From e998ce9b6e0e58403e8d8777d0c57c8ff7e7dba3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 6 Aug 2026 00:20:00 +0000 Subject: [PATCH] chore: update to latest Copilot LSP --- .release-please-manifest.json | 2 +- copilot/js/main.js | 1610 ++++++++++++++++----------------- lua/copilot/util.lua | 2 +- 3 files changed, 807 insertions(+), 807 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d4f6f299..930cf0f4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.0.0" + ".": "3.0.3" } diff --git a/copilot/js/main.js b/copilot/js/main.js index 2e4a8383..c0ce7ed5 100644 --- a/copilot/js/main.js +++ b/copilot/js/main.js @@ -1,17 +1,17 @@ -"use strict";var ego=Object.create;var $be=Object.defineProperty;var tgo=Object.getOwnPropertyDescriptor;var rgo=Object.getOwnPropertyNames;var ngo=Object.getPrototypeOf,igo=Object.prototype.hasOwnProperty;var A$r=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),y$r=t=>{throw TypeError(t)};var a=(t,e)=>$be(t,"name",{value:e,configurable:!0});var Se=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var I=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ti=(t,e)=>{for(var r in e)$be(t,r,{get:e[r],enumerable:!0})},_$r=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of rgo(e))!igo.call(t,o)&&o!==r&&$be(t,o,{get:()=>e[o],enumerable:!(n=tgo(e,o))||n.enumerable});return t};var fe=(t,e,r)=>(r=t!=null?ego(ngo(t)):{},_$r(e||!t||!t.__esModule?$be(r,"default",{value:t,enumerable:!0}):r,t)),Wa=t=>_$r($be({},"__esModule",{value:!0}),t);var mDt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&y$r("Object expected");var n,o;r&&(n=e[A$r("asyncDispose")]),n===void 0&&(n=e[A$r("dispose")],r&&(o=n)),typeof n!="function"&&y$r("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(s){return Promise.reject(s)}}),t.push([r,n,e])}else r&&t.push([r]);return e},gDt=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),s=c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e};return s()};var importMetaUrlShim,p=Se(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var w$r,R$r=Se(()=>{p();w$r="ffffffff-ffff-ffff-ffff-ffffffffffff"});var k$r,P$r=Se(()=>{p();k$r="00000000-0000-0000-0000-000000000000"});var D$r,N$r=Se(()=>{p();D$r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});function ggo(t){return typeof t=="string"&&D$r.test(t)}var q9,Vbe=Se(()=>{p();N$r();a(ggo,"validate");q9=ggo});function Ago(t){if(!q9(t))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(t.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(t.slice(9,13),16))>>>8,e&255,(e=parseInt(t.slice(14,18),16))>>>8,e&255,(e=parseInt(t.slice(19,23),16))>>>8,e&255,(e=parseInt(t.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}var OB,Wbe=Se(()=>{p();Vbe();a(Ago,"parse");OB=Ago});function PE(t,e=0){return(bA[t[e+0]]+bA[t[e+1]]+bA[t[e+2]]+bA[t[e+3]]+"-"+bA[t[e+4]]+bA[t[e+5]]+"-"+bA[t[e+6]]+bA[t[e+7]]+"-"+bA[t[e+8]]+bA[t[e+9]]+"-"+bA[t[e+10]]+bA[t[e+11]]+bA[t[e+12]]+bA[t[e+13]]+bA[t[e+14]]+bA[t[e+15]]).toLowerCase()}function ygo(t,e=0){let r=PE(t,e);if(!q9(r))throw TypeError("Stringified UUID is invalid");return r}var bA,M$r,LB=Se(()=>{p();Vbe();bA=[];for(let t=0;t<256;++t)bA.push((t+256).toString(16).slice(1));a(PE,"unsafeStringify");a(ygo,"stringify");M$r=ygo});function BB(){return crypto.getRandomValues(_go)}var _go,b9e=Se(()=>{p();_go=new Uint8Array(16);a(BB,"rng")});function Ego(t,e,r){let n,o=t?._v6??!1;if(t){let s=Object.keys(t);s.length===1&&s[0]==="_v6"&&(t=void 0)}if(t)n=O$r(t.random??t.rng?.()??BB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=BB();vgo(zbe,s,c),n=O$r(c,zbe.msecs,zbe.nsecs,o?void 0:zbe.clockseq,o?void 0:zbe.node,e,r)}return e??PE(n)}function vgo(t,e,r){return t.msecs??=-1/0,t.nsecs??=0,e===t.msecs?(t.nsecs++,t.nsecs>=1e4&&(t.node=void 0,t.nsecs=0)):e>t.msecs?t.nsecs=0:e= 16");if(!s)s=new Uint8Array(16),c=0;else if(c<0||c+16>s.length)throw new RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);e??=Date.now(),r??=0,n??=(t[8]<<8|t[9])&16383,o??=t.slice(10,16),e+=122192928e5;let l=((e&268435455)*1e4+r)%4294967296;s[c++]=l>>>24&255,s[c++]=l>>>16&255,s[c++]=l>>>8&255,s[c++]=l&255;let u=e/4294967296*1e4&268435455;s[c++]=u>>>8&255,s[c++]=u&255,s[c++]=u>>>24&15|16,s[c++]=u>>>16&255,s[c++]=n>>>8|128,s[c++]=n&255;for(let d=0;d<6;++d)s[c++]=o[d];return s}var zbe,S9e,vDt=Se(()=>{p();b9e();LB();zbe={};a(Ego,"v1");a(vgo,"updateV1State");a(O$r,"v1Bytes");S9e=Ego});function Ybe(t){let e=typeof t=="string"?OB(t):t,r=Cgo(e);return typeof t=="string"?PE(r):r}function Cgo(t){return Uint8Array.of((t[6]&15)<<4|t[7]>>4&15,(t[7]&15)<<4|(t[4]&240)>>4,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,(t[1]&15)<<4|(t[2]&240)>>4,96|t[2]&15,t[3],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}var CDt=Se(()=>{p();Wbe();LB();a(Ybe,"v1ToV6");a(Cgo,"_v1ToV6")});function bgo(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,L$r.createHash)("md5").update(t).digest()}var L$r,B$r,F$r=Se(()=>{p();L$r=require("node:crypto");a(bgo,"md5");B$r=bgo});function Sgo(t){t=unescape(encodeURIComponent(t));let e=new Uint8Array(t.length);for(let r=0;ro.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);for(let d=0;d<16;++d)o[s+d]=u[d];return o}return PE(u)}var T9e,I9e,bDt=Se(()=>{p();Wbe();LB();a(Sgo,"stringToBytes");T9e="6ba7b810-9dad-11d1-80b4-00c04fd430c8",I9e="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(Kbe,"v35")});function SDt(t,e,r,n){return Kbe(48,B$r,t,e,r,n)}var U$r,Q$r=Se(()=>{p();F$r();bDt();a(SDt,"v3");SDt.DNS=T9e;SDt.URL=I9e;U$r=SDt});function Tgo(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Igo(t,e,r)}function Igo(t,e,r){t=t||{};let n=t.random??t.rng?.()??BB();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[r+o]=n[o];return e}return PE(n)}var Dt,q$r=Se(()=>{p();b9e();LB();a(Tgo,"v4");a(Igo,"_v4");Dt=Tgo});function xgo(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,j$r.createHash)("sha1").update(t).digest()}var j$r,H$r,G$r=Se(()=>{p();j$r=require("node:crypto");a(xgo,"sha1");H$r=xgo});function TDt(t,e,r,n){return Kbe(80,H$r,t,e,r,n)}var $$r,V$r=Se(()=>{p();G$r();bDt();a(TDt,"v5");TDt.DNS=T9e;TDt.URL=I9e;$$r=TDt});function wgo(t,e,r){t??={},r??=0;let n=S9e({...t,_v6:!0},new Uint8Array(16));if(n=Ybe(n),e){if(r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;o++)e[r+o]=n[o];return e}return PE(n)}var W$r,z$r=Se(()=>{p();LB();vDt();CDt();a(wgo,"v6");W$r=wgo});function IDt(t){let e=typeof t=="string"?OB(t):t,r=Rgo(e);return typeof t=="string"?PE(r):r}function Rgo(t){return Uint8Array.of((t[3]&15)<<4|t[4]>>4&15,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|t[6]&15,t[7],(t[1]&15)<<4|(t[2]&240)>>4,(t[2]&15)<<4|(t[3]&240)>>4,16|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}var Y$r=Se(()=>{p();Wbe();LB();a(IDt,"v6ToV1");a(Rgo,"_v6ToV1")});function kgo(t,e,r){let n;if(t)n=K$r(t.random??t.rng?.()??BB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=BB();Pgo(xDt,o,s),n=K$r(s,xDt.msecs,xDt.seq,e,r)}return e??PE(n)}function Pgo(t,e,r){return t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],t.msecs=e):(t.seq=t.seq+1|0,t.seq===0&&t.msecs++),t}function K$r(t,e,r,n,o=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),o=0;else if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);return e??=Date.now(),r??=t[6]*127<<24|t[7]<<16|t[8]<<8|t[9],n[o++]=e/1099511627776&255,n[o++]=e/4294967296&255,n[o++]=e/16777216&255,n[o++]=e/65536&255,n[o++]=e/256&255,n[o++]=e&255,n[o++]=112|r>>>28&15,n[o++]=r>>>20&255,n[o++]=128|r>>>14&63,n[o++]=r>>>6&255,n[o++]=r<<2&255|t[10]&3,n[o++]=t[11],n[o++]=t[12],n[o++]=t[13],n[o++]=t[14],n[o++]=t[15],n}var xDt,J$r,Z$r=Se(()=>{p();b9e();LB();xDt={};a(kgo,"v7");a(Pgo,"updateV7State");a(K$r,"v7Bytes");J$r=kgo});function Dgo(t){if(!q9(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var X$r,eVr=Se(()=>{p();Vbe();a(Dgo,"version");X$r=Dgo});var Nc={};Ti(Nc,{MAX:()=>w$r,NIL:()=>k$r,parse:()=>OB,stringify:()=>M$r,v1:()=>S9e,v1ToV6:()=>Ybe,v3:()=>U$r,v4:()=>Dt,v5:()=>$$r,v6:()=>W$r,v6ToV1:()=>IDt,v7:()=>J$r,validate:()=>q9,version:()=>X$r});var Fo=Se(()=>{p();R$r();P$r();Wbe();LB();vDt();CDt();Q$r();q$r();V$r();z$r();Y$r();Z$r();Vbe();eVr()});var t0=I(wDt=>{"use strict";p();wDt.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((o,s)=>o!=null?n(o):r(s)),t.apply(this,e)})},"name",{value:t.name})};wDt.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var rVr=I((U0l,tVr)=>{p();var j9=require("constants"),Ngo=process.cwd,x9e=null,Mgo=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return x9e||(x9e=Ngo.call(process)),x9e};try{process.cwd()}catch{}typeof process.chdir=="function"&&(RDt=process.chdir,process.chdir=function(t){x9e=null,RDt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,RDt));var RDt;tVr.exports=Ogo;function Ogo(t){j9.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=c(t.chownSync),t.fchownSync=c(t.fchownSync),t.lchownSync=c(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=l(t.stat),t.fstat=l(t.fstat),t.lstat=l(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(f,h,m){m&&process.nextTick(m)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(f,h,m,g){g&&process.nextTick(g)},t.lchownSync=function(){}),Mgo==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(f){function h(m,g,A){var y=Date.now(),_=0;f(m,g,a(function E(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(g,function(S,T){S&&S.code==="ENOENT"?f(m,g,E):A(v)})},_),_<100&&(_+=10);return}A&&A(v)},"CB"))}return a(h,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(f){function h(m,g,A,y,_,E){var v;if(E&&typeof E=="function"){var S=0;v=a(function(T,w,R){if(T&&T.code==="EAGAIN"&&S<10)return S++,f.call(t,m,g,A,y,_,v);E.apply(this,arguments)},"callback")}return f.call(t,m,g,A,y,_,v)}return a(h,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(f){return function(h,m,g,A,y){for(var _=0;;)try{return f.call(t,h,m,g,A,y)}catch(E){if(E.code==="EAGAIN"&&_<10){_++;continue}throw E}}})(t.readSync);function e(f){f.lchmod=function(h,m,g){f.open(h,j9.O_WRONLY|j9.O_SYMLINK,m,function(A,y){if(A){g&&g(A);return}f.fchmod(y,m,function(_){f.close(y,function(E){g&&g(_||E)})})})},f.lchmodSync=function(h,m){var g=f.openSync(h,j9.O_WRONLY|j9.O_SYMLINK,m),A=!0,y;try{y=f.fchmodSync(g,m),A=!1}finally{if(A)try{f.closeSync(g)}catch{}else f.closeSync(g)}return y}}a(e,"patchLchmod");function r(f){j9.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,j9.O_SYMLINK,function(y,_){if(y){A&&A(y);return}f.futimes(_,m,g,function(E){f.close(_,function(v){A&&A(E||v)})})})},f.lutimesSync=function(h,m,g){var A=f.openSync(h,j9.O_SYMLINK),y,_=!0;try{y=f.futimesSync(A,m,g),_=!1}finally{if(_)try{f.closeSync(A)}catch{}else f.closeSync(A)}return y}):f.futimes&&(f.lutimes=function(h,m,g,A){A&&process.nextTick(A)},f.lutimesSync=function(){})}a(r,"patchLutimes");function n(f){return f&&function(h,m,g){return f.call(t,h,m,function(A){d(A)&&(A=null),g&&g.apply(this,arguments)})}}a(n,"chmodFix");function o(f){return f&&function(h,m){try{return f.call(t,h,m)}catch(g){if(!d(g))throw g}}}a(o,"chmodFixSync");function s(f){return f&&function(h,m,g,A){return f.call(t,h,m,g,function(y){d(y)&&(y=null),A&&A.apply(this,arguments)})}}a(s,"chownFix");function c(f){return f&&function(h,m,g){try{return f.call(t,h,m,g)}catch(A){if(!d(A))throw A}}}a(c,"chownFixSync");function l(f){return f&&function(h,m,g){typeof m=="function"&&(g=m,m=null);function A(y,_){_&&(_.uid<0&&(_.uid+=4294967296),_.gid<0&&(_.gid+=4294967296)),g&&g.apply(this,arguments)}return a(A,"callback"),m?f.call(t,h,m,A):f.call(t,h,A)}}a(l,"statFix");function u(f){return f&&function(h,m){var g=m?f.call(t,h,m):f.call(t,h);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}a(u,"statFixSync");function d(f){if(!f||f.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(f.code==="EINVAL"||f.code==="EPERM"))}a(d,"chownErOk")}a(Ogo,"patch")});var oVr=I((j0l,iVr)=>{p();var nVr=require("stream").Stream;iVr.exports=Lgo;function Lgo(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);nVr.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,o=o||{};for(var c=Object.keys(o),l=0,u=c.length;lthis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(f,h){if(f){s.emit("error",f),s.readable=!1;return}s.fd=h,s.emit("open",h),s._read()})}function r(n,o){if(!(this instanceof r))return new r(n,o);nVr.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};for(var s=Object.keys(o),c=0,l=s.length;c= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(Lgo,"legacy")});var aVr=I(($0l,sVr)=>{"use strict";p();sVr.exports=Fgo;var Bgo=Object.getPrototypeOf||function(t){return t.__proto__};function Fgo(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Bgo(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a(Fgo,"clone")});var hse=I((z0l,DDt)=>{p();var yf=require("fs"),Ugo=rVr(),Qgo=oVr(),qgo=aVr(),w9e=require("util"),SA,k9e;typeof Symbol=="function"&&typeof Symbol.for=="function"?(SA=Symbol.for("graceful-fs.queue"),k9e=Symbol.for("graceful-fs.previous")):(SA="___graceful-fs.queue",k9e="___graceful-fs.previous");function jgo(){}a(jgo,"noop");function uVr(t,e){Object.defineProperty(t,SA,{get:a(function(){return e},"get")})}a(uVr,"publishQueue");var Ez=jgo;w9e.debuglog?Ez=w9e.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ez=a(function(){var t=w9e.format.apply(w9e,arguments);t="GFS4: "+t.split(/\n/).join(` -GFS4: `),console.error(t)},"debug"));yf[SA]||(cVr=global[SA]||[],uVr(yf,cVr),yf.close=(function(t){function e(r,n){return t.call(yf,r,function(o){o||lVr(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,k9e,{value:t}),e})(yf.close),yf.closeSync=(function(t){function e(r){t.apply(yf,arguments),lVr()}return a(e,"closeSync"),Object.defineProperty(e,k9e,{value:t}),e})(yf.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ez(yf[SA]),require("assert").equal(yf[SA].length,0)}));var cVr;global[SA]||uVr(global,yf[SA]);DDt.exports=kDt(qgo(yf));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yf.__patched&&(DDt.exports=kDt(yf),yf.__patched=!0);function kDt(t){Ugo(t),t.gracefulify=kDt,t.createReadStream=w,t.createWriteStream=R;var e=t.readFile;t.readFile=r;function r(D,N,O){return typeof N=="function"&&(O=N,N=null),B(D,N,O);function B(q,M,L,U){return e(q,M,function(j){j&&(j.code==="EMFILE"||j.code==="ENFILE")?pse([B,[q,M,L],j,U||Date.now(),Date.now()]):typeof L=="function"&&L.apply(this,arguments)})}a(B,"go$readFile")}a(r,"readFile");var n=t.writeFile;t.writeFile=o;function o(D,N,O,B){return typeof O=="function"&&(B=O,O=null),q(D,N,O,B);function q(M,L,U,j,Q){return n(M,L,U,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?pse([q,[M,L,U,j],Y,Q||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments)})}a(q,"go$writeFile")}a(o,"writeFile");var s=t.appendFile;s&&(t.appendFile=c);function c(D,N,O,B){return typeof O=="function"&&(B=O,O=null),q(D,N,O,B);function q(M,L,U,j,Q){return s(M,L,U,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?pse([q,[M,L,U,j],Y,Q||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments)})}a(q,"go$appendFile")}a(c,"appendFile");var l=t.copyFile;l&&(t.copyFile=u);function u(D,N,O,B){return typeof O=="function"&&(B=O,O=0),q(D,N,O,B);function q(M,L,U,j,Q){return l(M,L,U,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?pse([q,[M,L,U,j],Y,Q||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments)})}a(q,"go$copyFile")}a(u,"copyFile");var d=t.readdir;t.readdir=h;var f=/^v[0-5]\./;function h(D,N,O){typeof N=="function"&&(O=N,N=null);var B=f.test(process.version)?a(function(L,U,j,Q){return d(L,q(L,U,j,Q))},"go$readdir"):a(function(L,U,j,Q){return d(L,U,q(L,U,j,Q))},"go$readdir");return B(D,N,O);function q(M,L,U,j){return function(Q,Y){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?pse([B,[M,L,U],Q,j||Date.now(),Date.now()]):(Y&&Y.sort&&Y.sort(),typeof U=="function"&&U.call(this,Q,Y))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=Qgo(t);E=m.ReadStream,S=m.WriteStream}var g=t.ReadStream;g&&(E.prototype=Object.create(g.prototype),E.prototype.open=v);var A=t.WriteStream;A&&(S.prototype=Object.create(A.prototype),S.prototype.open=T),Object.defineProperty(t,"ReadStream",{get:a(function(){return E},"get"),set:a(function(D){E=D},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:a(function(){return S},"get"),set:a(function(D){S=D},"set"),enumerable:!0,configurable:!0});var y=E;Object.defineProperty(t,"FileReadStream",{get:a(function(){return y},"get"),set:a(function(D){y=D},"set"),enumerable:!0,configurable:!0});var _=S;Object.defineProperty(t,"FileWriteStream",{get:a(function(){return _},"get"),set:a(function(D){_=D},"set"),enumerable:!0,configurable:!0});function E(D,N){return this instanceof E?(g.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}a(E,"ReadStream");function v(){var D=this;k(D.path,D.flags,D.mode,function(N,O){N?(D.autoClose&&D.destroy(),D.emit("error",N)):(D.fd=O,D.emit("open",O),D.read())})}a(v,"ReadStream$open");function S(D,N){return this instanceof S?(A.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}a(S,"WriteStream");function T(){var D=this;k(D.path,D.flags,D.mode,function(N,O){N?(D.destroy(),D.emit("error",N)):(D.fd=O,D.emit("open",O))})}a(T,"WriteStream$open");function w(D,N){return new t.ReadStream(D,N)}a(w,"createReadStream");function R(D,N){return new t.WriteStream(D,N)}a(R,"createWriteStream");var x=t.open;t.open=k;function k(D,N,O,B){return typeof O=="function"&&(B=O,O=null),q(D,N,O,B);function q(M,L,U,j,Q){return x(M,L,U,function(Y,W){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?pse([q,[M,L,U,j],Y,Q||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments)})}a(q,"go$open")}return a(k,"open"),t}a(kDt,"patch");function pse(t){Ez("ENQUEUE",t[0].name,t[1]),yf[SA].push(t),PDt()}a(pse,"enqueue");var R9e;function lVr(){for(var t=Date.now(),e=0;e2&&(yf[SA][e][3]=t,yf[SA][e][4]=t);PDt()}a(lVr,"resetQueue");function PDt(){if(clearTimeout(R9e),R9e=void 0,yf[SA].length!==0){var t=yf[SA].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)Ez("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){Ez("TIMEOUT",e.name,r);var c=r.pop();typeof c=="function"&&c.call(null,n)}else{var l=Date.now()-s,u=Math.max(s-o,1),d=Math.min(u*1.2,100);l>=d?(Ez("RETRY",e.name,r),e.apply(null,r.concat([o]))):yf[SA].push(t)}R9e===void 0&&(R9e=setTimeout(PDt,0))}}a(PDt,"retry")});var NE=I(FB=>{"use strict";p();var dVr=t0().fromCallback,DE=hse(),Hgo=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof DE[t]=="function");Object.assign(FB,DE);Hgo.forEach(t=>{FB[t]=dVr(DE[t])});FB.exists=function(t,e){return typeof e=="function"?DE.exists(t,e):new Promise(r=>DE.exists(t,r))};FB.read=function(t,e,r,n,o,s){return typeof s=="function"?DE.read(t,e,r,n,o,s):new Promise((c,l)=>{DE.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};FB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?DE.write(t,e,...r):new Promise((n,o)=>{DE.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};FB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?DE.readv(t,e,...r):new Promise((n,o)=>{DE.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};FB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?DE.writev(t,e,...r):new Promise((n,o)=>{DE.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof DE.realpath.native=="function"?FB.realpath.native=dVr(DE.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var pVr=I((X0l,fVr)=>{"use strict";p();var Ggo=require("path");fVr.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Ggo.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var AVr=I((rAl,NDt)=>{"use strict";p();var hVr=NE(),{checkPath:mVr}=pVr(),gVr=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");NDt.exports.makeDir=async(t,e)=>(mVr(t),hVr.mkdir(t,{mode:gVr(e),recursive:!0}));NDt.exports.makeDirSync=(t,e)=>(mVr(t),hVr.mkdirSync(t,{mode:gVr(e),recursive:!0}))});var oP=I((oAl,yVr)=>{"use strict";p();var $go=t0().fromPromise,{makeDir:Vgo,makeDirSync:MDt}=AVr(),ODt=$go(Vgo);yVr.exports={mkdirs:ODt,mkdirsSync:MDt,mkdirp:ODt,mkdirpSync:MDt,ensureDir:ODt,ensureDirSync:MDt}});var H9=I((aAl,EVr)=>{"use strict";p();var Wgo=t0().fromPromise,_Vr=NE();function zgo(t){return _Vr.access(t).then(()=>!0).catch(()=>!1)}a(zgo,"pathExists");EVr.exports={pathExists:Wgo(zgo),pathExistsSync:_Vr.existsSync}});var LDt=I((uAl,vVr)=>{"use strict";p();var mse=NE(),Ygo=t0().fromPromise;async function Kgo(t,e,r){let n=await mse.open(t,"r+"),o=null;try{await mse.futimes(n,e,r)}finally{try{await mse.close(n)}catch(s){o=s}}if(o)throw o}a(Kgo,"utimesMillis");function Jgo(t,e,r){let n=mse.openSync(t,"r+");return mse.futimesSync(n,e,r),mse.closeSync(n)}a(Jgo,"utimesMillisSync");vVr.exports={utimesMillis:Ygo(Kgo),utimesMillisSync:Jgo}});var vz=I((pAl,TVr)=>{"use strict";p();var gse=NE(),r0=require("path"),CVr=t0().fromPromise;function Zgo(t,e,r){let n=r.dereference?o=>gse.stat(o,{bigint:!0}):o=>gse.lstat(o,{bigint:!0});return Promise.all([n(t),n(e).catch(o=>{if(o.code==="ENOENT")return null;throw o})]).then(([o,s])=>({srcStat:o,destStat:s}))}a(Zgo,"getStats");function Xgo(t,e,r){let n,o=r.dereference?c=>gse.statSync(c,{bigint:!0}):c=>gse.lstatSync(c,{bigint:!0}),s=o(t);try{n=o(e)}catch(c){if(c.code==="ENOENT")return{srcStat:s,destStat:null};throw c}return{srcStat:s,destStat:n}}a(Xgo,"getStatsSync");async function e0o(t,e,r,n){let{srcStat:o,destStat:s}=await Zgo(t,e,n);if(s){if(Jbe(o,s)){let c=r0.basename(t),l=r0.basename(e);if(r==="move"&&c!==l&&c.toLowerCase()===l.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!o.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(o.isDirectory()&&BDt(t,e))throw new Error(P9e(t,e,r));return{srcStat:o,destStat:s}}a(e0o,"checkPaths");function t0o(t,e,r,n){let{srcStat:o,destStat:s}=Xgo(t,e,n);if(s){if(Jbe(o,s)){let c=r0.basename(t),l=r0.basename(e);if(r==="move"&&c!==l&&c.toLowerCase()===l.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!o.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(o.isDirectory()&&BDt(t,e))throw new Error(P9e(t,e,r));return{srcStat:o,destStat:s}}a(t0o,"checkPathsSync");async function bVr(t,e,r,n){let o=r0.resolve(r0.dirname(t)),s=r0.resolve(r0.dirname(r));if(s===o||s===r0.parse(s).root)return;let c;try{c=await gse.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(Jbe(e,c))throw new Error(P9e(t,r,n));return bVr(t,e,s,n)}a(bVr,"checkParentPaths");function SVr(t,e,r,n){let o=r0.resolve(r0.dirname(t)),s=r0.resolve(r0.dirname(r));if(s===o||s===r0.parse(s).root)return;let c;try{c=gse.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(Jbe(e,c))throw new Error(P9e(t,r,n));return SVr(t,e,s,n)}a(SVr,"checkParentPathsSync");function Jbe(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(Jbe,"areIdentical");function BDt(t,e){let r=r0.resolve(t).split(r0.sep).filter(o=>o),n=r0.resolve(e).split(r0.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(BDt,"isSrcSubdir");function P9e(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a(P9e,"errMsg");TVr.exports={checkPaths:CVr(e0o),checkPathsSync:t0o,checkParentPaths:CVr(bVr),checkParentPathsSync:SVr,isSrcSubdir:BDt,areIdentical:Jbe}});var xVr=I((gAl,IVr)=>{"use strict";p();async function r0o(t,e){let r=[];for await(let n of t)r.push(e(n).then(()=>null,o=>o??new Error("unknown error")));await Promise.all(r.map(n=>n.then(o=>{if(o!==null)throw o})))}a(r0o,"asyncIteratorConcurrentProcess");IVr.exports={asyncIteratorConcurrentProcess:r0o}});var DVr=I((_Al,PVr)=>{"use strict";p();var Jy=NE(),Zbe=require("path"),{mkdirs:n0o}=oP(),{pathExists:i0o}=H9(),{utimesMillis:o0o}=LDt(),Xbe=vz(),{asyncIteratorConcurrentProcess:s0o}=xVr();async function a0o(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; +"use strict";var rgo=Object.create;var $be=Object.defineProperty;var ngo=Object.getOwnPropertyDescriptor;var igo=Object.getOwnPropertyNames;var ogo=Object.getPrototypeOf,sgo=Object.prototype.hasOwnProperty;var y$r=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),_$r=t=>{throw TypeError(t)};var a=(t,e)=>$be(t,"name",{value:e,configurable:!0});var Se=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var I=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ti=(t,e)=>{for(var r in e)$be(t,r,{get:e[r],enumerable:!0})},E$r=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of igo(e))!sgo.call(t,o)&&o!==r&&$be(t,o,{get:()=>e[o],enumerable:!(n=ngo(e,o))||n.enumerable});return t};var fe=(t,e,r)=>(r=t!=null?rgo(ogo(t)):{},E$r(e||!t||!t.__esModule?$be(r,"default",{value:t,enumerable:!0}):r,t)),Wa=t=>E$r($be({},"__esModule",{value:!0}),t);var gDt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&_$r("Object expected");var n,o;r&&(n=e[y$r("asyncDispose")]),n===void 0&&(n=e[y$r("dispose")],r&&(o=n)),typeof n!="function"&&_$r("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(s){return Promise.reject(s)}}),t.push([r,n,e])}else r&&t.push([r]);return e},ADt=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),s=c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e};return s()};var importMetaUrlShim,p=Se(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var R$r,k$r=Se(()=>{p();R$r="ffffffff-ffff-ffff-ffff-ffffffffffff"});var P$r,D$r=Se(()=>{p();P$r="00000000-0000-0000-0000-000000000000"});var N$r,M$r=Se(()=>{p();N$r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});function ygo(t){return typeof t=="string"&&N$r.test(t)}var q9,Vbe=Se(()=>{p();M$r();a(ygo,"validate");q9=ygo});function _go(t){if(!q9(t))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(t.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(t.slice(9,13),16))>>>8,e&255,(e=parseInt(t.slice(14,18),16))>>>8,e&255,(e=parseInt(t.slice(19,23),16))>>>8,e&255,(e=parseInt(t.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}var OB,Wbe=Se(()=>{p();Vbe();a(_go,"parse");OB=_go});function PE(t,e=0){return(bA[t[e+0]]+bA[t[e+1]]+bA[t[e+2]]+bA[t[e+3]]+"-"+bA[t[e+4]]+bA[t[e+5]]+"-"+bA[t[e+6]]+bA[t[e+7]]+"-"+bA[t[e+8]]+bA[t[e+9]]+"-"+bA[t[e+10]]+bA[t[e+11]]+bA[t[e+12]]+bA[t[e+13]]+bA[t[e+14]]+bA[t[e+15]]).toLowerCase()}function Ego(t,e=0){let r=PE(t,e);if(!q9(r))throw TypeError("Stringified UUID is invalid");return r}var bA,O$r,LB=Se(()=>{p();Vbe();bA=[];for(let t=0;t<256;++t)bA.push((t+256).toString(16).slice(1));a(PE,"unsafeStringify");a(Ego,"stringify");O$r=Ego});function BB(){return crypto.getRandomValues(vgo)}var vgo,b9e=Se(()=>{p();vgo=new Uint8Array(16);a(BB,"rng")});function Cgo(t,e,r){let n,o=t?._v6??!1;if(t){let s=Object.keys(t);s.length===1&&s[0]==="_v6"&&(t=void 0)}if(t)n=L$r(t.random??t.rng?.()??BB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=BB();bgo(zbe,s,c),n=L$r(c,zbe.msecs,zbe.nsecs,o?void 0:zbe.clockseq,o?void 0:zbe.node,e,r)}return e??PE(n)}function bgo(t,e,r){return t.msecs??=-1/0,t.nsecs??=0,e===t.msecs?(t.nsecs++,t.nsecs>=1e4&&(t.node=void 0,t.nsecs=0)):e>t.msecs?t.nsecs=0:e= 16");if(!s)s=new Uint8Array(16),c=0;else if(c<0||c+16>s.length)throw new RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);e??=Date.now(),r??=0,n??=(t[8]<<8|t[9])&16383,o??=t.slice(10,16),e+=122192928e5;let l=((e&268435455)*1e4+r)%4294967296;s[c++]=l>>>24&255,s[c++]=l>>>16&255,s[c++]=l>>>8&255,s[c++]=l&255;let u=e/4294967296*1e4&268435455;s[c++]=u>>>8&255,s[c++]=u&255,s[c++]=u>>>24&15|16,s[c++]=u>>>16&255,s[c++]=n>>>8|128,s[c++]=n&255;for(let d=0;d<6;++d)s[c++]=o[d];return s}var zbe,S9e,CDt=Se(()=>{p();b9e();LB();zbe={};a(Cgo,"v1");a(bgo,"updateV1State");a(L$r,"v1Bytes");S9e=Cgo});function Ybe(t){let e=typeof t=="string"?OB(t):t,r=Sgo(e);return typeof t=="string"?PE(r):r}function Sgo(t){return Uint8Array.of((t[6]&15)<<4|t[7]>>4&15,(t[7]&15)<<4|(t[4]&240)>>4,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,(t[1]&15)<<4|(t[2]&240)>>4,96|t[2]&15,t[3],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}var bDt=Se(()=>{p();Wbe();LB();a(Ybe,"v1ToV6");a(Sgo,"_v1ToV6")});function Tgo(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,B$r.createHash)("md5").update(t).digest()}var B$r,F$r,U$r=Se(()=>{p();B$r=require("node:crypto");a(Tgo,"md5");F$r=Tgo});function Igo(t){t=unescape(encodeURIComponent(t));let e=new Uint8Array(t.length);for(let r=0;ro.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);for(let d=0;d<16;++d)o[s+d]=u[d];return o}return PE(u)}var T9e,I9e,SDt=Se(()=>{p();Wbe();LB();a(Igo,"stringToBytes");T9e="6ba7b810-9dad-11d1-80b4-00c04fd430c8",I9e="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(Kbe,"v35")});function TDt(t,e,r,n){return Kbe(48,F$r,t,e,r,n)}var Q$r,q$r=Se(()=>{p();U$r();SDt();a(TDt,"v3");TDt.DNS=T9e;TDt.URL=I9e;Q$r=TDt});function xgo(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():wgo(t,e,r)}function wgo(t,e,r){t=t||{};let n=t.random??t.rng?.()??BB();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[r+o]=n[o];return e}return PE(n)}var Dt,j$r=Se(()=>{p();b9e();LB();a(xgo,"v4");a(wgo,"_v4");Dt=xgo});function Rgo(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,H$r.createHash)("sha1").update(t).digest()}var H$r,G$r,$$r=Se(()=>{p();H$r=require("node:crypto");a(Rgo,"sha1");G$r=Rgo});function IDt(t,e,r,n){return Kbe(80,G$r,t,e,r,n)}var V$r,W$r=Se(()=>{p();$$r();SDt();a(IDt,"v5");IDt.DNS=T9e;IDt.URL=I9e;V$r=IDt});function kgo(t,e,r){t??={},r??=0;let n=S9e({...t,_v6:!0},new Uint8Array(16));if(n=Ybe(n),e){if(r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;o++)e[r+o]=n[o];return e}return PE(n)}var z$r,Y$r=Se(()=>{p();LB();CDt();bDt();a(kgo,"v6");z$r=kgo});function xDt(t){let e=typeof t=="string"?OB(t):t,r=Pgo(e);return typeof t=="string"?PE(r):r}function Pgo(t){return Uint8Array.of((t[3]&15)<<4|t[4]>>4&15,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|t[6]&15,t[7],(t[1]&15)<<4|(t[2]&240)>>4,(t[2]&15)<<4|(t[3]&240)>>4,16|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}var K$r=Se(()=>{p();Wbe();LB();a(xDt,"v6ToV1");a(Pgo,"_v6ToV1")});function Dgo(t,e,r){let n;if(t)n=J$r(t.random??t.rng?.()??BB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=BB();Ngo(wDt,o,s),n=J$r(s,wDt.msecs,wDt.seq,e,r)}return e??PE(n)}function Ngo(t,e,r){return t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],t.msecs=e):(t.seq=t.seq+1|0,t.seq===0&&t.msecs++),t}function J$r(t,e,r,n,o=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),o=0;else if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);return e??=Date.now(),r??=t[6]*127<<24|t[7]<<16|t[8]<<8|t[9],n[o++]=e/1099511627776&255,n[o++]=e/4294967296&255,n[o++]=e/16777216&255,n[o++]=e/65536&255,n[o++]=e/256&255,n[o++]=e&255,n[o++]=112|r>>>28&15,n[o++]=r>>>20&255,n[o++]=128|r>>>14&63,n[o++]=r>>>6&255,n[o++]=r<<2&255|t[10]&3,n[o++]=t[11],n[o++]=t[12],n[o++]=t[13],n[o++]=t[14],n[o++]=t[15],n}var wDt,Z$r,X$r=Se(()=>{p();b9e();LB();wDt={};a(Dgo,"v7");a(Ngo,"updateV7State");a(J$r,"v7Bytes");Z$r=Dgo});function Mgo(t){if(!q9(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var eVr,tVr=Se(()=>{p();Vbe();a(Mgo,"version");eVr=Mgo});var Nc={};Ti(Nc,{MAX:()=>R$r,NIL:()=>P$r,parse:()=>OB,stringify:()=>O$r,v1:()=>S9e,v1ToV6:()=>Ybe,v3:()=>Q$r,v4:()=>Dt,v5:()=>V$r,v6:()=>z$r,v6ToV1:()=>xDt,v7:()=>Z$r,validate:()=>q9,version:()=>eVr});var Fo=Se(()=>{p();k$r();D$r();Wbe();LB();CDt();bDt();q$r();j$r();W$r();Y$r();K$r();X$r();Vbe();tVr()});var r0=I(RDt=>{"use strict";p();RDt.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((o,s)=>o!=null?n(o):r(s)),t.apply(this,e)})},"name",{value:t.name})};RDt.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var nVr=I((q0l,rVr)=>{p();var j9=require("constants"),Ogo=process.cwd,x9e=null,Lgo=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return x9e||(x9e=Ogo.call(process)),x9e};try{process.cwd()}catch{}typeof process.chdir=="function"&&(kDt=process.chdir,process.chdir=function(t){x9e=null,kDt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,kDt));var kDt;rVr.exports=Bgo;function Bgo(t){j9.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=c(t.chownSync),t.fchownSync=c(t.fchownSync),t.lchownSync=c(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=l(t.stat),t.fstat=l(t.fstat),t.lstat=l(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(f,h,m){m&&process.nextTick(m)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(f,h,m,g){g&&process.nextTick(g)},t.lchownSync=function(){}),Lgo==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(f){function h(m,g,A){var y=Date.now(),_=0;f(m,g,a(function E(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(g,function(S,T){S&&S.code==="ENOENT"?f(m,g,E):A(v)})},_),_<100&&(_+=10);return}A&&A(v)},"CB"))}return a(h,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(f){function h(m,g,A,y,_,E){var v;if(E&&typeof E=="function"){var S=0;v=a(function(T,w,R){if(T&&T.code==="EAGAIN"&&S<10)return S++,f.call(t,m,g,A,y,_,v);E.apply(this,arguments)},"callback")}return f.call(t,m,g,A,y,_,v)}return a(h,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(f){return function(h,m,g,A,y){for(var _=0;;)try{return f.call(t,h,m,g,A,y)}catch(E){if(E.code==="EAGAIN"&&_<10){_++;continue}throw E}}})(t.readSync);function e(f){f.lchmod=function(h,m,g){f.open(h,j9.O_WRONLY|j9.O_SYMLINK,m,function(A,y){if(A){g&&g(A);return}f.fchmod(y,m,function(_){f.close(y,function(E){g&&g(_||E)})})})},f.lchmodSync=function(h,m){var g=f.openSync(h,j9.O_WRONLY|j9.O_SYMLINK,m),A=!0,y;try{y=f.fchmodSync(g,m),A=!1}finally{if(A)try{f.closeSync(g)}catch{}else f.closeSync(g)}return y}}a(e,"patchLchmod");function r(f){j9.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,j9.O_SYMLINK,function(y,_){if(y){A&&A(y);return}f.futimes(_,m,g,function(E){f.close(_,function(v){A&&A(E||v)})})})},f.lutimesSync=function(h,m,g){var A=f.openSync(h,j9.O_SYMLINK),y,_=!0;try{y=f.futimesSync(A,m,g),_=!1}finally{if(_)try{f.closeSync(A)}catch{}else f.closeSync(A)}return y}):f.futimes&&(f.lutimes=function(h,m,g,A){A&&process.nextTick(A)},f.lutimesSync=function(){})}a(r,"patchLutimes");function n(f){return f&&function(h,m,g){return f.call(t,h,m,function(A){d(A)&&(A=null),g&&g.apply(this,arguments)})}}a(n,"chmodFix");function o(f){return f&&function(h,m){try{return f.call(t,h,m)}catch(g){if(!d(g))throw g}}}a(o,"chmodFixSync");function s(f){return f&&function(h,m,g,A){return f.call(t,h,m,g,function(y){d(y)&&(y=null),A&&A.apply(this,arguments)})}}a(s,"chownFix");function c(f){return f&&function(h,m,g){try{return f.call(t,h,m,g)}catch(A){if(!d(A))throw A}}}a(c,"chownFixSync");function l(f){return f&&function(h,m,g){typeof m=="function"&&(g=m,m=null);function A(y,_){_&&(_.uid<0&&(_.uid+=4294967296),_.gid<0&&(_.gid+=4294967296)),g&&g.apply(this,arguments)}return a(A,"callback"),m?f.call(t,h,m,A):f.call(t,h,A)}}a(l,"statFix");function u(f){return f&&function(h,m){var g=m?f.call(t,h,m):f.call(t,h);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}a(u,"statFixSync");function d(f){if(!f||f.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(f.code==="EINVAL"||f.code==="EPERM"))}a(d,"chownErOk")}a(Bgo,"patch")});var sVr=I((G0l,oVr)=>{p();var iVr=require("stream").Stream;oVr.exports=Fgo;function Fgo(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);iVr.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,o=o||{};for(var c=Object.keys(o),l=0,u=c.length;lthis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(f,h){if(f){s.emit("error",f),s.readable=!1;return}s.fd=h,s.emit("open",h),s._read()})}function r(n,o){if(!(this instanceof r))return new r(n,o);iVr.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};for(var s=Object.keys(o),c=0,l=s.length;c= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(Fgo,"legacy")});var cVr=I((W0l,aVr)=>{"use strict";p();aVr.exports=Qgo;var Ugo=Object.getPrototypeOf||function(t){return t.__proto__};function Qgo(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Ugo(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a(Qgo,"clone")});var mse=I((K0l,NDt)=>{p();var yf=require("fs"),qgo=nVr(),jgo=sVr(),Hgo=cVr(),w9e=require("util"),SA,k9e;typeof Symbol=="function"&&typeof Symbol.for=="function"?(SA=Symbol.for("graceful-fs.queue"),k9e=Symbol.for("graceful-fs.previous")):(SA="___graceful-fs.queue",k9e="___graceful-fs.previous");function Ggo(){}a(Ggo,"noop");function dVr(t,e){Object.defineProperty(t,SA,{get:a(function(){return e},"get")})}a(dVr,"publishQueue");var vz=Ggo;w9e.debuglog?vz=w9e.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(vz=a(function(){var t=w9e.format.apply(w9e,arguments);t="GFS4: "+t.split(/\n/).join(` +GFS4: `),console.error(t)},"debug"));yf[SA]||(lVr=global[SA]||[],dVr(yf,lVr),yf.close=(function(t){function e(r,n){return t.call(yf,r,function(o){o||uVr(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,k9e,{value:t}),e})(yf.close),yf.closeSync=(function(t){function e(r){t.apply(yf,arguments),uVr()}return a(e,"closeSync"),Object.defineProperty(e,k9e,{value:t}),e})(yf.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){vz(yf[SA]),require("assert").equal(yf[SA].length,0)}));var lVr;global[SA]||dVr(global,yf[SA]);NDt.exports=PDt(Hgo(yf));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yf.__patched&&(NDt.exports=PDt(yf),yf.__patched=!0);function PDt(t){qgo(t),t.gracefulify=PDt,t.createReadStream=w,t.createWriteStream=R;var e=t.readFile;t.readFile=r;function r(D,N,O){return typeof N=="function"&&(O=N,N=null),B(D,N,O);function B(q,M,L,U){return e(q,M,function(j){j&&(j.code==="EMFILE"||j.code==="ENFILE")?hse([B,[q,M,L],j,U||Date.now(),Date.now()]):typeof L=="function"&&L.apply(this,arguments)})}a(B,"go$readFile")}a(r,"readFile");var n=t.writeFile;t.writeFile=o;function o(D,N,O,B){return typeof O=="function"&&(B=O,O=null),q(D,N,O,B);function q(M,L,U,j,Q){return n(M,L,U,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?hse([q,[M,L,U,j],Y,Q||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments)})}a(q,"go$writeFile")}a(o,"writeFile");var s=t.appendFile;s&&(t.appendFile=c);function c(D,N,O,B){return typeof O=="function"&&(B=O,O=null),q(D,N,O,B);function q(M,L,U,j,Q){return s(M,L,U,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?hse([q,[M,L,U,j],Y,Q||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments)})}a(q,"go$appendFile")}a(c,"appendFile");var l=t.copyFile;l&&(t.copyFile=u);function u(D,N,O,B){return typeof O=="function"&&(B=O,O=0),q(D,N,O,B);function q(M,L,U,j,Q){return l(M,L,U,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?hse([q,[M,L,U,j],Y,Q||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments)})}a(q,"go$copyFile")}a(u,"copyFile");var d=t.readdir;t.readdir=h;var f=/^v[0-5]\./;function h(D,N,O){typeof N=="function"&&(O=N,N=null);var B=f.test(process.version)?a(function(L,U,j,Q){return d(L,q(L,U,j,Q))},"go$readdir"):a(function(L,U,j,Q){return d(L,U,q(L,U,j,Q))},"go$readdir");return B(D,N,O);function q(M,L,U,j){return function(Q,Y){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?hse([B,[M,L,U],Q,j||Date.now(),Date.now()]):(Y&&Y.sort&&Y.sort(),typeof U=="function"&&U.call(this,Q,Y))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=jgo(t);E=m.ReadStream,S=m.WriteStream}var g=t.ReadStream;g&&(E.prototype=Object.create(g.prototype),E.prototype.open=v);var A=t.WriteStream;A&&(S.prototype=Object.create(A.prototype),S.prototype.open=T),Object.defineProperty(t,"ReadStream",{get:a(function(){return E},"get"),set:a(function(D){E=D},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:a(function(){return S},"get"),set:a(function(D){S=D},"set"),enumerable:!0,configurable:!0});var y=E;Object.defineProperty(t,"FileReadStream",{get:a(function(){return y},"get"),set:a(function(D){y=D},"set"),enumerable:!0,configurable:!0});var _=S;Object.defineProperty(t,"FileWriteStream",{get:a(function(){return _},"get"),set:a(function(D){_=D},"set"),enumerable:!0,configurable:!0});function E(D,N){return this instanceof E?(g.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}a(E,"ReadStream");function v(){var D=this;k(D.path,D.flags,D.mode,function(N,O){N?(D.autoClose&&D.destroy(),D.emit("error",N)):(D.fd=O,D.emit("open",O),D.read())})}a(v,"ReadStream$open");function S(D,N){return this instanceof S?(A.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}a(S,"WriteStream");function T(){var D=this;k(D.path,D.flags,D.mode,function(N,O){N?(D.destroy(),D.emit("error",N)):(D.fd=O,D.emit("open",O))})}a(T,"WriteStream$open");function w(D,N){return new t.ReadStream(D,N)}a(w,"createReadStream");function R(D,N){return new t.WriteStream(D,N)}a(R,"createWriteStream");var x=t.open;t.open=k;function k(D,N,O,B){return typeof O=="function"&&(B=O,O=null),q(D,N,O,B);function q(M,L,U,j,Q){return x(M,L,U,function(Y,W){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?hse([q,[M,L,U,j],Y,Q||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments)})}a(q,"go$open")}return a(k,"open"),t}a(PDt,"patch");function hse(t){vz("ENQUEUE",t[0].name,t[1]),yf[SA].push(t),DDt()}a(hse,"enqueue");var R9e;function uVr(){for(var t=Date.now(),e=0;e2&&(yf[SA][e][3]=t,yf[SA][e][4]=t);DDt()}a(uVr,"resetQueue");function DDt(){if(clearTimeout(R9e),R9e=void 0,yf[SA].length!==0){var t=yf[SA].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)vz("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){vz("TIMEOUT",e.name,r);var c=r.pop();typeof c=="function"&&c.call(null,n)}else{var l=Date.now()-s,u=Math.max(s-o,1),d=Math.min(u*1.2,100);l>=d?(vz("RETRY",e.name,r),e.apply(null,r.concat([o]))):yf[SA].push(t)}R9e===void 0&&(R9e=setTimeout(DDt,0))}}a(DDt,"retry")});var NE=I(FB=>{"use strict";p();var fVr=r0().fromCallback,DE=mse(),$go=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof DE[t]=="function");Object.assign(FB,DE);$go.forEach(t=>{FB[t]=fVr(DE[t])});FB.exists=function(t,e){return typeof e=="function"?DE.exists(t,e):new Promise(r=>DE.exists(t,r))};FB.read=function(t,e,r,n,o,s){return typeof s=="function"?DE.read(t,e,r,n,o,s):new Promise((c,l)=>{DE.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};FB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?DE.write(t,e,...r):new Promise((n,o)=>{DE.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};FB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?DE.readv(t,e,...r):new Promise((n,o)=>{DE.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};FB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?DE.writev(t,e,...r):new Promise((n,o)=>{DE.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof DE.realpath.native=="function"?FB.realpath.native=fVr(DE.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var hVr=I((tAl,pVr)=>{"use strict";p();var Vgo=require("path");pVr.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Vgo.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var yVr=I((iAl,MDt)=>{"use strict";p();var mVr=NE(),{checkPath:gVr}=hVr(),AVr=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");MDt.exports.makeDir=async(t,e)=>(gVr(t),mVr.mkdir(t,{mode:AVr(e),recursive:!0}));MDt.exports.makeDirSync=(t,e)=>(gVr(t),mVr.mkdirSync(t,{mode:AVr(e),recursive:!0}))});var oP=I((aAl,_Vr)=>{"use strict";p();var Wgo=r0().fromPromise,{makeDir:zgo,makeDirSync:ODt}=yVr(),LDt=Wgo(zgo);_Vr.exports={mkdirs:LDt,mkdirsSync:ODt,mkdirp:LDt,mkdirpSync:ODt,ensureDir:LDt,ensureDirSync:ODt}});var H9=I((lAl,vVr)=>{"use strict";p();var Ygo=r0().fromPromise,EVr=NE();function Kgo(t){return EVr.access(t).then(()=>!0).catch(()=>!1)}a(Kgo,"pathExists");vVr.exports={pathExists:Ygo(Kgo),pathExistsSync:EVr.existsSync}});var BDt=I((fAl,CVr)=>{"use strict";p();var gse=NE(),Jgo=r0().fromPromise;async function Zgo(t,e,r){let n=await gse.open(t,"r+"),o=null;try{await gse.futimes(n,e,r)}finally{try{await gse.close(n)}catch(s){o=s}}if(o)throw o}a(Zgo,"utimesMillis");function Xgo(t,e,r){let n=gse.openSync(t,"r+");return gse.futimesSync(n,e,r),gse.closeSync(n)}a(Xgo,"utimesMillisSync");CVr.exports={utimesMillis:Jgo(Zgo),utimesMillisSync:Xgo}});var Cz=I((mAl,IVr)=>{"use strict";p();var Ase=NE(),n0=require("path"),bVr=r0().fromPromise;function e0o(t,e,r){let n=r.dereference?o=>Ase.stat(o,{bigint:!0}):o=>Ase.lstat(o,{bigint:!0});return Promise.all([n(t),n(e).catch(o=>{if(o.code==="ENOENT")return null;throw o})]).then(([o,s])=>({srcStat:o,destStat:s}))}a(e0o,"getStats");function t0o(t,e,r){let n,o=r.dereference?c=>Ase.statSync(c,{bigint:!0}):c=>Ase.lstatSync(c,{bigint:!0}),s=o(t);try{n=o(e)}catch(c){if(c.code==="ENOENT")return{srcStat:s,destStat:null};throw c}return{srcStat:s,destStat:n}}a(t0o,"getStatsSync");async function r0o(t,e,r,n){let{srcStat:o,destStat:s}=await e0o(t,e,n);if(s){if(Jbe(o,s)){let c=n0.basename(t),l=n0.basename(e);if(r==="move"&&c!==l&&c.toLowerCase()===l.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!o.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(o.isDirectory()&&FDt(t,e))throw new Error(P9e(t,e,r));return{srcStat:o,destStat:s}}a(r0o,"checkPaths");function n0o(t,e,r,n){let{srcStat:o,destStat:s}=t0o(t,e,n);if(s){if(Jbe(o,s)){let c=n0.basename(t),l=n0.basename(e);if(r==="move"&&c!==l&&c.toLowerCase()===l.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!o.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(o.isDirectory()&&FDt(t,e))throw new Error(P9e(t,e,r));return{srcStat:o,destStat:s}}a(n0o,"checkPathsSync");async function SVr(t,e,r,n){let o=n0.resolve(n0.dirname(t)),s=n0.resolve(n0.dirname(r));if(s===o||s===n0.parse(s).root)return;let c;try{c=await Ase.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(Jbe(e,c))throw new Error(P9e(t,r,n));return SVr(t,e,s,n)}a(SVr,"checkParentPaths");function TVr(t,e,r,n){let o=n0.resolve(n0.dirname(t)),s=n0.resolve(n0.dirname(r));if(s===o||s===n0.parse(s).root)return;let c;try{c=Ase.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(Jbe(e,c))throw new Error(P9e(t,r,n));return TVr(t,e,s,n)}a(TVr,"checkParentPathsSync");function Jbe(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(Jbe,"areIdentical");function FDt(t,e){let r=n0.resolve(t).split(n0.sep).filter(o=>o),n=n0.resolve(e).split(n0.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(FDt,"isSrcSubdir");function P9e(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a(P9e,"errMsg");IVr.exports={checkPaths:bVr(r0o),checkPathsSync:n0o,checkParentPaths:bVr(SVr),checkParentPathsSync:TVr,isSrcSubdir:FDt,areIdentical:Jbe}});var wVr=I((yAl,xVr)=>{"use strict";p();async function i0o(t,e){let r=[];for await(let n of t)r.push(e(n).then(()=>null,o=>o??new Error("unknown error")));await Promise.all(r.map(n=>n.then(o=>{if(o!==null)throw o})))}a(i0o,"asyncIteratorConcurrentProcess");xVr.exports={asyncIteratorConcurrentProcess:i0o}});var NVr=I((vAl,DVr)=>{"use strict";p();var Jy=NE(),Zbe=require("path"),{mkdirs:o0o}=oP(),{pathExists:s0o}=H9(),{utimesMillis:a0o}=BDt(),Xbe=Cz(),{asyncIteratorConcurrentProcess:c0o}=wVr();async function l0o(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:o}=await Xbe.checkPaths(t,e,"copy",r);if(await Xbe.checkParentPaths(t,n,e,"copy"),!await RVr(t,e,r))return;let c=Zbe.dirname(e);await i0o(c)||await n0o(c),await kVr(o,t,e,r)}a(a0o,"copy");async function RVr(t,e,r){return r.filter?r.filter(t,e):!0}a(RVr,"runFilter");async function kVr(t,e,r,n){let s=await(n.dereference?Jy.stat:Jy.lstat)(e);if(s.isDirectory())return d0o(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return c0o(s,t,e,r,n);if(s.isSymbolicLink())return f0o(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(kVr,"getStatsAndPerformCopy");async function c0o(t,e,r,n,o){if(!e)return wVr(t,r,n,o);if(o.overwrite)return await Jy.unlink(n),wVr(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(c0o,"onFile");async function wVr(t,e,r,n){if(await Jy.copyFile(e,r),n.preserveTimestamps){l0o(t.mode)&&await u0o(r,t.mode);let o=await Jy.stat(e);await o0o(r,o.atime,o.mtime)}return Jy.chmod(r,t.mode)}a(wVr,"copyFile");function l0o(t){return(t&128)===0}a(l0o,"fileIsNotWritable");function u0o(t,e){return Jy.chmod(t,e|128)}a(u0o,"makeFileWritable");async function d0o(t,e,r,n,o){e||await Jy.mkdir(n),await s0o(await Jy.opendir(r),async s=>{let c=Zbe.join(r,s.name),l=Zbe.join(n,s.name);if(await RVr(c,l,o)){let{destStat:d}=await Xbe.checkPaths(c,l,"copy",o);await kVr(d,c,l,o)}}),e||await Jy.chmod(n,t.mode)}a(d0o,"onDir");async function f0o(t,e,r,n){let o=await Jy.readlink(e);if(n.dereference&&(o=Zbe.resolve(process.cwd(),o)),!t)return Jy.symlink(o,r);let s=null;try{s=await Jy.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return Jy.symlink(o,r);throw c}if(n.dereference&&(s=Zbe.resolve(process.cwd(),s)),o!==s){if(Xbe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(Xbe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return await Jy.unlink(r),Jy.symlink(o,r)}a(f0o,"onLink");PVr.exports=a0o});var BVr=I((CAl,LVr)=>{"use strict";p();var ME=hse(),eSe=require("path"),p0o=oP().mkdirsSync,h0o=LDt().utimesMillisSync,tSe=vz();function m0o(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; + see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:o}=await Xbe.checkPaths(t,e,"copy",r);if(await Xbe.checkParentPaths(t,n,e,"copy"),!await kVr(t,e,r))return;let c=Zbe.dirname(e);await s0o(c)||await o0o(c),await PVr(o,t,e,r)}a(l0o,"copy");async function kVr(t,e,r){return r.filter?r.filter(t,e):!0}a(kVr,"runFilter");async function PVr(t,e,r,n){let s=await(n.dereference?Jy.stat:Jy.lstat)(e);if(s.isDirectory())return p0o(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return u0o(s,t,e,r,n);if(s.isSymbolicLink())return h0o(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(PVr,"getStatsAndPerformCopy");async function u0o(t,e,r,n,o){if(!e)return RVr(t,r,n,o);if(o.overwrite)return await Jy.unlink(n),RVr(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(u0o,"onFile");async function RVr(t,e,r,n){if(await Jy.copyFile(e,r),n.preserveTimestamps){d0o(t.mode)&&await f0o(r,t.mode);let o=await Jy.stat(e);await a0o(r,o.atime,o.mtime)}return Jy.chmod(r,t.mode)}a(RVr,"copyFile");function d0o(t){return(t&128)===0}a(d0o,"fileIsNotWritable");function f0o(t,e){return Jy.chmod(t,e|128)}a(f0o,"makeFileWritable");async function p0o(t,e,r,n,o){e||await Jy.mkdir(n),await c0o(await Jy.opendir(r),async s=>{let c=Zbe.join(r,s.name),l=Zbe.join(n,s.name);if(await kVr(c,l,o)){let{destStat:d}=await Xbe.checkPaths(c,l,"copy",o);await PVr(d,c,l,o)}}),e||await Jy.chmod(n,t.mode)}a(p0o,"onDir");async function h0o(t,e,r,n){let o=await Jy.readlink(e);if(n.dereference&&(o=Zbe.resolve(process.cwd(),o)),!t)return Jy.symlink(o,r);let s=null;try{s=await Jy.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return Jy.symlink(o,r);throw c}if(n.dereference&&(s=Zbe.resolve(process.cwd(),s)),o!==s){if(Xbe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(Xbe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return await Jy.unlink(r),Jy.symlink(o,r)}a(h0o,"onLink");DVr.exports=l0o});var FVr=I((SAl,BVr)=>{"use strict";p();var ME=mse(),eSe=require("path"),m0o=oP().mkdirsSync,g0o=BDt().utimesMillisSync,tSe=Cz();function A0o(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:o}=tSe.checkPathsSync(t,e,"copy",r);if(tSe.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let s=eSe.dirname(e);return ME.existsSync(s)||p0o(s),NVr(o,t,e,r)}a(m0o,"copySync");function NVr(t,e,r,n){let s=(n.dereference?ME.statSync:ME.lstatSync)(e);if(s.isDirectory())return C0o(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return g0o(s,t,e,r,n);if(s.isSymbolicLink())return T0o(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(NVr,"getStats");function g0o(t,e,r,n,o){return e?A0o(t,r,n,o):MVr(t,r,n,o)}a(g0o,"onFile");function A0o(t,e,r,n){if(n.overwrite)return ME.unlinkSync(r),MVr(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}a(A0o,"mayCopyFile");function MVr(t,e,r,n){return ME.copyFileSync(e,r),n.preserveTimestamps&&y0o(t.mode,e,r),FDt(r,t.mode)}a(MVr,"copyFile");function y0o(t,e,r){return _0o(t)&&E0o(r,t),v0o(e,r)}a(y0o,"handleTimestamps");function _0o(t){return(t&128)===0}a(_0o,"fileIsNotWritable");function E0o(t,e){return FDt(t,e|128)}a(E0o,"makeFileWritable");function FDt(t,e){return ME.chmodSync(t,e)}a(FDt,"setDestMode");function v0o(t,e){let r=ME.statSync(t);return h0o(e,r.atime,r.mtime)}a(v0o,"setDestTimestamps");function C0o(t,e,r,n,o){return e?OVr(r,n,o):b0o(t.mode,r,n,o)}a(C0o,"onDir");function b0o(t,e,r,n){return ME.mkdirSync(r),OVr(e,r,n),FDt(r,t)}a(b0o,"mkDirAndCopy");function OVr(t,e,r){let n=ME.opendirSync(t);try{let o;for(;(o=n.readSync())!==null;)S0o(o.name,t,e,r)}finally{n.closeSync()}}a(OVr,"copyDir");function S0o(t,e,r,n){let o=eSe.join(e,t),s=eSe.join(r,t);if(n.filter&&!n.filter(o,s))return;let{destStat:c}=tSe.checkPathsSync(o,s,"copy",n);return NVr(c,o,s,n)}a(S0o,"copyDirItem");function T0o(t,e,r,n){let o=ME.readlinkSync(e);if(n.dereference&&(o=eSe.resolve(process.cwd(),o)),t){let s;try{s=ME.readlinkSync(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return ME.symlinkSync(o,r);throw c}if(n.dereference&&(s=eSe.resolve(process.cwd(),s)),o!==s){if(tSe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(tSe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return I0o(o,r)}else return ME.symlinkSync(o,r)}a(T0o,"onLink");function I0o(t,e){return ME.unlinkSync(e),ME.symlinkSync(t,e)}a(I0o,"copyLink");LVr.exports=m0o});var D9e=I((TAl,FVr)=>{"use strict";p();var x0o=t0().fromPromise;FVr.exports={copy:x0o(DVr()),copySync:BVr()}});var rSe=I((xAl,QVr)=>{"use strict";p();var UVr=hse(),w0o=t0().fromCallback;function R0o(t,e){UVr.rm(t,{recursive:!0,force:!0},e)}a(R0o,"remove");function k0o(t){UVr.rmSync(t,{recursive:!0,force:!0})}a(k0o,"removeSync");QVr.exports={remove:w0o(R0o),removeSync:k0o}});var zVr=I((kAl,WVr)=>{"use strict";p();var P0o=t0().fromPromise,HVr=NE(),GVr=require("path"),$Vr=oP(),VVr=rSe(),qVr=P0o(a(async function(e){let r;try{r=await HVr.readdir(e)}catch{return $Vr.mkdirs(e)}return Promise.all(r.map(n=>VVr.remove(GVr.join(e,n))))},"emptyDir"));function jVr(t){let e;try{e=HVr.readdirSync(t)}catch{return $Vr.mkdirsSync(t)}e.forEach(r=>{r=GVr.join(t,r),VVr.removeSync(r)})}a(jVr,"emptyDirSync");WVr.exports={emptyDirSync:jVr,emptydirSync:jVr,emptyDir:qVr,emptydir:qVr}});var ZVr=I((NAl,JVr)=>{"use strict";p();var D0o=t0().fromPromise,YVr=require("path"),UB=NE(),KVr=oP();async function N0o(t){let e;try{e=await UB.stat(t)}catch{}if(e&&e.isFile())return;let r=YVr.dirname(t),n=null;try{n=await UB.stat(r)}catch(o){if(o.code==="ENOENT"){await KVr.mkdirs(r),await UB.writeFile(t,"");return}else throw o}n.isDirectory()?await UB.writeFile(t,""):await UB.readdir(r)}a(N0o,"createFile");function M0o(t){let e;try{e=UB.statSync(t)}catch{}if(e&&e.isFile())return;let r=YVr.dirname(t);try{UB.statSync(r).isDirectory()||UB.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")KVr.mkdirsSync(r);else throw n}UB.writeFileSync(t,"")}a(M0o,"createFileSync");JVr.exports={createFile:D0o(N0o),createFileSync:M0o}});var nWr=I((LAl,rWr)=>{"use strict";p();var O0o=t0().fromPromise,XVr=require("path"),G9=NE(),eWr=oP(),{pathExists:L0o}=H9(),{areIdentical:tWr}=vz();async function B0o(t,e){let r;try{r=await G9.lstat(e)}catch{}let n;try{n=await G9.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&tWr(n,r))return;let o=XVr.dirname(e);await L0o(o)||await eWr.mkdirs(o),await G9.link(t,e)}a(B0o,"createLink");function F0o(t,e){let r;try{r=G9.lstatSync(e)}catch{}try{let s=G9.lstatSync(t);if(r&&tWr(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=XVr.dirname(e);return G9.existsSync(n)||eWr.mkdirsSync(n),G9.linkSync(t,e)}a(F0o,"createLinkSync");rWr.exports={createLink:O0o(B0o),createLinkSync:F0o}});var oWr=I((UAl,iWr)=>{"use strict";p();var $9=require("path"),nSe=NE(),{pathExists:U0o}=H9(),Q0o=t0().fromPromise;async function q0o(t,e){if($9.isAbsolute(t)){try{await nSe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=$9.dirname(e),n=$9.join(r,t);if(await U0o(n))return{toCwd:n,toDst:t};try{await nSe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:$9.relative(r,t)}}a(q0o,"symlinkPaths");function j0o(t,e){if($9.isAbsolute(t)){if(!nSe.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=$9.dirname(e),n=$9.join(r,t);if(nSe.existsSync(n))return{toCwd:n,toDst:t};if(!nSe.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:$9.relative(r,t)}}a(j0o,"symlinkPathsSync");iWr.exports={symlinkPaths:Q0o(q0o),symlinkPathsSync:j0o}});var cWr=I((jAl,aWr)=>{"use strict";p();var sWr=NE(),H0o=t0().fromPromise;async function G0o(t,e){if(e)return e;let r;try{r=await sWr.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(G0o,"symlinkType");function $0o(t,e){if(e)return e;let r;try{r=sWr.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a($0o,"symlinkTypeSync");aWr.exports={symlinkType:H0o(G0o),symlinkTypeSync:$0o}});var dWr=I(($Al,uWr)=>{"use strict";p();var V0o=t0().fromPromise,V9=require("path"),CC=NE(),{mkdirs:W0o,mkdirsSync:z0o}=oP(),{symlinkPaths:Y0o,symlinkPathsSync:K0o}=oWr(),{symlinkType:J0o,symlinkTypeSync:Z0o}=cWr(),{pathExists:X0o}=H9(),{areIdentical:lWr}=vz();async function eAo(t,e,r){let n;try{n=await CC.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(V9.isAbsolute(t))l=await CC.stat(t);else{let d=V9.dirname(e),f=V9.join(d,t);try{l=await CC.stat(f)}catch{l=await CC.stat(t)}}let u=await CC.stat(e);if(lWr(l,u))return}let o=await Y0o(t,e);t=o.toDst;let s=await J0o(o.toCwd,r),c=V9.dirname(e);return await X0o(c)||await W0o(c),CC.symlink(t,e,s)}a(eAo,"createSymlink");function tAo(t,e,r){let n;try{n=CC.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(V9.isAbsolute(t))l=CC.statSync(t);else{let d=V9.dirname(e),f=V9.join(d,t);try{l=CC.statSync(f)}catch{l=CC.statSync(t)}}let u=CC.statSync(e);if(lWr(l,u))return}let o=K0o(t,e);t=o.toDst,r=Z0o(o.toCwd,r);let s=V9.dirname(e);return CC.existsSync(s)||z0o(s),CC.symlinkSync(t,e,r)}a(tAo,"createSymlinkSync");uWr.exports={createSymlink:V0o(eAo),createSymlinkSync:tAo}});var _Wr=I((zAl,yWr)=>{"use strict";p();var{createFile:fWr,createFileSync:pWr}=ZVr(),{createLink:hWr,createLinkSync:mWr}=nWr(),{createSymlink:gWr,createSymlinkSync:AWr}=dWr();yWr.exports={createFile:fWr,createFileSync:pWr,ensureFile:fWr,ensureFileSync:pWr,createLink:hWr,createLinkSync:mWr,ensureLink:hWr,ensureLinkSync:mWr,createSymlink:gWr,createSymlinkSync:AWr,ensureSymlink:gWr,ensureSymlinkSync:AWr}});var N9e=I((KAl,EWr)=>{p();function rAo(t,{EOL:e=` -`,finalEOL:r=!0,replacer:n=null,spaces:o}={}){let s=r?e:"",c=JSON.stringify(t,n,o);if(c===void 0)throw new TypeError(`Converting ${typeof t} value to JSON is not supported`);return c.replace(/\n/g,e)+s}a(rAo,"stringify");function nAo(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(nAo,"stripBom");EWr.exports={stringify:rAo,stripBom:nAo}});var SWr=I((XAl,bWr)=>{p();var Ase;try{Ase=hse()}catch{Ase=require("fs")}var M9e=t0(),{stringify:vWr,stripBom:CWr}=N9e();async function iAo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Ase,n="throws"in e?e.throws:!0,o=await M9e.fromCallback(r.readFile)(t,e);o=CWr(o);let s;try{s=JSON.parse(o,e?e.reviver:null)}catch(c){if(n)throw c.message=`${t}: ${c.message}`,c;return null}return s}a(iAo,"_readFile");var oAo=M9e.fromPromise(iAo);function sAo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Ase,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=CWr(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(sAo,"readFileSync");async function aAo(t,e,r={}){let n=r.fs||Ase,o=vWr(e,r);await M9e.fromCallback(n.writeFile)(t,o,r)}a(aAo,"_writeFile");var cAo=M9e.fromPromise(aAo);function lAo(t,e,r={}){let n=r.fs||Ase,o=vWr(e,r);return n.writeFileSync(t,o,r)}a(lAo,"writeFileSync");bWr.exports={readFile:oAo,readFileSync:sAo,writeFile:cAo,writeFileSync:lAo}});var IWr=I((ryl,TWr)=>{"use strict";p();var O9e=SWr();TWr.exports={readJson:O9e.readFile,readJsonSync:O9e.readFileSync,writeJson:O9e.writeFile,writeJsonSync:O9e.writeFileSync}});var L9e=I((iyl,RWr)=>{"use strict";p();var uAo=t0().fromPromise,UDt=NE(),xWr=require("path"),wWr=oP(),dAo=H9().pathExists;async function fAo(t,e,r="utf-8"){let n=xWr.dirname(t);return await dAo(n)||await wWr.mkdirs(n),UDt.writeFile(t,e,r)}a(fAo,"outputFile");function pAo(t,...e){let r=xWr.dirname(t);UDt.existsSync(r)||wWr.mkdirsSync(r),UDt.writeFileSync(t,...e)}a(pAo,"outputFileSync");RWr.exports={outputFile:uAo(fAo),outputFileSync:pAo}});var PWr=I((ayl,kWr)=>{"use strict";p();var{stringify:hAo}=N9e(),{outputFile:mAo}=L9e();async function gAo(t,e,r={}){let n=hAo(e,r);await mAo(t,n,r)}a(gAo,"outputJson");kWr.exports=gAo});var NWr=I((uyl,DWr)=>{"use strict";p();var{stringify:AAo}=N9e(),{outputFileSync:yAo}=L9e();function _Ao(t,e,r){let n=AAo(e,r);yAo(t,n,r)}a(_Ao,"outputJsonSync");DWr.exports=_Ao});var OWr=I((pyl,MWr)=>{"use strict";p();var EAo=t0().fromPromise,OE=IWr();OE.outputJson=EAo(PWr());OE.outputJsonSync=NWr();OE.outputJSON=OE.outputJson;OE.outputJSONSync=OE.outputJsonSync;OE.writeJSON=OE.writeJson;OE.writeJSONSync=OE.writeJsonSync;OE.readJSON=OE.readJson;OE.readJSONSync=OE.readJsonSync;MWr.exports=OE});var QWr=I((myl,UWr)=>{"use strict";p();var vAo=NE(),LWr=require("path"),{copy:CAo}=D9e(),{remove:FWr}=rSe(),{mkdirp:bAo}=oP(),{pathExists:SAo}=H9(),BWr=vz();async function TAo(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await BWr.checkPaths(t,e,"move",r);await BWr.checkParentPaths(t,o,e,"move");let c=LWr.dirname(e);return LWr.parse(c).root!==c&&await bAo(c),IAo(t,e,n,s)}a(TAo,"move");async function IAo(t,e,r,n){if(!n){if(r)await FWr(e);else if(await SAo(e))throw new Error("dest already exists.")}try{await vAo.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await xAo(t,e,r)}}a(IAo,"doRename");async function xAo(t,e,r){return await CAo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),FWr(t)}a(xAo,"moveAcrossDevice");UWr.exports=TAo});var $Wr=I((yyl,GWr)=>{"use strict";p();var jWr=hse(),qDt=require("path"),wAo=D9e().copySync,HWr=rSe().removeSync,RAo=oP().mkdirpSync,qWr=vz();function kAo(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=qWr.checkPathsSync(t,e,"move",r);return qWr.checkParentPathsSync(t,o,e,"move"),PAo(e)||RAo(qDt.dirname(e)),DAo(t,e,n,s)}a(kAo,"moveSync");function PAo(t){let e=qDt.dirname(t);return qDt.parse(e).root===e}a(PAo,"isParentRoot");function DAo(t,e,r,n){if(n)return QDt(t,e,r);if(r)return HWr(e),QDt(t,e,r);if(jWr.existsSync(e))throw new Error("dest already exists.");return QDt(t,e,r)}a(DAo,"doRename");function QDt(t,e,r){try{jWr.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return NAo(t,e,r)}}a(QDt,"rename");function NAo(t,e,r){return wAo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),HWr(t)}a(NAo,"moveAcrossDevice");GWr.exports=kAo});var WWr=I((vyl,VWr)=>{"use strict";p();var MAo=t0().fromPromise;VWr.exports={move:MAo(QWr()),moveSync:$Wr()}});var YWr=I((byl,zWr)=>{"use strict";p();zWr.exports={...NE(),...D9e(),...zVr(),..._Wr(),...OWr(),...oP(),...WWr(),...L9e(),...H9(),...rSe()}});var F9e=I((Tyl,ZWr)=>{p();var jDt=require("fs"),B9e=require("path"),iSe=B9e.join,OAo=B9e.dirname,KWr=jDt.accessSync&&function(t){try{jDt.accessSync(t)}catch{return!1}return!0}||jDt.existsSync||B9e.existsSync,JWr={arrow:process.env.NODE_BINDINGS_ARROW||" \u2192 ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","compiled","platform","arch","bindings"]]};function LAo(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(JWr).map(function(u){u in t||(t[u]=JWr[u])}),t.module_root||(t.module_root=BAo(__filename)),B9e.extname(t.bindings)!=".node"&&(t.bindings+=".node");for(var e=typeof __webpack_require__=="function"?__non_webpack_require__:require,r=[],n=0,o=t.try.length,s,c,l;n{"use strict";p();var R0o=r0().fromPromise;UVr.exports={copy:R0o(NVr()),copySync:FVr()}});var rSe=I((RAl,qVr)=>{"use strict";p();var QVr=mse(),k0o=r0().fromCallback;function P0o(t,e){QVr.rm(t,{recursive:!0,force:!0},e)}a(P0o,"remove");function D0o(t){QVr.rmSync(t,{recursive:!0,force:!0})}a(D0o,"removeSync");qVr.exports={remove:k0o(P0o),removeSync:D0o}});var YVr=I((DAl,zVr)=>{"use strict";p();var N0o=r0().fromPromise,GVr=NE(),$Vr=require("path"),VVr=oP(),WVr=rSe(),jVr=N0o(a(async function(e){let r;try{r=await GVr.readdir(e)}catch{return VVr.mkdirs(e)}return Promise.all(r.map(n=>WVr.remove($Vr.join(e,n))))},"emptyDir"));function HVr(t){let e;try{e=GVr.readdirSync(t)}catch{return VVr.mkdirsSync(t)}e.forEach(r=>{r=$Vr.join(t,r),WVr.removeSync(r)})}a(HVr,"emptyDirSync");zVr.exports={emptyDirSync:HVr,emptydirSync:HVr,emptyDir:jVr,emptydir:jVr}});var XVr=I((OAl,ZVr)=>{"use strict";p();var M0o=r0().fromPromise,KVr=require("path"),UB=NE(),JVr=oP();async function O0o(t){let e;try{e=await UB.stat(t)}catch{}if(e&&e.isFile())return;let r=KVr.dirname(t),n=null;try{n=await UB.stat(r)}catch(o){if(o.code==="ENOENT"){await JVr.mkdirs(r),await UB.writeFile(t,"");return}else throw o}n.isDirectory()?await UB.writeFile(t,""):await UB.readdir(r)}a(O0o,"createFile");function L0o(t){let e;try{e=UB.statSync(t)}catch{}if(e&&e.isFile())return;let r=KVr.dirname(t);try{UB.statSync(r).isDirectory()||UB.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")JVr.mkdirsSync(r);else throw n}UB.writeFileSync(t,"")}a(L0o,"createFileSync");ZVr.exports={createFile:M0o(O0o),createFileSync:L0o}});var iWr=I((FAl,nWr)=>{"use strict";p();var B0o=r0().fromPromise,eWr=require("path"),G9=NE(),tWr=oP(),{pathExists:F0o}=H9(),{areIdentical:rWr}=Cz();async function U0o(t,e){let r;try{r=await G9.lstat(e)}catch{}let n;try{n=await G9.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&rWr(n,r))return;let o=eWr.dirname(e);await F0o(o)||await tWr.mkdirs(o),await G9.link(t,e)}a(U0o,"createLink");function Q0o(t,e){let r;try{r=G9.lstatSync(e)}catch{}try{let s=G9.lstatSync(t);if(r&&rWr(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=eWr.dirname(e);return G9.existsSync(n)||tWr.mkdirsSync(n),G9.linkSync(t,e)}a(Q0o,"createLinkSync");nWr.exports={createLink:B0o(U0o),createLinkSync:Q0o}});var sWr=I((qAl,oWr)=>{"use strict";p();var $9=require("path"),nSe=NE(),{pathExists:q0o}=H9(),j0o=r0().fromPromise;async function H0o(t,e){if($9.isAbsolute(t)){try{await nSe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=$9.dirname(e),n=$9.join(r,t);if(await q0o(n))return{toCwd:n,toDst:t};try{await nSe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:$9.relative(r,t)}}a(H0o,"symlinkPaths");function G0o(t,e){if($9.isAbsolute(t)){if(!nSe.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=$9.dirname(e),n=$9.join(r,t);if(nSe.existsSync(n))return{toCwd:n,toDst:t};if(!nSe.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:$9.relative(r,t)}}a(G0o,"symlinkPathsSync");oWr.exports={symlinkPaths:j0o(H0o),symlinkPathsSync:G0o}});var lWr=I((GAl,cWr)=>{"use strict";p();var aWr=NE(),$0o=r0().fromPromise;async function V0o(t,e){if(e)return e;let r;try{r=await aWr.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(V0o,"symlinkType");function W0o(t,e){if(e)return e;let r;try{r=aWr.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(W0o,"symlinkTypeSync");cWr.exports={symlinkType:$0o(V0o),symlinkTypeSync:W0o}});var fWr=I((WAl,dWr)=>{"use strict";p();var z0o=r0().fromPromise,V9=require("path"),CC=NE(),{mkdirs:Y0o,mkdirsSync:K0o}=oP(),{symlinkPaths:J0o,symlinkPathsSync:Z0o}=sWr(),{symlinkType:X0o,symlinkTypeSync:eAo}=lWr(),{pathExists:tAo}=H9(),{areIdentical:uWr}=Cz();async function rAo(t,e,r){let n;try{n=await CC.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(V9.isAbsolute(t))l=await CC.stat(t);else{let d=V9.dirname(e),f=V9.join(d,t);try{l=await CC.stat(f)}catch{l=await CC.stat(t)}}let u=await CC.stat(e);if(uWr(l,u))return}let o=await J0o(t,e);t=o.toDst;let s=await X0o(o.toCwd,r),c=V9.dirname(e);return await tAo(c)||await Y0o(c),CC.symlink(t,e,s)}a(rAo,"createSymlink");function nAo(t,e,r){let n;try{n=CC.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(V9.isAbsolute(t))l=CC.statSync(t);else{let d=V9.dirname(e),f=V9.join(d,t);try{l=CC.statSync(f)}catch{l=CC.statSync(t)}}let u=CC.statSync(e);if(uWr(l,u))return}let o=Z0o(t,e);t=o.toDst,r=eAo(o.toCwd,r);let s=V9.dirname(e);return CC.existsSync(s)||K0o(s),CC.symlinkSync(t,e,r)}a(nAo,"createSymlinkSync");dWr.exports={createSymlink:z0o(rAo),createSymlinkSync:nAo}});var EWr=I((KAl,_Wr)=>{"use strict";p();var{createFile:pWr,createFileSync:hWr}=XVr(),{createLink:mWr,createLinkSync:gWr}=iWr(),{createSymlink:AWr,createSymlinkSync:yWr}=fWr();_Wr.exports={createFile:pWr,createFileSync:hWr,ensureFile:pWr,ensureFileSync:hWr,createLink:mWr,createLinkSync:gWr,ensureLink:mWr,ensureLinkSync:gWr,createSymlink:AWr,createSymlinkSync:yWr,ensureSymlink:AWr,ensureSymlinkSync:yWr}});var N9e=I((ZAl,vWr)=>{p();function iAo(t,{EOL:e=` +`,finalEOL:r=!0,replacer:n=null,spaces:o}={}){let s=r?e:"",c=JSON.stringify(t,n,o);if(c===void 0)throw new TypeError(`Converting ${typeof t} value to JSON is not supported`);return c.replace(/\n/g,e)+s}a(iAo,"stringify");function oAo(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(oAo,"stripBom");vWr.exports={stringify:iAo,stripBom:oAo}});var TWr=I((tyl,SWr)=>{p();var yse;try{yse=mse()}catch{yse=require("fs")}var M9e=r0(),{stringify:CWr,stripBom:bWr}=N9e();async function sAo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||yse,n="throws"in e?e.throws:!0,o=await M9e.fromCallback(r.readFile)(t,e);o=bWr(o);let s;try{s=JSON.parse(o,e?e.reviver:null)}catch(c){if(n)throw c.message=`${t}: ${c.message}`,c;return null}return s}a(sAo,"_readFile");var aAo=M9e.fromPromise(sAo);function cAo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||yse,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=bWr(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(cAo,"readFileSync");async function lAo(t,e,r={}){let n=r.fs||yse,o=CWr(e,r);await M9e.fromCallback(n.writeFile)(t,o,r)}a(lAo,"_writeFile");var uAo=M9e.fromPromise(lAo);function dAo(t,e,r={}){let n=r.fs||yse,o=CWr(e,r);return n.writeFileSync(t,o,r)}a(dAo,"writeFileSync");SWr.exports={readFile:aAo,readFileSync:cAo,writeFile:uAo,writeFileSync:dAo}});var xWr=I((iyl,IWr)=>{"use strict";p();var O9e=TWr();IWr.exports={readJson:O9e.readFile,readJsonSync:O9e.readFileSync,writeJson:O9e.writeFile,writeJsonSync:O9e.writeFileSync}});var L9e=I((syl,kWr)=>{"use strict";p();var fAo=r0().fromPromise,QDt=NE(),wWr=require("path"),RWr=oP(),pAo=H9().pathExists;async function hAo(t,e,r="utf-8"){let n=wWr.dirname(t);return await pAo(n)||await RWr.mkdirs(n),QDt.writeFile(t,e,r)}a(hAo,"outputFile");function mAo(t,...e){let r=wWr.dirname(t);QDt.existsSync(r)||RWr.mkdirsSync(r),QDt.writeFileSync(t,...e)}a(mAo,"outputFileSync");kWr.exports={outputFile:fAo(hAo),outputFileSync:mAo}});var DWr=I((lyl,PWr)=>{"use strict";p();var{stringify:gAo}=N9e(),{outputFile:AAo}=L9e();async function yAo(t,e,r={}){let n=gAo(e,r);await AAo(t,n,r)}a(yAo,"outputJson");PWr.exports=yAo});var MWr=I((fyl,NWr)=>{"use strict";p();var{stringify:_Ao}=N9e(),{outputFileSync:EAo}=L9e();function vAo(t,e,r){let n=_Ao(e,r);EAo(t,n,r)}a(vAo,"outputJsonSync");NWr.exports=vAo});var LWr=I((myl,OWr)=>{"use strict";p();var CAo=r0().fromPromise,OE=xWr();OE.outputJson=CAo(DWr());OE.outputJsonSync=MWr();OE.outputJSON=OE.outputJson;OE.outputJSONSync=OE.outputJsonSync;OE.writeJSON=OE.writeJson;OE.writeJSONSync=OE.writeJsonSync;OE.readJSON=OE.readJson;OE.readJSONSync=OE.readJsonSync;OWr.exports=OE});var qWr=I((Ayl,QWr)=>{"use strict";p();var bAo=NE(),BWr=require("path"),{copy:SAo}=D9e(),{remove:UWr}=rSe(),{mkdirp:TAo}=oP(),{pathExists:IAo}=H9(),FWr=Cz();async function xAo(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await FWr.checkPaths(t,e,"move",r);await FWr.checkParentPaths(t,o,e,"move");let c=BWr.dirname(e);return BWr.parse(c).root!==c&&await TAo(c),wAo(t,e,n,s)}a(xAo,"move");async function wAo(t,e,r,n){if(!n){if(r)await UWr(e);else if(await IAo(e))throw new Error("dest already exists.")}try{await bAo.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await RAo(t,e,r)}}a(wAo,"doRename");async function RAo(t,e,r){return await SAo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),UWr(t)}a(RAo,"moveAcrossDevice");QWr.exports=xAo});var VWr=I((Eyl,$Wr)=>{"use strict";p();var HWr=mse(),jDt=require("path"),kAo=D9e().copySync,GWr=rSe().removeSync,PAo=oP().mkdirpSync,jWr=Cz();function DAo(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=jWr.checkPathsSync(t,e,"move",r);return jWr.checkParentPathsSync(t,o,e,"move"),NAo(e)||PAo(jDt.dirname(e)),MAo(t,e,n,s)}a(DAo,"moveSync");function NAo(t){let e=jDt.dirname(t);return jDt.parse(e).root===e}a(NAo,"isParentRoot");function MAo(t,e,r,n){if(n)return qDt(t,e,r);if(r)return GWr(e),qDt(t,e,r);if(HWr.existsSync(e))throw new Error("dest already exists.");return qDt(t,e,r)}a(MAo,"doRename");function qDt(t,e,r){try{HWr.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return OAo(t,e,r)}}a(qDt,"rename");function OAo(t,e,r){return kAo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),GWr(t)}a(OAo,"moveAcrossDevice");$Wr.exports=DAo});var zWr=I((byl,WWr)=>{"use strict";p();var LAo=r0().fromPromise;WWr.exports={move:LAo(qWr()),moveSync:VWr()}});var KWr=I((Tyl,YWr)=>{"use strict";p();YWr.exports={...NE(),...D9e(),...YVr(),...EWr(),...LWr(),...oP(),...zWr(),...L9e(),...H9(),...rSe()}});var F9e=I((xyl,XWr)=>{p();var HDt=require("fs"),B9e=require("path"),iSe=B9e.join,BAo=B9e.dirname,JWr=HDt.accessSync&&function(t){try{HDt.accessSync(t)}catch{return!1}return!0}||HDt.existsSync||B9e.existsSync,ZWr={arrow:process.env.NODE_BINDINGS_ARROW||" \u2192 ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","compiled","platform","arch","bindings"]]};function FAo(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(ZWr).map(function(u){u in t||(t[u]=ZWr[u])}),t.module_root||(t.module_root=UAo(__filename)),B9e.extname(t.bindings)!=".node"&&(t.bindings+=".node");for(var e=typeof __webpack_require__=="function"?__non_webpack_require__:require,r=[],n=0,o=t.try.length,s,c,l;n{"use strict";p();var FAo=dx&&dx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UAo=dx&&dx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),XWr=dx&&dx.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&FAo(e,t,r);return UAo(e,t),e};Object.defineProperty(dx,"__esModule",{value:!0});dx.setDeviceId=dx.getDeviceId=void 0;var U9e=XWr(require("path")),Q9e=XWr(YWr()),ezr=process.platform==="win32"?F9e()("windows"):null,QAo="deviceid";function tzr(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=U9e.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??U9e.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return U9e.join(t,"Microsoft","DeveloperTools")}a(tzr,"getDirectory");function HDt(){return U9e.join(tzr(),QAo)}a(HDt,"getDeviceIdFilePath");async function qAo(){return process.platform==="win32"?ezr?.GetDeviceId():await jAo(HDt())?Q9e.readFile(HDt(),"utf8"):void 0}a(qAo,"getDeviceId");dx.getDeviceId=qAo;async function jAo(t){try{return await Q9e.promises.access(t),!0}catch{return!1}}a(jAo,"exists");async function HAo(t){process.platform==="win32"?ezr?.SetDeviceId(t):(await Q9e.ensureDir(tzr()),await Q9e.writeFile(HDt(),t,"utf8"))}a(HAo,"setDeviceId");dx.setDeviceId=HAo});var izr=I(kM=>{"use strict";p();var GAo=kM&&kM.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Ao=kM&&kM.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),VAo=kM&&kM.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&GAo(e,t,r);return $Ao(e,t),e};Object.defineProperty(kM,"__esModule",{value:!0});kM.getDeviceId=void 0;var WAo=(Fo(),Wa(Nc)),nzr=VAo(rzr());async function zAo(){let t;try{t=await nzr.getDeviceId()}catch{}if(t)return t;{let e=(0,WAo.v4)().toLowerCase();return await nzr.setDeviceId(e),e}}a(zAo,"getDeviceId");kM.getDeviceId=zAo});var ozr=I(Cz=>{"use strict";p();var YAo=Cz&&Cz.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KAo=Cz&&Cz.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YAo(e,t,r)};Object.defineProperty(Cz,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");KAo(izr(),Cz)});var fa=I((j9e,szr)=>{p();(function(t,e){typeof j9e=="object"?szr.exports=j9e=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(j9e,function(){var t=t||(function(e,r){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof global<"u"&&global.crypto&&(n=global.crypto),!n&&typeof require=="function")try{n=require("crypto")}catch{}var o=a(function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},"cryptoSecureRandomInt"),s=Object.create||(function(){function E(){}return a(E,"F"),function(v){var S;return E.prototype=v,S=new E,E.prototype=null,S}})(),c={},l=c.lib={},u=l.Base=(function(){return{extend:a(function(E){var v=s(this);return E&&v.mixIn(E),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},"extend"),create:a(function(){var E=this.extend();return E.init.apply(E,arguments),E},"create"),init:a(function(){},"init"),mixIn:a(function(E){for(var v in E)E.hasOwnProperty(v)&&(this[v]=E[v]);E.hasOwnProperty("toString")&&(this.toString=E.toString)},"mixIn"),clone:a(function(){return this.init.prototype.extend(this)},"clone")}})(),d=l.WordArray=u.extend({init:a(function(E,v){E=this.words=E||[],v!=r?this.sigBytes=v:this.sigBytes=E.length*4},"init"),toString:a(function(E){return(E||h).stringify(this)},"toString"),concat:a(function(E){var v=this.words,S=E.words,T=this.sigBytes,w=E.sigBytes;if(this.clamp(),T%4)for(var R=0;R>>2]>>>24-R%4*8&255;v[T+R>>>2]|=x<<24-(T+R)%4*8}else for(var k=0;k>>2]=S[k>>>2];return this.sigBytes+=w,this},"concat"),clamp:a(function(){var E=this.words,v=this.sigBytes;E[v>>>2]&=4294967295<<32-v%4*8,E.length=e.ceil(v/4)},"clamp"),clone:a(function(){var E=u.clone.call(this);return E.words=this.words.slice(0),E},"clone"),random:a(function(E){for(var v=[],S=0;S>>2]>>>24-w%4*8&255;T.push((R>>>4).toString(16)),T.push((R&15).toString(16))}return T.join("")},"stringify"),parse:a(function(E){for(var v=E.length,S=[],T=0;T>>3]|=parseInt(E.substr(T,2),16)<<24-T%8*4;return new d.init(S,v/2)},"parse")},m=f.Latin1={stringify:a(function(E){for(var v=E.words,S=E.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push(String.fromCharCode(R))}return T.join("")},"stringify"),parse:a(function(E){for(var v=E.length,S=[],T=0;T>>2]|=(E.charCodeAt(T)&255)<<24-T%4*8;return new d.init(S,v)},"parse")},g=f.Utf8={stringify:a(function(E){try{return decodeURIComponent(escape(m.stringify(E)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:a(function(E){return m.parse(unescape(encodeURIComponent(E)))},"parse")},A=l.BufferedBlockAlgorithm=u.extend({reset:a(function(){this._data=new d.init,this._nDataBytes=0},"reset"),_append:a(function(E){typeof E=="string"&&(E=g.parse(E)),this._data.concat(E),this._nDataBytes+=E.sigBytes},"_append"),_process:a(function(E){var v,S=this._data,T=S.words,w=S.sigBytes,R=this.blockSize,x=R*4,k=w/x;E?k=e.ceil(k):k=e.max((k|0)-this._minBufferSize,0);var D=k*R,N=e.min(D*4,w);if(D){for(var O=0;O{p();(function(t,e){typeof H9e=="object"?azr.exports=H9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(H9e,function(t){return(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=r.x64={},l=c.Word=o.extend({init:a(function(d,f){this.high=d,this.low=f},"init")}),u=c.WordArray=o.extend({init:a(function(d,f){d=this.words=d||[],f!=e?this.sigBytes=f:this.sigBytes=d.length*8},"init"),toX32:a(function(){for(var d=this.words,f=d.length,h=[],m=0;m{p();(function(t,e){typeof G9e=="object"?czr.exports=G9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(G9e,function(t){return(function(){if(typeof ArrayBuffer=="function"){var e=t,r=e.lib,n=r.WordArray,o=n.init,s=n.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray<"u"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var l=c.byteLength,u=[],d=0;d>>2]|=c[d]<<24-d%4*8;o.call(this,u,l)}else o.apply(this,arguments)};s.prototype=n}})(),t.lib.WordArray})});var dzr=I(($9e,uzr)=>{p();(function(t,e){typeof $9e=="object"?uzr.exports=$9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})($9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Utf16=o.Utf16BE={stringify:a(function(l){for(var u=l.words,d=l.sigBytes,f=[],h=0;h>>2]>>>16-h%4*8&65535;f.push(String.fromCharCode(m))}return f.join("")},"stringify"),parse:a(function(l){for(var u=l.length,d=[],f=0;f>>1]|=l.charCodeAt(f)<<16-f%2*16;return n.create(d,u*2)},"parse")};o.Utf16LE={stringify:a(function(l){for(var u=l.words,d=l.sigBytes,f=[],h=0;h>>2]>>>16-h%4*8&65535);f.push(String.fromCharCode(m))}return f.join("")},"stringify"),parse:a(function(l){for(var u=l.length,d=[],f=0;f>>1]|=c(l.charCodeAt(f)<<16-f%2*16);return n.create(d,u*2)},"parse")};function c(l){return l<<8&4278255360|l>>>8&16711935}a(c,"swapEndian")})(),t.enc.Utf16})});var W9=I((V9e,fzr)=>{p();(function(t,e){typeof V9e=="object"?fzr.exports=V9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(V9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Base64={stringify:a(function(l){var u=l.words,d=l.sigBytes,f=this._map;l.clamp();for(var h=[],m=0;m>>2]>>>24-m%4*8&255,A=u[m+1>>>2]>>>24-(m+1)%4*8&255,y=u[m+2>>>2]>>>24-(m+2)%4*8&255,_=g<<16|A<<8|y,E=0;E<4&&m+E*.75>>6*(3-E)&63));var v=f.charAt(64);if(v)for(;h.length%4;)h.push(v);return h.join("")},"stringify"),parse:a(function(l){var u=l.length,d=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var h=0;h>>6-m%4*2,y=g|A;f[h>>>2]|=y<<24-h%4*8,h++}return n.create(f,h)}a(c,"parseLoop")})(),t.enc.Base64})});var hzr=I((W9e,pzr)=>{p();(function(t,e){typeof W9e=="object"?pzr.exports=W9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(W9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Base64url={stringify:a(function(l,u){u===void 0&&(u=!0);var d=l.words,f=l.sigBytes,h=u?this._safe_map:this._map;l.clamp();for(var m=[],g=0;g>>2]>>>24-g%4*8&255,y=d[g+1>>>2]>>>24-(g+1)%4*8&255,_=d[g+2>>>2]>>>24-(g+2)%4*8&255,E=A<<16|y<<8|_,v=0;v<4&&g+v*.75>>6*(3-v)&63));var S=h.charAt(64);if(S)for(;m.length%4;)m.push(S);return m.join("")},"stringify"),parse:a(function(l,u){u===void 0&&(u=!0);var d=l.length,f=u?this._safe_map:this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var m=0;m>>6-m%4*2,y=g|A;f[h>>>2]|=y<<24-h%4*8,h++}return n.create(f,h)}a(c,"parseLoop")})(),t.enc.Base64url})});var z9=I((z9e,mzr)=>{p();(function(t,e){typeof z9e=="object"?mzr.exports=z9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(z9e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[];(function(){for(var g=0;g<64;g++)l[g]=e.abs(e.sin(g+1))*4294967296|0})();var u=c.MD5=s.extend({_doReset:a(function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},"_doReset"),_doProcessBlock:a(function(g,A){for(var y=0;y<16;y++){var _=A+y,E=g[_];g[_]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}var v=this._hash.words,S=g[A+0],T=g[A+1],w=g[A+2],R=g[A+3],x=g[A+4],k=g[A+5],D=g[A+6],N=g[A+7],O=g[A+8],B=g[A+9],q=g[A+10],M=g[A+11],L=g[A+12],U=g[A+13],j=g[A+14],Q=g[A+15],Y=v[0],W=v[1],V=v[2],z=v[3];Y=d(Y,W,V,z,S,7,l[0]),z=d(z,Y,W,V,T,12,l[1]),V=d(V,z,Y,W,w,17,l[2]),W=d(W,V,z,Y,R,22,l[3]),Y=d(Y,W,V,z,x,7,l[4]),z=d(z,Y,W,V,k,12,l[5]),V=d(V,z,Y,W,D,17,l[6]),W=d(W,V,z,Y,N,22,l[7]),Y=d(Y,W,V,z,O,7,l[8]),z=d(z,Y,W,V,B,12,l[9]),V=d(V,z,Y,W,q,17,l[10]),W=d(W,V,z,Y,M,22,l[11]),Y=d(Y,W,V,z,L,7,l[12]),z=d(z,Y,W,V,U,12,l[13]),V=d(V,z,Y,W,j,17,l[14]),W=d(W,V,z,Y,Q,22,l[15]),Y=f(Y,W,V,z,T,5,l[16]),z=f(z,Y,W,V,D,9,l[17]),V=f(V,z,Y,W,M,14,l[18]),W=f(W,V,z,Y,S,20,l[19]),Y=f(Y,W,V,z,k,5,l[20]),z=f(z,Y,W,V,q,9,l[21]),V=f(V,z,Y,W,Q,14,l[22]),W=f(W,V,z,Y,x,20,l[23]),Y=f(Y,W,V,z,B,5,l[24]),z=f(z,Y,W,V,j,9,l[25]),V=f(V,z,Y,W,R,14,l[26]),W=f(W,V,z,Y,O,20,l[27]),Y=f(Y,W,V,z,U,5,l[28]),z=f(z,Y,W,V,w,9,l[29]),V=f(V,z,Y,W,N,14,l[30]),W=f(W,V,z,Y,L,20,l[31]),Y=h(Y,W,V,z,k,4,l[32]),z=h(z,Y,W,V,O,11,l[33]),V=h(V,z,Y,W,M,16,l[34]),W=h(W,V,z,Y,j,23,l[35]),Y=h(Y,W,V,z,T,4,l[36]),z=h(z,Y,W,V,x,11,l[37]),V=h(V,z,Y,W,N,16,l[38]),W=h(W,V,z,Y,q,23,l[39]),Y=h(Y,W,V,z,U,4,l[40]),z=h(z,Y,W,V,S,11,l[41]),V=h(V,z,Y,W,R,16,l[42]),W=h(W,V,z,Y,D,23,l[43]),Y=h(Y,W,V,z,B,4,l[44]),z=h(z,Y,W,V,L,11,l[45]),V=h(V,z,Y,W,Q,16,l[46]),W=h(W,V,z,Y,w,23,l[47]),Y=m(Y,W,V,z,S,6,l[48]),z=m(z,Y,W,V,N,10,l[49]),V=m(V,z,Y,W,j,15,l[50]),W=m(W,V,z,Y,k,21,l[51]),Y=m(Y,W,V,z,L,6,l[52]),z=m(z,Y,W,V,R,10,l[53]),V=m(V,z,Y,W,q,15,l[54]),W=m(W,V,z,Y,T,21,l[55]),Y=m(Y,W,V,z,O,6,l[56]),z=m(z,Y,W,V,Q,10,l[57]),V=m(V,z,Y,W,D,15,l[58]),W=m(W,V,z,Y,U,21,l[59]),Y=m(Y,W,V,z,x,6,l[60]),z=m(z,Y,W,V,M,10,l[61]),V=m(V,z,Y,W,w,15,l[62]),W=m(W,V,z,Y,B,21,l[63]),v[0]=v[0]+Y|0,v[1]=v[1]+W|0,v[2]=v[2]+V|0,v[3]=v[3]+z|0},"_doProcessBlock"),_doFinalize:a(function(){var g=this._data,A=g.words,y=this._nDataBytes*8,_=g.sigBytes*8;A[_>>>5]|=128<<24-_%32;var E=e.floor(y/4294967296),v=y;A[(_+64>>>9<<4)+15]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,A[(_+64>>>9<<4)+14]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,g.sigBytes=(A.length+1)*4,this._process();for(var S=this._hash,T=S.words,w=0;w<4;w++){var R=T[w];T[w]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}return S},"_doFinalize"),clone:a(function(){var g=s.clone.call(this);return g._hash=this._hash.clone(),g},"clone")});function d(g,A,y,_,E,v,S){var T=g+(A&y|~A&_)+E+S;return(T<>>32-v)+A}a(d,"FF");function f(g,A,y,_,E,v,S){var T=g+(A&_|y&~_)+E+S;return(T<>>32-v)+A}a(f,"GG");function h(g,A,y,_,E,v,S){var T=g+(A^y^_)+E+S;return(T<>>32-v)+A}a(h,"HH");function m(g,A,y,_,E,v,S){var T=g+(y^(A|~_))+E+S;return(T<>>32-v)+A}a(m,"II"),r.MD5=s._createHelper(u),r.HmacMD5=s._createHmacHelper(u)})(Math),t.MD5})});var VDt=I((Y9e,gzr)=>{p();(function(t,e){typeof Y9e=="object"?gzr.exports=Y9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Y9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.algo,c=[],l=s.SHA1=o.extend({_doReset:a(function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(u,d){for(var f=this._hash.words,h=f[0],m=f[1],g=f[2],A=f[3],y=f[4],_=0;_<80;_++){if(_<16)c[_]=u[d+_]|0;else{var E=c[_-3]^c[_-8]^c[_-14]^c[_-16];c[_]=E<<1|E>>>31}var v=(h<<5|h>>>27)+y+c[_];_<20?v+=(m&g|~m&A)+1518500249:_<40?v+=(m^g^A)+1859775393:_<60?v+=(m&g|m&A|g&A)-1894007588:v+=(m^g^A)-899497514,y=A,A=g,g=m<<30|m>>>2,m=h,h=v}f[0]=f[0]+h|0,f[1]=f[1]+m|0,f[2]=f[2]+g|0,f[3]=f[3]+A|0,f[4]=f[4]+y|0},"_doProcessBlock"),_doFinalize:a(function(){var u=this._data,d=u.words,f=this._nDataBytes*8,h=u.sigBytes*8;return d[h>>>5]|=128<<24-h%32,d[(h+64>>>9<<4)+14]=Math.floor(f/4294967296),d[(h+64>>>9<<4)+15]=f,u.sigBytes=d.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var u=o.clone.call(this);return u._hash=this._hash.clone(),u},"clone")});e.SHA1=o._createHelper(l),e.HmacSHA1=o._createHmacHelper(l)})(),t.SHA1})});var J9e=I((K9e,Azr)=>{p();(function(t,e){typeof K9e=="object"?Azr.exports=K9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(K9e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[],u=[];(function(){function h(y){for(var _=e.sqrt(y),E=2;E<=_;E++)if(!(y%E))return!1;return!0}a(h,"isPrime");function m(y){return(y-(y|0))*4294967296|0}a(m,"getFractionalBits");for(var g=2,A=0;A<64;)h(g)&&(A<8&&(l[A]=m(e.pow(g,1/2))),u[A]=m(e.pow(g,1/3)),A++),g++})();var d=[],f=c.SHA256=s.extend({_doReset:a(function(){this._hash=new o.init(l.slice(0))},"_doReset"),_doProcessBlock:a(function(h,m){for(var g=this._hash.words,A=g[0],y=g[1],_=g[2],E=g[3],v=g[4],S=g[5],T=g[6],w=g[7],R=0;R<64;R++){if(R<16)d[R]=h[m+R]|0;else{var x=d[R-15],k=(x<<25|x>>>7)^(x<<14|x>>>18)^x>>>3,D=d[R-2],N=(D<<15|D>>>17)^(D<<13|D>>>19)^D>>>10;d[R]=k+d[R-7]+N+d[R-16]}var O=v&S^~v&T,B=A&y^A&_^y&_,q=(A<<30|A>>>2)^(A<<19|A>>>13)^(A<<10|A>>>22),M=(v<<26|v>>>6)^(v<<21|v>>>11)^(v<<7|v>>>25),L=w+M+O+u[R]+d[R],U=q+B;w=T,T=S,S=v,v=E+L|0,E=_,_=y,y=A,A=L+U|0}g[0]=g[0]+A|0,g[1]=g[1]+y|0,g[2]=g[2]+_|0,g[3]=g[3]+E|0,g[4]=g[4]+v|0,g[5]=g[5]+S|0,g[6]=g[6]+T|0,g[7]=g[7]+w|0},"_doProcessBlock"),_doFinalize:a(function(){var h=this._data,m=h.words,g=this._nDataBytes*8,A=h.sigBytes*8;return m[A>>>5]|=128<<24-A%32,m[(A+64>>>9<<4)+14]=e.floor(g/4294967296),m[(A+64>>>9<<4)+15]=g,h.sigBytes=m.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h},"clone")});r.SHA256=s._createHelper(f),r.HmacSHA256=s._createHmacHelper(f)})(Math),t.SHA256})});var _zr=I((Z9e,yzr)=>{p();(function(t,e,r){typeof Z9e=="object"?yzr.exports=Z9e=e(fa(),J9e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(Z9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.algo,s=o.SHA256,c=o.SHA224=s.extend({_doReset:a(function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},"_doReset"),_doFinalize:a(function(){var l=s._doFinalize.call(this);return l.sigBytes-=4,l},"_doFinalize")});e.SHA224=s._createHelper(c),e.HmacSHA224=s._createHmacHelper(c)})(),t.SHA224})});var WDt=I((X9e,Ezr)=>{p();(function(t,e,r){typeof X9e=="object"?Ezr.exports=X9e=e(fa(),oSe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(X9e,function(t){return(function(){var e=t,r=e.lib,n=r.Hasher,o=e.x64,s=o.Word,c=o.WordArray,l=e.algo;function u(){return s.create.apply(s,arguments)}a(u,"X64Word_create");var d=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(1816402316,1246189591)],f=[];(function(){for(var m=0;m<80;m++)f[m]=u()})();var h=l.SHA512=n.extend({_doReset:a(function(){this._hash=new c.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},"_doReset"),_doProcessBlock:a(function(m,g){for(var A=this._hash.words,y=A[0],_=A[1],E=A[2],v=A[3],S=A[4],T=A[5],w=A[6],R=A[7],x=y.high,k=y.low,D=_.high,N=_.low,O=E.high,B=E.low,q=v.high,M=v.low,L=S.high,U=S.low,j=T.high,Q=T.low,Y=w.high,W=w.low,V=R.high,z=R.low,ie=x,H=k,re=D,le=N,Le=O,me=B,Oe=q,Te=M,te=L,ee=U,K=j,he=Q,X=Y,de=W,Be=V,ne=z,ue=0;ue<80;ue++){var Ne,xe,Fe=f[ue];if(ue<16)xe=Fe.high=m[g+ue*2]|0,Ne=Fe.low=m[g+ue*2+1]|0;else{var tt=f[ue-15],st=tt.high,vt=tt.low,Pt=(st>>>1|vt<<31)^(st>>>8|vt<<24)^st>>>7,Ht=(vt>>>1|st<<31)^(vt>>>8|st<<24)^(vt>>>7|st<<25),F=f[ue-2],se=F.high,be=F.low,Ue=(se>>>19|be<<13)^(se<<3|be>>>29)^se>>>6,Qe=(be>>>19|se<<13)^(be<<3|se>>>29)^(be>>>6|se<<26),ge=f[ue-7],Z=ge.high,ve=ge.low,Ge=f[ue-16],qe=Ge.high,je=Ge.low;Ne=Ht+ve,xe=Pt+Z+(Ne>>>0>>0?1:0),Ne=Ne+Qe,xe=xe+Ue+(Ne>>>0>>0?1:0),Ne=Ne+je,xe=xe+qe+(Ne>>>0>>0?1:0),Fe.high=xe,Fe.low=Ne}var J=te&K^~te&X,ae=ee&he^~ee&de,Ce=ie&re^ie&Le^re&Le,Re=H&le^H&me^le&me,$e=(ie>>>28|H<<4)^(ie<<30|H>>>2)^(ie<<25|H>>>7),Ye=(H>>>28|ie<<4)^(H<<30|ie>>>2)^(H<<25|ie>>>7),ut=(te>>>14|ee<<18)^(te>>>18|ee<<14)^(te<<23|ee>>>9),yt=(ee>>>14|te<<18)^(ee>>>18|te<<14)^(ee<<23|te>>>9),$t=d[ue],Tt=$t.high,We=$t.low,ce=ne+yt,Pe=Be+ut+(ce>>>0>>0?1:0),ce=ce+ae,Pe=Pe+J+(ce>>>0>>0?1:0),ce=ce+We,Pe=Pe+Tt+(ce>>>0>>0?1:0),ce=ce+Ne,Pe=Pe+xe+(ce>>>0>>0?1:0),Me=Ye+Re,ye=$e+Ce+(Me>>>0>>0?1:0);Be=X,ne=de,X=K,de=he,K=te,he=ee,ee=Te+ce|0,te=Oe+Pe+(ee>>>0>>0?1:0)|0,Oe=Le,Te=me,Le=re,me=le,re=ie,le=H,H=ce+Me|0,ie=Pe+ye+(H>>>0>>0?1:0)|0}k=y.low=k+H,y.high=x+ie+(k>>>0>>0?1:0),N=_.low=N+le,_.high=D+re+(N>>>0>>0?1:0),B=E.low=B+me,E.high=O+Le+(B>>>0>>0?1:0),M=v.low=M+Te,v.high=q+Oe+(M>>>0>>0?1:0),U=S.low=U+ee,S.high=L+te+(U>>>0>>0?1:0),Q=T.low=Q+he,T.high=j+K+(Q>>>0>>0?1:0),W=w.low=W+de,w.high=Y+X+(W>>>0>>0?1:0),z=R.low=z+ne,R.high=V+Be+(z>>>0>>0?1:0)},"_doProcessBlock"),_doFinalize:a(function(){var m=this._data,g=m.words,A=this._nDataBytes*8,y=m.sigBytes*8;g[y>>>5]|=128<<24-y%32,g[(y+128>>>10<<5)+30]=Math.floor(A/4294967296),g[(y+128>>>10<<5)+31]=A,m.sigBytes=g.length*4,this._process();var _=this._hash.toX32();return _},"_doFinalize"),clone:a(function(){var m=n.clone.call(this);return m._hash=this._hash.clone(),m},"clone"),blockSize:1024/32});e.SHA512=n._createHelper(h),e.HmacSHA512=n._createHmacHelper(h)})(),t.SHA512})});var Czr=I((e7e,vzr)=>{p();(function(t,e,r){typeof e7e=="object"?vzr.exports=e7e=e(fa(),oSe(),WDt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(e7e,function(t){return(function(){var e=t,r=e.x64,n=r.Word,o=r.WordArray,s=e.algo,c=s.SHA512,l=s.SHA384=c.extend({_doReset:a(function(){this._hash=new o.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},"_doReset"),_doFinalize:a(function(){var u=c._doFinalize.call(this);return u.sigBytes-=16,u},"_doFinalize")});e.SHA384=c._createHelper(l),e.HmacSHA384=c._createHmacHelper(l)})(),t.SHA384})});var Szr=I((t7e,bzr)=>{p();(function(t,e,r){typeof t7e=="object"?bzr.exports=t7e=e(fa(),oSe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(t7e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.x64,l=c.Word,u=r.algo,d=[],f=[],h=[];(function(){for(var A=1,y=0,_=0;_<24;_++){d[A+5*y]=(_+1)*(_+2)/2%64;var E=y%5,v=(2*A+3*y)%5;A=E,y=v}for(var A=0;A<5;A++)for(var y=0;y<5;y++)f[A+5*y]=y+(2*A+3*y)%5*5;for(var S=1,T=0;T<24;T++){for(var w=0,R=0,x=0;x<7;x++){if(S&1){var k=(1<>>24)&16711935|(S<<24|S>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var w=_[v];w.high^=T,w.low^=S}for(var R=0;R<24;R++){for(var x=0;x<5;x++){for(var k=0,D=0,N=0;N<5;N++){var w=_[x+5*N];k^=w.high,D^=w.low}var O=m[x];O.high=k,O.low=D}for(var x=0;x<5;x++)for(var B=m[(x+4)%5],q=m[(x+1)%5],M=q.high,L=q.low,k=B.high^(M<<1|L>>>31),D=B.low^(L<<1|M>>>31),N=0;N<5;N++){var w=_[x+5*N];w.high^=k,w.low^=D}for(var U=1;U<25;U++){var k,D,w=_[U],j=w.high,Q=w.low,Y=d[U];Y<32?(k=j<>>32-Y,D=Q<>>32-Y):(k=Q<>>64-Y,D=j<>>64-Y);var W=m[f[U]];W.high=k,W.low=D}var V=m[0],z=_[0];V.high=z.high,V.low=z.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var U=x+5*N,w=_[U],ie=m[U],H=m[(x+1)%5+5*N],re=m[(x+2)%5+5*N];w.high=ie.high^~H.high&re.high,w.low=ie.low^~H.low&re.low}var w=_[0],le=h[R];w.high^=le.high,w.low^=le.low}},"_doProcessBlock"),_doFinalize:a(function(){var A=this._data,y=A.words,_=this._nDataBytes*8,E=A.sigBytes*8,v=this.blockSize*32;y[E>>>5]|=1<<24-E%32,y[(e.ceil((E+1)/v)*v>>>5)-1]|=128,A.sigBytes=y.length*4,this._process();for(var S=this._state,T=this.cfg.outputLength/8,w=T/8,R=[],x=0;x>>24)&16711935|(D<<24|D>>>8)&4278255360,N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,R.push(N),R.push(D)}return new o.init(R,T)},"_doFinalize"),clone:a(function(){for(var A=s.clone.call(this),y=A._state=this._state.slice(0),_=0;_<25;_++)y[_]=y[_].clone();return A},"clone")});r.SHA3=s._createHelper(g),r.HmacSHA3=s._createHmacHelper(g)})(Math),t.SHA3})});var Izr=I((r7e,Tzr)=>{p();(function(t,e){typeof r7e=="object"?Tzr.exports=r7e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(r7e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),d=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=o.create([0,1518500249,1859775393,2400959708,2840853838]),m=o.create([1352829926,1548603684,1836072691,2053994217,0]),g=c.RIPEMD160=s.extend({_doReset:a(function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(T,w){for(var R=0;R<16;R++){var x=w+R,k=T[x];T[x]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}var D=this._hash.words,N=h.words,O=m.words,B=l.words,q=u.words,M=d.words,L=f.words,U,j,Q,Y,W,V,z,ie,H,re;V=U=D[0],z=j=D[1],ie=Q=D[2],H=Y=D[3],re=W=D[4];for(var le,R=0;R<80;R+=1)le=U+T[w+B[R]]|0,R<16?le+=A(j,Q,Y)+N[0]:R<32?le+=y(j,Q,Y)+N[1]:R<48?le+=_(j,Q,Y)+N[2]:R<64?le+=E(j,Q,Y)+N[3]:le+=v(j,Q,Y)+N[4],le=le|0,le=S(le,M[R]),le=le+W|0,U=W,W=Y,Y=S(Q,10),Q=j,j=le,le=V+T[w+q[R]]|0,R<16?le+=v(z,ie,H)+O[0]:R<32?le+=E(z,ie,H)+O[1]:R<48?le+=_(z,ie,H)+O[2]:R<64?le+=y(z,ie,H)+O[3]:le+=A(z,ie,H)+O[4],le=le|0,le=S(le,L[R]),le=le+re|0,V=re,re=H,H=S(ie,10),ie=z,z=le;le=D[1]+Q+H|0,D[1]=D[2]+Y+re|0,D[2]=D[3]+W+V|0,D[3]=D[4]+U+z|0,D[4]=D[0]+j+ie|0,D[0]=le},"_doProcessBlock"),_doFinalize:a(function(){var T=this._data,w=T.words,R=this._nDataBytes*8,x=T.sigBytes*8;w[x>>>5]|=128<<24-x%32,w[(x+64>>>9<<4)+14]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,T.sigBytes=(w.length+1)*4,this._process();for(var k=this._hash,D=k.words,N=0;N<5;N++){var O=D[N];D[N]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}return k},"_doFinalize"),clone:a(function(){var T=s.clone.call(this);return T._hash=this._hash.clone(),T},"clone")});function A(T,w,R){return T^w^R}a(A,"f1");function y(T,w,R){return T&w|~T&R}a(y,"f2");function _(T,w,R){return(T|~w)^R}a(_,"f3");function E(T,w,R){return T&R|w&~R}a(E,"f4");function v(T,w,R){return T^(w|~R)}a(v,"f5");function S(T,w){return T<>>32-w}a(S,"rotl"),r.RIPEMD160=s._createHelper(g),r.HmacRIPEMD160=s._createHmacHelper(g)})(Math),t.RIPEMD160})});var i7e=I((n7e,xzr)=>{p();(function(t,e){typeof n7e=="object"?xzr.exports=n7e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(n7e,function(t){(function(){var e=t,r=e.lib,n=r.Base,o=e.enc,s=o.Utf8,c=e.algo,l=c.HMAC=n.extend({init:a(function(u,d){u=this._hasher=new u.init,typeof d=="string"&&(d=s.parse(d));var f=u.blockSize,h=f*4;d.sigBytes>h&&(d=u.finalize(d)),d.clamp();for(var m=this._oKey=d.clone(),g=this._iKey=d.clone(),A=m.words,y=g.words,_=0;_{p();(function(t,e,r){typeof o7e=="object"?wzr.exports=o7e=e(fa(),J9e(),i7e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(o7e,function(t){return(function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,s=e.algo,c=s.SHA256,l=s.HMAC,u=s.PBKDF2=n.extend({cfg:n.extend({keySize:128/32,hasher:c,iterations:25e4}),init:a(function(d){this.cfg=this.cfg.extend(d)},"init"),compute:a(function(d,f){for(var h=this.cfg,m=l.create(h.hasher,d),g=o.create(),A=o.create([1]),y=g.words,_=A.words,E=h.keySize,v=h.iterations;y.length{p();(function(t,e,r){typeof s7e=="object"?kzr.exports=s7e=e(fa(),VDt(),i7e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(s7e,function(t){return(function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,s=e.algo,c=s.MD5,l=s.EvpKDF=n.extend({cfg:n.extend({keySize:128/32,hasher:c,iterations:1}),init:a(function(u){this.cfg=this.cfg.extend(u)},"init"),compute:a(function(u,d){for(var f,h=this.cfg,m=h.hasher.create(),g=o.create(),A=g.words,y=h.keySize,_=h.iterations;A.length{p();(function(t,e,r){typeof a7e=="object"?Pzr.exports=a7e=e(fa(),qB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(a7e,function(t){t.lib.Cipher||(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=n.BufferedBlockAlgorithm,l=r.enc,u=l.Utf8,d=l.Base64,f=r.algo,h=f.EvpKDF,m=n.Cipher=c.extend({cfg:o.extend(),createEncryptor:a(function(O,B){return this.create(this._ENC_XFORM_MODE,O,B)},"createEncryptor"),createDecryptor:a(function(O,B){return this.create(this._DEC_XFORM_MODE,O,B)},"createDecryptor"),init:a(function(O,B,q){this.cfg=this.cfg.extend(q),this._xformMode=O,this._key=B,this.reset()},"init"),reset:a(function(){c.reset.call(this),this._doReset()},"reset"),process:a(function(O){return this._append(O),this._process()},"process"),finalize:a(function(O){O&&this._append(O);var B=this._doFinalize();return B},"finalize"),keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function O(B){return typeof B=="string"?N:x}return a(O,"selectCipherStrategy"),function(B){return{encrypt:a(function(q,M,L){return O(M).encrypt(B,q,M,L)},"encrypt"),decrypt:a(function(q,M,L){return O(M).decrypt(B,q,M,L)},"decrypt")}}})()}),g=n.StreamCipher=m.extend({_doFinalize:a(function(){var O=this._process(!0);return O},"_doFinalize"),blockSize:1}),A=r.mode={},y=n.BlockCipherMode=o.extend({createEncryptor:a(function(O,B){return this.Encryptor.create(O,B)},"createEncryptor"),createDecryptor:a(function(O,B){return this.Decryptor.create(O,B)},"createDecryptor"),init:a(function(O,B){this._cipher=O,this._iv=B},"init")}),_=A.CBC=(function(){var O=y.extend();O.Encryptor=O.extend({processBlock:a(function(q,M){var L=this._cipher,U=L.blockSize;B.call(this,q,M,U),L.encryptBlock(q,M),this._prevBlock=q.slice(M,M+U)},"processBlock")}),O.Decryptor=O.extend({processBlock:a(function(q,M){var L=this._cipher,U=L.blockSize,j=q.slice(M,M+U);L.decryptBlock(q,M),B.call(this,q,M,U),this._prevBlock=j},"processBlock")});function B(q,M,L){var U,j=this._iv;j?(U=j,this._iv=e):U=this._prevBlock;for(var Q=0;Q>>2]&255;O.sigBytes-=B},"unpad")},S=n.BlockCipher=m.extend({cfg:m.cfg.extend({mode:_,padding:v}),reset:a(function(){var O;m.reset.call(this);var B=this.cfg,q=B.iv,M=B.mode;this._xformMode==this._ENC_XFORM_MODE?O=M.createEncryptor:(O=M.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==O?this._mode.init(this,q&&q.words):(this._mode=O.call(M,this,q&&q.words),this._mode.__creator=O)},"reset"),_doProcessBlock:a(function(O,B){this._mode.processBlock(O,B)},"_doProcessBlock"),_doFinalize:a(function(){var O,B=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(B.pad(this._data,this.blockSize),O=this._process(!0)):(O=this._process(!0),B.unpad(O)),O},"_doFinalize"),blockSize:128/32}),T=n.CipherParams=o.extend({init:a(function(O){this.mixIn(O)},"init"),toString:a(function(O){return(O||this.formatter).stringify(this)},"toString")}),w=r.format={},R=w.OpenSSL={stringify:a(function(O){var B,q=O.ciphertext,M=O.salt;return M?B=s.create([1398893684,1701076831]).concat(M).concat(q):B=q,B.toString(d)},"stringify"),parse:a(function(O){var B,q=d.parse(O),M=q.words;return M[0]==1398893684&&M[1]==1701076831&&(B=s.create(M.slice(2,4)),M.splice(0,4),q.sigBytes-=16),T.create({ciphertext:q,salt:B})},"parse")},x=n.SerializableCipher=o.extend({cfg:o.extend({format:R}),encrypt:a(function(O,B,q,M){M=this.cfg.extend(M);var L=O.createEncryptor(q,M),U=L.finalize(B),j=L.cfg;return T.create({ciphertext:U,key:q,iv:j.iv,algorithm:O,mode:j.mode,padding:j.padding,blockSize:O.blockSize,formatter:M.format})},"encrypt"),decrypt:a(function(O,B,q,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var L=O.createDecryptor(q,M).finalize(B.ciphertext);return L},"decrypt"),_parse:a(function(O,B){return typeof O=="string"?B.parse(O,this):O},"_parse")}),k=r.kdf={},D=k.OpenSSL={execute:a(function(O,B,q,M,L){if(M||(M=s.random(64/8)),L)var U=h.create({keySize:B+q,hasher:L}).compute(O,M);else var U=h.create({keySize:B+q}).compute(O,M);var j=s.create(U.words.slice(B),q*4);return U.sigBytes=B*4,T.create({key:U,iv:j,salt:M})},"execute")},N=n.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:D}),encrypt:a(function(O,B,q,M){M=this.cfg.extend(M);var L=M.kdf.execute(q,O.keySize,O.ivSize,M.salt,M.hasher);M.iv=L.iv;var U=x.encrypt.call(this,O,B,L.key,M);return U.mixIn(L),U},"encrypt"),decrypt:a(function(O,B,q,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var L=M.kdf.execute(q,O.keySize,O.ivSize,B.salt,M.hasher);M.iv=L.iv;var U=x.decrypt.call(this,O,B,L.key,M);return U},"decrypt")})})()})});var Nzr=I((c7e,Dzr)=>{p();(function(t,e,r){typeof c7e=="object"?Dzr.exports=c7e=e(fa(),tg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(c7e,function(t){return t.mode.CFB=(function(){var e=t.lib.BlockCipherMode.extend();e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize;r.call(this,n,o,c,s),this._prevBlock=n.slice(o,o+c)},"processBlock")}),e.Decryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=n.slice(o,o+c);r.call(this,n,o,c,s),this._prevBlock=l},"processBlock")});function r(n,o,s,c){var l,u=this._iv;u?(l=u.slice(0),this._iv=void 0):l=this._prevBlock,c.encryptBlock(l,0);for(var d=0;d{p();(function(t,e,r){typeof l7e=="object"?Mzr.exports=l7e=e(fa(),tg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(l7e,function(t){return t.mode.CTR=(function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=this._iv,u=this._counter;l&&(u=this._counter=l.slice(0),this._iv=void 0);var d=u.slice(0);s.encryptBlock(d,0),u[c-1]=u[c-1]+1|0;for(var f=0;f{p();(function(t,e,r){typeof u7e=="object"?Lzr.exports=u7e=e(fa(),tg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(u7e,function(t){return t.mode.CTRGladman=(function(){var e=t.lib.BlockCipherMode.extend();function r(s){if((s>>24&255)===255){var c=s>>16&255,l=s>>8&255,u=s&255;c===255?(c=0,l===255?(l=0,u===255?u=0:++u):++l):++c,s=0,s+=c<<16,s+=l<<8,s+=u}else s+=1<<24;return s}a(r,"incWord");function n(s){return(s[0]=r(s[0]))===0&&(s[1]=r(s[1])),s}a(n,"incCounter");var o=e.Encryptor=e.extend({processBlock:a(function(s,c){var l=this._cipher,u=l.blockSize,d=this._iv,f=this._counter;d&&(f=this._counter=d.slice(0),this._iv=void 0),n(f);var h=f.slice(0);l.encryptBlock(h,0);for(var m=0;m{p();(function(t,e,r){typeof d7e=="object"?Fzr.exports=d7e=e(fa(),tg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(d7e,function(t){return t.mode.OFB=(function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=this._iv,u=this._keystream;l&&(u=this._keystream=l.slice(0),this._iv=void 0),s.encryptBlock(u,0);for(var d=0;d{p();(function(t,e,r){typeof f7e=="object"?Qzr.exports=f7e=e(fa(),tg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(f7e,function(t){return t.mode.ECB=(function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:a(function(r,n){this._cipher.encryptBlock(r,n)},"processBlock")}),e.Decryptor=e.extend({processBlock:a(function(r,n){this._cipher.decryptBlock(r,n)},"processBlock")}),e})(),t.mode.ECB})});var Hzr=I((p7e,jzr)=>{p();(function(t,e,r){typeof p7e=="object"?jzr.exports=p7e=e(fa(),tg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(p7e,function(t){return t.pad.AnsiX923={pad:a(function(e,r){var n=e.sigBytes,o=r*4,s=o-n%o,c=n+s-1;e.clamp(),e.words[c>>>2]|=s<<24-c%4*8,e.sigBytes+=s},"pad"),unpad:a(function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r},"unpad")},t.pad.Ansix923})});var $zr=I((h7e,Gzr)=>{p();(function(t,e,r){typeof h7e=="object"?Gzr.exports=h7e=e(fa(),tg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(h7e,function(t){return t.pad.Iso10126={pad:a(function(e,r){var n=r*4,o=n-e.sigBytes%n;e.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},"pad"),unpad:a(function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r},"unpad")},t.pad.Iso10126})});var Wzr=I((m7e,Vzr)=>{p();(function(t,e,r){typeof m7e=="object"?Vzr.exports=m7e=e(fa(),tg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(m7e,function(t){return t.pad.Iso97971={pad:a(function(e,r){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,r)},"pad"),unpad:a(function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--},"unpad")},t.pad.Iso97971})});var Yzr=I((g7e,zzr)=>{p();(function(t,e,r){typeof g7e=="object"?zzr.exports=g7e=e(fa(),tg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(g7e,function(t){return t.pad.ZeroPadding={pad:a(function(e,r){var n=r*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},"pad"),unpad:a(function(e){for(var r=e.words,n=e.sigBytes-1,n=e.sigBytes-1;n>=0;n--)if(r[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}},"unpad")},t.pad.ZeroPadding})});var Jzr=I((A7e,Kzr)=>{p();(function(t,e,r){typeof A7e=="object"?Kzr.exports=A7e=e(fa(),tg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(A7e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var Xzr=I((y7e,Zzr)=>{p();(function(t,e,r){typeof y7e=="object"?Zzr.exports=y7e=e(fa(),tg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(y7e,function(t){return(function(e){var r=t,n=r.lib,o=n.CipherParams,s=r.enc,c=s.Hex,l=r.format,u=l.Hex={stringify:a(function(d){return d.ciphertext.toString(c)},"stringify"),parse:a(function(d){var f=c.parse(d);return o.create({ciphertext:f})},"parse")}})(),t.format.Hex})});var tYr=I((_7e,eYr)=>{p();(function(t,e,r){typeof _7e=="object"?eYr.exports=_7e=e(fa(),W9(),z9(),qB(),tg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(_7e,function(t){return(function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo,s=[],c=[],l=[],u=[],d=[],f=[],h=[],m=[],g=[],A=[];(function(){for(var E=[],v=0;v<256;v++)v<128?E[v]=v<<1:E[v]=v<<1^283;for(var S=0,T=0,v=0;v<256;v++){var w=T^T<<1^T<<2^T<<3^T<<4;w=w>>>8^w&255^99,s[S]=w,c[w]=S;var R=E[S],x=E[R],k=E[x],D=E[w]*257^w*16843008;l[S]=D<<24|D>>>8,u[S]=D<<16|D>>>16,d[S]=D<<8|D>>>24,f[S]=D;var D=k*16843009^x*65537^R*257^S*16843008;h[w]=D<<24|D>>>8,m[w]=D<<16|D>>>16,g[w]=D<<8|D>>>24,A[w]=D,S?(S=R^E[E[E[k^R]]],T^=E[E[T]]):S=T=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],_=o.AES=n.extend({_doReset:a(function(){var E;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,S=v.words,T=v.sigBytes/4,w=this._nRounds=T+6,R=(w+1)*4,x=this._keySchedule=[],k=0;k6&&k%T==4&&(E=s[E>>>24]<<24|s[E>>>16&255]<<16|s[E>>>8&255]<<8|s[E&255]):(E=E<<8|E>>>24,E=s[E>>>24]<<24|s[E>>>16&255]<<16|s[E>>>8&255]<<8|s[E&255],E^=y[k/T|0]<<24),x[k]=x[k-T]^E);for(var D=this._invKeySchedule=[],N=0;N>>24]]^m[s[E>>>16&255]]^g[s[E>>>8&255]]^A[s[E&255]]}}},"_doReset"),encryptBlock:a(function(E,v){this._doCryptBlock(E,v,this._keySchedule,l,u,d,f,s)},"encryptBlock"),decryptBlock:a(function(E,v){var S=E[v+1];E[v+1]=E[v+3],E[v+3]=S,this._doCryptBlock(E,v,this._invKeySchedule,h,m,g,A,c);var S=E[v+1];E[v+1]=E[v+3],E[v+3]=S},"decryptBlock"),_doCryptBlock:a(function(E,v,S,T,w,R,x,k){for(var D=this._nRounds,N=E[v]^S[0],O=E[v+1]^S[1],B=E[v+2]^S[2],q=E[v+3]^S[3],M=4,L=1;L>>24]^w[O>>>16&255]^R[B>>>8&255]^x[q&255]^S[M++],j=T[O>>>24]^w[B>>>16&255]^R[q>>>8&255]^x[N&255]^S[M++],Q=T[B>>>24]^w[q>>>16&255]^R[N>>>8&255]^x[O&255]^S[M++],Y=T[q>>>24]^w[N>>>16&255]^R[O>>>8&255]^x[B&255]^S[M++];N=U,O=j,B=Q,q=Y}var U=(k[N>>>24]<<24|k[O>>>16&255]<<16|k[B>>>8&255]<<8|k[q&255])^S[M++],j=(k[O>>>24]<<24|k[B>>>16&255]<<16|k[q>>>8&255]<<8|k[N&255])^S[M++],Q=(k[B>>>24]<<24|k[q>>>16&255]<<16|k[N>>>8&255]<<8|k[O&255])^S[M++],Y=(k[q>>>24]<<24|k[N>>>16&255]<<16|k[O>>>8&255]<<8|k[B&255])^S[M++];E[v]=U,E[v+1]=j,E[v+2]=Q,E[v+3]=Y},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(_)})(),t.AES})});var nYr=I((E7e,rYr)=>{p();(function(t,e,r){typeof E7e=="object"?rYr.exports=E7e=e(fa(),W9(),z9(),qB(),tg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(E7e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=r.BlockCipher,s=e.algo,c=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],l=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=s.DES=o.extend({_doReset:a(function(){for(var y=this._key,_=y.words,E=[],v=0;v<56;v++){var S=c[v]-1;E[v]=_[S>>>5]>>>31-S%32&1}for(var T=this._subKeys=[],w=0;w<16;w++){for(var R=T[w]=[],x=u[w],v=0;v<24;v++)R[v/6|0]|=E[(l[v]-1+x)%28]<<31-v%6,R[4+(v/6|0)]|=E[28+(l[v+24]-1+x)%28]<<31-v%6;R[0]=R[0]<<1|R[0]>>>31;for(var v=1;v<7;v++)R[v]=R[v]>>>(v-1)*4+3;R[7]=R[7]<<5|R[7]>>>27}for(var k=this._invSubKeys=[],v=0;v<16;v++)k[v]=T[15-v]},"_doReset"),encryptBlock:a(function(y,_){this._doCryptBlock(y,_,this._subKeys)},"encryptBlock"),decryptBlock:a(function(y,_){this._doCryptBlock(y,_,this._invSubKeys)},"decryptBlock"),_doCryptBlock:a(function(y,_,E){this._lBlock=y[_],this._rBlock=y[_+1],m.call(this,4,252645135),m.call(this,16,65535),g.call(this,2,858993459),g.call(this,8,16711935),m.call(this,1,1431655765);for(var v=0;v<16;v++){for(var S=E[v],T=this._lBlock,w=this._rBlock,R=0,x=0;x<8;x++)R|=d[x][((w^S[x])&f[x])>>>0];this._lBlock=w,this._rBlock=T^R}var k=this._lBlock;this._lBlock=this._rBlock,this._rBlock=k,m.call(this,1,1431655765),g.call(this,8,16711935),g.call(this,2,858993459),m.call(this,16,65535),m.call(this,4,252645135),y[_]=this._lBlock,y[_+1]=this._rBlock},"_doCryptBlock"),keySize:64/32,ivSize:64/32,blockSize:64/32});function m(y,_){var E=(this._lBlock>>>y^this._rBlock)&_;this._rBlock^=E,this._lBlock^=E<>>y^this._lBlock)&_;this._lBlock^=E,this._rBlock^=E<192.");var E=_.slice(0,2),v=_.length<4?_.slice(0,2):_.slice(2,4),S=_.length<6?_.slice(0,2):_.slice(4,6);this._des1=h.createEncryptor(n.create(E)),this._des2=h.createEncryptor(n.create(v)),this._des3=h.createEncryptor(n.create(S))},"_doReset"),encryptBlock:a(function(y,_){this._des1.encryptBlock(y,_),this._des2.decryptBlock(y,_),this._des3.encryptBlock(y,_)},"encryptBlock"),decryptBlock:a(function(y,_){this._des3.decryptBlock(y,_),this._des2.encryptBlock(y,_),this._des1.decryptBlock(y,_)},"decryptBlock"),keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=o._createHelper(A)})(),t.TripleDES})});var oYr=I((v7e,iYr)=>{p();(function(t,e,r){typeof v7e=="object"?iYr.exports=v7e=e(fa(),W9(),z9(),qB(),tg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(v7e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=o.RC4=n.extend({_doReset:a(function(){for(var u=this._key,d=u.words,f=u.sigBytes,h=this._S=[],m=0;m<256;m++)h[m]=m;for(var m=0,g=0;m<256;m++){var A=m%f,y=d[A>>>2]>>>24-A%4*8&255;g=(g+h[m]+y)%256;var _=h[m];h[m]=h[g],h[g]=_}this._i=this._j=0},"_doReset"),_doProcessBlock:a(function(u,d){u[d]^=c.call(this)},"_doProcessBlock"),keySize:256/32,ivSize:0});function c(){for(var u=this._S,d=this._i,f=this._j,h=0,m=0;m<4;m++){d=(d+1)%256,f=(f+u[d])%256;var g=u[d];u[d]=u[f],u[f]=g,h|=u[(u[d]+u[f])%256]<<24-m*8}return this._i=d,this._j=f,h}a(c,"generateKeystreamWord"),e.RC4=n._createHelper(s);var l=o.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:a(function(){s._doReset.call(this);for(var u=this.cfg.drop;u>0;u--)c.call(this)},"_doReset")});e.RC4Drop=n._createHelper(l)})(),t.RC4})});var aYr=I((C7e,sYr)=>{p();(function(t,e,r){typeof C7e=="object"?sYr.exports=C7e=e(fa(),W9(),z9(),qB(),tg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(C7e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=[],c=[],l=[],u=o.Rabbit=n.extend({_doReset:a(function(){for(var f=this._key.words,h=this.cfg.iv,m=0;m<4;m++)f[m]=(f[m]<<8|f[m]>>>24)&16711935|(f[m]<<24|f[m]>>>8)&4278255360;var g=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],A=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var m=0;m<4;m++)d.call(this);for(var m=0;m<8;m++)A[m]^=g[m+4&7];if(h){var y=h.words,_=y[0],E=y[1],v=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,S=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,T=v>>>16|S&4294901760,w=S<<16|v&65535;A[0]^=v,A[1]^=T,A[2]^=S,A[3]^=w,A[4]^=v,A[5]^=T,A[6]^=S,A[7]^=w;for(var m=0;m<4;m++)d.call(this)}},"_doReset"),_doProcessBlock:a(function(f,h){var m=this._X;d.call(this),s[0]=m[0]^m[5]>>>16^m[3]<<16,s[1]=m[2]^m[7]>>>16^m[5]<<16,s[2]=m[4]^m[1]>>>16^m[7]<<16,s[3]=m[6]^m[3]>>>16^m[1]<<16;for(var g=0;g<4;g++)s[g]=(s[g]<<8|s[g]>>>24)&16711935|(s[g]<<24|s[g]>>>8)&4278255360,f[h+g]^=s[g]},"_doProcessBlock"),blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,m=0;m<8;m++)c[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var g=f[m]+h[m],A=g&65535,y=g>>>16,_=((A*A>>>17)+A*y>>>15)+y*y,E=((g&4294901760)*g|0)+((g&65535)*g|0);l[m]=_^E}f[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,f[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,f[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,f[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,f[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,f[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,f[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,f[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}a(d,"nextState"),e.Rabbit=n._createHelper(u)})(),t.Rabbit})});var lYr=I((b7e,cYr)=>{p();(function(t,e,r){typeof b7e=="object"?cYr.exports=b7e=e(fa(),W9(),z9(),qB(),tg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(b7e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=[],c=[],l=[],u=o.RabbitLegacy=n.extend({_doReset:a(function(){var f=this._key.words,h=this.cfg.iv,m=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],g=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var A=0;A<4;A++)d.call(this);for(var A=0;A<8;A++)g[A]^=m[A+4&7];if(h){var y=h.words,_=y[0],E=y[1],v=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,S=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,T=v>>>16|S&4294901760,w=S<<16|v&65535;g[0]^=v,g[1]^=T,g[2]^=S,g[3]^=w,g[4]^=v,g[5]^=T,g[6]^=S,g[7]^=w;for(var A=0;A<4;A++)d.call(this)}},"_doReset"),_doProcessBlock:a(function(f,h){var m=this._X;d.call(this),s[0]=m[0]^m[5]>>>16^m[3]<<16,s[1]=m[2]^m[7]>>>16^m[5]<<16,s[2]=m[4]^m[1]>>>16^m[7]<<16,s[3]=m[6]^m[3]>>>16^m[1]<<16;for(var g=0;g<4;g++)s[g]=(s[g]<<8|s[g]>>>24)&16711935|(s[g]<<24|s[g]>>>8)&4278255360,f[h+g]^=s[g]},"_doProcessBlock"),blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,m=0;m<8;m++)c[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var g=f[m]+h[m],A=g&65535,y=g>>>16,_=((A*A>>>17)+A*y>>>15)+y*y,E=((g&4294901760)*g|0)+((g&65535)*g|0);l[m]=_^E}f[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,f[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,f[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,f[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,f[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,f[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,f[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,f[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}a(d,"nextState"),e.RabbitLegacy=n._createHelper(u)})(),t.RabbitLegacy})});var dYr=I((S7e,uYr)=>{p();(function(t,e,r){typeof S7e=="object"?uYr.exports=S7e=e(fa(),W9(),z9(),qB(),tg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(S7e,function(t){return(function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo;let s=16,c=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],l=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var u={pbox:[],sbox:[]};function d(A,y){let _=y>>24&255,E=y>>16&255,v=y>>8&255,S=y&255,T=A.sbox[0][_]+A.sbox[1][E];return T=T^A.sbox[2][v],T=T+A.sbox[3][S],T}a(d,"F");function f(A,y,_){let E=y,v=_,S;for(let T=0;T1;--T)E=E^A.pbox[T],v=d(A,E)^v,S=E,E=v,v=S;return S=E,E=v,v=S,v=v^A.pbox[1],E=E^A.pbox[0],{left:E,right:v}}a(h,"BlowFish_Decrypt");function m(A,y,_){for(let w=0;w<4;w++){A.sbox[w]=[];for(let R=0;R<256;R++)A.sbox[w][R]=l[w][R]}let E=0;for(let w=0;w=_&&(E=0);let v=0,S=0,T=0;for(let w=0;w{p();(function(t,e,r){typeof T7e=="object"?fYr.exports=T7e=e(fa(),oSe(),lzr(),dzr(),W9(),hzr(),z9(),VDt(),J9e(),_zr(),WDt(),Czr(),Szr(),Izr(),i7e(),Rzr(),qB(),tg(),Nzr(),Ozr(),Bzr(),Uzr(),qzr(),Hzr(),$zr(),Wzr(),Yzr(),Jzr(),Xzr(),tYr(),nYr(),oYr(),aYr(),lYr(),dYr()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./enc-base64url","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy","./blowfish"],e):t.CryptoJS=e(t.CryptoJS)})(T7e,function(t){return t})});var zse=I(n_=>{"use strict";p();Object.defineProperty(n_,"__esModule",{value:!0});n_.stringArray=n_.array=n_.func=n_.error=n_.number=n_.string=n_.boolean=void 0;function h1o(t){return t===!0||t===!1}a(h1o,"boolean");n_.boolean=h1o;function YJr(t){return typeof t=="string"||t instanceof String}a(YJr,"string");n_.string=YJr;function m1o(t){return typeof t=="number"||t instanceof Number}a(m1o,"number");n_.number=m1o;function g1o(t){return t instanceof Error}a(g1o,"error");n_.error=g1o;function A1o(t){return typeof t=="function"}a(A1o,"func");n_.func=A1o;function KJr(t){return Array.isArray(t)}a(KJr,"array");n_.array=KJr;function y1o(t){return KJr(t)&&t.every(e=>YJr(e))}a(y1o,"stringArray");n_.stringArray=y1o});var AMt=I(gi=>{"use strict";p();Object.defineProperty(gi,"__esModule",{value:!0});gi.Message=gi.NotificationType9=gi.NotificationType8=gi.NotificationType7=gi.NotificationType6=gi.NotificationType5=gi.NotificationType4=gi.NotificationType3=gi.NotificationType2=gi.NotificationType1=gi.NotificationType0=gi.NotificationType=gi.RequestType9=gi.RequestType8=gi.RequestType7=gi.RequestType6=gi.RequestType5=gi.RequestType4=gi.RequestType3=gi.RequestType2=gi.RequestType1=gi.RequestType=gi.RequestType0=gi.AbstractMessageSignature=gi.ParameterStructures=gi.ResponseError=gi.ErrorCodes=void 0;var Nz=zse(),WNt;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(WNt||(gi.ErrorCodes=WNt={}));var zNt=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=Nz.number(e)?e:WNt.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};gi.ResponseError=zNt;var wC=class t{static{a(this,"ParameterStructures")}constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};gi.ParameterStructures=wC;wC.auto=new wC("auto");wC.byPosition=new wC("byPosition");wC.byName=new wC("byName");var Xu=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return wC.auto}};gi.AbstractMessageSignature=Xu;var YNt=class extends Xu{static{a(this,"RequestType0")}constructor(e){super(e,0)}};gi.RequestType0=YNt;var KNt=class extends Xu{static{a(this,"RequestType")}constructor(e,r=wC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};gi.RequestType=KNt;var JNt=class extends Xu{static{a(this,"RequestType1")}constructor(e,r=wC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};gi.RequestType1=JNt;var ZNt=class extends Xu{static{a(this,"RequestType2")}constructor(e){super(e,2)}};gi.RequestType2=ZNt;var XNt=class extends Xu{static{a(this,"RequestType3")}constructor(e){super(e,3)}};gi.RequestType3=XNt;var eMt=class extends Xu{static{a(this,"RequestType4")}constructor(e){super(e,4)}};gi.RequestType4=eMt;var tMt=class extends Xu{static{a(this,"RequestType5")}constructor(e){super(e,5)}};gi.RequestType5=tMt;var rMt=class extends Xu{static{a(this,"RequestType6")}constructor(e){super(e,6)}};gi.RequestType6=rMt;var nMt=class extends Xu{static{a(this,"RequestType7")}constructor(e){super(e,7)}};gi.RequestType7=nMt;var iMt=class extends Xu{static{a(this,"RequestType8")}constructor(e){super(e,8)}};gi.RequestType8=iMt;var oMt=class extends Xu{static{a(this,"RequestType9")}constructor(e){super(e,9)}};gi.RequestType9=oMt;var sMt=class extends Xu{static{a(this,"NotificationType")}constructor(e,r=wC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};gi.NotificationType=sMt;var aMt=class extends Xu{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};gi.NotificationType0=aMt;var cMt=class extends Xu{static{a(this,"NotificationType1")}constructor(e,r=wC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};gi.NotificationType1=cMt;var lMt=class extends Xu{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};gi.NotificationType2=lMt;var uMt=class extends Xu{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};gi.NotificationType3=uMt;var dMt=class extends Xu{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};gi.NotificationType4=dMt;var fMt=class extends Xu{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};gi.NotificationType5=fMt;var pMt=class extends Xu{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};gi.NotificationType6=pMt;var hMt=class extends Xu{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};gi.NotificationType7=hMt;var mMt=class extends Xu{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};gi.NotificationType8=mMt;var gMt=class extends Xu{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};gi.NotificationType9=gMt;var JJr;(function(t){function e(o){let s=o;return s&&Nz.string(s.method)&&(Nz.string(s.id)||Nz.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&Nz.string(s.method)&&o.id===void 0}a(r,"isNotification"),t.isNotification=r;function n(o){let s=o;return s&&(s.result!==void 0||!!s.error)&&(Nz.string(s.id)||Nz.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})(JJr||(gi.Message=JJr={}))});var _Mt=I(u7=>{"use strict";p();var ZJr;Object.defineProperty(u7,"__esModule",{value:!0});u7.LRUCache=u7.LinkedMap=u7.Touch=void 0;var i_;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(i_||(u7.Touch=i_={}));var aQe=class{static{a(this,"LinkedMap")}constructor(){this[ZJr]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=i_.None){let n=this._map.get(e);if(n)return r!==i_.None&&this.touch(n,r),n.value}set(e,r,n=i_.None){let o=this._map.get(e);if(o)o.value=r,n!==i_.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case i_.None:this.addItemLast(o);break;case i_.First:this.addItemFirst(o);break;case i_.Last:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}[(ZJr=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==i_.First&&r!==i_.Last)){if(r===i_.First){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===i_.Last){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};u7.LinkedMap=aQe;var yMt=class extends aQe{static{a(this,"LRUCache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=i_.AsNew){return super.get(e,r)}peek(e){return super.get(e,i_.None)}set(e,r){return super.set(e,r,i_.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};u7.LRUCache=yMt});var eZr=I(cQe=>{"use strict";p();Object.defineProperty(cQe,"__esModule",{value:!0});cQe.Disposable=void 0;var XJr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(XJr||(cQe.Disposable=XJr={}))});var d7=I(CMt=>{"use strict";p();Object.defineProperty(CMt,"__esModule",{value:!0});var EMt;function vMt(){if(EMt===void 0)throw new Error("No runtime abstraction layer installed");return EMt}a(vMt,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");EMt=r}a(e,"install"),t.install=e})(vMt||(vMt={}));CMt.default=vMt});var Kse=I(Yse=>{"use strict";p();Object.defineProperty(Yse,"__esModule",{value:!0});Yse.Emitter=Yse.Event=void 0;var _1o=d7(),tZr;(function(t){let e={dispose(){}};t.None=function(){return e}})(tZr||(Yse.Event=tZr={}));var bMt=class{static{a(this,"CallbackList")}add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:a(()=>this.remove(e,r),"dispose")})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let o=0,s=this._callbacks.length;o{this._callbacks||(this._callbacks=new bMt),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let o={dispose:a(()=>{this._callbacks&&(this._callbacks.remove(e,r),o.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(n)&&n.push(o),o}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Yse.Emitter=lQe;lQe._noop=function(){}});var fQe=I(Jse=>{"use strict";p();Object.defineProperty(Jse,"__esModule",{value:!0});Jse.CancellationTokenSource=Jse.CancellationToken=void 0;var E1o=d7(),v1o=zse(),SMt=Kse(),uQe;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:SMt.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:SMt.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||v1o.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})(uQe||(Jse.CancellationToken=uQe={}));var C1o=Object.freeze(function(t,e){let r=(0,E1o.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),dQe=class{static{a(this,"MutableToken")}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?C1o:(this._emitter||(this._emitter=new SMt.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},TMt=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new dQe),this._token}cancel(){this._token?this._token.cancel():this._token=uQe.Cancelled}dispose(){this._token?this._token instanceof dQe&&this._token.dispose():this._token=uQe.None}};Jse.CancellationTokenSource=TMt});var rZr=I(Zse=>{"use strict";p();Object.defineProperty(Zse,"__esModule",{value:!0});Zse.SharedArrayReceiverStrategy=Zse.SharedArraySenderStrategy=void 0;var b1o=fQe(),TSe;(function(t){t.Continue=0,t.Cancelled=1})(TSe||(TSe={}));var IMt=class{static{a(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=TSe.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let o=new Int32Array(n,0,1);Atomics.store(o,0,TSe.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Zse.SharedArraySenderStrategy=IMt;var xMt=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===TSe.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},wMt=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new xMt(e)}cancel(){}dispose(){}},RMt=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new b1o.CancellationTokenSource:new wMt(r)}};Zse.SharedArrayReceiverStrategy=RMt});var PMt=I(pQe=>{"use strict";p();Object.defineProperty(pQe,"__esModule",{value:!0});pQe.Semaphore=void 0;var S1o=d7(),kMt=class{static{a(this,"Semaphore")}constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,S1o.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};pQe.Semaphore=kMt});var iZr=I(f7=>{"use strict";p();Object.defineProperty(f7,"__esModule",{value:!0});f7.ReadableStreamMessageReader=f7.AbstractMessageReader=f7.MessageReader=void 0;var NMt=d7(),Xse=zse(),DMt=Kse(),T1o=PMt(),nZr;(function(t){function e(r){let n=r;return n&&Xse.func(n.listen)&&Xse.func(n.dispose)&&Xse.func(n.onError)&&Xse.func(n.onClose)&&Xse.func(n.onPartialMessage)}a(e,"is"),t.is=e})(nZr||(f7.MessageReader=nZr={}));var hQe=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new DMt.Emitter,this.closeEmitter=new DMt.Emitter,this.partialMessageEmitter=new DMt.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Xse.string(e.message)?e.message:"unknown"}`)}};f7.AbstractMessageReader=hQe;var MMt;(function(t){function e(r){let n,o,s,c=new Map,l,u=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,c.set(s.name,s)),r.contentDecoders!==void 0)for(let d of r.contentDecoders)c.set(d.name,d);if(r.contentTypeDecoder!==void 0&&(l=r.contentTypeDecoder,u.set(l.name,l)),r.contentTypeDecoders!==void 0)for(let d of r.contentTypeDecoders)u.set(d.name,d)}return l===void 0&&(l=(0,NMt.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(MMt||(MMt={}));var OMt=class extends hQe{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=MMt.fromOptions(r),this.buffer=(0,NMt.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new T1o.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let o=n.get("content-length");if(!o){this.fireError(new Error(`Header must provide a Content-Length property. -${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(o);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${o}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,o=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(o)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,NMt.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};f7.ReadableStreamMessageReader=OMt});var lZr=I(p7=>{"use strict";p();Object.defineProperty(p7,"__esModule",{value:!0});p7.WriteableStreamMessageWriter=p7.AbstractMessageWriter=p7.MessageWriter=void 0;var oZr=d7(),ISe=zse(),I1o=PMt(),sZr=Kse(),x1o="Content-Length: ",aZr=`\r -`,cZr;(function(t){function e(r){let n=r;return n&&ISe.func(n.dispose)&&ISe.func(n.onClose)&&ISe.func(n.onError)&&ISe.func(n.write)}a(e,"is"),t.is=e})(cZr||(p7.MessageWriter=cZr={}));var mQe=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new sZr.Emitter,this.closeEmitter=new sZr.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${ISe.string(e.message)?e.message:"unknown"}`)}};p7.AbstractMessageWriter=mQe;var LMt;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,oZr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,oZr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(LMt||(LMt={}));var BMt=class extends mQe{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=LMt.fromOptions(r),this.errorCount=0,this.writeSemaphore=new I1o.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let o=[];return o.push(x1o,n.byteLength.toString(),aZr),o.push(aZr),this.doWrite(e,o,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(o){return this.handleError(o,e),Promise.reject(o)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};p7.WriteableStreamMessageWriter=BMt});var uZr=I(gQe=>{"use strict";p();Object.defineProperty(gQe,"__esModule",{value:!0});gQe.AbstractMessageBuffer=void 0;var w1o=13,R1o=10,k1o=`\r -`,FMt=class{static{a(this,"AbstractMessageBuffer")}constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,o=0,s=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],c=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,c}let r=this.allocNative(e),n=0,o=0;for(;e>0;){let s=this._chunks[o];if(s.byteLength>e){let c=s.slice(0,e);r.set(c,n),n+=e,this._chunks[o]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};gQe.AbstractMessageBuffer=FMt});var mZr=I(Uo=>{"use strict";p();Object.defineProperty(Uo,"__esModule",{value:!0});Uo.createMessageConnection=Uo.ConnectionOptions=Uo.MessageStrategy=Uo.CancellationStrategy=Uo.CancellationSenderStrategy=Uo.CancellationReceiverStrategy=Uo.RequestCancellationReceiverStrategy=Uo.IdCancellationReceiverStrategy=Uo.ConnectionStrategy=Uo.ConnectionError=Uo.ConnectionErrors=Uo.LogTraceNotification=Uo.SetTraceNotification=Uo.TraceFormat=Uo.TraceValues=Uo.Trace=Uo.NullLogger=Uo.ProgressType=Uo.ProgressToken=void 0;var dZr=d7(),vf=zse(),Ki=AMt(),fZr=_Mt(),xSe=Kse(),UMt=fQe(),kSe;(function(t){t.type=new Ki.NotificationType("$/cancelRequest")})(kSe||(kSe={}));var QMt;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(QMt||(Uo.ProgressToken=QMt={}));var wSe;(function(t){t.type=new Ki.NotificationType("$/progress")})(wSe||(wSe={}));var qMt=class{static{a(this,"ProgressType")}constructor(){}};Uo.ProgressType=qMt;var jMt;(function(t){function e(r){return vf.func(r)}a(e,"is"),t.is=e})(jMt||(jMt={}));Uo.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var Mc;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Mc||(Uo.Trace=Mc={}));var pZr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(pZr||(Uo.TraceValues=pZr={}));(function(t){function e(n){if(!vf.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}a(e,"fromString"),t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}a(r,"toString"),t.toString=r})(Mc||(Uo.Trace=Mc={}));var m1;(function(t){t.Text="text",t.JSON="json"})(m1||(Uo.TraceFormat=m1={}));(function(t){function e(r){return vf.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(m1||(Uo.TraceFormat=m1={}));var HMt;(function(t){t.type=new Ki.NotificationType("$/setTrace")})(HMt||(Uo.SetTraceNotification=HMt={}));var AQe;(function(t){t.type=new Ki.NotificationType("$/logTrace")})(AQe||(Uo.LogTraceNotification=AQe={}));var RSe;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(RSe||(Uo.ConnectionErrors=RSe={}));var eae=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Uo.ConnectionError=eae;var GMt;(function(t){function e(r){let n=r;return n&&vf.func(n.cancelUndispatched)}a(e,"is"),t.is=e})(GMt||(Uo.ConnectionStrategy=GMt={}));var yQe;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&vf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||vf.func(n.dispose))}a(e,"is"),t.is=e})(yQe||(Uo.IdCancellationReceiverStrategy=yQe={}));var $Mt;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&vf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||vf.func(n.dispose))}a(e,"is"),t.is=e})($Mt||(Uo.RequestCancellationReceiverStrategy=$Mt={}));var _Qe;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new UMt.CancellationTokenSource}});function e(r){return yQe.is(r)||$Mt.is(r)}a(e,"is"),t.is=e})(_Qe||(Uo.CancellationReceiverStrategy=_Qe={}));var EQe;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(kSe.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&vf.func(n.sendCancellation)&&vf.func(n.cleanup)}a(e,"is"),t.is=e})(EQe||(Uo.CancellationSenderStrategy=EQe={}));var vQe;(function(t){t.Message=Object.freeze({receiver:_Qe.Message,sender:EQe.Message});function e(r){let n=r;return n&&_Qe.is(n.receiver)&&EQe.is(n.sender)}a(e,"is"),t.is=e})(vQe||(Uo.CancellationStrategy=vQe={}));var CQe;(function(t){function e(r){let n=r;return n&&vf.func(n.handleMessage)}a(e,"is"),t.is=e})(CQe||(Uo.MessageStrategy=CQe={}));var hZr;(function(t){function e(r){let n=r;return n&&(vQe.is(n.cancellationStrategy)||GMt.is(n.connectionStrategy)||CQe.is(n.messageStrategy))}a(e,"is"),t.is=e})(hZr||(Uo.ConnectionOptions=hZr={}));var vP;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(vP||(vP={}));function P1o(t,e,r,n){let o=r!==void 0?r:Uo.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new fZr.LinkedMap,_=new Map,E=new Set,v=new Map,S=Mc.Off,T=m1.Text,w,R=vP.New,x=new xSe.Emitter,k=new xSe.Emitter,D=new xSe.Emitter,N=new xSe.Emitter,O=new xSe.Emitter,B=n&&n.cancellationStrategy?n.cancellationStrategy:vQe.Message;function q(se){if(se===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+se.toString()}a(q,"createRequestQueueKey");function M(se){return se===null?"res-unknown-"+(++l).toString():"res-"+se.toString()}a(M,"createResponseQueueKey");function L(){return"not-"+(++c).toString()}a(L,"createNotificationQueueKey");function U(se,be){Ki.Message.isRequest(be)?se.set(q(be.id),be):Ki.Message.isResponse(be)?se.set(M(be.id),be):se.set(L(),be)}a(U,"addMessageToQueue");function j(se){}a(j,"cancelUndispatched");function Q(){return R===vP.Listening}a(Q,"isListening");function Y(){return R===vP.Closed}a(Y,"isClosed");function W(){return R===vP.Disposed}a(W,"isDisposed");function V(){(R===vP.New||R===vP.Listening)&&(R=vP.Closed,k.fire(void 0))}a(V,"closeHandler");function z(se){x.fire([se,void 0,void 0])}a(z,"readErrorHandler");function ie(se){x.fire(se)}a(ie,"writeErrorHandler"),t.onClose(V),t.onError(z),e.onClose(V),e.onError(ie);function H(){A||y.size===0||(A=(0,dZr.default)().timer.setImmediate(()=>{A=void 0,le()}))}a(H,"triggerMessageQueue");function re(se){Ki.Message.isRequest(se)?me(se):Ki.Message.isNotification(se)?Te(se):Ki.Message.isResponse(se)?Oe(se):te(se)}a(re,"handleMessage");function le(){if(y.size===0)return;let se=y.shift();try{let be=n?.messageStrategy;CQe.is(be)?be.handleMessage(se,re):re(se)}finally{H()}}a(le,"processMessageQueue");let Le=a(se=>{try{if(Ki.Message.isNotification(se)&&se.method===kSe.type.method){let be=se.params.id,Ue=q(be),Qe=y.get(Ue);if(Ki.Message.isRequest(Qe)){let Z=n?.connectionStrategy,ve=Z&&Z.cancelUndispatched?Z.cancelUndispatched(Qe,j):void 0;if(ve&&(ve.error!==void 0||ve.result!==void 0)){y.delete(Ue),v.delete(be),ve.id=Qe.id,X(ve,se.method,Date.now()),e.write(ve).catch(()=>o.error("Sending response for canceled message failed."));return}}let ge=v.get(be);if(ge!==void 0){ge.cancel(),Be(se);return}else E.add(be)}U(y,se)}finally{H()}},"callback");function me(se){if(W())return;function be(qe,je,J){let ae={jsonrpc:u,id:se.id};qe instanceof Ki.ResponseError?ae.error=qe.toJson():ae.result=qe===void 0?null:qe,X(ae,je,J),e.write(ae).catch(()=>o.error("Sending response failed."))}a(be,"reply");function Ue(qe,je,J){let ae={jsonrpc:u,id:se.id,error:qe.toJson()};X(ae,je,J),e.write(ae).catch(()=>o.error("Sending response failed."))}a(Ue,"replyError");function Qe(qe,je,J){qe===void 0&&(qe=null);let ae={jsonrpc:u,id:se.id,result:qe};X(ae,je,J),e.write(ae).catch(()=>o.error("Sending response failed."))}a(Qe,"replySuccess"),de(se);let ge=f.get(se.method),Z,ve;ge&&(Z=ge.type,ve=ge.handler);let Ge=Date.now();if(ve||d){let qe=se.id??String(Date.now()),je=yQe.is(B.receiver)?B.receiver.createCancellationTokenSource(qe):B.receiver.createCancellationTokenSource(se);se.id!==null&&E.has(se.id)&&je.cancel(),se.id!==null&&v.set(qe,je);try{let J;if(ve)if(se.params===void 0){if(Z!==void 0&&Z.numberOfParams!==0){Ue(new Ki.ResponseError(Ki.ErrorCodes.InvalidParams,`Request ${se.method} defines ${Z.numberOfParams} params but received none.`),se.method,Ge);return}J=ve(je.token)}else if(Array.isArray(se.params)){if(Z!==void 0&&Z.parameterStructures===Ki.ParameterStructures.byName){Ue(new Ki.ResponseError(Ki.ErrorCodes.InvalidParams,`Request ${se.method} defines parameters by name but received parameters by position`),se.method,Ge);return}J=ve(...se.params,je.token)}else{if(Z!==void 0&&Z.parameterStructures===Ki.ParameterStructures.byPosition){Ue(new Ki.ResponseError(Ki.ErrorCodes.InvalidParams,`Request ${se.method} defines parameters by position but received parameters by name`),se.method,Ge);return}J=ve(se.params,je.token)}else d&&(J=d(se.method,se.params,je.token));let ae=J;J?ae.then?ae.then(Ce=>{v.delete(qe),be(Ce,se.method,Ge)},Ce=>{v.delete(qe),Ce instanceof Ki.ResponseError?Ue(Ce,se.method,Ge):Ce&&vf.string(Ce.message)?Ue(new Ki.ResponseError(Ki.ErrorCodes.InternalError,`Request ${se.method} failed with message: ${Ce.message}`),se.method,Ge):Ue(new Ki.ResponseError(Ki.ErrorCodes.InternalError,`Request ${se.method} failed unexpectedly without providing any details.`),se.method,Ge)}):(v.delete(qe),be(J,se.method,Ge)):(v.delete(qe),Qe(J,se.method,Ge))}catch(J){v.delete(qe),J instanceof Ki.ResponseError?be(J,se.method,Ge):J&&vf.string(J.message)?Ue(new Ki.ResponseError(Ki.ErrorCodes.InternalError,`Request ${se.method} failed with message: ${J.message}`),se.method,Ge):Ue(new Ki.ResponseError(Ki.ErrorCodes.InternalError,`Request ${se.method} failed unexpectedly without providing any details.`),se.method,Ge)}}else Ue(new Ki.ResponseError(Ki.ErrorCodes.MethodNotFound,`Unhandled method ${se.method}`),se.method,Ge)}a(me,"handleRequest");function Oe(se){if(!W())if(se.id===null)se.error?o.error(`Received response message without id: Error is: -${JSON.stringify(se.error,void 0,4)}`):o.error("Received response message without id. No further error information provided.");else{let be=se.id,Ue=_.get(be);if(ne(se,Ue),Ue!==void 0){_.delete(be);try{if(se.error){let Qe=se.error;Ue.reject(new Ki.ResponseError(Qe.code,Qe.message,Qe.data))}else if(se.result!==void 0)Ue.resolve(se.result);else throw new Error("Should never happen.")}catch(Qe){Qe.message?o.error(`Response handler '${Ue.method}' failed with message: ${Qe.message}`):o.error(`Response handler '${Ue.method}' failed unexpectedly.`)}}}}a(Oe,"handleResponse");function Te(se){if(W())return;let be,Ue;if(se.method===kSe.type.method){let Qe=se.params.id;E.delete(Qe),Be(se);return}else{let Qe=m.get(se.method);Qe&&(Ue=Qe.handler,be=Qe.type)}if(Ue||h)try{if(Be(se),Ue)if(se.params===void 0)be!==void 0&&be.numberOfParams!==0&&be.parameterStructures!==Ki.ParameterStructures.byName&&o.error(`Notification ${se.method} defines ${be.numberOfParams} params but received none.`),Ue();else if(Array.isArray(se.params)){let Qe=se.params;se.method===wSe.type.method&&Qe.length===2&&QMt.is(Qe[0])?Ue({token:Qe[0],value:Qe[1]}):(be!==void 0&&(be.parameterStructures===Ki.ParameterStructures.byName&&o.error(`Notification ${se.method} defines parameters by name but received parameters by position`),be.numberOfParams!==se.params.length&&o.error(`Notification ${se.method} defines ${be.numberOfParams} params but received ${Qe.length} arguments`)),Ue(...Qe))}else be!==void 0&&be.parameterStructures===Ki.ParameterStructures.byPosition&&o.error(`Notification ${se.method} defines parameters by position but received parameters by name`),Ue(se.params);else h&&h(se.method,se.params)}catch(Qe){Qe.message?o.error(`Notification handler '${se.method}' failed with message: ${Qe.message}`):o.error(`Notification handler '${se.method}' failed unexpectedly.`)}else D.fire(se)}a(Te,"handleNotification");function te(se){if(!se){o.error("Received empty message.");return}o.error(`Received message which is neither a response nor a notification message: +`)),l.tries=r,l}a(FAo,"bindings");XWr.exports=FAo;function UAo(t){for(var e=BAo(t),r;;){if(e==="."&&(e=process.cwd()),JWr(iSe(e,"dist")))return iSe(e,"dist");if(JWr(iSe(e,"compiled")))return e;if(r===e)throw new Error('Could not find module root given file: "'+t+'". Do you have a `dist` or `compiled` directory? ');r=e,e=iSe(e,"..")}}a(UAo,"getRoot")});var nzr=I(dx=>{"use strict";p();var QAo=dx&&dx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qAo=dx&&dx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ezr=dx&&dx.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&QAo(e,t,r);return qAo(e,t),e};Object.defineProperty(dx,"__esModule",{value:!0});dx.setDeviceId=dx.getDeviceId=void 0;var U9e=ezr(require("path")),Q9e=ezr(KWr()),tzr=process.platform==="win32"?F9e()("windows"):null,jAo="deviceid";function rzr(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=U9e.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??U9e.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return U9e.join(t,"Microsoft","DeveloperTools")}a(rzr,"getDirectory");function GDt(){return U9e.join(rzr(),jAo)}a(GDt,"getDeviceIdFilePath");async function HAo(){return process.platform==="win32"?tzr?.GetDeviceId():await GAo(GDt())?Q9e.readFile(GDt(),"utf8"):void 0}a(HAo,"getDeviceId");dx.getDeviceId=HAo;async function GAo(t){try{return await Q9e.promises.access(t),!0}catch{return!1}}a(GAo,"exists");async function $Ao(t){process.platform==="win32"?tzr?.SetDeviceId(t):(await Q9e.ensureDir(rzr()),await Q9e.writeFile(GDt(),t,"utf8"))}a($Ao,"setDeviceId");dx.setDeviceId=$Ao});var ozr=I(kM=>{"use strict";p();var VAo=kM&&kM.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WAo=kM&&kM.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zAo=kM&&kM.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&VAo(e,t,r);return WAo(e,t),e};Object.defineProperty(kM,"__esModule",{value:!0});kM.getDeviceId=void 0;var YAo=(Fo(),Wa(Nc)),izr=zAo(nzr());async function KAo(){let t;try{t=await izr.getDeviceId()}catch{}if(t)return t;{let e=(0,YAo.v4)().toLowerCase();return await izr.setDeviceId(e),e}}a(KAo,"getDeviceId");kM.getDeviceId=KAo});var szr=I(bz=>{"use strict";p();var JAo=bz&&bz.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZAo=bz&&bz.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JAo(e,t,r)};Object.defineProperty(bz,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");ZAo(ozr(),bz)});var fa=I((j9e,azr)=>{p();(function(t,e){typeof j9e=="object"?azr.exports=j9e=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(j9e,function(){var t=t||(function(e,r){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof global<"u"&&global.crypto&&(n=global.crypto),!n&&typeof require=="function")try{n=require("crypto")}catch{}var o=a(function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},"cryptoSecureRandomInt"),s=Object.create||(function(){function E(){}return a(E,"F"),function(v){var S;return E.prototype=v,S=new E,E.prototype=null,S}})(),c={},l=c.lib={},u=l.Base=(function(){return{extend:a(function(E){var v=s(this);return E&&v.mixIn(E),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},"extend"),create:a(function(){var E=this.extend();return E.init.apply(E,arguments),E},"create"),init:a(function(){},"init"),mixIn:a(function(E){for(var v in E)E.hasOwnProperty(v)&&(this[v]=E[v]);E.hasOwnProperty("toString")&&(this.toString=E.toString)},"mixIn"),clone:a(function(){return this.init.prototype.extend(this)},"clone")}})(),d=l.WordArray=u.extend({init:a(function(E,v){E=this.words=E||[],v!=r?this.sigBytes=v:this.sigBytes=E.length*4},"init"),toString:a(function(E){return(E||h).stringify(this)},"toString"),concat:a(function(E){var v=this.words,S=E.words,T=this.sigBytes,w=E.sigBytes;if(this.clamp(),T%4)for(var R=0;R>>2]>>>24-R%4*8&255;v[T+R>>>2]|=x<<24-(T+R)%4*8}else for(var k=0;k>>2]=S[k>>>2];return this.sigBytes+=w,this},"concat"),clamp:a(function(){var E=this.words,v=this.sigBytes;E[v>>>2]&=4294967295<<32-v%4*8,E.length=e.ceil(v/4)},"clamp"),clone:a(function(){var E=u.clone.call(this);return E.words=this.words.slice(0),E},"clone"),random:a(function(E){for(var v=[],S=0;S>>2]>>>24-w%4*8&255;T.push((R>>>4).toString(16)),T.push((R&15).toString(16))}return T.join("")},"stringify"),parse:a(function(E){for(var v=E.length,S=[],T=0;T>>3]|=parseInt(E.substr(T,2),16)<<24-T%8*4;return new d.init(S,v/2)},"parse")},m=f.Latin1={stringify:a(function(E){for(var v=E.words,S=E.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push(String.fromCharCode(R))}return T.join("")},"stringify"),parse:a(function(E){for(var v=E.length,S=[],T=0;T>>2]|=(E.charCodeAt(T)&255)<<24-T%4*8;return new d.init(S,v)},"parse")},g=f.Utf8={stringify:a(function(E){try{return decodeURIComponent(escape(m.stringify(E)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:a(function(E){return m.parse(unescape(encodeURIComponent(E)))},"parse")},A=l.BufferedBlockAlgorithm=u.extend({reset:a(function(){this._data=new d.init,this._nDataBytes=0},"reset"),_append:a(function(E){typeof E=="string"&&(E=g.parse(E)),this._data.concat(E),this._nDataBytes+=E.sigBytes},"_append"),_process:a(function(E){var v,S=this._data,T=S.words,w=S.sigBytes,R=this.blockSize,x=R*4,k=w/x;E?k=e.ceil(k):k=e.max((k|0)-this._minBufferSize,0);var D=k*R,N=e.min(D*4,w);if(D){for(var O=0;O{p();(function(t,e){typeof H9e=="object"?czr.exports=H9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(H9e,function(t){return(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=r.x64={},l=c.Word=o.extend({init:a(function(d,f){this.high=d,this.low=f},"init")}),u=c.WordArray=o.extend({init:a(function(d,f){d=this.words=d||[],f!=e?this.sigBytes=f:this.sigBytes=d.length*8},"init"),toX32:a(function(){for(var d=this.words,f=d.length,h=[],m=0;m{p();(function(t,e){typeof G9e=="object"?lzr.exports=G9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(G9e,function(t){return(function(){if(typeof ArrayBuffer=="function"){var e=t,r=e.lib,n=r.WordArray,o=n.init,s=n.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray<"u"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var l=c.byteLength,u=[],d=0;d>>2]|=c[d]<<24-d%4*8;o.call(this,u,l)}else o.apply(this,arguments)};s.prototype=n}})(),t.lib.WordArray})});var fzr=I(($9e,dzr)=>{p();(function(t,e){typeof $9e=="object"?dzr.exports=$9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})($9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Utf16=o.Utf16BE={stringify:a(function(l){for(var u=l.words,d=l.sigBytes,f=[],h=0;h>>2]>>>16-h%4*8&65535;f.push(String.fromCharCode(m))}return f.join("")},"stringify"),parse:a(function(l){for(var u=l.length,d=[],f=0;f>>1]|=l.charCodeAt(f)<<16-f%2*16;return n.create(d,u*2)},"parse")};o.Utf16LE={stringify:a(function(l){for(var u=l.words,d=l.sigBytes,f=[],h=0;h>>2]>>>16-h%4*8&65535);f.push(String.fromCharCode(m))}return f.join("")},"stringify"),parse:a(function(l){for(var u=l.length,d=[],f=0;f>>1]|=c(l.charCodeAt(f)<<16-f%2*16);return n.create(d,u*2)},"parse")};function c(l){return l<<8&4278255360|l>>>8&16711935}a(c,"swapEndian")})(),t.enc.Utf16})});var W9=I((V9e,pzr)=>{p();(function(t,e){typeof V9e=="object"?pzr.exports=V9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(V9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Base64={stringify:a(function(l){var u=l.words,d=l.sigBytes,f=this._map;l.clamp();for(var h=[],m=0;m>>2]>>>24-m%4*8&255,A=u[m+1>>>2]>>>24-(m+1)%4*8&255,y=u[m+2>>>2]>>>24-(m+2)%4*8&255,_=g<<16|A<<8|y,E=0;E<4&&m+E*.75>>6*(3-E)&63));var v=f.charAt(64);if(v)for(;h.length%4;)h.push(v);return h.join("")},"stringify"),parse:a(function(l){var u=l.length,d=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var h=0;h>>6-m%4*2,y=g|A;f[h>>>2]|=y<<24-h%4*8,h++}return n.create(f,h)}a(c,"parseLoop")})(),t.enc.Base64})});var mzr=I((W9e,hzr)=>{p();(function(t,e){typeof W9e=="object"?hzr.exports=W9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(W9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Base64url={stringify:a(function(l,u){u===void 0&&(u=!0);var d=l.words,f=l.sigBytes,h=u?this._safe_map:this._map;l.clamp();for(var m=[],g=0;g>>2]>>>24-g%4*8&255,y=d[g+1>>>2]>>>24-(g+1)%4*8&255,_=d[g+2>>>2]>>>24-(g+2)%4*8&255,E=A<<16|y<<8|_,v=0;v<4&&g+v*.75>>6*(3-v)&63));var S=h.charAt(64);if(S)for(;m.length%4;)m.push(S);return m.join("")},"stringify"),parse:a(function(l,u){u===void 0&&(u=!0);var d=l.length,f=u?this._safe_map:this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var m=0;m>>6-m%4*2,y=g|A;f[h>>>2]|=y<<24-h%4*8,h++}return n.create(f,h)}a(c,"parseLoop")})(),t.enc.Base64url})});var z9=I((z9e,gzr)=>{p();(function(t,e){typeof z9e=="object"?gzr.exports=z9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(z9e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[];(function(){for(var g=0;g<64;g++)l[g]=e.abs(e.sin(g+1))*4294967296|0})();var u=c.MD5=s.extend({_doReset:a(function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},"_doReset"),_doProcessBlock:a(function(g,A){for(var y=0;y<16;y++){var _=A+y,E=g[_];g[_]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}var v=this._hash.words,S=g[A+0],T=g[A+1],w=g[A+2],R=g[A+3],x=g[A+4],k=g[A+5],D=g[A+6],N=g[A+7],O=g[A+8],B=g[A+9],q=g[A+10],M=g[A+11],L=g[A+12],U=g[A+13],j=g[A+14],Q=g[A+15],Y=v[0],W=v[1],V=v[2],z=v[3];Y=d(Y,W,V,z,S,7,l[0]),z=d(z,Y,W,V,T,12,l[1]),V=d(V,z,Y,W,w,17,l[2]),W=d(W,V,z,Y,R,22,l[3]),Y=d(Y,W,V,z,x,7,l[4]),z=d(z,Y,W,V,k,12,l[5]),V=d(V,z,Y,W,D,17,l[6]),W=d(W,V,z,Y,N,22,l[7]),Y=d(Y,W,V,z,O,7,l[8]),z=d(z,Y,W,V,B,12,l[9]),V=d(V,z,Y,W,q,17,l[10]),W=d(W,V,z,Y,M,22,l[11]),Y=d(Y,W,V,z,L,7,l[12]),z=d(z,Y,W,V,U,12,l[13]),V=d(V,z,Y,W,j,17,l[14]),W=d(W,V,z,Y,Q,22,l[15]),Y=f(Y,W,V,z,T,5,l[16]),z=f(z,Y,W,V,D,9,l[17]),V=f(V,z,Y,W,M,14,l[18]),W=f(W,V,z,Y,S,20,l[19]),Y=f(Y,W,V,z,k,5,l[20]),z=f(z,Y,W,V,q,9,l[21]),V=f(V,z,Y,W,Q,14,l[22]),W=f(W,V,z,Y,x,20,l[23]),Y=f(Y,W,V,z,B,5,l[24]),z=f(z,Y,W,V,j,9,l[25]),V=f(V,z,Y,W,R,14,l[26]),W=f(W,V,z,Y,O,20,l[27]),Y=f(Y,W,V,z,U,5,l[28]),z=f(z,Y,W,V,w,9,l[29]),V=f(V,z,Y,W,N,14,l[30]),W=f(W,V,z,Y,L,20,l[31]),Y=h(Y,W,V,z,k,4,l[32]),z=h(z,Y,W,V,O,11,l[33]),V=h(V,z,Y,W,M,16,l[34]),W=h(W,V,z,Y,j,23,l[35]),Y=h(Y,W,V,z,T,4,l[36]),z=h(z,Y,W,V,x,11,l[37]),V=h(V,z,Y,W,N,16,l[38]),W=h(W,V,z,Y,q,23,l[39]),Y=h(Y,W,V,z,U,4,l[40]),z=h(z,Y,W,V,S,11,l[41]),V=h(V,z,Y,W,R,16,l[42]),W=h(W,V,z,Y,D,23,l[43]),Y=h(Y,W,V,z,B,4,l[44]),z=h(z,Y,W,V,L,11,l[45]),V=h(V,z,Y,W,Q,16,l[46]),W=h(W,V,z,Y,w,23,l[47]),Y=m(Y,W,V,z,S,6,l[48]),z=m(z,Y,W,V,N,10,l[49]),V=m(V,z,Y,W,j,15,l[50]),W=m(W,V,z,Y,k,21,l[51]),Y=m(Y,W,V,z,L,6,l[52]),z=m(z,Y,W,V,R,10,l[53]),V=m(V,z,Y,W,q,15,l[54]),W=m(W,V,z,Y,T,21,l[55]),Y=m(Y,W,V,z,O,6,l[56]),z=m(z,Y,W,V,Q,10,l[57]),V=m(V,z,Y,W,D,15,l[58]),W=m(W,V,z,Y,U,21,l[59]),Y=m(Y,W,V,z,x,6,l[60]),z=m(z,Y,W,V,M,10,l[61]),V=m(V,z,Y,W,w,15,l[62]),W=m(W,V,z,Y,B,21,l[63]),v[0]=v[0]+Y|0,v[1]=v[1]+W|0,v[2]=v[2]+V|0,v[3]=v[3]+z|0},"_doProcessBlock"),_doFinalize:a(function(){var g=this._data,A=g.words,y=this._nDataBytes*8,_=g.sigBytes*8;A[_>>>5]|=128<<24-_%32;var E=e.floor(y/4294967296),v=y;A[(_+64>>>9<<4)+15]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,A[(_+64>>>9<<4)+14]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,g.sigBytes=(A.length+1)*4,this._process();for(var S=this._hash,T=S.words,w=0;w<4;w++){var R=T[w];T[w]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}return S},"_doFinalize"),clone:a(function(){var g=s.clone.call(this);return g._hash=this._hash.clone(),g},"clone")});function d(g,A,y,_,E,v,S){var T=g+(A&y|~A&_)+E+S;return(T<>>32-v)+A}a(d,"FF");function f(g,A,y,_,E,v,S){var T=g+(A&_|y&~_)+E+S;return(T<>>32-v)+A}a(f,"GG");function h(g,A,y,_,E,v,S){var T=g+(A^y^_)+E+S;return(T<>>32-v)+A}a(h,"HH");function m(g,A,y,_,E,v,S){var T=g+(y^(A|~_))+E+S;return(T<>>32-v)+A}a(m,"II"),r.MD5=s._createHelper(u),r.HmacMD5=s._createHmacHelper(u)})(Math),t.MD5})});var WDt=I((Y9e,Azr)=>{p();(function(t,e){typeof Y9e=="object"?Azr.exports=Y9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Y9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.algo,c=[],l=s.SHA1=o.extend({_doReset:a(function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(u,d){for(var f=this._hash.words,h=f[0],m=f[1],g=f[2],A=f[3],y=f[4],_=0;_<80;_++){if(_<16)c[_]=u[d+_]|0;else{var E=c[_-3]^c[_-8]^c[_-14]^c[_-16];c[_]=E<<1|E>>>31}var v=(h<<5|h>>>27)+y+c[_];_<20?v+=(m&g|~m&A)+1518500249:_<40?v+=(m^g^A)+1859775393:_<60?v+=(m&g|m&A|g&A)-1894007588:v+=(m^g^A)-899497514,y=A,A=g,g=m<<30|m>>>2,m=h,h=v}f[0]=f[0]+h|0,f[1]=f[1]+m|0,f[2]=f[2]+g|0,f[3]=f[3]+A|0,f[4]=f[4]+y|0},"_doProcessBlock"),_doFinalize:a(function(){var u=this._data,d=u.words,f=this._nDataBytes*8,h=u.sigBytes*8;return d[h>>>5]|=128<<24-h%32,d[(h+64>>>9<<4)+14]=Math.floor(f/4294967296),d[(h+64>>>9<<4)+15]=f,u.sigBytes=d.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var u=o.clone.call(this);return u._hash=this._hash.clone(),u},"clone")});e.SHA1=o._createHelper(l),e.HmacSHA1=o._createHmacHelper(l)})(),t.SHA1})});var J9e=I((K9e,yzr)=>{p();(function(t,e){typeof K9e=="object"?yzr.exports=K9e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(K9e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[],u=[];(function(){function h(y){for(var _=e.sqrt(y),E=2;E<=_;E++)if(!(y%E))return!1;return!0}a(h,"isPrime");function m(y){return(y-(y|0))*4294967296|0}a(m,"getFractionalBits");for(var g=2,A=0;A<64;)h(g)&&(A<8&&(l[A]=m(e.pow(g,1/2))),u[A]=m(e.pow(g,1/3)),A++),g++})();var d=[],f=c.SHA256=s.extend({_doReset:a(function(){this._hash=new o.init(l.slice(0))},"_doReset"),_doProcessBlock:a(function(h,m){for(var g=this._hash.words,A=g[0],y=g[1],_=g[2],E=g[3],v=g[4],S=g[5],T=g[6],w=g[7],R=0;R<64;R++){if(R<16)d[R]=h[m+R]|0;else{var x=d[R-15],k=(x<<25|x>>>7)^(x<<14|x>>>18)^x>>>3,D=d[R-2],N=(D<<15|D>>>17)^(D<<13|D>>>19)^D>>>10;d[R]=k+d[R-7]+N+d[R-16]}var O=v&S^~v&T,B=A&y^A&_^y&_,q=(A<<30|A>>>2)^(A<<19|A>>>13)^(A<<10|A>>>22),M=(v<<26|v>>>6)^(v<<21|v>>>11)^(v<<7|v>>>25),L=w+M+O+u[R]+d[R],U=q+B;w=T,T=S,S=v,v=E+L|0,E=_,_=y,y=A,A=L+U|0}g[0]=g[0]+A|0,g[1]=g[1]+y|0,g[2]=g[2]+_|0,g[3]=g[3]+E|0,g[4]=g[4]+v|0,g[5]=g[5]+S|0,g[6]=g[6]+T|0,g[7]=g[7]+w|0},"_doProcessBlock"),_doFinalize:a(function(){var h=this._data,m=h.words,g=this._nDataBytes*8,A=h.sigBytes*8;return m[A>>>5]|=128<<24-A%32,m[(A+64>>>9<<4)+14]=e.floor(g/4294967296),m[(A+64>>>9<<4)+15]=g,h.sigBytes=m.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h},"clone")});r.SHA256=s._createHelper(f),r.HmacSHA256=s._createHmacHelper(f)})(Math),t.SHA256})});var Ezr=I((Z9e,_zr)=>{p();(function(t,e,r){typeof Z9e=="object"?_zr.exports=Z9e=e(fa(),J9e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(Z9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.algo,s=o.SHA256,c=o.SHA224=s.extend({_doReset:a(function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},"_doReset"),_doFinalize:a(function(){var l=s._doFinalize.call(this);return l.sigBytes-=4,l},"_doFinalize")});e.SHA224=s._createHelper(c),e.HmacSHA224=s._createHmacHelper(c)})(),t.SHA224})});var zDt=I((X9e,vzr)=>{p();(function(t,e,r){typeof X9e=="object"?vzr.exports=X9e=e(fa(),oSe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(X9e,function(t){return(function(){var e=t,r=e.lib,n=r.Hasher,o=e.x64,s=o.Word,c=o.WordArray,l=e.algo;function u(){return s.create.apply(s,arguments)}a(u,"X64Word_create");var d=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(1816402316,1246189591)],f=[];(function(){for(var m=0;m<80;m++)f[m]=u()})();var h=l.SHA512=n.extend({_doReset:a(function(){this._hash=new c.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},"_doReset"),_doProcessBlock:a(function(m,g){for(var A=this._hash.words,y=A[0],_=A[1],E=A[2],v=A[3],S=A[4],T=A[5],w=A[6],R=A[7],x=y.high,k=y.low,D=_.high,N=_.low,O=E.high,B=E.low,q=v.high,M=v.low,L=S.high,U=S.low,j=T.high,Q=T.low,Y=w.high,W=w.low,V=R.high,z=R.low,ie=x,H=k,re=D,le=N,Le=O,me=B,Oe=q,Te=M,te=L,ee=U,K=j,he=Q,X=Y,de=W,Be=V,ne=z,ue=0;ue<80;ue++){var Ne,xe,Fe=f[ue];if(ue<16)xe=Fe.high=m[g+ue*2]|0,Ne=Fe.low=m[g+ue*2+1]|0;else{var tt=f[ue-15],st=tt.high,vt=tt.low,Pt=(st>>>1|vt<<31)^(st>>>8|vt<<24)^st>>>7,Ht=(vt>>>1|st<<31)^(vt>>>8|st<<24)^(vt>>>7|st<<25),F=f[ue-2],se=F.high,be=F.low,Ue=(se>>>19|be<<13)^(se<<3|be>>>29)^se>>>6,Qe=(be>>>19|se<<13)^(be<<3|se>>>29)^(be>>>6|se<<26),ge=f[ue-7],Z=ge.high,ve=ge.low,Ge=f[ue-16],qe=Ge.high,je=Ge.low;Ne=Ht+ve,xe=Pt+Z+(Ne>>>0>>0?1:0),Ne=Ne+Qe,xe=xe+Ue+(Ne>>>0>>0?1:0),Ne=Ne+je,xe=xe+qe+(Ne>>>0>>0?1:0),Fe.high=xe,Fe.low=Ne}var J=te&K^~te&X,ae=ee&he^~ee&de,Ce=ie&re^ie&Le^re&Le,Re=H&le^H&me^le&me,$e=(ie>>>28|H<<4)^(ie<<30|H>>>2)^(ie<<25|H>>>7),Ye=(H>>>28|ie<<4)^(H<<30|ie>>>2)^(H<<25|ie>>>7),ut=(te>>>14|ee<<18)^(te>>>18|ee<<14)^(te<<23|ee>>>9),yt=(ee>>>14|te<<18)^(ee>>>18|te<<14)^(ee<<23|te>>>9),$t=d[ue],Tt=$t.high,We=$t.low,ce=ne+yt,Pe=Be+ut+(ce>>>0>>0?1:0),ce=ce+ae,Pe=Pe+J+(ce>>>0>>0?1:0),ce=ce+We,Pe=Pe+Tt+(ce>>>0>>0?1:0),ce=ce+Ne,Pe=Pe+xe+(ce>>>0>>0?1:0),Me=Ye+Re,ye=$e+Ce+(Me>>>0>>0?1:0);Be=X,ne=de,X=K,de=he,K=te,he=ee,ee=Te+ce|0,te=Oe+Pe+(ee>>>0>>0?1:0)|0,Oe=Le,Te=me,Le=re,me=le,re=ie,le=H,H=ce+Me|0,ie=Pe+ye+(H>>>0>>0?1:0)|0}k=y.low=k+H,y.high=x+ie+(k>>>0>>0?1:0),N=_.low=N+le,_.high=D+re+(N>>>0>>0?1:0),B=E.low=B+me,E.high=O+Le+(B>>>0>>0?1:0),M=v.low=M+Te,v.high=q+Oe+(M>>>0>>0?1:0),U=S.low=U+ee,S.high=L+te+(U>>>0>>0?1:0),Q=T.low=Q+he,T.high=j+K+(Q>>>0>>0?1:0),W=w.low=W+de,w.high=Y+X+(W>>>0>>0?1:0),z=R.low=z+ne,R.high=V+Be+(z>>>0>>0?1:0)},"_doProcessBlock"),_doFinalize:a(function(){var m=this._data,g=m.words,A=this._nDataBytes*8,y=m.sigBytes*8;g[y>>>5]|=128<<24-y%32,g[(y+128>>>10<<5)+30]=Math.floor(A/4294967296),g[(y+128>>>10<<5)+31]=A,m.sigBytes=g.length*4,this._process();var _=this._hash.toX32();return _},"_doFinalize"),clone:a(function(){var m=n.clone.call(this);return m._hash=this._hash.clone(),m},"clone"),blockSize:1024/32});e.SHA512=n._createHelper(h),e.HmacSHA512=n._createHmacHelper(h)})(),t.SHA512})});var bzr=I((e7e,Czr)=>{p();(function(t,e,r){typeof e7e=="object"?Czr.exports=e7e=e(fa(),oSe(),zDt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(e7e,function(t){return(function(){var e=t,r=e.x64,n=r.Word,o=r.WordArray,s=e.algo,c=s.SHA512,l=s.SHA384=c.extend({_doReset:a(function(){this._hash=new o.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},"_doReset"),_doFinalize:a(function(){var u=c._doFinalize.call(this);return u.sigBytes-=16,u},"_doFinalize")});e.SHA384=c._createHelper(l),e.HmacSHA384=c._createHmacHelper(l)})(),t.SHA384})});var Tzr=I((t7e,Szr)=>{p();(function(t,e,r){typeof t7e=="object"?Szr.exports=t7e=e(fa(),oSe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(t7e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.x64,l=c.Word,u=r.algo,d=[],f=[],h=[];(function(){for(var A=1,y=0,_=0;_<24;_++){d[A+5*y]=(_+1)*(_+2)/2%64;var E=y%5,v=(2*A+3*y)%5;A=E,y=v}for(var A=0;A<5;A++)for(var y=0;y<5;y++)f[A+5*y]=y+(2*A+3*y)%5*5;for(var S=1,T=0;T<24;T++){for(var w=0,R=0,x=0;x<7;x++){if(S&1){var k=(1<>>24)&16711935|(S<<24|S>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var w=_[v];w.high^=T,w.low^=S}for(var R=0;R<24;R++){for(var x=0;x<5;x++){for(var k=0,D=0,N=0;N<5;N++){var w=_[x+5*N];k^=w.high,D^=w.low}var O=m[x];O.high=k,O.low=D}for(var x=0;x<5;x++)for(var B=m[(x+4)%5],q=m[(x+1)%5],M=q.high,L=q.low,k=B.high^(M<<1|L>>>31),D=B.low^(L<<1|M>>>31),N=0;N<5;N++){var w=_[x+5*N];w.high^=k,w.low^=D}for(var U=1;U<25;U++){var k,D,w=_[U],j=w.high,Q=w.low,Y=d[U];Y<32?(k=j<>>32-Y,D=Q<>>32-Y):(k=Q<>>64-Y,D=j<>>64-Y);var W=m[f[U]];W.high=k,W.low=D}var V=m[0],z=_[0];V.high=z.high,V.low=z.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var U=x+5*N,w=_[U],ie=m[U],H=m[(x+1)%5+5*N],re=m[(x+2)%5+5*N];w.high=ie.high^~H.high&re.high,w.low=ie.low^~H.low&re.low}var w=_[0],le=h[R];w.high^=le.high,w.low^=le.low}},"_doProcessBlock"),_doFinalize:a(function(){var A=this._data,y=A.words,_=this._nDataBytes*8,E=A.sigBytes*8,v=this.blockSize*32;y[E>>>5]|=1<<24-E%32,y[(e.ceil((E+1)/v)*v>>>5)-1]|=128,A.sigBytes=y.length*4,this._process();for(var S=this._state,T=this.cfg.outputLength/8,w=T/8,R=[],x=0;x>>24)&16711935|(D<<24|D>>>8)&4278255360,N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,R.push(N),R.push(D)}return new o.init(R,T)},"_doFinalize"),clone:a(function(){for(var A=s.clone.call(this),y=A._state=this._state.slice(0),_=0;_<25;_++)y[_]=y[_].clone();return A},"clone")});r.SHA3=s._createHelper(g),r.HmacSHA3=s._createHmacHelper(g)})(Math),t.SHA3})});var xzr=I((r7e,Izr)=>{p();(function(t,e){typeof r7e=="object"?Izr.exports=r7e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(r7e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),d=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=o.create([0,1518500249,1859775393,2400959708,2840853838]),m=o.create([1352829926,1548603684,1836072691,2053994217,0]),g=c.RIPEMD160=s.extend({_doReset:a(function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(T,w){for(var R=0;R<16;R++){var x=w+R,k=T[x];T[x]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}var D=this._hash.words,N=h.words,O=m.words,B=l.words,q=u.words,M=d.words,L=f.words,U,j,Q,Y,W,V,z,ie,H,re;V=U=D[0],z=j=D[1],ie=Q=D[2],H=Y=D[3],re=W=D[4];for(var le,R=0;R<80;R+=1)le=U+T[w+B[R]]|0,R<16?le+=A(j,Q,Y)+N[0]:R<32?le+=y(j,Q,Y)+N[1]:R<48?le+=_(j,Q,Y)+N[2]:R<64?le+=E(j,Q,Y)+N[3]:le+=v(j,Q,Y)+N[4],le=le|0,le=S(le,M[R]),le=le+W|0,U=W,W=Y,Y=S(Q,10),Q=j,j=le,le=V+T[w+q[R]]|0,R<16?le+=v(z,ie,H)+O[0]:R<32?le+=E(z,ie,H)+O[1]:R<48?le+=_(z,ie,H)+O[2]:R<64?le+=y(z,ie,H)+O[3]:le+=A(z,ie,H)+O[4],le=le|0,le=S(le,L[R]),le=le+re|0,V=re,re=H,H=S(ie,10),ie=z,z=le;le=D[1]+Q+H|0,D[1]=D[2]+Y+re|0,D[2]=D[3]+W+V|0,D[3]=D[4]+U+z|0,D[4]=D[0]+j+ie|0,D[0]=le},"_doProcessBlock"),_doFinalize:a(function(){var T=this._data,w=T.words,R=this._nDataBytes*8,x=T.sigBytes*8;w[x>>>5]|=128<<24-x%32,w[(x+64>>>9<<4)+14]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,T.sigBytes=(w.length+1)*4,this._process();for(var k=this._hash,D=k.words,N=0;N<5;N++){var O=D[N];D[N]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}return k},"_doFinalize"),clone:a(function(){var T=s.clone.call(this);return T._hash=this._hash.clone(),T},"clone")});function A(T,w,R){return T^w^R}a(A,"f1");function y(T,w,R){return T&w|~T&R}a(y,"f2");function _(T,w,R){return(T|~w)^R}a(_,"f3");function E(T,w,R){return T&R|w&~R}a(E,"f4");function v(T,w,R){return T^(w|~R)}a(v,"f5");function S(T,w){return T<>>32-w}a(S,"rotl"),r.RIPEMD160=s._createHelper(g),r.HmacRIPEMD160=s._createHmacHelper(g)})(Math),t.RIPEMD160})});var i7e=I((n7e,wzr)=>{p();(function(t,e){typeof n7e=="object"?wzr.exports=n7e=e(fa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(n7e,function(t){(function(){var e=t,r=e.lib,n=r.Base,o=e.enc,s=o.Utf8,c=e.algo,l=c.HMAC=n.extend({init:a(function(u,d){u=this._hasher=new u.init,typeof d=="string"&&(d=s.parse(d));var f=u.blockSize,h=f*4;d.sigBytes>h&&(d=u.finalize(d)),d.clamp();for(var m=this._oKey=d.clone(),g=this._iKey=d.clone(),A=m.words,y=g.words,_=0;_{p();(function(t,e,r){typeof o7e=="object"?Rzr.exports=o7e=e(fa(),J9e(),i7e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(o7e,function(t){return(function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,s=e.algo,c=s.SHA256,l=s.HMAC,u=s.PBKDF2=n.extend({cfg:n.extend({keySize:128/32,hasher:c,iterations:25e4}),init:a(function(d){this.cfg=this.cfg.extend(d)},"init"),compute:a(function(d,f){for(var h=this.cfg,m=l.create(h.hasher,d),g=o.create(),A=o.create([1]),y=g.words,_=A.words,E=h.keySize,v=h.iterations;y.length{p();(function(t,e,r){typeof s7e=="object"?Pzr.exports=s7e=e(fa(),WDt(),i7e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(s7e,function(t){return(function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,s=e.algo,c=s.MD5,l=s.EvpKDF=n.extend({cfg:n.extend({keySize:128/32,hasher:c,iterations:1}),init:a(function(u){this.cfg=this.cfg.extend(u)},"init"),compute:a(function(u,d){for(var f,h=this.cfg,m=h.hasher.create(),g=o.create(),A=g.words,y=h.keySize,_=h.iterations;A.length{p();(function(t,e,r){typeof a7e=="object"?Dzr.exports=a7e=e(fa(),qB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(a7e,function(t){t.lib.Cipher||(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=n.BufferedBlockAlgorithm,l=r.enc,u=l.Utf8,d=l.Base64,f=r.algo,h=f.EvpKDF,m=n.Cipher=c.extend({cfg:o.extend(),createEncryptor:a(function(O,B){return this.create(this._ENC_XFORM_MODE,O,B)},"createEncryptor"),createDecryptor:a(function(O,B){return this.create(this._DEC_XFORM_MODE,O,B)},"createDecryptor"),init:a(function(O,B,q){this.cfg=this.cfg.extend(q),this._xformMode=O,this._key=B,this.reset()},"init"),reset:a(function(){c.reset.call(this),this._doReset()},"reset"),process:a(function(O){return this._append(O),this._process()},"process"),finalize:a(function(O){O&&this._append(O);var B=this._doFinalize();return B},"finalize"),keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function O(B){return typeof B=="string"?N:x}return a(O,"selectCipherStrategy"),function(B){return{encrypt:a(function(q,M,L){return O(M).encrypt(B,q,M,L)},"encrypt"),decrypt:a(function(q,M,L){return O(M).decrypt(B,q,M,L)},"decrypt")}}})()}),g=n.StreamCipher=m.extend({_doFinalize:a(function(){var O=this._process(!0);return O},"_doFinalize"),blockSize:1}),A=r.mode={},y=n.BlockCipherMode=o.extend({createEncryptor:a(function(O,B){return this.Encryptor.create(O,B)},"createEncryptor"),createDecryptor:a(function(O,B){return this.Decryptor.create(O,B)},"createDecryptor"),init:a(function(O,B){this._cipher=O,this._iv=B},"init")}),_=A.CBC=(function(){var O=y.extend();O.Encryptor=O.extend({processBlock:a(function(q,M){var L=this._cipher,U=L.blockSize;B.call(this,q,M,U),L.encryptBlock(q,M),this._prevBlock=q.slice(M,M+U)},"processBlock")}),O.Decryptor=O.extend({processBlock:a(function(q,M){var L=this._cipher,U=L.blockSize,j=q.slice(M,M+U);L.decryptBlock(q,M),B.call(this,q,M,U),this._prevBlock=j},"processBlock")});function B(q,M,L){var U,j=this._iv;j?(U=j,this._iv=e):U=this._prevBlock;for(var Q=0;Q>>2]&255;O.sigBytes-=B},"unpad")},S=n.BlockCipher=m.extend({cfg:m.cfg.extend({mode:_,padding:v}),reset:a(function(){var O;m.reset.call(this);var B=this.cfg,q=B.iv,M=B.mode;this._xformMode==this._ENC_XFORM_MODE?O=M.createEncryptor:(O=M.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==O?this._mode.init(this,q&&q.words):(this._mode=O.call(M,this,q&&q.words),this._mode.__creator=O)},"reset"),_doProcessBlock:a(function(O,B){this._mode.processBlock(O,B)},"_doProcessBlock"),_doFinalize:a(function(){var O,B=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(B.pad(this._data,this.blockSize),O=this._process(!0)):(O=this._process(!0),B.unpad(O)),O},"_doFinalize"),blockSize:128/32}),T=n.CipherParams=o.extend({init:a(function(O){this.mixIn(O)},"init"),toString:a(function(O){return(O||this.formatter).stringify(this)},"toString")}),w=r.format={},R=w.OpenSSL={stringify:a(function(O){var B,q=O.ciphertext,M=O.salt;return M?B=s.create([1398893684,1701076831]).concat(M).concat(q):B=q,B.toString(d)},"stringify"),parse:a(function(O){var B,q=d.parse(O),M=q.words;return M[0]==1398893684&&M[1]==1701076831&&(B=s.create(M.slice(2,4)),M.splice(0,4),q.sigBytes-=16),T.create({ciphertext:q,salt:B})},"parse")},x=n.SerializableCipher=o.extend({cfg:o.extend({format:R}),encrypt:a(function(O,B,q,M){M=this.cfg.extend(M);var L=O.createEncryptor(q,M),U=L.finalize(B),j=L.cfg;return T.create({ciphertext:U,key:q,iv:j.iv,algorithm:O,mode:j.mode,padding:j.padding,blockSize:O.blockSize,formatter:M.format})},"encrypt"),decrypt:a(function(O,B,q,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var L=O.createDecryptor(q,M).finalize(B.ciphertext);return L},"decrypt"),_parse:a(function(O,B){return typeof O=="string"?B.parse(O,this):O},"_parse")}),k=r.kdf={},D=k.OpenSSL={execute:a(function(O,B,q,M,L){if(M||(M=s.random(64/8)),L)var U=h.create({keySize:B+q,hasher:L}).compute(O,M);else var U=h.create({keySize:B+q}).compute(O,M);var j=s.create(U.words.slice(B),q*4);return U.sigBytes=B*4,T.create({key:U,iv:j,salt:M})},"execute")},N=n.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:D}),encrypt:a(function(O,B,q,M){M=this.cfg.extend(M);var L=M.kdf.execute(q,O.keySize,O.ivSize,M.salt,M.hasher);M.iv=L.iv;var U=x.encrypt.call(this,O,B,L.key,M);return U.mixIn(L),U},"encrypt"),decrypt:a(function(O,B,q,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var L=M.kdf.execute(q,O.keySize,O.ivSize,B.salt,M.hasher);M.iv=L.iv;var U=x.decrypt.call(this,O,B,L.key,M);return U},"decrypt")})})()})});var Mzr=I((c7e,Nzr)=>{p();(function(t,e,r){typeof c7e=="object"?Nzr.exports=c7e=e(fa(),rg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(c7e,function(t){return t.mode.CFB=(function(){var e=t.lib.BlockCipherMode.extend();e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize;r.call(this,n,o,c,s),this._prevBlock=n.slice(o,o+c)},"processBlock")}),e.Decryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=n.slice(o,o+c);r.call(this,n,o,c,s),this._prevBlock=l},"processBlock")});function r(n,o,s,c){var l,u=this._iv;u?(l=u.slice(0),this._iv=void 0):l=this._prevBlock,c.encryptBlock(l,0);for(var d=0;d{p();(function(t,e,r){typeof l7e=="object"?Ozr.exports=l7e=e(fa(),rg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(l7e,function(t){return t.mode.CTR=(function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=this._iv,u=this._counter;l&&(u=this._counter=l.slice(0),this._iv=void 0);var d=u.slice(0);s.encryptBlock(d,0),u[c-1]=u[c-1]+1|0;for(var f=0;f{p();(function(t,e,r){typeof u7e=="object"?Bzr.exports=u7e=e(fa(),rg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(u7e,function(t){return t.mode.CTRGladman=(function(){var e=t.lib.BlockCipherMode.extend();function r(s){if((s>>24&255)===255){var c=s>>16&255,l=s>>8&255,u=s&255;c===255?(c=0,l===255?(l=0,u===255?u=0:++u):++l):++c,s=0,s+=c<<16,s+=l<<8,s+=u}else s+=1<<24;return s}a(r,"incWord");function n(s){return(s[0]=r(s[0]))===0&&(s[1]=r(s[1])),s}a(n,"incCounter");var o=e.Encryptor=e.extend({processBlock:a(function(s,c){var l=this._cipher,u=l.blockSize,d=this._iv,f=this._counter;d&&(f=this._counter=d.slice(0),this._iv=void 0),n(f);var h=f.slice(0);l.encryptBlock(h,0);for(var m=0;m{p();(function(t,e,r){typeof d7e=="object"?Uzr.exports=d7e=e(fa(),rg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(d7e,function(t){return t.mode.OFB=(function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=this._iv,u=this._keystream;l&&(u=this._keystream=l.slice(0),this._iv=void 0),s.encryptBlock(u,0);for(var d=0;d{p();(function(t,e,r){typeof f7e=="object"?qzr.exports=f7e=e(fa(),rg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(f7e,function(t){return t.mode.ECB=(function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:a(function(r,n){this._cipher.encryptBlock(r,n)},"processBlock")}),e.Decryptor=e.extend({processBlock:a(function(r,n){this._cipher.decryptBlock(r,n)},"processBlock")}),e})(),t.mode.ECB})});var Gzr=I((p7e,Hzr)=>{p();(function(t,e,r){typeof p7e=="object"?Hzr.exports=p7e=e(fa(),rg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(p7e,function(t){return t.pad.AnsiX923={pad:a(function(e,r){var n=e.sigBytes,o=r*4,s=o-n%o,c=n+s-1;e.clamp(),e.words[c>>>2]|=s<<24-c%4*8,e.sigBytes+=s},"pad"),unpad:a(function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r},"unpad")},t.pad.Ansix923})});var Vzr=I((h7e,$zr)=>{p();(function(t,e,r){typeof h7e=="object"?$zr.exports=h7e=e(fa(),rg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(h7e,function(t){return t.pad.Iso10126={pad:a(function(e,r){var n=r*4,o=n-e.sigBytes%n;e.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},"pad"),unpad:a(function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r},"unpad")},t.pad.Iso10126})});var zzr=I((m7e,Wzr)=>{p();(function(t,e,r){typeof m7e=="object"?Wzr.exports=m7e=e(fa(),rg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(m7e,function(t){return t.pad.Iso97971={pad:a(function(e,r){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,r)},"pad"),unpad:a(function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--},"unpad")},t.pad.Iso97971})});var Kzr=I((g7e,Yzr)=>{p();(function(t,e,r){typeof g7e=="object"?Yzr.exports=g7e=e(fa(),rg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(g7e,function(t){return t.pad.ZeroPadding={pad:a(function(e,r){var n=r*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},"pad"),unpad:a(function(e){for(var r=e.words,n=e.sigBytes-1,n=e.sigBytes-1;n>=0;n--)if(r[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}},"unpad")},t.pad.ZeroPadding})});var Zzr=I((A7e,Jzr)=>{p();(function(t,e,r){typeof A7e=="object"?Jzr.exports=A7e=e(fa(),rg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(A7e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var eYr=I((y7e,Xzr)=>{p();(function(t,e,r){typeof y7e=="object"?Xzr.exports=y7e=e(fa(),rg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(y7e,function(t){return(function(e){var r=t,n=r.lib,o=n.CipherParams,s=r.enc,c=s.Hex,l=r.format,u=l.Hex={stringify:a(function(d){return d.ciphertext.toString(c)},"stringify"),parse:a(function(d){var f=c.parse(d);return o.create({ciphertext:f})},"parse")}})(),t.format.Hex})});var rYr=I((_7e,tYr)=>{p();(function(t,e,r){typeof _7e=="object"?tYr.exports=_7e=e(fa(),W9(),z9(),qB(),rg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(_7e,function(t){return(function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo,s=[],c=[],l=[],u=[],d=[],f=[],h=[],m=[],g=[],A=[];(function(){for(var E=[],v=0;v<256;v++)v<128?E[v]=v<<1:E[v]=v<<1^283;for(var S=0,T=0,v=0;v<256;v++){var w=T^T<<1^T<<2^T<<3^T<<4;w=w>>>8^w&255^99,s[S]=w,c[w]=S;var R=E[S],x=E[R],k=E[x],D=E[w]*257^w*16843008;l[S]=D<<24|D>>>8,u[S]=D<<16|D>>>16,d[S]=D<<8|D>>>24,f[S]=D;var D=k*16843009^x*65537^R*257^S*16843008;h[w]=D<<24|D>>>8,m[w]=D<<16|D>>>16,g[w]=D<<8|D>>>24,A[w]=D,S?(S=R^E[E[E[k^R]]],T^=E[E[T]]):S=T=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],_=o.AES=n.extend({_doReset:a(function(){var E;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,S=v.words,T=v.sigBytes/4,w=this._nRounds=T+6,R=(w+1)*4,x=this._keySchedule=[],k=0;k6&&k%T==4&&(E=s[E>>>24]<<24|s[E>>>16&255]<<16|s[E>>>8&255]<<8|s[E&255]):(E=E<<8|E>>>24,E=s[E>>>24]<<24|s[E>>>16&255]<<16|s[E>>>8&255]<<8|s[E&255],E^=y[k/T|0]<<24),x[k]=x[k-T]^E);for(var D=this._invKeySchedule=[],N=0;N>>24]]^m[s[E>>>16&255]]^g[s[E>>>8&255]]^A[s[E&255]]}}},"_doReset"),encryptBlock:a(function(E,v){this._doCryptBlock(E,v,this._keySchedule,l,u,d,f,s)},"encryptBlock"),decryptBlock:a(function(E,v){var S=E[v+1];E[v+1]=E[v+3],E[v+3]=S,this._doCryptBlock(E,v,this._invKeySchedule,h,m,g,A,c);var S=E[v+1];E[v+1]=E[v+3],E[v+3]=S},"decryptBlock"),_doCryptBlock:a(function(E,v,S,T,w,R,x,k){for(var D=this._nRounds,N=E[v]^S[0],O=E[v+1]^S[1],B=E[v+2]^S[2],q=E[v+3]^S[3],M=4,L=1;L>>24]^w[O>>>16&255]^R[B>>>8&255]^x[q&255]^S[M++],j=T[O>>>24]^w[B>>>16&255]^R[q>>>8&255]^x[N&255]^S[M++],Q=T[B>>>24]^w[q>>>16&255]^R[N>>>8&255]^x[O&255]^S[M++],Y=T[q>>>24]^w[N>>>16&255]^R[O>>>8&255]^x[B&255]^S[M++];N=U,O=j,B=Q,q=Y}var U=(k[N>>>24]<<24|k[O>>>16&255]<<16|k[B>>>8&255]<<8|k[q&255])^S[M++],j=(k[O>>>24]<<24|k[B>>>16&255]<<16|k[q>>>8&255]<<8|k[N&255])^S[M++],Q=(k[B>>>24]<<24|k[q>>>16&255]<<16|k[N>>>8&255]<<8|k[O&255])^S[M++],Y=(k[q>>>24]<<24|k[N>>>16&255]<<16|k[O>>>8&255]<<8|k[B&255])^S[M++];E[v]=U,E[v+1]=j,E[v+2]=Q,E[v+3]=Y},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(_)})(),t.AES})});var iYr=I((E7e,nYr)=>{p();(function(t,e,r){typeof E7e=="object"?nYr.exports=E7e=e(fa(),W9(),z9(),qB(),rg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(E7e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=r.BlockCipher,s=e.algo,c=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],l=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=s.DES=o.extend({_doReset:a(function(){for(var y=this._key,_=y.words,E=[],v=0;v<56;v++){var S=c[v]-1;E[v]=_[S>>>5]>>>31-S%32&1}for(var T=this._subKeys=[],w=0;w<16;w++){for(var R=T[w]=[],x=u[w],v=0;v<24;v++)R[v/6|0]|=E[(l[v]-1+x)%28]<<31-v%6,R[4+(v/6|0)]|=E[28+(l[v+24]-1+x)%28]<<31-v%6;R[0]=R[0]<<1|R[0]>>>31;for(var v=1;v<7;v++)R[v]=R[v]>>>(v-1)*4+3;R[7]=R[7]<<5|R[7]>>>27}for(var k=this._invSubKeys=[],v=0;v<16;v++)k[v]=T[15-v]},"_doReset"),encryptBlock:a(function(y,_){this._doCryptBlock(y,_,this._subKeys)},"encryptBlock"),decryptBlock:a(function(y,_){this._doCryptBlock(y,_,this._invSubKeys)},"decryptBlock"),_doCryptBlock:a(function(y,_,E){this._lBlock=y[_],this._rBlock=y[_+1],m.call(this,4,252645135),m.call(this,16,65535),g.call(this,2,858993459),g.call(this,8,16711935),m.call(this,1,1431655765);for(var v=0;v<16;v++){for(var S=E[v],T=this._lBlock,w=this._rBlock,R=0,x=0;x<8;x++)R|=d[x][((w^S[x])&f[x])>>>0];this._lBlock=w,this._rBlock=T^R}var k=this._lBlock;this._lBlock=this._rBlock,this._rBlock=k,m.call(this,1,1431655765),g.call(this,8,16711935),g.call(this,2,858993459),m.call(this,16,65535),m.call(this,4,252645135),y[_]=this._lBlock,y[_+1]=this._rBlock},"_doCryptBlock"),keySize:64/32,ivSize:64/32,blockSize:64/32});function m(y,_){var E=(this._lBlock>>>y^this._rBlock)&_;this._rBlock^=E,this._lBlock^=E<>>y^this._lBlock)&_;this._lBlock^=E,this._rBlock^=E<192.");var E=_.slice(0,2),v=_.length<4?_.slice(0,2):_.slice(2,4),S=_.length<6?_.slice(0,2):_.slice(4,6);this._des1=h.createEncryptor(n.create(E)),this._des2=h.createEncryptor(n.create(v)),this._des3=h.createEncryptor(n.create(S))},"_doReset"),encryptBlock:a(function(y,_){this._des1.encryptBlock(y,_),this._des2.decryptBlock(y,_),this._des3.encryptBlock(y,_)},"encryptBlock"),decryptBlock:a(function(y,_){this._des3.decryptBlock(y,_),this._des2.encryptBlock(y,_),this._des1.decryptBlock(y,_)},"decryptBlock"),keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=o._createHelper(A)})(),t.TripleDES})});var sYr=I((v7e,oYr)=>{p();(function(t,e,r){typeof v7e=="object"?oYr.exports=v7e=e(fa(),W9(),z9(),qB(),rg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(v7e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=o.RC4=n.extend({_doReset:a(function(){for(var u=this._key,d=u.words,f=u.sigBytes,h=this._S=[],m=0;m<256;m++)h[m]=m;for(var m=0,g=0;m<256;m++){var A=m%f,y=d[A>>>2]>>>24-A%4*8&255;g=(g+h[m]+y)%256;var _=h[m];h[m]=h[g],h[g]=_}this._i=this._j=0},"_doReset"),_doProcessBlock:a(function(u,d){u[d]^=c.call(this)},"_doProcessBlock"),keySize:256/32,ivSize:0});function c(){for(var u=this._S,d=this._i,f=this._j,h=0,m=0;m<4;m++){d=(d+1)%256,f=(f+u[d])%256;var g=u[d];u[d]=u[f],u[f]=g,h|=u[(u[d]+u[f])%256]<<24-m*8}return this._i=d,this._j=f,h}a(c,"generateKeystreamWord"),e.RC4=n._createHelper(s);var l=o.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:a(function(){s._doReset.call(this);for(var u=this.cfg.drop;u>0;u--)c.call(this)},"_doReset")});e.RC4Drop=n._createHelper(l)})(),t.RC4})});var cYr=I((C7e,aYr)=>{p();(function(t,e,r){typeof C7e=="object"?aYr.exports=C7e=e(fa(),W9(),z9(),qB(),rg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(C7e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=[],c=[],l=[],u=o.Rabbit=n.extend({_doReset:a(function(){for(var f=this._key.words,h=this.cfg.iv,m=0;m<4;m++)f[m]=(f[m]<<8|f[m]>>>24)&16711935|(f[m]<<24|f[m]>>>8)&4278255360;var g=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],A=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var m=0;m<4;m++)d.call(this);for(var m=0;m<8;m++)A[m]^=g[m+4&7];if(h){var y=h.words,_=y[0],E=y[1],v=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,S=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,T=v>>>16|S&4294901760,w=S<<16|v&65535;A[0]^=v,A[1]^=T,A[2]^=S,A[3]^=w,A[4]^=v,A[5]^=T,A[6]^=S,A[7]^=w;for(var m=0;m<4;m++)d.call(this)}},"_doReset"),_doProcessBlock:a(function(f,h){var m=this._X;d.call(this),s[0]=m[0]^m[5]>>>16^m[3]<<16,s[1]=m[2]^m[7]>>>16^m[5]<<16,s[2]=m[4]^m[1]>>>16^m[7]<<16,s[3]=m[6]^m[3]>>>16^m[1]<<16;for(var g=0;g<4;g++)s[g]=(s[g]<<8|s[g]>>>24)&16711935|(s[g]<<24|s[g]>>>8)&4278255360,f[h+g]^=s[g]},"_doProcessBlock"),blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,m=0;m<8;m++)c[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var g=f[m]+h[m],A=g&65535,y=g>>>16,_=((A*A>>>17)+A*y>>>15)+y*y,E=((g&4294901760)*g|0)+((g&65535)*g|0);l[m]=_^E}f[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,f[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,f[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,f[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,f[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,f[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,f[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,f[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}a(d,"nextState"),e.Rabbit=n._createHelper(u)})(),t.Rabbit})});var uYr=I((b7e,lYr)=>{p();(function(t,e,r){typeof b7e=="object"?lYr.exports=b7e=e(fa(),W9(),z9(),qB(),rg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(b7e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=[],c=[],l=[],u=o.RabbitLegacy=n.extend({_doReset:a(function(){var f=this._key.words,h=this.cfg.iv,m=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],g=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var A=0;A<4;A++)d.call(this);for(var A=0;A<8;A++)g[A]^=m[A+4&7];if(h){var y=h.words,_=y[0],E=y[1],v=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,S=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,T=v>>>16|S&4294901760,w=S<<16|v&65535;g[0]^=v,g[1]^=T,g[2]^=S,g[3]^=w,g[4]^=v,g[5]^=T,g[6]^=S,g[7]^=w;for(var A=0;A<4;A++)d.call(this)}},"_doReset"),_doProcessBlock:a(function(f,h){var m=this._X;d.call(this),s[0]=m[0]^m[5]>>>16^m[3]<<16,s[1]=m[2]^m[7]>>>16^m[5]<<16,s[2]=m[4]^m[1]>>>16^m[7]<<16,s[3]=m[6]^m[3]>>>16^m[1]<<16;for(var g=0;g<4;g++)s[g]=(s[g]<<8|s[g]>>>24)&16711935|(s[g]<<24|s[g]>>>8)&4278255360,f[h+g]^=s[g]},"_doProcessBlock"),blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,m=0;m<8;m++)c[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var g=f[m]+h[m],A=g&65535,y=g>>>16,_=((A*A>>>17)+A*y>>>15)+y*y,E=((g&4294901760)*g|0)+((g&65535)*g|0);l[m]=_^E}f[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,f[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,f[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,f[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,f[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,f[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,f[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,f[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}a(d,"nextState"),e.RabbitLegacy=n._createHelper(u)})(),t.RabbitLegacy})});var fYr=I((S7e,dYr)=>{p();(function(t,e,r){typeof S7e=="object"?dYr.exports=S7e=e(fa(),W9(),z9(),qB(),rg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(S7e,function(t){return(function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo;let s=16,c=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],l=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var u={pbox:[],sbox:[]};function d(A,y){let _=y>>24&255,E=y>>16&255,v=y>>8&255,S=y&255,T=A.sbox[0][_]+A.sbox[1][E];return T=T^A.sbox[2][v],T=T+A.sbox[3][S],T}a(d,"F");function f(A,y,_){let E=y,v=_,S;for(let T=0;T1;--T)E=E^A.pbox[T],v=d(A,E)^v,S=E,E=v,v=S;return S=E,E=v,v=S,v=v^A.pbox[1],E=E^A.pbox[0],{left:E,right:v}}a(h,"BlowFish_Decrypt");function m(A,y,_){for(let w=0;w<4;w++){A.sbox[w]=[];for(let R=0;R<256;R++)A.sbox[w][R]=l[w][R]}let E=0;for(let w=0;w=_&&(E=0);let v=0,S=0,T=0;for(let w=0;w{p();(function(t,e,r){typeof T7e=="object"?pYr.exports=T7e=e(fa(),oSe(),uzr(),fzr(),W9(),mzr(),z9(),WDt(),J9e(),Ezr(),zDt(),bzr(),Tzr(),xzr(),i7e(),kzr(),qB(),rg(),Mzr(),Lzr(),Fzr(),Qzr(),jzr(),Gzr(),Vzr(),zzr(),Kzr(),Zzr(),eYr(),rYr(),iYr(),sYr(),cYr(),uYr(),fYr()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./enc-base64url","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy","./blowfish"],e):t.CryptoJS=e(t.CryptoJS)})(T7e,function(t){return t})});var Yse=I(n_=>{"use strict";p();Object.defineProperty(n_,"__esModule",{value:!0});n_.stringArray=n_.array=n_.func=n_.error=n_.number=n_.string=n_.boolean=void 0;function g1o(t){return t===!0||t===!1}a(g1o,"boolean");n_.boolean=g1o;function KJr(t){return typeof t=="string"||t instanceof String}a(KJr,"string");n_.string=KJr;function A1o(t){return typeof t=="number"||t instanceof Number}a(A1o,"number");n_.number=A1o;function y1o(t){return t instanceof Error}a(y1o,"error");n_.error=y1o;function _1o(t){return typeof t=="function"}a(_1o,"func");n_.func=_1o;function JJr(t){return Array.isArray(t)}a(JJr,"array");n_.array=JJr;function E1o(t){return JJr(t)&&t.every(e=>KJr(e))}a(E1o,"stringArray");n_.stringArray=E1o});var yMt=I(gi=>{"use strict";p();Object.defineProperty(gi,"__esModule",{value:!0});gi.Message=gi.NotificationType9=gi.NotificationType8=gi.NotificationType7=gi.NotificationType6=gi.NotificationType5=gi.NotificationType4=gi.NotificationType3=gi.NotificationType2=gi.NotificationType1=gi.NotificationType0=gi.NotificationType=gi.RequestType9=gi.RequestType8=gi.RequestType7=gi.RequestType6=gi.RequestType5=gi.RequestType4=gi.RequestType3=gi.RequestType2=gi.RequestType1=gi.RequestType=gi.RequestType0=gi.AbstractMessageSignature=gi.ParameterStructures=gi.ResponseError=gi.ErrorCodes=void 0;var Mz=Yse(),zNt;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(zNt||(gi.ErrorCodes=zNt={}));var YNt=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=Mz.number(e)?e:zNt.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};gi.ResponseError=YNt;var wC=class t{static{a(this,"ParameterStructures")}constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};gi.ParameterStructures=wC;wC.auto=new wC("auto");wC.byPosition=new wC("byPosition");wC.byName=new wC("byName");var Xu=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return wC.auto}};gi.AbstractMessageSignature=Xu;var KNt=class extends Xu{static{a(this,"RequestType0")}constructor(e){super(e,0)}};gi.RequestType0=KNt;var JNt=class extends Xu{static{a(this,"RequestType")}constructor(e,r=wC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};gi.RequestType=JNt;var ZNt=class extends Xu{static{a(this,"RequestType1")}constructor(e,r=wC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};gi.RequestType1=ZNt;var XNt=class extends Xu{static{a(this,"RequestType2")}constructor(e){super(e,2)}};gi.RequestType2=XNt;var eMt=class extends Xu{static{a(this,"RequestType3")}constructor(e){super(e,3)}};gi.RequestType3=eMt;var tMt=class extends Xu{static{a(this,"RequestType4")}constructor(e){super(e,4)}};gi.RequestType4=tMt;var rMt=class extends Xu{static{a(this,"RequestType5")}constructor(e){super(e,5)}};gi.RequestType5=rMt;var nMt=class extends Xu{static{a(this,"RequestType6")}constructor(e){super(e,6)}};gi.RequestType6=nMt;var iMt=class extends Xu{static{a(this,"RequestType7")}constructor(e){super(e,7)}};gi.RequestType7=iMt;var oMt=class extends Xu{static{a(this,"RequestType8")}constructor(e){super(e,8)}};gi.RequestType8=oMt;var sMt=class extends Xu{static{a(this,"RequestType9")}constructor(e){super(e,9)}};gi.RequestType9=sMt;var aMt=class extends Xu{static{a(this,"NotificationType")}constructor(e,r=wC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};gi.NotificationType=aMt;var cMt=class extends Xu{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};gi.NotificationType0=cMt;var lMt=class extends Xu{static{a(this,"NotificationType1")}constructor(e,r=wC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};gi.NotificationType1=lMt;var uMt=class extends Xu{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};gi.NotificationType2=uMt;var dMt=class extends Xu{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};gi.NotificationType3=dMt;var fMt=class extends Xu{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};gi.NotificationType4=fMt;var pMt=class extends Xu{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};gi.NotificationType5=pMt;var hMt=class extends Xu{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};gi.NotificationType6=hMt;var mMt=class extends Xu{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};gi.NotificationType7=mMt;var gMt=class extends Xu{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};gi.NotificationType8=gMt;var AMt=class extends Xu{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};gi.NotificationType9=AMt;var ZJr;(function(t){function e(o){let s=o;return s&&Mz.string(s.method)&&(Mz.string(s.id)||Mz.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&Mz.string(s.method)&&o.id===void 0}a(r,"isNotification"),t.isNotification=r;function n(o){let s=o;return s&&(s.result!==void 0||!!s.error)&&(Mz.string(s.id)||Mz.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})(ZJr||(gi.Message=ZJr={}))});var EMt=I(u7=>{"use strict";p();var XJr;Object.defineProperty(u7,"__esModule",{value:!0});u7.LRUCache=u7.LinkedMap=u7.Touch=void 0;var i_;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(i_||(u7.Touch=i_={}));var aQe=class{static{a(this,"LinkedMap")}constructor(){this[XJr]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=i_.None){let n=this._map.get(e);if(n)return r!==i_.None&&this.touch(n,r),n.value}set(e,r,n=i_.None){let o=this._map.get(e);if(o)o.value=r,n!==i_.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case i_.None:this.addItemLast(o);break;case i_.First:this.addItemFirst(o);break;case i_.Last:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}[(XJr=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==i_.First&&r!==i_.Last)){if(r===i_.First){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===i_.Last){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};u7.LinkedMap=aQe;var _Mt=class extends aQe{static{a(this,"LRUCache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=i_.AsNew){return super.get(e,r)}peek(e){return super.get(e,i_.None)}set(e,r){return super.set(e,r,i_.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};u7.LRUCache=_Mt});var tZr=I(cQe=>{"use strict";p();Object.defineProperty(cQe,"__esModule",{value:!0});cQe.Disposable=void 0;var eZr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(eZr||(cQe.Disposable=eZr={}))});var d7=I(bMt=>{"use strict";p();Object.defineProperty(bMt,"__esModule",{value:!0});var vMt;function CMt(){if(vMt===void 0)throw new Error("No runtime abstraction layer installed");return vMt}a(CMt,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");vMt=r}a(e,"install"),t.install=e})(CMt||(CMt={}));bMt.default=CMt});var Jse=I(Kse=>{"use strict";p();Object.defineProperty(Kse,"__esModule",{value:!0});Kse.Emitter=Kse.Event=void 0;var v1o=d7(),rZr;(function(t){let e={dispose(){}};t.None=function(){return e}})(rZr||(Kse.Event=rZr={}));var SMt=class{static{a(this,"CallbackList")}add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:a(()=>this.remove(e,r),"dispose")})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let o=0,s=this._callbacks.length;o{this._callbacks||(this._callbacks=new SMt),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let o={dispose:a(()=>{this._callbacks&&(this._callbacks.remove(e,r),o.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(n)&&n.push(o),o}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Kse.Emitter=lQe;lQe._noop=function(){}});var fQe=I(Zse=>{"use strict";p();Object.defineProperty(Zse,"__esModule",{value:!0});Zse.CancellationTokenSource=Zse.CancellationToken=void 0;var C1o=d7(),b1o=Yse(),TMt=Jse(),uQe;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:TMt.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:TMt.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||b1o.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})(uQe||(Zse.CancellationToken=uQe={}));var S1o=Object.freeze(function(t,e){let r=(0,C1o.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),dQe=class{static{a(this,"MutableToken")}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?S1o:(this._emitter||(this._emitter=new TMt.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},IMt=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new dQe),this._token}cancel(){this._token?this._token.cancel():this._token=uQe.Cancelled}dispose(){this._token?this._token instanceof dQe&&this._token.dispose():this._token=uQe.None}};Zse.CancellationTokenSource=IMt});var nZr=I(Xse=>{"use strict";p();Object.defineProperty(Xse,"__esModule",{value:!0});Xse.SharedArrayReceiverStrategy=Xse.SharedArraySenderStrategy=void 0;var T1o=fQe(),TSe;(function(t){t.Continue=0,t.Cancelled=1})(TSe||(TSe={}));var xMt=class{static{a(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=TSe.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let o=new Int32Array(n,0,1);Atomics.store(o,0,TSe.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Xse.SharedArraySenderStrategy=xMt;var wMt=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===TSe.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},RMt=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new wMt(e)}cancel(){}dispose(){}},kMt=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new T1o.CancellationTokenSource:new RMt(r)}};Xse.SharedArrayReceiverStrategy=kMt});var DMt=I(pQe=>{"use strict";p();Object.defineProperty(pQe,"__esModule",{value:!0});pQe.Semaphore=void 0;var I1o=d7(),PMt=class{static{a(this,"Semaphore")}constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,I1o.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};pQe.Semaphore=PMt});var oZr=I(f7=>{"use strict";p();Object.defineProperty(f7,"__esModule",{value:!0});f7.ReadableStreamMessageReader=f7.AbstractMessageReader=f7.MessageReader=void 0;var MMt=d7(),eae=Yse(),NMt=Jse(),x1o=DMt(),iZr;(function(t){function e(r){let n=r;return n&&eae.func(n.listen)&&eae.func(n.dispose)&&eae.func(n.onError)&&eae.func(n.onClose)&&eae.func(n.onPartialMessage)}a(e,"is"),t.is=e})(iZr||(f7.MessageReader=iZr={}));var hQe=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new NMt.Emitter,this.closeEmitter=new NMt.Emitter,this.partialMessageEmitter=new NMt.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${eae.string(e.message)?e.message:"unknown"}`)}};f7.AbstractMessageReader=hQe;var OMt;(function(t){function e(r){let n,o,s,c=new Map,l,u=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,c.set(s.name,s)),r.contentDecoders!==void 0)for(let d of r.contentDecoders)c.set(d.name,d);if(r.contentTypeDecoder!==void 0&&(l=r.contentTypeDecoder,u.set(l.name,l)),r.contentTypeDecoders!==void 0)for(let d of r.contentTypeDecoders)u.set(d.name,d)}return l===void 0&&(l=(0,MMt.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(OMt||(OMt={}));var LMt=class extends hQe{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=OMt.fromOptions(r),this.buffer=(0,MMt.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new x1o.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let o=n.get("content-length");if(!o){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(o);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${o}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,o=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(o)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,MMt.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};f7.ReadableStreamMessageReader=LMt});var uZr=I(p7=>{"use strict";p();Object.defineProperty(p7,"__esModule",{value:!0});p7.WriteableStreamMessageWriter=p7.AbstractMessageWriter=p7.MessageWriter=void 0;var sZr=d7(),ISe=Yse(),w1o=DMt(),aZr=Jse(),R1o="Content-Length: ",cZr=`\r +`,lZr;(function(t){function e(r){let n=r;return n&&ISe.func(n.dispose)&&ISe.func(n.onClose)&&ISe.func(n.onError)&&ISe.func(n.write)}a(e,"is"),t.is=e})(lZr||(p7.MessageWriter=lZr={}));var mQe=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new aZr.Emitter,this.closeEmitter=new aZr.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${ISe.string(e.message)?e.message:"unknown"}`)}};p7.AbstractMessageWriter=mQe;var BMt;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,sZr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,sZr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(BMt||(BMt={}));var FMt=class extends mQe{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=BMt.fromOptions(r),this.errorCount=0,this.writeSemaphore=new w1o.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let o=[];return o.push(R1o,n.byteLength.toString(),cZr),o.push(cZr),this.doWrite(e,o,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(o){return this.handleError(o,e),Promise.reject(o)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};p7.WriteableStreamMessageWriter=FMt});var dZr=I(gQe=>{"use strict";p();Object.defineProperty(gQe,"__esModule",{value:!0});gQe.AbstractMessageBuffer=void 0;var k1o=13,P1o=10,D1o=`\r +`,UMt=class{static{a(this,"AbstractMessageBuffer")}constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,o=0,s=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],c=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,c}let r=this.allocNative(e),n=0,o=0;for(;e>0;){let s=this._chunks[o];if(s.byteLength>e){let c=s.slice(0,e);r.set(c,n),n+=e,this._chunks[o]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};gQe.AbstractMessageBuffer=UMt});var gZr=I(Uo=>{"use strict";p();Object.defineProperty(Uo,"__esModule",{value:!0});Uo.createMessageConnection=Uo.ConnectionOptions=Uo.MessageStrategy=Uo.CancellationStrategy=Uo.CancellationSenderStrategy=Uo.CancellationReceiverStrategy=Uo.RequestCancellationReceiverStrategy=Uo.IdCancellationReceiverStrategy=Uo.ConnectionStrategy=Uo.ConnectionError=Uo.ConnectionErrors=Uo.LogTraceNotification=Uo.SetTraceNotification=Uo.TraceFormat=Uo.TraceValues=Uo.Trace=Uo.NullLogger=Uo.ProgressType=Uo.ProgressToken=void 0;var fZr=d7(),vf=Yse(),Ki=yMt(),pZr=EMt(),xSe=Jse(),QMt=fQe(),kSe;(function(t){t.type=new Ki.NotificationType("$/cancelRequest")})(kSe||(kSe={}));var qMt;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(qMt||(Uo.ProgressToken=qMt={}));var wSe;(function(t){t.type=new Ki.NotificationType("$/progress")})(wSe||(wSe={}));var jMt=class{static{a(this,"ProgressType")}constructor(){}};Uo.ProgressType=jMt;var HMt;(function(t){function e(r){return vf.func(r)}a(e,"is"),t.is=e})(HMt||(HMt={}));Uo.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var Mc;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Mc||(Uo.Trace=Mc={}));var hZr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(hZr||(Uo.TraceValues=hZr={}));(function(t){function e(n){if(!vf.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}a(e,"fromString"),t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}a(r,"toString"),t.toString=r})(Mc||(Uo.Trace=Mc={}));var m1;(function(t){t.Text="text",t.JSON="json"})(m1||(Uo.TraceFormat=m1={}));(function(t){function e(r){return vf.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(m1||(Uo.TraceFormat=m1={}));var GMt;(function(t){t.type=new Ki.NotificationType("$/setTrace")})(GMt||(Uo.SetTraceNotification=GMt={}));var AQe;(function(t){t.type=new Ki.NotificationType("$/logTrace")})(AQe||(Uo.LogTraceNotification=AQe={}));var RSe;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(RSe||(Uo.ConnectionErrors=RSe={}));var tae=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Uo.ConnectionError=tae;var $Mt;(function(t){function e(r){let n=r;return n&&vf.func(n.cancelUndispatched)}a(e,"is"),t.is=e})($Mt||(Uo.ConnectionStrategy=$Mt={}));var yQe;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&vf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||vf.func(n.dispose))}a(e,"is"),t.is=e})(yQe||(Uo.IdCancellationReceiverStrategy=yQe={}));var VMt;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&vf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||vf.func(n.dispose))}a(e,"is"),t.is=e})(VMt||(Uo.RequestCancellationReceiverStrategy=VMt={}));var _Qe;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new QMt.CancellationTokenSource}});function e(r){return yQe.is(r)||VMt.is(r)}a(e,"is"),t.is=e})(_Qe||(Uo.CancellationReceiverStrategy=_Qe={}));var EQe;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(kSe.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&vf.func(n.sendCancellation)&&vf.func(n.cleanup)}a(e,"is"),t.is=e})(EQe||(Uo.CancellationSenderStrategy=EQe={}));var vQe;(function(t){t.Message=Object.freeze({receiver:_Qe.Message,sender:EQe.Message});function e(r){let n=r;return n&&_Qe.is(n.receiver)&&EQe.is(n.sender)}a(e,"is"),t.is=e})(vQe||(Uo.CancellationStrategy=vQe={}));var CQe;(function(t){function e(r){let n=r;return n&&vf.func(n.handleMessage)}a(e,"is"),t.is=e})(CQe||(Uo.MessageStrategy=CQe={}));var mZr;(function(t){function e(r){let n=r;return n&&(vQe.is(n.cancellationStrategy)||$Mt.is(n.connectionStrategy)||CQe.is(n.messageStrategy))}a(e,"is"),t.is=e})(mZr||(Uo.ConnectionOptions=mZr={}));var vP;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(vP||(vP={}));function N1o(t,e,r,n){let o=r!==void 0?r:Uo.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new pZr.LinkedMap,_=new Map,E=new Set,v=new Map,S=Mc.Off,T=m1.Text,w,R=vP.New,x=new xSe.Emitter,k=new xSe.Emitter,D=new xSe.Emitter,N=new xSe.Emitter,O=new xSe.Emitter,B=n&&n.cancellationStrategy?n.cancellationStrategy:vQe.Message;function q(se){if(se===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+se.toString()}a(q,"createRequestQueueKey");function M(se){return se===null?"res-unknown-"+(++l).toString():"res-"+se.toString()}a(M,"createResponseQueueKey");function L(){return"not-"+(++c).toString()}a(L,"createNotificationQueueKey");function U(se,be){Ki.Message.isRequest(be)?se.set(q(be.id),be):Ki.Message.isResponse(be)?se.set(M(be.id),be):se.set(L(),be)}a(U,"addMessageToQueue");function j(se){}a(j,"cancelUndispatched");function Q(){return R===vP.Listening}a(Q,"isListening");function Y(){return R===vP.Closed}a(Y,"isClosed");function W(){return R===vP.Disposed}a(W,"isDisposed");function V(){(R===vP.New||R===vP.Listening)&&(R=vP.Closed,k.fire(void 0))}a(V,"closeHandler");function z(se){x.fire([se,void 0,void 0])}a(z,"readErrorHandler");function ie(se){x.fire(se)}a(ie,"writeErrorHandler"),t.onClose(V),t.onError(z),e.onClose(V),e.onError(ie);function H(){A||y.size===0||(A=(0,fZr.default)().timer.setImmediate(()=>{A=void 0,le()}))}a(H,"triggerMessageQueue");function re(se){Ki.Message.isRequest(se)?me(se):Ki.Message.isNotification(se)?Te(se):Ki.Message.isResponse(se)?Oe(se):te(se)}a(re,"handleMessage");function le(){if(y.size===0)return;let se=y.shift();try{let be=n?.messageStrategy;CQe.is(be)?be.handleMessage(se,re):re(se)}finally{H()}}a(le,"processMessageQueue");let Le=a(se=>{try{if(Ki.Message.isNotification(se)&&se.method===kSe.type.method){let be=se.params.id,Ue=q(be),Qe=y.get(Ue);if(Ki.Message.isRequest(Qe)){let Z=n?.connectionStrategy,ve=Z&&Z.cancelUndispatched?Z.cancelUndispatched(Qe,j):void 0;if(ve&&(ve.error!==void 0||ve.result!==void 0)){y.delete(Ue),v.delete(be),ve.id=Qe.id,X(ve,se.method,Date.now()),e.write(ve).catch(()=>o.error("Sending response for canceled message failed."));return}}let ge=v.get(be);if(ge!==void 0){ge.cancel(),Be(se);return}else E.add(be)}U(y,se)}finally{H()}},"callback");function me(se){if(W())return;function be(qe,je,J){let ae={jsonrpc:u,id:se.id};qe instanceof Ki.ResponseError?ae.error=qe.toJson():ae.result=qe===void 0?null:qe,X(ae,je,J),e.write(ae).catch(()=>o.error("Sending response failed."))}a(be,"reply");function Ue(qe,je,J){let ae={jsonrpc:u,id:se.id,error:qe.toJson()};X(ae,je,J),e.write(ae).catch(()=>o.error("Sending response failed."))}a(Ue,"replyError");function Qe(qe,je,J){qe===void 0&&(qe=null);let ae={jsonrpc:u,id:se.id,result:qe};X(ae,je,J),e.write(ae).catch(()=>o.error("Sending response failed."))}a(Qe,"replySuccess"),de(se);let ge=f.get(se.method),Z,ve;ge&&(Z=ge.type,ve=ge.handler);let Ge=Date.now();if(ve||d){let qe=se.id??String(Date.now()),je=yQe.is(B.receiver)?B.receiver.createCancellationTokenSource(qe):B.receiver.createCancellationTokenSource(se);se.id!==null&&E.has(se.id)&&je.cancel(),se.id!==null&&v.set(qe,je);try{let J;if(ve)if(se.params===void 0){if(Z!==void 0&&Z.numberOfParams!==0){Ue(new Ki.ResponseError(Ki.ErrorCodes.InvalidParams,`Request ${se.method} defines ${Z.numberOfParams} params but received none.`),se.method,Ge);return}J=ve(je.token)}else if(Array.isArray(se.params)){if(Z!==void 0&&Z.parameterStructures===Ki.ParameterStructures.byName){Ue(new Ki.ResponseError(Ki.ErrorCodes.InvalidParams,`Request ${se.method} defines parameters by name but received parameters by position`),se.method,Ge);return}J=ve(...se.params,je.token)}else{if(Z!==void 0&&Z.parameterStructures===Ki.ParameterStructures.byPosition){Ue(new Ki.ResponseError(Ki.ErrorCodes.InvalidParams,`Request ${se.method} defines parameters by position but received parameters by name`),se.method,Ge);return}J=ve(se.params,je.token)}else d&&(J=d(se.method,se.params,je.token));let ae=J;J?ae.then?ae.then(Ce=>{v.delete(qe),be(Ce,se.method,Ge)},Ce=>{v.delete(qe),Ce instanceof Ki.ResponseError?Ue(Ce,se.method,Ge):Ce&&vf.string(Ce.message)?Ue(new Ki.ResponseError(Ki.ErrorCodes.InternalError,`Request ${se.method} failed with message: ${Ce.message}`),se.method,Ge):Ue(new Ki.ResponseError(Ki.ErrorCodes.InternalError,`Request ${se.method} failed unexpectedly without providing any details.`),se.method,Ge)}):(v.delete(qe),be(J,se.method,Ge)):(v.delete(qe),Qe(J,se.method,Ge))}catch(J){v.delete(qe),J instanceof Ki.ResponseError?be(J,se.method,Ge):J&&vf.string(J.message)?Ue(new Ki.ResponseError(Ki.ErrorCodes.InternalError,`Request ${se.method} failed with message: ${J.message}`),se.method,Ge):Ue(new Ki.ResponseError(Ki.ErrorCodes.InternalError,`Request ${se.method} failed unexpectedly without providing any details.`),se.method,Ge)}}else Ue(new Ki.ResponseError(Ki.ErrorCodes.MethodNotFound,`Unhandled method ${se.method}`),se.method,Ge)}a(me,"handleRequest");function Oe(se){if(!W())if(se.id===null)se.error?o.error(`Received response message without id: Error is: +${JSON.stringify(se.error,void 0,4)}`):o.error("Received response message without id. No further error information provided.");else{let be=se.id,Ue=_.get(be);if(ne(se,Ue),Ue!==void 0){_.delete(be);try{if(se.error){let Qe=se.error;Ue.reject(new Ki.ResponseError(Qe.code,Qe.message,Qe.data))}else if(se.result!==void 0)Ue.resolve(se.result);else throw new Error("Should never happen.")}catch(Qe){Qe.message?o.error(`Response handler '${Ue.method}' failed with message: ${Qe.message}`):o.error(`Response handler '${Ue.method}' failed unexpectedly.`)}}}}a(Oe,"handleResponse");function Te(se){if(W())return;let be,Ue;if(se.method===kSe.type.method){let Qe=se.params.id;E.delete(Qe),Be(se);return}else{let Qe=m.get(se.method);Qe&&(Ue=Qe.handler,be=Qe.type)}if(Ue||h)try{if(Be(se),Ue)if(se.params===void 0)be!==void 0&&be.numberOfParams!==0&&be.parameterStructures!==Ki.ParameterStructures.byName&&o.error(`Notification ${se.method} defines ${be.numberOfParams} params but received none.`),Ue();else if(Array.isArray(se.params)){let Qe=se.params;se.method===wSe.type.method&&Qe.length===2&&qMt.is(Qe[0])?Ue({token:Qe[0],value:Qe[1]}):(be!==void 0&&(be.parameterStructures===Ki.ParameterStructures.byName&&o.error(`Notification ${se.method} defines parameters by name but received parameters by position`),be.numberOfParams!==se.params.length&&o.error(`Notification ${se.method} defines ${be.numberOfParams} params but received ${Qe.length} arguments`)),Ue(...Qe))}else be!==void 0&&be.parameterStructures===Ki.ParameterStructures.byPosition&&o.error(`Notification ${se.method} defines parameters by position but received parameters by name`),Ue(se.params);else h&&h(se.method,se.params)}catch(Qe){Qe.message?o.error(`Notification handler '${se.method}' failed with message: ${Qe.message}`):o.error(`Notification handler '${se.method}' failed unexpectedly.`)}else D.fire(se)}a(Te,"handleNotification");function te(se){if(!se){o.error("Received empty message.");return}o.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(se,null,4)}`);let be=se;if(vf.string(be.id)||vf.number(be.id)){let Ue=be.id,Qe=_.get(Ue);Qe&&Qe.reject(new Error("The received response has neither a result nor an error property."))}}a(te,"handleInvalidMessage");function ee(se){if(se!=null)switch(S){case Mc.Verbose:return JSON.stringify(se,null,4);case Mc.Compact:return JSON.stringify(se);default:return}}a(ee,"stringifyTrace");function K(se){if(!(S===Mc.Off||!w))if(T===m1.Text){let be;(S===Mc.Verbose||S===Mc.Compact)&&se.params&&(be=`Params: ${ee(se.params)} `),w.log(`Sending request '${se.method} - (${se.id})'.`,be)}else ue("send-request",se)}a(K,"traceSendingRequest");function he(se){if(!(S===Mc.Off||!w))if(T===m1.Text){let be;(S===Mc.Verbose||S===Mc.Compact)&&(se.params?be=`Params: ${ee(se.params)} @@ -36,58 +36,58 @@ ${JSON.stringify(se,null,4)}`);let be=se;if(vf.string(be.id)||vf.number(be.id)){ `:se.error===void 0&&(Ue=`No result returned. -`)),be){let Qe=se.error?` Request failed: ${se.error.message} (${se.error.code}).`:"";w.log(`Received response '${be.method} - (${se.id})' in ${Date.now()-be.timerStart}ms.${Qe}`,Ue)}else w.log(`Received response ${se.id} without active response promise.`,Ue)}else ue("receive-response",se)}a(ne,"traceReceivedResponse");function ue(se,be){if(!w||S===Mc.Off)return;let Ue={isLSPMessage:!0,type:se,message:be,timestamp:Date.now()};w.log(Ue)}a(ue,"logLSPMessage");function Ne(){if(Y())throw new eae(RSe.Closed,"Connection is closed.");if(W())throw new eae(RSe.Disposed,"Connection is disposed.")}a(Ne,"throwIfClosedOrDisposed");function xe(){if(Q())throw new eae(RSe.AlreadyListening,"Connection is already listening")}a(xe,"throwIfListening");function Fe(){if(!Q())throw new Error("Call listen() first.")}a(Fe,"throwIfNotListening");function tt(se){return se===void 0?null:se}a(tt,"undefinedToNull");function st(se){if(se!==null)return se}a(st,"nullToUndefined");function vt(se){return se!=null&&!Array.isArray(se)&&typeof se=="object"}a(vt,"isNamedParam");function Pt(se,be){switch(se){case Ki.ParameterStructures.auto:return vt(be)?st(be):[tt(be)];case Ki.ParameterStructures.byName:if(!vt(be))throw new Error("Received parameters by name but param is not an object literal.");return st(be);case Ki.ParameterStructures.byPosition:return[tt(be)];default:throw new Error(`Unknown parameter structure ${se.toString()}`)}}a(Pt,"computeSingleParam");function Ht(se,be){let Ue,Qe=se.numberOfParams;switch(Qe){case 0:Ue=void 0;break;case 1:Ue=Pt(se.parameterStructures,be[0]);break;default:Ue=[];for(let ge=0;ge{Ne();let Ue,Qe;if(vf.string(se)){Ue=se;let Z=be[0],ve=0,Ge=Ki.ParameterStructures.auto;Ki.ParameterStructures.is(Z)&&(ve=1,Ge=Z);let qe=be.length,je=qe-ve;switch(je){case 0:Qe=void 0;break;case 1:Qe=Pt(Ge,be[ve]);break;default:if(Ge===Ki.ParameterStructures.byName)throw new Error(`Received ${je} parameters for 'by Name' notification parameter structure.`);Qe=be.slice(ve,qe).map(J=>tt(J));break}}else{let Z=be;Ue=se.method,Qe=Ht(se,Z)}let ge={jsonrpc:u,method:Ue,params:Qe};return he(ge),e.write(ge).catch(Z=>{throw o.error("Sending notification failed."),Z})},"sendNotification"),onNotification:a((se,be)=>{Ne();let Ue;return vf.func(se)?h=se:be&&(vf.string(se)?(Ue=se,m.set(se,{type:void 0,handler:be})):(Ue=se.method,m.set(se.method,{type:se,handler:be}))),{dispose:a(()=>{Ue!==void 0?m.delete(Ue):h=void 0},"dispose")}},"onNotification"),onProgress:a((se,be,Ue)=>{if(g.has(be))throw new Error(`Progress handler for token ${be} already registered`);return g.set(be,Ue),{dispose:a(()=>{g.delete(be)},"dispose")}},"onProgress"),sendProgress:a((se,be,Ue)=>F.sendNotification(wSe.type,{token:be,value:Ue}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((se,...be)=>{Ne(),Fe();let Ue,Qe,ge;if(vf.string(se)){Ue=se;let qe=be[0],je=be[be.length-1],J=0,ae=Ki.ParameterStructures.auto;Ki.ParameterStructures.is(qe)&&(J=1,ae=qe);let Ce=be.length;UMt.CancellationToken.is(je)&&(Ce=Ce-1,ge=je);let Re=Ce-J;switch(Re){case 0:Qe=void 0;break;case 1:Qe=Pt(ae,be[J]);break;default:if(ae===Ki.ParameterStructures.byName)throw new Error(`Received ${Re} parameters for 'by Name' request parameter structure.`);Qe=be.slice(J,Ce).map($e=>tt($e));break}}else{let qe=be;Ue=se.method,Qe=Ht(se,qe);let je=se.numberOfParams;ge=UMt.CancellationToken.is(qe[je])?qe[je]:void 0}let Z=s++,ve;ge&&(ve=ge.onCancellationRequested(()=>{let qe=B.sender.sendCancellation(F,Z);return qe===void 0?(o.log(`Received no promise from cancellation strategy when cancelling id ${Z}`),Promise.resolve()):qe.catch(()=>{o.log(`Sending cancellation messages for id ${Z} failed`)})}));let Ge={jsonrpc:u,id:Z,method:Ue,params:Qe};return K(Ge),typeof B.sender.enableCancellation=="function"&&B.sender.enableCancellation(Ge),new Promise(async(qe,je)=>{let J=a(Re=>{qe(Re),B.sender.cleanup(Z),ve?.dispose()},"resolveWithCleanup"),ae=a(Re=>{je(Re),B.sender.cleanup(Z),ve?.dispose()},"rejectWithCleanup"),Ce={method:Ue,timerStart:Date.now(),resolve:J,reject:ae};try{await e.write(Ge),_.set(Z,Ce)}catch(Re){throw o.error("Sending request failed."),Ce.reject(new Ki.ResponseError(Ki.ErrorCodes.MessageWriteError,Re.message?Re.message:"Unknown reason")),Re}})},"sendRequest"),onRequest:a((se,be)=>{Ne();let Ue=null;return jMt.is(se)?(Ue=void 0,d=se):vf.string(se)?(Ue=null,be!==void 0&&(Ue=se,f.set(se,{handler:be,type:void 0}))):be!==void 0&&(Ue=se.method,f.set(se.method,{type:se,handler:be})),{dispose:a(()=>{Ue!==null&&(Ue!==void 0?f.delete(Ue):d=void 0)},"dispose")}},"onRequest"),hasPendingResponse:a(()=>_.size>0,"hasPendingResponse"),trace:a(async(se,be,Ue)=>{let Qe=!1,ge=m1.Text;Ue!==void 0&&(vf.boolean(Ue)?Qe=Ue:(Qe=Ue.sendNotification||!1,ge=Ue.traceFormat||m1.Text)),S=se,T=ge,S===Mc.Off?w=void 0:w=be,Qe&&!Y()&&!W()&&await F.sendNotification(HMt.type,{value:Mc.toString(se)})},"trace"),onError:x.event,onClose:k.event,onUnhandledNotification:D.event,onDispose:O.event,end:a(()=>{e.end()},"end"),dispose:a(()=>{if(W())return;R=vP.Disposed,O.fire(void 0);let se=new Ki.ResponseError(Ki.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let be of _.values())be.reject(se);_=new Map,v=new Map,E=new Set,y=new fZr.LinkedMap,vf.func(e.dispose)&&e.dispose(),vf.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Ne(),xe(),R=vP.Listening,t.listen(Le)},"listen"),inspect:a(()=>{(0,dZr.default)().console.log("inspect")},"inspect")};return F.onNotification(AQe.type,se=>{if(S===Mc.Off||!w)return;let be=S===Mc.Verbose||S===Mc.Compact;w.log(se.message,be?se.verbose:void 0)}),F.onNotification(wSe.type,se=>{let be=g.get(se.token);be?be(se.value):N.fire(se)}),F}a(P1o,"createMessageConnection");Uo.createMessageConnection=P1o});var bQe=I(Ft=>{"use strict";p();Object.defineProperty(Ft,"__esModule",{value:!0});Ft.ProgressType=Ft.ProgressToken=Ft.createMessageConnection=Ft.NullLogger=Ft.ConnectionOptions=Ft.ConnectionStrategy=Ft.AbstractMessageBuffer=Ft.WriteableStreamMessageWriter=Ft.AbstractMessageWriter=Ft.MessageWriter=Ft.ReadableStreamMessageReader=Ft.AbstractMessageReader=Ft.MessageReader=Ft.SharedArrayReceiverStrategy=Ft.SharedArraySenderStrategy=Ft.CancellationToken=Ft.CancellationTokenSource=Ft.Emitter=Ft.Event=Ft.Disposable=Ft.LRUCache=Ft.Touch=Ft.LinkedMap=Ft.ParameterStructures=Ft.NotificationType9=Ft.NotificationType8=Ft.NotificationType7=Ft.NotificationType6=Ft.NotificationType5=Ft.NotificationType4=Ft.NotificationType3=Ft.NotificationType2=Ft.NotificationType1=Ft.NotificationType0=Ft.NotificationType=Ft.ErrorCodes=Ft.ResponseError=Ft.RequestType9=Ft.RequestType8=Ft.RequestType7=Ft.RequestType6=Ft.RequestType5=Ft.RequestType4=Ft.RequestType3=Ft.RequestType2=Ft.RequestType1=Ft.RequestType0=Ft.RequestType=Ft.Message=Ft.RAL=void 0;Ft.MessageStrategy=Ft.CancellationStrategy=Ft.CancellationSenderStrategy=Ft.CancellationReceiverStrategy=Ft.ConnectionError=Ft.ConnectionErrors=Ft.LogTraceNotification=Ft.SetTraceNotification=Ft.TraceFormat=Ft.TraceValues=Ft.Trace=void 0;var Eu=AMt();Object.defineProperty(Ft,"Message",{enumerable:!0,get:a(function(){return Eu.Message},"get")});Object.defineProperty(Ft,"RequestType",{enumerable:!0,get:a(function(){return Eu.RequestType},"get")});Object.defineProperty(Ft,"RequestType0",{enumerable:!0,get:a(function(){return Eu.RequestType0},"get")});Object.defineProperty(Ft,"RequestType1",{enumerable:!0,get:a(function(){return Eu.RequestType1},"get")});Object.defineProperty(Ft,"RequestType2",{enumerable:!0,get:a(function(){return Eu.RequestType2},"get")});Object.defineProperty(Ft,"RequestType3",{enumerable:!0,get:a(function(){return Eu.RequestType3},"get")});Object.defineProperty(Ft,"RequestType4",{enumerable:!0,get:a(function(){return Eu.RequestType4},"get")});Object.defineProperty(Ft,"RequestType5",{enumerable:!0,get:a(function(){return Eu.RequestType5},"get")});Object.defineProperty(Ft,"RequestType6",{enumerable:!0,get:a(function(){return Eu.RequestType6},"get")});Object.defineProperty(Ft,"RequestType7",{enumerable:!0,get:a(function(){return Eu.RequestType7},"get")});Object.defineProperty(Ft,"RequestType8",{enumerable:!0,get:a(function(){return Eu.RequestType8},"get")});Object.defineProperty(Ft,"RequestType9",{enumerable:!0,get:a(function(){return Eu.RequestType9},"get")});Object.defineProperty(Ft,"ResponseError",{enumerable:!0,get:a(function(){return Eu.ResponseError},"get")});Object.defineProperty(Ft,"ErrorCodes",{enumerable:!0,get:a(function(){return Eu.ErrorCodes},"get")});Object.defineProperty(Ft,"NotificationType",{enumerable:!0,get:a(function(){return Eu.NotificationType},"get")});Object.defineProperty(Ft,"NotificationType0",{enumerable:!0,get:a(function(){return Eu.NotificationType0},"get")});Object.defineProperty(Ft,"NotificationType1",{enumerable:!0,get:a(function(){return Eu.NotificationType1},"get")});Object.defineProperty(Ft,"NotificationType2",{enumerable:!0,get:a(function(){return Eu.NotificationType2},"get")});Object.defineProperty(Ft,"NotificationType3",{enumerable:!0,get:a(function(){return Eu.NotificationType3},"get")});Object.defineProperty(Ft,"NotificationType4",{enumerable:!0,get:a(function(){return Eu.NotificationType4},"get")});Object.defineProperty(Ft,"NotificationType5",{enumerable:!0,get:a(function(){return Eu.NotificationType5},"get")});Object.defineProperty(Ft,"NotificationType6",{enumerable:!0,get:a(function(){return Eu.NotificationType6},"get")});Object.defineProperty(Ft,"NotificationType7",{enumerable:!0,get:a(function(){return Eu.NotificationType7},"get")});Object.defineProperty(Ft,"NotificationType8",{enumerable:!0,get:a(function(){return Eu.NotificationType8},"get")});Object.defineProperty(Ft,"NotificationType9",{enumerable:!0,get:a(function(){return Eu.NotificationType9},"get")});Object.defineProperty(Ft,"ParameterStructures",{enumerable:!0,get:a(function(){return Eu.ParameterStructures},"get")});var VMt=_Mt();Object.defineProperty(Ft,"LinkedMap",{enumerable:!0,get:a(function(){return VMt.LinkedMap},"get")});Object.defineProperty(Ft,"LRUCache",{enumerable:!0,get:a(function(){return VMt.LRUCache},"get")});Object.defineProperty(Ft,"Touch",{enumerable:!0,get:a(function(){return VMt.Touch},"get")});var D1o=eZr();Object.defineProperty(Ft,"Disposable",{enumerable:!0,get:a(function(){return D1o.Disposable},"get")});var gZr=Kse();Object.defineProperty(Ft,"Event",{enumerable:!0,get:a(function(){return gZr.Event},"get")});Object.defineProperty(Ft,"Emitter",{enumerable:!0,get:a(function(){return gZr.Emitter},"get")});var AZr=fQe();Object.defineProperty(Ft,"CancellationTokenSource",{enumerable:!0,get:a(function(){return AZr.CancellationTokenSource},"get")});Object.defineProperty(Ft,"CancellationToken",{enumerable:!0,get:a(function(){return AZr.CancellationToken},"get")});var yZr=rZr();Object.defineProperty(Ft,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return yZr.SharedArraySenderStrategy},"get")});Object.defineProperty(Ft,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return yZr.SharedArrayReceiverStrategy},"get")});var WMt=iZr();Object.defineProperty(Ft,"MessageReader",{enumerable:!0,get:a(function(){return WMt.MessageReader},"get")});Object.defineProperty(Ft,"AbstractMessageReader",{enumerable:!0,get:a(function(){return WMt.AbstractMessageReader},"get")});Object.defineProperty(Ft,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return WMt.ReadableStreamMessageReader},"get")});var zMt=lZr();Object.defineProperty(Ft,"MessageWriter",{enumerable:!0,get:a(function(){return zMt.MessageWriter},"get")});Object.defineProperty(Ft,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return zMt.AbstractMessageWriter},"get")});Object.defineProperty(Ft,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return zMt.WriteableStreamMessageWriter},"get")});var N1o=uZr();Object.defineProperty(Ft,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return N1o.AbstractMessageBuffer},"get")});var wA=mZr();Object.defineProperty(Ft,"ConnectionStrategy",{enumerable:!0,get:a(function(){return wA.ConnectionStrategy},"get")});Object.defineProperty(Ft,"ConnectionOptions",{enumerable:!0,get:a(function(){return wA.ConnectionOptions},"get")});Object.defineProperty(Ft,"NullLogger",{enumerable:!0,get:a(function(){return wA.NullLogger},"get")});Object.defineProperty(Ft,"createMessageConnection",{enumerable:!0,get:a(function(){return wA.createMessageConnection},"get")});Object.defineProperty(Ft,"ProgressToken",{enumerable:!0,get:a(function(){return wA.ProgressToken},"get")});Object.defineProperty(Ft,"ProgressType",{enumerable:!0,get:a(function(){return wA.ProgressType},"get")});Object.defineProperty(Ft,"Trace",{enumerable:!0,get:a(function(){return wA.Trace},"get")});Object.defineProperty(Ft,"TraceValues",{enumerable:!0,get:a(function(){return wA.TraceValues},"get")});Object.defineProperty(Ft,"TraceFormat",{enumerable:!0,get:a(function(){return wA.TraceFormat},"get")});Object.defineProperty(Ft,"SetTraceNotification",{enumerable:!0,get:a(function(){return wA.SetTraceNotification},"get")});Object.defineProperty(Ft,"LogTraceNotification",{enumerable:!0,get:a(function(){return wA.LogTraceNotification},"get")});Object.defineProperty(Ft,"ConnectionErrors",{enumerable:!0,get:a(function(){return wA.ConnectionErrors},"get")});Object.defineProperty(Ft,"ConnectionError",{enumerable:!0,get:a(function(){return wA.ConnectionError},"get")});Object.defineProperty(Ft,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return wA.CancellationReceiverStrategy},"get")});Object.defineProperty(Ft,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return wA.CancellationSenderStrategy},"get")});Object.defineProperty(Ft,"CancellationStrategy",{enumerable:!0,get:a(function(){return wA.CancellationStrategy},"get")});Object.defineProperty(Ft,"MessageStrategy",{enumerable:!0,get:a(function(){return wA.MessageStrategy},"get")});var M1o=d7();Ft.RAL=M1o.default});var vZr=I(ZMt=>{"use strict";p();Object.defineProperty(ZMt,"__esModule",{value:!0});var _Zr=require("util"),t3=bQe(),SQe=class t extends t3.AbstractMessageBuffer{static{a(this,"MessageBuffer")}constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new _Zr.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};SQe.emptyBuffer=Buffer.allocUnsafe(0);var YMt=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),t3.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),t3.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),t3.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),t3.Disposable.create(()=>this.stream.off("data",e))}},KMt=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),t3.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),t3.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),t3.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,o)=>{let s=a(c=>{c==null?n():o(c)},"callback");typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},EZr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new SQe(t),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:a((t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}},"encode")}),decoder:Object.freeze({name:"application/json",decode:a((t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new _Zr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new YMt(t),"asReadableStream"),asWritableStream:a(t=>new KMt(t),"asWritableStream")}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:a(()=>clearTimeout(n),"dispose")}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:a(()=>clearImmediate(r),"dispose")}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:a(()=>clearInterval(n),"dispose")}}})});function JMt(){return EZr}a(JMt,"RIL");(function(t){function e(){t3.RAL.install(EZr)}a(e,"install"),t.install=e})(JMt||(JMt={}));ZMt.default=JMt});var Lz=I(Na=>{"use strict";p();var O1o=Na&&Na.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L1o=Na&&Na.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&O1o(e,t,r)};Object.defineProperty(Na,"__esModule",{value:!0});Na.createMessageConnection=Na.createServerSocketTransport=Na.createClientSocketTransport=Na.createServerPipeTransport=Na.createClientPipeTransport=Na.generateRandomPipeName=Na.StreamMessageWriter=Na.StreamMessageReader=Na.SocketMessageWriter=Na.SocketMessageReader=Na.PortMessageWriter=Na.PortMessageReader=Na.IPCMessageWriter=Na.IPCMessageReader=void 0;var tae=vZr();tae.default.install();var CZr=require("path"),B1o=require("os"),F1o=require("crypto"),xQe=require("net"),g1=bQe();L1o(bQe(),Na);var XMt=class extends g1.AbstractMessageReader{static{a(this,"IPCMessageReader")}constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),g1.Disposable.create(()=>this.process.off("message",e))}};Na.IPCMessageReader=XMt;var eOt=class extends g1.AbstractMessageWriter{static{a(this,"IPCMessageWriter")}constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Na.IPCMessageWriter=eOt;var tOt=class extends g1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new g1.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};Na.PortMessageReader=tOt;var rOt=class extends g1.AbstractMessageWriter{static{a(this,"PortMessageWriter")}constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Na.PortMessageWriter=rOt;var Mz=class extends g1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,tae.default)().stream.asReadableStream(e),r)}};Na.SocketMessageReader=Mz;var Oz=class extends g1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,tae.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Na.SocketMessageWriter=Oz;var TQe=class extends g1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,tae.default)().stream.asReadableStream(e),r)}};Na.StreamMessageReader=TQe;var IQe=class extends g1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,tae.default)().stream.asWritableStream(e),r)}};Na.StreamMessageWriter=IQe;var bZr=process.env.XDG_RUNTIME_DIR,U1o=new Map([["linux",107],["darwin",103]]);function Q1o(){let t=(0,F1o.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;bZr?e=CZr.join(bZr,`vscode-ipc-${t}.sock`):e=CZr.join(B1o.tmpdir(),`vscode-${t}.sock`);let r=U1o.get(process.platform);return r!==void 0&&e.length>r&&(0,tae.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(Q1o,"generateRandomPipeName");Na.generateRandomPipeName=Q1o;function q1o(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,xQe.createServer)(l=>{c.close(),r([new Mz(l,e),new Oz(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(q1o,"createClientPipeTransport");Na.createClientPipeTransport=q1o;function j1o(t,e="utf-8"){let r=(0,xQe.createConnection)(t);return[new Mz(r,e),new Oz(r,e)]}a(j1o,"createServerPipeTransport");Na.createServerPipeTransport=j1o;function H1o(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,xQe.createServer)(l=>{c.close(),r([new Mz(l,e),new Oz(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(H1o,"createClientSocketTransport");Na.createClientSocketTransport=H1o;function G1o(t,e="utf-8"){let r=(0,xQe.createConnection)(t,"127.0.0.1");return[new Mz(r,e),new Oz(r,e)]}a(G1o,"createServerSocketTransport");Na.createServerSocketTransport=G1o;function $1o(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a($1o,"isReadableStream");function V1o(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(V1o,"isWritableStream");function W1o(t,e,r,n){r||(r=g1.NullLogger);let o=$1o(t)?new TQe(t):t,s=V1o(e)?new IQe(e):e;return g1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,g1.createMessageConnection)(o,s,r,n)}a(W1o,"createMessageConnection");Na.createMessageConnection=W1o});var nOt=I((P5l,SZr)=>{"use strict";p();SZr.exports=Lz()});var PSe=I((TZr,wQe)=>{p();(function(t){if(typeof wQe=="object"&&typeof wQe.exports=="object"){var e=t(require,TZr);e!==void 0&&(wQe.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(ce){function Pe(Me){return typeof Me=="string"}a(Pe,"is"),ce.is=Pe})(r||(e.DocumentUri=r={}));var n;(function(ce){function Pe(Me){return typeof Me=="string"}a(Pe,"is"),ce.is=Pe})(n||(e.URI=n={}));var o;(function(ce){ce.MIN_VALUE=-2147483648,ce.MAX_VALUE=2147483647;function Pe(Me){return typeof Me=="number"&&ce.MIN_VALUE<=Me&&Me<=ce.MAX_VALUE}a(Pe,"is"),ce.is=Pe})(o||(e.integer=o={}));var s;(function(ce){ce.MIN_VALUE=0,ce.MAX_VALUE=2147483647;function Pe(Me){return typeof Me=="number"&&ce.MIN_VALUE<=Me&&Me<=ce.MAX_VALUE}a(Pe,"is"),ce.is=Pe})(s||(e.uinteger=s={}));var c;(function(ce){function Pe(ye,oe){return ye===Number.MAX_VALUE&&(ye=s.MAX_VALUE),oe===Number.MAX_VALUE&&(oe=s.MAX_VALUE),{line:ye,character:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.uinteger(oe.line)&&We.uinteger(oe.character)}a(Me,"is"),ce.is=Me})(c||(e.Position=c={}));var l;(function(ce){function Pe(ye,oe,Ke,lt){if(We.uinteger(ye)&&We.uinteger(oe)&&We.uinteger(Ke)&&We.uinteger(lt))return{start:c.create(ye,oe),end:c.create(Ke,lt)};if(c.is(ye)&&c.is(oe))return{start:ye,end:oe};throw new Error("Range#create called with invalid arguments[".concat(ye,", ").concat(oe,", ").concat(Ke,", ").concat(lt,"]"))}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&c.is(oe.start)&&c.is(oe.end)}a(Me,"is"),ce.is=Me})(l||(e.Range=l={}));var u;(function(ce){function Pe(ye,oe){return{uri:ye,range:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&(We.string(oe.uri)||We.undefined(oe.uri))}a(Me,"is"),ce.is=Me})(u||(e.Location=u={}));var d;(function(ce){function Pe(ye,oe,Ke,lt){return{targetUri:ye,targetRange:oe,targetSelectionRange:Ke,originSelectionRange:lt}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.targetRange)&&We.string(oe.targetUri)&&l.is(oe.targetSelectionRange)&&(l.is(oe.originSelectionRange)||We.undefined(oe.originSelectionRange))}a(Me,"is"),ce.is=Me})(d||(e.LocationLink=d={}));var f;(function(ce){function Pe(ye,oe,Ke,lt){return{red:ye,green:oe,blue:Ke,alpha:lt}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.numberRange(oe.red,0,1)&&We.numberRange(oe.green,0,1)&&We.numberRange(oe.blue,0,1)&&We.numberRange(oe.alpha,0,1)}a(Me,"is"),ce.is=Me})(f||(e.Color=f={}));var h;(function(ce){function Pe(ye,oe){return{range:ye,color:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&f.is(oe.color)}a(Me,"is"),ce.is=Me})(h||(e.ColorInformation=h={}));var m;(function(ce){function Pe(ye,oe,Ke){return{label:ye,textEdit:oe,additionalTextEdits:Ke}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.string(oe.label)&&(We.undefined(oe.textEdit)||w.is(oe))&&(We.undefined(oe.additionalTextEdits)||We.typedArray(oe.additionalTextEdits,w.is))}a(Me,"is"),ce.is=Me})(m||(e.ColorPresentation=m={}));var g;(function(ce){ce.Comment="comment",ce.Imports="imports",ce.Region="region"})(g||(e.FoldingRangeKind=g={}));var A;(function(ce){function Pe(ye,oe,Ke,lt,Gt,Er){var dr={startLine:ye,endLine:oe};return We.defined(Ke)&&(dr.startCharacter=Ke),We.defined(lt)&&(dr.endCharacter=lt),We.defined(Gt)&&(dr.kind=Gt),We.defined(Er)&&(dr.collapsedText=Er),dr}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.uinteger(oe.startLine)&&We.uinteger(oe.startLine)&&(We.undefined(oe.startCharacter)||We.uinteger(oe.startCharacter))&&(We.undefined(oe.endCharacter)||We.uinteger(oe.endCharacter))&&(We.undefined(oe.kind)||We.string(oe.kind))}a(Me,"is"),ce.is=Me})(A||(e.FoldingRange=A={}));var y;(function(ce){function Pe(ye,oe){return{location:ye,message:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&u.is(oe.location)&&We.string(oe.message)}a(Me,"is"),ce.is=Me})(y||(e.DiagnosticRelatedInformation=y={}));var _;(function(ce){ce.Error=1,ce.Warning=2,ce.Information=3,ce.Hint=4})(_||(e.DiagnosticSeverity=_={}));var E;(function(ce){ce.Unnecessary=1,ce.Deprecated=2})(E||(e.DiagnosticTag=E={}));var v;(function(ce){function Pe(Me){var ye=Me;return We.objectLiteral(ye)&&We.string(ye.href)}a(Pe,"is"),ce.is=Pe})(v||(e.CodeDescription=v={}));var S;(function(ce){function Pe(ye,oe,Ke,lt,Gt,Er){var dr={range:ye,message:oe};return We.defined(Ke)&&(dr.severity=Ke),We.defined(lt)&&(dr.code=lt),We.defined(Gt)&&(dr.source=Gt),We.defined(Er)&&(dr.relatedInformation=Er),dr}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe,Ke=ye;return We.defined(Ke)&&l.is(Ke.range)&&We.string(Ke.message)&&(We.number(Ke.severity)||We.undefined(Ke.severity))&&(We.integer(Ke.code)||We.string(Ke.code)||We.undefined(Ke.code))&&(We.undefined(Ke.codeDescription)||We.string((oe=Ke.codeDescription)===null||oe===void 0?void 0:oe.href))&&(We.string(Ke.source)||We.undefined(Ke.source))&&(We.undefined(Ke.relatedInformation)||We.typedArray(Ke.relatedInformation,y.is))}a(Me,"is"),ce.is=Me})(S||(e.Diagnostic=S={}));var T;(function(ce){function Pe(ye,oe){for(var Ke=[],lt=2;lt0&&(Gt.arguments=Ke),Gt}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.title)&&We.string(oe.command)}a(Me,"is"),ce.is=Me})(T||(e.Command=T={}));var w;(function(ce){function Pe(Ke,lt){return{range:Ke,newText:lt}}a(Pe,"replace"),ce.replace=Pe;function Me(Ke,lt){return{range:{start:Ke,end:Ke},newText:lt}}a(Me,"insert"),ce.insert=Me;function ye(Ke){return{range:Ke,newText:""}}a(ye,"del"),ce.del=ye;function oe(Ke){var lt=Ke;return We.objectLiteral(lt)&&We.string(lt.newText)&&l.is(lt.range)}a(oe,"is"),ce.is=oe})(w||(e.TextEdit=w={}));var R;(function(ce){function Pe(ye,oe,Ke){var lt={label:ye};return oe!==void 0&&(lt.needsConfirmation=oe),Ke!==void 0&&(lt.description=Ke),lt}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.string(oe.label)&&(We.boolean(oe.needsConfirmation)||oe.needsConfirmation===void 0)&&(We.string(oe.description)||oe.description===void 0)}a(Me,"is"),ce.is=Me})(R||(e.ChangeAnnotation=R={}));var x;(function(ce){function Pe(Me){var ye=Me;return We.string(ye)}a(Pe,"is"),ce.is=Pe})(x||(e.ChangeAnnotationIdentifier=x={}));var k;(function(ce){function Pe(Ke,lt,Gt){return{range:Ke,newText:lt,annotationId:Gt}}a(Pe,"replace"),ce.replace=Pe;function Me(Ke,lt,Gt){return{range:{start:Ke,end:Ke},newText:lt,annotationId:Gt}}a(Me,"insert"),ce.insert=Me;function ye(Ke,lt){return{range:Ke,newText:"",annotationId:lt}}a(ye,"del"),ce.del=ye;function oe(Ke){var lt=Ke;return w.is(lt)&&(R.is(lt.annotationId)||x.is(lt.annotationId))}a(oe,"is"),ce.is=oe})(k||(e.AnnotatedTextEdit=k={}));var D;(function(ce){function Pe(ye,oe){return{textDocument:ye,edits:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&Y.is(oe.textDocument)&&Array.isArray(oe.edits)}a(Me,"is"),ce.is=Me})(D||(e.TextDocumentEdit=D={}));var N;(function(ce){function Pe(ye,oe,Ke){var lt={kind:"create",uri:ye};return oe!==void 0&&(oe.overwrite!==void 0||oe.ignoreIfExists!==void 0)&&(lt.options=oe),Ke!==void 0&&(lt.annotationId=Ke),lt}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return oe&&oe.kind==="create"&&We.string(oe.uri)&&(oe.options===void 0||(oe.options.overwrite===void 0||We.boolean(oe.options.overwrite))&&(oe.options.ignoreIfExists===void 0||We.boolean(oe.options.ignoreIfExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(N||(e.CreateFile=N={}));var O;(function(ce){function Pe(ye,oe,Ke,lt){var Gt={kind:"rename",oldUri:ye,newUri:oe};return Ke!==void 0&&(Ke.overwrite!==void 0||Ke.ignoreIfExists!==void 0)&&(Gt.options=Ke),lt!==void 0&&(Gt.annotationId=lt),Gt}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return oe&&oe.kind==="rename"&&We.string(oe.oldUri)&&We.string(oe.newUri)&&(oe.options===void 0||(oe.options.overwrite===void 0||We.boolean(oe.options.overwrite))&&(oe.options.ignoreIfExists===void 0||We.boolean(oe.options.ignoreIfExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(O||(e.RenameFile=O={}));var B;(function(ce){function Pe(ye,oe,Ke){var lt={kind:"delete",uri:ye};return oe!==void 0&&(oe.recursive!==void 0||oe.ignoreIfNotExists!==void 0)&&(lt.options=oe),Ke!==void 0&&(lt.annotationId=Ke),lt}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return oe&&oe.kind==="delete"&&We.string(oe.uri)&&(oe.options===void 0||(oe.options.recursive===void 0||We.boolean(oe.options.recursive))&&(oe.options.ignoreIfNotExists===void 0||We.boolean(oe.options.ignoreIfNotExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(B||(e.DeleteFile=B={}));var q;(function(ce){function Pe(Me){var ye=Me;return ye&&(ye.changes!==void 0||ye.documentChanges!==void 0)&&(ye.documentChanges===void 0||ye.documentChanges.every(function(oe){return We.string(oe.kind)?N.is(oe)||O.is(oe)||B.is(oe):D.is(oe)}))}a(Pe,"is"),ce.is=Pe})(q||(e.WorkspaceEdit=q={}));var M=(function(){function ce(Pe,Me){this.edits=Pe,this.changeAnnotations=Me}return a(ce,"TextEditChangeImpl"),ce.prototype.insert=function(Pe,Me,ye){var oe,Ke;if(ye===void 0?oe=w.insert(Pe,Me):x.is(ye)?(Ke=ye,oe=k.insert(Pe,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),Ke=this.changeAnnotations.manage(ye),oe=k.insert(Pe,Me,Ke)),this.edits.push(oe),Ke!==void 0)return Ke},ce.prototype.replace=function(Pe,Me,ye){var oe,Ke;if(ye===void 0?oe=w.replace(Pe,Me):x.is(ye)?(Ke=ye,oe=k.replace(Pe,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),Ke=this.changeAnnotations.manage(ye),oe=k.replace(Pe,Me,Ke)),this.edits.push(oe),Ke!==void 0)return Ke},ce.prototype.delete=function(Pe,Me){var ye,oe;if(Me===void 0?ye=w.del(Pe):x.is(Me)?(oe=Me,ye=k.del(Pe,Me)):(this.assertChangeAnnotations(this.changeAnnotations),oe=this.changeAnnotations.manage(Me),ye=k.del(Pe,oe)),this.edits.push(ye),oe!==void 0)return oe},ce.prototype.add=function(Pe){this.edits.push(Pe)},ce.prototype.all=function(){return this.edits},ce.prototype.clear=function(){this.edits.splice(0,this.edits.length)},ce.prototype.assertChangeAnnotations=function(Pe){if(Pe===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},ce})(),L=(function(){function ce(Pe){this._annotations=Pe===void 0?Object.create(null):Pe,this._counter=0,this._size=0}return a(ce,"ChangeAnnotations"),ce.prototype.all=function(){return this._annotations},Object.defineProperty(ce.prototype,"size",{get:a(function(){return this._size},"get"),enumerable:!1,configurable:!0}),ce.prototype.manage=function(Pe,Me){var ye;if(x.is(Pe)?ye=Pe:(ye=this.nextId(),Me=Pe),this._annotations[ye]!==void 0)throw new Error("Id ".concat(ye," is already in use."));if(Me===void 0)throw new Error("No annotation provided for id ".concat(ye));return this._annotations[ye]=Me,this._size++,ye},ce.prototype.nextId=function(){return this._counter++,this._counter.toString()},ce})(),U=(function(){function ce(Pe){var Me=this;this._textEditChanges=Object.create(null),Pe!==void 0?(this._workspaceEdit=Pe,Pe.documentChanges?(this._changeAnnotations=new L(Pe.changeAnnotations),Pe.changeAnnotations=this._changeAnnotations.all(),Pe.documentChanges.forEach(function(ye){if(D.is(ye)){var oe=new M(ye.edits,Me._changeAnnotations);Me._textEditChanges[ye.textDocument.uri]=oe}})):Pe.changes&&Object.keys(Pe.changes).forEach(function(ye){var oe=new M(Pe.changes[ye]);Me._textEditChanges[ye]=oe})):this._workspaceEdit={}}return a(ce,"WorkspaceChange"),Object.defineProperty(ce.prototype,"edit",{get:a(function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},"get"),enumerable:!1,configurable:!0}),ce.prototype.getTextEditChange=function(Pe){if(Y.is(Pe)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Me={uri:Pe.uri,version:Pe.version},ye=this._textEditChanges[Me.uri];if(!ye){var oe=[],Ke={textDocument:Me,edits:oe};this._workspaceEdit.documentChanges.push(Ke),ye=new M(oe,this._changeAnnotations),this._textEditChanges[Me.uri]=ye}return ye}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var ye=this._textEditChanges[Pe];if(!ye){var oe=[];this._workspaceEdit.changes[Pe]=oe,ye=new M(oe),this._textEditChanges[Pe]=ye}return ye}},ce.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new L,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},ce.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},ce.prototype.createFile=function(Pe,Me,ye){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var oe;R.is(Me)||x.is(Me)?oe=Me:ye=Me;var Ke,lt;if(oe===void 0?Ke=N.create(Pe,ye):(lt=x.is(oe)?oe:this._changeAnnotations.manage(oe),Ke=N.create(Pe,ye,lt)),this._workspaceEdit.documentChanges.push(Ke),lt!==void 0)return lt},ce.prototype.renameFile=function(Pe,Me,ye,oe){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Ke;R.is(ye)||x.is(ye)?Ke=ye:oe=ye;var lt,Gt;if(Ke===void 0?lt=O.create(Pe,Me,oe):(Gt=x.is(Ke)?Ke:this._changeAnnotations.manage(Ke),lt=O.create(Pe,Me,oe,Gt)),this._workspaceEdit.documentChanges.push(lt),Gt!==void 0)return Gt},ce.prototype.deleteFile=function(Pe,Me,ye){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var oe;R.is(Me)||x.is(Me)?oe=Me:ye=Me;var Ke,lt;if(oe===void 0?Ke=B.create(Pe,ye):(lt=x.is(oe)?oe:this._changeAnnotations.manage(oe),Ke=B.create(Pe,ye,lt)),this._workspaceEdit.documentChanges.push(Ke),lt!==void 0)return lt},ce})();e.WorkspaceChange=U;var j;(function(ce){function Pe(ye){return{uri:ye}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)}a(Me,"is"),ce.is=Me})(j||(e.TextDocumentIdentifier=j={}));var Q;(function(ce){function Pe(ye,oe){return{uri:ye,version:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.integer(oe.version)}a(Me,"is"),ce.is=Me})(Q||(e.VersionedTextDocumentIdentifier=Q={}));var Y;(function(ce){function Pe(ye,oe){return{uri:ye,version:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&(oe.version===null||We.integer(oe.version))}a(Me,"is"),ce.is=Me})(Y||(e.OptionalVersionedTextDocumentIdentifier=Y={}));var W;(function(ce){function Pe(ye,oe,Ke,lt){return{uri:ye,languageId:oe,version:Ke,text:lt}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.string(oe.languageId)&&We.integer(oe.version)&&We.string(oe.text)}a(Me,"is"),ce.is=Me})(W||(e.TextDocumentItem=W={}));var V;(function(ce){ce.PlainText="plaintext",ce.Markdown="markdown";function Pe(Me){var ye=Me;return ye===ce.PlainText||ye===ce.Markdown}a(Pe,"is"),ce.is=Pe})(V||(e.MarkupKind=V={}));var z;(function(ce){function Pe(Me){var ye=Me;return We.objectLiteral(Me)&&V.is(ye.kind)&&We.string(ye.value)}a(Pe,"is"),ce.is=Pe})(z||(e.MarkupContent=z={}));var ie;(function(ce){ce.Text=1,ce.Method=2,ce.Function=3,ce.Constructor=4,ce.Field=5,ce.Variable=6,ce.Class=7,ce.Interface=8,ce.Module=9,ce.Property=10,ce.Unit=11,ce.Value=12,ce.Enum=13,ce.Keyword=14,ce.Snippet=15,ce.Color=16,ce.File=17,ce.Reference=18,ce.Folder=19,ce.EnumMember=20,ce.Constant=21,ce.Struct=22,ce.Event=23,ce.Operator=24,ce.TypeParameter=25})(ie||(e.CompletionItemKind=ie={}));var H;(function(ce){ce.PlainText=1,ce.Snippet=2})(H||(e.InsertTextFormat=H={}));var re;(function(ce){ce.Deprecated=1})(re||(e.CompletionItemTag=re={}));var le;(function(ce){function Pe(ye,oe,Ke){return{newText:ye,insert:oe,replace:Ke}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return oe&&We.string(oe.newText)&&l.is(oe.insert)&&l.is(oe.replace)}a(Me,"is"),ce.is=Me})(le||(e.InsertReplaceEdit=le={}));var Le;(function(ce){ce.asIs=1,ce.adjustIndentation=2})(Le||(e.InsertTextMode=Le={}));var me;(function(ce){function Pe(Me){var ye=Me;return ye&&(We.string(ye.detail)||ye.detail===void 0)&&(We.string(ye.description)||ye.description===void 0)}a(Pe,"is"),ce.is=Pe})(me||(e.CompletionItemLabelDetails=me={}));var Oe;(function(ce){function Pe(Me){return{label:Me}}a(Pe,"create"),ce.create=Pe})(Oe||(e.CompletionItem=Oe={}));var Te;(function(ce){function Pe(Me,ye){return{items:Me||[],isIncomplete:!!ye}}a(Pe,"create"),ce.create=Pe})(Te||(e.CompletionList=Te={}));var te;(function(ce){function Pe(ye){return ye.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(Pe,"fromPlainText"),ce.fromPlainText=Pe;function Me(ye){var oe=ye;return We.string(oe)||We.objectLiteral(oe)&&We.string(oe.language)&&We.string(oe.value)}a(Me,"is"),ce.is=Me})(te||(e.MarkedString=te={}));var ee;(function(ce){function Pe(Me){var ye=Me;return!!ye&&We.objectLiteral(ye)&&(z.is(ye.contents)||te.is(ye.contents)||We.typedArray(ye.contents,te.is))&&(Me.range===void 0||l.is(Me.range))}a(Pe,"is"),ce.is=Pe})(ee||(e.Hover=ee={}));var K;(function(ce){function Pe(Me,ye){return ye?{label:Me,documentation:ye}:{label:Me}}a(Pe,"create"),ce.create=Pe})(K||(e.ParameterInformation=K={}));var he;(function(ce){function Pe(Me,ye){for(var oe=[],Ke=2;Ke{Ne();let Ue,Qe;if(vf.string(se)){Ue=se;let Z=be[0],ve=0,Ge=Ki.ParameterStructures.auto;Ki.ParameterStructures.is(Z)&&(ve=1,Ge=Z);let qe=be.length,je=qe-ve;switch(je){case 0:Qe=void 0;break;case 1:Qe=Pt(Ge,be[ve]);break;default:if(Ge===Ki.ParameterStructures.byName)throw new Error(`Received ${je} parameters for 'by Name' notification parameter structure.`);Qe=be.slice(ve,qe).map(J=>tt(J));break}}else{let Z=be;Ue=se.method,Qe=Ht(se,Z)}let ge={jsonrpc:u,method:Ue,params:Qe};return he(ge),e.write(ge).catch(Z=>{throw o.error("Sending notification failed."),Z})},"sendNotification"),onNotification:a((se,be)=>{Ne();let Ue;return vf.func(se)?h=se:be&&(vf.string(se)?(Ue=se,m.set(se,{type:void 0,handler:be})):(Ue=se.method,m.set(se.method,{type:se,handler:be}))),{dispose:a(()=>{Ue!==void 0?m.delete(Ue):h=void 0},"dispose")}},"onNotification"),onProgress:a((se,be,Ue)=>{if(g.has(be))throw new Error(`Progress handler for token ${be} already registered`);return g.set(be,Ue),{dispose:a(()=>{g.delete(be)},"dispose")}},"onProgress"),sendProgress:a((se,be,Ue)=>F.sendNotification(wSe.type,{token:be,value:Ue}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((se,...be)=>{Ne(),Fe();let Ue,Qe,ge;if(vf.string(se)){Ue=se;let qe=be[0],je=be[be.length-1],J=0,ae=Ki.ParameterStructures.auto;Ki.ParameterStructures.is(qe)&&(J=1,ae=qe);let Ce=be.length;QMt.CancellationToken.is(je)&&(Ce=Ce-1,ge=je);let Re=Ce-J;switch(Re){case 0:Qe=void 0;break;case 1:Qe=Pt(ae,be[J]);break;default:if(ae===Ki.ParameterStructures.byName)throw new Error(`Received ${Re} parameters for 'by Name' request parameter structure.`);Qe=be.slice(J,Ce).map($e=>tt($e));break}}else{let qe=be;Ue=se.method,Qe=Ht(se,qe);let je=se.numberOfParams;ge=QMt.CancellationToken.is(qe[je])?qe[je]:void 0}let Z=s++,ve;ge&&(ve=ge.onCancellationRequested(()=>{let qe=B.sender.sendCancellation(F,Z);return qe===void 0?(o.log(`Received no promise from cancellation strategy when cancelling id ${Z}`),Promise.resolve()):qe.catch(()=>{o.log(`Sending cancellation messages for id ${Z} failed`)})}));let Ge={jsonrpc:u,id:Z,method:Ue,params:Qe};return K(Ge),typeof B.sender.enableCancellation=="function"&&B.sender.enableCancellation(Ge),new Promise(async(qe,je)=>{let J=a(Re=>{qe(Re),B.sender.cleanup(Z),ve?.dispose()},"resolveWithCleanup"),ae=a(Re=>{je(Re),B.sender.cleanup(Z),ve?.dispose()},"rejectWithCleanup"),Ce={method:Ue,timerStart:Date.now(),resolve:J,reject:ae};try{await e.write(Ge),_.set(Z,Ce)}catch(Re){throw o.error("Sending request failed."),Ce.reject(new Ki.ResponseError(Ki.ErrorCodes.MessageWriteError,Re.message?Re.message:"Unknown reason")),Re}})},"sendRequest"),onRequest:a((se,be)=>{Ne();let Ue=null;return HMt.is(se)?(Ue=void 0,d=se):vf.string(se)?(Ue=null,be!==void 0&&(Ue=se,f.set(se,{handler:be,type:void 0}))):be!==void 0&&(Ue=se.method,f.set(se.method,{type:se,handler:be})),{dispose:a(()=>{Ue!==null&&(Ue!==void 0?f.delete(Ue):d=void 0)},"dispose")}},"onRequest"),hasPendingResponse:a(()=>_.size>0,"hasPendingResponse"),trace:a(async(se,be,Ue)=>{let Qe=!1,ge=m1.Text;Ue!==void 0&&(vf.boolean(Ue)?Qe=Ue:(Qe=Ue.sendNotification||!1,ge=Ue.traceFormat||m1.Text)),S=se,T=ge,S===Mc.Off?w=void 0:w=be,Qe&&!Y()&&!W()&&await F.sendNotification(GMt.type,{value:Mc.toString(se)})},"trace"),onError:x.event,onClose:k.event,onUnhandledNotification:D.event,onDispose:O.event,end:a(()=>{e.end()},"end"),dispose:a(()=>{if(W())return;R=vP.Disposed,O.fire(void 0);let se=new Ki.ResponseError(Ki.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let be of _.values())be.reject(se);_=new Map,v=new Map,E=new Set,y=new pZr.LinkedMap,vf.func(e.dispose)&&e.dispose(),vf.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Ne(),xe(),R=vP.Listening,t.listen(Le)},"listen"),inspect:a(()=>{(0,fZr.default)().console.log("inspect")},"inspect")};return F.onNotification(AQe.type,se=>{if(S===Mc.Off||!w)return;let be=S===Mc.Verbose||S===Mc.Compact;w.log(se.message,be?se.verbose:void 0)}),F.onNotification(wSe.type,se=>{let be=g.get(se.token);be?be(se.value):N.fire(se)}),F}a(N1o,"createMessageConnection");Uo.createMessageConnection=N1o});var bQe=I(Ft=>{"use strict";p();Object.defineProperty(Ft,"__esModule",{value:!0});Ft.ProgressType=Ft.ProgressToken=Ft.createMessageConnection=Ft.NullLogger=Ft.ConnectionOptions=Ft.ConnectionStrategy=Ft.AbstractMessageBuffer=Ft.WriteableStreamMessageWriter=Ft.AbstractMessageWriter=Ft.MessageWriter=Ft.ReadableStreamMessageReader=Ft.AbstractMessageReader=Ft.MessageReader=Ft.SharedArrayReceiverStrategy=Ft.SharedArraySenderStrategy=Ft.CancellationToken=Ft.CancellationTokenSource=Ft.Emitter=Ft.Event=Ft.Disposable=Ft.LRUCache=Ft.Touch=Ft.LinkedMap=Ft.ParameterStructures=Ft.NotificationType9=Ft.NotificationType8=Ft.NotificationType7=Ft.NotificationType6=Ft.NotificationType5=Ft.NotificationType4=Ft.NotificationType3=Ft.NotificationType2=Ft.NotificationType1=Ft.NotificationType0=Ft.NotificationType=Ft.ErrorCodes=Ft.ResponseError=Ft.RequestType9=Ft.RequestType8=Ft.RequestType7=Ft.RequestType6=Ft.RequestType5=Ft.RequestType4=Ft.RequestType3=Ft.RequestType2=Ft.RequestType1=Ft.RequestType0=Ft.RequestType=Ft.Message=Ft.RAL=void 0;Ft.MessageStrategy=Ft.CancellationStrategy=Ft.CancellationSenderStrategy=Ft.CancellationReceiverStrategy=Ft.ConnectionError=Ft.ConnectionErrors=Ft.LogTraceNotification=Ft.SetTraceNotification=Ft.TraceFormat=Ft.TraceValues=Ft.Trace=void 0;var Eu=yMt();Object.defineProperty(Ft,"Message",{enumerable:!0,get:a(function(){return Eu.Message},"get")});Object.defineProperty(Ft,"RequestType",{enumerable:!0,get:a(function(){return Eu.RequestType},"get")});Object.defineProperty(Ft,"RequestType0",{enumerable:!0,get:a(function(){return Eu.RequestType0},"get")});Object.defineProperty(Ft,"RequestType1",{enumerable:!0,get:a(function(){return Eu.RequestType1},"get")});Object.defineProperty(Ft,"RequestType2",{enumerable:!0,get:a(function(){return Eu.RequestType2},"get")});Object.defineProperty(Ft,"RequestType3",{enumerable:!0,get:a(function(){return Eu.RequestType3},"get")});Object.defineProperty(Ft,"RequestType4",{enumerable:!0,get:a(function(){return Eu.RequestType4},"get")});Object.defineProperty(Ft,"RequestType5",{enumerable:!0,get:a(function(){return Eu.RequestType5},"get")});Object.defineProperty(Ft,"RequestType6",{enumerable:!0,get:a(function(){return Eu.RequestType6},"get")});Object.defineProperty(Ft,"RequestType7",{enumerable:!0,get:a(function(){return Eu.RequestType7},"get")});Object.defineProperty(Ft,"RequestType8",{enumerable:!0,get:a(function(){return Eu.RequestType8},"get")});Object.defineProperty(Ft,"RequestType9",{enumerable:!0,get:a(function(){return Eu.RequestType9},"get")});Object.defineProperty(Ft,"ResponseError",{enumerable:!0,get:a(function(){return Eu.ResponseError},"get")});Object.defineProperty(Ft,"ErrorCodes",{enumerable:!0,get:a(function(){return Eu.ErrorCodes},"get")});Object.defineProperty(Ft,"NotificationType",{enumerable:!0,get:a(function(){return Eu.NotificationType},"get")});Object.defineProperty(Ft,"NotificationType0",{enumerable:!0,get:a(function(){return Eu.NotificationType0},"get")});Object.defineProperty(Ft,"NotificationType1",{enumerable:!0,get:a(function(){return Eu.NotificationType1},"get")});Object.defineProperty(Ft,"NotificationType2",{enumerable:!0,get:a(function(){return Eu.NotificationType2},"get")});Object.defineProperty(Ft,"NotificationType3",{enumerable:!0,get:a(function(){return Eu.NotificationType3},"get")});Object.defineProperty(Ft,"NotificationType4",{enumerable:!0,get:a(function(){return Eu.NotificationType4},"get")});Object.defineProperty(Ft,"NotificationType5",{enumerable:!0,get:a(function(){return Eu.NotificationType5},"get")});Object.defineProperty(Ft,"NotificationType6",{enumerable:!0,get:a(function(){return Eu.NotificationType6},"get")});Object.defineProperty(Ft,"NotificationType7",{enumerable:!0,get:a(function(){return Eu.NotificationType7},"get")});Object.defineProperty(Ft,"NotificationType8",{enumerable:!0,get:a(function(){return Eu.NotificationType8},"get")});Object.defineProperty(Ft,"NotificationType9",{enumerable:!0,get:a(function(){return Eu.NotificationType9},"get")});Object.defineProperty(Ft,"ParameterStructures",{enumerable:!0,get:a(function(){return Eu.ParameterStructures},"get")});var WMt=EMt();Object.defineProperty(Ft,"LinkedMap",{enumerable:!0,get:a(function(){return WMt.LinkedMap},"get")});Object.defineProperty(Ft,"LRUCache",{enumerable:!0,get:a(function(){return WMt.LRUCache},"get")});Object.defineProperty(Ft,"Touch",{enumerable:!0,get:a(function(){return WMt.Touch},"get")});var M1o=tZr();Object.defineProperty(Ft,"Disposable",{enumerable:!0,get:a(function(){return M1o.Disposable},"get")});var AZr=Jse();Object.defineProperty(Ft,"Event",{enumerable:!0,get:a(function(){return AZr.Event},"get")});Object.defineProperty(Ft,"Emitter",{enumerable:!0,get:a(function(){return AZr.Emitter},"get")});var yZr=fQe();Object.defineProperty(Ft,"CancellationTokenSource",{enumerable:!0,get:a(function(){return yZr.CancellationTokenSource},"get")});Object.defineProperty(Ft,"CancellationToken",{enumerable:!0,get:a(function(){return yZr.CancellationToken},"get")});var _Zr=nZr();Object.defineProperty(Ft,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return _Zr.SharedArraySenderStrategy},"get")});Object.defineProperty(Ft,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return _Zr.SharedArrayReceiverStrategy},"get")});var zMt=oZr();Object.defineProperty(Ft,"MessageReader",{enumerable:!0,get:a(function(){return zMt.MessageReader},"get")});Object.defineProperty(Ft,"AbstractMessageReader",{enumerable:!0,get:a(function(){return zMt.AbstractMessageReader},"get")});Object.defineProperty(Ft,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return zMt.ReadableStreamMessageReader},"get")});var YMt=uZr();Object.defineProperty(Ft,"MessageWriter",{enumerable:!0,get:a(function(){return YMt.MessageWriter},"get")});Object.defineProperty(Ft,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return YMt.AbstractMessageWriter},"get")});Object.defineProperty(Ft,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return YMt.WriteableStreamMessageWriter},"get")});var O1o=dZr();Object.defineProperty(Ft,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return O1o.AbstractMessageBuffer},"get")});var wA=gZr();Object.defineProperty(Ft,"ConnectionStrategy",{enumerable:!0,get:a(function(){return wA.ConnectionStrategy},"get")});Object.defineProperty(Ft,"ConnectionOptions",{enumerable:!0,get:a(function(){return wA.ConnectionOptions},"get")});Object.defineProperty(Ft,"NullLogger",{enumerable:!0,get:a(function(){return wA.NullLogger},"get")});Object.defineProperty(Ft,"createMessageConnection",{enumerable:!0,get:a(function(){return wA.createMessageConnection},"get")});Object.defineProperty(Ft,"ProgressToken",{enumerable:!0,get:a(function(){return wA.ProgressToken},"get")});Object.defineProperty(Ft,"ProgressType",{enumerable:!0,get:a(function(){return wA.ProgressType},"get")});Object.defineProperty(Ft,"Trace",{enumerable:!0,get:a(function(){return wA.Trace},"get")});Object.defineProperty(Ft,"TraceValues",{enumerable:!0,get:a(function(){return wA.TraceValues},"get")});Object.defineProperty(Ft,"TraceFormat",{enumerable:!0,get:a(function(){return wA.TraceFormat},"get")});Object.defineProperty(Ft,"SetTraceNotification",{enumerable:!0,get:a(function(){return wA.SetTraceNotification},"get")});Object.defineProperty(Ft,"LogTraceNotification",{enumerable:!0,get:a(function(){return wA.LogTraceNotification},"get")});Object.defineProperty(Ft,"ConnectionErrors",{enumerable:!0,get:a(function(){return wA.ConnectionErrors},"get")});Object.defineProperty(Ft,"ConnectionError",{enumerable:!0,get:a(function(){return wA.ConnectionError},"get")});Object.defineProperty(Ft,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return wA.CancellationReceiverStrategy},"get")});Object.defineProperty(Ft,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return wA.CancellationSenderStrategy},"get")});Object.defineProperty(Ft,"CancellationStrategy",{enumerable:!0,get:a(function(){return wA.CancellationStrategy},"get")});Object.defineProperty(Ft,"MessageStrategy",{enumerable:!0,get:a(function(){return wA.MessageStrategy},"get")});var L1o=d7();Ft.RAL=L1o.default});var CZr=I(XMt=>{"use strict";p();Object.defineProperty(XMt,"__esModule",{value:!0});var EZr=require("util"),t3=bQe(),SQe=class t extends t3.AbstractMessageBuffer{static{a(this,"MessageBuffer")}constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new EZr.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};SQe.emptyBuffer=Buffer.allocUnsafe(0);var KMt=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),t3.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),t3.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),t3.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),t3.Disposable.create(()=>this.stream.off("data",e))}},JMt=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),t3.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),t3.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),t3.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,o)=>{let s=a(c=>{c==null?n():o(c)},"callback");typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},vZr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new SQe(t),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:a((t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}},"encode")}),decoder:Object.freeze({name:"application/json",decode:a((t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new EZr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new KMt(t),"asReadableStream"),asWritableStream:a(t=>new JMt(t),"asWritableStream")}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:a(()=>clearTimeout(n),"dispose")}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:a(()=>clearImmediate(r),"dispose")}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:a(()=>clearInterval(n),"dispose")}}})});function ZMt(){return vZr}a(ZMt,"RIL");(function(t){function e(){t3.RAL.install(vZr)}a(e,"install"),t.install=e})(ZMt||(ZMt={}));XMt.default=ZMt});var Bz=I(Na=>{"use strict";p();var B1o=Na&&Na.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F1o=Na&&Na.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&B1o(e,t,r)};Object.defineProperty(Na,"__esModule",{value:!0});Na.createMessageConnection=Na.createServerSocketTransport=Na.createClientSocketTransport=Na.createServerPipeTransport=Na.createClientPipeTransport=Na.generateRandomPipeName=Na.StreamMessageWriter=Na.StreamMessageReader=Na.SocketMessageWriter=Na.SocketMessageReader=Na.PortMessageWriter=Na.PortMessageReader=Na.IPCMessageWriter=Na.IPCMessageReader=void 0;var rae=CZr();rae.default.install();var bZr=require("path"),U1o=require("os"),Q1o=require("crypto"),xQe=require("net"),g1=bQe();F1o(bQe(),Na);var eOt=class extends g1.AbstractMessageReader{static{a(this,"IPCMessageReader")}constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),g1.Disposable.create(()=>this.process.off("message",e))}};Na.IPCMessageReader=eOt;var tOt=class extends g1.AbstractMessageWriter{static{a(this,"IPCMessageWriter")}constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Na.IPCMessageWriter=tOt;var rOt=class extends g1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new g1.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};Na.PortMessageReader=rOt;var nOt=class extends g1.AbstractMessageWriter{static{a(this,"PortMessageWriter")}constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Na.PortMessageWriter=nOt;var Oz=class extends g1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,rae.default)().stream.asReadableStream(e),r)}};Na.SocketMessageReader=Oz;var Lz=class extends g1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,rae.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Na.SocketMessageWriter=Lz;var TQe=class extends g1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,rae.default)().stream.asReadableStream(e),r)}};Na.StreamMessageReader=TQe;var IQe=class extends g1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,rae.default)().stream.asWritableStream(e),r)}};Na.StreamMessageWriter=IQe;var SZr=process.env.XDG_RUNTIME_DIR,q1o=new Map([["linux",107],["darwin",103]]);function j1o(){let t=(0,Q1o.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;SZr?e=bZr.join(SZr,`vscode-ipc-${t}.sock`):e=bZr.join(U1o.tmpdir(),`vscode-${t}.sock`);let r=q1o.get(process.platform);return r!==void 0&&e.length>r&&(0,rae.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(j1o,"generateRandomPipeName");Na.generateRandomPipeName=j1o;function H1o(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,xQe.createServer)(l=>{c.close(),r([new Oz(l,e),new Lz(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(H1o,"createClientPipeTransport");Na.createClientPipeTransport=H1o;function G1o(t,e="utf-8"){let r=(0,xQe.createConnection)(t);return[new Oz(r,e),new Lz(r,e)]}a(G1o,"createServerPipeTransport");Na.createServerPipeTransport=G1o;function $1o(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,xQe.createServer)(l=>{c.close(),r([new Oz(l,e),new Lz(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a($1o,"createClientSocketTransport");Na.createClientSocketTransport=$1o;function V1o(t,e="utf-8"){let r=(0,xQe.createConnection)(t,"127.0.0.1");return[new Oz(r,e),new Lz(r,e)]}a(V1o,"createServerSocketTransport");Na.createServerSocketTransport=V1o;function W1o(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a(W1o,"isReadableStream");function z1o(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(z1o,"isWritableStream");function Y1o(t,e,r,n){r||(r=g1.NullLogger);let o=W1o(t)?new TQe(t):t,s=z1o(e)?new IQe(e):e;return g1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,g1.createMessageConnection)(o,s,r,n)}a(Y1o,"createMessageConnection");Na.createMessageConnection=Y1o});var iOt=I((N5l,TZr)=>{"use strict";p();TZr.exports=Bz()});var PSe=I((IZr,wQe)=>{p();(function(t){if(typeof wQe=="object"&&typeof wQe.exports=="object"){var e=t(require,IZr);e!==void 0&&(wQe.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(ce){function Pe(Me){return typeof Me=="string"}a(Pe,"is"),ce.is=Pe})(r||(e.DocumentUri=r={}));var n;(function(ce){function Pe(Me){return typeof Me=="string"}a(Pe,"is"),ce.is=Pe})(n||(e.URI=n={}));var o;(function(ce){ce.MIN_VALUE=-2147483648,ce.MAX_VALUE=2147483647;function Pe(Me){return typeof Me=="number"&&ce.MIN_VALUE<=Me&&Me<=ce.MAX_VALUE}a(Pe,"is"),ce.is=Pe})(o||(e.integer=o={}));var s;(function(ce){ce.MIN_VALUE=0,ce.MAX_VALUE=2147483647;function Pe(Me){return typeof Me=="number"&&ce.MIN_VALUE<=Me&&Me<=ce.MAX_VALUE}a(Pe,"is"),ce.is=Pe})(s||(e.uinteger=s={}));var c;(function(ce){function Pe(ye,oe){return ye===Number.MAX_VALUE&&(ye=s.MAX_VALUE),oe===Number.MAX_VALUE&&(oe=s.MAX_VALUE),{line:ye,character:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.uinteger(oe.line)&&We.uinteger(oe.character)}a(Me,"is"),ce.is=Me})(c||(e.Position=c={}));var l;(function(ce){function Pe(ye,oe,Ke,lt){if(We.uinteger(ye)&&We.uinteger(oe)&&We.uinteger(Ke)&&We.uinteger(lt))return{start:c.create(ye,oe),end:c.create(Ke,lt)};if(c.is(ye)&&c.is(oe))return{start:ye,end:oe};throw new Error("Range#create called with invalid arguments[".concat(ye,", ").concat(oe,", ").concat(Ke,", ").concat(lt,"]"))}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&c.is(oe.start)&&c.is(oe.end)}a(Me,"is"),ce.is=Me})(l||(e.Range=l={}));var u;(function(ce){function Pe(ye,oe){return{uri:ye,range:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&(We.string(oe.uri)||We.undefined(oe.uri))}a(Me,"is"),ce.is=Me})(u||(e.Location=u={}));var d;(function(ce){function Pe(ye,oe,Ke,lt){return{targetUri:ye,targetRange:oe,targetSelectionRange:Ke,originSelectionRange:lt}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.targetRange)&&We.string(oe.targetUri)&&l.is(oe.targetSelectionRange)&&(l.is(oe.originSelectionRange)||We.undefined(oe.originSelectionRange))}a(Me,"is"),ce.is=Me})(d||(e.LocationLink=d={}));var f;(function(ce){function Pe(ye,oe,Ke,lt){return{red:ye,green:oe,blue:Ke,alpha:lt}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.numberRange(oe.red,0,1)&&We.numberRange(oe.green,0,1)&&We.numberRange(oe.blue,0,1)&&We.numberRange(oe.alpha,0,1)}a(Me,"is"),ce.is=Me})(f||(e.Color=f={}));var h;(function(ce){function Pe(ye,oe){return{range:ye,color:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&f.is(oe.color)}a(Me,"is"),ce.is=Me})(h||(e.ColorInformation=h={}));var m;(function(ce){function Pe(ye,oe,Ke){return{label:ye,textEdit:oe,additionalTextEdits:Ke}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.string(oe.label)&&(We.undefined(oe.textEdit)||w.is(oe))&&(We.undefined(oe.additionalTextEdits)||We.typedArray(oe.additionalTextEdits,w.is))}a(Me,"is"),ce.is=Me})(m||(e.ColorPresentation=m={}));var g;(function(ce){ce.Comment="comment",ce.Imports="imports",ce.Region="region"})(g||(e.FoldingRangeKind=g={}));var A;(function(ce){function Pe(ye,oe,Ke,lt,Gt,Er){var dr={startLine:ye,endLine:oe};return We.defined(Ke)&&(dr.startCharacter=Ke),We.defined(lt)&&(dr.endCharacter=lt),We.defined(Gt)&&(dr.kind=Gt),We.defined(Er)&&(dr.collapsedText=Er),dr}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.uinteger(oe.startLine)&&We.uinteger(oe.startLine)&&(We.undefined(oe.startCharacter)||We.uinteger(oe.startCharacter))&&(We.undefined(oe.endCharacter)||We.uinteger(oe.endCharacter))&&(We.undefined(oe.kind)||We.string(oe.kind))}a(Me,"is"),ce.is=Me})(A||(e.FoldingRange=A={}));var y;(function(ce){function Pe(ye,oe){return{location:ye,message:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&u.is(oe.location)&&We.string(oe.message)}a(Me,"is"),ce.is=Me})(y||(e.DiagnosticRelatedInformation=y={}));var _;(function(ce){ce.Error=1,ce.Warning=2,ce.Information=3,ce.Hint=4})(_||(e.DiagnosticSeverity=_={}));var E;(function(ce){ce.Unnecessary=1,ce.Deprecated=2})(E||(e.DiagnosticTag=E={}));var v;(function(ce){function Pe(Me){var ye=Me;return We.objectLiteral(ye)&&We.string(ye.href)}a(Pe,"is"),ce.is=Pe})(v||(e.CodeDescription=v={}));var S;(function(ce){function Pe(ye,oe,Ke,lt,Gt,Er){var dr={range:ye,message:oe};return We.defined(Ke)&&(dr.severity=Ke),We.defined(lt)&&(dr.code=lt),We.defined(Gt)&&(dr.source=Gt),We.defined(Er)&&(dr.relatedInformation=Er),dr}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe,Ke=ye;return We.defined(Ke)&&l.is(Ke.range)&&We.string(Ke.message)&&(We.number(Ke.severity)||We.undefined(Ke.severity))&&(We.integer(Ke.code)||We.string(Ke.code)||We.undefined(Ke.code))&&(We.undefined(Ke.codeDescription)||We.string((oe=Ke.codeDescription)===null||oe===void 0?void 0:oe.href))&&(We.string(Ke.source)||We.undefined(Ke.source))&&(We.undefined(Ke.relatedInformation)||We.typedArray(Ke.relatedInformation,y.is))}a(Me,"is"),ce.is=Me})(S||(e.Diagnostic=S={}));var T;(function(ce){function Pe(ye,oe){for(var Ke=[],lt=2;lt0&&(Gt.arguments=Ke),Gt}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.title)&&We.string(oe.command)}a(Me,"is"),ce.is=Me})(T||(e.Command=T={}));var w;(function(ce){function Pe(Ke,lt){return{range:Ke,newText:lt}}a(Pe,"replace"),ce.replace=Pe;function Me(Ke,lt){return{range:{start:Ke,end:Ke},newText:lt}}a(Me,"insert"),ce.insert=Me;function ye(Ke){return{range:Ke,newText:""}}a(ye,"del"),ce.del=ye;function oe(Ke){var lt=Ke;return We.objectLiteral(lt)&&We.string(lt.newText)&&l.is(lt.range)}a(oe,"is"),ce.is=oe})(w||(e.TextEdit=w={}));var R;(function(ce){function Pe(ye,oe,Ke){var lt={label:ye};return oe!==void 0&&(lt.needsConfirmation=oe),Ke!==void 0&&(lt.description=Ke),lt}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.string(oe.label)&&(We.boolean(oe.needsConfirmation)||oe.needsConfirmation===void 0)&&(We.string(oe.description)||oe.description===void 0)}a(Me,"is"),ce.is=Me})(R||(e.ChangeAnnotation=R={}));var x;(function(ce){function Pe(Me){var ye=Me;return We.string(ye)}a(Pe,"is"),ce.is=Pe})(x||(e.ChangeAnnotationIdentifier=x={}));var k;(function(ce){function Pe(Ke,lt,Gt){return{range:Ke,newText:lt,annotationId:Gt}}a(Pe,"replace"),ce.replace=Pe;function Me(Ke,lt,Gt){return{range:{start:Ke,end:Ke},newText:lt,annotationId:Gt}}a(Me,"insert"),ce.insert=Me;function ye(Ke,lt){return{range:Ke,newText:"",annotationId:lt}}a(ye,"del"),ce.del=ye;function oe(Ke){var lt=Ke;return w.is(lt)&&(R.is(lt.annotationId)||x.is(lt.annotationId))}a(oe,"is"),ce.is=oe})(k||(e.AnnotatedTextEdit=k={}));var D;(function(ce){function Pe(ye,oe){return{textDocument:ye,edits:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&Y.is(oe.textDocument)&&Array.isArray(oe.edits)}a(Me,"is"),ce.is=Me})(D||(e.TextDocumentEdit=D={}));var N;(function(ce){function Pe(ye,oe,Ke){var lt={kind:"create",uri:ye};return oe!==void 0&&(oe.overwrite!==void 0||oe.ignoreIfExists!==void 0)&&(lt.options=oe),Ke!==void 0&&(lt.annotationId=Ke),lt}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return oe&&oe.kind==="create"&&We.string(oe.uri)&&(oe.options===void 0||(oe.options.overwrite===void 0||We.boolean(oe.options.overwrite))&&(oe.options.ignoreIfExists===void 0||We.boolean(oe.options.ignoreIfExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(N||(e.CreateFile=N={}));var O;(function(ce){function Pe(ye,oe,Ke,lt){var Gt={kind:"rename",oldUri:ye,newUri:oe};return Ke!==void 0&&(Ke.overwrite!==void 0||Ke.ignoreIfExists!==void 0)&&(Gt.options=Ke),lt!==void 0&&(Gt.annotationId=lt),Gt}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return oe&&oe.kind==="rename"&&We.string(oe.oldUri)&&We.string(oe.newUri)&&(oe.options===void 0||(oe.options.overwrite===void 0||We.boolean(oe.options.overwrite))&&(oe.options.ignoreIfExists===void 0||We.boolean(oe.options.ignoreIfExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(O||(e.RenameFile=O={}));var B;(function(ce){function Pe(ye,oe,Ke){var lt={kind:"delete",uri:ye};return oe!==void 0&&(oe.recursive!==void 0||oe.ignoreIfNotExists!==void 0)&&(lt.options=oe),Ke!==void 0&&(lt.annotationId=Ke),lt}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return oe&&oe.kind==="delete"&&We.string(oe.uri)&&(oe.options===void 0||(oe.options.recursive===void 0||We.boolean(oe.options.recursive))&&(oe.options.ignoreIfNotExists===void 0||We.boolean(oe.options.ignoreIfNotExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(B||(e.DeleteFile=B={}));var q;(function(ce){function Pe(Me){var ye=Me;return ye&&(ye.changes!==void 0||ye.documentChanges!==void 0)&&(ye.documentChanges===void 0||ye.documentChanges.every(function(oe){return We.string(oe.kind)?N.is(oe)||O.is(oe)||B.is(oe):D.is(oe)}))}a(Pe,"is"),ce.is=Pe})(q||(e.WorkspaceEdit=q={}));var M=(function(){function ce(Pe,Me){this.edits=Pe,this.changeAnnotations=Me}return a(ce,"TextEditChangeImpl"),ce.prototype.insert=function(Pe,Me,ye){var oe,Ke;if(ye===void 0?oe=w.insert(Pe,Me):x.is(ye)?(Ke=ye,oe=k.insert(Pe,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),Ke=this.changeAnnotations.manage(ye),oe=k.insert(Pe,Me,Ke)),this.edits.push(oe),Ke!==void 0)return Ke},ce.prototype.replace=function(Pe,Me,ye){var oe,Ke;if(ye===void 0?oe=w.replace(Pe,Me):x.is(ye)?(Ke=ye,oe=k.replace(Pe,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),Ke=this.changeAnnotations.manage(ye),oe=k.replace(Pe,Me,Ke)),this.edits.push(oe),Ke!==void 0)return Ke},ce.prototype.delete=function(Pe,Me){var ye,oe;if(Me===void 0?ye=w.del(Pe):x.is(Me)?(oe=Me,ye=k.del(Pe,Me)):(this.assertChangeAnnotations(this.changeAnnotations),oe=this.changeAnnotations.manage(Me),ye=k.del(Pe,oe)),this.edits.push(ye),oe!==void 0)return oe},ce.prototype.add=function(Pe){this.edits.push(Pe)},ce.prototype.all=function(){return this.edits},ce.prototype.clear=function(){this.edits.splice(0,this.edits.length)},ce.prototype.assertChangeAnnotations=function(Pe){if(Pe===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},ce})(),L=(function(){function ce(Pe){this._annotations=Pe===void 0?Object.create(null):Pe,this._counter=0,this._size=0}return a(ce,"ChangeAnnotations"),ce.prototype.all=function(){return this._annotations},Object.defineProperty(ce.prototype,"size",{get:a(function(){return this._size},"get"),enumerable:!1,configurable:!0}),ce.prototype.manage=function(Pe,Me){var ye;if(x.is(Pe)?ye=Pe:(ye=this.nextId(),Me=Pe),this._annotations[ye]!==void 0)throw new Error("Id ".concat(ye," is already in use."));if(Me===void 0)throw new Error("No annotation provided for id ".concat(ye));return this._annotations[ye]=Me,this._size++,ye},ce.prototype.nextId=function(){return this._counter++,this._counter.toString()},ce})(),U=(function(){function ce(Pe){var Me=this;this._textEditChanges=Object.create(null),Pe!==void 0?(this._workspaceEdit=Pe,Pe.documentChanges?(this._changeAnnotations=new L(Pe.changeAnnotations),Pe.changeAnnotations=this._changeAnnotations.all(),Pe.documentChanges.forEach(function(ye){if(D.is(ye)){var oe=new M(ye.edits,Me._changeAnnotations);Me._textEditChanges[ye.textDocument.uri]=oe}})):Pe.changes&&Object.keys(Pe.changes).forEach(function(ye){var oe=new M(Pe.changes[ye]);Me._textEditChanges[ye]=oe})):this._workspaceEdit={}}return a(ce,"WorkspaceChange"),Object.defineProperty(ce.prototype,"edit",{get:a(function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},"get"),enumerable:!1,configurable:!0}),ce.prototype.getTextEditChange=function(Pe){if(Y.is(Pe)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Me={uri:Pe.uri,version:Pe.version},ye=this._textEditChanges[Me.uri];if(!ye){var oe=[],Ke={textDocument:Me,edits:oe};this._workspaceEdit.documentChanges.push(Ke),ye=new M(oe,this._changeAnnotations),this._textEditChanges[Me.uri]=ye}return ye}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var ye=this._textEditChanges[Pe];if(!ye){var oe=[];this._workspaceEdit.changes[Pe]=oe,ye=new M(oe),this._textEditChanges[Pe]=ye}return ye}},ce.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new L,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},ce.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},ce.prototype.createFile=function(Pe,Me,ye){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var oe;R.is(Me)||x.is(Me)?oe=Me:ye=Me;var Ke,lt;if(oe===void 0?Ke=N.create(Pe,ye):(lt=x.is(oe)?oe:this._changeAnnotations.manage(oe),Ke=N.create(Pe,ye,lt)),this._workspaceEdit.documentChanges.push(Ke),lt!==void 0)return lt},ce.prototype.renameFile=function(Pe,Me,ye,oe){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Ke;R.is(ye)||x.is(ye)?Ke=ye:oe=ye;var lt,Gt;if(Ke===void 0?lt=O.create(Pe,Me,oe):(Gt=x.is(Ke)?Ke:this._changeAnnotations.manage(Ke),lt=O.create(Pe,Me,oe,Gt)),this._workspaceEdit.documentChanges.push(lt),Gt!==void 0)return Gt},ce.prototype.deleteFile=function(Pe,Me,ye){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var oe;R.is(Me)||x.is(Me)?oe=Me:ye=Me;var Ke,lt;if(oe===void 0?Ke=B.create(Pe,ye):(lt=x.is(oe)?oe:this._changeAnnotations.manage(oe),Ke=B.create(Pe,ye,lt)),this._workspaceEdit.documentChanges.push(Ke),lt!==void 0)return lt},ce})();e.WorkspaceChange=U;var j;(function(ce){function Pe(ye){return{uri:ye}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)}a(Me,"is"),ce.is=Me})(j||(e.TextDocumentIdentifier=j={}));var Q;(function(ce){function Pe(ye,oe){return{uri:ye,version:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.integer(oe.version)}a(Me,"is"),ce.is=Me})(Q||(e.VersionedTextDocumentIdentifier=Q={}));var Y;(function(ce){function Pe(ye,oe){return{uri:ye,version:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&(oe.version===null||We.integer(oe.version))}a(Me,"is"),ce.is=Me})(Y||(e.OptionalVersionedTextDocumentIdentifier=Y={}));var W;(function(ce){function Pe(ye,oe,Ke,lt){return{uri:ye,languageId:oe,version:Ke,text:lt}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.string(oe.languageId)&&We.integer(oe.version)&&We.string(oe.text)}a(Me,"is"),ce.is=Me})(W||(e.TextDocumentItem=W={}));var V;(function(ce){ce.PlainText="plaintext",ce.Markdown="markdown";function Pe(Me){var ye=Me;return ye===ce.PlainText||ye===ce.Markdown}a(Pe,"is"),ce.is=Pe})(V||(e.MarkupKind=V={}));var z;(function(ce){function Pe(Me){var ye=Me;return We.objectLiteral(Me)&&V.is(ye.kind)&&We.string(ye.value)}a(Pe,"is"),ce.is=Pe})(z||(e.MarkupContent=z={}));var ie;(function(ce){ce.Text=1,ce.Method=2,ce.Function=3,ce.Constructor=4,ce.Field=5,ce.Variable=6,ce.Class=7,ce.Interface=8,ce.Module=9,ce.Property=10,ce.Unit=11,ce.Value=12,ce.Enum=13,ce.Keyword=14,ce.Snippet=15,ce.Color=16,ce.File=17,ce.Reference=18,ce.Folder=19,ce.EnumMember=20,ce.Constant=21,ce.Struct=22,ce.Event=23,ce.Operator=24,ce.TypeParameter=25})(ie||(e.CompletionItemKind=ie={}));var H;(function(ce){ce.PlainText=1,ce.Snippet=2})(H||(e.InsertTextFormat=H={}));var re;(function(ce){ce.Deprecated=1})(re||(e.CompletionItemTag=re={}));var le;(function(ce){function Pe(ye,oe,Ke){return{newText:ye,insert:oe,replace:Ke}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return oe&&We.string(oe.newText)&&l.is(oe.insert)&&l.is(oe.replace)}a(Me,"is"),ce.is=Me})(le||(e.InsertReplaceEdit=le={}));var Le;(function(ce){ce.asIs=1,ce.adjustIndentation=2})(Le||(e.InsertTextMode=Le={}));var me;(function(ce){function Pe(Me){var ye=Me;return ye&&(We.string(ye.detail)||ye.detail===void 0)&&(We.string(ye.description)||ye.description===void 0)}a(Pe,"is"),ce.is=Pe})(me||(e.CompletionItemLabelDetails=me={}));var Oe;(function(ce){function Pe(Me){return{label:Me}}a(Pe,"create"),ce.create=Pe})(Oe||(e.CompletionItem=Oe={}));var Te;(function(ce){function Pe(Me,ye){return{items:Me||[],isIncomplete:!!ye}}a(Pe,"create"),ce.create=Pe})(Te||(e.CompletionList=Te={}));var te;(function(ce){function Pe(ye){return ye.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(Pe,"fromPlainText"),ce.fromPlainText=Pe;function Me(ye){var oe=ye;return We.string(oe)||We.objectLiteral(oe)&&We.string(oe.language)&&We.string(oe.value)}a(Me,"is"),ce.is=Me})(te||(e.MarkedString=te={}));var ee;(function(ce){function Pe(Me){var ye=Me;return!!ye&&We.objectLiteral(ye)&&(z.is(ye.contents)||te.is(ye.contents)||We.typedArray(ye.contents,te.is))&&(Me.range===void 0||l.is(Me.range))}a(Pe,"is"),ce.is=Pe})(ee||(e.Hover=ee={}));var K;(function(ce){function Pe(Me,ye){return ye?{label:Me,documentation:ye}:{label:Me}}a(Pe,"create"),ce.create=Pe})(K||(e.ParameterInformation=K={}));var he;(function(ce){function Pe(Me,ye){for(var oe=[],Ke=2;Ke=0;Ur--){var Wr=Er[Ur],zr=Ke.offsetAt(Wr.range.start),zt=Ke.offsetAt(Wr.range.end);if(zt<=dr)Gt=Gt.substring(0,zr)+Wr.newText+Gt.substring(zt,Gt.length);else throw new Error("Overlapping edit");dr=zr}return Gt}a(ye,"applyEdits"),ce.applyEdits=ye;function oe(Ke,lt){if(Ke.length<=1)return Ke;var Gt=Ke.length/2|0,Er=Ke.slice(0,Gt),dr=Ke.slice(Gt);oe(Er,lt),oe(dr,lt);for(var Ur=0,Wr=0,zr=0;Ur=0;Ur--){var Wr=Er[Ur],zr=Ke.offsetAt(Wr.range.start),zt=Ke.offsetAt(Wr.range.end);if(zt<=dr)Gt=Gt.substring(0,zr)+Wr.newText+Gt.substring(zt,Gt.length);else throw new Error("Overlapping edit");dr=zr}return Gt}a(ye,"applyEdits"),ce.applyEdits=ye;function oe(Ke,lt){if(Ke.length<=1)return Ke;var Gt=Ke.length/2|0,Er=Ke.slice(0,Gt),dr=Ke.slice(Gt);oe(Er,lt),oe(dr,lt);for(var Ur=0,Wr=0,zr=0;Ur0&&Pe.push(Me.length),this._lineOffsets=Pe}return this._lineOffsets},ce.prototype.positionAt=function(Pe){Pe=Math.max(Math.min(Pe,this._content.length),0);var Me=this.getLineOffsets(),ye=0,oe=Me.length;if(oe===0)return c.create(0,Pe);for(;yePe?oe=Ke:ye=Ke+1}var lt=ye-1;return c.create(lt,Pe-Me[lt])},ce.prototype.offsetAt=function(Pe){var Me=this.getLineOffsets();if(Pe.line>=Me.length)return this._content.length;if(Pe.line<0)return 0;var ye=Me[Pe.line],oe=Pe.line+1"u"}a(ye,"undefined"),ce.undefined=ye;function oe(zt){return zt===!0||zt===!1}a(oe,"boolean"),ce.boolean=oe;function Ke(zt){return Pe.call(zt)==="[object String]"}a(Ke,"string"),ce.string=Ke;function lt(zt){return Pe.call(zt)==="[object Number]"}a(lt,"number"),ce.number=lt;function Gt(zt,Tr,e0){return Pe.call(zt)==="[object Number]"&&Tr<=zt&&zt<=e0}a(Gt,"numberRange"),ce.numberRange=Gt;function Er(zt){return Pe.call(zt)==="[object Number]"&&-2147483648<=zt&&zt<=2147483647}a(Er,"integer"),ce.integer=Er;function dr(zt){return Pe.call(zt)==="[object Number]"&&0<=zt&&zt<=2147483647}a(dr,"uinteger"),ce.uinteger=dr;function Ur(zt){return Pe.call(zt)==="[object Function]"}a(Ur,"func"),ce.func=Ur;function Wr(zt){return zt!==null&&typeof zt=="object"}a(Wr,"objectLiteral"),ce.objectLiteral=Wr;function zr(zt,Tr){return Array.isArray(zt)&&zt.every(Tr)}a(zr,"typedArray"),ce.typedArray=zr})(We||(We={}))})});var Hd=I(RC=>{"use strict";p();Object.defineProperty(RC,"__esModule",{value:!0});RC.ProtocolNotificationType=RC.ProtocolNotificationType0=RC.ProtocolRequestType=RC.ProtocolRequestType0=RC.RegistrationType=RC.MessageDirection=void 0;var rae=Lz(),IZr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(IZr||(RC.MessageDirection=IZr={}));var iOt=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};RC.RegistrationType=iOt;var oOt=class extends rae.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};RC.ProtocolRequestType0=oOt;var sOt=class extends rae.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,rae.ParameterStructures.byName)}};RC.ProtocolRequestType=sOt;var aOt=class extends rae.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};RC.ProtocolNotificationType0=aOt;var cOt=class extends rae.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,rae.ParameterStructures.byName)}};RC.ProtocolNotificationType=cOt});var RQe=I(Gh=>{"use strict";p();Object.defineProperty(Gh,"__esModule",{value:!0});Gh.objectLiteral=Gh.typedArray=Gh.stringArray=Gh.array=Gh.func=Gh.error=Gh.number=Gh.string=Gh.boolean=void 0;function z1o(t){return t===!0||t===!1}a(z1o,"boolean");Gh.boolean=z1o;function xZr(t){return typeof t=="string"||t instanceof String}a(xZr,"string");Gh.string=xZr;function Y1o(t){return typeof t=="number"||t instanceof Number}a(Y1o,"number");Gh.number=Y1o;function K1o(t){return t instanceof Error}a(K1o,"error");Gh.error=K1o;function J1o(t){return typeof t=="function"}a(J1o,"func");Gh.func=J1o;function wZr(t){return Array.isArray(t)}a(wZr,"array");Gh.array=wZr;function Z1o(t){return wZr(t)&&t.every(e=>xZr(e))}a(Z1o,"stringArray");Gh.stringArray=Z1o;function X1o(t,e){return Array.isArray(t)&&t.every(e)}a(X1o,"typedArray");Gh.typedArray=X1o;function eTo(t){return t!==null&&typeof t=="object"}a(eTo,"objectLiteral");Gh.objectLiteral=eTo});var PZr=I(kQe=>{"use strict";p();Object.defineProperty(kQe,"__esModule",{value:!0});kQe.ImplementationRequest=void 0;var RZr=Hd(),kZr;(function(t){t.method="textDocument/implementation",t.messageDirection=RZr.MessageDirection.clientToServer,t.type=new RZr.ProtocolRequestType(t.method)})(kZr||(kQe.ImplementationRequest=kZr={}))});var MZr=I(PQe=>{"use strict";p();Object.defineProperty(PQe,"__esModule",{value:!0});PQe.TypeDefinitionRequest=void 0;var DZr=Hd(),NZr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=DZr.MessageDirection.clientToServer,t.type=new DZr.ProtocolRequestType(t.method)})(NZr||(PQe.TypeDefinitionRequest=NZr={}))});var BZr=I(nae=>{"use strict";p();Object.defineProperty(nae,"__esModule",{value:!0});nae.DidChangeWorkspaceFoldersNotification=nae.WorkspaceFoldersRequest=void 0;var DQe=Hd(),OZr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=DQe.MessageDirection.serverToClient,t.type=new DQe.ProtocolRequestType0(t.method)})(OZr||(nae.WorkspaceFoldersRequest=OZr={}));var LZr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=DQe.MessageDirection.clientToServer,t.type=new DQe.ProtocolNotificationType(t.method)})(LZr||(nae.DidChangeWorkspaceFoldersNotification=LZr={}))});var QZr=I(NQe=>{"use strict";p();Object.defineProperty(NQe,"__esModule",{value:!0});NQe.ConfigurationRequest=void 0;var FZr=Hd(),UZr;(function(t){t.method="workspace/configuration",t.messageDirection=FZr.MessageDirection.serverToClient,t.type=new FZr.ProtocolRequestType(t.method)})(UZr||(NQe.ConfigurationRequest=UZr={}))});var HZr=I(iae=>{"use strict";p();Object.defineProperty(iae,"__esModule",{value:!0});iae.ColorPresentationRequest=iae.DocumentColorRequest=void 0;var MQe=Hd(),qZr;(function(t){t.method="textDocument/documentColor",t.messageDirection=MQe.MessageDirection.clientToServer,t.type=new MQe.ProtocolRequestType(t.method)})(qZr||(iae.DocumentColorRequest=qZr={}));var jZr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=MQe.MessageDirection.clientToServer,t.type=new MQe.ProtocolRequestType(t.method)})(jZr||(iae.ColorPresentationRequest=jZr={}))});var VZr=I(oae=>{"use strict";p();Object.defineProperty(oae,"__esModule",{value:!0});oae.FoldingRangeRefreshRequest=oae.FoldingRangeRequest=void 0;var OQe=Hd(),GZr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=OQe.MessageDirection.clientToServer,t.type=new OQe.ProtocolRequestType(t.method)})(GZr||(oae.FoldingRangeRequest=GZr={}));var $Zr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=OQe.MessageDirection.serverToClient,t.type=new OQe.ProtocolRequestType0(t.method)})($Zr||(oae.FoldingRangeRefreshRequest=$Zr={}))});var YZr=I(LQe=>{"use strict";p();Object.defineProperty(LQe,"__esModule",{value:!0});LQe.DeclarationRequest=void 0;var WZr=Hd(),zZr;(function(t){t.method="textDocument/declaration",t.messageDirection=WZr.MessageDirection.clientToServer,t.type=new WZr.ProtocolRequestType(t.method)})(zZr||(LQe.DeclarationRequest=zZr={}))});var ZZr=I(BQe=>{"use strict";p();Object.defineProperty(BQe,"__esModule",{value:!0});BQe.SelectionRangeRequest=void 0;var KZr=Hd(),JZr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=KZr.MessageDirection.clientToServer,t.type=new KZr.ProtocolRequestType(t.method)})(JZr||(BQe.SelectionRangeRequest=JZr={}))});var rXr=I(h7=>{"use strict";p();Object.defineProperty(h7,"__esModule",{value:!0});h7.WorkDoneProgressCancelNotification=h7.WorkDoneProgressCreateRequest=h7.WorkDoneProgress=void 0;var tTo=Lz(),FQe=Hd(),XZr;(function(t){t.type=new tTo.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(XZr||(h7.WorkDoneProgress=XZr={}));var eXr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=FQe.MessageDirection.serverToClient,t.type=new FQe.ProtocolRequestType(t.method)})(eXr||(h7.WorkDoneProgressCreateRequest=eXr={}));var tXr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=FQe.MessageDirection.clientToServer,t.type=new FQe.ProtocolNotificationType(t.method)})(tXr||(h7.WorkDoneProgressCancelNotification=tXr={}))});var sXr=I(m7=>{"use strict";p();Object.defineProperty(m7,"__esModule",{value:!0});m7.CallHierarchyOutgoingCallsRequest=m7.CallHierarchyIncomingCallsRequest=m7.CallHierarchyPrepareRequest=void 0;var sae=Hd(),nXr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=sae.MessageDirection.clientToServer,t.type=new sae.ProtocolRequestType(t.method)})(nXr||(m7.CallHierarchyPrepareRequest=nXr={}));var iXr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=sae.MessageDirection.clientToServer,t.type=new sae.ProtocolRequestType(t.method)})(iXr||(m7.CallHierarchyIncomingCallsRequest=iXr={}));var oXr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=sae.MessageDirection.clientToServer,t.type=new sae.ProtocolRequestType(t.method)})(oXr||(m7.CallHierarchyOutgoingCallsRequest=oXr={}))});var fXr=I(kC=>{"use strict";p();Object.defineProperty(kC,"__esModule",{value:!0});kC.SemanticTokensRefreshRequest=kC.SemanticTokensRangeRequest=kC.SemanticTokensDeltaRequest=kC.SemanticTokensRequest=kC.SemanticTokensRegistrationType=kC.TokenFormat=void 0;var r3=Hd(),aXr;(function(t){t.Relative="relative"})(aXr||(kC.TokenFormat=aXr={}));var DSe;(function(t){t.method="textDocument/semanticTokens",t.type=new r3.RegistrationType(t.method)})(DSe||(kC.SemanticTokensRegistrationType=DSe={}));var cXr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=r3.MessageDirection.clientToServer,t.type=new r3.ProtocolRequestType(t.method),t.registrationMethod=DSe.method})(cXr||(kC.SemanticTokensRequest=cXr={}));var lXr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=r3.MessageDirection.clientToServer,t.type=new r3.ProtocolRequestType(t.method),t.registrationMethod=DSe.method})(lXr||(kC.SemanticTokensDeltaRequest=lXr={}));var uXr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=r3.MessageDirection.clientToServer,t.type=new r3.ProtocolRequestType(t.method),t.registrationMethod=DSe.method})(uXr||(kC.SemanticTokensRangeRequest=uXr={}));var dXr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=r3.MessageDirection.serverToClient,t.type=new r3.ProtocolRequestType0(t.method)})(dXr||(kC.SemanticTokensRefreshRequest=dXr={}))});var mXr=I(UQe=>{"use strict";p();Object.defineProperty(UQe,"__esModule",{value:!0});UQe.ShowDocumentRequest=void 0;var pXr=Hd(),hXr;(function(t){t.method="window/showDocument",t.messageDirection=pXr.MessageDirection.serverToClient,t.type=new pXr.ProtocolRequestType(t.method)})(hXr||(UQe.ShowDocumentRequest=hXr={}))});var yXr=I(QQe=>{"use strict";p();Object.defineProperty(QQe,"__esModule",{value:!0});QQe.LinkedEditingRangeRequest=void 0;var gXr=Hd(),AXr;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=gXr.MessageDirection.clientToServer,t.type=new gXr.ProtocolRequestType(t.method)})(AXr||(QQe.LinkedEditingRangeRequest=AXr={}))});var IXr=I(o_=>{"use strict";p();Object.defineProperty(o_,"__esModule",{value:!0});o_.WillDeleteFilesRequest=o_.DidDeleteFilesNotification=o_.DidRenameFilesNotification=o_.WillRenameFilesRequest=o_.DidCreateFilesNotification=o_.WillCreateFilesRequest=o_.FileOperationPatternKind=void 0;var bx=Hd(),_Xr;(function(t){t.file="file",t.folder="folder"})(_Xr||(o_.FileOperationPatternKind=_Xr={}));var EXr;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolRequestType(t.method)})(EXr||(o_.WillCreateFilesRequest=EXr={}));var vXr;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolNotificationType(t.method)})(vXr||(o_.DidCreateFilesNotification=vXr={}));var CXr;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolRequestType(t.method)})(CXr||(o_.WillRenameFilesRequest=CXr={}));var bXr;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolNotificationType(t.method)})(bXr||(o_.DidRenameFilesNotification=bXr={}));var SXr;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolNotificationType(t.method)})(SXr||(o_.DidDeleteFilesNotification=SXr={}));var TXr;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolRequestType(t.method)})(TXr||(o_.WillDeleteFilesRequest=TXr={}))});var PXr=I(g7=>{"use strict";p();Object.defineProperty(g7,"__esModule",{value:!0});g7.MonikerRequest=g7.MonikerKind=g7.UniquenessLevel=void 0;var xXr=Hd(),wXr;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(wXr||(g7.UniquenessLevel=wXr={}));var RXr;(function(t){t.$import="import",t.$export="export",t.local="local"})(RXr||(g7.MonikerKind=RXr={}));var kXr;(function(t){t.method="textDocument/moniker",t.messageDirection=xXr.MessageDirection.clientToServer,t.type=new xXr.ProtocolRequestType(t.method)})(kXr||(g7.MonikerRequest=kXr={}))});var OXr=I(A7=>{"use strict";p();Object.defineProperty(A7,"__esModule",{value:!0});A7.TypeHierarchySubtypesRequest=A7.TypeHierarchySupertypesRequest=A7.TypeHierarchyPrepareRequest=void 0;var aae=Hd(),DXr;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=aae.MessageDirection.clientToServer,t.type=new aae.ProtocolRequestType(t.method)})(DXr||(A7.TypeHierarchyPrepareRequest=DXr={}));var NXr;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=aae.MessageDirection.clientToServer,t.type=new aae.ProtocolRequestType(t.method)})(NXr||(A7.TypeHierarchySupertypesRequest=NXr={}));var MXr;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=aae.MessageDirection.clientToServer,t.type=new aae.ProtocolRequestType(t.method)})(MXr||(A7.TypeHierarchySubtypesRequest=MXr={}))});var FXr=I(cae=>{"use strict";p();Object.defineProperty(cae,"__esModule",{value:!0});cae.InlineValueRefreshRequest=cae.InlineValueRequest=void 0;var qQe=Hd(),LXr;(function(t){t.method="textDocument/inlineValue",t.messageDirection=qQe.MessageDirection.clientToServer,t.type=new qQe.ProtocolRequestType(t.method)})(LXr||(cae.InlineValueRequest=LXr={}));var BXr;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=qQe.MessageDirection.serverToClient,t.type=new qQe.ProtocolRequestType0(t.method)})(BXr||(cae.InlineValueRefreshRequest=BXr={}))});var jXr=I(y7=>{"use strict";p();Object.defineProperty(y7,"__esModule",{value:!0});y7.InlayHintRefreshRequest=y7.InlayHintResolveRequest=y7.InlayHintRequest=void 0;var lae=Hd(),UXr;(function(t){t.method="textDocument/inlayHint",t.messageDirection=lae.MessageDirection.clientToServer,t.type=new lae.ProtocolRequestType(t.method)})(UXr||(y7.InlayHintRequest=UXr={}));var QXr;(function(t){t.method="inlayHint/resolve",t.messageDirection=lae.MessageDirection.clientToServer,t.type=new lae.ProtocolRequestType(t.method)})(QXr||(y7.InlayHintResolveRequest=QXr={}));var qXr;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=lae.MessageDirection.serverToClient,t.type=new lae.ProtocolRequestType0(t.method)})(qXr||(y7.InlayHintRefreshRequest=qXr={}))});var YXr=I(Sx=>{"use strict";p();Object.defineProperty(Sx,"__esModule",{value:!0});Sx.DiagnosticRefreshRequest=Sx.WorkspaceDiagnosticRequest=Sx.DocumentDiagnosticRequest=Sx.DocumentDiagnosticReportKind=Sx.DiagnosticServerCancellationData=void 0;var zXr=Lz(),rTo=RQe(),uae=Hd(),HXr;(function(t){function e(r){let n=r;return n&&rTo.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})(HXr||(Sx.DiagnosticServerCancellationData=HXr={}));var GXr;(function(t){t.Full="full",t.Unchanged="unchanged"})(GXr||(Sx.DocumentDiagnosticReportKind=GXr={}));var $Xr;(function(t){t.method="textDocument/diagnostic",t.messageDirection=uae.MessageDirection.clientToServer,t.type=new uae.ProtocolRequestType(t.method),t.partialResult=new zXr.ProgressType})($Xr||(Sx.DocumentDiagnosticRequest=$Xr={}));var VXr;(function(t){t.method="workspace/diagnostic",t.messageDirection=uae.MessageDirection.clientToServer,t.type=new uae.ProtocolRequestType(t.method),t.partialResult=new zXr.ProgressType})(VXr||(Sx.WorkspaceDiagnosticRequest=VXr={}));var WXr;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=uae.MessageDirection.serverToClient,t.type=new uae.ProtocolRequestType0(t.method)})(WXr||(Sx.DiagnosticRefreshRequest=WXr={}))});var ren=I(Xf=>{"use strict";p();Object.defineProperty(Xf,"__esModule",{value:!0});Xf.DidCloseNotebookDocumentNotification=Xf.DidSaveNotebookDocumentNotification=Xf.DidChangeNotebookDocumentNotification=Xf.NotebookCellArrayChange=Xf.DidOpenNotebookDocumentNotification=Xf.NotebookDocumentSyncRegistrationType=Xf.NotebookDocument=Xf.NotebookCell=Xf.ExecutionSummary=Xf.NotebookCellKind=void 0;var NSe=PSe(),CP=RQe(),LM=Hd(),lOt;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(lOt||(Xf.NotebookCellKind=lOt={}));var uOt;(function(t){function e(o,s){let c={executionOrder:o};return(s===!0||s===!1)&&(c.success=s),c}a(e,"create"),t.create=e;function r(o){let s=o;return CP.objectLiteral(s)&&NSe.uinteger.is(s.executionOrder)&&(s.success===void 0||CP.boolean(s.success))}a(r,"is"),t.is=r;function n(o,s){return o===s?!0:o==null||s===null||s===void 0?!1:o.executionOrder===s.executionOrder&&o.success===s.success}a(n,"equals"),t.equals=n})(uOt||(Xf.ExecutionSummary=uOt={}));var jQe;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return CP.objectLiteral(c)&&lOt.is(c.kind)&&NSe.DocumentUri.is(c.document)&&(c.metadata===void 0||CP.objectLiteral(c.metadata))}a(r,"is"),t.is=r;function n(s,c){let l=new Set;return s.document!==c.document&&l.add("document"),s.kind!==c.kind&&l.add("kind"),s.executionSummary!==c.executionSummary&&l.add("executionSummary"),(s.metadata!==void 0||c.metadata!==void 0)&&!o(s.metadata,c.metadata)&&l.add("metadata"),(s.executionSummary!==void 0||c.executionSummary!==void 0)&&!uOt.equals(s.executionSummary,c.executionSummary)&&l.add("executionSummary"),l}a(n,"diff"),t.diff=n;function o(s,c){if(s===c)return!0;if(s==null||c===null||c===void 0||typeof s!=typeof c||typeof s!="object")return!1;let l=Array.isArray(s),u=Array.isArray(c);if(l!==u)return!1;if(l&&u){if(s.length!==c.length)return!1;for(let d=0;d{"use strict";p();Object.defineProperty(HQe,"__esModule",{value:!0});HQe.InlineCompletionRequest=void 0;var nen=Hd(),ien;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=nen.MessageDirection.clientToServer,t.type=new nen.ProtocolRequestType(t.method)})(ien||(HQe.InlineCompletionRequest=ien={}))});var ytn=I(Ve=>{"use strict";p();Object.defineProperty(Ve,"__esModule",{value:!0});Ve.WorkspaceSymbolRequest=Ve.CodeActionResolveRequest=Ve.CodeActionRequest=Ve.DocumentSymbolRequest=Ve.DocumentHighlightRequest=Ve.ReferencesRequest=Ve.DefinitionRequest=Ve.SignatureHelpRequest=Ve.SignatureHelpTriggerKind=Ve.HoverRequest=Ve.CompletionResolveRequest=Ve.CompletionRequest=Ve.CompletionTriggerKind=Ve.PublishDiagnosticsNotification=Ve.WatchKind=Ve.RelativePattern=Ve.FileChangeType=Ve.DidChangeWatchedFilesNotification=Ve.WillSaveTextDocumentWaitUntilRequest=Ve.WillSaveTextDocumentNotification=Ve.TextDocumentSaveReason=Ve.DidSaveTextDocumentNotification=Ve.DidCloseTextDocumentNotification=Ve.DidChangeTextDocumentNotification=Ve.TextDocumentContentChangeEvent=Ve.DidOpenTextDocumentNotification=Ve.TextDocumentSyncKind=Ve.TelemetryEventNotification=Ve.LogMessageNotification=Ve.ShowMessageRequest=Ve.ShowMessageNotification=Ve.MessageType=Ve.DidChangeConfigurationNotification=Ve.ExitNotification=Ve.ShutdownRequest=Ve.InitializedNotification=Ve.InitializeErrorCodes=Ve.InitializeRequest=Ve.WorkDoneProgressOptions=Ve.TextDocumentRegistrationOptions=Ve.StaticRegistrationOptions=Ve.PositionEncodingKind=Ve.FailureHandlingKind=Ve.ResourceOperationKind=Ve.UnregistrationRequest=Ve.RegistrationRequest=Ve.DocumentSelector=Ve.NotebookCellTextDocumentFilter=Ve.NotebookDocumentFilter=Ve.TextDocumentFilter=void 0;Ve.MonikerRequest=Ve.MonikerKind=Ve.UniquenessLevel=Ve.WillDeleteFilesRequest=Ve.DidDeleteFilesNotification=Ve.WillRenameFilesRequest=Ve.DidRenameFilesNotification=Ve.WillCreateFilesRequest=Ve.DidCreateFilesNotification=Ve.FileOperationPatternKind=Ve.LinkedEditingRangeRequest=Ve.ShowDocumentRequest=Ve.SemanticTokensRegistrationType=Ve.SemanticTokensRefreshRequest=Ve.SemanticTokensRangeRequest=Ve.SemanticTokensDeltaRequest=Ve.SemanticTokensRequest=Ve.TokenFormat=Ve.CallHierarchyPrepareRequest=Ve.CallHierarchyOutgoingCallsRequest=Ve.CallHierarchyIncomingCallsRequest=Ve.WorkDoneProgressCancelNotification=Ve.WorkDoneProgressCreateRequest=Ve.WorkDoneProgress=Ve.SelectionRangeRequest=Ve.DeclarationRequest=Ve.FoldingRangeRefreshRequest=Ve.FoldingRangeRequest=Ve.ColorPresentationRequest=Ve.DocumentColorRequest=Ve.ConfigurationRequest=Ve.DidChangeWorkspaceFoldersNotification=Ve.WorkspaceFoldersRequest=Ve.TypeDefinitionRequest=Ve.ImplementationRequest=Ve.ApplyWorkspaceEditRequest=Ve.ExecuteCommandRequest=Ve.PrepareRenameRequest=Ve.RenameRequest=Ve.PrepareSupportDefaultBehavior=Ve.DocumentOnTypeFormattingRequest=Ve.DocumentRangesFormattingRequest=Ve.DocumentRangeFormattingRequest=Ve.DocumentFormattingRequest=Ve.DocumentLinkResolveRequest=Ve.DocumentLinkRequest=Ve.CodeLensRefreshRequest=Ve.CodeLensResolveRequest=Ve.CodeLensRequest=Ve.WorkspaceSymbolResolveRequest=void 0;Ve.InlineCompletionRequest=Ve.DidCloseNotebookDocumentNotification=Ve.DidSaveNotebookDocumentNotification=Ve.DidChangeNotebookDocumentNotification=Ve.NotebookCellArrayChange=Ve.DidOpenNotebookDocumentNotification=Ve.NotebookDocumentSyncRegistrationType=Ve.NotebookDocument=Ve.NotebookCell=Ve.ExecutionSummary=Ve.NotebookCellKind=Ve.DiagnosticRefreshRequest=Ve.WorkspaceDiagnosticRequest=Ve.DocumentDiagnosticRequest=Ve.DocumentDiagnosticReportKind=Ve.DiagnosticServerCancellationData=Ve.InlayHintRefreshRequest=Ve.InlayHintResolveRequest=Ve.InlayHintRequest=Ve.InlineValueRefreshRequest=Ve.InlineValueRequest=Ve.TypeHierarchySupertypesRequest=Ve.TypeHierarchySubtypesRequest=Ve.TypeHierarchyPrepareRequest=void 0;var Rr=Hd(),sen=PSe(),a0=RQe(),nTo=PZr();Object.defineProperty(Ve,"ImplementationRequest",{enumerable:!0,get:a(function(){return nTo.ImplementationRequest},"get")});var iTo=MZr();Object.defineProperty(Ve,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return iTo.TypeDefinitionRequest},"get")});var htn=BZr();Object.defineProperty(Ve,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return htn.WorkspaceFoldersRequest},"get")});Object.defineProperty(Ve,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return htn.DidChangeWorkspaceFoldersNotification},"get")});var oTo=QZr();Object.defineProperty(Ve,"ConfigurationRequest",{enumerable:!0,get:a(function(){return oTo.ConfigurationRequest},"get")});var mtn=HZr();Object.defineProperty(Ve,"DocumentColorRequest",{enumerable:!0,get:a(function(){return mtn.DocumentColorRequest},"get")});Object.defineProperty(Ve,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return mtn.ColorPresentationRequest},"get")});var gtn=VZr();Object.defineProperty(Ve,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return gtn.FoldingRangeRequest},"get")});Object.defineProperty(Ve,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return gtn.FoldingRangeRefreshRequest},"get")});var sTo=YZr();Object.defineProperty(Ve,"DeclarationRequest",{enumerable:!0,get:a(function(){return sTo.DeclarationRequest},"get")});var aTo=ZZr();Object.defineProperty(Ve,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return aTo.SelectionRangeRequest},"get")});var mOt=rXr();Object.defineProperty(Ve,"WorkDoneProgress",{enumerable:!0,get:a(function(){return mOt.WorkDoneProgress},"get")});Object.defineProperty(Ve,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return mOt.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Ve,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return mOt.WorkDoneProgressCancelNotification},"get")});var gOt=sXr();Object.defineProperty(Ve,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return gOt.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return gOt.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return gOt.CallHierarchyPrepareRequest},"get")});var fae=fXr();Object.defineProperty(Ve,"TokenFormat",{enumerable:!0,get:a(function(){return fae.TokenFormat},"get")});Object.defineProperty(Ve,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return fae.SemanticTokensRequest},"get")});Object.defineProperty(Ve,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return fae.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return fae.SemanticTokensRangeRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return fae.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return fae.SemanticTokensRegistrationType},"get")});var cTo=mXr();Object.defineProperty(Ve,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return cTo.ShowDocumentRequest},"get")});var lTo=yXr();Object.defineProperty(Ve,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return lTo.LinkedEditingRangeRequest},"get")});var Bz=IXr();Object.defineProperty(Ve,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return Bz.FileOperationPatternKind},"get")});Object.defineProperty(Ve,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return Bz.DidCreateFilesNotification},"get")});Object.defineProperty(Ve,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return Bz.WillCreateFilesRequest},"get")});Object.defineProperty(Ve,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return Bz.DidRenameFilesNotification},"get")});Object.defineProperty(Ve,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return Bz.WillRenameFilesRequest},"get")});Object.defineProperty(Ve,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return Bz.DidDeleteFilesNotification},"get")});Object.defineProperty(Ve,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return Bz.WillDeleteFilesRequest},"get")});var AOt=PXr();Object.defineProperty(Ve,"UniquenessLevel",{enumerable:!0,get:a(function(){return AOt.UniquenessLevel},"get")});Object.defineProperty(Ve,"MonikerKind",{enumerable:!0,get:a(function(){return AOt.MonikerKind},"get")});Object.defineProperty(Ve,"MonikerRequest",{enumerable:!0,get:a(function(){return AOt.MonikerRequest},"get")});var yOt=OXr();Object.defineProperty(Ve,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return yOt.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return yOt.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return yOt.TypeHierarchySupertypesRequest},"get")});var Atn=FXr();Object.defineProperty(Ve,"InlineValueRequest",{enumerable:!0,get:a(function(){return Atn.InlineValueRequest},"get")});Object.defineProperty(Ve,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return Atn.InlineValueRefreshRequest},"get")});var _Ot=jXr();Object.defineProperty(Ve,"InlayHintRequest",{enumerable:!0,get:a(function(){return _Ot.InlayHintRequest},"get")});Object.defineProperty(Ve,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return _Ot.InlayHintResolveRequest},"get")});Object.defineProperty(Ve,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return _Ot.InlayHintRefreshRequest},"get")});var MSe=YXr();Object.defineProperty(Ve,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return MSe.DiagnosticServerCancellationData},"get")});Object.defineProperty(Ve,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return MSe.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Ve,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return MSe.DocumentDiagnosticRequest},"get")});Object.defineProperty(Ve,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return MSe.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Ve,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return MSe.DiagnosticRefreshRequest},"get")});var BM=ren();Object.defineProperty(Ve,"NotebookCellKind",{enumerable:!0,get:a(function(){return BM.NotebookCellKind},"get")});Object.defineProperty(Ve,"ExecutionSummary",{enumerable:!0,get:a(function(){return BM.ExecutionSummary},"get")});Object.defineProperty(Ve,"NotebookCell",{enumerable:!0,get:a(function(){return BM.NotebookCell},"get")});Object.defineProperty(Ve,"NotebookDocument",{enumerable:!0,get:a(function(){return BM.NotebookDocument},"get")});Object.defineProperty(Ve,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return BM.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Ve,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return BM.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return BM.NotebookCellArrayChange},"get")});Object.defineProperty(Ve,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return BM.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return BM.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return BM.DidCloseNotebookDocumentNotification},"get")});var uTo=oen();Object.defineProperty(Ve,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return uTo.InlineCompletionRequest},"get")});var dOt;(function(t){function e(r){let n=r;return a0.string(n)||a0.string(n.language)||a0.string(n.scheme)||a0.string(n.pattern)}a(e,"is"),t.is=e})(dOt||(Ve.TextDocumentFilter=dOt={}));var fOt;(function(t){function e(r){let n=r;return a0.objectLiteral(n)&&(a0.string(n.notebookType)||a0.string(n.scheme)||a0.string(n.pattern))}a(e,"is"),t.is=e})(fOt||(Ve.NotebookDocumentFilter=fOt={}));var pOt;(function(t){function e(r){let n=r;return a0.objectLiteral(n)&&(a0.string(n.notebook)||fOt.is(n.notebook))&&(n.language===void 0||a0.string(n.language))}a(e,"is"),t.is=e})(pOt||(Ve.NotebookCellTextDocumentFilter=pOt={}));var hOt;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!a0.string(n)&&!dOt.is(n)&&!pOt.is(n))return!1;return!0}a(e,"is"),t.is=e})(hOt||(Ve.DocumentSelector=hOt={}));var aen;(function(t){t.method="client/registerCapability",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolRequestType(t.method)})(aen||(Ve.RegistrationRequest=aen={}));var cen;(function(t){t.method="client/unregisterCapability",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolRequestType(t.method)})(cen||(Ve.UnregistrationRequest=cen={}));var len;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(len||(Ve.ResourceOperationKind=len={}));var uen;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(uen||(Ve.FailureHandlingKind=uen={}));var den;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(den||(Ve.PositionEncodingKind=den={}));var fen;(function(t){function e(r){let n=r;return n&&a0.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})(fen||(Ve.StaticRegistrationOptions=fen={}));var pen;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||hOt.is(n.documentSelector))}a(e,"is"),t.is=e})(pen||(Ve.TextDocumentRegistrationOptions=pen={}));var hen;(function(t){function e(n){let o=n;return a0.objectLiteral(o)&&(o.workDoneProgress===void 0||a0.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&a0.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(hen||(Ve.WorkDoneProgressOptions=hen={}));var men;(function(t){t.method="initialize",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(men||(Ve.InitializeRequest=men={}));var gen;(function(t){t.unknownProtocolVersion=1})(gen||(Ve.InitializeErrorCodes=gen={}));var Aen;(function(t){t.method="initialized",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(Aen||(Ve.InitializedNotification=Aen={}));var yen;(function(t){t.method="shutdown",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType0(t.method)})(yen||(Ve.ShutdownRequest=yen={}));var _en;(function(t){t.method="exit",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType0(t.method)})(_en||(Ve.ExitNotification=_en={}));var Een;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(Een||(Ve.DidChangeConfigurationNotification=Een={}));var ven;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(ven||(Ve.MessageType=ven={}));var Cen;(function(t){t.method="window/showMessage",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolNotificationType(t.method)})(Cen||(Ve.ShowMessageNotification=Cen={}));var ben;(function(t){t.method="window/showMessageRequest",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolRequestType(t.method)})(ben||(Ve.ShowMessageRequest=ben={}));var Sen;(function(t){t.method="window/logMessage",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolNotificationType(t.method)})(Sen||(Ve.LogMessageNotification=Sen={}));var Ten;(function(t){t.method="telemetry/event",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolNotificationType(t.method)})(Ten||(Ve.TelemetryEventNotification=Ten={}));var Ien;(function(t){t.None=0,t.Full=1,t.Incremental=2})(Ien||(Ve.TextDocumentSyncKind=Ien={}));var xen;(function(t){t.method="textDocument/didOpen",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(xen||(Ve.DidOpenTextDocumentNotification=xen={}));var wen;(function(t){function e(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range!==void 0&&(o.rangeLength===void 0||typeof o.rangeLength=="number")}a(e,"isIncremental"),t.isIncremental=e;function r(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range===void 0&&o.rangeLength===void 0}a(r,"isFull"),t.isFull=r})(wen||(Ve.TextDocumentContentChangeEvent=wen={}));var Ren;(function(t){t.method="textDocument/didChange",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(Ren||(Ve.DidChangeTextDocumentNotification=Ren={}));var ken;(function(t){t.method="textDocument/didClose",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(ken||(Ve.DidCloseTextDocumentNotification=ken={}));var Pen;(function(t){t.method="textDocument/didSave",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(Pen||(Ve.DidSaveTextDocumentNotification=Pen={}));var Den;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(Den||(Ve.TextDocumentSaveReason=Den={}));var Nen;(function(t){t.method="textDocument/willSave",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(Nen||(Ve.WillSaveTextDocumentNotification=Nen={}));var Men;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Men||(Ve.WillSaveTextDocumentWaitUntilRequest=Men={}));var Oen;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(Oen||(Ve.DidChangeWatchedFilesNotification=Oen={}));var Len;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Len||(Ve.FileChangeType=Len={}));var Ben;(function(t){function e(r){let n=r;return a0.objectLiteral(n)&&(sen.URI.is(n.baseUri)||sen.WorkspaceFolder.is(n.baseUri))&&a0.string(n.pattern)}a(e,"is"),t.is=e})(Ben||(Ve.RelativePattern=Ben={}));var Fen;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Fen||(Ve.WatchKind=Fen={}));var Uen;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolNotificationType(t.method)})(Uen||(Ve.PublishDiagnosticsNotification=Uen={}));var Qen;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Qen||(Ve.CompletionTriggerKind=Qen={}));var qen;(function(t){t.method="textDocument/completion",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(qen||(Ve.CompletionRequest=qen={}));var jen;(function(t){t.method="completionItem/resolve",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(jen||(Ve.CompletionResolveRequest=jen={}));var Hen;(function(t){t.method="textDocument/hover",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Hen||(Ve.HoverRequest=Hen={}));var Gen;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Gen||(Ve.SignatureHelpTriggerKind=Gen={}));var $en;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})($en||(Ve.SignatureHelpRequest=$en={}));var Ven;(function(t){t.method="textDocument/definition",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Ven||(Ve.DefinitionRequest=Ven={}));var Wen;(function(t){t.method="textDocument/references",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Wen||(Ve.ReferencesRequest=Wen={}));var zen;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(zen||(Ve.DocumentHighlightRequest=zen={}));var Yen;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Yen||(Ve.DocumentSymbolRequest=Yen={}));var Ken;(function(t){t.method="textDocument/codeAction",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Ken||(Ve.CodeActionRequest=Ken={}));var Jen;(function(t){t.method="codeAction/resolve",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Jen||(Ve.CodeActionResolveRequest=Jen={}));var Zen;(function(t){t.method="workspace/symbol",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Zen||(Ve.WorkspaceSymbolRequest=Zen={}));var Xen;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Xen||(Ve.WorkspaceSymbolResolveRequest=Xen={}));var etn;(function(t){t.method="textDocument/codeLens",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(etn||(Ve.CodeLensRequest=etn={}));var ttn;(function(t){t.method="codeLens/resolve",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(ttn||(Ve.CodeLensResolveRequest=ttn={}));var rtn;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolRequestType0(t.method)})(rtn||(Ve.CodeLensRefreshRequest=rtn={}));var ntn;(function(t){t.method="textDocument/documentLink",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(ntn||(Ve.DocumentLinkRequest=ntn={}));var itn;(function(t){t.method="documentLink/resolve",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(itn||(Ve.DocumentLinkResolveRequest=itn={}));var otn;(function(t){t.method="textDocument/formatting",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(otn||(Ve.DocumentFormattingRequest=otn={}));var stn;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(stn||(Ve.DocumentRangeFormattingRequest=stn={}));var atn;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(atn||(Ve.DocumentRangesFormattingRequest=atn={}));var ctn;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(ctn||(Ve.DocumentOnTypeFormattingRequest=ctn={}));var ltn;(function(t){t.Identifier=1})(ltn||(Ve.PrepareSupportDefaultBehavior=ltn={}));var utn;(function(t){t.method="textDocument/rename",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(utn||(Ve.RenameRequest=utn={}));var dtn;(function(t){t.method="textDocument/prepareRename",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(dtn||(Ve.PrepareRenameRequest=dtn={}));var ftn;(function(t){t.method="workspace/executeCommand",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(ftn||(Ve.ExecuteCommandRequest=ftn={}));var ptn;(function(t){t.method="workspace/applyEdit",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolRequestType("workspace/applyEdit")})(ptn||(Ve.ApplyWorkspaceEditRequest=ptn={}))});var Etn=I(GQe=>{"use strict";p();Object.defineProperty(GQe,"__esModule",{value:!0});GQe.createProtocolConnection=void 0;var _tn=Lz();function dTo(t,e,r,n){return _tn.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,_tn.createMessageConnection)(t,e,r,n)}a(dTo,"createProtocolConnection");GQe.createProtocolConnection=dTo});var Ctn=I(PC=>{"use strict";p();var fTo=PC&&PC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Qe=PC&&PC.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fTo(e,t,r)};Object.defineProperty(PC,"__esModule",{value:!0});PC.LSPErrorCodes=PC.createProtocolConnection=void 0;$Qe(Lz(),PC);$Qe(PSe(),PC);$Qe(Hd(),PC);$Qe(ytn(),PC);var pTo=Etn();Object.defineProperty(PC,"createProtocolConnection",{enumerable:!0,get:a(function(){return pTo.createProtocolConnection},"get")});var vtn;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(vtn||(PC.LSPErrorCodes=vtn={}))});var ii=I(FM=>{"use strict";p();var hTo=FM&&FM.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),btn=FM&&FM.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hTo(e,t,r)};Object.defineProperty(FM,"__esModule",{value:!0});FM.createProtocolConnection=void 0;var mTo=nOt();btn(nOt(),FM);btn(Ctn(),FM);function gTo(t,e,r,n){return(0,mTo.createMessageConnection)(t,e,r,n)}a(gTo,"createProtocolConnection");FM.createProtocolConnection=gTo});var SBt=I(bGe=>{"use strict";p();Object.defineProperty(bGe,"__esModule",{value:!0});bGe.state=void 0;bGe.state={instrumenterImplementation:void 0}});var yle=I((n8t,Scn)=>{p();var b$e=require("buffer"),CO=b$e.Buffer;function bcn(t,e){for(var r in t)e[r]=t[r]}a(bcn,"copyProps");CO.from&&CO.alloc&&CO.allocUnsafe&&CO.allocUnsafeSlow?Scn.exports=b$e:(bcn(b$e,n8t),n8t.Buffer=AK);function AK(t,e,r){return CO(t,e,r)}a(AK,"SafeBuffer");AK.prototype=Object.create(CO.prototype);bcn(CO,AK);AK.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return CO(t,e,r)};AK.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=CO(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};AK.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return CO(t)};AK.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return b$e.SlowBuffer(t)}});var i8t=I((Gcu,Tcn)=>{p();var S$e=yle().Buffer,DDo=require("stream"),NDo=require("util");function T$e(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=S$e.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=S$e.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}a(T$e,"DataStream");NDo.inherits(T$e,DDo);T$e.prototype.write=a(function(e){this.buffer=S$e.concat([this.buffer,S$e.from(e)]),this.emit("data",e)},"write");T$e.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");Tcn.exports=T$e});var xcn=I((Wcu,Icn)=>{"use strict";p();function o8t(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(o8t,"getParamSize");var MDo={ES256:o8t(256),ES384:o8t(384),ES512:o8t(521)};function ODo(t){var e=MDo[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(ODo,"getParamBytesForAlg");Icn.exports=ODo});var Mcn=I((Kcu,Ncn)=>{"use strict";p();var I$e=yle().Buffer,Rcn=xcn(),x$e=128,kcn=0,LDo=32,BDo=16,FDo=2,Pcn=BDo|LDo|kcn<<6,w$e=FDo|kcn<<6;function UDo(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(UDo,"base64Url");function Dcn(t){if(I$e.isBuffer(t))return t;if(typeof t=="string")return I$e.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(Dcn,"signatureAsBuffer");function QDo(t,e){t=Dcn(t);var r=Rcn(e),n=r+1,o=t.length,s=0;if(t[s++]!==Pcn)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(x$e|1)&&(c=t[s++]),o-s=x$e;return o&&--n,n}a(wcn,"countPadding");function qDo(t,e){t=Dcn(t);var r=Rcn(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=wcn(t,0,r),s=wcn(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var PIe=require("buffer").Buffer,s8t=require("buffer").SlowBuffer;Ocn.exports=R$e;function R$e(t,e){if(!PIe.isBuffer(t)||!PIe.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var Ele=yle().Buffer,ew=require("crypto"),Fcn=Mcn(),Bcn=require("util"),GDo=`"%s" is not a valid algorithm. +`&&oe++}ye&&Me.length>0&&Pe.push(Me.length),this._lineOffsets=Pe}return this._lineOffsets},ce.prototype.positionAt=function(Pe){Pe=Math.max(Math.min(Pe,this._content.length),0);var Me=this.getLineOffsets(),ye=0,oe=Me.length;if(oe===0)return c.create(0,Pe);for(;yePe?oe=Ke:ye=Ke+1}var lt=ye-1;return c.create(lt,Pe-Me[lt])},ce.prototype.offsetAt=function(Pe){var Me=this.getLineOffsets();if(Pe.line>=Me.length)return this._content.length;if(Pe.line<0)return 0;var ye=Me[Pe.line],oe=Pe.line+1"u"}a(ye,"undefined"),ce.undefined=ye;function oe(zt){return zt===!0||zt===!1}a(oe,"boolean"),ce.boolean=oe;function Ke(zt){return Pe.call(zt)==="[object String]"}a(Ke,"string"),ce.string=Ke;function lt(zt){return Pe.call(zt)==="[object Number]"}a(lt,"number"),ce.number=lt;function Gt(zt,Tr,t0){return Pe.call(zt)==="[object Number]"&&Tr<=zt&&zt<=t0}a(Gt,"numberRange"),ce.numberRange=Gt;function Er(zt){return Pe.call(zt)==="[object Number]"&&-2147483648<=zt&&zt<=2147483647}a(Er,"integer"),ce.integer=Er;function dr(zt){return Pe.call(zt)==="[object Number]"&&0<=zt&&zt<=2147483647}a(dr,"uinteger"),ce.uinteger=dr;function Ur(zt){return Pe.call(zt)==="[object Function]"}a(Ur,"func"),ce.func=Ur;function Wr(zt){return zt!==null&&typeof zt=="object"}a(Wr,"objectLiteral"),ce.objectLiteral=Wr;function zr(zt,Tr){return Array.isArray(zt)&&zt.every(Tr)}a(zr,"typedArray"),ce.typedArray=zr})(We||(We={}))})});var Gd=I(RC=>{"use strict";p();Object.defineProperty(RC,"__esModule",{value:!0});RC.ProtocolNotificationType=RC.ProtocolNotificationType0=RC.ProtocolRequestType=RC.ProtocolRequestType0=RC.RegistrationType=RC.MessageDirection=void 0;var nae=Bz(),xZr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(xZr||(RC.MessageDirection=xZr={}));var oOt=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};RC.RegistrationType=oOt;var sOt=class extends nae.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};RC.ProtocolRequestType0=sOt;var aOt=class extends nae.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,nae.ParameterStructures.byName)}};RC.ProtocolRequestType=aOt;var cOt=class extends nae.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};RC.ProtocolNotificationType0=cOt;var lOt=class extends nae.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,nae.ParameterStructures.byName)}};RC.ProtocolNotificationType=lOt});var RQe=I(Gh=>{"use strict";p();Object.defineProperty(Gh,"__esModule",{value:!0});Gh.objectLiteral=Gh.typedArray=Gh.stringArray=Gh.array=Gh.func=Gh.error=Gh.number=Gh.string=Gh.boolean=void 0;function K1o(t){return t===!0||t===!1}a(K1o,"boolean");Gh.boolean=K1o;function wZr(t){return typeof t=="string"||t instanceof String}a(wZr,"string");Gh.string=wZr;function J1o(t){return typeof t=="number"||t instanceof Number}a(J1o,"number");Gh.number=J1o;function Z1o(t){return t instanceof Error}a(Z1o,"error");Gh.error=Z1o;function X1o(t){return typeof t=="function"}a(X1o,"func");Gh.func=X1o;function RZr(t){return Array.isArray(t)}a(RZr,"array");Gh.array=RZr;function eTo(t){return RZr(t)&&t.every(e=>wZr(e))}a(eTo,"stringArray");Gh.stringArray=eTo;function tTo(t,e){return Array.isArray(t)&&t.every(e)}a(tTo,"typedArray");Gh.typedArray=tTo;function rTo(t){return t!==null&&typeof t=="object"}a(rTo,"objectLiteral");Gh.objectLiteral=rTo});var DZr=I(kQe=>{"use strict";p();Object.defineProperty(kQe,"__esModule",{value:!0});kQe.ImplementationRequest=void 0;var kZr=Gd(),PZr;(function(t){t.method="textDocument/implementation",t.messageDirection=kZr.MessageDirection.clientToServer,t.type=new kZr.ProtocolRequestType(t.method)})(PZr||(kQe.ImplementationRequest=PZr={}))});var OZr=I(PQe=>{"use strict";p();Object.defineProperty(PQe,"__esModule",{value:!0});PQe.TypeDefinitionRequest=void 0;var NZr=Gd(),MZr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=NZr.MessageDirection.clientToServer,t.type=new NZr.ProtocolRequestType(t.method)})(MZr||(PQe.TypeDefinitionRequest=MZr={}))});var FZr=I(iae=>{"use strict";p();Object.defineProperty(iae,"__esModule",{value:!0});iae.DidChangeWorkspaceFoldersNotification=iae.WorkspaceFoldersRequest=void 0;var DQe=Gd(),LZr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=DQe.MessageDirection.serverToClient,t.type=new DQe.ProtocolRequestType0(t.method)})(LZr||(iae.WorkspaceFoldersRequest=LZr={}));var BZr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=DQe.MessageDirection.clientToServer,t.type=new DQe.ProtocolNotificationType(t.method)})(BZr||(iae.DidChangeWorkspaceFoldersNotification=BZr={}))});var qZr=I(NQe=>{"use strict";p();Object.defineProperty(NQe,"__esModule",{value:!0});NQe.ConfigurationRequest=void 0;var UZr=Gd(),QZr;(function(t){t.method="workspace/configuration",t.messageDirection=UZr.MessageDirection.serverToClient,t.type=new UZr.ProtocolRequestType(t.method)})(QZr||(NQe.ConfigurationRequest=QZr={}))});var GZr=I(oae=>{"use strict";p();Object.defineProperty(oae,"__esModule",{value:!0});oae.ColorPresentationRequest=oae.DocumentColorRequest=void 0;var MQe=Gd(),jZr;(function(t){t.method="textDocument/documentColor",t.messageDirection=MQe.MessageDirection.clientToServer,t.type=new MQe.ProtocolRequestType(t.method)})(jZr||(oae.DocumentColorRequest=jZr={}));var HZr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=MQe.MessageDirection.clientToServer,t.type=new MQe.ProtocolRequestType(t.method)})(HZr||(oae.ColorPresentationRequest=HZr={}))});var WZr=I(sae=>{"use strict";p();Object.defineProperty(sae,"__esModule",{value:!0});sae.FoldingRangeRefreshRequest=sae.FoldingRangeRequest=void 0;var OQe=Gd(),$Zr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=OQe.MessageDirection.clientToServer,t.type=new OQe.ProtocolRequestType(t.method)})($Zr||(sae.FoldingRangeRequest=$Zr={}));var VZr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=OQe.MessageDirection.serverToClient,t.type=new OQe.ProtocolRequestType0(t.method)})(VZr||(sae.FoldingRangeRefreshRequest=VZr={}))});var KZr=I(LQe=>{"use strict";p();Object.defineProperty(LQe,"__esModule",{value:!0});LQe.DeclarationRequest=void 0;var zZr=Gd(),YZr;(function(t){t.method="textDocument/declaration",t.messageDirection=zZr.MessageDirection.clientToServer,t.type=new zZr.ProtocolRequestType(t.method)})(YZr||(LQe.DeclarationRequest=YZr={}))});var XZr=I(BQe=>{"use strict";p();Object.defineProperty(BQe,"__esModule",{value:!0});BQe.SelectionRangeRequest=void 0;var JZr=Gd(),ZZr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=JZr.MessageDirection.clientToServer,t.type=new JZr.ProtocolRequestType(t.method)})(ZZr||(BQe.SelectionRangeRequest=ZZr={}))});var nXr=I(h7=>{"use strict";p();Object.defineProperty(h7,"__esModule",{value:!0});h7.WorkDoneProgressCancelNotification=h7.WorkDoneProgressCreateRequest=h7.WorkDoneProgress=void 0;var nTo=Bz(),FQe=Gd(),eXr;(function(t){t.type=new nTo.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(eXr||(h7.WorkDoneProgress=eXr={}));var tXr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=FQe.MessageDirection.serverToClient,t.type=new FQe.ProtocolRequestType(t.method)})(tXr||(h7.WorkDoneProgressCreateRequest=tXr={}));var rXr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=FQe.MessageDirection.clientToServer,t.type=new FQe.ProtocolNotificationType(t.method)})(rXr||(h7.WorkDoneProgressCancelNotification=rXr={}))});var aXr=I(m7=>{"use strict";p();Object.defineProperty(m7,"__esModule",{value:!0});m7.CallHierarchyOutgoingCallsRequest=m7.CallHierarchyIncomingCallsRequest=m7.CallHierarchyPrepareRequest=void 0;var aae=Gd(),iXr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=aae.MessageDirection.clientToServer,t.type=new aae.ProtocolRequestType(t.method)})(iXr||(m7.CallHierarchyPrepareRequest=iXr={}));var oXr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=aae.MessageDirection.clientToServer,t.type=new aae.ProtocolRequestType(t.method)})(oXr||(m7.CallHierarchyIncomingCallsRequest=oXr={}));var sXr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=aae.MessageDirection.clientToServer,t.type=new aae.ProtocolRequestType(t.method)})(sXr||(m7.CallHierarchyOutgoingCallsRequest=sXr={}))});var pXr=I(kC=>{"use strict";p();Object.defineProperty(kC,"__esModule",{value:!0});kC.SemanticTokensRefreshRequest=kC.SemanticTokensRangeRequest=kC.SemanticTokensDeltaRequest=kC.SemanticTokensRequest=kC.SemanticTokensRegistrationType=kC.TokenFormat=void 0;var r3=Gd(),cXr;(function(t){t.Relative="relative"})(cXr||(kC.TokenFormat=cXr={}));var DSe;(function(t){t.method="textDocument/semanticTokens",t.type=new r3.RegistrationType(t.method)})(DSe||(kC.SemanticTokensRegistrationType=DSe={}));var lXr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=r3.MessageDirection.clientToServer,t.type=new r3.ProtocolRequestType(t.method),t.registrationMethod=DSe.method})(lXr||(kC.SemanticTokensRequest=lXr={}));var uXr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=r3.MessageDirection.clientToServer,t.type=new r3.ProtocolRequestType(t.method),t.registrationMethod=DSe.method})(uXr||(kC.SemanticTokensDeltaRequest=uXr={}));var dXr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=r3.MessageDirection.clientToServer,t.type=new r3.ProtocolRequestType(t.method),t.registrationMethod=DSe.method})(dXr||(kC.SemanticTokensRangeRequest=dXr={}));var fXr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=r3.MessageDirection.serverToClient,t.type=new r3.ProtocolRequestType0(t.method)})(fXr||(kC.SemanticTokensRefreshRequest=fXr={}))});var gXr=I(UQe=>{"use strict";p();Object.defineProperty(UQe,"__esModule",{value:!0});UQe.ShowDocumentRequest=void 0;var hXr=Gd(),mXr;(function(t){t.method="window/showDocument",t.messageDirection=hXr.MessageDirection.serverToClient,t.type=new hXr.ProtocolRequestType(t.method)})(mXr||(UQe.ShowDocumentRequest=mXr={}))});var _Xr=I(QQe=>{"use strict";p();Object.defineProperty(QQe,"__esModule",{value:!0});QQe.LinkedEditingRangeRequest=void 0;var AXr=Gd(),yXr;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=AXr.MessageDirection.clientToServer,t.type=new AXr.ProtocolRequestType(t.method)})(yXr||(QQe.LinkedEditingRangeRequest=yXr={}))});var xXr=I(o_=>{"use strict";p();Object.defineProperty(o_,"__esModule",{value:!0});o_.WillDeleteFilesRequest=o_.DidDeleteFilesNotification=o_.DidRenameFilesNotification=o_.WillRenameFilesRequest=o_.DidCreateFilesNotification=o_.WillCreateFilesRequest=o_.FileOperationPatternKind=void 0;var bx=Gd(),EXr;(function(t){t.file="file",t.folder="folder"})(EXr||(o_.FileOperationPatternKind=EXr={}));var vXr;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolRequestType(t.method)})(vXr||(o_.WillCreateFilesRequest=vXr={}));var CXr;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolNotificationType(t.method)})(CXr||(o_.DidCreateFilesNotification=CXr={}));var bXr;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolRequestType(t.method)})(bXr||(o_.WillRenameFilesRequest=bXr={}));var SXr;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolNotificationType(t.method)})(SXr||(o_.DidRenameFilesNotification=SXr={}));var TXr;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolNotificationType(t.method)})(TXr||(o_.DidDeleteFilesNotification=TXr={}));var IXr;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolRequestType(t.method)})(IXr||(o_.WillDeleteFilesRequest=IXr={}))});var DXr=I(g7=>{"use strict";p();Object.defineProperty(g7,"__esModule",{value:!0});g7.MonikerRequest=g7.MonikerKind=g7.UniquenessLevel=void 0;var wXr=Gd(),RXr;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(RXr||(g7.UniquenessLevel=RXr={}));var kXr;(function(t){t.$import="import",t.$export="export",t.local="local"})(kXr||(g7.MonikerKind=kXr={}));var PXr;(function(t){t.method="textDocument/moniker",t.messageDirection=wXr.MessageDirection.clientToServer,t.type=new wXr.ProtocolRequestType(t.method)})(PXr||(g7.MonikerRequest=PXr={}))});var LXr=I(A7=>{"use strict";p();Object.defineProperty(A7,"__esModule",{value:!0});A7.TypeHierarchySubtypesRequest=A7.TypeHierarchySupertypesRequest=A7.TypeHierarchyPrepareRequest=void 0;var cae=Gd(),NXr;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=cae.MessageDirection.clientToServer,t.type=new cae.ProtocolRequestType(t.method)})(NXr||(A7.TypeHierarchyPrepareRequest=NXr={}));var MXr;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=cae.MessageDirection.clientToServer,t.type=new cae.ProtocolRequestType(t.method)})(MXr||(A7.TypeHierarchySupertypesRequest=MXr={}));var OXr;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=cae.MessageDirection.clientToServer,t.type=new cae.ProtocolRequestType(t.method)})(OXr||(A7.TypeHierarchySubtypesRequest=OXr={}))});var UXr=I(lae=>{"use strict";p();Object.defineProperty(lae,"__esModule",{value:!0});lae.InlineValueRefreshRequest=lae.InlineValueRequest=void 0;var qQe=Gd(),BXr;(function(t){t.method="textDocument/inlineValue",t.messageDirection=qQe.MessageDirection.clientToServer,t.type=new qQe.ProtocolRequestType(t.method)})(BXr||(lae.InlineValueRequest=BXr={}));var FXr;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=qQe.MessageDirection.serverToClient,t.type=new qQe.ProtocolRequestType0(t.method)})(FXr||(lae.InlineValueRefreshRequest=FXr={}))});var HXr=I(y7=>{"use strict";p();Object.defineProperty(y7,"__esModule",{value:!0});y7.InlayHintRefreshRequest=y7.InlayHintResolveRequest=y7.InlayHintRequest=void 0;var uae=Gd(),QXr;(function(t){t.method="textDocument/inlayHint",t.messageDirection=uae.MessageDirection.clientToServer,t.type=new uae.ProtocolRequestType(t.method)})(QXr||(y7.InlayHintRequest=QXr={}));var qXr;(function(t){t.method="inlayHint/resolve",t.messageDirection=uae.MessageDirection.clientToServer,t.type=new uae.ProtocolRequestType(t.method)})(qXr||(y7.InlayHintResolveRequest=qXr={}));var jXr;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=uae.MessageDirection.serverToClient,t.type=new uae.ProtocolRequestType0(t.method)})(jXr||(y7.InlayHintRefreshRequest=jXr={}))});var KXr=I(Sx=>{"use strict";p();Object.defineProperty(Sx,"__esModule",{value:!0});Sx.DiagnosticRefreshRequest=Sx.WorkspaceDiagnosticRequest=Sx.DocumentDiagnosticRequest=Sx.DocumentDiagnosticReportKind=Sx.DiagnosticServerCancellationData=void 0;var YXr=Bz(),iTo=RQe(),dae=Gd(),GXr;(function(t){function e(r){let n=r;return n&&iTo.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})(GXr||(Sx.DiagnosticServerCancellationData=GXr={}));var $Xr;(function(t){t.Full="full",t.Unchanged="unchanged"})($Xr||(Sx.DocumentDiagnosticReportKind=$Xr={}));var VXr;(function(t){t.method="textDocument/diagnostic",t.messageDirection=dae.MessageDirection.clientToServer,t.type=new dae.ProtocolRequestType(t.method),t.partialResult=new YXr.ProgressType})(VXr||(Sx.DocumentDiagnosticRequest=VXr={}));var WXr;(function(t){t.method="workspace/diagnostic",t.messageDirection=dae.MessageDirection.clientToServer,t.type=new dae.ProtocolRequestType(t.method),t.partialResult=new YXr.ProgressType})(WXr||(Sx.WorkspaceDiagnosticRequest=WXr={}));var zXr;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=dae.MessageDirection.serverToClient,t.type=new dae.ProtocolRequestType0(t.method)})(zXr||(Sx.DiagnosticRefreshRequest=zXr={}))});var nen=I(Xf=>{"use strict";p();Object.defineProperty(Xf,"__esModule",{value:!0});Xf.DidCloseNotebookDocumentNotification=Xf.DidSaveNotebookDocumentNotification=Xf.DidChangeNotebookDocumentNotification=Xf.NotebookCellArrayChange=Xf.DidOpenNotebookDocumentNotification=Xf.NotebookDocumentSyncRegistrationType=Xf.NotebookDocument=Xf.NotebookCell=Xf.ExecutionSummary=Xf.NotebookCellKind=void 0;var NSe=PSe(),CP=RQe(),LM=Gd(),uOt;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(uOt||(Xf.NotebookCellKind=uOt={}));var dOt;(function(t){function e(o,s){let c={executionOrder:o};return(s===!0||s===!1)&&(c.success=s),c}a(e,"create"),t.create=e;function r(o){let s=o;return CP.objectLiteral(s)&&NSe.uinteger.is(s.executionOrder)&&(s.success===void 0||CP.boolean(s.success))}a(r,"is"),t.is=r;function n(o,s){return o===s?!0:o==null||s===null||s===void 0?!1:o.executionOrder===s.executionOrder&&o.success===s.success}a(n,"equals"),t.equals=n})(dOt||(Xf.ExecutionSummary=dOt={}));var jQe;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return CP.objectLiteral(c)&&uOt.is(c.kind)&&NSe.DocumentUri.is(c.document)&&(c.metadata===void 0||CP.objectLiteral(c.metadata))}a(r,"is"),t.is=r;function n(s,c){let l=new Set;return s.document!==c.document&&l.add("document"),s.kind!==c.kind&&l.add("kind"),s.executionSummary!==c.executionSummary&&l.add("executionSummary"),(s.metadata!==void 0||c.metadata!==void 0)&&!o(s.metadata,c.metadata)&&l.add("metadata"),(s.executionSummary!==void 0||c.executionSummary!==void 0)&&!dOt.equals(s.executionSummary,c.executionSummary)&&l.add("executionSummary"),l}a(n,"diff"),t.diff=n;function o(s,c){if(s===c)return!0;if(s==null||c===null||c===void 0||typeof s!=typeof c||typeof s!="object")return!1;let l=Array.isArray(s),u=Array.isArray(c);if(l!==u)return!1;if(l&&u){if(s.length!==c.length)return!1;for(let d=0;d{"use strict";p();Object.defineProperty(HQe,"__esModule",{value:!0});HQe.InlineCompletionRequest=void 0;var ien=Gd(),oen;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=ien.MessageDirection.clientToServer,t.type=new ien.ProtocolRequestType(t.method)})(oen||(HQe.InlineCompletionRequest=oen={}))});var _tn=I(Ve=>{"use strict";p();Object.defineProperty(Ve,"__esModule",{value:!0});Ve.WorkspaceSymbolRequest=Ve.CodeActionResolveRequest=Ve.CodeActionRequest=Ve.DocumentSymbolRequest=Ve.DocumentHighlightRequest=Ve.ReferencesRequest=Ve.DefinitionRequest=Ve.SignatureHelpRequest=Ve.SignatureHelpTriggerKind=Ve.HoverRequest=Ve.CompletionResolveRequest=Ve.CompletionRequest=Ve.CompletionTriggerKind=Ve.PublishDiagnosticsNotification=Ve.WatchKind=Ve.RelativePattern=Ve.FileChangeType=Ve.DidChangeWatchedFilesNotification=Ve.WillSaveTextDocumentWaitUntilRequest=Ve.WillSaveTextDocumentNotification=Ve.TextDocumentSaveReason=Ve.DidSaveTextDocumentNotification=Ve.DidCloseTextDocumentNotification=Ve.DidChangeTextDocumentNotification=Ve.TextDocumentContentChangeEvent=Ve.DidOpenTextDocumentNotification=Ve.TextDocumentSyncKind=Ve.TelemetryEventNotification=Ve.LogMessageNotification=Ve.ShowMessageRequest=Ve.ShowMessageNotification=Ve.MessageType=Ve.DidChangeConfigurationNotification=Ve.ExitNotification=Ve.ShutdownRequest=Ve.InitializedNotification=Ve.InitializeErrorCodes=Ve.InitializeRequest=Ve.WorkDoneProgressOptions=Ve.TextDocumentRegistrationOptions=Ve.StaticRegistrationOptions=Ve.PositionEncodingKind=Ve.FailureHandlingKind=Ve.ResourceOperationKind=Ve.UnregistrationRequest=Ve.RegistrationRequest=Ve.DocumentSelector=Ve.NotebookCellTextDocumentFilter=Ve.NotebookDocumentFilter=Ve.TextDocumentFilter=void 0;Ve.MonikerRequest=Ve.MonikerKind=Ve.UniquenessLevel=Ve.WillDeleteFilesRequest=Ve.DidDeleteFilesNotification=Ve.WillRenameFilesRequest=Ve.DidRenameFilesNotification=Ve.WillCreateFilesRequest=Ve.DidCreateFilesNotification=Ve.FileOperationPatternKind=Ve.LinkedEditingRangeRequest=Ve.ShowDocumentRequest=Ve.SemanticTokensRegistrationType=Ve.SemanticTokensRefreshRequest=Ve.SemanticTokensRangeRequest=Ve.SemanticTokensDeltaRequest=Ve.SemanticTokensRequest=Ve.TokenFormat=Ve.CallHierarchyPrepareRequest=Ve.CallHierarchyOutgoingCallsRequest=Ve.CallHierarchyIncomingCallsRequest=Ve.WorkDoneProgressCancelNotification=Ve.WorkDoneProgressCreateRequest=Ve.WorkDoneProgress=Ve.SelectionRangeRequest=Ve.DeclarationRequest=Ve.FoldingRangeRefreshRequest=Ve.FoldingRangeRequest=Ve.ColorPresentationRequest=Ve.DocumentColorRequest=Ve.ConfigurationRequest=Ve.DidChangeWorkspaceFoldersNotification=Ve.WorkspaceFoldersRequest=Ve.TypeDefinitionRequest=Ve.ImplementationRequest=Ve.ApplyWorkspaceEditRequest=Ve.ExecuteCommandRequest=Ve.PrepareRenameRequest=Ve.RenameRequest=Ve.PrepareSupportDefaultBehavior=Ve.DocumentOnTypeFormattingRequest=Ve.DocumentRangesFormattingRequest=Ve.DocumentRangeFormattingRequest=Ve.DocumentFormattingRequest=Ve.DocumentLinkResolveRequest=Ve.DocumentLinkRequest=Ve.CodeLensRefreshRequest=Ve.CodeLensResolveRequest=Ve.CodeLensRequest=Ve.WorkspaceSymbolResolveRequest=void 0;Ve.InlineCompletionRequest=Ve.DidCloseNotebookDocumentNotification=Ve.DidSaveNotebookDocumentNotification=Ve.DidChangeNotebookDocumentNotification=Ve.NotebookCellArrayChange=Ve.DidOpenNotebookDocumentNotification=Ve.NotebookDocumentSyncRegistrationType=Ve.NotebookDocument=Ve.NotebookCell=Ve.ExecutionSummary=Ve.NotebookCellKind=Ve.DiagnosticRefreshRequest=Ve.WorkspaceDiagnosticRequest=Ve.DocumentDiagnosticRequest=Ve.DocumentDiagnosticReportKind=Ve.DiagnosticServerCancellationData=Ve.InlayHintRefreshRequest=Ve.InlayHintResolveRequest=Ve.InlayHintRequest=Ve.InlineValueRefreshRequest=Ve.InlineValueRequest=Ve.TypeHierarchySupertypesRequest=Ve.TypeHierarchySubtypesRequest=Ve.TypeHierarchyPrepareRequest=void 0;var Rr=Gd(),aen=PSe(),c0=RQe(),oTo=DZr();Object.defineProperty(Ve,"ImplementationRequest",{enumerable:!0,get:a(function(){return oTo.ImplementationRequest},"get")});var sTo=OZr();Object.defineProperty(Ve,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return sTo.TypeDefinitionRequest},"get")});var mtn=FZr();Object.defineProperty(Ve,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return mtn.WorkspaceFoldersRequest},"get")});Object.defineProperty(Ve,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return mtn.DidChangeWorkspaceFoldersNotification},"get")});var aTo=qZr();Object.defineProperty(Ve,"ConfigurationRequest",{enumerable:!0,get:a(function(){return aTo.ConfigurationRequest},"get")});var gtn=GZr();Object.defineProperty(Ve,"DocumentColorRequest",{enumerable:!0,get:a(function(){return gtn.DocumentColorRequest},"get")});Object.defineProperty(Ve,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return gtn.ColorPresentationRequest},"get")});var Atn=WZr();Object.defineProperty(Ve,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return Atn.FoldingRangeRequest},"get")});Object.defineProperty(Ve,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return Atn.FoldingRangeRefreshRequest},"get")});var cTo=KZr();Object.defineProperty(Ve,"DeclarationRequest",{enumerable:!0,get:a(function(){return cTo.DeclarationRequest},"get")});var lTo=XZr();Object.defineProperty(Ve,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return lTo.SelectionRangeRequest},"get")});var gOt=nXr();Object.defineProperty(Ve,"WorkDoneProgress",{enumerable:!0,get:a(function(){return gOt.WorkDoneProgress},"get")});Object.defineProperty(Ve,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return gOt.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Ve,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return gOt.WorkDoneProgressCancelNotification},"get")});var AOt=aXr();Object.defineProperty(Ve,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return AOt.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return AOt.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return AOt.CallHierarchyPrepareRequest},"get")});var pae=pXr();Object.defineProperty(Ve,"TokenFormat",{enumerable:!0,get:a(function(){return pae.TokenFormat},"get")});Object.defineProperty(Ve,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return pae.SemanticTokensRequest},"get")});Object.defineProperty(Ve,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return pae.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return pae.SemanticTokensRangeRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return pae.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return pae.SemanticTokensRegistrationType},"get")});var uTo=gXr();Object.defineProperty(Ve,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return uTo.ShowDocumentRequest},"get")});var dTo=_Xr();Object.defineProperty(Ve,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return dTo.LinkedEditingRangeRequest},"get")});var Fz=xXr();Object.defineProperty(Ve,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return Fz.FileOperationPatternKind},"get")});Object.defineProperty(Ve,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return Fz.DidCreateFilesNotification},"get")});Object.defineProperty(Ve,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return Fz.WillCreateFilesRequest},"get")});Object.defineProperty(Ve,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return Fz.DidRenameFilesNotification},"get")});Object.defineProperty(Ve,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return Fz.WillRenameFilesRequest},"get")});Object.defineProperty(Ve,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return Fz.DidDeleteFilesNotification},"get")});Object.defineProperty(Ve,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return Fz.WillDeleteFilesRequest},"get")});var yOt=DXr();Object.defineProperty(Ve,"UniquenessLevel",{enumerable:!0,get:a(function(){return yOt.UniquenessLevel},"get")});Object.defineProperty(Ve,"MonikerKind",{enumerable:!0,get:a(function(){return yOt.MonikerKind},"get")});Object.defineProperty(Ve,"MonikerRequest",{enumerable:!0,get:a(function(){return yOt.MonikerRequest},"get")});var _Ot=LXr();Object.defineProperty(Ve,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return _Ot.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return _Ot.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return _Ot.TypeHierarchySupertypesRequest},"get")});var ytn=UXr();Object.defineProperty(Ve,"InlineValueRequest",{enumerable:!0,get:a(function(){return ytn.InlineValueRequest},"get")});Object.defineProperty(Ve,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return ytn.InlineValueRefreshRequest},"get")});var EOt=HXr();Object.defineProperty(Ve,"InlayHintRequest",{enumerable:!0,get:a(function(){return EOt.InlayHintRequest},"get")});Object.defineProperty(Ve,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return EOt.InlayHintResolveRequest},"get")});Object.defineProperty(Ve,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return EOt.InlayHintRefreshRequest},"get")});var MSe=KXr();Object.defineProperty(Ve,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return MSe.DiagnosticServerCancellationData},"get")});Object.defineProperty(Ve,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return MSe.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Ve,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return MSe.DocumentDiagnosticRequest},"get")});Object.defineProperty(Ve,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return MSe.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Ve,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return MSe.DiagnosticRefreshRequest},"get")});var BM=nen();Object.defineProperty(Ve,"NotebookCellKind",{enumerable:!0,get:a(function(){return BM.NotebookCellKind},"get")});Object.defineProperty(Ve,"ExecutionSummary",{enumerable:!0,get:a(function(){return BM.ExecutionSummary},"get")});Object.defineProperty(Ve,"NotebookCell",{enumerable:!0,get:a(function(){return BM.NotebookCell},"get")});Object.defineProperty(Ve,"NotebookDocument",{enumerable:!0,get:a(function(){return BM.NotebookDocument},"get")});Object.defineProperty(Ve,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return BM.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Ve,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return BM.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return BM.NotebookCellArrayChange},"get")});Object.defineProperty(Ve,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return BM.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return BM.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return BM.DidCloseNotebookDocumentNotification},"get")});var fTo=sen();Object.defineProperty(Ve,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return fTo.InlineCompletionRequest},"get")});var fOt;(function(t){function e(r){let n=r;return c0.string(n)||c0.string(n.language)||c0.string(n.scheme)||c0.string(n.pattern)}a(e,"is"),t.is=e})(fOt||(Ve.TextDocumentFilter=fOt={}));var pOt;(function(t){function e(r){let n=r;return c0.objectLiteral(n)&&(c0.string(n.notebookType)||c0.string(n.scheme)||c0.string(n.pattern))}a(e,"is"),t.is=e})(pOt||(Ve.NotebookDocumentFilter=pOt={}));var hOt;(function(t){function e(r){let n=r;return c0.objectLiteral(n)&&(c0.string(n.notebook)||pOt.is(n.notebook))&&(n.language===void 0||c0.string(n.language))}a(e,"is"),t.is=e})(hOt||(Ve.NotebookCellTextDocumentFilter=hOt={}));var mOt;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!c0.string(n)&&!fOt.is(n)&&!hOt.is(n))return!1;return!0}a(e,"is"),t.is=e})(mOt||(Ve.DocumentSelector=mOt={}));var cen;(function(t){t.method="client/registerCapability",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolRequestType(t.method)})(cen||(Ve.RegistrationRequest=cen={}));var len;(function(t){t.method="client/unregisterCapability",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolRequestType(t.method)})(len||(Ve.UnregistrationRequest=len={}));var uen;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(uen||(Ve.ResourceOperationKind=uen={}));var den;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(den||(Ve.FailureHandlingKind=den={}));var fen;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(fen||(Ve.PositionEncodingKind=fen={}));var pen;(function(t){function e(r){let n=r;return n&&c0.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})(pen||(Ve.StaticRegistrationOptions=pen={}));var hen;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||mOt.is(n.documentSelector))}a(e,"is"),t.is=e})(hen||(Ve.TextDocumentRegistrationOptions=hen={}));var men;(function(t){function e(n){let o=n;return c0.objectLiteral(o)&&(o.workDoneProgress===void 0||c0.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&c0.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(men||(Ve.WorkDoneProgressOptions=men={}));var gen;(function(t){t.method="initialize",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(gen||(Ve.InitializeRequest=gen={}));var Aen;(function(t){t.unknownProtocolVersion=1})(Aen||(Ve.InitializeErrorCodes=Aen={}));var yen;(function(t){t.method="initialized",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(yen||(Ve.InitializedNotification=yen={}));var _en;(function(t){t.method="shutdown",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType0(t.method)})(_en||(Ve.ShutdownRequest=_en={}));var Een;(function(t){t.method="exit",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType0(t.method)})(Een||(Ve.ExitNotification=Een={}));var ven;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(ven||(Ve.DidChangeConfigurationNotification=ven={}));var Cen;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(Cen||(Ve.MessageType=Cen={}));var ben;(function(t){t.method="window/showMessage",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolNotificationType(t.method)})(ben||(Ve.ShowMessageNotification=ben={}));var Sen;(function(t){t.method="window/showMessageRequest",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolRequestType(t.method)})(Sen||(Ve.ShowMessageRequest=Sen={}));var Ten;(function(t){t.method="window/logMessage",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolNotificationType(t.method)})(Ten||(Ve.LogMessageNotification=Ten={}));var Ien;(function(t){t.method="telemetry/event",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolNotificationType(t.method)})(Ien||(Ve.TelemetryEventNotification=Ien={}));var xen;(function(t){t.None=0,t.Full=1,t.Incremental=2})(xen||(Ve.TextDocumentSyncKind=xen={}));var wen;(function(t){t.method="textDocument/didOpen",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(wen||(Ve.DidOpenTextDocumentNotification=wen={}));var Ren;(function(t){function e(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range!==void 0&&(o.rangeLength===void 0||typeof o.rangeLength=="number")}a(e,"isIncremental"),t.isIncremental=e;function r(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range===void 0&&o.rangeLength===void 0}a(r,"isFull"),t.isFull=r})(Ren||(Ve.TextDocumentContentChangeEvent=Ren={}));var ken;(function(t){t.method="textDocument/didChange",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(ken||(Ve.DidChangeTextDocumentNotification=ken={}));var Pen;(function(t){t.method="textDocument/didClose",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(Pen||(Ve.DidCloseTextDocumentNotification=Pen={}));var Den;(function(t){t.method="textDocument/didSave",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(Den||(Ve.DidSaveTextDocumentNotification=Den={}));var Nen;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(Nen||(Ve.TextDocumentSaveReason=Nen={}));var Men;(function(t){t.method="textDocument/willSave",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(Men||(Ve.WillSaveTextDocumentNotification=Men={}));var Oen;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Oen||(Ve.WillSaveTextDocumentWaitUntilRequest=Oen={}));var Len;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method)})(Len||(Ve.DidChangeWatchedFilesNotification=Len={}));var Ben;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Ben||(Ve.FileChangeType=Ben={}));var Fen;(function(t){function e(r){let n=r;return c0.objectLiteral(n)&&(aen.URI.is(n.baseUri)||aen.WorkspaceFolder.is(n.baseUri))&&c0.string(n.pattern)}a(e,"is"),t.is=e})(Fen||(Ve.RelativePattern=Fen={}));var Uen;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Uen||(Ve.WatchKind=Uen={}));var Qen;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolNotificationType(t.method)})(Qen||(Ve.PublishDiagnosticsNotification=Qen={}));var qen;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(qen||(Ve.CompletionTriggerKind=qen={}));var jen;(function(t){t.method="textDocument/completion",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(jen||(Ve.CompletionRequest=jen={}));var Hen;(function(t){t.method="completionItem/resolve",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Hen||(Ve.CompletionResolveRequest=Hen={}));var Gen;(function(t){t.method="textDocument/hover",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Gen||(Ve.HoverRequest=Gen={}));var $en;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})($en||(Ve.SignatureHelpTriggerKind=$en={}));var Ven;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Ven||(Ve.SignatureHelpRequest=Ven={}));var Wen;(function(t){t.method="textDocument/definition",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Wen||(Ve.DefinitionRequest=Wen={}));var zen;(function(t){t.method="textDocument/references",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(zen||(Ve.ReferencesRequest=zen={}));var Yen;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Yen||(Ve.DocumentHighlightRequest=Yen={}));var Ken;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Ken||(Ve.DocumentSymbolRequest=Ken={}));var Jen;(function(t){t.method="textDocument/codeAction",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Jen||(Ve.CodeActionRequest=Jen={}));var Zen;(function(t){t.method="codeAction/resolve",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Zen||(Ve.CodeActionResolveRequest=Zen={}));var Xen;(function(t){t.method="workspace/symbol",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(Xen||(Ve.WorkspaceSymbolRequest=Xen={}));var etn;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(etn||(Ve.WorkspaceSymbolResolveRequest=etn={}));var ttn;(function(t){t.method="textDocument/codeLens",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(ttn||(Ve.CodeLensRequest=ttn={}));var rtn;(function(t){t.method="codeLens/resolve",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(rtn||(Ve.CodeLensResolveRequest=rtn={}));var ntn;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolRequestType0(t.method)})(ntn||(Ve.CodeLensRefreshRequest=ntn={}));var itn;(function(t){t.method="textDocument/documentLink",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(itn||(Ve.DocumentLinkRequest=itn={}));var otn;(function(t){t.method="documentLink/resolve",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(otn||(Ve.DocumentLinkResolveRequest=otn={}));var stn;(function(t){t.method="textDocument/formatting",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(stn||(Ve.DocumentFormattingRequest=stn={}));var atn;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(atn||(Ve.DocumentRangeFormattingRequest=atn={}));var ctn;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(ctn||(Ve.DocumentRangesFormattingRequest=ctn={}));var ltn;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(ltn||(Ve.DocumentOnTypeFormattingRequest=ltn={}));var utn;(function(t){t.Identifier=1})(utn||(Ve.PrepareSupportDefaultBehavior=utn={}));var dtn;(function(t){t.method="textDocument/rename",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(dtn||(Ve.RenameRequest=dtn={}));var ftn;(function(t){t.method="textDocument/prepareRename",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(ftn||(Ve.PrepareRenameRequest=ftn={}));var ptn;(function(t){t.method="workspace/executeCommand",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolRequestType(t.method)})(ptn||(Ve.ExecuteCommandRequest=ptn={}));var htn;(function(t){t.method="workspace/applyEdit",t.messageDirection=Rr.MessageDirection.serverToClient,t.type=new Rr.ProtocolRequestType("workspace/applyEdit")})(htn||(Ve.ApplyWorkspaceEditRequest=htn={}))});var vtn=I(GQe=>{"use strict";p();Object.defineProperty(GQe,"__esModule",{value:!0});GQe.createProtocolConnection=void 0;var Etn=Bz();function pTo(t,e,r,n){return Etn.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Etn.createMessageConnection)(t,e,r,n)}a(pTo,"createProtocolConnection");GQe.createProtocolConnection=pTo});var btn=I(PC=>{"use strict";p();var hTo=PC&&PC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Qe=PC&&PC.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hTo(e,t,r)};Object.defineProperty(PC,"__esModule",{value:!0});PC.LSPErrorCodes=PC.createProtocolConnection=void 0;$Qe(Bz(),PC);$Qe(PSe(),PC);$Qe(Gd(),PC);$Qe(_tn(),PC);var mTo=vtn();Object.defineProperty(PC,"createProtocolConnection",{enumerable:!0,get:a(function(){return mTo.createProtocolConnection},"get")});var Ctn;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(Ctn||(PC.LSPErrorCodes=Ctn={}))});var ii=I(FM=>{"use strict";p();var gTo=FM&&FM.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Stn=FM&&FM.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gTo(e,t,r)};Object.defineProperty(FM,"__esModule",{value:!0});FM.createProtocolConnection=void 0;var ATo=iOt();Stn(iOt(),FM);Stn(btn(),FM);function yTo(t,e,r,n){return(0,ATo.createMessageConnection)(t,e,r,n)}a(yTo,"createProtocolConnection");FM.createProtocolConnection=yTo});var TBt=I(bGe=>{"use strict";p();Object.defineProperty(bGe,"__esModule",{value:!0});bGe.state=void 0;bGe.state={instrumenterImplementation:void 0}});var _le=I((i8t,Tcn)=>{p();var b$e=require("buffer"),CO=b$e.Buffer;function Scn(t,e){for(var r in t)e[r]=t[r]}a(Scn,"copyProps");CO.from&&CO.alloc&&CO.allocUnsafe&&CO.allocUnsafeSlow?Tcn.exports=b$e:(Scn(b$e,i8t),i8t.Buffer=yK);function yK(t,e,r){return CO(t,e,r)}a(yK,"SafeBuffer");yK.prototype=Object.create(CO.prototype);Scn(CO,yK);yK.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return CO(t,e,r)};yK.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=CO(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};yK.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return CO(t)};yK.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return b$e.SlowBuffer(t)}});var o8t=I((Vcu,Icn)=>{p();var S$e=_le().Buffer,MDo=require("stream"),ODo=require("util");function T$e(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=S$e.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=S$e.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}a(T$e,"DataStream");ODo.inherits(T$e,MDo);T$e.prototype.write=a(function(e){this.buffer=S$e.concat([this.buffer,S$e.from(e)]),this.emit("data",e)},"write");T$e.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");Icn.exports=T$e});var wcn=I((Ycu,xcn)=>{"use strict";p();function s8t(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(s8t,"getParamSize");var LDo={ES256:s8t(256),ES384:s8t(384),ES512:s8t(521)};function BDo(t){var e=LDo[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(BDo,"getParamBytesForAlg");xcn.exports=BDo});var Ocn=I((Zcu,Mcn)=>{"use strict";p();var I$e=_le().Buffer,kcn=wcn(),x$e=128,Pcn=0,FDo=32,UDo=16,QDo=2,Dcn=UDo|FDo|Pcn<<6,w$e=QDo|Pcn<<6;function qDo(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(qDo,"base64Url");function Ncn(t){if(I$e.isBuffer(t))return t;if(typeof t=="string")return I$e.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(Ncn,"signatureAsBuffer");function jDo(t,e){t=Ncn(t);var r=kcn(e),n=r+1,o=t.length,s=0;if(t[s++]!==Dcn)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(x$e|1)&&(c=t[s++]),o-s=x$e;return o&&--n,n}a(Rcn,"countPadding");function HDo(t,e){t=Ncn(t);var r=kcn(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=Rcn(t,0,r),s=Rcn(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var PIe=require("buffer").Buffer,a8t=require("buffer").SlowBuffer;Lcn.exports=R$e;function R$e(t,e){if(!PIe.isBuffer(t)||!PIe.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var vle=_le().Buffer,ew=require("crypto"),Ucn=Ocn(),Fcn=require("util"),VDo=`"%s" is not a valid algorithm. Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,DIe="secret must be a string or buffer",_le="key must be a string or a buffer",$Do="key must be a string, a buffer or an object",c8t=typeof ew.createPublicKey=="function";c8t&&(_le+=" or a KeyObject",DIe+="or a KeyObject");function Ucn(t){if(!Ele.isBuffer(t)&&typeof t!="string"&&(!c8t||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw VP(_le)}a(Ucn,"checkIsPublicKey");function Qcn(t){if(!Ele.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw VP($Do)}a(Qcn,"checkIsPrivateKey");function VDo(t){if(!Ele.isBuffer(t)){if(typeof t=="string")return t;if(!c8t||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw VP(DIe)}}a(VDo,"checkIsSecretKey");function l8t(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(l8t,"fromBase64");function qcn(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var rNo=require("buffer").Buffer;Vcn.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||rNo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var Zcn=I((clu,Jcn)=>{p();var nNo=yle().Buffer,Wcn=i8t(),iNo=u8t(),oNo=require("stream"),zcn=d8t(),f8t=require("util");function Ycn(t,e){return nNo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(Ycn,"base64url");function sNo(t,e,r){r=r||"utf8";var n=Ycn(zcn(t),"binary"),o=Ycn(zcn(e),r);return f8t.format("%s.%s",n,o)}a(sNo,"jwsSecuredInput");function Kcn(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=iNo(e.alg),c=sNo(e,r,o),l=s.sign(c,n);return f8t.format("%s.%s",c,l)}a(Kcn,"jwsSign");function k$e(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new Wcn(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Wcn(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}a(k$e,"SignStream");f8t.inherits(k$e,oNo);k$e.prototype.sign=a(function(){try{var e=Kcn({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}},"sign");k$e.sign=Kcn;Jcn.exports=k$e});var cln=I((dlu,aln)=>{p();var eln=yle().Buffer,Xcn=i8t(),aNo=u8t(),cNo=require("stream"),tln=d8t(),lNo=require("util"),uNo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function dNo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(dNo,"isObject");function fNo(t){if(dNo(t))return t;try{return JSON.parse(t)}catch{return}}a(fNo,"safeJsonParse");function rln(t){var e=t.split(".",1)[0];return fNo(eln.from(e,"base64").toString("binary"))}a(rln,"headerFromJWS");function pNo(t){return t.split(".",2).join(".")}a(pNo,"securedInputFromJWS");function nln(t){return t.split(".")[2]}a(nln,"signatureFromJWS");function hNo(t,e){e=e||"utf8";var r=t.split(".")[1];return eln.from(r,"base64").toString(e)}a(hNo,"payloadFromJWS");function iln(t){return uNo.test(t)&&!!rln(t)}a(iln,"isValidJws");function oln(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=tln(t);var o=nln(t),s=pNo(t),c=aNo(e);return c.verify(s,o,r)}a(oln,"jwsVerify");function sln(t,e){if(e=e||{},t=tln(t),!iln(t))return null;var r=rln(t);if(!r)return null;var n=hNo(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:nln(t)}}a(sln,"jwsDecode");function vle(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new Xcn(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new Xcn(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}a(vle,"VerifyStream");lNo.inherits(vle,cNo);vle.prototype.verify=a(function(){try{var e=oln(this.signature.buffer,this.algorithm,this.key.buffer),r=sln(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"verify");vle.decode=sln;vle.isValid=iln;vle.verify=oln;aln.exports=vle});var D$e=I(LQ=>{p();var lln=Zcn(),P$e=cln(),mNo=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];LQ.ALGORITHMS=mNo;LQ.sign=lln.sign;LQ.verify=P$e.verify;LQ.decode=P$e.decode;LQ.isValid=P$e.isValid;LQ.createSign=a(function(e){return new lln(e)},"createSign");LQ.createVerify=a(function(e){return new P$e(e)},"createVerify")});var p8t=I((Alu,uln)=>{p();var gNo=D$e();uln.exports=function(t,e){e=e||{};var r=gNo.decode(t,e);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var o=JSON.parse(n);o!==null&&typeof o=="object"&&(n=o)}catch{}return e.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var MIe=I((_lu,dln)=>{p();var N$e=a(function(t,e){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,e&&(this.inner=e)},"JsonWebTokenError");N$e.prototype=Object.create(Error.prototype);N$e.prototype.constructor=N$e;dln.exports=N$e});var h8t=I((Clu,pln)=>{p();var fln=MIe(),M$e=a(function(t,e){fln.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");M$e.prototype=Object.create(fln.prototype);M$e.prototype.constructor=M$e;pln.exports=M$e});var m8t=I((Tlu,mln)=>{p();var hln=MIe(),O$e=a(function(t,e){hln.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");O$e.prototype=Object.create(hln.prototype);O$e.prototype.constructor=O$e;mln.exports=O$e});var g8t=I((wlu,gln)=>{p();var Cle=1e3,ble=Cle*60,Sle=ble*60,yK=Sle*24,ANo=yK*7,yNo=yK*365.25;gln.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return _No(t);if(r==="number"&&isFinite(t))return e.long?vNo(t):ENo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function _No(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*yNo;case"weeks":case"week":case"w":return r*ANo;case"days":case"day":case"d":return r*yK;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Sle;case"minutes":case"minute":case"mins":case"min":case"m":return r*ble;case"seconds":case"second":case"secs":case"sec":case"s":return r*Cle;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(_No,"parse");function ENo(t){var e=Math.abs(t);return e>=yK?Math.round(t/yK)+"d":e>=Sle?Math.round(t/Sle)+"h":e>=ble?Math.round(t/ble)+"m":e>=Cle?Math.round(t/Cle)+"s":t+"ms"}a(ENo,"fmtShort");function vNo(t){var e=Math.abs(t);return e>=yK?L$e(t,e,yK,"day"):e>=Sle?L$e(t,e,Sle,"hour"):e>=ble?L$e(t,e,ble,"minute"):e>=Cle?L$e(t,e,Cle,"second"):t+" ms"}a(vNo,"fmtLong");function L$e(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(L$e,"plural")});var A8t=I((Plu,Aln)=>{p();var CNo=g8t();Aln.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=CNo(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var Tle=I((Nlu,yln)=>{"use strict";p();var bNo="2.0.0",SNo=Number.MAX_SAFE_INTEGER||9007199254740991,TNo=16,INo=250,xNo=["major","premajor","minor","preminor","patch","prepatch","prerelease"];yln.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:TNo,MAX_SAFE_BUILD_LENGTH:INo,MAX_SAFE_INTEGER:SNo,RELEASE_TYPES:xNo,SEMVER_SPEC_VERSION:bNo,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var OIe=I((Olu,_ln)=>{"use strict";p();var wNo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};_ln.exports=wNo});var Ile=I((bO,Eln)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:y8t,MAX_SAFE_BUILD_LENGTH:RNo,MAX_LENGTH:kNo}=Tle(),PNo=OIe();bO=Eln.exports={};var DNo=bO.re=[],NNo=bO.safeRe=[],wn=bO.src=[],MNo=bO.safeSrc=[],Rn=bO.t={},ONo=0,_8t="[a-zA-Z0-9-]",LNo=[["\\s",1],["\\d",kNo],[_8t,RNo]],BNo=a(t=>{for(let[e,r]of LNo)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Ho=a((t,e,r)=>{let n=BNo(e),o=ONo++;PNo(t,o,e),Rn[t]=o,wn[o]=e,MNo[o]=n,DNo[o]=new RegExp(e,r?"g":void 0),NNo[o]=new RegExp(n,r?"g":void 0)},"createToken");Ho("NUMERICIDENTIFIER","0|[1-9]\\d*");Ho("NUMERICIDENTIFIERLOOSE","\\d+");Ho("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${_8t}*`);Ho("MAINVERSION",`(${wn[Rn.NUMERICIDENTIFIER]})\\.(${wn[Rn.NUMERICIDENTIFIER]})\\.(${wn[Rn.NUMERICIDENTIFIER]})`);Ho("MAINVERSIONLOOSE",`(${wn[Rn.NUMERICIDENTIFIERLOOSE]})\\.(${wn[Rn.NUMERICIDENTIFIERLOOSE]})\\.(${wn[Rn.NUMERICIDENTIFIERLOOSE]})`);Ho("PRERELEASEIDENTIFIER",`(?:${wn[Rn.NONNUMERICIDENTIFIER]}|${wn[Rn.NUMERICIDENTIFIER]})`);Ho("PRERELEASEIDENTIFIERLOOSE",`(?:${wn[Rn.NONNUMERICIDENTIFIER]}|${wn[Rn.NUMERICIDENTIFIERLOOSE]})`);Ho("PRERELEASE",`(?:-(${wn[Rn.PRERELEASEIDENTIFIER]}(?:\\.${wn[Rn.PRERELEASEIDENTIFIER]})*))`);Ho("PRERELEASELOOSE",`(?:-?(${wn[Rn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${wn[Rn.PRERELEASEIDENTIFIERLOOSE]})*))`);Ho("BUILDIDENTIFIER",`${_8t}+`);Ho("BUILD",`(?:\\+(${wn[Rn.BUILDIDENTIFIER]}(?:\\.${wn[Rn.BUILDIDENTIFIER]})*))`);Ho("FULLPLAIN",`v?${wn[Rn.MAINVERSION]}${wn[Rn.PRERELEASE]}?${wn[Rn.BUILD]}?`);Ho("FULL",`^${wn[Rn.FULLPLAIN]}$`);Ho("LOOSEPLAIN",`[v=\\s]*${wn[Rn.MAINVERSIONLOOSE]}${wn[Rn.PRERELEASELOOSE]}?${wn[Rn.BUILD]}?`);Ho("LOOSE",`^${wn[Rn.LOOSEPLAIN]}$`);Ho("GTLT","((?:<|>)?=?)");Ho("XRANGEIDENTIFIERLOOSE",`${wn[Rn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Ho("XRANGEIDENTIFIER",`${wn[Rn.NUMERICIDENTIFIER]}|x|X|\\*`);Ho("XRANGEPLAIN",`[v=\\s]*(${wn[Rn.XRANGEIDENTIFIER]})(?:\\.(${wn[Rn.XRANGEIDENTIFIER]})(?:\\.(${wn[Rn.XRANGEIDENTIFIER]})(?:${wn[Rn.PRERELEASE]})?${wn[Rn.BUILD]}?)?)?`);Ho("XRANGEPLAINLOOSE",`[v=\\s]*(${wn[Rn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${wn[Rn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${wn[Rn.XRANGEIDENTIFIERLOOSE]})(?:${wn[Rn.PRERELEASELOOSE]})?${wn[Rn.BUILD]}?)?)?`);Ho("XRANGE",`^${wn[Rn.GTLT]}\\s*${wn[Rn.XRANGEPLAIN]}$`);Ho("XRANGELOOSE",`^${wn[Rn.GTLT]}\\s*${wn[Rn.XRANGEPLAINLOOSE]}$`);Ho("COERCEPLAIN",`(^|[^\\d])(\\d{1,${y8t}})(?:\\.(\\d{1,${y8t}}))?(?:\\.(\\d{1,${y8t}}))?`);Ho("COERCE",`${wn[Rn.COERCEPLAIN]}(?:$|[^\\d])`);Ho("COERCEFULL",wn[Rn.COERCEPLAIN]+`(?:${wn[Rn.PRERELEASE]})?(?:${wn[Rn.BUILD]})?(?:$|[^\\d])`);Ho("COERCERTL",wn[Rn.COERCE],!0);Ho("COERCERTLFULL",wn[Rn.COERCEFULL],!0);Ho("LONETILDE","(?:~>?)");Ho("TILDETRIM",`(\\s*)${wn[Rn.LONETILDE]}\\s+`,!0);bO.tildeTrimReplace="$1~";Ho("TILDE",`^${wn[Rn.LONETILDE]}${wn[Rn.XRANGEPLAIN]}$`);Ho("TILDELOOSE",`^${wn[Rn.LONETILDE]}${wn[Rn.XRANGEPLAINLOOSE]}$`);Ho("LONECARET","(?:\\^)");Ho("CARETTRIM",`(\\s*)${wn[Rn.LONECARET]}\\s+`,!0);bO.caretTrimReplace="$1^";Ho("CARET",`^${wn[Rn.LONECARET]}${wn[Rn.XRANGEPLAIN]}$`);Ho("CARETLOOSE",`^${wn[Rn.LONECARET]}${wn[Rn.XRANGEPLAINLOOSE]}$`);Ho("COMPARATORLOOSE",`^${wn[Rn.GTLT]}\\s*(${wn[Rn.LOOSEPLAIN]})$|^$`);Ho("COMPARATOR",`^${wn[Rn.GTLT]}\\s*(${wn[Rn.FULLPLAIN]})$|^$`);Ho("COMPARATORTRIM",`(\\s*)${wn[Rn.GTLT]}\\s*(${wn[Rn.LOOSEPLAIN]}|${wn[Rn.XRANGEPLAIN]})`,!0);bO.comparatorTrimReplace="$1$2$3";Ho("HYPHENRANGE",`^\\s*(${wn[Rn.XRANGEPLAIN]})\\s+-\\s+(${wn[Rn.XRANGEPLAIN]})\\s*$`);Ho("HYPHENRANGELOOSE",`^\\s*(${wn[Rn.XRANGEPLAINLOOSE]})\\s+-\\s+(${wn[Rn.XRANGEPLAINLOOSE]})\\s*$`);Ho("STAR","(<|>)?=?\\s*\\*");Ho("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Ho("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var B$e=I((Ulu,vln)=>{"use strict";p();var FNo=Object.freeze({loose:!0}),UNo=Object.freeze({}),QNo=a(t=>t?typeof t!="object"?FNo:t:UNo,"parseOptions");vln.exports=QNo});var E8t=I((jlu,Sln)=>{"use strict";p();var Cln=/^[0-9]+$/,bln=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tbln(e,t),"rcompareIdentifiers");Sln.exports={compareIdentifiers:bln,rcompareIdentifiers:qNo}});var MA=I(($lu,Iln)=>{"use strict";p();var F$e=OIe(),{MAX_LENGTH:Tln,MAX_SAFE_INTEGER:U$e}=Tle(),{safeRe:Q$e,t:q$e}=Ile(),jNo=B$e(),{compareIdentifiers:v8t}=E8t(),HNo=a((t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;nTln)throw new TypeError(`version is longer than ${Tln} characters`);F$e("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Q$e[q$e.LOOSE]:Q$e[q$e.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>U$e||this.major<0)throw new TypeError("Invalid major version");if(this.minor>U$e||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>U$e||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&se.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],o=e.prerelease[r];if(F$e("prerelease compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return v8t(n,o)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],o=e.build[r];if(F$e("build compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return v8t(n,o)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let o=`-${r}`.match(this.options.loose?Q$e[q$e.PRERELEASELOOSE]:Q$e[q$e.PRERELEASE]);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(r){let s=[r,o];if(n===!1&&(s=[r]),HNo(this.prerelease,r)){let c=this.prerelease[r.split(".").length];isNaN(c)&&(this.prerelease=s)}else this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Iln.exports=C8t});var BQ=I((zlu,wln)=>{"use strict";p();var xln=MA(),GNo=a((t,e,r=!1)=>{if(t instanceof xln)return t;try{return new xln(t,e)}catch(n){if(!r)return null;throw n}},"parse");wln.exports=GNo});var kln=I((Jlu,Rln)=>{"use strict";p();var $No=BQ(),VNo=a((t,e)=>{let r=$No(t,e);return r?r.version:null},"valid");Rln.exports=VNo});var Dln=I((euu,Pln)=>{"use strict";p();var WNo=BQ(),zNo=a((t,e)=>{let r=WNo(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");Pln.exports=zNo});var Oln=I((nuu,Mln)=>{"use strict";p();var Nln=MA(),YNo=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Nln(t instanceof Nln?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");Mln.exports=YNo});var Fln=I((suu,Bln)=>{"use strict";p();var Lln=BQ(),KNo=a((t,e)=>{let r=Lln(t,null,!0),n=Lln(e,null,!0),o=r.compare(n);if(o===0)return null;let s=o>0,c=s?r:n,l=s?n:r,u=!!c.prerelease.length;if(!!l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(l.compareMain(c)===0)return l.minor&&!l.patch?"minor":"patch"}let f=u?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"},"diff");Bln.exports=KNo});var Qln=I((luu,Uln)=>{"use strict";p();var JNo=MA(),ZNo=a((t,e)=>new JNo(t,e).major,"major");Uln.exports=ZNo});var jln=I((fuu,qln)=>{"use strict";p();var XNo=MA(),eMo=a((t,e)=>new XNo(t,e).minor,"minor");qln.exports=eMo});var Gln=I((muu,Hln)=>{"use strict";p();var tMo=MA(),rMo=a((t,e)=>new tMo(t,e).patch,"patch");Hln.exports=rMo});var Vln=I((yuu,$ln)=>{"use strict";p();var nMo=BQ(),iMo=a((t,e)=>{let r=nMo(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");$ln.exports=iMo});var tw=I((vuu,zln)=>{"use strict";p();var Wln=MA(),oMo=a((t,e,r)=>new Wln(t,r).compare(new Wln(e,r)),"compare");zln.exports=oMo});var Kln=I((Suu,Yln)=>{"use strict";p();var sMo=tw(),aMo=a((t,e,r)=>sMo(e,t,r),"rcompare");Yln.exports=aMo});var Zln=I((xuu,Jln)=>{"use strict";p();var cMo=tw(),lMo=a((t,e)=>cMo(t,e,!0),"compareLoose");Jln.exports=lMo});var j$e=I((kuu,eun)=>{"use strict";p();var Xln=MA(),uMo=a((t,e,r)=>{let n=new Xln(t,r),o=new Xln(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");eun.exports=uMo});var nun=I((Nuu,tun)=>{"use strict";p();var dMo=j$e(),fMo=a((t,e)=>t.sort((r,n)=>dMo(r,n,e)),"sort");tun.exports=fMo});var oun=I((Luu,iun)=>{"use strict";p();var pMo=j$e(),hMo=a((t,e)=>t.sort((r,n)=>pMo(n,r,e)),"rsort");iun.exports=hMo});var LIe=I((Uuu,sun)=>{"use strict";p();var mMo=tw(),gMo=a((t,e,r)=>mMo(t,e,r)>0,"gt");sun.exports=gMo});var H$e=I((juu,aun)=>{"use strict";p();var AMo=tw(),yMo=a((t,e,r)=>AMo(t,e,r)<0,"lt");aun.exports=yMo});var b8t=I(($uu,cun)=>{"use strict";p();var _Mo=tw(),EMo=a((t,e,r)=>_Mo(t,e,r)===0,"eq");cun.exports=EMo});var S8t=I((zuu,lun)=>{"use strict";p();var vMo=tw(),CMo=a((t,e,r)=>vMo(t,e,r)!==0,"neq");lun.exports=CMo});var G$e=I((Juu,uun)=>{"use strict";p();var bMo=tw(),SMo=a((t,e,r)=>bMo(t,e,r)>=0,"gte");uun.exports=SMo});var $$e=I((edu,dun)=>{"use strict";p();var TMo=tw(),IMo=a((t,e,r)=>TMo(t,e,r)<=0,"lte");dun.exports=IMo});var T8t=I((ndu,fun)=>{"use strict";p();var xMo=b8t(),wMo=S8t(),RMo=LIe(),kMo=G$e(),PMo=H$e(),DMo=$$e(),NMo=a((t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return xMo(t,r,n);case"!=":return wMo(t,r,n);case">":return RMo(t,r,n);case">=":return kMo(t,r,n);case"<":return PMo(t,r,n);case"<=":return DMo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");fun.exports=NMo});var hun=I((sdu,pun)=>{"use strict";p();var MMo=MA(),OMo=BQ(),{safeRe:V$e,t:W$e}=Ile(),LMo=a((t,e)=>{if(t instanceof MMo)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?V$e[W$e.COERCEFULL]:V$e[W$e.COERCE]);else{let u=e.includePrerelease?V$e[W$e.COERCERTLFULL]:V$e[W$e.COERCERTL],d;for(;(d=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||d.index+d[0].length!==r.index+r[0].length)&&(r=d),u.lastIndex=d.index+d[1].length+d[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",s=r[4]||"0",c=e.includePrerelease&&r[5]?`-${r[5]}`:"",l=e.includePrerelease&&r[6]?`+${r[6]}`:"";return OMo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");pun.exports=LMo});var gun=I((ldu,mun)=>{"use strict";p();var BMo=BQ(),FMo=Tle(),UMo=MA(),QMo=a((t,e,r)=>{if(!FMo.RELEASE_TYPES.includes(e))return null;let n=qMo(t,r);return n&&jMo(n,e)},"truncate"),qMo=a((t,e)=>{let r=t instanceof UMo?t.version:t;return BMo(r,e)},"cloneInputVersion"),jMo=a((t,e)=>{if(HMo(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},"doTruncation"),HMo=a(t=>t.startsWith("pre"),"isPrerelease");mun.exports=QMo});var yun=I((fdu,Aun)=>{"use strict";p();var I8t=class{static{a(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,r)}return this}};Aun.exports=I8t});var rw=I((mdu,Cun)=>{"use strict";p();var GMo=/\s+/g,x8t=class t{static{a(this,"Range")}constructor(e,r){if(r=VMo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof w8t)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(GMo," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(o=>!Eun(o[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&tOo(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(eOo,"");let n=((this.options.includePrerelease&&ZMo)|(this.options.loose&&XMo))+":"+e,o=_un.get(n);if(o)return o;let s=this.options.loose,c=s?YE[OA.HYPHENRANGELOOSE]:YE[OA.HYPHENRANGE];e=e.replace(c,fOo(this.options.includePrerelease)),ad("hyphen replace",e),e=e.replace(YE[OA.COMPARATORTRIM],YMo),ad("comparator trim",e),e=e.replace(YE[OA.TILDETRIM],KMo),ad("tilde trim",e),e=e.replace(YE[OA.CARETTRIM],JMo),ad("caret trim",e);let l=e.split(" ").map(h=>rOo(h,this.options)).join(" ").split(/\s+/).map(h=>dOo(h,this.options));s&&(l=l.filter(h=>(ad("loose invalid filter",h,this.options),!!h.match(YE[OA.COMPARATORLOOSE])))),ad("range list",l);let u=new Map,d=l.map(h=>new w8t(h,this.options));for(let h of d){if(Eun(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return _un.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>vun(n,r)&&e.set.some(o=>vun(o,r)&&n.every(s=>o.every(c=>s.intersects(c,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new WMo(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),tOo=a(t=>t.value==="","isAny"),vun=a((t,e)=>{let r=!0,n=t.slice(),o=n.pop();for(;r&&n.length;)r=n.every(s=>o.intersects(s,e)),o=n.pop();return r},"isSatisfiable"),rOo=a((t,e)=>(t=t.replace(YE[OA.BUILD],""),ad("comp",t,e),t=sOo(t,e),ad("caret",t),t=iOo(t,e),ad("tildes",t),t=cOo(t,e),ad("xrange",t),t=uOo(t,e),ad("stars",t),t),"parseComparator"),gg=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),nOo=a((t,e,r)=>gg(t)&&!gg(e)||gg(e)&&r&&!gg(r),"invalidXRangeOrder"),iOo=a((t,e)=>t.trim().split(/\s+/).map(r=>oOo(r,e)).join(" "),"replaceTildes"),oOo=a((t,e)=>{let r=e.loose?YE[OA.TILDELOOSE]:YE[OA.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{ad("tilde",t,o,s,c,l,u);let d;return gg(s)?d="":gg(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:gg(l)?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:u?(ad("replaceTilde pr",u),d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`):d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`,ad("tilde return",d),d})},"replaceTilde"),sOo=a((t,e)=>t.trim().split(/\s+/).map(r=>aOo(r,e)).join(" "),"replaceCarets"),aOo=a((t,e)=>{ad("caret",t,e);let r=e.loose?YE[OA.CARETLOOSE]:YE[OA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{ad("caret",t,o,s,c,l,u);let d;return gg(s)?d="":gg(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:gg(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(ad("replaceCaret pr",u),s==="0"?c==="0"?d=`>=${s}.${c}.${l}-${u} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l}-${u} <${+s+1}.0.0-0`):(ad("no pr"),s==="0"?c==="0"?d=`>=${s}.${c}.${l} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`),ad("caret return",d),d})},"replaceCaret"),cOo=a((t,e)=>(ad("replaceXRanges",t,e),t.split(/\s+/).map(r=>lOo(r,e)).join(" ")),"replaceXRanges"),lOo=a((t,e)=>{t=t.trim();let r=e.loose?YE[OA.XRANGELOOSE]:YE[OA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{if(ad("xRange",t,n,o,s,c,l,u),nOo(s,c,l))return t;let d=gg(s),f=d||gg(c),h=f||gg(l),m=h;return o==="="&&m&&(o=""),u=e.includePrerelease?"-0":"",d?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),o==="<"&&(u="-0"),n=`${o+s}.${c}.${l}${u}`):f?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${c}.0${u} <${s}.${+c+1}.0-0`),ad("xRange return",n),n})},"replaceXRange"),uOo=a((t,e)=>(ad("replaceStars",t,e),t.trim().replace(YE[OA.STAR],"")),"replaceStars"),dOo=a((t,e)=>(ad("replaceGTE0",t,e),t.trim().replace(YE[e.includePrerelease?OA.GTE0PRE:OA.GTE0],"")),"replaceGTE0"),fOo=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(gg(n)?r="":gg(o)?r=`>=${n}.0.0${t?"-0":""}`:gg(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,gg(d)?u="":gg(f)?u=`<${+d+1}.0.0-0`:gg(h)?u=`<${d}.${+f+1}.0-0`:m?u=`<=${d}.${f}.${h}-${m}`:t?u=`<${d}.${f}.${+h+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),"hyphenReplace"),pOo=a((t,e,r)=>{for(let n=0;n0){let o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0},"testSet")});var BIe=I((ydu,wun)=>{"use strict";p();var FIe=Symbol("SemVer ANY"),P8t=class t{static{a(this,"Comparator")}static get ANY(){return FIe}constructor(e,r){if(r=bun(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),k8t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===FIe?this.value="":this.value=this.operator+this.semver.version,k8t("comp",this)}parse(e){let r=this.options.loose?Sun[Tun.COMPARATORLOOSE]:Sun[Tun.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Iun(n[2],this.options.loose):this.semver=FIe}toString(){return this.value}test(e){if(k8t("Comparator.test",e,this.options.loose),this.semver===FIe||e===FIe)return!0;if(typeof e=="string")try{e=new Iun(e,this.options)}catch{return!1}return R8t(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new xun(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new xun(this.value,r).test(e.semver):(r=bun(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||R8t(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||R8t(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};wun.exports=P8t;var bun=B$e(),{safeRe:Sun,t:Tun}=Ile(),R8t=T8t(),k8t=OIe(),Iun=MA(),xun=rw()});var UIe=I((vdu,Run)=>{"use strict";p();var hOo=rw(),mOo=a((t,e,r)=>{try{e=new hOo(e,r)}catch{return!1}return e.test(t)},"satisfies");Run.exports=mOo});var Pun=I((Sdu,kun)=>{"use strict";p();var gOo=rw(),AOo=a((t,e)=>new gOo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");kun.exports=AOo});var Nun=I((xdu,Dun)=>{"use strict";p();var yOo=MA(),_Oo=rw(),EOo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new _Oo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new yOo(n,r))}),n},"maxSatisfying");Dun.exports=EOo});var Oun=I((kdu,Mun)=>{"use strict";p();var vOo=MA(),COo=rw(),bOo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new COo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new vOo(n,r))}),n},"minSatisfying");Mun.exports=bOo});var Uun=I((Ndu,Fun)=>{"use strict";p();var D8t=MA(),SOo=rw(),Lun=LIe(),TOo=a((t,e)=>{t=new SOo(t,e);let r=new D8t("0.0.0");if(t.test(r)||(r=new D8t("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new D8t(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||Lun(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||Lun(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");Fun.exports=TOo});var qun=I((Ldu,Qun)=>{"use strict";p();var IOo=rw(),xOo=a((t,e)=>{try{return new IOo(t,e).range||"*"}catch{return null}},"validRange");Qun.exports=xOo});var z$e=I((Udu,$un)=>{"use strict";p();var wOo=MA(),Gun=BIe(),{ANY:ROo}=Gun,kOo=rw(),POo=UIe(),jun=LIe(),Hun=H$e(),DOo=$$e(),NOo=G$e(),MOo=a((t,e,r,n)=>{t=new wOo(t,n),e=new kOo(e,n);let o,s,c,l,u;switch(r){case">":o=jun,s=DOo,c=Hun,l=">",u=">=";break;case"<":o=Hun,s=NOo,c=jun,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(POo(t,e,n))return!1;for(let d=0;d{g.semver===ROo&&(g=new Gun(">=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0},"outside");$un.exports=MOo});var Wun=I((jdu,Vun)=>{"use strict";p();var OOo=z$e(),LOo=a((t,e,r)=>OOo(t,e,">",r),"gtr");Vun.exports=LOo});var Yun=I(($du,zun)=>{"use strict";p();var BOo=z$e(),FOo=a((t,e,r)=>BOo(t,e,"<",r),"ltr");zun.exports=FOo});var Zun=I((zdu,Jun)=>{"use strict";p();var Kun=rw(),UOo=a((t,e,r)=>(t=new Kun(t,r),e=new Kun(e,r),t.intersects(e,r)),"intersects");Jun.exports=UOo});var edn=I((Jdu,Xun)=>{"use strict";p();var QOo=UIe(),qOo=tw();Xun.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>qOo(f,h,r));for(let f of c)QOo(f,e,r)?(s=f,o||(o=f)):(s&&n.push([o,s]),s=null,o=null);o&&n.push([o,null]);let l=[];for(let[f,h]of n)f===h?l.push(f):!h&&f===c[0]?l.push("*"):h?f===c[0]?l.push(`<=${h}`):l.push(`${f} - ${h}`):l.push(`>=${f}`);let u=l.join(" || "),d=typeof e.raw=="string"?e.raw:String(e);return u.length{"use strict";p();var tdn=rw(),O8t=BIe(),{ANY:N8t}=O8t,M8t=UIe(),L8t=tw(),jOo=a((t,e,r={})=>{if(t===e)return!0;t=new tdn(t,r),e=new tdn(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=GOo(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),HOo=[new O8t(">=0.0.0-0")],rdn=[new O8t(">=0.0.0")],GOo=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===N8t){if(e.length===1&&e[0].semver===N8t)return!0;r.includePrerelease?t=HOo:t=rdn}if(e.length===1&&e[0].semver===N8t){if(r.includePrerelease)return!0;e=rdn}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=ndn(o,g,r):g.operator==="<"||g.operator==="<="?s=idn(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=L8t(o.semver,s.semver,r),c>0)return null;if(c===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(o&&!M8t(g,String(o),r)||s&&!M8t(g,String(s),r))return null;for(let A of e)if(!M8t(g,String(A),r))return!1;return!0}let l,u,d,f,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let g of e){if(f=f||g.operator===">"||g.operator===">=",d=d||g.operator==="<"||g.operator==="<=",o){if(m&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===m.major&&g.semver.minor===m.minor&&g.semver.patch===m.patch&&(m=!1),g.operator===">"||g.operator===">="){if(l=ndn(o,g,r),l===g&&l!==o)return!1}else if(o.operator===">="&&!g.test(o.semver))return!1}if(s){if(h&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===h.major&&g.semver.minor===h.minor&&g.semver.patch===h.patch&&(h=!1),g.operator==="<"||g.operator==="<="){if(u=idn(s,g,r),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||o)&&c!==0)return!1}return!(o&&d&&!s&&c!==0||s&&f&&!o&&c!==0||m||h)},"simpleSubset"),ndn=a((t,e,r)=>{if(!t)return e;let n=L8t(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),idn=a((t,e,r)=>{if(!t)return e;let n=L8t(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");odn.exports=jOo});var WP=I((rfu,ldn)=>{"use strict";p();var B8t=Ile(),adn=Tle(),$Oo=MA(),cdn=E8t(),VOo=BQ(),WOo=kln(),zOo=Dln(),YOo=Oln(),KOo=Fln(),JOo=Qln(),ZOo=jln(),XOo=Gln(),e5o=Vln(),t5o=tw(),r5o=Kln(),n5o=Zln(),i5o=j$e(),o5o=nun(),s5o=oun(),a5o=LIe(),c5o=H$e(),l5o=b8t(),u5o=S8t(),d5o=G$e(),f5o=$$e(),p5o=T8t(),h5o=hun(),m5o=gun(),g5o=BIe(),A5o=rw(),y5o=UIe(),_5o=Pun(),E5o=Nun(),v5o=Oun(),C5o=Uun(),b5o=qun(),S5o=z$e(),T5o=Wun(),I5o=Yun(),x5o=Zun(),w5o=edn(),R5o=sdn();ldn.exports={parse:VOo,valid:WOo,clean:zOo,inc:YOo,diff:KOo,major:JOo,minor:ZOo,patch:XOo,prerelease:e5o,compare:t5o,rcompare:r5o,compareLoose:n5o,compareBuild:i5o,sort:o5o,rsort:s5o,gt:a5o,lt:c5o,eq:l5o,neq:u5o,gte:d5o,lte:f5o,cmp:p5o,coerce:h5o,truncate:m5o,Comparator:g5o,Range:A5o,satisfies:y5o,toComparators:_5o,maxSatisfying:E5o,minSatisfying:v5o,minVersion:C5o,validRange:b5o,outside:S5o,gtr:T5o,ltr:I5o,intersects:x5o,simplifyRange:w5o,subset:R5o,SemVer:$Oo,re:B8t.re,src:B8t.src,tokens:B8t.t,SEMVER_SPEC_VERSION:adn.SEMVER_SPEC_VERSION,RELEASE_TYPES:adn.RELEASE_TYPES,compareIdentifiers:cdn.compareIdentifiers,rcompareIdentifiers:cdn.rcompareIdentifiers}});var ddn=I((ifu,udn)=>{p();var k5o=WP();udn.exports=k5o.satisfies(process.version,">=15.7.0")});var pdn=I((sfu,fdn)=>{p();var P5o=WP();fdn.exports=P5o.satisfies(process.version,">=16.9.0")});var F8t=I((cfu,hdn)=>{p();var D5o=ddn(),N5o=pdn(),M5o={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},O5o={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};hdn.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=M5o[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(t))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(D5o)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=O5o[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(N5o){let c=parseInt(t.slice(-3),10),{hashAlgorithm:l,mgf1HashAlgorithm:u,saltLength:d}=e.asymmetricKeyDetails;if(l!==`sha${c}`||u!==l)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${t}.`);if(d!==void 0&&d>c>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${t}.`)}break}}});var U8t=I((ufu,mdn)=>{p();var L5o=WP();mdn.exports=L5o.satisfies(process.version,"^6.12.0 || >=8.0.0")});var ydn=I((ffu,Adn)=>{p();var Tu=MIe(),B5o=h8t(),gdn=m8t(),F5o=p8t(),U5o=A8t(),Q5o=F8t(),q5o=U8t(),j5o=D$e(),{KeyObject:H5o,createSecretKey:G5o,createPublicKey:$5o}=require("crypto"),Q8t=["RS256","RS384","RS512"],V5o=["ES256","ES384","ES512"],q8t=["RS256","RS384","RS512"],W5o=["HS256","HS384","HS512"];q5o&&(Q8t.splice(Q8t.length,0,"PS256","PS384","PS512"),q8t.splice(q8t.length,0,"PS256","PS384","PS512"));Adn.exports=function(t,e,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let o;if(n?o=n:o=a(function(f,h){if(f)throw f;return h},"done"),r.clockTimestamp&&typeof r.clockTimestamp!="number")return o(new Tu("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new Tu("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new Tu("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new Tu("jwt must be provided"));if(typeof t!="string")return o(new Tu("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new Tu("jwt malformed"));let l;try{l=F5o(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new Tu("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new Tu("verify must be called asynchronous if secret or public key is provided as a callback"));d=e}else d=a(function(f,h){return h(null,e)},"getSecret");return d(u,function(f,h){if(f)return o(new Tu("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new Tu("jwt signature is required"));if(m&&!h)return o(new Tu("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new Tu('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof H5o))try{h=$5o(h)}catch{try{h=G5o(typeof h=="string"?Buffer.from(h):h)}catch{return o(new Tu("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=W5o:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=q8t:h.asymmetricKeyType==="ec"?r.algorithms=V5o:r.algorithms=Q8t),r.algorithms.indexOf(l.header.alg)===-1)return o(new Tu("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new Tu(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new Tu(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{Q5o(u.alg,h)}catch(y){return o(y)}let g;try{g=j5o.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new Tu("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new Tu("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new B5o("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new Tu("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new gdn("jwt expired",new Date(A.exp*1e3)))}if(r.audience){let y=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(A.aud)?A.aud:[A.aud]).some(function(v){return y.some(function(S){return S instanceof RegExp?S.test(v):S===v})}))return o(new Tu("jwt audience invalid. expected: "+y.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&A.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(A.iss)===-1))return o(new Tu("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new Tu("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new Tu("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new Tu("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new Tu("iat required when maxAge is specified"));let y=U5o(r.maxAge,A.iat);if(typeof y>"u")return o(new Tu('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=y+(r.clockTolerance||0))return o(new gdn("maxAge exceeded",new Date(y*1e3)))}if(r.complete===!0){let y=l.signature;return o(null,{header:u,payload:A,signature:y})}return o(null,A)})}});var Sdn=I((mfu,bdn)=>{p();var _dn=1/0,vdn=9007199254740991,z5o=17976931348623157e292,Edn=NaN,Y5o="[object Arguments]",K5o="[object Function]",J5o="[object GeneratorFunction]",Z5o="[object String]",X5o="[object Symbol]",e4o=/^\s+|\s+$/g,t4o=/^[-+]0x[0-9a-f]+$/i,r4o=/^0b[01]+$/i,n4o=/^0o[0-7]+$/i,i4o=/^(?:0|[1-9]\d*)$/,o4o=parseInt;function s4o(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&c4o(t,e,r)>-1}a(E4o,"includes");function v4o(t){return C4o(t)&&H8t.call(t,"callee")&&(!p4o.call(t,"callee")||K$e.call(t)==Y5o)}a(v4o,"isArguments");var Cdn=Array.isArray;function G8t(t){return t!=null&&S4o(t.length)&&!b4o(t)}a(G8t,"isArrayLike");function C4o(t){return $8t(t)&&G8t(t)}a(C4o,"isArrayLikeObject");function b4o(t){var e=j8t(t)?K$e.call(t):"";return e==K5o||e==J5o}a(b4o,"isFunction");function S4o(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=vdn}a(S4o,"isLength");function j8t(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(j8t,"isObject");function $8t(t){return!!t&&typeof t=="object"}a($8t,"isObjectLike");function T4o(t){return typeof t=="string"||!Cdn(t)&&$8t(t)&&K$e.call(t)==Z5o}a(T4o,"isString");function I4o(t){return typeof t=="symbol"||$8t(t)&&K$e.call(t)==X5o}a(I4o,"isSymbol");function x4o(t){if(!t)return t===0?t:0;if(t=R4o(t),t===_dn||t===-_dn){var e=t<0?-1:1;return e*z5o}return t===t?t:0}a(x4o,"toFinite");function w4o(t){var e=x4o(t),r=e%1;return e===e?r?e-r:e:0}a(w4o,"toInteger");function R4o(t){if(typeof t=="number")return t;if(I4o(t))return Edn;if(j8t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=j8t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(e4o,"");var r=r4o.test(t);return r||n4o.test(t)?o4o(t.slice(2),r?2:8):t4o.test(t)?Edn:+t}a(R4o,"toNumber");function k4o(t){return G8t(t)?g4o(t):A4o(t)}a(k4o,"keys");function P4o(t){return t?d4o(t,k4o(t)):[]}a(P4o,"values");bdn.exports=E4o});var Idn=I((yfu,Tdn)=>{p();var D4o="[object Boolean]",N4o=Object.prototype,M4o=N4o.toString;function O4o(t){return t===!0||t===!1||L4o(t)&&M4o.call(t)==D4o}a(O4o,"isBoolean");function L4o(t){return!!t&&typeof t=="object"}a(L4o,"isObjectLike");Tdn.exports=O4o});var Pdn=I((vfu,kdn)=>{p();var xdn=1/0,B4o=17976931348623157e292,wdn=NaN,F4o="[object Symbol]",U4o=/^\s+|\s+$/g,Q4o=/^[-+]0x[0-9a-f]+$/i,q4o=/^0b[01]+$/i,j4o=/^0o[0-7]+$/i,H4o=parseInt,G4o=Object.prototype,$4o=G4o.toString;function V4o(t){return typeof t=="number"&&t==K4o(t)}a(V4o,"isInteger");function Rdn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(Rdn,"isObject");function W4o(t){return!!t&&typeof t=="object"}a(W4o,"isObjectLike");function z4o(t){return typeof t=="symbol"||W4o(t)&&$4o.call(t)==F4o}a(z4o,"isSymbol");function Y4o(t){if(!t)return t===0?t:0;if(t=J4o(t),t===xdn||t===-xdn){var e=t<0?-1:1;return e*B4o}return t===t?t:0}a(Y4o,"toFinite");function K4o(t){var e=Y4o(t),r=e%1;return e===e?r?e-r:e:0}a(K4o,"toInteger");function J4o(t){if(typeof t=="number")return t;if(z4o(t))return wdn;if(Rdn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Rdn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(U4o,"");var r=q4o.test(t);return r||j4o.test(t)?H4o(t.slice(2),r?2:8):Q4o.test(t)?wdn:+t}a(J4o,"toNumber");kdn.exports=V4o});var Ndn=I((Sfu,Ddn)=>{p();var Z4o="[object Number]",X4o=Object.prototype,eLo=X4o.toString;function tLo(t){return!!t&&typeof t=="object"}a(tLo,"isObjectLike");function rLo(t){return typeof t=="number"||tLo(t)&&eLo.call(t)==Z4o}a(rLo,"isNumber");Ddn.exports=rLo});var Bdn=I((xfu,Ldn)=>{p();var nLo="[object Object]";function iLo(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(iLo,"isHostObject");function oLo(t,e){return function(r){return t(e(r))}}a(oLo,"overArg");var sLo=Function.prototype,Mdn=Object.prototype,Odn=sLo.toString,aLo=Mdn.hasOwnProperty,cLo=Odn.call(Object),lLo=Mdn.toString,uLo=oLo(Object.getPrototypeOf,Object);function dLo(t){return!!t&&typeof t=="object"}a(dLo,"isObjectLike");function fLo(t){if(!dLo(t)||lLo.call(t)!=nLo||iLo(t))return!1;var e=uLo(t);if(e===null)return!0;var r=aLo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Odn.call(r)==cLo}a(fLo,"isPlainObject");Ldn.exports=fLo});var Udn=I((kfu,Fdn)=>{p();var pLo="[object String]",hLo=Object.prototype,mLo=hLo.toString,gLo=Array.isArray;function ALo(t){return!!t&&typeof t=="object"}a(ALo,"isObjectLike");function yLo(t){return typeof t=="string"||!gLo(t)&&ALo(t)&&mLo.call(t)==pLo}a(yLo,"isString");Fdn.exports=yLo});var Gdn=I((Nfu,Hdn)=>{p();var _Lo="Expected a function",Qdn=1/0,ELo=17976931348623157e292,qdn=NaN,vLo="[object Symbol]",CLo=/^\s+|\s+$/g,bLo=/^[-+]0x[0-9a-f]+$/i,SLo=/^0b[01]+$/i,TLo=/^0o[0-7]+$/i,ILo=parseInt,xLo=Object.prototype,wLo=xLo.toString;function RLo(t,e){var r;if(typeof e!="function")throw new TypeError(_Lo);return t=MLo(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(RLo,"before");function kLo(t){return RLo(2,t)}a(kLo,"once");function jdn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(jdn,"isObject");function PLo(t){return!!t&&typeof t=="object"}a(PLo,"isObjectLike");function DLo(t){return typeof t=="symbol"||PLo(t)&&wLo.call(t)==vLo}a(DLo,"isSymbol");function NLo(t){if(!t)return t===0?t:0;if(t=OLo(t),t===Qdn||t===-Qdn){var e=t<0?-1:1;return e*ELo}return t===t?t:0}a(NLo,"toFinite");function MLo(t){var e=NLo(t),r=e%1;return e===e?r?e-r:e:0}a(MLo,"toInteger");function OLo(t){if(typeof t=="number")return t;if(DLo(t))return qdn;if(jdn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=jdn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(CLo,"");var r=SLo.test(t);return r||TLo.test(t)?ILo(t.slice(2),r?2:8):bLo.test(t)?qdn:+t}a(OLo,"toNumber");Hdn.exports=kLo});var Xdn=I((Lfu,Zdn)=>{p();var $dn=A8t(),LLo=U8t(),BLo=F8t(),Vdn=D$e(),FLo=Sdn(),J$e=Idn(),Wdn=Pdn(),V8t=Ndn(),Ydn=Bdn(),FQ=Udn(),ULo=Gdn(),{KeyObject:QLo,createSecretKey:qLo,createPrivateKey:jLo}=require("crypto"),Kdn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];LLo&&Kdn.splice(3,0,"PS256","PS384","PS512");var HLo={expiresIn:{isValid:a(function(t){return Wdn(t)||FQ(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return Wdn(t)||FQ(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return FQ(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:FLo.bind(null,Kdn),message:'"algorithm" must be a valid string enum value'},header:{isValid:Ydn,message:'"header" must be an object'},encoding:{isValid:FQ,message:'"encoding" must be a string'},issuer:{isValid:FQ,message:'"issuer" must be a string'},subject:{isValid:FQ,message:'"subject" must be a string'},jwtid:{isValid:FQ,message:'"jwtid" must be a string'},noTimestamp:{isValid:J$e,message:'"noTimestamp" must be a boolean'},keyid:{isValid:FQ,message:'"keyid" must be a string'},mutatePayload:{isValid:J$e,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:J$e,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:J$e,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},GLo={iat:{isValid:V8t,message:'"iat" should be a number of seconds'},exp:{isValid:V8t,message:'"exp" should be a number of seconds'},nbf:{isValid:V8t,message:'"nbf" should be a number of seconds'}};function Jdn(t,e,r,n){if(!Ydn(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(o){let s=t[o];if(!s){if(!e)throw new Error('"'+o+'" is not allowed in "'+n+'"');return}if(!s.isValid(r[o]))throw new Error(s.message)})}a(Jdn,"validate");function $Lo(t){return Jdn(HLo,!1,t,"options")}a($Lo,"validateOptions");function VLo(t){return Jdn(GLo,!0,t,"payload")}a(VLo,"validatePayload");var zdn={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},WLo=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Zdn.exports=function(t,e,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let o=typeof t=="object"&&!Buffer.isBuffer(t),s=Object.assign({alg:r.algorithm||"HS256",typ:o?"JWT":void 0,kid:r.keyid},r.header);function c(d){if(n)return n(d);throw d}if(a(c,"failure"),!e&&r.algorithm!=="none")return c(new Error("secretOrPrivateKey must have a value"));if(e!=null&&!(e instanceof QLo))try{e=jLo(e)}catch{try{e=qLo(typeof e=="string"?Buffer.from(e):e)}catch{return c(new Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&e.type!=="secret")return c(new Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));if(/^(?:RS|PS|ES)/.test(s.alg)){if(e.type!=="private")return c(new Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!r.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&e.asymmetricKeyDetails!==void 0&&e.asymmetricKeyDetails.modulusLength<2048)return c(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof t>"u")return c(new Error("payload is required"));if(o){try{VLo(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=WLo.filter(function(f){return typeof r[f]<"u"});if(d.length>0)return c(new Error("invalid "+d.join(",")+" option for "+typeof t+" payload"))}if(typeof t.exp<"u"&&typeof r.expiresIn<"u")return c(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof t.nbf<"u"&&typeof r.notBefore<"u")return c(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{$Lo(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{BLo(s.alg,e)}catch(d){return c(d)}let l=t.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete t.iat:o&&(t.iat=l),typeof r.notBefore<"u"){try{t.nbf=$dn(r.notBefore,l)}catch(d){return c(d)}if(typeof t.nbf>"u")return c(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof t=="object"){try{t.exp=$dn(r.expiresIn,l)}catch(d){return c(d)}if(typeof t.exp>"u")return c(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(zdn).forEach(function(d){let f=zdn[d];if(typeof r[d]<"u"){if(typeof t[f]<"u")return c(new Error('Bad "options.'+d+'" option. The payload already has an "'+f+'" property.'));t[f]=r[d]}});let u=r.encoding||"utf8";if(typeof n=="function")n=n&&ULo(n),Vdn.createSign({header:s,privateKey:e,payload:t,encoding:u}).once("error",n).once("done",function(d){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&d.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));n(null,d)});else{let d=Vdn.sign({header:s,payload:t,secret:e,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&d.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return d}}});var tfn=I((Ufu,efn)=>{p();efn.exports={decode:p8t(),verify:ydn(),sign:Xdn(),JsonWebTokenError:MIe(),NotBeforeError:h8t(),TokenExpiredError:m8t()}});var b6t=I((N_u,tpn)=>{p();function YBo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=g8t(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let k=r.formatters[x];if(typeof k=="function"){let D=_[T];R=k.call(E,D),_.splice(T,1),T--}return R}),r.formatArgs.call(E,_),(E.log||r.log).apply(E,_)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(_=>{m=_},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h,m=(typeof f=="string"?f:"").split(/[\s,]+/),g=m.length;for(h=0;h"-"+h)].join(",");return r.enable(""),f}a(s,"disable");function c(f){if(f[f.length-1]==="*")return!0;let h,m;for(h=0,m=r.skips.length;h{p();W1.formatArgs=JBo;W1.save=ZBo;W1.load=XBo;W1.useColors=KBo;W1.storage=e3o();W1.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();W1.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function KBo(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(KBo,"useColors");function JBo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+wVe.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(JBo,"formatArgs");W1.log=console.debug||console.log||(()=>{});function ZBo(t){try{t?W1.storage.setItem("debug",t):W1.storage.removeItem("debug")}catch{}}a(ZBo,"save");function XBo(){let t;try{t=W1.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(XBo,"load");function e3o(){try{return localStorage}catch{}}a(e3o,"localstorage");wVe.exports=b6t()(W1);var{formatters:t3o}=wVe.exports;t3o.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ipn=I((F_u,npn)=>{"use strict";p();npn.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),o=e.indexOf("--");return n!==-1&&(o===-1||n{"use strict";p();var r3o=require("os"),opn=require("tty"),iw=ipn(),{env:h0}=process,qQ;iw("no-color")||iw("no-colors")||iw("color=false")||iw("color=never")?qQ=0:(iw("color")||iw("colors")||iw("color=true")||iw("color=always"))&&(qQ=1);"FORCE_COLOR"in h0&&(h0.FORCE_COLOR==="true"?qQ=1:h0.FORCE_COLOR==="false"?qQ=0:qQ=h0.FORCE_COLOR.length===0?1:Math.min(parseInt(h0.FORCE_COLOR,10),3));function S6t(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a(S6t,"translateLevel");function T6t(t,e){if(qQ===0)return 0;if(iw("color=16m")||iw("color=full")||iw("color=truecolor"))return 3;if(iw("color=256"))return 2;if(t&&!e&&qQ===void 0)return 0;let r=qQ||0;if(h0.TERM==="dumb")return r;if(process.platform==="win32"){let n=r3o.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in h0)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in h0)||h0.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in h0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(h0.TEAMCITY_VERSION)?1:0;if(h0.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in h0){let n=parseInt((h0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(h0.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(h0.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(h0.TERM)||"COLORTERM"in h0?1:r}a(T6t,"supportsColor");function n3o(t){let e=T6t(t,t&&t.isTTY);return S6t(e)}a(n3o,"getSupportLevel");spn.exports={supportsColor:n3o,stdout:S6t(T6t(!0,opn.isatty(1))),stderr:S6t(T6t(!0,opn.isatty(2)))}});var cpn=I((BA,PVe)=>{p();var i3o=require("tty"),kVe=require("util");BA.init=d3o;BA.log=c3o;BA.formatArgs=s3o;BA.save=l3o;BA.load=u3o;BA.useColors=o3o;BA.destroy=kVe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");BA.colors=[6,2,3,4,5,1];try{let t=RVe();t&&(t.stderr||t).level>=2&&(BA.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}BA.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function o3o(){return"colors"in BA.inspectOpts?!!BA.inspectOpts.colors:i3o.isatty(process.stderr.fd)}a(o3o,"useColors");function s3o(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` + "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,DIe="secret must be a string or buffer",Ele="key must be a string or a buffer",WDo="key must be a string, a buffer or an object",l8t=typeof ew.createPublicKey=="function";l8t&&(Ele+=" or a KeyObject",DIe+="or a KeyObject");function Qcn(t){if(!vle.isBuffer(t)&&typeof t!="string"&&(!l8t||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw VP(Ele)}a(Qcn,"checkIsPublicKey");function qcn(t){if(!vle.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw VP(WDo)}a(qcn,"checkIsPrivateKey");function zDo(t){if(!vle.isBuffer(t)){if(typeof t=="string")return t;if(!l8t||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw VP(DIe)}}a(zDo,"checkIsSecretKey");function u8t(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(u8t,"fromBase64");function jcn(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var iNo=require("buffer").Buffer;Wcn.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||iNo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var Xcn=I((ulu,Zcn)=>{p();var oNo=_le().Buffer,zcn=o8t(),sNo=d8t(),aNo=require("stream"),Ycn=f8t(),p8t=require("util");function Kcn(t,e){return oNo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(Kcn,"base64url");function cNo(t,e,r){r=r||"utf8";var n=Kcn(Ycn(t),"binary"),o=Kcn(Ycn(e),r);return p8t.format("%s.%s",n,o)}a(cNo,"jwsSecuredInput");function Jcn(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=sNo(e.alg),c=cNo(e,r,o),l=s.sign(c,n);return p8t.format("%s.%s",c,l)}a(Jcn,"jwsSign");function k$e(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new zcn(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new zcn(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}a(k$e,"SignStream");p8t.inherits(k$e,aNo);k$e.prototype.sign=a(function(){try{var e=Jcn({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}},"sign");k$e.sign=Jcn;Zcn.exports=k$e});var lln=I((plu,cln)=>{p();var tln=_le().Buffer,eln=o8t(),lNo=d8t(),uNo=require("stream"),rln=f8t(),dNo=require("util"),fNo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function pNo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(pNo,"isObject");function hNo(t){if(pNo(t))return t;try{return JSON.parse(t)}catch{return}}a(hNo,"safeJsonParse");function nln(t){var e=t.split(".",1)[0];return hNo(tln.from(e,"base64").toString("binary"))}a(nln,"headerFromJWS");function mNo(t){return t.split(".",2).join(".")}a(mNo,"securedInputFromJWS");function iln(t){return t.split(".")[2]}a(iln,"signatureFromJWS");function gNo(t,e){e=e||"utf8";var r=t.split(".")[1];return tln.from(r,"base64").toString(e)}a(gNo,"payloadFromJWS");function oln(t){return fNo.test(t)&&!!nln(t)}a(oln,"isValidJws");function sln(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=rln(t);var o=iln(t),s=mNo(t),c=lNo(e);return c.verify(s,o,r)}a(sln,"jwsVerify");function aln(t,e){if(e=e||{},t=rln(t),!oln(t))return null;var r=nln(t);if(!r)return null;var n=gNo(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:iln(t)}}a(aln,"jwsDecode");function Cle(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new eln(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new eln(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}a(Cle,"VerifyStream");dNo.inherits(Cle,uNo);Cle.prototype.verify=a(function(){try{var e=sln(this.signature.buffer,this.algorithm,this.key.buffer),r=aln(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"verify");Cle.decode=aln;Cle.isValid=oln;Cle.verify=sln;cln.exports=Cle});var D$e=I(LQ=>{p();var uln=Xcn(),P$e=lln(),ANo=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];LQ.ALGORITHMS=ANo;LQ.sign=uln.sign;LQ.verify=P$e.verify;LQ.decode=P$e.decode;LQ.isValid=P$e.isValid;LQ.createSign=a(function(e){return new uln(e)},"createSign");LQ.createVerify=a(function(e){return new P$e(e)},"createVerify")});var h8t=I((_lu,dln)=>{p();var yNo=D$e();dln.exports=function(t,e){e=e||{};var r=yNo.decode(t,e);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var o=JSON.parse(n);o!==null&&typeof o=="object"&&(n=o)}catch{}return e.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var MIe=I((vlu,fln)=>{p();var N$e=a(function(t,e){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,e&&(this.inner=e)},"JsonWebTokenError");N$e.prototype=Object.create(Error.prototype);N$e.prototype.constructor=N$e;fln.exports=N$e});var m8t=I((Slu,hln)=>{p();var pln=MIe(),M$e=a(function(t,e){pln.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");M$e.prototype=Object.create(pln.prototype);M$e.prototype.constructor=M$e;hln.exports=M$e});var g8t=I((xlu,gln)=>{p();var mln=MIe(),O$e=a(function(t,e){mln.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");O$e.prototype=Object.create(mln.prototype);O$e.prototype.constructor=O$e;gln.exports=O$e});var A8t=I((klu,Aln)=>{p();var ble=1e3,Sle=ble*60,Tle=Sle*60,_K=Tle*24,_No=_K*7,ENo=_K*365.25;Aln.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return vNo(t);if(r==="number"&&isFinite(t))return e.long?bNo(t):CNo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function vNo(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*ENo;case"weeks":case"week":case"w":return r*_No;case"days":case"day":case"d":return r*_K;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Tle;case"minutes":case"minute":case"mins":case"min":case"m":return r*Sle;case"seconds":case"second":case"secs":case"sec":case"s":return r*ble;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(vNo,"parse");function CNo(t){var e=Math.abs(t);return e>=_K?Math.round(t/_K)+"d":e>=Tle?Math.round(t/Tle)+"h":e>=Sle?Math.round(t/Sle)+"m":e>=ble?Math.round(t/ble)+"s":t+"ms"}a(CNo,"fmtShort");function bNo(t){var e=Math.abs(t);return e>=_K?L$e(t,e,_K,"day"):e>=Tle?L$e(t,e,Tle,"hour"):e>=Sle?L$e(t,e,Sle,"minute"):e>=ble?L$e(t,e,ble,"second"):t+" ms"}a(bNo,"fmtLong");function L$e(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(L$e,"plural")});var y8t=I((Nlu,yln)=>{p();var SNo=A8t();yln.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=SNo(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var Ile=I((Olu,_ln)=>{"use strict";p();var TNo="2.0.0",INo=Number.MAX_SAFE_INTEGER||9007199254740991,xNo=16,wNo=250,RNo=["major","premajor","minor","preminor","patch","prepatch","prerelease"];_ln.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:xNo,MAX_SAFE_BUILD_LENGTH:wNo,MAX_SAFE_INTEGER:INo,RELEASE_TYPES:RNo,SEMVER_SPEC_VERSION:TNo,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var OIe=I((Blu,Eln)=>{"use strict";p();var kNo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Eln.exports=kNo});var xle=I((bO,vln)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:_8t,MAX_SAFE_BUILD_LENGTH:PNo,MAX_LENGTH:DNo}=Ile(),NNo=OIe();bO=vln.exports={};var MNo=bO.re=[],ONo=bO.safeRe=[],wn=bO.src=[],LNo=bO.safeSrc=[],Rn=bO.t={},BNo=0,E8t="[a-zA-Z0-9-]",FNo=[["\\s",1],["\\d",DNo],[E8t,PNo]],UNo=a(t=>{for(let[e,r]of FNo)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Ho=a((t,e,r)=>{let n=UNo(e),o=BNo++;NNo(t,o,e),Rn[t]=o,wn[o]=e,LNo[o]=n,MNo[o]=new RegExp(e,r?"g":void 0),ONo[o]=new RegExp(n,r?"g":void 0)},"createToken");Ho("NUMERICIDENTIFIER","0|[1-9]\\d*");Ho("NUMERICIDENTIFIERLOOSE","\\d+");Ho("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${E8t}*`);Ho("MAINVERSION",`(${wn[Rn.NUMERICIDENTIFIER]})\\.(${wn[Rn.NUMERICIDENTIFIER]})\\.(${wn[Rn.NUMERICIDENTIFIER]})`);Ho("MAINVERSIONLOOSE",`(${wn[Rn.NUMERICIDENTIFIERLOOSE]})\\.(${wn[Rn.NUMERICIDENTIFIERLOOSE]})\\.(${wn[Rn.NUMERICIDENTIFIERLOOSE]})`);Ho("PRERELEASEIDENTIFIER",`(?:${wn[Rn.NONNUMERICIDENTIFIER]}|${wn[Rn.NUMERICIDENTIFIER]})`);Ho("PRERELEASEIDENTIFIERLOOSE",`(?:${wn[Rn.NONNUMERICIDENTIFIER]}|${wn[Rn.NUMERICIDENTIFIERLOOSE]})`);Ho("PRERELEASE",`(?:-(${wn[Rn.PRERELEASEIDENTIFIER]}(?:\\.${wn[Rn.PRERELEASEIDENTIFIER]})*))`);Ho("PRERELEASELOOSE",`(?:-?(${wn[Rn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${wn[Rn.PRERELEASEIDENTIFIERLOOSE]})*))`);Ho("BUILDIDENTIFIER",`${E8t}+`);Ho("BUILD",`(?:\\+(${wn[Rn.BUILDIDENTIFIER]}(?:\\.${wn[Rn.BUILDIDENTIFIER]})*))`);Ho("FULLPLAIN",`v?${wn[Rn.MAINVERSION]}${wn[Rn.PRERELEASE]}?${wn[Rn.BUILD]}?`);Ho("FULL",`^${wn[Rn.FULLPLAIN]}$`);Ho("LOOSEPLAIN",`[v=\\s]*${wn[Rn.MAINVERSIONLOOSE]}${wn[Rn.PRERELEASELOOSE]}?${wn[Rn.BUILD]}?`);Ho("LOOSE",`^${wn[Rn.LOOSEPLAIN]}$`);Ho("GTLT","((?:<|>)?=?)");Ho("XRANGEIDENTIFIERLOOSE",`${wn[Rn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Ho("XRANGEIDENTIFIER",`${wn[Rn.NUMERICIDENTIFIER]}|x|X|\\*`);Ho("XRANGEPLAIN",`[v=\\s]*(${wn[Rn.XRANGEIDENTIFIER]})(?:\\.(${wn[Rn.XRANGEIDENTIFIER]})(?:\\.(${wn[Rn.XRANGEIDENTIFIER]})(?:${wn[Rn.PRERELEASE]})?${wn[Rn.BUILD]}?)?)?`);Ho("XRANGEPLAINLOOSE",`[v=\\s]*(${wn[Rn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${wn[Rn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${wn[Rn.XRANGEIDENTIFIERLOOSE]})(?:${wn[Rn.PRERELEASELOOSE]})?${wn[Rn.BUILD]}?)?)?`);Ho("XRANGE",`^${wn[Rn.GTLT]}\\s*${wn[Rn.XRANGEPLAIN]}$`);Ho("XRANGELOOSE",`^${wn[Rn.GTLT]}\\s*${wn[Rn.XRANGEPLAINLOOSE]}$`);Ho("COERCEPLAIN",`(^|[^\\d])(\\d{1,${_8t}})(?:\\.(\\d{1,${_8t}}))?(?:\\.(\\d{1,${_8t}}))?`);Ho("COERCE",`${wn[Rn.COERCEPLAIN]}(?:$|[^\\d])`);Ho("COERCEFULL",wn[Rn.COERCEPLAIN]+`(?:${wn[Rn.PRERELEASE]})?(?:${wn[Rn.BUILD]})?(?:$|[^\\d])`);Ho("COERCERTL",wn[Rn.COERCE],!0);Ho("COERCERTLFULL",wn[Rn.COERCEFULL],!0);Ho("LONETILDE","(?:~>?)");Ho("TILDETRIM",`(\\s*)${wn[Rn.LONETILDE]}\\s+`,!0);bO.tildeTrimReplace="$1~";Ho("TILDE",`^${wn[Rn.LONETILDE]}${wn[Rn.XRANGEPLAIN]}$`);Ho("TILDELOOSE",`^${wn[Rn.LONETILDE]}${wn[Rn.XRANGEPLAINLOOSE]}$`);Ho("LONECARET","(?:\\^)");Ho("CARETTRIM",`(\\s*)${wn[Rn.LONECARET]}\\s+`,!0);bO.caretTrimReplace="$1^";Ho("CARET",`^${wn[Rn.LONECARET]}${wn[Rn.XRANGEPLAIN]}$`);Ho("CARETLOOSE",`^${wn[Rn.LONECARET]}${wn[Rn.XRANGEPLAINLOOSE]}$`);Ho("COMPARATORLOOSE",`^${wn[Rn.GTLT]}\\s*(${wn[Rn.LOOSEPLAIN]})$|^$`);Ho("COMPARATOR",`^${wn[Rn.GTLT]}\\s*(${wn[Rn.FULLPLAIN]})$|^$`);Ho("COMPARATORTRIM",`(\\s*)${wn[Rn.GTLT]}\\s*(${wn[Rn.LOOSEPLAIN]}|${wn[Rn.XRANGEPLAIN]})`,!0);bO.comparatorTrimReplace="$1$2$3";Ho("HYPHENRANGE",`^\\s*(${wn[Rn.XRANGEPLAIN]})\\s+-\\s+(${wn[Rn.XRANGEPLAIN]})\\s*$`);Ho("HYPHENRANGELOOSE",`^\\s*(${wn[Rn.XRANGEPLAINLOOSE]})\\s+-\\s+(${wn[Rn.XRANGEPLAINLOOSE]})\\s*$`);Ho("STAR","(<|>)?=?\\s*\\*");Ho("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Ho("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var B$e=I((qlu,Cln)=>{"use strict";p();var QNo=Object.freeze({loose:!0}),qNo=Object.freeze({}),jNo=a(t=>t?typeof t!="object"?QNo:t:qNo,"parseOptions");Cln.exports=jNo});var v8t=I((Glu,Tln)=>{"use strict";p();var bln=/^[0-9]+$/,Sln=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tSln(e,t),"rcompareIdentifiers");Tln.exports={compareIdentifiers:Sln,rcompareIdentifiers:HNo}});var MA=I((Wlu,xln)=>{"use strict";p();var F$e=OIe(),{MAX_LENGTH:Iln,MAX_SAFE_INTEGER:U$e}=Ile(),{safeRe:Q$e,t:q$e}=xle(),GNo=B$e(),{compareIdentifiers:C8t}=v8t(),$No=a((t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;nIln)throw new TypeError(`version is longer than ${Iln} characters`);F$e("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Q$e[q$e.LOOSE]:Q$e[q$e.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>U$e||this.major<0)throw new TypeError("Invalid major version");if(this.minor>U$e||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>U$e||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&se.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],o=e.prerelease[r];if(F$e("prerelease compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return C8t(n,o)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],o=e.build[r];if(F$e("build compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return C8t(n,o)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let o=`-${r}`.match(this.options.loose?Q$e[q$e.PRERELEASELOOSE]:Q$e[q$e.PRERELEASE]);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(r){let s=[r,o];if(n===!1&&(s=[r]),$No(this.prerelease,r)){let c=this.prerelease[r.split(".").length];isNaN(c)&&(this.prerelease=s)}else this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};xln.exports=b8t});var BQ=I((Klu,Rln)=>{"use strict";p();var wln=MA(),VNo=a((t,e,r=!1)=>{if(t instanceof wln)return t;try{return new wln(t,e)}catch(n){if(!r)return null;throw n}},"parse");Rln.exports=VNo});var Pln=I((Xlu,kln)=>{"use strict";p();var WNo=BQ(),zNo=a((t,e)=>{let r=WNo(t,e);return r?r.version:null},"valid");kln.exports=zNo});var Nln=I((ruu,Dln)=>{"use strict";p();var YNo=BQ(),KNo=a((t,e)=>{let r=YNo(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");Dln.exports=KNo});var Lln=I((ouu,Oln)=>{"use strict";p();var Mln=MA(),JNo=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Mln(t instanceof Mln?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");Oln.exports=JNo});var Uln=I((cuu,Fln)=>{"use strict";p();var Bln=BQ(),ZNo=a((t,e)=>{let r=Bln(t,null,!0),n=Bln(e,null,!0),o=r.compare(n);if(o===0)return null;let s=o>0,c=s?r:n,l=s?n:r,u=!!c.prerelease.length;if(!!l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(l.compareMain(c)===0)return l.minor&&!l.patch?"minor":"patch"}let f=u?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"},"diff");Fln.exports=ZNo});var qln=I((duu,Qln)=>{"use strict";p();var XNo=MA(),eMo=a((t,e)=>new XNo(t,e).major,"major");Qln.exports=eMo});var Hln=I((huu,jln)=>{"use strict";p();var tMo=MA(),rMo=a((t,e)=>new tMo(t,e).minor,"minor");jln.exports=rMo});var $ln=I((Auu,Gln)=>{"use strict";p();var nMo=MA(),iMo=a((t,e)=>new nMo(t,e).patch,"patch");Gln.exports=iMo});var Wln=I((Euu,Vln)=>{"use strict";p();var oMo=BQ(),sMo=a((t,e)=>{let r=oMo(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");Vln.exports=sMo});var tw=I((buu,Yln)=>{"use strict";p();var zln=MA(),aMo=a((t,e,r)=>new zln(t,r).compare(new zln(e,r)),"compare");Yln.exports=aMo});var Jln=I((Iuu,Kln)=>{"use strict";p();var cMo=tw(),lMo=a((t,e,r)=>cMo(e,t,r),"rcompare");Kln.exports=lMo});var Xln=I((Ruu,Zln)=>{"use strict";p();var uMo=tw(),dMo=a((t,e)=>uMo(t,e,!0),"compareLoose");Zln.exports=dMo});var j$e=I((Duu,tun)=>{"use strict";p();var eun=MA(),fMo=a((t,e,r)=>{let n=new eun(t,r),o=new eun(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");tun.exports=fMo});var iun=I((Ouu,nun)=>{"use strict";p();var pMo=j$e(),hMo=a((t,e)=>t.sort((r,n)=>pMo(r,n,e)),"sort");nun.exports=hMo});var sun=I((Fuu,oun)=>{"use strict";p();var mMo=j$e(),gMo=a((t,e)=>t.sort((r,n)=>mMo(n,r,e)),"rsort");oun.exports=gMo});var LIe=I((quu,aun)=>{"use strict";p();var AMo=tw(),yMo=a((t,e,r)=>AMo(t,e,r)>0,"gt");aun.exports=yMo});var H$e=I((Guu,cun)=>{"use strict";p();var _Mo=tw(),EMo=a((t,e,r)=>_Mo(t,e,r)<0,"lt");cun.exports=EMo});var S8t=I((Wuu,lun)=>{"use strict";p();var vMo=tw(),CMo=a((t,e,r)=>vMo(t,e,r)===0,"eq");lun.exports=CMo});var T8t=I((Kuu,uun)=>{"use strict";p();var bMo=tw(),SMo=a((t,e,r)=>bMo(t,e,r)!==0,"neq");uun.exports=SMo});var G$e=I((Xuu,dun)=>{"use strict";p();var TMo=tw(),IMo=a((t,e,r)=>TMo(t,e,r)>=0,"gte");dun.exports=IMo});var $$e=I((rdu,fun)=>{"use strict";p();var xMo=tw(),wMo=a((t,e,r)=>xMo(t,e,r)<=0,"lte");fun.exports=wMo});var I8t=I((odu,pun)=>{"use strict";p();var RMo=S8t(),kMo=T8t(),PMo=LIe(),DMo=G$e(),NMo=H$e(),MMo=$$e(),OMo=a((t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return RMo(t,r,n);case"!=":return kMo(t,r,n);case">":return PMo(t,r,n);case">=":return DMo(t,r,n);case"<":return NMo(t,r,n);case"<=":return MMo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");pun.exports=OMo});var mun=I((cdu,hun)=>{"use strict";p();var LMo=MA(),BMo=BQ(),{safeRe:V$e,t:W$e}=xle(),FMo=a((t,e)=>{if(t instanceof LMo)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?V$e[W$e.COERCEFULL]:V$e[W$e.COERCE]);else{let u=e.includePrerelease?V$e[W$e.COERCERTLFULL]:V$e[W$e.COERCERTL],d;for(;(d=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||d.index+d[0].length!==r.index+r[0].length)&&(r=d),u.lastIndex=d.index+d[1].length+d[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",s=r[4]||"0",c=e.includePrerelease&&r[5]?`-${r[5]}`:"",l=e.includePrerelease&&r[6]?`+${r[6]}`:"";return BMo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");hun.exports=FMo});var Aun=I((ddu,gun)=>{"use strict";p();var UMo=BQ(),QMo=Ile(),qMo=MA(),jMo=a((t,e,r)=>{if(!QMo.RELEASE_TYPES.includes(e))return null;let n=HMo(t,r);return n&&GMo(n,e)},"truncate"),HMo=a((t,e)=>{let r=t instanceof qMo?t.version:t;return UMo(r,e)},"cloneInputVersion"),GMo=a((t,e)=>{if($Mo(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},"doTruncation"),$Mo=a(t=>t.startsWith("pre"),"isPrerelease");gun.exports=jMo});var _un=I((hdu,yun)=>{"use strict";p();var x8t=class{static{a(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,r)}return this}};yun.exports=x8t});var rw=I((Adu,bun)=>{"use strict";p();var VMo=/\s+/g,w8t=class t{static{a(this,"Range")}constructor(e,r){if(r=zMo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof R8t)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(VMo," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(o=>!vun(o[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&nOo(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(rOo,"");let n=((this.options.includePrerelease&&eOo)|(this.options.loose&&tOo))+":"+e,o=Eun.get(n);if(o)return o;let s=this.options.loose,c=s?YE[OA.HYPHENRANGELOOSE]:YE[OA.HYPHENRANGE];e=e.replace(c,hOo(this.options.includePrerelease)),ad("hyphen replace",e),e=e.replace(YE[OA.COMPARATORTRIM],JMo),ad("comparator trim",e),e=e.replace(YE[OA.TILDETRIM],ZMo),ad("tilde trim",e),e=e.replace(YE[OA.CARETTRIM],XMo),ad("caret trim",e);let l=e.split(" ").map(h=>iOo(h,this.options)).join(" ").split(/\s+/).map(h=>pOo(h,this.options));s&&(l=l.filter(h=>(ad("loose invalid filter",h,this.options),!!h.match(YE[OA.COMPARATORLOOSE])))),ad("range list",l);let u=new Map,d=l.map(h=>new R8t(h,this.options));for(let h of d){if(vun(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return Eun.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Cun(n,r)&&e.set.some(o=>Cun(o,r)&&n.every(s=>o.every(c=>s.intersects(c,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new YMo(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),nOo=a(t=>t.value==="","isAny"),Cun=a((t,e)=>{let r=!0,n=t.slice(),o=n.pop();for(;r&&n.length;)r=n.every(s=>o.intersects(s,e)),o=n.pop();return r},"isSatisfiable"),iOo=a((t,e)=>(t=t.replace(YE[OA.BUILD],""),ad("comp",t,e),t=cOo(t,e),ad("caret",t),t=sOo(t,e),ad("tildes",t),t=uOo(t,e),ad("xrange",t),t=fOo(t,e),ad("stars",t),t),"parseComparator"),Ag=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),oOo=a((t,e,r)=>Ag(t)&&!Ag(e)||Ag(e)&&r&&!Ag(r),"invalidXRangeOrder"),sOo=a((t,e)=>t.trim().split(/\s+/).map(r=>aOo(r,e)).join(" "),"replaceTildes"),aOo=a((t,e)=>{let r=e.loose?YE[OA.TILDELOOSE]:YE[OA.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{ad("tilde",t,o,s,c,l,u);let d;return Ag(s)?d="":Ag(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Ag(l)?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:u?(ad("replaceTilde pr",u),d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`):d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`,ad("tilde return",d),d})},"replaceTilde"),cOo=a((t,e)=>t.trim().split(/\s+/).map(r=>lOo(r,e)).join(" "),"replaceCarets"),lOo=a((t,e)=>{ad("caret",t,e);let r=e.loose?YE[OA.CARETLOOSE]:YE[OA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{ad("caret",t,o,s,c,l,u);let d;return Ag(s)?d="":Ag(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Ag(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(ad("replaceCaret pr",u),s==="0"?c==="0"?d=`>=${s}.${c}.${l}-${u} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l}-${u} <${+s+1}.0.0-0`):(ad("no pr"),s==="0"?c==="0"?d=`>=${s}.${c}.${l} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`),ad("caret return",d),d})},"replaceCaret"),uOo=a((t,e)=>(ad("replaceXRanges",t,e),t.split(/\s+/).map(r=>dOo(r,e)).join(" ")),"replaceXRanges"),dOo=a((t,e)=>{t=t.trim();let r=e.loose?YE[OA.XRANGELOOSE]:YE[OA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{if(ad("xRange",t,n,o,s,c,l,u),oOo(s,c,l))return t;let d=Ag(s),f=d||Ag(c),h=f||Ag(l),m=h;return o==="="&&m&&(o=""),u=e.includePrerelease?"-0":"",d?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),o==="<"&&(u="-0"),n=`${o+s}.${c}.${l}${u}`):f?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${c}.0${u} <${s}.${+c+1}.0-0`),ad("xRange return",n),n})},"replaceXRange"),fOo=a((t,e)=>(ad("replaceStars",t,e),t.trim().replace(YE[OA.STAR],"")),"replaceStars"),pOo=a((t,e)=>(ad("replaceGTE0",t,e),t.trim().replace(YE[e.includePrerelease?OA.GTE0PRE:OA.GTE0],"")),"replaceGTE0"),hOo=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(Ag(n)?r="":Ag(o)?r=`>=${n}.0.0${t?"-0":""}`:Ag(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ag(d)?u="":Ag(f)?u=`<${+d+1}.0.0-0`:Ag(h)?u=`<${d}.${+f+1}.0-0`:m?u=`<=${d}.${f}.${h}-${m}`:t?u=`<${d}.${f}.${+h+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),"hyphenReplace"),mOo=a((t,e,r)=>{for(let n=0;n0){let o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0},"testSet")});var BIe=I((Edu,Run)=>{"use strict";p();var FIe=Symbol("SemVer ANY"),D8t=class t{static{a(this,"Comparator")}static get ANY(){return FIe}constructor(e,r){if(r=Sun(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),P8t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===FIe?this.value="":this.value=this.operator+this.semver.version,P8t("comp",this)}parse(e){let r=this.options.loose?Tun[Iun.COMPARATORLOOSE]:Tun[Iun.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new xun(n[2],this.options.loose):this.semver=FIe}toString(){return this.value}test(e){if(P8t("Comparator.test",e,this.options.loose),this.semver===FIe||e===FIe)return!0;if(typeof e=="string")try{e=new xun(e,this.options)}catch{return!1}return k8t(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new wun(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new wun(this.value,r).test(e.semver):(r=Sun(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||k8t(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||k8t(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Run.exports=D8t;var Sun=B$e(),{safeRe:Tun,t:Iun}=xle(),k8t=I8t(),P8t=OIe(),xun=MA(),wun=rw()});var UIe=I((bdu,kun)=>{"use strict";p();var gOo=rw(),AOo=a((t,e,r)=>{try{e=new gOo(e,r)}catch{return!1}return e.test(t)},"satisfies");kun.exports=AOo});var Dun=I((Idu,Pun)=>{"use strict";p();var yOo=rw(),_Oo=a((t,e)=>new yOo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");Pun.exports=_Oo});var Mun=I((Rdu,Nun)=>{"use strict";p();var EOo=MA(),vOo=rw(),COo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new vOo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new EOo(n,r))}),n},"maxSatisfying");Nun.exports=COo});var Lun=I((Ddu,Oun)=>{"use strict";p();var bOo=MA(),SOo=rw(),TOo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new SOo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new bOo(n,r))}),n},"minSatisfying");Oun.exports=TOo});var Qun=I((Odu,Uun)=>{"use strict";p();var N8t=MA(),IOo=rw(),Fun=LIe(),xOo=a((t,e)=>{t=new IOo(t,e);let r=new N8t("0.0.0");if(t.test(r)||(r=new N8t("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new N8t(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||Fun(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||Fun(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");Uun.exports=xOo});var jun=I((Fdu,qun)=>{"use strict";p();var wOo=rw(),ROo=a((t,e)=>{try{return new wOo(t,e).range||"*"}catch{return null}},"validRange");qun.exports=ROo});var z$e=I((qdu,Vun)=>{"use strict";p();var kOo=MA(),$un=BIe(),{ANY:POo}=$un,DOo=rw(),NOo=UIe(),Hun=LIe(),Gun=H$e(),MOo=$$e(),OOo=G$e(),LOo=a((t,e,r,n)=>{t=new kOo(t,n),e=new DOo(e,n);let o,s,c,l,u;switch(r){case">":o=Hun,s=MOo,c=Gun,l=">",u=">=";break;case"<":o=Gun,s=OOo,c=Hun,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(NOo(t,e,n))return!1;for(let d=0;d{g.semver===POo&&(g=new $un(">=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0},"outside");Vun.exports=LOo});var zun=I((Gdu,Wun)=>{"use strict";p();var BOo=z$e(),FOo=a((t,e,r)=>BOo(t,e,">",r),"gtr");Wun.exports=FOo});var Kun=I((Wdu,Yun)=>{"use strict";p();var UOo=z$e(),QOo=a((t,e,r)=>UOo(t,e,"<",r),"ltr");Yun.exports=QOo});var Xun=I((Kdu,Zun)=>{"use strict";p();var Jun=rw(),qOo=a((t,e,r)=>(t=new Jun(t,r),e=new Jun(e,r),t.intersects(e,r)),"intersects");Zun.exports=qOo});var tdn=I((Xdu,edn)=>{"use strict";p();var jOo=UIe(),HOo=tw();edn.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>HOo(f,h,r));for(let f of c)jOo(f,e,r)?(s=f,o||(o=f)):(s&&n.push([o,s]),s=null,o=null);o&&n.push([o,null]);let l=[];for(let[f,h]of n)f===h?l.push(f):!h&&f===c[0]?l.push("*"):h?f===c[0]?l.push(`<=${h}`):l.push(`${f} - ${h}`):l.push(`>=${f}`);let u=l.join(" || "),d=typeof e.raw=="string"?e.raw:String(e);return u.length{"use strict";p();var rdn=rw(),L8t=BIe(),{ANY:M8t}=L8t,O8t=UIe(),B8t=tw(),GOo=a((t,e,r={})=>{if(t===e)return!0;t=new rdn(t,r),e=new rdn(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=VOo(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),$Oo=[new L8t(">=0.0.0-0")],ndn=[new L8t(">=0.0.0")],VOo=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===M8t){if(e.length===1&&e[0].semver===M8t)return!0;r.includePrerelease?t=$Oo:t=ndn}if(e.length===1&&e[0].semver===M8t){if(r.includePrerelease)return!0;e=ndn}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=idn(o,g,r):g.operator==="<"||g.operator==="<="?s=odn(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=B8t(o.semver,s.semver,r),c>0)return null;if(c===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(o&&!O8t(g,String(o),r)||s&&!O8t(g,String(s),r))return null;for(let A of e)if(!O8t(g,String(A),r))return!1;return!0}let l,u,d,f,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let g of e){if(f=f||g.operator===">"||g.operator===">=",d=d||g.operator==="<"||g.operator==="<=",o){if(m&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===m.major&&g.semver.minor===m.minor&&g.semver.patch===m.patch&&(m=!1),g.operator===">"||g.operator===">="){if(l=idn(o,g,r),l===g&&l!==o)return!1}else if(o.operator===">="&&!g.test(o.semver))return!1}if(s){if(h&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===h.major&&g.semver.minor===h.minor&&g.semver.patch===h.patch&&(h=!1),g.operator==="<"||g.operator==="<="){if(u=odn(s,g,r),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||o)&&c!==0)return!1}return!(o&&d&&!s&&c!==0||s&&f&&!o&&c!==0||m||h)},"simpleSubset"),idn=a((t,e,r)=>{if(!t)return e;let n=B8t(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),odn=a((t,e,r)=>{if(!t)return e;let n=B8t(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");sdn.exports=GOo});var WP=I((ifu,udn)=>{"use strict";p();var F8t=xle(),cdn=Ile(),WOo=MA(),ldn=v8t(),zOo=BQ(),YOo=Pln(),KOo=Nln(),JOo=Lln(),ZOo=Uln(),XOo=qln(),e5o=Hln(),t5o=$ln(),r5o=Wln(),n5o=tw(),i5o=Jln(),o5o=Xln(),s5o=j$e(),a5o=iun(),c5o=sun(),l5o=LIe(),u5o=H$e(),d5o=S8t(),f5o=T8t(),p5o=G$e(),h5o=$$e(),m5o=I8t(),g5o=mun(),A5o=Aun(),y5o=BIe(),_5o=rw(),E5o=UIe(),v5o=Dun(),C5o=Mun(),b5o=Lun(),S5o=Qun(),T5o=jun(),I5o=z$e(),x5o=zun(),w5o=Kun(),R5o=Xun(),k5o=tdn(),P5o=adn();udn.exports={parse:zOo,valid:YOo,clean:KOo,inc:JOo,diff:ZOo,major:XOo,minor:e5o,patch:t5o,prerelease:r5o,compare:n5o,rcompare:i5o,compareLoose:o5o,compareBuild:s5o,sort:a5o,rsort:c5o,gt:l5o,lt:u5o,eq:d5o,neq:f5o,gte:p5o,lte:h5o,cmp:m5o,coerce:g5o,truncate:A5o,Comparator:y5o,Range:_5o,satisfies:E5o,toComparators:v5o,maxSatisfying:C5o,minSatisfying:b5o,minVersion:S5o,validRange:T5o,outside:I5o,gtr:x5o,ltr:w5o,intersects:R5o,simplifyRange:k5o,subset:P5o,SemVer:WOo,re:F8t.re,src:F8t.src,tokens:F8t.t,SEMVER_SPEC_VERSION:cdn.SEMVER_SPEC_VERSION,RELEASE_TYPES:cdn.RELEASE_TYPES,compareIdentifiers:ldn.compareIdentifiers,rcompareIdentifiers:ldn.rcompareIdentifiers}});var fdn=I((sfu,ddn)=>{p();var D5o=WP();ddn.exports=D5o.satisfies(process.version,">=15.7.0")});var hdn=I((cfu,pdn)=>{p();var N5o=WP();pdn.exports=N5o.satisfies(process.version,">=16.9.0")});var U8t=I((ufu,mdn)=>{p();var M5o=fdn(),O5o=hdn(),L5o={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},B5o={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};mdn.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=L5o[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(t))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(M5o)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=B5o[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(O5o){let c=parseInt(t.slice(-3),10),{hashAlgorithm:l,mgf1HashAlgorithm:u,saltLength:d}=e.asymmetricKeyDetails;if(l!==`sha${c}`||u!==l)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${t}.`);if(d!==void 0&&d>c>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${t}.`)}break}}});var Q8t=I((ffu,gdn)=>{p();var F5o=WP();gdn.exports=F5o.satisfies(process.version,"^6.12.0 || >=8.0.0")});var _dn=I((hfu,ydn)=>{p();var Tu=MIe(),U5o=m8t(),Adn=g8t(),Q5o=h8t(),q5o=y8t(),j5o=U8t(),H5o=Q8t(),G5o=D$e(),{KeyObject:$5o,createSecretKey:V5o,createPublicKey:W5o}=require("crypto"),q8t=["RS256","RS384","RS512"],z5o=["ES256","ES384","ES512"],j8t=["RS256","RS384","RS512"],Y5o=["HS256","HS384","HS512"];H5o&&(q8t.splice(q8t.length,0,"PS256","PS384","PS512"),j8t.splice(j8t.length,0,"PS256","PS384","PS512"));ydn.exports=function(t,e,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let o;if(n?o=n:o=a(function(f,h){if(f)throw f;return h},"done"),r.clockTimestamp&&typeof r.clockTimestamp!="number")return o(new Tu("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new Tu("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new Tu("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new Tu("jwt must be provided"));if(typeof t!="string")return o(new Tu("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new Tu("jwt malformed"));let l;try{l=Q5o(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new Tu("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new Tu("verify must be called asynchronous if secret or public key is provided as a callback"));d=e}else d=a(function(f,h){return h(null,e)},"getSecret");return d(u,function(f,h){if(f)return o(new Tu("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new Tu("jwt signature is required"));if(m&&!h)return o(new Tu("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new Tu('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof $5o))try{h=W5o(h)}catch{try{h=V5o(typeof h=="string"?Buffer.from(h):h)}catch{return o(new Tu("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=Y5o:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=j8t:h.asymmetricKeyType==="ec"?r.algorithms=z5o:r.algorithms=q8t),r.algorithms.indexOf(l.header.alg)===-1)return o(new Tu("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new Tu(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new Tu(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{j5o(u.alg,h)}catch(y){return o(y)}let g;try{g=G5o.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new Tu("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new Tu("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new U5o("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new Tu("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new Adn("jwt expired",new Date(A.exp*1e3)))}if(r.audience){let y=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(A.aud)?A.aud:[A.aud]).some(function(v){return y.some(function(S){return S instanceof RegExp?S.test(v):S===v})}))return o(new Tu("jwt audience invalid. expected: "+y.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&A.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(A.iss)===-1))return o(new Tu("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new Tu("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new Tu("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new Tu("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new Tu("iat required when maxAge is specified"));let y=q5o(r.maxAge,A.iat);if(typeof y>"u")return o(new Tu('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=y+(r.clockTolerance||0))return o(new Adn("maxAge exceeded",new Date(y*1e3)))}if(r.complete===!0){let y=l.signature;return o(null,{header:u,payload:A,signature:y})}return o(null,A)})}});var Tdn=I((Afu,Sdn)=>{p();var Edn=1/0,Cdn=9007199254740991,K5o=17976931348623157e292,vdn=NaN,J5o="[object Arguments]",Z5o="[object Function]",X5o="[object GeneratorFunction]",e4o="[object String]",t4o="[object Symbol]",r4o=/^\s+|\s+$/g,n4o=/^[-+]0x[0-9a-f]+$/i,i4o=/^0b[01]+$/i,o4o=/^0o[0-7]+$/i,s4o=/^(?:0|[1-9]\d*)$/,a4o=parseInt;function c4o(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&u4o(t,e,r)>-1}a(C4o,"includes");function b4o(t){return S4o(t)&&G8t.call(t,"callee")&&(!m4o.call(t,"callee")||K$e.call(t)==J5o)}a(b4o,"isArguments");var bdn=Array.isArray;function $8t(t){return t!=null&&I4o(t.length)&&!T4o(t)}a($8t,"isArrayLike");function S4o(t){return V8t(t)&&$8t(t)}a(S4o,"isArrayLikeObject");function T4o(t){var e=H8t(t)?K$e.call(t):"";return e==Z5o||e==X5o}a(T4o,"isFunction");function I4o(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Cdn}a(I4o,"isLength");function H8t(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(H8t,"isObject");function V8t(t){return!!t&&typeof t=="object"}a(V8t,"isObjectLike");function x4o(t){return typeof t=="string"||!bdn(t)&&V8t(t)&&K$e.call(t)==e4o}a(x4o,"isString");function w4o(t){return typeof t=="symbol"||V8t(t)&&K$e.call(t)==t4o}a(w4o,"isSymbol");function R4o(t){if(!t)return t===0?t:0;if(t=P4o(t),t===Edn||t===-Edn){var e=t<0?-1:1;return e*K5o}return t===t?t:0}a(R4o,"toFinite");function k4o(t){var e=R4o(t),r=e%1;return e===e?r?e-r:e:0}a(k4o,"toInteger");function P4o(t){if(typeof t=="number")return t;if(w4o(t))return vdn;if(H8t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=H8t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(r4o,"");var r=i4o.test(t);return r||o4o.test(t)?a4o(t.slice(2),r?2:8):n4o.test(t)?vdn:+t}a(P4o,"toNumber");function D4o(t){return $8t(t)?y4o(t):_4o(t)}a(D4o,"keys");function N4o(t){return t?p4o(t,D4o(t)):[]}a(N4o,"values");Sdn.exports=C4o});var xdn=I((Efu,Idn)=>{p();var M4o="[object Boolean]",O4o=Object.prototype,L4o=O4o.toString;function B4o(t){return t===!0||t===!1||F4o(t)&&L4o.call(t)==M4o}a(B4o,"isBoolean");function F4o(t){return!!t&&typeof t=="object"}a(F4o,"isObjectLike");Idn.exports=B4o});var Ddn=I((bfu,Pdn)=>{p();var wdn=1/0,U4o=17976931348623157e292,Rdn=NaN,Q4o="[object Symbol]",q4o=/^\s+|\s+$/g,j4o=/^[-+]0x[0-9a-f]+$/i,H4o=/^0b[01]+$/i,G4o=/^0o[0-7]+$/i,$4o=parseInt,V4o=Object.prototype,W4o=V4o.toString;function z4o(t){return typeof t=="number"&&t==Z4o(t)}a(z4o,"isInteger");function kdn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(kdn,"isObject");function Y4o(t){return!!t&&typeof t=="object"}a(Y4o,"isObjectLike");function K4o(t){return typeof t=="symbol"||Y4o(t)&&W4o.call(t)==Q4o}a(K4o,"isSymbol");function J4o(t){if(!t)return t===0?t:0;if(t=X4o(t),t===wdn||t===-wdn){var e=t<0?-1:1;return e*U4o}return t===t?t:0}a(J4o,"toFinite");function Z4o(t){var e=J4o(t),r=e%1;return e===e?r?e-r:e:0}a(Z4o,"toInteger");function X4o(t){if(typeof t=="number")return t;if(K4o(t))return Rdn;if(kdn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=kdn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(q4o,"");var r=H4o.test(t);return r||G4o.test(t)?$4o(t.slice(2),r?2:8):j4o.test(t)?Rdn:+t}a(X4o,"toNumber");Pdn.exports=z4o});var Mdn=I((Ifu,Ndn)=>{p();var eLo="[object Number]",tLo=Object.prototype,rLo=tLo.toString;function nLo(t){return!!t&&typeof t=="object"}a(nLo,"isObjectLike");function iLo(t){return typeof t=="number"||nLo(t)&&rLo.call(t)==eLo}a(iLo,"isNumber");Ndn.exports=iLo});var Fdn=I((Rfu,Bdn)=>{p();var oLo="[object Object]";function sLo(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(sLo,"isHostObject");function aLo(t,e){return function(r){return t(e(r))}}a(aLo,"overArg");var cLo=Function.prototype,Odn=Object.prototype,Ldn=cLo.toString,lLo=Odn.hasOwnProperty,uLo=Ldn.call(Object),dLo=Odn.toString,fLo=aLo(Object.getPrototypeOf,Object);function pLo(t){return!!t&&typeof t=="object"}a(pLo,"isObjectLike");function hLo(t){if(!pLo(t)||dLo.call(t)!=oLo||sLo(t))return!1;var e=fLo(t);if(e===null)return!0;var r=lLo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Ldn.call(r)==uLo}a(hLo,"isPlainObject");Bdn.exports=hLo});var Qdn=I((Dfu,Udn)=>{p();var mLo="[object String]",gLo=Object.prototype,ALo=gLo.toString,yLo=Array.isArray;function _Lo(t){return!!t&&typeof t=="object"}a(_Lo,"isObjectLike");function ELo(t){return typeof t=="string"||!yLo(t)&&_Lo(t)&&ALo.call(t)==mLo}a(ELo,"isString");Udn.exports=ELo});var $dn=I((Ofu,Gdn)=>{p();var vLo="Expected a function",qdn=1/0,CLo=17976931348623157e292,jdn=NaN,bLo="[object Symbol]",SLo=/^\s+|\s+$/g,TLo=/^[-+]0x[0-9a-f]+$/i,ILo=/^0b[01]+$/i,xLo=/^0o[0-7]+$/i,wLo=parseInt,RLo=Object.prototype,kLo=RLo.toString;function PLo(t,e){var r;if(typeof e!="function")throw new TypeError(vLo);return t=LLo(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(PLo,"before");function DLo(t){return PLo(2,t)}a(DLo,"once");function Hdn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(Hdn,"isObject");function NLo(t){return!!t&&typeof t=="object"}a(NLo,"isObjectLike");function MLo(t){return typeof t=="symbol"||NLo(t)&&kLo.call(t)==bLo}a(MLo,"isSymbol");function OLo(t){if(!t)return t===0?t:0;if(t=BLo(t),t===qdn||t===-qdn){var e=t<0?-1:1;return e*CLo}return t===t?t:0}a(OLo,"toFinite");function LLo(t){var e=OLo(t),r=e%1;return e===e?r?e-r:e:0}a(LLo,"toInteger");function BLo(t){if(typeof t=="number")return t;if(MLo(t))return jdn;if(Hdn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Hdn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(SLo,"");var r=ILo.test(t);return r||xLo.test(t)?wLo(t.slice(2),r?2:8):TLo.test(t)?jdn:+t}a(BLo,"toNumber");Gdn.exports=DLo});var efn=I((Ffu,Xdn)=>{p();var Vdn=y8t(),FLo=Q8t(),ULo=U8t(),Wdn=D$e(),QLo=Tdn(),J$e=xdn(),zdn=Ddn(),W8t=Mdn(),Kdn=Fdn(),FQ=Qdn(),qLo=$dn(),{KeyObject:jLo,createSecretKey:HLo,createPrivateKey:GLo}=require("crypto"),Jdn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];FLo&&Jdn.splice(3,0,"PS256","PS384","PS512");var $Lo={expiresIn:{isValid:a(function(t){return zdn(t)||FQ(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return zdn(t)||FQ(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return FQ(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:QLo.bind(null,Jdn),message:'"algorithm" must be a valid string enum value'},header:{isValid:Kdn,message:'"header" must be an object'},encoding:{isValid:FQ,message:'"encoding" must be a string'},issuer:{isValid:FQ,message:'"issuer" must be a string'},subject:{isValid:FQ,message:'"subject" must be a string'},jwtid:{isValid:FQ,message:'"jwtid" must be a string'},noTimestamp:{isValid:J$e,message:'"noTimestamp" must be a boolean'},keyid:{isValid:FQ,message:'"keyid" must be a string'},mutatePayload:{isValid:J$e,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:J$e,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:J$e,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},VLo={iat:{isValid:W8t,message:'"iat" should be a number of seconds'},exp:{isValid:W8t,message:'"exp" should be a number of seconds'},nbf:{isValid:W8t,message:'"nbf" should be a number of seconds'}};function Zdn(t,e,r,n){if(!Kdn(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(o){let s=t[o];if(!s){if(!e)throw new Error('"'+o+'" is not allowed in "'+n+'"');return}if(!s.isValid(r[o]))throw new Error(s.message)})}a(Zdn,"validate");function WLo(t){return Zdn($Lo,!1,t,"options")}a(WLo,"validateOptions");function zLo(t){return Zdn(VLo,!0,t,"payload")}a(zLo,"validatePayload");var Ydn={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},YLo=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Xdn.exports=function(t,e,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let o=typeof t=="object"&&!Buffer.isBuffer(t),s=Object.assign({alg:r.algorithm||"HS256",typ:o?"JWT":void 0,kid:r.keyid},r.header);function c(d){if(n)return n(d);throw d}if(a(c,"failure"),!e&&r.algorithm!=="none")return c(new Error("secretOrPrivateKey must have a value"));if(e!=null&&!(e instanceof jLo))try{e=GLo(e)}catch{try{e=HLo(typeof e=="string"?Buffer.from(e):e)}catch{return c(new Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&e.type!=="secret")return c(new Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));if(/^(?:RS|PS|ES)/.test(s.alg)){if(e.type!=="private")return c(new Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!r.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&e.asymmetricKeyDetails!==void 0&&e.asymmetricKeyDetails.modulusLength<2048)return c(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof t>"u")return c(new Error("payload is required"));if(o){try{zLo(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=YLo.filter(function(f){return typeof r[f]<"u"});if(d.length>0)return c(new Error("invalid "+d.join(",")+" option for "+typeof t+" payload"))}if(typeof t.exp<"u"&&typeof r.expiresIn<"u")return c(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof t.nbf<"u"&&typeof r.notBefore<"u")return c(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{WLo(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{ULo(s.alg,e)}catch(d){return c(d)}let l=t.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete t.iat:o&&(t.iat=l),typeof r.notBefore<"u"){try{t.nbf=Vdn(r.notBefore,l)}catch(d){return c(d)}if(typeof t.nbf>"u")return c(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof t=="object"){try{t.exp=Vdn(r.expiresIn,l)}catch(d){return c(d)}if(typeof t.exp>"u")return c(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(Ydn).forEach(function(d){let f=Ydn[d];if(typeof r[d]<"u"){if(typeof t[f]<"u")return c(new Error('Bad "options.'+d+'" option. The payload already has an "'+f+'" property.'));t[f]=r[d]}});let u=r.encoding||"utf8";if(typeof n=="function")n=n&&qLo(n),Wdn.createSign({header:s,privateKey:e,payload:t,encoding:u}).once("error",n).once("done",function(d){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&d.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));n(null,d)});else{let d=Wdn.sign({header:s,payload:t,secret:e,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&d.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return d}}});var rfn=I((qfu,tfn)=>{p();tfn.exports={decode:h8t(),verify:_dn(),sign:efn(),JsonWebTokenError:MIe(),NotBeforeError:m8t(),TokenExpiredError:g8t()}});var S6t=I((O_u,rpn)=>{p();function JBo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=A8t(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let k=r.formatters[x];if(typeof k=="function"){let D=_[T];R=k.call(E,D),_.splice(T,1),T--}return R}),r.formatArgs.call(E,_),(E.log||r.log).apply(E,_)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(_=>{m=_},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h,m=(typeof f=="string"?f:"").split(/[\s,]+/),g=m.length;for(h=0;h"-"+h)].join(",");return r.enable(""),f}a(s,"disable");function c(f){if(f[f.length-1]==="*")return!0;let h,m;for(h=0,m=r.skips.length;h{p();W1.formatArgs=XBo;W1.save=e3o;W1.load=t3o;W1.useColors=ZBo;W1.storage=r3o();W1.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();W1.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ZBo(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(ZBo,"useColors");function XBo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+wVe.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(XBo,"formatArgs");W1.log=console.debug||console.log||(()=>{});function e3o(t){try{t?W1.storage.setItem("debug",t):W1.storage.removeItem("debug")}catch{}}a(e3o,"save");function t3o(){let t;try{t=W1.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(t3o,"load");function r3o(){try{return localStorage}catch{}}a(r3o,"localstorage");wVe.exports=S6t()(W1);var{formatters:n3o}=wVe.exports;n3o.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var opn=I((Q_u,ipn)=>{"use strict";p();ipn.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),o=e.indexOf("--");return n!==-1&&(o===-1||n{"use strict";p();var i3o=require("os"),spn=require("tty"),iw=opn(),{env:m0}=process,qQ;iw("no-color")||iw("no-colors")||iw("color=false")||iw("color=never")?qQ=0:(iw("color")||iw("colors")||iw("color=true")||iw("color=always"))&&(qQ=1);"FORCE_COLOR"in m0&&(m0.FORCE_COLOR==="true"?qQ=1:m0.FORCE_COLOR==="false"?qQ=0:qQ=m0.FORCE_COLOR.length===0?1:Math.min(parseInt(m0.FORCE_COLOR,10),3));function T6t(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a(T6t,"translateLevel");function I6t(t,e){if(qQ===0)return 0;if(iw("color=16m")||iw("color=full")||iw("color=truecolor"))return 3;if(iw("color=256"))return 2;if(t&&!e&&qQ===void 0)return 0;let r=qQ||0;if(m0.TERM==="dumb")return r;if(process.platform==="win32"){let n=i3o.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in m0)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in m0)||m0.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in m0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(m0.TEAMCITY_VERSION)?1:0;if(m0.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in m0){let n=parseInt((m0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(m0.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(m0.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(m0.TERM)||"COLORTERM"in m0?1:r}a(I6t,"supportsColor");function o3o(t){let e=I6t(t,t&&t.isTTY);return T6t(e)}a(o3o,"getSupportLevel");apn.exports={supportsColor:o3o,stdout:T6t(I6t(!0,spn.isatty(1))),stderr:T6t(I6t(!0,spn.isatty(2)))}});var lpn=I((BA,PVe)=>{p();var s3o=require("tty"),kVe=require("util");BA.init=p3o;BA.log=u3o;BA.formatArgs=c3o;BA.save=d3o;BA.load=f3o;BA.useColors=a3o;BA.destroy=kVe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");BA.colors=[6,2,3,4,5,1];try{let t=RVe();t&&(t.stderr||t).level>=2&&(BA.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}BA.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function a3o(){return"colors"in BA.inspectOpts?!!BA.inspectOpts.colors:s3o.isatty(process.stderr.fd)}a(a3o,"useColors");function c3o(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` `).join(` -`+s),t.push(o+"m+"+PVe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=a3o()+e+" "+t[0]}a(s3o,"formatArgs");function a3o(){return BA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(a3o,"getDate");function c3o(...t){return process.stderr.write(kVe.format(...t)+` -`)}a(c3o,"log");function l3o(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(l3o,"save");function u3o(){return process.env.DEBUG}a(u3o,"load");function d3o(t){t.inspectOpts={};let e=Object.keys(BA.inspectOpts);for(let r=0;re.trim()).join(" ")};apn.O=function(t){return this.inspectOpts.colors=this.useColors,kVe.inspect(t,this.inspectOpts)}});var YP=I(($_u,I6t)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?I6t.exports=rpn():I6t.exports=cpn()});var dpn=I(WC=>{"use strict";p();var f3o=WC&&WC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),p3o=WC&&WC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lpn=WC&&WC.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&f3o(e,t,r);return p3o(e,t),e};Object.defineProperty(WC,"__esModule",{value:!0});WC.req=WC.json=WC.toBuffer=void 0;var h3o=lpn(require("http")),m3o=lpn(require("https"));async function upn(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a(upn,"toBuffer");WC.toBuffer=upn;async function g3o(t){let r=(await upn(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(g3o,"json");WC.json=g3o;function A3o(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?m3o:h3o).request(t,e),o=new Promise((s,c)=>{n.once("response",s).once("error",c).end()});return n.then=o.then.bind(o),n}a(A3o,"req");WC.req=A3o});var w6t=I(z1=>{"use strict";p();var ppn=z1&&z1.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y3o=z1&&z1.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hpn=z1&&z1.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ppn(e,t,r);return y3o(e,t),e},_3o=z1&&z1.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ppn(e,t,r)};Object.defineProperty(z1,"__esModule",{value:!0});z1.Agent=void 0;var E3o=hpn(require("net")),fpn=hpn(require("http")),v3o=require("https");_3o(dpn(),z1);var xO=Symbol("AgentBaseInternalState"),x6t=class extends fpn.Agent{static{a(this,"Agent")}constructor(e){super(e),this[xO]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(` -`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new E3o.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let n=this.sockets[e],o=n.indexOf(r);o!==-1&&(n.splice(o,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return(typeof e.secureEndpoint=="boolean"?e.secureEndpoint:this.isSecureEndpoint(e))?v3o.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let o={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(o),c=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,o)).then(l=>{if(this.decrementSockets(s,c),l instanceof fpn.Agent)return l.addRequest(e,o);this[xO].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[xO].currentSocket;if(this[xO].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[xO].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[xO]&&(this[xO].defaultPort=e)}get protocol(){return this[xO].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[xO]&&(this[xO].protocol=e)}};z1.Agent=x6t});var mpn=I(Qle=>{"use strict";p();var C3o=Qle&&Qle.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qle,"__esModule",{value:!0});Qle.parseProxyResponse=void 0;var b3o=C3o(YP()),DVe=(0,b3o.default)("https-proxy-agent:parse-proxy-response");function S3o(t){return new Promise((e,r)=>{let n=0,o=[];function s(){let f=t.read();f?d(f):t.once("readable",s)}a(s,"read");function c(){t.removeListener("end",l),t.removeListener("error",u),t.removeListener("readable",s)}a(c,"cleanup");function l(){c(),DVe("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),DVe("onerror %o",f),r(f)}a(u,"onerror");function d(f){o.push(f),n+=f.length;let h=Buffer.concat(o,n),m=h.indexOf(`\r +`+s),t.push(o+"m+"+PVe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=l3o()+e+" "+t[0]}a(c3o,"formatArgs");function l3o(){return BA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(l3o,"getDate");function u3o(...t){return process.stderr.write(kVe.format(...t)+` +`)}a(u3o,"log");function d3o(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(d3o,"save");function f3o(){return process.env.DEBUG}a(f3o,"load");function p3o(t){t.inspectOpts={};let e=Object.keys(BA.inspectOpts);for(let r=0;re.trim()).join(" ")};cpn.O=function(t){return this.inspectOpts.colors=this.useColors,kVe.inspect(t,this.inspectOpts)}});var YP=I((W_u,x6t)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?x6t.exports=npn():x6t.exports=lpn()});var fpn=I(WC=>{"use strict";p();var h3o=WC&&WC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),m3o=WC&&WC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),upn=WC&&WC.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&h3o(e,t,r);return m3o(e,t),e};Object.defineProperty(WC,"__esModule",{value:!0});WC.req=WC.json=WC.toBuffer=void 0;var g3o=upn(require("http")),A3o=upn(require("https"));async function dpn(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a(dpn,"toBuffer");WC.toBuffer=dpn;async function y3o(t){let r=(await dpn(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(y3o,"json");WC.json=y3o;function _3o(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?A3o:g3o).request(t,e),o=new Promise((s,c)=>{n.once("response",s).once("error",c).end()});return n.then=o.then.bind(o),n}a(_3o,"req");WC.req=_3o});var R6t=I(z1=>{"use strict";p();var hpn=z1&&z1.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),E3o=z1&&z1.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mpn=z1&&z1.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&hpn(e,t,r);return E3o(e,t),e},v3o=z1&&z1.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hpn(e,t,r)};Object.defineProperty(z1,"__esModule",{value:!0});z1.Agent=void 0;var C3o=mpn(require("net")),ppn=mpn(require("http")),b3o=require("https");v3o(fpn(),z1);var xO=Symbol("AgentBaseInternalState"),w6t=class extends ppn.Agent{static{a(this,"Agent")}constructor(e){super(e),this[xO]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(` +`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new C3o.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let n=this.sockets[e],o=n.indexOf(r);o!==-1&&(n.splice(o,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return(typeof e.secureEndpoint=="boolean"?e.secureEndpoint:this.isSecureEndpoint(e))?b3o.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let o={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(o),c=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,o)).then(l=>{if(this.decrementSockets(s,c),l instanceof ppn.Agent)return l.addRequest(e,o);this[xO].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[xO].currentSocket;if(this[xO].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[xO].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[xO]&&(this[xO].defaultPort=e)}get protocol(){return this[xO].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[xO]&&(this[xO].protocol=e)}};z1.Agent=w6t});var gpn=I(qle=>{"use strict";p();var S3o=qle&&qle.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qle,"__esModule",{value:!0});qle.parseProxyResponse=void 0;var T3o=S3o(YP()),DVe=(0,T3o.default)("https-proxy-agent:parse-proxy-response");function I3o(t){return new Promise((e,r)=>{let n=0,o=[];function s(){let f=t.read();f?d(f):t.once("readable",s)}a(s,"read");function c(){t.removeListener("end",l),t.removeListener("error",u),t.removeListener("readable",s)}a(c,"cleanup");function l(){c(),DVe("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),DVe("onerror %o",f),r(f)}a(u,"onerror");function d(f){o.push(f),n+=f.length;let h=Buffer.concat(o,n),m=h.indexOf(`\r \r `);if(m===-1){DVe("have not received end of HTTP headers yet..."),s();return}let g=h.slice(0,m).toString("ascii").split(`\r -`),A=g.shift();if(!A)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let y=A.split(" "),_=+y[1],E=y.slice(2).join(" "),v={};for(let S of g){if(!S)continue;let T=S.indexOf(":");if(T===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${S}"`));let w=S.slice(0,T).toLowerCase(),R=S.slice(T+1).trimStart(),x=v[w];typeof x=="string"?v[w]=[x,R]:Array.isArray(x)?x.push(R):v[w]=R}DVe("got proxy server response: %o %o",A,v),c(),e({connect:{statusCode:_,statusText:E,headers:v},buffered:h})}a(d,"ondata"),t.on("error",u),t.on("end",l),s()})}a(S3o,"parseProxyResponse");Qle.parseProxyResponse=S3o});var k6t=I(ow=>{"use strict";p();var T3o=ow&&ow.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),I3o=ow&&ow.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ypn=ow&&ow.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&T3o(e,t,r);return I3o(e,t),e},_pn=ow&&ow.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ow,"__esModule",{value:!0});ow.HttpsProxyAgent=void 0;var R6t=ypn(require("net")),gpn=ypn(require("tls")),x3o=_pn(require("assert")),w3o=_pn(YP()),R3o=w6t(),k3o=require("url"),P3o=mpn(),ZIe=(0,w3o.default)("https-proxy-agent"),NVe=class extends R3o.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new k3o.URL(e):e,this.proxyHeaders=r?.headers??{},ZIe("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?Apn(r,"headers"):null,host:n,port:o}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let o;if(n.protocol==="https:"){ZIe("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=gpn.connect({...this.connectOpts,servername:m})}else ZIe("Creating `net.Socket`: %o",this.connectOpts),o=R6t.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=R6t.isIPv6(r.host)?`[${r.host}]`:r.host,l=`CONNECT ${c}:${r.port} HTTP/1.1\r +`),A=g.shift();if(!A)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let y=A.split(" "),_=+y[1],E=y.slice(2).join(" "),v={};for(let S of g){if(!S)continue;let T=S.indexOf(":");if(T===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${S}"`));let w=S.slice(0,T).toLowerCase(),R=S.slice(T+1).trimStart(),x=v[w];typeof x=="string"?v[w]=[x,R]:Array.isArray(x)?x.push(R):v[w]=R}DVe("got proxy server response: %o %o",A,v),c(),e({connect:{statusCode:_,statusText:E,headers:v},buffered:h})}a(d,"ondata"),t.on("error",u),t.on("end",l),s()})}a(I3o,"parseProxyResponse");qle.parseProxyResponse=I3o});var P6t=I(ow=>{"use strict";p();var x3o=ow&&ow.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),w3o=ow&&ow.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_pn=ow&&ow.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&x3o(e,t,r);return w3o(e,t),e},Epn=ow&&ow.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ow,"__esModule",{value:!0});ow.HttpsProxyAgent=void 0;var k6t=_pn(require("net")),Apn=_pn(require("tls")),R3o=Epn(require("assert")),k3o=Epn(YP()),P3o=R6t(),D3o=require("url"),N3o=gpn(),ZIe=(0,k3o.default)("https-proxy-agent"),NVe=class extends P3o.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new D3o.URL(e):e,this.proxyHeaders=r?.headers??{},ZIe("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?ypn(r,"headers"):null,host:n,port:o}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let o;if(n.protocol==="https:"){ZIe("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=Apn.connect({...this.connectOpts,servername:m})}else ZIe("Creating `net.Socket`: %o",this.connectOpts),o=k6t.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=k6t.isIPv6(r.host)?`[${r.host}]`:r.host,l=`CONNECT ${c}:${r.port} HTTP/1.1\r `;if(n.username||n.password){let m=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(m).toString("base64")}`}s.Host=`${c}:${r.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let m of Object.keys(s))l+=`${m}: ${s[m]}\r -`;let u=(0,P3o.parseProxyResponse)(o);o.write(`${l}\r -`);let{connect:d,buffered:f}=await u;if(e.emit("proxyConnect",d),this.emit("proxyConnect",d,e),d.statusCode===200){if(e.once("socket",D3o),r.secureEndpoint){ZIe("Upgrading socket connection to TLS");let m=r.servername||r.host;return gpn.connect({...Apn(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new R6t.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{ZIe("Replaying proxy buffer for failed request"),(0,x3o.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};NVe.protocols=["http","https"];ow.HttpsProxyAgent=NVe;function D3o(t){t.resume()}a(D3o,"resume");function Apn(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(Apn,"omit")});var P6t=I(sw=>{"use strict";p();var N3o=sw&&sw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M3o=sw&&sw.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vpn=sw&&sw.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&N3o(e,t,r);return M3o(e,t),e},O3o=sw&&sw.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sw,"__esModule",{value:!0});sw.HttpProxyAgent=void 0;var L3o=vpn(require("net")),B3o=vpn(require("tls")),F3o=O3o(YP()),U3o=require("events"),Q3o=w6t(),Epn=require("url"),qle=(0,F3o.default)("http-proxy-agent"),MVe=class extends Q3o.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new Epn.URL(e):e,this.proxyHeaders=r?.headers??{},qle("Creating new HttpProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...r?q3o(r,"headers"):null,host:n,port:o}}addRequest(e,r){e._header=null,this.setRequestProps(e,r),super.addRequest(e,r)}setRequestProps(e,r){let{proxy:n}=this,o=r.secureEndpoint?"https:":"http:",s=e.getHeader("host")||"localhost",c=`${o}//${s}`,l=new Epn.URL(e.path,c);r.port!==80&&(l.port=String(r.port)),e.path=String(l);let u=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(n.username||n.password){let d=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}u["Proxy-Connection"]||(u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(u)){let f=u[d];f&&e.setHeader(d,f)}}async connect(e,r){e._header=null,e.path.includes("://")||this.setRequestProps(e,r);let n,o;qle("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(qle("Patching connection write() output buffer with updated header"),n=e.outputData[0].data,o=n.indexOf(`\r +`;let u=(0,N3o.parseProxyResponse)(o);o.write(`${l}\r +`);let{connect:d,buffered:f}=await u;if(e.emit("proxyConnect",d),this.emit("proxyConnect",d,e),d.statusCode===200){if(e.once("socket",M3o),r.secureEndpoint){ZIe("Upgrading socket connection to TLS");let m=r.servername||r.host;return Apn.connect({...ypn(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new k6t.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{ZIe("Replaying proxy buffer for failed request"),(0,R3o.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};NVe.protocols=["http","https"];ow.HttpsProxyAgent=NVe;function M3o(t){t.resume()}a(M3o,"resume");function ypn(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(ypn,"omit")});var D6t=I(sw=>{"use strict";p();var O3o=sw&&sw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L3o=sw&&sw.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Cpn=sw&&sw.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&O3o(e,t,r);return L3o(e,t),e},B3o=sw&&sw.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sw,"__esModule",{value:!0});sw.HttpProxyAgent=void 0;var F3o=Cpn(require("net")),U3o=Cpn(require("tls")),Q3o=B3o(YP()),q3o=require("events"),j3o=R6t(),vpn=require("url"),jle=(0,Q3o.default)("http-proxy-agent"),MVe=class extends j3o.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new vpn.URL(e):e,this.proxyHeaders=r?.headers??{},jle("Creating new HttpProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...r?H3o(r,"headers"):null,host:n,port:o}}addRequest(e,r){e._header=null,this.setRequestProps(e,r),super.addRequest(e,r)}setRequestProps(e,r){let{proxy:n}=this,o=r.secureEndpoint?"https:":"http:",s=e.getHeader("host")||"localhost",c=`${o}//${s}`,l=new vpn.URL(e.path,c);r.port!==80&&(l.port=String(r.port)),e.path=String(l);let u=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(n.username||n.password){let d=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}u["Proxy-Connection"]||(u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(u)){let f=u[d];f&&e.setHeader(d,f)}}async connect(e,r){e._header=null,e.path.includes("://")||this.setRequestProps(e,r);let n,o;jle("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(jle("Patching connection write() output buffer with updated header"),n=e.outputData[0].data,o=n.indexOf(`\r \r -`)+4,e.outputData[0].data=e._header+n.substring(o),qle("Output buffer: %o",e.outputData[0].data));let s;return this.proxy.protocol==="https:"?(qle("Creating `tls.Socket`: %o",this.connectOpts),s=B3o.connect(this.connectOpts)):(qle("Creating `net.Socket`: %o",this.connectOpts),s=L3o.connect(this.connectOpts)),await(0,U3o.once)(s,"connect"),s}};MVe.protocols=["http","https"];sw.HttpProxyAgent=MVe;function q3o(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(q3o,"omit")});var jQ={};Ti(jQ,{__addDisposableResource:()=>Kpn,__assign:()=>QVe,__asyncDelegator:()=>Hpn,__asyncGenerator:()=>XIe,__asyncValues:()=>HVe,__await:()=>Y1,__awaiter:()=>Bpn,__classPrivateFieldGet:()=>Wpn,__classPrivateFieldIn:()=>Ypn,__classPrivateFieldSet:()=>zpn,__createBinding:()=>jVe,__decorate:()=>kpn,__disposeResources:()=>Jpn,__esDecorate:()=>Dpn,__exportStar:()=>Upn,__extends:()=>wpn,__generator:()=>Fpn,__importDefault:()=>Vpn,__importStar:()=>$pn,__makeTemplateObject:()=>Gpn,__metadata:()=>Lpn,__param:()=>Ppn,__propKey:()=>Mpn,__read:()=>B6t,__rest:()=>Rpn,__rewriteRelativeImportExtension:()=>Zpn,__runInitializers:()=>Npn,__setFunctionName:()=>Opn,__spread:()=>Qpn,__spreadArray:()=>jpn,__spreadArrays:()=>qpn,__values:()=>qVe,default:()=>X3o});function wpn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");O6t(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Rpn(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function Ppn(t,e){return function(r,n){e(r,n,t)}}function Dpn(t,e,r,n,o,s){function c(E){if(E!==void 0&&typeof E!="function")throw new TypeError("Function expected");return E}a(c,"accept");for(var l=n.kind,u=l==="getter"?"get":l==="setter"?"set":"value",d=!e&&t?n.static?t:t.prototype:null,f=e||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),h,m=!1,g=r.length-1;g>=0;g--){var A={};for(var y in n)A[y]=y==="access"?{}:n[y];for(var y in n.access)A.access[y]=n.access[y];A.addInitializer=function(E){if(m)throw new TypeError("Cannot add initializers after decoration has completed");s.push(c(E||null))};var _=(0,r[g])(l==="accessor"?{get:f.get,set:f.set}:f[u],A);if(l==="accessor"){if(_===void 0)continue;if(_===null||typeof _!="object")throw new TypeError("Object expected");(h=c(_.get))&&(f.get=h),(h=c(_.set))&&(f.set=h),(h=c(_.init))&&o.unshift(h)}else(h=c(_))&&(l==="field"?o.unshift(h):f[u]=h)}d&&Object.defineProperty(d,n.name,f),m=!0}function Npn(t,e,r){for(var n=arguments.length>2,o=0;o0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function B6t(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s}function Qpn(){for(var t=[],e=0;e1||u(g,y)})},A&&(o[g]=A(o[g])))}function u(g,A){try{d(n[g](A))}catch(y){m(s[0][3],y)}}function d(g){g.value instanceof Y1?Promise.resolve(g.value.v).then(f,h):m(s[0][2],g)}function f(g){u("next",g)}function h(g){u("throw",g)}function m(g,A){g(A),s.shift(),s.length&&u(s[0][0],s[0][1])}}function Hpn(t){var e,r;return e={},n("next"),n("throw",function(o){throw o}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(o,s){e[o]=t[o]?function(c){return(r=!r)?{value:Y1(t[o](c)),done:!1}:s?s(c):c}:s}}function HVe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof qVe=="function"?qVe(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(c){return new Promise(function(l,u){c=t[s](c),o(l,u,c.done,c.value)})}}function o(s,c,l,u){Promise.resolve(u).then(function(d){s({value:d,done:l})},c)}}function Gpn(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function $pn(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=L6t(t),n=0;n{p();O6t=a(function(t,e){return O6t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},O6t(t,e)},"extendStatics");a(wpn,"__extends");QVe=a(function(){return QVe=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(eWe,"__esModule",{value:!0});eWe.state=void 0;eWe.state={operationRequestMap:new WeakMap}});function e8o(){try{return uUt.default.statSync("/.dockerenv"),!0}catch{return!1}}function t8o(){try{return uUt.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function dUt(){return lUt===void 0&&(lUt=e8o()||t8o()),lUt}var uUt,lUt,Phn=Se(()=>{p();uUt=fe(require("node:fs"),1);a(e8o,"hasDockerEnv");a(t8o,"hasDockerCGroup");a(dUt,"isDocker")});function $le(){return fUt===void 0&&(fUt=r8o()||dUt()),fUt}var Dhn,fUt,r8o,pUt=Se(()=>{p();Dhn=fe(require("node:fs"),1);Phn();r8o=a(()=>{try{return Dhn.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a($le,"isInsideContainer")});var hUt,Mhn,Ohn,Nhn,VQ,mUt=Se(()=>{p();hUt=fe(require("node:process"),1),Mhn=fe(require("node:os"),1),Ohn=fe(require("node:fs"),1);pUt();Nhn=a(()=>{if(hUt.default.platform!=="linux")return!1;if(Mhn.default.release().toLowerCase().includes("microsoft"))return!$le();try{return Ohn.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!$le():!1}catch{return!1}},"isWsl"),VQ=hUt.default.env.__IS_WSL_TEST__?Nhn:Nhn()});var gUt,oxe,n8o,i8o,AUt,Lhn=Se(()=>{p();gUt=fe(require("node:process"),1),oxe=fe(require("node:fs/promises"),1);mUt();mUt();n8o=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await oxe.default.access(r,oxe.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await oxe.default.readFile(r,{encoding:"utf8"}),s=/(?.*)/g.exec(o);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),i8o=a(async()=>`${await n8o()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),AUt=a(async()=>VQ?i8o():`${gUt.default.env.SYSTEMROOT||gUt.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function WQ(t,e,r){let n=a(o=>Object.defineProperty(t,e,{value:o,enumerable:!0,writable:!0}),"define");return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let o=r();return n(o),o},set(o){n(o)}}),t}var Bhn=Se(()=>{p();a(WQ,"defineLazyProperty")});async function yUt(){if(Uhn.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await o8o("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var Fhn,Uhn,Qhn,o8o,qhn=Se(()=>{p();Fhn=require("node:util"),Uhn=fe(require("node:process"),1),Qhn=require("node:child_process"),o8o=(0,Fhn.promisify)(Qhn.execFile);a(yUt,"defaultBrowserId")});async function Ghn(t,{humanReadableOutput:e=!0}={}){if(jhn.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await s8o("osascript",["-e",t,r]);return n.trim()}var jhn,Hhn,_Ut,s8o,$hn=Se(()=>{p();jhn=fe(require("node:process"),1),Hhn=require("node:util"),_Ut=require("node:child_process"),s8o=(0,Hhn.promisify)(_Ut.execFile);a(Ghn,"runAppleScript")});async function EUt(t){return Ghn(`tell application "Finder" to set app_path to application file id "${t}" as string -tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var Vhn=Se(()=>{p();$hn();a(EUt,"bundleName")});async function vUt(t=a8o){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?\S+)/.exec(e);if(!r)throw new rWe(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=c8o[n];if(!o)throw new rWe(`Unknown browser ID: ${n}`);return o}var Whn,zhn,a8o,c8o,rWe,Yhn=Se(()=>{p();Whn=require("node:util"),zhn=require("node:child_process"),a8o=(0,Whn.promisify)(zhn.execFile),c8o={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},rWe=class extends Error{static{a(this,"UnknownBrowserError")}};a(vUt,"defaultBrowser")});async function CUt(){if(nWe.default.platform==="darwin"){let t=await yUt();return{name:await EUt(t),id:t}}if(nWe.default.platform==="linux"){let{stdout:t}=await l8o("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:u8o(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(nWe.default.platform==="win32")return vUt();throw new Error("Only macOS, Linux, and Windows are supported")}var Khn,nWe,Jhn,l8o,u8o,Zhn=Se(()=>{p();Khn=require("node:util"),nWe=fe(require("node:process"),1),Jhn=require("node:child_process");qhn();Vhn();Yhn();l8o=(0,Khn.promisify)(Jhn.execFile),u8o=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(CUt,"defaultBrowser")});var omn={};Ti(omn,{apps:()=>zQ,default:()=>axe,openApp:()=>h8o});async function f8o(){let t=await AUt(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=TUt.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await d8o(t,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",r],{encoding:"utf8"}),o=n.trim(),s={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return s[o]?{id:s[o]}:{}}function rmn(t){if(typeof t=="string"||Array.isArray(t))return t;let{[emn]:e}=t;if(!e)throw new Error(`${emn} is not supported`);return e}function oWe({[Vle]:t},{wsl:e}){if(e&&VQ)return rmn(e);if(!t)throw new Error(`${Vle} is not supported`);return rmn(t)}var SUt,TUt,IUt,nmn,imn,xUt,iWe,d8o,bUt,Xhn,Vle,emn,tmn,sxe,p8o,h8o,zQ,axe,sWe=Se(()=>{p();SUt=fe(require("node:process"),1),TUt=require("node:buffer"),IUt=fe(require("node:path"),1),nmn=require("node:url"),imn=require("node:util"),xUt=fe(require("node:child_process"),1),iWe=fe(require("node:fs/promises"),1);Lhn();Bhn();Zhn();pUt();d8o=(0,imn.promisify)(xUt.default.execFile),bUt=IUt.default.dirname((0,nmn.fileURLToPath)(importMetaUrlShim)),Xhn=IUt.default.join(bUt,"xdg-open"),{platform:Vle,arch:emn}=SUt.default;a(f8o,"getWindowsDefaultBrowserFromWsl");tmn=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),sxe=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return tmn(t.app,l=>sxe({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return tmn(e,l=>sxe({...t,app:{name:l,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let l={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},d=VQ?await f8o():await CUt();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),sxe({...t,app:{name:zQ[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(Vle==="darwin")n="open",t.wait&&o.push("--wait-apps"),t.background&&o.push("--background"),t.newInstance&&o.push("--new"),e&&o.push("-a",e);else if(Vle==="win32"||VQ&&!$le()&&!e){n=await AUt(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),VQ||(s.windowsVerbatimArguments=!0);let l=["Start"];t.wait&&l.push("-Wait"),e?(l.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&l.push(`"${t.target}"`),r.length>0&&(r=r.map(u=>`"\`"${u}\`""`),l.push("-ArgumentList",r.join(","))),t.target=TUt.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!bUt||bUt==="/",u=!1;try{await iWe.default.access(Xhn,iWe.constants.X_OK),u=!0}catch{}n=SUt.default.versions.electron??(Vle==="android"||l||!u)?"xdg-open":Xhn}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}Vle==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=xUt.default.spawn(n,o,s);return t.wait?new Promise((l,u)=>{c.once("error",u),c.once("close",d=>{if(!t.allowNonzeroExitCode&&d>0){u(new Error(`Exited with code ${d}`));return}l(c)})}):(c.unref(),c)},"baseOpen"),p8o=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return sxe({...e,target:t})},"open"),h8o=a((t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return sxe({...e,app:{name:t,arguments:r}})},"openApp");a(rmn,"detectArchBinary");a(oWe,"detectPlatformBinary");zQ={};WQ(zQ,"chrome",()=>oWe({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));WQ(zQ,"brave",()=>oWe({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));WQ(zQ,"firefox",()=>oWe({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));WQ(zQ,"edge",()=>oWe({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));WQ(zQ,"browser",()=>"browser");WQ(zQ,"browserPrivate",()=>"browserPrivate");axe=p8o});var JUt=I((n4u,ugn)=>{"use strict";p();ugn.exports=a(function(e,r){r===!0&&(r=0);var n="";if(typeof e=="string")try{n=new URL(e).protocol}catch{}else e&&e.constructor===URL&&(n=e.protocol);var o=n.split(/\:|\+/).filter(Boolean);return typeof r=="number"?o[r]:o},"protocols")});var fgn=I((s4u,dgn)=>{"use strict";p();var C9o=JUt();function b9o(t){var e={protocols:[],protocol:null,port:null,resource:"",host:"",user:"",password:"",pathname:"",hash:"",search:"",href:t,query:{},parse_failed:!1};try{var r=new URL(t);e.protocols=C9o(r),e.protocol=e.protocols[0],e.port=r.port,e.resource=r.hostname,e.host=r.host,e.user=r.username||"",e.password=r.password||"",e.pathname=r.pathname,e.hash=r.hash.slice(1),e.search=r.search.slice(1),e.href=r.href,e.query=Object.fromEntries(r.searchParams)}catch{e.protocols=["file"],e.protocol=e.protocols[0],e.port="",e.resource="",e.user="",e.pathname="",e.hash="",e.search="",e.href=t,e.query={},e.parse_failed=!0}return e}a(b9o,"parsePath");dgn.exports=b9o});var ygn=I((l4u,Agn)=>{"use strict";p();var S9o=fgn();function T9o(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(T9o,"_interopDefaultLegacy");var I9o=T9o(S9o);function x9o(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=a(function n(){if(this instanceof n){var o=[null];o.push.apply(o,arguments);var s=Function.bind.apply(e,o);return new s}return e.apply(this,arguments)},"a");r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:a(function(){return t[n]},"get")})}),r}a(x9o,"getAugmentedNamespace");var hgn={},w9o="text/plain",R9o="us-ascii",pgn=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),k9o=a((t,{stripHash:e})=>{let r=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:n,data:o,hash:s}=r.groups,c=n.split(";");s=e?"":s;let l=!1;c[c.length-1]==="base64"&&(c.pop(),l=!0);let u=(c.shift()||"").toLowerCase(),f=[...c.map(h=>{let[m,g=""]=h.split("=").map(A=>A.trim());return m==="charset"&&(g=g.toLowerCase(),g===R9o)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==w9o)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function P9o(t,e){if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},t=t.trim(),/^data:/i.test(t))return k9o(t,e);if(/^view-source:/i.test(t))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let o=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&o.protocol==="https:"&&(o.protocol="http:"),e.forceHttps&&o.protocol==="http:"&&(o.protocol="https:"),e.stripAuthentication&&(o.username="",o.password=""),e.stripHash?o.hash="":e.stripTextFragment&&(o.hash=o.hash.replace(/#?:~:text.*?$/i,"")),o.pathname){let c=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,l=0,u="";for(;;){let f=c.exec(o.pathname);if(!f)break;let h=f[0],m=f.index,g=o.pathname.slice(l,m);u+=g.replace(/\/{2,}/g,"/"),u+=h,l=m+h.length}let d=o.pathname.slice(l,o.pathname.length);u+=d.replace(/\/{2,}/g,"/"),o.pathname=u}if(o.pathname)try{o.pathname=decodeURI(o.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let c=o.pathname.split("/"),l=c[c.length-1];pgn(l,e.removeDirectoryIndex)&&(c=c.slice(0,-1),o.pathname=c.slice(1).join("/")+"/")}if(o.hostname&&(o.hostname=o.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(o.hostname)&&(o.hostname=o.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let c of[...o.searchParams.keys()])pgn(c,e.removeQueryParameters)&&o.searchParams.delete(c);if(e.removeQueryParameters===!0&&(o.search=""),e.sortQueryParameters){o.searchParams.sort();try{o.search=decodeURIComponent(o.search)}catch{}}e.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,""));let s=t;return t=o.toString(),!e.removeSingleSlash&&o.pathname==="/"&&!s.endsWith("/")&&o.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||o.pathname==="/")&&o.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t}a(P9o,"normalizeUrl");var D9o=Object.freeze({__proto__:null,default:P9o}),N9o=x9o(D9o);Object.defineProperty(hgn,"__esModule",{value:!0});var M9o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O9o=N9o,L9o=mgn(O9o),B9o=I9o.default,F9o=mgn(B9o);function mgn(t){return t&&t.__esModule?t:{default:t}}a(mgn,"_interopRequireDefault");var ggn=a(function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=/^(?:([a-zA-Z_][a-zA-Z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:](([\~,\.\w,\-,\_,\/,\s]|%[0-9A-Fa-f]{2})+?(?:\.git|\/)?)$/,o=a(function(u){var d=new Error(u);throw d.subject_url=e,d},"throwErr");(typeof e!="string"||!e.trim())&&o("Invalid url."),e.length>t.MAX_INPUT_LENGTH&&o("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."),r&&((typeof r>"u"?"undefined":M9o(r))!=="object"&&(r={stripHash:!1}),e=(0,L9o.default)(e,r));var s=(0,F9o.default)(e);if(s.parse_failed){var c=s.href.match(n);c?(s.protocols=["ssh"],s.protocol="ssh",s.resource=c[2],s.host=c[2],s.user=c[1],s.pathname="/"+c[3],s.parse_failed=!1):o("URL parsing failed.")}return s},"parseUrl");ggn.MAX_INPUT_LENGTH=2048;var U9o=hgn.default=ggn;Agn.exports=U9o});var vgn=I((f4u,Egn)=>{"use strict";p();var Q9o=JUt();function _gn(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=Q9o(t);if(t=t.substring(t.indexOf("://")+3),_gn(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var q9o=ygn(),Cgn=vgn();function j9o(t){let e=q9o(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),Cgn(e.protocols)||e.protocols.length===0&&Cgn(t)?e.protocol="ssh":e.protocols.length?e.protocol=e.protocols[0]:(e.protocol="file",e.protocols=["file"]),e.href=e.href.replace(/\/$/,""),e}a(j9o,"gitUp");bgn.exports=j9o});var Ign=I((y4u,Tgn)=>{"use strict";p();var H9o=Sgn();function ZUt(t,e){if(e=e||[],typeof t!="string")throw new Error("The url must be a string.");if(!e.every(function(v){return typeof v=="string"}))throw new Error("The refs should contain only strings");var r=/^([a-z\d-]{1,39})\/([-\.\w]{1,100})$/i;r.test(t)&&(t="https://github.com/"+t);var n=H9o(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return ZUt.stringify(this,v)},n.source=o.length>2?o.slice(1-o.length).join("."):n.source=n.resource,n.git_suffix=/\.git$/.test(n.pathname),n.name=decodeURIComponent((n.pathname||n.href).replace(/(^\/)|(\/$)/g,"").replace(/\.git$/,"")),n.owner=decodeURIComponent(n.user),n.source){case"git.cloudforge.com":n.owner=n.user,n.organization=o[0],n.source="cloudforge.com";break;case"visualstudio.com":if(n.resource==="vs-ssh.visualstudio.com"){s=n.name.split("/"),s.length===4&&(n.organization=s[1],n.owner=s[2],n.name=s[3],n.full_name=s[2]+"/"+s[3]);break}else{s=n.name.split("/"),s.length===2?(n.owner=s[1],n.name=s[1],n.full_name="_git/"+n.name):s.length===3?(n.name=s[2],s[0]==="DefaultCollection"?(n.owner=s[2],n.organization=s[0],n.full_name=n.organization+"/_git/"+n.name):(n.owner=s[0],n.full_name=n.owner+"/_git/"+n.name)):s.length===4&&(n.organization=s[0],n.owner=s[1],n.name=s[3],n.full_name=n.organization+"/"+n.owner+"/_git/"+n.name);break}case"dev.azure.com":case"azure.com":if(n.resource==="ssh.dev.azure.com"){s=n.name.split("/"),s.length===4&&(n.organization=s[1],n.owner=s[2],n.name=s[3]);break}else{s=n.name.split("/"),s.length===5?(n.organization=s[0],n.owner=s[1],n.name=s[4],n.full_name="_git/"+n.name):s.length===3?(n.name=s[2],s[0]==="DefaultCollection"?(n.owner=s[2],n.organization=s[0],n.full_name=n.organization+"/_git/"+n.name):(n.owner=s[0],n.full_name=n.owner+"/_git/"+n.name)):s.length===4&&(n.organization=s[0],n.owner=s[1],n.name=s[3],n.full_name=n.organization+"/"+n.owner+"/_git/"+n.name),n.query&&n.query.path&&(n.filepath=n.query.path.replace(/^\/+/g,"")),n.query&&n.query.version&&(n.ref=n.query.version.replace(/^GB/,""));break}default:s=n.name.split("/");var c=s.length-1;if(s.length>=2){var l=s.indexOf("-",2),u=s.indexOf("blob",2),d=s.indexOf("tree",2),f=s.indexOf("commit",2),h=s.indexOf("issues",2),m=s.indexOf("src",2),g=s.indexOf("raw",2),A=s.indexOf("edit",2);c=l>0?l-1:u>0&&d>0?Math.min(u-1,d-1):u>0?u-1:h>0?h-1:d>0?d-1:f>0?f-1:m>0?m-1:g>0?g-1:A>0?A-1:c,n.owner=s.slice(0,c).join("/"),n.name=s[c],f&&h<0&&(n.commit=s[c+2])}n.ref="",n.filepathtype="",n.filepath="";var y=s.length>c&&s[c+1]==="-"?c+1:c;s.length>y+2&&["raw","src","blob","tree","edit"].indexOf(s[y+1])>=0&&(n.filepathtype=s[y+1],n.ref=s[y+2],s.length>y+3&&(n.filepath=s.slice(y+3).join("/"))),n.organization=n.owner;break}n.full_name||(n.full_name=n.owner,n.name&&(n.full_name&&(n.full_name+="/"),n.full_name+=n.name)),n.owner.startsWith("scm/")&&(n.source="bitbucket-server",n.owner=n.owner.replace("scm/",""),n.organization=n.owner,n.full_name=n.owner+"/"+n.name);var _=/(projects|users)\/(.*?)\/repos\/(.*?)((\/.*$)|$)/,E=_.exec(n.pathname);return E!=null&&(n.source="bitbucket-server",E[1]==="users"?n.owner="~"+E[2]:n.owner=E[2],n.organization=n.owner,n.name=E[3],s=E[4].split("/"),s.length>1&&(["raw","browse"].indexOf(s[1])>=0?(n.filepathtype=s[1],s.length>2&&(n.filepath=s.slice(2).join("/"))):s[1]==="commits"&&s.length>2&&(n.commit=s[2])),n.full_name=n.owner+"/"+n.name,n.query.at?n.ref=n.query.at:n.ref=""),e.length!==0&&n.ref&&(n.ref=V9o(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(ZUt,"gitUrlParse");ZUt.stringify=function(t,e){e=e||(t.protocols&&t.protocols.length?t.protocols.join("+"):t.protocol);var r=t.port?":"+t.port:"",n=t.user||"git",o=t.git_suffix?".git":"";switch(e){case"ssh":return r?"ssh://"+n+"@"+t.resource+r+"/"+t.full_name+o:n+"@"+t.resource+":"+t.full_name+o;case"git+ssh":case"ssh+git":case"ftp":case"ftps":return e+"://"+n+"@"+t.resource+r+"/"+t.full_name+o;case"http":case"https":var s=t.token?G9o(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+$9o(t)+o;default:return t.href}};function G9o(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(G9o,"buildToken");function $9o(t){if(t.source==="bitbucket-server")return"scm/"+t.full_name;var e=t.full_name.split("/").map(function(r){return encodeURIComponent(r)}).join("/");return e}a($9o,"buildPath");function V9o(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a(V9o,"findLongestMatchingSubstring");Tgn.exports=ZUt});var eue=I((exports,module)=>{p();var Module=typeof Module<"u"?Module:{},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",TreeSitter=(function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{static{a(this,"Parser")}constructor(){this.initialize()}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=a((t,e)=>{throw e},"quit_"),scriptDirectory="";function locateFile(t){return Module.locateFile?Module.locateFile(t,scriptDirectory):scriptDirectory+t}a(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");scriptDirectory=__dirname+"/",readBinary=a(t=>{t=isFileURI(t)?new URL(t):nodePath.normalize(t);var e=fs.readFileSync(t);return e},"readBinary"),readAsync=a((t,e=!0)=>(t=isFileURI(t)?new URL(t):nodePath.normalize(t),new Promise((r,n)=>{fs.readFile(t,e?void 0:"utf8",(o,s)=>{o?n(o):r(e?s.buffer:s)})})),"readAsync"),!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=a((t,e)=>{throw process.exitCode=t,e},"quit_")}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),ENVIRONMENT_IS_WORKER&&(readBinary=a(t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)},"readBinary")),readAsync=a(t=>isFileURI(t)?new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{(n.status==200||n.status==0&&n.response)&&r(n.response),e(n.status)},n.onerror=e,n.send(null)}):fetch(t,{credentials:"same-origin"}).then(e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url))),"readAsync"));var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var wasmMemory,ABORT=!1,EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP_DATA_VIEW;function updateMemoryViews(){var t=wasmMemory.buffer;Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(t),Module.HEAP8=HEAP8=new Int8Array(t),Module.HEAP16=HEAP16=new Int16Array(t),Module.HEAPU8=HEAPU8=new Uint8Array(t),Module.HEAPU16=HEAPU16=new Uint16Array(t),Module.HEAP32=HEAP32=new Int32Array(t),Module.HEAPU32=HEAPU32=new Uint32Array(t),Module.HEAPF32=HEAPF32=new Float32Array(t),Module.HEAPF64=HEAPF64=new Float64Array(t)}if(a(updateMemoryViews,"updateMemoryViews"),Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:2147483648/65536})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}a(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__)}a(initRuntime,"initRuntime");function preMain(){callRuntimeCallbacks(__ATMAIN__)}a(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}a(postRun,"postRun");function addOnPreRun(t){__ATPRERUN__.unshift(t)}a(addOnPreRun,"addOnPreRun");function addOnInit(t){__ATINIT__.unshift(t)}a(addOnInit,"addOnInit");function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}a(addOnPostRun,"addOnPostRun");var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(t){return t}a(getUniqueRunDependency,"getUniqueRunDependency");function addRunDependency(t){runDependencies++,Module.monitorRunDependencies?.(runDependencies)}a(addRunDependency,"addRunDependency");function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e()}}a(removeRunDependency,"removeRunDependency");function abort(t){Module.onAbort?.(t),t="Aborted("+t+")",err(t),ABORT=!0,EXITSTATUS=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw e}a(abort,"abort");var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=a(t=>t.startsWith(dataURIPrefix),"isDataURI"),isFileURI=a(t=>t.startsWith("file://"),"isFileURI");function findWasmBinary(){var t="tree-sitter.wasm";return isDataURI(t)?t:locateFile(t)}a(findWasmBinary,"findWasmBinary");var wasmBinaryFile;function getBinarySync(t){if(t==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(t);throw"both async and sync fetching of the wasm failed"}a(getBinarySync,"getBinarySync");function getBinaryPromise(t){return wasmBinary?Promise.resolve().then(()=>getBinarySync(t)):readAsync(t).then(e=>new Uint8Array(e),()=>getBinarySync(t))}a(getBinaryPromise,"getBinaryPromise");function instantiateArrayBuffer(t,e,r){return getBinaryPromise(t).then(n=>WebAssembly.instantiate(n,e)).then(r,n=>{err(`failed to asynchronously prepare wasm: ${n}`),abort(n)})}a(instantiateArrayBuffer,"instantiateArrayBuffer");function instantiateAsync(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(e)&&!isFileURI(e)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(o=>{var s=WebAssembly.instantiateStreaming(o,r);return s.then(n,function(c){return err(`wasm streaming compile failed: ${c}`),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(e,r,n)})}):instantiateArrayBuffer(e,r,n)}a(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}a(getWasmImports,"getWasmImports");function createWasm(){var t=getWasmImports();function e(n,o){wasmExports=n.exports,wasmExports=relocateExports(wasmExports,1024);var s=getDylinkMetadata(o);return s.neededDynlibs&&(dynamicLibraries=s.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}a(e,"receiveInstance"),addRunDependency("wasm-instantiate");function r(n){e(n.instance,n.module)}if(a(r,"receiveInstantiationResult"),Module.instantiateWasm)try{return Module.instantiateWasm(t,e)}catch(n){return err(`Module.instantiateWasm callback failed with error: ${n}`),!1}return wasmBinaryFile||(wasmBinaryFile=findWasmBinary()),instantiateAsync(wasmBinary,wasmBinaryFile,t,r),{}}a(createWasm,"createWasm");var ASM_CONSTS={};function ExitStatus(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}a(ExitStatus,"ExitStatus");var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(t,e){var r=GOT[e];return r||(r=GOT[e]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(e)||(r.required=!0),r}},LE_HEAP_LOAD_F32=a(t=>HEAP_DATA_VIEW.getFloat32(t,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=a(t=>HEAP_DATA_VIEW.getFloat64(t,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=a(t=>HEAP_DATA_VIEW.getInt16(t,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=a(t=>HEAP_DATA_VIEW.getInt32(t,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_U32=a(t=>HEAP_DATA_VIEW.getUint32(t,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=a((t,e)=>HEAP_DATA_VIEW.setFloat32(t,e,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=a((t,e)=>HEAP_DATA_VIEW.setFloat64(t,e,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=a((t,e)=>HEAP_DATA_VIEW.setInt16(t,e,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=a((t,e)=>HEAP_DATA_VIEW.setInt32(t,e,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_U32=a((t,e)=>HEAP_DATA_VIEW.setUint32(t,e,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=a(t=>{for(;t.length>0;)t.shift()(Module)},"callRuntimeCallbacks"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=a((t,e,r)=>{for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,o));for(var s="";e>10,56320|d&1023)}}return s},"UTF8ArrayToString"),getDylinkMetadata=a(t=>{var e=0,r=0;function n(){return t[e++]}a(n,"getU8");function o(){for(var q=0,M=1;;){var L=t[e++];if(q+=(L&127)*M,M*=128,!(L&128))break}return q}a(o,"getLEB");function s(){var q=o();return e+=q,UTF8ArrayToString(t,e-q,q)}a(s,"getString");function c(q,M){if(q)throw new Error(M)}a(c,"failIf");var l="dylink.0";if(t instanceof WebAssembly.Module){var u=WebAssembly.Module.customSections(t,l);u.length===0&&(l="dylink",u=WebAssembly.Module.customSections(t,l)),c(u.length===0,"need dylink section"),t=new Uint8Array(u[0]),r=t.length}else{var d=new Uint32Array(new Uint8Array(t.subarray(0,24)).buffer),f=d[0]==1836278016||d[0]==6386541;c(!f,"need to see wasm magic number"),c(t[8]!==0,"need the dylink section to be first"),e=9;var h=o();r=e+h,l=s()}var m={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(l=="dylink"){m.memorySize=o(),m.memoryAlign=o(),m.tableSize=o(),m.tableAlign=o();for(var g=o(),A=0;A>1)*2);case"i32":return LE_HEAP_LOAD_I32((t>>2)*4);case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return LE_HEAP_LOAD_F32((t>>2)*4);case"double":return LE_HEAP_LOAD_F64((t>>3)*8);case"*":return LE_HEAP_LOAD_U32((t>>2)*4);default:abort(`invalid type for getValue: ${e}`)}}a(getValue,"getValue");var newDSO=a((t,e,r)=>{var n={refcount:1/0,name:t,exports:r,global:!0};return LDSO.loadedLibsByName[t]=n,e!=null&&(LDSO.loadedLibsByHandle[e]=n),n},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78112,zeroMemory=a((t,e)=>(HEAPU8.fill(0,t,t+e),t),"zeroMemory"),alignMemory=a((t,e)=>Math.ceil(t/e)*e,"alignMemory"),getMemory=a(t=>{if(runtimeInitialized)return zeroMemory(_malloc(t),t);var e=___heap_base,r=e+alignMemory(t,16);return ___heap_base=r,GOT.__heap_base.value=r,e},"getMemory"),isInternalSym=a(t=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(t)||t.startsWith("__em_js__"),"isInternalSym"),uleb128Encode=a((t,e)=>{t<128?e.push(t):e.push(t%128|128,t>>7)},"uleb128Encode"),sigToWasmTypes=a(t=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:t[0]=="v"?[]:[e[t[0]]]},n=1;n{var r=t.slice(0,1),n=t.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};e.push(96),uleb128Encode(n.length,e);for(var s=0;s{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(e),t);var r=[1];generateFuncType(e,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push(...r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(n)),s=new WebAssembly.Instance(o,{e:{f:t}}),c=s.exports.f;return c},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:28,element:"anyfunc"}),getWasmTableEntry=a(t=>{var e=wasmTableMirror[t];return e||(t>=wasmTableMirror.length&&(wasmTableMirror.length=t+1),wasmTableMirror[t]=e=wasmTable.get(t)),e},"getWasmTableEntry"),updateTableMap=a((t,e)=>{if(functionsInTableMap)for(var r=t;r(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(t)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=a(()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(t){throw t instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":t}return wasmTable.length-1},"getEmptyTableSlot"),setWasmTableEntry=a((t,e)=>{wasmTable.set(t,e),wasmTableMirror[t]=wasmTable.get(t)},"setWasmTableEntry"),addFunction=a((t,e)=>{var r=getFunctionAddress(t);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,t)}catch(s){if(!(s instanceof TypeError))throw s;var o=convertJsFunctionToWasm(t,e);setWasmTableEntry(n,o)}return functionsInTableMap.set(t,n),n},"addFunction"),updateGOT=a((t,e)=>{for(var r in t)if(!isInternalSym(r)){var n=t[r];r.startsWith("orig$")&&(r=r.split("$")[1],e=!0),GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(e||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},"updateGOT"),relocateExports=a((t,e,r)=>{var n={};for(var o in t){var s=t[o];typeof s=="object"&&(s=s.value),typeof s=="number"&&(s+=e),n[o]=s}return updateGOT(n,r),n},"relocateExports"),isSymbolDefined=a(t=>{var e=wasmImports[t];return!(!e||e.stub)},"isSymbolDefined"),dynCallLegacy=a((t,e,r)=>{t=t.replace(/p/g,"i");var n=Module["dynCall_"+t];return n(e,...r)},"dynCallLegacy"),dynCall=a((t,e,r=[])=>{if(t.includes("j"))return dynCallLegacy(t,e,r);var n=getWasmTableEntry(e)(...r);return n},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(t=>__emscripten_stack_restore(t),"stackRestore"),createInvokeFunction=a(t=>(e,...r)=>{var n=stackSave();try{return dynCall(t,e,r)}catch(o){if(stackRestore(n),o!==o+0)throw o;_setThrew(1,0)}},"createInvokeFunction"),resolveGlobalSymbol=a((t,e=!1)=>{var r;return e&&"orig$"+t in wasmImports&&(t="orig$"+t),isSymbolDefined(t)?r=wasmImports[t]:t.startsWith("invoke_")&&(r=wasmImports[t]=createInvokeFunction(t.split("_")[1])),{sym:r,name:t}},"resolveGlobalSymbol"),UTF8ToString=a((t,e)=>t?UTF8ArrayToString(HEAPU8,t,e):"","UTF8ToString"),loadWebAssemblyModule=a((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize))}else memoryBase=LE_HEAP_LOAD_U32((handle+12>>2)*4),tableBase=LE_HEAP_LOAD_U32((handle+20>>2)*4);var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(t){var e=resolveGlobalSymbol(t).sym;return!e&&localScope&&(e=localScope[t]),e||(e=moduleExports[t]),e}a(resolveSymbol,"resolveSymbol");var proxyHandler={get(t,e){switch(e){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(e in wasmImports&&!wasmImports[e].stub)return wasmImports[e];if(!(e in t)){var r;t[e]=(...n)=>(r||=resolveSymbol(e),r(...n))}return t[e]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(a(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start ${body};`;moduleExports[name]=eval(func)}a(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(a(postInstantiation,"postInstantiation"),flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(t=>postInstantiation(t.module,t.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return a(loadModule,"loadModule"),flags.loadAsync?metadata.neededDynlibs.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(t=>loadDynamicLibrary(t,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=a((t,e)=>{for(var[r,n]of Object.entries(t)){let o=a(c=>{isSymbolDefined(c)||(wasmImports[c]=n)},"setImport");o(r);let s="__main_argc_argv";r=="main"&&o(s),r==s&&o("main"),r.startsWith("dynCall_")&&!Module.hasOwnProperty(r)&&(Module[r]=n)}},"mergeLibSymbols"),asyncLoad=a((t,e,r,n)=>{var o=n?"":`al ${t}`;readAsync(t).then(s=>{e(new Uint8Array(s)),o&&removeRunDependency(o)},s=>{if(r)r();else throw`Loading data file "${t}" failed.`}),o&&addRunDependency(o)},"asyncLoad");function loadDynamicLibrary(t,e={global:!0,nodelete:!0},r,n){var o=LDSO.loadedLibsByName[t];if(o)return e.global?o.global||(o.global=!0,mergeLibSymbols(o.exports,t)):r&&Object.assign(r,o.exports),e.nodelete&&o.refcount!==1/0&&(o.refcount=1/0),o.refcount++,n&&(LDSO.loadedLibsByHandle[n]=o),e.loadAsync?Promise.resolve(!0):!0;o=newDSO(t,n,"loading"),o.refcount=e.nodelete?1/0:1,o.global=e.global;function s(){if(n){var u=LE_HEAP_LOAD_U32((n+28>>2)*4),d=LE_HEAP_LOAD_U32((n+32>>2)*4);if(u&&d){var f=HEAP8.slice(u,u+d);return e.loadAsync?Promise.resolve(f):f}}var h=locateFile(t);if(e.loadAsync)return new Promise(function(m,g){asyncLoad(h,m,g)});if(!readBinary)throw new Error(`${h}: file not found, and synchronous loading of external files is not available`);return readBinary(h)}a(s,"loadLibData");function c(){return e.loadAsync?s().then(u=>loadWebAssemblyModule(u,e,t,r,n)):loadWebAssemblyModule(s(),e,t,r,n)}a(c,"getExports");function l(u){o.global?mergeLibSymbols(u,t):r&&Object.assign(r,u),o.exports=u}return a(l,"moduleLoaded"),e.loadAsync?c().then(u=>(l(u),!0)):(l(c()),!0)}a(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=a(()=>{for(var[t,e]of Object.entries(GOT))if(e.value==0){var r=resolveGlobalSymbol(t,!0).sym;if(!r&&!e.required)continue;if(typeof r=="function")e.value=addFunction(r,r.sig);else if(typeof r=="number")e.value=r;else throw new Error(`bad export type for '${t}': ${typeof r}`)}},"reportUndefinedSymbols"),loadDylibs=a(()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},"loadDylibs"),noExitRuntime=Module.noExitRuntime||!0;function setValue(t,e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":HEAP8[t]=e;break;case"i8":HEAP8[t]=e;break;case"i16":LE_HEAP_STORE_I16((t>>1)*2,e);break;case"i32":LE_HEAP_STORE_I32((t>>2)*4,e);break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":LE_HEAP_STORE_F32((t>>2)*4,e);break;case"double":LE_HEAP_STORE_F64((t>>3)*8,e);break;case"*":LE_HEAP_STORE_U32((t>>2)*4,e);break;default:abort(`invalid type for setValue: ${r}`)}}a(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78112),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=a(()=>{abort("")},"__abort_js");__abort_js.sig="v";var nowIsMonotonic=1,__emscripten_get_now_is_monotonic=a(()=>nowIsMonotonic,"__emscripten_get_now_is_monotonic");__emscripten_get_now_is_monotonic.sig="i";var __emscripten_memcpy_js=a((t,e,r)=>HEAPU8.copyWithin(t,e,e+r),"__emscripten_memcpy_js");__emscripten_memcpy_js.sig="vppp";var _emscripten_date_now=a(()=>Date.now(),"_emscripten_date_now");_emscripten_date_now.sig="d";var _emscripten_get_now;_emscripten_get_now=a(()=>performance.now(),"_emscripten_get_now"),_emscripten_get_now.sig="d";var getHeapMax=a(()=>2147483648,"getHeapMax"),growMemory=a(t=>{var e=wasmMemory.buffer,r=(t-e.byteLength+65535)/65536;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=a(t=>{var e=HEAPU8.length;t>>>=0;var r=getHeapMax();if(t>r)return!1;for(var n=a((u,d)=>u+(d-u%d)%d,"alignUp"),o=1;o<=4;o*=2){var s=e*(1+.2/o);s=Math.min(s,t+100663296);var c=Math.min(r,n(Math.max(t,s),65536)),l=growMemory(c);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=a(t=>52,"_fd_close");_fd_close.sig="ii";var convertI32PairToI53Checked=a((t,e)=>e+2097152>>>0<4194305-!!t?(t>>>0)+e*4294967296:NaN,"convertI32PairToI53Checked");function _fd_seek(t,e,r,n,o){var s=convertI32PairToI53Checked(e,r);return 70}a(_fd_seek,"_fd_seek"),_fd_seek.sig="iiiiip";var printCharBuffers=[null,[],[]],printChar=a((t,e)=>{var r=printCharBuffers[t];e===0||e===10?((t===1?out:err)(UTF8ArrayToString(r,0)),r.length=0):r.push(e)},"printChar"),_fd_write=a((t,e,r,n)=>{for(var o=0,s=0;s>2)*4),l=LE_HEAP_LOAD_U32((e+4>>2)*4);e+=8;for(var u=0;u>2)*4,o),0},"_fd_write");_fd_write.sig="iippp";function _tree_sitter_log_callback(t,e){if(currentLogCallback){let r=UTF8ToString(e);currentLogCallback(r,t!==0)}}a(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(t,e,r,n,o){let c=currentParseCallback(e,{row:r,column:n});typeof c=="string"?(setValue(o,c.length,"i32"),stringToUTF16(c,t,10240)):setValue(o,0,"i32")}a(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");var runtimeKeepaliveCounter=0,keepRuntimeAlive=a(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=a(t=>{EXITSTATUS=t,keepRuntimeAlive()||(Module.onExit?.(t),ABORT=!0),quit_(t,new ExitStatus(t))},"_proc_exit");_proc_exit.sig="vi";var exitJS=a((t,e)=>{EXITSTATUS=t,_proc_exit(t)},"exitJS"),handleException=a(t=>{if(t instanceof ExitStatus||t=="unwind")return EXITSTATUS;quit_(1,t)},"handleException"),lengthBytesUTF8=a(t=>{for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3}return e},"lengthBytesUTF8"),stringToUTF8Array=a((t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,s=r+n-1,c=0;c=55296&&l<=57343){var u=t.charCodeAt(++c);l=65536+((l&1023)<<10)|u&1023}if(l<=127){if(r>=s)break;e[r++]=l}else if(l<=2047){if(r+1>=s)break;e[r++]=192|l>>6,e[r++]=128|l&63}else if(l<=65535){if(r+2>=s)break;e[r++]=224|l>>12,e[r++]=128|l>>6&63,e[r++]=128|l&63}else{if(r+3>=s)break;e[r++]=240|l>>18,e[r++]=128|l>>12&63,e[r++]=128|l>>6&63,e[r++]=128|l&63}}return e[r]=0,r-o},"stringToUTF8Array"),stringToUTF8=a((t,e,r)=>stringToUTF8Array(t,HEAPU8,e,r),"stringToUTF8"),stackAlloc=a(t=>__emscripten_stack_alloc(t),"stackAlloc"),stringToUTF8OnStack=a(t=>{var e=lengthBytesUTF8(t)+1,r=stackAlloc(e);return stringToUTF8(t,r,e),r},"stringToUTF8OnStack"),stringToUTF16=a((t,e,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var n=e,o=r>1)*2,c),e+=2}return LE_HEAP_STORE_I16((e>>1)*2,0),e-n},"stringToUTF16"),AsciiToString=a(t=>{for(var e="";;){var r=HEAPU8[t++];if(!r)return e;e+=String.fromCharCode(r)}},"AsciiToString"),wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_memcpy_js:__emscripten_memcpy_js,emscripten_get_now:_emscripten_get_now,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback},wasmExports=createWasm(),___wasm_call_ctors=a(()=>(___wasm_call_ctors=wasmExports.__wasm_call_ctors)(),"___wasm_call_ctors"),___wasm_apply_data_relocs=a(()=>(___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs)(),"___wasm_apply_data_relocs"),_malloc=Module._malloc=t=>(_malloc=Module._malloc=wasmExports.malloc)(t),_calloc=Module._calloc=(t,e)=>(_calloc=Module._calloc=wasmExports.calloc)(t,e),_realloc=Module._realloc=(t,e)=>(_realloc=Module._realloc=wasmExports.realloc)(t,e),_free=Module._free=t=>(_free=Module._free=wasmExports.free)(t),_ts_language_symbol_count=Module._ts_language_symbol_count=t=>(_ts_language_symbol_count=Module._ts_language_symbol_count=wasmExports.ts_language_symbol_count)(t),_ts_language_state_count=Module._ts_language_state_count=t=>(_ts_language_state_count=Module._ts_language_state_count=wasmExports.ts_language_state_count)(t),_ts_language_version=Module._ts_language_version=t=>(_ts_language_version=Module._ts_language_version=wasmExports.ts_language_version)(t),_ts_language_field_count=Module._ts_language_field_count=t=>(_ts_language_field_count=Module._ts_language_field_count=wasmExports.ts_language_field_count)(t),_ts_language_next_state=Module._ts_language_next_state=(t,e,r)=>(_ts_language_next_state=Module._ts_language_next_state=wasmExports.ts_language_next_state)(t,e,r),_ts_language_symbol_name=Module._ts_language_symbol_name=(t,e)=>(_ts_language_symbol_name=Module._ts_language_symbol_name=wasmExports.ts_language_symbol_name)(t,e),_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=(t,e,r,n)=>(_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name)(t,e,r,n),_strncmp=Module._strncmp=(t,e,r)=>(_strncmp=Module._strncmp=wasmExports.strncmp)(t,e,r),_ts_language_symbol_type=Module._ts_language_symbol_type=(t,e)=>(_ts_language_symbol_type=Module._ts_language_symbol_type=wasmExports.ts_language_symbol_type)(t,e),_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=(t,e)=>(_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id)(t,e),_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=(t,e)=>(_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new)(t,e),_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=t=>(_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete)(t),_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=(t,e)=>(_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state)(t,e),_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=(t,e,r)=>(_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset)(t,e,r),_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=t=>(_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next)(t),_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=t=>(_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol)(t),_memset=Module._memset=(t,e,r)=>(_memset=Module._memset=wasmExports.memset)(t,e,r),_memcpy=Module._memcpy=(t,e,r)=>(_memcpy=Module._memcpy=wasmExports.memcpy)(t,e,r),_ts_parser_delete=Module._ts_parser_delete=t=>(_ts_parser_delete=Module._ts_parser_delete=wasmExports.ts_parser_delete)(t),_ts_parser_reset=Module._ts_parser_reset=t=>(_ts_parser_reset=Module._ts_parser_reset=wasmExports.ts_parser_reset)(t),_ts_parser_set_language=Module._ts_parser_set_language=(t,e)=>(_ts_parser_set_language=Module._ts_parser_set_language=wasmExports.ts_parser_set_language)(t,e),_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=t=>(_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros)(t),_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=(t,e,r)=>(_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros)(t,e,r),_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=(t,e,r)=>(_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges)(t,e,r),_memmove=Module._memmove=(t,e,r)=>(_memmove=Module._memmove=wasmExports.memmove)(t,e,r),_memcmp=Module._memcmp=(t,e,r)=>(_memcmp=Module._memcmp=wasmExports.memcmp)(t,e,r),_ts_query_new=Module._ts_query_new=(t,e,r,n,o)=>(_ts_query_new=Module._ts_query_new=wasmExports.ts_query_new)(t,e,r,n,o),_ts_query_delete=Module._ts_query_delete=t=>(_ts_query_delete=Module._ts_query_delete=wasmExports.ts_query_delete)(t),_iswspace=Module._iswspace=t=>(_iswspace=Module._iswspace=wasmExports.iswspace)(t),_iswalnum=Module._iswalnum=t=>(_iswalnum=Module._iswalnum=wasmExports.iswalnum)(t),_ts_query_pattern_count=Module._ts_query_pattern_count=t=>(_ts_query_pattern_count=Module._ts_query_pattern_count=wasmExports.ts_query_pattern_count)(t),_ts_query_capture_count=Module._ts_query_capture_count=t=>(_ts_query_capture_count=Module._ts_query_capture_count=wasmExports.ts_query_capture_count)(t),_ts_query_string_count=Module._ts_query_string_count=t=>(_ts_query_string_count=Module._ts_query_string_count=wasmExports.ts_query_string_count)(t),_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=(t,e,r)=>(_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id)(t,e,r),_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=(t,e,r)=>(_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id)(t,e,r),_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=(t,e,r)=>(_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern)(t,e,r),_ts_query_disable_capture=Module._ts_query_disable_capture=(t,e,r)=>(_ts_query_disable_capture=Module._ts_query_disable_capture=wasmExports.ts_query_disable_capture)(t,e,r),_ts_tree_copy=Module._ts_tree_copy=t=>(_ts_tree_copy=Module._ts_tree_copy=wasmExports.ts_tree_copy)(t),_ts_tree_delete=Module._ts_tree_delete=t=>(_ts_tree_delete=Module._ts_tree_delete=wasmExports.ts_tree_delete)(t),_ts_init=Module._ts_init=()=>(_ts_init=Module._ts_init=wasmExports.ts_init)(),_ts_parser_new_wasm=Module._ts_parser_new_wasm=()=>(_ts_parser_new_wasm=Module._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm)(),_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=(t,e)=>(_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm)(t,e),_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=(t,e,r,n,o)=>(_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm)(t,e,r,n,o),_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=t=>(_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm)(t),_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=(t,e)=>(_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm)(t,e),_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=(t,e)=>(_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm)(t,e),_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=t=>(_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm)(t),_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=t=>(_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm)(t),_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=t=>(_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm)(t),_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=t=>(_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm)(t),_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=(t,e)=>(_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm)(t,e),_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=t=>(_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm)(t),_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=t=>(_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm)(t),_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=t=>(_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm)(t),_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=(t,e)=>(_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm)(t,e),_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=t=>(_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm)(t),_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=t=>(_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm)(t),_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=t=>(_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(t),_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=t=>(_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(t),_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=t=>(_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(t),_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=t=>(_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(t),_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=(t,e)=>(_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm)(t,e),_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=t=>(_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm)(t),_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=t=>(_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm)(t),_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=t=>(_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm)(t),_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=t=>(_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm)(t),_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=t=>(_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(t),_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=t=>(_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm)(t),_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=t=>(_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm)(t),_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=t=>(_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm)(t),_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=t=>(_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm)(t),_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=t=>(_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm)(t),_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=t=>(_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm)(t),_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=t=>(_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm)(t),_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=t=>(_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm)(t),_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=t=>(_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm)(t),_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=t=>(_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm)(t),_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=(t,e)=>(_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm)(t,e),_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=(t,e)=>(_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm)(t,e),_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=t=>(_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm)(t),_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=t=>(_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm)(t),_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=t=>(_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm)(t),_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=t=>(_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm)(t),_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=t=>(_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm)(t),_ts_node_child_wasm=Module._ts_node_child_wasm=(t,e)=>(_ts_node_child_wasm=Module._ts_node_child_wasm=wasmExports.ts_node_child_wasm)(t,e),_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=(t,e)=>(_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm)(t,e),_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=(t,e)=>(_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm)(t,e),_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=t=>(_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm)(t),_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=t=>(_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm)(t),_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=t=>(_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm)(t),_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=t=>(_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm)(t),_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=t=>(_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm)(t),_ts_node_parent_wasm=Module._ts_node_parent_wasm=t=>(_ts_node_parent_wasm=Module._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm)(t),_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=t=>(_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm)(t),_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=t=>(_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm)(t),_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=t=>(_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm)(t),_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=t=>(_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm)(t),_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=t=>(_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm)(t),_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=t=>(_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm)(t),_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=t=>(_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm)(t),_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=t=>(_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm)(t),_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=t=>(_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm)(t),_ts_node_children_wasm=Module._ts_node_children_wasm=t=>(_ts_node_children_wasm=Module._ts_node_children_wasm=wasmExports.ts_node_children_wasm)(t),_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=t=>(_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm)(t),_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=(t,e,r,n,o,s,c)=>(_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm)(t,e,r,n,o,s,c),_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=t=>(_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm)(t),_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=t=>(_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm)(t),_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=t=>(_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm)(t),_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=t=>(_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm)(t),_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=t=>(_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm)(t),_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=t=>(_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm)(t),_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=t=>(_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm)(t),_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=t=>(_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm)(t),_ts_query_matches_wasm=Module._ts_query_matches_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_matches_wasm=Module._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm)(t,e,r,n,o,s,c,l,u,d),_ts_query_captures_wasm=Module._ts_query_captures_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_captures_wasm=Module._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm)(t,e,r,n,o,s,c,l,u,d),_iswalpha=Module._iswalpha=t=>(_iswalpha=Module._iswalpha=wasmExports.iswalpha)(t),_iswblank=Module._iswblank=t=>(_iswblank=Module._iswblank=wasmExports.iswblank)(t),_iswdigit=Module._iswdigit=t=>(_iswdigit=Module._iswdigit=wasmExports.iswdigit)(t),_iswlower=Module._iswlower=t=>(_iswlower=Module._iswlower=wasmExports.iswlower)(t),_iswupper=Module._iswupper=t=>(_iswupper=Module._iswupper=wasmExports.iswupper)(t),_iswxdigit=Module._iswxdigit=t=>(_iswxdigit=Module._iswxdigit=wasmExports.iswxdigit)(t),_memchr=Module._memchr=(t,e,r)=>(_memchr=Module._memchr=wasmExports.memchr)(t,e,r),_strlen=Module._strlen=t=>(_strlen=Module._strlen=wasmExports.strlen)(t),_strcmp=Module._strcmp=(t,e)=>(_strcmp=Module._strcmp=wasmExports.strcmp)(t,e),_strncat=Module._strncat=(t,e,r)=>(_strncat=Module._strncat=wasmExports.strncat)(t,e,r),_strncpy=Module._strncpy=(t,e,r)=>(_strncpy=Module._strncpy=wasmExports.strncpy)(t,e,r),_towlower=Module._towlower=t=>(_towlower=Module._towlower=wasmExports.towlower)(t),_towupper=Module._towupper=t=>(_towupper=Module._towupper=wasmExports.towupper)(t),_setThrew=a((t,e)=>(_setThrew=wasmExports.setThrew)(t,e),"_setThrew"),__emscripten_stack_restore=a(t=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(t),"__emscripten_stack_restore"),__emscripten_stack_alloc=a(t=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(t),"__emscripten_stack_alloc"),_emscripten_stack_get_current=a(()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),"_emscripten_stack_get_current"),dynCall_jiji=Module.dynCall_jiji=(t,e,r,n,o)=>(dynCall_jiji=Module.dynCall_jiji=wasmExports.dynCall_jiji)(t,e,r,n,o),_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=t=>(_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=wasmExports.orig$ts_parser_timeout_micros)(t),_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=(t,e)=>(_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=wasmExports.orig$ts_parser_set_timeout_micros)(t,e);Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16;var calledRun;dependenciesFulfilled=a(function t(){calledRun||run(),calledRun||(dependenciesFulfilled=t)},"runCaller");function callMain(t=[]){var e=resolveGlobalSymbol("main").sym;if(e){t.unshift(thisProgram);var r=t.length,n=stackAlloc((r+1)*4),o=n;t.forEach(c=>{LE_HEAP_STORE_U32((o>>2)*4,stringToUTF8OnStack(c)),o+=4}),LE_HEAP_STORE_U32((o>>2)*4,0);try{var s=e(r,n);return exitJS(s,!0),s}catch(c){return handleException(c)}}}a(callMain,"callMain");function run(t=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function e(){calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),Module.onRuntimeInitialized?.(),shouldRunNow&&callMain(t),postRun()))}a(e,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),e()},1)):e()}if(a(run,"run"),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_CURSOR=4*SIZE_OF_INT,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/,VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static{a(this,"ParserImpl")}static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let r;if(!e)r=0,e=null;else if(e.constructor===Language){r=e[0];let n=C._ts_language_version(r);if(ne.slice(u),"currentParseCallback");else if(typeof e=="function")currentParseCallback=e;else throw new Error("Argument must be a string or a function");this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let o=0,s=0;if(n?.includedRanges){o=n.includedRanges.length,s=C._calloc(o,SIZE_OF_RANGE);let u=s;for(let d=0;d0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let n=r;for(let o=0;o0){let n=r;for(let o=0;o0){let f=u;for(let h=0;hJpn,__assign:()=>QVe,__asyncDelegator:()=>Gpn,__asyncGenerator:()=>XIe,__asyncValues:()=>HVe,__await:()=>Y1,__awaiter:()=>Fpn,__classPrivateFieldGet:()=>zpn,__classPrivateFieldIn:()=>Kpn,__classPrivateFieldSet:()=>Ypn,__createBinding:()=>jVe,__decorate:()=>Ppn,__disposeResources:()=>Zpn,__esDecorate:()=>Npn,__exportStar:()=>Qpn,__extends:()=>Rpn,__generator:()=>Upn,__importDefault:()=>Wpn,__importStar:()=>Vpn,__makeTemplateObject:()=>$pn,__metadata:()=>Bpn,__param:()=>Dpn,__propKey:()=>Opn,__read:()=>F6t,__rest:()=>kpn,__rewriteRelativeImportExtension:()=>Xpn,__runInitializers:()=>Mpn,__setFunctionName:()=>Lpn,__spread:()=>qpn,__spreadArray:()=>Hpn,__spreadArrays:()=>jpn,__values:()=>qVe,default:()=>tFo});function Rpn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");L6t(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function kpn(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function Dpn(t,e){return function(r,n){e(r,n,t)}}function Npn(t,e,r,n,o,s){function c(E){if(E!==void 0&&typeof E!="function")throw new TypeError("Function expected");return E}a(c,"accept");for(var l=n.kind,u=l==="getter"?"get":l==="setter"?"set":"value",d=!e&&t?n.static?t:t.prototype:null,f=e||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),h,m=!1,g=r.length-1;g>=0;g--){var A={};for(var y in n)A[y]=y==="access"?{}:n[y];for(var y in n.access)A.access[y]=n.access[y];A.addInitializer=function(E){if(m)throw new TypeError("Cannot add initializers after decoration has completed");s.push(c(E||null))};var _=(0,r[g])(l==="accessor"?{get:f.get,set:f.set}:f[u],A);if(l==="accessor"){if(_===void 0)continue;if(_===null||typeof _!="object")throw new TypeError("Object expected");(h=c(_.get))&&(f.get=h),(h=c(_.set))&&(f.set=h),(h=c(_.init))&&o.unshift(h)}else(h=c(_))&&(l==="field"?o.unshift(h):f[u]=h)}d&&Object.defineProperty(d,n.name,f),m=!0}function Mpn(t,e,r){for(var n=arguments.length>2,o=0;o0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function F6t(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s}function qpn(){for(var t=[],e=0;e1||u(g,y)})},A&&(o[g]=A(o[g])))}function u(g,A){try{d(n[g](A))}catch(y){m(s[0][3],y)}}function d(g){g.value instanceof Y1?Promise.resolve(g.value.v).then(f,h):m(s[0][2],g)}function f(g){u("next",g)}function h(g){u("throw",g)}function m(g,A){g(A),s.shift(),s.length&&u(s[0][0],s[0][1])}}function Gpn(t){var e,r;return e={},n("next"),n("throw",function(o){throw o}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(o,s){e[o]=t[o]?function(c){return(r=!r)?{value:Y1(t[o](c)),done:!1}:s?s(c):c}:s}}function HVe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof qVe=="function"?qVe(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(c){return new Promise(function(l,u){c=t[s](c),o(l,u,c.done,c.value)})}}function o(s,c,l,u){Promise.resolve(u).then(function(d){s({value:d,done:l})},c)}}function $pn(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Vpn(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=B6t(t),n=0;n{p();L6t=a(function(t,e){return L6t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},L6t(t,e)},"extendStatics");a(Rpn,"__extends");QVe=a(function(){return QVe=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(eWe,"__esModule",{value:!0});eWe.state=void 0;eWe.state={operationRequestMap:new WeakMap}});function r8o(){try{return dUt.default.statSync("/.dockerenv"),!0}catch{return!1}}function n8o(){try{return dUt.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function fUt(){return uUt===void 0&&(uUt=r8o()||n8o()),uUt}var dUt,uUt,Dhn=Se(()=>{p();dUt=fe(require("node:fs"),1);a(r8o,"hasDockerEnv");a(n8o,"hasDockerCGroup");a(fUt,"isDocker")});function Vle(){return pUt===void 0&&(pUt=i8o()||fUt()),pUt}var Nhn,pUt,i8o,hUt=Se(()=>{p();Nhn=fe(require("node:fs"),1);Dhn();i8o=a(()=>{try{return Nhn.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a(Vle,"isInsideContainer")});var mUt,Ohn,Lhn,Mhn,VQ,gUt=Se(()=>{p();mUt=fe(require("node:process"),1),Ohn=fe(require("node:os"),1),Lhn=fe(require("node:fs"),1);hUt();Mhn=a(()=>{if(mUt.default.platform!=="linux")return!1;if(Ohn.default.release().toLowerCase().includes("microsoft"))return!Vle();try{return Lhn.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Vle():!1}catch{return!1}},"isWsl"),VQ=mUt.default.env.__IS_WSL_TEST__?Mhn:Mhn()});var AUt,oxe,o8o,s8o,yUt,Bhn=Se(()=>{p();AUt=fe(require("node:process"),1),oxe=fe(require("node:fs/promises"),1);gUt();gUt();o8o=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await oxe.default.access(r,oxe.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await oxe.default.readFile(r,{encoding:"utf8"}),s=/(?.*)/g.exec(o);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),s8o=a(async()=>`${await o8o()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),yUt=a(async()=>VQ?s8o():`${AUt.default.env.SYSTEMROOT||AUt.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function WQ(t,e,r){let n=a(o=>Object.defineProperty(t,e,{value:o,enumerable:!0,writable:!0}),"define");return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let o=r();return n(o),o},set(o){n(o)}}),t}var Fhn=Se(()=>{p();a(WQ,"defineLazyProperty")});async function _Ut(){if(Qhn.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await a8o("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var Uhn,Qhn,qhn,a8o,jhn=Se(()=>{p();Uhn=require("node:util"),Qhn=fe(require("node:process"),1),qhn=require("node:child_process"),a8o=(0,Uhn.promisify)(qhn.execFile);a(_Ut,"defaultBrowserId")});async function $hn(t,{humanReadableOutput:e=!0}={}){if(Hhn.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await c8o("osascript",["-e",t,r]);return n.trim()}var Hhn,Ghn,EUt,c8o,Vhn=Se(()=>{p();Hhn=fe(require("node:process"),1),Ghn=require("node:util"),EUt=require("node:child_process"),c8o=(0,Ghn.promisify)(EUt.execFile);a($hn,"runAppleScript")});async function vUt(t){return $hn(`tell application "Finder" to set app_path to application file id "${t}" as string +tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var Whn=Se(()=>{p();Vhn();a(vUt,"bundleName")});async function CUt(t=l8o){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?\S+)/.exec(e);if(!r)throw new rWe(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=u8o[n];if(!o)throw new rWe(`Unknown browser ID: ${n}`);return o}var zhn,Yhn,l8o,u8o,rWe,Khn=Se(()=>{p();zhn=require("node:util"),Yhn=require("node:child_process"),l8o=(0,zhn.promisify)(Yhn.execFile),u8o={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},rWe=class extends Error{static{a(this,"UnknownBrowserError")}};a(CUt,"defaultBrowser")});async function bUt(){if(nWe.default.platform==="darwin"){let t=await _Ut();return{name:await vUt(t),id:t}}if(nWe.default.platform==="linux"){let{stdout:t}=await d8o("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:f8o(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(nWe.default.platform==="win32")return CUt();throw new Error("Only macOS, Linux, and Windows are supported")}var Jhn,nWe,Zhn,d8o,f8o,Xhn=Se(()=>{p();Jhn=require("node:util"),nWe=fe(require("node:process"),1),Zhn=require("node:child_process");jhn();Whn();Khn();d8o=(0,Jhn.promisify)(Zhn.execFile),f8o=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(bUt,"defaultBrowser")});var smn={};Ti(smn,{apps:()=>zQ,default:()=>axe,openApp:()=>g8o});async function h8o(){let t=await yUt(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=IUt.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await p8o(t,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",r],{encoding:"utf8"}),o=n.trim(),s={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return s[o]?{id:s[o]}:{}}function nmn(t){if(typeof t=="string"||Array.isArray(t))return t;let{[tmn]:e}=t;if(!e)throw new Error(`${tmn} is not supported`);return e}function oWe({[Wle]:t},{wsl:e}){if(e&&VQ)return nmn(e);if(!t)throw new Error(`${Wle} is not supported`);return nmn(t)}var TUt,IUt,xUt,imn,omn,wUt,iWe,p8o,SUt,emn,Wle,tmn,rmn,sxe,m8o,g8o,zQ,axe,sWe=Se(()=>{p();TUt=fe(require("node:process"),1),IUt=require("node:buffer"),xUt=fe(require("node:path"),1),imn=require("node:url"),omn=require("node:util"),wUt=fe(require("node:child_process"),1),iWe=fe(require("node:fs/promises"),1);Bhn();Fhn();Xhn();hUt();p8o=(0,omn.promisify)(wUt.default.execFile),SUt=xUt.default.dirname((0,imn.fileURLToPath)(importMetaUrlShim)),emn=xUt.default.join(SUt,"xdg-open"),{platform:Wle,arch:tmn}=TUt.default;a(h8o,"getWindowsDefaultBrowserFromWsl");rmn=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),sxe=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return rmn(t.app,l=>sxe({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return rmn(e,l=>sxe({...t,app:{name:l,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let l={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},d=VQ?await h8o():await bUt();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),sxe({...t,app:{name:zQ[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(Wle==="darwin")n="open",t.wait&&o.push("--wait-apps"),t.background&&o.push("--background"),t.newInstance&&o.push("--new"),e&&o.push("-a",e);else if(Wle==="win32"||VQ&&!Vle()&&!e){n=await yUt(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),VQ||(s.windowsVerbatimArguments=!0);let l=["Start"];t.wait&&l.push("-Wait"),e?(l.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&l.push(`"${t.target}"`),r.length>0&&(r=r.map(u=>`"\`"${u}\`""`),l.push("-ArgumentList",r.join(","))),t.target=IUt.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!SUt||SUt==="/",u=!1;try{await iWe.default.access(emn,iWe.constants.X_OK),u=!0}catch{}n=TUt.default.versions.electron??(Wle==="android"||l||!u)?"xdg-open":emn}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}Wle==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=wUt.default.spawn(n,o,s);return t.wait?new Promise((l,u)=>{c.once("error",u),c.once("close",d=>{if(!t.allowNonzeroExitCode&&d>0){u(new Error(`Exited with code ${d}`));return}l(c)})}):(c.unref(),c)},"baseOpen"),m8o=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return sxe({...e,target:t})},"open"),g8o=a((t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return sxe({...e,app:{name:t,arguments:r}})},"openApp");a(nmn,"detectArchBinary");a(oWe,"detectPlatformBinary");zQ={};WQ(zQ,"chrome",()=>oWe({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));WQ(zQ,"brave",()=>oWe({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));WQ(zQ,"firefox",()=>oWe({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));WQ(zQ,"edge",()=>oWe({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));WQ(zQ,"browser",()=>"browser");WQ(zQ,"browserPrivate",()=>"browserPrivate");axe=m8o});var ZUt=I((o4u,dgn)=>{"use strict";p();dgn.exports=a(function(e,r){r===!0&&(r=0);var n="";if(typeof e=="string")try{n=new URL(e).protocol}catch{}else e&&e.constructor===URL&&(n=e.protocol);var o=n.split(/\:|\+/).filter(Boolean);return typeof r=="number"?o[r]:o},"protocols")});var pgn=I((c4u,fgn)=>{"use strict";p();var S9o=ZUt();function T9o(t){var e={protocols:[],protocol:null,port:null,resource:"",host:"",user:"",password:"",pathname:"",hash:"",search:"",href:t,query:{},parse_failed:!1};try{var r=new URL(t);e.protocols=S9o(r),e.protocol=e.protocols[0],e.port=r.port,e.resource=r.hostname,e.host=r.host,e.user=r.username||"",e.password=r.password||"",e.pathname=r.pathname,e.hash=r.hash.slice(1),e.search=r.search.slice(1),e.href=r.href,e.query=Object.fromEntries(r.searchParams)}catch{e.protocols=["file"],e.protocol=e.protocols[0],e.port="",e.resource="",e.user="",e.pathname="",e.hash="",e.search="",e.href=t,e.query={},e.parse_failed=!0}return e}a(T9o,"parsePath");fgn.exports=T9o});var _gn=I((d4u,ygn)=>{"use strict";p();var I9o=pgn();function x9o(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(x9o,"_interopDefaultLegacy");var w9o=x9o(I9o);function R9o(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=a(function n(){if(this instanceof n){var o=[null];o.push.apply(o,arguments);var s=Function.bind.apply(e,o);return new s}return e.apply(this,arguments)},"a");r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:a(function(){return t[n]},"get")})}),r}a(R9o,"getAugmentedNamespace");var mgn={},k9o="text/plain",P9o="us-ascii",hgn=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),D9o=a((t,{stripHash:e})=>{let r=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:n,data:o,hash:s}=r.groups,c=n.split(";");s=e?"":s;let l=!1;c[c.length-1]==="base64"&&(c.pop(),l=!0);let u=(c.shift()||"").toLowerCase(),f=[...c.map(h=>{let[m,g=""]=h.split("=").map(A=>A.trim());return m==="charset"&&(g=g.toLowerCase(),g===P9o)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==k9o)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function N9o(t,e){if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},t=t.trim(),/^data:/i.test(t))return D9o(t,e);if(/^view-source:/i.test(t))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let o=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&o.protocol==="https:"&&(o.protocol="http:"),e.forceHttps&&o.protocol==="http:"&&(o.protocol="https:"),e.stripAuthentication&&(o.username="",o.password=""),e.stripHash?o.hash="":e.stripTextFragment&&(o.hash=o.hash.replace(/#?:~:text.*?$/i,"")),o.pathname){let c=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,l=0,u="";for(;;){let f=c.exec(o.pathname);if(!f)break;let h=f[0],m=f.index,g=o.pathname.slice(l,m);u+=g.replace(/\/{2,}/g,"/"),u+=h,l=m+h.length}let d=o.pathname.slice(l,o.pathname.length);u+=d.replace(/\/{2,}/g,"/"),o.pathname=u}if(o.pathname)try{o.pathname=decodeURI(o.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let c=o.pathname.split("/"),l=c[c.length-1];hgn(l,e.removeDirectoryIndex)&&(c=c.slice(0,-1),o.pathname=c.slice(1).join("/")+"/")}if(o.hostname&&(o.hostname=o.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(o.hostname)&&(o.hostname=o.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let c of[...o.searchParams.keys()])hgn(c,e.removeQueryParameters)&&o.searchParams.delete(c);if(e.removeQueryParameters===!0&&(o.search=""),e.sortQueryParameters){o.searchParams.sort();try{o.search=decodeURIComponent(o.search)}catch{}}e.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,""));let s=t;return t=o.toString(),!e.removeSingleSlash&&o.pathname==="/"&&!s.endsWith("/")&&o.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||o.pathname==="/")&&o.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t}a(N9o,"normalizeUrl");var M9o=Object.freeze({__proto__:null,default:N9o}),O9o=R9o(M9o);Object.defineProperty(mgn,"__esModule",{value:!0});var L9o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B9o=O9o,F9o=ggn(B9o),U9o=w9o.default,Q9o=ggn(U9o);function ggn(t){return t&&t.__esModule?t:{default:t}}a(ggn,"_interopRequireDefault");var Agn=a(function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=/^(?:([a-zA-Z_][a-zA-Z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:](([\~,\.\w,\-,\_,\/,\s]|%[0-9A-Fa-f]{2})+?(?:\.git|\/)?)$/,o=a(function(u){var d=new Error(u);throw d.subject_url=e,d},"throwErr");(typeof e!="string"||!e.trim())&&o("Invalid url."),e.length>t.MAX_INPUT_LENGTH&&o("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."),r&&((typeof r>"u"?"undefined":L9o(r))!=="object"&&(r={stripHash:!1}),e=(0,F9o.default)(e,r));var s=(0,Q9o.default)(e);if(s.parse_failed){var c=s.href.match(n);c?(s.protocols=["ssh"],s.protocol="ssh",s.resource=c[2],s.host=c[2],s.user=c[1],s.pathname="/"+c[3],s.parse_failed=!1):o("URL parsing failed.")}return s},"parseUrl");Agn.MAX_INPUT_LENGTH=2048;var q9o=mgn.default=Agn;ygn.exports=q9o});var Cgn=I((h4u,vgn)=>{"use strict";p();var j9o=ZUt();function Egn(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=j9o(t);if(t=t.substring(t.indexOf("://")+3),Egn(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var H9o=_gn(),bgn=Cgn();function G9o(t){let e=H9o(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),bgn(e.protocols)||e.protocols.length===0&&bgn(t)?e.protocol="ssh":e.protocols.length?e.protocol=e.protocols[0]:(e.protocol="file",e.protocols=["file"]),e.href=e.href.replace(/\/$/,""),e}a(G9o,"gitUp");Sgn.exports=G9o});var xgn=I((E4u,Ign)=>{"use strict";p();var $9o=Tgn();function XUt(t,e){if(e=e||[],typeof t!="string")throw new Error("The url must be a string.");if(!e.every(function(v){return typeof v=="string"}))throw new Error("The refs should contain only strings");var r=/^([a-z\d-]{1,39})\/([-\.\w]{1,100})$/i;r.test(t)&&(t="https://github.com/"+t);var n=$9o(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return XUt.stringify(this,v)},n.source=o.length>2?o.slice(1-o.length).join("."):n.source=n.resource,n.git_suffix=/\.git$/.test(n.pathname),n.name=decodeURIComponent((n.pathname||n.href).replace(/(^\/)|(\/$)/g,"").replace(/\.git$/,"")),n.owner=decodeURIComponent(n.user),n.source){case"git.cloudforge.com":n.owner=n.user,n.organization=o[0],n.source="cloudforge.com";break;case"visualstudio.com":if(n.resource==="vs-ssh.visualstudio.com"){s=n.name.split("/"),s.length===4&&(n.organization=s[1],n.owner=s[2],n.name=s[3],n.full_name=s[2]+"/"+s[3]);break}else{s=n.name.split("/"),s.length===2?(n.owner=s[1],n.name=s[1],n.full_name="_git/"+n.name):s.length===3?(n.name=s[2],s[0]==="DefaultCollection"?(n.owner=s[2],n.organization=s[0],n.full_name=n.organization+"/_git/"+n.name):(n.owner=s[0],n.full_name=n.owner+"/_git/"+n.name)):s.length===4&&(n.organization=s[0],n.owner=s[1],n.name=s[3],n.full_name=n.organization+"/"+n.owner+"/_git/"+n.name);break}case"dev.azure.com":case"azure.com":if(n.resource==="ssh.dev.azure.com"){s=n.name.split("/"),s.length===4&&(n.organization=s[1],n.owner=s[2],n.name=s[3]);break}else{s=n.name.split("/"),s.length===5?(n.organization=s[0],n.owner=s[1],n.name=s[4],n.full_name="_git/"+n.name):s.length===3?(n.name=s[2],s[0]==="DefaultCollection"?(n.owner=s[2],n.organization=s[0],n.full_name=n.organization+"/_git/"+n.name):(n.owner=s[0],n.full_name=n.owner+"/_git/"+n.name)):s.length===4&&(n.organization=s[0],n.owner=s[1],n.name=s[3],n.full_name=n.organization+"/"+n.owner+"/_git/"+n.name),n.query&&n.query.path&&(n.filepath=n.query.path.replace(/^\/+/g,"")),n.query&&n.query.version&&(n.ref=n.query.version.replace(/^GB/,""));break}default:s=n.name.split("/");var c=s.length-1;if(s.length>=2){var l=s.indexOf("-",2),u=s.indexOf("blob",2),d=s.indexOf("tree",2),f=s.indexOf("commit",2),h=s.indexOf("issues",2),m=s.indexOf("src",2),g=s.indexOf("raw",2),A=s.indexOf("edit",2);c=l>0?l-1:u>0&&d>0?Math.min(u-1,d-1):u>0?u-1:h>0?h-1:d>0?d-1:f>0?f-1:m>0?m-1:g>0?g-1:A>0?A-1:c,n.owner=s.slice(0,c).join("/"),n.name=s[c],f&&h<0&&(n.commit=s[c+2])}n.ref="",n.filepathtype="",n.filepath="";var y=s.length>c&&s[c+1]==="-"?c+1:c;s.length>y+2&&["raw","src","blob","tree","edit"].indexOf(s[y+1])>=0&&(n.filepathtype=s[y+1],n.ref=s[y+2],s.length>y+3&&(n.filepath=s.slice(y+3).join("/"))),n.organization=n.owner;break}n.full_name||(n.full_name=n.owner,n.name&&(n.full_name&&(n.full_name+="/"),n.full_name+=n.name)),n.owner.startsWith("scm/")&&(n.source="bitbucket-server",n.owner=n.owner.replace("scm/",""),n.organization=n.owner,n.full_name=n.owner+"/"+n.name);var _=/(projects|users)\/(.*?)\/repos\/(.*?)((\/.*$)|$)/,E=_.exec(n.pathname);return E!=null&&(n.source="bitbucket-server",E[1]==="users"?n.owner="~"+E[2]:n.owner=E[2],n.organization=n.owner,n.name=E[3],s=E[4].split("/"),s.length>1&&(["raw","browse"].indexOf(s[1])>=0?(n.filepathtype=s[1],s.length>2&&(n.filepath=s.slice(2).join("/"))):s[1]==="commits"&&s.length>2&&(n.commit=s[2])),n.full_name=n.owner+"/"+n.name,n.query.at?n.ref=n.query.at:n.ref=""),e.length!==0&&n.ref&&(n.ref=z9o(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(XUt,"gitUrlParse");XUt.stringify=function(t,e){e=e||(t.protocols&&t.protocols.length?t.protocols.join("+"):t.protocol);var r=t.port?":"+t.port:"",n=t.user||"git",o=t.git_suffix?".git":"";switch(e){case"ssh":return r?"ssh://"+n+"@"+t.resource+r+"/"+t.full_name+o:n+"@"+t.resource+":"+t.full_name+o;case"git+ssh":case"ssh+git":case"ftp":case"ftps":return e+"://"+n+"@"+t.resource+r+"/"+t.full_name+o;case"http":case"https":var s=t.token?V9o(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+W9o(t)+o;default:return t.href}};function V9o(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(V9o,"buildToken");function W9o(t){if(t.source==="bitbucket-server")return"scm/"+t.full_name;var e=t.full_name.split("/").map(function(r){return encodeURIComponent(r)}).join("/");return e}a(W9o,"buildPath");function z9o(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a(z9o,"findLongestMatchingSubstring");Ign.exports=XUt});var tue=I((exports,module)=>{p();var Module=typeof Module<"u"?Module:{},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",TreeSitter=(function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{static{a(this,"Parser")}constructor(){this.initialize()}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=a((t,e)=>{throw e},"quit_"),scriptDirectory="";function locateFile(t){return Module.locateFile?Module.locateFile(t,scriptDirectory):scriptDirectory+t}a(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");scriptDirectory=__dirname+"/",readBinary=a(t=>{t=isFileURI(t)?new URL(t):nodePath.normalize(t);var e=fs.readFileSync(t);return e},"readBinary"),readAsync=a((t,e=!0)=>(t=isFileURI(t)?new URL(t):nodePath.normalize(t),new Promise((r,n)=>{fs.readFile(t,e?void 0:"utf8",(o,s)=>{o?n(o):r(e?s.buffer:s)})})),"readAsync"),!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=a((t,e)=>{throw process.exitCode=t,e},"quit_")}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),ENVIRONMENT_IS_WORKER&&(readBinary=a(t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)},"readBinary")),readAsync=a(t=>isFileURI(t)?new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{(n.status==200||n.status==0&&n.response)&&r(n.response),e(n.status)},n.onerror=e,n.send(null)}):fetch(t,{credentials:"same-origin"}).then(e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url))),"readAsync"));var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var wasmMemory,ABORT=!1,EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP_DATA_VIEW;function updateMemoryViews(){var t=wasmMemory.buffer;Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(t),Module.HEAP8=HEAP8=new Int8Array(t),Module.HEAP16=HEAP16=new Int16Array(t),Module.HEAPU8=HEAPU8=new Uint8Array(t),Module.HEAPU16=HEAPU16=new Uint16Array(t),Module.HEAP32=HEAP32=new Int32Array(t),Module.HEAPU32=HEAPU32=new Uint32Array(t),Module.HEAPF32=HEAPF32=new Float32Array(t),Module.HEAPF64=HEAPF64=new Float64Array(t)}if(a(updateMemoryViews,"updateMemoryViews"),Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:2147483648/65536})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}a(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__)}a(initRuntime,"initRuntime");function preMain(){callRuntimeCallbacks(__ATMAIN__)}a(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}a(postRun,"postRun");function addOnPreRun(t){__ATPRERUN__.unshift(t)}a(addOnPreRun,"addOnPreRun");function addOnInit(t){__ATINIT__.unshift(t)}a(addOnInit,"addOnInit");function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}a(addOnPostRun,"addOnPostRun");var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(t){return t}a(getUniqueRunDependency,"getUniqueRunDependency");function addRunDependency(t){runDependencies++,Module.monitorRunDependencies?.(runDependencies)}a(addRunDependency,"addRunDependency");function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e()}}a(removeRunDependency,"removeRunDependency");function abort(t){Module.onAbort?.(t),t="Aborted("+t+")",err(t),ABORT=!0,EXITSTATUS=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw e}a(abort,"abort");var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=a(t=>t.startsWith(dataURIPrefix),"isDataURI"),isFileURI=a(t=>t.startsWith("file://"),"isFileURI");function findWasmBinary(){var t="tree-sitter.wasm";return isDataURI(t)?t:locateFile(t)}a(findWasmBinary,"findWasmBinary");var wasmBinaryFile;function getBinarySync(t){if(t==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(t);throw"both async and sync fetching of the wasm failed"}a(getBinarySync,"getBinarySync");function getBinaryPromise(t){return wasmBinary?Promise.resolve().then(()=>getBinarySync(t)):readAsync(t).then(e=>new Uint8Array(e),()=>getBinarySync(t))}a(getBinaryPromise,"getBinaryPromise");function instantiateArrayBuffer(t,e,r){return getBinaryPromise(t).then(n=>WebAssembly.instantiate(n,e)).then(r,n=>{err(`failed to asynchronously prepare wasm: ${n}`),abort(n)})}a(instantiateArrayBuffer,"instantiateArrayBuffer");function instantiateAsync(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(e)&&!isFileURI(e)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(o=>{var s=WebAssembly.instantiateStreaming(o,r);return s.then(n,function(c){return err(`wasm streaming compile failed: ${c}`),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(e,r,n)})}):instantiateArrayBuffer(e,r,n)}a(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}a(getWasmImports,"getWasmImports");function createWasm(){var t=getWasmImports();function e(n,o){wasmExports=n.exports,wasmExports=relocateExports(wasmExports,1024);var s=getDylinkMetadata(o);return s.neededDynlibs&&(dynamicLibraries=s.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}a(e,"receiveInstance"),addRunDependency("wasm-instantiate");function r(n){e(n.instance,n.module)}if(a(r,"receiveInstantiationResult"),Module.instantiateWasm)try{return Module.instantiateWasm(t,e)}catch(n){return err(`Module.instantiateWasm callback failed with error: ${n}`),!1}return wasmBinaryFile||(wasmBinaryFile=findWasmBinary()),instantiateAsync(wasmBinary,wasmBinaryFile,t,r),{}}a(createWasm,"createWasm");var ASM_CONSTS={};function ExitStatus(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}a(ExitStatus,"ExitStatus");var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(t,e){var r=GOT[e];return r||(r=GOT[e]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(e)||(r.required=!0),r}},LE_HEAP_LOAD_F32=a(t=>HEAP_DATA_VIEW.getFloat32(t,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=a(t=>HEAP_DATA_VIEW.getFloat64(t,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=a(t=>HEAP_DATA_VIEW.getInt16(t,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=a(t=>HEAP_DATA_VIEW.getInt32(t,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_U32=a(t=>HEAP_DATA_VIEW.getUint32(t,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=a((t,e)=>HEAP_DATA_VIEW.setFloat32(t,e,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=a((t,e)=>HEAP_DATA_VIEW.setFloat64(t,e,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=a((t,e)=>HEAP_DATA_VIEW.setInt16(t,e,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=a((t,e)=>HEAP_DATA_VIEW.setInt32(t,e,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_U32=a((t,e)=>HEAP_DATA_VIEW.setUint32(t,e,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=a(t=>{for(;t.length>0;)t.shift()(Module)},"callRuntimeCallbacks"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=a((t,e,r)=>{for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,o));for(var s="";e>10,56320|d&1023)}}return s},"UTF8ArrayToString"),getDylinkMetadata=a(t=>{var e=0,r=0;function n(){return t[e++]}a(n,"getU8");function o(){for(var q=0,M=1;;){var L=t[e++];if(q+=(L&127)*M,M*=128,!(L&128))break}return q}a(o,"getLEB");function s(){var q=o();return e+=q,UTF8ArrayToString(t,e-q,q)}a(s,"getString");function c(q,M){if(q)throw new Error(M)}a(c,"failIf");var l="dylink.0";if(t instanceof WebAssembly.Module){var u=WebAssembly.Module.customSections(t,l);u.length===0&&(l="dylink",u=WebAssembly.Module.customSections(t,l)),c(u.length===0,"need dylink section"),t=new Uint8Array(u[0]),r=t.length}else{var d=new Uint32Array(new Uint8Array(t.subarray(0,24)).buffer),f=d[0]==1836278016||d[0]==6386541;c(!f,"need to see wasm magic number"),c(t[8]!==0,"need the dylink section to be first"),e=9;var h=o();r=e+h,l=s()}var m={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(l=="dylink"){m.memorySize=o(),m.memoryAlign=o(),m.tableSize=o(),m.tableAlign=o();for(var g=o(),A=0;A>1)*2);case"i32":return LE_HEAP_LOAD_I32((t>>2)*4);case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return LE_HEAP_LOAD_F32((t>>2)*4);case"double":return LE_HEAP_LOAD_F64((t>>3)*8);case"*":return LE_HEAP_LOAD_U32((t>>2)*4);default:abort(`invalid type for getValue: ${e}`)}}a(getValue,"getValue");var newDSO=a((t,e,r)=>{var n={refcount:1/0,name:t,exports:r,global:!0};return LDSO.loadedLibsByName[t]=n,e!=null&&(LDSO.loadedLibsByHandle[e]=n),n},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78112,zeroMemory=a((t,e)=>(HEAPU8.fill(0,t,t+e),t),"zeroMemory"),alignMemory=a((t,e)=>Math.ceil(t/e)*e,"alignMemory"),getMemory=a(t=>{if(runtimeInitialized)return zeroMemory(_malloc(t),t);var e=___heap_base,r=e+alignMemory(t,16);return ___heap_base=r,GOT.__heap_base.value=r,e},"getMemory"),isInternalSym=a(t=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(t)||t.startsWith("__em_js__"),"isInternalSym"),uleb128Encode=a((t,e)=>{t<128?e.push(t):e.push(t%128|128,t>>7)},"uleb128Encode"),sigToWasmTypes=a(t=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:t[0]=="v"?[]:[e[t[0]]]},n=1;n{var r=t.slice(0,1),n=t.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};e.push(96),uleb128Encode(n.length,e);for(var s=0;s{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(e),t);var r=[1];generateFuncType(e,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push(...r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(n)),s=new WebAssembly.Instance(o,{e:{f:t}}),c=s.exports.f;return c},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:28,element:"anyfunc"}),getWasmTableEntry=a(t=>{var e=wasmTableMirror[t];return e||(t>=wasmTableMirror.length&&(wasmTableMirror.length=t+1),wasmTableMirror[t]=e=wasmTable.get(t)),e},"getWasmTableEntry"),updateTableMap=a((t,e)=>{if(functionsInTableMap)for(var r=t;r(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(t)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=a(()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(t){throw t instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":t}return wasmTable.length-1},"getEmptyTableSlot"),setWasmTableEntry=a((t,e)=>{wasmTable.set(t,e),wasmTableMirror[t]=wasmTable.get(t)},"setWasmTableEntry"),addFunction=a((t,e)=>{var r=getFunctionAddress(t);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,t)}catch(s){if(!(s instanceof TypeError))throw s;var o=convertJsFunctionToWasm(t,e);setWasmTableEntry(n,o)}return functionsInTableMap.set(t,n),n},"addFunction"),updateGOT=a((t,e)=>{for(var r in t)if(!isInternalSym(r)){var n=t[r];r.startsWith("orig$")&&(r=r.split("$")[1],e=!0),GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(e||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},"updateGOT"),relocateExports=a((t,e,r)=>{var n={};for(var o in t){var s=t[o];typeof s=="object"&&(s=s.value),typeof s=="number"&&(s+=e),n[o]=s}return updateGOT(n,r),n},"relocateExports"),isSymbolDefined=a(t=>{var e=wasmImports[t];return!(!e||e.stub)},"isSymbolDefined"),dynCallLegacy=a((t,e,r)=>{t=t.replace(/p/g,"i");var n=Module["dynCall_"+t];return n(e,...r)},"dynCallLegacy"),dynCall=a((t,e,r=[])=>{if(t.includes("j"))return dynCallLegacy(t,e,r);var n=getWasmTableEntry(e)(...r);return n},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(t=>__emscripten_stack_restore(t),"stackRestore"),createInvokeFunction=a(t=>(e,...r)=>{var n=stackSave();try{return dynCall(t,e,r)}catch(o){if(stackRestore(n),o!==o+0)throw o;_setThrew(1,0)}},"createInvokeFunction"),resolveGlobalSymbol=a((t,e=!1)=>{var r;return e&&"orig$"+t in wasmImports&&(t="orig$"+t),isSymbolDefined(t)?r=wasmImports[t]:t.startsWith("invoke_")&&(r=wasmImports[t]=createInvokeFunction(t.split("_")[1])),{sym:r,name:t}},"resolveGlobalSymbol"),UTF8ToString=a((t,e)=>t?UTF8ArrayToString(HEAPU8,t,e):"","UTF8ToString"),loadWebAssemblyModule=a((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize))}else memoryBase=LE_HEAP_LOAD_U32((handle+12>>2)*4),tableBase=LE_HEAP_LOAD_U32((handle+20>>2)*4);var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(t){var e=resolveGlobalSymbol(t).sym;return!e&&localScope&&(e=localScope[t]),e||(e=moduleExports[t]),e}a(resolveSymbol,"resolveSymbol");var proxyHandler={get(t,e){switch(e){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(e in wasmImports&&!wasmImports[e].stub)return wasmImports[e];if(!(e in t)){var r;t[e]=(...n)=>(r||=resolveSymbol(e),r(...n))}return t[e]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(a(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start ${body};`;moduleExports[name]=eval(func)}a(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(a(postInstantiation,"postInstantiation"),flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(t=>postInstantiation(t.module,t.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return a(loadModule,"loadModule"),flags.loadAsync?metadata.neededDynlibs.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(t=>loadDynamicLibrary(t,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=a((t,e)=>{for(var[r,n]of Object.entries(t)){let o=a(c=>{isSymbolDefined(c)||(wasmImports[c]=n)},"setImport");o(r);let s="__main_argc_argv";r=="main"&&o(s),r==s&&o("main"),r.startsWith("dynCall_")&&!Module.hasOwnProperty(r)&&(Module[r]=n)}},"mergeLibSymbols"),asyncLoad=a((t,e,r,n)=>{var o=n?"":`al ${t}`;readAsync(t).then(s=>{e(new Uint8Array(s)),o&&removeRunDependency(o)},s=>{if(r)r();else throw`Loading data file "${t}" failed.`}),o&&addRunDependency(o)},"asyncLoad");function loadDynamicLibrary(t,e={global:!0,nodelete:!0},r,n){var o=LDSO.loadedLibsByName[t];if(o)return e.global?o.global||(o.global=!0,mergeLibSymbols(o.exports,t)):r&&Object.assign(r,o.exports),e.nodelete&&o.refcount!==1/0&&(o.refcount=1/0),o.refcount++,n&&(LDSO.loadedLibsByHandle[n]=o),e.loadAsync?Promise.resolve(!0):!0;o=newDSO(t,n,"loading"),o.refcount=e.nodelete?1/0:1,o.global=e.global;function s(){if(n){var u=LE_HEAP_LOAD_U32((n+28>>2)*4),d=LE_HEAP_LOAD_U32((n+32>>2)*4);if(u&&d){var f=HEAP8.slice(u,u+d);return e.loadAsync?Promise.resolve(f):f}}var h=locateFile(t);if(e.loadAsync)return new Promise(function(m,g){asyncLoad(h,m,g)});if(!readBinary)throw new Error(`${h}: file not found, and synchronous loading of external files is not available`);return readBinary(h)}a(s,"loadLibData");function c(){return e.loadAsync?s().then(u=>loadWebAssemblyModule(u,e,t,r,n)):loadWebAssemblyModule(s(),e,t,r,n)}a(c,"getExports");function l(u){o.global?mergeLibSymbols(u,t):r&&Object.assign(r,u),o.exports=u}return a(l,"moduleLoaded"),e.loadAsync?c().then(u=>(l(u),!0)):(l(c()),!0)}a(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=a(()=>{for(var[t,e]of Object.entries(GOT))if(e.value==0){var r=resolveGlobalSymbol(t,!0).sym;if(!r&&!e.required)continue;if(typeof r=="function")e.value=addFunction(r,r.sig);else if(typeof r=="number")e.value=r;else throw new Error(`bad export type for '${t}': ${typeof r}`)}},"reportUndefinedSymbols"),loadDylibs=a(()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},"loadDylibs"),noExitRuntime=Module.noExitRuntime||!0;function setValue(t,e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":HEAP8[t]=e;break;case"i8":HEAP8[t]=e;break;case"i16":LE_HEAP_STORE_I16((t>>1)*2,e);break;case"i32":LE_HEAP_STORE_I32((t>>2)*4,e);break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":LE_HEAP_STORE_F32((t>>2)*4,e);break;case"double":LE_HEAP_STORE_F64((t>>3)*8,e);break;case"*":LE_HEAP_STORE_U32((t>>2)*4,e);break;default:abort(`invalid type for setValue: ${r}`)}}a(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78112),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=a(()=>{abort("")},"__abort_js");__abort_js.sig="v";var nowIsMonotonic=1,__emscripten_get_now_is_monotonic=a(()=>nowIsMonotonic,"__emscripten_get_now_is_monotonic");__emscripten_get_now_is_monotonic.sig="i";var __emscripten_memcpy_js=a((t,e,r)=>HEAPU8.copyWithin(t,e,e+r),"__emscripten_memcpy_js");__emscripten_memcpy_js.sig="vppp";var _emscripten_date_now=a(()=>Date.now(),"_emscripten_date_now");_emscripten_date_now.sig="d";var _emscripten_get_now;_emscripten_get_now=a(()=>performance.now(),"_emscripten_get_now"),_emscripten_get_now.sig="d";var getHeapMax=a(()=>2147483648,"getHeapMax"),growMemory=a(t=>{var e=wasmMemory.buffer,r=(t-e.byteLength+65535)/65536;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=a(t=>{var e=HEAPU8.length;t>>>=0;var r=getHeapMax();if(t>r)return!1;for(var n=a((u,d)=>u+(d-u%d)%d,"alignUp"),o=1;o<=4;o*=2){var s=e*(1+.2/o);s=Math.min(s,t+100663296);var c=Math.min(r,n(Math.max(t,s),65536)),l=growMemory(c);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=a(t=>52,"_fd_close");_fd_close.sig="ii";var convertI32PairToI53Checked=a((t,e)=>e+2097152>>>0<4194305-!!t?(t>>>0)+e*4294967296:NaN,"convertI32PairToI53Checked");function _fd_seek(t,e,r,n,o){var s=convertI32PairToI53Checked(e,r);return 70}a(_fd_seek,"_fd_seek"),_fd_seek.sig="iiiiip";var printCharBuffers=[null,[],[]],printChar=a((t,e)=>{var r=printCharBuffers[t];e===0||e===10?((t===1?out:err)(UTF8ArrayToString(r,0)),r.length=0):r.push(e)},"printChar"),_fd_write=a((t,e,r,n)=>{for(var o=0,s=0;s>2)*4),l=LE_HEAP_LOAD_U32((e+4>>2)*4);e+=8;for(var u=0;u>2)*4,o),0},"_fd_write");_fd_write.sig="iippp";function _tree_sitter_log_callback(t,e){if(currentLogCallback){let r=UTF8ToString(e);currentLogCallback(r,t!==0)}}a(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(t,e,r,n,o){let c=currentParseCallback(e,{row:r,column:n});typeof c=="string"?(setValue(o,c.length,"i32"),stringToUTF16(c,t,10240)):setValue(o,0,"i32")}a(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");var runtimeKeepaliveCounter=0,keepRuntimeAlive=a(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=a(t=>{EXITSTATUS=t,keepRuntimeAlive()||(Module.onExit?.(t),ABORT=!0),quit_(t,new ExitStatus(t))},"_proc_exit");_proc_exit.sig="vi";var exitJS=a((t,e)=>{EXITSTATUS=t,_proc_exit(t)},"exitJS"),handleException=a(t=>{if(t instanceof ExitStatus||t=="unwind")return EXITSTATUS;quit_(1,t)},"handleException"),lengthBytesUTF8=a(t=>{for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3}return e},"lengthBytesUTF8"),stringToUTF8Array=a((t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,s=r+n-1,c=0;c=55296&&l<=57343){var u=t.charCodeAt(++c);l=65536+((l&1023)<<10)|u&1023}if(l<=127){if(r>=s)break;e[r++]=l}else if(l<=2047){if(r+1>=s)break;e[r++]=192|l>>6,e[r++]=128|l&63}else if(l<=65535){if(r+2>=s)break;e[r++]=224|l>>12,e[r++]=128|l>>6&63,e[r++]=128|l&63}else{if(r+3>=s)break;e[r++]=240|l>>18,e[r++]=128|l>>12&63,e[r++]=128|l>>6&63,e[r++]=128|l&63}}return e[r]=0,r-o},"stringToUTF8Array"),stringToUTF8=a((t,e,r)=>stringToUTF8Array(t,HEAPU8,e,r),"stringToUTF8"),stackAlloc=a(t=>__emscripten_stack_alloc(t),"stackAlloc"),stringToUTF8OnStack=a(t=>{var e=lengthBytesUTF8(t)+1,r=stackAlloc(e);return stringToUTF8(t,r,e),r},"stringToUTF8OnStack"),stringToUTF16=a((t,e,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var n=e,o=r>1)*2,c),e+=2}return LE_HEAP_STORE_I16((e>>1)*2,0),e-n},"stringToUTF16"),AsciiToString=a(t=>{for(var e="";;){var r=HEAPU8[t++];if(!r)return e;e+=String.fromCharCode(r)}},"AsciiToString"),wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_memcpy_js:__emscripten_memcpy_js,emscripten_get_now:_emscripten_get_now,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback},wasmExports=createWasm(),___wasm_call_ctors=a(()=>(___wasm_call_ctors=wasmExports.__wasm_call_ctors)(),"___wasm_call_ctors"),___wasm_apply_data_relocs=a(()=>(___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs)(),"___wasm_apply_data_relocs"),_malloc=Module._malloc=t=>(_malloc=Module._malloc=wasmExports.malloc)(t),_calloc=Module._calloc=(t,e)=>(_calloc=Module._calloc=wasmExports.calloc)(t,e),_realloc=Module._realloc=(t,e)=>(_realloc=Module._realloc=wasmExports.realloc)(t,e),_free=Module._free=t=>(_free=Module._free=wasmExports.free)(t),_ts_language_symbol_count=Module._ts_language_symbol_count=t=>(_ts_language_symbol_count=Module._ts_language_symbol_count=wasmExports.ts_language_symbol_count)(t),_ts_language_state_count=Module._ts_language_state_count=t=>(_ts_language_state_count=Module._ts_language_state_count=wasmExports.ts_language_state_count)(t),_ts_language_version=Module._ts_language_version=t=>(_ts_language_version=Module._ts_language_version=wasmExports.ts_language_version)(t),_ts_language_field_count=Module._ts_language_field_count=t=>(_ts_language_field_count=Module._ts_language_field_count=wasmExports.ts_language_field_count)(t),_ts_language_next_state=Module._ts_language_next_state=(t,e,r)=>(_ts_language_next_state=Module._ts_language_next_state=wasmExports.ts_language_next_state)(t,e,r),_ts_language_symbol_name=Module._ts_language_symbol_name=(t,e)=>(_ts_language_symbol_name=Module._ts_language_symbol_name=wasmExports.ts_language_symbol_name)(t,e),_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=(t,e,r,n)=>(_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name)(t,e,r,n),_strncmp=Module._strncmp=(t,e,r)=>(_strncmp=Module._strncmp=wasmExports.strncmp)(t,e,r),_ts_language_symbol_type=Module._ts_language_symbol_type=(t,e)=>(_ts_language_symbol_type=Module._ts_language_symbol_type=wasmExports.ts_language_symbol_type)(t,e),_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=(t,e)=>(_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id)(t,e),_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=(t,e)=>(_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new)(t,e),_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=t=>(_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete)(t),_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=(t,e)=>(_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state)(t,e),_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=(t,e,r)=>(_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset)(t,e,r),_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=t=>(_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next)(t),_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=t=>(_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol)(t),_memset=Module._memset=(t,e,r)=>(_memset=Module._memset=wasmExports.memset)(t,e,r),_memcpy=Module._memcpy=(t,e,r)=>(_memcpy=Module._memcpy=wasmExports.memcpy)(t,e,r),_ts_parser_delete=Module._ts_parser_delete=t=>(_ts_parser_delete=Module._ts_parser_delete=wasmExports.ts_parser_delete)(t),_ts_parser_reset=Module._ts_parser_reset=t=>(_ts_parser_reset=Module._ts_parser_reset=wasmExports.ts_parser_reset)(t),_ts_parser_set_language=Module._ts_parser_set_language=(t,e)=>(_ts_parser_set_language=Module._ts_parser_set_language=wasmExports.ts_parser_set_language)(t,e),_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=t=>(_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros)(t),_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=(t,e,r)=>(_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros)(t,e,r),_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=(t,e,r)=>(_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges)(t,e,r),_memmove=Module._memmove=(t,e,r)=>(_memmove=Module._memmove=wasmExports.memmove)(t,e,r),_memcmp=Module._memcmp=(t,e,r)=>(_memcmp=Module._memcmp=wasmExports.memcmp)(t,e,r),_ts_query_new=Module._ts_query_new=(t,e,r,n,o)=>(_ts_query_new=Module._ts_query_new=wasmExports.ts_query_new)(t,e,r,n,o),_ts_query_delete=Module._ts_query_delete=t=>(_ts_query_delete=Module._ts_query_delete=wasmExports.ts_query_delete)(t),_iswspace=Module._iswspace=t=>(_iswspace=Module._iswspace=wasmExports.iswspace)(t),_iswalnum=Module._iswalnum=t=>(_iswalnum=Module._iswalnum=wasmExports.iswalnum)(t),_ts_query_pattern_count=Module._ts_query_pattern_count=t=>(_ts_query_pattern_count=Module._ts_query_pattern_count=wasmExports.ts_query_pattern_count)(t),_ts_query_capture_count=Module._ts_query_capture_count=t=>(_ts_query_capture_count=Module._ts_query_capture_count=wasmExports.ts_query_capture_count)(t),_ts_query_string_count=Module._ts_query_string_count=t=>(_ts_query_string_count=Module._ts_query_string_count=wasmExports.ts_query_string_count)(t),_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=(t,e,r)=>(_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id)(t,e,r),_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=(t,e,r)=>(_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id)(t,e,r),_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=(t,e,r)=>(_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern)(t,e,r),_ts_query_disable_capture=Module._ts_query_disable_capture=(t,e,r)=>(_ts_query_disable_capture=Module._ts_query_disable_capture=wasmExports.ts_query_disable_capture)(t,e,r),_ts_tree_copy=Module._ts_tree_copy=t=>(_ts_tree_copy=Module._ts_tree_copy=wasmExports.ts_tree_copy)(t),_ts_tree_delete=Module._ts_tree_delete=t=>(_ts_tree_delete=Module._ts_tree_delete=wasmExports.ts_tree_delete)(t),_ts_init=Module._ts_init=()=>(_ts_init=Module._ts_init=wasmExports.ts_init)(),_ts_parser_new_wasm=Module._ts_parser_new_wasm=()=>(_ts_parser_new_wasm=Module._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm)(),_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=(t,e)=>(_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm)(t,e),_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=(t,e,r,n,o)=>(_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm)(t,e,r,n,o),_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=t=>(_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm)(t),_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=(t,e)=>(_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm)(t,e),_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=(t,e)=>(_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm)(t,e),_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=t=>(_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm)(t),_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=t=>(_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm)(t),_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=t=>(_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm)(t),_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=t=>(_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm)(t),_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=(t,e)=>(_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm)(t,e),_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=t=>(_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm)(t),_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=t=>(_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm)(t),_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=t=>(_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm)(t),_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=(t,e)=>(_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm)(t,e),_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=t=>(_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm)(t),_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=t=>(_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm)(t),_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=t=>(_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(t),_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=t=>(_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(t),_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=t=>(_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(t),_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=t=>(_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(t),_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=(t,e)=>(_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm)(t,e),_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=t=>(_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm)(t),_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=t=>(_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm)(t),_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=t=>(_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm)(t),_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=t=>(_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm)(t),_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=t=>(_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(t),_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=t=>(_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm)(t),_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=t=>(_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm)(t),_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=t=>(_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm)(t),_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=t=>(_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm)(t),_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=t=>(_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm)(t),_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=t=>(_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm)(t),_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=t=>(_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm)(t),_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=t=>(_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm)(t),_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=t=>(_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm)(t),_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=t=>(_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm)(t),_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=(t,e)=>(_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm)(t,e),_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=(t,e)=>(_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm)(t,e),_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=t=>(_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm)(t),_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=t=>(_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm)(t),_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=t=>(_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm)(t),_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=t=>(_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm)(t),_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=t=>(_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm)(t),_ts_node_child_wasm=Module._ts_node_child_wasm=(t,e)=>(_ts_node_child_wasm=Module._ts_node_child_wasm=wasmExports.ts_node_child_wasm)(t,e),_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=(t,e)=>(_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm)(t,e),_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=(t,e)=>(_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm)(t,e),_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=t=>(_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm)(t),_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=t=>(_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm)(t),_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=t=>(_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm)(t),_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=t=>(_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm)(t),_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=t=>(_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm)(t),_ts_node_parent_wasm=Module._ts_node_parent_wasm=t=>(_ts_node_parent_wasm=Module._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm)(t),_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=t=>(_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm)(t),_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=t=>(_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm)(t),_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=t=>(_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm)(t),_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=t=>(_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm)(t),_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=t=>(_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm)(t),_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=t=>(_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm)(t),_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=t=>(_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm)(t),_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=t=>(_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm)(t),_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=t=>(_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm)(t),_ts_node_children_wasm=Module._ts_node_children_wasm=t=>(_ts_node_children_wasm=Module._ts_node_children_wasm=wasmExports.ts_node_children_wasm)(t),_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=t=>(_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm)(t),_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=(t,e,r,n,o,s,c)=>(_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm)(t,e,r,n,o,s,c),_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=t=>(_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm)(t),_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=t=>(_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm)(t),_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=t=>(_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm)(t),_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=t=>(_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm)(t),_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=t=>(_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm)(t),_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=t=>(_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm)(t),_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=t=>(_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm)(t),_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=t=>(_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm)(t),_ts_query_matches_wasm=Module._ts_query_matches_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_matches_wasm=Module._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm)(t,e,r,n,o,s,c,l,u,d),_ts_query_captures_wasm=Module._ts_query_captures_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_captures_wasm=Module._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm)(t,e,r,n,o,s,c,l,u,d),_iswalpha=Module._iswalpha=t=>(_iswalpha=Module._iswalpha=wasmExports.iswalpha)(t),_iswblank=Module._iswblank=t=>(_iswblank=Module._iswblank=wasmExports.iswblank)(t),_iswdigit=Module._iswdigit=t=>(_iswdigit=Module._iswdigit=wasmExports.iswdigit)(t),_iswlower=Module._iswlower=t=>(_iswlower=Module._iswlower=wasmExports.iswlower)(t),_iswupper=Module._iswupper=t=>(_iswupper=Module._iswupper=wasmExports.iswupper)(t),_iswxdigit=Module._iswxdigit=t=>(_iswxdigit=Module._iswxdigit=wasmExports.iswxdigit)(t),_memchr=Module._memchr=(t,e,r)=>(_memchr=Module._memchr=wasmExports.memchr)(t,e,r),_strlen=Module._strlen=t=>(_strlen=Module._strlen=wasmExports.strlen)(t),_strcmp=Module._strcmp=(t,e)=>(_strcmp=Module._strcmp=wasmExports.strcmp)(t,e),_strncat=Module._strncat=(t,e,r)=>(_strncat=Module._strncat=wasmExports.strncat)(t,e,r),_strncpy=Module._strncpy=(t,e,r)=>(_strncpy=Module._strncpy=wasmExports.strncpy)(t,e,r),_towlower=Module._towlower=t=>(_towlower=Module._towlower=wasmExports.towlower)(t),_towupper=Module._towupper=t=>(_towupper=Module._towupper=wasmExports.towupper)(t),_setThrew=a((t,e)=>(_setThrew=wasmExports.setThrew)(t,e),"_setThrew"),__emscripten_stack_restore=a(t=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(t),"__emscripten_stack_restore"),__emscripten_stack_alloc=a(t=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(t),"__emscripten_stack_alloc"),_emscripten_stack_get_current=a(()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),"_emscripten_stack_get_current"),dynCall_jiji=Module.dynCall_jiji=(t,e,r,n,o)=>(dynCall_jiji=Module.dynCall_jiji=wasmExports.dynCall_jiji)(t,e,r,n,o),_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=t=>(_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=wasmExports.orig$ts_parser_timeout_micros)(t),_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=(t,e)=>(_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=wasmExports.orig$ts_parser_set_timeout_micros)(t,e);Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16;var calledRun;dependenciesFulfilled=a(function t(){calledRun||run(),calledRun||(dependenciesFulfilled=t)},"runCaller");function callMain(t=[]){var e=resolveGlobalSymbol("main").sym;if(e){t.unshift(thisProgram);var r=t.length,n=stackAlloc((r+1)*4),o=n;t.forEach(c=>{LE_HEAP_STORE_U32((o>>2)*4,stringToUTF8OnStack(c)),o+=4}),LE_HEAP_STORE_U32((o>>2)*4,0);try{var s=e(r,n);return exitJS(s,!0),s}catch(c){return handleException(c)}}}a(callMain,"callMain");function run(t=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function e(){calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),Module.onRuntimeInitialized?.(),shouldRunNow&&callMain(t),postRun()))}a(e,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),e()},1)):e()}if(a(run,"run"),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_CURSOR=4*SIZE_OF_INT,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/,VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static{a(this,"ParserImpl")}static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let r;if(!e)r=0,e=null;else if(e.constructor===Language){r=e[0];let n=C._ts_language_version(r);if(ne.slice(u),"currentParseCallback");else if(typeof e=="function")currentParseCallback=e;else throw new Error("Argument must be a string or a function");this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let o=0,s=0;if(n?.includedRanges){o=n.includedRanges.length,s=C._calloc(o,SIZE_OF_RANGE);let u=s;for(let d=0;d0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let n=r;for(let o=0;o0){let n=r;for(let o=0;o0){let f=u;for(let h=0;h0){if(v[0].type!=="string")throw new Error("Predicates must begin with a literal value");let x=v[0].value,k=!0,D=!0,N;switch(x){case"any-not-eq?":case"not-eq?":k=!1;case"any-eq?":case"eq?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 2, got ${v.length-1}`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}"`);if(D=!x.startsWith("any-"),v[2].type==="capture"){let M=v[1].name,L=v[2].name;A[y].push(U=>{let j=[],Q=[];for(let W of U)W.name===M&&j.push(W.node),W.name===L&&Q.push(W.node);let Y=a((W,V,z)=>z?W.text===V.text:W.text!==V.text,"compare");return D?j.every(W=>Q.some(V=>Y(W,V,k))):j.some(W=>Q.some(V=>Y(W,V,k)))})}else{N=v[1].name;let M=v[2].value,L=a(j=>j.text===M,"matches"),U=a(j=>j.text!==M,"doesNotMatch");A[y].push(j=>{let Q=[];for(let W of j)W.name===N&&Q.push(W.node);let Y=k?L:U;return D?Q.every(Y):Q.some(Y)})}break;case"any-not-match?":case"not-match?":k=!1;case"any-match?":case"match?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 2, got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}".`);if(v[2].type!=="string")throw new Error(`Second argument of \`#${x}\` predicate must be a string. Got @${v[2].value}.`);N=v[1].name;let O=new RegExp(v[2].value);D=!x.startsWith("any-"),A[y].push(M=>{let L=[];for(let j of M)j.name===N&&L.push(j.node.text);let U=a((j,Q)=>Q?O.test(j):!O.test(j),"test");return L.length===0?!k:D?L.every(j=>U(j,k)):L.some(j=>U(j,k))});break;case"set!":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(M=>M.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');f[y]||(f[y]={}),f[y][v[1].value]=v[2]?v[2].value:null;break;case"is?":case"is-not?":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(M=>M.type!=="string"))throw new Error(`Arguments to \`#${x}\` predicate must be a strings.".`);let B=x==="is?"?h:m;B[y]||(B[y]={}),B[y][v[1].value]=v[2]?v[2].value:null;break;case"not-any-of?":k=!1;case"any-of?":if(v.length<2)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected at least 1. Got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}".`);for(let M=2;MM.value);A[y].push(M=>{let L=[];for(let U of M)U.name===N&&L.push(U.node.text);return L.length===0?!k:L.every(U=>q.includes(U))===k});break;default:g[y].push({operator:x,operands:v.slice(1)})}v.length=0}}Object.freeze(f[y]),Object.freeze(h[y]),Object.freeze(m[y])}return C._free(n),new Query(INTERNAL,o,u,A,g,Object.freeze(f),Object.freeze(h),Object.freeze(m))}static load(e){let r;if(e instanceof Uint8Array)r=Promise.resolve(e);else{let n=e;if(typeof process<"u"&&process.versions&&process.versions.node){let o=require("fs");r=Promise.resolve(o.readFileSync(n))}else r=fetch(n).then(o=>o.arrayBuffer().then(s=>{if(o.ok)return new Uint8Array(s);{let c=new TextDecoder("utf-8").decode(s);throw new Error(`Language.load failed with status ${o.status}. ${c}`)}}))}return r.then(n=>loadWebAssemblyModule(n,{loadAsync:!0})).then(n=>{let o=Object.keys(n),s=o.find(l=>LANGUAGE_FUNCTION_REGEX.test(l)&&!l.includes("external_scanner_"));s||console.log(`Couldn't find language function in WASM file. Symbols: -${JSON.stringify(o,null,2)}`);let c=n[s]();return new Language(INTERNAL,c)})}}class LookaheadIterable{static{a(this,"LookaheadIterable")}constructor(e,r,n){assertInternal(e),this[0]=r,this.language=n}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(e){return C._ts_lookahead_iterator_reset_state(this[0],e)}reset(e,r){return C._ts_lookahead_iterator_reset(this[0],e[0],r)?(this.language=e,!0):!1}[Symbol.iterator](){let e=this;return{next(){return C._ts_lookahead_iterator_next(e[0])?{done:!1,value:e.currentType}:{done:!0,value:""}}}}}class Query{static{a(this,"Query")}constructor(e,r,n,o,s,c,l,u){assertInternal(e),this[0]=r,this.captureNames=n,this.textPredicates=o,this.predicates=s,this.setProperties=c,this.assertedProperties=l,this.refutedProperties=u,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_matches_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=new Array(u);this.exceededMatchLimit=!!f;let m=0,g=d;for(let A=0;Av(E))){h[m]={pattern:y,captures:E};let v=this.setProperties[y];v&&(h[m].setProperties=v);let S=this.assertedProperties[y];S&&(h[m].assertedProperties=S);let T=this.refutedProperties[y];T&&(h[m].refutedProperties=T),m++}}return h.length=m,C._free(d),h}captures(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_captures_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=[];this.exceededMatchLimit=!!f;let m=[],g=d;for(let A=0;Av(m))){let v=m[E],S=this.setProperties[y];S&&(v.setProperties=S);let T=this.assertedProperties[y];T&&(v.assertedProperties=T);let w=this.refutedProperties[y];w&&(v.refutedProperties=w),h.push(v)}}return C._free(d),h}predicatesForPattern(e){return this.predicates[e]}disableCapture(e){let r=lengthBytesUTF8(e),n=C._malloc(r+1);stringToUTF8(e,n,r+1),C._ts_query_disable_capture(this[0],n,r),C._free(n)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(t,e,r){let n=r-e,o=t.textCallback(e,null,r);for(e+=o.length;e0)e+=s.length,o+=s;else break}return e>r&&(o=o.slice(0,n)),o}a(getText,"getText");function unmarshalCaptures(t,e,r,n){for(let o=0,s=n.length;o>>0,column:getValue(t+SIZE_OF_INT,"i32")>>>0}}a(unmarshalPoint,"unmarshalPoint");function marshalRange(t,e){marshalPoint(t,e.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,e.endPosition),t+=SIZE_OF_POINT,setValue(t,e.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,e.endIndex,"i32"),t+=SIZE_OF_INT}a(marshalRange,"marshalRange");function unmarshalRange(t){let e={};return e.startPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.endPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.startIndex=getValue(t,"i32")>>>0,t+=SIZE_OF_INT,e.endIndex=getValue(t,"i32")>>>0,e}a(unmarshalRange,"unmarshalRange");function marshalEdit(t){let e=TRANSFER_BUFFER;marshalPoint(e,t.startPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.oldEndPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.newEndPosition),e+=SIZE_OF_POINT,setValue(e,t.startIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.oldEndIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.newEndIndex,"i32"),e+=SIZE_OF_INT}a(marshalEdit,"marshalEdit");for(let t of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,t,{value:ParserImpl.prototype[t],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}}))}}return Parser})();typeof exports=="object"&&(module.exports=TreeSitter)});var Hgn=I((OLu,jgn)=>{"use strict";p();var R7o=require("path"),k7o=R7o.join(__dirname,"compiled",process.platform,process.arch,"keytar.node");jgn.exports=require(k7o)});var nAn={};Ti(nAn,{TextDocument:()=>iF});function t7t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);t7t(n,e),t7t(o,e);let s=0,c=0,l=0;for(;sr.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function lqo(t){let e=rAn(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Yze,iF,r7t=Se(()=>{"use strict";p();Yze=class t{static{a(this,"FullTextDocument")}constructor(e,r,n,o){this._uri=e,this._languageId=r,this._version=n,this._content=o,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let o=rAn(n.range),s=this.offsetAt(o.start),c=this.offsetAt(o.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(c,this._content.length);let l=Math.max(o.start.line,0),u=Math.max(o.end.line,0),d=this._lineOffsets,f=eAn(n.text,!1,s);if(u-l===f.length)for(let m=0,g=f.length;me?o=c:n=c+1}let s=n-1;return e=this.ensureBeforeEOL(e,r[s]),{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let o=e.line+1r&&tAn(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}};(function(t){function e(o,s,c,l){return new Yze(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof Yze)return o.update(s,c),o;throw new Error("TextDocument.update: document must be created by TextDocument.create")}a(r,"update"),t.update=r;function n(o,s){let c=o.getText(),l=t7t(s.map(lqo),(f,h)=>{let m=f.range.start.line-h.range.start.line;return m===0?f.range.start.character-h.range.start.character:m}),u=0,d=[];for(let f of l){let h=o.offsetAt(f.range.start);if(hu&&d.push(c.substring(u,h)),f.newText.length&&d.push(f.newText),u=o.offsetAt(f.range.end)}return d.push(c.substr(u)),d.join("")}a(n,"applyEdits"),t.applyEdits=n})(iF||(iF={}));a(t7t,"mergeSort");a(eAn,"computeLineOffsets");a(tAn,"isEOL");a(rAn,"getWellformedRange");a(lqo,"getWellformedEdit")});var oYe=I(lm=>{"use strict";p();Object.defineProperty(lm,"__esModule",{value:!0});lm.thenable=lm.typedArray=lm.stringArray=lm.array=lm.func=lm.error=lm.number=lm.string=lm.boolean=void 0;function hqo(t){return t===!0||t===!1}a(hqo,"boolean");lm.boolean=hqo;function pyn(t){return typeof t=="string"||t instanceof String}a(pyn,"string");lm.string=pyn;function mqo(t){return typeof t=="number"||t instanceof Number}a(mqo,"number");lm.number=mqo;function gqo(t){return t instanceof Error}a(gqo,"error");lm.error=gqo;function hyn(t){return typeof t=="function"}a(hyn,"func");lm.func=hyn;function myn(t){return Array.isArray(t)}a(myn,"array");lm.array=myn;function Aqo(t){return myn(t)&&t.every(e=>pyn(e))}a(Aqo,"stringArray");lm.stringArray=Aqo;function yqo(t,e){return Array.isArray(t)&&t.every(e)}a(yqo,"typedArray");lm.typedArray=yqo;function _qo(t){return t&&hyn(t.then)}a(_qo,"thenable");lm.thenable=_qo});var E7t=I(dw=>{"use strict";p();Object.defineProperty(dw,"__esModule",{value:!0});dw.generateUuid=dw.parse=dw.isUUID=dw.v4=dw.empty=void 0;var ewe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},twe=class t extends ewe{static{a(this,"V4UUID")}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};twe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];twe._timeHighBits=["8","9","a","b"];dw.empty=new ewe("00000000-0000-0000-0000-000000000000");function gyn(){return new twe}a(gyn,"v4");dw.v4=gyn;var Eqo=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Ayn(t){return Eqo.test(t)}a(Ayn,"isUUID");dw.isUUID=Ayn;function vqo(t){if(!Ayn(t))throw new Error("invalid uuid");return new ewe(t)}a(vqo,"parse");dw.parse=vqo;function Cqo(){return gyn().asHex()}a(Cqo,"generateUuid");dw.generateUuid=Cqo});var yyn=I(mq=>{"use strict";p();Object.defineProperty(mq,"__esModule",{value:!0});mq.attachPartialResult=mq.ProgressFeature=mq.attachWorkDone=void 0;var hq=ii(),bqo=E7t(),HK=class t{static{a(this,"WorkDoneProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,o){let s={kind:"begin",title:e,percentage:r,message:n,cancellable:o};this._connection.sendProgress(hq.WorkDoneProgress.type,this._token,s)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(hq.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(hq.WorkDoneProgress.type,this._token,{kind:"end"})}};HK.Instances=new Map;var sYe=class extends HK{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new hq.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},rwe=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},aYe=class extends rwe{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new hq.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function Sqo(t,e){if(e===void 0||e.workDoneToken===void 0)return new rwe;let r=e.workDoneToken;return delete e.workDoneToken,new HK(t,r)}a(Sqo,"attachWorkDone");mq.attachWorkDone=Sqo;var Tqo=a(t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(hq.WorkDoneProgressCancelNotification.type,r=>{let n=HK.Instances.get(r.token);(n instanceof sYe||n instanceof aYe)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new rwe:new HK(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,bqo.generateUuid)();return this.connection.sendRequest(hq.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new sYe(this.connection,e))}else return Promise.resolve(new aYe)}},"ProgressFeature");mq.ProgressFeature=Tqo;var v7t;(function(t){t.type=new hq.ProgressType})(v7t||(v7t={}));var C7t=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(v7t.type,this._token,e)}};function Iqo(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new C7t(t,r)}a(Iqo,"attachPartialResult");mq.attachPartialResult=Iqo});var _yn=I(cYe=>{"use strict";p();Object.defineProperty(cYe,"__esModule",{value:!0});cYe.ConfigurationFeature=void 0;var xqo=ii(),wqo=oYe(),Rqo=a(t=>class extends t{getConfiguration(e){return e?wqo.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(xqo.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");cYe.ConfigurationFeature=Rqo});var Eyn=I(uYe=>{"use strict";p();Object.defineProperty(uYe,"__esModule",{value:!0});uYe.WorkspaceFoldersFeature=void 0;var lYe=ii(),kqo=a(t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new lYe.Emitter,this.connection.onNotification(lYe.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(lYe.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(lYe.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");uYe.WorkspaceFoldersFeature=kqo});var vyn=I(dYe=>{"use strict";p();Object.defineProperty(dYe,"__esModule",{value:!0});dYe.CallHierarchyFeature=void 0;var b7t=ii(),Pqo=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(b7t.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=b7t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onIncomingCalls"),onOutgoingCalls:a(e=>{let r=b7t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");dYe.CallHierarchyFeature=Pqo});var T7t=I(gq=>{"use strict";p();Object.defineProperty(gq,"__esModule",{value:!0});gq.SemanticTokensBuilder=gq.SemanticTokensDiff=gq.SemanticTokensFeature=void 0;var fYe=ii(),Dqo=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(fYe.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=fYe.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on"),onDelta:a(e=>{let r=fYe.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onDelta"),onRange:a(e=>{let r=fYe.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");gq.SemanticTokensFeature=Dqo;var pYe=class{static{a(this,"SemanticTokensDiff")}constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n=n&&s>=n&&this.originalSequence[o]===this.modifiedSequence[s];)o--,s--;(o0&&(c-=this._prevLine,c===0&&(l-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=l,this._data[this._dataLen++]=n,this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=r}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new pYe(this._prevData,this._data).computeDiff()}:this.build()}};gq.SemanticTokensBuilder=S7t});var Cyn=I(hYe=>{"use strict";p();Object.defineProperty(hYe,"__esModule",{value:!0});hYe.ShowDocumentFeature=void 0;var Nqo=ii(),Mqo=a(t=>class extends t{showDocument(e){return this.connection.sendRequest(Nqo.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");hYe.ShowDocumentFeature=Mqo});var byn=I(mYe=>{"use strict";p();Object.defineProperty(mYe,"__esModule",{value:!0});mYe.FileOperationsFeature=void 0;var _ue=ii(),Oqo=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(_ue.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(_ue.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(_ue.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(_ue.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(_ue.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(_ue.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");mYe.FileOperationsFeature=Oqo});var Syn=I(gYe=>{"use strict";p();Object.defineProperty(gYe,"__esModule",{value:!0});gYe.LinkedEditingRangeFeature=void 0;var Lqo=ii(),Bqo=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(Lqo.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");gYe.LinkedEditingRangeFeature=Bqo});var Tyn=I(AYe=>{"use strict";p();Object.defineProperty(AYe,"__esModule",{value:!0});AYe.TypeHierarchyFeature=void 0;var I7t=ii(),Fqo=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(I7t.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=I7t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSupertypes"),onSubtypes:a(e=>{let r=I7t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");AYe.TypeHierarchyFeature=Fqo});var xyn=I(yYe=>{"use strict";p();Object.defineProperty(yYe,"__esModule",{value:!0});yYe.InlineValueFeature=void 0;var Iyn=ii(),Uqo=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(Iyn.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(Iyn.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");yYe.InlineValueFeature=Uqo});var Ryn=I(_Ye=>{"use strict";p();Object.defineProperty(_Ye,"__esModule",{value:!0});_Ye.FoldingRangeFeature=void 0;var wyn=ii(),Qqo=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(wyn.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=wyn.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");_Ye.FoldingRangeFeature=Qqo});var kyn=I(EYe=>{"use strict";p();Object.defineProperty(EYe,"__esModule",{value:!0});EYe.InlayHintFeature=void 0;var x7t=ii(),qqo=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest(x7t.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(x7t.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest(x7t.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");EYe.InlayHintFeature=qqo});var Pyn=I(vYe=>{"use strict";p();Object.defineProperty(vYe,"__esModule",{value:!0});vYe.DiagnosticFeature=void 0;var nwe=ii(),jqo=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest(nwe.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(nwe.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(nwe.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest(nwe.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(nwe.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");vYe.DiagnosticFeature=jqo});var R7t=I(CYe=>{"use strict";p();Object.defineProperty(CYe,"__esModule",{value:!0});CYe.TextDocuments=void 0;var GK=ii(),w7t=class{static{a(this,"TextDocuments")}constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new GK.Emitter,this._onDidOpen=new GK.Emitter,this._onDidClose=new GK.Emitter,this._onDidSave=new GK.Emitter,this._onWillSave=new GK.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=GK.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let o=n.textDocument,s=this._configuration.create(o.uri,o.languageId,o.version,o.text);this._syncedDocuments.set(o.uri,s);let c=Object.freeze({document:s});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),r.push(e.onDidChangeTextDocument(n=>{let o=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let l=this._syncedDocuments.get(o.uri);l!==void 0&&(l=this._configuration.update(l,s,c),this._syncedDocuments.set(o.uri,l),this._onDidChangeContent.fire(Object.freeze({document:l})))})),r.push(e.onDidCloseTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:o})))})),r.push(e.onWillSaveTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&this._onWillSave.fire(Object.freeze({document:o,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,o)=>{let s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),o):[]})),r.push(e.onDidSaveTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&this._onDidSave.fire(Object.freeze({document:o}))})),GK.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};CYe.TextDocuments=w7t});var P7t=I(Eue=>{"use strict";p();Object.defineProperty(Eue,"__esModule",{value:!0});Eue.NotebookDocuments=Eue.NotebookSyncFeature=void 0;var fw=ii(),Dyn=R7t(),Hqo=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(fw.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(fw.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(fw.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(fw.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");Eue.NotebookSyncFeature=Hqo;var bYe=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,fw.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,fw.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,fw.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};bYe.NULL_DISPOSE=Object.freeze({dispose:a(()=>{},"dispose")});var k7t=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof Dyn.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Dyn.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new fw.Emitter,this._onDidChange=new fw.Emitter,this._onDidSave=new fw.Emitter,this._onDidClose=new fw.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new bYe,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(o=>{this.notebookDocuments.set(o.notebookDocument.uri,o.notebookDocument);for(let s of o.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(o.notebookDocument),this._onDidOpen.fire(o.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);if(s===void 0)return;s.version=o.notebookDocument.version;let c=s.metadata,l=!1,u=o.change;u.metadata!==void 0&&(l=!0,s.metadata=u.metadata);let d=[],f=[],h=[],m=[];if(u.cells!==void 0){let E=u.cells;if(E.structure!==void 0){let v=E.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),E.structure.didOpen!==void 0)for(let S of E.structure.didOpen)r.openTextDocument({textDocument:S}),d.push(S.uri);if(E.structure.didClose)for(let S of E.structure.didClose)r.closeTextDocument({textDocument:S}),f.push(S.uri)}if(E.data!==void 0){let v=new Map(E.data.map(S=>[S.document,S]));for(let S=0;S<=s.cells.length;S++){let T=v.get(s.cells[S].document);if(T!==void 0){let w=s.cells.splice(S,1,T);if(h.push({old:w[0],new:T}),v.delete(T.document),v.size===0)break}}}if(E.textContent!==void 0)for(let v of E.textContent)r.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),m.push(v.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};l&&(g.metadata={old:c,new:s.metadata});let A=[];for(let E of d)A.push(this.getNotebookCell(E));let y=[];for(let E of f)y.push(this.getNotebookCell(E));let _=[];for(let E of m)_.push(this.getNotebookCell(E));(A.length>0||y.length>0||h.length>0||_.length>0)&&(g.cells={added:A,removed:y,changed:{data:h,textContent:_}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let c of o.cellTextDocuments)r.closeTextDocument({textDocument:c});this.notebookDocuments.delete(o.notebookDocument.uri);for(let c of s.cells)this.notebookCellMap.delete(c.document)}})),fw.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Eue.NotebookDocuments=k7t});var Nyn=I(SYe=>{"use strict";p();Object.defineProperty(SYe,"__esModule",{value:!0});SYe.MonikerFeature=void 0;var Gqo=ii(),$qo=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=Gqo.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");SYe.MonikerFeature=$qo});var B7t=I(Tc=>{"use strict";p();Object.defineProperty(Tc,"__esModule",{value:!0});Tc.createConnection=Tc.combineFeatures=Tc.combineNotebooksFeatures=Tc.combineLanguagesFeatures=Tc.combineWorkspaceFeatures=Tc.combineWindowFeatures=Tc.combineClientFeatures=Tc.combineTracerFeatures=Tc.combineTelemetryFeatures=Tc.combineConsoleFeatures=Tc._NotebooksImpl=Tc._LanguagesImpl=Tc.BulkUnregistration=Tc.BulkRegistration=Tc.ErrorMessageTracker=void 0;var Xr=ii(),pw=oYe(),N7t=E7t(),xo=yyn(),Vqo=_yn(),Wqo=Eyn(),zqo=vyn(),Yqo=T7t(),Kqo=Cyn(),Jqo=byn(),Zqo=Syn(),Xqo=Tyn(),ejo=xyn(),tjo=Ryn(),rjo=kyn(),njo=Pyn(),ijo=P7t(),ojo=Nyn();function D7t(t){if(t!==null)return t}a(D7t,"null2Undefined");var M7t=class{static{a(this,"ErrorMessageTracker")}constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};Tc.ErrorMessageTracker=M7t;var TYe=class{static{a(this,"RemoteConsoleImpl")}constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(Xr.MessageType.Error,e)}warn(e){this.send(Xr.MessageType.Warning,e)}info(e){this.send(Xr.MessageType.Info,e)}log(e){this.send(Xr.MessageType.Log,e)}debug(e){this.send(Xr.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Xr.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Xr.RAL)().console.error("Sending log message failed")})}},O7t=class{static{a(this,"_RemoteWindowImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...r){let n={type:Xr.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Xr.ShowMessageRequest.type,n).then(D7t)}showWarningMessage(e,...r){let n={type:Xr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Xr.ShowMessageRequest.type,n).then(D7t)}showInformationMessage(e,...r){let n={type:Xr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Xr.ShowMessageRequest.type,n).then(D7t)}},Myn=(0,Kqo.ShowDocumentFeature)((0,xo.ProgressFeature)(O7t)),Oyn;(function(t){function e(){return new IYe}a(e,"create"),t.create=e})(Oyn||(Tc.BulkRegistration=Oyn={}));var IYe=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=pw.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=N7t.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},Lyn;(function(t){function e(){return new iwe(void 0,[])}a(e,"create"),t.create=e})(Lyn||(Tc.BulkUnregistration=Lyn={}));var iwe=class{static{a(this,"BulkUnregistrationImpl")}constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(Xr.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=pw.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let o={unregisterations:[n]};return this._connection.sendRequest(Xr.UnregistrationRequest.type,o).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},xYe=class{static{a(this,"RemoteClientImpl")}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,r,n){return e instanceof IYe?this.registerMany(e):e instanceof iwe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=pw.string(r)?r:r.method,s=N7t.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Xr.RegistrationRequest.type,c).then(l=>(e.add({id:s,method:o}),e),l=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(l)))}registerSingle2(e,r){let n=pw.string(e)?e:e.method,o=N7t.generateUuid(),s={registrations:[{id:o,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Xr.RegistrationRequest.type,s).then(c=>Xr.Disposable.create(()=>{this.unregisterSingle(o,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${o} failed.`)})}),c=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(c)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(Xr.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(Xr.RegistrationRequest.type,r).then(()=>new iwe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},L7t=class{static{a(this,"_RemoteWorkspaceImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function r(o){return o&&!!o.edit}a(r,"isApplyWorkspaceEditParams");let n=r(e)?e:{edit:e};return this.connection.sendRequest(Xr.ApplyWorkspaceEditRequest.type,n)}},Byn=(0,Jqo.FileOperationsFeature)((0,Wqo.WorkspaceFoldersFeature)((0,Vqo.ConfigurationFeature)(L7t))),wYe=class{static{a(this,"TracerImpl")}constructor(){this._trace=Xr.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,r){this._trace!==Xr.Trace.Off&&this.connection.sendNotification(Xr.LogTraceNotification.type,{message:e,verbose:this._trace===Xr.Trace.Verbose?r:void 0}).catch(()=>{})}},RYe=class{static{a(this,"TelemetryImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(Xr.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},kYe=class{static{a(this,"_LanguagesImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,xo.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,xo.attachPartialResult)(this.connection,r)}};Tc._LanguagesImpl=kYe;var Fyn=(0,tjo.FoldingRangeFeature)((0,ojo.MonikerFeature)((0,njo.DiagnosticFeature)((0,rjo.InlayHintFeature)((0,ejo.InlineValueFeature)((0,Xqo.TypeHierarchyFeature)((0,Zqo.LinkedEditingRangeFeature)((0,Yqo.SemanticTokensFeature)((0,zqo.CallHierarchyFeature)(kYe))))))))),PYe=class{static{a(this,"_NotebooksImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,xo.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,xo.attachPartialResult)(this.connection,r)}};Tc._NotebooksImpl=PYe;var Uyn=(0,ijo.NotebookSyncFeature)(PYe);function Qyn(t,e){return function(r){return e(t(r))}}a(Qyn,"combineConsoleFeatures");Tc.combineConsoleFeatures=Qyn;function qyn(t,e){return function(r){return e(t(r))}}a(qyn,"combineTelemetryFeatures");Tc.combineTelemetryFeatures=qyn;function jyn(t,e){return function(r){return e(t(r))}}a(jyn,"combineTracerFeatures");Tc.combineTracerFeatures=jyn;function Hyn(t,e){return function(r){return e(t(r))}}a(Hyn,"combineClientFeatures");Tc.combineClientFeatures=Hyn;function Gyn(t,e){return function(r){return e(t(r))}}a(Gyn,"combineWindowFeatures");Tc.combineWindowFeatures=Gyn;function $yn(t,e){return function(r){return e(t(r))}}a($yn,"combineWorkspaceFeatures");Tc.combineWorkspaceFeatures=$yn;function Vyn(t,e){return function(r){return e(t(r))}}a(Vyn,"combineLanguagesFeatures");Tc.combineLanguagesFeatures=Vyn;function Wyn(t,e){return function(r){return e(t(r))}}a(Wyn,"combineNotebooksFeatures");Tc.combineNotebooksFeatures=Wyn;function sjo(t,e){function r(o,s,c){return o&&s?c(o,s):o||s}return a(r,"combine"),{__brand:"features",console:r(t.console,e.console,Qyn),tracer:r(t.tracer,e.tracer,jyn),telemetry:r(t.telemetry,e.telemetry,qyn),client:r(t.client,e.client,Hyn),window:r(t.window,e.window,Gyn),workspace:r(t.workspace,e.workspace,$yn),languages:r(t.languages,e.languages,Vyn),notebooks:r(t.notebooks,e.notebooks,Wyn)}}a(sjo,"combineFeatures");Tc.combineFeatures=sjo;function ajo(t,e,r){let n=r&&r.console?new(r.console(TYe)):new TYe,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(wYe)):new wYe,c=r&&r.telemetry?new(r.telemetry(RYe)):new RYe,l=r&&r.client?new(r.client(xYe)):new xYe,u=r&&r.window?new(r.window(Myn)):new Myn,d=r&&r.workspace?new(r.workspace(Byn)):new Byn,f=r&&r.languages?new(r.languages(Fyn)):new Fyn,h=r&&r.notebooks?new(r.notebooks(Uyn)):new Uyn,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:pw.thenable(v)?new Promise((S,T)=>{v.then(w=>S(w),w=>T(w))}):Promise.resolve(v)}a(g,"asPromise");let A,y,_,E={listen:a(()=>o.listen(),"listen"),sendRequest:a((v,...S)=>o.sendRequest(pw.string(v)?v:v.method,...S),"sendRequest"),onRequest:a((v,S)=>o.onRequest(v,S),"onRequest"),sendNotification:a((v,S)=>{let T=pw.string(v)?v:v.method;return o.sendNotification(T,S)},"sendNotification"),onNotification:a((v,S)=>o.onNotification(v,S),"onNotification"),onProgress:o.onProgress,sendProgress:o.sendProgress,onInitialize:a(v=>(y=v,{dispose:a(()=>{y=void 0},"dispose")}),"onInitialize"),onInitialized:a(v=>o.onNotification(Xr.InitializedNotification.type,v),"onInitialized"),onShutdown:a(v=>(A=v,{dispose:a(()=>{A=void 0},"dispose")}),"onShutdown"),onExit:a(v=>(_=v,{dispose:a(()=>{_=void 0},"dispose")}),"onExit"),get console(){return n},get telemetry(){return c},get tracer(){return s},get client(){return l},get window(){return u},get workspace(){return d},get languages(){return f},get notebooks(){return h},onDidChangeConfiguration:a(v=>o.onNotification(Xr.DidChangeConfigurationNotification.type,v),"onDidChangeConfiguration"),onDidChangeWatchedFiles:a(v=>o.onNotification(Xr.DidChangeWatchedFilesNotification.type,v),"onDidChangeWatchedFiles"),__textDocumentSync:void 0,onDidOpenTextDocument:a(v=>o.onNotification(Xr.DidOpenTextDocumentNotification.type,v),"onDidOpenTextDocument"),onDidChangeTextDocument:a(v=>o.onNotification(Xr.DidChangeTextDocumentNotification.type,v),"onDidChangeTextDocument"),onDidCloseTextDocument:a(v=>o.onNotification(Xr.DidCloseTextDocumentNotification.type,v),"onDidCloseTextDocument"),onWillSaveTextDocument:a(v=>o.onNotification(Xr.WillSaveTextDocumentNotification.type,v),"onWillSaveTextDocument"),onWillSaveTextDocumentWaitUntil:a(v=>o.onRequest(Xr.WillSaveTextDocumentWaitUntilRequest.type,v),"onWillSaveTextDocumentWaitUntil"),onDidSaveTextDocument:a(v=>o.onNotification(Xr.DidSaveTextDocumentNotification.type,v),"onDidSaveTextDocument"),sendDiagnostics:a(v=>o.sendNotification(Xr.PublishDiagnosticsNotification.type,v),"sendDiagnostics"),onHover:a(v=>o.onRequest(Xr.HoverRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Xr.CompletionRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onCompletion"),onCompletionResolve:a(v=>o.onRequest(Xr.CompletionResolveRequest.type,v),"onCompletionResolve"),onSignatureHelp:a(v=>o.onRequest(Xr.SignatureHelpRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Xr.DeclarationRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Xr.DefinitionRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Xr.TypeDefinitionRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Xr.ImplementationRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onImplementation"),onReferences:a(v=>o.onRequest(Xr.ReferencesRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Xr.DocumentHighlightRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Xr.DocumentSymbolRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Xr.WorkspaceSymbolRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onWorkspaceSymbol"),onWorkspaceSymbolResolve:a(v=>o.onRequest(Xr.WorkspaceSymbolResolveRequest.type,v),"onWorkspaceSymbolResolve"),onCodeAction:a(v=>o.onRequest(Xr.CodeActionRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onCodeAction"),onCodeActionResolve:a(v=>o.onRequest(Xr.CodeActionResolveRequest.type,(S,T)=>v(S,T)),"onCodeActionResolve"),onCodeLens:a(v=>o.onRequest(Xr.CodeLensRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onCodeLens"),onCodeLensResolve:a(v=>o.onRequest(Xr.CodeLensResolveRequest.type,(S,T)=>v(S,T)),"onCodeLensResolve"),onDocumentFormatting:a(v=>o.onRequest(Xr.DocumentFormattingRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Xr.DocumentRangeFormattingRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),void 0)),"onDocumentRangeFormatting"),onDocumentOnTypeFormatting:a(v=>o.onRequest(Xr.DocumentOnTypeFormattingRequest.type,(S,T)=>v(S,T)),"onDocumentOnTypeFormatting"),onRenameRequest:a(v=>o.onRequest(Xr.RenameRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),void 0)),"onRenameRequest"),onPrepareRename:a(v=>o.onRequest(Xr.PrepareRenameRequest.type,(S,T)=>v(S,T)),"onPrepareRename"),onDocumentLinks:a(v=>o.onRequest(Xr.DocumentLinkRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onDocumentLinks"),onDocumentLinkResolve:a(v=>o.onRequest(Xr.DocumentLinkResolveRequest.type,(S,T)=>v(S,T)),"onDocumentLinkResolve"),onDocumentColor:a(v=>o.onRequest(Xr.DocumentColorRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Xr.ColorPresentationRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Xr.FoldingRangeRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Xr.SelectionRangeRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Xr.ExecuteCommandRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),void 0)),"onExecuteCommand"),dispose:a(()=>o.dispose(),"dispose")};for(let v of m)v.attach(E);return o.onRequest(Xr.InitializeRequest.type,v=>{e.initialize(v),pw.string(v.trace)&&(s.trace=Xr.Trace.fromString(v.trace));for(let S of m)S.initialize(v.capabilities);if(y){let S=y(v,new Xr.CancellationTokenSource().token,(0,xo.attachWorkDone)(o,v),void 0);return g(S).then(T=>{if(T instanceof Xr.ResponseError)return T;let w=T;w||(w={capabilities:{}});let R=w.capabilities;R||(R={},w.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=pw.number(E.__textDocumentSync)?E.__textDocumentSync:Xr.TextDocumentSyncKind.None:!pw.number(R.textDocumentSync)&&!pw.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=pw.number(E.__textDocumentSync)?E.__textDocumentSync:Xr.TextDocumentSyncKind.None);for(let x of m)x.fillServerCapabilities(R);return w})}else{let S={capabilities:{textDocumentSync:Xr.TextDocumentSyncKind.None}};for(let T of m)T.fillServerCapabilities(S.capabilities);return S}}),o.onRequest(Xr.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new Xr.CancellationTokenSource().token)}),o.onNotification(Xr.ExitNotification.type,()=>{try{_&&_()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),o.onNotification(Xr.SetTraceNotification.type,v=>{s.trace=Xr.Trace.fromString(v.value)}),E}a(ajo,"createConnection");Tc.createConnection=ajo});var zyn=I(eb=>{"use strict";p();Object.defineProperty(eb,"__esModule",{value:!0});eb.resolveModulePath=eb.FileSystem=eb.resolveGlobalYarnPath=eb.resolveGlobalNodePath=eb.resolve=eb.uriToFilePath=void 0;var cjo=require("url"),o2=require("path"),F7t=require("fs"),j7t=require("child_process");function ljo(t){let e=cjo.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,o=r.length;n1){let s=r[0],c=r[1];s.length===0&&c.length>1&&c[1]===":"&&r.shift()}return o2.normalize(r.join("/"))}a(ljo,"uriToFilePath");eb.uriToFilePath=ljo;function U7t(){return process.platform==="win32"}a(U7t,"isWindows");function DYe(t,e,r,n){let o="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((c,l)=>{let u=process.env,d=Object.create(null);Object.keys(u).forEach(f=>d[f]=u[f]),e&&F7t.existsSync(e)&&(d[o]?d[o]=e+o2.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,j7t.fork)("",[],{cwd:r,env:d,execArgv:["-e",s]});if(f.pid===void 0){l(new Error(`Starting process to resolve node module ${t} failed`));return}f.on("error",m=>{l(m)}),f.on("message",m=>{m.c==="r"&&(f.send({c:"e"}),m.s?c(m.r):l(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};f.send(h)}catch(f){l(f)}})}a(DYe,"resolve");eb.resolve=DYe;function Q7t(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(s=>r[s]=process.env[s]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};U7t()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,j7t.spawnSync)(e,["config","get","prefix"],n).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let c=s.trim();return t&&t(`'npm config get prefix' value is: ${c}`),c.length>0?U7t()?o2.join(c,"node_modules"):o2.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(Q7t,"resolveGlobalNodePath");eb.resolveGlobalNodePath=Q7t;function ujo(t){let e="yarn",r={encoding:"utf8"};U7t()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,j7t.spawnSync)(e,["global","dir","--json"],r),s=o.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),o.stderr&&t(o.stderr));return}let c=s.trim().split(/\r?\n/);for(let l of c)try{let u=JSON.parse(l);if(u.type==="log")return o2.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(ujo,"resolveGlobalYarnPath");eb.resolveGlobalYarnPath=ujo;var q7t;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!F7t.existsSync(__filename.toUpperCase())||!F7t.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?o2.normalize(s).indexOf(o2.normalize(o))===0:o2.normalize(s).toLowerCase().indexOf(o2.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(q7t||(eb.FileSystem=q7t={}));function djo(t,e,r,n){return r?(o2.isAbsolute(r)||(r=o2.join(t,r)),DYe(e,r,r,n).then(o=>q7t.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>DYe(e,Q7t(n),t,n))):DYe(e,Q7t(n),t,n)}a(djo,"resolveModulePath");eb.resolveModulePath=djo});var H7t=I((Uqu,Yyn)=>{"use strict";p();Yyn.exports=ii()});var Kyn=I(NYe=>{"use strict";p();Object.defineProperty(NYe,"__esModule",{value:!0});NYe.InlineCompletionFeature=void 0;var fjo=ii(),pjo=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(fjo.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");NYe.InlineCompletionFeature=pjo});var Xyn=I(v_=>{"use strict";p();var hjo=v_&&v_.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zyn=v_&&v_.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hjo(e,t,r)};Object.defineProperty(v_,"__esModule",{value:!0});v_.ProposedFeatures=v_.NotebookDocuments=v_.TextDocuments=v_.SemanticTokensBuilder=void 0;var mjo=T7t();Object.defineProperty(v_,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return mjo.SemanticTokensBuilder},"get")});var gjo=Kyn();Zyn(ii(),v_);var Ajo=R7t();Object.defineProperty(v_,"TextDocuments",{enumerable:!0,get:a(function(){return Ajo.TextDocuments},"get")});var yjo=P7t();Object.defineProperty(v_,"NotebookDocuments",{enumerable:!0,get:a(function(){return yjo.NotebookDocuments},"get")});Zyn(B7t(),v_);var Jyn;(function(t){t.all={__brand:"features",languages:gjo.InlineCompletionFeature}})(Jyn||(v_.ProposedFeatures=Jyn={}))});var Wc=I(hw=>{"use strict";p();var _jo=hw&&hw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),n_n=hw&&hw.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_jo(e,t,r)};Object.defineProperty(hw,"__esModule",{value:!0});hw.createConnection=hw.Files=void 0;var e_n=require("node:util"),G7t=oYe(),Ejo=B7t(),owe=zyn(),$K=H7t();n_n(H7t(),hw);n_n(Xyn(),hw);var t_n;(function(t){t.uriToFilePath=owe.uriToFilePath,t.resolveGlobalNodePath=owe.resolveGlobalNodePath,t.resolveGlobalYarnPath=owe.resolveGlobalYarnPath,t.resolve=owe.resolve,t.resolveModulePath=owe.resolveModulePath})(t_n||(hw.Files=t_n={}));var r_n;function MYe(){if(r_n!==void 0)try{r_n.end()}catch{}}a(MYe,"endProtocolConnection");var vue=!1,i_n;function vjo(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(i_n=setInterval(()=>{try{process.kill(n,0)}catch{MYe(),process.exit(vue?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;G7t.number(e)&&i_n===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(vue?0:1)}},3e3)},"initialize"),get shutdownReceived(){return vue},set shutdownReceived(t){vue=t},exit:a(t=>{MYe(),process.exit(t)},"exit")};function bjo(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),$K.ConnectionStrategy.is(t)||$K.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),Sjo(s,c,l,o)}a(bjo,"createConnection");hw.createConnection=bjo;function Sjo(t,e,r,n){let o=!1;if(!t&&!e&&process.argv.length>2){let u,d,f=process.argv.slice(2);for(let h=0;h{MYe(),process.exit(vue?0:1)}),u.on("close",()=>{MYe(),process.exit(vue?0:1)})}let l=a(u=>{let d=(0,$K.createProtocolConnection)(t,e,u,r);return o&&Tjo(u),d},"connectionFactory");return(0,Ejo.createConnection)(l,Cjo,n)}a(Sjo,"_createConnection");function Tjo(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,e_n.inspect)(o)).join(" ")}a(e,"serialize");let r=new Map;console.assert=a(function(o,...s){if(!o)if(s.length===0)t.error("Assertion failed");else{let[c,...l]=s;t.error(`Assertion failed: ${c} ${e(l)}`)}},"assert"),console.count=a(function(o="default"){let s=String(o),c=r.get(s)??0;c+=1,r.set(s,c),t.log(`${s}: ${s}`)},"count"),console.countReset=a(function(o){o===void 0?r.clear():r.delete(String(o))},"countReset"),console.debug=a(function(...o){t.log(e(o))},"debug"),console.dir=a(function(o,s){t.log((0,e_n.inspect)(o,s))},"dir"),console.log=a(function(...o){t.log(e(o))},"log"),console.error=a(function(...o){t.error(e(o))},"error"),console.trace=a(function(...o){let s=new Error().stack.replace(/(.+\n){2}/,""),c="Trace";o.length!==0&&(c+=`: ${e(o)}`),t.log(`${c} -${s}`)},"trace"),console.warn=a(function(...o){t.warn(e(o))},"warn")}a(Tjo,"patchConsole")});var s2=I((Jqu,o_n)=>{"use strict";p();o_n.exports=Wc()});var W_n=I((JHu,V_n)=>{"use strict";p();V_n.exports=a(function(e){if(e===void 0&&(e=2),e>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var r=Error.prepareStackTrace;Error.prepareStackTrace=function(o,s){return s};var n=new Error().stack;if(Error.prepareStackTrace=r,n!==null&&typeof n=="object")return n[e]?n[e].getFileName():void 0},"getCallerFile")});var $En=I(yg=>{"use strict";p();var xQt=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),qHo=xQt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=void 0;var e=require("node:fs"),r=require("node:fs/promises"),n=a(async(l,u={})=>{let{ignoreErrors:d=!1}=u;try{return s(await(0,r.stat)(l),u)}catch(f){let h=f;if(d||h.code==="EACCES")return!1;throw h}},"q");t.isexe=n;var o=a((l,u={})=>{let{ignoreErrors:d=!1}=u;try{return s((0,e.statSync)(l),u)}catch(f){let h=f;if(d||h.code==="EACCES")return!1;throw h}},"m");t.sync=o;var s=a((l,u)=>l.isFile()&&c(l,u),"d"),c=a((l,u)=>{let d=u.uid??process.getuid?.(),f=u.groups??process.getgroups?.()??[],h=u.gid??process.getgid?.()??f[0];if(d===void 0||h===void 0)throw new Error("cannot get uid or gid");let m=new Set([h,...f]),g=l.mode,A=l.uid,y=l.gid,_=parseInt("100",8),E=parseInt("010",8),v=parseInt("001",8),S=_|E;return!!(g&v||g&E&&m.has(y)||g&_&&A===d||g&S&&d===0)},"A")}),jHo=xQt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=void 0;var e=require("node:fs"),r=require("node:fs/promises"),n=require("node:path"),o=a(async(u,d={})=>{let{ignoreErrors:f=!1}=d;try{return l(await(0,r.stat)(u),u,d)}catch(h){let m=h;if(f||m.code==="EACCES")return!1;throw m}},"F");t.isexe=o;var s=a((u,d={})=>{let{ignoreErrors:f=!1}=d;try{return l((0,e.statSync)(u),u,d)}catch(h){let m=h;if(f||m.code==="EACCES")return!1;throw m}},"L");t.sync=s;var c=a((u,d)=>{let{pathExt:f=process.env.PATHEXT||""}=d,h=f.split(n.delimiter);if(h.indexOf("")!==-1)return!0;for(let m of h){let g=m.toLowerCase(),A=u.substring(u.length-g.length).toLowerCase();if(g&&A===g)return!0}return!1},"B"),l=a((u,d,f)=>u.isFile()&&c(d,f),"y")}),HHo=xQt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),QEn=yg&&yg.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),GHo=yg&&yg.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qEn=yg&&yg.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"t");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{p();var{isexe:WHo,sync:zHo}=$En(),{join:YHo,delimiter:KHo,sep:VEn,posix:WEn}=require("path"),zEn=process.platform==="win32",YEn=new RegExp(`[${WEn.sep}${VEn===WEn.sep?"":VEn}]`.replace(/(\\)/g,"\\$1")),JHo=new RegExp(`^\\.${YEn.source}`),KEn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),JEn=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=KHo})=>{let o=t.match(YEn)?[""]:[...zEn?[process.cwd()]:[],...(e||"").split(n)];if(zEn){let s=r||[".EXE",".CMD",".BAT",".COM"].join(n),c=s.split(n).flatMap(l=>[l,l.toLowerCase()]);return t.includes(".")&&c[0]!==""&&c.unshift(""),{pathEnv:o,pathExt:c,pathExtExe:s}}return{pathEnv:o,pathExt:[""]}},"getPathInfo"),ZEn=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&JHo.test(e)?e.slice(0,2):"")+YHo(r,e)},"getPathPart"),XEn=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=JEn(t,e),s=[];for(let c of r){let l=ZEn(c,t);for(let u of n){let d=l+u;if(await WHo(d,{pathExt:o,ignoreErrors:!0})){if(!e.all)return d;s.push(d)}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw KEn(t)},"which"),ZHo=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=JEn(t,e),s=[];for(let c of r){let l=ZEn(c,t);for(let u of n){let d=l+u;if(zHo(d,{pathExt:o,ignoreErrors:!0})){if(!e.all)return d;s.push(d)}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw KEn(t)},"whichSync");evn.exports=XEn;XEn.sync=ZHo});var Cwe=I((PKu,FCn)=>{"use strict";p();var MCn="[^\\\\/]",L$o="(?=.)",OCn="[^/]",hqt="(?:\\/|$)",LCn="(?:^|\\/)",mqt=`\\.{1,2}${hqt}`,B$o="(?!\\.)",F$o=`(?!${LCn}${mqt})`,U$o=`(?!\\.{0,1}${hqt})`,Q$o=`(?!${mqt})`,q$o="[^.\\/]",j$o=`${OCn}*?`,H$o="/",BCn={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:L$o,QMARK:OCn,END_ANCHOR:hqt,DOTS_SLASH:mqt,NO_DOT:B$o,NO_DOTS:F$o,NO_DOT_SLASH:U$o,NO_DOTS_SLASH:Q$o,QMARK_NO_DOT:q$o,STAR:j$o,START_ANCHOR:LCn,SEP:H$o},G$o={...BCn,SLASH_LITERAL:"[\\\\/]",QMARK:MCn,STAR:`${MCn}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},$$o={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};FCn.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:$$o,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?G$o:BCn}}});var bwe=I(ib=>{"use strict";p();var{REGEX_BACKSLASH:V$o,REGEX_REMOVE_BACKSLASH:W$o,REGEX_SPECIAL_CHARS:z$o,REGEX_SPECIAL_CHARS_GLOBAL:Y$o}=Cwe();ib.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);ib.hasRegexChars=t=>z$o.test(t);ib.isRegexChar=t=>t.length===1&&ib.hasRegexChars(t);ib.escapeRegex=t=>t.replace(Y$o,"\\$1");ib.toPosixSlashes=t=>t.replace(V$o,"/");ib.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};ib.removeBackslashes=t=>t.replace(W$o,e=>e==="\\"?"":e);ib.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?ib.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};ib.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};ib.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};ib.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var VCn=I((OKu,$Cn)=>{"use strict";p();var UCn=bwe(),{CHAR_ASTERISK:gqt,CHAR_AT:K$o,CHAR_BACKWARD_SLASH:Swe,CHAR_COMMA:J$o,CHAR_DOT:Aqt,CHAR_EXCLAMATION_MARK:yqt,CHAR_FORWARD_SLASH:GCn,CHAR_LEFT_CURLY_BRACE:_qt,CHAR_LEFT_PARENTHESES:Eqt,CHAR_LEFT_SQUARE_BRACKET:Z$o,CHAR_PLUS:X$o,CHAR_QUESTION_MARK:QCn,CHAR_RIGHT_CURLY_BRACE:eVo,CHAR_RIGHT_PARENTHESES:qCn,CHAR_RIGHT_SQUARE_BRACKET:tVo}=Cwe(),jCn=a(t=>t===GCn||t===Swe,"isPathSeparator"),HCn=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),rVo=a((t,e)=>{let r=e||{},n=t.length-1,o=r.parts===!0||r.scanToEnd===!0,s=[],c=[],l=[],u=t,d=-1,f=0,h=0,m=!1,g=!1,A=!1,y=!1,_=!1,E=!1,v=!1,S=!1,T=!1,w=!1,R=0,x,k,D={value:"",depth:0,isGlob:!1},N=a(()=>d>=n,"eos"),O=a(()=>u.charCodeAt(d+1),"peek"),B=a(()=>(x=k,u.charCodeAt(++d)),"advance");for(;d0&&(M=u.slice(0,f),u=u.slice(f),h-=f),q&&A===!0&&h>0?(q=u.slice(0,h),L=u.slice(h)):A===!0?(q="",L=u):q=u,q&&q!==""&&q!=="/"&&q!==u&&jCn(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),r.unescape===!0&&(L&&(L=UCn.removeBackslashes(L)),q&&v===!0&&(q=UCn.removeBackslashes(q)));let U={prefix:M,input:t,start:f,base:q,glob:L,isBrace:m,isBracket:g,isGlob:A,isExtglob:y,isGlobstar:_,negated:S,negatedExtglob:T};if(r.tokens===!0&&(U.maxDepth=0,jCn(k)||c.push(D),U.tokens=c),r.parts===!0||r.tokens===!0){let j;for(let Q=0;Q{"use strict";p();var Twe=Cwe(),fT=bwe(),{MAX_LENGTH:TKe,POSIX_REGEX_SOURCE:nVo,REGEX_NON_SPECIAL_CHARS:iVo,REGEX_SPECIAL_CHARS_BACKREF:oVo,REPLACEMENTS:WCn}=Twe,sVo=a((t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(o=>fT.escapeRegex(o)).join("..")}return r},"expandRange"),Mue=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),zCn=a(t=>{let e=[],r=0,n=0,o=0,s="",c=!1;for(let l of t){if(c===!0){s+=l,c=!1;continue}if(l==="\\"){s+=l,c=!0;continue}if(l==='"'){o=o===1?0:1,s+=l;continue}if(o===0){if(l==="[")r++;else if(l==="]"&&r>0)r--;else if(r===0){if(l==="(")n++;else if(l===")"&&n>0)n--;else if(l==="|"&&n===0){e.push(s),s="";continue}}}s+=l}return e.push(s),e},"splitTopLevel"),aVo=a(t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},"isPlainBranch"),YCn=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(aVo(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),cVo=a(t=>{let e=t.map(YCn).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,o=0,s=!1;for(let c=1;c0){r--;continue}if(!(r>0)){if(l==="("){n++;continue}if(l===")"&&(n--,n===0))return e===!0&&c!==t.length-1?void 0:{type:t[0],body:t.slice(2,c),end:c}}}}},"parseRepeatedExtglob"),lVo=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=YCn(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?fT.escapeRegex(r[0]):`[${r.map(o=>fT.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),uVo=a(t=>{let e=0,r=t.trim(),n=vqt(r);for(;n;)e++,r=n.body.trim(),n=vqt(r);return e},"repeatedExtglobRecursion"),dVo=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Twe.DEFAULT_MAX_EXTGLOB_RECURSION,n=zCn(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||cVo(n)))return{risky:!0};for(let o of n){let s=lVo(o);if(s)return{risky:!0,safeOutput:s};if(uVo(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),Cqt=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=WCn[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(TKe,r.maxLength):TKe,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},c=[s],l=r.capture?"":"?:",u=Twe.globChars(r.windows),d=Twe.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:m,ONE_CHAR:g,DOTS_SLASH:A,NO_DOT:y,NO_DOT_SLASH:_,NO_DOTS_SLASH:E,QMARK:v,QMARK_NO_DOT:S,STAR:T,START_ANCHOR:w}=u,R=a(me=>`(${l}(?:(?!${w}${me.dot?A:f}).)*?)`,"globstar"),x=r.dot?"":y,k=r.dot?v:S,D=r.bash===!0?R(r):T;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let N={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:c};t=fT.removePrefix(t,N),o=t.length;let O=[],B=[],q=[],M=s,L,U=a(()=>N.index===o-1,"eos"),j=N.peek=(me=1)=>t[N.index+me],Q=N.advance=()=>t[++N.index]||"",Y=a(()=>t.slice(N.index+1),"remaining"),W=a((me="",Oe=0)=>{N.consumed+=me,N.index+=Oe},"consume"),V=a(me=>{N.output+=me.output!=null?me.output:me.value,W(me.value)},"append"),z=a(()=>{let me=1;for(;j()==="!"&&(j(2)!=="("||j(3)==="?");)Q(),N.start++,me++;return me%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),ie=a(me=>{N[me]++,q.push(me)},"increment"),H=a(me=>{N[me]--,q.pop()},"decrement"),re=a(me=>{if(M.type==="globstar"){let Oe=N.braces>0&&(me.type==="comma"||me.type==="brace"),Te=me.extglob===!0||O.length&&(me.type==="pipe"||me.type==="paren");me.type!=="slash"&&me.type!=="paren"&&!Oe&&!Te&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(O.length&&me.type!=="paren"&&(O[O.length-1].inner+=me.value),(me.value||me.output)&&V(me),M&&M.type==="text"&&me.type==="text"){M.output=(M.output||M.value)+me.value,M.value+=me.value;return}me.prev=M,c.push(me),M=me},"push"),le=a((me,Oe)=>{let Te={...d[Oe],conditions:1,inner:""};Te.prev=M,Te.parens=N.parens,Te.output=N.output,Te.startIndex=N.index,Te.tokensIndex=c.length;let te=(r.capture?"(":"")+Te.open;ie("parens"),re({type:me,value:Oe,output:N.output?"":g}),re({type:"paren",extglob:!0,value:Q(),output:te}),O.push(Te)},"extglobOpen"),Le=a(me=>{let Oe=t.slice(me.startIndex,N.index+1),Te=t.slice(me.startIndex+2,N.index),te=dVo(Te,r);if((me.type==="plus"||me.type==="star")&&te.risky){let he=te.safeOutput?(me.output?"":g)+(r.capture?`(${te.safeOutput})`:te.safeOutput):void 0,X=c[me.tokensIndex];X.type="text",X.value=Oe,X.output=he||fT.escapeRegex(Oe);for(let de=me.tokensIndex+1;de1&&me.inner.includes("/")&&(he=R(r)),(he!==D||U()||/^\)+$/.test(Y()))&&(ee=me.close=`)$))${he}`),me.inner.includes("*")&&(K=Y())&&/^\.[^\\/.]+$/.test(K)){let X=Cqt(K,{...e,fastpaths:!1}).output;ee=me.close=`)${X})${he})`}me.prev.type==="bos"&&(N.negatedExtglob=!0)}re({type:"paren",extglob:!0,value:L,output:ee}),H("parens")},"extglobClose");if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let me=!1,Oe=t.replace(oVo,(Te,te,ee,K,he,X)=>K==="\\"?(me=!0,Te):K==="?"?te?te+K+(he?v.repeat(he.length):""):X===0?k+(he?v.repeat(he.length):""):v.repeat(ee.length):K==="."?f.repeat(ee.length):K==="*"?te?te+K+(he?D:""):D:te?Te:`\\${Te}`);return me===!0&&(r.unescape===!0?Oe=Oe.replace(/\\/g,""):Oe=Oe.replace(/\\+/g,Te=>Te.length%2===0?"\\\\":Te?"\\":"")),Oe===t&&r.contains===!0?(N.output=t,N):(N.output=fT.wrapOutput(Oe,N,e),N)}for(;!U();){if(L=Q(),L==="\0")continue;if(L==="\\"){let Te=j();if(Te==="/"&&r.bash!==!0||Te==="."||Te===";")continue;if(!Te){L+="\\",re({type:"text",value:L});continue}let te=/^\\+/.exec(Y()),ee=0;if(te&&te[0].length>2&&(ee=te[0].length,N.index+=ee,ee%2!==0&&(L+="\\")),r.unescape===!0?L=Q():L+=Q(),N.brackets===0){re({type:"text",value:L});continue}}if(N.brackets>0&&(L!=="]"||M.value==="["||M.value==="[^")){if(r.posix!==!1&&L===":"){let Te=M.value.slice(1);if(Te.includes("[")&&(M.posix=!0,Te.includes(":"))){let te=M.value.lastIndexOf("["),ee=M.value.slice(0,te),K=M.value.slice(te+2),he=nVo[K];if(he){M.value=ee+he,N.backtrack=!0,Q(),!s.output&&c.indexOf(M)===1&&(s.output=g);continue}}}(L==="["&&j()!==":"||L==="-"&&j()==="]")&&(L=`\\${L}`),L==="]"&&(M.value==="["||M.value==="[^")&&(L=`\\${L}`),r.posix===!0&&L==="!"&&M.value==="["&&(L="^"),M.value+=L,V({value:L});continue}if(N.quotes===1&&L!=='"'){L=fT.escapeRegex(L),M.value+=L,V({value:L});continue}if(L==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&re({type:"text",value:L});continue}if(L==="("){ie("parens"),re({type:"paren",value:L});continue}if(L===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Mue("opening","("));let Te=O[O.length-1];if(Te&&N.parens===Te.parens+1){Le(O.pop());continue}re({type:"paren",value:L,output:N.parens?")":"\\)"}),H("parens");continue}if(L==="["){if(r.nobracket===!0||!Y().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Mue("closing","]"));L=`\\${L}`}else ie("brackets");re({type:"bracket",value:L});continue}if(L==="]"){if(r.nobracket===!0||M&&M.type==="bracket"&&M.value.length===1){re({type:"text",value:L,output:`\\${L}`});continue}if(N.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Mue("opening","["));re({type:"text",value:L,output:`\\${L}`});continue}H("brackets");let Te=M.value.slice(1);if(M.posix!==!0&&Te[0]==="^"&&!Te.includes("/")&&(L=`/${L}`),M.value+=L,V({value:L}),r.literalBrackets===!1||fT.hasRegexChars(Te))continue;let te=fT.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=te,M.value=te;continue}M.value=`(${l}${te}|${M.value})`,N.output+=M.value;continue}if(L==="{"&&r.nobrace!==!0){ie("braces");let Te={type:"brace",value:L,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};B.push(Te),re(Te);continue}if(L==="}"){let Te=B[B.length-1];if(r.nobrace===!0||!Te){re({type:"text",value:L,output:L});continue}let te=")";if(Te.dots===!0){let ee=c.slice(),K=[];for(let he=ee.length-1;he>=0&&(c.pop(),ee[he].type!=="brace");he--)ee[he].type!=="dots"&&K.unshift(ee[he].value);te=sVo(K,r),N.backtrack=!0}if(Te.comma!==!0&&Te.dots!==!0){let ee=N.output.slice(0,Te.outputIndex),K=N.tokens.slice(Te.tokensIndex);Te.value=Te.output="\\{",L=te="\\}",N.output=ee;for(let he of K)N.output+=he.output||he.value}re({type:"brace",value:L,output:te}),H("braces"),B.pop();continue}if(L==="|"){O.length>0&&O[O.length-1].conditions++,re({type:"text",value:L});continue}if(L===","){let Te=L,te=B[B.length-1];te&&q[q.length-1]==="braces"&&(te.comma=!0,Te="|"),re({type:"comma",value:L,output:Te});continue}if(L==="/"){if(M.type==="dot"&&N.index===N.start+1){N.start=N.index+1,N.consumed="",N.output="",c.pop(),M=s;continue}re({type:"slash",value:L,output:m});continue}if(L==="."){if(N.braces>0&&M.type==="dot"){M.value==="."&&(M.output=f);let Te=B[B.length-1];M.type="dots",M.output+=L,M.value+=L,Te.dots=!0;continue}if(N.braces+N.parens===0&&M.type!=="bos"&&M.type!=="slash"){re({type:"text",value:L,output:f});continue}re({type:"dot",value:L,output:f});continue}if(L==="?"){if(!(M&&M.value==="(")&&r.noextglob!==!0&&j()==="("&&j(2)!=="?"){le("qmark",L);continue}if(M&&M.type==="paren"){let te=j(),ee=L;(M.value==="("&&!/[!=<:]/.test(te)||te==="<"&&!/<([!=]|\w+>)/.test(Y()))&&(ee=`\\${L}`),re({type:"text",value:L,output:ee});continue}if(r.dot!==!0&&(M.type==="slash"||M.type==="bos")){re({type:"qmark",value:L,output:S});continue}re({type:"qmark",value:L,output:v});continue}if(L==="!"){if(r.noextglob!==!0&&j()==="("&&(j(2)!=="?"||!/[!=<:]/.test(j(3)))){le("negate",L);continue}if(r.nonegate!==!0&&N.index===0){z();continue}}if(L==="+"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){le("plus",L);continue}if(M&&M.value==="("||r.regex===!1){re({type:"plus",value:L,output:h});continue}if(M&&(M.type==="bracket"||M.type==="paren"||M.type==="brace")||N.parens>0){re({type:"plus",value:L});continue}re({type:"plus",value:h});continue}if(L==="@"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){re({type:"at",extglob:!0,value:L,output:""});continue}re({type:"text",value:L});continue}if(L!=="*"){(L==="$"||L==="^")&&(L=`\\${L}`);let Te=iVo.exec(Y());Te&&(L+=Te[0],N.index+=Te[0].length),re({type:"text",value:L});continue}if(M&&(M.type==="globstar"||M.star===!0)){M.type="star",M.star=!0,M.value+=L,M.output=D,N.backtrack=!0,N.globstar=!0,W(L);continue}let me=Y();if(r.noextglob!==!0&&/^\([^?]/.test(me)){le("star",L);continue}if(M.type==="star"){if(r.noglobstar===!0){W(L);continue}let Te=M.prev,te=Te.prev,ee=Te.type==="slash"||Te.type==="bos",K=te&&(te.type==="star"||te.type==="globstar");if(r.bash===!0&&(!ee||me[0]&&me[0]!=="/")){re({type:"star",value:L,output:""});continue}let he=N.braces>0&&(Te.type==="comma"||Te.type==="brace"),X=O.length&&(Te.type==="pipe"||Te.type==="paren");if(!ee&&Te.type!=="paren"&&!he&&!X){re({type:"star",value:L,output:""});continue}for(;me.slice(0,3)==="/**";){let de=t[N.index+4];if(de&&de!=="/")break;me=me.slice(3),W("/**",3)}if(Te.type==="bos"&&U()){M.type="globstar",M.value+=L,M.output=R(r),N.output=M.output,N.globstar=!0,W(L);continue}if(Te.type==="slash"&&Te.prev.type!=="bos"&&!K&&U()){N.output=N.output.slice(0,-(Te.output+M.output).length),Te.output=`(?:${Te.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=L,N.globstar=!0,N.output+=Te.output+M.output,W(L);continue}if(Te.type==="slash"&&Te.prev.type!=="bos"&&me[0]==="/"){let de=me[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(Te.output+M.output).length),Te.output=`(?:${Te.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${de})`,M.value+=L,N.output+=Te.output+M.output,N.globstar=!0,W(L+Q()),re({type:"slash",value:"/",output:""});continue}if(Te.type==="bos"&&me[0]==="/"){M.type="globstar",M.value+=L,M.output=`(?:^|${m}|${R(r)}${m})`,N.output=M.output,N.globstar=!0,W(L+Q()),re({type:"slash",value:"/",output:""});continue}N.output=N.output.slice(0,-M.output.length),M.type="globstar",M.output=R(r),M.value+=L,N.output+=M.output,N.globstar=!0,W(L);continue}let Oe={type:"star",value:L,output:D};if(r.bash===!0){Oe.output=".*?",(M.type==="bos"||M.type==="slash")&&(Oe.output=x+Oe.output),re(Oe);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===!0){Oe.output=L,re(Oe);continue}(N.index===N.start||M.type==="slash"||M.type==="dot")&&(M.type==="dot"?(N.output+=_,M.output+=_):r.dot===!0?(N.output+=E,M.output+=E):(N.output+=x,M.output+=x),j()!=="*"&&(N.output+=g,M.output+=g)),re(Oe)}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Mue("closing","]"));N.output=fT.escapeLast(N.output,"["),H("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Mue("closing",")"));N.output=fT.escapeLast(N.output,"("),H("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Mue("closing","}"));N.output=fT.escapeLast(N.output,"{"),H("braces")}if(r.strictSlashes!==!0&&(M.type==="star"||M.type==="bracket")&&re({type:"maybe_slash",value:"",output:`${m}?`}),N.backtrack===!0){N.output="";for(let me of N.tokens)N.output+=me.output!=null?me.output:me.value,me.suffix&&(N.output+=me.suffix)}return N},"parse");Cqt.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(TKe,r.maxLength):TKe,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=WCn[t]||t;let{DOT_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,DOTS_SLASH:u,NO_DOT:d,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:m,START_ANCHOR:g}=Twe.globChars(r.windows),A=r.dot?f:d,y=r.dot?h:d,_=r.capture?"":"?:",E={negated:!1,prefix:""},v=r.bash===!0?".*?":m;r.capture&&(v=`(${v})`);let S=a(x=>x.noglobstar===!0?v:`(${_}(?:(?!${g}${x.dot?u:s}).)*?)`,"globstar"),T=a(x=>{switch(x){case"*":return`${A}${l}${v}`;case".*":return`${s}${l}${v}`;case"*.*":return`${A}${v}${s}${l}${v}`;case"*/*":return`${A}${v}${c}${l}${y}${v}`;case"**":return A+S(r);case"**/*":return`(?:${A}${S(r)}${c})?${y}${l}${v}`;case"**/*.*":return`(?:${A}${S(r)}${c})?${y}${v}${s}${l}${v}`;case"**/.*":return`(?:${A}${S(r)}${c})?${s}${l}${v}`;default:{let k=/^(.*?)\.(\w+)$/.exec(x);if(!k)return;let D=T(k[1]);return D?D+s+k[2]:void 0}}},"create"),w=fT.removePrefix(t,E),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};KCn.exports=Cqt});var ebn=I((qKu,XCn)=>{"use strict";p();var fVo=VCn(),bqt=JCn(),ZCn=bwe(),pVo=Cwe(),hVo=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),ch=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>ch(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=hVo(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},s=o.windows,c=n?ch.compileRe(t,e):ch.makeRe(t,e,!1,!0),l=c.state;delete c.state;let u=a(()=>!1,"isIgnored");if(o.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};u=ch(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=ch.test(f,c,e,{glob:t,posix:s}),y={glob:t,state:l,regex:c,posix:s,input:f,output:A,match:g,isMatch:m};return typeof o.onResult=="function"&&o.onResult(y),m===!1?(y.isMatch=!1,h?y:!1):u(f)?(typeof o.onIgnore=="function"&&o.onIgnore(y),y.isMatch=!1,h?y:!1):(typeof o.onMatch=="function"&&o.onMatch(y),h?y:!0)},"matcher");return r&&(d.state=l),d},"picomatch");ch.test=(t,e,r,{glob:n,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=r||{},c=s.format||(o?ZCn.toPosixSlashes:null),l=t===n,u=l&&c?c(t):t;return l===!1&&(u=c?c(t):t,l=u===n),(l===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?l=ch.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};ch.matchBase=(t,e,r)=>(e instanceof RegExp?e:ch.makeRe(e,r)).test(ZCn.basename(t));ch.isMatch=(t,e,r)=>ch(e,r)(t);ch.parse=(t,e)=>Array.isArray(t)?t.map(r=>ch.parse(r,e)):bqt(t,{...e,fastpaths:!1});ch.scan=(t,e)=>fVo(t,e);ch.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let o=e||{},s=o.contains?"":"^",c=o.contains?"":"$",l=`${s}(?:${t.output})${c}`;t&&t.negated===!0&&(l=`^(?!${l}).*$`);let u=ch.toRegex(l,e);return n===!0&&(u.state=t),u};ch.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=bqt.fastpaths(t,e)),o.output||(o=bqt(t,e)),ch.compileRe(o,e,r,n)};ch.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};ch.constants=pVo;XCn.exports=ch});var ibn=I((GKu,nbn)=>{"use strict";p();var tbn=ebn(),mVo=bwe();function rbn(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:mVo.isWindows()}),tbn(t,e,r)}a(rbn,"picomatch");Object.assign(rbn,tbn);nbn.exports=rbn});var sbn=I((WKu,obn)=>{p();obn.exports=a(function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1},"isExtglob")});var lbn=I((KKu,cbn)=>{p();var gVo=sbn(),abn={"{":"}","(":")","[":"]"},AVo=a(function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,o=-2,s=-2,c=-2;ee&&(c===-1||c>n||(c=t.indexOf("\\",e),c===-1||c>n)))||o!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(o=t.indexOf("}",e),o>e&&(c=t.indexOf("\\",e),c===-1||c>o))||s!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(s=t.indexOf(")",e),s>e&&(c=t.indexOf("\\",e),c===-1||c>s))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(c=t.indexOf("\\",r),c===-1||c>s))))return!0;if(t[e]==="\\"){var l=t[e+1];e+=2;var u=abn[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),yVo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var gJ=require("path"),_Vo=ibn(),EVo=lbn();function IKe(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(o instanceof RegExp){if(o.flags!=="")throw new Error(`RegExp ignore patterns must not have flags (got /${o.source}/${o.flags}). Flags are not supported by the native matcher.`);e.ignoreGlobs||(e.ignoreGlobs=[]),e.ignoreGlobs.push(`^[\\s\\S]*(?:${o.source})[\\s\\S]*$`)}else if(EVo(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=_Vo.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(gJ.resolve(t,o))}return e}a(IKe,"normalizeOptions");ubn.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(gJ.resolve(e),gJ.resolve(r),IKe(e,n))},getEventsSince(e,r,n){return t.getEventsSince(gJ.resolve(e),gJ.resolve(r),IKe(e,n))},async subscribe(e,r,n){return e=gJ.resolve(e),n=IKe(e,n),await t.subscribe(e,r,n),{unsubscribe(){return t.unsubscribe(e,r,n)}}},unsubscribe(e,r,n){return t.unsubscribe(gJ.resolve(e),r,IKe(e,n))}})});var fbn=I(Iwe=>{"use strict";p();var vVo=require("path"),{createWrapper:CVo}=dbn();function bVo(){return vVo.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(bVo,"resolveBindingPath");var SVo=require(bVo()),xKe=CVo(SVo);Iwe.writeSnapshot=xKe.writeSnapshot;Iwe.getEventsSince=xKe.getEventsSince;Iwe.subscribe=xKe.subscribe;Iwe.unsubscribe=xKe.unsubscribe});var iv=I(NKe=>{"use strict";p();Object.defineProperty(NKe,"__esModule",{value:!0});NKe.Position=void 0;var wqt=class t{static{a(this,"Position")}constructor(e,r){this.lineNumber=e,this.column=r}with(e=this.lineNumber,r=this.column){return e===this.lineNumber&&r===this.column?this:new t(e,r)}delta(e=0,r=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+r))}equals(e){return t.equals(this,e)}static equals(e,r){return!e&&!r?!0:!!e&&!!r&&e.lineNumber===r.lineNumber&&e.column===r.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,r){return e.lineNumber{"use strict";p();Object.defineProperty(MKe,"__esModule",{value:!0});MKe.Range=void 0;var ybn=iv(),Rqt=class t{static{a(this,"Range")}constructor(e,r,n,o){e>n||e===n&&r>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=r):(this.startLineNumber=e,this.startColumn=r,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.columne.endColumn)}static strictContainsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.column<=e.startColumn||r.lineNumber===e.endLineNumber&&r.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumn<=e.startColumn||r.endLineNumber===e.endLineNumber&&r.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,r){let n,o,s,c;return r.startLineNumbere.endLineNumber?(s=r.endLineNumber,c=r.endColumn):r.endLineNumber===e.endLineNumber?(s=r.endLineNumber,c=Math.max(r.endColumn,e.endColumn)):(s=e.endLineNumber,c=e.endColumn),new t(n,o,s,c)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,r){let n=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,c=e.endColumn,l=r.startLineNumber,u=r.startColumn,d=r.endLineNumber,f=r.endColumn;return nd?(s=d,c=f):s===d&&(c=Math.min(c,f)),n>s||n===s&&o>c?null:new t(n,o,s,c)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,r){return!e&&!r?!0:!!e&&!!r&&e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&e.endLineNumber===r.endLineNumber&&e.endColumn===r.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new ybn.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new ybn.Position(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,r){return new t(this.startLineNumber,this.startColumn,e,r)}setStartPosition(e,r){return new t(e,r,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,r=e){return new t(e.lineNumber,e.column,r.lineNumber,r.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,r){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};MKe.Range=Rqt});var ESn=I(Ajt=>{"use strict";p();Object.defineProperty(Ajt,"__esModule",{value:!0});Ajt.assertNever=DWo;function DWo(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(DWo,"assertNever")});var jwe=I(yF=>{"use strict";p();Object.defineProperty(yF,"__esModule",{value:!0});yF.ChatCompletionContentPartOpaque=yF.ChatCompletionContentPartKind=yF.ChatRole=void 0;var NWo=ESn(),cJe;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(cJe||(yF.ChatRole=cJe={}));(function(t){function e(r){switch(r){case t.System:return"system";case t.User:return"user";case t.Assistant:return"assistant";case t.Tool:return"tool";default:(0,NWo.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(cJe||(yF.ChatRole=cJe={}));var vSn;(function(t){t[t.Image=0]="Image",t[t.Text=1]="Text",t[t.Opaque=2]="Opaque",t[t.CacheBreakpoint=3]="CacheBreakpoint",t[t.Document=4]="Document"})(vSn||(yF.ChatCompletionContentPartKind=vSn={}));var CSn;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})(CSn||(yF.ChatCompletionContentPartOpaque=CSn={}))});var yjt=I(XO=>{"use strict";p();Object.defineProperty(XO,"__esModule",{value:!0});XO.BaseTokensPerName=XO.BaseTokensPerMessage=XO.BaseTokensPerCompletion=XO.ChatRole=void 0;var bSn;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(bSn||(XO.ChatRole=bSn={}));XO.BaseTokensPerCompletion=3;XO.BaseTokensPerMessage=3;XO.BaseTokensPerName=1});var xSn=I(uJe=>{"use strict";p();Object.defineProperty(uJe,"__esModule",{value:!0});uJe.toOpenAiChatMessage=ISn;uJe.toOpenAIChatMessages=OWo;var e5=jwe(),lJe=yjt(),MWo=Gq();function SSn(t){return t.filter(e=>e.type===e5.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(SSn,"onlyStringContent");function TSn(t){let e=t.map(r=>{if(r.type===e5.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===e5.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===e5.ChatCompletionContentPartKind.Document)return;if(r.type===e5.ChatCompletionContentPartKind.Opaque&&e5.ChatCompletionContentPartOpaque.usableIn(r,MWo.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(TSn,"stringAndImageContent");function ISn(t){switch(t.role){case e5.ChatRole.System:return{role:lJe.ChatRole.System,content:SSn(t.content),name:t.name};case e5.ChatRole.User:return{role:lJe.ChatRole.User,content:TSn(t.content),name:t.name};case e5.ChatRole.Assistant:return{role:lJe.ChatRole.Assistant,content:SSn(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case e5.ChatRole.Tool:return{role:lJe.ChatRole.Tool,content:TSn(t.content),tool_call_id:t.toolCallId};default:return}}a(ISn,"toOpenAiChatMessage");function OWo(t){return t.map(ISn).filter(e=>!!e)}a(OWo,"toOpenAIChatMessages")});var RSn=I(pJe=>{"use strict";p();Object.defineProperty(pJe,"__esModule",{value:!0});pJe.toVsCodeChatMessage=wSn;pJe.toVsCodeChatMessages=LWo;var fJe=jwe();function dJe(t){return t.filter(e=>e.type===fJe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(dJe,"onlyStringContent");var $q;function wSn(t){switch($q??=require("vscode"),t.role){case fJe.ChatRole.Assistant:let e=$q.LanguageModelChatMessage.Assistant(dJe(t.content),t.name);return t.toolCalls&&(e.content=[new $q.LanguageModelTextPart(dJe(t.content)),...t.toolCalls.map(r=>{let n;try{n=JSON.parse(r.function.arguments)}catch{throw new Error("Invalid JSON in tool call arguments for tool call: "+r.id)}return new $q.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case fJe.ChatRole.User:return $q.LanguageModelChatMessage.User(dJe(t.content),t.name);case fJe.ChatRole.Tool:{let r=$q.LanguageModelChatMessage.User("");return r.content=[new $q.LanguageModelToolResultPart(t.toolCallId,[new $q.LanguageModelTextPart(dJe(t.content))])],r}default:return}}a(wSn,"toVsCodeChatMessage");function LWo(t){return t.map(wSn).filter(e=>!!e)}a(LWo,"toVsCodeChatMessages")});var Gq=I(h2=>{"use strict";p();Object.defineProperty(h2,"__esModule",{value:!0});h2.OutputMode=h2.Raw=h2.OpenAI=void 0;h2.toMode=_jt;h2.toVSCode=BWo;h2.toOpenAI=FWo;var kSn=xSn(),PSn=RSn();h2.OpenAI=yjt();h2.Raw=jwe();var SJ;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(SJ||(h2.OutputMode=SJ={}));function _jt(t,e){switch(t){case SJ.Raw:return e;case SJ.VSCode:return e instanceof Array?(0,PSn.toVsCodeChatMessages)(e):(0,PSn.toVsCodeChatMessage)(e);case SJ.OpenAI:return e instanceof Array?(0,kSn.toOpenAIChatMessages)(e):(0,kSn.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(_jt,"toMode");function BWo(t){return _jt(SJ.VSCode,t)}a(BWo,"toVSCode");function FWo(t){return _jt(SJ.OpenAI,t)}a(FWo,"toOpenAI")});var Ejt=I(Hwe=>{"use strict";p();Object.defineProperty(Hwe,"__esModule",{value:!0});Hwe.jsonRetainedProps=void 0;Hwe.forEachNode=DSn;Hwe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function DSn(t,e){if(e(t),t.type===1)for(let r of t.children)DSn(r,e)}a(DSn,"forEachNode")});var NSn=I(vjt=>{"use strict";p();Object.defineProperty(vjt,"__esModule",{value:!0});vjt.once=UWo;function UWo(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(UWo,"once")});var Tjt=I(b0=>{"use strict";p();Object.defineProperty(b0,"__esModule",{value:!0});b0.BudgetExceededError=b0.MaterializedChatMessageDocument=b0.MaterializedChatMessageImage=b0.MaterializedChatMessageBreakpoint=b0.MaterializedChatMessageOpaque=b0.MaterializedChatMessage=b0.MaterializedChatMessageTextChunk=b0.GenericMaterializedContainer=void 0;var TJ=NSn(),qA=Gq(),_F=class t{static{a(this,"GenericMaterializedContainer")}parent;id;name;priority;metadata;flags;children;keepWithId;constructor(e,r,n,o,s,c,l){if(this.parent=e,this.id=r,this.name=n,this.priority=o,this.metadata=c,this.flags=l,this.children=s(this),l&8){if(this.children.length!==2)throw new Error("Invalid number of children for EmptyAlternate flag");let[u,d]=this.children;d.isEmpty?this.children=[u]:this.children=[d]}}has(e){return!!(this.flags&e)}async tokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{let o=Wq(n)?await n.tokenCount(e):await n.upperBoundTokenCount(e);r+=o})),r}async upperBoundTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{let o=await n.upperBoundTokenCount(e);r+=o})),r}replaceNode(e,r){return jSn(e,this.children,r)}allMetadata(){return qSn(this)}findById(e){return Sjt(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)QWo(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof g2&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof g2||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return bjt(this,e),e}};b0.GenericMaterializedContainer=_F;var Gwe=class{static{a(this,"MaterializedChatMessageTextChunk")}parent;text;priority;metadata;lineBreakBefore;constructor(e,r,n,o=[],s){this.parent=e,this.text=r,this.priority=n,this.metadata=o,this.lineBreakBefore=s}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,TJ.once)(async e=>await e.tokenLength({type:qA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};b0.MaterializedChatMessageTextChunk=Gwe;var g2=class{static{a(this,"MaterializedChatMessage")}parent;id;role;name;toolCalls;toolCallId;priority;metadata;children;constructor(e,r,n,o,s,c,l,u,d){this.parent=e,this.id=r,this.role=n,this.name=o,this.toolCalls=s,this.toolCallId=c,this.priority=l,this.metadata=u,this.children=d(this)}async tokenCount(e){return this._tokenCount(e)}async upperBoundTokenCount(e){return this._upperBound(e)}get text(){return this._text()}get isEmpty(){return!this.toolCalls?.length&&!this.children.some(e=>!e.isEmpty)}replaceNode(e,r){let n=jSn(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return bjt(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return Sjt(e,this)}_tokenCount=(0,TJ.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,qA.toMode)(e.mode,r))});_upperBound=(0,TJ.once)(async e=>{let r=await this.baseMessageTokenCount(e);return await Promise.all(this.children.map(async n=>{let o=await n.upperBoundTokenCount(e);r+=o})),r});baseMessageTokenCount=(0,TJ.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===qA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===qA.Raw.ChatCompletionContentPartKind.Image||n.type===qA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,qA.toMode)(e.mode,r))});_text=(0,TJ.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of USn(this)){if(r instanceof IJ||r instanceof xJ||r instanceof Vq){e.push(r);continue}if(r instanceof m2){e.at(-1)instanceof m2?e[e.length-1]=r:e.push(r);continue}if(r.lineBreakBefore===1||r.lineBreakBefore===2&&!n){let o=e[e.length-1];typeof o=="string"&&o&&!o.endsWith(` +${JSON.stringify(o,null,2)}`);let c=n[s]();return new Language(INTERNAL,c)})}}class LookaheadIterable{static{a(this,"LookaheadIterable")}constructor(e,r,n){assertInternal(e),this[0]=r,this.language=n}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(e){return C._ts_lookahead_iterator_reset_state(this[0],e)}reset(e,r){return C._ts_lookahead_iterator_reset(this[0],e[0],r)?(this.language=e,!0):!1}[Symbol.iterator](){let e=this;return{next(){return C._ts_lookahead_iterator_next(e[0])?{done:!1,value:e.currentType}:{done:!0,value:""}}}}}class Query{static{a(this,"Query")}constructor(e,r,n,o,s,c,l,u){assertInternal(e),this[0]=r,this.captureNames=n,this.textPredicates=o,this.predicates=s,this.setProperties=c,this.assertedProperties=l,this.refutedProperties=u,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_matches_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=new Array(u);this.exceededMatchLimit=!!f;let m=0,g=d;for(let A=0;Av(E))){h[m]={pattern:y,captures:E};let v=this.setProperties[y];v&&(h[m].setProperties=v);let S=this.assertedProperties[y];S&&(h[m].assertedProperties=S);let T=this.refutedProperties[y];T&&(h[m].refutedProperties=T),m++}}return h.length=m,C._free(d),h}captures(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_captures_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=[];this.exceededMatchLimit=!!f;let m=[],g=d;for(let A=0;Av(m))){let v=m[E],S=this.setProperties[y];S&&(v.setProperties=S);let T=this.assertedProperties[y];T&&(v.assertedProperties=T);let w=this.refutedProperties[y];w&&(v.refutedProperties=w),h.push(v)}}return C._free(d),h}predicatesForPattern(e){return this.predicates[e]}disableCapture(e){let r=lengthBytesUTF8(e),n=C._malloc(r+1);stringToUTF8(e,n,r+1),C._ts_query_disable_capture(this[0],n,r),C._free(n)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(t,e,r){let n=r-e,o=t.textCallback(e,null,r);for(e+=o.length;e0)e+=s.length,o+=s;else break}return e>r&&(o=o.slice(0,n)),o}a(getText,"getText");function unmarshalCaptures(t,e,r,n){for(let o=0,s=n.length;o>>0,column:getValue(t+SIZE_OF_INT,"i32")>>>0}}a(unmarshalPoint,"unmarshalPoint");function marshalRange(t,e){marshalPoint(t,e.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,e.endPosition),t+=SIZE_OF_POINT,setValue(t,e.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,e.endIndex,"i32"),t+=SIZE_OF_INT}a(marshalRange,"marshalRange");function unmarshalRange(t){let e={};return e.startPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.endPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.startIndex=getValue(t,"i32")>>>0,t+=SIZE_OF_INT,e.endIndex=getValue(t,"i32")>>>0,e}a(unmarshalRange,"unmarshalRange");function marshalEdit(t){let e=TRANSFER_BUFFER;marshalPoint(e,t.startPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.oldEndPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.newEndPosition),e+=SIZE_OF_POINT,setValue(e,t.startIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.oldEndIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.newEndIndex,"i32"),e+=SIZE_OF_INT}a(marshalEdit,"marshalEdit");for(let t of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,t,{value:ParserImpl.prototype[t],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}}))}}return Parser})();typeof exports=="object"&&(module.exports=TreeSitter)});var Ggn=I((BLu,Hgn)=>{"use strict";p();var P7o=require("path"),D7o=P7o.join(__dirname,"compiled",process.platform,process.arch,"keytar.node");Hgn.exports=require(D7o)});var iAn={};Ti(iAn,{TextDocument:()=>iF});function r7t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);r7t(n,e),r7t(o,e);let s=0,c=0,l=0;for(;sr.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function dqo(t){let e=nAn(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Yze,iF,n7t=Se(()=>{"use strict";p();Yze=class t{static{a(this,"FullTextDocument")}constructor(e,r,n,o){this._uri=e,this._languageId=r,this._version=n,this._content=o,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let o=nAn(n.range),s=this.offsetAt(o.start),c=this.offsetAt(o.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(c,this._content.length);let l=Math.max(o.start.line,0),u=Math.max(o.end.line,0),d=this._lineOffsets,f=tAn(n.text,!1,s);if(u-l===f.length)for(let m=0,g=f.length;me?o=c:n=c+1}let s=n-1;return e=this.ensureBeforeEOL(e,r[s]),{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let o=e.line+1r&&rAn(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}};(function(t){function e(o,s,c,l){return new Yze(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof Yze)return o.update(s,c),o;throw new Error("TextDocument.update: document must be created by TextDocument.create")}a(r,"update"),t.update=r;function n(o,s){let c=o.getText(),l=r7t(s.map(dqo),(f,h)=>{let m=f.range.start.line-h.range.start.line;return m===0?f.range.start.character-h.range.start.character:m}),u=0,d=[];for(let f of l){let h=o.offsetAt(f.range.start);if(hu&&d.push(c.substring(u,h)),f.newText.length&&d.push(f.newText),u=o.offsetAt(f.range.end)}return d.push(c.substr(u)),d.join("")}a(n,"applyEdits"),t.applyEdits=n})(iF||(iF={}));a(r7t,"mergeSort");a(tAn,"computeLineOffsets");a(rAn,"isEOL");a(nAn,"getWellformedRange");a(dqo,"getWellformedEdit")});var oYe=I(lm=>{"use strict";p();Object.defineProperty(lm,"__esModule",{value:!0});lm.thenable=lm.typedArray=lm.stringArray=lm.array=lm.func=lm.error=lm.number=lm.string=lm.boolean=void 0;function gqo(t){return t===!0||t===!1}a(gqo,"boolean");lm.boolean=gqo;function hyn(t){return typeof t=="string"||t instanceof String}a(hyn,"string");lm.string=hyn;function Aqo(t){return typeof t=="number"||t instanceof Number}a(Aqo,"number");lm.number=Aqo;function yqo(t){return t instanceof Error}a(yqo,"error");lm.error=yqo;function myn(t){return typeof t=="function"}a(myn,"func");lm.func=myn;function gyn(t){return Array.isArray(t)}a(gyn,"array");lm.array=gyn;function _qo(t){return gyn(t)&&t.every(e=>hyn(e))}a(_qo,"stringArray");lm.stringArray=_qo;function Eqo(t,e){return Array.isArray(t)&&t.every(e)}a(Eqo,"typedArray");lm.typedArray=Eqo;function vqo(t){return t&&myn(t.then)}a(vqo,"thenable");lm.thenable=vqo});var v7t=I(dw=>{"use strict";p();Object.defineProperty(dw,"__esModule",{value:!0});dw.generateUuid=dw.parse=dw.isUUID=dw.v4=dw.empty=void 0;var ewe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},twe=class t extends ewe{static{a(this,"V4UUID")}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};twe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];twe._timeHighBits=["8","9","a","b"];dw.empty=new ewe("00000000-0000-0000-0000-000000000000");function Ayn(){return new twe}a(Ayn,"v4");dw.v4=Ayn;var Cqo=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function yyn(t){return Cqo.test(t)}a(yyn,"isUUID");dw.isUUID=yyn;function bqo(t){if(!yyn(t))throw new Error("invalid uuid");return new ewe(t)}a(bqo,"parse");dw.parse=bqo;function Sqo(){return Ayn().asHex()}a(Sqo,"generateUuid");dw.generateUuid=Sqo});var _yn=I(mq=>{"use strict";p();Object.defineProperty(mq,"__esModule",{value:!0});mq.attachPartialResult=mq.ProgressFeature=mq.attachWorkDone=void 0;var hq=ii(),Tqo=v7t(),GK=class t{static{a(this,"WorkDoneProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,o){let s={kind:"begin",title:e,percentage:r,message:n,cancellable:o};this._connection.sendProgress(hq.WorkDoneProgress.type,this._token,s)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(hq.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(hq.WorkDoneProgress.type,this._token,{kind:"end"})}};GK.Instances=new Map;var sYe=class extends GK{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new hq.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},rwe=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},aYe=class extends rwe{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new hq.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function Iqo(t,e){if(e===void 0||e.workDoneToken===void 0)return new rwe;let r=e.workDoneToken;return delete e.workDoneToken,new GK(t,r)}a(Iqo,"attachWorkDone");mq.attachWorkDone=Iqo;var xqo=a(t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(hq.WorkDoneProgressCancelNotification.type,r=>{let n=GK.Instances.get(r.token);(n instanceof sYe||n instanceof aYe)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new rwe:new GK(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,Tqo.generateUuid)();return this.connection.sendRequest(hq.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new sYe(this.connection,e))}else return Promise.resolve(new aYe)}},"ProgressFeature");mq.ProgressFeature=xqo;var C7t;(function(t){t.type=new hq.ProgressType})(C7t||(C7t={}));var b7t=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(C7t.type,this._token,e)}};function wqo(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new b7t(t,r)}a(wqo,"attachPartialResult");mq.attachPartialResult=wqo});var Eyn=I(cYe=>{"use strict";p();Object.defineProperty(cYe,"__esModule",{value:!0});cYe.ConfigurationFeature=void 0;var Rqo=ii(),kqo=oYe(),Pqo=a(t=>class extends t{getConfiguration(e){return e?kqo.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(Rqo.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");cYe.ConfigurationFeature=Pqo});var vyn=I(uYe=>{"use strict";p();Object.defineProperty(uYe,"__esModule",{value:!0});uYe.WorkspaceFoldersFeature=void 0;var lYe=ii(),Dqo=a(t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new lYe.Emitter,this.connection.onNotification(lYe.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(lYe.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(lYe.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");uYe.WorkspaceFoldersFeature=Dqo});var Cyn=I(dYe=>{"use strict";p();Object.defineProperty(dYe,"__esModule",{value:!0});dYe.CallHierarchyFeature=void 0;var S7t=ii(),Nqo=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(S7t.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=S7t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onIncomingCalls"),onOutgoingCalls:a(e=>{let r=S7t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");dYe.CallHierarchyFeature=Nqo});var I7t=I(gq=>{"use strict";p();Object.defineProperty(gq,"__esModule",{value:!0});gq.SemanticTokensBuilder=gq.SemanticTokensDiff=gq.SemanticTokensFeature=void 0;var fYe=ii(),Mqo=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(fYe.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=fYe.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on"),onDelta:a(e=>{let r=fYe.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onDelta"),onRange:a(e=>{let r=fYe.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");gq.SemanticTokensFeature=Mqo;var pYe=class{static{a(this,"SemanticTokensDiff")}constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n=n&&s>=n&&this.originalSequence[o]===this.modifiedSequence[s];)o--,s--;(o0&&(c-=this._prevLine,c===0&&(l-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=l,this._data[this._dataLen++]=n,this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=r}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new pYe(this._prevData,this._data).computeDiff()}:this.build()}};gq.SemanticTokensBuilder=T7t});var byn=I(hYe=>{"use strict";p();Object.defineProperty(hYe,"__esModule",{value:!0});hYe.ShowDocumentFeature=void 0;var Oqo=ii(),Lqo=a(t=>class extends t{showDocument(e){return this.connection.sendRequest(Oqo.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");hYe.ShowDocumentFeature=Lqo});var Syn=I(mYe=>{"use strict";p();Object.defineProperty(mYe,"__esModule",{value:!0});mYe.FileOperationsFeature=void 0;var Eue=ii(),Bqo=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Eue.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Eue.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Eue.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Eue.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Eue.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Eue.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");mYe.FileOperationsFeature=Bqo});var Tyn=I(gYe=>{"use strict";p();Object.defineProperty(gYe,"__esModule",{value:!0});gYe.LinkedEditingRangeFeature=void 0;var Fqo=ii(),Uqo=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(Fqo.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");gYe.LinkedEditingRangeFeature=Uqo});var Iyn=I(AYe=>{"use strict";p();Object.defineProperty(AYe,"__esModule",{value:!0});AYe.TypeHierarchyFeature=void 0;var x7t=ii(),Qqo=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(x7t.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=x7t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSupertypes"),onSubtypes:a(e=>{let r=x7t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");AYe.TypeHierarchyFeature=Qqo});var wyn=I(yYe=>{"use strict";p();Object.defineProperty(yYe,"__esModule",{value:!0});yYe.InlineValueFeature=void 0;var xyn=ii(),qqo=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(xyn.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(xyn.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");yYe.InlineValueFeature=qqo});var kyn=I(_Ye=>{"use strict";p();Object.defineProperty(_Ye,"__esModule",{value:!0});_Ye.FoldingRangeFeature=void 0;var Ryn=ii(),jqo=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(Ryn.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=Ryn.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");_Ye.FoldingRangeFeature=jqo});var Pyn=I(EYe=>{"use strict";p();Object.defineProperty(EYe,"__esModule",{value:!0});EYe.InlayHintFeature=void 0;var w7t=ii(),Hqo=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest(w7t.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(w7t.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest(w7t.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");EYe.InlayHintFeature=Hqo});var Dyn=I(vYe=>{"use strict";p();Object.defineProperty(vYe,"__esModule",{value:!0});vYe.DiagnosticFeature=void 0;var nwe=ii(),Gqo=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest(nwe.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(nwe.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(nwe.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest(nwe.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(nwe.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");vYe.DiagnosticFeature=Gqo});var k7t=I(CYe=>{"use strict";p();Object.defineProperty(CYe,"__esModule",{value:!0});CYe.TextDocuments=void 0;var $K=ii(),R7t=class{static{a(this,"TextDocuments")}constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new $K.Emitter,this._onDidOpen=new $K.Emitter,this._onDidClose=new $K.Emitter,this._onDidSave=new $K.Emitter,this._onWillSave=new $K.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=$K.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let o=n.textDocument,s=this._configuration.create(o.uri,o.languageId,o.version,o.text);this._syncedDocuments.set(o.uri,s);let c=Object.freeze({document:s});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),r.push(e.onDidChangeTextDocument(n=>{let o=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let l=this._syncedDocuments.get(o.uri);l!==void 0&&(l=this._configuration.update(l,s,c),this._syncedDocuments.set(o.uri,l),this._onDidChangeContent.fire(Object.freeze({document:l})))})),r.push(e.onDidCloseTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:o})))})),r.push(e.onWillSaveTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&this._onWillSave.fire(Object.freeze({document:o,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,o)=>{let s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),o):[]})),r.push(e.onDidSaveTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&this._onDidSave.fire(Object.freeze({document:o}))})),$K.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};CYe.TextDocuments=R7t});var D7t=I(vue=>{"use strict";p();Object.defineProperty(vue,"__esModule",{value:!0});vue.NotebookDocuments=vue.NotebookSyncFeature=void 0;var fw=ii(),Nyn=k7t(),$qo=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(fw.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(fw.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(fw.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(fw.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");vue.NotebookSyncFeature=$qo;var bYe=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,fw.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,fw.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,fw.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};bYe.NULL_DISPOSE=Object.freeze({dispose:a(()=>{},"dispose")});var P7t=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof Nyn.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Nyn.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new fw.Emitter,this._onDidChange=new fw.Emitter,this._onDidSave=new fw.Emitter,this._onDidClose=new fw.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new bYe,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(o=>{this.notebookDocuments.set(o.notebookDocument.uri,o.notebookDocument);for(let s of o.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(o.notebookDocument),this._onDidOpen.fire(o.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);if(s===void 0)return;s.version=o.notebookDocument.version;let c=s.metadata,l=!1,u=o.change;u.metadata!==void 0&&(l=!0,s.metadata=u.metadata);let d=[],f=[],h=[],m=[];if(u.cells!==void 0){let E=u.cells;if(E.structure!==void 0){let v=E.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),E.structure.didOpen!==void 0)for(let S of E.structure.didOpen)r.openTextDocument({textDocument:S}),d.push(S.uri);if(E.structure.didClose)for(let S of E.structure.didClose)r.closeTextDocument({textDocument:S}),f.push(S.uri)}if(E.data!==void 0){let v=new Map(E.data.map(S=>[S.document,S]));for(let S=0;S<=s.cells.length;S++){let T=v.get(s.cells[S].document);if(T!==void 0){let w=s.cells.splice(S,1,T);if(h.push({old:w[0],new:T}),v.delete(T.document),v.size===0)break}}}if(E.textContent!==void 0)for(let v of E.textContent)r.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),m.push(v.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};l&&(g.metadata={old:c,new:s.metadata});let A=[];for(let E of d)A.push(this.getNotebookCell(E));let y=[];for(let E of f)y.push(this.getNotebookCell(E));let _=[];for(let E of m)_.push(this.getNotebookCell(E));(A.length>0||y.length>0||h.length>0||_.length>0)&&(g.cells={added:A,removed:y,changed:{data:h,textContent:_}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let c of o.cellTextDocuments)r.closeTextDocument({textDocument:c});this.notebookDocuments.delete(o.notebookDocument.uri);for(let c of s.cells)this.notebookCellMap.delete(c.document)}})),fw.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};vue.NotebookDocuments=P7t});var Myn=I(SYe=>{"use strict";p();Object.defineProperty(SYe,"__esModule",{value:!0});SYe.MonikerFeature=void 0;var Vqo=ii(),Wqo=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=Vqo.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");SYe.MonikerFeature=Wqo});var F7t=I(Tc=>{"use strict";p();Object.defineProperty(Tc,"__esModule",{value:!0});Tc.createConnection=Tc.combineFeatures=Tc.combineNotebooksFeatures=Tc.combineLanguagesFeatures=Tc.combineWorkspaceFeatures=Tc.combineWindowFeatures=Tc.combineClientFeatures=Tc.combineTracerFeatures=Tc.combineTelemetryFeatures=Tc.combineConsoleFeatures=Tc._NotebooksImpl=Tc._LanguagesImpl=Tc.BulkUnregistration=Tc.BulkRegistration=Tc.ErrorMessageTracker=void 0;var Xr=ii(),pw=oYe(),M7t=v7t(),xo=_yn(),zqo=Eyn(),Yqo=vyn(),Kqo=Cyn(),Jqo=I7t(),Zqo=byn(),Xqo=Syn(),ejo=Tyn(),tjo=Iyn(),rjo=wyn(),njo=kyn(),ijo=Pyn(),ojo=Dyn(),sjo=D7t(),ajo=Myn();function N7t(t){if(t!==null)return t}a(N7t,"null2Undefined");var O7t=class{static{a(this,"ErrorMessageTracker")}constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};Tc.ErrorMessageTracker=O7t;var TYe=class{static{a(this,"RemoteConsoleImpl")}constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(Xr.MessageType.Error,e)}warn(e){this.send(Xr.MessageType.Warning,e)}info(e){this.send(Xr.MessageType.Info,e)}log(e){this.send(Xr.MessageType.Log,e)}debug(e){this.send(Xr.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Xr.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Xr.RAL)().console.error("Sending log message failed")})}},L7t=class{static{a(this,"_RemoteWindowImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...r){let n={type:Xr.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Xr.ShowMessageRequest.type,n).then(N7t)}showWarningMessage(e,...r){let n={type:Xr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Xr.ShowMessageRequest.type,n).then(N7t)}showInformationMessage(e,...r){let n={type:Xr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Xr.ShowMessageRequest.type,n).then(N7t)}},Oyn=(0,Zqo.ShowDocumentFeature)((0,xo.ProgressFeature)(L7t)),Lyn;(function(t){function e(){return new IYe}a(e,"create"),t.create=e})(Lyn||(Tc.BulkRegistration=Lyn={}));var IYe=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=pw.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=M7t.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},Byn;(function(t){function e(){return new iwe(void 0,[])}a(e,"create"),t.create=e})(Byn||(Tc.BulkUnregistration=Byn={}));var iwe=class{static{a(this,"BulkUnregistrationImpl")}constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(Xr.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=pw.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let o={unregisterations:[n]};return this._connection.sendRequest(Xr.UnregistrationRequest.type,o).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},xYe=class{static{a(this,"RemoteClientImpl")}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,r,n){return e instanceof IYe?this.registerMany(e):e instanceof iwe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=pw.string(r)?r:r.method,s=M7t.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Xr.RegistrationRequest.type,c).then(l=>(e.add({id:s,method:o}),e),l=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(l)))}registerSingle2(e,r){let n=pw.string(e)?e:e.method,o=M7t.generateUuid(),s={registrations:[{id:o,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Xr.RegistrationRequest.type,s).then(c=>Xr.Disposable.create(()=>{this.unregisterSingle(o,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${o} failed.`)})}),c=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(c)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(Xr.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(Xr.RegistrationRequest.type,r).then(()=>new iwe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},B7t=class{static{a(this,"_RemoteWorkspaceImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function r(o){return o&&!!o.edit}a(r,"isApplyWorkspaceEditParams");let n=r(e)?e:{edit:e};return this.connection.sendRequest(Xr.ApplyWorkspaceEditRequest.type,n)}},Fyn=(0,Xqo.FileOperationsFeature)((0,Yqo.WorkspaceFoldersFeature)((0,zqo.ConfigurationFeature)(B7t))),wYe=class{static{a(this,"TracerImpl")}constructor(){this._trace=Xr.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,r){this._trace!==Xr.Trace.Off&&this.connection.sendNotification(Xr.LogTraceNotification.type,{message:e,verbose:this._trace===Xr.Trace.Verbose?r:void 0}).catch(()=>{})}},RYe=class{static{a(this,"TelemetryImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(Xr.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},kYe=class{static{a(this,"_LanguagesImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,xo.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,xo.attachPartialResult)(this.connection,r)}};Tc._LanguagesImpl=kYe;var Uyn=(0,njo.FoldingRangeFeature)((0,ajo.MonikerFeature)((0,ojo.DiagnosticFeature)((0,ijo.InlayHintFeature)((0,rjo.InlineValueFeature)((0,tjo.TypeHierarchyFeature)((0,ejo.LinkedEditingRangeFeature)((0,Jqo.SemanticTokensFeature)((0,Kqo.CallHierarchyFeature)(kYe))))))))),PYe=class{static{a(this,"_NotebooksImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,xo.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,xo.attachPartialResult)(this.connection,r)}};Tc._NotebooksImpl=PYe;var Qyn=(0,sjo.NotebookSyncFeature)(PYe);function qyn(t,e){return function(r){return e(t(r))}}a(qyn,"combineConsoleFeatures");Tc.combineConsoleFeatures=qyn;function jyn(t,e){return function(r){return e(t(r))}}a(jyn,"combineTelemetryFeatures");Tc.combineTelemetryFeatures=jyn;function Hyn(t,e){return function(r){return e(t(r))}}a(Hyn,"combineTracerFeatures");Tc.combineTracerFeatures=Hyn;function Gyn(t,e){return function(r){return e(t(r))}}a(Gyn,"combineClientFeatures");Tc.combineClientFeatures=Gyn;function $yn(t,e){return function(r){return e(t(r))}}a($yn,"combineWindowFeatures");Tc.combineWindowFeatures=$yn;function Vyn(t,e){return function(r){return e(t(r))}}a(Vyn,"combineWorkspaceFeatures");Tc.combineWorkspaceFeatures=Vyn;function Wyn(t,e){return function(r){return e(t(r))}}a(Wyn,"combineLanguagesFeatures");Tc.combineLanguagesFeatures=Wyn;function zyn(t,e){return function(r){return e(t(r))}}a(zyn,"combineNotebooksFeatures");Tc.combineNotebooksFeatures=zyn;function cjo(t,e){function r(o,s,c){return o&&s?c(o,s):o||s}return a(r,"combine"),{__brand:"features",console:r(t.console,e.console,qyn),tracer:r(t.tracer,e.tracer,Hyn),telemetry:r(t.telemetry,e.telemetry,jyn),client:r(t.client,e.client,Gyn),window:r(t.window,e.window,$yn),workspace:r(t.workspace,e.workspace,Vyn),languages:r(t.languages,e.languages,Wyn),notebooks:r(t.notebooks,e.notebooks,zyn)}}a(cjo,"combineFeatures");Tc.combineFeatures=cjo;function ljo(t,e,r){let n=r&&r.console?new(r.console(TYe)):new TYe,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(wYe)):new wYe,c=r&&r.telemetry?new(r.telemetry(RYe)):new RYe,l=r&&r.client?new(r.client(xYe)):new xYe,u=r&&r.window?new(r.window(Oyn)):new Oyn,d=r&&r.workspace?new(r.workspace(Fyn)):new Fyn,f=r&&r.languages?new(r.languages(Uyn)):new Uyn,h=r&&r.notebooks?new(r.notebooks(Qyn)):new Qyn,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:pw.thenable(v)?new Promise((S,T)=>{v.then(w=>S(w),w=>T(w))}):Promise.resolve(v)}a(g,"asPromise");let A,y,_,E={listen:a(()=>o.listen(),"listen"),sendRequest:a((v,...S)=>o.sendRequest(pw.string(v)?v:v.method,...S),"sendRequest"),onRequest:a((v,S)=>o.onRequest(v,S),"onRequest"),sendNotification:a((v,S)=>{let T=pw.string(v)?v:v.method;return o.sendNotification(T,S)},"sendNotification"),onNotification:a((v,S)=>o.onNotification(v,S),"onNotification"),onProgress:o.onProgress,sendProgress:o.sendProgress,onInitialize:a(v=>(y=v,{dispose:a(()=>{y=void 0},"dispose")}),"onInitialize"),onInitialized:a(v=>o.onNotification(Xr.InitializedNotification.type,v),"onInitialized"),onShutdown:a(v=>(A=v,{dispose:a(()=>{A=void 0},"dispose")}),"onShutdown"),onExit:a(v=>(_=v,{dispose:a(()=>{_=void 0},"dispose")}),"onExit"),get console(){return n},get telemetry(){return c},get tracer(){return s},get client(){return l},get window(){return u},get workspace(){return d},get languages(){return f},get notebooks(){return h},onDidChangeConfiguration:a(v=>o.onNotification(Xr.DidChangeConfigurationNotification.type,v),"onDidChangeConfiguration"),onDidChangeWatchedFiles:a(v=>o.onNotification(Xr.DidChangeWatchedFilesNotification.type,v),"onDidChangeWatchedFiles"),__textDocumentSync:void 0,onDidOpenTextDocument:a(v=>o.onNotification(Xr.DidOpenTextDocumentNotification.type,v),"onDidOpenTextDocument"),onDidChangeTextDocument:a(v=>o.onNotification(Xr.DidChangeTextDocumentNotification.type,v),"onDidChangeTextDocument"),onDidCloseTextDocument:a(v=>o.onNotification(Xr.DidCloseTextDocumentNotification.type,v),"onDidCloseTextDocument"),onWillSaveTextDocument:a(v=>o.onNotification(Xr.WillSaveTextDocumentNotification.type,v),"onWillSaveTextDocument"),onWillSaveTextDocumentWaitUntil:a(v=>o.onRequest(Xr.WillSaveTextDocumentWaitUntilRequest.type,v),"onWillSaveTextDocumentWaitUntil"),onDidSaveTextDocument:a(v=>o.onNotification(Xr.DidSaveTextDocumentNotification.type,v),"onDidSaveTextDocument"),sendDiagnostics:a(v=>o.sendNotification(Xr.PublishDiagnosticsNotification.type,v),"sendDiagnostics"),onHover:a(v=>o.onRequest(Xr.HoverRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Xr.CompletionRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onCompletion"),onCompletionResolve:a(v=>o.onRequest(Xr.CompletionResolveRequest.type,v),"onCompletionResolve"),onSignatureHelp:a(v=>o.onRequest(Xr.SignatureHelpRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Xr.DeclarationRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Xr.DefinitionRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Xr.TypeDefinitionRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Xr.ImplementationRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onImplementation"),onReferences:a(v=>o.onRequest(Xr.ReferencesRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Xr.DocumentHighlightRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Xr.DocumentSymbolRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Xr.WorkspaceSymbolRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onWorkspaceSymbol"),onWorkspaceSymbolResolve:a(v=>o.onRequest(Xr.WorkspaceSymbolResolveRequest.type,v),"onWorkspaceSymbolResolve"),onCodeAction:a(v=>o.onRequest(Xr.CodeActionRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onCodeAction"),onCodeActionResolve:a(v=>o.onRequest(Xr.CodeActionResolveRequest.type,(S,T)=>v(S,T)),"onCodeActionResolve"),onCodeLens:a(v=>o.onRequest(Xr.CodeLensRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onCodeLens"),onCodeLensResolve:a(v=>o.onRequest(Xr.CodeLensResolveRequest.type,(S,T)=>v(S,T)),"onCodeLensResolve"),onDocumentFormatting:a(v=>o.onRequest(Xr.DocumentFormattingRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Xr.DocumentRangeFormattingRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),void 0)),"onDocumentRangeFormatting"),onDocumentOnTypeFormatting:a(v=>o.onRequest(Xr.DocumentOnTypeFormattingRequest.type,(S,T)=>v(S,T)),"onDocumentOnTypeFormatting"),onRenameRequest:a(v=>o.onRequest(Xr.RenameRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),void 0)),"onRenameRequest"),onPrepareRename:a(v=>o.onRequest(Xr.PrepareRenameRequest.type,(S,T)=>v(S,T)),"onPrepareRename"),onDocumentLinks:a(v=>o.onRequest(Xr.DocumentLinkRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onDocumentLinks"),onDocumentLinkResolve:a(v=>o.onRequest(Xr.DocumentLinkResolveRequest.type,(S,T)=>v(S,T)),"onDocumentLinkResolve"),onDocumentColor:a(v=>o.onRequest(Xr.DocumentColorRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Xr.ColorPresentationRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Xr.FoldingRangeRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Xr.SelectionRangeRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),(0,xo.attachPartialResult)(o,S))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Xr.ExecuteCommandRequest.type,(S,T)=>v(S,T,(0,xo.attachWorkDone)(o,S),void 0)),"onExecuteCommand"),dispose:a(()=>o.dispose(),"dispose")};for(let v of m)v.attach(E);return o.onRequest(Xr.InitializeRequest.type,v=>{e.initialize(v),pw.string(v.trace)&&(s.trace=Xr.Trace.fromString(v.trace));for(let S of m)S.initialize(v.capabilities);if(y){let S=y(v,new Xr.CancellationTokenSource().token,(0,xo.attachWorkDone)(o,v),void 0);return g(S).then(T=>{if(T instanceof Xr.ResponseError)return T;let w=T;w||(w={capabilities:{}});let R=w.capabilities;R||(R={},w.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=pw.number(E.__textDocumentSync)?E.__textDocumentSync:Xr.TextDocumentSyncKind.None:!pw.number(R.textDocumentSync)&&!pw.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=pw.number(E.__textDocumentSync)?E.__textDocumentSync:Xr.TextDocumentSyncKind.None);for(let x of m)x.fillServerCapabilities(R);return w})}else{let S={capabilities:{textDocumentSync:Xr.TextDocumentSyncKind.None}};for(let T of m)T.fillServerCapabilities(S.capabilities);return S}}),o.onRequest(Xr.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new Xr.CancellationTokenSource().token)}),o.onNotification(Xr.ExitNotification.type,()=>{try{_&&_()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),o.onNotification(Xr.SetTraceNotification.type,v=>{s.trace=Xr.Trace.fromString(v.value)}),E}a(ljo,"createConnection");Tc.createConnection=ljo});var Yyn=I(eb=>{"use strict";p();Object.defineProperty(eb,"__esModule",{value:!0});eb.resolveModulePath=eb.FileSystem=eb.resolveGlobalYarnPath=eb.resolveGlobalNodePath=eb.resolve=eb.uriToFilePath=void 0;var ujo=require("url"),o2=require("path"),U7t=require("fs"),H7t=require("child_process");function djo(t){let e=ujo.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,o=r.length;n1){let s=r[0],c=r[1];s.length===0&&c.length>1&&c[1]===":"&&r.shift()}return o2.normalize(r.join("/"))}a(djo,"uriToFilePath");eb.uriToFilePath=djo;function Q7t(){return process.platform==="win32"}a(Q7t,"isWindows");function DYe(t,e,r,n){let o="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((c,l)=>{let u=process.env,d=Object.create(null);Object.keys(u).forEach(f=>d[f]=u[f]),e&&U7t.existsSync(e)&&(d[o]?d[o]=e+o2.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,H7t.fork)("",[],{cwd:r,env:d,execArgv:["-e",s]});if(f.pid===void 0){l(new Error(`Starting process to resolve node module ${t} failed`));return}f.on("error",m=>{l(m)}),f.on("message",m=>{m.c==="r"&&(f.send({c:"e"}),m.s?c(m.r):l(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};f.send(h)}catch(f){l(f)}})}a(DYe,"resolve");eb.resolve=DYe;function q7t(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(s=>r[s]=process.env[s]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};Q7t()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,H7t.spawnSync)(e,["config","get","prefix"],n).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let c=s.trim();return t&&t(`'npm config get prefix' value is: ${c}`),c.length>0?Q7t()?o2.join(c,"node_modules"):o2.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(q7t,"resolveGlobalNodePath");eb.resolveGlobalNodePath=q7t;function fjo(t){let e="yarn",r={encoding:"utf8"};Q7t()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,H7t.spawnSync)(e,["global","dir","--json"],r),s=o.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),o.stderr&&t(o.stderr));return}let c=s.trim().split(/\r?\n/);for(let l of c)try{let u=JSON.parse(l);if(u.type==="log")return o2.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(fjo,"resolveGlobalYarnPath");eb.resolveGlobalYarnPath=fjo;var j7t;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!U7t.existsSync(__filename.toUpperCase())||!U7t.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?o2.normalize(s).indexOf(o2.normalize(o))===0:o2.normalize(s).toLowerCase().indexOf(o2.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(j7t||(eb.FileSystem=j7t={}));function pjo(t,e,r,n){return r?(o2.isAbsolute(r)||(r=o2.join(t,r)),DYe(e,r,r,n).then(o=>j7t.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>DYe(e,q7t(n),t,n))):DYe(e,q7t(n),t,n)}a(pjo,"resolveModulePath");eb.resolveModulePath=pjo});var G7t=I((qqu,Kyn)=>{"use strict";p();Kyn.exports=ii()});var Jyn=I(NYe=>{"use strict";p();Object.defineProperty(NYe,"__esModule",{value:!0});NYe.InlineCompletionFeature=void 0;var hjo=ii(),mjo=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(hjo.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");NYe.InlineCompletionFeature=mjo});var e_n=I(v_=>{"use strict";p();var gjo=v_&&v_.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xyn=v_&&v_.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gjo(e,t,r)};Object.defineProperty(v_,"__esModule",{value:!0});v_.ProposedFeatures=v_.NotebookDocuments=v_.TextDocuments=v_.SemanticTokensBuilder=void 0;var Ajo=I7t();Object.defineProperty(v_,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return Ajo.SemanticTokensBuilder},"get")});var yjo=Jyn();Xyn(ii(),v_);var _jo=k7t();Object.defineProperty(v_,"TextDocuments",{enumerable:!0,get:a(function(){return _jo.TextDocuments},"get")});var Ejo=D7t();Object.defineProperty(v_,"NotebookDocuments",{enumerable:!0,get:a(function(){return Ejo.NotebookDocuments},"get")});Xyn(F7t(),v_);var Zyn;(function(t){t.all={__brand:"features",languages:yjo.InlineCompletionFeature}})(Zyn||(v_.ProposedFeatures=Zyn={}))});var Wc=I(hw=>{"use strict";p();var vjo=hw&&hw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i_n=hw&&hw.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vjo(e,t,r)};Object.defineProperty(hw,"__esModule",{value:!0});hw.createConnection=hw.Files=void 0;var t_n=require("node:util"),$7t=oYe(),Cjo=F7t(),owe=Yyn(),VK=G7t();i_n(G7t(),hw);i_n(e_n(),hw);var r_n;(function(t){t.uriToFilePath=owe.uriToFilePath,t.resolveGlobalNodePath=owe.resolveGlobalNodePath,t.resolveGlobalYarnPath=owe.resolveGlobalYarnPath,t.resolve=owe.resolve,t.resolveModulePath=owe.resolveModulePath})(r_n||(hw.Files=r_n={}));var n_n;function MYe(){if(n_n!==void 0)try{n_n.end()}catch{}}a(MYe,"endProtocolConnection");var Cue=!1,o_n;function bjo(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(o_n=setInterval(()=>{try{process.kill(n,0)}catch{MYe(),process.exit(Cue?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;$7t.number(e)&&o_n===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Cue?0:1)}},3e3)},"initialize"),get shutdownReceived(){return Cue},set shutdownReceived(t){Cue=t},exit:a(t=>{MYe(),process.exit(t)},"exit")};function Tjo(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),VK.ConnectionStrategy.is(t)||VK.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),Ijo(s,c,l,o)}a(Tjo,"createConnection");hw.createConnection=Tjo;function Ijo(t,e,r,n){let o=!1;if(!t&&!e&&process.argv.length>2){let u,d,f=process.argv.slice(2);for(let h=0;h{MYe(),process.exit(Cue?0:1)}),u.on("close",()=>{MYe(),process.exit(Cue?0:1)})}let l=a(u=>{let d=(0,VK.createProtocolConnection)(t,e,u,r);return o&&xjo(u),d},"connectionFactory");return(0,Cjo.createConnection)(l,Sjo,n)}a(Ijo,"_createConnection");function xjo(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,t_n.inspect)(o)).join(" ")}a(e,"serialize");let r=new Map;console.assert=a(function(o,...s){if(!o)if(s.length===0)t.error("Assertion failed");else{let[c,...l]=s;t.error(`Assertion failed: ${c} ${e(l)}`)}},"assert"),console.count=a(function(o="default"){let s=String(o),c=r.get(s)??0;c+=1,r.set(s,c),t.log(`${s}: ${s}`)},"count"),console.countReset=a(function(o){o===void 0?r.clear():r.delete(String(o))},"countReset"),console.debug=a(function(...o){t.log(e(o))},"debug"),console.dir=a(function(o,s){t.log((0,t_n.inspect)(o,s))},"dir"),console.log=a(function(...o){t.log(e(o))},"log"),console.error=a(function(...o){t.error(e(o))},"error"),console.trace=a(function(...o){let s=new Error().stack.replace(/(.+\n){2}/,""),c="Trace";o.length!==0&&(c+=`: ${e(o)}`),t.log(`${c} +${s}`)},"trace"),console.warn=a(function(...o){t.warn(e(o))},"warn")}a(xjo,"patchConsole")});var s2=I((Xqu,s_n)=>{"use strict";p();s_n.exports=Wc()});var z_n=I((XHu,W_n)=>{"use strict";p();W_n.exports=a(function(e){if(e===void 0&&(e=2),e>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var r=Error.prepareStackTrace;Error.prepareStackTrace=function(o,s){return s};var n=new Error().stack;if(Error.prepareStackTrace=r,n!==null&&typeof n=="object")return n[e]?n[e].getFileName():void 0},"getCallerFile")});var VEn=I(_g=>{"use strict";p();var wQt=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),HHo=wQt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=void 0;var e=require("node:fs"),r=require("node:fs/promises"),n=a(async(l,u={})=>{let{ignoreErrors:d=!1}=u;try{return s(await(0,r.stat)(l),u)}catch(f){let h=f;if(d||h.code==="EACCES")return!1;throw h}},"q");t.isexe=n;var o=a((l,u={})=>{let{ignoreErrors:d=!1}=u;try{return s((0,e.statSync)(l),u)}catch(f){let h=f;if(d||h.code==="EACCES")return!1;throw h}},"m");t.sync=o;var s=a((l,u)=>l.isFile()&&c(l,u),"d"),c=a((l,u)=>{let d=u.uid??process.getuid?.(),f=u.groups??process.getgroups?.()??[],h=u.gid??process.getgid?.()??f[0];if(d===void 0||h===void 0)throw new Error("cannot get uid or gid");let m=new Set([h,...f]),g=l.mode,A=l.uid,y=l.gid,_=parseInt("100",8),E=parseInt("010",8),v=parseInt("001",8),S=_|E;return!!(g&v||g&E&&m.has(y)||g&_&&A===d||g&S&&d===0)},"A")}),GHo=wQt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=void 0;var e=require("node:fs"),r=require("node:fs/promises"),n=require("node:path"),o=a(async(u,d={})=>{let{ignoreErrors:f=!1}=d;try{return l(await(0,r.stat)(u),u,d)}catch(h){let m=h;if(f||m.code==="EACCES")return!1;throw m}},"F");t.isexe=o;var s=a((u,d={})=>{let{ignoreErrors:f=!1}=d;try{return l((0,e.statSync)(u),u,d)}catch(h){let m=h;if(f||m.code==="EACCES")return!1;throw m}},"L");t.sync=s;var c=a((u,d)=>{let{pathExt:f=process.env.PATHEXT||""}=d,h=f.split(n.delimiter);if(h.indexOf("")!==-1)return!0;for(let m of h){let g=m.toLowerCase(),A=u.substring(u.length-g.length).toLowerCase();if(g&&A===g)return!0}return!1},"B"),l=a((u,d,f)=>u.isFile()&&c(d,f),"y")}),$Ho=wQt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),qEn=_g&&_g.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),VHo=_g&&_g.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jEn=_g&&_g.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"t");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{p();var{isexe:YHo,sync:KHo}=VEn(),{join:JHo,delimiter:ZHo,sep:WEn,posix:zEn}=require("path"),YEn=process.platform==="win32",KEn=new RegExp(`[${zEn.sep}${WEn===zEn.sep?"":WEn}]`.replace(/(\\)/g,"\\$1")),XHo=new RegExp(`^\\.${KEn.source}`),JEn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),ZEn=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=ZHo})=>{let o=t.match(KEn)?[""]:[...YEn?[process.cwd()]:[],...(e||"").split(n)];if(YEn){let s=r||[".EXE",".CMD",".BAT",".COM"].join(n),c=s.split(n).flatMap(l=>[l,l.toLowerCase()]);return t.includes(".")&&c[0]!==""&&c.unshift(""),{pathEnv:o,pathExt:c,pathExtExe:s}}return{pathEnv:o,pathExt:[""]}},"getPathInfo"),XEn=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&XHo.test(e)?e.slice(0,2):"")+JHo(r,e)},"getPathPart"),evn=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=ZEn(t,e),s=[];for(let c of r){let l=XEn(c,t);for(let u of n){let d=l+u;if(await YHo(d,{pathExt:o,ignoreErrors:!0})){if(!e.all)return d;s.push(d)}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw JEn(t)},"which"),eGo=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=ZEn(t,e),s=[];for(let c of r){let l=XEn(c,t);for(let u of n){let d=l+u;if(KHo(d,{pathExt:o,ignoreErrors:!0})){if(!e.all)return d;s.push(d)}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw JEn(t)},"whichSync");tvn.exports=evn;evn.sync=eGo});var Cwe=I((NKu,UCn)=>{"use strict";p();var OCn="[^\\\\/]",F$o="(?=.)",LCn="[^/]",mqt="(?:\\/|$)",BCn="(?:^|\\/)",gqt=`\\.{1,2}${mqt}`,U$o="(?!\\.)",Q$o=`(?!${BCn}${gqt})`,q$o=`(?!\\.{0,1}${mqt})`,j$o=`(?!${gqt})`,H$o="[^.\\/]",G$o=`${LCn}*?`,$$o="/",FCn={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:F$o,QMARK:LCn,END_ANCHOR:mqt,DOTS_SLASH:gqt,NO_DOT:U$o,NO_DOTS:Q$o,NO_DOT_SLASH:q$o,NO_DOTS_SLASH:j$o,QMARK_NO_DOT:H$o,STAR:G$o,START_ANCHOR:BCn,SEP:$$o},V$o={...FCn,SLASH_LITERAL:"[\\\\/]",QMARK:OCn,STAR:`${OCn}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},W$o={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};UCn.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:W$o,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?V$o:FCn}}});var bwe=I(ib=>{"use strict";p();var{REGEX_BACKSLASH:z$o,REGEX_REMOVE_BACKSLASH:Y$o,REGEX_SPECIAL_CHARS:K$o,REGEX_SPECIAL_CHARS_GLOBAL:J$o}=Cwe();ib.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);ib.hasRegexChars=t=>K$o.test(t);ib.isRegexChar=t=>t.length===1&&ib.hasRegexChars(t);ib.escapeRegex=t=>t.replace(J$o,"\\$1");ib.toPosixSlashes=t=>t.replace(z$o,"/");ib.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};ib.removeBackslashes=t=>t.replace(Y$o,e=>e==="\\"?"":e);ib.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?ib.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};ib.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};ib.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};ib.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var WCn=I((BKu,VCn)=>{"use strict";p();var QCn=bwe(),{CHAR_ASTERISK:Aqt,CHAR_AT:Z$o,CHAR_BACKWARD_SLASH:Swe,CHAR_COMMA:X$o,CHAR_DOT:yqt,CHAR_EXCLAMATION_MARK:_qt,CHAR_FORWARD_SLASH:$Cn,CHAR_LEFT_CURLY_BRACE:Eqt,CHAR_LEFT_PARENTHESES:vqt,CHAR_LEFT_SQUARE_BRACKET:eVo,CHAR_PLUS:tVo,CHAR_QUESTION_MARK:qCn,CHAR_RIGHT_CURLY_BRACE:rVo,CHAR_RIGHT_PARENTHESES:jCn,CHAR_RIGHT_SQUARE_BRACKET:nVo}=Cwe(),HCn=a(t=>t===$Cn||t===Swe,"isPathSeparator"),GCn=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),iVo=a((t,e)=>{let r=e||{},n=t.length-1,o=r.parts===!0||r.scanToEnd===!0,s=[],c=[],l=[],u=t,d=-1,f=0,h=0,m=!1,g=!1,A=!1,y=!1,_=!1,E=!1,v=!1,S=!1,T=!1,w=!1,R=0,x,k,D={value:"",depth:0,isGlob:!1},N=a(()=>d>=n,"eos"),O=a(()=>u.charCodeAt(d+1),"peek"),B=a(()=>(x=k,u.charCodeAt(++d)),"advance");for(;d0&&(M=u.slice(0,f),u=u.slice(f),h-=f),q&&A===!0&&h>0?(q=u.slice(0,h),L=u.slice(h)):A===!0?(q="",L=u):q=u,q&&q!==""&&q!=="/"&&q!==u&&HCn(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),r.unescape===!0&&(L&&(L=QCn.removeBackslashes(L)),q&&v===!0&&(q=QCn.removeBackslashes(q)));let U={prefix:M,input:t,start:f,base:q,glob:L,isBrace:m,isBracket:g,isGlob:A,isExtglob:y,isGlobstar:_,negated:S,negatedExtglob:T};if(r.tokens===!0&&(U.maxDepth=0,HCn(k)||c.push(D),U.tokens=c),r.parts===!0||r.tokens===!0){let j;for(let Q=0;Q{"use strict";p();var Twe=Cwe(),fT=bwe(),{MAX_LENGTH:TKe,POSIX_REGEX_SOURCE:oVo,REGEX_NON_SPECIAL_CHARS:sVo,REGEX_SPECIAL_CHARS_BACKREF:aVo,REPLACEMENTS:zCn}=Twe,cVo=a((t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(o=>fT.escapeRegex(o)).join("..")}return r},"expandRange"),Oue=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),YCn=a(t=>{let e=[],r=0,n=0,o=0,s="",c=!1;for(let l of t){if(c===!0){s+=l,c=!1;continue}if(l==="\\"){s+=l,c=!0;continue}if(l==='"'){o=o===1?0:1,s+=l;continue}if(o===0){if(l==="[")r++;else if(l==="]"&&r>0)r--;else if(r===0){if(l==="(")n++;else if(l===")"&&n>0)n--;else if(l==="|"&&n===0){e.push(s),s="";continue}}}s+=l}return e.push(s),e},"splitTopLevel"),lVo=a(t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},"isPlainBranch"),KCn=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(lVo(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),uVo=a(t=>{let e=t.map(KCn).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,o=0,s=!1;for(let c=1;c0){r--;continue}if(!(r>0)){if(l==="("){n++;continue}if(l===")"&&(n--,n===0))return e===!0&&c!==t.length-1?void 0:{type:t[0],body:t.slice(2,c),end:c}}}}},"parseRepeatedExtglob"),dVo=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=KCn(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?fT.escapeRegex(r[0]):`[${r.map(o=>fT.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),fVo=a(t=>{let e=0,r=t.trim(),n=Cqt(r);for(;n;)e++,r=n.body.trim(),n=Cqt(r);return e},"repeatedExtglobRecursion"),pVo=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Twe.DEFAULT_MAX_EXTGLOB_RECURSION,n=YCn(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||uVo(n)))return{risky:!0};for(let o of n){let s=dVo(o);if(s)return{risky:!0,safeOutput:s};if(fVo(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),bqt=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=zCn[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(TKe,r.maxLength):TKe,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},c=[s],l=r.capture?"":"?:",u=Twe.globChars(r.windows),d=Twe.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:m,ONE_CHAR:g,DOTS_SLASH:A,NO_DOT:y,NO_DOT_SLASH:_,NO_DOTS_SLASH:E,QMARK:v,QMARK_NO_DOT:S,STAR:T,START_ANCHOR:w}=u,R=a(me=>`(${l}(?:(?!${w}${me.dot?A:f}).)*?)`,"globstar"),x=r.dot?"":y,k=r.dot?v:S,D=r.bash===!0?R(r):T;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let N={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:c};t=fT.removePrefix(t,N),o=t.length;let O=[],B=[],q=[],M=s,L,U=a(()=>N.index===o-1,"eos"),j=N.peek=(me=1)=>t[N.index+me],Q=N.advance=()=>t[++N.index]||"",Y=a(()=>t.slice(N.index+1),"remaining"),W=a((me="",Oe=0)=>{N.consumed+=me,N.index+=Oe},"consume"),V=a(me=>{N.output+=me.output!=null?me.output:me.value,W(me.value)},"append"),z=a(()=>{let me=1;for(;j()==="!"&&(j(2)!=="("||j(3)==="?");)Q(),N.start++,me++;return me%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),ie=a(me=>{N[me]++,q.push(me)},"increment"),H=a(me=>{N[me]--,q.pop()},"decrement"),re=a(me=>{if(M.type==="globstar"){let Oe=N.braces>0&&(me.type==="comma"||me.type==="brace"),Te=me.extglob===!0||O.length&&(me.type==="pipe"||me.type==="paren");me.type!=="slash"&&me.type!=="paren"&&!Oe&&!Te&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(O.length&&me.type!=="paren"&&(O[O.length-1].inner+=me.value),(me.value||me.output)&&V(me),M&&M.type==="text"&&me.type==="text"){M.output=(M.output||M.value)+me.value,M.value+=me.value;return}me.prev=M,c.push(me),M=me},"push"),le=a((me,Oe)=>{let Te={...d[Oe],conditions:1,inner:""};Te.prev=M,Te.parens=N.parens,Te.output=N.output,Te.startIndex=N.index,Te.tokensIndex=c.length;let te=(r.capture?"(":"")+Te.open;ie("parens"),re({type:me,value:Oe,output:N.output?"":g}),re({type:"paren",extglob:!0,value:Q(),output:te}),O.push(Te)},"extglobOpen"),Le=a(me=>{let Oe=t.slice(me.startIndex,N.index+1),Te=t.slice(me.startIndex+2,N.index),te=pVo(Te,r);if((me.type==="plus"||me.type==="star")&&te.risky){let he=te.safeOutput?(me.output?"":g)+(r.capture?`(${te.safeOutput})`:te.safeOutput):void 0,X=c[me.tokensIndex];X.type="text",X.value=Oe,X.output=he||fT.escapeRegex(Oe);for(let de=me.tokensIndex+1;de1&&me.inner.includes("/")&&(he=R(r)),(he!==D||U()||/^\)+$/.test(Y()))&&(ee=me.close=`)$))${he}`),me.inner.includes("*")&&(K=Y())&&/^\.[^\\/.]+$/.test(K)){let X=bqt(K,{...e,fastpaths:!1}).output;ee=me.close=`)${X})${he})`}me.prev.type==="bos"&&(N.negatedExtglob=!0)}re({type:"paren",extglob:!0,value:L,output:ee}),H("parens")},"extglobClose");if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let me=!1,Oe=t.replace(aVo,(Te,te,ee,K,he,X)=>K==="\\"?(me=!0,Te):K==="?"?te?te+K+(he?v.repeat(he.length):""):X===0?k+(he?v.repeat(he.length):""):v.repeat(ee.length):K==="."?f.repeat(ee.length):K==="*"?te?te+K+(he?D:""):D:te?Te:`\\${Te}`);return me===!0&&(r.unescape===!0?Oe=Oe.replace(/\\/g,""):Oe=Oe.replace(/\\+/g,Te=>Te.length%2===0?"\\\\":Te?"\\":"")),Oe===t&&r.contains===!0?(N.output=t,N):(N.output=fT.wrapOutput(Oe,N,e),N)}for(;!U();){if(L=Q(),L==="\0")continue;if(L==="\\"){let Te=j();if(Te==="/"&&r.bash!==!0||Te==="."||Te===";")continue;if(!Te){L+="\\",re({type:"text",value:L});continue}let te=/^\\+/.exec(Y()),ee=0;if(te&&te[0].length>2&&(ee=te[0].length,N.index+=ee,ee%2!==0&&(L+="\\")),r.unescape===!0?L=Q():L+=Q(),N.brackets===0){re({type:"text",value:L});continue}}if(N.brackets>0&&(L!=="]"||M.value==="["||M.value==="[^")){if(r.posix!==!1&&L===":"){let Te=M.value.slice(1);if(Te.includes("[")&&(M.posix=!0,Te.includes(":"))){let te=M.value.lastIndexOf("["),ee=M.value.slice(0,te),K=M.value.slice(te+2),he=oVo[K];if(he){M.value=ee+he,N.backtrack=!0,Q(),!s.output&&c.indexOf(M)===1&&(s.output=g);continue}}}(L==="["&&j()!==":"||L==="-"&&j()==="]")&&(L=`\\${L}`),L==="]"&&(M.value==="["||M.value==="[^")&&(L=`\\${L}`),r.posix===!0&&L==="!"&&M.value==="["&&(L="^"),M.value+=L,V({value:L});continue}if(N.quotes===1&&L!=='"'){L=fT.escapeRegex(L),M.value+=L,V({value:L});continue}if(L==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&re({type:"text",value:L});continue}if(L==="("){ie("parens"),re({type:"paren",value:L});continue}if(L===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Oue("opening","("));let Te=O[O.length-1];if(Te&&N.parens===Te.parens+1){Le(O.pop());continue}re({type:"paren",value:L,output:N.parens?")":"\\)"}),H("parens");continue}if(L==="["){if(r.nobracket===!0||!Y().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Oue("closing","]"));L=`\\${L}`}else ie("brackets");re({type:"bracket",value:L});continue}if(L==="]"){if(r.nobracket===!0||M&&M.type==="bracket"&&M.value.length===1){re({type:"text",value:L,output:`\\${L}`});continue}if(N.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Oue("opening","["));re({type:"text",value:L,output:`\\${L}`});continue}H("brackets");let Te=M.value.slice(1);if(M.posix!==!0&&Te[0]==="^"&&!Te.includes("/")&&(L=`/${L}`),M.value+=L,V({value:L}),r.literalBrackets===!1||fT.hasRegexChars(Te))continue;let te=fT.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=te,M.value=te;continue}M.value=`(${l}${te}|${M.value})`,N.output+=M.value;continue}if(L==="{"&&r.nobrace!==!0){ie("braces");let Te={type:"brace",value:L,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};B.push(Te),re(Te);continue}if(L==="}"){let Te=B[B.length-1];if(r.nobrace===!0||!Te){re({type:"text",value:L,output:L});continue}let te=")";if(Te.dots===!0){let ee=c.slice(),K=[];for(let he=ee.length-1;he>=0&&(c.pop(),ee[he].type!=="brace");he--)ee[he].type!=="dots"&&K.unshift(ee[he].value);te=cVo(K,r),N.backtrack=!0}if(Te.comma!==!0&&Te.dots!==!0){let ee=N.output.slice(0,Te.outputIndex),K=N.tokens.slice(Te.tokensIndex);Te.value=Te.output="\\{",L=te="\\}",N.output=ee;for(let he of K)N.output+=he.output||he.value}re({type:"brace",value:L,output:te}),H("braces"),B.pop();continue}if(L==="|"){O.length>0&&O[O.length-1].conditions++,re({type:"text",value:L});continue}if(L===","){let Te=L,te=B[B.length-1];te&&q[q.length-1]==="braces"&&(te.comma=!0,Te="|"),re({type:"comma",value:L,output:Te});continue}if(L==="/"){if(M.type==="dot"&&N.index===N.start+1){N.start=N.index+1,N.consumed="",N.output="",c.pop(),M=s;continue}re({type:"slash",value:L,output:m});continue}if(L==="."){if(N.braces>0&&M.type==="dot"){M.value==="."&&(M.output=f);let Te=B[B.length-1];M.type="dots",M.output+=L,M.value+=L,Te.dots=!0;continue}if(N.braces+N.parens===0&&M.type!=="bos"&&M.type!=="slash"){re({type:"text",value:L,output:f});continue}re({type:"dot",value:L,output:f});continue}if(L==="?"){if(!(M&&M.value==="(")&&r.noextglob!==!0&&j()==="("&&j(2)!=="?"){le("qmark",L);continue}if(M&&M.type==="paren"){let te=j(),ee=L;(M.value==="("&&!/[!=<:]/.test(te)||te==="<"&&!/<([!=]|\w+>)/.test(Y()))&&(ee=`\\${L}`),re({type:"text",value:L,output:ee});continue}if(r.dot!==!0&&(M.type==="slash"||M.type==="bos")){re({type:"qmark",value:L,output:S});continue}re({type:"qmark",value:L,output:v});continue}if(L==="!"){if(r.noextglob!==!0&&j()==="("&&(j(2)!=="?"||!/[!=<:]/.test(j(3)))){le("negate",L);continue}if(r.nonegate!==!0&&N.index===0){z();continue}}if(L==="+"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){le("plus",L);continue}if(M&&M.value==="("||r.regex===!1){re({type:"plus",value:L,output:h});continue}if(M&&(M.type==="bracket"||M.type==="paren"||M.type==="brace")||N.parens>0){re({type:"plus",value:L});continue}re({type:"plus",value:h});continue}if(L==="@"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){re({type:"at",extglob:!0,value:L,output:""});continue}re({type:"text",value:L});continue}if(L!=="*"){(L==="$"||L==="^")&&(L=`\\${L}`);let Te=sVo.exec(Y());Te&&(L+=Te[0],N.index+=Te[0].length),re({type:"text",value:L});continue}if(M&&(M.type==="globstar"||M.star===!0)){M.type="star",M.star=!0,M.value+=L,M.output=D,N.backtrack=!0,N.globstar=!0,W(L);continue}let me=Y();if(r.noextglob!==!0&&/^\([^?]/.test(me)){le("star",L);continue}if(M.type==="star"){if(r.noglobstar===!0){W(L);continue}let Te=M.prev,te=Te.prev,ee=Te.type==="slash"||Te.type==="bos",K=te&&(te.type==="star"||te.type==="globstar");if(r.bash===!0&&(!ee||me[0]&&me[0]!=="/")){re({type:"star",value:L,output:""});continue}let he=N.braces>0&&(Te.type==="comma"||Te.type==="brace"),X=O.length&&(Te.type==="pipe"||Te.type==="paren");if(!ee&&Te.type!=="paren"&&!he&&!X){re({type:"star",value:L,output:""});continue}for(;me.slice(0,3)==="/**";){let de=t[N.index+4];if(de&&de!=="/")break;me=me.slice(3),W("/**",3)}if(Te.type==="bos"&&U()){M.type="globstar",M.value+=L,M.output=R(r),N.output=M.output,N.globstar=!0,W(L);continue}if(Te.type==="slash"&&Te.prev.type!=="bos"&&!K&&U()){N.output=N.output.slice(0,-(Te.output+M.output).length),Te.output=`(?:${Te.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=L,N.globstar=!0,N.output+=Te.output+M.output,W(L);continue}if(Te.type==="slash"&&Te.prev.type!=="bos"&&me[0]==="/"){let de=me[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(Te.output+M.output).length),Te.output=`(?:${Te.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${de})`,M.value+=L,N.output+=Te.output+M.output,N.globstar=!0,W(L+Q()),re({type:"slash",value:"/",output:""});continue}if(Te.type==="bos"&&me[0]==="/"){M.type="globstar",M.value+=L,M.output=`(?:^|${m}|${R(r)}${m})`,N.output=M.output,N.globstar=!0,W(L+Q()),re({type:"slash",value:"/",output:""});continue}N.output=N.output.slice(0,-M.output.length),M.type="globstar",M.output=R(r),M.value+=L,N.output+=M.output,N.globstar=!0,W(L);continue}let Oe={type:"star",value:L,output:D};if(r.bash===!0){Oe.output=".*?",(M.type==="bos"||M.type==="slash")&&(Oe.output=x+Oe.output),re(Oe);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===!0){Oe.output=L,re(Oe);continue}(N.index===N.start||M.type==="slash"||M.type==="dot")&&(M.type==="dot"?(N.output+=_,M.output+=_):r.dot===!0?(N.output+=E,M.output+=E):(N.output+=x,M.output+=x),j()!=="*"&&(N.output+=g,M.output+=g)),re(Oe)}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Oue("closing","]"));N.output=fT.escapeLast(N.output,"["),H("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Oue("closing",")"));N.output=fT.escapeLast(N.output,"("),H("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Oue("closing","}"));N.output=fT.escapeLast(N.output,"{"),H("braces")}if(r.strictSlashes!==!0&&(M.type==="star"||M.type==="bracket")&&re({type:"maybe_slash",value:"",output:`${m}?`}),N.backtrack===!0){N.output="";for(let me of N.tokens)N.output+=me.output!=null?me.output:me.value,me.suffix&&(N.output+=me.suffix)}return N},"parse");bqt.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(TKe,r.maxLength):TKe,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=zCn[t]||t;let{DOT_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,DOTS_SLASH:u,NO_DOT:d,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:m,START_ANCHOR:g}=Twe.globChars(r.windows),A=r.dot?f:d,y=r.dot?h:d,_=r.capture?"":"?:",E={negated:!1,prefix:""},v=r.bash===!0?".*?":m;r.capture&&(v=`(${v})`);let S=a(x=>x.noglobstar===!0?v:`(${_}(?:(?!${g}${x.dot?u:s}).)*?)`,"globstar"),T=a(x=>{switch(x){case"*":return`${A}${l}${v}`;case".*":return`${s}${l}${v}`;case"*.*":return`${A}${v}${s}${l}${v}`;case"*/*":return`${A}${v}${c}${l}${y}${v}`;case"**":return A+S(r);case"**/*":return`(?:${A}${S(r)}${c})?${y}${l}${v}`;case"**/*.*":return`(?:${A}${S(r)}${c})?${y}${v}${s}${l}${v}`;case"**/.*":return`(?:${A}${S(r)}${c})?${s}${l}${v}`;default:{let k=/^(.*?)\.(\w+)$/.exec(x);if(!k)return;let D=T(k[1]);return D?D+s+k[2]:void 0}}},"create"),w=fT.removePrefix(t,E),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};JCn.exports=bqt});var tbn=I((HKu,ebn)=>{"use strict";p();var hVo=WCn(),Sqt=ZCn(),XCn=bwe(),mVo=Cwe(),gVo=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),ch=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>ch(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=gVo(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},s=o.windows,c=n?ch.compileRe(t,e):ch.makeRe(t,e,!1,!0),l=c.state;delete c.state;let u=a(()=>!1,"isIgnored");if(o.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};u=ch(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=ch.test(f,c,e,{glob:t,posix:s}),y={glob:t,state:l,regex:c,posix:s,input:f,output:A,match:g,isMatch:m};return typeof o.onResult=="function"&&o.onResult(y),m===!1?(y.isMatch=!1,h?y:!1):u(f)?(typeof o.onIgnore=="function"&&o.onIgnore(y),y.isMatch=!1,h?y:!1):(typeof o.onMatch=="function"&&o.onMatch(y),h?y:!0)},"matcher");return r&&(d.state=l),d},"picomatch");ch.test=(t,e,r,{glob:n,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=r||{},c=s.format||(o?XCn.toPosixSlashes:null),l=t===n,u=l&&c?c(t):t;return l===!1&&(u=c?c(t):t,l=u===n),(l===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?l=ch.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};ch.matchBase=(t,e,r)=>(e instanceof RegExp?e:ch.makeRe(e,r)).test(XCn.basename(t));ch.isMatch=(t,e,r)=>ch(e,r)(t);ch.parse=(t,e)=>Array.isArray(t)?t.map(r=>ch.parse(r,e)):Sqt(t,{...e,fastpaths:!1});ch.scan=(t,e)=>hVo(t,e);ch.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let o=e||{},s=o.contains?"":"^",c=o.contains?"":"$",l=`${s}(?:${t.output})${c}`;t&&t.negated===!0&&(l=`^(?!${l}).*$`);let u=ch.toRegex(l,e);return n===!0&&(u.state=t),u};ch.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=Sqt.fastpaths(t,e)),o.output||(o=Sqt(t,e)),ch.compileRe(o,e,r,n)};ch.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};ch.constants=mVo;ebn.exports=ch});var obn=I((VKu,ibn)=>{"use strict";p();var rbn=tbn(),AVo=bwe();function nbn(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:AVo.isWindows()}),rbn(t,e,r)}a(nbn,"picomatch");Object.assign(nbn,rbn);ibn.exports=nbn});var abn=I((YKu,sbn)=>{p();sbn.exports=a(function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1},"isExtglob")});var ubn=I((ZKu,lbn)=>{p();var yVo=abn(),cbn={"{":"}","(":")","[":"]"},_Vo=a(function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,o=-2,s=-2,c=-2;ee&&(c===-1||c>n||(c=t.indexOf("\\",e),c===-1||c>n)))||o!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(o=t.indexOf("}",e),o>e&&(c=t.indexOf("\\",e),c===-1||c>o))||s!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(s=t.indexOf(")",e),s>e&&(c=t.indexOf("\\",e),c===-1||c>s))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(c=t.indexOf("\\",r),c===-1||c>s))))return!0;if(t[e]==="\\"){var l=t[e+1];e+=2;var u=cbn[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),EVo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var AJ=require("path"),vVo=obn(),CVo=ubn();function IKe(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(o instanceof RegExp){if(o.flags!=="")throw new Error(`RegExp ignore patterns must not have flags (got /${o.source}/${o.flags}). Flags are not supported by the native matcher.`);e.ignoreGlobs||(e.ignoreGlobs=[]),e.ignoreGlobs.push(`^[\\s\\S]*(?:${o.source})[\\s\\S]*$`)}else if(CVo(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=vVo.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(AJ.resolve(t,o))}return e}a(IKe,"normalizeOptions");dbn.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(AJ.resolve(e),AJ.resolve(r),IKe(e,n))},getEventsSince(e,r,n){return t.getEventsSince(AJ.resolve(e),AJ.resolve(r),IKe(e,n))},async subscribe(e,r,n){return e=AJ.resolve(e),n=IKe(e,n),await t.subscribe(e,r,n),{unsubscribe(){return t.unsubscribe(e,r,n)}}},unsubscribe(e,r,n){return t.unsubscribe(AJ.resolve(e),r,IKe(e,n))}})});var pbn=I(Iwe=>{"use strict";p();var bVo=require("path"),{createWrapper:SVo}=fbn();function TVo(){return bVo.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(TVo,"resolveBindingPath");var IVo=require(TVo()),xKe=SVo(IVo);Iwe.writeSnapshot=xKe.writeSnapshot;Iwe.getEventsSince=xKe.getEventsSince;Iwe.subscribe=xKe.subscribe;Iwe.unsubscribe=xKe.unsubscribe});var iv=I(NKe=>{"use strict";p();Object.defineProperty(NKe,"__esModule",{value:!0});NKe.Position=void 0;var Rqt=class t{static{a(this,"Position")}constructor(e,r){this.lineNumber=e,this.column=r}with(e=this.lineNumber,r=this.column){return e===this.lineNumber&&r===this.column?this:new t(e,r)}delta(e=0,r=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+r))}equals(e){return t.equals(this,e)}static equals(e,r){return!e&&!r?!0:!!e&&!!r&&e.lineNumber===r.lineNumber&&e.column===r.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,r){return e.lineNumber{"use strict";p();Object.defineProperty(MKe,"__esModule",{value:!0});MKe.Range=void 0;var _bn=iv(),kqt=class t{static{a(this,"Range")}constructor(e,r,n,o){e>n||e===n&&r>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=r):(this.startLineNumber=e,this.startColumn=r,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.columne.endColumn)}static strictContainsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.column<=e.startColumn||r.lineNumber===e.endLineNumber&&r.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumn<=e.startColumn||r.endLineNumber===e.endLineNumber&&r.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,r){let n,o,s,c;return r.startLineNumbere.endLineNumber?(s=r.endLineNumber,c=r.endColumn):r.endLineNumber===e.endLineNumber?(s=r.endLineNumber,c=Math.max(r.endColumn,e.endColumn)):(s=e.endLineNumber,c=e.endColumn),new t(n,o,s,c)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,r){let n=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,c=e.endColumn,l=r.startLineNumber,u=r.startColumn,d=r.endLineNumber,f=r.endColumn;return nd?(s=d,c=f):s===d&&(c=Math.min(c,f)),n>s||n===s&&o>c?null:new t(n,o,s,c)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,r){return!e&&!r?!0:!!e&&!!r&&e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&e.endLineNumber===r.endLineNumber&&e.endColumn===r.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new _bn.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new _bn.Position(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,r){return new t(this.startLineNumber,this.startColumn,e,r)}setStartPosition(e,r){return new t(e,r,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,r=e){return new t(e.lineNumber,e.column,r.lineNumber,r.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,r){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};MKe.Range=kqt});var vSn=I(yjt=>{"use strict";p();Object.defineProperty(yjt,"__esModule",{value:!0});yjt.assertNever=MWo;function MWo(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(MWo,"assertNever")});var jwe=I(yF=>{"use strict";p();Object.defineProperty(yF,"__esModule",{value:!0});yF.ChatCompletionContentPartOpaque=yF.ChatCompletionContentPartKind=yF.ChatRole=void 0;var OWo=vSn(),cJe;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(cJe||(yF.ChatRole=cJe={}));(function(t){function e(r){switch(r){case t.System:return"system";case t.User:return"user";case t.Assistant:return"assistant";case t.Tool:return"tool";default:(0,OWo.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(cJe||(yF.ChatRole=cJe={}));var CSn;(function(t){t[t.Image=0]="Image",t[t.Text=1]="Text",t[t.Opaque=2]="Opaque",t[t.CacheBreakpoint=3]="CacheBreakpoint",t[t.Document=4]="Document"})(CSn||(yF.ChatCompletionContentPartKind=CSn={}));var bSn;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})(bSn||(yF.ChatCompletionContentPartOpaque=bSn={}))});var _jt=I(XO=>{"use strict";p();Object.defineProperty(XO,"__esModule",{value:!0});XO.BaseTokensPerName=XO.BaseTokensPerMessage=XO.BaseTokensPerCompletion=XO.ChatRole=void 0;var SSn;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(SSn||(XO.ChatRole=SSn={}));XO.BaseTokensPerCompletion=3;XO.BaseTokensPerMessage=3;XO.BaseTokensPerName=1});var wSn=I(uJe=>{"use strict";p();Object.defineProperty(uJe,"__esModule",{value:!0});uJe.toOpenAiChatMessage=xSn;uJe.toOpenAIChatMessages=BWo;var e5=jwe(),lJe=_jt(),LWo=Gq();function TSn(t){return t.filter(e=>e.type===e5.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(TSn,"onlyStringContent");function ISn(t){let e=t.map(r=>{if(r.type===e5.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===e5.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===e5.ChatCompletionContentPartKind.Document)return;if(r.type===e5.ChatCompletionContentPartKind.Opaque&&e5.ChatCompletionContentPartOpaque.usableIn(r,LWo.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(ISn,"stringAndImageContent");function xSn(t){switch(t.role){case e5.ChatRole.System:return{role:lJe.ChatRole.System,content:TSn(t.content),name:t.name};case e5.ChatRole.User:return{role:lJe.ChatRole.User,content:ISn(t.content),name:t.name};case e5.ChatRole.Assistant:return{role:lJe.ChatRole.Assistant,content:TSn(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case e5.ChatRole.Tool:return{role:lJe.ChatRole.Tool,content:ISn(t.content),tool_call_id:t.toolCallId};default:return}}a(xSn,"toOpenAiChatMessage");function BWo(t){return t.map(xSn).filter(e=>!!e)}a(BWo,"toOpenAIChatMessages")});var kSn=I(pJe=>{"use strict";p();Object.defineProperty(pJe,"__esModule",{value:!0});pJe.toVsCodeChatMessage=RSn;pJe.toVsCodeChatMessages=FWo;var fJe=jwe();function dJe(t){return t.filter(e=>e.type===fJe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(dJe,"onlyStringContent");var $q;function RSn(t){switch($q??=require("vscode"),t.role){case fJe.ChatRole.Assistant:let e=$q.LanguageModelChatMessage.Assistant(dJe(t.content),t.name);return t.toolCalls&&(e.content=[new $q.LanguageModelTextPart(dJe(t.content)),...t.toolCalls.map(r=>{let n;try{n=JSON.parse(r.function.arguments)}catch{throw new Error("Invalid JSON in tool call arguments for tool call: "+r.id)}return new $q.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case fJe.ChatRole.User:return $q.LanguageModelChatMessage.User(dJe(t.content),t.name);case fJe.ChatRole.Tool:{let r=$q.LanguageModelChatMessage.User("");return r.content=[new $q.LanguageModelToolResultPart(t.toolCallId,[new $q.LanguageModelTextPart(dJe(t.content))])],r}default:return}}a(RSn,"toVsCodeChatMessage");function FWo(t){return t.map(RSn).filter(e=>!!e)}a(FWo,"toVsCodeChatMessages")});var Gq=I(h2=>{"use strict";p();Object.defineProperty(h2,"__esModule",{value:!0});h2.OutputMode=h2.Raw=h2.OpenAI=void 0;h2.toMode=Ejt;h2.toVSCode=UWo;h2.toOpenAI=QWo;var PSn=wSn(),DSn=kSn();h2.OpenAI=_jt();h2.Raw=jwe();var TJ;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(TJ||(h2.OutputMode=TJ={}));function Ejt(t,e){switch(t){case TJ.Raw:return e;case TJ.VSCode:return e instanceof Array?(0,DSn.toVsCodeChatMessages)(e):(0,DSn.toVsCodeChatMessage)(e);case TJ.OpenAI:return e instanceof Array?(0,PSn.toOpenAIChatMessages)(e):(0,PSn.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(Ejt,"toMode");function UWo(t){return Ejt(TJ.VSCode,t)}a(UWo,"toVSCode");function QWo(t){return Ejt(TJ.OpenAI,t)}a(QWo,"toOpenAI")});var vjt=I(Hwe=>{"use strict";p();Object.defineProperty(Hwe,"__esModule",{value:!0});Hwe.jsonRetainedProps=void 0;Hwe.forEachNode=NSn;Hwe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function NSn(t,e){if(e(t),t.type===1)for(let r of t.children)NSn(r,e)}a(NSn,"forEachNode")});var MSn=I(Cjt=>{"use strict";p();Object.defineProperty(Cjt,"__esModule",{value:!0});Cjt.once=qWo;function qWo(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(qWo,"once")});var Ijt=I(S0=>{"use strict";p();Object.defineProperty(S0,"__esModule",{value:!0});S0.BudgetExceededError=S0.MaterializedChatMessageDocument=S0.MaterializedChatMessageImage=S0.MaterializedChatMessageBreakpoint=S0.MaterializedChatMessageOpaque=S0.MaterializedChatMessage=S0.MaterializedChatMessageTextChunk=S0.GenericMaterializedContainer=void 0;var IJ=MSn(),qA=Gq(),_F=class t{static{a(this,"GenericMaterializedContainer")}parent;id;name;priority;metadata;flags;children;keepWithId;constructor(e,r,n,o,s,c,l){if(this.parent=e,this.id=r,this.name=n,this.priority=o,this.metadata=c,this.flags=l,this.children=s(this),l&8){if(this.children.length!==2)throw new Error("Invalid number of children for EmptyAlternate flag");let[u,d]=this.children;d.isEmpty?this.children=[u]:this.children=[d]}}has(e){return!!(this.flags&e)}async tokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{let o=Wq(n)?await n.tokenCount(e):await n.upperBoundTokenCount(e);r+=o})),r}async upperBoundTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{let o=await n.upperBoundTokenCount(e);r+=o})),r}replaceNode(e,r){return HSn(e,this.children,r)}allMetadata(){return jSn(this)}findById(e){return Tjt(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)jWo(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof g2&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof g2||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return Sjt(this,e),e}};S0.GenericMaterializedContainer=_F;var Gwe=class{static{a(this,"MaterializedChatMessageTextChunk")}parent;text;priority;metadata;lineBreakBefore;constructor(e,r,n,o=[],s){this.parent=e,this.text=r,this.priority=n,this.metadata=o,this.lineBreakBefore=s}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,IJ.once)(async e=>await e.tokenLength({type:qA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};S0.MaterializedChatMessageTextChunk=Gwe;var g2=class{static{a(this,"MaterializedChatMessage")}parent;id;role;name;toolCalls;toolCallId;priority;metadata;children;constructor(e,r,n,o,s,c,l,u,d){this.parent=e,this.id=r,this.role=n,this.name=o,this.toolCalls=s,this.toolCallId=c,this.priority=l,this.metadata=u,this.children=d(this)}async tokenCount(e){return this._tokenCount(e)}async upperBoundTokenCount(e){return this._upperBound(e)}get text(){return this._text()}get isEmpty(){return!this.toolCalls?.length&&!this.children.some(e=>!e.isEmpty)}replaceNode(e,r){let n=HSn(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return Sjt(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return Tjt(e,this)}_tokenCount=(0,IJ.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,qA.toMode)(e.mode,r))});_upperBound=(0,IJ.once)(async e=>{let r=await this.baseMessageTokenCount(e);return await Promise.all(this.children.map(async n=>{let o=await n.upperBoundTokenCount(e);r+=o})),r});baseMessageTokenCount=(0,IJ.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===qA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===qA.Raw.ChatCompletionContentPartKind.Image||n.type===qA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,qA.toMode)(e.mode,r))});_text=(0,IJ.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of QSn(this)){if(r instanceof xJ||r instanceof wJ||r instanceof Vq){e.push(r);continue}if(r instanceof m2){e.at(-1)instanceof m2?e[e.length-1]=r:e.push(r);continue}if(r.lineBreakBefore===1||r.lineBreakBefore===2&&!n){let o=e[e.length-1];typeof o=="string"&&o&&!o.endsWith(` `)&&(e[e.length-1]=o+` -`)}typeof e[e.length-1]=="string"?e[e.length-1]+=r.text:e.push(r.text)}return e});toChatMessage(){let e=this.text.map(r=>{if(typeof r=="string")return{type:qA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof IJ)return{type:qA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:HSn(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof xJ)return{type:qA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof Vq)return{type:qA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof m2)return r.part;throw new Error("Unexpected element type")});if(this.role===qA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===qA.Raw.ChatRole.Assistant){let r={role:this.role,content:e};return this.name&&(r.name=this.name),this.toolCalls?.length&&(r.toolCalls=this.toolCalls.map(n=>({function:n.function,id:n.id,type:n.type}))),r}else return this.role===qA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===qA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};b0.MaterializedChatMessage=g2;var Vq=class{static{a(this,"MaterializedChatMessageOpaque")}parent;part;priority;metadata=[];get value(){return this.part.value}constructor(e,r,n=Number.MAX_SAFE_INTEGER){this.parent=e,this.part=r,this.priority=n}upperBoundTokenCount(e){return this.part.tokenUsage&&qA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};b0.MaterializedChatMessageOpaque=Vq;var m2=class{static{a(this,"MaterializedChatMessageBreakpoint")}parent;part;metadata=[];priority=Number.MAX_SAFE_INTEGER;constructor(e,r){this.parent=e,this.part=r}upperBoundTokenCount(e){return 0}isEmpty=!1};b0.MaterializedChatMessageBreakpoint=m2;var IJ=class{static{a(this,"MaterializedChatMessageImage")}parent;id;src;priority;metadata;lineBreakBefore;detail;mimeType;constructor(e,r,n,o,s=[],c,l,u){this.parent=e,this.id=r,this.src=n,this.priority=o,this.metadata=s,this.lineBreakBefore=c,this.detail=l,this.mimeType=u}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,TJ.once)(async e=>e.tokenLength({type:qA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:HSn(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};b0.MaterializedChatMessageImage=IJ;var xJ=class{static{a(this,"MaterializedChatMessageDocument")}parent;id;data;mediaType;priority;metadata;lineBreakBefore;constructor(e,r,n,o,s,c=[],l){this.parent=e,this.id=r,this.data=n,this.mediaType=o,this.priority=s,this.metadata=c,this.lineBreakBefore=l}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,TJ.once)(async e=>e.tokenLength({type:qA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};b0.MaterializedChatMessageDocument=xJ;function Wq(t){return t instanceof _F||t instanceof g2}a(Wq,"isContainerType");function FSn(t){return t instanceof Gwe||t instanceof IJ||t instanceof xJ||t instanceof Vq||t instanceof m2}a(FSn,"isContentType");function QWo(t){if(!Wq(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(QWo,"assertContainerOrChatMessage");function*USn(t,e=!1){for(let r of t.children)r instanceof Gwe?(yield{content:r,isTextSibling:e},e=!0):r instanceof IJ||r instanceof xJ||r instanceof Vq||r instanceof m2?yield{content:r,isTextSibling:!1}:r instanceof Vq?yield{content:r,isTextSibling:!0}:(r&&(yield*USn(r,e)),e=!1)}a(USn,"contentChunks");function qWo(t,e){let r;function n(o,s){if(FSn(o))(!r||o.priorityn instanceof m2):t instanceof _F&&(r=t.children.some(QSn)),MSn.set(t,r),r}a(QSn,"hasCachePoint");function jWo(t){if(t instanceof g2)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof g2)return!1;return!0}a(jWo,"shouldLookForCachePointInNode");function bjt(t,e){let r;if(t instanceof _F&&t.has(1)){qWo(t,e);return}let n=jWo(t),o=t.children.map((s,c)=>({chain:[t],index:c}));for(let s=0;s({chain:d,index:h})))}else if(!r||u.priorityo instanceof g2?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};b0.BudgetExceededError=hJe;function OSn(t){if(!Wq(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(OSn,"getLowestPriorityAmongChildren");function*qSn(t){yield*t.metadata;for(let e of t.children)Wq(e)?yield*qSn(e):yield*e.metadata}a(qSn,"allMetadata");function jSn(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,Wq(r)&&e.push(...r.children)}}a(LSn,"forEachNode");function HWo(t){let e=t;for(;e.parent;)e=e.parent;return e}a(HWo,"getRoot");function BSn(t){return t instanceof _F&&t.keepWithId!==void 0}a(BSn,"isKeepWith");var Cjt=new Set;function GWo(t,e){let r=new Set;for(let n of LSn(t))BSn(n)&&!Cjt.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)Cjt.add(n);try{let n=HWo(t);for(let o of LSn(n))BSn(o)&&r.has(o.keepWithId)?$we(o,e):o instanceof g2&&o.toolCalls&&(o.toolCalls=$Wo(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&&$we(o,e))}finally{for(let n of r)Cjt.delete(n)}}a(GWo,"removeOtherKeepWiths");function Sjt(t,e){if(e.id===t)return e;for(let r of e.children)if(Wq(r)){let n=Sjt(t,r);if(n)return n}}a(Sjt,"findNodeById");function $we(t,e){let r=t.parent;if(!r)return;let n=r.children.indexOf(t);n!==-1&&(r.children.splice(n,1),e.push(t),GWo(t,e),r.isEmpty?$we(r,e):r.onChunksChange())}a($we,"removeNode");function HSn(t){let e={"/9j/":"image/jpeg",iVBOR:"image/png",R0lGOD:"image/gif",UklGR:"image/webp"};for(let r of Object.keys(e))if(t.startsWith(r))return`data:${e[r]};base64,${t}`;return t}a(HSn,"getEncodedBase64");function $Wo(t,e){for(let r=0;r{"use strict";p();function VWo(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(VWo,"_vscpp");function GSn(){throw new Error("This should not be invoked!")}a(GSn,"_vscppf");GSn.isFragment=!0;globalThis.vscpp=VWo;globalThis.vscppf=GSn});var xjt=I(mJe=>{"use strict";p();Object.defineProperty(mJe,"__esModule",{value:!0});mJe.PromptElement=void 0;$Sn();var Ijt=class{static{a(this,"PromptElement")}props;get priority(){return this.props.priority??Number.MAX_SAFE_INTEGER}get insertLineBreakBefore(){return!0}constructor(e){this.props=e}};mJe.PromptElement=Ijt});var Fjt=I(Vs=>{"use strict";p();Object.defineProperty(Vs,"__esModule",{value:!0});Vs.LogicalWrapper=Vs.IfEmpty=Vs.AbstractKeepWith=Vs.TokenLimit=Vs.Expandable=Vs.Chunk=Vs.LegacyPrioritization=Vs.ToolResult=Vs.PrioritizedList=Vs.Document=Vs.Image=Vs.TextChunk=Vs.ToolMessage=Vs.AssistantMessage=Vs.UserMessage=Vs.SystemMessage=Vs.BaseChatMessage=void 0;Vs.isChatMessagePromptElement=WWo;Vs.useKeepWith=JWo;var Wwe=wo(),AT=xjt();function WWo(t){return t instanceof gJe||t instanceof AJe||t instanceof yJe}a(WWo,"isChatMessagePromptElement");var wJ=class extends AT.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};Vs.BaseChatMessage=wJ;var gJe=class extends wJ{static{a(this,"SystemMessage")}constructor(e){e.role=Wwe.Raw.ChatRole.System,super(e)}};Vs.SystemMessage=gJe;var AJe=class extends wJ{static{a(this,"UserMessage")}constructor(e){e.role=Wwe.Raw.ChatRole.User,super(e)}};Vs.UserMessage=AJe;var yJe=class extends wJ{static{a(this,"AssistantMessage")}constructor(e){e.role=Wwe.Raw.ChatRole.Assistant,super(e)}};Vs.AssistantMessage=yJe;var zWo=/\s+/g,wjt=class extends wJ{static{a(this,"ToolMessage")}constructor(e){e.role=Wwe.Raw.ChatRole.Tool,super(e)}};Vs.ToolMessage=wjt;var _Je=class extends AT.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?zWo:this.props.breakOn;if(!o)return vscpp(vscppf,null,this.props.children);let s="",c=[];for(let u of this.props.children||[])if(u&&typeof u=="object"){if(typeof u.ctor!="string")throw new Error("TextChunk children must be text literals or intrinsic attributes.");u.ctor==="br"?s+=` -`:c.push(u)}else u!=null&&(s+=u);let l=await YWo(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};Vs.TextChunk=_Je;async function YWo(t,e,r,n){if(e instanceof RegExp){if(!e.global)throw new Error(`\`breakOn\` expression must have the global flag set (got ${e})`);e.lastIndex=0}let o="",s=-1;for(;st.tokenBudget)return o;o=l,s=c}return o}a(YWo,"getTextContentBelowBudget");var Rjt=class extends AT.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Vs.Image=Rjt;var kjt=class extends AT.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Vs.Document=kjt;var Pjt=class extends AT.PromptElement{static{a(this,"PrioritizedList")}render(){let{children:e,priority:r=0,descending:n}=this.props;if(e)return vscpp(vscppf,null,e.map((o,s)=>{if(!o)return;let c=n?r-s:r-e.length+s;return typeof o!="object"?vscpp(_Je,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};Vs.PrioritizedList=Pjt;var Djt=class extends AT.PromptElement{static{a(this,"ToolResult")}render(){return vscpp(vscppf,null,this.props.data.content.map(e=>{if(e&&typeof e.value=="string")return e.value;if(e&&e.value&&typeof e.value.node=="object")return vscpp("elementJSON",{data:e.value})}))}};Vs.ToolResult=Djt;var Njt=class extends AT.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};Vs.LegacyPrioritization=Njt;var Mjt=class extends AT.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};Vs.Chunk=Mjt;var Ojt=class extends AT.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};Vs.Expandable=Ojt;var Ljt=class extends AT.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};Vs.TokenLimit=Ljt;var EJe=class extends AT.PromptElement{static{a(this,"AbstractKeepWith")}};Vs.AbstractKeepWith=EJe;var KWo=0;function JWo(){let t=KWo++;return class extends EJe{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a(JWo,"useKeepWith");var Bjt=class extends AT.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp(Vwe,null,this.props.alt),vscpp(Vwe,{flexGrow:1},this.props.children))}};Vs.IfEmpty=Bjt;var Vwe=class extends AT.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};Vs.LogicalWrapper=Vwe});var WSn=I(zwe=>{"use strict";p();Object.defineProperty(zwe,"__esModule",{value:!0});zwe.localize=ZWo;zwe.localize2=XWo;zwe.getConfiguredDefaultLocale=ezo;function VSn(t,e){let r;return e.length===0?r=t:r=t.replace(/\{(\d+)\}/g,function(n,o){let s=o[0];return typeof e[s]<"u"?e[s]:n}),r}a(VSn,"_format");function ZWo(t,e,...r){return VSn(e,r)}a(ZWo,"localize");function XWo(t,e,...r){let n=VSn(e,r);return{original:n,value:n}}a(XWo,"localize2");function ezo(t){}a(ezo,"getConfiguredDefaultLocale")});var jjt=I(kr=>{"use strict";p();Object.defineProperty(kr,"__esModule",{value:!0});kr.isAndroid=kr.isEdge=kr.isSafari=kr.isFirefox=kr.isChrome=kr.OS=kr.setTimeout0=kr.setTimeout0IsFaster=kr.translationsConfigFile=kr.platformLocale=kr.locale=kr.Language=kr.language=kr.userAgent=kr.platform=kr.isCI=kr.isMobile=kr.isIOS=kr.webWorkerOrigin=kr.isWebWorker=kr.isWeb=kr.isElectron=kr.isNative=kr.isLinuxSnap=kr.isLinux=kr.isMacintosh=kr.isWindows=kr.LANGUAGE_DEFAULT=void 0;kr.PlatformToString=rzo;kr.isLittleEndian=nzo;kr.isBigSurOrNewer=izo;var zSn=WSn();kr.LANGUAGE_DEFAULT="en";var Jwe=!1,Zwe=!1,Kwe=!1,ZSn=!1,XSn=!1,Qjt=!1,e1n=!1,qjt=!1,t1n=!1,r1n=!1,Ywe,vJe=kr.LANGUAGE_DEFAULT,Ujt=kr.LANGUAGE_DEFAULT,n1n,EF,vF=globalThis,yT;typeof vF.vscode<"u"&&typeof vF.vscode.process<"u"?yT=vF.vscode.process:typeof process<"u"&&(yT=process);var i1n=typeof yT?.versions?.electron=="string",tzo=i1n&&yT?.type==="renderer";if(typeof yT=="object"){Jwe=yT.platform==="win32",Zwe=yT.platform==="darwin",Kwe=yT.platform==="linux",ZSn=Kwe&&!!yT.env.SNAP&&!!yT.env.SNAP_REVISION,e1n=i1n,t1n=!!yT.env.CI||!!yT.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ywe=kr.LANGUAGE_DEFAULT,vJe=kr.LANGUAGE_DEFAULT;let t=yT.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];Ywe=e.locale,Ujt=e.osLocale,vJe=r||kr.LANGUAGE_DEFAULT,n1n=e._translationsConfigFile}catch{}XSn=!0}else typeof navigator=="object"&&!tzo?(EF=navigator.userAgent,Jwe=EF.indexOf("Windows")>=0,Zwe=EF.indexOf("Macintosh")>=0,qjt=(EF.indexOf("Macintosh")>=0||EF.indexOf("iPad")>=0||EF.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Kwe=EF.indexOf("Linux")>=0,r1n=EF?.indexOf("Mobi")>=0,Qjt=!0,Ywe=zSn.getConfiguredDefaultLocale(zSn.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||kr.LANGUAGE_DEFAULT,vJe=Ywe,Ujt=navigator.language):console.error("Unable to resolve platform.");function rzo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(rzo,"PlatformToString");var CJe=0;Zwe?CJe=1:Jwe?CJe=3:Kwe&&(CJe=2);kr.isWindows=Jwe;kr.isMacintosh=Zwe;kr.isLinux=Kwe;kr.isLinuxSnap=ZSn;kr.isNative=XSn;kr.isElectron=e1n;kr.isWeb=Qjt;kr.isWebWorker=Qjt&&typeof vF.importScripts=="function";kr.webWorkerOrigin=kr.isWebWorker?vF.origin:void 0;kr.isIOS=qjt;kr.isMobile=r1n;kr.isCI=t1n;kr.platform=CJe;kr.userAgent=EF;kr.language=vJe;var YSn;(function(t){function e(){return kr.language}a(e,"value"),t.value=e;function r(){return kr.language.length===2?kr.language==="en":kr.language.length>=3?kr.language[0]==="e"&&kr.language[1]==="n"&&kr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return kr.language==="en"}a(n,"isDefault"),t.isDefault=n})(YSn||(kr.Language=YSn={}));kr.locale=Ywe;kr.platformLocale=Ujt;kr.translationsConfigFile=n1n;kr.setTimeout0IsFaster=typeof vF.postMessage=="function"&&!vF.importScripts;kr.setTimeout0=(()=>{if(kr.setTimeout0IsFaster){let t=[];vF.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),vF.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();kr.OS=Zwe||qjt?2:Jwe?1:3;var KSn=!0,JSn=!1;function nzo(){if(!JSn){JSn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,KSn=new Uint16Array(t.buffer)[0]===513}return KSn}a(nzo,"isLittleEndian");kr.isChrome=!!(kr.userAgent&&kr.userAgent.indexOf("Chrome")>=0);kr.isFirefox=!!(kr.userAgent&&kr.userAgent.indexOf("Firefox")>=0);kr.isSafari=!!(!kr.isChrome&&kr.userAgent&&kr.userAgent.indexOf("Safari")>=0);kr.isEdge=!!(kr.userAgent&&kr.userAgent.indexOf("Edg/")>=0);kr.isAndroid=!!(kr.userAgent&&kr.userAgent.indexOf("Android")>=0);function izo(t){return parseFloat(t)>=20}a(izo,"isBigSurOrNewer")});var s1n=I(t5=>{"use strict";p();Object.defineProperty(t5,"__esModule",{value:!0});t5.arch=t5.platform=t5.env=t5.cwd=void 0;var o1n=jjt(),RJ,Hjt=globalThis.vscode;if(typeof Hjt<"u"&&typeof Hjt.process<"u"){let t=Hjt.process;RJ={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?RJ={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:RJ={get platform(){return o1n.isWindows?"win32":o1n.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};t5.cwd=RJ.cwd;t5.env=RJ.env;t5.platform=RJ.platform;t5.arch=RJ.arch});var c1n=I(_n=>{"use strict";p();Object.defineProperty(_n,"__esModule",{value:!0});_n.delimiter=_n.sep=_n.toNamespacedPath=_n.parse=_n.format=_n.extname=_n.basename=_n.dirname=_n.relative=_n.resolve=_n.join=_n.isAbsolute=_n.normalize=_n.posix=_n.win32=void 0;var Yue=s1n(),ozo=65,szo=97,azo=90,czo=122,Kq=46,S0=47,ab=92,zq=58,lzo=63,bJe=class extends Error{static{a(this,"ErrorInvalidArgType")}code;constructor(e,r,n){let o;typeof r=="string"&&r.indexOf("not ")===0?(o="must not be",r=r.replace(/^not /,"")):o="must be";let s=e.indexOf(".")!==-1?"property":"argument",c=`The "${e}" ${s} ${o} of type ${r}`;c+=`. Received type ${typeof n}`,super(c),this.code="ERR_INVALID_ARG_TYPE"}};function uzo(t,e){if(t===null||typeof t!="object")throw new bJe(e,"Object",t)}a(uzo,"validateObject");function pp(t,e){if(typeof t!="string")throw new bJe(e,"string",t)}a(pp,"validateString");var cb=Yue.platform==="win32";function cs(t){return t===S0||t===ab}a(cs,"isPathSeparator");function Gjt(t){return t===S0}a(Gjt,"isPosixPathSeparator");function Yq(t){return t>=ozo&&t<=azo||t>=szo&&t<=czo}a(Yq,"isWindowsDeviceRoot");function SJe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===Kq&&l!==-1?++l:l=-1}return o}a(SJe,"normalizeString");function a1n(t,e){uzo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(a1n,"_format");_n.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],pp(s,"path"),s.length===0)continue}else e.length===0?s=Yue.cwd():(s=Yue.env[`=${e}`]||Yue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===ab)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)cs(f)&&(l=1,d=!0);else if(cs(f))if(d=!0,cs(s.charCodeAt(1))){let h=2,m=h;for(;h2&&cs(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=SJe(r,!n,"\\",cs),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){pp(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return Gjt(s)?"\\":t;if(cs(s))if(o=!0,cs(t.charCodeAt(1))){let l=2,u=l;for(;l2&&cs(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&cs(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){pp(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return cs(r)||e>2&&Yq(r)&&t.charCodeAt(1)===zq&&cs(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&cs(r.charCodeAt(0))){++o;let s=r.length;s>1&&cs(r.charCodeAt(1))&&(++o,s>2&&(cs(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return _n.win32.normalize(e)},relative(t,e){if(pp(t,"from"),pp(e,"to"),t===e)return"";let r=_n.win32.resolve(t),n=_n.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===ab;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===ab;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===ab)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===ab?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===ab)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===ab&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=_n.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===ab){if(e.charCodeAt(1)===ab){let r=e.charCodeAt(2);if(r!==lzo&&r!==Kq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Yq(e.charCodeAt(0))&&e.charCodeAt(1)===zq&&e.charCodeAt(2)===ab)return`\\\\?\\${e}`;return t},dirname(t){pp(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return cs(o)?t:".";if(cs(o)){if(r=n=1,cs(t.charCodeAt(1))){let l=2,u=l;for(;l2&&cs(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(cs(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&pp(e,"ext"),pp(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&Yq(t.charCodeAt(0))&&t.charCodeAt(1)===zq&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(cs(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(cs(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){pp(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===zq&&Yq(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(cs(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===Kq?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:a1n.bind(null,"\\"),parse(t){pp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return cs(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(cs(o)){if(n=1,cs(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),cs(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===Kq?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var dzo=(()=>{if(cb){let t=/\\/g;return()=>{let e=Yue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Yue.cwd()})();_n.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:dzo();pp(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===S0)}return e=SJe(e,!r,"/",Gjt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(pp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===S0,r=t.charCodeAt(t.length-1)===S0;return t=SJe(t,!e,"/",Gjt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return pp(t,"path"),t.length>0&&t.charCodeAt(0)===S0},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":_n.posix.normalize(e)},relative(t,e){if(pp(t,"from"),pp(e,"to"),t===e||(t=_n.posix.resolve(t),e=_n.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===S0)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===S0?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===S0)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(pp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===S0,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===S0){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&pp(e,"ext"),pp(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===S0){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===S0){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){pp(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===S0){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===Kq?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:a1n.bind(null,"/"),parse(t){pp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===S0,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===S0){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===Kq?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};_n.posix.win32=_n.win32.win32=_n.win32;_n.posix.posix=_n.win32.posix=_n.posix;_n.normalize=cb?_n.win32.normalize:_n.posix.normalize;_n.isAbsolute=cb?_n.win32.isAbsolute:_n.posix.isAbsolute;_n.join=cb?_n.win32.join:_n.posix.join;_n.resolve=cb?_n.win32.resolve:_n.posix.resolve;_n.relative=cb?_n.win32.relative:_n.posix.relative;_n.dirname=cb?_n.win32.dirname:_n.posix.dirname;_n.basename=cb?_n.win32.basename:_n.posix.basename;_n.extname=cb?_n.win32.extname:_n.posix.extname;_n.format=cb?_n.win32.format:_n.posix.format;_n.parse=cb?_n.win32.parse:_n.posix.parse;_n.toNamespacedPath=cb?_n.win32.toNamespacedPath:_n.posix.toNamespacedPath;_n.sep=cb?_n.win32.sep:_n.posix.sep;_n.delimiter=cb?_n.win32.delimiter:_n.posix.delimiter});var m1n=I(Kue=>{"use strict";p();Object.defineProperty(Kue,"__esModule",{value:!0});Kue.URI=void 0;Kue.isUriComponents=_zo;Kue.uriToFsPath=wJe;var l1n=c1n(),IJe=jjt(),fzo=/^\w[\w\d+.-]*$/,pzo=/^\//,hzo=/^\/\//;function mzo(t,e){if(!t.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!fzo.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!pzo.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(hzo.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(mzo,"_validateUri");function gzo(t,e){return!t&&!e?"file":t}a(gzo,"_schemeFix");function Azo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==A2&&(e=A2+e):e=A2;break}return e}a(Azo,"_referenceResolution");var tu="",A2="/",yzo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,xJe=class t{static{a(this,"URI")}static isUri(e){return e instanceof t?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}scheme;authority;path;query;fragment;constructor(e,r,n,o,s,c=!1){typeof e=="object"?(this.scheme=e.scheme||tu,this.authority=e.authority||tu,this.path=e.path||tu,this.query=e.query||tu,this.fragment=e.fragment||tu):(this.scheme=gzo(e,c),this.authority=r||tu,this.path=Azo(this.scheme,n||tu),this.query=o||tu,this.fragment=s||tu,mzo(this,c))}get fsPath(){return wJe(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=tu),n===void 0?n=this.authority:n===null&&(n=tu),o===void 0?o=this.path:o===null&&(o=tu),s===void 0?s=this.query:s===null&&(s=tu),c===void 0?c=this.fragment:c===null&&(c=tu),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new Jq(r,n,o,s,c)}static parse(e,r=!1){let n=yzo.exec(e);return n?new Jq(n[2]||tu,TJe(n[4]||tu),TJe(n[5]||tu),TJe(n[7]||tu),TJe(n[9]||tu),r):new Jq(tu,tu,tu,tu,tu)}static file(e){let r=tu;if(IJe.isWindows&&(e=e.replace(/\\/g,A2)),e[0]===A2&&e[1]===A2){let n=e.indexOf(A2,2);n===-1?(r=e.substring(2),e=A2):(r=e.substring(2,n),e=e.substring(n)||A2)}return new Jq("file",r,e,tu,tu)}static from(e,r){return new Jq(e.scheme,e.authority,e.path,e.query,e.fragment,r)}static joinPath(e,...r){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return IJe.isWindows&&e.scheme==="file"?n=t.file(l1n.win32.join(wJe(e,!0),...r)).path:n=l1n.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return $jt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new Jq(e);return r._formatted=e.external??null,r._fsPath=e._sep===f1n?e.fsPath??null:null,r}}else return e}};Kue.URI=xJe;function _zo(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}a(_zo,"isUriComponents");var f1n=IJe.isWindows?1:void 0,Jq=class extends xJe{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=wJe(this,!1)),this._fsPath}toString(e=!1){return e?$jt(this,!0):(this._formatted||(this._formatted=$jt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=f1n),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},p1n={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function u1n(t,e,r){let n,o=-1;for(let s=0;s=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||e&&c===47||r&&c===91||r&&c===93||r&&c===58)o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n!==void 0&&(n+=t.charAt(s));else{n===void 0&&(n=t.substr(0,s));let l=p1n[c];l!==void 0?(o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n+=l):o===-1&&(o=s)}}return o!==-1&&(n+=encodeURIComponent(t.substring(o))),n!==void 0?n:t}a(u1n,"encodeURIComponentFast");function Ezo(t){let e;for(let r=0;r1&&t.scheme==="file"?r=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?r=t.path.substr(1):r=t.path[1].toLowerCase()+t.path.substr(2):r=t.path,IJe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(wJe,"uriToFsPath");function $jt(t,e){let r=e?Ezo:u1n,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=A2,n+=A2),s){let d=s.indexOf("@");if(d!==-1){let f=s.substr(0,d);s=s.substr(d+1),d=f.lastIndexOf(":"),d===-1?n+=r(f,!1,!1):(n+=r(f.substr(0,d),!1,!1),n+=":",n+=r(f.substr(d+1),!1,!0)),n+="@"}s=s.toLowerCase(),d=s.lastIndexOf(":"),d===-1?n+=r(s,!1,!0):(n+=r(s.substr(0,d),!1,!0),n+=s.substr(d))}if(c){if(c.length>=3&&c.charCodeAt(0)===47&&c.charCodeAt(2)===58){let d=c.charCodeAt(1);d>=65&&d<=90&&(c=`/${String.fromCharCode(d+32)}:${c.substr(3)}`)}else if(c.length>=2&&c.charCodeAt(1)===58){let d=c.charCodeAt(0);d>=65&&d<=90&&(c=`${String.fromCharCode(d+32)}:${c.substr(2)}`)}n+=r(c,!0,!1)}return l&&(n+="?",n+=r(l,!1,!1)),u&&(n+="#",n+=e?u:u1n(u,!1,!1)),n}a($jt,"_asFormatted");function h1n(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+h1n(t.substr(3)):t}}a(h1n,"decodeURIComponentGraceful");var d1n=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function TJe(t){return t.match(d1n)?t.replace(d1n,e=>h1n(e)):t}a(TJe,"percentDecode")});var zjt=I(Zq=>{"use strict";p();Object.defineProperty(Zq,"__esModule",{value:!0});Zq.PromptReference=Zq.ChatResponseReferencePartStatusKind=Zq.PromptMetadata=void 0;var Xwe=m1n(),Vjt=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};Zq.PromptMetadata=Vjt;var g1n;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(g1n||(Zq.ChatResponseReferencePartStatusKind=g1n={}));var Wjt=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?Xwe.URI.from(n):{uri:Xwe.URI.from(n.uri),range:n.range},"uriOrLocation");return new t("variableName"in e.anchor?{variableName:e.anchor.variableName,value:e.anchor.value&&r(e.anchor.value)}:r(e.anchor),e.iconPath&&("scheme"in e.iconPath?Xwe.URI.from(e.iconPath):"light"in e.iconPath?{light:Xwe.URI.from(e.iconPath.light),dark:Xwe.URI.from(e.iconPath.dark)}:e.iconPath),e.options)}constructor(e,r,n){this.anchor=e,this.iconPath=r,this.options=n}toJSON(){return{anchor:this.anchor,iconPath:this.iconPath,options:this.options}}};Zq.PromptReference=Wjt});var rHt=I(Jue=>{"use strict";p();Object.defineProperty(Jue,"__esModule",{value:!0});Jue.PromptRenderer=Jue.MetadataMap=void 0;var vzo=Ejt(),Xq=Tjt(),PJ=Gq(),Kd=Fjt(),tHt=zjt(),kJe;(function(t){t.empty={get:a(()=>{},"get"),getAll:a(()=>[],"getAll")},t.from=e=>({get:a(r=>e.find(n=>n instanceof r),"get"),getAll:a(r=>e.filter(n=>n instanceof r),"getAll")})})(kJe||(Jue.MetadataMap=kJe={}));var Yjt=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new NJe(null,0);_tokenLimits=[];tracer=void 0;constructor(e,r,n,o){this._endpoint=e,this._ctor=r,this._props=n,this._tokenizer=o}getIgnoredFiles(){return Array.from(new Set(this._ignoredFiles))}getUsedContext(){return this._usedContext}createElement(e){return new e.ctor(e.props)}async _processPromptPieces(e,r,n,o){let s=new Map;for(let[u,d]of r.entries()){if(Array.isArray(d.children)&&(d.props=d.props??{},d.props.children=d.children),!d.ctor){let A=E1n(d.path);throw new Error(`Invalid ChatMessage child! Child must be a TSX component that extends PromptElement at ${A}`)}let f=this.createElement(d),h;f instanceof Kd.TokenLimit&&(h=d.props.max,this._tokenLimits.push({limit:h,id:d.node.id})),d.node.setObj(f);let m=d.props.flexGrow??1/0,g=s.get(m);g||(g=[],s.set(m,g)),g.push({element:d,promptElementInstance:f,tokenLimit:h})}if(s.size===0)return;let c=[...s.entries()].sort(([u],[d])=>d-u).map(([u,d])=>d),l=a(u=>{let d=0;for(let f=u+1;f{if(_.tokenLimit===void 0)return!1;let E=_.element.props.flexBasis??1,v=E/h;return Math.floor(e.remainingTokenBudget*v)<_.tokenLimit?!1:(h-=E,m+=_.tokenLimit,!0)}),A=d.map((_,E)=>{let v=(_.element.props.flexBasis??1)/h;return{tokenBudget:g[E]?_.tokenLimit:Math.floor((e.remainingTokenBudget-m)*v),endpoint:e.endpoint,countTokens:a((S,T)=>this._tokenizer.tokenLength(typeof S=="string"?{type:PJ.Raw.ChatCompletionContentPartKind.Text,text:S}:S,T),"countTokens")}});e.consume(-f),this.tracer?.addRenderEpoch?.({inNode:d[0].element.node.parent?.id,flexValue:d[0].element.props.flexGrow??0,tokenBudget:e.remainingTokenBudget,reservedTokens:f,elements:d.map((_,E)=>({id:_.element.node.id,tokenBudget:A[E].tokenBudget}))}),await Promise.all(d.map(async({element:_,promptElementInstance:E},v)=>{let S=await y1n(_,()=>E.prepare?.(A[v],n,o));_.node.setState(S)}));let y=await Promise.all(d.map(async({element:_,promptElementInstance:E},v)=>{let S=A[v];return await y1n(_,()=>E.render(_.node.getState(),S,n,o))}));for(let[_,{element:E,promptElementInstance:v}]of d.entries()){let S=A[_],T=y[_];if(!T)continue;let w=await this._processPromptRenderPiece(new kJ(S.tokenBudget,this._endpoint),E,v,T,n,o);v instanceof Kd.Expandable&&this._growables.push({initialConsume:w,elem:E.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=_1n(o),u=new kJ(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await Czo(this._tokenizer,r,n,l);return u.consume(d),await this._handlePromptChildren(r,l,u,s,c),u.consumed}async renderElementJSON(e){return await this._processPromptPieces(new kJ(this._endpoint.modelMaxPromptTokens,this._endpoint),[{node:this._root,ctor:this._ctor,props:this._props,children:[],path:[this._ctor]}],void 0,e),{node:this._root.toJSON()}}async render(e,r){let n=await this.renderRaw(e,r);return{...n,messages:(0,PJ.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new kJ(this._endpoint.modelMaxPromptTokens,this._endpoint),[{node:this._root,ctor:this._ctor,props:this._props,children:[],path:[this._ctor]}],e,r);let{container:n,allMetadata:o,removed:s}=await this._getFinalElementTree(this._endpoint.modelMaxPromptTokens,r);this.tracer?.didMaterializeTree?.({budget:this._endpoint.modelMaxPromptTokens,renderedTree:{container:n,removed:s,budget:this._endpoint.modelMaxPromptTokens},tokenizer:this._tokenizer,renderTree:a(m=>this._getFinalElementTree(m,void 0).then(g=>({...g,budget:m})),"renderTree")});let c=[...n.toChatMessages()],l=await n.tokenCount(this._tokenizer),u=[...n.allMetadata()],d=new Set,f=u.map(m=>{if(!(m instanceof r5))return;let g=m.reference,A="variableName"in g.anchor;if(A&&!d.has(g.anchor.variableName))return d.add(g.anchor.variableName),g;if(!A)return g}).filter(MJe),h=o.map(m=>{if(!(m instanceof r5)||u.includes(m))return;let g=m.reference,A="variableName"in g.anchor;if(A&&!d.has(g.anchor.variableName))return d.add(g.anchor.variableName),g;if(!A)return g}).filter(MJe);return{metadata:kJe.from(u),messages:c,hasIgnoredFiles:this._ignoredFiles.length>0,tokenCount:l,references:f,omittedReferences:h}}async _getFinalElementTree(e,r){let n=this._root.materialize(),o=[...n.toChatMessages()],s=[...n.allMetadata()],c=[{limit:e,id:this._root.id},...this._tokenLimits],l=0;for(let u=c.length-1;u>=0;u--){let d=c[u];if(d.limit>e)continue;let f=n.findById(d.id);if(!f)continue;let h=await f.tokenCount(this._tokenizer);if(!(hd.limit;){let g=await f.baseMessageTokenCount(this._tokenizer);do for(let A of f.removeLowestPriorityChild()){l++;let y=A.upperBoundTokenCount(this._tokenizer);m-=(typeof y=="number"?y:await y)*1.25}while(m-g>d.limit);m=await f.tokenCount(this._tokenizer)}}catch(m){throw m instanceof Xq.BudgetExceededError&&(m.metadata=kJe.from([...n.allMetadata()]),m.messages=o),m}}return{container:n,allMetadata:s,removed:l}}async _grow(e,r,n,o){if(!this._growables.length)return!1;for(let s of this._growables){if(!e.findById(s.elem.id))continue;let c=s.elem.getObj();if(!(c instanceof Kd.Expandable))throw new Error("unreachable: expected growable");let l=new NJe(null,0,s.elem.id),u=new kJ(n-r+s.initialConsume,this._endpoint),d=await this._processPromptRenderPiece(u,{node:l,ctor:this._ctor,props:{},children:[],path:[this._ctor]},c,await c.render(void 0,{tokenBudget:u.tokenBudget,endpoint:this._endpoint,countTokens:a((m,g)=>this._tokenizer.tokenLength(typeof m=="string"?{type:PJ.Raw.ChatCompletionContentPartKind.Text,text:m}:m,g),"countTokens")}),void 0,o),f=l.materialize();if(!e.replaceNode(s.elem.id,f))throw new Error("unreachable: could not find old element to replace");if(r-=s.initialConsume,r+=d,r>=n)break}return!0}_handlePromptChildren(e,r,n,o,s){if(e.ctor===Kd.TextChunk){this._handleExtrinsicTextChunkChildren(e.node,e.node,e.props,r);return}let c=[];for(let l of r){if(l.kind==="literal"){e.node.appendStringChild(l.value,e.props.priority??Number.MAX_SAFE_INTEGER);continue}if(l.kind==="intrinsic"){this._handleIntrinsic(e.node,l.name,{priority:e.props.priority??Number.MAX_SAFE_INTEGER,...l.props},PJe(l.children));continue}let u=e.node.createChild();c.push({node:u,ctor:l.ctor,props:l.props,children:l.children,path:[...e.path,l.ctor]})}return this._processPromptPieces(n,c,o,s)}_handleIntrinsic(e,r,n,o,s){switch(r){case"meta":return this._handleIntrinsicMeta(e,n,o);case"br":return this._handleIntrinsicLineBreak(e,n,o,n.priority,s);case"usedContext":return this._handleIntrinsicUsedContext(e,n,o);case"references":return this._handleIntrinsicReferences(e,n,o);case"ignoredFiles":return this._handleIntrinsicIgnoredFiles(e,n,o);case"elementJSON":return this._handleIntrinsicElementJSON(e,n.data);case"cacheBreakpoint":return this._handleIntrinsicCacheBreakpoint(e,n,o,s);case"opaque":return this._handleIntrinsicOpaque(e,n,s)}throw new Error(`Unknown intrinsic element ${r}!`)}_handleIntrinsicCacheBreakpoint(e,r,n,o){if(n.length>0)throw new Error(" must not have children!");e.addCacheBreakpoint(r,o)}_handleIntrinsicMeta(e,r,n){if(n.length>0)throw new Error(" must not have children!");r.local?e.addMetadata(r.value):this._root.addMetadata(r.value)}_handleIntrinsicLineBreak(e,r,n,o,s){if(n.length>0)throw new Error("
must not have children!");e.appendLineBreak(o??Number.MAX_SAFE_INTEGER,s)}_handleIntrinsicOpaque(e,r,n){e.appendOpaque(r.value,r.tokenUsage,r.priority,n)}_handleIntrinsicElementJSON(e,r){let n=e.appendPieceJSON(r.node);if(this.tracer?.includeInEpoch)for(let o of n.elements())this.tracer.includeInEpoch({id:o.id,tokenBudget:0})}_handleIntrinsicUsedContext(e,r,n){if(n.length>0)throw new Error(" must not have children!");this._usedContext.push(...r.value)}_handleIntrinsicReferences(e,r,n){if(n.length>0)throw new Error(" must not have children!");for(let o of r.value)e.addMetadata(new r5(o))}_handleIntrinsicIgnoredFiles(e,r,n){if(n.length>0)throw new Error(" must not have children!");this._ignoredFiles.push(...r.value)}_handleExtrinsicTextChunkChildren(e,r,n,o){let s=[],c=[];for(let l of o){if(l.kind==="extrinsic")throw new Error("TextChunk cannot have extrinsic children!");if(l.kind==="literal"&&s.push(l.value),l.kind==="intrinsic")if(l.name==="br")s.push(` -`);else if(l.name==="references")for(let u of l.props.value)c.push(new r5(u));else this._handleIntrinsic(e,l.name,l.props,PJe(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};Jue.PromptRenderer=Yjt;async function Czo(t,e,r,n){let o=0;if((0,Kd.isChatMessagePromptElement)(r)){let s={role:e.props.role,content:[],...e.props.name?{name:e.props.name}:void 0,...e.props.toolCalls?{toolCalls:e.props.toolCalls}:void 0,...e.props.toolCallId?{toolCallId:e.props.toolCallId}:void 0};o+=await t.countMessageTokens((0,PJ.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:PJ.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(Czo,"computeTokensConsumedByLiterals");function _1n(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new Zjt(String(t))):bzo(t)?PJe(t.children,e):Szo(t)?PJe(t,e):typeof t.ctor=="string"?e.push(new Kjt(t.ctor,t.props,t.children)):e.push(new Jjt(t.ctor,t.props,t.children)),e)}a(_1n,"flattenAndReduce");function PJe(t,e=[]){for(let r of t)_1n(r,e);return e}a(PJe,"flattenAndReduceArr");var Kjt=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},Jjt=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},Zjt=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},DJe=class t{static{a(this,"PromptOpaque")}parent;childIndex;value;tokenUsage;priority;static fromJSON(e,r,n){return new t(e,r,n.value,n.tokenUsage,n.priority)}kind=2;constructor(e,r,n,o,s){this.parent=e,this.childIndex=r,this.value=n,this.tokenUsage=o,this.priority=s}materialize(e){return new Xq.MaterializedChatMessageOpaque(e,{type:PJ.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},kJ=class{static{a(this,"PromptSizingContext")}tokenBudget;endpoint;_consumed=0;constructor(e,r){this.tokenBudget=e,this.endpoint=r}get consumed(){return this._consumed>this.tokenBudget?this.tokenBudget:this._consumed}get remainingTokenBudget(){return Math.max(0,this.tokenBudget-this._consumed)}consume(e){this._consumed+=e}},NJe=class t{static{a(this,"PromptTreeElement")}parent;childIndex;id;static _nextId=0;static fromJSON(e,r,n){let o=new t(null,e);switch(o._metadata=r.references?.map(s=>new r5(tHt.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return eRe.fromJSON(o,c,s);case 3:return DJe.fromJSON(o,c,s);default:}}).filter(MJe),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new Kd.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,Kd.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new Kd.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new Kd.Image(r.props);break;case 4:o._obj=new Kd.Document(r.props);break;default:}return o}kind=1;_obj=null;_state=void 0;_children=[];_metadata=[];_objFlags=0;constructor(e=null,r,n=t._nextId++){this.parent=e,this.childIndex=r,this.id=n}setObj(e){this._obj=e,this._obj instanceof Kd.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof Kd.Chunk&&(this._objFlags|=2),this._obj instanceof Kd.IfEmpty&&(this._objFlags|=8),this._obj.props.passPriority&&(this._objFlags|=4)}getObj(){return this._obj}setState(e){this._state=e}getState(){return this._state}createChild(){let e=new t(this,this._children.length);return this._children.push(e),e}appendPieceJSON(e){let r=t.fromJSON(this._children.length,e,new Map);return this._children.push(r),r}appendStringChild(e,r,n,o=this._children.length,s=!1){this._children.push(new eRe(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new eRe(this,r,` -`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new DJe(this,o,e,r,n))}toJSON(){let e={type:1,ctor:2,ctorName:this._obj?.constructor.name,children:this._children.slice().sort((r,n)=>r.childIndex-n.childIndex).map(r=>r.toJSON()).filter(MJe),props:{},references:this._metadata.filter(r=>r instanceof r5).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=RJe(this._obj.props,vzo.jsonRetainedProps)),this._obj instanceof Kd.BaseChatMessage)e.ctor=1,Object.assign(e.props,RJe(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof Kd.Image)return{...e,ctor:3,props:{...e.props,...RJe(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof Kd.Document)return{...e,ctor:4,props:{...e.props,...RJe(this._obj.props,["data","mediaType"])}};this._obj instanceof Kd.AbstractKeepWith&&(e.keepWithId=this._obj.id)}return this._objFlags!==0&&(e.flags=this._objFlags),e}materialize(e){if(this._children.sort((r,n)=>r.childIndex-n.childIndex),this._obj instanceof Kd.Image)return new Xq.MaterializedChatMessageImage(e,this.id,this._obj.props.src,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,0,this._obj.props.detail??void 0,this._obj.props.mimeType??void 0);if(this._obj instanceof Kd.Document)return new Xq.MaterializedChatMessageDocument(e,this.id,this._obj.props.data,this._obj.props.mediaType,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,0);if(this._obj instanceof Kd.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new Xq.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof Kd.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof Kd.ToolMessage?this._obj.props.toolCallId:void 0,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,r=>this._children.map(n=>n.materialize(r)))}else{let r=new Xq.GenericMaterializedContainer(e,this.id,this._obj?.constructor.name,this._obj?.props.priority??(this._obj?.props.passPriority?0:Number.MAX_SAFE_INTEGER),n=>this._children.map(o=>o.materialize(n)),this._metadata,this._objFlags);return this._obj instanceof Kd.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof Kd.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new Xjt({type:PJ.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},Xjt=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new Xq.MaterializedChatMessageBreakpoint(e,this.part)}},eRe=class t{static{a(this,"PromptText")}parent;childIndex;text;priority;metadata;lineBreakBefore;static fromJSON(e,r,n){return new t(e,r,n.text,n.priority,n.references?.map(o=>new r5(tHt.PromptReference.fromJSON(o))),n.lineBreakBefore)}kind=2;constructor(e,r,n,o,s,c=!1){this.parent=e,this.childIndex=r,this.text=n,this.priority=o,this.metadata=s,this.lineBreakBefore=c}materialize(e){let r=this.lineBreakBefore?1:this.childIndex===0?2:0;return new Xq.MaterializedChatMessageTextChunk(e,this.text,this.priority??Number.MAX_SAFE_INTEGER,this.metadata||[],r)}toJSON(){return{type:2,priority:this.priority,text:this.text,references:this.metadata?.filter(e=>e instanceof r5).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function bzo(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a(bzo,"isFragmentCtor");function MJe(t){return t!==void 0}a(MJe,"isDefined");var eHt=class extends tHt.PromptMetadata{static{a(this,"InternalMetadata")}},r5=class extends eHt{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function Szo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(Szo,"isIterable");function RJe(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(RJe,"pickProps");function E1n(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(E1n,"atPath");var A1n=new WeakSet;async function y1n(t,e){try{return await e()}catch(r){throw r instanceof Error&&!A1n.has(r)&&r.constructor.name!=="CancellationError"&&(A1n.add(r),r.message+=` (at tsx element ${E1n(t.path)})`),r}}a(y1n,"annotateError")});var v1n=I(OJe=>{"use strict";p();Object.defineProperty(OJe,"__esModule",{value:!0});OJe.VSCodeTokenizer=void 0;var nHt=Gq(),iHt=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=nHt.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==nHt.OutputMode.VSCode)throw new Error("`mode` must be set to vscode when using vscode.LanguageModelChat as the tokenizer")}async tokenLength(e,r){return e.type===nHt.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};OJe.VSCodeTokenizer=iHt});var C1n=I(Zue=>{"use strict";p();Object.defineProperty(Zue,"__esModule",{value:!0});Zue.tracerCss=Zue.tracerSrc=void 0;Zue.tracerSrc='"use strict";(()=>{var $,m,se,Ue,w,re,le,q,X,G,K,Ae,D={},ce=[],Re=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,J=Array.isArray;function E(t,e){for(var n in e)t[n]=e[n];return t}function ue(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function l(t,e,n){var o,r,_,c={};for(_ in e)_=="key"?o=e[_]:_=="ref"?r=e[_]:c[_]=e[_];if(arguments.length>2&&(c.children=arguments.length>3?$.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(_ in t.defaultProps)c[_]===void 0&&(c[_]=t.defaultProps[_]);return R(t,c,o,r,null)}function R(t,e,n,o,r){var _={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++se,__i:-1,__u:0};return r==null&&m.vnode!=null&&m.vnode(_),_}function N(t){return t.children}function B(t,e){this.props=t,this.context=e}function I(t,e){if(e==null)return t.__?I(t.__,t.__i+1):null;for(var n;ee&&w.sort(q));O.__r=0}function pe(t,e,n,o,r,_,c,a,u,s,p){var i,f,d,b,x,C=o&&o.__k||ce,h=e.length;for(n.__d=u,Be(n,e,C),u=n.__d,i=0;i0?R(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r).__=t,r.__b=t.__b+1,_=null,(a=r.__i=Oe(r,n,c,p))!==-1&&(p--,(_=n[a])&&(_.__u|=131072)),_==null||_.__v===null?(a==-1&&i--,typeof r.type!="function"&&(r.__u|=65536)):a!==c&&(a==c-1?i--:a==c+1?i++:(a>c?i--:i++,r.__u|=65536))):r=t.__k[o]=null;if(p)for(o=0;o(u!=null&&(131072&u.__u)==0?1:0))for(;c>=0||a=0){if((u=e[c])&&(131072&u.__u)==0&&r==u.key&&_===u.type)return c;c--}if(a=n.__.length&&n.__.push({}),n.__[t]}function S(t){return V=1,Ve(Ne,t)}function Ve(t,e,n){var o=te(L++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):Ne(void 0,e),function(a){var u=o.__N?o.__N[0]:o.__[0],s=o.t(u,a);u!==s&&(o.__N=[s,o.__[1]],o.__c.setState({}))}],o.__c=g,!g.u)){var r=function(a,u,s){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(f){return!!f.__c});if(p.every(function(f){return!f.__N}))return!_||_.call(this,a,u,s);var i=!1;return p.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(i=!0)}}),!(!i&&o.__c.props===a)&&(!_||_.call(this,a,u,s))};g.u=!0;var _=g.shouldComponentUpdate,c=g.componentWillUpdate;g.componentWillUpdate=function(a,u,s){if(this.__e){var p=_;_=void 0,r(a,u,s),_=p}c&&c.call(this,a,u,s)},g.shouldComponentUpdate=r}return o.__N||o.__}function Se(t,e){var n=te(L++,3);!y.__s&&Ie(n.__H,e)&&(n.__=t,n.i=e,g.__H.__h.push(n))}function we(t){return V=5,je(function(){return{current:t}},[])}function je(t,e){var n=te(L++,7);return Ie(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function qe(){for(var t;t=Ee.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(W),t.__H.__h.forEach(ee),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){g=null,be&&be(t)},y.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Te&&Te(t,e)},y.__r=function(t){ye&&ye(t),L=0;var e=(g=t.__c).__H;e&&(Z===g?(e.__h=[],g.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(W),e.__h.forEach(ee),e.__h=[],L=0)),Z=g},y.diffed=function(t){Ce&&Ce(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Ee.push(e)!==1&&ge===y.requestAnimationFrame||((ge=y.requestAnimationFrame)||Ge)(qe)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Z=g=null},y.__c=function(t,e){e.some(function(n){try{n.__h.forEach(W),n.__h=n.__h.filter(function(o){return!o.__||ee(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],y.__e(o,n.__v)}}),xe&&xe(t,e)},y.unmount=function(t){ke&&ke(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{W(o)}catch(r){e=r}}),n.__H=void 0,e&&y.__e(e,n.__v))};var Me=typeof requestAnimationFrame=="function";function Ge(t){var e,n=function(){clearTimeout(o),Me&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);Me&&(e=requestAnimationFrame(n))}function W(t){var e=g,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),g=e}function ee(t){var e=g;t.__c=t.__(),g=e}function Ie(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function Ne(t,e){return typeof e=="function"?e(t):e}function He(t,e){let n=we(void 0),o=(...r)=>{n.current&&clearTimeout(n.current),n.current=window.setTimeout(()=>{t(...r)},e)};return Se(()=>()=>{n.current&&clearTimeout(n.current)},[]),o}var Ke=new Intl.NumberFormat("en-US"),T=({value:t})=>l(N,null,Ke.format(t));var ne=[{bg:"#c1e7ff",fg:"#000"},{bg:"#abd2ec",fg:"#000"},{bg:"#94bed9",fg:"#000"},{bg:"#7faac6",fg:"#000"},{bg:"#6996b3",fg:"#fff"},{bg:"#5383a1",fg:"#fff"},{bg:"#3d708f",fg:"#fff"},{bg:"#255e7e",fg:"#fff"}],Xe=({scoreBy:t,nodes:e,epoch:n})=>{if(e.length===0)return null;let o=t;if(t.field!=="tokens"){let r=e[0][t.field],_=e[0][t.field];for(let c=1;cr.type===2?l(Je,{scoreBy:o,key:_,node:r}):l(Le,{scoreBy:o,key:_,node:r,epoch:n})))},Fe=({node:t})=>l("div",{className:"node-stats"},"Used Tokens: ",l(T,{value:t.tokens})," / ","Priority:"," ",t.priority===Number.MAX_SAFE_INTEGER?"MAX":l(T,{value:t.priority})),De=({scoreBy:t,node:e,children:n,...o})=>{let r=0;if(t.max!==t.min){let _=(e[t.field]-t.min)/(t.max-t.min);r=Math.round((ne.length-1)*_)}return l("div",{...o,className:`node ${o.className||""}`,style:{backgroundColor:ne[r].bg,color:ne[r].fg}},n)},Je=({scoreBy:t,node:e})=>l(De,{node:e,scoreBy:t,tabIndex:0,className:"node-text"},l(Fe,{node:e}),l("div",{className:"node-content"},e.value)),Le=({scoreBy:t,node:e,epoch:n})=>{let[o,r]=S(!1),_=EPOCHS.findIndex(i=>i.elements.some(f=>f.id===e.id));if(_===void 0)throw new Error(`epoch not found for ${e.id}`);let c=EPOCHS[_],a=EPOCHS.at(n),u=c.elements.find(i=>i.id===e.id).tokenBudget,s=e.type===1?e.name||e.role.slice(0,1).toUpperCase()+e.role.slice(1)+"Message":e.name,p=_===n?"new-in-epoch":n<_?"before-epoch":"";return l(De,{node:e,scoreBy:t,className:p},l(Fe,{node:e}),l("div",{className:"node-content node-toggler",onClick:()=>r(i=>!i)},l("span",null,a?.inNode===e.id?"\\u{1F3C3} ":"",`<${s}>`),l("span",{className:"indicator"},o?"[+]":"[-]")),n===_&&l("div",{className:"node-stats"},"Token Budget: ",l(T,{value:u})),a?.inNode===e.id&&l("div",{className:"node-stats"},"Rendering flexGrow=",a.flexValue,l("br",null),l("br",null),"Splitting"," ",a.reservedTokens?`${a.tokenBudget} - ${a.reservedTokens} (reserved) = `:"",l(T,{value:a.tokenBudget})," tokens among ",a.elements.length," ","elements"),!o&&l(Xe,{nodes:e.children,scoreBy:t,epoch:n}))},Pe=({scoreBy:t,node:e,epoch:n})=>{let o;return t==="tokens"?o={field:"tokens",max:e.tokens,min:0}:o={field:"priority",max:e.priority,min:e.priority},l(Le,{scoreBy:o,node:e,epoch:n})};var ze=({label:t,value:e,onChange:n,min:o,max:r})=>{let _=a=>{n(a.target.valueAsNumber)},c=`number-slider-${Math.random()}`;return l("div",{className:"controls-slider"},l("label",{htmlFor:c},t),l("input",{id:c,type:"range",min:o,max:r,value:e,onInput:_}),l("input",{type:"number",min:o,value:e,onInput:_,onChange:_}))},Qe=({scoreBy:t,onScoreByChange:e})=>{let n=o=>{let r=o.target.value;e(r)};return l("div",{className:"controls-scoreby"},"Visualize by",l("label",null,l("input",{type:"radio",name:"scoreBy",value:"tokens",checked:t==="tokens",onChange:n}),"Tokens"),l("label",null,l("input",{type:"radio",name:"scoreBy",value:"priority",checked:t==="priority",onChange:n}),"Priority"))},Ye=()=>{let[t,e]=S(DEFAULT_TOKENS),[n,o]=S(EPOCHS.length),[r,_]=S(DEFAULT_MODEL),[c,a]=S("tokens"),[u,s]=S("epoch"),p=He(async f=>{if(f===DEFAULT_TOKENS)return DEFAULT_MODEL;let b=await(await fetch(`${SERVER_ADDRESS}regen?n=${f}`)).json();_(b)},100),i=f=>{e(f),p(f),o(EPOCHS.length)};return l("div",{className:"app"},l("div",{className:"controls"},l("div",{className:"tabs"},l("div",{className:`tab ${u==="epoch"?"active":""}`,onClick:()=>s("epoch")},"View Order"),l("div",{className:`tab ${u==="tokens"?"active":""}`,onClick:()=>s("tokens")},"Change Token Budget")),l("div",{className:`tab-content ${u==="epoch"?"active":""}`},l(ze,{label:"Render Epoch",value:n,onChange:o,min:0,max:EPOCHS.length})),l("div",{className:`tab-content ${u==="tokens"?"active":""}`},l(ze,{label:"Token Budget",value:t,onChange:i,min:0,max:DEFAULT_TOKENS*2}))),l("div",{className:"control-description"},u==="tokens"?l("p",null,"Token changes here will prune elements and re-render Expandable ones, but the entire prompt is not being re-rendered"):l("p",null,"Changing the render epoch lets you see the order in which elements are rendered and how the token budget is allocated."),l("div",{className:"controls-stats"},l("span",null,"Used ",l(T,{value:r.container.tokens}),"/",l(T,{value:r.budget})," tokens"),l("span",null,"Removed ",l(T,{value:r.removed})," nodes"),l(Qe,{scoreBy:c,onScoreByChange:a}))),l(Pe,{node:r.container,scoreBy:c,epoch:n}))};ve(l(Ye,null),document.body);})();\n';Zue.tracerCss=`body{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,system-ui,Ubuntu,Droid Sans,sans-serif;background:#fff;margin:0}.render-pass{border-left:2px solid #ccc;&:hover{border-left-color:#000}}.literals li{white-space:pre;font-family:SF Mono,Monaco,Menlo,Consolas,Ubuntu Mono,Liberation Mono,DejaVu Sans Mono,Courier New,monospace}.render-flex,.render-element{padding-left:10px}.node{border:1px solid rgba(255,255,255,.5);margin:3px 10px;padding:3px 10px;border-radius:4px;width:fit-content;&.new-in-epoch{box-shadow:0 0 3px 2px red}&.before-epoch{pointer-events:none;filter:grayscale(1);color:#777!important;.node{color:#777!important}}&:last-child{margin-bottom:0}}.node-content{font-weight:700}.node-children{margin-left:20px;border-left:2px dashed rgba(255,255,255,.5);padding-left:10px}.node-toggler{cursor:pointer;display:flex;align-items:center;justify-content:space-between;.indicator{font-size:.7em}}.node-text{width:400px;&:focus,&:focus-within{outline:1px solid orange;.node-content{white-space:normal}}.node-content{font-weight:400;font-size:.8em;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}}.node-stats{font-family:SF Mono,Monaco,Menlo,Consolas,Ubuntu Mono,Liberation Mono,DejaVu Sans Mono,Courier New,monospace;font-size:.8em}.control-description{padding:10px;p{font-size:.9em;max-width:500px;margin-top:0}}.controls{display:flex;flex-direction:column;gap:10px;position:sticky;top:0;padding:10px;background:#fff;border-bottom:1px solid #ccc;z-index:1}.controls-slider{display:flex;align-items:center;gap:10px}.controls-stats{display:flex;gap:20px;list-style:none;padding:0;margin-top:0}.controls-scoreby{display:flex;gap:10px}.tabs{display:flex;border-bottom:1px solid #ccc;margin-bottom:10px}.tab{padding:10px;cursor:pointer;border:1px solid transparent;border-bottom:none}.tab.active{border-color:#ccc;border-bottom:1px solid #fff;background-color:#f9f9f9}.tab-content{display:none}.tab-content.active{display:block} -`});var x1n=I(BJe=>{"use strict";p();Object.defineProperty(BJe,"__esModule",{value:!0});BJe.HTMLTracer=void 0;var b1n=C1n(),ej=Tjt(),Tzo=Gq(),oHt=class{static{a(this,"HTMLTracer")}traceData;epochs=[];addRenderEpoch(e){this.epochs.push(e)}includeInEpoch(e){this.epochs[this.epochs.length-1].elements.push(e)}didMaterializeTree(e){this.traceData=e}async serveHTML(){return sHt.create({epochs:this.epochs,traceData:T1n(this.traceData)})}serveRouter(e){return new LJe({baseAddress:e,epochs:this.epochs,traceData:T1n(this.traceData)})}};BJe.HTMLTracer=oHt;var LJe=class{static{a(this,"RequestRouter")}opts;serverToken=crypto.randomUUID();constructor(e){this.opts=e}route(e,r){let n=e,o=r,s=new URL(n.url||"/","http://localhost"),c=`/${this.serverToken}`;switch(s.pathname){case c:case`${c}/`:this.onRoot(s,n,o);break;case`${c}/regen`:this.onRegen(s,n,o);break;default:return!1}return!0}get address(){return this.opts.baseAddress+"/"+this.serverToken}async getHTML(){let{traceData:e,epochs:r}=this.opts;return` - +`)}typeof e[e.length-1]=="string"?e[e.length-1]+=r.text:e.push(r.text)}return e});toChatMessage(){let e=this.text.map(r=>{if(typeof r=="string")return{type:qA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof xJ)return{type:qA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:GSn(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof wJ)return{type:qA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof Vq)return{type:qA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof m2)return r.part;throw new Error("Unexpected element type")});if(this.role===qA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===qA.Raw.ChatRole.Assistant){let r={role:this.role,content:e};return this.name&&(r.name=this.name),this.toolCalls?.length&&(r.toolCalls=this.toolCalls.map(n=>({function:n.function,id:n.id,type:n.type}))),r}else return this.role===qA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===qA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};S0.MaterializedChatMessage=g2;var Vq=class{static{a(this,"MaterializedChatMessageOpaque")}parent;part;priority;metadata=[];get value(){return this.part.value}constructor(e,r,n=Number.MAX_SAFE_INTEGER){this.parent=e,this.part=r,this.priority=n}upperBoundTokenCount(e){return this.part.tokenUsage&&qA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};S0.MaterializedChatMessageOpaque=Vq;var m2=class{static{a(this,"MaterializedChatMessageBreakpoint")}parent;part;metadata=[];priority=Number.MAX_SAFE_INTEGER;constructor(e,r){this.parent=e,this.part=r}upperBoundTokenCount(e){return 0}isEmpty=!1};S0.MaterializedChatMessageBreakpoint=m2;var xJ=class{static{a(this,"MaterializedChatMessageImage")}parent;id;src;priority;metadata;lineBreakBefore;detail;mimeType;constructor(e,r,n,o,s=[],c,l,u){this.parent=e,this.id=r,this.src=n,this.priority=o,this.metadata=s,this.lineBreakBefore=c,this.detail=l,this.mimeType=u}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,IJ.once)(async e=>e.tokenLength({type:qA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:GSn(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};S0.MaterializedChatMessageImage=xJ;var wJ=class{static{a(this,"MaterializedChatMessageDocument")}parent;id;data;mediaType;priority;metadata;lineBreakBefore;constructor(e,r,n,o,s,c=[],l){this.parent=e,this.id=r,this.data=n,this.mediaType=o,this.priority=s,this.metadata=c,this.lineBreakBefore=l}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,IJ.once)(async e=>e.tokenLength({type:qA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};S0.MaterializedChatMessageDocument=wJ;function Wq(t){return t instanceof _F||t instanceof g2}a(Wq,"isContainerType");function USn(t){return t instanceof Gwe||t instanceof xJ||t instanceof wJ||t instanceof Vq||t instanceof m2}a(USn,"isContentType");function jWo(t){if(!Wq(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(jWo,"assertContainerOrChatMessage");function*QSn(t,e=!1){for(let r of t.children)r instanceof Gwe?(yield{content:r,isTextSibling:e},e=!0):r instanceof xJ||r instanceof wJ||r instanceof Vq||r instanceof m2?yield{content:r,isTextSibling:!1}:r instanceof Vq?yield{content:r,isTextSibling:!0}:(r&&(yield*QSn(r,e)),e=!1)}a(QSn,"contentChunks");function HWo(t,e){let r;function n(o,s){if(USn(o))(!r||o.priorityn instanceof m2):t instanceof _F&&(r=t.children.some(qSn)),OSn.set(t,r),r}a(qSn,"hasCachePoint");function GWo(t){if(t instanceof g2)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof g2)return!1;return!0}a(GWo,"shouldLookForCachePointInNode");function Sjt(t,e){let r;if(t instanceof _F&&t.has(1)){HWo(t,e);return}let n=GWo(t),o=t.children.map((s,c)=>({chain:[t],index:c}));for(let s=0;s({chain:d,index:h})))}else if(!r||u.priorityo instanceof g2?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};S0.BudgetExceededError=hJe;function LSn(t){if(!Wq(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(LSn,"getLowestPriorityAmongChildren");function*jSn(t){yield*t.metadata;for(let e of t.children)Wq(e)?yield*jSn(e):yield*e.metadata}a(jSn,"allMetadata");function HSn(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,Wq(r)&&e.push(...r.children)}}a(BSn,"forEachNode");function $Wo(t){let e=t;for(;e.parent;)e=e.parent;return e}a($Wo,"getRoot");function FSn(t){return t instanceof _F&&t.keepWithId!==void 0}a(FSn,"isKeepWith");var bjt=new Set;function VWo(t,e){let r=new Set;for(let n of BSn(t))FSn(n)&&!bjt.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)bjt.add(n);try{let n=$Wo(t);for(let o of BSn(n))FSn(o)&&r.has(o.keepWithId)?$we(o,e):o instanceof g2&&o.toolCalls&&(o.toolCalls=WWo(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&&$we(o,e))}finally{for(let n of r)bjt.delete(n)}}a(VWo,"removeOtherKeepWiths");function Tjt(t,e){if(e.id===t)return e;for(let r of e.children)if(Wq(r)){let n=Tjt(t,r);if(n)return n}}a(Tjt,"findNodeById");function $we(t,e){let r=t.parent;if(!r)return;let n=r.children.indexOf(t);n!==-1&&(r.children.splice(n,1),e.push(t),VWo(t,e),r.isEmpty?$we(r,e):r.onChunksChange())}a($we,"removeNode");function GSn(t){let e={"/9j/":"image/jpeg",iVBOR:"image/png",R0lGOD:"image/gif",UklGR:"image/webp"};for(let r of Object.keys(e))if(t.startsWith(r))return`data:${e[r]};base64,${t}`;return t}a(GSn,"getEncodedBase64");function WWo(t,e){for(let r=0;r{"use strict";p();function zWo(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(zWo,"_vscpp");function $Sn(){throw new Error("This should not be invoked!")}a($Sn,"_vscppf");$Sn.isFragment=!0;globalThis.vscpp=zWo;globalThis.vscppf=$Sn});var wjt=I(mJe=>{"use strict";p();Object.defineProperty(mJe,"__esModule",{value:!0});mJe.PromptElement=void 0;VSn();var xjt=class{static{a(this,"PromptElement")}props;get priority(){return this.props.priority??Number.MAX_SAFE_INTEGER}get insertLineBreakBefore(){return!0}constructor(e){this.props=e}};mJe.PromptElement=xjt});var Ujt=I(Vs=>{"use strict";p();Object.defineProperty(Vs,"__esModule",{value:!0});Vs.LogicalWrapper=Vs.IfEmpty=Vs.AbstractKeepWith=Vs.TokenLimit=Vs.Expandable=Vs.Chunk=Vs.LegacyPrioritization=Vs.ToolResult=Vs.PrioritizedList=Vs.Document=Vs.Image=Vs.TextChunk=Vs.ToolMessage=Vs.AssistantMessage=Vs.UserMessage=Vs.SystemMessage=Vs.BaseChatMessage=void 0;Vs.isChatMessagePromptElement=YWo;Vs.useKeepWith=XWo;var Wwe=wo(),AT=wjt();function YWo(t){return t instanceof gJe||t instanceof AJe||t instanceof yJe}a(YWo,"isChatMessagePromptElement");var RJ=class extends AT.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};Vs.BaseChatMessage=RJ;var gJe=class extends RJ{static{a(this,"SystemMessage")}constructor(e){e.role=Wwe.Raw.ChatRole.System,super(e)}};Vs.SystemMessage=gJe;var AJe=class extends RJ{static{a(this,"UserMessage")}constructor(e){e.role=Wwe.Raw.ChatRole.User,super(e)}};Vs.UserMessage=AJe;var yJe=class extends RJ{static{a(this,"AssistantMessage")}constructor(e){e.role=Wwe.Raw.ChatRole.Assistant,super(e)}};Vs.AssistantMessage=yJe;var KWo=/\s+/g,Rjt=class extends RJ{static{a(this,"ToolMessage")}constructor(e){e.role=Wwe.Raw.ChatRole.Tool,super(e)}};Vs.ToolMessage=Rjt;var _Je=class extends AT.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?KWo:this.props.breakOn;if(!o)return vscpp(vscppf,null,this.props.children);let s="",c=[];for(let u of this.props.children||[])if(u&&typeof u=="object"){if(typeof u.ctor!="string")throw new Error("TextChunk children must be text literals or intrinsic attributes.");u.ctor==="br"?s+=` +`:c.push(u)}else u!=null&&(s+=u);let l=await JWo(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};Vs.TextChunk=_Je;async function JWo(t,e,r,n){if(e instanceof RegExp){if(!e.global)throw new Error(`\`breakOn\` expression must have the global flag set (got ${e})`);e.lastIndex=0}let o="",s=-1;for(;st.tokenBudget)return o;o=l,s=c}return o}a(JWo,"getTextContentBelowBudget");var kjt=class extends AT.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Vs.Image=kjt;var Pjt=class extends AT.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Vs.Document=Pjt;var Djt=class extends AT.PromptElement{static{a(this,"PrioritizedList")}render(){let{children:e,priority:r=0,descending:n}=this.props;if(e)return vscpp(vscppf,null,e.map((o,s)=>{if(!o)return;let c=n?r-s:r-e.length+s;return typeof o!="object"?vscpp(_Je,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};Vs.PrioritizedList=Djt;var Njt=class extends AT.PromptElement{static{a(this,"ToolResult")}render(){return vscpp(vscppf,null,this.props.data.content.map(e=>{if(e&&typeof e.value=="string")return e.value;if(e&&e.value&&typeof e.value.node=="object")return vscpp("elementJSON",{data:e.value})}))}};Vs.ToolResult=Njt;var Mjt=class extends AT.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};Vs.LegacyPrioritization=Mjt;var Ojt=class extends AT.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};Vs.Chunk=Ojt;var Ljt=class extends AT.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};Vs.Expandable=Ljt;var Bjt=class extends AT.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};Vs.TokenLimit=Bjt;var EJe=class extends AT.PromptElement{static{a(this,"AbstractKeepWith")}};Vs.AbstractKeepWith=EJe;var ZWo=0;function XWo(){let t=ZWo++;return class extends EJe{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a(XWo,"useKeepWith");var Fjt=class extends AT.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp(Vwe,null,this.props.alt),vscpp(Vwe,{flexGrow:1},this.props.children))}};Vs.IfEmpty=Fjt;var Vwe=class extends AT.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};Vs.LogicalWrapper=Vwe});var zSn=I(zwe=>{"use strict";p();Object.defineProperty(zwe,"__esModule",{value:!0});zwe.localize=ezo;zwe.localize2=tzo;zwe.getConfiguredDefaultLocale=rzo;function WSn(t,e){let r;return e.length===0?r=t:r=t.replace(/\{(\d+)\}/g,function(n,o){let s=o[0];return typeof e[s]<"u"?e[s]:n}),r}a(WSn,"_format");function ezo(t,e,...r){return WSn(e,r)}a(ezo,"localize");function tzo(t,e,...r){let n=WSn(e,r);return{original:n,value:n}}a(tzo,"localize2");function rzo(t){}a(rzo,"getConfiguredDefaultLocale")});var Hjt=I(kr=>{"use strict";p();Object.defineProperty(kr,"__esModule",{value:!0});kr.isAndroid=kr.isEdge=kr.isSafari=kr.isFirefox=kr.isChrome=kr.OS=kr.setTimeout0=kr.setTimeout0IsFaster=kr.translationsConfigFile=kr.platformLocale=kr.locale=kr.Language=kr.language=kr.userAgent=kr.platform=kr.isCI=kr.isMobile=kr.isIOS=kr.webWorkerOrigin=kr.isWebWorker=kr.isWeb=kr.isElectron=kr.isNative=kr.isLinuxSnap=kr.isLinux=kr.isMacintosh=kr.isWindows=kr.LANGUAGE_DEFAULT=void 0;kr.PlatformToString=izo;kr.isLittleEndian=ozo;kr.isBigSurOrNewer=szo;var YSn=zSn();kr.LANGUAGE_DEFAULT="en";var Jwe=!1,Zwe=!1,Kwe=!1,XSn=!1,e1n=!1,qjt=!1,t1n=!1,jjt=!1,r1n=!1,n1n=!1,Ywe,vJe=kr.LANGUAGE_DEFAULT,Qjt=kr.LANGUAGE_DEFAULT,i1n,EF,vF=globalThis,yT;typeof vF.vscode<"u"&&typeof vF.vscode.process<"u"?yT=vF.vscode.process:typeof process<"u"&&(yT=process);var o1n=typeof yT?.versions?.electron=="string",nzo=o1n&&yT?.type==="renderer";if(typeof yT=="object"){Jwe=yT.platform==="win32",Zwe=yT.platform==="darwin",Kwe=yT.platform==="linux",XSn=Kwe&&!!yT.env.SNAP&&!!yT.env.SNAP_REVISION,t1n=o1n,r1n=!!yT.env.CI||!!yT.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ywe=kr.LANGUAGE_DEFAULT,vJe=kr.LANGUAGE_DEFAULT;let t=yT.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];Ywe=e.locale,Qjt=e.osLocale,vJe=r||kr.LANGUAGE_DEFAULT,i1n=e._translationsConfigFile}catch{}e1n=!0}else typeof navigator=="object"&&!nzo?(EF=navigator.userAgent,Jwe=EF.indexOf("Windows")>=0,Zwe=EF.indexOf("Macintosh")>=0,jjt=(EF.indexOf("Macintosh")>=0||EF.indexOf("iPad")>=0||EF.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Kwe=EF.indexOf("Linux")>=0,n1n=EF?.indexOf("Mobi")>=0,qjt=!0,Ywe=YSn.getConfiguredDefaultLocale(YSn.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||kr.LANGUAGE_DEFAULT,vJe=Ywe,Qjt=navigator.language):console.error("Unable to resolve platform.");function izo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(izo,"PlatformToString");var CJe=0;Zwe?CJe=1:Jwe?CJe=3:Kwe&&(CJe=2);kr.isWindows=Jwe;kr.isMacintosh=Zwe;kr.isLinux=Kwe;kr.isLinuxSnap=XSn;kr.isNative=e1n;kr.isElectron=t1n;kr.isWeb=qjt;kr.isWebWorker=qjt&&typeof vF.importScripts=="function";kr.webWorkerOrigin=kr.isWebWorker?vF.origin:void 0;kr.isIOS=jjt;kr.isMobile=n1n;kr.isCI=r1n;kr.platform=CJe;kr.userAgent=EF;kr.language=vJe;var KSn;(function(t){function e(){return kr.language}a(e,"value"),t.value=e;function r(){return kr.language.length===2?kr.language==="en":kr.language.length>=3?kr.language[0]==="e"&&kr.language[1]==="n"&&kr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return kr.language==="en"}a(n,"isDefault"),t.isDefault=n})(KSn||(kr.Language=KSn={}));kr.locale=Ywe;kr.platformLocale=Qjt;kr.translationsConfigFile=i1n;kr.setTimeout0IsFaster=typeof vF.postMessage=="function"&&!vF.importScripts;kr.setTimeout0=(()=>{if(kr.setTimeout0IsFaster){let t=[];vF.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),vF.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();kr.OS=Zwe||jjt?2:Jwe?1:3;var JSn=!0,ZSn=!1;function ozo(){if(!ZSn){ZSn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,JSn=new Uint16Array(t.buffer)[0]===513}return JSn}a(ozo,"isLittleEndian");kr.isChrome=!!(kr.userAgent&&kr.userAgent.indexOf("Chrome")>=0);kr.isFirefox=!!(kr.userAgent&&kr.userAgent.indexOf("Firefox")>=0);kr.isSafari=!!(!kr.isChrome&&kr.userAgent&&kr.userAgent.indexOf("Safari")>=0);kr.isEdge=!!(kr.userAgent&&kr.userAgent.indexOf("Edg/")>=0);kr.isAndroid=!!(kr.userAgent&&kr.userAgent.indexOf("Android")>=0);function szo(t){return parseFloat(t)>=20}a(szo,"isBigSurOrNewer")});var a1n=I(t5=>{"use strict";p();Object.defineProperty(t5,"__esModule",{value:!0});t5.arch=t5.platform=t5.env=t5.cwd=void 0;var s1n=Hjt(),kJ,Gjt=globalThis.vscode;if(typeof Gjt<"u"&&typeof Gjt.process<"u"){let t=Gjt.process;kJ={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?kJ={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:kJ={get platform(){return s1n.isWindows?"win32":s1n.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};t5.cwd=kJ.cwd;t5.env=kJ.env;t5.platform=kJ.platform;t5.arch=kJ.arch});var l1n=I(_n=>{"use strict";p();Object.defineProperty(_n,"__esModule",{value:!0});_n.delimiter=_n.sep=_n.toNamespacedPath=_n.parse=_n.format=_n.extname=_n.basename=_n.dirname=_n.relative=_n.resolve=_n.join=_n.isAbsolute=_n.normalize=_n.posix=_n.win32=void 0;var Kue=a1n(),azo=65,czo=97,lzo=90,uzo=122,Kq=46,T0=47,ab=92,zq=58,dzo=63,bJe=class extends Error{static{a(this,"ErrorInvalidArgType")}code;constructor(e,r,n){let o;typeof r=="string"&&r.indexOf("not ")===0?(o="must not be",r=r.replace(/^not /,"")):o="must be";let s=e.indexOf(".")!==-1?"property":"argument",c=`The "${e}" ${s} ${o} of type ${r}`;c+=`. Received type ${typeof n}`,super(c),this.code="ERR_INVALID_ARG_TYPE"}};function fzo(t,e){if(t===null||typeof t!="object")throw new bJe(e,"Object",t)}a(fzo,"validateObject");function pp(t,e){if(typeof t!="string")throw new bJe(e,"string",t)}a(pp,"validateString");var cb=Kue.platform==="win32";function cs(t){return t===T0||t===ab}a(cs,"isPathSeparator");function $jt(t){return t===T0}a($jt,"isPosixPathSeparator");function Yq(t){return t>=azo&&t<=lzo||t>=czo&&t<=uzo}a(Yq,"isWindowsDeviceRoot");function SJe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===Kq&&l!==-1?++l:l=-1}return o}a(SJe,"normalizeString");function c1n(t,e){fzo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(c1n,"_format");_n.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],pp(s,"path"),s.length===0)continue}else e.length===0?s=Kue.cwd():(s=Kue.env[`=${e}`]||Kue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===ab)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)cs(f)&&(l=1,d=!0);else if(cs(f))if(d=!0,cs(s.charCodeAt(1))){let h=2,m=h;for(;h2&&cs(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=SJe(r,!n,"\\",cs),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){pp(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return $jt(s)?"\\":t;if(cs(s))if(o=!0,cs(t.charCodeAt(1))){let l=2,u=l;for(;l2&&cs(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&cs(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){pp(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return cs(r)||e>2&&Yq(r)&&t.charCodeAt(1)===zq&&cs(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&cs(r.charCodeAt(0))){++o;let s=r.length;s>1&&cs(r.charCodeAt(1))&&(++o,s>2&&(cs(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return _n.win32.normalize(e)},relative(t,e){if(pp(t,"from"),pp(e,"to"),t===e)return"";let r=_n.win32.resolve(t),n=_n.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===ab;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===ab;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===ab)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===ab?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===ab)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===ab&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=_n.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===ab){if(e.charCodeAt(1)===ab){let r=e.charCodeAt(2);if(r!==dzo&&r!==Kq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Yq(e.charCodeAt(0))&&e.charCodeAt(1)===zq&&e.charCodeAt(2)===ab)return`\\\\?\\${e}`;return t},dirname(t){pp(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return cs(o)?t:".";if(cs(o)){if(r=n=1,cs(t.charCodeAt(1))){let l=2,u=l;for(;l2&&cs(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(cs(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&pp(e,"ext"),pp(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&Yq(t.charCodeAt(0))&&t.charCodeAt(1)===zq&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(cs(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(cs(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){pp(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===zq&&Yq(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(cs(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===Kq?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:c1n.bind(null,"\\"),parse(t){pp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return cs(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(cs(o)){if(n=1,cs(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),cs(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===Kq?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var pzo=(()=>{if(cb){let t=/\\/g;return()=>{let e=Kue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Kue.cwd()})();_n.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:pzo();pp(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===T0)}return e=SJe(e,!r,"/",$jt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(pp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===T0,r=t.charCodeAt(t.length-1)===T0;return t=SJe(t,!e,"/",$jt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return pp(t,"path"),t.length>0&&t.charCodeAt(0)===T0},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":_n.posix.normalize(e)},relative(t,e){if(pp(t,"from"),pp(e,"to"),t===e||(t=_n.posix.resolve(t),e=_n.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===T0)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===T0?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===T0)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(pp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===T0,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===T0){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&pp(e,"ext"),pp(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===T0){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===T0){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){pp(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===T0){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===Kq?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:c1n.bind(null,"/"),parse(t){pp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===T0,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===T0){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===Kq?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};_n.posix.win32=_n.win32.win32=_n.win32;_n.posix.posix=_n.win32.posix=_n.posix;_n.normalize=cb?_n.win32.normalize:_n.posix.normalize;_n.isAbsolute=cb?_n.win32.isAbsolute:_n.posix.isAbsolute;_n.join=cb?_n.win32.join:_n.posix.join;_n.resolve=cb?_n.win32.resolve:_n.posix.resolve;_n.relative=cb?_n.win32.relative:_n.posix.relative;_n.dirname=cb?_n.win32.dirname:_n.posix.dirname;_n.basename=cb?_n.win32.basename:_n.posix.basename;_n.extname=cb?_n.win32.extname:_n.posix.extname;_n.format=cb?_n.win32.format:_n.posix.format;_n.parse=cb?_n.win32.parse:_n.posix.parse;_n.toNamespacedPath=cb?_n.win32.toNamespacedPath:_n.posix.toNamespacedPath;_n.sep=cb?_n.win32.sep:_n.posix.sep;_n.delimiter=cb?_n.win32.delimiter:_n.posix.delimiter});var g1n=I(Jue=>{"use strict";p();Object.defineProperty(Jue,"__esModule",{value:!0});Jue.URI=void 0;Jue.isUriComponents=vzo;Jue.uriToFsPath=wJe;var u1n=l1n(),IJe=Hjt(),hzo=/^\w[\w\d+.-]*$/,mzo=/^\//,gzo=/^\/\//;function Azo(t,e){if(!t.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!hzo.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!mzo.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(gzo.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(Azo,"_validateUri");function yzo(t,e){return!t&&!e?"file":t}a(yzo,"_schemeFix");function _zo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==A2&&(e=A2+e):e=A2;break}return e}a(_zo,"_referenceResolution");var tu="",A2="/",Ezo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,xJe=class t{static{a(this,"URI")}static isUri(e){return e instanceof t?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}scheme;authority;path;query;fragment;constructor(e,r,n,o,s,c=!1){typeof e=="object"?(this.scheme=e.scheme||tu,this.authority=e.authority||tu,this.path=e.path||tu,this.query=e.query||tu,this.fragment=e.fragment||tu):(this.scheme=yzo(e,c),this.authority=r||tu,this.path=_zo(this.scheme,n||tu),this.query=o||tu,this.fragment=s||tu,Azo(this,c))}get fsPath(){return wJe(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=tu),n===void 0?n=this.authority:n===null&&(n=tu),o===void 0?o=this.path:o===null&&(o=tu),s===void 0?s=this.query:s===null&&(s=tu),c===void 0?c=this.fragment:c===null&&(c=tu),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new Jq(r,n,o,s,c)}static parse(e,r=!1){let n=Ezo.exec(e);return n?new Jq(n[2]||tu,TJe(n[4]||tu),TJe(n[5]||tu),TJe(n[7]||tu),TJe(n[9]||tu),r):new Jq(tu,tu,tu,tu,tu)}static file(e){let r=tu;if(IJe.isWindows&&(e=e.replace(/\\/g,A2)),e[0]===A2&&e[1]===A2){let n=e.indexOf(A2,2);n===-1?(r=e.substring(2),e=A2):(r=e.substring(2,n),e=e.substring(n)||A2)}return new Jq("file",r,e,tu,tu)}static from(e,r){return new Jq(e.scheme,e.authority,e.path,e.query,e.fragment,r)}static joinPath(e,...r){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return IJe.isWindows&&e.scheme==="file"?n=t.file(u1n.win32.join(wJe(e,!0),...r)).path:n=u1n.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return Vjt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new Jq(e);return r._formatted=e.external??null,r._fsPath=e._sep===p1n?e.fsPath??null:null,r}}else return e}};Jue.URI=xJe;function vzo(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}a(vzo,"isUriComponents");var p1n=IJe.isWindows?1:void 0,Jq=class extends xJe{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=wJe(this,!1)),this._fsPath}toString(e=!1){return e?Vjt(this,!0):(this._formatted||(this._formatted=Vjt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=p1n),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},h1n={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function d1n(t,e,r){let n,o=-1;for(let s=0;s=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||e&&c===47||r&&c===91||r&&c===93||r&&c===58)o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n!==void 0&&(n+=t.charAt(s));else{n===void 0&&(n=t.substr(0,s));let l=h1n[c];l!==void 0?(o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n+=l):o===-1&&(o=s)}}return o!==-1&&(n+=encodeURIComponent(t.substring(o))),n!==void 0?n:t}a(d1n,"encodeURIComponentFast");function Czo(t){let e;for(let r=0;r1&&t.scheme==="file"?r=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?r=t.path.substr(1):r=t.path[1].toLowerCase()+t.path.substr(2):r=t.path,IJe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(wJe,"uriToFsPath");function Vjt(t,e){let r=e?Czo:d1n,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=A2,n+=A2),s){let d=s.indexOf("@");if(d!==-1){let f=s.substr(0,d);s=s.substr(d+1),d=f.lastIndexOf(":"),d===-1?n+=r(f,!1,!1):(n+=r(f.substr(0,d),!1,!1),n+=":",n+=r(f.substr(d+1),!1,!0)),n+="@"}s=s.toLowerCase(),d=s.lastIndexOf(":"),d===-1?n+=r(s,!1,!0):(n+=r(s.substr(0,d),!1,!0),n+=s.substr(d))}if(c){if(c.length>=3&&c.charCodeAt(0)===47&&c.charCodeAt(2)===58){let d=c.charCodeAt(1);d>=65&&d<=90&&(c=`/${String.fromCharCode(d+32)}:${c.substr(3)}`)}else if(c.length>=2&&c.charCodeAt(1)===58){let d=c.charCodeAt(0);d>=65&&d<=90&&(c=`${String.fromCharCode(d+32)}:${c.substr(2)}`)}n+=r(c,!0,!1)}return l&&(n+="?",n+=r(l,!1,!1)),u&&(n+="#",n+=e?u:d1n(u,!1,!1)),n}a(Vjt,"_asFormatted");function m1n(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+m1n(t.substr(3)):t}}a(m1n,"decodeURIComponentGraceful");var f1n=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function TJe(t){return t.match(f1n)?t.replace(f1n,e=>m1n(e)):t}a(TJe,"percentDecode")});var Yjt=I(Zq=>{"use strict";p();Object.defineProperty(Zq,"__esModule",{value:!0});Zq.PromptReference=Zq.ChatResponseReferencePartStatusKind=Zq.PromptMetadata=void 0;var Xwe=g1n(),Wjt=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};Zq.PromptMetadata=Wjt;var A1n;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(A1n||(Zq.ChatResponseReferencePartStatusKind=A1n={}));var zjt=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?Xwe.URI.from(n):{uri:Xwe.URI.from(n.uri),range:n.range},"uriOrLocation");return new t("variableName"in e.anchor?{variableName:e.anchor.variableName,value:e.anchor.value&&r(e.anchor.value)}:r(e.anchor),e.iconPath&&("scheme"in e.iconPath?Xwe.URI.from(e.iconPath):"light"in e.iconPath?{light:Xwe.URI.from(e.iconPath.light),dark:Xwe.URI.from(e.iconPath.dark)}:e.iconPath),e.options)}constructor(e,r,n){this.anchor=e,this.iconPath=r,this.options=n}toJSON(){return{anchor:this.anchor,iconPath:this.iconPath,options:this.options}}};Zq.PromptReference=zjt});var nHt=I(Zue=>{"use strict";p();Object.defineProperty(Zue,"__esModule",{value:!0});Zue.PromptRenderer=Zue.MetadataMap=void 0;var bzo=vjt(),Xq=Ijt(),DJ=Gq(),Jd=Ujt(),rHt=Yjt(),kJe;(function(t){t.empty={get:a(()=>{},"get"),getAll:a(()=>[],"getAll")},t.from=e=>({get:a(r=>e.find(n=>n instanceof r),"get"),getAll:a(r=>e.filter(n=>n instanceof r),"getAll")})})(kJe||(Zue.MetadataMap=kJe={}));var Kjt=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new NJe(null,0);_tokenLimits=[];tracer=void 0;constructor(e,r,n,o){this._endpoint=e,this._ctor=r,this._props=n,this._tokenizer=o}getIgnoredFiles(){return Array.from(new Set(this._ignoredFiles))}getUsedContext(){return this._usedContext}createElement(e){return new e.ctor(e.props)}async _processPromptPieces(e,r,n,o){let s=new Map;for(let[u,d]of r.entries()){if(Array.isArray(d.children)&&(d.props=d.props??{},d.props.children=d.children),!d.ctor){let A=v1n(d.path);throw new Error(`Invalid ChatMessage child! Child must be a TSX component that extends PromptElement at ${A}`)}let f=this.createElement(d),h;f instanceof Jd.TokenLimit&&(h=d.props.max,this._tokenLimits.push({limit:h,id:d.node.id})),d.node.setObj(f);let m=d.props.flexGrow??1/0,g=s.get(m);g||(g=[],s.set(m,g)),g.push({element:d,promptElementInstance:f,tokenLimit:h})}if(s.size===0)return;let c=[...s.entries()].sort(([u],[d])=>d-u).map(([u,d])=>d),l=a(u=>{let d=0;for(let f=u+1;f{if(_.tokenLimit===void 0)return!1;let E=_.element.props.flexBasis??1,v=E/h;return Math.floor(e.remainingTokenBudget*v)<_.tokenLimit?!1:(h-=E,m+=_.tokenLimit,!0)}),A=d.map((_,E)=>{let v=(_.element.props.flexBasis??1)/h;return{tokenBudget:g[E]?_.tokenLimit:Math.floor((e.remainingTokenBudget-m)*v),endpoint:e.endpoint,countTokens:a((S,T)=>this._tokenizer.tokenLength(typeof S=="string"?{type:DJ.Raw.ChatCompletionContentPartKind.Text,text:S}:S,T),"countTokens")}});e.consume(-f),this.tracer?.addRenderEpoch?.({inNode:d[0].element.node.parent?.id,flexValue:d[0].element.props.flexGrow??0,tokenBudget:e.remainingTokenBudget,reservedTokens:f,elements:d.map((_,E)=>({id:_.element.node.id,tokenBudget:A[E].tokenBudget}))}),await Promise.all(d.map(async({element:_,promptElementInstance:E},v)=>{let S=await _1n(_,()=>E.prepare?.(A[v],n,o));_.node.setState(S)}));let y=await Promise.all(d.map(async({element:_,promptElementInstance:E},v)=>{let S=A[v];return await _1n(_,()=>E.render(_.node.getState(),S,n,o))}));for(let[_,{element:E,promptElementInstance:v}]of d.entries()){let S=A[_],T=y[_];if(!T)continue;let w=await this._processPromptRenderPiece(new PJ(S.tokenBudget,this._endpoint),E,v,T,n,o);v instanceof Jd.Expandable&&this._growables.push({initialConsume:w,elem:E.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=E1n(o),u=new PJ(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await Szo(this._tokenizer,r,n,l);return u.consume(d),await this._handlePromptChildren(r,l,u,s,c),u.consumed}async renderElementJSON(e){return await this._processPromptPieces(new PJ(this._endpoint.modelMaxPromptTokens,this._endpoint),[{node:this._root,ctor:this._ctor,props:this._props,children:[],path:[this._ctor]}],void 0,e),{node:this._root.toJSON()}}async render(e,r){let n=await this.renderRaw(e,r);return{...n,messages:(0,DJ.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new PJ(this._endpoint.modelMaxPromptTokens,this._endpoint),[{node:this._root,ctor:this._ctor,props:this._props,children:[],path:[this._ctor]}],e,r);let{container:n,allMetadata:o,removed:s}=await this._getFinalElementTree(this._endpoint.modelMaxPromptTokens,r);this.tracer?.didMaterializeTree?.({budget:this._endpoint.modelMaxPromptTokens,renderedTree:{container:n,removed:s,budget:this._endpoint.modelMaxPromptTokens},tokenizer:this._tokenizer,renderTree:a(m=>this._getFinalElementTree(m,void 0).then(g=>({...g,budget:m})),"renderTree")});let c=[...n.toChatMessages()],l=await n.tokenCount(this._tokenizer),u=[...n.allMetadata()],d=new Set,f=u.map(m=>{if(!(m instanceof r5))return;let g=m.reference,A="variableName"in g.anchor;if(A&&!d.has(g.anchor.variableName))return d.add(g.anchor.variableName),g;if(!A)return g}).filter(MJe),h=o.map(m=>{if(!(m instanceof r5)||u.includes(m))return;let g=m.reference,A="variableName"in g.anchor;if(A&&!d.has(g.anchor.variableName))return d.add(g.anchor.variableName),g;if(!A)return g}).filter(MJe);return{metadata:kJe.from(u),messages:c,hasIgnoredFiles:this._ignoredFiles.length>0,tokenCount:l,references:f,omittedReferences:h}}async _getFinalElementTree(e,r){let n=this._root.materialize(),o=[...n.toChatMessages()],s=[...n.allMetadata()],c=[{limit:e,id:this._root.id},...this._tokenLimits],l=0;for(let u=c.length-1;u>=0;u--){let d=c[u];if(d.limit>e)continue;let f=n.findById(d.id);if(!f)continue;let h=await f.tokenCount(this._tokenizer);if(!(hd.limit;){let g=await f.baseMessageTokenCount(this._tokenizer);do for(let A of f.removeLowestPriorityChild()){l++;let y=A.upperBoundTokenCount(this._tokenizer);m-=(typeof y=="number"?y:await y)*1.25}while(m-g>d.limit);m=await f.tokenCount(this._tokenizer)}}catch(m){throw m instanceof Xq.BudgetExceededError&&(m.metadata=kJe.from([...n.allMetadata()]),m.messages=o),m}}return{container:n,allMetadata:s,removed:l}}async _grow(e,r,n,o){if(!this._growables.length)return!1;for(let s of this._growables){if(!e.findById(s.elem.id))continue;let c=s.elem.getObj();if(!(c instanceof Jd.Expandable))throw new Error("unreachable: expected growable");let l=new NJe(null,0,s.elem.id),u=new PJ(n-r+s.initialConsume,this._endpoint),d=await this._processPromptRenderPiece(u,{node:l,ctor:this._ctor,props:{},children:[],path:[this._ctor]},c,await c.render(void 0,{tokenBudget:u.tokenBudget,endpoint:this._endpoint,countTokens:a((m,g)=>this._tokenizer.tokenLength(typeof m=="string"?{type:DJ.Raw.ChatCompletionContentPartKind.Text,text:m}:m,g),"countTokens")}),void 0,o),f=l.materialize();if(!e.replaceNode(s.elem.id,f))throw new Error("unreachable: could not find old element to replace");if(r-=s.initialConsume,r+=d,r>=n)break}return!0}_handlePromptChildren(e,r,n,o,s){if(e.ctor===Jd.TextChunk){this._handleExtrinsicTextChunkChildren(e.node,e.node,e.props,r);return}let c=[];for(let l of r){if(l.kind==="literal"){e.node.appendStringChild(l.value,e.props.priority??Number.MAX_SAFE_INTEGER);continue}if(l.kind==="intrinsic"){this._handleIntrinsic(e.node,l.name,{priority:e.props.priority??Number.MAX_SAFE_INTEGER,...l.props},PJe(l.children));continue}let u=e.node.createChild();c.push({node:u,ctor:l.ctor,props:l.props,children:l.children,path:[...e.path,l.ctor]})}return this._processPromptPieces(n,c,o,s)}_handleIntrinsic(e,r,n,o,s){switch(r){case"meta":return this._handleIntrinsicMeta(e,n,o);case"br":return this._handleIntrinsicLineBreak(e,n,o,n.priority,s);case"usedContext":return this._handleIntrinsicUsedContext(e,n,o);case"references":return this._handleIntrinsicReferences(e,n,o);case"ignoredFiles":return this._handleIntrinsicIgnoredFiles(e,n,o);case"elementJSON":return this._handleIntrinsicElementJSON(e,n.data);case"cacheBreakpoint":return this._handleIntrinsicCacheBreakpoint(e,n,o,s);case"opaque":return this._handleIntrinsicOpaque(e,n,s)}throw new Error(`Unknown intrinsic element ${r}!`)}_handleIntrinsicCacheBreakpoint(e,r,n,o){if(n.length>0)throw new Error(" must not have children!");e.addCacheBreakpoint(r,o)}_handleIntrinsicMeta(e,r,n){if(n.length>0)throw new Error(" must not have children!");r.local?e.addMetadata(r.value):this._root.addMetadata(r.value)}_handleIntrinsicLineBreak(e,r,n,o,s){if(n.length>0)throw new Error("
must not have children!");e.appendLineBreak(o??Number.MAX_SAFE_INTEGER,s)}_handleIntrinsicOpaque(e,r,n){e.appendOpaque(r.value,r.tokenUsage,r.priority,n)}_handleIntrinsicElementJSON(e,r){let n=e.appendPieceJSON(r.node);if(this.tracer?.includeInEpoch)for(let o of n.elements())this.tracer.includeInEpoch({id:o.id,tokenBudget:0})}_handleIntrinsicUsedContext(e,r,n){if(n.length>0)throw new Error(" must not have children!");this._usedContext.push(...r.value)}_handleIntrinsicReferences(e,r,n){if(n.length>0)throw new Error(" must not have children!");for(let o of r.value)e.addMetadata(new r5(o))}_handleIntrinsicIgnoredFiles(e,r,n){if(n.length>0)throw new Error(" must not have children!");this._ignoredFiles.push(...r.value)}_handleExtrinsicTextChunkChildren(e,r,n,o){let s=[],c=[];for(let l of o){if(l.kind==="extrinsic")throw new Error("TextChunk cannot have extrinsic children!");if(l.kind==="literal"&&s.push(l.value),l.kind==="intrinsic")if(l.name==="br")s.push(` +`);else if(l.name==="references")for(let u of l.props.value)c.push(new r5(u));else this._handleIntrinsic(e,l.name,l.props,PJe(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};Zue.PromptRenderer=Kjt;async function Szo(t,e,r,n){let o=0;if((0,Jd.isChatMessagePromptElement)(r)){let s={role:e.props.role,content:[],...e.props.name?{name:e.props.name}:void 0,...e.props.toolCalls?{toolCalls:e.props.toolCalls}:void 0,...e.props.toolCallId?{toolCallId:e.props.toolCallId}:void 0};o+=await t.countMessageTokens((0,DJ.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:DJ.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(Szo,"computeTokensConsumedByLiterals");function E1n(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new Xjt(String(t))):Tzo(t)?PJe(t.children,e):Izo(t)?PJe(t,e):typeof t.ctor=="string"?e.push(new Jjt(t.ctor,t.props,t.children)):e.push(new Zjt(t.ctor,t.props,t.children)),e)}a(E1n,"flattenAndReduce");function PJe(t,e=[]){for(let r of t)E1n(r,e);return e}a(PJe,"flattenAndReduceArr");var Jjt=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},Zjt=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},Xjt=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},DJe=class t{static{a(this,"PromptOpaque")}parent;childIndex;value;tokenUsage;priority;static fromJSON(e,r,n){return new t(e,r,n.value,n.tokenUsage,n.priority)}kind=2;constructor(e,r,n,o,s){this.parent=e,this.childIndex=r,this.value=n,this.tokenUsage=o,this.priority=s}materialize(e){return new Xq.MaterializedChatMessageOpaque(e,{type:DJ.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},PJ=class{static{a(this,"PromptSizingContext")}tokenBudget;endpoint;_consumed=0;constructor(e,r){this.tokenBudget=e,this.endpoint=r}get consumed(){return this._consumed>this.tokenBudget?this.tokenBudget:this._consumed}get remainingTokenBudget(){return Math.max(0,this.tokenBudget-this._consumed)}consume(e){this._consumed+=e}},NJe=class t{static{a(this,"PromptTreeElement")}parent;childIndex;id;static _nextId=0;static fromJSON(e,r,n){let o=new t(null,e);switch(o._metadata=r.references?.map(s=>new r5(rHt.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return eRe.fromJSON(o,c,s);case 3:return DJe.fromJSON(o,c,s);default:}}).filter(MJe),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new Jd.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,Jd.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new Jd.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new Jd.Image(r.props);break;case 4:o._obj=new Jd.Document(r.props);break;default:}return o}kind=1;_obj=null;_state=void 0;_children=[];_metadata=[];_objFlags=0;constructor(e=null,r,n=t._nextId++){this.parent=e,this.childIndex=r,this.id=n}setObj(e){this._obj=e,this._obj instanceof Jd.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof Jd.Chunk&&(this._objFlags|=2),this._obj instanceof Jd.IfEmpty&&(this._objFlags|=8),this._obj.props.passPriority&&(this._objFlags|=4)}getObj(){return this._obj}setState(e){this._state=e}getState(){return this._state}createChild(){let e=new t(this,this._children.length);return this._children.push(e),e}appendPieceJSON(e){let r=t.fromJSON(this._children.length,e,new Map);return this._children.push(r),r}appendStringChild(e,r,n,o=this._children.length,s=!1){this._children.push(new eRe(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new eRe(this,r,` +`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new DJe(this,o,e,r,n))}toJSON(){let e={type:1,ctor:2,ctorName:this._obj?.constructor.name,children:this._children.slice().sort((r,n)=>r.childIndex-n.childIndex).map(r=>r.toJSON()).filter(MJe),props:{},references:this._metadata.filter(r=>r instanceof r5).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=RJe(this._obj.props,bzo.jsonRetainedProps)),this._obj instanceof Jd.BaseChatMessage)e.ctor=1,Object.assign(e.props,RJe(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof Jd.Image)return{...e,ctor:3,props:{...e.props,...RJe(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof Jd.Document)return{...e,ctor:4,props:{...e.props,...RJe(this._obj.props,["data","mediaType"])}};this._obj instanceof Jd.AbstractKeepWith&&(e.keepWithId=this._obj.id)}return this._objFlags!==0&&(e.flags=this._objFlags),e}materialize(e){if(this._children.sort((r,n)=>r.childIndex-n.childIndex),this._obj instanceof Jd.Image)return new Xq.MaterializedChatMessageImage(e,this.id,this._obj.props.src,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,0,this._obj.props.detail??void 0,this._obj.props.mimeType??void 0);if(this._obj instanceof Jd.Document)return new Xq.MaterializedChatMessageDocument(e,this.id,this._obj.props.data,this._obj.props.mediaType,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,0);if(this._obj instanceof Jd.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new Xq.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof Jd.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof Jd.ToolMessage?this._obj.props.toolCallId:void 0,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,r=>this._children.map(n=>n.materialize(r)))}else{let r=new Xq.GenericMaterializedContainer(e,this.id,this._obj?.constructor.name,this._obj?.props.priority??(this._obj?.props.passPriority?0:Number.MAX_SAFE_INTEGER),n=>this._children.map(o=>o.materialize(n)),this._metadata,this._objFlags);return this._obj instanceof Jd.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof Jd.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new eHt({type:DJ.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},eHt=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new Xq.MaterializedChatMessageBreakpoint(e,this.part)}},eRe=class t{static{a(this,"PromptText")}parent;childIndex;text;priority;metadata;lineBreakBefore;static fromJSON(e,r,n){return new t(e,r,n.text,n.priority,n.references?.map(o=>new r5(rHt.PromptReference.fromJSON(o))),n.lineBreakBefore)}kind=2;constructor(e,r,n,o,s,c=!1){this.parent=e,this.childIndex=r,this.text=n,this.priority=o,this.metadata=s,this.lineBreakBefore=c}materialize(e){let r=this.lineBreakBefore?1:this.childIndex===0?2:0;return new Xq.MaterializedChatMessageTextChunk(e,this.text,this.priority??Number.MAX_SAFE_INTEGER,this.metadata||[],r)}toJSON(){return{type:2,priority:this.priority,text:this.text,references:this.metadata?.filter(e=>e instanceof r5).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function Tzo(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a(Tzo,"isFragmentCtor");function MJe(t){return t!==void 0}a(MJe,"isDefined");var tHt=class extends rHt.PromptMetadata{static{a(this,"InternalMetadata")}},r5=class extends tHt{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function Izo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(Izo,"isIterable");function RJe(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(RJe,"pickProps");function v1n(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(v1n,"atPath");var y1n=new WeakSet;async function _1n(t,e){try{return await e()}catch(r){throw r instanceof Error&&!y1n.has(r)&&r.constructor.name!=="CancellationError"&&(y1n.add(r),r.message+=` (at tsx element ${v1n(t.path)})`),r}}a(_1n,"annotateError")});var C1n=I(OJe=>{"use strict";p();Object.defineProperty(OJe,"__esModule",{value:!0});OJe.VSCodeTokenizer=void 0;var iHt=Gq(),oHt=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=iHt.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==iHt.OutputMode.VSCode)throw new Error("`mode` must be set to vscode when using vscode.LanguageModelChat as the tokenizer")}async tokenLength(e,r){return e.type===iHt.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};OJe.VSCodeTokenizer=oHt});var b1n=I(Xue=>{"use strict";p();Object.defineProperty(Xue,"__esModule",{value:!0});Xue.tracerCss=Xue.tracerSrc=void 0;Xue.tracerSrc='"use strict";(()=>{var $,m,se,Ue,w,re,le,q,X,G,K,Ae,D={},ce=[],Re=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,J=Array.isArray;function E(t,e){for(var n in e)t[n]=e[n];return t}function ue(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function l(t,e,n){var o,r,_,c={};for(_ in e)_=="key"?o=e[_]:_=="ref"?r=e[_]:c[_]=e[_];if(arguments.length>2&&(c.children=arguments.length>3?$.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(_ in t.defaultProps)c[_]===void 0&&(c[_]=t.defaultProps[_]);return R(t,c,o,r,null)}function R(t,e,n,o,r){var _={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++se,__i:-1,__u:0};return r==null&&m.vnode!=null&&m.vnode(_),_}function N(t){return t.children}function B(t,e){this.props=t,this.context=e}function I(t,e){if(e==null)return t.__?I(t.__,t.__i+1):null;for(var n;ee&&w.sort(q));O.__r=0}function pe(t,e,n,o,r,_,c,a,u,s,p){var i,f,d,b,x,C=o&&o.__k||ce,h=e.length;for(n.__d=u,Be(n,e,C),u=n.__d,i=0;i0?R(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r).__=t,r.__b=t.__b+1,_=null,(a=r.__i=Oe(r,n,c,p))!==-1&&(p--,(_=n[a])&&(_.__u|=131072)),_==null||_.__v===null?(a==-1&&i--,typeof r.type!="function"&&(r.__u|=65536)):a!==c&&(a==c-1?i--:a==c+1?i++:(a>c?i--:i++,r.__u|=65536))):r=t.__k[o]=null;if(p)for(o=0;o(u!=null&&(131072&u.__u)==0?1:0))for(;c>=0||a=0){if((u=e[c])&&(131072&u.__u)==0&&r==u.key&&_===u.type)return c;c--}if(a=n.__.length&&n.__.push({}),n.__[t]}function S(t){return V=1,Ve(Ne,t)}function Ve(t,e,n){var o=te(L++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):Ne(void 0,e),function(a){var u=o.__N?o.__N[0]:o.__[0],s=o.t(u,a);u!==s&&(o.__N=[s,o.__[1]],o.__c.setState({}))}],o.__c=g,!g.u)){var r=function(a,u,s){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(f){return!!f.__c});if(p.every(function(f){return!f.__N}))return!_||_.call(this,a,u,s);var i=!1;return p.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(i=!0)}}),!(!i&&o.__c.props===a)&&(!_||_.call(this,a,u,s))};g.u=!0;var _=g.shouldComponentUpdate,c=g.componentWillUpdate;g.componentWillUpdate=function(a,u,s){if(this.__e){var p=_;_=void 0,r(a,u,s),_=p}c&&c.call(this,a,u,s)},g.shouldComponentUpdate=r}return o.__N||o.__}function Se(t,e){var n=te(L++,3);!y.__s&&Ie(n.__H,e)&&(n.__=t,n.i=e,g.__H.__h.push(n))}function we(t){return V=5,je(function(){return{current:t}},[])}function je(t,e){var n=te(L++,7);return Ie(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function qe(){for(var t;t=Ee.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(W),t.__H.__h.forEach(ee),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){g=null,be&&be(t)},y.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Te&&Te(t,e)},y.__r=function(t){ye&&ye(t),L=0;var e=(g=t.__c).__H;e&&(Z===g?(e.__h=[],g.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(W),e.__h.forEach(ee),e.__h=[],L=0)),Z=g},y.diffed=function(t){Ce&&Ce(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Ee.push(e)!==1&&ge===y.requestAnimationFrame||((ge=y.requestAnimationFrame)||Ge)(qe)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Z=g=null},y.__c=function(t,e){e.some(function(n){try{n.__h.forEach(W),n.__h=n.__h.filter(function(o){return!o.__||ee(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],y.__e(o,n.__v)}}),xe&&xe(t,e)},y.unmount=function(t){ke&&ke(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{W(o)}catch(r){e=r}}),n.__H=void 0,e&&y.__e(e,n.__v))};var Me=typeof requestAnimationFrame=="function";function Ge(t){var e,n=function(){clearTimeout(o),Me&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);Me&&(e=requestAnimationFrame(n))}function W(t){var e=g,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),g=e}function ee(t){var e=g;t.__c=t.__(),g=e}function Ie(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function Ne(t,e){return typeof e=="function"?e(t):e}function He(t,e){let n=we(void 0),o=(...r)=>{n.current&&clearTimeout(n.current),n.current=window.setTimeout(()=>{t(...r)},e)};return Se(()=>()=>{n.current&&clearTimeout(n.current)},[]),o}var Ke=new Intl.NumberFormat("en-US"),T=({value:t})=>l(N,null,Ke.format(t));var ne=[{bg:"#c1e7ff",fg:"#000"},{bg:"#abd2ec",fg:"#000"},{bg:"#94bed9",fg:"#000"},{bg:"#7faac6",fg:"#000"},{bg:"#6996b3",fg:"#fff"},{bg:"#5383a1",fg:"#fff"},{bg:"#3d708f",fg:"#fff"},{bg:"#255e7e",fg:"#fff"}],Xe=({scoreBy:t,nodes:e,epoch:n})=>{if(e.length===0)return null;let o=t;if(t.field!=="tokens"){let r=e[0][t.field],_=e[0][t.field];for(let c=1;cr.type===2?l(Je,{scoreBy:o,key:_,node:r}):l(Le,{scoreBy:o,key:_,node:r,epoch:n})))},Fe=({node:t})=>l("div",{className:"node-stats"},"Used Tokens: ",l(T,{value:t.tokens})," / ","Priority:"," ",t.priority===Number.MAX_SAFE_INTEGER?"MAX":l(T,{value:t.priority})),De=({scoreBy:t,node:e,children:n,...o})=>{let r=0;if(t.max!==t.min){let _=(e[t.field]-t.min)/(t.max-t.min);r=Math.round((ne.length-1)*_)}return l("div",{...o,className:`node ${o.className||""}`,style:{backgroundColor:ne[r].bg,color:ne[r].fg}},n)},Je=({scoreBy:t,node:e})=>l(De,{node:e,scoreBy:t,tabIndex:0,className:"node-text"},l(Fe,{node:e}),l("div",{className:"node-content"},e.value)),Le=({scoreBy:t,node:e,epoch:n})=>{let[o,r]=S(!1),_=EPOCHS.findIndex(i=>i.elements.some(f=>f.id===e.id));if(_===void 0)throw new Error(`epoch not found for ${e.id}`);let c=EPOCHS[_],a=EPOCHS.at(n),u=c.elements.find(i=>i.id===e.id).tokenBudget,s=e.type===1?e.name||e.role.slice(0,1).toUpperCase()+e.role.slice(1)+"Message":e.name,p=_===n?"new-in-epoch":n<_?"before-epoch":"";return l(De,{node:e,scoreBy:t,className:p},l(Fe,{node:e}),l("div",{className:"node-content node-toggler",onClick:()=>r(i=>!i)},l("span",null,a?.inNode===e.id?"\\u{1F3C3} ":"",`<${s}>`),l("span",{className:"indicator"},o?"[+]":"[-]")),n===_&&l("div",{className:"node-stats"},"Token Budget: ",l(T,{value:u})),a?.inNode===e.id&&l("div",{className:"node-stats"},"Rendering flexGrow=",a.flexValue,l("br",null),l("br",null),"Splitting"," ",a.reservedTokens?`${a.tokenBudget} - ${a.reservedTokens} (reserved) = `:"",l(T,{value:a.tokenBudget})," tokens among ",a.elements.length," ","elements"),!o&&l(Xe,{nodes:e.children,scoreBy:t,epoch:n}))},Pe=({scoreBy:t,node:e,epoch:n})=>{let o;return t==="tokens"?o={field:"tokens",max:e.tokens,min:0}:o={field:"priority",max:e.priority,min:e.priority},l(Le,{scoreBy:o,node:e,epoch:n})};var ze=({label:t,value:e,onChange:n,min:o,max:r})=>{let _=a=>{n(a.target.valueAsNumber)},c=`number-slider-${Math.random()}`;return l("div",{className:"controls-slider"},l("label",{htmlFor:c},t),l("input",{id:c,type:"range",min:o,max:r,value:e,onInput:_}),l("input",{type:"number",min:o,value:e,onInput:_,onChange:_}))},Qe=({scoreBy:t,onScoreByChange:e})=>{let n=o=>{let r=o.target.value;e(r)};return l("div",{className:"controls-scoreby"},"Visualize by",l("label",null,l("input",{type:"radio",name:"scoreBy",value:"tokens",checked:t==="tokens",onChange:n}),"Tokens"),l("label",null,l("input",{type:"radio",name:"scoreBy",value:"priority",checked:t==="priority",onChange:n}),"Priority"))},Ye=()=>{let[t,e]=S(DEFAULT_TOKENS),[n,o]=S(EPOCHS.length),[r,_]=S(DEFAULT_MODEL),[c,a]=S("tokens"),[u,s]=S("epoch"),p=He(async f=>{if(f===DEFAULT_TOKENS)return DEFAULT_MODEL;let b=await(await fetch(`${SERVER_ADDRESS}regen?n=${f}`)).json();_(b)},100),i=f=>{e(f),p(f),o(EPOCHS.length)};return l("div",{className:"app"},l("div",{className:"controls"},l("div",{className:"tabs"},l("div",{className:`tab ${u==="epoch"?"active":""}`,onClick:()=>s("epoch")},"View Order"),l("div",{className:`tab ${u==="tokens"?"active":""}`,onClick:()=>s("tokens")},"Change Token Budget")),l("div",{className:`tab-content ${u==="epoch"?"active":""}`},l(ze,{label:"Render Epoch",value:n,onChange:o,min:0,max:EPOCHS.length})),l("div",{className:`tab-content ${u==="tokens"?"active":""}`},l(ze,{label:"Token Budget",value:t,onChange:i,min:0,max:DEFAULT_TOKENS*2}))),l("div",{className:"control-description"},u==="tokens"?l("p",null,"Token changes here will prune elements and re-render Expandable ones, but the entire prompt is not being re-rendered"):l("p",null,"Changing the render epoch lets you see the order in which elements are rendered and how the token budget is allocated."),l("div",{className:"controls-stats"},l("span",null,"Used ",l(T,{value:r.container.tokens}),"/",l(T,{value:r.budget})," tokens"),l("span",null,"Removed ",l(T,{value:r.removed})," nodes"),l(Qe,{scoreBy:c,onScoreByChange:a}))),l(Pe,{node:r.container,scoreBy:c,epoch:n}))};ve(l(Ye,null),document.body);})();\n';Xue.tracerCss=`body{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,system-ui,Ubuntu,Droid Sans,sans-serif;background:#fff;margin:0}.render-pass{border-left:2px solid #ccc;&:hover{border-left-color:#000}}.literals li{white-space:pre;font-family:SF Mono,Monaco,Menlo,Consolas,Ubuntu Mono,Liberation Mono,DejaVu Sans Mono,Courier New,monospace}.render-flex,.render-element{padding-left:10px}.node{border:1px solid rgba(255,255,255,.5);margin:3px 10px;padding:3px 10px;border-radius:4px;width:fit-content;&.new-in-epoch{box-shadow:0 0 3px 2px red}&.before-epoch{pointer-events:none;filter:grayscale(1);color:#777!important;.node{color:#777!important}}&:last-child{margin-bottom:0}}.node-content{font-weight:700}.node-children{margin-left:20px;border-left:2px dashed rgba(255,255,255,.5);padding-left:10px}.node-toggler{cursor:pointer;display:flex;align-items:center;justify-content:space-between;.indicator{font-size:.7em}}.node-text{width:400px;&:focus,&:focus-within{outline:1px solid orange;.node-content{white-space:normal}}.node-content{font-weight:400;font-size:.8em;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}}.node-stats{font-family:SF Mono,Monaco,Menlo,Consolas,Ubuntu Mono,Liberation Mono,DejaVu Sans Mono,Courier New,monospace;font-size:.8em}.control-description{padding:10px;p{font-size:.9em;max-width:500px;margin-top:0}}.controls{display:flex;flex-direction:column;gap:10px;position:sticky;top:0;padding:10px;background:#fff;border-bottom:1px solid #ccc;z-index:1}.controls-slider{display:flex;align-items:center;gap:10px}.controls-stats{display:flex;gap:20px;list-style:none;padding:0;margin-top:0}.controls-scoreby{display:flex;gap:10px}.tabs{display:flex;border-bottom:1px solid #ccc;margin-bottom:10px}.tab{padding:10px;cursor:pointer;border:1px solid transparent;border-bottom:none}.tab.active{border-color:#ccc;border-bottom:1px solid #fff;background-color:#f9f9f9}.tab-content{display:none}.tab-content.active{display:block} +`});var w1n=I(BJe=>{"use strict";p();Object.defineProperty(BJe,"__esModule",{value:!0});BJe.HTMLTracer=void 0;var S1n=b1n(),ej=Ijt(),xzo=Gq(),sHt=class{static{a(this,"HTMLTracer")}traceData;epochs=[];addRenderEpoch(e){this.epochs.push(e)}includeInEpoch(e){this.epochs[this.epochs.length-1].elements.push(e)}didMaterializeTree(e){this.traceData=e}async serveHTML(){return aHt.create({epochs:this.epochs,traceData:I1n(this.traceData)})}serveRouter(e){return new LJe({baseAddress:e,epochs:this.epochs,traceData:I1n(this.traceData)})}};BJe.HTMLTracer=sHt;var LJe=class{static{a(this,"RequestRouter")}opts;serverToken=crypto.randomUUID();constructor(e){this.opts=e}route(e,r){let n=e,o=r,s=new URL(n.url||"/","http://localhost"),c=`/${this.serverToken}`;switch(s.pathname){case c:case`${c}/`:this.onRoot(s,n,o);break;case`${c}/regen`:this.onRegen(s,n,o);break;default:return!1}return!0}get address(){return this.opts.baseAddress+"/"+this.serverToken}async getHTML(){let{traceData:e,epochs:r}=this.opts;return` + - `}async onRegen(e,r,n){let{traceData:o}=this.opts,s=Number(e.searchParams.get("n")||o.budget),c=await o.renderTree(s),l=await S1n(o.tokenizer,c),u=JSON.stringify(l);n.setHeader("Content-Type","application/json"),n.setHeader("Content-Length",Buffer.byteLength(u)),n.end(u)}onRoot(e,r,n){this.getHTML().then(o=>{n.setHeader("Content-Type","text/html"),n.setHeader("Content-Length",Buffer.byteLength(o)),n.end(o)})}},sHt=class t extends LJe{static{a(this,"RequestServer")}server;static async create(e){let{createServer:r}=await Promise.resolve().then(()=>require("http")),n=r((c,l)=>{try{s.route(c,l)||(l.statusCode=404,l.end("Not Found"))}catch(u){l.statusCode=500,l.end(String(u))}}),o=await new Promise((c,l)=>{n.listen(0,"127.0.0.1",()=>c(n.address().port)).on("error",l)}),s=new t({...e,baseAddress:`http://127.0.0.1:${o}`},n);return s}constructor(e,r){super(e),this.server=r}dispose(){this.server.closeAllConnections(),this.server.close()}};async function S1n(t,e){return{container:await I1n(t,e.container,!1),removed:e.removed,budget:e.budget}}a(S1n,"serializeRenderData");async function I1n(t,e,r){let n={metadata:e.metadata.map(xzo),priority:e.priority};if(e instanceof ej.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof ej.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof ej.MaterializedChatMessageOpaque||e instanceof ej.MaterializedChatMessageBreakpoint||e instanceof ej.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>I1n(t,s,r||e instanceof ej.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof ej.GenericMaterializedContainer)return{...o,type:0};if(e instanceof ej.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:Tzo.Raw.ChatRole.display(e.role),text:s}}}Izo(e)}a(I1n,"serializeMaterialized");function Izo(t){throw new Error("unreachable")}a(Izo,"assertNever");function xzo(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(xzo,"serializeMetadata");var T1n=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var R1n=I(w1n=>{"use strict";p();Object.defineProperty(w1n,"__esModule",{value:!0})});var P1n=I(k1n=>{"use strict";p();Object.defineProperty(k1n,"__esModule",{value:!0})});var N1n=I(D1n=>{"use strict";p();Object.defineProperty(D1n,"__esModule",{value:!0})});var wo=I(ud=>{"use strict";p();var wzo=ud&&ud.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DJ=ud&&ud.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wzo(e,t,r)};Object.defineProperty(ud,"__esModule",{value:!0});ud.contentType=ud.PromptRenderer=ud.MetadataMap=ud.PromptElement=ud.JSONTree=void 0;ud.renderPrompt=Pzo;ud.renderElementJSON=Dzo;var aHt=Gq(),M1n=rHt(),Rzo=v1n();DJ(x1n(),ud);ud.JSONTree=Ejt();DJ(Gq(),ud);DJ(Fjt(),ud);DJ(zjt(),ud);DJ(R1n(),ud);DJ(P1n(),ud);DJ(N1n(),ud);var kzo=xjt();Object.defineProperty(ud,"PromptElement",{enumerable:!0,get:a(function(){return kzo.PromptElement},"get")});var O1n=rHt();Object.defineProperty(ud,"MetadataMap",{enumerable:!0,get:a(function(){return O1n.MetadataMap},"get")});Object.defineProperty(ud,"PromptRenderer",{enumerable:!0,get:a(function(){return O1n.PromptRenderer},"get")});async function Pzo(t,e,r,n,o,s,c=aHt.OutputMode.VSCode){let l="countTokens"in n?new Rzo.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new M1n.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(Pzo,"renderPrompt");ud.contentType="application/vnd.codechat.prompt+json.1";function Dzo(t,e,r,n){return new M1n.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:aHt.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===aHt.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(Dzo,"renderElementJSON")});var GIn=I((_0d,ARe)=>{"use strict";p();var zZe=a(function(){},"NullObject");zZe.prototype=Object.create(null);var VZe=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,WZe=/\\([\v\u0020-\u00ff])/gu,qIn=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,jJ={type:"",parameters:new zZe};Object.freeze(jJ.parameters);Object.freeze(jJ);function jIn(t){if(typeof t!="string")throw new TypeError("argument header is required and must be a string");let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(qIn.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new zZe};if(e===-1)return n;let o,s,c;for(VZe.lastIndex=e;s=VZe.exec(t);){if(s.index!==e)throw new TypeError("invalid parameter format");e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),WZe.test(c)&&(c=c.replace(WZe,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(jIn,"parse");function HIn(t){if(typeof t!="string")return jJ;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(qIn.test(r)===!1)return jJ;let n={type:r.toLowerCase(),parameters:new zZe};if(e===-1)return n;let o,s,c;for(VZe.lastIndex=e;s=VZe.exec(t);){if(s.index!==e)return jJ;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),WZe.test(c)&&(c=c.replace(WZe,"$1"))),n.parameters[o]=c}return e!==t.length?jJ:n}a(HIn,"safeParse");ARe.exports.default={parse:jIn,safeParse:HIn};ARe.exports.parse=jIn;ARe.exports.safeParse=HIn;ARe.exports.defaultContentType=jJ});var dj=I(w0=>{"use strict";p();Object.defineProperty(w0,"__esModule",{value:!0});w0.MonotonousArray=void 0;w0.findLast=cZo;w0.findLastIdx=Bxn;w0.findFirst=lZo;w0.findFirstIdx=Fxn;w0.findLastMonotonous=uZo;w0.findLastIdxMonotonous=VGt;w0.findFirstMonotonous=dZo;w0.findFirstIdxMonotonousOrArrLen=WGt;w0.findFirstIdxMonotonous=fZo;w0.findFirstMax=Uxn;w0.findLastMax=pZo;w0.findFirstMin=hZo;w0.findMaxIdx=mZo;w0.mapFindFirst=gZo;function cZo(t,e,r=t.length-1){let n=Bxn(t,e,r);if(n!==-1)return t[n]}a(cZo,"findLast");function Bxn(t,e,r=t.length-1){for(let n=r;n>=0;n--){let o=t[n];if(e(o,n))return n}return-1}a(Bxn,"findLastIdx");function lZo(t,e,r=0){let n=Fxn(t,e,r);if(n!==-1)return t[n]}a(lZo,"findFirst");function Fxn(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(Uxn,"findFirstMax");function pZo(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(pZo,"findLastMax");function hZo(t,e){return Uxn(t,(r,n)=>-e(r,n))}a(hZo,"findFirstMin");function mZo(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(mZo,"findMaxIdx");function gZo(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(gZo,"mapFindFirst")});var Os=I(ko=>{"use strict";p();Object.defineProperty(ko,"__esModule",{value:!0});ko.BugIndicatingError=ko.ErrorNoTelemetry=ko.ExpectedError=ko.NotSupportedError=ko.NotImplementedError=ko.ReadonlyError=ko.PendingMigrationError=ko.CancellationError=ko.canceledName=ko.errorHandler=ko.ErrorHandler=void 0;ko.setUnexpectedErrorHandler=AZo;ko.isSigPipeError=yZo;ko.onBugIndicatingError=_Zo;ko.onUnexpectedError=EZo;ko.onUnexpectedExternalError=vZo;ko.transformErrorForSerialization=Qxn;ko.transformErrorFromSerialization=qxn;ko.isCancellationError=e$t;ko.canceled=CZo;ko.illegalArgument=bZo;ko.illegalState=SZo;ko.getErrorMessage=TZo;var yXe=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?VJ.isErrorNoTelemetry(e)?new VJ(e.message+` + `}async onRegen(e,r,n){let{traceData:o}=this.opts,s=Number(e.searchParams.get("n")||o.budget),c=await o.renderTree(s),l=await T1n(o.tokenizer,c),u=JSON.stringify(l);n.setHeader("Content-Type","application/json"),n.setHeader("Content-Length",Buffer.byteLength(u)),n.end(u)}onRoot(e,r,n){this.getHTML().then(o=>{n.setHeader("Content-Type","text/html"),n.setHeader("Content-Length",Buffer.byteLength(o)),n.end(o)})}},aHt=class t extends LJe{static{a(this,"RequestServer")}server;static async create(e){let{createServer:r}=await Promise.resolve().then(()=>require("http")),n=r((c,l)=>{try{s.route(c,l)||(l.statusCode=404,l.end("Not Found"))}catch(u){l.statusCode=500,l.end(String(u))}}),o=await new Promise((c,l)=>{n.listen(0,"127.0.0.1",()=>c(n.address().port)).on("error",l)}),s=new t({...e,baseAddress:`http://127.0.0.1:${o}`},n);return s}constructor(e,r){super(e),this.server=r}dispose(){this.server.closeAllConnections(),this.server.close()}};async function T1n(t,e){return{container:await x1n(t,e.container,!1),removed:e.removed,budget:e.budget}}a(T1n,"serializeRenderData");async function x1n(t,e,r){let n={metadata:e.metadata.map(Rzo),priority:e.priority};if(e instanceof ej.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof ej.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof ej.MaterializedChatMessageOpaque||e instanceof ej.MaterializedChatMessageBreakpoint||e instanceof ej.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>x1n(t,s,r||e instanceof ej.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof ej.GenericMaterializedContainer)return{...o,type:0};if(e instanceof ej.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:xzo.Raw.ChatRole.display(e.role),text:s}}}wzo(e)}a(x1n,"serializeMaterialized");function wzo(t){throw new Error("unreachable")}a(wzo,"assertNever");function Rzo(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(Rzo,"serializeMetadata");var I1n=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var k1n=I(R1n=>{"use strict";p();Object.defineProperty(R1n,"__esModule",{value:!0})});var D1n=I(P1n=>{"use strict";p();Object.defineProperty(P1n,"__esModule",{value:!0})});var M1n=I(N1n=>{"use strict";p();Object.defineProperty(N1n,"__esModule",{value:!0})});var wo=I(ud=>{"use strict";p();var kzo=ud&&ud.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NJ=ud&&ud.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kzo(e,t,r)};Object.defineProperty(ud,"__esModule",{value:!0});ud.contentType=ud.PromptRenderer=ud.MetadataMap=ud.PromptElement=ud.JSONTree=void 0;ud.renderPrompt=Nzo;ud.renderElementJSON=Mzo;var cHt=Gq(),O1n=nHt(),Pzo=C1n();NJ(w1n(),ud);ud.JSONTree=vjt();NJ(Gq(),ud);NJ(Ujt(),ud);NJ(Yjt(),ud);NJ(k1n(),ud);NJ(D1n(),ud);NJ(M1n(),ud);var Dzo=wjt();Object.defineProperty(ud,"PromptElement",{enumerable:!0,get:a(function(){return Dzo.PromptElement},"get")});var L1n=nHt();Object.defineProperty(ud,"MetadataMap",{enumerable:!0,get:a(function(){return L1n.MetadataMap},"get")});Object.defineProperty(ud,"PromptRenderer",{enumerable:!0,get:a(function(){return L1n.PromptRenderer},"get")});async function Nzo(t,e,r,n,o,s,c=cHt.OutputMode.VSCode){let l="countTokens"in n?new Pzo.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new O1n.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(Nzo,"renderPrompt");ud.contentType="application/vnd.codechat.prompt+json.1";function Mzo(t,e,r,n){return new O1n.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:cHt.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===cHt.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(Mzo,"renderElementJSON")});var $In=I((v0d,ARe)=>{"use strict";p();var zZe=a(function(){},"NullObject");zZe.prototype=Object.create(null);var VZe=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,WZe=/\\([\v\u0020-\u00ff])/gu,jIn=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,HJ={type:"",parameters:new zZe};Object.freeze(HJ.parameters);Object.freeze(HJ);function HIn(t){if(typeof t!="string")throw new TypeError("argument header is required and must be a string");let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(jIn.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new zZe};if(e===-1)return n;let o,s,c;for(VZe.lastIndex=e;s=VZe.exec(t);){if(s.index!==e)throw new TypeError("invalid parameter format");e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),WZe.test(c)&&(c=c.replace(WZe,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(HIn,"parse");function GIn(t){if(typeof t!="string")return HJ;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(jIn.test(r)===!1)return HJ;let n={type:r.toLowerCase(),parameters:new zZe};if(e===-1)return n;let o,s,c;for(VZe.lastIndex=e;s=VZe.exec(t);){if(s.index!==e)return HJ;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),WZe.test(c)&&(c=c.replace(WZe,"$1"))),n.parameters[o]=c}return e!==t.length?HJ:n}a(GIn,"safeParse");ARe.exports.default={parse:HIn,safeParse:GIn};ARe.exports.parse=HIn;ARe.exports.safeParse=GIn;ARe.exports.defaultContentType=HJ});var dj=I(R0=>{"use strict";p();Object.defineProperty(R0,"__esModule",{value:!0});R0.MonotonousArray=void 0;R0.findLast=uZo;R0.findLastIdx=Fxn;R0.findFirst=dZo;R0.findFirstIdx=Uxn;R0.findLastMonotonous=fZo;R0.findLastIdxMonotonous=WGt;R0.findFirstMonotonous=pZo;R0.findFirstIdxMonotonousOrArrLen=zGt;R0.findFirstIdxMonotonous=hZo;R0.findFirstMax=Qxn;R0.findLastMax=mZo;R0.findFirstMin=gZo;R0.findMaxIdx=AZo;R0.mapFindFirst=yZo;function uZo(t,e,r=t.length-1){let n=Fxn(t,e,r);if(n!==-1)return t[n]}a(uZo,"findLast");function Fxn(t,e,r=t.length-1){for(let n=r;n>=0;n--){let o=t[n];if(e(o,n))return n}return-1}a(Fxn,"findLastIdx");function dZo(t,e,r=0){let n=Uxn(t,e,r);if(n!==-1)return t[n]}a(dZo,"findFirst");function Uxn(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(Qxn,"findFirstMax");function mZo(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(mZo,"findLastMax");function gZo(t,e){return Qxn(t,(r,n)=>-e(r,n))}a(gZo,"findFirstMin");function AZo(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(AZo,"findMaxIdx");function yZo(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(yZo,"mapFindFirst")});var Os=I(ko=>{"use strict";p();Object.defineProperty(ko,"__esModule",{value:!0});ko.BugIndicatingError=ko.ErrorNoTelemetry=ko.ExpectedError=ko.NotSupportedError=ko.NotImplementedError=ko.ReadonlyError=ko.PendingMigrationError=ko.CancellationError=ko.canceledName=ko.errorHandler=ko.ErrorHandler=void 0;ko.setUnexpectedErrorHandler=_Zo;ko.isSigPipeError=EZo;ko.onBugIndicatingError=vZo;ko.onUnexpectedError=CZo;ko.onUnexpectedExternalError=bZo;ko.transformErrorForSerialization=qxn;ko.transformErrorFromSerialization=jxn;ko.isCancellationError=t$t;ko.canceled=SZo;ko.illegalArgument=TZo;ko.illegalState=IZo;ko.getErrorMessage=xZo;var yXe=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?WJ.isErrorNoTelemetry(e)?new WJ(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};ko.ErrorHandler=yXe;ko.errorHandler=new yXe;function AZo(t){ko.errorHandler.setUnexpectedErrorHandler(t)}a(AZo,"setUnexpectedErrorHandler");function yZo(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(yZo,"isSigPipeError");function _Zo(t){ko.errorHandler.onUnexpectedError(t)}a(_Zo,"onBugIndicatingError");function EZo(t){e$t(t)||ko.errorHandler.onUnexpectedError(t)}a(EZo,"onUnexpectedError");function vZo(t){e$t(t)||ko.errorHandler.onUnexpectedExternalError(t)}a(vZo,"onUnexpectedExternalError");function Qxn(t){if(t instanceof Error){let{name:e,message:r,cause:n}=t,o=t.stacktrace||t.stack;return{$isError:!0,name:e,message:r,stack:o,noTelemetry:VJ.isErrorNoTelemetry(t),cause:n?Qxn(n):void 0,code:t.code}}return t}a(Qxn,"transformErrorForSerialization");function qxn(t){let e;return t.noTelemetry?e=new VJ:(e=new Error,e.name=t.name),e.message=t.message,e.stack=t.stack,t.code&&(e.code=t.code),t.cause&&(e.cause=qxn(t.cause)),e}a(qxn,"transformErrorFromSerialization");ko.canceledName="Canceled";function e$t(t){return t instanceof _Xe?!0:t instanceof Error&&t.name===ko.canceledName&&t.message===ko.canceledName}a(e$t,"isCancellationError");var _Xe=class extends Error{static{a(this,"CancellationError")}constructor(){super(ko.canceledName),this.name=this.message}};ko.CancellationError=_Xe;var zGt=class t extends Error{static{a(this,"PendingMigrationError")}static{this._name="PendingMigrationError"}static is(e){return e instanceof t||e instanceof Error&&e.name===t._name}constructor(e){super(e),this.name=t._name}};ko.PendingMigrationError=zGt;function CZo(){let t=new Error(ko.canceledName);return t.name=t.message,t}a(CZo,"canceled");function bZo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a(bZo,"illegalArgument");function SZo(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(SZo,"illegalState");var YGt=class extends TypeError{static{a(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};ko.ReadonlyError=YGt;function TZo(t){return t?t.message?t.message:t.stack?t.stack.split(` -`)[0]:String(t):"Error"}a(TZo,"getErrorMessage");var KGt=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};ko.NotImplementedError=KGt;var JGt=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};ko.NotSupportedError=JGt;var ZGt=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};ko.ExpectedError=ZGt;var VJ=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};ko.ErrorNoTelemetry=VJ;var XGt=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};ko.BugIndicatingError=XGt});var Ml=I(Kn=>{"use strict";p();Object.defineProperty(Kn,"__esModule",{value:!0});Kn.Permutation=Kn.CallbackIterable=Kn.ArrayQueue=Kn.booleanComparator=Kn.numberComparator=Kn.CompareResult=void 0;Kn.tail=wZo;Kn.equals=RZo;Kn.removeFastWithoutKeepingOrder=kZo;Kn.binarySearch=PZo;Kn.binarySearch2=jxn;Kn.quickSelect=t$t;Kn.groupBy=DZo;Kn.groupAdjacentBy=NZo;Kn.forEachAdjacent=MZo;Kn.forEachWithNeighbors=OZo;Kn.concatArrays=LZo;Kn.sortedDiff=Hxn;Kn.delta=BZo;Kn.top=FZo;Kn.topAsync=UZo;Kn.coalesce=QZo;Kn.coalesceInPlace=qZo;Kn.move=jZo;Kn.isFalsyOrEmpty=HZo;Kn.isNonEmptyArray=GZo;Kn.distinct=$Zo;Kn.uniqueFilter=VZo;Kn.commonPrefixLength=WZo;Kn.range=zZo;Kn.index=YZo;Kn.insert=KZo;Kn.remove=$xn;Kn.arrayInsert=JZo;Kn.shuffle=ZZo;Kn.pushToStart=XZo;Kn.pushToEnd=eXo;Kn.pushMany=tXo;Kn.mapArrayOrNot=rXo;Kn.mapFilter=nXo;Kn.withoutDuplicates=iXo;Kn.asArray=oXo;Kn.getRandomElement=sXo;Kn.insertInto=Vxn;Kn.splice=aXo;Kn.compareBy=cXo;Kn.tieBreakComparators=lXo;Kn.reverseOrder=fXo;Kn.compareUndefinedSmallest=pXo;Kn.findAsync=hXo;Kn.sum=mXo;Kn.sumBy=gXo;var IZo=dj(),xZo=Os();function wZo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(wZo,"tail");function RZo(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;nr(t[n],e))}a(PZo,"binarySearch");function jxn(t,e){let r=0,n=t-1;for(;r<=n;){let o=(r+n)/2|0,s=e(o);if(s<0)r=o+1;else if(s>0)n=o-1;else return o}return-(r+1)}a(jxn,"binarySearch2");function t$t(t,e,r){if(t=t|0,t>=e.length)throw new TypeError("invalid index");let n=e[Math.floor(e.length*Math.random())],o=[],s=[],c=[];for(let l of e){let u=r(l,n);u<0?o.push(l):u>0?s.push(l):c.push(l)}return t0&&(o(s,0,[u]),c+=1)}return n}a(Hxn,"sortedDiff");function BZo(t,e,r){let n=Hxn(t,e,r),o=[],s=[];for(let c of n)o.push(...t.slice(c.start,c.start+c.deleteCount)),s.push(...c.toInsert);return{removed:o,added:s}}a(BZo,"delta");function FZo(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return Gxn(t,e,n,r,t.length),n}a(FZo,"top");function UZo(t,e,r,n,o){return r===0?Promise.resolve([]):new Promise((s,c)=>{(async()=>{let l=t.length,u=t.slice(0,r).sort(e);for(let d=r,f=Math.min(r+n,l);dr&&await new Promise(h=>setTimeout(h)),o&&o.isCancellationRequested)throw new xZo.CancellationError;Gxn(t,e,u,d,f)}return u})().then(s,c)})}a(UZo,"topAsync");function Gxn(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a(Gxn,"topStep");function QZo(t){return t.filter(e=>!!e)}a(QZo,"coalesce");function qZo(t){let e=0;for(let r=0;r0}a(GZo,"isNonEmptyArray");function $Zo(t,e=r=>r){let r=new Set;return t.filter(n=>{let o=e(n);return r.has(o)?!1:(r.add(o),!0)})}a($Zo,"distinct");function VZo(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(VZo,"uniqueFilter");function WZo(t,e,r=(n,o)=>n===o){let n=0;for(let o=0,s=Math.min(t.length,e.length);oe;o--)n.push(o);return n}a(zZo,"range");function YZo(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(YZo,"index");function KZo(t,e){return t.push(e),()=>$xn(t,e)}a(KZo,"insert");function $xn(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a($xn,"remove");function JZo(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a(JZo,"arrayInsert");function ZZo(t,e){let r;if(typeof e=="number"){let n=e;r=a(()=>{let o=Math.sin(n++)*179426549;return o-Math.floor(o)},"rand")}else r=Math.random;for(let n=t.length-1;n>0;n-=1){let o=Math.floor(r()*(n+1)),s=t[n];t[n]=t[o],t[o]=s}}a(ZZo,"shuffle");function XZo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(XZo,"pushToStart");function eXo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(eXo,"pushToEnd");function tXo(t,e){for(let r of e)t.push(r)}a(tXo,"pushMany");function rXo(t,e){return Array.isArray(t)?t.map(e):e(t)}a(rXo,"mapArrayOrNot");function nXo(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(nXo,"mapFilter");function iXo(t){let e=new Set(t);return Array.from(e)}a(iXo,"withoutDuplicates");function oXo(t){return Array.isArray(t)?t:[t]}a(oXo,"asArray");function sXo(t){return t[Math.floor(Math.random()*t.length)]}a(sXo,"getRandomElement");function Vxn(t,e,r){let n=Wxn(t,e),o=t.length,s=r.length;t.length=o+s;for(let c=o-1;c>=n;c--)t[c+s]=t[c];for(let c=0;c0}a(n,"isGreaterThan"),t.isGreaterThan=n;function o(s){return s===0}a(o,"isNeitherLessOrGreaterThan"),t.isNeitherLessOrGreaterThan=o,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(fj||(Kn.CompareResult=fj={}));function cXo(t,e){return(r,n)=>e(t(r),t(n))}a(cXo,"compareBy");function lXo(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!fj.isNeitherLessOrGreaterThan(o))return o}return fj.neitherLessOrGreaterThan}}a(lXo,"tieBreakComparators");var uXo=a((t,e)=>t-e,"numberComparator");Kn.numberComparator=uXo;var dXo=a((t,e)=>(0,Kn.numberComparator)(t?1:0,e?1:0),"booleanComparator");Kn.booleanComparator=dXo;function fXo(t){return(e,r)=>-t(e,r)}a(fXo,"reverseOrder");function pXo(t){return(e,r)=>e===void 0?r===void 0?fj.neitherLessOrGreaterThan:fj.lessThan:r===void 0?fj.greaterThan:t(e,r)}a(pXo,"compareUndefinedSmallest");var r$t=class{static{a(this,"ArrayQueue")}constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let r=this.firstIdx;for(;r=0&&e(this.items[r]);)r--;let n=r===this.lastIdx?null:this.items.slice(r+1,this.lastIdx+1);return this.lastIdx=r,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}removeLast(){let e=this.items[this.lastIdx];return this.lastIdx--,e}takeCount(e){let r=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,r}};Kn.ArrayQueue=r$t;var n$t=class t{static{a(this,"CallbackIterable")}static{this.empty=new t(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(r=>(e(r),!0))}toArray(){let e=[];return this.iterate(r=>(e.push(r),!0)),e}filter(e){return new t(r=>this.iterate(n=>e(n)?r(n):!0))}map(e){return new t(r=>this.iterate(n=>r(e(n))))}some(e){let r=!1;return this.iterate(n=>(r=e(n),!r)),r}findFirst(e){let r;return this.iterate(n=>e(n)?(r=n,!1):!0),r}findLast(e){let r;return this.iterate(n=>(e(n)&&(r=n),!0)),r}findLastMaxBy(e){let r,n=!0;return this.iterate(o=>((n||fj.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};Kn.CallbackIterable=n$t;var i$t=class t{static{a(this,"Permutation")}constructor(e){this._indexMap=e}static createSortPermutation(e,r){let n=Array.from(e.keys()).sort((o,s)=>r(e[o],e[s]));return new t(n)}apply(e){return e.map((r,n)=>e[this._indexMap[n]])}inverse(){let e=this._indexMap.slice();for(let r=0;r({element:n,ok:await e(n,o)})))).find(n=>n.ok)?.element}a(hXo,"findAsync");function mXo(t){return t.reduce((e,r)=>e+r,0)}a(mXo,"sum");function gXo(t,e){return t.reduce((r,n)=>r+e(n),0)}a(gXo,"sumBy")});var a$t=I(IF=>{"use strict";p();var Yxn;Object.defineProperty(IF,"__esModule",{value:!0});IF.SetWithKey=void 0;IF.groupBy=_Xo;IF.groupByMap=EXo;IF.diffSets=vXo;IF.diffMaps=CXo;IF.intersection=bXo;function _Xo(t,e){let r=Object.create(null);for(let n of t){let o=e(n),s=r[o];s||(s=r[o]=[]),s.push(n)}return r}a(_Xo,"groupBy");function EXo(t,e){let r=new Map;for(let n of t){let o=e(n),s=r.get(o);s||(s=[],r.set(o,s)),s.push(n)}return r}a(EXo,"groupByMap");function vXo(t,e){let r=[],n=[];for(let o of t)e.has(o)||r.push(o);for(let o of e)t.has(o)||n.push(o);return{removed:r,added:n}}a(vXo,"diffSets");function CXo(t,e){let r=[],n=[];for(let[o,s]of t)e.has(o)||r.push(s);for(let[o,s]of e)t.has(o)||n.push(s);return{removed:r,added:n}}a(CXo,"diffMaps");function bXo(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a(bXo,"intersection");var s$t=class{static{a(this,"SetWithKey")}static{Yxn=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[Yxn]="SetWithKey";for(let n of e)this.add(n)}get size(){return this._map.size}add(e){let r=this.toKey(e);return this._map.set(r,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,r){this._map.forEach(n=>e.call(r,n,n,this))}[Symbol.iterator](){return this.values()}};IF.SetWithKey=s$t});var l$t=I(c$t=>{"use strict";p();Object.defineProperty(c$t,"__esModule",{value:!0});c$t.createSingleCallFunction=SXo;function SXo(t,e){let r=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=t.apply(r,arguments)}finally{e()}else o=t.apply(r,arguments);return o}}a(SXo,"createSingleCallFunction")});var b2=I(Jd=>{"use strict";p();var Kxn,Jxn,Zxn;Object.defineProperty(Jd,"__esModule",{value:!0});Jd.NKeyMap=Jd.SetMap=Jd.BidirectionalMap=Jd.CounterSet=Jd.MRUCache=Jd.LRUCache=Jd.LinkedMap=Jd.ResourceSet=Jd.ResourceMap=void 0;Jd.getOrSet=TXo;Jd.mapToString=IXo;Jd.setToString=xXo;Jd.mapsStrictEqualIgnoreOrder=RXo;function TXo(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(TXo,"getOrSet");function IXo(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(IXo,"mapToString");function xXo(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(xXo,"setToString");var u$t=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function wXo(t){return Array.isArray(t)}a(wXo,"isEntries");var RRe=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[Kxn]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(wXo(e)){this.map=new Map,this.toKey=r??t.defaultToKey;for(let[n,o]of e)this.set(n,o)}else this.map=new Map,this.toKey=e??t.defaultToKey}set(e,r){return this.map.set(this.toKey(e),new u$t(e,r)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,r){typeof r<"u"&&(e=e.bind(r));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(Kxn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Jd.ResourceMap=RRe;var d$t=class{static{a(this,"ResourceSet")}constructor(e,r){this[Jxn]="ResourceSet",!e||typeof e=="function"?this._map=new RRe(e):(this._map=new RRe(r),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,r){this._map.forEach((n,o)=>e.call(r,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(Jxn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};Jd.ResourceSet=d$t;var EXe=class{static{a(this,"LinkedMap")}constructor(){this[Zxn]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=0){let n=this._map.get(e);if(n)return r!==0&&this.touch(n,r),n.value}set(e,r,n=0){let o=this._map.get(e);if(o)o.value=r,n!==0&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}[(Zxn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Jd.LinkedMap=EXe;var vXe=class extends EXe{static{a(this,"Cache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=2){return super.get(e,r)}peek(e){return super.get(e,0)}set(e,r){return super.set(e,r,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},f$t=class extends vXe{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};Jd.LRUCache=f$t;var p$t=class extends vXe{static{a(this,"MRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimNew(e)}set(e,r){return this._limit<=this.size&&!this.has(e)&&this.trim(Math.round(this._limit*this._ratio)-1),super.set(e,r),this}};Jd.MRUCache=p$t;var h$t=class{static{a(this,"CounterSet")}constructor(){this.map=new Map}add(e){return this.map.set(e,(this.map.get(e)||0)+1),this}delete(e){let r=this.map.get(e)||0;return r===0?!1:(r--,r===0?this.map.delete(e):this.map.set(e,r),!0)}has(e){return this.map.has(e)}};Jd.CounterSet=h$t;var m$t=class{static{a(this,"BidirectionalMap")}constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this._m1.clear(),this._m2.clear()}set(e,r){this._m1.set(e,r),this._m2.set(r,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let r=this._m1.get(e);return r===void 0?!1:(this._m1.delete(e),this._m2.delete(r),!0)}forEach(e,r){this._m1.forEach((n,o)=>{e.call(r,n,o,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}};Jd.BidirectionalMap=m$t;var g$t=class{static{a(this,"SetMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};Jd.SetMap=g$t;function RXo(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(let[r,n]of t)if(!e.has(r)||e.get(r)!==n)return!1;for(let[r]of e)if(!t.has(r))return!1;return!0}a(RXo,"mapsStrictEqualIgnoreOrder");var A$t=class{static{a(this,"NKeyMap")}constructor(){this._data=new Map}set(e,...r){let n=this._data;for(let o=0;o{let o="";for(let[s,c]of r)o+=`${" ".repeat(n)}${s}: `,c instanceof Map?o+=` +`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};ko.ErrorHandler=yXe;ko.errorHandler=new yXe;function _Zo(t){ko.errorHandler.setUnexpectedErrorHandler(t)}a(_Zo,"setUnexpectedErrorHandler");function EZo(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(EZo,"isSigPipeError");function vZo(t){ko.errorHandler.onUnexpectedError(t)}a(vZo,"onBugIndicatingError");function CZo(t){t$t(t)||ko.errorHandler.onUnexpectedError(t)}a(CZo,"onUnexpectedError");function bZo(t){t$t(t)||ko.errorHandler.onUnexpectedExternalError(t)}a(bZo,"onUnexpectedExternalError");function qxn(t){if(t instanceof Error){let{name:e,message:r,cause:n}=t,o=t.stacktrace||t.stack;return{$isError:!0,name:e,message:r,stack:o,noTelemetry:WJ.isErrorNoTelemetry(t),cause:n?qxn(n):void 0,code:t.code}}return t}a(qxn,"transformErrorForSerialization");function jxn(t){let e;return t.noTelemetry?e=new WJ:(e=new Error,e.name=t.name),e.message=t.message,e.stack=t.stack,t.code&&(e.code=t.code),t.cause&&(e.cause=jxn(t.cause)),e}a(jxn,"transformErrorFromSerialization");ko.canceledName="Canceled";function t$t(t){return t instanceof _Xe?!0:t instanceof Error&&t.name===ko.canceledName&&t.message===ko.canceledName}a(t$t,"isCancellationError");var _Xe=class extends Error{static{a(this,"CancellationError")}constructor(){super(ko.canceledName),this.name=this.message}};ko.CancellationError=_Xe;var YGt=class t extends Error{static{a(this,"PendingMigrationError")}static{this._name="PendingMigrationError"}static is(e){return e instanceof t||e instanceof Error&&e.name===t._name}constructor(e){super(e),this.name=t._name}};ko.PendingMigrationError=YGt;function SZo(){let t=new Error(ko.canceledName);return t.name=t.message,t}a(SZo,"canceled");function TZo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a(TZo,"illegalArgument");function IZo(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(IZo,"illegalState");var KGt=class extends TypeError{static{a(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};ko.ReadonlyError=KGt;function xZo(t){return t?t.message?t.message:t.stack?t.stack.split(` +`)[0]:String(t):"Error"}a(xZo,"getErrorMessage");var JGt=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};ko.NotImplementedError=JGt;var ZGt=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};ko.NotSupportedError=ZGt;var XGt=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};ko.ExpectedError=XGt;var WJ=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};ko.ErrorNoTelemetry=WJ;var e$t=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};ko.BugIndicatingError=e$t});var Ml=I(Kn=>{"use strict";p();Object.defineProperty(Kn,"__esModule",{value:!0});Kn.Permutation=Kn.CallbackIterable=Kn.ArrayQueue=Kn.booleanComparator=Kn.numberComparator=Kn.CompareResult=void 0;Kn.tail=kZo;Kn.equals=PZo;Kn.removeFastWithoutKeepingOrder=DZo;Kn.binarySearch=NZo;Kn.binarySearch2=Hxn;Kn.quickSelect=r$t;Kn.groupBy=MZo;Kn.groupAdjacentBy=OZo;Kn.forEachAdjacent=LZo;Kn.forEachWithNeighbors=BZo;Kn.concatArrays=FZo;Kn.sortedDiff=Gxn;Kn.delta=UZo;Kn.top=QZo;Kn.topAsync=qZo;Kn.coalesce=jZo;Kn.coalesceInPlace=HZo;Kn.move=GZo;Kn.isFalsyOrEmpty=$Zo;Kn.isNonEmptyArray=VZo;Kn.distinct=WZo;Kn.uniqueFilter=zZo;Kn.commonPrefixLength=YZo;Kn.range=KZo;Kn.index=JZo;Kn.insert=ZZo;Kn.remove=Vxn;Kn.arrayInsert=XZo;Kn.shuffle=eXo;Kn.pushToStart=tXo;Kn.pushToEnd=rXo;Kn.pushMany=nXo;Kn.mapArrayOrNot=iXo;Kn.mapFilter=oXo;Kn.withoutDuplicates=sXo;Kn.asArray=aXo;Kn.getRandomElement=cXo;Kn.insertInto=Wxn;Kn.splice=lXo;Kn.compareBy=uXo;Kn.tieBreakComparators=dXo;Kn.reverseOrder=hXo;Kn.compareUndefinedSmallest=mXo;Kn.findAsync=gXo;Kn.sum=AXo;Kn.sumBy=yXo;var wZo=dj(),RZo=Os();function kZo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(kZo,"tail");function PZo(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;nr(t[n],e))}a(NZo,"binarySearch");function Hxn(t,e){let r=0,n=t-1;for(;r<=n;){let o=(r+n)/2|0,s=e(o);if(s<0)r=o+1;else if(s>0)n=o-1;else return o}return-(r+1)}a(Hxn,"binarySearch2");function r$t(t,e,r){if(t=t|0,t>=e.length)throw new TypeError("invalid index");let n=e[Math.floor(e.length*Math.random())],o=[],s=[],c=[];for(let l of e){let u=r(l,n);u<0?o.push(l):u>0?s.push(l):c.push(l)}return t0&&(o(s,0,[u]),c+=1)}return n}a(Gxn,"sortedDiff");function UZo(t,e,r){let n=Gxn(t,e,r),o=[],s=[];for(let c of n)o.push(...t.slice(c.start,c.start+c.deleteCount)),s.push(...c.toInsert);return{removed:o,added:s}}a(UZo,"delta");function QZo(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return $xn(t,e,n,r,t.length),n}a(QZo,"top");function qZo(t,e,r,n,o){return r===0?Promise.resolve([]):new Promise((s,c)=>{(async()=>{let l=t.length,u=t.slice(0,r).sort(e);for(let d=r,f=Math.min(r+n,l);dr&&await new Promise(h=>setTimeout(h)),o&&o.isCancellationRequested)throw new RZo.CancellationError;$xn(t,e,u,d,f)}return u})().then(s,c)})}a(qZo,"topAsync");function $xn(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a($xn,"topStep");function jZo(t){return t.filter(e=>!!e)}a(jZo,"coalesce");function HZo(t){let e=0;for(let r=0;r0}a(VZo,"isNonEmptyArray");function WZo(t,e=r=>r){let r=new Set;return t.filter(n=>{let o=e(n);return r.has(o)?!1:(r.add(o),!0)})}a(WZo,"distinct");function zZo(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(zZo,"uniqueFilter");function YZo(t,e,r=(n,o)=>n===o){let n=0;for(let o=0,s=Math.min(t.length,e.length);oe;o--)n.push(o);return n}a(KZo,"range");function JZo(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(JZo,"index");function ZZo(t,e){return t.push(e),()=>Vxn(t,e)}a(ZZo,"insert");function Vxn(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a(Vxn,"remove");function XZo(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a(XZo,"arrayInsert");function eXo(t,e){let r;if(typeof e=="number"){let n=e;r=a(()=>{let o=Math.sin(n++)*179426549;return o-Math.floor(o)},"rand")}else r=Math.random;for(let n=t.length-1;n>0;n-=1){let o=Math.floor(r()*(n+1)),s=t[n];t[n]=t[o],t[o]=s}}a(eXo,"shuffle");function tXo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(tXo,"pushToStart");function rXo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(rXo,"pushToEnd");function nXo(t,e){for(let r of e)t.push(r)}a(nXo,"pushMany");function iXo(t,e){return Array.isArray(t)?t.map(e):e(t)}a(iXo,"mapArrayOrNot");function oXo(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(oXo,"mapFilter");function sXo(t){let e=new Set(t);return Array.from(e)}a(sXo,"withoutDuplicates");function aXo(t){return Array.isArray(t)?t:[t]}a(aXo,"asArray");function cXo(t){return t[Math.floor(Math.random()*t.length)]}a(cXo,"getRandomElement");function Wxn(t,e,r){let n=zxn(t,e),o=t.length,s=r.length;t.length=o+s;for(let c=o-1;c>=n;c--)t[c+s]=t[c];for(let c=0;c0}a(n,"isGreaterThan"),t.isGreaterThan=n;function o(s){return s===0}a(o,"isNeitherLessOrGreaterThan"),t.isNeitherLessOrGreaterThan=o,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(fj||(Kn.CompareResult=fj={}));function uXo(t,e){return(r,n)=>e(t(r),t(n))}a(uXo,"compareBy");function dXo(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!fj.isNeitherLessOrGreaterThan(o))return o}return fj.neitherLessOrGreaterThan}}a(dXo,"tieBreakComparators");var fXo=a((t,e)=>t-e,"numberComparator");Kn.numberComparator=fXo;var pXo=a((t,e)=>(0,Kn.numberComparator)(t?1:0,e?1:0),"booleanComparator");Kn.booleanComparator=pXo;function hXo(t){return(e,r)=>-t(e,r)}a(hXo,"reverseOrder");function mXo(t){return(e,r)=>e===void 0?r===void 0?fj.neitherLessOrGreaterThan:fj.lessThan:r===void 0?fj.greaterThan:t(e,r)}a(mXo,"compareUndefinedSmallest");var n$t=class{static{a(this,"ArrayQueue")}constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let r=this.firstIdx;for(;r=0&&e(this.items[r]);)r--;let n=r===this.lastIdx?null:this.items.slice(r+1,this.lastIdx+1);return this.lastIdx=r,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}removeLast(){let e=this.items[this.lastIdx];return this.lastIdx--,e}takeCount(e){let r=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,r}};Kn.ArrayQueue=n$t;var i$t=class t{static{a(this,"CallbackIterable")}static{this.empty=new t(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(r=>(e(r),!0))}toArray(){let e=[];return this.iterate(r=>(e.push(r),!0)),e}filter(e){return new t(r=>this.iterate(n=>e(n)?r(n):!0))}map(e){return new t(r=>this.iterate(n=>r(e(n))))}some(e){let r=!1;return this.iterate(n=>(r=e(n),!r)),r}findFirst(e){let r;return this.iterate(n=>e(n)?(r=n,!1):!0),r}findLast(e){let r;return this.iterate(n=>(e(n)&&(r=n),!0)),r}findLastMaxBy(e){let r,n=!0;return this.iterate(o=>((n||fj.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};Kn.CallbackIterable=i$t;var o$t=class t{static{a(this,"Permutation")}constructor(e){this._indexMap=e}static createSortPermutation(e,r){let n=Array.from(e.keys()).sort((o,s)=>r(e[o],e[s]));return new t(n)}apply(e){return e.map((r,n)=>e[this._indexMap[n]])}inverse(){let e=this._indexMap.slice();for(let r=0;r({element:n,ok:await e(n,o)})))).find(n=>n.ok)?.element}a(gXo,"findAsync");function AXo(t){return t.reduce((e,r)=>e+r,0)}a(AXo,"sum");function yXo(t,e){return t.reduce((r,n)=>r+e(n),0)}a(yXo,"sumBy")});var c$t=I(IF=>{"use strict";p();var Kxn;Object.defineProperty(IF,"__esModule",{value:!0});IF.SetWithKey=void 0;IF.groupBy=vXo;IF.groupByMap=CXo;IF.diffSets=bXo;IF.diffMaps=SXo;IF.intersection=TXo;function vXo(t,e){let r=Object.create(null);for(let n of t){let o=e(n),s=r[o];s||(s=r[o]=[]),s.push(n)}return r}a(vXo,"groupBy");function CXo(t,e){let r=new Map;for(let n of t){let o=e(n),s=r.get(o);s||(s=[],r.set(o,s)),s.push(n)}return r}a(CXo,"groupByMap");function bXo(t,e){let r=[],n=[];for(let o of t)e.has(o)||r.push(o);for(let o of e)t.has(o)||n.push(o);return{removed:r,added:n}}a(bXo,"diffSets");function SXo(t,e){let r=[],n=[];for(let[o,s]of t)e.has(o)||r.push(s);for(let[o,s]of e)t.has(o)||n.push(s);return{removed:r,added:n}}a(SXo,"diffMaps");function TXo(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a(TXo,"intersection");var a$t=class{static{a(this,"SetWithKey")}static{Kxn=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[Kxn]="SetWithKey";for(let n of e)this.add(n)}get size(){return this._map.size}add(e){let r=this.toKey(e);return this._map.set(r,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,r){this._map.forEach(n=>e.call(r,n,n,this))}[Symbol.iterator](){return this.values()}};IF.SetWithKey=a$t});var u$t=I(l$t=>{"use strict";p();Object.defineProperty(l$t,"__esModule",{value:!0});l$t.createSingleCallFunction=IXo;function IXo(t,e){let r=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=t.apply(r,arguments)}finally{e()}else o=t.apply(r,arguments);return o}}a(IXo,"createSingleCallFunction")});var b2=I(Zd=>{"use strict";p();var Jxn,Zxn,Xxn;Object.defineProperty(Zd,"__esModule",{value:!0});Zd.NKeyMap=Zd.SetMap=Zd.BidirectionalMap=Zd.CounterSet=Zd.MRUCache=Zd.LRUCache=Zd.LinkedMap=Zd.ResourceSet=Zd.ResourceMap=void 0;Zd.getOrSet=xXo;Zd.mapToString=wXo;Zd.setToString=RXo;Zd.mapsStrictEqualIgnoreOrder=PXo;function xXo(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(xXo,"getOrSet");function wXo(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(wXo,"mapToString");function RXo(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(RXo,"setToString");var d$t=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function kXo(t){return Array.isArray(t)}a(kXo,"isEntries");var RRe=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[Jxn]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(kXo(e)){this.map=new Map,this.toKey=r??t.defaultToKey;for(let[n,o]of e)this.set(n,o)}else this.map=new Map,this.toKey=e??t.defaultToKey}set(e,r){return this.map.set(this.toKey(e),new d$t(e,r)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,r){typeof r<"u"&&(e=e.bind(r));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(Jxn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Zd.ResourceMap=RRe;var f$t=class{static{a(this,"ResourceSet")}constructor(e,r){this[Zxn]="ResourceSet",!e||typeof e=="function"?this._map=new RRe(e):(this._map=new RRe(r),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,r){this._map.forEach((n,o)=>e.call(r,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(Zxn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};Zd.ResourceSet=f$t;var EXe=class{static{a(this,"LinkedMap")}constructor(){this[Xxn]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=0){let n=this._map.get(e);if(n)return r!==0&&this.touch(n,r),n.value}set(e,r,n=0){let o=this._map.get(e);if(o)o.value=r,n!==0&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}[(Xxn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Zd.LinkedMap=EXe;var vXe=class extends EXe{static{a(this,"Cache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=2){return super.get(e,r)}peek(e){return super.get(e,0)}set(e,r){return super.set(e,r,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},p$t=class extends vXe{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};Zd.LRUCache=p$t;var h$t=class extends vXe{static{a(this,"MRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimNew(e)}set(e,r){return this._limit<=this.size&&!this.has(e)&&this.trim(Math.round(this._limit*this._ratio)-1),super.set(e,r),this}};Zd.MRUCache=h$t;var m$t=class{static{a(this,"CounterSet")}constructor(){this.map=new Map}add(e){return this.map.set(e,(this.map.get(e)||0)+1),this}delete(e){let r=this.map.get(e)||0;return r===0?!1:(r--,r===0?this.map.delete(e):this.map.set(e,r),!0)}has(e){return this.map.has(e)}};Zd.CounterSet=m$t;var g$t=class{static{a(this,"BidirectionalMap")}constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this._m1.clear(),this._m2.clear()}set(e,r){this._m1.set(e,r),this._m2.set(r,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let r=this._m1.get(e);return r===void 0?!1:(this._m1.delete(e),this._m2.delete(r),!0)}forEach(e,r){this._m1.forEach((n,o)=>{e.call(r,n,o,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}};Zd.BidirectionalMap=g$t;var A$t=class{static{a(this,"SetMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};Zd.SetMap=A$t;function PXo(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(let[r,n]of t)if(!e.has(r)||e.get(r)!==n)return!1;for(let[r]of e)if(!t.has(r))return!1;return!0}a(PXo,"mapsStrictEqualIgnoreOrder");var y$t=class{static{a(this,"NKeyMap")}constructor(){this._data=new Map}set(e,...r){let n=this._data;for(let o=0;o{let o="";for(let[s,c]of r)o+=`${" ".repeat(n)}${s}: `,c instanceof Map?o+=` `+e(c,n+1):o+=`${c} -`;return o},"printMap");return e(this._data,0)}};Jd.NKeyMap=A$t});var pd=I(xF=>{"use strict";p();Object.defineProperty(xF,"__esModule",{value:!0});xF.ok=kXo;xF.assertNever=PXo;xF.softAssertNever=DXo;xF.assert=NXo;xF.softAssert=MXo;xF.assertFn=OXo;xF.checkAdjacentItems=LXo;var kRe=Os();function kXo(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(kXo,"ok");function PXo(t,e="Unreachable"){throw new Error(e)}a(PXo,"assertNever");function DXo(t){}a(DXo,"softAssertNever");function NXo(t,e="unexpected state"){if(!t)throw typeof e=="string"?new kRe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(NXo,"assert");function MXo(t,e="Soft Assertion Failed"){t||(0,kRe.onUnexpectedError)(new kRe.BugIndicatingError(e))}a(MXo,"softAssert");function OXo(t){if(!t()){debugger;t(),(0,kRe.onUnexpectedError)(new kRe.BugIndicatingError("Assertion Failed"))}}a(OXo,"assertFn");function LXo(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(Ol,"__esModule",{value:!0});Ol.isOneOf=void 0;Ol.isString=y$t;Ol.isStringArray=FXo;Ol.isArrayOf=Xxn;Ol.isObject=ewn;Ol.isTypedArray=UXo;Ol.isNumber=QXo;Ol.isIterable=qXo;Ol.isAsyncIterable=jXo;Ol.isBoolean=HXo;Ol.isUndefined=twn;Ol.isDefined=GXo;Ol.isUndefinedOrNull=CXe;Ol.assertType=$Xo;Ol.assertReturnsDefined=VXo;Ol.assertDefined=WXo;Ol.assertReturnsAllDefined=zXo;Ol.typeCheck=KXo;Ol.isEmptyObject=ZXo;Ol.isFunction=_$t;Ol.areFunctions=XXo;Ol.validateConstraints=ees;Ol.validateConstraint=rwn;Ol.upcast=tes;Ol.hasKey=res;var BXo=pd();function y$t(t){return typeof t=="string"}a(y$t,"isString");function FXo(t){return Xxn(t,y$t)}a(FXo,"isStringArray");function Xxn(t,e){return Array.isArray(t)&&t.every(e)}a(Xxn,"isArrayOf");function ewn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(ewn,"isObject");function UXo(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(UXo,"isTypedArray");function QXo(t){return typeof t=="number"&&!isNaN(t)}a(QXo,"isNumber");function qXo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(qXo,"isIterable");function jXo(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(jXo,"isAsyncIterable");function HXo(t){return t===!0||t===!1}a(HXo,"isBoolean");function twn(t){return typeof t>"u"}a(twn,"isUndefined");function GXo(t){return!CXe(t)}a(GXo,"isDefined");function CXe(t){return twn(t)||t===null}a(CXe,"isUndefinedOrNull");function $Xo(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a($Xo,"assertType");function VXo(t){return(0,BXo.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(VXo,"assertReturnsDefined");function WXo(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(WXo,"assertDefined");function zXo(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");Ol.isOneOf=YXo;function KXo(t){}a(KXo,"typeCheck");var JXo=Object.prototype.hasOwnProperty;function ZXo(t){if(!ewn(t))return!1;for(let e in t)if(JXo.call(t,e))return!1;return!0}a(ZXo,"isEmptyObject");function _$t(t){return typeof t=="function"}a(_$t,"isFunction");function XXo(...t){return t.length>0&&t.every(_$t)}a(XXo,"areFunctions");function ees(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(bXe,"__esModule",{value:!0});bXe.Iterable=void 0;var nes=CT(),nwn;(function(t){function e(x){return!!x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}a(e,"is"),t.is=e;let r=Object.freeze([]);function n(){return r}a(n,"empty"),t.empty=n;function*o(x){yield x}a(o,"single"),t.single=o;function s(x){return e(x)?x:o(x)}a(s,"wrap"),t.wrap=s;function c(x){return x??r}a(c,"from"),t.from=c;function*l(x){for(let k=x.length-1;k>=0;k--)yield x[k]}a(l,"reverse"),t.reverse=l;function u(x){return!x||x[Symbol.iterator]().next().done===!0}a(u,"isEmpty"),t.isEmpty=u;function d(x){return x[Symbol.iterator]().next().value}a(d,"first"),t.first=d;function f(x,k){let D=0;for(let N of x)if(k(N,D++))return!0;return!1}a(f,"some"),t.some=f;function h(x,k){let D=0;for(let N of x)if(!k(N,D++))return!1;return!0}a(h,"every"),t.every=h;function m(x,k){for(let D of x)if(k(D))return D}a(m,"find"),t.find=m;function*g(x,k){for(let D of x)k(D)&&(yield D)}a(g,"filter"),t.filter=g;function*A(x,k){let D=0;for(let N of x)yield k(N,D++)}a(A,"map"),t.map=A;function*y(x,k){let D=0;for(let N of x)yield*k(N,D++)}a(y,"flatMap"),t.flatMap=y;function*_(...x){for(let k of x)(0,nes.isIterable)(k)?yield*k:yield k}a(_,"concat"),t.concat=_;function E(x,k,D){let N=D;for(let O of x)N=k(N,O);return N}a(E,"reduce"),t.reduce=E;function v(x){let k=0;for(let D of x)k++;return k}a(v,"length"),t.length=v;function*S(x,k,D=x.length){for(k<-x.length&&(k=0),k<0&&(k+=x.length),D<0?D+=x.length:D>x.length&&(D=x.length);k{"use strict";p();Object.defineProperty(_s,"__esModule",{value:!0});_s.DisposableResourceMap=_s.DisposableSet=_s.DisposableMap=_s.ImmortalReference=_s.AsyncReferenceCollection=_s.ReferenceCollection=_s.RefCountedDisposable=_s.MandatoryMutableDisposable=_s.MutableDisposable=_s.Disposable=_s.DisposableStore=_s.DisposableTracker=_s.GCBasedDisposableTracker=void 0;_s.setDisposableTracker=awn;_s.trackDisposable=zJ;_s.markAsDisposed=YJ;_s.markAsSingleton=les;_s.isDisposable=cwn;_s.dispose=DRe;_s.disposeIfDisposable=ues;_s.combinedDisposable=des;_s.toDisposable=P$t;_s.disposeOnReturn=fes;_s.thenIfNotDisposed=pes;_s.thenRegisterOrDispose=hes;var iwn=Ml(),ies=a$t(),swn=b2(),oes=l$t(),ses=E$t(),own=Os(),aes=!1,WJ=null,v$t=class{static{a(this,"GCBasedDisposableTracker")}constructor(){this._registry=new FinalizationRegistry(e=>{console.warn(`[LEAKED DISPOSABLE] ${e}`)})}trackDisposable(e){let r=new Error("CREATED via:").stack;this._registry.register(e,r,e)}setParent(e,r){r?this._registry.unregister(e):this.trackDisposable(e)}markAsDisposed(e){this._registry.unregister(e)}markAsSingleton(e){this._registry.unregister(e)}};_s.GCBasedDisposableTracker=v$t;var C$t=class t{static{a(this,"DisposableTracker")}constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let r=this.livingDisposables.get(e);return r||(r={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,r)),r}trackDisposable(e){let r=this.getDisposableData(e);r.source||(r.source=new Error().stack)}setParent(e,r){let n=this.getDisposableData(e);n.parent=r}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,r){let n=r.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),r):e;return r.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,r){let n;if(r)n=r;else{let u=new Map,d=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,u).isSingleton);if(d.length===0)return;let f=new Set(d.map(h=>h.value));if(n=d.filter(h=>!(h.parent&&f.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(u){function d(h,m){for(;h.length>0&&m.some(g=>typeof g=="string"?g===h[0]:h[0].match(g));)h.shift()}a(d,"removePrefix");let f=u.source.split(` -`).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return d(f,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),f.reverse()}a(o,"getStackTracePath");let s=new swn.SetMap;for(let u of n){let d=o(u);for(let f=0;f<=d.length;f++)s.add(d.slice(0,f).join(` -`),u)}n.sort((0,iwn.compareBy)(u=>u.idx,iwn.numberComparator));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;h{"use strict";p();Object.defineProperty(xF,"__esModule",{value:!0});xF.ok=DXo;xF.assertNever=NXo;xF.softAssertNever=MXo;xF.assert=OXo;xF.softAssert=LXo;xF.assertFn=BXo;xF.checkAdjacentItems=FXo;var kRe=Os();function DXo(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(DXo,"ok");function NXo(t,e="Unreachable"){throw new Error(e)}a(NXo,"assertNever");function MXo(t){}a(MXo,"softAssertNever");function OXo(t,e="unexpected state"){if(!t)throw typeof e=="string"?new kRe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(OXo,"assert");function LXo(t,e="Soft Assertion Failed"){t||(0,kRe.onUnexpectedError)(new kRe.BugIndicatingError(e))}a(LXo,"softAssert");function BXo(t){if(!t()){debugger;t(),(0,kRe.onUnexpectedError)(new kRe.BugIndicatingError("Assertion Failed"))}}a(BXo,"assertFn");function FXo(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(Ol,"__esModule",{value:!0});Ol.isOneOf=void 0;Ol.isString=_$t;Ol.isStringArray=QXo;Ol.isArrayOf=ewn;Ol.isObject=twn;Ol.isTypedArray=qXo;Ol.isNumber=jXo;Ol.isIterable=HXo;Ol.isAsyncIterable=GXo;Ol.isBoolean=$Xo;Ol.isUndefined=rwn;Ol.isDefined=VXo;Ol.isUndefinedOrNull=CXe;Ol.assertType=WXo;Ol.assertReturnsDefined=zXo;Ol.assertDefined=YXo;Ol.assertReturnsAllDefined=KXo;Ol.typeCheck=ZXo;Ol.isEmptyObject=ees;Ol.isFunction=E$t;Ol.areFunctions=tes;Ol.validateConstraints=res;Ol.validateConstraint=nwn;Ol.upcast=nes;Ol.hasKey=ies;var UXo=pd();function _$t(t){return typeof t=="string"}a(_$t,"isString");function QXo(t){return ewn(t,_$t)}a(QXo,"isStringArray");function ewn(t,e){return Array.isArray(t)&&t.every(e)}a(ewn,"isArrayOf");function twn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(twn,"isObject");function qXo(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(qXo,"isTypedArray");function jXo(t){return typeof t=="number"&&!isNaN(t)}a(jXo,"isNumber");function HXo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(HXo,"isIterable");function GXo(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(GXo,"isAsyncIterable");function $Xo(t){return t===!0||t===!1}a($Xo,"isBoolean");function rwn(t){return typeof t>"u"}a(rwn,"isUndefined");function VXo(t){return!CXe(t)}a(VXo,"isDefined");function CXe(t){return rwn(t)||t===null}a(CXe,"isUndefinedOrNull");function WXo(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a(WXo,"assertType");function zXo(t){return(0,UXo.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(zXo,"assertReturnsDefined");function YXo(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(YXo,"assertDefined");function KXo(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");Ol.isOneOf=JXo;function ZXo(t){}a(ZXo,"typeCheck");var XXo=Object.prototype.hasOwnProperty;function ees(t){if(!twn(t))return!1;for(let e in t)if(XXo.call(t,e))return!1;return!0}a(ees,"isEmptyObject");function E$t(t){return typeof t=="function"}a(E$t,"isFunction");function tes(...t){return t.length>0&&t.every(E$t)}a(tes,"areFunctions");function res(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(bXe,"__esModule",{value:!0});bXe.Iterable=void 0;var oes=CT(),iwn;(function(t){function e(x){return!!x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}a(e,"is"),t.is=e;let r=Object.freeze([]);function n(){return r}a(n,"empty"),t.empty=n;function*o(x){yield x}a(o,"single"),t.single=o;function s(x){return e(x)?x:o(x)}a(s,"wrap"),t.wrap=s;function c(x){return x??r}a(c,"from"),t.from=c;function*l(x){for(let k=x.length-1;k>=0;k--)yield x[k]}a(l,"reverse"),t.reverse=l;function u(x){return!x||x[Symbol.iterator]().next().done===!0}a(u,"isEmpty"),t.isEmpty=u;function d(x){return x[Symbol.iterator]().next().value}a(d,"first"),t.first=d;function f(x,k){let D=0;for(let N of x)if(k(N,D++))return!0;return!1}a(f,"some"),t.some=f;function h(x,k){let D=0;for(let N of x)if(!k(N,D++))return!1;return!0}a(h,"every"),t.every=h;function m(x,k){for(let D of x)if(k(D))return D}a(m,"find"),t.find=m;function*g(x,k){for(let D of x)k(D)&&(yield D)}a(g,"filter"),t.filter=g;function*A(x,k){let D=0;for(let N of x)yield k(N,D++)}a(A,"map"),t.map=A;function*y(x,k){let D=0;for(let N of x)yield*k(N,D++)}a(y,"flatMap"),t.flatMap=y;function*_(...x){for(let k of x)(0,oes.isIterable)(k)?yield*k:yield k}a(_,"concat"),t.concat=_;function E(x,k,D){let N=D;for(let O of x)N=k(N,O);return N}a(E,"reduce"),t.reduce=E;function v(x){let k=0;for(let D of x)k++;return k}a(v,"length"),t.length=v;function*S(x,k,D=x.length){for(k<-x.length&&(k=0),k<0&&(k+=x.length),D<0?D+=x.length:D>x.length&&(D=x.length);k{"use strict";p();Object.defineProperty(_s,"__esModule",{value:!0});_s.DisposableResourceMap=_s.DisposableSet=_s.DisposableMap=_s.ImmortalReference=_s.AsyncReferenceCollection=_s.ReferenceCollection=_s.RefCountedDisposable=_s.MandatoryMutableDisposable=_s.MutableDisposable=_s.Disposable=_s.DisposableStore=_s.DisposableTracker=_s.GCBasedDisposableTracker=void 0;_s.setDisposableTracker=cwn;_s.trackDisposable=YJ;_s.markAsDisposed=KJ;_s.markAsSingleton=des;_s.isDisposable=lwn;_s.dispose=DRe;_s.disposeIfDisposable=fes;_s.combinedDisposable=pes;_s.toDisposable=D$t;_s.disposeOnReturn=hes;_s.thenIfNotDisposed=mes;_s.thenRegisterOrDispose=ges;var own=Ml(),ses=c$t(),awn=b2(),aes=u$t(),ces=v$t(),swn=Os(),les=!1,zJ=null,C$t=class{static{a(this,"GCBasedDisposableTracker")}constructor(){this._registry=new FinalizationRegistry(e=>{console.warn(`[LEAKED DISPOSABLE] ${e}`)})}trackDisposable(e){let r=new Error("CREATED via:").stack;this._registry.register(e,r,e)}setParent(e,r){r?this._registry.unregister(e):this.trackDisposable(e)}markAsDisposed(e){this._registry.unregister(e)}markAsSingleton(e){this._registry.unregister(e)}};_s.GCBasedDisposableTracker=C$t;var b$t=class t{static{a(this,"DisposableTracker")}constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let r=this.livingDisposables.get(e);return r||(r={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,r)),r}trackDisposable(e){let r=this.getDisposableData(e);r.source||(r.source=new Error().stack)}setParent(e,r){let n=this.getDisposableData(e);n.parent=r}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,r){let n=r.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),r):e;return r.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,r){let n;if(r)n=r;else{let u=new Map,d=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,u).isSingleton);if(d.length===0)return;let f=new Set(d.map(h=>h.value));if(n=d.filter(h=>!(h.parent&&f.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(u){function d(h,m){for(;h.length>0&&m.some(g=>typeof g=="string"?g===h[0]:h[0].match(g));)h.shift()}a(d,"removePrefix");let f=u.source.split(` +`).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return d(f,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),f.reverse()}a(o,"getStackTracePath");let s=new awn.SetMap;for(let u of n){let d=o(u);for(let f=0;f<=d.length;f++)s.add(d.slice(0,f).join(` +`),u)}n.sort((0,own.compareBy)(u=>u.idx,own.numberComparator));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;ho(_)[h]),_=>_);delete y[d[h]];for(let[_,E]of Object.entries(y))E&&f.unshift(` - stacktraces of ${E.length} other leaks continue with ${_}`);f.unshift(m)}c+=` +`)),y=(0,ses.groupBy)([...A].map(_=>o(_)[h]),_=>_);delete y[d[h]];for(let[_,E]of Object.entries(y))E&&f.unshift(` - stacktraces of ${E.length} other leaks continue with ${_}`);f.unshift(m)}c+=` ==================== Leaking disposable ${l}/${n.length}: ${u.value.constructor.name} ==================== @@ -100,17 +100,17 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};_s.DisposableTracker=C$t;function awn(t){WJ=t}a(awn,"setDisposableTracker");if(aes){let t="__is_disposable_tracked__";awn(new class{trackDisposable(e){let r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==gde.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==gde.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function zJ(t){return WJ?.trackDisposable(t),t}a(zJ,"trackDisposable");function YJ(t){WJ?.markAsDisposed(t)}a(YJ,"markAsDisposed");function wF(t,e){WJ?.setParent(t,e)}a(wF,"setParentOfDisposable");function ces(t,e){if(WJ)for(let r of t)WJ.setParent(r,e)}a(ces,"setParentOfDisposables");function les(t){return WJ?.markAsSingleton(t),t}a(les,"markAsSingleton");function cwn(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(cwn,"isDisposable");function DRe(t){if(ses.Iterable.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(DRe,"dispose");function ues(t){for(let e of t)cwn(e)&&e.dispose();return[]}a(ues,"disposeIfDisposable");function des(...t){let e=P$t(()=>DRe(t));return ces(t,e),e}a(des,"combinedDisposable");var b$t=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,zJ(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,YJ(this),this._fn()}}};function P$t(t){return new b$t(t)}a(P$t,"toDisposable");var PRe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,zJ(this)}dispose(){this._isDisposed||(YJ(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{DRe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===gde.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return wF(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&wF(e,null)}assertNotDisposed(){this._isDisposed&&(0,own.onUnexpectedError)(new own.BugIndicatingError("Object disposed"))}};_s.DisposableStore=PRe;var gde=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new PRe,zJ(this),wF(this._store,this)}dispose(){YJ(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};_s.Disposable=gde;var SXe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,zJ(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&wF(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,YJ(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&wF(e,null),e}};_s.MutableDisposable=SXe;var S$t=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new SXe,this._isDisposed=!1,this._disposable.value=e}get value(){return this._disposable.value}set value(e){this._isDisposed||e===this._disposable.value||(this._disposable.value=e)}dispose(){this._isDisposed=!0,this._disposable.dispose()}};_s.MandatoryMutableDisposable=S$t;var T$t=class{static{a(this,"RefCountedDisposable")}constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}};_s.RefCountedDisposable=T$t;var I$t=class{static{a(this,"ReferenceCollection")}constructor(){this.references=new Map}acquire(e,...r){let n=this.references.get(e);n||(n={counter:0,object:this.createReferencedObject(e,...r)},this.references.set(e,n));let{object:o}=n,s=(0,oes.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};_s.ReferenceCollection=I$t;var x$t=class{static{a(this,"AsyncReferenceCollection")}constructor(e){this.referenceCollection=e}async acquire(e,...r){let n=this.referenceCollection.acquire(e,...r);try{return{object:await n.object,dispose:a(()=>n.dispose(),"dispose")}}catch(o){throw n.dispose(),o}}};_s.AsyncReferenceCollection=x$t;var w$t=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};_s.ImmortalReference=w$t;function fes(t){let e=new PRe;try{t(e)}finally{e.dispose()}}a(fes,"disposeOnReturn");var TXe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,zJ(this)}dispose(){YJ(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{DRe(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,r,n=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||this._store.get(e)?.dispose(),this._store.set(e,r),wF(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&wF(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};_s.DisposableMap=TXe;var R$t=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,zJ(this)}dispose(){YJ(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{DRe(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}add(e){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableSet that has already been disposed of. The added object will be leaked!").stack),this._store.add(e),wF(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return wF(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};_s.DisposableSet=R$t;function pes(t,e){let r=!1;return t.then(n=>{r||e(n)}),P$t(()=>{r=!0})}a(pes,"thenIfNotDisposed");function hes(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(hes,"thenRegisterOrDispose");var k$t=class extends TXe{static{a(this,"DisposableResourceMap")}constructor(){super(new swn.ResourceMap)}};_s.DisposableResourceMap=k$t});var Ade=I(IXe=>{"use strict";p();Object.defineProperty(IXe,"__esModule",{value:!0});IXe.LinkedList=void 0;var ku=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}},D$t=class{static{a(this,"LinkedList")}constructor(){this._first=ku.Undefined,this._last=ku.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ku.Undefined}clear(){let e=this._first;for(;e!==ku.Undefined;){let r=e.next;e.prev=ku.Undefined,e.next=ku.Undefined,e=r}this._first=ku.Undefined,this._last=ku.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new ku(e);if(this._first===ku.Undefined)this._first=n,this._last=n;else if(r){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let o=!1;return()=>{o||(o=!0,this._remove(n))}}shift(){if(this._first!==ku.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ku.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==ku.Undefined)return this._last.element}_remove(e){if(e.prev!==ku.Undefined&&e.next!==ku.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===ku.Undefined&&e.next===ku.Undefined?(this._first=ku.Undefined,this._last=ku.Undefined):e.next===ku.Undefined?(this._last=this._last.prev,this._last.next=ku.Undefined):e.prev===ku.Undefined&&(this._first=this._first.next,this._first.prev=ku.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ku.Undefined;)yield e.element,e=e.next}};IXe.LinkedList=D$t});var fwn=I(yde=>{"use strict";p();Object.defineProperty(yde,"__esModule",{value:!0});yde.getNLSMessages=lwn;yde.getNLSLanguage=uwn;yde.localize=ges;yde.localize2=Aes;function lwn(){return globalThis._VSCODE_NLS_MESSAGES}a(lwn,"getNLSMessages");function uwn(){return globalThis._VSCODE_NLS_LANGUAGE}a(uwn,"getNLSLanguage");var mes=uwn()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function xXe(t,e){let r;return e.length===0?r=t:r=t.replace(/\{(\d+)\}/g,(n,o)=>{let s=o[0],c=e[s],l=n;return typeof c=="string"?l=c:(typeof c=="number"||typeof c=="boolean"||c===void 0||c===null)&&(l=String(c)),l}),mes&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(xXe,"_format");function ges(t,e,...r){return xXe(typeof t=="number"?dwn(t,e):e,r)}a(ges,"localize");function dwn(t,e){let r=lwn()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(dwn,"lookupMessage");function Aes(t,e,...r){let n;typeof t=="number"?n=dwn(t,e):n=e;let o=xXe(n,r);return{value:o,original:e===n?o:xXe(e,r)}}a(Aes,"localize2")});var pj=I(gr=>{"use strict";p();var yes=gr&&gr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_es=gr&&gr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Ees=gr&&gr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=0,LRe=RF.indexOf("Macintosh")>=0,O$t=(RF.indexOf("Macintosh")>=0||RF.indexOf("iPad")>=0||RF.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,MRe=RF.indexOf("Linux")>=0,Ewn=RF?.indexOf("Mobi")>=0,M$t=!0,wXe=ves.getNLSLanguage()||gr.LANGUAGE_DEFAULT,NRe=navigator.language.toLowerCase(),N$t=NRe):console.error("Unable to resolve platform.");function bes(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(bes,"PlatformToString");var RXe=0;LRe?RXe=1:ORe?RXe=3:MRe&&(RXe=2);gr.isWindows=ORe;gr.isMacintosh=LRe;gr.isLinux=MRe;gr.isLinuxSnap=gwn;gr.isNative=Awn;gr.isElectron=ywn;gr.isWeb=M$t;gr.isWebWorker=M$t&&typeof kF.importScripts=="function";gr.webWorkerOrigin=gr.isWebWorker?kF.origin:void 0;gr.isIOS=O$t;gr.isMobile=Ewn;gr.isCI=_wn;gr.platform=RXe;gr.userAgent=RF;gr.language=wXe;var pwn;(function(t){function e(){return gr.language}a(e,"value"),t.value=e;function r(){return gr.language.length===2?gr.language==="en":gr.language.length>=3?gr.language[0]==="e"&&gr.language[1]==="n"&&gr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return gr.language==="en"}a(n,"isDefault"),t.isDefault=n})(pwn||(gr.Language=pwn={}));gr.locale=NRe;gr.platformLocale=N$t;gr.translationsConfigFile=vwn;gr.setTimeout0IsFaster=typeof kF.postMessage=="function"&&!kF.importScripts;gr.setTimeout0=(()=>{if(gr.setTimeout0IsFaster){let t=[];kF.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),kF.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();gr.OS=LRe||O$t?2:ORe?1:3;var hwn=!0,mwn=!1;function Ses(){if(!mwn){mwn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,hwn=new Uint16Array(t.buffer)[0]===513}return hwn}a(Ses,"isLittleEndian");gr.isChrome=!!(gr.userAgent&&gr.userAgent.indexOf("Chrome")>=0);gr.isFirefox=!!(gr.userAgent&&gr.userAgent.indexOf("Firefox")>=0);gr.isSafari=!!(!gr.isChrome&&gr.userAgent&&gr.userAgent.indexOf("Safari")>=0);gr.isEdge=!!(gr.userAgent&&gr.userAgent.indexOf("Edg/")>=0);gr.isAndroid=!!(gr.userAgent&&gr.userAgent.indexOf("Android")>=0);function Tes(t){return parseFloat(t)>=25}a(Tes,"isTahoeOrNewer")});var BRe=I(_5=>{"use strict";p();Object.defineProperty(_5,"__esModule",{value:!0});_5.arch=_5.platform=_5.env=_5.cwd=void 0;var bwn=pj(),KJ,L$t=globalThis.vscode;if(typeof L$t<"u"&&typeof L$t.process<"u"){let t=L$t.process;KJ={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?KJ={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:KJ={get platform(){return bwn.isWindows?"win32":bwn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};_5.cwd=KJ.cwd;_5.env=KJ.env;_5.platform=KJ.platform;_5.arch=KJ.arch});var E5=I(kXe=>{"use strict";p();Object.defineProperty(kXe,"__esModule",{value:!0});kXe.StopWatch=void 0;var Ies=globalThis.performance.now.bind(globalThis.performance),B$t=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:Ies,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};kXe.StopWatch=B$t});var Fc=I(Xa=>{"use strict";p();Object.defineProperty(Xa,"__esModule",{value:!0});Xa.ValueWithChangeEvent=Xa.Relay=Xa.EventBufferer=Xa.DynamicListEventMultiplexer=Xa.EventMultiplexer=Xa.MicrotaskEmitter=Xa.DebounceEmitter=Xa.PauseableEmitter=Xa.AsyncEmitter=Xa.createEventDeliveryQueue=Xa.Emitter=Xa.ListenerRefusalError=Xa.ListenerLeakError=Xa.EventProfiling=Xa.Event=void 0;Xa.setGlobalLeakWarningThreshold=Nes;Xa.trackSetChanges=Bes;var xes=a$t(),FRe=Os(),wes=l$t(),gb=Po(),wwn=Ade(),Res=BRe(),kes=E5(),Swn=!1,Pes=!1,Des=100,Twn=6e4;function Iwn(){return!!Res.env.VSCODE_DEV}a(Iwn,"_isBufferLeakWarningEnabled");var PXe;(function(t){t.None=()=>gb.Disposable.None;function e(M){if(Pes){let{onDidAddListener:L}=M,U=Ede.create(),j=0;M.onDidAddListener=()=>{++j===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),U.print()),L?.()}}}a(e,"_addLeakageTraceLogic");function r(M,L,U){return g(M,()=>{},0,void 0,L??!0,void 0,U)}a(r,"defer"),t.defer=r;function n(M){return(L,U=null,j)=>{let Q=!1,Y;return Y=M(W=>{if(!Q)return Y?Y.dispose():Q=!0,L.call(U,W)},null,j),Q&&Y.dispose(),Y}}a(n,"once"),t.once=n;function o(M,L){return t.once(t.filter(M,L))}a(o,"onceIf"),t.onceIf=o;function s(M,L,U){return h((j,Q=null,Y)=>M(W=>j.call(Q,L(W)),null,Y),U)}a(s,"map"),t.map=s;function c(M,L,U){return h((j,Q=null,Y)=>M(W=>{L(W),j.call(Q,W)},null,Y),U)}a(c,"forEach"),t.forEach=c;function l(M,L,U){return h((j,Q=null,Y)=>M(W=>L(W)&&j.call(Q,W),null,Y),U)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(L,U=null,j)=>{let Q=(0,gb.combinedDisposable)(...M.map(Y=>Y(W=>L.call(U,W))));return m(Q,j)}}a(d,"any"),t.any=d;function f(M,L,U,j){let Q=U;return s(M,Y=>(Q=L(Q,Y),Q),j)}a(f,"reduce"),t.reduce=f;function h(M,L){let U,j={onWillAddFirstListener(){U=M(Q.fire,Q)},onDidRemoveLastListener(){U?.dispose()}};L||e(j);let Q=new w_(j);return L?.add(Q),Q.event}a(h,"snapshot");function m(M,L){return L instanceof Array?L.push(M):L&&L.add(M),M}a(m,"addAndReturnDisposable");function g(M,L,U=100,j=!1,Q=!1,Y,W){let V,z,ie,H=0,re,le={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(me=>{H++,z=L(z,me),j&&!ie&&(Le.fire(z),z=void 0),re=a(()=>{let Oe=z;z=void 0,ie=void 0,(!j||H>1)&&Le.fire(Oe),H=0},"doFire"),typeof U=="number"?(ie&&clearTimeout(ie),ie=setTimeout(re,U)):ie===void 0&&(ie=null,queueMicrotask(re))})},onWillRemoveListener(){Q&&H>0&&re?.()},onDidRemoveLastListener(){re=void 0,V.dispose()}};W||e(le);let Le=new w_(le);return W?.add(Le),Le.event}a(g,"debounce"),t.debounce=g;function A(M,L=0,U,j){return t.debounce(M,(Q,Y)=>Q?(Q.push(Y),Q):[Y],L,void 0,U??!0,void 0,j)}a(A,"accumulate"),t.accumulate=A;function y(M,L,U=100,j=!0,Q=!0,Y,W){let V,z,ie,H=0,re={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(Le=>{H++,z=L(z,Le),ie===void 0&&(j&&(le.fire(z),z=void 0,H=0),typeof U=="number"?ie=setTimeout(()=>{Q&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0},U):(ie=0,queueMicrotask(()=>{Q&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0})))})},onDidRemoveLastListener(){V.dispose()}};W||e(re);let le=new w_(re);return W?.add(le),le.event}a(y,"throttle"),t.throttle=y;function _(M,L=(j,Q)=>j===Q,U){let j=!0,Q;return l(M,Y=>{let W=j||!L(Y,Q);return j=!1,Q=Y,W},U)}a(_,"latch"),t.latch=_;function E(M,L,U){return[t.filter(M,L,U),t.filter(M,j=>!L(j),U)]}a(E,"split"),t.split=E;function v(M,L,U=!1,j=[],Q){let Y=j.slice(),W;Iwn()&&(W={stack:Ede.create(),timerId:setTimeout(()=>{Y&&Y.length>0&&W&&!W.warned&&(W.warned=!0,console.warn(`[Event.buffer][${L}] potential LEAK detected: ${Y.length} events buffered for ${Twn/1e3}s without being consumed. Buffered here:`),W.stack.print())},Twn),warned:!1},Q&&Q.add((0,gb.toDisposable)(()=>clearTimeout(W.timerId))));let V=a(()=>{W&&clearTimeout(W.timerId)},"clearLeakWarningTimer"),z=M(re=>{Y?(Y.push(re),Iwn()&&W&&!W.warned&&Y.length>=Des&&(W.warned=!0,console.warn(`[Event.buffer][${L}] potential LEAK detected: ${Y.length} events buffered without being consumed. Buffered here:`),W.stack.print())):H.fire(re)});Q&&Q.add(z);let ie=a(()=>{Y?.forEach(re=>H.fire(re)),Y=null,V()},"flush"),H=new w_({onWillAddFirstListener(){z||(z=M(re=>H.fire(re)),Q&&Q.add(z))},onDidAddFirstListener(){Y&&(U?setTimeout(ie):ie())},onDidRemoveLastListener(){z&&z.dispose(),z=null,V()}});return Q&&Q.add(H),H.event}a(v,"buffer"),t.buffer=v;function S(M,L){return a((j,Q,Y)=>{let W=L(new w);return M(function(V){let z=W.evaluate(V);z!==T&&j.call(Q,z)},void 0,Y)},"fn")}a(S,"chain"),t.chain=S;let T=Symbol("HaltChainable");class w{static{a(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(L){return this.steps.push(L),this}forEach(L){return this.steps.push(U=>(L(U),U)),this}filter(L){return this.steps.push(U=>L(U)?U:T),this}reduce(L,U){let j=U;return this.steps.push(Q=>(j=L(j,Q),j)),this}latch(L=(U,j)=>U===j){let U=!0,j;return this.steps.push(Q=>{let Y=U||!L(Q,j);return U=!1,j=Q,Y?Q:T}),this}evaluate(L){for(let U of this.steps)if(L=U(L),L===T)break;return L}}function R(M,L,U=j=>j){let j=a((...V)=>W.fire(U(...V)),"fn"),Q=a(()=>M.on(L,j),"onFirstListenerAdd"),Y=a(()=>M.removeListener(L,j),"onLastListenerRemove"),W=new w_({onWillAddFirstListener:Q,onDidRemoveLastListener:Y});return W.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,L,U=j=>j){let j=a((...V)=>W.fire(U(...V)),"fn"),Q=a(()=>M.addEventListener(L,j),"onFirstListenerAdd"),Y=a(()=>M.removeEventListener(L,j),"onLastListenerRemove"),W=new w_({onWillAddFirstListener:Q,onDidRemoveLastListener:Y});return W.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function k(M,L){let U,j,Q=new Promise(Y=>{j=n(M)(Y),W$t(j,L),U=a(()=>{xwn(j,L)},"cancelRef")});return Q.cancel=U,L&&Q.finally(()=>xwn(j,L)),Q}a(k,"toPromise"),t.toPromise=k;function D(M,L){return M(U=>L.fire(U))}a(D,"forward"),t.forward=D;function N(M,L,U){return L(U),M(j=>L(j))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class O{static{a(this,"EmitterObserver")}constructor(L,U){this._observable=L,this._counter=0,this._hasChanged=!1;let j={onWillAddFirstListener:a(()=>{L.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{L.removeObserver(this)},"onDidRemoveLastListener")};U||e(j),this.emitter=new w_(j),U&&U.add(this.emitter)}beginUpdate(L){this._counter++}handlePossibleChange(L){}handleChange(L,U){this._hasChanged=!0}endUpdate(L){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(M,L){return new O(M,L).emitter.event}a(B,"fromObservable"),t.fromObservable=B;function q(M){return(L,U,j)=>{let Q=0,Y=!1,W={beginUpdate(){Q++},endUpdate(){Q--,Q===0&&(M.reportChanges(),Y&&(Y=!1,L.call(U)))},handlePossibleChange(){},handleChange(){Y=!0}};M.addObserver(W),M.reportChanges();let V={dispose(){M.removeObserver(W)}};return W$t(V,j),V}}a(q,"fromObservableLight"),t.fromObservableLight=q})(PXe||(Xa.Event=PXe={}));var DXe=class t{static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${t._idPool++}`,t.all.add(this)}start(e){this._stopWatch=new kes.StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};Xa.EventProfiling=DXe;var URe=-1;function Nes(t){let e=URe;return URe=t,{dispose(){URe=e}}}a(Nes,"setGlobalLeakWarningThreshold");var F$t=class t{static{a(this,"LeakageMonitor")}static{this._idPool=1}constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r.3?"dominated":"popular",f=new QRe(d,u,s,r,l);this._errorHandler(f)}return()=>{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||r{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==Ade.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==Ade.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function YJ(t){return zJ?.trackDisposable(t),t}a(YJ,"trackDisposable");function KJ(t){zJ?.markAsDisposed(t)}a(KJ,"markAsDisposed");function wF(t,e){zJ?.setParent(t,e)}a(wF,"setParentOfDisposable");function ues(t,e){if(zJ)for(let r of t)zJ.setParent(r,e)}a(ues,"setParentOfDisposables");function des(t){return zJ?.markAsSingleton(t),t}a(des,"markAsSingleton");function lwn(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(lwn,"isDisposable");function DRe(t){if(ces.Iterable.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(DRe,"dispose");function fes(t){for(let e of t)lwn(e)&&e.dispose();return[]}a(fes,"disposeIfDisposable");function pes(...t){let e=D$t(()=>DRe(t));return ues(t,e),e}a(pes,"combinedDisposable");var S$t=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,YJ(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,KJ(this),this._fn()}}};function D$t(t){return new S$t(t)}a(D$t,"toDisposable");var PRe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,YJ(this)}dispose(){this._isDisposed||(KJ(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{DRe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===Ade.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return wF(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&wF(e,null)}assertNotDisposed(){this._isDisposed&&(0,swn.onUnexpectedError)(new swn.BugIndicatingError("Object disposed"))}};_s.DisposableStore=PRe;var Ade=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new PRe,YJ(this),wF(this._store,this)}dispose(){KJ(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};_s.Disposable=Ade;var SXe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,YJ(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&wF(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,KJ(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&wF(e,null),e}};_s.MutableDisposable=SXe;var T$t=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new SXe,this._isDisposed=!1,this._disposable.value=e}get value(){return this._disposable.value}set value(e){this._isDisposed||e===this._disposable.value||(this._disposable.value=e)}dispose(){this._isDisposed=!0,this._disposable.dispose()}};_s.MandatoryMutableDisposable=T$t;var I$t=class{static{a(this,"RefCountedDisposable")}constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}};_s.RefCountedDisposable=I$t;var x$t=class{static{a(this,"ReferenceCollection")}constructor(){this.references=new Map}acquire(e,...r){let n=this.references.get(e);n||(n={counter:0,object:this.createReferencedObject(e,...r)},this.references.set(e,n));let{object:o}=n,s=(0,aes.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};_s.ReferenceCollection=x$t;var w$t=class{static{a(this,"AsyncReferenceCollection")}constructor(e){this.referenceCollection=e}async acquire(e,...r){let n=this.referenceCollection.acquire(e,...r);try{return{object:await n.object,dispose:a(()=>n.dispose(),"dispose")}}catch(o){throw n.dispose(),o}}};_s.AsyncReferenceCollection=w$t;var R$t=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};_s.ImmortalReference=R$t;function hes(t){let e=new PRe;try{t(e)}finally{e.dispose()}}a(hes,"disposeOnReturn");var TXe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,YJ(this)}dispose(){KJ(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{DRe(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,r,n=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||this._store.get(e)?.dispose(),this._store.set(e,r),wF(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&wF(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};_s.DisposableMap=TXe;var k$t=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,YJ(this)}dispose(){KJ(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{DRe(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}add(e){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableSet that has already been disposed of. The added object will be leaked!").stack),this._store.add(e),wF(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return wF(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};_s.DisposableSet=k$t;function mes(t,e){let r=!1;return t.then(n=>{r||e(n)}),D$t(()=>{r=!0})}a(mes,"thenIfNotDisposed");function ges(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(ges,"thenRegisterOrDispose");var P$t=class extends TXe{static{a(this,"DisposableResourceMap")}constructor(){super(new awn.ResourceMap)}};_s.DisposableResourceMap=P$t});var yde=I(IXe=>{"use strict";p();Object.defineProperty(IXe,"__esModule",{value:!0});IXe.LinkedList=void 0;var ku=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}},N$t=class{static{a(this,"LinkedList")}constructor(){this._first=ku.Undefined,this._last=ku.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ku.Undefined}clear(){let e=this._first;for(;e!==ku.Undefined;){let r=e.next;e.prev=ku.Undefined,e.next=ku.Undefined,e=r}this._first=ku.Undefined,this._last=ku.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new ku(e);if(this._first===ku.Undefined)this._first=n,this._last=n;else if(r){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let o=!1;return()=>{o||(o=!0,this._remove(n))}}shift(){if(this._first!==ku.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ku.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==ku.Undefined)return this._last.element}_remove(e){if(e.prev!==ku.Undefined&&e.next!==ku.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===ku.Undefined&&e.next===ku.Undefined?(this._first=ku.Undefined,this._last=ku.Undefined):e.next===ku.Undefined?(this._last=this._last.prev,this._last.next=ku.Undefined):e.prev===ku.Undefined&&(this._first=this._first.next,this._first.prev=ku.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ku.Undefined;)yield e.element,e=e.next}};IXe.LinkedList=N$t});var pwn=I(_de=>{"use strict";p();Object.defineProperty(_de,"__esModule",{value:!0});_de.getNLSMessages=uwn;_de.getNLSLanguage=dwn;_de.localize=yes;_de.localize2=_es;function uwn(){return globalThis._VSCODE_NLS_MESSAGES}a(uwn,"getNLSMessages");function dwn(){return globalThis._VSCODE_NLS_LANGUAGE}a(dwn,"getNLSLanguage");var Aes=dwn()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function xXe(t,e){let r;return e.length===0?r=t:r=t.replace(/\{(\d+)\}/g,(n,o)=>{let s=o[0],c=e[s],l=n;return typeof c=="string"?l=c:(typeof c=="number"||typeof c=="boolean"||c===void 0||c===null)&&(l=String(c)),l}),Aes&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(xXe,"_format");function yes(t,e,...r){return xXe(typeof t=="number"?fwn(t,e):e,r)}a(yes,"localize");function fwn(t,e){let r=uwn()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(fwn,"lookupMessage");function _es(t,e,...r){let n;typeof t=="number"?n=fwn(t,e):n=e;let o=xXe(n,r);return{value:o,original:e===n?o:xXe(e,r)}}a(_es,"localize2")});var pj=I(gr=>{"use strict";p();var Ees=gr&&gr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ves=gr&&gr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Ces=gr&&gr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=0,LRe=RF.indexOf("Macintosh")>=0,L$t=(RF.indexOf("Macintosh")>=0||RF.indexOf("iPad")>=0||RF.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,MRe=RF.indexOf("Linux")>=0,vwn=RF?.indexOf("Mobi")>=0,O$t=!0,wXe=bes.getNLSLanguage()||gr.LANGUAGE_DEFAULT,NRe=navigator.language.toLowerCase(),M$t=NRe):console.error("Unable to resolve platform.");function Tes(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(Tes,"PlatformToString");var RXe=0;LRe?RXe=1:ORe?RXe=3:MRe&&(RXe=2);gr.isWindows=ORe;gr.isMacintosh=LRe;gr.isLinux=MRe;gr.isLinuxSnap=Awn;gr.isNative=ywn;gr.isElectron=_wn;gr.isWeb=O$t;gr.isWebWorker=O$t&&typeof kF.importScripts=="function";gr.webWorkerOrigin=gr.isWebWorker?kF.origin:void 0;gr.isIOS=L$t;gr.isMobile=vwn;gr.isCI=Ewn;gr.platform=RXe;gr.userAgent=RF;gr.language=wXe;var hwn;(function(t){function e(){return gr.language}a(e,"value"),t.value=e;function r(){return gr.language.length===2?gr.language==="en":gr.language.length>=3?gr.language[0]==="e"&&gr.language[1]==="n"&&gr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return gr.language==="en"}a(n,"isDefault"),t.isDefault=n})(hwn||(gr.Language=hwn={}));gr.locale=NRe;gr.platformLocale=M$t;gr.translationsConfigFile=Cwn;gr.setTimeout0IsFaster=typeof kF.postMessage=="function"&&!kF.importScripts;gr.setTimeout0=(()=>{if(gr.setTimeout0IsFaster){let t=[];kF.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),kF.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();gr.OS=LRe||L$t?2:ORe?1:3;var mwn=!0,gwn=!1;function Ies(){if(!gwn){gwn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,mwn=new Uint16Array(t.buffer)[0]===513}return mwn}a(Ies,"isLittleEndian");gr.isChrome=!!(gr.userAgent&&gr.userAgent.indexOf("Chrome")>=0);gr.isFirefox=!!(gr.userAgent&&gr.userAgent.indexOf("Firefox")>=0);gr.isSafari=!!(!gr.isChrome&&gr.userAgent&&gr.userAgent.indexOf("Safari")>=0);gr.isEdge=!!(gr.userAgent&&gr.userAgent.indexOf("Edg/")>=0);gr.isAndroid=!!(gr.userAgent&&gr.userAgent.indexOf("Android")>=0);function xes(t){return parseFloat(t)>=25}a(xes,"isTahoeOrNewer")});var BRe=I(_5=>{"use strict";p();Object.defineProperty(_5,"__esModule",{value:!0});_5.arch=_5.platform=_5.env=_5.cwd=void 0;var Swn=pj(),JJ,B$t=globalThis.vscode;if(typeof B$t<"u"&&typeof B$t.process<"u"){let t=B$t.process;JJ={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?JJ={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:JJ={get platform(){return Swn.isWindows?"win32":Swn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};_5.cwd=JJ.cwd;_5.env=JJ.env;_5.platform=JJ.platform;_5.arch=JJ.arch});var E5=I(kXe=>{"use strict";p();Object.defineProperty(kXe,"__esModule",{value:!0});kXe.StopWatch=void 0;var wes=globalThis.performance.now.bind(globalThis.performance),F$t=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:wes,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};kXe.StopWatch=F$t});var Fc=I(Xa=>{"use strict";p();Object.defineProperty(Xa,"__esModule",{value:!0});Xa.ValueWithChangeEvent=Xa.Relay=Xa.EventBufferer=Xa.DynamicListEventMultiplexer=Xa.EventMultiplexer=Xa.MicrotaskEmitter=Xa.DebounceEmitter=Xa.PauseableEmitter=Xa.AsyncEmitter=Xa.createEventDeliveryQueue=Xa.Emitter=Xa.ListenerRefusalError=Xa.ListenerLeakError=Xa.EventProfiling=Xa.Event=void 0;Xa.setGlobalLeakWarningThreshold=Oes;Xa.trackSetChanges=Ues;var Res=c$t(),FRe=Os(),kes=u$t(),gb=Po(),Rwn=yde(),Pes=BRe(),Des=E5(),Twn=!1,Nes=!1,Mes=100,Iwn=6e4;function xwn(){return!!Pes.env.VSCODE_DEV}a(xwn,"_isBufferLeakWarningEnabled");var PXe;(function(t){t.None=()=>gb.Disposable.None;function e(M){if(Nes){let{onDidAddListener:L}=M,U=vde.create(),j=0;M.onDidAddListener=()=>{++j===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),U.print()),L?.()}}}a(e,"_addLeakageTraceLogic");function r(M,L,U){return g(M,()=>{},0,void 0,L??!0,void 0,U)}a(r,"defer"),t.defer=r;function n(M){return(L,U=null,j)=>{let Q=!1,Y;return Y=M(W=>{if(!Q)return Y?Y.dispose():Q=!0,L.call(U,W)},null,j),Q&&Y.dispose(),Y}}a(n,"once"),t.once=n;function o(M,L){return t.once(t.filter(M,L))}a(o,"onceIf"),t.onceIf=o;function s(M,L,U){return h((j,Q=null,Y)=>M(W=>j.call(Q,L(W)),null,Y),U)}a(s,"map"),t.map=s;function c(M,L,U){return h((j,Q=null,Y)=>M(W=>{L(W),j.call(Q,W)},null,Y),U)}a(c,"forEach"),t.forEach=c;function l(M,L,U){return h((j,Q=null,Y)=>M(W=>L(W)&&j.call(Q,W),null,Y),U)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(L,U=null,j)=>{let Q=(0,gb.combinedDisposable)(...M.map(Y=>Y(W=>L.call(U,W))));return m(Q,j)}}a(d,"any"),t.any=d;function f(M,L,U,j){let Q=U;return s(M,Y=>(Q=L(Q,Y),Q),j)}a(f,"reduce"),t.reduce=f;function h(M,L){let U,j={onWillAddFirstListener(){U=M(Q.fire,Q)},onDidRemoveLastListener(){U?.dispose()}};L||e(j);let Q=new w_(j);return L?.add(Q),Q.event}a(h,"snapshot");function m(M,L){return L instanceof Array?L.push(M):L&&L.add(M),M}a(m,"addAndReturnDisposable");function g(M,L,U=100,j=!1,Q=!1,Y,W){let V,z,ie,H=0,re,le={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(me=>{H++,z=L(z,me),j&&!ie&&(Le.fire(z),z=void 0),re=a(()=>{let Oe=z;z=void 0,ie=void 0,(!j||H>1)&&Le.fire(Oe),H=0},"doFire"),typeof U=="number"?(ie&&clearTimeout(ie),ie=setTimeout(re,U)):ie===void 0&&(ie=null,queueMicrotask(re))})},onWillRemoveListener(){Q&&H>0&&re?.()},onDidRemoveLastListener(){re=void 0,V.dispose()}};W||e(le);let Le=new w_(le);return W?.add(Le),Le.event}a(g,"debounce"),t.debounce=g;function A(M,L=0,U,j){return t.debounce(M,(Q,Y)=>Q?(Q.push(Y),Q):[Y],L,void 0,U??!0,void 0,j)}a(A,"accumulate"),t.accumulate=A;function y(M,L,U=100,j=!0,Q=!0,Y,W){let V,z,ie,H=0,re={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(Le=>{H++,z=L(z,Le),ie===void 0&&(j&&(le.fire(z),z=void 0,H=0),typeof U=="number"?ie=setTimeout(()=>{Q&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0},U):(ie=0,queueMicrotask(()=>{Q&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0})))})},onDidRemoveLastListener(){V.dispose()}};W||e(re);let le=new w_(re);return W?.add(le),le.event}a(y,"throttle"),t.throttle=y;function _(M,L=(j,Q)=>j===Q,U){let j=!0,Q;return l(M,Y=>{let W=j||!L(Y,Q);return j=!1,Q=Y,W},U)}a(_,"latch"),t.latch=_;function E(M,L,U){return[t.filter(M,L,U),t.filter(M,j=>!L(j),U)]}a(E,"split"),t.split=E;function v(M,L,U=!1,j=[],Q){let Y=j.slice(),W;xwn()&&(W={stack:vde.create(),timerId:setTimeout(()=>{Y&&Y.length>0&&W&&!W.warned&&(W.warned=!0,console.warn(`[Event.buffer][${L}] potential LEAK detected: ${Y.length} events buffered for ${Iwn/1e3}s without being consumed. Buffered here:`),W.stack.print())},Iwn),warned:!1},Q&&Q.add((0,gb.toDisposable)(()=>clearTimeout(W.timerId))));let V=a(()=>{W&&clearTimeout(W.timerId)},"clearLeakWarningTimer"),z=M(re=>{Y?(Y.push(re),xwn()&&W&&!W.warned&&Y.length>=Mes&&(W.warned=!0,console.warn(`[Event.buffer][${L}] potential LEAK detected: ${Y.length} events buffered without being consumed. Buffered here:`),W.stack.print())):H.fire(re)});Q&&Q.add(z);let ie=a(()=>{Y?.forEach(re=>H.fire(re)),Y=null,V()},"flush"),H=new w_({onWillAddFirstListener(){z||(z=M(re=>H.fire(re)),Q&&Q.add(z))},onDidAddFirstListener(){Y&&(U?setTimeout(ie):ie())},onDidRemoveLastListener(){z&&z.dispose(),z=null,V()}});return Q&&Q.add(H),H.event}a(v,"buffer"),t.buffer=v;function S(M,L){return a((j,Q,Y)=>{let W=L(new w);return M(function(V){let z=W.evaluate(V);z!==T&&j.call(Q,z)},void 0,Y)},"fn")}a(S,"chain"),t.chain=S;let T=Symbol("HaltChainable");class w{static{a(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(L){return this.steps.push(L),this}forEach(L){return this.steps.push(U=>(L(U),U)),this}filter(L){return this.steps.push(U=>L(U)?U:T),this}reduce(L,U){let j=U;return this.steps.push(Q=>(j=L(j,Q),j)),this}latch(L=(U,j)=>U===j){let U=!0,j;return this.steps.push(Q=>{let Y=U||!L(Q,j);return U=!1,j=Q,Y?Q:T}),this}evaluate(L){for(let U of this.steps)if(L=U(L),L===T)break;return L}}function R(M,L,U=j=>j){let j=a((...V)=>W.fire(U(...V)),"fn"),Q=a(()=>M.on(L,j),"onFirstListenerAdd"),Y=a(()=>M.removeListener(L,j),"onLastListenerRemove"),W=new w_({onWillAddFirstListener:Q,onDidRemoveLastListener:Y});return W.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,L,U=j=>j){let j=a((...V)=>W.fire(U(...V)),"fn"),Q=a(()=>M.addEventListener(L,j),"onFirstListenerAdd"),Y=a(()=>M.removeEventListener(L,j),"onLastListenerRemove"),W=new w_({onWillAddFirstListener:Q,onDidRemoveLastListener:Y});return W.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function k(M,L){let U,j,Q=new Promise(Y=>{j=n(M)(Y),z$t(j,L),U=a(()=>{wwn(j,L)},"cancelRef")});return Q.cancel=U,L&&Q.finally(()=>wwn(j,L)),Q}a(k,"toPromise"),t.toPromise=k;function D(M,L){return M(U=>L.fire(U))}a(D,"forward"),t.forward=D;function N(M,L,U){return L(U),M(j=>L(j))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class O{static{a(this,"EmitterObserver")}constructor(L,U){this._observable=L,this._counter=0,this._hasChanged=!1;let j={onWillAddFirstListener:a(()=>{L.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{L.removeObserver(this)},"onDidRemoveLastListener")};U||e(j),this.emitter=new w_(j),U&&U.add(this.emitter)}beginUpdate(L){this._counter++}handlePossibleChange(L){}handleChange(L,U){this._hasChanged=!0}endUpdate(L){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(M,L){return new O(M,L).emitter.event}a(B,"fromObservable"),t.fromObservable=B;function q(M){return(L,U,j)=>{let Q=0,Y=!1,W={beginUpdate(){Q++},endUpdate(){Q--,Q===0&&(M.reportChanges(),Y&&(Y=!1,L.call(U)))},handlePossibleChange(){},handleChange(){Y=!0}};M.addObserver(W),M.reportChanges();let V={dispose(){M.removeObserver(W)}};return z$t(V,j),V}}a(q,"fromObservableLight"),t.fromObservableLight=q})(PXe||(Xa.Event=PXe={}));var DXe=class t{static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${t._idPool++}`,t.all.add(this)}start(e){this._stopWatch=new Des.StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};Xa.EventProfiling=DXe;var URe=-1;function Oes(t){let e=URe;return URe=t,{dispose(){URe=e}}}a(Oes,"setGlobalLeakWarningThreshold");var U$t=class t{static{a(this,"LeakageMonitor")}static{this._idPool=1}constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r.3?"dominated":"popular",f=new QRe(d,u,s,r,l);this._errorHandler(f)}return()=>{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||r{if(t instanceof _de)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new F$t(e?.onListenerError??FRe.onUnexpectedError,this._options?.leakWarningThreshold??URe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new DXe(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Swn){let e=this._listeners;queueMicrotask(()=>{Rwn(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=d[1]/this._size>.3?"dominated":"popular",h=new NXe(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||FRe.onUnexpectedError)(h),gb.Disposable.None}if(this._disposed)return gb.Disposable.None;r&&(e=e.bind(r));let o=new _de(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Ede.create(),s=this._leakageMon.check(o.stack,this._size+1)),Swn&&(o.stack=c??Ede.create()),this._listeners?this._listeners instanceof _de?(this._deliveryQueue??=new MXe,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=(0,gb.toDisposable)(()=>{s?.(),this._removeListener(o)});return W$t(l,n),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,n=r.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*Oes<=r.length){let s=0;for(let c=0;c0}};Xa.Emitter=w_;var Les=a(()=>new MXe,"createEventDeliveryQueue");Xa.createEventDeliveryQueue=Les;var MXe=class{static{a(this,"EventDeliveryQueuePrivate")}constructor(){this.i=-1,this.end=0}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},U$t=class extends w_{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new wwn.LinkedList),Rwn(this._listeners,o=>this._asyncDeliveryQueue.push([o.value,e]));this._asyncDeliveryQueue.size>0&&!r.isCancellationRequested;){let[o,s]=this._asyncDeliveryQueue.shift(),c=[],l={...s,token:r,waitUntil:a(u=>{if(Object.isFrozen(c))throw new Error("waitUntil can NOT be called asynchronous");n&&(u=n(u,o)),c.push(u)},"waitUntil")};try{o(l)}catch(u){(0,FRe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,FRe.onUnexpectedError)(d.reason)})}}};Xa.AsyncEmitter=U$t;var OXe=class extends w_{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new wwn.LinkedList,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}};Xa.PauseableEmitter=OXe;var Q$t=class extends OXe{static{a(this,"DebounceEmitter")}constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}};Xa.DebounceEmitter=Q$t;var q$t=class extends w_{static{a(this,"MicrotaskEmitter")}constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(r=>super.fire(r)),this._queuedEvents=[]}))}};Xa.MicrotaskEmitter=q$t;var LXe=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new w_({onWillAddFirstListener:a(()=>this.onFirstListenerAdd(),"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>this.onLastListenerRemove(),"onDidRemoveLastListener")})}get event(){return this.emitter.event}add(e){let r={event:e,listener:null};this.events.push(r),this.hasListeners&&this.hook(r);let n=a(()=>{this.hasListeners&&this.unhook(r);let o=this.events.indexOf(r);this.events.splice(o,1)},"dispose");return(0,gb.toDisposable)((0,wes.createSingleCallFunction)(n))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(r=>this.emitter.fire(r))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(let e of this.events)e.listener?.dispose();this.events=[]}};Xa.EventMultiplexer=LXe;var j$t=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new gb.DisposableStore;let s=this._store.add(new LXe),c=this._store.add(new gb.DisposableMap);function l(u){c.set(u,s.add(o(u)))}a(l,"addItem");for(let u of e)l(u);this._store.add(r(u=>{l(u)})),this._store.add(n(u=>{c.deleteAndDispose(u)})),this.event=s.event}dispose(){this._store.dispose()}};Xa.DynamicListEventMultiplexer=j$t;var H$t=class{static{a(this,"EventBufferer")}constructor(){this.data=[]}wrapEvent(e,r,n){return(o,s,c)=>e(l=>{let u=this.data[this.data.length-1];if(!r){u?u.buffers.push(()=>o.call(s,l)):o.call(s,l);return}let d=u;if(!d){o.call(s,r(n,l));return}d.items??=[],d.items.push(l),d.buffers.length===0&&u.buffers.push(()=>{d.reducedResult??=n?d.items.reduce(r,n):d.items.reduce(r),o.call(s,d.reducedResult)})},void 0,c)}bufferEvents(e){let r={buffers:new Array};this.data.push(r);let n=e();return this.data.pop(),r.buffers.forEach(o=>o()),n}};Xa.EventBufferer=H$t;var G$t=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=PXe.None,this.inputEventListener=gb.Disposable.None,this.emitter=new w_({onDidAddFirstListener:a(()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},"onDidAddFirstListener"),onDidRemoveLastListener:a(()=>{this.listening=!1,this.inputEventListener.dispose()},"onDidRemoveLastListener")}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}};Xa.Relay=G$t;var $$t=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new V$t(e)}constructor(e){this._value=e,this._onDidChange=new w_,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};Xa.ValueWithChangeEvent=$$t;var V$t=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=PXe.None}};function Bes(t,e,r){let n=new gb.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new gb.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,xes.diffSets)(o,c);for(let u of l.removed)n.deleteAndDispose(u);for(let u of l.added)n.set(u,r(u));o=new Set(c)})),s.add(n),s}a(Bes,"trackSetChanges");function W$t(t,e){e instanceof gb.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(W$t,"addToDisposables");function xwn(t,e){if(e instanceof gb.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a(xwn,"disposeAndRemove")});var S2=I(PF=>{"use strict";p();Object.defineProperty(PF,"__esModule",{value:!0});PF.CancellationTokenPool=PF.CancellationTokenSource=PF.CancellationToken=void 0;PF.cancelOnDispose=Ues;var kwn=Fc(),Fes=Po(),Pwn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),BXe;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof vde?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}a(e,"isCancellationToken"),t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:kwn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Pwn})})(BXe||(PF.CancellationToken=BXe={}));var vde=class{static{a(this,"MutableToken")}constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Pwn:(this._emitter||(this._emitter=new kwn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},qRe=class{static{a(this,"CancellationTokenSource")}constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new vde),this._token}cancel(){this._token?this._token instanceof vde&&this._token.cancel():this._token=BXe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof vde&&this._token.dispose():this._token=BXe.None}};PF.CancellationTokenSource=qRe;function Ues(t){let e=new qRe;return t.add({dispose(){e.cancel()}}),e.token}a(Ues,"cancelOnDispose");var z$t=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new qRe,this._listeners=new Fes.DisposableStore,this._total=0,this._cancelled=0,this._isDone=!1}get token(){return this._source.token}add(e){if(this._isDone)return;if(this._total++,e.isCancellationRequested){this._cancelled++,this._check();return}let r=e.onCancellationRequested(()=>{r.dispose(),this._cancelled++,this._check()});this._listeners.add(r)}_check(){!this._isDone&&this._total>0&&this._total===this._cancelled&&(this._isDone=!0,this._listeners.dispose(),this._source.cancel())}dispose(){this._listeners.dispose(),this._source.dispose()}};PF.CancellationTokenPool=z$t});var $A=I(en=>{"use strict";p();var Qes=en&&en.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qes=en&&en.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jes=en&&en.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=Hes&&t<=$es||t>=Ges&&t<=Ves}a(NF,"isWindowsDeviceRoot");function UXe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===JJ&&l!==-1?++l:l=-1}return o}a(UXe,"normalizeString");function Yes(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(Yes,"formatExt");function Dwn(t,e){zes(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${Yes(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(Dwn,"_format");en.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],Ap(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=Cde.cwd():(s=Cde.env[`=${e}`]||Cde.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===Ab)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)ts(f)&&(l=1,d=!0);else if(ts(f))if(d=!0,ts(s.charCodeAt(1))){let h=2,m=h;for(;h2&&ts(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=UXe(r,!n,"\\",ts),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Ap(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return Y$t(s)?"\\":t;if(ts(s))if(o=!0,ts(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ts(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&ts(t.charCodeAt(e-1))&&(c+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&NF(c.charCodeAt(0))&&c.charCodeAt(1)===DF)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||ts(t.charCodeAt(l+1)))return`.\\${c}`;while((l=t.indexOf(":",l+1))!==-1)}return n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){Ap(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return ts(r)||e>2&&NF(r)&&t.charCodeAt(1)===DF&&ts(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&ts(r.charCodeAt(0))){++o;let s=r.length;s>1&&ts(r.charCodeAt(1))&&(++o,s>2&&(ts(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return en.win32.normalize(e)},relative(t,e){if(Ap(t,"from"),Ap(e,"to"),t===e)return"";let r=en.win32.resolve(t),n=en.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";if(r.length!==t.length||n.length!==e.length){let A=r.split("\\"),y=n.split("\\");A[A.length-1]===""&&A.pop(),y[y.length-1]===""&&y.pop();let _=A.length,E=y.length,v=_v?y.slice(S).join("\\"):_>v?"..\\".repeat(_-1-S)+"..":"":"..\\".repeat(_-S)+y.slice(S).join("\\")}let o=0;for(;oo&&t.charCodeAt(s-1)===Ab;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===Ab;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===Ab)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===Ab?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===Ab)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===Ab&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=en.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===Ab){if(e.charCodeAt(1)===Ab){let r=e.charCodeAt(2);if(r!==Wes&&r!==JJ)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(NF(e.charCodeAt(0))&&e.charCodeAt(1)===DF&&e.charCodeAt(2)===Ab)return`\\\\?\\${e}`;return e},dirname(t){Ap(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return ts(o)?t:".";if(ts(o)){if(r=n=1,ts(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ts(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(ts(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&Ap(e,"suffix"),Ap(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&NF(t.charCodeAt(0))&&t.charCodeAt(1)===DF&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(ts(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(ts(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Ap(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===DF&&NF(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(ts(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===JJ?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:Dwn.bind(null,"\\"),parse(t){Ap(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return ts(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(ts(o)){if(n=1,ts(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),ts(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===JJ?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var Kes=(()=>{if(yb){let t=/\\/g;return()=>{let e=Cde.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Cde.cwd()})();en.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];Ap(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===R0)}if(!r){let n=Kes();e=`${n}/${e}`,r=n.charCodeAt(0)===R0}return e=UXe(e,!r,"/",Y$t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Ap(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===R0,r=t.charCodeAt(t.length-1)===R0;return t=UXe(t,!e,"/",Y$t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Ap(t,"path"),t.length>0&&t.charCodeAt(0)===R0},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":en.posix.normalize(e.join("/"))},relative(t,e){if(Ap(t,"from"),Ap(e,"to"),t===e||(t=en.posix.resolve(t),e=en.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===R0)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===R0?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===R0)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Ap(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===R0,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===R0){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&Ap(e,"suffix"),Ap(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===R0){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===R0){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Ap(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t[c];if(l==="/"){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l==="."?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:Dwn.bind(null,"/"),parse(t){Ap(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===R0,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===R0){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===JJ?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};en.posix.win32=en.win32.win32=en.win32;en.posix.posix=en.win32.posix=en.posix;en.normalize=yb?en.win32.normalize:en.posix.normalize;en.isAbsolute=yb?en.win32.isAbsolute:en.posix.isAbsolute;en.join=yb?en.win32.join:en.posix.join;en.resolve=yb?en.win32.resolve:en.posix.resolve;en.relative=yb?en.win32.relative:en.posix.relative;en.dirname=yb?en.win32.dirname:en.posix.dirname;en.basename=yb?en.win32.basename:en.posix.basename;en.extname=yb?en.win32.extname:en.posix.extname;en.format=yb?en.win32.format:en.posix.format;en.parse=yb?en.win32.parse:en.posix.parse;en.toNamespacedPath=yb?en.win32.toNamespacedPath:en.posix.toNamespacedPath;en.sep=yb?en.win32.sep:en.posix.sep;en.delimiter=yb?en.win32.delimiter:en.posix.delimiter});var qXe=I(T2=>{"use strict";p();Object.defineProperty(T2,"__esModule",{value:!0});T2.WeakCachedFunction=T2.CachedFunction=T2.LRUCachedFunction=T2.Cache=void 0;T2.identity=QXe;var Jes=S2(),K$t=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new Jes.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};T2.Cache=K$t;function QXe(t){return t}a(QXe,"identity");var J$t=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=QXe):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};T2.LRUCachedFunction=J$t;var Z$t=class{static{a(this,"CachedFunction")}get cachedValues(){return this._map}constructor(e,r){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=QXe):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);if(this._map2.has(r))return this._map2.get(r);let n=this._fn(e);return this._map.set(e,n),this._map2.set(r,n),n}};T2.CachedFunction=Z$t;var X$t=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=QXe):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);if(this._map.has(r))return this._map.get(r);let n=this._fn(e);return this._map.set(r,n),n}};T2.WeakCachedFunction=X$t});var MF=I(jXe=>{"use strict";p();Object.defineProperty(jXe,"__esModule",{value:!0});jXe.Lazy=void 0;var hj;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(hj||(hj={}));var eVt=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=hj.Uninitialized}get hasValue(){return this._state===hj.Completed}get value(){if(this._state===hj.Uninitialized){this._state=hj.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=hj.Completed}}else if(this._state===hj.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};jXe.Lazy=eVt});var ym=I(Nr=>{"use strict";p();Object.defineProperty(Nr,"__esModule",{value:!0});Nr.Ellipsis=Nr.InvisibleCharacters=Nr.AmbiguousCharacters=Nr.noBreakWhitespace=Nr.UTF8_BOM_CHARACTER=Nr.UNUSUAL_LINE_TERMINATORS=Nr.GraphemeIterator=Nr.CodePointIterator=void 0;Nr.isFalsyOrWhitespace=Xes;Nr.format=tts;Nr.format2=nts;Nr.htmlAttributeEncodeValue=its;Nr.escape=ots;Nr.escapeRegExpCharacters=Own;Nr.count=sts;Nr.truncate=ats;Nr.truncateMiddle=cts;Nr.trim=lts;Nr.ltrim=Lwn;Nr.rtrim=Bwn;Nr.convertSimple2RegExpPattern=uts;Nr.createRegExp=dts;Nr.regExpLeadsToEndlessLoop=fts;Nr.joinStrings=pts;Nr.splitLines=hts;Nr.splitLinesIncludeSeparators=mts;Nr.indexOfPattern=gts;Nr.firstNonWhitespaceIndex=Fwn;Nr.getLeadingWhitespace=Ats;Nr.lastNonWhitespaceIndex=yts;Nr.getIndentationLength=_ts;Nr.replaceAsync=Ets;Nr.compare=vts;Nr.compareSubstring=Uwn;Nr.compareIgnoreCase=Cts;Nr.compareSubstringIgnoreCase=HRe;Nr.isAsciiDigit=bts;Nr.isLowerAsciiLetter=rVt;Nr.isUpperAsciiLetter=Sts;Nr.equalsIgnoreCase=Qwn;Nr.equals=Tts;Nr.startsWithIgnoreCase=Its;Nr.endsWithIgnoreCase=xts;Nr.commonPrefixLength=wts;Nr.commonSuffixLength=Rts;Nr.isHighSurrogate=oVt;Nr.isLowSurrogate=HXe;Nr.computeCodePoint=sVt;Nr.getNextCodePoint=qwn;Nr.nextCharLength=jwn;Nr.prevCharLength=Hwn;Nr.getCharContainingOffset=Pts;Nr.charCount=Dts;Nr.containsRTL=Mts;Nr.isBasicASCII=Lts;Nr.containsUnusualLineTerminators=Bts;Nr.isFullWidthCharacter=Fts;Nr.isEmojiImprecise=Gwn;Nr.lcut=Uts;Nr.rcut=Qts;Nr.forAnsiStringParts=Gts;Nr.removeAnsiEscapeCodes=Vwn;Nr.removeAnsiEscapeCodesFromPrompt=Vts;Nr.startsWithUTF8BOM=Wwn;Nr.stripUTF8BOM=Wts;Nr.fuzzyContains=zts;Nr.containsUppercaseCharacter=Yts;Nr.uppercaseFirstLetter=Kts;Nr.getNLines=Jts;Nr.singleLetterHash=Zts;Nr.getGraphemeBreakType=Xts;Nr.getLeftDeleteOffset=trs;Nr.multibyteAwareBtoa=ors;var Zes=qXe(),Nwn=MF();function Xes(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(Xes,"isFalsyOrWhitespace");var ets=/{(\d+)}/g;function tts(t,...e){return e.length===0?t:t.replace(ets,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(tts,"format");var rts=/{([^}]+)}/g;function nts(t,e){return Object.keys(e).length===0?t:t.replace(rts,(r,n)=>e[n]??r)}a(nts,"format2");function its(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(its,"htmlAttributeEncodeValue");function ots(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(ots,"escape");function Own(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(Own,"escapeRegExpCharacters");function sts(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a(sts,"count");function ats(t,e,r=Nr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a(ats,"truncate");function cts(t,e,r=Nr.Ellipsis){if(t.length<=e)return t;let n=Math.ceil(e/2)-r.length/2,o=Math.floor(e/2)-r.length/2;return`${t.substr(0,n)}${r}${t.substr(t.length-o)}`}a(cts,"truncateMiddle");function lts(t,e=" "){let r=Lwn(t,e);return Bwn(r,e)}a(lts,"trim");function Lwn(t,e){if(!t||!e)return t;let r=e.length,n=0;if(r===1){let o=e.charCodeAt(0);for(;n0&&t.charCodeAt(s-1)===c;)s--;return t.substring(0,s)}let o=n;for(;o>0&&t.endsWith(e,o);)o-=r;return t.substring(0,o)}a(Bwn,"rtrim");function uts(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(uts,"convertSimple2RegExpPattern");function dts(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=Own(t)),r.wholeWord&&(/\B/.test(t.charAt(0))||(t="\\b"+t),/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"));let n="";return r.global&&(n+="g"),r.matchCase||(n+="i"),r.multiline&&(n+="m"),r.unicode&&(n+="u"),new RegExp(t,n)}a(dts,"createRegExp");function fts(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(fts,"regExpLeadsToEndlessLoop");function pts(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(pts,"joinStrings");function hts(t){return t.split(/\r\n|\r|\n/)}a(hts,"splitLines");function mts(t){let e=[],r=t.split(/(\r\n|\r|\n)/);for(let n=0;n=0;r--){let n=t.charCodeAt(r);if(n!==32&&n!==9)return r}return-1}a(yts,"lastNonWhitespaceIndex");function _ts(t){let e=Fwn(t);return e===-1?t.length:e}a(_ts,"getIndentationLength");function Ets(t,e,r){let n=[],o=0;for(let s of t.matchAll(e)){if(n.push(t.slice(o,s.index)),s.index===void 0)throw new Error("match.index should be defined");o=s.index+s[0].length,n.push(r(s[0],...s.slice(1),s.index,t,s.groups))}return n.push(t.slice(o)),Promise.all(n).then(s=>s.join(""))}a(Ets,"replaceAsync");function vts(t,e){return te?1:0}a(vts,"compare");function Uwn(t,e,r=0,n=t.length,o=0,s=e.length){for(;rd)return 1}let c=n-r,l=s-o;return cl?1:0}a(Uwn,"compareSubstring");function Cts(t,e){return HRe(t,e,0,t.length,0,e.length)}a(Cts,"compareIgnoreCase");function HRe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return Uwn(t.toLowerCase(),e.toLowerCase(),r,n,o,s);rVt(u)&&(u-=32),rVt(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(HRe,"compareSubstringIgnoreCase");function bts(t){return t>=48&&t<=57}a(bts,"isAsciiDigit");function rVt(t){return t>=97&&t<=122}a(rVt,"isLowerAsciiLetter");function Sts(t){return t>=65&&t<=90}a(Sts,"isUpperAsciiLetter");function Qwn(t,e){return t.length===e.length&&HRe(t,e)===0}a(Qwn,"equalsIgnoreCase");function Tts(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&Qwn(t,e)}a(Tts,"equals");function Its(t,e){let r=e.length;return r<=t.length&&HRe(t,e,0,r)===0}a(Its,"startsWithIgnoreCase");function xts(t,e){let r=t.length,n=r-e.length;return n>=0&&HRe(t,e,n,r)===0}a(xts,"endsWithIgnoreCase");function wts(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(oVt(n))return sVt(n,r)}return r}a(kts,"getPrevCodePoint");var bde=class{static{a(this,"CodePointIterator")}get offset(){return this._offset}constructor(e,r=0){this._str=e,this._len=e.length,this._offset=r}setOffset(e){this._offset=e}prevCodePoint(){let e=kts(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=qwn(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};Nr.CodePointIterator=bde;var Sde=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new bde(e,r)}nextGraphemeLength(){let e=jRe.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.nextCodePoint());for(;!r.eol();){let s=r.offset,c=e.getGraphemeBreakType(r.nextCodePoint());if(Mwn(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=jRe.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.prevCodePoint());for(;r.offset>0;){let s=r.offset,c=e.getGraphemeBreakType(r.prevCodePoint());if(Mwn(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};Nr.GraphemeIterator=Sde;function jwn(t,e){return new Sde(t,e).nextGraphemeLength()}a(jwn,"nextCharLength");function Hwn(t,e){return new Sde(t,e).prevGraphemeLength()}a(Hwn,"prevCharLength");function Pts(t,e){e>0&&HXe(t.charCodeAt(e))&&e--;let r=e+jwn(t,e);return[r-Hwn(t,r),r]}a(Pts,"getCharContainingOffset");function Dts(t){let e=new Sde(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(Dts,"charCount");var tVt;function Nts(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}a(Nts,"makeContainsRtl");function Mts(t){return tVt||(tVt=Nts()),tVt.test(t)}a(Mts,"containsRTL");var Ots=/^[\t\n\r\x20-\x7E]*$/;function Lts(t){return Ots.test(t)}a(Lts,"isBasicASCII");Nr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function Bts(t){return Nr.UNUSUAL_LINE_TERMINATORS.test(t)}a(Bts,"containsUnusualLineTerminators");function Fts(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(Fts,"isFullWidthCharacter");function Gwn(t){return t>=127462&&t<=127487||t===8986||t===8987||t===9200||t===9203||t>=9728&&t<=10175||t===11088||t===11093||t>=127744&&t<=128591||t>=128640&&t<=128764||t>=128992&&t<=129008||t>=129280&&t<=129535||t>=129648&&t<=129782}a(Gwn,"isEmojiImprecise");function Uts(t,e,r=""){let n=t.trimStart();if(n.lengthe){c=!0;break}s=o.lastIndex,o.lastIndex+=1}if(!c)return n;if(s===0)return r;let l=n.substring(0,s).trimEnd();return l.length!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,jts=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,Hts=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,$wn=new RegExp("(?:"+[qts.source,jts.source,Hts.source].join("|")+")","g");function*Gts(t){let e=0;for(let r of t.matchAll($wn))e!==r.index&&(yield{isCode:!1,str:t.substring(e,r.index)}),yield{isCode:!0,str:r[0]},e=r.index+r[0].length;e!==t.length&&(yield{isCode:!1,str:t.substring(e)})}a(Gts,"forAnsiStringParts");function Vwn(t){return t&&(t=t.replace($wn,"")),t}a(Vwn,"removeAnsiEscapeCodes");var $ts=/\\\[.*?\\\]/g;function Vts(t){return Vwn(t).replace($ts,"")}a(Vts,"removeAnsiEscapeCodesFromPrompt");Nr.UTF8_BOM_CHARACTER="\uFEFF";function Wwn(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(Wwn,"startsWithUTF8BOM");function Wts(t){return Wwn(t)?t.substr(1):t}a(Wts,"stripUTF8BOM");function zts(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a(Jts,"getNLines");function Zts(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(Zts,"singleLetterHash");function Xts(t){return jRe.getInstance().getGraphemeBreakType(t)}a(Xts,"getGraphemeBreakType");function Mwn(t,e){return t===0?e!==5&&e!==7:t===2&&e===3?!1:t===4||t===2||t===3||e===4||e===2||e===3?!0:!(t===8&&(e===8||e===9||e===11||e===12)||(t===11||t===9)&&(e===9||e===10)||(t===12||t===10)&&e===10||e===5||e===13||e===7||t===1||t===13&&e===14||t===6&&e===6)}a(Mwn,"breakBetweenGraphemeBreakType");var jRe=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=ers()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(er[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function ers(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(ers,"getGraphemeBreakRawData");function trs(t,e){if(t===0)return 0;let r=rrs(t,e);if(r!==void 0)return r;let n=new bde(e,t);return n.prevCodePoint(),n.offset}a(trs,"getLeftDeleteOffset");function rrs(t,e){let r=new bde(e,t),n=r.prevCodePoint();for(;nrs(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!Gwn(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(rrs,"getOffsetBeforeLastEmojiComponent");function nrs(t){return 127995<=t&&t<=127999}a(nrs,"isEmojiModifier");Nr.noBreakWhitespace="\xA0";var nVt=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new Nwn.Lazy(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new Zes.LRUCachedFunction(e=>{let r=e.split(",");function n(h){let m=new Map;for(let g=0;g!h.startsWith("_")&&Object.hasOwn(c,h));l.length===0&&(l=["_default"]);let u;for(let h of l){let m=n(c[h]);u=s(u,m)}let d=n(c._common),f=o(d,u);return new t(f)})}static getInstance(e){return t.cache.get(Array.from(e).join(","))}static{this._locales=new Nwn.Lazy(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;r{"use strict";p();Object.defineProperty(bg,"__esModule",{value:!0});bg.isPathSeparator=OF;bg.toSlashes=zwn;bg.toPosixPath=ars;bg.getRoot=crs;bg.isUNC=lrs;bg.isValidBasename=prs;bg.isEqual=hrs;bg.isEqualOrParent=mrs;bg.isWindowsDriveLetter=aVt;bg.sanitizeFilePath=grs;bg.removeTrailingPathSeparator=Ywn;bg.isRootOrDriveLetter=Ars;bg.hasDriveLetter=cVt;bg.getDriveLetter=yrs;bg.indexOfPath=_rs;bg.parseLineAndColumnAware=Ers;bg.randomPath=brs;var Cg=$A(),mj=pj(),GXe=ym(),srs=CT();function OF(t){return t===47||t===92}a(OF,"isPathSeparator");function zwn(t){return t.replace(/[\\/]/g,Cg.posix.sep)}a(zwn,"toSlashes");function ars(t){return t.indexOf("/")===-1&&(t=zwn(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a(ars,"toPosixPath");function crs(t,e=Cg.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(OF(n)){if(OF(t.charCodeAt(1))&&!OF(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,drs=/[/]/g,frs=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function prs(t,e=mj.isWindows){let r=e?urs:drs;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&frs.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(prs,"isValidBasename");function hrs(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,GXe.equalsIgnoreCase)(t,e)}a(hrs,"isEqual");function mrs(t,e,r,n=!1){let o=n?Cg.posix.sep:Cg.sep;if(t===e)return!0;if(!t||!e||((t.indexOf("..")>=0||e.indexOf("..")>=0)&&(t=n?Cg.posix.normalize(t):(0,Cg.normalize)(t),e=n?Cg.posix.normalize(e):(0,Cg.normalize)(e)),e.length>t.length))return!1;if(r){if(!(0,GXe.startsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;let c=e.length;return e.charAt(e.length-1)===o&&c--,t.charAt(c)===o}return e.charAt(e.length-1)!==o&&(e+=o),t.indexOf(e)===0}a(mrs,"isEqualOrParent");function aVt(t){return t>=65&&t<=90||t>=97&&t<=122}a(aVt,"isWindowsDriveLetter");function grs(t,e){return mj.isWindows&&t.endsWith(":")&&(t+=Cg.sep),(0,Cg.isAbsolute)(t)||(t=(0,Cg.join)(e,t)),t=(0,Cg.normalize)(t),Ywn(t)}a(grs,"sanitizeFilePath");function Ywn(t){return mj.isWindows?(t=(0,GXe.rtrim)(t,Cg.sep),t.endsWith(":")&&(t+=Cg.sep)):(t=(0,GXe.rtrim)(t,Cg.sep),t||(t=Cg.sep)),t}a(Ywn,"removeTrailingPathSeparator");function Ars(t){let e=(0,Cg.normalize)(t);return mj.isWindows?t.length>3?!1:cVt(e)&&(t.length===2||e.charCodeAt(2)===92):e===Cg.posix.sep}a(Ars,"isRootOrDriveLetter");function cVt(t,e=mj.isWindows){return e?aVt(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(cVt,"hasDriveLetter");function yrs(t,e=mj.isWindows){return cVt(t,e)?t[0]:void 0}a(yrs,"getDriveLetter");function _rs(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(_rs,"indexOfPath");function Ers(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,srs.isNumber)(c)?n===void 0?n=c:o===void 0&&(o=c):r=r?[r,s].join(":"):s}if(!r)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:r,line:n!==void 0?n:void 0,column:o!==void 0?o:n!==void 0?1:void 0}}a(Ers,"parseLineAndColumnAware");var vrs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Crs="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function brs(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var Srs=Pw&&Pw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Trs=Pw&&Pw.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Irs=Pw&&Pw.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0?` Found '${r[0][0]}' at index ${r[0].index} (${r.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${n} (len:${t.scheme.length})`)}if(t.path){if(t.authority){if(!wrs.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Rrs.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(krs,"_validateUri");function Prs(t,e){return!t&&!e?"file":t}a(Prs,"_schemeFix");function Drs(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==I2&&(e=I2+e):e=I2;break}return e}a(Drs,"_referenceResolution");var ru="",I2="/",Nrs=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,WXe=class t{static{a(this,"URI")}static isUri(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,r,n,o,s,c=!1){typeof e=="object"?(this.scheme=e.scheme||ru,this.authority=e.authority||ru,this.path=e.path||ru,this.query=e.query||ru,this.fragment=e.fragment||ru):(this.scheme=Prs(e,c),this.authority=r||ru,this.path=Drs(this.scheme,n||ru),this.query=o||ru,this.fragment=s||ru,krs(this,c))}get fsPath(){return zXe(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=ru),n===void 0?n=this.authority:n===null&&(n=ru),o===void 0?o=this.path:o===null&&(o=ru),s===void 0?s=this.query:s===null&&(s=ru),c===void 0?c=this.fragment:c===null&&(c=ru),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new gj(r,n,o,s,c)}static parse(e,r=!1){let n=Nrs.exec(e);return n?new gj(n[2]||ru,$Xe(n[4]||ru),$Xe(n[5]||ru),$Xe(n[7]||ru),$Xe(n[9]||ru),r):new gj(ru,ru,ru,ru,ru)}static file(e){let r=ru;if(VXe.isWindows&&(e=e.replace(/\\/g,I2)),e[0]===I2&&e[1]===I2){let n=e.indexOf(I2,2);n===-1?(r=e.substring(2),e=I2):(r=e.substring(2,n),e=e.substring(n)||I2)}return new gj("file",r,e,ru,ru)}static from(e,r){return new gj(e.scheme,e.authority,e.path,e.query,e.fragment,r)}static joinPath(e,...r){if(!e.path)throw new Error(`[UriError]: cannot call joinPath on URI without path: ${e.toString()}`);let n;return VXe.isWindows&&e.scheme==="file"?n=t.file(Kwn.win32.join(zXe(e,!0),...r)).path:n=Kwn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return uVt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new gj(e);return r._formatted=e.external??null,r._fsPath=e._sep===Xwn?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};Pw.URI=WXe;function Mrs(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}a(Mrs,"isUriComponents");var Xwn=VXe.isWindows?1:void 0,gj=class extends WXe{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=zXe(this,!1)),this._fsPath}toString(e=!1){return e?uVt(this,!0):(this._formatted||(this._formatted=uVt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=Xwn),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},eRn={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function Jwn(t,e,r){let n,o=-1;for(let s=0;s=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||e&&c===47||r&&c===91||r&&c===93||r&&c===58)o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n!==void 0&&(n+=t.charAt(s));else{n===void 0&&(n=t.substr(0,s));let l=eRn[c];l!==void 0?(o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n+=l):o===-1&&(o=s)}}return o!==-1&&(n+=encodeURIComponent(t.substring(o))),n!==void 0?n:t}a(Jwn,"encodeURIComponentFast");function Ors(t){let e;for(let r=0;r1&&t.scheme==="file"?r=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?r=t.path.substr(1):r=t.path[1].toLowerCase()+t.path.substr(2):r=t.path,VXe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(zXe,"uriToFsPath");function uVt(t,e){let r=e?Ors:Jwn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=I2,n+=I2),s){let d=s.indexOf("@");if(d!==-1){let f=s.substr(0,d);s=s.substr(d+1),d=f.lastIndexOf(":"),d===-1?n+=r(f,!1,!1):(n+=r(f.substr(0,d),!1,!1),n+=":",n+=r(f.substr(d+1),!1,!0)),n+="@"}s=s.toLowerCase(),d=s.lastIndexOf(":"),d===-1?n+=r(s,!1,!0):(n+=r(s.substr(0,d),!1,!0),n+=s.substr(d))}if(c){if(c.length>=3&&c.charCodeAt(0)===47&&c.charCodeAt(2)===58){let d=c.charCodeAt(1);d>=65&&d<=90&&(c=`/${String.fromCharCode(d+32)}:${c.substr(3)}`)}else if(c.length>=2&&c.charCodeAt(1)===58){let d=c.charCodeAt(0);d>=65&&d<=90&&(c=`${String.fromCharCode(d+32)}:${c.substr(2)}`)}n+=r(c,!0,!1)}return l&&(n+="?",n+=r(l,!1,!1)),u&&(n+="#",n+=e?u:Jwn(u,!1,!1)),n}a(uVt,"_asFormatted");function tRn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+tRn(t.substr(3)):t}}a(tRn,"decodeURIComponentGraceful");var Zwn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function $Xe(t){return t.match(Zwn)?t.replace(Zwn,e=>tRn(e)):t}a($Xe,"percentDecode")});var XJ=I(Es=>{"use strict";p();var Lrs=Es&&Es.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Brs=Es&&Es.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mVt=Es&&Es.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oiRn(t,r))}a(Urs,"matchesSomeScheme");Es.connectionTokenCookieName="vscode-tkn";Es.connectionTokenQueryName="tkn";var pVt=class{static{a(this,"RemoteAuthoritiesImpl")}constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,r){this._serverRootPath=fVt.posix.join(r??"/",oRn(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return fVt.posix.join(this._serverRootPath,v5.vscodeRemoteResource)}set(e,r,n){this._hosts[e]=r,this._ports[e]=n}setConnectionToken(e,r){this._connectionTokens[e]=r}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(l){return Frs.onUnexpectedExternalError(l),e}let r=e.authority,n=this._hosts[r];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);let o=this._ports[r],s=this._connectionTokens[r],c=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(c+=`&${Es.connectionTokenQueryName}=${encodeURIComponent(s)}`),ZJ.URI.from({scheme:dVt.isWeb?this._preferredWebSchema:v5.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};Es.RemoteAuthorities=new pVt;function oRn(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(oRn,"getServerProductSegment");Es.builtinExtensionsPath="vs/../../extensions";Es.nodeModulesPath="vs/../../node_modules";Es.nodeModulesAsarPath="vs/../../node_modules.asar";Es.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";Es.VSCODE_AUTHORITY="vscode-app";var hVt=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=Es.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===v5.vscodeRemote?Es.RemoteAuthorities.rewrite(e):e.scheme===v5.file&&(dVt.isNative||dVt.webWorkerOrigin===`${v5.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:v5.vscodeFileResource,authority:e.authority||t.FALLBACK_AUTHORITY,query:null,fragment:null}):e}asFileUri(e){let r=this.toUri(e);return this.uriToFileUri(r)}uriToFileUri(e){return e.scheme===v5.vscodeFileResource?e.with({scheme:v5.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(ZJ.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return ZJ.URI.joinPath(ZJ.URI.parse(r,!0),e);let n=fVt.join(r,e);return ZJ.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};Es.FileAccess=new hVt;Es.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});Es.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var nRn;(function(t){let e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);t.CoopAndCoep=Object.freeze(e.get("3"));let r="vscode-coi";function n(s){let c;typeof s=="string"?c=new URL(s).searchParams:s instanceof URL?c=s.searchParams:ZJ.URI.isUri(s)&&(c=new URL(s.toString(!0)).searchParams);let l=c?.get(r);if(l)return e.get(l)}a(n,"getHeadersFromQuery"),t.getHeadersFromQuery=n;function o(s,c,l){if(!globalThis.crossOriginIsolated)return;let u=c&&l?"3":l?"2":"1";s instanceof URLSearchParams?s.set(r,u):s[r]=u}a(o,"addSearchParam"),t.addSearchParam=o})(nRn||(Es.COI=nRn={}))});var x2=I(Cr=>{"use strict";p();var Qrs=Cr&&Cr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qrs=Cr&&Cr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cRn=Cr&&Cr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oTde.getRoot(n).length&&n[n.length-1]===r}else{let n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,r=fv.sep){return(0,Cr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,r=fv.sep){let n=!1;if(e.scheme===Aj.Schemas.file){let o=C5(e);n=o!==void 0&&o.length===Tde.getRoot(o).length&&o[o.length-1]===r}else{r="/";let o=e.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!(0,Cr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path+"/"}):e}};Cr.ExtUri=Ide;Cr.extUri=new Ide(()=>!1);Cr.extUriBiasedIgnorePathCase=new Ide(t=>t.scheme===Aj.Schemas.file?!lRn.isLinux:!0);Cr.extUriIgnorePathCase=new Ide(t=>!0);Cr.isEqual=Cr.extUri.isEqual.bind(Cr.extUri);Cr.isEqualOrParent=Cr.extUri.isEqualOrParent.bind(Cr.extUri);Cr.getComparisonKey=Cr.extUri.getComparisonKey.bind(Cr.extUri);Cr.basenameOrAuthority=Cr.extUri.basenameOrAuthority.bind(Cr.extUri);Cr.basename=Cr.extUri.basename.bind(Cr.extUri);Cr.extname=Cr.extUri.extname.bind(Cr.extUri);Cr.dirname=Cr.extUri.dirname.bind(Cr.extUri);Cr.joinPath=Cr.extUri.joinPath.bind(Cr.extUri);Cr.normalizePath=Cr.extUri.normalizePath.bind(Cr.extUri);Cr.relativePath=Cr.extUri.relativePath.bind(Cr.extUri);Cr.resolvePath=Cr.extUri.resolvePath.bind(Cr.extUri);Cr.isAbsolutePath=Cr.extUri.isAbsolutePath.bind(Cr.extUri);Cr.isEqualAuthority=Cr.extUri.isEqualAuthority.bind(Cr.extUri);Cr.hasTrailingPathSeparator=Cr.extUri.hasTrailingPathSeparator.bind(Cr.extUri);Cr.removeTrailingPathSeparator=Cr.extUri.removeTrailingPathSeparator.bind(Cr.extUri);Cr.addTrailingPathSeparator=Cr.extUri.addTrailingPathSeparator.bind(Cr.extUri);function jrs(t,e){let r=[];for(let n=0;nc===n?!1:(0,Cr.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(jrs,"distinctParents");var aRn;(function(t){t.META_DATA_LABEL="label",t.META_DATA_DESCRIPTION="description",t.META_DATA_SIZE="size",t.META_DATA_MIME="mime";function e(r){let n=new Map;r.path.substring(r.path.indexOf(";")+1,r.path.lastIndexOf(";")).split(";").forEach(c=>{let[l,u]=c.split(":");l&&u&&n.set(l,u)});let s=r.path.substring(0,r.path.indexOf(";"));return s&&n.set(t.META_DATA_MIME,s),n}a(e,"parseMetaData"),t.parseMetaData=e})(aRn||(Cr.DataUri=aRn={}));function Hrs(t,e,r){if(e){let n=t.path;return n&&n[0]!==fv.posix.sep&&(n=fv.posix.sep+n),t.with({scheme:r,authority:e,path:n})}return t.with({scheme:r})}a(Hrs,"toLocalResource")});var uRn=I(YXe=>{"use strict";p();Object.defineProperty(YXe,"__esModule",{value:!0});YXe.MicrotaskDelay=void 0;YXe.MicrotaskDelay=Symbol("MicrotaskDelay")});var pl=I(Yt=>{"use strict";p();Object.defineProperty(Yt,"__esModule",{value:!0});Yt.AsyncReader=Yt.AsyncReaderEndOfStream=Yt.CancelableAsyncIterableProducer=Yt.AsyncIterableProducer=Yt.AsyncIterableSource=Yt.AsyncIterableObject=Yt.LazyStatefulPromise=Yt.StatefulPromise=Yt.Promises=Yt.DeferredPromise=Yt.IntervalCounter=Yt.TaskSequentializer=Yt.GlobalIdleValue=Yt.AbstractIdleValue=Yt._runWhenIdle=Yt.runWhenGlobalIdle=Yt.ThrottledWorker=Yt.RunOnceWorker=Yt.ProcessTimeRunOnceScheduler=Yt.RunOnceScheduler=Yt.IntervalTimer=Yt.TimeoutTimer=Yt.TaskQueue=Yt.ResourceQueue=Yt.LimitedQueue=Yt.Queue=Yt.Limiter=Yt.AutoOpenBarrier=Yt.Barrier=Yt.ThrottledDelayer=Yt.Delayer=Yt.SequencerByKey=Yt.Sequencer=Yt.Throttler=void 0;Yt.isThenable=pRn;Yt.createCancelablePromise=hRn;Yt.raceCancellation=mRn;Yt.raceCancellationError=Wrs;Yt.rejectIfNotCanceled=zrs;Yt.notCancellablePromise=Yrs;Yt.raceCancellablePromises=Krs;Yt.raceTimeout=gRn;Yt.asPromise=Jrs;Yt.promiseWithResolvers=ARn;Yt.timeout=OVt;Yt.disposableTimeout=ens;Yt.sequence=tns;Yt.first=rns;Yt.firstParallel=nns;Yt.installFakeRunWhenIdle=ins;Yt.retry=ons;Yt.createCancelableAsyncIterableProducer=sns;Yt.cancellableIterable=ans;Yt.createTimeout=cns;var MVt=S2(),pv=Os(),$Re=Fc(),yj=Po(),dRn=x2(),Grs=pj(),$rs=uRn(),Vrs=MF();function pRn(t){return!!t&&typeof t.then=="function"}a(pRn,"isThenable");function hRn(t){let e=new MVt.CancellationTokenSource,r=t(e.token),n=!1,o=new Promise((s,c)=>{let l=e.token.onCancellationRequested(()=>{n=!0,l.dispose(),c(new pv.CancellationError)});Promise.resolve(r).then(u=>{l.dispose(),e.dispose(),n?(0,yj.isDisposable)(u)&&u.dispose():s(u)},u=>{l.dispose(),e.dispose(),c(u)})});return new class{cancel(){e.cancel(),e.dispose()}then(s,c){return o.then(s,c)}catch(s){return this.then(void 0,s)}finally(s){return o.finally(s)}}}a(hRn,"createCancelablePromise");function mRn(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(mRn,"raceCancellation");function Wrs(t,e){return new Promise((r,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new pv.CancellationError)});t.then(r,n).finally(()=>o.dispose())})}a(Wrs,"raceCancellationError");function zrs(t){if(!(0,pv.isCancellationError)(t))return Promise.reject(t)}a(zrs,"rejectIfNotCanceled");function Yrs(t){return new Promise((e,r)=>{t.then(e,r)})}a(Yrs,"notCancellablePromise");function Krs(t){let e=-1,r=t.map((o,s)=>o.then(c=>(e=s,c))),n=Promise.race(r);return n.cancel=()=>{t.forEach((o,s)=>{s!==e&&o.cancel&&o.cancel()})},n.finally(()=>{n.cancel()}),n}a(Krs,"raceCancellablePromises");function gRn(t,e,r){let n,o=setTimeout(()=>{n?.(void 0),r?.()},e);return Promise.race([t.finally(()=>clearTimeout(o)),new Promise(s=>n=s)])}a(gRn,"raceTimeout");function Jrs(t){return new Promise((e,r)=>{let n=t();pRn(n)?n.then(e,r):e(n)})}a(Jrs,"asPromise");function ARn(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(ARn,"promiseWithResolvers");var KXe=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new MVt.CancellationTokenSource}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let r=a(()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n},"onComplete");this.queuedPromise=new Promise(n=>{this.activePromise.then(r,r).then(n)})}return new Promise((r,n)=>{this.queuedPromise.then(r,n)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((r,n)=>{this.activePromise.then(o=>{this.activePromise=null,r(o)},o=>{this.activePromise=null,n(o)})})}dispose(){this.cancellationTokenSource.cancel()}};Yt.Throttler=KXe;var gVt=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Yt.Sequencer=gVt;var AVt=class{static{a(this,"SequencerByKey")}constructor(){this.promiseMap=new Map}queue(e,r){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}};Yt.SequencerByKey=AVt;var Zrs=a((t,e)=>{let r=!0,n=setTimeout(()=>{r=!1,e()},t);return{isTriggered:a(()=>r,"isTriggered"),dispose:a(()=>{clearTimeout(n),r=!1},"dispose")}},"timeoutDeferred"),Xrs=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),JXe=class{static{a(this,"Delayer")}constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,r=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((o,s)=>{this.doResolve=o,this.doReject=s}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let o=this.task;return this.task=null,o()}}));let n=a(()=>{this.deferred=null,this.doResolve?.(null)},"fn");return this.deferred=r===$rs.MicrotaskDelay?Xrs(n):Zrs(r,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new pv.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};Yt.Delayer=JXe;var yVt=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new JXe(e),this.throttler=new KXe}trigger(e,r){return this.delayer.trigger(()=>this.throttler.queue(e),r)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};Yt.ThrottledDelayer=yVt;var ZXe=class{static{a(this,"Barrier")}constructor(){this._isOpen=!1,this._promise=new Promise((e,r)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};Yt.Barrier=ZXe;var _Vt=class extends ZXe{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Yt.AutoOpenBarrier=_Vt;function OVt(t,e){return e?new Promise((r,n)=>{let o=setTimeout(()=>{s.dispose(),r()},t),s=e.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new pv.CancellationError)})}):hRn(r=>OVt(t,r))}a(OVt,"timeout");function ens(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,yj.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(ens,"disposableTimeout");function tns(t){let e=[],r=0,n=t.length;function o(){return r!!n,r=null){let n=0,o=t.length,s=a(()=>{if(n>=o)return Promise.resolve(r);let c=t[n++];return Promise.resolve(c()).then(u=>e(u)?Promise.resolve(u):s())},"loop");return s()}a(rns,"first");function nns(t,e=n=>!!n,r=null){if(t.length===0)return Promise.resolve(r);let n=t.length,o=a(()=>{n=-1;for(let s of t)s.cancel?.()},"finish");return new Promise((s,c)=>{for(let l of t)l.then(u=>{--n>=0&&e(u)?(o(),s(u)):n===0&&s(r)}).catch(u=>{--n>=0&&(o(),c(u))})})}a(nns,"firstParallel");var XXe=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new $Re.Emitter}whenIdle(){return this.size>0?$Re.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((r,n)=>{this.outstandingPromises.push({factory:e,c:r,e:n}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}};Yt.Limiter=XXe;var eet=class extends XXe{static{a(this,"Queue")}constructor(){super(1)}};Yt.Queue=eet;var EVt=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new ret,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};Yt.LimitedQueue=EVt;var vVt=class{static{a(this,"ResourceQueue")}constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new LF;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,r=dRn.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=dRn.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new eet;let c=this.drainListenerCount++,l=$Re.Event.once(s.onDrained)(()=>{s?.dispose(),this.queues.delete(o),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(c),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new yj.DisposableMap),this.drainListeners.set(c,l),this.queues.set(o,s)}return s.queue(r)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}};Yt.ResourceQueue=vVt;var CVt=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new LF;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new LF;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),r.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new pv.BugIndicatingError;this._runningTask=e.task;try{let r=await e.task();e.deferred.complete(r)}catch(r){e.deferred.error(r)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let r of e)r.setUndefinedWhenCleared?r.deferred.complete(void 0):r.deferred.error(new pv.CancellationError)}};Yt.TaskQueue=CVt;var bVt=class{static{a(this,"TimeoutTimer")}constructor(e,r){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,r){if(this._isDisposed)throw new pv.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new pv.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},r))}};Yt.TimeoutTimer=bVt;var SVt=class{static{a(this,"IntervalTimer")}constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,r,n=globalThis){if(this.isDisposed)throw new pv.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},r);this.disposable=(0,yj.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Yt.IntervalTimer=SVt;var VRe=class{static{a(this,"RunOnceScheduler")}constructor(e,r){this.timeoutToken=void 0,this.runner=e,this.timeout=r,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};Yt.RunOnceScheduler=VRe;var TVt=class{static{a(this,"ProcessTimeRunOnceScheduler")}constructor(e,r){r%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${r}ms is not a multiple of 1000ms.`),this.runner=e,this.timeout=r,this.counter=0,this.intervalToken=void 0,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=void 0)}schedule(e=this.timeout){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(e/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==void 0}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=void 0,this.runner?.())}};Yt.ProcessTimeRunOnceScheduler=TVt;var IVt=class extends VRe{static{a(this,"RunOnceWorker")}constructor(e,r){super(e,r),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){let e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}};Yt.RunOnceWorker=IVt;var xVt=class extends yj.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new yj.MutableDisposable),this.disposed=!1,this.lastExecutionTime=0}get pending(){return this.pendingWork.length}work(e){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+e.length>this.options.maxBufferedWork)return!1}else if(this.pending+e.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(let n of e)this.pendingWork.push(n);let r=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||r>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-r,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(e=this.options.throttleDelay){this.throttler.value=new VRe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Yt.ThrottledWorker=xVt;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Yt._runWhenIdle=(e,r,n)=>{(0,Grs.setTimeout0)(()=>{if(o)return;let s=Date.now()+15;r(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let o=!1;return{dispose(){o||(o=!0)}}}:Yt._runWhenIdle=(e,r,n)=>{let o=e.requestIdleCallback(r,typeof n=="number"?{timeout:n}:void 0),s=!1;return{dispose(){s||(s=!0,e.cancelIdleCallback(o))}}},Yt.runWhenGlobalIdle=(e,r)=>(0,Yt._runWhenIdle)(globalThis,e,r)})();function ins(t){let e=Yt._runWhenIdle,r=Yt.runWhenGlobalIdle;return Yt._runWhenIdle=t,Yt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,yj.toDisposable)(()=>{Yt._runWhenIdle=e,Yt.runWhenGlobalIdle=r})}a(ins,"installFakeRunWhenIdle");var tet=class{static{a(this,"AbstractIdleValue")}constructor(e,r){this._didRun=!1,this._executor=()=>{try{this._value=r()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=(0,Yt._runWhenIdle)(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}};Yt.AbstractIdleValue=tet;var wVt=class extends tet{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Yt.GlobalIdleValue=wVt;async function ons(t,e,r){let n;for(let o=0;on?.(),"cancel"),promise:r},r.then(()=>this.doneRunning(e),()=>this.doneRunning(e)),r}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){let e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{let{promise:r,resolve:n,reject:o}=ARn();this._queued={run:e,promise:r,promiseResolve:n,promiseReject:o}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}};Yt.TaskSequentializer=ret;var RVt=class{static{a(this,"IntervalCounter")}constructor(e,r=()=>Date.now()){this.interval=e,this.nowFn=r,this.lastIncrementTime=0,this.value=0}increment(){let e=this.nowFn();return e-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=e,this.value=0),this.value++,this.value}};Yt.IntervalCounter=RVt;var LF=class t{static{a(this,"DeferredPromise")}static fromPromise(e){let r=new t;return r.settleWith(e),r}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,r)=>{this.completeCallback=e,this.errorCallback=r})}complete(e){return this.isSettled?Promise.resolve():new Promise(r=>{this.completeCallback(e),this.outcome={outcome:0,value:e},r()})}error(e){return this.isSettled?Promise.resolve():new Promise(r=>{this.errorCallback(e),this.outcome={outcome:1,value:e},r()})}settleWith(e){return e.then(r=>this.complete(r),r=>this.error(r))}cancel(){return this.error(new pv.CancellationError)}};Yt.DeferredPromise=LF;var fRn;(function(t){async function e(n){let o,s=await Promise.all(n.map(c=>c.then(l=>l,l=>{o||(o=l)})));if(typeof o<"u")throw o;return s}a(e,"settled"),t.settled=e;function r(n){return new Promise(async(o,s)=>{try{await n(o,s)}catch(c){s(c)}})}a(r,"withAsyncBody"),t.withAsyncBody=r})(fRn||(Yt.Promises=fRn={}));var net=class{static{a(this,"StatefulPromise")}get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then(r=>(this._value=r,this._isResolved=!0,r),r=>{throw this._error=r,this._isResolved=!0,r})}requireValue(){if(!this._isResolved)throw new pv.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};Yt.StatefulPromise=net;var kVt=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new Vrs.Lazy(()=>new net(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Yt.LazyStatefulPromise=kVt;var iet=class t{static{a(this,"AsyncIterableObject")}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new $Re.Emitter,queueMicrotask(async()=>{let n={emitOne:a(o=>this.emitOne(o),"emitOne"),emitMany:a(o=>this.emitMany(o),"emitMany"),reject:a(o=>this.reject(o),"reject")};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=()=>{},n.emitMany=()=>{},n.reject=()=>{}}})}[Symbol.asyncIterator](){let e=0;return{next:a(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}map(e){return t.map(this,e)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static async toPromise(e){let r=[];for await(let n of e)r.push(n);return r}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Yt.AsyncIterableObject=iet;function sns(t){let e=new MVt.CancellationTokenSource,r=t(e.token);return new set(e,async n=>{let o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),n.reject(new pv.CancellationError)});try{for await(let s of r){if(e.token.isCancellationRequested)return;n.emitOne(s)}o.dispose(),e.dispose()}catch(s){o.dispose(),e.dispose(),n.reject(s)}})}a(sns,"createCancelableAsyncIterableProducer");var PVt=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new LF,this._asyncIterable=new iet(o=>{if(r){o.reject(r);return}return n&&o.emitMany(n),this._errorFn=s=>o.reject(s),this._emitOneFn=s=>o.emitOne(s),this._emitManyFn=s=>o.emitMany(s),this._deferred.p},e);let r,n;this._errorFn=o=>{r||(r=o)},this._emitOneFn=o=>{n||(n=[]),n.push(o)},this._emitManyFn=o=>{n?o.forEach(s=>n.push(s)):n=o.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}};Yt.AsyncIterableSource=PVt;function ans(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await mRn(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a(ans,"cancellableIterable");var DVt=class{static{a(this,"ProducerConsumer")}constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let r=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(r,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let r of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(r,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new pv.BugIndicatingError("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,r){r.ok?e.complete(r.value):e.error(r.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new LF;return this._unsatisfiedConsumers.push(e),e.p}}},oet=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new DVt,this._iterator={next:a(()=>this._producerConsumer.consume(),"next"),return:a(()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),"return"),throw:a(async n=>(this._finishError(n),{done:!0,value:void 0}),"throw")},queueMicrotask(async()=>{let n=e({emitOne:a(o=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}}),"emitOne"),emitMany:a(o=>{for(let s of o)this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}})},"emitMany"),reject:a(o=>this._finishError(o),"reject")});if(!this._producerConsumer.hasFinalValue)try{await n,this._finishOk()}catch(o){this._finishError(o)}})}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}static tee(e){let r,n,o=new LF,s=a(async()=>{if(!(!r||!n))try{for await(let u of e)r.emitOne(u),n.emitOne(u)}catch(u){r.reject(u),n.reject(u)}finally{o.complete()}},"start"),c=new t(async u=>(r=u,s(),o.p)),l=new t(async u=>(n=u,s(),o.p));return[c,l]}map(e){return t.map(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};Yt.AsyncIterableProducer=oet;var set=class extends oet{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Yt.CancelableAsyncIterableProducer=set;Yt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var NVt=class{static{a(this,"AsyncReader")}get endOfStream(){return this._buffer.length===0&&this._atEnd}constructor(e){this._source=e,this._buffer=[],this._atEnd=!1}async read(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?Yt.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,r){do{let n=await this.peek();if(n===Yt.AsyncReaderEndOfStream||!e(n))break;await this.read(),await r(n)}while(!0)}readBufferedOrThrow(){let e=this.peekBufferedOrThrow();return this._buffer.shift(),e}async consumeToEnd(){for(;!this.endOfStream;)await this.read()}async peek(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?Yt.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return Yt.AsyncReaderEndOfStream;throw new pv.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await gRn(this._extendBuffer(),e),this._atEnd)return Yt.AsyncReaderEndOfStream;if(this._buffer.length!==0)return this._buffer[0]}_extendBuffer(){return this._atEnd?Promise.resolve():(this._extendBufferPromise||(this._extendBufferPromise=(async()=>{let{value:e,done:r}=await this._source.next();this._extendBufferPromise=void 0,r?this._atEnd=!0:this._buffer.push(e)})()),this._extendBufferPromise)}};Yt.AsyncReader=NVt;function cns(t,e){let r=setTimeout(e,t);return(0,yj.toDisposable)(()=>clearTimeout(r))}a(cns,"createTimeout")});var TRn=I(bT=>{"use strict";p();var pns=bT&&bT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bT,"__esModule",{value:!0});var hns=require("fs"),mns=pns(YP()),wde=mns.default("@kwsites/file-exists");function gns(t,e,r){wde("checking %s",t);try{let n=hns.statSync(t);return n.isFile()&&e?(wde("[OK] path represents a file"),!0):n.isDirectory()&&r?(wde("[OK] path represents a directory"),!0):(wde("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return wde("[FAIL] path is not accessible: %o",n),!1;throw wde("[FATAL] %o",n),n}}a(gns,"check");function Ans(t,e=bT.READABLE){return gns(t,(e&bT.FILE)>0,(e&bT.FOLDER)>0)}a(Ans,"exists");bT.exists=Ans;bT.FILE=1;bT.FOLDER=2;bT.READABLE=bT.FILE+bT.FOLDER});var IRn=I(pet=>{"use strict";p();function yns(t){for(var e in t)pet.hasOwnProperty(e)||(pet[e]=t[e])}a(yns,"__export");Object.defineProperty(pet,"__esModule",{value:!0});yns(TRn())});var wRn=I((DTd,xRn)=>{p();var Pde=1e3,Dde=Pde*60,Nde=Dde*60,eZ=Nde*24,_ns=eZ*7,Ens=eZ*365.25;xRn.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return vns(t);if(r==="number"&&isFinite(t))return e.long?bns(t):Cns(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function vns(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Ens;case"weeks":case"week":case"w":return r*_ns;case"days":case"day":case"d":return r*eZ;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Nde;case"minutes":case"minute":case"mins":case"min":case"m":return r*Dde;case"seconds":case"second":case"secs":case"sec":case"s":return r*Pde;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(vns,"parse");function Cns(t){var e=Math.abs(t);return e>=eZ?Math.round(t/eZ)+"d":e>=Nde?Math.round(t/Nde)+"h":e>=Dde?Math.round(t/Dde)+"m":e>=Pde?Math.round(t/Pde)+"s":t+"ms"}a(Cns,"fmtShort");function bns(t){var e=Math.abs(t);return e>=eZ?het(t,e,eZ,"day"):e>=Nde?het(t,e,Nde,"hour"):e>=Dde?het(t,e,Dde,"minute"):e>=Pde?het(t,e,Pde,"second"):t+" ms"}a(bns,"fmtLong");function het(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(het,"plural")});var UVt=I((OTd,RRn)=>{p();function Sns(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=wRn(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let k=r.formatters[x];if(typeof k=="function"){let D=_[T];R=k.call(E,D),_.splice(T,1),T--}return R}),r.formatArgs.call(E,_),(E.log||r.log).apply(E,_)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(_=>{m=_},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(" ",",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}a(o,"enable");function s(f,h){let m=0,g=0,A=-1,y=0;for(;m"-"+h)].join(",");return r.enable(""),f}a(c,"disable");function l(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}a(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}a(u,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(d,"destroy"),r.enable(r.load()),r}a(Sns,"setup");RRn.exports=Sns});var kRn=I((ST,met)=>{p();ST.formatArgs=Ins;ST.save=xns;ST.load=wns;ST.useColors=Tns;ST.storage=Rns();ST.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();ST.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Tns(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(Tns,"useColors");function Ins(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+met.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(Ins,"formatArgs");ST.log=console.debug||console.log||(()=>{});function xns(t){try{t?ST.storage.setItem("debug",t):ST.storage.removeItem("debug")}catch{}}a(xns,"save");function wns(){let t;try{t=ST.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(wns,"load");function Rns(){try{return localStorage}catch{}}a(Rns,"localstorage");met.exports=UVt()(ST);var{formatters:kns}=met.exports;kns.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var DRn=I((k0,Aet)=>{p();var Pns=require("tty"),get=require("util");k0.init=Fns;k0.log=Ons;k0.formatArgs=Nns;k0.save=Lns;k0.load=Bns;k0.useColors=Dns;k0.destroy=get.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");k0.colors=[6,2,3,4,5,1];try{let t=RVe();t&&(t.stderr||t).level>=2&&(k0.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}k0.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function Dns(){return"colors"in k0.inspectOpts?!!k0.inspectOpts.colors:Pns.isatty(process.stderr.fd)}a(Dns,"useColors");function Nns(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` +`))}},QRe=class t extends Error{static{a(this,"ListenerLeakError")}constructor(e,r,n,o,s){super(s?`[${s}] potential listener LEAK detected, ${e}`:`potential listener LEAK detected, ${e}`),this.name="ListenerLeakError",this.kind=e,this.listenerCount=o,this.details=r,this.stack=n}static is(e){return e instanceof t||e instanceof Error&&typeof e.kind=="string"&&typeof e.listenerCount=="number"}};Xa.ListenerLeakError=QRe;var NXe=class extends QRe{static{a(this,"ListenerRefusalError")}constructor(e,r,n,o,s){super(e,r,n,o,s),this.name="ListenerRefusalError"}};Xa.ListenerRefusalError=NXe;var Les=0,Ede=class{static{a(this,"UniqueContainer")}constructor(e){this.value=e,this.id=Les++}},Bes=2,kwn=a((t,e)=>{if(t instanceof Ede)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new U$t(e?.onListenerError??FRe.onUnexpectedError,this._options?.leakWarningThreshold??URe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new DXe(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Twn){let e=this._listeners;queueMicrotask(()=>{kwn(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=d[1]/this._size>.3?"dominated":"popular",h=new NXe(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||FRe.onUnexpectedError)(h),gb.Disposable.None}if(this._disposed)return gb.Disposable.None;r&&(e=e.bind(r));let o=new Ede(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=vde.create(),s=this._leakageMon.check(o.stack,this._size+1)),Twn&&(o.stack=c??vde.create()),this._listeners?this._listeners instanceof Ede?(this._deliveryQueue??=new MXe,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=(0,gb.toDisposable)(()=>{s?.(),this._removeListener(o)});return z$t(l,n),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,n=r.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*Bes<=r.length){let s=0;for(let c=0;c0}};Xa.Emitter=w_;var Fes=a(()=>new MXe,"createEventDeliveryQueue");Xa.createEventDeliveryQueue=Fes;var MXe=class{static{a(this,"EventDeliveryQueuePrivate")}constructor(){this.i=-1,this.end=0}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Q$t=class extends w_{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new Rwn.LinkedList),kwn(this._listeners,o=>this._asyncDeliveryQueue.push([o.value,e]));this._asyncDeliveryQueue.size>0&&!r.isCancellationRequested;){let[o,s]=this._asyncDeliveryQueue.shift(),c=[],l={...s,token:r,waitUntil:a(u=>{if(Object.isFrozen(c))throw new Error("waitUntil can NOT be called asynchronous");n&&(u=n(u,o)),c.push(u)},"waitUntil")};try{o(l)}catch(u){(0,FRe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,FRe.onUnexpectedError)(d.reason)})}}};Xa.AsyncEmitter=Q$t;var OXe=class extends w_{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new Rwn.LinkedList,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}};Xa.PauseableEmitter=OXe;var q$t=class extends OXe{static{a(this,"DebounceEmitter")}constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}};Xa.DebounceEmitter=q$t;var j$t=class extends w_{static{a(this,"MicrotaskEmitter")}constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(r=>super.fire(r)),this._queuedEvents=[]}))}};Xa.MicrotaskEmitter=j$t;var LXe=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new w_({onWillAddFirstListener:a(()=>this.onFirstListenerAdd(),"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>this.onLastListenerRemove(),"onDidRemoveLastListener")})}get event(){return this.emitter.event}add(e){let r={event:e,listener:null};this.events.push(r),this.hasListeners&&this.hook(r);let n=a(()=>{this.hasListeners&&this.unhook(r);let o=this.events.indexOf(r);this.events.splice(o,1)},"dispose");return(0,gb.toDisposable)((0,kes.createSingleCallFunction)(n))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(r=>this.emitter.fire(r))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(let e of this.events)e.listener?.dispose();this.events=[]}};Xa.EventMultiplexer=LXe;var H$t=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new gb.DisposableStore;let s=this._store.add(new LXe),c=this._store.add(new gb.DisposableMap);function l(u){c.set(u,s.add(o(u)))}a(l,"addItem");for(let u of e)l(u);this._store.add(r(u=>{l(u)})),this._store.add(n(u=>{c.deleteAndDispose(u)})),this.event=s.event}dispose(){this._store.dispose()}};Xa.DynamicListEventMultiplexer=H$t;var G$t=class{static{a(this,"EventBufferer")}constructor(){this.data=[]}wrapEvent(e,r,n){return(o,s,c)=>e(l=>{let u=this.data[this.data.length-1];if(!r){u?u.buffers.push(()=>o.call(s,l)):o.call(s,l);return}let d=u;if(!d){o.call(s,r(n,l));return}d.items??=[],d.items.push(l),d.buffers.length===0&&u.buffers.push(()=>{d.reducedResult??=n?d.items.reduce(r,n):d.items.reduce(r),o.call(s,d.reducedResult)})},void 0,c)}bufferEvents(e){let r={buffers:new Array};this.data.push(r);let n=e();return this.data.pop(),r.buffers.forEach(o=>o()),n}};Xa.EventBufferer=G$t;var $$t=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=PXe.None,this.inputEventListener=gb.Disposable.None,this.emitter=new w_({onDidAddFirstListener:a(()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},"onDidAddFirstListener"),onDidRemoveLastListener:a(()=>{this.listening=!1,this.inputEventListener.dispose()},"onDidRemoveLastListener")}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}};Xa.Relay=$$t;var V$t=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new W$t(e)}constructor(e){this._value=e,this._onDidChange=new w_,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};Xa.ValueWithChangeEvent=V$t;var W$t=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=PXe.None}};function Ues(t,e,r){let n=new gb.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new gb.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,Res.diffSets)(o,c);for(let u of l.removed)n.deleteAndDispose(u);for(let u of l.added)n.set(u,r(u));o=new Set(c)})),s.add(n),s}a(Ues,"trackSetChanges");function z$t(t,e){e instanceof gb.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(z$t,"addToDisposables");function wwn(t,e){if(e instanceof gb.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a(wwn,"disposeAndRemove")});var S2=I(PF=>{"use strict";p();Object.defineProperty(PF,"__esModule",{value:!0});PF.CancellationTokenPool=PF.CancellationTokenSource=PF.CancellationToken=void 0;PF.cancelOnDispose=qes;var Pwn=Fc(),Qes=Po(),Dwn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),BXe;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof Cde?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}a(e,"isCancellationToken"),t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Pwn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Dwn})})(BXe||(PF.CancellationToken=BXe={}));var Cde=class{static{a(this,"MutableToken")}constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Dwn:(this._emitter||(this._emitter=new Pwn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},qRe=class{static{a(this,"CancellationTokenSource")}constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Cde),this._token}cancel(){this._token?this._token instanceof Cde&&this._token.cancel():this._token=BXe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Cde&&this._token.dispose():this._token=BXe.None}};PF.CancellationTokenSource=qRe;function qes(t){let e=new qRe;return t.add({dispose(){e.cancel()}}),e.token}a(qes,"cancelOnDispose");var Y$t=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new qRe,this._listeners=new Qes.DisposableStore,this._total=0,this._cancelled=0,this._isDone=!1}get token(){return this._source.token}add(e){if(this._isDone)return;if(this._total++,e.isCancellationRequested){this._cancelled++,this._check();return}let r=e.onCancellationRequested(()=>{r.dispose(),this._cancelled++,this._check()});this._listeners.add(r)}_check(){!this._isDone&&this._total>0&&this._total===this._cancelled&&(this._isDone=!0,this._listeners.dispose(),this._source.cancel())}dispose(){this._listeners.dispose(),this._source.dispose()}};PF.CancellationTokenPool=Y$t});var $A=I(en=>{"use strict";p();var jes=en&&en.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hes=en&&en.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Ges=en&&en.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=$es&&t<=Wes||t>=Ves&&t<=zes}a(NF,"isWindowsDeviceRoot");function UXe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===ZJ&&l!==-1?++l:l=-1}return o}a(UXe,"normalizeString");function Jes(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(Jes,"formatExt");function Nwn(t,e){Kes(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${Jes(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(Nwn,"_format");en.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],Ap(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=bde.cwd():(s=bde.env[`=${e}`]||bde.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===Ab)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)ts(f)&&(l=1,d=!0);else if(ts(f))if(d=!0,ts(s.charCodeAt(1))){let h=2,m=h;for(;h2&&ts(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=UXe(r,!n,"\\",ts),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Ap(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return K$t(s)?"\\":t;if(ts(s))if(o=!0,ts(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ts(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&ts(t.charCodeAt(e-1))&&(c+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&NF(c.charCodeAt(0))&&c.charCodeAt(1)===DF)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||ts(t.charCodeAt(l+1)))return`.\\${c}`;while((l=t.indexOf(":",l+1))!==-1)}return n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){Ap(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return ts(r)||e>2&&NF(r)&&t.charCodeAt(1)===DF&&ts(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&ts(r.charCodeAt(0))){++o;let s=r.length;s>1&&ts(r.charCodeAt(1))&&(++o,s>2&&(ts(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return en.win32.normalize(e)},relative(t,e){if(Ap(t,"from"),Ap(e,"to"),t===e)return"";let r=en.win32.resolve(t),n=en.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";if(r.length!==t.length||n.length!==e.length){let A=r.split("\\"),y=n.split("\\");A[A.length-1]===""&&A.pop(),y[y.length-1]===""&&y.pop();let _=A.length,E=y.length,v=_v?y.slice(S).join("\\"):_>v?"..\\".repeat(_-1-S)+"..":"":"..\\".repeat(_-S)+y.slice(S).join("\\")}let o=0;for(;oo&&t.charCodeAt(s-1)===Ab;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===Ab;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===Ab)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===Ab?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===Ab)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===Ab&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=en.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===Ab){if(e.charCodeAt(1)===Ab){let r=e.charCodeAt(2);if(r!==Yes&&r!==ZJ)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(NF(e.charCodeAt(0))&&e.charCodeAt(1)===DF&&e.charCodeAt(2)===Ab)return`\\\\?\\${e}`;return e},dirname(t){Ap(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return ts(o)?t:".";if(ts(o)){if(r=n=1,ts(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ts(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(ts(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&Ap(e,"suffix"),Ap(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&NF(t.charCodeAt(0))&&t.charCodeAt(1)===DF&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(ts(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(ts(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Ap(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===DF&&NF(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(ts(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===ZJ?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:Nwn.bind(null,"\\"),parse(t){Ap(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return ts(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(ts(o)){if(n=1,ts(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),ts(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===ZJ?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var Zes=(()=>{if(yb){let t=/\\/g;return()=>{let e=bde.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>bde.cwd()})();en.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];Ap(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===k0)}if(!r){let n=Zes();e=`${n}/${e}`,r=n.charCodeAt(0)===k0}return e=UXe(e,!r,"/",K$t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Ap(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===k0,r=t.charCodeAt(t.length-1)===k0;return t=UXe(t,!e,"/",K$t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Ap(t,"path"),t.length>0&&t.charCodeAt(0)===k0},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":en.posix.normalize(e.join("/"))},relative(t,e){if(Ap(t,"from"),Ap(e,"to"),t===e||(t=en.posix.resolve(t),e=en.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===k0)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===k0?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===k0)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Ap(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===k0,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===k0){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&Ap(e,"suffix"),Ap(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===k0){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===k0){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Ap(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t[c];if(l==="/"){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l==="."?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:Nwn.bind(null,"/"),parse(t){Ap(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===k0,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===k0){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===ZJ?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};en.posix.win32=en.win32.win32=en.win32;en.posix.posix=en.win32.posix=en.posix;en.normalize=yb?en.win32.normalize:en.posix.normalize;en.isAbsolute=yb?en.win32.isAbsolute:en.posix.isAbsolute;en.join=yb?en.win32.join:en.posix.join;en.resolve=yb?en.win32.resolve:en.posix.resolve;en.relative=yb?en.win32.relative:en.posix.relative;en.dirname=yb?en.win32.dirname:en.posix.dirname;en.basename=yb?en.win32.basename:en.posix.basename;en.extname=yb?en.win32.extname:en.posix.extname;en.format=yb?en.win32.format:en.posix.format;en.parse=yb?en.win32.parse:en.posix.parse;en.toNamespacedPath=yb?en.win32.toNamespacedPath:en.posix.toNamespacedPath;en.sep=yb?en.win32.sep:en.posix.sep;en.delimiter=yb?en.win32.delimiter:en.posix.delimiter});var qXe=I(T2=>{"use strict";p();Object.defineProperty(T2,"__esModule",{value:!0});T2.WeakCachedFunction=T2.CachedFunction=T2.LRUCachedFunction=T2.Cache=void 0;T2.identity=QXe;var Xes=S2(),J$t=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new Xes.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};T2.Cache=J$t;function QXe(t){return t}a(QXe,"identity");var Z$t=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=QXe):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};T2.LRUCachedFunction=Z$t;var X$t=class{static{a(this,"CachedFunction")}get cachedValues(){return this._map}constructor(e,r){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=QXe):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);if(this._map2.has(r))return this._map2.get(r);let n=this._fn(e);return this._map.set(e,n),this._map2.set(r,n),n}};T2.CachedFunction=X$t;var eVt=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=QXe):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);if(this._map.has(r))return this._map.get(r);let n=this._fn(e);return this._map.set(r,n),n}};T2.WeakCachedFunction=eVt});var MF=I(jXe=>{"use strict";p();Object.defineProperty(jXe,"__esModule",{value:!0});jXe.Lazy=void 0;var hj;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(hj||(hj={}));var tVt=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=hj.Uninitialized}get hasValue(){return this._state===hj.Completed}get value(){if(this._state===hj.Uninitialized){this._state=hj.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=hj.Completed}}else if(this._state===hj.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};jXe.Lazy=tVt});var ym=I(Nr=>{"use strict";p();Object.defineProperty(Nr,"__esModule",{value:!0});Nr.Ellipsis=Nr.InvisibleCharacters=Nr.AmbiguousCharacters=Nr.noBreakWhitespace=Nr.UTF8_BOM_CHARACTER=Nr.UNUSUAL_LINE_TERMINATORS=Nr.GraphemeIterator=Nr.CodePointIterator=void 0;Nr.isFalsyOrWhitespace=tts;Nr.format=nts;Nr.format2=ots;Nr.htmlAttributeEncodeValue=sts;Nr.escape=ats;Nr.escapeRegExpCharacters=Lwn;Nr.count=cts;Nr.truncate=lts;Nr.truncateMiddle=uts;Nr.trim=dts;Nr.ltrim=Bwn;Nr.rtrim=Fwn;Nr.convertSimple2RegExpPattern=fts;Nr.createRegExp=pts;Nr.regExpLeadsToEndlessLoop=hts;Nr.joinStrings=mts;Nr.splitLines=gts;Nr.splitLinesIncludeSeparators=Ats;Nr.indexOfPattern=yts;Nr.firstNonWhitespaceIndex=Uwn;Nr.getLeadingWhitespace=_ts;Nr.lastNonWhitespaceIndex=Ets;Nr.getIndentationLength=vts;Nr.replaceAsync=Cts;Nr.compare=bts;Nr.compareSubstring=Qwn;Nr.compareIgnoreCase=Sts;Nr.compareSubstringIgnoreCase=HRe;Nr.isAsciiDigit=Tts;Nr.isLowerAsciiLetter=nVt;Nr.isUpperAsciiLetter=Its;Nr.equalsIgnoreCase=qwn;Nr.equals=xts;Nr.startsWithIgnoreCase=wts;Nr.endsWithIgnoreCase=Rts;Nr.commonPrefixLength=kts;Nr.commonSuffixLength=Pts;Nr.isHighSurrogate=sVt;Nr.isLowSurrogate=HXe;Nr.computeCodePoint=aVt;Nr.getNextCodePoint=jwn;Nr.nextCharLength=Hwn;Nr.prevCharLength=Gwn;Nr.getCharContainingOffset=Nts;Nr.charCount=Mts;Nr.containsRTL=Lts;Nr.isBasicASCII=Fts;Nr.containsUnusualLineTerminators=Uts;Nr.isFullWidthCharacter=Qts;Nr.isEmojiImprecise=$wn;Nr.lcut=qts;Nr.rcut=jts;Nr.forAnsiStringParts=Vts;Nr.removeAnsiEscapeCodes=Wwn;Nr.removeAnsiEscapeCodesFromPrompt=zts;Nr.startsWithUTF8BOM=zwn;Nr.stripUTF8BOM=Yts;Nr.fuzzyContains=Kts;Nr.containsUppercaseCharacter=Jts;Nr.uppercaseFirstLetter=Zts;Nr.getNLines=Xts;Nr.singleLetterHash=ers;Nr.getGraphemeBreakType=trs;Nr.getLeftDeleteOffset=nrs;Nr.multibyteAwareBtoa=ars;var ets=qXe(),Mwn=MF();function tts(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(tts,"isFalsyOrWhitespace");var rts=/{(\d+)}/g;function nts(t,...e){return e.length===0?t:t.replace(rts,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(nts,"format");var its=/{([^}]+)}/g;function ots(t,e){return Object.keys(e).length===0?t:t.replace(its,(r,n)=>e[n]??r)}a(ots,"format2");function sts(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(sts,"htmlAttributeEncodeValue");function ats(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(ats,"escape");function Lwn(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(Lwn,"escapeRegExpCharacters");function cts(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a(cts,"count");function lts(t,e,r=Nr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a(lts,"truncate");function uts(t,e,r=Nr.Ellipsis){if(t.length<=e)return t;let n=Math.ceil(e/2)-r.length/2,o=Math.floor(e/2)-r.length/2;return`${t.substr(0,n)}${r}${t.substr(t.length-o)}`}a(uts,"truncateMiddle");function dts(t,e=" "){let r=Bwn(t,e);return Fwn(r,e)}a(dts,"trim");function Bwn(t,e){if(!t||!e)return t;let r=e.length,n=0;if(r===1){let o=e.charCodeAt(0);for(;n0&&t.charCodeAt(s-1)===c;)s--;return t.substring(0,s)}let o=n;for(;o>0&&t.endsWith(e,o);)o-=r;return t.substring(0,o)}a(Fwn,"rtrim");function fts(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(fts,"convertSimple2RegExpPattern");function pts(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=Lwn(t)),r.wholeWord&&(/\B/.test(t.charAt(0))||(t="\\b"+t),/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"));let n="";return r.global&&(n+="g"),r.matchCase||(n+="i"),r.multiline&&(n+="m"),r.unicode&&(n+="u"),new RegExp(t,n)}a(pts,"createRegExp");function hts(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(hts,"regExpLeadsToEndlessLoop");function mts(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(mts,"joinStrings");function gts(t){return t.split(/\r\n|\r|\n/)}a(gts,"splitLines");function Ats(t){let e=[],r=t.split(/(\r\n|\r|\n)/);for(let n=0;n=0;r--){let n=t.charCodeAt(r);if(n!==32&&n!==9)return r}return-1}a(Ets,"lastNonWhitespaceIndex");function vts(t){let e=Uwn(t);return e===-1?t.length:e}a(vts,"getIndentationLength");function Cts(t,e,r){let n=[],o=0;for(let s of t.matchAll(e)){if(n.push(t.slice(o,s.index)),s.index===void 0)throw new Error("match.index should be defined");o=s.index+s[0].length,n.push(r(s[0],...s.slice(1),s.index,t,s.groups))}return n.push(t.slice(o)),Promise.all(n).then(s=>s.join(""))}a(Cts,"replaceAsync");function bts(t,e){return te?1:0}a(bts,"compare");function Qwn(t,e,r=0,n=t.length,o=0,s=e.length){for(;rd)return 1}let c=n-r,l=s-o;return cl?1:0}a(Qwn,"compareSubstring");function Sts(t,e){return HRe(t,e,0,t.length,0,e.length)}a(Sts,"compareIgnoreCase");function HRe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return Qwn(t.toLowerCase(),e.toLowerCase(),r,n,o,s);nVt(u)&&(u-=32),nVt(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(HRe,"compareSubstringIgnoreCase");function Tts(t){return t>=48&&t<=57}a(Tts,"isAsciiDigit");function nVt(t){return t>=97&&t<=122}a(nVt,"isLowerAsciiLetter");function Its(t){return t>=65&&t<=90}a(Its,"isUpperAsciiLetter");function qwn(t,e){return t.length===e.length&&HRe(t,e)===0}a(qwn,"equalsIgnoreCase");function xts(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&qwn(t,e)}a(xts,"equals");function wts(t,e){let r=e.length;return r<=t.length&&HRe(t,e,0,r)===0}a(wts,"startsWithIgnoreCase");function Rts(t,e){let r=t.length,n=r-e.length;return n>=0&&HRe(t,e,n,r)===0}a(Rts,"endsWithIgnoreCase");function kts(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(sVt(n))return aVt(n,r)}return r}a(Dts,"getPrevCodePoint");var Sde=class{static{a(this,"CodePointIterator")}get offset(){return this._offset}constructor(e,r=0){this._str=e,this._len=e.length,this._offset=r}setOffset(e){this._offset=e}prevCodePoint(){let e=Dts(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=jwn(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};Nr.CodePointIterator=Sde;var Tde=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new Sde(e,r)}nextGraphemeLength(){let e=jRe.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.nextCodePoint());for(;!r.eol();){let s=r.offset,c=e.getGraphemeBreakType(r.nextCodePoint());if(Own(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=jRe.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.prevCodePoint());for(;r.offset>0;){let s=r.offset,c=e.getGraphemeBreakType(r.prevCodePoint());if(Own(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};Nr.GraphemeIterator=Tde;function Hwn(t,e){return new Tde(t,e).nextGraphemeLength()}a(Hwn,"nextCharLength");function Gwn(t,e){return new Tde(t,e).prevGraphemeLength()}a(Gwn,"prevCharLength");function Nts(t,e){e>0&&HXe(t.charCodeAt(e))&&e--;let r=e+Hwn(t,e);return[r-Gwn(t,r),r]}a(Nts,"getCharContainingOffset");function Mts(t){let e=new Tde(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(Mts,"charCount");var rVt;function Ots(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}a(Ots,"makeContainsRtl");function Lts(t){return rVt||(rVt=Ots()),rVt.test(t)}a(Lts,"containsRTL");var Bts=/^[\t\n\r\x20-\x7E]*$/;function Fts(t){return Bts.test(t)}a(Fts,"isBasicASCII");Nr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function Uts(t){return Nr.UNUSUAL_LINE_TERMINATORS.test(t)}a(Uts,"containsUnusualLineTerminators");function Qts(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(Qts,"isFullWidthCharacter");function $wn(t){return t>=127462&&t<=127487||t===8986||t===8987||t===9200||t===9203||t>=9728&&t<=10175||t===11088||t===11093||t>=127744&&t<=128591||t>=128640&&t<=128764||t>=128992&&t<=129008||t>=129280&&t<=129535||t>=129648&&t<=129782}a($wn,"isEmojiImprecise");function qts(t,e,r=""){let n=t.trimStart();if(n.lengthe){c=!0;break}s=o.lastIndex,o.lastIndex+=1}if(!c)return n;if(s===0)return r;let l=n.substring(0,s).trimEnd();return l.length!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,Gts=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,$ts=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,Vwn=new RegExp("(?:"+[Hts.source,Gts.source,$ts.source].join("|")+")","g");function*Vts(t){let e=0;for(let r of t.matchAll(Vwn))e!==r.index&&(yield{isCode:!1,str:t.substring(e,r.index)}),yield{isCode:!0,str:r[0]},e=r.index+r[0].length;e!==t.length&&(yield{isCode:!1,str:t.substring(e)})}a(Vts,"forAnsiStringParts");function Wwn(t){return t&&(t=t.replace(Vwn,"")),t}a(Wwn,"removeAnsiEscapeCodes");var Wts=/\\\[.*?\\\]/g;function zts(t){return Wwn(t).replace(Wts,"")}a(zts,"removeAnsiEscapeCodesFromPrompt");Nr.UTF8_BOM_CHARACTER="\uFEFF";function zwn(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(zwn,"startsWithUTF8BOM");function Yts(t){return zwn(t)?t.substr(1):t}a(Yts,"stripUTF8BOM");function Kts(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a(Xts,"getNLines");function ers(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(ers,"singleLetterHash");function trs(t){return jRe.getInstance().getGraphemeBreakType(t)}a(trs,"getGraphemeBreakType");function Own(t,e){return t===0?e!==5&&e!==7:t===2&&e===3?!1:t===4||t===2||t===3||e===4||e===2||e===3?!0:!(t===8&&(e===8||e===9||e===11||e===12)||(t===11||t===9)&&(e===9||e===10)||(t===12||t===10)&&e===10||e===5||e===13||e===7||t===1||t===13&&e===14||t===6&&e===6)}a(Own,"breakBetweenGraphemeBreakType");var jRe=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=rrs()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(er[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function rrs(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(rrs,"getGraphemeBreakRawData");function nrs(t,e){if(t===0)return 0;let r=irs(t,e);if(r!==void 0)return r;let n=new Sde(e,t);return n.prevCodePoint(),n.offset}a(nrs,"getLeftDeleteOffset");function irs(t,e){let r=new Sde(e,t),n=r.prevCodePoint();for(;ors(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!$wn(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(irs,"getOffsetBeforeLastEmojiComponent");function ors(t){return 127995<=t&&t<=127999}a(ors,"isEmojiModifier");Nr.noBreakWhitespace="\xA0";var iVt=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new Mwn.Lazy(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new ets.LRUCachedFunction(e=>{let r=e.split(",");function n(h){let m=new Map;for(let g=0;g!h.startsWith("_")&&Object.hasOwn(c,h));l.length===0&&(l=["_default"]);let u;for(let h of l){let m=n(c[h]);u=s(u,m)}let d=n(c._common),f=o(d,u);return new t(f)})}static getInstance(e){return t.cache.get(Array.from(e).join(","))}static{this._locales=new Mwn.Lazy(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;r{"use strict";p();Object.defineProperty(Sg,"__esModule",{value:!0});Sg.isPathSeparator=OF;Sg.toSlashes=Ywn;Sg.toPosixPath=lrs;Sg.getRoot=urs;Sg.isUNC=drs;Sg.isValidBasename=mrs;Sg.isEqual=grs;Sg.isEqualOrParent=Ars;Sg.isWindowsDriveLetter=cVt;Sg.sanitizeFilePath=yrs;Sg.removeTrailingPathSeparator=Kwn;Sg.isRootOrDriveLetter=_rs;Sg.hasDriveLetter=lVt;Sg.getDriveLetter=Ers;Sg.indexOfPath=vrs;Sg.parseLineAndColumnAware=Crs;Sg.randomPath=Trs;var bg=$A(),mj=pj(),GXe=ym(),crs=CT();function OF(t){return t===47||t===92}a(OF,"isPathSeparator");function Ywn(t){return t.replace(/[\\/]/g,bg.posix.sep)}a(Ywn,"toSlashes");function lrs(t){return t.indexOf("/")===-1&&(t=Ywn(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a(lrs,"toPosixPath");function urs(t,e=bg.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(OF(n)){if(OF(t.charCodeAt(1))&&!OF(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,prs=/[/]/g,hrs=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function mrs(t,e=mj.isWindows){let r=e?frs:prs;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&hrs.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(mrs,"isValidBasename");function grs(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,GXe.equalsIgnoreCase)(t,e)}a(grs,"isEqual");function Ars(t,e,r,n=!1){let o=n?bg.posix.sep:bg.sep;if(t===e)return!0;if(!t||!e||((t.indexOf("..")>=0||e.indexOf("..")>=0)&&(t=n?bg.posix.normalize(t):(0,bg.normalize)(t),e=n?bg.posix.normalize(e):(0,bg.normalize)(e)),e.length>t.length))return!1;if(r){if(!(0,GXe.startsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;let c=e.length;return e.charAt(e.length-1)===o&&c--,t.charAt(c)===o}return e.charAt(e.length-1)!==o&&(e+=o),t.indexOf(e)===0}a(Ars,"isEqualOrParent");function cVt(t){return t>=65&&t<=90||t>=97&&t<=122}a(cVt,"isWindowsDriveLetter");function yrs(t,e){return mj.isWindows&&t.endsWith(":")&&(t+=bg.sep),(0,bg.isAbsolute)(t)||(t=(0,bg.join)(e,t)),t=(0,bg.normalize)(t),Kwn(t)}a(yrs,"sanitizeFilePath");function Kwn(t){return mj.isWindows?(t=(0,GXe.rtrim)(t,bg.sep),t.endsWith(":")&&(t+=bg.sep)):(t=(0,GXe.rtrim)(t,bg.sep),t||(t=bg.sep)),t}a(Kwn,"removeTrailingPathSeparator");function _rs(t){let e=(0,bg.normalize)(t);return mj.isWindows?t.length>3?!1:lVt(e)&&(t.length===2||e.charCodeAt(2)===92):e===bg.posix.sep}a(_rs,"isRootOrDriveLetter");function lVt(t,e=mj.isWindows){return e?cVt(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(lVt,"hasDriveLetter");function Ers(t,e=mj.isWindows){return lVt(t,e)?t[0]:void 0}a(Ers,"getDriveLetter");function vrs(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(vrs,"indexOfPath");function Crs(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,crs.isNumber)(c)?n===void 0?n=c:o===void 0&&(o=c):r=r?[r,s].join(":"):s}if(!r)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:r,line:n!==void 0?n:void 0,column:o!==void 0?o:n!==void 0?1:void 0}}a(Crs,"parseLineAndColumnAware");var brs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Srs="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function Trs(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var Irs=Pw&&Pw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xrs=Pw&&Pw.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wrs=Pw&&Pw.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0?` Found '${r[0][0]}' at index ${r[0].index} (${r.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${n} (len:${t.scheme.length})`)}if(t.path){if(t.authority){if(!krs.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Prs.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(Drs,"_validateUri");function Nrs(t,e){return!t&&!e?"file":t}a(Nrs,"_schemeFix");function Mrs(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==I2&&(e=I2+e):e=I2;break}return e}a(Mrs,"_referenceResolution");var ru="",I2="/",Ors=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,WXe=class t{static{a(this,"URI")}static isUri(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,r,n,o,s,c=!1){typeof e=="object"?(this.scheme=e.scheme||ru,this.authority=e.authority||ru,this.path=e.path||ru,this.query=e.query||ru,this.fragment=e.fragment||ru):(this.scheme=Nrs(e,c),this.authority=r||ru,this.path=Mrs(this.scheme,n||ru),this.query=o||ru,this.fragment=s||ru,Drs(this,c))}get fsPath(){return zXe(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=ru),n===void 0?n=this.authority:n===null&&(n=ru),o===void 0?o=this.path:o===null&&(o=ru),s===void 0?s=this.query:s===null&&(s=ru),c===void 0?c=this.fragment:c===null&&(c=ru),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new gj(r,n,o,s,c)}static parse(e,r=!1){let n=Ors.exec(e);return n?new gj(n[2]||ru,$Xe(n[4]||ru),$Xe(n[5]||ru),$Xe(n[7]||ru),$Xe(n[9]||ru),r):new gj(ru,ru,ru,ru,ru)}static file(e){let r=ru;if(VXe.isWindows&&(e=e.replace(/\\/g,I2)),e[0]===I2&&e[1]===I2){let n=e.indexOf(I2,2);n===-1?(r=e.substring(2),e=I2):(r=e.substring(2,n),e=e.substring(n)||I2)}return new gj("file",r,e,ru,ru)}static from(e,r){return new gj(e.scheme,e.authority,e.path,e.query,e.fragment,r)}static joinPath(e,...r){if(!e.path)throw new Error(`[UriError]: cannot call joinPath on URI without path: ${e.toString()}`);let n;return VXe.isWindows&&e.scheme==="file"?n=t.file(Jwn.win32.join(zXe(e,!0),...r)).path:n=Jwn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return dVt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new gj(e);return r._formatted=e.external??null,r._fsPath=e._sep===eRn?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};Pw.URI=WXe;function Lrs(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}a(Lrs,"isUriComponents");var eRn=VXe.isWindows?1:void 0,gj=class extends WXe{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=zXe(this,!1)),this._fsPath}toString(e=!1){return e?dVt(this,!0):(this._formatted||(this._formatted=dVt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=eRn),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},tRn={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function Zwn(t,e,r){let n,o=-1;for(let s=0;s=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||e&&c===47||r&&c===91||r&&c===93||r&&c===58)o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n!==void 0&&(n+=t.charAt(s));else{n===void 0&&(n=t.substr(0,s));let l=tRn[c];l!==void 0?(o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n+=l):o===-1&&(o=s)}}return o!==-1&&(n+=encodeURIComponent(t.substring(o))),n!==void 0?n:t}a(Zwn,"encodeURIComponentFast");function Brs(t){let e;for(let r=0;r1&&t.scheme==="file"?r=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?r=t.path.substr(1):r=t.path[1].toLowerCase()+t.path.substr(2):r=t.path,VXe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(zXe,"uriToFsPath");function dVt(t,e){let r=e?Brs:Zwn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=I2,n+=I2),s){let d=s.indexOf("@");if(d!==-1){let f=s.substr(0,d);s=s.substr(d+1),d=f.lastIndexOf(":"),d===-1?n+=r(f,!1,!1):(n+=r(f.substr(0,d),!1,!1),n+=":",n+=r(f.substr(d+1),!1,!0)),n+="@"}s=s.toLowerCase(),d=s.lastIndexOf(":"),d===-1?n+=r(s,!1,!0):(n+=r(s.substr(0,d),!1,!0),n+=s.substr(d))}if(c){if(c.length>=3&&c.charCodeAt(0)===47&&c.charCodeAt(2)===58){let d=c.charCodeAt(1);d>=65&&d<=90&&(c=`/${String.fromCharCode(d+32)}:${c.substr(3)}`)}else if(c.length>=2&&c.charCodeAt(1)===58){let d=c.charCodeAt(0);d>=65&&d<=90&&(c=`${String.fromCharCode(d+32)}:${c.substr(2)}`)}n+=r(c,!0,!1)}return l&&(n+="?",n+=r(l,!1,!1)),u&&(n+="#",n+=e?u:Zwn(u,!1,!1)),n}a(dVt,"_asFormatted");function rRn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+rRn(t.substr(3)):t}}a(rRn,"decodeURIComponentGraceful");var Xwn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function $Xe(t){return t.match(Xwn)?t.replace(Xwn,e=>rRn(e)):t}a($Xe,"percentDecode")});var eZ=I(Es=>{"use strict";p();var Frs=Es&&Es.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Urs=Es&&Es.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gVt=Es&&Es.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ooRn(t,r))}a(qrs,"matchesSomeScheme");Es.connectionTokenCookieName="vscode-tkn";Es.connectionTokenQueryName="tkn";var hVt=class{static{a(this,"RemoteAuthoritiesImpl")}constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,r){this._serverRootPath=pVt.posix.join(r??"/",sRn(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return pVt.posix.join(this._serverRootPath,v5.vscodeRemoteResource)}set(e,r,n){this._hosts[e]=r,this._ports[e]=n}setConnectionToken(e,r){this._connectionTokens[e]=r}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(l){return Qrs.onUnexpectedExternalError(l),e}let r=e.authority,n=this._hosts[r];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);let o=this._ports[r],s=this._connectionTokens[r],c=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(c+=`&${Es.connectionTokenQueryName}=${encodeURIComponent(s)}`),XJ.URI.from({scheme:fVt.isWeb?this._preferredWebSchema:v5.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};Es.RemoteAuthorities=new hVt;function sRn(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(sRn,"getServerProductSegment");Es.builtinExtensionsPath="vs/../../extensions";Es.nodeModulesPath="vs/../../node_modules";Es.nodeModulesAsarPath="vs/../../node_modules.asar";Es.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";Es.VSCODE_AUTHORITY="vscode-app";var mVt=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=Es.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===v5.vscodeRemote?Es.RemoteAuthorities.rewrite(e):e.scheme===v5.file&&(fVt.isNative||fVt.webWorkerOrigin===`${v5.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:v5.vscodeFileResource,authority:e.authority||t.FALLBACK_AUTHORITY,query:null,fragment:null}):e}asFileUri(e){let r=this.toUri(e);return this.uriToFileUri(r)}uriToFileUri(e){return e.scheme===v5.vscodeFileResource?e.with({scheme:v5.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(XJ.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return XJ.URI.joinPath(XJ.URI.parse(r,!0),e);let n=pVt.join(r,e);return XJ.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};Es.FileAccess=new mVt;Es.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});Es.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var iRn;(function(t){let e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);t.CoopAndCoep=Object.freeze(e.get("3"));let r="vscode-coi";function n(s){let c;typeof s=="string"?c=new URL(s).searchParams:s instanceof URL?c=s.searchParams:XJ.URI.isUri(s)&&(c=new URL(s.toString(!0)).searchParams);let l=c?.get(r);if(l)return e.get(l)}a(n,"getHeadersFromQuery"),t.getHeadersFromQuery=n;function o(s,c,l){if(!globalThis.crossOriginIsolated)return;let u=c&&l?"3":l?"2":"1";s instanceof URLSearchParams?s.set(r,u):s[r]=u}a(o,"addSearchParam"),t.addSearchParam=o})(iRn||(Es.COI=iRn={}))});var x2=I(Cr=>{"use strict";p();var jrs=Cr&&Cr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hrs=Cr&&Cr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lRn=Cr&&Cr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oIde.getRoot(n).length&&n[n.length-1]===r}else{let n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,r=fv.sep){return(0,Cr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,r=fv.sep){let n=!1;if(e.scheme===Aj.Schemas.file){let o=C5(e);n=o!==void 0&&o.length===Ide.getRoot(o).length&&o[o.length-1]===r}else{r="/";let o=e.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!(0,Cr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path+"/"}):e}};Cr.ExtUri=xde;Cr.extUri=new xde(()=>!1);Cr.extUriBiasedIgnorePathCase=new xde(t=>t.scheme===Aj.Schemas.file?!uRn.isLinux:!0);Cr.extUriIgnorePathCase=new xde(t=>!0);Cr.isEqual=Cr.extUri.isEqual.bind(Cr.extUri);Cr.isEqualOrParent=Cr.extUri.isEqualOrParent.bind(Cr.extUri);Cr.getComparisonKey=Cr.extUri.getComparisonKey.bind(Cr.extUri);Cr.basenameOrAuthority=Cr.extUri.basenameOrAuthority.bind(Cr.extUri);Cr.basename=Cr.extUri.basename.bind(Cr.extUri);Cr.extname=Cr.extUri.extname.bind(Cr.extUri);Cr.dirname=Cr.extUri.dirname.bind(Cr.extUri);Cr.joinPath=Cr.extUri.joinPath.bind(Cr.extUri);Cr.normalizePath=Cr.extUri.normalizePath.bind(Cr.extUri);Cr.relativePath=Cr.extUri.relativePath.bind(Cr.extUri);Cr.resolvePath=Cr.extUri.resolvePath.bind(Cr.extUri);Cr.isAbsolutePath=Cr.extUri.isAbsolutePath.bind(Cr.extUri);Cr.isEqualAuthority=Cr.extUri.isEqualAuthority.bind(Cr.extUri);Cr.hasTrailingPathSeparator=Cr.extUri.hasTrailingPathSeparator.bind(Cr.extUri);Cr.removeTrailingPathSeparator=Cr.extUri.removeTrailingPathSeparator.bind(Cr.extUri);Cr.addTrailingPathSeparator=Cr.extUri.addTrailingPathSeparator.bind(Cr.extUri);function Grs(t,e){let r=[];for(let n=0;nc===n?!1:(0,Cr.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(Grs,"distinctParents");var cRn;(function(t){t.META_DATA_LABEL="label",t.META_DATA_DESCRIPTION="description",t.META_DATA_SIZE="size",t.META_DATA_MIME="mime";function e(r){let n=new Map;r.path.substring(r.path.indexOf(";")+1,r.path.lastIndexOf(";")).split(";").forEach(c=>{let[l,u]=c.split(":");l&&u&&n.set(l,u)});let s=r.path.substring(0,r.path.indexOf(";"));return s&&n.set(t.META_DATA_MIME,s),n}a(e,"parseMetaData"),t.parseMetaData=e})(cRn||(Cr.DataUri=cRn={}));function $rs(t,e,r){if(e){let n=t.path;return n&&n[0]!==fv.posix.sep&&(n=fv.posix.sep+n),t.with({scheme:r,authority:e,path:n})}return t.with({scheme:r})}a($rs,"toLocalResource")});var dRn=I(YXe=>{"use strict";p();Object.defineProperty(YXe,"__esModule",{value:!0});YXe.MicrotaskDelay=void 0;YXe.MicrotaskDelay=Symbol("MicrotaskDelay")});var pl=I(Yt=>{"use strict";p();Object.defineProperty(Yt,"__esModule",{value:!0});Yt.AsyncReader=Yt.AsyncReaderEndOfStream=Yt.CancelableAsyncIterableProducer=Yt.AsyncIterableProducer=Yt.AsyncIterableSource=Yt.AsyncIterableObject=Yt.LazyStatefulPromise=Yt.StatefulPromise=Yt.Promises=Yt.DeferredPromise=Yt.IntervalCounter=Yt.TaskSequentializer=Yt.GlobalIdleValue=Yt.AbstractIdleValue=Yt._runWhenIdle=Yt.runWhenGlobalIdle=Yt.ThrottledWorker=Yt.RunOnceWorker=Yt.ProcessTimeRunOnceScheduler=Yt.RunOnceScheduler=Yt.IntervalTimer=Yt.TimeoutTimer=Yt.TaskQueue=Yt.ResourceQueue=Yt.LimitedQueue=Yt.Queue=Yt.Limiter=Yt.AutoOpenBarrier=Yt.Barrier=Yt.ThrottledDelayer=Yt.Delayer=Yt.SequencerByKey=Yt.Sequencer=Yt.Throttler=void 0;Yt.isThenable=hRn;Yt.createCancelablePromise=mRn;Yt.raceCancellation=gRn;Yt.raceCancellationError=Yrs;Yt.rejectIfNotCanceled=Krs;Yt.notCancellablePromise=Jrs;Yt.raceCancellablePromises=Zrs;Yt.raceTimeout=ARn;Yt.asPromise=Xrs;Yt.promiseWithResolvers=yRn;Yt.timeout=LVt;Yt.disposableTimeout=rns;Yt.sequence=nns;Yt.first=ins;Yt.firstParallel=ons;Yt.installFakeRunWhenIdle=sns;Yt.retry=ans;Yt.createCancelableAsyncIterableProducer=cns;Yt.cancellableIterable=lns;Yt.createTimeout=uns;var OVt=S2(),pv=Os(),$Re=Fc(),yj=Po(),fRn=x2(),Vrs=pj(),Wrs=dRn(),zrs=MF();function hRn(t){return!!t&&typeof t.then=="function"}a(hRn,"isThenable");function mRn(t){let e=new OVt.CancellationTokenSource,r=t(e.token),n=!1,o=new Promise((s,c)=>{let l=e.token.onCancellationRequested(()=>{n=!0,l.dispose(),c(new pv.CancellationError)});Promise.resolve(r).then(u=>{l.dispose(),e.dispose(),n?(0,yj.isDisposable)(u)&&u.dispose():s(u)},u=>{l.dispose(),e.dispose(),c(u)})});return new class{cancel(){e.cancel(),e.dispose()}then(s,c){return o.then(s,c)}catch(s){return this.then(void 0,s)}finally(s){return o.finally(s)}}}a(mRn,"createCancelablePromise");function gRn(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(gRn,"raceCancellation");function Yrs(t,e){return new Promise((r,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new pv.CancellationError)});t.then(r,n).finally(()=>o.dispose())})}a(Yrs,"raceCancellationError");function Krs(t){if(!(0,pv.isCancellationError)(t))return Promise.reject(t)}a(Krs,"rejectIfNotCanceled");function Jrs(t){return new Promise((e,r)=>{t.then(e,r)})}a(Jrs,"notCancellablePromise");function Zrs(t){let e=-1,r=t.map((o,s)=>o.then(c=>(e=s,c))),n=Promise.race(r);return n.cancel=()=>{t.forEach((o,s)=>{s!==e&&o.cancel&&o.cancel()})},n.finally(()=>{n.cancel()}),n}a(Zrs,"raceCancellablePromises");function ARn(t,e,r){let n,o=setTimeout(()=>{n?.(void 0),r?.()},e);return Promise.race([t.finally(()=>clearTimeout(o)),new Promise(s=>n=s)])}a(ARn,"raceTimeout");function Xrs(t){return new Promise((e,r)=>{let n=t();hRn(n)?n.then(e,r):e(n)})}a(Xrs,"asPromise");function yRn(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(yRn,"promiseWithResolvers");var KXe=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new OVt.CancellationTokenSource}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let r=a(()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n},"onComplete");this.queuedPromise=new Promise(n=>{this.activePromise.then(r,r).then(n)})}return new Promise((r,n)=>{this.queuedPromise.then(r,n)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((r,n)=>{this.activePromise.then(o=>{this.activePromise=null,r(o)},o=>{this.activePromise=null,n(o)})})}dispose(){this.cancellationTokenSource.cancel()}};Yt.Throttler=KXe;var AVt=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Yt.Sequencer=AVt;var yVt=class{static{a(this,"SequencerByKey")}constructor(){this.promiseMap=new Map}queue(e,r){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}};Yt.SequencerByKey=yVt;var ens=a((t,e)=>{let r=!0,n=setTimeout(()=>{r=!1,e()},t);return{isTriggered:a(()=>r,"isTriggered"),dispose:a(()=>{clearTimeout(n),r=!1},"dispose")}},"timeoutDeferred"),tns=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),JXe=class{static{a(this,"Delayer")}constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,r=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((o,s)=>{this.doResolve=o,this.doReject=s}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let o=this.task;return this.task=null,o()}}));let n=a(()=>{this.deferred=null,this.doResolve?.(null)},"fn");return this.deferred=r===Wrs.MicrotaskDelay?tns(n):ens(r,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new pv.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};Yt.Delayer=JXe;var _Vt=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new JXe(e),this.throttler=new KXe}trigger(e,r){return this.delayer.trigger(()=>this.throttler.queue(e),r)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};Yt.ThrottledDelayer=_Vt;var ZXe=class{static{a(this,"Barrier")}constructor(){this._isOpen=!1,this._promise=new Promise((e,r)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};Yt.Barrier=ZXe;var EVt=class extends ZXe{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Yt.AutoOpenBarrier=EVt;function LVt(t,e){return e?new Promise((r,n)=>{let o=setTimeout(()=>{s.dispose(),r()},t),s=e.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new pv.CancellationError)})}):mRn(r=>LVt(t,r))}a(LVt,"timeout");function rns(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,yj.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(rns,"disposableTimeout");function nns(t){let e=[],r=0,n=t.length;function o(){return r!!n,r=null){let n=0,o=t.length,s=a(()=>{if(n>=o)return Promise.resolve(r);let c=t[n++];return Promise.resolve(c()).then(u=>e(u)?Promise.resolve(u):s())},"loop");return s()}a(ins,"first");function ons(t,e=n=>!!n,r=null){if(t.length===0)return Promise.resolve(r);let n=t.length,o=a(()=>{n=-1;for(let s of t)s.cancel?.()},"finish");return new Promise((s,c)=>{for(let l of t)l.then(u=>{--n>=0&&e(u)?(o(),s(u)):n===0&&s(r)}).catch(u=>{--n>=0&&(o(),c(u))})})}a(ons,"firstParallel");var XXe=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new $Re.Emitter}whenIdle(){return this.size>0?$Re.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((r,n)=>{this.outstandingPromises.push({factory:e,c:r,e:n}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}};Yt.Limiter=XXe;var eet=class extends XXe{static{a(this,"Queue")}constructor(){super(1)}};Yt.Queue=eet;var vVt=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new ret,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};Yt.LimitedQueue=vVt;var CVt=class{static{a(this,"ResourceQueue")}constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new LF;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,r=fRn.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=fRn.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new eet;let c=this.drainListenerCount++,l=$Re.Event.once(s.onDrained)(()=>{s?.dispose(),this.queues.delete(o),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(c),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new yj.DisposableMap),this.drainListeners.set(c,l),this.queues.set(o,s)}return s.queue(r)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}};Yt.ResourceQueue=CVt;var bVt=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new LF;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new LF;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),r.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new pv.BugIndicatingError;this._runningTask=e.task;try{let r=await e.task();e.deferred.complete(r)}catch(r){e.deferred.error(r)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let r of e)r.setUndefinedWhenCleared?r.deferred.complete(void 0):r.deferred.error(new pv.CancellationError)}};Yt.TaskQueue=bVt;var SVt=class{static{a(this,"TimeoutTimer")}constructor(e,r){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,r){if(this._isDisposed)throw new pv.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new pv.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},r))}};Yt.TimeoutTimer=SVt;var TVt=class{static{a(this,"IntervalTimer")}constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,r,n=globalThis){if(this.isDisposed)throw new pv.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},r);this.disposable=(0,yj.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Yt.IntervalTimer=TVt;var VRe=class{static{a(this,"RunOnceScheduler")}constructor(e,r){this.timeoutToken=void 0,this.runner=e,this.timeout=r,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};Yt.RunOnceScheduler=VRe;var IVt=class{static{a(this,"ProcessTimeRunOnceScheduler")}constructor(e,r){r%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${r}ms is not a multiple of 1000ms.`),this.runner=e,this.timeout=r,this.counter=0,this.intervalToken=void 0,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=void 0)}schedule(e=this.timeout){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(e/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==void 0}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=void 0,this.runner?.())}};Yt.ProcessTimeRunOnceScheduler=IVt;var xVt=class extends VRe{static{a(this,"RunOnceWorker")}constructor(e,r){super(e,r),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){let e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}};Yt.RunOnceWorker=xVt;var wVt=class extends yj.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new yj.MutableDisposable),this.disposed=!1,this.lastExecutionTime=0}get pending(){return this.pendingWork.length}work(e){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+e.length>this.options.maxBufferedWork)return!1}else if(this.pending+e.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(let n of e)this.pendingWork.push(n);let r=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||r>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-r,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(e=this.options.throttleDelay){this.throttler.value=new VRe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Yt.ThrottledWorker=wVt;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Yt._runWhenIdle=(e,r,n)=>{(0,Vrs.setTimeout0)(()=>{if(o)return;let s=Date.now()+15;r(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let o=!1;return{dispose(){o||(o=!0)}}}:Yt._runWhenIdle=(e,r,n)=>{let o=e.requestIdleCallback(r,typeof n=="number"?{timeout:n}:void 0),s=!1;return{dispose(){s||(s=!0,e.cancelIdleCallback(o))}}},Yt.runWhenGlobalIdle=(e,r)=>(0,Yt._runWhenIdle)(globalThis,e,r)})();function sns(t){let e=Yt._runWhenIdle,r=Yt.runWhenGlobalIdle;return Yt._runWhenIdle=t,Yt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,yj.toDisposable)(()=>{Yt._runWhenIdle=e,Yt.runWhenGlobalIdle=r})}a(sns,"installFakeRunWhenIdle");var tet=class{static{a(this,"AbstractIdleValue")}constructor(e,r){this._didRun=!1,this._executor=()=>{try{this._value=r()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=(0,Yt._runWhenIdle)(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}};Yt.AbstractIdleValue=tet;var RVt=class extends tet{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Yt.GlobalIdleValue=RVt;async function ans(t,e,r){let n;for(let o=0;on?.(),"cancel"),promise:r},r.then(()=>this.doneRunning(e),()=>this.doneRunning(e)),r}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){let e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{let{promise:r,resolve:n,reject:o}=yRn();this._queued={run:e,promise:r,promiseResolve:n,promiseReject:o}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}};Yt.TaskSequentializer=ret;var kVt=class{static{a(this,"IntervalCounter")}constructor(e,r=()=>Date.now()){this.interval=e,this.nowFn=r,this.lastIncrementTime=0,this.value=0}increment(){let e=this.nowFn();return e-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=e,this.value=0),this.value++,this.value}};Yt.IntervalCounter=kVt;var LF=class t{static{a(this,"DeferredPromise")}static fromPromise(e){let r=new t;return r.settleWith(e),r}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,r)=>{this.completeCallback=e,this.errorCallback=r})}complete(e){return this.isSettled?Promise.resolve():new Promise(r=>{this.completeCallback(e),this.outcome={outcome:0,value:e},r()})}error(e){return this.isSettled?Promise.resolve():new Promise(r=>{this.errorCallback(e),this.outcome={outcome:1,value:e},r()})}settleWith(e){return e.then(r=>this.complete(r),r=>this.error(r))}cancel(){return this.error(new pv.CancellationError)}};Yt.DeferredPromise=LF;var pRn;(function(t){async function e(n){let o,s=await Promise.all(n.map(c=>c.then(l=>l,l=>{o||(o=l)})));if(typeof o<"u")throw o;return s}a(e,"settled"),t.settled=e;function r(n){return new Promise(async(o,s)=>{try{await n(o,s)}catch(c){s(c)}})}a(r,"withAsyncBody"),t.withAsyncBody=r})(pRn||(Yt.Promises=pRn={}));var net=class{static{a(this,"StatefulPromise")}get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then(r=>(this._value=r,this._isResolved=!0,r),r=>{throw this._error=r,this._isResolved=!0,r})}requireValue(){if(!this._isResolved)throw new pv.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};Yt.StatefulPromise=net;var PVt=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new zrs.Lazy(()=>new net(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Yt.LazyStatefulPromise=PVt;var iet=class t{static{a(this,"AsyncIterableObject")}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new $Re.Emitter,queueMicrotask(async()=>{let n={emitOne:a(o=>this.emitOne(o),"emitOne"),emitMany:a(o=>this.emitMany(o),"emitMany"),reject:a(o=>this.reject(o),"reject")};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=()=>{},n.emitMany=()=>{},n.reject=()=>{}}})}[Symbol.asyncIterator](){let e=0;return{next:a(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}map(e){return t.map(this,e)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static async toPromise(e){let r=[];for await(let n of e)r.push(n);return r}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Yt.AsyncIterableObject=iet;function cns(t){let e=new OVt.CancellationTokenSource,r=t(e.token);return new set(e,async n=>{let o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),n.reject(new pv.CancellationError)});try{for await(let s of r){if(e.token.isCancellationRequested)return;n.emitOne(s)}o.dispose(),e.dispose()}catch(s){o.dispose(),e.dispose(),n.reject(s)}})}a(cns,"createCancelableAsyncIterableProducer");var DVt=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new LF,this._asyncIterable=new iet(o=>{if(r){o.reject(r);return}return n&&o.emitMany(n),this._errorFn=s=>o.reject(s),this._emitOneFn=s=>o.emitOne(s),this._emitManyFn=s=>o.emitMany(s),this._deferred.p},e);let r,n;this._errorFn=o=>{r||(r=o)},this._emitOneFn=o=>{n||(n=[]),n.push(o)},this._emitManyFn=o=>{n?o.forEach(s=>n.push(s)):n=o.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}};Yt.AsyncIterableSource=DVt;function lns(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await gRn(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a(lns,"cancellableIterable");var NVt=class{static{a(this,"ProducerConsumer")}constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let r=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(r,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let r of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(r,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new pv.BugIndicatingError("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,r){r.ok?e.complete(r.value):e.error(r.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new LF;return this._unsatisfiedConsumers.push(e),e.p}}},oet=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new NVt,this._iterator={next:a(()=>this._producerConsumer.consume(),"next"),return:a(()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),"return"),throw:a(async n=>(this._finishError(n),{done:!0,value:void 0}),"throw")},queueMicrotask(async()=>{let n=e({emitOne:a(o=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}}),"emitOne"),emitMany:a(o=>{for(let s of o)this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}})},"emitMany"),reject:a(o=>this._finishError(o),"reject")});if(!this._producerConsumer.hasFinalValue)try{await n,this._finishOk()}catch(o){this._finishError(o)}})}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}static tee(e){let r,n,o=new LF,s=a(async()=>{if(!(!r||!n))try{for await(let u of e)r.emitOne(u),n.emitOne(u)}catch(u){r.reject(u),n.reject(u)}finally{o.complete()}},"start"),c=new t(async u=>(r=u,s(),o.p)),l=new t(async u=>(n=u,s(),o.p));return[c,l]}map(e){return t.map(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};Yt.AsyncIterableProducer=oet;var set=class extends oet{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Yt.CancelableAsyncIterableProducer=set;Yt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var MVt=class{static{a(this,"AsyncReader")}get endOfStream(){return this._buffer.length===0&&this._atEnd}constructor(e){this._source=e,this._buffer=[],this._atEnd=!1}async read(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?Yt.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,r){do{let n=await this.peek();if(n===Yt.AsyncReaderEndOfStream||!e(n))break;await this.read(),await r(n)}while(!0)}readBufferedOrThrow(){let e=this.peekBufferedOrThrow();return this._buffer.shift(),e}async consumeToEnd(){for(;!this.endOfStream;)await this.read()}async peek(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?Yt.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return Yt.AsyncReaderEndOfStream;throw new pv.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await ARn(this._extendBuffer(),e),this._atEnd)return Yt.AsyncReaderEndOfStream;if(this._buffer.length!==0)return this._buffer[0]}_extendBuffer(){return this._atEnd?Promise.resolve():(this._extendBufferPromise||(this._extendBufferPromise=(async()=>{let{value:e,done:r}=await this._source.next();this._extendBufferPromise=void 0,r?this._atEnd=!0:this._buffer.push(e)})()),this._extendBufferPromise)}};Yt.AsyncReader=MVt;function uns(t,e){let r=setTimeout(e,t);return(0,yj.toDisposable)(()=>clearTimeout(r))}a(uns,"createTimeout")});var IRn=I(bT=>{"use strict";p();var mns=bT&&bT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bT,"__esModule",{value:!0});var gns=require("fs"),Ans=mns(YP()),Rde=Ans.default("@kwsites/file-exists");function yns(t,e,r){Rde("checking %s",t);try{let n=gns.statSync(t);return n.isFile()&&e?(Rde("[OK] path represents a file"),!0):n.isDirectory()&&r?(Rde("[OK] path represents a directory"),!0):(Rde("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Rde("[FAIL] path is not accessible: %o",n),!1;throw Rde("[FATAL] %o",n),n}}a(yns,"check");function _ns(t,e=bT.READABLE){return yns(t,(e&bT.FILE)>0,(e&bT.FOLDER)>0)}a(_ns,"exists");bT.exists=_ns;bT.FILE=1;bT.FOLDER=2;bT.READABLE=bT.FILE+bT.FOLDER});var xRn=I(pet=>{"use strict";p();function Ens(t){for(var e in t)pet.hasOwnProperty(e)||(pet[e]=t[e])}a(Ens,"__export");Object.defineProperty(pet,"__esModule",{value:!0});Ens(IRn())});var RRn=I((MTd,wRn)=>{p();var Dde=1e3,Nde=Dde*60,Mde=Nde*60,tZ=Mde*24,vns=tZ*7,Cns=tZ*365.25;wRn.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return bns(t);if(r==="number"&&isFinite(t))return e.long?Tns(t):Sns(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function bns(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Cns;case"weeks":case"week":case"w":return r*vns;case"days":case"day":case"d":return r*tZ;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Mde;case"minutes":case"minute":case"mins":case"min":case"m":return r*Nde;case"seconds":case"second":case"secs":case"sec":case"s":return r*Dde;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(bns,"parse");function Sns(t){var e=Math.abs(t);return e>=tZ?Math.round(t/tZ)+"d":e>=Mde?Math.round(t/Mde)+"h":e>=Nde?Math.round(t/Nde)+"m":e>=Dde?Math.round(t/Dde)+"s":t+"ms"}a(Sns,"fmtShort");function Tns(t){var e=Math.abs(t);return e>=tZ?het(t,e,tZ,"day"):e>=Mde?het(t,e,Mde,"hour"):e>=Nde?het(t,e,Nde,"minute"):e>=Dde?het(t,e,Dde,"second"):t+" ms"}a(Tns,"fmtLong");function het(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(het,"plural")});var QVt=I((BTd,kRn)=>{p();function Ins(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=RRn(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let k=r.formatters[x];if(typeof k=="function"){let D=_[T];R=k.call(E,D),_.splice(T,1),T--}return R}),r.formatArgs.call(E,_),(E.log||r.log).apply(E,_)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(_=>{m=_},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(" ",",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}a(o,"enable");function s(f,h){let m=0,g=0,A=-1,y=0;for(;m"-"+h)].join(",");return r.enable(""),f}a(c,"disable");function l(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}a(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}a(u,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(d,"destroy"),r.enable(r.load()),r}a(Ins,"setup");kRn.exports=Ins});var PRn=I((ST,met)=>{p();ST.formatArgs=wns;ST.save=Rns;ST.load=kns;ST.useColors=xns;ST.storage=Pns();ST.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();ST.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function xns(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(xns,"useColors");function wns(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+met.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(wns,"formatArgs");ST.log=console.debug||console.log||(()=>{});function Rns(t){try{t?ST.storage.setItem("debug",t):ST.storage.removeItem("debug")}catch{}}a(Rns,"save");function kns(){let t;try{t=ST.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(kns,"load");function Pns(){try{return localStorage}catch{}}a(Pns,"localstorage");met.exports=QVt()(ST);var{formatters:Dns}=met.exports;Dns.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var NRn=I((P0,Aet)=>{p();var Nns=require("tty"),get=require("util");P0.init=Qns;P0.log=Bns;P0.formatArgs=Ons;P0.save=Fns;P0.load=Uns;P0.useColors=Mns;P0.destroy=get.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");P0.colors=[6,2,3,4,5,1];try{let t=RVe();t&&(t.stderr||t).level>=2&&(P0.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}P0.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function Mns(){return"colors"in P0.inspectOpts?!!P0.inspectOpts.colors:Nns.isatty(process.stderr.fd)}a(Mns,"useColors");function Ons(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` `).join(` -`+s),t.push(o+"m+"+Aet.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Mns()+e+" "+t[0]}a(Nns,"formatArgs");function Mns(){return k0.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(Mns,"getDate");function Ons(...t){return process.stderr.write(get.formatWithOptions(k0.inspectOpts,...t)+` -`)}a(Ons,"log");function Lns(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(Lns,"save");function Bns(){return process.env.DEBUG}a(Bns,"load");function Fns(t){t.inspectOpts={};let e=Object.keys(k0.inspectOpts);for(let r=0;re.trim()).join(" ")};PRn.O=function(t){return this.inspectOpts.colors=this.useColors,get.inspect(t,this.inspectOpts)}});var NRn=I((jTd,QVt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?QVt.exports=kRn():QVt.exports=DRn()});var jVt=I(tZ=>{"use strict";p();Object.defineProperty(tZ,"__esModule",{value:!0});tZ.createDeferred=tZ.deferred=void 0;function qVt(){let t,e,r="pending";return{promise:new Promise((o,s)=>{t=o,e=s}),done(o){r==="pending"&&(r="resolved",t(o))},fail(o){r==="pending"&&(r="rejected",e(o))},get fulfilled(){return r!=="pending"},get status(){return r}}}a(qVt,"deferred");tZ.deferred=qVt;tZ.createDeferred=qVt;tZ.default=qVt});var $et=I(IT=>{"use strict";p();Object.defineProperty(IT,"__esModule",{value:!0});IT.deepClone=O2n;IT.deepFreeze=bas;IT.cloneAndChange=Sas;IT.mixin=B2n;IT.equals=ike;IT.safeStringify=Tas;IT.stableStringify=Ias;IT.distinct=xas;IT.getCaseInsensitive=was;IT.filter=Ras;IT.mapValues=kas;var Cj=CT();function O2n(t){if(!t||typeof t!="object"||t instanceof RegExp)return t;let e=Array.isArray(t)?[]:{};return Object.entries(t).forEach(([r,n])=>{e[r]=n&&typeof n=="object"?O2n(n):n}),e}a(O2n,"deepClone");function bas(t){if(!t||typeof t!="object")return t;let e=[t];for(;e.length>0;){let r=e.shift();Object.freeze(r);for(let n in r)if(L2n.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,Cj.isTypedArray)(o)&&e.push(o)}}return t}a(bas,"deepFreeze");var L2n=Object.prototype.hasOwnProperty;function Sas(t,e){return GWt(t,e,new Set)}a(Sas,"cloneAndChange");function GWt(t,e,r){if((0,Cj.isUndefinedOrNull)(t))return t;let n=e(t);if(typeof n<"u")return n;if(Array.isArray(t)){let o=[];for(let s of t)o.push(GWt(s,e,r));return o}if((0,Cj.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)L2n.call(t,s)&&(o[s]=GWt(t[s],e,r));return r.delete(t),o}return t}a(GWt,"_cloneAndChange");function B2n(t,e,r=!0){return(0,Cj.isObject)(t)?((0,Cj.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,Cj.isObject)(t[n])&&(0,Cj.isObject)(e[n])?B2n(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(B2n,"mixin");function ike(t,e){if(t===e)return!0;if(t==null||e===null||e===void 0||typeof t!=typeof e||typeof t!="object"||Array.isArray(t)!==Array.isArray(e))return!1;let r,n;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(r=0;r{if((0,Cj.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(Tas,"safeStringify");function Ias(t){if(t===void 0)return"undefined";try{return $Wt(t,new WeakSet)}catch{return""}}a(Ias,"stableStringify");function $Wt(t,e){if(t===null||typeof t!="object")return JSON.stringify(t)??"null";if(e.has(t))return'"[Circular]"';if(e.add(t),Array.isArray(t))return"["+t.map(o=>$Wt(o,e)).join(",")+"]";let r=Object.keys(t).sort(),n=[];for(let o of r){let s=t[o];s!==void 0&&n.push(JSON.stringify(o)+":"+$Wt(s,e))}return"{"+n.join(",")+"}"}a($Wt,"_stableStringify");function xas(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];ike(s,c)||(r[o]=c)}),r}a(xas,"distinct");function was(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(was,"getCaseInsensitive");function Ras(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(Ras,"filter");function kas(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(kas,"mapValues")});var gv=I(Vet=>{"use strict";p();Object.defineProperty(Vet,"__esModule",{value:!0});Vet.ErrorUtils=void 0;var Pas=$et(),F2n;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,Pas.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(F2n||(Vet.ErrorUtils=F2n={}))});var xT=I(Wet=>{"use strict";p();Object.defineProperty(Wet,"__esModule",{value:!0});Wet.Result=void 0;var VWt=gv(),U2n;(function(t){function e(c){return new WWt(c)}a(e,"ok"),t.ok=e;function r(c){return new zWt(c)}a(r,"error"),t.error=r;function n(c){return t.error(new Error(c))}a(n,"fromString"),t.fromString=n;function o(c){try{return t.ok(c())}catch(l){return t.error(VWt.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(VWt.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(U2n||(Wet.Result=U2n={}));var WWt=class t{static{a(this,"ResultOk")}constructor(e){this.val=e}map(e){return new t(e(this.val))}mapError(e){return this}flatMap(e){return e(this.val)}unwrap(){return this.val}unwrapOr(e){return this.val}isOk(){return!0}isError(){return!1}},zWt=class t{static{a(this,"ResultError")}constructor(e){this.err=e}map(e){return this}mapError(e){return new t(e(this.err))}flatMap(e){return this}unwrap(){throw this.err instanceof Error?this.err:VWt.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var ef=I((kuf,U4n)=>{p();U4n.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")}});var Rc=I((Duf,uLn)=>{"use strict";p();var Q4n=Symbol.for("undici.error.UND_ERR"),tf=class extends Error{static{a(this,"UndiciError")}constructor(e){super(e),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[Q4n]===!0}[Q4n]=!0},q4n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),snr=class extends tf{static{a(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[q4n]===!0}[q4n]=!0},j4n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),anr=class extends tf{static{a(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[j4n]===!0}[j4n]=!0},H4n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),cnr=class extends tf{static{a(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[H4n]===!0}[H4n]=!0},G4n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),lnr=class extends tf{static{a(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[G4n]===!0}[G4n]=!0},$4n=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),unr=class extends tf{static{a(this,"ResponseStatusCodeError")}constructor(e,r,n,o){super(e),this.name="ResponseStatusCodeError",this.message=e||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=o,this.status=r,this.statusCode=r,this.headers=n}static[Symbol.hasInstance](e){return e&&e[$4n]===!0}[$4n]=!0},V4n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),dnr=class extends tf{static{a(this,"InvalidArgumentError")}constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[V4n]===!0}[V4n]=!0},W4n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),fnr=class extends tf{static{a(this,"InvalidReturnValueError")}constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[W4n]===!0}[W4n]=!0},z4n=Symbol.for("undici.error.UND_ERR_ABORT"),fot=class extends tf{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[z4n]===!0}[z4n]=!0},Y4n=Symbol.for("undici.error.UND_ERR_ABORTED"),pnr=class extends fot{static{a(this,"RequestAbortedError")}constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[Y4n]===!0}[Y4n]=!0},K4n=Symbol.for("undici.error.UND_ERR_INFO"),hnr=class extends tf{static{a(this,"InformationalError")}constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[K4n]===!0}[K4n]=!0},J4n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),mnr=class extends tf{static{a(this,"RequestContentLengthMismatchError")}constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[J4n]===!0}[J4n]=!0},Z4n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),gnr=class extends tf{static{a(this,"ResponseContentLengthMismatchError")}constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[Z4n]===!0}[Z4n]=!0},X4n=Symbol.for("undici.error.UND_ERR_DESTROYED"),Anr=class extends tf{static{a(this,"ClientDestroyedError")}constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[X4n]===!0}[X4n]=!0},eLn=Symbol.for("undici.error.UND_ERR_CLOSED"),ynr=class extends tf{static{a(this,"ClientClosedError")}constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[eLn]===!0}[eLn]=!0},tLn=Symbol.for("undici.error.UND_ERR_SOCKET"),_nr=class extends tf{static{a(this,"SocketError")}constructor(e,r){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=r}static[Symbol.hasInstance](e){return e&&e[tLn]===!0}[tLn]=!0},rLn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),Enr=class extends tf{static{a(this,"NotSupportedError")}constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[rLn]===!0}[rLn]=!0},nLn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),vnr=class extends tf{static{a(this,"BalancedPoolMissingUpstreamError")}constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[nLn]===!0}[nLn]=!0},iLn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),Cnr=class extends Error{static{a(this,"HTTPParserError")}constructor(e,r,n){super(e),this.name="HTTPParserError",this.code=r?`HPE_${r}`:void 0,this.data=n?n.toString():void 0}static[Symbol.hasInstance](e){return e&&e[iLn]===!0}[iLn]=!0},oLn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),bnr=class extends tf{static{a(this,"ResponseExceededMaxSizeError")}constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[oLn]===!0}[oLn]=!0},sLn=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),Snr=class extends tf{static{a(this,"RequestRetryError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[sLn]===!0}[sLn]=!0},aLn=Symbol.for("undici.error.UND_ERR_RESPONSE"),Tnr=class extends tf{static{a(this,"ResponseError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[aLn]===!0}[aLn]=!0},cLn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),Inr=class extends tf{static{a(this,"SecureProxyConnectionError")}constructor(e,r,n){super(r,{cause:e,...n??{}}),this.name="SecureProxyConnectionError",this.message=r||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[cLn]===!0}[cLn]=!0},lLn=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),xnr=class extends tf{static{a(this,"MessageSizeExceededError")}constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[lLn]===!0}get[lLn](){return!0}};uLn.exports={AbortError:fot,HTTPParserError:Cnr,UndiciError:tf,HeadersTimeoutError:anr,HeadersOverflowError:cnr,BodyTimeoutError:lnr,RequestContentLengthMismatchError:mnr,ConnectTimeoutError:snr,ResponseStatusCodeError:unr,InvalidArgumentError:dnr,InvalidReturnValueError:fnr,RequestAbortedError:pnr,ClientDestroyedError:Anr,ClientClosedError:ynr,InformationalError:hnr,SocketError:_nr,NotSupportedError:Enr,ResponseContentLengthMismatchError:gnr,BalancedPoolMissingUpstreamError:vnr,ResponseExceededMaxSizeError:bnr,RequestRetryError:Snr,ResponseError:Tnr,SecureProxyConnectionError:Inr,MessageSizeExceededError:xnr}});var hot=I((Ouf,dLn)=>{"use strict";p();var pot={},wnr=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"];for(let t=0;t{"use strict";p();var{wellknownHeaderNames:fLn,headerNameLowerCasedRecord:z0s}=hot(),Rnr=class t{static{a(this,"TstNode")}value=null;left=null;middle=null;right=null;code;constructor(e,r,n){if(n===void 0||n>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(n))>127)throw new TypeError("key must be ascii string");e.length!==++n?this.middle=new t(e,r,n):this.value=r}add(e,r){let n=e.length;if(n===0)throw new TypeError("Unreachable");let o=0,s=this;for(;;){let c=e.charCodeAt(o);if(c>127)throw new TypeError("key must be ascii string");if(s.code===c)if(n===++o){s.value=r;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,r,o);break}else if(s.code=65&&(s|=32);o!==null;){if(s===o.code){if(r===++n)return o;o=o.middle;break}o=o.code{"use strict";p();var TPe=require("node:assert"),{kDestroyed:ALn,kBodyUsed:spe,kListeners:knr,kBody:gLn}=ef(),{IncomingMessage:Y0s}=require("node:http"),yot=require("node:stream"),K0s=require("node:net"),{Blob:J0s}=require("node:buffer"),Z0s=require("node:util"),{stringify:X0s}=require("node:querystring"),{EventEmitter:eAs}=require("node:events"),{InvalidArgumentError:B0}=Rc(),{headerNameLowerCasedRecord:tAs}=hot(),{tree:yLn}=mLn(),[rAs,nAs]=process.versions.node.split(".").map(t=>Number(t)),Aot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[gLn]=e,this[spe]=!1}async*[Symbol.asyncIterator](){TPe(!this[spe],"disturbed"),this[spe]=!0,yield*this[gLn]}};function iAs(t){return _ot(t)?(bLn(t)===0&&t.on("data",function(){TPe(!1)}),typeof t.readableDidRead!="boolean"&&(t[spe]=!1,eAs.prototype.on.call(t,"data",function(){this[spe]=!0})),t):t&&typeof t.pipeTo=="function"?new Aot(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&CLn(t)?new Aot(t):t}a(iAs,"wrapRequestBody");function oAs(){}a(oAs,"nop");function _ot(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(_ot,"isStream");function _Ln(t){if(t===null)return!1;if(t instanceof J0s)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}a(_Ln,"isBlobLike");function sAs(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=X0s(e);return r&&(t+="?"+r),t}a(sAs,"buildURL");function ELn(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(ELn,"isValidPort");function got(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(got,"isHttpOrHttpsPrefixed");function vLn(t){if(typeof t=="string"){if(t=new URL(t),!got(t.origin||t.protocol))throw new B0("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new B0("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&ELn(t.port)===!1)throw new B0("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new B0("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new B0("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new B0("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new B0("Invalid URL origin: the origin must be a string or null/undefined.");if(!got(t.origin||t.protocol))throw new B0("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!got(t.origin||t.protocol))throw new B0("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(vLn,"parseURL");function aAs(t){if(t=vLn(t),t.pathname!=="/"||t.search||t.hash)throw new B0("invalid url");return t}a(aAs,"parseOrigin");function cAs(t){if(t[0]==="["){let r=t.indexOf("]");return TPe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(cAs,"getHostname");function lAs(t){if(!t)return null;TPe(typeof t=="string");let e=cAs(t);return K0s.isIP(e)?"":e}a(lAs,"getServerName");function uAs(t){return JSON.parse(JSON.stringify(t))}a(uAs,"deepClone");function dAs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(dAs,"isAsyncIterable");function CLn(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(CLn,"isIterable");function bLn(t){if(t==null)return 0;if(_ot(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(_Ln(t))return t.size!=null?t.size:null;if(ILn(t))return t.byteLength}return null}a(bLn,"bodyLength");function SLn(t){return t&&!!(t.destroyed||t[ALn]||yot.isDestroyed?.(t))}a(SLn,"isDestroyed");function fAs(t,e){t==null||!_ot(t)||SLn(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===Y0s&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[ALn]=!0))}a(fAs,"destroy");var pAs=/timeout=(\d+)/;function hAs(t){let e=t.toString().match(pAs);return e?parseInt(e[1],10)*1e3:null}a(hAs,"parseKeepAliveTimeout");function TLn(t){return typeof t=="string"?tAs[t]??t.toLowerCase():yLn.lookup(t)??t.toString("latin1").toLowerCase()}a(TLn,"headerNameToString");function mAs(t){return yLn.lookup(t)??t.toString("latin1").toLowerCase()}a(mAs,"bufferToLowerCasedHeaderName");function gAs(t,e){e===void 0&&(e={});for(let r=0;rc.toString("utf8")):s.toString("utf8")}}return"content-length"in e&&"content-disposition"in e&&(e["content-disposition"]=Buffer.from(e["content-disposition"]).toString("latin1")),e}a(gAs,"parseHeaders");function AAs(t){let e=t.length,r=new Array(e),n=!1,o=-1,s,c,l=0;for(let u=0;u{r.close(),r.byobRequest?.respond(0)});else{let s=Buffer.isBuffer(o)?o:Buffer.from(o);s.byteLength&&r.enqueue(new Uint8Array(s))}return r.desiredSize>0},async cancel(r){await e.return()},type:"bytes"})}a(bAs,"ReadableStreamFrom");function SAs(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}a(SAs,"isFormDataLike");function TAs(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.addListener("abort",e),()=>t.removeListener("abort",e))}a(TAs,"addAbortListener");var IAs=typeof String.prototype.toWellFormed=="function",xAs=typeof String.prototype.isWellFormed=="function";function xLn(t){return IAs?`${t}`.toWellFormed():Z0s.toUSVString(t)}a(xLn,"toUSVString");function wAs(t){return xAs?`${t}`.isWellFormed():xLn(t)===`${t}`}a(wAs,"isUSVString");function wLn(t){switch(t){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return!1;default:return t>=33&&t<=126}}a(wLn,"isTokenCharCode");function RAs(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Xc=require("node:diagnostics_channel"),Nnr=require("node:util"),Eot=Nnr.debuglog("undici"),Dnr=Nnr.debuglog("fetch"),OZ=Nnr.debuglog("websocket"),DLn=!1,LAs={beforeConnect:Xc.channel("undici:client:beforeConnect"),connected:Xc.channel("undici:client:connected"),connectError:Xc.channel("undici:client:connectError"),sendHeaders:Xc.channel("undici:client:sendHeaders"),create:Xc.channel("undici:request:create"),bodySent:Xc.channel("undici:request:bodySent"),headers:Xc.channel("undici:request:headers"),trailers:Xc.channel("undici:request:trailers"),error:Xc.channel("undici:request:error"),open:Xc.channel("undici:websocket:open"),close:Xc.channel("undici:websocket:close"),socketError:Xc.channel("undici:websocket:socket_error"),ping:Xc.channel("undici:websocket:ping"),pong:Xc.channel("undici:websocket:pong")};if(Eot.enabled||Dnr.enabled){let t=Dnr.enabled?Dnr:Eot;Xc.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s using %s%s",`${s}${o?`:${o}`:""}`,n,r)}),Xc.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s using %s%s",`${s}${o?`:${o}`:""}`,n,r)}),Xc.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s using %s%s errored - %s",`${s}${o?`:${o}`:""}`,n,r,c.message)}),Xc.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s/%s",r,o,n)}),Xc.channel("undici:request:headers").subscribe(e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s/%s - HTTP %d",r,o,n,s)}),Xc.channel("undici:request:trailers").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s/%s",r,o,n)}),Xc.channel("undici:request:error").subscribe(e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s/%s errored - %s",r,o,n,s.message)}),DLn=!0}if(OZ.enabled){if(!DLn){let t=Eot.enabled?Eot:OZ;Xc.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),Xc.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),Xc.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),Xc.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s/%s",r,o,n)})}Xc.channel("undici:websocket:open").subscribe(t=>{let{address:{address:e,port:r}}=t;OZ("connection opened %s%s",e,r?`:${r}`:"")}),Xc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;OZ("closed connection to %s - %s %s",e.url,r,n)}),Xc.channel("undici:websocket:socket_error").subscribe(t=>{OZ("connection errored - %s",t.message)}),Xc.channel("undici:websocket:ping").subscribe(t=>{OZ("ping received")}),Xc.channel("undici:websocket:pong").subscribe(t=>{OZ("pong received")})}NLn.exports={channels:LAs}});var BLn=I(($uf,LLn)=>{"use strict";p();var{InvalidArgumentError:Mu,NotSupportedError:BAs}=Rc(),s8=require("node:assert"),{isValidHTTPToken:OLn,isValidHeaderValue:Mnr,isStream:FAs,destroy:UAs,isBuffer:QAs,isFormDataLike:qAs,isIterable:jAs,isBlobLike:HAs,buildURL:GAs,validateHandler:$As,getServerName:VAs,normalizedMethodRecords:WAs}=Ws(),{channels:G5}=ape(),{headerNameLowerCasedRecord:MLn}=hot(),zAs=/[^\u0021-\u00ff]/,Vw=Symbol("handler"),Onr=class{static{a(this,"Request")}constructor(e,{path:r,method:n,body:o,headers:s,query:c,idempotent:l,blocking:u,upgrade:d,headersTimeout:f,bodyTimeout:h,reset:m,throwOnError:g,expectContinue:A,servername:y},_){if(typeof r!="string")throw new Mu("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Mu("path must be an absolute URL or start with a slash");if(zAs.test(r))throw new Mu("invalid request path");if(typeof n!="string")throw new Mu("method must be a string");if(WAs[n]===void 0&&!OLn(n))throw new Mu("invalid request method");if(d&&typeof d!="string")throw new Mu("upgrade must be a string");if(d&&!Mnr(d))throw new Mu("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Mu("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Mu("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Mu("invalid reset");if(A!=null&&typeof A!="boolean")throw new Mu("invalid expectContinue");if(this.headersTimeout=f,this.bodyTimeout=h,this.throwOnError=g===!0,this.method=n,this.abort=null,o==null)this.body=null;else if(FAs(o)){this.body=o;let E=this.body._readableState;(!E||!E.autoDestroy)&&(this.endHandler=a(function(){UAs(this)},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=v=>{this.abort?this.abort(v):this.error=v},this.body.on("error",this.errorHandler)}else if(QAs(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if(typeof o=="string")this.body=o.length?Buffer.from(o):null;else if(qAs(o)||jAs(o)||HAs(o))this.body=o;else throw new Mu("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=d||null,this.path=c?GAs(r,c):r,this.origin=e,this.idempotent=l??(n==="HEAD"||n==="GET"),this.blocking=u??!1,this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=A??!1,Array.isArray(s)){if(s.length%2!==0)throw new Mu("headers array must be even");for(let E=0;E{"use strict";p();var YAs=require("node:events"),Cot=class extends YAs{static{a(this,"Dispatcher")}dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let r=Array.isArray(e[0])?e[0]:e,n=this.dispatch.bind(this);for(let o of r)if(o!=null){if(typeof o!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof o}`);if(n=o(n),n==null||typeof n!="function"||n.length!==2)throw new TypeError("invalid interceptor")}return new Lnr(this,n)}},Lnr=class extends Cot{static{a(this,"ComposedDispatcher")}#e=null;#t=null;constructor(e,r){super(),this.#e=e,this.#t=r}dispatch(...e){this.#t(...e)}close(...e){return this.#e.close(...e)}destroy(...e){return this.#e.destroy(...e)}};FLn.exports=Cot});var dpe=I((Juf,ULn)=>{"use strict";p();var KAs=IPe(),{ClientDestroyedError:Bnr,ClientClosedError:JAs,InvalidArgumentError:cpe}=Rc(),{kDestroy:ZAs,kClose:XAs,kClosed:xPe,kDestroyed:lpe,kDispatch:Fnr,kInterceptors:LZ}=ef(),a8=Symbol("onDestroyed"),upe=Symbol("onClosed"),bot=Symbol("Intercepted Dispatch"),Unr=class extends KAs{static{a(this,"DispatcherBase")}constructor(){super(),this[lpe]=!1,this[a8]=null,this[xPe]=!1,this[upe]=[]}get destroyed(){return this[lpe]}get closed(){return this[xPe]}get interceptors(){return this[LZ]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[LZ][r]!="function")throw new cpe("interceptor must be an function")}this[LZ]=e}close(e){if(e===void 0)return new Promise((n,o)=>{this.close((s,c)=>s?o(s):n(c))});if(typeof e!="function")throw new cpe("invalid callback");if(this[lpe]){queueMicrotask(()=>e(new Bnr,null));return}if(this[xPe]){this[upe]?this[upe].push(e):queueMicrotask(()=>e(null,null));return}this[xPe]=!0,this[upe].push(e);let r=a(()=>{let n=this[upe];this[upe]=null;for(let o=0;othis.destroy()).then(()=>{queueMicrotask(r)})}destroy(e,r){if(typeof e=="function"&&(r=e,e=null),r===void 0)return new Promise((o,s)=>{this.destroy(e,(c,l)=>c?s(c):o(l))});if(typeof r!="function")throw new cpe("invalid callback");if(this[lpe]){this[a8]?this[a8].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new Bnr),this[lpe]=!0,this[a8]=this[a8]||[],this[a8].push(r);let n=a(()=>{let o=this[a8];this[a8]=null;for(let s=0;s{queueMicrotask(n)})}[bot](e,r){if(!this[LZ]||this[LZ].length===0)return this[bot]=this[Fnr],this[Fnr](e,r);let n=this[Fnr].bind(this);for(let o=this[LZ].length-1;o>=0;o--)n=this[LZ][o](n);return this[bot]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new cpe("handler must be an object");try{if(!e||typeof e!="object")throw new cpe("opts must be an object.");if(this[lpe]||this[a8])throw new Bnr;if(this[xPe])throw new JAs;return this[bot](e,r)}catch(n){if(typeof r.onError!="function")throw new cpe("invalid onError method");return r.onError(n),!1}}};ULn.exports=Unr});var Vnr=I((edf,HLn)=>{"use strict";p();var fpe=0,Qnr=1e3,qnr=(Qnr>>1)-1,c8,jnr=Symbol("kFastTimer"),l8=[],Hnr=-2,Gnr=-1,qLn=0,QLn=1;function $nr(){fpe+=qnr;let t=0,e=l8.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=Gnr,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===Gnr?(r._state=Hnr,--e!==0&&(l8[t]=l8[e])):++t}l8.length=e,l8.length!==0&&jLn()}a($nr,"onTick");function jLn(){c8?c8.refresh():(clearTimeout(c8),c8=setTimeout($nr,qnr),c8.unref&&c8.unref())}a(jLn,"refreshTimeout");var Sot=class{static{a(this,"FastTimer")}[jnr]=!0;_state=Hnr;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===Hnr&&l8.push(this),(!c8||l8.length===1)&&jLn(),this._state=qLn}clear(){this._state=Gnr,this._idleStart=-1}};HLn.exports={setTimeout(t,e,r){return e<=Qnr?setTimeout(t,e,r):new Sot(t,e,r)},clearTimeout(t){t[jnr]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Sot(t,e,r)},clearFastTimeout(t){t.clear()},now(){return fpe},tick(t=0){fpe+=t-Qnr+1,$nr(),$nr()},reset(){fpe=0,l8.length=0,clearTimeout(c8),c8=null},kFastTimer:jnr}});var wPe=I((odf,zLn)=>{"use strict";p();var eys=require("node:net"),GLn=require("node:assert"),WLn=Ws(),{InvalidArgumentError:tys,ConnectTimeoutError:rys}=Rc(),Tot=Vnr();function $Ln(){}a($Ln,"noop");var Wnr,znr;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?znr=class{static{a(this,"WeakSessionCache")}constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new global.FinalizationRegistry(r=>{if(this._sessionCache.size=this._maxCachedSessions){let{value:n}=this._sessionCache.keys().next();this._sessionCache.delete(n)}this._sessionCache.set(e,r)}}};function nys({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new tys("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new znr(e??100);return n=n??1e4,t=t??!1,a(function({hostname:d,host:f,protocol:h,port:m,servername:g,localAddress:A,httpSocket:y},_){let E;if(h==="https:"){Wnr||(Wnr=require("node:tls")),g=g||c.servername||WLn.getServerName(f)||null;let S=g||d;GLn(S);let T=o||l.get(S)||null;m=m||443,E=Wnr.connect({highWaterMark:16384,...c,servername:g,session:T,localAddress:A,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:y,port:m,host:d}),E.on("session",function(w){l.set(S,w)})}else GLn(!y,"httpSocket can only be sent on TLS update"),m=m||80,E=eys.connect({highWaterMark:64*1024,...c,localAddress:A,port:m,host:d});if(c.keepAlive==null||c.keepAlive){let S=c.keepAliveInitialDelay===void 0?6e4:c.keepAliveInitialDelay;E.setKeepAlive(!0,S)}let v=iys(new WeakRef(E),{timeout:n,hostname:d,port:m});return E.setNoDelay(!0).once(h==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(v),_){let S=_;_=null,S(null,this)}}).on("error",function(S){if(queueMicrotask(v),_){let T=_;_=null,T(S)}}),E},"connect")}a(nys,"buildConnector");var iys=process.platform==="win32"?(t,e)=>{if(!e.timeout)return $Ln;let r=null,n=null,o=Tot.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>VLn(t.deref(),e))})},e.timeout);return()=>{Tot.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return $Ln;let r=null,n=Tot.setFastTimeout(()=>{r=setImmediate(()=>{VLn(t.deref(),e)})},e.timeout);return()=>{Tot.clearFastTimeout(n),clearImmediate(r)}};function VLn(t,e){if(t==null)return;let r="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${e.hostname}:${e.port},`,r+=` timeout: ${e.timeout}ms)`,WLn.destroy(t,new rys(r))}a(VLn,"onConnectTimeout");zLn.exports=nys});var YLn=I(Iot=>{"use strict";p();Object.defineProperty(Iot,"__esModule",{value:!0});Iot.enumToMap=void 0;function oys(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(oys,"enumToMap");Iot.enumToMap=oys});var KLn=I(Mr=>{"use strict";p();Object.defineProperty(Mr,"__esModule",{value:!0});Mr.SPECIAL_HEADERS=Mr.HEADER_STATE=Mr.MINOR=Mr.MAJOR=Mr.CONNECTION_TOKEN_CHARS=Mr.HEADER_CHARS=Mr.TOKEN=Mr.STRICT_TOKEN=Mr.HEX=Mr.URL_CHAR=Mr.STRICT_URL_CHAR=Mr.USERINFO_CHARS=Mr.MARK=Mr.ALPHANUM=Mr.NUM=Mr.HEX_MAP=Mr.NUM_MAP=Mr.ALPHA=Mr.FINISH=Mr.H_METHOD_MAP=Mr.METHOD_MAP=Mr.METHODS_RTSP=Mr.METHODS_ICE=Mr.METHODS_HTTP=Mr.METHODS=Mr.LENIENT_FLAGS=Mr.FLAGS=Mr.TYPE=Mr.ERROR=void 0;var sys=YLn(),ays;(function(t){t[t.OK=0]="OK",t[t.INTERNAL=1]="INTERNAL",t[t.STRICT=2]="STRICT",t[t.LF_EXPECTED=3]="LF_EXPECTED",t[t.UNEXPECTED_CONTENT_LENGTH=4]="UNEXPECTED_CONTENT_LENGTH",t[t.CLOSED_CONNECTION=5]="CLOSED_CONNECTION",t[t.INVALID_METHOD=6]="INVALID_METHOD",t[t.INVALID_URL=7]="INVALID_URL",t[t.INVALID_CONSTANT=8]="INVALID_CONSTANT",t[t.INVALID_VERSION=9]="INVALID_VERSION",t[t.INVALID_HEADER_TOKEN=10]="INVALID_HEADER_TOKEN",t[t.INVALID_CONTENT_LENGTH=11]="INVALID_CONTENT_LENGTH",t[t.INVALID_CHUNK_SIZE=12]="INVALID_CHUNK_SIZE",t[t.INVALID_STATUS=13]="INVALID_STATUS",t[t.INVALID_EOF_STATE=14]="INVALID_EOF_STATE",t[t.INVALID_TRANSFER_ENCODING=15]="INVALID_TRANSFER_ENCODING",t[t.CB_MESSAGE_BEGIN=16]="CB_MESSAGE_BEGIN",t[t.CB_HEADERS_COMPLETE=17]="CB_HEADERS_COMPLETE",t[t.CB_MESSAGE_COMPLETE=18]="CB_MESSAGE_COMPLETE",t[t.CB_CHUNK_HEADER=19]="CB_CHUNK_HEADER",t[t.CB_CHUNK_COMPLETE=20]="CB_CHUNK_COMPLETE",t[t.PAUSED=21]="PAUSED",t[t.PAUSED_UPGRADE=22]="PAUSED_UPGRADE",t[t.PAUSED_H2_UPGRADE=23]="PAUSED_H2_UPGRADE",t[t.USER=24]="USER"})(ays=Mr.ERROR||(Mr.ERROR={}));var cys;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(cys=Mr.TYPE||(Mr.TYPE={}));var lys;(function(t){t[t.CONNECTION_KEEP_ALIVE=1]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=2]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=4]="CONNECTION_UPGRADE",t[t.CHUNKED=8]="CHUNKED",t[t.UPGRADE=16]="UPGRADE",t[t.CONTENT_LENGTH=32]="CONTENT_LENGTH",t[t.SKIPBODY=64]="SKIPBODY",t[t.TRAILING=128]="TRAILING",t[t.TRANSFER_ENCODING=512]="TRANSFER_ENCODING"})(lys=Mr.FLAGS||(Mr.FLAGS={}));var uys;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(uys=Mr.LENIENT_FLAGS||(Mr.LENIENT_FLAGS={}));var Bi;(function(t){t[t.DELETE=0]="DELETE",t[t.GET=1]="GET",t[t.HEAD=2]="HEAD",t[t.POST=3]="POST",t[t.PUT=4]="PUT",t[t.CONNECT=5]="CONNECT",t[t.OPTIONS=6]="OPTIONS",t[t.TRACE=7]="TRACE",t[t.COPY=8]="COPY",t[t.LOCK=9]="LOCK",t[t.MKCOL=10]="MKCOL",t[t.MOVE=11]="MOVE",t[t.PROPFIND=12]="PROPFIND",t[t.PROPPATCH=13]="PROPPATCH",t[t.SEARCH=14]="SEARCH",t[t.UNLOCK=15]="UNLOCK",t[t.BIND=16]="BIND",t[t.REBIND=17]="REBIND",t[t.UNBIND=18]="UNBIND",t[t.ACL=19]="ACL",t[t.REPORT=20]="REPORT",t[t.MKACTIVITY=21]="MKACTIVITY",t[t.CHECKOUT=22]="CHECKOUT",t[t.MERGE=23]="MERGE",t[t["M-SEARCH"]=24]="M-SEARCH",t[t.NOTIFY=25]="NOTIFY",t[t.SUBSCRIBE=26]="SUBSCRIBE",t[t.UNSUBSCRIBE=27]="UNSUBSCRIBE",t[t.PATCH=28]="PATCH",t[t.PURGE=29]="PURGE",t[t.MKCALENDAR=30]="MKCALENDAR",t[t.LINK=31]="LINK",t[t.UNLINK=32]="UNLINK",t[t.SOURCE=33]="SOURCE",t[t.PRI=34]="PRI",t[t.DESCRIBE=35]="DESCRIBE",t[t.ANNOUNCE=36]="ANNOUNCE",t[t.SETUP=37]="SETUP",t[t.PLAY=38]="PLAY",t[t.PAUSE=39]="PAUSE",t[t.TEARDOWN=40]="TEARDOWN",t[t.GET_PARAMETER=41]="GET_PARAMETER",t[t.SET_PARAMETER=42]="SET_PARAMETER",t[t.REDIRECT=43]="REDIRECT",t[t.RECORD=44]="RECORD",t[t.FLUSH=45]="FLUSH"})(Bi=Mr.METHODS||(Mr.METHODS={}));Mr.METHODS_HTTP=[Bi.DELETE,Bi.GET,Bi.HEAD,Bi.POST,Bi.PUT,Bi.CONNECT,Bi.OPTIONS,Bi.TRACE,Bi.COPY,Bi.LOCK,Bi.MKCOL,Bi.MOVE,Bi.PROPFIND,Bi.PROPPATCH,Bi.SEARCH,Bi.UNLOCK,Bi.BIND,Bi.REBIND,Bi.UNBIND,Bi.ACL,Bi.REPORT,Bi.MKACTIVITY,Bi.CHECKOUT,Bi.MERGE,Bi["M-SEARCH"],Bi.NOTIFY,Bi.SUBSCRIBE,Bi.UNSUBSCRIBE,Bi.PATCH,Bi.PURGE,Bi.MKCALENDAR,Bi.LINK,Bi.UNLINK,Bi.PRI,Bi.SOURCE];Mr.METHODS_ICE=[Bi.SOURCE];Mr.METHODS_RTSP=[Bi.OPTIONS,Bi.DESCRIBE,Bi.ANNOUNCE,Bi.SETUP,Bi.PLAY,Bi.PAUSE,Bi.TEARDOWN,Bi.GET_PARAMETER,Bi.SET_PARAMETER,Bi.REDIRECT,Bi.RECORD,Bi.FLUSH,Bi.GET,Bi.POST];Mr.METHOD_MAP=sys.enumToMap(Bi);Mr.H_METHOD_MAP={};Object.keys(Mr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(Mr.H_METHOD_MAP[t]=Mr.METHOD_MAP[t])});var dys;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(dys=Mr.FINISH||(Mr.FINISH={}));Mr.ALPHA=[];for(let t=65;t<=90;t++)Mr.ALPHA.push(String.fromCharCode(t)),Mr.ALPHA.push(String.fromCharCode(t+32));Mr.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};Mr.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};Mr.NUM=["0","1","2","3","4","5","6","7","8","9"];Mr.ALPHANUM=Mr.ALPHA.concat(Mr.NUM);Mr.MARK=["-","_",".","!","~","*","'","(",")"];Mr.USERINFO_CHARS=Mr.ALPHANUM.concat(Mr.MARK).concat(["%",";",":","&","=","+","$",","]);Mr.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(Mr.ALPHANUM);Mr.URL_CHAR=Mr.STRICT_URL_CHAR.concat([" ","\f"]);for(let t=128;t<=255;t++)Mr.URL_CHAR.push(t);Mr.HEX=Mr.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);Mr.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(Mr.ALPHANUM);Mr.TOKEN=Mr.STRICT_TOKEN.concat([" "]);Mr.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&Mr.HEADER_CHARS.push(t);Mr.CONNECTION_TOKEN_CHARS=Mr.HEADER_CHARS.filter(t=>t!==44);Mr.MAJOR=Mr.NUM_MAP;Mr.MINOR=Mr.MAJOR;var ppe;(function(t){t[t.GENERAL=0]="GENERAL",t[t.CONNECTION=1]="CONNECTION",t[t.CONTENT_LENGTH=2]="CONTENT_LENGTH",t[t.TRANSFER_ENCODING=3]="TRANSFER_ENCODING",t[t.UPGRADE=4]="UPGRADE",t[t.CONNECTION_KEEP_ALIVE=5]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=6]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=7]="CONNECTION_UPGRADE",t[t.TRANSFER_ENCODING_CHUNKED=8]="TRANSFER_ENCODING_CHUNKED"})(ppe=Mr.HEADER_STATE||(Mr.HEADER_STATE={}));Mr.SPECIAL_HEADERS={connection:ppe.CONNECTION,"content-length":ppe.CONTENT_LENGTH,"proxy-connection":ppe.CONNECTION,"transfer-encoding":ppe.TRANSFER_ENCODING,upgrade:ppe.UPGRADE}});var Ynr=I((pdf,JLn)=>{"use strict";p();var{Buffer:fys}=require("node:buffer");JLn.exports=fys.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv","base64")});var XLn=I((mdf,ZLn)=>{"use strict";p();var{Buffer:pys}=require("node:buffer");ZLn.exports=pys.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==","base64")});var RPe=I((Adf,aBn)=>{"use strict";p();var eBn=["GET","HEAD","POST"],hys=new Set(eBn),mys=[101,204,205,304],tBn=[301,302,303,307,308],gys=new Set(tBn),rBn=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],Ays=new Set(rBn),nBn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],yys=new Set(nBn),_ys=["follow","manual","error"],iBn=["GET","HEAD","OPTIONS","TRACE"],Eys=new Set(iBn),vys=["navigate","same-origin","no-cors","cors"],Cys=["omit","same-origin","include"],bys=["default","no-store","reload","no-cache","force-cache","only-if-cached"],Sys=["content-encoding","content-language","content-location","content-type","content-length"],Tys=["half"],oBn=["CONNECT","TRACE","TRACK"],Iys=new Set(oBn),sBn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],xys=new Set(sBn);aBn.exports={subresource:sBn,forbiddenMethods:oBn,requestBodyHeader:Sys,referrerPolicy:nBn,requestRedirect:_ys,requestMode:vys,requestCredentials:Cys,requestCache:bys,redirectStatus:tBn,corsSafeListedMethods:eBn,nullBodyStatus:mys,safeMethods:iBn,badPorts:rBn,requestDuplex:Tys,subresourceSet:xys,badPortsSet:Ays,redirectStatusSet:gys,corsSafeListedMethodsSet:hys,safeMethodsSet:Eys,forbiddenMethodsSet:Iys,referrerPolicySet:yys}});var Jnr=I((_df,cBn)=>{"use strict";p();var Knr=Symbol.for("undici.globalOrigin.1");function wys(){return globalThis[Knr]}a(wys,"getGlobalOrigin");function Rys(t){if(t===void 0){Object.defineProperty(globalThis,Knr,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,Knr,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(Rys,"setGlobalOrigin");cBn.exports={getGlobalOrigin:wys,setGlobalOrigin:Rys}});var xb=I((Cdf,mBn)=>{"use strict";p();var wot=require("node:assert"),kys=new TextEncoder,kPe=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,Pys=/[\u000A\u000D\u0009\u0020]/,Dys=/[\u0009\u000A\u000C\u000D\u0020]/g,Nys=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function Mys(t){wot(t.protocol==="data:");let e=dBn(t,!0);e=e.slice(5);let r={position:0},n=hpe(",",e,r),o=n.length;if(n=Qys(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=fBn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=hBn(c);if(c=Lys(u),c==="failure")return"failure";n=n.slice(0,-6),n=n.replace(/(\u0020)+$/,""),n=n.slice(0,-1)}n.startsWith(";")&&(n="text/plain"+n);let l=Znr(n);return l==="failure"&&(l=Znr("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(Mys,"dataURLProcessor");function dBn(t,e=!1){if(!e)return t.href;let r=t.href,n=t.hash.length,o=n===0?r:r.substring(0,r.length-n);return!n&&r.endsWith("#")?o.slice(0,-1):o}a(dBn,"URLSerializer");function Rot(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(lBn,"isHexCharByte");function uBn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(uBn,"hexByteToNumber");function Oys(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=hpe(";",t,e);if(n=xot(n,!1,!0),n.length===0||!kPe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionPys.test(d),t,e);let l=Rot(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=pBn(t,e,!0),hpe(";",t,e);else if(u=hpe(";",t,e),u=xot(u,!1,!0),u.length===0)continue;l.length!==0&&kPe.test(l)&&(u.length===0||Nys.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(Znr,"parseMIMEType");function Lys(t){t=t.replace(Dys,"");let e=t.length;if(e%4===0&&t.charCodeAt(e-1)===61&&(--e,t.charCodeAt(e-1)===61&&--e),e%4===1||/[^+/0-9A-Za-z]/.test(t.length===e?t:t.substring(0,e)))return"failure";let r=Buffer.from(t,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}a(Lys,"forgivingBase64");function pBn(t,e,r){let n=e.position,o="";for(wot(t[e.position]==='"'),e.position++;o+=Rot(c=>c!=='"'&&c!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){o+="\\";break}o+=t[e.position],e.position++}else{wot(s==='"');break}}return r?o:t.slice(n,e.position)}a(pBn,"collectAnHTTPQuotedString");function Bys(t){wot(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",kPe.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(Bys,"serializeAMimeType");function Fys(t){return t===13||t===10||t===9||t===32}a(Fys,"isHTTPWhiteSpace");function xot(t,e=!0,r=!0){return Xnr(t,e,r,Fys)}a(xot,"removeHTTPWhitespace");function Uys(t){return t===13||t===10||t===9||t===12||t===32}a(Uys,"isASCIIWhitespace");function Qys(t,e=!0,r=!0){return Xnr(t,e,r,Uys)}a(Qys,"removeASCIIWhitespace");function Xnr(t,e,r,n){let o=0,s=t.length-1;if(e)for(;o0&&n(t.charCodeAt(s));)s--;return o===0&&s===t.length-1?t:t.slice(o,s+1)}a(Xnr,"removeChars");function hBn(t){let e=t.length;if(65535>e)return String.fromCharCode.apply(null,t);let r="",n=0,o=65535;for(;ne&&(o=e-n),r+=String.fromCharCode.apply(null,t.subarray(n,n+=o));return r}a(hBn,"isomorphicDecode");function qys(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}a(qys,"minimizeSupportedMimeType");mBn.exports={dataURLProcessor:Mys,URLSerializer:dBn,collectASequenceOfCodePoints:Rot,collectASequenceOfCodePointsFast:hpe,stringPercentDecode:fBn,parseMIMEType:Znr,collectAnHTTPQuotedString:pBn,serializeAMimeType:Bys,removeChars:Xnr,removeHTTPWhitespace:xot,minimizeSupportedMimeType:qys,HTTP_TOKEN_CODEPOINTS:kPe,isomorphicDecode:hBn}});var ty=I((Tdf,gBn)=>{"use strict";p();var{types:$5,inspect:jys}=require("node:util"),{markAsUncloneable:Hys}=require("node:worker_threads"),{toUSVString:Gys}=Ws(),Sr={};Sr.converters={};Sr.util={};Sr.errors={};Sr.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};Sr.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return Sr.errors.exception({header:t.prefix,message:r})};Sr.errors.invalidArgument=function(t){return Sr.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};Sr.brandCheck=function(t,e,r){if(r?.strict!==!1){if(!(t instanceof e)){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}else if(t?.[Symbol.toStringTag]!==e.prototype[Symbol.toStringTag]){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}};Sr.argumentLengthCheck=function({length:t},e,r){if(t{});Sr.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=Math.pow(-2,e)-1,o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),n?.enforceRange===!0){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw Sr.errors.exception({header:"Integer conversion",message:`Could not convert ${Sr.util.Stringify(t)} to an integer.`});if(c=Sr.util.IntegerPart(c),co)throw Sr.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&n?.clamp===!0?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=Sr.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e)-1?c-Math.pow(2,e):c)};Sr.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};Sr.util.Stringify=function(t){switch(Sr.util.Type(t)){case"Symbol":return`Symbol(${t.description})`;case"Object":return jys(t);case"String":return`"${t}"`;default:return`${t}`}};Sr.sequenceConverter=function(t){return(e,r,n,o)=>{if(Sr.util.Type(e)!=="Object")throw Sr.errors.exception({header:r,message:`${n} (${Sr.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw Sr.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};Sr.recordConverter=function(t,e){return(r,n,o)=>{if(Sr.util.Type(r)!=="Object")throw Sr.errors.exception({header:n,message:`${o} ("${Sr.util.Type(r)}") is not an Object.`});let s={};if(!$5.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=t(u,n,o),f=e(r[u],n,o);s[d]=f}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};Sr.interfaceConverter=function(t){return(e,r,n,o)=>{if(o?.strict!==!1&&!(e instanceof t))throw Sr.errors.exception({header:r,message:`Expected ${n} ("${Sr.util.Stringify(e)}") to be an instance of ${t.name}.`});return e}};Sr.dictionaryConverter=function(t){return(e,r,n)=>{let o=Sr.util.Type(e),s={};if(o==="Null"||o==="Undefined")return s;if(o!=="Object")throw Sr.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let c of t){let{key:l,defaultValue:u,required:d,converter:f}=c;if(d===!0&&!Object.hasOwn(e,l))throw Sr.errors.exception({header:r,message:`Missing required key "${l}".`});let h=e[l],m=Object.hasOwn(c,"defaultValue");if(m&&h!==null&&(h??=u()),d||m||h!==void 0){if(h=f(h,r,`${n}.${l}`),c.allowedValues&&!c.allowedValues.includes(h))throw Sr.errors.exception({header:r,message:`${h} is not an accepted type. Expected one of ${c.allowedValues.join(", ")}.`});s[l]=h}}return s}};Sr.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};Sr.converters.DOMString=function(t,e,r,n){if(t===null&&n?.legacyNullToEmptyString)return"";if(typeof t=="symbol")throw Sr.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};Sr.converters.ByteString=function(t,e,r){let n=Sr.converters.DOMString(t,e,r);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};Sr.converters.USVString=Gys;Sr.converters.boolean=function(t){return!!t};Sr.converters.any=function(t){return t};Sr.converters["long long"]=function(t,e,r){return Sr.util.ConvertToInt(t,64,"signed",void 0,e,r)};Sr.converters["unsigned long long"]=function(t,e,r){return Sr.util.ConvertToInt(t,64,"unsigned",void 0,e,r)};Sr.converters["unsigned long"]=function(t,e,r){return Sr.util.ConvertToInt(t,32,"unsigned",void 0,e,r)};Sr.converters["unsigned short"]=function(t,e,r,n){return Sr.util.ConvertToInt(t,16,"unsigned",n,e,r)};Sr.converters.ArrayBuffer=function(t,e,r,n){if(Sr.util.Type(t)!=="Object"||!$5.isAnyArrayBuffer(t))throw Sr.errors.conversionFailed({prefix:e,argument:`${r} ("${Sr.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&$5.isSharedArrayBuffer(t))throw Sr.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.resizable||t.growable)throw Sr.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Sr.converters.TypedArray=function(t,e,r,n,o){if(Sr.util.Type(t)!=="Object"||!$5.isTypedArray(t)||t.constructor.name!==e.name)throw Sr.errors.conversionFailed({prefix:r,argument:`${n} ("${Sr.util.Stringify(t)}")`,types:[e.name]});if(o?.allowShared===!1&&$5.isSharedArrayBuffer(t.buffer))throw Sr.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Sr.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Sr.converters.DataView=function(t,e,r,n){if(Sr.util.Type(t)!=="Object"||!$5.isDataView(t))throw Sr.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&$5.isSharedArrayBuffer(t.buffer))throw Sr.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Sr.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Sr.converters.BufferSource=function(t,e,r,n){if($5.isAnyArrayBuffer(t))return Sr.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if($5.isTypedArray(t))return Sr.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if($5.isDataView(t))return Sr.converters.DataView(t,e,r,{...n,allowShared:!1});throw Sr.errors.conversionFailed({prefix:e,argument:`${r} ("${Sr.util.Stringify(t)}")`,types:["BufferSource"]})};Sr.converters["sequence"]=Sr.sequenceConverter(Sr.converters.ByteString);Sr.converters["sequence>"]=Sr.sequenceConverter(Sr.converters["sequence"]);Sr.converters["record"]=Sr.recordConverter(Sr.converters.ByteString,Sr.converters.ByteString);gBn.exports={webidl:Sr}});var NT=I((xdf,kBn)=>{"use strict";p();var{Transform:$ys}=require("node:stream"),ABn=require("node:zlib"),{redirectStatusSet:Vys,referrerPolicySet:Wys,badPortsSet:zys}=RPe(),{getGlobalOrigin:yBn}=Jnr(),{collectASequenceOfCodePoints:BZ,collectAnHTTPQuotedString:Yys,removeChars:Kys,parseMIMEType:Jys}=xb(),{performance:Zys}=require("node:perf_hooks"),{isBlobLike:Xys,ReadableStreamFrom:e_s,isValidHTTPToken:_Bn,normalizedMethodRecordsBase:t_s}=Ws(),FZ=require("node:assert"),{isUint8Array:r_s}=require("node:util/types"),{webidl:PPe}=ty(),EBn=[],Pot;try{Pot=require("node:crypto");let t=["sha256","sha384","sha512"];EBn=Pot.getHashes().filter(e=>t.includes(e))}catch{}function vBn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(vBn,"responseURL");function n_s(t,e){if(!Vys.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&bBn(r)&&(CBn(r)||(r=i_s(r)),r=new URL(r,vBn(t))),r&&!r.hash&&(r.hash=e),r}a(n_s,"responseLocationURL");function CBn(t){for(let e=0;e126||r<32)return!1}return!0}a(CBn,"isValidEncodedURL");function i_s(t){return Buffer.from(t,"binary").toString("utf8")}a(i_s,"normalizeBinaryStringToUtf8");function NPe(t){return t.urlList[t.urlList.length-1]}a(NPe,"requestCurrentURL");function o_s(t){let e=NPe(t);return wBn(e)&&zys.has(e.port)?"blocked":"allowed"}a(o_s,"requestBadPort");function s_s(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(s_s,"isErrorLike");function a_s(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(a_s,"isValidReasonPhrase");var c_s=_Bn;function bBn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(bBn,"isValidHeaderValue");function l_s(t,e){let{headersList:r}=e,n=(r.get("referrer-policy",!0)??"").split(","),o="";if(n.length>0)for(let s=n.length;s!==0;s--){let c=n[s-1].trim();if(Wys.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(l_s,"setRequestReferrerPolicyOnRedirect");function u_s(){return"allowed"}a(u_s,"crossOriginResourcePolicyCheck");function d_s(){return"success"}a(d_s,"corsCheck");function f_s(){return"success"}a(f_s,"TAOCheck");function p_s(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(p_s,"appendFetchMetadata");function h_s(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&tir(t.origin)&&!tir(NPe(t))&&(e=null);break;case"same-origin":Dot(t,NPe(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(h_s,"appendRequestOriginHeader");function mpe(t,e){return t}a(mpe,"coarsenTime");function m_s(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=Dot(t,n),c=DPe(n)&&!DPe(t.url);switch(e){case"origin":return o??eir(r,!0);case"unsafe-url":return n;case"same-origin":return s?o:"no-referrer";case"origin-when-cross-origin":return s?n:o;case"strict-origin-when-cross-origin":{let l=NPe(t);return Dot(n,l)?n:DPe(n)&&!DPe(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(__s,"determineRequestsReferrer");function eir(t,e){return FZ(t instanceof URL),t=new URL(t),t.protocol==="file:"||t.protocol==="about:"||t.protocol==="blank:"?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}a(eir,"stripURLForReferrer");function DPe(t){if(!(t instanceof URL))return!1;if(t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="file:")return!0;return e(t.origin);function e(r){if(r==null||r==="null")return!1;let n=new URL(r);return!!(n.protocol==="https:"||n.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(n.hostname)||n.hostname==="localhost"||n.hostname.includes("localhost.")||n.hostname.endsWith(".localhost"))}}a(DPe,"isURLPotentiallyTrustworthy");function E_s(t,e){if(Pot===void 0)return!0;let r=TBn(e);if(r==="no metadata"||r.length===0)return!0;let n=C_s(r),o=b_s(r,n);for(let s of o){let c=s.algo,l=s.hash,u=Pot.createHash(c).update(t).digest("base64");if(u[u.length-1]==="="&&(u[u.length-2]==="="?u=u.slice(0,-2):u=u.slice(0,-1)),S_s(u,l))return!0}return!1}a(E_s,"bytesMatch");var v_s=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function TBn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=v_s.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();EBn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(TBn,"parseMetadata");function C_s(t){let e=t[0].algo;if(e[3]==="5")return e;for(let r=1;r{t=n,e=o}),resolve:t,reject:e}}a(I_s,"createDeferredPromise");function x_s(t){return t.controller.state==="aborted"}a(x_s,"isAborted");function w_s(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(w_s,"isCancelled");function R_s(t){return t_s[t.toLowerCase()]??t}a(R_s,"normalizeMethod");function k_s(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return FZ(typeof e=="string"),e}a(k_s,"serializeJavascriptValueToJSONString");var P_s=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function IBn(t,e,r=0,n=1){class o{static{a(this,"FastIterableIterator")}#e;#t;#r;constructor(c,l){this.#e=c,this.#t=l,this.#r=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let c=this.#r,l=this.#e[e],u=l.length;if(c>=u)return{value:void 0,done:!0};let{[r]:d,[n]:f}=l[c];this.#r=c+1;let h;switch(this.#t){case"key":h=d;break;case"value":h=f;break;case"key+value":h=[d,f];break}return{value:h,done:!1}}}return delete o.prototype.constructor,Object.setPrototypeOf(o.prototype,P_s),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,c){return new o(s,c)}}a(IBn,"createIterator");function D_s(t,e,r,n=0,o=1){let s=IBn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return PPe.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return PPe.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return PPe.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(PPe.brandCheck(this,e),PPe.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof u!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:f,1:h}of s(this,"key+value"))u.call(d,h,f,this)},"forEach")}};return Object.defineProperties(e.prototype,{...c,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:c.entries.value}})}a(D_s,"iteratorMixin");async function N_s(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await xBn(s))}catch(c){o(c)}}a(N_s,"fullyReadBody");function M_s(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(M_s,"isReadableStreamLike");function O_s(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}a(O_s,"readableStreamClose");var L_s=/[^\x00-\xFF]/;function kot(t){return FZ(!L_s.test(t)),t}a(kot,"isomorphicEncode");async function xBn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!r_s(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(xBn,"readAllBytes");function B_s(t){FZ("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(B_s,"urlIsLocal");function tir(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}a(tir,"urlHasHttpsScheme");function wBn(t){FZ("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(wBn,"urlIsHttpHttpsScheme");function F_s(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&BZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&BZ(u=>u===" "||u===" ",r,n);let o=BZ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&BZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&BZ(u=>u===" "||u===" ",r,n);let c=BZ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(F_s,"simpleRangeHeaderValue");function U_s(t,e,r){let n="bytes ";return n+=kot(`${t}`),n+="-",n+=kot(`${e}`),n+="/",n+=kot(`${r}`),n}a(U_s,"buildContentRange");var rir=class extends $ys{static{a(this,"InflateStream")}#e;constructor(e){super(),this.#e=e}_transform(e,r,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)===8?ABn.createInflate(this.#e):ABn.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",o=>this.destroy(o))}this._inflateStream.write(e,r,n)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function Q_s(t){return new rir(t)}a(Q_s,"createInflate");function q_s(t){let e=null,r=null,n=null,o=RBn("content-type",t);if(o===null)return"failure";for(let s of o){let c=Jys(s);c==="failure"||c.essence==="*/*"||(n=c,n.essence!==r?(e=null,n.parameters.has("charset")&&(e=n.parameters.get("charset")),r=n.essence):!n.parameters.has("charset")&&e!==null&&n.parameters.set("charset",e))}return n??"failure"}a(q_s,"extractMimeType");function j_s(t){let e=t,r={position:0},n=[],o="";for(;r.positions!=='"'&&s!==",",e,r),r.positions===9||s===32),n.push(o),o=""}return n}a(j_s,"gettingDecodingSplitting");function RBn(t,e){let r=e.get(t,!0);return r===null?null:j_s(r)}a(RBn,"getDecodeSplit");var H_s=new TextDecoder;function G_s(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),H_s.decode(t))}a(G_s,"utf8DecodeBytes");var nir=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return yBn()}get origin(){return this.baseUrl?.origin}policyContainer=SBn()},iir=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new nir},$_s=new iir;kBn.exports={isAborted:x_s,isCancelled:w_s,isValidEncodedURL:CBn,createDeferredPromise:I_s,ReadableStreamFrom:e_s,tryUpgradeRequestToAPotentiallyTrustworthyURL:T_s,clampAndCoarsenConnectionTimingInfo:m_s,coarsenedSharedCurrentTime:g_s,determineRequestsReferrer:__s,makePolicyContainer:SBn,clonePolicyContainer:y_s,appendFetchMetadata:p_s,appendRequestOriginHeader:h_s,TAOCheck:f_s,corsCheck:d_s,crossOriginResourcePolicyCheck:u_s,createOpaqueTimingInfo:A_s,setRequestReferrerPolicyOnRedirect:l_s,isValidHTTPToken:_Bn,requestBadPort:o_s,requestCurrentURL:NPe,responseURL:vBn,responseLocationURL:n_s,isBlobLike:Xys,isURLPotentiallyTrustworthy:DPe,isValidReasonPhrase:a_s,sameOrigin:Dot,normalizeMethod:R_s,serializeJavascriptValueToJSONString:k_s,iteratorMixin:D_s,createIterator:IBn,isValidHeaderName:c_s,isValidHeaderValue:bBn,isErrorLike:s_s,fullyReadBody:N_s,bytesMatch:E_s,isReadableStreamLike:M_s,readableStreamClose:O_s,isomorphicEncode:kot,urlIsLocal:B_s,urlHasHttpsScheme:tir,urlIsHttpHttpsScheme:wBn,readAllBytes:xBn,simpleRangeHeaderValue:F_s,buildContentRange:U_s,parseMetadata:TBn,createInflate:Q_s,extractMimeType:q_s,getDecodeSplit:RBn,utf8DecodeBytes:G_s,environmentSettingsObject:$_s}});var Zj=I((kdf,PBn)=>{"use strict";p();PBn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var sir=I((Ddf,DBn)=>{"use strict";p();var{Blob:V_s,File:W_s}=require("node:buffer"),{kState:u8}=Zj(),{webidl:V5}=ty(),oir=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[u8]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return V5.brandCheck(this,t),this[u8].blobLike.stream(...e)}arrayBuffer(...e){return V5.brandCheck(this,t),this[u8].blobLike.arrayBuffer(...e)}slice(...e){return V5.brandCheck(this,t),this[u8].blobLike.slice(...e)}text(...e){return V5.brandCheck(this,t),this[u8].blobLike.text(...e)}get size(){return V5.brandCheck(this,t),this[u8].blobLike.size}get type(){return V5.brandCheck(this,t),this[u8].blobLike.type}get name(){return V5.brandCheck(this,t),this[u8].name}get lastModified(){return V5.brandCheck(this,t),this[u8].lastModified}get[Symbol.toStringTag](){return"File"}};V5.converters.Blob=V5.interfaceConverter(V_s);function z_s(t){return t instanceof W_s||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(z_s,"isFileLike");DBn.exports={FileLike:oir,isFileLike:z_s}});var OPe=I((Odf,BBn)=>{"use strict";p();var{isBlobLike:Not,iteratorMixin:Y_s}=NT(),{kState:bv}=Zj(),{kEnumerableProperty:gpe}=Ws(),{FileLike:NBn,isFileLike:K_s}=sir(),{webidl:Ou}=ty(),{File:LBn}=require("node:buffer"),MBn=require("node:util"),OBn=globalThis.File??LBn,MPe=class t{static{a(this,"FormData")}constructor(e){if(Ou.util.markAsUncloneable(this),e!==void 0)throw Ou.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[bv]=[]}append(e,r,n=void 0){Ou.brandCheck(this,t);let o="FormData.append";if(Ou.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Not(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=Ou.converters.USVString(e,o,"name"),r=Not(r)?Ou.converters.Blob(r,o,"value",{strict:!1}):Ou.converters.USVString(r,o,"value"),n=arguments.length===3?Ou.converters.USVString(n,o,"filename"):void 0;let s=air(e,r,n);this[bv].push(s)}delete(e){Ou.brandCheck(this,t);let r="FormData.delete";Ou.argumentLengthCheck(arguments,1,r),e=Ou.converters.USVString(e,r,"name"),this[bv]=this[bv].filter(n=>n.name!==e)}get(e){Ou.brandCheck(this,t);let r="FormData.get";Ou.argumentLengthCheck(arguments,1,r),e=Ou.converters.USVString(e,r,"name");let n=this[bv].findIndex(o=>o.name===e);return n===-1?null:this[bv][n].value}getAll(e){Ou.brandCheck(this,t);let r="FormData.getAll";return Ou.argumentLengthCheck(arguments,1,r),e=Ou.converters.USVString(e,r,"name"),this[bv].filter(n=>n.name===e).map(n=>n.value)}has(e){Ou.brandCheck(this,t);let r="FormData.has";return Ou.argumentLengthCheck(arguments,1,r),e=Ou.converters.USVString(e,r,"name"),this[bv].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Ou.brandCheck(this,t);let o="FormData.set";if(Ou.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Not(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=Ou.converters.USVString(e,o,"name"),r=Not(r)?Ou.converters.Blob(r,o,"name",{strict:!1}):Ou.converters.USVString(r,o,"name"),n=arguments.length===3?Ou.converters.USVString(n,o,"name"):void 0;let s=air(e,r,n),c=this[bv].findIndex(l=>l.name===e);c!==-1?this[bv]=[...this[bv].slice(0,c),s,...this[bv].slice(c+1).filter(l=>l.name!==e)]:this[bv].push(s)}[MBn.inspect.custom](e,r){let n=this[bv].reduce((s,c)=>(s[c.name]?Array.isArray(s[c.name])?s[c.name].push(c.value):s[c.name]=[s[c.name],c.value]:s[c.name]=c.value,s),{__proto__:null});r.depth??=e,r.colors??=!0;let o=MBn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};Y_s("FormData",MPe,bv,"name","value");Object.defineProperties(MPe.prototype,{append:gpe,delete:gpe,get:gpe,getAll:gpe,has:gpe,set:gpe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function air(t,e,r){if(typeof e!="string"){if(K_s(e)||(e=e instanceof Blob?new OBn([e],"blob",{type:e.type}):new NBn(e,"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=e instanceof LBn?new OBn([e],r,n):new NBn(e,r,n)}}return{name:t,value:e}}a(air,"makeEntry");BBn.exports={FormData:MPe,makeEntry:air}});var HBn=I((Fdf,jBn)=>{"use strict";p();var{isUSVString:FBn,bufferToLowerCasedHeaderName:J_s}=Ws(),{utf8DecodeBytes:Z_s}=NT(),{HTTP_TOKEN_CODEPOINTS:X_s,isomorphicDecode:UBn}=xb(),{isFileLike:eEs}=sir(),{makeEntry:tEs}=OPe(),Mot=require("node:assert"),{File:rEs}=require("node:buffer"),nEs=globalThis.File??rEs,iEs=Buffer.from('form-data; name="'),QBn=Buffer.from("; filename"),oEs=Buffer.from("--"),sEs=Buffer.from(`--\r -`);function aEs(t){for(let e=0;e70)return!1;for(let r=0;r=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}a(cEs,"validateBoundary");function lEs(t,e){Mot(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)return"failure";let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0};for(;t[s.position]===13&&t[s.position+1]===10;)s.position+=2;let c=t.length;for(;t[c-1]===10&&t[c-2]===13;)c-=2;for(c!==t.length&&(t=t.subarray(0,c));;){if(t.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else return"failure";if(s.position===t.length-2&&Oot(t,oEs,s)||s.position===t.length-4&&Oot(t,sEs,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=uEs(t,s);if(l==="failure")return"failure";let{name:u,filename:d,contentType:f,encoding:h}=l;s.position+=2;let m;{let A=t.indexOf(n.subarray(2),s.position);if(A===-1)return"failure";m=t.subarray(s.position,A-4),s.position+=m.length,h==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let g;d!==null?(f??="text/plain",aEs(f)||(f=""),g=new nEs([m],d,{type:f})):g=Z_s(Buffer.from(m)),Mot(FBn(u)),Mot(typeof g=="string"&&FBn(g)||eEs(g)),o.push(tEs(u,g,d))}}a(lEs,"multipartFormDataParser");function uEs(t,e){let r=null,n=null,o=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10)return r===null?"failure":{name:r,filename:n,contentType:o,encoding:s};let c=Ape(l=>l!==10&&l!==13&&l!==58,t,e);if(c=cir(c,!0,!0,l=>l===9||l===32),!X_s.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,Ape(l=>l===32||l===9,t,e),J_s(c)){case"content-disposition":{if(r=n=null,!Oot(t,iEs,e)||(e.position+=17,r=qBn(t,e),r===null))return"failure";if(Oot(t,QBn,e)){let l=e.position+QBn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=qBn(t,e),n===null))return"failure"}break}case"content-type":{let l=Ape(u=>u!==10&&u!==13,t,e);l=cir(l,!1,!0,u=>u===9||u===32),o=UBn(l);break}case"content-transfer-encoding":{let l=Ape(u=>u!==10&&u!==13,t,e);l=cir(l,!1,!0,u=>u===9||u===32),s=UBn(l);break}default:Ape(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a(uEs,"parseMultipartFormDataHeaders");function qBn(t,e){Mot(t[e.position-1]===34);let r=Ape(n=>n!==10&&n!==13&&n!==34,t,e);return t[e.position]!==34?null:(e.position++,r=new TextDecoder().decode(r).replace(/%0A/ig,` -`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),r)}a(qBn,"parseMultipartFormDataName");function Ape(t,e,r){let n=r.position;for(;n0&&n(t[s]);)s--;return o===0&&s===t.length-1?t:t.subarray(o,s+1)}a(cir,"removeChars");function Oot(t,e,r){if(t.length{"use strict";p();var LPe=Ws(),{ReadableStreamFrom:dEs,isBlobLike:GBn,isReadableStreamLike:fEs,readableStreamClose:pEs,createDeferredPromise:hEs,fullyReadBody:mEs,extractMimeType:gEs,utf8DecodeBytes:WBn}=NT(),{FormData:$Bn}=OPe(),{kState:_pe}=Zj(),{webidl:AEs}=ty(),{Blob:yEs}=require("node:buffer"),lir=require("node:assert"),{isErrored:zBn,isDisturbed:_Es}=require("node:stream"),{isArrayBuffer:EEs}=require("node:util/types"),{serializeAMimeType:vEs}=xb(),{multipartFormDataParser:CEs}=HBn(),uir;try{let t=require("node:crypto");uir=a(e=>t.randomInt(0,e),"random")}catch{uir=a(t=>Math.floor(Math.random(t)),"random")}var Lot=new TextEncoder;function bEs(){}a(bEs,"noop");var YBn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,KBn;YBn&&(KBn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!_Es(e)&&!zBn(e)&&e.cancel("Response object has been garbage collected").catch(bEs)}));function JBn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:GBn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?Lot.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>pEs(u))},start(){},type:"bytes"}),lir(fEs(r));let n=null,o=null,s=null,c=null;if(typeof t=="string")o=t,c="text/plain;charset=UTF-8";else if(t instanceof URLSearchParams)o=t.toString(),c="application/x-www-form-urlencoded;charset=UTF-8";else if(EEs(t))o=new Uint8Array(t.slice());else if(ArrayBuffer.isView(t))o=new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));else if(LPe.isFormDataLike(t)){let u=`----formdata-undici-0${`${uir(1e11)}`.padStart(11,"0")}`,d=`--${u}\r +`+s),t.push(o+"m+"+Aet.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Lns()+e+" "+t[0]}a(Ons,"formatArgs");function Lns(){return P0.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(Lns,"getDate");function Bns(...t){return process.stderr.write(get.formatWithOptions(P0.inspectOpts,...t)+` +`)}a(Bns,"log");function Fns(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(Fns,"save");function Uns(){return process.env.DEBUG}a(Uns,"load");function Qns(t){t.inspectOpts={};let e=Object.keys(P0.inspectOpts);for(let r=0;re.trim()).join(" ")};DRn.O=function(t){return this.inspectOpts.colors=this.useColors,get.inspect(t,this.inspectOpts)}});var MRn=I((GTd,qVt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?qVt.exports=PRn():qVt.exports=NRn()});var HVt=I(rZ=>{"use strict";p();Object.defineProperty(rZ,"__esModule",{value:!0});rZ.createDeferred=rZ.deferred=void 0;function jVt(){let t,e,r="pending";return{promise:new Promise((o,s)=>{t=o,e=s}),done(o){r==="pending"&&(r="resolved",t(o))},fail(o){r==="pending"&&(r="rejected",e(o))},get fulfilled(){return r!=="pending"},get status(){return r}}}a(jVt,"deferred");rZ.deferred=jVt;rZ.createDeferred=jVt;rZ.default=jVt});var $et=I(IT=>{"use strict";p();Object.defineProperty(IT,"__esModule",{value:!0});IT.deepClone=L2n;IT.deepFreeze=Tas;IT.cloneAndChange=Ias;IT.mixin=F2n;IT.equals=ike;IT.safeStringify=xas;IT.stableStringify=was;IT.distinct=Ras;IT.getCaseInsensitive=kas;IT.filter=Pas;IT.mapValues=Das;var Cj=CT();function L2n(t){if(!t||typeof t!="object"||t instanceof RegExp)return t;let e=Array.isArray(t)?[]:{};return Object.entries(t).forEach(([r,n])=>{e[r]=n&&typeof n=="object"?L2n(n):n}),e}a(L2n,"deepClone");function Tas(t){if(!t||typeof t!="object")return t;let e=[t];for(;e.length>0;){let r=e.shift();Object.freeze(r);for(let n in r)if(B2n.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,Cj.isTypedArray)(o)&&e.push(o)}}return t}a(Tas,"deepFreeze");var B2n=Object.prototype.hasOwnProperty;function Ias(t,e){return $Wt(t,e,new Set)}a(Ias,"cloneAndChange");function $Wt(t,e,r){if((0,Cj.isUndefinedOrNull)(t))return t;let n=e(t);if(typeof n<"u")return n;if(Array.isArray(t)){let o=[];for(let s of t)o.push($Wt(s,e,r));return o}if((0,Cj.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)B2n.call(t,s)&&(o[s]=$Wt(t[s],e,r));return r.delete(t),o}return t}a($Wt,"_cloneAndChange");function F2n(t,e,r=!0){return(0,Cj.isObject)(t)?((0,Cj.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,Cj.isObject)(t[n])&&(0,Cj.isObject)(e[n])?F2n(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(F2n,"mixin");function ike(t,e){if(t===e)return!0;if(t==null||e===null||e===void 0||typeof t!=typeof e||typeof t!="object"||Array.isArray(t)!==Array.isArray(e))return!1;let r,n;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(r=0;r{if((0,Cj.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(xas,"safeStringify");function was(t){if(t===void 0)return"undefined";try{return VWt(t,new WeakSet)}catch{return""}}a(was,"stableStringify");function VWt(t,e){if(t===null||typeof t!="object")return JSON.stringify(t)??"null";if(e.has(t))return'"[Circular]"';if(e.add(t),Array.isArray(t))return"["+t.map(o=>VWt(o,e)).join(",")+"]";let r=Object.keys(t).sort(),n=[];for(let o of r){let s=t[o];s!==void 0&&n.push(JSON.stringify(o)+":"+VWt(s,e))}return"{"+n.join(",")+"}"}a(VWt,"_stableStringify");function Ras(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];ike(s,c)||(r[o]=c)}),r}a(Ras,"distinct");function kas(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(kas,"getCaseInsensitive");function Pas(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(Pas,"filter");function Das(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(Das,"mapValues")});var gv=I(Vet=>{"use strict";p();Object.defineProperty(Vet,"__esModule",{value:!0});Vet.ErrorUtils=void 0;var Nas=$et(),U2n;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,Nas.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(U2n||(Vet.ErrorUtils=U2n={}))});var xT=I(Wet=>{"use strict";p();Object.defineProperty(Wet,"__esModule",{value:!0});Wet.Result=void 0;var WWt=gv(),Q2n;(function(t){function e(c){return new zWt(c)}a(e,"ok"),t.ok=e;function r(c){return new YWt(c)}a(r,"error"),t.error=r;function n(c){return t.error(new Error(c))}a(n,"fromString"),t.fromString=n;function o(c){try{return t.ok(c())}catch(l){return t.error(WWt.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(WWt.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(Q2n||(Wet.Result=Q2n={}));var zWt=class t{static{a(this,"ResultOk")}constructor(e){this.val=e}map(e){return new t(e(this.val))}mapError(e){return this}flatMap(e){return e(this.val)}unwrap(){return this.val}unwrapOr(e){return this.val}isOk(){return!0}isError(){return!1}},YWt=class t{static{a(this,"ResultError")}constructor(e){this.err=e}map(e){return this}mapError(e){return new t(e(this.err))}flatMap(e){return this}unwrap(){throw this.err instanceof Error?this.err:WWt.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var tf=I((Duf,q4n)=>{p();q4n.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")}});var Rc=I((Muf,fLn)=>{"use strict";p();var j4n=Symbol.for("undici.error.UND_ERR"),rf=class extends Error{static{a(this,"UndiciError")}constructor(e){super(e),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[j4n]===!0}[j4n]=!0},H4n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),anr=class extends rf{static{a(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[H4n]===!0}[H4n]=!0},G4n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),cnr=class extends rf{static{a(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[G4n]===!0}[G4n]=!0},$4n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),lnr=class extends rf{static{a(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[$4n]===!0}[$4n]=!0},V4n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),unr=class extends rf{static{a(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[V4n]===!0}[V4n]=!0},W4n=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),dnr=class extends rf{static{a(this,"ResponseStatusCodeError")}constructor(e,r,n,o){super(e),this.name="ResponseStatusCodeError",this.message=e||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=o,this.status=r,this.statusCode=r,this.headers=n}static[Symbol.hasInstance](e){return e&&e[W4n]===!0}[W4n]=!0},z4n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),fnr=class extends rf{static{a(this,"InvalidArgumentError")}constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[z4n]===!0}[z4n]=!0},Y4n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),pnr=class extends rf{static{a(this,"InvalidReturnValueError")}constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[Y4n]===!0}[Y4n]=!0},K4n=Symbol.for("undici.error.UND_ERR_ABORT"),fot=class extends rf{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[K4n]===!0}[K4n]=!0},J4n=Symbol.for("undici.error.UND_ERR_ABORTED"),hnr=class extends fot{static{a(this,"RequestAbortedError")}constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[J4n]===!0}[J4n]=!0},Z4n=Symbol.for("undici.error.UND_ERR_INFO"),mnr=class extends rf{static{a(this,"InformationalError")}constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[Z4n]===!0}[Z4n]=!0},X4n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),gnr=class extends rf{static{a(this,"RequestContentLengthMismatchError")}constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[X4n]===!0}[X4n]=!0},eLn=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),Anr=class extends rf{static{a(this,"ResponseContentLengthMismatchError")}constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[eLn]===!0}[eLn]=!0},tLn=Symbol.for("undici.error.UND_ERR_DESTROYED"),ynr=class extends rf{static{a(this,"ClientDestroyedError")}constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[tLn]===!0}[tLn]=!0},rLn=Symbol.for("undici.error.UND_ERR_CLOSED"),_nr=class extends rf{static{a(this,"ClientClosedError")}constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[rLn]===!0}[rLn]=!0},nLn=Symbol.for("undici.error.UND_ERR_SOCKET"),Enr=class extends rf{static{a(this,"SocketError")}constructor(e,r){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=r}static[Symbol.hasInstance](e){return e&&e[nLn]===!0}[nLn]=!0},iLn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),vnr=class extends rf{static{a(this,"NotSupportedError")}constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[iLn]===!0}[iLn]=!0},oLn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),Cnr=class extends rf{static{a(this,"BalancedPoolMissingUpstreamError")}constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[oLn]===!0}[oLn]=!0},sLn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),bnr=class extends Error{static{a(this,"HTTPParserError")}constructor(e,r,n){super(e),this.name="HTTPParserError",this.code=r?`HPE_${r}`:void 0,this.data=n?n.toString():void 0}static[Symbol.hasInstance](e){return e&&e[sLn]===!0}[sLn]=!0},aLn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),Snr=class extends rf{static{a(this,"ResponseExceededMaxSizeError")}constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[aLn]===!0}[aLn]=!0},cLn=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),Tnr=class extends rf{static{a(this,"RequestRetryError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[cLn]===!0}[cLn]=!0},lLn=Symbol.for("undici.error.UND_ERR_RESPONSE"),Inr=class extends rf{static{a(this,"ResponseError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[lLn]===!0}[lLn]=!0},uLn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),xnr=class extends rf{static{a(this,"SecureProxyConnectionError")}constructor(e,r,n){super(r,{cause:e,...n??{}}),this.name="SecureProxyConnectionError",this.message=r||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[uLn]===!0}[uLn]=!0},dLn=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),wnr=class extends rf{static{a(this,"MessageSizeExceededError")}constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[dLn]===!0}get[dLn](){return!0}};fLn.exports={AbortError:fot,HTTPParserError:bnr,UndiciError:rf,HeadersTimeoutError:cnr,HeadersOverflowError:lnr,BodyTimeoutError:unr,RequestContentLengthMismatchError:gnr,ConnectTimeoutError:anr,ResponseStatusCodeError:dnr,InvalidArgumentError:fnr,InvalidReturnValueError:pnr,RequestAbortedError:hnr,ClientDestroyedError:ynr,ClientClosedError:_nr,InformationalError:mnr,SocketError:Enr,NotSupportedError:vnr,ResponseContentLengthMismatchError:Anr,BalancedPoolMissingUpstreamError:Cnr,ResponseExceededMaxSizeError:Snr,RequestRetryError:Tnr,ResponseError:Inr,SecureProxyConnectionError:xnr,MessageSizeExceededError:wnr}});var hot=I((Buf,pLn)=>{"use strict";p();var pot={},Rnr=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"];for(let t=0;t{"use strict";p();var{wellknownHeaderNames:hLn,headerNameLowerCasedRecord:K0s}=hot(),knr=class t{static{a(this,"TstNode")}value=null;left=null;middle=null;right=null;code;constructor(e,r,n){if(n===void 0||n>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(n))>127)throw new TypeError("key must be ascii string");e.length!==++n?this.middle=new t(e,r,n):this.value=r}add(e,r){let n=e.length;if(n===0)throw new TypeError("Unreachable");let o=0,s=this;for(;;){let c=e.charCodeAt(o);if(c>127)throw new TypeError("key must be ascii string");if(s.code===c)if(n===++o){s.value=r;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,r,o);break}else if(s.code=65&&(s|=32);o!==null;){if(s===o.code){if(r===++n)return o;o=o.middle;break}o=o.code{"use strict";p();var TPe=require("node:assert"),{kDestroyed:_Ln,kBodyUsed:ape,kListeners:Pnr,kBody:yLn}=tf(),{IncomingMessage:J0s}=require("node:http"),yot=require("node:stream"),Z0s=require("node:net"),{Blob:X0s}=require("node:buffer"),eAs=require("node:util"),{stringify:tAs}=require("node:querystring"),{EventEmitter:rAs}=require("node:events"),{InvalidArgumentError:F0}=Rc(),{headerNameLowerCasedRecord:nAs}=hot(),{tree:ELn}=ALn(),[iAs,oAs]=process.versions.node.split(".").map(t=>Number(t)),Aot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[yLn]=e,this[ape]=!1}async*[Symbol.asyncIterator](){TPe(!this[ape],"disturbed"),this[ape]=!0,yield*this[yLn]}};function sAs(t){return _ot(t)?(TLn(t)===0&&t.on("data",function(){TPe(!1)}),typeof t.readableDidRead!="boolean"&&(t[ape]=!1,rAs.prototype.on.call(t,"data",function(){this[ape]=!0})),t):t&&typeof t.pipeTo=="function"?new Aot(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&SLn(t)?new Aot(t):t}a(sAs,"wrapRequestBody");function aAs(){}a(aAs,"nop");function _ot(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(_ot,"isStream");function vLn(t){if(t===null)return!1;if(t instanceof X0s)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}a(vLn,"isBlobLike");function cAs(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=tAs(e);return r&&(t+="?"+r),t}a(cAs,"buildURL");function CLn(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(CLn,"isValidPort");function got(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(got,"isHttpOrHttpsPrefixed");function bLn(t){if(typeof t=="string"){if(t=new URL(t),!got(t.origin||t.protocol))throw new F0("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new F0("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&CLn(t.port)===!1)throw new F0("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new F0("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new F0("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new F0("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new F0("Invalid URL origin: the origin must be a string or null/undefined.");if(!got(t.origin||t.protocol))throw new F0("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!got(t.origin||t.protocol))throw new F0("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(bLn,"parseURL");function lAs(t){if(t=bLn(t),t.pathname!=="/"||t.search||t.hash)throw new F0("invalid url");return t}a(lAs,"parseOrigin");function uAs(t){if(t[0]==="["){let r=t.indexOf("]");return TPe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(uAs,"getHostname");function dAs(t){if(!t)return null;TPe(typeof t=="string");let e=uAs(t);return Z0s.isIP(e)?"":e}a(dAs,"getServerName");function fAs(t){return JSON.parse(JSON.stringify(t))}a(fAs,"deepClone");function pAs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(pAs,"isAsyncIterable");function SLn(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(SLn,"isIterable");function TLn(t){if(t==null)return 0;if(_ot(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(vLn(t))return t.size!=null?t.size:null;if(wLn(t))return t.byteLength}return null}a(TLn,"bodyLength");function ILn(t){return t&&!!(t.destroyed||t[_Ln]||yot.isDestroyed?.(t))}a(ILn,"isDestroyed");function hAs(t,e){t==null||!_ot(t)||ILn(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===J0s&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[_Ln]=!0))}a(hAs,"destroy");var mAs=/timeout=(\d+)/;function gAs(t){let e=t.toString().match(mAs);return e?parseInt(e[1],10)*1e3:null}a(gAs,"parseKeepAliveTimeout");function xLn(t){return typeof t=="string"?nAs[t]??t.toLowerCase():ELn.lookup(t)??t.toString("latin1").toLowerCase()}a(xLn,"headerNameToString");function AAs(t){return ELn.lookup(t)??t.toString("latin1").toLowerCase()}a(AAs,"bufferToLowerCasedHeaderName");function yAs(t,e){e===void 0&&(e={});for(let r=0;rc.toString("utf8")):s.toString("utf8")}}return"content-length"in e&&"content-disposition"in e&&(e["content-disposition"]=Buffer.from(e["content-disposition"]).toString("latin1")),e}a(yAs,"parseHeaders");function _As(t){let e=t.length,r=new Array(e),n=!1,o=-1,s,c,l=0;for(let u=0;u{r.close(),r.byobRequest?.respond(0)});else{let s=Buffer.isBuffer(o)?o:Buffer.from(o);s.byteLength&&r.enqueue(new Uint8Array(s))}return r.desiredSize>0},async cancel(r){await e.return()},type:"bytes"})}a(TAs,"ReadableStreamFrom");function IAs(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}a(IAs,"isFormDataLike");function xAs(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.addListener("abort",e),()=>t.removeListener("abort",e))}a(xAs,"addAbortListener");var wAs=typeof String.prototype.toWellFormed=="function",RAs=typeof String.prototype.isWellFormed=="function";function RLn(t){return wAs?`${t}`.toWellFormed():eAs.toUSVString(t)}a(RLn,"toUSVString");function kAs(t){return RAs?`${t}`.isWellFormed():RLn(t)===`${t}`}a(kAs,"isUSVString");function kLn(t){switch(t){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return!1;default:return t>=33&&t<=126}}a(kLn,"isTokenCharCode");function PAs(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Xc=require("node:diagnostics_channel"),Mnr=require("node:util"),Eot=Mnr.debuglog("undici"),Nnr=Mnr.debuglog("fetch"),LZ=Mnr.debuglog("websocket"),MLn=!1,FAs={beforeConnect:Xc.channel("undici:client:beforeConnect"),connected:Xc.channel("undici:client:connected"),connectError:Xc.channel("undici:client:connectError"),sendHeaders:Xc.channel("undici:client:sendHeaders"),create:Xc.channel("undici:request:create"),bodySent:Xc.channel("undici:request:bodySent"),headers:Xc.channel("undici:request:headers"),trailers:Xc.channel("undici:request:trailers"),error:Xc.channel("undici:request:error"),open:Xc.channel("undici:websocket:open"),close:Xc.channel("undici:websocket:close"),socketError:Xc.channel("undici:websocket:socket_error"),ping:Xc.channel("undici:websocket:ping"),pong:Xc.channel("undici:websocket:pong")};if(Eot.enabled||Nnr.enabled){let t=Nnr.enabled?Nnr:Eot;Xc.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s using %s%s",`${s}${o?`:${o}`:""}`,n,r)}),Xc.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s using %s%s",`${s}${o?`:${o}`:""}`,n,r)}),Xc.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s using %s%s errored - %s",`${s}${o?`:${o}`:""}`,n,r,c.message)}),Xc.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s/%s",r,o,n)}),Xc.channel("undici:request:headers").subscribe(e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s/%s - HTTP %d",r,o,n,s)}),Xc.channel("undici:request:trailers").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s/%s",r,o,n)}),Xc.channel("undici:request:error").subscribe(e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s/%s errored - %s",r,o,n,s.message)}),MLn=!0}if(LZ.enabled){if(!MLn){let t=Eot.enabled?Eot:LZ;Xc.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),Xc.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),Xc.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),Xc.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s/%s",r,o,n)})}Xc.channel("undici:websocket:open").subscribe(t=>{let{address:{address:e,port:r}}=t;LZ("connection opened %s%s",e,r?`:${r}`:"")}),Xc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;LZ("closed connection to %s - %s %s",e.url,r,n)}),Xc.channel("undici:websocket:socket_error").subscribe(t=>{LZ("connection errored - %s",t.message)}),Xc.channel("undici:websocket:ping").subscribe(t=>{LZ("ping received")}),Xc.channel("undici:websocket:pong").subscribe(t=>{LZ("pong received")})}OLn.exports={channels:FAs}});var ULn=I((Wuf,FLn)=>{"use strict";p();var{InvalidArgumentError:Mu,NotSupportedError:UAs}=Rc(),s8=require("node:assert"),{isValidHTTPToken:BLn,isValidHeaderValue:Onr,isStream:QAs,destroy:qAs,isBuffer:jAs,isFormDataLike:HAs,isIterable:GAs,isBlobLike:$As,buildURL:VAs,validateHandler:WAs,getServerName:zAs,normalizedMethodRecords:YAs}=Ws(),{channels:G5}=cpe(),{headerNameLowerCasedRecord:LLn}=hot(),KAs=/[^\u0021-\u00ff]/,Vw=Symbol("handler"),Lnr=class{static{a(this,"Request")}constructor(e,{path:r,method:n,body:o,headers:s,query:c,idempotent:l,blocking:u,upgrade:d,headersTimeout:f,bodyTimeout:h,reset:m,throwOnError:g,expectContinue:A,servername:y},_){if(typeof r!="string")throw new Mu("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Mu("path must be an absolute URL or start with a slash");if(KAs.test(r))throw new Mu("invalid request path");if(typeof n!="string")throw new Mu("method must be a string");if(YAs[n]===void 0&&!BLn(n))throw new Mu("invalid request method");if(d&&typeof d!="string")throw new Mu("upgrade must be a string");if(d&&!Onr(d))throw new Mu("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Mu("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Mu("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Mu("invalid reset");if(A!=null&&typeof A!="boolean")throw new Mu("invalid expectContinue");if(this.headersTimeout=f,this.bodyTimeout=h,this.throwOnError=g===!0,this.method=n,this.abort=null,o==null)this.body=null;else if(QAs(o)){this.body=o;let E=this.body._readableState;(!E||!E.autoDestroy)&&(this.endHandler=a(function(){qAs(this)},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=v=>{this.abort?this.abort(v):this.error=v},this.body.on("error",this.errorHandler)}else if(jAs(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if(typeof o=="string")this.body=o.length?Buffer.from(o):null;else if(HAs(o)||GAs(o)||$As(o))this.body=o;else throw new Mu("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=d||null,this.path=c?VAs(r,c):r,this.origin=e,this.idempotent=l??(n==="HEAD"||n==="GET"),this.blocking=u??!1,this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=A??!1,Array.isArray(s)){if(s.length%2!==0)throw new Mu("headers array must be even");for(let E=0;E{"use strict";p();var JAs=require("node:events"),Cot=class extends JAs{static{a(this,"Dispatcher")}dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let r=Array.isArray(e[0])?e[0]:e,n=this.dispatch.bind(this);for(let o of r)if(o!=null){if(typeof o!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof o}`);if(n=o(n),n==null||typeof n!="function"||n.length!==2)throw new TypeError("invalid interceptor")}return new Bnr(this,n)}},Bnr=class extends Cot{static{a(this,"ComposedDispatcher")}#e=null;#t=null;constructor(e,r){super(),this.#e=e,this.#t=r}dispatch(...e){this.#t(...e)}close(...e){return this.#e.close(...e)}destroy(...e){return this.#e.destroy(...e)}};QLn.exports=Cot});var fpe=I((Xuf,qLn)=>{"use strict";p();var ZAs=IPe(),{ClientDestroyedError:Fnr,ClientClosedError:XAs,InvalidArgumentError:lpe}=Rc(),{kDestroy:eys,kClose:tys,kClosed:xPe,kDestroyed:upe,kDispatch:Unr,kInterceptors:BZ}=tf(),a8=Symbol("onDestroyed"),dpe=Symbol("onClosed"),bot=Symbol("Intercepted Dispatch"),Qnr=class extends ZAs{static{a(this,"DispatcherBase")}constructor(){super(),this[upe]=!1,this[a8]=null,this[xPe]=!1,this[dpe]=[]}get destroyed(){return this[upe]}get closed(){return this[xPe]}get interceptors(){return this[BZ]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[BZ][r]!="function")throw new lpe("interceptor must be an function")}this[BZ]=e}close(e){if(e===void 0)return new Promise((n,o)=>{this.close((s,c)=>s?o(s):n(c))});if(typeof e!="function")throw new lpe("invalid callback");if(this[upe]){queueMicrotask(()=>e(new Fnr,null));return}if(this[xPe]){this[dpe]?this[dpe].push(e):queueMicrotask(()=>e(null,null));return}this[xPe]=!0,this[dpe].push(e);let r=a(()=>{let n=this[dpe];this[dpe]=null;for(let o=0;othis.destroy()).then(()=>{queueMicrotask(r)})}destroy(e,r){if(typeof e=="function"&&(r=e,e=null),r===void 0)return new Promise((o,s)=>{this.destroy(e,(c,l)=>c?s(c):o(l))});if(typeof r!="function")throw new lpe("invalid callback");if(this[upe]){this[a8]?this[a8].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new Fnr),this[upe]=!0,this[a8]=this[a8]||[],this[a8].push(r);let n=a(()=>{let o=this[a8];this[a8]=null;for(let s=0;s{queueMicrotask(n)})}[bot](e,r){if(!this[BZ]||this[BZ].length===0)return this[bot]=this[Unr],this[Unr](e,r);let n=this[Unr].bind(this);for(let o=this[BZ].length-1;o>=0;o--)n=this[BZ][o](n);return this[bot]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new lpe("handler must be an object");try{if(!e||typeof e!="object")throw new lpe("opts must be an object.");if(this[upe]||this[a8])throw new Fnr;if(this[xPe])throw new XAs;return this[bot](e,r)}catch(n){if(typeof r.onError!="function")throw new lpe("invalid onError method");return r.onError(n),!1}}};qLn.exports=Qnr});var Wnr=I((rdf,$Ln)=>{"use strict";p();var ppe=0,qnr=1e3,jnr=(qnr>>1)-1,c8,Hnr=Symbol("kFastTimer"),l8=[],Gnr=-2,$nr=-1,HLn=0,jLn=1;function Vnr(){ppe+=jnr;let t=0,e=l8.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=$nr,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===$nr?(r._state=Gnr,--e!==0&&(l8[t]=l8[e])):++t}l8.length=e,l8.length!==0&&GLn()}a(Vnr,"onTick");function GLn(){c8?c8.refresh():(clearTimeout(c8),c8=setTimeout(Vnr,jnr),c8.unref&&c8.unref())}a(GLn,"refreshTimeout");var Sot=class{static{a(this,"FastTimer")}[Hnr]=!0;_state=Gnr;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===Gnr&&l8.push(this),(!c8||l8.length===1)&&GLn(),this._state=HLn}clear(){this._state=$nr,this._idleStart=-1}};$Ln.exports={setTimeout(t,e,r){return e<=qnr?setTimeout(t,e,r):new Sot(t,e,r)},clearTimeout(t){t[Hnr]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Sot(t,e,r)},clearFastTimeout(t){t.clear()},now(){return ppe},tick(t=0){ppe+=t-qnr+1,Vnr(),Vnr()},reset(){ppe=0,l8.length=0,clearTimeout(c8),c8=null},kFastTimer:Hnr}});var wPe=I((adf,KLn)=>{"use strict";p();var rys=require("node:net"),VLn=require("node:assert"),YLn=Ws(),{InvalidArgumentError:nys,ConnectTimeoutError:iys}=Rc(),Tot=Wnr();function WLn(){}a(WLn,"noop");var znr,Ynr;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?Ynr=class{static{a(this,"WeakSessionCache")}constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new global.FinalizationRegistry(r=>{if(this._sessionCache.size=this._maxCachedSessions){let{value:n}=this._sessionCache.keys().next();this._sessionCache.delete(n)}this._sessionCache.set(e,r)}}};function oys({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new nys("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new Ynr(e??100);return n=n??1e4,t=t??!1,a(function({hostname:d,host:f,protocol:h,port:m,servername:g,localAddress:A,httpSocket:y},_){let E;if(h==="https:"){znr||(znr=require("node:tls")),g=g||c.servername||YLn.getServerName(f)||null;let S=g||d;VLn(S);let T=o||l.get(S)||null;m=m||443,E=znr.connect({highWaterMark:16384,...c,servername:g,session:T,localAddress:A,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:y,port:m,host:d}),E.on("session",function(w){l.set(S,w)})}else VLn(!y,"httpSocket can only be sent on TLS update"),m=m||80,E=rys.connect({highWaterMark:64*1024,...c,localAddress:A,port:m,host:d});if(c.keepAlive==null||c.keepAlive){let S=c.keepAliveInitialDelay===void 0?6e4:c.keepAliveInitialDelay;E.setKeepAlive(!0,S)}let v=sys(new WeakRef(E),{timeout:n,hostname:d,port:m});return E.setNoDelay(!0).once(h==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(v),_){let S=_;_=null,S(null,this)}}).on("error",function(S){if(queueMicrotask(v),_){let T=_;_=null,T(S)}}),E},"connect")}a(oys,"buildConnector");var sys=process.platform==="win32"?(t,e)=>{if(!e.timeout)return WLn;let r=null,n=null,o=Tot.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>zLn(t.deref(),e))})},e.timeout);return()=>{Tot.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return WLn;let r=null,n=Tot.setFastTimeout(()=>{r=setImmediate(()=>{zLn(t.deref(),e)})},e.timeout);return()=>{Tot.clearFastTimeout(n),clearImmediate(r)}};function zLn(t,e){if(t==null)return;let r="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${e.hostname}:${e.port},`,r+=` timeout: ${e.timeout}ms)`,YLn.destroy(t,new iys(r))}a(zLn,"onConnectTimeout");KLn.exports=oys});var JLn=I(Iot=>{"use strict";p();Object.defineProperty(Iot,"__esModule",{value:!0});Iot.enumToMap=void 0;function ays(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(ays,"enumToMap");Iot.enumToMap=ays});var ZLn=I(Mr=>{"use strict";p();Object.defineProperty(Mr,"__esModule",{value:!0});Mr.SPECIAL_HEADERS=Mr.HEADER_STATE=Mr.MINOR=Mr.MAJOR=Mr.CONNECTION_TOKEN_CHARS=Mr.HEADER_CHARS=Mr.TOKEN=Mr.STRICT_TOKEN=Mr.HEX=Mr.URL_CHAR=Mr.STRICT_URL_CHAR=Mr.USERINFO_CHARS=Mr.MARK=Mr.ALPHANUM=Mr.NUM=Mr.HEX_MAP=Mr.NUM_MAP=Mr.ALPHA=Mr.FINISH=Mr.H_METHOD_MAP=Mr.METHOD_MAP=Mr.METHODS_RTSP=Mr.METHODS_ICE=Mr.METHODS_HTTP=Mr.METHODS=Mr.LENIENT_FLAGS=Mr.FLAGS=Mr.TYPE=Mr.ERROR=void 0;var cys=JLn(),lys;(function(t){t[t.OK=0]="OK",t[t.INTERNAL=1]="INTERNAL",t[t.STRICT=2]="STRICT",t[t.LF_EXPECTED=3]="LF_EXPECTED",t[t.UNEXPECTED_CONTENT_LENGTH=4]="UNEXPECTED_CONTENT_LENGTH",t[t.CLOSED_CONNECTION=5]="CLOSED_CONNECTION",t[t.INVALID_METHOD=6]="INVALID_METHOD",t[t.INVALID_URL=7]="INVALID_URL",t[t.INVALID_CONSTANT=8]="INVALID_CONSTANT",t[t.INVALID_VERSION=9]="INVALID_VERSION",t[t.INVALID_HEADER_TOKEN=10]="INVALID_HEADER_TOKEN",t[t.INVALID_CONTENT_LENGTH=11]="INVALID_CONTENT_LENGTH",t[t.INVALID_CHUNK_SIZE=12]="INVALID_CHUNK_SIZE",t[t.INVALID_STATUS=13]="INVALID_STATUS",t[t.INVALID_EOF_STATE=14]="INVALID_EOF_STATE",t[t.INVALID_TRANSFER_ENCODING=15]="INVALID_TRANSFER_ENCODING",t[t.CB_MESSAGE_BEGIN=16]="CB_MESSAGE_BEGIN",t[t.CB_HEADERS_COMPLETE=17]="CB_HEADERS_COMPLETE",t[t.CB_MESSAGE_COMPLETE=18]="CB_MESSAGE_COMPLETE",t[t.CB_CHUNK_HEADER=19]="CB_CHUNK_HEADER",t[t.CB_CHUNK_COMPLETE=20]="CB_CHUNK_COMPLETE",t[t.PAUSED=21]="PAUSED",t[t.PAUSED_UPGRADE=22]="PAUSED_UPGRADE",t[t.PAUSED_H2_UPGRADE=23]="PAUSED_H2_UPGRADE",t[t.USER=24]="USER"})(lys=Mr.ERROR||(Mr.ERROR={}));var uys;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(uys=Mr.TYPE||(Mr.TYPE={}));var dys;(function(t){t[t.CONNECTION_KEEP_ALIVE=1]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=2]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=4]="CONNECTION_UPGRADE",t[t.CHUNKED=8]="CHUNKED",t[t.UPGRADE=16]="UPGRADE",t[t.CONTENT_LENGTH=32]="CONTENT_LENGTH",t[t.SKIPBODY=64]="SKIPBODY",t[t.TRAILING=128]="TRAILING",t[t.TRANSFER_ENCODING=512]="TRANSFER_ENCODING"})(dys=Mr.FLAGS||(Mr.FLAGS={}));var fys;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(fys=Mr.LENIENT_FLAGS||(Mr.LENIENT_FLAGS={}));var Bi;(function(t){t[t.DELETE=0]="DELETE",t[t.GET=1]="GET",t[t.HEAD=2]="HEAD",t[t.POST=3]="POST",t[t.PUT=4]="PUT",t[t.CONNECT=5]="CONNECT",t[t.OPTIONS=6]="OPTIONS",t[t.TRACE=7]="TRACE",t[t.COPY=8]="COPY",t[t.LOCK=9]="LOCK",t[t.MKCOL=10]="MKCOL",t[t.MOVE=11]="MOVE",t[t.PROPFIND=12]="PROPFIND",t[t.PROPPATCH=13]="PROPPATCH",t[t.SEARCH=14]="SEARCH",t[t.UNLOCK=15]="UNLOCK",t[t.BIND=16]="BIND",t[t.REBIND=17]="REBIND",t[t.UNBIND=18]="UNBIND",t[t.ACL=19]="ACL",t[t.REPORT=20]="REPORT",t[t.MKACTIVITY=21]="MKACTIVITY",t[t.CHECKOUT=22]="CHECKOUT",t[t.MERGE=23]="MERGE",t[t["M-SEARCH"]=24]="M-SEARCH",t[t.NOTIFY=25]="NOTIFY",t[t.SUBSCRIBE=26]="SUBSCRIBE",t[t.UNSUBSCRIBE=27]="UNSUBSCRIBE",t[t.PATCH=28]="PATCH",t[t.PURGE=29]="PURGE",t[t.MKCALENDAR=30]="MKCALENDAR",t[t.LINK=31]="LINK",t[t.UNLINK=32]="UNLINK",t[t.SOURCE=33]="SOURCE",t[t.PRI=34]="PRI",t[t.DESCRIBE=35]="DESCRIBE",t[t.ANNOUNCE=36]="ANNOUNCE",t[t.SETUP=37]="SETUP",t[t.PLAY=38]="PLAY",t[t.PAUSE=39]="PAUSE",t[t.TEARDOWN=40]="TEARDOWN",t[t.GET_PARAMETER=41]="GET_PARAMETER",t[t.SET_PARAMETER=42]="SET_PARAMETER",t[t.REDIRECT=43]="REDIRECT",t[t.RECORD=44]="RECORD",t[t.FLUSH=45]="FLUSH"})(Bi=Mr.METHODS||(Mr.METHODS={}));Mr.METHODS_HTTP=[Bi.DELETE,Bi.GET,Bi.HEAD,Bi.POST,Bi.PUT,Bi.CONNECT,Bi.OPTIONS,Bi.TRACE,Bi.COPY,Bi.LOCK,Bi.MKCOL,Bi.MOVE,Bi.PROPFIND,Bi.PROPPATCH,Bi.SEARCH,Bi.UNLOCK,Bi.BIND,Bi.REBIND,Bi.UNBIND,Bi.ACL,Bi.REPORT,Bi.MKACTIVITY,Bi.CHECKOUT,Bi.MERGE,Bi["M-SEARCH"],Bi.NOTIFY,Bi.SUBSCRIBE,Bi.UNSUBSCRIBE,Bi.PATCH,Bi.PURGE,Bi.MKCALENDAR,Bi.LINK,Bi.UNLINK,Bi.PRI,Bi.SOURCE];Mr.METHODS_ICE=[Bi.SOURCE];Mr.METHODS_RTSP=[Bi.OPTIONS,Bi.DESCRIBE,Bi.ANNOUNCE,Bi.SETUP,Bi.PLAY,Bi.PAUSE,Bi.TEARDOWN,Bi.GET_PARAMETER,Bi.SET_PARAMETER,Bi.REDIRECT,Bi.RECORD,Bi.FLUSH,Bi.GET,Bi.POST];Mr.METHOD_MAP=cys.enumToMap(Bi);Mr.H_METHOD_MAP={};Object.keys(Mr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(Mr.H_METHOD_MAP[t]=Mr.METHOD_MAP[t])});var pys;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(pys=Mr.FINISH||(Mr.FINISH={}));Mr.ALPHA=[];for(let t=65;t<=90;t++)Mr.ALPHA.push(String.fromCharCode(t)),Mr.ALPHA.push(String.fromCharCode(t+32));Mr.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};Mr.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};Mr.NUM=["0","1","2","3","4","5","6","7","8","9"];Mr.ALPHANUM=Mr.ALPHA.concat(Mr.NUM);Mr.MARK=["-","_",".","!","~","*","'","(",")"];Mr.USERINFO_CHARS=Mr.ALPHANUM.concat(Mr.MARK).concat(["%",";",":","&","=","+","$",","]);Mr.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(Mr.ALPHANUM);Mr.URL_CHAR=Mr.STRICT_URL_CHAR.concat([" ","\f"]);for(let t=128;t<=255;t++)Mr.URL_CHAR.push(t);Mr.HEX=Mr.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);Mr.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(Mr.ALPHANUM);Mr.TOKEN=Mr.STRICT_TOKEN.concat([" "]);Mr.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&Mr.HEADER_CHARS.push(t);Mr.CONNECTION_TOKEN_CHARS=Mr.HEADER_CHARS.filter(t=>t!==44);Mr.MAJOR=Mr.NUM_MAP;Mr.MINOR=Mr.MAJOR;var hpe;(function(t){t[t.GENERAL=0]="GENERAL",t[t.CONNECTION=1]="CONNECTION",t[t.CONTENT_LENGTH=2]="CONTENT_LENGTH",t[t.TRANSFER_ENCODING=3]="TRANSFER_ENCODING",t[t.UPGRADE=4]="UPGRADE",t[t.CONNECTION_KEEP_ALIVE=5]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=6]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=7]="CONNECTION_UPGRADE",t[t.TRANSFER_ENCODING_CHUNKED=8]="TRANSFER_ENCODING_CHUNKED"})(hpe=Mr.HEADER_STATE||(Mr.HEADER_STATE={}));Mr.SPECIAL_HEADERS={connection:hpe.CONNECTION,"content-length":hpe.CONTENT_LENGTH,"proxy-connection":hpe.CONNECTION,"transfer-encoding":hpe.TRANSFER_ENCODING,upgrade:hpe.UPGRADE}});var Knr=I((mdf,XLn)=>{"use strict";p();var{Buffer:hys}=require("node:buffer");XLn.exports=hys.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv","base64")});var tBn=I((Adf,eBn)=>{"use strict";p();var{Buffer:mys}=require("node:buffer");eBn.exports=mys.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==","base64")});var RPe=I((_df,lBn)=>{"use strict";p();var rBn=["GET","HEAD","POST"],gys=new Set(rBn),Ays=[101,204,205,304],nBn=[301,302,303,307,308],yys=new Set(nBn),iBn=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],_ys=new Set(iBn),oBn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],Eys=new Set(oBn),vys=["follow","manual","error"],sBn=["GET","HEAD","OPTIONS","TRACE"],Cys=new Set(sBn),bys=["navigate","same-origin","no-cors","cors"],Sys=["omit","same-origin","include"],Tys=["default","no-store","reload","no-cache","force-cache","only-if-cached"],Iys=["content-encoding","content-language","content-location","content-type","content-length"],xys=["half"],aBn=["CONNECT","TRACE","TRACK"],wys=new Set(aBn),cBn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],Rys=new Set(cBn);lBn.exports={subresource:cBn,forbiddenMethods:aBn,requestBodyHeader:Iys,referrerPolicy:oBn,requestRedirect:vys,requestMode:bys,requestCredentials:Sys,requestCache:Tys,redirectStatus:nBn,corsSafeListedMethods:rBn,nullBodyStatus:Ays,safeMethods:sBn,badPorts:iBn,requestDuplex:xys,subresourceSet:Rys,badPortsSet:_ys,redirectStatusSet:yys,corsSafeListedMethodsSet:gys,safeMethodsSet:Cys,forbiddenMethodsSet:wys,referrerPolicySet:Eys}});var Znr=I((vdf,uBn)=>{"use strict";p();var Jnr=Symbol.for("undici.globalOrigin.1");function kys(){return globalThis[Jnr]}a(kys,"getGlobalOrigin");function Pys(t){if(t===void 0){Object.defineProperty(globalThis,Jnr,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,Jnr,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(Pys,"setGlobalOrigin");uBn.exports={getGlobalOrigin:kys,setGlobalOrigin:Pys}});var xb=I((Sdf,ABn)=>{"use strict";p();var wot=require("node:assert"),Dys=new TextEncoder,kPe=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,Nys=/[\u000A\u000D\u0009\u0020]/,Mys=/[\u0009\u000A\u000C\u000D\u0020]/g,Oys=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function Lys(t){wot(t.protocol==="data:");let e=pBn(t,!0);e=e.slice(5);let r={position:0},n=mpe(",",e,r),o=n.length;if(n=jys(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=hBn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=gBn(c);if(c=Fys(u),c==="failure")return"failure";n=n.slice(0,-6),n=n.replace(/(\u0020)+$/,""),n=n.slice(0,-1)}n.startsWith(";")&&(n="text/plain"+n);let l=Xnr(n);return l==="failure"&&(l=Xnr("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(Lys,"dataURLProcessor");function pBn(t,e=!1){if(!e)return t.href;let r=t.href,n=t.hash.length,o=n===0?r:r.substring(0,r.length-n);return!n&&r.endsWith("#")?o.slice(0,-1):o}a(pBn,"URLSerializer");function Rot(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(dBn,"isHexCharByte");function fBn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(fBn,"hexByteToNumber");function Bys(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=mpe(";",t,e);if(n=xot(n,!1,!0),n.length===0||!kPe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionNys.test(d),t,e);let l=Rot(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=mBn(t,e,!0),mpe(";",t,e);else if(u=mpe(";",t,e),u=xot(u,!1,!0),u.length===0)continue;l.length!==0&&kPe.test(l)&&(u.length===0||Oys.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(Xnr,"parseMIMEType");function Fys(t){t=t.replace(Mys,"");let e=t.length;if(e%4===0&&t.charCodeAt(e-1)===61&&(--e,t.charCodeAt(e-1)===61&&--e),e%4===1||/[^+/0-9A-Za-z]/.test(t.length===e?t:t.substring(0,e)))return"failure";let r=Buffer.from(t,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}a(Fys,"forgivingBase64");function mBn(t,e,r){let n=e.position,o="";for(wot(t[e.position]==='"'),e.position++;o+=Rot(c=>c!=='"'&&c!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){o+="\\";break}o+=t[e.position],e.position++}else{wot(s==='"');break}}return r?o:t.slice(n,e.position)}a(mBn,"collectAnHTTPQuotedString");function Uys(t){wot(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",kPe.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(Uys,"serializeAMimeType");function Qys(t){return t===13||t===10||t===9||t===32}a(Qys,"isHTTPWhiteSpace");function xot(t,e=!0,r=!0){return eir(t,e,r,Qys)}a(xot,"removeHTTPWhitespace");function qys(t){return t===13||t===10||t===9||t===12||t===32}a(qys,"isASCIIWhitespace");function jys(t,e=!0,r=!0){return eir(t,e,r,qys)}a(jys,"removeASCIIWhitespace");function eir(t,e,r,n){let o=0,s=t.length-1;if(e)for(;o0&&n(t.charCodeAt(s));)s--;return o===0&&s===t.length-1?t:t.slice(o,s+1)}a(eir,"removeChars");function gBn(t){let e=t.length;if(65535>e)return String.fromCharCode.apply(null,t);let r="",n=0,o=65535;for(;ne&&(o=e-n),r+=String.fromCharCode.apply(null,t.subarray(n,n+=o));return r}a(gBn,"isomorphicDecode");function Hys(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}a(Hys,"minimizeSupportedMimeType");ABn.exports={dataURLProcessor:Lys,URLSerializer:pBn,collectASequenceOfCodePoints:Rot,collectASequenceOfCodePointsFast:mpe,stringPercentDecode:hBn,parseMIMEType:Xnr,collectAnHTTPQuotedString:mBn,serializeAMimeType:Uys,removeChars:eir,removeHTTPWhitespace:xot,minimizeSupportedMimeType:Hys,HTTP_TOKEN_CODEPOINTS:kPe,isomorphicDecode:gBn}});var ty=I((xdf,yBn)=>{"use strict";p();var{types:$5,inspect:Gys}=require("node:util"),{markAsUncloneable:$ys}=require("node:worker_threads"),{toUSVString:Vys}=Ws(),Sr={};Sr.converters={};Sr.util={};Sr.errors={};Sr.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};Sr.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return Sr.errors.exception({header:t.prefix,message:r})};Sr.errors.invalidArgument=function(t){return Sr.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};Sr.brandCheck=function(t,e,r){if(r?.strict!==!1){if(!(t instanceof e)){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}else if(t?.[Symbol.toStringTag]!==e.prototype[Symbol.toStringTag]){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}};Sr.argumentLengthCheck=function({length:t},e,r){if(t{});Sr.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=Math.pow(-2,e)-1,o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),n?.enforceRange===!0){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw Sr.errors.exception({header:"Integer conversion",message:`Could not convert ${Sr.util.Stringify(t)} to an integer.`});if(c=Sr.util.IntegerPart(c),co)throw Sr.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&n?.clamp===!0?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=Sr.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e)-1?c-Math.pow(2,e):c)};Sr.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};Sr.util.Stringify=function(t){switch(Sr.util.Type(t)){case"Symbol":return`Symbol(${t.description})`;case"Object":return Gys(t);case"String":return`"${t}"`;default:return`${t}`}};Sr.sequenceConverter=function(t){return(e,r,n,o)=>{if(Sr.util.Type(e)!=="Object")throw Sr.errors.exception({header:r,message:`${n} (${Sr.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw Sr.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};Sr.recordConverter=function(t,e){return(r,n,o)=>{if(Sr.util.Type(r)!=="Object")throw Sr.errors.exception({header:n,message:`${o} ("${Sr.util.Type(r)}") is not an Object.`});let s={};if(!$5.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=t(u,n,o),f=e(r[u],n,o);s[d]=f}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};Sr.interfaceConverter=function(t){return(e,r,n,o)=>{if(o?.strict!==!1&&!(e instanceof t))throw Sr.errors.exception({header:r,message:`Expected ${n} ("${Sr.util.Stringify(e)}") to be an instance of ${t.name}.`});return e}};Sr.dictionaryConverter=function(t){return(e,r,n)=>{let o=Sr.util.Type(e),s={};if(o==="Null"||o==="Undefined")return s;if(o!=="Object")throw Sr.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let c of t){let{key:l,defaultValue:u,required:d,converter:f}=c;if(d===!0&&!Object.hasOwn(e,l))throw Sr.errors.exception({header:r,message:`Missing required key "${l}".`});let h=e[l],m=Object.hasOwn(c,"defaultValue");if(m&&h!==null&&(h??=u()),d||m||h!==void 0){if(h=f(h,r,`${n}.${l}`),c.allowedValues&&!c.allowedValues.includes(h))throw Sr.errors.exception({header:r,message:`${h} is not an accepted type. Expected one of ${c.allowedValues.join(", ")}.`});s[l]=h}}return s}};Sr.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};Sr.converters.DOMString=function(t,e,r,n){if(t===null&&n?.legacyNullToEmptyString)return"";if(typeof t=="symbol")throw Sr.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};Sr.converters.ByteString=function(t,e,r){let n=Sr.converters.DOMString(t,e,r);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};Sr.converters.USVString=Vys;Sr.converters.boolean=function(t){return!!t};Sr.converters.any=function(t){return t};Sr.converters["long long"]=function(t,e,r){return Sr.util.ConvertToInt(t,64,"signed",void 0,e,r)};Sr.converters["unsigned long long"]=function(t,e,r){return Sr.util.ConvertToInt(t,64,"unsigned",void 0,e,r)};Sr.converters["unsigned long"]=function(t,e,r){return Sr.util.ConvertToInt(t,32,"unsigned",void 0,e,r)};Sr.converters["unsigned short"]=function(t,e,r,n){return Sr.util.ConvertToInt(t,16,"unsigned",n,e,r)};Sr.converters.ArrayBuffer=function(t,e,r,n){if(Sr.util.Type(t)!=="Object"||!$5.isAnyArrayBuffer(t))throw Sr.errors.conversionFailed({prefix:e,argument:`${r} ("${Sr.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&$5.isSharedArrayBuffer(t))throw Sr.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.resizable||t.growable)throw Sr.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Sr.converters.TypedArray=function(t,e,r,n,o){if(Sr.util.Type(t)!=="Object"||!$5.isTypedArray(t)||t.constructor.name!==e.name)throw Sr.errors.conversionFailed({prefix:r,argument:`${n} ("${Sr.util.Stringify(t)}")`,types:[e.name]});if(o?.allowShared===!1&&$5.isSharedArrayBuffer(t.buffer))throw Sr.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Sr.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Sr.converters.DataView=function(t,e,r,n){if(Sr.util.Type(t)!=="Object"||!$5.isDataView(t))throw Sr.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&$5.isSharedArrayBuffer(t.buffer))throw Sr.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Sr.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Sr.converters.BufferSource=function(t,e,r,n){if($5.isAnyArrayBuffer(t))return Sr.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if($5.isTypedArray(t))return Sr.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if($5.isDataView(t))return Sr.converters.DataView(t,e,r,{...n,allowShared:!1});throw Sr.errors.conversionFailed({prefix:e,argument:`${r} ("${Sr.util.Stringify(t)}")`,types:["BufferSource"]})};Sr.converters["sequence"]=Sr.sequenceConverter(Sr.converters.ByteString);Sr.converters["sequence>"]=Sr.sequenceConverter(Sr.converters["sequence"]);Sr.converters["record"]=Sr.recordConverter(Sr.converters.ByteString,Sr.converters.ByteString);yBn.exports={webidl:Sr}});var NT=I((Rdf,DBn)=>{"use strict";p();var{Transform:Wys}=require("node:stream"),_Bn=require("node:zlib"),{redirectStatusSet:zys,referrerPolicySet:Yys,badPortsSet:Kys}=RPe(),{getGlobalOrigin:EBn}=Znr(),{collectASequenceOfCodePoints:FZ,collectAnHTTPQuotedString:Jys,removeChars:Zys,parseMIMEType:Xys}=xb(),{performance:e_s}=require("node:perf_hooks"),{isBlobLike:t_s,ReadableStreamFrom:r_s,isValidHTTPToken:vBn,normalizedMethodRecordsBase:n_s}=Ws(),UZ=require("node:assert"),{isUint8Array:i_s}=require("node:util/types"),{webidl:PPe}=ty(),CBn=[],Pot;try{Pot=require("node:crypto");let t=["sha256","sha384","sha512"];CBn=Pot.getHashes().filter(e=>t.includes(e))}catch{}function bBn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(bBn,"responseURL");function o_s(t,e){if(!zys.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&TBn(r)&&(SBn(r)||(r=s_s(r)),r=new URL(r,bBn(t))),r&&!r.hash&&(r.hash=e),r}a(o_s,"responseLocationURL");function SBn(t){for(let e=0;e126||r<32)return!1}return!0}a(SBn,"isValidEncodedURL");function s_s(t){return Buffer.from(t,"binary").toString("utf8")}a(s_s,"normalizeBinaryStringToUtf8");function NPe(t){return t.urlList[t.urlList.length-1]}a(NPe,"requestCurrentURL");function a_s(t){let e=NPe(t);return kBn(e)&&Kys.has(e.port)?"blocked":"allowed"}a(a_s,"requestBadPort");function c_s(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(c_s,"isErrorLike");function l_s(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(l_s,"isValidReasonPhrase");var u_s=vBn;function TBn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}a(TBn,"isValidHeaderValue");function d_s(t,e){let{headersList:r}=e,n=(r.get("referrer-policy",!0)??"").split(","),o="";if(n.length>0)for(let s=n.length;s!==0;s--){let c=n[s-1].trim();if(Yys.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(d_s,"setRequestReferrerPolicyOnRedirect");function f_s(){return"allowed"}a(f_s,"crossOriginResourcePolicyCheck");function p_s(){return"success"}a(p_s,"corsCheck");function h_s(){return"success"}a(h_s,"TAOCheck");function m_s(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(m_s,"appendFetchMetadata");function g_s(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&rir(t.origin)&&!rir(NPe(t))&&(e=null);break;case"same-origin":Dot(t,NPe(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(g_s,"appendRequestOriginHeader");function gpe(t,e){return t}a(gpe,"coarsenTime");function A_s(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=Dot(t,n),c=DPe(n)&&!DPe(t.url);switch(e){case"origin":return o??tir(r,!0);case"unsafe-url":return n;case"same-origin":return s?o:"no-referrer";case"origin-when-cross-origin":return s?n:o;case"strict-origin-when-cross-origin":{let l=NPe(t);return Dot(n,l)?n:DPe(n)&&!DPe(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(v_s,"determineRequestsReferrer");function tir(t,e){return UZ(t instanceof URL),t=new URL(t),t.protocol==="file:"||t.protocol==="about:"||t.protocol==="blank:"?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}a(tir,"stripURLForReferrer");function DPe(t){if(!(t instanceof URL))return!1;if(t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="file:")return!0;return e(t.origin);function e(r){if(r==null||r==="null")return!1;let n=new URL(r);return!!(n.protocol==="https:"||n.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(n.hostname)||n.hostname==="localhost"||n.hostname.includes("localhost.")||n.hostname.endsWith(".localhost"))}}a(DPe,"isURLPotentiallyTrustworthy");function C_s(t,e){if(Pot===void 0)return!0;let r=xBn(e);if(r==="no metadata"||r.length===0)return!0;let n=S_s(r),o=T_s(r,n);for(let s of o){let c=s.algo,l=s.hash,u=Pot.createHash(c).update(t).digest("base64");if(u[u.length-1]==="="&&(u[u.length-2]==="="?u=u.slice(0,-2):u=u.slice(0,-1)),I_s(u,l))return!0}return!1}a(C_s,"bytesMatch");var b_s=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function xBn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=b_s.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();CBn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(xBn,"parseMetadata");function S_s(t){let e=t[0].algo;if(e[3]==="5")return e;for(let r=1;r{t=n,e=o}),resolve:t,reject:e}}a(w_s,"createDeferredPromise");function R_s(t){return t.controller.state==="aborted"}a(R_s,"isAborted");function k_s(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(k_s,"isCancelled");function P_s(t){return n_s[t.toLowerCase()]??t}a(P_s,"normalizeMethod");function D_s(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return UZ(typeof e=="string"),e}a(D_s,"serializeJavascriptValueToJSONString");var N_s=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function wBn(t,e,r=0,n=1){class o{static{a(this,"FastIterableIterator")}#e;#t;#r;constructor(c,l){this.#e=c,this.#t=l,this.#r=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let c=this.#r,l=this.#e[e],u=l.length;if(c>=u)return{value:void 0,done:!0};let{[r]:d,[n]:f}=l[c];this.#r=c+1;let h;switch(this.#t){case"key":h=d;break;case"value":h=f;break;case"key+value":h=[d,f];break}return{value:h,done:!1}}}return delete o.prototype.constructor,Object.setPrototypeOf(o.prototype,N_s),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,c){return new o(s,c)}}a(wBn,"createIterator");function M_s(t,e,r,n=0,o=1){let s=wBn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return PPe.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return PPe.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return PPe.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(PPe.brandCheck(this,e),PPe.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof u!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:f,1:h}of s(this,"key+value"))u.call(d,h,f,this)},"forEach")}};return Object.defineProperties(e.prototype,{...c,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:c.entries.value}})}a(M_s,"iteratorMixin");async function O_s(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await RBn(s))}catch(c){o(c)}}a(O_s,"fullyReadBody");function L_s(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(L_s,"isReadableStreamLike");function B_s(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}a(B_s,"readableStreamClose");var F_s=/[^\x00-\xFF]/;function kot(t){return UZ(!F_s.test(t)),t}a(kot,"isomorphicEncode");async function RBn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!i_s(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(RBn,"readAllBytes");function U_s(t){UZ("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(U_s,"urlIsLocal");function rir(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}a(rir,"urlHasHttpsScheme");function kBn(t){UZ("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(kBn,"urlIsHttpHttpsScheme");function Q_s(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&FZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&FZ(u=>u===" "||u===" ",r,n);let o=FZ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&FZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&FZ(u=>u===" "||u===" ",r,n);let c=FZ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(Q_s,"simpleRangeHeaderValue");function q_s(t,e,r){let n="bytes ";return n+=kot(`${t}`),n+="-",n+=kot(`${e}`),n+="/",n+=kot(`${r}`),n}a(q_s,"buildContentRange");var nir=class extends Wys{static{a(this,"InflateStream")}#e;constructor(e){super(),this.#e=e}_transform(e,r,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)===8?_Bn.createInflate(this.#e):_Bn.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",o=>this.destroy(o))}this._inflateStream.write(e,r,n)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function j_s(t){return new nir(t)}a(j_s,"createInflate");function H_s(t){let e=null,r=null,n=null,o=PBn("content-type",t);if(o===null)return"failure";for(let s of o){let c=Xys(s);c==="failure"||c.essence==="*/*"||(n=c,n.essence!==r?(e=null,n.parameters.has("charset")&&(e=n.parameters.get("charset")),r=n.essence):!n.parameters.has("charset")&&e!==null&&n.parameters.set("charset",e))}return n??"failure"}a(H_s,"extractMimeType");function G_s(t){let e=t,r={position:0},n=[],o="";for(;r.positions!=='"'&&s!==",",e,r),r.positions===9||s===32),n.push(o),o=""}return n}a(G_s,"gettingDecodingSplitting");function PBn(t,e){let r=e.get(t,!0);return r===null?null:G_s(r)}a(PBn,"getDecodeSplit");var $_s=new TextDecoder;function V_s(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),$_s.decode(t))}a(V_s,"utf8DecodeBytes");var iir=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return EBn()}get origin(){return this.baseUrl?.origin}policyContainer=IBn()},oir=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new iir},W_s=new oir;DBn.exports={isAborted:R_s,isCancelled:k_s,isValidEncodedURL:SBn,createDeferredPromise:w_s,ReadableStreamFrom:r_s,tryUpgradeRequestToAPotentiallyTrustworthyURL:x_s,clampAndCoarsenConnectionTimingInfo:A_s,coarsenedSharedCurrentTime:y_s,determineRequestsReferrer:v_s,makePolicyContainer:IBn,clonePolicyContainer:E_s,appendFetchMetadata:m_s,appendRequestOriginHeader:g_s,TAOCheck:h_s,corsCheck:p_s,crossOriginResourcePolicyCheck:f_s,createOpaqueTimingInfo:__s,setRequestReferrerPolicyOnRedirect:d_s,isValidHTTPToken:vBn,requestBadPort:a_s,requestCurrentURL:NPe,responseURL:bBn,responseLocationURL:o_s,isBlobLike:t_s,isURLPotentiallyTrustworthy:DPe,isValidReasonPhrase:l_s,sameOrigin:Dot,normalizeMethod:P_s,serializeJavascriptValueToJSONString:D_s,iteratorMixin:M_s,createIterator:wBn,isValidHeaderName:u_s,isValidHeaderValue:TBn,isErrorLike:c_s,fullyReadBody:O_s,bytesMatch:C_s,isReadableStreamLike:L_s,readableStreamClose:B_s,isomorphicEncode:kot,urlIsLocal:U_s,urlHasHttpsScheme:rir,urlIsHttpHttpsScheme:kBn,readAllBytes:RBn,simpleRangeHeaderValue:Q_s,buildContentRange:q_s,parseMetadata:xBn,createInflate:j_s,extractMimeType:H_s,getDecodeSplit:PBn,utf8DecodeBytes:V_s,environmentSettingsObject:W_s}});var Zj=I((Ddf,NBn)=>{"use strict";p();NBn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var air=I((Mdf,MBn)=>{"use strict";p();var{Blob:z_s,File:Y_s}=require("node:buffer"),{kState:u8}=Zj(),{webidl:V5}=ty(),sir=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[u8]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return V5.brandCheck(this,t),this[u8].blobLike.stream(...e)}arrayBuffer(...e){return V5.brandCheck(this,t),this[u8].blobLike.arrayBuffer(...e)}slice(...e){return V5.brandCheck(this,t),this[u8].blobLike.slice(...e)}text(...e){return V5.brandCheck(this,t),this[u8].blobLike.text(...e)}get size(){return V5.brandCheck(this,t),this[u8].blobLike.size}get type(){return V5.brandCheck(this,t),this[u8].blobLike.type}get name(){return V5.brandCheck(this,t),this[u8].name}get lastModified(){return V5.brandCheck(this,t),this[u8].lastModified}get[Symbol.toStringTag](){return"File"}};V5.converters.Blob=V5.interfaceConverter(z_s);function K_s(t){return t instanceof Y_s||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(K_s,"isFileLike");MBn.exports={FileLike:sir,isFileLike:K_s}});var OPe=I((Bdf,UBn)=>{"use strict";p();var{isBlobLike:Not,iteratorMixin:J_s}=NT(),{kState:bv}=Zj(),{kEnumerableProperty:Ape}=Ws(),{FileLike:OBn,isFileLike:Z_s}=air(),{webidl:Ou}=ty(),{File:FBn}=require("node:buffer"),LBn=require("node:util"),BBn=globalThis.File??FBn,MPe=class t{static{a(this,"FormData")}constructor(e){if(Ou.util.markAsUncloneable(this),e!==void 0)throw Ou.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[bv]=[]}append(e,r,n=void 0){Ou.brandCheck(this,t);let o="FormData.append";if(Ou.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Not(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=Ou.converters.USVString(e,o,"name"),r=Not(r)?Ou.converters.Blob(r,o,"value",{strict:!1}):Ou.converters.USVString(r,o,"value"),n=arguments.length===3?Ou.converters.USVString(n,o,"filename"):void 0;let s=cir(e,r,n);this[bv].push(s)}delete(e){Ou.brandCheck(this,t);let r="FormData.delete";Ou.argumentLengthCheck(arguments,1,r),e=Ou.converters.USVString(e,r,"name"),this[bv]=this[bv].filter(n=>n.name!==e)}get(e){Ou.brandCheck(this,t);let r="FormData.get";Ou.argumentLengthCheck(arguments,1,r),e=Ou.converters.USVString(e,r,"name");let n=this[bv].findIndex(o=>o.name===e);return n===-1?null:this[bv][n].value}getAll(e){Ou.brandCheck(this,t);let r="FormData.getAll";return Ou.argumentLengthCheck(arguments,1,r),e=Ou.converters.USVString(e,r,"name"),this[bv].filter(n=>n.name===e).map(n=>n.value)}has(e){Ou.brandCheck(this,t);let r="FormData.has";return Ou.argumentLengthCheck(arguments,1,r),e=Ou.converters.USVString(e,r,"name"),this[bv].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Ou.brandCheck(this,t);let o="FormData.set";if(Ou.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Not(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=Ou.converters.USVString(e,o,"name"),r=Not(r)?Ou.converters.Blob(r,o,"name",{strict:!1}):Ou.converters.USVString(r,o,"name"),n=arguments.length===3?Ou.converters.USVString(n,o,"name"):void 0;let s=cir(e,r,n),c=this[bv].findIndex(l=>l.name===e);c!==-1?this[bv]=[...this[bv].slice(0,c),s,...this[bv].slice(c+1).filter(l=>l.name!==e)]:this[bv].push(s)}[LBn.inspect.custom](e,r){let n=this[bv].reduce((s,c)=>(s[c.name]?Array.isArray(s[c.name])?s[c.name].push(c.value):s[c.name]=[s[c.name],c.value]:s[c.name]=c.value,s),{__proto__:null});r.depth??=e,r.colors??=!0;let o=LBn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};J_s("FormData",MPe,bv,"name","value");Object.defineProperties(MPe.prototype,{append:Ape,delete:Ape,get:Ape,getAll:Ape,has:Ape,set:Ape,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function cir(t,e,r){if(typeof e!="string"){if(Z_s(e)||(e=e instanceof Blob?new BBn([e],"blob",{type:e.type}):new OBn(e,"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=e instanceof FBn?new BBn([e],r,n):new OBn(e,r,n)}}return{name:t,value:e}}a(cir,"makeEntry");UBn.exports={FormData:MPe,makeEntry:cir}});var $Bn=I((Qdf,GBn)=>{"use strict";p();var{isUSVString:QBn,bufferToLowerCasedHeaderName:X_s}=Ws(),{utf8DecodeBytes:eEs}=NT(),{HTTP_TOKEN_CODEPOINTS:tEs,isomorphicDecode:qBn}=xb(),{isFileLike:rEs}=air(),{makeEntry:nEs}=OPe(),Mot=require("node:assert"),{File:iEs}=require("node:buffer"),oEs=globalThis.File??iEs,sEs=Buffer.from('form-data; name="'),jBn=Buffer.from("; filename"),aEs=Buffer.from("--"),cEs=Buffer.from(`--\r +`);function lEs(t){for(let e=0;e70)return!1;for(let r=0;r=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}a(uEs,"validateBoundary");function dEs(t,e){Mot(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)return"failure";let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0};for(;t[s.position]===13&&t[s.position+1]===10;)s.position+=2;let c=t.length;for(;t[c-1]===10&&t[c-2]===13;)c-=2;for(c!==t.length&&(t=t.subarray(0,c));;){if(t.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else return"failure";if(s.position===t.length-2&&Oot(t,aEs,s)||s.position===t.length-4&&Oot(t,cEs,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=fEs(t,s);if(l==="failure")return"failure";let{name:u,filename:d,contentType:f,encoding:h}=l;s.position+=2;let m;{let A=t.indexOf(n.subarray(2),s.position);if(A===-1)return"failure";m=t.subarray(s.position,A-4),s.position+=m.length,h==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let g;d!==null?(f??="text/plain",lEs(f)||(f=""),g=new oEs([m],d,{type:f})):g=eEs(Buffer.from(m)),Mot(QBn(u)),Mot(typeof g=="string"&&QBn(g)||rEs(g)),o.push(nEs(u,g,d))}}a(dEs,"multipartFormDataParser");function fEs(t,e){let r=null,n=null,o=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10)return r===null?"failure":{name:r,filename:n,contentType:o,encoding:s};let c=ype(l=>l!==10&&l!==13&&l!==58,t,e);if(c=lir(c,!0,!0,l=>l===9||l===32),!tEs.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,ype(l=>l===32||l===9,t,e),X_s(c)){case"content-disposition":{if(r=n=null,!Oot(t,sEs,e)||(e.position+=17,r=HBn(t,e),r===null))return"failure";if(Oot(t,jBn,e)){let l=e.position+jBn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=HBn(t,e),n===null))return"failure"}break}case"content-type":{let l=ype(u=>u!==10&&u!==13,t,e);l=lir(l,!1,!0,u=>u===9||u===32),o=qBn(l);break}case"content-transfer-encoding":{let l=ype(u=>u!==10&&u!==13,t,e);l=lir(l,!1,!0,u=>u===9||u===32),s=qBn(l);break}default:ype(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a(fEs,"parseMultipartFormDataHeaders");function HBn(t,e){Mot(t[e.position-1]===34);let r=ype(n=>n!==10&&n!==13&&n!==34,t,e);return t[e.position]!==34?null:(e.position++,r=new TextDecoder().decode(r).replace(/%0A/ig,` +`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),r)}a(HBn,"parseMultipartFormDataName");function ype(t,e,r){let n=r.position;for(;n0&&n(t[s]);)s--;return o===0&&s===t.length-1?t:t.subarray(o,s+1)}a(lir,"removeChars");function Oot(t,e,r){if(t.length{"use strict";p();var LPe=Ws(),{ReadableStreamFrom:pEs,isBlobLike:VBn,isReadableStreamLike:hEs,readableStreamClose:mEs,createDeferredPromise:gEs,fullyReadBody:AEs,extractMimeType:yEs,utf8DecodeBytes:YBn}=NT(),{FormData:WBn}=OPe(),{kState:Epe}=Zj(),{webidl:_Es}=ty(),{Blob:EEs}=require("node:buffer"),uir=require("node:assert"),{isErrored:KBn,isDisturbed:vEs}=require("node:stream"),{isArrayBuffer:CEs}=require("node:util/types"),{serializeAMimeType:bEs}=xb(),{multipartFormDataParser:SEs}=$Bn(),dir;try{let t=require("node:crypto");dir=a(e=>t.randomInt(0,e),"random")}catch{dir=a(t=>Math.floor(Math.random(t)),"random")}var Lot=new TextEncoder;function TEs(){}a(TEs,"noop");var JBn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,ZBn;JBn&&(ZBn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!vEs(e)&&!KBn(e)&&e.cancel("Response object has been garbage collected").catch(TEs)}));function XBn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:VBn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?Lot.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>mEs(u))},start(){},type:"bytes"}),uir(hEs(r));let n=null,o=null,s=null,c=null;if(typeof t=="string")o=t,c="text/plain;charset=UTF-8";else if(t instanceof URLSearchParams)o=t.toString(),c="application/x-www-form-urlencoded;charset=UTF-8";else if(CEs(t))o=new Uint8Array(t.slice());else if(ArrayBuffer.isView(t))o=new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));else if(LPe.isFormDataLike(t)){let u=`----formdata-undici-0${`${dir(1e11)}`.padStart(11,"0")}`,d=`--${u}\r Content-Disposition: form-data`;let f=a(_=>_.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"escape"),h=a(_=>_.replace(/\r?\n|\r/g,`\r `),"normalizeLinefeeds"),m=[],g=new Uint8Array([13,10]);s=0;let A=!1;for(let[_,E]of t)if(typeof E=="string"){let v=Lot.encode(d+`; name="${f(h(_))}"\r \r @@ -119,63 +119,63 @@ ${h(E)}\r Content-Type: ${E.type||"application/octet-stream"}\r \r `);m.push(v,E,g),typeof E.size=="number"?s+=v.byteLength+E.size+g.byteLength:A=!0}let y=Lot.encode(`--${u}--\r -`);m.push(y),s+=y.byteLength,A&&(s=null),o=t,n=a(async function*(){for(let _ of m)_.stream?yield*_.stream():yield _},"action"),c=`multipart/form-data; boundary=${u}`}else if(GBn(t))o=t,s=t.size,t.type&&(c=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(LPe.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:dEs(t)}if((typeof o=="string"||LPe.isBuffer(o))&&(s=Buffer.byteLength(o)),n!=null){let u;r=new ReadableStream({async start(){u=n(t)[Symbol.asyncIterator]()},async pull(d){let{value:f,done:h}=await u.next();if(h)queueMicrotask(()=>{d.close(),d.byobRequest?.respond(0)});else if(!zBn(r)){let m=new Uint8Array(f);m.byteLength&&d.enqueue(m)}return d.desiredSize>0},async cancel(d){await u.return()},type:"bytes"})}return[{stream:r,source:o,length:s},c]}a(JBn,"extractBody");function SEs(t,e=!1){return t instanceof ReadableStream&&(lir(!LPe.isDisturbed(t),"The body has already been consumed."),lir(!t.locked,"The stream is locked.")),JBn(t,e)}a(SEs,"safelyExtractBody");function TEs(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(TEs,"cloneBody");function IEs(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(IEs,"throwIfAborted");function xEs(t){return{blob(){return ype(this,r=>{let n=VBn(this);return n===null?n="":n&&(n=vEs(n)),new yEs([r],{type:n})},t)},arrayBuffer(){return ype(this,r=>new Uint8Array(r).buffer,t)},text(){return ype(this,WBn,t)},json(){return ype(this,REs,t)},formData(){return ype(this,r=>{let n=VBn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=CEs(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new $Bn;return s[_pe]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new $Bn;for(let[c,l]of o)s.append(c,l);return s}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t)},bytes(){return ype(this,r=>new Uint8Array(r),t)}}}a(xEs,"bodyMixinMethods");function wEs(t){Object.assign(t.prototype,xEs(t))}a(wEs,"mixinBody");async function ype(t,e,r){if(AEs.brandCheck(t,r),ZBn(t))throw new TypeError("Body is unusable: Body has already been read");IEs(t[_pe]);let n=hEs(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[_pe].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await mEs(t[_pe].body,s,o),n.promise)}a(ype,"consumeBody");function ZBn(t){let e=t[_pe].body;return e!=null&&(e.stream.locked||LPe.isDisturbed(e.stream))}a(ZBn,"bodyUnusable");function REs(t){return JSON.parse(WBn(t))}a(REs,"parseJSONFromBytes");function VBn(t){let e=t[_pe].headersList,r=gEs(e);return r==="failure"?null:r}a(VBn,"bodyMimeType");XBn.exports={extractBody:JBn,safelyExtractBody:SEs,cloneBody:TEs,mixinBody:wEs,streamRegistry:KBn,hasFinalizationRegistry:YBn,bodyUnusable:ZBn}});var u3n=I((Gdf,l3n)=>{"use strict";p();var Vi=require("node:assert"),_o=Ws(),{channels:e3n}=ape(),dir=Vnr(),{RequestContentLengthMismatchError:UZ,ResponseContentLengthMismatchError:kEs,RequestAbortedError:s3n,HeadersTimeoutError:PEs,HeadersOverflowError:DEs,SocketError:jot,InformationalError:vpe,BodyTimeoutError:NEs,HTTPParserError:MEs,ResponseExceededMaxSizeError:OEs}=Rc(),{kUrl:a3n,kReset:wb,kClient:mir,kParser:vp,kBlocking:UPe,kRunning:L_,kPending:LEs,kSize:t3n,kWriting:eH,kQueue:Q2,kNoRef:BPe,kKeepAliveDefaultTimeout:BEs,kHostHeader:FEs,kPendingIdx:UEs,kRunningIdx:Ww,kError:zw,kPipelining:Qot,kSocket:Cpe,kKeepAliveTimeoutValue:Hot,kMaxHeadersSize:fir,kKeepAliveMaxTimeout:QEs,kKeepAliveTimeoutThreshold:qEs,kHeadersTimeout:jEs,kBodyTimeout:HEs,kStrictContentLength:gir,kMaxRequests:r3n,kCounter:GEs,kMaxResponseSize:$Es,kOnError:VEs,kResume:Xj,kHTTPContext:c3n}=ef(),W5=KLn(),WEs=Buffer.alloc(0),Bot=Buffer[Symbol.species],Fot=_o.addListener,zEs=_o.removeAllListeners,pir;async function YEs(){let t=process.env.JEST_WORKER_ID?Ynr():void 0,e;try{e=await WebAssembly.compile(XLn())}catch{e=await WebAssembly.compile(t||Ynr())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:a((r,n,o)=>0,"wasm_on_url"),wasm_on_status:a((r,n,o)=>{Vi(wg.ptr===r);let s=n-Y5+z5.byteOffset;return wg.onStatus(new Bot(z5.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(Vi(wg.ptr===r),wg.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{Vi(wg.ptr===r);let s=n-Y5+z5.byteOffset;return wg.onHeaderField(new Bot(z5.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{Vi(wg.ptr===r);let s=n-Y5+z5.byteOffset;return wg.onHeaderValue(new Bot(z5.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(Vi(wg.ptr===r),wg.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{Vi(wg.ptr===r);let s=n-Y5+z5.byteOffset;return wg.onBody(new Bot(z5.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(Vi(wg.ptr===r),wg.onMessageComplete()||0),"wasm_on_message_complete")}})}a(YEs,"lazyllhttp");var hir=null,Air=YEs();Air.catch();var wg=null,z5=null,Uot=0,Y5=null,KEs=0,FPe=1,bpe=2|FPe,qot=4|FPe,yir=8|KEs,_ir=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){Vi(Number.isFinite(e[fir])&&e[fir]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(W5.TYPE.RESPONSE),this.client=e,this.socket=r,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[fir],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[$Es]}setTimeout(e,r){e!==this.timeoutValue||r&FPe^this.timeoutType&FPe?(this.timeout&&(dir.clearTimeout(this.timeout),this.timeout=null),e&&(r&FPe?this.timeout=dir.setFastTimeout(n3n,e,new WeakRef(this)):(this.timeout=setTimeout(n3n,e,new WeakRef(this)),this.timeout.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(Vi(this.ptr!=null),Vi(wg==null),this.llhttp.llhttp_resume(this.ptr),Vi(this.timeoutType===qot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||WEs),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Vi(this.ptr!=null),Vi(wg==null),Vi(!this.paused);let{socket:r,llhttp:n}=this;e.length>Uot&&(Y5&&n.free(Y5),Uot=Math.ceil(e.length/4096)*4096,Y5=n.malloc(Uot)),new Uint8Array(n.memory.buffer,Y5,Uot).set(e);try{let o;try{z5=e,wg=this,o=n.llhttp_execute(this.ptr,Y5,e.length)}catch(c){throw c}finally{wg=null,z5=null}let s=n.llhttp_get_error_pos(this.ptr)-Y5;if(o===W5.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===W5.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==W5.ERROR.OK){let c=n.llhttp_get_error_reason(this.ptr),l="";if(c){let u=new Uint8Array(n.memory.buffer,c).indexOf(0);l="Response does not match the HTTP/1.1 protocol ("+Buffer.from(n.memory.buffer,c,u).toString()+")"}throw new MEs(l,W5.ERROR[o],e.slice(s))}}catch(o){_o.destroy(r,o)}}destroy(){Vi(this.ptr!=null),Vi(wg==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&dir.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){this.statusText=e.toString()}onMessageBegin(){let{socket:e,client:r}=this;if(e.destroyed)return-1;let n=r[Q2][r[Ww]];if(!n)return-1;n.onResponseStarted()}onHeaderField(e){let r=this.headers.length;(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length)}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=_o.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&_o.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());this.trackHeader(e.length)}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&_o.destroy(this.socket,new DEs)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Vi(r),Vi(n[Cpe]===o),Vi(!o.destroyed),Vi(!this.paused),Vi((s.length&1)===0);let l=n[Q2][n[Ww]];Vi(l),Vi(l.upgrade||l.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,o.unshift(e),o[vp].destroy(),o[vp]=null,o[mir]=null,o[zw]=null,zEs(o),n[Cpe]=null,n[c3n]=null,n[Q2][n[Ww]++]=null,n.emit("disconnect",n[a3n],[n],new vpe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){_o.destroy(o,u)}n[Xj]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[Q2][o[Ww]];if(!u)return-1;if(Vi(!this.upgrade),Vi(this.statusCode<200),e===100)return _o.destroy(s,new jot("bad response",_o.getSocketInfo(s))),-1;if(r&&!u.upgrade)return _o.destroy(s,new jot("bad upgrade",_o.getSocketInfo(s))),-1;if(Vi(this.timeoutType===bpe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[wb]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[HEs];this.setTimeout(f,qot)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Vi(o[L_]===1),this.upgrade=!0,2;if(r)return Vi(o[L_]===1),this.upgrade=!0,2;if(Vi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Qot]){let f=this.keepAlive?_o.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[qEs],o[QEs]);h<=0?s[wb]=!0:o[Hot]=h}else o[Hot]=o[BEs]}else s[wb]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[UPe]&&(s[UPe]=!1,o[Xj]()),d?W5.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[Q2][r[Ww]];if(Vi(c),Vi(this.timeoutType===qot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Vi(o>=200),s>-1&&this.bytesRead+e.length>s)return _o.destroy(n,new OEs),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return W5.ERROR.PAUSED}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return;Vi(n>=100),Vi((this.headers.length&1)===0);let d=e[Q2][e[Ww]];if(Vi(d),this.statusCode=null,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,!(n<200)){if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return _o.destroy(r,new kEs),-1;if(d.onComplete(s),e[Q2][e[Ww]++]=null,r[eH])return Vi(e[L_]===0),_o.destroy(r,new vpe("reset")),W5.ERROR.PAUSED;if(u){if(r[wb]&&e[L_]===0)return _o.destroy(r,new vpe("reset")),W5.ERROR.PAUSED;e[Qot]==null||e[Qot]===1?setImmediate(()=>e[Xj]()):e[Xj]()}else return _o.destroy(r,new vpe("reset")),W5.ERROR.PAUSED}}};function n3n(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===bpe?(!e[eH]||e.writableNeedDrain||n[L_]>1)&&(Vi(!o,"cannot be paused while waiting for headers"),_o.destroy(e,new PEs)):r===qot?o||_o.destroy(e,new NEs):r===yir&&(Vi(n[L_]===0&&n[Hot]),_o.destroy(e,new vpe("socket idle timeout")))}a(n3n,"onParserTimeout");async function JEs(t,e){t[Cpe]=e,hir||(hir=await Air,Air=null),e[BPe]=!1,e[eH]=!1,e[wb]=!1,e[UPe]=!1,e[vp]=new _ir(t,e,hir),Fot(e,"error",function(n){Vi(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[vp];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[zw]=n,this[mir][VEs](n)}),Fot(e,"readable",function(){let n=this[vp];n&&n.readMore()}),Fot(e,"end",function(){let n=this[vp];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}_o.destroy(this,new jot("other side closed",_o.getSocketInfo(this)))}),Fot(e,"close",function(){let n=this[mir],o=this[vp];o&&(!this[zw]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[vp].destroy(),this[vp]=null);let s=this[zw]||new jot("closed",_o.getSocketInfo(this));if(n[Cpe]=null,n[c3n]=null,n.destroyed){Vi(n[LEs]===0);let c=n[Q2].splice(n[Ww]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[Q2][n[Ww]];n[Q2][n[Ww]++]=null,_o.errorRequest(n,c,s)}n[UEs]=n[Ww],Vi(n[L_]===0),n.emit("disconnect",n[a3n],[n],s),n[Xj]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return evs(t,...n)},resume(){ZEs(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[eH]||e[wb]||e[UPe]||n&&(t[L_]>0&&!n.idempotent||t[L_]>0&&(n.upgrade||n.method==="CONNECT")||t[L_]>0&&_o.bodyLength(n.body)!==0&&(_o.isStream(n.body)||_o.isAsyncIterable(n.body)||_o.isFormDataLike(n.body))))}}}a(JEs,"connectH1");function ZEs(t){let e=t[Cpe];if(e&&!e.destroyed){if(t[t3n]===0?!e[BPe]&&e.unref&&(e.unref(),e[BPe]=!0):e[BPe]&&e.ref&&(e.ref(),e[BPe]=!1),t[t3n]===0)e[vp].timeoutType!==yir&&e[vp].setTimeout(t[Hot],yir);else if(t[L_]>0&&e[vp].statusCode<200&&e[vp].timeoutType!==bpe){let r=t[Q2][t[Ww]],n=r.headersTimeout!=null?r.headersTimeout:t[jEs];e[vp].setTimeout(n,bpe)}}}a(ZEs,"resumeH1");function XEs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(XEs,"shouldSendContentLength");function evs(t,e){let{method:r,path:n,host:o,upgrade:s,blocking:c,reset:l}=e,{body:u,headers:d,contentLength:f}=e,h=r==="PUT"||r==="POST"||r==="PATCH"||r==="QUERY"||r==="PROPFIND"||r==="PROPPATCH";if(_o.isFormDataLike(u)){pir||(pir=Epe().extractBody);let[_,E]=pir(u);e.contentType==null&&d.push("content-type",E),u=_.stream,f=_.length}else _o.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=_o.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),XEs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[gir])return _o.errorRequest(t,e,new UZ),!1;process.emitWarning(new UZ)}let g=t[Cpe],A=a(_=>{e.aborted||e.completed||(_o.errorRequest(t,e,_||new s3n),_o.destroy(u),_o.destroy(g,new vpe("aborted")))},"abort");try{e.onConnect(A)}catch(_){_o.errorRequest(t,e,_)}if(e.aborted)return!1;r==="HEAD"&&(g[wb]=!0),(s||r==="CONNECT")&&(g[wb]=!0),l!=null&&(g[wb]=l),t[r3n]&&g[GEs]++>=t[r3n]&&(g[wb]=!0),c&&(g[UPe]=!0);let y=`${r} ${n} HTTP/1.1\r +`);m.push(y),s+=y.byteLength,A&&(s=null),o=t,n=a(async function*(){for(let _ of m)_.stream?yield*_.stream():yield _},"action"),c=`multipart/form-data; boundary=${u}`}else if(VBn(t))o=t,s=t.size,t.type&&(c=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(LPe.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:pEs(t)}if((typeof o=="string"||LPe.isBuffer(o))&&(s=Buffer.byteLength(o)),n!=null){let u;r=new ReadableStream({async start(){u=n(t)[Symbol.asyncIterator]()},async pull(d){let{value:f,done:h}=await u.next();if(h)queueMicrotask(()=>{d.close(),d.byobRequest?.respond(0)});else if(!KBn(r)){let m=new Uint8Array(f);m.byteLength&&d.enqueue(m)}return d.desiredSize>0},async cancel(d){await u.return()},type:"bytes"})}return[{stream:r,source:o,length:s},c]}a(XBn,"extractBody");function IEs(t,e=!1){return t instanceof ReadableStream&&(uir(!LPe.isDisturbed(t),"The body has already been consumed."),uir(!t.locked,"The stream is locked.")),XBn(t,e)}a(IEs,"safelyExtractBody");function xEs(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(xEs,"cloneBody");function wEs(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(wEs,"throwIfAborted");function REs(t){return{blob(){return _pe(this,r=>{let n=zBn(this);return n===null?n="":n&&(n=bEs(n)),new EEs([r],{type:n})},t)},arrayBuffer(){return _pe(this,r=>new Uint8Array(r).buffer,t)},text(){return _pe(this,YBn,t)},json(){return _pe(this,PEs,t)},formData(){return _pe(this,r=>{let n=zBn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=SEs(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new WBn;return s[Epe]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new WBn;for(let[c,l]of o)s.append(c,l);return s}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t)},bytes(){return _pe(this,r=>new Uint8Array(r),t)}}}a(REs,"bodyMixinMethods");function kEs(t){Object.assign(t.prototype,REs(t))}a(kEs,"mixinBody");async function _pe(t,e,r){if(_Es.brandCheck(t,r),e3n(t))throw new TypeError("Body is unusable: Body has already been read");wEs(t[Epe]);let n=gEs(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[Epe].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await AEs(t[Epe].body,s,o),n.promise)}a(_pe,"consumeBody");function e3n(t){let e=t[Epe].body;return e!=null&&(e.stream.locked||LPe.isDisturbed(e.stream))}a(e3n,"bodyUnusable");function PEs(t){return JSON.parse(YBn(t))}a(PEs,"parseJSONFromBytes");function zBn(t){let e=t[Epe].headersList,r=yEs(e);return r==="failure"?null:r}a(zBn,"bodyMimeType");t3n.exports={extractBody:XBn,safelyExtractBody:IEs,cloneBody:xEs,mixinBody:kEs,streamRegistry:ZBn,hasFinalizationRegistry:JBn,bodyUnusable:e3n}});var f3n=I((Vdf,d3n)=>{"use strict";p();var Vi=require("node:assert"),_o=Ws(),{channels:r3n}=cpe(),fir=Wnr(),{RequestContentLengthMismatchError:QZ,ResponseContentLengthMismatchError:DEs,RequestAbortedError:c3n,HeadersTimeoutError:NEs,HeadersOverflowError:MEs,SocketError:jot,InformationalError:Cpe,BodyTimeoutError:OEs,HTTPParserError:LEs,ResponseExceededMaxSizeError:BEs}=Rc(),{kUrl:l3n,kReset:wb,kClient:gir,kParser:vp,kBlocking:UPe,kRunning:L_,kPending:FEs,kSize:n3n,kWriting:eH,kQueue:Q2,kNoRef:BPe,kKeepAliveDefaultTimeout:UEs,kHostHeader:QEs,kPendingIdx:qEs,kRunningIdx:Ww,kError:zw,kPipelining:Qot,kSocket:bpe,kKeepAliveTimeoutValue:Hot,kMaxHeadersSize:pir,kKeepAliveMaxTimeout:jEs,kKeepAliveTimeoutThreshold:HEs,kHeadersTimeout:GEs,kBodyTimeout:$Es,kStrictContentLength:Air,kMaxRequests:i3n,kCounter:VEs,kMaxResponseSize:WEs,kOnError:zEs,kResume:Xj,kHTTPContext:u3n}=tf(),W5=ZLn(),YEs=Buffer.alloc(0),Bot=Buffer[Symbol.species],Fot=_o.addListener,KEs=_o.removeAllListeners,hir;async function JEs(){let t=process.env.JEST_WORKER_ID?Knr():void 0,e;try{e=await WebAssembly.compile(tBn())}catch{e=await WebAssembly.compile(t||Knr())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:a((r,n,o)=>0,"wasm_on_url"),wasm_on_status:a((r,n,o)=>{Vi(Rg.ptr===r);let s=n-Y5+z5.byteOffset;return Rg.onStatus(new Bot(z5.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(Vi(Rg.ptr===r),Rg.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{Vi(Rg.ptr===r);let s=n-Y5+z5.byteOffset;return Rg.onHeaderField(new Bot(z5.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{Vi(Rg.ptr===r);let s=n-Y5+z5.byteOffset;return Rg.onHeaderValue(new Bot(z5.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(Vi(Rg.ptr===r),Rg.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{Vi(Rg.ptr===r);let s=n-Y5+z5.byteOffset;return Rg.onBody(new Bot(z5.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(Vi(Rg.ptr===r),Rg.onMessageComplete()||0),"wasm_on_message_complete")}})}a(JEs,"lazyllhttp");var mir=null,yir=JEs();yir.catch();var Rg=null,z5=null,Uot=0,Y5=null,ZEs=0,FPe=1,Spe=2|FPe,qot=4|FPe,_ir=8|ZEs,Eir=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){Vi(Number.isFinite(e[pir])&&e[pir]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(W5.TYPE.RESPONSE),this.client=e,this.socket=r,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[pir],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[WEs]}setTimeout(e,r){e!==this.timeoutValue||r&FPe^this.timeoutType&FPe?(this.timeout&&(fir.clearTimeout(this.timeout),this.timeout=null),e&&(r&FPe?this.timeout=fir.setFastTimeout(o3n,e,new WeakRef(this)):(this.timeout=setTimeout(o3n,e,new WeakRef(this)),this.timeout.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(Vi(this.ptr!=null),Vi(Rg==null),this.llhttp.llhttp_resume(this.ptr),Vi(this.timeoutType===qot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||YEs),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Vi(this.ptr!=null),Vi(Rg==null),Vi(!this.paused);let{socket:r,llhttp:n}=this;e.length>Uot&&(Y5&&n.free(Y5),Uot=Math.ceil(e.length/4096)*4096,Y5=n.malloc(Uot)),new Uint8Array(n.memory.buffer,Y5,Uot).set(e);try{let o;try{z5=e,Rg=this,o=n.llhttp_execute(this.ptr,Y5,e.length)}catch(c){throw c}finally{Rg=null,z5=null}let s=n.llhttp_get_error_pos(this.ptr)-Y5;if(o===W5.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===W5.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==W5.ERROR.OK){let c=n.llhttp_get_error_reason(this.ptr),l="";if(c){let u=new Uint8Array(n.memory.buffer,c).indexOf(0);l="Response does not match the HTTP/1.1 protocol ("+Buffer.from(n.memory.buffer,c,u).toString()+")"}throw new LEs(l,W5.ERROR[o],e.slice(s))}}catch(o){_o.destroy(r,o)}}destroy(){Vi(this.ptr!=null),Vi(Rg==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&fir.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){this.statusText=e.toString()}onMessageBegin(){let{socket:e,client:r}=this;if(e.destroyed)return-1;let n=r[Q2][r[Ww]];if(!n)return-1;n.onResponseStarted()}onHeaderField(e){let r=this.headers.length;(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length)}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=_o.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&_o.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());this.trackHeader(e.length)}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&_o.destroy(this.socket,new MEs)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Vi(r),Vi(n[bpe]===o),Vi(!o.destroyed),Vi(!this.paused),Vi((s.length&1)===0);let l=n[Q2][n[Ww]];Vi(l),Vi(l.upgrade||l.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,o.unshift(e),o[vp].destroy(),o[vp]=null,o[gir]=null,o[zw]=null,KEs(o),n[bpe]=null,n[u3n]=null,n[Q2][n[Ww]++]=null,n.emit("disconnect",n[l3n],[n],new Cpe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){_o.destroy(o,u)}n[Xj]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[Q2][o[Ww]];if(!u)return-1;if(Vi(!this.upgrade),Vi(this.statusCode<200),e===100)return _o.destroy(s,new jot("bad response",_o.getSocketInfo(s))),-1;if(r&&!u.upgrade)return _o.destroy(s,new jot("bad upgrade",_o.getSocketInfo(s))),-1;if(Vi(this.timeoutType===Spe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[wb]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[$Es];this.setTimeout(f,qot)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Vi(o[L_]===1),this.upgrade=!0,2;if(r)return Vi(o[L_]===1),this.upgrade=!0,2;if(Vi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Qot]){let f=this.keepAlive?_o.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[HEs],o[jEs]);h<=0?s[wb]=!0:o[Hot]=h}else o[Hot]=o[UEs]}else s[wb]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[UPe]&&(s[UPe]=!1,o[Xj]()),d?W5.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[Q2][r[Ww]];if(Vi(c),Vi(this.timeoutType===qot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Vi(o>=200),s>-1&&this.bytesRead+e.length>s)return _o.destroy(n,new BEs),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return W5.ERROR.PAUSED}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return;Vi(n>=100),Vi((this.headers.length&1)===0);let d=e[Q2][e[Ww]];if(Vi(d),this.statusCode=null,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,!(n<200)){if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return _o.destroy(r,new DEs),-1;if(d.onComplete(s),e[Q2][e[Ww]++]=null,r[eH])return Vi(e[L_]===0),_o.destroy(r,new Cpe("reset")),W5.ERROR.PAUSED;if(u){if(r[wb]&&e[L_]===0)return _o.destroy(r,new Cpe("reset")),W5.ERROR.PAUSED;e[Qot]==null||e[Qot]===1?setImmediate(()=>e[Xj]()):e[Xj]()}else return _o.destroy(r,new Cpe("reset")),W5.ERROR.PAUSED}}};function o3n(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===Spe?(!e[eH]||e.writableNeedDrain||n[L_]>1)&&(Vi(!o,"cannot be paused while waiting for headers"),_o.destroy(e,new NEs)):r===qot?o||_o.destroy(e,new OEs):r===_ir&&(Vi(n[L_]===0&&n[Hot]),_o.destroy(e,new Cpe("socket idle timeout")))}a(o3n,"onParserTimeout");async function XEs(t,e){t[bpe]=e,mir||(mir=await yir,yir=null),e[BPe]=!1,e[eH]=!1,e[wb]=!1,e[UPe]=!1,e[vp]=new Eir(t,e,mir),Fot(e,"error",function(n){Vi(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[vp];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[zw]=n,this[gir][zEs](n)}),Fot(e,"readable",function(){let n=this[vp];n&&n.readMore()}),Fot(e,"end",function(){let n=this[vp];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}_o.destroy(this,new jot("other side closed",_o.getSocketInfo(this)))}),Fot(e,"close",function(){let n=this[gir],o=this[vp];o&&(!this[zw]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[vp].destroy(),this[vp]=null);let s=this[zw]||new jot("closed",_o.getSocketInfo(this));if(n[bpe]=null,n[u3n]=null,n.destroyed){Vi(n[FEs]===0);let c=n[Q2].splice(n[Ww]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[Q2][n[Ww]];n[Q2][n[Ww]++]=null,_o.errorRequest(n,c,s)}n[qEs]=n[Ww],Vi(n[L_]===0),n.emit("disconnect",n[l3n],[n],s),n[Xj]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return rvs(t,...n)},resume(){evs(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[eH]||e[wb]||e[UPe]||n&&(t[L_]>0&&!n.idempotent||t[L_]>0&&(n.upgrade||n.method==="CONNECT")||t[L_]>0&&_o.bodyLength(n.body)!==0&&(_o.isStream(n.body)||_o.isAsyncIterable(n.body)||_o.isFormDataLike(n.body))))}}}a(XEs,"connectH1");function evs(t){let e=t[bpe];if(e&&!e.destroyed){if(t[n3n]===0?!e[BPe]&&e.unref&&(e.unref(),e[BPe]=!0):e[BPe]&&e.ref&&(e.ref(),e[BPe]=!1),t[n3n]===0)e[vp].timeoutType!==_ir&&e[vp].setTimeout(t[Hot],_ir);else if(t[L_]>0&&e[vp].statusCode<200&&e[vp].timeoutType!==Spe){let r=t[Q2][t[Ww]],n=r.headersTimeout!=null?r.headersTimeout:t[GEs];e[vp].setTimeout(n,Spe)}}}a(evs,"resumeH1");function tvs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(tvs,"shouldSendContentLength");function rvs(t,e){let{method:r,path:n,host:o,upgrade:s,blocking:c,reset:l}=e,{body:u,headers:d,contentLength:f}=e,h=r==="PUT"||r==="POST"||r==="PATCH"||r==="QUERY"||r==="PROPFIND"||r==="PROPPATCH";if(_o.isFormDataLike(u)){hir||(hir=vpe().extractBody);let[_,E]=hir(u);e.contentType==null&&d.push("content-type",E),u=_.stream,f=_.length}else _o.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=_o.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),tvs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[Air])return _o.errorRequest(t,e,new QZ),!1;process.emitWarning(new QZ)}let g=t[bpe],A=a(_=>{e.aborted||e.completed||(_o.errorRequest(t,e,_||new c3n),_o.destroy(u),_o.destroy(g,new Cpe("aborted")))},"abort");try{e.onConnect(A)}catch(_){_o.errorRequest(t,e,_)}if(e.aborted)return!1;r==="HEAD"&&(g[wb]=!0),(s||r==="CONNECT")&&(g[wb]=!0),l!=null&&(g[wb]=l),t[i3n]&&g[VEs]++>=t[i3n]&&(g[wb]=!0),c&&(g[UPe]=!0);let y=`${r} ${n} HTTP/1.1\r `;if(typeof o=="string"?y+=`host: ${o}\r -`:y+=t[FEs],s?y+=`connection: upgrade\r +`:y+=t[QEs],s?y+=`connection: upgrade\r upgrade: ${s}\r `:t[Qot]&&!g[wb]?y+=`connection: keep-alive\r `:y+=`connection: close\r `,Array.isArray(d))for(let _=0;_{e.removeListener("error",g)}),!u){let A=new s3n;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Vi(o.destroyed||o[eH]&&r[L_]<=1),o.off("drain",h).off("error",g),e.removeListener("data",f).removeListener("end",g).removeListener("close",m),!A)try{d.end()}catch(y){A=y}d.destroy(A),A&&(A.code!=="UND_ERR_INFO"||A.message!=="reset")?_o.destroy(e,A):_o.destroy(e)}},"onFinished");e.on("data",f).on("end",g).on("error",g).on("close",m),e.resume&&e.resume(),o.on("drain",h).on("error",g),e.errorEmitted??e.errored?setImmediate(()=>g(e.errored)):(e.endEmitted??e.readableEnded)&&setImmediate(()=>g(null)),(e.closeEmitted??e.closed)&&setImmediate(m)}a(tvs,"writeStream");function i3n(t,e,r,n,o,s,c,l){try{e?_o.isBuffer(e)&&(Vi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return r3n.sendHeaders.hasSubscribers&&r3n.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?s3n(A,null,t,e,g,f,y,h):_o.isBuffer(u)?s3n(A,u,t,e,g,f,y,h):_o.isBlobLike(u)?typeof u.stream=="function"?a3n(A,u.stream(),t,e,g,f,y,h):ivs(A,u,t,e,g,f,y,h):_o.isStream(u)?nvs(A,u,t,e,g,f,y,h):_o.isIterable(u)?a3n(A,u,t,e,g,f,y,h):Vi(!1),!0}a(rvs,"writeH1");function nvs(t,e,r,n,o,s,c,l){Vi(s!==0||r[L_]===0,"stream body cannot be pipelined");let u=!1,d=new Got({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c}),f=a(function(A){if(!u)try{!d.write(A)&&this.pause&&this.pause()}catch(y){_o.destroy(this,y)}},"onData"),h=a(function(){u||e.resume&&e.resume()},"onDrain"),m=a(function(){if(queueMicrotask(()=>{e.removeListener("error",g)}),!u){let A=new c3n;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Vi(o.destroyed||o[eH]&&r[L_]<=1),o.off("drain",h).off("error",g),e.removeListener("data",f).removeListener("end",g).removeListener("close",m),!A)try{d.end()}catch(y){A=y}d.destroy(A),A&&(A.code!=="UND_ERR_INFO"||A.message!=="reset")?_o.destroy(e,A):_o.destroy(e)}},"onFinished");e.on("data",f).on("end",g).on("error",g).on("close",m),e.resume&&e.resume(),o.on("drain",h).on("error",g),e.errorEmitted??e.errored?setImmediate(()=>g(e.errored)):(e.endEmitted??e.readableEnded)&&setImmediate(()=>g(null)),(e.closeEmitted??e.closed)&&setImmediate(m)}a(nvs,"writeStream");function s3n(t,e,r,n,o,s,c,l){try{e?_o.isBuffer(e)&&(Vi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r \r `,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[wb]=!0)):s===0?o.write(`${c}content-length: 0\r \r `,"latin1"):(Vi(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[Xj]()}catch(u){t(u)}}a(i3n,"writeBuffer");async function rvs(t,e,r,n,o,s,c,l){Vi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new UZ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r +`,"latin1")),n.onRequestSent(),r[Xj]()}catch(u){t(u)}}a(s3n,"writeBuffer");async function ivs(t,e,r,n,o,s,c,l){Vi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new QZ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r \r -`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[wb]=!0),r[Xj]()}catch(u){t(u)}}a(rvs,"writeBlob");async function o3n(t,e,r,n,o,s,c,l){Vi(s!==0||r[L_]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{Vi(u===null),o[zw]?g(o[zw]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new Got({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[zw])throw o[zw];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(o3n,"writeIterable");var Got=class{static{a(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:o,client:s,expectsPayload:c,header:l}){this.socket=r,this.request=n,this.contentLength=o,this.client=s,this.bytesWritten=0,this.expectsPayload=c,this.header=l,this.abort=e,r[eH]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[zw])throw r[zw];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[gir])throw new UZ;process.emitWarning(new UZ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[wb]=!0),o===null?r.write(`${u}transfer-encoding: chunked\r +`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[wb]=!0),r[Xj]()}catch(u){t(u)}}a(ivs,"writeBlob");async function a3n(t,e,r,n,o,s,c,l){Vi(s!==0||r[L_]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{Vi(u===null),o[zw]?g(o[zw]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new Got({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[zw])throw o[zw];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(a3n,"writeIterable");var Got=class{static{a(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:o,client:s,expectsPayload:c,header:l}){this.socket=r,this.request=n,this.contentLength=o,this.client=s,this.bytesWritten=0,this.expectsPayload=c,this.header=l,this.abort=e,r[eH]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[zw])throw r[zw];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[Air])throw new QZ;process.emitWarning(new QZ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[wb]=!0),o===null?r.write(`${u}transfer-encoding: chunked\r `,"latin1"):r.write(`${u}content-length: ${o}\r \r `,"latin1")),o===null&&r.write(`\r ${d.toString(16)}\r -`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[vp].timeout&&r[vp].timeoutType===bpe&&r[vp].timeout.refresh&&r[vp].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[eH]=!1,e[zw])throw e[zw];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r +`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[vp].timeout&&r[vp].timeoutType===Spe&&r[vp].timeout.refresh&&r[vp].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[eH]=!1,e[zw])throw e[zw];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r \r `,"latin1"):e.write(`${c}\r `,"latin1"):r===null&&e.write(`\r 0\r \r -`,"latin1"),r!==null&&o!==r){if(n[gir])throw new UZ;process.emitWarning(new UZ)}e[vp].timeout&&e[vp].timeoutType===bpe&&e[vp].timeout.refresh&&e[vp].timeout.refresh(),n[Xj]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[eH]=!1,e&&(Vi(n[L_]<=1,"pipeline should only contain this request"),o(e))}};l3n.exports=JEs});var y3n=I((Wdf,A3n)=>{"use strict";p();var Yw=require("node:assert"),{pipeline:nvs}=require("node:stream"),_a=Ws(),{RequestContentLengthMismatchError:Eir,RequestAbortedError:d3n,SocketError:QPe,InformationalError:vir}=Rc(),{kUrl:$ot,kReset:Wot,kClient:Spe,kRunning:zot,kPending:ivs,kQueue:tH,kPendingIdx:Cir,kRunningIdx:q2,kError:H2,kSocket:F0,kStrictContentLength:ovs,kOnError:bir,kMaxConcurrentStreams:g3n,kHTTP2Session:j2,kResume:rH,kSize:svs,kHTTPContext:avs}=ef(),d8=Symbol("open streams"),f3n,p3n=!1,Vot;try{Vot=require("node:http2")}catch{Vot={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:cvs,HTTP2_HEADER_METHOD:lvs,HTTP2_HEADER_PATH:uvs,HTTP2_HEADER_SCHEME:dvs,HTTP2_HEADER_CONTENT_LENGTH:fvs,HTTP2_HEADER_EXPECT:pvs,HTTP2_HEADER_STATUS:hvs}}=Vot;function mvs(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.push(Buffer.from(r),Buffer.from(o));else e.push(Buffer.from(r),Buffer.from(n));return e}a(mvs,"parseH2Headers");async function gvs(t,e){t[F0]=e,p3n||(p3n=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=Vot.connect(t[$ot],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[g3n]});r[d8]=0,r[Spe]=t,r[F0]=e,_a.addListener(r,"error",yvs),_a.addListener(r,"frameError",_vs),_a.addListener(r,"end",Evs),_a.addListener(r,"goaway",vvs),_a.addListener(r,"close",function(){let{[Spe]:o}=this,{[F0]:s}=o,c=this[F0][H2]||this[H2]||new QPe("closed",_a.getSocketInfo(s));if(o[j2]=null,o.destroyed){Yw(o[ivs]===0);let l=o[tH].splice(o[q2]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return bvs(t,...o)},resume(){Avs(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a(gvs,"connectH2");function Avs(t){let e=t[F0];e?.destroyed===!1&&(t[svs]===0&&t[g3n]===0?(e.unref(),t[j2].unref()):(e.ref(),t[j2].ref()))}a(Avs,"resumeH2");function yvs(t){Yw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[F0][H2]=t,this[Spe][bir](t)}a(yvs,"onHttp2SessionError");function _vs(t,e,r){if(r===0){let n=new vir(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[F0][H2]=n,this[Spe][bir](n)}}a(_vs,"onHttp2FrameError");function Evs(){let t=new QPe("other side closed",_a.getSocketInfo(this[F0]));this.destroy(t),_a.destroy(this[F0],t)}a(Evs,"onHttp2SessionEnd");function vvs(t){let e=this[H2]||new QPe(`HTTP/2: "GOAWAY" frame received with code ${t}`,_a.getSocketInfo(this)),r=this[Spe];if(r[F0]=null,r[avs]=null,this[j2]!=null&&(this[j2].destroy(e),this[j2]=null),_a.destroy(this[F0],e),r[q2]{e.aborted||e.completed||(T=T||new d3n,_a.errorRequest(t,e,T),m!=null&&_a.destroy(m,T),_a.destroy(f,T),t[tH][t[q2]++]=null,t[rH]())},"abort");try{e.onConnect(y)}catch(T){_a.errorRequest(t,e,T)}if(e.aborted)return!1;if(n==="CONNECT")return r.ref(),m=r.request(h,{endStream:!1,signal:u}),m.id&&!m.pending?(e.onUpgrade(null,null,m),++r[d8],t[tH][t[q2]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[d8],t[tH][t[q2]++]=null}),m.once("close",()=>{r[d8]-=1,r[d8]===0&&r.unref()}),!0;h[uvs]=o,h[dvs]="https";let _=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let E=_a.bodyLength(f);if(_a.isFormDataLike(f)){f3n??=Epe().extractBody;let[T,w]=f3n(f);h["content-type"]=w,f=T.stream,E=T.length}if(E==null&&(E=e.contentLength),(E===0||!_)&&(E=null),Cvs(n)&&E>0&&e.contentLength!=null&&e.contentLength!==E){if(t[ovs])return _a.errorRequest(t,e,new Eir),!1;process.emitWarning(new Eir)}E!=null&&(Yw(f,"no body must not have content length"),h[fvs]=`${E}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[pvs]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",S)):(m=r.request(h,{endStream:v,signal:u}),S()),++r[d8],m.once("response",T=>{let{[hvs]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new d3n;_a.errorRequest(t,e,x),_a.destroy(m,x);return}e.onHeaders(Number(w),mvs(R),m.resume.bind(m),"")===!1&&m.pause(),m.on("data",x=>{e.onData(x)===!1&&m.pause()})}),m.once("end",()=>{(m.state?.state==null||m.state.state<6)&&e.onComplete([]),r[d8]===0&&r.unref(),y(new vir("HTTP/2: stream half-closed (remote)")),t[tH][t[q2]++]=null,t[Cir]=t[q2],t[rH]()}),m.once("close",()=>{r[d8]-=1,r[d8]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new vir(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function S(){!f||E===0?h3n(y,m,null,t,e,t[F0],E,_):_a.isBuffer(f)?h3n(y,m,f,t,e,t[F0],E,_):_a.isBlobLike(f)?typeof f.stream=="function"?m3n(y,m,f.stream(),t,e,t[F0],E,_):Tvs(y,m,f,t,e,t[F0],E,_):_a.isStream(f)?Svs(y,t[F0],_,m,f,t,e,E):_a.isIterable(f)?m3n(y,m,f,t,e,t[F0],E,_):Yw(!1)}a(S,"writeBodyH2")}a(bvs,"writeH2");function h3n(t,e,r,n,o,s,c,l){try{r!=null&&_a.isBuffer(r)&&(Yw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Wot]=!0),o.onRequestSent(),n[rH]()}catch(u){t(u)}}a(h3n,"writeBuffer");function Svs(t,e,r,n,o,s,c,l){Yw(l!==0||s[zot]===0,"stream body cannot be pipelined");let u=nvs(o,n,f=>{f?(_a.destroy(u,f),t(f)):(_a.removeAllListeners(u),c.onRequestSent(),r||(e[Wot]=!0),s[rH]())});_a.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(Svs,"writeStream");async function Tvs(t,e,r,n,o,s,c,l){Yw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new Eir;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Wot]=!0),n[rH]()}catch(u){t(u)}}a(Tvs,"writeBlob");async function m3n(t,e,r,n,o,s,c,l){Yw(c!==0||n[zot]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let h=u;u=null,h()}}a(d,"onDrain");let f=a(()=>new Promise((h,m)=>{Yw(u===null),s[H2]?m(s[H2]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[H2])throw s[H2];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Wot]=!0),n[rH]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(m3n,"writeIterable");A3n.exports=gvs});var Kot=I((Kdf,v3n)=>{"use strict";p();var K5=Ws(),{kBodyUsed:qPe}=ef(),Tir=require("node:assert"),{InvalidArgumentError:Ivs}=Rc(),xvs=require("node:events"),wvs=[300,301,302,303,307,308],_3n=Symbol("body"),Yot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[_3n]=e,this[qPe]=!1}async*[Symbol.asyncIterator](){Tir(!this[qPe],"disturbed"),this[qPe]=!0,yield*this[_3n]}},Sir=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Ivs("maxRedirections must be a positive number");K5.validateHandler(o,n.method,n.upgrade),this.dispatch=e,this.location=null,this.abort=null,this.opts={...n,maxRedirections:0},this.maxRedirections=r,this.handler=o,this.history=[],this.redirectionLimitReached=!1,K5.isStream(this.opts.body)?(K5.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Tir(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[qPe]=!1,xvs.prototype.on.call(this.opts.body,"data",function(){this[qPe]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Yot(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&K5.isIterable(this.opts.body)&&(this.opts.body=new Yot(this.opts.body))}onConnect(e){this.abort=e,this.handler.onConnect(e,{history:this.history})}onUpgrade(e,r,n){this.handler.onUpgrade(e,r,n)}onError(e){this.handler.onError(e)}onHeaders(e,r,n,o){if(this.location=this.history.length>=this.maxRedirections||K5.isDisturbed(this.opts.body)?null:Rvs(e,r),this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections){this.request&&this.request.abort(new Error("max redirects")),this.redirectionLimitReached=!0,this.abort(new Error("max redirects"));return}if(this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return this.handler.onHeaders(e,r,n,o);let{origin:s,pathname:c,search:l}=K5.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=kvs(this.opts.headers,e===303,this.opts.origin!==s),this.opts.path=u,this.opts.origin=s,this.opts.maxRedirections=0,this.opts.query=null,e===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",this.opts.body=null)}onData(e){if(!this.location)return this.handler.onData(e)}onComplete(e){this.location?(this.location=null,this.abort=null,this.dispatch(this.opts,this)):this.handler.onComplete(e)}onBodySent(e){this.handler.onBodySent&&this.handler.onBodySent(e)}};function Rvs(t,e){if(wvs.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var Pvs=Kot();function Dvs({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new Pvs(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(Dvs,"createRedirectInterceptor");C3n.exports=Dvs});var xpe=I((rff,D3n)=>{"use strict";p();var f8=require("node:assert"),w3n=require("node:net"),Nvs=require("node:http"),QZ=Ws(),{channels:Tpe}=ape(),Mvs=BLn(),Ovs=dpe(),{InvalidArgumentError:Ah,InformationalError:Lvs,ClientDestroyedError:Bvs}=Rc(),Fvs=wPe(),{kUrl:J5,kServerName:nH,kClient:Uvs,kBusy:Iir,kConnect:Qvs,kResuming:qZ,kRunning:VPe,kPending:WPe,kSize:$Pe,kQueue:G2,kConnected:qvs,kConnecting:Ipe,kNeedDrain:oH,kKeepAliveDefaultTimeout:b3n,kHostHeader:jvs,kPendingIdx:$2,kRunningIdx:p8,kError:Hvs,kPipelining:Zot,kKeepAliveTimeoutValue:Gvs,kMaxHeadersSize:$vs,kKeepAliveMaxTimeout:Vvs,kKeepAliveTimeoutThreshold:Wvs,kHeadersTimeout:zvs,kBodyTimeout:Yvs,kStrictContentLength:Kvs,kConnector:jPe,kMaxRedirections:Jvs,kMaxRequests:xir,kCounter:Zvs,kClose:Xvs,kDestroy:eCs,kDispatch:tCs,kInterceptors:S3n,kLocalAddress:HPe,kMaxResponseSize:rCs,kOnError:nCs,kHTTPContext:yh,kMaxConcurrentStreams:iCs,kResume:GPe}=ef(),oCs=u3n(),sCs=y3n(),T3n=!1,iH=Symbol("kClosedResolve"),I3n=a(()=>{},"noop");function R3n(t){return t[Zot]??t[yh]?.defaultPipelining??1}a(R3n,"getPipelining");var wir=class extends Ovs{static{a(this,"Client")}constructor(e,{interceptors:r,maxHeaderSize:n,headersTimeout:o,socketTimeout:s,requestTimeout:c,connectTimeout:l,bodyTimeout:u,idleTimeout:d,keepAlive:f,keepAliveTimeout:h,maxKeepAliveTimeout:m,keepAliveMaxTimeout:g,keepAliveTimeoutThreshold:A,socketPath:y,pipelining:_,tls:E,strictContentLength:v,maxCachedSessions:S,maxRedirections:T,connect:w,maxRequestsPerClient:R,localAddress:x,maxResponseSize:k,autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N,maxConcurrentStreams:O,allowH2:B}={}){if(super(),f!==void 0)throw new Ah("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new Ah("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new Ah("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new Ah("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new Ah("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new Ah("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new Ah("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new Ah("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new Ah("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new Ah("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new Ah("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new Ah("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new Ah("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new Ah("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new Ah("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new Ah("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||w3n.isIP(x)===0))throw new Ah("localAddress must be valid string IP address");if(k!=null&&(!Number.isInteger(k)||k<-1))throw new Ah("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new Ah("autoSelectFamilyAttemptTimeout must be a positive number");if(B!=null&&typeof B!="boolean")throw new Ah("allowH2 must be a valid boolean value");if(O!=null&&(typeof O!="number"||O<1))throw new Ah("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=Fvs({...E,maxCachedSessions:S,allowH2:B,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[S3n]=r.Client,T3n||(T3n=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[S3n]=[aCs({maxRedirections:T})],this[J5]=QZ.parseOrigin(e),this[jPe]=w,this[Zot]=_??1,this[$vs]=n||Nvs.maxHeaderSize,this[b3n]=h??4e3,this[Vvs]=g??6e5,this[Wvs]=A??2e3,this[Gvs]=this[b3n],this[nH]=null,this[HPe]=x??null,this[qZ]=0,this[oH]=0,this[jvs]=`host: ${this[J5].hostname}${this[J5].port?`:${this[J5].port}`:""}\r -`,this[Yvs]=u??3e5,this[zvs]=o??3e5,this[Kvs]=v??!0,this[Jvs]=T,this[xir]=R,this[iH]=null,this[rCs]=k>-1?k:-1,this[iCs]=O??100,this[yh]=null,this[G2]=[],this[p8]=0,this[$2]=0,this[GPe]=q=>Rir(this,q),this[nCs]=q=>k3n(this,q)}get pipelining(){return this[Zot]}set pipelining(e){this[Zot]=e,this[GPe](!0)}get[WPe](){return this[G2].length-this[$2]}get[VPe](){return this[$2]-this[p8]}get[$Pe](){return this[G2].length-this[p8]}get[qvs](){return!!this[yh]&&!this[Ipe]&&!this[yh].destroyed}get[Iir](){return!!(this[yh]?.busy(null)||this[$Pe]>=(R3n(this)||1)||this[WPe]>0)}[Qvs](e){P3n(this),this.once("connect",e)}[tCs](e,r){let n=e.origin||this[J5].origin,o=new Mvs(n,e,r);return this[G2].push(o),this[qZ]||(QZ.bodyLength(o.body)==null&&QZ.isIterable(o.body)?(this[qZ]=1,queueMicrotask(()=>Rir(this))):this[GPe](!0)),this[qZ]&&this[oH]!==2&&this[Iir]&&(this[oH]=2),this[oH]<2}async[Xvs](){return new Promise(e=>{this[$Pe]?this[iH]=e:e(null)})}async[eCs](e){return new Promise(r=>{let n=this[G2].splice(this[$2]);for(let s=0;s{this[iH]&&(this[iH](),this[iH]=null),r(null)},"callback");this[yh]?(this[yh].destroy(e,o),this[yh]=null):queueMicrotask(o),this[GPe]()})}},aCs=Jot();function k3n(t,e){if(t[VPe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){f8(t[$2]===t[p8]);let r=t[G2].splice(t[p8]);for(let n=0;n{t[jPe]({host:e,hostname:r,protocol:n,port:o,servername:t[nH],localAddress:t[HPe]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){QZ.destroy(s.on("error",I3n),new Bvs);return}f8(s);try{t[yh]=s.alpnProtocol==="h2"?await sCs(t,s):await oCs(t,s)}catch(c){throw s.destroy().on("error",I3n),c}t[Ipe]=!1,s[Zvs]=0,s[xir]=t[xir],s[Uvs]=t,s[Hvs]=null,Tpe.connected.hasSubscribers&&Tpe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[yh]?.version,servername:t[nH],localAddress:t[HPe]},connector:t[jPe],socket:s}),t.emit("connect",t[J5],[t])}catch(s){if(t.destroyed)return;if(t[Ipe]=!1,Tpe.connectError.hasSubscribers&&Tpe.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[yh]?.version,servername:t[nH],localAddress:t[HPe]},connector:t[jPe],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(f8(t[VPe]===0);t[WPe]>0&&t[G2][t[$2]].servername===t[nH];){let c=t[G2][t[$2]++];QZ.errorRequest(t,c,s)}else k3n(t,s);t.emit("connectionError",t[J5],[t],s)}t[GPe]()}a(P3n,"connect");function x3n(t){t[oH]=0,t.emit("drain",t[J5],[t])}a(x3n,"emitDrain");function Rir(t,e){t[qZ]!==2&&(t[qZ]=2,cCs(t,e),t[qZ]=0,t[p8]>256&&(t[G2].splice(0,t[p8]),t[$2]-=t[p8],t[p8]=0))}a(Rir,"resume");function cCs(t,e){for(;;){if(t.destroyed){f8(t[WPe]===0);return}if(t[iH]&&!t[$Pe]){t[iH](),t[iH]=null;return}if(t[yh]&&t[yh].resume(),t[Iir])t[oH]=2;else if(t[oH]===2){e?(t[oH]=1,queueMicrotask(()=>x3n(t))):x3n(t);continue}if(t[WPe]===0||t[VPe]>=(R3n(t)||1))return;let r=t[G2][t[$2]];if(t[J5].protocol==="https:"&&t[nH]!==r.servername){if(t[VPe]>0)return;t[nH]=r.servername,t[yh]?.destroy(new Lvs("servername changed"),()=>{t[yh]=null,Rir(t)})}if(t[Ipe])return;if(!t[yh]){P3n(t);return}if(t[yh].destroyed||t[yh].busy(r))return;!r.aborted&&t[yh].write(r)?t[$2]++:t[G2].splice(t[$2],1)}}a(cCs,"_resume");D3n.exports=wir});var kir=I((sff,N3n)=>{"use strict";p();var Xot=class{static{a(this,"FixedCircularBuffer")}constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};N3n.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Xot}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Xot),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var O3n=I((lff,M3n)=>{p();var{kFree:lCs,kConnected:uCs,kPending:dCs,kQueued:fCs,kRunning:pCs,kSize:hCs}=ef(),jZ=Symbol("pool"),Pir=class{static{a(this,"PoolStats")}constructor(e){this[jZ]=e}get connected(){return this[jZ][uCs]}get free(){return this[jZ][lCs]}get pending(){return this[jZ][dCs]}get queued(){return this[jZ][fCs]}get running(){return this[jZ][pCs]}get size(){return this[jZ][hCs]}};M3n.exports=Pir});var Bir=I((fff,$3n)=>{"use strict";p();var mCs=dpe(),gCs=kir(),{kConnected:Dir,kSize:L3n,kRunning:B3n,kPending:F3n,kQueued:zPe,kBusy:ACs,kFree:yCs,kUrl:_Cs,kClose:ECs,kDestroy:vCs,kDispatch:CCs}=ef(),bCs=O3n(),Rb=Symbol("clients"),Sv=Symbol("needDrain"),YPe=Symbol("queue"),Nir=Symbol("closed resolve"),Mir=Symbol("onDrain"),U3n=Symbol("onConnect"),Q3n=Symbol("onDisconnect"),q3n=Symbol("onConnectionError"),Oir=Symbol("get dispatcher"),H3n=Symbol("add client"),G3n=Symbol("remove client"),j3n=Symbol("stats"),Lir=class extends mCs{static{a(this,"PoolBase")}constructor(){super(),this[YPe]=new gCs,this[Rb]=[],this[zPe]=0;let e=this;this[Mir]=a(function(n,o){let s=e[YPe],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[zPe]--,c=!this.dispatch(l.opts,l.handler)}this[Sv]=c,!this[Sv]&&e[Sv]&&(e[Sv]=!1,e.emit("drain",n,[e,...o])),e[Nir]&&s.isEmpty()&&Promise.all(e[Rb].map(l=>l.close())).then(e[Nir])},"onDrain"),this[U3n]=(r,n)=>{e.emit("connect",r,[e,...n])},this[Q3n]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[q3n]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[j3n]=new bCs(this)}get[ACs](){return this[Sv]}get[Dir](){return this[Rb].filter(e=>e[Dir]).length}get[yCs](){return this[Rb].filter(e=>e[Dir]&&!e[Sv]).length}get[F3n](){let e=this[zPe];for(let{[F3n]:r}of this[Rb])e+=r;return e}get[B3n](){let e=0;for(let{[B3n]:r}of this[Rb])e+=r;return e}get[L3n](){let e=this[zPe];for(let{[L3n]:r}of this[Rb])e+=r;return e}get stats(){return this[j3n]}async[ECs](){this[YPe].isEmpty()?await Promise.all(this[Rb].map(e=>e.close())):await new Promise(e=>{this[Nir]=e})}async[vCs](e){for(;;){let r=this[YPe].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[Rb].map(r=>r.destroy(e)))}[CCs](e,r){let n=this[Oir]();return n?n.dispatch(e,r)||(n[Sv]=!0,this[Sv]=!this[Oir]()):(this[Sv]=!0,this[YPe].push({opts:e,handler:r}),this[zPe]++),!this[Sv]}[H3n](e){return e.on("drain",this[Mir]).on("connect",this[U3n]).on("disconnect",this[Q3n]).on("connectionError",this[q3n]),this[Rb].push(e),this[Sv]&&queueMicrotask(()=>{this[Sv]&&this[Mir](e[_Cs],[this,e])}),this}[G3n](e){e.close(()=>{let r=this[Rb].indexOf(e);r!==-1&&this[Rb].splice(r,1)}),this[Sv]=this[Rb].some(r=>!r[Sv]&&r.closed!==!0&&r.destroyed!==!0)}};$3n.exports={PoolBase:Lir,kClients:Rb,kNeedDrain:Sv,kAddClient:H3n,kRemoveClient:G3n,kGetDispatcher:Oir}});var wpe=I((mff,Y3n)=>{"use strict";p();var{PoolBase:SCs,kClients:est,kNeedDrain:TCs,kAddClient:ICs,kGetDispatcher:xCs}=Bir(),wCs=xpe(),{InvalidArgumentError:Fir}=Rc(),V3n=Ws(),{kUrl:W3n,kInterceptors:RCs}=ef(),kCs=wPe(),Uir=Symbol("options"),Qir=Symbol("connections"),z3n=Symbol("factory");function PCs(t,e){return new wCs(t,e)}a(PCs,"defaultFactory");var qir=class extends SCs{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=PCs,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,...m}={}){if(super(),r!=null&&(!Number.isFinite(r)||r<0))throw new Fir("invalid connections");if(typeof n!="function")throw new Fir("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new Fir("connect must be a function or an object");typeof o!="function"&&(o=kCs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[RCs]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[Qir]=r||null,this[W3n]=V3n.parseOrigin(e),this[Uir]={...V3n.deepClone(m),connect:o,allowH2:h},this[Uir].interceptors=m.interceptors?{...m.interceptors}:void 0,this[z3n]=n,this.on("connectionError",(g,A,y)=>{for(let _ of A){let E=this[est].indexOf(_);E!==-1&&this[est].splice(E,1)}})}[xCs](){for(let e of this[est])if(!e[TCs])return e;if(!this[Qir]||this[est].length{"use strict";p();var{BalancedPoolMissingUpstreamError:DCs,InvalidArgumentError:NCs}=Rc(),{PoolBase:MCs,kClients:B_,kNeedDrain:KPe,kAddClient:OCs,kRemoveClient:LCs,kGetDispatcher:BCs}=Bir(),FCs=wpe(),{kUrl:jir,kInterceptors:UCs}=ef(),{parseOrigin:K3n}=Ws(),J3n=Symbol("factory"),tst=Symbol("options"),Z3n=Symbol("kGreatestCommonDivisor"),HZ=Symbol("kCurrentWeight"),GZ=Symbol("kIndex"),Kw=Symbol("kWeight"),rst=Symbol("kMaxWeightPerServer"),nst=Symbol("kErrorPenalty");function QCs(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(QCs,"getGreatestCommonDivisor");function qCs(t,e){return new FCs(t,e)}a(qCs,"defaultFactory");var Hir=class extends MCs{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=qCs,...n}={}){if(super(),this[tst]=n,this[GZ]=-1,this[HZ]=0,this[rst]=this[tst].maxWeightPerServer||100,this[nst]=this[tst].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new NCs("factory must be a function.");this[UCs]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[J3n]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=K3n(e).origin;if(this[B_].find(o=>o[jir].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[J3n](r,Object.assign({},this[tst]));this[OCs](n),n.on("connect",()=>{n[Kw]=Math.min(this[rst],n[Kw]+this[nst])}),n.on("connectionError",()=>{n[Kw]=Math.max(1,n[Kw]-this[nst]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Kw]=Math.max(1,n[Kw]-this[nst]),this._updateBalancedPoolStats())});for(let o of this[B_])o[Kw]=this[rst];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[jir].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[LCs](n),this}get upstreams(){return this[B_].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[jir].origin)}[BCs](){if(this[B_].length===0)throw new DCs;if(!this[B_].find(s=>!s[KPe]&&s.closed!==!0&&s.destroyed!==!0)||this[B_].map(s=>s[KPe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[B_].findIndex(s=>!s[KPe]);for(;n++this[B_][o][Kw]&&!s[KPe]&&(o=this[GZ]),this[GZ]===0&&(this[HZ]=this[HZ]-this[Z3n],this[HZ]<=0&&(this[HZ]=this[rst])),s[Kw]>=this[HZ]&&!s[KPe])return s}return this[HZ]=this[B_][o][Kw],this[GZ]=o,this[B_][o]}};X3n.exports=Hir});var Rpe=I((vff,aFn)=>{"use strict";p();var{InvalidArgumentError:ist}=Rc(),{kClients:sH,kRunning:tFn,kClose:jCs,kDestroy:HCs,kDispatch:GCs,kInterceptors:$Cs}=ef(),VCs=dpe(),WCs=wpe(),zCs=xpe(),YCs=Ws(),KCs=Jot(),rFn=Symbol("onConnect"),nFn=Symbol("onDisconnect"),iFn=Symbol("onConnectionError"),JCs=Symbol("maxRedirections"),oFn=Symbol("onDrain"),sFn=Symbol("factory"),Gir=Symbol("options");function ZCs(t,e){return e&&e.connections===1?new zCs(t,e):new WCs(t,e)}a(ZCs,"defaultFactory");var $ir=class extends VCs{static{a(this,"Agent")}constructor({factory:e=ZCs,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new ist("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new ist("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new ist("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[$Cs]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[KCs({maxRedirections:r})],this[Gir]={...YCs.deepClone(o),connect:n},this[Gir].interceptors=o.interceptors?{...o.interceptors}:void 0,this[JCs]=r,this[sFn]=e,this[sH]=new Map,this[oFn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[rFn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[nFn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[iFn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[tFn](){let e=0;for(let r of this[sH].values())e+=r[tFn];return e}[GCs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new ist("opts.origin must be a non-empty string or URL.");let o=this[sH].get(n);return o||(o=this[sFn](e.origin,this[Gir]).on("drain",this[oFn]).on("connect",this[rFn]).on("disconnect",this[nFn]).on("connectionError",this[iFn]),this[sH].set(n,o)),o.dispatch(e,r)}async[jCs](){let e=[];for(let r of this[sH].values())e.push(r.close());this[sH].clear(),await Promise.all(e)}async[HCs](e){let r=[];for(let n of this[sH].values())r.push(n.destroy(e));this[sH].clear(),await Promise.all(r)}};aFn.exports=$ir});var Kir=I((Sff,yFn)=>{"use strict";p();var{kProxy:Vir,kClose:pFn,kDestroy:hFn,kDispatch:cFn,kInterceptors:XCs}=ef(),{URL:$Z}=require("node:url"),ebs=Rpe(),mFn=wpe(),gFn=dpe(),{InvalidArgumentError:kpe,RequestAbortedError:tbs,SecureProxyConnectionError:rbs}=Rc(),lFn=wPe(),AFn=xpe(),ost=Symbol("proxy agent"),sst=Symbol("proxy client"),aH=Symbol("proxy headers"),Wir=Symbol("request tls settings"),uFn=Symbol("proxy tls settings"),dFn=Symbol("connect endpoint function"),fFn=Symbol("tunnel proxy");function nbs(t){return t==="https:"?443:80}a(nbs,"defaultProtocolPort");function ibs(t,e){return new mFn(t,e)}a(ibs,"defaultFactory");var obs=a(()=>{},"noop");function sbs(t,e){return e.connections===1?new AFn(t,e):new mFn(t,e)}a(sbs,"defaultAgentFactory");var zir=class extends gFn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new kpe("Proxy URL is mandatory");this[aH]=r,o?this.#e=o(e,{connect:n}):this.#e=new AFn(e,{connect:n})}[cFn](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new kpe("Proxy Authentication Required (407)"));return}n&&n.call(this,l,u,d)};let{origin:o,path:s="/",headers:c={}}=e;if(e.path=o+s,!("host"in c)&&!("Host"in c)){let{host:l}=new $Z(o);c.host=l}return e.headers={...this[aH],...c},this.#e[cFn](e,r)}async[pFn](){return this.#e.close()}async[hFn](e){return this.#e.destroy(e)}},Yir=class extends gFn{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof $Z)&&!e.uri)throw new kpe("Proxy uri is mandatory");let{clientFactory:r=ibs}=e;if(typeof r!="function")throw new kpe("Proxy opts.clientFactory must be a function.");let{proxyTunnel:n=!0}=e,o=this.#e(e),{href:s,origin:c,port:l,protocol:u,username:d,password:f,hostname:h}=o;if(this[Vir]={uri:s,protocol:u},this[XCs]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[Wir]=e.requestTls,this[uFn]=e.proxyTls,this[aH]=e.headers||{},this[fFn]=n,e.auth&&e.token)throw new kpe("opts.auth cannot be used in combination with opts.token");e.auth?this[aH]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[aH]["proxy-authorization"]=e.token:d&&f&&(this[aH]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=lFn({...e.proxyTls});this[dFn]=lFn({...e.requestTls});let g=e.factory||sbs,A=a((y,_)=>{let{protocol:E}=new $Z(y);return!this[fFn]&&E==="http:"&&this[Vir].protocol==="http:"?new zir(this[Vir].uri,{headers:this[aH],connect:m,factory:g}):g(y,_)},"factory");this[sst]=r(o,{connect:m}),this[ost]=new ebs({...e,factory:A,connect:a(async(y,_)=>{let E=y.host;y.port||(E+=`:${nbs(y.protocol)}`);try{let{socket:v,statusCode:S}=await this[sst].connect({origin:c,port:l,path:E,signal:y.signal,headers:{...this[aH],host:y.host},servername:this[uFn]?.servername||h});if(S!==200&&(v.on("error",obs).destroy(),_(new tbs(`Proxy response (${S}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){_(null,v);return}let T;this[Wir]?T=this[Wir].servername:T=y.servername,this[dFn]({...y,servername:T,httpSocket:v},_)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?_(new rbs(v)):_(v)}},"connect")})}dispatch(e,r){let n=abs(e.headers);if(cbs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new $Z(e.origin);n.host=o}return this[ost].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new $Z(e):e instanceof $Z?e:new $Z(e.uri)}async[pFn](){await this[ost].close(),await this[sst].close()}async[hFn](){await this[ost].destroy(),await this[sst].destroy()}};function abs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new kpe("Proxy-Authorization should be sent in ProxyAgent constructor")}a(cbs,"throwIfProxyAuthIsSent");yFn.exports=Yir});var SFn=I((xff,bFn)=>{"use strict";p();var lbs=dpe(),{kClose:ubs,kDestroy:dbs,kClosed:_Fn,kDestroyed:EFn,kDispatch:fbs,kNoProxyAgent:JPe,kHttpProxyAgent:cH,kHttpsProxyAgent:VZ}=ef(),vFn=Kir(),pbs=Rpe(),hbs={"http:":80,"https:":443},CFn=!1,Jir=class extends lbs{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,CFn||(CFn=!0,process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.",{code:"UNDICI-EHPA"}));let{httpProxy:r,httpsProxy:n,noProxy:o,...s}=e;this[JPe]=new pbs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[cH]=new vFn({...s,uri:c}):this[cH]=this[JPe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[VZ]=new vFn({...s,uri:l}):this[VZ]=this[cH],this.#o()}[fbs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[ubs](){await this[JPe].close(),this[cH][_Fn]||await this[cH].close(),this[VZ][_Fn]||await this[VZ].close()}async[dbs](e){await this[JPe].destroy(e),this[cH][EFn]||await this[cH].destroy(e),this[VZ][EFn]||await this[VZ].destroy(e)}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||hbs[r]||0,this.#i(n,o)?r==="https:"?this[VZ]:this[cH]:this[JPe]}#i(e,r){if(this.#s&&this.#o(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let n=0;n{"use strict";p();var Ppe=require("node:assert"),{kRetryHandlerDefaultRetry:TFn}=ef(),{RequestRetryError:ZPe}=Rc(),{isDisturbed:IFn,parseHeaders:mbs,parseRangeHeader:xFn,wrapRequestBody:gbs}=Ws();function Abs(t){let e=Date.now();return new Date(t).getTime()-e}a(Abs,"calculateRetryAfterHeader");var Zir=class t{static{a(this,"RetryHandler")}constructor(e,r){let{retryOptions:n,...o}=e,{retry:s,maxRetries:c,maxTimeout:l,minTimeout:u,timeoutFactor:d,methods:f,errorCodes:h,retryAfter:m,statusCodes:g}=n??{};this.dispatch=r.dispatch,this.handler=r.handler,this.opts={...o,body:gbs(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[TFn],retryAfter:m??!0,maxTimeout:l??30*1e3,minTimeout:u??500,timeoutFactor:d??2,maxRetries:c??5,methods:f??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:g??[500,502,503,504,429],errorCodes:h??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(A=>{this.aborted=!0,this.abort?this.abort(A):this.reason=A})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(e,r,n){this.handler.onUpgrade&&this.handler.onUpgrade(e,r,n)}onConnect(e){this.aborted?e(this.reason):this.abort=e}onBodySent(e){if(this.handler.onBodySent)return this.handler.onBodySent(e)}static[TFn](e,{state:r,opts:n},o){let{statusCode:s,code:c,headers:l}=e,{method:u,retryOptions:d}=n,{maxRetries:f,minTimeout:h,maxTimeout:m,timeoutFactor:g,statusCodes:A,errorCodes:y,methods:_}=d,{counter:E}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(_)&&!_.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(E>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?Abs(v):v*1e3);let S=v>0?Math.min(v,m):Math.min(h*g**(E-1),m);setTimeout(()=>o(null),S)}onHeaders(e,r,n,o){let s=mbs(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new ZPe("Request failed",e,{headers:s,data:{count:this.retryCount}})),!1);if(this.resume!=null){if(this.resume=null,e!==206&&(this.start>0||e!==200))return this.abort(new ZPe("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=xFn(s["content-range"]);if(!l)return this.abort(new ZPe("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new ZPe("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return Ppe(this.start===u,"content-range mismatch"),Ppe(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=xFn(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;Ppe(u!=null&&Number.isFinite(u),"content-range mismatch"),Ppe(f!=null&&Number.isFinite(f),"invalid content-length"),this.start=u,this.end=f}if(this.end==null){let l=s["content-length"];this.end=l!=null?Number(l)-1:null}return Ppe(Number.isFinite(this.start)),Ppe(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=n,this.etag=s.etag!=null?s.etag:null,this.etag!=null&&this.etag.startsWith("W/")&&(this.etag=null),this.handler.onHeaders(e,r,n,o)}let c=new ZPe("Request failed",e,{headers:s,data:{count:this.retryCount}});return this.abort(c),!1}onData(e){return this.start+=e.length,this.handler.onData(e)}onComplete(e){return this.retryCount=0,this.handler.onComplete(e)}onError(e){if(this.aborted||IFn(this.opts.body))return this.handler.onError(e);this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(e,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},r.bind(this));function r(n){if(n!=null||this.aborted||IFn(this.opts.body))return this.handler.onError(n);if(this.start!==0){let o={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(o["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...o}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(o){this.handler.onError(o)}}a(r,"onRetry")}};wFn.exports=Zir});var kFn=I((Nff,RFn)=>{"use strict";p();var ybs=IPe(),_bs=ast(),Xir=class extends ybs{static{a(this,"RetryAgent")}#e=null;#t=null;constructor(e,r={}){super(r),this.#e=e,this.#t=r}dispatch(e,r){let n=new _bs({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:r});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};RFn.exports=Xir});var oor=I((Lff,UFn)=>{"use strict";p();var OFn=require("node:assert"),{Readable:Ebs}=require("node:stream"),{RequestAbortedError:LFn,NotSupportedError:vbs,InvalidArgumentError:Cbs,AbortError:eor}=Rc(),BFn=Ws(),{ReadableStreamFrom:bbs}=Ws(),MT=Symbol("kConsume"),XPe=Symbol("kReading"),lH=Symbol("kBody"),PFn=Symbol("kAbort"),FFn=Symbol("kContentType"),DFn=Symbol("kContentLength"),Sbs=a(()=>{},"noop"),tor=class extends Ebs{static{a(this,"BodyReadable")}constructor({resume:e,abort:r,contentType:n="",contentLength:o,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[PFn]=r,this[MT]=null,this[lH]=null,this[FFn]=n,this[DFn]=o,this[XPe]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new LFn),e&&this[PFn](),super.destroy(e)}_destroy(e,r){this[XPe]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[XPe]=!0),super.on(e,...r)}addListener(e,...r){return this.on(e,...r)}off(e,...r){let n=super.off(e,...r);return(e==="data"||e==="readable")&&(this[XPe]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[MT]&&e!==null?(nor(this[MT],e),this[XPe]?super.push(e):!0):super.push(e)}async text(){return e2e(this,"text")}async json(){return e2e(this,"json")}async blob(){return e2e(this,"blob")}async bytes(){return e2e(this,"bytes")}async arrayBuffer(){return e2e(this,"arrayBuffer")}async formData(){throw new vbs}get bodyUsed(){return BFn.isDisturbed(this)}get body(){return this[lH]||(this[lH]=bbs(this),this[MT]&&(this[lH].getReader(),OFn(this[lH].locked))),this[lH]}async dump(e){let r=Number.isFinite(e?.limit)?e.limit:131072,n=e?.signal;if(n!=null&&(typeof n!="object"||!("aborted"in n)))throw new Cbs("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[DFn]>r&&this.destroy(new eor);let c=a(()=>{this.destroy(n.reason??new eor)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new eor):o(null)}).on("error",Sbs).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function Tbs(t){return t[lH]&&t[lH].locked===!0||t[MT]}a(Tbs,"isLocked");function Ibs(t){return BFn.isDisturbed(t)||Tbs(t)}a(Ibs,"isUnusable");async function e2e(t,e){return OFn(!t[MT]),new Promise((r,n)=>{if(Ibs(t)){let o=t._readableState;o.destroyed&&o.closeEmitted===!1?t.on("error",s=>{n(s)}).on("close",()=>{n(new TypeError("unusable"))}):n(o.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[MT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){ior(this[MT],o)}).on("close",function(){this[MT].body!==null&&ior(this[MT],new LFn)}),xbs(t[MT])})})}a(e2e,"consume");function xbs(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,n=e.buffer.length;for(let o=r;o2&&r[0]===239&&r[1]===187&&r[2]===191?3:0;return r.utf8Slice(o,n)}a(ror,"chunksDecode");function NFn(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let r=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),n=0;for(let o=0;o{p();var wbs=require("node:assert"),{ResponseStatusCodeError:QFn}=Rc(),{chunksDecode:qFn}=oor(),Rbs=128*1024;async function kbs({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){wbs(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>Rbs){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new QFn(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{jFn(r)?f=JSON.parse(qFn(c,l)):HFn(r)&&(f=qFn(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new QFn(u,n,s,f)))}a(kbs,"getResolveErrorBodyCallback");var jFn=a(t=>t.length>15&&t[11]==="/"&&t[0]==="a"&&t[1]==="p"&&t[2]==="p"&&t[3]==="l"&&t[4]==="i"&&t[5]==="c"&&t[6]==="a"&&t[7]==="t"&&t[8]==="i"&&t[9]==="o"&&t[10]==="n"&&t[12]==="j"&&t[13]==="s"&&t[14]==="o"&&t[15]==="n","isContentTypeApplicationJson"),HFn=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");GFn.exports={getResolveErrorBodyCallback:kbs,isContentTypeApplicationJson:jFn,isContentTypeText:HFn}});var WFn=I((jff,aor)=>{"use strict";p();var Pbs=require("node:assert"),{Readable:Dbs}=oor(),{InvalidArgumentError:Dpe,RequestAbortedError:$Fn}=Rc(),OT=Ws(),{getResolveErrorBodyCallback:Nbs}=sor(),{AsyncResource:Mbs}=require("node:async_hooks"),cst=class extends Mbs{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Dpe("invalid opts");let{signal:n,method:o,opaque:s,body:c,onInfo:l,responseHeaders:u,throwOnError:d,highWaterMark:f}=e;try{if(typeof r!="function")throw new Dpe("invalid callback");if(f&&(typeof f!="number"||f<0))throw new Dpe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Dpe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Dpe("invalid method");if(l&&typeof l!="function")throw new Dpe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw OT.isStream(c)&&OT.destroy(c.on("error",OT.nop),h),h}this.method=o,this.responseHeaders=u||null,this.opaque=s||null,this.callback=r,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.throwOnError=d,this.highWaterMark=f,this.signal=n,this.reason=null,this.removeAbortListener=null,OT.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new $Fn:this.removeAbortListener=OT.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new $Fn,this.res?OT.destroy(this.res.on("error",OT.nop),this.reason):this.abort&&this.abort(this.reason),this.removeAbortListener&&(this.res?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}))}onConnect(e,r){if(this.reason){e(this.reason);return}Pbs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{callback:s,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,h=d==="raw"?OT.parseRawHeaders(r):OT.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?OT.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new Dbs({resume:n,abort:l,contentType:g,contentLength:this.method!=="HEAD"&&A?Number(A):null,highWaterMark:f});this.removeAbortListener&&y.on("close",this.removeAbortListener),this.callback=null,this.res=y,s!==null&&(this.throwOnError&&e>=400?this.runInAsyncScope(Nbs,null,{callback:s,body:y,contentType:g,statusCode:e,statusMessage:o,headers:h}):this.runInAsyncScope(s,null,null,{statusCode:e,headers:h,trailers:this.trailers,opaque:c,body:y,context:u}))}onData(e){return this.res.push(e)}onComplete(e){OT.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:r,callback:n,body:o,opaque:s}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:s})})),r&&(this.res=null,queueMicrotask(()=>{OT.destroy(r,e)})),o&&(this.body=null,OT.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function VFn(t,e){if(e===void 0)return new Promise((r,n)=>{VFn.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new cst(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(VFn,"request");aor.exports=VFn;aor.exports.RequestHandler=cst});var t2e=I(($ff,KFn)=>{p();var{addAbortListener:Obs}=Ws(),{RequestAbortedError:Lbs}=Rc(),Npe=Symbol("kListener"),Z5=Symbol("kSignal");function zFn(t){t.abort?t.abort(t[Z5]?.reason):t.reason=t[Z5]?.reason??new Lbs,YFn(t)}a(zFn,"abort");function Bbs(t,e){if(t.reason=null,t[Z5]=null,t[Npe]=null,!!e){if(e.aborted){zFn(t);return}t[Z5]=e,t[Npe]=()=>{zFn(t)},Obs(t[Z5],t[Npe])}}a(Bbs,"addSignal");function YFn(t){t[Z5]&&("removeEventListener"in t[Z5]?t[Z5].removeEventListener("abort",t[Npe]):t[Z5].removeListener("abort",t[Npe]),t[Z5]=null,t[Npe]=null)}a(YFn,"removeSignal");KFn.exports={addSignal:Bbs,removeSignal:YFn}});var e8n=I((zff,XFn)=>{"use strict";p();var Fbs=require("node:assert"),{finished:Ubs,PassThrough:Qbs}=require("node:stream"),{InvalidArgumentError:Mpe,InvalidReturnValueError:qbs}=Rc(),V2=Ws(),{getResolveErrorBodyCallback:jbs}=sor(),{AsyncResource:Hbs}=require("node:async_hooks"),{addSignal:Gbs,removeSignal:JFn}=t2e(),cor=class extends Hbs{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new Mpe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d,throwOnError:f}=e;try{if(typeof n!="function")throw new Mpe("invalid callback");if(typeof r!="function")throw new Mpe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new Mpe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Mpe("invalid method");if(u&&typeof u!="function")throw new Mpe("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw V2.isStream(l)&&V2.destroy(l.on("error",V2.nop),h),h}this.responseHeaders=d||null,this.opaque=c||null,this.factory=r,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=l,this.onInfo=u||null,this.throwOnError=f||!1,V2.isStream(l)&&l.on("error",h=>{this.onError(h)}),Gbs(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}Fbs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{factory:s,opaque:c,context:l,callback:u,responseHeaders:d}=this,f=d==="raw"?V2.parseRawHeaders(r):V2.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:f});return}this.factory=null;let h;if(this.throwOnError&&e>=400){let A=(d==="raw"?V2.parseHeaders(r):f)["content-type"];h=new Qbs,this.callback=null,this.runInAsyncScope(jbs,null,{callback:u,body:h,contentType:A,statusCode:e,statusMessage:o,headers:f})}else{if(s===null)return;if(h=this.runInAsyncScope(s,null,{statusCode:e,headers:f,opaque:c,context:l}),!h||typeof h.write!="function"||typeof h.end!="function"||typeof h.on!="function")throw new qbs("expected Writable");Ubs(h,{readable:!1},g=>{let{callback:A,res:y,opaque:_,trailers:E,abort:v}=this;this.res=null,(g||!y.readable)&&V2.destroy(y,g),this.callback=null,this.runInAsyncScope(A,null,g||null,{opaque:_,trailers:E}),g&&v()})}return h.on("drain",n),this.res=h,(h.writableNeedDrain!==void 0?h.writableNeedDrain:h._writableState?.needDrain)!==!0}onData(e){let{res:r}=this;return r?r.write(e):!0}onComplete(e){let{res:r}=this;JFn(this),r&&(this.trailers=V2.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;JFn(this),this.factory=null,r?(this.res=null,V2.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,V2.destroy(s,e))}};function ZFn(t,e,r){if(r===void 0)return new Promise((n,o)=>{ZFn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new cor(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(ZFn,"stream");XFn.exports=ZFn});var i8n=I((Jff,n8n)=>{"use strict";p();var{Readable:r8n,Duplex:$bs,PassThrough:Vbs}=require("node:stream"),{InvalidArgumentError:r2e,InvalidReturnValueError:Wbs,RequestAbortedError:lor}=Rc(),Jw=Ws(),{AsyncResource:zbs}=require("node:async_hooks"),{addSignal:Ybs,removeSignal:Kbs}=t2e(),t8n=require("node:assert"),Ope=Symbol("resume"),uor=class extends r8n{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Ope]=null}_read(){let{[Ope]:e}=this;e&&(this[Ope]=null,e())}_destroy(e,r){this._read(),r(e)}},dor=class extends r8n{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Ope]=e}_read(){this[Ope]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new lor),r(e)}},por=class extends zbs{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new r2e("invalid opts");if(typeof r!="function")throw new r2e("invalid handler");let{signal:n,method:o,opaque:s,onInfo:c,responseHeaders:l}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new r2e("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new r2e("invalid method");if(c&&typeof c!="function")throw new r2e("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=l||null,this.handler=r,this.abort=null,this.context=null,this.onInfo=c||null,this.req=new uor().on("error",Jw.nop),this.ret=new $bs({readableObjectMode:e.objectMode,autoDestroy:!0,read:a(()=>{let{body:u}=this;u?.resume&&u.resume()},"read"),write:a((u,d,f)=>{let{req:h}=this;h.push(u,d)||h._readableState.destroyed?f():h[Ope]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new lor),A&&u&&A(),Jw.destroy(f,u),Jw.destroy(h,u),Jw.destroy(m,u),Kbs(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,Ybs(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}t8n(!o,"pipeline cannot be retried"),t8n(!n.destroyed),this.abort=e,this.context=r}onHeaders(e,r,n){let{opaque:o,handler:s,context:c}=this;if(e<200){if(this.onInfo){let u=this.responseHeaders==="raw"?Jw.parseRawHeaders(r):Jw.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new dor(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?Jw.parseRawHeaders(r):Jw.parseHeaders(r);l=this.runInAsyncScope(s,null,{statusCode:e,headers:u,opaque:o,body:this.res,context:c})}catch(u){throw this.res.on("error",Jw.nop),u}if(!l||typeof l.on!="function")throw new Wbs("expected Readable");l.on("data",u=>{let{ret:d,body:f}=this;!d.push(u)&&f.pause&&f.pause()}).on("error",u=>{let{ret:d}=this;Jw.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||Jw.destroy(u,new lor)}),this.body=l}onData(e){let{res:r}=this;return r.push(e)}onComplete(e){let{res:r}=this;r.push(null)}onError(e){let{ret:r}=this;this.handler=null,Jw.destroy(r,e)}};function Jbs(t,e){try{let r=new por(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new Vbs().destroy(r)}}a(Jbs,"pipeline");n8n.exports=Jbs});var u8n=I((epf,l8n)=>{"use strict";p();var{InvalidArgumentError:hor,SocketError:Zbs}=Rc(),{AsyncResource:Xbs}=require("node:async_hooks"),o8n=Ws(),{addSignal:eSs,removeSignal:s8n}=t2e(),a8n=require("node:assert"),mor=class extends Xbs{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new hor("invalid opts");if(typeof r!="function")throw new hor("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new hor("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,eSs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}a8n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new Zbs("bad upgrade",null)}onUpgrade(e,r,n){a8n(e===101);let{callback:o,opaque:s,context:c}=this;s8n(this),this.callback=null;let l=this.responseHeaders==="raw"?o8n.parseRawHeaders(r):o8n.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;s8n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function c8n(t,e){if(e===void 0)return new Promise((r,n)=>{c8n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new mor(t,e);this.dispatch({...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"},r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(c8n,"upgrade");l8n.exports=c8n});var m8n=I((npf,h8n)=>{"use strict";p();var tSs=require("node:assert"),{AsyncResource:rSs}=require("node:async_hooks"),{InvalidArgumentError:gor,SocketError:nSs}=Rc(),d8n=Ws(),{addSignal:iSs,removeSignal:f8n}=t2e(),Aor=class extends rSs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new gor("invalid opts");if(typeof r!="function")throw new gor("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new gor("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,iSs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}tSs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new nSs("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;f8n(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?d8n.parseRawHeaders(r):d8n.parseHeaders(r)),this.runInAsyncScope(o,null,null,{statusCode:e,headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;f8n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function p8n(t,e){if(e===void 0)return new Promise((r,n)=>{p8n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Aor(t,e);this.dispatch({...t,method:"CONNECT"},r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(p8n,"connect");h8n.exports=p8n});var g8n=I((spf,Lpe)=>{"use strict";p();Lpe.exports.request=WFn();Lpe.exports.stream=e8n();Lpe.exports.pipeline=i8n();Lpe.exports.upgrade=u8n();Lpe.exports.connect=m8n()});var _or=I((cpf,y8n)=>{"use strict";p();var{UndiciError:oSs}=Rc(),A8n=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),yor=class t extends oSs{static{a(this,"MockNotMatchedError")}constructor(e){super(e),Error.captureStackTrace(this,t),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[A8n]===!0}[A8n]=!0};y8n.exports={MockNotMatchedError:yor}});var Bpe=I((dpf,_8n)=>{"use strict";p();_8n.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected")}});var n2e=I((ppf,k8n)=>{"use strict";p();var{MockNotMatchedError:WZ}=_or(),{kDispatches:lst,kMockAgent:sSs,kOriginalDispatch:aSs,kOrigin:cSs,kGetNetConnect:lSs}=Bpe(),{buildURL:uSs}=Ws(),{STATUS_CODES:dSs}=require("node:http"),{types:{isPromise:fSs}}=require("node:util");function h8(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(h8,"matchValue");function v8n(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(v8n,"lowerCaseEntries");function C8n(t,e){if(Array.isArray(t)){for(let r=0;r"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[r,n]of Object.entries(t.headers)){let o=C8n(e,r);if(!h8(n,o))return!1}return!0}a(b8n,"matchHeaders");function E8n(t){if(typeof t!="string")return t;let e=t.split("?");if(e.length!==2)return t;let r=new URLSearchParams(e.pop());return r.sort(),[...e,r.toString()].join("?")}a(E8n,"safeUrl");function pSs(t,{path:e,method:r,body:n,headers:o}){let s=h8(t.path,e),c=h8(t.method,r),l=typeof t.body<"u"?h8(t.body,n):!0,u=b8n(t,o);return s&&c&&l&&u}a(pSs,"matchKey");function S8n(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(S8n,"getResponseData");function T8n(t,e){let r=e.query?uSs(e.path,e.query):e.path,n=typeof r=="string"?E8n(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>h8(E8n(s),n));if(o.length===0)throw new WZ(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>h8(s,e.method)),o.length===0)throw new WZ(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?h8(s,e.body):!0),o.length===0)throw new WZ(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>b8n(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new WZ(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(T8n,"getMockDispatch");function hSs(t,e,r){let n={timesInvoked:0,times:1,persist:!1,consumed:!1},o=typeof r=="function"?{callback:r}:{...r},s={...n,...e,pending:!0,data:{error:null,...o}};return t.push(s),s}a(hSs,"addMockDispatch");function Eor(t,e){let r=t.findIndex(n=>n.consumed?pSs(n,e):!1);r!==-1&&t.splice(r,1)}a(Eor,"deleteMockDispatch");function I8n(t){let{path:e,method:r,body:n,headers:o,query:s}=t;return{path:e,method:r,body:n,headers:o,query:s}}a(I8n,"buildKey");function vor(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[lst])},d):g(this[lst]);function g(y,_=s){let E=Array.isArray(t.headers)?Cor(t.headers):t.headers,v=typeof _=="function"?_({...t,headers:E}):_;if(fSs(v)){v.then(R=>g(y,R));return}let S=S8n(v),T=vor(c),w=vor(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,x8n(o)),e.onData?.(Buffer.from(S)),e.onComplete?.(w),Eor(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(w8n,"mockDispatch");function gSs(){let t=this[sSs],e=this[cSs],r=this[aSs];return a(function(o,s){if(t.isMockActive)try{w8n.call(this,o,s)}catch(c){if(c instanceof WZ){let l=t[lSs]();if(l===!1)throw new WZ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(R8n(l,e))r.call(this,o,s);else throw new WZ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)`)}else throw c}else r.call(this,o,s)},"dispatch")}a(gSs,"buildMockDispatch");function R8n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>h8(n,r.host)))}a(R8n,"checkNetConnect");function ASs(t){if(t){let{agent:e,...r}=t;return r}}a(ASs,"buildMockOptions");k8n.exports={getResponseData:S8n,getMockDispatch:T8n,addMockDispatch:hSs,deleteMockDispatch:Eor,buildKey:I8n,generateKeyValues:vor,matchValue:h8,getResponse:mSs,getStatusText:x8n,mockDispatch:w8n,buildMockDispatch:gSs,checkNetConnect:R8n,buildMockOptions:ASs,getHeaderByName:C8n,buildHeadersFromArray:Cor}});var Ror=I((gpf,wor)=>{"use strict";p();var{getResponseData:ySs,buildKey:_Ss,addMockDispatch:bor}=n2e(),{kDispatches:ust,kDispatchKey:dst,kDefaultHeaders:Sor,kDefaultTrailers:Tor,kContentLength:Ior,kMockDispatch:fst}=Bpe(),{InvalidArgumentError:X5}=Rc(),{buildURL:ESs}=Ws(),Fpe=class{static{a(this,"MockScope")}constructor(e){this[fst]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new X5("waitInMs must be a valid integer > 0");return this[fst].delay=e,this}persist(){return this[fst].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new X5("repeatTimes must be a valid integer > 0");return this[fst].times=e,this}},xor=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new X5("opts must be an object");if(typeof e.path>"u")throw new X5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=ESs(e.path,e.query);else{let n=new URL(e.path,"data://");e.path=n.pathname+n.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[dst]=_Ss(e),this[ust]=r,this[Sor]={},this[Tor]={},this[Ior]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=ySs(r),s=this[Ior]?{"content-length":o.length}:{},c={...this[Sor],...s,...n.headers},l={...this[Tor],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new X5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new X5("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new X5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=bor(this[ust],this[dst],s);return new Fpe(c)}let r={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(r);let n=this.createMockScopeDispatchData(r),o=bor(this[ust],this[dst],n);return new Fpe(o)}replyWithError(e){if(typeof e>"u")throw new X5("error must be defined");let r=bor(this[ust],this[dst],{error:e});return new Fpe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new X5("headers must be defined");return this[Sor]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new X5("trailers must be defined");return this[Tor]=e,this}replyContentLength(){return this[Ior]=!0,this}};wor.exports.MockInterceptor=xor;wor.exports.MockScope=Fpe});var Dor=I((_pf,B8n)=>{"use strict";p();var{promisify:vSs}=require("node:util"),CSs=xpe(),{buildMockDispatch:bSs}=n2e(),{kDispatches:P8n,kMockAgent:D8n,kClose:N8n,kOriginalClose:M8n,kOrigin:O8n,kOriginalDispatch:SSs,kConnected:kor}=Bpe(),{MockInterceptor:TSs}=Ror(),L8n=ef(),{InvalidArgumentError:ISs}=Rc(),Por=class extends CSs{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new ISs("Argument opts.agent must implement Agent");this[D8n]=r.agent,this[O8n]=e,this[P8n]=[],this[kor]=1,this[SSs]=this.dispatch,this[M8n]=this.close.bind(this),this.dispatch=bSs.call(this),this.close=this[N8n]}get[L8n.kConnected](){return this[kor]}intercept(e){return new TSs(e,this[P8n])}async[N8n](){await vSs(this[M8n])(),this[kor]=0,this[D8n][L8n.kClients].delete(this[O8n])}};B8n.exports=Por});var Oor=I((Cpf,G8n)=>{"use strict";p();var{promisify:xSs}=require("node:util"),wSs=wpe(),{buildMockDispatch:RSs}=n2e(),{kDispatches:F8n,kMockAgent:U8n,kClose:Q8n,kOriginalClose:q8n,kOrigin:j8n,kOriginalDispatch:kSs,kConnected:Nor}=Bpe(),{MockInterceptor:PSs}=Ror(),H8n=ef(),{InvalidArgumentError:DSs}=Rc(),Mor=class extends wSs{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new DSs("Argument opts.agent must implement Agent");this[U8n]=r.agent,this[j8n]=e,this[F8n]=[],this[Nor]=1,this[kSs]=this.dispatch,this[q8n]=this.close.bind(this),this.dispatch=RSs.call(this),this.close=this[Q8n]}get[H8n.kConnected](){return this[Nor]}intercept(e){return new PSs(e,this[F8n])}async[Q8n](){await xSs(this[q8n])(),this[Nor]=0,this[U8n][H8n.kClients].delete(this[j8n])}};G8n.exports=Mor});var V8n=I((Ipf,$8n)=>{"use strict";p();var NSs={pronoun:"it",is:"is",was:"was",this:"this"},MSs={pronoun:"they",is:"are",was:"were",this:"these"};$8n.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?NSs:MSs,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var z8n=I((kpf,W8n)=>{"use strict";p();var{Transform:OSs}=require("node:stream"),{Console:LSs}=require("node:console"),BSs=process.versions.icu?"\u2705":"Y ",FSs=process.versions.icu?"\u274C":"N ";W8n.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new OSs({transform(r,n,o){o(null,r)}}),this.logger=new LSs({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let r=e.map(({method:n,path:o,data:{statusCode:s},persist:c,times:l,timesInvoked:u,origin:d})=>({Method:n,Origin:d,Path:o,"Status code":s,Persistent:c?BSs:FSs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var Z8n=I((Npf,J8n)=>{"use strict";p();var{kClients:zZ}=ef(),USs=Rpe(),{kAgent:Lor,kMockAgentSet:pst,kMockAgentGet:Y8n,kDispatches:Bor,kIsMockActive:hst,kNetConnect:YZ,kGetNetConnect:QSs,kOptions:mst,kFactory:gst}=Bpe(),qSs=Dor(),jSs=Oor(),{matchValue:HSs,buildMockOptions:GSs}=n2e(),{InvalidArgumentError:K8n,UndiciError:$Ss}=Rc(),VSs=IPe(),WSs=V8n(),zSs=z8n(),For=class extends VSs{static{a(this,"MockAgent")}constructor(e){if(super(e),this[YZ]=!0,this[hst]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new K8n("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new USs(e);this[Lor]=r,this[zZ]=r[zZ],this[mst]=GSs(e)}get(e){let r=this[Y8n](e);return r||(r=this[gst](e),this[pst](e,r)),r}dispatch(e,r){return this.get(e.origin),this[Lor].dispatch(e,r)}async close(){await this[Lor].close(),this[zZ].clear()}deactivate(){this[hst]=!1}activate(){this[hst]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[YZ])?this[YZ].push(e):this[YZ]=[e];else if(typeof e>"u")this[YZ]=!0;else throw new K8n("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[YZ]=!1}get isMockActive(){return this[hst]}[pst](e,r){this[zZ].set(e,r)}[gst](e){let r=Object.assign({agent:this},this[mst]);return this[mst]&&this[mst].connections===1?new qSs(e,r):new jSs(e,r)}[Y8n](e){let r=this[zZ].get(e);if(r)return r;if(typeof e!="string"){let n=this[gst]("http://localhost:9999");return this[pst](e,n),n}for(let[n,o]of Array.from(this[zZ]))if(o&&typeof n!="string"&&HSs(n,e)){let s=this[gst](e);return this[pst](e,s),s[Bor]=o[Bor],s}}[QSs](){return this[YZ]}pendingInterceptors(){let e=this[zZ];return Array.from(e.entries()).flatMap(([r,n])=>n[Bor].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new zSs}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new WSs("interceptor","interceptors").pluralize(r.length);throw new $Ss(` +`,"latin1"),r!==null&&o!==r){if(n[Air])throw new QZ;process.emitWarning(new QZ)}e[vp].timeout&&e[vp].timeoutType===Spe&&e[vp].timeout.refresh&&e[vp].timeout.refresh(),n[Xj]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[eH]=!1,e&&(Vi(n[L_]<=1,"pipeline should only contain this request"),o(e))}};d3n.exports=XEs});var E3n=I((Ydf,_3n)=>{"use strict";p();var Yw=require("node:assert"),{pipeline:ovs}=require("node:stream"),_a=Ws(),{RequestContentLengthMismatchError:vir,RequestAbortedError:p3n,SocketError:QPe,InformationalError:Cir}=Rc(),{kUrl:$ot,kReset:Wot,kClient:Tpe,kRunning:zot,kPending:svs,kQueue:tH,kPendingIdx:bir,kRunningIdx:q2,kError:H2,kSocket:U0,kStrictContentLength:avs,kOnError:Sir,kMaxConcurrentStreams:y3n,kHTTP2Session:j2,kResume:rH,kSize:cvs,kHTTPContext:lvs}=tf(),d8=Symbol("open streams"),h3n,m3n=!1,Vot;try{Vot=require("node:http2")}catch{Vot={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:uvs,HTTP2_HEADER_METHOD:dvs,HTTP2_HEADER_PATH:fvs,HTTP2_HEADER_SCHEME:pvs,HTTP2_HEADER_CONTENT_LENGTH:hvs,HTTP2_HEADER_EXPECT:mvs,HTTP2_HEADER_STATUS:gvs}}=Vot;function Avs(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.push(Buffer.from(r),Buffer.from(o));else e.push(Buffer.from(r),Buffer.from(n));return e}a(Avs,"parseH2Headers");async function yvs(t,e){t[U0]=e,m3n||(m3n=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=Vot.connect(t[$ot],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[y3n]});r[d8]=0,r[Tpe]=t,r[U0]=e,_a.addListener(r,"error",Evs),_a.addListener(r,"frameError",vvs),_a.addListener(r,"end",Cvs),_a.addListener(r,"goaway",bvs),_a.addListener(r,"close",function(){let{[Tpe]:o}=this,{[U0]:s}=o,c=this[U0][H2]||this[H2]||new QPe("closed",_a.getSocketInfo(s));if(o[j2]=null,o.destroyed){Yw(o[svs]===0);let l=o[tH].splice(o[q2]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return Tvs(t,...o)},resume(){_vs(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a(yvs,"connectH2");function _vs(t){let e=t[U0];e?.destroyed===!1&&(t[cvs]===0&&t[y3n]===0?(e.unref(),t[j2].unref()):(e.ref(),t[j2].ref()))}a(_vs,"resumeH2");function Evs(t){Yw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[U0][H2]=t,this[Tpe][Sir](t)}a(Evs,"onHttp2SessionError");function vvs(t,e,r){if(r===0){let n=new Cir(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[U0][H2]=n,this[Tpe][Sir](n)}}a(vvs,"onHttp2FrameError");function Cvs(){let t=new QPe("other side closed",_a.getSocketInfo(this[U0]));this.destroy(t),_a.destroy(this[U0],t)}a(Cvs,"onHttp2SessionEnd");function bvs(t){let e=this[H2]||new QPe(`HTTP/2: "GOAWAY" frame received with code ${t}`,_a.getSocketInfo(this)),r=this[Tpe];if(r[U0]=null,r[lvs]=null,this[j2]!=null&&(this[j2].destroy(e),this[j2]=null),_a.destroy(this[U0],e),r[q2]{e.aborted||e.completed||(T=T||new p3n,_a.errorRequest(t,e,T),m!=null&&_a.destroy(m,T),_a.destroy(f,T),t[tH][t[q2]++]=null,t[rH]())},"abort");try{e.onConnect(y)}catch(T){_a.errorRequest(t,e,T)}if(e.aborted)return!1;if(n==="CONNECT")return r.ref(),m=r.request(h,{endStream:!1,signal:u}),m.id&&!m.pending?(e.onUpgrade(null,null,m),++r[d8],t[tH][t[q2]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[d8],t[tH][t[q2]++]=null}),m.once("close",()=>{r[d8]-=1,r[d8]===0&&r.unref()}),!0;h[fvs]=o,h[pvs]="https";let _=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let E=_a.bodyLength(f);if(_a.isFormDataLike(f)){h3n??=vpe().extractBody;let[T,w]=h3n(f);h["content-type"]=w,f=T.stream,E=T.length}if(E==null&&(E=e.contentLength),(E===0||!_)&&(E=null),Svs(n)&&E>0&&e.contentLength!=null&&e.contentLength!==E){if(t[avs])return _a.errorRequest(t,e,new vir),!1;process.emitWarning(new vir)}E!=null&&(Yw(f,"no body must not have content length"),h[hvs]=`${E}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[mvs]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",S)):(m=r.request(h,{endStream:v,signal:u}),S()),++r[d8],m.once("response",T=>{let{[gvs]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new p3n;_a.errorRequest(t,e,x),_a.destroy(m,x);return}e.onHeaders(Number(w),Avs(R),m.resume.bind(m),"")===!1&&m.pause(),m.on("data",x=>{e.onData(x)===!1&&m.pause()})}),m.once("end",()=>{(m.state?.state==null||m.state.state<6)&&e.onComplete([]),r[d8]===0&&r.unref(),y(new Cir("HTTP/2: stream half-closed (remote)")),t[tH][t[q2]++]=null,t[bir]=t[q2],t[rH]()}),m.once("close",()=>{r[d8]-=1,r[d8]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new Cir(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function S(){!f||E===0?g3n(y,m,null,t,e,t[U0],E,_):_a.isBuffer(f)?g3n(y,m,f,t,e,t[U0],E,_):_a.isBlobLike(f)?typeof f.stream=="function"?A3n(y,m,f.stream(),t,e,t[U0],E,_):xvs(y,m,f,t,e,t[U0],E,_):_a.isStream(f)?Ivs(y,t[U0],_,m,f,t,e,E):_a.isIterable(f)?A3n(y,m,f,t,e,t[U0],E,_):Yw(!1)}a(S,"writeBodyH2")}a(Tvs,"writeH2");function g3n(t,e,r,n,o,s,c,l){try{r!=null&&_a.isBuffer(r)&&(Yw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Wot]=!0),o.onRequestSent(),n[rH]()}catch(u){t(u)}}a(g3n,"writeBuffer");function Ivs(t,e,r,n,o,s,c,l){Yw(l!==0||s[zot]===0,"stream body cannot be pipelined");let u=ovs(o,n,f=>{f?(_a.destroy(u,f),t(f)):(_a.removeAllListeners(u),c.onRequestSent(),r||(e[Wot]=!0),s[rH]())});_a.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(Ivs,"writeStream");async function xvs(t,e,r,n,o,s,c,l){Yw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new vir;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Wot]=!0),n[rH]()}catch(u){t(u)}}a(xvs,"writeBlob");async function A3n(t,e,r,n,o,s,c,l){Yw(c!==0||n[zot]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let h=u;u=null,h()}}a(d,"onDrain");let f=a(()=>new Promise((h,m)=>{Yw(u===null),s[H2]?m(s[H2]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[H2])throw s[H2];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Wot]=!0),n[rH]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(A3n,"writeIterable");_3n.exports=yvs});var Kot=I((Zdf,b3n)=>{"use strict";p();var K5=Ws(),{kBodyUsed:qPe}=tf(),Iir=require("node:assert"),{InvalidArgumentError:wvs}=Rc(),Rvs=require("node:events"),kvs=[300,301,302,303,307,308],v3n=Symbol("body"),Yot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[v3n]=e,this[qPe]=!1}async*[Symbol.asyncIterator](){Iir(!this[qPe],"disturbed"),this[qPe]=!0,yield*this[v3n]}},Tir=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new wvs("maxRedirections must be a positive number");K5.validateHandler(o,n.method,n.upgrade),this.dispatch=e,this.location=null,this.abort=null,this.opts={...n,maxRedirections:0},this.maxRedirections=r,this.handler=o,this.history=[],this.redirectionLimitReached=!1,K5.isStream(this.opts.body)?(K5.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Iir(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[qPe]=!1,Rvs.prototype.on.call(this.opts.body,"data",function(){this[qPe]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Yot(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&K5.isIterable(this.opts.body)&&(this.opts.body=new Yot(this.opts.body))}onConnect(e){this.abort=e,this.handler.onConnect(e,{history:this.history})}onUpgrade(e,r,n){this.handler.onUpgrade(e,r,n)}onError(e){this.handler.onError(e)}onHeaders(e,r,n,o){if(this.location=this.history.length>=this.maxRedirections||K5.isDisturbed(this.opts.body)?null:Pvs(e,r),this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections){this.request&&this.request.abort(new Error("max redirects")),this.redirectionLimitReached=!0,this.abort(new Error("max redirects"));return}if(this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return this.handler.onHeaders(e,r,n,o);let{origin:s,pathname:c,search:l}=K5.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=Dvs(this.opts.headers,e===303,this.opts.origin!==s),this.opts.path=u,this.opts.origin=s,this.opts.maxRedirections=0,this.opts.query=null,e===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",this.opts.body=null)}onData(e){if(!this.location)return this.handler.onData(e)}onComplete(e){this.location?(this.location=null,this.abort=null,this.dispatch(this.opts,this)):this.handler.onComplete(e)}onBodySent(e){this.handler.onBodySent&&this.handler.onBodySent(e)}};function Pvs(t,e){if(kvs.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var Nvs=Kot();function Mvs({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new Nvs(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(Mvs,"createRedirectInterceptor");S3n.exports=Mvs});var wpe=I((iff,M3n)=>{"use strict";p();var f8=require("node:assert"),k3n=require("node:net"),Ovs=require("node:http"),qZ=Ws(),{channels:Ipe}=cpe(),Lvs=ULn(),Bvs=fpe(),{InvalidArgumentError:Ah,InformationalError:Fvs,ClientDestroyedError:Uvs}=Rc(),Qvs=wPe(),{kUrl:J5,kServerName:nH,kClient:qvs,kBusy:xir,kConnect:jvs,kResuming:jZ,kRunning:VPe,kPending:WPe,kSize:$Pe,kQueue:G2,kConnected:Hvs,kConnecting:xpe,kNeedDrain:oH,kKeepAliveDefaultTimeout:T3n,kHostHeader:Gvs,kPendingIdx:$2,kRunningIdx:p8,kError:$vs,kPipelining:Zot,kKeepAliveTimeoutValue:Vvs,kMaxHeadersSize:Wvs,kKeepAliveMaxTimeout:zvs,kKeepAliveTimeoutThreshold:Yvs,kHeadersTimeout:Kvs,kBodyTimeout:Jvs,kStrictContentLength:Zvs,kConnector:jPe,kMaxRedirections:Xvs,kMaxRequests:wir,kCounter:eCs,kClose:tCs,kDestroy:rCs,kDispatch:nCs,kInterceptors:I3n,kLocalAddress:HPe,kMaxResponseSize:iCs,kOnError:oCs,kHTTPContext:yh,kMaxConcurrentStreams:sCs,kResume:GPe}=tf(),aCs=f3n(),cCs=E3n(),x3n=!1,iH=Symbol("kClosedResolve"),w3n=a(()=>{},"noop");function P3n(t){return t[Zot]??t[yh]?.defaultPipelining??1}a(P3n,"getPipelining");var Rir=class extends Bvs{static{a(this,"Client")}constructor(e,{interceptors:r,maxHeaderSize:n,headersTimeout:o,socketTimeout:s,requestTimeout:c,connectTimeout:l,bodyTimeout:u,idleTimeout:d,keepAlive:f,keepAliveTimeout:h,maxKeepAliveTimeout:m,keepAliveMaxTimeout:g,keepAliveTimeoutThreshold:A,socketPath:y,pipelining:_,tls:E,strictContentLength:v,maxCachedSessions:S,maxRedirections:T,connect:w,maxRequestsPerClient:R,localAddress:x,maxResponseSize:k,autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N,maxConcurrentStreams:O,allowH2:B}={}){if(super(),f!==void 0)throw new Ah("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new Ah("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new Ah("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new Ah("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new Ah("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new Ah("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new Ah("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new Ah("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new Ah("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new Ah("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new Ah("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new Ah("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new Ah("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new Ah("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new Ah("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new Ah("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||k3n.isIP(x)===0))throw new Ah("localAddress must be valid string IP address");if(k!=null&&(!Number.isInteger(k)||k<-1))throw new Ah("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new Ah("autoSelectFamilyAttemptTimeout must be a positive number");if(B!=null&&typeof B!="boolean")throw new Ah("allowH2 must be a valid boolean value");if(O!=null&&(typeof O!="number"||O<1))throw new Ah("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=Qvs({...E,maxCachedSessions:S,allowH2:B,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[I3n]=r.Client,x3n||(x3n=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[I3n]=[lCs({maxRedirections:T})],this[J5]=qZ.parseOrigin(e),this[jPe]=w,this[Zot]=_??1,this[Wvs]=n||Ovs.maxHeaderSize,this[T3n]=h??4e3,this[zvs]=g??6e5,this[Yvs]=A??2e3,this[Vvs]=this[T3n],this[nH]=null,this[HPe]=x??null,this[jZ]=0,this[oH]=0,this[Gvs]=`host: ${this[J5].hostname}${this[J5].port?`:${this[J5].port}`:""}\r +`,this[Jvs]=u??3e5,this[Kvs]=o??3e5,this[Zvs]=v??!0,this[Xvs]=T,this[wir]=R,this[iH]=null,this[iCs]=k>-1?k:-1,this[sCs]=O??100,this[yh]=null,this[G2]=[],this[p8]=0,this[$2]=0,this[GPe]=q=>kir(this,q),this[oCs]=q=>D3n(this,q)}get pipelining(){return this[Zot]}set pipelining(e){this[Zot]=e,this[GPe](!0)}get[WPe](){return this[G2].length-this[$2]}get[VPe](){return this[$2]-this[p8]}get[$Pe](){return this[G2].length-this[p8]}get[Hvs](){return!!this[yh]&&!this[xpe]&&!this[yh].destroyed}get[xir](){return!!(this[yh]?.busy(null)||this[$Pe]>=(P3n(this)||1)||this[WPe]>0)}[jvs](e){N3n(this),this.once("connect",e)}[nCs](e,r){let n=e.origin||this[J5].origin,o=new Lvs(n,e,r);return this[G2].push(o),this[jZ]||(qZ.bodyLength(o.body)==null&&qZ.isIterable(o.body)?(this[jZ]=1,queueMicrotask(()=>kir(this))):this[GPe](!0)),this[jZ]&&this[oH]!==2&&this[xir]&&(this[oH]=2),this[oH]<2}async[tCs](){return new Promise(e=>{this[$Pe]?this[iH]=e:e(null)})}async[rCs](e){return new Promise(r=>{let n=this[G2].splice(this[$2]);for(let s=0;s{this[iH]&&(this[iH](),this[iH]=null),r(null)},"callback");this[yh]?(this[yh].destroy(e,o),this[yh]=null):queueMicrotask(o),this[GPe]()})}},lCs=Jot();function D3n(t,e){if(t[VPe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){f8(t[$2]===t[p8]);let r=t[G2].splice(t[p8]);for(let n=0;n{t[jPe]({host:e,hostname:r,protocol:n,port:o,servername:t[nH],localAddress:t[HPe]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){qZ.destroy(s.on("error",w3n),new Uvs);return}f8(s);try{t[yh]=s.alpnProtocol==="h2"?await cCs(t,s):await aCs(t,s)}catch(c){throw s.destroy().on("error",w3n),c}t[xpe]=!1,s[eCs]=0,s[wir]=t[wir],s[qvs]=t,s[$vs]=null,Ipe.connected.hasSubscribers&&Ipe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[yh]?.version,servername:t[nH],localAddress:t[HPe]},connector:t[jPe],socket:s}),t.emit("connect",t[J5],[t])}catch(s){if(t.destroyed)return;if(t[xpe]=!1,Ipe.connectError.hasSubscribers&&Ipe.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[yh]?.version,servername:t[nH],localAddress:t[HPe]},connector:t[jPe],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(f8(t[VPe]===0);t[WPe]>0&&t[G2][t[$2]].servername===t[nH];){let c=t[G2][t[$2]++];qZ.errorRequest(t,c,s)}else D3n(t,s);t.emit("connectionError",t[J5],[t],s)}t[GPe]()}a(N3n,"connect");function R3n(t){t[oH]=0,t.emit("drain",t[J5],[t])}a(R3n,"emitDrain");function kir(t,e){t[jZ]!==2&&(t[jZ]=2,uCs(t,e),t[jZ]=0,t[p8]>256&&(t[G2].splice(0,t[p8]),t[$2]-=t[p8],t[p8]=0))}a(kir,"resume");function uCs(t,e){for(;;){if(t.destroyed){f8(t[WPe]===0);return}if(t[iH]&&!t[$Pe]){t[iH](),t[iH]=null;return}if(t[yh]&&t[yh].resume(),t[xir])t[oH]=2;else if(t[oH]===2){e?(t[oH]=1,queueMicrotask(()=>R3n(t))):R3n(t);continue}if(t[WPe]===0||t[VPe]>=(P3n(t)||1))return;let r=t[G2][t[$2]];if(t[J5].protocol==="https:"&&t[nH]!==r.servername){if(t[VPe]>0)return;t[nH]=r.servername,t[yh]?.destroy(new Fvs("servername changed"),()=>{t[yh]=null,kir(t)})}if(t[xpe])return;if(!t[yh]){N3n(t);return}if(t[yh].destroyed||t[yh].busy(r))return;!r.aborted&&t[yh].write(r)?t[$2]++:t[G2].splice(t[$2],1)}}a(uCs,"_resume");M3n.exports=Rir});var Pir=I((cff,O3n)=>{"use strict";p();var Xot=class{static{a(this,"FixedCircularBuffer")}constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};O3n.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Xot}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Xot),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var B3n=I((dff,L3n)=>{p();var{kFree:dCs,kConnected:fCs,kPending:pCs,kQueued:hCs,kRunning:mCs,kSize:gCs}=tf(),HZ=Symbol("pool"),Dir=class{static{a(this,"PoolStats")}constructor(e){this[HZ]=e}get connected(){return this[HZ][fCs]}get free(){return this[HZ][dCs]}get pending(){return this[HZ][pCs]}get queued(){return this[HZ][hCs]}get running(){return this[HZ][mCs]}get size(){return this[HZ][gCs]}};L3n.exports=Dir});var Fir=I((hff,W3n)=>{"use strict";p();var ACs=fpe(),yCs=Pir(),{kConnected:Nir,kSize:F3n,kRunning:U3n,kPending:Q3n,kQueued:zPe,kBusy:_Cs,kFree:ECs,kUrl:vCs,kClose:CCs,kDestroy:bCs,kDispatch:SCs}=tf(),TCs=B3n(),Rb=Symbol("clients"),Sv=Symbol("needDrain"),YPe=Symbol("queue"),Mir=Symbol("closed resolve"),Oir=Symbol("onDrain"),q3n=Symbol("onConnect"),j3n=Symbol("onDisconnect"),H3n=Symbol("onConnectionError"),Lir=Symbol("get dispatcher"),$3n=Symbol("add client"),V3n=Symbol("remove client"),G3n=Symbol("stats"),Bir=class extends ACs{static{a(this,"PoolBase")}constructor(){super(),this[YPe]=new yCs,this[Rb]=[],this[zPe]=0;let e=this;this[Oir]=a(function(n,o){let s=e[YPe],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[zPe]--,c=!this.dispatch(l.opts,l.handler)}this[Sv]=c,!this[Sv]&&e[Sv]&&(e[Sv]=!1,e.emit("drain",n,[e,...o])),e[Mir]&&s.isEmpty()&&Promise.all(e[Rb].map(l=>l.close())).then(e[Mir])},"onDrain"),this[q3n]=(r,n)=>{e.emit("connect",r,[e,...n])},this[j3n]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[H3n]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[G3n]=new TCs(this)}get[_Cs](){return this[Sv]}get[Nir](){return this[Rb].filter(e=>e[Nir]).length}get[ECs](){return this[Rb].filter(e=>e[Nir]&&!e[Sv]).length}get[Q3n](){let e=this[zPe];for(let{[Q3n]:r}of this[Rb])e+=r;return e}get[U3n](){let e=0;for(let{[U3n]:r}of this[Rb])e+=r;return e}get[F3n](){let e=this[zPe];for(let{[F3n]:r}of this[Rb])e+=r;return e}get stats(){return this[G3n]}async[CCs](){this[YPe].isEmpty()?await Promise.all(this[Rb].map(e=>e.close())):await new Promise(e=>{this[Mir]=e})}async[bCs](e){for(;;){let r=this[YPe].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[Rb].map(r=>r.destroy(e)))}[SCs](e,r){let n=this[Lir]();return n?n.dispatch(e,r)||(n[Sv]=!0,this[Sv]=!this[Lir]()):(this[Sv]=!0,this[YPe].push({opts:e,handler:r}),this[zPe]++),!this[Sv]}[$3n](e){return e.on("drain",this[Oir]).on("connect",this[q3n]).on("disconnect",this[j3n]).on("connectionError",this[H3n]),this[Rb].push(e),this[Sv]&&queueMicrotask(()=>{this[Sv]&&this[Oir](e[vCs],[this,e])}),this}[V3n](e){e.close(()=>{let r=this[Rb].indexOf(e);r!==-1&&this[Rb].splice(r,1)}),this[Sv]=this[Rb].some(r=>!r[Sv]&&r.closed!==!0&&r.destroyed!==!0)}};W3n.exports={PoolBase:Bir,kClients:Rb,kNeedDrain:Sv,kAddClient:$3n,kRemoveClient:V3n,kGetDispatcher:Lir}});var Rpe=I((Aff,J3n)=>{"use strict";p();var{PoolBase:ICs,kClients:est,kNeedDrain:xCs,kAddClient:wCs,kGetDispatcher:RCs}=Fir(),kCs=wpe(),{InvalidArgumentError:Uir}=Rc(),z3n=Ws(),{kUrl:Y3n,kInterceptors:PCs}=tf(),DCs=wPe(),Qir=Symbol("options"),qir=Symbol("connections"),K3n=Symbol("factory");function NCs(t,e){return new kCs(t,e)}a(NCs,"defaultFactory");var jir=class extends ICs{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=NCs,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,...m}={}){if(super(),r!=null&&(!Number.isFinite(r)||r<0))throw new Uir("invalid connections");if(typeof n!="function")throw new Uir("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new Uir("connect must be a function or an object");typeof o!="function"&&(o=DCs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[PCs]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[qir]=r||null,this[Y3n]=z3n.parseOrigin(e),this[Qir]={...z3n.deepClone(m),connect:o,allowH2:h},this[Qir].interceptors=m.interceptors?{...m.interceptors}:void 0,this[K3n]=n,this.on("connectionError",(g,A,y)=>{for(let _ of A){let E=this[est].indexOf(_);E!==-1&&this[est].splice(E,1)}})}[RCs](){for(let e of this[est])if(!e[xCs])return e;if(!this[qir]||this[est].length{"use strict";p();var{BalancedPoolMissingUpstreamError:MCs,InvalidArgumentError:OCs}=Rc(),{PoolBase:LCs,kClients:B_,kNeedDrain:KPe,kAddClient:BCs,kRemoveClient:FCs,kGetDispatcher:UCs}=Fir(),QCs=Rpe(),{kUrl:Hir,kInterceptors:qCs}=tf(),{parseOrigin:Z3n}=Ws(),X3n=Symbol("factory"),tst=Symbol("options"),eFn=Symbol("kGreatestCommonDivisor"),GZ=Symbol("kCurrentWeight"),$Z=Symbol("kIndex"),Kw=Symbol("kWeight"),rst=Symbol("kMaxWeightPerServer"),nst=Symbol("kErrorPenalty");function jCs(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(jCs,"getGreatestCommonDivisor");function HCs(t,e){return new QCs(t,e)}a(HCs,"defaultFactory");var Gir=class extends LCs{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=HCs,...n}={}){if(super(),this[tst]=n,this[$Z]=-1,this[GZ]=0,this[rst]=this[tst].maxWeightPerServer||100,this[nst]=this[tst].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new OCs("factory must be a function.");this[qCs]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[X3n]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=Z3n(e).origin;if(this[B_].find(o=>o[Hir].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[X3n](r,Object.assign({},this[tst]));this[BCs](n),n.on("connect",()=>{n[Kw]=Math.min(this[rst],n[Kw]+this[nst])}),n.on("connectionError",()=>{n[Kw]=Math.max(1,n[Kw]-this[nst]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Kw]=Math.max(1,n[Kw]-this[nst]),this._updateBalancedPoolStats())});for(let o of this[B_])o[Kw]=this[rst];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Hir].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[FCs](n),this}get upstreams(){return this[B_].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Hir].origin)}[UCs](){if(this[B_].length===0)throw new MCs;if(!this[B_].find(s=>!s[KPe]&&s.closed!==!0&&s.destroyed!==!0)||this[B_].map(s=>s[KPe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[B_].findIndex(s=>!s[KPe]);for(;n++this[B_][o][Kw]&&!s[KPe]&&(o=this[$Z]),this[$Z]===0&&(this[GZ]=this[GZ]-this[eFn],this[GZ]<=0&&(this[GZ]=this[rst])),s[Kw]>=this[GZ]&&!s[KPe])return s}return this[GZ]=this[B_][o][Kw],this[$Z]=o,this[B_][o]}};tFn.exports=Gir});var kpe=I((bff,lFn)=>{"use strict";p();var{InvalidArgumentError:ist}=Rc(),{kClients:sH,kRunning:nFn,kClose:GCs,kDestroy:$Cs,kDispatch:VCs,kInterceptors:WCs}=tf(),zCs=fpe(),YCs=Rpe(),KCs=wpe(),JCs=Ws(),ZCs=Jot(),iFn=Symbol("onConnect"),oFn=Symbol("onDisconnect"),sFn=Symbol("onConnectionError"),XCs=Symbol("maxRedirections"),aFn=Symbol("onDrain"),cFn=Symbol("factory"),$ir=Symbol("options");function ebs(t,e){return e&&e.connections===1?new KCs(t,e):new YCs(t,e)}a(ebs,"defaultFactory");var Vir=class extends zCs{static{a(this,"Agent")}constructor({factory:e=ebs,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new ist("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new ist("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new ist("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[WCs]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[ZCs({maxRedirections:r})],this[$ir]={...JCs.deepClone(o),connect:n},this[$ir].interceptors=o.interceptors?{...o.interceptors}:void 0,this[XCs]=r,this[cFn]=e,this[sH]=new Map,this[aFn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[iFn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[oFn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[sFn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[nFn](){let e=0;for(let r of this[sH].values())e+=r[nFn];return e}[VCs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new ist("opts.origin must be a non-empty string or URL.");let o=this[sH].get(n);return o||(o=this[cFn](e.origin,this[$ir]).on("drain",this[aFn]).on("connect",this[iFn]).on("disconnect",this[oFn]).on("connectionError",this[sFn]),this[sH].set(n,o)),o.dispatch(e,r)}async[GCs](){let e=[];for(let r of this[sH].values())e.push(r.close());this[sH].clear(),await Promise.all(e)}async[$Cs](e){let r=[];for(let n of this[sH].values())r.push(n.destroy(e));this[sH].clear(),await Promise.all(r)}};lFn.exports=Vir});var Jir=I((Iff,EFn)=>{"use strict";p();var{kProxy:Wir,kClose:mFn,kDestroy:gFn,kDispatch:uFn,kInterceptors:tbs}=tf(),{URL:VZ}=require("node:url"),rbs=kpe(),AFn=Rpe(),yFn=fpe(),{InvalidArgumentError:Ppe,RequestAbortedError:nbs,SecureProxyConnectionError:ibs}=Rc(),dFn=wPe(),_Fn=wpe(),ost=Symbol("proxy agent"),sst=Symbol("proxy client"),aH=Symbol("proxy headers"),zir=Symbol("request tls settings"),fFn=Symbol("proxy tls settings"),pFn=Symbol("connect endpoint function"),hFn=Symbol("tunnel proxy");function obs(t){return t==="https:"?443:80}a(obs,"defaultProtocolPort");function sbs(t,e){return new AFn(t,e)}a(sbs,"defaultFactory");var abs=a(()=>{},"noop");function cbs(t,e){return e.connections===1?new _Fn(t,e):new AFn(t,e)}a(cbs,"defaultAgentFactory");var Yir=class extends yFn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new Ppe("Proxy URL is mandatory");this[aH]=r,o?this.#e=o(e,{connect:n}):this.#e=new _Fn(e,{connect:n})}[uFn](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new Ppe("Proxy Authentication Required (407)"));return}n&&n.call(this,l,u,d)};let{origin:o,path:s="/",headers:c={}}=e;if(e.path=o+s,!("host"in c)&&!("Host"in c)){let{host:l}=new VZ(o);c.host=l}return e.headers={...this[aH],...c},this.#e[uFn](e,r)}async[mFn](){return this.#e.close()}async[gFn](e){return this.#e.destroy(e)}},Kir=class extends yFn{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof VZ)&&!e.uri)throw new Ppe("Proxy uri is mandatory");let{clientFactory:r=sbs}=e;if(typeof r!="function")throw new Ppe("Proxy opts.clientFactory must be a function.");let{proxyTunnel:n=!0}=e,o=this.#e(e),{href:s,origin:c,port:l,protocol:u,username:d,password:f,hostname:h}=o;if(this[Wir]={uri:s,protocol:u},this[tbs]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[zir]=e.requestTls,this[fFn]=e.proxyTls,this[aH]=e.headers||{},this[hFn]=n,e.auth&&e.token)throw new Ppe("opts.auth cannot be used in combination with opts.token");e.auth?this[aH]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[aH]["proxy-authorization"]=e.token:d&&f&&(this[aH]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=dFn({...e.proxyTls});this[pFn]=dFn({...e.requestTls});let g=e.factory||cbs,A=a((y,_)=>{let{protocol:E}=new VZ(y);return!this[hFn]&&E==="http:"&&this[Wir].protocol==="http:"?new Yir(this[Wir].uri,{headers:this[aH],connect:m,factory:g}):g(y,_)},"factory");this[sst]=r(o,{connect:m}),this[ost]=new rbs({...e,factory:A,connect:a(async(y,_)=>{let E=y.host;y.port||(E+=`:${obs(y.protocol)}`);try{let{socket:v,statusCode:S}=await this[sst].connect({origin:c,port:l,path:E,signal:y.signal,headers:{...this[aH],host:y.host},servername:this[fFn]?.servername||h});if(S!==200&&(v.on("error",abs).destroy(),_(new nbs(`Proxy response (${S}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){_(null,v);return}let T;this[zir]?T=this[zir].servername:T=y.servername,this[pFn]({...y,servername:T,httpSocket:v},_)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?_(new ibs(v)):_(v)}},"connect")})}dispatch(e,r){let n=lbs(e.headers);if(ubs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new VZ(e.origin);n.host=o}return this[ost].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new VZ(e):e instanceof VZ?e:new VZ(e.uri)}async[mFn](){await this[ost].close(),await this[sst].close()}async[gFn](){await this[ost].destroy(),await this[sst].destroy()}};function lbs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new Ppe("Proxy-Authorization should be sent in ProxyAgent constructor")}a(ubs,"throwIfProxyAuthIsSent");EFn.exports=Kir});var IFn=I((Rff,TFn)=>{"use strict";p();var dbs=fpe(),{kClose:fbs,kDestroy:pbs,kClosed:vFn,kDestroyed:CFn,kDispatch:hbs,kNoProxyAgent:JPe,kHttpProxyAgent:cH,kHttpsProxyAgent:WZ}=tf(),bFn=Jir(),mbs=kpe(),gbs={"http:":80,"https:":443},SFn=!1,Zir=class extends dbs{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,SFn||(SFn=!0,process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.",{code:"UNDICI-EHPA"}));let{httpProxy:r,httpsProxy:n,noProxy:o,...s}=e;this[JPe]=new mbs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[cH]=new bFn({...s,uri:c}):this[cH]=this[JPe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[WZ]=new bFn({...s,uri:l}):this[WZ]=this[cH],this.#o()}[hbs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[fbs](){await this[JPe].close(),this[cH][vFn]||await this[cH].close(),this[WZ][vFn]||await this[WZ].close()}async[pbs](e){await this[JPe].destroy(e),this[cH][CFn]||await this[cH].destroy(e),this[WZ][CFn]||await this[WZ].destroy(e)}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||gbs[r]||0,this.#i(n,o)?r==="https:"?this[WZ]:this[cH]:this[JPe]}#i(e,r){if(this.#s&&this.#o(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let n=0;n{"use strict";p();var Dpe=require("node:assert"),{kRetryHandlerDefaultRetry:xFn}=tf(),{RequestRetryError:ZPe}=Rc(),{isDisturbed:wFn,parseHeaders:Abs,parseRangeHeader:RFn,wrapRequestBody:ybs}=Ws();function _bs(t){let e=Date.now();return new Date(t).getTime()-e}a(_bs,"calculateRetryAfterHeader");var Xir=class t{static{a(this,"RetryHandler")}constructor(e,r){let{retryOptions:n,...o}=e,{retry:s,maxRetries:c,maxTimeout:l,minTimeout:u,timeoutFactor:d,methods:f,errorCodes:h,retryAfter:m,statusCodes:g}=n??{};this.dispatch=r.dispatch,this.handler=r.handler,this.opts={...o,body:ybs(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[xFn],retryAfter:m??!0,maxTimeout:l??30*1e3,minTimeout:u??500,timeoutFactor:d??2,maxRetries:c??5,methods:f??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:g??[500,502,503,504,429],errorCodes:h??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(A=>{this.aborted=!0,this.abort?this.abort(A):this.reason=A})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(e,r,n){this.handler.onUpgrade&&this.handler.onUpgrade(e,r,n)}onConnect(e){this.aborted?e(this.reason):this.abort=e}onBodySent(e){if(this.handler.onBodySent)return this.handler.onBodySent(e)}static[xFn](e,{state:r,opts:n},o){let{statusCode:s,code:c,headers:l}=e,{method:u,retryOptions:d}=n,{maxRetries:f,minTimeout:h,maxTimeout:m,timeoutFactor:g,statusCodes:A,errorCodes:y,methods:_}=d,{counter:E}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(_)&&!_.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(E>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?_bs(v):v*1e3);let S=v>0?Math.min(v,m):Math.min(h*g**(E-1),m);setTimeout(()=>o(null),S)}onHeaders(e,r,n,o){let s=Abs(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new ZPe("Request failed",e,{headers:s,data:{count:this.retryCount}})),!1);if(this.resume!=null){if(this.resume=null,e!==206&&(this.start>0||e!==200))return this.abort(new ZPe("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=RFn(s["content-range"]);if(!l)return this.abort(new ZPe("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new ZPe("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return Dpe(this.start===u,"content-range mismatch"),Dpe(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=RFn(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;Dpe(u!=null&&Number.isFinite(u),"content-range mismatch"),Dpe(f!=null&&Number.isFinite(f),"invalid content-length"),this.start=u,this.end=f}if(this.end==null){let l=s["content-length"];this.end=l!=null?Number(l)-1:null}return Dpe(Number.isFinite(this.start)),Dpe(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=n,this.etag=s.etag!=null?s.etag:null,this.etag!=null&&this.etag.startsWith("W/")&&(this.etag=null),this.handler.onHeaders(e,r,n,o)}let c=new ZPe("Request failed",e,{headers:s,data:{count:this.retryCount}});return this.abort(c),!1}onData(e){return this.start+=e.length,this.handler.onData(e)}onComplete(e){return this.retryCount=0,this.handler.onComplete(e)}onError(e){if(this.aborted||wFn(this.opts.body))return this.handler.onError(e);this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(e,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},r.bind(this));function r(n){if(n!=null||this.aborted||wFn(this.opts.body))return this.handler.onError(n);if(this.start!==0){let o={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(o["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...o}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(o){this.handler.onError(o)}}a(r,"onRetry")}};kFn.exports=Xir});var DFn=I((Off,PFn)=>{"use strict";p();var Ebs=IPe(),vbs=ast(),eor=class extends Ebs{static{a(this,"RetryAgent")}#e=null;#t=null;constructor(e,r={}){super(r),this.#e=e,this.#t=r}dispatch(e,r){let n=new vbs({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:r});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};PFn.exports=eor});var sor=I((Fff,qFn)=>{"use strict";p();var BFn=require("node:assert"),{Readable:Cbs}=require("node:stream"),{RequestAbortedError:FFn,NotSupportedError:bbs,InvalidArgumentError:Sbs,AbortError:tor}=Rc(),UFn=Ws(),{ReadableStreamFrom:Tbs}=Ws(),MT=Symbol("kConsume"),XPe=Symbol("kReading"),lH=Symbol("kBody"),NFn=Symbol("kAbort"),QFn=Symbol("kContentType"),MFn=Symbol("kContentLength"),Ibs=a(()=>{},"noop"),ror=class extends Cbs{static{a(this,"BodyReadable")}constructor({resume:e,abort:r,contentType:n="",contentLength:o,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[NFn]=r,this[MT]=null,this[lH]=null,this[QFn]=n,this[MFn]=o,this[XPe]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new FFn),e&&this[NFn](),super.destroy(e)}_destroy(e,r){this[XPe]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[XPe]=!0),super.on(e,...r)}addListener(e,...r){return this.on(e,...r)}off(e,...r){let n=super.off(e,...r);return(e==="data"||e==="readable")&&(this[XPe]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[MT]&&e!==null?(ior(this[MT],e),this[XPe]?super.push(e):!0):super.push(e)}async text(){return e2e(this,"text")}async json(){return e2e(this,"json")}async blob(){return e2e(this,"blob")}async bytes(){return e2e(this,"bytes")}async arrayBuffer(){return e2e(this,"arrayBuffer")}async formData(){throw new bbs}get bodyUsed(){return UFn.isDisturbed(this)}get body(){return this[lH]||(this[lH]=Tbs(this),this[MT]&&(this[lH].getReader(),BFn(this[lH].locked))),this[lH]}async dump(e){let r=Number.isFinite(e?.limit)?e.limit:131072,n=e?.signal;if(n!=null&&(typeof n!="object"||!("aborted"in n)))throw new Sbs("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[MFn]>r&&this.destroy(new tor);let c=a(()=>{this.destroy(n.reason??new tor)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new tor):o(null)}).on("error",Ibs).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function xbs(t){return t[lH]&&t[lH].locked===!0||t[MT]}a(xbs,"isLocked");function wbs(t){return UFn.isDisturbed(t)||xbs(t)}a(wbs,"isUnusable");async function e2e(t,e){return BFn(!t[MT]),new Promise((r,n)=>{if(wbs(t)){let o=t._readableState;o.destroyed&&o.closeEmitted===!1?t.on("error",s=>{n(s)}).on("close",()=>{n(new TypeError("unusable"))}):n(o.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[MT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){oor(this[MT],o)}).on("close",function(){this[MT].body!==null&&oor(this[MT],new FFn)}),Rbs(t[MT])})})}a(e2e,"consume");function Rbs(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,n=e.buffer.length;for(let o=r;o2&&r[0]===239&&r[1]===187&&r[2]===191?3:0;return r.utf8Slice(o,n)}a(nor,"chunksDecode");function OFn(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let r=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),n=0;for(let o=0;o{p();var kbs=require("node:assert"),{ResponseStatusCodeError:jFn}=Rc(),{chunksDecode:HFn}=sor(),Pbs=128*1024;async function Dbs({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){kbs(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>Pbs){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new jFn(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{GFn(r)?f=JSON.parse(HFn(c,l)):$Fn(r)&&(f=HFn(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new jFn(u,n,s,f)))}a(Dbs,"getResolveErrorBodyCallback");var GFn=a(t=>t.length>15&&t[11]==="/"&&t[0]==="a"&&t[1]==="p"&&t[2]==="p"&&t[3]==="l"&&t[4]==="i"&&t[5]==="c"&&t[6]==="a"&&t[7]==="t"&&t[8]==="i"&&t[9]==="o"&&t[10]==="n"&&t[12]==="j"&&t[13]==="s"&&t[14]==="o"&&t[15]==="n","isContentTypeApplicationJson"),$Fn=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");VFn.exports={getResolveErrorBodyCallback:Dbs,isContentTypeApplicationJson:GFn,isContentTypeText:$Fn}});var YFn=I((Gff,cor)=>{"use strict";p();var Nbs=require("node:assert"),{Readable:Mbs}=sor(),{InvalidArgumentError:Npe,RequestAbortedError:WFn}=Rc(),OT=Ws(),{getResolveErrorBodyCallback:Obs}=aor(),{AsyncResource:Lbs}=require("node:async_hooks"),cst=class extends Lbs{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Npe("invalid opts");let{signal:n,method:o,opaque:s,body:c,onInfo:l,responseHeaders:u,throwOnError:d,highWaterMark:f}=e;try{if(typeof r!="function")throw new Npe("invalid callback");if(f&&(typeof f!="number"||f<0))throw new Npe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Npe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Npe("invalid method");if(l&&typeof l!="function")throw new Npe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw OT.isStream(c)&&OT.destroy(c.on("error",OT.nop),h),h}this.method=o,this.responseHeaders=u||null,this.opaque=s||null,this.callback=r,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.throwOnError=d,this.highWaterMark=f,this.signal=n,this.reason=null,this.removeAbortListener=null,OT.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new WFn:this.removeAbortListener=OT.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new WFn,this.res?OT.destroy(this.res.on("error",OT.nop),this.reason):this.abort&&this.abort(this.reason),this.removeAbortListener&&(this.res?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}))}onConnect(e,r){if(this.reason){e(this.reason);return}Nbs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{callback:s,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,h=d==="raw"?OT.parseRawHeaders(r):OT.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?OT.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new Mbs({resume:n,abort:l,contentType:g,contentLength:this.method!=="HEAD"&&A?Number(A):null,highWaterMark:f});this.removeAbortListener&&y.on("close",this.removeAbortListener),this.callback=null,this.res=y,s!==null&&(this.throwOnError&&e>=400?this.runInAsyncScope(Obs,null,{callback:s,body:y,contentType:g,statusCode:e,statusMessage:o,headers:h}):this.runInAsyncScope(s,null,null,{statusCode:e,headers:h,trailers:this.trailers,opaque:c,body:y,context:u}))}onData(e){return this.res.push(e)}onComplete(e){OT.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:r,callback:n,body:o,opaque:s}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:s})})),r&&(this.res=null,queueMicrotask(()=>{OT.destroy(r,e)})),o&&(this.body=null,OT.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function zFn(t,e){if(e===void 0)return new Promise((r,n)=>{zFn.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new cst(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(zFn,"request");cor.exports=zFn;cor.exports.RequestHandler=cst});var t2e=I((Wff,ZFn)=>{p();var{addAbortListener:Bbs}=Ws(),{RequestAbortedError:Fbs}=Rc(),Mpe=Symbol("kListener"),Z5=Symbol("kSignal");function KFn(t){t.abort?t.abort(t[Z5]?.reason):t.reason=t[Z5]?.reason??new Fbs,JFn(t)}a(KFn,"abort");function Ubs(t,e){if(t.reason=null,t[Z5]=null,t[Mpe]=null,!!e){if(e.aborted){KFn(t);return}t[Z5]=e,t[Mpe]=()=>{KFn(t)},Bbs(t[Z5],t[Mpe])}}a(Ubs,"addSignal");function JFn(t){t[Z5]&&("removeEventListener"in t[Z5]?t[Z5].removeEventListener("abort",t[Mpe]):t[Z5].removeListener("abort",t[Mpe]),t[Z5]=null,t[Mpe]=null)}a(JFn,"removeSignal");ZFn.exports={addSignal:Ubs,removeSignal:JFn}});var r8n=I((Kff,t8n)=>{"use strict";p();var Qbs=require("node:assert"),{finished:qbs,PassThrough:jbs}=require("node:stream"),{InvalidArgumentError:Ope,InvalidReturnValueError:Hbs}=Rc(),V2=Ws(),{getResolveErrorBodyCallback:Gbs}=aor(),{AsyncResource:$bs}=require("node:async_hooks"),{addSignal:Vbs,removeSignal:XFn}=t2e(),lor=class extends $bs{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new Ope("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d,throwOnError:f}=e;try{if(typeof n!="function")throw new Ope("invalid callback");if(typeof r!="function")throw new Ope("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new Ope("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Ope("invalid method");if(u&&typeof u!="function")throw new Ope("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw V2.isStream(l)&&V2.destroy(l.on("error",V2.nop),h),h}this.responseHeaders=d||null,this.opaque=c||null,this.factory=r,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=l,this.onInfo=u||null,this.throwOnError=f||!1,V2.isStream(l)&&l.on("error",h=>{this.onError(h)}),Vbs(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}Qbs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{factory:s,opaque:c,context:l,callback:u,responseHeaders:d}=this,f=d==="raw"?V2.parseRawHeaders(r):V2.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:f});return}this.factory=null;let h;if(this.throwOnError&&e>=400){let A=(d==="raw"?V2.parseHeaders(r):f)["content-type"];h=new jbs,this.callback=null,this.runInAsyncScope(Gbs,null,{callback:u,body:h,contentType:A,statusCode:e,statusMessage:o,headers:f})}else{if(s===null)return;if(h=this.runInAsyncScope(s,null,{statusCode:e,headers:f,opaque:c,context:l}),!h||typeof h.write!="function"||typeof h.end!="function"||typeof h.on!="function")throw new Hbs("expected Writable");qbs(h,{readable:!1},g=>{let{callback:A,res:y,opaque:_,trailers:E,abort:v}=this;this.res=null,(g||!y.readable)&&V2.destroy(y,g),this.callback=null,this.runInAsyncScope(A,null,g||null,{opaque:_,trailers:E}),g&&v()})}return h.on("drain",n),this.res=h,(h.writableNeedDrain!==void 0?h.writableNeedDrain:h._writableState?.needDrain)!==!0}onData(e){let{res:r}=this;return r?r.write(e):!0}onComplete(e){let{res:r}=this;XFn(this),r&&(this.trailers=V2.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;XFn(this),this.factory=null,r?(this.res=null,V2.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,V2.destroy(s,e))}};function e8n(t,e,r){if(r===void 0)return new Promise((n,o)=>{e8n.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new lor(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(e8n,"stream");t8n.exports=e8n});var s8n=I((Xff,o8n)=>{"use strict";p();var{Readable:i8n,Duplex:Wbs,PassThrough:zbs}=require("node:stream"),{InvalidArgumentError:r2e,InvalidReturnValueError:Ybs,RequestAbortedError:uor}=Rc(),Jw=Ws(),{AsyncResource:Kbs}=require("node:async_hooks"),{addSignal:Jbs,removeSignal:Zbs}=t2e(),n8n=require("node:assert"),Lpe=Symbol("resume"),dor=class extends i8n{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Lpe]=null}_read(){let{[Lpe]:e}=this;e&&(this[Lpe]=null,e())}_destroy(e,r){this._read(),r(e)}},por=class extends i8n{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Lpe]=e}_read(){this[Lpe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new uor),r(e)}},hor=class extends Kbs{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new r2e("invalid opts");if(typeof r!="function")throw new r2e("invalid handler");let{signal:n,method:o,opaque:s,onInfo:c,responseHeaders:l}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new r2e("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new r2e("invalid method");if(c&&typeof c!="function")throw new r2e("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=l||null,this.handler=r,this.abort=null,this.context=null,this.onInfo=c||null,this.req=new dor().on("error",Jw.nop),this.ret=new Wbs({readableObjectMode:e.objectMode,autoDestroy:!0,read:a(()=>{let{body:u}=this;u?.resume&&u.resume()},"read"),write:a((u,d,f)=>{let{req:h}=this;h.push(u,d)||h._readableState.destroyed?f():h[Lpe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new uor),A&&u&&A(),Jw.destroy(f,u),Jw.destroy(h,u),Jw.destroy(m,u),Zbs(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,Jbs(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}n8n(!o,"pipeline cannot be retried"),n8n(!n.destroyed),this.abort=e,this.context=r}onHeaders(e,r,n){let{opaque:o,handler:s,context:c}=this;if(e<200){if(this.onInfo){let u=this.responseHeaders==="raw"?Jw.parseRawHeaders(r):Jw.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new por(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?Jw.parseRawHeaders(r):Jw.parseHeaders(r);l=this.runInAsyncScope(s,null,{statusCode:e,headers:u,opaque:o,body:this.res,context:c})}catch(u){throw this.res.on("error",Jw.nop),u}if(!l||typeof l.on!="function")throw new Ybs("expected Readable");l.on("data",u=>{let{ret:d,body:f}=this;!d.push(u)&&f.pause&&f.pause()}).on("error",u=>{let{ret:d}=this;Jw.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||Jw.destroy(u,new uor)}),this.body=l}onData(e){let{res:r}=this;return r.push(e)}onComplete(e){let{res:r}=this;r.push(null)}onError(e){let{ret:r}=this;this.handler=null,Jw.destroy(r,e)}};function Xbs(t,e){try{let r=new hor(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new zbs().destroy(r)}}a(Xbs,"pipeline");o8n.exports=Xbs});var f8n=I((rpf,d8n)=>{"use strict";p();var{InvalidArgumentError:mor,SocketError:eSs}=Rc(),{AsyncResource:tSs}=require("node:async_hooks"),a8n=Ws(),{addSignal:rSs,removeSignal:c8n}=t2e(),l8n=require("node:assert"),gor=class extends tSs{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new mor("invalid opts");if(typeof r!="function")throw new mor("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new mor("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,rSs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}l8n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new eSs("bad upgrade",null)}onUpgrade(e,r,n){l8n(e===101);let{callback:o,opaque:s,context:c}=this;c8n(this),this.callback=null;let l=this.responseHeaders==="raw"?a8n.parseRawHeaders(r):a8n.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;c8n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function u8n(t,e){if(e===void 0)return new Promise((r,n)=>{u8n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new gor(t,e);this.dispatch({...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"},r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(u8n,"upgrade");d8n.exports=u8n});var A8n=I((opf,g8n)=>{"use strict";p();var nSs=require("node:assert"),{AsyncResource:iSs}=require("node:async_hooks"),{InvalidArgumentError:Aor,SocketError:oSs}=Rc(),p8n=Ws(),{addSignal:sSs,removeSignal:h8n}=t2e(),yor=class extends iSs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Aor("invalid opts");if(typeof r!="function")throw new Aor("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Aor("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,sSs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}nSs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new oSs("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;h8n(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?p8n.parseRawHeaders(r):p8n.parseHeaders(r)),this.runInAsyncScope(o,null,null,{statusCode:e,headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;h8n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function m8n(t,e){if(e===void 0)return new Promise((r,n)=>{m8n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new yor(t,e);this.dispatch({...t,method:"CONNECT"},r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(m8n,"connect");g8n.exports=m8n});var y8n=I((cpf,Bpe)=>{"use strict";p();Bpe.exports.request=YFn();Bpe.exports.stream=r8n();Bpe.exports.pipeline=s8n();Bpe.exports.upgrade=f8n();Bpe.exports.connect=A8n()});var Eor=I((upf,E8n)=>{"use strict";p();var{UndiciError:aSs}=Rc(),_8n=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),_or=class t extends aSs{static{a(this,"MockNotMatchedError")}constructor(e){super(e),Error.captureStackTrace(this,t),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[_8n]===!0}[_8n]=!0};E8n.exports={MockNotMatchedError:_or}});var Fpe=I((ppf,v8n)=>{"use strict";p();v8n.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected")}});var n2e=I((mpf,D8n)=>{"use strict";p();var{MockNotMatchedError:zZ}=Eor(),{kDispatches:lst,kMockAgent:cSs,kOriginalDispatch:lSs,kOrigin:uSs,kGetNetConnect:dSs}=Fpe(),{buildURL:fSs}=Ws(),{STATUS_CODES:pSs}=require("node:http"),{types:{isPromise:hSs}}=require("node:util");function h8(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(h8,"matchValue");function b8n(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(b8n,"lowerCaseEntries");function S8n(t,e){if(Array.isArray(t)){for(let r=0;r"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[r,n]of Object.entries(t.headers)){let o=S8n(e,r);if(!h8(n,o))return!1}return!0}a(T8n,"matchHeaders");function C8n(t){if(typeof t!="string")return t;let e=t.split("?");if(e.length!==2)return t;let r=new URLSearchParams(e.pop());return r.sort(),[...e,r.toString()].join("?")}a(C8n,"safeUrl");function mSs(t,{path:e,method:r,body:n,headers:o}){let s=h8(t.path,e),c=h8(t.method,r),l=typeof t.body<"u"?h8(t.body,n):!0,u=T8n(t,o);return s&&c&&l&&u}a(mSs,"matchKey");function I8n(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(I8n,"getResponseData");function x8n(t,e){let r=e.query?fSs(e.path,e.query):e.path,n=typeof r=="string"?C8n(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>h8(C8n(s),n));if(o.length===0)throw new zZ(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>h8(s,e.method)),o.length===0)throw new zZ(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?h8(s,e.body):!0),o.length===0)throw new zZ(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>T8n(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new zZ(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(x8n,"getMockDispatch");function gSs(t,e,r){let n={timesInvoked:0,times:1,persist:!1,consumed:!1},o=typeof r=="function"?{callback:r}:{...r},s={...n,...e,pending:!0,data:{error:null,...o}};return t.push(s),s}a(gSs,"addMockDispatch");function vor(t,e){let r=t.findIndex(n=>n.consumed?mSs(n,e):!1);r!==-1&&t.splice(r,1)}a(vor,"deleteMockDispatch");function w8n(t){let{path:e,method:r,body:n,headers:o,query:s}=t;return{path:e,method:r,body:n,headers:o,query:s}}a(w8n,"buildKey");function Cor(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[lst])},d):g(this[lst]);function g(y,_=s){let E=Array.isArray(t.headers)?bor(t.headers):t.headers,v=typeof _=="function"?_({...t,headers:E}):_;if(hSs(v)){v.then(R=>g(y,R));return}let S=I8n(v),T=Cor(c),w=Cor(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,R8n(o)),e.onData?.(Buffer.from(S)),e.onComplete?.(w),vor(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(k8n,"mockDispatch");function ySs(){let t=this[cSs],e=this[uSs],r=this[lSs];return a(function(o,s){if(t.isMockActive)try{k8n.call(this,o,s)}catch(c){if(c instanceof zZ){let l=t[dSs]();if(l===!1)throw new zZ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(P8n(l,e))r.call(this,o,s);else throw new zZ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)`)}else throw c}else r.call(this,o,s)},"dispatch")}a(ySs,"buildMockDispatch");function P8n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>h8(n,r.host)))}a(P8n,"checkNetConnect");function _Ss(t){if(t){let{agent:e,...r}=t;return r}}a(_Ss,"buildMockOptions");D8n.exports={getResponseData:I8n,getMockDispatch:x8n,addMockDispatch:gSs,deleteMockDispatch:vor,buildKey:w8n,generateKeyValues:Cor,matchValue:h8,getResponse:ASs,getStatusText:R8n,mockDispatch:k8n,buildMockDispatch:ySs,checkNetConnect:P8n,buildMockOptions:_Ss,getHeaderByName:S8n,buildHeadersFromArray:bor}});var kor=I((ypf,Ror)=>{"use strict";p();var{getResponseData:ESs,buildKey:vSs,addMockDispatch:Sor}=n2e(),{kDispatches:ust,kDispatchKey:dst,kDefaultHeaders:Tor,kDefaultTrailers:Ior,kContentLength:xor,kMockDispatch:fst}=Fpe(),{InvalidArgumentError:X5}=Rc(),{buildURL:CSs}=Ws(),Upe=class{static{a(this,"MockScope")}constructor(e){this[fst]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new X5("waitInMs must be a valid integer > 0");return this[fst].delay=e,this}persist(){return this[fst].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new X5("repeatTimes must be a valid integer > 0");return this[fst].times=e,this}},wor=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new X5("opts must be an object");if(typeof e.path>"u")throw new X5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=CSs(e.path,e.query);else{let n=new URL(e.path,"data://");e.path=n.pathname+n.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[dst]=vSs(e),this[ust]=r,this[Tor]={},this[Ior]={},this[xor]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=ESs(r),s=this[xor]?{"content-length":o.length}:{},c={...this[Tor],...s,...n.headers},l={...this[Ior],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new X5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new X5("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new X5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=Sor(this[ust],this[dst],s);return new Upe(c)}let r={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(r);let n=this.createMockScopeDispatchData(r),o=Sor(this[ust],this[dst],n);return new Upe(o)}replyWithError(e){if(typeof e>"u")throw new X5("error must be defined");let r=Sor(this[ust],this[dst],{error:e});return new Upe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new X5("headers must be defined");return this[Tor]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new X5("trailers must be defined");return this[Ior]=e,this}replyContentLength(){return this[xor]=!0,this}};Ror.exports.MockInterceptor=wor;Ror.exports.MockScope=Upe});var Nor=I((vpf,U8n)=>{"use strict";p();var{promisify:bSs}=require("node:util"),SSs=wpe(),{buildMockDispatch:TSs}=n2e(),{kDispatches:N8n,kMockAgent:M8n,kClose:O8n,kOriginalClose:L8n,kOrigin:B8n,kOriginalDispatch:ISs,kConnected:Por}=Fpe(),{MockInterceptor:xSs}=kor(),F8n=tf(),{InvalidArgumentError:wSs}=Rc(),Dor=class extends SSs{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new wSs("Argument opts.agent must implement Agent");this[M8n]=r.agent,this[B8n]=e,this[N8n]=[],this[Por]=1,this[ISs]=this.dispatch,this[L8n]=this.close.bind(this),this.dispatch=TSs.call(this),this.close=this[O8n]}get[F8n.kConnected](){return this[Por]}intercept(e){return new xSs(e,this[N8n])}async[O8n](){await bSs(this[L8n])(),this[Por]=0,this[M8n][F8n.kClients].delete(this[B8n])}};U8n.exports=Dor});var Lor=I((Spf,V8n)=>{"use strict";p();var{promisify:RSs}=require("node:util"),kSs=Rpe(),{buildMockDispatch:PSs}=n2e(),{kDispatches:Q8n,kMockAgent:q8n,kClose:j8n,kOriginalClose:H8n,kOrigin:G8n,kOriginalDispatch:DSs,kConnected:Mor}=Fpe(),{MockInterceptor:NSs}=kor(),$8n=tf(),{InvalidArgumentError:MSs}=Rc(),Oor=class extends kSs{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new MSs("Argument opts.agent must implement Agent");this[q8n]=r.agent,this[G8n]=e,this[Q8n]=[],this[Mor]=1,this[DSs]=this.dispatch,this[H8n]=this.close.bind(this),this.dispatch=PSs.call(this),this.close=this[j8n]}get[$8n.kConnected](){return this[Mor]}intercept(e){return new NSs(e,this[Q8n])}async[j8n](){await RSs(this[H8n])(),this[Mor]=0,this[q8n][$8n.kClients].delete(this[G8n])}};V8n.exports=Oor});var z8n=I((wpf,W8n)=>{"use strict";p();var OSs={pronoun:"it",is:"is",was:"was",this:"this"},LSs={pronoun:"they",is:"are",was:"were",this:"these"};W8n.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?OSs:LSs,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var K8n=I((Dpf,Y8n)=>{"use strict";p();var{Transform:BSs}=require("node:stream"),{Console:FSs}=require("node:console"),USs=process.versions.icu?"\u2705":"Y ",QSs=process.versions.icu?"\u274C":"N ";Y8n.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new BSs({transform(r,n,o){o(null,r)}}),this.logger=new FSs({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let r=e.map(({method:n,path:o,data:{statusCode:s},persist:c,times:l,timesInvoked:u,origin:d})=>({Method:n,Origin:d,Path:o,"Status code":s,Persistent:c?USs:QSs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var e6n=I((Opf,X8n)=>{"use strict";p();var{kClients:YZ}=tf(),qSs=kpe(),{kAgent:Bor,kMockAgentSet:pst,kMockAgentGet:J8n,kDispatches:For,kIsMockActive:hst,kNetConnect:KZ,kGetNetConnect:jSs,kOptions:mst,kFactory:gst}=Fpe(),HSs=Nor(),GSs=Lor(),{matchValue:$Ss,buildMockOptions:VSs}=n2e(),{InvalidArgumentError:Z8n,UndiciError:WSs}=Rc(),zSs=IPe(),YSs=z8n(),KSs=K8n(),Uor=class extends zSs{static{a(this,"MockAgent")}constructor(e){if(super(e),this[KZ]=!0,this[hst]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new Z8n("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new qSs(e);this[Bor]=r,this[YZ]=r[YZ],this[mst]=VSs(e)}get(e){let r=this[J8n](e);return r||(r=this[gst](e),this[pst](e,r)),r}dispatch(e,r){return this.get(e.origin),this[Bor].dispatch(e,r)}async close(){await this[Bor].close(),this[YZ].clear()}deactivate(){this[hst]=!1}activate(){this[hst]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[KZ])?this[KZ].push(e):this[KZ]=[e];else if(typeof e>"u")this[KZ]=!0;else throw new Z8n("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[KZ]=!1}get isMockActive(){return this[hst]}[pst](e,r){this[YZ].set(e,r)}[gst](e){let r=Object.assign({agent:this},this[mst]);return this[mst]&&this[mst].connections===1?new HSs(e,r):new GSs(e,r)}[J8n](e){let r=this[YZ].get(e);if(r)return r;if(typeof e!="string"){let n=this[gst]("http://localhost:9999");return this[pst](e,n),n}for(let[n,o]of Array.from(this[YZ]))if(o&&typeof n!="string"&&$Ss(n,e)){let s=this[gst](e);return this[pst](e,s),s[For]=o[For],s}}[jSs](){return this[KZ]}pendingInterceptors(){let e=this[YZ];return Array.from(e.entries()).flatMap(([r,n])=>n[For].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new KSs}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new YSs("interceptor","interceptors").pluralize(r.length);throw new WSs(` ${n.count} ${n.noun} ${n.is} pending: ${e.format(r)} -`.trim())}};J8n.exports=For});var Ast=I((Lpf,r6n)=>{"use strict";p();var X8n=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:YSs}=Rc(),KSs=Rpe();t6n()===void 0&&e6n(new KSs);function e6n(t){if(!t||typeof t.dispatch!="function")throw new YSs("Argument agent must implement Agent");Object.defineProperty(globalThis,X8n,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(e6n,"setGlobalDispatcher");function t6n(){return globalThis[X8n]}a(t6n,"getGlobalDispatcher");r6n.exports={setGlobalDispatcher:e6n,getGlobalDispatcher:t6n}});var yst=I((Qpf,n6n)=>{"use strict";p();n6n.exports=class{static{a(this,"DecoratorHandler")}#e;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}});var o6n=I((Hpf,i6n)=>{"use strict";p();var JSs=Kot();i6n.exports=t=>{let e=t?.maxRedirections;return r=>a(function(o,s){let{maxRedirections:c=e,...l}=o;if(!c)return r(o,s);let u=new JSs(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var a6n=I((Vpf,s6n)=>{"use strict";p();var ZSs=ast();s6n.exports=t=>e=>a(function(n,o){return e(n,new ZSs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var l6n=I((Ypf,c6n)=>{"use strict";p();var XSs=Ws(),{InvalidArgumentError:e1s,RequestAbortedError:t1s}=Rc(),r1s=yst(),Uor=class extends r1s{static{a(this,"DumpHandler")}#e=1024*1024;#t=null;#r=!1;#n=!1;#i=0;#o=null;#s=null;constructor({maxSize:e},r){if(super(r),e!=null&&(!Number.isFinite(e)||e<1))throw new e1s("maxSize must be a number greater than 0");this.#e=e??this.#e,this.#s=r}onConnect(e){this.#t=e,this.#s.onConnect(this.#a.bind(this))}#a(e){this.#n=!0,this.#o=e}onHeaders(e,r,n,o){let c=XSs.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new t1s(`Response size (${c}) larger than maxSize (${this.#e})`);return this.#n?!0:this.#s.onHeaders(e,r,n,o)}onError(e){this.#r||(e=this.#o??e,this.#s.onError(e))}onData(e){return this.#i=this.#i+e.length,this.#i>=this.#e&&(this.#r=!0,this.#n?this.#s.onError(this.#o):this.#s.onComplete([])),!0}onComplete(e){if(!this.#r){if(this.#n){this.#s.onError(this.reason);return}this.#s.onComplete(e)}}};function n1s({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new Uor({maxSize:s},o);return e(n,c)},"Intercept")}a(n1s,"createDumpInterceptor");c6n.exports=n1s});var f6n=I((Zpf,d6n)=>{"use strict";p();var{isIP:i1s}=require("node:net"),{lookup:o1s}=require("node:dns"),s1s=yst(),{InvalidArgumentError:Upe,InformationalError:a1s}=Rc(),u6n=Math.pow(2,31)-1,Qor=class{static{a(this,"DNSInstance")}#e=0;#t=0;#r=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#n,this.pick=e.pick??this.#i}get full(){return this.#r.size===this.#t}runLookup(e,r,n){let o=this.#r.get(e.hostname);if(o==null&&this.full){n(null,e.origin);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(o==null)this.lookup(e,s,(c,l)=>{if(c||l==null||l.length===0){n(c??new a1s("No DNS entries found"));return}this.setRecords(e,l);let u=this.#r.get(e.hostname),d=this.pick(e,u,s.affinity),f;typeof d.port=="number"?f=`:${d.port}`:e.port!==""?f=`:${e.port}`:f="",n(null,`${e.protocol}//${d.family===6?`[${d.address}]`:d.address}${f}`)});else{let c=this.pick(e,o,s.affinity);if(c==null){this.#r.delete(e.hostname),this.runLookup(e,r,n);return}let l;typeof c.port=="number"?l=`:${c.port}`:e.port!==""?l=`:${e.port}`:l="",n(null,`${e.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`)}}#n(e,r,n){o1s(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(o,s)=>{if(o)return n(o);let c=new Map;for(let l of s)c.set(`${l.address}:${l.family}`,l);n(null,c.values())})}#i(e,r,n){let o=null,{records:s,offset:c}=r,l;if(this.dualStack?(n==null&&(c==null||c===u6n?(r.offset=0,n=4):(r.offset++,n=(r.offset&1)===1?6:4)),s[n]!=null&&s[n].ips.length>0?l=s[n]:l=s[n===4?6:4]):l=s[n],l==null||l.ips.length===0)return o;l.offset==null||l.offset===u6n?l.offset=0:l.offset++;let u=l.offset%l.ips.length;return o=l.ips[u]??null,o==null?o:Date.now()-o.timestamp>o.ttl?(l.ips.splice(u,1),this.pick(e,r,n)):o}setRecords(e,r){let n=Date.now(),o={records:{4:null,6:null}};for(let s of r){s.timestamp=n,typeof s.ttl=="number"?s.ttl=Math.min(s.ttl,this.#e):s.ttl=this.#e;let c=o.records[s.family]??{ips:[]};c.ips.push(s),o.records[s.family]=c}this.#r.set(e.hostname,o)}getHandler(e,r){return new qor(this,e,r)}},qor=class extends s1s{static{a(this,"DNSDispatchHandler")}#e=null;#t=null;#r=null;#n=null;#i=null;constructor(e,{origin:r,handler:n,dispatch:o},s){super(n),this.#i=r,this.#n=n,this.#t={...s},this.#e=e,this.#r=o}onError(e){switch(e.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){this.#e.runLookup(this.#i,this.#t,(r,n)=>{if(r)return this.#n.onError(r);let o={...this.#t,origin:n};this.#r(o,this)});return}this.#n.onError(e);return}case"ENOTFOUND":this.#e.deleteRecord(this.#i);default:this.#n.onError(e);break}}};d6n.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new Upe("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new Upe("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new Upe("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new Upe("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new Upe("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new Upe("Invalid pick. Must be a function");let e=t?.dualStack??!0,r;e?r=t?.affinity??null:r=t?.affinity??4;let n={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:r,maxItems:t?.maxItems??1/0},o=new Qor(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return i1s(d.hostname)!==0?s(l,u):(o.runLookup(d,l,(f,h)=>{if(f)return u.onError(f);let m=null;m={...l,servername:d.hostname,origin:h,headers:{host:d.hostname,...l.headers}},s(m,o.getHandler({origin:d,dispatch:s,handler:u},l))}),!0)},"dnsInterceptor")}});var KZ=I((thf,_6n)=>{"use strict";p();var{kConstruct:c1s}=ef(),{kEnumerableProperty:Qpe}=Ws(),{iteratorMixin:l1s,isValidHeaderName:i2e,isValidHeaderValue:h6n}=NT(),{webidl:ec}=ty(),jor=require("node:assert"),_st=require("node:util"),Cm=Symbol("headers map"),LT=Symbol("headers map sorted");function p6n(t){return t===10||t===13||t===9||t===32}a(p6n,"isHTTPWhiteSpaceCharCode");function m6n(t){let e=0,r=t.length;for(;r>e&&p6n(t.charCodeAt(r-1));)--r;for(;r>e&&p6n(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(m6n,"headerValueNormalize");function g6n(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(g6n,"fill");function Hor(t,e,r){if(r=m6n(r),i2e(e)){if(!h6n(r))throw ec.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw ec.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(y6n(t)==="immutable")throw new TypeError("immutable");return Gor(t).append(e,r,!1)}a(Hor,"appendHeader");function A6n(t,e){return t[0]>1),r[d][0]<=f[0]?u=d+1:l=d;if(s!==d){for(c=s;c>u;)r[c]=r[--c];r[u]=f}}if(!n.next().done)throw new TypeError("Unreachable");return r}else{let n=0;for(let{0:o,1:{value:s}}of this[Cm])r[n++]=[o,s],jor(s!==null);return r.sort(A6n)}}},W2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){ec.util.markAsUncloneable(this),e!==c1s&&(this.#t=new Est,this.#e="none",e!==void 0&&(e=ec.converters.HeadersInit(e,"Headers contructor","init"),g6n(this,e)))}append(e,r){ec.brandCheck(this,t),ec.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=ec.converters.ByteString(e,n,"name"),r=ec.converters.ByteString(r,n,"value"),Hor(this,e,r)}delete(e){if(ec.brandCheck(this,t),ec.argumentLengthCheck(arguments,1,"Headers.delete"),e=ec.converters.ByteString(e,"Headers.delete","name"),!i2e(e))throw ec.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){ec.brandCheck(this,t),ec.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=ec.converters.ByteString(e,r,"name"),!i2e(e))throw ec.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){ec.brandCheck(this,t),ec.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=ec.converters.ByteString(e,r,"name"),!i2e(e))throw ec.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){ec.brandCheck(this,t),ec.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=ec.converters.ByteString(e,n,"name"),r=ec.converters.ByteString(r,n,"value"),r=m6n(r),i2e(e)){if(!h6n(r))throw ec.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw ec.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){ec.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[LT](){if(this.#t[LT])return this.#t[LT];let e=[],r=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[LT]=r;for(let o=0;o>"](t,e,r,n.bind(t)):ec.converters["record"](t,e,r)}throw ec.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};_6n.exports={fill:g6n,compareHeaderName:A6n,Headers:W2,HeadersList:Est,getHeadersGuard:y6n,setHeadersGuard:u1s,setHeadersList:d1s,getHeadersList:Gor}});var s2e=I((ihf,P6n)=>{"use strict";p();var{Headers:T6n,HeadersList:E6n,fill:f1s,getHeadersGuard:p1s,setHeadersGuard:I6n,setHeadersList:x6n}=KZ(),{extractBody:v6n,cloneBody:h1s,mixinBody:m1s,hasFinalizationRegistry:w6n,streamRegistry:R6n,bodyUnusable:g1s}=Epe(),$or=Ws(),C6n=require("node:util"),{kEnumerableProperty:BT}=$or,{isValidReasonPhrase:A1s,isCancelled:y1s,isAborted:_1s,isBlobLike:E1s,serializeJavascriptValueToJSONString:v1s,isErrorLike:C1s,isomorphicEncode:b1s,environmentSettingsObject:S1s}=NT(),{redirectStatusSet:T1s,nullBodyStatus:I1s}=RPe(),{kState:rf,kHeaders:m8}=Zj(),{webidl:ds}=ty(),{FormData:x1s}=OPe(),{URLSerializer:b6n}=xb(),{kConstruct:Cst}=ef(),Vor=require("node:assert"),{types:w1s}=require("node:util"),R1s=new TextEncoder("utf-8"),JZ=class t{static{a(this,"Response")}static error(){return o2e(bst(),"immutable")}static json(e,r={}){ds.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ds.converters.ResponseInit(r));let n=R1s.encode(v1s(e)),o=v6n(n),s=o2e(qpe({}),"response");return S6n(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ds.argumentLengthCheck(arguments,1,"Response.redirect"),e=ds.converters.USVString(e),r=ds.converters["unsigned short"](r);let n;try{n=new URL(e,S1s.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!T1s.has(r))throw new RangeError(`Invalid status code ${r}`);let o=o2e(qpe({}),"immutable");o[rf].status=r;let s=b1s(b6n(n));return o[rf].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(ds.util.markAsUncloneable(this),e===Cst)return;e!==null&&(e=ds.converters.BodyInit(e)),r=ds.converters.ResponseInit(r),this[rf]=qpe({}),this[m8]=new T6n(Cst),I6n(this[m8],"response"),x6n(this[m8],this[rf].headersList);let n=null;if(e!=null){let[o,s]=v6n(e);n={body:o,type:s}}S6n(this,r,n)}get type(){return ds.brandCheck(this,t),this[rf].type}get url(){ds.brandCheck(this,t);let e=this[rf].urlList,r=e[e.length-1]??null;return r===null?"":b6n(r,!0)}get redirected(){return ds.brandCheck(this,t),this[rf].urlList.length>1}get status(){return ds.brandCheck(this,t),this[rf].status}get ok(){return ds.brandCheck(this,t),this[rf].status>=200&&this[rf].status<=299}get statusText(){return ds.brandCheck(this,t),this[rf].statusText}get headers(){return ds.brandCheck(this,t),this[m8]}get body(){return ds.brandCheck(this,t),this[rf].body?this[rf].body.stream:null}get bodyUsed(){return ds.brandCheck(this,t),!!this[rf].body&&$or.isDisturbed(this[rf].body.stream)}clone(){if(ds.brandCheck(this,t),g1s(this))throw ds.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=Wor(this[rf]);return w6n&&this[rf].body?.stream&&R6n.register(this,new WeakRef(this[rf].body.stream)),o2e(e,p1s(this[m8]))}[C6n.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${C6n.formatWithOptions(r,n)}`}};m1s(JZ);Object.defineProperties(JZ.prototype,{type:BT,url:BT,status:BT,ok:BT,redirected:BT,statusText:BT,headers:BT,clone:BT,body:BT,bodyUsed:BT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(JZ,{json:BT,redirect:BT,error:BT});function Wor(t){if(t.internalResponse)return k6n(Wor(t.internalResponse),t.type);let e=qpe({...t,body:null});return t.body!=null&&(e.body=h1s(e,t.body)),e}a(Wor,"cloneResponse");function qpe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new E6n(t?.headersList):new E6n,urlList:t?.urlList?[...t.urlList]:[]}}a(qpe,"makeResponse");function bst(t){let e=C1s(t);return qpe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(bst,"makeNetworkError");function k1s(t){return t.type==="error"&&t.status===0}a(k1s,"isNetworkError");function vst(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(r,n){return n in e?e[n]:r[n]},set(r,n,o){return Vor(!(n in e)),r[n]=o,!0}})}a(vst,"makeFilteredResponse");function k6n(t,e){if(e==="basic")return vst(t,{type:"basic",headersList:t.headersList});if(e==="cors")return vst(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return vst(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return vst(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});Vor(!1)}a(k6n,"filterResponse");function P1s(t,e=null){return Vor(y1s(t)),_1s(t)?bst(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):bst(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(P1s,"makeAppropriateNetworkError");function S6n(t,e,r){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!A1s(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[rf].status=e.status),"statusText"in e&&e.statusText!=null&&(t[rf].statusText=e.statusText),"headers"in e&&e.headers!=null&&f1s(t[m8],e.headers),r){if(I1s.includes(t.status))throw ds.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[rf].body=r.body,r.type!=null&&!t[rf].headersList.contains("content-type",!0)&&t[rf].headersList.append("content-type",r.type,!0)}}a(S6n,"initializeResponse");function o2e(t,e){let r=new JZ(Cst);return r[rf]=t,r[m8]=new T6n(Cst),x6n(r[m8],t.headersList),I6n(r[m8],e),w6n&&t.body?.stream&&R6n.register(r,new WeakRef(t.body.stream)),r}a(o2e,"fromInnerResponse");ds.converters.ReadableStream=ds.interfaceConverter(ReadableStream);ds.converters.FormData=ds.interfaceConverter(x1s);ds.converters.URLSearchParams=ds.interfaceConverter(URLSearchParams);ds.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ds.converters.USVString(t,e,r):E1s(t)?ds.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||w1s.isArrayBuffer(t)?ds.converters.BufferSource(t,e,r):$or.isFormDataLike(t)?ds.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?ds.converters.URLSearchParams(t,e,r):ds.converters.DOMString(t,e,r)};ds.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?ds.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:ds.converters.XMLHttpRequestBodyInit(t,e,r)};ds.converters.ResponseInit=ds.dictionaryConverter([{key:"status",converter:ds.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ds.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ds.converters.HeadersInit}]);P6n.exports={isNetworkError:k1s,makeNetworkError:bst,makeResponse:qpe,makeAppropriateNetworkError:P1s,filterResponse:k6n,Response:JZ,cloneResponse:Wor,fromInnerResponse:o2e}});var O6n=I((ahf,M6n)=>{"use strict";p();var{kConnected:D6n,kSize:N6n}=ef(),zor=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[D6n]===0&&this.value[N6n]===0?void 0:this.value}},Yor=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[D6n]===0&&e[N6n]===0&&this.finalizer(r)})}unregister(e){}};M6n.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:zor,FinalizationRegistry:Yor}):{WeakRef,FinalizationRegistry}}});var jpe=I((uhf,K6n)=>{"use strict";p();var{extractBody:D1s,mixinBody:N1s,cloneBody:M1s,bodyUnusable:L6n}=Epe(),{Headers:$6n,fill:O1s,HeadersList:xst,setHeadersGuard:Jor,getHeadersGuard:L1s,setHeadersList:V6n,getHeadersList:B6n}=KZ(),{FinalizationRegistry:B1s}=O6n()(),Tst=Ws(),F6n=require("node:util"),{isValidHTTPToken:F1s,sameOrigin:U6n,environmentSettingsObject:Sst}=NT(),{forbiddenMethodsSet:U1s,corsSafeListedMethodsSet:Q1s,referrerPolicy:q1s,requestRedirect:j1s,requestMode:H1s,requestCredentials:G1s,requestCache:$1s,requestDuplex:V1s}=RPe(),{kEnumerableProperty:bm,normalizedMethodRecordsBase:W1s,normalizedMethodRecords:z1s}=Tst,{kHeaders:FT,kSignal:Ist,kState:gd,kDispatcher:Kor}=Zj(),{webidl:Wi}=ty(),{URLSerializer:Y1s}=xb(),{kConstruct:wst}=ef(),K1s=require("node:assert"),{getMaxListeners:Q6n,setMaxListeners:q6n,getEventListeners:J1s,defaultMaxListeners:j6n}=require("node:events"),Z1s=Symbol("abortController"),W6n=new B1s(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Rst=new WeakMap;function H6n(t){return e;function e(){let r=t.deref();if(r!==void 0){W6n.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Rst.get(r.signal);if(n!==void 0){if(n.size!==0){for(let o of n){let s=o.deref();s!==void 0&&s.abort(this.reason)}n.clear()}Rst.delete(r.signal)}}}}a(H6n,"buildAbort");var G6n=!1,uH=class t{static{a(this,"Request")}constructor(e,r={}){if(Wi.util.markAsUncloneable(this),e===wst)return;let n="Request constructor";Wi.argumentLengthCheck(arguments,1,n),e=Wi.converters.RequestInfo(e,n,"input"),r=Wi.converters.RequestInit(r,n,"init");let o=null,s=null,c=Sst.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[Kor]=r.dispatcher;let E;try{E=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(E.username||E.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=kst({urlList:[E]}),s="cors"}else this[Kor]=r.dispatcher||e[Kor],K1s(e instanceof t),o=e[gd],l=e[Ist];let u=Sst.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&U6n(o.window,u)&&(d=o.window),r.window!=null)throw new TypeError(`'window' option '${d}' must be null`);"window"in r&&(d="no-window"),o=kst({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Sst.settingsObject,window:d,priority:o.priority,origin:o.origin,referrer:o.referrer,referrerPolicy:o.referrerPolicy,mode:o.mode,credentials:o.credentials,cache:o.cache,redirect:o.redirect,integrity:o.integrity,keepalive:o.keepalive,reloadNavigation:o.reloadNavigation,historyNavigation:o.historyNavigation,urlList:[...o.urlList]});let f=Object.keys(r).length!==0;if(f&&(o.mode==="navigate"&&(o.mode="same-origin"),o.reloadNavigation=!1,o.historyNavigation=!1,o.origin="client",o.referrer="client",o.referrerPolicy="",o.url=o.urlList[o.urlList.length-1],o.urlList=[o.url]),r.referrer!==void 0){let E=r.referrer;if(E==="")o.referrer="no-referrer";else{let v;try{v=new URL(E,c)}catch(S){throw new TypeError(`Referrer "${E}" is not a valid URL.`,{cause:S})}v.protocol==="about:"&&v.hostname==="client"||u&&!U6n(v,Sst.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw Wi.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let E=r.method,v=z1s[E];if(v!==void 0)o.method=v;else{if(!F1s(E))throw new TypeError(`'${E}' is not a valid HTTP method.`);let S=E.toUpperCase();if(U1s.has(S))throw new TypeError(`'${E}' HTTP method is unsupported.`);E=W1s[S]??E,o.method=E}!G6n&&o.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),G6n=!0)}r.signal!==void 0&&(l=r.signal),this[gd]=o;let m=new AbortController;if(this[Ist]=m.signal,l!=null){if(!l||typeof l.aborted!="boolean"||typeof l.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(l.aborted)m.abort(l.reason);else{this[Z1s]=m;let E=new WeakRef(m),v=H6n(E);try{(typeof Q6n=="function"&&Q6n(l)===j6n||J1s(l,"abort").length>=j6n)&&q6n(1500,l)}catch{}Tst.addAbortListener(l,v),W6n.register(m,{signal:l,abort:v},v)}}if(this[FT]=new $6n(wst),V6n(this[FT],o.headersList),Jor(this[FT],"request"),h==="no-cors"){if(!Q1s.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);Jor(this[FT],"request-no-cors")}if(f){let E=B6n(this[FT]),v=r.headers!==void 0?r.headers:new xst(E);if(E.clear(),v instanceof xst){for(let{name:S,value:T}of v.rawValues())E.append(S,T,!1);E.cookies=v.cookies}else O1s(this[FT],v)}let g=e instanceof t?e[gd].body:null;if((r.body!=null||g!=null)&&(o.method==="GET"||o.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let A=null;if(r.body!=null){let[E,v]=D1s(r.body,o.keepalive);A=E,v&&!B6n(this[FT]).contains("content-type",!0)&&this[FT].append("content-type",v)}let y=A??g;if(y!=null&&y.source==null){if(A!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(o.mode!=="same-origin"&&o.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');o.useCORSPreflightFlag=!0}let _=y;if(A==null&&g!=null){if(L6n(e))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let E=new TransformStream;g.stream.pipeThrough(E),_={source:g.source,length:g.length,stream:E.readable}}this[gd].body=_}get method(){return Wi.brandCheck(this,t),this[gd].method}get url(){return Wi.brandCheck(this,t),Y1s(this[gd].url)}get headers(){return Wi.brandCheck(this,t),this[FT]}get destination(){return Wi.brandCheck(this,t),this[gd].destination}get referrer(){return Wi.brandCheck(this,t),this[gd].referrer==="no-referrer"?"":this[gd].referrer==="client"?"about:client":this[gd].referrer.toString()}get referrerPolicy(){return Wi.brandCheck(this,t),this[gd].referrerPolicy}get mode(){return Wi.brandCheck(this,t),this[gd].mode}get credentials(){return this[gd].credentials}get cache(){return Wi.brandCheck(this,t),this[gd].cache}get redirect(){return Wi.brandCheck(this,t),this[gd].redirect}get integrity(){return Wi.brandCheck(this,t),this[gd].integrity}get keepalive(){return Wi.brandCheck(this,t),this[gd].keepalive}get isReloadNavigation(){return Wi.brandCheck(this,t),this[gd].reloadNavigation}get isHistoryNavigation(){return Wi.brandCheck(this,t),this[gd].historyNavigation}get signal(){return Wi.brandCheck(this,t),this[Ist]}get body(){return Wi.brandCheck(this,t),this[gd].body?this[gd].body.stream:null}get bodyUsed(){return Wi.brandCheck(this,t),!!this[gd].body&&Tst.isDisturbed(this[gd].body.stream)}get duplex(){return Wi.brandCheck(this,t),"half"}clone(){if(Wi.brandCheck(this,t),L6n(this))throw new TypeError("unusable");let e=z6n(this[gd]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Rst.get(this.signal);n===void 0&&(n=new Set,Rst.set(this.signal,n));let o=new WeakRef(r);n.add(o),Tst.addAbortListener(r.signal,H6n(o))}return Y6n(e,r.signal,L1s(this[FT]))}[F6n.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${F6n.formatWithOptions(r,n)}`}};N1s(uH);function kst(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new xst(t.headersList):new xst}}a(kst,"makeRequest");function z6n(t){let e=kst({...t,body:null});return t.body!=null&&(e.body=M1s(e,t.body)),e}a(z6n,"cloneRequest");function Y6n(t,e,r){let n=new uH(wst);return n[gd]=t,n[Ist]=e,n[FT]=new $6n(wst),V6n(n[FT],t.headersList),Jor(n[FT],r),n}a(Y6n,"fromInnerRequest");Object.defineProperties(uH.prototype,{method:bm,url:bm,headers:bm,redirect:bm,clone:bm,signal:bm,duplex:bm,destination:bm,body:bm,bodyUsed:bm,isHistoryNavigation:bm,isReloadNavigation:bm,keepalive:bm,integrity:bm,cache:bm,credentials:bm,attribute:bm,referrerPolicy:bm,referrer:bm,mode:bm,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Wi.converters.Request=Wi.interfaceConverter(uH);Wi.converters.RequestInfo=function(t,e,r){return typeof t=="string"?Wi.converters.USVString(t,e,r):t instanceof uH?Wi.converters.Request(t,e,r):Wi.converters.USVString(t,e,r)};Wi.converters.AbortSignal=Wi.interfaceConverter(AbortSignal);Wi.converters.RequestInit=Wi.dictionaryConverter([{key:"method",converter:Wi.converters.ByteString},{key:"headers",converter:Wi.converters.HeadersInit},{key:"body",converter:Wi.nullableConverter(Wi.converters.BodyInit)},{key:"referrer",converter:Wi.converters.USVString},{key:"referrerPolicy",converter:Wi.converters.DOMString,allowedValues:q1s},{key:"mode",converter:Wi.converters.DOMString,allowedValues:H1s},{key:"credentials",converter:Wi.converters.DOMString,allowedValues:G1s},{key:"cache",converter:Wi.converters.DOMString,allowedValues:$1s},{key:"redirect",converter:Wi.converters.DOMString,allowedValues:j1s},{key:"integrity",converter:Wi.converters.DOMString},{key:"keepalive",converter:Wi.converters.boolean},{key:"signal",converter:Wi.nullableConverter(t=>Wi.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:Wi.converters.any},{key:"duplex",converter:Wi.converters.DOMString,allowedValues:V1s},{key:"dispatcher",converter:Wi.converters.any}]);K6n.exports={Request:uH,makeRequest:kst,fromInnerRequest:Y6n,cloneRequest:z6n}});var c2e=I((phf,dUn)=>{"use strict";p();var{makeNetworkError:gl,makeAppropriateNetworkError:Pst,filterResponse:Zor,makeResponse:Dst,fromInnerResponse:X1s}=s2e(),{HeadersList:J6n}=KZ(),{Request:eTs,cloneRequest:tTs}=jpe(),dH=require("node:zlib"),{bytesMatch:rTs,makePolicyContainer:nTs,clonePolicyContainer:iTs,requestBadPort:oTs,TAOCheck:sTs,appendRequestOriginHeader:aTs,responseLocationURL:cTs,requestCurrentURL:e4,setRequestReferrerPolicyOnRedirect:lTs,tryUpgradeRequestToAPotentiallyTrustworthyURL:uTs,createOpaqueTimingInfo:nsr,appendFetchMetadata:dTs,corsCheck:fTs,crossOriginResourcePolicyCheck:pTs,determineRequestsReferrer:hTs,coarsenedSharedCurrentTime:a2e,createDeferredPromise:mTs,isBlobLike:gTs,sameOrigin:rsr,isCancelled:ZZ,isAborted:Z6n,isErrorLike:ATs,fullyReadBody:yTs,readableStreamClose:_Ts,isomorphicEncode:Nst,urlIsLocal:ETs,urlIsHttpHttpsScheme:isr,urlHasHttpsScheme:vTs,clampAndCoarsenConnectionTimingInfo:CTs,simpleRangeHeaderValue:bTs,buildContentRange:STs,createInflate:TTs,extractMimeType:ITs}=NT(),{kState:rUn,kDispatcher:xTs}=Zj(),XZ=require("node:assert"),{safelyExtractBody:osr,extractBody:X6n}=Epe(),{redirectStatusSet:nUn,nullBodyStatus:iUn,safeMethodsSet:wTs,requestBodyHeader:RTs,subresourceSet:kTs}=RPe(),PTs=require("node:events"),{Readable:DTs,pipeline:NTs,finished:MTs}=require("node:stream"),{addAbortListener:OTs,isErrored:LTs,isReadable:Mst,bufferToLowerCasedHeaderName:eUn}=Ws(),{dataURLProcessor:BTs,serializeAMimeType:FTs,minimizeSupportedMimeType:UTs}=xb(),{getGlobalDispatcher:QTs}=Ast(),{webidl:qTs}=ty(),{STATUS_CODES:jTs}=require("node:http"),HTs=["GET","HEAD"],GTs=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",Xor,Ost=class extends PTs{static{a(this,"Fetch")}constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function $Ts(t){oUn(t,"fetch")}a($Ts,"handleFetchDone");function VTs(t,e=void 0){qTs.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=mTs(),n;try{n=new eTs(t,e)}catch(f){return r.reject(f),r.promise}let o=n[rUn];if(n.signal.aborted)return esr(r,o,null,n.signal.reason),r.promise;o.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(o.serviceWorkers="none");let c=null,l=!1,u=null;return OTs(n.signal,()=>{l=!0,XZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();esr(r,o,f,n.signal.reason)}),u=aUn({request:o,processResponseEndOfBody:$Ts,processResponse:a(f=>{if(!l){if(f.aborted){esr(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(X1s(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[xTs]}),r.promise}a(VTs,"fetch");function oUn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;isr(r)&&n!==null&&(t.timingAllowPassed||(n=nsr({startTime:n.startTime}),o=""),n.endTime=a2e(),t.timingInfo=n,sUn(n,r.href,e,globalThis,o))}a(oUn,"finalizeAndReportTiming");var sUn=performance.markResourceTiming;function esr(t,e,r,n){if(t&&t.reject(n),e.body!=null&&Mst(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[rUn];o.body!=null&&Mst(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(esr,"abortFetch");function aUn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=QTs()}){XZ(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=a2e(d),h=nsr({startTime:f}),m={controller:new Ost(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return XZ(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=iTs(t.client.policyContainer):t.policyContainer=nTs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,kTs.has(t.destination),cUn(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(aUn,"fetching");async function cUn(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!ETs(e4(r))&&(n=gl("local URLs only")),uTs(r),oTs(r)==="blocked"&&(n=gl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=hTs(r)),n===null&&(n=await(async()=>{let s=e4(r);return rsr(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await tUn(t)):r.mode==="same-origin"?gl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?gl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await tUn(t)):isr(e4(r))?(r.responseTainting="cors",await lUn(t)):gl("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=Zor(n,"basic"):r.responseTainting==="cors"?n=Zor(n,"cors"):r.responseTainting==="opaque"?n=Zor(n,"opaque"):XZ(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=gl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||iUn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>tsr(t,gl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!rTs(l,r.integrity)){s("integrity mismatch");return}n.body=osr(l)[0],tsr(t,n)},"processBody");await yTs(n.body,c,s)}else tsr(t,n)}a(cUn,"mainFetch");function tUn(t){if(ZZ(t)&&t.request.redirectCount===0)return Promise.resolve(Pst(t));let{request:e}=t,{protocol:r}=e4(e);switch(r){case"about:":return Promise.resolve(gl("about scheme is not supported"));case"blob:":{Xor||(Xor=require("node:buffer").resolveObjectURL);let n=e4(e);if(n.search.length!==0)return Promise.resolve(gl("NetworkError when attempting to fetch resource."));let o=Xor(n.toString());if(e.method!=="GET"||!gTs(o))return Promise.resolve(gl("invalid method"));let s=Dst(),c=o.size,l=Nst(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=bTs(d,!0);if(f==="failure")return Promise.resolve(gl("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(gl("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=X6n(g);s.body=A[0];let y=Nst(`${g.size}`),_=STs(h,m,c);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",y,!0),s.headersList.set("content-type",u,!0),s.headersList.set("content-range",_,!0)}else{let d=X6n(o);s.statusText="OK",s.body=d[0],s.headersList.set("content-length",l,!0),s.headersList.set("content-type",u,!0)}return Promise.resolve(s)}case"data:":{let n=e4(e),o=BTs(n);if(o==="failure")return Promise.resolve(gl("failed to fetch the data URL"));let s=FTs(o.mimeType);return Promise.resolve(Dst({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:osr(o.body)[0]}))}case"file:":return Promise.resolve(gl("not implemented... yet..."));case"http:":case"https:":return lUn(t).catch(n=>gl(n));default:return Promise.resolve(gl("unknown scheme"))}}a(tUn,"schemeFetch");function WTs(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(WTs,"finalizeResponse");function tsr(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(t.request.url.protocol!=="https:")return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=nsr(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=ITs(e.headersList);f!=="failure"&&(u.contentType=UTs(f))}t.request.initiatorType!=null&&sUn(r,t.request.url.href,t.request.initiatorType,globalThis,l,u,d)};let c=a(()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()},"processResponseEndOfBodyTask");queueMicrotask(()=>c())},"processResponseEndOfBody");t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let o=e.type==="error"?e:e.internalResponse??e;o.body==null?n():MTs(o.body.stream,()=>{n()})}a(tsr,"fetchFinale");async function lUn(t){let e=t.request,r=null,n=null,o=t.timingInfo;if(e.serviceWorkers,r===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),n=r=await uUn(t),e.responseTainting==="cors"&&fTs(e,r)==="failure")return gl("cors failure");sTs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&pTs(e.origin,e.client,e.destination,n)==="blocked"?gl("blocked"):(nUn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=gl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await zTs(t,r):XZ(!1)),r.timingInfo=o,r)}a(lUn,"httpFetch");function zTs(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=cTs(n,e4(r).hash),o==null)return e}catch(c){return Promise.resolve(gl(c))}if(!isr(o))return Promise.resolve(gl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(gl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!rsr(r,o))return Promise.resolve(gl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(gl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(gl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!HTs.includes(r.method)){r.method="GET",r.body=null;for(let c of RTs)r.headersList.delete(c)}rsr(e4(r),o)||(r.headersList.delete("authorization",!0),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie",!0),r.headersList.delete("host",!0)),r.body!=null&&(XZ(r.body.source!=null),r.body=osr(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=a2e(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),lTs(r,n),cUn(t,!0)}a(zTs,"httpRedirectFetch");async function uUn(t,e=!1,r=!1){let n=t.request,o=null,s=null,c=null,l=null,u=!1;n.window==="no-window"&&n.redirect==="error"?(o=t,s=n):(s=tTs(n),o={...t},o.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",f=s.body?s.body.length:null,h=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(h="0"),f!=null&&(h=Nst(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",Nst(s.referrer.href),!0),aTs(s),dTs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",GTs),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(vTs(e4(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return gl("only if cached");let m=await YTs(o,d,r);!wTs.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===407)return n.window==="no-window"?gl():ZZ(t)?Pst(t):gl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(ZZ(t))return Pst(t);t.controller.connection.destroy(),c=await uUn(t,e,!0)}return c}a(uUn,"httpNetworkOrCacheFetch");async function YTs(t,e=!1,r=!1){XZ(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(E){ZZ(t)||(yield E,t.processRequestBodyChunkLength?.(E.byteLength))},"processBodyChunk"),y=a(()=>{ZZ(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),_=a(E=>{ZZ(t)||(E.name==="AbortError"?t.controller.abort():t.controller.terminate(E))},"processBodyError");u=(async function*(){try{for await(let E of n.body.stream)yield*A(E);y()}catch(E){_(E)}})()}try{let{body:A,status:y,statusText:_,headersList:E,socket:v}=await g({body:u});if(v)o=Dst({status:y,statusText:_,headersList:E,socket:v});else{let S=A[Symbol.asyncIterator]();t.controller.next=()=>S.next(),o=Dst({status:y,statusText:_,headersList:E})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),Pst(t,A)):gl(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{ZZ(t)||t.controller.abort(A)},"cancelAlgorithm"),h=new ReadableStream({async start(A){t.controller.controller=A},async pull(A){await d(A)},async cancel(A){await f(A)},type:"bytes"});o.body={stream:h,source:null,length:null},t.controller.onAborted=m,t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let A,y;try{let{done:E,value:v}=await t.controller.next();if(Z6n(t))break;A=E?void 0:v}catch(E){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=E,y=!0)}if(A===void 0){_Ts(t.controller.controller),WTs(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let _=new Uint8Array(A);if(_.byteLength&&t.controller.controller.enqueue(_),LTs(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){Z6n(t)?(o.aborted=!0,Mst(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):Mst(h)&&t.controller.controller.error(new TypeError("terminated",{cause:ATs(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=e4(n),_=t.controller.dispatcher;return new Promise((E,v)=>_.dispatch({path:y.pathname+y.search,origin:y.origin,method:n.method,body:_.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(S){let{connection:T}=t.controller;s.finalConnectionTimingInfo=CTs(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),T.destroyed?S(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",S),this.abort=T.abort=S),s.finalNetworkRequestStartTime=a2e(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=a2e(t.crossOriginIsolatedCapability)},onHeaders(S,T,w,R){if(S<200)return;let x="",k=new J6n;for(let B=0;BM)return v(new Error(`too many content-encodings in response: ${q.length}, maximum allowed is ${M}`)),!0;for(let L=q.length-1;L>=0;--L){let U=q[L].trim();if(U==="x-gzip"||U==="gzip")D.push(dH.createGunzip({flush:dH.constants.Z_SYNC_FLUSH,finishFlush:dH.constants.Z_SYNC_FLUSH}));else if(U==="deflate")D.push(TTs({flush:dH.constants.Z_SYNC_FLUSH,finishFlush:dH.constants.Z_SYNC_FLUSH}));else if(U==="br")D.push(dH.createBrotliDecompress({flush:dH.constants.BROTLI_OPERATION_FLUSH,finishFlush:dH.constants.BROTLI_OPERATION_FLUSH}));else{D.length=0;break}}}let O=this.onError.bind(this);return E({status:S,statusText:R,headersList:k,body:D.length?NTs(this.body,...D,B=>{B&&this.onError(B)}).on("error",O):this.body.on("error",O)}),!0},onData(S){if(t.controller.dump)return;let T=S;return s.encodedBodySize+=T.byteLength,this.body.push(T)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.onAborted&&t.controller.off("terminated",t.controller.onAborted),t.controller.ended=!0,this.body.push(null)},onError(S){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(S),t.controller.terminate(S),v(S)},onUpgrade(S,T,w){if(S!==101)return;let R=new J6n;for(let x=0;x{"use strict";p();fUn.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var hUn=I((yhf,pUn)=>{"use strict";p();var{webidl:UT}=ty(),Lst=Symbol("ProgressEvent state"),asr=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=UT.converters.DOMString(e,"ProgressEvent constructor","type"),r=UT.converters.ProgressEventInit(r??{}),super(e,r),this[Lst]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return UT.brandCheck(this,t),this[Lst].lengthComputable}get loaded(){return UT.brandCheck(this,t),this[Lst].loaded}get total(){return UT.brandCheck(this,t),this[Lst].total}};UT.converters.ProgressEventInit=UT.dictionaryConverter([{key:"lengthComputable",converter:UT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:UT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:UT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:UT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:UT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:UT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);pUn.exports={ProgressEvent:asr}});var gUn=I((vhf,mUn)=>{"use strict";p();function KTs(t){if(!t)return"failure";switch(t.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}a(KTs,"getEncoding");mUn.exports={getEncoding:KTs}});var SUn=I((Shf,bUn)=>{"use strict";p();var{kState:Hpe,kError:csr,kResult:AUn,kAborted:l2e,kLastProgressEventFired:lsr}=ssr(),{ProgressEvent:JTs}=hUn(),{getEncoding:yUn}=gUn(),{serializeAMimeType:ZTs,parseMIMEType:_Un}=xb(),{types:XTs}=require("node:util"),{StringDecoder:EUn}=require("string_decoder"),{btoa:vUn}=require("node:buffer"),eIs={enumerable:!0,writable:!1,configurable:!1};function tIs(t,e,r,n){if(t[Hpe]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[Hpe]="loading",t[AUn]=null,t[csr]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[l2e];)try{let{done:d,value:f}=await l;if(u&&!t[l2e]&&queueMicrotask(()=>{fH("loadstart",t)}),u=!1,!d&&XTs.isUint8Array(f))c.push(f),(t[lsr]===void 0||Date.now()-t[lsr]>=50)&&!t[l2e]&&(t[lsr]=Date.now(),queueMicrotask(()=>{fH("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[Hpe]="done";try{let h=rIs(c,r,e.type,n);if(t[l2e])return;t[AUn]=h,fH("load",t)}catch(h){t[csr]=h,fH("error",t)}t[Hpe]!=="loading"&&fH("loadend",t)});break}}catch(d){if(t[l2e])return;queueMicrotask(()=>{t[Hpe]="done",t[csr]=d,fH("error",t),t[Hpe]!=="loading"&&fH("loadend",t)});break}})()}a(tIs,"readOperation");function fH(t,e){let r=new JTs(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(fH,"fireAProgressEvent");function rIs(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=_Un(r||"application/octet-stream");s!=="failure"&&(o+=ZTs(s)),o+=";base64,";let c=new EUn("latin1");for(let l of t)o+=vUn(c.write(l));return o+=vUn(c.end()),o}case"Text":{let o="failure";if(n&&(o=yUn(n)),o==="failure"&&r){let s=_Un(r);s!=="failure"&&(o=yUn(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),nIs(t,o)}case"ArrayBuffer":return CUn(t).buffer;case"BinaryString":{let o="",s=new EUn("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a(rIs,"packageData");function nIs(t,e){let r=CUn(t),n=iIs(r),o=0;n!==null&&(e=n,o=n==="UTF-8"?3:2);let s=r.slice(o);return new TextDecoder(e).decode(s)}a(nIs,"decode");function iIs(t){let[e,r,n]=t;return e===239&&r===187&&n===191?"UTF-8":e===254&&r===255?"UTF-16BE":e===255&&r===254?"UTF-16LE":null}a(iIs,"BOMSniffing");function CUn(t){let e=t.reduce((n,o)=>n+o.byteLength,0),r=0;return t.reduce((n,o)=>(n.set(o,r),r+=o.byteLength,n),new Uint8Array(e))}a(CUn,"combineByteSequences");bUn.exports={staticPropertyDescriptors:eIs,readOperation:tIs,fireAProgressEvent:fH}});var wUn=I((xhf,xUn)=>{"use strict";p();var{staticPropertyDescriptors:Gpe,readOperation:Bst,fireAProgressEvent:TUn}=SUn(),{kState:eX,kError:IUn,kResult:Fst,kEvents:Uc,kAborted:oIs}=ssr(),{webidl:Ql}=ty(),{kEnumerableProperty:kb}=Ws(),z2=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[eX]="empty",this[Fst]=null,this[IUn]=null,this[Uc]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){Ql.brandCheck(this,t),Ql.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=Ql.converters.Blob(e,{strict:!1}),Bst(this,e,"ArrayBuffer")}readAsBinaryString(e){Ql.brandCheck(this,t),Ql.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=Ql.converters.Blob(e,{strict:!1}),Bst(this,e,"BinaryString")}readAsText(e,r=void 0){Ql.brandCheck(this,t),Ql.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=Ql.converters.Blob(e,{strict:!1}),r!==void 0&&(r=Ql.converters.DOMString(r,"FileReader.readAsText","encoding")),Bst(this,e,"Text",r)}readAsDataURL(e){Ql.brandCheck(this,t),Ql.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=Ql.converters.Blob(e,{strict:!1}),Bst(this,e,"DataURL")}abort(){if(this[eX]==="empty"||this[eX]==="done"){this[Fst]=null;return}this[eX]==="loading"&&(this[eX]="done",this[Fst]=null),this[oIs]=!0,TUn("abort",this),this[eX]!=="loading"&&TUn("loadend",this)}get readyState(){switch(Ql.brandCheck(this,t),this[eX]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return Ql.brandCheck(this,t),this[Fst]}get error(){return Ql.brandCheck(this,t),this[IUn]}get onloadend(){return Ql.brandCheck(this,t),this[Uc].loadend}set onloadend(e){Ql.brandCheck(this,t),this[Uc].loadend&&this.removeEventListener("loadend",this[Uc].loadend),typeof e=="function"?(this[Uc].loadend=e,this.addEventListener("loadend",e)):this[Uc].loadend=null}get onerror(){return Ql.brandCheck(this,t),this[Uc].error}set onerror(e){Ql.brandCheck(this,t),this[Uc].error&&this.removeEventListener("error",this[Uc].error),typeof e=="function"?(this[Uc].error=e,this.addEventListener("error",e)):this[Uc].error=null}get onloadstart(){return Ql.brandCheck(this,t),this[Uc].loadstart}set onloadstart(e){Ql.brandCheck(this,t),this[Uc].loadstart&&this.removeEventListener("loadstart",this[Uc].loadstart),typeof e=="function"?(this[Uc].loadstart=e,this.addEventListener("loadstart",e)):this[Uc].loadstart=null}get onprogress(){return Ql.brandCheck(this,t),this[Uc].progress}set onprogress(e){Ql.brandCheck(this,t),this[Uc].progress&&this.removeEventListener("progress",this[Uc].progress),typeof e=="function"?(this[Uc].progress=e,this.addEventListener("progress",e)):this[Uc].progress=null}get onload(){return Ql.brandCheck(this,t),this[Uc].load}set onload(e){Ql.brandCheck(this,t),this[Uc].load&&this.removeEventListener("load",this[Uc].load),typeof e=="function"?(this[Uc].load=e,this.addEventListener("load",e)):this[Uc].load=null}get onabort(){return Ql.brandCheck(this,t),this[Uc].abort}set onabort(e){Ql.brandCheck(this,t),this[Uc].abort&&this.removeEventListener("abort",this[Uc].abort),typeof e=="function"?(this[Uc].abort=e,this.addEventListener("abort",e)):this[Uc].abort=null}};z2.EMPTY=z2.prototype.EMPTY=0;z2.LOADING=z2.prototype.LOADING=1;z2.DONE=z2.prototype.DONE=2;Object.defineProperties(z2.prototype,{EMPTY:Gpe,LOADING:Gpe,DONE:Gpe,readAsArrayBuffer:kb,readAsBinaryString:kb,readAsText:kb,readAsDataURL:kb,abort:kb,readyState:kb,result:kb,error:kb,onloadstart:kb,onprogress:kb,onload:kb,onabort:kb,onerror:kb,onloadend:kb,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(z2,{EMPTY:Gpe,LOADING:Gpe,DONE:Gpe});xUn.exports={FileReader:z2}});var Ust=I((khf,RUn)=>{"use strict";p();RUn.exports={kConstruct:ef().kConstruct}});var DUn=I((Dhf,PUn)=>{"use strict";p();var sIs=require("node:assert"),{URLSerializer:kUn}=xb(),{isValidHeaderName:aIs}=NT();function cIs(t,e,r=!1){let n=kUn(t,r),o=kUn(e,r);return n===o}a(cIs,"urlEquals");function lIs(t){sIs(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),aIs(r)&&e.push(r);return e}a(lIs,"getFieldValues");PUn.exports={urlEquals:cIs,getFieldValues:lIs}});var OUn=I((Ohf,MUn)=>{"use strict";p();var{kConstruct:uIs}=Ust(),{urlEquals:dIs,getFieldValues:usr}=DUn(),{kEnumerableProperty:tX,isDisturbed:fIs}=Ws(),{webidl:xi}=ty(),{Response:pIs,cloneResponse:hIs,fromInnerResponse:mIs}=s2e(),{Request:g8,fromInnerRequest:gIs}=jpe(),{kState:Y2}=Zj(),{fetching:AIs}=c2e(),{urlIsHttpHttpsScheme:Qst,createDeferredPromise:$pe,readAllBytes:yIs}=NT(),dsr=require("node:assert"),qst=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==uIs&&xi.illegalConstructor(),xi.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){xi.brandCheck(this,t);let n="Cache.match";xi.argumentLengthCheck(arguments,1,n),e=xi.converters.RequestInfo(e,n,"request"),r=xi.converters.CacheQueryOptions(r,n,"options");let o=this.#i(e,r,1);if(o.length!==0)return o[0]}async matchAll(e=void 0,r={}){xi.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=xi.converters.RequestInfo(e,n,"request")),r=xi.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){xi.brandCheck(this,t);let r="Cache.add";xi.argumentLengthCheck(arguments,1,r),e=xi.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){xi.brandCheck(this,t);let r="Cache.addAll";xi.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw xi.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=xi.converters.RequestInfo(m),typeof m=="string")continue;let g=m[Y2];if(!Qst(g.url)||g.method!=="GET")throw xi.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=new g8(m)[Y2];if(!Qst(g.url))throw xi.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=$pe();s.push(AIs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(xi.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let _=usr(y.headersList.get("vary"));for(let E of _)if(E==="*"){A.reject(xi.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let v of s)v.abort();return}}},processResponseEndOfBody(y){if(y.aborted){A.reject(new DOMException("aborted","AbortError"));return}A.resolve(y)}})),n.push(A.promise)}let l=await Promise.all(n),u=[],d=0;for(let m of l){let g={type:"put",request:o[d],response:m};u.push(g),d++}let f=$pe(),h=null;try{this.#t(u)}catch(m){h=m}return queueMicrotask(()=>{h===null?f.resolve(void 0):f.reject(h)}),f.promise}async put(e,r){xi.brandCheck(this,t);let n="Cache.put";xi.argumentLengthCheck(arguments,2,n),e=xi.converters.RequestInfo(e,n,"request"),r=xi.converters.Response(r,n,"response");let o=null;if(e instanceof g8?o=e[Y2]:o=new g8(e)[Y2],!Qst(o.url)||o.method!=="GET")throw xi.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[Y2];if(s.status===206)throw xi.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=usr(s.headersList.get("vary"));for(let A of g)if(A==="*")throw xi.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(fIs(s.body.stream)||s.body.stream.locked))throw xi.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=hIs(s),l=$pe();if(s.body!=null){let A=s.body.stream.getReader();yIs(A).then(l.resolve,l.reject)}else l.resolve(void 0);let u=[],d={type:"put",request:o,response:c};u.push(d);let f=await l.promise;c.body!=null&&(c.body.source=f);let h=$pe(),m=null;try{this.#t(u)}catch(g){m=g}return queueMicrotask(()=>{m===null?h.resolve():h.reject(m)}),h.promise}async delete(e,r={}){xi.brandCheck(this,t);let n="Cache.delete";xi.argumentLengthCheck(arguments,1,n),e=xi.converters.RequestInfo(e,n,"request"),r=xi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof g8){if(o=e[Y2],o.method!=="GET"&&!r.ignoreMethod)return!1}else dsr(typeof e=="string"),o=new g8(e)[Y2];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=$pe(),u=null,d;try{d=this.#t(s)}catch(f){u=f}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(e=void 0,r={}){xi.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=xi.converters.RequestInfo(e,n,"request")),r=xi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof g8){if(o=e[Y2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new g8(e)[Y2]);let s=$pe(),c=[];if(e===void 0)for(let l of this.#e)c.push(l[0]);else{let l=this.#r(o,r);for(let u of l)c.push(u[0])}return queueMicrotask(()=>{let l=[];for(let u of c){let d=gIs(u,new AbortController().signal,"immutable");l.push(d)}s.resolve(Object.freeze(l))}),s.promise}#t(e){let r=this.#e,n=[...r],o=[],s=[];try{for(let c of e){if(c.type!=="delete"&&c.type!=="put")throw xi.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw xi.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(c.request,c.options,o).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=this.#r(c.request,c.options),l.length===0)return[];for(let u of l){let d=r.indexOf(u);dsr(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw xi.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!Qst(u.url))throw xi.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw xi.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw xi.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=this.#r(c.request);for(let d of l){let f=r.indexOf(d);dsr(f!==-1),r.splice(f,1)}r.push([c.request,c.response]),o.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw this.#e.length=0,this.#e=n,c}}#r(e,r,n){let o=[],s=n??this.#e;for(let c of s){let[l,u]=c;this.#n(e,l,u,r)&&o.push(c)}return o}#n(e,r,n=null,o){let s=new URL(e.url),c=new URL(r.url);if(o?.ignoreSearch&&(c.search="",s.search=""),!dIs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=usr(n.headersList.get("vary"));for(let u of l){if(u==="*")return!1;let d=r.headersList.get(u),f=e.headersList.get(u);if(d!==f)return!1}return!0}#i(e,r,n=1/0){let o=null;if(e!==void 0)if(e instanceof g8){if(o=e[Y2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new g8(e)[Y2]);let s=[];if(e===void 0)for(let l of this.#e)s.push(l[1]);else{let l=this.#r(o,r);for(let u of l)s.push(u[1])}let c=[];for(let l of s){let u=mIs(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(qst.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:tX,matchAll:tX,add:tX,addAll:tX,put:tX,delete:tX,keys:tX});var NUn=[{key:"ignoreSearch",converter:xi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:xi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:xi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];xi.converters.CacheQueryOptions=xi.dictionaryConverter(NUn);xi.converters.MultiCacheQueryOptions=xi.dictionaryConverter([...NUn,{key:"cacheName",converter:xi.converters.DOMString}]);xi.converters.Response=xi.interfaceConverter(pIs);xi.converters["sequence"]=xi.sequenceConverter(xi.converters.RequestInfo);MUn.exports={Cache:qst}});var BUn=I((Fhf,LUn)=>{"use strict";p();var{kConstruct:u2e}=Ust(),{Cache:jst}=OUn(),{webidl:F_}=ty(),{kEnumerableProperty:d2e}=Ws(),Hst=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==u2e&&F_.illegalConstructor(),F_.util.markAsUncloneable(this)}async match(e,r={}){if(F_.brandCheck(this,t),F_.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=F_.converters.RequestInfo(e),r=F_.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new jst(u2e,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new jst(u2e,n).match(e,r);if(s!==void 0)return s}}async has(e){F_.brandCheck(this,t);let r="CacheStorage.has";return F_.argumentLengthCheck(arguments,1,r),e=F_.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){F_.brandCheck(this,t);let r="CacheStorage.open";if(F_.argumentLengthCheck(arguments,1,r),e=F_.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new jst(u2e,o)}let n=[];return this.#e.set(e,n),new jst(u2e,n)}async delete(e){F_.brandCheck(this,t);let r="CacheStorage.delete";return F_.argumentLengthCheck(arguments,1,r),e=F_.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return F_.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Hst.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:d2e,has:d2e,open:d2e,delete:d2e,keys:d2e});LUn.exports={CacheStorage:Hst}});var UUn=I((qhf,FUn)=>{"use strict";p();FUn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var fsr=I((Hhf,GUn)=>{"use strict";p();function _Is(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(_Is,"isCTLExcludingHtab");function QUn(t){for(let e=0;e126||r===34||r===40||r===41||r===60||r===62||r===64||r===44||r===59||r===58||r===92||r===47||r===91||r===93||r===63||r===61||r===123||r===125)throw new Error("Invalid cookie name")}}a(QUn,"validateCookieName");function qUn(t){let e=t.length,r=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++r}for(;r126||n===34||n===44||n===59||n===92)throw new Error("Invalid cookie value")}}a(qUn,"validateCookieValue");function jUn(t){for(let e=0;ee.toString().padStart(2,"0"));function HUn(t){return typeof t=="number"&&(t=new Date(t)),`${vIs[t.getUTCDay()]}, ${Gst[t.getUTCDate()]} ${CIs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Gst[t.getUTCHours()]}:${Gst[t.getUTCMinutes()]}:${Gst[t.getUTCSeconds()]} GMT`}a(HUn,"toIMFDate");function bIs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(bIs,"validateCookieMaxAge");function SIs(t){if(t.name.length===0)return null;QUn(t.name),qUn(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(bIs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(EIs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(jUn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${HUn(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let r of t.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...o]=r.split("=");e.push(`${n.trim()}=${o.join("=")}`)}return e.join("; ")}a(SIs,"stringify");GUn.exports={isCTLExcludingHtab:_Is,validateCookieName:QUn,validateCookiePath:jUn,validateCookieValue:qUn,toIMFDate:HUn,stringify:SIs}});var VUn=I((Vhf,$Un)=>{"use strict";p();var{maxNameValuePairSize:TIs,maxAttributeValueSize:IIs}=UUn(),{isCTLExcludingHtab:xIs}=fsr(),{collectASequenceOfCodePointsFast:$st}=xb(),wIs=require("node:assert");function RIs(t){if(xIs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=$st(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=$st("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>TIs?null:{name:n,value:o,...Vpe(r)}}a(RIs,"parseSetCookie");function Vpe(t,e={}){if(t.length===0)return e;wIs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=$st(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=$st("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>IIs)return Vpe(t,e);let s=n.toLowerCase();if(s==="expires"){let c=new Date(o);e.expires=c}else if(s==="max-age"){let c=o.charCodeAt(0);if((c<48||c>57)&&o[0]!=="-"||!/^\d+$/.test(o))return Vpe(t,e);let l=Number(o);e.maxAge=l}else if(s==="domain"){let c=o;c[0]==="."&&(c=c.slice(1)),c=c.toLowerCase(),e.domain=c}else if(s==="path"){let c="";o.length===0||o[0]!=="/"?c="/":c=o,e.path=c}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let c="Default",l=o.toLowerCase();l.includes("none")&&(c="None"),l.includes("strict")&&(c="Strict"),l.includes("lax")&&(c="Lax"),e.sameSite=c}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return Vpe(t,e)}a(Vpe,"parseUnparsedAttributes");$Un.exports={parseSetCookie:RIs,parseUnparsedAttributes:Vpe}});var YUn=I((Yhf,zUn)=>{"use strict";p();var{parseSetCookie:kIs}=VUn(),{stringify:PIs}=fsr(),{webidl:Ea}=ty(),{Headers:Vst}=KZ();function DIs(t){Ea.argumentLengthCheck(arguments,1,"getCookies"),Ea.brandCheck(t,Vst,{strict:!1});let e=t.get("cookie"),r={};if(!e)return r;for(let n of e.split(";")){let[o,...s]=n.split("=");r[o.trim()]=s.join("=")}return r}a(DIs,"getCookies");function NIs(t,e,r){Ea.brandCheck(t,Vst,{strict:!1});let n="deleteCookie";Ea.argumentLengthCheck(arguments,2,n),e=Ea.converters.DOMString(e,n,"name"),r=Ea.converters.DeleteCookieAttributes(r),WUn(t,{name:e,value:"",expires:new Date(0),...r})}a(NIs,"deleteCookie");function MIs(t){Ea.argumentLengthCheck(arguments,1,"getSetCookies"),Ea.brandCheck(t,Vst,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>kIs(r)):[]}a(MIs,"getSetCookies");function WUn(t,e){Ea.argumentLengthCheck(arguments,2,"setCookie"),Ea.brandCheck(t,Vst,{strict:!1}),e=Ea.converters.Cookie(e);let r=PIs(e);r&&t.append("Set-Cookie",r)}a(WUn,"setCookie");Ea.converters.DeleteCookieAttributes=Ea.dictionaryConverter([{converter:Ea.nullableConverter(Ea.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.nullableConverter(Ea.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);Ea.converters.Cookie=Ea.dictionaryConverter([{converter:Ea.converters.DOMString,key:"name"},{converter:Ea.converters.DOMString,key:"value"},{converter:Ea.nullableConverter(t=>typeof t=="number"?Ea.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.nullableConverter(Ea.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.nullableConverter(Ea.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.nullableConverter(Ea.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.nullableConverter(Ea.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.nullableConverter(Ea.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Ea.sequenceConverter(Ea.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);zUn.exports={getCookies:DIs,deleteCookie:NIs,getSetCookies:MIs,setCookie:WUn}});var zpe=I((Zhf,JUn)=>{"use strict";p();var{webidl:Ai}=ty(),{kEnumerableProperty:Pb}=Ws(),{kConstruct:KUn}=ef(),{MessagePort:OIs}=require("node:worker_threads"),Wpe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===KUn){super(arguments[1],arguments[2]),Ai.util.markAsUncloneable(this);return}let n="MessageEvent constructor";Ai.argumentLengthCheck(arguments,1,n),e=Ai.converters.DOMString(e,n,"type"),r=Ai.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,Ai.util.markAsUncloneable(this)}get data(){return Ai.brandCheck(this,t),this.#e.data}get origin(){return Ai.brandCheck(this,t),this.#e.origin}get lastEventId(){return Ai.brandCheck(this,t),this.#e.lastEventId}get source(){return Ai.brandCheck(this,t),this.#e.source}get ports(){return Ai.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,r=!1,n=!1,o=null,s="",c="",l=null,u=[]){return Ai.brandCheck(this,t),Ai.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:r,cancelable:n,data:o,origin:s,lastEventId:c,source:l,ports:u})}static createFastMessageEvent(e,r){let n=new t(KUn,e,r);return n.#e=r,n.#e.data??=null,n.#e.origin??="",n.#e.lastEventId??="",n.#e.source??=null,n.#e.ports??=[],n}},{createFastMessageEvent:LIs}=Wpe;delete Wpe.createFastMessageEvent;var Wst=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";Ai.argumentLengthCheck(arguments,1,n),e=Ai.converters.DOMString(e,n,"type"),r=Ai.converters.CloseEventInit(r),super(e,r),this.#e=r,Ai.util.markAsUncloneable(this)}get wasClean(){return Ai.brandCheck(this,t),this.#e.wasClean}get code(){return Ai.brandCheck(this,t),this.#e.code}get reason(){return Ai.brandCheck(this,t),this.#e.reason}},zst=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";Ai.argumentLengthCheck(arguments,1,n),super(e,r),Ai.util.markAsUncloneable(this),e=Ai.converters.DOMString(e,n,"type"),r=Ai.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return Ai.brandCheck(this,t),this.#e.message}get filename(){return Ai.brandCheck(this,t),this.#e.filename}get lineno(){return Ai.brandCheck(this,t),this.#e.lineno}get colno(){return Ai.brandCheck(this,t),this.#e.colno}get error(){return Ai.brandCheck(this,t),this.#e.error}};Object.defineProperties(Wpe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:Pb,origin:Pb,lastEventId:Pb,source:Pb,ports:Pb,initMessageEvent:Pb});Object.defineProperties(Wst.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:Pb,code:Pb,wasClean:Pb});Object.defineProperties(zst.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:Pb,filename:Pb,lineno:Pb,colno:Pb,error:Pb});Ai.converters.MessagePort=Ai.interfaceConverter(OIs);Ai.converters["sequence"]=Ai.sequenceConverter(Ai.converters.MessagePort);var psr=[{key:"bubbles",converter:Ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:Ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:Ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Ai.converters.MessageEventInit=Ai.dictionaryConverter([...psr,{key:"data",converter:Ai.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:Ai.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:Ai.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:Ai.nullableConverter(Ai.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:Ai.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);Ai.converters.CloseEventInit=Ai.dictionaryConverter([...psr,{key:"wasClean",converter:Ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:Ai.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:Ai.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);Ai.converters.ErrorEventInit=Ai.dictionaryConverter([...psr,{key:"message",converter:Ai.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:Ai.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:Ai.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:Ai.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:Ai.converters.any}]);JUn.exports={MessageEvent:Wpe,CloseEvent:Wst,ErrorEvent:zst,createFastMessageEvent:LIs}});var rX=I((tmf,ZUn)=>{"use strict";p();var BIs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",FIs={enumerable:!0,writable:!1,configurable:!1},UIs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},QIs={NOT_SENT:0,PROCESSING:1,SENT:2},qIs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},jIs=2**16-1,HIs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},GIs=Buffer.allocUnsafe(0),$Is={string:1,typedArray:2,arrayBuffer:3,blob:4};ZUn.exports={uid:BIs,sentCloseFrameState:QIs,staticPropertyDescriptors:FIs,states:UIs,opcodes:qIs,maxUnsigned16Bit:jIs,parserStates:HIs,emptyBuffer:GIs,sendHints:$Is}});var f2e=I((nmf,XUn)=>{"use strict";p();XUn.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var m2e=I((omf,c9n)=>{"use strict";p();var{kReadyState:p2e,kController:VIs,kResponse:WIs,kBinaryType:zIs,kWebSocketURL:YIs}=f2e(),{states:h2e,opcodes:pH}=rX(),{ErrorEvent:KIs,createFastMessageEvent:JIs}=zpe(),{isUtf8:ZIs}=require("node:buffer"),{collectASequenceOfCodePointsFast:XIs,removeHTTPWhitespace:e9n}=xb();function exs(t){return t[p2e]===h2e.CONNECTING}a(exs,"isConnecting");function txs(t){return t[p2e]===h2e.OPEN}a(txs,"isEstablished");function rxs(t){return t[p2e]===h2e.CLOSING}a(rxs,"isClosing");function nxs(t){return t[p2e]===h2e.CLOSED}a(nxs,"isClosed");function hsr(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(hsr,"fireEvent");function ixs(t,e,r){if(t[p2e]!==h2e.OPEN)return;let n;if(e===pH.TEXT)try{n=a9n(r)}catch{r9n(t,"Received invalid UTF-8 in text frame.");return}else e===pH.BINARY&&(t[zIs]==="blob"?n=new Blob([r]):n=oxs(r));hsr("message",t,JIs,{origin:t[YIs].origin,data:n})}a(ixs,"websocketMessageReceived");function oxs(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(oxs,"toArrayBuffer");function sxs(t){if(t.length===0)return!1;for(let e=0;e126||r===34||r===40||r===41||r===44||r===47||r===58||r===59||r===60||r===61||r===62||r===63||r===64||r===91||r===92||r===93||r===123||r===125)return!1}return!0}a(sxs,"isValidSubprotocol");function axs(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(axs,"isValidStatusCode");function r9n(t,e){let{[VIs]:r,[WIs]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&hsr("error",t,(o,s)=>new KIs(o,s),{error:new Error(e),message:e})}a(r9n,"failWebsocketConnection");function n9n(t){return t===pH.CLOSE||t===pH.PING||t===pH.PONG}a(n9n,"isControlFrame");function i9n(t){return t===pH.CONTINUATION}a(i9n,"isContinuationFrame");function o9n(t){return t===pH.TEXT||t===pH.BINARY}a(o9n,"isTextBinaryFrame");function cxs(t){return o9n(t)||i9n(t)||n9n(t)}a(cxs,"isValidOpcode");function lxs(t){let e={position:0},r=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}a(uxs,"isValidClientWindowBits");var s9n=typeof process.versions.icu=="string",t9n=s9n?new TextDecoder("utf-8",{fatal:!0}):void 0,a9n=s9n?t9n.decode.bind(t9n):function(t){if(ZIs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};c9n.exports={isConnecting:exs,isEstablished:txs,isClosing:rxs,isClosed:nxs,fireEvent:hsr,isValidSubprotocol:sxs,isValidStatusCode:axs,failWebsocketConnection:r9n,websocketMessageReceived:ixs,utf8Decode:a9n,isControlFrame:n9n,isContinuationFrame:i9n,isTextBinaryFrame:o9n,isValidOpcode:cxs,parseExtensions:lxs,isValidClientWindowBits:uxs}});var Kst=I((cmf,l9n)=>{"use strict";p();var{maxUnsigned16Bit:dxs}=rX(),Yst=16386,msr,g2e=null,Ype=Yst;try{msr=require("node:crypto")}catch{msr={randomFillSync:a(function(e,r,n){for(let o=0;odxs?(c+=8,s=127):o>125&&(c+=2,s=126);let l=Buffer.allocUnsafe(o+c);l[0]=l[1]=0,l[0]|=128,l[0]=(l[0]&240)+e;l[c-4]=n[0],l[c-3]=n[1],l[c-2]=n[2],l[c-1]=n[3],l[1]=s,s===126?l.writeUInt16BE(o,2):s===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),l[1]|=128;for(let u=0;u{"use strict";p();var{uid:pxs,states:A2e,sentCloseFrameState:Jst,emptyBuffer:hxs,opcodes:mxs}=rX(),{kReadyState:y2e,kSentClose:Zst,kByteParser:d9n,kReceivedClose:u9n,kResponse:f9n}=f2e(),{fireEvent:gxs,failWebsocketConnection:hH,isClosing:Axs,isClosed:yxs,isEstablished:_xs,parseExtensions:Exs}=m2e(),{channels:Kpe}=ape(),{CloseEvent:vxs}=zpe(),{makeRequest:Cxs}=jpe(),{fetching:bxs}=c2e(),{Headers:Sxs,getHeadersList:Txs}=KZ(),{getDecodeSplit:Ixs}=NT(),{WebsocketFrameSend:xxs}=Kst(),Asr;try{Asr=require("node:crypto")}catch{}function wxs(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=Cxs({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=Txs(new Sxs(s.headers));l.headersList=h}let u=Asr.randomBytes(16).toString("base64");l.headersList.append("sec-websocket-key",u),l.headersList.append("sec-websocket-version","13");for(let h of e)l.headersList.append("sec-websocket-protocol",h);return l.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits"),bxs({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){hH(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){hH(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){hH(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){hH(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=Asr.createHash("sha1").update(u+pxs).digest("base64");if(m!==g){hH(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=Exs(A),!y.has("permessage-deflate"))){hH(n,"Sec-WebSocket-Extensions header does not match.");return}let _=h.headersList.get("Sec-WebSocket-Protocol");if(_!==null&&!Ixs("sec-websocket-protocol",l.headersList).includes(_)){hH(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",p9n),h.socket.on("close",h9n),h.socket.on("error",m9n),Kpe.open.hasSubscribers&&Kpe.open.publish({address:h.socket.address(),protocol:_,extensions:A}),o(h,y)}})}a(wxs,"establishWebSocketConnection");function Rxs(t,e,r,n){if(!(Axs(t)||yxs(t)))if(!_xs(t))hH(t,"Connection was closed before it was established."),t[y2e]=A2e.CLOSING;else if(t[Zst]===Jst.NOT_SENT){t[Zst]=Jst.PROCESSING;let o=new xxs;e!==void 0&&r===void 0?(o.frameData=Buffer.allocUnsafe(2),o.frameData.writeUInt16BE(e,0)):e!==void 0&&r!==void 0?(o.frameData=Buffer.allocUnsafe(2+n),o.frameData.writeUInt16BE(e,0),o.frameData.write(r,2,"utf-8")):o.frameData=hxs,t[f9n].socket.write(o.createFrame(mxs.CLOSE)),t[Zst]=Jst.SENT,t[y2e]=A2e.CLOSING}else t[y2e]=A2e.CLOSING}a(Rxs,"closeWebSocketConnection");function p9n(t){this.ws[d9n].write(t)||this.pause()}a(p9n,"onSocketData");function h9n(){let{ws:t}=this,{[f9n]:e}=t;e.socket.off("data",p9n),e.socket.off("close",h9n),e.socket.off("error",m9n);let r=t[Zst]===Jst.SENT&&t[u9n],n=1005,o="",s=t[d9n].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[u9n]||(n=1006),t[y2e]=A2e.CLOSED,gxs("close",t,(c,l)=>new vxs(c,l),{wasClean:r,code:n,reason:o}),Kpe.close.hasSubscribers&&Kpe.close.publish({websocket:t,code:n,reason:o})}a(h9n,"onSocketClose");function m9n(t){let{ws:e}=this;e[y2e]=A2e.CLOSING,Kpe.socketError.hasSubscribers&&Kpe.socketError.publish(t),this.destroy()}a(m9n,"onSocketError");g9n.exports={establishWebSocketConnection:wxs,closeWebSocketConnection:Rxs}});var _9n=I((hmf,y9n)=>{"use strict";p();var{createInflateRaw:kxs,Z_DEFAULT_WINDOWBITS:Pxs}=require("node:zlib"),{isValidClientWindowBits:Dxs}=m2e(),{MessageSizeExceededError:A9n}=Rc(),Nxs=Buffer.from([0,0,255,255]),Xst=Symbol("kBuffer"),_2e=Symbol("kLength"),Mxs=4*1024*1024,_sr=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=!1;#n=null;constructor(e){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,r,n){if(this.#r){n(new A9n);return}if(!this.#e){let o=Pxs;if(this.#t.serverMaxWindowBits){if(!Dxs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=kxs({windowBits:o})}catch(s){n(s);return}this.#e[Xst]=[],this.#e[_2e]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[_2e]+=s.length,this.#e[_2e]>Mxs){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new A9n)}return}this.#e[Xst].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(Nxs),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[Xst],this.#e[_2e]);this.#e[Xst].length=0,this.#e[_2e]=0,this.#n=null,n(null,o)})}};y9n.exports={PerMessageDeflate:_sr}});var R9n=I((Amf,w9n)=>{"use strict";p();var{Writable:Oxs}=require("node:stream"),Lxs=require("node:assert"),{parserStates:Db,opcodes:Jpe,states:Bxs,emptyBuffer:E9n,sentCloseFrameState:v9n}=rX(),{kReadyState:Fxs,kSentClose:C9n,kResponse:b9n,kReceivedClose:S9n}=f2e(),{channels:eat}=ape(),{isValidStatusCode:Uxs,isValidOpcode:Qxs,failWebsocketConnection:QT,websocketMessageReceived:T9n,utf8Decode:qxs,isControlFrame:I9n,isTextBinaryFrame:Esr,isContinuationFrame:jxs}=m2e(),{WebsocketFrameSend:x9n}=Kst(),{closeWebSocketConnection:Hxs}=ysr(),{PerMessageDeflate:Gxs}=_9n(),vsr=class extends Oxs{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=Db.INFO;#i={};#o=[];#s;constructor(e,r){super(),this.ws=e,this.#s=r??new Map,this.#s.has("permessage-deflate")&&this.#s.set("permessage-deflate",new Gxs(r))}_write(e,r,n){this.#e.push(e),this.#t+=e.length,this.#r=!0,this.run(n)}run(e){for(;this.#r;)if(this.#n===Db.INFO){if(this.#t<2)return e();let r=this.consume(2),n=(r[0]&128)!==0,o=r[0]&15,s=(r[1]&128)===128,c=!n&&o!==Jpe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!Qxs(o))return QT(this.ws,"Invalid opcode received"),e();if(s)return QT(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){QT(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){QT(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Esr(o)){QT(this.ws,"Invalid frame type was fragmented.");return}if(Esr(o)&&this.#o.length>0){QT(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){QT(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&I9n(o)){QT(this.ws,"Control frame either too large or fragmented");return}if(jxs(o)&&this.#o.length===0&&!this.#i.compressed){QT(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=Db.READ_DATA):l===126?this.#n=Db.PAYLOADLENGTH_16:l===127&&(this.#n=Db.PAYLOADLENGTH_64),Esr(o)&&(this.#i.binaryType=o,this.#i.compressed=u!==0),this.#i.opcode=o,this.#i.masked=s,this.#i.fin=n,this.#i.fragmented=c}else if(this.#n===Db.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=Db.READ_DATA}else if(this.#n===Db.PAYLOADLENGTH_64){if(this.#t<8)return e();let r=this.consume(8),n=r.readUInt32BE(0),o=r.readUInt32BE(4);if(n!==0||o>2**31-1){QT(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=Db.READ_DATA}else if(this.#n===Db.READ_DATA){if(this.#t{if(n){QT(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=Db.INFO,this.#r=!0,this.run(e);return}T9n(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=Db.INFO,this.#o.length=0,this.run(e)}),this.#r=!1;break}else{if(this.#o.push(r),!this.#i.fragmented&&this.#i.fin){let n=Buffer.concat(this.#o);T9n(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=Db.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return E9n;if(this.#e[0].length===e)return this.#t-=this.#e[0].length,this.#e.shift();let r=Buffer.allocUnsafe(e),n=0;for(;n!==e;){let o=this.#e[0],{length:s}=o;if(s+n===e){r.set(this.#e.shift(),n);break}else if(s+n>e){r.set(o.subarray(0,e-n),n),this.#e[0]=o.subarray(e-n);break}else r.set(this.#e.shift(),n),n+=o.length}return this.#t-=e,r}parseCloseBody(e){Lxs(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!Uxs(r))return{code:1002,reason:"Invalid status code",error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=qxs(n)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:r,reason:n,error:!1}}parseControlFrame(e){let{opcode:r,payloadLength:n}=this.#i;if(r===Jpe.CLOSE){if(n===1)return QT(this.ws,"Received close frame with a 1-byte body."),!1;if(this.#i.closeInfo=this.parseCloseBody(e),this.#i.closeInfo.error){let{code:o,reason:s}=this.#i.closeInfo;return Hxs(this.ws,o,s,s.length),QT(this.ws,s),!1}if(this.ws[C9n]!==v9n.SENT){let o=E9n;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new x9n(o);this.ws[b9n].socket.write(s.createFrame(Jpe.CLOSE),c=>{c||(this.ws[C9n]=v9n.SENT)})}return this.ws[Fxs]=Bxs.CLOSING,this.ws[S9n]=!0,!1}else if(r===Jpe.PING){if(!this.ws[S9n]){let o=new x9n(e);this.ws[b9n].socket.write(o.createFrame(Jpe.PONG)),eat.ping.hasSubscribers&&eat.ping.publish({payload:e})}}else r===Jpe.PONG&&eat.pong.hasSubscribers&&eat.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};w9n.exports={ByteParser:vsr}});var M9n=I((Emf,N9n)=>{"use strict";p();var{WebsocketFrameSend:$xs}=Kst(),{opcodes:k9n,sendHints:Zpe}=rX(),Vxs=kir(),P9n=Buffer[Symbol.species],Csr=class{static{a(this,"SendQueue")}#e=new Vxs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==Zpe.blob){let s=D9n(e,n);if(!this.#t)this.#r.write(s,r);else{let c={promise:null,callback:r,frame:s};this.#e.push(c)}return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=D9n(s,n)}),callback:r,frame:null};this.#e.push(o),this.#t||this.#n()}async#n(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let r=e.shift();r.promise!==null&&await r.promise,this.#r.write(r.frame,r.callback),r.callback=r.frame=null}this.#t=!1}};function D9n(t,e){return new $xs(Wxs(t,e)).createFrame(e===Zpe.string?k9n.TEXT:k9n.BINARY)}a(D9n,"createFrame");function Wxs(t,e){switch(e){case Zpe.string:return Buffer.from(t);case Zpe.arrayBuffer:case Zpe.blob:return new P9n(t);case Zpe.typedArray:return new P9n(t.buffer,t.byteOffset,t.byteLength)}}a(Wxs,"toBuffer");N9n.exports={SendQueue:Csr}});var H9n=I((bmf,j9n)=>{"use strict";p();var{webidl:lo}=ty(),{URLSerializer:zxs}=xb(),{environmentSettingsObject:O9n}=NT(),{staticPropertyDescriptors:mH,states:E2e,sentCloseFrameState:Yxs,sendHints:tat}=rX(),{kWebSocketURL:L9n,kReadyState:bsr,kController:Kxs,kBinaryType:rat,kResponse:B9n,kSentClose:Jxs,kByteParser:Zxs}=f2e(),{isConnecting:Xxs,isEstablished:ews,isClosing:tws,isValidSubprotocol:rws,fireEvent:F9n}=m2e(),{establishWebSocketConnection:nws,closeWebSocketConnection:U9n}=ysr(),{ByteParser:iws}=R9n(),{kEnumerableProperty:Zw,isBlobLike:Q9n}=Ws(),{getGlobalDispatcher:ows}=Ast(),{types:q9n}=require("node:util"),{ErrorEvent:sws,CloseEvent:aws}=zpe(),{SendQueue:cws}=M9n(),qT=class t extends EventTarget{static{a(this,"WebSocket")}#e={open:null,error:null,close:null,message:null};#t=0;#r="";#n="";#i;constructor(e,r=[]){super(),lo.util.markAsUncloneable(this);let n="WebSocket constructor";lo.argumentLengthCheck(arguments,1,n);let o=lo.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=lo.converters.USVString(e,n,"url"),r=o.protocols;let s=O9n.settingsObject.baseUrl,c;try{c=new URL(e,s)}catch(u){throw new DOMException(u,"SyntaxError")}if(c.protocol==="http:"?c.protocol="ws:":c.protocol==="https:"&&(c.protocol="wss:"),c.protocol!=="ws:"&&c.protocol!=="wss:")throw new DOMException(`Expected a ws: or wss: protocol, got ${c.protocol}`,"SyntaxError");if(c.hash||c.href.endsWith("#"))throw new DOMException("Got fragment","SyntaxError");if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(u=>u.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(u=>rws(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[L9n]=new URL(c.href);let l=O9n.settingsObject;this[Kxs]=nws(c,r,l,this,(u,d)=>this.#o(u,d),o),this[bsr]=t.CONNECTING,this[Jxs]=Yxs.NOT_SENT,this[rat]="blob"}close(e=void 0,r=void 0){lo.brandCheck(this,t);let n="WebSocket.close";if(e!==void 0&&(e=lo.converters["unsigned short"](e,n,"code",{clamp:!0})),r!==void 0&&(r=lo.converters.USVString(r,n,"reason")),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new DOMException("invalid code","InvalidAccessError");let o=0;if(r!==void 0&&(o=Buffer.byteLength(r),o>123))throw new DOMException(`Reason must be less than 123 bytes; received ${o}`,"SyntaxError");U9n(this,e,r,o)}send(e){lo.brandCheck(this,t);let r="WebSocket.send";if(lo.argumentLengthCheck(arguments,1,r),e=lo.converters.WebSocketSendData(e,r,"data"),Xxs(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!ews(this)||tws(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},tat.string)}else q9n.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},tat.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},tat.typedArray)):Q9n(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},tat.blob))}get readyState(){return lo.brandCheck(this,t),this[bsr]}get bufferedAmount(){return lo.brandCheck(this,t),this.#t}get url(){return lo.brandCheck(this,t),zxs(this[L9n])}get extensions(){return lo.brandCheck(this,t),this.#n}get protocol(){return lo.brandCheck(this,t),this.#r}get onopen(){return lo.brandCheck(this,t),this.#e.open}set onopen(e){lo.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onerror(){return lo.brandCheck(this,t),this.#e.error}set onerror(e){lo.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}get onclose(){return lo.brandCheck(this,t),this.#e.close}set onclose(e){lo.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof e=="function"?(this.#e.close=e,this.addEventListener("close",e)):this.#e.close=null}get onmessage(){return lo.brandCheck(this,t),this.#e.message}set onmessage(e){lo.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get binaryType(){return lo.brandCheck(this,t),this[rat]}set binaryType(e){lo.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[rat]="blob":this[rat]=e}#o(e,r){this[B9n]=e;let n=new iws(this,r);n.on("drain",lws),n.on("error",uws.bind(this)),e.socket.ws=this,this[Zxs]=n,this.#i=new cws(e.socket),this[bsr]=E2e.OPEN;let o=e.headersList.get("sec-websocket-extensions");o!==null&&(this.#n=o);let s=e.headersList.get("sec-websocket-protocol");s!==null&&(this.#r=s),F9n("open",this)}};qT.CONNECTING=qT.prototype.CONNECTING=E2e.CONNECTING;qT.OPEN=qT.prototype.OPEN=E2e.OPEN;qT.CLOSING=qT.prototype.CLOSING=E2e.CLOSING;qT.CLOSED=qT.prototype.CLOSED=E2e.CLOSED;Object.defineProperties(qT.prototype,{CONNECTING:mH,OPEN:mH,CLOSING:mH,CLOSED:mH,url:Zw,readyState:Zw,bufferedAmount:Zw,onopen:Zw,onerror:Zw,onclose:Zw,close:Zw,onmessage:Zw,binaryType:Zw,send:Zw,extensions:Zw,protocol:Zw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(qT,{CONNECTING:mH,OPEN:mH,CLOSING:mH,CLOSED:mH});lo.converters["sequence"]=lo.sequenceConverter(lo.converters.DOMString);lo.converters["DOMString or sequence"]=function(t,e,r){return lo.util.Type(t)==="Object"&&Symbol.iterator in t?lo.converters["sequence"](t):lo.converters.DOMString(t,e,r)};lo.converters.WebSocketInit=lo.dictionaryConverter([{key:"protocols",converter:lo.converters["DOMString or sequence"],defaultValue:a(()=>new Array(0),"defaultValue")},{key:"dispatcher",converter:lo.converters.any,defaultValue:a(()=>ows(),"defaultValue")},{key:"headers",converter:lo.nullableConverter(lo.converters.HeadersInit)}]);lo.converters["DOMString or sequence or WebSocketInit"]=function(t){return lo.util.Type(t)==="Object"&&!(Symbol.iterator in t)?lo.converters.WebSocketInit(t):{protocols:lo.converters["DOMString or sequence"](t)}};lo.converters.WebSocketSendData=function(t){if(lo.util.Type(t)==="Object"){if(Q9n(t))return lo.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||q9n.isArrayBuffer(t))return lo.converters.BufferSource(t)}return lo.converters.USVString(t)};function lws(){this.ws[B9n].socket.resume()}a(lws,"onParserDrain");function uws(t){let e,r;t instanceof aws?(e=t.reason,r=t.code):e=t.message,F9n("error",this,()=>new sws("error",{error:t,message:e})),U9n(this,r)}a(uws,"onParserError");j9n.exports={WebSocket:qT}});var Ssr=I((Imf,G9n)=>{"use strict";p();function dws(t){return t.indexOf("\0")===-1}a(dws,"isValidLastEventId");function fws(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(fws,"isASCIINumber");function pws(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(pws,"delay");G9n.exports={isValidLastEventId:dws,isASCIINumber:fws,delay:pws}});var z9n=I((Rmf,W9n)=>{"use strict";p();var{Transform:hws}=require("node:stream"),{isASCIINumber:$9n,isValidLastEventId:V9n}=Ssr(),A8=[239,187,191],Tsr=10,nat=13,mws=58,gws=32,Isr=class extends hws{static{a(this,"EventSourceStream")}state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,r,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===A8[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===A8[0]&&this.buffer[1]===A8[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===A8[0]&&this.buffer[1]===A8[1]&&this.buffer[2]===A8[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===A8[0]&&this.buffer[1]===A8[1]&&this.buffer[2]===A8[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&$9n(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&V9n(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};W9n.exports={EventSourceStream:Isr}});var r7n=I((Dmf,t7n)=>{"use strict";p();var{pipeline:Aws}=require("node:stream"),{fetching:yws}=c2e(),{makeRequest:_ws}=jpe(),{webidl:y8}=ty(),{EventSourceStream:Ews}=z9n(),{parseMIMEType:vws}=xb(),{createFastMessageEvent:Cws}=zpe(),{isNetworkError:Y9n}=s2e(),{delay:bws}=Ssr(),{kEnumerableProperty:nX}=Ws(),{environmentSettingsObject:K9n}=NT(),J9n=!1,Z9n=3e3,v2e=0,X9n=1,C2e=2,Sws="anonymous",Tws="use-credentials",Xpe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=v2e;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),y8.util.markAsUncloneable(this);let n="EventSource constructor";y8.argumentLengthCheck(arguments,1,n),J9n||(J9n=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=y8.converters.USVString(e,n,"url"),r=y8.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:Z9n};let o=K9n,s;try{s=new URL(e,o.settingsObject.baseUrl),this.#a.origin=s.origin}catch(u){throw new DOMException(u,"SyntaxError")}this.#t=s.href;let c=Sws;r.withCredentials&&(c=Tws,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=K9n.settingsObject,l.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],l.cache="no-store",l.initiator="other",l.urlList=[new URL(this.#t)],this.#i=_ws(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===C2e)return;this.#n=v2e;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{Y9n(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(Y9n(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#u();return}let o=n.headersList.get("content-type",!0),s=o!==null?vws(o):"failure",c=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||c===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=X9n,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new Ews({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(Cws(u.type,u.options))},"push")});Aws(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=yws(e)}async#u(){this.#n!==C2e&&(this.#n=v2e,this.dispatchEvent(new Event("error")),await bws(this.#a.reconnectionTime),this.#n===v2e&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){y8.brandCheck(this,t),this.#n!==C2e&&(this.#n=C2e,this.#o.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}},e7n={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:v2e,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:X9n,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:C2e,writable:!1}};Object.defineProperties(Xpe,e7n);Object.defineProperties(Xpe.prototype,e7n);Object.defineProperties(Xpe.prototype,{close:nX,onerror:nX,onmessage:nX,onopen:nX,readyState:nX,url:nX,withCredentials:nX});y8.converters.EventSourceInitDict=y8.dictionaryConverter([{key:"withCredentials",converter:y8.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:y8.converters.any}]);t7n.exports={EventSource:Xpe,defaultReconnectionTime:Z9n}});var s7n=I((Omf,eo)=>{"use strict";p();var Iws=xpe(),n7n=IPe(),xws=wpe(),wws=eFn(),Rws=Rpe(),kws=Kir(),Pws=SFn(),Dws=kFn(),i7n=Rc(),oat=Ws(),{InvalidArgumentError:iat}=i7n,ehe=g8n(),Nws=wPe(),Mws=Dor(),Ows=Z8n(),Lws=Oor(),Bws=_or(),Fws=ast(),{getGlobalDispatcher:o7n,setGlobalDispatcher:Uws}=Ast(),Qws=yst(),qws=Kot(),jws=Jot();Object.assign(n7n.prototype,ehe);eo.exports.Dispatcher=n7n;eo.exports.Client=Iws;eo.exports.Pool=xws;eo.exports.BalancedPool=wws;eo.exports.Agent=Rws;eo.exports.ProxyAgent=kws;eo.exports.EnvHttpProxyAgent=Pws;eo.exports.RetryAgent=Dws;eo.exports.RetryHandler=Fws;eo.exports.DecoratorHandler=Qws;eo.exports.RedirectHandler=qws;eo.exports.createRedirectInterceptor=jws;eo.exports.interceptors={redirect:o6n(),retry:a6n(),dump:l6n(),dns:f6n()};eo.exports.buildConnector=Nws;eo.exports.errors=i7n;eo.exports.util={parseHeaders:oat.parseHeaders,headerNameToString:oat.headerNameToString};function b2e(t){return(e,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new iat("invalid url");if(r!=null&&typeof r!="object")throw new iat("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new iat("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(oat.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=oat.parseURL(e);let{agent:o,dispatcher:s=o7n()}=r;if(o)throw new iat("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...r,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}a(b2e,"makeDispatcher");eo.exports.setGlobalDispatcher=Uws;eo.exports.getGlobalDispatcher=o7n;var Hws=c2e().fetch;eo.exports.fetch=a(async function(e,r=void 0){try{return await Hws(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");eo.exports.Headers=KZ().Headers;eo.exports.Response=s2e().Response;eo.exports.Request=jpe().Request;eo.exports.FormData=OPe().FormData;eo.exports.File=globalThis.File??require("node:buffer").File;eo.exports.FileReader=wUn().FileReader;var{setGlobalOrigin:Gws,getGlobalOrigin:$ws}=Jnr();eo.exports.setGlobalOrigin=Gws;eo.exports.getGlobalOrigin=$ws;var{CacheStorage:Vws}=BUn(),{kConstruct:Wws}=Ust();eo.exports.caches=new Vws(Wws);var{deleteCookie:zws,getCookies:Yws,getSetCookies:Kws,setCookie:Jws}=YUn();eo.exports.deleteCookie=zws;eo.exports.getCookies=Yws;eo.exports.getSetCookies=Kws;eo.exports.setCookie=Jws;var{parseMIMEType:Zws,serializeAMimeType:Xws}=xb();eo.exports.parseMIMEType=Zws;eo.exports.serializeAMimeType=Xws;var{CloseEvent:eRs,ErrorEvent:tRs,MessageEvent:rRs}=zpe();eo.exports.WebSocket=H9n().WebSocket;eo.exports.CloseEvent=eRs;eo.exports.ErrorEvent=tRs;eo.exports.MessageEvent=rRs;eo.exports.request=b2e(ehe.request);eo.exports.stream=b2e(ehe.stream);eo.exports.pipeline=b2e(ehe.pipeline);eo.exports.connect=b2e(ehe.connect);eo.exports.upgrade=b2e(ehe.upgrade);eo.exports.MockClient=Mws;eo.exports.MockPool=Lws;eo.exports.MockAgent=Ows;eo.exports.mockErrors=Bws;var{EventSource:nRs}=r7n();eo.exports.EventSource=nRs});var Cs=I((Fmf,a7n)=>{p();a7n.exports={options:{usePureJavaScript:!1}}});var u7n=I((Qmf,l7n)=>{p();var xsr={};l7n.exports=xsr;var c7n={};xsr.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=iRs(t,e);else{var o=0,s=e.length,c=e.charAt(0),l=[0];for(o=0;o0;)l.push(d%s),d=d/s|0}for(o=0;t[o]===0&&o=0;--o)n+=e[l[o]]}if(r){var f=new RegExp(".{1,"+r+"}","g");n=n.match(f).join(`\r -`)}return n};xsr.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=c7n[e];if(!r){r=c7n[e]=[];for(var n=0;n>=8;for(;d>0;)c.push(d&255),d>>=8}for(var f=0;t[f]===s&&f0;)s.push(l%n),l=l/n|0}var u="";for(r=0;t.at(r)===0&&r=0;--r)u+=e[s[r]];return u}a(iRs,"_encodeWithByteBuffer")});var Ac=I((Hmf,h7n)=>{p();var d7n=Cs(),f7n=u7n(),nt=h7n.exports=d7n.util=d7n.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){nt.nextTick=process.nextTick,typeof setImmediate=="function"?nt.setImmediate=setImmediate:nt.setImmediate=nt.nextTick;return}if(typeof setImmediate=="function"){nt.setImmediate=function(){return setImmediate.apply(void 0,arguments)},nt.nextTick=function(l){return setImmediate(l)};return}if(nt.setImmediate=function(l){setTimeout(l,0)},typeof window<"u"&&typeof window.postMessage=="function"){let l=function(u){if(u.source===window&&u.data===t){u.stopPropagation();var d=e.slice();e.length=0,d.forEach(function(f){f()})}};var c=l;a(l,"handler");var t="forge.setImmediate",e=[];nt.setImmediate=function(u){e.push(u),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",l,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,o=document.createElement("div"),e=[];new MutationObserver(function(){var u=e.slice();e.length=0,u.forEach(function(d){d()})}).observe(o,{attributes:!0});var s=nt.setImmediate;nt.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),s(u)):(e.push(u),e.length===1&&o.setAttribute("a",n=!n))}}nt.nextTick=nt.setImmediate})();nt.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;nt.globalScope=(function(){return nt.isNodejs?global:typeof self>"u"?window:self})();nt.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};nt.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};nt.isArrayBufferView=function(t){return t&&nt.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function S2e(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(S2e,"_checkBitsParam");nt.ByteBuffer=wsr;function wsr(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(nt.isArrayBuffer(t)||nt.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;roRs&&(this.data.substr(0,1),this._constructedStringLength=0)};nt.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};nt.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};nt.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};nt.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};nt.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};nt.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(nt.encodeUtf8(t))};nt.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};nt.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};nt.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};nt.ByteStringBuffer.prototype.putInt=function(t,e){S2e(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};nt.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};nt.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};nt.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};nt.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};nt.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};nt.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};nt.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};nt.ByteStringBuffer.prototype.copy=function(){var t=nt.createBuffer(this.data);return t.read=this.read,t};nt.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};nt.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};nt.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};nt.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};nt.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};nt.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};nt.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};nt.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};nt.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};nt.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};nt.DataBuffer.prototype.putInt=function(t,e){S2e(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};nt.DataBuffer.prototype.putSignedInt=function(t,e){return S2e(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};nt.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};nt.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};nt.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};nt.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};nt.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};nt.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};nt.DataBuffer.prototype.copy=function(){return new nt.DataBuffer(this)};nt.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};nt.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};nt.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};nt.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};nt.xorBytes=function(t,e,r){for(var n="",o="",s="",c=0,l=0;r>0;--r,++c)o=t.charCodeAt(c)^e.charCodeAt(c),l>=10&&(n+=s,s="",l=0),s+=String.fromCharCode(o),++l;return n+=s,n};nt.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var gH="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",AH=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],p7n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";nt.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=gH.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=gH.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":gH.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};nt.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,o,s,c=0;c>4),o!==64&&(e+=String.fromCharCode((n&15)<<4|o>>2),s!==64&&(e+=String.fromCharCode((o&3)<<6|s)));return e};nt.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};nt.decodeUtf8=function(t){return decodeURIComponent(escape(t))};nt.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:f7n.encode,decode:f7n.decode}};nt.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};nt.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var o=r,s=0;s>2),r+=gH.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=gH.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":gH.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};nt.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var o,s,c,l,u=0,d=r;u>4,c!==64&&(n[d++]=(s&15)<<4|c>>2,l!==64&&(n[d++]=(c&3)<<6|l));return e?d-r:n.subarray(0,d)};nt.binary.base58.encode=function(t,e){return nt.binary.baseN.encode(t,p7n,e)};nt.binary.base58.decode=function(t,e){return nt.binary.baseN.decode(t,p7n,e)};nt.text={utf8:{},utf16:{}};nt.text.utf8.encode=function(t,e,r){t=nt.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var o=r,s=0;s"u"&&(r=["web","flash"]);var o,s=!1,c=null;for(var l in r){o=r[l];try{if(o==="flash"||o==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=o==="flash"}(o==="web"||o==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(u){c=u}if(s)break}if(!s)throw c;return n},"_callStorageFunction");nt.setItem=function(t,e,r,n,o){sat(aRs,arguments,o)};nt.getItem=function(t,e,r,n){return sat(cRs,arguments,n)};nt.removeItem=function(t,e,r,n){sat(lRs,arguments,n)};nt.clearItems=function(t,e,r){sat(uRs,arguments,r)};nt.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};nt.format=function(t){for(var e=/%./g,r,n,o=0,s=[],c=0;r=e.exec(t);){n=t.substring(c,e.lastIndex-2),n.length>0&&s.push(n),c=e.lastIndex;var l=r[0][1];switch(l){case"s":case"o":o");break;case"%":s.push("%");break;default:s.push("<%"+l+"?>")}}return s.push(t.substring(c)),s.join("")};nt.formatNumber=function(t,e,r,n){var o=t,s=isNaN(e=Math.abs(e))?2:e,c=r===void 0?",":r,l=n===void 0?".":n,u=o<0?"-":"",d=parseInt(o=Math.abs(+o||0).toFixed(s),10)+"",f=d.length>3?d.length%3:0;return u+(f?d.substr(0,f)+l:"")+d.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+l)+(s?c+Math.abs(o-d).toFixed(s).slice(2):"")};nt.formatSize=function(t){return t>=1073741824?t=nt.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=nt.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=nt.formatNumber(t/1024,0)+" KiB":t=nt.formatNumber(t,0)+" bytes",t};nt.bytesFromIP=function(t){return t.indexOf(".")!==-1?nt.bytesFromIPv4(t):t.indexOf(":")!==-1?nt.bytesFromIPv6(t):null};nt.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=nt.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var u=r[n];u.end-u.start>0&&(e.splice(u.start,u.end-u.start+1,""),u.start===0&&e.unshift(""),u.end===7&&e.push(""))}return e.join(":")};nt.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in nt&&!t.update)return e(null,nt.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return nt.cores=navigator.hardwareConcurrency,e(null,nt.cores);if(typeof Worker>"u")return nt.cores=1,e(null,nt.cores);if(typeof Blob>"u")return nt.cores=2,e(null,nt.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(c){for(var l=Date.now(),u=l+4;Date.now()g.st&&f.stf.st&&g.st{p();var U0=Cs();Ac();m7n.exports=U0.cipher=U0.cipher||{};U0.cipher.algorithms=U0.cipher.algorithms||{};U0.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=U0.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new U0.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};U0.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=U0.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new U0.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};U0.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),U0.cipher.algorithms[t]=e};U0.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in U0.cipher.algorithms?U0.cipher.algorithms[t]:null};var Psr=U0.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};Psr.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=U0.util.createBuffer(),this.output=t.output||U0.util.createBuffer(),this.mode.start(e)};Psr.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Psr.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Nsr=I((zmf,g7n)=>{p();var Q0=Cs();Ac();Q0.cipher=Q0.cipher||{};var ia=g7n.exports=Q0.cipher.modes=Q0.cipher.modes||{};ia.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};ia.ecb.prototype.start=function(t){};ia.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};ia.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};ia.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=cat(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};ia.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};ia.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Q0.util.createBuffer(),this._partialBytes=0};ia.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cat(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};ia.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};ia.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};ia.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Q0.util.createBuffer(),this._partialBytes=0};ia.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cat(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};ia.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};ia.ofb.prototype.decrypt=ia.ofb.prototype.encrypt;ia.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Q0.util.createBuffer(),this._partialBytes=0};ia.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cat(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};ia.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}lat(this._inBlock)};ia.ctr.prototype.decrypt=ia.ctr.prototype.encrypt;ia.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Q0.util.createBuffer(),this._partialBytes=0,this._R=3774873600};ia.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Q0.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Q0.util.createBuffer(t.additionalData):r=Q0.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Q0.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Dsr(n*8)))}this._inBlock=this._j0.slice(0),lat(this._inBlock),this._partialBytes=0,r=Q0.util.createBuffer(r),this._aDataLength=Dsr(r.length()*8);var o=r.length()%this.blockSize;for(o&&r.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};ia.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),lat(this._inBlock)};ia.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),lat(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var o=0;o0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};ia.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,o=t[n]>>>(7-r%8)*4&15,s=this._m[r][o];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};ia.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};ia.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,o=16*r,s=new Array(o),c=0;c>>1,o=new Array(r);o[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(o[2*s],o[s]=[]),s>>=1;for(s=2;s4){var r=t;t=Q0.util.createBuffer();for(var n=0;n{p();var Lu=Cs();aat();Nsr();Ac();E7n.exports=Lu.aes=Lu.aes||{};Lu.aes.startEncrypting=function(t,e,r,n){var o=uat({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};Lu.aes.createEncryptionCipher=function(t,e){return uat({key:t,output:null,decrypt:!1,mode:e})};Lu.aes.startDecrypting=function(t,e,r,n){var o=uat({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};Lu.aes.createDecryptionCipher=function(t,e){return uat({key:t,output:null,decrypt:!0,mode:e})};Lu.aes.Algorithm=function(t,e){Lsr||y7n();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return Osr(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return Osr(r._w,n,o,!0)},"decrypt")}}),r._init=!1};Lu.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=Lu.util.createBuffer(e);else if(Lu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Lu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,Tv[r]=l,Msr[l]=r,u=t[l],o=t[r],s=t[o],c=t[s],d=u<<24^l<<16^l<<8^(l^u),f=(o^s^c)<<24^(r^c)<<16^(r^s^c)<<8^(r^o^c);for(var h=0;h<4;++h)iX[h][r]=d,K2[h][l]=f,d=d<<24|d>>>8,f=f<<24|f>>>8;r===0?r=n=1:(r=o^t[t[t[o^c]]],n^=t[t[n]])}}a(y7n,"initialize");function _7n(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=the*c,u=s;u>>16&255]<<24^Tv[n>>>8&255]<<16^Tv[n&255]<<8^Tv[n>>>24]^A7n[o]<<24,o++):s>6&&u%s===4&&(n=Tv[n>>>24]<<24^Tv[n>>>16&255]<<16^Tv[n>>>8&255]<<8^Tv[n&255]),r[u]=r[u-s]^n;if(e){var d,f=K2[0],h=K2[1],m=K2[2],g=K2[3],A=r.slice(0);l=r.length;for(var u=0,y=l-the;u>>24]]^h[Tv[d>>>16&255]]^m[Tv[d>>>8&255]]^g[Tv[d&255]];r=A}return r}a(_7n,"_expandKey");function Osr(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=K2[0],c=K2[1],l=K2[2],u=K2[3],d=Msr):(s=iX[0],c=iX[1],l=iX[2],u=iX[3],d=Tv);var f,h,m,g,A,y,_;f=e[0]^t[0],h=e[n?3:1]^t[1],m=e[2]^t[2],g=e[n?1:3]^t[3];for(var E=3,v=1;v>>24]^c[h>>>16&255]^l[m>>>8&255]^u[g&255]^t[++E],y=s[h>>>24]^c[m>>>16&255]^l[g>>>8&255]^u[f&255]^t[++E],_=s[m>>>24]^c[g>>>16&255]^l[f>>>8&255]^u[h&255]^t[++E],g=s[g>>>24]^c[f>>>16&255]^l[h>>>8&255]^u[m&255]^t[++E],f=A,h=y,m=_;r[0]=d[f>>>24]<<24^d[h>>>16&255]<<16^d[m>>>8&255]<<8^d[g&255]^t[++E],r[n?3:1]=d[h>>>24]<<24^d[m>>>16&255]<<16^d[g>>>8&255]<<8^d[f&255]^t[++E],r[2]=d[m>>>24]<<24^d[g>>>16&255]<<16^d[f>>>8&255]<<8^d[h&255]^t[++E],r[n?1:3]=d[g>>>24]<<24^d[f>>>16&255]<<16^d[h>>>8&255]<<8^d[m&255]^t[++E]}a(Osr,"_updateBlock");function uat(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Lu.cipher.createDecipher(r,t.key):n=Lu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Lu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(uat,"_createCipher")});var _H=I((egf,v7n)=>{p();var T2e=Cs();T2e.pki=T2e.pki||{};var Bsr=v7n.exports=T2e.pki.oids=T2e.oids=T2e.oids||{};function ar(t,e){Bsr[t]=e,Bsr[e]=t}a(ar,"_IN");function el(t,e){Bsr[t]=e}a(el,"_I_");ar("1.2.840.113549.1.1.1","rsaEncryption");ar("1.2.840.113549.1.1.4","md5WithRSAEncryption");ar("1.2.840.113549.1.1.5","sha1WithRSAEncryption");ar("1.2.840.113549.1.1.7","RSAES-OAEP");ar("1.2.840.113549.1.1.8","mgf1");ar("1.2.840.113549.1.1.9","pSpecified");ar("1.2.840.113549.1.1.10","RSASSA-PSS");ar("1.2.840.113549.1.1.11","sha256WithRSAEncryption");ar("1.2.840.113549.1.1.12","sha384WithRSAEncryption");ar("1.2.840.113549.1.1.13","sha512WithRSAEncryption");ar("1.3.101.112","EdDSA25519");ar("1.2.840.10040.4.3","dsa-with-sha1");ar("1.3.14.3.2.7","desCBC");ar("1.3.14.3.2.26","sha1");ar("1.3.14.3.2.29","sha1WithRSASignature");ar("2.16.840.1.101.3.4.2.1","sha256");ar("2.16.840.1.101.3.4.2.2","sha384");ar("2.16.840.1.101.3.4.2.3","sha512");ar("2.16.840.1.101.3.4.2.4","sha224");ar("2.16.840.1.101.3.4.2.5","sha512-224");ar("2.16.840.1.101.3.4.2.6","sha512-256");ar("1.2.840.113549.2.2","md2");ar("1.2.840.113549.2.5","md5");ar("1.2.840.113549.1.7.1","data");ar("1.2.840.113549.1.7.2","signedData");ar("1.2.840.113549.1.7.3","envelopedData");ar("1.2.840.113549.1.7.4","signedAndEnvelopedData");ar("1.2.840.113549.1.7.5","digestedData");ar("1.2.840.113549.1.7.6","encryptedData");ar("1.2.840.113549.1.9.1","emailAddress");ar("1.2.840.113549.1.9.2","unstructuredName");ar("1.2.840.113549.1.9.3","contentType");ar("1.2.840.113549.1.9.4","messageDigest");ar("1.2.840.113549.1.9.5","signingTime");ar("1.2.840.113549.1.9.6","counterSignature");ar("1.2.840.113549.1.9.7","challengePassword");ar("1.2.840.113549.1.9.8","unstructuredAddress");ar("1.2.840.113549.1.9.14","extensionRequest");ar("1.2.840.113549.1.9.20","friendlyName");ar("1.2.840.113549.1.9.21","localKeyId");ar("1.2.840.113549.1.9.22.1","x509Certificate");ar("1.2.840.113549.1.12.10.1.1","keyBag");ar("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");ar("1.2.840.113549.1.12.10.1.3","certBag");ar("1.2.840.113549.1.12.10.1.4","crlBag");ar("1.2.840.113549.1.12.10.1.5","secretBag");ar("1.2.840.113549.1.12.10.1.6","safeContentsBag");ar("1.2.840.113549.1.5.13","pkcs5PBES2");ar("1.2.840.113549.1.5.12","pkcs5PBKDF2");ar("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");ar("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");ar("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");ar("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");ar("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");ar("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");ar("1.2.840.113549.2.7","hmacWithSHA1");ar("1.2.840.113549.2.8","hmacWithSHA224");ar("1.2.840.113549.2.9","hmacWithSHA256");ar("1.2.840.113549.2.10","hmacWithSHA384");ar("1.2.840.113549.2.11","hmacWithSHA512");ar("1.2.840.113549.3.7","des-EDE3-CBC");ar("2.16.840.1.101.3.4.1.2","aes128-CBC");ar("2.16.840.1.101.3.4.1.22","aes192-CBC");ar("2.16.840.1.101.3.4.1.42","aes256-CBC");ar("2.5.4.3","commonName");ar("2.5.4.4","surname");ar("2.5.4.5","serialNumber");ar("2.5.4.6","countryName");ar("2.5.4.7","localityName");ar("2.5.4.8","stateOrProvinceName");ar("2.5.4.9","streetAddress");ar("2.5.4.10","organizationName");ar("2.5.4.11","organizationalUnitName");ar("2.5.4.12","title");ar("2.5.4.13","description");ar("2.5.4.15","businessCategory");ar("2.5.4.17","postalCode");ar("2.5.4.42","givenName");ar("2.5.4.65","pseudonym");ar("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");ar("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");ar("2.16.840.1.113730.1.1","nsCertType");ar("2.16.840.1.113730.1.13","nsComment");el("2.5.29.1","authorityKeyIdentifier");el("2.5.29.2","keyAttributes");el("2.5.29.3","certificatePolicies");el("2.5.29.4","keyUsageRestriction");el("2.5.29.5","policyMapping");el("2.5.29.6","subtreesConstraint");el("2.5.29.7","subjectAltName");el("2.5.29.8","issuerAltName");el("2.5.29.9","subjectDirectoryAttributes");el("2.5.29.10","basicConstraints");el("2.5.29.11","nameConstraints");el("2.5.29.12","policyConstraints");el("2.5.29.13","basicConstraints");ar("2.5.29.14","subjectKeyIdentifier");ar("2.5.29.15","keyUsage");el("2.5.29.16","privateKeyUsagePeriod");ar("2.5.29.17","subjectAltName");ar("2.5.29.18","issuerAltName");ar("2.5.29.19","basicConstraints");el("2.5.29.20","cRLNumber");el("2.5.29.21","cRLReason");el("2.5.29.22","expirationDate");el("2.5.29.23","instructionCode");el("2.5.29.24","invalidityDate");el("2.5.29.25","cRLDistributionPoints");el("2.5.29.26","issuingDistributionPoint");el("2.5.29.27","deltaCRLIndicator");el("2.5.29.28","issuingDistributionPoint");el("2.5.29.29","certificateIssuer");el("2.5.29.30","nameConstraints");ar("2.5.29.31","cRLDistributionPoints");ar("2.5.29.32","certificatePolicies");el("2.5.29.33","policyMappings");el("2.5.29.34","policyConstraints");ar("2.5.29.35","authorityKeyIdentifier");el("2.5.29.36","policyConstraints");ar("2.5.29.37","extKeyUsage");el("2.5.29.46","freshestCRL");el("2.5.29.54","inhibitAnyPolicy");ar("1.3.6.1.4.1.11129.2.4.2","timestampList");ar("1.3.6.1.5.5.7.1.1","authorityInfoAccess");ar("1.3.6.1.5.5.7.3.1","serverAuth");ar("1.3.6.1.5.5.7.3.2","clientAuth");ar("1.3.6.1.5.5.7.3.3","codeSigning");ar("1.3.6.1.5.5.7.3.4","emailProtection");ar("1.3.6.1.5.5.7.3.8","timeStamping")});var J2=I((ngf,b7n)=>{p();var Ad=Cs();Ac();_H();var sn=b7n.exports=Ad.asn1=Ad.asn1||{};sn.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};sn.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};sn.maxDepth=256;sn.create=function(t,e,r,n,o){if(Ad.util.isArray(n)){for(var s=[],c=0;ce){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}a(I2e,"_checkBufferLength");var dRs=a(function(t,e){var r=t.getByte();if(e--,r!==128){var n,o=r&128;if(!o)n=r;else{var s=r&127;I2e(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");sn.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"maxDepth"in e||(e.maxDepth=sn.maxDepth),typeof t=="string"&&(t=Ad.util.createBuffer(t));var r=t.length(),n=dat(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var o=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw o.byteCount=r,o.remaining=t.length(),o}return n};function dat(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;I2e(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=dRs(t,e);if(e-=o-t.length(),u!==void 0&&u>e){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=e,d.requested=u,d}u=e}var f,h,m=(s&32)===32;if(m)if(f=[],u===void 0)for(;;){if(I2e(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(dat(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(dat(t,u,r+1,n)),e-=o-t.length(),u-=o-t.length();if(f===void 0&&c===sn.Class.UNIVERSAL&&l===sn.Type.BITSTRING&&(h=t.bytes(u)),f===void 0&&n.decodeBitStrings&&c===sn.Class.UNIVERSAL&&l===sn.Type.BITSTRING&&u>1){var g=t.read,A=e,y=0;if(l===sn.Type.BITSTRING&&(I2e(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var _={strict:!0,decodeBitStrings:!0},E=dat(t,e,r+1,_),v=o-t.length();e-=v,l==sn.Type.BITSTRING&&v++;var S=E.tagClass;v===u&&(S===sn.Class.UNIVERSAL||S===sn.Class.CONTEXT_SPECIFIC)&&(f=[E])}catch{}f===void 0&&(t.read=g,e=A)}if(f===void 0){if(u===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");u=e}if(l===sn.Type.BMPSTRING)for(f="";u>0;u-=2)I2e(t,e,2),f+=String.fromCharCode(t.getInt16()),e-=2;else f=t.getBytes(u),e-=u}var T=h===void 0?null:{bitStringContents:h};return sn.create(c,l,m,f,T)}a(dat,"_fromDer");sn.toDer=function(t){var e=Ad.util.createBuffer(),r=t.tagClass|t.type,n=Ad.util.createBuffer(),o=!1;if("bitStringContents"in t&&(o=!0,t.original&&(o=sn.equals(t,t.original))),o)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&(t.value.charCodeAt(1)&128)===0||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var c=n.length(),l="";do l+=String.fromCharCode(c&255),c=c>>>8;while(c>0);e.putByte(l.length|128);for(var s=l.length-1;s>=0;--s)e.putByte(l.charCodeAt(s))}return e.putBuffer(n),e};sn.oidToDer=function(t){var e=t.split("."),r=Ad.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,o,s,c,l=2;l4294967295)throw new Error("OID value too large; max is 32-bits.");do c=s&127,s=s>>>7,n||(c|=128),o.push(c),n=!1;while(s>0);for(var u=o.length-1;u>=0;--u)r.putByte(o[u])}return r};sn.derToOid=function(t){var e;typeof t=="string"&&(t=Ad.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;){if(n>70368744177663)throw new Error("OID value too large; max is 53-bits.");r=t.getByte(),n=n*128,r&128?n+=r&127:(e+="."+(n+r),n=0)}return e};sn.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,o=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),c=parseInt(t.substr(8,2),10),l=0;if(t.length>11){var u=t.charAt(10),d=10;u!=="+"&&u!=="-"&&(l=parseInt(t.substr(10,2),10),d+=2)}if(e.setUTCFullYear(r,n,o),e.setUTCHours(s,c,l,0),d&&(u=t.charAt(d),u==="+"||u==="-")){var f=parseInt(t.substr(d+1,2),10),h=parseInt(t.substr(d+4,2),10),m=f*60+h;m*=6e4,u==="+"?e.setTime(+e-m):e.setTime(+e+m)}return e};sn.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,o=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),c=parseInt(t.substr(10,2),10),l=parseInt(t.substr(12,2),10),u=0,d=0,f=!1;t.charAt(t.length-1)==="Z"&&(f=!0);var h=t.length-5,m=t.charAt(h);if(m==="+"||m==="-"){var g=parseInt(t.substr(h+1,2),10),A=parseInt(t.substr(h+4,2),10);d=g*60+A,d*=6e4,m==="+"&&(d*=-1),f=!0}return t.charAt(14)==="."&&(u=parseFloat(t.substr(14),10)*1e3),f?(e.setUTCFullYear(r,n,o),e.setUTCHours(s,c,l,u),e.setTime(+e+d)):(e.setFullYear(r,n,o),e.setHours(s,c,l,u)),e};sn.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};sn.derToInteger=function(t){typeof t=="string"&&(t=Ad.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};sn.validate=function(t,e,r,n){var o=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(o=!0,e.value&&Ad.util.isArray(e.value))for(var s=0,c=0;o&&c0&&(n+=` +`.trim())}};X8n.exports=Uor});var Ast=I((Fpf,i6n)=>{"use strict";p();var t6n=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:JSs}=Rc(),ZSs=kpe();n6n()===void 0&&r6n(new ZSs);function r6n(t){if(!t||typeof t.dispatch!="function")throw new JSs("Argument agent must implement Agent");Object.defineProperty(globalThis,t6n,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(r6n,"setGlobalDispatcher");function n6n(){return globalThis[t6n]}a(n6n,"getGlobalDispatcher");i6n.exports={setGlobalDispatcher:r6n,getGlobalDispatcher:n6n}});var yst=I((jpf,o6n)=>{"use strict";p();o6n.exports=class{static{a(this,"DecoratorHandler")}#e;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}});var a6n=I(($pf,s6n)=>{"use strict";p();var XSs=Kot();s6n.exports=t=>{let e=t?.maxRedirections;return r=>a(function(o,s){let{maxRedirections:c=e,...l}=o;if(!c)return r(o,s);let u=new XSs(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var l6n=I((zpf,c6n)=>{"use strict";p();var e1s=ast();c6n.exports=t=>e=>a(function(n,o){return e(n,new e1s({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var d6n=I((Jpf,u6n)=>{"use strict";p();var t1s=Ws(),{InvalidArgumentError:r1s,RequestAbortedError:n1s}=Rc(),i1s=yst(),Qor=class extends i1s{static{a(this,"DumpHandler")}#e=1024*1024;#t=null;#r=!1;#n=!1;#i=0;#o=null;#s=null;constructor({maxSize:e},r){if(super(r),e!=null&&(!Number.isFinite(e)||e<1))throw new r1s("maxSize must be a number greater than 0");this.#e=e??this.#e,this.#s=r}onConnect(e){this.#t=e,this.#s.onConnect(this.#a.bind(this))}#a(e){this.#n=!0,this.#o=e}onHeaders(e,r,n,o){let c=t1s.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new n1s(`Response size (${c}) larger than maxSize (${this.#e})`);return this.#n?!0:this.#s.onHeaders(e,r,n,o)}onError(e){this.#r||(e=this.#o??e,this.#s.onError(e))}onData(e){return this.#i=this.#i+e.length,this.#i>=this.#e&&(this.#r=!0,this.#n?this.#s.onError(this.#o):this.#s.onComplete([])),!0}onComplete(e){if(!this.#r){if(this.#n){this.#s.onError(this.reason);return}this.#s.onComplete(e)}}};function o1s({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new Qor({maxSize:s},o);return e(n,c)},"Intercept")}a(o1s,"createDumpInterceptor");u6n.exports=o1s});var h6n=I((ehf,p6n)=>{"use strict";p();var{isIP:s1s}=require("node:net"),{lookup:a1s}=require("node:dns"),c1s=yst(),{InvalidArgumentError:Qpe,InformationalError:l1s}=Rc(),f6n=Math.pow(2,31)-1,qor=class{static{a(this,"DNSInstance")}#e=0;#t=0;#r=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#n,this.pick=e.pick??this.#i}get full(){return this.#r.size===this.#t}runLookup(e,r,n){let o=this.#r.get(e.hostname);if(o==null&&this.full){n(null,e.origin);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(o==null)this.lookup(e,s,(c,l)=>{if(c||l==null||l.length===0){n(c??new l1s("No DNS entries found"));return}this.setRecords(e,l);let u=this.#r.get(e.hostname),d=this.pick(e,u,s.affinity),f;typeof d.port=="number"?f=`:${d.port}`:e.port!==""?f=`:${e.port}`:f="",n(null,`${e.protocol}//${d.family===6?`[${d.address}]`:d.address}${f}`)});else{let c=this.pick(e,o,s.affinity);if(c==null){this.#r.delete(e.hostname),this.runLookup(e,r,n);return}let l;typeof c.port=="number"?l=`:${c.port}`:e.port!==""?l=`:${e.port}`:l="",n(null,`${e.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`)}}#n(e,r,n){a1s(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(o,s)=>{if(o)return n(o);let c=new Map;for(let l of s)c.set(`${l.address}:${l.family}`,l);n(null,c.values())})}#i(e,r,n){let o=null,{records:s,offset:c}=r,l;if(this.dualStack?(n==null&&(c==null||c===f6n?(r.offset=0,n=4):(r.offset++,n=(r.offset&1)===1?6:4)),s[n]!=null&&s[n].ips.length>0?l=s[n]:l=s[n===4?6:4]):l=s[n],l==null||l.ips.length===0)return o;l.offset==null||l.offset===f6n?l.offset=0:l.offset++;let u=l.offset%l.ips.length;return o=l.ips[u]??null,o==null?o:Date.now()-o.timestamp>o.ttl?(l.ips.splice(u,1),this.pick(e,r,n)):o}setRecords(e,r){let n=Date.now(),o={records:{4:null,6:null}};for(let s of r){s.timestamp=n,typeof s.ttl=="number"?s.ttl=Math.min(s.ttl,this.#e):s.ttl=this.#e;let c=o.records[s.family]??{ips:[]};c.ips.push(s),o.records[s.family]=c}this.#r.set(e.hostname,o)}getHandler(e,r){return new jor(this,e,r)}},jor=class extends c1s{static{a(this,"DNSDispatchHandler")}#e=null;#t=null;#r=null;#n=null;#i=null;constructor(e,{origin:r,handler:n,dispatch:o},s){super(n),this.#i=r,this.#n=n,this.#t={...s},this.#e=e,this.#r=o}onError(e){switch(e.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){this.#e.runLookup(this.#i,this.#t,(r,n)=>{if(r)return this.#n.onError(r);let o={...this.#t,origin:n};this.#r(o,this)});return}this.#n.onError(e);return}case"ENOTFOUND":this.#e.deleteRecord(this.#i);default:this.#n.onError(e);break}}};p6n.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new Qpe("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new Qpe("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new Qpe("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new Qpe("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new Qpe("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new Qpe("Invalid pick. Must be a function");let e=t?.dualStack??!0,r;e?r=t?.affinity??null:r=t?.affinity??4;let n={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:r,maxItems:t?.maxItems??1/0},o=new qor(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return s1s(d.hostname)!==0?s(l,u):(o.runLookup(d,l,(f,h)=>{if(f)return u.onError(f);let m=null;m={...l,servername:d.hostname,origin:h,headers:{host:d.hostname,...l.headers}},s(m,o.getHandler({origin:d,dispatch:s,handler:u},l))}),!0)},"dnsInterceptor")}});var JZ=I((nhf,v6n)=>{"use strict";p();var{kConstruct:u1s}=tf(),{kEnumerableProperty:qpe}=Ws(),{iteratorMixin:d1s,isValidHeaderName:i2e,isValidHeaderValue:g6n}=NT(),{webidl:ec}=ty(),Hor=require("node:assert"),_st=require("node:util"),Cm=Symbol("headers map"),LT=Symbol("headers map sorted");function m6n(t){return t===10||t===13||t===9||t===32}a(m6n,"isHTTPWhiteSpaceCharCode");function A6n(t){let e=0,r=t.length;for(;r>e&&m6n(t.charCodeAt(r-1));)--r;for(;r>e&&m6n(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(A6n,"headerValueNormalize");function y6n(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(y6n,"fill");function Gor(t,e,r){if(r=A6n(r),i2e(e)){if(!g6n(r))throw ec.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw ec.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(E6n(t)==="immutable")throw new TypeError("immutable");return $or(t).append(e,r,!1)}a(Gor,"appendHeader");function _6n(t,e){return t[0]>1),r[d][0]<=f[0]?u=d+1:l=d;if(s!==d){for(c=s;c>u;)r[c]=r[--c];r[u]=f}}if(!n.next().done)throw new TypeError("Unreachable");return r}else{let n=0;for(let{0:o,1:{value:s}}of this[Cm])r[n++]=[o,s],Hor(s!==null);return r.sort(_6n)}}},W2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){ec.util.markAsUncloneable(this),e!==u1s&&(this.#t=new Est,this.#e="none",e!==void 0&&(e=ec.converters.HeadersInit(e,"Headers contructor","init"),y6n(this,e)))}append(e,r){ec.brandCheck(this,t),ec.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=ec.converters.ByteString(e,n,"name"),r=ec.converters.ByteString(r,n,"value"),Gor(this,e,r)}delete(e){if(ec.brandCheck(this,t),ec.argumentLengthCheck(arguments,1,"Headers.delete"),e=ec.converters.ByteString(e,"Headers.delete","name"),!i2e(e))throw ec.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){ec.brandCheck(this,t),ec.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=ec.converters.ByteString(e,r,"name"),!i2e(e))throw ec.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){ec.brandCheck(this,t),ec.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=ec.converters.ByteString(e,r,"name"),!i2e(e))throw ec.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){ec.brandCheck(this,t),ec.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=ec.converters.ByteString(e,n,"name"),r=ec.converters.ByteString(r,n,"value"),r=A6n(r),i2e(e)){if(!g6n(r))throw ec.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw ec.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){ec.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[LT](){if(this.#t[LT])return this.#t[LT];let e=[],r=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[LT]=r;for(let o=0;o>"](t,e,r,n.bind(t)):ec.converters["record"](t,e,r)}throw ec.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};v6n.exports={fill:y6n,compareHeaderName:_6n,Headers:W2,HeadersList:Est,getHeadersGuard:E6n,setHeadersGuard:f1s,setHeadersList:p1s,getHeadersList:$or}});var s2e=I((shf,N6n)=>{"use strict";p();var{Headers:x6n,HeadersList:C6n,fill:h1s,getHeadersGuard:m1s,setHeadersGuard:w6n,setHeadersList:R6n}=JZ(),{extractBody:b6n,cloneBody:g1s,mixinBody:A1s,hasFinalizationRegistry:k6n,streamRegistry:P6n,bodyUnusable:y1s}=vpe(),Vor=Ws(),S6n=require("node:util"),{kEnumerableProperty:BT}=Vor,{isValidReasonPhrase:_1s,isCancelled:E1s,isAborted:v1s,isBlobLike:C1s,serializeJavascriptValueToJSONString:b1s,isErrorLike:S1s,isomorphicEncode:T1s,environmentSettingsObject:I1s}=NT(),{redirectStatusSet:x1s,nullBodyStatus:w1s}=RPe(),{kState:nf,kHeaders:m8}=Zj(),{webidl:ds}=ty(),{FormData:R1s}=OPe(),{URLSerializer:T6n}=xb(),{kConstruct:Cst}=tf(),Wor=require("node:assert"),{types:k1s}=require("node:util"),P1s=new TextEncoder("utf-8"),ZZ=class t{static{a(this,"Response")}static error(){return o2e(bst(),"immutable")}static json(e,r={}){ds.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ds.converters.ResponseInit(r));let n=P1s.encode(b1s(e)),o=b6n(n),s=o2e(jpe({}),"response");return I6n(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ds.argumentLengthCheck(arguments,1,"Response.redirect"),e=ds.converters.USVString(e),r=ds.converters["unsigned short"](r);let n;try{n=new URL(e,I1s.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!x1s.has(r))throw new RangeError(`Invalid status code ${r}`);let o=o2e(jpe({}),"immutable");o[nf].status=r;let s=T1s(T6n(n));return o[nf].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(ds.util.markAsUncloneable(this),e===Cst)return;e!==null&&(e=ds.converters.BodyInit(e)),r=ds.converters.ResponseInit(r),this[nf]=jpe({}),this[m8]=new x6n(Cst),w6n(this[m8],"response"),R6n(this[m8],this[nf].headersList);let n=null;if(e!=null){let[o,s]=b6n(e);n={body:o,type:s}}I6n(this,r,n)}get type(){return ds.brandCheck(this,t),this[nf].type}get url(){ds.brandCheck(this,t);let e=this[nf].urlList,r=e[e.length-1]??null;return r===null?"":T6n(r,!0)}get redirected(){return ds.brandCheck(this,t),this[nf].urlList.length>1}get status(){return ds.brandCheck(this,t),this[nf].status}get ok(){return ds.brandCheck(this,t),this[nf].status>=200&&this[nf].status<=299}get statusText(){return ds.brandCheck(this,t),this[nf].statusText}get headers(){return ds.brandCheck(this,t),this[m8]}get body(){return ds.brandCheck(this,t),this[nf].body?this[nf].body.stream:null}get bodyUsed(){return ds.brandCheck(this,t),!!this[nf].body&&Vor.isDisturbed(this[nf].body.stream)}clone(){if(ds.brandCheck(this,t),y1s(this))throw ds.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=zor(this[nf]);return k6n&&this[nf].body?.stream&&P6n.register(this,new WeakRef(this[nf].body.stream)),o2e(e,m1s(this[m8]))}[S6n.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${S6n.formatWithOptions(r,n)}`}};A1s(ZZ);Object.defineProperties(ZZ.prototype,{type:BT,url:BT,status:BT,ok:BT,redirected:BT,statusText:BT,headers:BT,clone:BT,body:BT,bodyUsed:BT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(ZZ,{json:BT,redirect:BT,error:BT});function zor(t){if(t.internalResponse)return D6n(zor(t.internalResponse),t.type);let e=jpe({...t,body:null});return t.body!=null&&(e.body=g1s(e,t.body)),e}a(zor,"cloneResponse");function jpe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new C6n(t?.headersList):new C6n,urlList:t?.urlList?[...t.urlList]:[]}}a(jpe,"makeResponse");function bst(t){let e=S1s(t);return jpe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(bst,"makeNetworkError");function D1s(t){return t.type==="error"&&t.status===0}a(D1s,"isNetworkError");function vst(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(r,n){return n in e?e[n]:r[n]},set(r,n,o){return Wor(!(n in e)),r[n]=o,!0}})}a(vst,"makeFilteredResponse");function D6n(t,e){if(e==="basic")return vst(t,{type:"basic",headersList:t.headersList});if(e==="cors")return vst(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return vst(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return vst(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});Wor(!1)}a(D6n,"filterResponse");function N1s(t,e=null){return Wor(E1s(t)),v1s(t)?bst(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):bst(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(N1s,"makeAppropriateNetworkError");function I6n(t,e,r){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!_1s(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[nf].status=e.status),"statusText"in e&&e.statusText!=null&&(t[nf].statusText=e.statusText),"headers"in e&&e.headers!=null&&h1s(t[m8],e.headers),r){if(w1s.includes(t.status))throw ds.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[nf].body=r.body,r.type!=null&&!t[nf].headersList.contains("content-type",!0)&&t[nf].headersList.append("content-type",r.type,!0)}}a(I6n,"initializeResponse");function o2e(t,e){let r=new ZZ(Cst);return r[nf]=t,r[m8]=new x6n(Cst),R6n(r[m8],t.headersList),w6n(r[m8],e),k6n&&t.body?.stream&&P6n.register(r,new WeakRef(t.body.stream)),r}a(o2e,"fromInnerResponse");ds.converters.ReadableStream=ds.interfaceConverter(ReadableStream);ds.converters.FormData=ds.interfaceConverter(R1s);ds.converters.URLSearchParams=ds.interfaceConverter(URLSearchParams);ds.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ds.converters.USVString(t,e,r):C1s(t)?ds.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||k1s.isArrayBuffer(t)?ds.converters.BufferSource(t,e,r):Vor.isFormDataLike(t)?ds.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?ds.converters.URLSearchParams(t,e,r):ds.converters.DOMString(t,e,r)};ds.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?ds.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:ds.converters.XMLHttpRequestBodyInit(t,e,r)};ds.converters.ResponseInit=ds.dictionaryConverter([{key:"status",converter:ds.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ds.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ds.converters.HeadersInit}]);N6n.exports={isNetworkError:D1s,makeNetworkError:bst,makeResponse:jpe,makeAppropriateNetworkError:N1s,filterResponse:D6n,Response:ZZ,cloneResponse:zor,fromInnerResponse:o2e}});var B6n=I((lhf,L6n)=>{"use strict";p();var{kConnected:M6n,kSize:O6n}=tf(),Yor=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[M6n]===0&&this.value[O6n]===0?void 0:this.value}},Kor=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[M6n]===0&&e[O6n]===0&&this.finalizer(r)})}unregister(e){}};L6n.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:Yor,FinalizationRegistry:Kor}):{WeakRef,FinalizationRegistry}}});var Hpe=I((fhf,Z6n)=>{"use strict";p();var{extractBody:M1s,mixinBody:O1s,cloneBody:L1s,bodyUnusable:F6n}=vpe(),{Headers:W6n,fill:B1s,HeadersList:xst,setHeadersGuard:Zor,getHeadersGuard:F1s,setHeadersList:z6n,getHeadersList:U6n}=JZ(),{FinalizationRegistry:U1s}=B6n()(),Tst=Ws(),Q6n=require("node:util"),{isValidHTTPToken:Q1s,sameOrigin:q6n,environmentSettingsObject:Sst}=NT(),{forbiddenMethodsSet:q1s,corsSafeListedMethodsSet:j1s,referrerPolicy:H1s,requestRedirect:G1s,requestMode:$1s,requestCredentials:V1s,requestCache:W1s,requestDuplex:z1s}=RPe(),{kEnumerableProperty:bm,normalizedMethodRecordsBase:Y1s,normalizedMethodRecords:K1s}=Tst,{kHeaders:FT,kSignal:Ist,kState:gd,kDispatcher:Jor}=Zj(),{webidl:Wi}=ty(),{URLSerializer:J1s}=xb(),{kConstruct:wst}=tf(),Z1s=require("node:assert"),{getMaxListeners:j6n,setMaxListeners:H6n,getEventListeners:X1s,defaultMaxListeners:G6n}=require("node:events"),eTs=Symbol("abortController"),Y6n=new U1s(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Rst=new WeakMap;function $6n(t){return e;function e(){let r=t.deref();if(r!==void 0){Y6n.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Rst.get(r.signal);if(n!==void 0){if(n.size!==0){for(let o of n){let s=o.deref();s!==void 0&&s.abort(this.reason)}n.clear()}Rst.delete(r.signal)}}}}a($6n,"buildAbort");var V6n=!1,uH=class t{static{a(this,"Request")}constructor(e,r={}){if(Wi.util.markAsUncloneable(this),e===wst)return;let n="Request constructor";Wi.argumentLengthCheck(arguments,1,n),e=Wi.converters.RequestInfo(e,n,"input"),r=Wi.converters.RequestInit(r,n,"init");let o=null,s=null,c=Sst.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[Jor]=r.dispatcher;let E;try{E=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(E.username||E.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=kst({urlList:[E]}),s="cors"}else this[Jor]=r.dispatcher||e[Jor],Z1s(e instanceof t),o=e[gd],l=e[Ist];let u=Sst.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&q6n(o.window,u)&&(d=o.window),r.window!=null)throw new TypeError(`'window' option '${d}' must be null`);"window"in r&&(d="no-window"),o=kst({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Sst.settingsObject,window:d,priority:o.priority,origin:o.origin,referrer:o.referrer,referrerPolicy:o.referrerPolicy,mode:o.mode,credentials:o.credentials,cache:o.cache,redirect:o.redirect,integrity:o.integrity,keepalive:o.keepalive,reloadNavigation:o.reloadNavigation,historyNavigation:o.historyNavigation,urlList:[...o.urlList]});let f=Object.keys(r).length!==0;if(f&&(o.mode==="navigate"&&(o.mode="same-origin"),o.reloadNavigation=!1,o.historyNavigation=!1,o.origin="client",o.referrer="client",o.referrerPolicy="",o.url=o.urlList[o.urlList.length-1],o.urlList=[o.url]),r.referrer!==void 0){let E=r.referrer;if(E==="")o.referrer="no-referrer";else{let v;try{v=new URL(E,c)}catch(S){throw new TypeError(`Referrer "${E}" is not a valid URL.`,{cause:S})}v.protocol==="about:"&&v.hostname==="client"||u&&!q6n(v,Sst.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw Wi.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let E=r.method,v=K1s[E];if(v!==void 0)o.method=v;else{if(!Q1s(E))throw new TypeError(`'${E}' is not a valid HTTP method.`);let S=E.toUpperCase();if(q1s.has(S))throw new TypeError(`'${E}' HTTP method is unsupported.`);E=Y1s[S]??E,o.method=E}!V6n&&o.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),V6n=!0)}r.signal!==void 0&&(l=r.signal),this[gd]=o;let m=new AbortController;if(this[Ist]=m.signal,l!=null){if(!l||typeof l.aborted!="boolean"||typeof l.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(l.aborted)m.abort(l.reason);else{this[eTs]=m;let E=new WeakRef(m),v=$6n(E);try{(typeof j6n=="function"&&j6n(l)===G6n||X1s(l,"abort").length>=G6n)&&H6n(1500,l)}catch{}Tst.addAbortListener(l,v),Y6n.register(m,{signal:l,abort:v},v)}}if(this[FT]=new W6n(wst),z6n(this[FT],o.headersList),Zor(this[FT],"request"),h==="no-cors"){if(!j1s.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);Zor(this[FT],"request-no-cors")}if(f){let E=U6n(this[FT]),v=r.headers!==void 0?r.headers:new xst(E);if(E.clear(),v instanceof xst){for(let{name:S,value:T}of v.rawValues())E.append(S,T,!1);E.cookies=v.cookies}else B1s(this[FT],v)}let g=e instanceof t?e[gd].body:null;if((r.body!=null||g!=null)&&(o.method==="GET"||o.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let A=null;if(r.body!=null){let[E,v]=M1s(r.body,o.keepalive);A=E,v&&!U6n(this[FT]).contains("content-type",!0)&&this[FT].append("content-type",v)}let y=A??g;if(y!=null&&y.source==null){if(A!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(o.mode!=="same-origin"&&o.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');o.useCORSPreflightFlag=!0}let _=y;if(A==null&&g!=null){if(F6n(e))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let E=new TransformStream;g.stream.pipeThrough(E),_={source:g.source,length:g.length,stream:E.readable}}this[gd].body=_}get method(){return Wi.brandCheck(this,t),this[gd].method}get url(){return Wi.brandCheck(this,t),J1s(this[gd].url)}get headers(){return Wi.brandCheck(this,t),this[FT]}get destination(){return Wi.brandCheck(this,t),this[gd].destination}get referrer(){return Wi.brandCheck(this,t),this[gd].referrer==="no-referrer"?"":this[gd].referrer==="client"?"about:client":this[gd].referrer.toString()}get referrerPolicy(){return Wi.brandCheck(this,t),this[gd].referrerPolicy}get mode(){return Wi.brandCheck(this,t),this[gd].mode}get credentials(){return this[gd].credentials}get cache(){return Wi.brandCheck(this,t),this[gd].cache}get redirect(){return Wi.brandCheck(this,t),this[gd].redirect}get integrity(){return Wi.brandCheck(this,t),this[gd].integrity}get keepalive(){return Wi.brandCheck(this,t),this[gd].keepalive}get isReloadNavigation(){return Wi.brandCheck(this,t),this[gd].reloadNavigation}get isHistoryNavigation(){return Wi.brandCheck(this,t),this[gd].historyNavigation}get signal(){return Wi.brandCheck(this,t),this[Ist]}get body(){return Wi.brandCheck(this,t),this[gd].body?this[gd].body.stream:null}get bodyUsed(){return Wi.brandCheck(this,t),!!this[gd].body&&Tst.isDisturbed(this[gd].body.stream)}get duplex(){return Wi.brandCheck(this,t),"half"}clone(){if(Wi.brandCheck(this,t),F6n(this))throw new TypeError("unusable");let e=K6n(this[gd]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Rst.get(this.signal);n===void 0&&(n=new Set,Rst.set(this.signal,n));let o=new WeakRef(r);n.add(o),Tst.addAbortListener(r.signal,$6n(o))}return J6n(e,r.signal,F1s(this[FT]))}[Q6n.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${Q6n.formatWithOptions(r,n)}`}};O1s(uH);function kst(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new xst(t.headersList):new xst}}a(kst,"makeRequest");function K6n(t){let e=kst({...t,body:null});return t.body!=null&&(e.body=L1s(e,t.body)),e}a(K6n,"cloneRequest");function J6n(t,e,r){let n=new uH(wst);return n[gd]=t,n[Ist]=e,n[FT]=new W6n(wst),z6n(n[FT],t.headersList),Zor(n[FT],r),n}a(J6n,"fromInnerRequest");Object.defineProperties(uH.prototype,{method:bm,url:bm,headers:bm,redirect:bm,clone:bm,signal:bm,duplex:bm,destination:bm,body:bm,bodyUsed:bm,isHistoryNavigation:bm,isReloadNavigation:bm,keepalive:bm,integrity:bm,cache:bm,credentials:bm,attribute:bm,referrerPolicy:bm,referrer:bm,mode:bm,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Wi.converters.Request=Wi.interfaceConverter(uH);Wi.converters.RequestInfo=function(t,e,r){return typeof t=="string"?Wi.converters.USVString(t,e,r):t instanceof uH?Wi.converters.Request(t,e,r):Wi.converters.USVString(t,e,r)};Wi.converters.AbortSignal=Wi.interfaceConverter(AbortSignal);Wi.converters.RequestInit=Wi.dictionaryConverter([{key:"method",converter:Wi.converters.ByteString},{key:"headers",converter:Wi.converters.HeadersInit},{key:"body",converter:Wi.nullableConverter(Wi.converters.BodyInit)},{key:"referrer",converter:Wi.converters.USVString},{key:"referrerPolicy",converter:Wi.converters.DOMString,allowedValues:H1s},{key:"mode",converter:Wi.converters.DOMString,allowedValues:$1s},{key:"credentials",converter:Wi.converters.DOMString,allowedValues:V1s},{key:"cache",converter:Wi.converters.DOMString,allowedValues:W1s},{key:"redirect",converter:Wi.converters.DOMString,allowedValues:G1s},{key:"integrity",converter:Wi.converters.DOMString},{key:"keepalive",converter:Wi.converters.boolean},{key:"signal",converter:Wi.nullableConverter(t=>Wi.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:Wi.converters.any},{key:"duplex",converter:Wi.converters.DOMString,allowedValues:z1s},{key:"dispatcher",converter:Wi.converters.any}]);Z6n.exports={Request:uH,makeRequest:kst,fromInnerRequest:J6n,cloneRequest:K6n}});var c2e=I((mhf,pUn)=>{"use strict";p();var{makeNetworkError:gl,makeAppropriateNetworkError:Pst,filterResponse:Xor,makeResponse:Dst,fromInnerResponse:tTs}=s2e(),{HeadersList:X6n}=JZ(),{Request:rTs,cloneRequest:nTs}=Hpe(),dH=require("node:zlib"),{bytesMatch:iTs,makePolicyContainer:oTs,clonePolicyContainer:sTs,requestBadPort:aTs,TAOCheck:cTs,appendRequestOriginHeader:lTs,responseLocationURL:uTs,requestCurrentURL:e4,setRequestReferrerPolicyOnRedirect:dTs,tryUpgradeRequestToAPotentiallyTrustworthyURL:fTs,createOpaqueTimingInfo:isr,appendFetchMetadata:pTs,corsCheck:hTs,crossOriginResourcePolicyCheck:mTs,determineRequestsReferrer:gTs,coarsenedSharedCurrentTime:a2e,createDeferredPromise:ATs,isBlobLike:yTs,sameOrigin:nsr,isCancelled:XZ,isAborted:eUn,isErrorLike:_Ts,fullyReadBody:ETs,readableStreamClose:vTs,isomorphicEncode:Nst,urlIsLocal:CTs,urlIsHttpHttpsScheme:osr,urlHasHttpsScheme:bTs,clampAndCoarsenConnectionTimingInfo:STs,simpleRangeHeaderValue:TTs,buildContentRange:ITs,createInflate:xTs,extractMimeType:wTs}=NT(),{kState:iUn,kDispatcher:RTs}=Zj(),eX=require("node:assert"),{safelyExtractBody:ssr,extractBody:tUn}=vpe(),{redirectStatusSet:oUn,nullBodyStatus:sUn,safeMethodsSet:kTs,requestBodyHeader:PTs,subresourceSet:DTs}=RPe(),NTs=require("node:events"),{Readable:MTs,pipeline:OTs,finished:LTs}=require("node:stream"),{addAbortListener:BTs,isErrored:FTs,isReadable:Mst,bufferToLowerCasedHeaderName:rUn}=Ws(),{dataURLProcessor:UTs,serializeAMimeType:QTs,minimizeSupportedMimeType:qTs}=xb(),{getGlobalDispatcher:jTs}=Ast(),{webidl:HTs}=ty(),{STATUS_CODES:GTs}=require("node:http"),$Ts=["GET","HEAD"],VTs=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",esr,Ost=class extends NTs{static{a(this,"Fetch")}constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function WTs(t){aUn(t,"fetch")}a(WTs,"handleFetchDone");function zTs(t,e=void 0){HTs.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=ATs(),n;try{n=new rTs(t,e)}catch(f){return r.reject(f),r.promise}let o=n[iUn];if(n.signal.aborted)return tsr(r,o,null,n.signal.reason),r.promise;o.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(o.serviceWorkers="none");let c=null,l=!1,u=null;return BTs(n.signal,()=>{l=!0,eX(u!=null),u.abort(n.signal.reason);let f=c?.deref();tsr(r,o,f,n.signal.reason)}),u=lUn({request:o,processResponseEndOfBody:WTs,processResponse:a(f=>{if(!l){if(f.aborted){tsr(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(tTs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[RTs]}),r.promise}a(zTs,"fetch");function aUn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;osr(r)&&n!==null&&(t.timingAllowPassed||(n=isr({startTime:n.startTime}),o=""),n.endTime=a2e(),t.timingInfo=n,cUn(n,r.href,e,globalThis,o))}a(aUn,"finalizeAndReportTiming");var cUn=performance.markResourceTiming;function tsr(t,e,r,n){if(t&&t.reject(n),e.body!=null&&Mst(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[iUn];o.body!=null&&Mst(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(tsr,"abortFetch");function lUn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=jTs()}){eX(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=a2e(d),h=isr({startTime:f}),m={controller:new Ost(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return eX(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=sTs(t.client.policyContainer):t.policyContainer=oTs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,DTs.has(t.destination),uUn(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(lUn,"fetching");async function uUn(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!CTs(e4(r))&&(n=gl("local URLs only")),fTs(r),aTs(r)==="blocked"&&(n=gl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=gTs(r)),n===null&&(n=await(async()=>{let s=e4(r);return nsr(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await nUn(t)):r.mode==="same-origin"?gl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?gl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await nUn(t)):osr(e4(r))?(r.responseTainting="cors",await dUn(t)):gl("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=Xor(n,"basic"):r.responseTainting==="cors"?n=Xor(n,"cors"):r.responseTainting==="opaque"?n=Xor(n,"opaque"):eX(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=gl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||sUn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>rsr(t,gl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!iTs(l,r.integrity)){s("integrity mismatch");return}n.body=ssr(l)[0],rsr(t,n)},"processBody");await ETs(n.body,c,s)}else rsr(t,n)}a(uUn,"mainFetch");function nUn(t){if(XZ(t)&&t.request.redirectCount===0)return Promise.resolve(Pst(t));let{request:e}=t,{protocol:r}=e4(e);switch(r){case"about:":return Promise.resolve(gl("about scheme is not supported"));case"blob:":{esr||(esr=require("node:buffer").resolveObjectURL);let n=e4(e);if(n.search.length!==0)return Promise.resolve(gl("NetworkError when attempting to fetch resource."));let o=esr(n.toString());if(e.method!=="GET"||!yTs(o))return Promise.resolve(gl("invalid method"));let s=Dst(),c=o.size,l=Nst(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=TTs(d,!0);if(f==="failure")return Promise.resolve(gl("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(gl("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=tUn(g);s.body=A[0];let y=Nst(`${g.size}`),_=ITs(h,m,c);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",y,!0),s.headersList.set("content-type",u,!0),s.headersList.set("content-range",_,!0)}else{let d=tUn(o);s.statusText="OK",s.body=d[0],s.headersList.set("content-length",l,!0),s.headersList.set("content-type",u,!0)}return Promise.resolve(s)}case"data:":{let n=e4(e),o=UTs(n);if(o==="failure")return Promise.resolve(gl("failed to fetch the data URL"));let s=QTs(o.mimeType);return Promise.resolve(Dst({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:ssr(o.body)[0]}))}case"file:":return Promise.resolve(gl("not implemented... yet..."));case"http:":case"https:":return dUn(t).catch(n=>gl(n));default:return Promise.resolve(gl("unknown scheme"))}}a(nUn,"schemeFetch");function YTs(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(YTs,"finalizeResponse");function rsr(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(t.request.url.protocol!=="https:")return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=isr(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=wTs(e.headersList);f!=="failure"&&(u.contentType=qTs(f))}t.request.initiatorType!=null&&cUn(r,t.request.url.href,t.request.initiatorType,globalThis,l,u,d)};let c=a(()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()},"processResponseEndOfBodyTask");queueMicrotask(()=>c())},"processResponseEndOfBody");t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let o=e.type==="error"?e:e.internalResponse??e;o.body==null?n():LTs(o.body.stream,()=>{n()})}a(rsr,"fetchFinale");async function dUn(t){let e=t.request,r=null,n=null,o=t.timingInfo;if(e.serviceWorkers,r===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),n=r=await fUn(t),e.responseTainting==="cors"&&hTs(e,r)==="failure")return gl("cors failure");cTs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&mTs(e.origin,e.client,e.destination,n)==="blocked"?gl("blocked"):(oUn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=gl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await KTs(t,r):eX(!1)),r.timingInfo=o,r)}a(dUn,"httpFetch");function KTs(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=uTs(n,e4(r).hash),o==null)return e}catch(c){return Promise.resolve(gl(c))}if(!osr(o))return Promise.resolve(gl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(gl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!nsr(r,o))return Promise.resolve(gl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(gl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(gl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!$Ts.includes(r.method)){r.method="GET",r.body=null;for(let c of PTs)r.headersList.delete(c)}nsr(e4(r),o)||(r.headersList.delete("authorization",!0),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie",!0),r.headersList.delete("host",!0)),r.body!=null&&(eX(r.body.source!=null),r.body=ssr(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=a2e(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),dTs(r,n),uUn(t,!0)}a(KTs,"httpRedirectFetch");async function fUn(t,e=!1,r=!1){let n=t.request,o=null,s=null,c=null,l=null,u=!1;n.window==="no-window"&&n.redirect==="error"?(o=t,s=n):(s=nTs(n),o={...t},o.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",f=s.body?s.body.length:null,h=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(h="0"),f!=null&&(h=Nst(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",Nst(s.referrer.href),!0),lTs(s),pTs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",VTs),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(bTs(e4(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return gl("only if cached");let m=await JTs(o,d,r);!kTs.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===407)return n.window==="no-window"?gl():XZ(t)?Pst(t):gl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(XZ(t))return Pst(t);t.controller.connection.destroy(),c=await fUn(t,e,!0)}return c}a(fUn,"httpNetworkOrCacheFetch");async function JTs(t,e=!1,r=!1){eX(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(E){XZ(t)||(yield E,t.processRequestBodyChunkLength?.(E.byteLength))},"processBodyChunk"),y=a(()=>{XZ(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),_=a(E=>{XZ(t)||(E.name==="AbortError"?t.controller.abort():t.controller.terminate(E))},"processBodyError");u=(async function*(){try{for await(let E of n.body.stream)yield*A(E);y()}catch(E){_(E)}})()}try{let{body:A,status:y,statusText:_,headersList:E,socket:v}=await g({body:u});if(v)o=Dst({status:y,statusText:_,headersList:E,socket:v});else{let S=A[Symbol.asyncIterator]();t.controller.next=()=>S.next(),o=Dst({status:y,statusText:_,headersList:E})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),Pst(t,A)):gl(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{XZ(t)||t.controller.abort(A)},"cancelAlgorithm"),h=new ReadableStream({async start(A){t.controller.controller=A},async pull(A){await d(A)},async cancel(A){await f(A)},type:"bytes"});o.body={stream:h,source:null,length:null},t.controller.onAborted=m,t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let A,y;try{let{done:E,value:v}=await t.controller.next();if(eUn(t))break;A=E?void 0:v}catch(E){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=E,y=!0)}if(A===void 0){vTs(t.controller.controller),YTs(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let _=new Uint8Array(A);if(_.byteLength&&t.controller.controller.enqueue(_),FTs(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){eUn(t)?(o.aborted=!0,Mst(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):Mst(h)&&t.controller.controller.error(new TypeError("terminated",{cause:_Ts(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=e4(n),_=t.controller.dispatcher;return new Promise((E,v)=>_.dispatch({path:y.pathname+y.search,origin:y.origin,method:n.method,body:_.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(S){let{connection:T}=t.controller;s.finalConnectionTimingInfo=STs(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),T.destroyed?S(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",S),this.abort=T.abort=S),s.finalNetworkRequestStartTime=a2e(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=a2e(t.crossOriginIsolatedCapability)},onHeaders(S,T,w,R){if(S<200)return;let x="",k=new X6n;for(let B=0;BM)return v(new Error(`too many content-encodings in response: ${q.length}, maximum allowed is ${M}`)),!0;for(let L=q.length-1;L>=0;--L){let U=q[L].trim();if(U==="x-gzip"||U==="gzip")D.push(dH.createGunzip({flush:dH.constants.Z_SYNC_FLUSH,finishFlush:dH.constants.Z_SYNC_FLUSH}));else if(U==="deflate")D.push(xTs({flush:dH.constants.Z_SYNC_FLUSH,finishFlush:dH.constants.Z_SYNC_FLUSH}));else if(U==="br")D.push(dH.createBrotliDecompress({flush:dH.constants.BROTLI_OPERATION_FLUSH,finishFlush:dH.constants.BROTLI_OPERATION_FLUSH}));else{D.length=0;break}}}let O=this.onError.bind(this);return E({status:S,statusText:R,headersList:k,body:D.length?OTs(this.body,...D,B=>{B&&this.onError(B)}).on("error",O):this.body.on("error",O)}),!0},onData(S){if(t.controller.dump)return;let T=S;return s.encodedBodySize+=T.byteLength,this.body.push(T)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.onAborted&&t.controller.off("terminated",t.controller.onAborted),t.controller.ended=!0,this.body.push(null)},onError(S){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(S),t.controller.terminate(S),v(S)},onUpgrade(S,T,w){if(S!==101)return;let R=new X6n;for(let x=0;x{"use strict";p();hUn.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var gUn=I((Ehf,mUn)=>{"use strict";p();var{webidl:UT}=ty(),Lst=Symbol("ProgressEvent state"),csr=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=UT.converters.DOMString(e,"ProgressEvent constructor","type"),r=UT.converters.ProgressEventInit(r??{}),super(e,r),this[Lst]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return UT.brandCheck(this,t),this[Lst].lengthComputable}get loaded(){return UT.brandCheck(this,t),this[Lst].loaded}get total(){return UT.brandCheck(this,t),this[Lst].total}};UT.converters.ProgressEventInit=UT.dictionaryConverter([{key:"lengthComputable",converter:UT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:UT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:UT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:UT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:UT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:UT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);mUn.exports={ProgressEvent:csr}});var yUn=I((bhf,AUn)=>{"use strict";p();function ZTs(t){if(!t)return"failure";switch(t.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}a(ZTs,"getEncoding");AUn.exports={getEncoding:ZTs}});var IUn=I((Ihf,TUn)=>{"use strict";p();var{kState:Gpe,kError:lsr,kResult:_Un,kAborted:l2e,kLastProgressEventFired:usr}=asr(),{ProgressEvent:XTs}=gUn(),{getEncoding:EUn}=yUn(),{serializeAMimeType:eIs,parseMIMEType:vUn}=xb(),{types:tIs}=require("node:util"),{StringDecoder:CUn}=require("string_decoder"),{btoa:bUn}=require("node:buffer"),rIs={enumerable:!0,writable:!1,configurable:!1};function nIs(t,e,r,n){if(t[Gpe]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[Gpe]="loading",t[_Un]=null,t[lsr]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[l2e];)try{let{done:d,value:f}=await l;if(u&&!t[l2e]&&queueMicrotask(()=>{fH("loadstart",t)}),u=!1,!d&&tIs.isUint8Array(f))c.push(f),(t[usr]===void 0||Date.now()-t[usr]>=50)&&!t[l2e]&&(t[usr]=Date.now(),queueMicrotask(()=>{fH("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[Gpe]="done";try{let h=iIs(c,r,e.type,n);if(t[l2e])return;t[_Un]=h,fH("load",t)}catch(h){t[lsr]=h,fH("error",t)}t[Gpe]!=="loading"&&fH("loadend",t)});break}}catch(d){if(t[l2e])return;queueMicrotask(()=>{t[Gpe]="done",t[lsr]=d,fH("error",t),t[Gpe]!=="loading"&&fH("loadend",t)});break}})()}a(nIs,"readOperation");function fH(t,e){let r=new XTs(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(fH,"fireAProgressEvent");function iIs(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=vUn(r||"application/octet-stream");s!=="failure"&&(o+=eIs(s)),o+=";base64,";let c=new CUn("latin1");for(let l of t)o+=bUn(c.write(l));return o+=bUn(c.end()),o}case"Text":{let o="failure";if(n&&(o=EUn(n)),o==="failure"&&r){let s=vUn(r);s!=="failure"&&(o=EUn(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),oIs(t,o)}case"ArrayBuffer":return SUn(t).buffer;case"BinaryString":{let o="",s=new CUn("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a(iIs,"packageData");function oIs(t,e){let r=SUn(t),n=sIs(r),o=0;n!==null&&(e=n,o=n==="UTF-8"?3:2);let s=r.slice(o);return new TextDecoder(e).decode(s)}a(oIs,"decode");function sIs(t){let[e,r,n]=t;return e===239&&r===187&&n===191?"UTF-8":e===254&&r===255?"UTF-16BE":e===255&&r===254?"UTF-16LE":null}a(sIs,"BOMSniffing");function SUn(t){let e=t.reduce((n,o)=>n+o.byteLength,0),r=0;return t.reduce((n,o)=>(n.set(o,r),r+=o.byteLength,n),new Uint8Array(e))}a(SUn,"combineByteSequences");TUn.exports={staticPropertyDescriptors:rIs,readOperation:nIs,fireAProgressEvent:fH}});var kUn=I((Rhf,RUn)=>{"use strict";p();var{staticPropertyDescriptors:$pe,readOperation:Bst,fireAProgressEvent:xUn}=IUn(),{kState:tX,kError:wUn,kResult:Fst,kEvents:Uc,kAborted:aIs}=asr(),{webidl:Ql}=ty(),{kEnumerableProperty:kb}=Ws(),z2=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[tX]="empty",this[Fst]=null,this[wUn]=null,this[Uc]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){Ql.brandCheck(this,t),Ql.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=Ql.converters.Blob(e,{strict:!1}),Bst(this,e,"ArrayBuffer")}readAsBinaryString(e){Ql.brandCheck(this,t),Ql.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=Ql.converters.Blob(e,{strict:!1}),Bst(this,e,"BinaryString")}readAsText(e,r=void 0){Ql.brandCheck(this,t),Ql.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=Ql.converters.Blob(e,{strict:!1}),r!==void 0&&(r=Ql.converters.DOMString(r,"FileReader.readAsText","encoding")),Bst(this,e,"Text",r)}readAsDataURL(e){Ql.brandCheck(this,t),Ql.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=Ql.converters.Blob(e,{strict:!1}),Bst(this,e,"DataURL")}abort(){if(this[tX]==="empty"||this[tX]==="done"){this[Fst]=null;return}this[tX]==="loading"&&(this[tX]="done",this[Fst]=null),this[aIs]=!0,xUn("abort",this),this[tX]!=="loading"&&xUn("loadend",this)}get readyState(){switch(Ql.brandCheck(this,t),this[tX]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return Ql.brandCheck(this,t),this[Fst]}get error(){return Ql.brandCheck(this,t),this[wUn]}get onloadend(){return Ql.brandCheck(this,t),this[Uc].loadend}set onloadend(e){Ql.brandCheck(this,t),this[Uc].loadend&&this.removeEventListener("loadend",this[Uc].loadend),typeof e=="function"?(this[Uc].loadend=e,this.addEventListener("loadend",e)):this[Uc].loadend=null}get onerror(){return Ql.brandCheck(this,t),this[Uc].error}set onerror(e){Ql.brandCheck(this,t),this[Uc].error&&this.removeEventListener("error",this[Uc].error),typeof e=="function"?(this[Uc].error=e,this.addEventListener("error",e)):this[Uc].error=null}get onloadstart(){return Ql.brandCheck(this,t),this[Uc].loadstart}set onloadstart(e){Ql.brandCheck(this,t),this[Uc].loadstart&&this.removeEventListener("loadstart",this[Uc].loadstart),typeof e=="function"?(this[Uc].loadstart=e,this.addEventListener("loadstart",e)):this[Uc].loadstart=null}get onprogress(){return Ql.brandCheck(this,t),this[Uc].progress}set onprogress(e){Ql.brandCheck(this,t),this[Uc].progress&&this.removeEventListener("progress",this[Uc].progress),typeof e=="function"?(this[Uc].progress=e,this.addEventListener("progress",e)):this[Uc].progress=null}get onload(){return Ql.brandCheck(this,t),this[Uc].load}set onload(e){Ql.brandCheck(this,t),this[Uc].load&&this.removeEventListener("load",this[Uc].load),typeof e=="function"?(this[Uc].load=e,this.addEventListener("load",e)):this[Uc].load=null}get onabort(){return Ql.brandCheck(this,t),this[Uc].abort}set onabort(e){Ql.brandCheck(this,t),this[Uc].abort&&this.removeEventListener("abort",this[Uc].abort),typeof e=="function"?(this[Uc].abort=e,this.addEventListener("abort",e)):this[Uc].abort=null}};z2.EMPTY=z2.prototype.EMPTY=0;z2.LOADING=z2.prototype.LOADING=1;z2.DONE=z2.prototype.DONE=2;Object.defineProperties(z2.prototype,{EMPTY:$pe,LOADING:$pe,DONE:$pe,readAsArrayBuffer:kb,readAsBinaryString:kb,readAsText:kb,readAsDataURL:kb,abort:kb,readyState:kb,result:kb,error:kb,onloadstart:kb,onprogress:kb,onload:kb,onabort:kb,onerror:kb,onloadend:kb,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(z2,{EMPTY:$pe,LOADING:$pe,DONE:$pe});RUn.exports={FileReader:z2}});var Ust=I((Dhf,PUn)=>{"use strict";p();PUn.exports={kConstruct:tf().kConstruct}});var MUn=I((Mhf,NUn)=>{"use strict";p();var cIs=require("node:assert"),{URLSerializer:DUn}=xb(),{isValidHeaderName:lIs}=NT();function uIs(t,e,r=!1){let n=DUn(t,r),o=DUn(e,r);return n===o}a(uIs,"urlEquals");function dIs(t){cIs(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),lIs(r)&&e.push(r);return e}a(dIs,"getFieldValues");NUn.exports={urlEquals:uIs,getFieldValues:dIs}});var BUn=I((Bhf,LUn)=>{"use strict";p();var{kConstruct:fIs}=Ust(),{urlEquals:pIs,getFieldValues:dsr}=MUn(),{kEnumerableProperty:rX,isDisturbed:hIs}=Ws(),{webidl:xi}=ty(),{Response:mIs,cloneResponse:gIs,fromInnerResponse:AIs}=s2e(),{Request:g8,fromInnerRequest:yIs}=Hpe(),{kState:Y2}=Zj(),{fetching:_Is}=c2e(),{urlIsHttpHttpsScheme:Qst,createDeferredPromise:Vpe,readAllBytes:EIs}=NT(),fsr=require("node:assert"),qst=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==fIs&&xi.illegalConstructor(),xi.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){xi.brandCheck(this,t);let n="Cache.match";xi.argumentLengthCheck(arguments,1,n),e=xi.converters.RequestInfo(e,n,"request"),r=xi.converters.CacheQueryOptions(r,n,"options");let o=this.#i(e,r,1);if(o.length!==0)return o[0]}async matchAll(e=void 0,r={}){xi.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=xi.converters.RequestInfo(e,n,"request")),r=xi.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){xi.brandCheck(this,t);let r="Cache.add";xi.argumentLengthCheck(arguments,1,r),e=xi.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){xi.brandCheck(this,t);let r="Cache.addAll";xi.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw xi.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=xi.converters.RequestInfo(m),typeof m=="string")continue;let g=m[Y2];if(!Qst(g.url)||g.method!=="GET")throw xi.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=new g8(m)[Y2];if(!Qst(g.url))throw xi.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Vpe();s.push(_Is({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(xi.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let _=dsr(y.headersList.get("vary"));for(let E of _)if(E==="*"){A.reject(xi.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let v of s)v.abort();return}}},processResponseEndOfBody(y){if(y.aborted){A.reject(new DOMException("aborted","AbortError"));return}A.resolve(y)}})),n.push(A.promise)}let l=await Promise.all(n),u=[],d=0;for(let m of l){let g={type:"put",request:o[d],response:m};u.push(g),d++}let f=Vpe(),h=null;try{this.#t(u)}catch(m){h=m}return queueMicrotask(()=>{h===null?f.resolve(void 0):f.reject(h)}),f.promise}async put(e,r){xi.brandCheck(this,t);let n="Cache.put";xi.argumentLengthCheck(arguments,2,n),e=xi.converters.RequestInfo(e,n,"request"),r=xi.converters.Response(r,n,"response");let o=null;if(e instanceof g8?o=e[Y2]:o=new g8(e)[Y2],!Qst(o.url)||o.method!=="GET")throw xi.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[Y2];if(s.status===206)throw xi.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=dsr(s.headersList.get("vary"));for(let A of g)if(A==="*")throw xi.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(hIs(s.body.stream)||s.body.stream.locked))throw xi.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=gIs(s),l=Vpe();if(s.body!=null){let A=s.body.stream.getReader();EIs(A).then(l.resolve,l.reject)}else l.resolve(void 0);let u=[],d={type:"put",request:o,response:c};u.push(d);let f=await l.promise;c.body!=null&&(c.body.source=f);let h=Vpe(),m=null;try{this.#t(u)}catch(g){m=g}return queueMicrotask(()=>{m===null?h.resolve():h.reject(m)}),h.promise}async delete(e,r={}){xi.brandCheck(this,t);let n="Cache.delete";xi.argumentLengthCheck(arguments,1,n),e=xi.converters.RequestInfo(e,n,"request"),r=xi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof g8){if(o=e[Y2],o.method!=="GET"&&!r.ignoreMethod)return!1}else fsr(typeof e=="string"),o=new g8(e)[Y2];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Vpe(),u=null,d;try{d=this.#t(s)}catch(f){u=f}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(e=void 0,r={}){xi.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=xi.converters.RequestInfo(e,n,"request")),r=xi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof g8){if(o=e[Y2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new g8(e)[Y2]);let s=Vpe(),c=[];if(e===void 0)for(let l of this.#e)c.push(l[0]);else{let l=this.#r(o,r);for(let u of l)c.push(u[0])}return queueMicrotask(()=>{let l=[];for(let u of c){let d=yIs(u,new AbortController().signal,"immutable");l.push(d)}s.resolve(Object.freeze(l))}),s.promise}#t(e){let r=this.#e,n=[...r],o=[],s=[];try{for(let c of e){if(c.type!=="delete"&&c.type!=="put")throw xi.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw xi.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(c.request,c.options,o).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=this.#r(c.request,c.options),l.length===0)return[];for(let u of l){let d=r.indexOf(u);fsr(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw xi.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!Qst(u.url))throw xi.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw xi.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw xi.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=this.#r(c.request);for(let d of l){let f=r.indexOf(d);fsr(f!==-1),r.splice(f,1)}r.push([c.request,c.response]),o.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw this.#e.length=0,this.#e=n,c}}#r(e,r,n){let o=[],s=n??this.#e;for(let c of s){let[l,u]=c;this.#n(e,l,u,r)&&o.push(c)}return o}#n(e,r,n=null,o){let s=new URL(e.url),c=new URL(r.url);if(o?.ignoreSearch&&(c.search="",s.search=""),!pIs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=dsr(n.headersList.get("vary"));for(let u of l){if(u==="*")return!1;let d=r.headersList.get(u),f=e.headersList.get(u);if(d!==f)return!1}return!0}#i(e,r,n=1/0){let o=null;if(e!==void 0)if(e instanceof g8){if(o=e[Y2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new g8(e)[Y2]);let s=[];if(e===void 0)for(let l of this.#e)s.push(l[1]);else{let l=this.#r(o,r);for(let u of l)s.push(u[1])}let c=[];for(let l of s){let u=AIs(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(qst.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:rX,matchAll:rX,add:rX,addAll:rX,put:rX,delete:rX,keys:rX});var OUn=[{key:"ignoreSearch",converter:xi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:xi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:xi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];xi.converters.CacheQueryOptions=xi.dictionaryConverter(OUn);xi.converters.MultiCacheQueryOptions=xi.dictionaryConverter([...OUn,{key:"cacheName",converter:xi.converters.DOMString}]);xi.converters.Response=xi.interfaceConverter(mIs);xi.converters["sequence"]=xi.sequenceConverter(xi.converters.RequestInfo);LUn.exports={Cache:qst}});var UUn=I((Qhf,FUn)=>{"use strict";p();var{kConstruct:u2e}=Ust(),{Cache:jst}=BUn(),{webidl:F_}=ty(),{kEnumerableProperty:d2e}=Ws(),Hst=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==u2e&&F_.illegalConstructor(),F_.util.markAsUncloneable(this)}async match(e,r={}){if(F_.brandCheck(this,t),F_.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=F_.converters.RequestInfo(e),r=F_.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new jst(u2e,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new jst(u2e,n).match(e,r);if(s!==void 0)return s}}async has(e){F_.brandCheck(this,t);let r="CacheStorage.has";return F_.argumentLengthCheck(arguments,1,r),e=F_.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){F_.brandCheck(this,t);let r="CacheStorage.open";if(F_.argumentLengthCheck(arguments,1,r),e=F_.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new jst(u2e,o)}let n=[];return this.#e.set(e,n),new jst(u2e,n)}async delete(e){F_.brandCheck(this,t);let r="CacheStorage.delete";return F_.argumentLengthCheck(arguments,1,r),e=F_.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return F_.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Hst.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:d2e,has:d2e,open:d2e,delete:d2e,keys:d2e});FUn.exports={CacheStorage:Hst}});var qUn=I((Hhf,QUn)=>{"use strict";p();QUn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var psr=I(($hf,VUn)=>{"use strict";p();function vIs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(vIs,"isCTLExcludingHtab");function jUn(t){for(let e=0;e126||r===34||r===40||r===41||r===60||r===62||r===64||r===44||r===59||r===58||r===92||r===47||r===91||r===93||r===63||r===61||r===123||r===125)throw new Error("Invalid cookie name")}}a(jUn,"validateCookieName");function HUn(t){let e=t.length,r=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++r}for(;r126||n===34||n===44||n===59||n===92)throw new Error("Invalid cookie value")}}a(HUn,"validateCookieValue");function GUn(t){for(let e=0;ee.toString().padStart(2,"0"));function $Un(t){return typeof t=="number"&&(t=new Date(t)),`${bIs[t.getUTCDay()]}, ${Gst[t.getUTCDate()]} ${SIs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Gst[t.getUTCHours()]}:${Gst[t.getUTCMinutes()]}:${Gst[t.getUTCSeconds()]} GMT`}a($Un,"toIMFDate");function TIs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(TIs,"validateCookieMaxAge");function IIs(t){if(t.name.length===0)return null;jUn(t.name),HUn(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(TIs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(CIs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(GUn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${$Un(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let r of t.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...o]=r.split("=");e.push(`${n.trim()}=${o.join("=")}`)}return e.join("; ")}a(IIs,"stringify");VUn.exports={isCTLExcludingHtab:vIs,validateCookieName:jUn,validateCookiePath:GUn,validateCookieValue:HUn,toIMFDate:$Un,stringify:IIs}});var zUn=I((zhf,WUn)=>{"use strict";p();var{maxNameValuePairSize:xIs,maxAttributeValueSize:wIs}=qUn(),{isCTLExcludingHtab:RIs}=psr(),{collectASequenceOfCodePointsFast:$st}=xb(),kIs=require("node:assert");function PIs(t){if(RIs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=$st(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=$st("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>xIs?null:{name:n,value:o,...Wpe(r)}}a(PIs,"parseSetCookie");function Wpe(t,e={}){if(t.length===0)return e;kIs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=$st(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=$st("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>wIs)return Wpe(t,e);let s=n.toLowerCase();if(s==="expires"){let c=new Date(o);e.expires=c}else if(s==="max-age"){let c=o.charCodeAt(0);if((c<48||c>57)&&o[0]!=="-"||!/^\d+$/.test(o))return Wpe(t,e);let l=Number(o);e.maxAge=l}else if(s==="domain"){let c=o;c[0]==="."&&(c=c.slice(1)),c=c.toLowerCase(),e.domain=c}else if(s==="path"){let c="";o.length===0||o[0]!=="/"?c="/":c=o,e.path=c}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let c="Default",l=o.toLowerCase();l.includes("none")&&(c="None"),l.includes("strict")&&(c="Strict"),l.includes("lax")&&(c="Lax"),e.sameSite=c}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return Wpe(t,e)}a(Wpe,"parseUnparsedAttributes");WUn.exports={parseSetCookie:PIs,parseUnparsedAttributes:Wpe}});var JUn=I((Jhf,KUn)=>{"use strict";p();var{parseSetCookie:DIs}=zUn(),{stringify:NIs}=psr(),{webidl:Ea}=ty(),{Headers:Vst}=JZ();function MIs(t){Ea.argumentLengthCheck(arguments,1,"getCookies"),Ea.brandCheck(t,Vst,{strict:!1});let e=t.get("cookie"),r={};if(!e)return r;for(let n of e.split(";")){let[o,...s]=n.split("=");r[o.trim()]=s.join("=")}return r}a(MIs,"getCookies");function OIs(t,e,r){Ea.brandCheck(t,Vst,{strict:!1});let n="deleteCookie";Ea.argumentLengthCheck(arguments,2,n),e=Ea.converters.DOMString(e,n,"name"),r=Ea.converters.DeleteCookieAttributes(r),YUn(t,{name:e,value:"",expires:new Date(0),...r})}a(OIs,"deleteCookie");function LIs(t){Ea.argumentLengthCheck(arguments,1,"getSetCookies"),Ea.brandCheck(t,Vst,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>DIs(r)):[]}a(LIs,"getSetCookies");function YUn(t,e){Ea.argumentLengthCheck(arguments,2,"setCookie"),Ea.brandCheck(t,Vst,{strict:!1}),e=Ea.converters.Cookie(e);let r=NIs(e);r&&t.append("Set-Cookie",r)}a(YUn,"setCookie");Ea.converters.DeleteCookieAttributes=Ea.dictionaryConverter([{converter:Ea.nullableConverter(Ea.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.nullableConverter(Ea.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);Ea.converters.Cookie=Ea.dictionaryConverter([{converter:Ea.converters.DOMString,key:"name"},{converter:Ea.converters.DOMString,key:"value"},{converter:Ea.nullableConverter(t=>typeof t=="number"?Ea.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.nullableConverter(Ea.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.nullableConverter(Ea.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.nullableConverter(Ea.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.nullableConverter(Ea.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.nullableConverter(Ea.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:Ea.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Ea.sequenceConverter(Ea.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);KUn.exports={getCookies:MIs,deleteCookie:OIs,getSetCookies:LIs,setCookie:YUn}});var Ype=I((emf,XUn)=>{"use strict";p();var{webidl:Ai}=ty(),{kEnumerableProperty:Pb}=Ws(),{kConstruct:ZUn}=tf(),{MessagePort:BIs}=require("node:worker_threads"),zpe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===ZUn){super(arguments[1],arguments[2]),Ai.util.markAsUncloneable(this);return}let n="MessageEvent constructor";Ai.argumentLengthCheck(arguments,1,n),e=Ai.converters.DOMString(e,n,"type"),r=Ai.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,Ai.util.markAsUncloneable(this)}get data(){return Ai.brandCheck(this,t),this.#e.data}get origin(){return Ai.brandCheck(this,t),this.#e.origin}get lastEventId(){return Ai.brandCheck(this,t),this.#e.lastEventId}get source(){return Ai.brandCheck(this,t),this.#e.source}get ports(){return Ai.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,r=!1,n=!1,o=null,s="",c="",l=null,u=[]){return Ai.brandCheck(this,t),Ai.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:r,cancelable:n,data:o,origin:s,lastEventId:c,source:l,ports:u})}static createFastMessageEvent(e,r){let n=new t(ZUn,e,r);return n.#e=r,n.#e.data??=null,n.#e.origin??="",n.#e.lastEventId??="",n.#e.source??=null,n.#e.ports??=[],n}},{createFastMessageEvent:FIs}=zpe;delete zpe.createFastMessageEvent;var Wst=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";Ai.argumentLengthCheck(arguments,1,n),e=Ai.converters.DOMString(e,n,"type"),r=Ai.converters.CloseEventInit(r),super(e,r),this.#e=r,Ai.util.markAsUncloneable(this)}get wasClean(){return Ai.brandCheck(this,t),this.#e.wasClean}get code(){return Ai.brandCheck(this,t),this.#e.code}get reason(){return Ai.brandCheck(this,t),this.#e.reason}},zst=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";Ai.argumentLengthCheck(arguments,1,n),super(e,r),Ai.util.markAsUncloneable(this),e=Ai.converters.DOMString(e,n,"type"),r=Ai.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return Ai.brandCheck(this,t),this.#e.message}get filename(){return Ai.brandCheck(this,t),this.#e.filename}get lineno(){return Ai.brandCheck(this,t),this.#e.lineno}get colno(){return Ai.brandCheck(this,t),this.#e.colno}get error(){return Ai.brandCheck(this,t),this.#e.error}};Object.defineProperties(zpe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:Pb,origin:Pb,lastEventId:Pb,source:Pb,ports:Pb,initMessageEvent:Pb});Object.defineProperties(Wst.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:Pb,code:Pb,wasClean:Pb});Object.defineProperties(zst.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:Pb,filename:Pb,lineno:Pb,colno:Pb,error:Pb});Ai.converters.MessagePort=Ai.interfaceConverter(BIs);Ai.converters["sequence"]=Ai.sequenceConverter(Ai.converters.MessagePort);var hsr=[{key:"bubbles",converter:Ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:Ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:Ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Ai.converters.MessageEventInit=Ai.dictionaryConverter([...hsr,{key:"data",converter:Ai.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:Ai.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:Ai.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:Ai.nullableConverter(Ai.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:Ai.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);Ai.converters.CloseEventInit=Ai.dictionaryConverter([...hsr,{key:"wasClean",converter:Ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:Ai.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:Ai.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);Ai.converters.ErrorEventInit=Ai.dictionaryConverter([...hsr,{key:"message",converter:Ai.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:Ai.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:Ai.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:Ai.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:Ai.converters.any}]);XUn.exports={MessageEvent:zpe,CloseEvent:Wst,ErrorEvent:zst,createFastMessageEvent:FIs}});var nX=I((nmf,e9n)=>{"use strict";p();var UIs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",QIs={enumerable:!0,writable:!1,configurable:!1},qIs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},jIs={NOT_SENT:0,PROCESSING:1,SENT:2},HIs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},GIs=2**16-1,$Is={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},VIs=Buffer.allocUnsafe(0),WIs={string:1,typedArray:2,arrayBuffer:3,blob:4};e9n.exports={uid:UIs,sentCloseFrameState:jIs,staticPropertyDescriptors:QIs,states:qIs,opcodes:HIs,maxUnsigned16Bit:GIs,parserStates:$Is,emptyBuffer:VIs,sendHints:WIs}});var f2e=I((omf,t9n)=>{"use strict";p();t9n.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var m2e=I((amf,u9n)=>{"use strict";p();var{kReadyState:p2e,kController:zIs,kResponse:YIs,kBinaryType:KIs,kWebSocketURL:JIs}=f2e(),{states:h2e,opcodes:pH}=nX(),{ErrorEvent:ZIs,createFastMessageEvent:XIs}=Ype(),{isUtf8:exs}=require("node:buffer"),{collectASequenceOfCodePointsFast:txs,removeHTTPWhitespace:r9n}=xb();function rxs(t){return t[p2e]===h2e.CONNECTING}a(rxs,"isConnecting");function nxs(t){return t[p2e]===h2e.OPEN}a(nxs,"isEstablished");function ixs(t){return t[p2e]===h2e.CLOSING}a(ixs,"isClosing");function oxs(t){return t[p2e]===h2e.CLOSED}a(oxs,"isClosed");function msr(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(msr,"fireEvent");function sxs(t,e,r){if(t[p2e]!==h2e.OPEN)return;let n;if(e===pH.TEXT)try{n=l9n(r)}catch{i9n(t,"Received invalid UTF-8 in text frame.");return}else e===pH.BINARY&&(t[KIs]==="blob"?n=new Blob([r]):n=axs(r));msr("message",t,XIs,{origin:t[JIs].origin,data:n})}a(sxs,"websocketMessageReceived");function axs(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(axs,"toArrayBuffer");function cxs(t){if(t.length===0)return!1;for(let e=0;e126||r===34||r===40||r===41||r===44||r===47||r===58||r===59||r===60||r===61||r===62||r===63||r===64||r===91||r===92||r===93||r===123||r===125)return!1}return!0}a(cxs,"isValidSubprotocol");function lxs(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(lxs,"isValidStatusCode");function i9n(t,e){let{[zIs]:r,[YIs]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&msr("error",t,(o,s)=>new ZIs(o,s),{error:new Error(e),message:e})}a(i9n,"failWebsocketConnection");function o9n(t){return t===pH.CLOSE||t===pH.PING||t===pH.PONG}a(o9n,"isControlFrame");function s9n(t){return t===pH.CONTINUATION}a(s9n,"isContinuationFrame");function a9n(t){return t===pH.TEXT||t===pH.BINARY}a(a9n,"isTextBinaryFrame");function uxs(t){return a9n(t)||s9n(t)||o9n(t)}a(uxs,"isValidOpcode");function dxs(t){let e={position:0},r=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}a(fxs,"isValidClientWindowBits");var c9n=typeof process.versions.icu=="string",n9n=c9n?new TextDecoder("utf-8",{fatal:!0}):void 0,l9n=c9n?n9n.decode.bind(n9n):function(t){if(exs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};u9n.exports={isConnecting:rxs,isEstablished:nxs,isClosing:ixs,isClosed:oxs,fireEvent:msr,isValidSubprotocol:cxs,isValidStatusCode:lxs,failWebsocketConnection:i9n,websocketMessageReceived:sxs,utf8Decode:l9n,isControlFrame:o9n,isContinuationFrame:s9n,isTextBinaryFrame:a9n,isValidOpcode:uxs,parseExtensions:dxs,isValidClientWindowBits:fxs}});var Kst=I((umf,d9n)=>{"use strict";p();var{maxUnsigned16Bit:pxs}=nX(),Yst=16386,gsr,g2e=null,Kpe=Yst;try{gsr=require("node:crypto")}catch{gsr={randomFillSync:a(function(e,r,n){for(let o=0;opxs?(c+=8,s=127):o>125&&(c+=2,s=126);let l=Buffer.allocUnsafe(o+c);l[0]=l[1]=0,l[0]|=128,l[0]=(l[0]&240)+e;l[c-4]=n[0],l[c-3]=n[1],l[c-2]=n[2],l[c-1]=n[3],l[1]=s,s===126?l.writeUInt16BE(o,2):s===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),l[1]|=128;for(let u=0;u{"use strict";p();var{uid:mxs,states:A2e,sentCloseFrameState:Jst,emptyBuffer:gxs,opcodes:Axs}=nX(),{kReadyState:y2e,kSentClose:Zst,kByteParser:p9n,kReceivedClose:f9n,kResponse:h9n}=f2e(),{fireEvent:yxs,failWebsocketConnection:hH,isClosing:_xs,isClosed:Exs,isEstablished:vxs,parseExtensions:Cxs}=m2e(),{channels:Jpe}=cpe(),{CloseEvent:bxs}=Ype(),{makeRequest:Sxs}=Hpe(),{fetching:Txs}=c2e(),{Headers:Ixs,getHeadersList:xxs}=JZ(),{getDecodeSplit:wxs}=NT(),{WebsocketFrameSend:Rxs}=Kst(),ysr;try{ysr=require("node:crypto")}catch{}function kxs(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=Sxs({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=xxs(new Ixs(s.headers));l.headersList=h}let u=ysr.randomBytes(16).toString("base64");l.headersList.append("sec-websocket-key",u),l.headersList.append("sec-websocket-version","13");for(let h of e)l.headersList.append("sec-websocket-protocol",h);return l.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits"),Txs({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){hH(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){hH(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){hH(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){hH(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=ysr.createHash("sha1").update(u+mxs).digest("base64");if(m!==g){hH(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=Cxs(A),!y.has("permessage-deflate"))){hH(n,"Sec-WebSocket-Extensions header does not match.");return}let _=h.headersList.get("Sec-WebSocket-Protocol");if(_!==null&&!wxs("sec-websocket-protocol",l.headersList).includes(_)){hH(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",m9n),h.socket.on("close",g9n),h.socket.on("error",A9n),Jpe.open.hasSubscribers&&Jpe.open.publish({address:h.socket.address(),protocol:_,extensions:A}),o(h,y)}})}a(kxs,"establishWebSocketConnection");function Pxs(t,e,r,n){if(!(_xs(t)||Exs(t)))if(!vxs(t))hH(t,"Connection was closed before it was established."),t[y2e]=A2e.CLOSING;else if(t[Zst]===Jst.NOT_SENT){t[Zst]=Jst.PROCESSING;let o=new Rxs;e!==void 0&&r===void 0?(o.frameData=Buffer.allocUnsafe(2),o.frameData.writeUInt16BE(e,0)):e!==void 0&&r!==void 0?(o.frameData=Buffer.allocUnsafe(2+n),o.frameData.writeUInt16BE(e,0),o.frameData.write(r,2,"utf-8")):o.frameData=gxs,t[h9n].socket.write(o.createFrame(Axs.CLOSE)),t[Zst]=Jst.SENT,t[y2e]=A2e.CLOSING}else t[y2e]=A2e.CLOSING}a(Pxs,"closeWebSocketConnection");function m9n(t){this.ws[p9n].write(t)||this.pause()}a(m9n,"onSocketData");function g9n(){let{ws:t}=this,{[h9n]:e}=t;e.socket.off("data",m9n),e.socket.off("close",g9n),e.socket.off("error",A9n);let r=t[Zst]===Jst.SENT&&t[f9n],n=1005,o="",s=t[p9n].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[f9n]||(n=1006),t[y2e]=A2e.CLOSED,yxs("close",t,(c,l)=>new bxs(c,l),{wasClean:r,code:n,reason:o}),Jpe.close.hasSubscribers&&Jpe.close.publish({websocket:t,code:n,reason:o})}a(g9n,"onSocketClose");function A9n(t){let{ws:e}=this;e[y2e]=A2e.CLOSING,Jpe.socketError.hasSubscribers&&Jpe.socketError.publish(t),this.destroy()}a(A9n,"onSocketError");y9n.exports={establishWebSocketConnection:kxs,closeWebSocketConnection:Pxs}});var v9n=I((gmf,E9n)=>{"use strict";p();var{createInflateRaw:Dxs,Z_DEFAULT_WINDOWBITS:Nxs}=require("node:zlib"),{isValidClientWindowBits:Mxs}=m2e(),{MessageSizeExceededError:_9n}=Rc(),Oxs=Buffer.from([0,0,255,255]),Xst=Symbol("kBuffer"),_2e=Symbol("kLength"),Lxs=4*1024*1024,Esr=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=!1;#n=null;constructor(e){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,r,n){if(this.#r){n(new _9n);return}if(!this.#e){let o=Nxs;if(this.#t.serverMaxWindowBits){if(!Mxs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=Dxs({windowBits:o})}catch(s){n(s);return}this.#e[Xst]=[],this.#e[_2e]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[_2e]+=s.length,this.#e[_2e]>Lxs){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new _9n)}return}this.#e[Xst].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(Oxs),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[Xst],this.#e[_2e]);this.#e[Xst].length=0,this.#e[_2e]=0,this.#n=null,n(null,o)})}};E9n.exports={PerMessageDeflate:Esr}});var P9n=I((_mf,k9n)=>{"use strict";p();var{Writable:Bxs}=require("node:stream"),Fxs=require("node:assert"),{parserStates:Db,opcodes:Zpe,states:Uxs,emptyBuffer:C9n,sentCloseFrameState:b9n}=nX(),{kReadyState:Qxs,kSentClose:S9n,kResponse:T9n,kReceivedClose:I9n}=f2e(),{channels:eat}=cpe(),{isValidStatusCode:qxs,isValidOpcode:jxs,failWebsocketConnection:QT,websocketMessageReceived:x9n,utf8Decode:Hxs,isControlFrame:w9n,isTextBinaryFrame:vsr,isContinuationFrame:Gxs}=m2e(),{WebsocketFrameSend:R9n}=Kst(),{closeWebSocketConnection:$xs}=_sr(),{PerMessageDeflate:Vxs}=v9n(),Csr=class extends Bxs{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=Db.INFO;#i={};#o=[];#s;constructor(e,r){super(),this.ws=e,this.#s=r??new Map,this.#s.has("permessage-deflate")&&this.#s.set("permessage-deflate",new Vxs(r))}_write(e,r,n){this.#e.push(e),this.#t+=e.length,this.#r=!0,this.run(n)}run(e){for(;this.#r;)if(this.#n===Db.INFO){if(this.#t<2)return e();let r=this.consume(2),n=(r[0]&128)!==0,o=r[0]&15,s=(r[1]&128)===128,c=!n&&o!==Zpe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!jxs(o))return QT(this.ws,"Invalid opcode received"),e();if(s)return QT(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){QT(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){QT(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!vsr(o)){QT(this.ws,"Invalid frame type was fragmented.");return}if(vsr(o)&&this.#o.length>0){QT(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){QT(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&w9n(o)){QT(this.ws,"Control frame either too large or fragmented");return}if(Gxs(o)&&this.#o.length===0&&!this.#i.compressed){QT(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=Db.READ_DATA):l===126?this.#n=Db.PAYLOADLENGTH_16:l===127&&(this.#n=Db.PAYLOADLENGTH_64),vsr(o)&&(this.#i.binaryType=o,this.#i.compressed=u!==0),this.#i.opcode=o,this.#i.masked=s,this.#i.fin=n,this.#i.fragmented=c}else if(this.#n===Db.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=Db.READ_DATA}else if(this.#n===Db.PAYLOADLENGTH_64){if(this.#t<8)return e();let r=this.consume(8),n=r.readUInt32BE(0),o=r.readUInt32BE(4);if(n!==0||o>2**31-1){QT(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=Db.READ_DATA}else if(this.#n===Db.READ_DATA){if(this.#t{if(n){QT(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=Db.INFO,this.#r=!0,this.run(e);return}x9n(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=Db.INFO,this.#o.length=0,this.run(e)}),this.#r=!1;break}else{if(this.#o.push(r),!this.#i.fragmented&&this.#i.fin){let n=Buffer.concat(this.#o);x9n(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=Db.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return C9n;if(this.#e[0].length===e)return this.#t-=this.#e[0].length,this.#e.shift();let r=Buffer.allocUnsafe(e),n=0;for(;n!==e;){let o=this.#e[0],{length:s}=o;if(s+n===e){r.set(this.#e.shift(),n);break}else if(s+n>e){r.set(o.subarray(0,e-n),n),this.#e[0]=o.subarray(e-n);break}else r.set(this.#e.shift(),n),n+=o.length}return this.#t-=e,r}parseCloseBody(e){Fxs(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!qxs(r))return{code:1002,reason:"Invalid status code",error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=Hxs(n)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:r,reason:n,error:!1}}parseControlFrame(e){let{opcode:r,payloadLength:n}=this.#i;if(r===Zpe.CLOSE){if(n===1)return QT(this.ws,"Received close frame with a 1-byte body."),!1;if(this.#i.closeInfo=this.parseCloseBody(e),this.#i.closeInfo.error){let{code:o,reason:s}=this.#i.closeInfo;return $xs(this.ws,o,s,s.length),QT(this.ws,s),!1}if(this.ws[S9n]!==b9n.SENT){let o=C9n;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new R9n(o);this.ws[T9n].socket.write(s.createFrame(Zpe.CLOSE),c=>{c||(this.ws[S9n]=b9n.SENT)})}return this.ws[Qxs]=Uxs.CLOSING,this.ws[I9n]=!0,!1}else if(r===Zpe.PING){if(!this.ws[I9n]){let o=new R9n(e);this.ws[T9n].socket.write(o.createFrame(Zpe.PONG)),eat.ping.hasSubscribers&&eat.ping.publish({payload:e})}}else r===Zpe.PONG&&eat.pong.hasSubscribers&&eat.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};k9n.exports={ByteParser:Csr}});var L9n=I((Cmf,O9n)=>{"use strict";p();var{WebsocketFrameSend:Wxs}=Kst(),{opcodes:D9n,sendHints:Xpe}=nX(),zxs=Pir(),N9n=Buffer[Symbol.species],bsr=class{static{a(this,"SendQueue")}#e=new zxs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==Xpe.blob){let s=M9n(e,n);if(!this.#t)this.#r.write(s,r);else{let c={promise:null,callback:r,frame:s};this.#e.push(c)}return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=M9n(s,n)}),callback:r,frame:null};this.#e.push(o),this.#t||this.#n()}async#n(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let r=e.shift();r.promise!==null&&await r.promise,this.#r.write(r.frame,r.callback),r.callback=r.frame=null}this.#t=!1}};function M9n(t,e){return new Wxs(Yxs(t,e)).createFrame(e===Xpe.string?D9n.TEXT:D9n.BINARY)}a(M9n,"createFrame");function Yxs(t,e){switch(e){case Xpe.string:return Buffer.from(t);case Xpe.arrayBuffer:case Xpe.blob:return new N9n(t);case Xpe.typedArray:return new N9n(t.buffer,t.byteOffset,t.byteLength)}}a(Yxs,"toBuffer");O9n.exports={SendQueue:bsr}});var $9n=I((Tmf,G9n)=>{"use strict";p();var{webidl:lo}=ty(),{URLSerializer:Kxs}=xb(),{environmentSettingsObject:B9n}=NT(),{staticPropertyDescriptors:mH,states:E2e,sentCloseFrameState:Jxs,sendHints:tat}=nX(),{kWebSocketURL:F9n,kReadyState:Ssr,kController:Zxs,kBinaryType:rat,kResponse:U9n,kSentClose:Xxs,kByteParser:ews}=f2e(),{isConnecting:tws,isEstablished:rws,isClosing:nws,isValidSubprotocol:iws,fireEvent:Q9n}=m2e(),{establishWebSocketConnection:ows,closeWebSocketConnection:q9n}=_sr(),{ByteParser:sws}=P9n(),{kEnumerableProperty:Zw,isBlobLike:j9n}=Ws(),{getGlobalDispatcher:aws}=Ast(),{types:H9n}=require("node:util"),{ErrorEvent:cws,CloseEvent:lws}=Ype(),{SendQueue:uws}=L9n(),qT=class t extends EventTarget{static{a(this,"WebSocket")}#e={open:null,error:null,close:null,message:null};#t=0;#r="";#n="";#i;constructor(e,r=[]){super(),lo.util.markAsUncloneable(this);let n="WebSocket constructor";lo.argumentLengthCheck(arguments,1,n);let o=lo.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=lo.converters.USVString(e,n,"url"),r=o.protocols;let s=B9n.settingsObject.baseUrl,c;try{c=new URL(e,s)}catch(u){throw new DOMException(u,"SyntaxError")}if(c.protocol==="http:"?c.protocol="ws:":c.protocol==="https:"&&(c.protocol="wss:"),c.protocol!=="ws:"&&c.protocol!=="wss:")throw new DOMException(`Expected a ws: or wss: protocol, got ${c.protocol}`,"SyntaxError");if(c.hash||c.href.endsWith("#"))throw new DOMException("Got fragment","SyntaxError");if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(u=>u.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(u=>iws(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[F9n]=new URL(c.href);let l=B9n.settingsObject;this[Zxs]=ows(c,r,l,this,(u,d)=>this.#o(u,d),o),this[Ssr]=t.CONNECTING,this[Xxs]=Jxs.NOT_SENT,this[rat]="blob"}close(e=void 0,r=void 0){lo.brandCheck(this,t);let n="WebSocket.close";if(e!==void 0&&(e=lo.converters["unsigned short"](e,n,"code",{clamp:!0})),r!==void 0&&(r=lo.converters.USVString(r,n,"reason")),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new DOMException("invalid code","InvalidAccessError");let o=0;if(r!==void 0&&(o=Buffer.byteLength(r),o>123))throw new DOMException(`Reason must be less than 123 bytes; received ${o}`,"SyntaxError");q9n(this,e,r,o)}send(e){lo.brandCheck(this,t);let r="WebSocket.send";if(lo.argumentLengthCheck(arguments,1,r),e=lo.converters.WebSocketSendData(e,r,"data"),tws(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!rws(this)||nws(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},tat.string)}else H9n.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},tat.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},tat.typedArray)):j9n(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},tat.blob))}get readyState(){return lo.brandCheck(this,t),this[Ssr]}get bufferedAmount(){return lo.brandCheck(this,t),this.#t}get url(){return lo.brandCheck(this,t),Kxs(this[F9n])}get extensions(){return lo.brandCheck(this,t),this.#n}get protocol(){return lo.brandCheck(this,t),this.#r}get onopen(){return lo.brandCheck(this,t),this.#e.open}set onopen(e){lo.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onerror(){return lo.brandCheck(this,t),this.#e.error}set onerror(e){lo.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}get onclose(){return lo.brandCheck(this,t),this.#e.close}set onclose(e){lo.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof e=="function"?(this.#e.close=e,this.addEventListener("close",e)):this.#e.close=null}get onmessage(){return lo.brandCheck(this,t),this.#e.message}set onmessage(e){lo.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get binaryType(){return lo.brandCheck(this,t),this[rat]}set binaryType(e){lo.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[rat]="blob":this[rat]=e}#o(e,r){this[U9n]=e;let n=new sws(this,r);n.on("drain",dws),n.on("error",fws.bind(this)),e.socket.ws=this,this[ews]=n,this.#i=new uws(e.socket),this[Ssr]=E2e.OPEN;let o=e.headersList.get("sec-websocket-extensions");o!==null&&(this.#n=o);let s=e.headersList.get("sec-websocket-protocol");s!==null&&(this.#r=s),Q9n("open",this)}};qT.CONNECTING=qT.prototype.CONNECTING=E2e.CONNECTING;qT.OPEN=qT.prototype.OPEN=E2e.OPEN;qT.CLOSING=qT.prototype.CLOSING=E2e.CLOSING;qT.CLOSED=qT.prototype.CLOSED=E2e.CLOSED;Object.defineProperties(qT.prototype,{CONNECTING:mH,OPEN:mH,CLOSING:mH,CLOSED:mH,url:Zw,readyState:Zw,bufferedAmount:Zw,onopen:Zw,onerror:Zw,onclose:Zw,close:Zw,onmessage:Zw,binaryType:Zw,send:Zw,extensions:Zw,protocol:Zw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(qT,{CONNECTING:mH,OPEN:mH,CLOSING:mH,CLOSED:mH});lo.converters["sequence"]=lo.sequenceConverter(lo.converters.DOMString);lo.converters["DOMString or sequence"]=function(t,e,r){return lo.util.Type(t)==="Object"&&Symbol.iterator in t?lo.converters["sequence"](t):lo.converters.DOMString(t,e,r)};lo.converters.WebSocketInit=lo.dictionaryConverter([{key:"protocols",converter:lo.converters["DOMString or sequence"],defaultValue:a(()=>new Array(0),"defaultValue")},{key:"dispatcher",converter:lo.converters.any,defaultValue:a(()=>aws(),"defaultValue")},{key:"headers",converter:lo.nullableConverter(lo.converters.HeadersInit)}]);lo.converters["DOMString or sequence or WebSocketInit"]=function(t){return lo.util.Type(t)==="Object"&&!(Symbol.iterator in t)?lo.converters.WebSocketInit(t):{protocols:lo.converters["DOMString or sequence"](t)}};lo.converters.WebSocketSendData=function(t){if(lo.util.Type(t)==="Object"){if(j9n(t))return lo.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||H9n.isArrayBuffer(t))return lo.converters.BufferSource(t)}return lo.converters.USVString(t)};function dws(){this.ws[U9n].socket.resume()}a(dws,"onParserDrain");function fws(t){let e,r;t instanceof lws?(e=t.reason,r=t.code):e=t.message,Q9n("error",this,()=>new cws("error",{error:t,message:e})),q9n(this,r)}a(fws,"onParserError");G9n.exports={WebSocket:qT}});var Tsr=I((wmf,V9n)=>{"use strict";p();function pws(t){return t.indexOf("\0")===-1}a(pws,"isValidLastEventId");function hws(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(hws,"isASCIINumber");function mws(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(mws,"delay");V9n.exports={isValidLastEventId:pws,isASCIINumber:hws,delay:mws}});var K9n=I((Pmf,Y9n)=>{"use strict";p();var{Transform:gws}=require("node:stream"),{isASCIINumber:W9n,isValidLastEventId:z9n}=Tsr(),A8=[239,187,191],Isr=10,nat=13,Aws=58,yws=32,xsr=class extends gws{static{a(this,"EventSourceStream")}state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,r,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===A8[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===A8[0]&&this.buffer[1]===A8[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===A8[0]&&this.buffer[1]===A8[1]&&this.buffer[2]===A8[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===A8[0]&&this.buffer[1]===A8[1]&&this.buffer[2]===A8[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&W9n(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&z9n(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};Y9n.exports={EventSourceStream:xsr}});var i7n=I((Mmf,n7n)=>{"use strict";p();var{pipeline:_ws}=require("node:stream"),{fetching:Ews}=c2e(),{makeRequest:vws}=Hpe(),{webidl:y8}=ty(),{EventSourceStream:Cws}=K9n(),{parseMIMEType:bws}=xb(),{createFastMessageEvent:Sws}=Ype(),{isNetworkError:J9n}=s2e(),{delay:Tws}=Tsr(),{kEnumerableProperty:iX}=Ws(),{environmentSettingsObject:Z9n}=NT(),X9n=!1,e7n=3e3,v2e=0,t7n=1,C2e=2,Iws="anonymous",xws="use-credentials",ehe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=v2e;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),y8.util.markAsUncloneable(this);let n="EventSource constructor";y8.argumentLengthCheck(arguments,1,n),X9n||(X9n=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=y8.converters.USVString(e,n,"url"),r=y8.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:e7n};let o=Z9n,s;try{s=new URL(e,o.settingsObject.baseUrl),this.#a.origin=s.origin}catch(u){throw new DOMException(u,"SyntaxError")}this.#t=s.href;let c=Iws;r.withCredentials&&(c=xws,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=Z9n.settingsObject,l.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],l.cache="no-store",l.initiator="other",l.urlList=[new URL(this.#t)],this.#i=vws(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===C2e)return;this.#n=v2e;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{J9n(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(J9n(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#u();return}let o=n.headersList.get("content-type",!0),s=o!==null?bws(o):"failure",c=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||c===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=t7n,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new Cws({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(Sws(u.type,u.options))},"push")});_ws(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=Ews(e)}async#u(){this.#n!==C2e&&(this.#n=v2e,this.dispatchEvent(new Event("error")),await Tws(this.#a.reconnectionTime),this.#n===v2e&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){y8.brandCheck(this,t),this.#n!==C2e&&(this.#n=C2e,this.#o.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}},r7n={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:v2e,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:t7n,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:C2e,writable:!1}};Object.defineProperties(ehe,r7n);Object.defineProperties(ehe.prototype,r7n);Object.defineProperties(ehe.prototype,{close:iX,onerror:iX,onmessage:iX,onopen:iX,readyState:iX,url:iX,withCredentials:iX});y8.converters.EventSourceInitDict=y8.dictionaryConverter([{key:"withCredentials",converter:y8.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:y8.converters.any}]);n7n.exports={EventSource:ehe,defaultReconnectionTime:e7n}});var c7n=I((Bmf,eo)=>{"use strict";p();var wws=wpe(),o7n=IPe(),Rws=Rpe(),kws=rFn(),Pws=kpe(),Dws=Jir(),Nws=IFn(),Mws=DFn(),s7n=Rc(),oat=Ws(),{InvalidArgumentError:iat}=s7n,the=y8n(),Ows=wPe(),Lws=Nor(),Bws=e6n(),Fws=Lor(),Uws=Eor(),Qws=ast(),{getGlobalDispatcher:a7n,setGlobalDispatcher:qws}=Ast(),jws=yst(),Hws=Kot(),Gws=Jot();Object.assign(o7n.prototype,the);eo.exports.Dispatcher=o7n;eo.exports.Client=wws;eo.exports.Pool=Rws;eo.exports.BalancedPool=kws;eo.exports.Agent=Pws;eo.exports.ProxyAgent=Dws;eo.exports.EnvHttpProxyAgent=Nws;eo.exports.RetryAgent=Mws;eo.exports.RetryHandler=Qws;eo.exports.DecoratorHandler=jws;eo.exports.RedirectHandler=Hws;eo.exports.createRedirectInterceptor=Gws;eo.exports.interceptors={redirect:a6n(),retry:l6n(),dump:d6n(),dns:h6n()};eo.exports.buildConnector=Ows;eo.exports.errors=s7n;eo.exports.util={parseHeaders:oat.parseHeaders,headerNameToString:oat.headerNameToString};function b2e(t){return(e,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new iat("invalid url");if(r!=null&&typeof r!="object")throw new iat("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new iat("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(oat.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=oat.parseURL(e);let{agent:o,dispatcher:s=a7n()}=r;if(o)throw new iat("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...r,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}a(b2e,"makeDispatcher");eo.exports.setGlobalDispatcher=qws;eo.exports.getGlobalDispatcher=a7n;var $ws=c2e().fetch;eo.exports.fetch=a(async function(e,r=void 0){try{return await $ws(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");eo.exports.Headers=JZ().Headers;eo.exports.Response=s2e().Response;eo.exports.Request=Hpe().Request;eo.exports.FormData=OPe().FormData;eo.exports.File=globalThis.File??require("node:buffer").File;eo.exports.FileReader=kUn().FileReader;var{setGlobalOrigin:Vws,getGlobalOrigin:Wws}=Znr();eo.exports.setGlobalOrigin=Vws;eo.exports.getGlobalOrigin=Wws;var{CacheStorage:zws}=UUn(),{kConstruct:Yws}=Ust();eo.exports.caches=new zws(Yws);var{deleteCookie:Kws,getCookies:Jws,getSetCookies:Zws,setCookie:Xws}=JUn();eo.exports.deleteCookie=Kws;eo.exports.getCookies=Jws;eo.exports.getSetCookies=Zws;eo.exports.setCookie=Xws;var{parseMIMEType:eRs,serializeAMimeType:tRs}=xb();eo.exports.parseMIMEType=eRs;eo.exports.serializeAMimeType=tRs;var{CloseEvent:rRs,ErrorEvent:nRs,MessageEvent:iRs}=Ype();eo.exports.WebSocket=$9n().WebSocket;eo.exports.CloseEvent=rRs;eo.exports.ErrorEvent=nRs;eo.exports.MessageEvent=iRs;eo.exports.request=b2e(the.request);eo.exports.stream=b2e(the.stream);eo.exports.pipeline=b2e(the.pipeline);eo.exports.connect=b2e(the.connect);eo.exports.upgrade=b2e(the.upgrade);eo.exports.MockClient=Lws;eo.exports.MockPool=Fws;eo.exports.MockAgent=Bws;eo.exports.mockErrors=Uws;var{EventSource:oRs}=i7n();eo.exports.EventSource=oRs});var Cs=I((Qmf,l7n)=>{p();l7n.exports={options:{usePureJavaScript:!1}}});var f7n=I((jmf,d7n)=>{p();var wsr={};d7n.exports=wsr;var u7n={};wsr.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=sRs(t,e);else{var o=0,s=e.length,c=e.charAt(0),l=[0];for(o=0;o0;)l.push(d%s),d=d/s|0}for(o=0;t[o]===0&&o=0;--o)n+=e[l[o]]}if(r){var f=new RegExp(".{1,"+r+"}","g");n=n.match(f).join(`\r +`)}return n};wsr.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=u7n[e];if(!r){r=u7n[e]=[];for(var n=0;n>=8;for(;d>0;)c.push(d&255),d>>=8}for(var f=0;t[f]===s&&f0;)s.push(l%n),l=l/n|0}var u="";for(r=0;t.at(r)===0&&r=0;--r)u+=e[s[r]];return u}a(sRs,"_encodeWithByteBuffer")});var Ac=I(($mf,g7n)=>{p();var p7n=Cs(),h7n=f7n(),nt=g7n.exports=p7n.util=p7n.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){nt.nextTick=process.nextTick,typeof setImmediate=="function"?nt.setImmediate=setImmediate:nt.setImmediate=nt.nextTick;return}if(typeof setImmediate=="function"){nt.setImmediate=function(){return setImmediate.apply(void 0,arguments)},nt.nextTick=function(l){return setImmediate(l)};return}if(nt.setImmediate=function(l){setTimeout(l,0)},typeof window<"u"&&typeof window.postMessage=="function"){let l=function(u){if(u.source===window&&u.data===t){u.stopPropagation();var d=e.slice();e.length=0,d.forEach(function(f){f()})}};var c=l;a(l,"handler");var t="forge.setImmediate",e=[];nt.setImmediate=function(u){e.push(u),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",l,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,o=document.createElement("div"),e=[];new MutationObserver(function(){var u=e.slice();e.length=0,u.forEach(function(d){d()})}).observe(o,{attributes:!0});var s=nt.setImmediate;nt.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),s(u)):(e.push(u),e.length===1&&o.setAttribute("a",n=!n))}}nt.nextTick=nt.setImmediate})();nt.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;nt.globalScope=(function(){return nt.isNodejs?global:typeof self>"u"?window:self})();nt.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};nt.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};nt.isArrayBufferView=function(t){return t&&nt.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function S2e(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(S2e,"_checkBitsParam");nt.ByteBuffer=Rsr;function Rsr(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(nt.isArrayBuffer(t)||nt.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;raRs&&(this.data.substr(0,1),this._constructedStringLength=0)};nt.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};nt.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};nt.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};nt.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};nt.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};nt.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(nt.encodeUtf8(t))};nt.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};nt.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};nt.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};nt.ByteStringBuffer.prototype.putInt=function(t,e){S2e(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};nt.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};nt.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};nt.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};nt.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};nt.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};nt.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};nt.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};nt.ByteStringBuffer.prototype.copy=function(){var t=nt.createBuffer(this.data);return t.read=this.read,t};nt.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};nt.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};nt.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};nt.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};nt.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};nt.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};nt.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};nt.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};nt.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};nt.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};nt.DataBuffer.prototype.putInt=function(t,e){S2e(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};nt.DataBuffer.prototype.putSignedInt=function(t,e){return S2e(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};nt.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};nt.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};nt.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};nt.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};nt.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};nt.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};nt.DataBuffer.prototype.copy=function(){return new nt.DataBuffer(this)};nt.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};nt.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};nt.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};nt.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};nt.xorBytes=function(t,e,r){for(var n="",o="",s="",c=0,l=0;r>0;--r,++c)o=t.charCodeAt(c)^e.charCodeAt(c),l>=10&&(n+=s,s="",l=0),s+=String.fromCharCode(o),++l;return n+=s,n};nt.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var gH="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",AH=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],m7n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";nt.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=gH.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=gH.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":gH.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +`,r=r.substr(e));return n+=r,n};nt.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,o,s,c=0;c>4),o!==64&&(e+=String.fromCharCode((n&15)<<4|o>>2),s!==64&&(e+=String.fromCharCode((o&3)<<6|s)));return e};nt.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};nt.decodeUtf8=function(t){return decodeURIComponent(escape(t))};nt.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:h7n.encode,decode:h7n.decode}};nt.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};nt.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var o=r,s=0;s>2),r+=gH.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=gH.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":gH.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +`,r=r.substr(e));return n+=r,n};nt.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var o,s,c,l,u=0,d=r;u>4,c!==64&&(n[d++]=(s&15)<<4|c>>2,l!==64&&(n[d++]=(c&3)<<6|l));return e?d-r:n.subarray(0,d)};nt.binary.base58.encode=function(t,e){return nt.binary.baseN.encode(t,m7n,e)};nt.binary.base58.decode=function(t,e){return nt.binary.baseN.decode(t,m7n,e)};nt.text={utf8:{},utf16:{}};nt.text.utf8.encode=function(t,e,r){t=nt.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var o=r,s=0;s"u"&&(r=["web","flash"]);var o,s=!1,c=null;for(var l in r){o=r[l];try{if(o==="flash"||o==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=o==="flash"}(o==="web"||o==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(u){c=u}if(s)break}if(!s)throw c;return n},"_callStorageFunction");nt.setItem=function(t,e,r,n,o){sat(lRs,arguments,o)};nt.getItem=function(t,e,r,n){return sat(uRs,arguments,n)};nt.removeItem=function(t,e,r,n){sat(dRs,arguments,n)};nt.clearItems=function(t,e,r){sat(fRs,arguments,r)};nt.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};nt.format=function(t){for(var e=/%./g,r,n,o=0,s=[],c=0;r=e.exec(t);){n=t.substring(c,e.lastIndex-2),n.length>0&&s.push(n),c=e.lastIndex;var l=r[0][1];switch(l){case"s":case"o":o");break;case"%":s.push("%");break;default:s.push("<%"+l+"?>")}}return s.push(t.substring(c)),s.join("")};nt.formatNumber=function(t,e,r,n){var o=t,s=isNaN(e=Math.abs(e))?2:e,c=r===void 0?",":r,l=n===void 0?".":n,u=o<0?"-":"",d=parseInt(o=Math.abs(+o||0).toFixed(s),10)+"",f=d.length>3?d.length%3:0;return u+(f?d.substr(0,f)+l:"")+d.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+l)+(s?c+Math.abs(o-d).toFixed(s).slice(2):"")};nt.formatSize=function(t){return t>=1073741824?t=nt.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=nt.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=nt.formatNumber(t/1024,0)+" KiB":t=nt.formatNumber(t,0)+" bytes",t};nt.bytesFromIP=function(t){return t.indexOf(".")!==-1?nt.bytesFromIPv4(t):t.indexOf(":")!==-1?nt.bytesFromIPv6(t):null};nt.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=nt.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var u=r[n];u.end-u.start>0&&(e.splice(u.start,u.end-u.start+1,""),u.start===0&&e.unshift(""),u.end===7&&e.push(""))}return e.join(":")};nt.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in nt&&!t.update)return e(null,nt.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return nt.cores=navigator.hardwareConcurrency,e(null,nt.cores);if(typeof Worker>"u")return nt.cores=1,e(null,nt.cores);if(typeof Blob>"u")return nt.cores=2,e(null,nt.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(c){for(var l=Date.now(),u=l+4;Date.now()g.st&&f.stf.st&&g.st{p();var Q0=Cs();Ac();A7n.exports=Q0.cipher=Q0.cipher||{};Q0.cipher.algorithms=Q0.cipher.algorithms||{};Q0.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Q0.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Q0.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Q0.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Q0.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Q0.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Q0.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Q0.cipher.algorithms[t]=e};Q0.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Q0.cipher.algorithms?Q0.cipher.algorithms[t]:null};var Dsr=Q0.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};Dsr.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=Q0.util.createBuffer(),this.output=t.output||Q0.util.createBuffer(),this.mode.start(e)};Dsr.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Dsr.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Msr=I((Kmf,y7n)=>{p();var q0=Cs();Ac();q0.cipher=q0.cipher||{};var ia=y7n.exports=q0.cipher.modes=q0.cipher.modes||{};ia.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};ia.ecb.prototype.start=function(t){};ia.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};ia.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};ia.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=cat(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};ia.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};ia.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=q0.util.createBuffer(),this._partialBytes=0};ia.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cat(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};ia.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};ia.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};ia.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=q0.util.createBuffer(),this._partialBytes=0};ia.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cat(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};ia.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};ia.ofb.prototype.decrypt=ia.ofb.prototype.encrypt;ia.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=q0.util.createBuffer(),this._partialBytes=0};ia.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cat(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};ia.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}lat(this._inBlock)};ia.ctr.prototype.decrypt=ia.ctr.prototype.encrypt;ia.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=q0.util.createBuffer(),this._partialBytes=0,this._R=3774873600};ia.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=q0.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=q0.util.createBuffer(t.additionalData):r=q0.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=q0.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Nsr(n*8)))}this._inBlock=this._j0.slice(0),lat(this._inBlock),this._partialBytes=0,r=q0.util.createBuffer(r),this._aDataLength=Nsr(r.length()*8);var o=r.length()%this.blockSize;for(o&&r.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};ia.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),lat(this._inBlock)};ia.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),lat(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var o=0;o0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};ia.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,o=t[n]>>>(7-r%8)*4&15,s=this._m[r][o];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};ia.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};ia.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,o=16*r,s=new Array(o),c=0;c>>1,o=new Array(r);o[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(o[2*s],o[s]=[]),s>>=1;for(s=2;s4){var r=t;t=q0.util.createBuffer();for(var n=0;n{p();var Lu=Cs();aat();Msr();Ac();C7n.exports=Lu.aes=Lu.aes||{};Lu.aes.startEncrypting=function(t,e,r,n){var o=uat({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};Lu.aes.createEncryptionCipher=function(t,e){return uat({key:t,output:null,decrypt:!1,mode:e})};Lu.aes.startDecrypting=function(t,e,r,n){var o=uat({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};Lu.aes.createDecryptionCipher=function(t,e){return uat({key:t,output:null,decrypt:!0,mode:e})};Lu.aes.Algorithm=function(t,e){Bsr||E7n();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return Lsr(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return Lsr(r._w,n,o,!0)},"decrypt")}}),r._init=!1};Lu.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=Lu.util.createBuffer(e);else if(Lu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Lu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,Tv[r]=l,Osr[l]=r,u=t[l],o=t[r],s=t[o],c=t[s],d=u<<24^l<<16^l<<8^(l^u),f=(o^s^c)<<24^(r^c)<<16^(r^s^c)<<8^(r^o^c);for(var h=0;h<4;++h)oX[h][r]=d,K2[h][l]=f,d=d<<24|d>>>8,f=f<<24|f>>>8;r===0?r=n=1:(r=o^t[t[t[o^c]]],n^=t[t[n]])}}a(E7n,"initialize");function v7n(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=rhe*c,u=s;u>>16&255]<<24^Tv[n>>>8&255]<<16^Tv[n&255]<<8^Tv[n>>>24]^_7n[o]<<24,o++):s>6&&u%s===4&&(n=Tv[n>>>24]<<24^Tv[n>>>16&255]<<16^Tv[n>>>8&255]<<8^Tv[n&255]),r[u]=r[u-s]^n;if(e){var d,f=K2[0],h=K2[1],m=K2[2],g=K2[3],A=r.slice(0);l=r.length;for(var u=0,y=l-rhe;u>>24]]^h[Tv[d>>>16&255]]^m[Tv[d>>>8&255]]^g[Tv[d&255]];r=A}return r}a(v7n,"_expandKey");function Lsr(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=K2[0],c=K2[1],l=K2[2],u=K2[3],d=Osr):(s=oX[0],c=oX[1],l=oX[2],u=oX[3],d=Tv);var f,h,m,g,A,y,_;f=e[0]^t[0],h=e[n?3:1]^t[1],m=e[2]^t[2],g=e[n?1:3]^t[3];for(var E=3,v=1;v>>24]^c[h>>>16&255]^l[m>>>8&255]^u[g&255]^t[++E],y=s[h>>>24]^c[m>>>16&255]^l[g>>>8&255]^u[f&255]^t[++E],_=s[m>>>24]^c[g>>>16&255]^l[f>>>8&255]^u[h&255]^t[++E],g=s[g>>>24]^c[f>>>16&255]^l[h>>>8&255]^u[m&255]^t[++E],f=A,h=y,m=_;r[0]=d[f>>>24]<<24^d[h>>>16&255]<<16^d[m>>>8&255]<<8^d[g&255]^t[++E],r[n?3:1]=d[h>>>24]<<24^d[m>>>16&255]<<16^d[g>>>8&255]<<8^d[f&255]^t[++E],r[2]=d[m>>>24]<<24^d[g>>>16&255]<<16^d[f>>>8&255]<<8^d[h&255]^t[++E],r[n?1:3]=d[g>>>24]<<24^d[f>>>16&255]<<16^d[h>>>8&255]<<8^d[m&255]^t[++E]}a(Lsr,"_updateBlock");function uat(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Lu.cipher.createDecipher(r,t.key):n=Lu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Lu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(uat,"_createCipher")});var _H=I((rgf,b7n)=>{p();var T2e=Cs();T2e.pki=T2e.pki||{};var Fsr=b7n.exports=T2e.pki.oids=T2e.oids=T2e.oids||{};function ar(t,e){Fsr[t]=e,Fsr[e]=t}a(ar,"_IN");function el(t,e){Fsr[t]=e}a(el,"_I_");ar("1.2.840.113549.1.1.1","rsaEncryption");ar("1.2.840.113549.1.1.4","md5WithRSAEncryption");ar("1.2.840.113549.1.1.5","sha1WithRSAEncryption");ar("1.2.840.113549.1.1.7","RSAES-OAEP");ar("1.2.840.113549.1.1.8","mgf1");ar("1.2.840.113549.1.1.9","pSpecified");ar("1.2.840.113549.1.1.10","RSASSA-PSS");ar("1.2.840.113549.1.1.11","sha256WithRSAEncryption");ar("1.2.840.113549.1.1.12","sha384WithRSAEncryption");ar("1.2.840.113549.1.1.13","sha512WithRSAEncryption");ar("1.3.101.112","EdDSA25519");ar("1.2.840.10040.4.3","dsa-with-sha1");ar("1.3.14.3.2.7","desCBC");ar("1.3.14.3.2.26","sha1");ar("1.3.14.3.2.29","sha1WithRSASignature");ar("2.16.840.1.101.3.4.2.1","sha256");ar("2.16.840.1.101.3.4.2.2","sha384");ar("2.16.840.1.101.3.4.2.3","sha512");ar("2.16.840.1.101.3.4.2.4","sha224");ar("2.16.840.1.101.3.4.2.5","sha512-224");ar("2.16.840.1.101.3.4.2.6","sha512-256");ar("1.2.840.113549.2.2","md2");ar("1.2.840.113549.2.5","md5");ar("1.2.840.113549.1.7.1","data");ar("1.2.840.113549.1.7.2","signedData");ar("1.2.840.113549.1.7.3","envelopedData");ar("1.2.840.113549.1.7.4","signedAndEnvelopedData");ar("1.2.840.113549.1.7.5","digestedData");ar("1.2.840.113549.1.7.6","encryptedData");ar("1.2.840.113549.1.9.1","emailAddress");ar("1.2.840.113549.1.9.2","unstructuredName");ar("1.2.840.113549.1.9.3","contentType");ar("1.2.840.113549.1.9.4","messageDigest");ar("1.2.840.113549.1.9.5","signingTime");ar("1.2.840.113549.1.9.6","counterSignature");ar("1.2.840.113549.1.9.7","challengePassword");ar("1.2.840.113549.1.9.8","unstructuredAddress");ar("1.2.840.113549.1.9.14","extensionRequest");ar("1.2.840.113549.1.9.20","friendlyName");ar("1.2.840.113549.1.9.21","localKeyId");ar("1.2.840.113549.1.9.22.1","x509Certificate");ar("1.2.840.113549.1.12.10.1.1","keyBag");ar("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");ar("1.2.840.113549.1.12.10.1.3","certBag");ar("1.2.840.113549.1.12.10.1.4","crlBag");ar("1.2.840.113549.1.12.10.1.5","secretBag");ar("1.2.840.113549.1.12.10.1.6","safeContentsBag");ar("1.2.840.113549.1.5.13","pkcs5PBES2");ar("1.2.840.113549.1.5.12","pkcs5PBKDF2");ar("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");ar("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");ar("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");ar("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");ar("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");ar("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");ar("1.2.840.113549.2.7","hmacWithSHA1");ar("1.2.840.113549.2.8","hmacWithSHA224");ar("1.2.840.113549.2.9","hmacWithSHA256");ar("1.2.840.113549.2.10","hmacWithSHA384");ar("1.2.840.113549.2.11","hmacWithSHA512");ar("1.2.840.113549.3.7","des-EDE3-CBC");ar("2.16.840.1.101.3.4.1.2","aes128-CBC");ar("2.16.840.1.101.3.4.1.22","aes192-CBC");ar("2.16.840.1.101.3.4.1.42","aes256-CBC");ar("2.5.4.3","commonName");ar("2.5.4.4","surname");ar("2.5.4.5","serialNumber");ar("2.5.4.6","countryName");ar("2.5.4.7","localityName");ar("2.5.4.8","stateOrProvinceName");ar("2.5.4.9","streetAddress");ar("2.5.4.10","organizationName");ar("2.5.4.11","organizationalUnitName");ar("2.5.4.12","title");ar("2.5.4.13","description");ar("2.5.4.15","businessCategory");ar("2.5.4.17","postalCode");ar("2.5.4.42","givenName");ar("2.5.4.65","pseudonym");ar("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");ar("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");ar("2.16.840.1.113730.1.1","nsCertType");ar("2.16.840.1.113730.1.13","nsComment");el("2.5.29.1","authorityKeyIdentifier");el("2.5.29.2","keyAttributes");el("2.5.29.3","certificatePolicies");el("2.5.29.4","keyUsageRestriction");el("2.5.29.5","policyMapping");el("2.5.29.6","subtreesConstraint");el("2.5.29.7","subjectAltName");el("2.5.29.8","issuerAltName");el("2.5.29.9","subjectDirectoryAttributes");el("2.5.29.10","basicConstraints");el("2.5.29.11","nameConstraints");el("2.5.29.12","policyConstraints");el("2.5.29.13","basicConstraints");ar("2.5.29.14","subjectKeyIdentifier");ar("2.5.29.15","keyUsage");el("2.5.29.16","privateKeyUsagePeriod");ar("2.5.29.17","subjectAltName");ar("2.5.29.18","issuerAltName");ar("2.5.29.19","basicConstraints");el("2.5.29.20","cRLNumber");el("2.5.29.21","cRLReason");el("2.5.29.22","expirationDate");el("2.5.29.23","instructionCode");el("2.5.29.24","invalidityDate");el("2.5.29.25","cRLDistributionPoints");el("2.5.29.26","issuingDistributionPoint");el("2.5.29.27","deltaCRLIndicator");el("2.5.29.28","issuingDistributionPoint");el("2.5.29.29","certificateIssuer");el("2.5.29.30","nameConstraints");ar("2.5.29.31","cRLDistributionPoints");ar("2.5.29.32","certificatePolicies");el("2.5.29.33","policyMappings");el("2.5.29.34","policyConstraints");ar("2.5.29.35","authorityKeyIdentifier");el("2.5.29.36","policyConstraints");ar("2.5.29.37","extKeyUsage");el("2.5.29.46","freshestCRL");el("2.5.29.54","inhibitAnyPolicy");ar("1.3.6.1.4.1.11129.2.4.2","timestampList");ar("1.3.6.1.5.5.7.1.1","authorityInfoAccess");ar("1.3.6.1.5.5.7.3.1","serverAuth");ar("1.3.6.1.5.5.7.3.2","clientAuth");ar("1.3.6.1.5.5.7.3.3","codeSigning");ar("1.3.6.1.5.5.7.3.4","emailProtection");ar("1.3.6.1.5.5.7.3.8","timeStamping")});var J2=I((ogf,T7n)=>{p();var Ad=Cs();Ac();_H();var sn=T7n.exports=Ad.asn1=Ad.asn1||{};sn.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};sn.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};sn.maxDepth=256;sn.create=function(t,e,r,n,o){if(Ad.util.isArray(n)){for(var s=[],c=0;ce){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}a(I2e,"_checkBufferLength");var pRs=a(function(t,e){var r=t.getByte();if(e--,r!==128){var n,o=r&128;if(!o)n=r;else{var s=r&127;I2e(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");sn.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"maxDepth"in e||(e.maxDepth=sn.maxDepth),typeof t=="string"&&(t=Ad.util.createBuffer(t));var r=t.length(),n=dat(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var o=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw o.byteCount=r,o.remaining=t.length(),o}return n};function dat(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;I2e(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=pRs(t,e);if(e-=o-t.length(),u!==void 0&&u>e){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=e,d.requested=u,d}u=e}var f,h,m=(s&32)===32;if(m)if(f=[],u===void 0)for(;;){if(I2e(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(dat(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(dat(t,u,r+1,n)),e-=o-t.length(),u-=o-t.length();if(f===void 0&&c===sn.Class.UNIVERSAL&&l===sn.Type.BITSTRING&&(h=t.bytes(u)),f===void 0&&n.decodeBitStrings&&c===sn.Class.UNIVERSAL&&l===sn.Type.BITSTRING&&u>1){var g=t.read,A=e,y=0;if(l===sn.Type.BITSTRING&&(I2e(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var _={strict:!0,decodeBitStrings:!0},E=dat(t,e,r+1,_),v=o-t.length();e-=v,l==sn.Type.BITSTRING&&v++;var S=E.tagClass;v===u&&(S===sn.Class.UNIVERSAL||S===sn.Class.CONTEXT_SPECIFIC)&&(f=[E])}catch{}f===void 0&&(t.read=g,e=A)}if(f===void 0){if(u===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");u=e}if(l===sn.Type.BMPSTRING)for(f="";u>0;u-=2)I2e(t,e,2),f+=String.fromCharCode(t.getInt16()),e-=2;else f=t.getBytes(u),e-=u}var T=h===void 0?null:{bitStringContents:h};return sn.create(c,l,m,f,T)}a(dat,"_fromDer");sn.toDer=function(t){var e=Ad.util.createBuffer(),r=t.tagClass|t.type,n=Ad.util.createBuffer(),o=!1;if("bitStringContents"in t&&(o=!0,t.original&&(o=sn.equals(t,t.original))),o)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&(t.value.charCodeAt(1)&128)===0||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var c=n.length(),l="";do l+=String.fromCharCode(c&255),c=c>>>8;while(c>0);e.putByte(l.length|128);for(var s=l.length-1;s>=0;--s)e.putByte(l.charCodeAt(s))}return e.putBuffer(n),e};sn.oidToDer=function(t){var e=t.split("."),r=Ad.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,o,s,c,l=2;l4294967295)throw new Error("OID value too large; max is 32-bits.");do c=s&127,s=s>>>7,n||(c|=128),o.push(c),n=!1;while(s>0);for(var u=o.length-1;u>=0;--u)r.putByte(o[u])}return r};sn.derToOid=function(t){var e;typeof t=="string"&&(t=Ad.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;){if(n>70368744177663)throw new Error("OID value too large; max is 53-bits.");r=t.getByte(),n=n*128,r&128?n+=r&127:(e+="."+(n+r),n=0)}return e};sn.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,o=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),c=parseInt(t.substr(8,2),10),l=0;if(t.length>11){var u=t.charAt(10),d=10;u!=="+"&&u!=="-"&&(l=parseInt(t.substr(10,2),10),d+=2)}if(e.setUTCFullYear(r,n,o),e.setUTCHours(s,c,l,0),d&&(u=t.charAt(d),u==="+"||u==="-")){var f=parseInt(t.substr(d+1,2),10),h=parseInt(t.substr(d+4,2),10),m=f*60+h;m*=6e4,u==="+"?e.setTime(+e-m):e.setTime(+e+m)}return e};sn.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,o=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),c=parseInt(t.substr(10,2),10),l=parseInt(t.substr(12,2),10),u=0,d=0,f=!1;t.charAt(t.length-1)==="Z"&&(f=!0);var h=t.length-5,m=t.charAt(h);if(m==="+"||m==="-"){var g=parseInt(t.substr(h+1,2),10),A=parseInt(t.substr(h+4,2),10);d=g*60+A,d*=6e4,m==="+"&&(d*=-1),f=!0}return t.charAt(14)==="."&&(u=parseFloat(t.substr(14),10)*1e3),f?(e.setUTCFullYear(r,n,o),e.setUTCHours(s,c,l,u),e.setTime(+e+d)):(e.setFullYear(r,n,o),e.setHours(s,c,l,u)),e};sn.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};sn.derToInteger=function(t){typeof t=="string"&&(t=Ad.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};sn.validate=function(t,e,r,n){var o=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(o=!0,e.value&&Ad.util.isArray(e.value))for(var s=0,c=0;o&&c0&&(n+=` `);for(var o="",s=0;s1?n+="0x"+Ad.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var d=t.value.charCodeAt(0);d==1?n+=" (1 unused bit shown)":d>1&&(n+=" ("+d+" unused bits shown)")}}else if(t.type===sn.Type.OCTETSTRING)C7n.test(t.value)||(n+="("+t.value+") "),n+="0x"+Ad.util.bytesToHex(t.value);else if(t.type===sn.Type.UTF8)try{n+=Ad.util.decodeUtf8(t.value)}catch(f){if(f.message==="URI malformed")n+="0x"+Ad.util.bytesToHex(t.value)+" (malformed UTF8)";else throw f}else t.type===sn.Type.PRINTABLESTRING||t.type===sn.Type.IA5String?n+=t.value:C7n.test(t.value)?n+="0x"+Ad.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var t4=I((sgf,S7n)=>{p();var fat=Cs();S7n.exports=fat.md=fat.md||{};fat.md.algorithms=fat.md.algorithms||{}});var nhe=I((cgf,T7n)=>{p();var _8=Cs();t4();Ac();var fRs=T7n.exports=_8.hmac=_8.hmac||{};fRs.create=function(){var t=null,e=null,r=null,n=null,o={};return o.start=function(s,c){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in _8.md.algorithms)e=_8.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(c===null)c=t;else{if(typeof c=="string")c=_8.util.createBuffer(c);else if(_8.util.isArray(c)){var l=c;c=_8.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=_8.util.createBuffer(),n=_8.util.createBuffer(),d=c.length();for(var u=0;u{p();var r4=Cs();t4();Ac();var x7n=R7n.exports=r4.md5=r4.md5||{};r4.md.md5=r4.md.algorithms.md5=x7n;x7n.create=function(){w7n||pRs();var t=null,e=r4.util.createBuffer(),r=new Array(16),n={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),I7n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=r4.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(Fsr.substr(0,n.blockLength-c));for(var l,u=0,d=n.fullMessageLength.length-1;d>=0;--d)l=n.fullMessageLength[d]*8+u,u=l/4294967296>>>0,o.putInt32Le(l>>>0);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3};I7n(f,r,o);var h=r4.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var Fsr=null,pat=null,x2e=null,ihe=null,w7n=!1;function pRs(){Fsr="\x80",Fsr+=r4.util.fillString("\0",64),pat=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],x2e=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],ihe=new Array(64);for(var t=0;t<64;++t)ihe[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);w7n=!0}a(pRs,"_init");function I7n(t,e,r){for(var n,o,s,c,l,u,d,f,h=r.length();h>=64;){for(o=t.h0,s=t.h1,c=t.h2,l=t.h3,f=0;f<16;++f)e[f]=r.getInt32Le(),u=l^s&(c^l),n=o+u+ihe[f]+e[f],d=x2e[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+ihe[f]+e[pat[f]],d=x2e[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+ihe[f]+e[pat[f]],d=x2e[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+ihe[f]+e[pat[f]],d=x2e[f],o=l,l=c,c=s,s+=n<>>32-d;t.h0=t.h0+o|0,t.h1=t.h1+s|0,t.h2=t.h2+c|0,t.h3=t.h3+l|0,h-=64}}a(I7n,"_update")});var oX=I((pgf,P7n)=>{p();var gat=Cs();Ac();var k7n=P7n.exports=gat.pem=gat.pem||{};k7n.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r +`,t.composed){for(var c=0,l="",s=0;s1?n+="0x"+Ad.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var d=t.value.charCodeAt(0);d==1?n+=" (1 unused bit shown)":d>1&&(n+=" ("+d+" unused bits shown)")}}else if(t.type===sn.Type.OCTETSTRING)S7n.test(t.value)||(n+="("+t.value+") "),n+="0x"+Ad.util.bytesToHex(t.value);else if(t.type===sn.Type.UTF8)try{n+=Ad.util.decodeUtf8(t.value)}catch(f){if(f.message==="URI malformed")n+="0x"+Ad.util.bytesToHex(t.value)+" (malformed UTF8)";else throw f}else t.type===sn.Type.PRINTABLESTRING||t.type===sn.Type.IA5String?n+=t.value:S7n.test(t.value)?n+="0x"+Ad.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var t4=I((cgf,I7n)=>{p();var fat=Cs();I7n.exports=fat.md=fat.md||{};fat.md.algorithms=fat.md.algorithms||{}});var ihe=I((ugf,x7n)=>{p();var _8=Cs();t4();Ac();var hRs=x7n.exports=_8.hmac=_8.hmac||{};hRs.create=function(){var t=null,e=null,r=null,n=null,o={};return o.start=function(s,c){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in _8.md.algorithms)e=_8.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(c===null)c=t;else{if(typeof c=="string")c=_8.util.createBuffer(c);else if(_8.util.isArray(c)){var l=c;c=_8.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=_8.util.createBuffer(),n=_8.util.createBuffer(),d=c.length();for(var u=0;u{p();var r4=Cs();t4();Ac();var R7n=P7n.exports=r4.md5=r4.md5||{};r4.md.md5=r4.md.algorithms.md5=R7n;R7n.create=function(){k7n||mRs();var t=null,e=r4.util.createBuffer(),r=new Array(16),n={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),w7n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=r4.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(Usr.substr(0,n.blockLength-c));for(var l,u=0,d=n.fullMessageLength.length-1;d>=0;--d)l=n.fullMessageLength[d]*8+u,u=l/4294967296>>>0,o.putInt32Le(l>>>0);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3};w7n(f,r,o);var h=r4.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var Usr=null,pat=null,x2e=null,ohe=null,k7n=!1;function mRs(){Usr="\x80",Usr+=r4.util.fillString("\0",64),pat=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],x2e=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],ohe=new Array(64);for(var t=0;t<64;++t)ohe[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);k7n=!0}a(mRs,"_init");function w7n(t,e,r){for(var n,o,s,c,l,u,d,f,h=r.length();h>=64;){for(o=t.h0,s=t.h1,c=t.h2,l=t.h3,f=0;f<16;++f)e[f]=r.getInt32Le(),u=l^s&(c^l),n=o+u+ohe[f]+e[f],d=x2e[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+ohe[f]+e[pat[f]],d=x2e[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+ohe[f]+e[pat[f]],d=x2e[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+ohe[f]+e[pat[f]],d=x2e[f],o=l,l=c,c=s,s+=n<>>32-d;t.h0=t.h0+o|0,t.h1=t.h1+s|0,t.h2=t.h2+c|0,t.h3=t.h3+l|0,h-=64}}a(w7n,"_update")});var sX=I((mgf,N7n)=>{p();var gat=Cs();Ac();var D7n=N7n.exports=gat.pem=gat.pem||{};D7n.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r `,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=mat(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=mat(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=mat(n)),t.headers)for(var o=0;o65&&c!==-1){var l=e[c];l===","?(++c,e=e.substr(0,c)+`\r `+e.substr(c)):e=e.substr(0,c)+`\r -`+l+e.substr(c+1),s=o-c-1,c=-1,++o}else(e[o]===" "||e[o]===" "||e[o]===",")&&(c=o);return e}a(mat,"foldHeader");function hRs(t){return t.replace(/^\s+/,"")}a(hRs,"ltrim")});var w2e=I((ggf,N7n)=>{p();var nf=Cs();aat();Nsr();Ac();N7n.exports=nf.des=nf.des||{};nf.des.startEncrypting=function(t,e,r,n){var o=Aat({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};nf.des.createEncryptionCipher=function(t,e){return Aat({key:t,output:null,decrypt:!1,mode:e})};nf.des.startDecrypting=function(t,e,r,n){var o=Aat({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};nf.des.createDecryptionCipher=function(t,e){return Aat({key:t,output:null,decrypt:!0,mode:e})};nf.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return D7n(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return D7n(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};nf.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=nf.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=bRs(e),this._init=!0}};n4("DES-ECB",nf.cipher.modes.ecb);n4("DES-CBC",nf.cipher.modes.cbc);n4("DES-CFB",nf.cipher.modes.cfb);n4("DES-OFB",nf.cipher.modes.ofb);n4("DES-CTR",nf.cipher.modes.ctr);n4("3DES-ECB",nf.cipher.modes.ecb);n4("3DES-CBC",nf.cipher.modes.cbc);n4("3DES-CFB",nf.cipher.modes.cfb);n4("3DES-OFB",nf.cipher.modes.ofb);n4("3DES-CTR",nf.cipher.modes.ctr);function n4(t,e){var r=a(function(){return new nf.des.Algorithm(t,e)},"factory");nf.cipher.registerAlgorithm(t,r)}a(n4,"registerAlgorithm");var mRs=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],gRs=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],ARs=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],yRs=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],_Rs=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],ERs=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],vRs=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],CRs=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function bRs(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],c=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],l=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],d=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],m=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],A=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=t.length()>8?3:1,_=[],E=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,S,T=0;T>>4^R)&252645135,R^=S,w^=S<<4,S=(R>>>-16^w)&65535,w^=S,R^=S<<-16,S=(w>>>2^R)&858993459,R^=S,w^=S<<2,S=(R>>>-16^w)&65535,w^=S,R^=S<<-16,S=(w>>>1^R)&1431655765,R^=S,w^=S<<1,S=(R>>>8^w)&16711935,w^=S,R^=S<<8,S=(w>>>1^R)&1431655765,R^=S,w^=S<<1,S=w<<8|R>>>20&240,w=R<<24|R<<8&16711680|R>>>8&65280|R>>>24&240,R=S;for(var x=0;x>>26,R=R<<2|R>>>26):(w=w<<1|w>>>27,R=R<<1|R>>>27),w&=-15,R&=-15;var k=e[w>>>28]|r[w>>>24&15]|n[w>>>20&15]|o[w>>>16&15]|s[w>>>12&15]|c[w>>>8&15]|l[w>>>4&15],D=u[R>>>28]|d[R>>>24&15]|f[R>>>20&15]|h[R>>>16&15]|m[R>>>12&15]|g[R>>>8&15]|A[R>>>4&15];S=(D>>>16^k)&65535,_[v++]=k^S,_[v++]=D^S<<16}}return _}a(bRs,"_createKeys");function D7n(t,e,r,n){var o=t.length===32?3:9,s;o===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var c,l=e[0],u=e[1];c=(l>>>4^u)&252645135,u^=c,l^=c<<4,c=(l>>>16^u)&65535,u^=c,l^=c<<16,c=(u>>>2^l)&858993459,l^=c,u^=c<<2,c=(u>>>8^l)&16711935,l^=c,u^=c<<8,c=(l>>>1^u)&1431655765,u^=c,l^=c<<1,l=l<<1|l>>>31,u=u<<1|u>>>31;for(var d=0;d>>4|u<<28)^t[m+1];c=l,l=u,u=c^(gRs[g>>>24&63]|yRs[g>>>16&63]|ERs[g>>>8&63]|CRs[g&63]|mRs[A>>>24&63]|ARs[A>>>16&63]|_Rs[A>>>8&63]|vRs[A&63])}c=l,l=u,u=c}l=l>>>1|l<<31,u=u>>>1|u<<31,c=(l>>>1^u)&1431655765,u^=c,l^=c<<1,c=(u>>>8^l)&16711935,l^=c,u^=c<<8,c=(u>>>2^l)&858993459,l^=c,u^=c<<2,c=(l>>>16^u)&65535,u^=c,l^=c<<16,c=(l>>>4^u)&252645135,u^=c,l^=c<<4,r[0]=l,r[1]=u}a(D7n,"_updateBlock");function Aat(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=nf.cipher.createDecipher(r,t.key):n=nf.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof nf.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(Aat,"_createCipher")});var yat=I((_gf,M7n)=>{p();var Iv=Cs();nhe();t4();Ac();var SRs=Iv.pkcs5=Iv.pkcs5||{},E8;Iv.util.isNodejs&&!Iv.options.usePureJavaScript&&(E8=require("crypto"));M7n.exports=Iv.pbkdf2=SRs.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),Iv.util.isNodejs&&!Iv.options.usePureJavaScript&&E8.pbkdf2&&(o===null||typeof o!="object")&&(E8.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?E8.pbkdf2Sync.length===4?E8.pbkdf2(t,e,r,n,function(S,T){if(S)return s(S);s(null,T.toString("binary"))}):E8.pbkdf2(t,e,r,n,o,function(S,T){if(S)return s(S);s(null,T.toString("binary"))}):E8.pbkdf2Sync.length===4?E8.pbkdf2Sync(t,e,r,n).toString("binary"):E8.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in Iv.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=Iv.md[o].create()}var c=o.digestLength;if(n>4294967295*c){var l=new Error("Derived key is too long.");if(s)return s(l);throw l}var u=Math.ceil(n/c),d=n-(u-1)*c,f=Iv.hmac.create();f.start(o,t);var h="",m,g,A;if(!s){for(var y=1;y<=u;++y){f.start(null,null),f.update(e),f.update(Iv.util.int32ToBytes(y)),m=A=f.digest().getBytes();for(var _=2;_<=r;++_)f.start(null,null),f.update(A),g=f.digest().getBytes(),m=Iv.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(Iv.util.int32ToBytes(y)),m=A=f.digest().getBytes(),_=2,v()}a(E,"outer");function v(){if(_<=r)return f.start(null,null),f.update(A),g=f.digest().getBytes(),m=Iv.util.xorBytes(m,g,c),A=g,++_,Iv.util.setImmediate(v);h+=y{p();var i4=Cs();t4();Ac();var L7n=U7n.exports=i4.sha256=i4.sha256||{};i4.md.sha256=i4.md.algorithms.sha256=L7n;L7n.create=function(){B7n||TRs();var t=null,e=i4.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),O7n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=i4.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(Usr.substr(0,n.blockLength-c));for(var l,u,d=n.fullMessageLength[0]*8,f=0;f>>0,d+=u,o.putInt32(d>>>0),d=l>>>0;o.putInt32(d);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};O7n(h,r,o);var m=i4.util.createBuffer();return m.putInt32(h.h0),m.putInt32(h.h1),m.putInt32(h.h2),m.putInt32(h.h3),m.putInt32(h.h4),m.putInt32(h.h5),m.putInt32(h.h6),m.putInt32(h.h7),m},n};var Usr=null,B7n=!1,F7n=null;function TRs(){Usr="\x80",Usr+=i4.util.fillString("\0",64),F7n=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],B7n=!0}a(TRs,"_init");function O7n(t,e,r){for(var n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v=r.length();v>=64;){for(d=0;d<16;++d)e[d]=r.getInt32();for(;d<64;++d)n=e[d-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,o=e[d-15],o=(o>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,e[d]=n+e[d-7]+o+e[d-16]|0;for(f=t.h0,h=t.h1,m=t.h2,g=t.h3,A=t.h4,y=t.h5,_=t.h6,E=t.h7,d=0;d<64;++d)c=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7),l=_^A&(y^_),s=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),u=f&h|m&(f^h),n=E+c+l+F7n[d]+e[d],o=s+u,E=_,_=y,y=A,A=g+n>>>0,g=m,m=h,h=f,f=n+o>>>0;t.h0=t.h0+f|0,t.h1=t.h1+h|0,t.h2=t.h2+m|0,t.h3=t.h3+g|0,t.h4=t.h4+A|0,t.h5=t.h5+y|0,t.h6=t.h6+_|0,t.h7=t.h7+E|0,v-=64}}a(O7n,"_update")});var qsr=I((Tgf,Q7n)=>{p();var o4=Cs();Ac();var _at=null;o4.util.isNodejs&&!o4.options.usePureJavaScript&&!process.versions["node-webkit"]&&(_at=require("crypto"));var IRs=Q7n.exports=o4.prng=o4.prng||{};IRs.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),o=0;o<32;++o)n[o]=r.create();e.pools=n,e.pool=0,e.generate=function(d,f){if(!f)return e.generateSync(d);var h=e.plugin.cipher,m=e.plugin.increment,g=e.plugin.formatKey,A=e.plugin.formatSeed,y=o4.util.createBuffer();e.key=null,_();function _(E){if(E)return f(E);if(y.length()>=d)return f(null,y.getBytes(d));if(e.generated>1048575&&(e.key=null),e.key===null)return o4.util.nextTick(function(){s(_)});var v=h(e.key,e.seed);e.generated+=v.length,y.putBytes(v),e.key=g(h(e.key,m(e.seed))),e.seed=A(h(e.key,e.seed)),o4.util.setImmediate(_)}a(_,"generate")},e.generateSync=function(d){var f=e.plugin.cipher,h=e.plugin.increment,m=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var A=o4.util.createBuffer();A.length()1048575&&(e.key=null),e.key===null&&c();var y=f(e.key,e.seed);e.generated+=y.length,A.putBytes(y),e.key=m(f(e.key,h(e.seed))),e.seed=g(f(e.key,e.seed))}return A.getBytes(d)};function s(d){if(e.pools[0].messageLength>=32)return l(),d();var f=32-e.pools[0].messageLength<<5;e.seedFile(f,function(h,m){if(h)return d(h);e.collect(m),l(),d()})}a(s,"_reseed");function c(){if(e.pools[0].messageLength>=32)return l();var d=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(d)),l()}a(c,"_reseedSync");function l(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var d=e.plugin.md.create();d.update(e.keyBytes);for(var f=1,h=0;h<32;++h)e.reseeds%f===0&&(d.update(e.pools[h].digest().getBytes()),e.pools[h].start()),f=f<<1;e.keyBytes=d.digest().getBytes(),d.start(),d.update(e.keyBytes);var m=d.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(m),e.generated=0}a(l,"_seed");function u(d){var f=null,h=o4.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=o4.util.createBuffer();if(f)for(;g.length()>16),v+=(E&32767)<<16,v+=E>>15,v=(v&2147483647)+(v>>31),T=v&4294967295;for(var _=0;_<3;++_)S=T>>>(_<<3),S^=Math.floor(Math.random()*256),g.putByte(S&255)}return g.getBytes(d)}return a(u,"defaultSeedFile"),_at?(e.seedFile=function(d,f){_at.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return _at.randomBytes(d).toString()}):(e.seedFile=function(d,f){try{f(null,u(d))}catch(h){f(h)}},e.seedFileSync=u),e.collect=function(d){for(var f=d.length,h=0;h>m&255);e.collect(h)},e.registerWorker=function(d){if(d===self)e.seedFile=function(h,m){function g(A){var y=A.data;y.forge&&y.forge.prng&&(self.removeEventListener("message",g),m(y.forge.prng.err,y.forge.prng.bytes))}a(g,"listener"),self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var f=a(function(h){var m=h.data;m.forge&&m.forge.prng&&e.seedFile(m.forge.prng.needed,function(g,A){d.postMessage({forge:{prng:{err:g,bytes:A}}})})},"listener");d.addEventListener("message",f)}},e}});var Xw=I((wgf,jsr)=>{p();var q0=Cs();yH();Qsr();qsr();Ac();(function(){if(q0.random&&q0.random.getBytes){jsr.exports=q0.random;return}(function(t){var e={},r=new Array(4),n=q0.util.createBuffer();e.formatKey=function(h){var m=q0.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),q0.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=q0.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),h},e.cipher=function(h,m){return q0.aes._updateBlock(h,m,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=q0.md.sha256;function o(){var h=q0.prng.create(e);return h.getBytes=function(m,g){return h.generate(m,g)},h.getBytesSync=function(m){return h.generate(m)},h}a(o,"spawnPrng");var s=o(),c=null,l=q0.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),q0.options.usePureJavaScript||!q0.util.isNodejs&&!c){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var d="";for(var f in navigator)try{typeof navigator[f]=="string"&&(d+=navigator[f])}catch{}s.collect(d),d=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!q0.random)q0.random=s;else for(var f in s)q0.random[f]=s[f];q0.random.createInstance=o,jsr.exports=q0.random})(typeof jQuery<"u"?jQuery:null)})()});var Gsr=I((Pgf,H7n)=>{p();var Nb=Cs();Ac();var Hsr=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],q7n=[1,2,3,5],xRs=a(function(t,e){return t<>16-e},"rol"),wRs=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");H7n.exports=Nb.rc2=Nb.rc2||{};Nb.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Nb.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),o=e,s=Math.ceil(o/8),c=255>>(o&7),l;for(l=n;l<128;l++)r.putByte(Hsr[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,Hsr[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,Hsr[r.at(l+1)^r.at(l+s)]);return r};var j7n=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=Nb.rc2.expandKey(t,e),d=0;d<64;d++)h.push(t.getInt16Le());r?(l=a(function(A){for(d=0;d<4;d++)A[d]+=h[f]+(A[(d+3)%4]&A[(d+2)%4])+(~A[(d+3)%4]&A[(d+1)%4]),A[d]=xRs(A[d],q7n[d]),f++},"mixRound"),u=a(function(A){for(d=0;d<4;d++)A[d]+=h[A[(d+3)%4]&63]},"mashRound")):(l=a(function(A){for(d=3;d>=0;d--)A[d]=wRs(A[d],q7n[d]),A[d]-=h[f]+(A[(d+3)%4]&A[(d+2)%4])+(~A[(d+3)%4]&A[(d+1)%4]),f--},"mixRound"),u=a(function(A){for(d=3;d>=0;d--)A[d]-=h[A[(d+3)%4]&63]},"mashRound"));var m=a(function(A){var y=[];for(d=0;d<4;d++){var _=o.getInt16Le();c!==null&&(r?_^=c.getInt16Le():c.putInt16Le(_)),y.push(_&65535)}f=r?0:63;for(var E=0;E=8;)m([[5,l],[1,u],[6,l],[1,u],[5,l]])},"update"),finish:a(function(A){var y=!0;if(r)if(A)y=A(8,o,!r);else{var _=o.length()===8?8:8-o.length();o.fillWithByte(_,_)}if(y&&(n=!0,g.update()),!r&&(y=o.length()===0,y))if(A)y=A(8,s,!r);else{var E=s.length(),v=s.at(E-1);v>E?y=!1:s.truncate(v)}return y},"finish")},g},"createCipher");Nb.rc2.startEncrypting=function(t,e,r){var n=Nb.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Nb.rc2.createEncryptionCipher=function(t,e){return j7n(t,e,!0)};Nb.rc2.startDecrypting=function(t,e,r){var n=Nb.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Nb.rc2.createDecryptionCipher=function(t,e){return j7n(t,e,!1)}});var k2e=I((Mgf,J7n)=>{p();var $sr=Cs();J7n.exports=$sr.jsbn=$sr.jsbn||{};var v8,RRs=0xdeadbeefcafe,G7n=(RRs&16777215)==15715070;function Wt(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}a(Wt,"BigInteger");$sr.jsbn.BigInteger=Wt;function tc(){return new Wt(null)}a(tc,"nbi");function kRs(t,e,r,n,o,s){for(;--s>=0;){var c=e*this.data[t++]+r.data[n]+o;o=Math.floor(c/67108864),r.data[n++]=c&67108863}return o}a(kRs,"am1");function PRs(t,e,r,n,o,s){for(var c=e&32767,l=e>>15;--s>=0;){var u=this.data[t]&32767,d=this.data[t++]>>15,f=l*u+d*c;u=c*u+((f&32767)<<15)+r.data[n]+(o&1073741823),o=(u>>>30)+(f>>>15)+l*d+(o>>>30),r.data[n++]=u&1073741823}return o}a(PRs,"am2");function $7n(t,e,r,n,o,s){for(var c=e&16383,l=e>>14;--s>=0;){var u=this.data[t]&16383,d=this.data[t++]>>14,f=l*u+d*c;u=c*u+((f&16383)<<14)+r.data[n]+o,o=(u>>28)+(f>>14)+l*d,r.data[n++]=u&268435455}return o}a($7n,"am3");typeof navigator>"u"?(Wt.prototype.am=$7n,v8=28):G7n&&navigator.appName=="Microsoft Internet Explorer"?(Wt.prototype.am=PRs,v8=30):G7n&&navigator.appName!="Netscape"?(Wt.prototype.am=kRs,v8=26):(Wt.prototype.am=$7n,v8=28);Wt.prototype.DB=v8;Wt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(NRs,"bnpCopyTo");function MRs(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}a(MRs,"bnpFromInt");function EH(t){var e=tc();return e.fromInt(t),e}a(EH,"nbv");function ORs(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,o=!1,s=0;--n>=0;){var c=r==8?t[n]&255:W7n(t,n);if(c<0){t.charAt(n)=="-"&&(o=!0);continue}o=!1,s==0?this.data[this.t++]=c:s+r>this.DB?(this.data[this.t-1]|=(c&(1<>this.DB-s):this.data[this.t-1]|=c<=this.DB&&(s-=this.DB)}r==8&&(t[0]&128)!=0&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}a(LRs,"bnpClamp");function BRs(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(l>l)>0&&(o=!0,s=V7n(n));c>=0;)l>(l+=this.DB-e)):(n=this.data[c]>>(l-=e)&r,l<=0&&(l+=this.DB,--c)),n>0&&(o=!0),o&&(s+=V7n(n));return o?s:"0"}a(BRs,"bnToString");function FRs(){var t=tc();return Wt.ZERO.subTo(this,t),t}a(FRs,"bnNegate");function URs(){return this.s<0?this.negate():this}a(URs,"bnAbs");function QRs(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}a(QRs,"bnCompareTo");function vat(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}a(vat,"nbits");function qRs(){return this.t<=0?0:this.DB*(this.t-1)+vat(this.data[this.t-1]^this.s&this.DM)}a(qRs,"bnBitLength");function jRs(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}a(jRs,"bnpDLShiftTo");function HRs(t,e){for(var r=t;r=0;--l)e.data[l+s+1]=this.data[l]>>n|c,c=(this.data[l]&o)<=0;--l)e.data[l]=0;e.data[s]=c,e.t=this.t+s+1,e.s=this.s,e.clamp()}a(GRs,"bnpLShiftTo");function $Rs(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,o=this.DB-n,s=(1<>n;for(var c=r+1;c>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}a(VRs,"bnpSubTo");function WRs(t,e){var r=this.abs(),n=t.abs(),o=r.t;for(e.t=o+n.t;--o>=0;)e.data[o]=0;for(o=0;o=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}a(zRs,"bnpSquareTo");function YRs(t,e,r){var n=t.abs();if(!(n.t<=0)){var o=this.abs();if(o.t0?(n.lShiftTo(u,s),o.lShiftTo(u,r)):(n.copyTo(s),o.copyTo(r));var d=s.t,f=s.data[d-1];if(f!=0){var h=f*(1<1?s.data[d-2]>>this.F2:0),m=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(E,r)),Wt.ONE.dlShiftTo(d,E),E.subTo(s,s);s.t=0;){var v=r.data[--y]==f?this.DM:Math.floor(r.data[y]*m+(r.data[y-1]+A)*g);if((r.data[y]+=s.am(0,v,r,_,0,d))0&&r.rShiftTo(u,r),c<0&&Wt.ZERO.subTo(r,r)}}}a(YRs,"bnpDivRemTo");function KRs(t){var e=tc();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Wt.ZERO)>0&&t.subTo(e,e),e}a(KRs,"bnMod");function sX(t){this.m=t}a(sX,"Classic");function JRs(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(JRs,"cConvert");function ZRs(t){return t}a(ZRs,"cRevert");function XRs(t){t.divRemTo(this.m,null,t)}a(XRs,"cReduce");function eks(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(eks,"cMulTo");function tks(t,e){t.squareTo(e),this.reduce(e)}a(tks,"cSqrTo");sX.prototype.convert=JRs;sX.prototype.revert=ZRs;sX.prototype.reduce=XRs;sX.prototype.mulTo=eks;sX.prototype.sqrTo=tks;function rks(){if(this.t<1)return 0;var t=this.data[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}a(rks,"bnpInvDigit");function aX(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}a(nks,"montConvert");function iks(t){var e=tc();return t.copyTo(e),this.reduce(e),e}a(iks,"montRevert");function oks(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}a(oks,"montReduce");function sks(t,e){t.squareTo(e),this.reduce(e)}a(sks,"montSqrTo");function aks(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(aks,"montMulTo");aX.prototype.convert=nks;aX.prototype.revert=iks;aX.prototype.reduce=oks;aX.prototype.mulTo=aks;aX.prototype.sqrTo=sks;function cks(){return(this.t>0?this.data[0]&1:this.s)==0}a(cks,"bnpIsEven");function lks(t,e){if(t>4294967295||t<1)return Wt.ONE;var r=tc(),n=tc(),o=e.convert(this),s=vat(t)-1;for(o.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,o,r);else{var c=r;r=n,n=c}return e.revert(r)}a(lks,"bnpExp");function uks(t,e){var r;return t<256||e.isEven()?r=new sX(e):r=new aX(e),this.exp(t,r)}a(uks,"bnModPowInt");Wt.prototype.copyTo=NRs;Wt.prototype.fromInt=MRs;Wt.prototype.fromString=ORs;Wt.prototype.clamp=LRs;Wt.prototype.dlShiftTo=jRs;Wt.prototype.drShiftTo=HRs;Wt.prototype.lShiftTo=GRs;Wt.prototype.rShiftTo=$Rs;Wt.prototype.subTo=VRs;Wt.prototype.multiplyTo=WRs;Wt.prototype.squareTo=zRs;Wt.prototype.divRemTo=YRs;Wt.prototype.invDigit=rks;Wt.prototype.isEven=cks;Wt.prototype.exp=lks;Wt.prototype.toString=BRs;Wt.prototype.negate=FRs;Wt.prototype.abs=URs;Wt.prototype.compareTo=QRs;Wt.prototype.bitLength=qRs;Wt.prototype.mod=KRs;Wt.prototype.modPowInt=uks;Wt.ZERO=EH(0);Wt.ONE=EH(1);function dks(){var t=tc();return this.copyTo(t),t}a(dks,"bnClone");function fks(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}a(pks,"bnByteValue");function hks(){return this.t==0?this.s:this.data[0]<<16>>16}a(hks,"bnShortValue");function mks(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(mks,"bnpChunkSize");function gks(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a(gks,"bnSigNum");function Aks(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=EH(r),o=tc(),s=tc(),c="";for(this.divRemTo(n,o,s);o.signum()>0;)c=(r+s.intValue()).toString(t).substr(1)+c,o.divRemTo(n,o,s);return s.intValue().toString(t)+c}a(Aks,"bnpToRadix");function yks(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),o=!1,s=0,c=0,l=0;l=r&&(this.dMultiply(n),this.dAddOffset(c,0),s=0,c=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(c,0)),o&&Wt.ZERO.subTo(this,this)}a(yks,"bnpFromRadix");function _ks(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(Wt.ONE.shiftLeft(t-1),Wsr,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(Wt.ONE.shiftLeft(t-1),this);else{var n=new Array,o=t&7;n.length=(t>>3)+1,e.nextBytes(n),o>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[o++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),(n&128)!=0&&(n|=-256),o==0&&(this.s&128)!=(n&128)&&++o,(o>0||n!=this.s)&&(e[o++]=n);return e}a(Eks,"bnToByteArray");function vks(t){return this.compareTo(t)==0}a(vks,"bnEquals");function Cks(t){return this.compareTo(t)<0?this:t}a(Cks,"bnMin");function bks(t){return this.compareTo(t)>0?this:t}a(bks,"bnMax");function Sks(t,e,r){var n,o,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),(t&255)==0&&(t>>=8,e+=8),(t&15)==0&&(t>>=4,e+=4),(t&3)==0&&(t>>=2,e+=2),(t&1)==0&&++e,e}a(Nks,"lbit");function Mks(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}a(jks,"bnpAddTo");function Hks(t){var e=tc();return this.addTo(t,e),e}a(Hks,"bnAdd");function Gks(t){var e=tc();return this.subTo(t,e),e}a(Gks,"bnSubtract");function $ks(t){var e=tc();return this.multiplyTo(t,e),e}a($ks,"bnMultiply");function Vks(){var t=tc();return this.squareTo(t),t}a(Vks,"bnSquare");function Wks(t){var e=tc();return this.divRemTo(t,e,null),e}a(Wks,"bnDivide");function zks(t){var e=tc();return this.divRemTo(t,null,e),e}a(zks,"bnRemainder");function Yks(t){var e=tc(),r=tc();return this.divRemTo(t,e,r),new Array(e,r)}a(Yks,"bnDivideAndRemainder");function Kks(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(Kks,"bnpDMultiply");function Jks(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}a(Jks,"bnpDAddOffset");function R2e(){}a(R2e,"NullExp");function K7n(t){return t}a(K7n,"nNop");function Zks(t,e,r){t.multiplyTo(e,r)}a(Zks,"nMulTo");function Xks(t,e){t.squareTo(e)}a(Xks,"nSqrTo");R2e.prototype.convert=K7n;R2e.prototype.revert=K7n;R2e.prototype.mulTo=Zks;R2e.prototype.sqrTo=Xks;function ePs(t){return this.exp(t,new R2e)}a(ePs,"bnPow");function tPs(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var o;for(o=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=tc();return t.copyTo(e),this.reduce(e),e}a(nPs,"barrettConvert");function iPs(t){return t}a(iPs,"barrettRevert");function oPs(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}a(oPs,"barrettReduce");function sPs(t,e){t.squareTo(e),this.reduce(e)}a(sPs,"barrettSqrTo");function aPs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(aPs,"barrettMulTo");she.prototype.convert=nPs;she.prototype.revert=iPs;she.prototype.reduce=oPs;she.prototype.mulTo=aPs;she.prototype.sqrTo=sPs;function cPs(t,e){var r=t.bitLength(),n,o=EH(1),s;if(r<=0)return o;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new sX(e):e.isEven()?s=new she(e):s=new aX(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=tc();for(s.sqrTo(c[1],f);l<=d;)c[l]=tc(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=tc(),y;for(r=vat(t.data[h])-1;h>=0;){for(r>=u?m=t.data[h]>>r-u&d:(m=(t.data[h]&(1<0&&(m|=t.data[h-1]>>this.DB+r-u)),l=n;(m&1)==0;)m>>=1,--l;if((r-=l)<0&&(r+=this.DB,--h),g)c[m].copyTo(o),g=!1;else{for(;l>1;)s.sqrTo(o,A),s.sqrTo(A,o),l-=2;l>0?s.sqrTo(o,A):(y=o,o=A,A=y),s.mulTo(A,c[m],o)}for(;h>=0&&(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}a(lPs,"bnGCD");function uPs(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}a(uPs,"bnpModInt");function dPs(t){if(this.signum()==0)return Wt.ZERO;var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return Wt.ZERO;for(var r=t.clone(),n=this.clone(),o=EH(1),s=EH(0),c=EH(0),l=EH(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!c.isEven()||!l.isEven())&&(c.addTo(this,c),l.subTo(t,l)),c.rShiftTo(1,c)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);r.compareTo(n)>=0?(r.subTo(n,r),e&&o.subTo(c,o),s.subTo(l,s)):(n.subTo(r,n),e&&c.subTo(o,c),l.subTo(s,l))}if(n.compareTo(Wt.ONE)!=0)return Wt.ZERO;if(l.compareTo(t)>=0)return l.subtract(t);if(l.signum()<0)l.addTo(t,l);else return l;return l.signum()<0?l.add(t):l}a(dPs,"bnModInverse");var Z2=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],fPs=(1<<26)/Z2[Z2.length-1];function pPs(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=Z2[Z2.length-1]){for(e=0;e=0);var l=s.modPow(n,this);if(l.compareTo(Wt.ONE)!=0&&l.compareTo(e)!=0){for(var u=1;u++{p();var s4=Cs();t4();Ac();var X7n=tQn.exports=s4.sha1=s4.sha1||{};s4.md.sha1=s4.md.algorithms.sha1=X7n;X7n.create=function(){eQn||gPs();var t=null,e=s4.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),Z7n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=s4.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(zsr.substr(0,n.blockLength-c));for(var l,u,d=n.fullMessageLength[0]*8,f=0;f>>0,d+=u,o.putInt32(d>>>0),d=l>>>0;o.putInt32(d);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};Z7n(h,r,o);var m=s4.util.createBuffer();return m.putInt32(h.h0),m.putInt32(h.h1),m.putInt32(h.h2),m.putInt32(h.h3),m.putInt32(h.h4),m},n};var zsr=null,eQn=!1;function gPs(){zsr="\x80",zsr+=s4.util.fillString("\0",64),eQn=!0}a(gPs,"_init");function Z7n(t,e,r){for(var n,o,s,c,l,u,d,f,h=r.length();h>=64;){for(o=t.h0,s=t.h1,c=t.h2,l=t.h3,u=t.h4,f=0;f<16;++f)n=r.getInt32(),e[f]=n,d=l^s&(c^l),n=(o<<5|o>>>27)+d+u+1518500249+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<20;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,d=l^s&(c^l),n=(o<<5|o>>>27)+d+u+1518500249+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<32;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+1859775393+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<40;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+1859775393+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<60;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s&c|l&(s^c),n=(o<<5|o>>>27)+d+u+2400959708+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<80;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+3395469782+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;t.h0=t.h0+o|0,t.h1=t.h1+s|0,t.h2=t.h2+c|0,t.h3=t.h3+l|0,t.h4=t.h4+u|0,h-=64}}a(Z7n,"_update")});var Ysr=I((Qgf,nQn)=>{p();var a4=Cs();Ac();Xw();ahe();var rQn=nQn.exports=a4.pkcs1=a4.pkcs1||{};rQn.encode_rsa_oaep=function(t,e,r){var n,o,s,c;typeof r=="string"?(n=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),s?s.start():s=a4.md.sha1.create(),c||(c=s);var l=Math.ceil(t.n.bitLength()/8),u=l-2*s.digestLength-2;if(e.length>u){var d=new Error("RSAES-OAEP input message length is too long.");throw d.length=e.length,d.maxLength=u,d}n||(n=""),s.update(n,"raw");for(var f=s.digest(),h="",m=u-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+c),n+=r.digest().getBytes()}return n.substring(0,e)}a(Cat,"rsa_mgf1")});var Jsr=I((Hgf,Ksr)=>{p();var vH=Cs();Ac();k2e();Xw();(function(){if(vH.prime){Ksr.exports=vH.prime;return}var t=Ksr.exports=vH.prime=vH.prime||{},e=vH.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var o=a(function(h,m){return h|m},"op_or");t.generateProbablePrime=function(h,m,g){typeof m=="function"&&(g=m,m={}),m=m||{};var A=m.algorithm||"PRIMEINC";typeof A=="string"&&(A={name:A}),A.options=A.options||{};var y=m.prng||vH.random,_={nextBytes:a(function(E){for(var v=y.getBytesSync(E.length),S=0;Sm&&(h=d(m,g)),h.isProbablePrime(y))return E(null,h);h.dAddOffset(r[A++%8],0)}while(_<0||+new Date-v<_);vH.util.setImmediate(function(){l(h,m,g,A,y,_,E)})}a(l,"_primeinc");function u(h,m,g,A){if(typeof Worker>"u")return c(h,m,g,A);var y=d(h,m),_=g.workers,E=g.workLoad||100,v=E*30/8,S=g.workerScript||"forge/prime.worker.js";if(_===-1)return vH.util.estimateCores(function(w,R){w&&(R=2),_=R-1,T()});T();function T(){_=Math.max(1,_);for(var w=[],R=0;R<_;++R)w[R]=new Worker(S);for(var x=_,R=0;R<_;++R)w[R].addEventListener("message",D);var k=!1;function D(N){if(!k){--x;var O=N.data;if(O.found){for(var B=0;Bh&&(y=d(h,m));var q=y.toString(16);N.target.postMessage({hex:q,workLoad:E}),y.dAddOffset(v,0)}}a(D,"workerMessage")}a(T,"generate")}a(u,"primeincFindPrimeWithWorkers");function d(h,m){var g=new e(h,m),A=h-1;return g.testBit(A)||g.bitwiseTo(e.ONE.shiftLeft(A),o,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}a(d,"generateRandom");function f(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}a(f,"getMillerRabinTests")})()});var P2e=I((Vgf,uQn)=>{p();var wi=Cs();J2();k2e();_H();Ysr();Jsr();Xw();Ac();typeof rc>"u"&&(rc=wi.jsbn.BigInteger);var rc,Zsr=wi.util.isNodejs?require("crypto"):null,ht=wi.asn1,tR=wi.util;wi.pki=wi.pki||{};uQn.exports=wi.pki.rsa=wi.rsa=wi.rsa||{};var $o=wi.pki,APs=[6,4,2,4,2,4,6,2],yPs={name:"PrivateKeyInfo",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},_Ps={name:"RSAPrivateKey",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},EPs={name:"RSAPublicKey",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},vPs=wi.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:ht.Class.UNIVERSAL,type:ht.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},CPs={name:"DigestInfo",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:ht.Class.UNIVERSAL,type:ht.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},bPs=a(function(t){var e;if(t.algorithm in $o.oids)e=$o.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=ht.oidToDer(e).getBytes(),o=ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[]),s=ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[]);s.value.push(ht.create(ht.Class.UNIVERSAL,ht.Type.OID,!1,n)),s.value.push(ht.create(ht.Class.UNIVERSAL,ht.Type.NULL,!1,""));var c=ht.create(ht.Class.UNIVERSAL,ht.Type.OCTETSTRING,!1,t.digest().getBytes());return o.value.push(s),o.value.push(c),ht.toDer(o).getBytes()},"emsaPkcs1v15encode"),cQn=a(function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(rc.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(rc.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new rc(wi.util.bytesToHex(wi.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(rc.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var o=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);o.compareTo(s)<0;)o=o.add(e.p);var c=o.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return c=c.multiply(n.modInverse(e.n)).mod(e.n),c},"_modPow");$o.rsa.encrypt=function(t,e,r){var n=r,o,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,o=lQn(t,e,r)):(o=wi.util.createBuffer(),o.putBytes(t));for(var c=new rc(o.toHex(),16),l=cQn(c,e,n),u=l.toString(16),d=wi.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(wi.util.hexToBytes(u)),d.getBytes()};$o.rsa.decrypt=function(t,e,r,n){var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=o,s}var c=new rc(wi.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=cQn(c,e,r),u=l.toString(16),d=wi.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(wi.util.hexToBytes(u)),n!==!1?bat(d.getBytes(),e,r):d.getBytes()};$o.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||wi.random,o={nextBytes:a(function(l){for(var u=n.getBytesSync(l.length),d=0;d>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},c.e.fromInt(c.eInt);else throw new Error("Invalid key generation algorithm: "+s);return c};$o.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new rc(null);r.fromInt(30);for(var n=0,o=a(function(h,m){return h|m},"op_or"),s=+new Date,c,l=0;t.keys===null&&(e<=0||lu?t.pqState=0:t.num.isProbablePrime(TPs(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(APs[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(rc.ONE).gcd(t.e).compareTo(rc.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(rc.ONE),t.q1=t.q.subtract(rc.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(rc.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var f=t.e.modInverse(t.phi);t.keys={privateKey:$o.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:$o.rsa.setPublicKey(t.n,t.e)}}c=+new Date,l+=c-s,s=c}return t.keys!==null};$o.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!wi.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(iQn("generateKeyPair"))return Zsr.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(l,u,d){if(l)return n(l);n(null,{privateKey:$o.privateKeyFromPem(d),publicKey:$o.publicKeyFromPem(u)})});if(oQn("generateKey")&&oQn("exportKey"))return tR.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:aQn(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return tR.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=$o.privateKeyFromAsn1(ht.fromDer(wi.util.createBuffer(l)));n(null,{privateKey:u,publicKey:$o.setRsaPublicKey(u.n,u.e)})}});if(sQn("generateKey")&&sQn("exportKey")){var o=tR.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:aQn(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=tR.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=$o.privateKeyFromAsn1(ht.fromDer(wi.util.createBuffer(h)));n(null,{privateKey:m,publicKey:$o.setRsaPublicKey(m.n,m.e)})},d.onerror=function(f){n(f)}},o.onerror=function(l){n(l)};return}}else if(iQn("generateKeyPairSync")){var s=Zsr.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:$o.privateKeyFromPem(s.privateKey),publicKey:$o.publicKeyFromPem(s.publicKey)}}}var c=$o.rsa.createKeyPairGenerationState(t,e,r);if(!n)return $o.rsa.stepKeyPairGenerationState(c,0),c.keys;SPs(c,r,n)};$o.setRsaPublicKey=$o.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,o,s){if(typeof o=="string"?o=o.toUpperCase():o===void 0&&(o="RSAES-PKCS1-V1_5"),o==="RSAES-PKCS1-V1_5")o={encode:a(function(l,u,d){return lQn(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return wi.pkcs1.encode_rsa_oaep(u,l,s)},"encode")};else if(["RAW","NONE","NULL",null].indexOf(o)!==-1)o={encode:a(function(l){return l},"encode")};else if(typeof o=="string")throw new Error('Unsupported encryption scheme: "'+o+'".');var c=o.encode(n,r,!0);return $o.rsa.encrypt(c,r,!0)},r.verify=function(n,o,s,c){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),c===void 0&&(c={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in c||(c._parseAllDigestBytes=!0),"_skipPaddingChecks"in c||(c._skipPaddingChecks=!1),s==="RSASSA-PKCS1-V1_5"?s={verify:a(function(u,d){d=bat(d,r,!0,void 0,c);var f=ht.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!ht.validate(f,CPs,h,m)||f.value.length!==2){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=m,g}var A=ht.derToOid(h.algorithmIdentifier);if(!(A===wi.oids.md2||A===wi.oids.md5||A===wi.oids.sha1||A===wi.oids.sha224||A===wi.oids.sha256||A===wi.oids.sha384||A===wi.oids.sha512||A===wi.oids["sha512-224"]||A===wi.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===wi.oids.md2||A===wi.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return u===h.digest},"verify")}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:a(function(u,d){return d=bat(d,r,!0,void 0,c),u===d},"verify")});var l=$o.rsa.decrypt(o,r,!0,!1);return s.verify(n,l,r.n.bitLength())},r};$o.setRsaPrivateKey=$o.rsa.setPrivateKey=function(t,e,r,n,o,s,c,l){var u={n:t,e,d:r,p:n,q:o,dP:s,dQ:c,qInv:l};return u.decrypt=function(d,f,h){typeof f=="string"?f=f.toUpperCase():f===void 0&&(f="RSAES-PKCS1-V1_5");var m=$o.rsa.decrypt(d,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:bat};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return wi.pkcs1.decode_rsa_oaep(A,g,h)},"decode")};else if(["RAW","NONE","NULL",null].indexOf(f)!==-1)f={decode:a(function(g){return g},"decode")};else throw new Error('Unsupported encryption scheme: "'+f+'".');return f.decode(m,u,!1)},u.sign=function(d,f){var h=!1;typeof f=="string"&&(f=f.toUpperCase()),f===void 0||f==="RSASSA-PKCS1-V1_5"?(f={encode:bPs},h=1):(f==="NONE"||f==="NULL"||f===null)&&(f={encode:a(function(){return d},"encode")},h=1);var m=f.encode(d,u.n.bitLength());return $o.rsa.encrypt(m,u,h)},u};$o.wrapRsaPrivateKey=function(t){return ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,ht.integerToDer(0).getBytes()),ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.OID,!1,ht.oidToDer($o.oids.rsaEncryption).getBytes()),ht.create(ht.Class.UNIVERSAL,ht.Type.NULL,!1,"")]),ht.create(ht.Class.UNIVERSAL,ht.Type.OCTETSTRING,!1,ht.toDer(t).getBytes())])};$o.privateKeyFromAsn1=function(t){var e={},r=[];if(ht.validate(t,yPs,e,r)&&(t=ht.fromDer(wi.util.createBuffer(e.privateKey))),e={},r=[],!ht.validate(t,_Ps,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var o,s,c,l,u,d,f,h;return o=wi.util.createBuffer(e.privateKeyModulus).toHex(),s=wi.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=wi.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=wi.util.createBuffer(e.privateKeyPrime1).toHex(),u=wi.util.createBuffer(e.privateKeyPrime2).toHex(),d=wi.util.createBuffer(e.privateKeyExponent1).toHex(),f=wi.util.createBuffer(e.privateKeyExponent2).toHex(),h=wi.util.createBuffer(e.privateKeyCoefficient).toHex(),$o.setRsaPrivateKey(new rc(o,16),new rc(s,16),new rc(c,16),new rc(l,16),new rc(u,16),new rc(d,16),new rc(f,16),new rc(h,16))};$o.privateKeyToAsn1=$o.privateKeyToRSAPrivateKey=function(t){return ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,ht.integerToDer(0).getBytes()),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.n)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.e)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.d)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.p)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.q)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.dP)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.dQ)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.qInv))])};$o.publicKeyFromAsn1=function(t){var e={},r=[];if(ht.validate(t,vPs,e,r)){var n=ht.derToOid(e.publicKeyOid);if(n!==$o.oids.rsaEncryption){var o=new Error("Cannot read public key. Unknown OID.");throw o.oid=n,o}t=e.rsaPublicKey}if(r=[],!ht.validate(t,EPs,e,r)){var o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw o.errors=r,o}var s=wi.util.createBuffer(e.publicKeyModulus).toHex(),c=wi.util.createBuffer(e.publicKeyExponent).toHex();return $o.setRsaPublicKey(new rc(s,16),new rc(c,16))};$o.publicKeyToAsn1=$o.publicKeyToSubjectPublicKeyInfo=function(t){return ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.OID,!1,ht.oidToDer($o.oids.rsaEncryption).getBytes()),ht.create(ht.Class.UNIVERSAL,ht.Type.NULL,!1,"")]),ht.create(ht.Class.UNIVERSAL,ht.Type.BITSTRING,!1,[$o.publicKeyToRSAPublicKey(t)])])};$o.publicKeyToRSAPublicKey=function(t){return ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.n)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.e))])};function lQn(t,e,r){var n=wi.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=o-11,s}n.putByte(0),n.putByte(r);var c=o-3-t.length,l;if(r===0||r===1){l=r===0?0:255;for(var u=0;u0;){for(var d=0,f=wi.random.getBytes(c),u=0;u"u")throw new Error("Encryption block is invalid.");var d=0;if(u===0){d=s-3-n;for(var f=0;f1;){if(c.getByte()!==255){--c.read;break}++d}if(d<8&&!(o&&o._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(u===2){for(d=0;c.length()>1;){if(c.getByte()===0){--c.read;break}++d}if(d<8&&!(o&&o._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var h=c.getByte();if(h!==0||d!==s-3-c.length())throw new Error("Encryption block is invalid.");return c.getBytes()}a(bat,"_decodePkcs1_v1_5");function SPs(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),o();function o(){s(t.pBits,function(l,u){if(l)return r(l);if(t.p=u,t.q!==null)return c(l,t.q);s(t.qBits,c)})}a(o,"generate");function s(l,u){wi.prime.generateProbablePrime(l,n,u)}a(s,"getPrime");function c(l,u){if(l)return r(l);if(t.q=u,t.p.compareTo(t.q)<0){var d=t.p;t.p=t.q,t.q=d}if(t.p.subtract(rc.ONE).gcd(t.e).compareTo(rc.ONE)!==0){t.p=null,o();return}if(t.q.subtract(rc.ONE).gcd(t.e).compareTo(rc.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract(rc.ONE),t.q1=t.q.subtract(rc.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(rc.ONE)!==0){t.p=t.q=null,o();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,c);return}var f=t.e.modInverse(t.phi);t.keys={privateKey:$o.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:$o.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}a(c,"finish")}a(SPs,"_generateKeyPair");function c4(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=wi.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&(r.charCodeAt(1)&128)===0||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}a(c4,"_bnToBytes");function TPs(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}a(TPs,"_getMillerRabinTests");function iQn(t){return wi.util.isNodejs&&typeof Zsr[t]=="function"}a(iQn,"_detectNodeCrypto");function oQn(t){return typeof tR.globalScope<"u"&&typeof tR.globalScope.crypto=="object"&&typeof tR.globalScope.crypto.subtle=="object"&&typeof tR.globalScope.crypto.subtle[t]=="function"}a(oQn,"_detectSubtleCrypto");function sQn(t){return typeof tR.globalScope<"u"&&typeof tR.globalScope.msCrypto=="object"&&typeof tR.globalScope.msCrypto.subtle=="object"&&typeof tR.globalScope.msCrypto.subtle[t]=="function"}a(sQn,"_detectSubtleMsCrypto");function aQn(t){for(var e=wi.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var Cn=Cs();yH();J2();w2e();t4();_H();yat();oX();Xw();Gsr();P2e();Ac();typeof dQn>"u"&&(dQn=Cn.jsbn.BigInteger);var dQn,Mt=Cn.asn1,ps=Cn.pki=Cn.pki||{};mQn.exports=ps.pbe=Cn.pbe=Cn.pbe||{};var cX=ps.oids,IPs={name:"EncryptedPrivateKeyInfo",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},xPs={name:"PBES2Algorithms",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},wPs={name:"pkcs-12PbeParams",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.INTEGER,constructed:!1,capture:"iterations"}]};ps.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=Cn.random.getBytesSync(r.saltSize),o=r.count,s=Mt.integerToDer(o),c,l,u;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var d,f,h;switch(r.algorithm){case"aes128":c=16,d=16,f=cX["aes128-CBC"],h=Cn.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=cX["aes192-CBC"],h=Cn.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=cX["aes256-CBC"],h=Cn.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=cX.desCBC,h=Cn.des.createEncryptionCipher;break;default:var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),A=hQn(g),y=Cn.pkcs5.pbkdf2(e,n,o,c,A),_=Cn.random.getBytesSync(d),E=h(y);E.start(_),E.update(Mt.toDer(t)),E.finish(),u=E.output.getBytes();var v=RPs(n,s,c,g);l=Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OID,!1,Mt.oidToDer(cX.pkcs5PBES2).getBytes()),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OID,!1,Mt.oidToDer(cX.pkcs5PBKDF2).getBytes()),v]),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OID,!1,Mt.oidToDer(f).getBytes()),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OCTETSTRING,!1,_)])])])}else if(r.algorithm==="3des"){c=24;var S=new Cn.util.ByteBuffer(n),y=ps.pbe.generatePkcs12Key(e,S,1,o,c),_=ps.pbe.generatePkcs12Key(e,S,2,o,c),E=Cn.des.createEncryptionCipher(y);E.start(_),E.update(Mt.toDer(t)),E.finish(),u=E.output.getBytes(),l=Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OID,!1,Mt.oidToDer(cX["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OCTETSTRING,!1,n),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.INTEGER,!1,s.getBytes())])])}else{var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var T=Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[l,Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OCTETSTRING,!1,u)]);return T};ps.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Mt.validate(t,IPs,n,o)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=Mt.derToOid(n.encryptionOid),l=ps.pbe.getCipher(c,n.encryptionParams,e),u=Cn.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Mt.fromDer(l.output)),r};ps.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Mt.toDer(t).getBytes()};return Cn.pem.encode(r,{maxline:e})};ps.encryptedPrivateKeyFromPem=function(t){var e=Cn.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return Mt.fromDer(e.body)};ps.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=ps.wrapRsaPrivateKey(ps.privateKeyToAsn1(t));return n=ps.encryptPrivateKeyInfo(n,e,r),ps.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=Cn.random.getBytesSync(16),l=Cn.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=Cn.random.getBytesSync(16),l=Cn.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=Cn.random.getBytesSync(16),l=Cn.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=Cn.random.getBytesSync(8),l=Cn.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=Cn.random.getBytesSync(8),l=Cn.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw u.algorithm=r.algorithm,u}var d=Cn.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Mt.toDer(ps.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:Cn.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return Cn.pem.encode(h)};ps.decryptRsaPrivateKey=function(t,e){var r=null,n=Cn.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var o=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw o.headerType=o,o}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,c;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,c=Cn.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=Cn.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=Cn.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=Cn.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=Cn.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return Cn.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return Cn.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return Cn.rc2.createDecryptionCipher(h,128)},"cipherFn");break;default:var o=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw o.algorithm=n.dekInfo.algorithm,o}var l=Cn.util.hexToBytes(n.dekInfo.parameters),u=Cn.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(Cn.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=ps.decryptPrivateKeyInfo(Mt.fromDer(r),e):r=Mt.fromDer(r),r!==null&&(r=ps.privateKeyFromAsn1(r)),r};ps.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in Cn.md))throw new Error('"sha1" hash algorithm unavailable.');s=Cn.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new Cn.util.ByteBuffer,h=new Cn.util.ByteBuffer;if(t!=null){for(l=0;l=0;l--)B=B>>8,B+=k.at(l)+O.at(l),O.setAt(l,B&255);N.putBuffer(O)}S=N,f.putBuffer(R)}return f.truncate(f.length()-o),f};ps.pbe.getCipher=function(t,e,r){switch(t){case ps.oids.pkcs5PBES2:return ps.pbe.getCipherForPBES2(t,e,r);case ps.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case ps.oids["pbewithSHAAnd40BitRC2-CBC"]:return ps.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};ps.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Mt.validate(e,xPs,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}if(t=Mt.derToOid(n.kdfOid),t!==ps.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=Mt.derToOid(n.encOid),t!==ps.oids["aes128-CBC"]&&t!==ps.oids["aes192-CBC"]&&t!==ps.oids["aes256-CBC"]&&t!==ps.oids["des-EDE3-CBC"]&&t!==ps.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var c=n.kdfSalt,l=Cn.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(ps.oids[t]){case"aes128-CBC":u=16,d=Cn.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=Cn.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=Cn.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=Cn.des.createDecryptionCipher;break;case"desCBC":u=8,d=Cn.des.createDecryptionCipher;break}var f=pQn(n.prfOid),h=Cn.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};ps.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Mt.validate(e,wPs,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=Cn.util.createBuffer(n.salt),l=Cn.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case ps.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=Cn.des.startDecrypting;break;case ps.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,_){var E=Cn.rc2.createDecryptionCipher(y,40);return E.start(_,null),E},"cipherFn");break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=pQn(n.prfOid),m=ps.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=ps.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};ps.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in Cn.md))throw new Error('"md5" hash algorithm unavailable.');n=Cn.md.md5.create()}e===null&&(e="");for(var o=[fQn(n,t+e)],s=16,c=1;s{p();var che=Cs();J2();Ac();var gn=che.asn1,lhe=yQn.exports=che.pkcs7asn1=che.pkcs7asn1||{};che.pkcs7=che.pkcs7||{};che.pkcs7.asn1=lhe;var gQn={name:"ContentInfo",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:gn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};lhe.contentInfoValidator=gQn;var AQn={name:"EncryptedContentInfo",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:gn.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:gn.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};lhe.envelopedDataValidator={name:"EnvelopedData",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(AQn)};lhe.encryptedDataValidator={name:"EncryptedData",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1,capture:"version"}].concat(AQn)};var kPs={name:"SignerInfo",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:gn.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:gn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:gn.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};lhe.signedDataValidator={name:"SignedData",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},gQn,{name:"SignedData.Certificates",tagClass:gn.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:gn.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SET,capture:"signerInfos",optional:!0,value:[kPs]}]};lhe.recipientInfoValidator={name:"RecipientInfo",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:gn.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var tar=I((e0f,_Qn)=>{p();var lX=Cs();Ac();lX.mgf=lX.mgf||{};var PPs=_Qn.exports=lX.mgf.mgf1=lX.mgf1=lX.mgf1||{};PPs.create=function(t){var e={generate:a(function(r,n){for(var o=new lX.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var Sat=Cs();tar();EQn.exports=Sat.mgf=Sat.mgf||{};Sat.mgf.mgf1=Sat.mgf1});var Tat=I((o0f,CQn)=>{p();var uX=Cs();Xw();Ac();var DPs=CQn.exports=uX.pss=uX.pss||{};DPs.create=function(t){arguments.length===3&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e=t.md,r=t.mgf,n=e.digestLength,o=t.salt||null;typeof o=="string"&&(o=uX.util.createBuffer(o));var s;if("saltLength"in t)s=t.saltLength;else if(o!==null)s=o.length();else throw new Error("Salt length not specified or specific salt not given.");if(o!==null&&o.length()!==s)throw new Error("Given salt length does not match length of given salt.");var c=t.prng||uX.random,l={};return l.encode=function(u,d){var f,h=d-1,m=Math.ceil(h/8),g=u.digest().getBytes();if(m>8*m-h&255;return w=String.fromCharCode(w.charCodeAt(0)&~R)+w.substr(1),w+_+"\xBC"},l.verify=function(u,d,f){var h,m=f-1,g=Math.ceil(m/8);if(d=d.substr(-g),g>8*g-m&255;if((y.charCodeAt(0)&E)!==0)throw new Error("Bits beyond keysize not zero as expected.");var v=r.generate(_,A),S="";for(h=0;h{p();var Ri=Cs();yH();J2();w2e();t4();vQn();_H();oX();Tat();P2e();Ac();var Ae=Ri.asn1,Lr=xQn.exports=Ri.pki=Ri.pki||{},nc=Lr.oids,Cp={};Cp.CN=nc.commonName;Cp.commonName="CN";Cp.C=nc.countryName;Cp.countryName="C";Cp.L=nc.localityName;Cp.localityName="L";Cp.ST=nc.stateOrProvinceName;Cp.stateOrProvinceName="ST";Cp.O=nc.organizationName;Cp.organizationName="O";Cp.OU=nc.organizationalUnitName;Cp.organizationalUnitName="OU";Cp.E=nc.emailAddress;Cp.emailAddress="E";var SQn=Ri.pki.rsa.publicKeyValidator,NPs={name:"Certificate",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},SQn,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},MPs={name:"rsapss",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},OPs={name:"CertificationRequestInfo",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},SQn,{name:"CertificationRequestInfo.attributes",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SET,constructed:!0}]}]}]},LPs={name:"CertificationRequest",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[OPs,{name:"CertificationRequest.signatureAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};Lr.RDNAttributesAsArray=function(t,e){for(var r=[],n,o,s,c=0;c2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(u.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=u[0],c.validity.notAfter=u[1],c.tbsCertificate=r.tbsCertificate,e){c.md=xat({signatureOid:c.signatureOid,type:"certificate"});var d=Ae.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=Ri.md.sha1.create(),h=Ae.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return CH(c.issuer,A)},c.issuer.addField=function(A){rR([A]),c.issuer.attributes.push(A)},c.issuer.attributes=Lr.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=f.digest().toHex();var m=Ri.md.sha1.create(),g=Ae.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return CH(c.subject,A)},c.subject.addField=function(A){rR([A]),c.subject.attributes.push(A)},c.subject.attributes=Lr.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=Lr.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=Lr.publicKeyFromAsn1(r.subjectPublicKeyInfo),c};Lr.certificateExtensionsFromAsn1=function(t){for(var e=[],r=0;r1&&(n=r.value.charCodeAt(1),o=r.value.length>2?r.value.charCodeAt(2):0),e.digitalSignature=(n&128)===128,e.nonRepudiation=(n&64)===64,e.keyEncipherment=(n&32)===32,e.dataEncipherment=(n&16)===16,e.keyAgreement=(n&8)===8,e.keyCertSign=(n&4)===4,e.cRLSign=(n&2)===2,e.encipherOnly=(n&1)===1,e.decipherOnly=(o&128)===128}else if(e.name==="basicConstraints"){var r=Ae.fromDer(e.value);r.value.length>0&&r.value[0].type===Ae.Type.BOOLEAN?e.cA=r.value[0].value.charCodeAt(0)!==0:e.cA=!1;var s=null;r.value.length>0&&r.value[0].type===Ae.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(e.pathLenConstraint=Ae.derToInteger(s))}else if(e.name==="extKeyUsage")for(var r=Ae.fromDer(e.value),c=0;c1&&(n=r.value.charCodeAt(1)),e.client=(n&128)===128,e.server=(n&64)===64,e.email=(n&32)===32,e.objsign=(n&16)===16,e.reserved=(n&8)===8,e.sslCA=(n&4)===4,e.emailCA=(n&2)===2,e.objCA=(n&1)===1}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.altNames=[];for(var u,r=Ae.fromDer(e.value),d=0;d"u"&&(e.type&&e.type in Lr.oids?e.name=Lr.oids[e.type]:e.shortName&&e.shortName in Cp&&(e.name=Lr.oids[Cp[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in Lr.oids)e.type=Lr.oids[e.name];else{var n=new Error("Attribute type not specified.");throw n.attribute=e,n}if(typeof e.shortName>"u"&&e.name&&e.name in Cp&&(e.shortName=Cp[e.name]),e.type===nc.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=Ae.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var o=0;o"u"){var n=new Error("Attribute value not specified.");throw n.attribute=e,n}}}a(rR,"_fillMissingFields");function IQn(t,e){if(e=e||{},typeof t.name>"u"&&t.id&&t.id in Lr.oids&&(t.name=Lr.oids[t.id]),typeof t.id>"u")if(t.name&&t.name in Lr.oids)t.id=Lr.oids[t.name];else{var r=new Error("Extension ID not specified.");throw r.extension=t,r}if(typeof t.value<"u")return t;if(t.name==="keyUsage"){var n=0,o=0,s=0;t.digitalSignature&&(o|=128,n=7),t.nonRepudiation&&(o|=64,n=6),t.keyEncipherment&&(o|=32,n=5),t.dataEncipherment&&(o|=16,n=4),t.keyAgreement&&(o|=8,n=3),t.keyCertSign&&(o|=4,n=2),t.cRLSign&&(o|=2,n=1),t.encipherOnly&&(o|=1,n=0),t.decipherOnly&&(s|=128,n=7);var c=String.fromCharCode(n);s!==0?c+=String.fromCharCode(o)+String.fromCharCode(s):o!==0&&(c+=String.fromCharCode(o)),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,c)}else if(t.name==="basicConstraints")t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in t&&t.value.value.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(t.pathLenConstraint).getBytes()));else if(t.name==="extKeyUsage"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);var l=t.value.value;for(var u in t)t[u]===!0&&(u in nc?l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(nc[u]).getBytes())):u.indexOf(".")!==-1&&l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(u).getBytes())))}else if(t.name==="nsCertType"){var n=0,o=0;t.client&&(o|=128,n=7),t.server&&(o|=64,n=6),t.email&&(o|=32,n=5),t.objsign&&(o|=16,n=4),t.reserved&&(o|=8,n=3),t.sslCA&&(o|=4,n=2),t.emailCA&&(o|=2,n=1),t.objCA&&(o|=1,n=0);var c=String.fromCharCode(n);o!==0&&(c+=String.fromCharCode(o)),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,c)}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);for(var d,f=0;f128)throw new Error('Invalid "nsComment" content.');t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.IA5STRING,!1,t.comment)}else if(t.name==="subjectKeyIdentifier"&&e.cert){var h=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=h.toHex(),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OCTETSTRING,!1,h.getBytes())}else if(t.name==="authorityKeyIdentifier"&&e.cert){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);var l=t.value.value;if(t.keyIdentifier){var m=t.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!1,m))}if(t.authorityCertIssuer){var g=[Ae.create(Ae.Class.CONTEXT_SPECIFIC,4,!0,[uhe(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=Ri.util.hexToBytes(t.serialNumber===!0?e.cert.serialNumber:t.serialNumber);l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,2,!1,A))}}else if(t.name==="cRLDistributionPoints"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);for(var l=t.value.value,y=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]),_=Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[]),d,f=0;f"u"){var r=new Error("Extension value not specified.");throw r.extension=t,r}return t}a(IQn,"_fillMissingExtensionFields");function rar(t,e){if(t===nc["RSASSA-PSS"]){var r=[];return e.hash.algorithmOid!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.hash.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.mgf.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.mgf.hash.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,2,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(e.saltLength).getBytes())])),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,r)}else return Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")}a(rar,"_signatureParametersToAsn1");function BPs(t){var e=Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[]);if(t.attributes.length===0)return e;for(var r=t.attributes,n=0;n=FPs&&t0&&n.value.push(Lr.certificateExtensionsToAsn1(t.extensions)),n};Lr.getCertificationRequestInfo=function(t){var e=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(t.version).getBytes()),uhe(t.subject),Lr.publicKeyToAsn1(t.publicKey),BPs(t)]);return e};Lr.distinguishedNameToAsn1=function(t){return uhe(t)};Lr.certificateToAsn1=function(t){var e=t.tbsCertificate||Lr.getTBSCertificate(t);return Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[e,Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(t.signatureOid).getBytes()),rar(t.signatureOid,t.signatureParameters)]),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,"\0"+t.signature)])};Lr.certificateExtensionsToAsn1=function(t){var e=Ae.create(Ae.Class.CONTEXT_SPECIFIC,3,!0,[]),r=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);e.value.push(r);for(var n=0;n"u"&&(o=new Date);var s=!0,c=null,l=0;do{var u=e.shift(),d=null,f=!1;if(o&&(ou.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:Lr.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:o}),c===null){if(d=e[0]||t.getIssuer(u),d===null&&u.isIssuer(u)&&(f=!0,d=u),d){var h=d;Ri.util.isArray(h)||(h=[h]);for(var m=!1;!m&&h.length>0;){d=h.shift();try{m=d.verify(u)}catch{}}m||(c={message:"Certificate signature is invalid.",error:Lr.certificateError.bad_certificate})}c===null&&(!d||f)&&!t.hasCertificate(u)&&(c={message:"Certificate is not trusted.",error:Lr.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:"Certificate issuer is invalid.",error:Lr.certificateError.bad_certificate}),c===null)for(var g={keyUsage:!0,basicConstraints:!0},A=0;c===null&&A_.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:Lr.certificateError.bad_certificate})}}var S=c===null?!0:c.error,T=r.verify?r.verify(S,l,n):S;if(T===!0)c=null;else throw S===!0&&(c={message:"The application rejected the certificate.",error:Lr.certificateError.bad_certificate}),(T||T===0)&&(typeof T=="object"&&!Ri.util.isArray(T)?(T.message&&(c.message=T.message),T.error&&(c.error=T.error)):typeof T=="string"&&(c.error=T)),c;s=!1,++l}while(e.length>0);return!0}});var iar=I((u0f,RQn)=>{p();var Bu=Cs();J2();nhe();_H();ear();Xsr();Xw();P2e();ahe();Ac();wat();var Je=Bu.asn1,oa=Bu.pki,N2e=RQn.exports=Bu.pkcs12=Bu.pkcs12||{},wQn={name:"ContentInfo",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Je.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},QPs={name:"PFX",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Je.Class.UNIVERSAL,type:Je.Type.INTEGER,constructed:!1,capture:"version"},wQn,{name:"PFX.macData",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Je.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Je.Class.UNIVERSAL,type:Je.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},qPs={name:"SafeBag",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Je.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},jPs={name:"Attribute",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SET,constructed:!0,capture:"values"}]},HPs={name:"CertBag",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Je.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Je.Class.UNIVERSAL,type:Je.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function D2e(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(D2e,"_getBagsByAttribute");N2e.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Je.validate(t,QPs,n,o)){var s=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw s.errors=s,s}var c={version:n.version.charCodeAt(0),safeContents:[],getBags:a(function(_){var E={},v;return"localKeyId"in _?v=_.localKeyId:"localKeyIdHex"in _&&(v=Bu.util.hexToBytes(_.localKeyIdHex)),v===void 0&&!("friendlyName"in _)&&"bagType"in _&&(E[_.bagType]=D2e(c.safeContents,null,null,_.bagType)),v!==void 0&&(E.localKeyId=D2e(c.safeContents,"localKeyId",v,_.bagType)),"friendlyName"in _&&(E.friendlyName=D2e(c.safeContents,"friendlyName",_.friendlyName,_.bagType)),E},"getBags"),getBagsByFriendlyName:a(function(_,E){return D2e(c.safeContents,"friendlyName",_,E)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(_,E){return D2e(c.safeContents,"localKeyId",_,E)},"getBagsByLocalKeyId")};if(n.version.charCodeAt(0)!==3){var s=new Error("PKCS#12 PFX of version other than 3 not supported.");throw s.version=n.version.charCodeAt(0),s}if(Je.derToOid(n.contentType)!==oa.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Je.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Je.Class.UNIVERSAL||l.type!==Je.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=nar(l),n.mac){var u=null,d=0,f=Je.derToOid(n.macAlgorithm);switch(f){case oa.oids.sha1:u=Bu.md.sha1.create(),d=20;break;case oa.oids.sha256:u=Bu.md.sha256.create(),d=32;break;case oa.oids.sha384:u=Bu.md.sha384.create(),d=48;break;case oa.oids.sha512:u=Bu.md.sha512.create(),d=64;break;case oa.oids.md5:u=Bu.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new Bu.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(Bu.util.bytesToHex(n.macIterations),16):1,g=N2e.generateKey(r,h,3,m,d,u),A=Bu.hmac.create();A.start(u,g),A.update(l.value);var y=A.getMac();if(y.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(t.value)&&t.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return GPs(c,l.value,e,r),c};function nar(t){if(t.composed||t.constructed){for(var e=Bu.util.createBuffer(),r=0;r0&&(s=Je.create(Je.Class.UNIVERSAL,Je.Type.SET,!0,u));var d=[],f=[];e!==null&&(Bu.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var _=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,h),E=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(oa.oids.data).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,Je.toDer(_).getBytes())])]);d.push(E)}var v=null;if(t!==null){var S=oa.wrapRsaPrivateKey(oa.privateKeyToAsn1(t));r===null?v=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(oa.oids.keyBag).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[S]),s]):v=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(oa.oids.pkcs8ShroudedKeyBag).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[oa.encryptPrivateKeyInfo(S,r,n)]),s]);var T=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[v]),w=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(oa.oids.data).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,Je.toDer(T).getBytes())])]);d.push(w)}var R=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=Bu.md.sha1.create(),k=new Bu.util.ByteBuffer(Bu.random.getBytes(n.saltSize)),D=n.count,t=N2e.generateKey(r,k,3,D,20),N=Bu.hmac.create();N.start(l,t),N.update(Je.toDer(R).getBytes());var O=N.getMac();x=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(oa.oids.sha1).getBytes()),Je.create(Je.Class.UNIVERSAL,Je.Type.NULL,!1,"")]),Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,O.getBytes())]),Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,k.getBytes()),Je.create(Je.Class.UNIVERSAL,Je.Type.INTEGER,!1,Je.integerToDer(D).getBytes())])}return Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.INTEGER,!1,Je.integerToDer(3).getBytes()),Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(oa.oids.data).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,Je.toDer(R).getBytes())])]),x])};N2e.generateKey=Bu.pbe.generatePkcs12Key});var sar=I((p0f,kQn)=>{p();var bH=Cs();J2();_H();Xsr();oX();yat();iar();Tat();P2e();Ac();wat();var oar=bH.asn1,dhe=kQn.exports=bH.pki=bH.pki||{};dhe.pemToDer=function(t){var e=bH.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return bH.util.createBuffer(e.body)};dhe.privateKeyFromPem=function(t){var e=bH.pem.decode(t)[0];if(e.type!=="PRIVATE KEY"&&e.type!=="RSA PRIVATE KEY"){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var n=oar.fromDer(e.body);return dhe.privateKeyFromAsn1(n)};dhe.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:oar.toDer(dhe.privateKeyToAsn1(t)).getBytes()};return bH.pem.encode(r,{maxline:e})};dhe.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:oar.toDer(t).getBytes()};return bH.pem.encode(r,{maxline:e})}});var far=I((m0f,FQn)=>{p();var Kt=Cs();J2();nhe();hat();oX();sar();Xw();ahe();Ac();var Dat=a(function(t,e,r,n){var o=Kt.util.createBuffer(),s=t.length>>1,c=s+(t.length&1),l=t.substr(0,c),u=t.substr(s,c),d=Kt.util.createBuffer(),f=Kt.hmac.create();r=e+r;var h=Math.ceil(n/16),m=Math.ceil(n/20);f.start("MD5",l);var g=Kt.util.createBuffer();d.putBytes(r);for(var A=0;A0&&(Ee.queue(t,Ee.createAlert(t,{level:Ee.Alert.Level.warning,description:Ee.Alert.Description.no_renegotiation})),Ee.flush(t)),t.process()};Ee.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===Ee.ConnectionEnd.client;if(r<38)t.error(t,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});else{var s=e.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:Kt.util.createBuffer(s.getBytes(32)),session_id:jT(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=jT(s,2),n.compression_methods=jT(s,1)),c=r-(c-s.length()),c>0){for(var l=jT(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:jT(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(jT(f,2).getBytes())}}}if(t.session.version&&(n.version.major!==t.session.version.major||n.version.minor!==t.session.version.minor))return t.error(t,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=Ee.getCipherSuite(n.cipher_suite);else for(var m=Kt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=Ee.getCipherSuite(m.getBytes(2)),t.session.cipherSuite===null););if(t.session.cipherSuite===null)return t.error(t,{message:"No cipher suites in common.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.handshake_failure},cipherSuite:Kt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=Ee.CompressionMethod.none}return n};Ee.createSecurityParameters=function(t,e){var r=t.entity===Ee.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:Ee.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:Ee.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:t.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:o,server_random:s}};Ee.handleServerHello=function(t,e,r){var n=Ee.parseHelloMessage(t,e,r);if(!t.fail){if(n.version.minor<=t.version.minor)t.version.minor=n.version.minor;else return t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=NQn,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=ZPs,t.session.resuming=!1,Ee.createSecurityParameters(t,n)),t.session.id=o,t.process()}};Ee.handleClientHello=function(t,e,r){var n=Ee.parseHelloMessage(t,e,r);if(!t.fail){var o=n.session_id.bytes(),s=null;if(t.sessionCache&&(s=t.sessionCache.getSession(o),s===null?o="":(s.version.major!==n.version.major||s.version.minor>n.version.minor)&&(s=null,o="")),o.length===0&&(o=Kt.random.getBytes(32)),t.session.id=o,t.session.clientHelloVersion=n.version,t.session.sp={},s)t.version=t.session.version=s.version,t.session.sp=s.sp;else{for(var c,l=1;l0;)s=jT(o.certificate_list,3),c=Kt.asn1.fromDer(s),s=Kt.pki.certificateFromAsn1(c,!0),l.push(s)}catch(d){return t.error(t,{message:"Could not parse certificate list.",cause:d,send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.bad_certificate}})}var u=t.entity===Ee.ConnectionEnd.client;(u||t.verifyClient===!0)&&l.length===0?t.error(t,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?PQn:lar:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],Ee.verifyCertificateChain(t,l)&&(t.expect=u?PQn:lar)),t.process()};Ee.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.unsupported_certificate}});t.expect=XPs,t.process()};Ee.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:jT(n,2).getBytes()},s=null;if(t.getPrivateKey)try{s=t.getPrivateKey(t,t.session.serverCertificate),s=Kt.pki.privateKeyFromPem(s)}catch(u){t.error(t,{message:"Could not get private key.",cause:u,send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}});try{var c=t.session.sp;c.pre_master_secret=s.decrypt(o.enc_pre_master_secret);var l=t.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{c.pre_master_secret=Kt.random.getBytes(48)}t.expect=uar,t.session.clientCertificate!==null&&(t.expect=s2s),t.process()};Ee.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:jT(n,1),certificate_authorities:jT(n,2)};t.session.certificateRequest=o,t.expect=e2s,t.process()};Ee.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:jT(n,2).getBytes()},c=Kt.util.createBuffer();c.putBuffer(t.session.md5.digest()),c.putBuffer(t.session.sha1.digest()),c=c.getBytes();try{var l=t.session.clientCertificate;if(!l.publicKey.verify(c,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");t.session.md5.update(o),t.session.sha1.update(o)}catch{return t.error(t,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.handshake_failure}})}t.expect=uar,t.process()};Ee.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.insufficient_security}},o=0,s=t.verify(t,n.alert.description,o,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!Kt.util.isArray(s)?(s.message&&(n.message=s.message),s.alert&&(n.alert.description=s.alert)):typeof s=="number"&&(n.alert.description=s)),t.error(t,n)}t.session.certificateRequest!==null&&(e=Ee.createRecord(t,{type:Ee.ContentType.handshake,data:Ee.createCertificate(t)}),Ee.queue(t,e)),e=Ee.createRecord(t,{type:Ee.ContentType.handshake,data:Ee.createClientKeyExchange(t)}),Ee.queue(t,e),t.expect=n2s;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&Ee.queue(l,Ee.createRecord(l,{type:Ee.ContentType.handshake,data:Ee.createCertificateVerify(l,u)})),Ee.queue(l,Ee.createRecord(l,{type:Ee.ContentType.change_cipher_spec,data:Ee.createChangeCipherSpec()})),l.state.pending=Ee.createConnectionState(l),l.state.current.write=l.state.pending.write,Ee.queue(l,Ee.createRecord(l,{type:Ee.ContentType.handshake,data:Ee.createFinished(l)})),l.expect=NQn,Ee.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);Ee.getClientSignature(t,c)};Ee.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});var r=t.entity===Ee.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=Ee.createConnectionState(t)),t.state.current.read=t.state.pending.read,(!t.session.resuming&&r||t.session.resuming&&!r)&&(t.state.pending=null),t.expect=r?t2s:a2s,t.process()};Ee.handleFinished=function(t,e,r){var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s=e.fragment.getBytes();n=Kt.util.createBuffer(),n.putBuffer(t.session.md5.digest()),n.putBuffer(t.session.sha1.digest());var c=t.entity===Ee.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=Dat;if(n=f(u.master_secret,l,n.getBytes(),d),n.getBytes()!==s)return t.error(t,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(Ee.queue(t,Ee.createRecord(t,{type:Ee.ContentType.change_cipher_spec,data:Ee.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,Ee.queue(t,Ee.createRecord(t,{type:Ee.ContentType.handshake,data:Ee.createFinished(t)}))),t.expect=c?r2s:c2s,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,Ee.flush(t),t.isConnected=!0,t.connected(t),t.process()};Ee.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case Ee.Alert.Description.close_notify:o="Connection closed.";break;case Ee.Alert.Description.unexpected_message:o="Unexpected message.";break;case Ee.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case Ee.Alert.Description.decryption_failed:o="Decryption failed.";break;case Ee.Alert.Description.record_overflow:o="Record overflow.";break;case Ee.Alert.Description.decompression_failure:o="Decompression failed.";break;case Ee.Alert.Description.handshake_failure:o="Handshake failure.";break;case Ee.Alert.Description.bad_certificate:o="Bad certificate.";break;case Ee.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case Ee.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case Ee.Alert.Description.certificate_expired:o="Certificate expired.";break;case Ee.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case Ee.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case Ee.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case Ee.Alert.Description.access_denied:o="Access denied.";break;case Ee.Alert.Description.decode_error:o="Decode error.";break;case Ee.Alert.Description.decrypt_error:o="Decrypt error.";break;case Ee.Alert.Description.export_restriction:o="Export restriction.";break;case Ee.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case Ee.Alert.Description.insufficient_security:o="Insufficient security.";break;case Ee.Alert.Description.internal_error:o="Internal error.";break;case Ee.Alert.Description.user_canceled:o="User canceled.";break;case Ee.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===Ee.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===Ee.ConnectionEnd.client?"server":"client",alert:n}),t.process()};Ee.handleHandshake=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=Kt.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var s=r.bytes(o+4);r.read+=4,n in Pat[t.entity][t.expect]?(t.entity===Ee.ConnectionEnd.server&&!t.open&&!t.fail&&(t.handshaking=!0,t.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:Kt.md.md5.create(),sha1:Kt.md.sha1.create()}),n!==Ee.HandshakeType.hello_request&&n!==Ee.HandshakeType.certificate_verify&&n!==Ee.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),Pat[t.entity][t.expect][n](t,e,o)):Ee.handleUnexpected(t,e)};Ee.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};Ee.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===Ee.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();Ee.queue(t,Ee.createRecord(t,{type:Ee.ContentType.heartbeat,data:Ee.createHeartbeat(Ee.HeartbeatMessageType.heartbeat_response,s)})),Ee.flush(t)}else if(n===Ee.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Kt.util.createBuffer(s))}t.process()};var JPs=0,ZPs=1,PQn=2,XPs=3,e2s=4,NQn=5,t2s=6,r2s=7,n2s=8,i2s=0,o2s=1,lar=2,s2s=3,uar=4,a2s=5,c2s=6,_e=Ee.handleUnexpected,MQn=Ee.handleChangeCipherSpec,ry=Ee.handleAlert,xv=Ee.handleHandshake,OQn=Ee.handleApplicationData,ny=Ee.handleHeartbeat,dar=[];dar[Ee.ConnectionEnd.client]=[[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[MQn,ry,_e,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,OQn,ny],[_e,ry,xv,_e,ny]];dar[Ee.ConnectionEnd.server]=[[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[MQn,ry,_e,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,OQn,ny],[_e,ry,xv,_e,ny]];var SH=Ee.handleHelloRequest,l2s=Ee.handleServerHello,LQn=Ee.handleCertificate,DQn=Ee.handleServerKeyExchange,aar=Ee.handleCertificateRequest,Rat=Ee.handleServerHelloDone,BQn=Ee.handleFinished,Pat=[];Pat[Ee.ConnectionEnd.client]=[[_e,_e,l2s,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,LQn,DQn,aar,Rat,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,DQn,aar,Rat,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,aar,Rat,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,Rat,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,BQn],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e]];var u2s=Ee.handleClientHello,d2s=Ee.handleClientKeyExchange,f2s=Ee.handleCertificateVerify;Pat[Ee.ConnectionEnd.server]=[[_e,u2s,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,LQn,_e,_e,_e,_e,_e,_e,_e,_e,_e],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,d2s,_e,_e,_e,_e],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,f2s,_e,_e,_e,_e,_e],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,BQn],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e]];Ee.generateKeys=function(t,e){var r=Dat,n=e.client_random+e.server_random;t.session.resuming||(e.master_secret=r(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var o=2*e.mac_key_length+2*e.enc_key_length,s=t.version.major===Ee.Versions.TLS_1_0.major&&t.version.minor===Ee.Versions.TLS_1_0.minor;s&&(o+=2*e.fixed_iv_length);var c=r(e.master_secret,"key expansion",n,o),l={client_write_MAC_key:c.getBytes(e.mac_key_length),server_write_MAC_key:c.getBytes(e.mac_key_length),client_write_key:c.getBytes(e.enc_key_length),server_write_key:c.getBytes(e.enc_key_length)};return s&&(l.client_write_IV=c.getBytes(e.fixed_iv_length),l.server_write_IV=c.getBytes(e.fixed_iv_length)),l};Ee.createConnectionState=function(t){var e=t.entity===Ee.ConnectionEnd.client,r=a(function(){var s={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:a(function(c){return!0},"cipherFunction"),compressionState:null,compressFunction:a(function(c){return!0},"compressFunction"),updateSequenceNumber:a(function(){s.sequenceNumber[1]===4294967295?(s.sequenceNumber[1]=0,++s.sequenceNumber[0]):++s.sequenceNumber[1]},"updateSequenceNumber")};return s},"createMode"),n={read:r(),write:r()};if(n.read.update=function(s,c){return n.read.cipherFunction(c,n.read)?n.read.compressFunction(s,c,n.read)||s.error(s,{message:"Could not decompress record.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.bad_record_mac}}),!s.fail},n.write.update=function(s,c){return n.write.compressFunction(s,c,n.write)?n.write.cipherFunction(c,n.write)||s.error(s,{message:"Could not encrypt record.",send:!1,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=Ee.generateKeys(t,o),n.read.macKey=e?o.keys.server_write_MAC_key:o.keys.client_write_MAC_key,n.write.macKey=e?o.keys.client_write_MAC_key:o.keys.server_write_MAC_key,t.session.cipherSuite.initConnectionState(n,t,o),o.compression_algorithm){case Ee.CompressionMethod.none:break;case Ee.CompressionMethod.deflate:n.read.compressFunction=KPs,n.write.compressFunction=YPs;break;default:throw new Error("Unsupported compression algorithm.")}}return n};Ee.createRandom=function(){var t=new Date,e=+t+t.getTimezoneOffset()*6e4,r=Kt.util.createBuffer();return r.putInt32(e),r.putBytes(Kt.random.getBytes(28)),r};Ee.createRecord=function(t,e){if(!e.data)return null;var r={type:e.type,version:{major:t.version.major,minor:t.version.minor},length:e.data.length(),fragment:e.data};return r};Ee.createAlert=function(t,e){var r=Kt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),Ee.createRecord(t,{type:Ee.ContentType.alert,data:r})};Ee.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=Kt.util.createBuffer(),r=0;r0&&(h+=2);var m=t.session.id,g=m.length+1+2+4+28+2+o+1+c+h,A=Kt.util.createBuffer();return A.putByte(Ee.HandshakeType.client_hello),A.putInt24(g),A.putByte(t.version.major),A.putByte(t.version.minor),A.putBytes(t.session.sp.client_random),nR(A,1,Kt.util.createBuffer(m)),nR(A,2,e),nR(A,1,s),h>0&&nR(A,2,l),A};Ee.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Kt.util.createBuffer();return n.putByte(Ee.HandshakeType.server_hello),n.putInt24(r),n.putByte(t.version.major),n.putByte(t.version.minor),n.putBytes(t.session.sp.server_random),nR(n,1,Kt.util.createBuffer(e)),n.putByte(t.session.cipherSuite.id[0]),n.putByte(t.session.cipherSuite.id[1]),n.putByte(t.session.compressionMethod),n};Ee.createCertificate=function(t){var e=t.entity===Ee.ConnectionEnd.client,r=null;if(t.getCertificate){var n;e?n=t.session.certificateRequest:n=t.session.extensions.server_name.serverNameList,r=t.getCertificate(t,n)}var o=Kt.util.createBuffer();if(r!==null)try{Kt.util.isArray(r)||(r=[r]);for(var s=null,c=0;c0&&(r.putByte(Ee.HandshakeType.server_key_exchange),r.putInt24(e)),r};Ee.getClientSignature=function(t,e){var r=Kt.util.createBuffer();r.putBuffer(t.session.md5.digest()),r.putBuffer(t.session.sha1.digest()),r=r.getBytes(),t.getSignature=t.getSignature||function(n,o,s){var c=null;if(n.getPrivateKey)try{c=n.getPrivateKey(n,n.session.clientCertificate),c=Kt.pki.privateKeyFromPem(c)}catch(l){n.error(n,{message:"Could not get private key.",cause:l,send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};Ee.createCertificateVerify=function(t,e){var r=e.length+2,n=Kt.util.createBuffer();return n.putByte(Ee.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};Ee.createCertificateRequest=function(t){var e=Kt.util.createBuffer();e.putByte(1);var r=Kt.util.createBuffer();for(var n in t.caStore.certs){var o=t.caStore.certs[n],s=Kt.pki.distinguishedNameToAsn1(o.subject),c=Kt.asn1.toDer(s);r.putInt16(c.length()),r.putBuffer(c)}var l=1+e.length()+2+r.length(),u=Kt.util.createBuffer();return u.putByte(Ee.HandshakeType.certificate_request),u.putInt24(l),nR(u,1,e),nR(u,2,r),u};Ee.createServerHelloDone=function(t){var e=Kt.util.createBuffer();return e.putByte(Ee.HandshakeType.server_hello_done),e.putInt24(0),e};Ee.createChangeCipherSpec=function(){var t=Kt.util.createBuffer();return t.putByte(1),t};Ee.createFinished=function(t){var e=Kt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===Ee.ConnectionEnd.client,n=t.session.sp,o=12,s=Dat,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Kt.util.createBuffer();return l.putByte(Ee.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};Ee.createHeartbeat=function(t,e,r){typeof r>"u"&&(r=e.length);var n=Kt.util.createBuffer();n.putByte(t),n.putInt16(r),n.putBytes(e);var o=n.length(),s=Math.max(16,o-r-3);return n.putBytes(Kt.random.getBytes(s)),n};Ee.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===Ee.ContentType.handshake||e.type===Ee.ContentType.alert||e.type===Ee.ContentType.change_cipher_spec))){if(e.type===Ee.ContentType.handshake){var r=e.fragment.bytes();t.session.md5.update(r),t.session.sha1.update(r),r=null}var n;if(e.fragment.length()<=Ee.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>Ee.MaxFragment;)n.push(Ee.createRecord(t,{type:e.type,data:Kt.util.createBuffer(o.slice(0,Ee.MaxFragment))})),o=o.slice(Ee.MaxFragment);o.length>0&&n.push(Ee.createRecord(t,{type:e.type,data:Kt.util.createBuffer(o)}))}for(var s=0;s0&&(c=r.order[0]),c!==null&&c in r.cache){s=r.cache[c],delete r.cache[c];for(var l in r.order)if(r.order[l]===c){r.order.splice(l,1);break}}return s},r.setSession=function(o,s){if(r.order.length===r.capacity){var c=r.order.shift();delete r.cache[c]}var c=Kt.util.bytesToHex(o);r.order.push(c),r.cache[c]=s}}return r};Ee.createConnection=function(t){var e=null;t.caStore?Kt.util.isArray(t.caStore)?e=Kt.pki.createCaStore(t.caStore):e=t.caStore:e=Kt.pki.createCaStore();var r=t.cipherSuites||null;if(r===null){r=[];for(var n in Ee.CipherSuites)r.push(Ee.CipherSuites[n])}var o=t.server?Ee.ConnectionEnd.server:Ee.ConnectionEnd.client,s=t.sessionCache?Ee.createSessionCache(t.sessionCache):null,c={version:{major:Ee.Version.major,minor:Ee.Version.minor},entity:o,sessionId:t.sessionId,caStore:e,sessionCache:s,cipherSuites:r,connected:t.connected,virtualHost:t.virtualHost||null,verifyClient:t.verifyClient||!1,verify:t.verify||function(f,h,m,g){return h},verifyOptions:t.verifyOptions||{},getCertificate:t.getCertificate||null,getPrivateKey:t.getPrivateKey||null,getSignature:t.getSignature||null,input:Kt.util.createBuffer(),tlsData:Kt.util.createBuffer(),data:Kt.util.createBuffer(),tlsDataReady:t.tlsDataReady,dataReady:t.dataReady,heartbeatReceived:t.heartbeatReceived,closed:t.closed,error:a(function(f,h){h.origin=h.origin||(f.entity===Ee.ConnectionEnd.client?"client":"server"),h.send&&(Ee.queue(f,Ee.createAlert(f,h.alert)),Ee.flush(f));var m=h.fatal!==!1;m&&(f.fail=!0),t.error(f,h),m&&f.close(!1)},"error"),deflate:t.deflate||null,inflate:t.inflate||null};c.reset=function(f){c.version={major:Ee.Version.major,minor:Ee.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===Ee.ConnectionEnd.client?JPs:i2s,c.fragmented=null,c.records=[],c.open=!1,c.handshakes=0,c.handshaking=!1,c.isConnected=!1,c.fail=!(f||typeof f>"u"),c.input.clear(),c.tlsData.clear(),c.data.clear(),c.state.current=Ee.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-Ee.ContentType.change_cipher_spec,g=dar[f.entity][f.expect];m in g?g[m](f,h):Ee.handleUnexpected(f,h)},"_update"),u=a(function(f){var h=0,m=f.input,g=m.length();if(g<5)h=5-g;else{f.record={type:m.getByte(),version:{major:m.getByte(),minor:m.getByte()},length:m.getInt16(),fragment:Kt.util.createBuffer(),ready:!1};var A=f.record.version.major===f.version.major;A&&f.session&&f.session.version&&(A=f.record.version.minor===f.version.minor),A||f.error(f,{message:"Incompatible TLS version.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.protocol_version}})}return h},"_readRecordHeader"),d=a(function(f){var h=0,m=f.input,g=m.length();if(g0&&(c.sessionCache&&(h=c.sessionCache.getSession(f)),h===null&&(f="")),f.length===0&&c.sessionCache&&(h=c.sessionCache.getSession(),h!==null&&(f=h.id)),c.session={id:f,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:Kt.md.md5.create(),sha1:Kt.md.sha1.create()},h&&(c.version=h.version,c.session.sp=h.sp),c.session.sp.client_random=Ee.createRandom().getBytes(),c.open=!0,Ee.queue(c,Ee.createRecord(c,{type:Ee.ContentType.handshake,data:Ee.createClientHello(c)})),Ee.flush(c)}},c.process=function(f){var h=0;return f&&c.input.putBytes(f),c.fail||(c.record!==null&&c.record.ready&&c.record.fragment.isEmpty()&&(c.record=null),c.record===null&&(h=u(c)),!c.fail&&c.record!==null&&!c.record.ready&&(h=d(c)),!c.fail&&c.record!==null&&c.record.ready&&l(c,c.record)),h},c.prepare=function(f){return Ee.queue(c,Ee.createRecord(c,{type:Ee.ContentType.application_data,data:Kt.util.createBuffer(f)})),Ee.flush(c)},c.prepareHeartbeatRequest=function(f,h){return f instanceof Kt.util.ByteBuffer&&(f=f.bytes()),typeof h>"u"&&(h=f.length),c.expectedHeartbeatPayload=f,Ee.queue(c,Ee.createRecord(c,{type:Ee.ContentType.heartbeat,data:Ee.createHeartbeat(Ee.HeartbeatMessageType.heartbeat_request,f,h)})),Ee.flush(c)},c.close=function(f){if(!c.fail&&c.sessionCache&&c.session){var h={id:c.session.id,version:c.session.version,sp:c.session.sp};h.sp.keys=null,c.sessionCache.setSession(h.id,h)}c.open&&(c.open=!1,c.input.clear(),(c.isConnected||c.handshaking)&&(c.isConnected=c.handshaking=!1,Ee.queue(c,Ee.createAlert(c,{level:Ee.Alert.Level.warning,description:Ee.Alert.Description.close_notify})),Ee.flush(c)),c.closed(c)),c.reset(f)},c};FQn.exports=Kt.tls=Kt.tls||{};for(kat in Ee)typeof Ee[kat]!="function"&&(Kt.tls[kat]=Ee[kat]);var kat;Kt.tls.prf_tls1=Dat;Kt.tls.hmac_sha1=zPs;Kt.tls.createSessionCache=Ee.createSessionCache;Kt.tls.createConnection=Ee.createConnection});var qQn=I((y0f,QQn)=>{p();var TH=Cs();yH();far();var iR=QQn.exports=TH.tls;iR.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:a(function(t){t.bulk_cipher_algorithm=iR.BulkCipherAlgorithm.aes,t.cipher_type=iR.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=iR.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:UQn};iR.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:a(function(t){t.bulk_cipher_algorithm=iR.BulkCipherAlgorithm.aes,t.cipher_type=iR.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=iR.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:UQn};function UQn(t,e,r){var n=e.entity===TH.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:TH.cipher.createDecipher("AES-CBC",n?r.keys.server_write_key:r.keys.client_write_key),iv:n?r.keys.server_write_IV:r.keys.client_write_IV},t.write.cipherState={init:!1,cipher:TH.cipher.createCipher("AES-CBC",n?r.keys.client_write_key:r.keys.server_write_key),iv:n?r.keys.client_write_IV:r.keys.server_write_IV},t.read.cipherFunction=A2s,t.write.cipherFunction=h2s,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=iR.hmac_sha1}a(UQn,"initConnectionState");function h2s(t,e){var r=!1,n=e.macFunction(e.macKey,e.sequenceNumber,t);t.fragment.putBytes(n),e.updateSequenceNumber();var o;t.version.minor===iR.Versions.TLS_1_0.minor?o=e.cipherState.init?null:e.cipherState.iv:o=TH.random.getBytesSync(16),e.cipherState.init=!0;var s=e.cipherState.cipher;return s.start({iv:o}),t.version.minor>=iR.Versions.TLS_1_1.minor&&s.output.putBytes(o),s.update(t.fragment),s.finish(m2s)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(h2s,"encrypt_aes_cbc_sha1");function m2s(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(m2s,"encrypt_aes_cbc_sha1_padding");function g2s(t,e,r){var n=!0;if(r){for(var o=e.length(),s=e.last(),c=o-1-s;c=s?(t.fragment=o.output.getBytes(l-s),c=o.output.getBytes(s)):t.fragment=o.output.getBytes(),t.fragment=TH.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=y2s(e.macKey,c,u)&&r,r}a(A2s,"decrypt_aes_cbc_sha1");function y2s(t,e,r){var n=TH.hmac.create();return n.start("SHA1",t),n.update(e),e=n.digest().getBytes(),n.start(null,null),n.update(r),r=n.digest().getBytes(),e===r}a(y2s,"compareMacs")});var mar=I((v0f,$Qn)=>{p();var yd=Cs();t4();Ac();var M2e=$Qn.exports=yd.sha512=yd.sha512||{};yd.md.sha512=yd.md.algorithms.sha512=M2e;var HQn=yd.sha384=yd.sha512.sha384=yd.sha512.sha384||{};HQn.create=function(){return M2e.create("SHA-384")};yd.md.sha384=yd.md.algorithms.sha384=HQn;yd.sha512.sha256=yd.sha512.sha256||{create:a(function(){return M2e.create("SHA-512/256")},"create")};yd.md["sha512/256"]=yd.md.algorithms["sha512/256"]=yd.sha512.sha256;yd.sha512.sha224=yd.sha512.sha224||{create:a(function(){return M2e.create("SHA-512/224")},"create")};yd.md["sha512/224"]=yd.md.algorithms["sha512/224"]=yd.sha512.sha224;M2e.create=function(t){if(GQn||_2s(),typeof t>"u"&&(t="SHA-512"),!(t in dX))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=dX[t],r=null,n=yd.util.createBuffer(),o=new Array(80),s=0;s<80;++s)o[s]=new Array(2);var c=64;switch(t){case"SHA-384":c=48;break;case"SHA-512/256":c=32;break;case"SHA-512/224":c=28;break}var l={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:c,messageLength:0,fullMessageLength:null,messageLengthSize:16};return l.start=function(){l.messageLength=0,l.fullMessageLength=l.messageLength128=[];for(var u=l.messageLengthSize/4,d=0;d>>0,f>>>0];for(var h=l.fullMessageLength.length-1;h>=0;--h)l.fullMessageLength[h]+=f[1],f[1]=f[0]+(l.fullMessageLength[h]/4294967296>>>0),l.fullMessageLength[h]=l.fullMessageLength[h]>>>0,f[0]=f[1]/4294967296>>>0;return n.putBytes(u),jQn(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=yd.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes(par.substr(0,l.blockLength-f));for(var h,m,g=l.fullMessageLength[0]*8,A=0;A>>0,g+=m,u.putInt32(g>>>0),g=h>>>0;u.putInt32(g);for(var y=new Array(r.length),A=0;A=128;){for(L=0;L<16;++L)e[L][0]=r.getInt32()>>>0,e[L][1]=r.getInt32()>>>0;for(;L<80;++L)Q=e[L-2],U=Q[0],j=Q[1],n=((U>>>19|j<<13)^(j>>>29|U<<3)^U>>>6)>>>0,o=((U<<13|j>>>19)^(j<<3|U>>>29)^(U<<26|j>>>6))>>>0,W=e[L-15],U=W[0],j=W[1],s=((U>>>1|j<<31)^(U>>>8|j<<24)^U>>>7)>>>0,c=((U<<31|j>>>1)^(U<<24|j>>>8)^(U<<25|j>>>7))>>>0,Y=e[L-7],V=e[L-16],j=o+Y[1]+c+V[1],e[L][0]=n+Y[0]+s+V[0]+(j/4294967296>>>0)>>>0,e[L][1]=j>>>0;for(y=t[0][0],_=t[0][1],E=t[1][0],v=t[1][1],S=t[2][0],T=t[2][1],w=t[3][0],R=t[3][1],x=t[4][0],k=t[4][1],D=t[5][0],N=t[5][1],O=t[6][0],B=t[6][1],q=t[7][0],M=t[7][1],L=0;L<80;++L)d=((x>>>14|k<<18)^(x>>>18|k<<14)^(k>>>9|x<<23))>>>0,f=((x<<18|k>>>14)^(x<<14|k>>>18)^(k<<23|x>>>9))>>>0,h=(O^x&(D^O))>>>0,m=(B^k&(N^B))>>>0,l=((y>>>28|_<<4)^(_>>>2|y<<30)^(_>>>7|y<<25))>>>0,u=((y<<4|_>>>28)^(_<<30|y>>>2)^(_<<25|y>>>7))>>>0,g=(y&E|S&(y^E))>>>0,A=(_&v|T&(_^v))>>>0,j=M+f+m+har[L][1]+e[L][1],n=q+d+h+har[L][0]+e[L][0]+(j/4294967296>>>0)>>>0,o=j>>>0,j=u+A,s=l+g+(j/4294967296>>>0)>>>0,c=j>>>0,q=O,M=B,O=D,B=N,D=x,N=k,j=R+o,x=w+n+(j/4294967296>>>0)>>>0,k=j>>>0,w=S,R=T,S=E,T=v,E=y,v=_,j=o+c,y=n+s+(j/4294967296>>>0)>>>0,_=j>>>0;j=t[0][1]+_,t[0][0]=t[0][0]+y+(j/4294967296>>>0)>>>0,t[0][1]=j>>>0,j=t[1][1]+v,t[1][0]=t[1][0]+E+(j/4294967296>>>0)>>>0,t[1][1]=j>>>0,j=t[2][1]+T,t[2][0]=t[2][0]+S+(j/4294967296>>>0)>>>0,t[2][1]=j>>>0,j=t[3][1]+R,t[3][0]=t[3][0]+w+(j/4294967296>>>0)>>>0,t[3][1]=j>>>0,j=t[4][1]+k,t[4][0]=t[4][0]+x+(j/4294967296>>>0)>>>0,t[4][1]=j>>>0,j=t[5][1]+N,t[5][0]=t[5][0]+D+(j/4294967296>>>0)>>>0,t[5][1]=j>>>0,j=t[6][1]+B,t[6][0]=t[6][0]+O+(j/4294967296>>>0)>>>0,t[6][1]=j>>>0,j=t[7][1]+M,t[7][0]=t[7][0]+q+(j/4294967296>>>0)>>>0,t[7][1]=j>>>0,z-=128}}a(jQn,"_update")});var VQn=I(gar=>{p();var E2s=Cs();J2();var j0=E2s.asn1;gar.privateKeyValidator={name:"PrivateKeyInfo",tagClass:j0.Class.UNIVERSAL,type:j0.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:j0.Class.UNIVERSAL,type:j0.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:j0.Class.UNIVERSAL,type:j0.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:j0.Class.UNIVERSAL,type:j0.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:j0.Class.UNIVERSAL,type:j0.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};gar.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:j0.Class.UNIVERSAL,type:j0.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:j0.Class.UNIVERSAL,type:j0.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:j0.Class.UNIVERSAL,type:j0.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:j0.Class.UNIVERSAL,type:j0.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var oqn=I((I0f,iqn)=>{p();var iy=Cs();k2e();Xw();mar();Ac();var ZQn=VQn(),v2s=ZQn.publicKeyValidator,C2s=ZQn.privateKeyValidator;typeof WQn>"u"&&(WQn=iy.jsbn.BigInteger);var WQn,yar=iy.util.ByteBuffer,Mb=typeof Buffer>"u"?Uint8Array:Buffer;iy.pki=iy.pki||{};iqn.exports=iy.pki.ed25519=iy.ed25519=iy.ed25519||{};var sa=iy.ed25519;sa.constants={};sa.constants.PUBLIC_KEY_BYTE_LENGTH=32;sa.constants.PRIVATE_KEY_BYTE_LENGTH=64;sa.constants.SEED_BYTE_LENGTH=32;sa.constants.SIGN_BYTE_LENGTH=64;sa.constants.HASH_BYTE_LENGTH=64;sa.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=iy.random.getBytesSync(sa.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==sa.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+sa.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');e=C8({message:e,encoding:"binary"});for(var r=new Mb(sa.constants.PUBLIC_KEY_BYTE_LENGTH),n=new Mb(sa.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return I2s(r,n),{publicKey:r,privateKey:n}};sa.privateKeyFromAsn1=function(t){var e={},r=[],n=iy.asn1.validate(t,C2s,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=iy.asn1.derToOid(e.privateKeyOid),c=iy.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.privateKey,u=C8({message:iy.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};sa.publicKeyFromAsn1=function(t){var e={},r=[],n=iy.asn1.validate(t,v2s,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=iy.asn1.derToOid(e.publicKeyOid),c=iy.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.ed25519PublicKey;if(l.length!==sa.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return C8({message:l,encoding:"binary"})};sa.publicKeyFromPrivateKey=function(t){t=t||{};var e=C8({message:t.privateKey,encoding:"binary"});if(e.length!==sa.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+sa.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new Mb(sa.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function C8(t){var e=t.message;if(e instanceof Uint8Array||e instanceof Mb)return e;var r=t.encoding;if(e===void 0)if(t.md)e=t.md.digest().getBytes(),r="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof e=="string"&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof e=="string"){if(typeof Buffer<"u")return Buffer.from(e,r);e=new yar(e,r)}else if(!(e instanceof yar))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new Mb(e.length()),o=0;o=0;--r){if(t[e+r]O2e[r])return!1}return!1}a(R2s,"_isCanonicalSignatureScalar");function XQn(t,e){var r,n,o,s;for(n=63;n>=32;--n){for(r=0,o=n-32,s=n-12;o>8,e[o]-=r*256;e[o]+=r,e[n]=0}for(r=0,o=0;o<32;++o)e[o]+=r-(e[31]>>4)*O2e[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*O2e[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a(XQn,"modL");function Ear(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;XQn(t,e)}a(Ear,"reduce");function Car(t,e){var r=zi(),n=zi(),o=zi(),s=zi(),c=zi(),l=zi(),u=zi(),d=zi(),f=zi();phe(r,t[1],t[0]),phe(f,e[1],e[0]),su(r,r,f),fhe(n,t[0],t[1]),fhe(f,e[0],e[1]),su(n,n,f),su(o,t[3],e[3]),su(o,o,S2s),su(s,t[2],e[2]),fhe(s,s,s),phe(c,n,r),phe(l,s,o),fhe(u,s,o),fhe(d,n,r),su(t[0],c,l),su(t[1],d,u),su(t[2],u,l),su(t[3],c,d)}a(Car,"add");function KQn(t,e,r){for(var n=0;n<4;++n)nqn(t[n],e[n],r)}a(KQn,"cswap");function bar(t,e){var r=zi(),n=zi(),o=zi();M2s(o,e[2]),su(r,e[0],o),su(n,e[1],o),Mat(t,n),t[31]^=tqn(r)<<7}a(bar,"pack");function Mat(t,e){var r,n,o,s=zi(),c=zi();for(r=0;r<16;++r)c[r]=e[r];for(Aar(c),Aar(c),Aar(c),n=0;n<2;++n){for(s[0]=c[0]-65517,r=1;r<15;++r)s[r]=c[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=c[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,nqn(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(Mat,"pack25519");function k2s(t,e){var r=zi(),n=zi(),o=zi(),s=zi(),c=zi(),l=zi(),u=zi();return IH(t[2],Nat),P2s(t[1],e),fX(o,t[1]),su(s,o,b2s),phe(o,o,t[2]),fhe(s,t[2],s),fX(c,s),fX(l,c),su(u,l,c),su(r,u,o),su(r,r,s),D2s(r,r),su(r,r,o),su(r,r,s),su(r,r,s),su(t[0],r,s),fX(n,t[0]),su(n,n,s),JQn(n,o)&&su(t[0],t[0],T2s),fX(n,t[0]),su(n,n,s),JQn(n,o)?-1:(tqn(t[0])===e[31]>>7&&phe(t[0],_ar,t[0]),su(t[3],t[0],t[1]),0)}a(k2s,"unpackneg");function P2s(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(P2s,"unpack25519");function D2s(t,e){var r=zi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)fX(r,r),n!==1&&su(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(D2s,"pow2523");function JQn(t,e){var r=new Mb(32),n=new Mb(32);return Mat(r,t),Mat(n,e),eqn(r,0,n,0)}a(JQn,"neq25519");function eqn(t,e,r,n){return N2s(t,e,r,n,32)}a(eqn,"crypto_verify_32");function N2s(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(N2s,"vn");function tqn(t){var e=new Mb(32);return Mat(e,t),e[0]&1}a(tqn,"par25519");function rqn(t,e,r){var n,o;for(IH(t[0],_ar),IH(t[1],Nat),IH(t[2],Nat),IH(t[3],_ar),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,KQn(t,e,n),Car(e,t),Car(t,t),KQn(t,e,n)}a(rqn,"scalarmult");function Sar(t,e){var r=[zi(),zi(),zi(),zi()];IH(r[0],zQn),IH(r[1],YQn),IH(r[2],Nat),su(r[3],zQn,YQn),rqn(t,r,e)}a(Sar,"scalarbase");function IH(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(IH,"set25519");function M2s(t,e){var r=zi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)fX(r,r),n!==2&&n!==4&&su(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(M2s,"inv25519");function Aar(t){var e,r,n=1;for(e=0;e<16;++e)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-n*65536;t[0]+=n-1+37*(n-1)}a(Aar,"car25519");function nqn(t,e,r){for(var n,o=~(r-1),s=0;s<16;++s)n=o&(t[s]^e[s]),t[s]^=n,e[s]^=n}a(nqn,"sel25519");function zi(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var HT=Cs();Ac();Xw();k2e();cqn.exports=HT.kem=HT.kem||{};var sqn=HT.jsbn.BigInteger;HT.kem.rsa={};HT.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||HT.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new sqn(HT.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(sqn.ONE)<=0);l=HT.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=HT.util.fillString("\0",u)+l);var d=o.encrypt(l,"NONE"),f=t.generate(l,s);return{encapsulation:d,key:f}},n.decrypt=function(o,s,c){var l=o.decrypt(s,"NONE");return t.generate(l,c)},n};HT.kem.kdf1=function(t,e){aqn(this,t,0,e||t.digestLength)};HT.kem.kdf2=function(t,e){aqn(this,t,1,e||t.digestLength)};function aqn(t,e,r,n){t.generate=function(o,s){for(var c=new HT.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new HT.util.ByteBuffer,d=r;d{p();var va=Cs();Ac();fqn.exports=va.log=va.log||{};va.log.levels=["none","error","warning","info","debug","verbose","max"];var Oat={},xar=[],F2e=null;va.log.LEVEL_LOCKED=2;va.log.NO_LEVEL_CHECK=4;va.log.INTERPOLATE=8;for(l4=0;l4"u"||e?t.flags|=va.log.LEVEL_LOCKED:t.flags&=~va.log.LEVEL_LOCKED};va.log.addLogger=function(t){xar.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(uqn={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},U2e=a(function(t,e){va.log.prepareStandard(e);var r=uqn[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),hhe=va.log.makeLogger(U2e)):(U2e=a(function(e,r){va.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),hhe=va.log.makeLogger(U2e)),va.log.setLevel(hhe,"debug"),va.log.addLogger(hhe),F2e=hhe):console={log:a(function(){},"log")};var hhe,uqn,U2e;F2e!==null&&typeof window<"u"&&window.location&&(B2e=new URL(window.location.href).searchParams,B2e.has("console.level")&&va.log.setLevel(F2e,B2e.get("console.level").slice(-1)[0]),B2e.has("console.lock")&&(dqn=B2e.get("console.lock").slice(-1)[0],dqn=="true"&&va.log.lock(F2e)));var B2e,dqn;va.log.consoleLogger=F2e});var mqn=I((O0f,hqn)=>{p();hqn.exports=t4();hat();ahe();Qsr();mar()});var yqn=I((B0f,Aqn)=>{p();var rn=Cs();yH();J2();w2e();_H();oX();ear();Xw();Ac();wat();var et=rn.asn1,wv=Aqn.exports=rn.pkcs7=rn.pkcs7||{};wv.messageFromPem=function(t){var e=rn.pem.decode(t)[0];if(e.type!=="PKCS7"){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var n=et.fromDer(e.body);return wv.messageFromAsn1(n)};wv.messageToPem=function(t,e){var r={type:"PKCS7",body:et.toDer(t.toAsn1()).getBytes()};return rn.pem.encode(r,{maxline:e})};wv.messageFromAsn1=function(t){var e={},r=[];if(!et.validate(t,wv.asn1.contentInfoValidator,e,r)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw n.errors=r,n}var o=et.derToOid(e.contentType),s;switch(o){case rn.pki.oids.envelopedData:s=wv.createEnvelopedData();break;case rn.pki.oids.encryptedData:s=wv.createEncryptedData();break;case rn.pki.oids.signedData:s=wv.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+o+" is not (yet) supported.")}return s.fromAsn1(e.content.value[0]),s};wv.createSignedData=function(){var t=null;return t={type:rn.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:a(function(n){if(Rar(t,n,wv.asn1.signedDataValidator),t.certificates=[],t.crls=[],t.digestAlgorithmIdentifiers=[],t.contentInfo=null,t.signerInfos=[],t.rawCapture.certificates)for(var o=t.rawCapture.certificates.value,s=0;s0&&c.value[0].value.push(et.create(et.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&c.value[0].value.push(et.create(et.Class.CONTEXT_SPECIFIC,1,!0,s)),c.value[0].value.push(et.create(et.Class.UNIVERSAL,et.Type.SET,!0,t.signerInfos)),et.create(et.Class.UNIVERSAL,et.Type.SEQUENCE,!0,[et.create(et.Class.UNIVERSAL,et.Type.OID,!1,et.oidToDer(t.type).getBytes()),c])},"toAsn1"),addSigner:a(function(n){var o=n.issuer,s=n.serialNumber;if(n.certificate){var c=n.certificate;typeof c=="string"&&(c=rn.pki.certificateFromPem(c)),o=c.issuer.attributes,s=c.serialNumber}var l=n.key;if(!l)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof l=="string"&&(l=rn.pki.privateKeyFromPem(l));var u=n.digestAlgorithm||rn.pki.oids.sha1;switch(u){case rn.pki.oids.sha1:case rn.pki.oids.sha256:case rn.pki.oids.sha384:case rn.pki.oids.sha512:case rn.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+u)}var d=n.authenticatedAttributes||[];if(d.length>0){for(var f=!1,h=!1,m=0;m0){for(var r=et.create(et.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n=r&&o{p();var Sm=Cs();yH();nhe();hat();ahe();Ac();var Bat=_qn.exports=Sm.ssh=Sm.ssh||{};Bat.privateKeyToPutty=function(t,e,r){r=r||"",e=e||"";var n="ssh-rsa",o=e===""?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: "+n+`\r +`+l+e.substr(c+1),s=o-c-1,c=-1,++o}else(e[o]===" "||e[o]===" "||e[o]===",")&&(c=o);return e}a(mat,"foldHeader");function gRs(t){return t.replace(/^\s+/,"")}a(gRs,"ltrim")});var w2e=I((ygf,O7n)=>{p();var of=Cs();aat();Msr();Ac();O7n.exports=of.des=of.des||{};of.des.startEncrypting=function(t,e,r,n){var o=Aat({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};of.des.createEncryptionCipher=function(t,e){return Aat({key:t,output:null,decrypt:!1,mode:e})};of.des.startDecrypting=function(t,e,r,n){var o=Aat({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};of.des.createDecryptionCipher=function(t,e){return Aat({key:t,output:null,decrypt:!0,mode:e})};of.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return M7n(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return M7n(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};of.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=of.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=TRs(e),this._init=!0}};n4("DES-ECB",of.cipher.modes.ecb);n4("DES-CBC",of.cipher.modes.cbc);n4("DES-CFB",of.cipher.modes.cfb);n4("DES-OFB",of.cipher.modes.ofb);n4("DES-CTR",of.cipher.modes.ctr);n4("3DES-ECB",of.cipher.modes.ecb);n4("3DES-CBC",of.cipher.modes.cbc);n4("3DES-CFB",of.cipher.modes.cfb);n4("3DES-OFB",of.cipher.modes.ofb);n4("3DES-CTR",of.cipher.modes.ctr);function n4(t,e){var r=a(function(){return new of.des.Algorithm(t,e)},"factory");of.cipher.registerAlgorithm(t,r)}a(n4,"registerAlgorithm");var ARs=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],yRs=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],_Rs=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],ERs=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],vRs=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],CRs=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],bRs=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],SRs=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function TRs(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],c=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],l=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],d=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],m=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],A=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=t.length()>8?3:1,_=[],E=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,S,T=0;T>>4^R)&252645135,R^=S,w^=S<<4,S=(R>>>-16^w)&65535,w^=S,R^=S<<-16,S=(w>>>2^R)&858993459,R^=S,w^=S<<2,S=(R>>>-16^w)&65535,w^=S,R^=S<<-16,S=(w>>>1^R)&1431655765,R^=S,w^=S<<1,S=(R>>>8^w)&16711935,w^=S,R^=S<<8,S=(w>>>1^R)&1431655765,R^=S,w^=S<<1,S=w<<8|R>>>20&240,w=R<<24|R<<8&16711680|R>>>8&65280|R>>>24&240,R=S;for(var x=0;x>>26,R=R<<2|R>>>26):(w=w<<1|w>>>27,R=R<<1|R>>>27),w&=-15,R&=-15;var k=e[w>>>28]|r[w>>>24&15]|n[w>>>20&15]|o[w>>>16&15]|s[w>>>12&15]|c[w>>>8&15]|l[w>>>4&15],D=u[R>>>28]|d[R>>>24&15]|f[R>>>20&15]|h[R>>>16&15]|m[R>>>12&15]|g[R>>>8&15]|A[R>>>4&15];S=(D>>>16^k)&65535,_[v++]=k^S,_[v++]=D^S<<16}}return _}a(TRs,"_createKeys");function M7n(t,e,r,n){var o=t.length===32?3:9,s;o===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var c,l=e[0],u=e[1];c=(l>>>4^u)&252645135,u^=c,l^=c<<4,c=(l>>>16^u)&65535,u^=c,l^=c<<16,c=(u>>>2^l)&858993459,l^=c,u^=c<<2,c=(u>>>8^l)&16711935,l^=c,u^=c<<8,c=(l>>>1^u)&1431655765,u^=c,l^=c<<1,l=l<<1|l>>>31,u=u<<1|u>>>31;for(var d=0;d>>4|u<<28)^t[m+1];c=l,l=u,u=c^(yRs[g>>>24&63]|ERs[g>>>16&63]|CRs[g>>>8&63]|SRs[g&63]|ARs[A>>>24&63]|_Rs[A>>>16&63]|vRs[A>>>8&63]|bRs[A&63])}c=l,l=u,u=c}l=l>>>1|l<<31,u=u>>>1|u<<31,c=(l>>>1^u)&1431655765,u^=c,l^=c<<1,c=(u>>>8^l)&16711935,l^=c,u^=c<<8,c=(u>>>2^l)&858993459,l^=c,u^=c<<2,c=(l>>>16^u)&65535,u^=c,l^=c<<16,c=(l>>>4^u)&252645135,u^=c,l^=c<<4,r[0]=l,r[1]=u}a(M7n,"_updateBlock");function Aat(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=of.cipher.createDecipher(r,t.key):n=of.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof of.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(Aat,"_createCipher")});var yat=I((vgf,L7n)=>{p();var Iv=Cs();ihe();t4();Ac();var IRs=Iv.pkcs5=Iv.pkcs5||{},E8;Iv.util.isNodejs&&!Iv.options.usePureJavaScript&&(E8=require("crypto"));L7n.exports=Iv.pbkdf2=IRs.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),Iv.util.isNodejs&&!Iv.options.usePureJavaScript&&E8.pbkdf2&&(o===null||typeof o!="object")&&(E8.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?E8.pbkdf2Sync.length===4?E8.pbkdf2(t,e,r,n,function(S,T){if(S)return s(S);s(null,T.toString("binary"))}):E8.pbkdf2(t,e,r,n,o,function(S,T){if(S)return s(S);s(null,T.toString("binary"))}):E8.pbkdf2Sync.length===4?E8.pbkdf2Sync(t,e,r,n).toString("binary"):E8.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in Iv.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=Iv.md[o].create()}var c=o.digestLength;if(n>4294967295*c){var l=new Error("Derived key is too long.");if(s)return s(l);throw l}var u=Math.ceil(n/c),d=n-(u-1)*c,f=Iv.hmac.create();f.start(o,t);var h="",m,g,A;if(!s){for(var y=1;y<=u;++y){f.start(null,null),f.update(e),f.update(Iv.util.int32ToBytes(y)),m=A=f.digest().getBytes();for(var _=2;_<=r;++_)f.start(null,null),f.update(A),g=f.digest().getBytes(),m=Iv.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(Iv.util.int32ToBytes(y)),m=A=f.digest().getBytes(),_=2,v()}a(E,"outer");function v(){if(_<=r)return f.start(null,null),f.update(A),g=f.digest().getBytes(),m=Iv.util.xorBytes(m,g,c),A=g,++_,Iv.util.setImmediate(v);h+=y{p();var i4=Cs();t4();Ac();var F7n=q7n.exports=i4.sha256=i4.sha256||{};i4.md.sha256=i4.md.algorithms.sha256=F7n;F7n.create=function(){U7n||xRs();var t=null,e=i4.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),B7n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=i4.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(Qsr.substr(0,n.blockLength-c));for(var l,u,d=n.fullMessageLength[0]*8,f=0;f>>0,d+=u,o.putInt32(d>>>0),d=l>>>0;o.putInt32(d);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};B7n(h,r,o);var m=i4.util.createBuffer();return m.putInt32(h.h0),m.putInt32(h.h1),m.putInt32(h.h2),m.putInt32(h.h3),m.putInt32(h.h4),m.putInt32(h.h5),m.putInt32(h.h6),m.putInt32(h.h7),m},n};var Qsr=null,U7n=!1,Q7n=null;function xRs(){Qsr="\x80",Qsr+=i4.util.fillString("\0",64),Q7n=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],U7n=!0}a(xRs,"_init");function B7n(t,e,r){for(var n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v=r.length();v>=64;){for(d=0;d<16;++d)e[d]=r.getInt32();for(;d<64;++d)n=e[d-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,o=e[d-15],o=(o>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,e[d]=n+e[d-7]+o+e[d-16]|0;for(f=t.h0,h=t.h1,m=t.h2,g=t.h3,A=t.h4,y=t.h5,_=t.h6,E=t.h7,d=0;d<64;++d)c=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7),l=_^A&(y^_),s=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),u=f&h|m&(f^h),n=E+c+l+Q7n[d]+e[d],o=s+u,E=_,_=y,y=A,A=g+n>>>0,g=m,m=h,h=f,f=n+o>>>0;t.h0=t.h0+f|0,t.h1=t.h1+h|0,t.h2=t.h2+m|0,t.h3=t.h3+g|0,t.h4=t.h4+A|0,t.h5=t.h5+y|0,t.h6=t.h6+_|0,t.h7=t.h7+E|0,v-=64}}a(B7n,"_update")});var jsr=I((xgf,j7n)=>{p();var o4=Cs();Ac();var _at=null;o4.util.isNodejs&&!o4.options.usePureJavaScript&&!process.versions["node-webkit"]&&(_at=require("crypto"));var wRs=j7n.exports=o4.prng=o4.prng||{};wRs.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),o=0;o<32;++o)n[o]=r.create();e.pools=n,e.pool=0,e.generate=function(d,f){if(!f)return e.generateSync(d);var h=e.plugin.cipher,m=e.plugin.increment,g=e.plugin.formatKey,A=e.plugin.formatSeed,y=o4.util.createBuffer();e.key=null,_();function _(E){if(E)return f(E);if(y.length()>=d)return f(null,y.getBytes(d));if(e.generated>1048575&&(e.key=null),e.key===null)return o4.util.nextTick(function(){s(_)});var v=h(e.key,e.seed);e.generated+=v.length,y.putBytes(v),e.key=g(h(e.key,m(e.seed))),e.seed=A(h(e.key,e.seed)),o4.util.setImmediate(_)}a(_,"generate")},e.generateSync=function(d){var f=e.plugin.cipher,h=e.plugin.increment,m=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var A=o4.util.createBuffer();A.length()1048575&&(e.key=null),e.key===null&&c();var y=f(e.key,e.seed);e.generated+=y.length,A.putBytes(y),e.key=m(f(e.key,h(e.seed))),e.seed=g(f(e.key,e.seed))}return A.getBytes(d)};function s(d){if(e.pools[0].messageLength>=32)return l(),d();var f=32-e.pools[0].messageLength<<5;e.seedFile(f,function(h,m){if(h)return d(h);e.collect(m),l(),d()})}a(s,"_reseed");function c(){if(e.pools[0].messageLength>=32)return l();var d=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(d)),l()}a(c,"_reseedSync");function l(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var d=e.plugin.md.create();d.update(e.keyBytes);for(var f=1,h=0;h<32;++h)e.reseeds%f===0&&(d.update(e.pools[h].digest().getBytes()),e.pools[h].start()),f=f<<1;e.keyBytes=d.digest().getBytes(),d.start(),d.update(e.keyBytes);var m=d.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(m),e.generated=0}a(l,"_seed");function u(d){var f=null,h=o4.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=o4.util.createBuffer();if(f)for(;g.length()>16),v+=(E&32767)<<16,v+=E>>15,v=(v&2147483647)+(v>>31),T=v&4294967295;for(var _=0;_<3;++_)S=T>>>(_<<3),S^=Math.floor(Math.random()*256),g.putByte(S&255)}return g.getBytes(d)}return a(u,"defaultSeedFile"),_at?(e.seedFile=function(d,f){_at.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return _at.randomBytes(d).toString()}):(e.seedFile=function(d,f){try{f(null,u(d))}catch(h){f(h)}},e.seedFileSync=u),e.collect=function(d){for(var f=d.length,h=0;h>m&255);e.collect(h)},e.registerWorker=function(d){if(d===self)e.seedFile=function(h,m){function g(A){var y=A.data;y.forge&&y.forge.prng&&(self.removeEventListener("message",g),m(y.forge.prng.err,y.forge.prng.bytes))}a(g,"listener"),self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var f=a(function(h){var m=h.data;m.forge&&m.forge.prng&&e.seedFile(m.forge.prng.needed,function(g,A){d.postMessage({forge:{prng:{err:g,bytes:A}}})})},"listener");d.addEventListener("message",f)}},e}});var Xw=I((kgf,Hsr)=>{p();var j0=Cs();yH();qsr();jsr();Ac();(function(){if(j0.random&&j0.random.getBytes){Hsr.exports=j0.random;return}(function(t){var e={},r=new Array(4),n=j0.util.createBuffer();e.formatKey=function(h){var m=j0.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),j0.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=j0.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),h},e.cipher=function(h,m){return j0.aes._updateBlock(h,m,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=j0.md.sha256;function o(){var h=j0.prng.create(e);return h.getBytes=function(m,g){return h.generate(m,g)},h.getBytesSync=function(m){return h.generate(m)},h}a(o,"spawnPrng");var s=o(),c=null,l=j0.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),j0.options.usePureJavaScript||!j0.util.isNodejs&&!c){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var d="";for(var f in navigator)try{typeof navigator[f]=="string"&&(d+=navigator[f])}catch{}s.collect(d),d=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!j0.random)j0.random=s;else for(var f in s)j0.random[f]=s[f];j0.random.createInstance=o,Hsr.exports=j0.random})(typeof jQuery<"u"?jQuery:null)})()});var $sr=I((Ngf,$7n)=>{p();var Nb=Cs();Ac();var Gsr=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],H7n=[1,2,3,5],RRs=a(function(t,e){return t<>16-e},"rol"),kRs=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");$7n.exports=Nb.rc2=Nb.rc2||{};Nb.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Nb.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),o=e,s=Math.ceil(o/8),c=255>>(o&7),l;for(l=n;l<128;l++)r.putByte(Gsr[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,Gsr[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,Gsr[r.at(l+1)^r.at(l+s)]);return r};var G7n=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=Nb.rc2.expandKey(t,e),d=0;d<64;d++)h.push(t.getInt16Le());r?(l=a(function(A){for(d=0;d<4;d++)A[d]+=h[f]+(A[(d+3)%4]&A[(d+2)%4])+(~A[(d+3)%4]&A[(d+1)%4]),A[d]=RRs(A[d],H7n[d]),f++},"mixRound"),u=a(function(A){for(d=0;d<4;d++)A[d]+=h[A[(d+3)%4]&63]},"mashRound")):(l=a(function(A){for(d=3;d>=0;d--)A[d]=kRs(A[d],H7n[d]),A[d]-=h[f]+(A[(d+3)%4]&A[(d+2)%4])+(~A[(d+3)%4]&A[(d+1)%4]),f--},"mixRound"),u=a(function(A){for(d=3;d>=0;d--)A[d]-=h[A[(d+3)%4]&63]},"mashRound"));var m=a(function(A){var y=[];for(d=0;d<4;d++){var _=o.getInt16Le();c!==null&&(r?_^=c.getInt16Le():c.putInt16Le(_)),y.push(_&65535)}f=r?0:63;for(var E=0;E=8;)m([[5,l],[1,u],[6,l],[1,u],[5,l]])},"update"),finish:a(function(A){var y=!0;if(r)if(A)y=A(8,o,!r);else{var _=o.length()===8?8:8-o.length();o.fillWithByte(_,_)}if(y&&(n=!0,g.update()),!r&&(y=o.length()===0,y))if(A)y=A(8,s,!r);else{var E=s.length(),v=s.at(E-1);v>E?y=!1:s.truncate(v)}return y},"finish")},g},"createCipher");Nb.rc2.startEncrypting=function(t,e,r){var n=Nb.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Nb.rc2.createEncryptionCipher=function(t,e){return G7n(t,e,!0)};Nb.rc2.startDecrypting=function(t,e,r){var n=Nb.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Nb.rc2.createDecryptionCipher=function(t,e){return G7n(t,e,!1)}});var k2e=I((Lgf,X7n)=>{p();var Vsr=Cs();X7n.exports=Vsr.jsbn=Vsr.jsbn||{};var v8,PRs=0xdeadbeefcafe,V7n=(PRs&16777215)==15715070;function Wt(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}a(Wt,"BigInteger");Vsr.jsbn.BigInteger=Wt;function tc(){return new Wt(null)}a(tc,"nbi");function DRs(t,e,r,n,o,s){for(;--s>=0;){var c=e*this.data[t++]+r.data[n]+o;o=Math.floor(c/67108864),r.data[n++]=c&67108863}return o}a(DRs,"am1");function NRs(t,e,r,n,o,s){for(var c=e&32767,l=e>>15;--s>=0;){var u=this.data[t]&32767,d=this.data[t++]>>15,f=l*u+d*c;u=c*u+((f&32767)<<15)+r.data[n]+(o&1073741823),o=(u>>>30)+(f>>>15)+l*d+(o>>>30),r.data[n++]=u&1073741823}return o}a(NRs,"am2");function W7n(t,e,r,n,o,s){for(var c=e&16383,l=e>>14;--s>=0;){var u=this.data[t]&16383,d=this.data[t++]>>14,f=l*u+d*c;u=c*u+((f&16383)<<14)+r.data[n]+o,o=(u>>28)+(f>>14)+l*d,r.data[n++]=u&268435455}return o}a(W7n,"am3");typeof navigator>"u"?(Wt.prototype.am=W7n,v8=28):V7n&&navigator.appName=="Microsoft Internet Explorer"?(Wt.prototype.am=NRs,v8=30):V7n&&navigator.appName!="Netscape"?(Wt.prototype.am=DRs,v8=26):(Wt.prototype.am=W7n,v8=28);Wt.prototype.DB=v8;Wt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(ORs,"bnpCopyTo");function LRs(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}a(LRs,"bnpFromInt");function EH(t){var e=tc();return e.fromInt(t),e}a(EH,"nbv");function BRs(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,o=!1,s=0;--n>=0;){var c=r==8?t[n]&255:Y7n(t,n);if(c<0){t.charAt(n)=="-"&&(o=!0);continue}o=!1,s==0?this.data[this.t++]=c:s+r>this.DB?(this.data[this.t-1]|=(c&(1<>this.DB-s):this.data[this.t-1]|=c<=this.DB&&(s-=this.DB)}r==8&&(t[0]&128)!=0&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}a(FRs,"bnpClamp");function URs(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(l>l)>0&&(o=!0,s=z7n(n));c>=0;)l>(l+=this.DB-e)):(n=this.data[c]>>(l-=e)&r,l<=0&&(l+=this.DB,--c)),n>0&&(o=!0),o&&(s+=z7n(n));return o?s:"0"}a(URs,"bnToString");function QRs(){var t=tc();return Wt.ZERO.subTo(this,t),t}a(QRs,"bnNegate");function qRs(){return this.s<0?this.negate():this}a(qRs,"bnAbs");function jRs(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}a(jRs,"bnCompareTo");function vat(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}a(vat,"nbits");function HRs(){return this.t<=0?0:this.DB*(this.t-1)+vat(this.data[this.t-1]^this.s&this.DM)}a(HRs,"bnBitLength");function GRs(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}a(GRs,"bnpDLShiftTo");function $Rs(t,e){for(var r=t;r=0;--l)e.data[l+s+1]=this.data[l]>>n|c,c=(this.data[l]&o)<=0;--l)e.data[l]=0;e.data[s]=c,e.t=this.t+s+1,e.s=this.s,e.clamp()}a(VRs,"bnpLShiftTo");function WRs(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,o=this.DB-n,s=(1<>n;for(var c=r+1;c>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}a(zRs,"bnpSubTo");function YRs(t,e){var r=this.abs(),n=t.abs(),o=r.t;for(e.t=o+n.t;--o>=0;)e.data[o]=0;for(o=0;o=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}a(KRs,"bnpSquareTo");function JRs(t,e,r){var n=t.abs();if(!(n.t<=0)){var o=this.abs();if(o.t0?(n.lShiftTo(u,s),o.lShiftTo(u,r)):(n.copyTo(s),o.copyTo(r));var d=s.t,f=s.data[d-1];if(f!=0){var h=f*(1<1?s.data[d-2]>>this.F2:0),m=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(E,r)),Wt.ONE.dlShiftTo(d,E),E.subTo(s,s);s.t=0;){var v=r.data[--y]==f?this.DM:Math.floor(r.data[y]*m+(r.data[y-1]+A)*g);if((r.data[y]+=s.am(0,v,r,_,0,d))0&&r.rShiftTo(u,r),c<0&&Wt.ZERO.subTo(r,r)}}}a(JRs,"bnpDivRemTo");function ZRs(t){var e=tc();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Wt.ZERO)>0&&t.subTo(e,e),e}a(ZRs,"bnMod");function aX(t){this.m=t}a(aX,"Classic");function XRs(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(XRs,"cConvert");function eks(t){return t}a(eks,"cRevert");function tks(t){t.divRemTo(this.m,null,t)}a(tks,"cReduce");function rks(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(rks,"cMulTo");function nks(t,e){t.squareTo(e),this.reduce(e)}a(nks,"cSqrTo");aX.prototype.convert=XRs;aX.prototype.revert=eks;aX.prototype.reduce=tks;aX.prototype.mulTo=rks;aX.prototype.sqrTo=nks;function iks(){if(this.t<1)return 0;var t=this.data[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}a(iks,"bnpInvDigit");function cX(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}a(oks,"montConvert");function sks(t){var e=tc();return t.copyTo(e),this.reduce(e),e}a(sks,"montRevert");function aks(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}a(aks,"montReduce");function cks(t,e){t.squareTo(e),this.reduce(e)}a(cks,"montSqrTo");function lks(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(lks,"montMulTo");cX.prototype.convert=oks;cX.prototype.revert=sks;cX.prototype.reduce=aks;cX.prototype.mulTo=lks;cX.prototype.sqrTo=cks;function uks(){return(this.t>0?this.data[0]&1:this.s)==0}a(uks,"bnpIsEven");function dks(t,e){if(t>4294967295||t<1)return Wt.ONE;var r=tc(),n=tc(),o=e.convert(this),s=vat(t)-1;for(o.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,o,r);else{var c=r;r=n,n=c}return e.revert(r)}a(dks,"bnpExp");function fks(t,e){var r;return t<256||e.isEven()?r=new aX(e):r=new cX(e),this.exp(t,r)}a(fks,"bnModPowInt");Wt.prototype.copyTo=ORs;Wt.prototype.fromInt=LRs;Wt.prototype.fromString=BRs;Wt.prototype.clamp=FRs;Wt.prototype.dlShiftTo=GRs;Wt.prototype.drShiftTo=$Rs;Wt.prototype.lShiftTo=VRs;Wt.prototype.rShiftTo=WRs;Wt.prototype.subTo=zRs;Wt.prototype.multiplyTo=YRs;Wt.prototype.squareTo=KRs;Wt.prototype.divRemTo=JRs;Wt.prototype.invDigit=iks;Wt.prototype.isEven=uks;Wt.prototype.exp=dks;Wt.prototype.toString=URs;Wt.prototype.negate=QRs;Wt.prototype.abs=qRs;Wt.prototype.compareTo=jRs;Wt.prototype.bitLength=HRs;Wt.prototype.mod=ZRs;Wt.prototype.modPowInt=fks;Wt.ZERO=EH(0);Wt.ONE=EH(1);function pks(){var t=tc();return this.copyTo(t),t}a(pks,"bnClone");function hks(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}a(mks,"bnByteValue");function gks(){return this.t==0?this.s:this.data[0]<<16>>16}a(gks,"bnShortValue");function Aks(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(Aks,"bnpChunkSize");function yks(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a(yks,"bnSigNum");function _ks(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=EH(r),o=tc(),s=tc(),c="";for(this.divRemTo(n,o,s);o.signum()>0;)c=(r+s.intValue()).toString(t).substr(1)+c,o.divRemTo(n,o,s);return s.intValue().toString(t)+c}a(_ks,"bnpToRadix");function Eks(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),o=!1,s=0,c=0,l=0;l=r&&(this.dMultiply(n),this.dAddOffset(c,0),s=0,c=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(c,0)),o&&Wt.ZERO.subTo(this,this)}a(Eks,"bnpFromRadix");function vks(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(Wt.ONE.shiftLeft(t-1),zsr,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(Wt.ONE.shiftLeft(t-1),this);else{var n=new Array,o=t&7;n.length=(t>>3)+1,e.nextBytes(n),o>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[o++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),(n&128)!=0&&(n|=-256),o==0&&(this.s&128)!=(n&128)&&++o,(o>0||n!=this.s)&&(e[o++]=n);return e}a(Cks,"bnToByteArray");function bks(t){return this.compareTo(t)==0}a(bks,"bnEquals");function Sks(t){return this.compareTo(t)<0?this:t}a(Sks,"bnMin");function Tks(t){return this.compareTo(t)>0?this:t}a(Tks,"bnMax");function Iks(t,e,r){var n,o,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),(t&255)==0&&(t>>=8,e+=8),(t&15)==0&&(t>>=4,e+=4),(t&3)==0&&(t>>=2,e+=2),(t&1)==0&&++e,e}a(Oks,"lbit");function Lks(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}a(Gks,"bnpAddTo");function $ks(t){var e=tc();return this.addTo(t,e),e}a($ks,"bnAdd");function Vks(t){var e=tc();return this.subTo(t,e),e}a(Vks,"bnSubtract");function Wks(t){var e=tc();return this.multiplyTo(t,e),e}a(Wks,"bnMultiply");function zks(){var t=tc();return this.squareTo(t),t}a(zks,"bnSquare");function Yks(t){var e=tc();return this.divRemTo(t,e,null),e}a(Yks,"bnDivide");function Kks(t){var e=tc();return this.divRemTo(t,null,e),e}a(Kks,"bnRemainder");function Jks(t){var e=tc(),r=tc();return this.divRemTo(t,e,r),new Array(e,r)}a(Jks,"bnDivideAndRemainder");function Zks(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(Zks,"bnpDMultiply");function Xks(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}a(Xks,"bnpDAddOffset");function R2e(){}a(R2e,"NullExp");function Z7n(t){return t}a(Z7n,"nNop");function ePs(t,e,r){t.multiplyTo(e,r)}a(ePs,"nMulTo");function tPs(t,e){t.squareTo(e)}a(tPs,"nSqrTo");R2e.prototype.convert=Z7n;R2e.prototype.revert=Z7n;R2e.prototype.mulTo=ePs;R2e.prototype.sqrTo=tPs;function rPs(t){return this.exp(t,new R2e)}a(rPs,"bnPow");function nPs(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var o;for(o=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=tc();return t.copyTo(e),this.reduce(e),e}a(oPs,"barrettConvert");function sPs(t){return t}a(sPs,"barrettRevert");function aPs(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}a(aPs,"barrettReduce");function cPs(t,e){t.squareTo(e),this.reduce(e)}a(cPs,"barrettSqrTo");function lPs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(lPs,"barrettMulTo");ahe.prototype.convert=oPs;ahe.prototype.revert=sPs;ahe.prototype.reduce=aPs;ahe.prototype.mulTo=lPs;ahe.prototype.sqrTo=cPs;function uPs(t,e){var r=t.bitLength(),n,o=EH(1),s;if(r<=0)return o;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new aX(e):e.isEven()?s=new ahe(e):s=new cX(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=tc();for(s.sqrTo(c[1],f);l<=d;)c[l]=tc(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=tc(),y;for(r=vat(t.data[h])-1;h>=0;){for(r>=u?m=t.data[h]>>r-u&d:(m=(t.data[h]&(1<0&&(m|=t.data[h-1]>>this.DB+r-u)),l=n;(m&1)==0;)m>>=1,--l;if((r-=l)<0&&(r+=this.DB,--h),g)c[m].copyTo(o),g=!1;else{for(;l>1;)s.sqrTo(o,A),s.sqrTo(A,o),l-=2;l>0?s.sqrTo(o,A):(y=o,o=A,A=y),s.mulTo(A,c[m],o)}for(;h>=0&&(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}a(dPs,"bnGCD");function fPs(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}a(fPs,"bnpModInt");function pPs(t){if(this.signum()==0)return Wt.ZERO;var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return Wt.ZERO;for(var r=t.clone(),n=this.clone(),o=EH(1),s=EH(0),c=EH(0),l=EH(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!c.isEven()||!l.isEven())&&(c.addTo(this,c),l.subTo(t,l)),c.rShiftTo(1,c)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);r.compareTo(n)>=0?(r.subTo(n,r),e&&o.subTo(c,o),s.subTo(l,s)):(n.subTo(r,n),e&&c.subTo(o,c),l.subTo(s,l))}if(n.compareTo(Wt.ONE)!=0)return Wt.ZERO;if(l.compareTo(t)>=0)return l.subtract(t);if(l.signum()<0)l.addTo(t,l);else return l;return l.signum()<0?l.add(t):l}a(pPs,"bnModInverse");var Z2=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],hPs=(1<<26)/Z2[Z2.length-1];function mPs(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=Z2[Z2.length-1]){for(e=0;e=0);var l=s.modPow(n,this);if(l.compareTo(Wt.ONE)!=0&&l.compareTo(e)!=0){for(var u=1;u++{p();var s4=Cs();t4();Ac();var tQn=nQn.exports=s4.sha1=s4.sha1||{};s4.md.sha1=s4.md.algorithms.sha1=tQn;tQn.create=function(){rQn||yPs();var t=null,e=s4.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),eQn(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=s4.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(Ysr.substr(0,n.blockLength-c));for(var l,u,d=n.fullMessageLength[0]*8,f=0;f>>0,d+=u,o.putInt32(d>>>0),d=l>>>0;o.putInt32(d);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};eQn(h,r,o);var m=s4.util.createBuffer();return m.putInt32(h.h0),m.putInt32(h.h1),m.putInt32(h.h2),m.putInt32(h.h3),m.putInt32(h.h4),m},n};var Ysr=null,rQn=!1;function yPs(){Ysr="\x80",Ysr+=s4.util.fillString("\0",64),rQn=!0}a(yPs,"_init");function eQn(t,e,r){for(var n,o,s,c,l,u,d,f,h=r.length();h>=64;){for(o=t.h0,s=t.h1,c=t.h2,l=t.h3,u=t.h4,f=0;f<16;++f)n=r.getInt32(),e[f]=n,d=l^s&(c^l),n=(o<<5|o>>>27)+d+u+1518500249+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<20;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,d=l^s&(c^l),n=(o<<5|o>>>27)+d+u+1518500249+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<32;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+1859775393+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<40;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+1859775393+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<60;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s&c|l&(s^c),n=(o<<5|o>>>27)+d+u+2400959708+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<80;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+3395469782+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;t.h0=t.h0+o|0,t.h1=t.h1+s|0,t.h2=t.h2+c|0,t.h3=t.h3+l|0,t.h4=t.h4+u|0,h-=64}}a(eQn,"_update")});var Ksr=I((jgf,oQn)=>{p();var a4=Cs();Ac();Xw();che();var iQn=oQn.exports=a4.pkcs1=a4.pkcs1||{};iQn.encode_rsa_oaep=function(t,e,r){var n,o,s,c;typeof r=="string"?(n=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),s?s.start():s=a4.md.sha1.create(),c||(c=s);var l=Math.ceil(t.n.bitLength()/8),u=l-2*s.digestLength-2;if(e.length>u){var d=new Error("RSAES-OAEP input message length is too long.");throw d.length=e.length,d.maxLength=u,d}n||(n=""),s.update(n,"raw");for(var f=s.digest(),h="",m=u-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+c),n+=r.digest().getBytes()}return n.substring(0,e)}a(Cat,"rsa_mgf1")});var Zsr=I(($gf,Jsr)=>{p();var vH=Cs();Ac();k2e();Xw();(function(){if(vH.prime){Jsr.exports=vH.prime;return}var t=Jsr.exports=vH.prime=vH.prime||{},e=vH.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var o=a(function(h,m){return h|m},"op_or");t.generateProbablePrime=function(h,m,g){typeof m=="function"&&(g=m,m={}),m=m||{};var A=m.algorithm||"PRIMEINC";typeof A=="string"&&(A={name:A}),A.options=A.options||{};var y=m.prng||vH.random,_={nextBytes:a(function(E){for(var v=y.getBytesSync(E.length),S=0;Sm&&(h=d(m,g)),h.isProbablePrime(y))return E(null,h);h.dAddOffset(r[A++%8],0)}while(_<0||+new Date-v<_);vH.util.setImmediate(function(){l(h,m,g,A,y,_,E)})}a(l,"_primeinc");function u(h,m,g,A){if(typeof Worker>"u")return c(h,m,g,A);var y=d(h,m),_=g.workers,E=g.workLoad||100,v=E*30/8,S=g.workerScript||"forge/prime.worker.js";if(_===-1)return vH.util.estimateCores(function(w,R){w&&(R=2),_=R-1,T()});T();function T(){_=Math.max(1,_);for(var w=[],R=0;R<_;++R)w[R]=new Worker(S);for(var x=_,R=0;R<_;++R)w[R].addEventListener("message",D);var k=!1;function D(N){if(!k){--x;var O=N.data;if(O.found){for(var B=0;Bh&&(y=d(h,m));var q=y.toString(16);N.target.postMessage({hex:q,workLoad:E}),y.dAddOffset(v,0)}}a(D,"workerMessage")}a(T,"generate")}a(u,"primeincFindPrimeWithWorkers");function d(h,m){var g=new e(h,m),A=h-1;return g.testBit(A)||g.bitwiseTo(e.ONE.shiftLeft(A),o,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}a(d,"generateRandom");function f(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}a(f,"getMillerRabinTests")})()});var P2e=I((zgf,fQn)=>{p();var wi=Cs();J2();k2e();_H();Ksr();Zsr();Xw();Ac();typeof rc>"u"&&(rc=wi.jsbn.BigInteger);var rc,Xsr=wi.util.isNodejs?require("crypto"):null,ht=wi.asn1,tR=wi.util;wi.pki=wi.pki||{};fQn.exports=wi.pki.rsa=wi.rsa=wi.rsa||{};var $o=wi.pki,_Ps=[6,4,2,4,2,4,6,2],EPs={name:"PrivateKeyInfo",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},vPs={name:"RSAPrivateKey",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},CPs={name:"RSAPublicKey",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},bPs=wi.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:ht.Class.UNIVERSAL,type:ht.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},SPs={name:"DigestInfo",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:ht.Class.UNIVERSAL,type:ht.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},TPs=a(function(t){var e;if(t.algorithm in $o.oids)e=$o.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=ht.oidToDer(e).getBytes(),o=ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[]),s=ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[]);s.value.push(ht.create(ht.Class.UNIVERSAL,ht.Type.OID,!1,n)),s.value.push(ht.create(ht.Class.UNIVERSAL,ht.Type.NULL,!1,""));var c=ht.create(ht.Class.UNIVERSAL,ht.Type.OCTETSTRING,!1,t.digest().getBytes());return o.value.push(s),o.value.push(c),ht.toDer(o).getBytes()},"emsaPkcs1v15encode"),uQn=a(function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(rc.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(rc.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new rc(wi.util.bytesToHex(wi.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(rc.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var o=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);o.compareTo(s)<0;)o=o.add(e.p);var c=o.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return c=c.multiply(n.modInverse(e.n)).mod(e.n),c},"_modPow");$o.rsa.encrypt=function(t,e,r){var n=r,o,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,o=dQn(t,e,r)):(o=wi.util.createBuffer(),o.putBytes(t));for(var c=new rc(o.toHex(),16),l=uQn(c,e,n),u=l.toString(16),d=wi.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(wi.util.hexToBytes(u)),d.getBytes()};$o.rsa.decrypt=function(t,e,r,n){var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=o,s}var c=new rc(wi.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=uQn(c,e,r),u=l.toString(16),d=wi.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(wi.util.hexToBytes(u)),n!==!1?bat(d.getBytes(),e,r):d.getBytes()};$o.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||wi.random,o={nextBytes:a(function(l){for(var u=n.getBytesSync(l.length),d=0;d>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},c.e.fromInt(c.eInt);else throw new Error("Invalid key generation algorithm: "+s);return c};$o.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new rc(null);r.fromInt(30);for(var n=0,o=a(function(h,m){return h|m},"op_or"),s=+new Date,c,l=0;t.keys===null&&(e<=0||lu?t.pqState=0:t.num.isProbablePrime(xPs(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(_Ps[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(rc.ONE).gcd(t.e).compareTo(rc.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(rc.ONE),t.q1=t.q.subtract(rc.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(rc.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var f=t.e.modInverse(t.phi);t.keys={privateKey:$o.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:$o.rsa.setPublicKey(t.n,t.e)}}c=+new Date,l+=c-s,s=c}return t.keys!==null};$o.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!wi.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(sQn("generateKeyPair"))return Xsr.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(l,u,d){if(l)return n(l);n(null,{privateKey:$o.privateKeyFromPem(d),publicKey:$o.publicKeyFromPem(u)})});if(aQn("generateKey")&&aQn("exportKey"))return tR.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:lQn(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return tR.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=$o.privateKeyFromAsn1(ht.fromDer(wi.util.createBuffer(l)));n(null,{privateKey:u,publicKey:$o.setRsaPublicKey(u.n,u.e)})}});if(cQn("generateKey")&&cQn("exportKey")){var o=tR.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:lQn(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=tR.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=$o.privateKeyFromAsn1(ht.fromDer(wi.util.createBuffer(h)));n(null,{privateKey:m,publicKey:$o.setRsaPublicKey(m.n,m.e)})},d.onerror=function(f){n(f)}},o.onerror=function(l){n(l)};return}}else if(sQn("generateKeyPairSync")){var s=Xsr.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:$o.privateKeyFromPem(s.privateKey),publicKey:$o.publicKeyFromPem(s.publicKey)}}}var c=$o.rsa.createKeyPairGenerationState(t,e,r);if(!n)return $o.rsa.stepKeyPairGenerationState(c,0),c.keys;IPs(c,r,n)};$o.setRsaPublicKey=$o.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,o,s){if(typeof o=="string"?o=o.toUpperCase():o===void 0&&(o="RSAES-PKCS1-V1_5"),o==="RSAES-PKCS1-V1_5")o={encode:a(function(l,u,d){return dQn(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return wi.pkcs1.encode_rsa_oaep(u,l,s)},"encode")};else if(["RAW","NONE","NULL",null].indexOf(o)!==-1)o={encode:a(function(l){return l},"encode")};else if(typeof o=="string")throw new Error('Unsupported encryption scheme: "'+o+'".');var c=o.encode(n,r,!0);return $o.rsa.encrypt(c,r,!0)},r.verify=function(n,o,s,c){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),c===void 0&&(c={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in c||(c._parseAllDigestBytes=!0),"_skipPaddingChecks"in c||(c._skipPaddingChecks=!1),s==="RSASSA-PKCS1-V1_5"?s={verify:a(function(u,d){d=bat(d,r,!0,void 0,c);var f=ht.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!ht.validate(f,SPs,h,m)||f.value.length!==2){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=m,g}var A=ht.derToOid(h.algorithmIdentifier);if(!(A===wi.oids.md2||A===wi.oids.md5||A===wi.oids.sha1||A===wi.oids.sha224||A===wi.oids.sha256||A===wi.oids.sha384||A===wi.oids.sha512||A===wi.oids["sha512-224"]||A===wi.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===wi.oids.md2||A===wi.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return u===h.digest},"verify")}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:a(function(u,d){return d=bat(d,r,!0,void 0,c),u===d},"verify")});var l=$o.rsa.decrypt(o,r,!0,!1);return s.verify(n,l,r.n.bitLength())},r};$o.setRsaPrivateKey=$o.rsa.setPrivateKey=function(t,e,r,n,o,s,c,l){var u={n:t,e,d:r,p:n,q:o,dP:s,dQ:c,qInv:l};return u.decrypt=function(d,f,h){typeof f=="string"?f=f.toUpperCase():f===void 0&&(f="RSAES-PKCS1-V1_5");var m=$o.rsa.decrypt(d,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:bat};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return wi.pkcs1.decode_rsa_oaep(A,g,h)},"decode")};else if(["RAW","NONE","NULL",null].indexOf(f)!==-1)f={decode:a(function(g){return g},"decode")};else throw new Error('Unsupported encryption scheme: "'+f+'".');return f.decode(m,u,!1)},u.sign=function(d,f){var h=!1;typeof f=="string"&&(f=f.toUpperCase()),f===void 0||f==="RSASSA-PKCS1-V1_5"?(f={encode:TPs},h=1):(f==="NONE"||f==="NULL"||f===null)&&(f={encode:a(function(){return d},"encode")},h=1);var m=f.encode(d,u.n.bitLength());return $o.rsa.encrypt(m,u,h)},u};$o.wrapRsaPrivateKey=function(t){return ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,ht.integerToDer(0).getBytes()),ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.OID,!1,ht.oidToDer($o.oids.rsaEncryption).getBytes()),ht.create(ht.Class.UNIVERSAL,ht.Type.NULL,!1,"")]),ht.create(ht.Class.UNIVERSAL,ht.Type.OCTETSTRING,!1,ht.toDer(t).getBytes())])};$o.privateKeyFromAsn1=function(t){var e={},r=[];if(ht.validate(t,EPs,e,r)&&(t=ht.fromDer(wi.util.createBuffer(e.privateKey))),e={},r=[],!ht.validate(t,vPs,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var o,s,c,l,u,d,f,h;return o=wi.util.createBuffer(e.privateKeyModulus).toHex(),s=wi.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=wi.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=wi.util.createBuffer(e.privateKeyPrime1).toHex(),u=wi.util.createBuffer(e.privateKeyPrime2).toHex(),d=wi.util.createBuffer(e.privateKeyExponent1).toHex(),f=wi.util.createBuffer(e.privateKeyExponent2).toHex(),h=wi.util.createBuffer(e.privateKeyCoefficient).toHex(),$o.setRsaPrivateKey(new rc(o,16),new rc(s,16),new rc(c,16),new rc(l,16),new rc(u,16),new rc(d,16),new rc(f,16),new rc(h,16))};$o.privateKeyToAsn1=$o.privateKeyToRSAPrivateKey=function(t){return ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,ht.integerToDer(0).getBytes()),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.n)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.e)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.d)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.p)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.q)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.dP)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.dQ)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.qInv))])};$o.publicKeyFromAsn1=function(t){var e={},r=[];if(ht.validate(t,bPs,e,r)){var n=ht.derToOid(e.publicKeyOid);if(n!==$o.oids.rsaEncryption){var o=new Error("Cannot read public key. Unknown OID.");throw o.oid=n,o}t=e.rsaPublicKey}if(r=[],!ht.validate(t,CPs,e,r)){var o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw o.errors=r,o}var s=wi.util.createBuffer(e.publicKeyModulus).toHex(),c=wi.util.createBuffer(e.publicKeyExponent).toHex();return $o.setRsaPublicKey(new rc(s,16),new rc(c,16))};$o.publicKeyToAsn1=$o.publicKeyToSubjectPublicKeyInfo=function(t){return ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.OID,!1,ht.oidToDer($o.oids.rsaEncryption).getBytes()),ht.create(ht.Class.UNIVERSAL,ht.Type.NULL,!1,"")]),ht.create(ht.Class.UNIVERSAL,ht.Type.BITSTRING,!1,[$o.publicKeyToRSAPublicKey(t)])])};$o.publicKeyToRSAPublicKey=function(t){return ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.n)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,c4(t.e))])};function dQn(t,e,r){var n=wi.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=o-11,s}n.putByte(0),n.putByte(r);var c=o-3-t.length,l;if(r===0||r===1){l=r===0?0:255;for(var u=0;u0;){for(var d=0,f=wi.random.getBytes(c),u=0;u"u")throw new Error("Encryption block is invalid.");var d=0;if(u===0){d=s-3-n;for(var f=0;f1;){if(c.getByte()!==255){--c.read;break}++d}if(d<8&&!(o&&o._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(u===2){for(d=0;c.length()>1;){if(c.getByte()===0){--c.read;break}++d}if(d<8&&!(o&&o._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var h=c.getByte();if(h!==0||d!==s-3-c.length())throw new Error("Encryption block is invalid.");return c.getBytes()}a(bat,"_decodePkcs1_v1_5");function IPs(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),o();function o(){s(t.pBits,function(l,u){if(l)return r(l);if(t.p=u,t.q!==null)return c(l,t.q);s(t.qBits,c)})}a(o,"generate");function s(l,u){wi.prime.generateProbablePrime(l,n,u)}a(s,"getPrime");function c(l,u){if(l)return r(l);if(t.q=u,t.p.compareTo(t.q)<0){var d=t.p;t.p=t.q,t.q=d}if(t.p.subtract(rc.ONE).gcd(t.e).compareTo(rc.ONE)!==0){t.p=null,o();return}if(t.q.subtract(rc.ONE).gcd(t.e).compareTo(rc.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract(rc.ONE),t.q1=t.q.subtract(rc.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(rc.ONE)!==0){t.p=t.q=null,o();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,c);return}var f=t.e.modInverse(t.phi);t.keys={privateKey:$o.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:$o.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}a(c,"finish")}a(IPs,"_generateKeyPair");function c4(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=wi.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&(r.charCodeAt(1)&128)===0||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}a(c4,"_bnToBytes");function xPs(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}a(xPs,"_getMillerRabinTests");function sQn(t){return wi.util.isNodejs&&typeof Xsr[t]=="function"}a(sQn,"_detectNodeCrypto");function aQn(t){return typeof tR.globalScope<"u"&&typeof tR.globalScope.crypto=="object"&&typeof tR.globalScope.crypto.subtle=="object"&&typeof tR.globalScope.crypto.subtle[t]=="function"}a(aQn,"_detectSubtleCrypto");function cQn(t){return typeof tR.globalScope<"u"&&typeof tR.globalScope.msCrypto=="object"&&typeof tR.globalScope.msCrypto.subtle=="object"&&typeof tR.globalScope.msCrypto.subtle[t]=="function"}a(cQn,"_detectSubtleMsCrypto");function lQn(t){for(var e=wi.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var Cn=Cs();yH();J2();w2e();t4();_H();yat();sX();Xw();$sr();P2e();Ac();typeof pQn>"u"&&(pQn=Cn.jsbn.BigInteger);var pQn,Mt=Cn.asn1,ps=Cn.pki=Cn.pki||{};AQn.exports=ps.pbe=Cn.pbe=Cn.pbe||{};var lX=ps.oids,wPs={name:"EncryptedPrivateKeyInfo",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},RPs={name:"PBES2Algorithms",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},kPs={name:"pkcs-12PbeParams",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.INTEGER,constructed:!1,capture:"iterations"}]};ps.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=Cn.random.getBytesSync(r.saltSize),o=r.count,s=Mt.integerToDer(o),c,l,u;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var d,f,h;switch(r.algorithm){case"aes128":c=16,d=16,f=lX["aes128-CBC"],h=Cn.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=lX["aes192-CBC"],h=Cn.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=lX["aes256-CBC"],h=Cn.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=lX.desCBC,h=Cn.des.createEncryptionCipher;break;default:var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),A=gQn(g),y=Cn.pkcs5.pbkdf2(e,n,o,c,A),_=Cn.random.getBytesSync(d),E=h(y);E.start(_),E.update(Mt.toDer(t)),E.finish(),u=E.output.getBytes();var v=PPs(n,s,c,g);l=Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OID,!1,Mt.oidToDer(lX.pkcs5PBES2).getBytes()),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OID,!1,Mt.oidToDer(lX.pkcs5PBKDF2).getBytes()),v]),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OID,!1,Mt.oidToDer(f).getBytes()),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OCTETSTRING,!1,_)])])])}else if(r.algorithm==="3des"){c=24;var S=new Cn.util.ByteBuffer(n),y=ps.pbe.generatePkcs12Key(e,S,1,o,c),_=ps.pbe.generatePkcs12Key(e,S,2,o,c),E=Cn.des.createEncryptionCipher(y);E.start(_),E.update(Mt.toDer(t)),E.finish(),u=E.output.getBytes(),l=Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OID,!1,Mt.oidToDer(lX["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OCTETSTRING,!1,n),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.INTEGER,!1,s.getBytes())])])}else{var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var T=Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[l,Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OCTETSTRING,!1,u)]);return T};ps.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Mt.validate(t,wPs,n,o)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=Mt.derToOid(n.encryptionOid),l=ps.pbe.getCipher(c,n.encryptionParams,e),u=Cn.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Mt.fromDer(l.output)),r};ps.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Mt.toDer(t).getBytes()};return Cn.pem.encode(r,{maxline:e})};ps.encryptedPrivateKeyFromPem=function(t){var e=Cn.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return Mt.fromDer(e.body)};ps.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=ps.wrapRsaPrivateKey(ps.privateKeyToAsn1(t));return n=ps.encryptPrivateKeyInfo(n,e,r),ps.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=Cn.random.getBytesSync(16),l=Cn.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=Cn.random.getBytesSync(16),l=Cn.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=Cn.random.getBytesSync(16),l=Cn.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=Cn.random.getBytesSync(8),l=Cn.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=Cn.random.getBytesSync(8),l=Cn.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw u.algorithm=r.algorithm,u}var d=Cn.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Mt.toDer(ps.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:Cn.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return Cn.pem.encode(h)};ps.decryptRsaPrivateKey=function(t,e){var r=null,n=Cn.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var o=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw o.headerType=o,o}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,c;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,c=Cn.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=Cn.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=Cn.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=Cn.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=Cn.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return Cn.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return Cn.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return Cn.rc2.createDecryptionCipher(h,128)},"cipherFn");break;default:var o=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw o.algorithm=n.dekInfo.algorithm,o}var l=Cn.util.hexToBytes(n.dekInfo.parameters),u=Cn.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(Cn.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=ps.decryptPrivateKeyInfo(Mt.fromDer(r),e):r=Mt.fromDer(r),r!==null&&(r=ps.privateKeyFromAsn1(r)),r};ps.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in Cn.md))throw new Error('"sha1" hash algorithm unavailable.');s=Cn.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new Cn.util.ByteBuffer,h=new Cn.util.ByteBuffer;if(t!=null){for(l=0;l=0;l--)B=B>>8,B+=k.at(l)+O.at(l),O.setAt(l,B&255);N.putBuffer(O)}S=N,f.putBuffer(R)}return f.truncate(f.length()-o),f};ps.pbe.getCipher=function(t,e,r){switch(t){case ps.oids.pkcs5PBES2:return ps.pbe.getCipherForPBES2(t,e,r);case ps.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case ps.oids["pbewithSHAAnd40BitRC2-CBC"]:return ps.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};ps.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Mt.validate(e,RPs,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}if(t=Mt.derToOid(n.kdfOid),t!==ps.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=Mt.derToOid(n.encOid),t!==ps.oids["aes128-CBC"]&&t!==ps.oids["aes192-CBC"]&&t!==ps.oids["aes256-CBC"]&&t!==ps.oids["des-EDE3-CBC"]&&t!==ps.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var c=n.kdfSalt,l=Cn.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(ps.oids[t]){case"aes128-CBC":u=16,d=Cn.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=Cn.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=Cn.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=Cn.des.createDecryptionCipher;break;case"desCBC":u=8,d=Cn.des.createDecryptionCipher;break}var f=mQn(n.prfOid),h=Cn.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};ps.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Mt.validate(e,kPs,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=Cn.util.createBuffer(n.salt),l=Cn.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case ps.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=Cn.des.startDecrypting;break;case ps.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,_){var E=Cn.rc2.createDecryptionCipher(y,40);return E.start(_,null),E},"cipherFn");break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=mQn(n.prfOid),m=ps.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=ps.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};ps.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in Cn.md))throw new Error('"md5" hash algorithm unavailable.');n=Cn.md.md5.create()}e===null&&(e="");for(var o=[hQn(n,t+e)],s=16,c=1;s{p();var lhe=Cs();J2();Ac();var gn=lhe.asn1,uhe=EQn.exports=lhe.pkcs7asn1=lhe.pkcs7asn1||{};lhe.pkcs7=lhe.pkcs7||{};lhe.pkcs7.asn1=uhe;var yQn={name:"ContentInfo",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:gn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};uhe.contentInfoValidator=yQn;var _Qn={name:"EncryptedContentInfo",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:gn.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:gn.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};uhe.envelopedDataValidator={name:"EnvelopedData",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(_Qn)};uhe.encryptedDataValidator={name:"EncryptedData",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1,capture:"version"}].concat(_Qn)};var DPs={name:"SignerInfo",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:gn.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:gn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:gn.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};uhe.signedDataValidator={name:"SignedData",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},yQn,{name:"SignedData.Certificates",tagClass:gn.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:gn.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SET,capture:"signerInfos",optional:!0,value:[DPs]}]};uhe.recipientInfoValidator={name:"RecipientInfo",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:gn.Class.UNIVERSAL,type:gn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:gn.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:gn.Class.UNIVERSAL,type:gn.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var rar=I((r0f,vQn)=>{p();var uX=Cs();Ac();uX.mgf=uX.mgf||{};var NPs=vQn.exports=uX.mgf.mgf1=uX.mgf1=uX.mgf1||{};NPs.create=function(t){var e={generate:a(function(r,n){for(var o=new uX.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var Sat=Cs();rar();CQn.exports=Sat.mgf=Sat.mgf||{};Sat.mgf.mgf1=Sat.mgf1});var Tat=I((a0f,SQn)=>{p();var dX=Cs();Xw();Ac();var MPs=SQn.exports=dX.pss=dX.pss||{};MPs.create=function(t){arguments.length===3&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e=t.md,r=t.mgf,n=e.digestLength,o=t.salt||null;typeof o=="string"&&(o=dX.util.createBuffer(o));var s;if("saltLength"in t)s=t.saltLength;else if(o!==null)s=o.length();else throw new Error("Salt length not specified or specific salt not given.");if(o!==null&&o.length()!==s)throw new Error("Given salt length does not match length of given salt.");var c=t.prng||dX.random,l={};return l.encode=function(u,d){var f,h=d-1,m=Math.ceil(h/8),g=u.digest().getBytes();if(m>8*m-h&255;return w=String.fromCharCode(w.charCodeAt(0)&~R)+w.substr(1),w+_+"\xBC"},l.verify=function(u,d,f){var h,m=f-1,g=Math.ceil(m/8);if(d=d.substr(-g),g>8*g-m&255;if((y.charCodeAt(0)&E)!==0)throw new Error("Bits beyond keysize not zero as expected.");var v=r.generate(_,A),S="";for(h=0;h{p();var Ri=Cs();yH();J2();w2e();t4();bQn();_H();sX();Tat();P2e();Ac();var Ae=Ri.asn1,Br=RQn.exports=Ri.pki=Ri.pki||{},nc=Br.oids,Cp={};Cp.CN=nc.commonName;Cp.commonName="CN";Cp.C=nc.countryName;Cp.countryName="C";Cp.L=nc.localityName;Cp.localityName="L";Cp.ST=nc.stateOrProvinceName;Cp.stateOrProvinceName="ST";Cp.O=nc.organizationName;Cp.organizationName="O";Cp.OU=nc.organizationalUnitName;Cp.organizationalUnitName="OU";Cp.E=nc.emailAddress;Cp.emailAddress="E";var IQn=Ri.pki.rsa.publicKeyValidator,OPs={name:"Certificate",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},IQn,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},LPs={name:"rsapss",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},BPs={name:"CertificationRequestInfo",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},IQn,{name:"CertificationRequestInfo.attributes",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SET,constructed:!0}]}]}]},FPs={name:"CertificationRequest",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[BPs,{name:"CertificationRequest.signatureAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};Br.RDNAttributesAsArray=function(t,e){for(var r=[],n,o,s,c=0;c2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(u.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=u[0],c.validity.notAfter=u[1],c.tbsCertificate=r.tbsCertificate,e){c.md=xat({signatureOid:c.signatureOid,type:"certificate"});var d=Ae.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=Ri.md.sha1.create(),h=Ae.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return CH(c.issuer,A)},c.issuer.addField=function(A){rR([A]),c.issuer.attributes.push(A)},c.issuer.attributes=Br.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=f.digest().toHex();var m=Ri.md.sha1.create(),g=Ae.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return CH(c.subject,A)},c.subject.addField=function(A){rR([A]),c.subject.attributes.push(A)},c.subject.attributes=Br.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=Br.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=Br.publicKeyFromAsn1(r.subjectPublicKeyInfo),c};Br.certificateExtensionsFromAsn1=function(t){for(var e=[],r=0;r1&&(n=r.value.charCodeAt(1),o=r.value.length>2?r.value.charCodeAt(2):0),e.digitalSignature=(n&128)===128,e.nonRepudiation=(n&64)===64,e.keyEncipherment=(n&32)===32,e.dataEncipherment=(n&16)===16,e.keyAgreement=(n&8)===8,e.keyCertSign=(n&4)===4,e.cRLSign=(n&2)===2,e.encipherOnly=(n&1)===1,e.decipherOnly=(o&128)===128}else if(e.name==="basicConstraints"){var r=Ae.fromDer(e.value);r.value.length>0&&r.value[0].type===Ae.Type.BOOLEAN?e.cA=r.value[0].value.charCodeAt(0)!==0:e.cA=!1;var s=null;r.value.length>0&&r.value[0].type===Ae.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(e.pathLenConstraint=Ae.derToInteger(s))}else if(e.name==="extKeyUsage")for(var r=Ae.fromDer(e.value),c=0;c1&&(n=r.value.charCodeAt(1)),e.client=(n&128)===128,e.server=(n&64)===64,e.email=(n&32)===32,e.objsign=(n&16)===16,e.reserved=(n&8)===8,e.sslCA=(n&4)===4,e.emailCA=(n&2)===2,e.objCA=(n&1)===1}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.altNames=[];for(var u,r=Ae.fromDer(e.value),d=0;d"u"&&(e.type&&e.type in Br.oids?e.name=Br.oids[e.type]:e.shortName&&e.shortName in Cp&&(e.name=Br.oids[Cp[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in Br.oids)e.type=Br.oids[e.name];else{var n=new Error("Attribute type not specified.");throw n.attribute=e,n}if(typeof e.shortName>"u"&&e.name&&e.name in Cp&&(e.shortName=Cp[e.name]),e.type===nc.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=Ae.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var o=0;o"u"){var n=new Error("Attribute value not specified.");throw n.attribute=e,n}}}a(rR,"_fillMissingFields");function wQn(t,e){if(e=e||{},typeof t.name>"u"&&t.id&&t.id in Br.oids&&(t.name=Br.oids[t.id]),typeof t.id>"u")if(t.name&&t.name in Br.oids)t.id=Br.oids[t.name];else{var r=new Error("Extension ID not specified.");throw r.extension=t,r}if(typeof t.value<"u")return t;if(t.name==="keyUsage"){var n=0,o=0,s=0;t.digitalSignature&&(o|=128,n=7),t.nonRepudiation&&(o|=64,n=6),t.keyEncipherment&&(o|=32,n=5),t.dataEncipherment&&(o|=16,n=4),t.keyAgreement&&(o|=8,n=3),t.keyCertSign&&(o|=4,n=2),t.cRLSign&&(o|=2,n=1),t.encipherOnly&&(o|=1,n=0),t.decipherOnly&&(s|=128,n=7);var c=String.fromCharCode(n);s!==0?c+=String.fromCharCode(o)+String.fromCharCode(s):o!==0&&(c+=String.fromCharCode(o)),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,c)}else if(t.name==="basicConstraints")t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in t&&t.value.value.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(t.pathLenConstraint).getBytes()));else if(t.name==="extKeyUsage"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);var l=t.value.value;for(var u in t)t[u]===!0&&(u in nc?l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(nc[u]).getBytes())):u.indexOf(".")!==-1&&l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(u).getBytes())))}else if(t.name==="nsCertType"){var n=0,o=0;t.client&&(o|=128,n=7),t.server&&(o|=64,n=6),t.email&&(o|=32,n=5),t.objsign&&(o|=16,n=4),t.reserved&&(o|=8,n=3),t.sslCA&&(o|=4,n=2),t.emailCA&&(o|=2,n=1),t.objCA&&(o|=1,n=0);var c=String.fromCharCode(n);o!==0&&(c+=String.fromCharCode(o)),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,c)}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);for(var d,f=0;f128)throw new Error('Invalid "nsComment" content.');t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.IA5STRING,!1,t.comment)}else if(t.name==="subjectKeyIdentifier"&&e.cert){var h=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=h.toHex(),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OCTETSTRING,!1,h.getBytes())}else if(t.name==="authorityKeyIdentifier"&&e.cert){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);var l=t.value.value;if(t.keyIdentifier){var m=t.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!1,m))}if(t.authorityCertIssuer){var g=[Ae.create(Ae.Class.CONTEXT_SPECIFIC,4,!0,[dhe(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=Ri.util.hexToBytes(t.serialNumber===!0?e.cert.serialNumber:t.serialNumber);l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,2,!1,A))}}else if(t.name==="cRLDistributionPoints"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);for(var l=t.value.value,y=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]),_=Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[]),d,f=0;f"u"){var r=new Error("Extension value not specified.");throw r.extension=t,r}return t}a(wQn,"_fillMissingExtensionFields");function nar(t,e){if(t===nc["RSASSA-PSS"]){var r=[];return e.hash.algorithmOid!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.hash.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.mgf.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.mgf.hash.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,2,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(e.saltLength).getBytes())])),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,r)}else return Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")}a(nar,"_signatureParametersToAsn1");function UPs(t){var e=Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[]);if(t.attributes.length===0)return e;for(var r=t.attributes,n=0;n=QPs&&t0&&n.value.push(Br.certificateExtensionsToAsn1(t.extensions)),n};Br.getCertificationRequestInfo=function(t){var e=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(t.version).getBytes()),dhe(t.subject),Br.publicKeyToAsn1(t.publicKey),UPs(t)]);return e};Br.distinguishedNameToAsn1=function(t){return dhe(t)};Br.certificateToAsn1=function(t){var e=t.tbsCertificate||Br.getTBSCertificate(t);return Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[e,Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(t.signatureOid).getBytes()),nar(t.signatureOid,t.signatureParameters)]),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,"\0"+t.signature)])};Br.certificateExtensionsToAsn1=function(t){var e=Ae.create(Ae.Class.CONTEXT_SPECIFIC,3,!0,[]),r=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);e.value.push(r);for(var n=0;n"u"&&(o=new Date);var s=!0,c=null,l=0;do{var u=e.shift(),d=null,f=!1;if(o&&(ou.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:Br.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:o}),c===null){if(d=e[0]||t.getIssuer(u),d===null&&u.isIssuer(u)&&(f=!0,d=u),d){var h=d;Ri.util.isArray(h)||(h=[h]);for(var m=!1;!m&&h.length>0;){d=h.shift();try{m=d.verify(u)}catch{}}m||(c={message:"Certificate signature is invalid.",error:Br.certificateError.bad_certificate})}c===null&&(!d||f)&&!t.hasCertificate(u)&&(c={message:"Certificate is not trusted.",error:Br.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:"Certificate issuer is invalid.",error:Br.certificateError.bad_certificate}),c===null)for(var g={keyUsage:!0,basicConstraints:!0},A=0;c===null&&A_.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:Br.certificateError.bad_certificate})}}var S=c===null?!0:c.error,T=r.verify?r.verify(S,l,n):S;if(T===!0)c=null;else throw S===!0&&(c={message:"The application rejected the certificate.",error:Br.certificateError.bad_certificate}),(T||T===0)&&(typeof T=="object"&&!Ri.util.isArray(T)?(T.message&&(c.message=T.message),T.error&&(c.error=T.error)):typeof T=="string"&&(c.error=T)),c;s=!1,++l}while(e.length>0);return!0}});var oar=I((f0f,PQn)=>{p();var Bu=Cs();J2();ihe();_H();tar();ear();Xw();P2e();che();Ac();wat();var Je=Bu.asn1,oa=Bu.pki,N2e=PQn.exports=Bu.pkcs12=Bu.pkcs12||{},kQn={name:"ContentInfo",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Je.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},jPs={name:"PFX",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Je.Class.UNIVERSAL,type:Je.Type.INTEGER,constructed:!1,capture:"version"},kQn,{name:"PFX.macData",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Je.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Je.Class.UNIVERSAL,type:Je.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},HPs={name:"SafeBag",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Je.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},GPs={name:"Attribute",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SET,constructed:!0,capture:"values"}]},$Ps={name:"CertBag",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Je.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Je.Class.UNIVERSAL,type:Je.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function D2e(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(D2e,"_getBagsByAttribute");N2e.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Je.validate(t,jPs,n,o)){var s=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw s.errors=s,s}var c={version:n.version.charCodeAt(0),safeContents:[],getBags:a(function(_){var E={},v;return"localKeyId"in _?v=_.localKeyId:"localKeyIdHex"in _&&(v=Bu.util.hexToBytes(_.localKeyIdHex)),v===void 0&&!("friendlyName"in _)&&"bagType"in _&&(E[_.bagType]=D2e(c.safeContents,null,null,_.bagType)),v!==void 0&&(E.localKeyId=D2e(c.safeContents,"localKeyId",v,_.bagType)),"friendlyName"in _&&(E.friendlyName=D2e(c.safeContents,"friendlyName",_.friendlyName,_.bagType)),E},"getBags"),getBagsByFriendlyName:a(function(_,E){return D2e(c.safeContents,"friendlyName",_,E)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(_,E){return D2e(c.safeContents,"localKeyId",_,E)},"getBagsByLocalKeyId")};if(n.version.charCodeAt(0)!==3){var s=new Error("PKCS#12 PFX of version other than 3 not supported.");throw s.version=n.version.charCodeAt(0),s}if(Je.derToOid(n.contentType)!==oa.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Je.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Je.Class.UNIVERSAL||l.type!==Je.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=iar(l),n.mac){var u=null,d=0,f=Je.derToOid(n.macAlgorithm);switch(f){case oa.oids.sha1:u=Bu.md.sha1.create(),d=20;break;case oa.oids.sha256:u=Bu.md.sha256.create(),d=32;break;case oa.oids.sha384:u=Bu.md.sha384.create(),d=48;break;case oa.oids.sha512:u=Bu.md.sha512.create(),d=64;break;case oa.oids.md5:u=Bu.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new Bu.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(Bu.util.bytesToHex(n.macIterations),16):1,g=N2e.generateKey(r,h,3,m,d,u),A=Bu.hmac.create();A.start(u,g),A.update(l.value);var y=A.getMac();if(y.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(t.value)&&t.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return VPs(c,l.value,e,r),c};function iar(t){if(t.composed||t.constructed){for(var e=Bu.util.createBuffer(),r=0;r0&&(s=Je.create(Je.Class.UNIVERSAL,Je.Type.SET,!0,u));var d=[],f=[];e!==null&&(Bu.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var _=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,h),E=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(oa.oids.data).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,Je.toDer(_).getBytes())])]);d.push(E)}var v=null;if(t!==null){var S=oa.wrapRsaPrivateKey(oa.privateKeyToAsn1(t));r===null?v=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(oa.oids.keyBag).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[S]),s]):v=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(oa.oids.pkcs8ShroudedKeyBag).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[oa.encryptPrivateKeyInfo(S,r,n)]),s]);var T=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[v]),w=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(oa.oids.data).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,Je.toDer(T).getBytes())])]);d.push(w)}var R=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=Bu.md.sha1.create(),k=new Bu.util.ByteBuffer(Bu.random.getBytes(n.saltSize)),D=n.count,t=N2e.generateKey(r,k,3,D,20),N=Bu.hmac.create();N.start(l,t),N.update(Je.toDer(R).getBytes());var O=N.getMac();x=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(oa.oids.sha1).getBytes()),Je.create(Je.Class.UNIVERSAL,Je.Type.NULL,!1,"")]),Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,O.getBytes())]),Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,k.getBytes()),Je.create(Je.Class.UNIVERSAL,Je.Type.INTEGER,!1,Je.integerToDer(D).getBytes())])}return Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.INTEGER,!1,Je.integerToDer(3).getBytes()),Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(oa.oids.data).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,Je.toDer(R).getBytes())])]),x])};N2e.generateKey=Bu.pbe.generatePkcs12Key});var aar=I((m0f,DQn)=>{p();var bH=Cs();J2();_H();ear();sX();yat();oar();Tat();P2e();Ac();wat();var sar=bH.asn1,fhe=DQn.exports=bH.pki=bH.pki||{};fhe.pemToDer=function(t){var e=bH.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return bH.util.createBuffer(e.body)};fhe.privateKeyFromPem=function(t){var e=bH.pem.decode(t)[0];if(e.type!=="PRIVATE KEY"&&e.type!=="RSA PRIVATE KEY"){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var n=sar.fromDer(e.body);return fhe.privateKeyFromAsn1(n)};fhe.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:sar.toDer(fhe.privateKeyToAsn1(t)).getBytes()};return bH.pem.encode(r,{maxline:e})};fhe.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:sar.toDer(t).getBytes()};return bH.pem.encode(r,{maxline:e})}});var par=I((A0f,QQn)=>{p();var Kt=Cs();J2();ihe();hat();sX();aar();Xw();che();Ac();var Dat=a(function(t,e,r,n){var o=Kt.util.createBuffer(),s=t.length>>1,c=s+(t.length&1),l=t.substr(0,c),u=t.substr(s,c),d=Kt.util.createBuffer(),f=Kt.hmac.create();r=e+r;var h=Math.ceil(n/16),m=Math.ceil(n/20);f.start("MD5",l);var g=Kt.util.createBuffer();d.putBytes(r);for(var A=0;A0&&(Ee.queue(t,Ee.createAlert(t,{level:Ee.Alert.Level.warning,description:Ee.Alert.Description.no_renegotiation})),Ee.flush(t)),t.process()};Ee.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===Ee.ConnectionEnd.client;if(r<38)t.error(t,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});else{var s=e.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:Kt.util.createBuffer(s.getBytes(32)),session_id:jT(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=jT(s,2),n.compression_methods=jT(s,1)),c=r-(c-s.length()),c>0){for(var l=jT(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:jT(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(jT(f,2).getBytes())}}}if(t.session.version&&(n.version.major!==t.session.version.major||n.version.minor!==t.session.version.minor))return t.error(t,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=Ee.getCipherSuite(n.cipher_suite);else for(var m=Kt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=Ee.getCipherSuite(m.getBytes(2)),t.session.cipherSuite===null););if(t.session.cipherSuite===null)return t.error(t,{message:"No cipher suites in common.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.handshake_failure},cipherSuite:Kt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=Ee.CompressionMethod.none}return n};Ee.createSecurityParameters=function(t,e){var r=t.entity===Ee.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:Ee.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:Ee.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:t.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:o,server_random:s}};Ee.handleServerHello=function(t,e,r){var n=Ee.parseHelloMessage(t,e,r);if(!t.fail){if(n.version.minor<=t.version.minor)t.version.minor=n.version.minor;else return t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=OQn,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=e2s,t.session.resuming=!1,Ee.createSecurityParameters(t,n)),t.session.id=o,t.process()}};Ee.handleClientHello=function(t,e,r){var n=Ee.parseHelloMessage(t,e,r);if(!t.fail){var o=n.session_id.bytes(),s=null;if(t.sessionCache&&(s=t.sessionCache.getSession(o),s===null?o="":(s.version.major!==n.version.major||s.version.minor>n.version.minor)&&(s=null,o="")),o.length===0&&(o=Kt.random.getBytes(32)),t.session.id=o,t.session.clientHelloVersion=n.version,t.session.sp={},s)t.version=t.session.version=s.version,t.session.sp=s.sp;else{for(var c,l=1;l0;)s=jT(o.certificate_list,3),c=Kt.asn1.fromDer(s),s=Kt.pki.certificateFromAsn1(c,!0),l.push(s)}catch(d){return t.error(t,{message:"Could not parse certificate list.",cause:d,send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.bad_certificate}})}var u=t.entity===Ee.ConnectionEnd.client;(u||t.verifyClient===!0)&&l.length===0?t.error(t,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?NQn:uar:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],Ee.verifyCertificateChain(t,l)&&(t.expect=u?NQn:uar)),t.process()};Ee.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.unsupported_certificate}});t.expect=t2s,t.process()};Ee.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:jT(n,2).getBytes()},s=null;if(t.getPrivateKey)try{s=t.getPrivateKey(t,t.session.serverCertificate),s=Kt.pki.privateKeyFromPem(s)}catch(u){t.error(t,{message:"Could not get private key.",cause:u,send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}});try{var c=t.session.sp;c.pre_master_secret=s.decrypt(o.enc_pre_master_secret);var l=t.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{c.pre_master_secret=Kt.random.getBytes(48)}t.expect=dar,t.session.clientCertificate!==null&&(t.expect=c2s),t.process()};Ee.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:jT(n,1),certificate_authorities:jT(n,2)};t.session.certificateRequest=o,t.expect=r2s,t.process()};Ee.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:jT(n,2).getBytes()},c=Kt.util.createBuffer();c.putBuffer(t.session.md5.digest()),c.putBuffer(t.session.sha1.digest()),c=c.getBytes();try{var l=t.session.clientCertificate;if(!l.publicKey.verify(c,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");t.session.md5.update(o),t.session.sha1.update(o)}catch{return t.error(t,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.handshake_failure}})}t.expect=dar,t.process()};Ee.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.insufficient_security}},o=0,s=t.verify(t,n.alert.description,o,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!Kt.util.isArray(s)?(s.message&&(n.message=s.message),s.alert&&(n.alert.description=s.alert)):typeof s=="number"&&(n.alert.description=s)),t.error(t,n)}t.session.certificateRequest!==null&&(e=Ee.createRecord(t,{type:Ee.ContentType.handshake,data:Ee.createCertificate(t)}),Ee.queue(t,e)),e=Ee.createRecord(t,{type:Ee.ContentType.handshake,data:Ee.createClientKeyExchange(t)}),Ee.queue(t,e),t.expect=o2s;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&Ee.queue(l,Ee.createRecord(l,{type:Ee.ContentType.handshake,data:Ee.createCertificateVerify(l,u)})),Ee.queue(l,Ee.createRecord(l,{type:Ee.ContentType.change_cipher_spec,data:Ee.createChangeCipherSpec()})),l.state.pending=Ee.createConnectionState(l),l.state.current.write=l.state.pending.write,Ee.queue(l,Ee.createRecord(l,{type:Ee.ContentType.handshake,data:Ee.createFinished(l)})),l.expect=OQn,Ee.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);Ee.getClientSignature(t,c)};Ee.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});var r=t.entity===Ee.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=Ee.createConnectionState(t)),t.state.current.read=t.state.pending.read,(!t.session.resuming&&r||t.session.resuming&&!r)&&(t.state.pending=null),t.expect=r?n2s:l2s,t.process()};Ee.handleFinished=function(t,e,r){var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s=e.fragment.getBytes();n=Kt.util.createBuffer(),n.putBuffer(t.session.md5.digest()),n.putBuffer(t.session.sha1.digest());var c=t.entity===Ee.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=Dat;if(n=f(u.master_secret,l,n.getBytes(),d),n.getBytes()!==s)return t.error(t,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(Ee.queue(t,Ee.createRecord(t,{type:Ee.ContentType.change_cipher_spec,data:Ee.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,Ee.queue(t,Ee.createRecord(t,{type:Ee.ContentType.handshake,data:Ee.createFinished(t)}))),t.expect=c?i2s:u2s,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,Ee.flush(t),t.isConnected=!0,t.connected(t),t.process()};Ee.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case Ee.Alert.Description.close_notify:o="Connection closed.";break;case Ee.Alert.Description.unexpected_message:o="Unexpected message.";break;case Ee.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case Ee.Alert.Description.decryption_failed:o="Decryption failed.";break;case Ee.Alert.Description.record_overflow:o="Record overflow.";break;case Ee.Alert.Description.decompression_failure:o="Decompression failed.";break;case Ee.Alert.Description.handshake_failure:o="Handshake failure.";break;case Ee.Alert.Description.bad_certificate:o="Bad certificate.";break;case Ee.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case Ee.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case Ee.Alert.Description.certificate_expired:o="Certificate expired.";break;case Ee.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case Ee.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case Ee.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case Ee.Alert.Description.access_denied:o="Access denied.";break;case Ee.Alert.Description.decode_error:o="Decode error.";break;case Ee.Alert.Description.decrypt_error:o="Decrypt error.";break;case Ee.Alert.Description.export_restriction:o="Export restriction.";break;case Ee.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case Ee.Alert.Description.insufficient_security:o="Insufficient security.";break;case Ee.Alert.Description.internal_error:o="Internal error.";break;case Ee.Alert.Description.user_canceled:o="User canceled.";break;case Ee.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===Ee.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===Ee.ConnectionEnd.client?"server":"client",alert:n}),t.process()};Ee.handleHandshake=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=Kt.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var s=r.bytes(o+4);r.read+=4,n in Pat[t.entity][t.expect]?(t.entity===Ee.ConnectionEnd.server&&!t.open&&!t.fail&&(t.handshaking=!0,t.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:Kt.md.md5.create(),sha1:Kt.md.sha1.create()}),n!==Ee.HandshakeType.hello_request&&n!==Ee.HandshakeType.certificate_verify&&n!==Ee.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),Pat[t.entity][t.expect][n](t,e,o)):Ee.handleUnexpected(t,e)};Ee.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};Ee.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===Ee.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();Ee.queue(t,Ee.createRecord(t,{type:Ee.ContentType.heartbeat,data:Ee.createHeartbeat(Ee.HeartbeatMessageType.heartbeat_response,s)})),Ee.flush(t)}else if(n===Ee.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Kt.util.createBuffer(s))}t.process()};var XPs=0,e2s=1,NQn=2,t2s=3,r2s=4,OQn=5,n2s=6,i2s=7,o2s=8,s2s=0,a2s=1,uar=2,c2s=3,dar=4,l2s=5,u2s=6,_e=Ee.handleUnexpected,LQn=Ee.handleChangeCipherSpec,ry=Ee.handleAlert,xv=Ee.handleHandshake,BQn=Ee.handleApplicationData,ny=Ee.handleHeartbeat,far=[];far[Ee.ConnectionEnd.client]=[[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[LQn,ry,_e,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,BQn,ny],[_e,ry,xv,_e,ny]];far[Ee.ConnectionEnd.server]=[[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,_e,ny],[LQn,ry,_e,_e,ny],[_e,ry,xv,_e,ny],[_e,ry,xv,BQn,ny],[_e,ry,xv,_e,ny]];var SH=Ee.handleHelloRequest,d2s=Ee.handleServerHello,FQn=Ee.handleCertificate,MQn=Ee.handleServerKeyExchange,car=Ee.handleCertificateRequest,Rat=Ee.handleServerHelloDone,UQn=Ee.handleFinished,Pat=[];Pat[Ee.ConnectionEnd.client]=[[_e,_e,d2s,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,FQn,MQn,car,Rat,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,MQn,car,Rat,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,car,Rat,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,Rat,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,UQn],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e],[SH,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e]];var f2s=Ee.handleClientHello,p2s=Ee.handleClientKeyExchange,h2s=Ee.handleCertificateVerify;Pat[Ee.ConnectionEnd.server]=[[_e,f2s,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,FQn,_e,_e,_e,_e,_e,_e,_e,_e,_e],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,p2s,_e,_e,_e,_e],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,h2s,_e,_e,_e,_e,_e],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,UQn],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e],[_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e,_e]];Ee.generateKeys=function(t,e){var r=Dat,n=e.client_random+e.server_random;t.session.resuming||(e.master_secret=r(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var o=2*e.mac_key_length+2*e.enc_key_length,s=t.version.major===Ee.Versions.TLS_1_0.major&&t.version.minor===Ee.Versions.TLS_1_0.minor;s&&(o+=2*e.fixed_iv_length);var c=r(e.master_secret,"key expansion",n,o),l={client_write_MAC_key:c.getBytes(e.mac_key_length),server_write_MAC_key:c.getBytes(e.mac_key_length),client_write_key:c.getBytes(e.enc_key_length),server_write_key:c.getBytes(e.enc_key_length)};return s&&(l.client_write_IV=c.getBytes(e.fixed_iv_length),l.server_write_IV=c.getBytes(e.fixed_iv_length)),l};Ee.createConnectionState=function(t){var e=t.entity===Ee.ConnectionEnd.client,r=a(function(){var s={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:a(function(c){return!0},"cipherFunction"),compressionState:null,compressFunction:a(function(c){return!0},"compressFunction"),updateSequenceNumber:a(function(){s.sequenceNumber[1]===4294967295?(s.sequenceNumber[1]=0,++s.sequenceNumber[0]):++s.sequenceNumber[1]},"updateSequenceNumber")};return s},"createMode"),n={read:r(),write:r()};if(n.read.update=function(s,c){return n.read.cipherFunction(c,n.read)?n.read.compressFunction(s,c,n.read)||s.error(s,{message:"Could not decompress record.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.bad_record_mac}}),!s.fail},n.write.update=function(s,c){return n.write.compressFunction(s,c,n.write)?n.write.cipherFunction(c,n.write)||s.error(s,{message:"Could not encrypt record.",send:!1,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=Ee.generateKeys(t,o),n.read.macKey=e?o.keys.server_write_MAC_key:o.keys.client_write_MAC_key,n.write.macKey=e?o.keys.client_write_MAC_key:o.keys.server_write_MAC_key,t.session.cipherSuite.initConnectionState(n,t,o),o.compression_algorithm){case Ee.CompressionMethod.none:break;case Ee.CompressionMethod.deflate:n.read.compressFunction=ZPs,n.write.compressFunction=JPs;break;default:throw new Error("Unsupported compression algorithm.")}}return n};Ee.createRandom=function(){var t=new Date,e=+t+t.getTimezoneOffset()*6e4,r=Kt.util.createBuffer();return r.putInt32(e),r.putBytes(Kt.random.getBytes(28)),r};Ee.createRecord=function(t,e){if(!e.data)return null;var r={type:e.type,version:{major:t.version.major,minor:t.version.minor},length:e.data.length(),fragment:e.data};return r};Ee.createAlert=function(t,e){var r=Kt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),Ee.createRecord(t,{type:Ee.ContentType.alert,data:r})};Ee.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=Kt.util.createBuffer(),r=0;r0&&(h+=2);var m=t.session.id,g=m.length+1+2+4+28+2+o+1+c+h,A=Kt.util.createBuffer();return A.putByte(Ee.HandshakeType.client_hello),A.putInt24(g),A.putByte(t.version.major),A.putByte(t.version.minor),A.putBytes(t.session.sp.client_random),nR(A,1,Kt.util.createBuffer(m)),nR(A,2,e),nR(A,1,s),h>0&&nR(A,2,l),A};Ee.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Kt.util.createBuffer();return n.putByte(Ee.HandshakeType.server_hello),n.putInt24(r),n.putByte(t.version.major),n.putByte(t.version.minor),n.putBytes(t.session.sp.server_random),nR(n,1,Kt.util.createBuffer(e)),n.putByte(t.session.cipherSuite.id[0]),n.putByte(t.session.cipherSuite.id[1]),n.putByte(t.session.compressionMethod),n};Ee.createCertificate=function(t){var e=t.entity===Ee.ConnectionEnd.client,r=null;if(t.getCertificate){var n;e?n=t.session.certificateRequest:n=t.session.extensions.server_name.serverNameList,r=t.getCertificate(t,n)}var o=Kt.util.createBuffer();if(r!==null)try{Kt.util.isArray(r)||(r=[r]);for(var s=null,c=0;c0&&(r.putByte(Ee.HandshakeType.server_key_exchange),r.putInt24(e)),r};Ee.getClientSignature=function(t,e){var r=Kt.util.createBuffer();r.putBuffer(t.session.md5.digest()),r.putBuffer(t.session.sha1.digest()),r=r.getBytes(),t.getSignature=t.getSignature||function(n,o,s){var c=null;if(n.getPrivateKey)try{c=n.getPrivateKey(n,n.session.clientCertificate),c=Kt.pki.privateKeyFromPem(c)}catch(l){n.error(n,{message:"Could not get private key.",cause:l,send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};Ee.createCertificateVerify=function(t,e){var r=e.length+2,n=Kt.util.createBuffer();return n.putByte(Ee.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};Ee.createCertificateRequest=function(t){var e=Kt.util.createBuffer();e.putByte(1);var r=Kt.util.createBuffer();for(var n in t.caStore.certs){var o=t.caStore.certs[n],s=Kt.pki.distinguishedNameToAsn1(o.subject),c=Kt.asn1.toDer(s);r.putInt16(c.length()),r.putBuffer(c)}var l=1+e.length()+2+r.length(),u=Kt.util.createBuffer();return u.putByte(Ee.HandshakeType.certificate_request),u.putInt24(l),nR(u,1,e),nR(u,2,r),u};Ee.createServerHelloDone=function(t){var e=Kt.util.createBuffer();return e.putByte(Ee.HandshakeType.server_hello_done),e.putInt24(0),e};Ee.createChangeCipherSpec=function(){var t=Kt.util.createBuffer();return t.putByte(1),t};Ee.createFinished=function(t){var e=Kt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===Ee.ConnectionEnd.client,n=t.session.sp,o=12,s=Dat,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Kt.util.createBuffer();return l.putByte(Ee.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};Ee.createHeartbeat=function(t,e,r){typeof r>"u"&&(r=e.length);var n=Kt.util.createBuffer();n.putByte(t),n.putInt16(r),n.putBytes(e);var o=n.length(),s=Math.max(16,o-r-3);return n.putBytes(Kt.random.getBytes(s)),n};Ee.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===Ee.ContentType.handshake||e.type===Ee.ContentType.alert||e.type===Ee.ContentType.change_cipher_spec))){if(e.type===Ee.ContentType.handshake){var r=e.fragment.bytes();t.session.md5.update(r),t.session.sha1.update(r),r=null}var n;if(e.fragment.length()<=Ee.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>Ee.MaxFragment;)n.push(Ee.createRecord(t,{type:e.type,data:Kt.util.createBuffer(o.slice(0,Ee.MaxFragment))})),o=o.slice(Ee.MaxFragment);o.length>0&&n.push(Ee.createRecord(t,{type:e.type,data:Kt.util.createBuffer(o)}))}for(var s=0;s0&&(c=r.order[0]),c!==null&&c in r.cache){s=r.cache[c],delete r.cache[c];for(var l in r.order)if(r.order[l]===c){r.order.splice(l,1);break}}return s},r.setSession=function(o,s){if(r.order.length===r.capacity){var c=r.order.shift();delete r.cache[c]}var c=Kt.util.bytesToHex(o);r.order.push(c),r.cache[c]=s}}return r};Ee.createConnection=function(t){var e=null;t.caStore?Kt.util.isArray(t.caStore)?e=Kt.pki.createCaStore(t.caStore):e=t.caStore:e=Kt.pki.createCaStore();var r=t.cipherSuites||null;if(r===null){r=[];for(var n in Ee.CipherSuites)r.push(Ee.CipherSuites[n])}var o=t.server?Ee.ConnectionEnd.server:Ee.ConnectionEnd.client,s=t.sessionCache?Ee.createSessionCache(t.sessionCache):null,c={version:{major:Ee.Version.major,minor:Ee.Version.minor},entity:o,sessionId:t.sessionId,caStore:e,sessionCache:s,cipherSuites:r,connected:t.connected,virtualHost:t.virtualHost||null,verifyClient:t.verifyClient||!1,verify:t.verify||function(f,h,m,g){return h},verifyOptions:t.verifyOptions||{},getCertificate:t.getCertificate||null,getPrivateKey:t.getPrivateKey||null,getSignature:t.getSignature||null,input:Kt.util.createBuffer(),tlsData:Kt.util.createBuffer(),data:Kt.util.createBuffer(),tlsDataReady:t.tlsDataReady,dataReady:t.dataReady,heartbeatReceived:t.heartbeatReceived,closed:t.closed,error:a(function(f,h){h.origin=h.origin||(f.entity===Ee.ConnectionEnd.client?"client":"server"),h.send&&(Ee.queue(f,Ee.createAlert(f,h.alert)),Ee.flush(f));var m=h.fatal!==!1;m&&(f.fail=!0),t.error(f,h),m&&f.close(!1)},"error"),deflate:t.deflate||null,inflate:t.inflate||null};c.reset=function(f){c.version={major:Ee.Version.major,minor:Ee.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===Ee.ConnectionEnd.client?XPs:s2s,c.fragmented=null,c.records=[],c.open=!1,c.handshakes=0,c.handshaking=!1,c.isConnected=!1,c.fail=!(f||typeof f>"u"),c.input.clear(),c.tlsData.clear(),c.data.clear(),c.state.current=Ee.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-Ee.ContentType.change_cipher_spec,g=far[f.entity][f.expect];m in g?g[m](f,h):Ee.handleUnexpected(f,h)},"_update"),u=a(function(f){var h=0,m=f.input,g=m.length();if(g<5)h=5-g;else{f.record={type:m.getByte(),version:{major:m.getByte(),minor:m.getByte()},length:m.getInt16(),fragment:Kt.util.createBuffer(),ready:!1};var A=f.record.version.major===f.version.major;A&&f.session&&f.session.version&&(A=f.record.version.minor===f.version.minor),A||f.error(f,{message:"Incompatible TLS version.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.protocol_version}})}return h},"_readRecordHeader"),d=a(function(f){var h=0,m=f.input,g=m.length();if(g0&&(c.sessionCache&&(h=c.sessionCache.getSession(f)),h===null&&(f="")),f.length===0&&c.sessionCache&&(h=c.sessionCache.getSession(),h!==null&&(f=h.id)),c.session={id:f,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:Kt.md.md5.create(),sha1:Kt.md.sha1.create()},h&&(c.version=h.version,c.session.sp=h.sp),c.session.sp.client_random=Ee.createRandom().getBytes(),c.open=!0,Ee.queue(c,Ee.createRecord(c,{type:Ee.ContentType.handshake,data:Ee.createClientHello(c)})),Ee.flush(c)}},c.process=function(f){var h=0;return f&&c.input.putBytes(f),c.fail||(c.record!==null&&c.record.ready&&c.record.fragment.isEmpty()&&(c.record=null),c.record===null&&(h=u(c)),!c.fail&&c.record!==null&&!c.record.ready&&(h=d(c)),!c.fail&&c.record!==null&&c.record.ready&&l(c,c.record)),h},c.prepare=function(f){return Ee.queue(c,Ee.createRecord(c,{type:Ee.ContentType.application_data,data:Kt.util.createBuffer(f)})),Ee.flush(c)},c.prepareHeartbeatRequest=function(f,h){return f instanceof Kt.util.ByteBuffer&&(f=f.bytes()),typeof h>"u"&&(h=f.length),c.expectedHeartbeatPayload=f,Ee.queue(c,Ee.createRecord(c,{type:Ee.ContentType.heartbeat,data:Ee.createHeartbeat(Ee.HeartbeatMessageType.heartbeat_request,f,h)})),Ee.flush(c)},c.close=function(f){if(!c.fail&&c.sessionCache&&c.session){var h={id:c.session.id,version:c.session.version,sp:c.session.sp};h.sp.keys=null,c.sessionCache.setSession(h.id,h)}c.open&&(c.open=!1,c.input.clear(),(c.isConnected||c.handshaking)&&(c.isConnected=c.handshaking=!1,Ee.queue(c,Ee.createAlert(c,{level:Ee.Alert.Level.warning,description:Ee.Alert.Description.close_notify})),Ee.flush(c)),c.closed(c)),c.reset(f)},c};QQn.exports=Kt.tls=Kt.tls||{};for(kat in Ee)typeof Ee[kat]!="function"&&(Kt.tls[kat]=Ee[kat]);var kat;Kt.tls.prf_tls1=Dat;Kt.tls.hmac_sha1=KPs;Kt.tls.createSessionCache=Ee.createSessionCache;Kt.tls.createConnection=Ee.createConnection});var HQn=I((E0f,jQn)=>{p();var TH=Cs();yH();par();var iR=jQn.exports=TH.tls;iR.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:a(function(t){t.bulk_cipher_algorithm=iR.BulkCipherAlgorithm.aes,t.cipher_type=iR.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=iR.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:qQn};iR.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:a(function(t){t.bulk_cipher_algorithm=iR.BulkCipherAlgorithm.aes,t.cipher_type=iR.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=iR.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:qQn};function qQn(t,e,r){var n=e.entity===TH.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:TH.cipher.createDecipher("AES-CBC",n?r.keys.server_write_key:r.keys.client_write_key),iv:n?r.keys.server_write_IV:r.keys.client_write_IV},t.write.cipherState={init:!1,cipher:TH.cipher.createCipher("AES-CBC",n?r.keys.client_write_key:r.keys.server_write_key),iv:n?r.keys.client_write_IV:r.keys.server_write_IV},t.read.cipherFunction=_2s,t.write.cipherFunction=g2s,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=iR.hmac_sha1}a(qQn,"initConnectionState");function g2s(t,e){var r=!1,n=e.macFunction(e.macKey,e.sequenceNumber,t);t.fragment.putBytes(n),e.updateSequenceNumber();var o;t.version.minor===iR.Versions.TLS_1_0.minor?o=e.cipherState.init?null:e.cipherState.iv:o=TH.random.getBytesSync(16),e.cipherState.init=!0;var s=e.cipherState.cipher;return s.start({iv:o}),t.version.minor>=iR.Versions.TLS_1_1.minor&&s.output.putBytes(o),s.update(t.fragment),s.finish(A2s)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(g2s,"encrypt_aes_cbc_sha1");function A2s(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(A2s,"encrypt_aes_cbc_sha1_padding");function y2s(t,e,r){var n=!0;if(r){for(var o=e.length(),s=e.last(),c=o-1-s;c=s?(t.fragment=o.output.getBytes(l-s),c=o.output.getBytes(s)):t.fragment=o.output.getBytes(),t.fragment=TH.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=E2s(e.macKey,c,u)&&r,r}a(_2s,"decrypt_aes_cbc_sha1");function E2s(t,e,r){var n=TH.hmac.create();return n.start("SHA1",t),n.update(e),e=n.digest().getBytes(),n.start(null,null),n.update(r),r=n.digest().getBytes(),e===r}a(E2s,"compareMacs")});var gar=I((b0f,WQn)=>{p();var yd=Cs();t4();Ac();var M2e=WQn.exports=yd.sha512=yd.sha512||{};yd.md.sha512=yd.md.algorithms.sha512=M2e;var $Qn=yd.sha384=yd.sha512.sha384=yd.sha512.sha384||{};$Qn.create=function(){return M2e.create("SHA-384")};yd.md.sha384=yd.md.algorithms.sha384=$Qn;yd.sha512.sha256=yd.sha512.sha256||{create:a(function(){return M2e.create("SHA-512/256")},"create")};yd.md["sha512/256"]=yd.md.algorithms["sha512/256"]=yd.sha512.sha256;yd.sha512.sha224=yd.sha512.sha224||{create:a(function(){return M2e.create("SHA-512/224")},"create")};yd.md["sha512/224"]=yd.md.algorithms["sha512/224"]=yd.sha512.sha224;M2e.create=function(t){if(VQn||v2s(),typeof t>"u"&&(t="SHA-512"),!(t in fX))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=fX[t],r=null,n=yd.util.createBuffer(),o=new Array(80),s=0;s<80;++s)o[s]=new Array(2);var c=64;switch(t){case"SHA-384":c=48;break;case"SHA-512/256":c=32;break;case"SHA-512/224":c=28;break}var l={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:c,messageLength:0,fullMessageLength:null,messageLengthSize:16};return l.start=function(){l.messageLength=0,l.fullMessageLength=l.messageLength128=[];for(var u=l.messageLengthSize/4,d=0;d>>0,f>>>0];for(var h=l.fullMessageLength.length-1;h>=0;--h)l.fullMessageLength[h]+=f[1],f[1]=f[0]+(l.fullMessageLength[h]/4294967296>>>0),l.fullMessageLength[h]=l.fullMessageLength[h]>>>0,f[0]=f[1]/4294967296>>>0;return n.putBytes(u),GQn(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=yd.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes(har.substr(0,l.blockLength-f));for(var h,m,g=l.fullMessageLength[0]*8,A=0;A>>0,g+=m,u.putInt32(g>>>0),g=h>>>0;u.putInt32(g);for(var y=new Array(r.length),A=0;A=128;){for(L=0;L<16;++L)e[L][0]=r.getInt32()>>>0,e[L][1]=r.getInt32()>>>0;for(;L<80;++L)Q=e[L-2],U=Q[0],j=Q[1],n=((U>>>19|j<<13)^(j>>>29|U<<3)^U>>>6)>>>0,o=((U<<13|j>>>19)^(j<<3|U>>>29)^(U<<26|j>>>6))>>>0,W=e[L-15],U=W[0],j=W[1],s=((U>>>1|j<<31)^(U>>>8|j<<24)^U>>>7)>>>0,c=((U<<31|j>>>1)^(U<<24|j>>>8)^(U<<25|j>>>7))>>>0,Y=e[L-7],V=e[L-16],j=o+Y[1]+c+V[1],e[L][0]=n+Y[0]+s+V[0]+(j/4294967296>>>0)>>>0,e[L][1]=j>>>0;for(y=t[0][0],_=t[0][1],E=t[1][0],v=t[1][1],S=t[2][0],T=t[2][1],w=t[3][0],R=t[3][1],x=t[4][0],k=t[4][1],D=t[5][0],N=t[5][1],O=t[6][0],B=t[6][1],q=t[7][0],M=t[7][1],L=0;L<80;++L)d=((x>>>14|k<<18)^(x>>>18|k<<14)^(k>>>9|x<<23))>>>0,f=((x<<18|k>>>14)^(x<<14|k>>>18)^(k<<23|x>>>9))>>>0,h=(O^x&(D^O))>>>0,m=(B^k&(N^B))>>>0,l=((y>>>28|_<<4)^(_>>>2|y<<30)^(_>>>7|y<<25))>>>0,u=((y<<4|_>>>28)^(_<<30|y>>>2)^(_<<25|y>>>7))>>>0,g=(y&E|S&(y^E))>>>0,A=(_&v|T&(_^v))>>>0,j=M+f+m+mar[L][1]+e[L][1],n=q+d+h+mar[L][0]+e[L][0]+(j/4294967296>>>0)>>>0,o=j>>>0,j=u+A,s=l+g+(j/4294967296>>>0)>>>0,c=j>>>0,q=O,M=B,O=D,B=N,D=x,N=k,j=R+o,x=w+n+(j/4294967296>>>0)>>>0,k=j>>>0,w=S,R=T,S=E,T=v,E=y,v=_,j=o+c,y=n+s+(j/4294967296>>>0)>>>0,_=j>>>0;j=t[0][1]+_,t[0][0]=t[0][0]+y+(j/4294967296>>>0)>>>0,t[0][1]=j>>>0,j=t[1][1]+v,t[1][0]=t[1][0]+E+(j/4294967296>>>0)>>>0,t[1][1]=j>>>0,j=t[2][1]+T,t[2][0]=t[2][0]+S+(j/4294967296>>>0)>>>0,t[2][1]=j>>>0,j=t[3][1]+R,t[3][0]=t[3][0]+w+(j/4294967296>>>0)>>>0,t[3][1]=j>>>0,j=t[4][1]+k,t[4][0]=t[4][0]+x+(j/4294967296>>>0)>>>0,t[4][1]=j>>>0,j=t[5][1]+N,t[5][0]=t[5][0]+D+(j/4294967296>>>0)>>>0,t[5][1]=j>>>0,j=t[6][1]+B,t[6][0]=t[6][0]+O+(j/4294967296>>>0)>>>0,t[6][1]=j>>>0,j=t[7][1]+M,t[7][0]=t[7][0]+q+(j/4294967296>>>0)>>>0,t[7][1]=j>>>0,z-=128}}a(GQn,"_update")});var zQn=I(Aar=>{p();var C2s=Cs();J2();var H0=C2s.asn1;Aar.privateKeyValidator={name:"PrivateKeyInfo",tagClass:H0.Class.UNIVERSAL,type:H0.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:H0.Class.UNIVERSAL,type:H0.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:H0.Class.UNIVERSAL,type:H0.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:H0.Class.UNIVERSAL,type:H0.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:H0.Class.UNIVERSAL,type:H0.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Aar.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:H0.Class.UNIVERSAL,type:H0.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:H0.Class.UNIVERSAL,type:H0.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:H0.Class.UNIVERSAL,type:H0.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:H0.Class.UNIVERSAL,type:H0.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var aqn=I((w0f,sqn)=>{p();var iy=Cs();k2e();Xw();gar();Ac();var eqn=zQn(),b2s=eqn.publicKeyValidator,S2s=eqn.privateKeyValidator;typeof YQn>"u"&&(YQn=iy.jsbn.BigInteger);var YQn,_ar=iy.util.ByteBuffer,Mb=typeof Buffer>"u"?Uint8Array:Buffer;iy.pki=iy.pki||{};sqn.exports=iy.pki.ed25519=iy.ed25519=iy.ed25519||{};var sa=iy.ed25519;sa.constants={};sa.constants.PUBLIC_KEY_BYTE_LENGTH=32;sa.constants.PRIVATE_KEY_BYTE_LENGTH=64;sa.constants.SEED_BYTE_LENGTH=32;sa.constants.SIGN_BYTE_LENGTH=64;sa.constants.HASH_BYTE_LENGTH=64;sa.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=iy.random.getBytesSync(sa.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==sa.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+sa.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');e=C8({message:e,encoding:"binary"});for(var r=new Mb(sa.constants.PUBLIC_KEY_BYTE_LENGTH),n=new Mb(sa.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return w2s(r,n),{publicKey:r,privateKey:n}};sa.privateKeyFromAsn1=function(t){var e={},r=[],n=iy.asn1.validate(t,S2s,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=iy.asn1.derToOid(e.privateKeyOid),c=iy.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.privateKey,u=C8({message:iy.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};sa.publicKeyFromAsn1=function(t){var e={},r=[],n=iy.asn1.validate(t,b2s,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=iy.asn1.derToOid(e.publicKeyOid),c=iy.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.ed25519PublicKey;if(l.length!==sa.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return C8({message:l,encoding:"binary"})};sa.publicKeyFromPrivateKey=function(t){t=t||{};var e=C8({message:t.privateKey,encoding:"binary"});if(e.length!==sa.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+sa.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new Mb(sa.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function C8(t){var e=t.message;if(e instanceof Uint8Array||e instanceof Mb)return e;var r=t.encoding;if(e===void 0)if(t.md)e=t.md.digest().getBytes(),r="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof e=="string"&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof e=="string"){if(typeof Buffer<"u")return Buffer.from(e,r);e=new _ar(e,r)}else if(!(e instanceof _ar))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new Mb(e.length()),o=0;o=0;--r){if(t[e+r]O2e[r])return!1}return!1}a(P2s,"_isCanonicalSignatureScalar");function tqn(t,e){var r,n,o,s;for(n=63;n>=32;--n){for(r=0,o=n-32,s=n-12;o>8,e[o]-=r*256;e[o]+=r,e[n]=0}for(r=0,o=0;o<32;++o)e[o]+=r-(e[31]>>4)*O2e[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*O2e[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a(tqn,"modL");function Car(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;tqn(t,e)}a(Car,"reduce");function bar(t,e){var r=zi(),n=zi(),o=zi(),s=zi(),c=zi(),l=zi(),u=zi(),d=zi(),f=zi();hhe(r,t[1],t[0]),hhe(f,e[1],e[0]),su(r,r,f),phe(n,t[0],t[1]),phe(f,e[0],e[1]),su(n,n,f),su(o,t[3],e[3]),su(o,o,I2s),su(s,t[2],e[2]),phe(s,s,s),hhe(c,n,r),hhe(l,s,o),phe(u,s,o),phe(d,n,r),su(t[0],c,l),su(t[1],d,u),su(t[2],u,l),su(t[3],c,d)}a(bar,"add");function ZQn(t,e,r){for(var n=0;n<4;++n)oqn(t[n],e[n],r)}a(ZQn,"cswap");function Sar(t,e){var r=zi(),n=zi(),o=zi();L2s(o,e[2]),su(r,e[0],o),su(n,e[1],o),Mat(t,n),t[31]^=nqn(r)<<7}a(Sar,"pack");function Mat(t,e){var r,n,o,s=zi(),c=zi();for(r=0;r<16;++r)c[r]=e[r];for(yar(c),yar(c),yar(c),n=0;n<2;++n){for(s[0]=c[0]-65517,r=1;r<15;++r)s[r]=c[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=c[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,oqn(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(Mat,"pack25519");function D2s(t,e){var r=zi(),n=zi(),o=zi(),s=zi(),c=zi(),l=zi(),u=zi();return IH(t[2],Nat),N2s(t[1],e),pX(o,t[1]),su(s,o,T2s),hhe(o,o,t[2]),phe(s,t[2],s),pX(c,s),pX(l,c),su(u,l,c),su(r,u,o),su(r,r,s),M2s(r,r),su(r,r,o),su(r,r,s),su(r,r,s),su(t[0],r,s),pX(n,t[0]),su(n,n,s),XQn(n,o)&&su(t[0],t[0],x2s),pX(n,t[0]),su(n,n,s),XQn(n,o)?-1:(nqn(t[0])===e[31]>>7&&hhe(t[0],Ear,t[0]),su(t[3],t[0],t[1]),0)}a(D2s,"unpackneg");function N2s(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(N2s,"unpack25519");function M2s(t,e){var r=zi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)pX(r,r),n!==1&&su(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(M2s,"pow2523");function XQn(t,e){var r=new Mb(32),n=new Mb(32);return Mat(r,t),Mat(n,e),rqn(r,0,n,0)}a(XQn,"neq25519");function rqn(t,e,r,n){return O2s(t,e,r,n,32)}a(rqn,"crypto_verify_32");function O2s(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(O2s,"vn");function nqn(t){var e=new Mb(32);return Mat(e,t),e[0]&1}a(nqn,"par25519");function iqn(t,e,r){var n,o;for(IH(t[0],Ear),IH(t[1],Nat),IH(t[2],Nat),IH(t[3],Ear),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,ZQn(t,e,n),bar(e,t),bar(t,t),ZQn(t,e,n)}a(iqn,"scalarmult");function Tar(t,e){var r=[zi(),zi(),zi(),zi()];IH(r[0],KQn),IH(r[1],JQn),IH(r[2],Nat),su(r[3],KQn,JQn),iqn(t,r,e)}a(Tar,"scalarbase");function IH(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(IH,"set25519");function L2s(t,e){var r=zi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)pX(r,r),n!==2&&n!==4&&su(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(L2s,"inv25519");function yar(t){var e,r,n=1;for(e=0;e<16;++e)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-n*65536;t[0]+=n-1+37*(n-1)}a(yar,"car25519");function oqn(t,e,r){for(var n,o=~(r-1),s=0;s<16;++s)n=o&(t[s]^e[s]),t[s]^=n,e[s]^=n}a(oqn,"sel25519");function zi(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var HT=Cs();Ac();Xw();k2e();uqn.exports=HT.kem=HT.kem||{};var cqn=HT.jsbn.BigInteger;HT.kem.rsa={};HT.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||HT.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new cqn(HT.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(cqn.ONE)<=0);l=HT.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=HT.util.fillString("\0",u)+l);var d=o.encrypt(l,"NONE"),f=t.generate(l,s);return{encapsulation:d,key:f}},n.decrypt=function(o,s,c){var l=o.decrypt(s,"NONE");return t.generate(l,c)},n};HT.kem.kdf1=function(t,e){lqn(this,t,0,e||t.digestLength)};HT.kem.kdf2=function(t,e){lqn(this,t,1,e||t.digestLength)};function lqn(t,e,r,n){t.generate=function(o,s){for(var c=new HT.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new HT.util.ByteBuffer,d=r;d{p();var va=Cs();Ac();hqn.exports=va.log=va.log||{};va.log.levels=["none","error","warning","info","debug","verbose","max"];var Oat={},war=[],F2e=null;va.log.LEVEL_LOCKED=2;va.log.NO_LEVEL_CHECK=4;va.log.INTERPOLATE=8;for(l4=0;l4"u"||e?t.flags|=va.log.LEVEL_LOCKED:t.flags&=~va.log.LEVEL_LOCKED};va.log.addLogger=function(t){war.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(fqn={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},U2e=a(function(t,e){va.log.prepareStandard(e);var r=fqn[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),mhe=va.log.makeLogger(U2e)):(U2e=a(function(e,r){va.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),mhe=va.log.makeLogger(U2e)),va.log.setLevel(mhe,"debug"),va.log.addLogger(mhe),F2e=mhe):console={log:a(function(){},"log")};var mhe,fqn,U2e;F2e!==null&&typeof window<"u"&&window.location&&(B2e=new URL(window.location.href).searchParams,B2e.has("console.level")&&va.log.setLevel(F2e,B2e.get("console.level").slice(-1)[0]),B2e.has("console.lock")&&(pqn=B2e.get("console.lock").slice(-1)[0],pqn=="true"&&va.log.lock(F2e)));var B2e,pqn;va.log.consoleLogger=F2e});var Aqn=I((B0f,gqn)=>{p();gqn.exports=t4();hat();che();qsr();gar()});var Eqn=I((U0f,_qn)=>{p();var rn=Cs();yH();J2();w2e();_H();sX();tar();Xw();Ac();wat();var et=rn.asn1,wv=_qn.exports=rn.pkcs7=rn.pkcs7||{};wv.messageFromPem=function(t){var e=rn.pem.decode(t)[0];if(e.type!=="PKCS7"){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var n=et.fromDer(e.body);return wv.messageFromAsn1(n)};wv.messageToPem=function(t,e){var r={type:"PKCS7",body:et.toDer(t.toAsn1()).getBytes()};return rn.pem.encode(r,{maxline:e})};wv.messageFromAsn1=function(t){var e={},r=[];if(!et.validate(t,wv.asn1.contentInfoValidator,e,r)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw n.errors=r,n}var o=et.derToOid(e.contentType),s;switch(o){case rn.pki.oids.envelopedData:s=wv.createEnvelopedData();break;case rn.pki.oids.encryptedData:s=wv.createEncryptedData();break;case rn.pki.oids.signedData:s=wv.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+o+" is not (yet) supported.")}return s.fromAsn1(e.content.value[0]),s};wv.createSignedData=function(){var t=null;return t={type:rn.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:a(function(n){if(kar(t,n,wv.asn1.signedDataValidator),t.certificates=[],t.crls=[],t.digestAlgorithmIdentifiers=[],t.contentInfo=null,t.signerInfos=[],t.rawCapture.certificates)for(var o=t.rawCapture.certificates.value,s=0;s0&&c.value[0].value.push(et.create(et.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&c.value[0].value.push(et.create(et.Class.CONTEXT_SPECIFIC,1,!0,s)),c.value[0].value.push(et.create(et.Class.UNIVERSAL,et.Type.SET,!0,t.signerInfos)),et.create(et.Class.UNIVERSAL,et.Type.SEQUENCE,!0,[et.create(et.Class.UNIVERSAL,et.Type.OID,!1,et.oidToDer(t.type).getBytes()),c])},"toAsn1"),addSigner:a(function(n){var o=n.issuer,s=n.serialNumber;if(n.certificate){var c=n.certificate;typeof c=="string"&&(c=rn.pki.certificateFromPem(c)),o=c.issuer.attributes,s=c.serialNumber}var l=n.key;if(!l)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof l=="string"&&(l=rn.pki.privateKeyFromPem(l));var u=n.digestAlgorithm||rn.pki.oids.sha1;switch(u){case rn.pki.oids.sha1:case rn.pki.oids.sha256:case rn.pki.oids.sha384:case rn.pki.oids.sha512:case rn.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+u)}var d=n.authenticatedAttributes||[];if(d.length>0){for(var f=!1,h=!1,m=0;m0){for(var r=et.create(et.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n=r&&o{p();var Sm=Cs();yH();ihe();hat();che();Ac();var Bat=vqn.exports=Sm.ssh=Sm.ssh||{};Bat.privateKeyToPutty=function(t,e,r){r=r||"",e=e||"";var n="ssh-rsa",o=e===""?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: "+n+`\r `;s+="Encryption: "+o+`\r `,s+="Comment: "+r+`\r -`;var c=Sm.util.createBuffer();mhe(c,n),u4(c,t.e),u4(c,t.n);var l=Sm.util.encode64(c.bytes(),64),u=Math.floor(l.length/66)+1;s+="Public-Lines: "+u+`\r +`;var c=Sm.util.createBuffer();ghe(c,n),u4(c,t.e),u4(c,t.n);var l=Sm.util.encode64(c.bytes(),64),u=Math.floor(l.length/66)+1;s+="Public-Lines: "+u+`\r `,s+=l;var d=Sm.util.createBuffer();u4(d,t.d),u4(d,t.p),u4(d,t.q),u4(d,t.qInv);var f;if(!e)f=Sm.util.encode64(d.bytes(),64);else{var h=d.length()+16-1;h-=h%16;var m=Lat(d.bytes());m.truncate(m.length()-h+d.length()),d.putBuffer(m);var g=Sm.util.createBuffer();g.putBuffer(Lat("\0\0\0\0",e)),g.putBuffer(Lat("\0\0\0",e));var A=Sm.aes.createEncryptionCipher(g.truncate(8),"CBC");A.start(Sm.util.createBuffer().fillWithByte(0,16)),A.update(d.copy()),A.finish();var y=A.output;y.truncate(16),f=Sm.util.encode64(y.bytes(),64)}u=Math.floor(f.length/66)+1,s+=`\r Private-Lines: `+u+`\r -`,s+=f;var _=Lat("putty-private-key-file-mac-key",e),E=Sm.util.createBuffer();mhe(E,n),mhe(E,o),mhe(E,r),E.putInt32(c.length()),E.putBuffer(c),E.putInt32(d.length()),E.putBuffer(d);var v=Sm.hmac.create();return v.start("sha1",_),v.update(E.bytes()),s+=`\r +`,s+=f;var _=Lat("putty-private-key-file-mac-key",e),E=Sm.util.createBuffer();ghe(E,n),ghe(E,o),ghe(E,r),E.putInt32(c.length()),E.putBuffer(c),E.putInt32(d.length()),E.putBuffer(d);var v=Sm.hmac.create();return v.start("sha1",_),v.update(E.bytes()),s+=`\r Private-MAC: `+v.digest().toHex()+`\r -`,s};Bat.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=Sm.util.createBuffer();return mhe(n,r),u4(n,t.e),u4(n,t.n),r+" "+Sm.util.encode64(n.bytes())+" "+e};Bat.privateKeyToOpenSSH=function(t,e){return e?Sm.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):Sm.pki.privateKeyToPem(t)};Bat.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||Sm.md.md5.create(),n="ssh-rsa",o=Sm.util.createBuffer();mhe(o,n),u4(o,t.e),u4(o,t.n),r.start(),r.update(o.getBytes());var s=r.digest();if(e.encoding==="hex"){var c=s.toHex();return e.delimiter?c.match(/.{2}/g).join(e.delimiter):c}else{if(e.encoding==="binary")return s.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".')}return s};function u4(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=Sm.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(u4,"_addBigIntegerToBuffer");function mhe(t,e){t.putInt32(e.length),t.putString(e)}a(mhe,"_addStringToBuffer");function Lat(){for(var t=Sm.md.sha1.create(),e=arguments.length,r=0;r{p();vqn.exports=Cs();yH();qQn();J2();aat();w2e();oqn();nhe();lqn();pqn();mqn();tar();yat();oX();Ysr();iar();yqn();sar();Jsr();qsr();Tat();Xw();Gsr();Eqn();far();Ac()});var Tqn=I(pX=>{"use strict";p();Object.defineProperty(pX,"__esModule",{value:!0});pX.convert=pX.Format=void 0;var Q2e=Cqn(),xH;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(xH=pX.Format||(pX.Format={}));function bqn(t){var e=Q2e.pki.pemToDer(t),r=Q2e.asn1,n=r.fromDer(e.data.toString("binary")).value[0].value,o=n[0],s=o.tagClass===r.Class.CONTEXT_SPECIFIC&&o.type===0&&o.constructed,c=n.slice(s);return{serial:c[0],issuer:c[2],valid:c[3],subject:c[4]}}a(bqn,"myASN");function j2s(t){var e=bqn(t),r=e.subject.value.map(function(o){return o.value[0].value[1].value}).join("/"),n=e.valid.value.map(function(o){return o.value}).join(" - ");return["Subject ".concat(r),"Valid ".concat(n),String(t)].join(` -`)}a(j2s,"txtFormat");function Sqn(t,e){switch(e){case xH.der:return Q2e.pki.pemToDer(t);case xH.pem:return t;case xH.txt:return j2s(t);case xH.asn1:return bqn(t);case xH.fingerprint:var r=Q2e.md.sha1.create(),n=Sqn(t,xH.der);return r.update(n.getBytes()),r.digest().toHex();case xH.x509:return Q2e.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(Sqn,"convert");pX.convert=Sqn});var Pqn=I(Ob=>{"use strict";p();var wH=Ob&&Ob.__assign||function(){return wH=Object.assign||function(t){for(var e,r=1,n=arguments.length;r"u"&&(s.ca=e),r.call(this,s)},"newAgent");return n.prototype=r.prototype,n})(kar.Agent),(0,xqn.setGlobalDispatcher)(new xqn.Agent({connect:{ca:e}}))}},"addToGlobalAgent");Ob.addToGlobalAgent=G2s});var Dqn=I((J0f,Par)=>{p();function $2s(){let{X509Certificate:t}=require("crypto"),{join:e}=require("path");var r=typeof __webpack_require__=="function"?__non_webpack_require__:require;let n=process.arch==="arm64"?"crypt32-arm64.node":"crypt32.node",o=r(e(__dirname,n)),s=[],c=new o.Crypt32;try{let l;for(;l=c.next();){let u=new t(l);s.push(u.toString())}}finally{c.done()}return Array.from(new Set(s))}a($2s,"all");process.platform!=="win32"?Par.exports.all=()=>[]:Par.exports.all=$2s});var Al=I((iAf,Fqn)=>{"use strict";p();Fqn.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kHTTP2InitialWindowSize:Symbol("http2 initial window size"),kHTTP2ConnectionWindowSize:Symbol("http2 connection window size"),kEnableConnectProtocol:Symbol("http2session connect protocol"),kRemoteSettings:Symbol("http2session remote settings"),kHTTP2Stream:Symbol("http2session client stream"),kPingInterval:Symbol("ping interval"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}});var Var=I((sAf,jqn)=>{"use strict";p();var Ahe=0,Qar=1e3,qar=(Qar>>1)-1,RH,jar=Symbol("kFastTimer"),S8=[],Har=-2,Gar=-1,Qqn=0,Uqn=1;function $ar(){Ahe+=qar;let t=0,e=S8.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=Gar,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===Gar?(r._state=Har,--e!==0&&(S8[t]=S8[e])):++t}S8.length=e,S8.length!==0&&qqn()}a($ar,"onTick");function qqn(){RH?.refresh?RH.refresh():(clearTimeout(RH),RH=setTimeout($ar,qar),RH?.unref())}a(qqn,"refreshTimeout");var Hat=class{static{a(this,"FastTimer")}[jar]=!0;_state=Har;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===Har&&S8.push(this),(!RH||S8.length===1)&&qqn(),this._state=Qqn}clear(){this._state=Gar,this._idleStart=-1}};jqn.exports={setTimeout(t,e,r){return e<=Qar?setTimeout(t,e,r):new Hat(t,e,r)},clearTimeout(t){t[jar]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Hat(t,e,r)},clearFastTimeout(t){t.clear()},now(){return Ahe},tick(t=0){Ahe+=t-Qar+1,$ar(),$ar()},reset(){Ahe=0,S8.length=0,clearTimeout(RH),RH=null},kFastTimer:jar}});var uo=I((lAf,pjn)=>{"use strict";p();var Hqn=Symbol.for("undici.error.UND_ERR"),_d=class extends Error{static{a(this,"UndiciError")}constructor(e,r){super(e,r),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[Hqn]===!0}get[Hqn](){return!0}},Gqn=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),War=class extends _d{static{a(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[Gqn]===!0}get[Gqn](){return!0}},$qn=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),zar=class extends _d{static{a(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[$qn]===!0}get[$qn](){return!0}},Vqn=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),Yar=class extends _d{static{a(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[Vqn]===!0}get[Vqn](){return!0}},Wqn=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),Kar=class extends _d{static{a(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[Wqn]===!0}get[Wqn](){return!0}},zqn=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),Jar=class extends _d{static{a(this,"InvalidArgumentError")}constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[zqn]===!0}get[zqn](){return!0}},Yqn=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),Zar=class extends _d{static{a(this,"InvalidReturnValueError")}constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[Yqn]===!0}get[Yqn](){return!0}},Kqn=Symbol.for("undici.error.UND_ERR_ABORT"),Gat=class extends _d{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[Kqn]===!0}get[Kqn](){return!0}},Jqn=Symbol.for("undici.error.UND_ERR_ABORTED"),Xar=class extends Gat{static{a(this,"RequestAbortedError")}constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[Jqn]===!0}get[Jqn](){return!0}},Zqn=Symbol.for("undici.error.UND_ERR_INFO"),ecr=class extends _d{static{a(this,"InformationalError")}constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[Zqn]===!0}get[Zqn](){return!0}},Xqn=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),tcr=class extends _d{static{a(this,"RequestContentLengthMismatchError")}constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[Xqn]===!0}get[Xqn](){return!0}},ejn=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),rcr=class extends _d{static{a(this,"ResponseContentLengthMismatchError")}constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[ejn]===!0}get[ejn](){return!0}},tjn=Symbol.for("undici.error.UND_ERR_DESTROYED"),ncr=class extends _d{static{a(this,"ClientDestroyedError")}constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[tjn]===!0}get[tjn](){return!0}},rjn=Symbol.for("undici.error.UND_ERR_CLOSED"),icr=class extends _d{static{a(this,"ClientClosedError")}constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[rjn]===!0}get[rjn](){return!0}},njn=Symbol.for("undici.error.UND_ERR_SOCKET"),ocr=class extends _d{static{a(this,"SocketError")}constructor(e,r){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=r}static[Symbol.hasInstance](e){return e&&e[njn]===!0}get[njn](){return!0}},ijn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),scr=class extends _d{static{a(this,"NotSupportedError")}constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[ijn]===!0}get[ijn](){return!0}},ojn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),acr=class extends _d{static{a(this,"BalancedPoolMissingUpstreamError")}constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[ojn]===!0}get[ojn](){return!0}},sjn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),ccr=class extends Error{static{a(this,"HTTPParserError")}constructor(e,r,n){super(e),this.name="HTTPParserError",this.code=r?`HPE_${r}`:void 0,this.data=n?n.toString():void 0}static[Symbol.hasInstance](e){return e&&e[sjn]===!0}get[sjn](){return!0}},ajn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),lcr=class extends _d{static{a(this,"ResponseExceededMaxSizeError")}constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[ajn]===!0}get[ajn](){return!0}},cjn=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),ucr=class extends _d{static{a(this,"RequestRetryError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[cjn]===!0}get[cjn](){return!0}},ljn=Symbol.for("undici.error.UND_ERR_RESPONSE"),dcr=class extends _d{static{a(this,"ResponseError")}constructor(e,r,{headers:n,body:o}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=r,this.body=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[ljn]===!0}get[ljn](){return!0}},ujn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),fcr=class extends _d{static{a(this,"SecureProxyConnectionError")}constructor(e,r,n={}){super(r,{cause:e,...n}),this.name="SecureProxyConnectionError",this.message=r||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[ujn]===!0}get[ujn](){return!0}},djn=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),pcr=class extends _d{static{a(this,"MaxOriginsReachedError")}constructor(e){super(e),this.name="MaxOriginsReachedError",this.message=e||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED"}static[Symbol.hasInstance](e){return e&&e[djn]===!0}get[djn](){return!0}},hcr=class extends _d{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},fjn=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),mcr=class extends _d{static{a(this,"MessageSizeExceededError")}constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[fjn]===!0}get[fjn](){return!0}};pjn.exports={AbortError:Gat,HTTPParserError:ccr,UndiciError:_d,HeadersTimeoutError:zar,HeadersOverflowError:Yar,BodyTimeoutError:Kar,RequestContentLengthMismatchError:tcr,ConnectTimeoutError:War,InvalidArgumentError:Jar,InvalidReturnValueError:Zar,RequestAbortedError:Xar,ClientDestroyedError:ncr,ClientClosedError:icr,InformationalError:ecr,SocketError:ocr,NotSupportedError:scr,ResponseContentLengthMismatchError:rcr,BalancedPoolMissingUpstreamError:acr,ResponseExceededMaxSizeError:lcr,RequestRetryError:ucr,ResponseError:dcr,SecureProxyConnectionError:fcr,MaxOriginsReachedError:pcr,Socks5ProxyError:hcr,MessageSizeExceededError:mcr}});var Vat=I((fAf,mjn)=>{"use strict";p();var gcr=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"],$at={};Object.setPrototypeOf($at,null);var hjn={};Object.setPrototypeOf(hjn,null);function W2s(t){let e=hjn[t];return e===void 0&&(e=Buffer.from(t)),e}a(W2s,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:gjn,headerNameLowerCasedRecord:z2s}=Vat(),Acr=class t{static{a(this,"TstNode")}value=null;left=null;middle=null;right=null;code;constructor(e,r,n){if(n===void 0||n>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(n))>127)throw new TypeError("key must be ascii string");e.length!==++n?this.middle=new t(e,r,n):this.value=r}add(e,r){let n=e.length;if(n===0)throw new TypeError("Unreachable");let o=0,s=this;for(;;){let c=e.charCodeAt(o);if(c>127)throw new TypeError("key must be ascii string");if(s.code===c)if(n===++o){s.value=r;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,r,o);break}else if(s.code=65&&(s|=32);o!==null;){if(s===o.code){if(r===++n)return o;o=o.middle;break}o=o.code{"use strict";p();var q2e=require("node:assert"),{kDestroyed:bjn,kBodyUsed:yhe,kListeners:Yat,kBody:Ejn}=Al(),{IncomingMessage:Y2s}=require("node:http"),Sjn=require("node:stream"),K2s=require("node:net"),{stringify:J2s}=require("node:querystring"),{EventEmitter:Z2s}=require("node:events"),zat=Var(),{InvalidArgumentError:H0,ConnectTimeoutError:X2s}=uo(),{headerNameLowerCasedRecord:eDs}=Vat(),{tree:Tjn}=_jn(),[tDs,rDs]=process.versions.node.split(".",2).map(t=>Number(t)),Jat=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[Ejn]=e,this[yhe]=!1}async*[Symbol.asyncIterator](){q2e(!this[yhe],"disturbed"),this[yhe]=!0,yield*this[Ejn]}};function vjn(){}a(vjn,"noop");function nDs(t){return Zat(t)?(Pjn(t)===0&&t.on("data",function(){q2e(!1)}),typeof t.readableDidRead!="boolean"&&(t[yhe]=!1,Z2s.prototype.on.call(t,"data",function(){this[yhe]=!0})),t):t&&typeof t.pipeTo=="function"?new Jat(t):t&&Ljn(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&kjn(t)?new Jat(t):t}a(nDs,"wrapRequestBody");function Zat(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Zat,"isStream");function Ijn(t){if(t===null)return!1;if(t instanceof Blob)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}a(Ijn,"isBlobLike");function xjn(t){return t.includes("?")||t.includes("#")}a(xjn,"pathHasQueryOrFragment");function iDs(t,e){if(xjn(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=J2s(e);return r&&(t+="?"+r),t}a(iDs,"serializePathWithQuery");function wjn(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(wjn,"isValidPort");function Kat(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(Kat,"isHttpOrHttpsPrefixed");function Rjn(t){if(typeof t=="string"){if(t=new URL(t),!Kat(t.origin||t.protocol))throw new H0("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new H0("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&wjn(t.port)===!1)throw new H0("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new H0("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new H0("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new H0("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new H0("Invalid URL origin: the origin must be a string or null/undefined.");if(!Kat(t.origin||t.protocol))throw new H0("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!Kat(t.origin||t.protocol))throw new H0("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(Rjn,"parseURL");function oDs(t){if(t=Rjn(t),t.pathname!=="/"||t.search||t.hash)throw new H0("invalid url");return t}a(oDs,"parseOrigin");function sDs(t){if(t[0]==="["){let r=t.indexOf("]");return q2e(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(sDs,"getHostname");function aDs(t){if(!t)return null;q2e(typeof t=="string");let e=sDs(t);return K2s.isIP(e)?"":e}a(aDs,"getServerName");function cDs(t){return JSON.parse(JSON.stringify(t))}a(cDs,"deepClone");function lDs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(lDs,"isAsyncIterable");function kjn(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(kjn,"isIterable");function uDs(t){let e=Object.getPrototypeOf(t);return Object.prototype.hasOwnProperty.call(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}a(uDs,"hasSafeIterator");function Pjn(t){if(t==null)return 0;if(Zat(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(Ijn(t))return t.size!=null?t.size:null;if(Ojn(t))return t.byteLength}return null}a(Pjn,"bodyLength");function Djn(t){return t&&!!(t.destroyed||t[bjn]||Sjn.isDestroyed?.(t))}a(Djn,"isDestroyed");function Njn(t,e){t==null||!Zat(t)||Djn(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===Y2s&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[bjn]=!0))}a(Njn,"destroy");var dDs=/timeout=(\d+)/;function fDs(t){let e=t.match(dDs);return e?parseInt(e[1],10)*1e3:null}a(fDs,"parseKeepAliveTimeout");function Mjn(t){return typeof t=="string"?eDs[t]??t.toLowerCase():Tjn.lookup(t)??t.toString("latin1").toLowerCase()}a(Mjn,"headerNameToString");function pDs(t){return Tjn.lookup(t)??t.toString("latin1").toLowerCase()}a(pDs,"bufferToLowerCasedHeaderName");function hDs(t,e){e===void 0&&(e={});for(let r=0;rc.toString("latin1")):t[r+1].toString("latin1");n==="__proto__"?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s}else{let s=typeof t[r+1]=="string"?t[r+1]:Array.isArray(t[r+1])?t[r+1].map(c=>c.toString("latin1")):t[r+1].toString("latin1");e[n]=s}}return e}a(hDs,"parseHeaders");function mDs(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a(gDs,"encodeRawHeaders");function Ojn(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(Ojn,"isBuffer");function ADs(t,e,r){if(!t||typeof t!="object")throw new H0("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new H0("invalid onConnect method");if(typeof t.onError!="function")throw new H0("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new H0("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new H0("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new H0("invalid onHeaders method");if(typeof t.onData!="function")throw new H0("invalid onData method");if(typeof t.onComplete!="function")throw new H0("invalid onComplete method")}}}a(ADs,"assertRequestHandler");function yDs(t){return!!(t&&(Sjn.isDisturbed(t)||t[yhe]))}a(yDs,"isDisturbed");function _Ds(t){return{localAddress:t.localAddress,localPort:t.localPort,remoteAddress:t.remoteAddress,remotePort:t.remotePort,remoteFamily:t.remoteFamily,timeout:t.timeout,bytesWritten:t.bytesWritten,bytesRead:t.bytesRead}}a(_Ds,"getSocketInfo");function EDs(t){let e;return new ReadableStream({start(){e=t[Symbol.asyncIterator]()},pull(r){return e.next().then(({done:n,value:o})=>{if(n)return queueMicrotask(()=>{r.close(),r.byobRequest?.respond(0)});{let s=Buffer.isBuffer(o)?o:Buffer.from(o);return s.byteLength?r.enqueue(new Uint8Array(s)):this.pull(r)}})},cancel(){return e.return()},type:"bytes"})}a(EDs,"ReadableStreamFrom");function Ljn(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}a(Ljn,"isFormDataLike");function vDs(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.once("abort",e),()=>t.removeListener("abort",e))}a(vDs,"addAbortListener");var Bjn=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,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,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,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,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]);function CDs(t){return Bjn[t]===1}a(CDs,"isTokenCharCode");var bDs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function SDs(t){if(t.length>=12)return bDs.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return vjn;let r=null,n=null,o=zat.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>Cjn(t.deref(),e))})},e.timeout);return()=>{zat.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return vjn;let r=null,n=zat.setFastTimeout(()=>{r=setImmediate(()=>{Cjn(t.deref(),e)})},e.timeout);return()=>{zat.clearFastTimeout(n),clearImmediate(r)}};function Cjn(t,e){if(t==null)return;let r="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${e.hostname}:${e.port},`,r+=` timeout: ${e.timeout}ms)`,Njn(t,new X2s(r))}a(Cjn,"onConnectTimeout");function NDs(t){if(t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p")switch(t[4]){case":":return"http:";case"s":if(t[5]===":")return"https:"}return t.slice(0,t.indexOf(":")+1)}a(NDs,"getProtocolFromUrlString");var Fjn=Object.create(null);Fjn.enumerable=!0;var ycr={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},Ujn={...ycr,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(ycr,null);Object.setPrototypeOf(Ujn,null);Qjn.exports={kEnumerableProperty:Fjn,isDisturbed:yDs,isBlobLike:Ijn,parseOrigin:oDs,parseURL:Rjn,getServerName:aDs,isStream:Zat,isIterable:kjn,hasSafeIterator:uDs,isAsyncIterable:lDs,isDestroyed:Djn,headerNameToString:Mjn,bufferToLowerCasedHeaderName:pDs,addListener:RDs,removeAllListeners:kDs,errorRequest:PDs,parseRawHeaders:mDs,encodeRawHeaders:gDs,parseHeaders:hDs,parseKeepAliveTimeout:fDs,destroy:Njn,bodyLength:Pjn,deepClone:cDs,ReadableStreamFrom:EDs,isBuffer:Ojn,assertRequestHandler:ADs,getSocketInfo:_Ds,isFormDataLike:Ljn,pathHasQueryOrFragment:xjn,serializePathWithQuery:iDs,addAbortListener:vDs,isValidHTTPToken:SDs,isValidHeaderValue:IDs,isTokenCharCode:CDs,parseRangeHeader:wDs,normalizedMethodRecordsBase:ycr,normalizedMethodRecords:Ujn,isValidPort:wjn,isHttpOrHttpsPrefixed:Kat,nodeMajor:tDs,nodeMinor:rDs,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:nDs,setupConnectTimeout:DDs,getProtocolFromUrlString:NDs}});var vcr=I((vAf,$jn)=>{"use strict";p();var{kConnected:qjn,kPending:jjn,kRunning:Hjn,kSize:Gjn,kFree:MDs,kQueued:ODs}=Al(),_cr=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[qjn],this.pending=e[jjn],this.running=e[Hjn],this.size=e[Gjn]}},Ecr=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[qjn],this.free=e[MDs],this.pending=e[jjn],this.queued=e[ODs],this.running=e[Hjn],this.size=e[Gjn]}};$jn.exports={ClientStats:_cr,PoolStats:Ecr}});var kH=I((SAf,Wjn)=>{"use strict";p();var yl=require("node:diagnostics_channel"),Tcr=require("node:util"),hX=Tcr.debuglog("undici"),j2e=Tcr.debuglog("fetch"),Xat=Tcr.debuglog("websocket"),GT={beforeConnect:yl.channel("undici:client:beforeConnect"),connected:yl.channel("undici:client:connected"),connectError:yl.channel("undici:client:connectError"),sendHeaders:yl.channel("undici:client:sendHeaders"),create:yl.channel("undici:request:create"),bodySent:yl.channel("undici:request:bodySent"),bodyChunkSent:yl.channel("undici:request:bodyChunkSent"),bodyChunkReceived:yl.channel("undici:request:bodyChunkReceived"),headers:yl.channel("undici:request:headers"),trailers:yl.channel("undici:request:trailers"),error:yl.channel("undici:request:error"),open:yl.channel("undici:websocket:open"),close:yl.channel("undici:websocket:close"),socketError:yl.channel("undici:websocket:socket_error"),ping:yl.channel("undici:websocket:ping"),pong:yl.channel("undici:websocket:pong"),proxyConnected:yl.channel("undici:proxy:connected")},Ccr=!1;function Vjn(t=hX){if(!Ccr){if(GT.beforeConnect.hasSubscribers||GT.connected.hasSubscribers||GT.connectError.hasSubscribers||GT.sendHeaders.hasSubscribers){Ccr=!0;return}Ccr=!0,yl.subscribe("undici:client:beforeConnect",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),yl.subscribe("undici:client:connected",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),yl.subscribe("undici:client:connectError",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),yl.subscribe("undici:client:sendHeaders",e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s%s",r,o,n)})}}a(Vjn,"trackClientEvents");var bcr=!1;function LDs(t=hX){if(!bcr){if(GT.headers.hasSubscribers||GT.trailers.hasSubscribers||GT.error.hasSubscribers){bcr=!0;return}bcr=!0,yl.subscribe("undici:request:headers",e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s%s - HTTP %d",r,o,n,s)}),yl.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),yl.subscribe("undici:request:error",e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s%s errored - %s",r,o,n,s.message)})}}a(LDs,"trackRequestEvents");var Scr=!1;function BDs(t=Xat){if(!Scr){if(GT.open.hasSubscribers||GT.close.hasSubscribers||GT.socketError.hasSubscribers||GT.ping.hasSubscribers||GT.pong.hasSubscribers){Scr=!0;return}Scr=!0,yl.subscribe("undici:websocket:open",e=>{if(e.address!=null){let{address:r,port:n}=e.address;t("connection opened %s%s",r,n?`:${n}`:"")}else t("connection opened")}),yl.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),yl.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),yl.subscribe("undici:websocket:ping",e=>{t("ping received")}),yl.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(BDs,"trackWebSocketEvents");(hX.enabled||j2e.enabled)&&(Vjn(j2e.enabled?j2e:hX),LDs(j2e.enabled?j2e:hX));Xat.enabled&&(Vjn(hX.enabled?hX:Xat),BDs(Xat));Wjn.exports={channels:GT}});var Kjn=I((xAf,Yjn)=>{"use strict";p();var{InvalidArgumentError:kc,NotSupportedError:FDs}=uo(),d4=require("node:assert"),{isValidHTTPToken:Icr,isValidHeaderValue:H2e,isStream:UDs,destroy:QDs,isBuffer:qDs,isFormDataLike:jDs,isIterable:HDs,hasSafeIterator:GDs,isBlobLike:$Ds,serializePathWithQuery:VDs,assertRequestHandler:WDs,getServerName:zDs,normalizedMethodRecords:YDs,getProtocolFromUrlString:KDs}=No(),{channels:Lb}=kH(),{headerNameLowerCasedRecord:zjn}=Vat(),JDs=/[^\u0021-\u00ff]/;function ZDs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a(ZDs,"isValidContentLengthHeaderValue");var oR=Symbol("handler"),xcr=class{static{a(this,"Request")}constructor(e,{path:r,method:n,body:o,headers:s,query:c,idempotent:l,blocking:u,upgrade:d,headersTimeout:f,bodyTimeout:h,reset:m,expectContinue:g,servername:A,throwOnError:y,maxRedirections:_,typeOfService:E},v){if(typeof r!="string")throw new kc("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new kc("path must be an absolute URL or start with a slash");if(JDs.test(r))throw new kc("invalid request path");if(typeof n!="string")throw new kc("method must be a string");if(YDs[n]===void 0&&!Icr(n))throw new kc("invalid request method");if(d&&typeof d!="string")throw new kc("upgrade must be a string");if(d&&!H2e(d))throw new kc("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new kc("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new kc("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new kc("invalid reset");if(g!=null&&typeof g!="boolean")throw new kc("invalid expectContinue");if(y!=null)throw new kc("invalid throwOnError");if(_!=null&&_!==0)throw new kc("maxRedirections is not supported, use the redirect interceptor");if(E!=null&&(!Number.isInteger(E)||E<0||E>255))throw new kc("typeOfService must be an integer between 0 and 255");if(this.headersTimeout=f,this.bodyTimeout=h,this.method=n,this.typeOfService=E??0,this.abort=null,o==null)this.body=null;else if(UDs(o)){this.body=o;let S=this.body._readableState;(!S||!S.autoDestroy)&&(this.endHandler=a(function(){QDs(this)},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=T=>{this.abort?this.abort(T):this.error=T},this.body.on("error",this.errorHandler)}else if(qDs(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if(typeof o=="string")this.body=o.length?Buffer.from(o):null;else if(jDs(o)||HDs(o)||$Ds(o))this.body=o;else throw new kc("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=d||null,this.path=c?VDs(r,c):r,this.origin=e,this.protocol=KDs(e),this.idempotent=l??(n==="HEAD"||n==="GET"),this.blocking=u??this.method!=="HEAD",this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=g??!1,Array.isArray(s)){if(s.length%2!==0)throw new kc("headers array must be even");for(let S=0;S{"use strict";p();var{InvalidArgumentError:XDs}=uo();Zjn.exports=class Jjn{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new Jjn(e)}onConnect(e,r){return this.#e.onConnect?.(e,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onHeaders(e,r,n,o){return this.#e.onHeaders?.(e,r,n,o)}onUpgrade(e,r,n){return this.#e.onUpgrade?.(e,r,n)}onData(e){return this.#e.onData?.(e)}onComplete(e){return this.#e.onComplete?.(e)}onError(e){if(!this.#e.onError)throw e;return this.#e.onError?.(e)}onRequestStart(e,r){this.#e.onConnect?.(n=>e.abort(n),r)}onRequestUpgrade(e,r,n,o){let s=[];for(let[c,l]of Object.entries(n))s.push(Buffer.from(c,"latin1"),wcr(l));this.#e.onUpgrade?.(r,s,o)}onResponseStart(e,r,n,o){let s=[];for(let[c,l]of Object.entries(n))s.push(Buffer.from(c,"latin1"),wcr(l));this.#e.onHeaders?.(r,s,()=>e.resume(),o)===!1&&e.pause()}onResponseData(e,r){this.#e.onData?.(r)===!1&&e.pause()}onResponseEnd(e,r){let n=[];for(let[o,s]of Object.entries(r))n.push(Buffer.from(o,"latin1"),wcr(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new XDs("invalid onError method");this.#e.onError?.(r)}};function wcr(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(wcr,"toRawHeaderValue")});var $2e=I((NAf,Xjn)=>{"use strict";p();var eNs=require("node:events"),tNs=G2e(),rNs=a(t=>(e,r)=>t(e,tNs.wrap(r)),"wrapInterceptor"),Rcr=class extends eNs{static{a(this,"Dispatcher")}dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let r=Array.isArray(e[0])?e[0]:e,n=this.dispatch.bind(this);for(let o of r)if(o!=null){if(typeof o!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof o}`);if(n=o(n),n=rNs(n),n==null||typeof n!="function"||n.length!==2)throw new TypeError("invalid interceptor")}return new Proxy(this,{get:a((o,s)=>s==="dispatch"?n:o[s],"get")})}};Xjn.exports=Rcr});var rHn=I((LAf,tHn)=>{"use strict";p();var{parseHeaders:kcr}=No(),{InvalidArgumentError:nNs}=uo(),Pcr=Symbol("resume"),Dcr=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[Pcr]=null;rawHeaders=null;rawTrailers=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[Pcr]?.())}abort(e){this.#r||(this.#r=!0,this.#t=e,this.#n(e))}get aborted(){return this.#r}get reason(){return this.#t}get paused(){return this.#e}};tHn.exports=class eHn{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new eHn(e):e}onConnect(e,r){this.#t=new Dcr(e),this.#e.onRequestStart?.(this.#t,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onUpgrade(e,r,n){this.#t.rawHeaders=r,this.#e.onRequestUpgrade?.(this.#t,e,kcr(r),n)}onHeaders(e,r,n,o){return this.#t[Pcr]=n,this.#t.rawHeaders=r,this.#e.onResponseStart?.(this.#t,e,kcr(r),o),!this.#t.paused}onData(e){return this.#e.onResponseData?.(this.#t,e),!this.#t.paused}onComplete(e){this.#t.rawTrailers=e,this.#e.onResponseEnd?.(this.#t,kcr(e))}onError(e){if(!this.#e.onResponseError)throw new nNs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var gX=I((UAf,nHn)=>{"use strict";p();var iNs=$2e(),oNs=rHn(),{ClientDestroyedError:Ncr,ClientClosedError:sNs,InvalidArgumentError:tct}=uo(),{kDestroy:aNs,kClose:cNs,kClosed:V2e,kDestroyed:_he,kDispatch:lNs}=Al(),PH=Symbol("onDestroyed"),mX=Symbol("onClosed"),Mcr=Symbol("webSocketOptions"),Ocr=class extends iNs{static{a(this,"DispatcherBase")}[_he]=!1;[PH]=null;[V2e]=!1;[mX]=null;constructor(e){super(),this[Mcr]=e?.webSocket??{}}get webSocketOptions(){return{maxFragments:this[Mcr].maxFragments??131072,maxPayloadSize:this[Mcr].maxPayloadSize??128*1024*1024}}get destroyed(){return this[_he]}get closed(){return this[V2e]}close(e){if(e===void 0)return new Promise((n,o)=>{this.close((s,c)=>s?o(s):n(c))});if(typeof e!="function")throw new tct("invalid callback");if(this[_he]){let n=new Ncr;queueMicrotask(()=>e(n,null));return}if(this[V2e]){this[mX]?this[mX].push(e):queueMicrotask(()=>e(null,null));return}this[V2e]=!0,this[mX]??=[],this[mX].push(e);let r=a(()=>{let n=this[mX];this[mX]=null;for(let o=0;othis.destroy()).then(()=>queueMicrotask(r))}destroy(e,r){if(typeof e=="function"&&(r=e,e=null),r===void 0)return new Promise((o,s)=>{this.destroy(e,(c,l)=>c?s(c):o(l))});if(typeof r!="function")throw new tct("invalid callback");if(this[_he]){this[PH]?this[PH].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new Ncr),this[_he]=!0,this[PH]??=[],this[PH].push(r);let n=a(()=>{let o=this[PH];this[PH]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new tct("handler must be an object");r=oNs.unwrap(r);try{if(!e||typeof e!="object")throw new tct("opts must be an object.");if(this[_he]||this[PH])throw new Ncr;if(this[V2e])throw new sNs;return this[lNs](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};nHn.exports=Ocr});var AX=I((HAf,sHn)=>{"use strict";p();var uNs=require("node:net"),iHn=require("node:assert"),oHn=No(),{InvalidArgumentError:dNs}=uo(),Lcr,fNs=class{static{a(this,"WeakSessionCache")}constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new FinalizationRegistry(r=>{if(this._sessionCache.size=this._maxCachedSessions){for(let[o,s]of this._sessionCache)if(s.deref()===void 0){this._sessionCache.delete(o);return}let n=this._sessionCache.keys().next();n.done||this._sessionCache.delete(n.value)}this._sessionCache.set(e,new WeakRef(r)),this._sessionRegistry.register(r,e)}}};function pNs({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new dNs("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new fNs(r??100);return o=o??1e4,t=t??!1,a(function({hostname:f,host:h,protocol:m,port:g,servername:A,localAddress:y,httpSocket:_},E){let v;if(m==="https:"){Lcr||(Lcr=require("node:tls")),A=A||l.servername||oHn.getServerName(h)||null;let T=A||f;iHn(T);let w=s||u.get(T)||null;g=g||443,v=Lcr.connect({highWaterMark:16384,...l,servername:A,session:w,localAddress:y,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:_,port:g,host:f}),v.on("session",function(R){u.set(T,R)})}else iHn(!_,"httpSocket can only be sent on TLS update"),g=g||80,v=uNs.connect({highWaterMark:64*1024,...l,localAddress:y,port:g,host:f}),e===!0&&(v.alpnProtocol="h2");if(l.keepAlive==null||l.keepAlive){let T=l.keepAliveInitialDelay===void 0?6e4:l.keepAliveInitialDelay;v.setKeepAlive(!0,T)}let S=oHn.setupConnectTimeout(new WeakRef(v),{timeout:o,hostname:f,port:g});return v.setNoDelay(!0).once(m==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(S),E){let T=E;E=null,T(null,this)}}).on("error",function(T){if(queueMicrotask(S),E){let w=E;E=null,w(T)}}),v},"connect")}a(pNs,"buildConnector");sHn.exports=pNs});var aHn=I(Bcr=>{"use strict";p();Object.defineProperty(Bcr,"__esModule",{value:!0});Bcr.enumToMap=hNs;function hNs(t,e=[],r=[]){let n=(e?.length??0)===0,o=(r?.length??0)===0;return Object.fromEntries(Object.entries(t).filter(([,s])=>typeof s=="number"&&(n||e.includes(s))&&(o||!r.includes(s))))}a(hNs,"enumToMap")});var cHn=I(He=>{"use strict";p();Object.defineProperty(He,"__esModule",{value:!0});He.SPECIAL_HEADERS=He.MINOR=He.MAJOR=He.HTAB_SP_VCHAR_OBS_TEXT=He.QUOTED_STRING=He.CONNECTION_TOKEN_CHARS=He.HEADER_CHARS=He.TOKEN=He.HEX=He.URL_CHAR=He.USERINFO_CHARS=He.MARK=He.ALPHANUM=He.NUM=He.HEX_MAP=He.NUM_MAP=He.ALPHA=He.STATUSES_HTTP=He.H_METHOD_MAP=He.METHOD_MAP=He.METHODS_RTSP=He.METHODS_ICE=He.METHODS_HTTP=He.HEADER_STATE=He.FINISH=He.STATUSES=He.METHODS=He.LENIENT_FLAGS=He.FLAGS=He.TYPE=He.ERROR=void 0;var mNs=aHn();He.ERROR={OK:0,INTERNAL:1,STRICT:2,CR_EXPECTED:25,LF_EXPECTED:3,UNEXPECTED_CONTENT_LENGTH:4,UNEXPECTED_SPACE:30,CLOSED_CONNECTION:5,INVALID_METHOD:6,INVALID_URL:7,INVALID_CONSTANT:8,INVALID_VERSION:9,INVALID_HEADER_TOKEN:10,INVALID_CONTENT_LENGTH:11,INVALID_CHUNK_SIZE:12,INVALID_STATUS:13,INVALID_EOF_STATE:14,INVALID_TRANSFER_ENCODING:15,CB_MESSAGE_BEGIN:16,CB_HEADERS_COMPLETE:17,CB_MESSAGE_COMPLETE:18,CB_CHUNK_HEADER:19,CB_CHUNK_COMPLETE:20,PAUSED:21,PAUSED_UPGRADE:22,PAUSED_H2_UPGRADE:23,USER:24,CB_URL_COMPLETE:26,CB_STATUS_COMPLETE:27,CB_METHOD_COMPLETE:32,CB_VERSION_COMPLETE:33,CB_HEADER_FIELD_COMPLETE:28,CB_HEADER_VALUE_COMPLETE:29,CB_CHUNK_EXTENSION_NAME_COMPLETE:34,CB_CHUNK_EXTENSION_VALUE_COMPLETE:35,CB_RESET:31,CB_PROTOCOL_COMPLETE:38};He.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};He.FLAGS={CONNECTION_KEEP_ALIVE:1,CONNECTION_CLOSE:2,CONNECTION_UPGRADE:4,CHUNKED:8,UPGRADE:16,CONTENT_LENGTH:32,SKIPBODY:64,TRAILING:128,TRANSFER_ENCODING:512};He.LENIENT_FLAGS={HEADERS:1,CHUNKED_LENGTH:2,KEEP_ALIVE:4,TRANSFER_ENCODING:8,VERSION:16,DATA_AFTER_CLOSE:32,OPTIONAL_LF_AFTER_CR:64,OPTIONAL_CRLF_AFTER_CHUNK:128,OPTIONAL_CR_BEFORE_LF:256,SPACES_AFTER_CHUNK_SIZE:512};He.METHODS={DELETE:0,GET:1,HEAD:2,POST:3,PUT:4,CONNECT:5,OPTIONS:6,TRACE:7,COPY:8,LOCK:9,MKCOL:10,MOVE:11,PROPFIND:12,PROPPATCH:13,SEARCH:14,UNLOCK:15,BIND:16,REBIND:17,UNBIND:18,ACL:19,REPORT:20,MKACTIVITY:21,CHECKOUT:22,MERGE:23,"M-SEARCH":24,NOTIFY:25,SUBSCRIBE:26,UNSUBSCRIBE:27,PATCH:28,PURGE:29,MKCALENDAR:30,LINK:31,UNLINK:32,SOURCE:33,PRI:34,DESCRIBE:35,ANNOUNCE:36,SETUP:37,PLAY:38,PAUSE:39,TEARDOWN:40,GET_PARAMETER:41,SET_PARAMETER:42,REDIRECT:43,RECORD:44,FLUSH:45,QUERY:46};He.STATUSES={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,RESPONSE_IS_STALE:110,REVALIDATION_FAILED:111,DISCONNECTED_OPERATION:112,HEURISTIC_EXPIRATION:113,MISCELLANEOUS_WARNING:199,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,TRANSFORMATION_APPLIED:214,IM_USED:226,MISCELLANEOUS_PERSISTENT_WARNING:299,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,SWITCH_PROXY:306,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,PAGE_EXPIRED:419,ENHANCE_YOUR_CALM:420,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL:430,REQUEST_HEADER_FIELDS_TOO_LARGE:431,LOGIN_TIMEOUT:440,NO_RESPONSE:444,RETRY_WITH:449,BLOCKED_BY_PARENTAL_CONTROL:450,UNAVAILABLE_FOR_LEGAL_REASONS:451,CLIENT_CLOSED_LOAD_BALANCED_REQUEST:460,INVALID_X_FORWARDED_FOR:463,REQUEST_HEADER_TOO_LARGE:494,SSL_CERTIFICATE_ERROR:495,SSL_CERTIFICATE_REQUIRED:496,HTTP_REQUEST_SENT_TO_HTTPS_PORT:497,INVALID_TOKEN:498,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511,WEB_SERVER_UNKNOWN_ERROR:520,WEB_SERVER_IS_DOWN:521,CONNECTION_TIMEOUT:522,ORIGIN_IS_UNREACHABLE:523,TIMEOUT_OCCURED:524,SSL_HANDSHAKE_FAILED:525,INVALID_SSL_CERTIFICATE:526,RAILGUN_ERROR:527,SITE_IS_OVERLOADED:529,SITE_IS_FROZEN:530,IDENTITY_PROVIDER_AUTHENTICATION_ERROR:561,NETWORK_READ_TIMEOUT:598,NETWORK_CONNECT_TIMEOUT:599};He.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};He.HEADER_STATE={GENERAL:0,CONNECTION:1,CONTENT_LENGTH:2,TRANSFER_ENCODING:3,UPGRADE:4,CONNECTION_KEEP_ALIVE:5,CONNECTION_CLOSE:6,CONNECTION_UPGRADE:7,TRANSFER_ENCODING_CHUNKED:8};He.METHODS_HTTP=[He.METHODS.DELETE,He.METHODS.GET,He.METHODS.HEAD,He.METHODS.POST,He.METHODS.PUT,He.METHODS.CONNECT,He.METHODS.OPTIONS,He.METHODS.TRACE,He.METHODS.COPY,He.METHODS.LOCK,He.METHODS.MKCOL,He.METHODS.MOVE,He.METHODS.PROPFIND,He.METHODS.PROPPATCH,He.METHODS.SEARCH,He.METHODS.UNLOCK,He.METHODS.BIND,He.METHODS.REBIND,He.METHODS.UNBIND,He.METHODS.ACL,He.METHODS.REPORT,He.METHODS.MKACTIVITY,He.METHODS.CHECKOUT,He.METHODS.MERGE,He.METHODS["M-SEARCH"],He.METHODS.NOTIFY,He.METHODS.SUBSCRIBE,He.METHODS.UNSUBSCRIBE,He.METHODS.PATCH,He.METHODS.PURGE,He.METHODS.MKCALENDAR,He.METHODS.LINK,He.METHODS.UNLINK,He.METHODS.PRI,He.METHODS.SOURCE,He.METHODS.QUERY];He.METHODS_ICE=[He.METHODS.SOURCE];He.METHODS_RTSP=[He.METHODS.OPTIONS,He.METHODS.DESCRIBE,He.METHODS.ANNOUNCE,He.METHODS.SETUP,He.METHODS.PLAY,He.METHODS.PAUSE,He.METHODS.TEARDOWN,He.METHODS.GET_PARAMETER,He.METHODS.SET_PARAMETER,He.METHODS.REDIRECT,He.METHODS.RECORD,He.METHODS.FLUSH,He.METHODS.GET,He.METHODS.POST];He.METHOD_MAP=(0,mNs.enumToMap)(He.METHODS);He.H_METHOD_MAP=Object.fromEntries(Object.entries(He.METHODS).filter(([t])=>t.startsWith("H")));He.STATUSES_HTTP=[He.STATUSES.CONTINUE,He.STATUSES.SWITCHING_PROTOCOLS,He.STATUSES.PROCESSING,He.STATUSES.EARLY_HINTS,He.STATUSES.RESPONSE_IS_STALE,He.STATUSES.REVALIDATION_FAILED,He.STATUSES.DISCONNECTED_OPERATION,He.STATUSES.HEURISTIC_EXPIRATION,He.STATUSES.MISCELLANEOUS_WARNING,He.STATUSES.OK,He.STATUSES.CREATED,He.STATUSES.ACCEPTED,He.STATUSES.NON_AUTHORITATIVE_INFORMATION,He.STATUSES.NO_CONTENT,He.STATUSES.RESET_CONTENT,He.STATUSES.PARTIAL_CONTENT,He.STATUSES.MULTI_STATUS,He.STATUSES.ALREADY_REPORTED,He.STATUSES.TRANSFORMATION_APPLIED,He.STATUSES.IM_USED,He.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,He.STATUSES.MULTIPLE_CHOICES,He.STATUSES.MOVED_PERMANENTLY,He.STATUSES.FOUND,He.STATUSES.SEE_OTHER,He.STATUSES.NOT_MODIFIED,He.STATUSES.USE_PROXY,He.STATUSES.SWITCH_PROXY,He.STATUSES.TEMPORARY_REDIRECT,He.STATUSES.PERMANENT_REDIRECT,He.STATUSES.BAD_REQUEST,He.STATUSES.UNAUTHORIZED,He.STATUSES.PAYMENT_REQUIRED,He.STATUSES.FORBIDDEN,He.STATUSES.NOT_FOUND,He.STATUSES.METHOD_NOT_ALLOWED,He.STATUSES.NOT_ACCEPTABLE,He.STATUSES.PROXY_AUTHENTICATION_REQUIRED,He.STATUSES.REQUEST_TIMEOUT,He.STATUSES.CONFLICT,He.STATUSES.GONE,He.STATUSES.LENGTH_REQUIRED,He.STATUSES.PRECONDITION_FAILED,He.STATUSES.PAYLOAD_TOO_LARGE,He.STATUSES.URI_TOO_LONG,He.STATUSES.UNSUPPORTED_MEDIA_TYPE,He.STATUSES.RANGE_NOT_SATISFIABLE,He.STATUSES.EXPECTATION_FAILED,He.STATUSES.IM_A_TEAPOT,He.STATUSES.PAGE_EXPIRED,He.STATUSES.ENHANCE_YOUR_CALM,He.STATUSES.MISDIRECTED_REQUEST,He.STATUSES.UNPROCESSABLE_ENTITY,He.STATUSES.LOCKED,He.STATUSES.FAILED_DEPENDENCY,He.STATUSES.TOO_EARLY,He.STATUSES.UPGRADE_REQUIRED,He.STATUSES.PRECONDITION_REQUIRED,He.STATUSES.TOO_MANY_REQUESTS,He.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,He.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,He.STATUSES.LOGIN_TIMEOUT,He.STATUSES.NO_RESPONSE,He.STATUSES.RETRY_WITH,He.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,He.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,He.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,He.STATUSES.INVALID_X_FORWARDED_FOR,He.STATUSES.REQUEST_HEADER_TOO_LARGE,He.STATUSES.SSL_CERTIFICATE_ERROR,He.STATUSES.SSL_CERTIFICATE_REQUIRED,He.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,He.STATUSES.INVALID_TOKEN,He.STATUSES.CLIENT_CLOSED_REQUEST,He.STATUSES.INTERNAL_SERVER_ERROR,He.STATUSES.NOT_IMPLEMENTED,He.STATUSES.BAD_GATEWAY,He.STATUSES.SERVICE_UNAVAILABLE,He.STATUSES.GATEWAY_TIMEOUT,He.STATUSES.HTTP_VERSION_NOT_SUPPORTED,He.STATUSES.VARIANT_ALSO_NEGOTIATES,He.STATUSES.INSUFFICIENT_STORAGE,He.STATUSES.LOOP_DETECTED,He.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,He.STATUSES.NOT_EXTENDED,He.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,He.STATUSES.WEB_SERVER_UNKNOWN_ERROR,He.STATUSES.WEB_SERVER_IS_DOWN,He.STATUSES.CONNECTION_TIMEOUT,He.STATUSES.ORIGIN_IS_UNREACHABLE,He.STATUSES.TIMEOUT_OCCURED,He.STATUSES.SSL_HANDSHAKE_FAILED,He.STATUSES.INVALID_SSL_CERTIFICATE,He.STATUSES.RAILGUN_ERROR,He.STATUSES.SITE_IS_OVERLOADED,He.STATUSES.SITE_IS_FROZEN,He.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,He.STATUSES.NETWORK_READ_TIMEOUT,He.STATUSES.NETWORK_CONNECT_TIMEOUT];He.ALPHA=[];for(let t=65;t<=90;t++)He.ALPHA.push(String.fromCharCode(t)),He.ALPHA.push(String.fromCharCode(t+32));He.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};He.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};He.NUM=["0","1","2","3","4","5","6","7","8","9"];He.ALPHANUM=He.ALPHA.concat(He.NUM);He.MARK=["-","_",".","!","~","*","'","(",")"];He.USERINFO_CHARS=He.ALPHANUM.concat(He.MARK).concat(["%",";",":","&","=","+","$",","]);He.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(He.ALPHANUM);He.HEX=He.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);He.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(He.ALPHANUM);He.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&He.HEADER_CHARS.push(t);He.CONNECTION_TOKEN_CHARS=He.HEADER_CHARS.filter(t=>t!==44);He.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&He.QUOTED_STRING.push(t);He.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)He.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)He.HTAB_SP_VCHAR_OBS_TEXT.push(t);He.MAJOR=He.NUM_MAP;He.MINOR=He.MAJOR;He.SPECIAL_HEADERS={connection:He.HEADER_STATE.CONNECTION,"content-length":He.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":He.HEADER_STATE.CONNECTION,"transfer-encoding":He.HEADER_STATE.TRANSFER_ENCODING,upgrade:He.HEADER_STATE.UPGRADE};He.default={ERROR:He.ERROR,TYPE:He.TYPE,FLAGS:He.FLAGS,LENIENT_FLAGS:He.LENIENT_FLAGS,METHODS:He.METHODS,STATUSES:He.STATUSES,FINISH:He.FINISH,HEADER_STATE:He.HEADER_STATE,ALPHA:He.ALPHA,NUM_MAP:He.NUM_MAP,HEX_MAP:He.HEX_MAP,NUM:He.NUM,ALPHANUM:He.ALPHANUM,MARK:He.MARK,USERINFO_CHARS:He.USERINFO_CHARS,URL_CHAR:He.URL_CHAR,HEX:He.HEX,TOKEN:He.TOKEN,HEADER_CHARS:He.HEADER_CHARS,CONNECTION_TOKEN_CHARS:He.CONNECTION_TOKEN_CHARS,QUOTED_STRING:He.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:He.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:He.MAJOR,MINOR:He.MINOR,SPECIAL_HEADERS:He.SPECIAL_HEADERS,METHODS_HTTP:He.METHODS_HTTP,METHODS_ICE:He.METHODS_ICE,METHODS_RTSP:He.METHODS_RTSP,METHOD_MAP:He.METHOD_MAP,H_METHOD_MAP:He.H_METHOD_MAP,STATUSES_HTTP:He.STATUSES_HTTP}});var Ucr=I((JAf,lHn)=>{"use strict";p();var{Buffer:gNs}=require("node:buffer"),ANs="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCq/ZAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAygCHCICQQJrDvwBAfkBAgMEBQYHCAkKCwwNDg8QERL4ARP3ARQV9gEWF/UBGBkaGxwdHh8g/QH7ASH0ASIjJCUmJygpKivzASwtLi8wMTLyAfEBMzTwAe8BNTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5P+gFQUVJT7gHtAVTsAVXrAVZXWFla6gFbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHpAegBzwHnAdAB5gHRAdIB0wHUAeUB1QHWAdcB2AHZAdoB2wHcAd0B3gHfAeAB4QHiAeMBAPwBC0EADOMBC0EODOIBC0ENDOEBC0EPDOABC0EQDN8BC0ETDN4BC0EUDN0BC0EVDNwBC0EWDNsBC0EXDNoBC0EYDNkBC0EZDNgBC0EaDNcBC0EbDNYBC0EcDNUBC0EdDNQBC0EeDNMBC0EfDNIBC0EgDNEBC0EhDNABC0EIDM8BC0EiDM4BC0EkDM0BC0EjDMwBC0EHDMsBC0ElDMoBC0EmDMkBC0EnDMgBC0EoDMcBC0ESDMYBC0ERDMUBC0EpDMQBC0EqDMMBC0ErDMIBC0EsDMEBC0HeAQzAAQtBLgy/AQtBLwy+AQtBMAy9AQtBMQy8AQtBMgy7AQtBMwy6AQtBNAy5AQtB3wEMuAELQTUMtwELQTkMtgELQQwMtQELQTYMtAELQTcMswELQTgMsgELQT4MsQELQToMsAELQeABDK8BC0ELDK4BC0E/DK0BC0E7DKwBC0EKDKsBC0E8DKoBC0E9DKkBC0HhAQyoAQtBwQAMpwELQcAADKYBC0HCAAylAQtBCQykAQtBLQyjAQtBwwAMogELQcQADKEBC0HFAAygAQtBxgAMnwELQccADJ4BC0HIAAydAQtByQAMnAELQcoADJsBC0HLAAyaAQtBzAAMmQELQc0ADJgBC0HOAAyXAQtBzwAMlgELQdAADJUBC0HRAAyUAQtB0gAMkwELQdMADJIBC0HVAAyRAQtB1AAMkAELQdYADI8BC0HXAAyOAQtB2AAMjQELQdkADIwBC0HaAAyLAQtB2wAMigELQdwADIkBC0HdAAyIAQtB3gAMhwELQd8ADIYBC0HgAAyFAQtB4QAMhAELQeIADIMBC0HjAAyCAQtB5AAMgQELQeUADIABC0HiAQx/C0HmAAx+C0HnAAx9C0EGDHwLQegADHsLQQUMegtB6QAMeQtBBAx4C0HqAAx3C0HrAAx2C0HsAAx1C0HtAAx0C0EDDHMLQe4ADHILQe8ADHELQfAADHALQfIADG8LQfEADG4LQfMADG0LQfQADGwLQfUADGsLQfYADGoLQQIMaQtB9wAMaAtB+AAMZwtB+QAMZgtB+gAMZQtB+wAMZAtB/AAMYwtB/QAMYgtB/gAMYQtB/wAMYAtBgAEMXwtBgQEMXgtBggEMXQtBgwEMXAtBhAEMWwtBhQEMWgtBhgEMWQtBhwEMWAtBiAEMVwtBiQEMVgtBigEMVQtBiwEMVAtBjAEMUwtBjQEMUgtBjgEMUQtBjwEMUAtBkAEMTwtBkQEMTgtBkgEMTQtBkwEMTAtBlAEMSwtBlQEMSgtBlgEMSQtBlwEMSAtBmAEMRwtBmQEMRgtBmgEMRQtBmwEMRAtBnAEMQwtBnQEMQgtBngEMQQtBnwEMQAtBoAEMPwtBoQEMPgtBogEMPQtBowEMPAtBpAEMOwtBpQEMOgtBpgEMOQtBpwEMOAtBqAEMNwtBqQEMNgtBqgEMNQtBqwEMNAtBrAEMMwtBrQEMMgtBrgEMMQtBrwEMMAtBsAEMLwtBsQEMLgtBsgEMLQtBswEMLAtBtAEMKwtBtQEMKgtBtgEMKQtBtwEMKAtBuAEMJwtBuQEMJgtBugEMJQtBuwEMJAtBvAEMIwtBvQEMIgtBvgEMIQtBvwEMIAtBwAEMHwtBwQEMHgtBwgEMHQtBAQwcC0HDAQwbC0HEAQwaC0HFAQwZC0HGAQwYC0HHAQwXC0HIAQwWC0HJAQwVC0HKAQwUC0HLAQwTC0HMAQwSC0HNAQwRC0HOAQwQC0HPAQwPC0HQAQwOC0HRAQwNC0HSAQwMC0HTAQwLC0HUAQwKC0HVAQwJC0HWAQwIC0HjAQwHC0HXAQwGC0HYAQwFC0HZAQwEC0HaAQwDC0HbAQwCC0HdAQwBC0HcAQshAgNAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJ/AkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAg7jAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEjJCUnKCmeA5sDmgORA4oDgwOAA/0C+wL4AvIC8QLvAu0C6ALnAuYC5QLkAtwC2wLaAtkC2ALXAtYC1QLPAs4CzALLAsoCyQLIAscCxgLEAsMCvgK8AroCuQK4ArcCtgK1ArQCswKyArECsAKuAq0CqQKoAqcCpgKlAqQCowKiAqECoAKfApgCkAKMAosCigKBAv4B/QH8AfsB+gH5AfgB9wH1AfMB8AHrAekB6AHnAeYB5QHkAeMB4gHhAeAB3wHeAd0B3AHaAdkB2AHXAdYB1QHUAdMB0gHRAdABzwHOAc0BzAHLAcoByQHIAccBxgHFAcQBwwHCAcEBwAG/Ab4BvQG8AbsBugG5AbgBtwG2AbUBtAGzAbIBsQGwAa8BrgGtAawBqwGqAakBqAGnAaYBpQGkAaMBogGfAZ4BmQGYAZcBlgGVAZQBkwGSAZEBkAGPAY0BjAGHAYYBhQGEAYMBggF9fHt6eXZ1dFBRUlNUVQsgASAERw1yQf0BIQIMvgMLIAEgBEcNmAFB2wEhAgy9AwsgASAERw3xAUGOASECDLwDCyABIARHDfwBQYQBIQIMuwMLIAEgBEcNigJB/wAhAgy6AwsgASAERw2RAkH9ACECDLkDCyABIARHDZQCQfsAIQIMuAMLIAEgBEcNHkEeIQIMtwMLIAEgBEcNGUEYIQIMtgMLIAEgBEcNygJBzQAhAgy1AwsgASAERw3VAkHGACECDLQDCyABIARHDdYCQcMAIQIMswMLIAEgBEcN3AJBOCECDLIDCyADLQAwQQFGDa0DDIkDC0EAIQACQAJAAkAgAy0AKkUNACADLQArRQ0AIAMvATIiAkECcUUNAQwCCyADLwEyIgJBAXFFDQELQQEhACADLQAoQQFGDQAgAy8BNCIGQeQAa0HkAEkNACAGQcwBRg0AIAZBsAJGDQAgAkHAAHENAEEAIQAgAkGIBHFBgARGDQAgAkEocUEARyEACyADQQA7ATIgA0EAOgAxAkAgAEUEQCADQQA6ADEgAy0ALkEEcQ0BDLEDCyADQgA3AyALIANBADoAMSADQQE6ADYMSAtBACEAAkAgAygCOCICRQ0AIAIoAjAiAkUNACADIAIRAAAhAAsgAEUNSCAAQRVHDWIgA0EENgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMrwMLIAEgBEYEQEEGIQIMrwMLIAEtAABBCkcNGSABQQFqIQEMGgsgA0IANwMgQRIhAgyUAwsgASAERw2KA0EjIQIMrAMLIAEgBEYEQEEHIQIMrAMLAkACQCABLQAAQQprDgQBGBgAGAsgAUEBaiEBQRAhAgyTAwsgAUEBaiEBIANBL2otAABBAXENF0EAIQIgA0EANgIcIAMgATYCFCADQZkgNgIQIANBGTYCDAyrAwsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFoNGEEIIQIMqgMLIAEgBEcEQCADQQk2AgggAyABNgIEQRQhAgyRAwtBCSECDKkDCyADKQMgUA2uAgxDCyABIARGBEBBCyECDKgDCyABLQAAQQpHDRYgAUEBaiEBDBcLIANBL2otAABBAXFFDRkMJgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0ZDEILQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGgwkC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRsMMgsgA0Evai0AAEEBcUUNHAwiC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADRwMQgtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0dDCALIAEgBEYEQEETIQIMoAMLAkAgAS0AACIAQQprDgQfIyMAIgsgAUEBaiEBDB8LQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIgxCCyABIARGBEBBFiECDJ4DCyABLQAAQcDBAGotAABBAUcNIwyDAwsCQANAIAEtAABBsDtqLQAAIgBBAUcEQAJAIABBAmsOAgMAJwsgAUEBaiEBQSEhAgyGAwsgBCABQQFqIgFHDQALQRghAgydAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAFBAWoiARA0IgANIQxBC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADSMMKgsgASAERgRAQRwhAgybAwsgA0EKNgIIIAMgATYCBEEAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADSVBJCECDIEDCyABIARHBEADQCABLQAAQbA9ai0AACIAQQNHBEAgAEEBaw4FGBomggMlJgsgBCABQQFqIgFHDQALQRshAgyaAwtBGyECDJkDCwNAIAEtAABBsD9qLQAAIgBBA0cEQCAAQQFrDgUPEScTJicLIAQgAUEBaiIBRw0AC0EeIQIMmAMLIAEgBEcEQCADQQs2AgggAyABNgIEQQchAgz/AgtBHyECDJcDCyABIARGBEBBICECDJcDCwJAIAEtAABBDWsOFC4/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8APwtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQMlgMLIANBL2ohAgNAIAEgBEYEQEEhIQIMlwMLAkACQAJAIAEtAAAiAEEJaw4YAgApKQEpKSkpKSkpKSkpKSkpKSkpKSkCJwsgAUEBaiEBIANBL2otAABBAXFFDQoMGAsgAUEBaiEBDBcLIAFBAWohASACLQAAQQJxDQALQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDJUDCyADLQAuQYABcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUN5gIgAEEVRgRAIANBJDYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDJQDC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAyTAwtBACECIANBADYCHCADIAE2AhQgA0G+IDYCECADQQI2AgwMkgMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABIAynaiIBEDIiAEUNKyADQQc2AhwgAyABNgIUIAMgADYCDAyRAwsgAy0ALkHAAHFFDQELQQAhAAJAIAMoAjgiAkUNACACKAJYIgJFDQAgAyACEQAAIQALIABFDSsgAEEVRgRAIANBCjYCHCADIAE2AhQgA0HrGTYCECADQRU2AgxBACECDJADC0EAIQIgA0EANgIcIAMgATYCFCADQZMMNgIQIANBEzYCDAyPAwtBACECIANBADYCHCADIAE2AhQgA0GCFTYCECADQQI2AgwMjgMLQQAhAiADQQA2AhwgAyABNgIUIANB3RQ2AhAgA0EZNgIMDI0DC0EAIQIgA0EANgIcIAMgATYCFCADQeYdNgIQIANBGTYCDAyMAwsgAEEVRg09QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIsDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFDSggA0ENNgIcIAMgATYCFCADIAA2AgwMigMLIABBFUYNOkEAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAyJAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwoCyADQQ42AhwgAyAANgIMIAMgAUEBajYCFAyIAwsgAEEVRg03QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIcDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCcLIANBDzYCHCADIAA2AgwgAyABQQFqNgIUDIYDC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAyFAwsgAEEVRg0zQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIQDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFDSUgA0ERNgIcIAMgATYCFCADIAA2AgwMgwMLIABBFUYNMEEAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAyCAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwlCyADQRI2AhwgAyAANgIMIAMgAUEBajYCFAyBAwsgA0Evai0AAEEBcUUNAQtBFyECDOYCC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAz+AgsgAEE7Rw0AIAFBAWohAQwMC0EAIQIgA0EANgIcIAMgATYCFCADQZIYNgIQIANBAjYCDAz8AgsgAEEVRg0oQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDPsCCyADQRQ2AhwgAyABNgIUIAMgADYCDAz6AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQz1AgsgA0EVNgIcIAMgADYCDCADIAFBAWo2AhQM+QILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM8wILIANBFzYCHCADIAA2AgwgAyABQQFqNgIUDPgCCyAAQRVGDSNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM9wILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEMHQsgA0EZNgIcIAMgADYCDCADIAFBAWo2AhQM9gILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM7wILIANBGjYCHCADIAA2AgwgAyABQQFqNgIUDPUCCyAAQRVGDR9BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwM9AILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwbCyADQRw2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8wILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQzrAgsgA0EdNgIcIAMgADYCDCADIAFBAWo2AhRBACECDPICCyAAQTtHDQEgAUEBaiEBC0EmIQIM1wILQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDO8CCyABIARHBEADQCABLQAAQSBHDYQCIAQgAUEBaiIBRw0AC0EsIQIM7wILQSwhAgzuAgsgASAERgRAQTQhAgzuAgsCQAJAA0ACQCABLQAAQQprDgQCAAADAAsgBCABQQFqIgFHDQALQTQhAgzvAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDZ8CIANBMjYCHCADIAE2AhQgAyAANgIMQQAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDJ8CCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM7QILIAEgBEcEQAJAA0AgAS0AAEEwayIAQf8BcUEKTwRAQTohAgzXAgsgAykDICILQpmz5syZs+bMGVYNASADIAtCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAMgCiALfDcDICAEIAFBAWoiAUcNAAtBwAAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgAUEBaiIBEDEiAA0XDOICC0HAACECDOwCCyABIARGBEBByQAhAgzsAgsCQANAAkAgAS0AAEEJaw4YAAKiAqICqQKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogIAogILIAQgAUEBaiIBRw0AC0HJACECDOwCCyABQQFqIQEgA0Evai0AAEEBcQ2lAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgzrAgsgASAERwRAA0AgAS0AAEEgRw0VIAQgAUEBaiIBRw0AC0H4ACECDOsCC0H4ACECDOoCCyADQQI6ACgMOAtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQM6AILQQAhAgzOAgtBDSECDM0CC0ETIQIMzAILQRUhAgzLAgtBFiECDMoCC0EYIQIMyQILQRkhAgzIAgtBGiECDMcCC0EbIQIMxgILQRwhAgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIAMgADYCDEEAIQIMwgILQfQBIQIgASAERg3BAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEG41QBqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzCAgsgA0GBBDsBKCADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIADQMMAgsgA0EANgIAC0EAIQIgA0EANgIcIAMgATYCFCADQeUfNgIQIANBCDYCDAy/AgtB1QEhAgylAgsgA0HzATYCHCADIAE2AhQgAyAANgIMQQAhAgy9AgtBACEAAkAgAygCOCICRQ0AIAIoAkAiAkUNACADIAIRAAAhAAsgAEUNbiAAQRVHBEAgA0EANgIcIAMgATYCFCADQYIPNgIQIANBIDYCDEEAIQIMvQILIANBjwE2AhwgAyABNgIUIANB7Bs2AhAgA0EVNgIMQQAhAgy8AgsgASAERwRAIANBDTYCCCADIAE2AgRB0wEhAgyjAgtB8gEhAgy7AgsgASAERgRAQfEBIQIMuwILAkACQAJAIAEtAABByABrDgsAAQgICAgICAgIAggLIAFBAWohAUHQASECDKMCCyABQQFqIQFB0QEhAgyiAgsgAUEBaiEBQdIBIQIMoQILQfABIQIgASAERg25AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBtdUAai0AAEcNBCAAQQJGDQMgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuQILQe8BIQIgASAERg24AiADKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABBs9UAai0AAEcNAyAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuAILQe4BIQIgASAERg23AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMtwILIAMoAgQhACADQgA3AwAgAyAAIAVBAWoiARArIgBFDQIgA0HsATYCHCADIAE2AhQgAyAANgIMQQAhAgy2AgsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNnAIgA0HtATYCHCADIAE2AhQgAyAANgIMQQAhAgy0AgtBzwEhAgyaAgtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4wE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ2YAiADQeQBNgIcIAMgATYCFCADIAA2AgwMrQILQckBIQIMkwILQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgytAgtByAEhAgyTAgsgA0HhATYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDKsCCyABIARGBEBB4QEhAgyrAgsCQCABLQAAQSBGBEAgA0EAOwE0IAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBmRE2AhAgA0EJNgIMQQAhAgyrAgtBxwEhAgyRAgsgASAERgRAQeABIQIMqgILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyrAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqgILQcYBIQIMkAILIAEgBEYEQEHfASECDKkCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqgILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKkCC0HFASECDI8CCyABIARGBEBB3gEhAgyoAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKkCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyoAgtBxAEhAgyOAgsgASAERgRAQd0BIQIMpwILAkACQAJAAkAgAS0AAEEKaw4XAgMDAAMDAwMDAwMDAwMDAwMDAwMDAwEDCyABQQFqDAULIAFBAWohAUHDASECDI8CCyABQQFqIQEgA0Evai0AAEEBcQ0IIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKcCCyADQQA2AhwgAyABNgIUIANBjQs2AhAgA0ENNgIMQQAhAgymAgsgASAERwRAIANBDzYCCCADIAE2AgRBASECDI0CC0HcASECDKUCCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBAWohAQwBCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAjwiAkUNACADIAIRAAAhAAsgAEUNoAEgAEEVRgRAIANB2QA2AhwgAyABNgIUIANBtxo2AhAgA0EVNgIMQQAhAgyfAgsgA0EANgIcIAMgATYCFCADQYANNgIQIANBGzYCDEEAIQIMngILIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDJ0CCyABIARHBEAgA0EMNgIIIAMgATYCBEG/ASECDIQCC0HYASECDJwCCyABIARGBEBB1wEhAgycAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBwQBrDhUAAQIDWgQFBlpaWgcICQoLDA0ODxBaCyABQQFqIQFB+wAhAgySAgsgAUEBaiEBQfwAIQIMkQILIAFBAWohAUGBASECDJACCyABQQFqIQFBhQEhAgyPAgsgAUEBaiEBQYYBIQIMjgILIAFBAWohAUGJASECDI0CCyABQQFqIQFBigEhAgyMAgsgAUEBaiEBQY0BIQIMiwILIAFBAWohAUGWASECDIoCCyABQQFqIQFBlwEhAgyJAgsgAUEBaiEBQZgBIQIMiAILIAFBAWohAUGlASECDIcCCyABQQFqIQFBpgEhAgyGAgsgAUEBaiEBQawBIQIMhQILIAFBAWohAUG0ASECDIQCCyABQQFqIQFBtwEhAgyDAgsgAUEBaiEBQb4BIQIMggILIAEgBEYEQEHWASECDJsCCyABLQAAQc4ARw1IIAFBAWohAUG9ASECDIECCyABIARGBEBB1QEhAgyaAgsCQAJAAkAgAS0AAEHCAGsOEgBKSkpKSkpKSkoBSkpKSkpKAkoLIAFBAWohAUG4ASECDIICCyABQQFqIQFBuwEhAgyBAgsgAUEBaiEBQbwBIQIMgAILQdQBIQIgASAERg2YAiADKAIAIgAgBCABa2ohBSABIABrQQdqIQYCQANAIAEtAAAgAEGo1QBqLQAARw1FIABBB0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAgsgA0EANgIAIAZBAWohAUEbDEULIAEgBEYEQEHTASECDJgCCwJAAkAgAS0AAEHJAGsOBwBHR0dHRwFHCyABQQFqIQFBuQEhAgz/AQsgAUEBaiEBQboBIQIM/gELQdIBIQIgASAERg2WAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw1DIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyXAgsgA0EANgIAIAZBAWohAUEPDEMLQdEBIQIgASAERg2VAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw1CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyWAgsgA0EANgIAIAZBAWohAUEgDEILQdABIQIgASAERg2UAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw1BIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyVAgsgA0EANgIAIAZBAWohAUESDEELIAEgBEYEQEHPASECDJQCCwJAAkAgAS0AAEHFAGsODgBDQ0NDQ0NDQ0NDQ0MBQwsgAUEBaiEBQbUBIQIM+wELIAFBAWohAUG2ASECDPoBC0HOASECIAEgBEYNkgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBntUAai0AAEcNPyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkwILIANBADYCACAGQQFqIQFBBww/C0HNASECIAEgBEYNkQIgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBmNUAai0AAEcNPiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkgILIANBADYCACAGQQFqIQFBKAw+CyABIARGBEBBzAEhAgyRAgsCQAJAAkAgAS0AAEHFAGsOEQBBQUFBQUFBQUEBQUFBQUECQQsgAUEBaiEBQbEBIQIM+QELIAFBAWohAUGyASECDPgBCyABQQFqIQFBswEhAgz3AQtBywEhAiABIARGDY8CIAMoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQZHVAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJACCyADQQA2AgAgBkEBaiEBQRoMPAtBygEhAiABIARGDY4CIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQY3VAGotAABHDTsgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADI8CCyADQQA2AgAgBkEBaiEBQSEMOwsgASAERgRAQckBIQIMjgILAkACQCABLQAAQcEAaw4UAD09PT09PT09PT09PT09PT09PQE9CyABQQFqIQFBrQEhAgz1AQsgAUEBaiEBQbABIQIM9AELIAEgBEYEQEHIASECDI0CCwJAAkAgAS0AAEHVAGsOCwA8PDw8PDw8PDwBPAsgAUEBaiEBQa4BIQIM9AELIAFBAWohAUGvASECDPMBC0HHASECIAEgBEYNiwIgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNOCAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjAILIANBADYCACAGQQFqIQFBKgw4CyABIARGBEBBxgEhAgyLAgsgAS0AAEHQAEcNOCABQQFqIQFBJQw3C0HFASECIAEgBEYNiQIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBgdUAai0AAEcNNiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMigILIANBADYCACAGQQFqIQFBDgw2CyABIARGBEBBxAEhAgyJAgsgAS0AAEHFAEcNNiABQQFqIQFBqwEhAgzvAQsgASAERgRAQcMBIQIMiAILAkACQAJAAkAgAS0AAEHCAGsODwABAjk5OTk5OTk5OTk5AzkLIAFBAWohAUGnASECDPEBCyABQQFqIQFBqAEhAgzwAQsgAUEBaiEBQakBIQIM7wELIAFBAWohAUGqASECDO4BC0HCASECIAEgBEYNhgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB/tQAai0AAEcNMyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhwILIANBADYCACAGQQFqIQFBFAwzC0HBASECIAEgBEYNhQIgAygCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABB+dQAai0AAEcNMiAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhgILIANBADYCACAGQQFqIQFBKwwyC0HAASECIAEgBEYNhAIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB9tQAai0AAEcNMSAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhQILIANBADYCACAGQQFqIQFBLAwxC0G/ASECIAEgBEYNgwIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNMCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhAILIANBADYCACAGQQFqIQFBEQwwC0G+ASECIAEgBEYNggIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB8tQAai0AAEcNLyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgwILIANBADYCACAGQQFqIQFBLgwvCyABIARGBEBBvQEhAgyCAgsCQAJAAkACQAJAIAEtAABBwQBrDhUANDQ0NDQ0NDQ0NAE0NAI0NAM0NAQ0CyABQQFqIQFBmwEhAgzsAQsgAUEBaiEBQZwBIQIM6wELIAFBAWohAUGdASECDOoBCyABQQFqIQFBogEhAgzpAQsgAUEBaiEBQaQBIQIM6AELIAEgBEYEQEG8ASECDIECCwJAAkAgAS0AAEHSAGsOAwAwATALIAFBAWohAUGjASECDOgBCyABQQFqIQFBBAwtC0G7ASECIAEgBEYN/wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8NQAai0AAEcNLCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgAILIANBADYCACAGQQFqIQFBHQwsCyABIARGBEBBugEhAgz/AQsCQAJAIAEtAABByQBrDgcBLi4uLi4ALgsgAUEBaiEBQaEBIQIM5gELIAFBAWohAUEiDCsLIAEgBEYEQEG5ASECDP4BCyABLQAAQdAARw0rIAFBAWohAUGgASECDOQBCyABIARGBEBBuAEhAgz9AQsCQAJAIAEtAABBxgBrDgsALCwsLCwsLCwsASwLIAFBAWohAUGeASECDOQBCyABQQFqIQFBnwEhAgzjAQtBtwEhAiABIARGDfsBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQezUAGotAABHDSggAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPwBCyADQQA2AgAgBkEBaiEBQQ0MKAtBtgEhAiABIARGDfoBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDScgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPsBCyADQQA2AgAgBkEBaiEBQQwMJwtBtQEhAiABIARGDfkBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQerUAGotAABHDSYgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPoBCyADQQA2AgAgBkEBaiEBQQMMJgtBtAEhAiABIARGDfgBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQejUAGotAABHDSUgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPkBCyADQQA2AgAgBkEBaiEBQSYMJQsgASAERgRAQbMBIQIM+AELAkACQCABLQAAQdQAaw4CAAEnCyABQQFqIQFBmQEhAgzfAQsgAUEBaiEBQZoBIQIM3gELQbIBIQIgASAERg32ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHm1ABqLQAARw0jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz3AQsgA0EANgIAIAZBAWohAUEnDCMLQbEBIQIgASAERg31ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHk1ABqLQAARw0iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz2AQsgA0EANgIAIAZBAWohAUEcDCILQbABIQIgASAERg30ASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHe1ABqLQAARw0hIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz1AQsgA0EANgIAIAZBAWohAUEGDCELQa8BIQIgASAERg3zASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHZ1ABqLQAARw0gIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz0AQsgA0EANgIAIAZBAWohAUEZDCALIAEgBEYEQEGuASECDPMBCwJAAkACQAJAIAEtAABBLWsOIwAkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJAEkJCQkJAIkJCQDJAsgAUEBaiEBQY4BIQIM3AELIAFBAWohAUGPASECDNsBCyABQQFqIQFBlAEhAgzaAQsgAUEBaiEBQZUBIQIM2QELQa0BIQIgASAERg3xASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHX1ABqLQAARw0eIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzyAQsgA0EANgIAIAZBAWohAUELDB4LIAEgBEYEQEGsASECDPEBCwJAAkAgAS0AAEHBAGsOAwAgASALIAFBAWohAUGQASECDNgBCyABQQFqIQFBkwEhAgzXAQsgASAERgRAQasBIQIM8AELAkACQCABLQAAQcEAaw4PAB8fHx8fHx8fHx8fHx8BHwsgAUEBaiEBQZEBIQIM1wELIAFBAWohAUGSASECDNYBCyABIARGBEBBqgEhAgzvAQsgAS0AAEHMAEcNHCABQQFqIQFBCgwbC0GpASECIAEgBEYN7QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABB0dQAai0AAEcNGiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7gELIANBADYCACAGQQFqIQFBHgwaC0GoASECIAEgBEYN7AEgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBytQAai0AAEcNGSAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7QELIANBADYCACAGQQFqIQFBFQwZC0GnASECIAEgBEYN6wEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBx9QAai0AAEcNGCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7AELIANBADYCACAGQQFqIQFBFwwYC0GmASECIAEgBEYN6gEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBwdQAai0AAEcNFyAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6wELIANBADYCACAGQQFqIQFBGAwXCyABIARGBEBBpQEhAgzqAQsCQAJAIAEtAABByQBrDgcAGRkZGRkBGQsgAUEBaiEBQYsBIQIM0QELIAFBAWohAUGMASECDNABC0GkASECIAEgBEYN6AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBptUAai0AAEcNFSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6QELIANBADYCACAGQQFqIQFBCQwVC0GjASECIAEgBEYN5wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBpNUAai0AAEcNFCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6AELIANBADYCACAGQQFqIQFBHwwUC0GiASECIAEgBEYN5gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBvtQAai0AAEcNEyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5wELIANBADYCACAGQQFqIQFBAgwTC0GhASECIAEgBEYN5QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGA0AgAS0AACAAQbzUAGotAABHDREgAEEBRg0CIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADOUBCyABIARGBEBBoAEhAgzlAQtBASABLQAAQd8ARw0RGiABQQFqIQFBhwEhAgzLAQsgA0EANgIAIAZBAWohAUGIASECDMoBC0GfASECIAEgBEYN4gEgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNDyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4wELIANBADYCACAGQQFqIQFBKQwPC0GeASECIAEgBEYN4QEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBuNQAai0AAEcNDiAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4gELIANBADYCACAGQQFqIQFBLQwOCyABIARGBEBBnQEhAgzhAQsgAS0AAEHFAEcNDiABQQFqIQFBhAEhAgzHAQsgASAERgRAQZwBIQIM4AELAkACQCABLQAAQcwAaw4IAA8PDw8PDwEPCyABQQFqIQFBggEhAgzHAQsgAUEBaiEBQYMBIQIMxgELQZsBIQIgASAERg3eASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEGz1ABqLQAARw0LIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzfAQsgA0EANgIAIAZBAWohAUEjDAsLQZoBIQIgASAERg3dASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGw1ABqLQAARw0KIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzeAQsgA0EANgIAIAZBAWohAUEADAoLIAEgBEYEQEGZASECDN0BCwJAAkAgAS0AAEHIAGsOCAAMDAwMDAwBDAsgAUEBaiEBQf0AIQIMxAELIAFBAWohAUGAASECDMMBCyABIARGBEBBmAEhAgzcAQsCQAJAIAEtAABBzgBrDgMACwELCyABQQFqIQFB/gAhAgzDAQsgAUEBaiEBQf8AIQIMwgELIAEgBEYEQEGXASECDNsBCyABLQAAQdkARw0IIAFBAWohAUEIDAcLQZYBIQIgASAERg3ZASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEGs1ABqLQAARw0GIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzaAQsgA0EANgIAIAZBAWohAUEFDAYLQZUBIQIgASAERg3YASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGm1ABqLQAARw0FIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzZAQsgA0EANgIAIAZBAWohAUEWDAULQZQBIQIgASAERg3XASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0EIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzYAQsgA0EANgIAIAZBAWohAUEQDAQLIAEgBEYEQEGTASECDNcBCwJAAkAgAS0AAEHDAGsODAAGBgYGBgYGBgYGAQYLIAFBAWohAUH5ACECDL4BCyABQQFqIQFB+gAhAgy9AQtBkgEhAiABIARGDdUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUYNASADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgzOAQtB9wAhAgy0AQsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDMwBCyABIARGBEBBjwEhAgzMAQsCQCABLQAAQSBGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GbHzYCECADQQY2AgxBACECDMwBC0ECIQIMsgELA0AgAS0AAEEgRw0CIAQgAUEBaiIBRw0AC0GOASECDMoBCyABIARGBEBBjQEhAgzKAQsCQCABLQAAQQlrDgRKAABKAAtB9QAhAgywAQsgAy0AKUEFRgRAQfYAIQIMsAELQfQAIQIMrwELIAEgBEYEQEGMASECDMgBCyADQRA2AgggAyABNgIEDAoLIAEgBEYEQEGLASECDMcBCwJAIAEtAABBCWsOBEcAAEcAC0HzACECDK0BCyABIARHBEAgA0EQNgIIIAMgATYCBEHxACECDK0BC0GKASECDMUBCwJAIAEgBEcEQANAIAEtAABBoNAAai0AACIAQQNHBEACQCAAQQFrDgJJAAQLQfAAIQIMrwELIAQgAUEBaiIBRw0AC0GIASECDMYBC0GIASECDMUBCyADQQA2AhwgAyABNgIUIANB2yA2AhAgA0EHNgIMQQAhAgzEAQsgASAERgRAQYkBIQIMxAELAkACQAJAIAEtAABBoNIAai0AAEEBaw4DRgIAAQtB8gAhAgysAQsgA0EANgIcIAMgATYCFCADQbQSNgIQIANBBzYCDEEAIQIMxAELQeoAIQIMqgELIAEgBEcEQCABQQFqIQFB7wAhAgyqAQtBhwEhAgzCAQsgBCABIgBGBEBBhgEhAgzCAQsgAC0AACIBQS9GBEAgAEEBaiEBQe4AIQIMqQELIAFBCWsiAkEXSw0BIAAhAUEBIAJ0QZuAgARxDUEMAQsgBCABIgBGBEBBhQEhAgzBAQsgAC0AAEEvRw0AIABBAWohAQwDC0EAIQIgA0EANgIcIAMgADYCFCADQdsgNgIQIANBBzYCDAy/AQsCQAJAAkACQAJAA0AgAS0AAEGgzgBqLQAAIgBBBUcEQAJAAkAgAEEBaw4IRwUGBwgABAEIC0HrACECDK0BCyABQQFqIQFB7QAhAgysAQsgBCABQQFqIgFHDQALQYQBIQIMwwELIAFBAWoMFAsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgzBAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgzAAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy/AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMvgELIAEgBEYEQEGDASECDL4BCwJAIAEtAABBoM4Aai0AAEEBaw4IPgQFBgAIAgMHCyABQQFqIQELQQMhAgyjAQsgAUEBagwNC0EAIQIgA0EANgIcIANB0RI2AhAgA0EHNgIMIAMgAUEBajYCFAy6AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgy5AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgy4AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy3AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMtgELQewAIQIMnAELIAEgBEYEQEGCASECDLUBCyABQQFqDAILIAEgBEYEQEGBASECDLQBCyABQQFqDAELIAEgBEYNASABQQFqCyEBQQQhAgyYAQtBgAEhAgywAQsDQCABLQAAQaDMAGotAAAiAEECRwRAIABBAUcEQEHpACECDJkBCwwxCyAEIAFBAWoiAUcNAAtB/wAhAgyvAQsgASAERgRAQf4AIQIMrwELAkAgAS0AAEEJaw43LwMGLwQGBgYGBgYGBgYGBgYGBgYGBgYFBgYCBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAAYLIAFBAWoLIQFBBSECDJQBCyABQQFqDAYLIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIANBADYCHCADIAE2AhQgA0GNFDYCECADQQc2AgxBACECDKgBCwJAAkACQAJAA0AgAS0AAEGgygBqLQAAIgBBBUcEQAJAIABBAWsOBi4DBAUGAAYLQegAIQIMlAELIAQgAUEBaiIBRw0AC0H9ACECDKsBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQdsANgIcIAMgATYCFCADIAA2AgxBACECDKoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDKkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQfoANgIcIAMgATYCFCADIAA2AgxBACECDKgBCyADQQA2AhwgAyABNgIUIANB5Ag2AhAgA0EHNgIMQQAhAgynAQsgASAERg0BIAFBAWoLIQFBBiECDIwBC0H8ACECDKQBCwJAAkACQAJAA0AgAS0AAEGgyABqLQAAIgBBBUcEQCAAQQFrDgQpAgMEBQsgBCABQQFqIgFHDQALQfsAIQIMpwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMpgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMpQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMpAELIANBADYCHCADIAE2AhQgA0G8CjYCECADQQc2AgxBACECDKMBC0HPACECDIkBC0HRACECDIgBC0HnACECDIcBCyABIARGBEBB+gAhAgygAQsCQCABLQAAQQlrDgQgAAAgAAsgAUEBaiEBQeYAIQIMhgELIAEgBEYEQEH5ACECDJ8BCwJAIAEtAABBCWsOBB8AAB8AC0EAIQACQCADKAI4IgJFDQAgAigCOCICRQ0AIAMgAhEAACEACyAARQRAQeIBIQIMhgELIABBFUcEQCADQQA2AhwgAyABNgIUIANByQ02AhAgA0EaNgIMQQAhAgyfAQsgA0H4ADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDJ4BCyABIARHBEAgA0ENNgIIIAMgATYCBEHkACECDIUBC0H3ACECDJ0BCyABIARGBEBB9gAhAgydAQsCQAJAAkAgAS0AAEHIAGsOCwABCwsLCwsLCwsCCwsgAUEBaiEBQd0AIQIMhQELIAFBAWohAUHgACECDIQBCyABQQFqIQFB4wAhAgyDAQtB9QAhAiABIARGDZsBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbXVAGotAABHDQggAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJwBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIABEAgA0H0ADYCHCADIAE2AhQgAyAANgIMQQAhAgycAQtB4gAhAgyCAQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJwBC0HhACECDIIBCyADQfMANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMmgELIAMtACkiAEEja0ELSQ0JAkAgAEEGSw0AQQEgAHRBygBxRQ0ADAoLQQAhAiADQQA2AhwgAyABNgIUIANB7Qk2AhAgA0EINgIMDJkBC0HyACECIAEgBEYNmAEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBs9UAai0AAEcNBSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMmQELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANgIcIANBmhI2AhAgA0EHNgIMIAMgAUEBajYCFAx/CyADQYASOwEqQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2QA2AhwgAyABNgIUIANB6ho2AhAgA0EVNgIMQQAhAgx+C0HNACECDGQLIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDHwLIAEgBEYEQEHZACECDHwLIAEtAABBIEcNPSABQQFqIQEgAy0ALkEBcQ09IANBADYCHCADIAE2AhQgA0HCHDYCECADQR42AgxBACECDHsLIAEgBEYEQEHYACECDHsLAkACQAJAAkACQCABLQAAIgBBCmsOBAIDAwABCyABQQFqIQFBLCECDGULIABBOkcNASADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgx9CyABQQFqIQEgA0Evai0AAEEBcUUNcyADLQAyQYABcUUEQCADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALAkACQCAADhZNTEsBAQEBAQEBAQEBAQEBAQEBAQEAAQsgA0EpNgIcIAMgATYCFCADQawZNgIQIANBFTYCDEEAIQIMfgsgA0EANgIcIAMgATYCFCADQeULNgIQIANBETYCDEEAIQIMfQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUNWSAAQRVHDQEgA0EFNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMfAtBywAhAgxiC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAx6CyADIAMvATJBgAFyOwEyDDsLIAEgBEcEQCADQRE2AgggAyABNgIEQcoAIQIMYAtB1wAhAgx4CyABIARGBEBB1gAhAgx4CwJAAkACQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQeMAaw4TAEBAQEBAQEBAQEBAQAFAQEACA0ALIAFBAWohAUHGACECDGELIAFBAWohAUHHACECDGALIAFBAWohAUHIACECDF8LIAFBAWohAUHJACECDF4LQdUAIQIgBCABIgBGDXYgBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0IQQQgAUEFRg0KGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx2C0HUACECIAQgASIARg11IAQgAWsgAygCACIBaiEGIAAgAWtBD2ohBwNAIAFBgMgAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNB0EDIAFBD0YNCRogAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdQtB0wAhAiAEIAEiAEYNdCAEIAFrIAMoAgAiAWohBiAAIAFrQQ5qIQcDQCABQeLHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQYgAUEORg0HIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHQLQdIAIQIgBCABIgBGDXMgBCABayADKAIAIgFqIQUgACABa0EBaiEGA0AgAUHgxwBqLQAAIAAtAAAiB0EgciAHIAdBwQBrQf8BcUEaSRtB/wFxRw0FIAFBAUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBTYCAAxzCyABIARGBEBB0QAhAgxzCwJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB7gBrDgcAOTk5OTkBOQsgAUEBaiEBQcMAIQIMWgsgAUEBaiEBQcQAIQIMWQsgA0EANgIAIAZBAWohAUHFACECDFgLQdAAIQIgBCABIgBGDXAgBCABayADKAIAIgFqIQYgACABa0EJaiEHA0AgAUHWxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0CQQIgAUEJRg0EGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxwC0HPACECIAQgASIARg1vIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwNAIAFB0McAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQVGDQIgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMbwsgACEBIANBADYCAAwzC0EBCzoALCADQQA2AgAgB0EBaiEBC0EtIQIMUgsCQANAIAEtAABB0MUAai0AAEEBRw0BIAQgAUEBaiIBRw0AC0HNACECDGsLQcIAIQIMUQsgASAERgRAQcwAIQIMagsgAS0AAEE6RgRAIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0zIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMagsgA0EANgIcIAMgATYCFCADQecRNgIQIANBCjYCDEEAIQIMaQsCQAJAIAMtACxBAmsOAgABJwsgA0Ezai0AAEECcUUNJiADLQAuQQJxDSYgA0EANgIcIAMgATYCFCADQaYUNgIQIANBCzYCDEEAIQIMaQsgAy0AMkEgcUUNJSADLQAuQQJxDSUgA0EANgIcIAMgATYCFCADQb0TNgIQIANBDzYCDEEAIQIMaAtBACEAAkAgAygCOCICRQ0AIAIoAkgiAkUNACADIAIRAAAhAAsgAEUEQEHBACECDE8LIABBFUcEQCADQQA2AhwgAyABNgIUIANBpg82AhAgA0EcNgIMQQAhAgxoCyADQcoANgIcIAMgATYCFCADQYUcNgIQIANBFTYCDEEAIQIMZwsgASAERwRAA0AgAS0AAEHAwQBqLQAAQQFHDRcgBCABQQFqIgFHDQALQcQAIQIMZwtBxAAhAgxmCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUE2IQIMUgsgAUEBaiEBQTchAgxRCyABQQFqIQFBOCECDFALDBULIAQgAUEBaiIBRw0AC0E8IQIMZgtBPCECDGULIAEgBEYEQEHIACECDGULIANBEjYCCCADIAE2AgQCQAJAAkACQAJAIAMtACxBAWsOBBQAAQIJCyADLQAyQSBxDQNB4AEhAgxPCwJAIAMvATIiAEEIcUUNACADLQAoQQFHDQAgAy0ALkEIcUUNAgsgAyAAQff7A3FBgARyOwEyDAsLIAMgAy8BMkEQcjsBMgwECyADQQA2AgQgAyABIAEQMSIABEAgA0HBADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxmCyABQQFqIQEMWAsgA0EANgIcIAMgATYCFCADQfQTNgIQIANBBDYCDEEAIQIMZAtBxwAhAiABIARGDWMgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCAAQcDFAGotAAAgAS0AAEEgckcNASAAQQZGDUogAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMZAsgA0EANgIADAULAkAgASAERwRAA0AgAS0AAEHAwwBqLQAAIgBBAUcEQCAAQQJHDQMgAUEBaiEBDAULIAQgAUEBaiIBRw0AC0HFACECDGQLQcUAIQIMYwsLIANBADoALAwBC0ELIQIMRwtBPyECDEYLAkACQANAIAEtAAAiAEEgRwRAAkAgAEEKaw4EAwUFAwALIABBLEYNAwwECyAEIAFBAWoiAUcNAAtBxgAhAgxgCyADQQg6ACwMDgsgAy0AKEEBRw0CIAMtAC5BCHENAiADKAIEIQAgA0EANgIEIAMgACABEDEiAARAIANBwgA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMXwsgAUEBaiEBDFALQTshAgxECwJAA0AgAS0AACIAQSBHIABBCUdxDQEgBCABQQFqIgFHDQALQcMAIQIMXQsLQTwhAgxCCwJAAkAgASAERwRAA0AgAS0AACIAQSBHBEAgAEEKaw4EAwQEAwQLIAQgAUEBaiIBRw0AC0E/IQIMXQtBPyECDFwLIAMgAy8BMkEgcjsBMgwKCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNTiADQT42AhwgAyABNgIUIAMgADYCDEEAIQIMWgsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkYNAwwMCyAEIAFBAWoiAUcNAAtBNyECDFsLQTchAgxaCyABQQFqIQEMBAtBOyECIAQgASIARg1YIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwJAA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEMPwsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMWQsgA0EANgIAIAAhAQwFC0E6IQIgBCABIgBGDVcgBCABayADKAIAIgFqIQYgACABa0EIaiEHAkADQCABQbTBAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEIRgRAQQUhAQw+CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxYCyADQQA2AgAgACEBDAQLQTkhAiAEIAEiAEYNViAEIAFrIAMoAgAiAWohBiAAIAFrQQNqIQcCQANAIAFBsMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQNGBEBBBiEBDD0LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFcLIANBADYCACAAIQEMAwsCQANAIAEtAAAiAEEgRwRAIABBCmsOBAcEBAcCCyAEIAFBAWoiAUcNAAtBOCECDFYLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCADLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIANBAToALCADIAMvATIgAXI7ATIgACEBDAELIAMgAy8BMkEIcjsBMiAAIQELQT4hAgw7CyADQQA6ACwLQTkhAgw5CyABIARGBEBBNiECDFILAkACQAJAAkACQCABLQAAQQprDgQAAgIBAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDQIgA0EzNgIcIAMgATYCFCADIAA2AgxBACECDFULIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQRAIAFBAWohAQwGCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMVAsgAy0ALkEBcQRAQd8BIQIMOwsgAygCBCEAIANBADYCBCADIAAgARAxIgANAQxJC0E0IQIMOQsgA0E1NgIcIAMgATYCFCADIAA2AgxBACECDFELQTUhAgw3CyADQS9qLQAAQQFxDQAgA0EANgIcIAMgATYCFCADQesWNgIQIANBGTYCDEEAIQIMTwtBMyECDDULIAEgBEYEQEEyIQIMTgsCQCABLQAAQQpGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GSFzYCECADQQM2AgxBACECDE4LQTIhAgw0CyABIARGBEBBMSECDE0LAkAgAS0AACIAQQlGDQAgAEEgRg0AQQEhAgJAIAMtACxBBWsOBAYEBQANCyADIAMvATJBCHI7ATIMDAsgAy0ALkEBcUUNASADLQAsQQhHDQAgA0EAOgAsC0E9IQIMMgsgA0EANgIcIAMgATYCFCADQcIWNgIQIANBCjYCDEEAIQIMSgtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgwGCyABIARGBEBBMCECDEcLIAEtAABBCkYEQCABQQFqIQEMAQsgAy0ALkEBcQ0AIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDEYLQTAhAgwsCyABQQFqIQFBMSECDCsLIAEgBEYEQEEvIQIMRAsgAS0AACIAQQlHIABBIEdxRQRAIAFBAWohASADLQAuQQFxDQEgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDEEAIQIMRAtBASECAkACQAJAAkACQAJAIAMtACxBAmsOBwUEBAMBAgAECyADIAMvATJBCHI7ATIMAwtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgtBLyECDCsLIANBADYCHCADIAE2AhQgA0GEEzYCECADQQs2AgxBACECDEMLQeEBIQIMKQsgASAERgRAQS4hAgxCCyADQQA2AgQgA0ESNgIIIAMgASABEDEiAA0BC0EuIQIMJwsgA0EtNgIcIAMgATYCFCADIAA2AgxBACECDD8LQQAhAAJAIAMoAjgiAkUNACACKAJMIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2AA2AhwgAyABNgIUIANBsxs2AhAgA0EVNgIMQQAhAgw+C0HMACECDCQLIANBADYCHCADIAE2AhQgA0GzDjYCECADQR02AgxBACECDDwLIAEgBEYEQEHOACECDDwLIAEtAAAiAEEgRg0CIABBOkYNAQsgA0EAOgAsQQkhAgwhCyADKAIEIQAgA0EANgIEIAMgACABEDAiAA0BDAILIAMtAC5BAXEEQEHeASECDCALIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0CIANBKjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgw4CyADQcsANgIcIAMgADYCDCADIAFBAWo2AhRBACECDDcLIAFBAWohAUHAACECDB0LIAFBAWohAQwsCyABIARGBEBBKyECDDULAkAgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQcAAcUUNBgsgAy0AMkGAAXEEQEEAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ0SIABBFUYEQCADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgw2CyADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMQQAhAgw1CyADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyADQQE6ADALIAIgAi8BAEHAAHI7AQALQSshAgwYCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgwwCyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgwvCyADQQA2AhwgAyABNgIUIANBpQs2AhAgA0ECNgIMQQAhAgwuC0EBIQcgAy8BMiIFQQhxRQRAIAMpAyBCAFIhBwsCQCADLQAwBEBBASEAIAMtAClBBUYNASAFQcAAcUUgB3FFDQELAkAgAy0AKCICQQJGBEBBASEAIAMvATQiBkHlAEYNAkEAIQAgBUHAAHENAiAGQeQARg0CIAZB5gBrQQJJDQIgBkHMAUYNAiAGQbACRg0CDAELQQAhACAFQcAAcQ0BC0ECIQAgBUEIcQ0AIAVBgARxBEACQCACQQFHDQAgAy0ALkEKcQ0AQQUhAAwCC0EEIQAMAQsgBUEgcUUEQCADEDZBAEdBAnQhAAwBC0EAQQMgAykDIFAbIQALIABBAWsOBQIABwEDBAtBESECDBMLIANBAToAMQwpC0EAIQICQCADKAI4IgBFDQAgACgCMCIARQ0AIAMgABEAACECCyACRQ0mIAJBFUYEQCADQQM2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwrC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAwqCyADQQA2AhwgAyABNgIUIANB+SA2AhAgA0EPNgIMQQAhAgwpC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAADQELQQ4hAgwOCyAAQRVGBEAgA0ECNgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMJwsgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDEEAIQIMJgtBKiECDAwLIAEgBEcEQCADQQk2AgggAyABNgIEQSkhAgwMC0EmIQIMJAsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFQEQEElIQIMJAsgAygCBCEAIANBADYCBCADIAAgASAMp2oiARAyIgBFDQAgA0EFNgIcIAMgATYCFCADIAA2AgxBACECDCMLQQ8hAgwJC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FxYAAQIDBAUGBxQUFBQUFBQICQoLDA0UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFA4PEBESExQLQgIhCgwWC0IDIQoMFQtCBCEKDBQLQgUhCgwTC0IGIQoMEgtCByEKDBELQgghCgwQC0IJIQoMDwtCCiEKDA4LQgshCgwNC0IMIQoMDAtCDSEKDAsLQg4hCgwKC0IPIQoMCQtCCiEKDAgLQgshCgwHC0IMIQoMBgtCDSEKDAULQg4hCgwEC0IPIQoMAwsgA0EANgIcIAMgATYCFCADQZ8VNgIQIANBDDYCDEEAIQIMIQsgASAERgRAQSIhAgwhC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsONxUUAAECAwQFBgcWFhYWFhYWCAkKCwwNFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYODxAREhMWC0ICIQoMFAtCAyEKDBMLQgQhCgwSC0IFIQoMEQtCBiEKDBALQgchCgwPC0IIIQoMDgtCCSEKDA0LQgohCgwMC0ILIQoMCwtCDCEKDAoLQg0hCgwJC0IOIQoMCAtCDyEKDAcLQgohCgwGC0ILIQoMBQtCDCEKDAQLQg0hCgwDC0IOIQoMAgtCDyEKDAELQgEhCgsgAUEBaiEBIAMpAyAiC0L//////////w9YBEAgAyALQgSGIAqENwMgDAILIANBADYCHCADIAE2AhQgA0G1CTYCECADQQw2AgxBACECDB4LQSchAgwEC0EoIQIMAwsgAyABOgAsIANBADYCACAHQQFqIQFBDCECDAILIANBADYCACAGQQFqIQFBCiECDAELIAFBAWohAUEIIQIMAAsAC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwXC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwWC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwVC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwUC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwTC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwSC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwRC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwQC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwPC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwOC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwNC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwMC0EAIQIgA0EANgIcIAMgATYCFCADQZkTNgIQIANBCzYCDAwLC0EAIQIgA0EANgIcIAMgATYCFCADQZ0JNgIQIANBCzYCDAwKC0EAIQIgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDAwJC0EAIQIgA0EANgIcIAMgATYCFCADQbEQNgIQIANBCjYCDAwIC0EAIQIgA0EANgIcIAMgATYCFCADQbsdNgIQIANBAjYCDAwHC0EAIQIgA0EANgIcIAMgATYCFCADQZYWNgIQIANBAjYCDAwGC0EAIQIgA0EANgIcIAMgATYCFCADQfkYNgIQIANBAjYCDAwFC0EAIQIgA0EANgIcIAMgATYCFCADQcQYNgIQIANBAjYCDAwECyADQQI2AhwgAyABNgIUIANBqR42AhAgA0EWNgIMQQAhAgwDC0HeACECIAEgBEYNAiAJQQhqIQcgAygCACEFAkACQCABIARHBEAgBUGWyABqIQggBCAFaiABayEGIAVBf3NBCmoiBSABaiEAA0AgAS0AACAILQAARwRAQQIhCAwDCyAFRQRAQQAhCCAAIQEMAwsgBUEBayEFIAhBAWohCCAEIAFBAWoiAUcNAAsgBiEFIAQhAQsgB0EBNgIAIAMgBTYCAAwBCyADQQA2AgAgByAINgIACyAHIAE2AgQgCSgCDCEAAkACQCAJKAIIQQFrDgIEAQALIANBADYCHCADQcIeNgIQIANBFzYCDCADIABBAWo2AhRBACECDAMLIANBADYCHCADIAA2AhQgA0HXHjYCECADQQk2AgxBACECDAILIAEgBEYEQEEoIQIMAgsgA0EJNgIIIAMgATYCBEEnIQIMAQsgASAERgRAQQEhAgwBCwNAAkACQAJAIAEtAABBCmsOBAABAQABCyABQQFqIQEMAQsgAUEBaiEBIAMtAC5BIHENAEEAIQIgA0EANgIcIAMgATYCFCADQaEhNgIQIANBBTYCDAwCC0EBIQIgASAERw0ACwsgCUEQaiQAIAJFBEAgAygCDCEADAELIAMgAjYCHEEAIQAgAygCBCIBRQ0AIAMgASAEIAMoAggRAQAiAUUNACADIAQ2AhQgAyABNgIMIAEhAAsgAAu+AgECfyAAQQA6AAAgAEHkAGoiAUEBa0EAOgAAIABBADoAAiAAQQA6AAEgAUEDa0EAOgAAIAFBAmtBADoAACAAQQA6AAMgAUEEa0EAOgAAQQAgAGtBA3EiASAAaiIAQQA2AgBB5AAgAWtBfHEiAiAAaiIBQQRrQQA2AgACQCACQQlJDQAgAEEANgIIIABBADYCBCABQQhrQQA2AgAgAUEMa0EANgIAIAJBGUkNACAAQQA2AhggAEEANgIUIABBADYCECAAQQA2AgwgAUEQa0EANgIAIAFBFGtBADYCACABQRhrQQA2AgAgAUEca0EANgIAIAIgAEEEcUEYciICayIBQSBJDQAgACACaiEAA0AgAEIANwMYIABCADcDECAAQgA3AwggAEIANwMAIABBIGohACABQSBrIgFBH0sNAAsLC1YBAX8CQCAAKAIMDQACQAJAAkACQCAALQAxDgMBAAMCCyAAKAI4IgFFDQAgASgCMCIBRQ0AIAAgAREAACIBDQMLQQAPCwALIABByhk2AhBBDiEBCyABCxoAIAAoAgxFBEAgAEHeHzYCECAAQRU2AgwLCxQAIAAoAgxBFUYEQCAAQQA2AgwLCxQAIAAoAgxBFkYEQCAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsrAAJAIABBJ08NAEL//////wkgAK2IQgGDUA0AIABBAnRB0DhqKAIADwsACxcAIABBL08EQAALIABBAnRB7DlqKAIAC78JAQF/QfQtIQECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQeQAaw70A2NiAAFhYWFhYWECAwQFYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQYHCAkKCwwNDg9hYWFhYRBhYWFhYWFhYWFhYRFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWESExQVFhcYGRobYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1NmE3ODk6YWFhYWFhYWE7YWFhPGFhYWE9Pj9hYWFhYWFhYUBhYUFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFCQ0RFRkdISUpLTE1OT1BRUlNhYWFhYWFhYVRVVldYWVpbYVxdYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhXmFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYV9gYQtB6iwPC0GYJg8LQe0xDwtBoDcPC0HJKQ8LQbQpDwtBli0PC0HrKw8LQaI1DwtB2zQPC0HgKQ8LQeMkDwtB1SQPC0HuJA8LQeYlDwtByjQPC0HQNw8LQao1DwtB9SwPC0H2Jg8LQYIiDwtB8jMPC0G+KA8LQec3DwtBzSEPC0HAIQ8LQbglDwtByyUPC0GWJA8LQY80DwtBzTUPC0HdKg8LQe4zDwtBnDQPC0GeMQ8LQfQ1DwtB5SIPC0GvJQ8LQZkxDwtBsjYPC0H5Ng8LQcQyDwtB3SwPC0GCMQ8LQcExDwtBjTcPC0HJJA8LQew2DwtB5yoPC0HIIw8LQeIhDwtByTcPC0GlIg8LQZQiDwtB2zYPC0HeNQ8LQYYmDwtBvCsPC0GLMg8LQaAjDwtB9jAPC0GALA8LQYkrDwtBpCYPC0HyIw8LQYEoDwtBqzIPC0HrJw8LQcI2DwtBoiQPC0HPKg8LQdwjDwtBhycPC0HkNA8LQbciDwtBrTEPC0HVIg8LQa80DwtB3iYPC0HWMg8LQfQ0DwtBgTgPC0H0Nw8LQZI2DwtBnScPC0GCKQ8LQY0jDwtB1zEPC0G9NQ8LQbQ3DwtB2DAPC0G2Jw8LQZo4DwtBpyoPC0HEJw8LQa4jDwtB9SIPCwALQcomIQELIAELFwAgACAALwEuQf7/A3EgAUEAR3I7AS4LGgAgACAALwEuQf3/A3EgAUEAR0EBdHI7AS4LGgAgACAALwEuQfv/A3EgAUEAR0ECdHI7AS4LGgAgACAALwEuQff/A3EgAUEAR0EDdHI7AS4LGgAgACAALwEuQe//A3EgAUEAR0EEdHI7AS4LGgAgACAALwEuQd//A3EgAUEAR0EFdHI7AS4LGgAgACAALwEuQb//A3EgAUEAR0EGdHI7AS4LGgAgACAALwEuQf/+A3EgAUEAR0EHdHI7AS4LGgAgACAALwEuQf/9A3EgAUEAR0EIdHI7AS4LGgAgACAALwEuQf/7A3EgAUEAR0EJdHI7AS4LPgECfwJAIAAoAjgiA0UNACADKAIEIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHhEjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIIIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH8ETYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIMIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHsCjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIQIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH6HjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIUIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHLEDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIYIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG3HzYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIcIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG/FTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIsIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH+CDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIgIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEGMHTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIkIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHmFTYCEEEYIQQLIAQLOAAgAAJ/IAAvATJBFHFBFEYEQEEBIAAtAChBAUYNARogAC8BNEHlAEYMAQsgAC0AKUEFRgs6ADALWQECfwJAIAAtAChBAUYNACAALwE0IgFB5ABrQeQASQ0AIAFBzAFGDQAgAUGwAkYNACAALwEyIgBBwABxDQBBASECIABBiARxQYAERg0AIABBKHFFIQILIAILjAEBAn8CQAJAAkAgAC0AKkUNACAALQArRQ0AIAAvATIiAUECcUUNAQwCCyAALwEyIgFBAXFFDQELQQEhAiAALQAoQQFGDQAgAC8BNCIAQeQAa0HkAEkNACAAQcwBRg0AIABBsAJGDQAgAUHAAHENAEEAIQIgAUGIBHFBgARGDQAgAUEocUEARyECCyACC1cAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",Fcr;Object.defineProperty(lHn,"exports",{get:a(()=>Fcr||(Fcr=gNs.from(ANs,"base64")),"get")})});var dHn=I((eyf,uHn)=>{"use strict";p();var{Buffer:yNs}=require("node:buffer"),_Ns="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCuzaAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKAIcIgJBAmsO/AEB+QECAwQFBgcICQoLDA0ODxAREvgBE/cBFBX2ARYX9QEYGRobHB0eHyD9AfsBIfQBIiMkJSYnKCkqK/MBLC0uLzAxMvIB8QEzNPAB7wE1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk/6AVBRUlPuAe0BVOwBVesBVldYWVrqAVtcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAekB6AHPAecB0AHmAdEB0gHTAdQB5QHVAdYB1wHYAdkB2gHbAdwB3QHeAd8B4AHhAeIB4wEA/AELQQAM4wELQQ4M4gELQQ0M4QELQQ8M4AELQRAM3wELQRMM3gELQRQM3QELQRUM3AELQRYM2wELQRcM2gELQRgM2QELQRkM2AELQRoM1wELQRsM1gELQRwM1QELQR0M1AELQR4M0wELQR8M0gELQSAM0QELQSEM0AELQQgMzwELQSIMzgELQSQMzQELQSMMzAELQQcMywELQSUMygELQSYMyQELQScMyAELQSgMxwELQRIMxgELQREMxQELQSkMxAELQSoMwwELQSsMwgELQSwMwQELQd4BDMABC0EuDL8BC0EvDL4BC0EwDL0BC0ExDLwBC0EyDLsBC0EzDLoBC0E0DLkBC0HfAQy4AQtBNQy3AQtBOQy2AQtBDAy1AQtBNgy0AQtBNwyzAQtBOAyyAQtBPgyxAQtBOgywAQtB4AEMrwELQQsMrgELQT8MrQELQTsMrAELQQoMqwELQTwMqgELQT0MqQELQeEBDKgBC0HBAAynAQtBwAAMpgELQcIADKUBC0EJDKQBC0EtDKMBC0HDAAyiAQtBxAAMoQELQcUADKABC0HGAAyfAQtBxwAMngELQcgADJ0BC0HJAAycAQtBygAMmwELQcsADJoBC0HMAAyZAQtBzQAMmAELQc4ADJcBC0HPAAyWAQtB0AAMlQELQdEADJQBC0HSAAyTAQtB0wAMkgELQdUADJEBC0HUAAyQAQtB1gAMjwELQdcADI4BC0HYAAyNAQtB2QAMjAELQdoADIsBC0HbAAyKAQtB3AAMiQELQd0ADIgBC0HeAAyHAQtB3wAMhgELQeAADIUBC0HhAAyEAQtB4gAMgwELQeMADIIBC0HkAAyBAQtB5QAMgAELQeIBDH8LQeYADH4LQecADH0LQQYMfAtB6AAMewtBBQx6C0HpAAx5C0EEDHgLQeoADHcLQesADHYLQewADHULQe0ADHQLQQMMcwtB7gAMcgtB7wAMcQtB8AAMcAtB8gAMbwtB8QAMbgtB8wAMbQtB9AAMbAtB9QAMawtB9gAMagtBAgxpC0H3AAxoC0H4AAxnC0H5AAxmC0H6AAxlC0H7AAxkC0H8AAxjC0H9AAxiC0H+AAxhC0H/AAxgC0GAAQxfC0GBAQxeC0GCAQxdC0GDAQxcC0GEAQxbC0GFAQxaC0GGAQxZC0GHAQxYC0GIAQxXC0GJAQxWC0GKAQxVC0GLAQxUC0GMAQxTC0GNAQxSC0GOAQxRC0GPAQxQC0GQAQxPC0GRAQxOC0GSAQxNC0GTAQxMC0GUAQxLC0GVAQxKC0GWAQxJC0GXAQxIC0GYAQxHC0GZAQxGC0GaAQxFC0GbAQxEC0GcAQxDC0GdAQxCC0GeAQxBC0GfAQxAC0GgAQw/C0GhAQw+C0GiAQw9C0GjAQw8C0GkAQw7C0GlAQw6C0GmAQw5C0GnAQw4C0GoAQw3C0GpAQw2C0GqAQw1C0GrAQw0C0GsAQwzC0GtAQwyC0GuAQwxC0GvAQwwC0GwAQwvC0GxAQwuC0GyAQwtC0GzAQwsC0G0AQwrC0G1AQwqC0G2AQwpC0G3AQwoC0G4AQwnC0G5AQwmC0G6AQwlC0G7AQwkC0G8AQwjC0G9AQwiC0G+AQwhC0G/AQwgC0HAAQwfC0HBAQweC0HCAQwdC0EBDBwLQcMBDBsLQcQBDBoLQcUBDBkLQcYBDBgLQccBDBcLQcgBDBYLQckBDBULQcoBDBQLQcsBDBMLQcwBDBILQc0BDBELQc4BDBALQc8BDA8LQdABDA4LQdEBDA0LQdIBDAwLQdMBDAsLQdQBDAoLQdUBDAkLQdYBDAgLQeMBDAcLQdcBDAYLQdgBDAULQdkBDAQLQdoBDAMLQdsBDAILQd0BDAELQdwBCyECA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCACDuMBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISMkJScoKZ4DmwOaA5EDigODA4AD/QL7AvgC8gLxAu8C7QLoAucC5gLlAuQC3ALbAtoC2QLYAtcC1gLVAs8CzgLMAssCygLJAsgCxwLGAsQCwwK+ArwCugK5ArgCtwK2ArUCtAKzArICsQKwAq4CrQKpAqgCpwKmAqUCpAKjAqICoQKgAp8CmAKQAowCiwKKAoEC/gH9AfwB+wH6AfkB+AH3AfUB8wHwAesB6QHoAecB5gHlAeQB4wHiAeEB4AHfAd4B3QHcAdoB2QHYAdcB1gHVAdQB0wHSAdEB0AHPAc4BzQHMAcsBygHJAcgBxwHGAcUBxAHDAcIBwQHAAb8BvgG9AbwBuwG6AbkBuAG3AbYBtQG0AbMBsgGxAbABrwGuAa0BrAGrAaoBqQGoAacBpgGlAaQBowGiAZ8BngGZAZgBlwGWAZUBlAGTAZIBkQGQAY8BjQGMAYcBhgGFAYQBgwGCAX18e3p5dnV0UFFSU1RVCyABIARHDXJB/QEhAgy+AwsgASAERw2YAUHbASECDL0DCyABIARHDfEBQY4BIQIMvAMLIAEgBEcN/AFBhAEhAgy7AwsgASAERw2KAkH/ACECDLoDCyABIARHDZECQf0AIQIMuQMLIAEgBEcNlAJB+wAhAgy4AwsgASAERw0eQR4hAgy3AwsgASAERw0ZQRghAgy2AwsgASAERw3KAkHNACECDLUDCyABIARHDdUCQcYAIQIMtAMLIAEgBEcN1gJBwwAhAgyzAwsgASAERw3cAkE4IQIMsgMLIAMtADBBAUYNrQMMiQMLQQAhAAJAAkACQCADLQAqRQ0AIAMtACtFDQAgAy8BMiICQQJxRQ0BDAILIAMvATIiAkEBcUUNAQtBASEAIAMtAChBAUYNACADLwE0IgZB5ABrQeQASQ0AIAZBzAFGDQAgBkGwAkYNACACQcAAcQ0AQQAhACACQYgEcUGABEYNACACQShxQQBHIQALIANBADsBMiADQQA6ADECQCAARQRAIANBADoAMSADLQAuQQRxDQEMsQMLIANCADcDIAsgA0EAOgAxIANBAToANgxIC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAARQ1IIABBFUcNYiADQQQ2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgyvAwsgASAERgRAQQYhAgyvAwsgAS0AAEEKRw0ZIAFBAWohAQwaCyADQgA3AyBBEiECDJQDCyABIARHDYoDQSMhAgysAwsgASAERgRAQQchAgysAwsCQAJAIAEtAABBCmsOBAEYGAAYCyABQQFqIQFBECECDJMDCyABQQFqIQEgA0Evai0AAEEBcQ0XQQAhAiADQQA2AhwgAyABNgIUIANBmSA2AhAgA0EZNgIMDKsDCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMWg0YQQghAgyqAwsgASAERwRAIANBCTYCCCADIAE2AgRBFCECDJEDC0EJIQIMqQMLIAMpAyBQDa4CDEMLIAEgBEYEQEELIQIMqAMLIAEtAABBCkcNFiABQQFqIQEMFwsgA0Evai0AAEEBcUUNGQwmC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRkMQgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0aDCQLQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGwwyCyADQS9qLQAAQQFxRQ0cDCILQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANHAxCC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADR0MIAsgASAERgRAQRMhAgygAwsCQCABLQAAIgBBCmsOBB8jIwAiCyABQQFqIQEMHwtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0iDEILIAEgBEYEQEEWIQIMngMLIAEtAABBwMEAai0AAEEBRw0jDIMDCwJAA0AgAS0AAEGwO2otAAAiAEEBRwRAAkAgAEECaw4CAwAnCyABQQFqIQFBISECDIYDCyAEIAFBAWoiAUcNAAtBGCECDJ0DCyADKAIEIQBBACECIANBADYCBCADIAAgAUEBaiIBEDQiAA0hDEELQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIwwqCyABIARGBEBBHCECDJsDCyADQQo2AgggAyABNgIEQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANJUEkIQIMgQMLIAEgBEcEQANAIAEtAABBsD1qLQAAIgBBA0cEQCAAQQFrDgUYGiaCAyUmCyAEIAFBAWoiAUcNAAtBGyECDJoDC0EbIQIMmQMLA0AgAS0AAEGwP2otAAAiAEEDRwRAIABBAWsOBQ8RJxMmJwsgBCABQQFqIgFHDQALQR4hAgyYAwsgASAERwRAIANBCzYCCCADIAE2AgRBByECDP8CC0EfIQIMlwMLIAEgBEYEQEEgIQIMlwMLAkAgAS0AAEENaw4ULj8/Pz8/Pz8/Pz8/Pz8/Pz8/PwA/C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAyWAwsgA0EvaiECA0AgASAERgRAQSEhAgyXAwsCQAJAAkAgAS0AACIAQQlrDhgCACkpASkpKSkpKSkpKSkpKSkpKSkpKQInCyABQQFqIQEgA0Evai0AAEEBcUUNCgwYCyABQQFqIQEMFwsgAUEBaiEBIAItAABBAnENAAtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwMlQMLIAMtAC5BgAFxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ3mAiAAQRVGBEAgA0EkNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMlAMLQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDJMDC0EAIQIgA0EANgIcIAMgATYCFCADQb4gNgIQIANBAjYCDAySAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEgDKdqIgEQMiIARQ0rIANBBzYCHCADIAE2AhQgAyAANgIMDJEDCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlgiAkUNACADIAIRAAAhAAsgAEUNKyAAQRVGBEAgA0EKNgIcIAMgATYCFCADQesZNgIQIANBFTYCDEEAIQIMkAMLQQAhAiADQQA2AhwgAyABNgIUIANBkww2AhAgA0ETNgIMDI8DC0EAIQIgA0EANgIcIAMgATYCFCADQYIVNgIQIANBAjYCDAyOAwtBACECIANBADYCHCADIAE2AhQgA0HdFDYCECADQRk2AgwMjQMLQQAhAiADQQA2AhwgAyABNgIUIANB5h02AhAgA0EZNgIMDIwDCyAAQRVGDT1BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMiwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUNKCADQQ02AhwgAyABNgIUIAMgADYCDAyKAwsgAEEVRg06QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIkDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCgLIANBDjYCHCADIAA2AgwgAyABQQFqNgIUDIgDCyAAQRVGDTdBACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMhwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUEQCABQQFqIQEMJwsgA0EPNgIcIAMgADYCDCADIAFBAWo2AhQMhgMLQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDIUDCyAAQRVGDTNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwMhAMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUNJSADQRE2AhwgAyABNgIUIAMgADYCDAyDAwsgAEEVRg0wQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIIDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDCULIANBEjYCHCADIAA2AgwgAyABQQFqNgIUDIEDCyADQS9qLQAAQQFxRQ0BC0EXIQIM5gILQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDP4CCyAAQTtHDQAgAUEBaiEBDAwLQQAhAiADQQA2AhwgAyABNgIUIANBkhg2AhAgA0ECNgIMDPwCCyAAQRVGDShBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM+wILIANBFDYCHCADIAE2AhQgAyAANgIMDPoCCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDPUCCyADQRU2AhwgAyAANgIMIAMgAUEBajYCFAz5AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzzAgsgA0EXNgIcIAMgADYCDCADIAFBAWo2AhQM+AILIABBFUYNI0EAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAz3AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwdCyADQRk2AhwgAyAANgIMIAMgAUEBajYCFAz2AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzvAgsgA0EaNgIcIAMgADYCDCADIAFBAWo2AhQM9QILIABBFUYNH0EAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAz0AgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDBsLIANBHDYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIANBIDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNMCCyADQRM2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzSAgsgA0ELNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0QILIANBEDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNACCyADQSA2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzPAgsgA0ELNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzgILIANBDDYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM0CC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAzMAgsCQANAAkAgAS0AAEEKaw4EAAICAAILIAQgAUEBaiIBRw0AC0H9ASECDMwCCwJAAkAgAy0ANkEBRw0AQQAhAAJAIAMoAjgiAkUNACACKAJgIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB/AE2AhwgAyABNgIUIANB3Bk2AhAgA0EVNgIMQQAhAgzNAgtB3AEhAgyzAgsgA0EANgIcIAMgATYCFCADQfkLNgIQIANBHzYCDEEAIQIMywILAkACQCADLQAoQQFrDgIEAQALQdsBIQIMsgILQdQBIQIMsQILIANBAjoAMUEAIQACQCADKAI4IgJFDQAgAigCACICRQ0AIAMgAhEAACEACyAARQRAQd0BIQIMsQILIABBFUcEQCADQQA2AhwgAyABNgIUIANBtAw2AhAgA0EQNgIMQQAhAgzKAgsgA0H7ATYCHCADIAE2AhQgA0GBGjYCECADQRU2AgxBACECDMkCCyABIARGBEBB+gEhAgzJAgsgAS0AAEHIAEYNASADQQE6ACgLQcABIQIMrgILQdoBIQIMrQILIAEgBEcEQCADQQw2AgggAyABNgIEQdkBIQIMrQILQfkBIQIMxQILIAEgBEYEQEH4ASECDMUCCyABLQAAQcgARw0EIAFBAWohAUHYASECDKsCCyABIARGBEBB9wEhAgzEAgsCQAJAIAEtAABBxQBrDhAABQUFBQUFBQUFBQUFBQUBBQsgAUEBaiEBQdYBIQIMqwILIAFBAWohAUHXASECDKoCC0H2ASECIAEgBEYNwgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABButUAai0AAEcNAyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMwwILIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBgA02AhAgA0EbNgIMQQAhAgyeAgsgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMnQILIAEgBEcEQCADQQw2AgggAyABNgIEQb8BIQIMhAILQdgBIQIMnAILIAEgBEYEQEHXASECDJwCCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEHBAGsOFQABAgNaBAUGWlpaBwgJCgsMDQ4PEFoLIAFBAWohAUH7ACECDJICCyABQQFqIQFB/AAhAgyRAgsgAUEBaiEBQYEBIQIMkAILIAFBAWohAUGFASECDI8CCyABQQFqIQFBhgEhAgyOAgsgAUEBaiEBQYkBIQIMjQILIAFBAWohAUGKASECDIwCCyABQQFqIQFBjQEhAgyLAgsgAUEBaiEBQZYBIQIMigILIAFBAWohAUGXASECDIkCCyABQQFqIQFBmAEhAgyIAgsgAUEBaiEBQaUBIQIMhwILIAFBAWohAUGmASECDIYCCyABQQFqIQFBrAEhAgyFAgsgAUEBaiEBQbQBIQIMhAILIAFBAWohAUG3ASECDIMCCyABQQFqIQFBvgEhAgyCAgsgASAERgRAQdYBIQIMmwILIAEtAABBzgBHDUggAUEBaiEBQb0BIQIMgQILIAEgBEYEQEHVASECDJoCCwJAAkACQCABLQAAQcIAaw4SAEpKSkpKSkpKSgFKSkpKSkoCSgsgAUEBaiEBQbgBIQIMggILIAFBAWohAUG7ASECDIECCyABQQFqIQFBvAEhAgyAAgtB1AEhAiABIARGDZgCIAMoAgAiACAEIAFraiEFIAEgAGtBB2ohBgJAA0AgAS0AACAAQajVAGotAABHDUUgAEEHRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJkCCyADQQA2AgAgBkEBaiEBQRsMRQsgASAERgRAQdMBIQIMmAILAkACQCABLQAAQckAaw4HAEdHR0dHAUcLIAFBAWohAUG5ASECDP8BCyABQQFqIQFBugEhAgz+AQtB0gEhAiABIARGDZYCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQabVAGotAABHDUMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJcCCyADQQA2AgAgBkEBaiEBQQ8MQwtB0QEhAiABIARGDZUCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQaTVAGotAABHDUIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYCCyADQQA2AgAgBkEBaiEBQSAMQgtB0AEhAiABIARGDZQCIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDUEgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJUCCyADQQA2AgAgBkEBaiEBQRIMQQsgASAERgRAQc8BIQIMlAILAkACQCABLQAAQcUAaw4OAENDQ0NDQ0NDQ0NDQwFDCyABQQFqIQFBtQEhAgz7AQsgAUEBaiEBQbYBIQIM+gELQc4BIQIgASAERg2SAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGe1QBqLQAARw0/IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyTAgsgA0EANgIAIAZBAWohAUEHDD8LQc0BIQIgASAERg2RAiADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGY1QBqLQAARw0+IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAySAgsgA0EANgIAIAZBAWohAUEoDD4LIAEgBEYEQEHMASECDJECCwJAAkACQCABLQAAQcUAaw4RAEFBQUFBQUFBQQFBQUFBQQJBCyABQQFqIQFBsQEhAgz5AQsgAUEBaiEBQbIBIQIM+AELIAFBAWohAUGzASECDPcBC0HLASECIAEgBEYNjwIgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBkdUAai0AAEcNPCAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkAILIANBADYCACAGQQFqIQFBGgw8C0HKASECIAEgBEYNjgIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBjdUAai0AAEcNOyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjwILIANBADYCACAGQQFqIQFBIQw7CyABIARGBEBByQEhAgyOAgsCQAJAIAEtAABBwQBrDhQAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEH51ABqLQAARw0yIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyGAgsgA0EANgIAIAZBAWohAUErDDILQcABIQIgASAERg2EAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH21ABqLQAARw0xIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyFAgsgA0EANgIAIAZBAWohAUEsDDELQb8BIQIgASAERg2DAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0wIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyEAgsgA0EANgIAIAZBAWohAUERDDALQb4BIQIgASAERg2CAiADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEHy1ABqLQAARw0vIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyDAgsgA0EANgIAIAZBAWohAUEuDC8LIAEgBEYEQEG9ASECDIICCwJAAkACQAJAAkAgAS0AAEHBAGsOFQA0NDQ0NDQ0NDQ0ATQ0AjQ0AzQ0BDQLIAFBAWohAUGbASECDOwBCyABQQFqIQFBnAEhAgzrAQsgAUEBaiEBQZ0BIQIM6gELIAFBAWohAUGiASECDOkBCyABQQFqIQFBpAEhAgzoAQsgASAERgRAQbwBIQIMgQILAkACQCABLQAAQdIAaw4DADABMAsgAUEBaiEBQaMBIQIM6AELIAFBAWohAUEEDC0LQbsBIQIgASAERg3/ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHw1ABqLQAARw0sIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyAAgsgA0EANgIAIAZBAWohAUEdDCwLIAEgBEYEQEG6ASECDP8BCwJAAkAgAS0AAEHJAGsOBwEuLi4uLgAuCyABQQFqIQFBoQEhAgzmAQsgAUEBaiEBQSIMKwsgASAERgRAQbkBIQIM/gELIAEtAABB0ABHDSsgAUEBaiEBQaABIQIM5AELIAEgBEYEQEG4ASECDP0BCwJAAkAgAS0AAEHGAGsOCwAsLCwsLCwsLCwBLAsgAUEBaiEBQZ4BIQIM5AELIAFBAWohAUGfASECDOMBC0G3ASECIAEgBEYN+wEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB7NQAai0AAEcNKCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM/AELIANBADYCACAGQQFqIQFBDQwoC0G2ASECIAEgBEYN+gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNJyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+wELIANBADYCACAGQQFqIQFBDAwnC0G1ASECIAEgBEYN+QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6tQAai0AAEcNJiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+gELIANBADYCACAGQQFqIQFBAwwmC0G0ASECIAEgBEYN+AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6NQAai0AAEcNJSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+QELIANBADYCACAGQQFqIQFBJgwlCyABIARGBEBBswEhAgz4AQsCQAJAIAEtAABB1ABrDgIAAScLIAFBAWohAUGZASECDN8BCyABQQFqIQFBmgEhAgzeAQtBsgEhAiABIARGDfYBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQebUAGotAABHDSMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPcBCyADQQA2AgAgBkEBaiEBQScMIwtBsQEhAiABIARGDfUBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQeTUAGotAABHDSIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPYBCyADQQA2AgAgBkEBaiEBQRwMIgtBsAEhAiABIARGDfQBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQd7UAGotAABHDSEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPUBCyADQQA2AgAgBkEBaiEBQQYMIQtBrwEhAiABIARGDfMBIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQdnUAGotAABHDSAgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPQBCyADQQA2AgAgBkEBaiEBQRkMIAsgASAERgRAQa4BIQIM8wELAkACQAJAAkAgAS0AAEEtaw4jACQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkASQkJCQkAiQkJAMkCyABQQFqIQFBjgEhAgzcAQsgAUEBaiEBQY8BIQIM2wELIAFBAWohAUGUASECDNoBCyABQQFqIQFBlQEhAgzZAQtBrQEhAiABIARGDfEBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQdfUAGotAABHDR4gAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPIBCyADQQA2AgAgBkEBaiEBQQsMHgsgASAERgRAQawBIQIM8QELAkACQCABLQAAQcEAaw4DACABIAsgAUEBaiEBQZABIQIM2AELIAFBAWohAUGTASECDNcBCyABIARGBEBBqwEhAgzwAQsCQAJAIAEtAABBwQBrDg8AHx8fHx8fHx8fHx8fHwEfCyABQQFqIQFBkQEhAgzXAQsgAUEBaiEBQZIBIQIM1gELIAEgBEYEQEGqASECDO8BCyABLQAAQcwARw0cIAFBAWohAUEKDBsLQakBIQIgASAERg3tASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHR1ABqLQAARw0aIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzuAQsgA0EANgIAIAZBAWohAUEeDBoLQagBIQIgASAERg3sASADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMDAwMDAEMCyABQQFqIQFB/QAhAgzEAQsgAUEBaiEBQYABIQIMwwELIAEgBEYEQEGYASECDNwBCwJAAkAgAS0AAEHOAGsOAwALAQsLIAFBAWohAUH+ACECDMMBCyABQQFqIQFB/wAhAgzCAQsgASAERgRAQZcBIQIM2wELIAEtAABB2QBHDQggAUEBaiEBQQgMBwtBlgEhAiABIARGDdkBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQazUAGotAABHDQYgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNoBCyADQQA2AgAgBkEBaiEBQQUMBgtBlQEhAiABIARGDdgBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3AAhAgx5C0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMkwELQdsAIQIMeQsgA0HsADYCHCADIAE2AhQgA0GAGzYCECADQRU2AgxBACECDJEBCyADLQApIgBBI0kNACAAQS5GDQAgA0EANgIcIAMgATYCFCADQckJNgIQIANBCDYCDEEAIQIMkAELQdoAIQIMdgsgASAERgRAQesAIQIMjwELAkAgAS0AAEEvRgRAIAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMQQAhAgyPAQtB2QAhAgx1CyABIARHBEAgA0EONgIIIAMgATYCBEHYACECDHULQeoAIQIMjQELIAEgBEYEQEHpACECDI0BCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHXACECDHQLIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ16IANB6AA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAEgBEYEQEHnACECDIwBCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDXsgA0HmADYCHCADIAE2AhQgAyAANgIMQQAhAgyMAQtB1gAhAgxyCyABIARGBEBB5QAhAgyLAQtBACEAQQEhBUEBIQdBACECAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkAgAS0AAEEwaw4KCgkAAQIDBAUGCAsLQQIMBgtBAwwFC0EEDAQLQQUMAwtBBgwCC0EHDAELQQgLIQJBACEFQQAhBwwCC0EJIQJBASEAQQAhBUEAIQcMAQtBACEFQQEhAgsgAyACOgArIAFBAWohAQJAAkAgAy0ALkEQcQ0AAkACQAJAIAMtACoOAwEAAgQLIAdFDQMMAgsgAA0BDAILIAVFDQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ0CIANB4gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ19IANB4wA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5AA2AhwgAyABNgIUIAMgADYCDAyLAQtB1AAhAgxxCyADLQApQSJGDYYBQdMAIQIMcAtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsgAEUEQEHVACECDHALIABBFUcEQCADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgyJAQsgA0HhADYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDIgBCyABIARGBEBB4AAhAgyIAQsCQAJAAkACQAJAIAEtAABBCmsOBAEEBAAECyABQQFqIQEMAQsgAUEBaiEBIANBL2otAABBAXFFDQELQdIAIQIMcAsgA0EANgIcIAMgATYCFCADQbYRNgIQIANBCTYCDEEAIQIMiAELIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIcBCyABIARGBEBB3wAhAgyHAQsgAS0AAEEKRgRAIAFBAWohAQwJCyADLQAuQcAAcQ0IIANBADYCHCADIAE2AhQgA0G2ETYCECADQQI2AgxBACECDIYBCyABIARGBEBB3QAhAgyGAQsgAS0AACICQQ1GBEAgAUEBaiEBQdAAIQIMbQsgASEAIAJBCWsOBAUBAQUBCyAEIAEiAEYEQEHcACECDIUBCyAALQAAQQpHDQAgAEEBagwCC0EAIQIgA0EANgIcIAMgADYCFCADQcotNgIQIANBBzYCDAyDAQsgASAERgRAQdsAIQIMgwELAkAgAS0AAEEJaw4EAwAAAwALIAFBAWoLIQFBzgAhAgxoCyABIARGBEBB2gAhAgyBAQsgAS0AAEEJaw4EAAEBAAELQQAhAiADQQA2AhwgA0GaEjYCECADQQc2AgwgAyABQQFqNgIUDH8LIANBgBI7ASpBACEAAkAgAygCOCICRQ0AIAIoAjgiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HZADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDH4LQc0AIQIMZAsgA0EANgIcIAMgATYCFCADQckNNgIQIANBGjYCDEEAIQIMfAsgASAERgRAQdkAIQIMfAsgAS0AAEEgRw09IAFBAWohASADLQAuQQFxDT0gA0EANgIcIAMgATYCFCADQcIcNgIQIANBHjYCDEEAIQIMewsgASAERgRAQdgAIQIMewsCQAJAAkACQAJAIAEtAAAiAEEKaw4EAgMDAAELIAFBAWohAUEsIQIMZQsgAEE6Rw0BIANBADYCHCADIAE2AhQgA0HnETYCECADQQo2AgxBACECDH0LIAFBAWohASADQS9qLQAAQQFxRQ1zIAMtADJBgAFxRQRAIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsCQAJAIAAOFk1MSwEBAQEBAQEBAQEBAQEBAQEBAQABCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgx+CyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgx9C0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ1ZIABBFUcNASADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgx8C0HLACECDGILQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDHoLIAMgAy8BMkGAAXI7ATIMOwsgASAERwRAIANBETYCCCADIAE2AgRBygAhAgxgC0HXACECDHgLIAEgBEYEQEHWACECDHgLAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAQEBAQEBAQEBAQEBAAUBAQAIDQAsgAUEBaiEBQcYAIQIMYQsgAUEBaiEBQccAIQIMYAsgAUEBaiEBQcgAIQIMXwsgAUEBaiEBQckAIQIMXgtB1QAhAiAEIAEiAEYNdiAEIAFrIAMoAgAiAWohBiAAIAFrQQVqIQcDQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQhBBCABQQVGDQoaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHYLQdQAIQIgBCABIgBGDXUgBCABayADKAIAIgFqIQYgACABa0EPaiEHA0AgAUGAyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0HQQMgAUEPRg0JGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx1C0HTACECIAQgASIARg10IAQgAWsgAygCACIBaiEGIAAgAWtBDmohBwNAIAFB4scAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNBiABQQ5GDQcgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdAtB0gAhAiAEIAEiAEYNcyAEIAFrIAMoAgAiAWohBSAAIAFrQQFqIQYDQCABQeDHAGotAAAgAC0AACIHQSByIAcgB0HBAGtB/wFxQRpJG0H/AXFHDQUgAUEBRg0CIAFBAWohASAEIABBAWoiAEcNAAsgAyAFNgIADHMLIAEgBEYEQEHRACECDHMLAkACQCABLQAAIgBBIHIgACAAQcEAa0H/AXFBGkkbQf8BcUHuAGsOBwA5OTk5OQE5CyABQQFqIQFBwwAhAgxaCyABQQFqIQFBxAAhAgxZCyADQQA2AgAgBkEBaiEBQcUAIQIMWAtB0AAhAiAEIAEiAEYNcCAEIAFrIAMoAgAiAWohBiAAIAFrQQlqIQcDQCABQdbHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQJBAiABQQlGDQQaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHALQc8AIQIgBCABIgBGDW8gBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUHQxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxvCyAAIQEgA0EANgIADDMLQQELOgAsIANBADYCACAHQQFqIQELQS0hAgxSCwJAA0AgAS0AAEHQxQBqLQAAQQFHDQEgBCABQQFqIgFHDQALQc0AIQIMawtBwgAhAgxRCyABIARGBEBBzAAhAgxqCyABLQAAQTpGBEAgAygCBCEAIANBADYCBCADIAAgARAwIgBFDTMgA0HLADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxqCyADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgxpCwJAAkAgAy0ALEECaw4CAAEnCyADQTNqLQAAQQJxRQ0mIAMtAC5BAnENJiADQQA2AhwgAyABNgIUIANBphQ2AhAgA0ELNgIMQQAhAgxpCyADLQAyQSBxRQ0lIAMtAC5BAnENJSADQQA2AhwgAyABNgIUIANBvRM2AhAgA0EPNgIMQQAhAgxoC0EAIQACQCADKAI4IgJFDQAgAigCSCICRQ0AIAMgAhEAACEACyAARQRAQcEAIQIMTwsgAEEVRwRAIANBADYCHCADIAE2AhQgA0GmDzYCECADQRw2AgxBACECDGgLIANBygA2AhwgAyABNgIUIANBhRw2AhAgA0EVNgIMQQAhAgxnCyABIARHBEAgASECA0AgBCACIgFrQRBOBEAgAUEQaiEC/Qz/////////////////////IAH9AAAAIg1BB/1sIA39DODg4ODg4ODg4ODg4ODg4OD9bv0MX19fX19fX19fX19fX19fX/0mIA39DAkJCQkJCQkJCQkJCQkJCQn9I/1Q/VL9ZEF/c2giAEEQRg0BIAAgAWohAQwYCyABIARGBEBBxAAhAgxpCyABLQAAQcDBAGotAABBAUcNFyAEIAFBAWoiAkcNAAtBxAAhAgxnC0HEACECDGYLIAEgBEcEQANAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXEiAEEJRg0AIABBIEYNAAJAAkACQAJAIABB4wBrDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTYhAgxSCyABQQFqIQFBNyECDFELIAFBAWohAUE4IQIMUAsMFQsgBCABQQFqIgFHDQALQTwhAgxmC0E8IQIMZQsgASAERgRAQcgAIQIMZQsgA0ESNgIIIAMgATYCBAJAAkACQAJAAkAgAy0ALEEBaw4EFAABAgkLIAMtADJBIHENA0HgASECDE8LAkAgAy8BMiIAQQhxRQ0AIAMtAChBAUcNACADLQAuQQhxRQ0CCyADIABB9/sDcUGABHI7ATIMCwsgAyADLwEyQRByOwEyDAQLIANBADYCBCADIAEgARAxIgAEQCADQcEANgIcIAMgADYCDCADIAFBAWo2AhRBACECDGYLIAFBAWohAQxYCyADQQA2AhwgAyABNgIUIANB9BM2AhAgA0EENgIMQQAhAgxkC0HHACECIAEgBEYNYyADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIABBwMUAai0AACABLQAAQSByRw0BIABBBkYNSiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAxkCyADQQA2AgAMBQsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkcNAyABQQFqIQEMBQsgBCABQQFqIgFHDQALQcUAIQIMZAtBxQAhAgxjCwsgA0EAOgAsDAELQQshAgxHC0E/IQIMRgsCQAJAA0AgAS0AACIAQSBHBEACQCAAQQprDgQDBQUDAAsgAEEsRg0DDAQLIAQgAUEBaiIBRw0AC0HGACECDGALIANBCDoALAwOCyADLQAoQQFHDQIgAy0ALkEIcQ0CIAMoAgQhACADQQA2AgQgAyAAIAEQMSIABEAgA0HCADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxfCyABQQFqIQEMUAtBOyECDEQLAkADQCABLQAAIgBBIEcgAEEJR3ENASAEIAFBAWoiAUcNAAtBwwAhAgxdCwtBPCECDEILAkACQCABIARHBEADQCABLQAAIgBBIEcEQCAAQQprDgQDBAQDBAsgBCABQQFqIgFHDQALQT8hAgxdC0E/IQIMXAsgAyADLwEyQSByOwEyDAoLIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQ1OIANBPjYCHCADIAE2AhQgAyAANgIMQQAhAgxaCwJAIAEgBEcEQANAIAEtAABBwMMAai0AACIAQQFHBEAgAEECRg0DDAwLIAQgAUEBaiIBRw0AC0E3IQIMWwtBNyECDFoLIAFBAWohAQwEC0E7IQIgBCABIgBGDVggBCABayADKAIAIgFqIQYgACABa0EFaiEHAkADQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEFRgRAQQchAQw/CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxZCyADQQA2AgAgACEBDAULQTohAiAEIAEiAEYNVyAEIAFrIAMoAgAiAWohBiAAIAFrQQhqIQcCQANAIAFBtMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQhGBEBBBSEBDD4LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFgLIANBADYCACAAIQEMBAtBOSECIAQgASIARg1WIAQgAWsgAygCACIBaiEGIAAgAWtBA2ohBwJAA0AgAUGwwQBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBA0YEQEEGIQEMPQsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMVwsgA0EANgIAIAAhAQwDCwJAA0AgAS0AACIAQSBHBEAgAEEKaw4EBwQEBwILIAQgAUEBaiIBRw0AC0E4IQIMVgsgAEEsRw0BIAFBAWohAEEBIQECQAJAAkACQAJAIAMtACxBBWsOBAMBAgQACyAAIQEMBAtBAiEBDAELQQQhAQsgA0EBOgAsIAMgAy8BMiABcjsBMiAAIQEMAQsgAyADLwEyQQhyOwEyIAAhAQtBPiECDDsLIANBADoALAtBOSECDDkLIAEgBEYEQEE2IQIMUgsCQAJAAkACQAJAIAEtAABBCmsOBAACAgECCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNAiADQTM2AhwgAyABNgIUIAMgADYCDEEAIQIMVQsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDAYLIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxUCyADLQAuQQFxBEBB3wEhAgw7CyADKAIEIQAgA0EANgIEIAMgACABEDEiAA0BDEkLQTQhAgw5CyADQTU2AhwgAyABNgIUIAMgADYCDEEAIQIMUQtBNSECDDcLIANBL2otAABBAXENACADQQA2AhwgAyABNgIUIANB6xY2AhAgA0EZNgIMQQAhAgxPC0EzIQIMNQsgASAERgRAQTIhAgxOCwJAIAEtAABBCkYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZIXNgIQIANBAzYCDEEAIQIMTgtBMiECDDQLIAEgBEYEQEExIQIMTQsCQCABLQAAIgBBCUYNACAAQSBGDQBBASECAkAgAy0ALEEFaw4EBgQFAA0LIAMgAy8BMkEIcjsBMgwMCyADLQAuQQFxRQ0BIAMtACxBCEcNACADQQA6ACwLQT0hAgwyCyADQQA2AhwgAyABNgIUIANBwhY2AhAgA0EKNgIMQQAhAgxKC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyDAYLIAEgBEYEQEEwIQIMRwsgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQQFxDQAgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMRgtBMCECDCwLIAFBAWohAUExIQIMKwsgASAERgRAQS8hAgxECyABLQAAIgBBCUcgAEEgR3FFBEAgAUEBaiEBIAMtAC5BAXENASADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgxEC0EBIQICQAJAAkACQAJAAkAgAy0ALEECaw4HBQQEAwECAAQLIAMgAy8BMkEIcjsBMgwDC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyC0EvIQIMKwsgA0EANgIcIAMgATYCFCADQYQTNgIQIANBCzYCDEEAIQIMQwtB4QEhAgwpCyABIARGBEBBLiECDEILIANBADYCBCADQRI2AgggAyABIAEQMSIADQELQS4hAgwnCyADQS02AhwgAyABNgIUIAMgADYCDEEAIQIMPwtBACEAAkAgAygCOCICRQ0AIAIoAkwiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HYADYCHCADIAE2AhQgA0GzGzYCECADQRU2AgxBACECDD4LQcwAIQIMJAsgA0EANgIcIAMgATYCFCADQbMONgIQIANBHTYCDEEAIQIMPAsgASAERgRAQc4AIQIMPAsgAS0AACIAQSBGDQIgAEE6Rg0BCyADQQA6ACxBCSECDCELIAMoAgQhACADQQA2AgQgAyAAIAEQMCIADQEMAgsgAy0ALkEBcQRAQd4BIQIMIAsgAygCBCEAIANBADYCBCADIAAgARAwIgBFDQIgA0EqNgIcIAMgADYCDCADIAFBAWo2AhRBACECDDgLIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMNwsgAUEBaiEBQcAAIQIMHQsgAUEBaiEBDCwLIAEgBEYEQEErIQIMNQsCQCABLQAAQQpGBEAgAUEBaiEBDAELIAMtAC5BwABxRQ0GCyADLQAyQYABcQRAQQAhAAJAIAMoAjgiAkUNACACKAJcIgJFDQAgAyACEQAAIQALIABFDRIgAEEVRgRAIANBBTYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDDYLIANBADYCHCADIAE2AhQgA0GQDjYCECADQRQ2AgxBACECDDULIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsgAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIANBAToAMAsgAiACLwEAQcAAcjsBAAtBKyECDBgLIANBKTYCHCADIAE2AhQgA0GsGTYCECADQRU2AgxBACECDDALIANBADYCHCADIAE2AhQgA0HlCzYCECADQRE2AgxBACECDC8LIANBADYCHCADIAE2AhQgA0GlCzYCECADQQI2AgxBACECDC4LQQEhByADLwEyIgVBCHFFBEAgAykDIEIAUiEHCwJAIAMtADAEQEEBIQAgAy0AKUEFRg0BIAVBwABxRSAHcUUNAQsCQCADLQAoIgJBAkYEQEEBIQAgAy8BNCIGQeUARg0CQQAhACAFQcAAcQ0CIAZB5ABGDQIgBkHmAGtBAkkNAiAGQcwBRg0CIAZBsAJGDQIMAQtBACEAIAVBwABxDQELQQIhACAFQQhxDQAgBUGABHEEQAJAIAJBAUcNACADLQAuQQpxDQBBBSEADAILQQQhAAwBCyAFQSBxRQRAIAMQNkEAR0ECdCEADAELQQBBAyADKQMgUBshAAsgAEEBaw4FAgAHAQMEC0ERIQIMEwsgA0EBOgAxDCkLQQAhAgJAIAMoAjgiAEUNACAAKAIwIgBFDQAgAyAAEQAAIQILIAJFDSYgAkEVRgRAIANBAzYCHCADIAE2AhQgA0HSGzYCECADQRU2AgxBACECDCsLQQAhAiADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMDCoLIANBADYCHCADIAE2AhQgA0H5IDYCECADQQ82AgxBACECDCkLQQAhAAJAIAMoAjgiAkUNACACKAIwIgJFDQAgAyACEQAAIQALIAANAQtBDiECDA4LIABBFUYEQCADQQI2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwnCyADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMQQAhAgwmC0EqIQIMDAsgASAERwRAIANBCTYCCCADIAE2AgRBKSECDAwLQSYhAgwkCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMVARAQSUhAgwkCyADKAIEIQAgA0EANgIEIAMgACABIAynaiIBEDIiAEUNACADQQU2AhwgAyABNgIUIAMgADYCDEEAIQIMIwtBDyECDAkLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQTBrDjcXFgABAgMEBQYHFBQUFBQUFAgJCgsMDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUDg8QERITFAtCAiEKDBYLQgMhCgwVC0IEIQoMFAtCBSEKDBMLQgYhCgwSC0IHIQoMEQtCCCEKDBALQgkhCgwPC0IKIQoMDgtCCyEKDA0LQgwhCgwMC0INIQoMCwtCDiEKDAoLQg8hCgwJC0IKIQoMCAtCCyEKDAcLQgwhCgwGC0INIQoMBQtCDiEKDAQLQg8hCgwDCyADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMQQAhAgwhCyABIARGBEBBIiECDCELQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FRQAAQIDBAUGBxYWFhYWFhYICQoLDA0WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFg4PEBESExYLQgIhCgwUC0IDIQoMEwtCBCEKDBILQgUhCgwRC0IGIQoMEAtCByEKDA8LQgghCgwOC0IJIQoMDQtCCiEKDAwLQgshCgwLC0IMIQoMCgtCDSEKDAkLQg4hCgwIC0IPIQoMBwtCCiEKDAYLQgshCgwFC0IMIQoMBAtCDSEKDAMLQg4hCgwCC0IPIQoMAQtCASEKCyABQQFqIQEgAykDICILQv//////////D1gEQCADIAtCBIYgCoQ3AyAMAgsgA0EANgIcIAMgATYCFCADQbUJNgIQIANBDDYCDEEAIQIMHgtBJyECDAQLQSghAgwDCyADIAE6ACwgA0EANgIAIAdBAWohAUEMIQIMAgsgA0EANgIAIAZBAWohAUEKIQIMAQsgAUEBaiEBQQghAgwACwALQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBcLQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBYLQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBULQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDBQLQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDBMLQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBILQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBELQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBALQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDA8LQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDA4LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDA0LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDAwLQQAhAiADQQA2AhwgAyABNgIUIANBmRM2AhAgA0ELNgIMDAsLQQAhAiADQQA2AhwgAyABNgIUIANBnQk2AhAgA0ELNgIMDAoLQQAhAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMDAkLQQAhAiADQQA2AhwgAyABNgIUIANBsRA2AhAgA0EKNgIMDAgLQQAhAiADQQA2AhwgAyABNgIUIANBux02AhAgA0ECNgIMDAcLQQAhAiADQQA2AhwgAyABNgIUIANBlhY2AhAgA0ECNgIMDAYLQQAhAiADQQA2AhwgAyABNgIUIANB+Rg2AhAgA0ECNgIMDAULQQAhAiADQQA2AhwgAyABNgIUIANBxBg2AhAgA0ECNgIMDAQLIANBAjYCHCADIAE2AhQgA0GpHjYCECADQRY2AgxBACECDAMLQd4AIQIgASAERg0CIAlBCGohByADKAIAIQUCQAJAIAEgBEcEQCAFQZbIAGohCCAEIAVqIAFrIQYgBUF/c0EKaiIFIAFqIQADQCABLQAAIAgtAABHBEBBAiEIDAMLIAVFBEBBACEIIAAhAQwDCyAFQQFrIQUgCEEBaiEIIAQgAUEBaiIBRw0ACyAGIQUgBCEBCyAHQQE2AgAgAyAFNgIADAELIANBADYCACAHIAg2AgALIAcgATYCBCAJKAIMIQACQAJAIAkoAghBAWsOAgQBAAsgA0EANgIcIANBwh42AhAgA0EXNgIMIAMgAEEBajYCFEEAIQIMAwsgA0EANgIcIAMgADYCFCADQdceNgIQIANBCTYCDEEAIQIMAgsgASAERgRAQSghAgwCCyADQQk2AgggAyABNgIEQSchAgwBCyABIARGBEBBASECDAELA0ACQAJAAkAgAS0AAEEKaw4EAAEBAAELIAFBAWohAQwBCyABQQFqIQEgAy0ALkEgcQ0AQQAhAiADQQA2AhwgAyABNgIUIANBoSE2AhAgA0EFNgIMDAILQQEhAiABIARHDQALCyAJQRBqJAAgAkUEQCADKAIMIQAMAQsgAyACNgIcQQAhACADKAIEIgFFDQAgAyABIAQgAygCCBEBACIBRQ0AIAMgBDYCFCADIAE2AgwgASEACyAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQOGooAgAPCwALFwAgAEEvTwRAAAsgAEECdEHsOWooAgALvwkBAX9B9C0hAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HqLA8LQZgmDwtB7TEPC0GgNw8LQckpDwtBtCkPC0GWLQ8LQesrDwtBojUPC0HbNA8LQeApDwtB4yQPC0HVJA8LQe4kDwtB5iUPC0HKNA8LQdA3DwtBqjUPC0H1LA8LQfYmDwtBgiIPC0HyMw8LQb4oDwtB5zcPC0HNIQ8LQcAhDwtBuCUPC0HLJQ8LQZYkDwtBjzQPC0HNNQ8LQd0qDwtB7jMPC0GcNA8LQZ4xDwtB9DUPC0HlIg8LQa8lDwtBmTEPC0GyNg8LQfk2DwtBxDIPC0HdLA8LQYIxDwtBwTEPC0GNNw8LQckkDwtB7DYPC0HnKg8LQcgjDwtB4iEPC0HJNw8LQaUiDwtBlCIPC0HbNg8LQd41DwtBhiYPC0G8Kw8LQYsyDwtBoCMPC0H2MA8LQYAsDwtBiSsPC0GkJg8LQfIjDwtBgSgPC0GrMg8LQesnDwtBwjYPC0GiJA8LQc8qDwtB3CMPC0GHJw8LQeQ0DwtBtyIPC0GtMQ8LQdUiDwtBrzQPC0HeJg8LQdYyDwtB9DQPC0GBOA8LQfQ3DwtBkjYPC0GdJw8LQYIpDwtBjSMPC0HXMQ8LQb01DwtBtDcPC0HYMA8LQbYnDwtBmjgPC0GnKg8LQcQnDwtBriMPC0H1Ig8LAAtByiYhAQsgAQsXACAAIAAvAS5B/v8DcSABQQBHcjsBLgsaACAAIAAvAS5B/f8DcSABQQBHQQF0cjsBLgsaACAAIAAvAS5B+/8DcSABQQBHQQJ0cjsBLgsaACAAIAAvAS5B9/8DcSABQQBHQQN0cjsBLgsaACAAIAAvAS5B7/8DcSABQQBHQQR0cjsBLgsaACAAIAAvAS5B3/8DcSABQQBHQQV0cjsBLgsaACAAIAAvAS5Bv/8DcSABQQBHQQZ0cjsBLgsaACAAIAAvAS5B//4DcSABQQBHQQd0cjsBLgsaACAAIAAvAS5B//0DcSABQQBHQQh0cjsBLgsaACAAIAAvAS5B//sDcSABQQBHQQl0cjsBLgs+AQJ/AkAgACgCOCIDRQ0AIAMoAgQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeESNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAggiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfwRNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAgwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQewKNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfoeNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQcsQNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhgiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQbcfNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQb8VNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQf4INgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQYwdNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeYVNgIQQRghBAsgBAs4ACAAAn8gAC8BMkEUcUEURgRAQQEgAC0AKEEBRg0BGiAALwE0QeUARgwBCyAALQApQQVGCzoAMAtZAQJ/AkAgAC0AKEEBRg0AIAAvATQiAUHkAGtB5ABJDQAgAUHMAUYNACABQbACRg0AIAAvATIiAEHAAHENAEEBIQIgAEGIBHFBgARGDQAgAEEocUUhAgsgAguMAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQAgAC8BMiIBQQJxRQ0BDAILIAAvATIiAUEBcUUNAQtBASECIAAtAChBAUYNACAALwE0IgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNACABQcAAcQ0AQQAhAiABQYgEcUGABEYNACABQShxQQBHIQILIAILcwAgAEEQav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAP0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEwav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEgav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",Qcr;Object.defineProperty(uHn,"exports",{get:a(()=>Qcr||(Qcr=yNs.from(_Ns,"base64")),"get")})});var W2e=I((nyf,_Hn)=>{"use strict";p();var fHn=["GET","HEAD","POST"],ENs=new Set(fHn),vNs=[101,204,205,304],pHn=[301,302,303,307,308],CNs=new Set(pHn),hHn=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],bNs=new Set(hHn),mHn=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],SNs=["",...mHn],TNs=new Set(mHn),INs=["follow","manual","error"],gHn=["GET","HEAD","OPTIONS","TRACE"],xNs=new Set(gHn),wNs=["navigate","same-origin","no-cors","cors"],RNs=["omit","same-origin","include"],kNs=["default","no-store","reload","no-cache","force-cache","only-if-cached"],PNs=["content-encoding","content-language","content-location","content-type","content-length"],DNs=["half"],AHn=["CONNECT","TRACE","TRACK"],NNs=new Set(AHn),yHn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],MNs=new Set(yHn);_Hn.exports={subresource:yHn,forbiddenMethods:AHn,requestBodyHeader:PNs,referrerPolicy:SNs,requestRedirect:INs,requestMode:wNs,requestCredentials:RNs,requestCache:kNs,redirectStatus:pHn,corsSafeListedMethods:fHn,nullBodyStatus:vNs,safeMethods:gHn,badPorts:hHn,requestDuplex:DNs,subresourceSet:MNs,badPortsSet:bNs,redirectStatusSet:CNs,corsSafeListedMethodsSet:ENs,safeMethodsSet:xNs,forbiddenMethodsSet:NNs,referrerPolicyTokens:TNs}});var jcr=I((oyf,EHn)=>{"use strict";p();var qcr=Symbol.for("undici.globalOrigin.1");function ONs(){return globalThis[qcr]}a(ONs,"getGlobalOrigin");function LNs(t){if(t===void 0){Object.defineProperty(globalThis,qcr,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,qcr,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(LNs,"setGlobalOrigin");EHn.exports={getGlobalOrigin:ONs,setGlobalOrigin:LNs}});var rct=I((cyf,vHn)=>{"use strict";p();var BNs=new TextDecoder;function FNs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),BNs.decode(t))}a(FNs,"utf8DecodeBytes");vHn.exports={utf8DecodeBytes:FNs}});var T8=I((dyf,THn)=>{"use strict";p();var CHn=require("node:assert"),{utf8DecodeBytes:UNs}=rct();function QNs(t,e,r){let n="";for(;r.positione)return String.fromCharCode.apply(null,t);let r="",n=0,o=65535;for(;ne&&(o=e-n),r+=String.fromCharCode.apply(null,t.subarray(n,n+=o));return r}a(GNs,"isomorphicDecode");var $Ns=/[^\x00-\xFF]/;function VNs(t){return CHn(!$Ns.test(t)),t}a(VNs,"isomorphicEncode");function WNs(t){return JSON.parse(UNs(t))}a(WNs,"parseJSONFromBytes");function zNs(t,e=!0,r=!0){return SHn(t,e,r,bHn)}a(zNs,"removeASCIIWhitespace");function SHn(t,e,r,n){let o=0,s=t.length-1;if(e)for(;o0&&n(t.charCodeAt(s));)s--;return o===0&&s===t.length-1?t:t.slice(o,s+1)}a(SHn,"removeChars");function YNs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return CHn(typeof e=="string"),e}a(YNs,"serializeJavascriptValueToJSONString");THn.exports={collectASequenceOfCodePoints:QNs,collectASequenceOfCodePointsFast:qNs,forgivingBase64:HNs,isASCIIWhitespace:bHn,isomorphicDecode:GNs,isomorphicEncode:VNs,parseJSONFromBytes:WNs,removeASCIIWhitespace:zNs,removeChars:SHn,serializeJavascriptValueToJSONString:YNs}});var sR=I((hyf,PHn)=>{"use strict";p();var ict=require("node:assert"),{forgivingBase64:KNs,collectASequenceOfCodePoints:Hcr,collectASequenceOfCodePointsFast:z2e,isomorphicDecode:JNs,removeASCIIWhitespace:ZNs,removeChars:XNs}=T8(),eMs=new TextEncoder,Y2e=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,tMs=/[\u000A\u000D\u0009\u0020]/u,rMs=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function nMs(t){ict(t.protocol==="data:");let e=wHn(t,!0);e=e.slice(5);let r={position:0},n=z2e(",",e,r),o=n.length;if(n=ZNs(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=RHn(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=JNs(c);if(c=KNs(u),c==="failure")return"failure";n=n.slice(0,-6),n=n.replace(/(\u0020+)$/u,""),n=n.slice(0,-1)}n.startsWith(";")&&(n="text/plain"+n);let l=Gcr(n);return l==="failure"&&(l=Gcr("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(nMs,"dataURLProcessor");function wHn(t,e=!1){if(!e)return t.href;let r=t.href,n=t.hash.length,o=n===0?r:r.substring(0,r.length-n);return!n&&r.endsWith("#")?o.slice(0,-1):o}a(wHn,"URLSerializer");function RHn(t){let e=eMs.encode(t);return iMs(e)}a(RHn,"stringPercentDecode");function IHn(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(IHn,"isHexCharByte");function xHn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(xHn,"hexByteToNumber");function iMs(t){let e=t.length,r=new Uint8Array(e),n=0,o=0;for(;o=t.length)return"failure";e.position++;let n=z2e(";",t,e);if(n=nct(n,!1,!0),n.length===0||!Y2e.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positiontMs.test(d),t,e);let l=Hcr(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=kHn(t,e,!0),z2e(";",t,e);else if(u=z2e(";",t,e),u=nct(u,!1,!0),u.length===0)continue;l.length!==0&&Y2e.test(l)&&(u.length===0||rMs.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(Gcr,"parseMIMEType");function kHn(t,e,r=!1){let n=e.position,o="";for(ict(t[e.position]==='"'),e.position++;o+=Hcr(c=>c!=='"'&&c!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){o+="\\";break}o+=t[e.position],e.position++}else{ict(s==='"');break}}return r?o:t.slice(n,e.position)}a(kHn,"collectAnHTTPQuotedString");function oMs(t){ict(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",Y2e.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(oMs,"serializeAMimeType");function sMs(t){return t===13||t===10||t===9||t===32}a(sMs,"isHTTPWhiteSpace");function nct(t,e=!0,r=!0){return XNs(t,e,r,sMs)}a(nct,"removeHTTPWhitespace");function aMs(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}a(aMs,"minimizeSupportedMimeType");PHn.exports={dataURLProcessor:nMs,URLSerializer:wHn,stringPercentDecode:RHn,parseMIMEType:Gcr,collectAnHTTPQuotedString:kHn,serializeAMimeType:oMs,removeHTTPWhitespace:nct,minimizeSupportedMimeType:aMs,HTTP_TOKEN_CODEPOINTS:Y2e}});var I8=I((Ayf,Vcr)=>{"use strict";p();var DHn={__proto__:null,"node:crypto":a(()=>require("node:crypto"),"node:crypto"),"node:sqlite":a(()=>require("node:sqlite"),"node:sqlite"),"node:worker_threads":a(()=>require("node:worker_threads"),"node:worker_threads"),"node:zlib":a(()=>require("node:zlib"),"node:zlib")};function cMs(t){try{return DHn[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(cMs,"detectRuntimeFeatureByNodeModule");function lMs(t,e){return typeof DHn[t]()[e]<"u"}a(lMs,"detectRuntimeFeatureByExportedProperty");var NHn=["markAsUncloneable","zstd"],uMs={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},MHn=["crypto","sqlite"],dMs=[...MHn,...NHn];function fMs(t){if(MHn.includes(t))return cMs(`node:${t}`);if(NHn.includes(t)){let[e,r]=uMs[t];return lMs(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(fMs,"detectRuntimeFeature");var $cr=class{static{a(this,"RuntimeFeatures")}#e=new Map;clear(){this.#e.clear()}has(e){return this.#e.get(e)??this.#t(e)}set(e,r){if(dMs.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=fMs(e);return this.#e.set(e,r),r}},OHn=new $cr;Vcr.exports.runtimeFeatures=OHn;Vcr.exports.default=OHn});var oy=I((Eyf,BHn)=>{"use strict";p();var pMs=require("node:assert"),{types:Sp,inspect:hMs}=require("node:util"),{runtimeFeatures:mMs}=I8(),Wcr=1,zcr=2,oct=3,sct=4,Ycr=5,act=6,Kcr=7,$T=8,LHn=Function.call.bind(Function.prototype[Symbol.hasInstance]),dt={converters:{},util:{},errors:{},is:{}};dt.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};dt.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return dt.errors.exception({header:t.prefix,message:r})};dt.errors.invalidArgument=function(t){return dt.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};dt.brandCheck=function(t,e){if(!LHn(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};dt.brandCheckMultiple=function(t){let e=t.map(r=>dt.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};dt.argumentLengthCheck=function({length:t},e,r){if(tLHn(t,e)};dt.util.Type=function(t){switch(typeof t){case"undefined":return Wcr;case"boolean":return zcr;case"string":return oct;case"symbol":return sct;case"number":return Ycr;case"bigint":return act;case"function":case"object":return t===null?Kcr:$T}};dt.util.Types={UNDEFINED:Wcr,BOOLEAN:zcr,STRING:oct,SYMBOL:sct,NUMBER:Ycr,BIGINT:act,NULL:Kcr,OBJECT:$T};dt.util.TypeValueToString=function(t){switch(dt.util.Type(t)){case Wcr:return"Undefined";case zcr:return"Boolean";case oct:return"String";case sct:return"Symbol";case Ycr:return"Number";case act:return"BigInt";case Kcr:return"Null";case $T:return"Object"}};dt.util.markAsUncloneable=mMs.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};dt.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=-Math.pow(2,e-1),o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),dt.util.HasFlag(n,dt.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw dt.errors.exception({header:"Integer conversion",message:`Could not convert ${dt.util.Stringify(t)} to an integer.`});if(c=dt.util.IntegerPart(c),co)throw dt.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&dt.util.HasFlag(n,dt.attributes.Clamp)?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=dt.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};dt.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};dt.util.Stringify=function(t){switch(dt.util.Type(t)){case sct:return`Symbol(${t.description})`;case $T:return hMs(t);case oct:return`"${t}"`;case act:return`${t}n`;default:return`${t}`}};dt.util.IsResizableArrayBuffer=function(t){if(Sp.isArrayBuffer(t))return t.resizable;if(Sp.isSharedArrayBuffer(t))return t.growable;throw dt.errors.exception({header:"IsResizableArrayBuffer",message:`"${dt.util.Stringify(t)}" is not an array buffer.`})};dt.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};dt.sequenceConverter=function(t){return(e,r,n,o)=>{if(dt.util.Type(e)!==$T)throw dt.errors.exception({header:r,message:`${n} (${dt.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw dt.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};dt.recordConverter=function(t,e){return(r,n,o)=>{if(dt.util.Type(r)!==$T)throw dt.errors.exception({header:n,message:`${o} ("${dt.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!Sp.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=dt.util.Stringify(u),f=t(u,n,`Key ${d} in ${o}`),h=e(r[u],n,`${o}[${d}]`);s[f]=h}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};dt.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw dt.errors.exception({header:n,message:`Expected ${o} ("${dt.util.Stringify(r)}") to be an instance of ${e}.`});return r}};dt.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&&dt.util.Type(e)!==$T)throw dt.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let s of t){let{key:c,defaultValue:l,required:u,converter:d}=s;if(u===!0&&(e==null||!Object.hasOwn(e,c)))throw dt.errors.exception({header:r,message:`Missing required key "${c}".`});let f=e?.[c],h=l!==void 0;if(h&&f===void 0&&(f=l()),u||h||f!==void 0){if(f=d(f,r,`${n}.${c}`),s.allowedValues&&!s.allowedValues.includes(f))throw dt.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};dt.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};dt.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};dt.is.ReadableStream=dt.util.MakeTypeAssertion(ReadableStream);dt.is.Blob=dt.util.MakeTypeAssertion(Blob);dt.is.URLSearchParams=dt.util.MakeTypeAssertion(URLSearchParams);dt.is.File=dt.util.MakeTypeAssertion(File);dt.is.URL=dt.util.MakeTypeAssertion(URL);dt.is.AbortSignal=dt.util.MakeTypeAssertion(AbortSignal);dt.is.MessagePort=dt.util.MakeTypeAssertion(MessagePort);dt.is.BufferSource=function(t){return Sp.isArrayBuffer(t)||ArrayBuffer.isView(t)&&Sp.isArrayBuffer(t.buffer)};dt.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(Sp.isTypedArray(e)||Sp.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(pMs(Sp.isAnyArrayBuffer(e)),o=e.byteLength),r.detached)return new Uint8Array(0);let s=new Uint8Array(o),c=new Uint8Array(r,n,o);return s.set(c),s};dt.converters.DOMString=function(t,e,r,n){if(t===null&&dt.util.HasFlag(n,dt.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw dt.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};dt.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw dt.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a ByteString.`});let n=String(t);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};dt.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};dt.converters.boolean=function(t){return!!t};dt.converters.any=function(t){return t};dt.converters["long long"]=function(t,e,r){return dt.util.ConvertToInt(t,64,"signed",0,e,r)};dt.converters["unsigned long long"]=function(t,e,r){return dt.util.ConvertToInt(t,64,"unsigned",0,e,r)};dt.converters["unsigned long"]=function(t,e,r){return dt.util.ConvertToInt(t,32,"unsigned",0,e,r)};dt.converters["unsigned short"]=function(t,e,r,n){return dt.util.ConvertToInt(t,16,"unsigned",n,e,r)};dt.converters.ArrayBuffer=function(t,e,r,n){if(dt.util.Type(t)!==$T||!Sp.isArrayBuffer(t))throw dt.errors.conversionFailed({prefix:e,argument:`${r} ("${dt.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!dt.util.HasFlag(n,dt.attributes.AllowResizable)&&dt.util.IsResizableArrayBuffer(t))throw dt.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};dt.converters.SharedArrayBuffer=function(t,e,r,n){if(dt.util.Type(t)!==$T||!Sp.isSharedArrayBuffer(t))throw dt.errors.conversionFailed({prefix:e,argument:`${r} ("${dt.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!dt.util.HasFlag(n,dt.attributes.AllowResizable)&&dt.util.IsResizableArrayBuffer(t))throw dt.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};dt.converters.TypedArray=function(t,e,r,n,o){if(dt.util.Type(t)!==$T||!Sp.isTypedArray(t)||t.constructor.name!==e.name)throw dt.errors.conversionFailed({prefix:r,argument:`${n} ("${dt.util.Stringify(t)}")`,types:[e.name]});if(!dt.util.HasFlag(o,dt.attributes.AllowShared)&&Sp.isSharedArrayBuffer(t.buffer))throw dt.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!dt.util.HasFlag(o,dt.attributes.AllowResizable)&&dt.util.IsResizableArrayBuffer(t.buffer))throw dt.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};dt.converters.DataView=function(t,e,r,n){if(dt.util.Type(t)!==$T||!Sp.isDataView(t))throw dt.errors.conversionFailed({prefix:e,argument:`${r} ("${dt.util.Stringify(t)}")`,types:["DataView"]});if(!dt.util.HasFlag(n,dt.attributes.AllowShared)&&Sp.isSharedArrayBuffer(t.buffer))throw dt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!dt.util.HasFlag(n,dt.attributes.AllowResizable)&&dt.util.IsResizableArrayBuffer(t.buffer))throw dt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};dt.converters.ArrayBufferView=function(t,e,r,n){if(dt.util.Type(t)!==$T||!Sp.isArrayBufferView(t))throw dt.errors.conversionFailed({prefix:e,argument:`${r} ("${dt.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!dt.util.HasFlag(n,dt.attributes.AllowShared)&&Sp.isSharedArrayBuffer(t.buffer))throw dt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!dt.util.HasFlag(n,dt.attributes.AllowResizable)&&dt.util.IsResizableArrayBuffer(t.buffer))throw dt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};dt.converters.BufferSource=function(t,e,r,n){if(Sp.isArrayBuffer(t))return dt.converters.ArrayBuffer(t,e,r,n);if(Sp.isArrayBufferView(t))return n&=~dt.attributes.AllowShared,dt.converters.ArrayBufferView(t,e,r,n);throw Sp.isSharedArrayBuffer(t)?dt.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):dt.errors.conversionFailed({prefix:e,argument:`${r} ("${dt.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};dt.converters.AllowSharedBufferSource=function(t,e,r,n){if(Sp.isArrayBuffer(t))return dt.converters.ArrayBuffer(t,e,r,n);if(Sp.isSharedArrayBuffer(t))return dt.converters.SharedArrayBuffer(t,e,r,n);if(Sp.isArrayBufferView(t))return n|=dt.attributes.AllowShared,dt.converters.ArrayBufferView(t,e,r,n);throw dt.errors.conversionFailed({prefix:e,argument:`${r} ("${dt.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};dt.converters["sequence"]=dt.sequenceConverter(dt.converters.ByteString);dt.converters["sequence>"]=dt.sequenceConverter(dt.converters["sequence"]);dt.converters["record"]=dt.recordConverter(dt.converters.ByteString,dt.converters.ByteString);dt.converters.Blob=dt.interfaceConverter(dt.is.Blob,"Blob");dt.converters.AbortSignal=dt.interfaceConverter(dt.is.AbortSignal,"AbortSignal");dt.converters.EventHandlerNonNull=function(t){return dt.util.Type(t)!==$T?null:typeof t=="function"?t:()=>{}};dt.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};BHn.exports={webidl:dt}});var VT=I((Cyf,JHn)=>{"use strict";p();var{Transform:gMs}=require("node:stream"),FHn=require("node:zlib"),{redirectStatusSet:AMs,referrerPolicyTokens:yMs,badPortsSet:_Ms}=W2e(),{getGlobalOrigin:UHn}=jcr(),{collectAnHTTPQuotedString:EMs,parseMIMEType:vMs}=sR(),{performance:CMs}=require("node:perf_hooks"),{ReadableStreamFrom:bMs,isValidHTTPToken:QHn,normalizedMethodRecordsBase:SMs}=No(),J2e=require("node:assert"),{isUint8Array:TMs}=require("node:util/types"),{webidl:DH}=oy(),{isomorphicEncode:Jcr,collectASequenceOfCodePoints:yX,removeChars:IMs}=T8();function qHn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(qHn,"responseURL");function xMs(t,e){if(!AMs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&HHn(r)&&(jHn(r)||(r=wMs(r)),r=new URL(r,qHn(t))),r&&!r.hash&&(r.hash=e),r}a(xMs,"responseLocationURL");function jHn(t){for(let e=0;e126||r<32)return!1}return!0}a(jHn,"isValidEncodedURL");function wMs(t){return Buffer.from(t,"binary").toString("utf8")}a(wMs,"normalizeBinaryStringToUtf8");function EX(t){return t.urlList[t.urlList.length-1]}a(EX,"requestCurrentURL");function RMs(t){let e=EX(t);return YHn(e)&&_Ms.has(e.port)?"blocked":"allowed"}a(RMs,"requestBadPort");function kMs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(kMs,"isErrorLike");function PMs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(PMs,"isValidReasonPhrase");var DMs=QHn;function HHn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(HHn,"isValidHeaderValue");function NMs(t){let e=(t.headersList.get("referrer-policy",!0)??"").split(","),r="";if(e.length)for(let n=e.length;n!==0;n--){let o=e[n-1].trim();if(yMs.has(o)){r=o;break}}return r}a(NMs,"parseReferrerPolicy");function MMs(t,e){let r=NMs(e);r!==""&&(t.referrerPolicy=r)}a(MMs,"setRequestReferrerPolicyOnRedirect");function OMs(){return"allowed"}a(OMs,"crossOriginResourcePolicyCheck");function LMs(){return"success"}a(LMs,"corsCheck");function BMs(){return"success"}a(BMs,"TAOCheck");function FMs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(FMs,"appendFetchMetadata");function UMs(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&Xcr(t.origin)&&!Xcr(EX(t))&&(e=null);break;case"same-origin":K2e(t,EX(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(UMs,"appendRequestOriginHeader");function Ehe(t,e){return t}a(Ehe,"coarsenTime");function QMs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??Zcr(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=EX(t);return _X(n)&&!_X(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=EX(t);return K2e(n,s)?n:_X(n)&&!_X(s)?"no-referrer":o}case"same-origin":return K2e(t,n)?n:"no-referrer";case"origin-when-cross-origin":return K2e(t,n)?n:o;case"no-referrer-when-downgrade":{let s=EX(t);return _X(n)&&!_X(s)?"no-referrer":n}}}a(GMs,"determineRequestsReferrer");function Zcr(t,e=!1){return J2e(DH.is.URL(t)),t=new URL(t),zHn(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(Zcr,"stripURLForReferrer");var $Ms=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),VMs=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function $Hn(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),VMs(t)):$Ms(t)}a($Hn,"isOriginIPPotentiallyTrustworthy");function WMs(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||$Hn(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(WMs,"isOriginPotentiallyTrustworthy");function _X(t){return DH.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:WMs(t.origin):!1}a(_X,"isURLPotentiallyTrustworthy");function zMs(t){}a(zMs,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function K2e(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(K2e,"sameOrigin");function YMs(t){return t.controller.state==="aborted"}a(YMs,"isAborted");function KMs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(KMs,"isCancelled");function JMs(t){return SMs[t.toLowerCase()]??t}a(JMs,"normalizeMethod");var ZMs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function VHn(t,e,r=0,n=1){class o{static{a(this,"FastIterableIterator")}#e;#t;#r;constructor(c,l){this.#e=c,this.#t=l,this.#r=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let c=this.#r,l=e(this.#e),u=l.length;if(c>=u)return{value:void 0,done:!0};let{[r]:d,[n]:f}=l[c];this.#r=c+1;let h;switch(this.#t){case"key":h=d;break;case"value":h=f;break;case"key+value":h=[d,f];break}return{value:h,done:!1}}}return delete o.prototype.constructor,Object.setPrototypeOf(o.prototype,ZMs),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,c){return new o(s,c)}}a(VHn,"createIterator");function XMs(t,e,r,n=0,o=1){let s=VHn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return DH.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return DH.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return DH.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(DH.brandCheck(this,e),DH.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof u!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:f,1:h}of s(this,"key+value"))u.call(d,h,f,this)},"forEach")}};return Object.defineProperties(e.prototype,{...c,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:c.entries.value}})}a(XMs,"iteratorMixin");function eOs(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();WHn(s,n,o)}catch(s){o(s)}}a(eOs,"fullyReadBody");function tOs(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}a(tOs,"readableStreamClose");async function WHn(t,e,r){try{let n=[],o=0;do{let{done:s,value:c}=await t.read();if(s){e(Buffer.concat(n,o));return}if(!TMs(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(WHn,"readAllBytes");function zHn(t){J2e("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(zHn,"urlIsLocal");function Xcr(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}a(Xcr,"urlHasHttpsScheme");function YHn(t){J2e("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(YHn,"urlIsHttpHttpsScheme");function rOs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&yX(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&yX(u=>u===" "||u===" ",r,n);let o=yX(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&yX(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&yX(u=>u===" "||u===" ",r,n);let c=yX(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(rOs,"simpleRangeHeaderValue");function nOs(t,e,r){let n="bytes ";return n+=Jcr(`${t}`),n+="-",n+=Jcr(`${e}`),n+="/",n+=Jcr(`${r}`),n}a(nOs,"buildContentRange");var elr=class extends gMs{static{a(this,"InflateStream")}#e;constructor(e){super(),this.#e=e}_transform(e,r,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)===8?FHn.createInflate(this.#e):FHn.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",o=>this.destroy(o))}this._inflateStream.write(e,r,n)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function iOs(t){return new elr(t)}a(iOs,"createInflate");function oOs(t){let e=null,r=null,n=null,o=KHn("content-type",t);if(o===null)return"failure";for(let s of o){let c=vMs(s);c==="failure"||c.essence==="*/*"||(n=c,n.essence!==r?(e=null,n.parameters.has("charset")&&(e=n.parameters.get("charset")),r=n.essence):!n.parameters.has("charset")&&e!==null&&n.parameters.set("charset",e))}return n??"failure"}a(oOs,"extractMimeType");function sOs(t){let e=t,r={position:0},n=[],o="";for(;r.positions!=='"'&&s!==",",e,r),r.positions===9||s===32),n.push(o),o=""}return n}a(sOs,"gettingDecodingSplitting");function KHn(t,e){let r=e.get(t,!0);return r===null?null:sOs(r)}a(KHn,"getDecodeSplit");function aOs(t){return!1}a(aOs,"hasAuthenticationEntry");function cOs(t){return!!(t.username||t.password)}a(cOs,"includesCredentials");function lOs(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(lOs,"isTraversableNavigable");var tlr=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return UHn()}get origin(){return this.baseUrl?.origin}policyContainer=GHn()},rlr=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new tlr},uOs=new rlr;JHn.exports={isAborted:YMs,isCancelled:KMs,isValidEncodedURL:jHn,ReadableStreamFrom:bMs,tryUpgradeRequestToAPotentiallyTrustworthyURL:zMs,clampAndCoarsenConnectionTimingInfo:QMs,coarsenedSharedCurrentTime:qMs,determineRequestsReferrer:GMs,makePolicyContainer:GHn,clonePolicyContainer:HMs,appendFetchMetadata:FMs,appendRequestOriginHeader:UMs,TAOCheck:BMs,corsCheck:LMs,crossOriginResourcePolicyCheck:OMs,createOpaqueTimingInfo:jMs,setRequestReferrerPolicyOnRedirect:MMs,isValidHTTPToken:QHn,requestBadPort:RMs,requestCurrentURL:EX,responseURL:qHn,responseLocationURL:xMs,isURLPotentiallyTrustworthy:_X,isValidReasonPhrase:PMs,sameOrigin:K2e,normalizeMethod:JMs,iteratorMixin:XMs,createIterator:VHn,isValidHeaderName:DMs,isValidHeaderValue:HHn,isErrorLike:kMs,fullyReadBody:eOs,readableStreamClose:tOs,urlIsLocal:zHn,urlHasHttpsScheme:Xcr,urlIsHttpHttpsScheme:YHn,readAllBytes:WHn,simpleRangeHeaderValue:rOs,buildContentRange:nOs,createInflate:iOs,extractMimeType:oOs,getDecodeSplit:KHn,environmentSettingsObject:uOs,isOriginIPPotentiallyTrustworthy:$Hn,hasAuthenticationEntry:aOs,includesCredentials:cOs,isTraversableNavigable:lOs}});var cct=I((Tyf,XHn)=>{"use strict";p();var{iteratorMixin:dOs}=VT(),{kEnumerableProperty:vhe}=No(),{webidl:Qc}=oy(),ZHn=require("node:util"),x8=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(Qc.util.markAsUncloneable(this),e!==void 0)throw Qc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){Qc.brandCheck(this,t);let o="FormData.append";Qc.argumentLengthCheck(arguments,2,o),e=Qc.converters.USVString(e),arguments.length===3||Qc.is.Blob(r)?(r=Qc.converters.Blob(r,o,"value"),n!==void 0&&(n=Qc.converters.USVString(n))):r=Qc.converters.USVString(r);let s=nlr(e,r,n);this.#e.push(s)}delete(e){Qc.brandCheck(this,t),Qc.argumentLengthCheck(arguments,1,"FormData.delete"),e=Qc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){Qc.brandCheck(this,t),Qc.argumentLengthCheck(arguments,1,"FormData.get"),e=Qc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return Qc.brandCheck(this,t),Qc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=Qc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return Qc.brandCheck(this,t),Qc.argumentLengthCheck(arguments,1,"FormData.has"),e=Qc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Qc.brandCheck(this,t);let o="FormData.set";Qc.argumentLengthCheck(arguments,2,o),e=Qc.converters.USVString(e),arguments.length===3||Qc.is.Blob(r)?(r=Qc.converters.Blob(r,o,"value"),n!==void 0&&(n=Qc.converters.USVString(n))):r=Qc.converters.USVString(r);let s=nlr(e,r,n),c=this.#e.findIndex(l=>l.name===e);c!==-1?this.#e=[...this.#e.slice(0,c),s,...this.#e.slice(c+1).filter(l=>l.name!==e)]:this.#e.push(s)}[ZHn.inspect.custom](e,r){let n=this.#e.reduce((s,c)=>(s[c.name]?Array.isArray(s[c.name])?s[c.name].push(c.value):s[c.name]=[s[c.name],c.value]:s[c.name]=c.value,s),{__proto__:null});r.depth??=e,r.colors??=!0;let o=ZHn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:fOs,setFormDataState:pOs}=x8;Reflect.deleteProperty(x8,"getFormDataState");Reflect.deleteProperty(x8,"setFormDataState");dOs("FormData",x8,fOs,"name","value");Object.defineProperties(x8.prototype,{append:vhe,delete:vhe,get:vhe,getAll:vhe,has:vhe,set:vhe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function nlr(t,e,r){if(typeof e!="string"){if(Qc.is.File(e)||(e=new File([e],"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=new File([e],r,n)}}return{name:t,value:e}}a(nlr,"makeEntry");Qc.is.FormData=Qc.util.MakeTypeAssertion(x8);XHn.exports={FormData:x8,makeEntry:nlr,setFormDataState:pOs}});var rGn=I((wyf,tGn)=>{"use strict";p();var{bufferToLowerCasedHeaderName:hOs}=No(),{HTTP_TOKEN_CODEPOINTS:mOs}=sR(),{makeEntry:gOs}=cct(),{webidl:ilr}=oy(),olr=require("node:assert"),{isomorphicDecode:eGn}=T8(),AOs=Buffer.from("--"),slr=new TextDecoder,yOs=new TextDecoder("utf-8",{ignoreBOM:!0});function _Os(t){for(let e=0;e70)return!1;for(let r=0;r=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}a(EOs,"validateBoundary");function vOs(t,e){olr(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw Bb("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw Bb("no boundary found in multipart body");for(s.position=c;;){if(t.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else throw Bb("expected a value starting with -- and the boundary");if(SOs(t,AOs,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw Bb("expected CRLF");s.position+=2;let l=bOs(t,s),{name:u,filename:d,contentType:f,encoding:h}=l;s.position+=2;let m;{let A=t.indexOf(n.subarray(2),s.position);if(A===-1)throw Bb("expected boundary after body");m=t.subarray(s.position,A-4),s.position+=m.length,h==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)throw Bb("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",_Os(f)||(f=""),g=new File([m],d,{type:f})):g=yOs.decode(Buffer.from(m)),olr(ilr.is.USVString(u)),olr(typeof g=="string"&&ilr.is.USVString(g)||ilr.is.File(g)),o.push(gOs(u,g,d))}}a(vOs,"multipartFormDataParser");function COs(t,e){t[e.position]===59&&e.position++,aR(c=>c===32||c===9,t,e);let r=aR(c=>clr(c)&&c!==61&&c!==42,t,e);if(r.length===0)return null;let n=r.toString("ascii").toLowerCase(),o=t[e.position]===42;if(o&&e.position++,t[e.position]!==61)return null;e.position++,aR(c=>c===32||c===9,t,e);let s;if(o){let c=aR(l=>l!==32&&l!==13&&l!==10&&l!==59,t,e);if(c[0]!==117&&c[0]!==85||c[1]!==116&&c[1]!==84||c[2]!==102&&c[2]!==70||c[3]!==45||c[4]!==56)throw Bb("unknown encoding, expected utf-8''");s=decodeURIComponent(slr.decode(c.subarray(7)))}else if(t[e.position]===34){e.position++;let c=aR(l=>l!==10&&l!==13&&l!==34,t,e);if(t[e.position]!==34)throw Bb("Closing quote not found");e.position++,s=slr.decode(c).replace(/%0A/ig,` -`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=aR(l=>clr(l)&&l!==59,t,e);s=slr.decode(c)}return{name:n,value:s,extended:o}}a(COs,"parseContentDispositionAttribute");function bOs(t,e){let r=null,n=null,o=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10){if(r===null)throw Bb("header name is null");return{name:r,filename:n,contentType:o,encoding:s}}let c=aR(l=>l!==10&&l!==13&&l!==58,t,e);if(c=alr(c,!0,!0,l=>l===9||l===32),!mOs.test(c.toString()))throw Bb("header name does not match the field-name token production");if(t[e.position]!==58)throw Bb("expected :");switch(e.position++,aR(l=>l===32||l===9,t,e),hOs(c)){case"content-disposition":{r=n=null;let l=!1;if(aR(d=>clr(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw Bb("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=alr(l,!1,!0,u=>u===9||u===32),o=eGn(l);break}case"content-transfer-encoding":{let l=aR(u=>u!==10&&u!==13,t,e);l=alr(l,!1,!0,u=>u===9||u===32),s=eGn(l);break}default:aR(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw Bb("expected CRLF");e.position+=2}}a(bOs,"parseMultipartFormDataHeaders");function aR(t,e,r){let n=r.position;for(;n0&&n(t[s]);)s--;return o===0&&s===t.length-1?t:t.subarray(o,s+1)}a(alr,"removeChars");function SOs(t,e,r){if(t.length{"use strict";p();function xOs(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(xOs,"createDeferredPromise");nGn.exports={createDeferredPromise:xOs}});var bhe=I((Myf,cGn)=>{"use strict";p();var dlr=No(),{ReadableStreamFrom:wOs,readableStreamClose:ROs,fullyReadBody:kOs,extractMimeType:POs}=VT(),{FormData:iGn,setFormDataState:DOs}=cct(),{webidl:X2}=oy(),llr=require("node:assert"),{isErrored:ulr,isDisturbed:NOs}=require("node:stream"),{isUint8Array:MOs}=require("node:util/types"),{serializeAMimeType:OOs}=sR(),{multipartFormDataParser:LOs}=rGn(),{createDeferredPromise:BOs}=Z2e(),{parseJSONFromBytes:FOs}=T8(),{utf8DecodeBytes:UOs}=rct(),{runtimeFeatures:QOs}=I8(),qOs=QOs.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),lct=new TextEncoder;function jOs(){}a(jOs,"noop");var HOs=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!NOs(e)&&!ulr(e)&&e.cancel("Response object has been garbage collected").catch(jOs)});function sGn(t,e=!1){let r=null,n=null;X2.is.ReadableStream(t)?r=t:X2.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),llr(X2.is.ReadableStream(r));let o=null,s=null,c=null,l=null;if(typeof t=="string")s=t,l="text/plain;charset=UTF-8";else if(X2.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(X2.is.BufferSource(t))s=X2.util.getCopyOfBytesHeldByBufferSource(t);else if(X2.is.FormData(t)){let d=`----formdata-undici-0${`${qOs(1e11)}`.padStart(11,"0")}`,f=`--${d}\r +`,s};Bat.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=Sm.util.createBuffer();return ghe(n,r),u4(n,t.e),u4(n,t.n),r+" "+Sm.util.encode64(n.bytes())+" "+e};Bat.privateKeyToOpenSSH=function(t,e){return e?Sm.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):Sm.pki.privateKeyToPem(t)};Bat.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||Sm.md.md5.create(),n="ssh-rsa",o=Sm.util.createBuffer();ghe(o,n),u4(o,t.e),u4(o,t.n),r.start(),r.update(o.getBytes());var s=r.digest();if(e.encoding==="hex"){var c=s.toHex();return e.delimiter?c.match(/.{2}/g).join(e.delimiter):c}else{if(e.encoding==="binary")return s.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".')}return s};function u4(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=Sm.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(u4,"_addBigIntegerToBuffer");function ghe(t,e){t.putInt32(e.length),t.putString(e)}a(ghe,"_addStringToBuffer");function Lat(){for(var t=Sm.md.sha1.create(),e=arguments.length,r=0;r{p();bqn.exports=Cs();yH();HQn();J2();aat();w2e();aqn();ihe();dqn();mqn();Aqn();rar();yat();sX();Ksr();oar();Eqn();aar();Zsr();jsr();Tat();Xw();$sr();Cqn();par();Ac()});var xqn=I(hX=>{"use strict";p();Object.defineProperty(hX,"__esModule",{value:!0});hX.convert=hX.Format=void 0;var Q2e=Sqn(),xH;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(xH=hX.Format||(hX.Format={}));function Tqn(t){var e=Q2e.pki.pemToDer(t),r=Q2e.asn1,n=r.fromDer(e.data.toString("binary")).value[0].value,o=n[0],s=o.tagClass===r.Class.CONTEXT_SPECIFIC&&o.type===0&&o.constructed,c=n.slice(s);return{serial:c[0],issuer:c[2],valid:c[3],subject:c[4]}}a(Tqn,"myASN");function G2s(t){var e=Tqn(t),r=e.subject.value.map(function(o){return o.value[0].value[1].value}).join("/"),n=e.valid.value.map(function(o){return o.value}).join(" - ");return["Subject ".concat(r),"Valid ".concat(n),String(t)].join(` +`)}a(G2s,"txtFormat");function Iqn(t,e){switch(e){case xH.der:return Q2e.pki.pemToDer(t);case xH.pem:return t;case xH.txt:return G2s(t);case xH.asn1:return Tqn(t);case xH.fingerprint:var r=Q2e.md.sha1.create(),n=Iqn(t,xH.der);return r.update(n.getBytes()),r.digest().toHex();case xH.x509:return Q2e.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(Iqn,"convert");hX.convert=Iqn});var Nqn=I(Ob=>{"use strict";p();var wH=Ob&&Ob.__assign||function(){return wH=Object.assign||function(t){for(var e,r=1,n=arguments.length;r"u"&&(s.ca=e),r.call(this,s)},"newAgent");return n.prototype=r.prototype,n})(Par.Agent),(0,Rqn.setGlobalDispatcher)(new Rqn.Agent({connect:{ca:e}}))}},"addToGlobalAgent");Ob.addToGlobalAgent=V2s});var Mqn=I((X0f,Dar)=>{p();function W2s(){let{X509Certificate:t}=require("crypto"),{join:e}=require("path");var r=typeof __webpack_require__=="function"?__non_webpack_require__:require;let n=process.arch==="arm64"?"crypt32-arm64.node":"crypt32.node",o=r(e(__dirname,n)),s=[],c=new o.Crypt32;try{let l;for(;l=c.next();){let u=new t(l);s.push(u.toString())}}finally{c.done()}return Array.from(new Set(s))}a(W2s,"all");process.platform!=="win32"?Dar.exports.all=()=>[]:Dar.exports.all=W2s});var Al=I((sAf,Qqn)=>{"use strict";p();Qqn.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kHTTP2InitialWindowSize:Symbol("http2 initial window size"),kHTTP2ConnectionWindowSize:Symbol("http2 connection window size"),kEnableConnectProtocol:Symbol("http2session connect protocol"),kRemoteSettings:Symbol("http2session remote settings"),kHTTP2Stream:Symbol("http2session client stream"),kPingInterval:Symbol("ping interval"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}});var War=I((cAf,Gqn)=>{"use strict";p();var yhe=0,qar=1e3,jar=(qar>>1)-1,RH,Har=Symbol("kFastTimer"),S8=[],Gar=-2,$ar=-1,jqn=0,qqn=1;function Var(){yhe+=jar;let t=0,e=S8.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=$ar,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===$ar?(r._state=Gar,--e!==0&&(S8[t]=S8[e])):++t}S8.length=e,S8.length!==0&&Hqn()}a(Var,"onTick");function Hqn(){RH?.refresh?RH.refresh():(clearTimeout(RH),RH=setTimeout(Var,jar),RH?.unref())}a(Hqn,"refreshTimeout");var Hat=class{static{a(this,"FastTimer")}[Har]=!0;_state=Gar;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===Gar&&S8.push(this),(!RH||S8.length===1)&&Hqn(),this._state=jqn}clear(){this._state=$ar,this._idleStart=-1}};Gqn.exports={setTimeout(t,e,r){return e<=qar?setTimeout(t,e,r):new Hat(t,e,r)},clearTimeout(t){t[Har]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Hat(t,e,r)},clearFastTimeout(t){t.clear()},now(){return yhe},tick(t=0){yhe+=t-qar+1,Var(),Var()},reset(){yhe=0,S8.length=0,clearTimeout(RH),RH=null},kFastTimer:Har}});var uo=I((dAf,mjn)=>{"use strict";p();var $qn=Symbol.for("undici.error.UND_ERR"),_d=class extends Error{static{a(this,"UndiciError")}constructor(e,r){super(e,r),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[$qn]===!0}get[$qn](){return!0}},Vqn=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),zar=class extends _d{static{a(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[Vqn]===!0}get[Vqn](){return!0}},Wqn=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),Yar=class extends _d{static{a(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[Wqn]===!0}get[Wqn](){return!0}},zqn=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),Kar=class extends _d{static{a(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[zqn]===!0}get[zqn](){return!0}},Yqn=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),Jar=class extends _d{static{a(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[Yqn]===!0}get[Yqn](){return!0}},Kqn=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),Zar=class extends _d{static{a(this,"InvalidArgumentError")}constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[Kqn]===!0}get[Kqn](){return!0}},Jqn=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),Xar=class extends _d{static{a(this,"InvalidReturnValueError")}constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[Jqn]===!0}get[Jqn](){return!0}},Zqn=Symbol.for("undici.error.UND_ERR_ABORT"),Gat=class extends _d{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[Zqn]===!0}get[Zqn](){return!0}},Xqn=Symbol.for("undici.error.UND_ERR_ABORTED"),ecr=class extends Gat{static{a(this,"RequestAbortedError")}constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[Xqn]===!0}get[Xqn](){return!0}},ejn=Symbol.for("undici.error.UND_ERR_INFO"),tcr=class extends _d{static{a(this,"InformationalError")}constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[ejn]===!0}get[ejn](){return!0}},tjn=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),rcr=class extends _d{static{a(this,"RequestContentLengthMismatchError")}constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[tjn]===!0}get[tjn](){return!0}},rjn=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),ncr=class extends _d{static{a(this,"ResponseContentLengthMismatchError")}constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[rjn]===!0}get[rjn](){return!0}},njn=Symbol.for("undici.error.UND_ERR_DESTROYED"),icr=class extends _d{static{a(this,"ClientDestroyedError")}constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[njn]===!0}get[njn](){return!0}},ijn=Symbol.for("undici.error.UND_ERR_CLOSED"),ocr=class extends _d{static{a(this,"ClientClosedError")}constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[ijn]===!0}get[ijn](){return!0}},ojn=Symbol.for("undici.error.UND_ERR_SOCKET"),scr=class extends _d{static{a(this,"SocketError")}constructor(e,r){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=r}static[Symbol.hasInstance](e){return e&&e[ojn]===!0}get[ojn](){return!0}},sjn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),acr=class extends _d{static{a(this,"NotSupportedError")}constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[sjn]===!0}get[sjn](){return!0}},ajn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),ccr=class extends _d{static{a(this,"BalancedPoolMissingUpstreamError")}constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[ajn]===!0}get[ajn](){return!0}},cjn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),lcr=class extends Error{static{a(this,"HTTPParserError")}constructor(e,r,n){super(e),this.name="HTTPParserError",this.code=r?`HPE_${r}`:void 0,this.data=n?n.toString():void 0}static[Symbol.hasInstance](e){return e&&e[cjn]===!0}get[cjn](){return!0}},ljn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),ucr=class extends _d{static{a(this,"ResponseExceededMaxSizeError")}constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[ljn]===!0}get[ljn](){return!0}},ujn=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),dcr=class extends _d{static{a(this,"RequestRetryError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[ujn]===!0}get[ujn](){return!0}},djn=Symbol.for("undici.error.UND_ERR_RESPONSE"),fcr=class extends _d{static{a(this,"ResponseError")}constructor(e,r,{headers:n,body:o}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=r,this.body=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[djn]===!0}get[djn](){return!0}},fjn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),pcr=class extends _d{static{a(this,"SecureProxyConnectionError")}constructor(e,r,n={}){super(r,{cause:e,...n}),this.name="SecureProxyConnectionError",this.message=r||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[fjn]===!0}get[fjn](){return!0}},pjn=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),hcr=class extends _d{static{a(this,"MaxOriginsReachedError")}constructor(e){super(e),this.name="MaxOriginsReachedError",this.message=e||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED"}static[Symbol.hasInstance](e){return e&&e[pjn]===!0}get[pjn](){return!0}},mcr=class extends _d{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},hjn=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),gcr=class extends _d{static{a(this,"MessageSizeExceededError")}constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[hjn]===!0}get[hjn](){return!0}};mjn.exports={AbortError:Gat,HTTPParserError:lcr,UndiciError:_d,HeadersTimeoutError:Yar,HeadersOverflowError:Kar,BodyTimeoutError:Jar,RequestContentLengthMismatchError:rcr,ConnectTimeoutError:zar,InvalidArgumentError:Zar,InvalidReturnValueError:Xar,RequestAbortedError:ecr,ClientDestroyedError:icr,ClientClosedError:ocr,InformationalError:tcr,SocketError:scr,NotSupportedError:acr,ResponseContentLengthMismatchError:ncr,BalancedPoolMissingUpstreamError:ccr,ResponseExceededMaxSizeError:ucr,RequestRetryError:dcr,ResponseError:fcr,SecureProxyConnectionError:pcr,MaxOriginsReachedError:hcr,Socks5ProxyError:mcr,MessageSizeExceededError:gcr}});var Vat=I((hAf,Ajn)=>{"use strict";p();var Acr=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"],$at={};Object.setPrototypeOf($at,null);var gjn={};Object.setPrototypeOf(gjn,null);function Y2s(t){let e=gjn[t];return e===void 0&&(e=Buffer.from(t)),e}a(Y2s,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:yjn,headerNameLowerCasedRecord:K2s}=Vat(),ycr=class t{static{a(this,"TstNode")}value=null;left=null;middle=null;right=null;code;constructor(e,r,n){if(n===void 0||n>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(n))>127)throw new TypeError("key must be ascii string");e.length!==++n?this.middle=new t(e,r,n):this.value=r}add(e,r){let n=e.length;if(n===0)throw new TypeError("Unreachable");let o=0,s=this;for(;;){let c=e.charCodeAt(o);if(c>127)throw new TypeError("key must be ascii string");if(s.code===c)if(n===++o){s.value=r;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,r,o);break}else if(s.code=65&&(s|=32);o!==null;){if(s===o.code){if(r===++n)return o;o=o.middle;break}o=o.code{"use strict";p();var q2e=require("node:assert"),{kDestroyed:Tjn,kBodyUsed:_he,kListeners:Yat,kBody:Cjn}=Al(),{IncomingMessage:J2s}=require("node:http"),Ijn=require("node:stream"),Z2s=require("node:net"),{stringify:X2s}=require("node:querystring"),{EventEmitter:eDs}=require("node:events"),zat=War(),{InvalidArgumentError:G0,ConnectTimeoutError:tDs}=uo(),{headerNameLowerCasedRecord:rDs}=Vat(),{tree:xjn}=vjn(),[nDs,iDs]=process.versions.node.split(".",2).map(t=>Number(t)),Jat=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[Cjn]=e,this[_he]=!1}async*[Symbol.asyncIterator](){q2e(!this[_he],"disturbed"),this[_he]=!0,yield*this[Cjn]}};function bjn(){}a(bjn,"noop");function oDs(t){return Zat(t)?(Njn(t)===0&&t.on("data",function(){q2e(!1)}),typeof t.readableDidRead!="boolean"&&(t[_he]=!1,eDs.prototype.on.call(t,"data",function(){this[_he]=!0})),t):t&&typeof t.pipeTo=="function"?new Jat(t):t&&Fjn(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&Djn(t)?new Jat(t):t}a(oDs,"wrapRequestBody");function Zat(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Zat,"isStream");function wjn(t){if(t===null)return!1;if(t instanceof Blob)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}a(wjn,"isBlobLike");function Rjn(t){return t.includes("?")||t.includes("#")}a(Rjn,"pathHasQueryOrFragment");function sDs(t,e){if(Rjn(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=X2s(e);return r&&(t+="?"+r),t}a(sDs,"serializePathWithQuery");function kjn(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(kjn,"isValidPort");function Kat(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(Kat,"isHttpOrHttpsPrefixed");function Pjn(t){if(typeof t=="string"){if(t=new URL(t),!Kat(t.origin||t.protocol))throw new G0("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new G0("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&kjn(t.port)===!1)throw new G0("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new G0("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new G0("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new G0("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new G0("Invalid URL origin: the origin must be a string or null/undefined.");if(!Kat(t.origin||t.protocol))throw new G0("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!Kat(t.origin||t.protocol))throw new G0("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(Pjn,"parseURL");function aDs(t){if(t=Pjn(t),t.pathname!=="/"||t.search||t.hash)throw new G0("invalid url");return t}a(aDs,"parseOrigin");function cDs(t){if(t[0]==="["){let r=t.indexOf("]");return q2e(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(cDs,"getHostname");function lDs(t){if(!t)return null;q2e(typeof t=="string");let e=cDs(t);return Z2s.isIP(e)?"":e}a(lDs,"getServerName");function uDs(t){return JSON.parse(JSON.stringify(t))}a(uDs,"deepClone");function dDs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(dDs,"isAsyncIterable");function Djn(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(Djn,"isIterable");function fDs(t){let e=Object.getPrototypeOf(t);return Object.prototype.hasOwnProperty.call(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}a(fDs,"hasSafeIterator");function Njn(t){if(t==null)return 0;if(Zat(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(wjn(t))return t.size!=null?t.size:null;if(Bjn(t))return t.byteLength}return null}a(Njn,"bodyLength");function Mjn(t){return t&&!!(t.destroyed||t[Tjn]||Ijn.isDestroyed?.(t))}a(Mjn,"isDestroyed");function Ojn(t,e){t==null||!Zat(t)||Mjn(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===J2s&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[Tjn]=!0))}a(Ojn,"destroy");var pDs=/timeout=(\d+)/;function hDs(t){let e=t.match(pDs);return e?parseInt(e[1],10)*1e3:null}a(hDs,"parseKeepAliveTimeout");function Ljn(t){return typeof t=="string"?rDs[t]??t.toLowerCase():xjn.lookup(t)??t.toString("latin1").toLowerCase()}a(Ljn,"headerNameToString");function mDs(t){return xjn.lookup(t)??t.toString("latin1").toLowerCase()}a(mDs,"bufferToLowerCasedHeaderName");function gDs(t,e){e===void 0&&(e={});for(let r=0;rc.toString("latin1")):t[r+1].toString("latin1");n==="__proto__"?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s}else{let s=typeof t[r+1]=="string"?t[r+1]:Array.isArray(t[r+1])?t[r+1].map(c=>c.toString("latin1")):t[r+1].toString("latin1");e[n]=s}}return e}a(gDs,"parseHeaders");function ADs(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a(yDs,"encodeRawHeaders");function Bjn(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(Bjn,"isBuffer");function _Ds(t,e,r){if(!t||typeof t!="object")throw new G0("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new G0("invalid onConnect method");if(typeof t.onError!="function")throw new G0("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new G0("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new G0("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new G0("invalid onHeaders method");if(typeof t.onData!="function")throw new G0("invalid onData method");if(typeof t.onComplete!="function")throw new G0("invalid onComplete method")}}}a(_Ds,"assertRequestHandler");function EDs(t){return!!(t&&(Ijn.isDisturbed(t)||t[_he]))}a(EDs,"isDisturbed");function vDs(t){return{localAddress:t.localAddress,localPort:t.localPort,remoteAddress:t.remoteAddress,remotePort:t.remotePort,remoteFamily:t.remoteFamily,timeout:t.timeout,bytesWritten:t.bytesWritten,bytesRead:t.bytesRead}}a(vDs,"getSocketInfo");function CDs(t){let e;return new ReadableStream({start(){e=t[Symbol.asyncIterator]()},pull(r){return e.next().then(({done:n,value:o})=>{if(n)return queueMicrotask(()=>{r.close(),r.byobRequest?.respond(0)});{let s=Buffer.isBuffer(o)?o:Buffer.from(o);return s.byteLength?r.enqueue(new Uint8Array(s)):this.pull(r)}})},cancel(){return e.return()},type:"bytes"})}a(CDs,"ReadableStreamFrom");function Fjn(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}a(Fjn,"isFormDataLike");function bDs(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.once("abort",e),()=>t.removeListener("abort",e))}a(bDs,"addAbortListener");var Ujn=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,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,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,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,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]);function SDs(t){return Ujn[t]===1}a(SDs,"isTokenCharCode");var TDs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function IDs(t){if(t.length>=12)return TDs.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return bjn;let r=null,n=null,o=zat.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>Sjn(t.deref(),e))})},e.timeout);return()=>{zat.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return bjn;let r=null,n=zat.setFastTimeout(()=>{r=setImmediate(()=>{Sjn(t.deref(),e)})},e.timeout);return()=>{zat.clearFastTimeout(n),clearImmediate(r)}};function Sjn(t,e){if(t==null)return;let r="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${e.hostname}:${e.port},`,r+=` timeout: ${e.timeout}ms)`,Ojn(t,new tDs(r))}a(Sjn,"onConnectTimeout");function ODs(t){if(t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p")switch(t[4]){case":":return"http:";case"s":if(t[5]===":")return"https:"}return t.slice(0,t.indexOf(":")+1)}a(ODs,"getProtocolFromUrlString");var Qjn=Object.create(null);Qjn.enumerable=!0;var _cr={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},qjn={..._cr,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(_cr,null);Object.setPrototypeOf(qjn,null);jjn.exports={kEnumerableProperty:Qjn,isDisturbed:EDs,isBlobLike:wjn,parseOrigin:aDs,parseURL:Pjn,getServerName:lDs,isStream:Zat,isIterable:Djn,hasSafeIterator:fDs,isAsyncIterable:dDs,isDestroyed:Mjn,headerNameToString:Ljn,bufferToLowerCasedHeaderName:mDs,addListener:PDs,removeAllListeners:DDs,errorRequest:NDs,parseRawHeaders:ADs,encodeRawHeaders:yDs,parseHeaders:gDs,parseKeepAliveTimeout:hDs,destroy:Ojn,bodyLength:Njn,deepClone:uDs,ReadableStreamFrom:CDs,isBuffer:Bjn,assertRequestHandler:_Ds,getSocketInfo:vDs,isFormDataLike:Fjn,pathHasQueryOrFragment:Rjn,serializePathWithQuery:sDs,addAbortListener:bDs,isValidHTTPToken:IDs,isValidHeaderValue:wDs,isTokenCharCode:SDs,parseRangeHeader:kDs,normalizedMethodRecordsBase:_cr,normalizedMethodRecords:qjn,isValidPort:kjn,isHttpOrHttpsPrefixed:Kat,nodeMajor:nDs,nodeMinor:iDs,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:oDs,setupConnectTimeout:MDs,getProtocolFromUrlString:ODs}});var Ccr=I((bAf,Wjn)=>{"use strict";p();var{kConnected:Hjn,kPending:Gjn,kRunning:$jn,kSize:Vjn,kFree:LDs,kQueued:BDs}=Al(),Ecr=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[Hjn],this.pending=e[Gjn],this.running=e[$jn],this.size=e[Vjn]}},vcr=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[Hjn],this.free=e[LDs],this.pending=e[Gjn],this.queued=e[BDs],this.running=e[$jn],this.size=e[Vjn]}};Wjn.exports={ClientStats:Ecr,PoolStats:vcr}});var kH=I((IAf,Yjn)=>{"use strict";p();var yl=require("node:diagnostics_channel"),Icr=require("node:util"),mX=Icr.debuglog("undici"),j2e=Icr.debuglog("fetch"),Xat=Icr.debuglog("websocket"),GT={beforeConnect:yl.channel("undici:client:beforeConnect"),connected:yl.channel("undici:client:connected"),connectError:yl.channel("undici:client:connectError"),sendHeaders:yl.channel("undici:client:sendHeaders"),create:yl.channel("undici:request:create"),bodySent:yl.channel("undici:request:bodySent"),bodyChunkSent:yl.channel("undici:request:bodyChunkSent"),bodyChunkReceived:yl.channel("undici:request:bodyChunkReceived"),headers:yl.channel("undici:request:headers"),trailers:yl.channel("undici:request:trailers"),error:yl.channel("undici:request:error"),open:yl.channel("undici:websocket:open"),close:yl.channel("undici:websocket:close"),socketError:yl.channel("undici:websocket:socket_error"),ping:yl.channel("undici:websocket:ping"),pong:yl.channel("undici:websocket:pong"),proxyConnected:yl.channel("undici:proxy:connected")},bcr=!1;function zjn(t=mX){if(!bcr){if(GT.beforeConnect.hasSubscribers||GT.connected.hasSubscribers||GT.connectError.hasSubscribers||GT.sendHeaders.hasSubscribers){bcr=!0;return}bcr=!0,yl.subscribe("undici:client:beforeConnect",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),yl.subscribe("undici:client:connected",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),yl.subscribe("undici:client:connectError",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),yl.subscribe("undici:client:sendHeaders",e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s%s",r,o,n)})}}a(zjn,"trackClientEvents");var Scr=!1;function FDs(t=mX){if(!Scr){if(GT.headers.hasSubscribers||GT.trailers.hasSubscribers||GT.error.hasSubscribers){Scr=!0;return}Scr=!0,yl.subscribe("undici:request:headers",e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s%s - HTTP %d",r,o,n,s)}),yl.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),yl.subscribe("undici:request:error",e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s%s errored - %s",r,o,n,s.message)})}}a(FDs,"trackRequestEvents");var Tcr=!1;function UDs(t=Xat){if(!Tcr){if(GT.open.hasSubscribers||GT.close.hasSubscribers||GT.socketError.hasSubscribers||GT.ping.hasSubscribers||GT.pong.hasSubscribers){Tcr=!0;return}Tcr=!0,yl.subscribe("undici:websocket:open",e=>{if(e.address!=null){let{address:r,port:n}=e.address;t("connection opened %s%s",r,n?`:${n}`:"")}else t("connection opened")}),yl.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),yl.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),yl.subscribe("undici:websocket:ping",e=>{t("ping received")}),yl.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(UDs,"trackWebSocketEvents");(mX.enabled||j2e.enabled)&&(zjn(j2e.enabled?j2e:mX),FDs(j2e.enabled?j2e:mX));Xat.enabled&&(zjn(mX.enabled?mX:Xat),UDs(Xat));Yjn.exports={channels:GT}});var Zjn=I((RAf,Jjn)=>{"use strict";p();var{InvalidArgumentError:kc,NotSupportedError:QDs}=uo(),d4=require("node:assert"),{isValidHTTPToken:xcr,isValidHeaderValue:H2e,isStream:qDs,destroy:jDs,isBuffer:HDs,isFormDataLike:GDs,isIterable:$Ds,hasSafeIterator:VDs,isBlobLike:WDs,serializePathWithQuery:zDs,assertRequestHandler:YDs,getServerName:KDs,normalizedMethodRecords:JDs,getProtocolFromUrlString:ZDs}=No(),{channels:Lb}=kH(),{headerNameLowerCasedRecord:Kjn}=Vat(),XDs=/[^\u0021-\u00ff]/;function eNs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a(eNs,"isValidContentLengthHeaderValue");var oR=Symbol("handler"),wcr=class{static{a(this,"Request")}constructor(e,{path:r,method:n,body:o,headers:s,query:c,idempotent:l,blocking:u,upgrade:d,headersTimeout:f,bodyTimeout:h,reset:m,expectContinue:g,servername:A,throwOnError:y,maxRedirections:_,typeOfService:E},v){if(typeof r!="string")throw new kc("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new kc("path must be an absolute URL or start with a slash");if(XDs.test(r))throw new kc("invalid request path");if(typeof n!="string")throw new kc("method must be a string");if(JDs[n]===void 0&&!xcr(n))throw new kc("invalid request method");if(d&&typeof d!="string")throw new kc("upgrade must be a string");if(d&&!H2e(d))throw new kc("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new kc("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new kc("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new kc("invalid reset");if(g!=null&&typeof g!="boolean")throw new kc("invalid expectContinue");if(y!=null)throw new kc("invalid throwOnError");if(_!=null&&_!==0)throw new kc("maxRedirections is not supported, use the redirect interceptor");if(E!=null&&(!Number.isInteger(E)||E<0||E>255))throw new kc("typeOfService must be an integer between 0 and 255");if(this.headersTimeout=f,this.bodyTimeout=h,this.method=n,this.typeOfService=E??0,this.abort=null,o==null)this.body=null;else if(qDs(o)){this.body=o;let S=this.body._readableState;(!S||!S.autoDestroy)&&(this.endHandler=a(function(){jDs(this)},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=T=>{this.abort?this.abort(T):this.error=T},this.body.on("error",this.errorHandler)}else if(HDs(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if(typeof o=="string")this.body=o.length?Buffer.from(o):null;else if(GDs(o)||$Ds(o)||WDs(o))this.body=o;else throw new kc("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=d||null,this.path=c?zDs(r,c):r,this.origin=e,this.protocol=ZDs(e),this.idempotent=l??(n==="HEAD"||n==="GET"),this.blocking=u??this.method!=="HEAD",this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=g??!1,Array.isArray(s)){if(s.length%2!==0)throw new kc("headers array must be even");for(let S=0;S{"use strict";p();var{InvalidArgumentError:tNs}=uo();eHn.exports=class Xjn{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new Xjn(e)}onConnect(e,r){return this.#e.onConnect?.(e,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onHeaders(e,r,n,o){return this.#e.onHeaders?.(e,r,n,o)}onUpgrade(e,r,n){return this.#e.onUpgrade?.(e,r,n)}onData(e){return this.#e.onData?.(e)}onComplete(e){return this.#e.onComplete?.(e)}onError(e){if(!this.#e.onError)throw e;return this.#e.onError?.(e)}onRequestStart(e,r){this.#e.onConnect?.(n=>e.abort(n),r)}onRequestUpgrade(e,r,n,o){let s=[];for(let[c,l]of Object.entries(n))s.push(Buffer.from(c,"latin1"),Rcr(l));this.#e.onUpgrade?.(r,s,o)}onResponseStart(e,r,n,o){let s=[];for(let[c,l]of Object.entries(n))s.push(Buffer.from(c,"latin1"),Rcr(l));this.#e.onHeaders?.(r,s,()=>e.resume(),o)===!1&&e.pause()}onResponseData(e,r){this.#e.onData?.(r)===!1&&e.pause()}onResponseEnd(e,r){let n=[];for(let[o,s]of Object.entries(r))n.push(Buffer.from(o,"latin1"),Rcr(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new tNs("invalid onError method");this.#e.onError?.(r)}};function Rcr(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(Rcr,"toRawHeaderValue")});var $2e=I((OAf,tHn)=>{"use strict";p();var rNs=require("node:events"),nNs=G2e(),iNs=a(t=>(e,r)=>t(e,nNs.wrap(r)),"wrapInterceptor"),kcr=class extends rNs{static{a(this,"Dispatcher")}dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let r=Array.isArray(e[0])?e[0]:e,n=this.dispatch.bind(this);for(let o of r)if(o!=null){if(typeof o!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof o}`);if(n=o(n),n=iNs(n),n==null||typeof n!="function"||n.length!==2)throw new TypeError("invalid interceptor")}return new Proxy(this,{get:a((o,s)=>s==="dispatch"?n:o[s],"get")})}};tHn.exports=kcr});var iHn=I((FAf,nHn)=>{"use strict";p();var{parseHeaders:Pcr}=No(),{InvalidArgumentError:oNs}=uo(),Dcr=Symbol("resume"),Ncr=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[Dcr]=null;rawHeaders=null;rawTrailers=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[Dcr]?.())}abort(e){this.#r||(this.#r=!0,this.#t=e,this.#n(e))}get aborted(){return this.#r}get reason(){return this.#t}get paused(){return this.#e}};nHn.exports=class rHn{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new rHn(e):e}onConnect(e,r){this.#t=new Ncr(e),this.#e.onRequestStart?.(this.#t,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onUpgrade(e,r,n){this.#t.rawHeaders=r,this.#e.onRequestUpgrade?.(this.#t,e,Pcr(r),n)}onHeaders(e,r,n,o){return this.#t[Dcr]=n,this.#t.rawHeaders=r,this.#e.onResponseStart?.(this.#t,e,Pcr(r),o),!this.#t.paused}onData(e){return this.#e.onResponseData?.(this.#t,e),!this.#t.paused}onComplete(e){this.#t.rawTrailers=e,this.#e.onResponseEnd?.(this.#t,Pcr(e))}onError(e){if(!this.#e.onResponseError)throw new oNs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var AX=I((qAf,oHn)=>{"use strict";p();var sNs=$2e(),aNs=iHn(),{ClientDestroyedError:Mcr,ClientClosedError:cNs,InvalidArgumentError:tct}=uo(),{kDestroy:lNs,kClose:uNs,kClosed:V2e,kDestroyed:Ehe,kDispatch:dNs}=Al(),PH=Symbol("onDestroyed"),gX=Symbol("onClosed"),Ocr=Symbol("webSocketOptions"),Lcr=class extends sNs{static{a(this,"DispatcherBase")}[Ehe]=!1;[PH]=null;[V2e]=!1;[gX]=null;constructor(e){super(),this[Ocr]=e?.webSocket??{}}get webSocketOptions(){return{maxFragments:this[Ocr].maxFragments??131072,maxPayloadSize:this[Ocr].maxPayloadSize??128*1024*1024}}get destroyed(){return this[Ehe]}get closed(){return this[V2e]}close(e){if(e===void 0)return new Promise((n,o)=>{this.close((s,c)=>s?o(s):n(c))});if(typeof e!="function")throw new tct("invalid callback");if(this[Ehe]){let n=new Mcr;queueMicrotask(()=>e(n,null));return}if(this[V2e]){this[gX]?this[gX].push(e):queueMicrotask(()=>e(null,null));return}this[V2e]=!0,this[gX]??=[],this[gX].push(e);let r=a(()=>{let n=this[gX];this[gX]=null;for(let o=0;othis.destroy()).then(()=>queueMicrotask(r))}destroy(e,r){if(typeof e=="function"&&(r=e,e=null),r===void 0)return new Promise((o,s)=>{this.destroy(e,(c,l)=>c?s(c):o(l))});if(typeof r!="function")throw new tct("invalid callback");if(this[Ehe]){this[PH]?this[PH].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new Mcr),this[Ehe]=!0,this[PH]??=[],this[PH].push(r);let n=a(()=>{let o=this[PH];this[PH]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new tct("handler must be an object");r=aNs.unwrap(r);try{if(!e||typeof e!="object")throw new tct("opts must be an object.");if(this[Ehe]||this[PH])throw new Mcr;if(this[V2e])throw new cNs;return this[dNs](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};oHn.exports=Lcr});var yX=I(($Af,cHn)=>{"use strict";p();var fNs=require("node:net"),sHn=require("node:assert"),aHn=No(),{InvalidArgumentError:pNs}=uo(),Bcr,hNs=class{static{a(this,"WeakSessionCache")}constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new FinalizationRegistry(r=>{if(this._sessionCache.size=this._maxCachedSessions){for(let[o,s]of this._sessionCache)if(s.deref()===void 0){this._sessionCache.delete(o);return}let n=this._sessionCache.keys().next();n.done||this._sessionCache.delete(n.value)}this._sessionCache.set(e,new WeakRef(r)),this._sessionRegistry.register(r,e)}}};function mNs({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new pNs("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new hNs(r??100);return o=o??1e4,t=t??!1,a(function({hostname:f,host:h,protocol:m,port:g,servername:A,localAddress:y,httpSocket:_},E){let v;if(m==="https:"){Bcr||(Bcr=require("node:tls")),A=A||l.servername||aHn.getServerName(h)||null;let T=A||f;sHn(T);let w=s||u.get(T)||null;g=g||443,v=Bcr.connect({highWaterMark:16384,...l,servername:A,session:w,localAddress:y,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:_,port:g,host:f}),v.on("session",function(R){u.set(T,R)})}else sHn(!_,"httpSocket can only be sent on TLS update"),g=g||80,v=fNs.connect({highWaterMark:64*1024,...l,localAddress:y,port:g,host:f}),e===!0&&(v.alpnProtocol="h2");if(l.keepAlive==null||l.keepAlive){let T=l.keepAliveInitialDelay===void 0?6e4:l.keepAliveInitialDelay;v.setKeepAlive(!0,T)}let S=aHn.setupConnectTimeout(new WeakRef(v),{timeout:o,hostname:f,port:g});return v.setNoDelay(!0).once(m==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(S),E){let T=E;E=null,T(null,this)}}).on("error",function(T){if(queueMicrotask(S),E){let w=E;E=null,w(T)}}),v},"connect")}a(mNs,"buildConnector");cHn.exports=mNs});var lHn=I(Fcr=>{"use strict";p();Object.defineProperty(Fcr,"__esModule",{value:!0});Fcr.enumToMap=gNs;function gNs(t,e=[],r=[]){let n=(e?.length??0)===0,o=(r?.length??0)===0;return Object.fromEntries(Object.entries(t).filter(([,s])=>typeof s=="number"&&(n||e.includes(s))&&(o||!r.includes(s))))}a(gNs,"enumToMap")});var uHn=I(He=>{"use strict";p();Object.defineProperty(He,"__esModule",{value:!0});He.SPECIAL_HEADERS=He.MINOR=He.MAJOR=He.HTAB_SP_VCHAR_OBS_TEXT=He.QUOTED_STRING=He.CONNECTION_TOKEN_CHARS=He.HEADER_CHARS=He.TOKEN=He.HEX=He.URL_CHAR=He.USERINFO_CHARS=He.MARK=He.ALPHANUM=He.NUM=He.HEX_MAP=He.NUM_MAP=He.ALPHA=He.STATUSES_HTTP=He.H_METHOD_MAP=He.METHOD_MAP=He.METHODS_RTSP=He.METHODS_ICE=He.METHODS_HTTP=He.HEADER_STATE=He.FINISH=He.STATUSES=He.METHODS=He.LENIENT_FLAGS=He.FLAGS=He.TYPE=He.ERROR=void 0;var ANs=lHn();He.ERROR={OK:0,INTERNAL:1,STRICT:2,CR_EXPECTED:25,LF_EXPECTED:3,UNEXPECTED_CONTENT_LENGTH:4,UNEXPECTED_SPACE:30,CLOSED_CONNECTION:5,INVALID_METHOD:6,INVALID_URL:7,INVALID_CONSTANT:8,INVALID_VERSION:9,INVALID_HEADER_TOKEN:10,INVALID_CONTENT_LENGTH:11,INVALID_CHUNK_SIZE:12,INVALID_STATUS:13,INVALID_EOF_STATE:14,INVALID_TRANSFER_ENCODING:15,CB_MESSAGE_BEGIN:16,CB_HEADERS_COMPLETE:17,CB_MESSAGE_COMPLETE:18,CB_CHUNK_HEADER:19,CB_CHUNK_COMPLETE:20,PAUSED:21,PAUSED_UPGRADE:22,PAUSED_H2_UPGRADE:23,USER:24,CB_URL_COMPLETE:26,CB_STATUS_COMPLETE:27,CB_METHOD_COMPLETE:32,CB_VERSION_COMPLETE:33,CB_HEADER_FIELD_COMPLETE:28,CB_HEADER_VALUE_COMPLETE:29,CB_CHUNK_EXTENSION_NAME_COMPLETE:34,CB_CHUNK_EXTENSION_VALUE_COMPLETE:35,CB_RESET:31,CB_PROTOCOL_COMPLETE:38};He.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};He.FLAGS={CONNECTION_KEEP_ALIVE:1,CONNECTION_CLOSE:2,CONNECTION_UPGRADE:4,CHUNKED:8,UPGRADE:16,CONTENT_LENGTH:32,SKIPBODY:64,TRAILING:128,TRANSFER_ENCODING:512};He.LENIENT_FLAGS={HEADERS:1,CHUNKED_LENGTH:2,KEEP_ALIVE:4,TRANSFER_ENCODING:8,VERSION:16,DATA_AFTER_CLOSE:32,OPTIONAL_LF_AFTER_CR:64,OPTIONAL_CRLF_AFTER_CHUNK:128,OPTIONAL_CR_BEFORE_LF:256,SPACES_AFTER_CHUNK_SIZE:512};He.METHODS={DELETE:0,GET:1,HEAD:2,POST:3,PUT:4,CONNECT:5,OPTIONS:6,TRACE:7,COPY:8,LOCK:9,MKCOL:10,MOVE:11,PROPFIND:12,PROPPATCH:13,SEARCH:14,UNLOCK:15,BIND:16,REBIND:17,UNBIND:18,ACL:19,REPORT:20,MKACTIVITY:21,CHECKOUT:22,MERGE:23,"M-SEARCH":24,NOTIFY:25,SUBSCRIBE:26,UNSUBSCRIBE:27,PATCH:28,PURGE:29,MKCALENDAR:30,LINK:31,UNLINK:32,SOURCE:33,PRI:34,DESCRIBE:35,ANNOUNCE:36,SETUP:37,PLAY:38,PAUSE:39,TEARDOWN:40,GET_PARAMETER:41,SET_PARAMETER:42,REDIRECT:43,RECORD:44,FLUSH:45,QUERY:46};He.STATUSES={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,RESPONSE_IS_STALE:110,REVALIDATION_FAILED:111,DISCONNECTED_OPERATION:112,HEURISTIC_EXPIRATION:113,MISCELLANEOUS_WARNING:199,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,TRANSFORMATION_APPLIED:214,IM_USED:226,MISCELLANEOUS_PERSISTENT_WARNING:299,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,SWITCH_PROXY:306,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,PAGE_EXPIRED:419,ENHANCE_YOUR_CALM:420,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL:430,REQUEST_HEADER_FIELDS_TOO_LARGE:431,LOGIN_TIMEOUT:440,NO_RESPONSE:444,RETRY_WITH:449,BLOCKED_BY_PARENTAL_CONTROL:450,UNAVAILABLE_FOR_LEGAL_REASONS:451,CLIENT_CLOSED_LOAD_BALANCED_REQUEST:460,INVALID_X_FORWARDED_FOR:463,REQUEST_HEADER_TOO_LARGE:494,SSL_CERTIFICATE_ERROR:495,SSL_CERTIFICATE_REQUIRED:496,HTTP_REQUEST_SENT_TO_HTTPS_PORT:497,INVALID_TOKEN:498,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511,WEB_SERVER_UNKNOWN_ERROR:520,WEB_SERVER_IS_DOWN:521,CONNECTION_TIMEOUT:522,ORIGIN_IS_UNREACHABLE:523,TIMEOUT_OCCURED:524,SSL_HANDSHAKE_FAILED:525,INVALID_SSL_CERTIFICATE:526,RAILGUN_ERROR:527,SITE_IS_OVERLOADED:529,SITE_IS_FROZEN:530,IDENTITY_PROVIDER_AUTHENTICATION_ERROR:561,NETWORK_READ_TIMEOUT:598,NETWORK_CONNECT_TIMEOUT:599};He.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};He.HEADER_STATE={GENERAL:0,CONNECTION:1,CONTENT_LENGTH:2,TRANSFER_ENCODING:3,UPGRADE:4,CONNECTION_KEEP_ALIVE:5,CONNECTION_CLOSE:6,CONNECTION_UPGRADE:7,TRANSFER_ENCODING_CHUNKED:8};He.METHODS_HTTP=[He.METHODS.DELETE,He.METHODS.GET,He.METHODS.HEAD,He.METHODS.POST,He.METHODS.PUT,He.METHODS.CONNECT,He.METHODS.OPTIONS,He.METHODS.TRACE,He.METHODS.COPY,He.METHODS.LOCK,He.METHODS.MKCOL,He.METHODS.MOVE,He.METHODS.PROPFIND,He.METHODS.PROPPATCH,He.METHODS.SEARCH,He.METHODS.UNLOCK,He.METHODS.BIND,He.METHODS.REBIND,He.METHODS.UNBIND,He.METHODS.ACL,He.METHODS.REPORT,He.METHODS.MKACTIVITY,He.METHODS.CHECKOUT,He.METHODS.MERGE,He.METHODS["M-SEARCH"],He.METHODS.NOTIFY,He.METHODS.SUBSCRIBE,He.METHODS.UNSUBSCRIBE,He.METHODS.PATCH,He.METHODS.PURGE,He.METHODS.MKCALENDAR,He.METHODS.LINK,He.METHODS.UNLINK,He.METHODS.PRI,He.METHODS.SOURCE,He.METHODS.QUERY];He.METHODS_ICE=[He.METHODS.SOURCE];He.METHODS_RTSP=[He.METHODS.OPTIONS,He.METHODS.DESCRIBE,He.METHODS.ANNOUNCE,He.METHODS.SETUP,He.METHODS.PLAY,He.METHODS.PAUSE,He.METHODS.TEARDOWN,He.METHODS.GET_PARAMETER,He.METHODS.SET_PARAMETER,He.METHODS.REDIRECT,He.METHODS.RECORD,He.METHODS.FLUSH,He.METHODS.GET,He.METHODS.POST];He.METHOD_MAP=(0,ANs.enumToMap)(He.METHODS);He.H_METHOD_MAP=Object.fromEntries(Object.entries(He.METHODS).filter(([t])=>t.startsWith("H")));He.STATUSES_HTTP=[He.STATUSES.CONTINUE,He.STATUSES.SWITCHING_PROTOCOLS,He.STATUSES.PROCESSING,He.STATUSES.EARLY_HINTS,He.STATUSES.RESPONSE_IS_STALE,He.STATUSES.REVALIDATION_FAILED,He.STATUSES.DISCONNECTED_OPERATION,He.STATUSES.HEURISTIC_EXPIRATION,He.STATUSES.MISCELLANEOUS_WARNING,He.STATUSES.OK,He.STATUSES.CREATED,He.STATUSES.ACCEPTED,He.STATUSES.NON_AUTHORITATIVE_INFORMATION,He.STATUSES.NO_CONTENT,He.STATUSES.RESET_CONTENT,He.STATUSES.PARTIAL_CONTENT,He.STATUSES.MULTI_STATUS,He.STATUSES.ALREADY_REPORTED,He.STATUSES.TRANSFORMATION_APPLIED,He.STATUSES.IM_USED,He.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,He.STATUSES.MULTIPLE_CHOICES,He.STATUSES.MOVED_PERMANENTLY,He.STATUSES.FOUND,He.STATUSES.SEE_OTHER,He.STATUSES.NOT_MODIFIED,He.STATUSES.USE_PROXY,He.STATUSES.SWITCH_PROXY,He.STATUSES.TEMPORARY_REDIRECT,He.STATUSES.PERMANENT_REDIRECT,He.STATUSES.BAD_REQUEST,He.STATUSES.UNAUTHORIZED,He.STATUSES.PAYMENT_REQUIRED,He.STATUSES.FORBIDDEN,He.STATUSES.NOT_FOUND,He.STATUSES.METHOD_NOT_ALLOWED,He.STATUSES.NOT_ACCEPTABLE,He.STATUSES.PROXY_AUTHENTICATION_REQUIRED,He.STATUSES.REQUEST_TIMEOUT,He.STATUSES.CONFLICT,He.STATUSES.GONE,He.STATUSES.LENGTH_REQUIRED,He.STATUSES.PRECONDITION_FAILED,He.STATUSES.PAYLOAD_TOO_LARGE,He.STATUSES.URI_TOO_LONG,He.STATUSES.UNSUPPORTED_MEDIA_TYPE,He.STATUSES.RANGE_NOT_SATISFIABLE,He.STATUSES.EXPECTATION_FAILED,He.STATUSES.IM_A_TEAPOT,He.STATUSES.PAGE_EXPIRED,He.STATUSES.ENHANCE_YOUR_CALM,He.STATUSES.MISDIRECTED_REQUEST,He.STATUSES.UNPROCESSABLE_ENTITY,He.STATUSES.LOCKED,He.STATUSES.FAILED_DEPENDENCY,He.STATUSES.TOO_EARLY,He.STATUSES.UPGRADE_REQUIRED,He.STATUSES.PRECONDITION_REQUIRED,He.STATUSES.TOO_MANY_REQUESTS,He.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,He.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,He.STATUSES.LOGIN_TIMEOUT,He.STATUSES.NO_RESPONSE,He.STATUSES.RETRY_WITH,He.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,He.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,He.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,He.STATUSES.INVALID_X_FORWARDED_FOR,He.STATUSES.REQUEST_HEADER_TOO_LARGE,He.STATUSES.SSL_CERTIFICATE_ERROR,He.STATUSES.SSL_CERTIFICATE_REQUIRED,He.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,He.STATUSES.INVALID_TOKEN,He.STATUSES.CLIENT_CLOSED_REQUEST,He.STATUSES.INTERNAL_SERVER_ERROR,He.STATUSES.NOT_IMPLEMENTED,He.STATUSES.BAD_GATEWAY,He.STATUSES.SERVICE_UNAVAILABLE,He.STATUSES.GATEWAY_TIMEOUT,He.STATUSES.HTTP_VERSION_NOT_SUPPORTED,He.STATUSES.VARIANT_ALSO_NEGOTIATES,He.STATUSES.INSUFFICIENT_STORAGE,He.STATUSES.LOOP_DETECTED,He.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,He.STATUSES.NOT_EXTENDED,He.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,He.STATUSES.WEB_SERVER_UNKNOWN_ERROR,He.STATUSES.WEB_SERVER_IS_DOWN,He.STATUSES.CONNECTION_TIMEOUT,He.STATUSES.ORIGIN_IS_UNREACHABLE,He.STATUSES.TIMEOUT_OCCURED,He.STATUSES.SSL_HANDSHAKE_FAILED,He.STATUSES.INVALID_SSL_CERTIFICATE,He.STATUSES.RAILGUN_ERROR,He.STATUSES.SITE_IS_OVERLOADED,He.STATUSES.SITE_IS_FROZEN,He.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,He.STATUSES.NETWORK_READ_TIMEOUT,He.STATUSES.NETWORK_CONNECT_TIMEOUT];He.ALPHA=[];for(let t=65;t<=90;t++)He.ALPHA.push(String.fromCharCode(t)),He.ALPHA.push(String.fromCharCode(t+32));He.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};He.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};He.NUM=["0","1","2","3","4","5","6","7","8","9"];He.ALPHANUM=He.ALPHA.concat(He.NUM);He.MARK=["-","_",".","!","~","*","'","(",")"];He.USERINFO_CHARS=He.ALPHANUM.concat(He.MARK).concat(["%",";",":","&","=","+","$",","]);He.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(He.ALPHANUM);He.HEX=He.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);He.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(He.ALPHANUM);He.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&He.HEADER_CHARS.push(t);He.CONNECTION_TOKEN_CHARS=He.HEADER_CHARS.filter(t=>t!==44);He.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&He.QUOTED_STRING.push(t);He.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)He.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)He.HTAB_SP_VCHAR_OBS_TEXT.push(t);He.MAJOR=He.NUM_MAP;He.MINOR=He.MAJOR;He.SPECIAL_HEADERS={connection:He.HEADER_STATE.CONNECTION,"content-length":He.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":He.HEADER_STATE.CONNECTION,"transfer-encoding":He.HEADER_STATE.TRANSFER_ENCODING,upgrade:He.HEADER_STATE.UPGRADE};He.default={ERROR:He.ERROR,TYPE:He.TYPE,FLAGS:He.FLAGS,LENIENT_FLAGS:He.LENIENT_FLAGS,METHODS:He.METHODS,STATUSES:He.STATUSES,FINISH:He.FINISH,HEADER_STATE:He.HEADER_STATE,ALPHA:He.ALPHA,NUM_MAP:He.NUM_MAP,HEX_MAP:He.HEX_MAP,NUM:He.NUM,ALPHANUM:He.ALPHANUM,MARK:He.MARK,USERINFO_CHARS:He.USERINFO_CHARS,URL_CHAR:He.URL_CHAR,HEX:He.HEX,TOKEN:He.TOKEN,HEADER_CHARS:He.HEADER_CHARS,CONNECTION_TOKEN_CHARS:He.CONNECTION_TOKEN_CHARS,QUOTED_STRING:He.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:He.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:He.MAJOR,MINOR:He.MINOR,SPECIAL_HEADERS:He.SPECIAL_HEADERS,METHODS_HTTP:He.METHODS_HTTP,METHODS_ICE:He.METHODS_ICE,METHODS_RTSP:He.METHODS_RTSP,METHOD_MAP:He.METHOD_MAP,H_METHOD_MAP:He.H_METHOD_MAP,STATUSES_HTTP:He.STATUSES_HTTP}});var Qcr=I((XAf,dHn)=>{"use strict";p();var{Buffer:yNs}=require("node:buffer"),_Ns="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCq/ZAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAygCHCICQQJrDvwBAfkBAgMEBQYHCAkKCwwNDg8QERL4ARP3ARQV9gEWF/UBGBkaGxwdHh8g/QH7ASH0ASIjJCUmJygpKivzASwtLi8wMTLyAfEBMzTwAe8BNTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5P+gFQUVJT7gHtAVTsAVXrAVZXWFla6gFbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHpAegBzwHnAdAB5gHRAdIB0wHUAeUB1QHWAdcB2AHZAdoB2wHcAd0B3gHfAeAB4QHiAeMBAPwBC0EADOMBC0EODOIBC0ENDOEBC0EPDOABC0EQDN8BC0ETDN4BC0EUDN0BC0EVDNwBC0EWDNsBC0EXDNoBC0EYDNkBC0EZDNgBC0EaDNcBC0EbDNYBC0EcDNUBC0EdDNQBC0EeDNMBC0EfDNIBC0EgDNEBC0EhDNABC0EIDM8BC0EiDM4BC0EkDM0BC0EjDMwBC0EHDMsBC0ElDMoBC0EmDMkBC0EnDMgBC0EoDMcBC0ESDMYBC0ERDMUBC0EpDMQBC0EqDMMBC0ErDMIBC0EsDMEBC0HeAQzAAQtBLgy/AQtBLwy+AQtBMAy9AQtBMQy8AQtBMgy7AQtBMwy6AQtBNAy5AQtB3wEMuAELQTUMtwELQTkMtgELQQwMtQELQTYMtAELQTcMswELQTgMsgELQT4MsQELQToMsAELQeABDK8BC0ELDK4BC0E/DK0BC0E7DKwBC0EKDKsBC0E8DKoBC0E9DKkBC0HhAQyoAQtBwQAMpwELQcAADKYBC0HCAAylAQtBCQykAQtBLQyjAQtBwwAMogELQcQADKEBC0HFAAygAQtBxgAMnwELQccADJ4BC0HIAAydAQtByQAMnAELQcoADJsBC0HLAAyaAQtBzAAMmQELQc0ADJgBC0HOAAyXAQtBzwAMlgELQdAADJUBC0HRAAyUAQtB0gAMkwELQdMADJIBC0HVAAyRAQtB1AAMkAELQdYADI8BC0HXAAyOAQtB2AAMjQELQdkADIwBC0HaAAyLAQtB2wAMigELQdwADIkBC0HdAAyIAQtB3gAMhwELQd8ADIYBC0HgAAyFAQtB4QAMhAELQeIADIMBC0HjAAyCAQtB5AAMgQELQeUADIABC0HiAQx/C0HmAAx+C0HnAAx9C0EGDHwLQegADHsLQQUMegtB6QAMeQtBBAx4C0HqAAx3C0HrAAx2C0HsAAx1C0HtAAx0C0EDDHMLQe4ADHILQe8ADHELQfAADHALQfIADG8LQfEADG4LQfMADG0LQfQADGwLQfUADGsLQfYADGoLQQIMaQtB9wAMaAtB+AAMZwtB+QAMZgtB+gAMZQtB+wAMZAtB/AAMYwtB/QAMYgtB/gAMYQtB/wAMYAtBgAEMXwtBgQEMXgtBggEMXQtBgwEMXAtBhAEMWwtBhQEMWgtBhgEMWQtBhwEMWAtBiAEMVwtBiQEMVgtBigEMVQtBiwEMVAtBjAEMUwtBjQEMUgtBjgEMUQtBjwEMUAtBkAEMTwtBkQEMTgtBkgEMTQtBkwEMTAtBlAEMSwtBlQEMSgtBlgEMSQtBlwEMSAtBmAEMRwtBmQEMRgtBmgEMRQtBmwEMRAtBnAEMQwtBnQEMQgtBngEMQQtBnwEMQAtBoAEMPwtBoQEMPgtBogEMPQtBowEMPAtBpAEMOwtBpQEMOgtBpgEMOQtBpwEMOAtBqAEMNwtBqQEMNgtBqgEMNQtBqwEMNAtBrAEMMwtBrQEMMgtBrgEMMQtBrwEMMAtBsAEMLwtBsQEMLgtBsgEMLQtBswEMLAtBtAEMKwtBtQEMKgtBtgEMKQtBtwEMKAtBuAEMJwtBuQEMJgtBugEMJQtBuwEMJAtBvAEMIwtBvQEMIgtBvgEMIQtBvwEMIAtBwAEMHwtBwQEMHgtBwgEMHQtBAQwcC0HDAQwbC0HEAQwaC0HFAQwZC0HGAQwYC0HHAQwXC0HIAQwWC0HJAQwVC0HKAQwUC0HLAQwTC0HMAQwSC0HNAQwRC0HOAQwQC0HPAQwPC0HQAQwOC0HRAQwNC0HSAQwMC0HTAQwLC0HUAQwKC0HVAQwJC0HWAQwIC0HjAQwHC0HXAQwGC0HYAQwFC0HZAQwEC0HaAQwDC0HbAQwCC0HdAQwBC0HcAQshAgNAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJ/AkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAg7jAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEjJCUnKCmeA5sDmgORA4oDgwOAA/0C+wL4AvIC8QLvAu0C6ALnAuYC5QLkAtwC2wLaAtkC2ALXAtYC1QLPAs4CzALLAsoCyQLIAscCxgLEAsMCvgK8AroCuQK4ArcCtgK1ArQCswKyArECsAKuAq0CqQKoAqcCpgKlAqQCowKiAqECoAKfApgCkAKMAosCigKBAv4B/QH8AfsB+gH5AfgB9wH1AfMB8AHrAekB6AHnAeYB5QHkAeMB4gHhAeAB3wHeAd0B3AHaAdkB2AHXAdYB1QHUAdMB0gHRAdABzwHOAc0BzAHLAcoByQHIAccBxgHFAcQBwwHCAcEBwAG/Ab4BvQG8AbsBugG5AbgBtwG2AbUBtAGzAbIBsQGwAa8BrgGtAawBqwGqAakBqAGnAaYBpQGkAaMBogGfAZ4BmQGYAZcBlgGVAZQBkwGSAZEBkAGPAY0BjAGHAYYBhQGEAYMBggF9fHt6eXZ1dFBRUlNUVQsgASAERw1yQf0BIQIMvgMLIAEgBEcNmAFB2wEhAgy9AwsgASAERw3xAUGOASECDLwDCyABIARHDfwBQYQBIQIMuwMLIAEgBEcNigJB/wAhAgy6AwsgASAERw2RAkH9ACECDLkDCyABIARHDZQCQfsAIQIMuAMLIAEgBEcNHkEeIQIMtwMLIAEgBEcNGUEYIQIMtgMLIAEgBEcNygJBzQAhAgy1AwsgASAERw3VAkHGACECDLQDCyABIARHDdYCQcMAIQIMswMLIAEgBEcN3AJBOCECDLIDCyADLQAwQQFGDa0DDIkDC0EAIQACQAJAAkAgAy0AKkUNACADLQArRQ0AIAMvATIiAkECcUUNAQwCCyADLwEyIgJBAXFFDQELQQEhACADLQAoQQFGDQAgAy8BNCIGQeQAa0HkAEkNACAGQcwBRg0AIAZBsAJGDQAgAkHAAHENAEEAIQAgAkGIBHFBgARGDQAgAkEocUEARyEACyADQQA7ATIgA0EAOgAxAkAgAEUEQCADQQA6ADEgAy0ALkEEcQ0BDLEDCyADQgA3AyALIANBADoAMSADQQE6ADYMSAtBACEAAkAgAygCOCICRQ0AIAIoAjAiAkUNACADIAIRAAAhAAsgAEUNSCAAQRVHDWIgA0EENgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMrwMLIAEgBEYEQEEGIQIMrwMLIAEtAABBCkcNGSABQQFqIQEMGgsgA0IANwMgQRIhAgyUAwsgASAERw2KA0EjIQIMrAMLIAEgBEYEQEEHIQIMrAMLAkACQCABLQAAQQprDgQBGBgAGAsgAUEBaiEBQRAhAgyTAwsgAUEBaiEBIANBL2otAABBAXENF0EAIQIgA0EANgIcIAMgATYCFCADQZkgNgIQIANBGTYCDAyrAwsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFoNGEEIIQIMqgMLIAEgBEcEQCADQQk2AgggAyABNgIEQRQhAgyRAwtBCSECDKkDCyADKQMgUA2uAgxDCyABIARGBEBBCyECDKgDCyABLQAAQQpHDRYgAUEBaiEBDBcLIANBL2otAABBAXFFDRkMJgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0ZDEILQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGgwkC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRsMMgsgA0Evai0AAEEBcUUNHAwiC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADRwMQgtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0dDCALIAEgBEYEQEETIQIMoAMLAkAgAS0AACIAQQprDgQfIyMAIgsgAUEBaiEBDB8LQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIgxCCyABIARGBEBBFiECDJ4DCyABLQAAQcDBAGotAABBAUcNIwyDAwsCQANAIAEtAABBsDtqLQAAIgBBAUcEQAJAIABBAmsOAgMAJwsgAUEBaiEBQSEhAgyGAwsgBCABQQFqIgFHDQALQRghAgydAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAFBAWoiARA0IgANIQxBC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADSMMKgsgASAERgRAQRwhAgybAwsgA0EKNgIIIAMgATYCBEEAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADSVBJCECDIEDCyABIARHBEADQCABLQAAQbA9ai0AACIAQQNHBEAgAEEBaw4FGBomggMlJgsgBCABQQFqIgFHDQALQRshAgyaAwtBGyECDJkDCwNAIAEtAABBsD9qLQAAIgBBA0cEQCAAQQFrDgUPEScTJicLIAQgAUEBaiIBRw0AC0EeIQIMmAMLIAEgBEcEQCADQQs2AgggAyABNgIEQQchAgz/AgtBHyECDJcDCyABIARGBEBBICECDJcDCwJAIAEtAABBDWsOFC4/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8APwtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQMlgMLIANBL2ohAgNAIAEgBEYEQEEhIQIMlwMLAkACQAJAIAEtAAAiAEEJaw4YAgApKQEpKSkpKSkpKSkpKSkpKSkpKSkCJwsgAUEBaiEBIANBL2otAABBAXFFDQoMGAsgAUEBaiEBDBcLIAFBAWohASACLQAAQQJxDQALQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDJUDCyADLQAuQYABcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUN5gIgAEEVRgRAIANBJDYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDJQDC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAyTAwtBACECIANBADYCHCADIAE2AhQgA0G+IDYCECADQQI2AgwMkgMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABIAynaiIBEDIiAEUNKyADQQc2AhwgAyABNgIUIAMgADYCDAyRAwsgAy0ALkHAAHFFDQELQQAhAAJAIAMoAjgiAkUNACACKAJYIgJFDQAgAyACEQAAIQALIABFDSsgAEEVRgRAIANBCjYCHCADIAE2AhQgA0HrGTYCECADQRU2AgxBACECDJADC0EAIQIgA0EANgIcIAMgATYCFCADQZMMNgIQIANBEzYCDAyPAwtBACECIANBADYCHCADIAE2AhQgA0GCFTYCECADQQI2AgwMjgMLQQAhAiADQQA2AhwgAyABNgIUIANB3RQ2AhAgA0EZNgIMDI0DC0EAIQIgA0EANgIcIAMgATYCFCADQeYdNgIQIANBGTYCDAyMAwsgAEEVRg09QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIsDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFDSggA0ENNgIcIAMgATYCFCADIAA2AgwMigMLIABBFUYNOkEAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAyJAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwoCyADQQ42AhwgAyAANgIMIAMgAUEBajYCFAyIAwsgAEEVRg03QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIcDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCcLIANBDzYCHCADIAA2AgwgAyABQQFqNgIUDIYDC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAyFAwsgAEEVRg0zQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIQDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFDSUgA0ERNgIcIAMgATYCFCADIAA2AgwMgwMLIABBFUYNMEEAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAyCAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwlCyADQRI2AhwgAyAANgIMIAMgAUEBajYCFAyBAwsgA0Evai0AAEEBcUUNAQtBFyECDOYCC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAz+AgsgAEE7Rw0AIAFBAWohAQwMC0EAIQIgA0EANgIcIAMgATYCFCADQZIYNgIQIANBAjYCDAz8AgsgAEEVRg0oQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDPsCCyADQRQ2AhwgAyABNgIUIAMgADYCDAz6AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQz1AgsgA0EVNgIcIAMgADYCDCADIAFBAWo2AhQM+QILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM8wILIANBFzYCHCADIAA2AgwgAyABQQFqNgIUDPgCCyAAQRVGDSNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM9wILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEMHQsgA0EZNgIcIAMgADYCDCADIAFBAWo2AhQM9gILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM7wILIANBGjYCHCADIAA2AgwgAyABQQFqNgIUDPUCCyAAQRVGDR9BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwM9AILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwbCyADQRw2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8wILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQzrAgsgA0EdNgIcIAMgADYCDCADIAFBAWo2AhRBACECDPICCyAAQTtHDQEgAUEBaiEBC0EmIQIM1wILQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDO8CCyABIARHBEADQCABLQAAQSBHDYQCIAQgAUEBaiIBRw0AC0EsIQIM7wILQSwhAgzuAgsgASAERgRAQTQhAgzuAgsCQAJAA0ACQCABLQAAQQprDgQCAAADAAsgBCABQQFqIgFHDQALQTQhAgzvAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDZ8CIANBMjYCHCADIAE2AhQgAyAANgIMQQAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDJ8CCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM7QILIAEgBEcEQAJAA0AgAS0AAEEwayIAQf8BcUEKTwRAQTohAgzXAgsgAykDICILQpmz5syZs+bMGVYNASADIAtCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAMgCiALfDcDICAEIAFBAWoiAUcNAAtBwAAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgAUEBaiIBEDEiAA0XDOICC0HAACECDOwCCyABIARGBEBByQAhAgzsAgsCQANAAkAgAS0AAEEJaw4YAAKiAqICqQKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogIAogILIAQgAUEBaiIBRw0AC0HJACECDOwCCyABQQFqIQEgA0Evai0AAEEBcQ2lAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgzrAgsgASAERwRAA0AgAS0AAEEgRw0VIAQgAUEBaiIBRw0AC0H4ACECDOsCC0H4ACECDOoCCyADQQI6ACgMOAtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQM6AILQQAhAgzOAgtBDSECDM0CC0ETIQIMzAILQRUhAgzLAgtBFiECDMoCC0EYIQIMyQILQRkhAgzIAgtBGiECDMcCC0EbIQIMxgILQRwhAgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIAMgADYCDEEAIQIMwgILQfQBIQIgASAERg3BAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEG41QBqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzCAgsgA0GBBDsBKCADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIADQMMAgsgA0EANgIAC0EAIQIgA0EANgIcIAMgATYCFCADQeUfNgIQIANBCDYCDAy/AgtB1QEhAgylAgsgA0HzATYCHCADIAE2AhQgAyAANgIMQQAhAgy9AgtBACEAAkAgAygCOCICRQ0AIAIoAkAiAkUNACADIAIRAAAhAAsgAEUNbiAAQRVHBEAgA0EANgIcIAMgATYCFCADQYIPNgIQIANBIDYCDEEAIQIMvQILIANBjwE2AhwgAyABNgIUIANB7Bs2AhAgA0EVNgIMQQAhAgy8AgsgASAERwRAIANBDTYCCCADIAE2AgRB0wEhAgyjAgtB8gEhAgy7AgsgASAERgRAQfEBIQIMuwILAkACQAJAIAEtAABByABrDgsAAQgICAgICAgIAggLIAFBAWohAUHQASECDKMCCyABQQFqIQFB0QEhAgyiAgsgAUEBaiEBQdIBIQIMoQILQfABIQIgASAERg25AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBtdUAai0AAEcNBCAAQQJGDQMgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuQILQe8BIQIgASAERg24AiADKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABBs9UAai0AAEcNAyAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuAILQe4BIQIgASAERg23AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMtwILIAMoAgQhACADQgA3AwAgAyAAIAVBAWoiARArIgBFDQIgA0HsATYCHCADIAE2AhQgAyAANgIMQQAhAgy2AgsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNnAIgA0HtATYCHCADIAE2AhQgAyAANgIMQQAhAgy0AgtBzwEhAgyaAgtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4wE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ2YAiADQeQBNgIcIAMgATYCFCADIAA2AgwMrQILQckBIQIMkwILQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgytAgtByAEhAgyTAgsgA0HhATYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDKsCCyABIARGBEBB4QEhAgyrAgsCQCABLQAAQSBGBEAgA0EAOwE0IAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBmRE2AhAgA0EJNgIMQQAhAgyrAgtBxwEhAgyRAgsgASAERgRAQeABIQIMqgILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyrAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqgILQcYBIQIMkAILIAEgBEYEQEHfASECDKkCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqgILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKkCC0HFASECDI8CCyABIARGBEBB3gEhAgyoAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKkCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyoAgtBxAEhAgyOAgsgASAERgRAQd0BIQIMpwILAkACQAJAAkAgAS0AAEEKaw4XAgMDAAMDAwMDAwMDAwMDAwMDAwMDAwEDCyABQQFqDAULIAFBAWohAUHDASECDI8CCyABQQFqIQEgA0Evai0AAEEBcQ0IIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKcCCyADQQA2AhwgAyABNgIUIANBjQs2AhAgA0ENNgIMQQAhAgymAgsgASAERwRAIANBDzYCCCADIAE2AgRBASECDI0CC0HcASECDKUCCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBAWohAQwBCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAjwiAkUNACADIAIRAAAhAAsgAEUNoAEgAEEVRgRAIANB2QA2AhwgAyABNgIUIANBtxo2AhAgA0EVNgIMQQAhAgyfAgsgA0EANgIcIAMgATYCFCADQYANNgIQIANBGzYCDEEAIQIMngILIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDJ0CCyABIARHBEAgA0EMNgIIIAMgATYCBEG/ASECDIQCC0HYASECDJwCCyABIARGBEBB1wEhAgycAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBwQBrDhUAAQIDWgQFBlpaWgcICQoLDA0ODxBaCyABQQFqIQFB+wAhAgySAgsgAUEBaiEBQfwAIQIMkQILIAFBAWohAUGBASECDJACCyABQQFqIQFBhQEhAgyPAgsgAUEBaiEBQYYBIQIMjgILIAFBAWohAUGJASECDI0CCyABQQFqIQFBigEhAgyMAgsgAUEBaiEBQY0BIQIMiwILIAFBAWohAUGWASECDIoCCyABQQFqIQFBlwEhAgyJAgsgAUEBaiEBQZgBIQIMiAILIAFBAWohAUGlASECDIcCCyABQQFqIQFBpgEhAgyGAgsgAUEBaiEBQawBIQIMhQILIAFBAWohAUG0ASECDIQCCyABQQFqIQFBtwEhAgyDAgsgAUEBaiEBQb4BIQIMggILIAEgBEYEQEHWASECDJsCCyABLQAAQc4ARw1IIAFBAWohAUG9ASECDIECCyABIARGBEBB1QEhAgyaAgsCQAJAAkAgAS0AAEHCAGsOEgBKSkpKSkpKSkoBSkpKSkpKAkoLIAFBAWohAUG4ASECDIICCyABQQFqIQFBuwEhAgyBAgsgAUEBaiEBQbwBIQIMgAILQdQBIQIgASAERg2YAiADKAIAIgAgBCABa2ohBSABIABrQQdqIQYCQANAIAEtAAAgAEGo1QBqLQAARw1FIABBB0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAgsgA0EANgIAIAZBAWohAUEbDEULIAEgBEYEQEHTASECDJgCCwJAAkAgAS0AAEHJAGsOBwBHR0dHRwFHCyABQQFqIQFBuQEhAgz/AQsgAUEBaiEBQboBIQIM/gELQdIBIQIgASAERg2WAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw1DIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyXAgsgA0EANgIAIAZBAWohAUEPDEMLQdEBIQIgASAERg2VAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw1CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyWAgsgA0EANgIAIAZBAWohAUEgDEILQdABIQIgASAERg2UAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw1BIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyVAgsgA0EANgIAIAZBAWohAUESDEELIAEgBEYEQEHPASECDJQCCwJAAkAgAS0AAEHFAGsODgBDQ0NDQ0NDQ0NDQ0MBQwsgAUEBaiEBQbUBIQIM+wELIAFBAWohAUG2ASECDPoBC0HOASECIAEgBEYNkgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBntUAai0AAEcNPyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkwILIANBADYCACAGQQFqIQFBBww/C0HNASECIAEgBEYNkQIgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBmNUAai0AAEcNPiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkgILIANBADYCACAGQQFqIQFBKAw+CyABIARGBEBBzAEhAgyRAgsCQAJAAkAgAS0AAEHFAGsOEQBBQUFBQUFBQUEBQUFBQUECQQsgAUEBaiEBQbEBIQIM+QELIAFBAWohAUGyASECDPgBCyABQQFqIQFBswEhAgz3AQtBywEhAiABIARGDY8CIAMoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQZHVAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJACCyADQQA2AgAgBkEBaiEBQRoMPAtBygEhAiABIARGDY4CIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQY3VAGotAABHDTsgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADI8CCyADQQA2AgAgBkEBaiEBQSEMOwsgASAERgRAQckBIQIMjgILAkACQCABLQAAQcEAaw4UAD09PT09PT09PT09PT09PT09PQE9CyABQQFqIQFBrQEhAgz1AQsgAUEBaiEBQbABIQIM9AELIAEgBEYEQEHIASECDI0CCwJAAkAgAS0AAEHVAGsOCwA8PDw8PDw8PDwBPAsgAUEBaiEBQa4BIQIM9AELIAFBAWohAUGvASECDPMBC0HHASECIAEgBEYNiwIgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNOCAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjAILIANBADYCACAGQQFqIQFBKgw4CyABIARGBEBBxgEhAgyLAgsgAS0AAEHQAEcNOCABQQFqIQFBJQw3C0HFASECIAEgBEYNiQIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBgdUAai0AAEcNNiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMigILIANBADYCACAGQQFqIQFBDgw2CyABIARGBEBBxAEhAgyJAgsgAS0AAEHFAEcNNiABQQFqIQFBqwEhAgzvAQsgASAERgRAQcMBIQIMiAILAkACQAJAAkAgAS0AAEHCAGsODwABAjk5OTk5OTk5OTk5AzkLIAFBAWohAUGnASECDPEBCyABQQFqIQFBqAEhAgzwAQsgAUEBaiEBQakBIQIM7wELIAFBAWohAUGqASECDO4BC0HCASECIAEgBEYNhgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB/tQAai0AAEcNMyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhwILIANBADYCACAGQQFqIQFBFAwzC0HBASECIAEgBEYNhQIgAygCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABB+dQAai0AAEcNMiAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhgILIANBADYCACAGQQFqIQFBKwwyC0HAASECIAEgBEYNhAIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB9tQAai0AAEcNMSAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhQILIANBADYCACAGQQFqIQFBLAwxC0G/ASECIAEgBEYNgwIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNMCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhAILIANBADYCACAGQQFqIQFBEQwwC0G+ASECIAEgBEYNggIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB8tQAai0AAEcNLyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgwILIANBADYCACAGQQFqIQFBLgwvCyABIARGBEBBvQEhAgyCAgsCQAJAAkACQAJAIAEtAABBwQBrDhUANDQ0NDQ0NDQ0NAE0NAI0NAM0NAQ0CyABQQFqIQFBmwEhAgzsAQsgAUEBaiEBQZwBIQIM6wELIAFBAWohAUGdASECDOoBCyABQQFqIQFBogEhAgzpAQsgAUEBaiEBQaQBIQIM6AELIAEgBEYEQEG8ASECDIECCwJAAkAgAS0AAEHSAGsOAwAwATALIAFBAWohAUGjASECDOgBCyABQQFqIQFBBAwtC0G7ASECIAEgBEYN/wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8NQAai0AAEcNLCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgAILIANBADYCACAGQQFqIQFBHQwsCyABIARGBEBBugEhAgz/AQsCQAJAIAEtAABByQBrDgcBLi4uLi4ALgsgAUEBaiEBQaEBIQIM5gELIAFBAWohAUEiDCsLIAEgBEYEQEG5ASECDP4BCyABLQAAQdAARw0rIAFBAWohAUGgASECDOQBCyABIARGBEBBuAEhAgz9AQsCQAJAIAEtAABBxgBrDgsALCwsLCwsLCwsASwLIAFBAWohAUGeASECDOQBCyABQQFqIQFBnwEhAgzjAQtBtwEhAiABIARGDfsBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQezUAGotAABHDSggAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPwBCyADQQA2AgAgBkEBaiEBQQ0MKAtBtgEhAiABIARGDfoBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDScgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPsBCyADQQA2AgAgBkEBaiEBQQwMJwtBtQEhAiABIARGDfkBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQerUAGotAABHDSYgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPoBCyADQQA2AgAgBkEBaiEBQQMMJgtBtAEhAiABIARGDfgBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQejUAGotAABHDSUgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPkBCyADQQA2AgAgBkEBaiEBQSYMJQsgASAERgRAQbMBIQIM+AELAkACQCABLQAAQdQAaw4CAAEnCyABQQFqIQFBmQEhAgzfAQsgAUEBaiEBQZoBIQIM3gELQbIBIQIgASAERg32ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHm1ABqLQAARw0jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz3AQsgA0EANgIAIAZBAWohAUEnDCMLQbEBIQIgASAERg31ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHk1ABqLQAARw0iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz2AQsgA0EANgIAIAZBAWohAUEcDCILQbABIQIgASAERg30ASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHe1ABqLQAARw0hIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz1AQsgA0EANgIAIAZBAWohAUEGDCELQa8BIQIgASAERg3zASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHZ1ABqLQAARw0gIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz0AQsgA0EANgIAIAZBAWohAUEZDCALIAEgBEYEQEGuASECDPMBCwJAAkACQAJAIAEtAABBLWsOIwAkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJAEkJCQkJAIkJCQDJAsgAUEBaiEBQY4BIQIM3AELIAFBAWohAUGPASECDNsBCyABQQFqIQFBlAEhAgzaAQsgAUEBaiEBQZUBIQIM2QELQa0BIQIgASAERg3xASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHX1ABqLQAARw0eIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzyAQsgA0EANgIAIAZBAWohAUELDB4LIAEgBEYEQEGsASECDPEBCwJAAkAgAS0AAEHBAGsOAwAgASALIAFBAWohAUGQASECDNgBCyABQQFqIQFBkwEhAgzXAQsgASAERgRAQasBIQIM8AELAkACQCABLQAAQcEAaw4PAB8fHx8fHx8fHx8fHx8BHwsgAUEBaiEBQZEBIQIM1wELIAFBAWohAUGSASECDNYBCyABIARGBEBBqgEhAgzvAQsgAS0AAEHMAEcNHCABQQFqIQFBCgwbC0GpASECIAEgBEYN7QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABB0dQAai0AAEcNGiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7gELIANBADYCACAGQQFqIQFBHgwaC0GoASECIAEgBEYN7AEgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBytQAai0AAEcNGSAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7QELIANBADYCACAGQQFqIQFBFQwZC0GnASECIAEgBEYN6wEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBx9QAai0AAEcNGCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7AELIANBADYCACAGQQFqIQFBFwwYC0GmASECIAEgBEYN6gEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBwdQAai0AAEcNFyAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6wELIANBADYCACAGQQFqIQFBGAwXCyABIARGBEBBpQEhAgzqAQsCQAJAIAEtAABByQBrDgcAGRkZGRkBGQsgAUEBaiEBQYsBIQIM0QELIAFBAWohAUGMASECDNABC0GkASECIAEgBEYN6AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBptUAai0AAEcNFSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6QELIANBADYCACAGQQFqIQFBCQwVC0GjASECIAEgBEYN5wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBpNUAai0AAEcNFCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6AELIANBADYCACAGQQFqIQFBHwwUC0GiASECIAEgBEYN5gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBvtQAai0AAEcNEyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5wELIANBADYCACAGQQFqIQFBAgwTC0GhASECIAEgBEYN5QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGA0AgAS0AACAAQbzUAGotAABHDREgAEEBRg0CIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADOUBCyABIARGBEBBoAEhAgzlAQtBASABLQAAQd8ARw0RGiABQQFqIQFBhwEhAgzLAQsgA0EANgIAIAZBAWohAUGIASECDMoBC0GfASECIAEgBEYN4gEgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNDyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4wELIANBADYCACAGQQFqIQFBKQwPC0GeASECIAEgBEYN4QEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBuNQAai0AAEcNDiAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4gELIANBADYCACAGQQFqIQFBLQwOCyABIARGBEBBnQEhAgzhAQsgAS0AAEHFAEcNDiABQQFqIQFBhAEhAgzHAQsgASAERgRAQZwBIQIM4AELAkACQCABLQAAQcwAaw4IAA8PDw8PDwEPCyABQQFqIQFBggEhAgzHAQsgAUEBaiEBQYMBIQIMxgELQZsBIQIgASAERg3eASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEGz1ABqLQAARw0LIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzfAQsgA0EANgIAIAZBAWohAUEjDAsLQZoBIQIgASAERg3dASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGw1ABqLQAARw0KIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzeAQsgA0EANgIAIAZBAWohAUEADAoLIAEgBEYEQEGZASECDN0BCwJAAkAgAS0AAEHIAGsOCAAMDAwMDAwBDAsgAUEBaiEBQf0AIQIMxAELIAFBAWohAUGAASECDMMBCyABIARGBEBBmAEhAgzcAQsCQAJAIAEtAABBzgBrDgMACwELCyABQQFqIQFB/gAhAgzDAQsgAUEBaiEBQf8AIQIMwgELIAEgBEYEQEGXASECDNsBCyABLQAAQdkARw0IIAFBAWohAUEIDAcLQZYBIQIgASAERg3ZASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEGs1ABqLQAARw0GIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzaAQsgA0EANgIAIAZBAWohAUEFDAYLQZUBIQIgASAERg3YASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGm1ABqLQAARw0FIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzZAQsgA0EANgIAIAZBAWohAUEWDAULQZQBIQIgASAERg3XASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0EIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzYAQsgA0EANgIAIAZBAWohAUEQDAQLIAEgBEYEQEGTASECDNcBCwJAAkAgAS0AAEHDAGsODAAGBgYGBgYGBgYGAQYLIAFBAWohAUH5ACECDL4BCyABQQFqIQFB+gAhAgy9AQtBkgEhAiABIARGDdUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUYNASADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgzOAQtB9wAhAgy0AQsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDMwBCyABIARGBEBBjwEhAgzMAQsCQCABLQAAQSBGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GbHzYCECADQQY2AgxBACECDMwBC0ECIQIMsgELA0AgAS0AAEEgRw0CIAQgAUEBaiIBRw0AC0GOASECDMoBCyABIARGBEBBjQEhAgzKAQsCQCABLQAAQQlrDgRKAABKAAtB9QAhAgywAQsgAy0AKUEFRgRAQfYAIQIMsAELQfQAIQIMrwELIAEgBEYEQEGMASECDMgBCyADQRA2AgggAyABNgIEDAoLIAEgBEYEQEGLASECDMcBCwJAIAEtAABBCWsOBEcAAEcAC0HzACECDK0BCyABIARHBEAgA0EQNgIIIAMgATYCBEHxACECDK0BC0GKASECDMUBCwJAIAEgBEcEQANAIAEtAABBoNAAai0AACIAQQNHBEACQCAAQQFrDgJJAAQLQfAAIQIMrwELIAQgAUEBaiIBRw0AC0GIASECDMYBC0GIASECDMUBCyADQQA2AhwgAyABNgIUIANB2yA2AhAgA0EHNgIMQQAhAgzEAQsgASAERgRAQYkBIQIMxAELAkACQAJAIAEtAABBoNIAai0AAEEBaw4DRgIAAQtB8gAhAgysAQsgA0EANgIcIAMgATYCFCADQbQSNgIQIANBBzYCDEEAIQIMxAELQeoAIQIMqgELIAEgBEcEQCABQQFqIQFB7wAhAgyqAQtBhwEhAgzCAQsgBCABIgBGBEBBhgEhAgzCAQsgAC0AACIBQS9GBEAgAEEBaiEBQe4AIQIMqQELIAFBCWsiAkEXSw0BIAAhAUEBIAJ0QZuAgARxDUEMAQsgBCABIgBGBEBBhQEhAgzBAQsgAC0AAEEvRw0AIABBAWohAQwDC0EAIQIgA0EANgIcIAMgADYCFCADQdsgNgIQIANBBzYCDAy/AQsCQAJAAkACQAJAA0AgAS0AAEGgzgBqLQAAIgBBBUcEQAJAAkAgAEEBaw4IRwUGBwgABAEIC0HrACECDK0BCyABQQFqIQFB7QAhAgysAQsgBCABQQFqIgFHDQALQYQBIQIMwwELIAFBAWoMFAsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgzBAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgzAAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy/AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMvgELIAEgBEYEQEGDASECDL4BCwJAIAEtAABBoM4Aai0AAEEBaw4IPgQFBgAIAgMHCyABQQFqIQELQQMhAgyjAQsgAUEBagwNC0EAIQIgA0EANgIcIANB0RI2AhAgA0EHNgIMIAMgAUEBajYCFAy6AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgy5AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgy4AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy3AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMtgELQewAIQIMnAELIAEgBEYEQEGCASECDLUBCyABQQFqDAILIAEgBEYEQEGBASECDLQBCyABQQFqDAELIAEgBEYNASABQQFqCyEBQQQhAgyYAQtBgAEhAgywAQsDQCABLQAAQaDMAGotAAAiAEECRwRAIABBAUcEQEHpACECDJkBCwwxCyAEIAFBAWoiAUcNAAtB/wAhAgyvAQsgASAERgRAQf4AIQIMrwELAkAgAS0AAEEJaw43LwMGLwQGBgYGBgYGBgYGBgYGBgYGBgYFBgYCBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAAYLIAFBAWoLIQFBBSECDJQBCyABQQFqDAYLIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIANBADYCHCADIAE2AhQgA0GNFDYCECADQQc2AgxBACECDKgBCwJAAkACQAJAA0AgAS0AAEGgygBqLQAAIgBBBUcEQAJAIABBAWsOBi4DBAUGAAYLQegAIQIMlAELIAQgAUEBaiIBRw0AC0H9ACECDKsBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQdsANgIcIAMgATYCFCADIAA2AgxBACECDKoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDKkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQfoANgIcIAMgATYCFCADIAA2AgxBACECDKgBCyADQQA2AhwgAyABNgIUIANB5Ag2AhAgA0EHNgIMQQAhAgynAQsgASAERg0BIAFBAWoLIQFBBiECDIwBC0H8ACECDKQBCwJAAkACQAJAA0AgAS0AAEGgyABqLQAAIgBBBUcEQCAAQQFrDgQpAgMEBQsgBCABQQFqIgFHDQALQfsAIQIMpwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMpgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMpQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMpAELIANBADYCHCADIAE2AhQgA0G8CjYCECADQQc2AgxBACECDKMBC0HPACECDIkBC0HRACECDIgBC0HnACECDIcBCyABIARGBEBB+gAhAgygAQsCQCABLQAAQQlrDgQgAAAgAAsgAUEBaiEBQeYAIQIMhgELIAEgBEYEQEH5ACECDJ8BCwJAIAEtAABBCWsOBB8AAB8AC0EAIQACQCADKAI4IgJFDQAgAigCOCICRQ0AIAMgAhEAACEACyAARQRAQeIBIQIMhgELIABBFUcEQCADQQA2AhwgAyABNgIUIANByQ02AhAgA0EaNgIMQQAhAgyfAQsgA0H4ADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDJ4BCyABIARHBEAgA0ENNgIIIAMgATYCBEHkACECDIUBC0H3ACECDJ0BCyABIARGBEBB9gAhAgydAQsCQAJAAkAgAS0AAEHIAGsOCwABCwsLCwsLCwsCCwsgAUEBaiEBQd0AIQIMhQELIAFBAWohAUHgACECDIQBCyABQQFqIQFB4wAhAgyDAQtB9QAhAiABIARGDZsBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbXVAGotAABHDQggAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJwBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIABEAgA0H0ADYCHCADIAE2AhQgAyAANgIMQQAhAgycAQtB4gAhAgyCAQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJwBC0HhACECDIIBCyADQfMANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMmgELIAMtACkiAEEja0ELSQ0JAkAgAEEGSw0AQQEgAHRBygBxRQ0ADAoLQQAhAiADQQA2AhwgAyABNgIUIANB7Qk2AhAgA0EINgIMDJkBC0HyACECIAEgBEYNmAEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBs9UAai0AAEcNBSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMmQELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANgIcIANBmhI2AhAgA0EHNgIMIAMgAUEBajYCFAx/CyADQYASOwEqQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2QA2AhwgAyABNgIUIANB6ho2AhAgA0EVNgIMQQAhAgx+C0HNACECDGQLIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDHwLIAEgBEYEQEHZACECDHwLIAEtAABBIEcNPSABQQFqIQEgAy0ALkEBcQ09IANBADYCHCADIAE2AhQgA0HCHDYCECADQR42AgxBACECDHsLIAEgBEYEQEHYACECDHsLAkACQAJAAkACQCABLQAAIgBBCmsOBAIDAwABCyABQQFqIQFBLCECDGULIABBOkcNASADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgx9CyABQQFqIQEgA0Evai0AAEEBcUUNcyADLQAyQYABcUUEQCADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALAkACQCAADhZNTEsBAQEBAQEBAQEBAQEBAQEBAQEAAQsgA0EpNgIcIAMgATYCFCADQawZNgIQIANBFTYCDEEAIQIMfgsgA0EANgIcIAMgATYCFCADQeULNgIQIANBETYCDEEAIQIMfQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUNWSAAQRVHDQEgA0EFNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMfAtBywAhAgxiC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAx6CyADIAMvATJBgAFyOwEyDDsLIAEgBEcEQCADQRE2AgggAyABNgIEQcoAIQIMYAtB1wAhAgx4CyABIARGBEBB1gAhAgx4CwJAAkACQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQeMAaw4TAEBAQEBAQEBAQEBAQAFAQEACA0ALIAFBAWohAUHGACECDGELIAFBAWohAUHHACECDGALIAFBAWohAUHIACECDF8LIAFBAWohAUHJACECDF4LQdUAIQIgBCABIgBGDXYgBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0IQQQgAUEFRg0KGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx2C0HUACECIAQgASIARg11IAQgAWsgAygCACIBaiEGIAAgAWtBD2ohBwNAIAFBgMgAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNB0EDIAFBD0YNCRogAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdQtB0wAhAiAEIAEiAEYNdCAEIAFrIAMoAgAiAWohBiAAIAFrQQ5qIQcDQCABQeLHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQYgAUEORg0HIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHQLQdIAIQIgBCABIgBGDXMgBCABayADKAIAIgFqIQUgACABa0EBaiEGA0AgAUHgxwBqLQAAIAAtAAAiB0EgciAHIAdBwQBrQf8BcUEaSRtB/wFxRw0FIAFBAUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBTYCAAxzCyABIARGBEBB0QAhAgxzCwJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB7gBrDgcAOTk5OTkBOQsgAUEBaiEBQcMAIQIMWgsgAUEBaiEBQcQAIQIMWQsgA0EANgIAIAZBAWohAUHFACECDFgLQdAAIQIgBCABIgBGDXAgBCABayADKAIAIgFqIQYgACABa0EJaiEHA0AgAUHWxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0CQQIgAUEJRg0EGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxwC0HPACECIAQgASIARg1vIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwNAIAFB0McAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQVGDQIgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMbwsgACEBIANBADYCAAwzC0EBCzoALCADQQA2AgAgB0EBaiEBC0EtIQIMUgsCQANAIAEtAABB0MUAai0AAEEBRw0BIAQgAUEBaiIBRw0AC0HNACECDGsLQcIAIQIMUQsgASAERgRAQcwAIQIMagsgAS0AAEE6RgRAIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0zIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMagsgA0EANgIcIAMgATYCFCADQecRNgIQIANBCjYCDEEAIQIMaQsCQAJAIAMtACxBAmsOAgABJwsgA0Ezai0AAEECcUUNJiADLQAuQQJxDSYgA0EANgIcIAMgATYCFCADQaYUNgIQIANBCzYCDEEAIQIMaQsgAy0AMkEgcUUNJSADLQAuQQJxDSUgA0EANgIcIAMgATYCFCADQb0TNgIQIANBDzYCDEEAIQIMaAtBACEAAkAgAygCOCICRQ0AIAIoAkgiAkUNACADIAIRAAAhAAsgAEUEQEHBACECDE8LIABBFUcEQCADQQA2AhwgAyABNgIUIANBpg82AhAgA0EcNgIMQQAhAgxoCyADQcoANgIcIAMgATYCFCADQYUcNgIQIANBFTYCDEEAIQIMZwsgASAERwRAA0AgAS0AAEHAwQBqLQAAQQFHDRcgBCABQQFqIgFHDQALQcQAIQIMZwtBxAAhAgxmCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUE2IQIMUgsgAUEBaiEBQTchAgxRCyABQQFqIQFBOCECDFALDBULIAQgAUEBaiIBRw0AC0E8IQIMZgtBPCECDGULIAEgBEYEQEHIACECDGULIANBEjYCCCADIAE2AgQCQAJAAkACQAJAIAMtACxBAWsOBBQAAQIJCyADLQAyQSBxDQNB4AEhAgxPCwJAIAMvATIiAEEIcUUNACADLQAoQQFHDQAgAy0ALkEIcUUNAgsgAyAAQff7A3FBgARyOwEyDAsLIAMgAy8BMkEQcjsBMgwECyADQQA2AgQgAyABIAEQMSIABEAgA0HBADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxmCyABQQFqIQEMWAsgA0EANgIcIAMgATYCFCADQfQTNgIQIANBBDYCDEEAIQIMZAtBxwAhAiABIARGDWMgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCAAQcDFAGotAAAgAS0AAEEgckcNASAAQQZGDUogAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMZAsgA0EANgIADAULAkAgASAERwRAA0AgAS0AAEHAwwBqLQAAIgBBAUcEQCAAQQJHDQMgAUEBaiEBDAULIAQgAUEBaiIBRw0AC0HFACECDGQLQcUAIQIMYwsLIANBADoALAwBC0ELIQIMRwtBPyECDEYLAkACQANAIAEtAAAiAEEgRwRAAkAgAEEKaw4EAwUFAwALIABBLEYNAwwECyAEIAFBAWoiAUcNAAtBxgAhAgxgCyADQQg6ACwMDgsgAy0AKEEBRw0CIAMtAC5BCHENAiADKAIEIQAgA0EANgIEIAMgACABEDEiAARAIANBwgA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMXwsgAUEBaiEBDFALQTshAgxECwJAA0AgAS0AACIAQSBHIABBCUdxDQEgBCABQQFqIgFHDQALQcMAIQIMXQsLQTwhAgxCCwJAAkAgASAERwRAA0AgAS0AACIAQSBHBEAgAEEKaw4EAwQEAwQLIAQgAUEBaiIBRw0AC0E/IQIMXQtBPyECDFwLIAMgAy8BMkEgcjsBMgwKCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNTiADQT42AhwgAyABNgIUIAMgADYCDEEAIQIMWgsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkYNAwwMCyAEIAFBAWoiAUcNAAtBNyECDFsLQTchAgxaCyABQQFqIQEMBAtBOyECIAQgASIARg1YIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwJAA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEMPwsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMWQsgA0EANgIAIAAhAQwFC0E6IQIgBCABIgBGDVcgBCABayADKAIAIgFqIQYgACABa0EIaiEHAkADQCABQbTBAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEIRgRAQQUhAQw+CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxYCyADQQA2AgAgACEBDAQLQTkhAiAEIAEiAEYNViAEIAFrIAMoAgAiAWohBiAAIAFrQQNqIQcCQANAIAFBsMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQNGBEBBBiEBDD0LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFcLIANBADYCACAAIQEMAwsCQANAIAEtAAAiAEEgRwRAIABBCmsOBAcEBAcCCyAEIAFBAWoiAUcNAAtBOCECDFYLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCADLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIANBAToALCADIAMvATIgAXI7ATIgACEBDAELIAMgAy8BMkEIcjsBMiAAIQELQT4hAgw7CyADQQA6ACwLQTkhAgw5CyABIARGBEBBNiECDFILAkACQAJAAkACQCABLQAAQQprDgQAAgIBAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDQIgA0EzNgIcIAMgATYCFCADIAA2AgxBACECDFULIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQRAIAFBAWohAQwGCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMVAsgAy0ALkEBcQRAQd8BIQIMOwsgAygCBCEAIANBADYCBCADIAAgARAxIgANAQxJC0E0IQIMOQsgA0E1NgIcIAMgATYCFCADIAA2AgxBACECDFELQTUhAgw3CyADQS9qLQAAQQFxDQAgA0EANgIcIAMgATYCFCADQesWNgIQIANBGTYCDEEAIQIMTwtBMyECDDULIAEgBEYEQEEyIQIMTgsCQCABLQAAQQpGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GSFzYCECADQQM2AgxBACECDE4LQTIhAgw0CyABIARGBEBBMSECDE0LAkAgAS0AACIAQQlGDQAgAEEgRg0AQQEhAgJAIAMtACxBBWsOBAYEBQANCyADIAMvATJBCHI7ATIMDAsgAy0ALkEBcUUNASADLQAsQQhHDQAgA0EAOgAsC0E9IQIMMgsgA0EANgIcIAMgATYCFCADQcIWNgIQIANBCjYCDEEAIQIMSgtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgwGCyABIARGBEBBMCECDEcLIAEtAABBCkYEQCABQQFqIQEMAQsgAy0ALkEBcQ0AIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDEYLQTAhAgwsCyABQQFqIQFBMSECDCsLIAEgBEYEQEEvIQIMRAsgAS0AACIAQQlHIABBIEdxRQRAIAFBAWohASADLQAuQQFxDQEgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDEEAIQIMRAtBASECAkACQAJAAkACQAJAIAMtACxBAmsOBwUEBAMBAgAECyADIAMvATJBCHI7ATIMAwtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgtBLyECDCsLIANBADYCHCADIAE2AhQgA0GEEzYCECADQQs2AgxBACECDEMLQeEBIQIMKQsgASAERgRAQS4hAgxCCyADQQA2AgQgA0ESNgIIIAMgASABEDEiAA0BC0EuIQIMJwsgA0EtNgIcIAMgATYCFCADIAA2AgxBACECDD8LQQAhAAJAIAMoAjgiAkUNACACKAJMIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2AA2AhwgAyABNgIUIANBsxs2AhAgA0EVNgIMQQAhAgw+C0HMACECDCQLIANBADYCHCADIAE2AhQgA0GzDjYCECADQR02AgxBACECDDwLIAEgBEYEQEHOACECDDwLIAEtAAAiAEEgRg0CIABBOkYNAQsgA0EAOgAsQQkhAgwhCyADKAIEIQAgA0EANgIEIAMgACABEDAiAA0BDAILIAMtAC5BAXEEQEHeASECDCALIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0CIANBKjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgw4CyADQcsANgIcIAMgADYCDCADIAFBAWo2AhRBACECDDcLIAFBAWohAUHAACECDB0LIAFBAWohAQwsCyABIARGBEBBKyECDDULAkAgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQcAAcUUNBgsgAy0AMkGAAXEEQEEAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ0SIABBFUYEQCADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgw2CyADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMQQAhAgw1CyADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyADQQE6ADALIAIgAi8BAEHAAHI7AQALQSshAgwYCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgwwCyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgwvCyADQQA2AhwgAyABNgIUIANBpQs2AhAgA0ECNgIMQQAhAgwuC0EBIQcgAy8BMiIFQQhxRQRAIAMpAyBCAFIhBwsCQCADLQAwBEBBASEAIAMtAClBBUYNASAFQcAAcUUgB3FFDQELAkAgAy0AKCICQQJGBEBBASEAIAMvATQiBkHlAEYNAkEAIQAgBUHAAHENAiAGQeQARg0CIAZB5gBrQQJJDQIgBkHMAUYNAiAGQbACRg0CDAELQQAhACAFQcAAcQ0BC0ECIQAgBUEIcQ0AIAVBgARxBEACQCACQQFHDQAgAy0ALkEKcQ0AQQUhAAwCC0EEIQAMAQsgBUEgcUUEQCADEDZBAEdBAnQhAAwBC0EAQQMgAykDIFAbIQALIABBAWsOBQIABwEDBAtBESECDBMLIANBAToAMQwpC0EAIQICQCADKAI4IgBFDQAgACgCMCIARQ0AIAMgABEAACECCyACRQ0mIAJBFUYEQCADQQM2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwrC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAwqCyADQQA2AhwgAyABNgIUIANB+SA2AhAgA0EPNgIMQQAhAgwpC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAADQELQQ4hAgwOCyAAQRVGBEAgA0ECNgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMJwsgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDEEAIQIMJgtBKiECDAwLIAEgBEcEQCADQQk2AgggAyABNgIEQSkhAgwMC0EmIQIMJAsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFQEQEElIQIMJAsgAygCBCEAIANBADYCBCADIAAgASAMp2oiARAyIgBFDQAgA0EFNgIcIAMgATYCFCADIAA2AgxBACECDCMLQQ8hAgwJC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FxYAAQIDBAUGBxQUFBQUFBQICQoLDA0UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFA4PEBESExQLQgIhCgwWC0IDIQoMFQtCBCEKDBQLQgUhCgwTC0IGIQoMEgtCByEKDBELQgghCgwQC0IJIQoMDwtCCiEKDA4LQgshCgwNC0IMIQoMDAtCDSEKDAsLQg4hCgwKC0IPIQoMCQtCCiEKDAgLQgshCgwHC0IMIQoMBgtCDSEKDAULQg4hCgwEC0IPIQoMAwsgA0EANgIcIAMgATYCFCADQZ8VNgIQIANBDDYCDEEAIQIMIQsgASAERgRAQSIhAgwhC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsONxUUAAECAwQFBgcWFhYWFhYWCAkKCwwNFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYODxAREhMWC0ICIQoMFAtCAyEKDBMLQgQhCgwSC0IFIQoMEQtCBiEKDBALQgchCgwPC0IIIQoMDgtCCSEKDA0LQgohCgwMC0ILIQoMCwtCDCEKDAoLQg0hCgwJC0IOIQoMCAtCDyEKDAcLQgohCgwGC0ILIQoMBQtCDCEKDAQLQg0hCgwDC0IOIQoMAgtCDyEKDAELQgEhCgsgAUEBaiEBIAMpAyAiC0L//////////w9YBEAgAyALQgSGIAqENwMgDAILIANBADYCHCADIAE2AhQgA0G1CTYCECADQQw2AgxBACECDB4LQSchAgwEC0EoIQIMAwsgAyABOgAsIANBADYCACAHQQFqIQFBDCECDAILIANBADYCACAGQQFqIQFBCiECDAELIAFBAWohAUEIIQIMAAsAC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwXC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwWC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwVC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwUC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwTC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwSC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwRC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwQC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwPC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwOC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwNC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwMC0EAIQIgA0EANgIcIAMgATYCFCADQZkTNgIQIANBCzYCDAwLC0EAIQIgA0EANgIcIAMgATYCFCADQZ0JNgIQIANBCzYCDAwKC0EAIQIgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDAwJC0EAIQIgA0EANgIcIAMgATYCFCADQbEQNgIQIANBCjYCDAwIC0EAIQIgA0EANgIcIAMgATYCFCADQbsdNgIQIANBAjYCDAwHC0EAIQIgA0EANgIcIAMgATYCFCADQZYWNgIQIANBAjYCDAwGC0EAIQIgA0EANgIcIAMgATYCFCADQfkYNgIQIANBAjYCDAwFC0EAIQIgA0EANgIcIAMgATYCFCADQcQYNgIQIANBAjYCDAwECyADQQI2AhwgAyABNgIUIANBqR42AhAgA0EWNgIMQQAhAgwDC0HeACECIAEgBEYNAiAJQQhqIQcgAygCACEFAkACQCABIARHBEAgBUGWyABqIQggBCAFaiABayEGIAVBf3NBCmoiBSABaiEAA0AgAS0AACAILQAARwRAQQIhCAwDCyAFRQRAQQAhCCAAIQEMAwsgBUEBayEFIAhBAWohCCAEIAFBAWoiAUcNAAsgBiEFIAQhAQsgB0EBNgIAIAMgBTYCAAwBCyADQQA2AgAgByAINgIACyAHIAE2AgQgCSgCDCEAAkACQCAJKAIIQQFrDgIEAQALIANBADYCHCADQcIeNgIQIANBFzYCDCADIABBAWo2AhRBACECDAMLIANBADYCHCADIAA2AhQgA0HXHjYCECADQQk2AgxBACECDAILIAEgBEYEQEEoIQIMAgsgA0EJNgIIIAMgATYCBEEnIQIMAQsgASAERgRAQQEhAgwBCwNAAkACQAJAIAEtAABBCmsOBAABAQABCyABQQFqIQEMAQsgAUEBaiEBIAMtAC5BIHENAEEAIQIgA0EANgIcIAMgATYCFCADQaEhNgIQIANBBTYCDAwCC0EBIQIgASAERw0ACwsgCUEQaiQAIAJFBEAgAygCDCEADAELIAMgAjYCHEEAIQAgAygCBCIBRQ0AIAMgASAEIAMoAggRAQAiAUUNACADIAQ2AhQgAyABNgIMIAEhAAsgAAu+AgECfyAAQQA6AAAgAEHkAGoiAUEBa0EAOgAAIABBADoAAiAAQQA6AAEgAUEDa0EAOgAAIAFBAmtBADoAACAAQQA6AAMgAUEEa0EAOgAAQQAgAGtBA3EiASAAaiIAQQA2AgBB5AAgAWtBfHEiAiAAaiIBQQRrQQA2AgACQCACQQlJDQAgAEEANgIIIABBADYCBCABQQhrQQA2AgAgAUEMa0EANgIAIAJBGUkNACAAQQA2AhggAEEANgIUIABBADYCECAAQQA2AgwgAUEQa0EANgIAIAFBFGtBADYCACABQRhrQQA2AgAgAUEca0EANgIAIAIgAEEEcUEYciICayIBQSBJDQAgACACaiEAA0AgAEIANwMYIABCADcDECAAQgA3AwggAEIANwMAIABBIGohACABQSBrIgFBH0sNAAsLC1YBAX8CQCAAKAIMDQACQAJAAkACQCAALQAxDgMBAAMCCyAAKAI4IgFFDQAgASgCMCIBRQ0AIAAgAREAACIBDQMLQQAPCwALIABByhk2AhBBDiEBCyABCxoAIAAoAgxFBEAgAEHeHzYCECAAQRU2AgwLCxQAIAAoAgxBFUYEQCAAQQA2AgwLCxQAIAAoAgxBFkYEQCAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsrAAJAIABBJ08NAEL//////wkgAK2IQgGDUA0AIABBAnRB0DhqKAIADwsACxcAIABBL08EQAALIABBAnRB7DlqKAIAC78JAQF/QfQtIQECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQeQAaw70A2NiAAFhYWFhYWECAwQFYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQYHCAkKCwwNDg9hYWFhYRBhYWFhYWFhYWFhYRFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWESExQVFhcYGRobYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1NmE3ODk6YWFhYWFhYWE7YWFhPGFhYWE9Pj9hYWFhYWFhYUBhYUFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFCQ0RFRkdISUpLTE1OT1BRUlNhYWFhYWFhYVRVVldYWVpbYVxdYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhXmFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYV9gYQtB6iwPC0GYJg8LQe0xDwtBoDcPC0HJKQ8LQbQpDwtBli0PC0HrKw8LQaI1DwtB2zQPC0HgKQ8LQeMkDwtB1SQPC0HuJA8LQeYlDwtByjQPC0HQNw8LQao1DwtB9SwPC0H2Jg8LQYIiDwtB8jMPC0G+KA8LQec3DwtBzSEPC0HAIQ8LQbglDwtByyUPC0GWJA8LQY80DwtBzTUPC0HdKg8LQe4zDwtBnDQPC0GeMQ8LQfQ1DwtB5SIPC0GvJQ8LQZkxDwtBsjYPC0H5Ng8LQcQyDwtB3SwPC0GCMQ8LQcExDwtBjTcPC0HJJA8LQew2DwtB5yoPC0HIIw8LQeIhDwtByTcPC0GlIg8LQZQiDwtB2zYPC0HeNQ8LQYYmDwtBvCsPC0GLMg8LQaAjDwtB9jAPC0GALA8LQYkrDwtBpCYPC0HyIw8LQYEoDwtBqzIPC0HrJw8LQcI2DwtBoiQPC0HPKg8LQdwjDwtBhycPC0HkNA8LQbciDwtBrTEPC0HVIg8LQa80DwtB3iYPC0HWMg8LQfQ0DwtBgTgPC0H0Nw8LQZI2DwtBnScPC0GCKQ8LQY0jDwtB1zEPC0G9NQ8LQbQ3DwtB2DAPC0G2Jw8LQZo4DwtBpyoPC0HEJw8LQa4jDwtB9SIPCwALQcomIQELIAELFwAgACAALwEuQf7/A3EgAUEAR3I7AS4LGgAgACAALwEuQf3/A3EgAUEAR0EBdHI7AS4LGgAgACAALwEuQfv/A3EgAUEAR0ECdHI7AS4LGgAgACAALwEuQff/A3EgAUEAR0EDdHI7AS4LGgAgACAALwEuQe//A3EgAUEAR0EEdHI7AS4LGgAgACAALwEuQd//A3EgAUEAR0EFdHI7AS4LGgAgACAALwEuQb//A3EgAUEAR0EGdHI7AS4LGgAgACAALwEuQf/+A3EgAUEAR0EHdHI7AS4LGgAgACAALwEuQf/9A3EgAUEAR0EIdHI7AS4LGgAgACAALwEuQf/7A3EgAUEAR0EJdHI7AS4LPgECfwJAIAAoAjgiA0UNACADKAIEIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHhEjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIIIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH8ETYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIMIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHsCjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIQIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH6HjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIUIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHLEDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIYIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG3HzYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIcIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG/FTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIsIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH+CDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIgIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEGMHTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIkIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHmFTYCEEEYIQQLIAQLOAAgAAJ/IAAvATJBFHFBFEYEQEEBIAAtAChBAUYNARogAC8BNEHlAEYMAQsgAC0AKUEFRgs6ADALWQECfwJAIAAtAChBAUYNACAALwE0IgFB5ABrQeQASQ0AIAFBzAFGDQAgAUGwAkYNACAALwEyIgBBwABxDQBBASECIABBiARxQYAERg0AIABBKHFFIQILIAILjAEBAn8CQAJAAkAgAC0AKkUNACAALQArRQ0AIAAvATIiAUECcUUNAQwCCyAALwEyIgFBAXFFDQELQQEhAiAALQAoQQFGDQAgAC8BNCIAQeQAa0HkAEkNACAAQcwBRg0AIABBsAJGDQAgAUHAAHENAEEAIQIgAUGIBHFBgARGDQAgAUEocUEARyECCyACC1cAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",Ucr;Object.defineProperty(dHn,"exports",{get:a(()=>Ucr||(Ucr=yNs.from(_Ns,"base64")),"get")})});var pHn=I((ryf,fHn)=>{"use strict";p();var{Buffer:ENs}=require("node:buffer"),vNs="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCuzaAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKAIcIgJBAmsO/AEB+QECAwQFBgcICQoLDA0ODxAREvgBE/cBFBX2ARYX9QEYGRobHB0eHyD9AfsBIfQBIiMkJSYnKCkqK/MBLC0uLzAxMvIB8QEzNPAB7wE1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk/6AVBRUlPuAe0BVOwBVesBVldYWVrqAVtcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAekB6AHPAecB0AHmAdEB0gHTAdQB5QHVAdYB1wHYAdkB2gHbAdwB3QHeAd8B4AHhAeIB4wEA/AELQQAM4wELQQ4M4gELQQ0M4QELQQ8M4AELQRAM3wELQRMM3gELQRQM3QELQRUM3AELQRYM2wELQRcM2gELQRgM2QELQRkM2AELQRoM1wELQRsM1gELQRwM1QELQR0M1AELQR4M0wELQR8M0gELQSAM0QELQSEM0AELQQgMzwELQSIMzgELQSQMzQELQSMMzAELQQcMywELQSUMygELQSYMyQELQScMyAELQSgMxwELQRIMxgELQREMxQELQSkMxAELQSoMwwELQSsMwgELQSwMwQELQd4BDMABC0EuDL8BC0EvDL4BC0EwDL0BC0ExDLwBC0EyDLsBC0EzDLoBC0E0DLkBC0HfAQy4AQtBNQy3AQtBOQy2AQtBDAy1AQtBNgy0AQtBNwyzAQtBOAyyAQtBPgyxAQtBOgywAQtB4AEMrwELQQsMrgELQT8MrQELQTsMrAELQQoMqwELQTwMqgELQT0MqQELQeEBDKgBC0HBAAynAQtBwAAMpgELQcIADKUBC0EJDKQBC0EtDKMBC0HDAAyiAQtBxAAMoQELQcUADKABC0HGAAyfAQtBxwAMngELQcgADJ0BC0HJAAycAQtBygAMmwELQcsADJoBC0HMAAyZAQtBzQAMmAELQc4ADJcBC0HPAAyWAQtB0AAMlQELQdEADJQBC0HSAAyTAQtB0wAMkgELQdUADJEBC0HUAAyQAQtB1gAMjwELQdcADI4BC0HYAAyNAQtB2QAMjAELQdoADIsBC0HbAAyKAQtB3AAMiQELQd0ADIgBC0HeAAyHAQtB3wAMhgELQeAADIUBC0HhAAyEAQtB4gAMgwELQeMADIIBC0HkAAyBAQtB5QAMgAELQeIBDH8LQeYADH4LQecADH0LQQYMfAtB6AAMewtBBQx6C0HpAAx5C0EEDHgLQeoADHcLQesADHYLQewADHULQe0ADHQLQQMMcwtB7gAMcgtB7wAMcQtB8AAMcAtB8gAMbwtB8QAMbgtB8wAMbQtB9AAMbAtB9QAMawtB9gAMagtBAgxpC0H3AAxoC0H4AAxnC0H5AAxmC0H6AAxlC0H7AAxkC0H8AAxjC0H9AAxiC0H+AAxhC0H/AAxgC0GAAQxfC0GBAQxeC0GCAQxdC0GDAQxcC0GEAQxbC0GFAQxaC0GGAQxZC0GHAQxYC0GIAQxXC0GJAQxWC0GKAQxVC0GLAQxUC0GMAQxTC0GNAQxSC0GOAQxRC0GPAQxQC0GQAQxPC0GRAQxOC0GSAQxNC0GTAQxMC0GUAQxLC0GVAQxKC0GWAQxJC0GXAQxIC0GYAQxHC0GZAQxGC0GaAQxFC0GbAQxEC0GcAQxDC0GdAQxCC0GeAQxBC0GfAQxAC0GgAQw/C0GhAQw+C0GiAQw9C0GjAQw8C0GkAQw7C0GlAQw6C0GmAQw5C0GnAQw4C0GoAQw3C0GpAQw2C0GqAQw1C0GrAQw0C0GsAQwzC0GtAQwyC0GuAQwxC0GvAQwwC0GwAQwvC0GxAQwuC0GyAQwtC0GzAQwsC0G0AQwrC0G1AQwqC0G2AQwpC0G3AQwoC0G4AQwnC0G5AQwmC0G6AQwlC0G7AQwkC0G8AQwjC0G9AQwiC0G+AQwhC0G/AQwgC0HAAQwfC0HBAQweC0HCAQwdC0EBDBwLQcMBDBsLQcQBDBoLQcUBDBkLQcYBDBgLQccBDBcLQcgBDBYLQckBDBULQcoBDBQLQcsBDBMLQcwBDBILQc0BDBELQc4BDBALQc8BDA8LQdABDA4LQdEBDA0LQdIBDAwLQdMBDAsLQdQBDAoLQdUBDAkLQdYBDAgLQeMBDAcLQdcBDAYLQdgBDAULQdkBDAQLQdoBDAMLQdsBDAILQd0BDAELQdwBCyECA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCACDuMBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISMkJScoKZ4DmwOaA5EDigODA4AD/QL7AvgC8gLxAu8C7QLoAucC5gLlAuQC3ALbAtoC2QLYAtcC1gLVAs8CzgLMAssCygLJAsgCxwLGAsQCwwK+ArwCugK5ArgCtwK2ArUCtAKzArICsQKwAq4CrQKpAqgCpwKmAqUCpAKjAqICoQKgAp8CmAKQAowCiwKKAoEC/gH9AfwB+wH6AfkB+AH3AfUB8wHwAesB6QHoAecB5gHlAeQB4wHiAeEB4AHfAd4B3QHcAdoB2QHYAdcB1gHVAdQB0wHSAdEB0AHPAc4BzQHMAcsBygHJAcgBxwHGAcUBxAHDAcIBwQHAAb8BvgG9AbwBuwG6AbkBuAG3AbYBtQG0AbMBsgGxAbABrwGuAa0BrAGrAaoBqQGoAacBpgGlAaQBowGiAZ8BngGZAZgBlwGWAZUBlAGTAZIBkQGQAY8BjQGMAYcBhgGFAYQBgwGCAX18e3p5dnV0UFFSU1RVCyABIARHDXJB/QEhAgy+AwsgASAERw2YAUHbASECDL0DCyABIARHDfEBQY4BIQIMvAMLIAEgBEcN/AFBhAEhAgy7AwsgASAERw2KAkH/ACECDLoDCyABIARHDZECQf0AIQIMuQMLIAEgBEcNlAJB+wAhAgy4AwsgASAERw0eQR4hAgy3AwsgASAERw0ZQRghAgy2AwsgASAERw3KAkHNACECDLUDCyABIARHDdUCQcYAIQIMtAMLIAEgBEcN1gJBwwAhAgyzAwsgASAERw3cAkE4IQIMsgMLIAMtADBBAUYNrQMMiQMLQQAhAAJAAkACQCADLQAqRQ0AIAMtACtFDQAgAy8BMiICQQJxRQ0BDAILIAMvATIiAkEBcUUNAQtBASEAIAMtAChBAUYNACADLwE0IgZB5ABrQeQASQ0AIAZBzAFGDQAgBkGwAkYNACACQcAAcQ0AQQAhACACQYgEcUGABEYNACACQShxQQBHIQALIANBADsBMiADQQA6ADECQCAARQRAIANBADoAMSADLQAuQQRxDQEMsQMLIANCADcDIAsgA0EAOgAxIANBAToANgxIC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAARQ1IIABBFUcNYiADQQQ2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgyvAwsgASAERgRAQQYhAgyvAwsgAS0AAEEKRw0ZIAFBAWohAQwaCyADQgA3AyBBEiECDJQDCyABIARHDYoDQSMhAgysAwsgASAERgRAQQchAgysAwsCQAJAIAEtAABBCmsOBAEYGAAYCyABQQFqIQFBECECDJMDCyABQQFqIQEgA0Evai0AAEEBcQ0XQQAhAiADQQA2AhwgAyABNgIUIANBmSA2AhAgA0EZNgIMDKsDCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMWg0YQQghAgyqAwsgASAERwRAIANBCTYCCCADIAE2AgRBFCECDJEDC0EJIQIMqQMLIAMpAyBQDa4CDEMLIAEgBEYEQEELIQIMqAMLIAEtAABBCkcNFiABQQFqIQEMFwsgA0Evai0AAEEBcUUNGQwmC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRkMQgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0aDCQLQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGwwyCyADQS9qLQAAQQFxRQ0cDCILQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANHAxCC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADR0MIAsgASAERgRAQRMhAgygAwsCQCABLQAAIgBBCmsOBB8jIwAiCyABQQFqIQEMHwtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0iDEILIAEgBEYEQEEWIQIMngMLIAEtAABBwMEAai0AAEEBRw0jDIMDCwJAA0AgAS0AAEGwO2otAAAiAEEBRwRAAkAgAEECaw4CAwAnCyABQQFqIQFBISECDIYDCyAEIAFBAWoiAUcNAAtBGCECDJ0DCyADKAIEIQBBACECIANBADYCBCADIAAgAUEBaiIBEDQiAA0hDEELQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIwwqCyABIARGBEBBHCECDJsDCyADQQo2AgggAyABNgIEQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANJUEkIQIMgQMLIAEgBEcEQANAIAEtAABBsD1qLQAAIgBBA0cEQCAAQQFrDgUYGiaCAyUmCyAEIAFBAWoiAUcNAAtBGyECDJoDC0EbIQIMmQMLA0AgAS0AAEGwP2otAAAiAEEDRwRAIABBAWsOBQ8RJxMmJwsgBCABQQFqIgFHDQALQR4hAgyYAwsgASAERwRAIANBCzYCCCADIAE2AgRBByECDP8CC0EfIQIMlwMLIAEgBEYEQEEgIQIMlwMLAkAgAS0AAEENaw4ULj8/Pz8/Pz8/Pz8/Pz8/Pz8/PwA/C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAyWAwsgA0EvaiECA0AgASAERgRAQSEhAgyXAwsCQAJAAkAgAS0AACIAQQlrDhgCACkpASkpKSkpKSkpKSkpKSkpKSkpKQInCyABQQFqIQEgA0Evai0AAEEBcUUNCgwYCyABQQFqIQEMFwsgAUEBaiEBIAItAABBAnENAAtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwMlQMLIAMtAC5BgAFxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ3mAiAAQRVGBEAgA0EkNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMlAMLQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDJMDC0EAIQIgA0EANgIcIAMgATYCFCADQb4gNgIQIANBAjYCDAySAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEgDKdqIgEQMiIARQ0rIANBBzYCHCADIAE2AhQgAyAANgIMDJEDCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlgiAkUNACADIAIRAAAhAAsgAEUNKyAAQRVGBEAgA0EKNgIcIAMgATYCFCADQesZNgIQIANBFTYCDEEAIQIMkAMLQQAhAiADQQA2AhwgAyABNgIUIANBkww2AhAgA0ETNgIMDI8DC0EAIQIgA0EANgIcIAMgATYCFCADQYIVNgIQIANBAjYCDAyOAwtBACECIANBADYCHCADIAE2AhQgA0HdFDYCECADQRk2AgwMjQMLQQAhAiADQQA2AhwgAyABNgIUIANB5h02AhAgA0EZNgIMDIwDCyAAQRVGDT1BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMiwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUNKCADQQ02AhwgAyABNgIUIAMgADYCDAyKAwsgAEEVRg06QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIkDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCgLIANBDjYCHCADIAA2AgwgAyABQQFqNgIUDIgDCyAAQRVGDTdBACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMhwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUEQCABQQFqIQEMJwsgA0EPNgIcIAMgADYCDCADIAFBAWo2AhQMhgMLQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDIUDCyAAQRVGDTNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwMhAMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUNJSADQRE2AhwgAyABNgIUIAMgADYCDAyDAwsgAEEVRg0wQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIIDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDCULIANBEjYCHCADIAA2AgwgAyABQQFqNgIUDIEDCyADQS9qLQAAQQFxRQ0BC0EXIQIM5gILQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDP4CCyAAQTtHDQAgAUEBaiEBDAwLQQAhAiADQQA2AhwgAyABNgIUIANBkhg2AhAgA0ECNgIMDPwCCyAAQRVGDShBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM+wILIANBFDYCHCADIAE2AhQgAyAANgIMDPoCCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDPUCCyADQRU2AhwgAyAANgIMIAMgAUEBajYCFAz5AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzzAgsgA0EXNgIcIAMgADYCDCADIAFBAWo2AhQM+AILIABBFUYNI0EAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAz3AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwdCyADQRk2AhwgAyAANgIMIAMgAUEBajYCFAz2AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzvAgsgA0EaNgIcIAMgADYCDCADIAFBAWo2AhQM9QILIABBFUYNH0EAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAz0AgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDBsLIANBHDYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIANBIDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNMCCyADQRM2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzSAgsgA0ELNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0QILIANBEDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNACCyADQSA2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzPAgsgA0ELNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzgILIANBDDYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM0CC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAzMAgsCQANAAkAgAS0AAEEKaw4EAAICAAILIAQgAUEBaiIBRw0AC0H9ASECDMwCCwJAAkAgAy0ANkEBRw0AQQAhAAJAIAMoAjgiAkUNACACKAJgIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB/AE2AhwgAyABNgIUIANB3Bk2AhAgA0EVNgIMQQAhAgzNAgtB3AEhAgyzAgsgA0EANgIcIAMgATYCFCADQfkLNgIQIANBHzYCDEEAIQIMywILAkACQCADLQAoQQFrDgIEAQALQdsBIQIMsgILQdQBIQIMsQILIANBAjoAMUEAIQACQCADKAI4IgJFDQAgAigCACICRQ0AIAMgAhEAACEACyAARQRAQd0BIQIMsQILIABBFUcEQCADQQA2AhwgAyABNgIUIANBtAw2AhAgA0EQNgIMQQAhAgzKAgsgA0H7ATYCHCADIAE2AhQgA0GBGjYCECADQRU2AgxBACECDMkCCyABIARGBEBB+gEhAgzJAgsgAS0AAEHIAEYNASADQQE6ACgLQcABIQIMrgILQdoBIQIMrQILIAEgBEcEQCADQQw2AgggAyABNgIEQdkBIQIMrQILQfkBIQIMxQILIAEgBEYEQEH4ASECDMUCCyABLQAAQcgARw0EIAFBAWohAUHYASECDKsCCyABIARGBEBB9wEhAgzEAgsCQAJAIAEtAABBxQBrDhAABQUFBQUFBQUFBQUFBQUBBQsgAUEBaiEBQdYBIQIMqwILIAFBAWohAUHXASECDKoCC0H2ASECIAEgBEYNwgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABButUAai0AAEcNAyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMwwILIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBgA02AhAgA0EbNgIMQQAhAgyeAgsgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMnQILIAEgBEcEQCADQQw2AgggAyABNgIEQb8BIQIMhAILQdgBIQIMnAILIAEgBEYEQEHXASECDJwCCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEHBAGsOFQABAgNaBAUGWlpaBwgJCgsMDQ4PEFoLIAFBAWohAUH7ACECDJICCyABQQFqIQFB/AAhAgyRAgsgAUEBaiEBQYEBIQIMkAILIAFBAWohAUGFASECDI8CCyABQQFqIQFBhgEhAgyOAgsgAUEBaiEBQYkBIQIMjQILIAFBAWohAUGKASECDIwCCyABQQFqIQFBjQEhAgyLAgsgAUEBaiEBQZYBIQIMigILIAFBAWohAUGXASECDIkCCyABQQFqIQFBmAEhAgyIAgsgAUEBaiEBQaUBIQIMhwILIAFBAWohAUGmASECDIYCCyABQQFqIQFBrAEhAgyFAgsgAUEBaiEBQbQBIQIMhAILIAFBAWohAUG3ASECDIMCCyABQQFqIQFBvgEhAgyCAgsgASAERgRAQdYBIQIMmwILIAEtAABBzgBHDUggAUEBaiEBQb0BIQIMgQILIAEgBEYEQEHVASECDJoCCwJAAkACQCABLQAAQcIAaw4SAEpKSkpKSkpKSgFKSkpKSkoCSgsgAUEBaiEBQbgBIQIMggILIAFBAWohAUG7ASECDIECCyABQQFqIQFBvAEhAgyAAgtB1AEhAiABIARGDZgCIAMoAgAiACAEIAFraiEFIAEgAGtBB2ohBgJAA0AgAS0AACAAQajVAGotAABHDUUgAEEHRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJkCCyADQQA2AgAgBkEBaiEBQRsMRQsgASAERgRAQdMBIQIMmAILAkACQCABLQAAQckAaw4HAEdHR0dHAUcLIAFBAWohAUG5ASECDP8BCyABQQFqIQFBugEhAgz+AQtB0gEhAiABIARGDZYCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQabVAGotAABHDUMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJcCCyADQQA2AgAgBkEBaiEBQQ8MQwtB0QEhAiABIARGDZUCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQaTVAGotAABHDUIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYCCyADQQA2AgAgBkEBaiEBQSAMQgtB0AEhAiABIARGDZQCIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDUEgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJUCCyADQQA2AgAgBkEBaiEBQRIMQQsgASAERgRAQc8BIQIMlAILAkACQCABLQAAQcUAaw4OAENDQ0NDQ0NDQ0NDQwFDCyABQQFqIQFBtQEhAgz7AQsgAUEBaiEBQbYBIQIM+gELQc4BIQIgASAERg2SAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGe1QBqLQAARw0/IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyTAgsgA0EANgIAIAZBAWohAUEHDD8LQc0BIQIgASAERg2RAiADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGY1QBqLQAARw0+IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAySAgsgA0EANgIAIAZBAWohAUEoDD4LIAEgBEYEQEHMASECDJECCwJAAkACQCABLQAAQcUAaw4RAEFBQUFBQUFBQQFBQUFBQQJBCyABQQFqIQFBsQEhAgz5AQsgAUEBaiEBQbIBIQIM+AELIAFBAWohAUGzASECDPcBC0HLASECIAEgBEYNjwIgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBkdUAai0AAEcNPCAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkAILIANBADYCACAGQQFqIQFBGgw8C0HKASECIAEgBEYNjgIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBjdUAai0AAEcNOyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjwILIANBADYCACAGQQFqIQFBIQw7CyABIARGBEBByQEhAgyOAgsCQAJAIAEtAABBwQBrDhQAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEH51ABqLQAARw0yIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyGAgsgA0EANgIAIAZBAWohAUErDDILQcABIQIgASAERg2EAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH21ABqLQAARw0xIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyFAgsgA0EANgIAIAZBAWohAUEsDDELQb8BIQIgASAERg2DAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0wIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyEAgsgA0EANgIAIAZBAWohAUERDDALQb4BIQIgASAERg2CAiADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEHy1ABqLQAARw0vIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyDAgsgA0EANgIAIAZBAWohAUEuDC8LIAEgBEYEQEG9ASECDIICCwJAAkACQAJAAkAgAS0AAEHBAGsOFQA0NDQ0NDQ0NDQ0ATQ0AjQ0AzQ0BDQLIAFBAWohAUGbASECDOwBCyABQQFqIQFBnAEhAgzrAQsgAUEBaiEBQZ0BIQIM6gELIAFBAWohAUGiASECDOkBCyABQQFqIQFBpAEhAgzoAQsgASAERgRAQbwBIQIMgQILAkACQCABLQAAQdIAaw4DADABMAsgAUEBaiEBQaMBIQIM6AELIAFBAWohAUEEDC0LQbsBIQIgASAERg3/ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHw1ABqLQAARw0sIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyAAgsgA0EANgIAIAZBAWohAUEdDCwLIAEgBEYEQEG6ASECDP8BCwJAAkAgAS0AAEHJAGsOBwEuLi4uLgAuCyABQQFqIQFBoQEhAgzmAQsgAUEBaiEBQSIMKwsgASAERgRAQbkBIQIM/gELIAEtAABB0ABHDSsgAUEBaiEBQaABIQIM5AELIAEgBEYEQEG4ASECDP0BCwJAAkAgAS0AAEHGAGsOCwAsLCwsLCwsLCwBLAsgAUEBaiEBQZ4BIQIM5AELIAFBAWohAUGfASECDOMBC0G3ASECIAEgBEYN+wEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB7NQAai0AAEcNKCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM/AELIANBADYCACAGQQFqIQFBDQwoC0G2ASECIAEgBEYN+gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNJyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+wELIANBADYCACAGQQFqIQFBDAwnC0G1ASECIAEgBEYN+QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6tQAai0AAEcNJiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+gELIANBADYCACAGQQFqIQFBAwwmC0G0ASECIAEgBEYN+AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6NQAai0AAEcNJSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+QELIANBADYCACAGQQFqIQFBJgwlCyABIARGBEBBswEhAgz4AQsCQAJAIAEtAABB1ABrDgIAAScLIAFBAWohAUGZASECDN8BCyABQQFqIQFBmgEhAgzeAQtBsgEhAiABIARGDfYBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQebUAGotAABHDSMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPcBCyADQQA2AgAgBkEBaiEBQScMIwtBsQEhAiABIARGDfUBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQeTUAGotAABHDSIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPYBCyADQQA2AgAgBkEBaiEBQRwMIgtBsAEhAiABIARGDfQBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQd7UAGotAABHDSEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPUBCyADQQA2AgAgBkEBaiEBQQYMIQtBrwEhAiABIARGDfMBIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQdnUAGotAABHDSAgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPQBCyADQQA2AgAgBkEBaiEBQRkMIAsgASAERgRAQa4BIQIM8wELAkACQAJAAkAgAS0AAEEtaw4jACQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkASQkJCQkAiQkJAMkCyABQQFqIQFBjgEhAgzcAQsgAUEBaiEBQY8BIQIM2wELIAFBAWohAUGUASECDNoBCyABQQFqIQFBlQEhAgzZAQtBrQEhAiABIARGDfEBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQdfUAGotAABHDR4gAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPIBCyADQQA2AgAgBkEBaiEBQQsMHgsgASAERgRAQawBIQIM8QELAkACQCABLQAAQcEAaw4DACABIAsgAUEBaiEBQZABIQIM2AELIAFBAWohAUGTASECDNcBCyABIARGBEBBqwEhAgzwAQsCQAJAIAEtAABBwQBrDg8AHx8fHx8fHx8fHx8fHwEfCyABQQFqIQFBkQEhAgzXAQsgAUEBaiEBQZIBIQIM1gELIAEgBEYEQEGqASECDO8BCyABLQAAQcwARw0cIAFBAWohAUEKDBsLQakBIQIgASAERg3tASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHR1ABqLQAARw0aIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzuAQsgA0EANgIAIAZBAWohAUEeDBoLQagBIQIgASAERg3sASADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMDAwMDAEMCyABQQFqIQFB/QAhAgzEAQsgAUEBaiEBQYABIQIMwwELIAEgBEYEQEGYASECDNwBCwJAAkAgAS0AAEHOAGsOAwALAQsLIAFBAWohAUH+ACECDMMBCyABQQFqIQFB/wAhAgzCAQsgASAERgRAQZcBIQIM2wELIAEtAABB2QBHDQggAUEBaiEBQQgMBwtBlgEhAiABIARGDdkBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQazUAGotAABHDQYgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNoBCyADQQA2AgAgBkEBaiEBQQUMBgtBlQEhAiABIARGDdgBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3AAhAgx5C0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMkwELQdsAIQIMeQsgA0HsADYCHCADIAE2AhQgA0GAGzYCECADQRU2AgxBACECDJEBCyADLQApIgBBI0kNACAAQS5GDQAgA0EANgIcIAMgATYCFCADQckJNgIQIANBCDYCDEEAIQIMkAELQdoAIQIMdgsgASAERgRAQesAIQIMjwELAkAgAS0AAEEvRgRAIAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMQQAhAgyPAQtB2QAhAgx1CyABIARHBEAgA0EONgIIIAMgATYCBEHYACECDHULQeoAIQIMjQELIAEgBEYEQEHpACECDI0BCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHXACECDHQLIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ16IANB6AA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAEgBEYEQEHnACECDIwBCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDXsgA0HmADYCHCADIAE2AhQgAyAANgIMQQAhAgyMAQtB1gAhAgxyCyABIARGBEBB5QAhAgyLAQtBACEAQQEhBUEBIQdBACECAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkAgAS0AAEEwaw4KCgkAAQIDBAUGCAsLQQIMBgtBAwwFC0EEDAQLQQUMAwtBBgwCC0EHDAELQQgLIQJBACEFQQAhBwwCC0EJIQJBASEAQQAhBUEAIQcMAQtBACEFQQEhAgsgAyACOgArIAFBAWohAQJAAkAgAy0ALkEQcQ0AAkACQAJAIAMtACoOAwEAAgQLIAdFDQMMAgsgAA0BDAILIAVFDQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ0CIANB4gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ19IANB4wA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5AA2AhwgAyABNgIUIAMgADYCDAyLAQtB1AAhAgxxCyADLQApQSJGDYYBQdMAIQIMcAtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsgAEUEQEHVACECDHALIABBFUcEQCADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgyJAQsgA0HhADYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDIgBCyABIARGBEBB4AAhAgyIAQsCQAJAAkACQAJAIAEtAABBCmsOBAEEBAAECyABQQFqIQEMAQsgAUEBaiEBIANBL2otAABBAXFFDQELQdIAIQIMcAsgA0EANgIcIAMgATYCFCADQbYRNgIQIANBCTYCDEEAIQIMiAELIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIcBCyABIARGBEBB3wAhAgyHAQsgAS0AAEEKRgRAIAFBAWohAQwJCyADLQAuQcAAcQ0IIANBADYCHCADIAE2AhQgA0G2ETYCECADQQI2AgxBACECDIYBCyABIARGBEBB3QAhAgyGAQsgAS0AACICQQ1GBEAgAUEBaiEBQdAAIQIMbQsgASEAIAJBCWsOBAUBAQUBCyAEIAEiAEYEQEHcACECDIUBCyAALQAAQQpHDQAgAEEBagwCC0EAIQIgA0EANgIcIAMgADYCFCADQcotNgIQIANBBzYCDAyDAQsgASAERgRAQdsAIQIMgwELAkAgAS0AAEEJaw4EAwAAAwALIAFBAWoLIQFBzgAhAgxoCyABIARGBEBB2gAhAgyBAQsgAS0AAEEJaw4EAAEBAAELQQAhAiADQQA2AhwgA0GaEjYCECADQQc2AgwgAyABQQFqNgIUDH8LIANBgBI7ASpBACEAAkAgAygCOCICRQ0AIAIoAjgiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HZADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDH4LQc0AIQIMZAsgA0EANgIcIAMgATYCFCADQckNNgIQIANBGjYCDEEAIQIMfAsgASAERgRAQdkAIQIMfAsgAS0AAEEgRw09IAFBAWohASADLQAuQQFxDT0gA0EANgIcIAMgATYCFCADQcIcNgIQIANBHjYCDEEAIQIMewsgASAERgRAQdgAIQIMewsCQAJAAkACQAJAIAEtAAAiAEEKaw4EAgMDAAELIAFBAWohAUEsIQIMZQsgAEE6Rw0BIANBADYCHCADIAE2AhQgA0HnETYCECADQQo2AgxBACECDH0LIAFBAWohASADQS9qLQAAQQFxRQ1zIAMtADJBgAFxRQRAIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsCQAJAIAAOFk1MSwEBAQEBAQEBAQEBAQEBAQEBAQABCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgx+CyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgx9C0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ1ZIABBFUcNASADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgx8C0HLACECDGILQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDHoLIAMgAy8BMkGAAXI7ATIMOwsgASAERwRAIANBETYCCCADIAE2AgRBygAhAgxgC0HXACECDHgLIAEgBEYEQEHWACECDHgLAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAQEBAQEBAQEBAQEBAAUBAQAIDQAsgAUEBaiEBQcYAIQIMYQsgAUEBaiEBQccAIQIMYAsgAUEBaiEBQcgAIQIMXwsgAUEBaiEBQckAIQIMXgtB1QAhAiAEIAEiAEYNdiAEIAFrIAMoAgAiAWohBiAAIAFrQQVqIQcDQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQhBBCABQQVGDQoaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHYLQdQAIQIgBCABIgBGDXUgBCABayADKAIAIgFqIQYgACABa0EPaiEHA0AgAUGAyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0HQQMgAUEPRg0JGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx1C0HTACECIAQgASIARg10IAQgAWsgAygCACIBaiEGIAAgAWtBDmohBwNAIAFB4scAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNBiABQQ5GDQcgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdAtB0gAhAiAEIAEiAEYNcyAEIAFrIAMoAgAiAWohBSAAIAFrQQFqIQYDQCABQeDHAGotAAAgAC0AACIHQSByIAcgB0HBAGtB/wFxQRpJG0H/AXFHDQUgAUEBRg0CIAFBAWohASAEIABBAWoiAEcNAAsgAyAFNgIADHMLIAEgBEYEQEHRACECDHMLAkACQCABLQAAIgBBIHIgACAAQcEAa0H/AXFBGkkbQf8BcUHuAGsOBwA5OTk5OQE5CyABQQFqIQFBwwAhAgxaCyABQQFqIQFBxAAhAgxZCyADQQA2AgAgBkEBaiEBQcUAIQIMWAtB0AAhAiAEIAEiAEYNcCAEIAFrIAMoAgAiAWohBiAAIAFrQQlqIQcDQCABQdbHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQJBAiABQQlGDQQaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHALQc8AIQIgBCABIgBGDW8gBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUHQxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxvCyAAIQEgA0EANgIADDMLQQELOgAsIANBADYCACAHQQFqIQELQS0hAgxSCwJAA0AgAS0AAEHQxQBqLQAAQQFHDQEgBCABQQFqIgFHDQALQc0AIQIMawtBwgAhAgxRCyABIARGBEBBzAAhAgxqCyABLQAAQTpGBEAgAygCBCEAIANBADYCBCADIAAgARAwIgBFDTMgA0HLADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxqCyADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgxpCwJAAkAgAy0ALEECaw4CAAEnCyADQTNqLQAAQQJxRQ0mIAMtAC5BAnENJiADQQA2AhwgAyABNgIUIANBphQ2AhAgA0ELNgIMQQAhAgxpCyADLQAyQSBxRQ0lIAMtAC5BAnENJSADQQA2AhwgAyABNgIUIANBvRM2AhAgA0EPNgIMQQAhAgxoC0EAIQACQCADKAI4IgJFDQAgAigCSCICRQ0AIAMgAhEAACEACyAARQRAQcEAIQIMTwsgAEEVRwRAIANBADYCHCADIAE2AhQgA0GmDzYCECADQRw2AgxBACECDGgLIANBygA2AhwgAyABNgIUIANBhRw2AhAgA0EVNgIMQQAhAgxnCyABIARHBEAgASECA0AgBCACIgFrQRBOBEAgAUEQaiEC/Qz/////////////////////IAH9AAAAIg1BB/1sIA39DODg4ODg4ODg4ODg4ODg4OD9bv0MX19fX19fX19fX19fX19fX/0mIA39DAkJCQkJCQkJCQkJCQkJCQn9I/1Q/VL9ZEF/c2giAEEQRg0BIAAgAWohAQwYCyABIARGBEBBxAAhAgxpCyABLQAAQcDBAGotAABBAUcNFyAEIAFBAWoiAkcNAAtBxAAhAgxnC0HEACECDGYLIAEgBEcEQANAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXEiAEEJRg0AIABBIEYNAAJAAkACQAJAIABB4wBrDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTYhAgxSCyABQQFqIQFBNyECDFELIAFBAWohAUE4IQIMUAsMFQsgBCABQQFqIgFHDQALQTwhAgxmC0E8IQIMZQsgASAERgRAQcgAIQIMZQsgA0ESNgIIIAMgATYCBAJAAkACQAJAAkAgAy0ALEEBaw4EFAABAgkLIAMtADJBIHENA0HgASECDE8LAkAgAy8BMiIAQQhxRQ0AIAMtAChBAUcNACADLQAuQQhxRQ0CCyADIABB9/sDcUGABHI7ATIMCwsgAyADLwEyQRByOwEyDAQLIANBADYCBCADIAEgARAxIgAEQCADQcEANgIcIAMgADYCDCADIAFBAWo2AhRBACECDGYLIAFBAWohAQxYCyADQQA2AhwgAyABNgIUIANB9BM2AhAgA0EENgIMQQAhAgxkC0HHACECIAEgBEYNYyADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIABBwMUAai0AACABLQAAQSByRw0BIABBBkYNSiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAxkCyADQQA2AgAMBQsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkcNAyABQQFqIQEMBQsgBCABQQFqIgFHDQALQcUAIQIMZAtBxQAhAgxjCwsgA0EAOgAsDAELQQshAgxHC0E/IQIMRgsCQAJAA0AgAS0AACIAQSBHBEACQCAAQQprDgQDBQUDAAsgAEEsRg0DDAQLIAQgAUEBaiIBRw0AC0HGACECDGALIANBCDoALAwOCyADLQAoQQFHDQIgAy0ALkEIcQ0CIAMoAgQhACADQQA2AgQgAyAAIAEQMSIABEAgA0HCADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxfCyABQQFqIQEMUAtBOyECDEQLAkADQCABLQAAIgBBIEcgAEEJR3ENASAEIAFBAWoiAUcNAAtBwwAhAgxdCwtBPCECDEILAkACQCABIARHBEADQCABLQAAIgBBIEcEQCAAQQprDgQDBAQDBAsgBCABQQFqIgFHDQALQT8hAgxdC0E/IQIMXAsgAyADLwEyQSByOwEyDAoLIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQ1OIANBPjYCHCADIAE2AhQgAyAANgIMQQAhAgxaCwJAIAEgBEcEQANAIAEtAABBwMMAai0AACIAQQFHBEAgAEECRg0DDAwLIAQgAUEBaiIBRw0AC0E3IQIMWwtBNyECDFoLIAFBAWohAQwEC0E7IQIgBCABIgBGDVggBCABayADKAIAIgFqIQYgACABa0EFaiEHAkADQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEFRgRAQQchAQw/CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxZCyADQQA2AgAgACEBDAULQTohAiAEIAEiAEYNVyAEIAFrIAMoAgAiAWohBiAAIAFrQQhqIQcCQANAIAFBtMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQhGBEBBBSEBDD4LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFgLIANBADYCACAAIQEMBAtBOSECIAQgASIARg1WIAQgAWsgAygCACIBaiEGIAAgAWtBA2ohBwJAA0AgAUGwwQBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBA0YEQEEGIQEMPQsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMVwsgA0EANgIAIAAhAQwDCwJAA0AgAS0AACIAQSBHBEAgAEEKaw4EBwQEBwILIAQgAUEBaiIBRw0AC0E4IQIMVgsgAEEsRw0BIAFBAWohAEEBIQECQAJAAkACQAJAIAMtACxBBWsOBAMBAgQACyAAIQEMBAtBAiEBDAELQQQhAQsgA0EBOgAsIAMgAy8BMiABcjsBMiAAIQEMAQsgAyADLwEyQQhyOwEyIAAhAQtBPiECDDsLIANBADoALAtBOSECDDkLIAEgBEYEQEE2IQIMUgsCQAJAAkACQAJAIAEtAABBCmsOBAACAgECCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNAiADQTM2AhwgAyABNgIUIAMgADYCDEEAIQIMVQsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDAYLIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxUCyADLQAuQQFxBEBB3wEhAgw7CyADKAIEIQAgA0EANgIEIAMgACABEDEiAA0BDEkLQTQhAgw5CyADQTU2AhwgAyABNgIUIAMgADYCDEEAIQIMUQtBNSECDDcLIANBL2otAABBAXENACADQQA2AhwgAyABNgIUIANB6xY2AhAgA0EZNgIMQQAhAgxPC0EzIQIMNQsgASAERgRAQTIhAgxOCwJAIAEtAABBCkYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZIXNgIQIANBAzYCDEEAIQIMTgtBMiECDDQLIAEgBEYEQEExIQIMTQsCQCABLQAAIgBBCUYNACAAQSBGDQBBASECAkAgAy0ALEEFaw4EBgQFAA0LIAMgAy8BMkEIcjsBMgwMCyADLQAuQQFxRQ0BIAMtACxBCEcNACADQQA6ACwLQT0hAgwyCyADQQA2AhwgAyABNgIUIANBwhY2AhAgA0EKNgIMQQAhAgxKC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyDAYLIAEgBEYEQEEwIQIMRwsgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQQFxDQAgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMRgtBMCECDCwLIAFBAWohAUExIQIMKwsgASAERgRAQS8hAgxECyABLQAAIgBBCUcgAEEgR3FFBEAgAUEBaiEBIAMtAC5BAXENASADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgxEC0EBIQICQAJAAkACQAJAAkAgAy0ALEECaw4HBQQEAwECAAQLIAMgAy8BMkEIcjsBMgwDC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyC0EvIQIMKwsgA0EANgIcIAMgATYCFCADQYQTNgIQIANBCzYCDEEAIQIMQwtB4QEhAgwpCyABIARGBEBBLiECDEILIANBADYCBCADQRI2AgggAyABIAEQMSIADQELQS4hAgwnCyADQS02AhwgAyABNgIUIAMgADYCDEEAIQIMPwtBACEAAkAgAygCOCICRQ0AIAIoAkwiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HYADYCHCADIAE2AhQgA0GzGzYCECADQRU2AgxBACECDD4LQcwAIQIMJAsgA0EANgIcIAMgATYCFCADQbMONgIQIANBHTYCDEEAIQIMPAsgASAERgRAQc4AIQIMPAsgAS0AACIAQSBGDQIgAEE6Rg0BCyADQQA6ACxBCSECDCELIAMoAgQhACADQQA2AgQgAyAAIAEQMCIADQEMAgsgAy0ALkEBcQRAQd4BIQIMIAsgAygCBCEAIANBADYCBCADIAAgARAwIgBFDQIgA0EqNgIcIAMgADYCDCADIAFBAWo2AhRBACECDDgLIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMNwsgAUEBaiEBQcAAIQIMHQsgAUEBaiEBDCwLIAEgBEYEQEErIQIMNQsCQCABLQAAQQpGBEAgAUEBaiEBDAELIAMtAC5BwABxRQ0GCyADLQAyQYABcQRAQQAhAAJAIAMoAjgiAkUNACACKAJcIgJFDQAgAyACEQAAIQALIABFDRIgAEEVRgRAIANBBTYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDDYLIANBADYCHCADIAE2AhQgA0GQDjYCECADQRQ2AgxBACECDDULIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsgAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIANBAToAMAsgAiACLwEAQcAAcjsBAAtBKyECDBgLIANBKTYCHCADIAE2AhQgA0GsGTYCECADQRU2AgxBACECDDALIANBADYCHCADIAE2AhQgA0HlCzYCECADQRE2AgxBACECDC8LIANBADYCHCADIAE2AhQgA0GlCzYCECADQQI2AgxBACECDC4LQQEhByADLwEyIgVBCHFFBEAgAykDIEIAUiEHCwJAIAMtADAEQEEBIQAgAy0AKUEFRg0BIAVBwABxRSAHcUUNAQsCQCADLQAoIgJBAkYEQEEBIQAgAy8BNCIGQeUARg0CQQAhACAFQcAAcQ0CIAZB5ABGDQIgBkHmAGtBAkkNAiAGQcwBRg0CIAZBsAJGDQIMAQtBACEAIAVBwABxDQELQQIhACAFQQhxDQAgBUGABHEEQAJAIAJBAUcNACADLQAuQQpxDQBBBSEADAILQQQhAAwBCyAFQSBxRQRAIAMQNkEAR0ECdCEADAELQQBBAyADKQMgUBshAAsgAEEBaw4FAgAHAQMEC0ERIQIMEwsgA0EBOgAxDCkLQQAhAgJAIAMoAjgiAEUNACAAKAIwIgBFDQAgAyAAEQAAIQILIAJFDSYgAkEVRgRAIANBAzYCHCADIAE2AhQgA0HSGzYCECADQRU2AgxBACECDCsLQQAhAiADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMDCoLIANBADYCHCADIAE2AhQgA0H5IDYCECADQQ82AgxBACECDCkLQQAhAAJAIAMoAjgiAkUNACACKAIwIgJFDQAgAyACEQAAIQALIAANAQtBDiECDA4LIABBFUYEQCADQQI2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwnCyADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMQQAhAgwmC0EqIQIMDAsgASAERwRAIANBCTYCCCADIAE2AgRBKSECDAwLQSYhAgwkCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMVARAQSUhAgwkCyADKAIEIQAgA0EANgIEIAMgACABIAynaiIBEDIiAEUNACADQQU2AhwgAyABNgIUIAMgADYCDEEAIQIMIwtBDyECDAkLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQTBrDjcXFgABAgMEBQYHFBQUFBQUFAgJCgsMDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUDg8QERITFAtCAiEKDBYLQgMhCgwVC0IEIQoMFAtCBSEKDBMLQgYhCgwSC0IHIQoMEQtCCCEKDBALQgkhCgwPC0IKIQoMDgtCCyEKDA0LQgwhCgwMC0INIQoMCwtCDiEKDAoLQg8hCgwJC0IKIQoMCAtCCyEKDAcLQgwhCgwGC0INIQoMBQtCDiEKDAQLQg8hCgwDCyADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMQQAhAgwhCyABIARGBEBBIiECDCELQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FRQAAQIDBAUGBxYWFhYWFhYICQoLDA0WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFg4PEBESExYLQgIhCgwUC0IDIQoMEwtCBCEKDBILQgUhCgwRC0IGIQoMEAtCByEKDA8LQgghCgwOC0IJIQoMDQtCCiEKDAwLQgshCgwLC0IMIQoMCgtCDSEKDAkLQg4hCgwIC0IPIQoMBwtCCiEKDAYLQgshCgwFC0IMIQoMBAtCDSEKDAMLQg4hCgwCC0IPIQoMAQtCASEKCyABQQFqIQEgAykDICILQv//////////D1gEQCADIAtCBIYgCoQ3AyAMAgsgA0EANgIcIAMgATYCFCADQbUJNgIQIANBDDYCDEEAIQIMHgtBJyECDAQLQSghAgwDCyADIAE6ACwgA0EANgIAIAdBAWohAUEMIQIMAgsgA0EANgIAIAZBAWohAUEKIQIMAQsgAUEBaiEBQQghAgwACwALQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBcLQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBYLQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBULQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDBQLQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDBMLQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBILQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBELQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBALQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDA8LQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDA4LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDA0LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDAwLQQAhAiADQQA2AhwgAyABNgIUIANBmRM2AhAgA0ELNgIMDAsLQQAhAiADQQA2AhwgAyABNgIUIANBnQk2AhAgA0ELNgIMDAoLQQAhAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMDAkLQQAhAiADQQA2AhwgAyABNgIUIANBsRA2AhAgA0EKNgIMDAgLQQAhAiADQQA2AhwgAyABNgIUIANBux02AhAgA0ECNgIMDAcLQQAhAiADQQA2AhwgAyABNgIUIANBlhY2AhAgA0ECNgIMDAYLQQAhAiADQQA2AhwgAyABNgIUIANB+Rg2AhAgA0ECNgIMDAULQQAhAiADQQA2AhwgAyABNgIUIANBxBg2AhAgA0ECNgIMDAQLIANBAjYCHCADIAE2AhQgA0GpHjYCECADQRY2AgxBACECDAMLQd4AIQIgASAERg0CIAlBCGohByADKAIAIQUCQAJAIAEgBEcEQCAFQZbIAGohCCAEIAVqIAFrIQYgBUF/c0EKaiIFIAFqIQADQCABLQAAIAgtAABHBEBBAiEIDAMLIAVFBEBBACEIIAAhAQwDCyAFQQFrIQUgCEEBaiEIIAQgAUEBaiIBRw0ACyAGIQUgBCEBCyAHQQE2AgAgAyAFNgIADAELIANBADYCACAHIAg2AgALIAcgATYCBCAJKAIMIQACQAJAIAkoAghBAWsOAgQBAAsgA0EANgIcIANBwh42AhAgA0EXNgIMIAMgAEEBajYCFEEAIQIMAwsgA0EANgIcIAMgADYCFCADQdceNgIQIANBCTYCDEEAIQIMAgsgASAERgRAQSghAgwCCyADQQk2AgggAyABNgIEQSchAgwBCyABIARGBEBBASECDAELA0ACQAJAAkAgAS0AAEEKaw4EAAEBAAELIAFBAWohAQwBCyABQQFqIQEgAy0ALkEgcQ0AQQAhAiADQQA2AhwgAyABNgIUIANBoSE2AhAgA0EFNgIMDAILQQEhAiABIARHDQALCyAJQRBqJAAgAkUEQCADKAIMIQAMAQsgAyACNgIcQQAhACADKAIEIgFFDQAgAyABIAQgAygCCBEBACIBRQ0AIAMgBDYCFCADIAE2AgwgASEACyAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQOGooAgAPCwALFwAgAEEvTwRAAAsgAEECdEHsOWooAgALvwkBAX9B9C0hAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HqLA8LQZgmDwtB7TEPC0GgNw8LQckpDwtBtCkPC0GWLQ8LQesrDwtBojUPC0HbNA8LQeApDwtB4yQPC0HVJA8LQe4kDwtB5iUPC0HKNA8LQdA3DwtBqjUPC0H1LA8LQfYmDwtBgiIPC0HyMw8LQb4oDwtB5zcPC0HNIQ8LQcAhDwtBuCUPC0HLJQ8LQZYkDwtBjzQPC0HNNQ8LQd0qDwtB7jMPC0GcNA8LQZ4xDwtB9DUPC0HlIg8LQa8lDwtBmTEPC0GyNg8LQfk2DwtBxDIPC0HdLA8LQYIxDwtBwTEPC0GNNw8LQckkDwtB7DYPC0HnKg8LQcgjDwtB4iEPC0HJNw8LQaUiDwtBlCIPC0HbNg8LQd41DwtBhiYPC0G8Kw8LQYsyDwtBoCMPC0H2MA8LQYAsDwtBiSsPC0GkJg8LQfIjDwtBgSgPC0GrMg8LQesnDwtBwjYPC0GiJA8LQc8qDwtB3CMPC0GHJw8LQeQ0DwtBtyIPC0GtMQ8LQdUiDwtBrzQPC0HeJg8LQdYyDwtB9DQPC0GBOA8LQfQ3DwtBkjYPC0GdJw8LQYIpDwtBjSMPC0HXMQ8LQb01DwtBtDcPC0HYMA8LQbYnDwtBmjgPC0GnKg8LQcQnDwtBriMPC0H1Ig8LAAtByiYhAQsgAQsXACAAIAAvAS5B/v8DcSABQQBHcjsBLgsaACAAIAAvAS5B/f8DcSABQQBHQQF0cjsBLgsaACAAIAAvAS5B+/8DcSABQQBHQQJ0cjsBLgsaACAAIAAvAS5B9/8DcSABQQBHQQN0cjsBLgsaACAAIAAvAS5B7/8DcSABQQBHQQR0cjsBLgsaACAAIAAvAS5B3/8DcSABQQBHQQV0cjsBLgsaACAAIAAvAS5Bv/8DcSABQQBHQQZ0cjsBLgsaACAAIAAvAS5B//4DcSABQQBHQQd0cjsBLgsaACAAIAAvAS5B//0DcSABQQBHQQh0cjsBLgsaACAAIAAvAS5B//sDcSABQQBHQQl0cjsBLgs+AQJ/AkAgACgCOCIDRQ0AIAMoAgQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeESNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAggiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfwRNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAgwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQewKNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfoeNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQcsQNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhgiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQbcfNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQb8VNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQf4INgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQYwdNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeYVNgIQQRghBAsgBAs4ACAAAn8gAC8BMkEUcUEURgRAQQEgAC0AKEEBRg0BGiAALwE0QeUARgwBCyAALQApQQVGCzoAMAtZAQJ/AkAgAC0AKEEBRg0AIAAvATQiAUHkAGtB5ABJDQAgAUHMAUYNACABQbACRg0AIAAvATIiAEHAAHENAEEBIQIgAEGIBHFBgARGDQAgAEEocUUhAgsgAguMAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQAgAC8BMiIBQQJxRQ0BDAILIAAvATIiAUEBcUUNAQtBASECIAAtAChBAUYNACAALwE0IgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNACABQcAAcQ0AQQAhAiABQYgEcUGABEYNACABQShxQQBHIQILIAILcwAgAEEQav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAP0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEwav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEgav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",qcr;Object.defineProperty(fHn,"exports",{get:a(()=>qcr||(qcr=ENs.from(vNs,"base64")),"get")})});var W2e=I((oyf,vHn)=>{"use strict";p();var hHn=["GET","HEAD","POST"],CNs=new Set(hHn),bNs=[101,204,205,304],mHn=[301,302,303,307,308],SNs=new Set(mHn),gHn=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],TNs=new Set(gHn),AHn=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],INs=["",...AHn],xNs=new Set(AHn),wNs=["follow","manual","error"],yHn=["GET","HEAD","OPTIONS","TRACE"],RNs=new Set(yHn),kNs=["navigate","same-origin","no-cors","cors"],PNs=["omit","same-origin","include"],DNs=["default","no-store","reload","no-cache","force-cache","only-if-cached"],NNs=["content-encoding","content-language","content-location","content-type","content-length"],MNs=["half"],_Hn=["CONNECT","TRACE","TRACK"],ONs=new Set(_Hn),EHn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],LNs=new Set(EHn);vHn.exports={subresource:EHn,forbiddenMethods:_Hn,requestBodyHeader:NNs,referrerPolicy:INs,requestRedirect:wNs,requestMode:kNs,requestCredentials:PNs,requestCache:DNs,redirectStatus:mHn,corsSafeListedMethods:hHn,nullBodyStatus:bNs,safeMethods:yHn,badPorts:gHn,requestDuplex:MNs,subresourceSet:LNs,badPortsSet:TNs,redirectStatusSet:SNs,corsSafeListedMethodsSet:CNs,safeMethodsSet:RNs,forbiddenMethodsSet:ONs,referrerPolicyTokens:xNs}});var Hcr=I((ayf,CHn)=>{"use strict";p();var jcr=Symbol.for("undici.globalOrigin.1");function BNs(){return globalThis[jcr]}a(BNs,"getGlobalOrigin");function FNs(t){if(t===void 0){Object.defineProperty(globalThis,jcr,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,jcr,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(FNs,"setGlobalOrigin");CHn.exports={getGlobalOrigin:BNs,setGlobalOrigin:FNs}});var rct=I((uyf,bHn)=>{"use strict";p();var UNs=new TextDecoder;function QNs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),UNs.decode(t))}a(QNs,"utf8DecodeBytes");bHn.exports={utf8DecodeBytes:QNs}});var T8=I((pyf,xHn)=>{"use strict";p();var SHn=require("node:assert"),{utf8DecodeBytes:qNs}=rct();function jNs(t,e,r){let n="";for(;r.positione)return String.fromCharCode.apply(null,t);let r="",n=0,o=65535;for(;ne&&(o=e-n),r+=String.fromCharCode.apply(null,t.subarray(n,n+=o));return r}a(VNs,"isomorphicDecode");var WNs=/[^\x00-\xFF]/;function zNs(t){return SHn(!WNs.test(t)),t}a(zNs,"isomorphicEncode");function YNs(t){return JSON.parse(qNs(t))}a(YNs,"parseJSONFromBytes");function KNs(t,e=!0,r=!0){return IHn(t,e,r,THn)}a(KNs,"removeASCIIWhitespace");function IHn(t,e,r,n){let o=0,s=t.length-1;if(e)for(;o0&&n(t.charCodeAt(s));)s--;return o===0&&s===t.length-1?t:t.slice(o,s+1)}a(IHn,"removeChars");function JNs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return SHn(typeof e=="string"),e}a(JNs,"serializeJavascriptValueToJSONString");xHn.exports={collectASequenceOfCodePoints:jNs,collectASequenceOfCodePointsFast:HNs,forgivingBase64:$Ns,isASCIIWhitespace:THn,isomorphicDecode:VNs,isomorphicEncode:zNs,parseJSONFromBytes:YNs,removeASCIIWhitespace:KNs,removeChars:IHn,serializeJavascriptValueToJSONString:JNs}});var sR=I((gyf,NHn)=>{"use strict";p();var ict=require("node:assert"),{forgivingBase64:ZNs,collectASequenceOfCodePoints:Gcr,collectASequenceOfCodePointsFast:z2e,isomorphicDecode:XNs,removeASCIIWhitespace:eMs,removeChars:tMs}=T8(),rMs=new TextEncoder,Y2e=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,nMs=/[\u000A\u000D\u0009\u0020]/u,iMs=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function oMs(t){ict(t.protocol==="data:");let e=kHn(t,!0);e=e.slice(5);let r={position:0},n=z2e(",",e,r),o=n.length;if(n=eMs(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=PHn(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=XNs(c);if(c=ZNs(u),c==="failure")return"failure";n=n.slice(0,-6),n=n.replace(/(\u0020+)$/u,""),n=n.slice(0,-1)}n.startsWith(";")&&(n="text/plain"+n);let l=$cr(n);return l==="failure"&&(l=$cr("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(oMs,"dataURLProcessor");function kHn(t,e=!1){if(!e)return t.href;let r=t.href,n=t.hash.length,o=n===0?r:r.substring(0,r.length-n);return!n&&r.endsWith("#")?o.slice(0,-1):o}a(kHn,"URLSerializer");function PHn(t){let e=rMs.encode(t);return sMs(e)}a(PHn,"stringPercentDecode");function wHn(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(wHn,"isHexCharByte");function RHn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(RHn,"hexByteToNumber");function sMs(t){let e=t.length,r=new Uint8Array(e),n=0,o=0;for(;o=t.length)return"failure";e.position++;let n=z2e(";",t,e);if(n=nct(n,!1,!0),n.length===0||!Y2e.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionnMs.test(d),t,e);let l=Gcr(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=DHn(t,e,!0),z2e(";",t,e);else if(u=z2e(";",t,e),u=nct(u,!1,!0),u.length===0)continue;l.length!==0&&Y2e.test(l)&&(u.length===0||iMs.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a($cr,"parseMIMEType");function DHn(t,e,r=!1){let n=e.position,o="";for(ict(t[e.position]==='"'),e.position++;o+=Gcr(c=>c!=='"'&&c!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){o+="\\";break}o+=t[e.position],e.position++}else{ict(s==='"');break}}return r?o:t.slice(n,e.position)}a(DHn,"collectAnHTTPQuotedString");function aMs(t){ict(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",Y2e.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(aMs,"serializeAMimeType");function cMs(t){return t===13||t===10||t===9||t===32}a(cMs,"isHTTPWhiteSpace");function nct(t,e=!0,r=!0){return tMs(t,e,r,cMs)}a(nct,"removeHTTPWhitespace");function lMs(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}a(lMs,"minimizeSupportedMimeType");NHn.exports={dataURLProcessor:oMs,URLSerializer:kHn,stringPercentDecode:PHn,parseMIMEType:$cr,collectAnHTTPQuotedString:DHn,serializeAMimeType:aMs,removeHTTPWhitespace:nct,minimizeSupportedMimeType:lMs,HTTP_TOKEN_CODEPOINTS:Y2e}});var I8=I((_yf,Wcr)=>{"use strict";p();var MHn={__proto__:null,"node:crypto":a(()=>require("node:crypto"),"node:crypto"),"node:sqlite":a(()=>require("node:sqlite"),"node:sqlite"),"node:worker_threads":a(()=>require("node:worker_threads"),"node:worker_threads"),"node:zlib":a(()=>require("node:zlib"),"node:zlib")};function uMs(t){try{return MHn[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(uMs,"detectRuntimeFeatureByNodeModule");function dMs(t,e){return typeof MHn[t]()[e]<"u"}a(dMs,"detectRuntimeFeatureByExportedProperty");var OHn=["markAsUncloneable","zstd"],fMs={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},LHn=["crypto","sqlite"],pMs=[...LHn,...OHn];function hMs(t){if(LHn.includes(t))return uMs(`node:${t}`);if(OHn.includes(t)){let[e,r]=fMs[t];return dMs(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(hMs,"detectRuntimeFeature");var Vcr=class{static{a(this,"RuntimeFeatures")}#e=new Map;clear(){this.#e.clear()}has(e){return this.#e.get(e)??this.#t(e)}set(e,r){if(pMs.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=hMs(e);return this.#e.set(e,r),r}},BHn=new Vcr;Wcr.exports.runtimeFeatures=BHn;Wcr.exports.default=BHn});var oy=I((Cyf,UHn)=>{"use strict";p();var mMs=require("node:assert"),{types:Sp,inspect:gMs}=require("node:util"),{runtimeFeatures:AMs}=I8(),zcr=1,Ycr=2,oct=3,sct=4,Kcr=5,act=6,Jcr=7,$T=8,FHn=Function.call.bind(Function.prototype[Symbol.hasInstance]),dt={converters:{},util:{},errors:{},is:{}};dt.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};dt.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return dt.errors.exception({header:t.prefix,message:r})};dt.errors.invalidArgument=function(t){return dt.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};dt.brandCheck=function(t,e){if(!FHn(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};dt.brandCheckMultiple=function(t){let e=t.map(r=>dt.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};dt.argumentLengthCheck=function({length:t},e,r){if(tFHn(t,e)};dt.util.Type=function(t){switch(typeof t){case"undefined":return zcr;case"boolean":return Ycr;case"string":return oct;case"symbol":return sct;case"number":return Kcr;case"bigint":return act;case"function":case"object":return t===null?Jcr:$T}};dt.util.Types={UNDEFINED:zcr,BOOLEAN:Ycr,STRING:oct,SYMBOL:sct,NUMBER:Kcr,BIGINT:act,NULL:Jcr,OBJECT:$T};dt.util.TypeValueToString=function(t){switch(dt.util.Type(t)){case zcr:return"Undefined";case Ycr:return"Boolean";case oct:return"String";case sct:return"Symbol";case Kcr:return"Number";case act:return"BigInt";case Jcr:return"Null";case $T:return"Object"}};dt.util.markAsUncloneable=AMs.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};dt.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=-Math.pow(2,e-1),o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),dt.util.HasFlag(n,dt.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw dt.errors.exception({header:"Integer conversion",message:`Could not convert ${dt.util.Stringify(t)} to an integer.`});if(c=dt.util.IntegerPart(c),co)throw dt.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&dt.util.HasFlag(n,dt.attributes.Clamp)?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=dt.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};dt.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};dt.util.Stringify=function(t){switch(dt.util.Type(t)){case sct:return`Symbol(${t.description})`;case $T:return gMs(t);case oct:return`"${t}"`;case act:return`${t}n`;default:return`${t}`}};dt.util.IsResizableArrayBuffer=function(t){if(Sp.isArrayBuffer(t))return t.resizable;if(Sp.isSharedArrayBuffer(t))return t.growable;throw dt.errors.exception({header:"IsResizableArrayBuffer",message:`"${dt.util.Stringify(t)}" is not an array buffer.`})};dt.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};dt.sequenceConverter=function(t){return(e,r,n,o)=>{if(dt.util.Type(e)!==$T)throw dt.errors.exception({header:r,message:`${n} (${dt.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw dt.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};dt.recordConverter=function(t,e){return(r,n,o)=>{if(dt.util.Type(r)!==$T)throw dt.errors.exception({header:n,message:`${o} ("${dt.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!Sp.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=dt.util.Stringify(u),f=t(u,n,`Key ${d} in ${o}`),h=e(r[u],n,`${o}[${d}]`);s[f]=h}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};dt.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw dt.errors.exception({header:n,message:`Expected ${o} ("${dt.util.Stringify(r)}") to be an instance of ${e}.`});return r}};dt.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&&dt.util.Type(e)!==$T)throw dt.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let s of t){let{key:c,defaultValue:l,required:u,converter:d}=s;if(u===!0&&(e==null||!Object.hasOwn(e,c)))throw dt.errors.exception({header:r,message:`Missing required key "${c}".`});let f=e?.[c],h=l!==void 0;if(h&&f===void 0&&(f=l()),u||h||f!==void 0){if(f=d(f,r,`${n}.${c}`),s.allowedValues&&!s.allowedValues.includes(f))throw dt.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};dt.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};dt.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};dt.is.ReadableStream=dt.util.MakeTypeAssertion(ReadableStream);dt.is.Blob=dt.util.MakeTypeAssertion(Blob);dt.is.URLSearchParams=dt.util.MakeTypeAssertion(URLSearchParams);dt.is.File=dt.util.MakeTypeAssertion(File);dt.is.URL=dt.util.MakeTypeAssertion(URL);dt.is.AbortSignal=dt.util.MakeTypeAssertion(AbortSignal);dt.is.MessagePort=dt.util.MakeTypeAssertion(MessagePort);dt.is.BufferSource=function(t){return Sp.isArrayBuffer(t)||ArrayBuffer.isView(t)&&Sp.isArrayBuffer(t.buffer)};dt.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(Sp.isTypedArray(e)||Sp.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(mMs(Sp.isAnyArrayBuffer(e)),o=e.byteLength),r.detached)return new Uint8Array(0);let s=new Uint8Array(o),c=new Uint8Array(r,n,o);return s.set(c),s};dt.converters.DOMString=function(t,e,r,n){if(t===null&&dt.util.HasFlag(n,dt.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw dt.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};dt.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw dt.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a ByteString.`});let n=String(t);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};dt.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};dt.converters.boolean=function(t){return!!t};dt.converters.any=function(t){return t};dt.converters["long long"]=function(t,e,r){return dt.util.ConvertToInt(t,64,"signed",0,e,r)};dt.converters["unsigned long long"]=function(t,e,r){return dt.util.ConvertToInt(t,64,"unsigned",0,e,r)};dt.converters["unsigned long"]=function(t,e,r){return dt.util.ConvertToInt(t,32,"unsigned",0,e,r)};dt.converters["unsigned short"]=function(t,e,r,n){return dt.util.ConvertToInt(t,16,"unsigned",n,e,r)};dt.converters.ArrayBuffer=function(t,e,r,n){if(dt.util.Type(t)!==$T||!Sp.isArrayBuffer(t))throw dt.errors.conversionFailed({prefix:e,argument:`${r} ("${dt.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!dt.util.HasFlag(n,dt.attributes.AllowResizable)&&dt.util.IsResizableArrayBuffer(t))throw dt.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};dt.converters.SharedArrayBuffer=function(t,e,r,n){if(dt.util.Type(t)!==$T||!Sp.isSharedArrayBuffer(t))throw dt.errors.conversionFailed({prefix:e,argument:`${r} ("${dt.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!dt.util.HasFlag(n,dt.attributes.AllowResizable)&&dt.util.IsResizableArrayBuffer(t))throw dt.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};dt.converters.TypedArray=function(t,e,r,n,o){if(dt.util.Type(t)!==$T||!Sp.isTypedArray(t)||t.constructor.name!==e.name)throw dt.errors.conversionFailed({prefix:r,argument:`${n} ("${dt.util.Stringify(t)}")`,types:[e.name]});if(!dt.util.HasFlag(o,dt.attributes.AllowShared)&&Sp.isSharedArrayBuffer(t.buffer))throw dt.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!dt.util.HasFlag(o,dt.attributes.AllowResizable)&&dt.util.IsResizableArrayBuffer(t.buffer))throw dt.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};dt.converters.DataView=function(t,e,r,n){if(dt.util.Type(t)!==$T||!Sp.isDataView(t))throw dt.errors.conversionFailed({prefix:e,argument:`${r} ("${dt.util.Stringify(t)}")`,types:["DataView"]});if(!dt.util.HasFlag(n,dt.attributes.AllowShared)&&Sp.isSharedArrayBuffer(t.buffer))throw dt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!dt.util.HasFlag(n,dt.attributes.AllowResizable)&&dt.util.IsResizableArrayBuffer(t.buffer))throw dt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};dt.converters.ArrayBufferView=function(t,e,r,n){if(dt.util.Type(t)!==$T||!Sp.isArrayBufferView(t))throw dt.errors.conversionFailed({prefix:e,argument:`${r} ("${dt.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!dt.util.HasFlag(n,dt.attributes.AllowShared)&&Sp.isSharedArrayBuffer(t.buffer))throw dt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!dt.util.HasFlag(n,dt.attributes.AllowResizable)&&dt.util.IsResizableArrayBuffer(t.buffer))throw dt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};dt.converters.BufferSource=function(t,e,r,n){if(Sp.isArrayBuffer(t))return dt.converters.ArrayBuffer(t,e,r,n);if(Sp.isArrayBufferView(t))return n&=~dt.attributes.AllowShared,dt.converters.ArrayBufferView(t,e,r,n);throw Sp.isSharedArrayBuffer(t)?dt.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):dt.errors.conversionFailed({prefix:e,argument:`${r} ("${dt.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};dt.converters.AllowSharedBufferSource=function(t,e,r,n){if(Sp.isArrayBuffer(t))return dt.converters.ArrayBuffer(t,e,r,n);if(Sp.isSharedArrayBuffer(t))return dt.converters.SharedArrayBuffer(t,e,r,n);if(Sp.isArrayBufferView(t))return n|=dt.attributes.AllowShared,dt.converters.ArrayBufferView(t,e,r,n);throw dt.errors.conversionFailed({prefix:e,argument:`${r} ("${dt.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};dt.converters["sequence"]=dt.sequenceConverter(dt.converters.ByteString);dt.converters["sequence>"]=dt.sequenceConverter(dt.converters["sequence"]);dt.converters["record"]=dt.recordConverter(dt.converters.ByteString,dt.converters.ByteString);dt.converters.Blob=dt.interfaceConverter(dt.is.Blob,"Blob");dt.converters.AbortSignal=dt.interfaceConverter(dt.is.AbortSignal,"AbortSignal");dt.converters.EventHandlerNonNull=function(t){return dt.util.Type(t)!==$T?null:typeof t=="function"?t:()=>{}};dt.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};UHn.exports={webidl:dt}});var VT=I((Syf,XHn)=>{"use strict";p();var{Transform:yMs}=require("node:stream"),QHn=require("node:zlib"),{redirectStatusSet:_Ms,referrerPolicyTokens:EMs,badPortsSet:vMs}=W2e(),{getGlobalOrigin:qHn}=Hcr(),{collectAnHTTPQuotedString:CMs,parseMIMEType:bMs}=sR(),{performance:SMs}=require("node:perf_hooks"),{ReadableStreamFrom:TMs,isValidHTTPToken:jHn,normalizedMethodRecordsBase:IMs}=No(),J2e=require("node:assert"),{isUint8Array:xMs}=require("node:util/types"),{webidl:DH}=oy(),{isomorphicEncode:Zcr,collectASequenceOfCodePoints:_X,removeChars:wMs}=T8();function HHn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(HHn,"responseURL");function RMs(t,e){if(!_Ms.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&$Hn(r)&&(GHn(r)||(r=kMs(r)),r=new URL(r,HHn(t))),r&&!r.hash&&(r.hash=e),r}a(RMs,"responseLocationURL");function GHn(t){for(let e=0;e126||r<32)return!1}return!0}a(GHn,"isValidEncodedURL");function kMs(t){return Buffer.from(t,"binary").toString("utf8")}a(kMs,"normalizeBinaryStringToUtf8");function vX(t){return t.urlList[t.urlList.length-1]}a(vX,"requestCurrentURL");function PMs(t){let e=vX(t);return JHn(e)&&vMs.has(e.port)?"blocked":"allowed"}a(PMs,"requestBadPort");function DMs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(DMs,"isErrorLike");function NMs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(NMs,"isValidReasonPhrase");var MMs=jHn;function $Hn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}a($Hn,"isValidHeaderValue");function OMs(t){let e=(t.headersList.get("referrer-policy",!0)??"").split(","),r="";if(e.length)for(let n=e.length;n!==0;n--){let o=e[n-1].trim();if(EMs.has(o)){r=o;break}}return r}a(OMs,"parseReferrerPolicy");function LMs(t,e){let r=OMs(e);r!==""&&(t.referrerPolicy=r)}a(LMs,"setRequestReferrerPolicyOnRedirect");function BMs(){return"allowed"}a(BMs,"crossOriginResourcePolicyCheck");function FMs(){return"success"}a(FMs,"corsCheck");function UMs(){return"success"}a(UMs,"TAOCheck");function QMs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(QMs,"appendFetchMetadata");function qMs(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&elr(t.origin)&&!elr(vX(t))&&(e=null);break;case"same-origin":K2e(t,vX(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(qMs,"appendRequestOriginHeader");function vhe(t,e){return t}a(vhe,"coarsenTime");function jMs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??Xcr(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=vX(t);return EX(n)&&!EX(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=vX(t);return K2e(n,s)?n:EX(n)&&!EX(s)?"no-referrer":o}case"same-origin":return K2e(t,n)?n:"no-referrer";case"origin-when-cross-origin":return K2e(t,n)?n:o;case"no-referrer-when-downgrade":{let s=vX(t);return EX(n)&&!EX(s)?"no-referrer":n}}}a(VMs,"determineRequestsReferrer");function Xcr(t,e=!1){return J2e(DH.is.URL(t)),t=new URL(t),KHn(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(Xcr,"stripURLForReferrer");var WMs=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),zMs=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function WHn(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),zMs(t)):WMs(t)}a(WHn,"isOriginIPPotentiallyTrustworthy");function YMs(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||WHn(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(YMs,"isOriginPotentiallyTrustworthy");function EX(t){return DH.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:YMs(t.origin):!1}a(EX,"isURLPotentiallyTrustworthy");function KMs(t){}a(KMs,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function K2e(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(K2e,"sameOrigin");function JMs(t){return t.controller.state==="aborted"}a(JMs,"isAborted");function ZMs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(ZMs,"isCancelled");function XMs(t){return IMs[t.toLowerCase()]??t}a(XMs,"normalizeMethod");var eOs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function zHn(t,e,r=0,n=1){class o{static{a(this,"FastIterableIterator")}#e;#t;#r;constructor(c,l){this.#e=c,this.#t=l,this.#r=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let c=this.#r,l=e(this.#e),u=l.length;if(c>=u)return{value:void 0,done:!0};let{[r]:d,[n]:f}=l[c];this.#r=c+1;let h;switch(this.#t){case"key":h=d;break;case"value":h=f;break;case"key+value":h=[d,f];break}return{value:h,done:!1}}}return delete o.prototype.constructor,Object.setPrototypeOf(o.prototype,eOs),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,c){return new o(s,c)}}a(zHn,"createIterator");function tOs(t,e,r,n=0,o=1){let s=zHn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return DH.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return DH.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return DH.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(DH.brandCheck(this,e),DH.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof u!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:f,1:h}of s(this,"key+value"))u.call(d,h,f,this)},"forEach")}};return Object.defineProperties(e.prototype,{...c,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:c.entries.value}})}a(tOs,"iteratorMixin");function rOs(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();YHn(s,n,o)}catch(s){o(s)}}a(rOs,"fullyReadBody");function nOs(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}a(nOs,"readableStreamClose");async function YHn(t,e,r){try{let n=[],o=0;do{let{done:s,value:c}=await t.read();if(s){e(Buffer.concat(n,o));return}if(!xMs(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(YHn,"readAllBytes");function KHn(t){J2e("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(KHn,"urlIsLocal");function elr(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}a(elr,"urlHasHttpsScheme");function JHn(t){J2e("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(JHn,"urlIsHttpHttpsScheme");function iOs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&_X(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&_X(u=>u===" "||u===" ",r,n);let o=_X(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&_X(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&_X(u=>u===" "||u===" ",r,n);let c=_X(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(iOs,"simpleRangeHeaderValue");function oOs(t,e,r){let n="bytes ";return n+=Zcr(`${t}`),n+="-",n+=Zcr(`${e}`),n+="/",n+=Zcr(`${r}`),n}a(oOs,"buildContentRange");var tlr=class extends yMs{static{a(this,"InflateStream")}#e;constructor(e){super(),this.#e=e}_transform(e,r,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)===8?QHn.createInflate(this.#e):QHn.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",o=>this.destroy(o))}this._inflateStream.write(e,r,n)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function sOs(t){return new tlr(t)}a(sOs,"createInflate");function aOs(t){let e=null,r=null,n=null,o=ZHn("content-type",t);if(o===null)return"failure";for(let s of o){let c=bMs(s);c==="failure"||c.essence==="*/*"||(n=c,n.essence!==r?(e=null,n.parameters.has("charset")&&(e=n.parameters.get("charset")),r=n.essence):!n.parameters.has("charset")&&e!==null&&n.parameters.set("charset",e))}return n??"failure"}a(aOs,"extractMimeType");function cOs(t){let e=t,r={position:0},n=[],o="";for(;r.positions!=='"'&&s!==",",e,r),r.positions===9||s===32),n.push(o),o=""}return n}a(cOs,"gettingDecodingSplitting");function ZHn(t,e){let r=e.get(t,!0);return r===null?null:cOs(r)}a(ZHn,"getDecodeSplit");function lOs(t){return!1}a(lOs,"hasAuthenticationEntry");function uOs(t){return!!(t.username||t.password)}a(uOs,"includesCredentials");function dOs(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(dOs,"isTraversableNavigable");var rlr=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return qHn()}get origin(){return this.baseUrl?.origin}policyContainer=VHn()},nlr=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new rlr},fOs=new nlr;XHn.exports={isAborted:JMs,isCancelled:ZMs,isValidEncodedURL:GHn,ReadableStreamFrom:TMs,tryUpgradeRequestToAPotentiallyTrustworthyURL:KMs,clampAndCoarsenConnectionTimingInfo:jMs,coarsenedSharedCurrentTime:HMs,determineRequestsReferrer:VMs,makePolicyContainer:VHn,clonePolicyContainer:$Ms,appendFetchMetadata:QMs,appendRequestOriginHeader:qMs,TAOCheck:UMs,corsCheck:FMs,crossOriginResourcePolicyCheck:BMs,createOpaqueTimingInfo:GMs,setRequestReferrerPolicyOnRedirect:LMs,isValidHTTPToken:jHn,requestBadPort:PMs,requestCurrentURL:vX,responseURL:HHn,responseLocationURL:RMs,isURLPotentiallyTrustworthy:EX,isValidReasonPhrase:NMs,sameOrigin:K2e,normalizeMethod:XMs,iteratorMixin:tOs,createIterator:zHn,isValidHeaderName:MMs,isValidHeaderValue:$Hn,isErrorLike:DMs,fullyReadBody:rOs,readableStreamClose:nOs,urlIsLocal:KHn,urlHasHttpsScheme:elr,urlIsHttpHttpsScheme:JHn,readAllBytes:YHn,simpleRangeHeaderValue:iOs,buildContentRange:oOs,createInflate:sOs,extractMimeType:aOs,getDecodeSplit:ZHn,environmentSettingsObject:fOs,isOriginIPPotentiallyTrustworthy:WHn,hasAuthenticationEntry:lOs,includesCredentials:uOs,isTraversableNavigable:dOs}});var cct=I((xyf,tGn)=>{"use strict";p();var{iteratorMixin:pOs}=VT(),{kEnumerableProperty:Che}=No(),{webidl:Qc}=oy(),eGn=require("node:util"),x8=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(Qc.util.markAsUncloneable(this),e!==void 0)throw Qc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){Qc.brandCheck(this,t);let o="FormData.append";Qc.argumentLengthCheck(arguments,2,o),e=Qc.converters.USVString(e),arguments.length===3||Qc.is.Blob(r)?(r=Qc.converters.Blob(r,o,"value"),n!==void 0&&(n=Qc.converters.USVString(n))):r=Qc.converters.USVString(r);let s=ilr(e,r,n);this.#e.push(s)}delete(e){Qc.brandCheck(this,t),Qc.argumentLengthCheck(arguments,1,"FormData.delete"),e=Qc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){Qc.brandCheck(this,t),Qc.argumentLengthCheck(arguments,1,"FormData.get"),e=Qc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return Qc.brandCheck(this,t),Qc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=Qc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return Qc.brandCheck(this,t),Qc.argumentLengthCheck(arguments,1,"FormData.has"),e=Qc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Qc.brandCheck(this,t);let o="FormData.set";Qc.argumentLengthCheck(arguments,2,o),e=Qc.converters.USVString(e),arguments.length===3||Qc.is.Blob(r)?(r=Qc.converters.Blob(r,o,"value"),n!==void 0&&(n=Qc.converters.USVString(n))):r=Qc.converters.USVString(r);let s=ilr(e,r,n),c=this.#e.findIndex(l=>l.name===e);c!==-1?this.#e=[...this.#e.slice(0,c),s,...this.#e.slice(c+1).filter(l=>l.name!==e)]:this.#e.push(s)}[eGn.inspect.custom](e,r){let n=this.#e.reduce((s,c)=>(s[c.name]?Array.isArray(s[c.name])?s[c.name].push(c.value):s[c.name]=[s[c.name],c.value]:s[c.name]=c.value,s),{__proto__:null});r.depth??=e,r.colors??=!0;let o=eGn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:hOs,setFormDataState:mOs}=x8;Reflect.deleteProperty(x8,"getFormDataState");Reflect.deleteProperty(x8,"setFormDataState");pOs("FormData",x8,hOs,"name","value");Object.defineProperties(x8.prototype,{append:Che,delete:Che,get:Che,getAll:Che,has:Che,set:Che,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function ilr(t,e,r){if(typeof e!="string"){if(Qc.is.File(e)||(e=new File([e],"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=new File([e],r,n)}}return{name:t,value:e}}a(ilr,"makeEntry");Qc.is.FormData=Qc.util.MakeTypeAssertion(x8);tGn.exports={FormData:x8,makeEntry:ilr,setFormDataState:mOs}});var iGn=I((kyf,nGn)=>{"use strict";p();var{bufferToLowerCasedHeaderName:gOs}=No(),{HTTP_TOKEN_CODEPOINTS:AOs}=sR(),{makeEntry:yOs}=cct(),{webidl:olr}=oy(),slr=require("node:assert"),{isomorphicDecode:rGn}=T8(),_Os=Buffer.from("--"),alr=new TextDecoder,EOs=new TextDecoder("utf-8",{ignoreBOM:!0});function vOs(t){for(let e=0;e70)return!1;for(let r=0;r=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}a(COs,"validateBoundary");function bOs(t,e){slr(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw Bb("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw Bb("no boundary found in multipart body");for(s.position=c;;){if(t.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else throw Bb("expected a value starting with -- and the boundary");if(IOs(t,_Os,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw Bb("expected CRLF");s.position+=2;let l=TOs(t,s),{name:u,filename:d,contentType:f,encoding:h}=l;s.position+=2;let m;{let A=t.indexOf(n.subarray(2),s.position);if(A===-1)throw Bb("expected boundary after body");m=t.subarray(s.position,A-4),s.position+=m.length,h==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)throw Bb("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",vOs(f)||(f=""),g=new File([m],d,{type:f})):g=EOs.decode(Buffer.from(m)),slr(olr.is.USVString(u)),slr(typeof g=="string"&&olr.is.USVString(g)||olr.is.File(g)),o.push(yOs(u,g,d))}}a(bOs,"multipartFormDataParser");function SOs(t,e){t[e.position]===59&&e.position++,aR(c=>c===32||c===9,t,e);let r=aR(c=>llr(c)&&c!==61&&c!==42,t,e);if(r.length===0)return null;let n=r.toString("ascii").toLowerCase(),o=t[e.position]===42;if(o&&e.position++,t[e.position]!==61)return null;e.position++,aR(c=>c===32||c===9,t,e);let s;if(o){let c=aR(l=>l!==32&&l!==13&&l!==10&&l!==59,t,e);if(c[0]!==117&&c[0]!==85||c[1]!==116&&c[1]!==84||c[2]!==102&&c[2]!==70||c[3]!==45||c[4]!==56)throw Bb("unknown encoding, expected utf-8''");s=decodeURIComponent(alr.decode(c.subarray(7)))}else if(t[e.position]===34){e.position++;let c=aR(l=>l!==10&&l!==13&&l!==34,t,e);if(t[e.position]!==34)throw Bb("Closing quote not found");e.position++,s=alr.decode(c).replace(/%0A/ig,` +`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=aR(l=>llr(l)&&l!==59,t,e);s=alr.decode(c)}return{name:n,value:s,extended:o}}a(SOs,"parseContentDispositionAttribute");function TOs(t,e){let r=null,n=null,o=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10){if(r===null)throw Bb("header name is null");return{name:r,filename:n,contentType:o,encoding:s}}let c=aR(l=>l!==10&&l!==13&&l!==58,t,e);if(c=clr(c,!0,!0,l=>l===9||l===32),!AOs.test(c.toString()))throw Bb("header name does not match the field-name token production");if(t[e.position]!==58)throw Bb("expected :");switch(e.position++,aR(l=>l===32||l===9,t,e),gOs(c)){case"content-disposition":{r=n=null;let l=!1;if(aR(d=>llr(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw Bb("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=clr(l,!1,!0,u=>u===9||u===32),o=rGn(l);break}case"content-transfer-encoding":{let l=aR(u=>u!==10&&u!==13,t,e);l=clr(l,!1,!0,u=>u===9||u===32),s=rGn(l);break}default:aR(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw Bb("expected CRLF");e.position+=2}}a(TOs,"parseMultipartFormDataHeaders");function aR(t,e,r){let n=r.position;for(;n0&&n(t[s]);)s--;return o===0&&s===t.length-1?t:t.subarray(o,s+1)}a(clr,"removeChars");function IOs(t,e,r){if(t.length{"use strict";p();function ROs(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(ROs,"createDeferredPromise");oGn.exports={createDeferredPromise:ROs}});var She=I((Lyf,uGn)=>{"use strict";p();var flr=No(),{ReadableStreamFrom:kOs,readableStreamClose:POs,fullyReadBody:DOs,extractMimeType:NOs}=VT(),{FormData:sGn,setFormDataState:MOs}=cct(),{webidl:X2}=oy(),ulr=require("node:assert"),{isErrored:dlr,isDisturbed:OOs}=require("node:stream"),{isUint8Array:LOs}=require("node:util/types"),{serializeAMimeType:BOs}=sR(),{multipartFormDataParser:FOs}=iGn(),{createDeferredPromise:UOs}=Z2e(),{parseJSONFromBytes:QOs}=T8(),{utf8DecodeBytes:qOs}=rct(),{runtimeFeatures:jOs}=I8(),HOs=jOs.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),lct=new TextEncoder;function GOs(){}a(GOs,"noop");var $Os=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!OOs(e)&&!dlr(e)&&e.cancel("Response object has been garbage collected").catch(GOs)});function cGn(t,e=!1){let r=null,n=null;X2.is.ReadableStream(t)?r=t:X2.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),ulr(X2.is.ReadableStream(r));let o=null,s=null,c=null,l=null;if(typeof t=="string")s=t,l="text/plain;charset=UTF-8";else if(X2.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(X2.is.BufferSource(t))s=X2.util.getCopyOfBytesHeldByBufferSource(t);else if(X2.is.FormData(t)){let d=`----formdata-undici-0${`${HOs(1e11)}`.padStart(11,"0")}`,f=`--${d}\r Content-Disposition: form-data`;let h=a(E=>E.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"formdataEscape"),m=a(E=>E.replace(/\r?\n|\r/g,`\r `),"normalizeLinefeeds"),g=[],A=new Uint8Array([13,10]);c=0;let y=!1;for(let[E,v]of t)if(typeof v=="string"){let S=lct.encode(f+`; name="${h(m(E))}"\r \r @@ -184,39 +184,39 @@ ${m(v)}\r Content-Type: ${v.type||"application/octet-stream"}\r \r `);g.push(S,v,A),typeof v.size=="number"?c+=S.byteLength+v.size+A.byteLength:y=!0}let _=lct.encode(`--${d}--\r -`);g.push(_),c+=_.byteLength,y&&(c=null),s=t,o=a(async function*(){for(let E of g)E.stream?yield*E.stream():yield E},"action"),l=`multipart/form-data; boundary=${d}`}else if(X2.is.Blob(t))s=t,c=t.size,t.type&&(l=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(dlr.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=X2.is.ReadableStream(t)?t:wOs(t)}return(typeof s=="string"||MOs(s))&&(o=a(()=>(c=typeof s=="string"?Buffer.byteLength(s):s.length,s),"action")),o!=null&&(async()=>{let d=o(),f=d?.[Symbol.asyncIterator]?.();if(f)for await(let h of f){if(ulr(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!ulr(r)&&n.enqueue(typeof d=="string"?lct.encode(d):new Uint8Array(d));queueMicrotask(()=>ROs(n))})(),[{stream:r,source:s,length:c},l]}a(sGn,"extractBody");function GOs(t,e=!1){return X2.is.ReadableStream(t)&&(llr(!dlr.isDisturbed(t),"The body has already been consumed."),llr(!t.locked,"The stream is locked.")),sGn(t,e)}a(GOs,"safelyExtractBody");function $Os(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a($Os,"cloneBody");function VOs(t,e){return{blob(){return Che(this,n=>{let o=oGn(e(this));return o===null?o="":o&&(o=OOs(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return Che(this,n=>new Uint8Array(n).buffer,t,e)},text(){return Che(this,UOs,t,e)},json(){return Che(this,FOs,t,e)},formData(){return Che(this,n=>{let o=oGn(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=LOs(n,o),c=new iGn;return DOs(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new iGn;for(let[l,u]of s)c.append(l,u);return c}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t,e)},bytes(){return Che(this,n=>new Uint8Array(n),t,e)}}}a(VOs,"bodyMixinMethods");function WOs(t,e){Object.assign(t.prototype,VOs(t,e))}a(WOs,"mixinBody");function Che(t,e,r,n){try{X2.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),aGn(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=BOs(),s=o.reject,c=a(l=>{try{o.resolve(e(l))}catch(u){s(u)}},"successSteps");return t.body==null?(c(Buffer.allocUnsafe(0)),o.promise):(kOs(t.body,c,s),o.promise)}a(Che,"consumeBody");function aGn(t){let e=t.body;return e!=null&&(e.stream.locked||dlr.isDisturbed(e.stream))}a(aGn,"bodyUnusable");function oGn(t){let e=t.headersList,r=POs(e);return r==="failure"?null:r}a(oGn,"bodyMimeType");cGn.exports={extractBody:sGn,safelyExtractBody:GOs,cloneBody:$Os,mixinBody:WOs,streamRegistry:HOs,bodyUnusable:aGn}});var bGn=I((Byf,CGn)=>{"use strict";p();var Fi=require("node:assert"),Ci=No(),{channels:lGn}=kH(),flr=Var(),{RequestContentLengthMismatchError:vX,ResponseContentLengthMismatchError:uGn,RequestAbortedError:yGn,InvalidArgumentError:zOs,HeadersTimeoutError:YOs,HeadersOverflowError:KOs,SocketError:CX,InformationalError:She,BodyTimeoutError:JOs,HTTPParserError:ZOs,ResponseExceededMaxSizeError:XOs}=uo(),{kUrl:_Gn,kReset:Fb,kClient:hct,kParser:Ed,kBlocking:tDe,kRunning:Tm,kPending:_lr,kSize:dGn,kWriting:NH,kQueue:eD,kNoRef:X2e,kKeepAliveDefaultTimeout:e5s,kHostHeader:t5s,kPendingIdx:r5s,kRunningIdx:cR,kError:Rv,kPipelining:fct,kSocket:SX,kKeepAliveTimeoutValue:mct,kMaxHeadersSize:n5s,kKeepAliveMaxTimeout:i5s,kKeepAliveTimeoutThreshold:o5s,kHeadersTimeout:s5s,kBodyTimeout:a5s,kStrictContentLength:mlr,kMaxRequests:fGn,kCounter:c5s,kMaxResponseSize:l5s,kOnError:pGn,kResume:w8,kHTTPContext:EGn,kClosed:glr}=Al(),WT=cHn(),hGn=Buffer.alloc(0),uct=Buffer[Symbol.species],u5s=Ci.removeAllListeners,TX=Symbol("kIdleSocketValidation"),bX=Symbol("kIdleSocketValidationTimeout"),Elr=Symbol("kSocketUsed"),plr;function d5s(){let t=process.env.JEST_WORKER_ID?Ucr():void 0,e,r=process.arch!=="ppc64";if(process.env.UNDICI_NO_WASM_SIMD==="1"?r=!1:process.env.UNDICI_NO_WASM_SIMD==="0"&&(r=!0),r)try{e=new WebAssembly.Module(dHn())}catch{}return e||(e=new WebAssembly.Module(t||Ucr())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Fi(Tp.ptr===n);let c=o-p4+f4.byteOffset;return Tp.onStatus(new uct(f4.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Fi(Tp.ptr===n),Tp.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Fi(Tp.ptr===n);let c=o-p4+f4.byteOffset;return Tp.onHeaderField(new uct(f4.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Fi(Tp.ptr===n);let c=o-p4+f4.byteOffset;return Tp.onHeaderValue(new uct(f4.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Fi(Tp.ptr===n),Tp.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Fi(Tp.ptr===n);let c=o-p4+f4.byteOffset;return Tp.onBody(new uct(f4.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Fi(Tp.ptr===n),Tp.onMessageComplete()),"wasm_on_message_complete")}})}a(d5s,"lazyllhttp");var hlr=null,Tp=null,f4=null,dct=0,p4=null,f5s=0,eDe=1,The=2|eDe,pct=4|eDe,Alr=8|f5s,ylr=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(WT.TYPE.RESPONSE),this.client=e,this.socket=r,this.timeout=null,this.timeoutWeakRef=new WeakRef(this),this.timeoutValue=null,this.timeoutType=null,this.statusCode=0,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[n5s],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[l5s]}setTimeout(e,r){e!==this.timeoutValue||r&eDe^this.timeoutType&eDe?(this.timeout&&(flr.clearTimeout(this.timeout),this.timeout=null),e&&(r&eDe?this.timeout=flr.setFastTimeout(mGn,e,this.timeoutWeakRef):(this.timeout=setTimeout(mGn,e,this.timeoutWeakRef),this.timeout?.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(Fi(this.ptr!=null),Fi(Tp===null),this.llhttp.llhttp_resume(this.ptr),Fi(this.timeoutType===pct),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||hGn),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Fi(Tp===null),Fi(this.ptr!=null),Fi(!this.paused);let{socket:r,llhttp:n}=this;e.length>dct&&(p4&&n.free(p4),dct=Math.ceil(e.length/4096)*4096,p4=n.malloc(dct)),new Uint8Array(n.memory.buffer,p4,dct).set(e);try{let o;try{f4=e,Tp=this,o=n.llhttp_execute(this.ptr,p4,e.length)}finally{Tp=null,f4=null}if(o!==WT.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-p4);if(o===WT.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===WT.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Ci.destroy(r,o)}}finish(){Fi(Tp===null),Fi(this.ptr!=null),Fi(!this.paused);let{llhttp:e}=this,r;try{Tp=this,r=e.llhttp_finish(this.ptr)}finally{Tp=null}return r===WT.ERROR.OK?null:r===WT.ERROR.PAUSED||r===WT.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,hGn)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new uGn;let c=n.llhttp_get_error_reason(this.ptr),l="";if(c){let u=new Uint8Array(n.memory.buffer,c).indexOf(0);l="Response does not match the HTTP/1.1 protocol ("+Buffer.from(n.memory.buffer,c,u).toString()+")"}return new ZOs(l,WT.ERROR[e],r)}destroy(){Fi(Tp===null),Fi(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&flr.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){return this.statusText=e.toString(),0}onMessageBegin(){let{socket:e,client:r}=this;if(e.destroyed)return-1;if(r[Tm]===0)return Ci.destroy(e,new CX("bad response",Ci.getSocketInfo(e))),-1;let n=r[eD][r[cR]];return n?(n.onResponseStarted(),0):-1}onHeaderField(e){let r=this.headers.length;return(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length),0}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=Ci.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ci.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ci.destroy(this.socket,new KOs)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Fi(r),Fi(n[SX]===o),Fi(!o.destroyed),Fi(!this.paused),Fi((s.length&1)===0);let l=n[eD][n[cR]];Fi(l),Fi(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[Ed].destroy(),o[Ed]=null,o[hct]=null,o[Rv]=null,u5s(o),n[SX]=null,n[EGn]=null,n[eD][n[cR]++]=null,n.emit("disconnect",n[_Gn],[n],new She("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ci.destroy(o,u)}n[w8]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;if(o[Tm]===0)return Ci.destroy(s,new CX("bad response",Ci.getSocketInfo(s))),-1;let u=o[eD][o[cR]];if(!u)return-1;if(Fi(!this.upgrade),Fi(this.statusCode<200),e===100)return Ci.destroy(s,new CX("bad response",Ci.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ci.destroy(s,new CX("bad upgrade",Ci.getSocketInfo(s))),-1;if(Fi(this.timeoutType===The),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[Fb]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[a5s];this.setTimeout(f,pct)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Fi(o[Tm]===1),this.upgrade=!0,2;if(r)return Fi(o[Tm]===1),this.upgrade=!0,2;if(Fi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[fct]){let f=this.keepAlive?Ci.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[o5s],o[i5s]);h<=0?s[Fb]=!0:o[mct]=h}else o[mct]=o[e5s]}else s[Fb]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[tDe]&&(s[tDe]=!1,o[w8]()),d?WT.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[eD][r[cR]];return Fi(c),Fi(this.timeoutType===pct),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Fi(o>=200),s>-1&&this.bytesRead+e.length>s?(Ci.destroy(n,new XOs),-1):(this.bytesRead+=e.length,c.onData(e)===!1?WT.ERROR.PAUSED:0)}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return 0;Fi(n>=100),Fi((this.headers.length&1)===0);let d=e[eD][e[cR]];if(Fi(d),this.statusCode=0,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,n<200)return 0;if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return Ci.destroy(r,new uGn),-1;if(d.onComplete(s),e[eD][e[cR]++]=null,r[Elr]=e[_lr]===0,r[NH])return Fi(e[Tm]===0),Ci.destroy(r,new She("reset")),WT.ERROR.PAUSED;if(u){if(r[Fb]&&e[Tm]===0)return Ci.destroy(r,new She("reset")),WT.ERROR.PAUSED;e[fct]==null||e[fct]===1?setImmediate(e[w8]):e[w8]()}else return Ci.destroy(r,new She("reset")),WT.ERROR.PAUSED;return 0}};function mGn(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===The?(!r[NH]||r.writableNeedDrain||o[Tm]>1)&&(Fi(!s,"cannot be paused while waiting for headers"),Ci.destroy(r,new YOs)):n===pct?s||Ci.destroy(r,new JOs):n===Alr&&(Fi(o[Tm]===0&&o[mct]),Ci.destroy(r,new She("socket idle timeout")))}a(mGn,"onParserTimeout");function p5s(t,e){if(t[SX]=e,hlr||(hlr=d5s()),e.errored)throw e.errored;if(e.destroyed)throw new CX("destroyed");return e[X2e]=!1,e[NH]=!1,e[Fb]=!1,e[tDe]=!1,e[TX]=0,e[bX]=null,e[Elr]=!1,e[Ed]=new ylr(t,e,hlr),Ci.addListener(e,"error",h5s),Ci.addListener(e,"readable",m5s),Ci.addListener(e,"end",g5s),Ci.addListener(e,"close",A5s),e[glr]=!1,e.on("close",y5s),{version:"h1",defaultPipelining:1,write(r){return C5s(t,r)},resume(){E5s(t)},destroy(r,n){e[glr]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[NH]||e[Fb]||e[tDe]||e[TX]===1||r&&(t[Tm]>0&&!r.idempotent||t[Tm]>0&&(r.upgrade||r.method==="CONNECT")||t[Tm]>0&&Ci.bodyLength(r.body)!==0&&(Ci.isStream(r.body)||Ci.isAsyncIterable(r.body)||Ci.isFormDataLike(r.body))))}}}a(p5s,"connectH1");function h5s(t){Fi(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[Ed];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[Rv]=r,this[hct][pGn](r));return}this[Rv]=t,this[hct][pGn](t)}a(h5s,"onHttpSocketError");function m5s(){this[Ed]?.readMore()}a(m5s,"onHttpSocketReadable");function g5s(){let t=this[Ed];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Ci.destroy(this,e);return}Ci.destroy(this,new CX("other side closed",Ci.getSocketInfo(this)))}a(g5s,"onHttpSocketEnd");function A5s(){let t=this[Ed];vGn(this),t&&(!this[Rv]&&t.statusCode&&!t.shouldKeepAlive&&(this[Rv]=t.finish()||this[Rv]),this[Ed].destroy(),this[Ed]=null);let e=this[Rv]||new CX("closed",Ci.getSocketInfo(this)),r=this[hct];if(r[SX]=null,r[EGn]=null,r.destroyed){Fi(r[_lr]===0);let n=r[eD].splice(r[cR]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[eD][r[cR]];r[eD][r[cR]++]=null,Ci.errorRequest(r,n,e)}r[r5s]=r[cR],Fi(r[Tm]===0),r.emit("disconnect",r[_Gn],[r],e),r[w8]()}a(A5s,"onHttpSocketClose");function y5s(){this[glr]=!0}a(y5s,"onSocketClose");function vGn(t){t[bX]&&(clearTimeout(t[bX]),t[bX]=null),t[TX]=0}a(vGn,"clearIdleSocketValidation");function _5s(t,e){e[TX]=1,e[bX]=setTimeout(()=>{e[bX]=null,e[TX]=2,t[SX]===e&&!e.destroyed&&t[w8]()},0),e[bX].unref?.()}a(_5s,"scheduleIdleSocketValidation");function E5s(t){let e=t[SX];if(e&&!e.destroyed){if(t[dGn]===0?!e[X2e]&&e.unref&&(e.unref(),e[X2e]=!0):e[X2e]&&e.ref&&(e.ref(),e[X2e]=!1),t[Tm]===0&&t[_lr]>0&&e[Elr]){if(e[TX]===0)return _5s(t,e),e[Ed].readMore(),e.destroyed,void 0;if(e[TX]===1)return e[Ed].readMore(),e.destroyed,void 0}if(t[Tm]===0&&(e[Ed].readMore(),e.destroyed))return;if(t[dGn]===0)e[Ed].timeoutType!==Alr&&e[Ed].setTimeout(t[mct],Alr);else if(t[Tm]>0&&e[Ed].statusCode<200&&e[Ed].timeoutType!==The){let r=t[eD][t[cR]],n=r.headersTimeout!=null?r.headersTimeout:t[s5s];e[Ed].setTimeout(n,The)}}}a(E5s,"resumeH1");function v5s(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(v5s,"shouldSendContentLength");function C5s(t,e){let{method:r,path:n,host:o,upgrade:s,blocking:c,reset:l}=e,{body:u,headers:d,contentLength:f}=e,h=r==="PUT"||r==="POST"||r==="PATCH"||r==="QUERY"||r==="PROPFIND"||r==="PROPPATCH";if(Ci.isFormDataLike(u)){plr||(plr=bhe().extractBody);let[_,E]=plr(u);e.contentType==null&&d.push("content-type",E),u=_.stream,f=_.length}else if(Ci.isBlobLike(u)&&e.contentType==null){let _=u.type;if(_){let E=`${_}`;if(!Ci.isValidHeaderValue(E))return Ci.errorRequest(t,e,new zOs("invalid content-type header")),!1;d.push("content-type",E)}}u&&typeof u.read=="function"&&u.read(0);let m=Ci.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),v5s(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[mlr])return Ci.errorRequest(t,e,new vX),!1;process.emitWarning(new vX)}let g=t[SX];vGn(g);let A=a(_=>{e.aborted||e.completed||(Ci.errorRequest(t,e,_||new yGn),Ci.destroy(u),Ci.destroy(g,new She("aborted")))},"abort");try{e.onConnect(A)}catch(_){Ci.errorRequest(t,e,_)}if(e.aborted)return!1;r==="HEAD"&&(g[Fb]=!0),(s||r==="CONNECT")&&(g[Fb]=!0),l!=null&&(g[Fb]=l),t[fGn]&&g[c5s]++>=t[fGn]&&(g[Fb]=!0),c&&(g[tDe]=!0),g.setTypeOfService&&g.setTypeOfService(e.typeOfService);let y=`${r} ${n} HTTP/1.1\r +`);g.push(_),c+=_.byteLength,y&&(c=null),s=t,o=a(async function*(){for(let E of g)E.stream?yield*E.stream():yield E},"action"),l=`multipart/form-data; boundary=${d}`}else if(X2.is.Blob(t))s=t,c=t.size,t.type&&(l=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(flr.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=X2.is.ReadableStream(t)?t:kOs(t)}return(typeof s=="string"||LOs(s))&&(o=a(()=>(c=typeof s=="string"?Buffer.byteLength(s):s.length,s),"action")),o!=null&&(async()=>{let d=o(),f=d?.[Symbol.asyncIterator]?.();if(f)for await(let h of f){if(dlr(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!dlr(r)&&n.enqueue(typeof d=="string"?lct.encode(d):new Uint8Array(d));queueMicrotask(()=>POs(n))})(),[{stream:r,source:s,length:c},l]}a(cGn,"extractBody");function VOs(t,e=!1){return X2.is.ReadableStream(t)&&(ulr(!flr.isDisturbed(t),"The body has already been consumed."),ulr(!t.locked,"The stream is locked.")),cGn(t,e)}a(VOs,"safelyExtractBody");function WOs(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a(WOs,"cloneBody");function zOs(t,e){return{blob(){return bhe(this,n=>{let o=aGn(e(this));return o===null?o="":o&&(o=BOs(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return bhe(this,n=>new Uint8Array(n).buffer,t,e)},text(){return bhe(this,qOs,t,e)},json(){return bhe(this,QOs,t,e)},formData(){return bhe(this,n=>{let o=aGn(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=FOs(n,o),c=new sGn;return MOs(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new sGn;for(let[l,u]of s)c.append(l,u);return c}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t,e)},bytes(){return bhe(this,n=>new Uint8Array(n),t,e)}}}a(zOs,"bodyMixinMethods");function YOs(t,e){Object.assign(t.prototype,zOs(t,e))}a(YOs,"mixinBody");function bhe(t,e,r,n){try{X2.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),lGn(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=UOs(),s=o.reject,c=a(l=>{try{o.resolve(e(l))}catch(u){s(u)}},"successSteps");return t.body==null?(c(Buffer.allocUnsafe(0)),o.promise):(DOs(t.body,c,s),o.promise)}a(bhe,"consumeBody");function lGn(t){let e=t.body;return e!=null&&(e.stream.locked||flr.isDisturbed(e.stream))}a(lGn,"bodyUnusable");function aGn(t){let e=t.headersList,r=NOs(e);return r==="failure"?null:r}a(aGn,"bodyMimeType");uGn.exports={extractBody:cGn,safelyExtractBody:VOs,cloneBody:WOs,mixinBody:YOs,streamRegistry:$Os,bodyUnusable:lGn}});var TGn=I((Uyf,SGn)=>{"use strict";p();var Fi=require("node:assert"),Ci=No(),{channels:dGn}=kH(),plr=War(),{RequestContentLengthMismatchError:CX,ResponseContentLengthMismatchError:fGn,RequestAbortedError:EGn,InvalidArgumentError:KOs,HeadersTimeoutError:JOs,HeadersOverflowError:ZOs,SocketError:bX,InformationalError:The,BodyTimeoutError:XOs,HTTPParserError:e5s,ResponseExceededMaxSizeError:t5s}=uo(),{kUrl:vGn,kReset:Fb,kClient:hct,kParser:Ed,kBlocking:tDe,kRunning:Tm,kPending:Elr,kSize:pGn,kWriting:NH,kQueue:eD,kNoRef:X2e,kKeepAliveDefaultTimeout:r5s,kHostHeader:n5s,kPendingIdx:i5s,kRunningIdx:cR,kError:Rv,kPipelining:fct,kSocket:TX,kKeepAliveTimeoutValue:mct,kMaxHeadersSize:o5s,kKeepAliveMaxTimeout:s5s,kKeepAliveTimeoutThreshold:a5s,kHeadersTimeout:c5s,kBodyTimeout:l5s,kStrictContentLength:glr,kMaxRequests:hGn,kCounter:u5s,kMaxResponseSize:d5s,kOnError:mGn,kResume:w8,kHTTPContext:CGn,kClosed:Alr}=Al(),WT=uHn(),gGn=Buffer.alloc(0),uct=Buffer[Symbol.species],f5s=Ci.removeAllListeners,IX=Symbol("kIdleSocketValidation"),SX=Symbol("kIdleSocketValidationTimeout"),vlr=Symbol("kSocketUsed"),hlr;function p5s(){let t=process.env.JEST_WORKER_ID?Qcr():void 0,e,r=process.arch!=="ppc64";if(process.env.UNDICI_NO_WASM_SIMD==="1"?r=!1:process.env.UNDICI_NO_WASM_SIMD==="0"&&(r=!0),r)try{e=new WebAssembly.Module(pHn())}catch{}return e||(e=new WebAssembly.Module(t||Qcr())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Fi(Tp.ptr===n);let c=o-p4+f4.byteOffset;return Tp.onStatus(new uct(f4.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Fi(Tp.ptr===n),Tp.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Fi(Tp.ptr===n);let c=o-p4+f4.byteOffset;return Tp.onHeaderField(new uct(f4.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Fi(Tp.ptr===n);let c=o-p4+f4.byteOffset;return Tp.onHeaderValue(new uct(f4.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Fi(Tp.ptr===n),Tp.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Fi(Tp.ptr===n);let c=o-p4+f4.byteOffset;return Tp.onBody(new uct(f4.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Fi(Tp.ptr===n),Tp.onMessageComplete()),"wasm_on_message_complete")}})}a(p5s,"lazyllhttp");var mlr=null,Tp=null,f4=null,dct=0,p4=null,h5s=0,eDe=1,Ihe=2|eDe,pct=4|eDe,ylr=8|h5s,_lr=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(WT.TYPE.RESPONSE),this.client=e,this.socket=r,this.timeout=null,this.timeoutWeakRef=new WeakRef(this),this.timeoutValue=null,this.timeoutType=null,this.statusCode=0,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[o5s],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[d5s]}setTimeout(e,r){e!==this.timeoutValue||r&eDe^this.timeoutType&eDe?(this.timeout&&(plr.clearTimeout(this.timeout),this.timeout=null),e&&(r&eDe?this.timeout=plr.setFastTimeout(AGn,e,this.timeoutWeakRef):(this.timeout=setTimeout(AGn,e,this.timeoutWeakRef),this.timeout?.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(Fi(this.ptr!=null),Fi(Tp===null),this.llhttp.llhttp_resume(this.ptr),Fi(this.timeoutType===pct),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||gGn),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Fi(Tp===null),Fi(this.ptr!=null),Fi(!this.paused);let{socket:r,llhttp:n}=this;e.length>dct&&(p4&&n.free(p4),dct=Math.ceil(e.length/4096)*4096,p4=n.malloc(dct)),new Uint8Array(n.memory.buffer,p4,dct).set(e);try{let o;try{f4=e,Tp=this,o=n.llhttp_execute(this.ptr,p4,e.length)}finally{Tp=null,f4=null}if(o!==WT.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-p4);if(o===WT.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===WT.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Ci.destroy(r,o)}}finish(){Fi(Tp===null),Fi(this.ptr!=null),Fi(!this.paused);let{llhttp:e}=this,r;try{Tp=this,r=e.llhttp_finish(this.ptr)}finally{Tp=null}return r===WT.ERROR.OK?null:r===WT.ERROR.PAUSED||r===WT.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,gGn)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new fGn;let c=n.llhttp_get_error_reason(this.ptr),l="";if(c){let u=new Uint8Array(n.memory.buffer,c).indexOf(0);l="Response does not match the HTTP/1.1 protocol ("+Buffer.from(n.memory.buffer,c,u).toString()+")"}return new e5s(l,WT.ERROR[e],r)}destroy(){Fi(Tp===null),Fi(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&plr.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){return this.statusText=e.toString(),0}onMessageBegin(){let{socket:e,client:r}=this;if(e.destroyed)return-1;if(r[Tm]===0)return Ci.destroy(e,new bX("bad response",Ci.getSocketInfo(e))),-1;let n=r[eD][r[cR]];return n?(n.onResponseStarted(),0):-1}onHeaderField(e){let r=this.headers.length;return(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length),0}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=Ci.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ci.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ci.destroy(this.socket,new ZOs)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Fi(r),Fi(n[TX]===o),Fi(!o.destroyed),Fi(!this.paused),Fi((s.length&1)===0);let l=n[eD][n[cR]];Fi(l),Fi(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[Ed].destroy(),o[Ed]=null,o[hct]=null,o[Rv]=null,f5s(o),n[TX]=null,n[CGn]=null,n[eD][n[cR]++]=null,n.emit("disconnect",n[vGn],[n],new The("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ci.destroy(o,u)}n[w8]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;if(o[Tm]===0)return Ci.destroy(s,new bX("bad response",Ci.getSocketInfo(s))),-1;let u=o[eD][o[cR]];if(!u)return-1;if(Fi(!this.upgrade),Fi(this.statusCode<200),e===100)return Ci.destroy(s,new bX("bad response",Ci.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ci.destroy(s,new bX("bad upgrade",Ci.getSocketInfo(s))),-1;if(Fi(this.timeoutType===Ihe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[Fb]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[l5s];this.setTimeout(f,pct)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Fi(o[Tm]===1),this.upgrade=!0,2;if(r)return Fi(o[Tm]===1),this.upgrade=!0,2;if(Fi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[fct]){let f=this.keepAlive?Ci.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[a5s],o[s5s]);h<=0?s[Fb]=!0:o[mct]=h}else o[mct]=o[r5s]}else s[Fb]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[tDe]&&(s[tDe]=!1,o[w8]()),d?WT.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[eD][r[cR]];return Fi(c),Fi(this.timeoutType===pct),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Fi(o>=200),s>-1&&this.bytesRead+e.length>s?(Ci.destroy(n,new t5s),-1):(this.bytesRead+=e.length,c.onData(e)===!1?WT.ERROR.PAUSED:0)}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return 0;Fi(n>=100),Fi((this.headers.length&1)===0);let d=e[eD][e[cR]];if(Fi(d),this.statusCode=0,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,n<200)return 0;if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return Ci.destroy(r,new fGn),-1;if(d.onComplete(s),e[eD][e[cR]++]=null,r[vlr]=e[Elr]===0,r[NH])return Fi(e[Tm]===0),Ci.destroy(r,new The("reset")),WT.ERROR.PAUSED;if(u){if(r[Fb]&&e[Tm]===0)return Ci.destroy(r,new The("reset")),WT.ERROR.PAUSED;e[fct]==null||e[fct]===1?setImmediate(e[w8]):e[w8]()}else return Ci.destroy(r,new The("reset")),WT.ERROR.PAUSED;return 0}};function AGn(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===Ihe?(!r[NH]||r.writableNeedDrain||o[Tm]>1)&&(Fi(!s,"cannot be paused while waiting for headers"),Ci.destroy(r,new JOs)):n===pct?s||Ci.destroy(r,new XOs):n===ylr&&(Fi(o[Tm]===0&&o[mct]),Ci.destroy(r,new The("socket idle timeout")))}a(AGn,"onParserTimeout");function m5s(t,e){if(t[TX]=e,mlr||(mlr=p5s()),e.errored)throw e.errored;if(e.destroyed)throw new bX("destroyed");return e[X2e]=!1,e[NH]=!1,e[Fb]=!1,e[tDe]=!1,e[IX]=0,e[SX]=null,e[vlr]=!1,e[Ed]=new _lr(t,e,mlr),Ci.addListener(e,"error",g5s),Ci.addListener(e,"readable",A5s),Ci.addListener(e,"end",y5s),Ci.addListener(e,"close",_5s),e[Alr]=!1,e.on("close",E5s),{version:"h1",defaultPipelining:1,write(r){return S5s(t,r)},resume(){C5s(t)},destroy(r,n){e[Alr]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[NH]||e[Fb]||e[tDe]||e[IX]===1||r&&(t[Tm]>0&&!r.idempotent||t[Tm]>0&&(r.upgrade||r.method==="CONNECT")||t[Tm]>0&&Ci.bodyLength(r.body)!==0&&(Ci.isStream(r.body)||Ci.isAsyncIterable(r.body)||Ci.isFormDataLike(r.body))))}}}a(m5s,"connectH1");function g5s(t){Fi(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[Ed];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[Rv]=r,this[hct][mGn](r));return}this[Rv]=t,this[hct][mGn](t)}a(g5s,"onHttpSocketError");function A5s(){this[Ed]?.readMore()}a(A5s,"onHttpSocketReadable");function y5s(){let t=this[Ed];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Ci.destroy(this,e);return}Ci.destroy(this,new bX("other side closed",Ci.getSocketInfo(this)))}a(y5s,"onHttpSocketEnd");function _5s(){let t=this[Ed];bGn(this),t&&(!this[Rv]&&t.statusCode&&!t.shouldKeepAlive&&(this[Rv]=t.finish()||this[Rv]),this[Ed].destroy(),this[Ed]=null);let e=this[Rv]||new bX("closed",Ci.getSocketInfo(this)),r=this[hct];if(r[TX]=null,r[CGn]=null,r.destroyed){Fi(r[Elr]===0);let n=r[eD].splice(r[cR]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[eD][r[cR]];r[eD][r[cR]++]=null,Ci.errorRequest(r,n,e)}r[i5s]=r[cR],Fi(r[Tm]===0),r.emit("disconnect",r[vGn],[r],e),r[w8]()}a(_5s,"onHttpSocketClose");function E5s(){this[Alr]=!0}a(E5s,"onSocketClose");function bGn(t){t[SX]&&(clearTimeout(t[SX]),t[SX]=null),t[IX]=0}a(bGn,"clearIdleSocketValidation");function v5s(t,e){e[IX]=1,e[SX]=setTimeout(()=>{e[SX]=null,e[IX]=2,t[TX]===e&&!e.destroyed&&t[w8]()},0),e[SX].unref?.()}a(v5s,"scheduleIdleSocketValidation");function C5s(t){let e=t[TX];if(e&&!e.destroyed){if(t[pGn]===0?!e[X2e]&&e.unref&&(e.unref(),e[X2e]=!0):e[X2e]&&e.ref&&(e.ref(),e[X2e]=!1),t[Tm]===0&&t[Elr]>0&&e[vlr]){if(e[IX]===0)return v5s(t,e),e[Ed].readMore(),e.destroyed,void 0;if(e[IX]===1)return e[Ed].readMore(),e.destroyed,void 0}if(t[Tm]===0&&(e[Ed].readMore(),e.destroyed))return;if(t[pGn]===0)e[Ed].timeoutType!==ylr&&e[Ed].setTimeout(t[mct],ylr);else if(t[Tm]>0&&e[Ed].statusCode<200&&e[Ed].timeoutType!==Ihe){let r=t[eD][t[cR]],n=r.headersTimeout!=null?r.headersTimeout:t[c5s];e[Ed].setTimeout(n,Ihe)}}}a(C5s,"resumeH1");function b5s(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(b5s,"shouldSendContentLength");function S5s(t,e){let{method:r,path:n,host:o,upgrade:s,blocking:c,reset:l}=e,{body:u,headers:d,contentLength:f}=e,h=r==="PUT"||r==="POST"||r==="PATCH"||r==="QUERY"||r==="PROPFIND"||r==="PROPPATCH";if(Ci.isFormDataLike(u)){hlr||(hlr=She().extractBody);let[_,E]=hlr(u);e.contentType==null&&d.push("content-type",E),u=_.stream,f=_.length}else if(Ci.isBlobLike(u)&&e.contentType==null){let _=u.type;if(_){let E=`${_}`;if(!Ci.isValidHeaderValue(E))return Ci.errorRequest(t,e,new KOs("invalid content-type header")),!1;d.push("content-type",E)}}u&&typeof u.read=="function"&&u.read(0);let m=Ci.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),b5s(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[glr])return Ci.errorRequest(t,e,new CX),!1;process.emitWarning(new CX)}let g=t[TX];bGn(g);let A=a(_=>{e.aborted||e.completed||(Ci.errorRequest(t,e,_||new EGn),Ci.destroy(u),Ci.destroy(g,new The("aborted")))},"abort");try{e.onConnect(A)}catch(_){Ci.errorRequest(t,e,_)}if(e.aborted)return!1;r==="HEAD"&&(g[Fb]=!0),(s||r==="CONNECT")&&(g[Fb]=!0),l!=null&&(g[Fb]=l),t[hGn]&&g[u5s]++>=t[hGn]&&(g[Fb]=!0),c&&(g[tDe]=!0),g.setTypeOfService&&g.setTypeOfService(e.typeOfService);let y=`${r} ${n} HTTP/1.1\r `;if(typeof o=="string"?y+=`host: ${o}\r -`:y+=t[t5s],s?y+=`connection: upgrade\r +`:y+=t[n5s],s?y+=`connection: upgrade\r upgrade: ${s}\r `:t[fct]&&!g[Fb]?y+=`connection: keep-alive\r `:y+=`connection: close\r `,Array.isArray(d))for(let _=0;_{e.removeListener("error",g)}),!u){let A=new yGn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Fi(o.destroyed||o[NH]&&r[Tm]<=1),o.off("drain",h).off("error",g),e.removeListener("data",f).removeListener("end",g).removeListener("close",m),!A)try{d.end()}catch(y){A=y}d.destroy(A),A&&(A.code!=="UND_ERR_INFO"||A.message!=="reset")?Ci.destroy(e,A):Ci.destroy(e)}},"onFinished");e.on("data",f).on("end",g).on("error",g).on("close",m),e.resume&&e.resume(),o.on("drain",h).on("error",g),e.errorEmitted??e.errored?setImmediate(g,e.errored):(e.endEmitted??e.readableEnded)&&setImmediate(g,null),(e.closeEmitted??e.closed)&&setImmediate(m)}a(b5s,"writeStream");function gGn(t,e,r,n,o,s,c,l){try{e?Ci.isBuffer(e)&&(Fi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return dGn.sendHeaders.hasSubscribers&&dGn.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?yGn(A,null,t,e,g,f,y,h):Ci.isBuffer(u)?yGn(A,u,t,e,g,f,y,h):Ci.isBlobLike(u)?typeof u.stream=="function"?_Gn(A,u.stream(),t,e,g,f,y,h):I5s(A,u,t,e,g,f,y,h):Ci.isStream(u)?T5s(A,u,t,e,g,f,y,h):Ci.isIterable(u)?_Gn(A,u,t,e,g,f,y,h):Fi(!1),!0}a(S5s,"writeH1");function T5s(t,e,r,n,o,s,c,l){Fi(s!==0||r[Tm]===0,"stream body cannot be pipelined");let u=!1,d=new gct({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c}),f=a(function(A){if(!u)try{!d.write(A)&&this.pause&&this.pause()}catch(y){Ci.destroy(this,y)}},"onData"),h=a(function(){u||e.resume&&e.resume()},"onDrain"),m=a(function(){if(queueMicrotask(()=>{e.removeListener("error",g)}),!u){let A=new EGn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Fi(o.destroyed||o[NH]&&r[Tm]<=1),o.off("drain",h).off("error",g),e.removeListener("data",f).removeListener("end",g).removeListener("close",m),!A)try{d.end()}catch(y){A=y}d.destroy(A),A&&(A.code!=="UND_ERR_INFO"||A.message!=="reset")?Ci.destroy(e,A):Ci.destroy(e)}},"onFinished");e.on("data",f).on("end",g).on("error",g).on("close",m),e.resume&&e.resume(),o.on("drain",h).on("error",g),e.errorEmitted??e.errored?setImmediate(g,e.errored):(e.endEmitted??e.readableEnded)&&setImmediate(g,null),(e.closeEmitted??e.closed)&&setImmediate(m)}a(T5s,"writeStream");function yGn(t,e,r,n,o,s,c,l){try{e?Ci.isBuffer(e)&&(Fi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r \r `,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[Fb]=!0)):s===0?o.write(`${c}content-length: 0\r \r `,"latin1"):(Fi(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[w8]()}catch(u){t(u)}}a(gGn,"writeBuffer");async function S5s(t,e,r,n,o,s,c,l){Fi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new vX;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r +`,"latin1")),n.onRequestSent(),r[w8]()}catch(u){t(u)}}a(yGn,"writeBuffer");async function I5s(t,e,r,n,o,s,c,l){Fi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new CX;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r \r -`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[Fb]=!0),r[w8]()}catch(u){t(u)}}a(S5s,"writeBlob");async function AGn(t,e,r,n,o,s,c,l){Fi(s!==0||r[Tm]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{Fi(u===null),o[Rv]?g(o[Rv]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new gct({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[Rv])throw o[Rv];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(AGn,"writeIterable");var gct=class{static{a(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:o,client:s,expectsPayload:c,header:l}){this.socket=r,this.request=n,this.contentLength=o,this.client=s,this.bytesWritten=0,this.expectsPayload=c,this.header=l,this.abort=e,r[NH]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[Rv])throw r[Rv];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[mlr])throw new vX;process.emitWarning(new vX)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[Fb]=!0),o===null?r.write(`${u}transfer-encoding: chunked\r +`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[Fb]=!0),r[w8]()}catch(u){t(u)}}a(I5s,"writeBlob");async function _Gn(t,e,r,n,o,s,c,l){Fi(s!==0||r[Tm]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{Fi(u===null),o[Rv]?g(o[Rv]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new gct({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[Rv])throw o[Rv];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(_Gn,"writeIterable");var gct=class{static{a(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:o,client:s,expectsPayload:c,header:l}){this.socket=r,this.request=n,this.contentLength=o,this.client=s,this.bytesWritten=0,this.expectsPayload=c,this.header=l,this.abort=e,r[NH]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[Rv])throw r[Rv];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[glr])throw new CX;process.emitWarning(new CX)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[Fb]=!0),o===null?r.write(`${u}transfer-encoding: chunked\r `,"latin1"):r.write(`${u}content-length: ${o}\r \r `,"latin1")),o===null&&r.write(`\r ${d.toString(16)}\r -`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[Ed].timeout&&r[Ed].timeoutType===The&&r[Ed].timeout.refresh&&r[Ed].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[NH]=!1,e[Rv])throw e[Rv];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r +`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[Ed].timeout&&r[Ed].timeoutType===Ihe&&r[Ed].timeout.refresh&&r[Ed].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[NH]=!1,e[Rv])throw e[Rv];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r \r `,"latin1"):e.write(`${c}\r `,"latin1"):r===null&&e.write(`\r 0\r \r -`,"latin1"),r!==null&&o!==r){if(n[mlr])throw new vX;process.emitWarning(new vX)}e[Ed].timeout&&e[Ed].timeoutType===The&&e[Ed].timeout.refresh&&e[Ed].timeout.refresh(),n[w8]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[NH]=!1,e&&(Fi(n[Tm]<=1,"pipeline should only contain this request"),o(e))}};CGn.exports=p5s});var DGn=I((Qyf,PGn)=>{"use strict";p();var uR=require("node:assert"),{pipeline:T5s}=require("node:stream"),bs=No(),{RequestContentLengthMismatchError:Slr,RequestAbortedError:I5s,SocketError:oDe,InformationalError:MH,InvalidArgumentError:x5s}=uo(),{kUrl:iDe,kReset:Ect,kClient:zT,kRunning:sDe,kPending:w5s,kQueue:OH,kPendingIdx:Ilr,kRunningIdx:tD,kError:YT,kSocket:Bf,kStrictContentLength:R5s,kOnError:Ihe,kMaxConcurrentStreams:yct,kPingInterval:SGn,kHTTP2Session:R8,kHTTP2InitialWindowSize:k5s,kHTTP2ConnectionWindowSize:P5s,kResume:h4,kSize:D5s,kHTTPContext:xlr,kClosed:Tlr,kBodyTimeout:N5s,kEnableConnectProtocol:rDe,kRemoteSettings:nDe,kHTTP2Stream:Act,kHTTP2SessionState:wlr}=Al(),{channels:TGn}=kH(),lR=Symbol("open streams"),IGn,_ct;try{_ct=require("node:http2")}catch{_ct={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:M5s,HTTP2_HEADER_METHOD:xGn,HTTP2_HEADER_PATH:wGn,HTTP2_HEADER_SCHEME:vlr,HTTP2_HEADER_CONTENT_LENGTH:O5s,HTTP2_HEADER_EXPECT:L5s,HTTP2_HEADER_STATUS:Clr,HTTP2_HEADER_PROTOCOL:B5s,NGHTTP2_REFUSED_STREAM:F5s,NGHTTP2_CANCEL:U5s}}=_ct;function blr(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.push(Buffer.from(r),Buffer.from(o));else e.push(Buffer.from(r),Buffer.from(n));return e}a(blr,"parseH2Headers");function Q5s(t,e){t[Bf]=e;let r=t[k5s],n=t[P5s],o=_ct.connect(t[iDe],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[yct],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[Bf]=e,o[lR]=0,o[zT]=t,o[Bf]=e,o[wlr]={ping:{interval:t[SGn]===0?null:setInterval(G5s,t[SGn],o).unref()}},o[rDe]=!1,o[nDe]=!1,n&&bs.addListener(o,"connect",j5s.bind(o,n)),bs.addListener(o,"error",$5s),bs.addListener(o,"frameError",V5s),bs.addListener(o,"end",W5s),bs.addListener(o,"goaway",z5s),bs.addListener(o,"close",Y5s),bs.addListener(o,"remoteSettings",H5s),o.unref(),t[R8]=o,e[R8]=o,bs.addListener(e,"error",J5s),bs.addListener(e,"end",Z5s),bs.addListener(e,"close",K5s),e[Tlr]=!1,e.on("close",X5s),{version:"h2",defaultPipelining:1/0,write(s){return t4s(t,s)},resume(){q5s(t)},destroy(s,c){e[Tlr]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[sDe]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[nDe]===!1||bs.bodyLength(s.body)!==0&&(bs.isStream(s.body)||bs.isAsyncIterable(s.body)||bs.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[nDe]===!1;return!1}}}a(Q5s,"connectH2");function q5s(t){let e=t[Bf];e?.destroyed===!1&&(t[D5s]===0||t[yct]===0?(e.unref(),t[R8].unref()):(e.ref(),t[R8].ref()))}a(q5s,"resumeH2");function j5s(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(j5s,"applyConnectionWindowSize");function H5s(t){if(this[zT][yct]=t.maxConcurrentStreams??this[zT][yct],this[nDe]===!0&&this[rDe]===!0&&t.enableConnectProtocol===!1){let e=new MH("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[Bf][YT]=e,this[zT][Ihe](e);return}this[rDe]=t.enableConnectProtocol??this[rDe],this[nDe]=!0,this[zT][h4]()}a(H5s,"onHttp2RemoteSettings");function G5s(t){let e=t[wlr];if((t.closed||t.destroyed)&&e.ping.interval!=null){clearInterval(e.ping.interval),e.ping.interval=null;return}t.ping(r.bind(t));function r(n,o){let s=this[zT],c=this[zT];if(n!=null){let l=new MH(`HTTP/2: "PING" errored - type ${n.message}`);c[YT]=l,s[Ihe](l)}else s.emit("ping",o)}a(r,"onPing")}a(G5s,"onHttp2SendPing");function $5s(t){uR(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Bf][YT]=t,this[zT][Ihe](t)}a($5s,"onHttp2SessionError");function V5s(t,e,r){if(r===0){let n=new MH(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[Bf][YT]=n,this[zT][Ihe](n)}}a(V5s,"onHttp2FrameError");function W5s(){let t=new oDe("other side closed",bs.getSocketInfo(this[Bf]));this.destroy(t),bs.destroy(this[Bf],t)}a(W5s,"onHttp2SessionEnd");function z5s(t){let e=this[YT]||new oDe(`HTTP/2: "GOAWAY" frame received with code ${t}`,bs.getSocketInfo(this[Bf])),r=this[zT];if(r[Bf]=null,r[xlr]=null,this.close(),this[R8]=null,bs.destroy(this[Bf],e),r[tD]{e.aborted||e.completed||(x=x||new I5s,bs.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[Ihe](x),t[h4]()),bs.destroy(m,x))},"abort");try{e.onConnect(E)}catch(x){bs.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[rDe]===!1?(bs.errorRequest(t,e,new MH("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[xGn]="CONNECT",g[B5s]="websocket",g[wGn]=s,f==="ws:"||f==="wss:"?g[vlr]=f==="ws:"?"http":"https":g[vlr]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[Act]=!0,A.once("response",(x,k)=>{let{[Clr]:D,...N}=x;e.onUpgrade(D,blr(N),A),++n[lR],t[OH][t[tD]++]=null}),A.on("error",()=>{(A.rstCode===F5s||A.rstCode===U5s)&&E(new MH(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[lR]-=1,n[lR]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[Act]=!0,A.on("response",x=>{let{[Clr]:k,...D}=x;e.onUpgrade(k,blr(D),A),++n[lR],t[OH][t[tD]++]=null}),A.once("close",()=>{n[lR]-=1,n[lR]===0&&n.unref()}),A.setTimeout(r),!0);g[wGn]=s,g[vlr]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let S=bs.bodyLength(m);if(bs.isFormDataLike(m)){IGn??=bhe().extractBody;let[x,k]=IGn(m);g["content-type"]=k,m=x.stream,S=x.length}if(S==null&&(S=e.contentLength),v||(S=null),e4s(o)&&S>0&&e.contentLength!=null&&e.contentLength!==S){if(t[R5s])return bs.errorRequest(t,e,new Slr),!1;process.emitWarning(new Slr)}if(S!=null&&(uR(m||S===0,"no body must not have content length"),g[O5s]=`${S}`),n.ref(),TGn.sendHeaders.hasSubscribers){let x="";for(let k in g)x+=`${k}: ${g[k]}\r -`;TGn.sendHeaders.publish({request:e,headers:x,socket:n[Bf]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[L5s]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[Act]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[Act]=!0,R()),++n[lR],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[Clr]:k,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(k),blr(D),A.resume.bind(A),"")===!1&&A.pause(),A.on("data",N=>{e.aborted||e.completed||e.onData(N)===!1&&A.pause()})}),A.once("end",()=>{A.removeAllListeners("data"),w?(!e.aborted&&!e.completed&&e.onComplete({}),t[OH][t[tD]++]=null,t[h4]()):(E(new MH("HTTP/2: stream half-closed (remote)")),t[OH][t[tD]++]=null,t[Ilr]=t[tD],t[h4]())}),A.once("close",()=>{A.removeAllListeners("data"),n[lR]-=1,n[lR]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),E(x)}),A.once("frameError",(x,k)=>{A.removeAllListeners("data"),E(new MH(`HTTP/2: "frameError" received - type ${x}, code ${k}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new MH(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[lR]-=1,n[lR]===0&&n.unref(),E(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||S===0?RGn(E,A,null,t,e,t[Bf],S,v):bs.isBuffer(m)?RGn(E,A,m,t,e,t[Bf],S,v):bs.isBlobLike(m)?typeof m.stream=="function"?kGn(E,A,m.stream(),t,e,t[Bf],S,v):n4s(E,A,m,t,e,t[Bf],S,v):bs.isStream(m)?r4s(E,t[Bf],v,A,m,t,e,S):bs.isIterable(m)?kGn(E,A,m,t,e,t[Bf],S,v):uR(!1)}a(R,"writeBodyH2")}a(t4s,"writeH2");function RGn(t,e,r,n,o,s,c,l){try{r!=null&&bs.isBuffer(r)&&(uR(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Ect]=!0),o.onRequestSent(),n[h4]()}catch(u){t(u)}}a(RGn,"writeBuffer");function r4s(t,e,r,n,o,s,c,l){uR(l!==0||s[sDe]===0,"stream body cannot be pipelined");let u=T5s(o,n,f=>{f?(bs.destroy(u,f),t(f)):(bs.removeAllListeners(u),c.onRequestSent(),r||(e[Ect]=!0),s[h4]())});bs.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(r4s,"writeStream");async function n4s(t,e,r,n,o,s,c,l){uR(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new Slr;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Ect]=!0),n[h4]()}catch(u){t(u)}}a(n4s,"writeBlob");async function kGn(t,e,r,n,o,s,c,l){uR(c!==0||n[sDe]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let h=u;u=null,h()}}a(d,"onDrain");let f=a(()=>new Promise((h,m)=>{uR(u===null),s[YT]?m(s[YT]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[YT])throw s[YT];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Ect]=!0),n[h4]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(kGn,"writeIterable");PGn.exports=Q5s});var UH=I((Hyf,QGn)=>{"use strict";p();var k8=require("node:assert"),LGn=require("node:net"),aDe=require("node:http"),IX=No(),{ClientStats:i4s}=vcr(),{channels:xhe}=kH(),o4s=Kjn(),s4s=gX(),{InvalidArgumentError:vd,InformationalError:a4s,ClientDestroyedError:c4s}=uo(),l4s=AX(),{kUrl:m4,kServerName:FH,kClient:u4s,kBusy:klr,kConnect:d4s,kResuming:xX,kRunning:dDe,kPending:fDe,kSize:cDe,kQueue:rD,kConnected:f4s,kConnecting:whe,kNeedDrain:BH,kKeepAliveDefaultTimeout:NGn,kHostHeader:p4s,kPendingIdx:nD,kRunningIdx:D8,kError:h4s,kPipelining:vct,kKeepAliveTimeoutValue:m4s,kMaxHeadersSize:g4s,kKeepAliveMaxTimeout:A4s,kKeepAliveTimeoutThreshold:y4s,kHeadersTimeout:_4s,kBodyTimeout:E4s,kStrictContentLength:v4s,kConnector:lDe,kMaxRequests:Plr,kCounter:C4s,kClose:b4s,kDestroy:S4s,kDispatch:T4s,kLocalAddress:uDe,kMaxResponseSize:I4s,kOnError:x4s,kHTTPContext:_h,kMaxConcurrentStreams:w4s,kHTTP2InitialWindowSize:R4s,kHTTP2ConnectionWindowSize:k4s,kResume:P8,kPingInterval:P4s}=Al(),D4s=bGn(),N4s=DGn(),LH=Symbol("kClosedResolve"),M4s=aDe&&aDe.maxHeaderSize&&Number.isInteger(aDe.maxHeaderSize)&&aDe.maxHeaderSize>0?()=>aDe.maxHeaderSize:()=>{throw new vd("http module not available or http.maxHeaderSize invalid")},MGn=a(()=>{},"noop");function BGn(t){return t[vct]??t[_h]?.defaultPipelining??1}a(BGn,"getPipelining");var Dlr=class extends s4s{static{a(this,"Client")}constructor(e,{maxHeaderSize:r,headersTimeout:n,socketTimeout:o,requestTimeout:s,connectTimeout:c,bodyTimeout:l,idleTimeout:u,keepAlive:d,keepAliveTimeout:f,maxKeepAliveTimeout:h,keepAliveMaxTimeout:m,keepAliveTimeoutThreshold:g,socketPath:A,pipelining:y,tls:_,strictContentLength:E,maxCachedSessions:v,connect:S,maxRequestsPerClient:T,localAddress:w,maxResponseSize:R,autoSelectFamily:x,autoSelectFamilyAttemptTimeout:k,maxConcurrentStreams:D,allowH2:N,useH2c:O,initialWindowSize:B,connectionWindowSize:q,pingInterval:M,webSocket:L}={}){if(d!==void 0)throw new vd("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new vd("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new vd("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new vd("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new vd("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new vd("invalid maxHeaderSize")}else r=M4s();if(A!=null&&typeof A!="string")throw new vd("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new vd("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new vd("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new vd("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new vd("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new vd("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new vd("bodyTimeout must be a positive integer or zero");if(S!=null&&typeof S!="function"&&typeof S!="object")throw new vd("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new vd("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||LGn.isIP(w)===0))throw new vd("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new vd("maxResponseSize must be a positive number");if(k!=null&&(!Number.isInteger(k)||k<-1))throw new vd("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new vd("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new vd("maxConcurrentStreams must be a positive integer, greater than 0");if(O!=null&&typeof O!="boolean")throw new vd("useH2c must be a valid boolean value");if(B!=null&&(!Number.isInteger(B)||B<1))throw new vd("initialWindowSize must be a positive integer, greater than 0");if(q!=null&&(!Number.isInteger(q)||q<1))throw new vd("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new vd("pingInterval must be a positive integer, greater or equal to 0");if(super({webSocket:L}),typeof S!="function")S=l4s({..._,maxCachedSessions:v,allowH2:N,useH2c:O,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:k}:void 0,...S});else{let U=S;S=a((j,Q)=>U({...j,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},Q),"connect")}this[m4]=IX.parseOrigin(e),this[lDe]=S,this[vct]=y??1,this[g4s]=r,this[NGn]=f??4e3,this[A4s]=m??6e5,this[y4s]=g??2e3,this[m4s]=this[NGn],this[FH]=null,this[uDe]=w??null,this[xX]=0,this[BH]=0,this[p4s]=`host: ${this[m4].hostname}${this[m4].port?`:${this[m4].port}`:""}\r -`,this[E4s]=l??3e5,this[_4s]=n??3e5,this[v4s]=E??!0,this[Plr]=T,this[LH]=null,this[I4s]=R>-1?R:-1,this[_h]=null,this[w4s]=D??100,this[R4s]=B??262144,this[k4s]=q??524288,this[P4s]=M??6e4,this[rD]=[],this[D8]=0,this[nD]=0,this[P8]=U=>Nlr(this,U),this[x4s]=U=>FGn(this,U)}get pipelining(){return this[vct]}set pipelining(e){this[vct]=e,this[P8](!0)}get stats(){return new i4s(this)}get[fDe](){return this[rD].length-this[nD]}get[dDe](){return this[nD]-this[D8]}get[cDe](){return this[rD].length-this[D8]}get[f4s](){return!!this[_h]&&!this[whe]&&!this[_h].destroyed}get[klr](){return!!(this[_h]?.busy(null)||this[cDe]>=(BGn(this)||1)||this[fDe]>0)}[d4s](e){UGn(this),this.once("connect",e)}[T4s](e,r){let n=new o4s(this[m4].origin,e,r);return this[rD].push(n),this[xX]||(IX.bodyLength(n.body)==null&&IX.isIterable(n.body)?(this[xX]=1,queueMicrotask(()=>Nlr(this))):this[P8](!0)),this[xX]&&this[BH]!==2&&this[klr]&&(this[BH]=2),this[BH]<2}[b4s](){return new Promise(e=>{this[cDe]?this[LH]=e:e(null)})}[S4s](e){return new Promise(r=>{let n=this[rD].splice(this[nD]);for(let s=0;s{this[LH]&&(this[LH](),this[LH]=null),r(null)},"callback");this[_h]?(this[_h].destroy(e,o),this[_h]=null):queueMicrotask(o),this[P8]()})}};function FGn(t,e){if(t[dDe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){k8(t[nD]===t[D8]);let r=t[rD].splice(t[D8]);for(let n=0;n{if(s){Rlr(t,s,{host:e,hostname:r,protocol:n,port:o}),t[P8]();return}if(t.destroyed){IX.destroy(c.on("error",MGn),new c4s),t[P8]();return}k8(c);try{t[_h]=c.alpnProtocol==="h2"?N4s(t,c):D4s(t,c)}catch(l){c.destroy().on("error",MGn),Rlr(t,l,{host:e,hostname:r,protocol:n,port:o}),t[P8]();return}t[whe]=!1,c[C4s]=0,c[Plr]=t[Plr],c[u4s]=t,c[h4s]=null,xhe.connected.hasSubscribers&&xhe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[_h]?.version,servername:t[FH],localAddress:t[uDe]},connector:t[lDe],socket:c}),t.emit("connect",t[m4],[t]),t[P8]()})}catch(s){Rlr(t,s,{host:e,hostname:r,protocol:n,port:o}),t[P8]()}}a(UGn,"connect");function Rlr(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[whe]=!1,xhe.connectError.hasSubscribers&&xhe.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[_h]?.version,servername:t[FH],localAddress:t[uDe]},connector:t[lDe],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(k8(t[dDe]===0);t[fDe]>0&&t[rD][t[nD]].servername===t[FH];){let c=t[rD][t[nD]++];IX.errorRequest(t,c,e)}else FGn(t,e);t.emit("connectionError",t[m4],[t],e)}}a(Rlr,"handleConnectError");function OGn(t){t[BH]=0,t.emit("drain",t[m4],[t])}a(OGn,"emitDrain");function Nlr(t,e){t[xX]!==2&&(t[xX]=2,O4s(t,e),t[xX]=0,t[D8]>256&&(t[rD].splice(0,t[D8]),t[nD]-=t[D8],t[D8]=0))}a(Nlr,"resume");function O4s(t,e){for(;;){if(t.destroyed){k8(t[fDe]===0);return}if(t[LH]&&!t[cDe]){t[LH](),t[LH]=null;return}if(t[_h]&&t[_h].resume(),t[klr])t[BH]=2;else if(t[BH]===2){e?(t[BH]=1,queueMicrotask(()=>OGn(t))):OGn(t);continue}if(t[fDe]===0||t[dDe]>=(BGn(t)||1))return;let r=t[rD][t[nD]];if(r===null)return;if(t[m4].protocol==="https:"&&t[FH]!==r.servername){if(t[dDe]>0)return;t[FH]=r.servername,t[_h]?.destroy(new a4s("servername changed"),()=>{t[_h]=null,Nlr(t)})}if(t[whe])return;if(!t[_h]){UGn(t);return}if(t[_h].destroyed||t[_h].busy(r))return;!r.aborted&&t[_h].write(r)?t[nD]++:t[rD].splice(t[nD],1)}}a(O4s,"_resume");QGn.exports=Dlr});var Mlr=I((Wyf,qGn)=>{"use strict";p();var Cct=class{static{a(this,"FixedCircularBuffer")}bottom=0;top=0;list=new Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};qGn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Cct}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Cct),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),r}}});var bct=I((Kyf,KGn)=>{"use strict";p();var{PoolStats:L4s}=vcr(),B4s=gX(),F4s=Mlr(),{kConnected:Olr,kSize:jGn,kRunning:HGn,kPending:GGn,kQueued:pDe,kBusy:U4s,kFree:Q4s,kUrl:q4s,kClose:j4s,kDestroy:H4s,kDispatch:G4s}=Al(),G0=Symbol("clients"),kv=Symbol("needDrain"),hDe=Symbol("queue"),Llr=Symbol("closed resolve"),Blr=Symbol("onDrain"),$Gn=Symbol("onConnect"),VGn=Symbol("onDisconnect"),WGn=Symbol("onConnectionError"),Flr=Symbol("get dispatcher"),zGn=Symbol("add client"),YGn=Symbol("remove client"),Ulr=class extends B4s{static{a(this,"PoolBase")}[hDe]=new F4s;[pDe]=0;[G0]=[];[kv]=!1;[Blr](e,r,n){let o=this[hDe],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[pDe]--,s=!e.dispatch(c.opts,c.handler)}if(e[kv]=s,!s&&this[kv]&&(this[kv]=!1,this.emit("drain",r,[this,...n])),this[Llr]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[VGn]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[WGn]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[U4s](){return this[kv]}get[Olr](){let e=0;for(let{[Olr]:r}of this[G0])e+=r;return e}get[Q4s](){let e=0;for(let{[Olr]:r,[kv]:n}of this[G0])e+=r&&!n;return e}get[GGn](){let e=this[pDe];for(let{[GGn]:r}of this[G0])e+=r;return e}get[HGn](){let e=0;for(let{[HGn]:r}of this[G0])e+=r;return e}get[jGn](){let e=this[pDe];for(let{[jGn]:r}of this[G0])e+=r;return e}get stats(){return new L4s(this)}[j4s](){if(this[hDe].isEmpty()){let e=[];for(let r=0;r{this[Llr]=e})}[H4s](e){for(;;){let n=this[hDe].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[G0].length);for(let n=0;n{this[kv]&&this[Blr](e,e[q4s],[e,this])}),this}[YGn](e){e.close(()=>{let r=this[G0].indexOf(e);r!==-1&&this[G0].splice(r,1)}),this[kv]=this[G0].some(r=>!r[kv]&&r.closed!==!0&&r.destroyed!==!0)}};KGn.exports={PoolBase:Ulr,kClients:G0,kNeedDrain:kv,kAddClient:zGn,kRemoveClient:YGn,kGetDispatcher:Flr}});var wX=I((Xyf,e$n)=>{"use strict";p();var{PoolBase:$4s,kClients:Sct,kNeedDrain:V4s,kAddClient:W4s,kGetDispatcher:z4s,kRemoveClient:Y4s}=bct(),K4s=UH(),{InvalidArgumentError:Qlr}=uo(),JGn=No(),{kUrl:ZGn}=Al(),J4s=AX(),Tct=Symbol("options"),qlr=Symbol("connections"),XGn=Symbol("factory");function Z4s(t,e){return new K4s(t,e)}a(Z4s,"defaultFactory");var jlr=class extends $4s{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=Z4s,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,clientTtl:m,...g}={}){if(r!=null&&(!Number.isFinite(r)||r<0))throw new Qlr("invalid connections");if(typeof n!="function")throw new Qlr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new Qlr("connect must be a function or an object");typeof o!="function"&&(o=J4s({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(g),this[qlr]=r||null,this[ZGn]=JGn.parseOrigin(e),this[Tct]={...JGn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[Tct].interceptors=g.interceptors?{...g.interceptors}:void 0,this[XGn]=n,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let _ of y)Object.assign(_,{ttl:Date.now()})}),this.on("connectionError",(A,y,_)=>{for(let E of y){let v=this[Sct].indexOf(E);v!==-1&&this[Sct].splice(v,1)}})}[z4s](){let e=this[Tct].clientTtl;for(let r of this[Sct])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[Y4s](r);else if(!r[V4s])return r;if(!this[qlr]||this[Sct].length{"use strict";p();var{BalancedPoolMissingUpstreamError:X4s,InvalidArgumentError:eLs}=uo(),{PoolBase:tLs,kClients:sy,kNeedDrain:mDe,kAddClient:rLs,kRemoveClient:nLs,kGetDispatcher:iLs}=bct(),oLs=wX(),{kUrl:Ict}=Al(),xct=No(),t$n=Symbol("factory"),gDe=Symbol("options"),r$n=Symbol("kGreatestCommonDivisor"),RX=Symbol("kCurrentWeight"),kX=Symbol("kIndex"),dR=Symbol("kWeight"),wct=Symbol("kMaxWeightPerServer"),Rct=Symbol("kErrorPenalty");function sLs(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(sLs,"getGreatestCommonDivisor");function aLs(t,e){return new oLs(t,e)}a(aLs,"defaultFactory");var Hlr=class extends tLs{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=aLs,...n}={}){if(typeof r!="function")throw new eLs("factory must be a function.");super(n),this[gDe]={...xct.deepClone(n)},this[gDe].interceptors=n.interceptors?{...n.interceptors}:void 0,this[kX]=-1,this[RX]=0,this[wct]=this[gDe].maxWeightPerServer||100,this[Rct]=this[gDe].errorPenalty||15,Array.isArray(e)||(e=[e]),this[t$n]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=xct.parseOrigin(e).origin;if(this[sy].find(o=>o[Ict].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[t$n](r,this[gDe]);this[rLs](n),n.on("connect",()=>{n[dR]=Math.min(this[wct],n[dR]+this[Rct])}),n.on("connectionError",()=>{n[dR]=Math.max(1,n[dR]-this[Rct]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[dR]=Math.max(1,n[dR]-this[Rct]),this._updateBalancedPoolStats())});for(let o of this[sy])o[dR]=this[wct];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Ict].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[nLs](n),this}getUpstream(e){let r=xct.parseOrigin(e).origin;return this[sy].find(n=>n[Ict].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[sy].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Ict].origin)}[iLs](){if(this[sy].length===0)throw new X4s;if(!this[sy].find(s=>!s[mDe]&&s.closed!==!0&&s.destroyed!==!0)||this[sy].map(s=>s[mDe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[sy].findIndex(s=>!s[mDe]);for(;n++this[sy][o][dR]&&!s[mDe]&&(o=this[kX]),this[kX]===0&&(this[RX]=this[RX]-this[r$n],this[RX]<=0&&(this[RX]=this[wct])),s[dR]>=this[RX]&&!s[mDe])return s}return this[RX]=this[sy][o][dR],this[kX]=o,this[sy][o]}};n$n.exports=Hlr});var c$n=I((o_f,a$n)=>{"use strict";p();var{PoolBase:cLs,kClients:kct,kNeedDrain:lLs,kAddClient:o$n,kGetDispatcher:uLs,kRemoveClient:dLs}=bct(),fLs=UH(),{InvalidArgumentError:Glr}=uo(),s$n=No(),{kUrl:$lr}=Al(),pLs=AX(),ADe=Symbol("options"),Vlr=Symbol("connections"),Wlr=Symbol("factory"),Pct=Symbol("index");function hLs(t,e){return new fLs(t,e)}a(hLs,"defaultFactory");var zlr=class extends cLs{static{a(this,"RoundRobinPool")}constructor(e,{connections:r,factory:n=hLs,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,clientTtl:m,...g}={}){if(r!=null&&(!Number.isFinite(r)||r<0))throw new Glr("invalid connections");if(typeof n!="function")throw new Glr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new Glr("connect must be a function or an object");typeof o!="function"&&(o=pLs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[Vlr]=r||null,this[$lr]=s$n.parseOrigin(e),this[ADe]={...s$n.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[ADe].interceptors=g.interceptors?{...g.interceptors}:void 0,this[Wlr]=n,this[Pct]=-1,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let _ of y)Object.assign(_,{ttl:Date.now()})}),this.on("connectionError",(A,y,_)=>{for(let E of y){let v=this[kct].indexOf(E);v!==-1&&this[kct].splice(v,1)}})}[uLs](){let e=this[ADe].clientTtl,r=this[kct].length;if(r===0){let o=this[Wlr](this[$lr],this[ADe]);return this[o$n](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[dLs](o),n++;continue}if(!o[lLs])return o;n++}if(!this[Vlr]||r{"use strict";p();var{InvalidArgumentError:Dct,MaxOriginsReachedError:mLs}=uo(),{kClients:fR,kRunning:l$n,kClose:gLs,kDestroy:ALs,kDispatch:yLs,kUrl:_Ls}=Al(),ELs=gX(),vLs=wX(),CLs=UH(),bLs=No(),u$n=Symbol("onConnect"),d$n=Symbol("onDisconnect"),f$n=Symbol("onConnectionError"),p$n=Symbol("onDrain"),h$n=Symbol("factory"),Ylr=Symbol("options"),yDe=Symbol("origins");function SLs(t,e){return e&&e.connections===1?new CLs(t,e):new vLs(t,e)}a(SLs,"defaultFactory");var Klr=class extends ELs{static{a(this,"Agent")}constructor({factory:e=SLs,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new Dct("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new Dct("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new Dct("maxOrigins must be a number greater than 0");super(o),n&&typeof n!="function"&&(n={...n}),this[Ylr]={...bLs.deepClone(o),maxOrigins:r,connect:n},this[h$n]=e,this[fR]=new Map,this[yDe]=new Set,this[p$n]=(s,c)=>{this.emit("drain",s,[this,...c])},this[u$n]=(s,c)=>{this.emit("connect",s,[this,...c])},this[d$n]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[f$n]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[l$n](){let e=0;for(let{dispatcher:r}of this[fR].values())e+=r[l$n];return e}[yLs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new Dct("opts.origin must be a non-empty string or URL.");if(this[yDe].size>=this[Ylr].maxOrigins&&!this[yDe].has(n))throw new mLs;let o=this[fR].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[fR].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[fR].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[yDe].delete(n))},"closeClientIfUnused");s=this[h$n](e.origin,this[Ylr]).on("drain",this[p$n]).on("connect",(l,u)=>{let d=this[fR].get(n);d&&(d.count+=1),this[u$n](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[d$n](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[f$n](l,u,d)}),this[fR].set(n,{count:0,dispatcher:s}),this[yDe].add(n)}return s.dispatch(e,r)}[gLs](){let e=[];for(let{dispatcher:r}of this[fR].values())e.push(r.close());return this[fR].clear(),Promise.all(e)}[ALs](e){let r=[];for(let{dispatcher:n}of this[fR].values())r.push(n.destroy(e));return this[fR].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[fR].values())r.stats&&(e[r[_Ls].origin]=r.stats);return e}};m$n.exports=Klr});var y$n=I((d_f,A$n)=>{"use strict";p();var{Buffer:qH}=require("node:buffer"),Jlr=require("node:net"),{InvalidArgumentError:QH}=uo();function TLs(t){if(Jlr.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:qH.from(r)}}if(Jlr.isIPv6(t))return{type:4,buffer:g$n(t)};let e=qH.from(t,"utf8");if(e.length>255)throw new QH("Domain name too long (max 255 bytes)");return{type:3,buffer:qH.concat([qH.from([e.length]),e])}}a(TLs,"parseAddress");function g$n(t){let e=qH.alloc(16),r=t;if(t.includes(".")){let o=t.lastIndexOf(":"),s=t.slice(o+1);if(Jlr.isIPv4(s)){let c=s.split(".").map(Number),l=(c[0]<<8|c[1]).toString(16),u=(c[2]<<8|c[3]).toString(16);r=`${t.slice(0,o)}:${l}:${u}`}}let n=r.indexOf("::");if(n!==-1){let o=r.slice(0,n),s=r.slice(n+2),c=o===""?[]:o.split(":"),l=s===""?[]:s.split(":"),u=0;for(let d of c)e.writeUInt16BE(parseInt(d,16),u),u+=2;u=16-l.length*2;for(let d of l)e.writeUInt16BE(parseInt(d,16),u),u+=2}else{let o=r.split(":");for(let s=0;s{"use strict";p();var{EventEmitter:RLs}=require("node:events"),{Buffer:DX}=require("node:buffer"),{InvalidArgumentError:Rhe,Socks5ProxyError:jH}=uo(),{debuglog:kLs}=require("node:util"),{parseAddress:PLs}=y$n(),N8=kLs("undici:socks5"),_$n=DX.alloc(0),Nct=5,khe={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},E$n={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},NX={IPV4:1,DOMAIN:3,IPV6:4},g4={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},U_={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},Zlr=class extends RLs{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new Rhe("socket is required");this.socket=e,this.options=r,this.state=U_.INITIAL,this.buffer=_$n,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],r.username&&r.password&&this.authMethods.push(khe.USERNAME_PASSWORD),this.authMethods.push(khe.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){N8("received data",e.length,"bytes in state",this.state),this.buffer=DX.concat([this.buffer,e]);try{switch(this.state){case U_.HANDSHAKING:this.handleHandshakeResponse();break;case U_.AUTHENTICATING:this.handleAuthResponse();break;case U_.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){N8("socket error",e),this.state=U_.ERROR,this.emit("error",e),this.destroy()}onClose(){N8("socket closed"),this.state=U_.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=U_.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==U_.INITIAL)throw new Rhe("Handshake already started");N8("starting handshake with",this.authMethods.length,"auth methods"),this.state=U_.HANDSHAKING;let e=DX.alloc(2+this.authMethods.length);e[0]=Nct,e[1]=this.authMethods.length,this.authMethods.forEach((r,n)=>{e[2+n]=r}),this.socket.write(e)}handleHandshakeResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],r=this.buffer[1];if(e!==Nct)throw new jH(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===khe.NO_ACCEPTABLE)throw new jH("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),N8("server selected auth method",r),r===khe.NO_AUTH)this.markAuthenticated();else if(r===khe.USERNAME_PASSWORD)this.state=U_.AUTHENTICATING,this.sendAuthRequest();else throw new jH(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new Rhe("Username and password required for authentication");N8("sending username/password auth");let n=DX.from(e),o=DX.from(r);if(n.length>255||o.length>255)throw new Rhe("Username or password too long");let s=DX.alloc(3+n.length+o.length);s[0]=1,s[1]=n.length,n.copy(s,2),s[2+n.length]=o.length,o.copy(s,3+n.length),this.socket.write(s)}handleAuthResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],r=this.buffer[1];if(e!==1)throw new jH(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new jH("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),N8("authentication successful"),this.markAuthenticated()}connect(e,r){if(this.state===U_.CONNECTING||this.state===U_.CONNECTED)throw new Rhe("Connection already in progress");if(this.state!==U_.AUTHENTICATED)throw new Rhe("Client must be authenticated before CONNECT");N8("connecting to",e,r),this.state=U_.CONNECTING;let n=this.buildConnectRequest(E$n.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=PLs(r),c=DX.alloc(4+s.length+2);return c[0]=Nct,c[1]=e,c[2]=0,c[3]=o,s.copy(c,4),c.writeUInt16BE(n,4+s.length),c}handleConnectResponse(){if(this.buffer.length<4)return;let e=this.buffer[0],r=this.buffer[1],n=this.buffer[3];if(e!==Nct)throw new jH(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===NX.IPV4)o+=6;else if(n===NX.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===NX.IPV6)o+=18;else throw new jH(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var{URL:b$n}=require("node:url"),Xlr,DLs=gX(),{InvalidArgumentError:S$n}=uo(),{Socks5Client:NLs,STATES:MLs}=C$n(),{kDispatch:T$n,kClose:OLs,kDestroy:LLs}=Al(),BLs=wX(),FLs=AX(),{debuglog:ULs}=require("node:util"),HH=ULs("undici:socks5-proxy"),eur=Symbol("proxy url"),QLs=Symbol("proxy headers"),I$n=Symbol("proxy auth"),x$n=Symbol("proxy protocol"),MX=Symbol("pools"),w$n=Symbol("connector"),tur=Symbol("request tls settings"),R$n=!1,rur=class extends DLs{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),R$n||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),R$n=!0),!e)throw new S$n("Proxy URL is mandatory");let n=typeof e=="string"?new b$n(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new S$n("Proxy URL must use socks5:// or socks:// protocol");this[eur]=n,this[QLs]=r.headers||{},this[x$n]=r.proxyTls?"https:":"http:",this[tur]=r.requestTls,this[I$n]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[w$n]=r.connect||FLs({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[MX]=new Map}async createSocks5Connection(e,r){let n=this[eur].hostname,o=parseInt(this[eur].port)||1080;HH("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{this[w$n]({hostname:n,host:n,port:o,protocol:this[x$n]},(d,f)=>{d?u(d):l(f)})}),c=new NLs(s,this[I$n]);return c.on("error",l=>{HH("SOCKS5 error:",l),s.destroy()}),await c.handshake(),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 authentication timeout"))},5e3),f=a(()=>{clearTimeout(d),c.removeListener("error",h),l()},"onAuthenticated"),h=a(m=>{clearTimeout(d),c.removeListener("authenticated",f),u(m)},"onError");c.state===MLs.AUTHENTICATED?(clearTimeout(d),l()):(c.once("authenticated",f),c.once("error",h))}),await c.connect(e,r),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 connection timeout"))},5e3),f=a(m=>{HH("SOCKS5 tunnel established to",e,r,"via",m),clearTimeout(d),c.removeListener("error",h),l()},"onConnected"),h=a(m=>{clearTimeout(d),c.removeListener("connected",f),u(m)},"onError");c.once("connected",f),c.once("error",h)}),s}[T$n](e,r){let{origin:n}=e;HH("dispatching request to",n,"via SOCKS5");try{let o=String(n),s=this[MX].get(o);return(!s||s.destroyed||s.closed)&&(s=new BLs(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(c,l)=>{try{let u=new b$n(n),d=u.hostname,f=parseInt(u.port)||(u.protocol==="https:"?443:80);HH("establishing SOCKS5 connection to",d,f);let h=await this.createSocks5Connection(d,f),m=h;u.protocol==="https:"&&(Xlr||(Xlr=require("node:tls")),HH("upgrading to TLS"),m=Xlr.connect({...this[tur],socket:h,servername:this[tur]?.servername||d}),await new Promise((g,A)=>{m.once("secureConnect",g),m.once("error",A)})),l(null,m)}catch(u){HH("SOCKS5 connection error:",u),l(u)}},"connect")}),this[MX].set(o,s)),s[T$n](e,r)}catch(o){if(HH("dispatch error:",o),typeof r.onResponseError=="function")return r.onResponseError(null,o),!1;if(typeof r.onError=="function")return r.onError(o),!1;throw o}}async[OLs](){let e=[];for(let r of this[MX].values())e.push(r.close());this[MX].clear(),await Promise.all(e)}async[LLs](e){let r=[];for(let n of this[MX].values())r.push(n.destroy(e));this[MX].clear(),await Promise.all(r)}};k$n.exports=rur});var aur=I((E_f,j$n)=>{"use strict";p();var{kProxy:Phe,kClose:B$n,kDestroy:F$n,kDispatch:P$n}=Al(),qLs=PX(),U$n=wX(),Q$n=gX(),{InvalidArgumentError:OX,RequestAbortedError:jLs,SecureProxyConnectionError:HLs}=uo(),D$n=AX(),q$n=UH(),{channels:N$n}=kH(),GLs=nur(),Mct=Symbol("proxy agent"),GH=Symbol("proxy client"),M8=Symbol("proxy headers"),iur=Symbol("request tls settings"),M$n=Symbol("proxy tls settings"),O$n=Symbol("connect endpoint function"),L$n=Symbol("tunnel proxy");function $Ls(t){return t==="https:"?443:80}a($Ls,"defaultProtocolPort");function VLs(t,e){return new U$n(t,e)}a(VLs,"defaultFactory");var WLs=a(()=>{},"noop");function zLs(t,e){return e.connections===1?new q$n(t,e):new U$n(t,e)}a(zLs,"defaultAgentFactory");var our=class extends Q$n{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new OX("Proxy URL is mandatory");super(),this[M8]=r,o?this.#e=o(e,{connect:n}):this.#e=new q$n(e,{connect:n})}[P$n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new OX("Proxy Authentication Required (407)"));return}n&&n.call(this,l,u,d)};let{origin:o,path:s="/",headers:c={}}=e;if(e.path=o+s,!("host"in c)&&!("Host"in c)){let{host:l}=new URL(o);c.host=l}return e.headers={...this[M8],...c},this.#e[P$n](e,r)}[B$n](){return this.#e.close()}[F$n](e){return this.#e.destroy(e)}},sur=class extends Q$n{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new OX("Proxy uri is mandatory");let{clientFactory:r=VLs}=e;if(typeof r!="function")throw new OX("Proxy opts.clientFactory must be a function.");let{proxyTunnel:n=!0}=e;super();let o=this.#e(e),{href:s,origin:c,port:l,protocol:u,username:d,password:f,hostname:h}=o;if(this[Phe]={uri:s,protocol:u},this[iur]=e.requestTls,this[M$n]=e.proxyTls,this[M8]=e.headers||{},this[L$n]=n,e.auth&&e.token)throw new OX("opts.auth cannot be used in combination with opts.token");e.auth?this[M8]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[M8]["proxy-authorization"]=e.token:d&&f&&(this[M8]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=D$n({...e.proxyTls});this[O$n]=D$n({...e.requestTls});let g=e.factory||zLs,A=a((y,_)=>{let{protocol:E}=new URL(y);return this[Phe].protocol==="socks5:"||this[Phe].protocol==="socks:"?new GLs(this[Phe].uri,{headers:this[M8],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls,requestTls:e.requestTls}):!this[L$n]&&E==="http:"&&this[Phe].protocol==="http:"?new our(this[Phe].uri,{headers:this[M8],connect:m,factory:g}):g(y,_)},"factory");u==="socks5:"||u==="socks:"?this[GH]=null:this[GH]=r(o,{connect:m}),this[Mct]=new qLs({...e,factory:A,connect:a(async(y,_)=>{if(!this[GH]){_(new OX("Cannot establish tunnel connection without a proxy client"));return}let E=y.host;y.port||(E+=`:${$Ls(y.protocol)}`);try{let v={origin:c,port:l,path:E,signal:y.signal,headers:{...this[M8],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[M$n]?.servername||h},{socket:S,statusCode:T}=await this[GH].connect(v);if(T!==200){S.on("error",WLs).destroy(),_(new jLs(`Proxy response (${T}) !== 200 when HTTP Tunneling`));return}if(N$n.proxyConnected.hasSubscribers&&N$n.proxyConnected.publish({socket:S,connectParams:v}),y.protocol!=="https:"){_(null,S);return}let w;this[iur]?w=this[iur].servername:w=y.servername,this[O$n]({...y,servername:w,httpSocket:S},_)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?_(new HLs(v)):_(v)}},"connect")})}dispatch(e,r){let n=YLs(e.headers);if(KLs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[Mct].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[B$n](){let e=[this[Mct].close()];return this[GH]&&e.push(this[GH].close()),Promise.all(e)}[F$n](){let e=[this[Mct].destroy()];return this[GH]&&e.push(this[GH].destroy()),Promise.all(e)}};function YLs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new OX("Proxy-Authorization should be sent in ProxyAgent constructor")}a(KLs,"throwIfProxyAuthIsSent");j$n.exports=sur});var W$n=I((b_f,V$n)=>{"use strict";p();var JLs=gX(),{kClose:ZLs,kDestroy:XLs,kClosed:H$n,kDestroyed:G$n,kDispatch:eBs,kNoProxyAgent:_De,kHttpProxyAgent:$H,kHttpsProxyAgent:LX}=Al(),$$n=aur(),tBs=PX(),rBs={"http:":80,"https:":443},cur=class extends JLs{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e;let{httpProxy:r,httpsProxy:n,noProxy:o,...s}=e;this[_De]=new tBs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[$H]=new $$n({...s,uri:c}):this[$H]=this[_De];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[LX]=new $$n({...s,uri:l}):this[LX]=this[$H],this.#o()}[eBs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[ZLs](){return Promise.all([this[_De].close(),!this[$H][H$n]&&this[$H].close(),!this[LX][H$n]&&this[LX].close()])}[XLs](e){return Promise.all([this[_De].destroy(e),!this[$H][G$n]&&this[$H].destroy(e),!this[LX][G$n]&&this[LX].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||rBs[r]||0,this.#i(n,o)?r==="https:"?this[LX]:this[$H]:this[_De]}#i(e,r){if(this.#s&&this.#o(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let n=0;n{"use strict";p();var Dhe=require("node:assert"),{kRetryHandlerDefaultRetry:z$n}=Al(),{RequestRetryError:Nhe}=uo(),nBs=G2e(),{isDisturbed:Y$n,parseRangeHeader:K$n,wrapRequestBody:iBs}=No();function oBs(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(oBs,"calculateRetryAfterHeader");function J$n(t,e,r,n){let o=t["content-length"];if(o==null||!Number.isFinite(e.start)||!Number.isFinite(e.end))return;let s=Number(o),c=e.end-e.start+1;if(!Number.isFinite(s)||s!==c)throw new Nhe("Content-Length mismatch",r,{headers:t,data:{count:n}})}a(J$n,"validatePartialResponseContentLength");var lur=class t{static{a(this,"RetryHandler")}constructor(e,{dispatch:r,handler:n}){let{retryOptions:o,...s}=e,{retry:c,maxRetries:l,maxTimeout:u,minTimeout:d,timeoutFactor:f,methods:h,errorCodes:m,retryAfter:g,statusCodes:A,throwOnError:y}=o??{};this.error=null,this.dispatch=r,this.handler=nBs.wrap(n),this.opts={...s,body:iBs(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[z$n],retryAfter:g??!0,maxTimeout:u??30*1e3,minTimeout:d??500,timeoutFactor:f??2,maxRetries:l??5,methods:h??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:A??[500,502,503,504,429],errorCodes:m??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null}onResponseStartWithRetry(e,r,n,o,s){if(this.retryOpts.throwOnError){this.retryOpts.statusCodes.includes(r)===!1?(this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o)):this.error=s;return}if(Y$n(this.opts.body)){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}function c(l){if(l){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o),e.resume();return}this.error=s,e.resume()}a(c,"shouldRetry"),e.pause(),this.retryOpts.retry(s,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},c.bind(this))}onRequestStart(e,r){this.headersSent||this.handler.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.handler.onRequestUpgrade?.(e,r,n,o)}static[z$n](e,{state:r,opts:n},o){let{statusCode:s,code:c,headers:l}=e,{method:u,retryOptions:d}=n,{maxRetries:f,minTimeout:h,maxTimeout:m,timeoutFactor:g,statusCodes:A,errorCodes:y,methods:_}=d,{counter:E}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(_)&&!_.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(E>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?oBs(l["retry-after"]):v*1e3);let S=v>0?Math.min(v,m):Math.min(h*g**(E-1),m);setTimeout(()=>o(null),S)}onResponseStart(e,r,n,o){if(this.error=null,this.retryCount+=1,r>=300){let s=new Nhe("Request failed",r,{headers:n,data:{count:this.retryCount}});this.onResponseStartWithRetry(e,r,n,o,s);return}if(this.headersSent){if(r!==206&&(this.start>0||r!==200))throw new Nhe("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=K$n(n["content-range"]);if(!s)throw new Nhe("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new Nhe("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});J$n(n,s,r,this.retryCount);let{start:c,size:l,end:u=l?l-1:null}=s;Dhe(this.start===c,"content-range mismatch"),Dhe(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=K$n(n["content-range"]);if(s==null){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}J$n(n,s,r,this.retryCount);let{start:c,size:l,end:u=l?l-1:null}=s;Dhe(c!=null&&Number.isFinite(c),"content-range mismatch"),Dhe(u!=null&&Number.isFinite(u),"invalid content-length"),this.start=c,this.end=u}if(this.end==null){let s=n["content-length"];this.end=s!=null?Number(s)-1:null}Dhe(Number.isFinite(this.start)),Dhe(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=!0,this.etag=n.etag!=null?n.etag:null,this.etag!=null&&this.etag[0]==="W"&&this.etag[1]==="/"&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o)}else throw new Nhe("Request failed",r,{headers:n,data:{count:this.retryCount}})}onResponseData(e,r){this.error||(this.start+=r.length,this.handler.onResponseData?.(e,r))}onResponseEnd(e,r){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error)return this.retryCount=0,this.handler.onResponseEnd?.(e,r);this.retry(e)}retry(e){if(this.start!==0){let r={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(r["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...r}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(r){this.handler.onResponseError?.(e,r)}}onResponseError(e,r){if(e?.aborted||Y$n(this.opts.body)){this.handler.onResponseError?.(e,r);return}function n(o){if(!o){this.retry(e);return}this.handler?.onResponseError?.(e,o)}a(n,"shouldRetry"),this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(r,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},n.bind(this))}};Z$n.exports=lur});var eVn=I((R_f,X$n)=>{"use strict";p();var sBs=$2e(),aBs=Oct(),uur=class extends sBs{static{a(this,"RetryAgent")}#e=null;#t=null;constructor(e,r={}){super(r),this.#e=e,this.#t=r}dispatch(e,r){let n=new aBs({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:r});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};X$n.exports=uur});var nVn=I((D_f,rVn)=>{"use strict";p();var{InvalidArgumentError:tVn}=uo(),cBs=UH(),dur=class extends cBs{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new tVn("h2c-client: Only h2c protocol is supported");let{maxConcurrentStreams:n,pipelining:o,...s}=r??{},c=100,l=100;if(n!=null&&Number.isInteger(n)&&n>0&&(c=n),o!=null&&Number.isInteger(o)&&o>0&&(l=o),l>c)throw new tVn("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};rVn.exports=dur});var fVn=I((O_f,dVn)=>{"use strict";p();var aVn=require("node:assert"),{Readable:lBs}=require("node:stream"),{RequestAbortedError:cVn,NotSupportedError:uBs,InvalidArgumentError:dBs,AbortError:Lct}=uo(),lVn=No(),{ReadableStreamFrom:fBs}=No(),KT=Symbol("kConsume"),Bct=Symbol("kReading"),BX=Symbol("kBody"),iVn=Symbol("kAbort"),uVn=Symbol("kContentType"),fur=Symbol("kContentLength"),pur=Symbol("kUsed"),Fct=Symbol("kBytesRead"),pBs=a(()=>{},"noop"),hur=class extends lBs{static{a(this,"BodyReadable")}constructor({resume:e,abort:r,contentType:n="",contentLength:o,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[iVn]=r,this[KT]=null,this[Fct]=0,this[BX]=null,this[pur]=!1,this[uVn]=n,this[fur]=Number.isFinite(o)?o:null,this[Bct]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new cVn),e&&this[iVn](),this[pur]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[Bct]=!0,this[pur]=!0),super.on(e,r)}addListener(e,r){return this.on(e,r)}off(e,r){let n=super.off(e,r);return(e==="data"||e==="readable")&&(this[Bct]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[Fct]+=e.length,this[KT])?(gur(this[KT],e),this[Bct]?super.push(e):!0):super.push(e)}text(){return EDe(this,"text")}json(){return EDe(this,"json")}blob(){return EDe(this,"blob")}bytes(){return EDe(this,"bytes")}arrayBuffer(){return EDe(this,"arrayBuffer")}async formData(){throw new uBs}get bodyUsed(){return lVn.isDisturbed(this)}get body(){return this[BX]||(this[BX]=fBs(this),this[KT]&&(this[BX].getReader(),aVn(this[BX].locked))),this[BX]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new dBs("signal must be an AbortSignal"));let n=e?.limit&&Number.isFinite(e.limit)?e.limit:128*1024;return r?.aborted?Promise.reject(r.reason??new Lct):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[fur]&&this[fur]>n||this[Fct]>n)&&this.destroy(new Lct),r){let c=a(()=>{this.destroy(r.reason??new Lct)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new Lct):o(null)})}else this.on("close",o);this.on("error",pBs).on("data",()=>{this[Fct]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function hBs(t){return t[BX]?.locked===!0||t[KT]!==null}a(hBs,"isLocked");function mBs(t){return lVn.isDisturbed(t)||hBs(t)}a(mBs,"isUnusable");function EDe(t,e){return aVn(!t[KT]),new Promise((r,n)=>{if(mBs(t)){let o=t._readableState;o.destroyed&&o.closeEmitted===!1?t.on("error",n).on("close",()=>{n(new TypeError("unusable"))}):n(o.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[KT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){Aur(this[KT],o)}).on("close",function(){this[KT].body!==null&&Aur(this[KT],new cVn)}),gBs(t[KT])})})}a(EDe,"consume");function gBs(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,n=e.buffer.length;for(let o=r;o2&&n[0]===239&&n[1]===187&&n[2]===191?3:0;return!r||r==="utf8"||r==="utf-8"?n.utf8Slice(s,o):n.subarray(s,o).toString(r)}a(mur,"chunksDecode");function oVn(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let r=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),n=0;for(let o=0;o{"use strict";p();var ABs=require("node:assert"),{AsyncResource:yBs}=require("node:async_hooks"),{Readable:_Bs}=fVn(),{InvalidArgumentError:Mhe,RequestAbortedError:pVn}=uo(),pR=No();function vDe(){}a(vDe,"noop");var Uct=class extends yBs{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Mhe("invalid opts");let{signal:n,method:o,opaque:s,body:c,onInfo:l,responseHeaders:u,highWaterMark:d}=e;try{if(typeof r!="function")throw new Mhe("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new Mhe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Mhe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Mhe("invalid method");if(l&&typeof l!="function")throw new Mhe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw pR.isStream(c)&&pR.destroy(c.on("error",vDe),f),f}this.method=o,this.responseHeaders=u||null,this.opaque=s||null,this.callback=r,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.highWaterMark=d,this.reason=null,this.removeAbortListener=null,n?.aborted?this.reason=n.reason??new pVn:n&&(this.removeAbortListener=pR.addAbortListener(n,()=>{this.reason=n.reason??new pVn,this.res?pR.destroy(this.res.on("error",vDe),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}ABs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{callback:s,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,h=d==="raw"?pR.parseRawHeaders(r):pR.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?pR.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new _Bs({resume:n,abort:l,contentType:g,contentLength:this.method!=="HEAD"&&A?Number(A):null,highWaterMark:f});if(this.removeAbortListener&&(y.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=y,s!==null)try{this.runInAsyncScope(s,null,null,{statusCode:e,statusText:o,headers:h,trailers:this.trailers,opaque:c,body:y,context:u})}catch(_){this.res=null,pR.destroy(y.on("error",vDe),_),queueMicrotask(()=>{throw _})}}onData(e){return this.res.push(e)}onComplete(e){pR.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:r,callback:n,body:o,opaque:s}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:s})})),r&&(this.res=null,queueMicrotask(()=>{pR.destroy(r.on("error",vDe),e)})),o&&(this.body=null,pR.isStream(o)&&(o.on("error",vDe),pR.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function hVn(t,e){if(e===void 0)return new Promise((r,n)=>{hVn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Uct(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(hVn,"request");yur.exports=hVn;yur.exports.RequestHandler=Uct});var CDe=I((q_f,yVn)=>{"use strict";p();var{addAbortListener:EBs}=No(),{RequestAbortedError:vBs}=uo(),Ohe=Symbol("kListener"),A4=Symbol("kSignal");function gVn(t){t.abort?t.abort(t[A4]?.reason):t.reason=t[A4]?.reason??new vBs,AVn(t)}a(gVn,"abort");function CBs(t,e){if(t.reason=null,t[A4]=null,t[Ohe]=null,!!e){if(e.aborted){gVn(t);return}t[A4]=e,t[Ohe]=()=>{gVn(t)},EBs(t[A4],t[Ohe])}}a(CBs,"addSignal");function AVn(t){t[A4]&&("removeEventListener"in t[A4]?t[A4].removeEventListener("abort",t[Ohe]):t[A4].removeListener("abort",t[Ohe]),t[A4]=null,t[Ohe]=null)}a(AVn,"removeSignal");yVn.exports={addSignal:CBs,removeSignal:AVn}});var CVn=I((G_f,vVn)=>{"use strict";p();var bBs=require("node:assert"),{finished:SBs}=require("node:stream"),{AsyncResource:TBs}=require("node:async_hooks"),{InvalidArgumentError:Lhe,InvalidReturnValueError:IBs}=uo(),O8=No(),{addSignal:xBs,removeSignal:_Vn}=CDe();function wBs(){}a(wBs,"noop");var _ur=class extends TBs{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new Lhe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new Lhe("invalid callback");if(typeof r!="function")throw new Lhe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new Lhe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Lhe("invalid method");if(u&&typeof u!="function")throw new Lhe("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw O8.isStream(l)&&O8.destroy(l.on("error",wBs),f),f}this.responseHeaders=d||null,this.opaque=c||null,this.factory=r,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=l,this.onInfo=u||null,O8.isStream(l)&&l.on("error",f=>{this.onError(f)}),xBs(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}bBs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{factory:s,opaque:c,context:l,responseHeaders:u}=this,d=u==="raw"?O8.parseRawHeaders(r):O8.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:d});return}if(this.factory=null,s===null)return;let f=this.runInAsyncScope(s,null,{statusCode:e,headers:d,opaque:c,context:l});if(!f||typeof f.write!="function"||typeof f.end!="function"||typeof f.on!="function")throw new IBs("expected Writable");return SBs(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:_,abort:E}=this;this.res=null,(m||!A?.readable)&&O8.destroy(A,m),this.callback=null,this.runInAsyncScope(g,null,m||null,{opaque:y,trailers:_}),m&&E()}),f.on("drain",n),this.res=f,(f.writableNeedDrain!==void 0?f.writableNeedDrain:f._writableState?.needDrain)!==!0}onData(e){let{res:r}=this;return r?r.write(e):!0}onComplete(e){let{res:r}=this;_Vn(this),r&&(this.trailers=O8.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;_Vn(this),this.factory=null,r?(this.res=null,O8.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,O8.destroy(s,e))}};function EVn(t,e,r){if(r===void 0)return new Promise((n,o)=>{EVn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new _ur(t,e,r);this.dispatch(t,n)}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(EVn,"stream");vVn.exports=EVn});var IVn=I((W_f,TVn)=>{"use strict";p();var{Readable:SVn,Duplex:RBs,PassThrough:kBs}=require("node:stream"),PBs=require("node:assert"),{AsyncResource:DBs}=require("node:async_hooks"),{InvalidArgumentError:bDe,InvalidReturnValueError:NBs,RequestAbortedError:Eur}=uo(),y4=No(),{addSignal:MBs,removeSignal:OBs}=CDe();function bVn(){}a(bVn,"noop");var Bhe=Symbol("resume"),vur=class extends SVn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Bhe]=null}_read(){let{[Bhe]:e}=this;e&&(this[Bhe]=null,e())}_destroy(e,r){this._read(),r(e)}},Cur=class extends SVn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Bhe]=e}_read(){this[Bhe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new Eur),r(e)}},bur=class extends DBs{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new bDe("invalid opts");if(typeof r!="function")throw new bDe("invalid handler");let{signal:n,method:o,opaque:s,onInfo:c,responseHeaders:l}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new bDe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new bDe("invalid method");if(c&&typeof c!="function")throw new bDe("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=l||null,this.handler=r,this.abort=null,this.context=null,this.onInfo=c||null,this.req=new vur().on("error",bVn),this.ret=new RBs({readableObjectMode:e.objectMode,autoDestroy:!0,read:a(()=>{let{body:u}=this;u?.resume&&u.resume()},"read"),write:a((u,d,f)=>{let{req:h}=this;h.push(u,d)||h._readableState.destroyed?f():h[Bhe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new Eur),A&&u&&A(),y4.destroy(f,u),y4.destroy(h,u),y4.destroy(m,u),OBs(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,MBs(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}PBs(!n,"pipeline cannot be retried"),this.abort=e,this.context=r}onHeaders(e,r,n){let{opaque:o,handler:s,context:c}=this;if(e<200){if(this.onInfo){let u=this.responseHeaders==="raw"?y4.parseRawHeaders(r):y4.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Cur(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?y4.parseRawHeaders(r):y4.parseHeaders(r);l=this.runInAsyncScope(s,null,{statusCode:e,headers:u,opaque:o,body:this.res,context:c})}catch(u){throw this.res.on("error",bVn),u}if(!l||typeof l.on!="function")throw new NBs("expected Readable");l.on("data",u=>{let{ret:d,body:f}=this;!d.push(u)&&f.pause&&f.pause()}).on("error",u=>{let{ret:d}=this;y4.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||y4.destroy(u,new Eur)}),this.body=l}onData(e){let{res:r}=this;return r.push(e)}onComplete(e){let{res:r}=this;r.push(null)}onError(e){let{ret:r}=this;this.handler=null,y4.destroy(r,e)}};function LBs(t,e){try{let r=new bur(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new kBs().destroy(r)}}a(LBs,"pipeline");TVn.exports=LBs});var DVn=I((K_f,PVn)=>{"use strict";p();var{InvalidArgumentError:Sur,SocketError:BBs}=uo(),{AsyncResource:FBs}=require("node:async_hooks"),xVn=require("node:assert"),wVn=No(),{kHTTP2Stream:UBs}=Al(),{addSignal:QBs,removeSignal:RVn}=CDe(),Tur=class extends FBs{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Sur("invalid opts");if(typeof r!="function")throw new Sur("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Sur("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,QBs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}xVn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new BBs("bad upgrade",null)}onUpgrade(e,r,n){xVn(n[UBs]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;RVn(this),this.callback=null;let l=this.responseHeaders==="raw"?wVn.parseRawHeaders(r):wVn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;RVn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function kVn(t,e){if(e===void 0)return new Promise((r,n)=>{kVn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Tur(t,e),n={...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"};this.dispatch(n,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(kVn,"upgrade");PVn.exports=kVn});var BVn=I((X_f,LVn)=>{"use strict";p();var qBs=require("node:assert"),{AsyncResource:jBs}=require("node:async_hooks"),{InvalidArgumentError:Iur,SocketError:HBs}=uo(),NVn=No(),{addSignal:GBs,removeSignal:MVn}=CDe(),xur=class extends jBs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Iur("invalid opts");if(typeof r!="function")throw new Iur("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Iur("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,GBs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}qBs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new HBs("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;MVn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?NVn.parseRawHeaders(r):NVn.parseHeaders(r)),this.runInAsyncScope(o,null,null,{statusCode:e,headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;MVn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function OVn(t,e){if(e===void 0)return new Promise((r,n)=>{OVn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new xur(t,e),n={...t,method:"CONNECT"};this.dispatch(n,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(OVn,"connect");LVn.exports=OVn});var FVn=I((rEf,Fhe)=>{"use strict";p();Fhe.exports.request=mVn();Fhe.exports.stream=CVn();Fhe.exports.pipeline=IVn();Fhe.exports.upgrade=DVn();Fhe.exports.connect=BVn()});var Rur=I((iEf,QVn)=>{"use strict";p();var{UndiciError:$Bs}=uo(),UVn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),wur=class extends $Bs{static{a(this,"MockNotMatchedError")}constructor(e){super(e),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[UVn]===!0}get[UVn](){return!0}};QVn.exports={MockNotMatchedError:wur}});var FX=I((aEf,qVn)=>{"use strict";p();qVn.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOriginalDispatch:Symbol("original dispatch"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected"),kIgnoreTrailingSlash:Symbol("ignore trailing slash"),kMockAgentMockCallHistoryInstance:Symbol("mock agent mock call history name"),kMockAgentRegisterCallHistory:Symbol("mock agent register mock call history"),kMockAgentAddCallHistoryLog:Symbol("mock agent add call history log"),kMockAgentIsCallHistoryEnabled:Symbol("mock agent is call history enabled"),kMockAgentAcceptsNonStandardSearchParameters:Symbol("mock agent accepts non standard search parameters"),kMockCallHistoryAddLog:Symbol("mock call history add log"),kTotalDispatchCount:Symbol("total dispatch count")}});var SDe=I((lEf,ZVn)=>{"use strict";p();var{MockNotMatchedError:Uhe}=Rur(),{kDispatches:UX,kMockAgent:VBs,kOriginalDispatch:WBs,kOrigin:zBs,kGetNetConnect:YBs,kTotalDispatchCount:Dur}=FX(),{serializePathWithQuery:KBs}=No(),{STATUS_CODES:JBs}=require("node:http"),{types:{isPromise:ZBs}}=require("node:util"),{InvalidArgumentError:kur}=uo();function _4(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(_4,"matchValue");function HVn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(HVn,"lowerCaseEntries");function GVn(t,e){if(Array.isArray(t)){for(let r=0;r"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[r,n]of Object.entries(t.headers)){let o=GVn(e,r);if(!_4(n,o))return!1}return!0}a($Vn,"matchHeaders");function XBs(t){if(typeof t!="string")return t;let e=new URLSearchParams(t),r=new URLSearchParams;for(let[n,o]of e.entries()){if(n=n.replace("[]",""),/^(['"]).*\1$/.test(o)){r.append(n,o);continue}if(o.includes(",")){let c=o.split(",");for(let l of c)r.append(n,l);continue}r.append(n,o)}return r}a(XBs,"normalizeSearchParams");function Pur(t){if(typeof t!="string")return t;let e=t.split("?",3);if(e.length!==2)return t;let r=new URLSearchParams(e.pop());return r.sort(),[...e,r.toString()].join("?")}a(Pur,"safeUrl");function e3s(t,{path:e,method:r,body:n,headers:o}){let s=_4(t.path,e),c=_4(t.method,r),l=typeof t.body<"u"?_4(t.body,n):!0,u=$Vn(t,o);return s&&c&&l&&u}a(e3s,"matchKey");function VVn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(VVn,"getResponseData");function WVn(t,e){let r=e.query?KBs(e.path,e.query):e.path,n=typeof r=="string"?Pur(r):r,o=jVn(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?_4(jVn(Pur(c)),o):_4(Pur(c),n));if(s.length===0)throw new Uhe(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>_4(c,e.method)),s.length===0)throw new Uhe(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?_4(c,e.body):!0),s.length===0)throw new Uhe(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>$Vn(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new Uhe(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(WVn,"getMockDispatch");function t3s(t,e,r,n){let o={timesInvoked:0,times:1,persist:!1,consumed:!1,...n},s=typeof r=="function"?{callback:r}:{...r},c={...o,...e,pending:!0,data:{error:null,...s}};return t.push(c),t[Dur]=(t[Dur]||0)+1,c}a(t3s,"addMockDispatch");function Nur(t,e){let r=t.findIndex(n=>n.consumed?e3s(n,e):!1);r!==-1&&t.splice(r,1)}a(Nur,"deleteMockDispatch");function jVn(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(jVn,"removeTrailingSlash");function zVn(t){let{path:e,method:r,body:n,headers:o,query:s}=t;return{path:e,method:r,body:n,headers:o,query:s}}a(zVn,"buildKey");function Mur(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,_(this[UX])},d):_(this[UX]);function _(v,S=s){if(g)return;let T=Array.isArray(t.headers)?Our(t.headers):t.headers,w=typeof S=="function"?S({...t,headers:T}):S;if(ZBs(w))return w.then(D=>_(v,D));if(g)return;let R=VVn(w),x=Mur(c),k=Mur(l);e.onHeaders?.(o,x,E,YVn(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(k),Nur(v,r)}a(_,"handleReply");function E(){}return a(E,"resume"),!0}a(KVn,"mockDispatch");function n3s(){let t=this[VBs],e=this[zBs],r=this[WBs];return a(function(o,s){if(t.isMockActive)try{KVn.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[YBs](),u=this[UX][Dur]||this[UX].length,f=`, ${this[UX].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new Uhe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(JVn(l,e))r.call(this,o,s);else throw new Uhe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)${f}`)}else throw c}else r.call(this,o,s)},"dispatch")}a(n3s,"buildMockDispatch");function JVn(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>_4(n,r.host)))}a(JVn,"checkNetConnect");function i3s(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(i3s,"normalizeOrigin");function o3s(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new kur("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new kur("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new kur("options.ignoreTrailingSlash must to be a boolean");return r}a(o3s,"buildAndValidateMockOptions");ZVn.exports={getResponseData:VVn,getMockDispatch:WVn,addMockDispatch:t3s,deleteMockDispatch:Nur,buildKey:zVn,generateKeyValues:Mur,matchValue:_4,getResponse:r3s,getStatusText:YVn,mockDispatch:KVn,buildMockDispatch:n3s,checkNetConnect:JVn,buildAndValidateMockOptions:o3s,getHeaderByName:GVn,buildHeadersFromArray:Our,normalizeSearchParams:XBs,normalizeOrigin:i3s}});var jur=I((fEf,qur)=>{"use strict";p();var{getResponseData:s3s,buildKey:a3s,addMockDispatch:Lur}=SDe(),{kDispatches:Qct,kDispatchKey:qct,kDefaultHeaders:Bur,kDefaultTrailers:Fur,kContentLength:Uur,kMockDispatch:jct,kIgnoreTrailingSlash:Hct}=FX(),{InvalidArgumentError:E4}=uo(),{serializePathWithQuery:c3s}=No(),Qhe=class{static{a(this,"MockScope")}constructor(e){this[jct]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new E4("waitInMs must be a valid integer > 0");return this[jct].delay=e,this}persist(){return this[jct].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new E4("repeatTimes must be a valid integer > 0");return this[jct].times=e,this}},Qur=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new E4("opts must be an object");if(typeof e.path>"u")throw new E4("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=c3s(e.path,e.query);else{let n=new URL(e.path,"data://");e.path=n.pathname+n.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[qct]=a3s(e),this[Qct]=r,this[Hct]=e.ignoreTrailingSlash??!1,this[Bur]={},this[Fur]={},this[Uur]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=s3s(r),s=this[Uur]?{"content-length":o.length}:{},c={...this[Bur],...s,...n.headers},l={...this[Fur],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new E4("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new E4("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new E4("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=Lur(this[Qct],this[qct],s,{ignoreTrailingSlash:this[Hct]});return new Qhe(c)}let r={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(r);let n=this.createMockScopeDispatchData(r),o=Lur(this[Qct],this[qct],n,{ignoreTrailingSlash:this[Hct]});return new Qhe(o)}replyWithError(e){if(typeof e>"u")throw new E4("error must be defined");let r=Lur(this[Qct],this[qct],{error:e},{ignoreTrailingSlash:this[Hct]});return new Qhe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new E4("headers must be defined");return this[Bur]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new E4("trailers must be defined");return this[Fur]=e,this}replyContentLength(){return this[Uur]=!0,this}};qur.exports.MockInterceptor=Qur;qur.exports.MockScope=Qhe});var Vur=I((mEf,oWn)=>{"use strict";p();var{promisify:l3s}=require("node:util"),u3s=UH(),{buildMockDispatch:d3s}=SDe(),{kDispatches:Hur,kMockAgent:XVn,kClose:eWn,kOriginalClose:tWn,kOrigin:rWn,kOriginalDispatch:f3s,kConnected:Gur,kIgnoreTrailingSlash:nWn}=FX(),{MockInterceptor:p3s}=jur(),iWn=Al(),{InvalidArgumentError:h3s}=uo(),$ur=class extends u3s{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new h3s("Argument opts.agent must implement Agent");super(e,r),this[XVn]=r.agent,this[rWn]=e,this[nWn]=r.ignoreTrailingSlash??!1,this[Hur]=[],this[Gur]=1,this[f3s]=this.dispatch,this[tWn]=this.close.bind(this),this.dispatch=d3s.call(this),this.close=this[eWn]}get[iWn.kConnected](){return this[Gur]}intercept(e){return new p3s(e&&{ignoreTrailingSlash:this[nWn],...e},this[Hur])}cleanMocks(){this[Hur]=[]}async[eWn](){await l3s(this[tWn])(),this[Gur]=0,this[XVn][iWn.kClients].delete(this[rWn])}};oWn.exports=$ur});var Yur=I((yEf,zur)=>{"use strict";p();var{kMockCallHistoryAddLog:m3s}=FX(),{InvalidArgumentError:zH}=uo();function VH(t,e,r,n,o){switch(e.operator){case"OR":return n.push(...r(t,o)),n;case"AND":return r(t,n);default:throw new zH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(VH,"handleFilterCallsWithOptions");function g3s(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new zH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(g3s,"buildAndValidateFilterCallsOptions");function WH(t){return(e,r)=>{if(typeof e=="string"||e==null)return r.filter(n=>n[t]===e);if(e instanceof RegExp)return r.filter(n=>e.test(n[t]));throw new zH(`${t} parameter should be one of string, regexp, undefined or null`)}}a(WH,"makeFilterCalls");function A3s(t){try{let e=new URL(t.path,t.origin);return e.search.length!==0||(e.search=new URLSearchParams(t.query).toString()),e}catch(e){throw new zH("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a(A3s,"computeUrlWithMaybeSearchParameters");var Gct=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=A3s(e);this.fullUrl=r.toString(),this.origin=r.origin,this.path=r.pathname,this.searchParams=Object.fromEntries(r.searchParams),this.protocol=r.protocol,this.host=r.host,this.port=r.port,this.hash=r.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){let e={betweenKeyValueSeparator:"->",betweenPairSeparator:"|"},r="";return this.toMap().forEach((n,o)=>{(typeof n=="string"||n===void 0||n===null)&&(r=`${r}${o}${e.betweenKeyValueSeparator}${n}${e.betweenPairSeparator}`),(typeof n=="object"&&n!==null||Array.isArray(n))&&(r=`${r}${o}${e.betweenKeyValueSeparator}${JSON.stringify(n)}${e.betweenPairSeparator}`)}),r.slice(0,-1)}},Wur=class{static{a(this,"MockCallHistory")}logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(e){if(typeof e!="number")throw new zH("nthCall must be called with a number");if(!Number.isInteger(e))throw new zH("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new zH("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(e-1)}filterCalls(e,r){if(this.logs.length===0)return this.logs;if(typeof e=="function")return this.logs.filter(e);if(e instanceof RegExp)return this.logs.filter(n=>e.test(n.toString()));if(typeof e=="object"&&e!==null){if(Object.keys(e).length===0)return this.logs;let n={operator:"OR",...g3s(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=VH(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=VH(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=VH(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=VH(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=VH(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=VH(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=VH(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=VH(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new zH("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=WH.call(this,"protocol");filterCallsByHost=WH.call(this,"host");filterCallsByPort=WH.call(this,"port");filterCallsByOrigin=WH.call(this,"origin");filterCallsByPath=WH.call(this,"path");filterCallsByHash=WH.call(this,"hash");filterCallsByFullUrl=WH.call(this,"fullUrl");filterCallsByMethod=WH.call(this,"method");clear(){this.logs=[]}[m3s](e){let r=new Gct(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};zur.exports.MockCallHistory=Wur;zur.exports.MockCallHistoryLog=Gct});var Xur=I((vEf,fWn)=>{"use strict";p();var{promisify:y3s}=require("node:util"),_3s=wX(),{buildMockDispatch:E3s}=SDe(),{kDispatches:Kur,kMockAgent:sWn,kClose:aWn,kOriginalClose:cWn,kOrigin:lWn,kOriginalDispatch:v3s,kConnected:Jur,kIgnoreTrailingSlash:uWn}=FX(),{MockInterceptor:C3s}=jur(),dWn=Al(),{InvalidArgumentError:b3s}=uo(),Zur=class extends _3s{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new b3s("Argument opts.agent must implement Agent");super(e,r),this[sWn]=r.agent,this[lWn]=e,this[uWn]=r.ignoreTrailingSlash??!1,this[Kur]=[],this[Jur]=1,this[v3s]=this.dispatch,this[cWn]=this.close.bind(this),this.dispatch=E3s.call(this),this.close=this[aWn]}get[dWn.kConnected](){return this[Jur]}intercept(e){return new C3s(e&&{ignoreTrailingSlash:this[uWn],...e},this[Kur])}cleanMocks(){this[Kur]=[]}async[aWn](){await y3s(this[cWn])(),this[Jur]=0,this[sWn][dWn.kClients].delete(this[lWn])}};fWn.exports=Zur});var hWn=I((TEf,pWn)=>{"use strict";p();var{Transform:S3s}=require("node:stream"),{Console:T3s}=require("node:console"),I3s=process.versions.icu?"\u2705":"Y ",x3s=process.versions.icu?"\u274C":"N ";pWn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new S3s({transform(r,n,o){o(null,r)}}),this.logger=new T3s({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let r=e.map(({method:n,path:o,data:{statusCode:s},persist:c,times:l,timesInvoked:u,origin:d})=>({Method:n,Origin:d,Path:o,"Status code":s,Persistent:c?I3s:x3s,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var idr=I((wEf,vWn)=>{"use strict";p();var{kClients:QX}=Al(),w3s=PX(),{kAgent:edr,kMockAgentSet:$ct,kMockAgentGet:mWn,kDispatches:tdr,kIsMockActive:Vct,kNetConnect:qX,kGetNetConnect:R3s,kOptions:Wct,kFactory:zct,kMockAgentRegisterCallHistory:rdr,kMockAgentIsCallHistoryEnabled:TDe,kMockAgentAddCallHistoryLog:gWn,kMockAgentMockCallHistoryInstance:qhe,kMockAgentAcceptsNonStandardSearchParameters:AWn,kMockCallHistoryAddLog:k3s,kIgnoreTrailingSlash:yWn}=FX(),P3s=Vur(),D3s=Xur(),{matchValue:N3s,normalizeSearchParams:M3s,buildAndValidateMockOptions:O3s,normalizeOrigin:_Wn}=SDe(),{InvalidArgumentError:EWn,UndiciError:L3s}=uo(),B3s=$2e(),F3s=hWn(),{MockCallHistory:U3s}=Yur(),ndr=class extends B3s{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=O3s(e);if(this[qX]=!0,this[Vct]=!0,this[TDe]=r.enableCallHistory??!1,this[AWn]=r.acceptNonStandardSearchParameters??!1,this[yWn]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new EWn("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new w3s(e);this[edr]=n,this[QX]=n[QX],this[Wct]=r,this[TDe]&&this[rdr]()}get(e){let r=_Wn(e),n=this[yWn]?r.replace(/\/$/,""):r,o=this[mWn](n);return o||(o=this[zct](n),this[$ct](n,o)),o}dispatch(e,r){e.origin=_Wn(e.origin),this.get(e.origin),this[gWn](e);let n=this[AWn],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=M3s(c,n);o.path=`${s}?${l}`}return this[edr].dispatch(o,r)}async close(){this.clearCallHistory(),await this[edr].close(),this[QX].clear()}deactivate(){this[Vct]=!1}activate(){this[Vct]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[qX])?this[qX].push(e):this[qX]=[e];else if(typeof e>"u")this[qX]=!0;else throw new EWn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[qX]=!1}enableCallHistory(){return this[TDe]=!0,this}disableCallHistory(){return this[TDe]=!1,this}getCallHistory(){return this[qhe]}clearCallHistory(){this[qhe]!==void 0&&this[qhe].clear()}get isMockActive(){return this[Vct]}[rdr](){this[qhe]===void 0&&(this[qhe]=new U3s)}[gWn](e){this[TDe]&&(this[rdr](),this[qhe][k3s](e))}[$ct](e,r){this[QX].set(e,{count:0,dispatcher:r})}[zct](e){let r=Object.assign({agent:this},this[Wct]);return this[Wct]&&this[Wct].connections===1?new P3s(e,r):new D3s(e,r)}[mWn](e){let r=this[QX].get(e);if(r?.dispatcher)return r.dispatcher;if(typeof e!="string"){let n=this[zct]("http://localhost:9999");return this[$ct](e,n),n}for(let[n,o]of Array.from(this[QX]))if(o&&typeof n!="string"&&N3s(n,e)){let s=this[zct](e);return this[$ct](e,s),s[tdr]=o.dispatcher[tdr],s}}[R3s](){return this[qX]}pendingInterceptors(){let e=this[QX];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[tdr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new F3s}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new L3s(r.length===1?`1 interceptor is pending: +`,"latin1"),r!==null&&o!==r){if(n[glr])throw new CX;process.emitWarning(new CX)}e[Ed].timeout&&e[Ed].timeoutType===Ihe&&e[Ed].timeout.refresh&&e[Ed].timeout.refresh(),n[w8]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[NH]=!1,e&&(Fi(n[Tm]<=1,"pipeline should only contain this request"),o(e))}};SGn.exports=m5s});var MGn=I((jyf,NGn)=>{"use strict";p();var uR=require("node:assert"),{pipeline:x5s}=require("node:stream"),bs=No(),{RequestContentLengthMismatchError:Tlr,RequestAbortedError:w5s,SocketError:oDe,InformationalError:MH,InvalidArgumentError:R5s}=uo(),{kUrl:iDe,kReset:Ect,kClient:zT,kRunning:sDe,kPending:k5s,kQueue:OH,kPendingIdx:xlr,kRunningIdx:tD,kError:YT,kSocket:Bf,kStrictContentLength:P5s,kOnError:xhe,kMaxConcurrentStreams:yct,kPingInterval:IGn,kHTTP2Session:R8,kHTTP2InitialWindowSize:D5s,kHTTP2ConnectionWindowSize:N5s,kResume:h4,kSize:M5s,kHTTPContext:wlr,kClosed:Ilr,kBodyTimeout:O5s,kEnableConnectProtocol:rDe,kRemoteSettings:nDe,kHTTP2Stream:Act,kHTTP2SessionState:Rlr}=Al(),{channels:xGn}=kH(),lR=Symbol("open streams"),wGn,_ct;try{_ct=require("node:http2")}catch{_ct={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:L5s,HTTP2_HEADER_METHOD:RGn,HTTP2_HEADER_PATH:kGn,HTTP2_HEADER_SCHEME:Clr,HTTP2_HEADER_CONTENT_LENGTH:B5s,HTTP2_HEADER_EXPECT:F5s,HTTP2_HEADER_STATUS:blr,HTTP2_HEADER_PROTOCOL:U5s,NGHTTP2_REFUSED_STREAM:Q5s,NGHTTP2_CANCEL:q5s}}=_ct;function Slr(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.push(Buffer.from(r),Buffer.from(o));else e.push(Buffer.from(r),Buffer.from(n));return e}a(Slr,"parseH2Headers");function j5s(t,e){t[Bf]=e;let r=t[D5s],n=t[N5s],o=_ct.connect(t[iDe],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[yct],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[Bf]=e,o[lR]=0,o[zT]=t,o[Bf]=e,o[Rlr]={ping:{interval:t[IGn]===0?null:setInterval(V5s,t[IGn],o).unref()}},o[rDe]=!1,o[nDe]=!1,n&&bs.addListener(o,"connect",G5s.bind(o,n)),bs.addListener(o,"error",W5s),bs.addListener(o,"frameError",z5s),bs.addListener(o,"end",Y5s),bs.addListener(o,"goaway",K5s),bs.addListener(o,"close",J5s),bs.addListener(o,"remoteSettings",$5s),o.unref(),t[R8]=o,e[R8]=o,bs.addListener(e,"error",X5s),bs.addListener(e,"end",e4s),bs.addListener(e,"close",Z5s),e[Ilr]=!1,e.on("close",t4s),{version:"h2",defaultPipelining:1/0,write(s){return n4s(t,s)},resume(){H5s(t)},destroy(s,c){e[Ilr]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[sDe]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[nDe]===!1||bs.bodyLength(s.body)!==0&&(bs.isStream(s.body)||bs.isAsyncIterable(s.body)||bs.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[nDe]===!1;return!1}}}a(j5s,"connectH2");function H5s(t){let e=t[Bf];e?.destroyed===!1&&(t[M5s]===0||t[yct]===0?(e.unref(),t[R8].unref()):(e.ref(),t[R8].ref()))}a(H5s,"resumeH2");function G5s(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(G5s,"applyConnectionWindowSize");function $5s(t){if(this[zT][yct]=t.maxConcurrentStreams??this[zT][yct],this[nDe]===!0&&this[rDe]===!0&&t.enableConnectProtocol===!1){let e=new MH("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[Bf][YT]=e,this[zT][xhe](e);return}this[rDe]=t.enableConnectProtocol??this[rDe],this[nDe]=!0,this[zT][h4]()}a($5s,"onHttp2RemoteSettings");function V5s(t){let e=t[Rlr];if((t.closed||t.destroyed)&&e.ping.interval!=null){clearInterval(e.ping.interval),e.ping.interval=null;return}t.ping(r.bind(t));function r(n,o){let s=this[zT],c=this[zT];if(n!=null){let l=new MH(`HTTP/2: "PING" errored - type ${n.message}`);c[YT]=l,s[xhe](l)}else s.emit("ping",o)}a(r,"onPing")}a(V5s,"onHttp2SendPing");function W5s(t){uR(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Bf][YT]=t,this[zT][xhe](t)}a(W5s,"onHttp2SessionError");function z5s(t,e,r){if(r===0){let n=new MH(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[Bf][YT]=n,this[zT][xhe](n)}}a(z5s,"onHttp2FrameError");function Y5s(){let t=new oDe("other side closed",bs.getSocketInfo(this[Bf]));this.destroy(t),bs.destroy(this[Bf],t)}a(Y5s,"onHttp2SessionEnd");function K5s(t){let e=this[YT]||new oDe(`HTTP/2: "GOAWAY" frame received with code ${t}`,bs.getSocketInfo(this[Bf])),r=this[zT];if(r[Bf]=null,r[wlr]=null,this.close(),this[R8]=null,bs.destroy(this[Bf],e),r[tD]{e.aborted||e.completed||(x=x||new w5s,bs.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[xhe](x),t[h4]()),bs.destroy(m,x))},"abort");try{e.onConnect(E)}catch(x){bs.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[rDe]===!1?(bs.errorRequest(t,e,new MH("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[RGn]="CONNECT",g[U5s]="websocket",g[kGn]=s,f==="ws:"||f==="wss:"?g[Clr]=f==="ws:"?"http":"https":g[Clr]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[Act]=!0,A.once("response",(x,k)=>{let{[blr]:D,...N}=x;e.onUpgrade(D,Slr(N),A),++n[lR],t[OH][t[tD]++]=null}),A.on("error",()=>{(A.rstCode===Q5s||A.rstCode===q5s)&&E(new MH(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[lR]-=1,n[lR]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[Act]=!0,A.on("response",x=>{let{[blr]:k,...D}=x;e.onUpgrade(k,Slr(D),A),++n[lR],t[OH][t[tD]++]=null}),A.once("close",()=>{n[lR]-=1,n[lR]===0&&n.unref()}),A.setTimeout(r),!0);g[kGn]=s,g[Clr]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let S=bs.bodyLength(m);if(bs.isFormDataLike(m)){wGn??=She().extractBody;let[x,k]=wGn(m);g["content-type"]=k,m=x.stream,S=x.length}if(S==null&&(S=e.contentLength),v||(S=null),r4s(o)&&S>0&&e.contentLength!=null&&e.contentLength!==S){if(t[P5s])return bs.errorRequest(t,e,new Tlr),!1;process.emitWarning(new Tlr)}if(S!=null&&(uR(m||S===0,"no body must not have content length"),g[B5s]=`${S}`),n.ref(),xGn.sendHeaders.hasSubscribers){let x="";for(let k in g)x+=`${k}: ${g[k]}\r +`;xGn.sendHeaders.publish({request:e,headers:x,socket:n[Bf]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[F5s]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[Act]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[Act]=!0,R()),++n[lR],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[blr]:k,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(k),Slr(D),A.resume.bind(A),"")===!1&&A.pause(),A.on("data",N=>{e.aborted||e.completed||e.onData(N)===!1&&A.pause()})}),A.once("end",()=>{A.removeAllListeners("data"),w?(!e.aborted&&!e.completed&&e.onComplete({}),t[OH][t[tD]++]=null,t[h4]()):(E(new MH("HTTP/2: stream half-closed (remote)")),t[OH][t[tD]++]=null,t[xlr]=t[tD],t[h4]())}),A.once("close",()=>{A.removeAllListeners("data"),n[lR]-=1,n[lR]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),E(x)}),A.once("frameError",(x,k)=>{A.removeAllListeners("data"),E(new MH(`HTTP/2: "frameError" received - type ${x}, code ${k}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new MH(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[lR]-=1,n[lR]===0&&n.unref(),E(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||S===0?PGn(E,A,null,t,e,t[Bf],S,v):bs.isBuffer(m)?PGn(E,A,m,t,e,t[Bf],S,v):bs.isBlobLike(m)?typeof m.stream=="function"?DGn(E,A,m.stream(),t,e,t[Bf],S,v):o4s(E,A,m,t,e,t[Bf],S,v):bs.isStream(m)?i4s(E,t[Bf],v,A,m,t,e,S):bs.isIterable(m)?DGn(E,A,m,t,e,t[Bf],S,v):uR(!1)}a(R,"writeBodyH2")}a(n4s,"writeH2");function PGn(t,e,r,n,o,s,c,l){try{r!=null&&bs.isBuffer(r)&&(uR(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Ect]=!0),o.onRequestSent(),n[h4]()}catch(u){t(u)}}a(PGn,"writeBuffer");function i4s(t,e,r,n,o,s,c,l){uR(l!==0||s[sDe]===0,"stream body cannot be pipelined");let u=x5s(o,n,f=>{f?(bs.destroy(u,f),t(f)):(bs.removeAllListeners(u),c.onRequestSent(),r||(e[Ect]=!0),s[h4]())});bs.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(i4s,"writeStream");async function o4s(t,e,r,n,o,s,c,l){uR(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new Tlr;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Ect]=!0),n[h4]()}catch(u){t(u)}}a(o4s,"writeBlob");async function DGn(t,e,r,n,o,s,c,l){uR(c!==0||n[sDe]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let h=u;u=null,h()}}a(d,"onDrain");let f=a(()=>new Promise((h,m)=>{uR(u===null),s[YT]?m(s[YT]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[YT])throw s[YT];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Ect]=!0),n[h4]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(DGn,"writeIterable");NGn.exports=j5s});var UH=I(($yf,jGn)=>{"use strict";p();var k8=require("node:assert"),FGn=require("node:net"),aDe=require("node:http"),xX=No(),{ClientStats:s4s}=Ccr(),{channels:whe}=kH(),a4s=Zjn(),c4s=AX(),{InvalidArgumentError:vd,InformationalError:l4s,ClientDestroyedError:u4s}=uo(),d4s=yX(),{kUrl:m4,kServerName:FH,kClient:f4s,kBusy:Plr,kConnect:p4s,kResuming:wX,kRunning:dDe,kPending:fDe,kSize:cDe,kQueue:rD,kConnected:h4s,kConnecting:Rhe,kNeedDrain:BH,kKeepAliveDefaultTimeout:OGn,kHostHeader:m4s,kPendingIdx:nD,kRunningIdx:D8,kError:g4s,kPipelining:vct,kKeepAliveTimeoutValue:A4s,kMaxHeadersSize:y4s,kKeepAliveMaxTimeout:_4s,kKeepAliveTimeoutThreshold:E4s,kHeadersTimeout:v4s,kBodyTimeout:C4s,kStrictContentLength:b4s,kConnector:lDe,kMaxRequests:Dlr,kCounter:S4s,kClose:T4s,kDestroy:I4s,kDispatch:x4s,kLocalAddress:uDe,kMaxResponseSize:w4s,kOnError:R4s,kHTTPContext:_h,kMaxConcurrentStreams:k4s,kHTTP2InitialWindowSize:P4s,kHTTP2ConnectionWindowSize:D4s,kResume:P8,kPingInterval:N4s}=Al(),M4s=TGn(),O4s=MGn(),LH=Symbol("kClosedResolve"),L4s=aDe&&aDe.maxHeaderSize&&Number.isInteger(aDe.maxHeaderSize)&&aDe.maxHeaderSize>0?()=>aDe.maxHeaderSize:()=>{throw new vd("http module not available or http.maxHeaderSize invalid")},LGn=a(()=>{},"noop");function UGn(t){return t[vct]??t[_h]?.defaultPipelining??1}a(UGn,"getPipelining");var Nlr=class extends c4s{static{a(this,"Client")}constructor(e,{maxHeaderSize:r,headersTimeout:n,socketTimeout:o,requestTimeout:s,connectTimeout:c,bodyTimeout:l,idleTimeout:u,keepAlive:d,keepAliveTimeout:f,maxKeepAliveTimeout:h,keepAliveMaxTimeout:m,keepAliveTimeoutThreshold:g,socketPath:A,pipelining:y,tls:_,strictContentLength:E,maxCachedSessions:v,connect:S,maxRequestsPerClient:T,localAddress:w,maxResponseSize:R,autoSelectFamily:x,autoSelectFamilyAttemptTimeout:k,maxConcurrentStreams:D,allowH2:N,useH2c:O,initialWindowSize:B,connectionWindowSize:q,pingInterval:M,webSocket:L}={}){if(d!==void 0)throw new vd("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new vd("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new vd("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new vd("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new vd("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new vd("invalid maxHeaderSize")}else r=L4s();if(A!=null&&typeof A!="string")throw new vd("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new vd("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new vd("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new vd("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new vd("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new vd("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new vd("bodyTimeout must be a positive integer or zero");if(S!=null&&typeof S!="function"&&typeof S!="object")throw new vd("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new vd("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||FGn.isIP(w)===0))throw new vd("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new vd("maxResponseSize must be a positive number");if(k!=null&&(!Number.isInteger(k)||k<-1))throw new vd("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new vd("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new vd("maxConcurrentStreams must be a positive integer, greater than 0");if(O!=null&&typeof O!="boolean")throw new vd("useH2c must be a valid boolean value");if(B!=null&&(!Number.isInteger(B)||B<1))throw new vd("initialWindowSize must be a positive integer, greater than 0");if(q!=null&&(!Number.isInteger(q)||q<1))throw new vd("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new vd("pingInterval must be a positive integer, greater or equal to 0");if(super({webSocket:L}),typeof S!="function")S=d4s({..._,maxCachedSessions:v,allowH2:N,useH2c:O,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:k}:void 0,...S});else{let U=S;S=a((j,Q)=>U({...j,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},Q),"connect")}this[m4]=xX.parseOrigin(e),this[lDe]=S,this[vct]=y??1,this[y4s]=r,this[OGn]=f??4e3,this[_4s]=m??6e5,this[E4s]=g??2e3,this[A4s]=this[OGn],this[FH]=null,this[uDe]=w??null,this[wX]=0,this[BH]=0,this[m4s]=`host: ${this[m4].hostname}${this[m4].port?`:${this[m4].port}`:""}\r +`,this[C4s]=l??3e5,this[v4s]=n??3e5,this[b4s]=E??!0,this[Dlr]=T,this[LH]=null,this[w4s]=R>-1?R:-1,this[_h]=null,this[k4s]=D??100,this[P4s]=B??262144,this[D4s]=q??524288,this[N4s]=M??6e4,this[rD]=[],this[D8]=0,this[nD]=0,this[P8]=U=>Mlr(this,U),this[R4s]=U=>QGn(this,U)}get pipelining(){return this[vct]}set pipelining(e){this[vct]=e,this[P8](!0)}get stats(){return new s4s(this)}get[fDe](){return this[rD].length-this[nD]}get[dDe](){return this[nD]-this[D8]}get[cDe](){return this[rD].length-this[D8]}get[h4s](){return!!this[_h]&&!this[Rhe]&&!this[_h].destroyed}get[Plr](){return!!(this[_h]?.busy(null)||this[cDe]>=(UGn(this)||1)||this[fDe]>0)}[p4s](e){qGn(this),this.once("connect",e)}[x4s](e,r){let n=new a4s(this[m4].origin,e,r);return this[rD].push(n),this[wX]||(xX.bodyLength(n.body)==null&&xX.isIterable(n.body)?(this[wX]=1,queueMicrotask(()=>Mlr(this))):this[P8](!0)),this[wX]&&this[BH]!==2&&this[Plr]&&(this[BH]=2),this[BH]<2}[T4s](){return new Promise(e=>{this[cDe]?this[LH]=e:e(null)})}[I4s](e){return new Promise(r=>{let n=this[rD].splice(this[nD]);for(let s=0;s{this[LH]&&(this[LH](),this[LH]=null),r(null)},"callback");this[_h]?(this[_h].destroy(e,o),this[_h]=null):queueMicrotask(o),this[P8]()})}};function QGn(t,e){if(t[dDe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){k8(t[nD]===t[D8]);let r=t[rD].splice(t[D8]);for(let n=0;n{if(s){klr(t,s,{host:e,hostname:r,protocol:n,port:o}),t[P8]();return}if(t.destroyed){xX.destroy(c.on("error",LGn),new u4s),t[P8]();return}k8(c);try{t[_h]=c.alpnProtocol==="h2"?O4s(t,c):M4s(t,c)}catch(l){c.destroy().on("error",LGn),klr(t,l,{host:e,hostname:r,protocol:n,port:o}),t[P8]();return}t[Rhe]=!1,c[S4s]=0,c[Dlr]=t[Dlr],c[f4s]=t,c[g4s]=null,whe.connected.hasSubscribers&&whe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[_h]?.version,servername:t[FH],localAddress:t[uDe]},connector:t[lDe],socket:c}),t.emit("connect",t[m4],[t]),t[P8]()})}catch(s){klr(t,s,{host:e,hostname:r,protocol:n,port:o}),t[P8]()}}a(qGn,"connect");function klr(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[Rhe]=!1,whe.connectError.hasSubscribers&&whe.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[_h]?.version,servername:t[FH],localAddress:t[uDe]},connector:t[lDe],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(k8(t[dDe]===0);t[fDe]>0&&t[rD][t[nD]].servername===t[FH];){let c=t[rD][t[nD]++];xX.errorRequest(t,c,e)}else QGn(t,e);t.emit("connectionError",t[m4],[t],e)}}a(klr,"handleConnectError");function BGn(t){t[BH]=0,t.emit("drain",t[m4],[t])}a(BGn,"emitDrain");function Mlr(t,e){t[wX]!==2&&(t[wX]=2,B4s(t,e),t[wX]=0,t[D8]>256&&(t[rD].splice(0,t[D8]),t[nD]-=t[D8],t[D8]=0))}a(Mlr,"resume");function B4s(t,e){for(;;){if(t.destroyed){k8(t[fDe]===0);return}if(t[LH]&&!t[cDe]){t[LH](),t[LH]=null;return}if(t[_h]&&t[_h].resume(),t[Plr])t[BH]=2;else if(t[BH]===2){e?(t[BH]=1,queueMicrotask(()=>BGn(t))):BGn(t);continue}if(t[fDe]===0||t[dDe]>=(UGn(t)||1))return;let r=t[rD][t[nD]];if(r===null)return;if(t[m4].protocol==="https:"&&t[FH]!==r.servername){if(t[dDe]>0)return;t[FH]=r.servername,t[_h]?.destroy(new l4s("servername changed"),()=>{t[_h]=null,Mlr(t)})}if(t[Rhe])return;if(!t[_h]){qGn(t);return}if(t[_h].destroyed||t[_h].busy(r))return;!r.aborted&&t[_h].write(r)?t[nD]++:t[rD].splice(t[nD],1)}}a(B4s,"_resume");jGn.exports=Nlr});var Olr=I((Yyf,HGn)=>{"use strict";p();var Cct=class{static{a(this,"FixedCircularBuffer")}bottom=0;top=0;list=new Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};HGn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Cct}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Cct),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),r}}});var bct=I((Zyf,ZGn)=>{"use strict";p();var{PoolStats:F4s}=Ccr(),U4s=AX(),Q4s=Olr(),{kConnected:Llr,kSize:GGn,kRunning:$Gn,kPending:VGn,kQueued:pDe,kBusy:q4s,kFree:j4s,kUrl:H4s,kClose:G4s,kDestroy:$4s,kDispatch:V4s}=Al(),$0=Symbol("clients"),kv=Symbol("needDrain"),hDe=Symbol("queue"),Blr=Symbol("closed resolve"),Flr=Symbol("onDrain"),WGn=Symbol("onConnect"),zGn=Symbol("onDisconnect"),YGn=Symbol("onConnectionError"),Ulr=Symbol("get dispatcher"),KGn=Symbol("add client"),JGn=Symbol("remove client"),Qlr=class extends U4s{static{a(this,"PoolBase")}[hDe]=new Q4s;[pDe]=0;[$0]=[];[kv]=!1;[Flr](e,r,n){let o=this[hDe],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[pDe]--,s=!e.dispatch(c.opts,c.handler)}if(e[kv]=s,!s&&this[kv]&&(this[kv]=!1,this.emit("drain",r,[this,...n])),this[Blr]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[zGn]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[YGn]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[q4s](){return this[kv]}get[Llr](){let e=0;for(let{[Llr]:r}of this[$0])e+=r;return e}get[j4s](){let e=0;for(let{[Llr]:r,[kv]:n}of this[$0])e+=r&&!n;return e}get[VGn](){let e=this[pDe];for(let{[VGn]:r}of this[$0])e+=r;return e}get[$Gn](){let e=0;for(let{[$Gn]:r}of this[$0])e+=r;return e}get[GGn](){let e=this[pDe];for(let{[GGn]:r}of this[$0])e+=r;return e}get stats(){return new F4s(this)}[G4s](){if(this[hDe].isEmpty()){let e=[];for(let r=0;r{this[Blr]=e})}[$4s](e){for(;;){let n=this[hDe].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[$0].length);for(let n=0;n{this[kv]&&this[Flr](e,e[H4s],[e,this])}),this}[JGn](e){e.close(()=>{let r=this[$0].indexOf(e);r!==-1&&this[$0].splice(r,1)}),this[kv]=this[$0].some(r=>!r[kv]&&r.closed!==!0&&r.destroyed!==!0)}};ZGn.exports={PoolBase:Qlr,kClients:$0,kNeedDrain:kv,kAddClient:KGn,kRemoveClient:JGn,kGetDispatcher:Ulr}});var RX=I((t_f,r$n)=>{"use strict";p();var{PoolBase:W4s,kClients:Sct,kNeedDrain:z4s,kAddClient:Y4s,kGetDispatcher:K4s,kRemoveClient:J4s}=bct(),Z4s=UH(),{InvalidArgumentError:qlr}=uo(),XGn=No(),{kUrl:e$n}=Al(),X4s=yX(),Tct=Symbol("options"),jlr=Symbol("connections"),t$n=Symbol("factory");function eLs(t,e){return new Z4s(t,e)}a(eLs,"defaultFactory");var Hlr=class extends W4s{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=eLs,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,clientTtl:m,...g}={}){if(r!=null&&(!Number.isFinite(r)||r<0))throw new qlr("invalid connections");if(typeof n!="function")throw new qlr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new qlr("connect must be a function or an object");typeof o!="function"&&(o=X4s({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(g),this[jlr]=r||null,this[e$n]=XGn.parseOrigin(e),this[Tct]={...XGn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[Tct].interceptors=g.interceptors?{...g.interceptors}:void 0,this[t$n]=n,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let _ of y)Object.assign(_,{ttl:Date.now()})}),this.on("connectionError",(A,y,_)=>{for(let E of y){let v=this[Sct].indexOf(E);v!==-1&&this[Sct].splice(v,1)}})}[K4s](){let e=this[Tct].clientTtl;for(let r of this[Sct])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[J4s](r);else if(!r[z4s])return r;if(!this[jlr]||this[Sct].length{"use strict";p();var{BalancedPoolMissingUpstreamError:tLs,InvalidArgumentError:rLs}=uo(),{PoolBase:nLs,kClients:sy,kNeedDrain:mDe,kAddClient:iLs,kRemoveClient:oLs,kGetDispatcher:sLs}=bct(),aLs=RX(),{kUrl:Ict}=Al(),xct=No(),n$n=Symbol("factory"),gDe=Symbol("options"),i$n=Symbol("kGreatestCommonDivisor"),kX=Symbol("kCurrentWeight"),PX=Symbol("kIndex"),dR=Symbol("kWeight"),wct=Symbol("kMaxWeightPerServer"),Rct=Symbol("kErrorPenalty");function cLs(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(cLs,"getGreatestCommonDivisor");function lLs(t,e){return new aLs(t,e)}a(lLs,"defaultFactory");var Glr=class extends nLs{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=lLs,...n}={}){if(typeof r!="function")throw new rLs("factory must be a function.");super(n),this[gDe]={...xct.deepClone(n)},this[gDe].interceptors=n.interceptors?{...n.interceptors}:void 0,this[PX]=-1,this[kX]=0,this[wct]=this[gDe].maxWeightPerServer||100,this[Rct]=this[gDe].errorPenalty||15,Array.isArray(e)||(e=[e]),this[n$n]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=xct.parseOrigin(e).origin;if(this[sy].find(o=>o[Ict].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[n$n](r,this[gDe]);this[iLs](n),n.on("connect",()=>{n[dR]=Math.min(this[wct],n[dR]+this[Rct])}),n.on("connectionError",()=>{n[dR]=Math.max(1,n[dR]-this[Rct]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[dR]=Math.max(1,n[dR]-this[Rct]),this._updateBalancedPoolStats())});for(let o of this[sy])o[dR]=this[wct];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Ict].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[oLs](n),this}getUpstream(e){let r=xct.parseOrigin(e).origin;return this[sy].find(n=>n[Ict].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[sy].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Ict].origin)}[sLs](){if(this[sy].length===0)throw new tLs;if(!this[sy].find(s=>!s[mDe]&&s.closed!==!0&&s.destroyed!==!0)||this[sy].map(s=>s[mDe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[sy].findIndex(s=>!s[mDe]);for(;n++this[sy][o][dR]&&!s[mDe]&&(o=this[PX]),this[PX]===0&&(this[kX]=this[kX]-this[i$n],this[kX]<=0&&(this[kX]=this[wct])),s[dR]>=this[kX]&&!s[mDe])return s}return this[kX]=this[sy][o][dR],this[PX]=o,this[sy][o]}};o$n.exports=Glr});var u$n=I((a_f,l$n)=>{"use strict";p();var{PoolBase:uLs,kClients:kct,kNeedDrain:dLs,kAddClient:a$n,kGetDispatcher:fLs,kRemoveClient:pLs}=bct(),hLs=UH(),{InvalidArgumentError:$lr}=uo(),c$n=No(),{kUrl:Vlr}=Al(),mLs=yX(),ADe=Symbol("options"),Wlr=Symbol("connections"),zlr=Symbol("factory"),Pct=Symbol("index");function gLs(t,e){return new hLs(t,e)}a(gLs,"defaultFactory");var Ylr=class extends uLs{static{a(this,"RoundRobinPool")}constructor(e,{connections:r,factory:n=gLs,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,clientTtl:m,...g}={}){if(r!=null&&(!Number.isFinite(r)||r<0))throw new $lr("invalid connections");if(typeof n!="function")throw new $lr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new $lr("connect must be a function or an object");typeof o!="function"&&(o=mLs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[Wlr]=r||null,this[Vlr]=c$n.parseOrigin(e),this[ADe]={...c$n.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[ADe].interceptors=g.interceptors?{...g.interceptors}:void 0,this[zlr]=n,this[Pct]=-1,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let _ of y)Object.assign(_,{ttl:Date.now()})}),this.on("connectionError",(A,y,_)=>{for(let E of y){let v=this[kct].indexOf(E);v!==-1&&this[kct].splice(v,1)}})}[fLs](){let e=this[ADe].clientTtl,r=this[kct].length;if(r===0){let o=this[zlr](this[Vlr],this[ADe]);return this[a$n](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[pLs](o),n++;continue}if(!o[dLs])return o;n++}if(!this[Wlr]||r{"use strict";p();var{InvalidArgumentError:Dct,MaxOriginsReachedError:ALs}=uo(),{kClients:fR,kRunning:d$n,kClose:yLs,kDestroy:_Ls,kDispatch:ELs,kUrl:vLs}=Al(),CLs=AX(),bLs=RX(),SLs=UH(),TLs=No(),f$n=Symbol("onConnect"),p$n=Symbol("onDisconnect"),h$n=Symbol("onConnectionError"),m$n=Symbol("onDrain"),g$n=Symbol("factory"),Klr=Symbol("options"),yDe=Symbol("origins");function ILs(t,e){return e&&e.connections===1?new SLs(t,e):new bLs(t,e)}a(ILs,"defaultFactory");var Jlr=class extends CLs{static{a(this,"Agent")}constructor({factory:e=ILs,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new Dct("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new Dct("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new Dct("maxOrigins must be a number greater than 0");super(o),n&&typeof n!="function"&&(n={...n}),this[Klr]={...TLs.deepClone(o),maxOrigins:r,connect:n},this[g$n]=e,this[fR]=new Map,this[yDe]=new Set,this[m$n]=(s,c)=>{this.emit("drain",s,[this,...c])},this[f$n]=(s,c)=>{this.emit("connect",s,[this,...c])},this[p$n]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[h$n]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[d$n](){let e=0;for(let{dispatcher:r}of this[fR].values())e+=r[d$n];return e}[ELs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new Dct("opts.origin must be a non-empty string or URL.");if(this[yDe].size>=this[Klr].maxOrigins&&!this[yDe].has(n))throw new ALs;let o=this[fR].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[fR].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[fR].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[yDe].delete(n))},"closeClientIfUnused");s=this[g$n](e.origin,this[Klr]).on("drain",this[m$n]).on("connect",(l,u)=>{let d=this[fR].get(n);d&&(d.count+=1),this[f$n](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[p$n](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[h$n](l,u,d)}),this[fR].set(n,{count:0,dispatcher:s}),this[yDe].add(n)}return s.dispatch(e,r)}[yLs](){let e=[];for(let{dispatcher:r}of this[fR].values())e.push(r.close());return this[fR].clear(),Promise.all(e)}[_Ls](e){let r=[];for(let{dispatcher:n}of this[fR].values())r.push(n.destroy(e));return this[fR].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[fR].values())r.stats&&(e[r[vLs].origin]=r.stats);return e}};A$n.exports=Jlr});var E$n=I((p_f,_$n)=>{"use strict";p();var{Buffer:qH}=require("node:buffer"),Zlr=require("node:net"),{InvalidArgumentError:QH}=uo();function xLs(t){if(Zlr.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:qH.from(r)}}if(Zlr.isIPv6(t))return{type:4,buffer:y$n(t)};let e=qH.from(t,"utf8");if(e.length>255)throw new QH("Domain name too long (max 255 bytes)");return{type:3,buffer:qH.concat([qH.from([e.length]),e])}}a(xLs,"parseAddress");function y$n(t){let e=qH.alloc(16),r=t;if(t.includes(".")){let o=t.lastIndexOf(":"),s=t.slice(o+1);if(Zlr.isIPv4(s)){let c=s.split(".").map(Number),l=(c[0]<<8|c[1]).toString(16),u=(c[2]<<8|c[3]).toString(16);r=`${t.slice(0,o)}:${l}:${u}`}}let n=r.indexOf("::");if(n!==-1){let o=r.slice(0,n),s=r.slice(n+2),c=o===""?[]:o.split(":"),l=s===""?[]:s.split(":"),u=0;for(let d of c)e.writeUInt16BE(parseInt(d,16),u),u+=2;u=16-l.length*2;for(let d of l)e.writeUInt16BE(parseInt(d,16),u),u+=2}else{let o=r.split(":");for(let s=0;s{"use strict";p();var{EventEmitter:PLs}=require("node:events"),{Buffer:NX}=require("node:buffer"),{InvalidArgumentError:khe,Socks5ProxyError:jH}=uo(),{debuglog:DLs}=require("node:util"),{parseAddress:NLs}=E$n(),N8=DLs("undici:socks5"),v$n=NX.alloc(0),Nct=5,Phe={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},C$n={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},MX={IPV4:1,DOMAIN:3,IPV6:4},g4={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},U_={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},Xlr=class extends PLs{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new khe("socket is required");this.socket=e,this.options=r,this.state=U_.INITIAL,this.buffer=v$n,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],r.username&&r.password&&this.authMethods.push(Phe.USERNAME_PASSWORD),this.authMethods.push(Phe.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){N8("received data",e.length,"bytes in state",this.state),this.buffer=NX.concat([this.buffer,e]);try{switch(this.state){case U_.HANDSHAKING:this.handleHandshakeResponse();break;case U_.AUTHENTICATING:this.handleAuthResponse();break;case U_.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){N8("socket error",e),this.state=U_.ERROR,this.emit("error",e),this.destroy()}onClose(){N8("socket closed"),this.state=U_.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=U_.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==U_.INITIAL)throw new khe("Handshake already started");N8("starting handshake with",this.authMethods.length,"auth methods"),this.state=U_.HANDSHAKING;let e=NX.alloc(2+this.authMethods.length);e[0]=Nct,e[1]=this.authMethods.length,this.authMethods.forEach((r,n)=>{e[2+n]=r}),this.socket.write(e)}handleHandshakeResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],r=this.buffer[1];if(e!==Nct)throw new jH(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===Phe.NO_ACCEPTABLE)throw new jH("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),N8("server selected auth method",r),r===Phe.NO_AUTH)this.markAuthenticated();else if(r===Phe.USERNAME_PASSWORD)this.state=U_.AUTHENTICATING,this.sendAuthRequest();else throw new jH(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new khe("Username and password required for authentication");N8("sending username/password auth");let n=NX.from(e),o=NX.from(r);if(n.length>255||o.length>255)throw new khe("Username or password too long");let s=NX.alloc(3+n.length+o.length);s[0]=1,s[1]=n.length,n.copy(s,2),s[2+n.length]=o.length,o.copy(s,3+n.length),this.socket.write(s)}handleAuthResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],r=this.buffer[1];if(e!==1)throw new jH(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new jH("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),N8("authentication successful"),this.markAuthenticated()}connect(e,r){if(this.state===U_.CONNECTING||this.state===U_.CONNECTED)throw new khe("Connection already in progress");if(this.state!==U_.AUTHENTICATED)throw new khe("Client must be authenticated before CONNECT");N8("connecting to",e,r),this.state=U_.CONNECTING;let n=this.buildConnectRequest(C$n.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=NLs(r),c=NX.alloc(4+s.length+2);return c[0]=Nct,c[1]=e,c[2]=0,c[3]=o,s.copy(c,4),c.writeUInt16BE(n,4+s.length),c}handleConnectResponse(){if(this.buffer.length<4)return;let e=this.buffer[0],r=this.buffer[1],n=this.buffer[3];if(e!==Nct)throw new jH(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===MX.IPV4)o+=6;else if(n===MX.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===MX.IPV6)o+=18;else throw new jH(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var{URL:T$n}=require("node:url"),eur,MLs=AX(),{InvalidArgumentError:I$n}=uo(),{Socks5Client:OLs,STATES:LLs}=S$n(),{kDispatch:x$n,kClose:BLs,kDestroy:FLs}=Al(),ULs=RX(),QLs=yX(),{debuglog:qLs}=require("node:util"),HH=qLs("undici:socks5-proxy"),tur=Symbol("proxy url"),jLs=Symbol("proxy headers"),w$n=Symbol("proxy auth"),R$n=Symbol("proxy protocol"),OX=Symbol("pools"),k$n=Symbol("connector"),rur=Symbol("request tls settings"),P$n=!1,nur=class extends MLs{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),P$n||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),P$n=!0),!e)throw new I$n("Proxy URL is mandatory");let n=typeof e=="string"?new T$n(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new I$n("Proxy URL must use socks5:// or socks:// protocol");this[tur]=n,this[jLs]=r.headers||{},this[R$n]=r.proxyTls?"https:":"http:",this[rur]=r.requestTls,this[w$n]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[k$n]=r.connect||QLs({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[OX]=new Map}async createSocks5Connection(e,r){let n=this[tur].hostname,o=parseInt(this[tur].port)||1080;HH("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{this[k$n]({hostname:n,host:n,port:o,protocol:this[R$n]},(d,f)=>{d?u(d):l(f)})}),c=new OLs(s,this[w$n]);return c.on("error",l=>{HH("SOCKS5 error:",l),s.destroy()}),await c.handshake(),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 authentication timeout"))},5e3),f=a(()=>{clearTimeout(d),c.removeListener("error",h),l()},"onAuthenticated"),h=a(m=>{clearTimeout(d),c.removeListener("authenticated",f),u(m)},"onError");c.state===LLs.AUTHENTICATED?(clearTimeout(d),l()):(c.once("authenticated",f),c.once("error",h))}),await c.connect(e,r),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 connection timeout"))},5e3),f=a(m=>{HH("SOCKS5 tunnel established to",e,r,"via",m),clearTimeout(d),c.removeListener("error",h),l()},"onConnected"),h=a(m=>{clearTimeout(d),c.removeListener("connected",f),u(m)},"onError");c.once("connected",f),c.once("error",h)}),s}[x$n](e,r){let{origin:n}=e;HH("dispatching request to",n,"via SOCKS5");try{let o=String(n),s=this[OX].get(o);return(!s||s.destroyed||s.closed)&&(s=new ULs(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(c,l)=>{try{let u=new T$n(n),d=u.hostname,f=parseInt(u.port)||(u.protocol==="https:"?443:80);HH("establishing SOCKS5 connection to",d,f);let h=await this.createSocks5Connection(d,f),m=h;u.protocol==="https:"&&(eur||(eur=require("node:tls")),HH("upgrading to TLS"),m=eur.connect({...this[rur],socket:h,servername:this[rur]?.servername||d}),await new Promise((g,A)=>{m.once("secureConnect",g),m.once("error",A)})),l(null,m)}catch(u){HH("SOCKS5 connection error:",u),l(u)}},"connect")}),this[OX].set(o,s)),s[x$n](e,r)}catch(o){if(HH("dispatch error:",o),typeof r.onResponseError=="function")return r.onResponseError(null,o),!1;if(typeof r.onError=="function")return r.onError(o),!1;throw o}}async[BLs](){let e=[];for(let r of this[OX].values())e.push(r.close());this[OX].clear(),await Promise.all(e)}async[FLs](e){let r=[];for(let n of this[OX].values())r.push(n.destroy(e));this[OX].clear(),await Promise.all(r)}};D$n.exports=nur});var cur=I((C_f,G$n)=>{"use strict";p();var{kProxy:Dhe,kClose:U$n,kDestroy:Q$n,kDispatch:N$n}=Al(),HLs=DX(),q$n=RX(),j$n=AX(),{InvalidArgumentError:LX,RequestAbortedError:GLs,SecureProxyConnectionError:$Ls}=uo(),M$n=yX(),H$n=UH(),{channels:O$n}=kH(),VLs=iur(),Mct=Symbol("proxy agent"),GH=Symbol("proxy client"),M8=Symbol("proxy headers"),our=Symbol("request tls settings"),L$n=Symbol("proxy tls settings"),B$n=Symbol("connect endpoint function"),F$n=Symbol("tunnel proxy");function WLs(t){return t==="https:"?443:80}a(WLs,"defaultProtocolPort");function zLs(t,e){return new q$n(t,e)}a(zLs,"defaultFactory");var YLs=a(()=>{},"noop");function KLs(t,e){return e.connections===1?new H$n(t,e):new q$n(t,e)}a(KLs,"defaultAgentFactory");var sur=class extends j$n{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new LX("Proxy URL is mandatory");super(),this[M8]=r,o?this.#e=o(e,{connect:n}):this.#e=new H$n(e,{connect:n})}[N$n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new LX("Proxy Authentication Required (407)"));return}n&&n.call(this,l,u,d)};let{origin:o,path:s="/",headers:c={}}=e;if(e.path=o+s,!("host"in c)&&!("Host"in c)){let{host:l}=new URL(o);c.host=l}return e.headers={...this[M8],...c},this.#e[N$n](e,r)}[U$n](){return this.#e.close()}[Q$n](e){return this.#e.destroy(e)}},aur=class extends j$n{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new LX("Proxy uri is mandatory");let{clientFactory:r=zLs}=e;if(typeof r!="function")throw new LX("Proxy opts.clientFactory must be a function.");let{proxyTunnel:n=!0}=e;super();let o=this.#e(e),{href:s,origin:c,port:l,protocol:u,username:d,password:f,hostname:h}=o;if(this[Dhe]={uri:s,protocol:u},this[our]=e.requestTls,this[L$n]=e.proxyTls,this[M8]=e.headers||{},this[F$n]=n,e.auth&&e.token)throw new LX("opts.auth cannot be used in combination with opts.token");e.auth?this[M8]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[M8]["proxy-authorization"]=e.token:d&&f&&(this[M8]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=M$n({...e.proxyTls});this[B$n]=M$n({...e.requestTls});let g=e.factory||KLs,A=a((y,_)=>{let{protocol:E}=new URL(y);return this[Dhe].protocol==="socks5:"||this[Dhe].protocol==="socks:"?new VLs(this[Dhe].uri,{headers:this[M8],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls,requestTls:e.requestTls}):!this[F$n]&&E==="http:"&&this[Dhe].protocol==="http:"?new sur(this[Dhe].uri,{headers:this[M8],connect:m,factory:g}):g(y,_)},"factory");u==="socks5:"||u==="socks:"?this[GH]=null:this[GH]=r(o,{connect:m}),this[Mct]=new HLs({...e,factory:A,connect:a(async(y,_)=>{if(!this[GH]){_(new LX("Cannot establish tunnel connection without a proxy client"));return}let E=y.host;y.port||(E+=`:${WLs(y.protocol)}`);try{let v={origin:c,port:l,path:E,signal:y.signal,headers:{...this[M8],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[L$n]?.servername||h},{socket:S,statusCode:T}=await this[GH].connect(v);if(T!==200){S.on("error",YLs).destroy(),_(new GLs(`Proxy response (${T}) !== 200 when HTTP Tunneling`));return}if(O$n.proxyConnected.hasSubscribers&&O$n.proxyConnected.publish({socket:S,connectParams:v}),y.protocol!=="https:"){_(null,S);return}let w;this[our]?w=this[our].servername:w=y.servername,this[B$n]({...y,servername:w,httpSocket:S},_)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?_(new $Ls(v)):_(v)}},"connect")})}dispatch(e,r){let n=JLs(e.headers);if(ZLs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[Mct].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[U$n](){let e=[this[Mct].close()];return this[GH]&&e.push(this[GH].close()),Promise.all(e)}[Q$n](){let e=[this[Mct].destroy()];return this[GH]&&e.push(this[GH].destroy()),Promise.all(e)}};function JLs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new LX("Proxy-Authorization should be sent in ProxyAgent constructor")}a(ZLs,"throwIfProxyAuthIsSent");G$n.exports=aur});var Y$n=I((T_f,z$n)=>{"use strict";p();var XLs=AX(),{kClose:eBs,kDestroy:tBs,kClosed:$$n,kDestroyed:V$n,kDispatch:rBs,kNoProxyAgent:_De,kHttpProxyAgent:$H,kHttpsProxyAgent:BX}=Al(),W$n=cur(),nBs=DX(),iBs={"http:":80,"https:":443},lur=class extends XLs{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e;let{httpProxy:r,httpsProxy:n,noProxy:o,...s}=e;this[_De]=new nBs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[$H]=new W$n({...s,uri:c}):this[$H]=this[_De];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[BX]=new W$n({...s,uri:l}):this[BX]=this[$H],this.#o()}[rBs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[eBs](){return Promise.all([this[_De].close(),!this[$H][$$n]&&this[$H].close(),!this[BX][$$n]&&this[BX].close()])}[tBs](e){return Promise.all([this[_De].destroy(e),!this[$H][V$n]&&this[$H].destroy(e),!this[BX][V$n]&&this[BX].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||iBs[r]||0,this.#i(n,o)?r==="https:"?this[BX]:this[$H]:this[_De]}#i(e,r){if(this.#s&&this.#o(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let n=0;n{"use strict";p();var Nhe=require("node:assert"),{kRetryHandlerDefaultRetry:K$n}=Al(),{RequestRetryError:Mhe}=uo(),oBs=G2e(),{isDisturbed:J$n,parseRangeHeader:Z$n,wrapRequestBody:sBs}=No();function aBs(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(aBs,"calculateRetryAfterHeader");function X$n(t,e,r,n){let o=t["content-length"];if(o==null||!Number.isFinite(e.start)||!Number.isFinite(e.end))return;let s=Number(o),c=e.end-e.start+1;if(!Number.isFinite(s)||s!==c)throw new Mhe("Content-Length mismatch",r,{headers:t,data:{count:n}})}a(X$n,"validatePartialResponseContentLength");var uur=class t{static{a(this,"RetryHandler")}constructor(e,{dispatch:r,handler:n}){let{retryOptions:o,...s}=e,{retry:c,maxRetries:l,maxTimeout:u,minTimeout:d,timeoutFactor:f,methods:h,errorCodes:m,retryAfter:g,statusCodes:A,throwOnError:y}=o??{};this.error=null,this.dispatch=r,this.handler=oBs.wrap(n),this.opts={...s,body:sBs(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[K$n],retryAfter:g??!0,maxTimeout:u??30*1e3,minTimeout:d??500,timeoutFactor:f??2,maxRetries:l??5,methods:h??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:A??[500,502,503,504,429],errorCodes:m??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null}onResponseStartWithRetry(e,r,n,o,s){if(this.retryOpts.throwOnError){this.retryOpts.statusCodes.includes(r)===!1?(this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o)):this.error=s;return}if(J$n(this.opts.body)){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}function c(l){if(l){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o),e.resume();return}this.error=s,e.resume()}a(c,"shouldRetry"),e.pause(),this.retryOpts.retry(s,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},c.bind(this))}onRequestStart(e,r){this.headersSent||this.handler.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.handler.onRequestUpgrade?.(e,r,n,o)}static[K$n](e,{state:r,opts:n},o){let{statusCode:s,code:c,headers:l}=e,{method:u,retryOptions:d}=n,{maxRetries:f,minTimeout:h,maxTimeout:m,timeoutFactor:g,statusCodes:A,errorCodes:y,methods:_}=d,{counter:E}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(_)&&!_.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(E>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?aBs(l["retry-after"]):v*1e3);let S=v>0?Math.min(v,m):Math.min(h*g**(E-1),m);setTimeout(()=>o(null),S)}onResponseStart(e,r,n,o){if(this.error=null,this.retryCount+=1,r>=300){let s=new Mhe("Request failed",r,{headers:n,data:{count:this.retryCount}});this.onResponseStartWithRetry(e,r,n,o,s);return}if(this.headersSent){if(r!==206&&(this.start>0||r!==200))throw new Mhe("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=Z$n(n["content-range"]);if(!s)throw new Mhe("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new Mhe("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});X$n(n,s,r,this.retryCount);let{start:c,size:l,end:u=l?l-1:null}=s;Nhe(this.start===c,"content-range mismatch"),Nhe(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=Z$n(n["content-range"]);if(s==null){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}X$n(n,s,r,this.retryCount);let{start:c,size:l,end:u=l?l-1:null}=s;Nhe(c!=null&&Number.isFinite(c),"content-range mismatch"),Nhe(u!=null&&Number.isFinite(u),"invalid content-length"),this.start=c,this.end=u}if(this.end==null){let s=n["content-length"];this.end=s!=null?Number(s)-1:null}Nhe(Number.isFinite(this.start)),Nhe(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=!0,this.etag=n.etag!=null?n.etag:null,this.etag!=null&&this.etag[0]==="W"&&this.etag[1]==="/"&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o)}else throw new Mhe("Request failed",r,{headers:n,data:{count:this.retryCount}})}onResponseData(e,r){this.error||(this.start+=r.length,this.handler.onResponseData?.(e,r))}onResponseEnd(e,r){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error)return this.retryCount=0,this.handler.onResponseEnd?.(e,r);this.retry(e)}retry(e){if(this.start!==0){let r={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(r["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...r}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(r){this.handler.onResponseError?.(e,r)}}onResponseError(e,r){if(e?.aborted||J$n(this.opts.body)){this.handler.onResponseError?.(e,r);return}function n(o){if(!o){this.retry(e);return}this.handler?.onResponseError?.(e,o)}a(n,"shouldRetry"),this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(r,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},n.bind(this))}};eVn.exports=uur});var rVn=I((P_f,tVn)=>{"use strict";p();var cBs=$2e(),lBs=Oct(),dur=class extends cBs{static{a(this,"RetryAgent")}#e=null;#t=null;constructor(e,r={}){super(r),this.#e=e,this.#t=r}dispatch(e,r){let n=new lBs({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:r});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};tVn.exports=dur});var oVn=I((M_f,iVn)=>{"use strict";p();var{InvalidArgumentError:nVn}=uo(),uBs=UH(),fur=class extends uBs{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new nVn("h2c-client: Only h2c protocol is supported");let{maxConcurrentStreams:n,pipelining:o,...s}=r??{},c=100,l=100;if(n!=null&&Number.isInteger(n)&&n>0&&(c=n),o!=null&&Number.isInteger(o)&&o>0&&(l=o),l>c)throw new nVn("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};iVn.exports=fur});var hVn=I((B_f,pVn)=>{"use strict";p();var lVn=require("node:assert"),{Readable:dBs}=require("node:stream"),{RequestAbortedError:uVn,NotSupportedError:fBs,InvalidArgumentError:pBs,AbortError:Lct}=uo(),dVn=No(),{ReadableStreamFrom:hBs}=No(),KT=Symbol("kConsume"),Bct=Symbol("kReading"),FX=Symbol("kBody"),sVn=Symbol("kAbort"),fVn=Symbol("kContentType"),pur=Symbol("kContentLength"),hur=Symbol("kUsed"),Fct=Symbol("kBytesRead"),mBs=a(()=>{},"noop"),mur=class extends dBs{static{a(this,"BodyReadable")}constructor({resume:e,abort:r,contentType:n="",contentLength:o,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[sVn]=r,this[KT]=null,this[Fct]=0,this[FX]=null,this[hur]=!1,this[fVn]=n,this[pur]=Number.isFinite(o)?o:null,this[Bct]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new uVn),e&&this[sVn](),this[hur]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[Bct]=!0,this[hur]=!0),super.on(e,r)}addListener(e,r){return this.on(e,r)}off(e,r){let n=super.off(e,r);return(e==="data"||e==="readable")&&(this[Bct]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[Fct]+=e.length,this[KT])?(Aur(this[KT],e),this[Bct]?super.push(e):!0):super.push(e)}text(){return EDe(this,"text")}json(){return EDe(this,"json")}blob(){return EDe(this,"blob")}bytes(){return EDe(this,"bytes")}arrayBuffer(){return EDe(this,"arrayBuffer")}async formData(){throw new fBs}get bodyUsed(){return dVn.isDisturbed(this)}get body(){return this[FX]||(this[FX]=hBs(this),this[KT]&&(this[FX].getReader(),lVn(this[FX].locked))),this[FX]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new pBs("signal must be an AbortSignal"));let n=e?.limit&&Number.isFinite(e.limit)?e.limit:128*1024;return r?.aborted?Promise.reject(r.reason??new Lct):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[pur]&&this[pur]>n||this[Fct]>n)&&this.destroy(new Lct),r){let c=a(()=>{this.destroy(r.reason??new Lct)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new Lct):o(null)})}else this.on("close",o);this.on("error",mBs).on("data",()=>{this[Fct]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function gBs(t){return t[FX]?.locked===!0||t[KT]!==null}a(gBs,"isLocked");function ABs(t){return dVn.isDisturbed(t)||gBs(t)}a(ABs,"isUnusable");function EDe(t,e){return lVn(!t[KT]),new Promise((r,n)=>{if(ABs(t)){let o=t._readableState;o.destroyed&&o.closeEmitted===!1?t.on("error",n).on("close",()=>{n(new TypeError("unusable"))}):n(o.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[KT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){yur(this[KT],o)}).on("close",function(){this[KT].body!==null&&yur(this[KT],new uVn)}),yBs(t[KT])})})}a(EDe,"consume");function yBs(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,n=e.buffer.length;for(let o=r;o2&&n[0]===239&&n[1]===187&&n[2]===191?3:0;return!r||r==="utf8"||r==="utf-8"?n.utf8Slice(s,o):n.subarray(s,o).toString(r)}a(gur,"chunksDecode");function aVn(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let r=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),n=0;for(let o=0;o{"use strict";p();var _Bs=require("node:assert"),{AsyncResource:EBs}=require("node:async_hooks"),{Readable:vBs}=hVn(),{InvalidArgumentError:Ohe,RequestAbortedError:mVn}=uo(),pR=No();function vDe(){}a(vDe,"noop");var Uct=class extends EBs{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Ohe("invalid opts");let{signal:n,method:o,opaque:s,body:c,onInfo:l,responseHeaders:u,highWaterMark:d}=e;try{if(typeof r!="function")throw new Ohe("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new Ohe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Ohe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Ohe("invalid method");if(l&&typeof l!="function")throw new Ohe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw pR.isStream(c)&&pR.destroy(c.on("error",vDe),f),f}this.method=o,this.responseHeaders=u||null,this.opaque=s||null,this.callback=r,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.highWaterMark=d,this.reason=null,this.removeAbortListener=null,n?.aborted?this.reason=n.reason??new mVn:n&&(this.removeAbortListener=pR.addAbortListener(n,()=>{this.reason=n.reason??new mVn,this.res?pR.destroy(this.res.on("error",vDe),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}_Bs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{callback:s,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,h=d==="raw"?pR.parseRawHeaders(r):pR.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?pR.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new vBs({resume:n,abort:l,contentType:g,contentLength:this.method!=="HEAD"&&A?Number(A):null,highWaterMark:f});if(this.removeAbortListener&&(y.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=y,s!==null)try{this.runInAsyncScope(s,null,null,{statusCode:e,statusText:o,headers:h,trailers:this.trailers,opaque:c,body:y,context:u})}catch(_){this.res=null,pR.destroy(y.on("error",vDe),_),queueMicrotask(()=>{throw _})}}onData(e){return this.res.push(e)}onComplete(e){pR.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:r,callback:n,body:o,opaque:s}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:s})})),r&&(this.res=null,queueMicrotask(()=>{pR.destroy(r.on("error",vDe),e)})),o&&(this.body=null,pR.isStream(o)&&(o.on("error",vDe),pR.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function gVn(t,e){if(e===void 0)return new Promise((r,n)=>{gVn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Uct(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(gVn,"request");_ur.exports=gVn;_ur.exports.RequestHandler=Uct});var CDe=I((H_f,EVn)=>{"use strict";p();var{addAbortListener:CBs}=No(),{RequestAbortedError:bBs}=uo(),Lhe=Symbol("kListener"),A4=Symbol("kSignal");function yVn(t){t.abort?t.abort(t[A4]?.reason):t.reason=t[A4]?.reason??new bBs,_Vn(t)}a(yVn,"abort");function SBs(t,e){if(t.reason=null,t[A4]=null,t[Lhe]=null,!!e){if(e.aborted){yVn(t);return}t[A4]=e,t[Lhe]=()=>{yVn(t)},CBs(t[A4],t[Lhe])}}a(SBs,"addSignal");function _Vn(t){t[A4]&&("removeEventListener"in t[A4]?t[A4].removeEventListener("abort",t[Lhe]):t[A4].removeListener("abort",t[Lhe]),t[A4]=null,t[Lhe]=null)}a(_Vn,"removeSignal");EVn.exports={addSignal:SBs,removeSignal:_Vn}});var SVn=I((V_f,bVn)=>{"use strict";p();var TBs=require("node:assert"),{finished:IBs}=require("node:stream"),{AsyncResource:xBs}=require("node:async_hooks"),{InvalidArgumentError:Bhe,InvalidReturnValueError:wBs}=uo(),O8=No(),{addSignal:RBs,removeSignal:vVn}=CDe();function kBs(){}a(kBs,"noop");var Eur=class extends xBs{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new Bhe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new Bhe("invalid callback");if(typeof r!="function")throw new Bhe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new Bhe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Bhe("invalid method");if(u&&typeof u!="function")throw new Bhe("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw O8.isStream(l)&&O8.destroy(l.on("error",kBs),f),f}this.responseHeaders=d||null,this.opaque=c||null,this.factory=r,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=l,this.onInfo=u||null,O8.isStream(l)&&l.on("error",f=>{this.onError(f)}),RBs(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}TBs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{factory:s,opaque:c,context:l,responseHeaders:u}=this,d=u==="raw"?O8.parseRawHeaders(r):O8.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:d});return}if(this.factory=null,s===null)return;let f=this.runInAsyncScope(s,null,{statusCode:e,headers:d,opaque:c,context:l});if(!f||typeof f.write!="function"||typeof f.end!="function"||typeof f.on!="function")throw new wBs("expected Writable");return IBs(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:_,abort:E}=this;this.res=null,(m||!A?.readable)&&O8.destroy(A,m),this.callback=null,this.runInAsyncScope(g,null,m||null,{opaque:y,trailers:_}),m&&E()}),f.on("drain",n),this.res=f,(f.writableNeedDrain!==void 0?f.writableNeedDrain:f._writableState?.needDrain)!==!0}onData(e){let{res:r}=this;return r?r.write(e):!0}onComplete(e){let{res:r}=this;vVn(this),r&&(this.trailers=O8.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;vVn(this),this.factory=null,r?(this.res=null,O8.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,O8.destroy(s,e))}};function CVn(t,e,r){if(r===void 0)return new Promise((n,o)=>{CVn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new Eur(t,e,r);this.dispatch(t,n)}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(CVn,"stream");bVn.exports=CVn});var wVn=I((Y_f,xVn)=>{"use strict";p();var{Readable:IVn,Duplex:PBs,PassThrough:DBs}=require("node:stream"),NBs=require("node:assert"),{AsyncResource:MBs}=require("node:async_hooks"),{InvalidArgumentError:bDe,InvalidReturnValueError:OBs,RequestAbortedError:vur}=uo(),y4=No(),{addSignal:LBs,removeSignal:BBs}=CDe();function TVn(){}a(TVn,"noop");var Fhe=Symbol("resume"),Cur=class extends IVn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Fhe]=null}_read(){let{[Fhe]:e}=this;e&&(this[Fhe]=null,e())}_destroy(e,r){this._read(),r(e)}},bur=class extends IVn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Fhe]=e}_read(){this[Fhe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new vur),r(e)}},Sur=class extends MBs{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new bDe("invalid opts");if(typeof r!="function")throw new bDe("invalid handler");let{signal:n,method:o,opaque:s,onInfo:c,responseHeaders:l}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new bDe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new bDe("invalid method");if(c&&typeof c!="function")throw new bDe("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=l||null,this.handler=r,this.abort=null,this.context=null,this.onInfo=c||null,this.req=new Cur().on("error",TVn),this.ret=new PBs({readableObjectMode:e.objectMode,autoDestroy:!0,read:a(()=>{let{body:u}=this;u?.resume&&u.resume()},"read"),write:a((u,d,f)=>{let{req:h}=this;h.push(u,d)||h._readableState.destroyed?f():h[Fhe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new vur),A&&u&&A(),y4.destroy(f,u),y4.destroy(h,u),y4.destroy(m,u),BBs(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,LBs(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}NBs(!n,"pipeline cannot be retried"),this.abort=e,this.context=r}onHeaders(e,r,n){let{opaque:o,handler:s,context:c}=this;if(e<200){if(this.onInfo){let u=this.responseHeaders==="raw"?y4.parseRawHeaders(r):y4.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new bur(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?y4.parseRawHeaders(r):y4.parseHeaders(r);l=this.runInAsyncScope(s,null,{statusCode:e,headers:u,opaque:o,body:this.res,context:c})}catch(u){throw this.res.on("error",TVn),u}if(!l||typeof l.on!="function")throw new OBs("expected Readable");l.on("data",u=>{let{ret:d,body:f}=this;!d.push(u)&&f.pause&&f.pause()}).on("error",u=>{let{ret:d}=this;y4.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||y4.destroy(u,new vur)}),this.body=l}onData(e){let{res:r}=this;return r.push(e)}onComplete(e){let{res:r}=this;r.push(null)}onError(e){let{ret:r}=this;this.handler=null,y4.destroy(r,e)}};function FBs(t,e){try{let r=new Sur(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new DBs().destroy(r)}}a(FBs,"pipeline");xVn.exports=FBs});var MVn=I((Z_f,NVn)=>{"use strict";p();var{InvalidArgumentError:Tur,SocketError:UBs}=uo(),{AsyncResource:QBs}=require("node:async_hooks"),RVn=require("node:assert"),kVn=No(),{kHTTP2Stream:qBs}=Al(),{addSignal:jBs,removeSignal:PVn}=CDe(),Iur=class extends QBs{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Tur("invalid opts");if(typeof r!="function")throw new Tur("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Tur("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,jBs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}RVn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new UBs("bad upgrade",null)}onUpgrade(e,r,n){RVn(n[qBs]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;PVn(this),this.callback=null;let l=this.responseHeaders==="raw"?kVn.parseRawHeaders(r):kVn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;PVn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function DVn(t,e){if(e===void 0)return new Promise((r,n)=>{DVn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Iur(t,e),n={...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"};this.dispatch(n,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(DVn,"upgrade");NVn.exports=DVn});var UVn=I((tEf,FVn)=>{"use strict";p();var HBs=require("node:assert"),{AsyncResource:GBs}=require("node:async_hooks"),{InvalidArgumentError:xur,SocketError:$Bs}=uo(),OVn=No(),{addSignal:VBs,removeSignal:LVn}=CDe(),wur=class extends GBs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new xur("invalid opts");if(typeof r!="function")throw new xur("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new xur("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,VBs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}HBs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new $Bs("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;LVn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?OVn.parseRawHeaders(r):OVn.parseHeaders(r)),this.runInAsyncScope(o,null,null,{statusCode:e,headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;LVn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function BVn(t,e){if(e===void 0)return new Promise((r,n)=>{BVn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new wur(t,e),n={...t,method:"CONNECT"};this.dispatch(n,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(BVn,"connect");FVn.exports=BVn});var QVn=I((iEf,Uhe)=>{"use strict";p();Uhe.exports.request=AVn();Uhe.exports.stream=SVn();Uhe.exports.pipeline=wVn();Uhe.exports.upgrade=MVn();Uhe.exports.connect=UVn()});var kur=I((sEf,jVn)=>{"use strict";p();var{UndiciError:WBs}=uo(),qVn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),Rur=class extends WBs{static{a(this,"MockNotMatchedError")}constructor(e){super(e),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[qVn]===!0}get[qVn](){return!0}};jVn.exports={MockNotMatchedError:Rur}});var UX=I((lEf,HVn)=>{"use strict";p();HVn.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOriginalDispatch:Symbol("original dispatch"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected"),kIgnoreTrailingSlash:Symbol("ignore trailing slash"),kMockAgentMockCallHistoryInstance:Symbol("mock agent mock call history name"),kMockAgentRegisterCallHistory:Symbol("mock agent register mock call history"),kMockAgentAddCallHistoryLog:Symbol("mock agent add call history log"),kMockAgentIsCallHistoryEnabled:Symbol("mock agent is call history enabled"),kMockAgentAcceptsNonStandardSearchParameters:Symbol("mock agent accepts non standard search parameters"),kMockCallHistoryAddLog:Symbol("mock call history add log"),kTotalDispatchCount:Symbol("total dispatch count")}});var SDe=I((dEf,eWn)=>{"use strict";p();var{MockNotMatchedError:Qhe}=kur(),{kDispatches:QX,kMockAgent:zBs,kOriginalDispatch:YBs,kOrigin:KBs,kGetNetConnect:JBs,kTotalDispatchCount:Nur}=UX(),{serializePathWithQuery:ZBs}=No(),{STATUS_CODES:XBs}=require("node:http"),{types:{isPromise:e3s}}=require("node:util"),{InvalidArgumentError:Pur}=uo();function _4(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(_4,"matchValue");function $Vn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a($Vn,"lowerCaseEntries");function VVn(t,e){if(Array.isArray(t)){for(let r=0;r"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[r,n]of Object.entries(t.headers)){let o=VVn(e,r);if(!_4(n,o))return!1}return!0}a(WVn,"matchHeaders");function t3s(t){if(typeof t!="string")return t;let e=new URLSearchParams(t),r=new URLSearchParams;for(let[n,o]of e.entries()){if(n=n.replace("[]",""),/^(['"]).*\1$/.test(o)){r.append(n,o);continue}if(o.includes(",")){let c=o.split(",");for(let l of c)r.append(n,l);continue}r.append(n,o)}return r}a(t3s,"normalizeSearchParams");function Dur(t){if(typeof t!="string")return t;let e=t.split("?",3);if(e.length!==2)return t;let r=new URLSearchParams(e.pop());return r.sort(),[...e,r.toString()].join("?")}a(Dur,"safeUrl");function r3s(t,{path:e,method:r,body:n,headers:o}){let s=_4(t.path,e),c=_4(t.method,r),l=typeof t.body<"u"?_4(t.body,n):!0,u=WVn(t,o);return s&&c&&l&&u}a(r3s,"matchKey");function zVn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(zVn,"getResponseData");function YVn(t,e){let r=e.query?ZBs(e.path,e.query):e.path,n=typeof r=="string"?Dur(r):r,o=GVn(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?_4(GVn(Dur(c)),o):_4(Dur(c),n));if(s.length===0)throw new Qhe(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>_4(c,e.method)),s.length===0)throw new Qhe(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?_4(c,e.body):!0),s.length===0)throw new Qhe(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>WVn(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new Qhe(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(YVn,"getMockDispatch");function n3s(t,e,r,n){let o={timesInvoked:0,times:1,persist:!1,consumed:!1,...n},s=typeof r=="function"?{callback:r}:{...r},c={...o,...e,pending:!0,data:{error:null,...s}};return t.push(c),t[Nur]=(t[Nur]||0)+1,c}a(n3s,"addMockDispatch");function Mur(t,e){let r=t.findIndex(n=>n.consumed?r3s(n,e):!1);r!==-1&&t.splice(r,1)}a(Mur,"deleteMockDispatch");function GVn(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(GVn,"removeTrailingSlash");function KVn(t){let{path:e,method:r,body:n,headers:o,query:s}=t;return{path:e,method:r,body:n,headers:o,query:s}}a(KVn,"buildKey");function Our(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,_(this[QX])},d):_(this[QX]);function _(v,S=s){if(g)return;let T=Array.isArray(t.headers)?Lur(t.headers):t.headers,w=typeof S=="function"?S({...t,headers:T}):S;if(e3s(w))return w.then(D=>_(v,D));if(g)return;let R=zVn(w),x=Our(c),k=Our(l);e.onHeaders?.(o,x,E,JVn(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(k),Mur(v,r)}a(_,"handleReply");function E(){}return a(E,"resume"),!0}a(ZVn,"mockDispatch");function o3s(){let t=this[zBs],e=this[KBs],r=this[YBs];return a(function(o,s){if(t.isMockActive)try{ZVn.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[JBs](),u=this[QX][Nur]||this[QX].length,f=`, ${this[QX].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new Qhe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(XVn(l,e))r.call(this,o,s);else throw new Qhe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)${f}`)}else throw c}else r.call(this,o,s)},"dispatch")}a(o3s,"buildMockDispatch");function XVn(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>_4(n,r.host)))}a(XVn,"checkNetConnect");function s3s(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(s3s,"normalizeOrigin");function a3s(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new Pur("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new Pur("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new Pur("options.ignoreTrailingSlash must to be a boolean");return r}a(a3s,"buildAndValidateMockOptions");eWn.exports={getResponseData:zVn,getMockDispatch:YVn,addMockDispatch:n3s,deleteMockDispatch:Mur,buildKey:KVn,generateKeyValues:Our,matchValue:_4,getResponse:i3s,getStatusText:JVn,mockDispatch:ZVn,buildMockDispatch:o3s,checkNetConnect:XVn,buildAndValidateMockOptions:a3s,getHeaderByName:VVn,buildHeadersFromArray:Lur,normalizeSearchParams:t3s,normalizeOrigin:s3s}});var Hur=I((hEf,jur)=>{"use strict";p();var{getResponseData:c3s,buildKey:l3s,addMockDispatch:Bur}=SDe(),{kDispatches:Qct,kDispatchKey:qct,kDefaultHeaders:Fur,kDefaultTrailers:Uur,kContentLength:Qur,kMockDispatch:jct,kIgnoreTrailingSlash:Hct}=UX(),{InvalidArgumentError:E4}=uo(),{serializePathWithQuery:u3s}=No(),qhe=class{static{a(this,"MockScope")}constructor(e){this[jct]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new E4("waitInMs must be a valid integer > 0");return this[jct].delay=e,this}persist(){return this[jct].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new E4("repeatTimes must be a valid integer > 0");return this[jct].times=e,this}},qur=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new E4("opts must be an object");if(typeof e.path>"u")throw new E4("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=u3s(e.path,e.query);else{let n=new URL(e.path,"data://");e.path=n.pathname+n.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[qct]=l3s(e),this[Qct]=r,this[Hct]=e.ignoreTrailingSlash??!1,this[Fur]={},this[Uur]={},this[Qur]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=c3s(r),s=this[Qur]?{"content-length":o.length}:{},c={...this[Fur],...s,...n.headers},l={...this[Uur],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new E4("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new E4("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new E4("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=Bur(this[Qct],this[qct],s,{ignoreTrailingSlash:this[Hct]});return new qhe(c)}let r={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(r);let n=this.createMockScopeDispatchData(r),o=Bur(this[Qct],this[qct],n,{ignoreTrailingSlash:this[Hct]});return new qhe(o)}replyWithError(e){if(typeof e>"u")throw new E4("error must be defined");let r=Bur(this[Qct],this[qct],{error:e},{ignoreTrailingSlash:this[Hct]});return new qhe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new E4("headers must be defined");return this[Fur]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new E4("trailers must be defined");return this[Uur]=e,this}replyContentLength(){return this[Qur]=!0,this}};jur.exports.MockInterceptor=qur;jur.exports.MockScope=qhe});var Wur=I((AEf,aWn)=>{"use strict";p();var{promisify:d3s}=require("node:util"),f3s=UH(),{buildMockDispatch:p3s}=SDe(),{kDispatches:Gur,kMockAgent:tWn,kClose:rWn,kOriginalClose:nWn,kOrigin:iWn,kOriginalDispatch:h3s,kConnected:$ur,kIgnoreTrailingSlash:oWn}=UX(),{MockInterceptor:m3s}=Hur(),sWn=Al(),{InvalidArgumentError:g3s}=uo(),Vur=class extends f3s{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new g3s("Argument opts.agent must implement Agent");super(e,r),this[tWn]=r.agent,this[iWn]=e,this[oWn]=r.ignoreTrailingSlash??!1,this[Gur]=[],this[$ur]=1,this[h3s]=this.dispatch,this[nWn]=this.close.bind(this),this.dispatch=p3s.call(this),this.close=this[rWn]}get[sWn.kConnected](){return this[$ur]}intercept(e){return new m3s(e&&{ignoreTrailingSlash:this[oWn],...e},this[Gur])}cleanMocks(){this[Gur]=[]}async[rWn](){await d3s(this[nWn])(),this[$ur]=0,this[tWn][sWn.kClients].delete(this[iWn])}};aWn.exports=Vur});var Kur=I((EEf,Yur)=>{"use strict";p();var{kMockCallHistoryAddLog:A3s}=UX(),{InvalidArgumentError:zH}=uo();function VH(t,e,r,n,o){switch(e.operator){case"OR":return n.push(...r(t,o)),n;case"AND":return r(t,n);default:throw new zH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(VH,"handleFilterCallsWithOptions");function y3s(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new zH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(y3s,"buildAndValidateFilterCallsOptions");function WH(t){return(e,r)=>{if(typeof e=="string"||e==null)return r.filter(n=>n[t]===e);if(e instanceof RegExp)return r.filter(n=>e.test(n[t]));throw new zH(`${t} parameter should be one of string, regexp, undefined or null`)}}a(WH,"makeFilterCalls");function _3s(t){try{let e=new URL(t.path,t.origin);return e.search.length!==0||(e.search=new URLSearchParams(t.query).toString()),e}catch(e){throw new zH("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a(_3s,"computeUrlWithMaybeSearchParameters");var Gct=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=_3s(e);this.fullUrl=r.toString(),this.origin=r.origin,this.path=r.pathname,this.searchParams=Object.fromEntries(r.searchParams),this.protocol=r.protocol,this.host=r.host,this.port=r.port,this.hash=r.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){let e={betweenKeyValueSeparator:"->",betweenPairSeparator:"|"},r="";return this.toMap().forEach((n,o)=>{(typeof n=="string"||n===void 0||n===null)&&(r=`${r}${o}${e.betweenKeyValueSeparator}${n}${e.betweenPairSeparator}`),(typeof n=="object"&&n!==null||Array.isArray(n))&&(r=`${r}${o}${e.betweenKeyValueSeparator}${JSON.stringify(n)}${e.betweenPairSeparator}`)}),r.slice(0,-1)}},zur=class{static{a(this,"MockCallHistory")}logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(e){if(typeof e!="number")throw new zH("nthCall must be called with a number");if(!Number.isInteger(e))throw new zH("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new zH("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(e-1)}filterCalls(e,r){if(this.logs.length===0)return this.logs;if(typeof e=="function")return this.logs.filter(e);if(e instanceof RegExp)return this.logs.filter(n=>e.test(n.toString()));if(typeof e=="object"&&e!==null){if(Object.keys(e).length===0)return this.logs;let n={operator:"OR",...y3s(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=VH(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=VH(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=VH(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=VH(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=VH(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=VH(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=VH(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=VH(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new zH("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=WH.call(this,"protocol");filterCallsByHost=WH.call(this,"host");filterCallsByPort=WH.call(this,"port");filterCallsByOrigin=WH.call(this,"origin");filterCallsByPath=WH.call(this,"path");filterCallsByHash=WH.call(this,"hash");filterCallsByFullUrl=WH.call(this,"fullUrl");filterCallsByMethod=WH.call(this,"method");clear(){this.logs=[]}[A3s](e){let r=new Gct(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};Yur.exports.MockCallHistory=zur;Yur.exports.MockCallHistoryLog=Gct});var edr=I((bEf,hWn)=>{"use strict";p();var{promisify:E3s}=require("node:util"),v3s=RX(),{buildMockDispatch:C3s}=SDe(),{kDispatches:Jur,kMockAgent:cWn,kClose:lWn,kOriginalClose:uWn,kOrigin:dWn,kOriginalDispatch:b3s,kConnected:Zur,kIgnoreTrailingSlash:fWn}=UX(),{MockInterceptor:S3s}=Hur(),pWn=Al(),{InvalidArgumentError:T3s}=uo(),Xur=class extends v3s{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new T3s("Argument opts.agent must implement Agent");super(e,r),this[cWn]=r.agent,this[dWn]=e,this[fWn]=r.ignoreTrailingSlash??!1,this[Jur]=[],this[Zur]=1,this[b3s]=this.dispatch,this[uWn]=this.close.bind(this),this.dispatch=C3s.call(this),this.close=this[lWn]}get[pWn.kConnected](){return this[Zur]}intercept(e){return new S3s(e&&{ignoreTrailingSlash:this[fWn],...e},this[Jur])}cleanMocks(){this[Jur]=[]}async[lWn](){await E3s(this[uWn])(),this[Zur]=0,this[cWn][pWn.kClients].delete(this[dWn])}};hWn.exports=Xur});var gWn=I((xEf,mWn)=>{"use strict";p();var{Transform:I3s}=require("node:stream"),{Console:x3s}=require("node:console"),w3s=process.versions.icu?"\u2705":"Y ",R3s=process.versions.icu?"\u274C":"N ";mWn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new I3s({transform(r,n,o){o(null,r)}}),this.logger=new x3s({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let r=e.map(({method:n,path:o,data:{statusCode:s},persist:c,times:l,timesInvoked:u,origin:d})=>({Method:n,Origin:d,Path:o,"Status code":s,Persistent:c?w3s:R3s,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var odr=I((kEf,bWn)=>{"use strict";p();var{kClients:qX}=Al(),k3s=DX(),{kAgent:tdr,kMockAgentSet:$ct,kMockAgentGet:AWn,kDispatches:rdr,kIsMockActive:Vct,kNetConnect:jX,kGetNetConnect:P3s,kOptions:Wct,kFactory:zct,kMockAgentRegisterCallHistory:ndr,kMockAgentIsCallHistoryEnabled:TDe,kMockAgentAddCallHistoryLog:yWn,kMockAgentMockCallHistoryInstance:jhe,kMockAgentAcceptsNonStandardSearchParameters:_Wn,kMockCallHistoryAddLog:D3s,kIgnoreTrailingSlash:EWn}=UX(),N3s=Wur(),M3s=edr(),{matchValue:O3s,normalizeSearchParams:L3s,buildAndValidateMockOptions:B3s,normalizeOrigin:vWn}=SDe(),{InvalidArgumentError:CWn,UndiciError:F3s}=uo(),U3s=$2e(),Q3s=gWn(),{MockCallHistory:q3s}=Kur(),idr=class extends U3s{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=B3s(e);if(this[jX]=!0,this[Vct]=!0,this[TDe]=r.enableCallHistory??!1,this[_Wn]=r.acceptNonStandardSearchParameters??!1,this[EWn]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new CWn("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new k3s(e);this[tdr]=n,this[qX]=n[qX],this[Wct]=r,this[TDe]&&this[ndr]()}get(e){let r=vWn(e),n=this[EWn]?r.replace(/\/$/,""):r,o=this[AWn](n);return o||(o=this[zct](n),this[$ct](n,o)),o}dispatch(e,r){e.origin=vWn(e.origin),this.get(e.origin),this[yWn](e);let n=this[_Wn],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=L3s(c,n);o.path=`${s}?${l}`}return this[tdr].dispatch(o,r)}async close(){this.clearCallHistory(),await this[tdr].close(),this[qX].clear()}deactivate(){this[Vct]=!1}activate(){this[Vct]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[jX])?this[jX].push(e):this[jX]=[e];else if(typeof e>"u")this[jX]=!0;else throw new CWn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[jX]=!1}enableCallHistory(){return this[TDe]=!0,this}disableCallHistory(){return this[TDe]=!1,this}getCallHistory(){return this[jhe]}clearCallHistory(){this[jhe]!==void 0&&this[jhe].clear()}get isMockActive(){return this[Vct]}[ndr](){this[jhe]===void 0&&(this[jhe]=new q3s)}[yWn](e){this[TDe]&&(this[ndr](),this[jhe][D3s](e))}[$ct](e,r){this[qX].set(e,{count:0,dispatcher:r})}[zct](e){let r=Object.assign({agent:this},this[Wct]);return this[Wct]&&this[Wct].connections===1?new N3s(e,r):new M3s(e,r)}[AWn](e){let r=this[qX].get(e);if(r?.dispatcher)return r.dispatcher;if(typeof e!="string"){let n=this[zct]("http://localhost:9999");return this[$ct](e,n),n}for(let[n,o]of Array.from(this[qX]))if(o&&typeof n!="string"&&O3s(n,e)){let s=this[zct](e);return this[$ct](e,s),s[rdr]=o.dispatcher[rdr],s}}[P3s](){return this[jX]}pendingInterceptors(){let e=this[qX];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[rdr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new Q3s}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new F3s(r.length===1?`1 interceptor is pending: ${e.format(r)}`.trim():`${r.length} interceptors are pending: -${e.format(r)}`.trim())}};vWn.exports=ndr});var odr=I((PEf,TWn)=>{"use strict";p();var{InvalidArgumentError:Q3s}=uo(),{runtimeFeatures:q3s}=I8();function j3s(t={}){let{ignoreHeaders:e=[],excludeHeaders:r=[],matchHeaders:n=[],caseSensitive:o=!1}=t;return{ignore:new Set(e.map(s=>o?s:s.toLowerCase())),exclude:new Set(r.map(s=>o?s:s.toLowerCase())),match:new Set(n.map(s=>o?s:s.toLowerCase()))}}a(j3s,"createHeaderFilters");var CWn=q3s.has("crypto")?require("node:crypto"):null,H3s=CWn?.hash?t=>CWn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function SWn(t){return Array.isArray(t)&&(t.length&1)===0}a(SWn,"isUndiciHeaders");function G3s(t=[]){return t.length===0?()=>!1:a(function(r){let n;for(let o of t)if(typeof o=="string"){if(n||(n=r.toLowerCase()),n.includes(o.toLowerCase()))return!0}else if(o instanceof RegExp&&o.test(r))return!0;return!1},"isUrlExcluded")}a(G3s,"isUrlExcludedFactory");function $3s(t){let e={};if(!t)return e;if(SWn(t)){for(let r=0;r{"use strict";p();var{writeFile:W3s,readFile:z3s,mkdir:Y3s}=require("node:fs/promises"),{dirname:K3s,resolve:IWn}=require("node:path"),{setTimeout:J3s,clearTimeout:xWn}=require("node:timers"),{InvalidArgumentError:wWn,UndiciError:Z3s}=uo(),{hashId:X3s,isUrlExcludedFactory:eFs,normalizeHeaders:RWn,createHeaderFilters:kWn}=odr();function IDe(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||RWn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:PWn(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(IDe,"formatRequestKey");function PWn(t,e,r={}){if(!t||typeof t!="object")return{};let{caseSensitive:n=!1}=r,o={},{ignore:s,exclude:c,match:l}=e;for(let[u,d]of Object.entries(t)){let f=n?u:u.toLowerCase();c.has(f)||s.has(f)||l.size!==0&&!l.has(f)||(o[f]=d)}return o}a(PWn,"filterHeadersForMatching");function DWn(t,e,r={}){if(!t||typeof t!="object")return{};let{caseSensitive:n=!1}=r,o={},{exclude:s}=e;for(let[c,l]of Object.entries(t)){let u=n?c:c.toLowerCase();s.has(u)||(o[u]=l)}return o}a(DWn,"filterHeadersForStorage");function xDe(t){let e=[t.method,t.url];if(t.headers&&typeof t.headers=="object"){let n=Object.keys(t.headers).sort();for(let o of n){let s=Array.isArray(t.headers[o])?t.headers[o]:[t.headers[o]];e.push(o);for(let c of s.sort())e.push(String(c))}}e.push(t.body);let r=e.join("|");return X3s(r)}a(xDe,"createRequestHash");var sdr=class{static{a(this,"SnapshotRecorder")}#e;#t;#r=new Map;#n;#i=1/0;#o=!1;#s;constructor(e={}){this.#n=e.snapshotPath,this.#i=e.maxSnapshots||1/0,this.#o=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:e.matchBody!==!1,matchQuery:e.matchQuery!==!1,caseSensitive:e.caseSensitive||!1},this.#s=kWn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=eFs(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=IDe(e,this.#s,this.matchOptions),o=xDe(n),s=RWn(r.headers),c={statusCode:r.statusCode,headers:DWn(s,this.#s,this.matchOptions),body:Buffer.isBuffer(r.body)?r.body.toString("base64"):Buffer.from(String(r.body||"")).toString("base64"),trailers:r.trailers};if(this.#r.size>=this.#i&&!this.#r.has(o)){let u=this.#r.keys().next().value;this.#r.delete(u)}let l=this.#r.get(o);l&&l.responses?(l.responses.push(c),l.timestamp=new Date().toISOString()):this.#r.set(o,{request:n,responses:[c],callCount:0,timestamp:new Date().toISOString()}),this.#o&&this.#n&&this.#u()}isUrlExcluded(e){let r=new URL(e.path,e.origin).toString();return this.#t(r)}findSnapshot(e){if(!this.shouldPlayback(e)||this.isUrlExcluded(e))return;let r=IDe(e,this.#s,this.matchOptions),n=xDe(r),o=this.#r.get(n);if(!o)return;let s=o.callCount||0,c=Math.min(s,o.responses.length-1);return o.callCount=s+1,{...o,response:o.responses[c]}}async loadSnapshots(e){let r=e||this.#n;if(!r)throw new wWn("Snapshot path is required");try{let n=await z3s(IWn(r),"utf8"),o=JSON.parse(n);if(Array.isArray(o)){this.#r.clear();for(let{hash:s,snapshot:c}of o)this.#r.set(s,c)}else this.#r=new Map(Object.entries(o))}catch(n){if(n.code==="ENOENT")this.#r.clear();else throw new Z3s(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new wWn("Snapshot path is required");let n=IWn(r);await Y3s(K3s(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await W3s(n,JSON.stringify(o,null,2),{flush:!0})}clear(){this.#r.clear()}getSnapshots(){return Array.from(this.#r.values())}size(){return this.#r.size}resetCallCounts(){for(let e of this.#r.values())e.callCount=0}deleteSnapshot(e){let r=IDe(e,this.#s,this.matchOptions),n=xDe(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=IDe(e,this.#s,this.matchOptions),n=xDe(r),o=this.#r.get(n);return o?{hash:n,request:o.request,responseCount:o.responses?o.responses.length:o.response?1:0,callCount:o.callCount||0,timestamp:o.timestamp}:null}replaceSnapshots(e){if(this.#r.clear(),Array.isArray(e))for(let{hash:r,snapshot:n}of e)this.#r.set(r,n);else e&&typeof e=="object"&&(this.#r=new Map(Object.entries(e)))}#a(){return this.#u()}#c(){this.#e&&(xWn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=J3s(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(xWn(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};NWn.exports={SnapshotRecorder:sdr,formatRequestKey:IDe,createRequestHash:xDe,filterHeadersForMatching:PWn,filterHeadersForStorage:DWn,createHeaderFilters:kWn}});var BWn=I((BEf,LWn)=>{"use strict";p();var tFs=PX(),rFs=idr(),{SnapshotRecorder:nFs}=MWn(),iFs=G2e(),{InvalidArgumentError:oFs,UndiciError:sFs}=uo(),{validateSnapshotMode:aFs}=odr(),Ub=Symbol("kSnapshotRecorder"),v4=Symbol("kSnapshotMode"),wDe=Symbol("kSnapshotPath"),adr=Symbol("kSnapshotLoaded"),Yct=Symbol("kRealAgent"),OWn=!1,cdr=class extends rFs{static{a(this,"SnapshotAgent")}constructor(e={}){OWn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),OWn=!0);let{mode:r="record",snapshotPath:n=null,...o}=e;if(super(o),aFs(r),(r==="playback"||r==="update")&&!n)throw new oFs(`snapshotPath is required when mode is '${r}'`);this[v4]=r,this[wDe]=n,this[Ub]=new nFs({snapshotPath:this[wDe],mode:this[v4],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,matchQuery:e.matchQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[adr]=!1,(this[v4]==="record"||this[v4]==="update"||this[v4]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[Yct]=new tFs(e)),(this[v4]==="playback"||this[v4]==="update")&&this[wDe]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=iFs.wrap(r);let n=this[v4];if(this[Ub].isUrlExcluded(e))return this[Yct].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[adr])return this.#e(e,r);let o=this[Ub].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new sFs(`No snapshot found for ${e.method||"GET"} ${e.path}`);if(r.onError){r.onError(s);return}throw s}}else if(n==="record")return this.#t(e,r)}async#e(e,r){return await this.loadSnapshots(),this.dispatch(e,r)}#t(e,r){let n={statusCode:null,headers:{},trailers:{},body:[]},o=this,s={onRequestStart(l,u){return r.onRequestStart(l,{...u,history:this.history})},onRequestUpgrade(l,u,d,f){return r.onRequestUpgrade(l,u,d,f)},onResponseStart(l,u,d,f){return n.statusCode=u,n.headers=d,r.onResponseStart(l,u,d,f)},onResponseData(l,u){return n.body.push(u),r.onResponseData(l,u)},onResponseEnd(l,u){n.trailers=u;let d=Buffer.concat(n.body);o[Ub].record(e,{statusCode:n.statusCode,headers:n.headers,body:d,trailers:n.trailers}).then(()=>r.onResponseEnd(l,u)).catch(f=>r.onResponseError(l,f))}};return this[Yct].dispatch(e,s)}#r(e,r){try{let{response:n}=e,o={pause(){},resume(){},abort(c){this.aborted=!0,this.reason=c},aborted:!1,paused:!1};r.onRequestStart(o),r.onResponseStart(o,n.statusCode,n.headers);let s=Buffer.from(n.body,"base64");r.onResponseData(o,s),r.onResponseEnd(o,n.trailers)}catch(n){r.onError?.(n)}}async loadSnapshots(e){await this[Ub].loadSnapshots(e||this[wDe]),this[adr]=!0,this[v4]==="playback"&&this.#n()}async saveSnapshots(e){return this[Ub].saveSnapshots(e||this[wDe])}#n(){for(let e of this[Ub].getSnapshots()){let{request:r,responses:n,response:o}=e,s=new URL(r.url),c=this.get(s.origin),l=n?n[0]:o;l&&c.intercept({path:s.pathname+s.search,method:r.method,headers:r.headers,body:r.body}).reply(l.statusCode,l.body,{headers:l.headers,trailers:l.trailers}).persist()}}getRecorder(){return this[Ub]}getMode(){return this[v4]}clearSnapshots(){this[Ub].clear()}resetCallCounts(){this[Ub].resetCallCounts()}deleteSnapshot(e){return this[Ub].deleteSnapshot(e)}getSnapshotInfo(e){return this[Ub].getSnapshotInfo(e)}replaceSnapshots(e){this[Ub].replaceSnapshots(e)}async close(){await this[Ub].close(),await this[Yct]?.close(),await super.close()}};LWn.exports=cdr});var Kct=I((QEf,qWn)=>{"use strict";p();var cFs=Symbol.for("undici.globalDispatcher.2"),FWn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:lFs}=uo(),uFs=PX();QWn()===void 0&&UWn(new uFs);function UWn(t){if(!t||typeof t.dispatch!="function")throw new lFs("Argument agent must implement Agent");Object.defineProperty(globalThis,cFs,{value:t,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,FWn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(UWn,"setGlobalDispatcher");function QWn(){return globalThis[FWn]}a(QWn,"getGlobalDispatcher");var dFs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];qWn.exports={setGlobalDispatcher:UWn,getGlobalDispatcher:QWn,installedExports:dFs}});var jhe=I((GEf,jWn)=>{"use strict";p();var L8=require("node:assert"),fFs=G2e();jWn.exports=class{static{a(this,"DecoratorHandler")}#e;#t=!1;#r=!1;#n=!1;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=fFs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return L8(!this.#t),L8(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return L8(!this.#t),L8(!this.#r),L8(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return L8(!this.#t),L8(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return L8(!this.#t),L8(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var fdr=I((WEf,VWn)=>{"use strict";p();var Qb=No(),{kBodyUsed:RDe}=Al(),ddr=require("node:assert"),{InvalidArgumentError:ldr}=uo(),pFs=require("node:events"),hFs=[300,301,302,303,307,308],HWn=Symbol("body"),GWn=a(()=>{},"noop"),Jct=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[HWn]=e,this[RDe]=!1}async*[Symbol.asyncIterator](){ddr(!this[RDe],"disturbed"),this[RDe]=!0,yield*this[HWn]}},udr=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new ldr("maxRedirections must be a positive number");let n=e.dispatch.bind(e);return(o,s)=>n(o,new t(n,r,o,s))}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new ldr("maxRedirections must be a positive number");this.dispatch=e,this.location=null;let{maxRedirections:s,...c}=n;this.opts=c,this.maxRedirections=r,this.handler=o,this.history=[],Qb.isStream(this.opts.body)?(Qb.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){ddr(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[RDe]=!1,pFs.prototype.on.call(this.opts.body,"data",function(){this[RDe]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Jct(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&Qb.isIterable(this.opts.body)&&!Qb.isFormDataLike(this.opts.body)&&(this.opts.body=new Jct(this.opts.body))}onRequestStart(e,r){this.handler.onRequestStart?.(e,{...r,history:this.history})}onRequestUpgrade(e,r,n,o){this.handler.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw new Error("max redirects");if((r===301||r===302)&&this.opts.method==="POST"&&(this.opts.method="GET",Qb.isStream(this.opts.body)&&Qb.destroy(this.opts.body.on("error",GWn)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",Qb.isStream(this.opts.body)&&Qb.destroy(this.opts.body.on("error",GWn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||Qb.isDisturbed(this.opts.body)||hFs.indexOf(r)===-1?null:n.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location){this.handler.onResponseStart?.(e,r,n,o);return}let{origin:s,pathname:c,search:l}=Qb.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c,d=`${s}${u}`;for(let f of this.history)if(f.toString()===d)throw new ldr(`Redirect loop detected. Cannot redirect to ${s}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=mFs(this.opts.headers,r===303,this.opts.origin!==s),this.opts.path=u,this.opts.origin=s,this.opts.query=null}onResponseData(e,r){this.location||this.handler.onResponseData?.(e,r)}onResponseEnd(e,r){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,r)}onResponseError(e,r){this.handler.onResponseError?.(e,r)}};function $Wn(t,e,r){if(t.length===4)return Qb.headerNameToString(t)==="host";if(e&&Qb.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=Qb.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a($Wn,"shouldRemoveHeader");function mFs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var gFs=fdr();function AFs({maxRedirections:t}={}){return e=>a(function(n,o){let{maxRedirections:s=t,...c}=n;if(s==null||s===0)return e(n,o);let l={...c},u=new gFs(e,s,l,o);return e(l,u)},"Intercept")}a(AFs,"createRedirectInterceptor");WWn.exports=AFs});var KWn=I((XEf,YWn)=>{"use strict";p();var yFs=jhe(),{ResponseError:_Fs}=uo(),pdr=class extends yFs{static{a(this,"ResponseErrorHandler")}#e;#t;#r;#n;#i;constructor(e,{handler:r}){super(r)}#o(e){return(this.#t??"").indexOf(e)===0}onRequestStart(e,r){return this.#e=0,this.#t=null,this.#r=null,this.#n=null,this.#i="",super.onRequestStart(e,r)}onResponseStart(e,r,n,o){if(this.#e=r,this.#n=n,this.#t=n["content-type"],this.#e<400)return super.onResponseStart(e,r,n,o);(this.#o("application/json")||this.#o("text/plain"))&&(this.#r=new TextDecoder("utf-8"))}onResponseData(e,r){if(this.#e<400)return super.onResponseData(e,r);this.#i+=this.#r?.decode(r,{stream:!0})??""}onResponseEnd(e,r){if(this.#e>=400){if(this.#i+=this.#r?.decode(void 0,{stream:!1})??"",this.#o("application/json"))try{this.#i=JSON.parse(this.#i)}catch{}let n,o=Error.stackTraceLimit;Error.stackTraceLimit=0;try{n=new _Fs("Response Error",this.#e,{body:this.#i,headers:this.#n})}finally{Error.stackTraceLimit=o}super.onResponseError(e,n)}else super.onResponseEnd(e,r)}onResponseError(e,r){super.onResponseError(e,r)}};YWn.exports=()=>t=>a(function(r,n){return t(r,new pdr(r,{handler:n}))},"Intercept")});var ZWn=I((rvf,JWn)=>{"use strict";p();var EFs=Oct();JWn.exports=t=>e=>a(function(n,o){return e(n,new EFs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var ezn=I((ovf,XWn)=>{"use strict";p();var{InvalidArgumentError:vFs,RequestAbortedError:CFs}=uo(),bFs=jhe(),hdr=class extends bFs{static{a(this,"DumpHandler")}#e=1024*1024;#t=!1;#r=0;#n=null;aborted=!1;reason=!1;constructor({maxSize:e,signal:r},n){if(e!=null&&(!Number.isFinite(e)||e<1))throw new vFs("maxSize must be a number greater than 0");super(n),this.#e=e??this.#e}#i(e){this.aborted=!0,this.reason=e}onRequestStart(e,r){return e.abort=this.#i.bind(this),this.#n=e,super.onRequestStart(e,r)}onResponseStart(e,r,n,o){let s=n["content-length"];if(s!=null&&s>this.#e)throw new CFs(`Response size (${s}) larger than maxSize (${this.#e})`);return this.aborted===!0?!0:super.onResponseStart(e,r,n,o)}onResponseError(e,r){this.#t||(r=this.#n?.reason??r,super.onResponseError(e,r))}onResponseData(e,r){return this.#r=this.#r+r.length,this.#r>=this.#e&&(this.#t=!0,this.aborted===!0?super.onResponseError(e,this.reason):super.onResponseEnd(e,{})),!0}onResponseEnd(e,r){if(!this.#t){if(this.#n.aborted===!0){super.onResponseError(e,this.reason);return}super.onResponseEnd(e,r)}}};function SFs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new hdr({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(SFs,"createDumpInterceptor");XWn.exports=SFs});var izn=I((cvf,nzn)=>{"use strict";p();var{isIP:TFs}=require("node:net"),{lookup:IFs}=require("node:dns"),xFs=jhe(),{InvalidArgumentError:jX,InformationalError:wFs}=uo(),mdr=Math.pow(2,31)-1;function RFs(t){let e=Object.getPrototypeOf(t);return Object.prototype.hasOwnProperty.call(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}a(RFs,"hasSafeIterator");function tzn(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(tzn,"isHostHeader");function kFs(t){if(t==null)return null;if(Array.isArray(t)){if(t.length===0||!Array.isArray(t[0]))return t;let e=[];for(let r of t)Array.isArray(r)&&r.length===2?e.push(r[0],r[1]):e.push(r);return e}if(typeof t=="object"&&RFs(t)){let e=[];for(let r of t)Array.isArray(r)&&r.length===2?e.push(r[0],r[1]):e.push(r);return e}return t}a(kFs,"normalizeHeaders");function PFs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},Adr=class{static{a(this,"DNSInstance")}#e=0;#t=0;dualStack=!0;affinity=null;lookup=null;pick=null;storage=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#n,this.storage=e.storage??new gdr(e)}runLookup(e,r,n){let o=this.storage.get(e.hostname);if(o==null&&this.storage.full()){n(null,e);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(o==null)this.lookup(e,s,(c,l)=>{if(c||l==null||l.length===0){n(c??new wFs("No DNS entries found"));return}this.setRecords(e,l);let u=this.storage.get(e.hostname),d=this.pick(e,u,s.affinity),f;typeof d.port=="number"?f=`:${d.port}`:e.port!==""?f=`:${e.port}`:f="",n(null,new URL(`${e.protocol}//${d.family===6?`[${d.address}]`:d.address}${f}`))});else{let c=this.pick(e,o,s.affinity);if(c==null){this.storage.delete(e.hostname),this.runLookup(e,r,n);return}let l;typeof c.port=="number"?l=`:${c.port}`:e.port!==""?l=`:${e.port}`:l="",n(null,new URL(`${e.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`))}}#r(e,r,n){IFs(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(o,s)=>{if(o)return n(o);let c=new Map;for(let l of s)c.set(`${l.address}:${l.family}`,l);n(null,c.values())})}#n(e,r,n){let o=null,{records:s,offset:c}=r,l;if(this.dualStack?(n==null&&(c==null||c===mdr?(r.offset=0,n=4):(r.offset++,n=(r.offset&1)===1?6:4)),s[n]!=null&&s[n].ips.length>0?l=s[n]:l=s[n===4?6:4]):l=s[n],l==null||l.ips.length===0)return o;l.offset==null||l.offset===mdr?l.offset=0:l.offset++;let u=l.offset%l.ips.length;return o=l.ips[u]??null,o==null?o:Date.now()-o.timestamp>o.ttl?(l.ips.splice(u,1),this.pick(e,r,n)):o}pickFamily(e,r){let n=this.storage.get(e.hostname)?.records;if(!n)return null;let o=n[r];if(!o)return null;o.offset==null||o.offset===mdr?o.offset=0:o.offset++;let s=o.offset%o.ips.length,c=o.ips[s]??null;return c==null||Date.now()-c.timestamp>c.ttl&&o.ips.splice(s,1),c}setRecords(e,r){let n=Date.now(),o={records:{4:null,6:null}},s=this.#e;for(let c of r){c.timestamp=n,typeof c.ttl=="number"?(c.ttl=Math.min(c.ttl,this.#e),s=Math.min(s,c.ttl)):c.ttl=this.#e;let l=o.records[c.family]??{ips:[]};l.ips.push(c),o.records[c.family]=l}this.storage.set(e.hostname,o,{ttl:s})}deleteRecords(e){this.storage.delete(e.hostname)}getHandler(e,r){return new ydr(this,e,r)}},ydr=class extends xFs{static{a(this,"DNSDispatchHandler")}#e=null;#t=null;#r=null;#n=null;#i=null;#o=null;#s=!0;constructor(e,{origin:r,handler:n,dispatch:o,newOrigin:s},c){super(n),this.#n=r,this.#o=s,this.#t={...c},this.#e=e,this.#r=o}onResponseError(e,r){switch(r.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){if(!this.#s){super.onResponseError(e,r);return}this.#s=!1;let n=this.#o.hostname[0]==="["?4:6,o=this.#e.pickFamily(this.#n,n);if(o==null){super.onResponseError(e,r);return}let s;typeof o.port=="number"?s=`:${o.port}`:this.#n.port!==""?s=`:${this.#n.port}`:s="";let c={...this.#t,origin:`${this.#n.protocol}//${o.family===6?`[${o.address}]`:o.address}${s}`,headers:rzn(this.#n.host,this.#t.headers)};this.#r(c,this);return}super.onResponseError(e,r);break}case"ENOTFOUND":this.#e.deleteRecords(this.#n),super.onResponseError(e,r);break;default:super.onResponseError(e,r);break}}};nzn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new jX("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new jX("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new jX("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new jX("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new jX("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new jX("Invalid pick. Must be a function");if(t?.storage!=null&&(typeof t?.storage?.get!="function"||typeof t?.storage?.set!="function"||typeof t?.storage?.full!="function"||typeof t?.storage?.delete!="function"))throw new jX("Invalid storage. Must be a object with methods: { get, set, full, delete }");let e=t?.dualStack??!0,r;e?r=t?.affinity??null:r=t?.affinity??4;let n={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:r,maxItems:t?.maxItems??1/0,storage:t?.storage},o=new Adr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return TFs(d.hostname)!==0?s(l,u):(o.runLookup(d,l,(f,h)=>{if(f)return u.onResponseError(null,f);let m={...l,servername:d.hostname,origin:h.origin,headers:rzn(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var Hhe=I((dvf,mzn)=>{"use strict";p();var{safeHTTPMethods:ozn,pathHasQueryOrFragment:DFs,hasSafeIterator:NFs,isValidHTTPToken:kDe}=No(),{serializePathWithQuery:MFs}=No(),OFs=2147483647,szn=["no-store","private","no-cache"],_dr=Symbol("invalid cache-control directives");function HX(t){return t.replace(/^[\t ]+|[\t ]+$/g,"")}a(HX,"trimOWS");function fzn(t,e){for(let r=0;rl}),u=d+1);return e.push({value:c.substring(u),fromMalformedQuote:u>l}),e}a(LFs,"splitCacheControlHeaderValue");function uzn(t,e){let r=t[_dr];r===void 0&&(r=new Set,Object.defineProperty(t,_dr,{value:r})),r.add(e)}a(uzn,"markInvalidCacheControlDirective");function BFs(t,e){return t[_dr]?.has(e)===!0}a(BFs,"hasInvalidCacheControlDirective");function FFs(t){for(let n of szn)if(t.startsWith(n)&&t.length>n.length&&!kDe(t[n.length]))return n;let e="",r=!1;for(let n=0;n=2&&h[0]==='"'&&h[h.length-1]==='"'&&(h=h.substring(1,h.length-1)),!/^[0-9]+$/.test(h)){delete e[f],r.add(f),uzn(e,f);continue}let y=Math.min(parseInt(h,10),OFs);f==="min-fresh"?(!(f in e)||e[f]y)&&(e[f]=y);break}case"private":case"no-cache":{if(u){e[f]=!0;break}if(h!==void 0&&h.length===0){e[f]=!0;break}if(h){if(h[0]==='"'){h=czn(h);let y="",_=s,E=!1,v=lzn(h,1);if(v!==-1)y=h.substring(1,v),E=!0;else{let w=[h.substring(1)];for(let R=s+1;R{"use strict";p();function YFs(t){switch(t[3]){case",":return KFs(t);case" ":return JFs(t);default:return ZFs(t)}}a(YFs,"parseHttpDate");function vdr(t,e,r,n,o,s,c){let l=new Date(Date.UTC(t,e,r,n,o,s));return t>=0&&t<=99&&l.setUTCFullYear(t),l.getUTCFullYear()===t&&l.getUTCMonth()===e&&l.getUTCDate()===r&&l.getUTCHours()===n&&l.getUTCMinutes()===o&&l.getUTCSeconds()===s&&l.getUTCDay()===c?l:void 0}a(vdr,"makeDate");function KFs(t){if(t.length!==29||t[4]!==" "||t[7]!==" "||t[11]!==" "||t[16]!==" "||t[19]!==":"||t[22]!==":"||t[25]!==" "||t[26]!=="G"||t[27]!=="M"||t[28]!=="T")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let r=0;if(t[5]==="0"){let m=t.charCodeAt(6);if(m<49||m>57)return;r=m-48}else{let m=t.charCodeAt(5);if(m<49||m>51)return;let g=t.charCodeAt(6);if(g<48||g>57)return;r=(m-48)*10+(g-48)}let n=-1;if(t[8]==="J"&&t[9]==="a"&&t[10]==="n")n=0;else if(t[8]==="F"&&t[9]==="e"&&t[10]==="b")n=1;else if(t[8]==="M"&&t[9]==="a")if(t[10]==="r")n=2;else if(t[10]==="y")n=4;else return;else if(t[8]==="J")if(t[9]==="a"&&t[10]==="n")n=0;else if(t[9]==="u")if(t[10]==="n")n=5;else if(t[10]==="l")n=6;else return;else return;else if(t[8]==="A")if(t[9]==="p"&&t[10]==="r")n=3;else if(t[9]==="u"&&t[10]==="g")n=7;else return;else if(t[8]==="S"&&t[9]==="e"&&t[10]==="p")n=8;else if(t[8]==="O"&&t[9]==="c"&&t[10]==="t")n=9;else if(t[8]==="N"&&t[9]==="o"&&t[10]==="v")n=10;else if(t[8]==="D"&&t[9]==="e"&&t[10]==="c")n=11;else return;let o=t.charCodeAt(12);if(o<48||o>57)return;let s=t.charCodeAt(13);if(s<48||s>57)return;let c=t.charCodeAt(14);if(c<48||c>57)return;let l=t.charCodeAt(15);if(l<48||l>57)return;let u=(o-48)*1e3+(s-48)*100+(c-48)*10+(l-48),d=0;if(t[17]==="0"){let m=t.charCodeAt(18);if(m<48||m>57)return;d=m-48}else{let m=t.charCodeAt(17);if(m<48||m>50)return;let g=t.charCodeAt(18);if(g<48||g>57||m===50&&g>51)return;d=(m-48)*10+(g-48)}let f=0;if(t[20]==="0"){let m=t.charCodeAt(21);if(m<48||m>57)return;f=m-48}else{let m=t.charCodeAt(20);if(m<48||m>53)return;let g=t.charCodeAt(21);if(g<48||g>57)return;f=(m-48)*10+(g-48)}let h=0;if(t[23]==="0"){let m=t.charCodeAt(24);if(m<48||m>57)return;h=m-48}else{let m=t.charCodeAt(23);if(m<48||m>53)return;let g=t.charCodeAt(24);if(g<48||g>57)return;h=(m-48)*10+(g-48)}return vdr(u,n,r,d,f,h,e)}a(KFs,"parseImfDate");function JFs(t){if(t.length!==24||t[7]!==" "||t[10]!==" "||t[19]!==" ")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let r=-1;if(t[4]==="J"&&t[5]==="a"&&t[6]==="n")r=0;else if(t[4]==="F"&&t[5]==="e"&&t[6]==="b")r=1;else if(t[4]==="M"&&t[5]==="a")if(t[6]==="r")r=2;else if(t[6]==="y")r=4;else return;else if(t[4]==="J")if(t[5]==="a"&&t[6]==="n")r=0;else if(t[5]==="u")if(t[6]==="n")r=5;else if(t[6]==="l")r=6;else return;else return;else if(t[4]==="A")if(t[5]==="p"&&t[6]==="r")r=3;else if(t[5]==="u"&&t[6]==="g")r=7;else return;else if(t[4]==="S"&&t[5]==="e"&&t[6]==="p")r=8;else if(t[4]==="O"&&t[5]==="c"&&t[6]==="t")r=9;else if(t[4]==="N"&&t[5]==="o"&&t[6]==="v")r=10;else if(t[4]==="D"&&t[5]==="e"&&t[6]==="c")r=11;else return;let n=0;if(t[8]===" "){let m=t.charCodeAt(9);if(m<49||m>57)return;n=m-48}else{let m=t.charCodeAt(8);if(m<49||m>51)return;let g=t.charCodeAt(9);if(g<48||g>57)return;n=(m-48)*10+(g-48)}let o=0;if(t[11]==="0"){let m=t.charCodeAt(12);if(m<48||m>57)return;o=m-48}else{let m=t.charCodeAt(11);if(m<48||m>50)return;let g=t.charCodeAt(12);if(g<48||g>57||m===50&&g>51)return;o=(m-48)*10+(g-48)}let s=0;if(t[14]==="0"){let m=t.charCodeAt(15);if(m<48||m>57)return;s=m-48}else{let m=t.charCodeAt(14);if(m<48||m>53)return;let g=t.charCodeAt(15);if(g<48||g>57)return;s=(m-48)*10+(g-48)}let c=0;if(t[17]==="0"){let m=t.charCodeAt(18);if(m<48||m>57)return;c=m-48}else{let m=t.charCodeAt(17);if(m<48||m>53)return;let g=t.charCodeAt(18);if(g<48||g>57)return;c=(m-48)*10+(g-48)}let l=t.charCodeAt(20);if(l<48||l>57)return;let u=t.charCodeAt(21);if(u<48||u>57)return;let d=t.charCodeAt(22);if(d<48||d>57)return;let f=t.charCodeAt(23);if(f<48||f>57)return;let h=(l-48)*1e3+(u-48)*100+(d-48)*10+(f-48);return vdr(h,r,n,o,s,c,e)}a(JFs,"parseAscTimeDate");function ZFs(t){let e=-1,r=-1;if(t[0]==="S")t[1]==="u"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y"?(r=0,e=6):t[1]==="a"&&t[2]==="t"&&t[3]==="u"&&t[4]==="r"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(r=6,e=8);else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")r=1,e=6;else if(t[0]==="T")t[1]==="u"&&t[2]==="e"&&t[3]==="s"&&t[4]==="d"&&t[5]==="a"&&t[6]==="y"?(r=2,e=7):t[1]==="h"&&t[2]==="u"&&t[3]==="r"&&t[4]==="s"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(r=4,e=8);else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d"&&t[3]==="n"&&t[4]==="e"&&t[5]==="s"&&t[6]==="d"&&t[7]==="a"&&t[8]==="y")r=3,e=9;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")r=5,e=6;else return;if(t[e]!==","||t.length-e-1!==23||t[e+1]!==" "||t[e+4]!=="-"||t[e+8]!=="-"||t[e+11]!==" "||t[e+14]!==":"||t[e+17]!==":"||t[e+20]!==" "||t[e+21]!=="G"||t[e+22]!=="M"||t[e+23]!=="T")return;let n=0;if(t[e+2]==="0"){let h=t.charCodeAt(e+3);if(h<49||h>57)return;n=h-48}else{let h=t.charCodeAt(e+2);if(h<49||h>51)return;let m=t.charCodeAt(e+3);if(m<48||m>57)return;n=(h-48)*10+(m-48)}let o=-1;if(t[e+5]==="J"&&t[e+6]==="a"&&t[e+7]==="n")o=0;else if(t[e+5]==="F"&&t[e+6]==="e"&&t[e+7]==="b")o=1;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="r")o=2;else if(t[e+5]==="A"&&t[e+6]==="p"&&t[e+7]==="r")o=3;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="y")o=4;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="n")o=5;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="l")o=6;else if(t[e+5]==="A"&&t[e+6]==="u"&&t[e+7]==="g")o=7;else if(t[e+5]==="S"&&t[e+6]==="e"&&t[e+7]==="p")o=8;else if(t[e+5]==="O"&&t[e+6]==="c"&&t[e+7]==="t")o=9;else if(t[e+5]==="N"&&t[e+6]==="o"&&t[e+7]==="v")o=10;else if(t[e+5]==="D"&&t[e+6]==="e"&&t[e+7]==="c")o=11;else return;let s=t.charCodeAt(e+9);if(s<48||s>57)return;let c=t.charCodeAt(e+10);if(c<48||c>57)return;let l=(s-48)*10+(c-48);l+=l<70?2e3:1900;let u=0;if(t[e+12]==="0"){let h=t.charCodeAt(e+13);if(h<48||h>57)return;u=h-48}else{let h=t.charCodeAt(e+12);if(h<48||h>50)return;let m=t.charCodeAt(e+13);if(m<48||m>57||h===50&&m>51)return;u=(h-48)*10+(m-48)}let d=0;if(t[e+15]==="0"){let h=t.charCodeAt(e+16);if(h<48||h>57)return;d=h-48}else{let h=t.charCodeAt(e+15);if(h<48||h>53)return;let m=t.charCodeAt(e+16);if(m<48||m>57)return;d=(h-48)*10+(m-48)}let f=0;if(t[e+18]==="0"){let h=t.charCodeAt(e+19);if(h<48||h>57)return;f=h-48}else{let h=t.charCodeAt(e+18);if(h<48||h>53)return;let m=t.charCodeAt(e+19);if(m<48||m>57)return;f=(h-48)*10+(m-48)}return vdr(l,o,n,u,d,f,r)}a(ZFs,"parseRfc850Date");gzn.exports={parseHttpDate:YFs}});var bzn=I((Avf,Czn)=>{"use strict";p();var bdr=No(),{parseCacheControlHeader:XFs,hasInvalidCacheControlDirective:Azn,parseVaryHeader:e8s,hasVaryStar:t8s,isInvalidOrWildcardVaryHeader:_zn,isEtagUsable:r8s}=Hhe(),{parseHttpDate:Sdr}=Cdr();function n8s(){}a(n8s,"noop");var Ezn=[200,203,204,206,300,301,308,404,405,410,414,501],i8s=[206],PDe=2147483647e3;function o8s(t){return t.replace(/^[\t ]+|[\t ]+$/g,"")}a(o8s,"trimOWS");function Ghe(t,e){for(let r=0;rthis.#i.onResponseStart?.(e,r,n,o),"downstreamOnHeaders"),c=this;if(!Ghe(bdr.safeHTTPMethods,this.#e.method)&&r>=200&&r<=399)return c8s(this.#n,this.#e,n),s();let l=n["cache-control"],u=n["last-modified"]&&Ghe(Ezn,r);if(!l&&!n.expires&&!u&&!this.#r)return r===304&&n.vary&&_zn(n.vary)&&DDe(this.#n,this.#e),s();let d=l?XFs(l):{};if(!u8s(this.#t,r,n,d,this.#e.headers))return r===304&&(l||l8s(this.#t,n,d))&&DDe(this.#n,this.#e),s();let f=Date.now(),h=Object.hasOwn(n,"age")?f8s(n.age):void 0;if(h!==void 0&&h>=PDe)return Zct(r,this.#n,this.#e),s();let m=Object.hasOwn(n,"date")?d8s(n.date):void 0;if(m===null)return Zct(r,this.#n,this.#e),s();let g=m?Math.max(0,f-m.getTime()):0,A=Math.max(g,h??0),y=p8s(this.#t,f,h,n,m,d)??this.#r;if(y===void 0||A>=y)return(l||y!==void 0)&&Zct(r,this.#n,this.#e),s();let _=f-A,E=y+_;if(f>=E)return Zct(r,this.#n,this.#e),s();let v;if(this.#e.headers&&n.vary&&(v=e8s(n.vary,this.#e.headers),!v))return s();let S=_,T=h8s(_,f,d,E),w=m8s(n,d),R={statusCode:r,statusMessage:o,headers:w,vary:v,cacheControlDirectives:d,cachedAt:S,staleAt:E,deleteAt:T};if(r===304){let x=a(D=>{if(!D)return s();if(R.statusCode=D.statusCode,R.statusMessage=D.statusMessage,R.etag=D.etag,R.vary=v??D.vary,R.headers={...D.headers,...w},s(),this.#o=this.#n.createWriteStream(this.#e,R),!(!this.#o||!D?.body))if(typeof D.body.values=="function"){let N=D.body.values(),O=a(()=>{for(let B of N){let q=this.#o.write(B)===!1;if(this.#i.onResponseData?.(e,B),q)break}},"streamCachedBody");this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("drain",()=>{O()}).on("close",function(){c.#o===this&&(c.#o=void 0)}),O()}else typeof D.body.on=="function"&&(D.body.on("data",N=>{this.#o.write(N),this.#i.onResponseData?.(e,N)}).on("end",()=>{this.#o.end()}).on("error",()=>{this.#o=void 0,this.#n.delete(this.#e)}),this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("close",function(){c.#o===this&&(c.#o=void 0)}))},"handle304"),k=this.#n.get(this.#e);k&&typeof k.then=="function"?k.then(x):x(k)}else{if(typeof n.etag=="string"&&r8s(n.etag)&&(R.etag=n.etag),this.#o=this.#n.createWriteStream(this.#e,R),!this.#o)return s();this.#o.on("drain",()=>e.resume()).on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("close",function(){c.#o===this&&(c.#o=void 0),e.resume()}),s()}}onResponseData(e,r){this.#o?.write(r)===!1&&e.pause(),this.#i.onResponseData?.(e,r)}onResponseEnd(e,r){this.#o?.end(),this.#i.onResponseEnd?.(e,r)}onResponseError(e,r){this.#o?.destroy(r),this.#o=void 0,this.#i.onResponseError?.(e,r)}};function DDe(t,e){try{t.delete(e)?.catch?.(n8s)}catch{}}a(DDe,"deleteCachedValue");function Zct(t,e,r){t===304&&DDe(e,r)}a(Zct,"deleteCachedValueIfNotModified");function l8s(t,e,r){return r["no-store"]===!0||t==="shared"&&r.private===!0||(e.vary?_zn(e.vary):!1)}a(l8s,"revalidationResponseDisallowsCachedReuse");function u8s(t,e,r,n,o){return!(e<200||Ghe(i8s,e)||!Ghe(Ezn,e)&&!r.expires&&!n.public&&n["max-age"]===void 0&&!(n.private&&t==="private")&&!(n["s-maxage"]!==void 0&&t==="shared")||n["no-store"]||t==="shared"&&n.private===!0||r.vary&&t8s(r.vary)||o!=null&&Object.hasOwn(o,"authorization")&&(!n.public&&!n["s-maxage"]&&!n["must-revalidate"]||typeof o.authorization!="string"||Array.isArray(n["no-cache"])&&Ghe(n["no-cache"],"authorization")||Array.isArray(n.private)&&Ghe(n.private,"authorization")))}a(u8s,"canCacheResponse");function d8s(t){let e=t;if(Array.isArray(e)){if(e.length!==1)return null;e=e[0]}return typeof e!="string"?null:Sdr(e)}a(d8s,"getDate");function f8s(t){let e=t;if(Array.isArray(e)){if(e.length!==1)return PDe;e=e[0]}if(typeof e!="string"||!/^[\t ]*[0-9]+[\t ]*$/.test(e))return PDe;let r=BigInt(e.replace(/^[\t ]+|[\t ]+$/g,""));return r>=BigInt(PDe/1e3)?PDe:Number(r)*1e3}a(f8s,"getAge");function p8s(t,e,r,n,o,s){if(t==="shared"){if(Azn(s,"s-maxage"))return 0;let l=s["s-maxage"];if(l!==void 0)return l*1e3}if(Azn(s,"max-age"))return 0;let c=s["max-age"];if(c!==void 0)return c*1e3;if(Object.hasOwn(n,"expires")){if(typeof n.expires!="string")return 0;let l=Sdr(n.expires);if(!l||e>=l.getTime())return 0;if(o){if(o>=l)return 0;let u=l.getTime()-o.getTime();return r!==void 0&&r>=u?0:u}return l.getTime()-e}if(typeof n["last-modified"]=="string"){let l=Sdr(n["last-modified"]);if(l)return l.getTime()>=e?void 0:(e-l.getTime())*.1}if(s.immutable)return 31536e6}a(p8s,"determineStaleAt");function h8s(t,e,r,n){let o=-1/0,s=-1/0,c=-1/0;if(r["stale-while-revalidate"]&&(o=n+r["stale-while-revalidate"]*1e3),r["stale-if-error"]&&(s=n+r["stale-if-error"]*1e3),r.immutable&&o===-1/0&&s===-1/0&&(c=e+31536e6),o===-1/0&&s===-1/0&&c===-1/0){let l=n-t,u=Math.min(Math.max(e-t,0),1e3);return n+l+u}return Math.max(n,o,s,c)}a(h8s,"determineDeleteAt");function m8s(t,e){let r=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];t.connection&&s8s(r,t.connection),Array.isArray(e["no-cache"])&&r.push(...e["no-cache"]),Array.isArray(e.private)&&r.push(...e.private);let n;for(let o of r)Object.hasOwn(t,o)&&(n??={...t},delete n[o]);return n??t}a(m8s,"stripNecessaryHeaders");Czn.exports=Tdr});var xdr=I((Evf,Izn)=>{"use strict";p();var{Writable:g8s}=require("node:stream"),{EventEmitter:A8s}=require("node:events"),{assertCacheKey:Szn,assertCacheValue:y8s}=Hhe(),Idr=class extends A8s{static{a(this,"MemoryCacheStore")}#e=1024;#t=104857600;#r=5242880;#n=0;#i=0;#o=new Map;#s=!1;constructor(e){if(super(),e){if(typeof e!="object")throw new TypeError("MemoryCacheStore options must be an object");if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}if(e.maxSize!==void 0){if(typeof e.maxSize!="number"||!Number.isInteger(e.maxSize)||e.maxSize<0)throw new TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#t=e.maxSize}if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#r=e.maxEntrySize}}}get size(){return this.#n}isFull(){return this.#n>=this.#t||this.#i>=this.#e}get(e){Szn(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?Tzn(e,o,n):null;return s==null?void 0:{statusMessage:s.statusMessage,statusCode:s.statusCode,headers:s.headers,body:s.body,vary:s.vary?s.vary:void 0,etag:s.etag,cacheControlDirectives:s.cacheControlDirectives,cachedAt:s.cachedAt,staleAt:s.staleAt,deleteAt:s.deleteAt}}createWriteStream(e,r){Szn(e),y8s(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new g8s({write(c,l,u){typeof c=="string"&&(c=Buffer.from(c,l)),s.size+=c.byteLength,s.size>=o.#r?this.destroy():s.body.push(c),u(null)},final(c){let l=o.#o.get(n);l||(l=[],o.#o.set(n,l));let u=Tzn(e,l,Date.now());if(u){let d=l.indexOf(u);l.splice(d,1,s),o.#n-=u.size}else l.push(s),o.#i+=1;if(o.#n+=s.size,o.#n>o.#t||o.#i>o.#e){o.#s||(o.emit("maxSizeExceeded",{size:o.#n,maxSize:o.#t,count:o.#i,maxCount:o.#e}),o.#s=!0);for(let[d,f]of o.#o){for(let h of f.splice(0,f.length/2))o.#n-=h.size,o.#i-=1;f.length===0&&o.#o.delete(d)}o.#nr&&o.method===t.method&&_8s(t,o))return o}}a(Tzn,"findEntry");function _8s(t,e){if(e.vary==null)return!0;for(let r in e.vary)if(Object.hasOwn(e.vary,r)&&!E8s(t.headers?.[r],e.vary[r]))return!1;return!0}a(_8s,"varyMatches");function E8s(t,e){if(t==null&&e==null)return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;r{"use strict";p();var v8s=require("node:assert"),wdr=class{static{a(this,"CacheRevalidationHandler")}#e=!1;#t;#r;#n;#i;constructor(e,r,n){if(typeof e!="function")throw new TypeError("callback must be a function");this.#t=e,this.#r=r,this.#i=n}onRequestStart(e,r){this.#e=!1,this.#n=r}onRequestUpgrade(e,r,n,o){this.#r.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){if(v8s(this.#t!=null),this.#e=r===304||this.#i&&r>=500&&r<=504,this.#t(this.#e,this.#n,r,n),this.#t=null,this.#e)return!0;this.#r.onRequestStart?.(e,this.#n),this.#r.onResponseStart?.(e,r,n,o)}onResponseData(e,r){if(!this.#e)return this.#r.onResponseData?.(e,r)}onResponseEnd(e,r){this.#e||this.#r.onResponseEnd?.(e,r)}onResponseError(e,r){if(!this.#e)if(this.#t&&(this.#t(!1),this.#t=null),typeof this.#r.onResponseError=="function")this.#r.onResponseError(e,r);else throw r}};xzn.exports=wdr});var Lzn=I((Ivf,Ozn)=>{"use strict";p();var Rzn=require("node:assert"),{Readable:C8s}=require("node:stream"),YH=No(),$he=bzn(),b8s=xdr(),S8s=wzn(),{assertCacheStore:T8s,assertCacheMethods:I8s,makeCacheKey:x8s,normalizeHeaders:w8s,parseCacheControlHeader:Mzn,isInvalidOrWildcardVaryHeader:R8s}=Hhe(),{AbortError:k8s}=uo(),{parseHttpDate:P8s}=Cdr();function D8s(t,e){if(t!==void 0){if(!Array.isArray(t))throw new TypeError(`expected ${e} to be an array or undefined, got ${typeof t}`);for(let r=0;r{},"nop");function N8s(t){return t.replace(/^[\t ]+|[\t ]+$/g,"")}a(N8s,"trimOWS");function kzn(t,e){for(let r=0;rt.staleAt){if(!kdr(t,r)&&e?.["max-stale"]){let o=t.staleAt+e["max-stale"]*1e3;return n>o}return!0}if(e?.["min-fresh"]){let o=t.staleAt-n,s=e["min-fresh"]*1e3;return o<=s}return!1}a(U8s,"isStale");function Q8s(t,e){let r=t.cacheControlDirectives?.["stale-while-revalidate"];if(!r||kdr(t,e))return!1;let n=Date.now(),o=t.staleAt+r*1e3;return n<=o}a(Q8s,"withinStaleWhileRevalidateWindow");function q8s(t,e,r,n,o,s){if(s?.["only-if-cached"]){let c=!1;try{if(typeof n.onConnect=="function"&&(n.onConnect(()=>{c=!0}),c)||typeof n.onHeaders=="function"&&(n.onHeaders(504,[],NDe,"Gateway Timeout"),c))return;typeof n.onComplete=="function"&&n.onComplete([])}catch(l){typeof n.onError=="function"&&n.onError(l)}return!0}return t(o,new $he(e,r,n))}a(q8s,"handleUncachedResponse");function Rdr(t,e,r,n,o,s){let c=YH.isStream(r.body)?r.body:C8s.from(r.body??[]);Rzn(!c.destroyed,"stream should not be destroyed"),Rzn(!c.readableDidRead,"stream should not be readableDidRead");let l={resume(){c.resume()},pause(){c.pause()},get paused(){return c.isPaused()},get aborted(){return c.destroyed},get reason(){return c.errored},abort(d){c.destroy(d??new k8s)}};if(c.on("error",function(d){if(!this.readableEnded)if(typeof t.onResponseError=="function")t.onResponseError(l,d);else throw d}).on("close",function(){this.errored||t.onResponseEnd?.(l,{})}),t.onRequestStart?.(l,o),c.destroyed)return;let u={...r.headers,age:String(n)};s&&(u.warning='110 - "response is stale"'),t.onResponseStart?.(l,r.statusCode,u,r.statusMessage),e.method==="HEAD"?c.destroy():c.on("data",function(d){t.onResponseData?.(l,d)})}a(Rdr,"sendCachedValue");function Nzn(t,e,r,n,o,s,c){if(!c)return q8s(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new $he(e,r,n));let u=Math.round((l-c.cachedAt)/1e3),d=s?.["max-age"]!==void 0&&u>=s["max-age"],f=d||U8s(c,s,e.type),h=d||O8s(c,s,o);if(f||h){if(YH.isStream(o.body)&&YH.bodyLength(o.body)!==0)return t(o,new $he(e,r,n));if(!h&&Q8s(c,e.type))return Rdr(n,o,c,u,null,!0),queueMicrotask(()=>{let A=Dzn(o,c);t({...o,headers:A},new $he(e,r,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let m=!1;if(!kdr(c,e.type)){let A=c.cacheControlDirectives["stale-if-error"]??s?.["stale-if-error"];A&&(m=l{if(A){if(_===304){if(L8s(e.type,E))return YH.isStream(c.body)&&c.body.on("error",NDe).destroy(),Pzn(e.store,r),t(o,new $he(e,r,n));B8s(E)&&Pzn(e.store,r)}Rdr(n,o,c,u,y,f)}else YH.isStream(c.body)&&c.body.on("error",NDe).destroy()},new $he(e,r,n),m))}YH.isStream(o.body)&&o.body.on("error",NDe).destroy(),Rdr(n,o,c,u,null,!1)}a(Nzn,"handleResult");Ozn.exports=(t={})=>{let{store:e=new b8s,methods:r=["GET"],cacheByDefault:n=void 0,type:o="shared",origins:s=void 0}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(T8s(e,"opts.store"),I8s(r,"opts.methods"),D8s(s,"opts.origins"),typeof n<"u"&&typeof n!="number")throw new TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof n}`);if(typeof o<"u"&&o!=="shared"&&o!=="private")throw new TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof o}`);let c={store:e,methods:r,cacheByDefault:n,type:o},l=[];for(let u=0;u(d,f)=>{if(!d.origin||kzn(l,d.method))return u(d,f);if(s!==void 0){let A=d.origin.toString().toLowerCase(),y=!1;for(let _=0;_Nzn(u,c,m,f,d,h,A)):Nzn(u,c,m,f,d,h,g)}}});var qzn=I((Rvf,Qzn)=>{"use strict";p();var{createInflate:Pdr,createGunzip:Bzn,createBrotliDecompress:j8s,createZstdDecompress:H8s}=require("node:zlib"),{pipeline:G8s}=require("node:stream"),$8s=jhe(),{runtimeFeatures:V8s}=I8(),Fzn={gzip:Bzn,"x-gzip":Bzn,br:j8s,deflate:Pdr,compress:Pdr,"x-compress":Pdr,...V8s.has("zstd")?{zstd:H8s}:{}},W8s=[204,304],Uzn=!1,Ddr=class extends $8s{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=W8s,skipErrorResponses:n=!0}={}){super(e),this.#t=r,this.#r=n}#n(e,r){return!!(!e||r<200||this.#t.includes(r)||this.#r&&r>=400)}#i(e){let r=e.split(","),n=5;if(r.length>n)throw new Error(`too many content-encodings in response: ${r.length}, maximum allowed is ${n}`);let o=[];for(let s=r.length-1;s>=0;s--){let c=r[s].trim();if(c){if(!Fzn[c])return o.length=0,o;o.push(Fzn[c]())}}return o}#o(e,r){e.on("readable",()=>{let n;for(;(n=e.read())!==null&&super.onResponseData(r,n)!==!1;);}),e.on("error",n=>{super.onResponseError(r,n)})}#s(e){let r=this.#e[0];this.#o(r,e),r.on("end",()=>{super.onResponseEnd(e,{})})}#a(e){let r=this.#e[this.#e.length-1];this.#o(r,e),G8s(this.#e,n=>{if(n){super.onResponseError(e,n);return}super.onResponseEnd(e,{})})}#c(){this.#e.length=0}onResponseStart(e,r,n,o){let s=n["content-encoding"];if(this.#n(s,r))return super.onResponseStart(e,r,n,o);let c=this.#i(s.toLowerCase());if(c.length===0)return this.#c(),super.onResponseStart(e,r,n,o);this.#e=c;let{"content-encoding":l,"content-length":u,...d}=n;return this.#e.length===1?this.#s(e):this.#a(e),super.onResponseStart(e,r,d,o)}onResponseData(e,r){if(this.#e.length>0){this.#e[0].write(r);return}super.onResponseData(e,r)}onResponseEnd(e,r){if(this.#e.length>0){this.#e[0].end(),this.#c();return}super.onResponseEnd(e,r)}onResponseError(e,r){if(this.#e.length>0){for(let n of this.#e)n.destroy(r);this.#c()}super.onResponseError(e,r)}};function z8s(t={}){return Uzn||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),Uzn=!0),e=>(r,n)=>{let o=new Ddr(n,t);return e(r,o)}}a(z8s,"createDecompressInterceptor");Qzn.exports=z8s});var Gzn=I((Dvf,Hzn)=>{"use strict";p();var{RequestAbortedError:Y8s}=uo(),jzn=5*1024*1024,Ndr=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=jzn;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=jzn){this.#e=e,this.#p=r,this.#r=n}addWaitingHandler(e){if(this.#u||this.#c)return!1;let r=this.#g(e),n=r.controller;try{if(e.onRequestStart?.(n,null),n.aborted)return r.done=!0,!0;this.#a&&e.onResponseStart?.(n,this.#n,this.#i,this.#o)}catch{return r.done=!0,!0}return n.aborted||this.#t.push(r),!0}onRequestStart(e,r){this.#l=e,this.#e.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.#e.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){this.#a=!0,this.#n=r,this.#i=n,this.#o=o,this.#e.onResponseStart?.(e,r,n,o);for(let s of this.#t){let{handler:c,controller:l}=s;if(s.done||l.aborted){s.done=!0;continue}try{c.onResponseStart?.(l,r,n,o)}catch{}l.aborted&&(s.done=!0)}this.#m()}onResponseData(e,r){if(!(this.#s||this.#u)){this.#c=!0,this.#e.onResponseData?.(e,r);for(let n of this.#t){let{handler:o,controller:s}=n;if(n.done||s.aborted){n.done=!0;continue}if(s.paused){this.#A(n,r);continue}try{o.onResponseData?.(s,r)}catch{}s.aborted&&(n.done=!0,n.bufferedChunks=[],n.bufferedBytes=0)}this.#m()}}onResponseEnd(e,r){if(!(this.#s||this.#u)){this.#u=!0,this.#e.onResponseEnd?.(e,r);for(let n of this.#t){if(n.done||n.controller.aborted){n.done=!0;continue}if(this.#h(n),n.done||n.controller.aborted){n.done=!0;continue}if(n.controller.paused&&n.bufferedChunks.length>0){n.pendingTrailers=r;continue}try{n.handler.onResponseEnd?.(n.controller,r)}catch{}n.done=!0}this.#m(),this.#p?.()}}onResponseError(e,r){if(!this.#u){this.#s=!0,this.#u=!0,this.#e.onResponseError?.(e,r);for(let n of this.#t)this.#v(n,r);this.#t=[],this.#p?.()}}#g(e){let r={handler:e,controller:null,bufferedChunks:[],bufferedBytes:0,pendingTrailers:null,done:!1},n={aborted:!1,paused:!1,reason:null};return r.controller={resume:a(()=>{if(!n.aborted){if(n.paused=!1,this.#h(r),this.#u&&r.pendingTrailers&&r.bufferedChunks.length===0&&!n.paused&&!n.aborted){try{r.handler.onResponseEnd?.(r.controller,r.pendingTrailers)}catch{}r.pendingTrailers=null,r.done=!0}this.#m()}},"resume"),pause:a(()=>{n.aborted||(n.paused=!0)},"pause"),get paused(){return n.paused},get aborted(){return n.aborted},get reason(){return n.reason},abort:a(o=>{n.aborted=!0,n.reason=o??null,r.done=!0,r.pendingTrailers=null,r.bufferedChunks=[],r.bufferedBytes=0},"abort")},r}#A(e,r){if(e.done||e.controller.aborted){e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0;return}let n=Buffer.from(r);if(e.bufferedChunks.push(n),e.bufferedBytes+=n.length,e.bufferedBytes>this.#r){let o=new Y8s(`Deduplicated waiting handler exceeded maxBufferSize (${this.#r} bytes) while paused`);this.#v(e,o)}}#h(e){let{handler:r,controller:n}=e;for(;!e.done&&!n.aborted&&!n.paused&&e.bufferedChunks.length>0;){let o=e.bufferedChunks.shift();e.bufferedBytes-=o.length;try{r.onResponseData?.(n,o)}catch{}if(n.aborted){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;break}}}#v(e,r){if(!e.done){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;try{e.controller.abort(r),e.handler.onResponseError?.(e.controller,r)}catch{}}}#m(){this.#t=this.#t.filter(e=>e.done===!1)}};Hzn.exports=Ndr});var Vzn=I((Ovf,$zn)=>{"use strict";p();var K8s=require("node:diagnostics_channel"),J8s=No(),Z8s=Gzn(),{normalizeHeaders:X8s,makeCacheKey:e6s,makeDeduplicationKey:t6s}=Hhe(),Xct=K8s.channel("undici:request:pending-requests");$zn.exports=(t={})=>{let{methods:e=["GET"],skipHeaderNames:r=[],excludeHeaderNames:n=[],maxBufferSize:o=5*1024*1024}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(!Array.isArray(e))throw new TypeError(`expected opts.methods to be an array, got ${typeof e}`);for(let u of e)if(!J8s.safeHTTPMethods.includes(u))throw new TypeError(`expected opts.methods to only contain safe HTTP methods, got ${u}`);if(!Array.isArray(r))throw new TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof r}`);if(!Array.isArray(n))throw new TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof n}`);if(!Number.isFinite(o)||o<=0)throw new TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${o}`);let s=new Set(r.map(u=>u.toLowerCase())),c=new Set(n.map(u=>u.toLowerCase())),l=new Map;return u=>(d,f)=>{if(!d.origin||e.includes(d.method)===!1)return u(d,f);if(d={...d,headers:X8s(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=e6s(d),m=t6s(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new Z8s(f,()=>{l.delete(m),Xct.hasSubscribers&&Xct.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),Xct.hasSubscribers&&Xct.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var Yzn=I((Fvf,zzn)=>{"use strict";p();var{Writable:r6s}=require("node:stream"),{assertCacheKey:Mdr,assertCacheValue:n6s}=Hhe(),Odr,JT=3,Wzn=2*1e3*1e3*1e3;zzn.exports=class{static{a(this,"SqliteCacheStore")}#e=Wzn;#t=1/0;#r;#n;#i;#o;#s;#a;#c;#u;constructor(e){if(e){if(typeof e!="object")throw new TypeError("SqliteCacheStore options must be an object");if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("SqliteCacheStore options.maxEntrySize must be a non-negative integer");if(e.maxEntrySize>Wzn)throw new TypeError("SqliteCacheStore options.maxEntrySize must be less than 2gb");this.#e=e.maxEntrySize}if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("SqliteCacheStore options.maxCount must be a non-negative integer");this.#t=e.maxCount}}Odr||(Odr=require("node:sqlite").DatabaseSync),this.#r=new Odr(e?.location??":memory:"),this.#r.exec(` +${e.format(r)}`.trim())}};bWn.exports=idr});var sdr=I((NEf,xWn)=>{"use strict";p();var{InvalidArgumentError:j3s}=uo(),{runtimeFeatures:H3s}=I8();function G3s(t={}){let{ignoreHeaders:e=[],excludeHeaders:r=[],matchHeaders:n=[],caseSensitive:o=!1}=t;return{ignore:new Set(e.map(s=>o?s:s.toLowerCase())),exclude:new Set(r.map(s=>o?s:s.toLowerCase())),match:new Set(n.map(s=>o?s:s.toLowerCase()))}}a(G3s,"createHeaderFilters");var SWn=H3s.has("crypto")?require("node:crypto"):null,$3s=SWn?.hash?t=>SWn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function IWn(t){return Array.isArray(t)&&(t.length&1)===0}a(IWn,"isUndiciHeaders");function V3s(t=[]){return t.length===0?()=>!1:a(function(r){let n;for(let o of t)if(typeof o=="string"){if(n||(n=r.toLowerCase()),n.includes(o.toLowerCase()))return!0}else if(o instanceof RegExp&&o.test(r))return!0;return!1},"isUrlExcluded")}a(V3s,"isUrlExcludedFactory");function W3s(t){let e={};if(!t)return e;if(IWn(t)){for(let r=0;r{"use strict";p();var{writeFile:Y3s,readFile:K3s,mkdir:J3s}=require("node:fs/promises"),{dirname:Z3s,resolve:wWn}=require("node:path"),{setTimeout:X3s,clearTimeout:RWn}=require("node:timers"),{InvalidArgumentError:kWn,UndiciError:eFs}=uo(),{hashId:tFs,isUrlExcludedFactory:rFs,normalizeHeaders:PWn,createHeaderFilters:DWn}=sdr();function IDe(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||PWn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:NWn(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(IDe,"formatRequestKey");function NWn(t,e,r={}){if(!t||typeof t!="object")return{};let{caseSensitive:n=!1}=r,o={},{ignore:s,exclude:c,match:l}=e;for(let[u,d]of Object.entries(t)){let f=n?u:u.toLowerCase();c.has(f)||s.has(f)||l.size!==0&&!l.has(f)||(o[f]=d)}return o}a(NWn,"filterHeadersForMatching");function MWn(t,e,r={}){if(!t||typeof t!="object")return{};let{caseSensitive:n=!1}=r,o={},{exclude:s}=e;for(let[c,l]of Object.entries(t)){let u=n?c:c.toLowerCase();s.has(u)||(o[u]=l)}return o}a(MWn,"filterHeadersForStorage");function xDe(t){let e=[t.method,t.url];if(t.headers&&typeof t.headers=="object"){let n=Object.keys(t.headers).sort();for(let o of n){let s=Array.isArray(t.headers[o])?t.headers[o]:[t.headers[o]];e.push(o);for(let c of s.sort())e.push(String(c))}}e.push(t.body);let r=e.join("|");return tFs(r)}a(xDe,"createRequestHash");var adr=class{static{a(this,"SnapshotRecorder")}#e;#t;#r=new Map;#n;#i=1/0;#o=!1;#s;constructor(e={}){this.#n=e.snapshotPath,this.#i=e.maxSnapshots||1/0,this.#o=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:e.matchBody!==!1,matchQuery:e.matchQuery!==!1,caseSensitive:e.caseSensitive||!1},this.#s=DWn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=rFs(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=IDe(e,this.#s,this.matchOptions),o=xDe(n),s=PWn(r.headers),c={statusCode:r.statusCode,headers:MWn(s,this.#s,this.matchOptions),body:Buffer.isBuffer(r.body)?r.body.toString("base64"):Buffer.from(String(r.body||"")).toString("base64"),trailers:r.trailers};if(this.#r.size>=this.#i&&!this.#r.has(o)){let u=this.#r.keys().next().value;this.#r.delete(u)}let l=this.#r.get(o);l&&l.responses?(l.responses.push(c),l.timestamp=new Date().toISOString()):this.#r.set(o,{request:n,responses:[c],callCount:0,timestamp:new Date().toISOString()}),this.#o&&this.#n&&this.#u()}isUrlExcluded(e){let r=new URL(e.path,e.origin).toString();return this.#t(r)}findSnapshot(e){if(!this.shouldPlayback(e)||this.isUrlExcluded(e))return;let r=IDe(e,this.#s,this.matchOptions),n=xDe(r),o=this.#r.get(n);if(!o)return;let s=o.callCount||0,c=Math.min(s,o.responses.length-1);return o.callCount=s+1,{...o,response:o.responses[c]}}async loadSnapshots(e){let r=e||this.#n;if(!r)throw new kWn("Snapshot path is required");try{let n=await K3s(wWn(r),"utf8"),o=JSON.parse(n);if(Array.isArray(o)){this.#r.clear();for(let{hash:s,snapshot:c}of o)this.#r.set(s,c)}else this.#r=new Map(Object.entries(o))}catch(n){if(n.code==="ENOENT")this.#r.clear();else throw new eFs(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new kWn("Snapshot path is required");let n=wWn(r);await J3s(Z3s(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await Y3s(n,JSON.stringify(o,null,2),{flush:!0})}clear(){this.#r.clear()}getSnapshots(){return Array.from(this.#r.values())}size(){return this.#r.size}resetCallCounts(){for(let e of this.#r.values())e.callCount=0}deleteSnapshot(e){let r=IDe(e,this.#s,this.matchOptions),n=xDe(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=IDe(e,this.#s,this.matchOptions),n=xDe(r),o=this.#r.get(n);return o?{hash:n,request:o.request,responseCount:o.responses?o.responses.length:o.response?1:0,callCount:o.callCount||0,timestamp:o.timestamp}:null}replaceSnapshots(e){if(this.#r.clear(),Array.isArray(e))for(let{hash:r,snapshot:n}of e)this.#r.set(r,n);else e&&typeof e=="object"&&(this.#r=new Map(Object.entries(e)))}#a(){return this.#u()}#c(){this.#e&&(RWn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=X3s(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(RWn(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};OWn.exports={SnapshotRecorder:adr,formatRequestKey:IDe,createRequestHash:xDe,filterHeadersForMatching:NWn,filterHeadersForStorage:MWn,createHeaderFilters:DWn}});var UWn=I((UEf,FWn)=>{"use strict";p();var nFs=DX(),iFs=odr(),{SnapshotRecorder:oFs}=LWn(),sFs=G2e(),{InvalidArgumentError:aFs,UndiciError:cFs}=uo(),{validateSnapshotMode:lFs}=sdr(),Ub=Symbol("kSnapshotRecorder"),v4=Symbol("kSnapshotMode"),wDe=Symbol("kSnapshotPath"),cdr=Symbol("kSnapshotLoaded"),Yct=Symbol("kRealAgent"),BWn=!1,ldr=class extends iFs{static{a(this,"SnapshotAgent")}constructor(e={}){BWn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),BWn=!0);let{mode:r="record",snapshotPath:n=null,...o}=e;if(super(o),lFs(r),(r==="playback"||r==="update")&&!n)throw new aFs(`snapshotPath is required when mode is '${r}'`);this[v4]=r,this[wDe]=n,this[Ub]=new oFs({snapshotPath:this[wDe],mode:this[v4],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,matchQuery:e.matchQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[cdr]=!1,(this[v4]==="record"||this[v4]==="update"||this[v4]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[Yct]=new nFs(e)),(this[v4]==="playback"||this[v4]==="update")&&this[wDe]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=sFs.wrap(r);let n=this[v4];if(this[Ub].isUrlExcluded(e))return this[Yct].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[cdr])return this.#e(e,r);let o=this[Ub].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new cFs(`No snapshot found for ${e.method||"GET"} ${e.path}`);if(r.onError){r.onError(s);return}throw s}}else if(n==="record")return this.#t(e,r)}async#e(e,r){return await this.loadSnapshots(),this.dispatch(e,r)}#t(e,r){let n={statusCode:null,headers:{},trailers:{},body:[]},o=this,s={onRequestStart(l,u){return r.onRequestStart(l,{...u,history:this.history})},onRequestUpgrade(l,u,d,f){return r.onRequestUpgrade(l,u,d,f)},onResponseStart(l,u,d,f){return n.statusCode=u,n.headers=d,r.onResponseStart(l,u,d,f)},onResponseData(l,u){return n.body.push(u),r.onResponseData(l,u)},onResponseEnd(l,u){n.trailers=u;let d=Buffer.concat(n.body);o[Ub].record(e,{statusCode:n.statusCode,headers:n.headers,body:d,trailers:n.trailers}).then(()=>r.onResponseEnd(l,u)).catch(f=>r.onResponseError(l,f))}};return this[Yct].dispatch(e,s)}#r(e,r){try{let{response:n}=e,o={pause(){},resume(){},abort(c){this.aborted=!0,this.reason=c},aborted:!1,paused:!1};r.onRequestStart(o),r.onResponseStart(o,n.statusCode,n.headers);let s=Buffer.from(n.body,"base64");r.onResponseData(o,s),r.onResponseEnd(o,n.trailers)}catch(n){r.onError?.(n)}}async loadSnapshots(e){await this[Ub].loadSnapshots(e||this[wDe]),this[cdr]=!0,this[v4]==="playback"&&this.#n()}async saveSnapshots(e){return this[Ub].saveSnapshots(e||this[wDe])}#n(){for(let e of this[Ub].getSnapshots()){let{request:r,responses:n,response:o}=e,s=new URL(r.url),c=this.get(s.origin),l=n?n[0]:o;l&&c.intercept({path:s.pathname+s.search,method:r.method,headers:r.headers,body:r.body}).reply(l.statusCode,l.body,{headers:l.headers,trailers:l.trailers}).persist()}}getRecorder(){return this[Ub]}getMode(){return this[v4]}clearSnapshots(){this[Ub].clear()}resetCallCounts(){this[Ub].resetCallCounts()}deleteSnapshot(e){return this[Ub].deleteSnapshot(e)}getSnapshotInfo(e){return this[Ub].getSnapshotInfo(e)}replaceSnapshots(e){this[Ub].replaceSnapshots(e)}async close(){await this[Ub].close(),await this[Yct]?.close(),await super.close()}};FWn.exports=ldr});var Kct=I((jEf,HWn)=>{"use strict";p();var uFs=Symbol.for("undici.globalDispatcher.2"),QWn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:dFs}=uo(),fFs=DX();jWn()===void 0&&qWn(new fFs);function qWn(t){if(!t||typeof t.dispatch!="function")throw new dFs("Argument agent must implement Agent");Object.defineProperty(globalThis,uFs,{value:t,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,QWn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(qWn,"setGlobalDispatcher");function jWn(){return globalThis[QWn]}a(jWn,"getGlobalDispatcher");var pFs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];HWn.exports={setGlobalDispatcher:qWn,getGlobalDispatcher:jWn,installedExports:pFs}});var Hhe=I((VEf,GWn)=>{"use strict";p();var L8=require("node:assert"),hFs=G2e();GWn.exports=class{static{a(this,"DecoratorHandler")}#e;#t=!1;#r=!1;#n=!1;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=hFs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return L8(!this.#t),L8(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return L8(!this.#t),L8(!this.#r),L8(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return L8(!this.#t),L8(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return L8(!this.#t),L8(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var pdr=I((YEf,zWn)=>{"use strict";p();var Qb=No(),{kBodyUsed:RDe}=Al(),fdr=require("node:assert"),{InvalidArgumentError:udr}=uo(),mFs=require("node:events"),gFs=[300,301,302,303,307,308],$Wn=Symbol("body"),VWn=a(()=>{},"noop"),Jct=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[$Wn]=e,this[RDe]=!1}async*[Symbol.asyncIterator](){fdr(!this[RDe],"disturbed"),this[RDe]=!0,yield*this[$Wn]}},ddr=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new udr("maxRedirections must be a positive number");let n=e.dispatch.bind(e);return(o,s)=>n(o,new t(n,r,o,s))}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new udr("maxRedirections must be a positive number");this.dispatch=e,this.location=null;let{maxRedirections:s,...c}=n;this.opts=c,this.maxRedirections=r,this.handler=o,this.history=[],Qb.isStream(this.opts.body)?(Qb.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){fdr(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[RDe]=!1,mFs.prototype.on.call(this.opts.body,"data",function(){this[RDe]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Jct(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&Qb.isIterable(this.opts.body)&&!Qb.isFormDataLike(this.opts.body)&&(this.opts.body=new Jct(this.opts.body))}onRequestStart(e,r){this.handler.onRequestStart?.(e,{...r,history:this.history})}onRequestUpgrade(e,r,n,o){this.handler.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw new Error("max redirects");if((r===301||r===302)&&this.opts.method==="POST"&&(this.opts.method="GET",Qb.isStream(this.opts.body)&&Qb.destroy(this.opts.body.on("error",VWn)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",Qb.isStream(this.opts.body)&&Qb.destroy(this.opts.body.on("error",VWn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||Qb.isDisturbed(this.opts.body)||gFs.indexOf(r)===-1?null:n.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location){this.handler.onResponseStart?.(e,r,n,o);return}let{origin:s,pathname:c,search:l}=Qb.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c,d=`${s}${u}`;for(let f of this.history)if(f.toString()===d)throw new udr(`Redirect loop detected. Cannot redirect to ${s}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=AFs(this.opts.headers,r===303,this.opts.origin!==s),this.opts.path=u,this.opts.origin=s,this.opts.query=null}onResponseData(e,r){this.location||this.handler.onResponseData?.(e,r)}onResponseEnd(e,r){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,r)}onResponseError(e,r){this.handler.onResponseError?.(e,r)}};function WWn(t,e,r){if(t.length===4)return Qb.headerNameToString(t)==="host";if(e&&Qb.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=Qb.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a(WWn,"shouldRemoveHeader");function AFs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var yFs=pdr();function _Fs({maxRedirections:t}={}){return e=>a(function(n,o){let{maxRedirections:s=t,...c}=n;if(s==null||s===0)return e(n,o);let l={...c},u=new yFs(e,s,l,o);return e(l,u)},"Intercept")}a(_Fs,"createRedirectInterceptor");YWn.exports=_Fs});var ZWn=I((tvf,JWn)=>{"use strict";p();var EFs=Hhe(),{ResponseError:vFs}=uo(),hdr=class extends EFs{static{a(this,"ResponseErrorHandler")}#e;#t;#r;#n;#i;constructor(e,{handler:r}){super(r)}#o(e){return(this.#t??"").indexOf(e)===0}onRequestStart(e,r){return this.#e=0,this.#t=null,this.#r=null,this.#n=null,this.#i="",super.onRequestStart(e,r)}onResponseStart(e,r,n,o){if(this.#e=r,this.#n=n,this.#t=n["content-type"],this.#e<400)return super.onResponseStart(e,r,n,o);(this.#o("application/json")||this.#o("text/plain"))&&(this.#r=new TextDecoder("utf-8"))}onResponseData(e,r){if(this.#e<400)return super.onResponseData(e,r);this.#i+=this.#r?.decode(r,{stream:!0})??""}onResponseEnd(e,r){if(this.#e>=400){if(this.#i+=this.#r?.decode(void 0,{stream:!1})??"",this.#o("application/json"))try{this.#i=JSON.parse(this.#i)}catch{}let n,o=Error.stackTraceLimit;Error.stackTraceLimit=0;try{n=new vFs("Response Error",this.#e,{body:this.#i,headers:this.#n})}finally{Error.stackTraceLimit=o}super.onResponseError(e,n)}else super.onResponseEnd(e,r)}onResponseError(e,r){super.onResponseError(e,r)}};JWn.exports=()=>t=>a(function(r,n){return t(r,new hdr(r,{handler:n}))},"Intercept")});var ezn=I((ivf,XWn)=>{"use strict";p();var CFs=Oct();XWn.exports=t=>e=>a(function(n,o){return e(n,new CFs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var rzn=I((avf,tzn)=>{"use strict";p();var{InvalidArgumentError:bFs,RequestAbortedError:SFs}=uo(),TFs=Hhe(),mdr=class extends TFs{static{a(this,"DumpHandler")}#e=1024*1024;#t=!1;#r=0;#n=null;aborted=!1;reason=!1;constructor({maxSize:e,signal:r},n){if(e!=null&&(!Number.isFinite(e)||e<1))throw new bFs("maxSize must be a number greater than 0");super(n),this.#e=e??this.#e}#i(e){this.aborted=!0,this.reason=e}onRequestStart(e,r){return e.abort=this.#i.bind(this),this.#n=e,super.onRequestStart(e,r)}onResponseStart(e,r,n,o){let s=n["content-length"];if(s!=null&&s>this.#e)throw new SFs(`Response size (${s}) larger than maxSize (${this.#e})`);return this.aborted===!0?!0:super.onResponseStart(e,r,n,o)}onResponseError(e,r){this.#t||(r=this.#n?.reason??r,super.onResponseError(e,r))}onResponseData(e,r){return this.#r=this.#r+r.length,this.#r>=this.#e&&(this.#t=!0,this.aborted===!0?super.onResponseError(e,this.reason):super.onResponseEnd(e,{})),!0}onResponseEnd(e,r){if(!this.#t){if(this.#n.aborted===!0){super.onResponseError(e,this.reason);return}super.onResponseEnd(e,r)}}};function IFs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new mdr({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(IFs,"createDumpInterceptor");tzn.exports=IFs});var szn=I((uvf,ozn)=>{"use strict";p();var{isIP:xFs}=require("node:net"),{lookup:wFs}=require("node:dns"),RFs=Hhe(),{InvalidArgumentError:HX,InformationalError:kFs}=uo(),gdr=Math.pow(2,31)-1;function PFs(t){let e=Object.getPrototypeOf(t);return Object.prototype.hasOwnProperty.call(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}a(PFs,"hasSafeIterator");function nzn(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(nzn,"isHostHeader");function DFs(t){if(t==null)return null;if(Array.isArray(t)){if(t.length===0||!Array.isArray(t[0]))return t;let e=[];for(let r of t)Array.isArray(r)&&r.length===2?e.push(r[0],r[1]):e.push(r);return e}if(typeof t=="object"&&PFs(t)){let e=[];for(let r of t)Array.isArray(r)&&r.length===2?e.push(r[0],r[1]):e.push(r);return e}return t}a(DFs,"normalizeHeaders");function NFs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},ydr=class{static{a(this,"DNSInstance")}#e=0;#t=0;dualStack=!0;affinity=null;lookup=null;pick=null;storage=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#n,this.storage=e.storage??new Adr(e)}runLookup(e,r,n){let o=this.storage.get(e.hostname);if(o==null&&this.storage.full()){n(null,e);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(o==null)this.lookup(e,s,(c,l)=>{if(c||l==null||l.length===0){n(c??new kFs("No DNS entries found"));return}this.setRecords(e,l);let u=this.storage.get(e.hostname),d=this.pick(e,u,s.affinity),f;typeof d.port=="number"?f=`:${d.port}`:e.port!==""?f=`:${e.port}`:f="",n(null,new URL(`${e.protocol}//${d.family===6?`[${d.address}]`:d.address}${f}`))});else{let c=this.pick(e,o,s.affinity);if(c==null){this.storage.delete(e.hostname),this.runLookup(e,r,n);return}let l;typeof c.port=="number"?l=`:${c.port}`:e.port!==""?l=`:${e.port}`:l="",n(null,new URL(`${e.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`))}}#r(e,r,n){wFs(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(o,s)=>{if(o)return n(o);let c=new Map;for(let l of s)c.set(`${l.address}:${l.family}`,l);n(null,c.values())})}#n(e,r,n){let o=null,{records:s,offset:c}=r,l;if(this.dualStack?(n==null&&(c==null||c===gdr?(r.offset=0,n=4):(r.offset++,n=(r.offset&1)===1?6:4)),s[n]!=null&&s[n].ips.length>0?l=s[n]:l=s[n===4?6:4]):l=s[n],l==null||l.ips.length===0)return o;l.offset==null||l.offset===gdr?l.offset=0:l.offset++;let u=l.offset%l.ips.length;return o=l.ips[u]??null,o==null?o:Date.now()-o.timestamp>o.ttl?(l.ips.splice(u,1),this.pick(e,r,n)):o}pickFamily(e,r){let n=this.storage.get(e.hostname)?.records;if(!n)return null;let o=n[r];if(!o)return null;o.offset==null||o.offset===gdr?o.offset=0:o.offset++;let s=o.offset%o.ips.length,c=o.ips[s]??null;return c==null||Date.now()-c.timestamp>c.ttl&&o.ips.splice(s,1),c}setRecords(e,r){let n=Date.now(),o={records:{4:null,6:null}},s=this.#e;for(let c of r){c.timestamp=n,typeof c.ttl=="number"?(c.ttl=Math.min(c.ttl,this.#e),s=Math.min(s,c.ttl)):c.ttl=this.#e;let l=o.records[c.family]??{ips:[]};l.ips.push(c),o.records[c.family]=l}this.storage.set(e.hostname,o,{ttl:s})}deleteRecords(e){this.storage.delete(e.hostname)}getHandler(e,r){return new _dr(this,e,r)}},_dr=class extends RFs{static{a(this,"DNSDispatchHandler")}#e=null;#t=null;#r=null;#n=null;#i=null;#o=null;#s=!0;constructor(e,{origin:r,handler:n,dispatch:o,newOrigin:s},c){super(n),this.#n=r,this.#o=s,this.#t={...c},this.#e=e,this.#r=o}onResponseError(e,r){switch(r.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){if(!this.#s){super.onResponseError(e,r);return}this.#s=!1;let n=this.#o.hostname[0]==="["?4:6,o=this.#e.pickFamily(this.#n,n);if(o==null){super.onResponseError(e,r);return}let s;typeof o.port=="number"?s=`:${o.port}`:this.#n.port!==""?s=`:${this.#n.port}`:s="";let c={...this.#t,origin:`${this.#n.protocol}//${o.family===6?`[${o.address}]`:o.address}${s}`,headers:izn(this.#n.host,this.#t.headers)};this.#r(c,this);return}super.onResponseError(e,r);break}case"ENOTFOUND":this.#e.deleteRecords(this.#n),super.onResponseError(e,r);break;default:super.onResponseError(e,r);break}}};ozn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new HX("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new HX("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new HX("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new HX("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new HX("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new HX("Invalid pick. Must be a function");if(t?.storage!=null&&(typeof t?.storage?.get!="function"||typeof t?.storage?.set!="function"||typeof t?.storage?.full!="function"||typeof t?.storage?.delete!="function"))throw new HX("Invalid storage. Must be a object with methods: { get, set, full, delete }");let e=t?.dualStack??!0,r;e?r=t?.affinity??null:r=t?.affinity??4;let n={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:r,maxItems:t?.maxItems??1/0,storage:t?.storage},o=new ydr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return xFs(d.hostname)!==0?s(l,u):(o.runLookup(d,l,(f,h)=>{if(f)return u.onResponseError(null,f);let m={...l,servername:d.hostname,origin:h.origin,headers:izn(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var Ghe=I((pvf,Azn)=>{"use strict";p();var{safeHTTPMethods:azn,pathHasQueryOrFragment:MFs,hasSafeIterator:OFs,isValidHTTPToken:kDe}=No(),{serializePathWithQuery:LFs}=No(),BFs=2147483647,czn=["no-store","private","no-cache"],Edr=Symbol("invalid cache-control directives");function GX(t){return t.replace(/^[\t ]+|[\t ]+$/g,"")}a(GX,"trimOWS");function hzn(t,e){for(let r=0;rl}),u=d+1);return e.push({value:c.substring(u),fromMalformedQuote:u>l}),e}a(FFs,"splitCacheControlHeaderValue");function fzn(t,e){let r=t[Edr];r===void 0&&(r=new Set,Object.defineProperty(t,Edr,{value:r})),r.add(e)}a(fzn,"markInvalidCacheControlDirective");function UFs(t,e){return t[Edr]?.has(e)===!0}a(UFs,"hasInvalidCacheControlDirective");function QFs(t){for(let n of czn)if(t.startsWith(n)&&t.length>n.length&&!kDe(t[n.length]))return n;let e="",r=!1;for(let n=0;n=2&&h[0]==='"'&&h[h.length-1]==='"'&&(h=h.substring(1,h.length-1)),!/^[0-9]+$/.test(h)){delete e[f],r.add(f),fzn(e,f);continue}let y=Math.min(parseInt(h,10),BFs);f==="min-fresh"?(!(f in e)||e[f]y)&&(e[f]=y);break}case"private":case"no-cache":{if(u){e[f]=!0;break}if(h!==void 0&&h.length===0){e[f]=!0;break}if(h){if(h[0]==='"'){h=uzn(h);let y="",_=s,E=!1,v=dzn(h,1);if(v!==-1)y=h.substring(1,v),E=!0;else{let w=[h.substring(1)];for(let R=s+1;R{"use strict";p();function JFs(t){switch(t[3]){case",":return ZFs(t);case" ":return XFs(t);default:return e8s(t)}}a(JFs,"parseHttpDate");function Cdr(t,e,r,n,o,s,c){let l=new Date(Date.UTC(t,e,r,n,o,s));return t>=0&&t<=99&&l.setUTCFullYear(t),l.getUTCFullYear()===t&&l.getUTCMonth()===e&&l.getUTCDate()===r&&l.getUTCHours()===n&&l.getUTCMinutes()===o&&l.getUTCSeconds()===s&&l.getUTCDay()===c?l:void 0}a(Cdr,"makeDate");function ZFs(t){if(t.length!==29||t[4]!==" "||t[7]!==" "||t[11]!==" "||t[16]!==" "||t[19]!==":"||t[22]!==":"||t[25]!==" "||t[26]!=="G"||t[27]!=="M"||t[28]!=="T")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let r=0;if(t[5]==="0"){let m=t.charCodeAt(6);if(m<49||m>57)return;r=m-48}else{let m=t.charCodeAt(5);if(m<49||m>51)return;let g=t.charCodeAt(6);if(g<48||g>57)return;r=(m-48)*10+(g-48)}let n=-1;if(t[8]==="J"&&t[9]==="a"&&t[10]==="n")n=0;else if(t[8]==="F"&&t[9]==="e"&&t[10]==="b")n=1;else if(t[8]==="M"&&t[9]==="a")if(t[10]==="r")n=2;else if(t[10]==="y")n=4;else return;else if(t[8]==="J")if(t[9]==="a"&&t[10]==="n")n=0;else if(t[9]==="u")if(t[10]==="n")n=5;else if(t[10]==="l")n=6;else return;else return;else if(t[8]==="A")if(t[9]==="p"&&t[10]==="r")n=3;else if(t[9]==="u"&&t[10]==="g")n=7;else return;else if(t[8]==="S"&&t[9]==="e"&&t[10]==="p")n=8;else if(t[8]==="O"&&t[9]==="c"&&t[10]==="t")n=9;else if(t[8]==="N"&&t[9]==="o"&&t[10]==="v")n=10;else if(t[8]==="D"&&t[9]==="e"&&t[10]==="c")n=11;else return;let o=t.charCodeAt(12);if(o<48||o>57)return;let s=t.charCodeAt(13);if(s<48||s>57)return;let c=t.charCodeAt(14);if(c<48||c>57)return;let l=t.charCodeAt(15);if(l<48||l>57)return;let u=(o-48)*1e3+(s-48)*100+(c-48)*10+(l-48),d=0;if(t[17]==="0"){let m=t.charCodeAt(18);if(m<48||m>57)return;d=m-48}else{let m=t.charCodeAt(17);if(m<48||m>50)return;let g=t.charCodeAt(18);if(g<48||g>57||m===50&&g>51)return;d=(m-48)*10+(g-48)}let f=0;if(t[20]==="0"){let m=t.charCodeAt(21);if(m<48||m>57)return;f=m-48}else{let m=t.charCodeAt(20);if(m<48||m>53)return;let g=t.charCodeAt(21);if(g<48||g>57)return;f=(m-48)*10+(g-48)}let h=0;if(t[23]==="0"){let m=t.charCodeAt(24);if(m<48||m>57)return;h=m-48}else{let m=t.charCodeAt(23);if(m<48||m>53)return;let g=t.charCodeAt(24);if(g<48||g>57)return;h=(m-48)*10+(g-48)}return Cdr(u,n,r,d,f,h,e)}a(ZFs,"parseImfDate");function XFs(t){if(t.length!==24||t[7]!==" "||t[10]!==" "||t[19]!==" ")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let r=-1;if(t[4]==="J"&&t[5]==="a"&&t[6]==="n")r=0;else if(t[4]==="F"&&t[5]==="e"&&t[6]==="b")r=1;else if(t[4]==="M"&&t[5]==="a")if(t[6]==="r")r=2;else if(t[6]==="y")r=4;else return;else if(t[4]==="J")if(t[5]==="a"&&t[6]==="n")r=0;else if(t[5]==="u")if(t[6]==="n")r=5;else if(t[6]==="l")r=6;else return;else return;else if(t[4]==="A")if(t[5]==="p"&&t[6]==="r")r=3;else if(t[5]==="u"&&t[6]==="g")r=7;else return;else if(t[4]==="S"&&t[5]==="e"&&t[6]==="p")r=8;else if(t[4]==="O"&&t[5]==="c"&&t[6]==="t")r=9;else if(t[4]==="N"&&t[5]==="o"&&t[6]==="v")r=10;else if(t[4]==="D"&&t[5]==="e"&&t[6]==="c")r=11;else return;let n=0;if(t[8]===" "){let m=t.charCodeAt(9);if(m<49||m>57)return;n=m-48}else{let m=t.charCodeAt(8);if(m<49||m>51)return;let g=t.charCodeAt(9);if(g<48||g>57)return;n=(m-48)*10+(g-48)}let o=0;if(t[11]==="0"){let m=t.charCodeAt(12);if(m<48||m>57)return;o=m-48}else{let m=t.charCodeAt(11);if(m<48||m>50)return;let g=t.charCodeAt(12);if(g<48||g>57||m===50&&g>51)return;o=(m-48)*10+(g-48)}let s=0;if(t[14]==="0"){let m=t.charCodeAt(15);if(m<48||m>57)return;s=m-48}else{let m=t.charCodeAt(14);if(m<48||m>53)return;let g=t.charCodeAt(15);if(g<48||g>57)return;s=(m-48)*10+(g-48)}let c=0;if(t[17]==="0"){let m=t.charCodeAt(18);if(m<48||m>57)return;c=m-48}else{let m=t.charCodeAt(17);if(m<48||m>53)return;let g=t.charCodeAt(18);if(g<48||g>57)return;c=(m-48)*10+(g-48)}let l=t.charCodeAt(20);if(l<48||l>57)return;let u=t.charCodeAt(21);if(u<48||u>57)return;let d=t.charCodeAt(22);if(d<48||d>57)return;let f=t.charCodeAt(23);if(f<48||f>57)return;let h=(l-48)*1e3+(u-48)*100+(d-48)*10+(f-48);return Cdr(h,r,n,o,s,c,e)}a(XFs,"parseAscTimeDate");function e8s(t){let e=-1,r=-1;if(t[0]==="S")t[1]==="u"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y"?(r=0,e=6):t[1]==="a"&&t[2]==="t"&&t[3]==="u"&&t[4]==="r"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(r=6,e=8);else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")r=1,e=6;else if(t[0]==="T")t[1]==="u"&&t[2]==="e"&&t[3]==="s"&&t[4]==="d"&&t[5]==="a"&&t[6]==="y"?(r=2,e=7):t[1]==="h"&&t[2]==="u"&&t[3]==="r"&&t[4]==="s"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(r=4,e=8);else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d"&&t[3]==="n"&&t[4]==="e"&&t[5]==="s"&&t[6]==="d"&&t[7]==="a"&&t[8]==="y")r=3,e=9;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")r=5,e=6;else return;if(t[e]!==","||t.length-e-1!==23||t[e+1]!==" "||t[e+4]!=="-"||t[e+8]!=="-"||t[e+11]!==" "||t[e+14]!==":"||t[e+17]!==":"||t[e+20]!==" "||t[e+21]!=="G"||t[e+22]!=="M"||t[e+23]!=="T")return;let n=0;if(t[e+2]==="0"){let h=t.charCodeAt(e+3);if(h<49||h>57)return;n=h-48}else{let h=t.charCodeAt(e+2);if(h<49||h>51)return;let m=t.charCodeAt(e+3);if(m<48||m>57)return;n=(h-48)*10+(m-48)}let o=-1;if(t[e+5]==="J"&&t[e+6]==="a"&&t[e+7]==="n")o=0;else if(t[e+5]==="F"&&t[e+6]==="e"&&t[e+7]==="b")o=1;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="r")o=2;else if(t[e+5]==="A"&&t[e+6]==="p"&&t[e+7]==="r")o=3;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="y")o=4;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="n")o=5;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="l")o=6;else if(t[e+5]==="A"&&t[e+6]==="u"&&t[e+7]==="g")o=7;else if(t[e+5]==="S"&&t[e+6]==="e"&&t[e+7]==="p")o=8;else if(t[e+5]==="O"&&t[e+6]==="c"&&t[e+7]==="t")o=9;else if(t[e+5]==="N"&&t[e+6]==="o"&&t[e+7]==="v")o=10;else if(t[e+5]==="D"&&t[e+6]==="e"&&t[e+7]==="c")o=11;else return;let s=t.charCodeAt(e+9);if(s<48||s>57)return;let c=t.charCodeAt(e+10);if(c<48||c>57)return;let l=(s-48)*10+(c-48);l+=l<70?2e3:1900;let u=0;if(t[e+12]==="0"){let h=t.charCodeAt(e+13);if(h<48||h>57)return;u=h-48}else{let h=t.charCodeAt(e+12);if(h<48||h>50)return;let m=t.charCodeAt(e+13);if(m<48||m>57||h===50&&m>51)return;u=(h-48)*10+(m-48)}let d=0;if(t[e+15]==="0"){let h=t.charCodeAt(e+16);if(h<48||h>57)return;d=h-48}else{let h=t.charCodeAt(e+15);if(h<48||h>53)return;let m=t.charCodeAt(e+16);if(m<48||m>57)return;d=(h-48)*10+(m-48)}let f=0;if(t[e+18]==="0"){let h=t.charCodeAt(e+19);if(h<48||h>57)return;f=h-48}else{let h=t.charCodeAt(e+18);if(h<48||h>53)return;let m=t.charCodeAt(e+19);if(m<48||m>57)return;f=(h-48)*10+(m-48)}return Cdr(l,o,n,u,d,f,r)}a(e8s,"parseRfc850Date");yzn.exports={parseHttpDate:JFs}});var Tzn=I((_vf,Szn)=>{"use strict";p();var Sdr=No(),{parseCacheControlHeader:t8s,hasInvalidCacheControlDirective:_zn,parseVaryHeader:r8s,hasVaryStar:n8s,isInvalidOrWildcardVaryHeader:vzn,isEtagUsable:i8s}=Ghe(),{parseHttpDate:Tdr}=bdr();function o8s(){}a(o8s,"noop");var Czn=[200,203,204,206,300,301,308,404,405,410,414,501],s8s=[206],PDe=2147483647e3;function a8s(t){return t.replace(/^[\t ]+|[\t ]+$/g,"")}a(a8s,"trimOWS");function $he(t,e){for(let r=0;rthis.#i.onResponseStart?.(e,r,n,o),"downstreamOnHeaders"),c=this;if(!$he(Sdr.safeHTTPMethods,this.#e.method)&&r>=200&&r<=399)return u8s(this.#n,this.#e,n),s();let l=n["cache-control"],u=n["last-modified"]&&$he(Czn,r);if(!l&&!n.expires&&!u&&!this.#r)return r===304&&n.vary&&vzn(n.vary)&&DDe(this.#n,this.#e),s();let d=l?t8s(l):{};if(!f8s(this.#t,r,n,d,this.#e.headers))return r===304&&(l||d8s(this.#t,n,d))&&DDe(this.#n,this.#e),s();let f=Date.now(),h=Object.hasOwn(n,"age")?h8s(n.age):void 0;if(h!==void 0&&h>=PDe)return Zct(r,this.#n,this.#e),s();let m=Object.hasOwn(n,"date")?p8s(n.date):void 0;if(m===null)return Zct(r,this.#n,this.#e),s();let g=m?Math.max(0,f-m.getTime()):0,A=Math.max(g,h??0),y=m8s(this.#t,f,h,n,m,d)??this.#r;if(y===void 0||A>=y)return(l||y!==void 0)&&Zct(r,this.#n,this.#e),s();let _=f-A,E=y+_;if(f>=E)return Zct(r,this.#n,this.#e),s();let v;if(this.#e.headers&&n.vary&&(v=r8s(n.vary,this.#e.headers),!v))return s();let S=_,T=g8s(_,f,d,E),w=A8s(n,d),R={statusCode:r,statusMessage:o,headers:w,vary:v,cacheControlDirectives:d,cachedAt:S,staleAt:E,deleteAt:T};if(r===304){let x=a(D=>{if(!D)return s();if(R.statusCode=D.statusCode,R.statusMessage=D.statusMessage,R.etag=D.etag,R.vary=v??D.vary,R.headers={...D.headers,...w},s(),this.#o=this.#n.createWriteStream(this.#e,R),!(!this.#o||!D?.body))if(typeof D.body.values=="function"){let N=D.body.values(),O=a(()=>{for(let B of N){let q=this.#o.write(B)===!1;if(this.#i.onResponseData?.(e,B),q)break}},"streamCachedBody");this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("drain",()=>{O()}).on("close",function(){c.#o===this&&(c.#o=void 0)}),O()}else typeof D.body.on=="function"&&(D.body.on("data",N=>{this.#o.write(N),this.#i.onResponseData?.(e,N)}).on("end",()=>{this.#o.end()}).on("error",()=>{this.#o=void 0,this.#n.delete(this.#e)}),this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("close",function(){c.#o===this&&(c.#o=void 0)}))},"handle304"),k=this.#n.get(this.#e);k&&typeof k.then=="function"?k.then(x):x(k)}else{if(typeof n.etag=="string"&&i8s(n.etag)&&(R.etag=n.etag),this.#o=this.#n.createWriteStream(this.#e,R),!this.#o)return s();this.#o.on("drain",()=>e.resume()).on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("close",function(){c.#o===this&&(c.#o=void 0),e.resume()}),s()}}onResponseData(e,r){this.#o?.write(r)===!1&&e.pause(),this.#i.onResponseData?.(e,r)}onResponseEnd(e,r){this.#o?.end(),this.#i.onResponseEnd?.(e,r)}onResponseError(e,r){this.#o?.destroy(r),this.#o=void 0,this.#i.onResponseError?.(e,r)}};function DDe(t,e){try{t.delete(e)?.catch?.(o8s)}catch{}}a(DDe,"deleteCachedValue");function Zct(t,e,r){t===304&&DDe(e,r)}a(Zct,"deleteCachedValueIfNotModified");function d8s(t,e,r){return r["no-store"]===!0||t==="shared"&&r.private===!0||(e.vary?vzn(e.vary):!1)}a(d8s,"revalidationResponseDisallowsCachedReuse");function f8s(t,e,r,n,o){return!(e<200||$he(s8s,e)||!$he(Czn,e)&&!r.expires&&!n.public&&n["max-age"]===void 0&&!(n.private&&t==="private")&&!(n["s-maxage"]!==void 0&&t==="shared")||n["no-store"]||t==="shared"&&n.private===!0||r.vary&&n8s(r.vary)||o!=null&&Object.hasOwn(o,"authorization")&&(!n.public&&!n["s-maxage"]&&!n["must-revalidate"]||typeof o.authorization!="string"||Array.isArray(n["no-cache"])&&$he(n["no-cache"],"authorization")||Array.isArray(n.private)&&$he(n.private,"authorization")))}a(f8s,"canCacheResponse");function p8s(t){let e=t;if(Array.isArray(e)){if(e.length!==1)return null;e=e[0]}return typeof e!="string"?null:Tdr(e)}a(p8s,"getDate");function h8s(t){let e=t;if(Array.isArray(e)){if(e.length!==1)return PDe;e=e[0]}if(typeof e!="string"||!/^[\t ]*[0-9]+[\t ]*$/.test(e))return PDe;let r=BigInt(e.replace(/^[\t ]+|[\t ]+$/g,""));return r>=BigInt(PDe/1e3)?PDe:Number(r)*1e3}a(h8s,"getAge");function m8s(t,e,r,n,o,s){if(t==="shared"){if(_zn(s,"s-maxage"))return 0;let l=s["s-maxage"];if(l!==void 0)return l*1e3}if(_zn(s,"max-age"))return 0;let c=s["max-age"];if(c!==void 0)return c*1e3;if(Object.hasOwn(n,"expires")){if(typeof n.expires!="string")return 0;let l=Tdr(n.expires);if(!l||e>=l.getTime())return 0;if(o){if(o>=l)return 0;let u=l.getTime()-o.getTime();return r!==void 0&&r>=u?0:u}return l.getTime()-e}if(typeof n["last-modified"]=="string"){let l=Tdr(n["last-modified"]);if(l)return l.getTime()>=e?void 0:(e-l.getTime())*.1}if(s.immutable)return 31536e6}a(m8s,"determineStaleAt");function g8s(t,e,r,n){let o=-1/0,s=-1/0,c=-1/0;if(r["stale-while-revalidate"]&&(o=n+r["stale-while-revalidate"]*1e3),r["stale-if-error"]&&(s=n+r["stale-if-error"]*1e3),r.immutable&&o===-1/0&&s===-1/0&&(c=e+31536e6),o===-1/0&&s===-1/0&&c===-1/0){let l=n-t,u=Math.min(Math.max(e-t,0),1e3);return n+l+u}return Math.max(n,o,s,c)}a(g8s,"determineDeleteAt");function A8s(t,e){let r=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];t.connection&&c8s(r,t.connection),Array.isArray(e["no-cache"])&&r.push(...e["no-cache"]),Array.isArray(e.private)&&r.push(...e.private);let n;for(let o of r)Object.hasOwn(t,o)&&(n??={...t},delete n[o]);return n??t}a(A8s,"stripNecessaryHeaders");Szn.exports=Idr});var wdr=I((Cvf,wzn)=>{"use strict";p();var{Writable:y8s}=require("node:stream"),{EventEmitter:_8s}=require("node:events"),{assertCacheKey:Izn,assertCacheValue:E8s}=Ghe(),xdr=class extends _8s{static{a(this,"MemoryCacheStore")}#e=1024;#t=104857600;#r=5242880;#n=0;#i=0;#o=new Map;#s=!1;constructor(e){if(super(),e){if(typeof e!="object")throw new TypeError("MemoryCacheStore options must be an object");if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}if(e.maxSize!==void 0){if(typeof e.maxSize!="number"||!Number.isInteger(e.maxSize)||e.maxSize<0)throw new TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#t=e.maxSize}if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#r=e.maxEntrySize}}}get size(){return this.#n}isFull(){return this.#n>=this.#t||this.#i>=this.#e}get(e){Izn(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?xzn(e,o,n):null;return s==null?void 0:{statusMessage:s.statusMessage,statusCode:s.statusCode,headers:s.headers,body:s.body,vary:s.vary?s.vary:void 0,etag:s.etag,cacheControlDirectives:s.cacheControlDirectives,cachedAt:s.cachedAt,staleAt:s.staleAt,deleteAt:s.deleteAt}}createWriteStream(e,r){Izn(e),E8s(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new y8s({write(c,l,u){typeof c=="string"&&(c=Buffer.from(c,l)),s.size+=c.byteLength,s.size>=o.#r?this.destroy():s.body.push(c),u(null)},final(c){let l=o.#o.get(n);l||(l=[],o.#o.set(n,l));let u=xzn(e,l,Date.now());if(u){let d=l.indexOf(u);l.splice(d,1,s),o.#n-=u.size}else l.push(s),o.#i+=1;if(o.#n+=s.size,o.#n>o.#t||o.#i>o.#e){o.#s||(o.emit("maxSizeExceeded",{size:o.#n,maxSize:o.#t,count:o.#i,maxCount:o.#e}),o.#s=!0);for(let[d,f]of o.#o){for(let h of f.splice(0,f.length/2))o.#n-=h.size,o.#i-=1;f.length===0&&o.#o.delete(d)}o.#nr&&o.method===t.method&&v8s(t,o))return o}}a(xzn,"findEntry");function v8s(t,e){if(e.vary==null)return!0;for(let r in e.vary)if(Object.hasOwn(e.vary,r)&&!C8s(t.headers?.[r],e.vary[r]))return!1;return!0}a(v8s,"varyMatches");function C8s(t,e){if(t==null&&e==null)return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;r{"use strict";p();var b8s=require("node:assert"),Rdr=class{static{a(this,"CacheRevalidationHandler")}#e=!1;#t;#r;#n;#i;constructor(e,r,n){if(typeof e!="function")throw new TypeError("callback must be a function");this.#t=e,this.#r=r,this.#i=n}onRequestStart(e,r){this.#e=!1,this.#n=r}onRequestUpgrade(e,r,n,o){this.#r.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){if(b8s(this.#t!=null),this.#e=r===304||this.#i&&r>=500&&r<=504,this.#t(this.#e,this.#n,r,n),this.#t=null,this.#e)return!0;this.#r.onRequestStart?.(e,this.#n),this.#r.onResponseStart?.(e,r,n,o)}onResponseData(e,r){if(!this.#e)return this.#r.onResponseData?.(e,r)}onResponseEnd(e,r){this.#e||this.#r.onResponseEnd?.(e,r)}onResponseError(e,r){if(!this.#e)if(this.#t&&(this.#t(!1),this.#t=null),typeof this.#r.onResponseError=="function")this.#r.onResponseError(e,r);else throw r}};Rzn.exports=Rdr});var Fzn=I((wvf,Bzn)=>{"use strict";p();var Pzn=require("node:assert"),{Readable:S8s}=require("node:stream"),YH=No(),Vhe=Tzn(),T8s=wdr(),I8s=kzn(),{assertCacheStore:x8s,assertCacheMethods:w8s,makeCacheKey:R8s,normalizeHeaders:k8s,parseCacheControlHeader:Lzn,isInvalidOrWildcardVaryHeader:P8s}=Ghe(),{AbortError:D8s}=uo(),{parseHttpDate:N8s}=bdr();function M8s(t,e){if(t!==void 0){if(!Array.isArray(t))throw new TypeError(`expected ${e} to be an array or undefined, got ${typeof t}`);for(let r=0;r{},"nop");function O8s(t){return t.replace(/^[\t ]+|[\t ]+$/g,"")}a(O8s,"trimOWS");function Dzn(t,e){for(let r=0;rt.staleAt){if(!Pdr(t,r)&&e?.["max-stale"]){let o=t.staleAt+e["max-stale"]*1e3;return n>o}return!0}if(e?.["min-fresh"]){let o=t.staleAt-n,s=e["min-fresh"]*1e3;return o<=s}return!1}a(q8s,"isStale");function j8s(t,e){let r=t.cacheControlDirectives?.["stale-while-revalidate"];if(!r||Pdr(t,e))return!1;let n=Date.now(),o=t.staleAt+r*1e3;return n<=o}a(j8s,"withinStaleWhileRevalidateWindow");function H8s(t,e,r,n,o,s){if(s?.["only-if-cached"]){let c=!1;try{if(typeof n.onConnect=="function"&&(n.onConnect(()=>{c=!0}),c)||typeof n.onHeaders=="function"&&(n.onHeaders(504,[],NDe,"Gateway Timeout"),c))return;typeof n.onComplete=="function"&&n.onComplete([])}catch(l){typeof n.onError=="function"&&n.onError(l)}return!0}return t(o,new Vhe(e,r,n))}a(H8s,"handleUncachedResponse");function kdr(t,e,r,n,o,s){let c=YH.isStream(r.body)?r.body:S8s.from(r.body??[]);Pzn(!c.destroyed,"stream should not be destroyed"),Pzn(!c.readableDidRead,"stream should not be readableDidRead");let l={resume(){c.resume()},pause(){c.pause()},get paused(){return c.isPaused()},get aborted(){return c.destroyed},get reason(){return c.errored},abort(d){c.destroy(d??new D8s)}};if(c.on("error",function(d){if(!this.readableEnded)if(typeof t.onResponseError=="function")t.onResponseError(l,d);else throw d}).on("close",function(){this.errored||t.onResponseEnd?.(l,{})}),t.onRequestStart?.(l,o),c.destroyed)return;let u={...r.headers,age:String(n)};s&&(u.warning='110 - "response is stale"'),t.onResponseStart?.(l,r.statusCode,u,r.statusMessage),e.method==="HEAD"?c.destroy():c.on("data",function(d){t.onResponseData?.(l,d)})}a(kdr,"sendCachedValue");function Ozn(t,e,r,n,o,s,c){if(!c)return H8s(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new Vhe(e,r,n));let u=Math.round((l-c.cachedAt)/1e3),d=s?.["max-age"]!==void 0&&u>=s["max-age"],f=d||q8s(c,s,e.type),h=d||B8s(c,s,o);if(f||h){if(YH.isStream(o.body)&&YH.bodyLength(o.body)!==0)return t(o,new Vhe(e,r,n));if(!h&&j8s(c,e.type))return kdr(n,o,c,u,null,!0),queueMicrotask(()=>{let A=Mzn(o,c);t({...o,headers:A},new Vhe(e,r,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let m=!1;if(!Pdr(c,e.type)){let A=c.cacheControlDirectives["stale-if-error"]??s?.["stale-if-error"];A&&(m=l{if(A){if(_===304){if(F8s(e.type,E))return YH.isStream(c.body)&&c.body.on("error",NDe).destroy(),Nzn(e.store,r),t(o,new Vhe(e,r,n));U8s(E)&&Nzn(e.store,r)}kdr(n,o,c,u,y,f)}else YH.isStream(c.body)&&c.body.on("error",NDe).destroy()},new Vhe(e,r,n),m))}YH.isStream(o.body)&&o.body.on("error",NDe).destroy(),kdr(n,o,c,u,null,!1)}a(Ozn,"handleResult");Bzn.exports=(t={})=>{let{store:e=new T8s,methods:r=["GET"],cacheByDefault:n=void 0,type:o="shared",origins:s=void 0}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(x8s(e,"opts.store"),w8s(r,"opts.methods"),M8s(s,"opts.origins"),typeof n<"u"&&typeof n!="number")throw new TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof n}`);if(typeof o<"u"&&o!=="shared"&&o!=="private")throw new TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof o}`);let c={store:e,methods:r,cacheByDefault:n,type:o},l=[];for(let u=0;u(d,f)=>{if(!d.origin||Dzn(l,d.method))return u(d,f);if(s!==void 0){let A=d.origin.toString().toLowerCase(),y=!1;for(let _=0;_Ozn(u,c,m,f,d,h,A)):Ozn(u,c,m,f,d,h,g)}}});var Hzn=I((Pvf,jzn)=>{"use strict";p();var{createInflate:Ddr,createGunzip:Uzn,createBrotliDecompress:G8s,createZstdDecompress:$8s}=require("node:zlib"),{pipeline:V8s}=require("node:stream"),W8s=Hhe(),{runtimeFeatures:z8s}=I8(),Qzn={gzip:Uzn,"x-gzip":Uzn,br:G8s,deflate:Ddr,compress:Ddr,"x-compress":Ddr,...z8s.has("zstd")?{zstd:$8s}:{}},Y8s=[204,304],qzn=!1,Ndr=class extends W8s{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=Y8s,skipErrorResponses:n=!0}={}){super(e),this.#t=r,this.#r=n}#n(e,r){return!!(!e||r<200||this.#t.includes(r)||this.#r&&r>=400)}#i(e){let r=e.split(","),n=5;if(r.length>n)throw new Error(`too many content-encodings in response: ${r.length}, maximum allowed is ${n}`);let o=[];for(let s=r.length-1;s>=0;s--){let c=r[s].trim();if(c){if(!Qzn[c])return o.length=0,o;o.push(Qzn[c]())}}return o}#o(e,r){e.on("readable",()=>{let n;for(;(n=e.read())!==null&&super.onResponseData(r,n)!==!1;);}),e.on("error",n=>{super.onResponseError(r,n)})}#s(e){let r=this.#e[0];this.#o(r,e),r.on("end",()=>{super.onResponseEnd(e,{})})}#a(e){let r=this.#e[this.#e.length-1];this.#o(r,e),V8s(this.#e,n=>{if(n){super.onResponseError(e,n);return}super.onResponseEnd(e,{})})}#c(){this.#e.length=0}onResponseStart(e,r,n,o){let s=n["content-encoding"];if(this.#n(s,r))return super.onResponseStart(e,r,n,o);let c=this.#i(s.toLowerCase());if(c.length===0)return this.#c(),super.onResponseStart(e,r,n,o);this.#e=c;let{"content-encoding":l,"content-length":u,...d}=n;return this.#e.length===1?this.#s(e):this.#a(e),super.onResponseStart(e,r,d,o)}onResponseData(e,r){if(this.#e.length>0){this.#e[0].write(r);return}super.onResponseData(e,r)}onResponseEnd(e,r){if(this.#e.length>0){this.#e[0].end(),this.#c();return}super.onResponseEnd(e,r)}onResponseError(e,r){if(this.#e.length>0){for(let n of this.#e)n.destroy(r);this.#c()}super.onResponseError(e,r)}};function K8s(t={}){return qzn||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),qzn=!0),e=>(r,n)=>{let o=new Ndr(n,t);return e(r,o)}}a(K8s,"createDecompressInterceptor");jzn.exports=K8s});var Vzn=I((Mvf,$zn)=>{"use strict";p();var{RequestAbortedError:J8s}=uo(),Gzn=5*1024*1024,Mdr=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=Gzn;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=Gzn){this.#e=e,this.#p=r,this.#r=n}addWaitingHandler(e){if(this.#u||this.#c)return!1;let r=this.#g(e),n=r.controller;try{if(e.onRequestStart?.(n,null),n.aborted)return r.done=!0,!0;this.#a&&e.onResponseStart?.(n,this.#n,this.#i,this.#o)}catch{return r.done=!0,!0}return n.aborted||this.#t.push(r),!0}onRequestStart(e,r){this.#l=e,this.#e.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.#e.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){this.#a=!0,this.#n=r,this.#i=n,this.#o=o,this.#e.onResponseStart?.(e,r,n,o);for(let s of this.#t){let{handler:c,controller:l}=s;if(s.done||l.aborted){s.done=!0;continue}try{c.onResponseStart?.(l,r,n,o)}catch{}l.aborted&&(s.done=!0)}this.#m()}onResponseData(e,r){if(!(this.#s||this.#u)){this.#c=!0,this.#e.onResponseData?.(e,r);for(let n of this.#t){let{handler:o,controller:s}=n;if(n.done||s.aborted){n.done=!0;continue}if(s.paused){this.#A(n,r);continue}try{o.onResponseData?.(s,r)}catch{}s.aborted&&(n.done=!0,n.bufferedChunks=[],n.bufferedBytes=0)}this.#m()}}onResponseEnd(e,r){if(!(this.#s||this.#u)){this.#u=!0,this.#e.onResponseEnd?.(e,r);for(let n of this.#t){if(n.done||n.controller.aborted){n.done=!0;continue}if(this.#h(n),n.done||n.controller.aborted){n.done=!0;continue}if(n.controller.paused&&n.bufferedChunks.length>0){n.pendingTrailers=r;continue}try{n.handler.onResponseEnd?.(n.controller,r)}catch{}n.done=!0}this.#m(),this.#p?.()}}onResponseError(e,r){if(!this.#u){this.#s=!0,this.#u=!0,this.#e.onResponseError?.(e,r);for(let n of this.#t)this.#v(n,r);this.#t=[],this.#p?.()}}#g(e){let r={handler:e,controller:null,bufferedChunks:[],bufferedBytes:0,pendingTrailers:null,done:!1},n={aborted:!1,paused:!1,reason:null};return r.controller={resume:a(()=>{if(!n.aborted){if(n.paused=!1,this.#h(r),this.#u&&r.pendingTrailers&&r.bufferedChunks.length===0&&!n.paused&&!n.aborted){try{r.handler.onResponseEnd?.(r.controller,r.pendingTrailers)}catch{}r.pendingTrailers=null,r.done=!0}this.#m()}},"resume"),pause:a(()=>{n.aborted||(n.paused=!0)},"pause"),get paused(){return n.paused},get aborted(){return n.aborted},get reason(){return n.reason},abort:a(o=>{n.aborted=!0,n.reason=o??null,r.done=!0,r.pendingTrailers=null,r.bufferedChunks=[],r.bufferedBytes=0},"abort")},r}#A(e,r){if(e.done||e.controller.aborted){e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0;return}let n=Buffer.from(r);if(e.bufferedChunks.push(n),e.bufferedBytes+=n.length,e.bufferedBytes>this.#r){let o=new J8s(`Deduplicated waiting handler exceeded maxBufferSize (${this.#r} bytes) while paused`);this.#v(e,o)}}#h(e){let{handler:r,controller:n}=e;for(;!e.done&&!n.aborted&&!n.paused&&e.bufferedChunks.length>0;){let o=e.bufferedChunks.shift();e.bufferedBytes-=o.length;try{r.onResponseData?.(n,o)}catch{}if(n.aborted){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;break}}}#v(e,r){if(!e.done){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;try{e.controller.abort(r),e.handler.onResponseError?.(e.controller,r)}catch{}}}#m(){this.#t=this.#t.filter(e=>e.done===!1)}};$zn.exports=Mdr});var zzn=I((Bvf,Wzn)=>{"use strict";p();var Z8s=require("node:diagnostics_channel"),X8s=No(),e6s=Vzn(),{normalizeHeaders:t6s,makeCacheKey:r6s,makeDeduplicationKey:n6s}=Ghe(),Xct=Z8s.channel("undici:request:pending-requests");Wzn.exports=(t={})=>{let{methods:e=["GET"],skipHeaderNames:r=[],excludeHeaderNames:n=[],maxBufferSize:o=5*1024*1024}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(!Array.isArray(e))throw new TypeError(`expected opts.methods to be an array, got ${typeof e}`);for(let u of e)if(!X8s.safeHTTPMethods.includes(u))throw new TypeError(`expected opts.methods to only contain safe HTTP methods, got ${u}`);if(!Array.isArray(r))throw new TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof r}`);if(!Array.isArray(n))throw new TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof n}`);if(!Number.isFinite(o)||o<=0)throw new TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${o}`);let s=new Set(r.map(u=>u.toLowerCase())),c=new Set(n.map(u=>u.toLowerCase())),l=new Map;return u=>(d,f)=>{if(!d.origin||e.includes(d.method)===!1)return u(d,f);if(d={...d,headers:t6s(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=r6s(d),m=n6s(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new e6s(f,()=>{l.delete(m),Xct.hasSubscribers&&Xct.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),Xct.hasSubscribers&&Xct.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var Jzn=I((Qvf,Kzn)=>{"use strict";p();var{Writable:i6s}=require("node:stream"),{assertCacheKey:Odr,assertCacheValue:o6s}=Ghe(),Ldr,JT=3,Yzn=2*1e3*1e3*1e3;Kzn.exports=class{static{a(this,"SqliteCacheStore")}#e=Yzn;#t=1/0;#r;#n;#i;#o;#s;#a;#c;#u;constructor(e){if(e){if(typeof e!="object")throw new TypeError("SqliteCacheStore options must be an object");if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("SqliteCacheStore options.maxEntrySize must be a non-negative integer");if(e.maxEntrySize>Yzn)throw new TypeError("SqliteCacheStore options.maxEntrySize must be less than 2gb");this.#e=e.maxEntrySize}if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("SqliteCacheStore options.maxCount must be a non-negative integer");this.#t=e.maxCount}}Ldr||(Ldr=require("node:sqlite").DatabaseSync),this.#r=new Ldr(e?.location??":memory:"),this.#r.exec(` PRAGMA journal_mode = WAL; PRAGMA synchronous = NORMAL; PRAGMA temp_store = memory; @@ -299,76 +299,76 @@ ${e.format(r)}`.trim())}};vWn.exports=ndr});var odr=I((PEf,TWn)=>{"use strict";p ORDER BY cachedAt ASC LIMIT ? ) - `)}close(){this.#r.close()}get(e){Mdr(e);let r=this.#g(e);return r?{body:r.body?Buffer.from(r.body.buffer,r.body.byteOffset,r.body.byteLength):void 0,statusCode:r.statusCode,statusMessage:r.statusMessage,headers:r.headers?JSON.parse(r.headers):void 0,etag:r.etag?r.etag:void 0,vary:r.vary?JSON.parse(r.vary):void 0,cacheControlDirectives:r.cacheControlDirectives?JSON.parse(r.cacheControlDirectives):void 0,cachedAt:r.cachedAt,staleAt:r.staleAt,deleteAt:r.deleteAt}:void 0}set(e,r){Mdr(e);let n=this.#p(e),o=Array.isArray(r.body)?Buffer.concat(r.body):r.body,s=o?.byteLength;if(s&&s>this.#e)return;let c=this.#g(e,!0);c?this.#i.run(o,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.cachedAt,r.staleAt,c.id):(this.#o.run(n,e.method,o,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.vary?JSON.stringify(r.vary):null,r.cachedAt,r.staleAt),this.#l())}createWriteStream(e,r){Mdr(e),n6s(r);let n=0,o=[],s=this;return new r6s({decodeStrings:!0,write(c,l,u){n+=c.byteLength,n=u.deleteAt&&!r)continue;let d=!0;if(u.vary){let f=JSON.parse(u.vary);for(let h in f)if(!i6s(o[h],f[h])){d=!1;break}}if(d)return u}}};function i6s(t,e){if(t==null&&e==null)return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;r{"use strict";p();var{kConstruct:o6s}=Al(),{kEnumerableProperty:Vhe}=No(),{iteratorMixin:s6s,isValidHeaderName:MDe,isValidHeaderValue:Jzn}=VT(),{webidl:Ba}=oy(),Ldr=require("node:assert"),elt=require("node:util");function Kzn(t){return t===10||t===13||t===9||t===32}a(Kzn,"isHTTPWhiteSpaceCharCode");function Zzn(t){let e=0,r=t.length;for(;r>e&&Kzn(t.charCodeAt(r-1));)--r;for(;r>e&&Kzn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(Zzn,"headerValueNormalize");function Xzn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(Xzn,"fill");function Bdr(t,e,r){if(r=Zzn(r),MDe(e)){if(!Jzn(r))throw Ba.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw Ba.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(tYn(t)==="immutable")throw new TypeError("immutable");return rlt(t).append(e,r,!1)}a(Bdr,"appendHeader");function a6s(t){let e=rlt(t);if(!e)return[];if(e.sortedMap)return e.sortedMap;let r=[],n=e.toSortedArray(),o=e.cookies;if(o===null||o.length===1)return e.sortedMap=n;for(let s=0;s>1),r[d][0]<=f[0]?u=d+1:l=d;if(s!==d){for(c=s;c>u;)r[c]=r[--c];r[u]=f}}if(!n.next().done)throw new TypeError("Unreachable");return r}else{let n=0;for(let{0:o,1:{value:s}}of this.headersMap)r[n++]=[o,s],Ldr(s!==null);return r.sort(eYn)}}},iD=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){Ba.util.markAsUncloneable(this),e!==o6s&&(this.#t=new tlt,this.#e="none",e!==void 0&&(e=Ba.converters.HeadersInit(e,"Headers constructor","init"),Xzn(this,e)))}append(e,r){Ba.brandCheck(this,t),Ba.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=Ba.converters.ByteString(e,n,"name"),r=Ba.converters.ByteString(r,n,"value"),Bdr(this,e,r)}delete(e){if(Ba.brandCheck(this,t),Ba.argumentLengthCheck(arguments,1,"Headers.delete"),e=Ba.converters.ByteString(e,"Headers.delete","name"),!MDe(e))throw Ba.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){Ba.brandCheck(this,t),Ba.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=Ba.converters.ByteString(e,r,"name"),!MDe(e))throw Ba.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Ba.brandCheck(this,t),Ba.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=Ba.converters.ByteString(e,r,"name"),!MDe(e))throw Ba.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){Ba.brandCheck(this,t),Ba.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=Ba.converters.ByteString(e,n,"name"),r=Ba.converters.ByteString(r,n,"value"),r=Zzn(r),MDe(e)){if(!Jzn(r))throw Ba.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw Ba.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){Ba.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[elt.inspect.custom](e,r){return r.depth??=e,`Headers ${elt.formatWithOptions(r,this.#t.entries)}`}static getHeadersGuard(e){return e.#e}static setHeadersGuard(e,r){e.#e=r}static getHeadersList(e){return e.#t}static setHeadersList(e,r){e.#t=r}},{getHeadersGuard:tYn,setHeadersGuard:c6s,getHeadersList:rlt,setHeadersList:l6s}=iD;Reflect.deleteProperty(iD,"getHeadersGuard");Reflect.deleteProperty(iD,"setHeadersGuard");Reflect.deleteProperty(iD,"getHeadersList");Reflect.deleteProperty(iD,"setHeadersList");s6s("Headers",iD,a6s,0,1);Object.defineProperties(iD.prototype,{append:Vhe,delete:Vhe,get:Vhe,has:Vhe,set:Vhe,getSetCookie:Vhe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[elt.inspect.custom]:{enumerable:!1}});Ba.converters.HeadersInit=function(t,e,r){if(Ba.util.Type(t)===Ba.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!elt.types.isProxy(t)&&n===iD.prototype.entries)try{return rlt(t).entriesList}catch{}return typeof n=="function"?Ba.converters["sequence>"](t,e,r,n.bind(t)):Ba.converters["record"](t,e,r)}throw Ba.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};rYn.exports={fill:Xzn,compareHeaderName:eYn,Headers:iD,HeadersList:tlt,getHeadersGuard:tYn,setHeadersGuard:c6s,setHeadersList:l6s,getHeadersList:rlt}});var LDe=I((Gvf,hYn)=>{"use strict";p();var{Headers:cYn,HeadersList:nYn,fill:u6s,getHeadersGuard:d6s,setHeadersGuard:lYn,setHeadersList:uYn}=GX(),{extractBody:iYn,cloneBody:f6s,mixinBody:p6s,streamRegistry:dYn,bodyUnusable:h6s}=bhe(),fYn=No(),oYn=require("node:util"),{kEnumerableProperty:ZT}=fYn,{isValidReasonPhrase:m6s,isCancelled:g6s,isAborted:A6s,isErrorLike:y6s,environmentSettingsObject:_6s}=VT(),{redirectStatusSet:E6s,nullBodyStatus:v6s}=W2e(),{webidl:aa}=oy(),{URLSerializer:sYn}=sR(),{kConstruct:ilt}=Al(),Fdr=require("node:assert"),{isomorphicEncode:C6s,serializeJavascriptValueToJSONString:b6s}=T8(),S6s=new TextEncoder("utf-8"),XT=class t{static{a(this,"Response")}#e;#t;static error(){return ODe(olt(),"immutable")}static json(e,r=void 0){aa.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=aa.converters.ResponseInit(r));let n=S6s.encode(b6s(e)),o=iYn(n),s=ODe(Whe({}),"response");return aYn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){aa.argumentLengthCheck(arguments,1,"Response.redirect"),e=aa.converters.USVString(e),r=aa.converters["unsigned short"](r);let n;try{n=new URL(e,_6s.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!E6s.has(r))throw new RangeError(`Invalid status code ${r}`);let o=ODe(Whe({}),"immutable");o.#t.status=r;let s=C6s(sYn(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(aa.util.markAsUncloneable(this),e===ilt)return;e!==null&&(e=aa.converters.BodyInit(e,"Response","body")),r=aa.converters.ResponseInit(r),this.#t=Whe({}),this.#e=new cYn(ilt),lYn(this.#e,"response"),uYn(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=iYn(e);n={body:o,type:s}}aYn(this,r,n)}get type(){return aa.brandCheck(this,t),this.#t.type}get url(){aa.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":sYn(r,!0)}get redirected(){return aa.brandCheck(this,t),this.#t.urlList.length>1}get status(){return aa.brandCheck(this,t),this.#t.status}get ok(){return aa.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return aa.brandCheck(this,t),this.#t.statusText}get headers(){return aa.brandCheck(this,t),this.#e}get body(){return aa.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return aa.brandCheck(this,t),!!this.#t.body&&fYn.isDisturbed(this.#t.body.stream)}clone(){if(aa.brandCheck(this,t),h6s(this.#t))throw aa.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=Udr(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&dYn.register(this,new WeakRef(this.#t.body.stream)),ODe(e,d6s(this.#e))}[oYn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${oYn.formatWithOptions(r,n)}`}static getResponseHeaders(e){return e.#e}static setResponseHeaders(e,r){e.#e=r}static getResponseState(e){return e.#t}static setResponseState(e,r){e.#t=r}},{getResponseHeaders:T6s,setResponseHeaders:I6s,getResponseState:$X,setResponseState:x6s}=XT;Reflect.deleteProperty(XT,"getResponseHeaders");Reflect.deleteProperty(XT,"setResponseHeaders");Reflect.deleteProperty(XT,"getResponseState");Reflect.deleteProperty(XT,"setResponseState");p6s(XT,$X);Object.defineProperties(XT.prototype,{type:ZT,url:ZT,status:ZT,ok:ZT,redirected:ZT,statusText:ZT,headers:ZT,clone:ZT,body:ZT,bodyUsed:ZT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(XT,{json:ZT,redirect:ZT,error:ZT});function Udr(t){if(t.internalResponse)return pYn(Udr(t.internalResponse),t.type);let e=Whe({...t,body:null});return t.body!=null&&(e.body=f6s(t.body)),e}a(Udr,"cloneResponse");function Whe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new nYn(t?.headersList):new nYn,urlList:t?.urlList?[...t.urlList]:[]}}a(Whe,"makeResponse");function olt(t){let e=y6s(t);return Whe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(olt,"makeNetworkError");function w6s(t){return t.type==="error"&&t.status===0}a(w6s,"isNetworkError");function nlt(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(r,n){return n in e?e[n]:r[n]},set(r,n,o){return Fdr(!(n in e)),r[n]=o,!0}})}a(nlt,"makeFilteredResponse");function pYn(t,e){if(e==="basic")return nlt(t,{type:"basic",headersList:t.headersList});if(e==="cors")return nlt(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return nlt(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return nlt(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});Fdr(!1)}a(pYn,"filterResponse");function R6s(t,e=null){return Fdr(g6s(t)),A6s(t)?olt(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):olt(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(R6s,"makeAppropriateNetworkError");function aYn(t,e,r){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!m6s(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&($X(t).status=e.status),"statusText"in e&&e.statusText!=null&&($X(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&u6s(T6s(t),e.headers),r){if(v6s.includes(t.status))throw aa.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});$X(t).body=r.body,r.type!=null&&!$X(t).headersList.contains("content-type",!0)&&$X(t).headersList.append("content-type",r.type,!0)}}a(aYn,"initializeResponse");function ODe(t,e){let r=new XT(ilt);x6s(r,t);let n=new cYn(ilt);return I6s(r,n),uYn(n,t.headersList),lYn(n,e),t.urlList.length!==0&&t.body?.stream&&dYn.register(r,new WeakRef(t.body.stream)),r}a(ODe,"fromInnerResponse");aa.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?aa.converters.USVString(t,e,r):aa.is.Blob(t)||aa.is.BufferSource(t)||aa.is.FormData(t)||aa.is.URLSearchParams(t)?t:aa.converters.DOMString(t,e,r)};aa.converters.BodyInit=function(t,e,r){return aa.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:aa.converters.XMLHttpRequestBodyInit(t,e,r)};aa.converters.ResponseInit=aa.dictionaryConverter([{key:"status",converter:aa.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:aa.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:aa.converters.HeadersInit}]);aa.is.Response=aa.util.MakeTypeAssertion(XT);hYn.exports={isNetworkError:w6s,makeNetworkError:olt,makeResponse:Whe,makeAppropriateNetworkError:R6s,filterResponse:pYn,Response:XT,cloneResponse:Udr,fromInnerResponse:ODe,getResponseState:$X}});var zhe=I((Wvf,wYn)=>{"use strict";p();var{extractBody:k6s,mixinBody:P6s,cloneBody:D6s,bodyUnusable:mYn}=bhe(),{Headers:vYn,fill:N6s,HeadersList:clt,setHeadersGuard:Qdr,getHeadersGuard:M6s,setHeadersList:CYn,getHeadersList:gYn}=GX(),alt=No(),AYn=require("node:util"),{isValidHTTPToken:O6s,sameOrigin:yYn,environmentSettingsObject:slt}=VT(),{forbiddenMethodsSet:L6s,corsSafeListedMethodsSet:B6s,referrerPolicy:F6s,requestRedirect:U6s,requestMode:Q6s,requestCredentials:q6s,requestCache:j6s,requestDuplex:H6s}=W2e(),{kEnumerableProperty:Im,normalizedMethodRecordsBase:G6s,normalizedMethodRecords:$6s}=alt,{webidl:Ui}=oy(),{URLSerializer:V6s}=sR(),{kConstruct:llt}=Al(),W6s=require("node:assert"),{getMaxListeners:bYn,setMaxListeners:z6s,defaultMaxListeners:Y6s}=require("node:events"),K6s=Symbol("abortController"),SYn=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),ult=new WeakMap,qdr;try{qdr=bYn(new AbortController().signal)>0}catch{qdr=!1}function _Yn(t){return e;function e(){let r=t.deref();if(r!==void 0){SYn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=ult.get(r.signal);if(n!==void 0){if(n.size!==0){for(let o of n){let s=o.deref();s!==void 0&&s.abort(this.reason)}n.clear()}ult.delete(r.signal)}}}}a(_Yn,"buildAbort");var EYn=!1,qb=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Ui.util.markAsUncloneable(this),e===llt)return;Ui.argumentLengthCheck(arguments,1,"Request constructor"),e=Ui.converters.RequestInfo(e),r=Ui.converters.RequestInit(r);let o=null,s=null,c=slt.settingsObject.baseUrl,l=null;if(typeof e=="string"){this.#t=r.dispatcher;let E;try{E=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(E.username||E.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=dlt({urlList:[E]}),s="cors"}else W6s(Ui.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=slt.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&yYn(o.window,u)&&(d=o.window),r.window!=null)throw new TypeError(`'window' option '${d}' must be null`);"window"in r&&(d="no-window"),o=dlt({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:slt.settingsObject,window:d,priority:o.priority,origin:o.origin,referrer:o.referrer,referrerPolicy:o.referrerPolicy,mode:o.mode,credentials:o.credentials,cache:o.cache,redirect:o.redirect,integrity:o.integrity,keepalive:o.keepalive,reloadNavigation:o.reloadNavigation,historyNavigation:o.historyNavigation,urlList:[...o.urlList]});let f=Object.keys(r).length!==0;if(f&&(o.mode==="navigate"&&(o.mode="same-origin"),o.reloadNavigation=!1,o.historyNavigation=!1,o.origin="client",o.referrer="client",o.referrerPolicy="",o.url=o.urlList[o.urlList.length-1],o.urlList=[o.url]),r.referrer!==void 0){let E=r.referrer;if(E==="")o.referrer="no-referrer";else{let v;try{v=new URL(E,c)}catch(S){throw new TypeError(`Referrer "${E}" is not a valid URL.`,{cause:S})}v.protocol==="about:"&&v.hostname==="client"||u&&!yYn(v,slt.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw Ui.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let E=r.method,v=$6s[E];if(v!==void 0)o.method=v;else{if(!O6s(E))throw new TypeError(`'${E}' is not a valid HTTP method.`);let S=E.toUpperCase();if(L6s.has(S))throw new TypeError(`'${E}' HTTP method is unsupported.`);E=G6s[S]??E,o.method=E}!EYn&&o.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),EYn=!0)}r.signal!==void 0&&(l=r.signal),this.#n=o;let m=new AbortController;if(this.#e=m.signal,l!=null)if(l.aborted)m.abort(l.reason);else{this[K6s]=m;let E=new WeakRef(m),v=_Yn(E);qdr&&bYn(l)===Y6s&&z6s(1500,l),alt.addAbortListener(l,v),SYn.register(m,{signal:l,abort:v},v)}if(this.#r=new vYn(llt),CYn(this.#r,o.headersList),Qdr(this.#r,"request"),h==="no-cors"){if(!B6s.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);Qdr(this.#r,"request-no-cors")}if(f){let E=gYn(this.#r),v=r.headers!==void 0?r.headers:new clt(E);if(E.clear(),v instanceof clt){for(let{name:S,value:T}of v.rawValues())E.append(S,T,!1);E.cookies=v.cookies}else N6s(this.#r,v)}let g=Ui.is.Request(e)?e.#n.body:null;if((r.body!=null||g!=null)&&(o.method==="GET"||o.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let A=null;if(r.body!=null){let[E,v]=k6s(r.body,o.keepalive);A=E,v&&!gYn(this.#r).contains("content-type",!0)&&this.#r.append("content-type",v,!0)}let y=A??g;if(y!=null&&y.source==null){if(A!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(o.mode!=="same-origin"&&o.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');o.useCORSPreflightFlag=!0}let _=y;if(A==null&&g!=null){if(mYn(e.#n))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let E=new TransformStream;g.stream.pipeThrough(E),_={source:g.source,length:g.length,stream:E.readable}}this.#n.body=_}get method(){return Ui.brandCheck(this,t),this.#n.method}get url(){return Ui.brandCheck(this,t),V6s(this.#n.url)}get headers(){return Ui.brandCheck(this,t),this.#r}get destination(){return Ui.brandCheck(this,t),this.#n.destination}get referrer(){return Ui.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Ui.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Ui.brandCheck(this,t),this.#n.mode}get credentials(){return Ui.brandCheck(this,t),this.#n.credentials}get cache(){return Ui.brandCheck(this,t),this.#n.cache}get redirect(){return Ui.brandCheck(this,t),this.#n.redirect}get integrity(){return Ui.brandCheck(this,t),this.#n.integrity}get keepalive(){return Ui.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Ui.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Ui.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Ui.brandCheck(this,t),this.#e}get body(){return Ui.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Ui.brandCheck(this,t),!!this.#n.body&&alt.isDisturbed(this.#n.body.stream)}get duplex(){return Ui.brandCheck(this,t),"half"}clone(){if(Ui.brandCheck(this,t),mYn(this.#n))throw new TypeError("unusable");let e=IYn(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=ult.get(this.signal);n===void 0&&(n=new Set,ult.set(this.signal,n));let o=new WeakRef(r);n.add(o),alt.addAbortListener(r.signal,_Yn(o))}return xYn(e,this.#t,r.signal,M6s(this.#r))}[AYn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${AYn.formatWithOptions(r,n)}`}static setRequestSignal(e,r){return e.#e=r,e}static getRequestDispatcher(e){return e.#t}static setRequestDispatcher(e,r){e.#t=r}static setRequestHeaders(e,r){e.#r=r}static getRequestState(e){return e.#n}static setRequestState(e,r){e.#n=r}},{setRequestSignal:J6s,getRequestDispatcher:Z6s,setRequestDispatcher:X6s,setRequestHeaders:eUs,getRequestState:TYn,setRequestState:tUs}=qb;Reflect.deleteProperty(qb,"setRequestSignal");Reflect.deleteProperty(qb,"getRequestDispatcher");Reflect.deleteProperty(qb,"setRequestDispatcher");Reflect.deleteProperty(qb,"setRequestHeaders");Reflect.deleteProperty(qb,"getRequestState");Reflect.deleteProperty(qb,"setRequestState");P6s(qb,TYn);function dlt(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,useURLCredentials:t.useURLCredentials??void 0,traversableForUserPrompts:t.traversableForUserPrompts??"client",urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new clt(t.headersList):new clt}}a(dlt,"makeRequest");function IYn(t){let e=dlt({...t,body:null});return t.body!=null&&(e.body=D6s(t.body)),e}a(IYn,"cloneRequest");function xYn(t,e,r,n){let o=new qb(llt);tUs(o,t),X6s(o,e),J6s(o,r);let s=new vYn(llt);return eUs(o,s),CYn(s,t.headersList),Qdr(s,n),o}a(xYn,"fromInnerRequest");Object.defineProperties(qb.prototype,{method:Im,url:Im,headers:Im,redirect:Im,clone:Im,signal:Im,duplex:Im,destination:Im,body:Im,bodyUsed:Im,isHistoryNavigation:Im,isReloadNavigation:Im,keepalive:Im,integrity:Im,cache:Im,credentials:Im,attribute:Im,referrerPolicy:Im,referrer:Im,mode:Im,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Ui.is.Request=Ui.util.MakeTypeAssertion(qb);Ui.converters.RequestInfo=function(t){return typeof t=="string"?Ui.converters.USVString(t):Ui.is.Request(t)?t:Ui.converters.USVString(t)};Ui.converters.RequestInit=Ui.dictionaryConverter([{key:"method",converter:Ui.converters.ByteString},{key:"headers",converter:Ui.converters.HeadersInit},{key:"body",converter:Ui.nullableConverter(Ui.converters.BodyInit)},{key:"referrer",converter:Ui.converters.USVString},{key:"referrerPolicy",converter:Ui.converters.DOMString,allowedValues:F6s},{key:"mode",converter:Ui.converters.DOMString,allowedValues:Q6s},{key:"credentials",converter:Ui.converters.DOMString,allowedValues:q6s},{key:"cache",converter:Ui.converters.DOMString,allowedValues:j6s},{key:"redirect",converter:Ui.converters.DOMString,allowedValues:U6s},{key:"integrity",converter:Ui.converters.DOMString},{key:"keepalive",converter:Ui.converters.boolean},{key:"signal",converter:Ui.nullableConverter(t=>Ui.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Ui.converters.any},{key:"duplex",converter:Ui.converters.DOMString,allowedValues:H6s},{key:"dispatcher",converter:Ui.converters.any},{key:"priority",converter:Ui.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);wYn.exports={Request:qb,makeRequest:dlt,fromInnerRequest:xYn,cloneRequest:IYn,getRequestDispatcher:Z6s,getRequestState:TYn}});var LYn=I((Kvf,OYn)=>{"use strict";p();var rUs=require("node:assert"),{runtimeFeatures:kYn}=I8(),VX=new Map([["sha256",0],["sha384",1],["sha512",2]]),jdr;if(kYn.has("crypto")){jdr=require("node:crypto");let t=jdr.getHashes();t.length===0&&VX.clear();for(let e of VX.keys())t.includes(e)===!1&&VX.delete(e)}else VX.clear();var RYn=Map.prototype.get.bind(VX),Hdr=Map.prototype.has.bind(VX),nUs=kYn.has("crypto")===!1||VX.size===0?()=>!0:(t,e)=>{let r=DYn(e);if(r.length===0)return!0;let n=PYn(r);for(let o of n){let s=o.alg,c=o.val,l=NYn(s,t);if(MYn(l,c))return!0}return!1};function PYn(t){let e=[],r=null;for(let n of t){if(rUs(Hdr(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=RYn(o),c=n.alg,l=RYn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a(PYn,"getStrongestMetadata");function DYn(t){let e=[];for(let r of t.split(" ")){let o=r.split("?",1)[0],s="",c=[o.slice(0,6),o.slice(7)],l=c[0];if(!Hdr(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(DYn,"parseMetadata");var NYn=a((t,e)=>jdr.hash(t,e,"base64"),"applyAlgorithmToBytes");function MYn(t,e){let r=t.length;r!==0&&t[r-1]==="="&&(r-=1),r!==0&&t[r-1]==="="&&(r-=1);let n=e.length;if(n!==0&&e[n-1]==="="&&(n-=1),n!==0&&e[n-1]==="="&&(n-=1),r!==n)return!1;for(let o=0;o{"use strict";p();var{makeNetworkError:_l,makeAppropriateNetworkError:BDe,filterResponse:Gdr,makeResponse:flt,fromInnerResponse:iUs,getResponseState:oUs}=LDe(),{HeadersList:$dr}=GX(),{Request:sUs,cloneRequest:aUs,getRequestDispatcher:cUs,getRequestState:lUs}=zhe(),oD=require("node:zlib"),{makePolicyContainer:uUs,clonePolicyContainer:dUs,requestBadPort:fUs,TAOCheck:pUs,appendRequestOriginHeader:hUs,responseLocationURL:mUs,requestCurrentURL:eI,setRequestReferrerPolicyOnRedirect:gUs,tryUpgradeRequestToAPotentiallyTrustworthyURL:AUs,createOpaqueTimingInfo:Jdr,appendFetchMetadata:yUs,corsCheck:_Us,crossOriginResourcePolicyCheck:EUs,determineRequestsReferrer:vUs,coarsenedSharedCurrentTime:FDe,sameOrigin:Ydr,isCancelled:KH,isAborted:BYn,isErrorLike:CUs,fullyReadBody:bUs,readableStreamClose:SUs,urlIsLocal:TUs,urlIsHttpHttpsScheme:glt,urlHasHttpsScheme:IUs,clampAndCoarsenConnectionTimingInfo:xUs,simpleRangeHeaderValue:wUs,buildContentRange:RUs,createInflate:kUs,extractMimeType:PUs,hasAuthenticationEntry:DUs,includesCredentials:FYn,isTraversableNavigable:NUs}=VT(),WX=require("node:assert"),{safelyExtractBody:Alt,extractBody:UYn}=bhe(),{redirectStatusSet:HYn,nullBodyStatus:GYn,safeMethodsSet:MUs,requestBodyHeader:OUs,subresourceSet:LUs}=W2e(),BUs=require("node:events"),{Readable:FUs,pipeline:UUs,finished:QUs,isErrored:qUs,isReadable:plt}=require("node:stream"),{addAbortListener:jUs,bufferToLowerCasedHeaderName:QYn}=No(),{dataURLProcessor:HUs,serializeAMimeType:GUs,minimizeSupportedMimeType:$Us}=sR(),{getGlobalDispatcher:VUs}=Kct(),{webidl:Zdr}=oy(),{STATUS_CODES:qYn}=require("node:http"),{bytesMatch:WUs}=LYn(),{createDeferredPromise:zUs}=Z2e(),{isomorphicEncode:hlt}=T8(),{runtimeFeatures:YUs}=I8(),KUs=YUs.has("zstd"),JUs=["GET","HEAD"],ZUs=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",Vdr,mlt=class extends BUs{static{a(this,"Fetch")}constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function XUs(t){$Yn(t,"fetch")}a(XUs,"handleFetchDone");function e9s(t,e=void 0){Zdr.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=zUs(),n;try{n=new sUs(t,e)}catch(f){return r.reject(f),r.promise}let o=lUs(n);if(n.signal.aborted)return Wdr(r,o,null,n.signal.reason,null),r.promise;o.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(o.serviceWorkers="none");let c=null,l=!1,u=null;return jUs(n.signal,()=>{l=!0,WX(u!=null),u.abort(n.signal.reason);let f=c?.deref();Wdr(r,o,f,n.signal.reason,u.controller)}),u=WYn({request:o,processResponseEndOfBody:XUs,processResponse:a(f=>{if(!l){if(f.aborted){Wdr(r,o,c,u.serializedAbortReason,u.controller);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(iUs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:cUs(n),requestObject:n}),r.promise}a(e9s,"fetch");function $Yn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;glt(r)&&n!==null&&(t.timingAllowPassed||(n=Jdr({startTime:n.startTime}),o=""),n.endTime=FDe(),t.timingInfo=n,VYn(n,r.href,e,globalThis,o,"",t.status))}a($Yn,"finalizeAndReportTiming");var VYn=performance.markResourceTiming;function Wdr(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&plt(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=oUs(r);s.body?.stream!=null&&plt(s.body.stream)&&o.error(n)}a(Wdr,"abortFetch");function WYn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=VUs(),requestObject:u=null}){WX(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=FDe(f),m=Jdr({startTime:h}),g={controller:new mlt(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return WX(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=dUs(t.client.policyContainer):t.policyContainer=uUs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,LUs.has(t.destination),zYn(g,!1),g.controller}a(WYn,"fetching");async function zYn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!TUs(eI(r))&&(n=_l("local URLs only")),AUs(r),fUs(r)==="blocked"&&(n=_l("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=vUs(r)),n===null){let s=eI(r);Ydr(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await jYn(t)):r.mode==="same-origin"?n=_l('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=_l('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await jYn(t)):glt(eI(r))?(r.responseTainting="cors",n=await YYn(t)):n=_l("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=Gdr(n,"basic"):r.responseTainting==="cors"?n=Gdr(n,"cors"):r.responseTainting==="opaque"?n=Gdr(n,"opaque"):WX(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=_l()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||GYn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>zdr(t,_l(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!WUs(l,r.integrity)){s("integrity mismatch");return}n.body=Alt(l)[0],zdr(t,n)},"processBody");bUs(n.body,c,s)}else zdr(t,n)}catch(r){t.controller.terminate(r)}}a(zYn,"mainFetch");function jYn(t){if(KH(t)&&t.request.redirectCount===0)return Promise.resolve(BDe(t));let{request:e}=t,{protocol:r}=eI(e);switch(r){case"about:":return Promise.resolve(_l("about scheme is not supported"));case"blob:":{Vdr||(Vdr=require("node:buffer").resolveObjectURL);let n=eI(e);if(n.search.length!==0)return Promise.resolve(_l("NetworkError when attempting to fetch resource."));let o=Vdr(n.toString());if(e.method!=="GET"||!Zdr.is.Blob(o))return Promise.resolve(_l("invalid method"));let s=flt(),c=o.size,l=hlt(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=wUs(d,!0);if(f==="failure")return Promise.resolve(_l("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(_l("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m+1,u),A=UYn(g);s.body=A[0];let y=hlt(`${g.size}`),_=RUs(h,m,c);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",y,!0),s.headersList.set("content-type",u,!0),s.headersList.set("content-range",_,!0)}else{let d=UYn(o);s.statusText="OK",s.body=d[0],s.headersList.set("content-length",l,!0),s.headersList.set("content-type",u,!0)}return Promise.resolve(s)}case"data:":{let n=eI(e),o=HUs(n);if(o==="failure")return Promise.resolve(_l("failed to fetch the data URL"));let s=GUs(o.mimeType);return Promise.resolve(flt({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Alt(o.body)[0]}))}case"file:":return Promise.resolve(_l("not implemented... yet..."));case"http:":case"https:":return YYn(t).catch(n=>_l(n));default:return Promise.resolve(_l("unknown scheme"))}}a(jYn,"schemeFetch");function t9s(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(t9s,"finalizeResponse");function zdr(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!glt(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=Jdr(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=PUs(e.headersList);f!=="failure"&&(u.contentType=$Us(f))}t.request.initiatorType!=null&&VYn(r,t.request.url.href,t.request.initiatorType,globalThis,l,u,d)};let c=a(()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()},"processResponseEndOfBodyTask");queueMicrotask(()=>c())},"processResponseEndOfBody");t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let o=e.type==="error"?e:e.internalResponse??e;o.body==null?n():QUs(o.body.stream,()=>{n()})}a(zdr,"fetchFinale");async function YYn(t){let e=t.request,r=null,n=null,o=t.timingInfo;if(e.serviceWorkers,r===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),n=r=await Kdr(t),e.responseTainting==="cors"&&_Us(e,r)==="failure")return _l("cors failure");pUs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&EUs(e.origin,e.client,e.destination,n)==="blocked"?_l("blocked"):(HYn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=_l("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await r9s(t,r):WX(!1)),r.timingInfo=o,r)}a(YYn,"httpFetch");function r9s(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=mUs(n,eI(r).hash),o==null)return e}catch(c){return Promise.resolve(_l(c))}if(!glt(o))return Promise.resolve(_l("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(_l("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!Ydr(r,o))return Promise.resolve(_l('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(_l('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(_l());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!JUs.includes(r.method)){r.method="GET",r.body=null;for(let c of OUs)r.headersList.delete(c)}Ydr(eI(r),o)||(r.headersList.delete("authorization",!0),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie",!0),r.headersList.delete("host",!0)),r.body!=null&&(WX(r.body.source!=null),r.body=Alt(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=FDe(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),gUs(r,n),zYn(t,!0)}a(r9s,"httpRedirectFetch");async function Kdr(t,e=!1,r=!1){let n=t.request,o=null,s=null,c=null,l=null,u=!1;n.window==="no-window"&&n.redirect==="error"?(o=t,s=n):(s=aUs(n),o={...t},o.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",f=s.body?s.body.length:null,h=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(h="0"),f!=null&&(h=hlt(`${f}`)),h!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,Zdr.is.URL(s.referrer)&&s.headersList.append("referer",hlt(s.referrer.href),!0),hUs(s),yUs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",ZUs,!0),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(IUs(eI(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),d&&!s.headersList.contains("authorization",!0)){let m=null;if(!(DUs(s)&&(s.useURLCredentials===void 0||!FYn(eI(s))))){if(FYn(eI(s))&&e){let{username:g,password:A}=eI(s);m=`Basic ${Buffer.from(`${g}:${A}`).toString("base64")}`}}m!==null&&s.headersList.append("Authorization",m,!1)}if(l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return _l("only if cached");let m=await n9s(o,d,r);!MUs.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===401&&s.responseTainting!=="cors"&&d&&(n.useURLCredentials!==void 0||NUs(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=Alt(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return KH(t)?BDe(t):c;t.controller.connection.destroy(),c=await Kdr(t,!0)}if(c.status===407)return n.window==="no-window"?_l():KH(t)?BDe(t):_l("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(KH(t))return BDe(t);t.controller.connection.destroy(),c=await Kdr(t,e,!0)}return c}a(Kdr,"httpNetworkOrCacheFetch");async function n9s(t,e=!1,r=!1){WX(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(E){KH(t)||(yield E,t.processRequestBodyChunkLength?.(E.byteLength))},"processBodyChunk"),y=a(()=>{KH(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),_=a(E=>{KH(t)||(E.name==="AbortError"?t.controller.abort():t.controller.terminate(E))},"processBodyError");u=(async function*(){try{for await(let E of n.body.stream)yield*A(E);y()}catch(E){_(E)}})()}try{let{body:A,status:y,statusText:_,headersList:E,socket:v}=await g({body:u});if(v)o=flt({status:y,statusText:_,headersList:E,socket:v});else{let S=A[Symbol.asyncIterator]();t.controller.next=()=>S.next(),o=flt({status:y,statusText:_,headersList:E})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),BDe(t,A)):_l(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{KH(t)||t.controller.abort(A)},"cancelAlgorithm"),h=new ReadableStream({start(A){t.controller.controller=A},pull:d,cancel:f,type:"bytes"});o.body={stream:h,source:null,length:null},t.controller.resume||t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let A,y;try{let{done:E,value:v}=await t.controller.next();if(BYn(t))break;A=E?void 0:v}catch(E){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=E,y=!0)}if(A===void 0){SUs(t.controller.controller),t9s(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let _=new Uint8Array(A);if(_.byteLength&&t.controller.controller.enqueue(_),qUs(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){BYn(t)?(o.aborted=!0,plt(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):plt(h)&&t.controller.controller.error(new TypeError("terminated",{cause:CUs(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=eI(n),_=t.controller.dispatcher,E=y.pathname+y.search,v=y.search.length===0&&y.href[y.href.length-y.hash.length-1]==="?";return new Promise((S,T)=>_.dispatch({path:v?`${E}?`:E,origin:y.origin,method:n.method,body:_.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(w){let{connection:R}=t.controller;s.finalConnectionTimingInfo=xUs(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),R.destroyed?w(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",w),this.abort=R.abort=w),s.finalNetworkRequestStartTime=FDe(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=FDe(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,k){if(w<200)return!1;let D=new $dr;for(let M=0;MU)return T(new Error(`too many content-encodings in response: ${L.length}, maximum allowed is ${U}`)),!0;for(let j=L.length-1;j>=0;--j){let Q=L[j].trim();if(Q==="x-gzip"||Q==="gzip")B.push(oD.createGunzip({flush:oD.constants.Z_SYNC_FLUSH,finishFlush:oD.constants.Z_SYNC_FLUSH}));else if(Q==="deflate")B.push(kUs({flush:oD.constants.Z_SYNC_FLUSH,finishFlush:oD.constants.Z_SYNC_FLUSH}));else if(Q==="br")B.push(oD.createBrotliDecompress({flush:oD.constants.BROTLI_OPERATION_FLUSH,finishFlush:oD.constants.BROTLI_OPERATION_FLUSH}));else if(Q==="zstd"&&KUs)B.push(oD.createZstdDecompress({flush:oD.constants.ZSTD_e_continue,finishFlush:oD.constants.ZSTD_e_end}));else{B.length=0;break}}}let q=this.onError.bind(this);return S({status:w,statusText:k,headersList:D,body:B.length?UUs(this.body,...B,M=>{M&&this.onError(M)}).on("error",q):this.body.on("error",q)}),!0},onData(w){if(t.controller.dump)return;let R=w;return s.encodedBodySize+=R.byteLength,this.body.push(R)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.ended=!0,this.body.push(null)},onError(w){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(w),t.controller.terminate(w),T(w)},onRequestUpgrade(w,R,x,k){if(k.session!=null&&R!==200||k.session==null&&R!==101)return!1;let D=new $dr;for(let[N,O]of Object.entries(x)){if(O==null)continue;let B=N.toLowerCase();if(Array.isArray(O))for(let q of O)D.append(B,String(q),!0);else D.append(B,String(O),!0)}return S({status:R,statusText:qYn[R],headersList:D,socket:k}),!0},onUpgrade(w,R,x){if(x.session!=null&&w!==200||x.session==null&&w!==101)return!1;let k=new $dr;for(let D=0;D{"use strict";p();var i9s=require("node:assert"),{URLSerializer:JYn}=sR(),{isValidHeaderName:o9s}=VT();function s9s(t,e,r=!1){let n=JYn(t,r),o=JYn(e,r);return n===o}a(s9s,"urlEquals");function a9s(t){i9s(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),o9s(r)&&e.push(r);return e}a(a9s,"getFieldValues");ZYn.exports={urlEquals:s9s,getFieldValues:a9s}});var nKn=I((oCf,rKn)=>{"use strict";p();var Xdr=require("node:assert"),{kConstruct:c9s}=Al(),{urlEquals:l9s,getFieldValues:efr}=XYn(),{kEnumerableProperty:zX,isDisturbed:u9s}=No(),{webidl:ti}=oy(),{cloneResponse:eKn,fromInnerResponse:d9s,getResponseState:f9s}=LDe(),{Request:QDe,fromInnerRequest:p9s,getRequestState:C4}=zhe(),{fetching:h9s}=UDe(),{urlIsHttpHttpsScheme:ylt,readAllBytes:m9s}=VT(),{createDeferredPromise:Yhe}=Z2e(),_lt=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==c9s&&ti.illegalConstructor(),ti.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){ti.brandCheck(this,t);let n="Cache.match";ti.argumentLengthCheck(arguments,1,n),e=ti.converters.RequestInfo(e),r=ti.converters.CacheQueryOptions(r,n,"options");let o=this.#i(e,r,1);if(o.length!==0)return o[0]}async matchAll(e=void 0,r={}){ti.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=ti.converters.RequestInfo(e)),r=ti.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){ti.brandCheck(this,t),ti.argumentLengthCheck(arguments,1,"Cache.add"),e=ti.converters.RequestInfo(e);let n=[e];return await this.addAll(n)}async addAll(e){ti.brandCheck(this,t);let r="Cache.addAll";ti.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw ti.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=ti.converters.RequestInfo(m),typeof m=="string")continue;let g=C4(m);if(!ylt(g.url)||g.method!=="GET")throw ti.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=C4(new QDe(m));if(!ylt(g.url))throw ti.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Yhe();s.push(h9s({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(ti.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let _=efr(y.headersList.get("vary"));for(let E of _)if(E==="*"){A.reject(ti.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let v of s)v.abort();return}}},processResponseEndOfBody(y){if(y.aborted){A.reject(new DOMException("aborted","AbortError"));return}A.resolve(y)}})),n.push(A.promise)}let l=await Promise.all(n),u=[],d=0;for(let m of l){let g={type:"put",request:o[d],response:m};u.push(g),d++}let f=Yhe(),h=null;try{this.#t(u)}catch(m){h=m}return queueMicrotask(()=>{h===null?f.resolve(void 0):f.reject(h)}),f.promise}async put(e,r){ti.brandCheck(this,t);let n="Cache.put";ti.argumentLengthCheck(arguments,2,n),e=ti.converters.RequestInfo(e),r=ti.converters.Response(r,n,"response");let o=null;if(ti.is.Request(e)?o=C4(e):o=C4(new QDe(e)),!ylt(o.url)||o.method!=="GET")throw ti.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=f9s(r);if(s.status===206)throw ti.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=efr(s.headersList.get("vary"));for(let A of g)if(A==="*")throw ti.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(u9s(s.body.stream)||s.body.stream.locked))throw ti.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=eKn(s),l=Yhe();if(s.body!=null){let A=s.body.stream.getReader();m9s(A,l.resolve,l.reject)}else l.resolve(void 0);let u=[],d={type:"put",request:o,response:c};u.push(d);let f=await l.promise;c.body!=null&&(c.body.source=f);let h=Yhe(),m=null;try{this.#t(u)}catch(g){m=g}return queueMicrotask(()=>{m===null?h.resolve():h.reject(m)}),h.promise}async delete(e,r={}){ti.brandCheck(this,t);let n="Cache.delete";ti.argumentLengthCheck(arguments,1,n),e=ti.converters.RequestInfo(e),r=ti.converters.CacheQueryOptions(r,n,"options");let o=null;if(ti.is.Request(e)){if(o=C4(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else Xdr(typeof e=="string"),o=C4(new QDe(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Yhe(),u=null,d;try{d=this.#t(s)}catch(f){u=f}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(e=void 0,r={}){ti.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=ti.converters.RequestInfo(e)),r=ti.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(ti.is.Request(e)){if(o=C4(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=C4(new QDe(e)));let s=Yhe(),c=[];if(e===void 0)for(let l of this.#e)c.push(l[0]);else{let l=this.#r(o,r);for(let u of l)c.push(u[0])}return queueMicrotask(()=>{let l=[];for(let u of c){let d=p9s(u,void 0,new AbortController().signal,"immutable");l.push(d)}s.resolve(Object.freeze(l))}),s.promise}#t(e){let r=this.#e,n=[...r],o=[],s=[];try{for(let c of e){if(c.type!=="delete"&&c.type!=="put")throw ti.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw ti.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(c.request,c.options,o).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=this.#r(c.request,c.options),l.length===0)return[];for(let u of l){let d=r.indexOf(u);Xdr(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw ti.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!ylt(u.url))throw ti.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw ti.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw ti.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=this.#r(c.request);for(let d of l){let f=r.indexOf(d);Xdr(f!==-1),r.splice(f,1)}r.push([c.request,c.response]),o.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw this.#e.length=0,this.#e=n,c}}#r(e,r,n){let o=[],s=n??this.#e;for(let c of s){let[l,u]=c;this.#n(e,l,u,r)&&o.push(c)}return o}#n(e,r,n=null,o){let s=new URL(e.url),c=new URL(r.url);if(o?.ignoreSearch&&(c.search="",s.search=""),!l9s(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=efr(n.headersList.get("vary"));for(let u of l){if(u==="*")return!1;let d=r.headersList.get(u),f=e.headersList.get(u);if(d!==f)return!1}return!0}#i(e,r,n=1/0){let o=null;if(e!==void 0)if(ti.is.Request(e)){if(o=C4(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=C4(new QDe(e)));let s=[];if(e===void 0)for(let l of this.#e)s.push(l[1]);else{let l=this.#r(o,r);for(let u of l)s.push(u[1])}let c=[];for(let l of s){let u=d9s(eKn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(_lt.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:zX,matchAll:zX,add:zX,addAll:zX,put:zX,delete:zX,keys:zX});var tKn=[{key:"ignoreSearch",converter:ti.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:ti.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:ti.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];ti.converters.CacheQueryOptions=ti.dictionaryConverter(tKn);ti.converters.MultiCacheQueryOptions=ti.dictionaryConverter([...tKn,{key:"cacheName",converter:ti.converters.DOMString}]);ti.converters.Response=ti.interfaceConverter(ti.is.Response,"Response");ti.converters["sequence"]=ti.sequenceConverter(ti.converters.RequestInfo);rKn.exports={Cache:_lt}});var oKn=I((cCf,iKn)=>{"use strict";p();var{Cache:Elt}=nKn(),{webidl:Q_}=oy(),{kEnumerableProperty:qDe}=No(),{kConstruct:jDe}=Al(),vlt=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==jDe&&Q_.illegalConstructor(),Q_.util.markAsUncloneable(this)}async match(e,r={}){if(Q_.brandCheck(this,t),Q_.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=Q_.converters.RequestInfo(e),r=Q_.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Elt(jDe,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Elt(jDe,n).match(e,r);if(s!==void 0)return s}}async has(e){Q_.brandCheck(this,t);let r="CacheStorage.has";return Q_.argumentLengthCheck(arguments,1,r),e=Q_.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){Q_.brandCheck(this,t);let r="CacheStorage.open";if(Q_.argumentLengthCheck(arguments,1,r),e=Q_.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Elt(jDe,o)}let n=[];return this.#e.set(e,n),new Elt(jDe,n)}async delete(e){Q_.brandCheck(this,t);let r="CacheStorage.delete";return Q_.argumentLengthCheck(arguments,1,r),e=Q_.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return Q_.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(vlt.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:qDe,has:qDe,open:qDe,delete:qDe,keys:qDe});iKn.exports={CacheStorage:vlt}});var aKn=I((dCf,sKn)=>{"use strict";p();sKn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var nfr=I((pCf,dKn)=>{"use strict";p();function g9s(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(g9s,"isCTLExcludingHtab");function tfr(t){for(let e=0;e126||r===34||r===40||r===41||r===60||r===62||r===64||r===44||r===59||r===58||r===92||r===47||r===91||r===93||r===63||r===61||r===123||r===125)throw new Error("Invalid cookie name")}}a(tfr,"validateCookieName");function rfr(t){let e=t.length,r=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++r}for(;r126||n===34||n===44||n===59||n===92)throw new Error("Invalid cookie value")}}a(rfr,"validateCookieValue");function lKn(t){for(let e=0;e126||r===59)throw new Error("Invalid cookie path")}}a(lKn,"validateCookiePath");function cKn(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122}a(cKn,"isLetterOrDigit");function A9s(t){if(t===" ")return;if(t.length>255)throw new Error("Invalid cookie domain");let e=0;for(let r=0;r63)throw new Error("Invalid cookie domain")}if(e===0||t.charCodeAt(t.length-1)===45)throw new Error("Invalid cookie domain")}a(A9s,"validateCookieDomain");var y9s=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],_9s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Clt=Array(61).fill(0).map((t,e)=>e.toString().padStart(2,"0"));function uKn(t){return typeof t=="number"&&(t=new Date(t)),`${y9s[t.getUTCDay()]}, ${Clt[t.getUTCDate()]} ${_9s[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Clt[t.getUTCHours()]}:${Clt[t.getUTCMinutes()]}:${Clt[t.getUTCSeconds()]} GMT`}a(uKn,"toIMFDate");function E9s(t){if(t<0)throw new Error("Invalid cookie max-age")}a(E9s,"validateCookieMaxAge");function v9s(t){if(t.name.length===0)return null;tfr(t.name),rfr(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(E9s(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(A9s(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(lKn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${uKn(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let r of t.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...o]=r.split("="),s=n.trim(),c=o.join("=");tfr(s),rfr(c),e.push(`${s}=${c}`)}return e.join("; ")}a(v9s,"stringify");dKn.exports={isCTLExcludingHtab:g9s,validateCookieName:tfr,validateCookiePath:lKn,validateCookieValue:rfr,toIMFDate:uKn,stringify:v9s}});var pKn=I((gCf,fKn)=>{"use strict";p();var{collectASequenceOfCodePointsFast:blt}=T8(),{maxNameValuePairSize:C9s,maxAttributeValueSize:b9s}=aKn(),{isCTLExcludingHtab:S9s}=nfr(),T9s=require("node:assert");function I9s(t){if(S9s(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=blt(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=blt("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>C9s?null:{name:n,value:o,...Khe(r)}}a(I9s,"parseSetCookie");function Khe(t,e={}){if(t.length===0)return e;T9s(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=blt(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=blt("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>b9s)return Khe(t,e);let s=n.toLowerCase();if(s==="expires"){let c=new Date(o);e.expires=c}else if(s==="max-age"){let c=o.charCodeAt(0);if((c<48||c>57)&&o[0]!=="-"||!/^\d+$/.test(o))return Khe(t,e);let l=Number(o);e.maxAge=l}else if(s==="domain"){let c=o;c[0]==="."&&(c=c.slice(1)),c=c.toLowerCase(),e.domain=c}else if(s==="path"){let c="";o.length===0||o[0]!=="/"?c="/":c=o,e.path=c}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let c=o.toLowerCase();c==="none"?e.sameSite="None":c==="strict"?e.sameSite="Strict":c==="lax"&&(e.sameSite="Lax")}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return Khe(t,e)}a(Khe,"parseUnparsedAttributes");fKn.exports={parseSetCookie:I9s,parseUnparsedAttributes:Khe}});var AKn=I((_Cf,gKn)=>{"use strict";p();var{parseSetCookie:hKn}=pKn(),{stringify:x9s}=nfr(),{webidl:ic}=oy(),{Headers:w9s}=GX(),Slt=ic.brandCheckMultiple([w9s,globalThis.Headers].filter(Boolean));function R9s(t){ic.argumentLengthCheck(arguments,1,"getCookies"),Slt(t);let e=t.get("cookie"),r={};if(!e)return r;for(let n of e.split(";")){let[o,...s]=n.split("=");r[o.trim()]=s.join("=")}return r}a(R9s,"getCookies");function k9s(t,e,r){Slt(t);let n="deleteCookie";ic.argumentLengthCheck(arguments,2,n),e=ic.converters.DOMString(e,n,"name"),r=ic.converters.DeleteCookieAttributes(r),mKn(t,{name:e,value:"",expires:new Date(0),...r})}a(k9s,"deleteCookie");function P9s(t){ic.argumentLengthCheck(arguments,1,"getSetCookies"),Slt(t);let e=t.getSetCookie();return e?e.map(r=>hKn(r)):[]}a(P9s,"getSetCookies");function D9s(t){return t=ic.converters.DOMString(t),hKn(t)}a(D9s,"parseCookie");function mKn(t,e){ic.argumentLengthCheck(arguments,2,"setCookie"),Slt(t),e=ic.converters.Cookie(e);let r=x9s(e);r&&t.append("set-cookie",r,!0)}a(mKn,"setCookie");ic.converters.DeleteCookieAttributes=ic.dictionaryConverter([{converter:ic.nullableConverter(ic.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:ic.nullableConverter(ic.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);ic.converters.Cookie=ic.dictionaryConverter([{converter:ic.converters.DOMString,key:"name"},{converter:ic.converters.DOMString,key:"value"},{converter:ic.nullableConverter(t=>typeof t=="number"?ic.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:ic.nullableConverter(ic.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:ic.nullableConverter(ic.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:ic.nullableConverter(ic.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:ic.nullableConverter(ic.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:ic.nullableConverter(ic.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:ic.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:ic.sequenceConverter(ic.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);gKn.exports={getCookies:R9s,deleteCookie:k9s,getSetCookies:P9s,setCookie:mKn,parseCookie:D9s}});var xlt=I((CCf,_Kn)=>{"use strict";p();var{webidl:fi}=oy(),{kEnumerableProperty:jb}=No(),{kConstruct:yKn}=Al(),Jhe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===yKn){super(arguments[1],arguments[2]),fi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";fi.argumentLengthCheck(arguments,1,n),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,fi.util.markAsUncloneable(this)}get data(){return fi.brandCheck(this,t),this.#e.data}get origin(){return fi.brandCheck(this,t),this.#e.origin}get lastEventId(){return fi.brandCheck(this,t),this.#e.lastEventId}get source(){return fi.brandCheck(this,t),this.#e.source}get ports(){return fi.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,r=!1,n=!1,o=null,s="",c="",l=null,u=[]){return fi.brandCheck(this,t),fi.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:r,cancelable:n,data:o,origin:s,lastEventId:c,source:l,ports:u})}static createFastMessageEvent(e,r){let n=new t(yKn,e,r);return n.#e=r,n.#e.data??=null,n.#e.origin??="",n.#e.lastEventId??="",n.#e.source??=null,n.#e.ports??=[],n}},{createFastMessageEvent:N9s}=Jhe;delete Jhe.createFastMessageEvent;var Tlt=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";fi.argumentLengthCheck(arguments,1,n),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.CloseEventInit(r),super(e,r),this.#e=r,fi.util.markAsUncloneable(this)}get wasClean(){return fi.brandCheck(this,t),this.#e.wasClean}get code(){return fi.brandCheck(this,t),this.#e.code}get reason(){return fi.brandCheck(this,t),this.#e.reason}},Ilt=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";fi.argumentLengthCheck(arguments,1,n),super(e,r),fi.util.markAsUncloneable(this),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return fi.brandCheck(this,t),this.#e.message}get filename(){return fi.brandCheck(this,t),this.#e.filename}get lineno(){return fi.brandCheck(this,t),this.#e.lineno}get colno(){return fi.brandCheck(this,t),this.#e.colno}get error(){return fi.brandCheck(this,t),this.#e.error}};Object.defineProperties(Jhe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:jb,origin:jb,lastEventId:jb,source:jb,ports:jb,initMessageEvent:jb});Object.defineProperties(Tlt.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:jb,code:jb,wasClean:jb});Object.defineProperties(Ilt.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:jb,filename:jb,lineno:jb,colno:jb,error:jb});fi.converters.MessagePort=fi.interfaceConverter(fi.is.MessagePort,"MessagePort");fi.converters["sequence"]=fi.sequenceConverter(fi.converters.MessagePort);var ifr=[{key:"bubbles",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];fi.converters.MessageEventInit=fi.dictionaryConverter([...ifr,{key:"data",converter:fi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:fi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:fi.nullableConverter(fi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:fi.converters["sequence"],defaultValue:a(()=>[],"defaultValue")}]);fi.converters.CloseEventInit=fi.dictionaryConverter([...ifr,{key:"wasClean",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:fi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);fi.converters.ErrorEventInit=fi.dictionaryConverter([...ifr,{key:"message",converter:fi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:fi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:fi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:fi.converters.any}]);_Kn.exports={MessageEvent:Jhe,CloseEvent:Tlt,ErrorEvent:Ilt,createFastMessageEvent:N9s}});var JH=I((TCf,EKn)=>{"use strict";p();var M9s="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",O9s={enumerable:!0,writable:!1,configurable:!1},L9s={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},B9s={SENT:1,RECEIVED:2},F9s={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},U9s=65535,Q9s={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},q9s=Buffer.allocUnsafe(0),j9s={text:1,typedArray:2,arrayBuffer:3,blob:4};EKn.exports={uid:M9s,sentCloseFrameState:B9s,staticPropertyDescriptors:O9s,states:L9s,opcodes:F9s,maxUnsigned16Bit:U9s,parserStates:Q9s,emptyBuffer:q9s,sendHints:j9s}});var YX=I((xCf,TKn)=>{"use strict";p();var{states:wlt,opcodes:Zhe}=JH(),{isUtf8:H9s}=require("node:buffer"),{removeHTTPWhitespace:vKn}=sR(),{collectASequenceOfCodePointsFast:G9s}=T8();function $9s(t){return t===wlt.CONNECTING}a($9s,"isConnecting");function V9s(t){return t===wlt.OPEN}a(V9s,"isEstablished");function W9s(t){return t===wlt.CLOSING}a(W9s,"isClosing");function z9s(t){return t===wlt.CLOSED}a(z9s,"isClosed");function Y9s(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(Y9s,"fireEvent");function K9s(t,e,r){t.onMessage(e,r)}a(K9s,"websocketMessageReceived");function J9s(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(J9s,"toArrayBuffer");function Z9s(t){if(t.length===0)return!1;for(let e=0;e126||r===34||r===40||r===41||r===44||r===47||r===58||r===59||r===60||r===61||r===62||r===63||r===64||r===91||r===92||r===93||r===123||r===125)return!1}return!0}a(Z9s,"isValidSubprotocol");function X9s(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(X9s,"isValidStatusCode");function CKn(t){return t===Zhe.CLOSE||t===Zhe.PING||t===Zhe.PONG}a(CKn,"isControlFrame");function bKn(t){return t===Zhe.CONTINUATION}a(bKn,"isContinuationFrame");function SKn(t){return t===Zhe.TEXT||t===Zhe.BINARY}a(SKn,"isTextBinaryFrame");function e7s(t){return SKn(t)||bKn(t)||CKn(t)}a(e7s,"isValidOpcode");function t7s(t){let e={position:0},r=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}a(r7s,"isValidClientWindowBits");function n7s(t,e){let r;try{r=new URL(t,e)}catch(n){throw new DOMException(n,"SyntaxError")}if(r.protocol==="http:"?r.protocol="ws:":r.protocol==="https:"&&(r.protocol="wss:"),r.protocol!=="ws:"&&r.protocol!=="wss:")throw new DOMException("expected a ws: or wss: url","SyntaxError");if(r.hash.length||r.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return r}a(n7s,"getURLRecord");function i7s(t,e){if(t!==null&&t!==1e3&&(t<3e3||t>4999))throw new DOMException("invalid code","InvalidAccessError");if(e!==null){let r=Buffer.byteLength(e);if(r>123)throw new DOMException(`Reason must be less than 123 bytes; received ${r}`,"SyntaxError")}}a(i7s,"validateCloseCodeAndReason");var o7s=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(H9s(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();TKn.exports={isConnecting:$9s,isEstablished:V9s,isClosing:W9s,isClosed:z9s,fireEvent:Y9s,isValidSubprotocol:Z9s,isValidStatusCode:X9s,websocketMessageReceived:K9s,utf8Decode:o7s,isControlFrame:CKn,isContinuationFrame:bKn,isTextBinaryFrame:SKn,isValidOpcode:e7s,parseExtensions:t7s,isValidClientWindowBits:r7s,toArrayBuffer:J9s,getURLRecord:n7s,validateCloseCodeAndReason:i7s}});var eme=I((kCf,xKn)=>{"use strict";p();var{runtimeFeatures:s7s}=I8(),{maxUnsigned16Bit:IKn,opcodes:a7s}=JH(),Rlt=8*1024,HDe=null,Xhe=Rlt,c7s=s7s.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;oIKn?(c+=8,s=127):o>125&&(c+=2,s=126);let l=Buffer.allocUnsafe(o+c);l[0]=l[1]=0,l[0]|=128,l[0]=(l[0]&240)+e;l[c-4]=n[0],l[c-3]=n[1],l[c-2]=n[2],l[c-1]=n[3],l[1]=s,s===126?l.writeUInt16BE(o,2):s===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),l[1]|=128;for(let u=0;uIKn?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|a7s.TEXT,c[1]=o|128,c[s-4]=r[0],c[s-3]=r[1],c[s-2]=r[2],c[s-1]=r[3],o===126?c.writeUInt16BE(n,2):o===127&&(c[2]=c[3]=0,c.writeUIntBE(n,4,6)),[c,e]}};xKn.exports={WebsocketFrameSend:sfr,generateMask:ofr}});var klt=I((NCf,NKn)=>{"use strict";p();var{uid:l7s,states:afr,sentCloseFrameState:cfr,emptyBuffer:wKn,opcodes:u7s}=JH(),{parseExtensions:d7s,isClosed:f7s,isClosing:p7s,isEstablished:PKn,isConnecting:h7s,validateCloseCodeAndReason:m7s}=YX(),{makeRequest:g7s}=zhe(),{fetching:A7s}=UDe(),{Headers:y7s,getHeadersList:_7s}=GX(),{getDecodeSplit:E7s}=VT(),{WebsocketFrameSend:v7s}=eme(),C7s=require("node:assert"),{runtimeFeatures:b7s}=I8(),RKn=b7s.has("crypto")?require("node:crypto"):null,kKn=!1;function S7s(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=g7s({urlList:[s],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error",useURLCredentials:!0});if(o.headers){let f=_7s(new y7s(o.headers));c.headersList=f}let l=RKn.randomBytes(16).toString("base64");c.headersList.append("sec-websocket-key",l,!0),c.headersList.append("sec-websocket-version","13",!0);for(let f of e)c.headersList.append("sec-websocket-protocol",f,!0);return c.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits",!0),A7s({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){b4(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){b4(n,1002,"Received network error or non-200 status code.",f.error);return}}if(kKn===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),kKn=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){b4(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){b4(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){b4(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=RKn.hash("sha1",l+l7s,"base64");if(h!==m){b4(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=d7s(g),!A.has("permessage-deflate"))){b4(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!E7s("sec-websocket-protocol",c.headersList).includes(y)){b4(n,1002,"Protocol was not set in the opening handshake.");return}f.socket.on("data",n.onSocketData),f.socket.on("close",n.onSocketClose),f.socket.on("error",n.onSocketError),n.wasEverConnected=!0,n.onConnectionEstablished(f,A)}})}a(S7s,"establishWebSocketConnection");function DKn(t,e,r,n=!1){if(e??=null,r??="",n&&m7s(e,r),!(f7s(t.readyState)||p7s(t.readyState)))if(!PKn(t.readyState))b4(t),t.readyState=afr.CLOSING;else if(!t.closeState.has(cfr.SENT)&&!t.closeState.has(cfr.RECEIVED)){let o=new v7s;r.length!==0&&e===null&&(e=1e3),C7s(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=wKn:e!==null&&r===null?(o.frameData=Buffer.allocUnsafe(2),o.frameData.writeUInt16BE(e,0)):e!==null&&r!==null?(o.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(r)),o.frameData.writeUInt16BE(e,0),o.frameData.write(r,2,"utf-8")):o.frameData=wKn,t.socket.write(o.createFrame(u7s.CLOSE)),t.closeState.add(cfr.SENT),t.readyState=afr.CLOSING}else t.readyState=afr.CLOSING}a(DKn,"closeWebSocketConnection");function b4(t,e,r,n){PKn(t.readyState)&&DKn(t,e,r,!1),t.controller.abort(),h7s(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(b4,"failWebsocketConnection");NKn.exports={establishWebSocketConnection:S7s,failWebsocketConnection:b4,closeWebSocketConnection:DKn}});var OKn=I((LCf,MKn)=>{"use strict";p();var{createInflateRaw:T7s,Z_DEFAULT_WINDOWBITS:I7s}=require("node:zlib"),{isValidClientWindowBits:x7s}=YX(),{MessageSizeExceededError:w7s}=uo(),R7s=Buffer.from([0,0,255,255]),Plt=Symbol("kBuffer"),GDe=Symbol("kLength"),lfr=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=0;constructor(e,r){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits"),this.#r=r.maxPayloadSize}decompress(e,r,n){if(!this.#e){let o=I7s;if(this.#t.serverMaxWindowBits){if(!x7s(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=T7s({windowBits:o})}catch(s){n(s);return}this.#e[Plt]=[],this.#e[GDe]=0,this.#e.on("data",s=>{if(this.#e[GDe]+=s.length,this.#r>0&&this.#e[GDe]>this.#r){n(new w7s),this.#e.removeAllListeners(),this.#e=null;return}this.#e[Plt].push(s)}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#e.write(e),r&&this.#e.write(R7s),this.#e.flush(()=>{if(!this.#e)return;let o=Buffer.concat(this.#e[Plt],this.#e[GDe]);this.#e[Plt].length=0,this.#e[GDe]=0,n(null,o)})}};MKn.exports={PerMessageDeflate:lfr}});var pfr=I((UCf,QKn)=>{"use strict";p();var{Writable:k7s}=require("node:stream"),P7s=require("node:assert"),{parserStates:Hb,opcodes:tme,states:D7s,emptyBuffer:LKn,sentCloseFrameState:$De}=JH(),{isValidStatusCode:N7s,isValidOpcode:M7s,websocketMessageReceived:BKn,utf8Decode:O7s,isControlFrame:ufr,isTextBinaryFrame:dfr,isContinuationFrame:L7s}=YX(),{failWebsocketConnection:q_}=klt(),{WebsocketFrameSend:FKn}=eme(),{PerMessageDeflate:B7s}=OKn(),{MessageSizeExceededError:UKn}=uo(),ffr=class extends k7s{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=Hb.INFO;#o={};#s=[];#a;#c;#u;#l;constructor(e,r,n={}){super(),this.#c=e,this.#a=r??new Map,this.#u=n.maxFragments??0,this.#l=n.maxPayloadSize??0,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new B7s(r,n))}_write(e,r,n){this.#e.push(e),this.#r+=e.length,this.#n=!0,this.run(n)}#p(){return this.#l>0&&!ufr(this.#o.opcode)&&this.#o.payloadLength+this.#t>this.#l?(q_(this.#c,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#n;)if(this.#i===Hb.INFO){if(this.#r<2)return e();let r=this.consume(2),n=(r[0]&128)!==0,o=r[0]&15,s=(r[1]&128)===128,c=!n&&o!==tme.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!M7s(o))return q_(this.#c,1002,"Invalid opcode received"),e();if(s)return q_(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){q_(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){q_(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!dfr(o)){q_(this.#c,1002,"Invalid frame type was fragmented.");return}if(dfr(o)&&this.#s.length>0){q_(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){q_(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&ufr(o)){q_(this.#c,1002,"Control frame either too large or fragmented");return}if(L7s(o)&&this.#s.length===0&&!this.#o.compressed){q_(this.#c,1002,"Unexpected continuation frame");return}if(l<=125){if(this.#o.payloadLength=l,this.#i=Hb.READ_DATA,!this.#p())return}else l===126?this.#i=Hb.PAYLOADLENGTH_16:l===127&&(this.#i=Hb.PAYLOADLENGTH_64);dfr(o)&&(this.#o.binaryType=o,this.#o.compressed=u!==0),this.#o.opcode=o,this.#o.masked=s,this.#o.fin=n,this.#o.fragmented=c}else if(this.#i===Hb.PAYLOADLENGTH_16){if(this.#r<2)return e();let r=this.consume(2);if(this.#o.payloadLength=r.readUInt16BE(0),this.#i=Hb.READ_DATA,!this.#p())return}else if(this.#i===Hb.PAYLOADLENGTH_64){if(this.#r<8)return e();let r=this.consume(8),n=r.readUInt32BE(0),o=r.readUInt32BE(4);if(n!==0||o>2**31-1){q_(this.#c,1009,"Received payload length > 2^31 bytes.");return}if(this.#o.payloadLength=o,this.#i=Hb.READ_DATA,!this.#p())return}else if(this.#i===Hb.READ_DATA){if(this.#r{if(n){let s=n instanceof UKn?1009:1007;q_(this.#c,s,n.message);return}if(this.writeFragments(o)){if(this.#l>0&&this.#t>this.#l){q_(this.#c,1009,new UKn().message);return}if(!this.#o.fin){this.#i=Hb.INFO,this.#n=!0,this.run(e);return}BKn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=Hb.INFO,this.run(e)}},this.#t),this.#n=!1;break}else{if(!this.writeFragments(r))return;!this.#o.fragmented&&this.#o.fin&&BKn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#i=Hb.INFO}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return LKn;this.#r-=e;let r=this.#e[0];if(r.length>e)return this.#e[0]=r.subarray(e,r.length),r.subarray(0,e);if(r.length===e)return this.#e.shift();{let n=0,o=Buffer.allocUnsafeSlow(e);for(;n!==e;){let s=this.#e[0],c=s.length;if(c+n===e){o.set(this.#e.shift(),n);break}else if(c+n>e){o.set(s.subarray(0,e-n),n),this.#e[0]=s.subarray(e-n);break}else o.set(this.#e.shift(),n),n+=c}return o}}writeFragments(e){return this.#u>0&&this.#s.length===this.#u?(q_(this.#c,1008,"Too many message fragments"),!1):(this.#t+=e.length,this.#s.push(e),!0)}consumeFragments(){let e=this.#s;if(e.length===1)return this.#t=0,e.shift();let r=0,n=Buffer.allocUnsafeSlow(this.#t);for(let o=0;o=2&&(r=e.readUInt16BE(0)),r!==void 0&&!N7s(r))return{code:1002,reason:"Invalid status code",error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=O7s(n)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:r,reason:n,error:!1}}parseControlFrame(e){let{opcode:r,payloadLength:n}=this.#o;if(r===tme.CLOSE){if(n===1)return q_(this.#c,1002,"Received close frame with a 1-byte body."),!1;if(this.#o.closeInfo=this.parseCloseBody(e),this.#o.closeInfo.error){let{code:o,reason:s}=this.#o.closeInfo;return q_(this.#c,o,s),!1}if(!this.#c.closeState.has($De.SENT)&&!this.#c.closeState.has($De.RECEIVED)){let o=LKn;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new FKn(o);this.#c.socket.write(s.createFrame(tme.CLOSE)),this.#c.closeState.add($De.SENT)}return this.#c.readyState=D7s.CLOSING,this.#c.closeState.add($De.RECEIVED),!1}else if(r===tme.PING){if(!this.#c.closeState.has($De.RECEIVED)){let o=new FKn(e);this.#c.socket.write(o.createFrame(tme.PONG)),this.#c.onPing(e)}}else r===tme.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};QKn.exports={ByteParser:ffr}});var GKn=I((jCf,HKn)=>{"use strict";p();var{WebsocketFrameSend:jKn}=eme(),{opcodes:qKn,sendHints:KX}=JH(),F7s=Mlr(),mfr=class{static{a(this,"SendQueue")}#e=new F7s;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==KX.blob){if(this.#t){let s={promise:null,callback:r,frame:hfr(e,n)};this.#e.push(s)}else if(n===KX.text){let{0:s,1:c}=jKn.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(hfr(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=hfr(s,n)}),callback:r,frame:null};this.#e.push(o),this.#t||this.#n()}async#n(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let r=e.shift();r.promise!==null&&await r.promise,this.#r.write(r.frame,r.callback),r.callback=r.frame=null}this.#t=!1}};function hfr(t,e){return new jKn(U7s(t,e)).createFrame(e===KX.text?qKn.TEXT:qKn.BINARY)}a(hfr,"createFrame");function U7s(t,e){switch(e){case KX.text:case KX.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case KX.arrayBuffer:case KX.blob:return new Uint8Array(t)}}a(U7s,"toBuffer");HKn.exports={SendQueue:mfr}});var KKn=I(($Cf,YKn)=>{"use strict";p();var{isArrayBuffer:Q7s}=require("node:util/types"),{webidl:yi}=oy(),{URLSerializer:q7s}=sR(),{environmentSettingsObject:$Kn}=VT(),{staticPropertyDescriptors:ZH,states:B8,sentCloseFrameState:gfr,sendHints:Dlt,opcodes:Afr}=JH(),{isConnecting:j7s,isEstablished:VKn,isClosing:WKn,isClosed:H7s,isValidSubprotocol:G7s,fireEvent:Nlt,utf8Decode:$7s,toArrayBuffer:V7s,getURLRecord:W7s}=YX(),{establishWebSocketConnection:z7s,closeWebSocketConnection:Y7s,failWebsocketConnection:zKn}=klt(),{ByteParser:K7s}=pfr(),{kEnumerableProperty:hR}=No(),{getGlobalDispatcher:J7s}=Kct(),{ErrorEvent:Z7s,CloseEvent:X7s,createFastMessageEvent:eQs}=xlt(),{SendQueue:tQs}=GKn(),{WebsocketFrameSend:rQs}=eme(),{channels:S4}=kH();function nQs(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(nQs,"getSocketAddress");var Pv=class t extends EventTarget{static{a(this,"WebSocket")}#e={open:null,error:null,close:null,message:null};#t=0;#r="";#n="";#i;#o={onConnectionEstablished:a((e,r)=>this.#u(e,r),"onConnectionEstablished"),onMessage:a((e,r)=>this.#l(e,r),"onMessage"),onParserError:a(e=>zKn(this.#o,null,e.message),"onParserError"),onParserDrain:a(()=>this.#p(),"onParserDrain"),onSocketData:a(e=>{this.#c.write(e)||this.#o.socket.pause()},"onSocketData"),onSocketError:a(e=>{this.#o.readyState=B8.CLOSING,S4.socketError.hasSubscribers&&S4.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{S4.ping.hasSubscribers&&S4.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{S4.pong.hasSubscribers&&S4.pong.publish({payload:e,websocket:this})},"onPong"),readyState:B8.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),yi.util.markAsUncloneable(this);let n="WebSocket constructor";yi.argumentLengthCheck(arguments,1,n);let o=yi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=yi.converters.USVString(e),r=o.protocols;let s=$Kn.settingsObject.baseUrl,c=W7s(e,s);if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(u=>u.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(u=>G7s(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=$Kn.settingsObject;this.#o.controller=z7s(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){yi.brandCheck(this,t),e!==void 0&&(e=yi.converters["unsigned short"](e,"WebSocket.close","code",yi.attributes.Clamp)),r!==void 0&&(r=yi.converters.USVString(r)),e??=null,r??="",Y7s(this.#o,e,r,!0)}send(e){yi.brandCheck(this,t);let r="WebSocket.send";if(yi.argumentLengthCheck(arguments,1,r),e=yi.converters.WebSocketSendData(e,r,"data"),j7s(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!VKn(this.#o.readyState)||WKn(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},Dlt.text)}else Q7s(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Dlt.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Dlt.typedArray)):yi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Dlt.blob))}get readyState(){return yi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return yi.brandCheck(this,t),this.#t}get url(){return yi.brandCheck(this,t),q7s(this.#s)}get extensions(){return yi.brandCheck(this,t),this.#n}get protocol(){return yi.brandCheck(this,t),this.#r}get onopen(){return yi.brandCheck(this,t),this.#e.open}set onopen(e){yi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=yi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return yi.brandCheck(this,t),this.#e.error}set onerror(e){yi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=yi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return yi.brandCheck(this,t),this.#e.close}set onclose(e){yi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=yi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return yi.brandCheck(this,t),this.#e.message}set onmessage(e){yi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=yi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return yi.brandCheck(this,t),this.#a}set binaryType(e){yi.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this.#a="blob":this.#a=e}#u(e,r){this.#o.socket=e.socket;let n=this.#o.controller.dispatcher?.webSocketOptions,o=n?.maxFragments,s=n?.maxPayloadSize,c=new K7s(this.#o,r,{maxFragments:o,maxPayloadSize:s});c.on("drain",()=>this.#o.onParserDrain()),c.on("error",d=>this.#o.onParserError(d)),this.#c=c,this.#i=new tQs(e.socket),this.#o.readyState=B8.OPEN;let l=e.headersList.get("sec-websocket-extensions");l!==null&&(this.#n=l);let u=e.headersList.get("sec-websocket-protocol");if(u!==null&&(this.#r=u),Nlt("open",this),S4.open.hasSubscribers){let d=e.headersList.entries;S4.open.publish({address:nQs(e.socket),protocol:this.#r,extensions:this.#n,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:d}})}}#l(e,r){if(this.#o.readyState!==B8.OPEN)return;let n;if(e===Afr.TEXT)try{n=$7s(r)}catch{zKn(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===Afr.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=V7s(r));Nlt("message",this,eQs,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(gfr.SENT)&&this.#o.closeState.has(gfr.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=B8.CLOSED,this.#o.closeState.has(gfr.RECEIVED)||(r=1006,Nlt("error",this,(s,c)=>new Z7s(s,c),{error:new TypeError(n)})),Nlt("close",this,(s,c)=>new X7s(s,c),{wasClean:e,code:r,reason:n}),S4.close.hasSubscribers&&S4.close.publish({websocket:this,code:r,reason:n})}static ping(e,r){if(Buffer.isBuffer(r)){if(r.length>125)throw new TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(r!==void 0)throw new TypeError("Expected buffer payload");let n=e.#o.readyState;if(VKn(n)&&!WKn(n)&&!H7s(n)){let o=new rQs(r);e.#o.socket.write(o.createFrame(Afr.PING))}}},{ping:iQs}=Pv;Reflect.deleteProperty(Pv,"ping");Pv.CONNECTING=Pv.prototype.CONNECTING=B8.CONNECTING;Pv.OPEN=Pv.prototype.OPEN=B8.OPEN;Pv.CLOSING=Pv.prototype.CLOSING=B8.CLOSING;Pv.CLOSED=Pv.prototype.CLOSED=B8.CLOSED;Object.defineProperties(Pv.prototype,{CONNECTING:ZH,OPEN:ZH,CLOSING:ZH,CLOSED:ZH,url:hR,readyState:hR,bufferedAmount:hR,onopen:hR,onerror:hR,onclose:hR,close:hR,onmessage:hR,binaryType:hR,send:hR,extensions:hR,protocol:hR,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(Pv,{CONNECTING:ZH,OPEN:ZH,CLOSING:ZH,CLOSED:ZH});yi.converters["sequence"]=yi.sequenceConverter(yi.converters.DOMString);yi.converters["DOMString or sequence"]=function(t,e,r){return yi.util.Type(t)===yi.util.Types.OBJECT&&Symbol.iterator in t?yi.converters["sequence"](t):yi.converters.DOMString(t,e,r)};yi.converters.WebSocketInit=yi.dictionaryConverter([{key:"protocols",converter:yi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:yi.converters.any,defaultValue:a(()=>J7s(),"defaultValue")},{key:"headers",converter:yi.nullableConverter(yi.converters.HeadersInit)}]);yi.converters["DOMString or sequence or WebSocketInit"]=function(t){return yi.util.Type(t)===yi.util.Types.OBJECT&&!(Symbol.iterator in t)?yi.converters.WebSocketInit(t):{protocols:yi.converters["DOMString or sequence"](t)}};yi.converters.WebSocketSendData=function(t){return yi.util.Type(t)===yi.util.Types.OBJECT&&(yi.is.Blob(t)||yi.is.BufferSource(t))?t:yi.converters.USVString(t)};YKn.exports={WebSocket:Pv,ping:iQs}});var yfr=I((zCf,XKn)=>{"use strict";p();var{webidl:Mlt}=oy(),{validateCloseCodeAndReason:oQs}=YX(),{kConstruct:JKn}=Al(),{kEnumerableProperty:ZKn}=No();function sQs(){class t extends DOMException{static{a(this,"Test")}get reason(){return""}}return new t().reason!==void 0?DOMException:new Proxy(DOMException,{construct(e,r,n){let o=Reflect.construct(e,r,e);return Object.setPrototypeOf(o,n.prototype),o}})}a(sQs,"createInheritableDOMException");var JX=class t extends sQs(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=Mlt.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===JKn)return;r!==null&&(r=Mlt.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";oQs(n,o),o.length!==0&&n===null&&(n=1e3),this.#e=n,this.#t=o}get closeCode(){return this.#e}get reason(){return this.#t}static createUnvalidatedWebSocketError(e,r,n){let o=new t(e,JKn);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:aQs}=JX;delete JX.createUnvalidatedWebSocketError;Object.defineProperties(JX.prototype,{closeCode:ZKn,reason:ZKn,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});Mlt.is.WebSocketError=Mlt.util.MakeTypeAssertion(JX);XKn.exports={WebSocketError:JX,createUnvalidatedWebSocketError:aQs}});var iJn=I((JCf,nJn)=>{"use strict";p();var{createDeferredPromise:_fr}=Z2e(),{environmentSettingsObject:eJn}=VT(),{states:rme,opcodes:Olt,sentCloseFrameState:nme}=JH(),{webidl:Ip}=oy(),{getURLRecord:cQs,isValidSubprotocol:lQs,isEstablished:uQs,utf8Decode:dQs}=YX(),{establishWebSocketConnection:fQs,failWebsocketConnection:Efr,closeWebSocketConnection:vfr}=klt(),{channels:tJn}=kH(),{WebsocketFrameSend:pQs}=eme(),{ByteParser:hQs}=pfr(),{WebSocketError:mQs,createUnvalidatedWebSocketError:gQs}=yfr(),{kEnumerableProperty:Llt}=No(),{utf8DecodeBytes:AQs}=rct(),rJn=!1,Blt=class{static{a(this,"WebSocketStream")}#e;#t;#r;#n;#i;#o;#s=!1;#a={onConnectionEstablished:a((e,r)=>this.#l(e,r),"onConnectionEstablished"),onMessage:a((e,r)=>this.#p(e,r),"onMessage"),onParserError:a(e=>Efr(this.#a,null,e.message),"onParserError"),onParserDrain:a(()=>this.#a.socket.resume(),"onParserDrain"),onSocketData:a(e=>{this.#c.write(e)||this.#a.socket.pause()},"onSocketData"),onSocketError:a(e=>{this.#a.readyState=rme.CLOSING,tJn.socketError.hasSubscribers&&tJn.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:rme.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){rJn||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),rJn=!0),Ip.argumentLengthCheck(arguments,1,"WebSocket"),e=Ip.converters.USVString(e),r!==null&&(r=Ip.converters.WebSocketStreamOptions(r));let n=eJn.settingsObject.baseUrl,o=cQs(e,n),s=r.protocols;if(s.length!==new Set(s.map(l=>l.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(s.length>0&&!s.every(l=>lQs(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=_fr(),this.#r=_fr(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{uQs(this.#a.readyState)||(Efr(this.#a),this.#a.readyState=rme.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=eJn.settingsObject;this.#a.controller=fQs(o,s,c,this.#a,r)}get url(){return this.#e.toString()}get opened(){return this.#t.promise}get closed(){return this.#r.promise}close(e=void 0){e!==null&&(e=Ip.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;vfr(this.#a,r,n,!0)}#u(e){e=Ip.converters.WebSocketStreamWrite(e);let r=_fr(),n=null,o=null;if(Ip.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=Olt.BINARY;else{let s;try{s=Ip.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=Olt.TEXT}if(!this.#a.closeState.has(nme.SENT)&&!this.#a.closeState.has(nme.RECEIVED)){let s=new pQs(n);this.#a.socket.write(s.createFrame(o),()=>{r.resolve(void 0)})}return r.promise}#l(e,r){this.#a.socket=e.socket;let n=this.#a.controller.dispatcher?.webSocketOptions?.maxFragments,o=this.#a.controller.dispatcher?.webSocketOptions?.maxPayloadSize,s=new hQs(this.#a,r,{maxFragments:n,maxPayloadSize:o});s.on("drain",()=>this.#a.onParserDrain()),s.on("error",f=>this.#a.onParserError(f)),this.#c=s,this.#a.readyState=rme.OPEN;let c=r??"",l=e.headersList.get("sec-websocket-protocol")??"",u=new ReadableStream({start:a(f=>{this.#i=f},"start"),cancel:a(f=>this.#h(f),"cancel")}),d=new WritableStream({write:a(f=>this.#u(f),"write"),close:a(()=>vfr(this.#a,null,null),"close"),abort:a(f=>this.#A(f),"abort")});this.#n=u,this.#o=d,this.#t.resolve({extensions:c,protocol:l,readable:u,writable:d})}#p(e,r){if(this.#a.readyState!==rme.OPEN)return;let n;if(e===Olt.TEXT)try{n=dQs(r)}catch{Efr(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===Olt.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(nme.SENT)&&this.#a.closeState.has(nme.RECEIVED);if(this.#a.readyState=rme.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new mQs("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(nme.SENT)&&!this.#a.closeState.has(nme.RECEIVED)&&(n=1006);let o=r?.reason==null?"":AQs(Buffer.from(r.reason));if(e)this.#i.close(),this.#o.locked||this.#o.abort(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#r.resolve({closeCode:n,reason:o});else{let s=gQs("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";Ip.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),vfr(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(Blt.prototype,{url:Llt,opened:Llt,closed:Llt,close:Llt,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});Ip.converters.WebSocketStreamOptions=Ip.dictionaryConverter([{key:"protocols",converter:Ip.sequenceConverter(Ip.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:Ip.nullableConverter(Ip.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);Ip.converters.WebSocketCloseInfo=Ip.dictionaryConverter([{key:"closeCode",converter:a(t=>Ip.converters["unsigned short"](t,Ip.attributes.EnforceRange),"converter")},{key:"reason",converter:Ip.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);Ip.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?Ip.converters.USVString(t):Ip.converters.BufferSource(t)};nJn.exports={WebSocketStream:Blt}});var sJn=I((ebf,oJn)=>{"use strict";p();function yQs(t){return t.indexOf("\0")===-1}a(yQs,"isValidLastEventId");function _Qs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(_Qs,"isASCIINumber");oJn.exports={isValidLastEventId:yQs,isASCIINumber:_Qs}});var uJn=I((nbf,lJn)=>{"use strict";p();var{Transform:EQs}=require("node:stream"),{isASCIINumber:aJn,isValidLastEventId:cJn}=sJn(),F8=[239,187,191],Cfr=10,Flt=13,vQs=58,CQs=32,bfr=class extends EQs{static{a(this,"EventSourceStream")}state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,r,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===F8[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===F8[0]&&this.buffer[1]===F8[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===F8[0]&&this.buffer[1]===F8[1]&&this.buffer[2]===F8[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===F8[0]&&this.buffer[1]===F8[1]&&this.buffer[2]===F8[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&aJn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&cJn(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};lJn.exports={EventSourceStream:bfr}});var yJn=I((sbf,AJn)=>{"use strict";p();var{pipeline:bQs}=require("node:stream"),{fetching:SQs}=UDe(),{makeRequest:TQs}=zhe(),{webidl:Dv}=oy(),{EventSourceStream:IQs}=uJn(),{parseMIMEType:xQs}=sR(),{createFastMessageEvent:wQs}=xlt(),{isNetworkError:dJn}=LDe(),{kEnumerableProperty:ZX}=No(),{environmentSettingsObject:fJn}=VT(),pJn=!1,hJn=3e3,VDe=0,mJn=1,WDe=2,RQs="anonymous",kQs="use-credentials",ime=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=VDe;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),Dv.util.markAsUncloneable(this);let n="EventSource constructor";Dv.argumentLengthCheck(arguments,1,n),pJn||(pJn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=Dv.converters.USVString(e),r=Dv.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=fJn,s;try{s=new URL(e,o.settingsObject.baseUrl),this.#a.origin=s.origin}catch(u){throw new DOMException(u,"SyntaxError")}this.#t=s.href;let c=RQs;r.withCredentials===!0&&(c=kQs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=fJn.settingsObject,l.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],l.cache="no-store",l.initiator="other",l.urlList=[new URL(this.#t)],this.#i=TQs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===WDe)return;this.#n=VDe;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!dJn(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(dJn(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#u();return}let o=n.headersList.get("content-type",!0),s=o!==null?xQs(o):"failure",c=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||c===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=mJn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new IQs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(wQs(u.type,u.options))},"push")});bQs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=SQs(e)}#u(){this.#n!==WDe&&(this.#n=VDe,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===VDe&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){Dv.brandCheck(this,t),this.#n!==WDe&&(this.#n=WDe,this.#o.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open);let r=Dv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message);let r=Dv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error);let r=Dv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},gJn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:VDe,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:mJn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:WDe,writable:!1}};Object.defineProperties(ime,gJn);Object.defineProperties(ime.prototype,gJn);Object.defineProperties(ime.prototype,{close:ZX,onerror:ZX,onmessage:ZX,onopen:ZX,readyState:ZX,url:ZX,withCredentials:ZX});Dv.converters.EventSourceInitDict=Dv.dictionaryConverter([{key:"withCredentials",converter:Dv.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:Dv.converters.any},{key:"node",converter:Dv.dictionaryConverter([{key:"reconnectionTime",converter:Dv.converters["unsigned long"],defaultValue:a(()=>hJn,"defaultValue")},{key:"dispatcher",converter:Dv.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);AJn.exports={EventSource:ime,defaultReconnectionTime:hJn}});var Sfr=I((lbf,bn)=>{"use strict";p();var PQs=UH(),EJn=$2e(),DQs=wX(),NQs=i$n(),MQs=c$n(),OQs=PX(),LQs=aur(),BQs=nur(),FQs=W$n(),UQs=eVn(),QQs=nVn(),vJn=uo(),Qlt=No(),{InvalidArgumentError:Ult}=vJn,ome=FVn(),qQs=AX(),jQs=Vur(),{MockCallHistory:HQs,MockCallHistoryLog:GQs}=Yur(),$Qs=idr(),VQs=Xur(),WQs=BWn(),zQs=Rur(),YQs=Oct(),{getGlobalDispatcher:CJn,setGlobalDispatcher:KQs}=Kct(),JQs=jhe(),ZQs=fdr();Object.assign(EJn.prototype,ome);bn.exports.Dispatcher=EJn;bn.exports.Client=PQs;bn.exports.Pool=DQs;bn.exports.BalancedPool=NQs;bn.exports.RoundRobinPool=MQs;bn.exports.Agent=OQs;bn.exports.ProxyAgent=LQs;bn.exports.Socks5ProxyAgent=BQs;bn.exports.EnvHttpProxyAgent=FQs;bn.exports.RetryAgent=UQs;bn.exports.H2CClient=QQs;bn.exports.RetryHandler=YQs;bn.exports.DecoratorHandler=JQs;bn.exports.RedirectHandler=ZQs;bn.exports.interceptors={redirect:zWn(),responseError:KWn(),retry:ZWn(),dump:ezn(),dns:izn(),cache:Lzn(),decompress:qzn(),deduplicate:Vzn()};bn.exports.cacheStores={MemoryCacheStore:xdr()};var XQs=Yzn();bn.exports.cacheStores.SqliteCacheStore=XQs;bn.exports.buildConnector=qQs;bn.exports.errors=vJn;bn.exports.util={parseHeaders:Qlt.parseHeaders,headerNameToString:Qlt.headerNameToString};function zDe(t){return(e,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new Ult("invalid url");if(r!=null&&typeof r!="object")throw new Ult("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new Ult("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Qlt.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Qlt.parseURL(e);let{agent:o,dispatcher:s=CJn()}=r;if(o)throw new Ult("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...r,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}a(zDe,"makeDispatcher");bn.exports.setGlobalDispatcher=KQs;bn.exports.getGlobalDispatcher=CJn;var eqs=UDe().fetch,_Jn=typeof __filename<"u"?__filename:void 0;function bJn(t,e){if(!t||typeof t!="object")return;let r=typeof t.stack=="string"?t.stack:"",n=e.replace(/\\/g,"/");if(r&&(r.includes(e)||r.includes(n)))return;let o={};if(Error.captureStackTrace(o,bJn),!o.stack)return;let s=o.stack.split(` + `)}close(){this.#r.close()}get(e){Odr(e);let r=this.#g(e);return r?{body:r.body?Buffer.from(r.body.buffer,r.body.byteOffset,r.body.byteLength):void 0,statusCode:r.statusCode,statusMessage:r.statusMessage,headers:r.headers?JSON.parse(r.headers):void 0,etag:r.etag?r.etag:void 0,vary:r.vary?JSON.parse(r.vary):void 0,cacheControlDirectives:r.cacheControlDirectives?JSON.parse(r.cacheControlDirectives):void 0,cachedAt:r.cachedAt,staleAt:r.staleAt,deleteAt:r.deleteAt}:void 0}set(e,r){Odr(e);let n=this.#p(e),o=Array.isArray(r.body)?Buffer.concat(r.body):r.body,s=o?.byteLength;if(s&&s>this.#e)return;let c=this.#g(e,!0);c?this.#i.run(o,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.cachedAt,r.staleAt,c.id):(this.#o.run(n,e.method,o,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.vary?JSON.stringify(r.vary):null,r.cachedAt,r.staleAt),this.#l())}createWriteStream(e,r){Odr(e),o6s(r);let n=0,o=[],s=this;return new i6s({decodeStrings:!0,write(c,l,u){n+=c.byteLength,n=u.deleteAt&&!r)continue;let d=!0;if(u.vary){let f=JSON.parse(u.vary);for(let h in f)if(!s6s(o[h],f[h])){d=!1;break}}if(d)return u}}};function s6s(t,e){if(t==null&&e==null)return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;r{"use strict";p();var{kConstruct:a6s}=Al(),{kEnumerableProperty:Whe}=No(),{iteratorMixin:c6s,isValidHeaderName:MDe,isValidHeaderValue:Xzn}=VT(),{webidl:Ba}=oy(),Bdr=require("node:assert"),elt=require("node:util");function Zzn(t){return t===10||t===13||t===9||t===32}a(Zzn,"isHTTPWhiteSpaceCharCode");function eYn(t){let e=0,r=t.length;for(;r>e&&Zzn(t.charCodeAt(r-1));)--r;for(;r>e&&Zzn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(eYn,"headerValueNormalize");function tYn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(tYn,"fill");function Fdr(t,e,r){if(r=eYn(r),MDe(e)){if(!Xzn(r))throw Ba.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw Ba.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(nYn(t)==="immutable")throw new TypeError("immutable");return rlt(t).append(e,r,!1)}a(Fdr,"appendHeader");function l6s(t){let e=rlt(t);if(!e)return[];if(e.sortedMap)return e.sortedMap;let r=[],n=e.toSortedArray(),o=e.cookies;if(o===null||o.length===1)return e.sortedMap=n;for(let s=0;s>1),r[d][0]<=f[0]?u=d+1:l=d;if(s!==d){for(c=s;c>u;)r[c]=r[--c];r[u]=f}}if(!n.next().done)throw new TypeError("Unreachable");return r}else{let n=0;for(let{0:o,1:{value:s}}of this.headersMap)r[n++]=[o,s],Bdr(s!==null);return r.sort(rYn)}}},iD=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){Ba.util.markAsUncloneable(this),e!==a6s&&(this.#t=new tlt,this.#e="none",e!==void 0&&(e=Ba.converters.HeadersInit(e,"Headers constructor","init"),tYn(this,e)))}append(e,r){Ba.brandCheck(this,t),Ba.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=Ba.converters.ByteString(e,n,"name"),r=Ba.converters.ByteString(r,n,"value"),Fdr(this,e,r)}delete(e){if(Ba.brandCheck(this,t),Ba.argumentLengthCheck(arguments,1,"Headers.delete"),e=Ba.converters.ByteString(e,"Headers.delete","name"),!MDe(e))throw Ba.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){Ba.brandCheck(this,t),Ba.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=Ba.converters.ByteString(e,r,"name"),!MDe(e))throw Ba.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Ba.brandCheck(this,t),Ba.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=Ba.converters.ByteString(e,r,"name"),!MDe(e))throw Ba.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){Ba.brandCheck(this,t),Ba.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=Ba.converters.ByteString(e,n,"name"),r=Ba.converters.ByteString(r,n,"value"),r=eYn(r),MDe(e)){if(!Xzn(r))throw Ba.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw Ba.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){Ba.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[elt.inspect.custom](e,r){return r.depth??=e,`Headers ${elt.formatWithOptions(r,this.#t.entries)}`}static getHeadersGuard(e){return e.#e}static setHeadersGuard(e,r){e.#e=r}static getHeadersList(e){return e.#t}static setHeadersList(e,r){e.#t=r}},{getHeadersGuard:nYn,setHeadersGuard:u6s,getHeadersList:rlt,setHeadersList:d6s}=iD;Reflect.deleteProperty(iD,"getHeadersGuard");Reflect.deleteProperty(iD,"setHeadersGuard");Reflect.deleteProperty(iD,"getHeadersList");Reflect.deleteProperty(iD,"setHeadersList");c6s("Headers",iD,l6s,0,1);Object.defineProperties(iD.prototype,{append:Whe,delete:Whe,get:Whe,has:Whe,set:Whe,getSetCookie:Whe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[elt.inspect.custom]:{enumerable:!1}});Ba.converters.HeadersInit=function(t,e,r){if(Ba.util.Type(t)===Ba.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!elt.types.isProxy(t)&&n===iD.prototype.entries)try{return rlt(t).entriesList}catch{}return typeof n=="function"?Ba.converters["sequence>"](t,e,r,n.bind(t)):Ba.converters["record"](t,e,r)}throw Ba.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};iYn.exports={fill:tYn,compareHeaderName:rYn,Headers:iD,HeadersList:tlt,getHeadersGuard:nYn,setHeadersGuard:u6s,setHeadersList:d6s,getHeadersList:rlt}});var LDe=I((Vvf,gYn)=>{"use strict";p();var{Headers:uYn,HeadersList:oYn,fill:f6s,getHeadersGuard:p6s,setHeadersGuard:dYn,setHeadersList:fYn}=$X(),{extractBody:sYn,cloneBody:h6s,mixinBody:m6s,streamRegistry:pYn,bodyUnusable:g6s}=She(),hYn=No(),aYn=require("node:util"),{kEnumerableProperty:ZT}=hYn,{isValidReasonPhrase:A6s,isCancelled:y6s,isAborted:_6s,isErrorLike:E6s,environmentSettingsObject:v6s}=VT(),{redirectStatusSet:C6s,nullBodyStatus:b6s}=W2e(),{webidl:aa}=oy(),{URLSerializer:cYn}=sR(),{kConstruct:ilt}=Al(),Udr=require("node:assert"),{isomorphicEncode:S6s,serializeJavascriptValueToJSONString:T6s}=T8(),I6s=new TextEncoder("utf-8"),XT=class t{static{a(this,"Response")}#e;#t;static error(){return ODe(olt(),"immutable")}static json(e,r=void 0){aa.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=aa.converters.ResponseInit(r));let n=I6s.encode(T6s(e)),o=sYn(n),s=ODe(zhe({}),"response");return lYn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){aa.argumentLengthCheck(arguments,1,"Response.redirect"),e=aa.converters.USVString(e),r=aa.converters["unsigned short"](r);let n;try{n=new URL(e,v6s.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!C6s.has(r))throw new RangeError(`Invalid status code ${r}`);let o=ODe(zhe({}),"immutable");o.#t.status=r;let s=S6s(cYn(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(aa.util.markAsUncloneable(this),e===ilt)return;e!==null&&(e=aa.converters.BodyInit(e,"Response","body")),r=aa.converters.ResponseInit(r),this.#t=zhe({}),this.#e=new uYn(ilt),dYn(this.#e,"response"),fYn(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=sYn(e);n={body:o,type:s}}lYn(this,r,n)}get type(){return aa.brandCheck(this,t),this.#t.type}get url(){aa.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":cYn(r,!0)}get redirected(){return aa.brandCheck(this,t),this.#t.urlList.length>1}get status(){return aa.brandCheck(this,t),this.#t.status}get ok(){return aa.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return aa.brandCheck(this,t),this.#t.statusText}get headers(){return aa.brandCheck(this,t),this.#e}get body(){return aa.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return aa.brandCheck(this,t),!!this.#t.body&&hYn.isDisturbed(this.#t.body.stream)}clone(){if(aa.brandCheck(this,t),g6s(this.#t))throw aa.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=Qdr(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&pYn.register(this,new WeakRef(this.#t.body.stream)),ODe(e,p6s(this.#e))}[aYn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${aYn.formatWithOptions(r,n)}`}static getResponseHeaders(e){return e.#e}static setResponseHeaders(e,r){e.#e=r}static getResponseState(e){return e.#t}static setResponseState(e,r){e.#t=r}},{getResponseHeaders:x6s,setResponseHeaders:w6s,getResponseState:VX,setResponseState:R6s}=XT;Reflect.deleteProperty(XT,"getResponseHeaders");Reflect.deleteProperty(XT,"setResponseHeaders");Reflect.deleteProperty(XT,"getResponseState");Reflect.deleteProperty(XT,"setResponseState");m6s(XT,VX);Object.defineProperties(XT.prototype,{type:ZT,url:ZT,status:ZT,ok:ZT,redirected:ZT,statusText:ZT,headers:ZT,clone:ZT,body:ZT,bodyUsed:ZT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(XT,{json:ZT,redirect:ZT,error:ZT});function Qdr(t){if(t.internalResponse)return mYn(Qdr(t.internalResponse),t.type);let e=zhe({...t,body:null});return t.body!=null&&(e.body=h6s(t.body)),e}a(Qdr,"cloneResponse");function zhe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new oYn(t?.headersList):new oYn,urlList:t?.urlList?[...t.urlList]:[]}}a(zhe,"makeResponse");function olt(t){let e=E6s(t);return zhe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(olt,"makeNetworkError");function k6s(t){return t.type==="error"&&t.status===0}a(k6s,"isNetworkError");function nlt(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(r,n){return n in e?e[n]:r[n]},set(r,n,o){return Udr(!(n in e)),r[n]=o,!0}})}a(nlt,"makeFilteredResponse");function mYn(t,e){if(e==="basic")return nlt(t,{type:"basic",headersList:t.headersList});if(e==="cors")return nlt(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return nlt(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return nlt(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});Udr(!1)}a(mYn,"filterResponse");function P6s(t,e=null){return Udr(y6s(t)),_6s(t)?olt(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):olt(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(P6s,"makeAppropriateNetworkError");function lYn(t,e,r){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!A6s(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(VX(t).status=e.status),"statusText"in e&&e.statusText!=null&&(VX(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&f6s(x6s(t),e.headers),r){if(b6s.includes(t.status))throw aa.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});VX(t).body=r.body,r.type!=null&&!VX(t).headersList.contains("content-type",!0)&&VX(t).headersList.append("content-type",r.type,!0)}}a(lYn,"initializeResponse");function ODe(t,e){let r=new XT(ilt);R6s(r,t);let n=new uYn(ilt);return w6s(r,n),fYn(n,t.headersList),dYn(n,e),t.urlList.length!==0&&t.body?.stream&&pYn.register(r,new WeakRef(t.body.stream)),r}a(ODe,"fromInnerResponse");aa.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?aa.converters.USVString(t,e,r):aa.is.Blob(t)||aa.is.BufferSource(t)||aa.is.FormData(t)||aa.is.URLSearchParams(t)?t:aa.converters.DOMString(t,e,r)};aa.converters.BodyInit=function(t,e,r){return aa.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:aa.converters.XMLHttpRequestBodyInit(t,e,r)};aa.converters.ResponseInit=aa.dictionaryConverter([{key:"status",converter:aa.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:aa.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:aa.converters.HeadersInit}]);aa.is.Response=aa.util.MakeTypeAssertion(XT);gYn.exports={isNetworkError:k6s,makeNetworkError:olt,makeResponse:zhe,makeAppropriateNetworkError:P6s,filterResponse:mYn,Response:XT,cloneResponse:Qdr,fromInnerResponse:ODe,getResponseState:VX}});var Yhe=I((Yvf,kYn)=>{"use strict";p();var{extractBody:D6s,mixinBody:N6s,cloneBody:M6s,bodyUnusable:AYn}=She(),{Headers:bYn,fill:O6s,HeadersList:clt,setHeadersGuard:qdr,getHeadersGuard:L6s,setHeadersList:SYn,getHeadersList:yYn}=$X(),alt=No(),_Yn=require("node:util"),{isValidHTTPToken:B6s,sameOrigin:EYn,environmentSettingsObject:slt}=VT(),{forbiddenMethodsSet:F6s,corsSafeListedMethodsSet:U6s,referrerPolicy:Q6s,requestRedirect:q6s,requestMode:j6s,requestCredentials:H6s,requestCache:G6s,requestDuplex:$6s}=W2e(),{kEnumerableProperty:Im,normalizedMethodRecordsBase:V6s,normalizedMethodRecords:W6s}=alt,{webidl:Ui}=oy(),{URLSerializer:z6s}=sR(),{kConstruct:llt}=Al(),Y6s=require("node:assert"),{getMaxListeners:TYn,setMaxListeners:K6s,defaultMaxListeners:J6s}=require("node:events"),Z6s=Symbol("abortController"),IYn=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),ult=new WeakMap,jdr;try{jdr=TYn(new AbortController().signal)>0}catch{jdr=!1}function vYn(t){return e;function e(){let r=t.deref();if(r!==void 0){IYn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=ult.get(r.signal);if(n!==void 0){if(n.size!==0){for(let o of n){let s=o.deref();s!==void 0&&s.abort(this.reason)}n.clear()}ult.delete(r.signal)}}}}a(vYn,"buildAbort");var CYn=!1,qb=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Ui.util.markAsUncloneable(this),e===llt)return;Ui.argumentLengthCheck(arguments,1,"Request constructor"),e=Ui.converters.RequestInfo(e),r=Ui.converters.RequestInit(r);let o=null,s=null,c=slt.settingsObject.baseUrl,l=null;if(typeof e=="string"){this.#t=r.dispatcher;let E;try{E=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(E.username||E.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=dlt({urlList:[E]}),s="cors"}else Y6s(Ui.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=slt.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&EYn(o.window,u)&&(d=o.window),r.window!=null)throw new TypeError(`'window' option '${d}' must be null`);"window"in r&&(d="no-window"),o=dlt({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:slt.settingsObject,window:d,priority:o.priority,origin:o.origin,referrer:o.referrer,referrerPolicy:o.referrerPolicy,mode:o.mode,credentials:o.credentials,cache:o.cache,redirect:o.redirect,integrity:o.integrity,keepalive:o.keepalive,reloadNavigation:o.reloadNavigation,historyNavigation:o.historyNavigation,urlList:[...o.urlList]});let f=Object.keys(r).length!==0;if(f&&(o.mode==="navigate"&&(o.mode="same-origin"),o.reloadNavigation=!1,o.historyNavigation=!1,o.origin="client",o.referrer="client",o.referrerPolicy="",o.url=o.urlList[o.urlList.length-1],o.urlList=[o.url]),r.referrer!==void 0){let E=r.referrer;if(E==="")o.referrer="no-referrer";else{let v;try{v=new URL(E,c)}catch(S){throw new TypeError(`Referrer "${E}" is not a valid URL.`,{cause:S})}v.protocol==="about:"&&v.hostname==="client"||u&&!EYn(v,slt.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw Ui.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let E=r.method,v=W6s[E];if(v!==void 0)o.method=v;else{if(!B6s(E))throw new TypeError(`'${E}' is not a valid HTTP method.`);let S=E.toUpperCase();if(F6s.has(S))throw new TypeError(`'${E}' HTTP method is unsupported.`);E=V6s[S]??E,o.method=E}!CYn&&o.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),CYn=!0)}r.signal!==void 0&&(l=r.signal),this.#n=o;let m=new AbortController;if(this.#e=m.signal,l!=null)if(l.aborted)m.abort(l.reason);else{this[Z6s]=m;let E=new WeakRef(m),v=vYn(E);jdr&&TYn(l)===J6s&&K6s(1500,l),alt.addAbortListener(l,v),IYn.register(m,{signal:l,abort:v},v)}if(this.#r=new bYn(llt),SYn(this.#r,o.headersList),qdr(this.#r,"request"),h==="no-cors"){if(!U6s.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);qdr(this.#r,"request-no-cors")}if(f){let E=yYn(this.#r),v=r.headers!==void 0?r.headers:new clt(E);if(E.clear(),v instanceof clt){for(let{name:S,value:T}of v.rawValues())E.append(S,T,!1);E.cookies=v.cookies}else O6s(this.#r,v)}let g=Ui.is.Request(e)?e.#n.body:null;if((r.body!=null||g!=null)&&(o.method==="GET"||o.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let A=null;if(r.body!=null){let[E,v]=D6s(r.body,o.keepalive);A=E,v&&!yYn(this.#r).contains("content-type",!0)&&this.#r.append("content-type",v,!0)}let y=A??g;if(y!=null&&y.source==null){if(A!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(o.mode!=="same-origin"&&o.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');o.useCORSPreflightFlag=!0}let _=y;if(A==null&&g!=null){if(AYn(e.#n))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let E=new TransformStream;g.stream.pipeThrough(E),_={source:g.source,length:g.length,stream:E.readable}}this.#n.body=_}get method(){return Ui.brandCheck(this,t),this.#n.method}get url(){return Ui.brandCheck(this,t),z6s(this.#n.url)}get headers(){return Ui.brandCheck(this,t),this.#r}get destination(){return Ui.brandCheck(this,t),this.#n.destination}get referrer(){return Ui.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Ui.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Ui.brandCheck(this,t),this.#n.mode}get credentials(){return Ui.brandCheck(this,t),this.#n.credentials}get cache(){return Ui.brandCheck(this,t),this.#n.cache}get redirect(){return Ui.brandCheck(this,t),this.#n.redirect}get integrity(){return Ui.brandCheck(this,t),this.#n.integrity}get keepalive(){return Ui.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Ui.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Ui.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Ui.brandCheck(this,t),this.#e}get body(){return Ui.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Ui.brandCheck(this,t),!!this.#n.body&&alt.isDisturbed(this.#n.body.stream)}get duplex(){return Ui.brandCheck(this,t),"half"}clone(){if(Ui.brandCheck(this,t),AYn(this.#n))throw new TypeError("unusable");let e=wYn(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=ult.get(this.signal);n===void 0&&(n=new Set,ult.set(this.signal,n));let o=new WeakRef(r);n.add(o),alt.addAbortListener(r.signal,vYn(o))}return RYn(e,this.#t,r.signal,L6s(this.#r))}[_Yn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${_Yn.formatWithOptions(r,n)}`}static setRequestSignal(e,r){return e.#e=r,e}static getRequestDispatcher(e){return e.#t}static setRequestDispatcher(e,r){e.#t=r}static setRequestHeaders(e,r){e.#r=r}static getRequestState(e){return e.#n}static setRequestState(e,r){e.#n=r}},{setRequestSignal:X6s,getRequestDispatcher:eUs,setRequestDispatcher:tUs,setRequestHeaders:rUs,getRequestState:xYn,setRequestState:nUs}=qb;Reflect.deleteProperty(qb,"setRequestSignal");Reflect.deleteProperty(qb,"getRequestDispatcher");Reflect.deleteProperty(qb,"setRequestDispatcher");Reflect.deleteProperty(qb,"setRequestHeaders");Reflect.deleteProperty(qb,"getRequestState");Reflect.deleteProperty(qb,"setRequestState");N6s(qb,xYn);function dlt(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,useURLCredentials:t.useURLCredentials??void 0,traversableForUserPrompts:t.traversableForUserPrompts??"client",urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new clt(t.headersList):new clt}}a(dlt,"makeRequest");function wYn(t){let e=dlt({...t,body:null});return t.body!=null&&(e.body=M6s(t.body)),e}a(wYn,"cloneRequest");function RYn(t,e,r,n){let o=new qb(llt);nUs(o,t),tUs(o,e),X6s(o,r);let s=new bYn(llt);return rUs(o,s),SYn(s,t.headersList),qdr(s,n),o}a(RYn,"fromInnerRequest");Object.defineProperties(qb.prototype,{method:Im,url:Im,headers:Im,redirect:Im,clone:Im,signal:Im,duplex:Im,destination:Im,body:Im,bodyUsed:Im,isHistoryNavigation:Im,isReloadNavigation:Im,keepalive:Im,integrity:Im,cache:Im,credentials:Im,attribute:Im,referrerPolicy:Im,referrer:Im,mode:Im,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Ui.is.Request=Ui.util.MakeTypeAssertion(qb);Ui.converters.RequestInfo=function(t){return typeof t=="string"?Ui.converters.USVString(t):Ui.is.Request(t)?t:Ui.converters.USVString(t)};Ui.converters.RequestInit=Ui.dictionaryConverter([{key:"method",converter:Ui.converters.ByteString},{key:"headers",converter:Ui.converters.HeadersInit},{key:"body",converter:Ui.nullableConverter(Ui.converters.BodyInit)},{key:"referrer",converter:Ui.converters.USVString},{key:"referrerPolicy",converter:Ui.converters.DOMString,allowedValues:Q6s},{key:"mode",converter:Ui.converters.DOMString,allowedValues:j6s},{key:"credentials",converter:Ui.converters.DOMString,allowedValues:H6s},{key:"cache",converter:Ui.converters.DOMString,allowedValues:G6s},{key:"redirect",converter:Ui.converters.DOMString,allowedValues:q6s},{key:"integrity",converter:Ui.converters.DOMString},{key:"keepalive",converter:Ui.converters.boolean},{key:"signal",converter:Ui.nullableConverter(t=>Ui.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Ui.converters.any},{key:"duplex",converter:Ui.converters.DOMString,allowedValues:$6s},{key:"dispatcher",converter:Ui.converters.any},{key:"priority",converter:Ui.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);kYn.exports={Request:qb,makeRequest:dlt,fromInnerRequest:RYn,cloneRequest:wYn,getRequestDispatcher:eUs,getRequestState:xYn}});var FYn=I((Zvf,BYn)=>{"use strict";p();var iUs=require("node:assert"),{runtimeFeatures:DYn}=I8(),WX=new Map([["sha256",0],["sha384",1],["sha512",2]]),Hdr;if(DYn.has("crypto")){Hdr=require("node:crypto");let t=Hdr.getHashes();t.length===0&&WX.clear();for(let e of WX.keys())t.includes(e)===!1&&WX.delete(e)}else WX.clear();var PYn=Map.prototype.get.bind(WX),Gdr=Map.prototype.has.bind(WX),oUs=DYn.has("crypto")===!1||WX.size===0?()=>!0:(t,e)=>{let r=MYn(e);if(r.length===0)return!0;let n=NYn(r);for(let o of n){let s=o.alg,c=o.val,l=OYn(s,t);if(LYn(l,c))return!0}return!1};function NYn(t){let e=[],r=null;for(let n of t){if(iUs(Gdr(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=PYn(o),c=n.alg,l=PYn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a(NYn,"getStrongestMetadata");function MYn(t){let e=[];for(let r of t.split(" ")){let o=r.split("?",1)[0],s="",c=[o.slice(0,6),o.slice(7)],l=c[0];if(!Gdr(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(MYn,"parseMetadata");var OYn=a((t,e)=>Hdr.hash(t,e,"base64"),"applyAlgorithmToBytes");function LYn(t,e){let r=t.length;r!==0&&t[r-1]==="="&&(r-=1),r!==0&&t[r-1]==="="&&(r-=1);let n=e.length;if(n!==0&&e[n-1]==="="&&(n-=1),n!==0&&e[n-1]==="="&&(n-=1),r!==n)return!1;for(let o=0;o{"use strict";p();var{makeNetworkError:_l,makeAppropriateNetworkError:BDe,filterResponse:$dr,makeResponse:flt,fromInnerResponse:sUs,getResponseState:aUs}=LDe(),{HeadersList:Vdr}=$X(),{Request:cUs,cloneRequest:lUs,getRequestDispatcher:uUs,getRequestState:dUs}=Yhe(),oD=require("node:zlib"),{makePolicyContainer:fUs,clonePolicyContainer:pUs,requestBadPort:hUs,TAOCheck:mUs,appendRequestOriginHeader:gUs,responseLocationURL:AUs,requestCurrentURL:eI,setRequestReferrerPolicyOnRedirect:yUs,tryUpgradeRequestToAPotentiallyTrustworthyURL:_Us,createOpaqueTimingInfo:Zdr,appendFetchMetadata:EUs,corsCheck:vUs,crossOriginResourcePolicyCheck:CUs,determineRequestsReferrer:bUs,coarsenedSharedCurrentTime:FDe,sameOrigin:Kdr,isCancelled:KH,isAborted:UYn,isErrorLike:SUs,fullyReadBody:TUs,readableStreamClose:IUs,urlIsLocal:xUs,urlIsHttpHttpsScheme:glt,urlHasHttpsScheme:wUs,clampAndCoarsenConnectionTimingInfo:RUs,simpleRangeHeaderValue:kUs,buildContentRange:PUs,createInflate:DUs,extractMimeType:NUs,hasAuthenticationEntry:MUs,includesCredentials:QYn,isTraversableNavigable:OUs}=VT(),zX=require("node:assert"),{safelyExtractBody:Alt,extractBody:qYn}=She(),{redirectStatusSet:$Yn,nullBodyStatus:VYn,safeMethodsSet:LUs,requestBodyHeader:BUs,subresourceSet:FUs}=W2e(),UUs=require("node:events"),{Readable:QUs,pipeline:qUs,finished:jUs,isErrored:HUs,isReadable:plt}=require("node:stream"),{addAbortListener:GUs,bufferToLowerCasedHeaderName:jYn}=No(),{dataURLProcessor:$Us,serializeAMimeType:VUs,minimizeSupportedMimeType:WUs}=sR(),{getGlobalDispatcher:zUs}=Kct(),{webidl:Xdr}=oy(),{STATUS_CODES:HYn}=require("node:http"),{bytesMatch:YUs}=FYn(),{createDeferredPromise:KUs}=Z2e(),{isomorphicEncode:hlt}=T8(),{runtimeFeatures:JUs}=I8(),ZUs=JUs.has("zstd"),XUs=["GET","HEAD"],e9s=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",Wdr,mlt=class extends UUs{static{a(this,"Fetch")}constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function t9s(t){WYn(t,"fetch")}a(t9s,"handleFetchDone");function r9s(t,e=void 0){Xdr.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=KUs(),n;try{n=new cUs(t,e)}catch(f){return r.reject(f),r.promise}let o=dUs(n);if(n.signal.aborted)return zdr(r,o,null,n.signal.reason,null),r.promise;o.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(o.serviceWorkers="none");let c=null,l=!1,u=null;return GUs(n.signal,()=>{l=!0,zX(u!=null),u.abort(n.signal.reason);let f=c?.deref();zdr(r,o,f,n.signal.reason,u.controller)}),u=YYn({request:o,processResponseEndOfBody:t9s,processResponse:a(f=>{if(!l){if(f.aborted){zdr(r,o,c,u.serializedAbortReason,u.controller);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(sUs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:uUs(n),requestObject:n}),r.promise}a(r9s,"fetch");function WYn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;glt(r)&&n!==null&&(t.timingAllowPassed||(n=Zdr({startTime:n.startTime}),o=""),n.endTime=FDe(),t.timingInfo=n,zYn(n,r.href,e,globalThis,o,"",t.status))}a(WYn,"finalizeAndReportTiming");var zYn=performance.markResourceTiming;function zdr(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&plt(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=aUs(r);s.body?.stream!=null&&plt(s.body.stream)&&o.error(n)}a(zdr,"abortFetch");function YYn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=zUs(),requestObject:u=null}){zX(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=FDe(f),m=Zdr({startTime:h}),g={controller:new mlt(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return zX(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=pUs(t.client.policyContainer):t.policyContainer=fUs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,FUs.has(t.destination),KYn(g,!1),g.controller}a(YYn,"fetching");async function KYn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!xUs(eI(r))&&(n=_l("local URLs only")),_Us(r),hUs(r)==="blocked"&&(n=_l("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=bUs(r)),n===null){let s=eI(r);Kdr(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await GYn(t)):r.mode==="same-origin"?n=_l('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=_l('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await GYn(t)):glt(eI(r))?(r.responseTainting="cors",n=await JYn(t)):n=_l("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=$dr(n,"basic"):r.responseTainting==="cors"?n=$dr(n,"cors"):r.responseTainting==="opaque"?n=$dr(n,"opaque"):zX(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=_l()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||VYn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>Ydr(t,_l(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!YUs(l,r.integrity)){s("integrity mismatch");return}n.body=Alt(l)[0],Ydr(t,n)},"processBody");TUs(n.body,c,s)}else Ydr(t,n)}catch(r){t.controller.terminate(r)}}a(KYn,"mainFetch");function GYn(t){if(KH(t)&&t.request.redirectCount===0)return Promise.resolve(BDe(t));let{request:e}=t,{protocol:r}=eI(e);switch(r){case"about:":return Promise.resolve(_l("about scheme is not supported"));case"blob:":{Wdr||(Wdr=require("node:buffer").resolveObjectURL);let n=eI(e);if(n.search.length!==0)return Promise.resolve(_l("NetworkError when attempting to fetch resource."));let o=Wdr(n.toString());if(e.method!=="GET"||!Xdr.is.Blob(o))return Promise.resolve(_l("invalid method"));let s=flt(),c=o.size,l=hlt(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=kUs(d,!0);if(f==="failure")return Promise.resolve(_l("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(_l("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m+1,u),A=qYn(g);s.body=A[0];let y=hlt(`${g.size}`),_=PUs(h,m,c);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",y,!0),s.headersList.set("content-type",u,!0),s.headersList.set("content-range",_,!0)}else{let d=qYn(o);s.statusText="OK",s.body=d[0],s.headersList.set("content-length",l,!0),s.headersList.set("content-type",u,!0)}return Promise.resolve(s)}case"data:":{let n=eI(e),o=$Us(n);if(o==="failure")return Promise.resolve(_l("failed to fetch the data URL"));let s=VUs(o.mimeType);return Promise.resolve(flt({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Alt(o.body)[0]}))}case"file:":return Promise.resolve(_l("not implemented... yet..."));case"http:":case"https:":return JYn(t).catch(n=>_l(n));default:return Promise.resolve(_l("unknown scheme"))}}a(GYn,"schemeFetch");function n9s(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(n9s,"finalizeResponse");function Ydr(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!glt(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=Zdr(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=NUs(e.headersList);f!=="failure"&&(u.contentType=WUs(f))}t.request.initiatorType!=null&&zYn(r,t.request.url.href,t.request.initiatorType,globalThis,l,u,d)};let c=a(()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()},"processResponseEndOfBodyTask");queueMicrotask(()=>c())},"processResponseEndOfBody");t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let o=e.type==="error"?e:e.internalResponse??e;o.body==null?n():jUs(o.body.stream,()=>{n()})}a(Ydr,"fetchFinale");async function JYn(t){let e=t.request,r=null,n=null,o=t.timingInfo;if(e.serviceWorkers,r===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),n=r=await Jdr(t),e.responseTainting==="cors"&&vUs(e,r)==="failure")return _l("cors failure");mUs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&CUs(e.origin,e.client,e.destination,n)==="blocked"?_l("blocked"):($Yn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=_l("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await i9s(t,r):zX(!1)),r.timingInfo=o,r)}a(JYn,"httpFetch");function i9s(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=AUs(n,eI(r).hash),o==null)return e}catch(c){return Promise.resolve(_l(c))}if(!glt(o))return Promise.resolve(_l("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(_l("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!Kdr(r,o))return Promise.resolve(_l('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(_l('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(_l());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!XUs.includes(r.method)){r.method="GET",r.body=null;for(let c of BUs)r.headersList.delete(c)}Kdr(eI(r),o)||(r.headersList.delete("authorization",!0),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie",!0),r.headersList.delete("host",!0)),r.body!=null&&(zX(r.body.source!=null),r.body=Alt(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=FDe(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),yUs(r,n),KYn(t,!0)}a(i9s,"httpRedirectFetch");async function Jdr(t,e=!1,r=!1){let n=t.request,o=null,s=null,c=null,l=null,u=!1;n.window==="no-window"&&n.redirect==="error"?(o=t,s=n):(s=lUs(n),o={...t},o.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",f=s.body?s.body.length:null,h=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(h="0"),f!=null&&(h=hlt(`${f}`)),h!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,Xdr.is.URL(s.referrer)&&s.headersList.append("referer",hlt(s.referrer.href),!0),gUs(s),EUs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",e9s,!0),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(wUs(eI(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),d&&!s.headersList.contains("authorization",!0)){let m=null;if(!(MUs(s)&&(s.useURLCredentials===void 0||!QYn(eI(s))))){if(QYn(eI(s))&&e){let{username:g,password:A}=eI(s);m=`Basic ${Buffer.from(`${g}:${A}`).toString("base64")}`}}m!==null&&s.headersList.append("Authorization",m,!1)}if(l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return _l("only if cached");let m=await o9s(o,d,r);!LUs.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===401&&s.responseTainting!=="cors"&&d&&(n.useURLCredentials!==void 0||OUs(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=Alt(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return KH(t)?BDe(t):c;t.controller.connection.destroy(),c=await Jdr(t,!0)}if(c.status===407)return n.window==="no-window"?_l():KH(t)?BDe(t):_l("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(KH(t))return BDe(t);t.controller.connection.destroy(),c=await Jdr(t,e,!0)}return c}a(Jdr,"httpNetworkOrCacheFetch");async function o9s(t,e=!1,r=!1){zX(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(E){KH(t)||(yield E,t.processRequestBodyChunkLength?.(E.byteLength))},"processBodyChunk"),y=a(()=>{KH(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),_=a(E=>{KH(t)||(E.name==="AbortError"?t.controller.abort():t.controller.terminate(E))},"processBodyError");u=(async function*(){try{for await(let E of n.body.stream)yield*A(E);y()}catch(E){_(E)}})()}try{let{body:A,status:y,statusText:_,headersList:E,socket:v}=await g({body:u});if(v)o=flt({status:y,statusText:_,headersList:E,socket:v});else{let S=A[Symbol.asyncIterator]();t.controller.next=()=>S.next(),o=flt({status:y,statusText:_,headersList:E})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),BDe(t,A)):_l(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{KH(t)||t.controller.abort(A)},"cancelAlgorithm"),h=new ReadableStream({start(A){t.controller.controller=A},pull:d,cancel:f,type:"bytes"});o.body={stream:h,source:null,length:null},t.controller.resume||t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let A,y;try{let{done:E,value:v}=await t.controller.next();if(UYn(t))break;A=E?void 0:v}catch(E){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=E,y=!0)}if(A===void 0){IUs(t.controller.controller),n9s(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let _=new Uint8Array(A);if(_.byteLength&&t.controller.controller.enqueue(_),HUs(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){UYn(t)?(o.aborted=!0,plt(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):plt(h)&&t.controller.controller.error(new TypeError("terminated",{cause:SUs(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=eI(n),_=t.controller.dispatcher,E=y.pathname+y.search,v=y.search.length===0&&y.href[y.href.length-y.hash.length-1]==="?";return new Promise((S,T)=>_.dispatch({path:v?`${E}?`:E,origin:y.origin,method:n.method,body:_.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(w){let{connection:R}=t.controller;s.finalConnectionTimingInfo=RUs(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),R.destroyed?w(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",w),this.abort=R.abort=w),s.finalNetworkRequestStartTime=FDe(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=FDe(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,k){if(w<200)return!1;let D=new Vdr;for(let M=0;MU)return T(new Error(`too many content-encodings in response: ${L.length}, maximum allowed is ${U}`)),!0;for(let j=L.length-1;j>=0;--j){let Q=L[j].trim();if(Q==="x-gzip"||Q==="gzip")B.push(oD.createGunzip({flush:oD.constants.Z_SYNC_FLUSH,finishFlush:oD.constants.Z_SYNC_FLUSH}));else if(Q==="deflate")B.push(DUs({flush:oD.constants.Z_SYNC_FLUSH,finishFlush:oD.constants.Z_SYNC_FLUSH}));else if(Q==="br")B.push(oD.createBrotliDecompress({flush:oD.constants.BROTLI_OPERATION_FLUSH,finishFlush:oD.constants.BROTLI_OPERATION_FLUSH}));else if(Q==="zstd"&&ZUs)B.push(oD.createZstdDecompress({flush:oD.constants.ZSTD_e_continue,finishFlush:oD.constants.ZSTD_e_end}));else{B.length=0;break}}}let q=this.onError.bind(this);return S({status:w,statusText:k,headersList:D,body:B.length?qUs(this.body,...B,M=>{M&&this.onError(M)}).on("error",q):this.body.on("error",q)}),!0},onData(w){if(t.controller.dump)return;let R=w;return s.encodedBodySize+=R.byteLength,this.body.push(R)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.ended=!0,this.body.push(null)},onError(w){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(w),t.controller.terminate(w),T(w)},onRequestUpgrade(w,R,x,k){if(k.session!=null&&R!==200||k.session==null&&R!==101)return!1;let D=new Vdr;for(let[N,O]of Object.entries(x)){if(O==null)continue;let B=N.toLowerCase();if(Array.isArray(O))for(let q of O)D.append(B,String(q),!0);else D.append(B,String(O),!0)}return S({status:R,statusText:HYn[R],headersList:D,socket:k}),!0},onUpgrade(w,R,x){if(x.session!=null&&w!==200||x.session==null&&w!==101)return!1;let k=new Vdr;for(let D=0;D{"use strict";p();var s9s=require("node:assert"),{URLSerializer:XYn}=sR(),{isValidHeaderName:a9s}=VT();function c9s(t,e,r=!1){let n=XYn(t,r),o=XYn(e,r);return n===o}a(c9s,"urlEquals");function l9s(t){s9s(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),a9s(r)&&e.push(r);return e}a(l9s,"getFieldValues");eKn.exports={urlEquals:c9s,getFieldValues:l9s}});var oKn=I((aCf,iKn)=>{"use strict";p();var efr=require("node:assert"),{kConstruct:u9s}=Al(),{urlEquals:d9s,getFieldValues:tfr}=tKn(),{kEnumerableProperty:YX,isDisturbed:f9s}=No(),{webidl:ti}=oy(),{cloneResponse:rKn,fromInnerResponse:p9s,getResponseState:h9s}=LDe(),{Request:QDe,fromInnerRequest:m9s,getRequestState:C4}=Yhe(),{fetching:g9s}=UDe(),{urlIsHttpHttpsScheme:ylt,readAllBytes:A9s}=VT(),{createDeferredPromise:Khe}=Z2e(),_lt=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==u9s&&ti.illegalConstructor(),ti.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){ti.brandCheck(this,t);let n="Cache.match";ti.argumentLengthCheck(arguments,1,n),e=ti.converters.RequestInfo(e),r=ti.converters.CacheQueryOptions(r,n,"options");let o=this.#i(e,r,1);if(o.length!==0)return o[0]}async matchAll(e=void 0,r={}){ti.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=ti.converters.RequestInfo(e)),r=ti.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){ti.brandCheck(this,t),ti.argumentLengthCheck(arguments,1,"Cache.add"),e=ti.converters.RequestInfo(e);let n=[e];return await this.addAll(n)}async addAll(e){ti.brandCheck(this,t);let r="Cache.addAll";ti.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw ti.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=ti.converters.RequestInfo(m),typeof m=="string")continue;let g=C4(m);if(!ylt(g.url)||g.method!=="GET")throw ti.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=C4(new QDe(m));if(!ylt(g.url))throw ti.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Khe();s.push(g9s({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(ti.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let _=tfr(y.headersList.get("vary"));for(let E of _)if(E==="*"){A.reject(ti.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let v of s)v.abort();return}}},processResponseEndOfBody(y){if(y.aborted){A.reject(new DOMException("aborted","AbortError"));return}A.resolve(y)}})),n.push(A.promise)}let l=await Promise.all(n),u=[],d=0;for(let m of l){let g={type:"put",request:o[d],response:m};u.push(g),d++}let f=Khe(),h=null;try{this.#t(u)}catch(m){h=m}return queueMicrotask(()=>{h===null?f.resolve(void 0):f.reject(h)}),f.promise}async put(e,r){ti.brandCheck(this,t);let n="Cache.put";ti.argumentLengthCheck(arguments,2,n),e=ti.converters.RequestInfo(e),r=ti.converters.Response(r,n,"response");let o=null;if(ti.is.Request(e)?o=C4(e):o=C4(new QDe(e)),!ylt(o.url)||o.method!=="GET")throw ti.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=h9s(r);if(s.status===206)throw ti.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=tfr(s.headersList.get("vary"));for(let A of g)if(A==="*")throw ti.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(f9s(s.body.stream)||s.body.stream.locked))throw ti.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=rKn(s),l=Khe();if(s.body!=null){let A=s.body.stream.getReader();A9s(A,l.resolve,l.reject)}else l.resolve(void 0);let u=[],d={type:"put",request:o,response:c};u.push(d);let f=await l.promise;c.body!=null&&(c.body.source=f);let h=Khe(),m=null;try{this.#t(u)}catch(g){m=g}return queueMicrotask(()=>{m===null?h.resolve():h.reject(m)}),h.promise}async delete(e,r={}){ti.brandCheck(this,t);let n="Cache.delete";ti.argumentLengthCheck(arguments,1,n),e=ti.converters.RequestInfo(e),r=ti.converters.CacheQueryOptions(r,n,"options");let o=null;if(ti.is.Request(e)){if(o=C4(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else efr(typeof e=="string"),o=C4(new QDe(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Khe(),u=null,d;try{d=this.#t(s)}catch(f){u=f}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(e=void 0,r={}){ti.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=ti.converters.RequestInfo(e)),r=ti.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(ti.is.Request(e)){if(o=C4(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=C4(new QDe(e)));let s=Khe(),c=[];if(e===void 0)for(let l of this.#e)c.push(l[0]);else{let l=this.#r(o,r);for(let u of l)c.push(u[0])}return queueMicrotask(()=>{let l=[];for(let u of c){let d=m9s(u,void 0,new AbortController().signal,"immutable");l.push(d)}s.resolve(Object.freeze(l))}),s.promise}#t(e){let r=this.#e,n=[...r],o=[],s=[];try{for(let c of e){if(c.type!=="delete"&&c.type!=="put")throw ti.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw ti.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(c.request,c.options,o).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=this.#r(c.request,c.options),l.length===0)return[];for(let u of l){let d=r.indexOf(u);efr(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw ti.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!ylt(u.url))throw ti.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw ti.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw ti.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=this.#r(c.request);for(let d of l){let f=r.indexOf(d);efr(f!==-1),r.splice(f,1)}r.push([c.request,c.response]),o.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw this.#e.length=0,this.#e=n,c}}#r(e,r,n){let o=[],s=n??this.#e;for(let c of s){let[l,u]=c;this.#n(e,l,u,r)&&o.push(c)}return o}#n(e,r,n=null,o){let s=new URL(e.url),c=new URL(r.url);if(o?.ignoreSearch&&(c.search="",s.search=""),!d9s(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=tfr(n.headersList.get("vary"));for(let u of l){if(u==="*")return!1;let d=r.headersList.get(u),f=e.headersList.get(u);if(d!==f)return!1}return!0}#i(e,r,n=1/0){let o=null;if(e!==void 0)if(ti.is.Request(e)){if(o=C4(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=C4(new QDe(e)));let s=[];if(e===void 0)for(let l of this.#e)s.push(l[1]);else{let l=this.#r(o,r);for(let u of l)s.push(u[1])}let c=[];for(let l of s){let u=p9s(rKn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(_lt.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:YX,matchAll:YX,add:YX,addAll:YX,put:YX,delete:YX,keys:YX});var nKn=[{key:"ignoreSearch",converter:ti.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:ti.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:ti.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];ti.converters.CacheQueryOptions=ti.dictionaryConverter(nKn);ti.converters.MultiCacheQueryOptions=ti.dictionaryConverter([...nKn,{key:"cacheName",converter:ti.converters.DOMString}]);ti.converters.Response=ti.interfaceConverter(ti.is.Response,"Response");ti.converters["sequence"]=ti.sequenceConverter(ti.converters.RequestInfo);iKn.exports={Cache:_lt}});var aKn=I((uCf,sKn)=>{"use strict";p();var{Cache:Elt}=oKn(),{webidl:Q_}=oy(),{kEnumerableProperty:qDe}=No(),{kConstruct:jDe}=Al(),vlt=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==jDe&&Q_.illegalConstructor(),Q_.util.markAsUncloneable(this)}async match(e,r={}){if(Q_.brandCheck(this,t),Q_.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=Q_.converters.RequestInfo(e),r=Q_.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Elt(jDe,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Elt(jDe,n).match(e,r);if(s!==void 0)return s}}async has(e){Q_.brandCheck(this,t);let r="CacheStorage.has";return Q_.argumentLengthCheck(arguments,1,r),e=Q_.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){Q_.brandCheck(this,t);let r="CacheStorage.open";if(Q_.argumentLengthCheck(arguments,1,r),e=Q_.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Elt(jDe,o)}let n=[];return this.#e.set(e,n),new Elt(jDe,n)}async delete(e){Q_.brandCheck(this,t);let r="CacheStorage.delete";return Q_.argumentLengthCheck(arguments,1,r),e=Q_.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return Q_.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(vlt.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:qDe,has:qDe,open:qDe,delete:qDe,keys:qDe});sKn.exports={CacheStorage:vlt}});var lKn=I((pCf,cKn)=>{"use strict";p();cKn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var ifr=I((mCf,pKn)=>{"use strict";p();function y9s(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(y9s,"isCTLExcludingHtab");function rfr(t){for(let e=0;e126||r===34||r===40||r===41||r===60||r===62||r===64||r===44||r===59||r===58||r===92||r===47||r===91||r===93||r===63||r===61||r===123||r===125)throw new Error("Invalid cookie name")}}a(rfr,"validateCookieName");function nfr(t){let e=t.length,r=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++r}for(;r126||n===34||n===44||n===59||n===92)throw new Error("Invalid cookie value")}}a(nfr,"validateCookieValue");function dKn(t){for(let e=0;e126||r===59)throw new Error("Invalid cookie path")}}a(dKn,"validateCookiePath");function uKn(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122}a(uKn,"isLetterOrDigit");function _9s(t){if(t===" ")return;if(t.length>255)throw new Error("Invalid cookie domain");let e=0;for(let r=0;r63)throw new Error("Invalid cookie domain")}if(e===0||t.charCodeAt(t.length-1)===45)throw new Error("Invalid cookie domain")}a(_9s,"validateCookieDomain");var E9s=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],v9s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Clt=Array(61).fill(0).map((t,e)=>e.toString().padStart(2,"0"));function fKn(t){return typeof t=="number"&&(t=new Date(t)),`${E9s[t.getUTCDay()]}, ${Clt[t.getUTCDate()]} ${v9s[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Clt[t.getUTCHours()]}:${Clt[t.getUTCMinutes()]}:${Clt[t.getUTCSeconds()]} GMT`}a(fKn,"toIMFDate");function C9s(t){if(t<0)throw new Error("Invalid cookie max-age")}a(C9s,"validateCookieMaxAge");function b9s(t){if(t.name.length===0)return null;rfr(t.name),nfr(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(C9s(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(_9s(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(dKn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${fKn(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let r of t.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...o]=r.split("="),s=n.trim(),c=o.join("=");rfr(s),nfr(c),e.push(`${s}=${c}`)}return e.join("; ")}a(b9s,"stringify");pKn.exports={isCTLExcludingHtab:y9s,validateCookieName:rfr,validateCookiePath:dKn,validateCookieValue:nfr,toIMFDate:fKn,stringify:b9s}});var mKn=I((yCf,hKn)=>{"use strict";p();var{collectASequenceOfCodePointsFast:blt}=T8(),{maxNameValuePairSize:S9s,maxAttributeValueSize:T9s}=lKn(),{isCTLExcludingHtab:I9s}=ifr(),x9s=require("node:assert");function w9s(t){if(I9s(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=blt(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=blt("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>S9s?null:{name:n,value:o,...Jhe(r)}}a(w9s,"parseSetCookie");function Jhe(t,e={}){if(t.length===0)return e;x9s(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=blt(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=blt("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>T9s)return Jhe(t,e);let s=n.toLowerCase();if(s==="expires"){let c=new Date(o);e.expires=c}else if(s==="max-age"){let c=o.charCodeAt(0);if((c<48||c>57)&&o[0]!=="-"||!/^\d+$/.test(o))return Jhe(t,e);let l=Number(o);e.maxAge=l}else if(s==="domain"){let c=o;c[0]==="."&&(c=c.slice(1)),c=c.toLowerCase(),e.domain=c}else if(s==="path"){let c="";o.length===0||o[0]!=="/"?c="/":c=o,e.path=c}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let c=o.toLowerCase();c==="none"?e.sameSite="None":c==="strict"?e.sameSite="Strict":c==="lax"&&(e.sameSite="Lax")}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return Jhe(t,e)}a(Jhe,"parseUnparsedAttributes");hKn.exports={parseSetCookie:w9s,parseUnparsedAttributes:Jhe}});var _Kn=I((vCf,yKn)=>{"use strict";p();var{parseSetCookie:gKn}=mKn(),{stringify:R9s}=ifr(),{webidl:ic}=oy(),{Headers:k9s}=$X(),Slt=ic.brandCheckMultiple([k9s,globalThis.Headers].filter(Boolean));function P9s(t){ic.argumentLengthCheck(arguments,1,"getCookies"),Slt(t);let e=t.get("cookie"),r={};if(!e)return r;for(let n of e.split(";")){let[o,...s]=n.split("=");r[o.trim()]=s.join("=")}return r}a(P9s,"getCookies");function D9s(t,e,r){Slt(t);let n="deleteCookie";ic.argumentLengthCheck(arguments,2,n),e=ic.converters.DOMString(e,n,"name"),r=ic.converters.DeleteCookieAttributes(r),AKn(t,{name:e,value:"",expires:new Date(0),...r})}a(D9s,"deleteCookie");function N9s(t){ic.argumentLengthCheck(arguments,1,"getSetCookies"),Slt(t);let e=t.getSetCookie();return e?e.map(r=>gKn(r)):[]}a(N9s,"getSetCookies");function M9s(t){return t=ic.converters.DOMString(t),gKn(t)}a(M9s,"parseCookie");function AKn(t,e){ic.argumentLengthCheck(arguments,2,"setCookie"),Slt(t),e=ic.converters.Cookie(e);let r=R9s(e);r&&t.append("set-cookie",r,!0)}a(AKn,"setCookie");ic.converters.DeleteCookieAttributes=ic.dictionaryConverter([{converter:ic.nullableConverter(ic.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:ic.nullableConverter(ic.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);ic.converters.Cookie=ic.dictionaryConverter([{converter:ic.converters.DOMString,key:"name"},{converter:ic.converters.DOMString,key:"value"},{converter:ic.nullableConverter(t=>typeof t=="number"?ic.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:ic.nullableConverter(ic.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:ic.nullableConverter(ic.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:ic.nullableConverter(ic.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:ic.nullableConverter(ic.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:ic.nullableConverter(ic.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:ic.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:ic.sequenceConverter(ic.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);yKn.exports={getCookies:P9s,deleteCookie:D9s,getSetCookies:N9s,setCookie:AKn,parseCookie:M9s}});var xlt=I((SCf,vKn)=>{"use strict";p();var{webidl:fi}=oy(),{kEnumerableProperty:jb}=No(),{kConstruct:EKn}=Al(),Zhe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===EKn){super(arguments[1],arguments[2]),fi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";fi.argumentLengthCheck(arguments,1,n),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,fi.util.markAsUncloneable(this)}get data(){return fi.brandCheck(this,t),this.#e.data}get origin(){return fi.brandCheck(this,t),this.#e.origin}get lastEventId(){return fi.brandCheck(this,t),this.#e.lastEventId}get source(){return fi.brandCheck(this,t),this.#e.source}get ports(){return fi.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,r=!1,n=!1,o=null,s="",c="",l=null,u=[]){return fi.brandCheck(this,t),fi.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:r,cancelable:n,data:o,origin:s,lastEventId:c,source:l,ports:u})}static createFastMessageEvent(e,r){let n=new t(EKn,e,r);return n.#e=r,n.#e.data??=null,n.#e.origin??="",n.#e.lastEventId??="",n.#e.source??=null,n.#e.ports??=[],n}},{createFastMessageEvent:O9s}=Zhe;delete Zhe.createFastMessageEvent;var Tlt=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";fi.argumentLengthCheck(arguments,1,n),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.CloseEventInit(r),super(e,r),this.#e=r,fi.util.markAsUncloneable(this)}get wasClean(){return fi.brandCheck(this,t),this.#e.wasClean}get code(){return fi.brandCheck(this,t),this.#e.code}get reason(){return fi.brandCheck(this,t),this.#e.reason}},Ilt=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";fi.argumentLengthCheck(arguments,1,n),super(e,r),fi.util.markAsUncloneable(this),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return fi.brandCheck(this,t),this.#e.message}get filename(){return fi.brandCheck(this,t),this.#e.filename}get lineno(){return fi.brandCheck(this,t),this.#e.lineno}get colno(){return fi.brandCheck(this,t),this.#e.colno}get error(){return fi.brandCheck(this,t),this.#e.error}};Object.defineProperties(Zhe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:jb,origin:jb,lastEventId:jb,source:jb,ports:jb,initMessageEvent:jb});Object.defineProperties(Tlt.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:jb,code:jb,wasClean:jb});Object.defineProperties(Ilt.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:jb,filename:jb,lineno:jb,colno:jb,error:jb});fi.converters.MessagePort=fi.interfaceConverter(fi.is.MessagePort,"MessagePort");fi.converters["sequence"]=fi.sequenceConverter(fi.converters.MessagePort);var ofr=[{key:"bubbles",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];fi.converters.MessageEventInit=fi.dictionaryConverter([...ofr,{key:"data",converter:fi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:fi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:fi.nullableConverter(fi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:fi.converters["sequence"],defaultValue:a(()=>[],"defaultValue")}]);fi.converters.CloseEventInit=fi.dictionaryConverter([...ofr,{key:"wasClean",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:fi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);fi.converters.ErrorEventInit=fi.dictionaryConverter([...ofr,{key:"message",converter:fi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:fi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:fi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:fi.converters.any}]);vKn.exports={MessageEvent:Zhe,CloseEvent:Tlt,ErrorEvent:Ilt,createFastMessageEvent:O9s}});var JH=I((xCf,CKn)=>{"use strict";p();var L9s="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",B9s={enumerable:!0,writable:!1,configurable:!1},F9s={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},U9s={SENT:1,RECEIVED:2},Q9s={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},q9s=65535,j9s={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},H9s=Buffer.allocUnsafe(0),G9s={text:1,typedArray:2,arrayBuffer:3,blob:4};CKn.exports={uid:L9s,sentCloseFrameState:U9s,staticPropertyDescriptors:B9s,states:F9s,opcodes:Q9s,maxUnsigned16Bit:q9s,parserStates:j9s,emptyBuffer:H9s,sendHints:G9s}});var KX=I((RCf,xKn)=>{"use strict";p();var{states:wlt,opcodes:Xhe}=JH(),{isUtf8:$9s}=require("node:buffer"),{removeHTTPWhitespace:bKn}=sR(),{collectASequenceOfCodePointsFast:V9s}=T8();function W9s(t){return t===wlt.CONNECTING}a(W9s,"isConnecting");function z9s(t){return t===wlt.OPEN}a(z9s,"isEstablished");function Y9s(t){return t===wlt.CLOSING}a(Y9s,"isClosing");function K9s(t){return t===wlt.CLOSED}a(K9s,"isClosed");function J9s(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(J9s,"fireEvent");function Z9s(t,e,r){t.onMessage(e,r)}a(Z9s,"websocketMessageReceived");function X9s(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(X9s,"toArrayBuffer");function e7s(t){if(t.length===0)return!1;for(let e=0;e126||r===34||r===40||r===41||r===44||r===47||r===58||r===59||r===60||r===61||r===62||r===63||r===64||r===91||r===92||r===93||r===123||r===125)return!1}return!0}a(e7s,"isValidSubprotocol");function t7s(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(t7s,"isValidStatusCode");function SKn(t){return t===Xhe.CLOSE||t===Xhe.PING||t===Xhe.PONG}a(SKn,"isControlFrame");function TKn(t){return t===Xhe.CONTINUATION}a(TKn,"isContinuationFrame");function IKn(t){return t===Xhe.TEXT||t===Xhe.BINARY}a(IKn,"isTextBinaryFrame");function r7s(t){return IKn(t)||TKn(t)||SKn(t)}a(r7s,"isValidOpcode");function n7s(t){let e={position:0},r=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}a(i7s,"isValidClientWindowBits");function o7s(t,e){let r;try{r=new URL(t,e)}catch(n){throw new DOMException(n,"SyntaxError")}if(r.protocol==="http:"?r.protocol="ws:":r.protocol==="https:"&&(r.protocol="wss:"),r.protocol!=="ws:"&&r.protocol!=="wss:")throw new DOMException("expected a ws: or wss: url","SyntaxError");if(r.hash.length||r.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return r}a(o7s,"getURLRecord");function s7s(t,e){if(t!==null&&t!==1e3&&(t<3e3||t>4999))throw new DOMException("invalid code","InvalidAccessError");if(e!==null){let r=Buffer.byteLength(e);if(r>123)throw new DOMException(`Reason must be less than 123 bytes; received ${r}`,"SyntaxError")}}a(s7s,"validateCloseCodeAndReason");var a7s=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if($9s(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();xKn.exports={isConnecting:W9s,isEstablished:z9s,isClosing:Y9s,isClosed:K9s,fireEvent:J9s,isValidSubprotocol:e7s,isValidStatusCode:t7s,websocketMessageReceived:Z9s,utf8Decode:a7s,isControlFrame:SKn,isContinuationFrame:TKn,isTextBinaryFrame:IKn,isValidOpcode:r7s,parseExtensions:n7s,isValidClientWindowBits:i7s,toArrayBuffer:X9s,getURLRecord:o7s,validateCloseCodeAndReason:s7s}});var tme=I((DCf,RKn)=>{"use strict";p();var{runtimeFeatures:c7s}=I8(),{maxUnsigned16Bit:wKn,opcodes:l7s}=JH(),Rlt=8*1024,HDe=null,eme=Rlt,u7s=c7s.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;owKn?(c+=8,s=127):o>125&&(c+=2,s=126);let l=Buffer.allocUnsafe(o+c);l[0]=l[1]=0,l[0]|=128,l[0]=(l[0]&240)+e;l[c-4]=n[0],l[c-3]=n[1],l[c-2]=n[2],l[c-1]=n[3],l[1]=s,s===126?l.writeUInt16BE(o,2):s===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),l[1]|=128;for(let u=0;uwKn?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|l7s.TEXT,c[1]=o|128,c[s-4]=r[0],c[s-3]=r[1],c[s-2]=r[2],c[s-1]=r[3],o===126?c.writeUInt16BE(n,2):o===127&&(c[2]=c[3]=0,c.writeUIntBE(n,4,6)),[c,e]}};RKn.exports={WebsocketFrameSend:afr,generateMask:sfr}});var klt=I((OCf,OKn)=>{"use strict";p();var{uid:d7s,states:cfr,sentCloseFrameState:lfr,emptyBuffer:kKn,opcodes:f7s}=JH(),{parseExtensions:p7s,isClosed:h7s,isClosing:m7s,isEstablished:NKn,isConnecting:g7s,validateCloseCodeAndReason:A7s}=KX(),{makeRequest:y7s}=Yhe(),{fetching:_7s}=UDe(),{Headers:E7s,getHeadersList:v7s}=$X(),{getDecodeSplit:C7s}=VT(),{WebsocketFrameSend:b7s}=tme(),S7s=require("node:assert"),{runtimeFeatures:T7s}=I8(),PKn=T7s.has("crypto")?require("node:crypto"):null,DKn=!1;function I7s(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=y7s({urlList:[s],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error",useURLCredentials:!0});if(o.headers){let f=v7s(new E7s(o.headers));c.headersList=f}let l=PKn.randomBytes(16).toString("base64");c.headersList.append("sec-websocket-key",l,!0),c.headersList.append("sec-websocket-version","13",!0);for(let f of e)c.headersList.append("sec-websocket-protocol",f,!0);return c.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits",!0),_7s({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){b4(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){b4(n,1002,"Received network error or non-200 status code.",f.error);return}}if(DKn===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),DKn=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){b4(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){b4(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){b4(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=PKn.hash("sha1",l+d7s,"base64");if(h!==m){b4(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=p7s(g),!A.has("permessage-deflate"))){b4(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!C7s("sec-websocket-protocol",c.headersList).includes(y)){b4(n,1002,"Protocol was not set in the opening handshake.");return}f.socket.on("data",n.onSocketData),f.socket.on("close",n.onSocketClose),f.socket.on("error",n.onSocketError),n.wasEverConnected=!0,n.onConnectionEstablished(f,A)}})}a(I7s,"establishWebSocketConnection");function MKn(t,e,r,n=!1){if(e??=null,r??="",n&&A7s(e,r),!(h7s(t.readyState)||m7s(t.readyState)))if(!NKn(t.readyState))b4(t),t.readyState=cfr.CLOSING;else if(!t.closeState.has(lfr.SENT)&&!t.closeState.has(lfr.RECEIVED)){let o=new b7s;r.length!==0&&e===null&&(e=1e3),S7s(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=kKn:e!==null&&r===null?(o.frameData=Buffer.allocUnsafe(2),o.frameData.writeUInt16BE(e,0)):e!==null&&r!==null?(o.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(r)),o.frameData.writeUInt16BE(e,0),o.frameData.write(r,2,"utf-8")):o.frameData=kKn,t.socket.write(o.createFrame(f7s.CLOSE)),t.closeState.add(lfr.SENT),t.readyState=cfr.CLOSING}else t.readyState=cfr.CLOSING}a(MKn,"closeWebSocketConnection");function b4(t,e,r,n){NKn(t.readyState)&&MKn(t,e,r,!1),t.controller.abort(),g7s(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(b4,"failWebsocketConnection");OKn.exports={establishWebSocketConnection:I7s,failWebsocketConnection:b4,closeWebSocketConnection:MKn}});var BKn=I((FCf,LKn)=>{"use strict";p();var{createInflateRaw:x7s,Z_DEFAULT_WINDOWBITS:w7s}=require("node:zlib"),{isValidClientWindowBits:R7s}=KX(),{MessageSizeExceededError:k7s}=uo(),P7s=Buffer.from([0,0,255,255]),Plt=Symbol("kBuffer"),GDe=Symbol("kLength"),ufr=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=0;constructor(e,r){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits"),this.#r=r.maxPayloadSize}decompress(e,r,n){if(!this.#e){let o=w7s;if(this.#t.serverMaxWindowBits){if(!R7s(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=x7s({windowBits:o})}catch(s){n(s);return}this.#e[Plt]=[],this.#e[GDe]=0,this.#e.on("data",s=>{if(this.#e[GDe]+=s.length,this.#r>0&&this.#e[GDe]>this.#r){n(new k7s),this.#e.removeAllListeners(),this.#e=null;return}this.#e[Plt].push(s)}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#e.write(e),r&&this.#e.write(P7s),this.#e.flush(()=>{if(!this.#e)return;let o=Buffer.concat(this.#e[Plt],this.#e[GDe]);this.#e[Plt].length=0,this.#e[GDe]=0,n(null,o)})}};LKn.exports={PerMessageDeflate:ufr}});var hfr=I((qCf,jKn)=>{"use strict";p();var{Writable:D7s}=require("node:stream"),N7s=require("node:assert"),{parserStates:Hb,opcodes:rme,states:M7s,emptyBuffer:FKn,sentCloseFrameState:$De}=JH(),{isValidStatusCode:O7s,isValidOpcode:L7s,websocketMessageReceived:UKn,utf8Decode:B7s,isControlFrame:dfr,isTextBinaryFrame:ffr,isContinuationFrame:F7s}=KX(),{failWebsocketConnection:q_}=klt(),{WebsocketFrameSend:QKn}=tme(),{PerMessageDeflate:U7s}=BKn(),{MessageSizeExceededError:qKn}=uo(),pfr=class extends D7s{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=Hb.INFO;#o={};#s=[];#a;#c;#u;#l;constructor(e,r,n={}){super(),this.#c=e,this.#a=r??new Map,this.#u=n.maxFragments??0,this.#l=n.maxPayloadSize??0,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new U7s(r,n))}_write(e,r,n){this.#e.push(e),this.#r+=e.length,this.#n=!0,this.run(n)}#p(){return this.#l>0&&!dfr(this.#o.opcode)&&this.#o.payloadLength+this.#t>this.#l?(q_(this.#c,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#n;)if(this.#i===Hb.INFO){if(this.#r<2)return e();let r=this.consume(2),n=(r[0]&128)!==0,o=r[0]&15,s=(r[1]&128)===128,c=!n&&o!==rme.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!L7s(o))return q_(this.#c,1002,"Invalid opcode received"),e();if(s)return q_(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){q_(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){q_(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!ffr(o)){q_(this.#c,1002,"Invalid frame type was fragmented.");return}if(ffr(o)&&this.#s.length>0){q_(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){q_(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&dfr(o)){q_(this.#c,1002,"Control frame either too large or fragmented");return}if(F7s(o)&&this.#s.length===0&&!this.#o.compressed){q_(this.#c,1002,"Unexpected continuation frame");return}if(l<=125){if(this.#o.payloadLength=l,this.#i=Hb.READ_DATA,!this.#p())return}else l===126?this.#i=Hb.PAYLOADLENGTH_16:l===127&&(this.#i=Hb.PAYLOADLENGTH_64);ffr(o)&&(this.#o.binaryType=o,this.#o.compressed=u!==0),this.#o.opcode=o,this.#o.masked=s,this.#o.fin=n,this.#o.fragmented=c}else if(this.#i===Hb.PAYLOADLENGTH_16){if(this.#r<2)return e();let r=this.consume(2);if(this.#o.payloadLength=r.readUInt16BE(0),this.#i=Hb.READ_DATA,!this.#p())return}else if(this.#i===Hb.PAYLOADLENGTH_64){if(this.#r<8)return e();let r=this.consume(8),n=r.readUInt32BE(0),o=r.readUInt32BE(4);if(n!==0||o>2**31-1){q_(this.#c,1009,"Received payload length > 2^31 bytes.");return}if(this.#o.payloadLength=o,this.#i=Hb.READ_DATA,!this.#p())return}else if(this.#i===Hb.READ_DATA){if(this.#r{if(n){let s=n instanceof qKn?1009:1007;q_(this.#c,s,n.message);return}if(this.writeFragments(o)){if(this.#l>0&&this.#t>this.#l){q_(this.#c,1009,new qKn().message);return}if(!this.#o.fin){this.#i=Hb.INFO,this.#n=!0,this.run(e);return}UKn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=Hb.INFO,this.run(e)}},this.#t),this.#n=!1;break}else{if(!this.writeFragments(r))return;!this.#o.fragmented&&this.#o.fin&&UKn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#i=Hb.INFO}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return FKn;this.#r-=e;let r=this.#e[0];if(r.length>e)return this.#e[0]=r.subarray(e,r.length),r.subarray(0,e);if(r.length===e)return this.#e.shift();{let n=0,o=Buffer.allocUnsafeSlow(e);for(;n!==e;){let s=this.#e[0],c=s.length;if(c+n===e){o.set(this.#e.shift(),n);break}else if(c+n>e){o.set(s.subarray(0,e-n),n),this.#e[0]=s.subarray(e-n);break}else o.set(this.#e.shift(),n),n+=c}return o}}writeFragments(e){return this.#u>0&&this.#s.length===this.#u?(q_(this.#c,1008,"Too many message fragments"),!1):(this.#t+=e.length,this.#s.push(e),!0)}consumeFragments(){let e=this.#s;if(e.length===1)return this.#t=0,e.shift();let r=0,n=Buffer.allocUnsafeSlow(this.#t);for(let o=0;o=2&&(r=e.readUInt16BE(0)),r!==void 0&&!O7s(r))return{code:1002,reason:"Invalid status code",error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=B7s(n)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:r,reason:n,error:!1}}parseControlFrame(e){let{opcode:r,payloadLength:n}=this.#o;if(r===rme.CLOSE){if(n===1)return q_(this.#c,1002,"Received close frame with a 1-byte body."),!1;if(this.#o.closeInfo=this.parseCloseBody(e),this.#o.closeInfo.error){let{code:o,reason:s}=this.#o.closeInfo;return q_(this.#c,o,s),!1}if(!this.#c.closeState.has($De.SENT)&&!this.#c.closeState.has($De.RECEIVED)){let o=FKn;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new QKn(o);this.#c.socket.write(s.createFrame(rme.CLOSE)),this.#c.closeState.add($De.SENT)}return this.#c.readyState=M7s.CLOSING,this.#c.closeState.add($De.RECEIVED),!1}else if(r===rme.PING){if(!this.#c.closeState.has($De.RECEIVED)){let o=new QKn(e);this.#c.socket.write(o.createFrame(rme.PONG)),this.#c.onPing(e)}}else r===rme.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};jKn.exports={ByteParser:pfr}});var VKn=I((GCf,$Kn)=>{"use strict";p();var{WebsocketFrameSend:GKn}=tme(),{opcodes:HKn,sendHints:JX}=JH(),Q7s=Olr(),gfr=class{static{a(this,"SendQueue")}#e=new Q7s;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==JX.blob){if(this.#t){let s={promise:null,callback:r,frame:mfr(e,n)};this.#e.push(s)}else if(n===JX.text){let{0:s,1:c}=GKn.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(mfr(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=mfr(s,n)}),callback:r,frame:null};this.#e.push(o),this.#t||this.#n()}async#n(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let r=e.shift();r.promise!==null&&await r.promise,this.#r.write(r.frame,r.callback),r.callback=r.frame=null}this.#t=!1}};function mfr(t,e){return new GKn(q7s(t,e)).createFrame(e===JX.text?HKn.TEXT:HKn.BINARY)}a(mfr,"createFrame");function q7s(t,e){switch(e){case JX.text:case JX.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case JX.arrayBuffer:case JX.blob:return new Uint8Array(t)}}a(q7s,"toBuffer");$Kn.exports={SendQueue:gfr}});var ZKn=I((WCf,JKn)=>{"use strict";p();var{isArrayBuffer:j7s}=require("node:util/types"),{webidl:yi}=oy(),{URLSerializer:H7s}=sR(),{environmentSettingsObject:WKn}=VT(),{staticPropertyDescriptors:ZH,states:B8,sentCloseFrameState:Afr,sendHints:Dlt,opcodes:yfr}=JH(),{isConnecting:G7s,isEstablished:zKn,isClosing:YKn,isClosed:$7s,isValidSubprotocol:V7s,fireEvent:Nlt,utf8Decode:W7s,toArrayBuffer:z7s,getURLRecord:Y7s}=KX(),{establishWebSocketConnection:K7s,closeWebSocketConnection:J7s,failWebsocketConnection:KKn}=klt(),{ByteParser:Z7s}=hfr(),{kEnumerableProperty:hR}=No(),{getGlobalDispatcher:X7s}=Kct(),{ErrorEvent:eQs,CloseEvent:tQs,createFastMessageEvent:rQs}=xlt(),{SendQueue:nQs}=VKn(),{WebsocketFrameSend:iQs}=tme(),{channels:S4}=kH();function oQs(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(oQs,"getSocketAddress");var Pv=class t extends EventTarget{static{a(this,"WebSocket")}#e={open:null,error:null,close:null,message:null};#t=0;#r="";#n="";#i;#o={onConnectionEstablished:a((e,r)=>this.#u(e,r),"onConnectionEstablished"),onMessage:a((e,r)=>this.#l(e,r),"onMessage"),onParserError:a(e=>KKn(this.#o,null,e.message),"onParserError"),onParserDrain:a(()=>this.#p(),"onParserDrain"),onSocketData:a(e=>{this.#c.write(e)||this.#o.socket.pause()},"onSocketData"),onSocketError:a(e=>{this.#o.readyState=B8.CLOSING,S4.socketError.hasSubscribers&&S4.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{S4.ping.hasSubscribers&&S4.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{S4.pong.hasSubscribers&&S4.pong.publish({payload:e,websocket:this})},"onPong"),readyState:B8.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),yi.util.markAsUncloneable(this);let n="WebSocket constructor";yi.argumentLengthCheck(arguments,1,n);let o=yi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=yi.converters.USVString(e),r=o.protocols;let s=WKn.settingsObject.baseUrl,c=Y7s(e,s);if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(u=>u.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(u=>V7s(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=WKn.settingsObject;this.#o.controller=K7s(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){yi.brandCheck(this,t),e!==void 0&&(e=yi.converters["unsigned short"](e,"WebSocket.close","code",yi.attributes.Clamp)),r!==void 0&&(r=yi.converters.USVString(r)),e??=null,r??="",J7s(this.#o,e,r,!0)}send(e){yi.brandCheck(this,t);let r="WebSocket.send";if(yi.argumentLengthCheck(arguments,1,r),e=yi.converters.WebSocketSendData(e,r,"data"),G7s(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!zKn(this.#o.readyState)||YKn(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},Dlt.text)}else j7s(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Dlt.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Dlt.typedArray)):yi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Dlt.blob))}get readyState(){return yi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return yi.brandCheck(this,t),this.#t}get url(){return yi.brandCheck(this,t),H7s(this.#s)}get extensions(){return yi.brandCheck(this,t),this.#n}get protocol(){return yi.brandCheck(this,t),this.#r}get onopen(){return yi.brandCheck(this,t),this.#e.open}set onopen(e){yi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=yi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return yi.brandCheck(this,t),this.#e.error}set onerror(e){yi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=yi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return yi.brandCheck(this,t),this.#e.close}set onclose(e){yi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=yi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return yi.brandCheck(this,t),this.#e.message}set onmessage(e){yi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=yi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return yi.brandCheck(this,t),this.#a}set binaryType(e){yi.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this.#a="blob":this.#a=e}#u(e,r){this.#o.socket=e.socket;let n=this.#o.controller.dispatcher?.webSocketOptions,o=n?.maxFragments,s=n?.maxPayloadSize,c=new Z7s(this.#o,r,{maxFragments:o,maxPayloadSize:s});c.on("drain",()=>this.#o.onParserDrain()),c.on("error",d=>this.#o.onParserError(d)),this.#c=c,this.#i=new nQs(e.socket),this.#o.readyState=B8.OPEN;let l=e.headersList.get("sec-websocket-extensions");l!==null&&(this.#n=l);let u=e.headersList.get("sec-websocket-protocol");if(u!==null&&(this.#r=u),Nlt("open",this),S4.open.hasSubscribers){let d=e.headersList.entries;S4.open.publish({address:oQs(e.socket),protocol:this.#r,extensions:this.#n,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:d}})}}#l(e,r){if(this.#o.readyState!==B8.OPEN)return;let n;if(e===yfr.TEXT)try{n=W7s(r)}catch{KKn(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===yfr.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=z7s(r));Nlt("message",this,rQs,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(Afr.SENT)&&this.#o.closeState.has(Afr.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=B8.CLOSED,this.#o.closeState.has(Afr.RECEIVED)||(r=1006,Nlt("error",this,(s,c)=>new eQs(s,c),{error:new TypeError(n)})),Nlt("close",this,(s,c)=>new tQs(s,c),{wasClean:e,code:r,reason:n}),S4.close.hasSubscribers&&S4.close.publish({websocket:this,code:r,reason:n})}static ping(e,r){if(Buffer.isBuffer(r)){if(r.length>125)throw new TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(r!==void 0)throw new TypeError("Expected buffer payload");let n=e.#o.readyState;if(zKn(n)&&!YKn(n)&&!$7s(n)){let o=new iQs(r);e.#o.socket.write(o.createFrame(yfr.PING))}}},{ping:sQs}=Pv;Reflect.deleteProperty(Pv,"ping");Pv.CONNECTING=Pv.prototype.CONNECTING=B8.CONNECTING;Pv.OPEN=Pv.prototype.OPEN=B8.OPEN;Pv.CLOSING=Pv.prototype.CLOSING=B8.CLOSING;Pv.CLOSED=Pv.prototype.CLOSED=B8.CLOSED;Object.defineProperties(Pv.prototype,{CONNECTING:ZH,OPEN:ZH,CLOSING:ZH,CLOSED:ZH,url:hR,readyState:hR,bufferedAmount:hR,onopen:hR,onerror:hR,onclose:hR,close:hR,onmessage:hR,binaryType:hR,send:hR,extensions:hR,protocol:hR,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(Pv,{CONNECTING:ZH,OPEN:ZH,CLOSING:ZH,CLOSED:ZH});yi.converters["sequence"]=yi.sequenceConverter(yi.converters.DOMString);yi.converters["DOMString or sequence"]=function(t,e,r){return yi.util.Type(t)===yi.util.Types.OBJECT&&Symbol.iterator in t?yi.converters["sequence"](t):yi.converters.DOMString(t,e,r)};yi.converters.WebSocketInit=yi.dictionaryConverter([{key:"protocols",converter:yi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:yi.converters.any,defaultValue:a(()=>X7s(),"defaultValue")},{key:"headers",converter:yi.nullableConverter(yi.converters.HeadersInit)}]);yi.converters["DOMString or sequence or WebSocketInit"]=function(t){return yi.util.Type(t)===yi.util.Types.OBJECT&&!(Symbol.iterator in t)?yi.converters.WebSocketInit(t):{protocols:yi.converters["DOMString or sequence"](t)}};yi.converters.WebSocketSendData=function(t){return yi.util.Type(t)===yi.util.Types.OBJECT&&(yi.is.Blob(t)||yi.is.BufferSource(t))?t:yi.converters.USVString(t)};JKn.exports={WebSocket:Pv,ping:sQs}});var _fr=I((KCf,tJn)=>{"use strict";p();var{webidl:Mlt}=oy(),{validateCloseCodeAndReason:aQs}=KX(),{kConstruct:XKn}=Al(),{kEnumerableProperty:eJn}=No();function cQs(){class t extends DOMException{static{a(this,"Test")}get reason(){return""}}return new t().reason!==void 0?DOMException:new Proxy(DOMException,{construct(e,r,n){let o=Reflect.construct(e,r,e);return Object.setPrototypeOf(o,n.prototype),o}})}a(cQs,"createInheritableDOMException");var ZX=class t extends cQs(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=Mlt.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===XKn)return;r!==null&&(r=Mlt.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";aQs(n,o),o.length!==0&&n===null&&(n=1e3),this.#e=n,this.#t=o}get closeCode(){return this.#e}get reason(){return this.#t}static createUnvalidatedWebSocketError(e,r,n){let o=new t(e,XKn);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:lQs}=ZX;delete ZX.createUnvalidatedWebSocketError;Object.defineProperties(ZX.prototype,{closeCode:eJn,reason:eJn,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});Mlt.is.WebSocketError=Mlt.util.MakeTypeAssertion(ZX);tJn.exports={WebSocketError:ZX,createUnvalidatedWebSocketError:lQs}});var sJn=I((XCf,oJn)=>{"use strict";p();var{createDeferredPromise:Efr}=Z2e(),{environmentSettingsObject:rJn}=VT(),{states:nme,opcodes:Olt,sentCloseFrameState:ime}=JH(),{webidl:Ip}=oy(),{getURLRecord:uQs,isValidSubprotocol:dQs,isEstablished:fQs,utf8Decode:pQs}=KX(),{establishWebSocketConnection:hQs,failWebsocketConnection:vfr,closeWebSocketConnection:Cfr}=klt(),{channels:nJn}=kH(),{WebsocketFrameSend:mQs}=tme(),{ByteParser:gQs}=hfr(),{WebSocketError:AQs,createUnvalidatedWebSocketError:yQs}=_fr(),{kEnumerableProperty:Llt}=No(),{utf8DecodeBytes:_Qs}=rct(),iJn=!1,Blt=class{static{a(this,"WebSocketStream")}#e;#t;#r;#n;#i;#o;#s=!1;#a={onConnectionEstablished:a((e,r)=>this.#l(e,r),"onConnectionEstablished"),onMessage:a((e,r)=>this.#p(e,r),"onMessage"),onParserError:a(e=>vfr(this.#a,null,e.message),"onParserError"),onParserDrain:a(()=>this.#a.socket.resume(),"onParserDrain"),onSocketData:a(e=>{this.#c.write(e)||this.#a.socket.pause()},"onSocketData"),onSocketError:a(e=>{this.#a.readyState=nme.CLOSING,nJn.socketError.hasSubscribers&&nJn.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:nme.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){iJn||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),iJn=!0),Ip.argumentLengthCheck(arguments,1,"WebSocket"),e=Ip.converters.USVString(e),r!==null&&(r=Ip.converters.WebSocketStreamOptions(r));let n=rJn.settingsObject.baseUrl,o=uQs(e,n),s=r.protocols;if(s.length!==new Set(s.map(l=>l.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(s.length>0&&!s.every(l=>dQs(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=Efr(),this.#r=Efr(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{fQs(this.#a.readyState)||(vfr(this.#a),this.#a.readyState=nme.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=rJn.settingsObject;this.#a.controller=hQs(o,s,c,this.#a,r)}get url(){return this.#e.toString()}get opened(){return this.#t.promise}get closed(){return this.#r.promise}close(e=void 0){e!==null&&(e=Ip.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;Cfr(this.#a,r,n,!0)}#u(e){e=Ip.converters.WebSocketStreamWrite(e);let r=Efr(),n=null,o=null;if(Ip.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=Olt.BINARY;else{let s;try{s=Ip.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=Olt.TEXT}if(!this.#a.closeState.has(ime.SENT)&&!this.#a.closeState.has(ime.RECEIVED)){let s=new mQs(n);this.#a.socket.write(s.createFrame(o),()=>{r.resolve(void 0)})}return r.promise}#l(e,r){this.#a.socket=e.socket;let n=this.#a.controller.dispatcher?.webSocketOptions?.maxFragments,o=this.#a.controller.dispatcher?.webSocketOptions?.maxPayloadSize,s=new gQs(this.#a,r,{maxFragments:n,maxPayloadSize:o});s.on("drain",()=>this.#a.onParserDrain()),s.on("error",f=>this.#a.onParserError(f)),this.#c=s,this.#a.readyState=nme.OPEN;let c=r??"",l=e.headersList.get("sec-websocket-protocol")??"",u=new ReadableStream({start:a(f=>{this.#i=f},"start"),cancel:a(f=>this.#h(f),"cancel")}),d=new WritableStream({write:a(f=>this.#u(f),"write"),close:a(()=>Cfr(this.#a,null,null),"close"),abort:a(f=>this.#A(f),"abort")});this.#n=u,this.#o=d,this.#t.resolve({extensions:c,protocol:l,readable:u,writable:d})}#p(e,r){if(this.#a.readyState!==nme.OPEN)return;let n;if(e===Olt.TEXT)try{n=pQs(r)}catch{vfr(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===Olt.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(ime.SENT)&&this.#a.closeState.has(ime.RECEIVED);if(this.#a.readyState=nme.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new AQs("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(ime.SENT)&&!this.#a.closeState.has(ime.RECEIVED)&&(n=1006);let o=r?.reason==null?"":_Qs(Buffer.from(r.reason));if(e)this.#i.close(),this.#o.locked||this.#o.abort(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#r.resolve({closeCode:n,reason:o});else{let s=yQs("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";Ip.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),Cfr(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(Blt.prototype,{url:Llt,opened:Llt,closed:Llt,close:Llt,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});Ip.converters.WebSocketStreamOptions=Ip.dictionaryConverter([{key:"protocols",converter:Ip.sequenceConverter(Ip.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:Ip.nullableConverter(Ip.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);Ip.converters.WebSocketCloseInfo=Ip.dictionaryConverter([{key:"closeCode",converter:a(t=>Ip.converters["unsigned short"](t,Ip.attributes.EnforceRange),"converter")},{key:"reason",converter:Ip.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);Ip.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?Ip.converters.USVString(t):Ip.converters.BufferSource(t)};oJn.exports={WebSocketStream:Blt}});var cJn=I((rbf,aJn)=>{"use strict";p();function EQs(t){return t.indexOf("\0")===-1}a(EQs,"isValidLastEventId");function vQs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(vQs,"isASCIINumber");aJn.exports={isValidLastEventId:EQs,isASCIINumber:vQs}});var fJn=I((obf,dJn)=>{"use strict";p();var{Transform:CQs}=require("node:stream"),{isASCIINumber:lJn,isValidLastEventId:uJn}=cJn(),F8=[239,187,191],bfr=10,Flt=13,bQs=58,SQs=32,Sfr=class extends CQs{static{a(this,"EventSourceStream")}state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,r,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===F8[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===F8[0]&&this.buffer[1]===F8[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===F8[0]&&this.buffer[1]===F8[1]&&this.buffer[2]===F8[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===F8[0]&&this.buffer[1]===F8[1]&&this.buffer[2]===F8[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&lJn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&uJn(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};dJn.exports={EventSourceStream:Sfr}});var EJn=I((cbf,_Jn)=>{"use strict";p();var{pipeline:TQs}=require("node:stream"),{fetching:IQs}=UDe(),{makeRequest:xQs}=Yhe(),{webidl:Dv}=oy(),{EventSourceStream:wQs}=fJn(),{parseMIMEType:RQs}=sR(),{createFastMessageEvent:kQs}=xlt(),{isNetworkError:pJn}=LDe(),{kEnumerableProperty:eee}=No(),{environmentSettingsObject:hJn}=VT(),mJn=!1,gJn=3e3,VDe=0,AJn=1,WDe=2,PQs="anonymous",DQs="use-credentials",ome=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=VDe;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),Dv.util.markAsUncloneable(this);let n="EventSource constructor";Dv.argumentLengthCheck(arguments,1,n),mJn||(mJn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=Dv.converters.USVString(e),r=Dv.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=hJn,s;try{s=new URL(e,o.settingsObject.baseUrl),this.#a.origin=s.origin}catch(u){throw new DOMException(u,"SyntaxError")}this.#t=s.href;let c=PQs;r.withCredentials===!0&&(c=DQs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=hJn.settingsObject,l.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],l.cache="no-store",l.initiator="other",l.urlList=[new URL(this.#t)],this.#i=xQs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===WDe)return;this.#n=VDe;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!pJn(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(pJn(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#u();return}let o=n.headersList.get("content-type",!0),s=o!==null?RQs(o):"failure",c=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||c===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=AJn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new wQs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(kQs(u.type,u.options))},"push")});TQs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=IQs(e)}#u(){this.#n!==WDe&&(this.#n=VDe,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===VDe&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){Dv.brandCheck(this,t),this.#n!==WDe&&(this.#n=WDe,this.#o.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open);let r=Dv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message);let r=Dv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error);let r=Dv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},yJn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:VDe,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:AJn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:WDe,writable:!1}};Object.defineProperties(ome,yJn);Object.defineProperties(ome.prototype,yJn);Object.defineProperties(ome.prototype,{close:eee,onerror:eee,onmessage:eee,onopen:eee,readyState:eee,url:eee,withCredentials:eee});Dv.converters.EventSourceInitDict=Dv.dictionaryConverter([{key:"withCredentials",converter:Dv.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:Dv.converters.any},{key:"node",converter:Dv.dictionaryConverter([{key:"reconnectionTime",converter:Dv.converters["unsigned long"],defaultValue:a(()=>gJn,"defaultValue")},{key:"dispatcher",converter:Dv.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);_Jn.exports={EventSource:ome,defaultReconnectionTime:gJn}});var Tfr=I((dbf,bn)=>{"use strict";p();var NQs=UH(),CJn=$2e(),MQs=RX(),OQs=s$n(),LQs=u$n(),BQs=DX(),FQs=cur(),UQs=iur(),QQs=Y$n(),qQs=rVn(),jQs=oVn(),bJn=uo(),Qlt=No(),{InvalidArgumentError:Ult}=bJn,sme=QVn(),HQs=yX(),GQs=Wur(),{MockCallHistory:$Qs,MockCallHistoryLog:VQs}=Kur(),WQs=odr(),zQs=edr(),YQs=UWn(),KQs=kur(),JQs=Oct(),{getGlobalDispatcher:SJn,setGlobalDispatcher:ZQs}=Kct(),XQs=Hhe(),eqs=pdr();Object.assign(CJn.prototype,sme);bn.exports.Dispatcher=CJn;bn.exports.Client=NQs;bn.exports.Pool=MQs;bn.exports.BalancedPool=OQs;bn.exports.RoundRobinPool=LQs;bn.exports.Agent=BQs;bn.exports.ProxyAgent=FQs;bn.exports.Socks5ProxyAgent=UQs;bn.exports.EnvHttpProxyAgent=QQs;bn.exports.RetryAgent=qQs;bn.exports.H2CClient=jQs;bn.exports.RetryHandler=JQs;bn.exports.DecoratorHandler=XQs;bn.exports.RedirectHandler=eqs;bn.exports.interceptors={redirect:KWn(),responseError:ZWn(),retry:ezn(),dump:rzn(),dns:szn(),cache:Fzn(),decompress:Hzn(),deduplicate:zzn()};bn.exports.cacheStores={MemoryCacheStore:wdr()};var tqs=Jzn();bn.exports.cacheStores.SqliteCacheStore=tqs;bn.exports.buildConnector=HQs;bn.exports.errors=bJn;bn.exports.util={parseHeaders:Qlt.parseHeaders,headerNameToString:Qlt.headerNameToString};function zDe(t){return(e,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new Ult("invalid url");if(r!=null&&typeof r!="object")throw new Ult("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new Ult("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Qlt.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Qlt.parseURL(e);let{agent:o,dispatcher:s=SJn()}=r;if(o)throw new Ult("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...r,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}a(zDe,"makeDispatcher");bn.exports.setGlobalDispatcher=ZQs;bn.exports.getGlobalDispatcher=SJn;var rqs=UDe().fetch,vJn=typeof __filename<"u"?__filename:void 0;function TJn(t,e){if(!t||typeof t!="object")return;let r=typeof t.stack=="string"?t.stack:"",n=e.replace(/\\/g,"/");if(r&&(r.includes(e)||r.includes(n)))return;let o={};if(Error.captureStackTrace(o,TJn),!o.stack)return;let s=o.stack.split(` `).slice(1).join(` `);t.stack=r?`${r} -${s}`:o.stack}a(bJn,"appendFetchStackTrace");bn.exports.fetch=a(function(e,r=void 0){return eqs(e,r).catch(n=>{throw _Jn?bJn(n,_Jn):n&&typeof n=="object"&&Error.captureStackTrace(n,bn.exports.fetch),n})},"fetch");bn.exports.Headers=GX().Headers;bn.exports.Response=LDe().Response;bn.exports.Request=zhe().Request;bn.exports.FormData=cct().FormData;var{setGlobalOrigin:tqs,getGlobalOrigin:rqs}=jcr();bn.exports.setGlobalOrigin=tqs;bn.exports.getGlobalOrigin=rqs;var{CacheStorage:nqs}=oKn(),{kConstruct:iqs}=Al();bn.exports.caches=new nqs(iqs);var{deleteCookie:oqs,getCookies:sqs,getSetCookies:aqs,setCookie:cqs,parseCookie:lqs}=AKn();bn.exports.deleteCookie=oqs;bn.exports.getCookies=sqs;bn.exports.getSetCookies=aqs;bn.exports.setCookie=cqs;bn.exports.parseCookie=lqs;var{parseMIMEType:uqs,serializeAMimeType:dqs}=sR();bn.exports.parseMIMEType=uqs;bn.exports.serializeAMimeType=dqs;var{CloseEvent:fqs,ErrorEvent:pqs,MessageEvent:hqs}=xlt(),{WebSocket:mqs,ping:gqs}=KKn();bn.exports.WebSocket=mqs;bn.exports.CloseEvent=fqs;bn.exports.ErrorEvent=pqs;bn.exports.MessageEvent=hqs;bn.exports.ping=gqs;bn.exports.WebSocketStream=iJn().WebSocketStream;bn.exports.WebSocketError=yfr().WebSocketError;bn.exports.request=zDe(ome.request);bn.exports.stream=zDe(ome.stream);bn.exports.pipeline=zDe(ome.pipeline);bn.exports.connect=zDe(ome.connect);bn.exports.upgrade=zDe(ome.upgrade);bn.exports.MockClient=jQs;bn.exports.MockCallHistory=HQs;bn.exports.MockCallHistoryLog=GQs;bn.exports.MockPool=VQs;bn.exports.MockAgent=$Qs;bn.exports.SnapshotAgent=WQs;bn.exports.mockErrors=zQs;var{EventSource:Aqs}=yJn();bn.exports.EventSource=Aqs;function yqs(){globalThis.fetch=bn.exports.fetch,globalThis.Headers=bn.exports.Headers,globalThis.Response=bn.exports.Response,globalThis.Request=bn.exports.Request,globalThis.FormData=bn.exports.FormData,globalThis.WebSocket=bn.exports.WebSocket,globalThis.CloseEvent=bn.exports.CloseEvent,globalThis.ErrorEvent=bn.exports.ErrorEvent,globalThis.MessageEvent=bn.exports.MessageEvent,globalThis.EventSource=bn.exports.EventSource}a(yqs,"install");bn.exports.install=yqs});var TJn=I((ybf,kfr)=>{p();kfr.exports=function(t){return SJn(vqs(t),t)};kfr.exports.array=SJn;function SJn(t,e){var r=t.length,n=new Array(r),o={},s=r,c=Cqs(e),l=bqs(t);for(e.forEach(function(d){if(!l.has(d[0])||!l.has(d[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)o[s]||u(t[s],s,new Set);return n;function u(d,f,h){if(h.has(d)){var m;try{m=", node was:"+JSON.stringify(d)}catch{m=""}throw new Error("Cyclic dependency"+m)}if(!l.has(d))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(d));if(!o[f]){o[f]=!0;var g=c.get(d)||new Set;if(g=Array.from(g),f=g.length){h.add(d);do{var A=g[--f];u(A,l.get(A),h)}while(f);h.delete(d)}n[--r]=d}}}a(SJn,"toposort");function vqs(t){for(var e=new Set,r=0,n=t.length;r=48&&x<=57)R=R*16+x-48;else if(x>=65&&x<=70)R=R*16+x-65+10;else if(x>=97&&x<=102)R=R*16+x-97+10;else break;n++,w++}return w=r){S+=t.substring(T,n),h=2;break}let w=t.charCodeAt(n);if(w===34){S+=t.substring(T,n),n++;break}if(w===92){if(S+=t.substring(T,n),n++,n>=r){h=2;break}switch(t.charCodeAt(n++)){case 34:S+='"';break;case 92:S+="\\";break;case 47:S+="/";break;case 98:S+="\b";break;case 102:S+="\f";break;case 110:S+=` -`;break;case 114:S+="\r";break;case 116:S+=" ";break;case 117:let x=m(4,!0);x>=0?S+=String.fromCharCode(x):h=4;break;default:h=5}T=n;continue}if(w>=0&&w<=31)if(uNe(w)){S+=t.substring(T,n),h=2;break}else h=6;n++}return S}a(y,"scanString");function _(){if(o="",h=0,s=n,u=l,f=d,n>=r)return s=r,c=17;let S=t.charCodeAt(n);if(Zfr(S)){do n++,o+=String.fromCharCode(S),S=t.charCodeAt(n);while(Zfr(S));return c=15}if(uNe(S))return n++,o+=String.fromCharCode(S),S===13&&t.charCodeAt(n)===10&&(n++,o+=` -`),l++,d=n,c=14;switch(S){case 123:return n++,c=1;case 125:return n++,c=2;case 91:return n++,c=3;case 93:return n++,c=4;case 58:return n++,c=6;case 44:return n++,c=5;case 34:return n++,o=y(),c=10;case 47:let T=n-1;if(t.charCodeAt(n+1)===47){for(n+=2;n=12&&S<=15);return S}return a(v,"scanNextNonTrivia"),{setPosition:g,getPosition:a(()=>n,"getPosition"),scan:e?v:_,getToken:a(()=>c,"getToken"),getTokenValue:a(()=>o,"getTokenValue"),getTokenOffset:a(()=>s,"getTokenOffset"),getTokenLength:a(()=>n-s,"getTokenLength"),getTokenStartLine:a(()=>u,"getTokenStartLine"),getTokenStartCharacter:a(()=>s-f,"getTokenStartCharacter"),getTokenError:a(()=>h,"getTokenError")}}function Zfr(t){return t===32||t===9}function uNe(t){return t===10||t===13}function pme(t){return t>=48&&t<=57}var RZn,dut=Se(()=>{"use strict";p();a(oee,"createScanner");a(Zfr,"isWhiteSpace");a(uNe,"isLineBreak");a(pme,"isDigit");(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(RZn||(RZn={}))});var iI,hme,Xfr,kZn,PZn=Se(()=>{p();iI=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),hme=200,Xfr={" ":{"\n":new Array(hme).fill(0).map((t,e)=>` +${s}`:o.stack}a(TJn,"appendFetchStackTrace");bn.exports.fetch=a(function(e,r=void 0){return rqs(e,r).catch(n=>{throw vJn?TJn(n,vJn):n&&typeof n=="object"&&Error.captureStackTrace(n,bn.exports.fetch),n})},"fetch");bn.exports.Headers=$X().Headers;bn.exports.Response=LDe().Response;bn.exports.Request=Yhe().Request;bn.exports.FormData=cct().FormData;var{setGlobalOrigin:nqs,getGlobalOrigin:iqs}=Hcr();bn.exports.setGlobalOrigin=nqs;bn.exports.getGlobalOrigin=iqs;var{CacheStorage:oqs}=aKn(),{kConstruct:sqs}=Al();bn.exports.caches=new oqs(sqs);var{deleteCookie:aqs,getCookies:cqs,getSetCookies:lqs,setCookie:uqs,parseCookie:dqs}=_Kn();bn.exports.deleteCookie=aqs;bn.exports.getCookies=cqs;bn.exports.getSetCookies=lqs;bn.exports.setCookie=uqs;bn.exports.parseCookie=dqs;var{parseMIMEType:fqs,serializeAMimeType:pqs}=sR();bn.exports.parseMIMEType=fqs;bn.exports.serializeAMimeType=pqs;var{CloseEvent:hqs,ErrorEvent:mqs,MessageEvent:gqs}=xlt(),{WebSocket:Aqs,ping:yqs}=ZKn();bn.exports.WebSocket=Aqs;bn.exports.CloseEvent=hqs;bn.exports.ErrorEvent=mqs;bn.exports.MessageEvent=gqs;bn.exports.ping=yqs;bn.exports.WebSocketStream=sJn().WebSocketStream;bn.exports.WebSocketError=_fr().WebSocketError;bn.exports.request=zDe(sme.request);bn.exports.stream=zDe(sme.stream);bn.exports.pipeline=zDe(sme.pipeline);bn.exports.connect=zDe(sme.connect);bn.exports.upgrade=zDe(sme.upgrade);bn.exports.MockClient=GQs;bn.exports.MockCallHistory=$Qs;bn.exports.MockCallHistoryLog=VQs;bn.exports.MockPool=zQs;bn.exports.MockAgent=WQs;bn.exports.SnapshotAgent=YQs;bn.exports.mockErrors=KQs;var{EventSource:_qs}=EJn();bn.exports.EventSource=_qs;function Eqs(){globalThis.fetch=bn.exports.fetch,globalThis.Headers=bn.exports.Headers,globalThis.Response=bn.exports.Response,globalThis.Request=bn.exports.Request,globalThis.FormData=bn.exports.FormData,globalThis.WebSocket=bn.exports.WebSocket,globalThis.CloseEvent=bn.exports.CloseEvent,globalThis.ErrorEvent=bn.exports.ErrorEvent,globalThis.MessageEvent=bn.exports.MessageEvent,globalThis.EventSource=bn.exports.EventSource}a(Eqs,"install");bn.exports.install=Eqs});var xJn=I((Ebf,Pfr)=>{p();Pfr.exports=function(t){return IJn(bqs(t),t)};Pfr.exports.array=IJn;function IJn(t,e){var r=t.length,n=new Array(r),o={},s=r,c=Sqs(e),l=Tqs(t);for(e.forEach(function(d){if(!l.has(d[0])||!l.has(d[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)o[s]||u(t[s],s,new Set);return n;function u(d,f,h){if(h.has(d)){var m;try{m=", node was:"+JSON.stringify(d)}catch{m=""}throw new Error("Cyclic dependency"+m)}if(!l.has(d))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(d));if(!o[f]){o[f]=!0;var g=c.get(d)||new Set;if(g=Array.from(g),f=g.length){h.add(d);do{var A=g[--f];u(A,l.get(A),h)}while(f);h.delete(d)}n[--r]=d}}}a(IJn,"toposort");function bqs(t){for(var e=new Set,r=0,n=t.length;r=48&&x<=57)R=R*16+x-48;else if(x>=65&&x<=70)R=R*16+x-65+10;else if(x>=97&&x<=102)R=R*16+x-97+10;else break;n++,w++}return w=r){S+=t.substring(T,n),h=2;break}let w=t.charCodeAt(n);if(w===34){S+=t.substring(T,n),n++;break}if(w===92){if(S+=t.substring(T,n),n++,n>=r){h=2;break}switch(t.charCodeAt(n++)){case 34:S+='"';break;case 92:S+="\\";break;case 47:S+="/";break;case 98:S+="\b";break;case 102:S+="\f";break;case 110:S+=` +`;break;case 114:S+="\r";break;case 116:S+=" ";break;case 117:let x=m(4,!0);x>=0?S+=String.fromCharCode(x):h=4;break;default:h=5}T=n;continue}if(w>=0&&w<=31)if(uNe(w)){S+=t.substring(T,n),h=2;break}else h=6;n++}return S}a(y,"scanString");function _(){if(o="",h=0,s=n,u=l,f=d,n>=r)return s=r,c=17;let S=t.charCodeAt(n);if(Xfr(S)){do n++,o+=String.fromCharCode(S),S=t.charCodeAt(n);while(Xfr(S));return c=15}if(uNe(S))return n++,o+=String.fromCharCode(S),S===13&&t.charCodeAt(n)===10&&(n++,o+=` +`),l++,d=n,c=14;switch(S){case 123:return n++,c=1;case 125:return n++,c=2;case 91:return n++,c=3;case 93:return n++,c=4;case 58:return n++,c=6;case 44:return n++,c=5;case 34:return n++,o=y(),c=10;case 47:let T=n-1;if(t.charCodeAt(n+1)===47){for(n+=2;n=12&&S<=15);return S}return a(v,"scanNextNonTrivia"),{setPosition:g,getPosition:a(()=>n,"getPosition"),scan:e?v:_,getToken:a(()=>c,"getToken"),getTokenValue:a(()=>o,"getTokenValue"),getTokenOffset:a(()=>s,"getTokenOffset"),getTokenLength:a(()=>n-s,"getTokenLength"),getTokenStartLine:a(()=>u,"getTokenStartLine"),getTokenStartCharacter:a(()=>s-f,"getTokenStartCharacter"),getTokenError:a(()=>h,"getTokenError")}}function Xfr(t){return t===32||t===9}function uNe(t){return t===10||t===13}function pme(t){return t>=48&&t<=57}var PZn,dut=Se(()=>{"use strict";p();a(see,"createScanner");a(Xfr,"isWhiteSpace");a(uNe,"isLineBreak");a(pme,"isDigit");(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(PZn||(PZn={}))});var iI,hme,epr,DZn,NZn=Se(()=>{p();iI=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),hme=200,epr={" ":{"\n":new Array(hme).fill(0).map((t,e)=>` `+" ".repeat(e)),"\r":new Array(hme).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(hme).fill(0).map((t,e)=>`\r `+" ".repeat(e))}," ":{"\n":new Array(hme).fill(0).map((t,e)=>` `+" ".repeat(e)),"\r":new Array(hme).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(hme).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}},kZn=[` +`+" ".repeat(e))}},DZn=[` `,"\r",`\r -`]});function fut(t,e,r){let n,o,s,c,l;if(e){for(c=e.offset,l=c+e.length,s=c;s>0&&!dNe(t,s-1);)s--;let w=l;for(;w1)return mme(u,f)+mme(m,n+h);let w=m.length*(n+h);return!d||w>Xfr[g][u].length?u+mme(m,n+h):w<=0?u:Xfr[g][u][w]}a(_,"newLinesAndIndent");function E(){let w=A.scan();for(f=0;w===15||w===14;)w===14&&r.keepLines?f+=1:w===14&&(f=1),w=A.scan();return y=w===16||A.getTokenError()!==0,w}a(E,"scanNext");let v=[];function S(w,R,x){!y&&(!e||Rc)&&t.substring(R,x)!==w&&v.push({offset:R,length:x-R,content:w})}a(S,"addEdit");let T=E();if(r.keepLines&&f>0&&S(mme(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?iI[m.length*n]:mme(m,n);S(R,s,w)}for(;T!==17;){let w=A.getTokenOffset()+A.getTokenLength()+s,R=E(),x="",k=!1;for(;f===0&&(R===12||R===13);){let N=A.getTokenOffset()+s;S(iI[1],w,N),w=A.getTokenOffset()+A.getTokenLength()+s,k=R===12,x=k?_():"",R=E()}if(R===2)T!==1&&h--,r.keepLines&&f>0||!r.keepLines&&T!==1?x=_():r.keepLines&&(x=iI[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=_():r.keepLines&&(x=iI[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=_():x=iI[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=_():x=iI[1];break;case 12:x=_();break;case 13:f>0?x=_():k||(x=iI[1]);break;case 6:r.keepLines&&f>0?x=_():k||(x=iI[1]);break;case 10:r.keepLines&&f>0?x=_():R===6&&!k&&(x="");break;case 7:case 8:case 9:case 11:case 2:case 4:r.keepLines&&f>0?x=_():(R===12||R===13)&&!k?x=iI[1]:R!==5&&R!==17&&(y=!0);break;case 16:y=!0;break}f>0&&(R===12||R===13)&&(x=_())}R===17&&(r.keepLines&&f>0?x=_():x=r.insertFinalNewline?u:"");let D=A.getTokenOffset()+s;S(x,w,D),T=R}return v}function mme(t,e){let r="";for(let n=0;n0&&!dNe(t,s-1);)s--;let w=l;for(;w1)return mme(u,f)+mme(m,n+h);let w=m.length*(n+h);return!d||w>epr[g][u].length?u+mme(m,n+h):w<=0?u:epr[g][u][w]}a(_,"newLinesAndIndent");function E(){let w=A.scan();for(f=0;w===15||w===14;)w===14&&r.keepLines?f+=1:w===14&&(f=1),w=A.scan();return y=w===16||A.getTokenError()!==0,w}a(E,"scanNext");let v=[];function S(w,R,x){!y&&(!e||Rc)&&t.substring(R,x)!==w&&v.push({offset:R,length:x-R,content:w})}a(S,"addEdit");let T=E();if(r.keepLines&&f>0&&S(mme(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?iI[m.length*n]:mme(m,n);S(R,s,w)}for(;T!==17;){let w=A.getTokenOffset()+A.getTokenLength()+s,R=E(),x="",k=!1;for(;f===0&&(R===12||R===13);){let N=A.getTokenOffset()+s;S(iI[1],w,N),w=A.getTokenOffset()+A.getTokenLength()+s,k=R===12,x=k?_():"",R=E()}if(R===2)T!==1&&h--,r.keepLines&&f>0||!r.keepLines&&T!==1?x=_():r.keepLines&&(x=iI[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=_():r.keepLines&&(x=iI[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=_():x=iI[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=_():x=iI[1];break;case 12:x=_();break;case 13:f>0?x=_():k||(x=iI[1]);break;case 6:r.keepLines&&f>0?x=_():k||(x=iI[1]);break;case 10:r.keepLines&&f>0?x=_():R===6&&!k&&(x="");break;case 7:case 8:case 9:case 11:case 2:case 4:r.keepLines&&f>0?x=_():(R===12||R===13)&&!k?x=iI[1]:R!==5&&R!==17&&(y=!0);break;case 16:y=!0;break}f>0&&(R===12||R===13)&&(x=_())}R===17&&(r.keepLines&&f>0?x=_():x=r.insertFinalNewline?u:"");let D=A.getTokenOffset()+s;S(x,w,D),T=R}return v}function mme(t,e){let r="";for(let n=0;n{"use strict";p();dut();PZn();a(fut,"format");a(mme,"repeat");a(aHs,"computeIndentLevel");a(cHs,"getEOL");a(dNe,"isEOL")});function DZn(t,e){let r=[],n=new Object,o,s={value:{},offset:0,length:0,type:"object",parent:void 0},c=!1;function l(u,d,f,h){s.value=u,s.offset=d,s.length=f,s.type=h,s.colonOffset=void 0,o=s}a(l,"setPreviousNode");try{hNe(t,{onObjectBegin:a((u,d)=>{if(e<=u)throw n;o=void 0,c=e>u,r.push("")},"onObjectBegin"),onObjectProperty:a((u,d,f)=>{if(e{if(e<=u)throw n;o=void 0,r.pop()},"onObjectEnd"),onArrayBegin:a((u,d)=>{if(e<=u)throw n;o=void 0,r.push(0)},"onArrayBegin"),onArrayEnd:a((u,d)=>{if(e<=u)throw n;o=void 0,r.pop()},"onArrayEnd"),onLiteralValue:a((u,d,f)=>{if(e{if(e<=d)throw n;if(u===":"&&o&&o.type==="property")o.colonOffset=d,c=!1,o=void 0;else if(u===","){let h=r[r.length-1];typeof h=="number"?r[r.length-1]=h+1:(c=!0,r[r.length-1]=""),o=void 0}},"onSeparator")})}catch(u){if(u!==n)throw u}return{path:r,previousNode:o,isAtPropertyKey:c,matches:a(u=>{let d=0;for(let f=0;d{let u={};c(u),s.push(o),o=u,n=null},"onObjectBegin"),onObjectProperty:a(u=>{n=u},"onObjectProperty"),onObjectEnd:a(()=>{o=s.pop()},"onObjectEnd"),onArrayBegin:a(()=>{let u=[];c(u),s.push(o),o=u,n=null},"onArrayBegin"),onArrayEnd:a(()=>{o=s.pop()},"onArrayEnd"),onLiteralValue:c,onError:a((u,d,f)=>{e.push({error:u,offset:d,length:f})},"onError")},r),o[0]}function hut(t,e=[],r=fNe.DEFAULT){let n={type:"array",offset:-1,length:-1,children:[],parent:void 0};function o(u){n.type==="property"&&(n.length=u-n.offset,n=n.parent)}a(o,"ensurePropertyComplete");function s(u){return n.children.push(u),u}a(s,"onValue"),hNe(t,{onObjectBegin:a(u=>{n=s({type:"object",offset:u,length:-1,parent:n,children:[]})},"onObjectBegin"),onObjectProperty:a((u,d,f)=>{n=s({type:"property",offset:d,length:-1,parent:n,children:[]}),n.children.push({type:"string",value:u,offset:d,length:f,parent:n})},"onObjectProperty"),onObjectEnd:a((u,d)=>{o(u+d),n.length=u+d-n.offset,n=n.parent,o(u+d)},"onObjectEnd"),onArrayBegin:a((u,d)=>{n=s({type:"array",offset:u,length:-1,parent:n,children:[]})},"onArrayBegin"),onArrayEnd:a((u,d)=>{n.length=u+d-n.offset,n=n.parent,o(u+d)},"onArrayEnd"),onLiteralValue:a((u,d,f)=>{s({type:OZn(u),offset:d,length:f,parent:n,value:u}),o(d+f)},"onLiteralValue"),onSeparator:a((u,d,f)=>{n.type==="property"&&(u===":"?n.colonOffset=d:u===","&&o(d))},"onSeparator"),onError:a((u,d,f)=>{e.push({error:u,offset:d,length:f})},"onError")},r);let l=n.children[0];return l&&delete l.parent,l}function pNe(t,e){if(!t)return;let r=t;for(let n of e)if(typeof n=="string"){if(r.type!=="object"||!Array.isArray(r.children))return;let o=!1;for(let s of r.children)if(Array.isArray(s.children)&&s.children[0].value===n&&s.children.length===2){r=s.children[1],o=!0;break}if(!o)return}else{let o=n;if(r.type!=="array"||o<0||!Array.isArray(r.children)||o>=r.children.length)return;r=r.children[o]}return r}function tpr(t){if(!t.parent||!t.parent.children)return[];let e=tpr(t.parent);if(t.parent.type==="property"){let r=t.parent.children[0].value;e.push(r)}else if(t.parent.type==="array"){let r=t.parent.children.indexOf(t);r!==-1&&e.push(r)}return e}function put(t){switch(t.type){case"array":return t.children.map(put);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=put(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function uHs(t,e,r=!1){return e>=t.offset&&es===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(c,"toNoArgVisit");function l(M){return M?L=>s===0&&M(L,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(l,"toOneArgVisit");function u(M){return M?L=>s===0&&M(L,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}a(u,"toOneArgVisitWithPath");function d(M){return M?()=>{s>0?s++:M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice())===!1&&(s=1)}:()=>!0}a(d,"toBeginVisit");function f(M){return M?()=>{s>0&&s--,s===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}a(f,"toEndVisit");let h=d(e.onObjectBegin),m=u(e.onObjectProperty),g=f(e.onObjectEnd),A=d(e.onArrayBegin),y=f(e.onArrayEnd),_=u(e.onLiteralValue),E=l(e.onSeparator),v=c(e.onComment),S=l(e.onError),T=r&&r.disallowComments,w=r&&r.allowTrailingComma;function R(){for(;;){let M=n.scan();switch(n.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:T||x(11);break;case 2:x(12);break;case 6:x(16);break}switch(M){case 12:case 13:T?x(10):v();break;case 16:x(1);break;case 15:case 14:break;default:return M}}}a(R,"scanNext");function x(M,L=[],U=[]){if(S(M),L.length+U.length>0){let j=n.getToken();for(;j!==17;){if(L.indexOf(j)!==-1){R();break}else if(U.indexOf(j)!==-1)break;j=R()}}}a(x,"handleError");function k(M){let L=n.getTokenValue();return M?_(L):(m(L),o.push(L)),R(),!0}a(k,"parseString");function D(){switch(n.getToken()){case 11:let M=n.getTokenValue(),L=Number(M);isNaN(L)&&(x(2),L=0),_(L);break;case 7:_(null);break;case 8:_(!0);break;case 9:_(!1);break;default:return!1}return R(),!0}a(D,"parseLiteral");function N(){return n.getToken()!==10?(x(3,[],[2,5]),!1):(k(!1),n.getToken()===6?(E(":"),R(),q()||x(4,[],[2,5])):x(5,[],[2,5]),o.pop(),!0)}a(N,"parseProperty");function O(){h(),R();let M=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(M||x(4,[],[]),E(","),R(),n.getToken()===2&&w)break}else M&&x(6,[],[]);N()||x(4,[],[2,5]),M=!0}return g(),n.getToken()!==2?x(7,[2],[]):R(),!0}a(O,"parseObject");function B(){A(),R();let M=!0,L=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(L||x(4,[],[]),E(","),R(),n.getToken()===4&&w)break}else L&&x(6,[],[]);M?(o.push(0),M=!1):o[o.length-1]++,q()||x(4,[],[4,5]),L=!0}return y(),M||o.pop(),n.getToken()!==4?x(8,[4],[]):R(),!0}a(B,"parseArray");function q(){switch(n.getToken()){case 3:return B();case 1:return O();case 10:return k(!0);default:return D()}}return a(q,"parseValue"),R(),n.getToken()===17?r.allowEmptyContent?!0:(x(4,[],[]),!1):q()?(n.getToken()!==17&&x(9,[],[]),!0):(x(4,[],[]),!1)}function MZn(t,e){let r=oee(t),n=[],o,s=0,c;do switch(c=r.getPosition(),o=r.scan(),o){case 12:case 13:case 17:s!==c&&n.push(t.substring(s,c)),e!==void 0&&n.push(r.getTokenValue().replace(/[^\r\n]/g,e)),s=r.getPosition();break}while(o!==17);return n.join("")}function OZn(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}var fNe,npr=Se(()=>{"use strict";p();dut();(function(t){t.DEFAULT={allowTrailingComma:!1}})(fNe||(fNe={}));a(DZn,"getLocation");a(NZn,"parse");a(hut,"parseTree");a(pNe,"findNodeAtLocation");a(tpr,"getNodePath");a(put,"getNodeValue");a(uHs,"contains");a(rpr,"findNodeAtOffset");a(hNe,"visit");a(MZn,"stripComments");a(OZn,"getNodeType")});function LZn(t,e,r,n){let o=e.slice(),c=hut(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=pNe(c,o),l===void 0&&r!==void 0);)typeof u=="string"?r={[u]:r}:r=[r];if(l)if(l.type==="object"&&typeof u=="string"&&Array.isArray(l.children)){let d=pNe(l,[u]);if(d!==void 0)if(r===void 0){if(!d.parent)throw new Error("Malformed AST");let f=l.children.indexOf(d.parent),h,m=d.parent.offset+d.parent.length;if(f>0){let g=l.children[f-1];h=g.offset+g.length}else h=l.offset+1,l.children.length>1&&(m=l.children[1].offset);return see(t,{offset:h,length:m-h,content:""},n)}else return see(t,{offset:d.offset,length:d.length,content:JSON.stringify(r)},n);else{if(r===void 0)return[];let f=`${JSON.stringify(u)}: ${JSON.stringify(r)}`,h=n.getInsertionIndex?n.getInsertionIndex(l.children.map(g=>g.children[0].value)):l.children.length,m;if(h>0){let g=l.children[h-1];m={offset:g.offset+g.length,length:0,content:","+f}}else l.children.length===0?m={offset:l.offset+1,length:0,content:f}:m={offset:l.offset+1,length:0,content:f+","};return see(t,m,n)}}else if(l.type==="array"&&typeof u=="number"&&Array.isArray(l.children)){let d=u;if(d===-1){let f=`${JSON.stringify(r)}`,h;if(l.children.length===0)h={offset:l.offset+1,length:0,content:f};else{let m=l.children[l.children.length-1];h={offset:m.offset+m.length,length:0,content:","+f}}return see(t,h,n)}else if(r===void 0&&l.children.length>=0){let f=u,h=l.children[f],m;if(l.children.length===1)m={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===f){let g=l.children[f-1],A=g.offset+g.length,y=l.offset+l.length;m={offset:A,length:y-2-A,content:""}}else m={offset:h.offset,length:l.children[f+1].offset-h.offset,content:""};return see(t,m,n)}else if(r!==void 0){let f,h=`${JSON.stringify(r)}`;if(!n.isArrayInsertion&&l.children.length>u){let m=l.children[u];f={offset:m.offset,length:m.length,content:h}}else if(l.children.length===0||u===0)f={offset:l.offset+1,length:0,content:l.children.length===0?h:h+","};else{let m=u>l.children.length?l.children.length:u,g=l.children[m-1];f={offset:g.offset+g.length,length:0,content:","+h}}return see(t,f,n)}else throw new Error(`Can not ${r===void 0?"remove":n.isArrayInsertion?"insert":"modify"} Array index ${d} as length is not sufficient`)}else throw new Error(`Can not add ${typeof u!="number"?"index":"property"} to parent of type ${l.type}`);else{if(r===void 0)throw new Error("Can not delete in empty document");return see(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function see(t,e,r){if(!r.formattingOptions)return[e];let n=mut(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!dNe(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=mut(n,d),o=Math.min(o,d.offset),s=Math.max(s,d.offset+d.length),s+=d.content.length-d.length}let l=t.length-(n.length-s)-o;return[{offset:o,length:l,content:n.substring(o,s)}]}function mut(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var BZn=Se(()=>{"use strict";p();epr();npr();a(LZn,"setProperty");a(see,"withFormatting");a(mut,"applyEdit")});var FZn={};Ti(FZn,{ParseErrorCode:()=>spr,ScanError:()=>ipr,SyntaxKind:()=>opr,applyEdits:()=>THs,createScanner:()=>pHs,findNodeAtLocation:()=>gHs,findNodeAtOffset:()=>AHs,format:()=>bHs,getLocation:()=>hHs,getNodePath:()=>yHs,getNodeValue:()=>_Hs,modify:()=>SHs,parse:()=>apr,parseTree:()=>mHs,printParseErrorCode:()=>CHs,stripComments:()=>vHs,visit:()=>EHs});function CHs(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return""}function bHs(t,e,r){return fut(t,e,r)}function SHs(t,e,r,n){return LZn(t,e,r,n)}function THs(t,e){let r=e.slice(0).sort((o,s)=>{let c=o.offset-s.offset;return c===0?o.length-s.length:c}),n=t.length;for(let o=r.length-1;o>=0;o--){let s=r[o];if(s.offset+s.length<=n)t=mut(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var pHs,ipr,opr,hHs,apr,mHs,gHs,AHs,yHs,_Hs,EHs,vHs,spr,cpr=Se(()=>{"use strict";p();epr();BZn();dut();npr();pHs=oee;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(ipr||(ipr={}));(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(opr||(opr={}));hHs=DZn,apr=NZn,mHs=hut,gHs=pNe,AHs=rpr,yHs=tpr,_Hs=put,EHs=hNe,vHs=MZn;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(spr||(spr={}));a(CHs,"printParseErrorCode");a(bHs,"format");a(SHs,"modify");a(THs,"applyEdits")});var YNe=I(yc=>{"use strict";p();Object.defineProperty(yc,"__esModule",{value:!0});yc.regexpCode=yc.getEsmExportName=yc.getProperty=yc.safeStringify=yc.stringify=yc.strConcat=yc.addCodeArg=yc.str=yc._=yc.nil=yc._Code=yc.Name=yc.IDENTIFIER=yc._CodeOrName=void 0;var WNe=class{static{a(this,"_CodeOrName")}};yc._CodeOrName=WNe;yc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Eee=class extends WNe{static{a(this,"Name")}constructor(e){if(super(),!yc.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};yc.Name=Eee;var bR=class extends WNe{static{a(this,"_Code")}constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Eee&&(r[n.str]=(r[n.str]||0)+1),r),{})}};yc._Code=bR;yc.nil=new bR("");function vei(t,...e){let r=[t[0]],n=0;for(;n{"use strict";p();Object.defineProperty($b,"__esModule",{value:!0});$b.ValueScope=$b.ValueScopeName=$b.Scope=$b.varKinds=$b.UsedValueState=void 0;var Gb=YNe(),fhr=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Vut;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Vut||($b.UsedValueState=Vut={}));$b.varKinds={const:new Gb.Name("const"),let:new Gb.Name("let"),var:new Gb.Name("var")};var Wut=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Gb.Name?e:this.name(e)}name(e){return new Gb.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};$b.Scope=Wut;var zut=class extends Gb.Name{static{a(this,"ValueScopeName")}constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Gb._)`.${new Gb.Name(r)}[${n}]`}};$b.ValueScopeName=zut;var lWs=(0,Gb._)`\n`,phr=class extends Wut{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?lWs:Gb.nil}}get(){return this._scope}name(e){return new zut(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,c=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let f=l.get(c);if(f)return f}else l=this._values[s]=new Map;l.set(c,o);let u=this._scope[s]||(this._scope[s]=[]),d=u.length;return u[d]=r.ref,o.setValue(r,{property:s,itemIndex:d}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Gb._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=Gb.nil;for(let c in e){let l=e[c];if(!l)continue;let u=n[c]=n[c]||new Map;l.forEach(d=>{if(u.has(d))return;u.set(d,Vut.Started);let f=r(d);if(f){let h=this.opts.es5?$b.varKinds.var:$b.varKinds.const;s=(0,Gb._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,Gb._)`${s}${f}${this.opts._n}`;else throw new fhr(d);u.set(d,Vut.Completed)})}return s}};$b.ValueScope=phr});var Ss=I(Bs=>{"use strict";p();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.or=Bs.and=Bs.not=Bs.CodeGen=Bs.operators=Bs.varKinds=Bs.ValueScopeName=Bs.ValueScope=Bs.Scope=Bs.Name=Bs.regexpCode=Bs.stringify=Bs.getProperty=Bs.nil=Bs.strConcat=Bs.str=Bs._=void 0;var Fa=YNe(),cD=hhr(),uG=YNe();Object.defineProperty(Bs,"_",{enumerable:!0,get:a(function(){return uG._},"get")});Object.defineProperty(Bs,"str",{enumerable:!0,get:a(function(){return uG.str},"get")});Object.defineProperty(Bs,"strConcat",{enumerable:!0,get:a(function(){return uG.strConcat},"get")});Object.defineProperty(Bs,"nil",{enumerable:!0,get:a(function(){return uG.nil},"get")});Object.defineProperty(Bs,"getProperty",{enumerable:!0,get:a(function(){return uG.getProperty},"get")});Object.defineProperty(Bs,"stringify",{enumerable:!0,get:a(function(){return uG.stringify},"get")});Object.defineProperty(Bs,"regexpCode",{enumerable:!0,get:a(function(){return uG.regexpCode},"get")});Object.defineProperty(Bs,"Name",{enumerable:!0,get:a(function(){return uG.Name},"get")});var Zut=hhr();Object.defineProperty(Bs,"Scope",{enumerable:!0,get:a(function(){return Zut.Scope},"get")});Object.defineProperty(Bs,"ValueScope",{enumerable:!0,get:a(function(){return Zut.ValueScope},"get")});Object.defineProperty(Bs,"ValueScopeName",{enumerable:!0,get:a(function(){return Zut.ValueScopeName},"get")});Object.defineProperty(Bs,"varKinds",{enumerable:!0,get:a(function(){return Zut.varKinds},"get")});Bs.operators={GT:new Fa._Code(">"),GTE:new Fa._Code(">="),LT:new Fa._Code("<"),LTE:new Fa._Code("<="),EQ:new Fa._Code("==="),NEQ:new Fa._Code("!=="),NOT:new Fa._Code("!"),OR:new Fa._Code("||"),AND:new Fa._Code("&&"),ADD:new Fa._Code("+")};var V8=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},mhr=class extends V8{static{a(this,"Def")}constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?cD.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Nme(this.rhs,e,r)),this}get names(){return this.rhs instanceof Fa._CodeOrName?this.rhs.names:{}}},Yut=class extends V8{static{a(this,"Assign")}constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Fa.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Nme(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Fa.Name?{}:{...this.lhs.names};return Jut(e,this.rhs)}},ghr=class extends Yut{static{a(this,"AssignOp")}constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Ahr=class extends V8{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},yhr=class extends V8{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},_hr=class extends V8{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Ehr=class extends V8{static{a(this,"AnyCode")}constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Nme(this.code,e,r),this}get names(){return this.code instanceof Fa._CodeOrName?this.code.names:{}}},KNe=class extends V8{static{a(this,"ParentNode")}constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(uWs(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>bee(e,r.names),{})}},W8=class extends KNe{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},vhr=class extends KNe{static{a(this,"Root")}},Dme=class extends W8{static{a(this,"Else")}};Dme.kind="else";var vee=class t extends W8{static{a(this,"If")}constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Dme(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(bei(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Nme(this.condition,e,r),this}get names(){let e=super.names;return Jut(e,this.condition),this.else&&bee(e,this.else.names),e}};vee.kind="if";var Cee=class extends W8{static{a(this,"For")}};Cee.kind="for";var Chr=class extends Cee{static{a(this,"ForLoop")}constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Nme(this.iteration,e,r),this}get names(){return bee(super.names,this.iteration.names)}},bhr=class extends Cee{static{a(this,"ForRange")}constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?cD.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Jut(super.names,this.from);return Jut(e,this.to)}},Kut=class extends Cee{static{a(this,"ForIter")}constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Nme(this.iterable,e,r),this}get names(){return bee(super.names,this.iterable.names)}},JNe=class extends W8{static{a(this,"Func")}constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};JNe.kind="func";var ZNe=class extends KNe{static{a(this,"Return")}render(e){return"return "+super.render(e)}};ZNe.kind="return";var Shr=class extends W8{static{a(this,"Try")}render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&bee(e,this.catch.names),this.finally&&bee(e,this.finally.names),e}},XNe=class extends W8{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};XNe.kind="catch";var eMe=class extends W8{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};eMe.kind="finally";var Thr=class{static{a(this,"CodeGen")}constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?` -`:""},this._extScope=e,this._scope=new cD.Scope({parent:e}),this._nodes=[new vhr]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new mhr(e,s,n)),s}const(e,r,n){return this._def(cD.varKinds.const,e,r,n)}let(e,r,n){return this._def(cD.varKinds.let,e,r,n)}var(e,r,n){return this._def(cD.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Yut(e,r,n))}add(e,r){return this._leafNode(new ghr(e,Bs.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Fa.nil&&this._leafNode(new Ehr(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,Fa.addCodeArg)(r,o));return r.push("}"),new Fa._Code(r)}if(e,r,n){if(this._blockNode(new vee(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new vee(e))}else(){return this._elseNode(new Dme)}endIf(){return this._endBlockNode(vee,Dme)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Chr(e),r)}forRange(e,r,n,o,s=this.opts.es5?cD.varKinds.var:cD.varKinds.let){let c=this._scope.toName(e);return this._for(new bhr(s,c,r,n),()=>o(c))}forOf(e,r,n,o=cD.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof Fa.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Fa._)`${c}.length`,l=>{this.var(s,(0,Fa._)`${c}[${l}]`),n(s)})}return this._for(new Kut("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?cD.varKinds.var:cD.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Fa._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Kut("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(Cee)}label(e){return this._leafNode(new Ahr(e))}break(e){return this._leafNode(new yhr(e))}return(e){let r=new ZNe;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ZNe)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Shr;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new XNe(s),r(s)}return n&&(this._currNode=o.finally=new eMe,this.code(n)),this._endBlockNode(XNe,eMe)}throw(e){return this._leafNode(new _hr(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Fa.nil,n,o){return this._blockNode(new JNe(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(JNe)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof vee))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Bs.CodeGen=Thr;function bee(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(bee,"addNames");function Jut(t,e){return e instanceof Fa._CodeOrName?bee(t,e.names):t}a(Jut,"addExprNames");function Nme(t,e,r){if(t instanceof Fa.Name)return n(t);if(!o(t))return t;return new Fa._Code(t._items.reduce((s,c)=>(c instanceof Fa.Name&&(c=n(c)),c instanceof Fa._Code?s.push(...c._items):s.push(c),s),[]));function n(s){let c=r[s.str];return c===void 0||e[s.str]!==1?s:(delete e[s.str],c)}function o(s){return s instanceof Fa._Code&&s._items.some(c=>c instanceof Fa.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a(Nme,"optimizeExpr");function uWs(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(uWs,"subtractNames");function bei(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Fa._)`!${Ihr(t)}`}a(bei,"not");Bs.not=bei;var dWs=Sei(Bs.operators.AND);function fWs(...t){return t.reduce(dWs)}a(fWs,"and");Bs.and=fWs;var pWs=Sei(Bs.operators.OR);function hWs(...t){return t.reduce(pWs)}a(hWs,"or");Bs.or=hWs;function Sei(t){return(e,r)=>e===Fa.nil?r:r===Fa.nil?e:(0,Fa._)`${Ihr(e)} ${t} ${Ihr(r)}`}a(Sei,"mappend");function Ihr(t){return t instanceof Fa.Name?t:(0,Fa._)`(${t})`}a(Ihr,"par")});var oc=I(zs=>{"use strict";p();Object.defineProperty(zs,"__esModule",{value:!0});zs.checkStrictMode=zs.getErrorPath=zs.Type=zs.useFunc=zs.setEvaluated=zs.evaluatedPropsToName=zs.mergeEvaluated=zs.eachItem=zs.unescapeJsonPointer=zs.escapeJsonPointer=zs.escapeFragment=zs.unescapeFragment=zs.schemaRefOrVal=zs.schemaHasRulesButRef=zs.schemaHasRules=zs.checkUnknownRules=zs.alwaysValidSchema=zs.toHash=void 0;var cu=Ss(),mWs=YNe();function gWs(t){let e={};for(let r of t)e[r]=!0;return e}a(gWs,"toHash");zs.toHash=gWs;function AWs(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(xei(t,e),!wei(e,t.self.RULES.all))}a(AWs,"alwaysValidSchema");zs.alwaysValidSchema=AWs;function xei(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||Pei(t,`unknown keyword: "${s}"`)}a(xei,"checkUnknownRules");zs.checkUnknownRules=xei;function wei(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(wei,"schemaHasRules");zs.schemaHasRules=wei;function yWs(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(yWs,"schemaHasRulesButRef");zs.schemaHasRulesButRef=yWs;function _Ws({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,cu._)`${r}`}return(0,cu._)`${t}${e}${(0,cu.getProperty)(n)}`}a(_Ws,"schemaRefOrVal");zs.schemaRefOrVal=_Ws;function EWs(t){return Rei(decodeURIComponent(t))}a(EWs,"unescapeFragment");zs.unescapeFragment=EWs;function vWs(t){return encodeURIComponent(whr(t))}a(vWs,"escapeFragment");zs.escapeFragment=vWs;function whr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(whr,"escapeJsonPointer");zs.escapeJsonPointer=whr;function Rei(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(Rei,"unescapeJsonPointer");zs.unescapeJsonPointer=Rei;function CWs(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(CWs,"eachItem");zs.eachItem=CWs;function Tei({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof cu.Name?(s instanceof cu.Name?t(o,s,c):e(o,s,c),c):s instanceof cu.Name?(e(o,c,s),s):r(s,c);return l===cu.Name&&!(u instanceof cu.Name)?n(o,u):u}}a(Tei,"makeMergeEvaluated");zs.mergeEvaluated={props:Tei({mergeNames:a((t,e,r)=>t.if((0,cu._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,cu._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,cu._)`${r} || {}`).code((0,cu._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,cu._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,cu._)`${r} || {}`),Rhr(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:kei}),items:Tei({mergeNames:a((t,e,r)=>t.if((0,cu._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,cu._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,cu._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,cu._)`${r} > ${e} ? ${r} : ${e}`)),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:Math.max(t,e),"mergeValues"),resultToName:a((t,e)=>t.var("items",e),"resultToName")})};function kei(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,cu._)`{}`);return e!==void 0&&Rhr(t,r,e),r}a(kei,"evaluatedPropsToName");zs.evaluatedPropsToName=kei;function Rhr(t,e,r){Object.keys(r).forEach(n=>t.assign((0,cu._)`${e}${(0,cu.getProperty)(n)}`,!0))}a(Rhr,"setEvaluated");zs.setEvaluated=Rhr;var Iei={};function bWs(t,e){return t.scopeValue("func",{ref:e,code:Iei[e.code]||(Iei[e.code]=new mWs._Code(e.code))})}a(bWs,"useFunc");zs.useFunc=bWs;var xhr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(xhr||(zs.Type=xhr={}));function SWs(t,e,r){if(t instanceof cu.Name){let n=e===xhr.Num;return r?n?(0,cu._)`"[" + ${t} + "]"`:(0,cu._)`"['" + ${t} + "']"`:n?(0,cu._)`"/" + ${t}`:(0,cu._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,cu.getProperty)(t).toString():"/"+whr(t)}a(SWs,"getErrorPath");zs.getErrorPath=SWs;function Pei(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}a(Pei,"checkStrictMode");zs.checkStrictMode=Pei});var z8=I(khr=>{"use strict";p();Object.defineProperty(khr,"__esModule",{value:!0});var H_=Ss(),TWs={data:new H_.Name("data"),valCxt:new H_.Name("valCxt"),instancePath:new H_.Name("instancePath"),parentData:new H_.Name("parentData"),parentDataProperty:new H_.Name("parentDataProperty"),rootData:new H_.Name("rootData"),dynamicAnchors:new H_.Name("dynamicAnchors"),vErrors:new H_.Name("vErrors"),errors:new H_.Name("errors"),this:new H_.Name("this"),self:new H_.Name("self"),scope:new H_.Name("scope"),json:new H_.Name("json"),jsonPos:new H_.Name("jsonPos"),jsonLen:new H_.Name("jsonLen"),jsonPart:new H_.Name("jsonPart")};khr.default=TWs});var tMe=I(G_=>{"use strict";p();Object.defineProperty(G_,"__esModule",{value:!0});G_.extendErrors=G_.resetErrorsCount=G_.reportExtraError=G_.reportError=G_.keyword$DataError=G_.keywordError=void 0;var sc=Ss(),Xut=oc(),Nv=z8();G_.keywordError={message:a(({keyword:t})=>(0,sc.str)`must pass "${t}" keyword validation`,"message")};G_.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,sc.str)`"${t}" keyword must be ${e} ($data)`:(0,sc.str)`"${t}" keyword is invalid ($data)`,"message")};function IWs(t,e=G_.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=Mei(t,e,r);n??(c||l)?Dei(s,u):Nei(o,(0,sc._)`[${u}]`)}a(IWs,"reportError");G_.reportError=IWs;function xWs(t,e=G_.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=Mei(t,e,r);Dei(o,l),s||c||Nei(n,Nv.default.vErrors)}a(xWs,"reportExtraError");G_.reportExtraError=xWs;function wWs(t,e){t.assign(Nv.default.errors,e),t.if((0,sc._)`${Nv.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,sc._)`${Nv.default.vErrors}.length`,e),()=>t.assign(Nv.default.vErrors,null)))}a(wWs,"resetErrorsCount");G_.resetErrorsCount=wWs;function RWs({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let c=t.name("err");t.forRange("i",o,Nv.default.errors,l=>{t.const(c,(0,sc._)`${Nv.default.vErrors}[${l}]`),t.if((0,sc._)`${c}.instancePath === undefined`,()=>t.assign((0,sc._)`${c}.instancePath`,(0,sc.strConcat)(Nv.default.instancePath,s.errorPath))),t.assign((0,sc._)`${c}.schemaPath`,(0,sc.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,sc._)`${c}.schema`,r),t.assign((0,sc._)`${c}.data`,n))})}a(RWs,"extendErrors");G_.extendErrors=RWs;function Dei(t,e){let r=t.const("err",e);t.if((0,sc._)`${Nv.default.vErrors} === null`,()=>t.assign(Nv.default.vErrors,(0,sc._)`[${r}]`),(0,sc._)`${Nv.default.vErrors}.push(${r})`),t.code((0,sc._)`${Nv.default.errors}++`)}a(Dei,"addError");function Nei(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,sc._)`new ${t.ValidationError}(${e})`):(r.assign((0,sc._)`${n}.errors`,e),r.return(!1))}a(Nei,"returnErrors");var See={keyword:new sc.Name("keyword"),schemaPath:new sc.Name("schemaPath"),params:new sc.Name("params"),propertyName:new sc.Name("propertyName"),message:new sc.Name("message"),schema:new sc.Name("schema"),parentSchema:new sc.Name("parentSchema")};function Mei(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,sc._)`{}`:kWs(t,e,r)}a(Mei,"errorObjectCode");function kWs(t,e,r={}){let{gen:n,it:o}=t,s=[PWs(o,r),DWs(t,r)];return NWs(t,e,s),n.object(...s)}a(kWs,"errorObject");function PWs({errorPath:t},{instancePath:e}){let r=e?(0,sc.str)`${t}${(0,Xut.getErrorPath)(e,Xut.Type.Str)}`:t;return[Nv.default.instancePath,(0,sc.strConcat)(Nv.default.instancePath,r)]}a(PWs,"errorInstancePath");function DWs({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,sc.str)`${e}/${t}`;return r&&(o=(0,sc.str)`${o}${(0,Xut.getErrorPath)(r,Xut.Type.Str)}`),[See.schemaPath,o]}a(DWs,"errorSchemaPath");function NWs(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:c,it:l}=t,{opts:u,propertyName:d,topSchemaRef:f,schemaPath:h}=l;n.push([See.keyword,o],[See.params,typeof e=="function"?e(t):e||(0,sc._)`{}`]),u.messages&&n.push([See.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([See.schema,c],[See.parentSchema,(0,sc._)`${f}${h}`],[Nv.default.data,s]),d&&n.push([See.propertyName,d])}a(NWs,"extraErrorProps")});var Lei=I(Mme=>{"use strict";p();Object.defineProperty(Mme,"__esModule",{value:!0});Mme.boolOrEmptySchema=Mme.topBoolOrEmptySchema=void 0;var MWs=tMe(),OWs=Ss(),LWs=z8(),BWs={message:"boolean schema is false"};function FWs(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Oei(t,!1):typeof r=="object"&&r.$async===!0?e.return(LWs.default.data):(e.assign((0,OWs._)`${n}.errors`,null),e.return(!0))}a(FWs,"topBoolOrEmptySchema");Mme.topBoolOrEmptySchema=FWs;function UWs(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Oei(t)):r.var(e,!0)}a(UWs,"boolOrEmptySchema");Mme.boolOrEmptySchema=UWs;function Oei(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,MWs.reportError)(o,BWs,void 0,e)}a(Oei,"falseSchemaError")});var Phr=I(Ome=>{"use strict";p();Object.defineProperty(Ome,"__esModule",{value:!0});Ome.getRules=Ome.isJSONType=void 0;var QWs=["string","number","integer","boolean","null","object","array"],qWs=new Set(QWs);function jWs(t){return typeof t=="string"&&qWs.has(t)}a(jWs,"isJSONType");Ome.isJSONType=jWs;function HWs(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}a(HWs,"getRules");Ome.getRules=HWs});var Dhr=I(dG=>{"use strict";p();Object.defineProperty(dG,"__esModule",{value:!0});dG.shouldUseRule=dG.shouldUseGroup=dG.schemaHasRulesForType=void 0;function GWs({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Bei(t,n)}a(GWs,"schemaHasRulesForType");dG.schemaHasRulesForType=GWs;function Bei(t,e){return e.rules.some(r=>Fei(t,r))}a(Bei,"shouldUseGroup");dG.shouldUseGroup=Bei;function Fei(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}a(Fei,"shouldUseRule");dG.shouldUseRule=Fei});var rMe=I($_=>{"use strict";p();Object.defineProperty($_,"__esModule",{value:!0});$_.reportTypeError=$_.checkDataTypes=$_.checkDataType=$_.coerceAndCheckDataType=$_.getJSONTypes=$_.getSchemaTypes=$_.DataType=void 0;var $Ws=Phr(),VWs=Dhr(),WWs=tMe(),hs=Ss(),Uei=oc(),Lme;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Lme||($_.DataType=Lme={}));function zWs(t){let e=Qei(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}a(zWs,"getSchemaTypes");$_.getSchemaTypes=zWs;function Qei(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every($Ws.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(Qei,"getJSONTypes");$_.getJSONTypes=Qei;function YWs(t,e){let{gen:r,data:n,opts:o}=t,s=KWs(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,VWs.schemaHasRulesForType)(t,e[0]));if(c){let l=Mhr(e,n,o.strictNumbers,Lme.Wrong);r.if(l,()=>{s.length?JWs(t,e,s):Ohr(t)})}return c}a(YWs,"coerceAndCheckDataType");$_.coerceAndCheckDataType=YWs;var qei=new Set(["string","number","integer","boolean","null"]);function KWs(t,e){return e?t.filter(r=>qei.has(r)||e==="array"&&r==="array"):[]}a(KWs,"coerceToTypes");function JWs(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,hs._)`typeof ${o}`),l=n.let("coerced",(0,hs._)`undefined`);s.coerceTypes==="array"&&n.if((0,hs._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,hs._)`${o}[0]`).assign(c,(0,hs._)`typeof ${o}`).if(Mhr(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,hs._)`${l} !== undefined`);for(let d of r)(qei.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),Ohr(t),n.endIf(),n.if((0,hs._)`${l} !== undefined`,()=>{n.assign(o,l),ZWs(t,l)});function u(d){switch(d){case"string":n.elseIf((0,hs._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,hs._)`"" + ${o}`).elseIf((0,hs._)`${o} === null`).assign(l,(0,hs._)`""`);return;case"number":n.elseIf((0,hs._)`${c} == "boolean" || ${o} === null +`.indexOf(t.charAt(e))!==-1}var tpr=Se(()=>{"use strict";p();dut();NZn();a(fut,"format");a(mme,"repeat");a(lHs,"computeIndentLevel");a(uHs,"getEOL");a(dNe,"isEOL")});function MZn(t,e){let r=[],n=new Object,o,s={value:{},offset:0,length:0,type:"object",parent:void 0},c=!1;function l(u,d,f,h){s.value=u,s.offset=d,s.length=f,s.type=h,s.colonOffset=void 0,o=s}a(l,"setPreviousNode");try{hNe(t,{onObjectBegin:a((u,d)=>{if(e<=u)throw n;o=void 0,c=e>u,r.push("")},"onObjectBegin"),onObjectProperty:a((u,d,f)=>{if(e{if(e<=u)throw n;o=void 0,r.pop()},"onObjectEnd"),onArrayBegin:a((u,d)=>{if(e<=u)throw n;o=void 0,r.push(0)},"onArrayBegin"),onArrayEnd:a((u,d)=>{if(e<=u)throw n;o=void 0,r.pop()},"onArrayEnd"),onLiteralValue:a((u,d,f)=>{if(e{if(e<=d)throw n;if(u===":"&&o&&o.type==="property")o.colonOffset=d,c=!1,o=void 0;else if(u===","){let h=r[r.length-1];typeof h=="number"?r[r.length-1]=h+1:(c=!0,r[r.length-1]=""),o=void 0}},"onSeparator")})}catch(u){if(u!==n)throw u}return{path:r,previousNode:o,isAtPropertyKey:c,matches:a(u=>{let d=0;for(let f=0;d{let u={};c(u),s.push(o),o=u,n=null},"onObjectBegin"),onObjectProperty:a(u=>{n=u},"onObjectProperty"),onObjectEnd:a(()=>{o=s.pop()},"onObjectEnd"),onArrayBegin:a(()=>{let u=[];c(u),s.push(o),o=u,n=null},"onArrayBegin"),onArrayEnd:a(()=>{o=s.pop()},"onArrayEnd"),onLiteralValue:c,onError:a((u,d,f)=>{e.push({error:u,offset:d,length:f})},"onError")},r),o[0]}function hut(t,e=[],r=fNe.DEFAULT){let n={type:"array",offset:-1,length:-1,children:[],parent:void 0};function o(u){n.type==="property"&&(n.length=u-n.offset,n=n.parent)}a(o,"ensurePropertyComplete");function s(u){return n.children.push(u),u}a(s,"onValue"),hNe(t,{onObjectBegin:a(u=>{n=s({type:"object",offset:u,length:-1,parent:n,children:[]})},"onObjectBegin"),onObjectProperty:a((u,d,f)=>{n=s({type:"property",offset:d,length:-1,parent:n,children:[]}),n.children.push({type:"string",value:u,offset:d,length:f,parent:n})},"onObjectProperty"),onObjectEnd:a((u,d)=>{o(u+d),n.length=u+d-n.offset,n=n.parent,o(u+d)},"onObjectEnd"),onArrayBegin:a((u,d)=>{n=s({type:"array",offset:u,length:-1,parent:n,children:[]})},"onArrayBegin"),onArrayEnd:a((u,d)=>{n.length=u+d-n.offset,n=n.parent,o(u+d)},"onArrayEnd"),onLiteralValue:a((u,d,f)=>{s({type:BZn(u),offset:d,length:f,parent:n,value:u}),o(d+f)},"onLiteralValue"),onSeparator:a((u,d,f)=>{n.type==="property"&&(u===":"?n.colonOffset=d:u===","&&o(d))},"onSeparator"),onError:a((u,d,f)=>{e.push({error:u,offset:d,length:f})},"onError")},r);let l=n.children[0];return l&&delete l.parent,l}function pNe(t,e){if(!t)return;let r=t;for(let n of e)if(typeof n=="string"){if(r.type!=="object"||!Array.isArray(r.children))return;let o=!1;for(let s of r.children)if(Array.isArray(s.children)&&s.children[0].value===n&&s.children.length===2){r=s.children[1],o=!0;break}if(!o)return}else{let o=n;if(r.type!=="array"||o<0||!Array.isArray(r.children)||o>=r.children.length)return;r=r.children[o]}return r}function rpr(t){if(!t.parent||!t.parent.children)return[];let e=rpr(t.parent);if(t.parent.type==="property"){let r=t.parent.children[0].value;e.push(r)}else if(t.parent.type==="array"){let r=t.parent.children.indexOf(t);r!==-1&&e.push(r)}return e}function put(t){switch(t.type){case"array":return t.children.map(put);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=put(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function fHs(t,e,r=!1){return e>=t.offset&&es===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(c,"toNoArgVisit");function l(M){return M?L=>s===0&&M(L,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(l,"toOneArgVisit");function u(M){return M?L=>s===0&&M(L,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}a(u,"toOneArgVisitWithPath");function d(M){return M?()=>{s>0?s++:M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice())===!1&&(s=1)}:()=>!0}a(d,"toBeginVisit");function f(M){return M?()=>{s>0&&s--,s===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}a(f,"toEndVisit");let h=d(e.onObjectBegin),m=u(e.onObjectProperty),g=f(e.onObjectEnd),A=d(e.onArrayBegin),y=f(e.onArrayEnd),_=u(e.onLiteralValue),E=l(e.onSeparator),v=c(e.onComment),S=l(e.onError),T=r&&r.disallowComments,w=r&&r.allowTrailingComma;function R(){for(;;){let M=n.scan();switch(n.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:T||x(11);break;case 2:x(12);break;case 6:x(16);break}switch(M){case 12:case 13:T?x(10):v();break;case 16:x(1);break;case 15:case 14:break;default:return M}}}a(R,"scanNext");function x(M,L=[],U=[]){if(S(M),L.length+U.length>0){let j=n.getToken();for(;j!==17;){if(L.indexOf(j)!==-1){R();break}else if(U.indexOf(j)!==-1)break;j=R()}}}a(x,"handleError");function k(M){let L=n.getTokenValue();return M?_(L):(m(L),o.push(L)),R(),!0}a(k,"parseString");function D(){switch(n.getToken()){case 11:let M=n.getTokenValue(),L=Number(M);isNaN(L)&&(x(2),L=0),_(L);break;case 7:_(null);break;case 8:_(!0);break;case 9:_(!1);break;default:return!1}return R(),!0}a(D,"parseLiteral");function N(){return n.getToken()!==10?(x(3,[],[2,5]),!1):(k(!1),n.getToken()===6?(E(":"),R(),q()||x(4,[],[2,5])):x(5,[],[2,5]),o.pop(),!0)}a(N,"parseProperty");function O(){h(),R();let M=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(M||x(4,[],[]),E(","),R(),n.getToken()===2&&w)break}else M&&x(6,[],[]);N()||x(4,[],[2,5]),M=!0}return g(),n.getToken()!==2?x(7,[2],[]):R(),!0}a(O,"parseObject");function B(){A(),R();let M=!0,L=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(L||x(4,[],[]),E(","),R(),n.getToken()===4&&w)break}else L&&x(6,[],[]);M?(o.push(0),M=!1):o[o.length-1]++,q()||x(4,[],[4,5]),L=!0}return y(),M||o.pop(),n.getToken()!==4?x(8,[4],[]):R(),!0}a(B,"parseArray");function q(){switch(n.getToken()){case 3:return B();case 1:return O();case 10:return k(!0);default:return D()}}return a(q,"parseValue"),R(),n.getToken()===17?r.allowEmptyContent?!0:(x(4,[],[]),!1):q()?(n.getToken()!==17&&x(9,[],[]),!0):(x(4,[],[]),!1)}function LZn(t,e){let r=see(t),n=[],o,s=0,c;do switch(c=r.getPosition(),o=r.scan(),o){case 12:case 13:case 17:s!==c&&n.push(t.substring(s,c)),e!==void 0&&n.push(r.getTokenValue().replace(/[^\r\n]/g,e)),s=r.getPosition();break}while(o!==17);return n.join("")}function BZn(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}var fNe,ipr=Se(()=>{"use strict";p();dut();(function(t){t.DEFAULT={allowTrailingComma:!1}})(fNe||(fNe={}));a(MZn,"getLocation");a(OZn,"parse");a(hut,"parseTree");a(pNe,"findNodeAtLocation");a(rpr,"getNodePath");a(put,"getNodeValue");a(fHs,"contains");a(npr,"findNodeAtOffset");a(hNe,"visit");a(LZn,"stripComments");a(BZn,"getNodeType")});function FZn(t,e,r,n){let o=e.slice(),c=hut(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=pNe(c,o),l===void 0&&r!==void 0);)typeof u=="string"?r={[u]:r}:r=[r];if(l)if(l.type==="object"&&typeof u=="string"&&Array.isArray(l.children)){let d=pNe(l,[u]);if(d!==void 0)if(r===void 0){if(!d.parent)throw new Error("Malformed AST");let f=l.children.indexOf(d.parent),h,m=d.parent.offset+d.parent.length;if(f>0){let g=l.children[f-1];h=g.offset+g.length}else h=l.offset+1,l.children.length>1&&(m=l.children[1].offset);return aee(t,{offset:h,length:m-h,content:""},n)}else return aee(t,{offset:d.offset,length:d.length,content:JSON.stringify(r)},n);else{if(r===void 0)return[];let f=`${JSON.stringify(u)}: ${JSON.stringify(r)}`,h=n.getInsertionIndex?n.getInsertionIndex(l.children.map(g=>g.children[0].value)):l.children.length,m;if(h>0){let g=l.children[h-1];m={offset:g.offset+g.length,length:0,content:","+f}}else l.children.length===0?m={offset:l.offset+1,length:0,content:f}:m={offset:l.offset+1,length:0,content:f+","};return aee(t,m,n)}}else if(l.type==="array"&&typeof u=="number"&&Array.isArray(l.children)){let d=u;if(d===-1){let f=`${JSON.stringify(r)}`,h;if(l.children.length===0)h={offset:l.offset+1,length:0,content:f};else{let m=l.children[l.children.length-1];h={offset:m.offset+m.length,length:0,content:","+f}}return aee(t,h,n)}else if(r===void 0&&l.children.length>=0){let f=u,h=l.children[f],m;if(l.children.length===1)m={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===f){let g=l.children[f-1],A=g.offset+g.length,y=l.offset+l.length;m={offset:A,length:y-2-A,content:""}}else m={offset:h.offset,length:l.children[f+1].offset-h.offset,content:""};return aee(t,m,n)}else if(r!==void 0){let f,h=`${JSON.stringify(r)}`;if(!n.isArrayInsertion&&l.children.length>u){let m=l.children[u];f={offset:m.offset,length:m.length,content:h}}else if(l.children.length===0||u===0)f={offset:l.offset+1,length:0,content:l.children.length===0?h:h+","};else{let m=u>l.children.length?l.children.length:u,g=l.children[m-1];f={offset:g.offset+g.length,length:0,content:","+h}}return aee(t,f,n)}else throw new Error(`Can not ${r===void 0?"remove":n.isArrayInsertion?"insert":"modify"} Array index ${d} as length is not sufficient`)}else throw new Error(`Can not add ${typeof u!="number"?"index":"property"} to parent of type ${l.type}`);else{if(r===void 0)throw new Error("Can not delete in empty document");return aee(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function aee(t,e,r){if(!r.formattingOptions)return[e];let n=mut(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!dNe(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=mut(n,d),o=Math.min(o,d.offset),s=Math.max(s,d.offset+d.length),s+=d.content.length-d.length}let l=t.length-(n.length-s)-o;return[{offset:o,length:l,content:n.substring(o,s)}]}function mut(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var UZn=Se(()=>{"use strict";p();tpr();ipr();a(FZn,"setProperty");a(aee,"withFormatting");a(mut,"applyEdit")});var QZn={};Ti(QZn,{ParseErrorCode:()=>apr,ScanError:()=>opr,SyntaxKind:()=>spr,applyEdits:()=>xHs,createScanner:()=>mHs,findNodeAtLocation:()=>yHs,findNodeAtOffset:()=>_Hs,format:()=>THs,getLocation:()=>gHs,getNodePath:()=>EHs,getNodeValue:()=>vHs,modify:()=>IHs,parse:()=>cpr,parseTree:()=>AHs,printParseErrorCode:()=>SHs,stripComments:()=>bHs,visit:()=>CHs});function SHs(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return""}function THs(t,e,r){return fut(t,e,r)}function IHs(t,e,r,n){return FZn(t,e,r,n)}function xHs(t,e){let r=e.slice(0).sort((o,s)=>{let c=o.offset-s.offset;return c===0?o.length-s.length:c}),n=t.length;for(let o=r.length-1;o>=0;o--){let s=r[o];if(s.offset+s.length<=n)t=mut(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var mHs,opr,spr,gHs,cpr,AHs,yHs,_Hs,EHs,vHs,CHs,bHs,apr,lpr=Se(()=>{"use strict";p();tpr();UZn();dut();ipr();mHs=see;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(opr||(opr={}));(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(spr||(spr={}));gHs=MZn,cpr=OZn,AHs=hut,yHs=pNe,_Hs=npr,EHs=rpr,vHs=put,CHs=hNe,bHs=LZn;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(apr||(apr={}));a(SHs,"printParseErrorCode");a(THs,"format");a(IHs,"modify");a(xHs,"applyEdits")});var YNe=I(yc=>{"use strict";p();Object.defineProperty(yc,"__esModule",{value:!0});yc.regexpCode=yc.getEsmExportName=yc.getProperty=yc.safeStringify=yc.stringify=yc.strConcat=yc.addCodeArg=yc.str=yc._=yc.nil=yc._Code=yc.Name=yc.IDENTIFIER=yc._CodeOrName=void 0;var WNe=class{static{a(this,"_CodeOrName")}};yc._CodeOrName=WNe;yc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var vee=class extends WNe{static{a(this,"Name")}constructor(e){if(super(),!yc.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};yc.Name=vee;var bR=class extends WNe{static{a(this,"_Code")}constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof vee&&(r[n.str]=(r[n.str]||0)+1),r),{})}};yc._Code=bR;yc.nil=new bR("");function bei(t,...e){let r=[t[0]],n=0;for(;n{"use strict";p();Object.defineProperty($b,"__esModule",{value:!0});$b.ValueScope=$b.ValueScopeName=$b.Scope=$b.varKinds=$b.UsedValueState=void 0;var Gb=YNe(),phr=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Vut;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Vut||($b.UsedValueState=Vut={}));$b.varKinds={const:new Gb.Name("const"),let:new Gb.Name("let"),var:new Gb.Name("var")};var Wut=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Gb.Name?e:this.name(e)}name(e){return new Gb.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};$b.Scope=Wut;var zut=class extends Gb.Name{static{a(this,"ValueScopeName")}constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Gb._)`.${new Gb.Name(r)}[${n}]`}};$b.ValueScopeName=zut;var dWs=(0,Gb._)`\n`,hhr=class extends Wut{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?dWs:Gb.nil}}get(){return this._scope}name(e){return new zut(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,c=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let f=l.get(c);if(f)return f}else l=this._values[s]=new Map;l.set(c,o);let u=this._scope[s]||(this._scope[s]=[]),d=u.length;return u[d]=r.ref,o.setValue(r,{property:s,itemIndex:d}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Gb._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=Gb.nil;for(let c in e){let l=e[c];if(!l)continue;let u=n[c]=n[c]||new Map;l.forEach(d=>{if(u.has(d))return;u.set(d,Vut.Started);let f=r(d);if(f){let h=this.opts.es5?$b.varKinds.var:$b.varKinds.const;s=(0,Gb._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,Gb._)`${s}${f}${this.opts._n}`;else throw new phr(d);u.set(d,Vut.Completed)})}return s}};$b.ValueScope=hhr});var Ss=I(Bs=>{"use strict";p();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.or=Bs.and=Bs.not=Bs.CodeGen=Bs.operators=Bs.varKinds=Bs.ValueScopeName=Bs.ValueScope=Bs.Scope=Bs.Name=Bs.regexpCode=Bs.stringify=Bs.getProperty=Bs.nil=Bs.strConcat=Bs.str=Bs._=void 0;var Fa=YNe(),cD=mhr(),dG=YNe();Object.defineProperty(Bs,"_",{enumerable:!0,get:a(function(){return dG._},"get")});Object.defineProperty(Bs,"str",{enumerable:!0,get:a(function(){return dG.str},"get")});Object.defineProperty(Bs,"strConcat",{enumerable:!0,get:a(function(){return dG.strConcat},"get")});Object.defineProperty(Bs,"nil",{enumerable:!0,get:a(function(){return dG.nil},"get")});Object.defineProperty(Bs,"getProperty",{enumerable:!0,get:a(function(){return dG.getProperty},"get")});Object.defineProperty(Bs,"stringify",{enumerable:!0,get:a(function(){return dG.stringify},"get")});Object.defineProperty(Bs,"regexpCode",{enumerable:!0,get:a(function(){return dG.regexpCode},"get")});Object.defineProperty(Bs,"Name",{enumerable:!0,get:a(function(){return dG.Name},"get")});var Zut=mhr();Object.defineProperty(Bs,"Scope",{enumerable:!0,get:a(function(){return Zut.Scope},"get")});Object.defineProperty(Bs,"ValueScope",{enumerable:!0,get:a(function(){return Zut.ValueScope},"get")});Object.defineProperty(Bs,"ValueScopeName",{enumerable:!0,get:a(function(){return Zut.ValueScopeName},"get")});Object.defineProperty(Bs,"varKinds",{enumerable:!0,get:a(function(){return Zut.varKinds},"get")});Bs.operators={GT:new Fa._Code(">"),GTE:new Fa._Code(">="),LT:new Fa._Code("<"),LTE:new Fa._Code("<="),EQ:new Fa._Code("==="),NEQ:new Fa._Code("!=="),NOT:new Fa._Code("!"),OR:new Fa._Code("||"),AND:new Fa._Code("&&"),ADD:new Fa._Code("+")};var V8=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},ghr=class extends V8{static{a(this,"Def")}constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?cD.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Nme(this.rhs,e,r)),this}get names(){return this.rhs instanceof Fa._CodeOrName?this.rhs.names:{}}},Yut=class extends V8{static{a(this,"Assign")}constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Fa.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Nme(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Fa.Name?{}:{...this.lhs.names};return Jut(e,this.rhs)}},Ahr=class extends Yut{static{a(this,"AssignOp")}constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},yhr=class extends V8{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},_hr=class extends V8{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Ehr=class extends V8{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},vhr=class extends V8{static{a(this,"AnyCode")}constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Nme(this.code,e,r),this}get names(){return this.code instanceof Fa._CodeOrName?this.code.names:{}}},KNe=class extends V8{static{a(this,"ParentNode")}constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(fWs(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>See(e,r.names),{})}},W8=class extends KNe{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Chr=class extends KNe{static{a(this,"Root")}},Dme=class extends W8{static{a(this,"Else")}};Dme.kind="else";var Cee=class t extends W8{static{a(this,"If")}constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Dme(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Tei(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Nme(this.condition,e,r),this}get names(){let e=super.names;return Jut(e,this.condition),this.else&&See(e,this.else.names),e}};Cee.kind="if";var bee=class extends W8{static{a(this,"For")}};bee.kind="for";var bhr=class extends bee{static{a(this,"ForLoop")}constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Nme(this.iteration,e,r),this}get names(){return See(super.names,this.iteration.names)}},Shr=class extends bee{static{a(this,"ForRange")}constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?cD.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Jut(super.names,this.from);return Jut(e,this.to)}},Kut=class extends bee{static{a(this,"ForIter")}constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Nme(this.iterable,e,r),this}get names(){return See(super.names,this.iterable.names)}},JNe=class extends W8{static{a(this,"Func")}constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};JNe.kind="func";var ZNe=class extends KNe{static{a(this,"Return")}render(e){return"return "+super.render(e)}};ZNe.kind="return";var Thr=class extends W8{static{a(this,"Try")}render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&See(e,this.catch.names),this.finally&&See(e,this.finally.names),e}},XNe=class extends W8{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};XNe.kind="catch";var eMe=class extends W8{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};eMe.kind="finally";var Ihr=class{static{a(this,"CodeGen")}constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?` +`:""},this._extScope=e,this._scope=new cD.Scope({parent:e}),this._nodes=[new Chr]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new ghr(e,s,n)),s}const(e,r,n){return this._def(cD.varKinds.const,e,r,n)}let(e,r,n){return this._def(cD.varKinds.let,e,r,n)}var(e,r,n){return this._def(cD.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Yut(e,r,n))}add(e,r){return this._leafNode(new Ahr(e,Bs.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Fa.nil&&this._leafNode(new vhr(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,Fa.addCodeArg)(r,o));return r.push("}"),new Fa._Code(r)}if(e,r,n){if(this._blockNode(new Cee(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Cee(e))}else(){return this._elseNode(new Dme)}endIf(){return this._endBlockNode(Cee,Dme)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new bhr(e),r)}forRange(e,r,n,o,s=this.opts.es5?cD.varKinds.var:cD.varKinds.let){let c=this._scope.toName(e);return this._for(new Shr(s,c,r,n),()=>o(c))}forOf(e,r,n,o=cD.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof Fa.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Fa._)`${c}.length`,l=>{this.var(s,(0,Fa._)`${c}[${l}]`),n(s)})}return this._for(new Kut("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?cD.varKinds.var:cD.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Fa._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Kut("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(bee)}label(e){return this._leafNode(new yhr(e))}break(e){return this._leafNode(new _hr(e))}return(e){let r=new ZNe;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ZNe)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Thr;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new XNe(s),r(s)}return n&&(this._currNode=o.finally=new eMe,this.code(n)),this._endBlockNode(XNe,eMe)}throw(e){return this._leafNode(new Ehr(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Fa.nil,n,o){return this._blockNode(new JNe(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(JNe)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Cee))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Bs.CodeGen=Ihr;function See(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(See,"addNames");function Jut(t,e){return e instanceof Fa._CodeOrName?See(t,e.names):t}a(Jut,"addExprNames");function Nme(t,e,r){if(t instanceof Fa.Name)return n(t);if(!o(t))return t;return new Fa._Code(t._items.reduce((s,c)=>(c instanceof Fa.Name&&(c=n(c)),c instanceof Fa._Code?s.push(...c._items):s.push(c),s),[]));function n(s){let c=r[s.str];return c===void 0||e[s.str]!==1?s:(delete e[s.str],c)}function o(s){return s instanceof Fa._Code&&s._items.some(c=>c instanceof Fa.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a(Nme,"optimizeExpr");function fWs(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(fWs,"subtractNames");function Tei(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Fa._)`!${xhr(t)}`}a(Tei,"not");Bs.not=Tei;var pWs=Iei(Bs.operators.AND);function hWs(...t){return t.reduce(pWs)}a(hWs,"and");Bs.and=hWs;var mWs=Iei(Bs.operators.OR);function gWs(...t){return t.reduce(mWs)}a(gWs,"or");Bs.or=gWs;function Iei(t){return(e,r)=>e===Fa.nil?r:r===Fa.nil?e:(0,Fa._)`${xhr(e)} ${t} ${xhr(r)}`}a(Iei,"mappend");function xhr(t){return t instanceof Fa.Name?t:(0,Fa._)`(${t})`}a(xhr,"par")});var oc=I(zs=>{"use strict";p();Object.defineProperty(zs,"__esModule",{value:!0});zs.checkStrictMode=zs.getErrorPath=zs.Type=zs.useFunc=zs.setEvaluated=zs.evaluatedPropsToName=zs.mergeEvaluated=zs.eachItem=zs.unescapeJsonPointer=zs.escapeJsonPointer=zs.escapeFragment=zs.unescapeFragment=zs.schemaRefOrVal=zs.schemaHasRulesButRef=zs.schemaHasRules=zs.checkUnknownRules=zs.alwaysValidSchema=zs.toHash=void 0;var cu=Ss(),AWs=YNe();function yWs(t){let e={};for(let r of t)e[r]=!0;return e}a(yWs,"toHash");zs.toHash=yWs;function _Ws(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Rei(t,e),!kei(e,t.self.RULES.all))}a(_Ws,"alwaysValidSchema");zs.alwaysValidSchema=_Ws;function Rei(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||Nei(t,`unknown keyword: "${s}"`)}a(Rei,"checkUnknownRules");zs.checkUnknownRules=Rei;function kei(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(kei,"schemaHasRules");zs.schemaHasRules=kei;function EWs(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(EWs,"schemaHasRulesButRef");zs.schemaHasRulesButRef=EWs;function vWs({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,cu._)`${r}`}return(0,cu._)`${t}${e}${(0,cu.getProperty)(n)}`}a(vWs,"schemaRefOrVal");zs.schemaRefOrVal=vWs;function CWs(t){return Pei(decodeURIComponent(t))}a(CWs,"unescapeFragment");zs.unescapeFragment=CWs;function bWs(t){return encodeURIComponent(Rhr(t))}a(bWs,"escapeFragment");zs.escapeFragment=bWs;function Rhr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(Rhr,"escapeJsonPointer");zs.escapeJsonPointer=Rhr;function Pei(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(Pei,"unescapeJsonPointer");zs.unescapeJsonPointer=Pei;function SWs(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(SWs,"eachItem");zs.eachItem=SWs;function xei({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof cu.Name?(s instanceof cu.Name?t(o,s,c):e(o,s,c),c):s instanceof cu.Name?(e(o,c,s),s):r(s,c);return l===cu.Name&&!(u instanceof cu.Name)?n(o,u):u}}a(xei,"makeMergeEvaluated");zs.mergeEvaluated={props:xei({mergeNames:a((t,e,r)=>t.if((0,cu._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,cu._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,cu._)`${r} || {}`).code((0,cu._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,cu._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,cu._)`${r} || {}`),khr(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:Dei}),items:xei({mergeNames:a((t,e,r)=>t.if((0,cu._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,cu._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,cu._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,cu._)`${r} > ${e} ? ${r} : ${e}`)),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:Math.max(t,e),"mergeValues"),resultToName:a((t,e)=>t.var("items",e),"resultToName")})};function Dei(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,cu._)`{}`);return e!==void 0&&khr(t,r,e),r}a(Dei,"evaluatedPropsToName");zs.evaluatedPropsToName=Dei;function khr(t,e,r){Object.keys(r).forEach(n=>t.assign((0,cu._)`${e}${(0,cu.getProperty)(n)}`,!0))}a(khr,"setEvaluated");zs.setEvaluated=khr;var wei={};function TWs(t,e){return t.scopeValue("func",{ref:e,code:wei[e.code]||(wei[e.code]=new AWs._Code(e.code))})}a(TWs,"useFunc");zs.useFunc=TWs;var whr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(whr||(zs.Type=whr={}));function IWs(t,e,r){if(t instanceof cu.Name){let n=e===whr.Num;return r?n?(0,cu._)`"[" + ${t} + "]"`:(0,cu._)`"['" + ${t} + "']"`:n?(0,cu._)`"/" + ${t}`:(0,cu._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,cu.getProperty)(t).toString():"/"+Rhr(t)}a(IWs,"getErrorPath");zs.getErrorPath=IWs;function Nei(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}a(Nei,"checkStrictMode");zs.checkStrictMode=Nei});var z8=I(Phr=>{"use strict";p();Object.defineProperty(Phr,"__esModule",{value:!0});var H_=Ss(),xWs={data:new H_.Name("data"),valCxt:new H_.Name("valCxt"),instancePath:new H_.Name("instancePath"),parentData:new H_.Name("parentData"),parentDataProperty:new H_.Name("parentDataProperty"),rootData:new H_.Name("rootData"),dynamicAnchors:new H_.Name("dynamicAnchors"),vErrors:new H_.Name("vErrors"),errors:new H_.Name("errors"),this:new H_.Name("this"),self:new H_.Name("self"),scope:new H_.Name("scope"),json:new H_.Name("json"),jsonPos:new H_.Name("jsonPos"),jsonLen:new H_.Name("jsonLen"),jsonPart:new H_.Name("jsonPart")};Phr.default=xWs});var tMe=I(G_=>{"use strict";p();Object.defineProperty(G_,"__esModule",{value:!0});G_.extendErrors=G_.resetErrorsCount=G_.reportExtraError=G_.reportError=G_.keyword$DataError=G_.keywordError=void 0;var sc=Ss(),Xut=oc(),Nv=z8();G_.keywordError={message:a(({keyword:t})=>(0,sc.str)`must pass "${t}" keyword validation`,"message")};G_.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,sc.str)`"${t}" keyword must be ${e} ($data)`:(0,sc.str)`"${t}" keyword is invalid ($data)`,"message")};function wWs(t,e=G_.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=Lei(t,e,r);n??(c||l)?Mei(s,u):Oei(o,(0,sc._)`[${u}]`)}a(wWs,"reportError");G_.reportError=wWs;function RWs(t,e=G_.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=Lei(t,e,r);Mei(o,l),s||c||Oei(n,Nv.default.vErrors)}a(RWs,"reportExtraError");G_.reportExtraError=RWs;function kWs(t,e){t.assign(Nv.default.errors,e),t.if((0,sc._)`${Nv.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,sc._)`${Nv.default.vErrors}.length`,e),()=>t.assign(Nv.default.vErrors,null)))}a(kWs,"resetErrorsCount");G_.resetErrorsCount=kWs;function PWs({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let c=t.name("err");t.forRange("i",o,Nv.default.errors,l=>{t.const(c,(0,sc._)`${Nv.default.vErrors}[${l}]`),t.if((0,sc._)`${c}.instancePath === undefined`,()=>t.assign((0,sc._)`${c}.instancePath`,(0,sc.strConcat)(Nv.default.instancePath,s.errorPath))),t.assign((0,sc._)`${c}.schemaPath`,(0,sc.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,sc._)`${c}.schema`,r),t.assign((0,sc._)`${c}.data`,n))})}a(PWs,"extendErrors");G_.extendErrors=PWs;function Mei(t,e){let r=t.const("err",e);t.if((0,sc._)`${Nv.default.vErrors} === null`,()=>t.assign(Nv.default.vErrors,(0,sc._)`[${r}]`),(0,sc._)`${Nv.default.vErrors}.push(${r})`),t.code((0,sc._)`${Nv.default.errors}++`)}a(Mei,"addError");function Oei(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,sc._)`new ${t.ValidationError}(${e})`):(r.assign((0,sc._)`${n}.errors`,e),r.return(!1))}a(Oei,"returnErrors");var Tee={keyword:new sc.Name("keyword"),schemaPath:new sc.Name("schemaPath"),params:new sc.Name("params"),propertyName:new sc.Name("propertyName"),message:new sc.Name("message"),schema:new sc.Name("schema"),parentSchema:new sc.Name("parentSchema")};function Lei(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,sc._)`{}`:DWs(t,e,r)}a(Lei,"errorObjectCode");function DWs(t,e,r={}){let{gen:n,it:o}=t,s=[NWs(o,r),MWs(t,r)];return OWs(t,e,s),n.object(...s)}a(DWs,"errorObject");function NWs({errorPath:t},{instancePath:e}){let r=e?(0,sc.str)`${t}${(0,Xut.getErrorPath)(e,Xut.Type.Str)}`:t;return[Nv.default.instancePath,(0,sc.strConcat)(Nv.default.instancePath,r)]}a(NWs,"errorInstancePath");function MWs({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,sc.str)`${e}/${t}`;return r&&(o=(0,sc.str)`${o}${(0,Xut.getErrorPath)(r,Xut.Type.Str)}`),[Tee.schemaPath,o]}a(MWs,"errorSchemaPath");function OWs(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:c,it:l}=t,{opts:u,propertyName:d,topSchemaRef:f,schemaPath:h}=l;n.push([Tee.keyword,o],[Tee.params,typeof e=="function"?e(t):e||(0,sc._)`{}`]),u.messages&&n.push([Tee.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([Tee.schema,c],[Tee.parentSchema,(0,sc._)`${f}${h}`],[Nv.default.data,s]),d&&n.push([Tee.propertyName,d])}a(OWs,"extraErrorProps")});var Fei=I(Mme=>{"use strict";p();Object.defineProperty(Mme,"__esModule",{value:!0});Mme.boolOrEmptySchema=Mme.topBoolOrEmptySchema=void 0;var LWs=tMe(),BWs=Ss(),FWs=z8(),UWs={message:"boolean schema is false"};function QWs(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Bei(t,!1):typeof r=="object"&&r.$async===!0?e.return(FWs.default.data):(e.assign((0,BWs._)`${n}.errors`,null),e.return(!0))}a(QWs,"topBoolOrEmptySchema");Mme.topBoolOrEmptySchema=QWs;function qWs(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Bei(t)):r.var(e,!0)}a(qWs,"boolOrEmptySchema");Mme.boolOrEmptySchema=qWs;function Bei(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,LWs.reportError)(o,UWs,void 0,e)}a(Bei,"falseSchemaError")});var Dhr=I(Ome=>{"use strict";p();Object.defineProperty(Ome,"__esModule",{value:!0});Ome.getRules=Ome.isJSONType=void 0;var jWs=["string","number","integer","boolean","null","object","array"],HWs=new Set(jWs);function GWs(t){return typeof t=="string"&&HWs.has(t)}a(GWs,"isJSONType");Ome.isJSONType=GWs;function $Ws(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}a($Ws,"getRules");Ome.getRules=$Ws});var Nhr=I(fG=>{"use strict";p();Object.defineProperty(fG,"__esModule",{value:!0});fG.shouldUseRule=fG.shouldUseGroup=fG.schemaHasRulesForType=void 0;function VWs({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Uei(t,n)}a(VWs,"schemaHasRulesForType");fG.schemaHasRulesForType=VWs;function Uei(t,e){return e.rules.some(r=>Qei(t,r))}a(Uei,"shouldUseGroup");fG.shouldUseGroup=Uei;function Qei(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}a(Qei,"shouldUseRule");fG.shouldUseRule=Qei});var rMe=I($_=>{"use strict";p();Object.defineProperty($_,"__esModule",{value:!0});$_.reportTypeError=$_.checkDataTypes=$_.checkDataType=$_.coerceAndCheckDataType=$_.getJSONTypes=$_.getSchemaTypes=$_.DataType=void 0;var WWs=Dhr(),zWs=Nhr(),YWs=tMe(),hs=Ss(),qei=oc(),Lme;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Lme||($_.DataType=Lme={}));function KWs(t){let e=jei(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}a(KWs,"getSchemaTypes");$_.getSchemaTypes=KWs;function jei(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(WWs.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(jei,"getJSONTypes");$_.getJSONTypes=jei;function JWs(t,e){let{gen:r,data:n,opts:o}=t,s=ZWs(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,zWs.schemaHasRulesForType)(t,e[0]));if(c){let l=Ohr(e,n,o.strictNumbers,Lme.Wrong);r.if(l,()=>{s.length?XWs(t,e,s):Lhr(t)})}return c}a(JWs,"coerceAndCheckDataType");$_.coerceAndCheckDataType=JWs;var Hei=new Set(["string","number","integer","boolean","null"]);function ZWs(t,e){return e?t.filter(r=>Hei.has(r)||e==="array"&&r==="array"):[]}a(ZWs,"coerceToTypes");function XWs(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,hs._)`typeof ${o}`),l=n.let("coerced",(0,hs._)`undefined`);s.coerceTypes==="array"&&n.if((0,hs._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,hs._)`${o}[0]`).assign(c,(0,hs._)`typeof ${o}`).if(Ohr(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,hs._)`${l} !== undefined`);for(let d of r)(Hei.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),Lhr(t),n.endIf(),n.if((0,hs._)`${l} !== undefined`,()=>{n.assign(o,l),ezs(t,l)});function u(d){switch(d){case"string":n.elseIf((0,hs._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,hs._)`"" + ${o}`).elseIf((0,hs._)`${o} === null`).assign(l,(0,hs._)`""`);return;case"number":n.elseIf((0,hs._)`${c} == "boolean" || ${o} === null || (${c} == "string" && ${o} && ${o} == +${o})`).assign(l,(0,hs._)`+${o}`);return;case"integer":n.elseIf((0,hs._)`${c} === "boolean" || ${o} === null || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,(0,hs._)`+${o}`);return;case"boolean":n.elseIf((0,hs._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf((0,hs._)`${o} === "true" || ${o} === 1`).assign(l,!0);return;case"null":n.elseIf((0,hs._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(l,null);return;case"array":n.elseIf((0,hs._)`${c} === "string" || ${c} === "number" - || ${c} === "boolean" || ${o} === null`).assign(l,(0,hs._)`[${o}]`)}}a(u,"coerceSpecificType")}a(JWs,"coerceData");function ZWs({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,hs._)`${e} !== undefined`,()=>t.assign((0,hs._)`${e}[${r}]`,n))}a(ZWs,"assignParentData");function Nhr(t,e,r,n=Lme.Correct){let o=n===Lme.Correct?hs.operators.EQ:hs.operators.NEQ,s;switch(t){case"null":return(0,hs._)`${e} ${o} null`;case"array":s=(0,hs._)`Array.isArray(${e})`;break;case"object":s=(0,hs._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,hs._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,hs._)`typeof ${e} ${o} ${t}`}return n===Lme.Correct?s:(0,hs.not)(s);function c(l=hs.nil){return(0,hs.and)((0,hs._)`typeof ${e} == "number"`,l,r?(0,hs._)`isFinite(${e})`:hs.nil)}}a(Nhr,"checkDataType");$_.checkDataType=Nhr;function Mhr(t,e,r,n){if(t.length===1)return Nhr(t[0],e,r,n);let o,s=(0,Uei.toHash)(t);if(s.array&&s.object){let c=(0,hs._)`typeof ${e} != "object"`;o=s.null?c:(0,hs._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=hs.nil;s.number&&delete s.integer;for(let c in s)o=(0,hs.and)(o,Nhr(c,e,r,n));return o}a(Mhr,"checkDataTypes");$_.checkDataTypes=Mhr;var XWs={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,hs._)`{type: ${t}}`:(0,hs._)`{type: ${e}}`,"params")};function Ohr(t){let e=ezs(t);(0,WWs.reportError)(e,XWs)}a(Ohr,"reportTypeError");$_.reportTypeError=Ohr;function ezs(t){let{gen:e,data:r,schema:n}=t,o=(0,Uei.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(ezs,"getTypeErrorContext")});var Hei=I(edt=>{"use strict";p();Object.defineProperty(edt,"__esModule",{value:!0});edt.assignDefaults=void 0;var Bme=Ss(),tzs=oc();function rzs(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)jei(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>jei(t,s,o.default))}a(rzs,"assignDefaults");edt.assignDefaults=rzs;function jei(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,Bme._)`${s}${(0,Bme.getProperty)(e)}`;if(o){(0,tzs.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,Bme._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,Bme._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,Bme._)`${l} = ${(0,Bme.stringify)(r)}`)}a(jei,"assignDefault")});var SR=I(ql=>{"use strict";p();Object.defineProperty(ql,"__esModule",{value:!0});ql.validateUnion=ql.validateArray=ql.usePattern=ql.callValidateCode=ql.schemaProperties=ql.allSchemaProperties=ql.noPropertyInData=ql.propertyInData=ql.isOwnProperty=ql.hasPropFunc=ql.reportMissingProp=ql.checkMissingProp=ql.checkReportMissingProp=void 0;var Cd=Ss(),Lhr=oc(),fG=z8(),nzs=oc();function izs(t,e){let{gen:r,data:n,it:o}=t;r.if(Fhr(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Cd._)`${e}`},!0),t.error()})}a(izs,"checkReportMissingProp");ql.checkReportMissingProp=izs;function ozs({gen:t,data:e,it:{opts:r}},n,o){return(0,Cd.or)(...n.map(s=>(0,Cd.and)(Fhr(t,e,s,r.ownProperties),(0,Cd._)`${o} = ${s}`)))}a(ozs,"checkMissingProp");ql.checkMissingProp=ozs;function szs(t,e){t.setParams({missingProperty:e},!0),t.error()}a(szs,"reportMissingProp");ql.reportMissingProp=szs;function Gei(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Cd._)`Object.prototype.hasOwnProperty`})}a(Gei,"hasPropFunc");ql.hasPropFunc=Gei;function Bhr(t,e,r){return(0,Cd._)`${Gei(t)}.call(${e}, ${r})`}a(Bhr,"isOwnProperty");ql.isOwnProperty=Bhr;function azs(t,e,r,n){let o=(0,Cd._)`${e}${(0,Cd.getProperty)(r)} !== undefined`;return n?(0,Cd._)`${o} && ${Bhr(t,e,r)}`:o}a(azs,"propertyInData");ql.propertyInData=azs;function Fhr(t,e,r,n){let o=(0,Cd._)`${e}${(0,Cd.getProperty)(r)} === undefined`;return n?(0,Cd.or)(o,(0,Cd.not)(Bhr(t,e,r))):o}a(Fhr,"noPropertyInData");ql.noPropertyInData=Fhr;function $ei(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a($ei,"allSchemaProperties");ql.allSchemaProperties=$ei;function czs(t,e){return $ei(e).filter(r=>!(0,Lhr.alwaysValidSchema)(t,e[r]))}a(czs,"schemaProperties");ql.schemaProperties=czs;function lzs({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,Cd._)`${t}, ${e}, ${n}${o}`:e,h=[[fG.default.instancePath,(0,Cd.strConcat)(fG.default.instancePath,s)],[fG.default.parentData,c.parentData],[fG.default.parentDataProperty,c.parentDataProperty],[fG.default.rootData,fG.default.rootData]];c.opts.dynamicRef&&h.push([fG.default.dynamicAnchors,fG.default.dynamicAnchors]);let m=(0,Cd._)`${f}, ${r.object(...h)}`;return u!==Cd.nil?(0,Cd._)`${l}.call(${u}, ${m})`:(0,Cd._)`${l}(${m})`}a(lzs,"callValidateCode");ql.callValidateCode=lzs;var uzs=(0,Cd._)`new RegExp`;function dzs({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,Cd._)`${o.code==="new RegExp"?uzs:(0,nzs.useFunc)(t,o)}(${r}, ${n})`})}a(dzs,"usePattern");ql.usePattern=dzs;function fzs(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let l=e.let("valid",!0);return c(()=>e.assign(l,!1)),l}return e.var(s,!0),c(()=>e.break()),s;function c(l){let u=e.const("len",(0,Cd._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:Lhr.Type.Num},s),e.if((0,Cd.not)(s),l)})}a(c,"validateItems")}a(fzs,"validateArray");ql.validateArray=fzs;function pzs(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Lhr.alwaysValidSchema)(o,u))&&!o.opts.unevaluated)return;let c=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((u,d)=>{let f=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(c,(0,Cd._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,Cd.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(pzs,"validateUnion");ql.validateUnion=pzs});var zei=I(x4=>{"use strict";p();Object.defineProperty(x4,"__esModule",{value:!0});x4.validateKeywordUsage=x4.validSchemaType=x4.funcKeywordCode=x4.macroKeywordCode=void 0;var Mv=Ss(),Tee=z8(),hzs=SR(),mzs=tMe();function gzs(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=Wei(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Mv.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}a(gzs,"macroKeywordCode");x4.macroKeywordCode=gzs;function Azs(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;_zs(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=Wei(n,o,d),h=n.let("valid");t.block$data(h,m),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function m(){if(e.errors===!1)y(),e.modifying&&Vei(t),_(()=>t.error());else{let E=e.async?g():A();e.modifying&&Vei(t),_(()=>yzs(t,E))}}a(m,"validateKeyword");function g(){let E=n.let("ruleErrs",null);return n.try(()=>y((0,Mv._)`await `),v=>n.assign(h,!1).if((0,Mv._)`${v} instanceof ${u.ValidationError}`,()=>n.assign(E,(0,Mv._)`${v}.errors`),()=>n.throw(v))),E}a(g,"validateAsync");function A(){let E=(0,Mv._)`${f}.errors`;return n.assign(E,null),y(Mv.nil),E}a(A,"validateSync");function y(E=e.async?(0,Mv._)`await `:Mv.nil){let v=u.opts.passContext?Tee.default.this:Tee.default.self,S=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,Mv._)`${E}${(0,hzs.callValidateCode)(t,f,v,S)}`,e.modifying)}a(y,"assignValid");function _(E){var v;n.if((0,Mv.not)((v=e.valid)!==null&&v!==void 0?v:h),E)}a(_,"reportErrs")}a(Azs,"funcKeywordCode");x4.funcKeywordCode=Azs;function Vei(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Mv._)`${n.parentData}[${n.parentDataProperty}]`))}a(Vei,"modifyData");function yzs(t,e){let{gen:r}=t;r.if((0,Mv._)`Array.isArray(${e})`,()=>{r.assign(Tee.default.vErrors,(0,Mv._)`${Tee.default.vErrors} === null ? ${e} : ${Tee.default.vErrors}.concat(${e})`).assign(Tee.default.errors,(0,Mv._)`${Tee.default.vErrors}.length`),(0,mzs.extendErrors)(t)},()=>t.error())}a(yzs,"addErrs");function _zs({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(_zs,"checkAsyncKeyword");function Wei(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Mv.stringify)(r)})}a(Wei,"useKeyword");function Ezs(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}a(Ezs,"validSchemaType");x4.validSchemaType=Ezs;function vzs({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let c=o.dependencies;if(c?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${c.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}a(vzs,"validateKeywordUsage");x4.validateKeywordUsage=vzs});var Kei=I(pG=>{"use strict";p();Object.defineProperty(pG,"__esModule",{value:!0});pG.extendSubschemaMode=pG.extendSubschemaData=pG.getSubschema=void 0;var w4=Ss(),Yei=oc();function Czs(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,w4._)`${t.schemaPath}${(0,w4.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,w4._)`${t.schemaPath}${(0,w4.getProperty)(e)}${(0,w4.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Yei.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||c===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}a(Czs,"getSubschema");pG.getSubschema=Czs;function bzs(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:d,dataPathArr:f,opts:h}=e,m=l.let("data",(0,w4._)`${e.data}${(0,w4.getProperty)(r)}`,!0);u(m),t.errorPath=(0,w4.str)`${d}${(0,Yei.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,w4._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof w4.Name?o:l.let("data",o,!0);u(d),c!==void 0&&(t.propertyName=c)}s&&(t.dataTypes=s);function u(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}a(u,"dataContextProps")}a(bzs,"extendSubschemaData");pG.extendSubschemaData=bzs;function Szs(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}a(Szs,"extendSubschemaMode");pG.extendSubschemaMode=Szs});var Uhr=I((dOf,Jei)=>{"use strict";p();Jei.exports=a(function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var c=s[o];if(!t(e[c],r[c]))return!1}return!0}return e!==e&&r!==r},"equal")});var Xei=I((hOf,Zei)=>{"use strict";p();var hG=Zei.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};tdt(e,n,o,t,"",t)};hG.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};hG.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};hG.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};hG.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function tdt(t,e,r,n,o,s,c,l,u,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,c,l,u,d);for(var f in n){var h=n[f];if(Array.isArray(h)){if(f in hG.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(Vb,"__esModule",{value:!0});Vb.getSchemaRefs=Vb.resolveUrl=Vb.normalizeId=Vb._getFullPath=Vb.getFullPath=Vb.inlineRef=void 0;var Izs=oc(),xzs=Uhr(),wzs=Xei(),Rzs=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function kzs(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Qhr(t):e?eti(t)<=e:!1}a(kzs,"inlineRef");Vb.inlineRef=kzs;var Pzs=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Qhr(t){for(let e in t){if(Pzs.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Qhr)||typeof r=="object"&&Qhr(r))return!0}return!1}a(Qhr,"hasRef");function eti(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!Rzs.has(r)&&(typeof t[r]=="object"&&(0,Izs.eachItem)(t[r],n=>e+=eti(n)),e===1/0))return 1/0}return e}a(eti,"countKeys");function tti(t,e="",r){r!==!1&&(e=Fme(e));let n=t.parse(e);return rti(t,n)}a(tti,"getFullPath");Vb.getFullPath=tti;function rti(t,e){return t.serialize(e).split("#")[0]+"#"}a(rti,"_getFullPath");Vb._getFullPath=rti;var Dzs=/#\/?$/;function Fme(t){return t?t.replace(Dzs,""):""}a(Fme,"normalizeId");Vb.normalizeId=Fme;function Nzs(t,e,r){return r=Fme(r),t.resolve(e,r)}a(Nzs,"resolveUrl");Vb.resolveUrl=Nzs;var Mzs=/^[a-z_][-a-z0-9._]*$/i;function Ozs(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Fme(t[r]||e),s={"":o},c=tti(n,o,!1),l={},u=new Set;return wzs(t,{allKeys:!0},(h,m,g,A)=>{if(A===void 0)return;let y=c+m,_=s[A];typeof h[r]=="string"&&(_=E.call(this,h[r])),v.call(this,h.$anchor),v.call(this,h.$dynamicAnchor),s[m]=_;function E(S){let T=this.opts.uriResolver.resolve;if(S=Fme(_?T(_,S):S),u.has(S))throw f(S);u.add(S);let w=this.refs[S];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?d(h,w.schema,S):S!==Fme(y)&&(S[0]==="#"?(d(h,l[S],S),l[S]=h):this.refs[S]=y),S}a(E,"addRef");function v(S){if(typeof S=="string"){if(!Mzs.test(S))throw new Error(`invalid anchor "${S}"`);E.call(this,`#${S}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!xzs(h,m))throw f(g)}a(d,"checkAmbiguosRef");function f(h){return new Error(`reference "${h}" resolves to more than one schema`)}a(f,"ambiguos")}a(Ozs,"getSchemaRefs");Vb.getSchemaRefs=Ozs});var sMe=I(mG=>{"use strict";p();Object.defineProperty(mG,"__esModule",{value:!0});mG.getData=mG.KeywordCxt=mG.validateFunctionCode=void 0;var ati=Lei(),nti=rMe(),jhr=Dhr(),rdt=rMe(),Lzs=Hei(),oMe=zei(),qhr=Kei(),ai=Ss(),mo=z8(),Bzs=nMe(),Y8=oc(),iMe=tMe();function Fzs(t){if(uti(t)&&(dti(t),lti(t))){qzs(t);return}cti(t,()=>(0,ati.topBoolOrEmptySchema)(t))}a(Fzs,"validateFunctionCode");mG.validateFunctionCode=Fzs;function cti({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,ai._)`${mo.default.data}, ${mo.default.valCxt}`,n.$async,()=>{t.code((0,ai._)`"use strict"; ${iti(r,o)}`),Qzs(t,o),t.code(s)}):t.func(e,(0,ai._)`${mo.default.data}, ${Uzs(o)}`,n.$async,()=>t.code(iti(r,o)).code(s))}a(cti,"validateFunction");function Uzs(t){return(0,ai._)`{${mo.default.instancePath}="", ${mo.default.parentData}, ${mo.default.parentDataProperty}, ${mo.default.rootData}=${mo.default.data}${t.dynamicRef?(0,ai._)`, ${mo.default.dynamicAnchors}={}`:ai.nil}}={}`}a(Uzs,"destructureValCxt");function Qzs(t,e){t.if(mo.default.valCxt,()=>{t.var(mo.default.instancePath,(0,ai._)`${mo.default.valCxt}.${mo.default.instancePath}`),t.var(mo.default.parentData,(0,ai._)`${mo.default.valCxt}.${mo.default.parentData}`),t.var(mo.default.parentDataProperty,(0,ai._)`${mo.default.valCxt}.${mo.default.parentDataProperty}`),t.var(mo.default.rootData,(0,ai._)`${mo.default.valCxt}.${mo.default.rootData}`),e.dynamicRef&&t.var(mo.default.dynamicAnchors,(0,ai._)`${mo.default.valCxt}.${mo.default.dynamicAnchors}`)},()=>{t.var(mo.default.instancePath,(0,ai._)`""`),t.var(mo.default.parentData,(0,ai._)`undefined`),t.var(mo.default.parentDataProperty,(0,ai._)`undefined`),t.var(mo.default.rootData,mo.default.data),e.dynamicRef&&t.var(mo.default.dynamicAnchors,(0,ai._)`{}`)})}a(Qzs,"destructureValCxtES5");function qzs(t){let{schema:e,opts:r,gen:n}=t;cti(t,()=>{r.$comment&&e.$comment&&pti(t),Vzs(t),n.let(mo.default.vErrors,null),n.let(mo.default.errors,0),r.unevaluated&&jzs(t),fti(t),Yzs(t)})}a(qzs,"topSchemaObjCode");function jzs(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ai._)`${r}.evaluated`),e.if((0,ai._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ai._)`${t.evaluated}.props`,(0,ai._)`undefined`)),e.if((0,ai._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ai._)`${t.evaluated}.items`,(0,ai._)`undefined`))}a(jzs,"resetEvaluated");function iti(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ai._)`/*# sourceURL=${r} */`:ai.nil}a(iti,"funcSourceUrl");function Hzs(t,e){if(uti(t)&&(dti(t),lti(t))){Gzs(t,e);return}(0,ati.boolOrEmptySchema)(t,e)}a(Hzs,"subschemaCode");function lti({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}a(lti,"schemaCxtHasRules");function uti(t){return typeof t.schema!="boolean"}a(uti,"isSchemaObj");function Gzs(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&pti(t),Wzs(t),zzs(t);let s=n.const("_errs",mo.default.errors);fti(t,s),n.var(e,(0,ai._)`${s} === ${mo.default.errors}`)}a(Gzs,"subSchemaObjCode");function dti(t){(0,Y8.checkUnknownRules)(t),$zs(t)}a(dti,"checkKeywords");function fti(t,e){if(t.opts.jtd)return oti(t,[],!1,e);let r=(0,nti.getSchemaTypes)(t.schema),n=(0,nti.coerceAndCheckDataType)(t,r);oti(t,r,!n,e)}a(fti,"typeAndKeywords");function $zs(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Y8.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a($zs,"checkRefsAndKeywords");function Vzs(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Y8.checkStrictMode)(t,"default is ignored in the schema root")}a(Vzs,"checkNoDefault");function Wzs(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Bzs.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(Wzs,"updateContext");function zzs(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(zzs,"checkAsyncSchema");function pti({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,ai._)`${mo.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let c=(0,ai.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ai._)`${mo.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(pti,"commentKeyword");function Yzs(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,ai._)`${mo.default.errors} === 0`,()=>e.return(mo.default.data),()=>e.throw((0,ai._)`new ${o}(${mo.default.vErrors})`)):(e.assign((0,ai._)`${n}.errors`,mo.default.vErrors),s.unevaluated&&Kzs(t),e.return((0,ai._)`${mo.default.errors} === 0`))}a(Yzs,"returnResults");function Kzs({gen:t,evaluated:e,props:r,items:n}){r instanceof ai.Name&&t.assign((0,ai._)`${e}.props`,r),n instanceof ai.Name&&t.assign((0,ai._)`${e}.items`,n)}a(Kzs,"assignEvaluated");function oti(t,e,r,n){let{gen:o,schema:s,data:c,allErrors:l,opts:u,self:d}=t,{RULES:f}=d;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,Y8.schemaHasRulesButRef)(s,f))){o.block(()=>mti(t,"$ref",f.all.$ref.definition));return}u.jtd||Jzs(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,jhr.shouldUseGroup)(s,m)&&(m.type?(o.if((0,rdt.checkDataType)(m.type,c,u.strictNumbers)),sti(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,rdt.reportTypeError)(t)),o.endIf()):sti(t,m),l||o.if((0,ai._)`${mo.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a(oti,"schemaKeywords");function sti(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,Lzs.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,jhr.shouldUseRule)(n,s)&&mti(t,s.keyword,s.definition,e.type)})}a(sti,"iterateKeywords");function Jzs(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Zzs(t,e),t.opts.allowUnionTypes||Xzs(t,e),eYs(t,t.dataTypes))}a(Jzs,"checkStrictTypes");function Zzs(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{hti(t.dataTypes,r)||Hhr(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),rYs(t,e)}}a(Zzs,"checkContextTypes");function Xzs(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Hhr(t,"use allowUnionTypes to allow union type keyword")}a(Xzs,"checkMultipleTypes");function eYs(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,jhr.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>tYs(e,c))&&Hhr(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(eYs,"checkKeywordTypes");function tYs(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(tYs,"hasApplicableType");function hti(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(hti,"includesType");function rYs(t,e){let r=[];for(let n of t.dataTypes)hti(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(rYs,"narrowSchemaTypes");function Hhr(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Y8.checkStrictMode)(t,e,t.opts.strictTypes)}a(Hhr,"strictTypesError");var ndt=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,oMe.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Y8.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",gti(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,oMe.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",mo.default.errors))}result(e,r,n){this.failResult((0,ai.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,ai.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,ai._)`${r} !== undefined && (${(0,ai.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?iMe.reportExtraError:iMe.reportError)(this,this.def.error,r)}$dataError(){(0,iMe.reportError)(this,this.def.$dataError||iMe.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,iMe.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=ai.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ai.nil,r=ai.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:c}=this;n.if((0,ai.or)((0,ai._)`${o} === undefined`,r)),e!==ai.nil&&n.assign(e,!0),(s.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ai.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,ai.or)(c(),l());function c(){if(n.length){if(!(r instanceof ai.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,ai._)`${(0,rdt.checkDataTypes)(u,r,s.opts.strictNumbers,rdt.DataType.Wrong)}`}return ai.nil}function l(){if(o.validateSchema){let u=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,ai._)`!${u}(${r})`}return ai.nil}}subschema(e,r){let n=(0,qhr.getSubschema)(this.it,e);(0,qhr.extendSubschemaData)(n,this.it,e),(0,qhr.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return Hzs(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Y8.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Y8.mergeEvaluated.items(o,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(e,ai.Name)),!0}};mG.KeywordCxt=ndt;function mti(t,e,r,n){let o=new ndt(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,oMe.funcKeywordCode)(o,r):"macro"in r?(0,oMe.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,oMe.funcKeywordCode)(o,r)}a(mti,"keywordCode");var nYs=/^\/(?:[^~]|~0|~1)*$/,iYs=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function gti(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return mo.default.rootData;if(t[0]==="/"){if(!nYs.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=mo.default.rootData}else{let d=iYs.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let f=+d[1];if(o=d[2],o==="#"){if(f>=e)throw new Error(u("property/index",f));return n[e-f]}if(f>e)throw new Error(u("data",f));if(s=r[e-f],!o)return s}let c=s,l=o.split("/");for(let d of l)d&&(s=(0,ai._)`${s}${(0,ai.getProperty)((0,Y8.unescapeJsonPointer)(d))}`,c=(0,ai._)`${c} && ${s}`);return c;function u(d,f){return`Cannot access ${d} ${f} levels up, current level is ${e}`}}a(gti,"getData");mG.getData=gti});var idt=I($hr=>{"use strict";p();Object.defineProperty($hr,"__esModule",{value:!0});var Ghr=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};$hr.default=Ghr});var aMe=I(zhr=>{"use strict";p();Object.defineProperty(zhr,"__esModule",{value:!0});var Vhr=nMe(),Whr=class extends Error{static{a(this,"MissingRefError")}constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Vhr.resolveUrl)(e,r,n),this.missingSchema=(0,Vhr.normalizeId)((0,Vhr.getFullPath)(e,this.missingRef))}};zhr.default=Whr});var sdt=I(TR=>{"use strict";p();Object.defineProperty(TR,"__esModule",{value:!0});TR.resolveSchema=TR.getCompilingSchema=TR.resolveRef=TR.compileSchema=TR.SchemaEnv=void 0;var lD=Ss(),oYs=idt(),Iee=z8(),uD=nMe(),Ati=oc(),sYs=sMe(),Ume=class{static{a(this,"SchemaEnv")}constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,uD.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};TR.SchemaEnv=Ume;function Khr(t){let e=yti.call(this,t);if(e)return e;let r=(0,uD.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,c=new lD.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),l;t.$async&&(l=c.scopeValue("Error",{ref:oYs.default,code:(0,lD._)`require("ajv/dist/runtime/validation_error").default`}));let u=c.scopeName("validate");t.validateName=u;let d={gen:c,allErrors:this.opts.allErrors,data:Iee.default.data,parentData:Iee.default.parentData,parentDataProperty:Iee.default.parentDataProperty,dataNames:[Iee.default.data],dataPathArr:[lD.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,lD.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:lD.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,lD._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,sYs.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(Iee.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${Iee.default.self}`,`${Iee.default.scope}`,f)(this,this.scope.get());if(this.scope.value(u,{ref:g}),g.errors=null,g.schema=t.schema,g.schemaEnv=t,t.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:u,validateCode:h,scopeValues:c._values}),this.opts.unevaluated){let{props:A,items:y}=d;g.evaluated={props:A instanceof lD.Name?void 0:A,items:y instanceof lD.Name?void 0:y,dynamicProps:A instanceof lD.Name,dynamicItems:y instanceof lD.Name},g.source&&(g.source.evaluated=(0,lD.stringify)(g.evaluated))}return t.validate=g,t}catch(h){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),h}finally{this._compilations.delete(t)}}a(Khr,"compileSchema");TR.compileSchema=Khr;function aYs(t,e,r){var n;r=(0,uD.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=uYs.call(this,t,r);if(s===void 0){let c=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;c&&(s=new Ume({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=cYs.call(this,s)}a(aYs,"resolveRef");TR.resolveRef=aYs;function cYs(t){return(0,uD.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Khr.call(this,t)}a(cYs,"inlineOrCompile");function yti(t){for(let e of this._compilations)if(lYs(e,t))return e}a(yti,"getCompilingSchema");TR.getCompilingSchema=yti;function lYs(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(lYs,"sameSchemaEnv");function uYs(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||odt.call(this,t,e)}a(uYs,"resolve");function odt(t,e){let r=this.opts.uriResolver.parse(e),n=(0,uD._getFullPath)(this.opts.uriResolver,r),o=(0,uD.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Yhr.call(this,r,t);let s=(0,uD.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=odt.call(this,t,c);return typeof l?.schema!="object"?void 0:Yhr.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||Khr.call(this,c),s===(0,uD.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,uD.resolveUrl)(this.opts.uriResolver,o,d)),new Ume({schema:l,schemaId:u,root:t,baseId:o})}return Yhr.call(this,r,c)}}a(odt,"resolveSchema");TR.resolveSchema=odt;var dYs=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Yhr(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,Ati.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!dYs.has(l)&&d&&(e=(0,uD.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,Ati.schemaHasRulesButRef)(r,this.RULES)){let l=(0,uD.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=odt.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new Ume({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a(Yhr,"getJsonPointer")});var _ti=I((DOf,fYs)=>{fYs.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Xhr=I((NOf,Tti)=>{"use strict";p();var pYs=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),vti=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),Jhr=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Cti=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),hYs=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Zhr(t){let e="",r=0,n=0;for(n=0;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}a(Zhr,"stringArrayToHexStripped");var mYs=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Eti(t){return t.length=0,!0}a(Eti,"consumeIsZone");function gYs(t,e,r){if(t.length){let n=Zhr(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(gYs,"consumeHextets");function AYs(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=gYs;for(let u=0;u7){r.error=!0;break}u>0&&t[u-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(o,n,r))break;l=Eti}else{o.push(d);continue}}return o.length&&(l===Eti?r.zone=o.join(""):c?n.push(o.join("")):n.push(Zhr(o))),r.address=n.join(""),r}a(AYs,"getIPV6");function bti(t){if(yYs(t,":")<2)return{host:t,isIPV6:!1};let e=AYs(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}a(bti,"normalizeIPv6");function yYs(t,e){let r=0;for(let n=0;nEYs[n])}a(Sti,"reescapeHostDelimiters");function bYs(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:xYs}=Xhr(),wYs=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,RYs=["http","https","ws","wss","urn","urn:uuid"];function kYs(t){return RYs.indexOf(t)!==-1}a(kYs,"isValidSchemeName");function emr(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}a(emr,"wsIsSecure");function Iti(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(Iti,"httpParse");function xti(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}a(xti,"httpSerialize");function PYs(t){return t.secure=emr(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(PYs,"wsParse");function DYs(t){if((t.port===(emr(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}a(DYs,"wsSerialize");function NYs(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(wYs);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=tmr(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(NYs,"urnParse");function MYs(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=tmr(o);s&&(t=s.serialize(t,e));let c=t,l=t.nss;return c.path=`${n||e.nid}:${l}`,e.skipEscape=!0,c}a(MYs,"urnSerialize");function OYs(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!xYs(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a(OYs,"urnuuidParse");function LYs(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(LYs,"urnuuidSerialize");var wti={scheme:"http",domainHost:!0,parse:Iti,serialize:xti},BYs={scheme:"https",domainHost:wti.domainHost,parse:Iti,serialize:xti},adt={scheme:"ws",domainHost:!0,parse:PYs,serialize:DYs},FYs={scheme:"wss",domainHost:adt.domainHost,parse:adt.parse,serialize:adt.serialize},UYs={scheme:"urn",parse:NYs,serialize:MYs,skipNormalize:!0},QYs={scheme:"urn:uuid",parse:OYs,serialize:LYs,skipNormalize:!0},cdt={http:wti,https:BYs,ws:adt,wss:FYs,urn:UYs,"urn:uuid":QYs};Object.setPrototypeOf(cdt,null);function tmr(t){return t&&(cdt[t]||cdt[t.toLowerCase()])||void 0}a(tmr,"getSchemeHandler");Rti.exports={wsIsSecure:emr,SCHEMES:cdt,isValidSchemeName:kYs,getSchemeHandler:tmr}});var Lti=I((UOf,ldt)=>{"use strict";p();var{normalizeIPv6:qYs,removeDotSegments:cMe,recomposeAuthority:jYs,normalizePercentEncoding:HYs,normalizePathEncoding:GYs,escapePreservingEscapes:$Ys,reescapeHostDelimiters:VYs,isIPv4:WYs,nonSimpleDomain:zYs}=Xhr(),{SCHEMES:YYs,getSchemeHandler:Dti}=kti();function KYs(t,e){return typeof t=="string"?t=rKs(t,e):typeof t=="object"&&(t=Qme(xee(t,e),e)),t}a(KYs,"normalize");function JYs(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=Nti(Qme(t,n),Qme(e,n),n,!0);return n.skipEscape=!0,xee(o,n)}a(JYs,"resolve");function Nti(t,e,r,n){let o={};return n||(t=Qme(xee(t,r),r),e=Qme(xee(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=cMe(e.path||""),o.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=cMe(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=cMe(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=cMe(o.path)),o.query=e.query):(o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}a(Nti,"resolveComponent");function ZYs(t,e,r){let n=Pti(t,r),o=Pti(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(ZYs,"equal");function xee(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[],s=Dti(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=HYs(r.path):(r.path=$Ys(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=jYs(r);if(c!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(c),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=cMe(l)),c===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),o.push(l)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}a(xee,"serialize");var XYs=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,eKs=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/;function tKs(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}a(tKs,"getParseError");function Mti(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let c=t.match(eKs);c!==null&&c[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",o=!0);let l=t.match(XYs);if(l){n.scheme=l[1],n.userinfo=l[3],n.host=l[4],n.port=parseInt(l[5],10),n.path=l[6]||"",n.query=l[7],n.fragment=l[8],isNaN(n.port)&&(n.port=l[5]);let u=tKs(n,l);if(u!==void 0&&(n.error=n.error||u,o=!0),n.host)if(WYs(n.host)===!1){let h=qYs(n.host);n.host=h.host.toLowerCase(),s=h.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let d=Dti(r.scheme||n.scheme);if(!r.unicodeSupport&&(!d||!d.unicodeSupport)&&n.host&&(r.domainHost||d&&d.domainHost)&&s===!1&&zYs(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(f){n.error=n.error||"Host's domain name can not be converted to ASCII: "+f}if((!d||d&&!d.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=VYs(unescape(n.host),s))),n.path&&(n.path=GYs(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}d&&d.parse&&d.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}a(Mti,"parseWithStatus");function Qme(t,e){return Mti(t,e).parsed}a(Qme,"parse");function rKs(t,e){return Oti(t,e).normalized}a(rKs,"normalizeString");function Oti(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Mti(t,e);return{normalized:n?t:xee(r,e),malformedAuthorityOrPort:n}}a(Oti,"normalizeStringWithStatus");function Pti(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Oti(t,e);return n?void 0:r}if(typeof t=="object")return xee(t,e)}a(Pti,"normalizeComparableURI");var rmr={SCHEMES:YYs,normalize:KYs,resolve:JYs,resolveComponent:Nti,equal:ZYs,serialize:xee,parse:Qme};ldt.exports=rmr;ldt.exports.default=rmr;ldt.exports.fastUri=rmr});var Fti=I(nmr=>{"use strict";p();Object.defineProperty(nmr,"__esModule",{value:!0});var Bti=Lti();Bti.code='require("ajv/dist/runtime/uri").default';nmr.default=Bti});var Vti=I(hy=>{"use strict";p();Object.defineProperty(hy,"__esModule",{value:!0});hy.CodeGen=hy.Name=hy.nil=hy.stringify=hy.str=hy._=hy.KeywordCxt=void 0;var nKs=sMe();Object.defineProperty(hy,"KeywordCxt",{enumerable:!0,get:a(function(){return nKs.KeywordCxt},"get")});var qme=Ss();Object.defineProperty(hy,"_",{enumerable:!0,get:a(function(){return qme._},"get")});Object.defineProperty(hy,"str",{enumerable:!0,get:a(function(){return qme.str},"get")});Object.defineProperty(hy,"stringify",{enumerable:!0,get:a(function(){return qme.stringify},"get")});Object.defineProperty(hy,"nil",{enumerable:!0,get:a(function(){return qme.nil},"get")});Object.defineProperty(hy,"Name",{enumerable:!0,get:a(function(){return qme.Name},"get")});Object.defineProperty(hy,"CodeGen",{enumerable:!0,get:a(function(){return qme.CodeGen},"get")});var iKs=idt(),Hti=aMe(),oKs=Phr(),lMe=sdt(),sKs=Ss(),uMe=nMe(),udt=rMe(),omr=oc(),Uti=_ti(),aKs=Fti(),Gti=a((t,e)=>new RegExp(t,e),"defaultRegExp");Gti.code="new RegExp";var cKs=["removeAdditional","useDefaults","coerceTypes"],lKs=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),uKs={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},dKs={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Qti=200;function fKs(t){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S,T,w,R,x,k,D;let N=t.strict,O=(e=t.code)===null||e===void 0?void 0:e.optimize,B=O===!0||O===void 0?1:O||0,q=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Gti,M=(o=t.uriResolver)!==null&&o!==void 0?o:aKs.default;return{strictSchema:(c=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&c!==void 0?c:!0,strictNumbers:(u=(l=t.strictNumbers)!==null&&l!==void 0?l:N)!==null&&u!==void 0?u:!0,strictTypes:(f=(d=t.strictTypes)!==null&&d!==void 0?d:N)!==null&&f!==void 0?f:"log",strictTuples:(m=(h=t.strictTuples)!==null&&h!==void 0?h:N)!==null&&m!==void 0?m:"log",strictRequired:(A=(g=t.strictRequired)!==null&&g!==void 0?g:N)!==null&&A!==void 0?A:!1,code:t.code?{...t.code,optimize:B,regExp:q}:{optimize:B,regExp:q},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:Qti,loopEnum:(_=t.loopEnum)!==null&&_!==void 0?_:Qti,meta:(E=t.meta)!==null&&E!==void 0?E:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(S=t.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(T=t.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(R=t.validateSchema)!==null&&R!==void 0?R:!0,validateFormats:(x=t.validateFormats)!==null&&x!==void 0?x:!0,unicodeRegExp:(k=t.unicodeRegExp)!==null&&k!==void 0?k:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:M}}a(fKs,"requiredOptions");var dMe=class{static{a(this,"Ajv")}constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...fKs(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new sKs.ValueScope({scope:{},prefixes:lKs,es5:r,lines:n}),this.logger=yKs(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,oKs.getRules)(),qti.call(this,uKs,e,"NOT SUPPORTED"),qti.call(this,dKs,e,"DEPRECATED","warn"),this._metaOpts=gKs.call(this),e.formats&&hKs.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&mKs.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),pKs.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=Uti;n==="id"&&(o={...Uti},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(f,h){await s.call(this,f.$schema);let m=this._addSchema(f,h);return m.validate||c.call(this,m)}async function s(f){f&&!this.getSchema(f)&&await o.call(this,{$ref:f},!0)}async function c(f){try{return this._compileSchemaEnv(f)}catch(h){if(!(h instanceof Hti.default))throw h;return l.call(this,h),await u.call(this,h.missingSchema),c.call(this,f)}}function l({missingSchema:f,missingRef:h}){if(this.refs[f])throw new Error(`AnySchema ${f} is loaded but ${h} cannot be resolved`)}async function u(f){let h=await d.call(this,f);this.refs[f]||await s.call(this,h.$schema),this.refs[f]||this.addSchema(h,f,r)}async function d(f){let h=this._loading[f];if(h)return h;try{return await(this._loading[f]=n(f))}finally{delete this._loading[f]}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let c of e)this.addSchema(c,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:c}=this.opts;if(s=e[c],s!==void 0&&typeof s!="string")throw new Error(`schema ${c} must be string`)}return r=(0,uMe.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=jti.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new lMe.SchemaEnv({schema:{},schemaId:n});if(r=lMe.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=jti.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,uMe.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(EKs.call(this,n,r),!r)return(0,omr.eachItem)(n,s=>imr.call(this,s)),this;CKs.call(this,r);let o={...r,type:(0,udt.getJSONTypes)(r.type),schemaType:(0,udt.getJSONTypes)(r.schemaType)};return(0,omr.eachItem)(n,o.type.length===0?s=>imr.call(this,s,o):s=>o.type.forEach(c=>imr.call(this,s,o,c))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),c=e;for(let l of s)c=c[l];for(let l in n){let u=n[l];if(typeof u!="object")continue;let{$data:d}=u.definition,f=c[l];d&&f&&(c[l]=$ti(f))}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]))}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let c,{schemaId:l}=this.opts;if(typeof e=="object")c=e[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;n=(0,uMe.normalizeId)(c||n);let d=uMe.getSchemaRefs.call(this,e,n);return u=new lMe.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),o&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):lMe.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{lMe.compileSchema.call(this,e)}finally{this.opts=r}}};dMe.ValidationError=iKs.default;dMe.MissingRefError=Hti.default;hy.default=dMe;function qti(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`)}}a(qti,"checkOptions");function jti(t){return t=(0,uMe.normalizeId)(t),this.schemas[t]||this.refs[t]}a(jti,"getSchEnv");function pKs(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}a(pKs,"addInitialSchemas");function hKs(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(hKs,"addInitialFormats");function mKs(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}a(mKs,"addInitialKeywords");function gKs(){let t={...this.opts};for(let e of cKs)delete t[e];return t}a(gKs,"getMetaSchemaOptions");var AKs={log(){},warn(){},error(){}};function yKs(t){if(t===!1)return AKs;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}a(yKs,"getLogger");var _Ks=/^[a-z_$][a-z0-9_$:-]*$/i;function EKs(t,e){let{RULES:r}=this;if((0,omr.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!_Ks.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}a(EKs,"checkKeyword");function imr(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,c=o?s.post:s.rules.find(({type:u})=>u===r);if(c||(c={type:r,rules:[]},s.rules.push(c)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,udt.getJSONTypes)(e.type),schemaType:(0,udt.getJSONTypes)(e.schemaType)}};e.before?vKs.call(this,c,l,e.before):c.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}a(imr,"addRule");function vKs(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}a(vKs,"addBeforeRule");function CKs(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=$ti(e)),t.validateSchema=this.compile(e,!0))}a(CKs,"keywordMetaschema");var bKs={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function $ti(t){return{anyOf:[t,bKs]}}a($ti,"schemaOrData")});var Wti=I(smr=>{"use strict";p();Object.defineProperty(smr,"__esModule",{value:!0});var SKs={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};smr.default=SKs});var Jti=I(wee=>{"use strict";p();Object.defineProperty(wee,"__esModule",{value:!0});wee.callRef=wee.getValidate=void 0;var TKs=aMe(),zti=SR(),Wb=Ss(),jme=z8(),Yti=sdt(),ddt=oc(),IKs={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:c,opts:l,self:u}=n,{root:d}=s;if((r==="#"||r==="#/")&&o===d.baseId)return h();let f=Yti.resolveRef.call(u,d,o,r);if(f===void 0)throw new TKs.default(n.opts.uriResolver,o,r);if(f instanceof Yti.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return fdt(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return fdt(t,(0,Wb._)`${A}.validate`,d,d.$async)}function m(A){let y=Kti(t,A);fdt(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,Wb.stringify)(A)}:{ref:A}),_=e.name("valid"),E=t.subschema({schema:A,dataTypes:[],schemaPath:Wb.nil,topSchemaRef:y,errSchemaPath:r},_);t.mergeEvaluated(E),t.ok(_)}}};function Kti(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Wb._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(Kti,"getValidate");wee.getValidate=Kti;function fdt(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?jme.default.this:Wb.nil;n?f():h();function f(){if(!l.$async)throw new Error("async schema referenced by sync schema");let A=o.let("valid");o.try(()=>{o.code((0,Wb._)`await ${(0,zti.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,Wb._)`!(${y} instanceof ${s.ValidationError})`,()=>o.throw(y)),m(y),c||o.assign(A,!1)}),t.ok(A)}a(f,"callAsyncRef");function h(){t.result((0,zti.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,Wb._)`${A}.errors`;o.assign(jme.default.vErrors,(0,Wb._)`${jme.default.vErrors} === null ? ${y} : ${jme.default.vErrors}.concat(${y})`),o.assign(jme.default.errors,(0,Wb._)`${jme.default.vErrors}.length`)}a(m,"addErrorsFrom");function g(A){var y;if(!s.opts.unevaluated)return;let _=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(s.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(s.props=ddt.mergeEvaluated.props(o,_.props,s.props));else{let E=o.var("props",(0,Wb._)`${A}.evaluated.props`);s.props=ddt.mergeEvaluated.props(o,E,s.props,Wb.Name)}if(s.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(s.items=ddt.mergeEvaluated.items(o,_.items,s.items));else{let E=o.var("items",(0,Wb._)`${A}.evaluated.items`);s.items=ddt.mergeEvaluated.items(o,E,s.items,Wb.Name)}}a(g,"addEvaluatedFrom")}a(fdt,"callRef");wee.callRef=fdt;wee.default=IKs});var Zti=I(amr=>{"use strict";p();Object.defineProperty(amr,"__esModule",{value:!0});var xKs=Wti(),wKs=Jti(),RKs=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",xKs.default,wKs.default];amr.default=RKs});var Xti=I(cmr=>{"use strict";p();Object.defineProperty(cmr,"__esModule",{value:!0});var pdt=Ss(),gG=pdt.operators,hdt={maximum:{okStr:"<=",ok:gG.LTE,fail:gG.GT},minimum:{okStr:">=",ok:gG.GTE,fail:gG.LT},exclusiveMaximum:{okStr:"<",ok:gG.LT,fail:gG.GTE},exclusiveMinimum:{okStr:">",ok:gG.GT,fail:gG.LTE}},kKs={message:a(({keyword:t,schemaCode:e})=>(0,pdt.str)`must be ${hdt[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,pdt._)`{comparison: ${hdt[t].okStr}, limit: ${e}}`,"params")},PKs={keyword:Object.keys(hdt),type:"number",schemaType:"number",$data:!0,error:kKs,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,pdt._)`${r} ${hdt[e].fail} ${n} || isNaN(${r})`)}};cmr.default=PKs});var eri=I(lmr=>{"use strict";p();Object.defineProperty(lmr,"__esModule",{value:!0});var fMe=Ss(),DKs={message:a(({schemaCode:t})=>(0,fMe.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,fMe._)`{multipleOf: ${t}}`,"params")},NKs={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:DKs,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,fMe._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,fMe._)`${c} !== parseInt(${c})`;t.fail$data((0,fMe._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};lmr.default=NKs});var rri=I(umr=>{"use strict";p();Object.defineProperty(umr,"__esModule",{value:!0});function tri(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(dmr,"__esModule",{value:!0});var Ree=Ss(),MKs=oc(),OKs=rri(),LKs={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Ree.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,Ree._)`{limit: ${t}}`,"params")},BKs={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:LKs,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?Ree.operators.GT:Ree.operators.LT,c=o.opts.unicode===!1?(0,Ree._)`${r}.length`:(0,Ree._)`${(0,MKs.useFunc)(t.gen,OKs.default)}(${r})`;t.fail$data((0,Ree._)`${c} ${s} ${n}`)}};dmr.default=BKs});var iri=I(fmr=>{"use strict";p();Object.defineProperty(fmr,"__esModule",{value:!0});var FKs=SR(),UKs=oc(),Hme=Ss(),QKs={message:a(({schemaCode:t})=>(0,Hme.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,Hme._)`{pattern: ${t}}`,"params")},qKs={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:QKs,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:c}=t,l=c.opts.unicodeRegExp?"u":"";if(n){let{regExp:u}=c.opts.code,d=u.code==="new RegExp"?(0,Hme._)`new RegExp`:(0,UKs.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,Hme._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,Hme._)`!${f}`)}else{let u=(0,FKs.usePattern)(t,o);t.fail$data((0,Hme._)`!${u}.test(${r})`)}}};fmr.default=qKs});var ori=I(pmr=>{"use strict";p();Object.defineProperty(pmr,"__esModule",{value:!0});var pMe=Ss(),jKs={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,pMe.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,pMe._)`{limit: ${t}}`,"params")},HKs={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:jKs,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?pMe.operators.GT:pMe.operators.LT;t.fail$data((0,pMe._)`Object.keys(${r}).length ${o} ${n}`)}};pmr.default=HKs});var sri=I(hmr=>{"use strict";p();Object.defineProperty(hmr,"__esModule",{value:!0});var hMe=SR(),mMe=Ss(),GKs=oc(),$Ks={message:a(({params:{missingProperty:t}})=>(0,mMe.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,mMe._)`{missingProperty: ${t}}`,"params")},VKs={keyword:"required",type:"object",schemaType:"array",$data:!0,error:$Ks,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:c}=t,{opts:l}=c;if(!s&&r.length===0)return;let u=r.length>=l.loopRequired;if(c.allErrors?d():f(),l.strictRequired){let g=t.parentSchema.properties,{definedProperties:A}=t.it;for(let y of r)if(g?.[y]===void 0&&!A.has(y)){let _=c.schemaEnv.baseId+c.errSchemaPath,E=`required property "${y}" is not defined at "${_}" (strictRequired)`;(0,GKs.checkStrictMode)(c,E,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(mMe.nil,h);else for(let g of r)(0,hMe.checkReportMissingProp)(t,g)}a(d,"allErrorsMode");function f(){let g=e.let("missing");if(u||s){let A=e.let("valid",!0);t.block$data(A,()=>m(g,A)),t.ok(A)}else e.if((0,hMe.checkMissingProp)(t,r,g)),(0,hMe.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,hMe.noPropertyInData)(e,o,g,l.ownProperties),()=>t.error())})}a(h,"loopAllRequired");function m(g,A){t.setParams({missingProperty:g}),e.forOf(g,n,()=>{e.assign(A,(0,hMe.propertyInData)(e,o,g,l.ownProperties)),e.if((0,mMe.not)(A),()=>{t.error(),e.break()})},mMe.nil)}a(m,"loopUntilMissing")}};hmr.default=VKs});var ari=I(mmr=>{"use strict";p();Object.defineProperty(mmr,"__esModule",{value:!0});var gMe=Ss(),WKs={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,gMe.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,gMe._)`{limit: ${t}}`,"params")},zKs={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:WKs,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?gMe.operators.GT:gMe.operators.LT;t.fail$data((0,gMe._)`${r}.length ${o} ${n}`)}};mmr.default=zKs});var mdt=I(gmr=>{"use strict";p();Object.defineProperty(gmr,"__esModule",{value:!0});var cri=Uhr();cri.code='require("ajv/dist/runtime/equal").default';gmr.default=cri});var lri=I(ymr=>{"use strict";p();Object.defineProperty(ymr,"__esModule",{value:!0});var Amr=rMe(),my=Ss(),YKs=oc(),KKs=mdt(),JKs={message:a(({params:{i:t,j:e}})=>(0,my.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,my._)`{i: ${t}, j: ${e}}`,"params")},ZKs={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:JKs,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:c,it:l}=t;if(!n&&!o)return;let u=e.let("valid"),d=s.items?(0,Amr.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,my._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,my._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,my._)`${A} > 1`,()=>(h()?m:g)(A,y))}a(f,"validateUniqueItems");function h(){return d.length>0&&!d.some(A=>A==="object"||A==="array")}a(h,"canOptimize");function m(A,y){let _=e.name("item"),E=(0,Amr.checkDataTypes)(d,_,l.opts.strictNumbers,Amr.DataType.Wrong),v=e.const("indices",(0,my._)`{}`);e.for((0,my._)`;${A}--;`,()=>{e.let(_,(0,my._)`${r}[${A}]`),e.if(E,(0,my._)`continue`),d.length>1&&e.if((0,my._)`typeof ${_} == "string"`,(0,my._)`${_} += "_"`),e.if((0,my._)`typeof ${v}[${_}] == "number"`,()=>{e.assign(y,(0,my._)`${v}[${_}]`),t.error(),e.assign(u,!1).break()}).code((0,my._)`${v}[${_}] = ${A}`)})}a(m,"loopN");function g(A,y){let _=(0,YKs.useFunc)(e,KKs.default),E=e.name("outer");e.label(E).for((0,my._)`;${A}--;`,()=>e.for((0,my._)`${y} = ${A}; ${y}--;`,()=>e.if((0,my._)`${_}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(E)})))}a(g,"loopN2")}};ymr.default=ZKs});var uri=I(Emr=>{"use strict";p();Object.defineProperty(Emr,"__esModule",{value:!0});var _mr=Ss(),XKs=oc(),eJs=mdt(),tJs={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,_mr._)`{allowedValue: ${t}}`,"params")},rJs={keyword:"const",$data:!0,error:tJs,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,_mr._)`!${(0,XKs.useFunc)(e,eJs.default)}(${r}, ${o})`):t.fail((0,_mr._)`${s} !== ${r}`)}};Emr.default=rJs});var dri=I(vmr=>{"use strict";p();Object.defineProperty(vmr,"__esModule",{value:!0});var AMe=Ss(),nJs=oc(),iJs=mdt(),oJs={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,AMe._)`{allowedValues: ${t}}`,"params")},sJs={keyword:"enum",schemaType:"array",$data:!0,error:oJs,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:c}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let l=o.length>=c.opts.loopEnum,u,d=a(()=>u??(u=(0,nJs.useFunc)(e,iJs.default)),"getEql"),f;if(l||n)f=e.let("valid"),t.block$data(f,h);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let g=e.const("vSchema",s);f=(0,AMe.or)(...o.map((A,y)=>m(g,y)))}t.pass(f);function h(){e.assign(f,!1),e.forOf("v",s,g=>e.if((0,AMe._)`${d()}(${r}, ${g})`,()=>e.assign(f,!0).break()))}a(h,"loopEnum");function m(g,A){let y=o[A];return typeof y=="object"&&y!==null?(0,AMe._)`${d()}(${r}, ${g}[${A}])`:(0,AMe._)`${r} === ${y}`}a(m,"equalCode")}};vmr.default=sJs});var fri=I(Cmr=>{"use strict";p();Object.defineProperty(Cmr,"__esModule",{value:!0});var aJs=Xti(),cJs=eri(),lJs=nri(),uJs=iri(),dJs=ori(),fJs=sri(),pJs=ari(),hJs=lri(),mJs=uri(),gJs=dri(),AJs=[aJs.default,cJs.default,lJs.default,uJs.default,dJs.default,fJs.default,pJs.default,hJs.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},mJs.default,gJs.default];Cmr.default=AJs});var Smr=I(yMe=>{"use strict";p();Object.defineProperty(yMe,"__esModule",{value:!0});yMe.validateAdditionalItems=void 0;var kee=Ss(),bmr=oc(),yJs={message:a(({params:{len:t}})=>(0,kee.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,kee._)`{limit: ${t}}`,"params")},_Js={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:yJs,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,bmr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}pri(t,n)}};function pri(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,kee._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,kee._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,bmr.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,kee._)`${l} <= ${e.length}`);r.if((0,kee.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:bmr.Type.Num},d),c.allErrors||r.if((0,kee.not)(d),()=>r.break())})}a(u,"validateItems")}a(pri,"validateAdditionalItems");yMe.validateAdditionalItems=pri;yMe.default=_Js});var Tmr=I(_Me=>{"use strict";p();Object.defineProperty(_Me,"__esModule",{value:!0});_Me.validateTuple=void 0;var hri=Ss(),gdt=oc(),EJs=SR(),vJs={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return mri(t,"additionalItems",e);r.items=!0,!(0,gdt.alwaysValidSchema)(r,e)&&t.ok((0,EJs.validateArray)(t))}};function mri(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:c,it:l}=t;f(o),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=gdt.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,hri._)`${s}.length`);r.forEach((h,m)=>{(0,gdt.alwaysValidSchema)(l,h)||(n.if((0,hri._)`${d} > ${m}`,()=>t.subschema({keyword:c,schemaProp:m,dataProp:m},u)),t.ok(u))});function f(h){let{opts:m,errSchemaPath:g}=l,A=r.length,y=A===h.minItems&&(A===h.maxItems||h[e]===!1);if(m.strictTuples&&!y){let _=`"${c}" is ${A}-tuple, but minItems or maxItems/${e} are not specified or different at path "${g}"`;(0,gdt.checkStrictMode)(l,_,m.strictTuples)}}a(f,"checkStrictTuple")}a(mri,"validateTuple");_Me.validateTuple=mri;_Me.default=vJs});var gri=I(Imr=>{"use strict";p();Object.defineProperty(Imr,"__esModule",{value:!0});var CJs=Tmr(),bJs={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,CJs.validateTuple)(t,"items"),"code")};Imr.default=bJs});var yri=I(xmr=>{"use strict";p();Object.defineProperty(xmr,"__esModule",{value:!0});var Ari=Ss(),SJs=oc(),TJs=SR(),IJs=Smr(),xJs={message:a(({params:{len:t}})=>(0,Ari.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,Ari._)`{limit: ${t}}`,"params")},wJs={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:xJs,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,SJs.alwaysValidSchema)(n,e)&&(o?(0,IJs.validateAdditionalItems)(t,o):t.ok((0,TJs.validateArray)(t)))}};xmr.default=wJs});var _ri=I(wmr=>{"use strict";p();Object.defineProperty(wmr,"__esModule",{value:!0});var IR=Ss(),Adt=oc(),RJs={message:a(({params:{min:t,max:e}})=>e===void 0?(0,IR.str)`must contain at least ${t} valid item(s)`:(0,IR.str)`must contain at least ${t} and no more than ${e} valid item(s)`,"message"),params:a(({params:{min:t,max:e}})=>e===void 0?(0,IR._)`{minContains: ${t}}`:(0,IR._)`{minContains: ${t}, maxContains: ${e}}`,"params")},kJs={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:RJs,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,c,l,{minContains:u,maxContains:d}=n;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=e.const("len",(0,IR._)`${o}.length`);if(t.setParams({min:c,max:l}),l===void 0&&c===0){(0,Adt.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,Adt.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Adt.alwaysValidSchema)(s,r)){let y=(0,IR._)`${f} >= ${c}`;l!==void 0&&(y=(0,IR._)`${y} && ${f} <= ${l}`),t.pass(y);return}s.items=!0;let h=e.name("valid");l===void 0&&c===1?g(h,()=>e.if(h,()=>e.break())):c===0?(e.let(h,!0),l!==void 0&&e.if((0,IR._)`${o}.length > 0`,m)):(e.let(h,!1),m()),t.result(h,()=>t.reset());function m(){let y=e.name("_valid"),_=e.let("count",0);g(y,()=>e.if(y,()=>A(_)))}a(m,"validateItemsWithCount");function g(y,_){e.forRange("i",0,f,E=>{t.subschema({keyword:"contains",dataProp:E,dataPropType:Adt.Type.Num,compositeRule:!0},y),_()})}a(g,"validateItems");function A(y){e.code((0,IR._)`${y}++`),l===void 0?e.if((0,IR._)`${y} >= ${c}`,()=>e.assign(h,!0).break()):(e.if((0,IR._)`${y} > ${l}`,()=>e.assign(h,!1).break()),c===1?e.assign(h,!0):e.if((0,IR._)`${y} >= ${c}`,()=>e.assign(h,!0)))}a(A,"checkLimits")}};wmr.default=kJs});var Cri=I(R4=>{"use strict";p();Object.defineProperty(R4,"__esModule",{value:!0});R4.validateSchemaDeps=R4.validatePropertyDeps=R4.error=void 0;var Rmr=Ss(),PJs=oc(),EMe=SR();R4.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Rmr.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Rmr._)`{property: ${t}, + || ${c} === "boolean" || ${o} === null`).assign(l,(0,hs._)`[${o}]`)}}a(u,"coerceSpecificType")}a(XWs,"coerceData");function ezs({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,hs._)`${e} !== undefined`,()=>t.assign((0,hs._)`${e}[${r}]`,n))}a(ezs,"assignParentData");function Mhr(t,e,r,n=Lme.Correct){let o=n===Lme.Correct?hs.operators.EQ:hs.operators.NEQ,s;switch(t){case"null":return(0,hs._)`${e} ${o} null`;case"array":s=(0,hs._)`Array.isArray(${e})`;break;case"object":s=(0,hs._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,hs._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,hs._)`typeof ${e} ${o} ${t}`}return n===Lme.Correct?s:(0,hs.not)(s);function c(l=hs.nil){return(0,hs.and)((0,hs._)`typeof ${e} == "number"`,l,r?(0,hs._)`isFinite(${e})`:hs.nil)}}a(Mhr,"checkDataType");$_.checkDataType=Mhr;function Ohr(t,e,r,n){if(t.length===1)return Mhr(t[0],e,r,n);let o,s=(0,qei.toHash)(t);if(s.array&&s.object){let c=(0,hs._)`typeof ${e} != "object"`;o=s.null?c:(0,hs._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=hs.nil;s.number&&delete s.integer;for(let c in s)o=(0,hs.and)(o,Mhr(c,e,r,n));return o}a(Ohr,"checkDataTypes");$_.checkDataTypes=Ohr;var tzs={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,hs._)`{type: ${t}}`:(0,hs._)`{type: ${e}}`,"params")};function Lhr(t){let e=rzs(t);(0,YWs.reportError)(e,tzs)}a(Lhr,"reportTypeError");$_.reportTypeError=Lhr;function rzs(t){let{gen:e,data:r,schema:n}=t,o=(0,qei.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(rzs,"getTypeErrorContext")});var $ei=I(edt=>{"use strict";p();Object.defineProperty(edt,"__esModule",{value:!0});edt.assignDefaults=void 0;var Bme=Ss(),nzs=oc();function izs(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)Gei(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>Gei(t,s,o.default))}a(izs,"assignDefaults");edt.assignDefaults=izs;function Gei(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,Bme._)`${s}${(0,Bme.getProperty)(e)}`;if(o){(0,nzs.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,Bme._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,Bme._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,Bme._)`${l} = ${(0,Bme.stringify)(r)}`)}a(Gei,"assignDefault")});var SR=I(ql=>{"use strict";p();Object.defineProperty(ql,"__esModule",{value:!0});ql.validateUnion=ql.validateArray=ql.usePattern=ql.callValidateCode=ql.schemaProperties=ql.allSchemaProperties=ql.noPropertyInData=ql.propertyInData=ql.isOwnProperty=ql.hasPropFunc=ql.reportMissingProp=ql.checkMissingProp=ql.checkReportMissingProp=void 0;var bd=Ss(),Bhr=oc(),pG=z8(),ozs=oc();function szs(t,e){let{gen:r,data:n,it:o}=t;r.if(Uhr(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,bd._)`${e}`},!0),t.error()})}a(szs,"checkReportMissingProp");ql.checkReportMissingProp=szs;function azs({gen:t,data:e,it:{opts:r}},n,o){return(0,bd.or)(...n.map(s=>(0,bd.and)(Uhr(t,e,s,r.ownProperties),(0,bd._)`${o} = ${s}`)))}a(azs,"checkMissingProp");ql.checkMissingProp=azs;function czs(t,e){t.setParams({missingProperty:e},!0),t.error()}a(czs,"reportMissingProp");ql.reportMissingProp=czs;function Vei(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,bd._)`Object.prototype.hasOwnProperty`})}a(Vei,"hasPropFunc");ql.hasPropFunc=Vei;function Fhr(t,e,r){return(0,bd._)`${Vei(t)}.call(${e}, ${r})`}a(Fhr,"isOwnProperty");ql.isOwnProperty=Fhr;function lzs(t,e,r,n){let o=(0,bd._)`${e}${(0,bd.getProperty)(r)} !== undefined`;return n?(0,bd._)`${o} && ${Fhr(t,e,r)}`:o}a(lzs,"propertyInData");ql.propertyInData=lzs;function Uhr(t,e,r,n){let o=(0,bd._)`${e}${(0,bd.getProperty)(r)} === undefined`;return n?(0,bd.or)(o,(0,bd.not)(Fhr(t,e,r))):o}a(Uhr,"noPropertyInData");ql.noPropertyInData=Uhr;function Wei(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(Wei,"allSchemaProperties");ql.allSchemaProperties=Wei;function uzs(t,e){return Wei(e).filter(r=>!(0,Bhr.alwaysValidSchema)(t,e[r]))}a(uzs,"schemaProperties");ql.schemaProperties=uzs;function dzs({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,bd._)`${t}, ${e}, ${n}${o}`:e,h=[[pG.default.instancePath,(0,bd.strConcat)(pG.default.instancePath,s)],[pG.default.parentData,c.parentData],[pG.default.parentDataProperty,c.parentDataProperty],[pG.default.rootData,pG.default.rootData]];c.opts.dynamicRef&&h.push([pG.default.dynamicAnchors,pG.default.dynamicAnchors]);let m=(0,bd._)`${f}, ${r.object(...h)}`;return u!==bd.nil?(0,bd._)`${l}.call(${u}, ${m})`:(0,bd._)`${l}(${m})`}a(dzs,"callValidateCode");ql.callValidateCode=dzs;var fzs=(0,bd._)`new RegExp`;function pzs({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,bd._)`${o.code==="new RegExp"?fzs:(0,ozs.useFunc)(t,o)}(${r}, ${n})`})}a(pzs,"usePattern");ql.usePattern=pzs;function hzs(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let l=e.let("valid",!0);return c(()=>e.assign(l,!1)),l}return e.var(s,!0),c(()=>e.break()),s;function c(l){let u=e.const("len",(0,bd._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:Bhr.Type.Num},s),e.if((0,bd.not)(s),l)})}a(c,"validateItems")}a(hzs,"validateArray");ql.validateArray=hzs;function mzs(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Bhr.alwaysValidSchema)(o,u))&&!o.opts.unevaluated)return;let c=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((u,d)=>{let f=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(c,(0,bd._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,bd.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(mzs,"validateUnion");ql.validateUnion=mzs});var Kei=I(x4=>{"use strict";p();Object.defineProperty(x4,"__esModule",{value:!0});x4.validateKeywordUsage=x4.validSchemaType=x4.funcKeywordCode=x4.macroKeywordCode=void 0;var Mv=Ss(),Iee=z8(),gzs=SR(),Azs=tMe();function yzs(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=Yei(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Mv.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}a(yzs,"macroKeywordCode");x4.macroKeywordCode=yzs;function _zs(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;vzs(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=Yei(n,o,d),h=n.let("valid");t.block$data(h,m),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function m(){if(e.errors===!1)y(),e.modifying&&zei(t),_(()=>t.error());else{let E=e.async?g():A();e.modifying&&zei(t),_(()=>Ezs(t,E))}}a(m,"validateKeyword");function g(){let E=n.let("ruleErrs",null);return n.try(()=>y((0,Mv._)`await `),v=>n.assign(h,!1).if((0,Mv._)`${v} instanceof ${u.ValidationError}`,()=>n.assign(E,(0,Mv._)`${v}.errors`),()=>n.throw(v))),E}a(g,"validateAsync");function A(){let E=(0,Mv._)`${f}.errors`;return n.assign(E,null),y(Mv.nil),E}a(A,"validateSync");function y(E=e.async?(0,Mv._)`await `:Mv.nil){let v=u.opts.passContext?Iee.default.this:Iee.default.self,S=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,Mv._)`${E}${(0,gzs.callValidateCode)(t,f,v,S)}`,e.modifying)}a(y,"assignValid");function _(E){var v;n.if((0,Mv.not)((v=e.valid)!==null&&v!==void 0?v:h),E)}a(_,"reportErrs")}a(_zs,"funcKeywordCode");x4.funcKeywordCode=_zs;function zei(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Mv._)`${n.parentData}[${n.parentDataProperty}]`))}a(zei,"modifyData");function Ezs(t,e){let{gen:r}=t;r.if((0,Mv._)`Array.isArray(${e})`,()=>{r.assign(Iee.default.vErrors,(0,Mv._)`${Iee.default.vErrors} === null ? ${e} : ${Iee.default.vErrors}.concat(${e})`).assign(Iee.default.errors,(0,Mv._)`${Iee.default.vErrors}.length`),(0,Azs.extendErrors)(t)},()=>t.error())}a(Ezs,"addErrs");function vzs({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(vzs,"checkAsyncKeyword");function Yei(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Mv.stringify)(r)})}a(Yei,"useKeyword");function Czs(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}a(Czs,"validSchemaType");x4.validSchemaType=Czs;function bzs({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let c=o.dependencies;if(c?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${c.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}a(bzs,"validateKeywordUsage");x4.validateKeywordUsage=bzs});var Zei=I(hG=>{"use strict";p();Object.defineProperty(hG,"__esModule",{value:!0});hG.extendSubschemaMode=hG.extendSubschemaData=hG.getSubschema=void 0;var w4=Ss(),Jei=oc();function Szs(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,w4._)`${t.schemaPath}${(0,w4.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,w4._)`${t.schemaPath}${(0,w4.getProperty)(e)}${(0,w4.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Jei.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||c===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}a(Szs,"getSubschema");hG.getSubschema=Szs;function Tzs(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:d,dataPathArr:f,opts:h}=e,m=l.let("data",(0,w4._)`${e.data}${(0,w4.getProperty)(r)}`,!0);u(m),t.errorPath=(0,w4.str)`${d}${(0,Jei.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,w4._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof w4.Name?o:l.let("data",o,!0);u(d),c!==void 0&&(t.propertyName=c)}s&&(t.dataTypes=s);function u(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}a(u,"dataContextProps")}a(Tzs,"extendSubschemaData");hG.extendSubschemaData=Tzs;function Izs(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}a(Izs,"extendSubschemaMode");hG.extendSubschemaMode=Izs});var Qhr=I((pOf,Xei)=>{"use strict";p();Xei.exports=a(function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var c=s[o];if(!t(e[c],r[c]))return!1}return!0}return e!==e&&r!==r},"equal")});var tti=I((gOf,eti)=>{"use strict";p();var mG=eti.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};tdt(e,n,o,t,"",t)};mG.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};mG.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};mG.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};mG.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function tdt(t,e,r,n,o,s,c,l,u,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,c,l,u,d);for(var f in n){var h=n[f];if(Array.isArray(h)){if(f in mG.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(Vb,"__esModule",{value:!0});Vb.getSchemaRefs=Vb.resolveUrl=Vb.normalizeId=Vb._getFullPath=Vb.getFullPath=Vb.inlineRef=void 0;var wzs=oc(),Rzs=Qhr(),kzs=tti(),Pzs=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Dzs(t,e=!0){return typeof t=="boolean"?!0:e===!0?!qhr(t):e?rti(t)<=e:!1}a(Dzs,"inlineRef");Vb.inlineRef=Dzs;var Nzs=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function qhr(t){for(let e in t){if(Nzs.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(qhr)||typeof r=="object"&&qhr(r))return!0}return!1}a(qhr,"hasRef");function rti(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!Pzs.has(r)&&(typeof t[r]=="object"&&(0,wzs.eachItem)(t[r],n=>e+=rti(n)),e===1/0))return 1/0}return e}a(rti,"countKeys");function nti(t,e="",r){r!==!1&&(e=Fme(e));let n=t.parse(e);return iti(t,n)}a(nti,"getFullPath");Vb.getFullPath=nti;function iti(t,e){return t.serialize(e).split("#")[0]+"#"}a(iti,"_getFullPath");Vb._getFullPath=iti;var Mzs=/#\/?$/;function Fme(t){return t?t.replace(Mzs,""):""}a(Fme,"normalizeId");Vb.normalizeId=Fme;function Ozs(t,e,r){return r=Fme(r),t.resolve(e,r)}a(Ozs,"resolveUrl");Vb.resolveUrl=Ozs;var Lzs=/^[a-z_][-a-z0-9._]*$/i;function Bzs(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Fme(t[r]||e),s={"":o},c=nti(n,o,!1),l={},u=new Set;return kzs(t,{allKeys:!0},(h,m,g,A)=>{if(A===void 0)return;let y=c+m,_=s[A];typeof h[r]=="string"&&(_=E.call(this,h[r])),v.call(this,h.$anchor),v.call(this,h.$dynamicAnchor),s[m]=_;function E(S){let T=this.opts.uriResolver.resolve;if(S=Fme(_?T(_,S):S),u.has(S))throw f(S);u.add(S);let w=this.refs[S];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?d(h,w.schema,S):S!==Fme(y)&&(S[0]==="#"?(d(h,l[S],S),l[S]=h):this.refs[S]=y),S}a(E,"addRef");function v(S){if(typeof S=="string"){if(!Lzs.test(S))throw new Error(`invalid anchor "${S}"`);E.call(this,`#${S}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!Rzs(h,m))throw f(g)}a(d,"checkAmbiguosRef");function f(h){return new Error(`reference "${h}" resolves to more than one schema`)}a(f,"ambiguos")}a(Bzs,"getSchemaRefs");Vb.getSchemaRefs=Bzs});var sMe=I(gG=>{"use strict";p();Object.defineProperty(gG,"__esModule",{value:!0});gG.getData=gG.KeywordCxt=gG.validateFunctionCode=void 0;var lti=Fei(),oti=rMe(),Hhr=Nhr(),rdt=rMe(),Fzs=$ei(),oMe=Kei(),jhr=Zei(),ai=Ss(),mo=z8(),Uzs=nMe(),Y8=oc(),iMe=tMe();function Qzs(t){if(fti(t)&&(pti(t),dti(t))){Hzs(t);return}uti(t,()=>(0,lti.topBoolOrEmptySchema)(t))}a(Qzs,"validateFunctionCode");gG.validateFunctionCode=Qzs;function uti({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,ai._)`${mo.default.data}, ${mo.default.valCxt}`,n.$async,()=>{t.code((0,ai._)`"use strict"; ${sti(r,o)}`),jzs(t,o),t.code(s)}):t.func(e,(0,ai._)`${mo.default.data}, ${qzs(o)}`,n.$async,()=>t.code(sti(r,o)).code(s))}a(uti,"validateFunction");function qzs(t){return(0,ai._)`{${mo.default.instancePath}="", ${mo.default.parentData}, ${mo.default.parentDataProperty}, ${mo.default.rootData}=${mo.default.data}${t.dynamicRef?(0,ai._)`, ${mo.default.dynamicAnchors}={}`:ai.nil}}={}`}a(qzs,"destructureValCxt");function jzs(t,e){t.if(mo.default.valCxt,()=>{t.var(mo.default.instancePath,(0,ai._)`${mo.default.valCxt}.${mo.default.instancePath}`),t.var(mo.default.parentData,(0,ai._)`${mo.default.valCxt}.${mo.default.parentData}`),t.var(mo.default.parentDataProperty,(0,ai._)`${mo.default.valCxt}.${mo.default.parentDataProperty}`),t.var(mo.default.rootData,(0,ai._)`${mo.default.valCxt}.${mo.default.rootData}`),e.dynamicRef&&t.var(mo.default.dynamicAnchors,(0,ai._)`${mo.default.valCxt}.${mo.default.dynamicAnchors}`)},()=>{t.var(mo.default.instancePath,(0,ai._)`""`),t.var(mo.default.parentData,(0,ai._)`undefined`),t.var(mo.default.parentDataProperty,(0,ai._)`undefined`),t.var(mo.default.rootData,mo.default.data),e.dynamicRef&&t.var(mo.default.dynamicAnchors,(0,ai._)`{}`)})}a(jzs,"destructureValCxtES5");function Hzs(t){let{schema:e,opts:r,gen:n}=t;uti(t,()=>{r.$comment&&e.$comment&&mti(t),zzs(t),n.let(mo.default.vErrors,null),n.let(mo.default.errors,0),r.unevaluated&&Gzs(t),hti(t),Jzs(t)})}a(Hzs,"topSchemaObjCode");function Gzs(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ai._)`${r}.evaluated`),e.if((0,ai._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ai._)`${t.evaluated}.props`,(0,ai._)`undefined`)),e.if((0,ai._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ai._)`${t.evaluated}.items`,(0,ai._)`undefined`))}a(Gzs,"resetEvaluated");function sti(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ai._)`/*# sourceURL=${r} */`:ai.nil}a(sti,"funcSourceUrl");function $zs(t,e){if(fti(t)&&(pti(t),dti(t))){Vzs(t,e);return}(0,lti.boolOrEmptySchema)(t,e)}a($zs,"subschemaCode");function dti({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}a(dti,"schemaCxtHasRules");function fti(t){return typeof t.schema!="boolean"}a(fti,"isSchemaObj");function Vzs(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&mti(t),Yzs(t),Kzs(t);let s=n.const("_errs",mo.default.errors);hti(t,s),n.var(e,(0,ai._)`${s} === ${mo.default.errors}`)}a(Vzs,"subSchemaObjCode");function pti(t){(0,Y8.checkUnknownRules)(t),Wzs(t)}a(pti,"checkKeywords");function hti(t,e){if(t.opts.jtd)return ati(t,[],!1,e);let r=(0,oti.getSchemaTypes)(t.schema),n=(0,oti.coerceAndCheckDataType)(t,r);ati(t,r,!n,e)}a(hti,"typeAndKeywords");function Wzs(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Y8.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(Wzs,"checkRefsAndKeywords");function zzs(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Y8.checkStrictMode)(t,"default is ignored in the schema root")}a(zzs,"checkNoDefault");function Yzs(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Uzs.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(Yzs,"updateContext");function Kzs(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(Kzs,"checkAsyncSchema");function mti({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,ai._)`${mo.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let c=(0,ai.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ai._)`${mo.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(mti,"commentKeyword");function Jzs(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,ai._)`${mo.default.errors} === 0`,()=>e.return(mo.default.data),()=>e.throw((0,ai._)`new ${o}(${mo.default.vErrors})`)):(e.assign((0,ai._)`${n}.errors`,mo.default.vErrors),s.unevaluated&&Zzs(t),e.return((0,ai._)`${mo.default.errors} === 0`))}a(Jzs,"returnResults");function Zzs({gen:t,evaluated:e,props:r,items:n}){r instanceof ai.Name&&t.assign((0,ai._)`${e}.props`,r),n instanceof ai.Name&&t.assign((0,ai._)`${e}.items`,n)}a(Zzs,"assignEvaluated");function ati(t,e,r,n){let{gen:o,schema:s,data:c,allErrors:l,opts:u,self:d}=t,{RULES:f}=d;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,Y8.schemaHasRulesButRef)(s,f))){o.block(()=>Ati(t,"$ref",f.all.$ref.definition));return}u.jtd||Xzs(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,Hhr.shouldUseGroup)(s,m)&&(m.type?(o.if((0,rdt.checkDataType)(m.type,c,u.strictNumbers)),cti(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,rdt.reportTypeError)(t)),o.endIf()):cti(t,m),l||o.if((0,ai._)`${mo.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a(ati,"schemaKeywords");function cti(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,Fzs.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Hhr.shouldUseRule)(n,s)&&Ati(t,s.keyword,s.definition,e.type)})}a(cti,"iterateKeywords");function Xzs(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(eYs(t,e),t.opts.allowUnionTypes||tYs(t,e),rYs(t,t.dataTypes))}a(Xzs,"checkStrictTypes");function eYs(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{gti(t.dataTypes,r)||Ghr(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),iYs(t,e)}}a(eYs,"checkContextTypes");function tYs(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Ghr(t,"use allowUnionTypes to allow union type keyword")}a(tYs,"checkMultipleTypes");function rYs(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Hhr.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>nYs(e,c))&&Ghr(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(rYs,"checkKeywordTypes");function nYs(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(nYs,"hasApplicableType");function gti(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(gti,"includesType");function iYs(t,e){let r=[];for(let n of t.dataTypes)gti(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(iYs,"narrowSchemaTypes");function Ghr(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Y8.checkStrictMode)(t,e,t.opts.strictTypes)}a(Ghr,"strictTypesError");var ndt=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,oMe.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Y8.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",yti(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,oMe.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",mo.default.errors))}result(e,r,n){this.failResult((0,ai.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,ai.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,ai._)`${r} !== undefined && (${(0,ai.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?iMe.reportExtraError:iMe.reportError)(this,this.def.error,r)}$dataError(){(0,iMe.reportError)(this,this.def.$dataError||iMe.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,iMe.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=ai.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ai.nil,r=ai.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:c}=this;n.if((0,ai.or)((0,ai._)`${o} === undefined`,r)),e!==ai.nil&&n.assign(e,!0),(s.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ai.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,ai.or)(c(),l());function c(){if(n.length){if(!(r instanceof ai.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,ai._)`${(0,rdt.checkDataTypes)(u,r,s.opts.strictNumbers,rdt.DataType.Wrong)}`}return ai.nil}function l(){if(o.validateSchema){let u=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,ai._)`!${u}(${r})`}return ai.nil}}subschema(e,r){let n=(0,jhr.getSubschema)(this.it,e);(0,jhr.extendSubschemaData)(n,this.it,e),(0,jhr.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return $zs(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Y8.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Y8.mergeEvaluated.items(o,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(e,ai.Name)),!0}};gG.KeywordCxt=ndt;function Ati(t,e,r,n){let o=new ndt(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,oMe.funcKeywordCode)(o,r):"macro"in r?(0,oMe.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,oMe.funcKeywordCode)(o,r)}a(Ati,"keywordCode");var oYs=/^\/(?:[^~]|~0|~1)*$/,sYs=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function yti(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return mo.default.rootData;if(t[0]==="/"){if(!oYs.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=mo.default.rootData}else{let d=sYs.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let f=+d[1];if(o=d[2],o==="#"){if(f>=e)throw new Error(u("property/index",f));return n[e-f]}if(f>e)throw new Error(u("data",f));if(s=r[e-f],!o)return s}let c=s,l=o.split("/");for(let d of l)d&&(s=(0,ai._)`${s}${(0,ai.getProperty)((0,Y8.unescapeJsonPointer)(d))}`,c=(0,ai._)`${c} && ${s}`);return c;function u(d,f){return`Cannot access ${d} ${f} levels up, current level is ${e}`}}a(yti,"getData");gG.getData=yti});var idt=I(Vhr=>{"use strict";p();Object.defineProperty(Vhr,"__esModule",{value:!0});var $hr=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Vhr.default=$hr});var aMe=I(Yhr=>{"use strict";p();Object.defineProperty(Yhr,"__esModule",{value:!0});var Whr=nMe(),zhr=class extends Error{static{a(this,"MissingRefError")}constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Whr.resolveUrl)(e,r,n),this.missingSchema=(0,Whr.normalizeId)((0,Whr.getFullPath)(e,this.missingRef))}};Yhr.default=zhr});var sdt=I(TR=>{"use strict";p();Object.defineProperty(TR,"__esModule",{value:!0});TR.resolveSchema=TR.getCompilingSchema=TR.resolveRef=TR.compileSchema=TR.SchemaEnv=void 0;var lD=Ss(),aYs=idt(),xee=z8(),uD=nMe(),_ti=oc(),cYs=sMe(),Ume=class{static{a(this,"SchemaEnv")}constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,uD.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};TR.SchemaEnv=Ume;function Jhr(t){let e=Eti.call(this,t);if(e)return e;let r=(0,uD.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,c=new lD.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),l;t.$async&&(l=c.scopeValue("Error",{ref:aYs.default,code:(0,lD._)`require("ajv/dist/runtime/validation_error").default`}));let u=c.scopeName("validate");t.validateName=u;let d={gen:c,allErrors:this.opts.allErrors,data:xee.default.data,parentData:xee.default.parentData,parentDataProperty:xee.default.parentDataProperty,dataNames:[xee.default.data],dataPathArr:[lD.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,lD.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:lD.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,lD._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,cYs.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(xee.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${xee.default.self}`,`${xee.default.scope}`,f)(this,this.scope.get());if(this.scope.value(u,{ref:g}),g.errors=null,g.schema=t.schema,g.schemaEnv=t,t.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:u,validateCode:h,scopeValues:c._values}),this.opts.unevaluated){let{props:A,items:y}=d;g.evaluated={props:A instanceof lD.Name?void 0:A,items:y instanceof lD.Name?void 0:y,dynamicProps:A instanceof lD.Name,dynamicItems:y instanceof lD.Name},g.source&&(g.source.evaluated=(0,lD.stringify)(g.evaluated))}return t.validate=g,t}catch(h){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),h}finally{this._compilations.delete(t)}}a(Jhr,"compileSchema");TR.compileSchema=Jhr;function lYs(t,e,r){var n;r=(0,uD.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=fYs.call(this,t,r);if(s===void 0){let c=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;c&&(s=new Ume({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=uYs.call(this,s)}a(lYs,"resolveRef");TR.resolveRef=lYs;function uYs(t){return(0,uD.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Jhr.call(this,t)}a(uYs,"inlineOrCompile");function Eti(t){for(let e of this._compilations)if(dYs(e,t))return e}a(Eti,"getCompilingSchema");TR.getCompilingSchema=Eti;function dYs(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(dYs,"sameSchemaEnv");function fYs(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||odt.call(this,t,e)}a(fYs,"resolve");function odt(t,e){let r=this.opts.uriResolver.parse(e),n=(0,uD._getFullPath)(this.opts.uriResolver,r),o=(0,uD.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Khr.call(this,r,t);let s=(0,uD.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=odt.call(this,t,c);return typeof l?.schema!="object"?void 0:Khr.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||Jhr.call(this,c),s===(0,uD.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,uD.resolveUrl)(this.opts.uriResolver,o,d)),new Ume({schema:l,schemaId:u,root:t,baseId:o})}return Khr.call(this,r,c)}}a(odt,"resolveSchema");TR.resolveSchema=odt;var pYs=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Khr(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,_ti.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!pYs.has(l)&&d&&(e=(0,uD.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,_ti.schemaHasRulesButRef)(r,this.RULES)){let l=(0,uD.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=odt.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new Ume({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a(Khr,"getJsonPointer")});var vti=I((MOf,hYs)=>{hYs.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var emr=I((OOf,xti)=>{"use strict";p();var mYs=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),bti=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),Zhr=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Sti=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),gYs=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Xhr(t){let e="",r=0,n=0;for(n=0;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}a(Xhr,"stringArrayToHexStripped");var AYs=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Cti(t){return t.length=0,!0}a(Cti,"consumeIsZone");function yYs(t,e,r){if(t.length){let n=Xhr(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(yYs,"consumeHextets");function _Ys(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=yYs;for(let u=0;u7){r.error=!0;break}u>0&&t[u-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(o,n,r))break;l=Cti}else{o.push(d);continue}}return o.length&&(l===Cti?r.zone=o.join(""):c?n.push(o.join("")):n.push(Xhr(o))),r.address=n.join(""),r}a(_Ys,"getIPV6");function Tti(t){if(EYs(t,":")<2)return{host:t,isIPV6:!1};let e=_Ys(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}a(Tti,"normalizeIPv6");function EYs(t,e){let r=0;for(let n=0;nCYs[n])}a(Iti,"reescapeHostDelimiters");function TYs(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:RYs}=emr(),kYs=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,PYs=["http","https","ws","wss","urn","urn:uuid"];function DYs(t){return PYs.indexOf(t)!==-1}a(DYs,"isValidSchemeName");function tmr(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}a(tmr,"wsIsSecure");function wti(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(wti,"httpParse");function Rti(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}a(Rti,"httpSerialize");function NYs(t){return t.secure=tmr(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(NYs,"wsParse");function MYs(t){if((t.port===(tmr(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}a(MYs,"wsSerialize");function OYs(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(kYs);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=rmr(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(OYs,"urnParse");function LYs(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=rmr(o);s&&(t=s.serialize(t,e));let c=t,l=t.nss;return c.path=`${n||e.nid}:${l}`,e.skipEscape=!0,c}a(LYs,"urnSerialize");function BYs(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!RYs(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a(BYs,"urnuuidParse");function FYs(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(FYs,"urnuuidSerialize");var kti={scheme:"http",domainHost:!0,parse:wti,serialize:Rti},UYs={scheme:"https",domainHost:kti.domainHost,parse:wti,serialize:Rti},adt={scheme:"ws",domainHost:!0,parse:NYs,serialize:MYs},QYs={scheme:"wss",domainHost:adt.domainHost,parse:adt.parse,serialize:adt.serialize},qYs={scheme:"urn",parse:OYs,serialize:LYs,skipNormalize:!0},jYs={scheme:"urn:uuid",parse:BYs,serialize:FYs,skipNormalize:!0},cdt={http:kti,https:UYs,ws:adt,wss:QYs,urn:qYs,"urn:uuid":jYs};Object.setPrototypeOf(cdt,null);function rmr(t){return t&&(cdt[t]||cdt[t.toLowerCase()])||void 0}a(rmr,"getSchemeHandler");Pti.exports={wsIsSecure:tmr,SCHEMES:cdt,isValidSchemeName:DYs,getSchemeHandler:rmr}});var Fti=I((qOf,ldt)=>{"use strict";p();var{normalizeIPv6:HYs,removeDotSegments:cMe,recomposeAuthority:GYs,normalizePercentEncoding:$Ys,normalizePathEncoding:VYs,escapePreservingEscapes:WYs,reescapeHostDelimiters:zYs,isIPv4:YYs,nonSimpleDomain:KYs}=emr(),{SCHEMES:JYs,getSchemeHandler:Mti}=Dti();function ZYs(t,e){return typeof t=="string"?t=iKs(t,e):typeof t=="object"&&(t=Qme(wee(t,e),e)),t}a(ZYs,"normalize");function XYs(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=Oti(Qme(t,n),Qme(e,n),n,!0);return n.skipEscape=!0,wee(o,n)}a(XYs,"resolve");function Oti(t,e,r,n){let o={};return n||(t=Qme(wee(t,r),r),e=Qme(wee(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=cMe(e.path||""),o.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=cMe(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=cMe(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=cMe(o.path)),o.query=e.query):(o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}a(Oti,"resolveComponent");function eKs(t,e,r){let n=Nti(t,r),o=Nti(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(eKs,"equal");function wee(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[],s=Mti(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=$Ys(r.path):(r.path=WYs(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=GYs(r);if(c!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(c),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=cMe(l)),c===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),o.push(l)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}a(wee,"serialize");var tKs=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,rKs=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/;function nKs(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}a(nKs,"getParseError");function Lti(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let c=t.match(rKs);c!==null&&c[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",o=!0);let l=t.match(tKs);if(l){n.scheme=l[1],n.userinfo=l[3],n.host=l[4],n.port=parseInt(l[5],10),n.path=l[6]||"",n.query=l[7],n.fragment=l[8],isNaN(n.port)&&(n.port=l[5]);let u=nKs(n,l);if(u!==void 0&&(n.error=n.error||u,o=!0),n.host)if(YYs(n.host)===!1){let h=HYs(n.host);n.host=h.host.toLowerCase(),s=h.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let d=Mti(r.scheme||n.scheme);if(!r.unicodeSupport&&(!d||!d.unicodeSupport)&&n.host&&(r.domainHost||d&&d.domainHost)&&s===!1&&KYs(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(f){n.error=n.error||"Host's domain name can not be converted to ASCII: "+f}if((!d||d&&!d.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=zYs(unescape(n.host),s))),n.path&&(n.path=VYs(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}d&&d.parse&&d.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}a(Lti,"parseWithStatus");function Qme(t,e){return Lti(t,e).parsed}a(Qme,"parse");function iKs(t,e){return Bti(t,e).normalized}a(iKs,"normalizeString");function Bti(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Lti(t,e);return{normalized:n?t:wee(r,e),malformedAuthorityOrPort:n}}a(Bti,"normalizeStringWithStatus");function Nti(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Bti(t,e);return n?void 0:r}if(typeof t=="object")return wee(t,e)}a(Nti,"normalizeComparableURI");var nmr={SCHEMES:JYs,normalize:ZYs,resolve:XYs,resolveComponent:Oti,equal:eKs,serialize:wee,parse:Qme};ldt.exports=nmr;ldt.exports.default=nmr;ldt.exports.fastUri=nmr});var Qti=I(imr=>{"use strict";p();Object.defineProperty(imr,"__esModule",{value:!0});var Uti=Fti();Uti.code='require("ajv/dist/runtime/uri").default';imr.default=Uti});var zti=I(hy=>{"use strict";p();Object.defineProperty(hy,"__esModule",{value:!0});hy.CodeGen=hy.Name=hy.nil=hy.stringify=hy.str=hy._=hy.KeywordCxt=void 0;var oKs=sMe();Object.defineProperty(hy,"KeywordCxt",{enumerable:!0,get:a(function(){return oKs.KeywordCxt},"get")});var qme=Ss();Object.defineProperty(hy,"_",{enumerable:!0,get:a(function(){return qme._},"get")});Object.defineProperty(hy,"str",{enumerable:!0,get:a(function(){return qme.str},"get")});Object.defineProperty(hy,"stringify",{enumerable:!0,get:a(function(){return qme.stringify},"get")});Object.defineProperty(hy,"nil",{enumerable:!0,get:a(function(){return qme.nil},"get")});Object.defineProperty(hy,"Name",{enumerable:!0,get:a(function(){return qme.Name},"get")});Object.defineProperty(hy,"CodeGen",{enumerable:!0,get:a(function(){return qme.CodeGen},"get")});var sKs=idt(),$ti=aMe(),aKs=Dhr(),lMe=sdt(),cKs=Ss(),uMe=nMe(),udt=rMe(),smr=oc(),qti=vti(),lKs=Qti(),Vti=a((t,e)=>new RegExp(t,e),"defaultRegExp");Vti.code="new RegExp";var uKs=["removeAdditional","useDefaults","coerceTypes"],dKs=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),fKs={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},pKs={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},jti=200;function hKs(t){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S,T,w,R,x,k,D;let N=t.strict,O=(e=t.code)===null||e===void 0?void 0:e.optimize,B=O===!0||O===void 0?1:O||0,q=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Vti,M=(o=t.uriResolver)!==null&&o!==void 0?o:lKs.default;return{strictSchema:(c=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&c!==void 0?c:!0,strictNumbers:(u=(l=t.strictNumbers)!==null&&l!==void 0?l:N)!==null&&u!==void 0?u:!0,strictTypes:(f=(d=t.strictTypes)!==null&&d!==void 0?d:N)!==null&&f!==void 0?f:"log",strictTuples:(m=(h=t.strictTuples)!==null&&h!==void 0?h:N)!==null&&m!==void 0?m:"log",strictRequired:(A=(g=t.strictRequired)!==null&&g!==void 0?g:N)!==null&&A!==void 0?A:!1,code:t.code?{...t.code,optimize:B,regExp:q}:{optimize:B,regExp:q},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:jti,loopEnum:(_=t.loopEnum)!==null&&_!==void 0?_:jti,meta:(E=t.meta)!==null&&E!==void 0?E:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(S=t.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(T=t.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(R=t.validateSchema)!==null&&R!==void 0?R:!0,validateFormats:(x=t.validateFormats)!==null&&x!==void 0?x:!0,unicodeRegExp:(k=t.unicodeRegExp)!==null&&k!==void 0?k:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:M}}a(hKs,"requiredOptions");var dMe=class{static{a(this,"Ajv")}constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...hKs(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new cKs.ValueScope({scope:{},prefixes:dKs,es5:r,lines:n}),this.logger=EKs(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,aKs.getRules)(),Hti.call(this,fKs,e,"NOT SUPPORTED"),Hti.call(this,pKs,e,"DEPRECATED","warn"),this._metaOpts=yKs.call(this),e.formats&&gKs.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&AKs.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),mKs.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=qti;n==="id"&&(o={...qti},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(f,h){await s.call(this,f.$schema);let m=this._addSchema(f,h);return m.validate||c.call(this,m)}async function s(f){f&&!this.getSchema(f)&&await o.call(this,{$ref:f},!0)}async function c(f){try{return this._compileSchemaEnv(f)}catch(h){if(!(h instanceof $ti.default))throw h;return l.call(this,h),await u.call(this,h.missingSchema),c.call(this,f)}}function l({missingSchema:f,missingRef:h}){if(this.refs[f])throw new Error(`AnySchema ${f} is loaded but ${h} cannot be resolved`)}async function u(f){let h=await d.call(this,f);this.refs[f]||await s.call(this,h.$schema),this.refs[f]||this.addSchema(h,f,r)}async function d(f){let h=this._loading[f];if(h)return h;try{return await(this._loading[f]=n(f))}finally{delete this._loading[f]}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let c of e)this.addSchema(c,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:c}=this.opts;if(s=e[c],s!==void 0&&typeof s!="string")throw new Error(`schema ${c} must be string`)}return r=(0,uMe.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=Gti.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new lMe.SchemaEnv({schema:{},schemaId:n});if(r=lMe.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Gti.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,uMe.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(CKs.call(this,n,r),!r)return(0,smr.eachItem)(n,s=>omr.call(this,s)),this;SKs.call(this,r);let o={...r,type:(0,udt.getJSONTypes)(r.type),schemaType:(0,udt.getJSONTypes)(r.schemaType)};return(0,smr.eachItem)(n,o.type.length===0?s=>omr.call(this,s,o):s=>o.type.forEach(c=>omr.call(this,s,o,c))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),c=e;for(let l of s)c=c[l];for(let l in n){let u=n[l];if(typeof u!="object")continue;let{$data:d}=u.definition,f=c[l];d&&f&&(c[l]=Wti(f))}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]))}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let c,{schemaId:l}=this.opts;if(typeof e=="object")c=e[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;n=(0,uMe.normalizeId)(c||n);let d=uMe.getSchemaRefs.call(this,e,n);return u=new lMe.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),o&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):lMe.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{lMe.compileSchema.call(this,e)}finally{this.opts=r}}};dMe.ValidationError=sKs.default;dMe.MissingRefError=$ti.default;hy.default=dMe;function Hti(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`)}}a(Hti,"checkOptions");function Gti(t){return t=(0,uMe.normalizeId)(t),this.schemas[t]||this.refs[t]}a(Gti,"getSchEnv");function mKs(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}a(mKs,"addInitialSchemas");function gKs(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(gKs,"addInitialFormats");function AKs(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}a(AKs,"addInitialKeywords");function yKs(){let t={...this.opts};for(let e of uKs)delete t[e];return t}a(yKs,"getMetaSchemaOptions");var _Ks={log(){},warn(){},error(){}};function EKs(t){if(t===!1)return _Ks;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}a(EKs,"getLogger");var vKs=/^[a-z_$][a-z0-9_$:-]*$/i;function CKs(t,e){let{RULES:r}=this;if((0,smr.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!vKs.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}a(CKs,"checkKeyword");function omr(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,c=o?s.post:s.rules.find(({type:u})=>u===r);if(c||(c={type:r,rules:[]},s.rules.push(c)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,udt.getJSONTypes)(e.type),schemaType:(0,udt.getJSONTypes)(e.schemaType)}};e.before?bKs.call(this,c,l,e.before):c.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}a(omr,"addRule");function bKs(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}a(bKs,"addBeforeRule");function SKs(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Wti(e)),t.validateSchema=this.compile(e,!0))}a(SKs,"keywordMetaschema");var TKs={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Wti(t){return{anyOf:[t,TKs]}}a(Wti,"schemaOrData")});var Yti=I(amr=>{"use strict";p();Object.defineProperty(amr,"__esModule",{value:!0});var IKs={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};amr.default=IKs});var Xti=I(Ree=>{"use strict";p();Object.defineProperty(Ree,"__esModule",{value:!0});Ree.callRef=Ree.getValidate=void 0;var xKs=aMe(),Kti=SR(),Wb=Ss(),jme=z8(),Jti=sdt(),ddt=oc(),wKs={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:c,opts:l,self:u}=n,{root:d}=s;if((r==="#"||r==="#/")&&o===d.baseId)return h();let f=Jti.resolveRef.call(u,d,o,r);if(f===void 0)throw new xKs.default(n.opts.uriResolver,o,r);if(f instanceof Jti.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return fdt(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return fdt(t,(0,Wb._)`${A}.validate`,d,d.$async)}function m(A){let y=Zti(t,A);fdt(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,Wb.stringify)(A)}:{ref:A}),_=e.name("valid"),E=t.subschema({schema:A,dataTypes:[],schemaPath:Wb.nil,topSchemaRef:y,errSchemaPath:r},_);t.mergeEvaluated(E),t.ok(_)}}};function Zti(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Wb._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(Zti,"getValidate");Ree.getValidate=Zti;function fdt(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?jme.default.this:Wb.nil;n?f():h();function f(){if(!l.$async)throw new Error("async schema referenced by sync schema");let A=o.let("valid");o.try(()=>{o.code((0,Wb._)`await ${(0,Kti.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,Wb._)`!(${y} instanceof ${s.ValidationError})`,()=>o.throw(y)),m(y),c||o.assign(A,!1)}),t.ok(A)}a(f,"callAsyncRef");function h(){t.result((0,Kti.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,Wb._)`${A}.errors`;o.assign(jme.default.vErrors,(0,Wb._)`${jme.default.vErrors} === null ? ${y} : ${jme.default.vErrors}.concat(${y})`),o.assign(jme.default.errors,(0,Wb._)`${jme.default.vErrors}.length`)}a(m,"addErrorsFrom");function g(A){var y;if(!s.opts.unevaluated)return;let _=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(s.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(s.props=ddt.mergeEvaluated.props(o,_.props,s.props));else{let E=o.var("props",(0,Wb._)`${A}.evaluated.props`);s.props=ddt.mergeEvaluated.props(o,E,s.props,Wb.Name)}if(s.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(s.items=ddt.mergeEvaluated.items(o,_.items,s.items));else{let E=o.var("items",(0,Wb._)`${A}.evaluated.items`);s.items=ddt.mergeEvaluated.items(o,E,s.items,Wb.Name)}}a(g,"addEvaluatedFrom")}a(fdt,"callRef");Ree.callRef=fdt;Ree.default=wKs});var eri=I(cmr=>{"use strict";p();Object.defineProperty(cmr,"__esModule",{value:!0});var RKs=Yti(),kKs=Xti(),PKs=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",RKs.default,kKs.default];cmr.default=PKs});var tri=I(lmr=>{"use strict";p();Object.defineProperty(lmr,"__esModule",{value:!0});var pdt=Ss(),AG=pdt.operators,hdt={maximum:{okStr:"<=",ok:AG.LTE,fail:AG.GT},minimum:{okStr:">=",ok:AG.GTE,fail:AG.LT},exclusiveMaximum:{okStr:"<",ok:AG.LT,fail:AG.GTE},exclusiveMinimum:{okStr:">",ok:AG.GT,fail:AG.LTE}},DKs={message:a(({keyword:t,schemaCode:e})=>(0,pdt.str)`must be ${hdt[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,pdt._)`{comparison: ${hdt[t].okStr}, limit: ${e}}`,"params")},NKs={keyword:Object.keys(hdt),type:"number",schemaType:"number",$data:!0,error:DKs,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,pdt._)`${r} ${hdt[e].fail} ${n} || isNaN(${r})`)}};lmr.default=NKs});var rri=I(umr=>{"use strict";p();Object.defineProperty(umr,"__esModule",{value:!0});var fMe=Ss(),MKs={message:a(({schemaCode:t})=>(0,fMe.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,fMe._)`{multipleOf: ${t}}`,"params")},OKs={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:MKs,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,fMe._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,fMe._)`${c} !== parseInt(${c})`;t.fail$data((0,fMe._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};umr.default=OKs});var iri=I(dmr=>{"use strict";p();Object.defineProperty(dmr,"__esModule",{value:!0});function nri(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(fmr,"__esModule",{value:!0});var kee=Ss(),LKs=oc(),BKs=iri(),FKs={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,kee.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,kee._)`{limit: ${t}}`,"params")},UKs={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:FKs,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?kee.operators.GT:kee.operators.LT,c=o.opts.unicode===!1?(0,kee._)`${r}.length`:(0,kee._)`${(0,LKs.useFunc)(t.gen,BKs.default)}(${r})`;t.fail$data((0,kee._)`${c} ${s} ${n}`)}};fmr.default=UKs});var sri=I(pmr=>{"use strict";p();Object.defineProperty(pmr,"__esModule",{value:!0});var QKs=SR(),qKs=oc(),Hme=Ss(),jKs={message:a(({schemaCode:t})=>(0,Hme.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,Hme._)`{pattern: ${t}}`,"params")},HKs={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:jKs,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:c}=t,l=c.opts.unicodeRegExp?"u":"";if(n){let{regExp:u}=c.opts.code,d=u.code==="new RegExp"?(0,Hme._)`new RegExp`:(0,qKs.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,Hme._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,Hme._)`!${f}`)}else{let u=(0,QKs.usePattern)(t,o);t.fail$data((0,Hme._)`!${u}.test(${r})`)}}};pmr.default=HKs});var ari=I(hmr=>{"use strict";p();Object.defineProperty(hmr,"__esModule",{value:!0});var pMe=Ss(),GKs={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,pMe.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,pMe._)`{limit: ${t}}`,"params")},$Ks={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:GKs,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?pMe.operators.GT:pMe.operators.LT;t.fail$data((0,pMe._)`Object.keys(${r}).length ${o} ${n}`)}};hmr.default=$Ks});var cri=I(mmr=>{"use strict";p();Object.defineProperty(mmr,"__esModule",{value:!0});var hMe=SR(),mMe=Ss(),VKs=oc(),WKs={message:a(({params:{missingProperty:t}})=>(0,mMe.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,mMe._)`{missingProperty: ${t}}`,"params")},zKs={keyword:"required",type:"object",schemaType:"array",$data:!0,error:WKs,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:c}=t,{opts:l}=c;if(!s&&r.length===0)return;let u=r.length>=l.loopRequired;if(c.allErrors?d():f(),l.strictRequired){let g=t.parentSchema.properties,{definedProperties:A}=t.it;for(let y of r)if(g?.[y]===void 0&&!A.has(y)){let _=c.schemaEnv.baseId+c.errSchemaPath,E=`required property "${y}" is not defined at "${_}" (strictRequired)`;(0,VKs.checkStrictMode)(c,E,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(mMe.nil,h);else for(let g of r)(0,hMe.checkReportMissingProp)(t,g)}a(d,"allErrorsMode");function f(){let g=e.let("missing");if(u||s){let A=e.let("valid",!0);t.block$data(A,()=>m(g,A)),t.ok(A)}else e.if((0,hMe.checkMissingProp)(t,r,g)),(0,hMe.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,hMe.noPropertyInData)(e,o,g,l.ownProperties),()=>t.error())})}a(h,"loopAllRequired");function m(g,A){t.setParams({missingProperty:g}),e.forOf(g,n,()=>{e.assign(A,(0,hMe.propertyInData)(e,o,g,l.ownProperties)),e.if((0,mMe.not)(A),()=>{t.error(),e.break()})},mMe.nil)}a(m,"loopUntilMissing")}};mmr.default=zKs});var lri=I(gmr=>{"use strict";p();Object.defineProperty(gmr,"__esModule",{value:!0});var gMe=Ss(),YKs={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,gMe.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,gMe._)`{limit: ${t}}`,"params")},KKs={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:YKs,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?gMe.operators.GT:gMe.operators.LT;t.fail$data((0,gMe._)`${r}.length ${o} ${n}`)}};gmr.default=KKs});var mdt=I(Amr=>{"use strict";p();Object.defineProperty(Amr,"__esModule",{value:!0});var uri=Qhr();uri.code='require("ajv/dist/runtime/equal").default';Amr.default=uri});var dri=I(_mr=>{"use strict";p();Object.defineProperty(_mr,"__esModule",{value:!0});var ymr=rMe(),my=Ss(),JKs=oc(),ZKs=mdt(),XKs={message:a(({params:{i:t,j:e}})=>(0,my.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,my._)`{i: ${t}, j: ${e}}`,"params")},eJs={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:XKs,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:c,it:l}=t;if(!n&&!o)return;let u=e.let("valid"),d=s.items?(0,ymr.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,my._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,my._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,my._)`${A} > 1`,()=>(h()?m:g)(A,y))}a(f,"validateUniqueItems");function h(){return d.length>0&&!d.some(A=>A==="object"||A==="array")}a(h,"canOptimize");function m(A,y){let _=e.name("item"),E=(0,ymr.checkDataTypes)(d,_,l.opts.strictNumbers,ymr.DataType.Wrong),v=e.const("indices",(0,my._)`{}`);e.for((0,my._)`;${A}--;`,()=>{e.let(_,(0,my._)`${r}[${A}]`),e.if(E,(0,my._)`continue`),d.length>1&&e.if((0,my._)`typeof ${_} == "string"`,(0,my._)`${_} += "_"`),e.if((0,my._)`typeof ${v}[${_}] == "number"`,()=>{e.assign(y,(0,my._)`${v}[${_}]`),t.error(),e.assign(u,!1).break()}).code((0,my._)`${v}[${_}] = ${A}`)})}a(m,"loopN");function g(A,y){let _=(0,JKs.useFunc)(e,ZKs.default),E=e.name("outer");e.label(E).for((0,my._)`;${A}--;`,()=>e.for((0,my._)`${y} = ${A}; ${y}--;`,()=>e.if((0,my._)`${_}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(E)})))}a(g,"loopN2")}};_mr.default=eJs});var fri=I(vmr=>{"use strict";p();Object.defineProperty(vmr,"__esModule",{value:!0});var Emr=Ss(),tJs=oc(),rJs=mdt(),nJs={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,Emr._)`{allowedValue: ${t}}`,"params")},iJs={keyword:"const",$data:!0,error:nJs,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,Emr._)`!${(0,tJs.useFunc)(e,rJs.default)}(${r}, ${o})`):t.fail((0,Emr._)`${s} !== ${r}`)}};vmr.default=iJs});var pri=I(Cmr=>{"use strict";p();Object.defineProperty(Cmr,"__esModule",{value:!0});var AMe=Ss(),oJs=oc(),sJs=mdt(),aJs={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,AMe._)`{allowedValues: ${t}}`,"params")},cJs={keyword:"enum",schemaType:"array",$data:!0,error:aJs,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:c}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let l=o.length>=c.opts.loopEnum,u,d=a(()=>u??(u=(0,oJs.useFunc)(e,sJs.default)),"getEql"),f;if(l||n)f=e.let("valid"),t.block$data(f,h);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let g=e.const("vSchema",s);f=(0,AMe.or)(...o.map((A,y)=>m(g,y)))}t.pass(f);function h(){e.assign(f,!1),e.forOf("v",s,g=>e.if((0,AMe._)`${d()}(${r}, ${g})`,()=>e.assign(f,!0).break()))}a(h,"loopEnum");function m(g,A){let y=o[A];return typeof y=="object"&&y!==null?(0,AMe._)`${d()}(${r}, ${g}[${A}])`:(0,AMe._)`${r} === ${y}`}a(m,"equalCode")}};Cmr.default=cJs});var hri=I(bmr=>{"use strict";p();Object.defineProperty(bmr,"__esModule",{value:!0});var lJs=tri(),uJs=rri(),dJs=ori(),fJs=sri(),pJs=ari(),hJs=cri(),mJs=lri(),gJs=dri(),AJs=fri(),yJs=pri(),_Js=[lJs.default,uJs.default,dJs.default,fJs.default,pJs.default,hJs.default,mJs.default,gJs.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},AJs.default,yJs.default];bmr.default=_Js});var Tmr=I(yMe=>{"use strict";p();Object.defineProperty(yMe,"__esModule",{value:!0});yMe.validateAdditionalItems=void 0;var Pee=Ss(),Smr=oc(),EJs={message:a(({params:{len:t}})=>(0,Pee.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,Pee._)`{limit: ${t}}`,"params")},vJs={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:EJs,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Smr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}mri(t,n)}};function mri(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,Pee._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Pee._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Smr.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,Pee._)`${l} <= ${e.length}`);r.if((0,Pee.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:Smr.Type.Num},d),c.allErrors||r.if((0,Pee.not)(d),()=>r.break())})}a(u,"validateItems")}a(mri,"validateAdditionalItems");yMe.validateAdditionalItems=mri;yMe.default=vJs});var Imr=I(_Me=>{"use strict";p();Object.defineProperty(_Me,"__esModule",{value:!0});_Me.validateTuple=void 0;var gri=Ss(),gdt=oc(),CJs=SR(),bJs={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Ari(t,"additionalItems",e);r.items=!0,!(0,gdt.alwaysValidSchema)(r,e)&&t.ok((0,CJs.validateArray)(t))}};function Ari(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:c,it:l}=t;f(o),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=gdt.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,gri._)`${s}.length`);r.forEach((h,m)=>{(0,gdt.alwaysValidSchema)(l,h)||(n.if((0,gri._)`${d} > ${m}`,()=>t.subschema({keyword:c,schemaProp:m,dataProp:m},u)),t.ok(u))});function f(h){let{opts:m,errSchemaPath:g}=l,A=r.length,y=A===h.minItems&&(A===h.maxItems||h[e]===!1);if(m.strictTuples&&!y){let _=`"${c}" is ${A}-tuple, but minItems or maxItems/${e} are not specified or different at path "${g}"`;(0,gdt.checkStrictMode)(l,_,m.strictTuples)}}a(f,"checkStrictTuple")}a(Ari,"validateTuple");_Me.validateTuple=Ari;_Me.default=bJs});var yri=I(xmr=>{"use strict";p();Object.defineProperty(xmr,"__esModule",{value:!0});var SJs=Imr(),TJs={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,SJs.validateTuple)(t,"items"),"code")};xmr.default=TJs});var Eri=I(wmr=>{"use strict";p();Object.defineProperty(wmr,"__esModule",{value:!0});var _ri=Ss(),IJs=oc(),xJs=SR(),wJs=Tmr(),RJs={message:a(({params:{len:t}})=>(0,_ri.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,_ri._)`{limit: ${t}}`,"params")},kJs={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:RJs,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,IJs.alwaysValidSchema)(n,e)&&(o?(0,wJs.validateAdditionalItems)(t,o):t.ok((0,xJs.validateArray)(t)))}};wmr.default=kJs});var vri=I(Rmr=>{"use strict";p();Object.defineProperty(Rmr,"__esModule",{value:!0});var IR=Ss(),Adt=oc(),PJs={message:a(({params:{min:t,max:e}})=>e===void 0?(0,IR.str)`must contain at least ${t} valid item(s)`:(0,IR.str)`must contain at least ${t} and no more than ${e} valid item(s)`,"message"),params:a(({params:{min:t,max:e}})=>e===void 0?(0,IR._)`{minContains: ${t}}`:(0,IR._)`{minContains: ${t}, maxContains: ${e}}`,"params")},DJs={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:PJs,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,c,l,{minContains:u,maxContains:d}=n;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=e.const("len",(0,IR._)`${o}.length`);if(t.setParams({min:c,max:l}),l===void 0&&c===0){(0,Adt.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,Adt.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Adt.alwaysValidSchema)(s,r)){let y=(0,IR._)`${f} >= ${c}`;l!==void 0&&(y=(0,IR._)`${y} && ${f} <= ${l}`),t.pass(y);return}s.items=!0;let h=e.name("valid");l===void 0&&c===1?g(h,()=>e.if(h,()=>e.break())):c===0?(e.let(h,!0),l!==void 0&&e.if((0,IR._)`${o}.length > 0`,m)):(e.let(h,!1),m()),t.result(h,()=>t.reset());function m(){let y=e.name("_valid"),_=e.let("count",0);g(y,()=>e.if(y,()=>A(_)))}a(m,"validateItemsWithCount");function g(y,_){e.forRange("i",0,f,E=>{t.subschema({keyword:"contains",dataProp:E,dataPropType:Adt.Type.Num,compositeRule:!0},y),_()})}a(g,"validateItems");function A(y){e.code((0,IR._)`${y}++`),l===void 0?e.if((0,IR._)`${y} >= ${c}`,()=>e.assign(h,!0).break()):(e.if((0,IR._)`${y} > ${l}`,()=>e.assign(h,!1).break()),c===1?e.assign(h,!0):e.if((0,IR._)`${y} >= ${c}`,()=>e.assign(h,!0)))}a(A,"checkLimits")}};Rmr.default=DJs});var Sri=I(R4=>{"use strict";p();Object.defineProperty(R4,"__esModule",{value:!0});R4.validateSchemaDeps=R4.validatePropertyDeps=R4.error=void 0;var kmr=Ss(),NJs=oc(),EMe=SR();R4.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,kmr.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,kmr._)`{property: ${t}, missingProperty: ${n}, depsCount: ${e}, - deps: ${r}}`,"params")};var DJs={keyword:"dependencies",type:"object",schemaType:"object",error:R4.error,code(t){let[e,r]=NJs(t);Eri(t,e),vri(t,r)}};function NJs({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let o=Array.isArray(t[n])?e:r;o[n]=t[n]}return[e,r]}a(NJs,"splitDependencies");function Eri(t,e=t.schema){let{gen:r,data:n,it:o}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let c in e){let l=e[c];if(l.length===0)continue;let u=(0,EMe.propertyInData)(r,n,c,o.opts.ownProperties);t.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),o.allErrors?r.if(u,()=>{for(let d of l)(0,EMe.checkReportMissingProp)(t,d)}):(r.if((0,Rmr._)`${u} && (${(0,EMe.checkMissingProp)(t,l,s)})`),(0,EMe.reportMissingProp)(t,s),r.else())}}a(Eri,"validatePropertyDeps");R4.validatePropertyDeps=Eri;function vri(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,PJs.alwaysValidSchema)(s,e[l])||(r.if((0,EMe.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let u=t.subschema({keyword:o,schemaProp:l},c);t.mergeValidEvaluated(u,c)},()=>r.var(c,!0)),t.ok(c))}a(vri,"validateSchemaDeps");R4.validateSchemaDeps=vri;R4.default=DJs});var Sri=I(kmr=>{"use strict";p();Object.defineProperty(kmr,"__esModule",{value:!0});var bri=Ss(),MJs=oc(),OJs={message:"property name must be valid",params:a(({params:t})=>(0,bri._)`{propertyName: ${t.propertyName}}`,"params")},LJs={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:OJs,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,MJs.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,c=>{t.setParams({propertyName:c}),t.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},s),e.if((0,bri.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};kmr.default=LJs});var Dmr=I(Pmr=>{"use strict";p();Object.defineProperty(Pmr,"__esModule",{value:!0});var ydt=SR(),dD=Ss(),BJs=z8(),_dt=oc(),FJs={message:"must NOT have additional properties",params:a(({params:t})=>(0,dD._)`{additionalProperty: ${t.additionalProperty}}`,"params")},UJs={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:FJs,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:c}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:u}=c;if(c.props=!0,u.removeAdditional!=="all"&&(0,_dt.alwaysValidSchema)(c,r))return;let d=(0,ydt.allSchemaProperties)(n.properties),f=(0,ydt.allSchemaProperties)(n.patternProperties);h(),t.ok((0,dD._)`${s} === ${BJs.default.errors}`);function h(){e.forIn("key",o,_=>{!d.length&&!f.length?A(_):e.if(m(_),()=>A(_))})}a(h,"checkAdditionalProperties");function m(_){let E;if(d.length>8){let v=(0,_dt.schemaRefOrVal)(c,n.properties,"properties");E=(0,ydt.isOwnProperty)(e,v,_)}else d.length?E=(0,dD.or)(...d.map(v=>(0,dD._)`${_} === ${v}`)):E=dD.nil;return f.length&&(E=(0,dD.or)(E,...f.map(v=>(0,dD._)`${(0,ydt.usePattern)(t,v)}.test(${_})`))),(0,dD.not)(E)}a(m,"isAdditional");function g(_){e.code((0,dD._)`delete ${o}[${_}]`)}a(g,"deleteAdditional");function A(_){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){g(_);return}if(r===!1){t.setParams({additionalProperty:_}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,_dt.alwaysValidSchema)(c,r)){let E=e.name("valid");u.removeAdditional==="failing"?(y(_,E,!1),e.if((0,dD.not)(E),()=>{t.reset(),g(_)})):(y(_,E),l||e.if((0,dD.not)(E),()=>e.break()))}}a(A,"additionalPropertyCode");function y(_,E,v){let S={keyword:"additionalProperties",dataProp:_,dataPropType:_dt.Type.Str};v===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(S,E)}a(y,"applyAdditionalSchema")}};Pmr.default=UJs});var xri=I(Mmr=>{"use strict";p();Object.defineProperty(Mmr,"__esModule",{value:!0});var QJs=sMe(),Tri=SR(),Nmr=oc(),Iri=Dmr(),qJs={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Iri.default.code(new QJs.KeywordCxt(s,Iri.default,"additionalProperties"));let c=(0,Tri.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=Nmr.mergeEvaluated.props(e,(0,Nmr.toHash)(c),s.props));let l=c.filter(h=>!(0,Nmr.alwaysValidSchema)(s,r[h]));if(l.length===0)return;let u=e.name("valid");for(let h of l)d(h)?f(h):(e.if((0,Tri.propertyInData)(e,o,h,s.opts.ownProperties)),f(h),s.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(u);function d(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}a(d,"hasDefault");function f(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}a(f,"applyPropertySchema")}};Mmr.default=qJs});var Pri=I(Omr=>{"use strict";p();Object.defineProperty(Omr,"__esModule",{value:!0});var wri=SR(),Edt=Ss(),Rri=oc(),kri=oc(),jJs={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:c}=s,l=(0,wri.allSchemaProperties)(r),u=l.filter(y=>(0,Rri.alwaysValidSchema)(s,r[y]));if(l.length===0||u.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=c.strictSchema&&!c.allowMatchingProperties&&o.properties,f=e.name("valid");s.props!==!0&&!(s.props instanceof Edt.Name)&&(s.props=(0,kri.evaluatedPropsToName)(e,s.props));let{props:h}=s;m();function m(){for(let y of l)d&&g(y),s.allErrors?A(y):(e.var(f,!0),A(y),e.if(f))}a(m,"validatePatternProperties");function g(y){for(let _ in d)new RegExp(y).test(_)&&(0,Rri.checkStrictMode)(s,`property ${_} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,_=>{e.if((0,Edt._)`${(0,wri.usePattern)(t,y)}.test(${_})`,()=>{let E=u.includes(y);E||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:_,dataPropType:kri.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,Edt._)`${h}[${_}]`,!0):!E&&!s.allErrors&&e.if((0,Edt.not)(f),()=>e.break())})})}a(A,"validateProperties")}};Omr.default=jJs});var Dri=I(Lmr=>{"use strict";p();Object.defineProperty(Lmr,"__esModule",{value:!0});var HJs=oc(),GJs={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,HJs.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Lmr.default=GJs});var Nri=I(Bmr=>{"use strict";p();Object.defineProperty(Bmr,"__esModule",{value:!0});var $Js=SR(),VJs={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:$Js.validateUnion,error:{message:"must match a schema in anyOf"}};Bmr.default=VJs});var Mri=I(Fmr=>{"use strict";p();Object.defineProperty(Fmr,"__esModule",{value:!0});var vdt=Ss(),WJs=oc(),zJs={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,vdt._)`{passingSchemas: ${t.passing}}`,"params")},YJs={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:zJs,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,c=e.let("valid",!1),l=e.let("passing",null),u=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(c,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((f,h)=>{let m;(0,WJs.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,vdt._)`${u} && ${c}`).assign(c,!1).assign(l,(0,vdt._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,vdt.Name)})})}a(d,"validateOneOf")}};Fmr.default=YJs});var Ori=I(Umr=>{"use strict";p();Object.defineProperty(Umr,"__esModule",{value:!0});var KJs=oc(),JJs={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,c)=>{if((0,KJs.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};Umr.default=JJs});var Fri=I(Qmr=>{"use strict";p();Object.defineProperty(Qmr,"__esModule",{value:!0});var Cdt=Ss(),Bri=oc(),ZJs={message:a(({params:t})=>(0,Cdt.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,Cdt._)`{failingKeyword: ${t.ifClause}}`,"params")},XJs={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:ZJs,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Bri.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=Lri(n,"then"),s=Lri(n,"else");if(!o&&!s)return;let c=e.let("valid",!0),l=e.name("_valid");if(u(),t.reset(),o&&s){let f=e.let("ifClause");t.setParams({ifClause:f}),e.if(l,d("then",f),d("else",f))}else o?e.if(l,d("then")):e.if((0,Cdt.not)(l),d("else"));t.pass(c,()=>t.error(!0));function u(){let f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(f)}a(u,"validateIf");function d(f,h){return()=>{let m=t.subschema({keyword:f},l);e.assign(c,l),t.mergeValidEvaluated(m,c),h?e.assign(h,(0,Cdt._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function Lri(t,e){let r=t.schema[e];return r!==void 0&&!(0,Bri.alwaysValidSchema)(t,r)}a(Lri,"hasSchema");Qmr.default=XJs});var Uri=I(qmr=>{"use strict";p();Object.defineProperty(qmr,"__esModule",{value:!0});var eZs=oc(),tZs={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,eZs.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};qmr.default=tZs});var Qri=I(jmr=>{"use strict";p();Object.defineProperty(jmr,"__esModule",{value:!0});var rZs=Smr(),nZs=gri(),iZs=Tmr(),oZs=yri(),sZs=_ri(),aZs=Cri(),cZs=Sri(),lZs=Dmr(),uZs=xri(),dZs=Pri(),fZs=Dri(),pZs=Nri(),hZs=Mri(),mZs=Ori(),gZs=Fri(),AZs=Uri();function yZs(t=!1){let e=[fZs.default,pZs.default,hZs.default,mZs.default,gZs.default,AZs.default,cZs.default,lZs.default,aZs.default,uZs.default,dZs.default];return t?e.push(nZs.default,oZs.default):e.push(rZs.default,iZs.default),e.push(sZs.default),e}a(yZs,"getApplicator");jmr.default=yZs});var qri=I(Hmr=>{"use strict";p();Object.defineProperty(Hmr,"__esModule",{value:!0});var vh=Ss(),_Zs={message:a(({schemaCode:t})=>(0,vh.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,vh._)`{format: ${t}}`,"params")},EZs={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:_Zs,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:c,it:l}=t,{opts:u,errSchemaPath:d,schemaEnv:f,self:h}=l;if(!u.validateFormats)return;o?m():g();function m(){let A=r.scopeValue("formats",{ref:h.formats,code:u.code.formats}),y=r.const("fDef",(0,vh._)`${A}[${c}]`),_=r.let("fType"),E=r.let("format");r.if((0,vh._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(_,(0,vh._)`${y}.type || "string"`).assign(E,(0,vh._)`${y}.validate`),()=>r.assign(_,(0,vh._)`"string"`).assign(E,y)),t.fail$data((0,vh.or)(v(),S()));function v(){return u.strictSchema===!1?vh.nil:(0,vh._)`${c} && !${E}`}a(v,"unknownFmt");function S(){let T=f.$async?(0,vh._)`(${y}.async ? await ${E}(${n}) : ${E}(${n}))`:(0,vh._)`${E}(${n})`,w=(0,vh._)`(typeof ${E} == "function" ? ${T} : ${E}.test(${n}))`;return(0,vh._)`${E} && ${E} !== true && ${_} === ${e} && !${w}`}a(S,"invalidFmt")}a(m,"validate$DataFormat");function g(){let A=h.formats[s];if(!A){v();return}if(A===!0)return;let[y,_,E]=S(A);y===e&&t.pass(T());function v(){if(u.strictSchema===!1){h.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${s}" ignored in schema at path "${d}"`}}a(v,"unknownFormat");function S(w){let R=w instanceof RegExp?(0,vh.regexpCode)(w):u.code.formats?(0,vh._)`${u.code.formats}${(0,vh.getProperty)(s)}`:void 0,x=r.scopeValue("formats",{key:s,ref:w,code:R});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,vh._)`${x}.validate`]:["string",w,x]}a(S,"getFormat");function T(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!f.$async)throw new Error("async format in sync schema");return(0,vh._)`await ${E}(${n})`}return typeof _=="function"?(0,vh._)`${E}(${n})`:(0,vh._)`${E}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};Hmr.default=EZs});var jri=I(Gmr=>{"use strict";p();Object.defineProperty(Gmr,"__esModule",{value:!0});var vZs=qri(),CZs=[vZs.default];Gmr.default=CZs});var Hri=I(Gme=>{"use strict";p();Object.defineProperty(Gme,"__esModule",{value:!0});Gme.contentVocabulary=Gme.metadataVocabulary=void 0;Gme.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Gme.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var $ri=I($mr=>{"use strict";p();Object.defineProperty($mr,"__esModule",{value:!0});var bZs=Zti(),SZs=fri(),TZs=Qri(),IZs=jri(),Gri=Hri(),xZs=[bZs.default,SZs.default,(0,TZs.default)(),IZs.default,Gri.metadataVocabulary,Gri.contentVocabulary];$mr.default=xZs});var Wri=I(bdt=>{"use strict";p();Object.defineProperty(bdt,"__esModule",{value:!0});bdt.DiscrError=void 0;var Vri;(function(t){t.Tag="tag",t.Mapping="mapping"})(Vri||(bdt.DiscrError=Vri={}))});var Yri=I(Wmr=>{"use strict";p();Object.defineProperty(Wmr,"__esModule",{value:!0});var $me=Ss(),Vmr=Wri(),zri=sdt(),wZs=aMe(),RZs=oc(),kZs={message:a(({params:{discrError:t,tagName:e}})=>t===Vmr.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,"message"),params:a(({params:{discrError:t,tag:e,tagName:r}})=>(0,$me._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},PZs={keyword:"discriminator",type:"object",schemaType:"object",error:kZs,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:c}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),d=e.const("tag",(0,$me._)`${r}${(0,$me.getProperty)(l)}`);e.if((0,$me._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:Vmr.DiscrError.Tag,tag:d,tagName:l})),t.ok(u);function f(){let g=m();e.if(!1);for(let A in g)e.elseIf((0,$me._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:Vmr.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}a(f,"validateMapping");function h(g){let A=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:g},A);return t.mergeEvaluated(y,$me.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=E(o),_=!0;for(let T=0;T{DZs.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Ymr=I((bd,zmr)=>{"use strict";p();Object.defineProperty(bd,"__esModule",{value:!0});bd.MissingRefError=bd.ValidationError=bd.CodeGen=bd.Name=bd.nil=bd.stringify=bd.str=bd._=bd.KeywordCxt=bd.Ajv=void 0;var NZs=Vti(),MZs=$ri(),OZs=Yri(),Jri=Kri(),LZs=["/properties"],Sdt="http://json-schema.org/draft-07/schema",Vme=class extends NZs.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),MZs.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(OZs.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Jri,LZs):Jri;this.addMetaSchema(e,Sdt,!1),this.refs["http://json-schema.org/schema"]=Sdt}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Sdt)?Sdt:void 0)}};bd.Ajv=Vme;zmr.exports=bd=Vme;zmr.exports.Ajv=Vme;Object.defineProperty(bd,"__esModule",{value:!0});bd.default=Vme;var BZs=sMe();Object.defineProperty(bd,"KeywordCxt",{enumerable:!0,get:a(function(){return BZs.KeywordCxt},"get")});var Wme=Ss();Object.defineProperty(bd,"_",{enumerable:!0,get:a(function(){return Wme._},"get")});Object.defineProperty(bd,"str",{enumerable:!0,get:a(function(){return Wme.str},"get")});Object.defineProperty(bd,"stringify",{enumerable:!0,get:a(function(){return Wme.stringify},"get")});Object.defineProperty(bd,"nil",{enumerable:!0,get:a(function(){return Wme.nil},"get")});Object.defineProperty(bd,"Name",{enumerable:!0,get:a(function(){return Wme.Name},"get")});Object.defineProperty(bd,"CodeGen",{enumerable:!0,get:a(function(){return Wme.CodeGen},"get")});var FZs=idt();Object.defineProperty(bd,"ValidationError",{enumerable:!0,get:a(function(){return FZs.default},"get")});var UZs=aMe();Object.defineProperty(bd,"MissingRefError",{enumerable:!0,get:a(function(){return UZs.default},"get")})});var oni=I(P4=>{"use strict";p();Object.defineProperty(P4,"__esModule",{value:!0});P4.formatNames=P4.fastFormats=P4.fullFormats=void 0;function k4(t,e){return{validate:t,compare:e}}a(k4,"fmtDef");P4.fullFormats={date:k4(tni,Xmr),time:k4(Jmr(!0),egr),"date-time":k4(Zri(!0),nni),"iso-time":k4(Jmr(),rni),"iso-date-time":k4(Zri(),ini),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:$Zs,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:ZZs,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:VZs,int32:{type:"number",validate:YZs},int64:{type:"number",validate:KZs},float:{type:"number",validate:eni},double:{type:"number",validate:eni},password:!0,binary:!0};P4.fastFormats={...P4.fullFormats,date:k4(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Xmr),time:k4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,egr),"date-time":k4(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,nni),"iso-time":k4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,rni),"iso-date-time":k4(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ini),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};P4.formatNames=Object.keys(P4.fullFormats);function QZs(t){return t%4===0&&(t%100!==0||t%400===0)}a(QZs,"isLeapYear");var qZs=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,jZs=[0,31,28,31,30,31,30,31,31,30,31,30,31];function tni(t){let e=qZs.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&QZs(r)?29:jZs[n])}a(tni,"date");function Xmr(t,e){if(t&&e)return t>e?1:t23||f>59||t&&!l)return!1;if(o<=23&&s<=59&&c<60)return!0;let h=s-f*u,m=o-d*u-(h<0?1:0);return(m===23||m===-1)&&(h===59||h===-1)&&c<61},"time")}a(Jmr,"getTime");function egr(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}a(egr,"compareTime");function rni(t,e){if(!(t&&e))return;let r=Kmr.exec(t),n=Kmr.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=WZs}a(YZs,"validateInt32");function KZs(t){return Number.isInteger(t)}a(KZs,"validateInt64");function eni(){return!0}a(eni,"validateNumber");var JZs=/[^\\]\\Z/;function ZZs(t){if(JZs.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(ZZs,"regex")});var sni=I(zme=>{"use strict";p();Object.defineProperty(zme,"__esModule",{value:!0});zme.formatLimitDefinition=void 0;var XZs=Ymr(),fD=Ss(),AG=fD.operators,Tdt={formatMaximum:{okStr:"<=",ok:AG.LTE,fail:AG.GT},formatMinimum:{okStr:">=",ok:AG.GTE,fail:AG.LT},formatExclusiveMaximum:{okStr:"<",ok:AG.LT,fail:AG.GTE},formatExclusiveMinimum:{okStr:">",ok:AG.GT,fail:AG.LTE}},eXs={message:a(({keyword:t,schemaCode:e})=>(0,fD.str)`should be ${Tdt[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,fD._)`{comparison: ${Tdt[t].okStr}, limit: ${e}}`,"params")};zme.formatLimitDefinition={keyword:Object.keys(Tdt),type:"string",schemaType:"string",$data:!0,error:eXs,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:c,self:l}=s;if(!c.validateFormats)return;let u=new XZs.KeywordCxt(s,l.RULES.all.format.definition,"format");u.$data?d():f();function d(){let m=e.scopeValue("formats",{ref:l.formats,code:c.code.formats}),g=e.const("fmt",(0,fD._)`${m}[${u.schemaCode}]`);t.fail$data((0,fD.or)((0,fD._)`typeof ${g} != "object"`,(0,fD._)`${g} instanceof RegExp`,(0,fD._)`typeof ${g}.compare != "function"`,h(g)))}a(d,"validate$DataFormat");function f(){let m=u.schema,g=l.formats[m];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${o}": format "${m}" does not define "compare" function`);let A=e.scopeValue("formats",{key:m,ref:g,code:c.code.formats?(0,fD._)`${c.code.formats}${(0,fD.getProperty)(m)}`:void 0});t.fail$data(h(A))}a(f,"validateFormat");function h(m){return(0,fD._)`${m}.compare(${r}, ${n}) ${Tdt[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var tXs=a(t=>(t.addKeyword(zme.formatLimitDefinition),t),"formatLimitPlugin");zme.default=tXs});var uni=I((vMe,lni)=>{"use strict";p();Object.defineProperty(vMe,"__esModule",{value:!0});var Yme=oni(),rXs=sni(),tgr=Ss(),ani=new tgr.Name("fullFormats"),nXs=new tgr.Name("fastFormats"),rgr=a((t,e={keywords:!0})=>{if(Array.isArray(e))return cni(t,e,Yme.fullFormats,ani),t;let[r,n]=e.mode==="fast"?[Yme.fastFormats,nXs]:[Yme.fullFormats,ani],o=e.formats||Yme.formatNames;return cni(t,o,r,n),e.keywords&&(0,rXs.default)(t),t},"formatsPlugin");rgr.get=(t,e="full")=>{let n=(e==="fast"?Yme.fastFormats:Yme.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function cni(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,tgr._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a(cni,"addFormats");lni.exports=vMe=rgr;Object.defineProperty(vMe,"__esModule",{value:!0});vMe.default=rgr});var jni=I((I3f,qni)=>{p();qni.exports=Qni;Qni.sync=SXs;var Fni=require("fs");function bXs(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{p();Vni.exports=Gni;Gni.sync=TXs;var Hni=require("fs");function Gni(t,e,r){Hni.stat(t,function(n,o){r(n,n?!1:$ni(o,e))})}a(Gni,"isexe");function TXs(t,e){return $ni(Hni.statSync(t),e)}a(TXs,"sync");function $ni(t,e){return t.isFile()&&IXs(t,e)}a($ni,"checkStat");function IXs(t,e){var r=t.mode,n=t.uid,o=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),c=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),l=parseInt("100",8),u=parseInt("010",8),d=parseInt("001",8),f=l|u,h=r&d||r&u&&o===c||r&l&&n===s||r&f&&s===0;return h}a(IXs,"checkMode")});var Yni=I((N3f,zni)=>{p();var D3f=require("fs"),qdt;process.platform==="win32"||global.TESTING_WINDOWS?qdt=jni():qdt=Wni();zni.exports=_gr;_gr.sync=xXs;function _gr(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){_gr(t,e||{},function(s,c){s?o(s):n(c)})})}qdt(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(_gr,"isexe");function xXs(t,e){try{return qdt.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(xXs,"sync")});var rii=I((L3f,tii)=>{p();var age=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Kni=require("path"),wXs=age?";":":",Jni=Yni(),Zni=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),Xni=a((t,e)=>{let r=e.colon||wXs,n=t.match(/\//)||age&&t.match(/\\/)?[""]:[...age?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=age?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=age?o.split(r):[""];return age&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),eii=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=Xni(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(Zni(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=Kni.join(g,t),y=!g&&/^\.[\\\/]/.test(t)?t.slice(0,2)+A:A;f(u(y,d,0))}),"step"),u=a((d,f,h)=>new Promise((m,g)=>{if(h===o.length)return m(l(f+1));let A=o[h];Jni(d+A,{pathExt:s},(y,_)=>{if(!y&&_)if(e.all)c.push(d+A);else return m(d+A);return m(u(d,f,h+1))})}),"subStep");return r?l(0).then(d=>r(null,d),r):l(0)},"which"),RXs=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Xni(t,e),s=[];for(let c=0;c{"use strict";p();var nii=a((t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");Egr.exports=nii;Egr.exports.default=nii});var cii=I((j3f,aii)=>{"use strict";p();var oii=require("path"),kXs=rii(),PXs=iii();function sii(t,e){let r=t.options.env||process.env,n=process.cwd(),o=t.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let c;try{c=kXs.sync(t.command,{path:r[PXs({env:r})],pathExt:e?oii.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=oii.resolve(o?t.options.cwd:"",c)),c}a(sii,"resolveCommandAttempt");function DXs(t){return sii(t)||sii(t,!0)}a(DXs,"resolveCommand");aii.exports=DXs});var lii=I(($3f,Cgr)=>{"use strict";p();var vgr=/([()\][%!^"`<>&|;, *?])/g;function NXs(t){return t=t.replace(vgr,"^$1"),t}a(NXs,"escapeCommand");function MXs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(vgr,"^$1"),e&&(t=t.replace(vgr,"^$1")),t}a(MXs,"escapeArgument");Cgr.exports.command=NXs;Cgr.exports.argument=MXs});var dii=I((z3f,uii)=>{"use strict";p();uii.exports=/^#!(.*)/});var pii=I((K3f,fii)=>{"use strict";p();var OXs=dii();fii.exports=(t="")=>{let e=t.match(OXs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var mii=I((Z3f,hii)=>{"use strict";p();var bgr=require("fs"),LXs=pii();function BXs(t){let r=Buffer.alloc(150),n;try{n=bgr.openSync(t,"r"),bgr.readSync(n,r,0,150,0),bgr.closeSync(n)}catch{}return LXs(r.toString())}a(BXs,"readShebang");hii.exports=BXs});var _ii=I((tFf,yii)=>{"use strict";p();var FXs=require("path"),gii=cii(),Aii=lii(),UXs=mii(),QXs=process.platform==="win32",qXs=/\.(?:com|exe)$/i,jXs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function HXs(t){t.file=gii(t);let e=t.file&&UXs(t.file);return e?(t.args.unshift(t.file),t.command=e,gii(t)):t.file}a(HXs,"detectShebang");function GXs(t){if(!QXs)return t;let e=HXs(t),r=!qXs.test(e);if(t.options.forceShell||r){let n=jXs.test(e);t.command=FXs.normalize(t.command),t.command=Aii.command(t.command),t.args=t.args.map(s=>Aii.argument(s,n));let o=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${o}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}a(GXs,"parseNonShell");function $Xs(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:GXs(n)}a($Xs,"parse");yii.exports=$Xs});var Cii=I((iFf,vii)=>{"use strict";p();var Sgr=process.platform==="win32";function Tgr(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}a(Tgr,"notFoundError");function VXs(t,e){if(!Sgr)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=Eii(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(VXs,"hookChildProcess");function Eii(t,e){return Sgr&&t===1&&!e.file?Tgr(e.original,"spawn"):null}a(Eii,"verifyENOENT");function WXs(t,e){return Sgr&&t===1&&!e.file?Tgr(e.original,"spawnSync"):null}a(WXs,"verifyENOENTSync");vii.exports={hookChildProcess:VXs,verifyENOENT:Eii,verifyENOENTSync:WXs,notFoundError:Tgr}});var Tii=I((aFf,cge)=>{"use strict";p();var bii=require("child_process"),Igr=_ii(),xgr=Cii();function Sii(t,e,r){let n=Igr(t,e,r),o=bii.spawn(n.command,n.args,n.options);return xgr.hookChildProcess(o,n),o}a(Sii,"spawn");function zXs(t,e,r){let n=Igr(t,e,r),o=bii.spawnSync(n.command,n.args,n.options);return o.error=o.error||xgr.verifyENOENTSync(o.status,n),o}a(zXs,"spawnSync");cge.exports=Sii;cge.exports.spawn=Sii;cge.exports.sync=zXs;cge.exports._parse=Igr;cge.exports._enoent=xgr});var lI=I(Uee=>{"use strict";p();Object.defineProperty(Uee,"__esModule",{value:!0});Uee.DebugNameData=void 0;Uee.getDebugName=jsi;Uee.getClassName=Hsi;Uee.getFunctionName=Gsi;var _0r=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return jsi(e,this)}};Uee.DebugNameData=_0r;var Usi=new Map,E0r=new WeakMap;function jsi(t,e){let r=E0r.get(t);if(r)return r;let n=_ra(t,e);if(n){let o=Usi.get(n)??0;o++,Usi.set(n,o);let s=o===1?n:`${n}#${o}`;return E0r.set(t,s),s}}a(jsi,"getDebugName");function _ra(t,e){let r=E0r.get(t);if(r)return r;let n=e.owner?vra(e.owner)+".":"",o,s=e.debugNameSource;if(s!==void 0)if(typeof s=="function"){if(o=s(),o!==void 0)return n+o}else return n+s;let c=e.referenceFn;if(c!==void 0&&(o=Gsi(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=Era(e.owner,t);if(l!==void 0)return n+l}}a(_ra,"computeDebugName");function Era(t,e){for(let r in t)if(t[r]===e)return r}a(Era,"findKey");var Qsi=new Map,qsi=new WeakMap;function vra(t){let e=qsi.get(t);if(e)return e;let r=Hsi(t)??"Object",n=Qsi.get(r)??0;n++,Qsi.set(r,n);let o=n===1?r:`${r}#${n}`;return qsi.set(t,o),o}a(vra,"formatOwner");function Hsi(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a(Hsi,"getClassName");function Gsi(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(Gsi,"getFunctionName")});var nai=I(Rp=>{"use strict";p();var Cra=Rp&&Rp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bra=Rp&&Rp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Sra=Rp&&Rp.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot===e}a(zsi,"strictEqualsC");function Ysi(t,e,r){return Wsi.equals(t,e,r??Nft)}a(Ysi,"arrayEquals");function Ksi(t){return(e,r)=>Wsi.equals(e,r,t??Nft)}a(Ksi,"arrayEqualsC");function zMe(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;rzMe(t,e)}a(Jsi,"structuralEqualsC");function Tra(t){return JSON.stringify(v0r(t))}a(Tra,"getStructuralKey");var Ira=0,$si=new WeakMap;function v0r(t){if(Array.isArray(t))return t.map(v0r);if(t&&typeof t=="object")if(Object.getPrototypeOf(t)===Object.prototype){let e=t,r=Object.create(null);for(let n of Object.keys(e).sort())r[n]=v0r(e[n]);return r}else{let e=$si.get(t);return e===void 0&&(e=Ira++,$si.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(v0r,"toNormalizedJsonStructure");function Zsi(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(Zsi,"jsonStringifyEquals");function Xsi(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(Xsi,"jsonStringifyEqualsC");function eai(){return(t,e)=>t.equals(e)}a(eai,"thisEqualsC");function tai(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(tai,"equalsIfDefined");function rai(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(rai,"equalsIfDefinedC");var Vsi;(function(t){t.strict=Nft,t.strictC=zsi,t.array=Ysi,t.arrayC=Ksi,t.structural=zMe,t.structuralC=Jsi,t.jsonStringify=Zsi,t.jsonStringifyC=Xsi,t.thisC=eai,t.ifDefined=tai,t.ifDefinedC=rai})(Vsi||(Rp.equals=Vsi={}))});var Ov=I(kp=>{"use strict";p();Object.defineProperty(kp,"__esModule",{value:!0});kp.trackDisposable=kp.toDisposable=kp.markAsDisposed=kp.DisposableStore=kp.Event=kp.onUnexpectedError=kp.onBugIndicatingError=kp.BugIndicatingError=kp.strictEquals=kp.assertFn=void 0;var xra=pd();Object.defineProperty(kp,"assertFn",{enumerable:!0,get:a(function(){return xra.assertFn},"get")});var wra=nai();Object.defineProperty(kp,"strictEquals",{enumerable:!0,get:a(function(){return wra.strictEquals},"get")});var C0r=Os();Object.defineProperty(kp,"BugIndicatingError",{enumerable:!0,get:a(function(){return C0r.BugIndicatingError},"get")});Object.defineProperty(kp,"onBugIndicatingError",{enumerable:!0,get:a(function(){return C0r.onBugIndicatingError},"get")});Object.defineProperty(kp,"onUnexpectedError",{enumerable:!0,get:a(function(){return C0r.onUnexpectedError},"get")});var Rra=Fc();Object.defineProperty(kp,"Event",{enumerable:!0,get:a(function(){return Rra.Event},"get")});var Mft=Po();Object.defineProperty(kp,"DisposableStore",{enumerable:!0,get:a(function(){return Mft.DisposableStore},"get")});Object.defineProperty(kp,"markAsDisposed",{enumerable:!0,get:a(function(){return Mft.markAsDisposed},"get")});Object.defineProperty(kp,"toDisposable",{enumerable:!0,get:a(function(){return Mft.toDisposable},"get")});Object.defineProperty(kp,"trackDisposable",{enumerable:!0,get:a(function(){return Mft.trackDisposable},"get")})});var iai=I(b0r=>{"use strict";p();Object.defineProperty(b0r,"__esModule",{value:!0});b0r.handleBugIndicatingErrorRecovery=Pra;var kra=Ov();function Pra(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,kra.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(Pra,"handleBugIndicatingErrorRecovery")});var F4=I(Rge=>{"use strict";p();Object.defineProperty(Rge,"__esModule",{value:!0});Rge.addLogger=Dra;Rge.getLogger=Nra;Rge.setLogObservableFn=Mra;Rge.logObservable=Ora;var Qee;function Dra(t){Qee?Qee instanceof Oft?Qee.loggers.push(t):Qee=new Oft([Qee,t]):Qee=t}a(Dra,"addLogger");function Nra(){return Qee}a(Nra,"getLogger");var S0r;function Mra(t){S0r=t}a(Mra,"setLogObservableFn");function Ora(t){S0r&&S0r(t)}a(Ora,"logObservable");var Oft=class{static{a(this,"ComposedLogger")}constructor(e){this.loggers=e}handleObservableCreated(e,r){for(let n of this.loggers)n.handleObservableCreated(e,r)}handleOnListenerCountChanged(e,r){for(let n of this.loggers)n.handleOnListenerCountChanged(e,r)}handleObservableUpdated(e,r){for(let n of this.loggers)n.handleObservableUpdated(e,r)}handleAutorunCreated(e,r){for(let n of this.loggers)n.handleAutorunCreated(e,r)}handleAutorunDisposed(e){for(let r of this.loggers)r.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,r,n){for(let o of this.loggers)o.handleAutorunDependencyChanged(e,r,n)}handleAutorunStarted(e){for(let r of this.loggers)r.handleAutorunStarted(e)}handleAutorunFinished(e){for(let r of this.loggers)r.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,r,n){for(let o of this.loggers)o.handleDerivedDependencyChanged(e,r,n)}handleDerivedCleared(e){for(let r of this.loggers)r.handleDerivedCleared(e)}handleBeginTransaction(e){for(let r of this.loggers)r.handleBeginTransaction(e)}handleEndTransaction(e){for(let r of this.loggers)r.handleEndTransaction(e)}}});var n6=I(xG=>{"use strict";p();Object.defineProperty(xG,"__esModule",{value:!0});xG.TransactionImpl=void 0;xG.transaction=T0r;xG.globalTransaction=Bra;xG.asyncTransaction=Fra;xG.subtransaction=Ura;var oai=iai(),Lra=lI(),sai=F4();function T0r(t,e){let r=new kge(t,e);try{t(r)}finally{r.finish()}}a(T0r,"transaction");var Lft;function Bra(t){if(Lft)t(Lft);else{let e=new kge(t,void 0);Lft=e;try{t(e)}finally{e.finish(),Lft=void 0}}}a(Bra,"globalTransaction");async function Fra(t,e){let r=new kge(t,e);try{await t(r)}finally{r.finish()}}a(Fra,"asyncTransaction");function Ura(t,e,r){t?e(t):T0r(e,r)}a(Ura,"subtransaction");var kge=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,sai.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,Lra.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,oai.handleBugIndicatingErrorRecovery)("Transaction already finished!"),T0r(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,oai.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(Bft,"__esModule",{value:!0});Bft.DebugLocation=void 0;var aai;(function(t){let e=!1;function r(){e=!0}a(r,"enable"),t.enable=r;function n(){if(!e)return;let o=Error,s=o.stackTraceLimit;o.stackTraceLimit=3;let c=new Error().stack;return o.stackTraceLimit=s,I0r.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(aai||(Bft.DebugLocation=aai={}));var I0r=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` -`),o=Qra(n[r+1]);if(o)return new t(o.fileName,o.line,o.column,o.id)}constructor(e,r,n,o){this.fileName=e,this.line=r,this.column=n,this.id=o}};function Qra(t){let e=t.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:t};let r=t.match(/at ([^\(\)]*):(\d+):(\d+)/);if(r)return{fileName:r[1],line:parseInt(r[2]),column:parseInt(r[3]),id:t}}a(Qra,"parseLine")});var _D=I(U4=>{"use strict";p();Object.defineProperty(U4,"__esModule",{value:!0});U4.BaseObservable=U4.ConvenientObservable=void 0;U4._setDerivedOpts=jra;U4._setRecomputeInitiallyAndOnChange=Hra;U4._setKeepObserved=Gra;U4._setDebugGetObservableGraph=$ra;var cai=uI(),qra=lI(),Pge=F4(),x0r;function jra(t){x0r=t}a(jra,"_setDerivedOpts");var lai;function Hra(t){lai=t}a(Hra,"_setRecomputeInitiallyAndOnChange");var uai;function Gra(t){uai=t}a(Gra,"_setKeepObserved");var w0r;function $ra(t){w0r=t}a($ra,"_setDebugGetObservableGraph");var Fft=class{static{a(this,"ConvenientObservable")}get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,r,n=cai.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return x0r({owner:o,debugName:a(()=>{let c=(0,qra.getFunctionName)(s);if(c!==void 0)return c;let u=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(u)return`${this.debugName}.${u[2]}`;if(!o)return`${this.debugName} (mapped)`},"debugName"),debugReferenceFn:s},c=>s(this.read(c),c),n)}flatten(){return x0r({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(lai(this,r)),this}keepObserved(e){return e.add(uai(this)),this}get debugValue(){return this.get()}get debug(){return new R0r(this)}};U4.ConvenientObservable=Fft;var R0r=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return w0r(this.observable,{type:"dependencies"})}getObserverGraph(){return w0r(this.observable,{type:"observers"})}},k0r=class extends Fft{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,Pge.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,Pge.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,Pge.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,Pge.getLogger)();return(0,Pge.logObservable)(this),e||(0,Pge.getLogger)()?.handleObservableCreated(this,cai.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};U4.BaseObservable=k0r});var i6=I(wG=>{"use strict";p();Object.defineProperty(wG,"__esModule",{value:!0});wG.DisposableObservableValue=wG.ObservableValue=void 0;wG.observableValue=zra;wG.disposableObservableValue=Yra;var Vra=n6(),Wra=_D(),fai=Ov(),Uft=lI(),dai=F4(),pai=uI();function zra(t,e,r=pai.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Uft.DebugNameData(void 0,t,void 0):n=new Uft.DebugNameData(t,void 0,void 0),new YMe(n,e,fai.strictEquals,r)}a(zra,"observableValue");var YMe=class extends Wra.BaseObservable{static{a(this,"ObservableValue")}get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,r,n,o){super(o),this._debugNameData=e,this._equalityComparator=n,this._value=r,(0,dai.getLogger)()?.handleObservableUpdated(this,{hadValue:!1,newValue:r,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,r,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let o;r||(r=o=new Vra.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),(0,dai.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(let c of this._observers)r.updateObserver(c,this),c.handleChange(this,n)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}};wG.ObservableValue=YMe;function Yra(t,e,r=pai.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Uft.DebugNameData(void 0,t,void 0):n=new Uft.DebugNameData(t,void 0,void 0),new Qft(n,e,fai.strictEquals,r)}a(Yra,"disposableObservableValue");var Qft=class extends YMe{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};wG.DisposableObservableValue=Qft});var mai=I(qft=>{"use strict";p();Object.defineProperty(qft,"__esModule",{value:!0});qft.LazyObservableValue=void 0;var Kra=n6(),hai=F4(),Jra=_D(),P0r=class extends Jra.BaseObservable{static{a(this,"LazyObservableValue")}get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,r,n,o){super(o),this._debugNameData=e,this._equalityComparator=n,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=r}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(let e of this._deltas){(0,hai.getLogger)()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let r of this._observers)r.handleChange(this,e)}this._deltas.length=0}else{(0,hai.getLogger)()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(let e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();let e=[...this._observers];for(let r of e)r.endUpdate(this)}}addObserver(e){let r=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),r&&e.beginUpdate(this)}removeObserver(e){let r=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),r&&e.endUpdate(this)}set(e,r,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let o;r||(r=o=new Kra.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),n!==void 0&&this._deltas.push(n),r.updateObserver({beginUpdate:a(()=>this._beginUpdate(),"beginUpdate"),endUpdate:a(()=>this._endUpdate(),"endUpdate"),handleChange:a((s,c)=>{},"handleChange"),handlePossibleChange:a(s=>{},"handlePossibleChange")},this),this._updateCounter>1)for(let s of this._observers)s.handlePossibleChange(this)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}};qft.LazyObservableValue=P0r});var jft=I(D0r=>{"use strict";p();Object.defineProperty(D0r,"__esModule",{value:!0});D0r.observableValueOpts=tna;var gai=lI(),Aai=Ov(),Zra=i6(),Xra=mai(),ena=uI();function tna(t,e,r=ena.DebugLocation.ofCaller()){return t.lazy?new Xra.LazyObservableValue(new gai.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??Aai.strictEquals,r):new Zra.ObservableValue(new gai.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??Aai.strictEquals,r)}a(tna,"observableValueOpts")});var Gft=I(Hft=>{"use strict";p();Object.defineProperty(Hft,"__esModule",{value:!0});Hft.AutorunObserver=void 0;var RR=Ov(),KMe=F4();function rna(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(rna,"autorunStateToString");var N0r=class{static{a(this,"AutorunObserver")}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,r,n,o){this._debugNameData=e,this._runFn=r,this._changeTracker=n,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._iteration=0,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),(0,KMe.getLogger)()?.handleAutorunCreated(this,o),this._run(),(0,RR.trackDisposable)(this)}dispose(){if(!this._disposed){this._disposed=!0;for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),(0,KMe.getLogger)()?.handleAutorunDisposed(this),(0,RR.markAsDisposed)(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(0,KMe.getLogger)()?.handleAutorunStarted(this);let r=this._changeSummary,n=this._delayedStore;n!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,r),this._changeSummary=this._changeTracker.createChangeSummary(r)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,r)}catch(o){(0,RR.onBugIndicatingError)(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||(0,KMe.getLogger)()?.handleAutorunFinished(this);for(let r of this._dependenciesToBeRemoved)r.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===3&&(this._checkIterations(),this._state=1),this._updateCount++}endUpdate(e){try{if(this._updateCount===1){this._iteration=1;do{if(this._checkIterations())return;if(this._state===1){this._state=3;for(let r of this._dependencies)if(r.reportChanges(),this._state===2)break}this._iteration++,this._state!==3&&this._run()}while(this._state!==3)}}finally{this._updateCount--}(0,RR.assertFn)(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===3&&this._isDependency(e)&&(this._checkIterations(),this._state=1)}handleChange(e,r){if(this._isDependency(e)){(0,KMe.getLogger)()?.handleAutorunDependencyChanged(this,e,r);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:r,didChange:a(o=>o===e,"didChange")},this._changeSummary))&&(this._checkIterations(),this._state=2)}catch(n){(0,RR.onBugIndicatingError)(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new RR.BugIndicatingError("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);let r=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),r}get store(){if(this._ensureNoRunning(),this._disposed)throw new RR.BugIndicatingError("Cannot access store after dispose");return this._store===void 0&&(this._store=new RR.DisposableStore),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new RR.BugIndicatingError("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new RR.DisposableStore),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:rna(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?((0,RR.onBugIndicatingError)(new RR.BugIndicatingError(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};Hft.AutorunObserver=N0r});var qee=I(kR=>{"use strict";p();Object.defineProperty(kR,"__esModule",{value:!0});kR.autorun=L0r;kR.autorunOpts=JMe;kR.autorunHandleChanges=yai;kR.autorunWithStoreHandleChanges=ona;kR.autorunWithStore=sna;kR.autorunDelta=ana;kR.autorunIterableDelta=cna;kR.autorunPerKeyedItem=lna;kR.autorunSelfDisposable=una;kR.registerAutorunSelfDisposable=dna;var Dge=Ov(),M0r=lI(),O0r=Gft(),Nge=uI(),nna=i6(),ina=n6();function L0r(t,e=Nge.DebugLocation.ofCaller()){return new O0r.AutorunObserver(new M0r.DebugNameData(void 0,void 0,t),t,void 0,e)}a(L0r,"autorun");function JMe(t,e,r=Nge.DebugLocation.ofCaller()){return new O0r.AutorunObserver(new M0r.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(JMe,"autorunOpts");function yai(t,e,r=Nge.DebugLocation.ofCaller()){return new O0r.AutorunObserver(new M0r.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(yai,"autorunHandleChanges");function ona(t,e){let r=new Dge.DisposableStore,n=yai({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,Dge.toDisposable)(()=>{n.dispose(),r.dispose()})}a(ona,"autorunWithStoreHandleChanges");function sna(t){let e=new Dge.DisposableStore,r=JMe({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,Dge.toDisposable)(()=>{r.dispose(),e.dispose()})}a(sna,"autorunWithStore");function ana(t,e){let r;return JMe({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(ana,"autorunDelta");function cna(t,e,r=n=>n){let n=new Map;return JMe({debugReferenceFn:t},o=>{let s=new Map,c=new Map(n);for(let l of t(o)){let u=r(l);n.has(u)?c.delete(u):(s.set(u,l),n.set(u,l))}for(let l of c.keys())n.delete(l);(s.size||c.size)&&e({addedValues:[...s.values()],removedValues:[...c.values()]})})}a(cna,"autorunIterableDelta");function lna(t,e,r,n=Nge.DebugLocation.ofCaller()){let o=new Map,s=JMe({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,ina.transaction)(f=>{for(let h of l){let m=e(h);u.add(m);let g=o.get(m);if(g)g.value.set(h,f);else{let A=new Dge.DisposableStore,_={value:(0,nna.observableValue)("keyedItem",h),store:A};o.set(m,_),d.push({key:m,cell:_})}}for(let[h,m]of o)u.has(h)||(m.store.dispose(),o.delete(h))});for(let{key:f,cell:h}of d)r(f,h.value,h.store)},n);return(0,Dge.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(lna,"autorunPerKeyedItem");function una(t,e=Nge.DebugLocation.ofCaller()){let r,n=!1;return r=L0r(o=>{t({delayedStore:o.delayedStore,store:o.store,readObservable:o.readObservable.bind(o),dispose:a(()=>{r?.dispose(),n=!0},"dispose")})},e),n&&r.dispose(),r}a(una,"autorunSelfDisposable");function dna(t,e,r=Nge.DebugLocation.ofCaller()){let n,o=!1;n=L0r(s=>{e({delayedStore:s.delayedStore,store:s.store,readObservable:s.readObservable.bind(s),dispose:a(()=>{n?t.delete(n):o=!0},"dispose")})},r),o?n.dispose():t.add(n)}a(dna,"registerAutorunSelfDisposable")});var Oge=I(Mge=>{"use strict";p();Object.defineProperty(Mge,"__esModule",{value:!0});Mge.DerivedWithSetter=Mge.Derived=void 0;var fna=_D(),jee=Ov(),B0r=F4();function pna(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(pna,"derivedStateToString");var $ft=class extends fna.BaseObservable{static{a(this,"Derived")}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,r,n,o=void 0,s,c){super(c),this._debugNameData=e,this._computeFn=r,this._changeTracker=n,this._handleLastObserverRemoved=o,this._equalityComparator=s,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=0,this._value=void 0,(0,B0r.getLogger)()?.handleDerivedCleared(this);for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let r;try{this._isReaderValid=!0;let n;this._changeTracker&&(n=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,n)),r=this._computeFn(this,n)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),r}else{do{if(this._state===1){for(let r of this._dependencies)if(r.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;let r=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=r;try{let n=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,n),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(n));let o=this._state!==0,s=this._value;this._state=3;let c=this._delayedStore;c!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,n)}finally{this._isReaderValid=!1;for(let l of this._dependenciesToBeRemoved)l.removeObserver(this);this._dependenciesToBeRemoved.clear(),c!==void 0&&c.dispose()}e=this._didReportChange||o&&!this._equalityComparator(s,this._value),(0,B0r.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,jee.onBugIndicatingError)(n)}if(this._isComputing=!1,!this._didReportChange&&e)for(let n of this._observers)n.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new jee.BugIndicatingError("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{let r=this._updateCount===1;if(this._state===3&&(this._state=1,!r))for(let n of this._observers)n.handlePossibleChange(this);if(r)for(let n of this._observers)n.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){let r=[...this._observers];for(let n of r)n.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let n=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(let o of n)o.endUpdate(this)}}(0,jee.assertFn)(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(let r of this._observers)r.handlePossibleChange(this)}}handleChange(e,r){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){(0,B0r.getLogger)()?.handleDerivedDependencyChanged(this,e,r);let n=!1;try{n=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:r,didChange:a(s=>s===e,"didChange")},this._changeSummary):!0}catch(s){(0,jee.onBugIndicatingError)(s)}let o=this._state===3;if(n&&(this._state===1||o)&&(this._state=2,o))for(let s of this._observers)s.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new jee.BugIndicatingError("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);let r=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),r}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(let r of this._observers)r.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new jee.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new jee.DisposableStore),this._delayedStore}addObserver(e){let r=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),r&&(this._removedObserverToCallEndUpdateOn?.delete(e)||e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:pna(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this.beginUpdate(this);try{this._isComputing?this._state=2:this._recompute()}finally{this.endUpdate(this)}}setValue(e,r,n){this._value=e;let o=this._observers;r.updateObserver(this,this);for(let s of o)s.handleChange(this,n)}};Mge.Derived=$ft;var F0r=class extends $ft{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};Mge.DerivedWithSetter=F0r});var Vft=I(RG=>{"use strict";p();Object.defineProperty(RG,"__esModule",{value:!0});RG.derived=mna;RG.derivedWithSetter=gna;RG.derivedOpts=_ai;RG.derivedHandleChanges=Ana;RG.derivedWithStore=yna;RG.derivedDisposable=_na;var Q4=Ov(),Lge=uI(),Hee=lI(),hna=_D(),Gee=Oge();function mna(t,e,r=Lge.DebugLocation.ofCaller()){return e!==void 0?new Gee.Derived(new Hee.DebugNameData(t,void 0,e),e,void 0,void 0,Q4.strictEquals,r):new Gee.Derived(new Hee.DebugNameData(void 0,void 0,t),t,void 0,void 0,Q4.strictEquals,r)}a(mna,"derived");function gna(t,e,r,n=Lge.DebugLocation.ofCaller()){return new Gee.DerivedWithSetter(new Hee.DebugNameData(t,void 0,e),e,void 0,void 0,Q4.strictEquals,r,n)}a(gna,"derivedWithSetter");function _ai(t,e,r=Lge.DebugLocation.ofCaller()){return new Gee.Derived(new Hee.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??Q4.strictEquals,r)}a(_ai,"derivedOpts");(0,hna._setDerivedOpts)(_ai);function Ana(t,e,r=Lge.DebugLocation.ofCaller()){return new Gee.Derived(new Hee.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??Q4.strictEquals,r)}a(Ana,"derivedHandleChanges");function yna(t,e,r=Lge.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new Q4.DisposableStore;return new Gee.Derived(new Hee.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new Q4.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),Q4.strictEquals,r)}a(yna,"derivedWithStore");function _na(t,e,r=Lge.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new Gee.Derived(new Hee.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new Q4.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},Q4.strictEquals,r)}a(_na,"derivedDisposable")});var Cai=I(PR=>{"use strict";p();Object.defineProperty(PR,"__esModule",{value:!0});PR.ObservableLazyPromise=PR.ObservableResolvedPromise=PR.PromiseResult=PR.ObservablePromise=PR.ObservableLazy=void 0;var Ena=qee(),Eai=n6(),vai=Vft(),Wft=i6(),zft=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,Wft.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};PR.ObservableLazy=zft;var Yft=class t{static{a(this,"ObservablePromise")}static fromFn(e){return new t(e())}static resolved(e){return new t(Promise.resolve(e))}constructor(e){this._value=(0,Wft.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,vai.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,Eai.transaction)(n=>{this._value.set(new ZMe(r,void 0),n)}),r),r=>{throw(0,Eai.transaction)(n=>{this._value.set(new ZMe(void 0,r),n)}),r})}};PR.ObservablePromise=Yft;var ZMe=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};PR.PromiseResult=ZMe;var U0r=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,Wft.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,Wft.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,Ena.autorun)(o=>{let s=e.read(o);this._runningPromise=s;let c=s.promiseResult.read(o);c?s===this._runningPromise&&(this._isResolving.set(!1,void 0),this._lastResolved.set(c.getDataOrThrow(),void 0)):this._isResolving.set(!0,void 0)}))}};PR.ObservableResolvedPromise=U0r;var Q0r=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new zft(()=>new Yft(this._computePromise())),this.cachedPromiseResult=(0,vai.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};PR.ObservableLazyPromise=Q0r});var j0r=I(q4=>{"use strict";p();Object.defineProperty(q4,"__esModule",{value:!0});q4.cancelOnDispose=q4.CancellationTokenSource=q4.CancellationToken=q4.CancellationError=void 0;var vna=Os();Object.defineProperty(q4,"CancellationError",{enumerable:!0,get:a(function(){return vna.CancellationError},"get")});var q0r=S2();Object.defineProperty(q4,"CancellationToken",{enumerable:!0,get:a(function(){return q0r.CancellationToken},"get")});Object.defineProperty(q4,"CancellationTokenSource",{enumerable:!0,get:a(function(){return q0r.CancellationTokenSource},"get")});Object.defineProperty(q4,"cancelOnDispose",{enumerable:!0,get:a(function(){return q0r.cancelOnDispose},"get")})});var bai=I(Kft=>{"use strict";p();Object.defineProperty(Kft,"__esModule",{value:!0});Kft.waitForState=xna;Kft.derivedWithCancellationToken=wna;var Cna=lI(),H0r=j0r(),bna=Ov(),Sna=qee(),Tna=Oge(),Ina=uI();function xna(t,e,r,n){return e||(e=a(o=>o!=null,"predicate")),new Promise((o,s)=>{let c=!0,l=!1,u=t.map(f=>({isFinished:e(f),error:r?r(f):!1,state:f})),d=(0,Sna.autorun)(f=>{let{isFinished:h,error:m,state:g}=u.read(f);(h||m)&&(c?l=!0:d.dispose(),m?s(m===!0?g:m):o(g))});if(n){let f=n.onCancellationRequested(()=>{d.dispose(),f.dispose(),s(new H0r.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new H0r.CancellationError);return}}c=!1,l&&d.dispose()})}a(xna,"waitForState");function wna(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new Tna.Derived(new Cna.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new H0r.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),bna.strictEquals,Ina.DebugLocation.ofCaller())}a(wna,"derivedWithCancellationToken")});var kG=I($ee=>{"use strict";p();Object.defineProperty($ee,"__esModule",{value:!0});$ee.FromEventObservable=void 0;$ee.observableFromEvent=G0r;$ee.observableFromEventOpts=Pna;var Rna=n6(),Tai=Ov(),Iai=lI(),Sai=F4(),kna=_D(),xai=uI();function G0r(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new ED(new Iai.DebugNameData(e,void 0,n),r,n,()=>ED.globalTransaction,Tai.strictEquals,o??xai.DebugLocation.ofCaller())}a(G0r,"observableFromEvent");function Pna(t,e,r,n=xai.DebugLocation.ofCaller()){return new ED(new Iai.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??ED.globalTransaction,t.equalsFn??Tai.strictEquals,n)}a(Pna,"observableFromEventOpts");var ED=class extends kna.BaseObservable{static{a(this,"FromEventObservable")}constructor(e,r,n,o,s,c){super(c),this._debugNameData=e,this.event=r,this._getValue=n,this._getTransaction=o,this._equalityComparator=s,this._hasValue=!1,this.handleEvent=l=>{let u=this._getValue(l),d=this._value,f=!this._hasValue||!this._equalityComparator(d,u),h=!1;f&&(this._value=u,this._hasValue&&(h=!0,(0,Rna.subtransaction)(this._getTransaction(),m=>{(0,Sai.getLogger)()?.handleObservableUpdated(this,{oldValue:d,newValue:u,change:void 0,didChange:f,hadValue:this._hasValue});for(let g of this._observers)m.updateObserver(g,this),g.handleChange(this,void 0)},()=>{let m=this.getDebugName();return"Event fired"+(m?`: ${m}`:"")})),this._hasValue=!0),h||(0,Sai.getLogger)()?.handleObservableUpdated(this,{oldValue:d,newValue:u,change:void 0,didChange:f,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}};$ee.FromEventObservable=ED;(function(t){t.Observer=ED;function e(r,n){let o=!1;ED.globalTransaction===void 0&&(ED.globalTransaction=r,o=!0);try{n()}finally{o&&(ED.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})(G0r||($ee.observableFromEvent=G0r={}))});var V0r=I($0r=>{"use strict";p();Object.defineProperty($0r,"__esModule",{value:!0});$0r.observableSignal=Lna;var Dna=n6(),Nna=lI(),Mna=_D(),Ona=uI();function Lna(t,e=Ona.DebugLocation.ofCaller()){return typeof t=="string"?new Jft(t,void 0,e):new Jft(void 0,t,e)}a(Lna,"observableSignal");var Jft=class extends Mna.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new Nna.DebugNameData(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,r,n){super(n),this._debugName=e,this._owner=r}trigger(e,r){if(!e){(0,Dna.transaction)(n=>{this.trigger(n,r)},()=>`Trigger signal ${this.debugName}`);return}for(let n of this._observers)e.updateObserver(n,this),n.handleChange(this,r)}get(){}}});var Xft=I(V_=>{"use strict";p();Object.defineProperty(V_,"__esModule",{value:!0});V_.KeepAliveObserver=void 0;V_.observableFromPromise=Bna;V_.signalFromObservable=Fna;V_.debouncedObservable=Una;V_.throttledObservable=Qna;V_.debouncedObservable2=qna;V_.wasEventTriggeredRecently=jna;V_.keepObserved=Nai;V_.recomputeInitiallyAndOnChange=Mai;V_.derivedObservableWithCache=Hna;V_.derivedObservableWithWritableCache=Gna;V_.mapObservableArrayCached=$na;V_.isObservable=Vna;var wai=qee(),Rai=i6(),W0r=Ov(),eOe=Vft(),kai=kG(),Pai=V0r(),Dai=_D(),z0r=uI();function Bna(t){let e=(0,Rai.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(Bna,"observableFromPromise");function Fna(t,e){return(0,eOe.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(Fna,"signalFromObservable");function Una(t,e,r=z0r.DebugLocation.ofCaller()){let n=!1,o,s;return(0,kai.observableFromEvent)(void 0,c=>{let l=(0,wai.autorun)(u=>{let d=t.read(u);if(!n)n=!0,o=d;else{s&&clearTimeout(s);let f=typeof e=="number"?e:e(o,d);if(f===0){o=d,c();return}s=setTimeout(()=>{o=d,c()},f)}});return{dispose(){l.dispose(),n=!1,o=void 0}}},()=>n?o:t.get(),r)}a(Una,"debouncedObservable");function Qna(t,e,r=z0r.DebugLocation.ofCaller()){let n=!1,o,s;return(0,kai.observableFromEvent)(void 0,c=>{let l=(0,wai.autorun)(u=>{let d=t.read(u);n?s||(s=setTimeout(()=>{s=void 0,o=t.read(void 0),c()},e)):(n=!0,o=d)});return{dispose(){l.dispose(),s&&(clearTimeout(s),s=void 0),n=!1,o=void 0}}},()=>n?o:t.get(),r)}a(Qna,"throttledObservable");function qna(t,e,r=z0r.DebugLocation.ofCaller()){let n=(0,Pai.observableSignal)("handleTimeout"),o,s;return(0,eOe.derivedOpts)({owner:void 0,onLastObserverRemoved:a(()=>{o=void 0},"onLastObserverRemoved")},l=>{let u=t.read(l);if(n.read(l),u!==o){let d=typeof e=="number"?e:e(o,u);if(d===0)return o=u,u;s&&clearTimeout(s),s=setTimeout(()=>{o=u,n.trigger(void 0)},d)}return o},r)}a(qna,"debouncedObservable2");function jna(t,e,r){let n=(0,Rai.observableValue)("triggeredRecently",!1),o;return r.add(t(()=>{n.set(!0,void 0),o&&clearTimeout(o),o=setTimeout(()=>{n.set(!1,void 0)},e)})),n}a(jna,"wasEventTriggeredRecently");function Nai(t){let e=new XMe(!1,void 0);return t.addObserver(e),(0,W0r.toDisposable)(()=>{t.removeObserver(e)})}a(Nai,"keepObserved");(0,Dai._setKeepObserved)(Nai);function Mai(t,e){let r=new XMe(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,W0r.toDisposable)(()=>{t.removeObserver(r)})}a(Mai,"recomputeInitiallyAndOnChange");(0,Dai._setRecomputeInitiallyAndOnChange)(Mai);var XMe=class{static{a(this,"KeepAliveObserver")}constructor(e,r){this._forceRecompute=e,this._handleValue=r,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,r){}};V_.KeepAliveObserver=XMe;function Hna(t,e){let r;return(0,eOe.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a(Hna,"derivedObservableWithCache");function Gna(t,e){let r,n=(0,Pai.observableSignal)("derivedObservableWithWritableCache"),o=(0,eOe.derived)(t,s=>(n.read(s),r=e(s,r),r));return Object.assign(o,{clearCache:a(s=>{r=void 0,n.trigger(s)},"clearCache"),setCache:a((s,c)=>{r=s,n.trigger(c)},"setCache")})}a(Gna,"derivedObservableWithWritableCache");function $na(t,e,r,n){let o=new Zft(r,n);return(0,eOe.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new Zft(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a($na,"mapObservableArrayCached");var Zft=class{static{a(this,"ArrayMap")}constructor(e,r){this._map=e,this._keySelector=r,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){let r=[],n=new Set(this._cache.keys());for(let o of e){let s=this._keySelector?this._keySelector(o):o,c=this._cache.get(s);if(c)n.delete(s);else{let l=new W0r.DisposableStore;c={out:this._map(o,l),store:l},this._cache.set(s,c)}r.push(c.out)}for(let o of n)this._cache.get(o).store.dispose(),this._cache.delete(o);this._items=r}getItems(){return this._items}};function Vna(t){return!!t&&t.read!==void 0&&t.reportChanges!==void 0}a(Vna,"isObservable")});var Lai=I(ept=>{"use strict";p();Object.defineProperty(ept,"__esModule",{value:!0});ept.recordChanges=Wna;ept.recordChangesLazy=zna;var Oai=Ov();function Wna(t){return{createChangeSummary:a(e=>({changes:[]}),"createChangeSummary"),handleChange(e,r){for(let n in t)e.didChange(t[n])&&r.changes.push({key:n,change:e.change});return!0},beforeUpdate(e,r){for(let n in t){if(n==="changes")throw new Oai.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(Wna,"recordChanges");function zna(t){let e;return{createChangeSummary:a(r=>({changes:[]}),"createChangeSummary"),handleChange(r,n){e||(e=t());for(let o in e)r.didChange(e[o])&&n.changes.push({key:o,change:r.change});return!0},beforeUpdate(r,n){e||(e=t());for(let o in e){if(o==="changes")throw new Oai.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(zna,"recordChangesLazy")});var Bai=I(K0r=>{"use strict";p();Object.defineProperty(K0r,"__esModule",{value:!0});K0r.constObservable=Kna;var Yna=_D();function Kna(t){return new Y0r(t)}a(Kna,"constObservable");var Y0r=class extends Yna.ConvenientObservable{static{a(this,"ConstObservable")}constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}log(){return this}toString(){return`Const: ${this.value}`}}});var Fai=I(Z0r=>{"use strict";p();Object.defineProperty(Z0r,"__esModule",{value:!0});Z0r.observableSignalFromEvent=tia;var Jna=n6(),Zna=lI(),Xna=_D(),eia=uI();function tia(t,e,r=eia.DebugLocation.ofCaller()){return new J0r(typeof t=="string"?t:new Zna.DebugNameData(t,void 0,void 0),e,r)}a(tia,"observableSignalFromEvent");var J0r=class extends Xna.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,Jna.transaction)(o=>{for(let s of this._observers)o.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}});var Uai=I(tOe=>{"use strict";p();Object.defineProperty(tOe,"__esModule",{value:!0});tOe.ValueWithChangeEventFromObservable=void 0;tOe.observableFromValueWithChangeEvent=iia;var ria=Ov(),nia=kG(),tpt=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return ria.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};tOe.ValueWithChangeEventFromObservable=tpt;function iia(t,e){return e instanceof tpt?e.observable:(0,nia.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(iia,"observableFromValueWithChangeEvent")});var jai=I(rOe=>{"use strict";p();Object.defineProperty(rOe,"__esModule",{value:!0});rOe.runOnChange=Qai;rOe.runOnChangeWithStore=qai;rOe.runOnChangeWithCancellationToken=cia;var oia=j0r(),sia=Ov(),aia=qee();function Qai(t,e){let r,n=!0;return(0,aia.autorunWithStoreHandleChanges)({changeTracker:{createChangeSummary:a(()=>({deltas:[],didChange:!1}),"createChangeSummary"),handleChange:a((o,s)=>{if(o.didChange(t)){let c=o.change;c!==void 0&&s.deltas.push(c),s.didChange=!0}return!0},"handleChange")}},(o,s)=>{let c=t.read(o),l=r;s.didChange&&(r=c,e(c,l,s.deltas)),n&&(n=!1,r=c)})}a(Qai,"runOnChange");function qai(t,e){let r=new sia.DisposableStore,n=Qai(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(qai,"runOnChangeWithStore");function cia(t,e){return qai(t,(r,n,o,s)=>{e(r,n,o,(0,oia.cancelOnDispose)(s))})}a(cia,"runOnChangeWithCancellationToken")});var $ai=I(rpt=>{"use strict";p();Object.defineProperty(rpt,"__esModule",{value:!0});rpt.latestChangedValue=fia;rpt.derivedConstOnceDefined=pia;var Hai=Ov(),Gai=lI(),lia=kG(),uia=qee(),dia=Xft();function fia(t,e){if(e.length===0)throw new Hai.BugIndicatingError;let r=!1,n,o=(0,lia.observableFromEvent)(t,s=>{let c=new Hai.DisposableStore;for(let l of e)c.add((0,uia.autorunOpts)({debugName:a(()=>(0,Gai.getDebugName)(o,new Gai.DebugNameData(t,void 0,void 0))+".updateLastChangedValue","debugName")},u=>{r=!0,n=l.read(u),s()}));return c.add({dispose(){r=!1,n=void 0}}),c},()=>r?n:e[e.length-1].get());return o}a(fia,"latestChangedValue");function pia(t,e){return(0,dia.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(pia,"derivedConstOnceDefined")});var Vai=I(npt=>{"use strict";p();Object.defineProperty(npt,"__esModule",{value:!0});npt.ObservableSet=void 0;var hia=jft(),X0r=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,hia.observableValueOpts)({equalsFn:a(()=>!1,"equalsFn")},this),this.observable=this._obs}get size(){return this._data.size}has(e){return this._data.has(e)}add(e,r){return this._data.has(e)||(this._data.add(e),this._obs.set(this,r)),this}delete(e,r){let n=this._data.delete(e);return n&&this._obs.set(this,r),n}clear(e){this._data.size>0&&(this._data.clear(),this._obs.set(this,e))}forEach(e,r){this._data.forEach((n,o,s)=>{e.call(r,n,o,this)})}*entries(){for(let e of this._data)yield[e,e]}*keys(){yield*this._data.keys()}*values(){yield*this._data.values()}[Symbol.iterator](){return this.values()}get[Symbol.toStringTag](){return"ObservableSet"}};npt.ObservableSet=X0r});var Wai=I(ipt=>{"use strict";p();Object.defineProperty(ipt,"__esModule",{value:!0});ipt.ObservableMap=void 0;var mia=jft(),eAr=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,mia.observableValueOpts)({equalsFn:a(()=>!1,"equalsFn")},this),this.observable=this._obs}get size(){return this._data.size}has(e){return this._data.has(e)}get(e){return this._data.get(e)}set(e,r,n){let o=this._data.has(e),s=this._data.get(e);return(!o||s!==r)&&(this._data.set(e,r),this._obs.set(this,n)),this}delete(e,r){let n=this._data.delete(e);return n&&this._obs.set(this,r),n}clear(e){this._data.size>0&&(this._data.clear(),this._obs.set(this,e))}forEach(e,r){this._data.forEach((n,o,s)=>{e.call(r,n,o,this)})}*entries(){yield*this._data.entries()}*keys(){yield*this._data.keys()}*values(){yield*this._data.values()}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return"ObservableMap"}};ipt.ObservableMap=eAr});var apt=I(Qge=>{"use strict";p();Object.defineProperty(Qge,"__esModule",{value:!0});Qge.ConsoleObservableLogger=void 0;Qge.logObservableToConsole=yia;Qge.formatValue=Uge;var gia=F4(),Aia=lI(),zai=Oge(),opt;function yia(t){opt||(opt=new spt,(0,gia.addLogger)(opt)),opt.addFilteredObj(t)}a(yia,"logObservableToConsole");var spt=class{static{a(this,"ConsoleObservableLogger")}constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return _ia([Bge(Cia("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[Bge(" "),DR(Uge(e.oldValue,70),{color:"red",strikeThrough:!0}),Bge(" "),DR(Uge(e.newValue,60),{color:"green"})]:[Bge(" (unchanged)")]:[Bge(" "),DR(Uge(e.newValue,60),{color:"green"}),Bge(" (initial)")]}handleObservableCreated(e){if(e instanceof zai.Derived){let r=e;if(this.changedObservablesSets.set(r,new Set),!1){let o=[];r.__debugUpdating=o;let s=r.beginUpdate;r.beginUpdate=l=>(o.push(l),s.apply(r,[l]));let c=r.endUpdate;r.endUpdate=l=>{let u=o.indexOf(l);return u===-1&&console.error("endUpdate called without beginUpdate",r.debugName,l.debugName),o.splice(u,1),c.apply(r,[l])}}}}handleOnListenerCountChanged(e,r){}handleObservableUpdated(e,r){if(this._isIncluded(e)){if(e instanceof zai.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([Fge("observable value changed"),DR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return DR(" (changed deps: "+[...e].map(r=>r.debugName).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(e,r,n){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(r)}_handleDerivedRecomputed(e,r){if(!this._isIncluded(e))return;let n=this.changedObservablesSets.get(e);n&&(console.log(...this.textToConsoleArgs([Fge("derived recomputed"),DR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r),this.formatChanges(n),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),n.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Fge("derived cleared"),DR(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Fge("observable from event triggered"),DR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r),{data:[{fn:e._getValue}]}]))}handleAutorunCreated(e){this._isIncluded(e)&&this.changedObservablesSets.set(e,new Set)}handleAutorunDisposed(e){}handleAutorunDependencyChanged(e,r,n){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(r)}handleAutorunStarted(e){let r=this.changedObservablesSets.get(e);r&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Fge("autorun"),DR(e.debugName,{color:"BlueViolet"}),this.formatChanges(r),{data:[{fn:e._debugNameData.referenceFn??e._runFn}]}])),r.clear(),this.indentation++)}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let r=e.getDebugName();r===void 0&&(r=""),this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Fge("transaction"),DR(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};Qge.ConsoleObservableLogger=spt;function _ia(t){let e=new Array,r=[],n="";function o(c){if("length"in c)for(let l of c)l&&o(l);else"text"in c?(n+=`%c${c.text}`,e.push(c.style),c.data&&r.push(...c.data)):"data"in c&&r.push(...c.data)}a(o,"process"),o(t);let s=[n,...e];return s.push(...r),s}a(_ia,"consoleTextToArgs");function Bge(t){return DR(t,{color:"black"})}a(Bge,"normalText");function Fge(t){return DR(bia(`${t}: `,10),{color:"black",bold:!0})}a(Fge,"formatKind");function DR(t,e={color:"black"}){function r(o){return Object.entries(o).reduce((s,[c,l])=>`${s}${c}:${l};`,"")}a(r,"objToCss");let n={color:e.color};return e.strikeThrough&&(n["text-decoration"]="line-through"),e.bold&&(n["font-weight"]="bold"),{text:t,style:r(n)}}a(DR,"styled");function Uge(t,e){switch(typeof t){case"number":return""+t;case"string":return t.length+2<=e?`"${t}"`:`"${t.substr(0,e-7)}"+...`;case"boolean":return t?"true":"false";case"undefined":return"undefined";case"object":return t===null?"null":Array.isArray(t)?Eia(t,e):via(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a(Uge,"formatValue");function Eia(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${Uge(o,e-r.length)}`}return r+=" ]",r}a(Eia,"formatArray");function via(t,e){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString){let s=t.toString();return s.length<=e?s:s.substring(0,e-3)+"..."}let r=(0,Aia.getClassName)(t),n=r?r+"(":"{ ",o=!0;for(let[s,c]of Object.entries(t)){if(o||(n+=", "),n.length-5>e){n+="...";break}o=!1,n+=`${s}: ${Uge(c,e-n.length)}`}return n+=r?")":" }",n}a(via,"formatObject");function Cia(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(Cia,"repeat");function bia(t,e){for(;t.length{"use strict";p();Object.defineProperty(cpt,"__esModule",{value:!0});cpt.SimpleTypedRpcConnection=void 0;var tAr=class t{static{a(this,"SimpleTypedRpcConnection")}static createHost(e,r){return new t(e,r)}static createClient(e,r){return new t(e,r)}constructor(e,r){this._channelFactory=e,this._getHandler=r,this._channel=this._channelFactory({handleNotification:a(s=>{let c=s,l=this._getHandler().notifications[c[0]];if(!l)throw new Error(`Unknown notification "${c[0]}"!`);l(...c[1])},"handleNotification"),handleRequest:a(s=>{let c=s;try{return{type:"result",value:this._getHandler().requests[c[0]](...c[1])}}catch(l){return{type:"error",value:l}}},"handleRequest")});let n=new Proxy({},{get:a((s,c)=>async(...l)=>{let u=await this._channel.sendRequest([c,l]);if(u.type==="error")throw u.value;return u.value},"get")}),o=new Proxy({},{get:a((s,c)=>(...l)=>{this._channel.sendNotification([c,l])},"get")});this.api={notifications:o,requests:n}}};cpt.SimpleTypedRpcConnection=tAr});var Kai=I(rAr=>{"use strict";p();Object.defineProperty(rAr,"__esModule",{value:!0});rAr.registerDebugChannel=Tia;var Sia=Yai();function Tia(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=Iia({sendNotification:a(u=>{o?o.sendNotification(u):n.push(u)},"sendNotification")}),l;return(r.$$debugValueEditor_debugChannels??(r.$$debugValueEditor_debugChannels={}))[t]=u=>{l=e(),o=u;for(let d of n)u.sendNotification(d);return n=[],c},Sia.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(Tia,"registerDebugChannel");function Iia(t){let e;return{channel:a(n=>(e=n,{sendNotification:a(o=>{t.sendNotification(o)},"sendNotification"),sendRequest:a(o=>{throw new Error("not supported")},"sendRequest")}),"channel"),handler:{handleRequest:a(n=>n.type==="notification"?e?.handleNotification(n.data):e?.handleRequest(n.data),"handleRequest")}}}a(Iia,"createChannelFactoryFromDebugChannel")});var Xai=I(PG=>{"use strict";p();Object.defineProperty(PG,"__esModule",{value:!0});PG.Throttler=PG.Debouncer=void 0;PG.deepAssign=Jai;PG.deepAssignDeleteNulls=Zai;var nAr=class{static{a(this,"Debouncer")}constructor(){this._timeout=void 0}debounce(e,r){this._timeout!==void 0&&clearTimeout(this._timeout),this._timeout=setTimeout(()=>{this._timeout=void 0,e()},r)}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};PG.Debouncer=nAr;var iAr=class{static{a(this,"Throttler")}constructor(){this._timeout=void 0}throttle(e,r){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},r))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};PG.Throttler=iAr;function Jai(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?Jai(t[r],e[r]):t[r]=e[r]}a(Jai,"deepAssign");function Zai(t,e){for(let r in e)e[r]===null?delete t[r]:t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?Zai(t[r],e[r]):t[r]=e[r]}a(Zai,"deepAssignDeleteNulls")});var rci=I(upt=>{"use strict";p();Object.defineProperty(upt,"__esModule",{value:!0});upt.DevToolsLogger=void 0;var eci=Gft(),lpt=apt(),xia=Kai(),oAr=Xai(),nOe=CT(),wia=kG(),Vee=Os(),Wee=Oge(),tci=i6(),Ria=uI(),sAr=class t{static{a(this,"DevToolsLogger")}static{this._instance=void 0}static getInstance(){return t._instance===void 0&&(t._instance=new t),t._instance}getTransactionState(){let e=[],r=[...this._activeTransactions];if(r.length===0)return;let n=r.flatMap(s=>s.debugGetUpdatingObservers()??[]).map(s=>s.observer),o=new Set;for(;n.length>0;){let s=n.shift();if(o.has(s))continue;o.add(s);let c=this._getInfo(s,l=>{o.has(l)||n.push(l)});c&&e.push(c)}return{names:r.map(s=>s.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,Vee.onUnexpectedError)(new Vee.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,Vee.onUnexpectedError)(new Vee.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof Wee.Derived){let n=[...e.debugGetObservers()];for(let u of n)r(u);let o=this._getObservableInfo(e);if(!o)return;let s=e.debugGetState(),c={name:e.debugName,instanceId:o.instanceId,updateCount:s.updateCount},l=[...o.changedObservables].map(u=>this._instanceInfos.get(u)?.instanceId).filter(nOe.isDefined);if(s.isComputing)return{...c,type:"observable/derived",state:"updating",changedDependencies:l,initialComputation:!1};switch(s.state){case 0:return{...c,type:"observable/derived",state:"noValue"};case 3:return{...c,type:"observable/derived",state:"upToDate"};case 2:return{...c,type:"observable/derived",state:"stale",changedDependencies:l};case 1:return{...c,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof eci.AutorunObserver){let n=this._getAutorunInfo(e);if(!n)return;let o={name:e.debugName,instanceId:n.instanceId,updateCount:n.updateCount},s=[...n.changedObservables].map(c=>this._instanceInfos.get(c).instanceId);if(e.debugGetState().isRunning)return{...o,type:"autorun",state:"updating",changedDependencies:s};switch(e.debugGetState().state){case 3:return{...o,type:"autorun",state:"upToDate"};case 2:return{...o,type:"autorun",state:"stale",changedDependencies:s};case 1:return{...o,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){let r=this._getObservableInfo(e);if(r)return{name:e.debugName,instanceId:r.instanceId}}_formatObserver(e){if(e instanceof Wee.Derived)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};let r=this._getAutorunInfo(e);if(r)return{name:e.toString(),instanceId:r.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=(0,xia.registerDebugChannel)("observableDevTools",()=>({notifications:{setDeclarationIdFilter:a(e=>{},"setDeclarationIdFilter"),logObservableValue:a(e=>{console.log("logObservableValue",e)},"logObservableValue"),flushUpdates:a(()=>{this._flushUpdates()},"flushUpdates"),resetUpdates:a(()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)},"resetUpdates")},requests:{getDeclarations:a(()=>{let e={};for(let r of this._declarations.values())e[r.id]=r;return{decls:e}},"getDeclarations"),getSummarizedInstances:a(()=>null,"getSummarizedInstances"),getObservableValueInfo:a(e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(n=>this._formatObserver(n)).filter(nOe.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(nOe.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(nOe.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(nOe.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof Wee.Derived)n.debugSetValue(r);else if(n instanceof tci.ObservableValue)n.debugSetValue(r);else if(n instanceof wia.FromEventObservable)n.debugSetValue(r);else throw new Vee.BugIndicatingError("Observable is not supported");let o=[...n.debugGetObservers()];for(let s of o)s.beginUpdate(n);for(let s of o)s.handleChange(n,void 0);for(let s of o)s.endUpdate(n)},"setValue"),getValue:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof Wee.Derived)return(0,lpt.formatValue)(r.debugGetState().value,200);if(r instanceof tci.ObservableValue)return(0,lpt.formatValue)(r.debugGetState().value,200)},"getValue"),logValue:a(e=>{let r=this._aliveInstances.get(e);if(r&&"get"in r)console.log("Logged Value:",r.get());else throw new Vee.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof Wee.Derived)r.debugRecompute();else if(r instanceof eci.AutorunObserver)r.debugRerun();else throw new Vee.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new oAr.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},Ria.DebugLocation.enable()}_handleChange(e){(0,oAr.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,oAr.deepAssign)(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,r){if(!r)return-1;let n=this._declarations.get(r.id);return n===void 0&&(n={id:this._declarationId++,type:e,url:r.fileName,line:r.line,column:r.column},this._declarations.set(r.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(e,r){let o={declarationId:this._getDeclarationId("observable/value",r),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o)}handleOnListenerCountChanged(e,r){let n=this._getObservableInfo(e);if(n){if(n.listenerCount===0&&r>0){let o=e instanceof Wee.Derived?"observable/derived":"observable/value";this._aliveInstances.set(n.instanceId,e),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:o,name:e.debugName}}})}else n.listenerCount>0&&r===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=r}}handleObservableUpdated(e,r){if(e instanceof Wee.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,lpt.formatValue)(r.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(e,r){let o={declarationId:this._getDeclarationId("autorun",r),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o),this._aliveInstances.set(o.instanceId,e),o&&this._handleChange({instances:{[o.instanceId]:{instanceId:o.instanceId,declarationId:o.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){let r=this._getAutorunInfo(e);r&&(this._handleChange({instances:{[r.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(r.instanceId))}handleAutorunDependencyChanged(e,r,n){let o=this._getAutorunInfo(e);o&&o.changedObservables.add(r)}handleAutorunStarted(e){}handleAutorunFinished(e){let r=this._getAutorunInfo(e);r&&(r.changedObservables.clear(),r.updateCount++,this._handleChange({instances:{[r.instanceId]:{runCount:r.updateCount}}}))}handleDerivedDependencyChanged(e,r,n){let o=this._getObservableInfo(e);o&&o.changedObservables.add(r)}_handleDerivedRecomputed(e,r){let n=this._getObservableInfo(e);if(!n)return;let o=(0,lpt.formatValue)(r.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=o,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:o,recomputationCount:n.updateCount}}})}handleDerivedCleared(e){let r=this._getObservableInfo(e);r&&(r.lastValue=void 0,r.changedObservables.clear(),r.listenerCount>0&&this._handleChange({instances:{[r.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}};upt.DevToolsLogger=sAr});var sci=I(aAr=>{"use strict";p();Object.defineProperty(aAr,"__esModule",{value:!0});aAr.debugGetObservableGraph=Mia;var kia=Oge(),Pia=kG(),Dia=i6(),Nia=Gft(),nci=apt();function Mia(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=zee.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?oci(n,0,o,e).trim():ici(n,0,o,e).trim()}a(Mia,"debugGetObservableGraph");function ici(t,e,r,n){let o=" ".repeat(e),s=[];if(r.has(t.sourceObj))return s.push(`${o}* ${t.type} ${t.name} (already listed)`),s.join(` -`);if(r.add(t.sourceObj),s.push(`${o}* ${t.type} ${t.name}:`),s.push(`${o} value: ${(0,nci.formatValue)(t.value,50)}`),s.push(`${o} state: ${t.state}`),t.dependencies.length>0){s.push(`${o} dependencies:`);for(let l of t.dependencies){let u=zee.from(l,n.debugNamePostProcessor??(d=>d))??zee.unknown(l);s.push(ici(u,e+1,r,n))}}return s.join(` -`)}a(ici,"formatObservableInfoWithDependencies");function oci(t,e,r,n){let o=" ".repeat(e),s=[];if(r.has(t.sourceObj))return s.push(`${o}* ${t.type} ${t.name} (already listed)`),s.join(` -`);if(r.add(t.sourceObj),s.push(`${o}* ${t.type} ${t.name}:`),s.push(`${o} value: ${(0,nci.formatValue)(t.value,50)}`),s.push(`${o} state: ${t.state}`),t.observers.length>0){s.push(`${o} observers:`);for(let l of t.observers){let u=zee.from(l,n.debugNamePostProcessor??(d=>d))??zee.unknown(l);s.push(oci(u,e+1,r,n))}}return s.join(` -`)}a(oci,"formatObservableInfoWithObservers");var zee=class t{static{a(this,"Info")}static from(e,r){if(e instanceof Nia.AutorunObserver){let n=e.debugGetState();return new t(e,r(e.debugName),"autorun",void 0,n.stateStr,Array.from(n.dependencies),[])}else if(e instanceof kia.Derived){let n=e.debugGetState();return new t(e,r(e.debugName),"derived",n.value,n.stateStr,Array.from(n.dependencies),Array.from(e.debugGetObservers()))}else if(e instanceof Dia.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof Pia.FromEventObservable){let n=e.debugGetState();return new t(e,r(e.debugName),"fromEvent",n.value,n.hasValue?"upToDate":"initial",[],Array.from(e.debugGetObservers()))}}static unknown(e){return new t(e,"(unknown)","unknown",void 0,"unknown",[],[])}constructor(e,r,n,o,s,c,l){this.sourceObj=e,this.name=r,this.type=n,this.value=o,this.state=s,this.dependencies=c,this.observers=l}}});var o6=I(Ut=>{"use strict";p();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ValueWithChangeEventFromObservable=Ut.observableFromValueWithChangeEvent=Ut.TransactionImpl=Ut.transaction=Ut.subtransaction=Ut.globalTransaction=Ut.asyncTransaction=Ut.observableSignalFromEvent=Ut.observableFromEventOpts=Ut.observableSignal=Ut.constObservable=Ut.recordChangesLazy=Ut.recordChanges=Ut.isObservable=Ut.wasEventTriggeredRecently=Ut.throttledObservable=Ut.signalFromObservable=Ut.recomputeInitiallyAndOnChange=Ut.observableFromPromise=Ut.mapObservableArrayCached=Ut.keepObserved=Ut.derivedObservableWithWritableCache=Ut.derivedObservableWithCache=Ut.debouncedObservable2=Ut.debouncedObservable=Ut.waitForState=Ut.derivedWithCancellationToken=Ut.PromiseResult=Ut.ObservableResolvedPromise=Ut.ObservablePromise=Ut.ObservableLazyPromise=Ut.ObservableLazy=Ut.derivedWithStore=Ut.derivedWithSetter=Ut.derivedOpts=Ut.derivedHandleChanges=Ut.derivedDisposable=Ut.derived=Ut.disposableObservableValue=Ut.registerAutorunSelfDisposable=Ut.autorunSelfDisposable=Ut.autorunPerKeyedItem=Ut.autorunIterableDelta=Ut.autorunWithStoreHandleChanges=Ut.autorunWithStore=Ut.autorunOpts=Ut.autorunHandleChanges=Ut.autorunDelta=Ut.autorun=Ut.observableValueOpts=void 0;Ut.DebugLocation=Ut.ObservableMap=Ut.ObservableSet=Ut.observableValue=Ut.observableFromEvent=Ut.latestChangedValue=Ut.derivedConstOnceDefined=Ut.runOnChangeWithStore=Ut.runOnChangeWithCancellationToken=Ut.runOnChange=void 0;var Oia=jft();Object.defineProperty(Ut,"observableValueOpts",{enumerable:!0,get:a(function(){return Oia.observableValueOpts},"get")});var j4=qee();Object.defineProperty(Ut,"autorun",{enumerable:!0,get:a(function(){return j4.autorun},"get")});Object.defineProperty(Ut,"autorunDelta",{enumerable:!0,get:a(function(){return j4.autorunDelta},"get")});Object.defineProperty(Ut,"autorunHandleChanges",{enumerable:!0,get:a(function(){return j4.autorunHandleChanges},"get")});Object.defineProperty(Ut,"autorunOpts",{enumerable:!0,get:a(function(){return j4.autorunOpts},"get")});Object.defineProperty(Ut,"autorunWithStore",{enumerable:!0,get:a(function(){return j4.autorunWithStore},"get")});Object.defineProperty(Ut,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return j4.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Ut,"autorunIterableDelta",{enumerable:!0,get:a(function(){return j4.autorunIterableDelta},"get")});Object.defineProperty(Ut,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return j4.autorunPerKeyedItem},"get")});Object.defineProperty(Ut,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return j4.autorunSelfDisposable},"get")});Object.defineProperty(Ut,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return j4.registerAutorunSelfDisposable},"get")});var Lia=i6();Object.defineProperty(Ut,"disposableObservableValue",{enumerable:!0,get:a(function(){return Lia.disposableObservableValue},"get")});var qge=Vft();Object.defineProperty(Ut,"derived",{enumerable:!0,get:a(function(){return qge.derived},"get")});Object.defineProperty(Ut,"derivedDisposable",{enumerable:!0,get:a(function(){return qge.derivedDisposable},"get")});Object.defineProperty(Ut,"derivedHandleChanges",{enumerable:!0,get:a(function(){return qge.derivedHandleChanges},"get")});Object.defineProperty(Ut,"derivedOpts",{enumerable:!0,get:a(function(){return qge.derivedOpts},"get")});Object.defineProperty(Ut,"derivedWithSetter",{enumerable:!0,get:a(function(){return qge.derivedWithSetter},"get")});Object.defineProperty(Ut,"derivedWithStore",{enumerable:!0,get:a(function(){return qge.derivedWithStore},"get")});var iOe=Cai();Object.defineProperty(Ut,"ObservableLazy",{enumerable:!0,get:a(function(){return iOe.ObservableLazy},"get")});Object.defineProperty(Ut,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return iOe.ObservableLazyPromise},"get")});Object.defineProperty(Ut,"ObservablePromise",{enumerable:!0,get:a(function(){return iOe.ObservablePromise},"get")});Object.defineProperty(Ut,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return iOe.ObservableResolvedPromise},"get")});Object.defineProperty(Ut,"PromiseResult",{enumerable:!0,get:a(function(){return iOe.PromiseResult},"get")});var cci=bai();Object.defineProperty(Ut,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return cci.derivedWithCancellationToken},"get")});Object.defineProperty(Ut,"waitForState",{enumerable:!0,get:a(function(){return cci.waitForState},"get")});var NR=Xft();Object.defineProperty(Ut,"debouncedObservable",{enumerable:!0,get:a(function(){return NR.debouncedObservable},"get")});Object.defineProperty(Ut,"debouncedObservable2",{enumerable:!0,get:a(function(){return NR.debouncedObservable2},"get")});Object.defineProperty(Ut,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return NR.derivedObservableWithCache},"get")});Object.defineProperty(Ut,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return NR.derivedObservableWithWritableCache},"get")});Object.defineProperty(Ut,"keepObserved",{enumerable:!0,get:a(function(){return NR.keepObserved},"get")});Object.defineProperty(Ut,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return NR.mapObservableArrayCached},"get")});Object.defineProperty(Ut,"observableFromPromise",{enumerable:!0,get:a(function(){return NR.observableFromPromise},"get")});Object.defineProperty(Ut,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return NR.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Ut,"signalFromObservable",{enumerable:!0,get:a(function(){return NR.signalFromObservable},"get")});Object.defineProperty(Ut,"throttledObservable",{enumerable:!0,get:a(function(){return NR.throttledObservable},"get")});Object.defineProperty(Ut,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return NR.wasEventTriggeredRecently},"get")});Object.defineProperty(Ut,"isObservable",{enumerable:!0,get:a(function(){return NR.isObservable},"get")});var lci=Lai();Object.defineProperty(Ut,"recordChanges",{enumerable:!0,get:a(function(){return lci.recordChanges},"get")});Object.defineProperty(Ut,"recordChangesLazy",{enumerable:!0,get:a(function(){return lci.recordChangesLazy},"get")});var Bia=Bai();Object.defineProperty(Ut,"constObservable",{enumerable:!0,get:a(function(){return Bia.constObservable},"get")});var Fia=V0r();Object.defineProperty(Ut,"observableSignal",{enumerable:!0,get:a(function(){return Fia.observableSignal},"get")});var Uia=kG();Object.defineProperty(Ut,"observableFromEventOpts",{enumerable:!0,get:a(function(){return Uia.observableFromEventOpts},"get")});var Qia=Fai();Object.defineProperty(Ut,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return Qia.observableSignalFromEvent},"get")});var oOe=n6();Object.defineProperty(Ut,"asyncTransaction",{enumerable:!0,get:a(function(){return oOe.asyncTransaction},"get")});Object.defineProperty(Ut,"globalTransaction",{enumerable:!0,get:a(function(){return oOe.globalTransaction},"get")});Object.defineProperty(Ut,"subtransaction",{enumerable:!0,get:a(function(){return oOe.subtransaction},"get")});Object.defineProperty(Ut,"transaction",{enumerable:!0,get:a(function(){return oOe.transaction},"get")});Object.defineProperty(Ut,"TransactionImpl",{enumerable:!0,get:a(function(){return oOe.TransactionImpl},"get")});var uci=Uai();Object.defineProperty(Ut,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return uci.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Ut,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return uci.ValueWithChangeEventFromObservable},"get")});var cAr=jai();Object.defineProperty(Ut,"runOnChange",{enumerable:!0,get:a(function(){return cAr.runOnChange},"get")});Object.defineProperty(Ut,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return cAr.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Ut,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return cAr.runOnChangeWithStore},"get")});var dci=$ai();Object.defineProperty(Ut,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return dci.derivedConstOnceDefined},"get")});Object.defineProperty(Ut,"latestChangedValue",{enumerable:!0,get:a(function(){return dci.latestChangedValue},"get")});var qia=kG();Object.defineProperty(Ut,"observableFromEvent",{enumerable:!0,get:a(function(){return qia.observableFromEvent},"get")});var jia=i6();Object.defineProperty(Ut,"observableValue",{enumerable:!0,get:a(function(){return jia.observableValue},"get")});var Hia=Vai();Object.defineProperty(Ut,"ObservableSet",{enumerable:!0,get:a(function(){return Hia.ObservableSet},"get")});var Gia=Wai();Object.defineProperty(Ut,"ObservableMap",{enumerable:!0,get:a(function(){return Gia.ObservableMap},"get")});var $ia=uI();Object.defineProperty(Ut,"DebugLocation",{enumerable:!0,get:a(function(){return $ia.DebugLocation},"get")});var lAr=F4(),fci=apt(),Via=rci(),aci=BRe(),Wia=_D(),zia=sci();(0,Wia._setDebugGetObservableGraph)(zia.debugGetObservableGraph);(0,lAr.setLogObservableFn)(fci.logObservableToConsole);var Yia=!1;Yia&&(0,lAr.addLogger)(new fci.ConsoleObservableLogger);aci.env&&aci.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,lAr.addLogger)(Via.DevToolsLogger.getInstance())});var Td=I(jge=>{"use strict";p();Object.defineProperty(jge,"__esModule",{value:!0});jge.OffsetRangeSet=jge.OffsetRange=void 0;var dpt=Os(),fpt=class t{static{a(this,"OffsetRange")}static fromTo(e,r){return new t(e,r)}static equals(e,r){return e.start===r.start&&e.endExclusive===r.endExclusive}static addRange(e,r){let n=0;for(;nr))return new t(e,r)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,r){return new t(e,e+r)}static emptyAt(e){return new t(e,e)}constructor(e,r){if(this.start=e,this.endExclusive=r,e>r)throw new dpt.BugIndicatingError(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new dpt.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new dpt.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let r=[];for(let n=this.start;ne.toString()).join(", ")}intersectsStrict(e){let r=0;for(;re+r.length,0)}};jge.OffsetRangeSet=uAr});var vD=I($ge=>{"use strict";p();Object.defineProperty($ge,"__esModule",{value:!0});$ge.LineRangeSet=$ge.LineRange=void 0;var pci=Os(),Kia=Td(),hci=uh(),Hge=dj(),mci=Ml(),Gge=class t{static{a(this,"LineRange")}static ofLength(e,r){return new t(e,e+r)}static fromRange(e){return new t(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new t(e.startLineNumber,e.endLineNumber+1)}static{this.compareByStart=(0,mci.compareBy)(e=>e.startLineNumber,mci.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new pci.BugIndicatingError(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=(0,Hge.findLastIdxMonotonous)(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)this._normalizedRanges.splice(r,0,e);else if(r===n-1){let o=this._normalizedRanges[r];this._normalizedRanges[r]=o.join(e)}else{let o=this._normalizedRanges[r].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(r,n-r,o)}}contains(e){let r=(0,Hge.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,Hge.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let r=[],n=0,o=0,s=null;for(;n=c.startLineNumber?s=new Gge(s.startLineNumber,Math.max(s.endLineNumberExclusive,c.endLineNumberExclusive)):(r.push(s),s=c)}return s!==null&&r.push(s),new t(r)}subtractFrom(e){let r=(0,Hge.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,Hge.findLastIdxMonotonous)(this._normalizedRanges,c=>c.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)return new t([e]);let o=[],s=e.startLineNumber;for(let c=r;cs&&o.push(new Gge(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};$ge.LineRangeSet=sOe});var Vge=I(hpt=>{"use strict";p();Object.defineProperty(hpt,"__esModule",{value:!0});hpt.TextLength=void 0;var Jia=vD(),gci=iv(),ppt=uh(),dAr=class t{static{a(this,"TextLength")}static{this.zero=new t(0,0)}static lengthDiffNonNegative(e,r){return r.isLessThan(e)?t.zero:e.lineCount===r.lineCount?new t(0,r.columnCount-e.columnCount):new t(r.lineCount-e.lineCount,r.columnCount)}static betweenPositions(e,r){return e.lineNumber===r.lineNumber?new t(0,r.column-e.column):new t(r.lineNumber-e.lineNumber,r.column-1)}static fromPosition(e){return new t(e.lineNumber-1,e.column-1)}static ofRange(e){return t.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let r=0,n=0;for(let o of e)o===` -`?(r++,n=0):n++;return new t(r,n)}static ofSubstr(e,r){return t.ofText(r.substring(e))}static sum(e,r){return e.reduce((n,o)=>n.add(r(o)),t.zero)}constructor(e,r){this.lineCount=e,this.columnCount=r}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new t(this.lineCount,this.columnCount+e.columnCount):new t(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new ppt.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new ppt.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new ppt.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return Jia.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new gci.Position(e.lineNumber,e.column+this.columnCount):new gci.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return ppt.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};hpt.TextLength=dAr});var gpt=I(Yee=>{"use strict";p();Object.defineProperty(Yee,"__esModule",{value:!0});Yee.PositionOffsetTransformer=Yee.PositionOffsetTransformerBase=void 0;Yee._setPositionOffsetTransformerDependencies=toa;var Zia=dj(),Xia=Td(),aOe=iv(),eoa=uh(),mpt=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new Xia.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return eoa.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new s6.deps.StringEdit(r)}getStringReplacement(e){return new s6.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new s6.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new s6.deps.TextEdit(r)}};Yee.PositionOffsetTransformerBase=mpt;var s6=class{static{a(this,"Deps")}static{this._deps=void 0}static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}};function toa(t){s6._deps=t}a(toa,"_setPositionOffsetTransformerDependencies");var fAr=class extends mpt{static{a(this,"PositionOffsetTransformer")}constructor(e){super(),this.text=e}get lineStartOffsetByLineIdx(){return this._lineStartOffsetByLineIdx||this._computeLineOffsets(),this._lineStartOffsetByLineIdx}get lineEndOffsetByLineIdx(){return this._lineEndOffsetByLineIdx||this._computeLineOffsets(),this._lineEndOffsetByLineIdx}_computeLineOffsets(){this._lineStartOffsetByLineIdx=[],this._lineEndOffsetByLineIdx=[],this._lineStartOffsetByLineIdx.push(0);for(let e=0;e0&&this.text.charAt(e-1)==="\r"?this._lineEndOffsetByLineIdx.push(e-1):this._lineEndOffsetByLineIdx.push(e));this._lineEndOffsetByLineIdx.push(this.text.length)}getOffset(e){let r=this._validatePosition(e);return this.lineStartOffsetByLineIdx[r.lineNumber-1]+r.column-1}_validatePosition(e){if(e.lineNumber<1)return new aOe.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new aOe.Position(r,o+1)}if(e.column<1)return new aOe.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new aOe.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,Zia.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new aOe.Position(n,o)}getTextLength(e){return s6.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new s6.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};Yee.PositionOffsetTransformer=fAr});var dI=I(H4=>{"use strict";p();Object.defineProperty(H4,"__esModule",{value:!0});H4.StringText=H4.ArrayText=H4.LineBasedText=H4.AbstractText=void 0;var roa=pd(),noa=ym(),ioa=iv(),Aci=uh(),ooa=Vge(),yci=gpt(),cOe=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new ioa.Position(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new Aci.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new yci.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Aci.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,noa.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};H4.AbstractText=cOe;var Apt=class extends cOe{static{a(this,"LineBasedText")}constructor(e,r){(0,roa.assert)(r>=1),super(),this._getLineContent=e,this._lineCount=r}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let r=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let n=e.startLineNumber+1;n{for(let d of l)(0,EMe.checkReportMissingProp)(t,d)}):(r.if((0,kmr._)`${u} && (${(0,EMe.checkMissingProp)(t,l,s)})`),(0,EMe.reportMissingProp)(t,s),r.else())}}a(Cri,"validatePropertyDeps");R4.validatePropertyDeps=Cri;function bri(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,NJs.alwaysValidSchema)(s,e[l])||(r.if((0,EMe.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let u=t.subschema({keyword:o,schemaProp:l},c);t.mergeValidEvaluated(u,c)},()=>r.var(c,!0)),t.ok(c))}a(bri,"validateSchemaDeps");R4.validateSchemaDeps=bri;R4.default=MJs});var Iri=I(Pmr=>{"use strict";p();Object.defineProperty(Pmr,"__esModule",{value:!0});var Tri=Ss(),LJs=oc(),BJs={message:"property name must be valid",params:a(({params:t})=>(0,Tri._)`{propertyName: ${t.propertyName}}`,"params")},FJs={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:BJs,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,LJs.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,c=>{t.setParams({propertyName:c}),t.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},s),e.if((0,Tri.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Pmr.default=FJs});var Nmr=I(Dmr=>{"use strict";p();Object.defineProperty(Dmr,"__esModule",{value:!0});var ydt=SR(),dD=Ss(),UJs=z8(),_dt=oc(),QJs={message:"must NOT have additional properties",params:a(({params:t})=>(0,dD._)`{additionalProperty: ${t.additionalProperty}}`,"params")},qJs={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:QJs,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:c}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:u}=c;if(c.props=!0,u.removeAdditional!=="all"&&(0,_dt.alwaysValidSchema)(c,r))return;let d=(0,ydt.allSchemaProperties)(n.properties),f=(0,ydt.allSchemaProperties)(n.patternProperties);h(),t.ok((0,dD._)`${s} === ${UJs.default.errors}`);function h(){e.forIn("key",o,_=>{!d.length&&!f.length?A(_):e.if(m(_),()=>A(_))})}a(h,"checkAdditionalProperties");function m(_){let E;if(d.length>8){let v=(0,_dt.schemaRefOrVal)(c,n.properties,"properties");E=(0,ydt.isOwnProperty)(e,v,_)}else d.length?E=(0,dD.or)(...d.map(v=>(0,dD._)`${_} === ${v}`)):E=dD.nil;return f.length&&(E=(0,dD.or)(E,...f.map(v=>(0,dD._)`${(0,ydt.usePattern)(t,v)}.test(${_})`))),(0,dD.not)(E)}a(m,"isAdditional");function g(_){e.code((0,dD._)`delete ${o}[${_}]`)}a(g,"deleteAdditional");function A(_){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){g(_);return}if(r===!1){t.setParams({additionalProperty:_}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,_dt.alwaysValidSchema)(c,r)){let E=e.name("valid");u.removeAdditional==="failing"?(y(_,E,!1),e.if((0,dD.not)(E),()=>{t.reset(),g(_)})):(y(_,E),l||e.if((0,dD.not)(E),()=>e.break()))}}a(A,"additionalPropertyCode");function y(_,E,v){let S={keyword:"additionalProperties",dataProp:_,dataPropType:_dt.Type.Str};v===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(S,E)}a(y,"applyAdditionalSchema")}};Dmr.default=qJs});var Rri=I(Omr=>{"use strict";p();Object.defineProperty(Omr,"__esModule",{value:!0});var jJs=sMe(),xri=SR(),Mmr=oc(),wri=Nmr(),HJs={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&wri.default.code(new jJs.KeywordCxt(s,wri.default,"additionalProperties"));let c=(0,xri.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=Mmr.mergeEvaluated.props(e,(0,Mmr.toHash)(c),s.props));let l=c.filter(h=>!(0,Mmr.alwaysValidSchema)(s,r[h]));if(l.length===0)return;let u=e.name("valid");for(let h of l)d(h)?f(h):(e.if((0,xri.propertyInData)(e,o,h,s.opts.ownProperties)),f(h),s.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(u);function d(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}a(d,"hasDefault");function f(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}a(f,"applyPropertySchema")}};Omr.default=HJs});var Nri=I(Lmr=>{"use strict";p();Object.defineProperty(Lmr,"__esModule",{value:!0});var kri=SR(),Edt=Ss(),Pri=oc(),Dri=oc(),GJs={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:c}=s,l=(0,kri.allSchemaProperties)(r),u=l.filter(y=>(0,Pri.alwaysValidSchema)(s,r[y]));if(l.length===0||u.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=c.strictSchema&&!c.allowMatchingProperties&&o.properties,f=e.name("valid");s.props!==!0&&!(s.props instanceof Edt.Name)&&(s.props=(0,Dri.evaluatedPropsToName)(e,s.props));let{props:h}=s;m();function m(){for(let y of l)d&&g(y),s.allErrors?A(y):(e.var(f,!0),A(y),e.if(f))}a(m,"validatePatternProperties");function g(y){for(let _ in d)new RegExp(y).test(_)&&(0,Pri.checkStrictMode)(s,`property ${_} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,_=>{e.if((0,Edt._)`${(0,kri.usePattern)(t,y)}.test(${_})`,()=>{let E=u.includes(y);E||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:_,dataPropType:Dri.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,Edt._)`${h}[${_}]`,!0):!E&&!s.allErrors&&e.if((0,Edt.not)(f),()=>e.break())})})}a(A,"validateProperties")}};Lmr.default=GJs});var Mri=I(Bmr=>{"use strict";p();Object.defineProperty(Bmr,"__esModule",{value:!0});var $Js=oc(),VJs={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,$Js.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Bmr.default=VJs});var Ori=I(Fmr=>{"use strict";p();Object.defineProperty(Fmr,"__esModule",{value:!0});var WJs=SR(),zJs={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:WJs.validateUnion,error:{message:"must match a schema in anyOf"}};Fmr.default=zJs});var Lri=I(Umr=>{"use strict";p();Object.defineProperty(Umr,"__esModule",{value:!0});var vdt=Ss(),YJs=oc(),KJs={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,vdt._)`{passingSchemas: ${t.passing}}`,"params")},JJs={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:KJs,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,c=e.let("valid",!1),l=e.let("passing",null),u=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(c,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((f,h)=>{let m;(0,YJs.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,vdt._)`${u} && ${c}`).assign(c,!1).assign(l,(0,vdt._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,vdt.Name)})})}a(d,"validateOneOf")}};Umr.default=JJs});var Bri=I(Qmr=>{"use strict";p();Object.defineProperty(Qmr,"__esModule",{value:!0});var ZJs=oc(),XJs={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,c)=>{if((0,ZJs.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};Qmr.default=XJs});var Qri=I(qmr=>{"use strict";p();Object.defineProperty(qmr,"__esModule",{value:!0});var Cdt=Ss(),Uri=oc(),eZs={message:a(({params:t})=>(0,Cdt.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,Cdt._)`{failingKeyword: ${t.ifClause}}`,"params")},tZs={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:eZs,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Uri.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=Fri(n,"then"),s=Fri(n,"else");if(!o&&!s)return;let c=e.let("valid",!0),l=e.name("_valid");if(u(),t.reset(),o&&s){let f=e.let("ifClause");t.setParams({ifClause:f}),e.if(l,d("then",f),d("else",f))}else o?e.if(l,d("then")):e.if((0,Cdt.not)(l),d("else"));t.pass(c,()=>t.error(!0));function u(){let f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(f)}a(u,"validateIf");function d(f,h){return()=>{let m=t.subschema({keyword:f},l);e.assign(c,l),t.mergeValidEvaluated(m,c),h?e.assign(h,(0,Cdt._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function Fri(t,e){let r=t.schema[e];return r!==void 0&&!(0,Uri.alwaysValidSchema)(t,r)}a(Fri,"hasSchema");qmr.default=tZs});var qri=I(jmr=>{"use strict";p();Object.defineProperty(jmr,"__esModule",{value:!0});var rZs=oc(),nZs={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,rZs.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};jmr.default=nZs});var jri=I(Hmr=>{"use strict";p();Object.defineProperty(Hmr,"__esModule",{value:!0});var iZs=Tmr(),oZs=yri(),sZs=Imr(),aZs=Eri(),cZs=vri(),lZs=Sri(),uZs=Iri(),dZs=Nmr(),fZs=Rri(),pZs=Nri(),hZs=Mri(),mZs=Ori(),gZs=Lri(),AZs=Bri(),yZs=Qri(),_Zs=qri();function EZs(t=!1){let e=[hZs.default,mZs.default,gZs.default,AZs.default,yZs.default,_Zs.default,uZs.default,dZs.default,lZs.default,fZs.default,pZs.default];return t?e.push(oZs.default,aZs.default):e.push(iZs.default,sZs.default),e.push(cZs.default),e}a(EZs,"getApplicator");Hmr.default=EZs});var Hri=I(Gmr=>{"use strict";p();Object.defineProperty(Gmr,"__esModule",{value:!0});var vh=Ss(),vZs={message:a(({schemaCode:t})=>(0,vh.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,vh._)`{format: ${t}}`,"params")},CZs={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:vZs,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:c,it:l}=t,{opts:u,errSchemaPath:d,schemaEnv:f,self:h}=l;if(!u.validateFormats)return;o?m():g();function m(){let A=r.scopeValue("formats",{ref:h.formats,code:u.code.formats}),y=r.const("fDef",(0,vh._)`${A}[${c}]`),_=r.let("fType"),E=r.let("format");r.if((0,vh._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(_,(0,vh._)`${y}.type || "string"`).assign(E,(0,vh._)`${y}.validate`),()=>r.assign(_,(0,vh._)`"string"`).assign(E,y)),t.fail$data((0,vh.or)(v(),S()));function v(){return u.strictSchema===!1?vh.nil:(0,vh._)`${c} && !${E}`}a(v,"unknownFmt");function S(){let T=f.$async?(0,vh._)`(${y}.async ? await ${E}(${n}) : ${E}(${n}))`:(0,vh._)`${E}(${n})`,w=(0,vh._)`(typeof ${E} == "function" ? ${T} : ${E}.test(${n}))`;return(0,vh._)`${E} && ${E} !== true && ${_} === ${e} && !${w}`}a(S,"invalidFmt")}a(m,"validate$DataFormat");function g(){let A=h.formats[s];if(!A){v();return}if(A===!0)return;let[y,_,E]=S(A);y===e&&t.pass(T());function v(){if(u.strictSchema===!1){h.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${s}" ignored in schema at path "${d}"`}}a(v,"unknownFormat");function S(w){let R=w instanceof RegExp?(0,vh.regexpCode)(w):u.code.formats?(0,vh._)`${u.code.formats}${(0,vh.getProperty)(s)}`:void 0,x=r.scopeValue("formats",{key:s,ref:w,code:R});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,vh._)`${x}.validate`]:["string",w,x]}a(S,"getFormat");function T(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!f.$async)throw new Error("async format in sync schema");return(0,vh._)`await ${E}(${n})`}return typeof _=="function"?(0,vh._)`${E}(${n})`:(0,vh._)`${E}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};Gmr.default=CZs});var Gri=I($mr=>{"use strict";p();Object.defineProperty($mr,"__esModule",{value:!0});var bZs=Hri(),SZs=[bZs.default];$mr.default=SZs});var $ri=I(Gme=>{"use strict";p();Object.defineProperty(Gme,"__esModule",{value:!0});Gme.contentVocabulary=Gme.metadataVocabulary=void 0;Gme.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Gme.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Wri=I(Vmr=>{"use strict";p();Object.defineProperty(Vmr,"__esModule",{value:!0});var TZs=eri(),IZs=hri(),xZs=jri(),wZs=Gri(),Vri=$ri(),RZs=[TZs.default,IZs.default,(0,xZs.default)(),wZs.default,Vri.metadataVocabulary,Vri.contentVocabulary];Vmr.default=RZs});var Yri=I(bdt=>{"use strict";p();Object.defineProperty(bdt,"__esModule",{value:!0});bdt.DiscrError=void 0;var zri;(function(t){t.Tag="tag",t.Mapping="mapping"})(zri||(bdt.DiscrError=zri={}))});var Jri=I(zmr=>{"use strict";p();Object.defineProperty(zmr,"__esModule",{value:!0});var $me=Ss(),Wmr=Yri(),Kri=sdt(),kZs=aMe(),PZs=oc(),DZs={message:a(({params:{discrError:t,tagName:e}})=>t===Wmr.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,"message"),params:a(({params:{discrError:t,tag:e,tagName:r}})=>(0,$me._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},NZs={keyword:"discriminator",type:"object",schemaType:"object",error:DZs,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:c}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),d=e.const("tag",(0,$me._)`${r}${(0,$me.getProperty)(l)}`);e.if((0,$me._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:Wmr.DiscrError.Tag,tag:d,tagName:l})),t.ok(u);function f(){let g=m();e.if(!1);for(let A in g)e.elseIf((0,$me._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:Wmr.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}a(f,"validateMapping");function h(g){let A=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:g},A);return t.mergeEvaluated(y,$me.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=E(o),_=!0;for(let T=0;T{MZs.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Kmr=I((Sd,Ymr)=>{"use strict";p();Object.defineProperty(Sd,"__esModule",{value:!0});Sd.MissingRefError=Sd.ValidationError=Sd.CodeGen=Sd.Name=Sd.nil=Sd.stringify=Sd.str=Sd._=Sd.KeywordCxt=Sd.Ajv=void 0;var OZs=zti(),LZs=Wri(),BZs=Jri(),Xri=Zri(),FZs=["/properties"],Sdt="http://json-schema.org/draft-07/schema",Vme=class extends OZs.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),LZs.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(BZs.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Xri,FZs):Xri;this.addMetaSchema(e,Sdt,!1),this.refs["http://json-schema.org/schema"]=Sdt}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Sdt)?Sdt:void 0)}};Sd.Ajv=Vme;Ymr.exports=Sd=Vme;Ymr.exports.Ajv=Vme;Object.defineProperty(Sd,"__esModule",{value:!0});Sd.default=Vme;var UZs=sMe();Object.defineProperty(Sd,"KeywordCxt",{enumerable:!0,get:a(function(){return UZs.KeywordCxt},"get")});var Wme=Ss();Object.defineProperty(Sd,"_",{enumerable:!0,get:a(function(){return Wme._},"get")});Object.defineProperty(Sd,"str",{enumerable:!0,get:a(function(){return Wme.str},"get")});Object.defineProperty(Sd,"stringify",{enumerable:!0,get:a(function(){return Wme.stringify},"get")});Object.defineProperty(Sd,"nil",{enumerable:!0,get:a(function(){return Wme.nil},"get")});Object.defineProperty(Sd,"Name",{enumerable:!0,get:a(function(){return Wme.Name},"get")});Object.defineProperty(Sd,"CodeGen",{enumerable:!0,get:a(function(){return Wme.CodeGen},"get")});var QZs=idt();Object.defineProperty(Sd,"ValidationError",{enumerable:!0,get:a(function(){return QZs.default},"get")});var qZs=aMe();Object.defineProperty(Sd,"MissingRefError",{enumerable:!0,get:a(function(){return qZs.default},"get")})});var ani=I(P4=>{"use strict";p();Object.defineProperty(P4,"__esModule",{value:!0});P4.formatNames=P4.fastFormats=P4.fullFormats=void 0;function k4(t,e){return{validate:t,compare:e}}a(k4,"fmtDef");P4.fullFormats={date:k4(nni,egr),time:k4(Zmr(!0),tgr),"date-time":k4(eni(!0),oni),"iso-time":k4(Zmr(),ini),"iso-date-time":k4(eni(),sni),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:WZs,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:eXs,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:zZs,int32:{type:"number",validate:JZs},int64:{type:"number",validate:ZZs},float:{type:"number",validate:rni},double:{type:"number",validate:rni},password:!0,binary:!0};P4.fastFormats={...P4.fullFormats,date:k4(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,egr),time:k4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,tgr),"date-time":k4(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,oni),"iso-time":k4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ini),"iso-date-time":k4(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,sni),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};P4.formatNames=Object.keys(P4.fullFormats);function jZs(t){return t%4===0&&(t%100!==0||t%400===0)}a(jZs,"isLeapYear");var HZs=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,GZs=[0,31,28,31,30,31,30,31,31,30,31,30,31];function nni(t){let e=HZs.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&jZs(r)?29:GZs[n])}a(nni,"date");function egr(t,e){if(t&&e)return t>e?1:t23||f>59||t&&!l)return!1;if(o<=23&&s<=59&&c<60)return!0;let h=s-f*u,m=o-d*u-(h<0?1:0);return(m===23||m===-1)&&(h===59||h===-1)&&c<61},"time")}a(Zmr,"getTime");function tgr(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}a(tgr,"compareTime");function ini(t,e){if(!(t&&e))return;let r=Jmr.exec(t),n=Jmr.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=YZs}a(JZs,"validateInt32");function ZZs(t){return Number.isInteger(t)}a(ZZs,"validateInt64");function rni(){return!0}a(rni,"validateNumber");var XZs=/[^\\]\\Z/;function eXs(t){if(XZs.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(eXs,"regex")});var cni=I(zme=>{"use strict";p();Object.defineProperty(zme,"__esModule",{value:!0});zme.formatLimitDefinition=void 0;var tXs=Kmr(),fD=Ss(),yG=fD.operators,Tdt={formatMaximum:{okStr:"<=",ok:yG.LTE,fail:yG.GT},formatMinimum:{okStr:">=",ok:yG.GTE,fail:yG.LT},formatExclusiveMaximum:{okStr:"<",ok:yG.LT,fail:yG.GTE},formatExclusiveMinimum:{okStr:">",ok:yG.GT,fail:yG.LTE}},rXs={message:a(({keyword:t,schemaCode:e})=>(0,fD.str)`should be ${Tdt[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,fD._)`{comparison: ${Tdt[t].okStr}, limit: ${e}}`,"params")};zme.formatLimitDefinition={keyword:Object.keys(Tdt),type:"string",schemaType:"string",$data:!0,error:rXs,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:c,self:l}=s;if(!c.validateFormats)return;let u=new tXs.KeywordCxt(s,l.RULES.all.format.definition,"format");u.$data?d():f();function d(){let m=e.scopeValue("formats",{ref:l.formats,code:c.code.formats}),g=e.const("fmt",(0,fD._)`${m}[${u.schemaCode}]`);t.fail$data((0,fD.or)((0,fD._)`typeof ${g} != "object"`,(0,fD._)`${g} instanceof RegExp`,(0,fD._)`typeof ${g}.compare != "function"`,h(g)))}a(d,"validate$DataFormat");function f(){let m=u.schema,g=l.formats[m];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${o}": format "${m}" does not define "compare" function`);let A=e.scopeValue("formats",{key:m,ref:g,code:c.code.formats?(0,fD._)`${c.code.formats}${(0,fD.getProperty)(m)}`:void 0});t.fail$data(h(A))}a(f,"validateFormat");function h(m){return(0,fD._)`${m}.compare(${r}, ${n}) ${Tdt[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var nXs=a(t=>(t.addKeyword(zme.formatLimitDefinition),t),"formatLimitPlugin");zme.default=nXs});var fni=I((vMe,dni)=>{"use strict";p();Object.defineProperty(vMe,"__esModule",{value:!0});var Yme=ani(),iXs=cni(),rgr=Ss(),lni=new rgr.Name("fullFormats"),oXs=new rgr.Name("fastFormats"),ngr=a((t,e={keywords:!0})=>{if(Array.isArray(e))return uni(t,e,Yme.fullFormats,lni),t;let[r,n]=e.mode==="fast"?[Yme.fastFormats,oXs]:[Yme.fullFormats,lni],o=e.formats||Yme.formatNames;return uni(t,o,r,n),e.keywords&&(0,iXs.default)(t),t},"formatsPlugin");ngr.get=(t,e="full")=>{let n=(e==="fast"?Yme.fastFormats:Yme.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function uni(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,rgr._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a(uni,"addFormats");dni.exports=vMe=ngr;Object.defineProperty(vMe,"__esModule",{value:!0});vMe.default=ngr});var Gni=I((w3f,Hni)=>{p();Hni.exports=jni;jni.sync=IXs;var Qni=require("fs");function TXs(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{p();zni.exports=Vni;Vni.sync=xXs;var $ni=require("fs");function Vni(t,e,r){$ni.stat(t,function(n,o){r(n,n?!1:Wni(o,e))})}a(Vni,"isexe");function xXs(t,e){return Wni($ni.statSync(t),e)}a(xXs,"sync");function Wni(t,e){return t.isFile()&&wXs(t,e)}a(Wni,"checkStat");function wXs(t,e){var r=t.mode,n=t.uid,o=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),c=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),l=parseInt("100",8),u=parseInt("010",8),d=parseInt("001",8),f=l|u,h=r&d||r&u&&o===c||r&l&&n===s||r&f&&s===0;return h}a(wXs,"checkMode")});var Jni=I((O3f,Kni)=>{p();var M3f=require("fs"),qdt;process.platform==="win32"||global.TESTING_WINDOWS?qdt=Gni():qdt=Yni();Kni.exports=Egr;Egr.sync=RXs;function Egr(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){Egr(t,e||{},function(s,c){s?o(s):n(c)})})}qdt(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(Egr,"isexe");function RXs(t,e){try{return qdt.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(RXs,"sync")});var iii=I((F3f,nii)=>{p();var age=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Zni=require("path"),kXs=age?";":":",Xni=Jni(),eii=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),tii=a((t,e)=>{let r=e.colon||kXs,n=t.match(/\//)||age&&t.match(/\\/)?[""]:[...age?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=age?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=age?o.split(r):[""];return age&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),rii=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=tii(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(eii(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=Zni.join(g,t),y=!g&&/^\.[\\\/]/.test(t)?t.slice(0,2)+A:A;f(u(y,d,0))}),"step"),u=a((d,f,h)=>new Promise((m,g)=>{if(h===o.length)return m(l(f+1));let A=o[h];Xni(d+A,{pathExt:s},(y,_)=>{if(!y&&_)if(e.all)c.push(d+A);else return m(d+A);return m(u(d,f,h+1))})}),"subStep");return r?l(0).then(d=>r(null,d),r):l(0)},"which"),PXs=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=tii(t,e),s=[];for(let c=0;c{"use strict";p();var oii=a((t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");vgr.exports=oii;vgr.exports.default=oii});var uii=I((G3f,lii)=>{"use strict";p();var aii=require("path"),DXs=iii(),NXs=sii();function cii(t,e){let r=t.options.env||process.env,n=process.cwd(),o=t.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let c;try{c=DXs.sync(t.command,{path:r[NXs({env:r})],pathExt:e?aii.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=aii.resolve(o?t.options.cwd:"",c)),c}a(cii,"resolveCommandAttempt");function MXs(t){return cii(t)||cii(t,!0)}a(MXs,"resolveCommand");lii.exports=MXs});var dii=I((W3f,bgr)=>{"use strict";p();var Cgr=/([()\][%!^"`<>&|;, *?])/g;function OXs(t){return t=t.replace(Cgr,"^$1"),t}a(OXs,"escapeCommand");function LXs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Cgr,"^$1"),e&&(t=t.replace(Cgr,"^$1")),t}a(LXs,"escapeArgument");bgr.exports.command=OXs;bgr.exports.argument=LXs});var pii=I((K3f,fii)=>{"use strict";p();fii.exports=/^#!(.*)/});var mii=I((Z3f,hii)=>{"use strict";p();var BXs=pii();hii.exports=(t="")=>{let e=t.match(BXs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Aii=I((eFf,gii)=>{"use strict";p();var Sgr=require("fs"),FXs=mii();function UXs(t){let r=Buffer.alloc(150),n;try{n=Sgr.openSync(t,"r"),Sgr.readSync(n,r,0,150,0),Sgr.closeSync(n)}catch{}return FXs(r.toString())}a(UXs,"readShebang");gii.exports=UXs});var vii=I((nFf,Eii)=>{"use strict";p();var QXs=require("path"),yii=uii(),_ii=dii(),qXs=Aii(),jXs=process.platform==="win32",HXs=/\.(?:com|exe)$/i,GXs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function $Xs(t){t.file=yii(t);let e=t.file&&qXs(t.file);return e?(t.args.unshift(t.file),t.command=e,yii(t)):t.file}a($Xs,"detectShebang");function VXs(t){if(!jXs)return t;let e=$Xs(t),r=!HXs.test(e);if(t.options.forceShell||r){let n=GXs.test(e);t.command=QXs.normalize(t.command),t.command=_ii.command(t.command),t.args=t.args.map(s=>_ii.argument(s,n));let o=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${o}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}a(VXs,"parseNonShell");function WXs(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:VXs(n)}a(WXs,"parse");Eii.exports=WXs});var Sii=I((sFf,bii)=>{"use strict";p();var Tgr=process.platform==="win32";function Igr(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}a(Igr,"notFoundError");function zXs(t,e){if(!Tgr)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=Cii(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(zXs,"hookChildProcess");function Cii(t,e){return Tgr&&t===1&&!e.file?Igr(e.original,"spawn"):null}a(Cii,"verifyENOENT");function YXs(t,e){return Tgr&&t===1&&!e.file?Igr(e.original,"spawnSync"):null}a(YXs,"verifyENOENTSync");bii.exports={hookChildProcess:zXs,verifyENOENT:Cii,verifyENOENTSync:YXs,notFoundError:Igr}});var xii=I((lFf,cge)=>{"use strict";p();var Tii=require("child_process"),xgr=vii(),wgr=Sii();function Iii(t,e,r){let n=xgr(t,e,r),o=Tii.spawn(n.command,n.args,n.options);return wgr.hookChildProcess(o,n),o}a(Iii,"spawn");function KXs(t,e,r){let n=xgr(t,e,r),o=Tii.spawnSync(n.command,n.args,n.options);return o.error=o.error||wgr.verifyENOENTSync(o.status,n),o}a(KXs,"spawnSync");cge.exports=Iii;cge.exports.spawn=Iii;cge.exports.sync=KXs;cge.exports._parse=xgr;cge.exports._enoent=wgr});var lI=I(Qee=>{"use strict";p();Object.defineProperty(Qee,"__esModule",{value:!0});Qee.DebugNameData=void 0;Qee.getDebugName=Gsi;Qee.getClassName=$si;Qee.getFunctionName=Vsi;var E0r=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return Gsi(e,this)}};Qee.DebugNameData=E0r;var qsi=new Map,v0r=new WeakMap;function Gsi(t,e){let r=v0r.get(t);if(r)return r;let n=vra(t,e);if(n){let o=qsi.get(n)??0;o++,qsi.set(n,o);let s=o===1?n:`${n}#${o}`;return v0r.set(t,s),s}}a(Gsi,"getDebugName");function vra(t,e){let r=v0r.get(t);if(r)return r;let n=e.owner?bra(e.owner)+".":"",o,s=e.debugNameSource;if(s!==void 0)if(typeof s=="function"){if(o=s(),o!==void 0)return n+o}else return n+s;let c=e.referenceFn;if(c!==void 0&&(o=Vsi(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=Cra(e.owner,t);if(l!==void 0)return n+l}}a(vra,"computeDebugName");function Cra(t,e){for(let r in t)if(t[r]===e)return r}a(Cra,"findKey");var jsi=new Map,Hsi=new WeakMap;function bra(t){let e=Hsi.get(t);if(e)return e;let r=$si(t)??"Object",n=jsi.get(r)??0;n++,jsi.set(r,n);let o=n===1?r:`${r}#${n}`;return Hsi.set(t,o),o}a(bra,"formatOwner");function $si(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a($si,"getClassName");function Vsi(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(Vsi,"getFunctionName")});var oai=I(Rp=>{"use strict";p();var Sra=Rp&&Rp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Tra=Rp&&Rp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Ira=Rp&&Rp.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot===e}a(Ksi,"strictEqualsC");function Jsi(t,e,r){return Ysi.equals(t,e,r??Mft)}a(Jsi,"arrayEquals");function Zsi(t){return(e,r)=>Ysi.equals(e,r,t??Mft)}a(Zsi,"arrayEqualsC");function zMe(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;rzMe(t,e)}a(Xsi,"structuralEqualsC");function xra(t){return JSON.stringify(C0r(t))}a(xra,"getStructuralKey");var wra=0,Wsi=new WeakMap;function C0r(t){if(Array.isArray(t))return t.map(C0r);if(t&&typeof t=="object")if(Object.getPrototypeOf(t)===Object.prototype){let e=t,r=Object.create(null);for(let n of Object.keys(e).sort())r[n]=C0r(e[n]);return r}else{let e=Wsi.get(t);return e===void 0&&(e=wra++,Wsi.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(C0r,"toNormalizedJsonStructure");function eai(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(eai,"jsonStringifyEquals");function tai(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(tai,"jsonStringifyEqualsC");function rai(){return(t,e)=>t.equals(e)}a(rai,"thisEqualsC");function nai(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(nai,"equalsIfDefined");function iai(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(iai,"equalsIfDefinedC");var zsi;(function(t){t.strict=Mft,t.strictC=Ksi,t.array=Jsi,t.arrayC=Zsi,t.structural=zMe,t.structuralC=Xsi,t.jsonStringify=eai,t.jsonStringifyC=tai,t.thisC=rai,t.ifDefined=nai,t.ifDefinedC=iai})(zsi||(Rp.equals=zsi={}))});var Ov=I(kp=>{"use strict";p();Object.defineProperty(kp,"__esModule",{value:!0});kp.trackDisposable=kp.toDisposable=kp.markAsDisposed=kp.DisposableStore=kp.Event=kp.onUnexpectedError=kp.onBugIndicatingError=kp.BugIndicatingError=kp.strictEquals=kp.assertFn=void 0;var Rra=pd();Object.defineProperty(kp,"assertFn",{enumerable:!0,get:a(function(){return Rra.assertFn},"get")});var kra=oai();Object.defineProperty(kp,"strictEquals",{enumerable:!0,get:a(function(){return kra.strictEquals},"get")});var b0r=Os();Object.defineProperty(kp,"BugIndicatingError",{enumerable:!0,get:a(function(){return b0r.BugIndicatingError},"get")});Object.defineProperty(kp,"onBugIndicatingError",{enumerable:!0,get:a(function(){return b0r.onBugIndicatingError},"get")});Object.defineProperty(kp,"onUnexpectedError",{enumerable:!0,get:a(function(){return b0r.onUnexpectedError},"get")});var Pra=Fc();Object.defineProperty(kp,"Event",{enumerable:!0,get:a(function(){return Pra.Event},"get")});var Oft=Po();Object.defineProperty(kp,"DisposableStore",{enumerable:!0,get:a(function(){return Oft.DisposableStore},"get")});Object.defineProperty(kp,"markAsDisposed",{enumerable:!0,get:a(function(){return Oft.markAsDisposed},"get")});Object.defineProperty(kp,"toDisposable",{enumerable:!0,get:a(function(){return Oft.toDisposable},"get")});Object.defineProperty(kp,"trackDisposable",{enumerable:!0,get:a(function(){return Oft.trackDisposable},"get")})});var sai=I(S0r=>{"use strict";p();Object.defineProperty(S0r,"__esModule",{value:!0});S0r.handleBugIndicatingErrorRecovery=Nra;var Dra=Ov();function Nra(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,Dra.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(Nra,"handleBugIndicatingErrorRecovery")});var F4=I(Rge=>{"use strict";p();Object.defineProperty(Rge,"__esModule",{value:!0});Rge.addLogger=Mra;Rge.getLogger=Ora;Rge.setLogObservableFn=Lra;Rge.logObservable=Bra;var qee;function Mra(t){qee?qee instanceof Lft?qee.loggers.push(t):qee=new Lft([qee,t]):qee=t}a(Mra,"addLogger");function Ora(){return qee}a(Ora,"getLogger");var T0r;function Lra(t){T0r=t}a(Lra,"setLogObservableFn");function Bra(t){T0r&&T0r(t)}a(Bra,"logObservable");var Lft=class{static{a(this,"ComposedLogger")}constructor(e){this.loggers=e}handleObservableCreated(e,r){for(let n of this.loggers)n.handleObservableCreated(e,r)}handleOnListenerCountChanged(e,r){for(let n of this.loggers)n.handleOnListenerCountChanged(e,r)}handleObservableUpdated(e,r){for(let n of this.loggers)n.handleObservableUpdated(e,r)}handleAutorunCreated(e,r){for(let n of this.loggers)n.handleAutorunCreated(e,r)}handleAutorunDisposed(e){for(let r of this.loggers)r.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,r,n){for(let o of this.loggers)o.handleAutorunDependencyChanged(e,r,n)}handleAutorunStarted(e){for(let r of this.loggers)r.handleAutorunStarted(e)}handleAutorunFinished(e){for(let r of this.loggers)r.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,r,n){for(let o of this.loggers)o.handleDerivedDependencyChanged(e,r,n)}handleDerivedCleared(e){for(let r of this.loggers)r.handleDerivedCleared(e)}handleBeginTransaction(e){for(let r of this.loggers)r.handleBeginTransaction(e)}handleEndTransaction(e){for(let r of this.loggers)r.handleEndTransaction(e)}}});var n6=I(wG=>{"use strict";p();Object.defineProperty(wG,"__esModule",{value:!0});wG.TransactionImpl=void 0;wG.transaction=I0r;wG.globalTransaction=Ura;wG.asyncTransaction=Qra;wG.subtransaction=qra;var aai=sai(),Fra=lI(),cai=F4();function I0r(t,e){let r=new kge(t,e);try{t(r)}finally{r.finish()}}a(I0r,"transaction");var Bft;function Ura(t){if(Bft)t(Bft);else{let e=new kge(t,void 0);Bft=e;try{t(e)}finally{e.finish(),Bft=void 0}}}a(Ura,"globalTransaction");async function Qra(t,e){let r=new kge(t,e);try{await t(r)}finally{r.finish()}}a(Qra,"asyncTransaction");function qra(t,e,r){t?e(t):I0r(e,r)}a(qra,"subtransaction");var kge=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,cai.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,Fra.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,aai.handleBugIndicatingErrorRecovery)("Transaction already finished!"),I0r(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,aai.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(Fft,"__esModule",{value:!0});Fft.DebugLocation=void 0;var lai;(function(t){let e=!1;function r(){e=!0}a(r,"enable"),t.enable=r;function n(){if(!e)return;let o=Error,s=o.stackTraceLimit;o.stackTraceLimit=3;let c=new Error().stack;return o.stackTraceLimit=s,x0r.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(lai||(Fft.DebugLocation=lai={}));var x0r=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` +`),o=jra(n[r+1]);if(o)return new t(o.fileName,o.line,o.column,o.id)}constructor(e,r,n,o){this.fileName=e,this.line=r,this.column=n,this.id=o}};function jra(t){let e=t.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:t};let r=t.match(/at ([^\(\)]*):(\d+):(\d+)/);if(r)return{fileName:r[1],line:parseInt(r[2]),column:parseInt(r[3]),id:t}}a(jra,"parseLine")});var _D=I(U4=>{"use strict";p();Object.defineProperty(U4,"__esModule",{value:!0});U4.BaseObservable=U4.ConvenientObservable=void 0;U4._setDerivedOpts=Gra;U4._setRecomputeInitiallyAndOnChange=$ra;U4._setKeepObserved=Vra;U4._setDebugGetObservableGraph=Wra;var uai=uI(),Hra=lI(),Pge=F4(),w0r;function Gra(t){w0r=t}a(Gra,"_setDerivedOpts");var dai;function $ra(t){dai=t}a($ra,"_setRecomputeInitiallyAndOnChange");var fai;function Vra(t){fai=t}a(Vra,"_setKeepObserved");var R0r;function Wra(t){R0r=t}a(Wra,"_setDebugGetObservableGraph");var Uft=class{static{a(this,"ConvenientObservable")}get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,r,n=uai.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return w0r({owner:o,debugName:a(()=>{let c=(0,Hra.getFunctionName)(s);if(c!==void 0)return c;let u=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(u)return`${this.debugName}.${u[2]}`;if(!o)return`${this.debugName} (mapped)`},"debugName"),debugReferenceFn:s},c=>s(this.read(c),c),n)}flatten(){return w0r({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(dai(this,r)),this}keepObserved(e){return e.add(fai(this)),this}get debugValue(){return this.get()}get debug(){return new k0r(this)}};U4.ConvenientObservable=Uft;var k0r=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return R0r(this.observable,{type:"dependencies"})}getObserverGraph(){return R0r(this.observable,{type:"observers"})}},P0r=class extends Uft{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,Pge.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,Pge.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,Pge.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,Pge.getLogger)();return(0,Pge.logObservable)(this),e||(0,Pge.getLogger)()?.handleObservableCreated(this,uai.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};U4.BaseObservable=P0r});var i6=I(RG=>{"use strict";p();Object.defineProperty(RG,"__esModule",{value:!0});RG.DisposableObservableValue=RG.ObservableValue=void 0;RG.observableValue=Kra;RG.disposableObservableValue=Jra;var zra=n6(),Yra=_D(),hai=Ov(),Qft=lI(),pai=F4(),mai=uI();function Kra(t,e,r=mai.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Qft.DebugNameData(void 0,t,void 0):n=new Qft.DebugNameData(t,void 0,void 0),new YMe(n,e,hai.strictEquals,r)}a(Kra,"observableValue");var YMe=class extends Yra.BaseObservable{static{a(this,"ObservableValue")}get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,r,n,o){super(o),this._debugNameData=e,this._equalityComparator=n,this._value=r,(0,pai.getLogger)()?.handleObservableUpdated(this,{hadValue:!1,newValue:r,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,r,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let o;r||(r=o=new zra.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),(0,pai.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(let c of this._observers)r.updateObserver(c,this),c.handleChange(this,n)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}};RG.ObservableValue=YMe;function Jra(t,e,r=mai.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Qft.DebugNameData(void 0,t,void 0):n=new Qft.DebugNameData(t,void 0,void 0),new qft(n,e,hai.strictEquals,r)}a(Jra,"disposableObservableValue");var qft=class extends YMe{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};RG.DisposableObservableValue=qft});var Aai=I(jft=>{"use strict";p();Object.defineProperty(jft,"__esModule",{value:!0});jft.LazyObservableValue=void 0;var Zra=n6(),gai=F4(),Xra=_D(),D0r=class extends Xra.BaseObservable{static{a(this,"LazyObservableValue")}get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,r,n,o){super(o),this._debugNameData=e,this._equalityComparator=n,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=r}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(let e of this._deltas){(0,gai.getLogger)()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let r of this._observers)r.handleChange(this,e)}this._deltas.length=0}else{(0,gai.getLogger)()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(let e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();let e=[...this._observers];for(let r of e)r.endUpdate(this)}}addObserver(e){let r=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),r&&e.beginUpdate(this)}removeObserver(e){let r=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),r&&e.endUpdate(this)}set(e,r,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let o;r||(r=o=new Zra.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),n!==void 0&&this._deltas.push(n),r.updateObserver({beginUpdate:a(()=>this._beginUpdate(),"beginUpdate"),endUpdate:a(()=>this._endUpdate(),"endUpdate"),handleChange:a((s,c)=>{},"handleChange"),handlePossibleChange:a(s=>{},"handlePossibleChange")},this),this._updateCounter>1)for(let s of this._observers)s.handlePossibleChange(this)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}};jft.LazyObservableValue=D0r});var Hft=I(N0r=>{"use strict";p();Object.defineProperty(N0r,"__esModule",{value:!0});N0r.observableValueOpts=nna;var yai=lI(),_ai=Ov(),ena=i6(),tna=Aai(),rna=uI();function nna(t,e,r=rna.DebugLocation.ofCaller()){return t.lazy?new tna.LazyObservableValue(new yai.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??_ai.strictEquals,r):new ena.ObservableValue(new yai.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??_ai.strictEquals,r)}a(nna,"observableValueOpts")});var $ft=I(Gft=>{"use strict";p();Object.defineProperty(Gft,"__esModule",{value:!0});Gft.AutorunObserver=void 0;var RR=Ov(),KMe=F4();function ina(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(ina,"autorunStateToString");var M0r=class{static{a(this,"AutorunObserver")}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,r,n,o){this._debugNameData=e,this._runFn=r,this._changeTracker=n,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._iteration=0,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),(0,KMe.getLogger)()?.handleAutorunCreated(this,o),this._run(),(0,RR.trackDisposable)(this)}dispose(){if(!this._disposed){this._disposed=!0;for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),(0,KMe.getLogger)()?.handleAutorunDisposed(this),(0,RR.markAsDisposed)(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(0,KMe.getLogger)()?.handleAutorunStarted(this);let r=this._changeSummary,n=this._delayedStore;n!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,r),this._changeSummary=this._changeTracker.createChangeSummary(r)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,r)}catch(o){(0,RR.onBugIndicatingError)(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||(0,KMe.getLogger)()?.handleAutorunFinished(this);for(let r of this._dependenciesToBeRemoved)r.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===3&&(this._checkIterations(),this._state=1),this._updateCount++}endUpdate(e){try{if(this._updateCount===1){this._iteration=1;do{if(this._checkIterations())return;if(this._state===1){this._state=3;for(let r of this._dependencies)if(r.reportChanges(),this._state===2)break}this._iteration++,this._state!==3&&this._run()}while(this._state!==3)}}finally{this._updateCount--}(0,RR.assertFn)(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===3&&this._isDependency(e)&&(this._checkIterations(),this._state=1)}handleChange(e,r){if(this._isDependency(e)){(0,KMe.getLogger)()?.handleAutorunDependencyChanged(this,e,r);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:r,didChange:a(o=>o===e,"didChange")},this._changeSummary))&&(this._checkIterations(),this._state=2)}catch(n){(0,RR.onBugIndicatingError)(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new RR.BugIndicatingError("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);let r=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),r}get store(){if(this._ensureNoRunning(),this._disposed)throw new RR.BugIndicatingError("Cannot access store after dispose");return this._store===void 0&&(this._store=new RR.DisposableStore),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new RR.BugIndicatingError("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new RR.DisposableStore),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:ina(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?((0,RR.onBugIndicatingError)(new RR.BugIndicatingError(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};Gft.AutorunObserver=M0r});var jee=I(kR=>{"use strict";p();Object.defineProperty(kR,"__esModule",{value:!0});kR.autorun=B0r;kR.autorunOpts=JMe;kR.autorunHandleChanges=Eai;kR.autorunWithStoreHandleChanges=ana;kR.autorunWithStore=cna;kR.autorunDelta=lna;kR.autorunIterableDelta=una;kR.autorunPerKeyedItem=dna;kR.autorunSelfDisposable=fna;kR.registerAutorunSelfDisposable=pna;var Dge=Ov(),O0r=lI(),L0r=$ft(),Nge=uI(),ona=i6(),sna=n6();function B0r(t,e=Nge.DebugLocation.ofCaller()){return new L0r.AutorunObserver(new O0r.DebugNameData(void 0,void 0,t),t,void 0,e)}a(B0r,"autorun");function JMe(t,e,r=Nge.DebugLocation.ofCaller()){return new L0r.AutorunObserver(new O0r.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(JMe,"autorunOpts");function Eai(t,e,r=Nge.DebugLocation.ofCaller()){return new L0r.AutorunObserver(new O0r.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(Eai,"autorunHandleChanges");function ana(t,e){let r=new Dge.DisposableStore,n=Eai({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,Dge.toDisposable)(()=>{n.dispose(),r.dispose()})}a(ana,"autorunWithStoreHandleChanges");function cna(t){let e=new Dge.DisposableStore,r=JMe({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,Dge.toDisposable)(()=>{r.dispose(),e.dispose()})}a(cna,"autorunWithStore");function lna(t,e){let r;return JMe({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(lna,"autorunDelta");function una(t,e,r=n=>n){let n=new Map;return JMe({debugReferenceFn:t},o=>{let s=new Map,c=new Map(n);for(let l of t(o)){let u=r(l);n.has(u)?c.delete(u):(s.set(u,l),n.set(u,l))}for(let l of c.keys())n.delete(l);(s.size||c.size)&&e({addedValues:[...s.values()],removedValues:[...c.values()]})})}a(una,"autorunIterableDelta");function dna(t,e,r,n=Nge.DebugLocation.ofCaller()){let o=new Map,s=JMe({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,sna.transaction)(f=>{for(let h of l){let m=e(h);u.add(m);let g=o.get(m);if(g)g.value.set(h,f);else{let A=new Dge.DisposableStore,_={value:(0,ona.observableValue)("keyedItem",h),store:A};o.set(m,_),d.push({key:m,cell:_})}}for(let[h,m]of o)u.has(h)||(m.store.dispose(),o.delete(h))});for(let{key:f,cell:h}of d)r(f,h.value,h.store)},n);return(0,Dge.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(dna,"autorunPerKeyedItem");function fna(t,e=Nge.DebugLocation.ofCaller()){let r,n=!1;return r=B0r(o=>{t({delayedStore:o.delayedStore,store:o.store,readObservable:o.readObservable.bind(o),dispose:a(()=>{r?.dispose(),n=!0},"dispose")})},e),n&&r.dispose(),r}a(fna,"autorunSelfDisposable");function pna(t,e,r=Nge.DebugLocation.ofCaller()){let n,o=!1;n=B0r(s=>{e({delayedStore:s.delayedStore,store:s.store,readObservable:s.readObservable.bind(s),dispose:a(()=>{n?t.delete(n):o=!0},"dispose")})},r),o?n.dispose():t.add(n)}a(pna,"registerAutorunSelfDisposable")});var Oge=I(Mge=>{"use strict";p();Object.defineProperty(Mge,"__esModule",{value:!0});Mge.DerivedWithSetter=Mge.Derived=void 0;var hna=_D(),Hee=Ov(),F0r=F4();function mna(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(mna,"derivedStateToString");var Vft=class extends hna.BaseObservable{static{a(this,"Derived")}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,r,n,o=void 0,s,c){super(c),this._debugNameData=e,this._computeFn=r,this._changeTracker=n,this._handleLastObserverRemoved=o,this._equalityComparator=s,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=0,this._value=void 0,(0,F0r.getLogger)()?.handleDerivedCleared(this);for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let r;try{this._isReaderValid=!0;let n;this._changeTracker&&(n=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,n)),r=this._computeFn(this,n)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),r}else{do{if(this._state===1){for(let r of this._dependencies)if(r.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;let r=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=r;try{let n=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,n),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(n));let o=this._state!==0,s=this._value;this._state=3;let c=this._delayedStore;c!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,n)}finally{this._isReaderValid=!1;for(let l of this._dependenciesToBeRemoved)l.removeObserver(this);this._dependenciesToBeRemoved.clear(),c!==void 0&&c.dispose()}e=this._didReportChange||o&&!this._equalityComparator(s,this._value),(0,F0r.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,Hee.onBugIndicatingError)(n)}if(this._isComputing=!1,!this._didReportChange&&e)for(let n of this._observers)n.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new Hee.BugIndicatingError("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{let r=this._updateCount===1;if(this._state===3&&(this._state=1,!r))for(let n of this._observers)n.handlePossibleChange(this);if(r)for(let n of this._observers)n.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){let r=[...this._observers];for(let n of r)n.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let n=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(let o of n)o.endUpdate(this)}}(0,Hee.assertFn)(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(let r of this._observers)r.handlePossibleChange(this)}}handleChange(e,r){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){(0,F0r.getLogger)()?.handleDerivedDependencyChanged(this,e,r);let n=!1;try{n=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:r,didChange:a(s=>s===e,"didChange")},this._changeSummary):!0}catch(s){(0,Hee.onBugIndicatingError)(s)}let o=this._state===3;if(n&&(this._state===1||o)&&(this._state=2,o))for(let s of this._observers)s.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new Hee.BugIndicatingError("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);let r=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),r}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(let r of this._observers)r.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new Hee.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new Hee.DisposableStore),this._delayedStore}addObserver(e){let r=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),r&&(this._removedObserverToCallEndUpdateOn?.delete(e)||e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:mna(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this.beginUpdate(this);try{this._isComputing?this._state=2:this._recompute()}finally{this.endUpdate(this)}}setValue(e,r,n){this._value=e;let o=this._observers;r.updateObserver(this,this);for(let s of o)s.handleChange(this,n)}};Mge.Derived=Vft;var U0r=class extends Vft{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};Mge.DerivedWithSetter=U0r});var Wft=I(kG=>{"use strict";p();Object.defineProperty(kG,"__esModule",{value:!0});kG.derived=Ana;kG.derivedWithSetter=yna;kG.derivedOpts=vai;kG.derivedHandleChanges=_na;kG.derivedWithStore=Ena;kG.derivedDisposable=vna;var Q4=Ov(),Lge=uI(),Gee=lI(),gna=_D(),$ee=Oge();function Ana(t,e,r=Lge.DebugLocation.ofCaller()){return e!==void 0?new $ee.Derived(new Gee.DebugNameData(t,void 0,e),e,void 0,void 0,Q4.strictEquals,r):new $ee.Derived(new Gee.DebugNameData(void 0,void 0,t),t,void 0,void 0,Q4.strictEquals,r)}a(Ana,"derived");function yna(t,e,r,n=Lge.DebugLocation.ofCaller()){return new $ee.DerivedWithSetter(new Gee.DebugNameData(t,void 0,e),e,void 0,void 0,Q4.strictEquals,r,n)}a(yna,"derivedWithSetter");function vai(t,e,r=Lge.DebugLocation.ofCaller()){return new $ee.Derived(new Gee.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??Q4.strictEquals,r)}a(vai,"derivedOpts");(0,gna._setDerivedOpts)(vai);function _na(t,e,r=Lge.DebugLocation.ofCaller()){return new $ee.Derived(new Gee.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??Q4.strictEquals,r)}a(_na,"derivedHandleChanges");function Ena(t,e,r=Lge.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new Q4.DisposableStore;return new $ee.Derived(new Gee.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new Q4.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),Q4.strictEquals,r)}a(Ena,"derivedWithStore");function vna(t,e,r=Lge.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new $ee.Derived(new Gee.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new Q4.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},Q4.strictEquals,r)}a(vna,"derivedDisposable")});var Sai=I(PR=>{"use strict";p();Object.defineProperty(PR,"__esModule",{value:!0});PR.ObservableLazyPromise=PR.ObservableResolvedPromise=PR.PromiseResult=PR.ObservablePromise=PR.ObservableLazy=void 0;var Cna=jee(),Cai=n6(),bai=Wft(),zft=i6(),Yft=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,zft.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};PR.ObservableLazy=Yft;var Kft=class t{static{a(this,"ObservablePromise")}static fromFn(e){return new t(e())}static resolved(e){return new t(Promise.resolve(e))}constructor(e){this._value=(0,zft.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,bai.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,Cai.transaction)(n=>{this._value.set(new ZMe(r,void 0),n)}),r),r=>{throw(0,Cai.transaction)(n=>{this._value.set(new ZMe(void 0,r),n)}),r})}};PR.ObservablePromise=Kft;var ZMe=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};PR.PromiseResult=ZMe;var Q0r=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,zft.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,zft.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,Cna.autorun)(o=>{let s=e.read(o);this._runningPromise=s;let c=s.promiseResult.read(o);c?s===this._runningPromise&&(this._isResolving.set(!1,void 0),this._lastResolved.set(c.getDataOrThrow(),void 0)):this._isResolving.set(!0,void 0)}))}};PR.ObservableResolvedPromise=Q0r;var q0r=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new Yft(()=>new Kft(this._computePromise())),this.cachedPromiseResult=(0,bai.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};PR.ObservableLazyPromise=q0r});var H0r=I(q4=>{"use strict";p();Object.defineProperty(q4,"__esModule",{value:!0});q4.cancelOnDispose=q4.CancellationTokenSource=q4.CancellationToken=q4.CancellationError=void 0;var bna=Os();Object.defineProperty(q4,"CancellationError",{enumerable:!0,get:a(function(){return bna.CancellationError},"get")});var j0r=S2();Object.defineProperty(q4,"CancellationToken",{enumerable:!0,get:a(function(){return j0r.CancellationToken},"get")});Object.defineProperty(q4,"CancellationTokenSource",{enumerable:!0,get:a(function(){return j0r.CancellationTokenSource},"get")});Object.defineProperty(q4,"cancelOnDispose",{enumerable:!0,get:a(function(){return j0r.cancelOnDispose},"get")})});var Tai=I(Jft=>{"use strict";p();Object.defineProperty(Jft,"__esModule",{value:!0});Jft.waitForState=Rna;Jft.derivedWithCancellationToken=kna;var Sna=lI(),G0r=H0r(),Tna=Ov(),Ina=jee(),xna=Oge(),wna=uI();function Rna(t,e,r,n){return e||(e=a(o=>o!=null,"predicate")),new Promise((o,s)=>{let c=!0,l=!1,u=t.map(f=>({isFinished:e(f),error:r?r(f):!1,state:f})),d=(0,Ina.autorun)(f=>{let{isFinished:h,error:m,state:g}=u.read(f);(h||m)&&(c?l=!0:d.dispose(),m?s(m===!0?g:m):o(g))});if(n){let f=n.onCancellationRequested(()=>{d.dispose(),f.dispose(),s(new G0r.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new G0r.CancellationError);return}}c=!1,l&&d.dispose()})}a(Rna,"waitForState");function kna(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new xna.Derived(new Sna.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new G0r.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),Tna.strictEquals,wna.DebugLocation.ofCaller())}a(kna,"derivedWithCancellationToken")});var PG=I(Vee=>{"use strict";p();Object.defineProperty(Vee,"__esModule",{value:!0});Vee.FromEventObservable=void 0;Vee.observableFromEvent=$0r;Vee.observableFromEventOpts=Nna;var Pna=n6(),xai=Ov(),wai=lI(),Iai=F4(),Dna=_D(),Rai=uI();function $0r(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new ED(new wai.DebugNameData(e,void 0,n),r,n,()=>ED.globalTransaction,xai.strictEquals,o??Rai.DebugLocation.ofCaller())}a($0r,"observableFromEvent");function Nna(t,e,r,n=Rai.DebugLocation.ofCaller()){return new ED(new wai.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??ED.globalTransaction,t.equalsFn??xai.strictEquals,n)}a(Nna,"observableFromEventOpts");var ED=class extends Dna.BaseObservable{static{a(this,"FromEventObservable")}constructor(e,r,n,o,s,c){super(c),this._debugNameData=e,this.event=r,this._getValue=n,this._getTransaction=o,this._equalityComparator=s,this._hasValue=!1,this.handleEvent=l=>{let u=this._getValue(l),d=this._value,f=!this._hasValue||!this._equalityComparator(d,u),h=!1;f&&(this._value=u,this._hasValue&&(h=!0,(0,Pna.subtransaction)(this._getTransaction(),m=>{(0,Iai.getLogger)()?.handleObservableUpdated(this,{oldValue:d,newValue:u,change:void 0,didChange:f,hadValue:this._hasValue});for(let g of this._observers)m.updateObserver(g,this),g.handleChange(this,void 0)},()=>{let m=this.getDebugName();return"Event fired"+(m?`: ${m}`:"")})),this._hasValue=!0),h||(0,Iai.getLogger)()?.handleObservableUpdated(this,{oldValue:d,newValue:u,change:void 0,didChange:f,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}};Vee.FromEventObservable=ED;(function(t){t.Observer=ED;function e(r,n){let o=!1;ED.globalTransaction===void 0&&(ED.globalTransaction=r,o=!0);try{n()}finally{o&&(ED.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})($0r||(Vee.observableFromEvent=$0r={}))});var W0r=I(V0r=>{"use strict";p();Object.defineProperty(V0r,"__esModule",{value:!0});V0r.observableSignal=Fna;var Mna=n6(),Ona=lI(),Lna=_D(),Bna=uI();function Fna(t,e=Bna.DebugLocation.ofCaller()){return typeof t=="string"?new Zft(t,void 0,e):new Zft(void 0,t,e)}a(Fna,"observableSignal");var Zft=class extends Lna.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new Ona.DebugNameData(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,r,n){super(n),this._debugName=e,this._owner=r}trigger(e,r){if(!e){(0,Mna.transaction)(n=>{this.trigger(n,r)},()=>`Trigger signal ${this.debugName}`);return}for(let n of this._observers)e.updateObserver(n,this),n.handleChange(this,r)}get(){}}});var ept=I(V_=>{"use strict";p();Object.defineProperty(V_,"__esModule",{value:!0});V_.KeepAliveObserver=void 0;V_.observableFromPromise=Una;V_.signalFromObservable=Qna;V_.debouncedObservable=qna;V_.throttledObservable=jna;V_.debouncedObservable2=Hna;V_.wasEventTriggeredRecently=Gna;V_.keepObserved=Oai;V_.recomputeInitiallyAndOnChange=Lai;V_.derivedObservableWithCache=$na;V_.derivedObservableWithWritableCache=Vna;V_.mapObservableArrayCached=Wna;V_.isObservable=zna;var kai=jee(),Pai=i6(),z0r=Ov(),eOe=Wft(),Dai=PG(),Nai=W0r(),Mai=_D(),Y0r=uI();function Una(t){let e=(0,Pai.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(Una,"observableFromPromise");function Qna(t,e){return(0,eOe.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(Qna,"signalFromObservable");function qna(t,e,r=Y0r.DebugLocation.ofCaller()){let n=!1,o,s;return(0,Dai.observableFromEvent)(void 0,c=>{let l=(0,kai.autorun)(u=>{let d=t.read(u);if(!n)n=!0,o=d;else{s&&clearTimeout(s);let f=typeof e=="number"?e:e(o,d);if(f===0){o=d,c();return}s=setTimeout(()=>{o=d,c()},f)}});return{dispose(){l.dispose(),n=!1,o=void 0}}},()=>n?o:t.get(),r)}a(qna,"debouncedObservable");function jna(t,e,r=Y0r.DebugLocation.ofCaller()){let n=!1,o,s;return(0,Dai.observableFromEvent)(void 0,c=>{let l=(0,kai.autorun)(u=>{let d=t.read(u);n?s||(s=setTimeout(()=>{s=void 0,o=t.read(void 0),c()},e)):(n=!0,o=d)});return{dispose(){l.dispose(),s&&(clearTimeout(s),s=void 0),n=!1,o=void 0}}},()=>n?o:t.get(),r)}a(jna,"throttledObservable");function Hna(t,e,r=Y0r.DebugLocation.ofCaller()){let n=(0,Nai.observableSignal)("handleTimeout"),o,s;return(0,eOe.derivedOpts)({owner:void 0,onLastObserverRemoved:a(()=>{o=void 0},"onLastObserverRemoved")},l=>{let u=t.read(l);if(n.read(l),u!==o){let d=typeof e=="number"?e:e(o,u);if(d===0)return o=u,u;s&&clearTimeout(s),s=setTimeout(()=>{o=u,n.trigger(void 0)},d)}return o},r)}a(Hna,"debouncedObservable2");function Gna(t,e,r){let n=(0,Pai.observableValue)("triggeredRecently",!1),o;return r.add(t(()=>{n.set(!0,void 0),o&&clearTimeout(o),o=setTimeout(()=>{n.set(!1,void 0)},e)})),n}a(Gna,"wasEventTriggeredRecently");function Oai(t){let e=new XMe(!1,void 0);return t.addObserver(e),(0,z0r.toDisposable)(()=>{t.removeObserver(e)})}a(Oai,"keepObserved");(0,Mai._setKeepObserved)(Oai);function Lai(t,e){let r=new XMe(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,z0r.toDisposable)(()=>{t.removeObserver(r)})}a(Lai,"recomputeInitiallyAndOnChange");(0,Mai._setRecomputeInitiallyAndOnChange)(Lai);var XMe=class{static{a(this,"KeepAliveObserver")}constructor(e,r){this._forceRecompute=e,this._handleValue=r,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,r){}};V_.KeepAliveObserver=XMe;function $na(t,e){let r;return(0,eOe.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a($na,"derivedObservableWithCache");function Vna(t,e){let r,n=(0,Nai.observableSignal)("derivedObservableWithWritableCache"),o=(0,eOe.derived)(t,s=>(n.read(s),r=e(s,r),r));return Object.assign(o,{clearCache:a(s=>{r=void 0,n.trigger(s)},"clearCache"),setCache:a((s,c)=>{r=s,n.trigger(c)},"setCache")})}a(Vna,"derivedObservableWithWritableCache");function Wna(t,e,r,n){let o=new Xft(r,n);return(0,eOe.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new Xft(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a(Wna,"mapObservableArrayCached");var Xft=class{static{a(this,"ArrayMap")}constructor(e,r){this._map=e,this._keySelector=r,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){let r=[],n=new Set(this._cache.keys());for(let o of e){let s=this._keySelector?this._keySelector(o):o,c=this._cache.get(s);if(c)n.delete(s);else{let l=new z0r.DisposableStore;c={out:this._map(o,l),store:l},this._cache.set(s,c)}r.push(c.out)}for(let o of n)this._cache.get(o).store.dispose(),this._cache.delete(o);this._items=r}getItems(){return this._items}};function zna(t){return!!t&&t.read!==void 0&&t.reportChanges!==void 0}a(zna,"isObservable")});var Fai=I(tpt=>{"use strict";p();Object.defineProperty(tpt,"__esModule",{value:!0});tpt.recordChanges=Yna;tpt.recordChangesLazy=Kna;var Bai=Ov();function Yna(t){return{createChangeSummary:a(e=>({changes:[]}),"createChangeSummary"),handleChange(e,r){for(let n in t)e.didChange(t[n])&&r.changes.push({key:n,change:e.change});return!0},beforeUpdate(e,r){for(let n in t){if(n==="changes")throw new Bai.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(Yna,"recordChanges");function Kna(t){let e;return{createChangeSummary:a(r=>({changes:[]}),"createChangeSummary"),handleChange(r,n){e||(e=t());for(let o in e)r.didChange(e[o])&&n.changes.push({key:o,change:r.change});return!0},beforeUpdate(r,n){e||(e=t());for(let o in e){if(o==="changes")throw new Bai.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(Kna,"recordChangesLazy")});var Uai=I(J0r=>{"use strict";p();Object.defineProperty(J0r,"__esModule",{value:!0});J0r.constObservable=Zna;var Jna=_D();function Zna(t){return new K0r(t)}a(Zna,"constObservable");var K0r=class extends Jna.ConvenientObservable{static{a(this,"ConstObservable")}constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}log(){return this}toString(){return`Const: ${this.value}`}}});var Qai=I(X0r=>{"use strict";p();Object.defineProperty(X0r,"__esModule",{value:!0});X0r.observableSignalFromEvent=nia;var Xna=n6(),eia=lI(),tia=_D(),ria=uI();function nia(t,e,r=ria.DebugLocation.ofCaller()){return new Z0r(typeof t=="string"?t:new eia.DebugNameData(t,void 0,void 0),e,r)}a(nia,"observableSignalFromEvent");var Z0r=class extends tia.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,Xna.transaction)(o=>{for(let s of this._observers)o.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}});var qai=I(tOe=>{"use strict";p();Object.defineProperty(tOe,"__esModule",{value:!0});tOe.ValueWithChangeEventFromObservable=void 0;tOe.observableFromValueWithChangeEvent=sia;var iia=Ov(),oia=PG(),rpt=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return iia.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};tOe.ValueWithChangeEventFromObservable=rpt;function sia(t,e){return e instanceof rpt?e.observable:(0,oia.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(sia,"observableFromValueWithChangeEvent")});var Gai=I(rOe=>{"use strict";p();Object.defineProperty(rOe,"__esModule",{value:!0});rOe.runOnChange=jai;rOe.runOnChangeWithStore=Hai;rOe.runOnChangeWithCancellationToken=uia;var aia=H0r(),cia=Ov(),lia=jee();function jai(t,e){let r,n=!0;return(0,lia.autorunWithStoreHandleChanges)({changeTracker:{createChangeSummary:a(()=>({deltas:[],didChange:!1}),"createChangeSummary"),handleChange:a((o,s)=>{if(o.didChange(t)){let c=o.change;c!==void 0&&s.deltas.push(c),s.didChange=!0}return!0},"handleChange")}},(o,s)=>{let c=t.read(o),l=r;s.didChange&&(r=c,e(c,l,s.deltas)),n&&(n=!1,r=c)})}a(jai,"runOnChange");function Hai(t,e){let r=new cia.DisposableStore,n=jai(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(Hai,"runOnChangeWithStore");function uia(t,e){return Hai(t,(r,n,o,s)=>{e(r,n,o,(0,aia.cancelOnDispose)(s))})}a(uia,"runOnChangeWithCancellationToken")});var Wai=I(npt=>{"use strict";p();Object.defineProperty(npt,"__esModule",{value:!0});npt.latestChangedValue=hia;npt.derivedConstOnceDefined=mia;var $ai=Ov(),Vai=lI(),dia=PG(),fia=jee(),pia=ept();function hia(t,e){if(e.length===0)throw new $ai.BugIndicatingError;let r=!1,n,o=(0,dia.observableFromEvent)(t,s=>{let c=new $ai.DisposableStore;for(let l of e)c.add((0,fia.autorunOpts)({debugName:a(()=>(0,Vai.getDebugName)(o,new Vai.DebugNameData(t,void 0,void 0))+".updateLastChangedValue","debugName")},u=>{r=!0,n=l.read(u),s()}));return c.add({dispose(){r=!1,n=void 0}}),c},()=>r?n:e[e.length-1].get());return o}a(hia,"latestChangedValue");function mia(t,e){return(0,pia.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(mia,"derivedConstOnceDefined")});var zai=I(ipt=>{"use strict";p();Object.defineProperty(ipt,"__esModule",{value:!0});ipt.ObservableSet=void 0;var gia=Hft(),eAr=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,gia.observableValueOpts)({equalsFn:a(()=>!1,"equalsFn")},this),this.observable=this._obs}get size(){return this._data.size}has(e){return this._data.has(e)}add(e,r){return this._data.has(e)||(this._data.add(e),this._obs.set(this,r)),this}delete(e,r){let n=this._data.delete(e);return n&&this._obs.set(this,r),n}clear(e){this._data.size>0&&(this._data.clear(),this._obs.set(this,e))}forEach(e,r){this._data.forEach((n,o,s)=>{e.call(r,n,o,this)})}*entries(){for(let e of this._data)yield[e,e]}*keys(){yield*this._data.keys()}*values(){yield*this._data.values()}[Symbol.iterator](){return this.values()}get[Symbol.toStringTag](){return"ObservableSet"}};ipt.ObservableSet=eAr});var Yai=I(opt=>{"use strict";p();Object.defineProperty(opt,"__esModule",{value:!0});opt.ObservableMap=void 0;var Aia=Hft(),tAr=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,Aia.observableValueOpts)({equalsFn:a(()=>!1,"equalsFn")},this),this.observable=this._obs}get size(){return this._data.size}has(e){return this._data.has(e)}get(e){return this._data.get(e)}set(e,r,n){let o=this._data.has(e),s=this._data.get(e);return(!o||s!==r)&&(this._data.set(e,r),this._obs.set(this,n)),this}delete(e,r){let n=this._data.delete(e);return n&&this._obs.set(this,r),n}clear(e){this._data.size>0&&(this._data.clear(),this._obs.set(this,e))}forEach(e,r){this._data.forEach((n,o,s)=>{e.call(r,n,o,this)})}*entries(){yield*this._data.entries()}*keys(){yield*this._data.keys()}*values(){yield*this._data.values()}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return"ObservableMap"}};opt.ObservableMap=tAr});var cpt=I(Qge=>{"use strict";p();Object.defineProperty(Qge,"__esModule",{value:!0});Qge.ConsoleObservableLogger=void 0;Qge.logObservableToConsole=Eia;Qge.formatValue=Uge;var yia=F4(),_ia=lI(),Kai=Oge(),spt;function Eia(t){spt||(spt=new apt,(0,yia.addLogger)(spt)),spt.addFilteredObj(t)}a(Eia,"logObservableToConsole");var apt=class{static{a(this,"ConsoleObservableLogger")}constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return via([Bge(Sia("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[Bge(" "),DR(Uge(e.oldValue,70),{color:"red",strikeThrough:!0}),Bge(" "),DR(Uge(e.newValue,60),{color:"green"})]:[Bge(" (unchanged)")]:[Bge(" "),DR(Uge(e.newValue,60),{color:"green"}),Bge(" (initial)")]}handleObservableCreated(e){if(e instanceof Kai.Derived){let r=e;if(this.changedObservablesSets.set(r,new Set),!1){let o=[];r.__debugUpdating=o;let s=r.beginUpdate;r.beginUpdate=l=>(o.push(l),s.apply(r,[l]));let c=r.endUpdate;r.endUpdate=l=>{let u=o.indexOf(l);return u===-1&&console.error("endUpdate called without beginUpdate",r.debugName,l.debugName),o.splice(u,1),c.apply(r,[l])}}}}handleOnListenerCountChanged(e,r){}handleObservableUpdated(e,r){if(this._isIncluded(e)){if(e instanceof Kai.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([Fge("observable value changed"),DR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return DR(" (changed deps: "+[...e].map(r=>r.debugName).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(e,r,n){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(r)}_handleDerivedRecomputed(e,r){if(!this._isIncluded(e))return;let n=this.changedObservablesSets.get(e);n&&(console.log(...this.textToConsoleArgs([Fge("derived recomputed"),DR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r),this.formatChanges(n),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),n.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Fge("derived cleared"),DR(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Fge("observable from event triggered"),DR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r),{data:[{fn:e._getValue}]}]))}handleAutorunCreated(e){this._isIncluded(e)&&this.changedObservablesSets.set(e,new Set)}handleAutorunDisposed(e){}handleAutorunDependencyChanged(e,r,n){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(r)}handleAutorunStarted(e){let r=this.changedObservablesSets.get(e);r&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Fge("autorun"),DR(e.debugName,{color:"BlueViolet"}),this.formatChanges(r),{data:[{fn:e._debugNameData.referenceFn??e._runFn}]}])),r.clear(),this.indentation++)}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let r=e.getDebugName();r===void 0&&(r=""),this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Fge("transaction"),DR(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};Qge.ConsoleObservableLogger=apt;function via(t){let e=new Array,r=[],n="";function o(c){if("length"in c)for(let l of c)l&&o(l);else"text"in c?(n+=`%c${c.text}`,e.push(c.style),c.data&&r.push(...c.data)):"data"in c&&r.push(...c.data)}a(o,"process"),o(t);let s=[n,...e];return s.push(...r),s}a(via,"consoleTextToArgs");function Bge(t){return DR(t,{color:"black"})}a(Bge,"normalText");function Fge(t){return DR(Tia(`${t}: `,10),{color:"black",bold:!0})}a(Fge,"formatKind");function DR(t,e={color:"black"}){function r(o){return Object.entries(o).reduce((s,[c,l])=>`${s}${c}:${l};`,"")}a(r,"objToCss");let n={color:e.color};return e.strikeThrough&&(n["text-decoration"]="line-through"),e.bold&&(n["font-weight"]="bold"),{text:t,style:r(n)}}a(DR,"styled");function Uge(t,e){switch(typeof t){case"number":return""+t;case"string":return t.length+2<=e?`"${t}"`:`"${t.substr(0,e-7)}"+...`;case"boolean":return t?"true":"false";case"undefined":return"undefined";case"object":return t===null?"null":Array.isArray(t)?Cia(t,e):bia(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a(Uge,"formatValue");function Cia(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${Uge(o,e-r.length)}`}return r+=" ]",r}a(Cia,"formatArray");function bia(t,e){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString){let s=t.toString();return s.length<=e?s:s.substring(0,e-3)+"..."}let r=(0,_ia.getClassName)(t),n=r?r+"(":"{ ",o=!0;for(let[s,c]of Object.entries(t)){if(o||(n+=", "),n.length-5>e){n+="...";break}o=!1,n+=`${s}: ${Uge(c,e-n.length)}`}return n+=r?")":" }",n}a(bia,"formatObject");function Sia(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(Sia,"repeat");function Tia(t,e){for(;t.length{"use strict";p();Object.defineProperty(lpt,"__esModule",{value:!0});lpt.SimpleTypedRpcConnection=void 0;var rAr=class t{static{a(this,"SimpleTypedRpcConnection")}static createHost(e,r){return new t(e,r)}static createClient(e,r){return new t(e,r)}constructor(e,r){this._channelFactory=e,this._getHandler=r,this._channel=this._channelFactory({handleNotification:a(s=>{let c=s,l=this._getHandler().notifications[c[0]];if(!l)throw new Error(`Unknown notification "${c[0]}"!`);l(...c[1])},"handleNotification"),handleRequest:a(s=>{let c=s;try{return{type:"result",value:this._getHandler().requests[c[0]](...c[1])}}catch(l){return{type:"error",value:l}}},"handleRequest")});let n=new Proxy({},{get:a((s,c)=>async(...l)=>{let u=await this._channel.sendRequest([c,l]);if(u.type==="error")throw u.value;return u.value},"get")}),o=new Proxy({},{get:a((s,c)=>(...l)=>{this._channel.sendNotification([c,l])},"get")});this.api={notifications:o,requests:n}}};lpt.SimpleTypedRpcConnection=rAr});var Zai=I(nAr=>{"use strict";p();Object.defineProperty(nAr,"__esModule",{value:!0});nAr.registerDebugChannel=xia;var Iia=Jai();function xia(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=wia({sendNotification:a(u=>{o?o.sendNotification(u):n.push(u)},"sendNotification")}),l;return(r.$$debugValueEditor_debugChannels??(r.$$debugValueEditor_debugChannels={}))[t]=u=>{l=e(),o=u;for(let d of n)u.sendNotification(d);return n=[],c},Iia.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(xia,"registerDebugChannel");function wia(t){let e;return{channel:a(n=>(e=n,{sendNotification:a(o=>{t.sendNotification(o)},"sendNotification"),sendRequest:a(o=>{throw new Error("not supported")},"sendRequest")}),"channel"),handler:{handleRequest:a(n=>n.type==="notification"?e?.handleNotification(n.data):e?.handleRequest(n.data),"handleRequest")}}}a(wia,"createChannelFactoryFromDebugChannel")});var tci=I(DG=>{"use strict";p();Object.defineProperty(DG,"__esModule",{value:!0});DG.Throttler=DG.Debouncer=void 0;DG.deepAssign=Xai;DG.deepAssignDeleteNulls=eci;var iAr=class{static{a(this,"Debouncer")}constructor(){this._timeout=void 0}debounce(e,r){this._timeout!==void 0&&clearTimeout(this._timeout),this._timeout=setTimeout(()=>{this._timeout=void 0,e()},r)}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};DG.Debouncer=iAr;var oAr=class{static{a(this,"Throttler")}constructor(){this._timeout=void 0}throttle(e,r){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},r))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};DG.Throttler=oAr;function Xai(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?Xai(t[r],e[r]):t[r]=e[r]}a(Xai,"deepAssign");function eci(t,e){for(let r in e)e[r]===null?delete t[r]:t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?eci(t[r],e[r]):t[r]=e[r]}a(eci,"deepAssignDeleteNulls")});var ici=I(dpt=>{"use strict";p();Object.defineProperty(dpt,"__esModule",{value:!0});dpt.DevToolsLogger=void 0;var rci=$ft(),upt=cpt(),Ria=Zai(),sAr=tci(),nOe=CT(),kia=PG(),Wee=Os(),zee=Oge(),nci=i6(),Pia=uI(),aAr=class t{static{a(this,"DevToolsLogger")}static{this._instance=void 0}static getInstance(){return t._instance===void 0&&(t._instance=new t),t._instance}getTransactionState(){let e=[],r=[...this._activeTransactions];if(r.length===0)return;let n=r.flatMap(s=>s.debugGetUpdatingObservers()??[]).map(s=>s.observer),o=new Set;for(;n.length>0;){let s=n.shift();if(o.has(s))continue;o.add(s);let c=this._getInfo(s,l=>{o.has(l)||n.push(l)});c&&e.push(c)}return{names:r.map(s=>s.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,Wee.onUnexpectedError)(new Wee.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,Wee.onUnexpectedError)(new Wee.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof zee.Derived){let n=[...e.debugGetObservers()];for(let u of n)r(u);let o=this._getObservableInfo(e);if(!o)return;let s=e.debugGetState(),c={name:e.debugName,instanceId:o.instanceId,updateCount:s.updateCount},l=[...o.changedObservables].map(u=>this._instanceInfos.get(u)?.instanceId).filter(nOe.isDefined);if(s.isComputing)return{...c,type:"observable/derived",state:"updating",changedDependencies:l,initialComputation:!1};switch(s.state){case 0:return{...c,type:"observable/derived",state:"noValue"};case 3:return{...c,type:"observable/derived",state:"upToDate"};case 2:return{...c,type:"observable/derived",state:"stale",changedDependencies:l};case 1:return{...c,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof rci.AutorunObserver){let n=this._getAutorunInfo(e);if(!n)return;let o={name:e.debugName,instanceId:n.instanceId,updateCount:n.updateCount},s=[...n.changedObservables].map(c=>this._instanceInfos.get(c).instanceId);if(e.debugGetState().isRunning)return{...o,type:"autorun",state:"updating",changedDependencies:s};switch(e.debugGetState().state){case 3:return{...o,type:"autorun",state:"upToDate"};case 2:return{...o,type:"autorun",state:"stale",changedDependencies:s};case 1:return{...o,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){let r=this._getObservableInfo(e);if(r)return{name:e.debugName,instanceId:r.instanceId}}_formatObserver(e){if(e instanceof zee.Derived)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};let r=this._getAutorunInfo(e);if(r)return{name:e.toString(),instanceId:r.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=(0,Ria.registerDebugChannel)("observableDevTools",()=>({notifications:{setDeclarationIdFilter:a(e=>{},"setDeclarationIdFilter"),logObservableValue:a(e=>{console.log("logObservableValue",e)},"logObservableValue"),flushUpdates:a(()=>{this._flushUpdates()},"flushUpdates"),resetUpdates:a(()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)},"resetUpdates")},requests:{getDeclarations:a(()=>{let e={};for(let r of this._declarations.values())e[r.id]=r;return{decls:e}},"getDeclarations"),getSummarizedInstances:a(()=>null,"getSummarizedInstances"),getObservableValueInfo:a(e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(n=>this._formatObserver(n)).filter(nOe.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(nOe.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(nOe.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(nOe.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof zee.Derived)n.debugSetValue(r);else if(n instanceof nci.ObservableValue)n.debugSetValue(r);else if(n instanceof kia.FromEventObservable)n.debugSetValue(r);else throw new Wee.BugIndicatingError("Observable is not supported");let o=[...n.debugGetObservers()];for(let s of o)s.beginUpdate(n);for(let s of o)s.handleChange(n,void 0);for(let s of o)s.endUpdate(n)},"setValue"),getValue:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof zee.Derived)return(0,upt.formatValue)(r.debugGetState().value,200);if(r instanceof nci.ObservableValue)return(0,upt.formatValue)(r.debugGetState().value,200)},"getValue"),logValue:a(e=>{let r=this._aliveInstances.get(e);if(r&&"get"in r)console.log("Logged Value:",r.get());else throw new Wee.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof zee.Derived)r.debugRecompute();else if(r instanceof rci.AutorunObserver)r.debugRerun();else throw new Wee.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new sAr.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},Pia.DebugLocation.enable()}_handleChange(e){(0,sAr.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,sAr.deepAssign)(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,r){if(!r)return-1;let n=this._declarations.get(r.id);return n===void 0&&(n={id:this._declarationId++,type:e,url:r.fileName,line:r.line,column:r.column},this._declarations.set(r.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(e,r){let o={declarationId:this._getDeclarationId("observable/value",r),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o)}handleOnListenerCountChanged(e,r){let n=this._getObservableInfo(e);if(n){if(n.listenerCount===0&&r>0){let o=e instanceof zee.Derived?"observable/derived":"observable/value";this._aliveInstances.set(n.instanceId,e),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:o,name:e.debugName}}})}else n.listenerCount>0&&r===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=r}}handleObservableUpdated(e,r){if(e instanceof zee.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,upt.formatValue)(r.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(e,r){let o={declarationId:this._getDeclarationId("autorun",r),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o),this._aliveInstances.set(o.instanceId,e),o&&this._handleChange({instances:{[o.instanceId]:{instanceId:o.instanceId,declarationId:o.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){let r=this._getAutorunInfo(e);r&&(this._handleChange({instances:{[r.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(r.instanceId))}handleAutorunDependencyChanged(e,r,n){let o=this._getAutorunInfo(e);o&&o.changedObservables.add(r)}handleAutorunStarted(e){}handleAutorunFinished(e){let r=this._getAutorunInfo(e);r&&(r.changedObservables.clear(),r.updateCount++,this._handleChange({instances:{[r.instanceId]:{runCount:r.updateCount}}}))}handleDerivedDependencyChanged(e,r,n){let o=this._getObservableInfo(e);o&&o.changedObservables.add(r)}_handleDerivedRecomputed(e,r){let n=this._getObservableInfo(e);if(!n)return;let o=(0,upt.formatValue)(r.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=o,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:o,recomputationCount:n.updateCount}}})}handleDerivedCleared(e){let r=this._getObservableInfo(e);r&&(r.lastValue=void 0,r.changedObservables.clear(),r.listenerCount>0&&this._handleChange({instances:{[r.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}};dpt.DevToolsLogger=aAr});var cci=I(cAr=>{"use strict";p();Object.defineProperty(cAr,"__esModule",{value:!0});cAr.debugGetObservableGraph=Lia;var Dia=Oge(),Nia=PG(),Mia=i6(),Oia=$ft(),oci=cpt();function Lia(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=Yee.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?aci(n,0,o,e).trim():sci(n,0,o,e).trim()}a(Lia,"debugGetObservableGraph");function sci(t,e,r,n){let o=" ".repeat(e),s=[];if(r.has(t.sourceObj))return s.push(`${o}* ${t.type} ${t.name} (already listed)`),s.join(` +`);if(r.add(t.sourceObj),s.push(`${o}* ${t.type} ${t.name}:`),s.push(`${o} value: ${(0,oci.formatValue)(t.value,50)}`),s.push(`${o} state: ${t.state}`),t.dependencies.length>0){s.push(`${o} dependencies:`);for(let l of t.dependencies){let u=Yee.from(l,n.debugNamePostProcessor??(d=>d))??Yee.unknown(l);s.push(sci(u,e+1,r,n))}}return s.join(` +`)}a(sci,"formatObservableInfoWithDependencies");function aci(t,e,r,n){let o=" ".repeat(e),s=[];if(r.has(t.sourceObj))return s.push(`${o}* ${t.type} ${t.name} (already listed)`),s.join(` +`);if(r.add(t.sourceObj),s.push(`${o}* ${t.type} ${t.name}:`),s.push(`${o} value: ${(0,oci.formatValue)(t.value,50)}`),s.push(`${o} state: ${t.state}`),t.observers.length>0){s.push(`${o} observers:`);for(let l of t.observers){let u=Yee.from(l,n.debugNamePostProcessor??(d=>d))??Yee.unknown(l);s.push(aci(u,e+1,r,n))}}return s.join(` +`)}a(aci,"formatObservableInfoWithObservers");var Yee=class t{static{a(this,"Info")}static from(e,r){if(e instanceof Oia.AutorunObserver){let n=e.debugGetState();return new t(e,r(e.debugName),"autorun",void 0,n.stateStr,Array.from(n.dependencies),[])}else if(e instanceof Dia.Derived){let n=e.debugGetState();return new t(e,r(e.debugName),"derived",n.value,n.stateStr,Array.from(n.dependencies),Array.from(e.debugGetObservers()))}else if(e instanceof Mia.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof Nia.FromEventObservable){let n=e.debugGetState();return new t(e,r(e.debugName),"fromEvent",n.value,n.hasValue?"upToDate":"initial",[],Array.from(e.debugGetObservers()))}}static unknown(e){return new t(e,"(unknown)","unknown",void 0,"unknown",[],[])}constructor(e,r,n,o,s,c,l){this.sourceObj=e,this.name=r,this.type=n,this.value=o,this.state=s,this.dependencies=c,this.observers=l}}});var o6=I(Ut=>{"use strict";p();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ValueWithChangeEventFromObservable=Ut.observableFromValueWithChangeEvent=Ut.TransactionImpl=Ut.transaction=Ut.subtransaction=Ut.globalTransaction=Ut.asyncTransaction=Ut.observableSignalFromEvent=Ut.observableFromEventOpts=Ut.observableSignal=Ut.constObservable=Ut.recordChangesLazy=Ut.recordChanges=Ut.isObservable=Ut.wasEventTriggeredRecently=Ut.throttledObservable=Ut.signalFromObservable=Ut.recomputeInitiallyAndOnChange=Ut.observableFromPromise=Ut.mapObservableArrayCached=Ut.keepObserved=Ut.derivedObservableWithWritableCache=Ut.derivedObservableWithCache=Ut.debouncedObservable2=Ut.debouncedObservable=Ut.waitForState=Ut.derivedWithCancellationToken=Ut.PromiseResult=Ut.ObservableResolvedPromise=Ut.ObservablePromise=Ut.ObservableLazyPromise=Ut.ObservableLazy=Ut.derivedWithStore=Ut.derivedWithSetter=Ut.derivedOpts=Ut.derivedHandleChanges=Ut.derivedDisposable=Ut.derived=Ut.disposableObservableValue=Ut.registerAutorunSelfDisposable=Ut.autorunSelfDisposable=Ut.autorunPerKeyedItem=Ut.autorunIterableDelta=Ut.autorunWithStoreHandleChanges=Ut.autorunWithStore=Ut.autorunOpts=Ut.autorunHandleChanges=Ut.autorunDelta=Ut.autorun=Ut.observableValueOpts=void 0;Ut.DebugLocation=Ut.ObservableMap=Ut.ObservableSet=Ut.observableValue=Ut.observableFromEvent=Ut.latestChangedValue=Ut.derivedConstOnceDefined=Ut.runOnChangeWithStore=Ut.runOnChangeWithCancellationToken=Ut.runOnChange=void 0;var Bia=Hft();Object.defineProperty(Ut,"observableValueOpts",{enumerable:!0,get:a(function(){return Bia.observableValueOpts},"get")});var j4=jee();Object.defineProperty(Ut,"autorun",{enumerable:!0,get:a(function(){return j4.autorun},"get")});Object.defineProperty(Ut,"autorunDelta",{enumerable:!0,get:a(function(){return j4.autorunDelta},"get")});Object.defineProperty(Ut,"autorunHandleChanges",{enumerable:!0,get:a(function(){return j4.autorunHandleChanges},"get")});Object.defineProperty(Ut,"autorunOpts",{enumerable:!0,get:a(function(){return j4.autorunOpts},"get")});Object.defineProperty(Ut,"autorunWithStore",{enumerable:!0,get:a(function(){return j4.autorunWithStore},"get")});Object.defineProperty(Ut,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return j4.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Ut,"autorunIterableDelta",{enumerable:!0,get:a(function(){return j4.autorunIterableDelta},"get")});Object.defineProperty(Ut,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return j4.autorunPerKeyedItem},"get")});Object.defineProperty(Ut,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return j4.autorunSelfDisposable},"get")});Object.defineProperty(Ut,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return j4.registerAutorunSelfDisposable},"get")});var Fia=i6();Object.defineProperty(Ut,"disposableObservableValue",{enumerable:!0,get:a(function(){return Fia.disposableObservableValue},"get")});var qge=Wft();Object.defineProperty(Ut,"derived",{enumerable:!0,get:a(function(){return qge.derived},"get")});Object.defineProperty(Ut,"derivedDisposable",{enumerable:!0,get:a(function(){return qge.derivedDisposable},"get")});Object.defineProperty(Ut,"derivedHandleChanges",{enumerable:!0,get:a(function(){return qge.derivedHandleChanges},"get")});Object.defineProperty(Ut,"derivedOpts",{enumerable:!0,get:a(function(){return qge.derivedOpts},"get")});Object.defineProperty(Ut,"derivedWithSetter",{enumerable:!0,get:a(function(){return qge.derivedWithSetter},"get")});Object.defineProperty(Ut,"derivedWithStore",{enumerable:!0,get:a(function(){return qge.derivedWithStore},"get")});var iOe=Sai();Object.defineProperty(Ut,"ObservableLazy",{enumerable:!0,get:a(function(){return iOe.ObservableLazy},"get")});Object.defineProperty(Ut,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return iOe.ObservableLazyPromise},"get")});Object.defineProperty(Ut,"ObservablePromise",{enumerable:!0,get:a(function(){return iOe.ObservablePromise},"get")});Object.defineProperty(Ut,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return iOe.ObservableResolvedPromise},"get")});Object.defineProperty(Ut,"PromiseResult",{enumerable:!0,get:a(function(){return iOe.PromiseResult},"get")});var uci=Tai();Object.defineProperty(Ut,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return uci.derivedWithCancellationToken},"get")});Object.defineProperty(Ut,"waitForState",{enumerable:!0,get:a(function(){return uci.waitForState},"get")});var NR=ept();Object.defineProperty(Ut,"debouncedObservable",{enumerable:!0,get:a(function(){return NR.debouncedObservable},"get")});Object.defineProperty(Ut,"debouncedObservable2",{enumerable:!0,get:a(function(){return NR.debouncedObservable2},"get")});Object.defineProperty(Ut,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return NR.derivedObservableWithCache},"get")});Object.defineProperty(Ut,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return NR.derivedObservableWithWritableCache},"get")});Object.defineProperty(Ut,"keepObserved",{enumerable:!0,get:a(function(){return NR.keepObserved},"get")});Object.defineProperty(Ut,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return NR.mapObservableArrayCached},"get")});Object.defineProperty(Ut,"observableFromPromise",{enumerable:!0,get:a(function(){return NR.observableFromPromise},"get")});Object.defineProperty(Ut,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return NR.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Ut,"signalFromObservable",{enumerable:!0,get:a(function(){return NR.signalFromObservable},"get")});Object.defineProperty(Ut,"throttledObservable",{enumerable:!0,get:a(function(){return NR.throttledObservable},"get")});Object.defineProperty(Ut,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return NR.wasEventTriggeredRecently},"get")});Object.defineProperty(Ut,"isObservable",{enumerable:!0,get:a(function(){return NR.isObservable},"get")});var dci=Fai();Object.defineProperty(Ut,"recordChanges",{enumerable:!0,get:a(function(){return dci.recordChanges},"get")});Object.defineProperty(Ut,"recordChangesLazy",{enumerable:!0,get:a(function(){return dci.recordChangesLazy},"get")});var Uia=Uai();Object.defineProperty(Ut,"constObservable",{enumerable:!0,get:a(function(){return Uia.constObservable},"get")});var Qia=W0r();Object.defineProperty(Ut,"observableSignal",{enumerable:!0,get:a(function(){return Qia.observableSignal},"get")});var qia=PG();Object.defineProperty(Ut,"observableFromEventOpts",{enumerable:!0,get:a(function(){return qia.observableFromEventOpts},"get")});var jia=Qai();Object.defineProperty(Ut,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return jia.observableSignalFromEvent},"get")});var oOe=n6();Object.defineProperty(Ut,"asyncTransaction",{enumerable:!0,get:a(function(){return oOe.asyncTransaction},"get")});Object.defineProperty(Ut,"globalTransaction",{enumerable:!0,get:a(function(){return oOe.globalTransaction},"get")});Object.defineProperty(Ut,"subtransaction",{enumerable:!0,get:a(function(){return oOe.subtransaction},"get")});Object.defineProperty(Ut,"transaction",{enumerable:!0,get:a(function(){return oOe.transaction},"get")});Object.defineProperty(Ut,"TransactionImpl",{enumerable:!0,get:a(function(){return oOe.TransactionImpl},"get")});var fci=qai();Object.defineProperty(Ut,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return fci.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Ut,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return fci.ValueWithChangeEventFromObservable},"get")});var lAr=Gai();Object.defineProperty(Ut,"runOnChange",{enumerable:!0,get:a(function(){return lAr.runOnChange},"get")});Object.defineProperty(Ut,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return lAr.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Ut,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return lAr.runOnChangeWithStore},"get")});var pci=Wai();Object.defineProperty(Ut,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return pci.derivedConstOnceDefined},"get")});Object.defineProperty(Ut,"latestChangedValue",{enumerable:!0,get:a(function(){return pci.latestChangedValue},"get")});var Hia=PG();Object.defineProperty(Ut,"observableFromEvent",{enumerable:!0,get:a(function(){return Hia.observableFromEvent},"get")});var Gia=i6();Object.defineProperty(Ut,"observableValue",{enumerable:!0,get:a(function(){return Gia.observableValue},"get")});var $ia=zai();Object.defineProperty(Ut,"ObservableSet",{enumerable:!0,get:a(function(){return $ia.ObservableSet},"get")});var Via=Yai();Object.defineProperty(Ut,"ObservableMap",{enumerable:!0,get:a(function(){return Via.ObservableMap},"get")});var Wia=uI();Object.defineProperty(Ut,"DebugLocation",{enumerable:!0,get:a(function(){return Wia.DebugLocation},"get")});var uAr=F4(),hci=cpt(),zia=ici(),lci=BRe(),Yia=_D(),Kia=cci();(0,Yia._setDebugGetObservableGraph)(Kia.debugGetObservableGraph);(0,uAr.setLogObservableFn)(hci.logObservableToConsole);var Jia=!1;Jia&&(0,uAr.addLogger)(new hci.ConsoleObservableLogger);lci.env&&lci.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,uAr.addLogger)(zia.DevToolsLogger.getInstance())});var Id=I(jge=>{"use strict";p();Object.defineProperty(jge,"__esModule",{value:!0});jge.OffsetRangeSet=jge.OffsetRange=void 0;var fpt=Os(),ppt=class t{static{a(this,"OffsetRange")}static fromTo(e,r){return new t(e,r)}static equals(e,r){return e.start===r.start&&e.endExclusive===r.endExclusive}static addRange(e,r){let n=0;for(;nr))return new t(e,r)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,r){return new t(e,e+r)}static emptyAt(e){return new t(e,e)}constructor(e,r){if(this.start=e,this.endExclusive=r,e>r)throw new fpt.BugIndicatingError(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new fpt.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new fpt.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let r=[];for(let n=this.start;ne.toString()).join(", ")}intersectsStrict(e){let r=0;for(;re+r.length,0)}};jge.OffsetRangeSet=dAr});var vD=I($ge=>{"use strict";p();Object.defineProperty($ge,"__esModule",{value:!0});$ge.LineRangeSet=$ge.LineRange=void 0;var mci=Os(),Zia=Id(),gci=uh(),Hge=dj(),Aci=Ml(),Gge=class t{static{a(this,"LineRange")}static ofLength(e,r){return new t(e,e+r)}static fromRange(e){return new t(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new t(e.startLineNumber,e.endLineNumber+1)}static{this.compareByStart=(0,Aci.compareBy)(e=>e.startLineNumber,Aci.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new mci.BugIndicatingError(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=(0,Hge.findLastIdxMonotonous)(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)this._normalizedRanges.splice(r,0,e);else if(r===n-1){let o=this._normalizedRanges[r];this._normalizedRanges[r]=o.join(e)}else{let o=this._normalizedRanges[r].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(r,n-r,o)}}contains(e){let r=(0,Hge.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,Hge.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let r=[],n=0,o=0,s=null;for(;n=c.startLineNumber?s=new Gge(s.startLineNumber,Math.max(s.endLineNumberExclusive,c.endLineNumberExclusive)):(r.push(s),s=c)}return s!==null&&r.push(s),new t(r)}subtractFrom(e){let r=(0,Hge.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,Hge.findLastIdxMonotonous)(this._normalizedRanges,c=>c.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)return new t([e]);let o=[],s=e.startLineNumber;for(let c=r;cs&&o.push(new Gge(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};$ge.LineRangeSet=sOe});var Vge=I(mpt=>{"use strict";p();Object.defineProperty(mpt,"__esModule",{value:!0});mpt.TextLength=void 0;var Xia=vD(),yci=iv(),hpt=uh(),fAr=class t{static{a(this,"TextLength")}static{this.zero=new t(0,0)}static lengthDiffNonNegative(e,r){return r.isLessThan(e)?t.zero:e.lineCount===r.lineCount?new t(0,r.columnCount-e.columnCount):new t(r.lineCount-e.lineCount,r.columnCount)}static betweenPositions(e,r){return e.lineNumber===r.lineNumber?new t(0,r.column-e.column):new t(r.lineNumber-e.lineNumber,r.column-1)}static fromPosition(e){return new t(e.lineNumber-1,e.column-1)}static ofRange(e){return t.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let r=0,n=0;for(let o of e)o===` +`?(r++,n=0):n++;return new t(r,n)}static ofSubstr(e,r){return t.ofText(r.substring(e))}static sum(e,r){return e.reduce((n,o)=>n.add(r(o)),t.zero)}constructor(e,r){this.lineCount=e,this.columnCount=r}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new t(this.lineCount,this.columnCount+e.columnCount):new t(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new hpt.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new hpt.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new hpt.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return Xia.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new yci.Position(e.lineNumber,e.column+this.columnCount):new yci.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return hpt.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};mpt.TextLength=fAr});var Apt=I(Kee=>{"use strict";p();Object.defineProperty(Kee,"__esModule",{value:!0});Kee.PositionOffsetTransformer=Kee.PositionOffsetTransformerBase=void 0;Kee._setPositionOffsetTransformerDependencies=noa;var eoa=dj(),toa=Id(),aOe=iv(),roa=uh(),gpt=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new toa.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return roa.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new s6.deps.StringEdit(r)}getStringReplacement(e){return new s6.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new s6.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new s6.deps.TextEdit(r)}};Kee.PositionOffsetTransformerBase=gpt;var s6=class{static{a(this,"Deps")}static{this._deps=void 0}static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}};function noa(t){s6._deps=t}a(noa,"_setPositionOffsetTransformerDependencies");var pAr=class extends gpt{static{a(this,"PositionOffsetTransformer")}constructor(e){super(),this.text=e}get lineStartOffsetByLineIdx(){return this._lineStartOffsetByLineIdx||this._computeLineOffsets(),this._lineStartOffsetByLineIdx}get lineEndOffsetByLineIdx(){return this._lineEndOffsetByLineIdx||this._computeLineOffsets(),this._lineEndOffsetByLineIdx}_computeLineOffsets(){this._lineStartOffsetByLineIdx=[],this._lineEndOffsetByLineIdx=[],this._lineStartOffsetByLineIdx.push(0);for(let e=0;e0&&this.text.charAt(e-1)==="\r"?this._lineEndOffsetByLineIdx.push(e-1):this._lineEndOffsetByLineIdx.push(e));this._lineEndOffsetByLineIdx.push(this.text.length)}getOffset(e){let r=this._validatePosition(e);return this.lineStartOffsetByLineIdx[r.lineNumber-1]+r.column-1}_validatePosition(e){if(e.lineNumber<1)return new aOe.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new aOe.Position(r,o+1)}if(e.column<1)return new aOe.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new aOe.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,eoa.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new aOe.Position(n,o)}getTextLength(e){return s6.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new s6.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};Kee.PositionOffsetTransformer=pAr});var dI=I(H4=>{"use strict";p();Object.defineProperty(H4,"__esModule",{value:!0});H4.StringText=H4.ArrayText=H4.LineBasedText=H4.AbstractText=void 0;var ioa=pd(),ooa=ym(),soa=iv(),_ci=uh(),aoa=Vge(),Eci=Apt(),cOe=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new soa.Position(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new _ci.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Eci.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new _ci.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,ooa.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};H4.AbstractText=cOe;var ypt=class extends cOe{static{a(this,"LineBasedText")}constructor(e,r){(0,ioa.assert)(r>=1),super(),this._getLineContent=e,this._lineCount=r}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let r=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let n=e.startLineNumber+1;ne[r-1],e.length)}};H4.ArrayText=pAr;var hAr=class extends cOe{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new yci.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};H4.StringText=hAr});var Eci=I(G4=>{"use strict";p();Object.defineProperty(G4,"__esModule",{value:!0});G4.AnnotationReplacement=G4.Edit=G4.BaseReplacement=G4.BaseEdit=void 0;var soa=Ml(),_ci=Os(),MR=Td(),ypt=class{static{a(this,"BaseEdit")}constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new _ci.BugIndicatingError(`Edits must be disjoint and sorted. Found ${n} after ${r}`);r=n.replaceRange.endExclusive}}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let r=0;rr.toString()).join(", ")}]`}normalize(){let e=[],r;for(let n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(r&&r.replaceRange.endExclusive===n.replaceRange.start){let o=r.tryJoinTouching(n);if(o){r=o;continue}}r&&e.push(r),r=n}return r&&e.push(r),this._createNew(e)}compose(e){let r=this.normalize(),n=e.normalize();if(r.isEmpty())return n;if(n.isEmpty())return r;let o=[...r.replacements],s=[],c=0;for(let l of n.replacements){for(;;){let h=o[0];if(!h||h.replaceRange.start+c+h.getNewLength()>=l.replaceRange.start)break;o.shift(),s.push(h),c+=h.getNewLength()-h.replaceRange.length}let u=c,d,f;for(;;){let h=o[0];if(!h||h.replaceRange.start+c>l.replaceRange.endExclusive)break;d||(d=h),f=h,o.shift(),c+=h.getNewLength()-h.replaceRange.length}if(!d)s.push(l.delta(-c));else{let h=Math.min(d.replaceRange.start,l.replaceRange.start-u),m=l.replaceRange.start-(d.replaceRange.start+u);if(m>0){let _=d.slice(MR.OffsetRange.emptyAt(h),new MR.OffsetRange(0,m));s.push(_)}if(!f)throw new _ci.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let _=f.slice(MR.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new MR.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(_),c-=_.getNewLength()-_.replaceRange.length}let A=new MR.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new MR.OffsetRange(0,l.getNewLength()));s.push(y)}}for(;;){let l=o.shift();if(!l)break;s.push(l)}return this._createNew(s).normalize()}decomposeSplit(e){let r=[],n=[],o=0;for(let s of this.replacements)e(s)?(r.push(s),o+=s.getNewLength()-s.replaceRange.length):n.push(s.slice(s.replaceRange.delta(o),new MR.OffsetRange(0,s.getNewLength())));return{e1:this._createNew(r),e2:this._createNew(n)}}getNewRanges(){let e=[],r=0;for(let n of this.replacements)e.push(MR.OffsetRange.ofStartAndLength(n.replaceRange.start+r,n.getNewLength())),r+=n.getLengthDelta();return e}getJoinedReplaceRange(){if(this.replacements.length!==0)return this.replacements[0].replaceRange.join(this.replacements.at(-1).replaceRange)}isEmpty(){return this.replacements.length===0}getLengthDelta(){return(0,soa.sumBy)(this.replacements,e=>e.getLengthDelta())}getNewDataLength(e){return e+this.getLengthDelta()}applyToOffset(e){let r=0;for(let n of this.replacements)if(n.replaceRange.start<=e){if(e ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new MR.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};G4.BaseReplacement=_pt;var mAr=class t extends ypt{static{a(this,"Edit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}_createNew(e){return new t(e)}};G4.Edit=mAr;var gAr=class t extends _pt{static{a(this,"AnnotationReplacement")}constructor(e,r,n){super(e),this.newLength=r,this.annotation=n}equals(e){return this.replaceRange.equals(e.replaceRange)&&this.newLength===e.newLength&&this.annotation===e.annotation}getNewLength(){return this.newLength}tryJoinTouching(e){if(this.annotation===e.annotation)return new t(this.replaceRange.joinRightTouching(e.replaceRange),this.newLength+e.newLength,this.annotation)}slice(e,r){return new t(e,r?r.length:this.newLength,this.annotation)}};G4.AnnotationReplacement=gAr});var W_=I(yy=>{"use strict";p();Object.defineProperty(yy,"__esModule",{value:!0});yy.AnnotatedStringReplacement=yy.AnnotatedStringEdit=yy.VoidEditData=yy.StringReplacement=yy.StringEdit=yy.BaseStringReplacement=yy.BaseStringEdit=void 0;yy.applyEditsToRanges=coa;var Ept=ym(),CD=Td(),aoa=dI(),Cci=Eci(),lOe=class extends Cci.BaseEdit{static{a(this,"BaseStringEdit")}get TReplacement(){throw new Error("TReplacement is not defined for BaseStringEdit")}static composeOrUndefined(e){if(e.length===0)return;let r=e[0];for(let n=1;n" ".repeat(l-c)),o=r.tryRebase(n);if(!o)return;let s=e.tryRebase(o);if(s)return{e1:o,e2:s}}apply(e){let r=[],n=0;for(let o of this.replacements)r.push(e.substring(n,o.replaceRange.start)),r.push(o.newText),n=o.replaceRange.endExclusive;return r.push(e.substring(n)),r.join("")}inverseOnSlice(e){let r=[],n=0;for(let o of this.replacements)r.push(Lv.replace(CD.OffsetRange.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new $4(r)}inverse(e){return this.inverseOnSlice((r,n)=>e.substring(r,n))}rebaseSkipConflicting(e){return this._tryRebase(e,!1)}tryRebase(e){return this._tryRebase(e,!0)}_tryRebase(e,r){let n=[],o=0,s=0,c=0;for(;se.toJson())}isNeutralOn(e){return this.replacements.every(r=>r.isNeutralOn(e))}removeCommonSuffixPrefix(e){let r=[];for(let n of this.replacements){let o=n.removeCommonSuffixPrefix(e);o.isEmpty||r.push(o)}return new $4(r)}normalizeEOL(e){return new $4(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=Lv.replace(CD.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?$4.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new aoa.StringText(this.apply(e.value))}mapData(e){return new vpt(this.replacements.map(r=>new Kee(r.replaceRange,r.newText,e(r))))}};yy.BaseStringEdit=lOe;var uOe=class extends Cci.BaseReplacement{static{a(this,"BaseStringReplacement")}constructor(e,r){super(e),this.newText=r}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}isNeutralOn(e){return this.newText===e.substring(this.replaceRange.start,this.replaceRange.endExclusive)}removeCommonSuffixPrefix(e){let r=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),n=(0,Ept.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,Ept.commonSuffixLength)(r,this.newText)),s=new CD.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new Lv(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new Lv(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,Ept.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new CD.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,Ept.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new CD.OffsetRange(0,this.newText.length-n))}toEdit(){return new $4([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};yy.BaseStringReplacement=uOe;var $4=class t extends lOe{static{a(this,"StringEdit")}static parse(e){let r=[],n=/\[(\d+),\s*(\d+)\)\s*->\s*"([^"]*)"/g,o;for(;(o=n.exec(e))!==null;){let s=parseInt(o[1],10),c=parseInt(o[2],10),l=o[3].replace(/\\n/g,` -`).replace(/\\r/g,"\r").replace(/\\\\/g,"\\");r.push(new Lv(new CD.OffsetRange(s,c),l))}return new t(r)}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r){return new t([new Lv(e,r)])}static insert(e,r){return new t([new Lv(CD.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new Lv(e,"")])}static fromJson(e){return new t(e.map(Lv.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;n=o.replaceRange.start)break;t.shift(),r.push(c.delta(n))}let s=[];for(;;){let c=t[0];if(!c||!c.intersectsOrTouches(o.replaceRange))break;t.shift(),s.push(c)}for(let c=s.length-1;c>=0;c--){let l=s[c],u=l.intersect(o.replaceRange).length;l=l.deltaEnd(-u+(c===0?o.newText.length:0));let d=l.start-o.replaceRange.start;d>0&&(l=l.delta(-d)),c!==0&&(l=l.delta(o.newText.length)),l=l.delta(-(o.newText.length-o.replaceRange.length)),t.unshift(l)}n+=o.newText.length-o.replaceRange.length}for(;;){let o=t[0];if(!o)break;t.shift(),r.push(o.delta(n))}return r}a(coa,"applyEditsToRanges");var AAr=class{static{a(this,"VoidEditData")}join(e){return this}};yy.VoidEditData=AAr;var vpt=class t extends lOe{static{a(this,"AnnotatedStringEdit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r,n){return new t([new Kee(e,r,n)])}static insert(e,r,n){return new t([new Kee(CD.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new Kee(e,"",r)])}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;n{"use strict";p();Object.defineProperty(Cpt,"__esModule",{value:!0});Cpt.LanguageId=void 0;var bci;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(bci||(Cpt.LanguageId=bci={}))});var Tci=I(DG=>{"use strict";p();Object.defineProperty(DG,"__esModule",{value:!0});DG.EditReasons=DG.TextModelEditReason=DG.EditReason=void 0;var yAr=class t{static{a(this,"EditReason")}static create(e){return e?new t(e):t.unknown}constructor(e){this.metadata=e}static{this.unknown=new t({source:"unknown",name:void 0})}toKey(e){return new dOe(this.metadata,Sci).toKey(e)}};DG.EditReason=yAr;var Sci=Symbol("TextModelEditReason"),dOe=class{static{a(this,"TextModelEditReason")}constructor(e,r){this.metadata=e}toString(){return`${this.metadata.source}`}getType(){let e=this.metadata;switch(e.source){case"cursor":return e.kind;case"inlineCompletionAccept":return e.source+(e.$nes?":nes":"");case"unknown":return e.name||"unknown";default:return e.source}}toKey(e){let r=this.metadata;return Object.entries(r).filter(([o,s])=>(o.match(/\$/g)||[]).length<=e&&s!==void 0&&s!==null&&s!=="").map(([o,s])=>`${o}:${s}`).join("-")}};DG.TextModelEditReason=dOe;function OR(t){return new dOe(t,Sci)}a(OR,"createEditReason");DG.EditReasons={unknown(t){return OR({source:"unknown",name:t.name})},chatApplyEdits(t){return OR({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return OR({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return OR({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return OR({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>OR({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return OR({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>OR({source:"setValue"}),"setValue"),eolChange:a(()=>OR({source:"eolChange"}),"eolChange"),applyEdits:a(()=>OR({source:"applyEdits"}),"applyEdits"),snippet:a(()=>OR({source:"snippet"}),"snippet"),suggest:a(t=>OR({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var Jee=I(V4=>{"use strict";p();Object.defineProperty(V4,"__esModule",{value:!0});V4.MutableObservableDocument=V4.MutableObservableWorkspace=V4.StringEditWithReason=V4.ObservableWorkspace=void 0;var uoa=pd(),Ici=Po(),Bv=o6(),wci=W_(),doa=Td(),foa=dI(),poa=bpt(),xci=Tci(),Spt=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,Bv.derivedHandleChanges)({owner:this,changeTracker:{createChangeSummary:a(()=>({didChange:!1}),"createChangeSummary"),handleChange:a((e,r)=>(e.didChange(this.openDocuments)||(r.didChange=!0),!0),"handleChange")}},(e,r)=>{let n=this.openDocuments.read(e);for(let o of n)o.value.read(e);return r.didChange&&this._version++,this._version}),this.lastActiveDocument=(0,Bv.derivedWithStore)((e,r)=>{let n=(0,Bv.observableValue)("lastActiveDocument",void 0);return r.add((0,Bv.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,Bv.runOnChange)(l.value,()=>{n.set(l,void 0)}))})),n}).flatten()}getFirstOpenDocument(){return this.openDocuments.get()[0]}getDocument(e){return this.openDocuments.get().find(r=>r.id===e)}};V4.ObservableWorkspace=Spt;var Wge=class extends wci.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};V4.StringEditWithReason=Wge;var _Ar=class extends Spt{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,Bv.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,uoa.assert)(!this._documents.has(e.id));let n=new Tpt(e.id,new foa.StringText(e.initialValue??""),[],e.languageId??poa.LanguageId.PlainText,()=>{this._documents.delete(e.id);let o=this._openDocuments.get(),s=o.filter(c=>c.id!==n.id);s.length!==o.length&&this._openDocuments.set(s,r,{added:[],removed:[n]})},e.initialVersionId??0,e.workspaceRoot);return this._documents.set(e.id,n),this._openDocuments.set([...this._openDocuments.get(),n],r,{added:[n],removed:[]}),n}getDocument(e){return this._documents.get(e)}clear(){this._openDocuments.set([],void 0,{added:[],removed:this._openDocuments.get()});for(let e of this._documents.values())e.dispose();this._documents.clear()}getWorkspaceRoot(e){return this._documents.get(e)?.workspaceRoot}};V4.MutableObservableWorkspace=_Ar;var Tpt=class extends Ici.Disposable{static{a(this,"MutableObservableDocument")}get value(){return this._value}get selection(){return this._selection}get primarySelectionLine(){return this._primarySelectionLine}get visibleRanges(){return this._visibleRanges}get languageId(){return this._languageId}get version(){return this._version}get diagnostics(){return this._diagnostics}constructor(e,r,n,o,s,c,l){super(),this.id=e,this.workspaceRoot=l,this._value=(0,Bv.observableValue)(this,r),this._selection=(0,Bv.observableValue)(this,n),this._primarySelectionLine=(0,Bv.observableValue)(this,void 0),this._visibleRanges=(0,Bv.observableValue)(this,[]),this._languageId=(0,Bv.observableValue)(this,o),this._version=(0,Bv.observableValue)(this,c),this._diagnostics=(0,Bv.observableValue)(this,[]),this._register((0,Ici.toDisposable)(s))}setSelection(e,r=void 0,n){this._selection.set(e,r),this._primarySelectionLine.set(n,r)}setVisibleRange(e,r=void 0){this._visibleRanges.set(e,r)}applyEdit(e,r=void 0,n=void 0){let o=e.applyOnText(this.value.get()),s=e instanceof Wge?e:new Wge(e.replacements,xci.EditReason.unknown);(0,Bv.subtransaction)(r,c=>{this._value.set(o,c,s),this._version.set(n??this._version.get()+1,c)})}updateSelection(e,r=void 0,n){this._selection.set(e,r),this._primarySelectionLine.set(n,r)}setValue(e,r=void 0,n=void 0){let o=xci.EditReason.unknown,s=new Wge([wci.StringReplacement.replace(new doa.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,Bv.subtransaction)(r,c=>{this._value.set(e,c,s),this._version.set(n??this._version.get()+1,c)})}updateDiagnostics(e,r=void 0){this._diagnostics.set(e,r)}};V4.MutableObservableDocument=Tpt});var bD=I(Zee=>{"use strict";p();var hoa=Zee&&Zee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),moa=Zee&&Zee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hoa(e,t,r)};Object.defineProperty(Zee,"__esModule",{value:!0});moa(o6(),Zee)});var W4=I(EAr=>{"use strict";p();Object.defineProperty(EAr,"__esModule",{value:!0});EAr.autorunWithChanges=Aoa;var goa=bD();function Aoa(t,e,r){let n=new Map(Object.entries(e).map(([s,c])=>[c,s])),o=new Map(Object.keys(e).map(s=>[s,void 0]));return(0,goa.autorunHandleChanges)({owner:t,changeTracker:{createChangeSummary:a(()=>({}),"createChangeSummary"),handleChange:a((s,c)=>{let l=n.get(s.changedObservable);return c[l]===void 0&&(c[l]={value:void 0,changes:[]}),c[l].changes.push(s.change),!0},"handleChange")}},(s,c)=>{for(let[l,u]of Object.entries(e)){let d=u.read(s);c[l]===void 0&&(c[l]={value:d,changes:[],previous:o.get(l)}),c[l].value=d,c[l].previous=o.get(l)===void 0?void 0:o.get(l),o.set(l,d)}r(c)})}a(Aoa,"autorunWithChanges")});var ac=I(Ey=>{"use strict";p();var YAr=Symbol.for("yaml.alias"),Bli=Symbol.for("yaml.document"),fht=Symbol.for("yaml.map"),Fli=Symbol.for("yaml.pair"),KAr=Symbol.for("yaml.scalar"),pht=Symbol.for("yaml.seq"),u6=Symbol.for("yaml.node.type"),Zsa=a(t=>!!t&&typeof t=="object"&&t[u6]===YAr,"isAlias"),Xsa=a(t=>!!t&&typeof t=="object"&&t[u6]===Bli,"isDocument"),eaa=a(t=>!!t&&typeof t=="object"&&t[u6]===fht,"isMap"),taa=a(t=>!!t&&typeof t=="object"&&t[u6]===Fli,"isPair"),Uli=a(t=>!!t&&typeof t=="object"&&t[u6]===KAr,"isScalar"),raa=a(t=>!!t&&typeof t=="object"&&t[u6]===pht,"isSeq");function Qli(t){if(t&&typeof t=="object")switch(t[u6]){case fht:case pht:return!0}return!1}a(Qli,"isCollection");function naa(t){if(t&&typeof t=="object")switch(t[u6]){case YAr:case fht:case KAr:case pht:return!0}return!1}a(naa,"isNode");var iaa=a(t=>(Uli(t)||Qli(t))&&!!t.anchor,"hasAnchor");Ey.ALIAS=YAr;Ey.DOC=Bli;Ey.MAP=fht;Ey.NODE_TYPE=u6;Ey.PAIR=Fli;Ey.SCALAR=KAr;Ey.SEQ=pht;Ey.hasAnchor=iaa;Ey.isAlias=Zsa;Ey.isCollection=Qli;Ey.isDocument=Xsa;Ey.isMap=eaa;Ey.isNode=naa;Ey.isPair=taa;Ey.isScalar=Uli;Ey.isSeq=raa});var COe=I(JAr=>{"use strict";p();var Dg=ac(),nS=Symbol("break visit"),qli=Symbol("skip children"),J4=Symbol("remove node");function hht(t,e){let r=jli(e);Dg.isDocument(t)?e0e(null,t.contents,r,Object.freeze([t]))===J4&&(t.contents=null):e0e(null,t,r,Object.freeze([]))}a(hht,"visit");hht.BREAK=nS;hht.SKIP=qli;hht.REMOVE=J4;function e0e(t,e,r,n){let o=Hli(t,e,r,n);if(Dg.isNode(o)||Dg.isPair(o))return Gli(t,n,o),e0e(t,o,r,n);if(typeof o!="symbol"){if(Dg.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var $li=ac(),oaa=COe(),saa={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},aaa=a(t=>t.replace(/[!,[\]{}]/g,e=>saa[e]),"escapeTagName"),bOe=class t{static{a(this,"Directives")}constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),o=n.shift();switch(o){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,c]=n;return this.tags[s]=c,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let c=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,c),!1}}default:return r(0,`Unknown directive ${o}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let c=e.slice(2,-1);return c==="!"||c==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),c)}let[,n,o]=e.match(/^(.*!)([^!]*)$/s);o||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(o)}catch(c){return r(String(c)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+aaa(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),o;if(e&&n.length>0&&$li.isNode(e.contents)){let s={};oaa.visit(e.contents,(c,l)=>{$li.isNode(l)&&l.tag&&(s[l.tag]=!0)}),o=Object.keys(s)}else o=[];for(let[s,c]of n)s==="!!"&&c==="tag:yaml.org,2002:"||(!e||o.some(l=>l.startsWith(c)))&&r.push(`%TAG ${s} ${c}`);return r.join(` -`)}};bOe.defaultYaml={explicit:!1,version:"1.2"};bOe.defaultTags={"!!":"tag:yaml.org,2002:"};Vli.Directives=bOe});var ght=I(SOe=>{"use strict";p();var Wli=ac(),caa=COe();function laa(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}a(laa,"anchorIsValid");function zli(t){let e=new Set;return caa.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(zli,"anchorNames");function Yli(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(Yli,"findNewAnchor");function uaa(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=zli(t));let c=Yli(e,o);return o.add(c),c},"onAnchor"),setAnchors:a(()=>{for(let s of r){let c=n.get(s);if(typeof c=="object"&&c.anchor&&(Wli.isScalar(c.node)||Wli.isCollection(c.node)))c.node.anchor=c.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},"setAnchors"),sourceObjects:n}}a(uaa,"createNodeAnchors");SOe.anchorIsValid=laa;SOe.anchorNames=zli;SOe.createNodeAnchors=uaa;SOe.findNewAnchor=Yli});var XAr=I(Kli=>{"use strict";p();function TOe(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let o=0,s=n.length;o{"use strict";p();var daa=ac();function Jli(t,e,r){if(Array.isArray(t))return t.map((n,o)=>Jli(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!daa.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let o=t.toJSON(e,r);return r.onCreate&&r.onCreate(o),o}return typeof t=="bigint"&&!r?.keep?Number(t):t}a(Jli,"toJS");Zli.toJS=Jli});var Aht=I(eui=>{"use strict";p();var faa=XAr(),Xli=ac(),paa=LG(),eyr=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,Xli.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:o,reviver:s}={}){if(!Xli.isDocument(e))throw new TypeError("A document argument is required");let c={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=paa.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?faa.applyReviver(s,{"":l},"",l):l}};eui.NodeBase=eyr});var IOe=I(tui=>{"use strict";p();var haa=ght(),maa=COe(),r0e=ac(),gaa=Aht(),Aaa=LG(),tyr=class extends gaa.NodeBase{static{a(this,"Alias")}constructor(e){super(r0e.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],maa.visit(e,{Node:a((s,c)=>{(r0e.isAlias(c)||r0e.hasAnchor(c))&&n.push(c)},"Node")}),r&&(r.aliasResolveCache=n));let o;for(let s of n){if(s===this)break;s.anchor===this.source&&(o=s)}return o}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:o,maxAliasCount:s}=r,c=this.resolve(o,r);if(!c){let u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let l=n.get(c);if(l||(Aaa.toJS(c,null,r),l=n.get(c)),l?.res===void 0){let u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=yht(o,c,n)),l.count*l.aliasCount>s)){let u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return l.res}toString(e,r,n){let o=`*${this.source}`;if(e){if(haa.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${o} `}return o}};function yht(t,e,r){if(r0e.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(r0e.isCollection(e)){let n=0;for(let o of e.items){let s=yht(t,o,r);s>n&&(n=s)}return n}else if(r0e.isPair(e)){let n=yht(t,e.key,r),o=yht(t,e.value,r);return Math.max(n,o)}return 1}a(yht,"getAliasCount");tui.Alias=tyr});var Pm=I(ryr=>{"use strict";p();var yaa=ac(),_aa=Aht(),Eaa=LG(),vaa=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),BG=class extends _aa.NodeBase{static{a(this,"Scalar")}constructor(e){super(yaa.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Eaa.toJS(this.value,e,r)}toString(){return String(this.value)}};BG.BLOCK_FOLDED="BLOCK_FOLDED";BG.BLOCK_LITERAL="BLOCK_LITERAL";BG.PLAIN="PLAIN";BG.QUOTE_DOUBLE="QUOTE_DOUBLE";BG.QUOTE_SINGLE="QUOTE_SINGLE";ryr.Scalar=BG;ryr.isScalarValue=vaa});var xOe=I(nui=>{"use strict";p();var Caa=IOe(),ite=ac(),rui=Pm(),baa="tag:yaml.org,2002:";function Saa(t,e,r){if(e){let n=r.filter(s=>s.tag===e),o=n.find(s=>!s.format)??n[0];if(!o)throw new Error(`Tag ${e} not found`);return o}return r.find(n=>n.identify?.(t)&&!n.format)}a(Saa,"findTagObject");function Taa(t,e,r){if(ite.isDocument(t)&&(t=t.contents),ite.isNode(t))return t;if(ite.isPair(t)){let h=r.schema[ite.MAP].createNode?.(r.schema,null,r);return h.items.push(t),h}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:o,onTagObj:s,schema:c,sourceObjects:l}=r,u;if(n&&t&&typeof t=="object"){if(u=l.get(t),u)return u.anchor??(u.anchor=o(t)),new Caa.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=baa+e.slice(2));let d=Saa(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new rui.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[ite.MAP]:Symbol.iterator in Object(t)?c[ite.SEQ]:c[ite.MAP]}s&&(s(d),delete r.onTagObj);let f=d?.createNode?d.createNode(r.schema,t,r):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(r.schema,t,r):new rui.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(Taa,"createNode");nui.createNode=Taa});var Eht=I(_ht=>{"use strict";p();var Iaa=xOe(),Z4=ac(),xaa=Aht();function nyr(t,e,r){let n=r;for(let o=e.length-1;o>=0;--o){let s=e[o];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let c=[];c[s]=n,n=c}else n=new Map([[s,n]])}return Iaa.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:a(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:t,sourceObjects:new Map})}a(nyr,"collectionFromPath");var iui=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),iyr=class extends xaa.NodeBase{static{a(this,"Collection")}constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Z4.isNode(n)||Z4.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(iui(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(Z4.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,nyr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let o=this.get(r,!0);if(Z4.isCollection(o))return o.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...o]=e,s=this.get(n,!0);return o.length===0?!r&&Z4.isScalar(s)?s.value:s:Z4.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Z4.isPair(r))return!1;let n=r.value;return n==null||e&&Z4.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let o=this.get(r,!0);return Z4.isCollection(o)?o.hasIn(n):!1}setIn(e,r){let[n,...o]=e;if(o.length===0)this.set(n,r);else{let s=this.get(n,!0);if(Z4.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,nyr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};_ht.Collection=iyr;_ht.collectionFromPath=nyr;_ht.isEmptyPath=iui});var wOe=I(vht=>{"use strict";p();var waa=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function oyr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(oyr,"indentComment");var Raa=a((t,e,r)=>t.endsWith(` -`)?oyr(r,e):r.includes(` +`+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1),r}getLineLength(e){return this._getLineContent(e).length}get length(){let e=this._getLineContent(this._lineCount);return new aoa.TextLength(this._lineCount-1,e.length)}};H4.LineBasedText=ypt;var hAr=class extends ypt{static{a(this,"ArrayText")}constructor(e){super(r=>e[r-1],e.length)}};H4.ArrayText=hAr;var mAr=class extends cOe{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new Eci.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};H4.StringText=mAr});var Cci=I(G4=>{"use strict";p();Object.defineProperty(G4,"__esModule",{value:!0});G4.AnnotationReplacement=G4.Edit=G4.BaseReplacement=G4.BaseEdit=void 0;var coa=Ml(),vci=Os(),MR=Id(),_pt=class{static{a(this,"BaseEdit")}constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new vci.BugIndicatingError(`Edits must be disjoint and sorted. Found ${n} after ${r}`);r=n.replaceRange.endExclusive}}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let r=0;rr.toString()).join(", ")}]`}normalize(){let e=[],r;for(let n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(r&&r.replaceRange.endExclusive===n.replaceRange.start){let o=r.tryJoinTouching(n);if(o){r=o;continue}}r&&e.push(r),r=n}return r&&e.push(r),this._createNew(e)}compose(e){let r=this.normalize(),n=e.normalize();if(r.isEmpty())return n;if(n.isEmpty())return r;let o=[...r.replacements],s=[],c=0;for(let l of n.replacements){for(;;){let h=o[0];if(!h||h.replaceRange.start+c+h.getNewLength()>=l.replaceRange.start)break;o.shift(),s.push(h),c+=h.getNewLength()-h.replaceRange.length}let u=c,d,f;for(;;){let h=o[0];if(!h||h.replaceRange.start+c>l.replaceRange.endExclusive)break;d||(d=h),f=h,o.shift(),c+=h.getNewLength()-h.replaceRange.length}if(!d)s.push(l.delta(-c));else{let h=Math.min(d.replaceRange.start,l.replaceRange.start-u),m=l.replaceRange.start-(d.replaceRange.start+u);if(m>0){let _=d.slice(MR.OffsetRange.emptyAt(h),new MR.OffsetRange(0,m));s.push(_)}if(!f)throw new vci.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let _=f.slice(MR.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new MR.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(_),c-=_.getNewLength()-_.replaceRange.length}let A=new MR.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new MR.OffsetRange(0,l.getNewLength()));s.push(y)}}for(;;){let l=o.shift();if(!l)break;s.push(l)}return this._createNew(s).normalize()}decomposeSplit(e){let r=[],n=[],o=0;for(let s of this.replacements)e(s)?(r.push(s),o+=s.getNewLength()-s.replaceRange.length):n.push(s.slice(s.replaceRange.delta(o),new MR.OffsetRange(0,s.getNewLength())));return{e1:this._createNew(r),e2:this._createNew(n)}}getNewRanges(){let e=[],r=0;for(let n of this.replacements)e.push(MR.OffsetRange.ofStartAndLength(n.replaceRange.start+r,n.getNewLength())),r+=n.getLengthDelta();return e}getJoinedReplaceRange(){if(this.replacements.length!==0)return this.replacements[0].replaceRange.join(this.replacements.at(-1).replaceRange)}isEmpty(){return this.replacements.length===0}getLengthDelta(){return(0,coa.sumBy)(this.replacements,e=>e.getLengthDelta())}getNewDataLength(e){return e+this.getLengthDelta()}applyToOffset(e){let r=0;for(let n of this.replacements)if(n.replaceRange.start<=e){if(e ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new MR.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};G4.BaseReplacement=Ept;var gAr=class t extends _pt{static{a(this,"Edit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}_createNew(e){return new t(e)}};G4.Edit=gAr;var AAr=class t extends Ept{static{a(this,"AnnotationReplacement")}constructor(e,r,n){super(e),this.newLength=r,this.annotation=n}equals(e){return this.replaceRange.equals(e.replaceRange)&&this.newLength===e.newLength&&this.annotation===e.annotation}getNewLength(){return this.newLength}tryJoinTouching(e){if(this.annotation===e.annotation)return new t(this.replaceRange.joinRightTouching(e.replaceRange),this.newLength+e.newLength,this.annotation)}slice(e,r){return new t(e,r?r.length:this.newLength,this.annotation)}};G4.AnnotationReplacement=AAr});var W_=I(yy=>{"use strict";p();Object.defineProperty(yy,"__esModule",{value:!0});yy.AnnotatedStringReplacement=yy.AnnotatedStringEdit=yy.VoidEditData=yy.StringReplacement=yy.StringEdit=yy.BaseStringReplacement=yy.BaseStringEdit=void 0;yy.applyEditsToRanges=uoa;var vpt=ym(),CD=Id(),loa=dI(),Sci=Cci(),lOe=class extends Sci.BaseEdit{static{a(this,"BaseStringEdit")}get TReplacement(){throw new Error("TReplacement is not defined for BaseStringEdit")}static composeOrUndefined(e){if(e.length===0)return;let r=e[0];for(let n=1;n" ".repeat(l-c)),o=r.tryRebase(n);if(!o)return;let s=e.tryRebase(o);if(s)return{e1:o,e2:s}}apply(e){let r=[],n=0;for(let o of this.replacements)r.push(e.substring(n,o.replaceRange.start)),r.push(o.newText),n=o.replaceRange.endExclusive;return r.push(e.substring(n)),r.join("")}inverseOnSlice(e){let r=[],n=0;for(let o of this.replacements)r.push(Lv.replace(CD.OffsetRange.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new $4(r)}inverse(e){return this.inverseOnSlice((r,n)=>e.substring(r,n))}rebaseSkipConflicting(e){return this._tryRebase(e,!1)}tryRebase(e){return this._tryRebase(e,!0)}_tryRebase(e,r){let n=[],o=0,s=0,c=0;for(;se.toJson())}isNeutralOn(e){return this.replacements.every(r=>r.isNeutralOn(e))}removeCommonSuffixPrefix(e){let r=[];for(let n of this.replacements){let o=n.removeCommonSuffixPrefix(e);o.isEmpty||r.push(o)}return new $4(r)}normalizeEOL(e){return new $4(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=Lv.replace(CD.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?$4.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new loa.StringText(this.apply(e.value))}mapData(e){return new Cpt(this.replacements.map(r=>new Jee(r.replaceRange,r.newText,e(r))))}};yy.BaseStringEdit=lOe;var uOe=class extends Sci.BaseReplacement{static{a(this,"BaseStringReplacement")}constructor(e,r){super(e),this.newText=r}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}isNeutralOn(e){return this.newText===e.substring(this.replaceRange.start,this.replaceRange.endExclusive)}removeCommonSuffixPrefix(e){let r=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),n=(0,vpt.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,vpt.commonSuffixLength)(r,this.newText)),s=new CD.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new Lv(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new Lv(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,vpt.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new CD.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,vpt.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new CD.OffsetRange(0,this.newText.length-n))}toEdit(){return new $4([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};yy.BaseStringReplacement=uOe;var $4=class t extends lOe{static{a(this,"StringEdit")}static parse(e){let r=[],n=/\[(\d+),\s*(\d+)\)\s*->\s*"([^"]*)"/g,o;for(;(o=n.exec(e))!==null;){let s=parseInt(o[1],10),c=parseInt(o[2],10),l=o[3].replace(/\\n/g,` +`).replace(/\\r/g,"\r").replace(/\\\\/g,"\\");r.push(new Lv(new CD.OffsetRange(s,c),l))}return new t(r)}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r){return new t([new Lv(e,r)])}static insert(e,r){return new t([new Lv(CD.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new Lv(e,"")])}static fromJson(e){return new t(e.map(Lv.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;n=o.replaceRange.start)break;t.shift(),r.push(c.delta(n))}let s=[];for(;;){let c=t[0];if(!c||!c.intersectsOrTouches(o.replaceRange))break;t.shift(),s.push(c)}for(let c=s.length-1;c>=0;c--){let l=s[c],u=l.intersect(o.replaceRange).length;l=l.deltaEnd(-u+(c===0?o.newText.length:0));let d=l.start-o.replaceRange.start;d>0&&(l=l.delta(-d)),c!==0&&(l=l.delta(o.newText.length)),l=l.delta(-(o.newText.length-o.replaceRange.length)),t.unshift(l)}n+=o.newText.length-o.replaceRange.length}for(;;){let o=t[0];if(!o)break;t.shift(),r.push(o.delta(n))}return r}a(uoa,"applyEditsToRanges");var yAr=class{static{a(this,"VoidEditData")}join(e){return this}};yy.VoidEditData=yAr;var Cpt=class t extends lOe{static{a(this,"AnnotatedStringEdit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r,n){return new t([new Jee(e,r,n)])}static insert(e,r,n){return new t([new Jee(CD.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new Jee(e,"",r)])}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;n{"use strict";p();Object.defineProperty(bpt,"__esModule",{value:!0});bpt.LanguageId=void 0;var Tci;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(Tci||(bpt.LanguageId=Tci={}))});var xci=I(NG=>{"use strict";p();Object.defineProperty(NG,"__esModule",{value:!0});NG.EditReasons=NG.TextModelEditReason=NG.EditReason=void 0;var _Ar=class t{static{a(this,"EditReason")}static create(e){return e?new t(e):t.unknown}constructor(e){this.metadata=e}static{this.unknown=new t({source:"unknown",name:void 0})}toKey(e){return new dOe(this.metadata,Ici).toKey(e)}};NG.EditReason=_Ar;var Ici=Symbol("TextModelEditReason"),dOe=class{static{a(this,"TextModelEditReason")}constructor(e,r){this.metadata=e}toString(){return`${this.metadata.source}`}getType(){let e=this.metadata;switch(e.source){case"cursor":return e.kind;case"inlineCompletionAccept":return e.source+(e.$nes?":nes":"");case"unknown":return e.name||"unknown";default:return e.source}}toKey(e){let r=this.metadata;return Object.entries(r).filter(([o,s])=>(o.match(/\$/g)||[]).length<=e&&s!==void 0&&s!==null&&s!=="").map(([o,s])=>`${o}:${s}`).join("-")}};NG.TextModelEditReason=dOe;function OR(t){return new dOe(t,Ici)}a(OR,"createEditReason");NG.EditReasons={unknown(t){return OR({source:"unknown",name:t.name})},chatApplyEdits(t){return OR({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return OR({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return OR({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return OR({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>OR({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return OR({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>OR({source:"setValue"}),"setValue"),eolChange:a(()=>OR({source:"eolChange"}),"eolChange"),applyEdits:a(()=>OR({source:"applyEdits"}),"applyEdits"),snippet:a(()=>OR({source:"snippet"}),"snippet"),suggest:a(t=>OR({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var Zee=I(V4=>{"use strict";p();Object.defineProperty(V4,"__esModule",{value:!0});V4.MutableObservableDocument=V4.MutableObservableWorkspace=V4.StringEditWithReason=V4.ObservableWorkspace=void 0;var foa=pd(),wci=Po(),Bv=o6(),kci=W_(),poa=Id(),hoa=dI(),moa=Spt(),Rci=xci(),Tpt=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,Bv.derivedHandleChanges)({owner:this,changeTracker:{createChangeSummary:a(()=>({didChange:!1}),"createChangeSummary"),handleChange:a((e,r)=>(e.didChange(this.openDocuments)||(r.didChange=!0),!0),"handleChange")}},(e,r)=>{let n=this.openDocuments.read(e);for(let o of n)o.value.read(e);return r.didChange&&this._version++,this._version}),this.lastActiveDocument=(0,Bv.derivedWithStore)((e,r)=>{let n=(0,Bv.observableValue)("lastActiveDocument",void 0);return r.add((0,Bv.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,Bv.runOnChange)(l.value,()=>{n.set(l,void 0)}))})),n}).flatten()}getFirstOpenDocument(){return this.openDocuments.get()[0]}getDocument(e){return this.openDocuments.get().find(r=>r.id===e)}};V4.ObservableWorkspace=Tpt;var Wge=class extends kci.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};V4.StringEditWithReason=Wge;var EAr=class extends Tpt{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,Bv.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,foa.assert)(!this._documents.has(e.id));let n=new Ipt(e.id,new hoa.StringText(e.initialValue??""),[],e.languageId??moa.LanguageId.PlainText,()=>{this._documents.delete(e.id);let o=this._openDocuments.get(),s=o.filter(c=>c.id!==n.id);s.length!==o.length&&this._openDocuments.set(s,r,{added:[],removed:[n]})},e.initialVersionId??0,e.workspaceRoot);return this._documents.set(e.id,n),this._openDocuments.set([...this._openDocuments.get(),n],r,{added:[n],removed:[]}),n}getDocument(e){return this._documents.get(e)}clear(){this._openDocuments.set([],void 0,{added:[],removed:this._openDocuments.get()});for(let e of this._documents.values())e.dispose();this._documents.clear()}getWorkspaceRoot(e){return this._documents.get(e)?.workspaceRoot}};V4.MutableObservableWorkspace=EAr;var Ipt=class extends wci.Disposable{static{a(this,"MutableObservableDocument")}get value(){return this._value}get selection(){return this._selection}get primarySelectionLine(){return this._primarySelectionLine}get visibleRanges(){return this._visibleRanges}get languageId(){return this._languageId}get version(){return this._version}get diagnostics(){return this._diagnostics}constructor(e,r,n,o,s,c,l){super(),this.id=e,this.workspaceRoot=l,this._value=(0,Bv.observableValue)(this,r),this._selection=(0,Bv.observableValue)(this,n),this._primarySelectionLine=(0,Bv.observableValue)(this,void 0),this._visibleRanges=(0,Bv.observableValue)(this,[]),this._languageId=(0,Bv.observableValue)(this,o),this._version=(0,Bv.observableValue)(this,c),this._diagnostics=(0,Bv.observableValue)(this,[]),this._register((0,wci.toDisposable)(s))}setSelection(e,r=void 0,n){this._selection.set(e,r),this._primarySelectionLine.set(n,r)}setVisibleRange(e,r=void 0){this._visibleRanges.set(e,r)}applyEdit(e,r=void 0,n=void 0){let o=e.applyOnText(this.value.get()),s=e instanceof Wge?e:new Wge(e.replacements,Rci.EditReason.unknown);(0,Bv.subtransaction)(r,c=>{this._value.set(o,c,s),this._version.set(n??this._version.get()+1,c)})}updateSelection(e,r=void 0,n){this._selection.set(e,r),this._primarySelectionLine.set(n,r)}setValue(e,r=void 0,n=void 0){let o=Rci.EditReason.unknown,s=new Wge([kci.StringReplacement.replace(new poa.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,Bv.subtransaction)(r,c=>{this._value.set(e,c,s),this._version.set(n??this._version.get()+1,c)})}updateDiagnostics(e,r=void 0){this._diagnostics.set(e,r)}};V4.MutableObservableDocument=Ipt});var bD=I(Xee=>{"use strict";p();var goa=Xee&&Xee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Aoa=Xee&&Xee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&goa(e,t,r)};Object.defineProperty(Xee,"__esModule",{value:!0});Aoa(o6(),Xee)});var W4=I(vAr=>{"use strict";p();Object.defineProperty(vAr,"__esModule",{value:!0});vAr.autorunWithChanges=_oa;var yoa=bD();function _oa(t,e,r){let n=new Map(Object.entries(e).map(([s,c])=>[c,s])),o=new Map(Object.keys(e).map(s=>[s,void 0]));return(0,yoa.autorunHandleChanges)({owner:t,changeTracker:{createChangeSummary:a(()=>({}),"createChangeSummary"),handleChange:a((s,c)=>{let l=n.get(s.changedObservable);return c[l]===void 0&&(c[l]={value:void 0,changes:[]}),c[l].changes.push(s.change),!0},"handleChange")}},(s,c)=>{for(let[l,u]of Object.entries(e)){let d=u.read(s);c[l]===void 0&&(c[l]={value:d,changes:[],previous:o.get(l)}),c[l].value=d,c[l].previous=o.get(l)===void 0?void 0:o.get(l),o.set(l,d)}r(c)})}a(_oa,"autorunWithChanges")});var ac=I(Ey=>{"use strict";p();var KAr=Symbol.for("yaml.alias"),Uli=Symbol.for("yaml.document"),pht=Symbol.for("yaml.map"),Qli=Symbol.for("yaml.pair"),JAr=Symbol.for("yaml.scalar"),hht=Symbol.for("yaml.seq"),u6=Symbol.for("yaml.node.type"),eaa=a(t=>!!t&&typeof t=="object"&&t[u6]===KAr,"isAlias"),taa=a(t=>!!t&&typeof t=="object"&&t[u6]===Uli,"isDocument"),raa=a(t=>!!t&&typeof t=="object"&&t[u6]===pht,"isMap"),naa=a(t=>!!t&&typeof t=="object"&&t[u6]===Qli,"isPair"),qli=a(t=>!!t&&typeof t=="object"&&t[u6]===JAr,"isScalar"),iaa=a(t=>!!t&&typeof t=="object"&&t[u6]===hht,"isSeq");function jli(t){if(t&&typeof t=="object")switch(t[u6]){case pht:case hht:return!0}return!1}a(jli,"isCollection");function oaa(t){if(t&&typeof t=="object")switch(t[u6]){case KAr:case pht:case JAr:case hht:return!0}return!1}a(oaa,"isNode");var saa=a(t=>(qli(t)||jli(t))&&!!t.anchor,"hasAnchor");Ey.ALIAS=KAr;Ey.DOC=Uli;Ey.MAP=pht;Ey.NODE_TYPE=u6;Ey.PAIR=Qli;Ey.SCALAR=JAr;Ey.SEQ=hht;Ey.hasAnchor=saa;Ey.isAlias=eaa;Ey.isCollection=jli;Ey.isDocument=taa;Ey.isMap=raa;Ey.isNode=oaa;Ey.isPair=naa;Ey.isScalar=qli;Ey.isSeq=iaa});var COe=I(ZAr=>{"use strict";p();var Ng=ac(),nS=Symbol("break visit"),Hli=Symbol("skip children"),J4=Symbol("remove node");function mht(t,e){let r=Gli(e);Ng.isDocument(t)?e0e(null,t.contents,r,Object.freeze([t]))===J4&&(t.contents=null):e0e(null,t,r,Object.freeze([]))}a(mht,"visit");mht.BREAK=nS;mht.SKIP=Hli;mht.REMOVE=J4;function e0e(t,e,r,n){let o=$li(t,e,r,n);if(Ng.isNode(o)||Ng.isPair(o))return Vli(t,n,o),e0e(t,o,r,n);if(typeof o!="symbol"){if(Ng.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var Wli=ac(),aaa=COe(),caa={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},laa=a(t=>t.replace(/[!,[\]{}]/g,e=>caa[e]),"escapeTagName"),bOe=class t{static{a(this,"Directives")}constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),o=n.shift();switch(o){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,c]=n;return this.tags[s]=c,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let c=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,c),!1}}default:return r(0,`Unknown directive ${o}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let c=e.slice(2,-1);return c==="!"||c==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),c)}let[,n,o]=e.match(/^(.*!)([^!]*)$/s);o||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(o)}catch(c){return r(String(c)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+laa(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),o;if(e&&n.length>0&&Wli.isNode(e.contents)){let s={};aaa.visit(e.contents,(c,l)=>{Wli.isNode(l)&&l.tag&&(s[l.tag]=!0)}),o=Object.keys(s)}else o=[];for(let[s,c]of n)s==="!!"&&c==="tag:yaml.org,2002:"||(!e||o.some(l=>l.startsWith(c)))&&r.push(`%TAG ${s} ${c}`);return r.join(` +`)}};bOe.defaultYaml={explicit:!1,version:"1.2"};bOe.defaultTags={"!!":"tag:yaml.org,2002:"};zli.Directives=bOe});var Aht=I(SOe=>{"use strict";p();var Yli=ac(),uaa=COe();function daa(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}a(daa,"anchorIsValid");function Kli(t){let e=new Set;return uaa.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(Kli,"anchorNames");function Jli(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(Jli,"findNewAnchor");function faa(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=Kli(t));let c=Jli(e,o);return o.add(c),c},"onAnchor"),setAnchors:a(()=>{for(let s of r){let c=n.get(s);if(typeof c=="object"&&c.anchor&&(Yli.isScalar(c.node)||Yli.isCollection(c.node)))c.node.anchor=c.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},"setAnchors"),sourceObjects:n}}a(faa,"createNodeAnchors");SOe.anchorIsValid=daa;SOe.anchorNames=Kli;SOe.createNodeAnchors=faa;SOe.findNewAnchor=Jli});var eyr=I(Zli=>{"use strict";p();function TOe(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let o=0,s=n.length;o{"use strict";p();var paa=ac();function Xli(t,e,r){if(Array.isArray(t))return t.map((n,o)=>Xli(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!paa.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let o=t.toJSON(e,r);return r.onCreate&&r.onCreate(o),o}return typeof t=="bigint"&&!r?.keep?Number(t):t}a(Xli,"toJS");eui.toJS=Xli});var yht=I(rui=>{"use strict";p();var haa=eyr(),tui=ac(),maa=BG(),tyr=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,tui.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:o,reviver:s}={}){if(!tui.isDocument(e))throw new TypeError("A document argument is required");let c={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=maa.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?haa.applyReviver(s,{"":l},"",l):l}};rui.NodeBase=tyr});var IOe=I(nui=>{"use strict";p();var gaa=Aht(),Aaa=COe(),r0e=ac(),yaa=yht(),_aa=BG(),ryr=class extends yaa.NodeBase{static{a(this,"Alias")}constructor(e){super(r0e.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Aaa.visit(e,{Node:a((s,c)=>{(r0e.isAlias(c)||r0e.hasAnchor(c))&&n.push(c)},"Node")}),r&&(r.aliasResolveCache=n));let o;for(let s of n){if(s===this)break;s.anchor===this.source&&(o=s)}return o}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:o,maxAliasCount:s}=r,c=this.resolve(o,r);if(!c){let u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let l=n.get(c);if(l||(_aa.toJS(c,null,r),l=n.get(c)),l?.res===void 0){let u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=_ht(o,c,n)),l.count*l.aliasCount>s)){let u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return l.res}toString(e,r,n){let o=`*${this.source}`;if(e){if(gaa.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${o} `}return o}};function _ht(t,e,r){if(r0e.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(r0e.isCollection(e)){let n=0;for(let o of e.items){let s=_ht(t,o,r);s>n&&(n=s)}return n}else if(r0e.isPair(e)){let n=_ht(t,e.key,r),o=_ht(t,e.value,r);return Math.max(n,o)}return 1}a(_ht,"getAliasCount");nui.Alias=ryr});var Dm=I(nyr=>{"use strict";p();var Eaa=ac(),vaa=yht(),Caa=BG(),baa=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),FG=class extends vaa.NodeBase{static{a(this,"Scalar")}constructor(e){super(Eaa.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Caa.toJS(this.value,e,r)}toString(){return String(this.value)}};FG.BLOCK_FOLDED="BLOCK_FOLDED";FG.BLOCK_LITERAL="BLOCK_LITERAL";FG.PLAIN="PLAIN";FG.QUOTE_DOUBLE="QUOTE_DOUBLE";FG.QUOTE_SINGLE="QUOTE_SINGLE";nyr.Scalar=FG;nyr.isScalarValue=baa});var xOe=I(oui=>{"use strict";p();var Saa=IOe(),ote=ac(),iui=Dm(),Taa="tag:yaml.org,2002:";function Iaa(t,e,r){if(e){let n=r.filter(s=>s.tag===e),o=n.find(s=>!s.format)??n[0];if(!o)throw new Error(`Tag ${e} not found`);return o}return r.find(n=>n.identify?.(t)&&!n.format)}a(Iaa,"findTagObject");function xaa(t,e,r){if(ote.isDocument(t)&&(t=t.contents),ote.isNode(t))return t;if(ote.isPair(t)){let h=r.schema[ote.MAP].createNode?.(r.schema,null,r);return h.items.push(t),h}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:o,onTagObj:s,schema:c,sourceObjects:l}=r,u;if(n&&t&&typeof t=="object"){if(u=l.get(t),u)return u.anchor??(u.anchor=o(t)),new Saa.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=Taa+e.slice(2));let d=Iaa(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new iui.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[ote.MAP]:Symbol.iterator in Object(t)?c[ote.SEQ]:c[ote.MAP]}s&&(s(d),delete r.onTagObj);let f=d?.createNode?d.createNode(r.schema,t,r):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(r.schema,t,r):new iui.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(xaa,"createNode");oui.createNode=xaa});var vht=I(Eht=>{"use strict";p();var waa=xOe(),Z4=ac(),Raa=yht();function iyr(t,e,r){let n=r;for(let o=e.length-1;o>=0;--o){let s=e[o];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let c=[];c[s]=n,n=c}else n=new Map([[s,n]])}return waa.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:a(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:t,sourceObjects:new Map})}a(iyr,"collectionFromPath");var sui=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),oyr=class extends Raa.NodeBase{static{a(this,"Collection")}constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Z4.isNode(n)||Z4.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(sui(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(Z4.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,iyr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let o=this.get(r,!0);if(Z4.isCollection(o))return o.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...o]=e,s=this.get(n,!0);return o.length===0?!r&&Z4.isScalar(s)?s.value:s:Z4.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Z4.isPair(r))return!1;let n=r.value;return n==null||e&&Z4.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let o=this.get(r,!0);return Z4.isCollection(o)?o.hasIn(n):!1}setIn(e,r){let[n,...o]=e;if(o.length===0)this.set(n,r);else{let s=this.get(n,!0);if(Z4.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,iyr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};Eht.Collection=oyr;Eht.collectionFromPath=iyr;Eht.isEmptyPath=sui});var wOe=I(Cht=>{"use strict";p();var kaa=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function syr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(syr,"indentComment");var Paa=a((t,e,r)=>t.endsWith(` +`)?syr(r,e):r.includes(` `)?` -`+oyr(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");vht.indentComment=oyr;vht.lineComment=Raa;vht.stringifyComment=waa});var sui=I(ROe=>{"use strict";p();var kaa="flow",syr="block",Cht="quoted";function Paa(t,e,r="flow",{indentAtStart:n,lineWidth:o=80,minContentWidth:s=20,onFold:c,onOverflow:l}={}){if(!o||o<0)return t;oo-Math.max(2,s)?d.push(0):h=o-n);let m,g,A=!1,y=-1,_=-1,E=-1;r===syr&&(y=oui(t,y,e.length),y!==-1&&(h=y+u));for(let S;S=t[y+=1];){if(r===Cht&&S==="\\"){switch(_=y,t[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}E=y}if(S===` -`)r===syr&&(y=oui(t,y,e.length)),h=y+e.length+u,m=void 0;else{if(S===" "&&g&&g!==" "&&g!==` +`+syr(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");Cht.indentComment=syr;Cht.lineComment=Paa;Cht.stringifyComment=kaa});var cui=I(ROe=>{"use strict";p();var Daa="flow",ayr="block",bht="quoted";function Naa(t,e,r="flow",{indentAtStart:n,lineWidth:o=80,minContentWidth:s=20,onFold:c,onOverflow:l}={}){if(!o||o<0)return t;oo-Math.max(2,s)?d.push(0):h=o-n);let m,g,A=!1,y=-1,_=-1,E=-1;r===ayr&&(y=aui(t,y,e.length),y!==-1&&(h=y+u));for(let S;S=t[y+=1];){if(r===bht&&S==="\\"){switch(_=y,t[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}E=y}if(S===` +`)r===ayr&&(y=aui(t,y,e.length)),h=y+e.length+u,m=void 0;else{if(S===" "&&g&&g!==" "&&g!==` `&&g!==" "){let T=t[y+1];T&&T!==" "&&T!==` -`&&T!==" "&&(m=y)}if(y>=h)if(m)d.push(m),h=m+u,m=void 0;else if(r===Cht){for(;g===" "||g===" ";)g=S,S=t[y+=1],A=!0;let T=y>E+1?y-2:_-1;if(f[T])return t;d.push(T),f[T]=!0,h=T+u,m=void 0}else A=!0}g=S}if(A&&l&&l(),d.length===0)return t;c&&c();let v=t.slice(0,d[0]);for(let S=0;S{"use strict";p();var xD=Pm(),FG=sui(),Sht=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),Tht=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function Daa(t,e,r){if(!e||e<0)return!1;let n=e-r,o=t.length;if(o<=n)return!1;for(let s=0,c=0;sn)return!0;if(c=s+1,o-c<=n)return!1}return!0}a(Daa,"lineLengthOverLimit");function kOe(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Tht(t)?" ":""),c="",l=0;for(let u=0,d=r[u];d;d=r[++u])if(d===" "&&r[u+1]==="\\"&&r[u+2]==="n"&&(c+=r.slice(l,u)+"\\ ",u+=1,l=u,d="\\"),d==="\\")switch(r[u+1]){case"u":{c+=r.slice(l,u);let f=r.substr(u+2,4);switch(f){case"0000":c+="\\0";break;case"0007":c+="\\a";break;case"000b":c+="\\v";break;case"001b":c+="\\e";break;case"0085":c+="\\N";break;case"00a0":c+="\\_";break;case"2028":c+="\\L";break;case"2029":c+="\\P";break;default:f.substr(0,2)==="00"?c+="\\x"+f.substr(2):c+=r.substr(u,6)}u+=5,l=u+1}break;case"n":if(n||r[u+2]==='"'||r.length=h)if(m)d.push(m),h=m+u,m=void 0;else if(r===bht){for(;g===" "||g===" ";)g=S,S=t[y+=1],A=!0;let T=y>E+1?y-2:_-1;if(f[T])return t;d.push(T),f[T]=!0,h=T+u,m=void 0}else A=!0}g=S}if(A&&l&&l(),d.length===0)return t;c&&c();let v=t.slice(0,d[0]);for(let S=0;S{"use strict";p();var xD=Dm(),UG=cui(),Tht=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),Iht=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function Maa(t,e,r){if(!e||e<0)return!1;let n=e-r,o=t.length;if(o<=n)return!1;for(let s=0,c=0;sn)return!0;if(c=s+1,o-c<=n)return!1}return!0}a(Maa,"lineLengthOverLimit");function kOe(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Iht(t)?" ":""),c="",l=0;for(let u=0,d=r[u];d;d=r[++u])if(d===" "&&r[u+1]==="\\"&&r[u+2]==="n"&&(c+=r.slice(l,u)+"\\ ",u+=1,l=u,d="\\"),d==="\\")switch(r[u+1]){case"u":{c+=r.slice(l,u);let f=r.substr(u+2,4);switch(f){case"0000":c+="\\0";break;case"0007":c+="\\a";break;case"000b":c+="\\v";break;case"001b":c+="\\e";break;case"0085":c+="\\N";break;case"00a0":c+="\\_";break;case"2028":c+="\\L";break;case"2029":c+="\\P";break;default:f.substr(0,2)==="00"?c+="\\x"+f.substr(2):c+=r.substr(u,6)}u+=5,l=u+1}break;case"n":if(n||r[u+2]==='"'||r.length `;let h,m;for(m=r.length;m>0;--m){let w=r[m-1];if(w!==` `&&w!==" "&&w!==" ")break}let g=r.substring(m),A=g.indexOf(` `);A===-1?h="-":r===g||A!==g.length-1?(h="+",s&&s()):h="",g&&(r=r.slice(0,-g.length),g[g.length-1]===` -`&&(g=g.slice(0,-1)),g=g.replace(cyr,`$&${d}`));let y=!1,_,E=-1;for(_=0;_{R=!0});let k=FG.foldFlowLines(`${v}${w}${g}`,d,FG.FOLD_BLOCK,x);if(!R)return`>${T} +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),R=!1,x=Tht(n,!0);c!=="folded"&&e!==xD.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{R=!0});let k=UG.foldFlowLines(`${v}${w}${g}`,d,UG.FOLD_BLOCK,x);if(!R)return`>${T} ${d}${k}`}return r=r.replace(/\n+/g,`$&${d}`),`|${T} -${d}${v}${r}${g}`}a(bht,"blockString");function Naa(t,e,r,n){let{type:o,value:s}=t,{actualString:c,implicitKey:l,indent:u,indentStep:d,inFlow:f}=e;if(l&&s.includes(` +${d}${v}${r}${g}`}a(Sht,"blockString");function Oaa(t,e,r,n){let{type:o,value:s}=t,{actualString:c,implicitKey:l,indent:u,indentStep:d,inFlow:f}=e;if(l&&s.includes(` `)||f&&/[[\]{},]/.test(s))return n0e(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` -`)?n0e(s,e):bht(t,e,r,n);if(!l&&!f&&o!==xD.Scalar.PLAIN&&s.includes(` -`))return bht(t,e,r,n);if(Tht(s)){if(u==="")return e.forceBlockIndent=!0,bht(t,e,r,n);if(l&&u===d)return n0e(s,e)}let h=s.replace(/\n+/g,`$& -${u}`);if(c){let m=a(y=>y.default&&y.tag!=="tag:yaml.org,2002:str"&&y.test?.test(h),"test"),{compat:g,tags:A}=e.doc.schema;if(A.some(m)||g?.some(m))return n0e(s,e)}return l?h:FG.foldFlowLines(h,u,FG.FOLD_FLOW,Sht(e,!1))}a(Naa,"plainString");function Maa(t,e,r,n){let{implicitKey:o,inFlow:s}=e,c=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==xD.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=xD.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case xD.Scalar.BLOCK_FOLDED:case xD.Scalar.BLOCK_LITERAL:return o||s?n0e(c.value,e):bht(c,e,r,n);case xD.Scalar.QUOTE_DOUBLE:return kOe(c.value,e);case xD.Scalar.QUOTE_SINGLE:return ayr(c.value,e);case xD.Scalar.PLAIN:return Naa(c,e,r,n);default:return null}},"_stringify"),d=u(l);if(d===null){let{defaultKeyType:f,defaultStringType:h}=e.options,m=o&&f||h;if(d=u(m),d===null)throw new Error(`Unsupported default string type ${m}`)}return d}a(Maa,"stringifyString");aui.stringifyString=Maa});var DOe=I(lyr=>{"use strict";p();var Oaa=ght(),UG=ac(),Laa=wOe(),Baa=POe();function Faa(t,e){let r=Object.assign({blockQuote:!0,commentString:Laa.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}a(Faa,"createStringifyContext");function Uaa(t,e){if(e.tag){let o=t.filter(s=>s.tag===e.tag);if(o.length>0)return o.find(s=>s.format===e.format)??o[0]}let r,n;if(UG.isScalar(e)){n=e.value;let o=t.filter(s=>s.identify?.(n));if(o.length>1){let s=o.filter(c=>c.test);s.length>0&&(o=s)}r=o.find(s=>s.format===e.format)??o.find(s=>!s.format)}else n=e,r=t.find(o=>o.nodeClass&&n instanceof o.nodeClass);if(!r){let o=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${o} value`)}return r}a(Uaa,"getTagObject");function Qaa(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=(UG.isScalar(t)||UG.isCollection(t))&&t.anchor;s&&Oaa.anchorIsValid(s)&&(r.add(s),o.push(`&${s}`));let c=t.tag??(e.default?null:e.tag);return c&&o.push(n.directives.tagString(c)),o.join(" ")}a(Qaa,"stringifyProps");function qaa(t,e,r,n){if(UG.isPair(t))return t.toString(e,r,n);if(UG.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let o,s=UG.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=Uaa(e.doc.schema.tags,s));let c=Qaa(s,o,e);c.length>0&&(e.indentAtStart=(e.indentAtStart??0)+c.length+1);let l=typeof o.stringify=="function"?o.stringify(s,e,r,n):UG.isScalar(s)?Baa.stringifyString(s,e,r,n):s.toString(e,r,n);return c?UG.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} -${e.indent}${l}`:l}a(qaa,"stringify");lyr.createStringifyContext=Faa;lyr.stringify=qaa});var dui=I(uui=>{"use strict";p();var d6=ac(),cui=Pm(),lui=DOe(),NOe=wOe();function jaa({key:t,value:e},r,n,o){let{allNullValues:s,doc:c,indent:l,indentStep:u,options:{commentString:d,indentSeq:f,simpleKeys:h}}=r,m=d6.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(d6.isCollection(t)||!d6.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let g=!h&&(!t||m&&e==null&&!r.inFlow||d6.isCollection(t)||(d6.isScalar(t)?t.type===cui.Scalar.BLOCK_FOLDED||t.type===cui.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!g&&(h||!s),indent:l+u});let A=!1,y=!1,_=lui.stringify(t,r,()=>A=!0,()=>y=!0);if(!g&&!r.inFlow&&_.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(r.inFlow){if(s||e==null)return A&&n&&n(),_===""?"?":g?`? ${_}`:_}else if(s&&!h||e==null&&g)return _=`? ${_}`,m&&!A?_+=NOe.lineComment(_,r.indent,d(m)):y&&o&&o(),_;A&&(m=null),g?(m&&(_+=NOe.lineComment(_,r.indent,d(m))),_=`? ${_} -${l}:`):(_=`${_}:`,m&&(_+=NOe.lineComment(_,r.indent,d(m))));let E,v,S;d6.isNode(e)?(E=!!e.spaceBefore,v=e.commentBefore,S=e.comment):(E=!1,v=null,S=null,e&&typeof e=="object"&&(e=c.createNode(e))),r.implicitKey=!1,!g&&!m&&d6.isScalar(e)&&(r.indentAtStart=_.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&d6.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=lui.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||E||v){if(R=E?` +`)?n0e(s,e):Sht(t,e,r,n);if(!l&&!f&&o!==xD.Scalar.PLAIN&&s.includes(` +`))return Sht(t,e,r,n);if(Iht(s)){if(u==="")return e.forceBlockIndent=!0,Sht(t,e,r,n);if(l&&u===d)return n0e(s,e)}let h=s.replace(/\n+/g,`$& +${u}`);if(c){let m=a(y=>y.default&&y.tag!=="tag:yaml.org,2002:str"&&y.test?.test(h),"test"),{compat:g,tags:A}=e.doc.schema;if(A.some(m)||g?.some(m))return n0e(s,e)}return l?h:UG.foldFlowLines(h,u,UG.FOLD_FLOW,Tht(e,!1))}a(Oaa,"plainString");function Laa(t,e,r,n){let{implicitKey:o,inFlow:s}=e,c=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==xD.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=xD.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case xD.Scalar.BLOCK_FOLDED:case xD.Scalar.BLOCK_LITERAL:return o||s?n0e(c.value,e):Sht(c,e,r,n);case xD.Scalar.QUOTE_DOUBLE:return kOe(c.value,e);case xD.Scalar.QUOTE_SINGLE:return cyr(c.value,e);case xD.Scalar.PLAIN:return Oaa(c,e,r,n);default:return null}},"_stringify"),d=u(l);if(d===null){let{defaultKeyType:f,defaultStringType:h}=e.options,m=o&&f||h;if(d=u(m),d===null)throw new Error(`Unsupported default string type ${m}`)}return d}a(Laa,"stringifyString");lui.stringifyString=Laa});var DOe=I(uyr=>{"use strict";p();var Baa=Aht(),QG=ac(),Faa=wOe(),Uaa=POe();function Qaa(t,e){let r=Object.assign({blockQuote:!0,commentString:Faa.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}a(Qaa,"createStringifyContext");function qaa(t,e){if(e.tag){let o=t.filter(s=>s.tag===e.tag);if(o.length>0)return o.find(s=>s.format===e.format)??o[0]}let r,n;if(QG.isScalar(e)){n=e.value;let o=t.filter(s=>s.identify?.(n));if(o.length>1){let s=o.filter(c=>c.test);s.length>0&&(o=s)}r=o.find(s=>s.format===e.format)??o.find(s=>!s.format)}else n=e,r=t.find(o=>o.nodeClass&&n instanceof o.nodeClass);if(!r){let o=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${o} value`)}return r}a(qaa,"getTagObject");function jaa(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=(QG.isScalar(t)||QG.isCollection(t))&&t.anchor;s&&Baa.anchorIsValid(s)&&(r.add(s),o.push(`&${s}`));let c=t.tag??(e.default?null:e.tag);return c&&o.push(n.directives.tagString(c)),o.join(" ")}a(jaa,"stringifyProps");function Haa(t,e,r,n){if(QG.isPair(t))return t.toString(e,r,n);if(QG.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let o,s=QG.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=qaa(e.doc.schema.tags,s));let c=jaa(s,o,e);c.length>0&&(e.indentAtStart=(e.indentAtStart??0)+c.length+1);let l=typeof o.stringify=="function"?o.stringify(s,e,r,n):QG.isScalar(s)?Uaa.stringifyString(s,e,r,n):s.toString(e,r,n);return c?QG.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} +${e.indent}${l}`:l}a(Haa,"stringify");uyr.createStringifyContext=Qaa;uyr.stringify=Haa});var pui=I(fui=>{"use strict";p();var d6=ac(),uui=Dm(),dui=DOe(),NOe=wOe();function Gaa({key:t,value:e},r,n,o){let{allNullValues:s,doc:c,indent:l,indentStep:u,options:{commentString:d,indentSeq:f,simpleKeys:h}}=r,m=d6.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(d6.isCollection(t)||!d6.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let g=!h&&(!t||m&&e==null&&!r.inFlow||d6.isCollection(t)||(d6.isScalar(t)?t.type===uui.Scalar.BLOCK_FOLDED||t.type===uui.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!g&&(h||!s),indent:l+u});let A=!1,y=!1,_=dui.stringify(t,r,()=>A=!0,()=>y=!0);if(!g&&!r.inFlow&&_.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(r.inFlow){if(s||e==null)return A&&n&&n(),_===""?"?":g?`? ${_}`:_}else if(s&&!h||e==null&&g)return _=`? ${_}`,m&&!A?_+=NOe.lineComment(_,r.indent,d(m)):y&&o&&o(),_;A&&(m=null),g?(m&&(_+=NOe.lineComment(_,r.indent,d(m))),_=`? ${_} +${l}:`):(_=`${_}:`,m&&(_+=NOe.lineComment(_,r.indent,d(m))));let E,v,S;d6.isNode(e)?(E=!!e.spaceBefore,v=e.commentBefore,S=e.comment):(E=!1,v=null,S=null,e&&typeof e=="object"&&(e=c.createNode(e))),r.implicitKey=!1,!g&&!m&&d6.isScalar(e)&&(r.indentAtStart=_.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&d6.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=dui.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||E||v){if(R=E?` `:"",v){let x=d(v);R+=` ${NOe.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` `&&S&&(R=` @@ -377,34 +377,34 @@ ${NOe.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` ${r.indent}`}else if(!g&&d6.isCollection(e)){let x=w[0],k=w.indexOf(` `),D=k!==-1,N=r.inFlow??e.flow??e.items.length===0;if(D||!N){let O=!1;if(D&&(x==="&"||x==="!")){let B=w.indexOf(" ");x==="&"&&B!==-1&&B{"use strict";p();var fui=require("process");function Haa(t,...e){t==="debug"&&console.log(...e)}a(Haa,"debug");function Gaa(t,e){(t==="debug"||t==="warn")&&(typeof fui.emitWarning=="function"?fui.emitWarning(e):console.warn(e))}a(Gaa,"warn");uyr.debug=Haa;uyr.warn=Gaa});var Rht=I(wht=>{"use strict";p();var MOe=ac(),pui=Pm(),Iht="<<",xht={identify:a(t=>t===Iht||typeof t=="symbol"&&t.description===Iht,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new pui.Scalar(Symbol(Iht)),{addToJSMap:hui}),"resolve"),stringify:a(()=>Iht,"stringify")},$aa=a((t,e)=>(xht.identify(e)||MOe.isScalar(e)&&(!e.type||e.type===pui.Scalar.PLAIN)&&xht.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===xht.tag&&r.default),"isMergeKey");function hui(t,e,r){if(r=t&&MOe.isAlias(r)?r.resolve(t.doc):r,MOe.isSeq(r))for(let n of r.items)fyr(t,e,n);else if(Array.isArray(r))for(let n of r)fyr(t,e,n);else fyr(t,e,r)}a(hui,"addMergeToJSMap");function fyr(t,e,r){let n=t&&MOe.isAlias(r)?r.resolve(t.doc):r;if(!MOe.isMap(n))throw new Error("Merge sources must be maps or map aliases");let o=n.toJSON(null,t,Map);for(let[s,c]of o)e instanceof Map?e.has(s)||e.set(s,c):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:c,writable:!0,enumerable:!0,configurable:!0});return e}a(fyr,"mergeValue");wht.addMergeToJSMap=hui;wht.isMergeKey=$aa;wht.merge=xht});var hyr=I(Aui=>{"use strict";p();var Vaa=dyr(),mui=Rht(),Waa=DOe(),gui=ac(),pyr=LG();function zaa(t,e,{key:r,value:n}){if(gui.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(mui.isMergeKey(t,r))mui.addMergeToJSMap(t,e,n);else{let o=pyr.toJS(r,"",t);if(e instanceof Map)e.set(o,pyr.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=Yaa(r,o,t),c=pyr.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:c,writable:!0,enumerable:!0,configurable:!0}):e[s]=c}}return e}a(zaa,"addPairToJSMap");function Yaa(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(gui.isNode(t)&&r?.doc){let n=Waa.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let o=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(o);s.length>40&&(s=s.substring(0,36)+'..."'),Vaa.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return o}return JSON.stringify(e)}a(Yaa,"stringifyKey");Aui.addPairToJSMap=zaa});var QG=I(myr=>{"use strict";p();var yui=xOe(),Kaa=dui(),Jaa=hyr(),kht=ac();function Zaa(t,e,r){let n=yui.createNode(t,void 0,r),o=yui.createNode(e,void 0,r);return new Pht(n,o)}a(Zaa,"createPair");var Pht=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,kht.NODE_TYPE,{value:kht.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return kht.isNode(r)&&(r=r.clone(e)),kht.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return Jaa.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?Kaa.stringifyPair(this,e,r,n):JSON.stringify(this)}};myr.Pair=Pht;myr.createPair=Zaa});var gyr=I(Eui=>{"use strict";p();var ote=ac(),_ui=DOe(),Dht=wOe();function Xaa(t,e,r){return(e.inFlow??t.flow?tca:eca)(t,e,r)}a(Xaa,"stringifyCollection");function eca({comment:t,items:e},r,{blockItemPrefix:n,flowChars:o,itemIndent:s,onChompKeep:c,onComment:l}){let{indent:u,options:{commentString:d}}=r,f=Object.assign({},r,{indent:s,type:null}),h=!1,m=[];for(let A=0;A_=null,()=>h=!0);_&&(E+=Dht.lineComment(E,s,d(_))),h&&_&&(h=!1),m.push(n+E)}let g;if(m.length===0)g=o.start+o.end;else{g=m[0];for(let A=1;A{"use strict";p();var hui=require("process");function $aa(t,...e){t==="debug"&&console.log(...e)}a($aa,"debug");function Vaa(t,e){(t==="debug"||t==="warn")&&(typeof hui.emitWarning=="function"?hui.emitWarning(e):console.warn(e))}a(Vaa,"warn");dyr.debug=$aa;dyr.warn=Vaa});var kht=I(Rht=>{"use strict";p();var MOe=ac(),mui=Dm(),xht="<<",wht={identify:a(t=>t===xht||typeof t=="symbol"&&t.description===xht,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new mui.Scalar(Symbol(xht)),{addToJSMap:gui}),"resolve"),stringify:a(()=>xht,"stringify")},Waa=a((t,e)=>(wht.identify(e)||MOe.isScalar(e)&&(!e.type||e.type===mui.Scalar.PLAIN)&&wht.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===wht.tag&&r.default),"isMergeKey");function gui(t,e,r){if(r=t&&MOe.isAlias(r)?r.resolve(t.doc):r,MOe.isSeq(r))for(let n of r.items)pyr(t,e,n);else if(Array.isArray(r))for(let n of r)pyr(t,e,n);else pyr(t,e,r)}a(gui,"addMergeToJSMap");function pyr(t,e,r){let n=t&&MOe.isAlias(r)?r.resolve(t.doc):r;if(!MOe.isMap(n))throw new Error("Merge sources must be maps or map aliases");let o=n.toJSON(null,t,Map);for(let[s,c]of o)e instanceof Map?e.has(s)||e.set(s,c):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:c,writable:!0,enumerable:!0,configurable:!0});return e}a(pyr,"mergeValue");Rht.addMergeToJSMap=gui;Rht.isMergeKey=Waa;Rht.merge=wht});var myr=I(_ui=>{"use strict";p();var zaa=fyr(),Aui=kht(),Yaa=DOe(),yui=ac(),hyr=BG();function Kaa(t,e,{key:r,value:n}){if(yui.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(Aui.isMergeKey(t,r))Aui.addMergeToJSMap(t,e,n);else{let o=hyr.toJS(r,"",t);if(e instanceof Map)e.set(o,hyr.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=Jaa(r,o,t),c=hyr.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:c,writable:!0,enumerable:!0,configurable:!0}):e[s]=c}}return e}a(Kaa,"addPairToJSMap");function Jaa(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(yui.isNode(t)&&r?.doc){let n=Yaa.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let o=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(o);s.length>40&&(s=s.substring(0,36)+'..."'),zaa.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return o}return JSON.stringify(e)}a(Jaa,"stringifyKey");_ui.addPairToJSMap=Kaa});var qG=I(gyr=>{"use strict";p();var Eui=xOe(),Zaa=pui(),Xaa=myr(),Pht=ac();function eca(t,e,r){let n=Eui.createNode(t,void 0,r),o=Eui.createNode(e,void 0,r);return new Dht(n,o)}a(eca,"createPair");var Dht=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,Pht.NODE_TYPE,{value:Pht.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Pht.isNode(r)&&(r=r.clone(e)),Pht.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return Xaa.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?Zaa.stringifyPair(this,e,r,n):JSON.stringify(this)}};gyr.Pair=Dht;gyr.createPair=eca});var Ayr=I(Cui=>{"use strict";p();var ste=ac(),vui=DOe(),Nht=wOe();function tca(t,e,r){return(e.inFlow??t.flow?nca:rca)(t,e,r)}a(tca,"stringifyCollection");function rca({comment:t,items:e},r,{blockItemPrefix:n,flowChars:o,itemIndent:s,onChompKeep:c,onComment:l}){let{indent:u,options:{commentString:d}}=r,f=Object.assign({},r,{indent:s,type:null}),h=!1,m=[];for(let A=0;A_=null,()=>h=!0);_&&(E+=Nht.lineComment(E,s,d(_))),h&&_&&(h=!1),m.push(n+E)}let g;if(m.length===0)g=o.start+o.end;else{g=m[0];for(let A=1;A_=null);d||(d=h.length>f||E.includes(` -`)),A0&&(d||(d=h.reduce((v,S)=>v+S.length+2,2)+(E.length+2)>e.options.lineWidth)),d&&(E+=",")),_&&(E+=Dht.lineComment(E,n,l(_))),h.push(E),f=h.length}let{start:m,end:g}=r;if(h.length===0)return m+g;if(!d){let A=h.reduce((y,_)=>y+_.length+2,2);d=e.options.lineWidth>0&&A>e.options.lineWidth}if(d){let A=m;for(let y of h)A+=y?` +`+Nht.indentComment(d(t),u),l&&l()):h&&c&&c(),g}a(rca,"stringifyBlockCollection");function nca({items:t},e,{flowChars:r,itemIndent:n}){let{indent:o,indentStep:s,flowCollectionPadding:c,options:{commentString:l}}=e;n+=s;let u=Object.assign({},e,{indent:n,inFlow:!0,type:null}),d=!1,f=0,h=[];for(let A=0;A_=null);d||(d=h.length>f||E.includes(` +`)),A0&&(d||(d=h.reduce((v,S)=>v+S.length+2,2)+(E.length+2)>e.options.lineWidth)),d&&(E+=",")),_&&(E+=Nht.lineComment(E,n,l(_))),h.push(E),f=h.length}let{start:m,end:g}=r;if(h.length===0)return m+g;if(!d){let A=h.reduce((y,_)=>y+_.length+2,2);d=e.options.lineWidth>0&&A>e.options.lineWidth}if(d){let A=m;for(let y of h)A+=y?` ${s}${o}${y}`:` `;return`${A} -${o}${g}`}else return`${m}${c}${h.join(" ")}${c}${g}`}a(tca,"stringifyFlowCollection");function Nht({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=Dht.indentComment(e(n),t);r.push(s.trimStart())}}a(Nht,"addCommentBefore");Eui.stringifyCollection=Xaa});var jG=I(yyr=>{"use strict";p();var rca=gyr(),nca=hyr(),ica=Eht(),qG=ac(),Mht=QG(),oca=Pm();function OOe(t,e){let r=qG.isScalar(e)?e.value:e;for(let n of t)if(qG.isPair(n)&&(n.key===e||n.key===r||qG.isScalar(n.key)&&n.key.value===r))return n}a(OOe,"findPair");var Ayr=class extends ica.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(qG.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:o,replacer:s}=n,c=new this(e),l=a((u,d)=>{if(typeof s=="function")d=s.call(r,u,d);else if(Array.isArray(s)&&!s.includes(u))return;(d!==void 0||o)&&c.items.push(Mht.createPair(u,d,n))},"add");if(r instanceof Map)for(let[u,d]of r)l(u,d);else if(r&&typeof r=="object")for(let u of Object.keys(r))l(u,r[u]);return typeof e.sortMapEntries=="function"&&c.items.sort(e.sortMapEntries),c}add(e,r){let n;qG.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Mht.Pair(e,e?.value):n=new Mht.Pair(e.key,e.value);let o=OOe(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);qG.isScalar(o.value)&&oca.isScalarValue(n.value)?o.value.value=n.value:o.value=n.value}else if(s){let c=this.items.findIndex(l=>s(n,l)<0);c===-1?this.items.push(n):this.items.splice(c,0,n)}else this.items.push(n)}delete(e){let r=OOe(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=OOe(this.items,e)?.value;return(!r&&qG.isScalar(o)?o.value:o)??void 0}has(e){return!!OOe(this.items,e)}set(e,r){this.add(new Mht.Pair(e,r),!0)}toJSON(e,r,n){let o=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(o);for(let s of this.items)nca.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!qG.isPair(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),rca.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};yyr.YAMLMap=Ayr;yyr.findPair=OOe});var i0e=I(Cui=>{"use strict";p();var sca=ac(),vui=jG(),aca={collection:"map",default:!0,nodeClass:vui.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return sca.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>vui.YAMLMap.from(t,e,r),"createNode")};Cui.map=aca});var HG=I(bui=>{"use strict";p();var cca=xOe(),lca=gyr(),uca=Eht(),Lht=ac(),dca=Pm(),fca=LG(),_yr=class extends uca.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Lht.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Oht(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Oht(e);if(typeof n!="number")return;let o=this.items[n];return!r&&Lht.isScalar(o)?o.value:o}has(e){let r=Oht(e);return typeof r=="number"&&r=0?e:null}a(Oht,"asItemIndex");bui.YAMLSeq=_yr});var o0e=I(Tui=>{"use strict";p();var pca=ac(),Sui=HG(),hca={collection:"seq",default:!0,nodeClass:Sui.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return pca.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>Sui.YAMLSeq.from(t,e,r),"createNode")};Tui.seq=hca});var LOe=I(Iui=>{"use strict";p();var mca=POe(),gca={identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),mca.stringifyString(t,e,r,n)}};Iui.string=gca});var Bht=I(Rui=>{"use strict";p();var xui=Pm(),wui={identify:a(t=>t==null,"identify"),createNode:a(()=>new xui.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new xui.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&wui.test.test(t)?t:e.options.nullStr,"stringify")};Rui.nullTag=wui});var Eyr=I(Pui=>{"use strict";p();var Aca=Pm(),kui={identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:a(t=>new Aca.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&kui.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};Pui.boolTag=kui});var s0e=I(Dui=>{"use strict";p();function yca({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let o=typeof n=="number"?n:Number(n);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let c=s.indexOf(".");c<0&&(c=s.length,s+=".");let l=e-(s.length-c-1);for(;l-- >0;)s+="0"}return s}a(yca,"stringifyNumber");Dui.stringifyNumber=yca});var Cyr=I(Fht=>{"use strict";p();var _ca=Pm(),vyr=s0e(),Eca={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:vyr.stringifyNumber},vca={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():vyr.stringifyNumber(t)}},Cca={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new _ca.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:vyr.stringifyNumber};Fht.float=Cca;Fht.floatExp=vca;Fht.floatNaN=Eca});var Syr=I(Qht=>{"use strict";p();var Nui=s0e(),Uht=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),byr=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function Mui(t,e,r){let{value:n}=t;return Uht(n)&&n>=0?r+n.toString(e):Nui.stringifyNumber(t)}a(Mui,"intStringify");var bca={identify:a(t=>Uht(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>byr(t,2,8,r),"resolve"),stringify:a(t=>Mui(t,8,"0o"),"stringify")},Sca={identify:Uht,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>byr(t,0,10,r),"resolve"),stringify:Nui.stringifyNumber},Tca={identify:a(t=>Uht(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:a((t,e,r)=>byr(t,2,16,r),"resolve"),stringify:a(t=>Mui(t,16,"0x"),"stringify")};Qht.int=Sca;Qht.intHex=Tca;Qht.intOct=bca});var Lui=I(Oui=>{"use strict";p();var Ica=i0e(),xca=Bht(),wca=o0e(),Rca=LOe(),kca=Eyr(),Tyr=Cyr(),Iyr=Syr(),Pca=[Ica.map,wca.seq,Rca.string,xca.nullTag,kca.boolTag,Iyr.intOct,Iyr.int,Iyr.intHex,Tyr.floatNaN,Tyr.floatExp,Tyr.float];Oui.schema=Pca});var Uui=I(Fui=>{"use strict";p();var Dca=Pm(),Nca=i0e(),Mca=o0e();function Bui(t){return typeof t=="bigint"||Number.isInteger(t)}a(Bui,"intIdentify");var qht=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),Oca=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:qht},{identify:a(t=>t==null,"identify"),createNode:a(()=>new Dca.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:qht},{identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:a(t=>t==="true","resolve"),stringify:qht},{identify:Bui,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:a((t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),"resolve"),stringify:a(({value:t})=>Bui(t)?t.toString():JSON.stringify(t),"stringify")},{identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:a(t=>parseFloat(t),"resolve"),stringify:qht}],Lca={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Bca=[Nca.map,Mca.seq].concat(Oca,Lca);Fui.schema=Bca});var wyr=I(Qui=>{"use strict";p();var BOe=require("buffer"),xyr=Pm(),Fca=POe(),Uca={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof BOe.Buffer=="function")return BOe.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let o=0;o{"use strict";p();var jht=ac(),Ryr=QG(),Qca=Pm(),qca=HG();function qui(t,e){if(jht.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new Ryr.Pair(new Qca.Scalar(null));if(n.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${n.commentBefore} +${o}${g}`}else return`${m}${c}${h.join(" ")}${c}${g}`}a(nca,"stringifyFlowCollection");function Mht({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=Nht.indentComment(e(n),t);r.push(s.trimStart())}}a(Mht,"addCommentBefore");Cui.stringifyCollection=tca});var HG=I(_yr=>{"use strict";p();var ica=Ayr(),oca=myr(),sca=vht(),jG=ac(),Oht=qG(),aca=Dm();function OOe(t,e){let r=jG.isScalar(e)?e.value:e;for(let n of t)if(jG.isPair(n)&&(n.key===e||n.key===r||jG.isScalar(n.key)&&n.key.value===r))return n}a(OOe,"findPair");var yyr=class extends sca.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(jG.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:o,replacer:s}=n,c=new this(e),l=a((u,d)=>{if(typeof s=="function")d=s.call(r,u,d);else if(Array.isArray(s)&&!s.includes(u))return;(d!==void 0||o)&&c.items.push(Oht.createPair(u,d,n))},"add");if(r instanceof Map)for(let[u,d]of r)l(u,d);else if(r&&typeof r=="object")for(let u of Object.keys(r))l(u,r[u]);return typeof e.sortMapEntries=="function"&&c.items.sort(e.sortMapEntries),c}add(e,r){let n;jG.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Oht.Pair(e,e?.value):n=new Oht.Pair(e.key,e.value);let o=OOe(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);jG.isScalar(o.value)&&aca.isScalarValue(n.value)?o.value.value=n.value:o.value=n.value}else if(s){let c=this.items.findIndex(l=>s(n,l)<0);c===-1?this.items.push(n):this.items.splice(c,0,n)}else this.items.push(n)}delete(e){let r=OOe(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=OOe(this.items,e)?.value;return(!r&&jG.isScalar(o)?o.value:o)??void 0}has(e){return!!OOe(this.items,e)}set(e,r){this.add(new Oht.Pair(e,r),!0)}toJSON(e,r,n){let o=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(o);for(let s of this.items)oca.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!jG.isPair(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ica.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};_yr.YAMLMap=yyr;_yr.findPair=OOe});var i0e=I(Sui=>{"use strict";p();var cca=ac(),bui=HG(),lca={collection:"map",default:!0,nodeClass:bui.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return cca.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>bui.YAMLMap.from(t,e,r),"createNode")};Sui.map=lca});var GG=I(Tui=>{"use strict";p();var uca=xOe(),dca=Ayr(),fca=vht(),Bht=ac(),pca=Dm(),hca=BG(),Eyr=class extends fca.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Bht.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Lht(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Lht(e);if(typeof n!="number")return;let o=this.items[n];return!r&&Bht.isScalar(o)?o.value:o}has(e){let r=Lht(e);return typeof r=="number"&&r=0?e:null}a(Lht,"asItemIndex");Tui.YAMLSeq=Eyr});var o0e=I(xui=>{"use strict";p();var mca=ac(),Iui=GG(),gca={collection:"seq",default:!0,nodeClass:Iui.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return mca.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>Iui.YAMLSeq.from(t,e,r),"createNode")};xui.seq=gca});var LOe=I(wui=>{"use strict";p();var Aca=POe(),yca={identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),Aca.stringifyString(t,e,r,n)}};wui.string=yca});var Fht=I(Pui=>{"use strict";p();var Rui=Dm(),kui={identify:a(t=>t==null,"identify"),createNode:a(()=>new Rui.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new Rui.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&kui.test.test(t)?t:e.options.nullStr,"stringify")};Pui.nullTag=kui});var vyr=I(Nui=>{"use strict";p();var _ca=Dm(),Dui={identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:a(t=>new _ca.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&Dui.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};Nui.boolTag=Dui});var s0e=I(Mui=>{"use strict";p();function Eca({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let o=typeof n=="number"?n:Number(n);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let c=s.indexOf(".");c<0&&(c=s.length,s+=".");let l=e-(s.length-c-1);for(;l-- >0;)s+="0"}return s}a(Eca,"stringifyNumber");Mui.stringifyNumber=Eca});var byr=I(Uht=>{"use strict";p();var vca=Dm(),Cyr=s0e(),Cca={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Cyr.stringifyNumber},bca={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Cyr.stringifyNumber(t)}},Sca={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new vca.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Cyr.stringifyNumber};Uht.float=Sca;Uht.floatExp=bca;Uht.floatNaN=Cca});var Tyr=I(qht=>{"use strict";p();var Oui=s0e(),Qht=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),Syr=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function Lui(t,e,r){let{value:n}=t;return Qht(n)&&n>=0?r+n.toString(e):Oui.stringifyNumber(t)}a(Lui,"intStringify");var Tca={identify:a(t=>Qht(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>Syr(t,2,8,r),"resolve"),stringify:a(t=>Lui(t,8,"0o"),"stringify")},Ica={identify:Qht,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>Syr(t,0,10,r),"resolve"),stringify:Oui.stringifyNumber},xca={identify:a(t=>Qht(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:a((t,e,r)=>Syr(t,2,16,r),"resolve"),stringify:a(t=>Lui(t,16,"0x"),"stringify")};qht.int=Ica;qht.intHex=xca;qht.intOct=Tca});var Fui=I(Bui=>{"use strict";p();var wca=i0e(),Rca=Fht(),kca=o0e(),Pca=LOe(),Dca=vyr(),Iyr=byr(),xyr=Tyr(),Nca=[wca.map,kca.seq,Pca.string,Rca.nullTag,Dca.boolTag,xyr.intOct,xyr.int,xyr.intHex,Iyr.floatNaN,Iyr.floatExp,Iyr.float];Bui.schema=Nca});var qui=I(Qui=>{"use strict";p();var Mca=Dm(),Oca=i0e(),Lca=o0e();function Uui(t){return typeof t=="bigint"||Number.isInteger(t)}a(Uui,"intIdentify");var jht=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),Bca=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:jht},{identify:a(t=>t==null,"identify"),createNode:a(()=>new Mca.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:jht},{identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:a(t=>t==="true","resolve"),stringify:jht},{identify:Uui,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:a((t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),"resolve"),stringify:a(({value:t})=>Uui(t)?t.toString():JSON.stringify(t),"stringify")},{identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:a(t=>parseFloat(t),"resolve"),stringify:jht}],Fca={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Uca=[Oca.map,Lca.seq].concat(Bca,Fca);Qui.schema=Uca});var Ryr=I(jui=>{"use strict";p();var BOe=require("buffer"),wyr=Dm(),Qca=POe(),qca={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof BOe.Buffer=="function")return BOe.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let o=0;o{"use strict";p();var Hht=ac(),kyr=qG(),jca=Dm(),Hca=GG();function Hui(t,e){if(Hht.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new kyr.Pair(new jca.Scalar(null));if(n.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${n.commentBefore} ${o.key.commentBefore}`:n.commentBefore),n.comment){let s=o.value??o.key;s.comment=s.comment?`${n.comment} -${s.comment}`:n.comment}n=o}t.items[r]=jht.isPair(n)?n:new Ryr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(qui,"resolvePairs");function jui(t,e,r){let{replacer:n}=r,o=new qca.YAMLSeq(t);o.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let c of e){typeof n=="function"&&(c=n.call(e,String(s++),c));let l,u;if(Array.isArray(c))if(c.length===2)l=c[0],u=c[1];else throw new TypeError(`Expected [key, value] tuple: ${c}`);else if(c&&c instanceof Object){let d=Object.keys(c);if(d.length===1)l=d[0],u=c[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=c;o.items.push(Ryr.createPair(l,u,r))}return o}a(jui,"createPairs");var jca={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:qui,createNode:jui};Hht.createPairs=jui;Hht.pairs=jca;Hht.resolvePairs=qui});var Dyr=I(Pyr=>{"use strict";p();var Hui=ac(),kyr=LG(),FOe=jG(),Hca=HG(),Gui=Ght(),ste=class t extends Hca.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=FOe.YAMLMap.prototype.add.bind(this),this.delete=FOe.YAMLMap.prototype.delete.bind(this),this.get=FOe.YAMLMap.prototype.get.bind(this),this.has=FOe.YAMLMap.prototype.has.bind(this),this.set=FOe.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let o of this.items){let s,c;if(Hui.isPair(o)?(s=kyr.toJS(o.key,"",r),c=kyr.toJS(o.value,s,r)):s=kyr.toJS(o,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,c)}return n}static from(e,r,n){let o=Gui.createPairs(e,r,n),s=new this;return s.items=o.items,s}};ste.tag="tag:yaml.org,2002:omap";var Gca={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:ste,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Gui.resolvePairs(t,e),n=[];for(let{key:o}of r.items)Hui.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new ste,r)},createNode:a((t,e,r)=>ste.from(t,e,r),"createNode")};Pyr.YAMLOMap=ste;Pyr.omap=Gca});var Yui=I(Nyr=>{"use strict";p();var $ui=Pm();function Vui({value:t,source:e},r){return e&&(t?Wui:zui).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(Vui,"boolStringify");var Wui={identify:a(t=>t===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:a(()=>new $ui.Scalar(!0),"resolve"),stringify:Vui},zui={identify:a(t=>t===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:a(()=>new $ui.Scalar(!1),"resolve"),stringify:Vui};Nyr.falseTag=zui;Nyr.trueTag=Wui});var Kui=I($ht=>{"use strict";p();var $ca=Pm(),Myr=s0e(),Vca={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Myr.stringifyNumber},Wca={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t.replace(/_/g,"")),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Myr.stringifyNumber(t)}},zca={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new $ca.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Myr.stringifyNumber};$ht.float=zca;$ht.floatExp=Wca;$ht.floatNaN=Vca});var Zui=I(QOe=>{"use strict";p();var Jui=s0e(),UOe=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function Vht(t,e,r,{intAsBigInt:n}){let o=t[0];if((o==="-"||o==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let c=BigInt(t);return o==="-"?BigInt(-1)*c:c}let s=parseInt(t,r);return o==="-"?-1*s:s}a(Vht,"intResolve");function Oyr(t,e,r){let{value:n}=t;if(UOe(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return Jui.stringifyNumber(t)}a(Oyr,"intStringify");var Yca={identify:UOe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>Vht(t,2,2,r),"resolve"),stringify:a(t=>Oyr(t,2,"0b"),"stringify")},Kca={identify:UOe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>Vht(t,1,8,r),"resolve"),stringify:a(t=>Oyr(t,8,"0"),"stringify")},Jca={identify:UOe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>Vht(t,0,10,r),"resolve"),stringify:Jui.stringifyNumber},Zca={identify:UOe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>Vht(t,2,16,r),"resolve"),stringify:a(t=>Oyr(t,16,"0x"),"stringify")};QOe.int=Jca;QOe.intBin=Yca;QOe.intHex=Zca;QOe.intOct=Kca});var Byr=I(Lyr=>{"use strict";p();var Yht=ac(),Wht=QG(),zht=jG(),ate=class t extends zht.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;Yht.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Wht.Pair(e.key,null):r=new Wht.Pair(e,null),zht.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=zht.findPair(this.items,e);return!r&&Yht.isPair(n)?Yht.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=zht.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Wht.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:o}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let c of r)typeof o=="function"&&(c=o.call(r,c,c)),s.items.push(Wht.createPair(c,null,n));return s}};ate.tag="tag:yaml.org,2002:set";var Xca={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:ate,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>ate.from(t,e,r),"createNode"),resolve(t,e){if(Yht.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ate,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Lyr.YAMLSet=ate;Lyr.set=Xca});var Uyr=I(Kht=>{"use strict";p();var ela=s0e();function Fyr(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,o=a(c=>e?BigInt(c):Number(c),"num"),s=n.replace(/_/g,"").split(":").reduce((c,l)=>c*o(60)+o(l),o(0));return r==="-"?o(-1)*s:s}a(Fyr,"parseSexagesimal");function Xui(t){let{value:e}=t,r=a(c=>c,"num");if(typeof e=="bigint")r=a(c=>BigInt(c),"num");else if(isNaN(e)||!isFinite(e))return ela.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let o=r(60),s=[e%o];return e<60?s.unshift(0):(e=(e-s[0])/o,s.unshift(e%o),e>=60&&(e=(e-s[0])/o,s.unshift(e))),n+s.map(c=>String(c).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}a(Xui,"stringifySexagesimal");var tla={identify:a(t=>typeof t=="bigint"||Number.isInteger(t),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:a((t,e,{intAsBigInt:r})=>Fyr(t,r),"resolve"),stringify:Xui},rla={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:a(t=>Fyr(t,!1),"resolve"),stringify:Xui},edi={identify:a(t=>t instanceof Date,"identify"),default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(edi.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,o,s,c,l]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(r,n-1,o,s||0,c||0,l||0,u),f=e[8];if(f&&f!=="Z"){let h=Fyr(f,!1);Math.abs(h)<30&&(h*=60),d-=6e4*h}return new Date(d)},stringify:a(({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};Kht.floatTime=rla;Kht.intTime=tla;Kht.timestamp=edi});var ndi=I(rdi=>{"use strict";p();var nla=i0e(),ila=Bht(),ola=o0e(),sla=LOe(),ala=wyr(),tdi=Yui(),Qyr=Kui(),Jht=Zui(),cla=Rht(),lla=Dyr(),ula=Ght(),dla=Byr(),qyr=Uyr(),fla=[nla.map,ola.seq,sla.string,ila.nullTag,tdi.trueTag,tdi.falseTag,Jht.intBin,Jht.intOct,Jht.int,Jht.intHex,Qyr.floatNaN,Qyr.floatExp,Qyr.float,ala.binary,cla.merge,lla.omap,ula.pairs,dla.set,qyr.intTime,qyr.floatTime,qyr.timestamp];rdi.schema=fla});var pdi=I(Gyr=>{"use strict";p();var adi=i0e(),pla=Bht(),cdi=o0e(),hla=LOe(),mla=Eyr(),jyr=Cyr(),Hyr=Syr(),gla=Lui(),Ala=Uui(),ldi=wyr(),qOe=Rht(),udi=Dyr(),ddi=Ght(),idi=ndi(),fdi=Byr(),Zht=Uyr(),odi=new Map([["core",gla.schema],["failsafe",[adi.map,cdi.seq,hla.string]],["json",Ala.schema],["yaml11",idi.schema],["yaml-1.1",idi.schema]]),sdi={binary:ldi.binary,bool:mla.boolTag,float:jyr.float,floatExp:jyr.floatExp,floatNaN:jyr.floatNaN,floatTime:Zht.floatTime,int:Hyr.int,intHex:Hyr.intHex,intOct:Hyr.intOct,intTime:Zht.intTime,map:adi.map,merge:qOe.merge,null:pla.nullTag,omap:udi.omap,pairs:ddi.pairs,seq:cdi.seq,set:fdi.set,timestamp:Zht.timestamp},yla={"tag:yaml.org,2002:binary":ldi.binary,"tag:yaml.org,2002:merge":qOe.merge,"tag:yaml.org,2002:omap":udi.omap,"tag:yaml.org,2002:pairs":ddi.pairs,"tag:yaml.org,2002:set":fdi.set,"tag:yaml.org,2002:timestamp":Zht.timestamp};function _la(t,e,r){let n=odi.get(e);if(n&&!t)return r&&!n.includes(qOe.merge)?n.concat(qOe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(odi.keys()).filter(c=>c!=="yaml11").map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)o=o.concat(s);else typeof t=="function"&&(o=t(o.slice()));return r&&(o=o.concat(qOe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?sdi[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys(sdi).map(f=>JSON.stringify(f)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}a(_la,"getTags");Gyr.coreKnownTags=yla;Gyr.getTags=_la});var Wyr=I(hdi=>{"use strict";p();var $yr=ac(),Ela=i0e(),vla=o0e(),Cla=LOe(),Xht=pdi(),bla=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),Vyr=class t{static{a(this,"Schema")}constructor({compat:e,customTags:r,merge:n,resolveKnownTags:o,schema:s,sortMapEntries:c,toStringDefaults:l}){this.compat=Array.isArray(e)?Xht.getTags(e,"compat"):e?Xht.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?Xht.coreKnownTags:{},this.tags=Xht.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,$yr.MAP,{value:Ela.map}),Object.defineProperty(this,$yr.SCALAR,{value:Cla.string}),Object.defineProperty(this,$yr.SEQ,{value:vla.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?bla:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};hdi.Schema=Vyr});var gdi=I(mdi=>{"use strict";p();var Sla=ac(),zyr=DOe(),jOe=wOe();function Tla(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let u=t.directives.toString(t);u?(r.push(u),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let o=zyr.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(jOe.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(Sla.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(jOe.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=zyr.stringify(t.contents,o,()=>l=null,u);l&&(d+=jOe.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(zyr.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` +${s.comment}`:n.comment}n=o}t.items[r]=Hht.isPair(n)?n:new kyr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(Hui,"resolvePairs");function Gui(t,e,r){let{replacer:n}=r,o=new Hca.YAMLSeq(t);o.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let c of e){typeof n=="function"&&(c=n.call(e,String(s++),c));let l,u;if(Array.isArray(c))if(c.length===2)l=c[0],u=c[1];else throw new TypeError(`Expected [key, value] tuple: ${c}`);else if(c&&c instanceof Object){let d=Object.keys(c);if(d.length===1)l=d[0],u=c[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=c;o.items.push(kyr.createPair(l,u,r))}return o}a(Gui,"createPairs");var Gca={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Hui,createNode:Gui};Ght.createPairs=Gui;Ght.pairs=Gca;Ght.resolvePairs=Hui});var Nyr=I(Dyr=>{"use strict";p();var $ui=ac(),Pyr=BG(),FOe=HG(),$ca=GG(),Vui=$ht(),ate=class t extends $ca.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=FOe.YAMLMap.prototype.add.bind(this),this.delete=FOe.YAMLMap.prototype.delete.bind(this),this.get=FOe.YAMLMap.prototype.get.bind(this),this.has=FOe.YAMLMap.prototype.has.bind(this),this.set=FOe.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let o of this.items){let s,c;if($ui.isPair(o)?(s=Pyr.toJS(o.key,"",r),c=Pyr.toJS(o.value,s,r)):s=Pyr.toJS(o,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,c)}return n}static from(e,r,n){let o=Vui.createPairs(e,r,n),s=new this;return s.items=o.items,s}};ate.tag="tag:yaml.org,2002:omap";var Vca={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:ate,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Vui.resolvePairs(t,e),n=[];for(let{key:o}of r.items)$ui.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new ate,r)},createNode:a((t,e,r)=>ate.from(t,e,r),"createNode")};Dyr.YAMLOMap=ate;Dyr.omap=Vca});var Jui=I(Myr=>{"use strict";p();var Wui=Dm();function zui({value:t,source:e},r){return e&&(t?Yui:Kui).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(zui,"boolStringify");var Yui={identify:a(t=>t===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:a(()=>new Wui.Scalar(!0),"resolve"),stringify:zui},Kui={identify:a(t=>t===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:a(()=>new Wui.Scalar(!1),"resolve"),stringify:zui};Myr.falseTag=Kui;Myr.trueTag=Yui});var Zui=I(Vht=>{"use strict";p();var Wca=Dm(),Oyr=s0e(),zca={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Oyr.stringifyNumber},Yca={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t.replace(/_/g,"")),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Oyr.stringifyNumber(t)}},Kca={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Wca.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Oyr.stringifyNumber};Vht.float=Kca;Vht.floatExp=Yca;Vht.floatNaN=zca});var edi=I(QOe=>{"use strict";p();var Xui=s0e(),UOe=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function Wht(t,e,r,{intAsBigInt:n}){let o=t[0];if((o==="-"||o==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let c=BigInt(t);return o==="-"?BigInt(-1)*c:c}let s=parseInt(t,r);return o==="-"?-1*s:s}a(Wht,"intResolve");function Lyr(t,e,r){let{value:n}=t;if(UOe(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return Xui.stringifyNumber(t)}a(Lyr,"intStringify");var Jca={identify:UOe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>Wht(t,2,2,r),"resolve"),stringify:a(t=>Lyr(t,2,"0b"),"stringify")},Zca={identify:UOe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>Wht(t,1,8,r),"resolve"),stringify:a(t=>Lyr(t,8,"0"),"stringify")},Xca={identify:UOe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>Wht(t,0,10,r),"resolve"),stringify:Xui.stringifyNumber},ela={identify:UOe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>Wht(t,2,16,r),"resolve"),stringify:a(t=>Lyr(t,16,"0x"),"stringify")};QOe.int=Xca;QOe.intBin=Jca;QOe.intHex=ela;QOe.intOct=Zca});var Fyr=I(Byr=>{"use strict";p();var Kht=ac(),zht=qG(),Yht=HG(),cte=class t extends Yht.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;Kht.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new zht.Pair(e.key,null):r=new zht.Pair(e,null),Yht.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Yht.findPair(this.items,e);return!r&&Kht.isPair(n)?Kht.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Yht.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new zht.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:o}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let c of r)typeof o=="function"&&(c=o.call(r,c,c)),s.items.push(zht.createPair(c,null,n));return s}};cte.tag="tag:yaml.org,2002:set";var tla={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:cte,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>cte.from(t,e,r),"createNode"),resolve(t,e){if(Kht.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new cte,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Byr.YAMLSet=cte;Byr.set=tla});var Qyr=I(Jht=>{"use strict";p();var rla=s0e();function Uyr(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,o=a(c=>e?BigInt(c):Number(c),"num"),s=n.replace(/_/g,"").split(":").reduce((c,l)=>c*o(60)+o(l),o(0));return r==="-"?o(-1)*s:s}a(Uyr,"parseSexagesimal");function tdi(t){let{value:e}=t,r=a(c=>c,"num");if(typeof e=="bigint")r=a(c=>BigInt(c),"num");else if(isNaN(e)||!isFinite(e))return rla.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let o=r(60),s=[e%o];return e<60?s.unshift(0):(e=(e-s[0])/o,s.unshift(e%o),e>=60&&(e=(e-s[0])/o,s.unshift(e))),n+s.map(c=>String(c).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}a(tdi,"stringifySexagesimal");var nla={identify:a(t=>typeof t=="bigint"||Number.isInteger(t),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:a((t,e,{intAsBigInt:r})=>Uyr(t,r),"resolve"),stringify:tdi},ila={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:a(t=>Uyr(t,!1),"resolve"),stringify:tdi},rdi={identify:a(t=>t instanceof Date,"identify"),default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(rdi.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,o,s,c,l]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(r,n-1,o,s||0,c||0,l||0,u),f=e[8];if(f&&f!=="Z"){let h=Uyr(f,!1);Math.abs(h)<30&&(h*=60),d-=6e4*h}return new Date(d)},stringify:a(({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};Jht.floatTime=ila;Jht.intTime=nla;Jht.timestamp=rdi});var odi=I(idi=>{"use strict";p();var ola=i0e(),sla=Fht(),ala=o0e(),cla=LOe(),lla=Ryr(),ndi=Jui(),qyr=Zui(),Zht=edi(),ula=kht(),dla=Nyr(),fla=$ht(),pla=Fyr(),jyr=Qyr(),hla=[ola.map,ala.seq,cla.string,sla.nullTag,ndi.trueTag,ndi.falseTag,Zht.intBin,Zht.intOct,Zht.int,Zht.intHex,qyr.floatNaN,qyr.floatExp,qyr.float,lla.binary,ula.merge,dla.omap,fla.pairs,pla.set,jyr.intTime,jyr.floatTime,jyr.timestamp];idi.schema=hla});var mdi=I($yr=>{"use strict";p();var ldi=i0e(),mla=Fht(),udi=o0e(),gla=LOe(),Ala=vyr(),Hyr=byr(),Gyr=Tyr(),yla=Fui(),_la=qui(),ddi=Ryr(),qOe=kht(),fdi=Nyr(),pdi=$ht(),sdi=odi(),hdi=Fyr(),Xht=Qyr(),adi=new Map([["core",yla.schema],["failsafe",[ldi.map,udi.seq,gla.string]],["json",_la.schema],["yaml11",sdi.schema],["yaml-1.1",sdi.schema]]),cdi={binary:ddi.binary,bool:Ala.boolTag,float:Hyr.float,floatExp:Hyr.floatExp,floatNaN:Hyr.floatNaN,floatTime:Xht.floatTime,int:Gyr.int,intHex:Gyr.intHex,intOct:Gyr.intOct,intTime:Xht.intTime,map:ldi.map,merge:qOe.merge,null:mla.nullTag,omap:fdi.omap,pairs:pdi.pairs,seq:udi.seq,set:hdi.set,timestamp:Xht.timestamp},Ela={"tag:yaml.org,2002:binary":ddi.binary,"tag:yaml.org,2002:merge":qOe.merge,"tag:yaml.org,2002:omap":fdi.omap,"tag:yaml.org,2002:pairs":pdi.pairs,"tag:yaml.org,2002:set":hdi.set,"tag:yaml.org,2002:timestamp":Xht.timestamp};function vla(t,e,r){let n=adi.get(e);if(n&&!t)return r&&!n.includes(qOe.merge)?n.concat(qOe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(adi.keys()).filter(c=>c!=="yaml11").map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)o=o.concat(s);else typeof t=="function"&&(o=t(o.slice()));return r&&(o=o.concat(qOe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?cdi[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys(cdi).map(f=>JSON.stringify(f)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}a(vla,"getTags");$yr.coreKnownTags=Ela;$yr.getTags=vla});var zyr=I(gdi=>{"use strict";p();var Vyr=ac(),Cla=i0e(),bla=o0e(),Sla=LOe(),emt=mdi(),Tla=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),Wyr=class t{static{a(this,"Schema")}constructor({compat:e,customTags:r,merge:n,resolveKnownTags:o,schema:s,sortMapEntries:c,toStringDefaults:l}){this.compat=Array.isArray(e)?emt.getTags(e,"compat"):e?emt.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?emt.coreKnownTags:{},this.tags=emt.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Vyr.MAP,{value:Cla.map}),Object.defineProperty(this,Vyr.SCALAR,{value:Sla.string}),Object.defineProperty(this,Vyr.SEQ,{value:bla.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?Tla:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};gdi.Schema=Wyr});var ydi=I(Adi=>{"use strict";p();var Ila=ac(),Yyr=DOe(),jOe=wOe();function xla(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let u=t.directives.toString(t);u?(r.push(u),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let o=Yyr.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(jOe.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(Ila.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(jOe.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=Yyr.stringify(t.contents,o,()=>l=null,u);l&&(d+=jOe.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(Yyr.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` `)?(r.push("..."),r.push(jOe.indentComment(u,""))):r.push(`... ${u}`)}else r.push("...");else{let u=t.comment;u&&c&&(u=u.replace(/^\n+/,"")),u&&((!c||l)&&r[r.length-1]!==""&&r.push(""),r.push(jOe.indentComment(s(u),"")))}return r.join(` `)+` -`}a(Tla,"stringifyDocument");mdi.stringifyDocument=Tla});var HOe=I(Adi=>{"use strict";p();var Ila=IOe(),a0e=Eht(),BR=ac(),xla=QG(),wla=LG(),Rla=Wyr(),kla=gdi(),Yyr=ght(),Pla=XAr(),Dla=xOe(),Kyr=ZAr(),Jyr=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,BR.NODE_TYPE,{value:BR.DOC});let o=null;typeof r=="function"||Array.isArray(r)?o=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:c}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(c=this.directives.yaml.version)):this.directives=new Kyr.Directives({version:c}),this.setSchema(c,n),this.contents=e===void 0?null:this.createNode(e,o,n)}clone(){let e=Object.create(t.prototype,{[BR.NODE_TYPE]:{value:BR.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=BR.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){c0e(this.contents)&&this.contents.add(e)}addIn(e,r){c0e(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Yyr.anchorNames(this);e.anchor=!r||n.has(r)?Yyr.findNewAnchor(r||"a",n):r}return new Ila.Alias(e.anchor)}createNode(e,r,n){let o;if(typeof r=="function")e=r.call({"":e},"",e),o=r;else if(Array.isArray(r)){let _=a(v=>typeof v=="number"||v instanceof String||v instanceof Number,"keyToStr"),E=r.filter(_).map(String);E.length>0&&(r=r.concat(E)),o=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:c,flow:l,keepUndefined:u,onTagObj:d,tag:f}=n??{},{onAnchor:h,setAnchors:m,sourceObjects:g}=Yyr.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=Dla.createNode(e,f,A);return l&&BR.isCollection(y)&&(y.flow=!0),m(),y}createPair(e,r,n={}){let o=this.createNode(e,null,n),s=this.createNode(r,null,n);return new xla.Pair(o,s)}delete(e){return c0e(this.contents)?this.contents.delete(e):!1}deleteIn(e){return a0e.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):c0e(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return BR.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return a0e.isEmptyPath(e)?!r&&BR.isScalar(this.contents)?this.contents.value:this.contents:BR.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return BR.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return a0e.isEmptyPath(e)?this.contents!==void 0:BR.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=a0e.collectionFromPath(this.schema,[e],r):c0e(this.contents)&&this.contents.set(e,r)}setIn(e,r){a0e.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=a0e.collectionFromPath(this.schema,Array.from(e),r):c0e(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Kyr.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Kyr.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let o=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Rla.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:o,onAnchor:s,reviver:c}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},u=wla.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:d,res:f}of l.anchors.values())s(f,d);return typeof c=="function"?Pla.applyReviver(c,{"":u},"",u):u}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return kla.stringifyDocument(this,e)}};function c0e(t){if(BR.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(c0e,"assertCollection");Adi.Document=Jyr});var VOe=I($Oe=>{"use strict";p();var GOe=class extends Error{static{a(this,"YAMLError")}constructor(e,r,n,o){super(),this.name=e,this.code=n,this.message=o,this.pos=r}},Zyr=class extends GOe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},Xyr=class extends GOe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},Nla=a((t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(l=>e.linePos(l));let{line:n,col:o}=r.linePos[0];r.message+=` at line ${n}, column ${o}`;let s=o-1,c=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&c.length>80){let l=Math.min(s-39,c.length-79);c="\u2026"+c.substring(l),s-=l-1}if(c.length>80&&(c=c.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(c.substring(0,s))){let l=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026 +`}a(xla,"stringifyDocument");Adi.stringifyDocument=xla});var HOe=I(_di=>{"use strict";p();var wla=IOe(),a0e=vht(),BR=ac(),Rla=qG(),kla=BG(),Pla=zyr(),Dla=ydi(),Kyr=Aht(),Nla=eyr(),Mla=xOe(),Jyr=XAr(),Zyr=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,BR.NODE_TYPE,{value:BR.DOC});let o=null;typeof r=="function"||Array.isArray(r)?o=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:c}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(c=this.directives.yaml.version)):this.directives=new Jyr.Directives({version:c}),this.setSchema(c,n),this.contents=e===void 0?null:this.createNode(e,o,n)}clone(){let e=Object.create(t.prototype,{[BR.NODE_TYPE]:{value:BR.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=BR.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){c0e(this.contents)&&this.contents.add(e)}addIn(e,r){c0e(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Kyr.anchorNames(this);e.anchor=!r||n.has(r)?Kyr.findNewAnchor(r||"a",n):r}return new wla.Alias(e.anchor)}createNode(e,r,n){let o;if(typeof r=="function")e=r.call({"":e},"",e),o=r;else if(Array.isArray(r)){let _=a(v=>typeof v=="number"||v instanceof String||v instanceof Number,"keyToStr"),E=r.filter(_).map(String);E.length>0&&(r=r.concat(E)),o=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:c,flow:l,keepUndefined:u,onTagObj:d,tag:f}=n??{},{onAnchor:h,setAnchors:m,sourceObjects:g}=Kyr.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=Mla.createNode(e,f,A);return l&&BR.isCollection(y)&&(y.flow=!0),m(),y}createPair(e,r,n={}){let o=this.createNode(e,null,n),s=this.createNode(r,null,n);return new Rla.Pair(o,s)}delete(e){return c0e(this.contents)?this.contents.delete(e):!1}deleteIn(e){return a0e.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):c0e(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return BR.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return a0e.isEmptyPath(e)?!r&&BR.isScalar(this.contents)?this.contents.value:this.contents:BR.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return BR.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return a0e.isEmptyPath(e)?this.contents!==void 0:BR.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=a0e.collectionFromPath(this.schema,[e],r):c0e(this.contents)&&this.contents.set(e,r)}setIn(e,r){a0e.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=a0e.collectionFromPath(this.schema,Array.from(e),r):c0e(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Jyr.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Jyr.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let o=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Pla.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:o,onAnchor:s,reviver:c}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},u=kla.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:d,res:f}of l.anchors.values())s(f,d);return typeof c=="function"?Nla.applyReviver(c,{"":u},"",u):u}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Dla.stringifyDocument(this,e)}};function c0e(t){if(BR.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(c0e,"assertCollection");_di.Document=Zyr});var VOe=I($Oe=>{"use strict";p();var GOe=class extends Error{static{a(this,"YAMLError")}constructor(e,r,n,o){super(),this.name=e,this.code=n,this.message=o,this.pos=r}},Xyr=class extends GOe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},e_r=class extends GOe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},Ola=a((t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(l=>e.linePos(l));let{line:n,col:o}=r.linePos[0];r.message+=` at line ${n}, column ${o}`;let s=o-1,c=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&c.length>80){let l=Math.min(s-39,c.length-79);c="\u2026"+c.substring(l),s-=l-1}if(c.length>80&&(c=c.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(c.substring(0,s))){let l=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026 `),c=l+c}if(/[^ ]/.test(c)){let l=1,u=r.linePos[1];u?.line===n&&u.col>o&&(l=Math.max(1,Math.min(u.col-o,80-s)));let d=" ".repeat(s)+"^".repeat(l);r.message+=`: ${c} ${d} -`}},"prettifyError");$Oe.YAMLError=GOe;$Oe.YAMLParseError=Zyr;$Oe.YAMLWarning=Xyr;$Oe.prettifyError=Nla});var WOe=I(ydi=>{"use strict";p();function Mla(t,{flow:e,indicator:r,next:n,offset:o,onError:s,parentIndent:c,startOnNewline:l}){let u=!1,d=l,f=l,h="",m="",g=!1,A=!1,y=null,_=null,E=null,v=null,S=null,T=null,w=null;for(let k of t)switch(A&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&s(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),A=!1),y&&(d&&k.type!=="comment"&&k.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),k.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&k.source.includes(" ")&&(y=k),f=!0;break;case"comment":{f||s(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=k.source.substring(1)||" ";h?h+=m+D:h=D,m="",d=!1;break}case"newline":d?h?h+=k.source:(!T||r!=="seq-item-ind")&&(u=!0):m+=k.source,d=!0,g=!0,(_||E)&&(v=k),f=!0;break;case"anchor":_&&s(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&s(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),_=k,w??(w=k.offset),d=!1,f=!1,A=!0;break;case"tag":{E&&s(k,"MULTIPLE_TAGS","A node can have at most one tag"),E=k,w??(w=k.offset),d=!1,f=!1,A=!0;break}case r:(_||E)&&s(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),T&&s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${e??"collection"}`),T=k,d=r==="seq-item-ind"||r==="explicit-key-ind",f=!1;break;case"comma":if(e){S&&s(k,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=k,d=!1,f=!1;break}default:s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),d=!1,f=!1}let R=t[t.length-1],x=R?R.offset+R.source.length:o;return A&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(d&&y.indent<=c||n?.type==="block-map"||n?.type==="block-seq")&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:T,spaceBefore:u,comment:h,hasNewline:g,anchor:_,tag:E,newlineAfterProp:v,end:x,start:w??x}}a(Mla,"resolveProps");ydi.resolveProps=Mla});var emt=I(_di=>{"use strict";p();function e_r(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` -`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(e_r(e.key)||e_r(e.value))return!0}return!1;default:return!0}}a(e_r,"containsNewline");_di.containsNewline=e_r});var t_r=I(Edi=>{"use strict";p();var Ola=emt();function Lla(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Ola.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(Lla,"flowIndentCheck");Edi.flowIndentCheck=Lla});var r_r=I(Cdi=>{"use strict";p();var vdi=ac();function Bla(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||vdi.isScalar(s)&&vdi.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(Bla,"mapIncludes");Cdi.mapIncludes=Bla});var wdi=I(xdi=>{"use strict";p();var bdi=QG(),Fla=jG(),Sdi=WOe(),Ula=emt(),Tdi=t_r(),Qla=r_r(),Idi="All mapping items must start at the same column";function qla({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??Fla.YAMLMap,l=new c(r.schema);r.atRoot&&(r.atRoot=!1);let u=n.offset,d=null;for(let f of n.items){let{start:h,key:m,sep:g,value:A}=f,y=Sdi.resolveProps(h,{indicator:"explicit-key-ind",next:m??g?.[0],offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0}),_=!y.found;if(_){if(m&&(m.type==="block-seq"?o(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==n.indent&&o(u,"BAD_INDENT",Idi)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` -`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||Ula.containsNewline(m))&&o(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else y.found?.indent!==n.indent&&o(u,"BAD_INDENT",Idi);r.atKey=!0;let E=y.end,v=m?t(r,m,y,o):e(r,E,h,null,y,o);r.schema.compat&&Tdi.flowIndentCheck(n.indent,m,o),r.atKey=!1,Qla.mapIncludes(r,l.items,v)&&o(E,"DUPLICATE_KEY","Map keys must be unique");let S=Sdi.resolveProps(g??[],{indicator:"map-value-ind",next:A,offset:v.range[2],onError:o,parentIndent:n.indent,startOnNewline:!m||m.type==="block-scalar"});if(u=S.end,S.found){_&&(A?.type==="block-map"&&!S.hasNewline&&o(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&y.start{"use strict";p();var jla=HG(),Hla=WOe(),Gla=t_r();function $la({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??jla.YAMLSeq,l=new c(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let u=n.offset,d=null;for(let{start:f,value:h}of n.items){let m=Hla.resolveProps(f,{indicator:"seq-item-ind",next:h,offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||h)h?.type==="block-seq"?o(m.end,"BAD_INDENT","All sequence items must start at the same column"):o(u,"MISSING_CHAR","Sequence item without - indicator");else{d=m.end,m.comment&&(l.comment=m.comment);continue}let g=h?t(r,h,m,o):e(r,m.end,f,null,m,o);r.schema.compat&&Gla.flowIndentCheck(n.indent,h,o),u=g.range[2],l.items.push(g)}return l.range=[n.offset,u,d??u],l}a($la,"resolveBlockSeq");Rdi.resolveBlockSeq=$la});var l0e=I(Pdi=>{"use strict";p();function Vla(t,e,r,n){let o="";if(t){let s=!1,c="";for(let l of t){let{source:u,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let f=u.substring(1)||" ";o?o+=c+f:o=f,c="";break}case"newline":o&&(c+=u),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=u.length}}return{comment:o,offset:e}}a(Vla,"resolveEnd");Pdi.resolveEnd=Vla});var Odi=I(Mdi=>{"use strict";p();var Wla=ac(),zla=QG(),Ddi=jG(),Yla=HG(),Kla=l0e(),Ndi=WOe(),Jla=emt(),Zla=r_r(),n_r="Block collections are not allowed within flow collections",i_r=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function Xla({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?Ddi.YAMLMap:Yla.YAMLSeq),d=new u(r.schema);d.flow=!0;let f=r.atRoot;f&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let h=n.offset+n.start.source.length;for(let _=0;_0){let _=Kla.resolveEnd(A,y,r.options.strict,o);_.comment&&(d.comment?d.comment+=` -`+_.comment:d.comment=_.comment),d.range=[n.offset,y,_.offset]}else d.range=[n.offset,y,y];return d}a(Xla,"resolveFlowCollection");Mdi.resolveFlowCollection=Xla});var Bdi=I(Ldi=>{"use strict";p();var eua=ac(),tua=Pm(),rua=jG(),nua=HG(),iua=wdi(),oua=kdi(),sua=Odi();function o_r(t,e,r,n,o,s){let c=r.type==="block-map"?iua.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?oua.resolveBlockSeq(t,e,r,n,s):sua.resolveFlowCollection(t,e,r,n,s),l=c.constructor;return o==="!"||o===l.tagName?(c.tag=l.tagName,c):(o&&(c.tag=o),c)}a(o_r,"resolveCollection");function aua(t,e,r,n,o){let s=n.tag,c=s?e.directives.tagName(s.source,m=>o(s,"TAG_RESOLVE_FAILED",m)):null;if(r.type==="block-seq"){let{anchor:m,newlineAfterProp:g}=n,A=m&&s?m.offset>s.offset?m:s:m??s;A&&(!g||g.offsetm.tag===c&&m.collection===l);if(!u){let m=e.schema.knownTags[c];if(m?.collection===l)e.schema.tags.push(Object.assign({},m,{default:!1})),u=m;else return m?o(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):o(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,!0),o_r(t,e,r,o,c)}let d=o_r(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=eua.isNode(f)?f:new tua.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(aua,"composeCollection");Ldi.composeCollection=aua});var a_r=I(Fdi=>{"use strict";p();var s_r=Pm();function cua(t,e,r){let n=e.offset,o=lua(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?s_r.Scalar.BLOCK_FOLDED:s_r.Scalar.BLOCK_LITERAL,c=e.source?uua(e.source):[],l=c.length;for(let y=c.length-1;y>=0;--y){let _=c[y][1];if(_===""||_==="\r")l=y;else break}if(l===0){let y=o.chomp==="+"&&c.length>0?` +`}},"prettifyError");$Oe.YAMLError=GOe;$Oe.YAMLParseError=Xyr;$Oe.YAMLWarning=e_r;$Oe.prettifyError=Ola});var WOe=I(Edi=>{"use strict";p();function Lla(t,{flow:e,indicator:r,next:n,offset:o,onError:s,parentIndent:c,startOnNewline:l}){let u=!1,d=l,f=l,h="",m="",g=!1,A=!1,y=null,_=null,E=null,v=null,S=null,T=null,w=null;for(let k of t)switch(A&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&s(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),A=!1),y&&(d&&k.type!=="comment"&&k.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),k.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&k.source.includes(" ")&&(y=k),f=!0;break;case"comment":{f||s(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=k.source.substring(1)||" ";h?h+=m+D:h=D,m="",d=!1;break}case"newline":d?h?h+=k.source:(!T||r!=="seq-item-ind")&&(u=!0):m+=k.source,d=!0,g=!0,(_||E)&&(v=k),f=!0;break;case"anchor":_&&s(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&s(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),_=k,w??(w=k.offset),d=!1,f=!1,A=!0;break;case"tag":{E&&s(k,"MULTIPLE_TAGS","A node can have at most one tag"),E=k,w??(w=k.offset),d=!1,f=!1,A=!0;break}case r:(_||E)&&s(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),T&&s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${e??"collection"}`),T=k,d=r==="seq-item-ind"||r==="explicit-key-ind",f=!1;break;case"comma":if(e){S&&s(k,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=k,d=!1,f=!1;break}default:s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),d=!1,f=!1}let R=t[t.length-1],x=R?R.offset+R.source.length:o;return A&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(d&&y.indent<=c||n?.type==="block-map"||n?.type==="block-seq")&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:T,spaceBefore:u,comment:h,hasNewline:g,anchor:_,tag:E,newlineAfterProp:v,end:x,start:w??x}}a(Lla,"resolveProps");Edi.resolveProps=Lla});var tmt=I(vdi=>{"use strict";p();function t_r(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(t_r(e.key)||t_r(e.value))return!0}return!1;default:return!0}}a(t_r,"containsNewline");vdi.containsNewline=t_r});var r_r=I(Cdi=>{"use strict";p();var Bla=tmt();function Fla(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Bla.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(Fla,"flowIndentCheck");Cdi.flowIndentCheck=Fla});var n_r=I(Sdi=>{"use strict";p();var bdi=ac();function Ula(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||bdi.isScalar(s)&&bdi.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(Ula,"mapIncludes");Sdi.mapIncludes=Ula});var kdi=I(Rdi=>{"use strict";p();var Tdi=qG(),Qla=HG(),Idi=WOe(),qla=tmt(),xdi=r_r(),jla=n_r(),wdi="All mapping items must start at the same column";function Hla({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??Qla.YAMLMap,l=new c(r.schema);r.atRoot&&(r.atRoot=!1);let u=n.offset,d=null;for(let f of n.items){let{start:h,key:m,sep:g,value:A}=f,y=Idi.resolveProps(h,{indicator:"explicit-key-ind",next:m??g?.[0],offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0}),_=!y.found;if(_){if(m&&(m.type==="block-seq"?o(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==n.indent&&o(u,"BAD_INDENT",wdi)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` +`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||qla.containsNewline(m))&&o(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else y.found?.indent!==n.indent&&o(u,"BAD_INDENT",wdi);r.atKey=!0;let E=y.end,v=m?t(r,m,y,o):e(r,E,h,null,y,o);r.schema.compat&&xdi.flowIndentCheck(n.indent,m,o),r.atKey=!1,jla.mapIncludes(r,l.items,v)&&o(E,"DUPLICATE_KEY","Map keys must be unique");let S=Idi.resolveProps(g??[],{indicator:"map-value-ind",next:A,offset:v.range[2],onError:o,parentIndent:n.indent,startOnNewline:!m||m.type==="block-scalar"});if(u=S.end,S.found){_&&(A?.type==="block-map"&&!S.hasNewline&&o(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&y.start{"use strict";p();var Gla=GG(),$la=WOe(),Vla=r_r();function Wla({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??Gla.YAMLSeq,l=new c(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let u=n.offset,d=null;for(let{start:f,value:h}of n.items){let m=$la.resolveProps(f,{indicator:"seq-item-ind",next:h,offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||h)h?.type==="block-seq"?o(m.end,"BAD_INDENT","All sequence items must start at the same column"):o(u,"MISSING_CHAR","Sequence item without - indicator");else{d=m.end,m.comment&&(l.comment=m.comment);continue}let g=h?t(r,h,m,o):e(r,m.end,f,null,m,o);r.schema.compat&&Vla.flowIndentCheck(n.indent,h,o),u=g.range[2],l.items.push(g)}return l.range=[n.offset,u,d??u],l}a(Wla,"resolveBlockSeq");Pdi.resolveBlockSeq=Wla});var l0e=I(Ndi=>{"use strict";p();function zla(t,e,r,n){let o="";if(t){let s=!1,c="";for(let l of t){let{source:u,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let f=u.substring(1)||" ";o?o+=c+f:o=f,c="";break}case"newline":o&&(c+=u),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=u.length}}return{comment:o,offset:e}}a(zla,"resolveEnd");Ndi.resolveEnd=zla});var Bdi=I(Ldi=>{"use strict";p();var Yla=ac(),Kla=qG(),Mdi=HG(),Jla=GG(),Zla=l0e(),Odi=WOe(),Xla=tmt(),eua=n_r(),i_r="Block collections are not allowed within flow collections",o_r=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function tua({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?Mdi.YAMLMap:Jla.YAMLSeq),d=new u(r.schema);d.flow=!0;let f=r.atRoot;f&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let h=n.offset+n.start.source.length;for(let _=0;_0){let _=Zla.resolveEnd(A,y,r.options.strict,o);_.comment&&(d.comment?d.comment+=` +`+_.comment:d.comment=_.comment),d.range=[n.offset,y,_.offset]}else d.range=[n.offset,y,y];return d}a(tua,"resolveFlowCollection");Ldi.resolveFlowCollection=tua});var Udi=I(Fdi=>{"use strict";p();var rua=ac(),nua=Dm(),iua=HG(),oua=GG(),sua=kdi(),aua=Ddi(),cua=Bdi();function s_r(t,e,r,n,o,s){let c=r.type==="block-map"?sua.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?aua.resolveBlockSeq(t,e,r,n,s):cua.resolveFlowCollection(t,e,r,n,s),l=c.constructor;return o==="!"||o===l.tagName?(c.tag=l.tagName,c):(o&&(c.tag=o),c)}a(s_r,"resolveCollection");function lua(t,e,r,n,o){let s=n.tag,c=s?e.directives.tagName(s.source,m=>o(s,"TAG_RESOLVE_FAILED",m)):null;if(r.type==="block-seq"){let{anchor:m,newlineAfterProp:g}=n,A=m&&s?m.offset>s.offset?m:s:m??s;A&&(!g||g.offsetm.tag===c&&m.collection===l);if(!u){let m=e.schema.knownTags[c];if(m?.collection===l)e.schema.tags.push(Object.assign({},m,{default:!1})),u=m;else return m?o(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):o(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,!0),s_r(t,e,r,o,c)}let d=s_r(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=rua.isNode(f)?f:new nua.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(lua,"composeCollection");Fdi.composeCollection=lua});var c_r=I(Qdi=>{"use strict";p();var a_r=Dm();function uua(t,e,r){let n=e.offset,o=dua(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?a_r.Scalar.BLOCK_FOLDED:a_r.Scalar.BLOCK_LITERAL,c=e.source?fua(e.source):[],l=c.length;for(let y=c.length-1;y>=0;--y){let _=c[y][1];if(_===""||_==="\r")l=y;else break}if(l===0){let y=o.chomp==="+"&&c.length>0?` `.repeat(Math.max(1,c.length-1)):"",_=n+o.length;return e.source&&(_+=e.source.length),{value:y,type:s,comment:o.comment,range:[n,_,_]}}let u=e.indent+o.indent,d=e.offset+o.length,f=0;for(let y=0;yu&&(u=_.length);else{_.length=l;--y)c[y][0].length>u&&(l=y+1);let h="",m="",g=!1;for(let y=0;yu||E[0]===" "?(m===" "?m=` `:!g&&m===` `&&(m=` @@ -417,75 +417,75 @@ ${d} `+c[y][0].slice(u);h[h.length-1]!==` `&&(h+=` `);break;default:h+=` -`}let A=n+o.length+e.source.length;return{value:h,type:s,comment:o.comment,range:[n,A,A]}}a(cua,"resolveBlockScalar");function lua({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:o}=e[0],s=o[0],c=0,l="",u=-1;for(let m=1;m{"use strict";p();var c_r=Pm(),dua=l0e();function fua(t,e,r){let{offset:n,type:o,source:s,end:c}=t,l,u,d=a((m,g,A)=>r(n+m,g,A),"_onError");switch(o){case"scalar":l=c_r.Scalar.PLAIN,u=pua(s,d);break;case"single-quoted-scalar":l=c_r.Scalar.QUOTE_SINGLE,u=hua(s,d);break;case"double-quoted-scalar":l=c_r.Scalar.QUOTE_DOUBLE,u=mua(s,d);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let f=n+s.length,h=dua.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(fua,"resolveFlowScalar");function pua(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),Udi(t)}a(pua,"plainValue");function hua(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Udi(t.slice(1,-1)).replace(/''/g,"'")}a(hua,"singleQuotedValue");function Udi(t){let e,r;try{e=new RegExp(`(.*?)(?{"use strict";p();var l_r=Dm(),pua=l0e();function hua(t,e,r){let{offset:n,type:o,source:s,end:c}=t,l,u,d=a((m,g,A)=>r(n+m,g,A),"_onError");switch(o){case"scalar":l=l_r.Scalar.PLAIN,u=mua(s,d);break;case"single-quoted-scalar":l=l_r.Scalar.QUOTE_SINGLE,u=gua(s,d);break;case"double-quoted-scalar":l=l_r.Scalar.QUOTE_DOUBLE,u=Aua(s,d);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let f=n+s.length,h=pua.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(hua,"resolveFlowScalar");function mua(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),qdi(t)}a(mua,"plainValue");function gua(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),qdi(t.slice(1,-1)).replace(/''/g,"'")}a(gua,"singleQuotedValue");function qdi(t){let e,r;try{e=new RegExp(`(.*?)(?s?t.slice(s,n+1):o)}else r+=o}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}a(mua,"doubleQuotedValue");function gua(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` +`)&&(r+=n>s?t.slice(s,n+1):o)}else r+=o}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}a(Aua,"doubleQuotedValue");function yua(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` `||n==="\r")&&!(n==="\r"&&t[e+2]!==` `);)n===` `&&(r+=` -`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}a(gua,"foldNewline");var Aua={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function yua(t,e,r,n){let o=t.substr(e,r),c=o.length===r&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;if(isNaN(c)){let l=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}return String.fromCodePoint(c)}a(yua,"parseCharCode");Qdi.resolveFlowScalar=fua});var Hdi=I(jdi=>{"use strict";p();var cte=ac(),qdi=Pm(),_ua=a_r(),Eua=l_r();function vua(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?_ua.resolveBlockScalar(t,e,n):Eua.resolveFlowScalar(e,t.options.strict,n),u=r?t.directives.tagName(r.source,h=>n(r,"TAG_RESOLVE_FAILED",h)):null,d;t.options.stringKeys&&t.atKey?d=t.schema[cte.SCALAR]:u?d=Cua(t.schema,o,u,r,n):e.type==="scalar"?d=bua(t,o,e,n):d=t.schema[cte.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=cte.isScalar(h)?h:new qdi.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new qdi.Scalar(o)}return f.range=l,f.source=o,s&&(f.type=s),u&&(f.tag=u),d.format&&(f.format=d.format),c&&(f.comment=c),f}a(vua,"composeScalar");function Cua(t,e,r,n,o){if(r==="!")return t[cte.SCALAR];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===r)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let c=t.knownTags[r];return c&&!c.collection?(t.tags.push(Object.assign({},c,{default:!1,test:void 0})),c):(o(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[cte.SCALAR])}a(Cua,"findScalarTagByName");function bua({atKey:t,directives:e,schema:r},n,o,s){let c=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[cte.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[cte.SCALAR];if(c.tag!==l.tag){let u=e.tagString(c.tag),d=e.tagString(l.tag),f=`Value may be parsed as either ${u} or ${d}`;s(o,"TAG_RESOLVE_FAILED",f,!0)}}return c}a(bua,"findScalarTagByTest");jdi.composeScalar=vua});var $di=I(Gdi=>{"use strict";p();function Sua(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let o=e[n];switch(o.type){case"space":case"comment":case"newline":t-=o.source.length;continue}for(o=e[++n];o?.type==="space";)t+=o.source.length,o=e[++n];break}}return t}a(Sua,"emptyScalarPosition");Gdi.emptyScalarPosition=Sua});var zdi=I(d_r=>{"use strict";p();var Tua=IOe(),Iua=ac(),xua=Bdi(),Vdi=Hdi(),wua=l0e(),Rua=$di(),kua={composeNode:Wdi,composeEmptyNode:u_r};function Wdi(t,e,r,n){let o=t.atKey,{spaceBefore:s,comment:c,anchor:l,tag:u}=r,d,f=!0;switch(e.type){case"alias":d=Pua(t,e,n),(l||u)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=Vdi.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=xua.composeCollection(kua,t,e,r,n),l&&(d.anchor=l.source.substring(1))}catch(h){let m=h instanceof Error?h.message:String(h);n(e,"RESOURCE_EXHAUSTION",m)}break;default:{let h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),f=!1}}return d??(d=u_r(t,e.offset,void 0,null,r,n)),l&&d.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),o&&t.options.stringKeys&&(!Iua.isScalar(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&n(u??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(d.spaceBefore=!0),c&&(e.type==="scalar"&&e.source===""?d.comment=c:d.commentBefore=c),t.options.keepSourceTokens&&f&&(d.srcToken=e),d}a(Wdi,"composeNode");function u_r(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:Rua.emptyScalarPosition(e,r,n),indent:-1,source:""},h=Vdi.composeScalar(t,f,l,d);return c&&(h.anchor=c.source.substring(1),h.anchor===""&&d(c,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=!0),s&&(h.comment=s,h.range[2]=u),h}a(u_r,"composeEmptyNode");function Pua({options:t},{offset:e,source:r,end:n},o){let s=new Tua.Alias(r.substring(1));s.source===""&&o(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&o(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let c=e+r.length,l=wua.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(Pua,"composeAlias");d_r.composeEmptyNode=u_r;d_r.composeNode=Wdi});var Jdi=I(Kdi=>{"use strict";p();var Dua=HOe(),Ydi=zdi(),Nua=l0e(),Mua=WOe();function Oua(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new Dua.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=Mua.resolveProps(n,{indicator:"doc-start",next:o??s?.[0],offset:r,onError:c,parentIndent:0,startOnNewline:!0});f.found&&(u.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!f.hasNewline&&c(f.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=o?Ydi.composeNode(d,o,f,c):Ydi.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=Nua.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(Oua,"composeDoc");Kdi.composeDoc=Oua});var p_r=I(efi=>{"use strict";p();var Lua=require("process"),Bua=ZAr(),Fua=HOe(),zOe=VOe(),Zdi=ac(),Uua=Jdi(),Qua=l0e();function YOe(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}a(YOe,"getErrorPos");function Xdi(t){let e="",r=!1,n=!1;for(let o=0;o{"use strict";p();var lte=ac(),Hdi=Dm(),vua=c_r(),Cua=u_r();function bua(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?vua.resolveBlockScalar(t,e,n):Cua.resolveFlowScalar(e,t.options.strict,n),u=r?t.directives.tagName(r.source,h=>n(r,"TAG_RESOLVE_FAILED",h)):null,d;t.options.stringKeys&&t.atKey?d=t.schema[lte.SCALAR]:u?d=Sua(t.schema,o,u,r,n):e.type==="scalar"?d=Tua(t,o,e,n):d=t.schema[lte.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=lte.isScalar(h)?h:new Hdi.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new Hdi.Scalar(o)}return f.range=l,f.source=o,s&&(f.type=s),u&&(f.tag=u),d.format&&(f.format=d.format),c&&(f.comment=c),f}a(bua,"composeScalar");function Sua(t,e,r,n,o){if(r==="!")return t[lte.SCALAR];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===r)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let c=t.knownTags[r];return c&&!c.collection?(t.tags.push(Object.assign({},c,{default:!1,test:void 0})),c):(o(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[lte.SCALAR])}a(Sua,"findScalarTagByName");function Tua({atKey:t,directives:e,schema:r},n,o,s){let c=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[lte.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[lte.SCALAR];if(c.tag!==l.tag){let u=e.tagString(c.tag),d=e.tagString(l.tag),f=`Value may be parsed as either ${u} or ${d}`;s(o,"TAG_RESOLVE_FAILED",f,!0)}}return c}a(Tua,"findScalarTagByTest");Gdi.composeScalar=bua});var Wdi=I(Vdi=>{"use strict";p();function Iua(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let o=e[n];switch(o.type){case"space":case"comment":case"newline":t-=o.source.length;continue}for(o=e[++n];o?.type==="space";)t+=o.source.length,o=e[++n];break}}return t}a(Iua,"emptyScalarPosition");Vdi.emptyScalarPosition=Iua});var Kdi=I(f_r=>{"use strict";p();var xua=IOe(),wua=ac(),Rua=Udi(),zdi=$di(),kua=l0e(),Pua=Wdi(),Dua={composeNode:Ydi,composeEmptyNode:d_r};function Ydi(t,e,r,n){let o=t.atKey,{spaceBefore:s,comment:c,anchor:l,tag:u}=r,d,f=!0;switch(e.type){case"alias":d=Nua(t,e,n),(l||u)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=zdi.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=Rua.composeCollection(Dua,t,e,r,n),l&&(d.anchor=l.source.substring(1))}catch(h){let m=h instanceof Error?h.message:String(h);n(e,"RESOURCE_EXHAUSTION",m)}break;default:{let h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),f=!1}}return d??(d=d_r(t,e.offset,void 0,null,r,n)),l&&d.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),o&&t.options.stringKeys&&(!wua.isScalar(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&n(u??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(d.spaceBefore=!0),c&&(e.type==="scalar"&&e.source===""?d.comment=c:d.commentBefore=c),t.options.keepSourceTokens&&f&&(d.srcToken=e),d}a(Ydi,"composeNode");function d_r(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:Pua.emptyScalarPosition(e,r,n),indent:-1,source:""},h=zdi.composeScalar(t,f,l,d);return c&&(h.anchor=c.source.substring(1),h.anchor===""&&d(c,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=!0),s&&(h.comment=s,h.range[2]=u),h}a(d_r,"composeEmptyNode");function Nua({options:t},{offset:e,source:r,end:n},o){let s=new xua.Alias(r.substring(1));s.source===""&&o(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&o(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let c=e+r.length,l=kua.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(Nua,"composeAlias");f_r.composeEmptyNode=d_r;f_r.composeNode=Ydi});var Xdi=I(Zdi=>{"use strict";p();var Mua=HOe(),Jdi=Kdi(),Oua=l0e(),Lua=WOe();function Bua(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new Mua.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=Lua.resolveProps(n,{indicator:"doc-start",next:o??s?.[0],offset:r,onError:c,parentIndent:0,startOnNewline:!0});f.found&&(u.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!f.hasNewline&&c(f.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=o?Jdi.composeNode(d,o,f,c):Jdi.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=Oua.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(Bua,"composeDoc");Zdi.composeDoc=Bua});var h_r=I(rfi=>{"use strict";p();var Fua=require("process"),Uua=XAr(),Qua=HOe(),zOe=VOe(),efi=ac(),qua=Xdi(),jua=l0e();function YOe(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}a(YOe,"getErrorPos");function tfi(t){let e="",r=!1,n=!1;for(let o=0;o{let c=YOe(r);s?this.warnings.push(new zOe.YAMLWarning(c,n,o)):this.errors.push(new zOe.YAMLParseError(c,n,o))},this.directives=new Bua.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=Xdi(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment} -${n}`:n;else if(o||e.directives.docStart||!s)e.commentBefore=n;else if(Zdi.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];Zdi.isPair(c)&&(c=c.key);let l=c.commentBefore;c.commentBefore=l?`${n} +`)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[o+1]?.[0]!=="#"&&(o+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}a(tfi,"parsePrelude");var p_r=class{static{a(this,"Composer")}constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,o,s)=>{let c=YOe(r);s?this.warnings.push(new zOe.YAMLWarning(c,n,o)):this.errors.push(new zOe.YAMLParseError(c,n,o))},this.directives=new Uua.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=tfi(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment} +${n}`:n;else if(o||e.directives.docStart||!s)e.commentBefore=n;else if(efi.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];efi.isPair(c)&&(c=c.key);let l=c.commentBefore;c.commentBefore=l?`${n} ${l}`:n}else{let c=s.commentBefore;s.commentBefore=c?`${n} -${c}`:n}}r?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Xdi(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let o of e)yield*this.next(o);yield*this.end(r,n)}*next(e){switch(Lua.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=YOe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Uua.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new zOe.YAMLParseError(YOe(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new zOe.YAMLParseError(YOe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Qua.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} -${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new zOe.YAMLParseError(YOe(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),o=new Fua.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,r,r],this.decorate(o,!1),yield o}}};efi.Composer=f_r});var nfi=I(tmt=>{"use strict";p();var qua=a_r(),jua=l_r(),Hua=VOe(),tfi=POe();function Gua(t,e=!0,r){if(t){let n=a((o,s,c)=>{let l=typeof o=="number"?o:Array.isArray(o)?o[0]:o.offset;if(r)r(l,s,c);else throw new Hua.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return jua.resolveFlowScalar(t,e,n);case"block-scalar":return qua.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(Gua,"resolveAsScalar");function $ua(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=tfi.stringifyString({type:c,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),u=e.end??[{type:"newline",offset:-1,indent:n,source:` +${c}`:n}}r?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:tfi(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let o of e)yield*this.next(o);yield*this.end(r,n)}*next(e){switch(Fua.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=YOe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=qua.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new zOe.YAMLParseError(YOe(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new zOe.YAMLParseError(YOe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=jua.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} +${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new zOe.YAMLParseError(YOe(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),o=new Qua.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,r,r],this.decorate(o,!1),yield o}}};rfi.Composer=p_r});var ofi=I(rmt=>{"use strict";p();var Hua=c_r(),Gua=u_r(),$ua=VOe(),nfi=POe();function Vua(t,e=!0,r){if(t){let n=a((o,s,c)=>{let l=typeof o=="number"?o:Array.isArray(o)?o[0]:o.offset;if(r)r(l,s,c);else throw new $ua.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Gua.resolveFlowScalar(t,e,n);case"block-scalar":return Hua.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(Vua,"resolveAsScalar");function Wua(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=nfi.stringifyString({type:c,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),u=e.end??[{type:"newline",offset:-1,indent:n,source:` `}];switch(l[0]){case"|":case">":{let d=l.indexOf(` `),f=l.substring(0,d),h=l.substring(d+1)+` -`,m=[{type:"block-scalar-header",offset:s,indent:n,source:f}];return rfi(m,u)||m.push({type:"newline",offset:-1,indent:n,source:` -`}),{type:"block-scalar",offset:s,indent:n,props:m,source:h}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:l,end:u};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:l,end:u};default:return{type:"scalar",offset:s,indent:n,source:l,end:u}}}a($ua,"createScalarToken");function Vua(t,e,r={}){let{afterKey:n=!1,implicitKey:o=!1,inFlow:s=!1,type:c}=r,l="indent"in t?t.indent:null;if(n&&typeof l=="number"&&(l+=2),!c)switch(t.type){case"single-quoted-scalar":c="QUOTE_SINGLE";break;case"double-quoted-scalar":c="QUOTE_DOUBLE";break;case"block-scalar":{let d=t.props[0];if(d.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c=d.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:c="PLAIN"}let u=tfi.stringifyString({type:c,value:e},{implicitKey:o||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":Wua(t,u);break;case'"':h_r(t,u,"double-quoted-scalar");break;case"'":h_r(t,u,"single-quoted-scalar");break;default:h_r(t,u,"scalar")}}a(Vua,"setScalarValue");function Wua(t,e){let r=e.indexOf(` +`,m=[{type:"block-scalar-header",offset:s,indent:n,source:f}];return ifi(m,u)||m.push({type:"newline",offset:-1,indent:n,source:` +`}),{type:"block-scalar",offset:s,indent:n,props:m,source:h}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:l,end:u};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:l,end:u};default:return{type:"scalar",offset:s,indent:n,source:l,end:u}}}a(Wua,"createScalarToken");function zua(t,e,r={}){let{afterKey:n=!1,implicitKey:o=!1,inFlow:s=!1,type:c}=r,l="indent"in t?t.indent:null;if(n&&typeof l=="number"&&(l+=2),!c)switch(t.type){case"single-quoted-scalar":c="QUOTE_SINGLE";break;case"double-quoted-scalar":c="QUOTE_DOUBLE";break;case"block-scalar":{let d=t.props[0];if(d.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c=d.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:c="PLAIN"}let u=nfi.stringifyString({type:c,value:e},{implicitKey:o||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":Yua(t,u);break;case'"':m_r(t,u,"double-quoted-scalar");break;case"'":m_r(t,u,"single-quoted-scalar");break;default:m_r(t,u,"scalar")}}a(zua,"setScalarValue");function Yua(t,e){let r=e.indexOf(` `),n=e.substring(0,r),o=e.substring(r+1)+` -`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=o}else{let{offset:s}=t,c="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:c,source:n}];rfi(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:c,source:` -`});for(let u of Object.keys(t))u!=="type"&&u!=="offset"&&delete t[u];Object.assign(t,{type:"block-scalar",indent:c,props:l,source:o})}}a(Wua,"setBlockScalarValue");function rfi(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}a(rfi,"addEndtoBlockProps");function h_r(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),o=e.length;t.props[0].type==="block-scalar-header"&&(o-=t.props[0].source.length);for(let s of n)s.offset+=o;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let o={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` -`};delete t.items,Object.assign(t,{type:r,source:e,end:[o]});break}default:{let n="indent"in t?t.indent:-1,o="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:o})}}}a(h_r,"setFlowScalarValue");tmt.createScalarToken=$ua;tmt.resolveAsScalar=Gua;tmt.setScalarValue=Vua});var ofi=I(ifi=>{"use strict";p();var zua=a(t=>"type"in t?nmt(t):rmt(t),"stringify");function nmt(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=nmt(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=rmt(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=rmt(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=rmt(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}a(nmt,"stringifyToken");function rmt({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=nmt(e)),r)for(let s of r)o+=s.source;return n&&(o+=nmt(n)),o}a(rmt,"stringifyItem");ifi.stringify=zua});var lfi=I(cfi=>{"use strict";p();var m_r=Symbol("break visit"),Yua=Symbol("skip children"),sfi=Symbol("remove item");function lte(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),afi(Object.freeze([]),t,e)}a(lte,"visit");lte.BREAK=m_r;lte.SKIP=Yua;lte.REMOVE=sfi;lte.itemAtPath=(t,e)=>{let r=t;for(let[n,o]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[o];else return}return r};lte.parentCollection=(t,e)=>{let r=lte.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],o=r?.[n];if(o&&"items"in o)return o;throw new Error("Parent collection not found")};function afi(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let o of["key","value"]){let s=e[o];if(s&&"items"in s){for(let c=0;c{"use strict";p();var g_r=nfi(),Kua=ofi(),Jua=lfi(),A_r="\uFEFF",y_r="",__r="",E_r="",Zua=a(t=>!!t&&"items"in t,"isCollection"),Xua=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function eda(t){switch(t){case A_r:return"";case y_r:return"";case __r:return"";case E_r:return"";default:return JSON.stringify(t)}}a(eda,"prettyToken");function tda(t){switch(t){case A_r:return"byte-order-mark";case y_r:return"doc-mode";case __r:return"flow-error-end";case E_r:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=o}else{let{offset:s}=t,c="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:c,source:n}];ifi(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:c,source:` +`});for(let u of Object.keys(t))u!=="type"&&u!=="offset"&&delete t[u];Object.assign(t,{type:"block-scalar",indent:c,props:l,source:o})}}a(Yua,"setBlockScalarValue");function ifi(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}a(ifi,"addEndtoBlockProps");function m_r(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),o=e.length;t.props[0].type==="block-scalar-header"&&(o-=t.props[0].source.length);for(let s of n)s.offset+=o;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let o={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:r,source:e,end:[o]});break}default:{let n="indent"in t?t.indent:-1,o="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:o})}}}a(m_r,"setFlowScalarValue");rmt.createScalarToken=Wua;rmt.resolveAsScalar=Vua;rmt.setScalarValue=zua});var afi=I(sfi=>{"use strict";p();var Kua=a(t=>"type"in t?imt(t):nmt(t),"stringify");function imt(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=imt(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=nmt(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=nmt(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=nmt(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}a(imt,"stringifyToken");function nmt({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=imt(e)),r)for(let s of r)o+=s.source;return n&&(o+=imt(n)),o}a(nmt,"stringifyItem");sfi.stringify=Kua});var dfi=I(ufi=>{"use strict";p();var g_r=Symbol("break visit"),Jua=Symbol("skip children"),cfi=Symbol("remove item");function ute(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),lfi(Object.freeze([]),t,e)}a(ute,"visit");ute.BREAK=g_r;ute.SKIP=Jua;ute.REMOVE=cfi;ute.itemAtPath=(t,e)=>{let r=t;for(let[n,o]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[o];else return}return r};ute.parentCollection=(t,e)=>{let r=ute.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],o=r?.[n];if(o&&"items"in o)return o;throw new Error("Parent collection not found")};function lfi(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let o of["key","value"]){let s=e[o];if(s&&"items"in s){for(let c=0;c{"use strict";p();var A_r=ofi(),Zua=afi(),Xua=dfi(),y_r="\uFEFF",__r="",E_r="",v_r="",eda=a(t=>!!t&&"items"in t,"isCollection"),tda=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function rda(t){switch(t){case y_r:return"";case __r:return"";case E_r:return"";case v_r:return"";default:return JSON.stringify(t)}}a(rda,"prettyToken");function nda(t){switch(t){case y_r:return"byte-order-mark";case __r:return"doc-mode";case E_r:return"flow-error-end";case v_r:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}a(tda,"tokenType");iS.createScalarToken=g_r.createScalarToken;iS.resolveAsScalar=g_r.resolveAsScalar;iS.setScalarValue=g_r.setScalarValue;iS.stringify=Kua.stringify;iS.visit=Jua.visit;iS.BOM=A_r;iS.DOCUMENT=y_r;iS.FLOW_END=__r;iS.SCALAR=E_r;iS.isCollection=Zua;iS.isScalar=Xua;iS.prettyToken=eda;iS.tokenType=tda});var b_r=I(dfi=>{"use strict";p();var KOe=imt();function wD(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}a(wD,"isEmpty");var ufi=new Set("0123456789ABCDEFabcdef"),rda=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),omt=new Set(",[]{}"),nda=new Set(` ,[]{} -\r `),v_r=a(t=>!t||nda.has(t),"isNotAnchorChar"),C_r=class{static{a(this,"Lexer")}constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}a(nda,"tokenType");iS.createScalarToken=A_r.createScalarToken;iS.resolveAsScalar=A_r.resolveAsScalar;iS.setScalarValue=A_r.setScalarValue;iS.stringify=Zua.stringify;iS.visit=Xua.visit;iS.BOM=y_r;iS.DOCUMENT=__r;iS.FLOW_END=E_r;iS.SCALAR=v_r;iS.isCollection=eda;iS.isScalar=tda;iS.prettyToken=rda;iS.tokenType=nda});var S_r=I(pfi=>{"use strict";p();var KOe=omt();function wD(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}a(wD,"isEmpty");var ffi=new Set("0123456789ABCDEFabcdef"),ida=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),smt=new Set(",[]{}"),oda=new Set(` ,[]{} +\r `),C_r=a(t=>!t||oda.has(t),"isNotAnchorChar"),b_r=class{static{a(this,"Lexer")}constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` `?!0:r==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let o=this.buffer[n+e+1];if(o===` `||!o&&!this.atEnd)return e+n+1}return r===` `||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&wD(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!wD(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&wD(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(v_r),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let o=this.getLine();if(o===null)return this.setNext("flow");if((n!==-1&&nthis.indentValue&&!wD(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&wD(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(C_r),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let o=this.getLine();if(o===null)return this.setNext("flow");if((n!==-1&&n"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>wD(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case` `:e=s,r=0;break;case"\r":{let c=this.buffer[s+1];if(!c&&!this.atEnd)return this.setNext("block-scalar");if(c===` `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(` `,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let o=e+1;for(n=this.buffer[o];n===" ";)n=this.buffer[++o];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===` `;)n=this.buffer[++o];e=o-1}else if(!this.blockScalarKeep)do{let s=e-1,c=this.buffer[s];c==="\r"&&(c=this.buffer[--s]);let l=s;for(;c===" ";)c=this.buffer[--s];if(c===` -`&&s>=this.pos&&s+1+r>l)e=s;else break}while(!0);return yield KOe.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,o;for(;o=this.buffer[++n];)if(o===":"){let s=this.buffer[n+1];if(wD(s)||e&&omt.has(s))break;r=n}else if(wD(o)){let s=this.buffer[n+1];if(o==="\r"&&(s===` +`&&s>=this.pos&&s+1+r>l)e=s;else break}while(!0);return yield KOe.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,o;for(;o=this.buffer[++n];)if(o===":"){let s=this.buffer[n+1];if(wD(s)||e&&smt.has(s))break;r=n}else if(wD(o)){let s=this.buffer[n+1];if(o==="\r"&&(s===` `?(n+=1,o=` -`,s=this.buffer[n+1]):r=n),s==="#"||e&&omt.has(s))break;if(o===` -`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&omt.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield KOe.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(v_r))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(wD(r)||e&&omt.has(r))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!wD(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(rda.has(r))r=this.buffer[++e];else if(r==="%"&&ufi.has(this.buffer[e+1])&&ufi.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` +`,s=this.buffer[n+1]):r=n),s==="#"||e&&smt.has(s))break;if(o===` +`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&smt.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield KOe.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(C_r))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(wD(r)||e&&smt.has(r))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!wD(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(ida.has(r))r=this.buffer[++e];else if(r==="%"&&ffi.has(this.buffer[e+1])&&ffi.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let o=r-this.pos;return o>0&&(yield this.buffer.substr(this.pos,o),this.pos=r),o}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};dfi.Lexer=C_r});var T_r=I(ffi=>{"use strict";p();var S_r=class{static{a(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[s]{"use strict";p();var ida=require("process"),pfi=imt(),oda=b_r();function GG(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}a(u0e,"getFirstKeyStartProps");function mfi(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!GG(e.start,"explicit-key-ind")&&!GG(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,gfi(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}a(mfi,"fixFlowSeqItems");var I_r=class{static{a(this,"Parser")}constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new oda.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,ida.env.LOG_TOKENS&&console.log("|",pfi.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=pfi.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&mfi(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let o=n.items[n.items.length-1];if(o.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=r;else{Object.assign(o,{key:r,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{let o=n.items[n.items.length-1];o.value?n.items.push({start:[],value:r}):o.value=r;break}case"flow-collection":{let o=n.items[n.items.length-1];!o||o.value?n.items.push({start:[],key:r,sep:[]}):o.sep?o.value=r:Object.assign(o,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let o=r.items[r.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&hfi(o.start)===-1&&(r.indent===0||o.start.every(s=>s.type!=="comment"||s.indent0&&(yield this.buffer.substr(this.pos,o),this.pos=r),o}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};pfi.Lexer=b_r});var I_r=I(hfi=>{"use strict";p();var T_r=class{static{a(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[s]{"use strict";p();var sda=require("process"),mfi=omt(),ada=S_r();function $G(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}a(u0e,"getFirstKeyStartProps");function Afi(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!$G(e.start,"explicit-key-ind")&&!$G(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,yfi(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}a(Afi,"fixFlowSeqItems");var x_r=class{static{a(this,"Parser")}constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new ada.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,sda.env.LOG_TOKENS&&console.log("|",mfi.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=mfi.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&Afi(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let o=n.items[n.items.length-1];if(o.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=r;else{Object.assign(o,{key:r,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{let o=n.items[n.items.length-1];o.value?n.items.push({start:[],value:r}):o.value=r;break}case"flow-collection":{let o=n.items[n.items.length-1];!o||o.value?n.items.push({start:[],key:r,sep:[]}):o.sep?o.value=r:Object.assign(o,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let o=r.items[r.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&gfi(o.start)===-1&&(r.indent===0||o.start.every(s=>s.type!=="comment"||s.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,o=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(o&&r.sep&&!r.value){let c=[];for(let l=0;le.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(s=r.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":o||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):o||r.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(GG(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(gfi(r.key)&&!GG(r.sep,"newline")){let c=u0e(r.start),l=r.key,u=r.sep;u.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:l,sep:u}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(GG(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=u0e(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||o?e.items.push({start:s,key:null,sep:[this.sourceToken]}):GG(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let c=this.flowScalar(this.type);o||r.value?(e.items.push({start:s,key:c,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(c):(Object.assign(r,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{let c=this.startBlockValue(e);if(c){if(c.type==="block-seq"){if(!r.explicitKey&&r.sep&&!GG(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let o=e.items[e.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,r.start),o.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||GG(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:o,sep:[]}):r.sep?this.stack.push(o):Object.assign(r,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let o=smt(n),s=u0e(o);mfi(e);let c=e.end.splice(1,e.end.length);c.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:c}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` +`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let o=e.items[e.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,r.start),o.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,o=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(o&&r.sep&&!r.value){let c=[];for(let l=0;le.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(s=r.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":o||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):o||r.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if($G(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(yfi(r.key)&&!$G(r.sep,"newline")){let c=u0e(r.start),l=r.key,u=r.sep;u.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:l,sep:u}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if($G(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=u0e(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||o?e.items.push({start:s,key:null,sep:[this.sourceToken]}):$G(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let c=this.flowScalar(this.type);o||r.value?(e.items.push({start:s,key:c,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(c):(Object.assign(r,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{let c=this.startBlockValue(e);if(c){if(c.type==="block-seq"){if(!r.explicitKey&&r.sep&&!$G(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let o=e.items[e.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,r.start),o.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||$G(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:o,sep:[]}):r.sep?this.stack.push(o):Object.assign(r,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let o=amt(n),s=u0e(o);Afi(e);let c=e.end.splice(1,e.end.length);c.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:c}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(` -`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=smt(e),n=u0e(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=smt(e),n=u0e(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Afi.Parser=I_r});var Cfi=I(ZOe=>{"use strict";p();var yfi=p_r(),sda=HOe(),JOe=VOe(),ada=dyr(),cda=ac(),lda=T_r(),_fi=x_r();function Efi(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new lda.LineCounter||null,prettyErrors:e}}a(Efi,"parseOptions");function uda(t,e={}){let{lineCounter:r,prettyErrors:n}=Efi(e),o=new _fi.Parser(r?.addNewLine),s=new yfi.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(JOe.prettifyError(t,r)),l.warnings.forEach(JOe.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(uda,"parseAllDocuments");function vfi(t,e={}){let{lineCounter:r,prettyErrors:n}=Efi(e),o=new _fi.Parser(r?.addNewLine),s=new yfi.Composer(e),c=null;for(let l of s.compose(o.parse(t),!0,t.length))if(!c)c=l;else if(c.options.logLevel!=="silent"){c.errors.push(new JOe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(JOe.prettifyError(t,r)),c.warnings.forEach(JOe.prettifyError(t,r))),c}a(vfi,"parseDocument");function dda(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=vfi(t,r);if(!o)return null;if(o.warnings.forEach(s=>ada.warn(o.options.logLevel,s)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:n},r))}a(dda,"parse");function fda(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let o=Math.round(r);r=o<1?void 0:o>8?{indent:8}:{indent:o}}if(t===void 0){let{keepUndefined:o}=r??e??{};if(!o)return}return cda.isDocument(t)&&!n?t.toString(r):new sda.Document(t,n,r).toString(r)}a(fda,"stringify");ZOe.parse=dda;ZOe.parseAllDocuments=uda;ZOe.parseDocument=vfi;ZOe.stringify=fda});var Sfi=I(tl=>{"use strict";p();var pda=p_r(),hda=HOe(),mda=Wyr(),w_r=VOe(),gda=IOe(),$G=ac(),Ada=QG(),yda=Pm(),_da=jG(),Eda=HG(),vda=imt(),Cda=b_r(),bda=T_r(),Sda=x_r(),amt=Cfi(),bfi=COe();tl.Composer=pda.Composer;tl.Document=hda.Document;tl.Schema=mda.Schema;tl.YAMLError=w_r.YAMLError;tl.YAMLParseError=w_r.YAMLParseError;tl.YAMLWarning=w_r.YAMLWarning;tl.Alias=gda.Alias;tl.isAlias=$G.isAlias;tl.isCollection=$G.isCollection;tl.isDocument=$G.isDocument;tl.isMap=$G.isMap;tl.isNode=$G.isNode;tl.isPair=$G.isPair;tl.isScalar=$G.isScalar;tl.isSeq=$G.isSeq;tl.Pair=Ada.Pair;tl.Scalar=yda.Scalar;tl.YAMLMap=_da.YAMLMap;tl.YAMLSeq=Eda.YAMLSeq;tl.CST=vda;tl.Lexer=Cda.Lexer;tl.LineCounter=bda.LineCounter;tl.Parser=Sda.Parser;tl.parse=amt.parse;tl.parseAllDocuments=amt.parseAllDocuments;tl.parseDocument=amt.parseDocument;tl.stringify=amt.stringify;tl.visit=bfi.visit;tl.visitAsync=bfi.visitAsync});var Tfi=I(cmt=>{"use strict";p();Object.defineProperty(cmt,"__esModule",{value:!0});cmt.FetchCancellationError=void 0;var Tda=Os(),R_r=class extends Tda.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};cmt.FetchCancellationError=R_r});var Ks=I(VG=>{"use strict";p();Object.defineProperty(VG,"__esModule",{value:!0});VG.IInstantiationService=VG._util=void 0;VG.createDecorator=Ifi;VG.refineServiceDecorator=xda;var f6;(function(t){t.serviceIds=new Map,t.DI_TARGET="$di$target",t.DI_DEPENDENCIES="$di$dependencies";function e(r){return r[t.DI_DEPENDENCIES]||[]}a(e,"getServiceDependencies"),t.getServiceDependencies=e})(f6||(VG._util=f6={}));VG.IInstantiationService=Ifi("instantiationService");function Ida(t,e,r){e[f6.DI_TARGET]===e?e[f6.DI_DEPENDENCIES].push({id:t,index:r}):(e[f6.DI_DEPENDENCIES]=[{id:t,index:r}],e[f6.DI_TARGET]=e)}a(Ida,"storeServiceDependency");function Ifi(t){if(f6.serviceIds.has(t))return f6.serviceIds.get(t);let e=a(function(r,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Ida(e,r,o)},"id");return e.toString=()=>t,f6.serviceIds.set(t,e),e}a(Ifi,"createDecorator");function xda(t){return t}a(xda,"refineServiceDecorator")});var umt=I(lmt=>{"use strict";p();Object.defineProperty(lmt,"__esModule",{value:!0});lmt.SyncDescriptor=void 0;var k_r=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};lmt.SyncDescriptor=k_r});var xfi=I(d0e=>{"use strict";p();Object.defineProperty(d0e,"__esModule",{value:!0});d0e.Graph=d0e.Node=void 0;var dmt=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};d0e.Node=dmt;var P_r=class{static{a(this,"Graph")}constructor(e){this._hashFn=e,this._nodes=new Map}roots(){let e=[];for(let r of this._nodes.values())r.outgoing.size===0&&e.push(r);return e}insertEdge(e,r){let n=this.lookupOrInsertNode(e),o=this.lookupOrInsertNode(r);n.outgoing.set(o.key,o),o.incoming.set(n.key,n)}removeNode(e){let r=this._hashFn(e);this._nodes.delete(r);for(let n of this._nodes.values())n.outgoing.delete(r),n.incoming.delete(r)}lookupOrInsertNode(e){let r=this._hashFn(e),n=this._nodes.get(r);return n||(n=new dmt(r,e),this._nodes.set(r,n)),n}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[r,n]of this._nodes)e.push(`${r} +`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=amt(e),n=u0e(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=amt(e),n=u0e(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};_fi.Parser=x_r});var Sfi=I(ZOe=>{"use strict";p();var Efi=h_r(),cda=HOe(),JOe=VOe(),lda=fyr(),uda=ac(),dda=I_r(),vfi=w_r();function Cfi(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new dda.LineCounter||null,prettyErrors:e}}a(Cfi,"parseOptions");function fda(t,e={}){let{lineCounter:r,prettyErrors:n}=Cfi(e),o=new vfi.Parser(r?.addNewLine),s=new Efi.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(JOe.prettifyError(t,r)),l.warnings.forEach(JOe.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(fda,"parseAllDocuments");function bfi(t,e={}){let{lineCounter:r,prettyErrors:n}=Cfi(e),o=new vfi.Parser(r?.addNewLine),s=new Efi.Composer(e),c=null;for(let l of s.compose(o.parse(t),!0,t.length))if(!c)c=l;else if(c.options.logLevel!=="silent"){c.errors.push(new JOe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(JOe.prettifyError(t,r)),c.warnings.forEach(JOe.prettifyError(t,r))),c}a(bfi,"parseDocument");function pda(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=bfi(t,r);if(!o)return null;if(o.warnings.forEach(s=>lda.warn(o.options.logLevel,s)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:n},r))}a(pda,"parse");function hda(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let o=Math.round(r);r=o<1?void 0:o>8?{indent:8}:{indent:o}}if(t===void 0){let{keepUndefined:o}=r??e??{};if(!o)return}return uda.isDocument(t)&&!n?t.toString(r):new cda.Document(t,n,r).toString(r)}a(hda,"stringify");ZOe.parse=pda;ZOe.parseAllDocuments=fda;ZOe.parseDocument=bfi;ZOe.stringify=hda});var Ifi=I(tl=>{"use strict";p();var mda=h_r(),gda=HOe(),Ada=zyr(),R_r=VOe(),yda=IOe(),VG=ac(),_da=qG(),Eda=Dm(),vda=HG(),Cda=GG(),bda=omt(),Sda=S_r(),Tda=I_r(),Ida=w_r(),cmt=Sfi(),Tfi=COe();tl.Composer=mda.Composer;tl.Document=gda.Document;tl.Schema=Ada.Schema;tl.YAMLError=R_r.YAMLError;tl.YAMLParseError=R_r.YAMLParseError;tl.YAMLWarning=R_r.YAMLWarning;tl.Alias=yda.Alias;tl.isAlias=VG.isAlias;tl.isCollection=VG.isCollection;tl.isDocument=VG.isDocument;tl.isMap=VG.isMap;tl.isNode=VG.isNode;tl.isPair=VG.isPair;tl.isScalar=VG.isScalar;tl.isSeq=VG.isSeq;tl.Pair=_da.Pair;tl.Scalar=Eda.Scalar;tl.YAMLMap=vda.YAMLMap;tl.YAMLSeq=Cda.YAMLSeq;tl.CST=bda;tl.Lexer=Sda.Lexer;tl.LineCounter=Tda.LineCounter;tl.Parser=Ida.Parser;tl.parse=cmt.parse;tl.parseAllDocuments=cmt.parseAllDocuments;tl.parseDocument=cmt.parseDocument;tl.stringify=cmt.stringify;tl.visit=Tfi.visit;tl.visitAsync=Tfi.visitAsync});var xfi=I(lmt=>{"use strict";p();Object.defineProperty(lmt,"__esModule",{value:!0});lmt.FetchCancellationError=void 0;var xda=Os(),k_r=class extends xda.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};lmt.FetchCancellationError=k_r});var Ks=I(WG=>{"use strict";p();Object.defineProperty(WG,"__esModule",{value:!0});WG.IInstantiationService=WG._util=void 0;WG.createDecorator=wfi;WG.refineServiceDecorator=Rda;var f6;(function(t){t.serviceIds=new Map,t.DI_TARGET="$di$target",t.DI_DEPENDENCIES="$di$dependencies";function e(r){return r[t.DI_DEPENDENCIES]||[]}a(e,"getServiceDependencies"),t.getServiceDependencies=e})(f6||(WG._util=f6={}));WG.IInstantiationService=wfi("instantiationService");function wda(t,e,r){e[f6.DI_TARGET]===e?e[f6.DI_DEPENDENCIES].push({id:t,index:r}):(e[f6.DI_DEPENDENCIES]=[{id:t,index:r}],e[f6.DI_TARGET]=e)}a(wda,"storeServiceDependency");function wfi(t){if(f6.serviceIds.has(t))return f6.serviceIds.get(t);let e=a(function(r,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");wda(e,r,o)},"id");return e.toString=()=>t,f6.serviceIds.set(t,e),e}a(wfi,"createDecorator");function Rda(t){return t}a(Rda,"refineServiceDecorator")});var dmt=I(umt=>{"use strict";p();Object.defineProperty(umt,"__esModule",{value:!0});umt.SyncDescriptor=void 0;var P_r=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};umt.SyncDescriptor=P_r});var Rfi=I(d0e=>{"use strict";p();Object.defineProperty(d0e,"__esModule",{value:!0});d0e.Graph=d0e.Node=void 0;var fmt=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};d0e.Node=fmt;var D_r=class{static{a(this,"Graph")}constructor(e){this._hashFn=e,this._nodes=new Map}roots(){let e=[];for(let r of this._nodes.values())r.outgoing.size===0&&e.push(r);return e}insertEdge(e,r){let n=this.lookupOrInsertNode(e),o=this.lookupOrInsertNode(r);n.outgoing.set(o.key,o),o.incoming.set(n.key,n)}removeNode(e){let r=this._hashFn(e);this._nodes.delete(r);for(let n of this._nodes.values())n.outgoing.delete(r),n.incoming.delete(r)}lookupOrInsertNode(e){let r=this._hashFn(e),n=this._nodes.get(r);return n||(n=new fmt(r,e),this._nodes.set(r,n)),n}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[r,n]of this._nodes)e.push(`${r} (-> incoming)[${[...n.incoming.keys()].join(", ")}] (outgoing ->)[${[...n.outgoing.keys()].join(",")}] `);return e.join(` -`)}findCycleSlow(){for(let[e,r]of this._nodes){let n=new Set([e]),o=this._findCycle(r,n);if(o)return o}}_findCycle(e,r){for(let[n,o]of e.outgoing){if(r.has(n))return[...r,n].join(" -> ");r.add(n);let s=this._findCycle(o,r);if(s)return s;r.delete(n)}}};d0e.Graph=P_r});var N_r=I(fmt=>{"use strict";p();Object.defineProperty(fmt,"__esModule",{value:!0});fmt.ServiceCollection=void 0;var D_r=class{static{a(this,"ServiceCollection")}constructor(...e){this._entries=new Map;for(let[r,n]of e)this.set(r,n)}set(e,r){let n=this._entries.get(e);return this._entries.set(e,r),n}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}};fmt.ServiceCollection=D_r});var Rfi=I(h0e=>{"use strict";p();Object.defineProperty(h0e,"__esModule",{value:!0});h0e.Trace=h0e.InstantiationService=void 0;var wda=pl(),Rda=Os(),M_r=Po(),f0e=umt(),wfi=xfi(),O_r=Ks(),kda=N_r(),Pda=Ade(),Dda=!1,pmt=class extends Error{static{a(this,"CyclicDependencyError")}constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: -${e.toString()}`}},L_r=class t{static{a(this,"InstantiationService")}constructor(e=new kda.ServiceCollection,r=!1,n,o=Dda){this._services=e,this._strict=r,this._parent=n,this._enableTracing=o,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(O_r.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new wfi.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,M_r.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,M_r.isDisposable)(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,r){this._throwIfDisposed();let n=this,o=new class extends t{dispose(){n._children.delete(o),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(o),r?.add(o),o}invokeFunction(e,...r){this._throwIfDisposed();let n=p0e.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,Rda.illegalState)("service accessor is only valid during the invocation of its target method");let l=this._getOrCreateServiceInstance(c,n);return l||this._throwIfStrict(`[invokeFunction] unknown service '${c}'`,!1),l},"get")},...r)}finally{o=!0,n.stop()}}createInstance(e,...r){this._throwIfDisposed();let n,o;return e instanceof f0e.SyncDescriptor?(n=p0e.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=p0e.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=O_r._util.getServiceDependencies(e).sort((l,u)=>l.index-u.index),s=[];for(let l of o){let u=this._getOrCreateServiceInstance(l.id,n);u||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id}.`,!1),s.push(u)}let c=o.length>0?o[0].index:r.length;if(r.length!==c){console.trace(`[createInstance] First service dependency of ${e.name} at position ${c+1} conflicts with ${r.length} static arguments`);let l=c-r.length;l>0?r=r.concat(new Array(l)):r=r.slice(0,c)}return Reflect.construct(e,r.concat(s))}_setCreatedServiceInstance(e,r){if(this._services.get(e)instanceof f0e.SyncDescriptor)this._services.set(e,r);else if(this._parent)this._parent._setCreatedServiceInstance(e,r);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){let r=this._services.get(e);return!r&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):r}_getOrCreateServiceInstance(e,r){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));let n=this._getServiceInstanceOrDescriptor(e);return n instanceof f0e.SyncDescriptor?this._safeCreateAndCacheServiceInstance(e,n,r.branch(e,!0)):(r.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,r,n){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,r,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,r,n){let o=new wfi.Graph(u=>u.id.toString()),s=0,c=[{id:e,desc:r,_trace:n}],l=new Set;for(;c.length;){let u=c.pop();if(!l.has(String(u.id))){if(l.add(String(u.id)),o.lookupOrInsertNode(u),s++>1e3)throw new pmt(o);for(let d of O_r._util.getServiceDependencies(u.desc.ctor)){let f=this._getServiceInstanceOrDescriptor(d.id);if(f||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(u.id),String(d.id)),f instanceof f0e.SyncDescriptor){let h={id:d.id,desc:f,_trace:u._trace.branch(d.id,!0)};o.insertEdge(u,h),c.push(h)}}}}for(;;){let u=o.roots();if(u.length===0){if(!o.isEmpty())throw new pmt(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof f0e.SyncDescriptor){let h=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,h)}o.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,r,n=[],o,s){if(this._services.get(e)instanceof f0e.SyncDescriptor)return this._createServiceInstance(e,r,n,o,s,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,r,n,o,s);throw new Error(`illegalState - creating UNKNOWN service instance ${r.name}`)}_createServiceInstance(e,r,n=[],o,s,c){if(o){let l=new t(void 0,this._strict,this,this._enableTracing);l._globalGraphImplicitDependency=String(e);let u=new Map,d=new wda.GlobalIdleValue(()=>{let f=l._createInstance(r,n,s);for(let[h,m]of u){let g=f[h];if(typeof g=="function")for(let A of m)A.disposable=g.apply(f,A.listener)}return u.clear(),c.add(f),f});return new Proxy(Object.create(null),{get(f,h){if(!d.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let A=u.get(h);return A||(A=new Pda.LinkedList,u.set(h,A)),a((_,E,v)=>{if(d.isInitialized)return d.value[h](_,E,v);{let S={listener:[_,E,v],disposable:void 0},T=A.push(S);return(0,M_r.toDisposable)(()=>{T(),S.disposable?.dispose()})}},"event")}if(h in f)return f[h];let m=d.value,g=m[h];return typeof g!="function"||(g=g.bind(m),f[h]=g),g},set(f,h,m){return d.value[h]=m,!0},getPrototypeOf(f){return r.prototype}})}else{let l=this._createInstance(r,n,s);return c.add(l),l}}_throwIfStrict(e,r){if(r&&console.warn(e),this._strict)throw new Error(e)}};h0e.InstantiationService=L_r;var p0e=class t{static{a(this,"Trace")}static{this.all=new Set}static{this._None=new class extends t{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,r){return e?new t(2,r.name||new Error().stack.split(` +`)}findCycleSlow(){for(let[e,r]of this._nodes){let n=new Set([e]),o=this._findCycle(r,n);if(o)return o}}_findCycle(e,r){for(let[n,o]of e.outgoing){if(r.has(n))return[...r,n].join(" -> ");r.add(n);let s=this._findCycle(o,r);if(s)return s;r.delete(n)}}};d0e.Graph=D_r});var M_r=I(pmt=>{"use strict";p();Object.defineProperty(pmt,"__esModule",{value:!0});pmt.ServiceCollection=void 0;var N_r=class{static{a(this,"ServiceCollection")}constructor(...e){this._entries=new Map;for(let[r,n]of e)this.set(r,n)}set(e,r){let n=this._entries.get(e);return this._entries.set(e,r),n}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}};pmt.ServiceCollection=N_r});var Pfi=I(h0e=>{"use strict";p();Object.defineProperty(h0e,"__esModule",{value:!0});h0e.Trace=h0e.InstantiationService=void 0;var kda=pl(),Pda=Os(),O_r=Po(),f0e=dmt(),kfi=Rfi(),L_r=Ks(),Dda=M_r(),Nda=yde(),Mda=!1,hmt=class extends Error{static{a(this,"CyclicDependencyError")}constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: +${e.toString()}`}},B_r=class t{static{a(this,"InstantiationService")}constructor(e=new Dda.ServiceCollection,r=!1,n,o=Mda){this._services=e,this._strict=r,this._parent=n,this._enableTracing=o,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(L_r.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new kfi.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,O_r.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,O_r.isDisposable)(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,r){this._throwIfDisposed();let n=this,o=new class extends t{dispose(){n._children.delete(o),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(o),r?.add(o),o}invokeFunction(e,...r){this._throwIfDisposed();let n=p0e.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,Pda.illegalState)("service accessor is only valid during the invocation of its target method");let l=this._getOrCreateServiceInstance(c,n);return l||this._throwIfStrict(`[invokeFunction] unknown service '${c}'`,!1),l},"get")},...r)}finally{o=!0,n.stop()}}createInstance(e,...r){this._throwIfDisposed();let n,o;return e instanceof f0e.SyncDescriptor?(n=p0e.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=p0e.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=L_r._util.getServiceDependencies(e).sort((l,u)=>l.index-u.index),s=[];for(let l of o){let u=this._getOrCreateServiceInstance(l.id,n);u||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id}.`,!1),s.push(u)}let c=o.length>0?o[0].index:r.length;if(r.length!==c){console.trace(`[createInstance] First service dependency of ${e.name} at position ${c+1} conflicts with ${r.length} static arguments`);let l=c-r.length;l>0?r=r.concat(new Array(l)):r=r.slice(0,c)}return Reflect.construct(e,r.concat(s))}_setCreatedServiceInstance(e,r){if(this._services.get(e)instanceof f0e.SyncDescriptor)this._services.set(e,r);else if(this._parent)this._parent._setCreatedServiceInstance(e,r);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){let r=this._services.get(e);return!r&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):r}_getOrCreateServiceInstance(e,r){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));let n=this._getServiceInstanceOrDescriptor(e);return n instanceof f0e.SyncDescriptor?this._safeCreateAndCacheServiceInstance(e,n,r.branch(e,!0)):(r.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,r,n){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,r,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,r,n){let o=new kfi.Graph(u=>u.id.toString()),s=0,c=[{id:e,desc:r,_trace:n}],l=new Set;for(;c.length;){let u=c.pop();if(!l.has(String(u.id))){if(l.add(String(u.id)),o.lookupOrInsertNode(u),s++>1e3)throw new hmt(o);for(let d of L_r._util.getServiceDependencies(u.desc.ctor)){let f=this._getServiceInstanceOrDescriptor(d.id);if(f||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(u.id),String(d.id)),f instanceof f0e.SyncDescriptor){let h={id:d.id,desc:f,_trace:u._trace.branch(d.id,!0)};o.insertEdge(u,h),c.push(h)}}}}for(;;){let u=o.roots();if(u.length===0){if(!o.isEmpty())throw new hmt(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof f0e.SyncDescriptor){let h=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,h)}o.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,r,n=[],o,s){if(this._services.get(e)instanceof f0e.SyncDescriptor)return this._createServiceInstance(e,r,n,o,s,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,r,n,o,s);throw new Error(`illegalState - creating UNKNOWN service instance ${r.name}`)}_createServiceInstance(e,r,n=[],o,s,c){if(o){let l=new t(void 0,this._strict,this,this._enableTracing);l._globalGraphImplicitDependency=String(e);let u=new Map,d=new kda.GlobalIdleValue(()=>{let f=l._createInstance(r,n,s);for(let[h,m]of u){let g=f[h];if(typeof g=="function")for(let A of m)A.disposable=g.apply(f,A.listener)}return u.clear(),c.add(f),f});return new Proxy(Object.create(null),{get(f,h){if(!d.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let A=u.get(h);return A||(A=new Nda.LinkedList,u.set(h,A)),a((_,E,v)=>{if(d.isInitialized)return d.value[h](_,E,v);{let S={listener:[_,E,v],disposable:void 0},T=A.push(S);return(0,O_r.toDisposable)(()=>{T(),S.disposable?.dispose()})}},"event")}if(h in f)return f[h];let m=d.value,g=m[h];return typeof g!="function"||(g=g.bind(m),f[h]=g),g},set(f,h,m){return d.value[h]=m,!0},getPrototypeOf(f){return r.prototype}})}else{let l=this._createInstance(r,n,s);return c.add(l),l}}_throwIfStrict(e,r){if(r&&console.warn(e),this._strict)throw new Error(e)}};h0e.InstantiationService=B_r;var p0e=class t{static{a(this,"Trace")}static{this.all=new Set}static{this._None=new class extends t{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,r){return e?new t(2,r.name||new Error().stack.split(` `).slice(3,4).join(` `)):t._None}static traceCreation(e,r){return e?new t(1,r.name):t._None}static{this._totals=0}constructor(e,r){this.type=e,this.name=r,this._start=Date.now(),this._dep=[]}branch(e,r){let n=new t(3,e.toString());return this._dep.push([e,r,n]),n}stop(){let e=Date.now()-this._start;t._totals+=e;let r=!1;function n(s,c){let l=[],u=new Array(s+1).join(" ");for(let[d,f,h]of c._dep)if(f&&h){r=!0,l.push(`${u}CREATES -> ${d}`);let m=n(s+1,h);m&&l.push(m)}else l.push(`${u}uses -> ${d}`);return l.join(` `)}a(n,"printChild");let o=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${n(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${t._totals.toFixed(2)}ms)`];(e>2||r)&&t.all.add(o.join(` -`))}};h0e.Trace=p0e});var an=I(m0e=>{"use strict";p();Object.defineProperty(m0e,"__esModule",{value:!0});m0e.InstantiationServiceBuilder=m0e.createServiceIdentifier=void 0;var Nda=Ks();Object.defineProperty(m0e,"createServiceIdentifier",{enumerable:!0,get:a(function(){return Nda.createDecorator},"get")});var Mda=Rfi(),kfi=N_r(),B_r=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new kfi.ServiceCollection(...e):e??new kfi.ServiceCollection}define(e,r){if(this._isSealed)throw new Error("This accessor is sealed and cannot be modified anymore.");this._collection.set(e,r)}seal(){if(this._isSealed)throw new Error("This accessor is sealed and cannot be seal again anymore.");return this._isSealed=!0,new Mda.InstantiationService(this._collection,!0)}};m0e.InstantiationServiceBuilder=B_r});var XOe=I(FR=>{"use strict";p();Object.defineProperty(FR,"__esModule",{value:!0});FR.NullLanguageContextService=FR.TriggerKind=FR.KnownSources=FR.ContextKind=FR.ILanguageContextService=void 0;var Oda=an();FR.ILanguageContextService=(0,Oda.createServiceIdentifier)("ILanguageContextService");var Pfi;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(Pfi||(FR.ContextKind=Pfi={}));var Dfi;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(Dfi||(FR.KnownSources=Dfi={}));var Nfi;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(Nfi||(FR.TriggerKind=Nfi={}));var F_r=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};FR.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new F_r,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var Ofi=I(hmt=>{"use strict";p();Object.defineProperty(hmt,"__esModule",{value:!0});hmt.serializeLanguageContext=Bda;hmt.serializeFileDiagnostics=jda;var Lda=uh(),U_r=XOe();function Bda(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:Fda(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(Bda,"serializeLanguageContext");function Fda(t){switch(t.kind){case U_r.ContextKind.Snippet:return Uda(t);case U_r.ContextKind.Trait:return Qda(t);case U_r.ContextKind.DiagnosticBag:return qda(t)}}a(Fda,"serializeLanguageContextItem");function Uda(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(Uda,"serializeSnippetContext");function Qda(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(Qda,"serializeTraitContext");function qda(t){let e=t.values.map(r=>Mfi(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(qda,"serializeDiagnosticBagContext");function Mfi(t,e){let r={severity:t.severity===0?"Error":t.severity===1?"Warning":t.severity===2?"Information":"Hint",message:t.message,source:t.source||"",code:t.code&&typeof t.code!="number"&&typeof t.code!="string"?t.code.value:t.code,range:new Lda.Range(t.range.start.line+1,t.range.start.character+1,t.range.end.line+1,t.range.end.character+1).toString()};return e&&(r.uri=e.toString()),r}a(Mfi,"serializeDiagnostic");function jda(t){return t.flatMap(([e,r])=>r.map(n=>Mfi(n,e)))}a(jda,"serializeFileDiagnostics")});var q_r=I(Q_r=>{"use strict";p();Object.defineProperty(Q_r,"__esModule",{value:!0});Q_r.stringifyChatMessages=Hda;var mmt=wo();function Hda(t){return t.map(Gda).join(` -`)}a(Hda,"stringifyChatMessages");function Gda({role:t,content:e}){if(t!==mmt.Raw.ChatRole.User&&t!==mmt.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===mmt.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==mmt.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} +`))}};h0e.Trace=p0e});var an=I(m0e=>{"use strict";p();Object.defineProperty(m0e,"__esModule",{value:!0});m0e.InstantiationServiceBuilder=m0e.createServiceIdentifier=void 0;var Oda=Ks();Object.defineProperty(m0e,"createServiceIdentifier",{enumerable:!0,get:a(function(){return Oda.createDecorator},"get")});var Lda=Pfi(),Dfi=M_r(),F_r=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new Dfi.ServiceCollection(...e):e??new Dfi.ServiceCollection}define(e,r){if(this._isSealed)throw new Error("This accessor is sealed and cannot be modified anymore.");this._collection.set(e,r)}seal(){if(this._isSealed)throw new Error("This accessor is sealed and cannot be seal again anymore.");return this._isSealed=!0,new Lda.InstantiationService(this._collection,!0)}};m0e.InstantiationServiceBuilder=F_r});var XOe=I(FR=>{"use strict";p();Object.defineProperty(FR,"__esModule",{value:!0});FR.NullLanguageContextService=FR.TriggerKind=FR.KnownSources=FR.ContextKind=FR.ILanguageContextService=void 0;var Bda=an();FR.ILanguageContextService=(0,Bda.createServiceIdentifier)("ILanguageContextService");var Nfi;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(Nfi||(FR.ContextKind=Nfi={}));var Mfi;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(Mfi||(FR.KnownSources=Mfi={}));var Ofi;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(Ofi||(FR.TriggerKind=Ofi={}));var U_r=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};FR.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new U_r,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var Bfi=I(mmt=>{"use strict";p();Object.defineProperty(mmt,"__esModule",{value:!0});mmt.serializeLanguageContext=Uda;mmt.serializeFileDiagnostics=Gda;var Fda=uh(),Q_r=XOe();function Uda(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:Qda(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(Uda,"serializeLanguageContext");function Qda(t){switch(t.kind){case Q_r.ContextKind.Snippet:return qda(t);case Q_r.ContextKind.Trait:return jda(t);case Q_r.ContextKind.DiagnosticBag:return Hda(t)}}a(Qda,"serializeLanguageContextItem");function qda(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(qda,"serializeSnippetContext");function jda(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(jda,"serializeTraitContext");function Hda(t){let e=t.values.map(r=>Lfi(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(Hda,"serializeDiagnosticBagContext");function Lfi(t,e){let r={severity:t.severity===0?"Error":t.severity===1?"Warning":t.severity===2?"Information":"Hint",message:t.message,source:t.source||"",code:t.code&&typeof t.code!="number"&&typeof t.code!="string"?t.code.value:t.code,range:new Fda.Range(t.range.start.line+1,t.range.start.character+1,t.range.end.line+1,t.range.end.character+1).toString()};return e&&(r.uri=e.toString()),r}a(Lfi,"serializeDiagnostic");function Gda(t){return t.flatMap(([e,r])=>r.map(n=>Lfi(n,e)))}a(Gda,"serializeFileDiagnostics")});var j_r=I(q_r=>{"use strict";p();Object.defineProperty(q_r,"__esModule",{value:!0});q_r.stringifyChatMessages=$da;var gmt=wo();function $da(t){return t.map(Vda).join(` +`)}a($da,"stringifyChatMessages");function Vda({role:t,content:e}){if(t!==gmt.Raw.ChatRole.User&&t!==gmt.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===gmt.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==gmt.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} ------ ${n.text} -==================`}a(Gda,"stringifyMessage")});var H_r=I(gmt=>{"use strict";p();Object.defineProperty(gmt,"__esModule",{value:!0});gmt.register=Vda;gmt.getCodiconFontCharacters=Wda;var $da=CT(),j_r=Object.create(null);function Vda(t,e){if((0,$da.isString)(e)){let r=j_r[e];if(r===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=r}return j_r[t]=e,{id:t}}a(Vda,"register");function Wda(){return j_r}a(Wda,"getCodiconFontCharacters")});var Lfi=I(Amt=>{"use strict";p();Object.defineProperty(Amt,"__esModule",{value:!0});Amt.codiconsLibrary=void 0;var $=H_r();Amt.codiconsLibrary={add:(0,$.register)("add",6e4),plus:(0,$.register)("plus",6e4),gistNew:(0,$.register)("gist-new",6e4),repoCreate:(0,$.register)("repo-create",6e4),lightbulb:(0,$.register)("lightbulb",60001),lightBulb:(0,$.register)("light-bulb",60001),repo:(0,$.register)("repo",60002),repoDelete:(0,$.register)("repo-delete",60002),gistFork:(0,$.register)("gist-fork",60003),repoForked:(0,$.register)("repo-forked",60003),gitPullRequest:(0,$.register)("git-pull-request",60004),gitPullRequestAbandoned:(0,$.register)("git-pull-request-abandoned",60004),recordKeys:(0,$.register)("record-keys",60005),keyboard:(0,$.register)("keyboard",60005),tag:(0,$.register)("tag",60006),gitPullRequestLabel:(0,$.register)("git-pull-request-label",60006),tagAdd:(0,$.register)("tag-add",60006),tagRemove:(0,$.register)("tag-remove",60006),person:(0,$.register)("person",60007),personFollow:(0,$.register)("person-follow",60007),personOutline:(0,$.register)("person-outline",60007),personFilled:(0,$.register)("person-filled",60007),sourceControl:(0,$.register)("source-control",60008),mirror:(0,$.register)("mirror",60009),mirrorPublic:(0,$.register)("mirror-public",60009),star:(0,$.register)("star",60010),starAdd:(0,$.register)("star-add",60010),starDelete:(0,$.register)("star-delete",60010),starEmpty:(0,$.register)("star-empty",60010),comment:(0,$.register)("comment",60011),commentAdd:(0,$.register)("comment-add",60011),alert:(0,$.register)("alert",60012),warning:(0,$.register)("warning",60012),search:(0,$.register)("search",60013),searchSave:(0,$.register)("search-save",60013),logOut:(0,$.register)("log-out",60014),signOut:(0,$.register)("sign-out",60014),logIn:(0,$.register)("log-in",60015),signIn:(0,$.register)("sign-in",60015),eye:(0,$.register)("eye",60016),eyeUnwatch:(0,$.register)("eye-unwatch",60016),eyeWatch:(0,$.register)("eye-watch",60016),circleFilled:(0,$.register)("circle-filled",60017),primitiveDot:(0,$.register)("primitive-dot",60017),closeDirty:(0,$.register)("close-dirty",60017),debugBreakpoint:(0,$.register)("debug-breakpoint",60017),debugBreakpointDisabled:(0,$.register)("debug-breakpoint-disabled",60017),debugHint:(0,$.register)("debug-hint",60017),terminalDecorationSuccess:(0,$.register)("terminal-decoration-success",60017),primitiveSquare:(0,$.register)("primitive-square",60018),edit:(0,$.register)("edit",60019),pencil:(0,$.register)("pencil",60019),info:(0,$.register)("info",60020),issueOpened:(0,$.register)("issue-opened",60020),gistPrivate:(0,$.register)("gist-private",60021),gitForkPrivate:(0,$.register)("git-fork-private",60021),lock:(0,$.register)("lock",60021),mirrorPrivate:(0,$.register)("mirror-private",60021),close:(0,$.register)("close",60022),removeClose:(0,$.register)("remove-close",60022),x:(0,$.register)("x",60022),repoSync:(0,$.register)("repo-sync",60023),sync:(0,$.register)("sync",60023),clone:(0,$.register)("clone",60024),desktopDownload:(0,$.register)("desktop-download",60024),beaker:(0,$.register)("beaker",60025),microscope:(0,$.register)("microscope",60025),vm:(0,$.register)("vm",60026),deviceDesktop:(0,$.register)("device-desktop",60026),file:(0,$.register)("file",60027),more:(0,$.register)("more",60028),ellipsis:(0,$.register)("ellipsis",60028),kebabHorizontal:(0,$.register)("kebab-horizontal",60028),mailReply:(0,$.register)("mail-reply",60029),reply:(0,$.register)("reply",60029),organization:(0,$.register)("organization",60030),organizationFilled:(0,$.register)("organization-filled",60030),organizationOutline:(0,$.register)("organization-outline",60030),newFile:(0,$.register)("new-file",60031),fileAdd:(0,$.register)("file-add",60031),newFolder:(0,$.register)("new-folder",60032),fileDirectoryCreate:(0,$.register)("file-directory-create",60032),trash:(0,$.register)("trash",60033),trashcan:(0,$.register)("trashcan",60033),history:(0,$.register)("history",60034),clock:(0,$.register)("clock",60034),folder:(0,$.register)("folder",60035),fileDirectory:(0,$.register)("file-directory",60035),symbolFolder:(0,$.register)("symbol-folder",60035),logoGithub:(0,$.register)("logo-github",60036),markGithub:(0,$.register)("mark-github",60036),github:(0,$.register)("github",60036),terminal:(0,$.register)("terminal",60037),console:(0,$.register)("console",60037),repl:(0,$.register)("repl",60037),zap:(0,$.register)("zap",60038),symbolEvent:(0,$.register)("symbol-event",60038),error:(0,$.register)("error",60039),stop:(0,$.register)("stop",60039),variable:(0,$.register)("variable",60040),symbolVariable:(0,$.register)("symbol-variable",60040),array:(0,$.register)("array",60042),symbolArray:(0,$.register)("symbol-array",60042),symbolModule:(0,$.register)("symbol-module",60043),symbolPackage:(0,$.register)("symbol-package",60043),symbolNamespace:(0,$.register)("symbol-namespace",60043),symbolObject:(0,$.register)("symbol-object",60043),symbolMethod:(0,$.register)("symbol-method",60044),symbolFunction:(0,$.register)("symbol-function",60044),symbolConstructor:(0,$.register)("symbol-constructor",60044),symbolBoolean:(0,$.register)("symbol-boolean",60047),symbolNull:(0,$.register)("symbol-null",60047),symbolNumeric:(0,$.register)("symbol-numeric",60048),symbolNumber:(0,$.register)("symbol-number",60048),symbolStructure:(0,$.register)("symbol-structure",60049),symbolStruct:(0,$.register)("symbol-struct",60049),symbolParameter:(0,$.register)("symbol-parameter",60050),symbolTypeParameter:(0,$.register)("symbol-type-parameter",60050),symbolKey:(0,$.register)("symbol-key",60051),symbolText:(0,$.register)("symbol-text",60051),symbolReference:(0,$.register)("symbol-reference",60052),goToFile:(0,$.register)("go-to-file",60052),symbolEnum:(0,$.register)("symbol-enum",60053),symbolValue:(0,$.register)("symbol-value",60053),symbolRuler:(0,$.register)("symbol-ruler",60054),symbolUnit:(0,$.register)("symbol-unit",60054),activateBreakpoints:(0,$.register)("activate-breakpoints",60055),archive:(0,$.register)("archive",60056),arrowBoth:(0,$.register)("arrow-both",60057),arrowDown:(0,$.register)("arrow-down",60058),arrowLeft:(0,$.register)("arrow-left",60059),arrowRight:(0,$.register)("arrow-right",60060),arrowSmallDown:(0,$.register)("arrow-small-down",60061),arrowSmallLeft:(0,$.register)("arrow-small-left",60062),arrowSmallRight:(0,$.register)("arrow-small-right",60063),arrowSmallUp:(0,$.register)("arrow-small-up",60064),arrowUp:(0,$.register)("arrow-up",60065),bell:(0,$.register)("bell",60066),bold:(0,$.register)("bold",60067),book:(0,$.register)("book",60068),bookmark:(0,$.register)("bookmark",60069),debugBreakpointConditionalUnverified:(0,$.register)("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:(0,$.register)("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:(0,$.register)("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:(0,$.register)("debug-breakpoint-data-unverified",60072),debugBreakpointData:(0,$.register)("debug-breakpoint-data",60073),debugBreakpointDataDisabled:(0,$.register)("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:(0,$.register)("debug-breakpoint-log-unverified",60074),debugBreakpointLog:(0,$.register)("debug-breakpoint-log",60075),debugBreakpointLogDisabled:(0,$.register)("debug-breakpoint-log-disabled",60075),briefcase:(0,$.register)("briefcase",60076),broadcast:(0,$.register)("broadcast",60077),browser:(0,$.register)("browser",60078),bug:(0,$.register)("bug",60079),calendar:(0,$.register)("calendar",60080),caseSensitive:(0,$.register)("case-sensitive",60081),check:(0,$.register)("check",60082),checklist:(0,$.register)("checklist",60083),chevronDown:(0,$.register)("chevron-down",60084),chevronLeft:(0,$.register)("chevron-left",60085),chevronRight:(0,$.register)("chevron-right",60086),chevronUp:(0,$.register)("chevron-up",60087),chromeClose:(0,$.register)("chrome-close",60088),chromeMaximize:(0,$.register)("chrome-maximize",60089),chromeMinimize:(0,$.register)("chrome-minimize",60090),chromeRestore:(0,$.register)("chrome-restore",60091),circleOutline:(0,$.register)("circle-outline",60092),circle:(0,$.register)("circle",60092),debugBreakpointUnverified:(0,$.register)("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:(0,$.register)("terminal-decoration-incomplete",60092),circleSlash:(0,$.register)("circle-slash",60093),circuitBoard:(0,$.register)("circuit-board",60094),clearAll:(0,$.register)("clear-all",60095),clippy:(0,$.register)("clippy",60096),closeAll:(0,$.register)("close-all",60097),cloudDownload:(0,$.register)("cloud-download",60098),cloudUpload:(0,$.register)("cloud-upload",60099),code:(0,$.register)("code",60100),collapseAll:(0,$.register)("collapse-all",60101),colorMode:(0,$.register)("color-mode",60102),commentDiscussion:(0,$.register)("comment-discussion",60103),creditCard:(0,$.register)("credit-card",60105),dash:(0,$.register)("dash",60108),dashboard:(0,$.register)("dashboard",60109),database:(0,$.register)("database",60110),debugContinue:(0,$.register)("debug-continue",60111),debugDisconnect:(0,$.register)("debug-disconnect",60112),debugPause:(0,$.register)("debug-pause",60113),debugRestart:(0,$.register)("debug-restart",60114),debugStart:(0,$.register)("debug-start",60115),debugStepInto:(0,$.register)("debug-step-into",60116),debugStepOut:(0,$.register)("debug-step-out",60117),debugStepOver:(0,$.register)("debug-step-over",60118),debugStop:(0,$.register)("debug-stop",60119),debug:(0,$.register)("debug",60120),deviceCameraVideo:(0,$.register)("device-camera-video",60121),deviceCamera:(0,$.register)("device-camera",60122),deviceMobile:(0,$.register)("device-mobile",60123),diffAdded:(0,$.register)("diff-added",60124),diffIgnored:(0,$.register)("diff-ignored",60125),diffModified:(0,$.register)("diff-modified",60126),diffRemoved:(0,$.register)("diff-removed",60127),diffRenamed:(0,$.register)("diff-renamed",60128),diff:(0,$.register)("diff",60129),diffSidebyside:(0,$.register)("diff-sidebyside",60129),discard:(0,$.register)("discard",60130),editorLayout:(0,$.register)("editor-layout",60131),emptyWindow:(0,$.register)("empty-window",60132),exclude:(0,$.register)("exclude",60133),extensions:(0,$.register)("extensions",60134),eyeClosed:(0,$.register)("eye-closed",60135),fileBinary:(0,$.register)("file-binary",60136),fileCode:(0,$.register)("file-code",60137),fileMedia:(0,$.register)("file-media",60138),filePdf:(0,$.register)("file-pdf",60139),fileSubmodule:(0,$.register)("file-submodule",60140),fileSymlinkDirectory:(0,$.register)("file-symlink-directory",60141),fileSymlinkFile:(0,$.register)("file-symlink-file",60142),fileZip:(0,$.register)("file-zip",60143),files:(0,$.register)("files",60144),filter:(0,$.register)("filter",60145),flame:(0,$.register)("flame",60146),foldDown:(0,$.register)("fold-down",60147),foldUp:(0,$.register)("fold-up",60148),fold:(0,$.register)("fold",60149),folderActive:(0,$.register)("folder-active",60150),folderOpened:(0,$.register)("folder-opened",60151),gear:(0,$.register)("gear",60152),gift:(0,$.register)("gift",60153),gistSecret:(0,$.register)("gist-secret",60154),gist:(0,$.register)("gist",60155),gitCommit:(0,$.register)("git-commit",60156),gitCompare:(0,$.register)("git-compare",60157),compareChanges:(0,$.register)("compare-changes",60157),gitMerge:(0,$.register)("git-merge",60158),githubAction:(0,$.register)("github-action",60159),githubAlt:(0,$.register)("github-alt",60160),globe:(0,$.register)("globe",60161),grabber:(0,$.register)("grabber",60162),graph:(0,$.register)("graph",60163),gripper:(0,$.register)("gripper",60164),heart:(0,$.register)("heart",60165),home:(0,$.register)("home",60166),horizontalRule:(0,$.register)("horizontal-rule",60167),hubot:(0,$.register)("hubot",60168),inbox:(0,$.register)("inbox",60169),issueReopened:(0,$.register)("issue-reopened",60171),issues:(0,$.register)("issues",60172),italic:(0,$.register)("italic",60173),jersey:(0,$.register)("jersey",60174),json:(0,$.register)("json",60175),bracket:(0,$.register)("bracket",60175),kebabVertical:(0,$.register)("kebab-vertical",60176),key:(0,$.register)("key",60177),law:(0,$.register)("law",60178),lightbulbAutofix:(0,$.register)("lightbulb-autofix",60179),linkExternal:(0,$.register)("link-external",60180),link:(0,$.register)("link",60181),listOrdered:(0,$.register)("list-ordered",60182),listUnordered:(0,$.register)("list-unordered",60183),liveShare:(0,$.register)("live-share",60184),loading:(0,$.register)("loading",60185),location:(0,$.register)("location",60186),mailRead:(0,$.register)("mail-read",60187),mail:(0,$.register)("mail",60188),markdown:(0,$.register)("markdown",60189),megaphone:(0,$.register)("megaphone",60190),mention:(0,$.register)("mention",60191),milestone:(0,$.register)("milestone",60192),gitPullRequestMilestone:(0,$.register)("git-pull-request-milestone",60192),mortarBoard:(0,$.register)("mortar-board",60193),move:(0,$.register)("move",60194),multipleWindows:(0,$.register)("multiple-windows",60195),mute:(0,$.register)("mute",60196),noNewline:(0,$.register)("no-newline",60197),note:(0,$.register)("note",60198),octoface:(0,$.register)("octoface",60199),openPreview:(0,$.register)("open-preview",60200),package:(0,$.register)("package",60201),paintcan:(0,$.register)("paintcan",60202),pin:(0,$.register)("pin",60203),play:(0,$.register)("play",60204),run:(0,$.register)("run",60204),plug:(0,$.register)("plug",60205),preserveCase:(0,$.register)("preserve-case",60206),preview:(0,$.register)("preview",60207),project:(0,$.register)("project",60208),pulse:(0,$.register)("pulse",60209),question:(0,$.register)("question",60210),quote:(0,$.register)("quote",60211),radioTower:(0,$.register)("radio-tower",60212),reactions:(0,$.register)("reactions",60213),references:(0,$.register)("references",60214),refresh:(0,$.register)("refresh",60215),regex:(0,$.register)("regex",60216),remoteExplorer:(0,$.register)("remote-explorer",60217),remote:(0,$.register)("remote",60218),remove:(0,$.register)("remove",60219),replaceAll:(0,$.register)("replace-all",60220),replace:(0,$.register)("replace",60221),repoClone:(0,$.register)("repo-clone",60222),repoForcePush:(0,$.register)("repo-force-push",60223),repoPull:(0,$.register)("repo-pull",60224),repoPush:(0,$.register)("repo-push",60225),report:(0,$.register)("report",60226),requestChanges:(0,$.register)("request-changes",60227),rocket:(0,$.register)("rocket",60228),rootFolderOpened:(0,$.register)("root-folder-opened",60229),rootFolder:(0,$.register)("root-folder",60230),rss:(0,$.register)("rss",60231),ruby:(0,$.register)("ruby",60232),saveAll:(0,$.register)("save-all",60233),saveAs:(0,$.register)("save-as",60234),save:(0,$.register)("save",60235),screenFull:(0,$.register)("screen-full",60236),screenNormal:(0,$.register)("screen-normal",60237),searchStop:(0,$.register)("search-stop",60238),server:(0,$.register)("server",60240),settingsGear:(0,$.register)("settings-gear",60241),settings:(0,$.register)("settings",60242),shield:(0,$.register)("shield",60243),smiley:(0,$.register)("smiley",60244),sortPrecedence:(0,$.register)("sort-precedence",60245),splitHorizontal:(0,$.register)("split-horizontal",60246),splitVertical:(0,$.register)("split-vertical",60247),squirrel:(0,$.register)("squirrel",60248),starFull:(0,$.register)("star-full",60249),starHalf:(0,$.register)("star-half",60250),symbolClass:(0,$.register)("symbol-class",60251),symbolColor:(0,$.register)("symbol-color",60252),symbolConstant:(0,$.register)("symbol-constant",60253),symbolEnumMember:(0,$.register)("symbol-enum-member",60254),symbolField:(0,$.register)("symbol-field",60255),symbolFile:(0,$.register)("symbol-file",60256),symbolInterface:(0,$.register)("symbol-interface",60257),symbolKeyword:(0,$.register)("symbol-keyword",60258),symbolMisc:(0,$.register)("symbol-misc",60259),symbolOperator:(0,$.register)("symbol-operator",60260),symbolProperty:(0,$.register)("symbol-property",60261),wrench:(0,$.register)("wrench",60261),wrenchSubaction:(0,$.register)("wrench-subaction",60261),symbolSnippet:(0,$.register)("symbol-snippet",60262),tasklist:(0,$.register)("tasklist",60263),telescope:(0,$.register)("telescope",60264),textSize:(0,$.register)("text-size",60265),threeBars:(0,$.register)("three-bars",60266),thumbsdown:(0,$.register)("thumbsdown",60267),thumbsup:(0,$.register)("thumbsup",60268),tools:(0,$.register)("tools",60269),triangleDown:(0,$.register)("triangle-down",60270),triangleLeft:(0,$.register)("triangle-left",60271),triangleRight:(0,$.register)("triangle-right",60272),triangleUp:(0,$.register)("triangle-up",60273),twitter:(0,$.register)("twitter",60274),unfold:(0,$.register)("unfold",60275),unlock:(0,$.register)("unlock",60276),unmute:(0,$.register)("unmute",60277),unverified:(0,$.register)("unverified",60278),verified:(0,$.register)("verified",60279),versions:(0,$.register)("versions",60280),vmActive:(0,$.register)("vm-active",60281),vmOutline:(0,$.register)("vm-outline",60282),vmRunning:(0,$.register)("vm-running",60283),watch:(0,$.register)("watch",60284),whitespace:(0,$.register)("whitespace",60285),wholeWord:(0,$.register)("whole-word",60286),window:(0,$.register)("window",60287),wordWrap:(0,$.register)("word-wrap",60288),zoomIn:(0,$.register)("zoom-in",60289),zoomOut:(0,$.register)("zoom-out",60290),listFilter:(0,$.register)("list-filter",60291),listFlat:(0,$.register)("list-flat",60292),listSelection:(0,$.register)("list-selection",60293),selection:(0,$.register)("selection",60293),listTree:(0,$.register)("list-tree",60294),debugBreakpointFunctionUnverified:(0,$.register)("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:(0,$.register)("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:(0,$.register)("debug-breakpoint-function-disabled",60296),debugStackframeActive:(0,$.register)("debug-stackframe-active",60297),circleSmallFilled:(0,$.register)("circle-small-filled",60298),debugStackframeDot:(0,$.register)("debug-stackframe-dot",60298),terminalDecorationMark:(0,$.register)("terminal-decoration-mark",60298),debugStackframe:(0,$.register)("debug-stackframe",60299),debugStackframeFocused:(0,$.register)("debug-stackframe-focused",60299),debugBreakpointUnsupported:(0,$.register)("debug-breakpoint-unsupported",60300),symbolString:(0,$.register)("symbol-string",60301),debugReverseContinue:(0,$.register)("debug-reverse-continue",60302),debugStepBack:(0,$.register)("debug-step-back",60303),debugRestartFrame:(0,$.register)("debug-restart-frame",60304),debugAlt:(0,$.register)("debug-alt",60305),callIncoming:(0,$.register)("call-incoming",60306),callOutgoing:(0,$.register)("call-outgoing",60307),menu:(0,$.register)("menu",60308),expandAll:(0,$.register)("expand-all",60309),feedback:(0,$.register)("feedback",60310),gitPullRequestReviewer:(0,$.register)("git-pull-request-reviewer",60310),groupByRefType:(0,$.register)("group-by-ref-type",60311),ungroupByRefType:(0,$.register)("ungroup-by-ref-type",60312),account:(0,$.register)("account",60313),gitPullRequestAssignee:(0,$.register)("git-pull-request-assignee",60313),bellDot:(0,$.register)("bell-dot",60314),debugConsole:(0,$.register)("debug-console",60315),library:(0,$.register)("library",60316),output:(0,$.register)("output",60317),runAll:(0,$.register)("run-all",60318),syncIgnored:(0,$.register)("sync-ignored",60319),pinned:(0,$.register)("pinned",60320),githubInverted:(0,$.register)("github-inverted",60321),serverProcess:(0,$.register)("server-process",60322),serverEnvironment:(0,$.register)("server-environment",60323),pass:(0,$.register)("pass",60324),issueClosed:(0,$.register)("issue-closed",60324),stopCircle:(0,$.register)("stop-circle",60325),playCircle:(0,$.register)("play-circle",60326),record:(0,$.register)("record",60327),debugAltSmall:(0,$.register)("debug-alt-small",60328),vmConnect:(0,$.register)("vm-connect",60329),cloud:(0,$.register)("cloud",60330),merge:(0,$.register)("merge",60331),export:(0,$.register)("export",60332),graphLeft:(0,$.register)("graph-left",60333),magnet:(0,$.register)("magnet",60334),notebook:(0,$.register)("notebook",60335),redo:(0,$.register)("redo",60336),checkAll:(0,$.register)("check-all",60337),pinnedDirty:(0,$.register)("pinned-dirty",60338),passFilled:(0,$.register)("pass-filled",60339),circleLargeFilled:(0,$.register)("circle-large-filled",60340),circleLarge:(0,$.register)("circle-large",60341),circleLargeOutline:(0,$.register)("circle-large-outline",60341),combine:(0,$.register)("combine",60342),gather:(0,$.register)("gather",60342),table:(0,$.register)("table",60343),variableGroup:(0,$.register)("variable-group",60344),typeHierarchy:(0,$.register)("type-hierarchy",60345),typeHierarchySub:(0,$.register)("type-hierarchy-sub",60346),typeHierarchySuper:(0,$.register)("type-hierarchy-super",60347),gitPullRequestCreate:(0,$.register)("git-pull-request-create",60348),runAbove:(0,$.register)("run-above",60349),runBelow:(0,$.register)("run-below",60350),notebookTemplate:(0,$.register)("notebook-template",60351),debugRerun:(0,$.register)("debug-rerun",60352),workspaceTrusted:(0,$.register)("workspace-trusted",60353),workspaceUntrusted:(0,$.register)("workspace-untrusted",60354),workspaceUnknown:(0,$.register)("workspace-unknown",60355),terminalCmd:(0,$.register)("terminal-cmd",60356),terminalDebian:(0,$.register)("terminal-debian",60357),terminalLinux:(0,$.register)("terminal-linux",60358),terminalPowershell:(0,$.register)("terminal-powershell",60359),terminalTmux:(0,$.register)("terminal-tmux",60360),terminalUbuntu:(0,$.register)("terminal-ubuntu",60361),terminalBash:(0,$.register)("terminal-bash",60362),arrowSwap:(0,$.register)("arrow-swap",60363),copy:(0,$.register)("copy",60364),personAdd:(0,$.register)("person-add",60365),filterFilled:(0,$.register)("filter-filled",60366),wand:(0,$.register)("wand",60367),debugLineByLine:(0,$.register)("debug-line-by-line",60368),inspect:(0,$.register)("inspect",60369),layers:(0,$.register)("layers",60370),layersDot:(0,$.register)("layers-dot",60371),layersActive:(0,$.register)("layers-active",60372),compass:(0,$.register)("compass",60373),compassDot:(0,$.register)("compass-dot",60374),compassActive:(0,$.register)("compass-active",60375),azure:(0,$.register)("azure",60376),issueDraft:(0,$.register)("issue-draft",60377),gitPullRequestClosed:(0,$.register)("git-pull-request-closed",60378),gitPullRequestDraft:(0,$.register)("git-pull-request-draft",60379),debugAll:(0,$.register)("debug-all",60380),debugCoverage:(0,$.register)("debug-coverage",60381),runErrors:(0,$.register)("run-errors",60382),folderLibrary:(0,$.register)("folder-library",60383),debugContinueSmall:(0,$.register)("debug-continue-small",60384),beakerStop:(0,$.register)("beaker-stop",60385),graphLine:(0,$.register)("graph-line",60386),graphScatter:(0,$.register)("graph-scatter",60387),pieChart:(0,$.register)("pie-chart",60388),bracketDot:(0,$.register)("bracket-dot",60389),bracketError:(0,$.register)("bracket-error",60390),lockSmall:(0,$.register)("lock-small",60391),azureDevops:(0,$.register)("azure-devops",60392),verifiedFilled:(0,$.register)("verified-filled",60393),newline:(0,$.register)("newline",60394),layout:(0,$.register)("layout",60395),layoutActivitybarLeft:(0,$.register)("layout-activitybar-left",60396),layoutActivitybarRight:(0,$.register)("layout-activitybar-right",60397),layoutPanelLeft:(0,$.register)("layout-panel-left",60398),layoutPanelCenter:(0,$.register)("layout-panel-center",60399),layoutPanelJustify:(0,$.register)("layout-panel-justify",60400),layoutPanelRight:(0,$.register)("layout-panel-right",60401),layoutPanel:(0,$.register)("layout-panel",60402),layoutSidebarLeft:(0,$.register)("layout-sidebar-left",60403),layoutSidebarRight:(0,$.register)("layout-sidebar-right",60404),layoutStatusbar:(0,$.register)("layout-statusbar",60405),layoutMenubar:(0,$.register)("layout-menubar",60406),layoutCentered:(0,$.register)("layout-centered",60407),target:(0,$.register)("target",60408),indent:(0,$.register)("indent",60409),recordSmall:(0,$.register)("record-small",60410),errorSmall:(0,$.register)("error-small",60411),terminalDecorationError:(0,$.register)("terminal-decoration-error",60411),arrowCircleDown:(0,$.register)("arrow-circle-down",60412),arrowCircleLeft:(0,$.register)("arrow-circle-left",60413),arrowCircleRight:(0,$.register)("arrow-circle-right",60414),arrowCircleUp:(0,$.register)("arrow-circle-up",60415),layoutSidebarRightOff:(0,$.register)("layout-sidebar-right-off",60416),layoutPanelOff:(0,$.register)("layout-panel-off",60417),layoutSidebarLeftOff:(0,$.register)("layout-sidebar-left-off",60418),blank:(0,$.register)("blank",60419),heartFilled:(0,$.register)("heart-filled",60420),map:(0,$.register)("map",60421),mapHorizontal:(0,$.register)("map-horizontal",60421),foldHorizontal:(0,$.register)("fold-horizontal",60421),mapFilled:(0,$.register)("map-filled",60422),mapHorizontalFilled:(0,$.register)("map-horizontal-filled",60422),foldHorizontalFilled:(0,$.register)("fold-horizontal-filled",60422),circleSmall:(0,$.register)("circle-small",60423),bellSlash:(0,$.register)("bell-slash",60424),bellSlashDot:(0,$.register)("bell-slash-dot",60425),commentUnresolved:(0,$.register)("comment-unresolved",60426),gitPullRequestGoToChanges:(0,$.register)("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:(0,$.register)("git-pull-request-new-changes",60428),searchFuzzy:(0,$.register)("search-fuzzy",60429),commentDraft:(0,$.register)("comment-draft",60430),send:(0,$.register)("send",60431),sparkle:(0,$.register)("sparkle",60432),insert:(0,$.register)("insert",60433),mic:(0,$.register)("mic",60434),thumbsdownFilled:(0,$.register)("thumbsdown-filled",60435),thumbsupFilled:(0,$.register)("thumbsup-filled",60436),coffee:(0,$.register)("coffee",60437),snake:(0,$.register)("snake",60438),game:(0,$.register)("game",60439),vr:(0,$.register)("vr",60440),chip:(0,$.register)("chip",60441),piano:(0,$.register)("piano",60442),music:(0,$.register)("music",60443),micFilled:(0,$.register)("mic-filled",60444),repoFetch:(0,$.register)("repo-fetch",60445),copilot:(0,$.register)("copilot",60446),lightbulbSparkle:(0,$.register)("lightbulb-sparkle",60447),robot:(0,$.register)("robot",60448),sparkleFilled:(0,$.register)("sparkle-filled",60449),diffSingle:(0,$.register)("diff-single",60450),diffMultiple:(0,$.register)("diff-multiple",60451),surroundWith:(0,$.register)("surround-with",60452),share:(0,$.register)("share",60453),gitStash:(0,$.register)("git-stash",60454),gitStashApply:(0,$.register)("git-stash-apply",60455),gitStashPop:(0,$.register)("git-stash-pop",60456),vscode:(0,$.register)("vscode",60457),vscodeInsiders:(0,$.register)("vscode-insiders",60458),codeOss:(0,$.register)("code-oss",60459),runCoverage:(0,$.register)("run-coverage",60460),runAllCoverage:(0,$.register)("run-all-coverage",60461),coverage:(0,$.register)("coverage",60462),githubProject:(0,$.register)("github-project",60463),mapVertical:(0,$.register)("map-vertical",60464),foldVertical:(0,$.register)("fold-vertical",60464),mapVerticalFilled:(0,$.register)("map-vertical-filled",60465),foldVerticalFilled:(0,$.register)("fold-vertical-filled",60465),goToSearch:(0,$.register)("go-to-search",60466),percentage:(0,$.register)("percentage",60467),sortPercentage:(0,$.register)("sort-percentage",60467),attach:(0,$.register)("attach",60468),goToEditingSession:(0,$.register)("go-to-editing-session",60469),editSession:(0,$.register)("edit-session",60470),codeReview:(0,$.register)("code-review",60471),copilotWarning:(0,$.register)("copilot-warning",60472),python:(0,$.register)("python",60473),copilotLarge:(0,$.register)("copilot-large",60474),copilotWarningLarge:(0,$.register)("copilot-warning-large",60475),keyboardTab:(0,$.register)("keyboard-tab",60476),copilotBlocked:(0,$.register)("copilot-blocked",60477),copilotNotConnected:(0,$.register)("copilot-not-connected",60478),flag:(0,$.register)("flag",60479),lightbulbEmpty:(0,$.register)("lightbulb-empty",60480),symbolMethodArrow:(0,$.register)("symbol-method-arrow",60481),copilotUnavailable:(0,$.register)("copilot-unavailable",60482),repoPinned:(0,$.register)("repo-pinned",60483),keyboardTabAbove:(0,$.register)("keyboard-tab-above",60484),keyboardTabBelow:(0,$.register)("keyboard-tab-below",60485),gitPullRequestDone:(0,$.register)("git-pull-request-done",60486),mcp:(0,$.register)("mcp",60487),extensionsLarge:(0,$.register)("extensions-large",60488),layoutPanelDock:(0,$.register)("layout-panel-dock",60489),layoutSidebarLeftDock:(0,$.register)("layout-sidebar-left-dock",60490),layoutSidebarRightDock:(0,$.register)("layout-sidebar-right-dock",60491),copilotInProgress:(0,$.register)("copilot-in-progress",60492),copilotError:(0,$.register)("copilot-error",60493),copilotSuccess:(0,$.register)("copilot-success",60494),chatSparkle:(0,$.register)("chat-sparkle",60495),searchSparkle:(0,$.register)("search-sparkle",60496),editSparkle:(0,$.register)("edit-sparkle",60497),copilotSnooze:(0,$.register)("copilot-snooze",60498),sendToRemoteAgent:(0,$.register)("send-to-remote-agent",60499),commentDiscussionSparkle:(0,$.register)("comment-discussion-sparkle",60500),chatSparkleWarning:(0,$.register)("chat-sparkle-warning",60501),chatSparkleError:(0,$.register)("chat-sparkle-error",60502),collection:(0,$.register)("collection",60503),newCollection:(0,$.register)("new-collection",60504),thinking:(0,$.register)("thinking",60505),build:(0,$.register)("build",60506),commentDiscussionQuote:(0,$.register)("comment-discussion-quote",60507),cursor:(0,$.register)("cursor",60508),eraser:(0,$.register)("eraser",60509),fileText:(0,$.register)("file-text",60510),quotes:(0,$.register)("quotes",60512),rename:(0,$.register)("rename",60513),runWithDeps:(0,$.register)("run-with-deps",60514),debugConnected:(0,$.register)("debug-connected",60515),strikethrough:(0,$.register)("strikethrough",60516),openInProduct:(0,$.register)("open-in-product",60517),indexZero:(0,$.register)("index-zero",60518),agent:(0,$.register)("agent",60519),editCode:(0,$.register)("edit-code",60520),repoSelected:(0,$.register)("repo-selected",60521),skip:(0,$.register)("skip",60522),mergeInto:(0,$.register)("merge-into",60523),gitBranchChanges:(0,$.register)("git-branch-changes",60524),gitBranchStagedChanges:(0,$.register)("git-branch-staged-changes",60525),gitBranchConflicts:(0,$.register)("git-branch-conflicts",60526),gitBranch:(0,$.register)("git-branch",60527),gitBranchCreate:(0,$.register)("git-branch-create",60527),gitBranchDelete:(0,$.register)("git-branch-delete",60527),searchLarge:(0,$.register)("search-large",60528),terminalGitBash:(0,$.register)("terminal-git-bash",60529),windowActive:(0,$.register)("window-active",60530),forward:(0,$.register)("forward",60531),download:(0,$.register)("download",60532),clockface:(0,$.register)("clockface",60533),unarchive:(0,$.register)("unarchive",60534),sessionInProgress:(0,$.register)("session-in-progress",60535),collectionSmall:(0,$.register)("collection-small",60536),vmSmall:(0,$.register)("vm-small",60537),cloudSmall:(0,$.register)("cloud-small",60538),addSmall:(0,$.register)("add-small",60539),removeSmall:(0,$.register)("remove-small",60540),worktreeSmall:(0,$.register)("worktree-small",60541),worktree:(0,$.register)("worktree",60542),screenCut:(0,$.register)("screen-cut",60543),ask:(0,$.register)("ask",60544),openai:(0,$.register)("openai",60545),claude:(0,$.register)("claude",60546),openInWindow:(0,$.register)("open-in-window",60547),newSession:(0,$.register)("new-session",60548),terminalSecure:(0,$.register)("terminal-secure",60549),chatImport:(0,$.register)("chat-import",60550),chatExport:(0,$.register)("chat-export",60551),shareWindow:(0,$.register)("share-window",60552)}});var G_r=I(p6=>{"use strict";p();Object.defineProperty(p6,"__esModule",{value:!0});p6.Codicon=p6.codiconsDerived=void 0;p6.getAllCodicons=Yda;var rl=H_r(),zda=Lfi();function Yda(){return Object.values(p6.Codicon)}a(Yda,"getAllCodicons");p6.codiconsDerived={dialogError:(0,rl.register)("dialog-error","error"),dialogWarning:(0,rl.register)("dialog-warning","warning"),dialogInfo:(0,rl.register)("dialog-info","info"),dialogClose:(0,rl.register)("dialog-close","close"),treeItemExpanded:(0,rl.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,rl.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,rl.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,rl.register)("tree-filter-clear","close"),treeItemLoading:(0,rl.register)("tree-item-loading","loading"),menuSelection:(0,rl.register)("menu-selection","check"),menuSubmenu:(0,rl.register)("menu-submenu","chevron-right"),menuBarMore:(0,rl.register)("menubar-more","more"),scrollbarButtonLeft:(0,rl.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,rl.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,rl.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,rl.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,rl.register)("toolbar-more","more"),quickInputBack:(0,rl.register)("quick-input-back","arrow-left"),dropDownButton:(0,rl.register)("drop-down-button",60084),symbolCustomColor:(0,rl.register)("symbol-customcolor",60252),exportIcon:(0,rl.register)("export",60332),workspaceUnspecified:(0,rl.register)("workspace-unspecified",60355),newLine:(0,rl.register)("newline",60394),thumbsDownFilled:(0,rl.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,rl.register)("thumbsup-filled",60436),gitFetch:(0,rl.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,rl.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,rl.register)("debug-breakpoint-pending",60377),chatImport:(0,rl.register)("chat-import",60550),chatExport:(0,rl.register)("chat-export",60551)};p6.Codicon={...zda.codiconsLibrary,...p6.codiconsDerived}});var W_r=I(ute=>{"use strict";p();Object.defineProperty(ute,"__esModule",{value:!0});ute.ThemeIcon=ute.ThemeColor=void 0;ute.themeColorFromId=Kda;var $_r=G_r(),V_r;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.id=="string"}a(e,"isThemeColor"),t.isThemeColor=e})(V_r||(ute.ThemeColor=V_r={}));function Kda(t){return{id:t}}a(Kda,"themeColorFromId");var Bfi;(function(t){t.iconNameSegment="[A-Za-z0-9]+",t.iconNameExpression="[A-Za-z0-9-]+",t.iconModifierExpression="~[A-Za-z]+",t.iconNameCharacter="[A-Za-z0-9~-]";let e=new RegExp(`^(${t.iconNameExpression})(${t.iconModifierExpression})?$`);function r(A){let y=e.exec(A.id);if(!y)return r($_r.Codicon.error);let[,_,E]=y,v=["codicon","codicon-"+_];return E&&v.push("codicon-modifier-"+E.substring(1)),v}a(r,"asClassNameArray"),t.asClassNameArray=r;function n(A){return r(A).join(" ")}a(n,"asClassName"),t.asClassName=n;function o(A){return"."+r(A).join(".")}a(o,"asCSSSelector"),t.asCSSSelector=o;function s(A){return!!A&&typeof A=="object"&&typeof A.id=="string"&&(typeof A.color>"u"||V_r.isThemeColor(A.color))}a(s,"isThemeIcon"),t.isThemeIcon=s;let c=new RegExp(`^\\$\\((${t.iconNameExpression}(?:${t.iconModifierExpression})?)\\)$`);function l(A){let y=c.exec(A);if(!y)return;let[,_]=y;return{id:_}}a(l,"fromString"),t.fromString=l;function u(A){return{id:A}}a(u,"fromId"),t.fromId=u;function d(A,y){let _=A.id,E=_.lastIndexOf("~");return E!==-1&&(_=_.substring(0,E)),y&&(_=`${_}~${y}`),{id:_}}a(d,"modify"),t.modify=d;function f(A){let y=A.id.lastIndexOf("~");if(y!==-1)return A.id.substring(y+1)}a(f,"getModifier"),t.getModifier=f;function h(A,y){return A.id===y.id&&A.color?.id===y.color?.id}a(h,"isEqual"),t.isEqual=h;function m(A){return A?.id===$_r.Codicon.file.id}a(m,"isFile"),t.isFile=m;function g(A){return A?.id===$_r.Codicon.folder.id}a(g,"isFolder"),t.isFolder=g})(Bfi||(ute.ThemeIcon=Bfi={}))});var e5e=I(WG=>{"use strict";p();Object.defineProperty(WG,"__esModule",{value:!0});WG.Icon=void 0;WG.overrideNowValue=Jda;WG.now=Zda;WG.shortenOpportunityId=Xda;WG.checkIfCursorAtEndOfLine=efa;var h6=W_r(),z_r=-1;function Jda(t){z_r=t}a(Jda,"overrideNowValue");function Zda(){return z_r!==-1?z_r:Date.now()}a(Zda,"now");var Ffi;(function(t){t.circleSlash={themeIcon:h6.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:h6.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:h6.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:h6.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:h6.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:h6.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:h6.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:h6.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:h6.ThemeIcon.fromId("thumbsdown"),svg:''}})(Ffi||(WG.Icon=Ffi={}));function Xda(t){return t.substring(4,8)}a(Xda,"shortenOpportunityId");function efa(t,e){return t.substring(e).match(/^\s*$/)!==null}a(efa,"checkIfCursorAtEndOfLine")});var _mt=I(X4=>{"use strict";p();var tfa=X4&&X4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rfa=X4&&X4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),nfa=X4&&X4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(Amt,"__esModule",{value:!0});Amt.register=zda;Amt.getCodiconFontCharacters=Yda;var Wda=CT(),H_r=Object.create(null);function zda(t,e){if((0,Wda.isString)(e)){let r=H_r[e];if(r===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=r}return H_r[t]=e,{id:t}}a(zda,"register");function Yda(){return H_r}a(Yda,"getCodiconFontCharacters")});var Ffi=I(ymt=>{"use strict";p();Object.defineProperty(ymt,"__esModule",{value:!0});ymt.codiconsLibrary=void 0;var $=G_r();ymt.codiconsLibrary={add:(0,$.register)("add",6e4),plus:(0,$.register)("plus",6e4),gistNew:(0,$.register)("gist-new",6e4),repoCreate:(0,$.register)("repo-create",6e4),lightbulb:(0,$.register)("lightbulb",60001),lightBulb:(0,$.register)("light-bulb",60001),repo:(0,$.register)("repo",60002),repoDelete:(0,$.register)("repo-delete",60002),gistFork:(0,$.register)("gist-fork",60003),repoForked:(0,$.register)("repo-forked",60003),gitPullRequest:(0,$.register)("git-pull-request",60004),gitPullRequestAbandoned:(0,$.register)("git-pull-request-abandoned",60004),recordKeys:(0,$.register)("record-keys",60005),keyboard:(0,$.register)("keyboard",60005),tag:(0,$.register)("tag",60006),gitPullRequestLabel:(0,$.register)("git-pull-request-label",60006),tagAdd:(0,$.register)("tag-add",60006),tagRemove:(0,$.register)("tag-remove",60006),person:(0,$.register)("person",60007),personFollow:(0,$.register)("person-follow",60007),personOutline:(0,$.register)("person-outline",60007),personFilled:(0,$.register)("person-filled",60007),sourceControl:(0,$.register)("source-control",60008),mirror:(0,$.register)("mirror",60009),mirrorPublic:(0,$.register)("mirror-public",60009),star:(0,$.register)("star",60010),starAdd:(0,$.register)("star-add",60010),starDelete:(0,$.register)("star-delete",60010),starEmpty:(0,$.register)("star-empty",60010),comment:(0,$.register)("comment",60011),commentAdd:(0,$.register)("comment-add",60011),alert:(0,$.register)("alert",60012),warning:(0,$.register)("warning",60012),search:(0,$.register)("search",60013),searchSave:(0,$.register)("search-save",60013),logOut:(0,$.register)("log-out",60014),signOut:(0,$.register)("sign-out",60014),logIn:(0,$.register)("log-in",60015),signIn:(0,$.register)("sign-in",60015),eye:(0,$.register)("eye",60016),eyeUnwatch:(0,$.register)("eye-unwatch",60016),eyeWatch:(0,$.register)("eye-watch",60016),circleFilled:(0,$.register)("circle-filled",60017),primitiveDot:(0,$.register)("primitive-dot",60017),closeDirty:(0,$.register)("close-dirty",60017),debugBreakpoint:(0,$.register)("debug-breakpoint",60017),debugBreakpointDisabled:(0,$.register)("debug-breakpoint-disabled",60017),debugHint:(0,$.register)("debug-hint",60017),terminalDecorationSuccess:(0,$.register)("terminal-decoration-success",60017),primitiveSquare:(0,$.register)("primitive-square",60018),edit:(0,$.register)("edit",60019),pencil:(0,$.register)("pencil",60019),info:(0,$.register)("info",60020),issueOpened:(0,$.register)("issue-opened",60020),gistPrivate:(0,$.register)("gist-private",60021),gitForkPrivate:(0,$.register)("git-fork-private",60021),lock:(0,$.register)("lock",60021),mirrorPrivate:(0,$.register)("mirror-private",60021),close:(0,$.register)("close",60022),removeClose:(0,$.register)("remove-close",60022),x:(0,$.register)("x",60022),repoSync:(0,$.register)("repo-sync",60023),sync:(0,$.register)("sync",60023),clone:(0,$.register)("clone",60024),desktopDownload:(0,$.register)("desktop-download",60024),beaker:(0,$.register)("beaker",60025),microscope:(0,$.register)("microscope",60025),vm:(0,$.register)("vm",60026),deviceDesktop:(0,$.register)("device-desktop",60026),file:(0,$.register)("file",60027),more:(0,$.register)("more",60028),ellipsis:(0,$.register)("ellipsis",60028),kebabHorizontal:(0,$.register)("kebab-horizontal",60028),mailReply:(0,$.register)("mail-reply",60029),reply:(0,$.register)("reply",60029),organization:(0,$.register)("organization",60030),organizationFilled:(0,$.register)("organization-filled",60030),organizationOutline:(0,$.register)("organization-outline",60030),newFile:(0,$.register)("new-file",60031),fileAdd:(0,$.register)("file-add",60031),newFolder:(0,$.register)("new-folder",60032),fileDirectoryCreate:(0,$.register)("file-directory-create",60032),trash:(0,$.register)("trash",60033),trashcan:(0,$.register)("trashcan",60033),history:(0,$.register)("history",60034),clock:(0,$.register)("clock",60034),folder:(0,$.register)("folder",60035),fileDirectory:(0,$.register)("file-directory",60035),symbolFolder:(0,$.register)("symbol-folder",60035),logoGithub:(0,$.register)("logo-github",60036),markGithub:(0,$.register)("mark-github",60036),github:(0,$.register)("github",60036),terminal:(0,$.register)("terminal",60037),console:(0,$.register)("console",60037),repl:(0,$.register)("repl",60037),zap:(0,$.register)("zap",60038),symbolEvent:(0,$.register)("symbol-event",60038),error:(0,$.register)("error",60039),stop:(0,$.register)("stop",60039),variable:(0,$.register)("variable",60040),symbolVariable:(0,$.register)("symbol-variable",60040),array:(0,$.register)("array",60042),symbolArray:(0,$.register)("symbol-array",60042),symbolModule:(0,$.register)("symbol-module",60043),symbolPackage:(0,$.register)("symbol-package",60043),symbolNamespace:(0,$.register)("symbol-namespace",60043),symbolObject:(0,$.register)("symbol-object",60043),symbolMethod:(0,$.register)("symbol-method",60044),symbolFunction:(0,$.register)("symbol-function",60044),symbolConstructor:(0,$.register)("symbol-constructor",60044),symbolBoolean:(0,$.register)("symbol-boolean",60047),symbolNull:(0,$.register)("symbol-null",60047),symbolNumeric:(0,$.register)("symbol-numeric",60048),symbolNumber:(0,$.register)("symbol-number",60048),symbolStructure:(0,$.register)("symbol-structure",60049),symbolStruct:(0,$.register)("symbol-struct",60049),symbolParameter:(0,$.register)("symbol-parameter",60050),symbolTypeParameter:(0,$.register)("symbol-type-parameter",60050),symbolKey:(0,$.register)("symbol-key",60051),symbolText:(0,$.register)("symbol-text",60051),symbolReference:(0,$.register)("symbol-reference",60052),goToFile:(0,$.register)("go-to-file",60052),symbolEnum:(0,$.register)("symbol-enum",60053),symbolValue:(0,$.register)("symbol-value",60053),symbolRuler:(0,$.register)("symbol-ruler",60054),symbolUnit:(0,$.register)("symbol-unit",60054),activateBreakpoints:(0,$.register)("activate-breakpoints",60055),archive:(0,$.register)("archive",60056),arrowBoth:(0,$.register)("arrow-both",60057),arrowDown:(0,$.register)("arrow-down",60058),arrowLeft:(0,$.register)("arrow-left",60059),arrowRight:(0,$.register)("arrow-right",60060),arrowSmallDown:(0,$.register)("arrow-small-down",60061),arrowSmallLeft:(0,$.register)("arrow-small-left",60062),arrowSmallRight:(0,$.register)("arrow-small-right",60063),arrowSmallUp:(0,$.register)("arrow-small-up",60064),arrowUp:(0,$.register)("arrow-up",60065),bell:(0,$.register)("bell",60066),bold:(0,$.register)("bold",60067),book:(0,$.register)("book",60068),bookmark:(0,$.register)("bookmark",60069),debugBreakpointConditionalUnverified:(0,$.register)("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:(0,$.register)("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:(0,$.register)("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:(0,$.register)("debug-breakpoint-data-unverified",60072),debugBreakpointData:(0,$.register)("debug-breakpoint-data",60073),debugBreakpointDataDisabled:(0,$.register)("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:(0,$.register)("debug-breakpoint-log-unverified",60074),debugBreakpointLog:(0,$.register)("debug-breakpoint-log",60075),debugBreakpointLogDisabled:(0,$.register)("debug-breakpoint-log-disabled",60075),briefcase:(0,$.register)("briefcase",60076),broadcast:(0,$.register)("broadcast",60077),browser:(0,$.register)("browser",60078),bug:(0,$.register)("bug",60079),calendar:(0,$.register)("calendar",60080),caseSensitive:(0,$.register)("case-sensitive",60081),check:(0,$.register)("check",60082),checklist:(0,$.register)("checklist",60083),chevronDown:(0,$.register)("chevron-down",60084),chevronLeft:(0,$.register)("chevron-left",60085),chevronRight:(0,$.register)("chevron-right",60086),chevronUp:(0,$.register)("chevron-up",60087),chromeClose:(0,$.register)("chrome-close",60088),chromeMaximize:(0,$.register)("chrome-maximize",60089),chromeMinimize:(0,$.register)("chrome-minimize",60090),chromeRestore:(0,$.register)("chrome-restore",60091),circleOutline:(0,$.register)("circle-outline",60092),circle:(0,$.register)("circle",60092),debugBreakpointUnverified:(0,$.register)("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:(0,$.register)("terminal-decoration-incomplete",60092),circleSlash:(0,$.register)("circle-slash",60093),circuitBoard:(0,$.register)("circuit-board",60094),clearAll:(0,$.register)("clear-all",60095),clippy:(0,$.register)("clippy",60096),closeAll:(0,$.register)("close-all",60097),cloudDownload:(0,$.register)("cloud-download",60098),cloudUpload:(0,$.register)("cloud-upload",60099),code:(0,$.register)("code",60100),collapseAll:(0,$.register)("collapse-all",60101),colorMode:(0,$.register)("color-mode",60102),commentDiscussion:(0,$.register)("comment-discussion",60103),creditCard:(0,$.register)("credit-card",60105),dash:(0,$.register)("dash",60108),dashboard:(0,$.register)("dashboard",60109),database:(0,$.register)("database",60110),debugContinue:(0,$.register)("debug-continue",60111),debugDisconnect:(0,$.register)("debug-disconnect",60112),debugPause:(0,$.register)("debug-pause",60113),debugRestart:(0,$.register)("debug-restart",60114),debugStart:(0,$.register)("debug-start",60115),debugStepInto:(0,$.register)("debug-step-into",60116),debugStepOut:(0,$.register)("debug-step-out",60117),debugStepOver:(0,$.register)("debug-step-over",60118),debugStop:(0,$.register)("debug-stop",60119),debug:(0,$.register)("debug",60120),deviceCameraVideo:(0,$.register)("device-camera-video",60121),deviceCamera:(0,$.register)("device-camera",60122),deviceMobile:(0,$.register)("device-mobile",60123),diffAdded:(0,$.register)("diff-added",60124),diffIgnored:(0,$.register)("diff-ignored",60125),diffModified:(0,$.register)("diff-modified",60126),diffRemoved:(0,$.register)("diff-removed",60127),diffRenamed:(0,$.register)("diff-renamed",60128),diff:(0,$.register)("diff",60129),diffSidebyside:(0,$.register)("diff-sidebyside",60129),discard:(0,$.register)("discard",60130),editorLayout:(0,$.register)("editor-layout",60131),emptyWindow:(0,$.register)("empty-window",60132),exclude:(0,$.register)("exclude",60133),extensions:(0,$.register)("extensions",60134),eyeClosed:(0,$.register)("eye-closed",60135),fileBinary:(0,$.register)("file-binary",60136),fileCode:(0,$.register)("file-code",60137),fileMedia:(0,$.register)("file-media",60138),filePdf:(0,$.register)("file-pdf",60139),fileSubmodule:(0,$.register)("file-submodule",60140),fileSymlinkDirectory:(0,$.register)("file-symlink-directory",60141),fileSymlinkFile:(0,$.register)("file-symlink-file",60142),fileZip:(0,$.register)("file-zip",60143),files:(0,$.register)("files",60144),filter:(0,$.register)("filter",60145),flame:(0,$.register)("flame",60146),foldDown:(0,$.register)("fold-down",60147),foldUp:(0,$.register)("fold-up",60148),fold:(0,$.register)("fold",60149),folderActive:(0,$.register)("folder-active",60150),folderOpened:(0,$.register)("folder-opened",60151),gear:(0,$.register)("gear",60152),gift:(0,$.register)("gift",60153),gistSecret:(0,$.register)("gist-secret",60154),gist:(0,$.register)("gist",60155),gitCommit:(0,$.register)("git-commit",60156),gitCompare:(0,$.register)("git-compare",60157),compareChanges:(0,$.register)("compare-changes",60157),gitMerge:(0,$.register)("git-merge",60158),githubAction:(0,$.register)("github-action",60159),githubAlt:(0,$.register)("github-alt",60160),globe:(0,$.register)("globe",60161),grabber:(0,$.register)("grabber",60162),graph:(0,$.register)("graph",60163),gripper:(0,$.register)("gripper",60164),heart:(0,$.register)("heart",60165),home:(0,$.register)("home",60166),horizontalRule:(0,$.register)("horizontal-rule",60167),hubot:(0,$.register)("hubot",60168),inbox:(0,$.register)("inbox",60169),issueReopened:(0,$.register)("issue-reopened",60171),issues:(0,$.register)("issues",60172),italic:(0,$.register)("italic",60173),jersey:(0,$.register)("jersey",60174),json:(0,$.register)("json",60175),bracket:(0,$.register)("bracket",60175),kebabVertical:(0,$.register)("kebab-vertical",60176),key:(0,$.register)("key",60177),law:(0,$.register)("law",60178),lightbulbAutofix:(0,$.register)("lightbulb-autofix",60179),linkExternal:(0,$.register)("link-external",60180),link:(0,$.register)("link",60181),listOrdered:(0,$.register)("list-ordered",60182),listUnordered:(0,$.register)("list-unordered",60183),liveShare:(0,$.register)("live-share",60184),loading:(0,$.register)("loading",60185),location:(0,$.register)("location",60186),mailRead:(0,$.register)("mail-read",60187),mail:(0,$.register)("mail",60188),markdown:(0,$.register)("markdown",60189),megaphone:(0,$.register)("megaphone",60190),mention:(0,$.register)("mention",60191),milestone:(0,$.register)("milestone",60192),gitPullRequestMilestone:(0,$.register)("git-pull-request-milestone",60192),mortarBoard:(0,$.register)("mortar-board",60193),move:(0,$.register)("move",60194),multipleWindows:(0,$.register)("multiple-windows",60195),mute:(0,$.register)("mute",60196),noNewline:(0,$.register)("no-newline",60197),note:(0,$.register)("note",60198),octoface:(0,$.register)("octoface",60199),openPreview:(0,$.register)("open-preview",60200),package:(0,$.register)("package",60201),paintcan:(0,$.register)("paintcan",60202),pin:(0,$.register)("pin",60203),play:(0,$.register)("play",60204),run:(0,$.register)("run",60204),plug:(0,$.register)("plug",60205),preserveCase:(0,$.register)("preserve-case",60206),preview:(0,$.register)("preview",60207),project:(0,$.register)("project",60208),pulse:(0,$.register)("pulse",60209),question:(0,$.register)("question",60210),quote:(0,$.register)("quote",60211),radioTower:(0,$.register)("radio-tower",60212),reactions:(0,$.register)("reactions",60213),references:(0,$.register)("references",60214),refresh:(0,$.register)("refresh",60215),regex:(0,$.register)("regex",60216),remoteExplorer:(0,$.register)("remote-explorer",60217),remote:(0,$.register)("remote",60218),remove:(0,$.register)("remove",60219),replaceAll:(0,$.register)("replace-all",60220),replace:(0,$.register)("replace",60221),repoClone:(0,$.register)("repo-clone",60222),repoForcePush:(0,$.register)("repo-force-push",60223),repoPull:(0,$.register)("repo-pull",60224),repoPush:(0,$.register)("repo-push",60225),report:(0,$.register)("report",60226),requestChanges:(0,$.register)("request-changes",60227),rocket:(0,$.register)("rocket",60228),rootFolderOpened:(0,$.register)("root-folder-opened",60229),rootFolder:(0,$.register)("root-folder",60230),rss:(0,$.register)("rss",60231),ruby:(0,$.register)("ruby",60232),saveAll:(0,$.register)("save-all",60233),saveAs:(0,$.register)("save-as",60234),save:(0,$.register)("save",60235),screenFull:(0,$.register)("screen-full",60236),screenNormal:(0,$.register)("screen-normal",60237),searchStop:(0,$.register)("search-stop",60238),server:(0,$.register)("server",60240),settingsGear:(0,$.register)("settings-gear",60241),settings:(0,$.register)("settings",60242),shield:(0,$.register)("shield",60243),smiley:(0,$.register)("smiley",60244),sortPrecedence:(0,$.register)("sort-precedence",60245),splitHorizontal:(0,$.register)("split-horizontal",60246),splitVertical:(0,$.register)("split-vertical",60247),squirrel:(0,$.register)("squirrel",60248),starFull:(0,$.register)("star-full",60249),starHalf:(0,$.register)("star-half",60250),symbolClass:(0,$.register)("symbol-class",60251),symbolColor:(0,$.register)("symbol-color",60252),symbolConstant:(0,$.register)("symbol-constant",60253),symbolEnumMember:(0,$.register)("symbol-enum-member",60254),symbolField:(0,$.register)("symbol-field",60255),symbolFile:(0,$.register)("symbol-file",60256),symbolInterface:(0,$.register)("symbol-interface",60257),symbolKeyword:(0,$.register)("symbol-keyword",60258),symbolMisc:(0,$.register)("symbol-misc",60259),symbolOperator:(0,$.register)("symbol-operator",60260),symbolProperty:(0,$.register)("symbol-property",60261),wrench:(0,$.register)("wrench",60261),wrenchSubaction:(0,$.register)("wrench-subaction",60261),symbolSnippet:(0,$.register)("symbol-snippet",60262),tasklist:(0,$.register)("tasklist",60263),telescope:(0,$.register)("telescope",60264),textSize:(0,$.register)("text-size",60265),threeBars:(0,$.register)("three-bars",60266),thumbsdown:(0,$.register)("thumbsdown",60267),thumbsup:(0,$.register)("thumbsup",60268),tools:(0,$.register)("tools",60269),triangleDown:(0,$.register)("triangle-down",60270),triangleLeft:(0,$.register)("triangle-left",60271),triangleRight:(0,$.register)("triangle-right",60272),triangleUp:(0,$.register)("triangle-up",60273),twitter:(0,$.register)("twitter",60274),unfold:(0,$.register)("unfold",60275),unlock:(0,$.register)("unlock",60276),unmute:(0,$.register)("unmute",60277),unverified:(0,$.register)("unverified",60278),verified:(0,$.register)("verified",60279),versions:(0,$.register)("versions",60280),vmActive:(0,$.register)("vm-active",60281),vmOutline:(0,$.register)("vm-outline",60282),vmRunning:(0,$.register)("vm-running",60283),watch:(0,$.register)("watch",60284),whitespace:(0,$.register)("whitespace",60285),wholeWord:(0,$.register)("whole-word",60286),window:(0,$.register)("window",60287),wordWrap:(0,$.register)("word-wrap",60288),zoomIn:(0,$.register)("zoom-in",60289),zoomOut:(0,$.register)("zoom-out",60290),listFilter:(0,$.register)("list-filter",60291),listFlat:(0,$.register)("list-flat",60292),listSelection:(0,$.register)("list-selection",60293),selection:(0,$.register)("selection",60293),listTree:(0,$.register)("list-tree",60294),debugBreakpointFunctionUnverified:(0,$.register)("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:(0,$.register)("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:(0,$.register)("debug-breakpoint-function-disabled",60296),debugStackframeActive:(0,$.register)("debug-stackframe-active",60297),circleSmallFilled:(0,$.register)("circle-small-filled",60298),debugStackframeDot:(0,$.register)("debug-stackframe-dot",60298),terminalDecorationMark:(0,$.register)("terminal-decoration-mark",60298),debugStackframe:(0,$.register)("debug-stackframe",60299),debugStackframeFocused:(0,$.register)("debug-stackframe-focused",60299),debugBreakpointUnsupported:(0,$.register)("debug-breakpoint-unsupported",60300),symbolString:(0,$.register)("symbol-string",60301),debugReverseContinue:(0,$.register)("debug-reverse-continue",60302),debugStepBack:(0,$.register)("debug-step-back",60303),debugRestartFrame:(0,$.register)("debug-restart-frame",60304),debugAlt:(0,$.register)("debug-alt",60305),callIncoming:(0,$.register)("call-incoming",60306),callOutgoing:(0,$.register)("call-outgoing",60307),menu:(0,$.register)("menu",60308),expandAll:(0,$.register)("expand-all",60309),feedback:(0,$.register)("feedback",60310),gitPullRequestReviewer:(0,$.register)("git-pull-request-reviewer",60310),groupByRefType:(0,$.register)("group-by-ref-type",60311),ungroupByRefType:(0,$.register)("ungroup-by-ref-type",60312),account:(0,$.register)("account",60313),gitPullRequestAssignee:(0,$.register)("git-pull-request-assignee",60313),bellDot:(0,$.register)("bell-dot",60314),debugConsole:(0,$.register)("debug-console",60315),library:(0,$.register)("library",60316),output:(0,$.register)("output",60317),runAll:(0,$.register)("run-all",60318),syncIgnored:(0,$.register)("sync-ignored",60319),pinned:(0,$.register)("pinned",60320),githubInverted:(0,$.register)("github-inverted",60321),serverProcess:(0,$.register)("server-process",60322),serverEnvironment:(0,$.register)("server-environment",60323),pass:(0,$.register)("pass",60324),issueClosed:(0,$.register)("issue-closed",60324),stopCircle:(0,$.register)("stop-circle",60325),playCircle:(0,$.register)("play-circle",60326),record:(0,$.register)("record",60327),debugAltSmall:(0,$.register)("debug-alt-small",60328),vmConnect:(0,$.register)("vm-connect",60329),cloud:(0,$.register)("cloud",60330),merge:(0,$.register)("merge",60331),export:(0,$.register)("export",60332),graphLeft:(0,$.register)("graph-left",60333),magnet:(0,$.register)("magnet",60334),notebook:(0,$.register)("notebook",60335),redo:(0,$.register)("redo",60336),checkAll:(0,$.register)("check-all",60337),pinnedDirty:(0,$.register)("pinned-dirty",60338),passFilled:(0,$.register)("pass-filled",60339),circleLargeFilled:(0,$.register)("circle-large-filled",60340),circleLarge:(0,$.register)("circle-large",60341),circleLargeOutline:(0,$.register)("circle-large-outline",60341),combine:(0,$.register)("combine",60342),gather:(0,$.register)("gather",60342),table:(0,$.register)("table",60343),variableGroup:(0,$.register)("variable-group",60344),typeHierarchy:(0,$.register)("type-hierarchy",60345),typeHierarchySub:(0,$.register)("type-hierarchy-sub",60346),typeHierarchySuper:(0,$.register)("type-hierarchy-super",60347),gitPullRequestCreate:(0,$.register)("git-pull-request-create",60348),runAbove:(0,$.register)("run-above",60349),runBelow:(0,$.register)("run-below",60350),notebookTemplate:(0,$.register)("notebook-template",60351),debugRerun:(0,$.register)("debug-rerun",60352),workspaceTrusted:(0,$.register)("workspace-trusted",60353),workspaceUntrusted:(0,$.register)("workspace-untrusted",60354),workspaceUnknown:(0,$.register)("workspace-unknown",60355),terminalCmd:(0,$.register)("terminal-cmd",60356),terminalDebian:(0,$.register)("terminal-debian",60357),terminalLinux:(0,$.register)("terminal-linux",60358),terminalPowershell:(0,$.register)("terminal-powershell",60359),terminalTmux:(0,$.register)("terminal-tmux",60360),terminalUbuntu:(0,$.register)("terminal-ubuntu",60361),terminalBash:(0,$.register)("terminal-bash",60362),arrowSwap:(0,$.register)("arrow-swap",60363),copy:(0,$.register)("copy",60364),personAdd:(0,$.register)("person-add",60365),filterFilled:(0,$.register)("filter-filled",60366),wand:(0,$.register)("wand",60367),debugLineByLine:(0,$.register)("debug-line-by-line",60368),inspect:(0,$.register)("inspect",60369),layers:(0,$.register)("layers",60370),layersDot:(0,$.register)("layers-dot",60371),layersActive:(0,$.register)("layers-active",60372),compass:(0,$.register)("compass",60373),compassDot:(0,$.register)("compass-dot",60374),compassActive:(0,$.register)("compass-active",60375),azure:(0,$.register)("azure",60376),issueDraft:(0,$.register)("issue-draft",60377),gitPullRequestClosed:(0,$.register)("git-pull-request-closed",60378),gitPullRequestDraft:(0,$.register)("git-pull-request-draft",60379),debugAll:(0,$.register)("debug-all",60380),debugCoverage:(0,$.register)("debug-coverage",60381),runErrors:(0,$.register)("run-errors",60382),folderLibrary:(0,$.register)("folder-library",60383),debugContinueSmall:(0,$.register)("debug-continue-small",60384),beakerStop:(0,$.register)("beaker-stop",60385),graphLine:(0,$.register)("graph-line",60386),graphScatter:(0,$.register)("graph-scatter",60387),pieChart:(0,$.register)("pie-chart",60388),bracketDot:(0,$.register)("bracket-dot",60389),bracketError:(0,$.register)("bracket-error",60390),lockSmall:(0,$.register)("lock-small",60391),azureDevops:(0,$.register)("azure-devops",60392),verifiedFilled:(0,$.register)("verified-filled",60393),newline:(0,$.register)("newline",60394),layout:(0,$.register)("layout",60395),layoutActivitybarLeft:(0,$.register)("layout-activitybar-left",60396),layoutActivitybarRight:(0,$.register)("layout-activitybar-right",60397),layoutPanelLeft:(0,$.register)("layout-panel-left",60398),layoutPanelCenter:(0,$.register)("layout-panel-center",60399),layoutPanelJustify:(0,$.register)("layout-panel-justify",60400),layoutPanelRight:(0,$.register)("layout-panel-right",60401),layoutPanel:(0,$.register)("layout-panel",60402),layoutSidebarLeft:(0,$.register)("layout-sidebar-left",60403),layoutSidebarRight:(0,$.register)("layout-sidebar-right",60404),layoutStatusbar:(0,$.register)("layout-statusbar",60405),layoutMenubar:(0,$.register)("layout-menubar",60406),layoutCentered:(0,$.register)("layout-centered",60407),target:(0,$.register)("target",60408),indent:(0,$.register)("indent",60409),recordSmall:(0,$.register)("record-small",60410),errorSmall:(0,$.register)("error-small",60411),terminalDecorationError:(0,$.register)("terminal-decoration-error",60411),arrowCircleDown:(0,$.register)("arrow-circle-down",60412),arrowCircleLeft:(0,$.register)("arrow-circle-left",60413),arrowCircleRight:(0,$.register)("arrow-circle-right",60414),arrowCircleUp:(0,$.register)("arrow-circle-up",60415),layoutSidebarRightOff:(0,$.register)("layout-sidebar-right-off",60416),layoutPanelOff:(0,$.register)("layout-panel-off",60417),layoutSidebarLeftOff:(0,$.register)("layout-sidebar-left-off",60418),blank:(0,$.register)("blank",60419),heartFilled:(0,$.register)("heart-filled",60420),map:(0,$.register)("map",60421),mapHorizontal:(0,$.register)("map-horizontal",60421),foldHorizontal:(0,$.register)("fold-horizontal",60421),mapFilled:(0,$.register)("map-filled",60422),mapHorizontalFilled:(0,$.register)("map-horizontal-filled",60422),foldHorizontalFilled:(0,$.register)("fold-horizontal-filled",60422),circleSmall:(0,$.register)("circle-small",60423),bellSlash:(0,$.register)("bell-slash",60424),bellSlashDot:(0,$.register)("bell-slash-dot",60425),commentUnresolved:(0,$.register)("comment-unresolved",60426),gitPullRequestGoToChanges:(0,$.register)("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:(0,$.register)("git-pull-request-new-changes",60428),searchFuzzy:(0,$.register)("search-fuzzy",60429),commentDraft:(0,$.register)("comment-draft",60430),send:(0,$.register)("send",60431),sparkle:(0,$.register)("sparkle",60432),insert:(0,$.register)("insert",60433),mic:(0,$.register)("mic",60434),thumbsdownFilled:(0,$.register)("thumbsdown-filled",60435),thumbsupFilled:(0,$.register)("thumbsup-filled",60436),coffee:(0,$.register)("coffee",60437),snake:(0,$.register)("snake",60438),game:(0,$.register)("game",60439),vr:(0,$.register)("vr",60440),chip:(0,$.register)("chip",60441),piano:(0,$.register)("piano",60442),music:(0,$.register)("music",60443),micFilled:(0,$.register)("mic-filled",60444),repoFetch:(0,$.register)("repo-fetch",60445),copilot:(0,$.register)("copilot",60446),lightbulbSparkle:(0,$.register)("lightbulb-sparkle",60447),robot:(0,$.register)("robot",60448),sparkleFilled:(0,$.register)("sparkle-filled",60449),diffSingle:(0,$.register)("diff-single",60450),diffMultiple:(0,$.register)("diff-multiple",60451),surroundWith:(0,$.register)("surround-with",60452),share:(0,$.register)("share",60453),gitStash:(0,$.register)("git-stash",60454),gitStashApply:(0,$.register)("git-stash-apply",60455),gitStashPop:(0,$.register)("git-stash-pop",60456),vscode:(0,$.register)("vscode",60457),vscodeInsiders:(0,$.register)("vscode-insiders",60458),codeOss:(0,$.register)("code-oss",60459),runCoverage:(0,$.register)("run-coverage",60460),runAllCoverage:(0,$.register)("run-all-coverage",60461),coverage:(0,$.register)("coverage",60462),githubProject:(0,$.register)("github-project",60463),mapVertical:(0,$.register)("map-vertical",60464),foldVertical:(0,$.register)("fold-vertical",60464),mapVerticalFilled:(0,$.register)("map-vertical-filled",60465),foldVerticalFilled:(0,$.register)("fold-vertical-filled",60465),goToSearch:(0,$.register)("go-to-search",60466),percentage:(0,$.register)("percentage",60467),sortPercentage:(0,$.register)("sort-percentage",60467),attach:(0,$.register)("attach",60468),goToEditingSession:(0,$.register)("go-to-editing-session",60469),editSession:(0,$.register)("edit-session",60470),codeReview:(0,$.register)("code-review",60471),copilotWarning:(0,$.register)("copilot-warning",60472),python:(0,$.register)("python",60473),copilotLarge:(0,$.register)("copilot-large",60474),copilotWarningLarge:(0,$.register)("copilot-warning-large",60475),keyboardTab:(0,$.register)("keyboard-tab",60476),copilotBlocked:(0,$.register)("copilot-blocked",60477),copilotNotConnected:(0,$.register)("copilot-not-connected",60478),flag:(0,$.register)("flag",60479),lightbulbEmpty:(0,$.register)("lightbulb-empty",60480),symbolMethodArrow:(0,$.register)("symbol-method-arrow",60481),copilotUnavailable:(0,$.register)("copilot-unavailable",60482),repoPinned:(0,$.register)("repo-pinned",60483),keyboardTabAbove:(0,$.register)("keyboard-tab-above",60484),keyboardTabBelow:(0,$.register)("keyboard-tab-below",60485),gitPullRequestDone:(0,$.register)("git-pull-request-done",60486),mcp:(0,$.register)("mcp",60487),extensionsLarge:(0,$.register)("extensions-large",60488),layoutPanelDock:(0,$.register)("layout-panel-dock",60489),layoutSidebarLeftDock:(0,$.register)("layout-sidebar-left-dock",60490),layoutSidebarRightDock:(0,$.register)("layout-sidebar-right-dock",60491),copilotInProgress:(0,$.register)("copilot-in-progress",60492),copilotError:(0,$.register)("copilot-error",60493),copilotSuccess:(0,$.register)("copilot-success",60494),chatSparkle:(0,$.register)("chat-sparkle",60495),searchSparkle:(0,$.register)("search-sparkle",60496),editSparkle:(0,$.register)("edit-sparkle",60497),copilotSnooze:(0,$.register)("copilot-snooze",60498),sendToRemoteAgent:(0,$.register)("send-to-remote-agent",60499),commentDiscussionSparkle:(0,$.register)("comment-discussion-sparkle",60500),chatSparkleWarning:(0,$.register)("chat-sparkle-warning",60501),chatSparkleError:(0,$.register)("chat-sparkle-error",60502),collection:(0,$.register)("collection",60503),newCollection:(0,$.register)("new-collection",60504),thinking:(0,$.register)("thinking",60505),build:(0,$.register)("build",60506),commentDiscussionQuote:(0,$.register)("comment-discussion-quote",60507),cursor:(0,$.register)("cursor",60508),eraser:(0,$.register)("eraser",60509),fileText:(0,$.register)("file-text",60510),quotes:(0,$.register)("quotes",60512),rename:(0,$.register)("rename",60513),runWithDeps:(0,$.register)("run-with-deps",60514),debugConnected:(0,$.register)("debug-connected",60515),strikethrough:(0,$.register)("strikethrough",60516),openInProduct:(0,$.register)("open-in-product",60517),indexZero:(0,$.register)("index-zero",60518),agent:(0,$.register)("agent",60519),editCode:(0,$.register)("edit-code",60520),repoSelected:(0,$.register)("repo-selected",60521),skip:(0,$.register)("skip",60522),mergeInto:(0,$.register)("merge-into",60523),gitBranchChanges:(0,$.register)("git-branch-changes",60524),gitBranchStagedChanges:(0,$.register)("git-branch-staged-changes",60525),gitBranchConflicts:(0,$.register)("git-branch-conflicts",60526),gitBranch:(0,$.register)("git-branch",60527),gitBranchCreate:(0,$.register)("git-branch-create",60527),gitBranchDelete:(0,$.register)("git-branch-delete",60527),searchLarge:(0,$.register)("search-large",60528),terminalGitBash:(0,$.register)("terminal-git-bash",60529),windowActive:(0,$.register)("window-active",60530),forward:(0,$.register)("forward",60531),download:(0,$.register)("download",60532),clockface:(0,$.register)("clockface",60533),unarchive:(0,$.register)("unarchive",60534),sessionInProgress:(0,$.register)("session-in-progress",60535),collectionSmall:(0,$.register)("collection-small",60536),vmSmall:(0,$.register)("vm-small",60537),cloudSmall:(0,$.register)("cloud-small",60538),addSmall:(0,$.register)("add-small",60539),removeSmall:(0,$.register)("remove-small",60540),worktreeSmall:(0,$.register)("worktree-small",60541),worktree:(0,$.register)("worktree",60542),screenCut:(0,$.register)("screen-cut",60543),ask:(0,$.register)("ask",60544),openai:(0,$.register)("openai",60545),claude:(0,$.register)("claude",60546),openInWindow:(0,$.register)("open-in-window",60547),newSession:(0,$.register)("new-session",60548),terminalSecure:(0,$.register)("terminal-secure",60549),chatImport:(0,$.register)("chat-import",60550),chatExport:(0,$.register)("chat-export",60551),shareWindow:(0,$.register)("share-window",60552)}});var $_r=I(p6=>{"use strict";p();Object.defineProperty(p6,"__esModule",{value:!0});p6.Codicon=p6.codiconsDerived=void 0;p6.getAllCodicons=Jda;var rl=G_r(),Kda=Ffi();function Jda(){return Object.values(p6.Codicon)}a(Jda,"getAllCodicons");p6.codiconsDerived={dialogError:(0,rl.register)("dialog-error","error"),dialogWarning:(0,rl.register)("dialog-warning","warning"),dialogInfo:(0,rl.register)("dialog-info","info"),dialogClose:(0,rl.register)("dialog-close","close"),treeItemExpanded:(0,rl.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,rl.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,rl.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,rl.register)("tree-filter-clear","close"),treeItemLoading:(0,rl.register)("tree-item-loading","loading"),menuSelection:(0,rl.register)("menu-selection","check"),menuSubmenu:(0,rl.register)("menu-submenu","chevron-right"),menuBarMore:(0,rl.register)("menubar-more","more"),scrollbarButtonLeft:(0,rl.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,rl.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,rl.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,rl.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,rl.register)("toolbar-more","more"),quickInputBack:(0,rl.register)("quick-input-back","arrow-left"),dropDownButton:(0,rl.register)("drop-down-button",60084),symbolCustomColor:(0,rl.register)("symbol-customcolor",60252),exportIcon:(0,rl.register)("export",60332),workspaceUnspecified:(0,rl.register)("workspace-unspecified",60355),newLine:(0,rl.register)("newline",60394),thumbsDownFilled:(0,rl.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,rl.register)("thumbsup-filled",60436),gitFetch:(0,rl.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,rl.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,rl.register)("debug-breakpoint-pending",60377),chatImport:(0,rl.register)("chat-import",60550),chatExport:(0,rl.register)("chat-export",60551)};p6.Codicon={...Kda.codiconsLibrary,...p6.codiconsDerived}});var z_r=I(dte=>{"use strict";p();Object.defineProperty(dte,"__esModule",{value:!0});dte.ThemeIcon=dte.ThemeColor=void 0;dte.themeColorFromId=Zda;var V_r=$_r(),W_r;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.id=="string"}a(e,"isThemeColor"),t.isThemeColor=e})(W_r||(dte.ThemeColor=W_r={}));function Zda(t){return{id:t}}a(Zda,"themeColorFromId");var Ufi;(function(t){t.iconNameSegment="[A-Za-z0-9]+",t.iconNameExpression="[A-Za-z0-9-]+",t.iconModifierExpression="~[A-Za-z]+",t.iconNameCharacter="[A-Za-z0-9~-]";let e=new RegExp(`^(${t.iconNameExpression})(${t.iconModifierExpression})?$`);function r(A){let y=e.exec(A.id);if(!y)return r(V_r.Codicon.error);let[,_,E]=y,v=["codicon","codicon-"+_];return E&&v.push("codicon-modifier-"+E.substring(1)),v}a(r,"asClassNameArray"),t.asClassNameArray=r;function n(A){return r(A).join(" ")}a(n,"asClassName"),t.asClassName=n;function o(A){return"."+r(A).join(".")}a(o,"asCSSSelector"),t.asCSSSelector=o;function s(A){return!!A&&typeof A=="object"&&typeof A.id=="string"&&(typeof A.color>"u"||W_r.isThemeColor(A.color))}a(s,"isThemeIcon"),t.isThemeIcon=s;let c=new RegExp(`^\\$\\((${t.iconNameExpression}(?:${t.iconModifierExpression})?)\\)$`);function l(A){let y=c.exec(A);if(!y)return;let[,_]=y;return{id:_}}a(l,"fromString"),t.fromString=l;function u(A){return{id:A}}a(u,"fromId"),t.fromId=u;function d(A,y){let _=A.id,E=_.lastIndexOf("~");return E!==-1&&(_=_.substring(0,E)),y&&(_=`${_}~${y}`),{id:_}}a(d,"modify"),t.modify=d;function f(A){let y=A.id.lastIndexOf("~");if(y!==-1)return A.id.substring(y+1)}a(f,"getModifier"),t.getModifier=f;function h(A,y){return A.id===y.id&&A.color?.id===y.color?.id}a(h,"isEqual"),t.isEqual=h;function m(A){return A?.id===V_r.Codicon.file.id}a(m,"isFile"),t.isFile=m;function g(A){return A?.id===V_r.Codicon.folder.id}a(g,"isFolder"),t.isFolder=g})(Ufi||(dte.ThemeIcon=Ufi={}))});var e5e=I(zG=>{"use strict";p();Object.defineProperty(zG,"__esModule",{value:!0});zG.Icon=void 0;zG.overrideNowValue=Xda;zG.now=efa;zG.shortenOpportunityId=tfa;zG.checkIfCursorAtEndOfLine=rfa;var h6=z_r(),Y_r=-1;function Xda(t){Y_r=t}a(Xda,"overrideNowValue");function efa(){return Y_r!==-1?Y_r:Date.now()}a(efa,"now");var Qfi;(function(t){t.circleSlash={themeIcon:h6.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:h6.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:h6.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:h6.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:h6.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:h6.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:h6.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:h6.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:h6.ThemeIcon.fromId("thumbsdown"),svg:''}})(Qfi||(zG.Icon=Qfi={}));function tfa(t){return t.substring(4,8)}a(tfa,"shortenOpportunityId");function rfa(t,e){return t.substring(e).match(/^\s*$/)!==null}a(rfa,"checkIfCursorAtEndOfLine")});var Emt=I(X4=>{"use strict";p();var nfa=X4&&X4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ifa=X4&&X4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ofa=X4&&X4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oExplanation for icons @@ -510,11 +510,11 @@ ${n.text} `);let n=this.prompt;e.push("````"),e.push(...n.split(` `)),e.push("````"),e.push(` -`)}if(this.error&&(e.push(`## Error ${r}`),e.push("```"),e.push(ymt.ErrorUtils.toString(ymt.ErrorUtils.fromUnknown(this.error))),e.push("```")),this.response&&(e.push(`## Response ${r}`),e.push(`
Click to view +`)}if(this.error&&(e.push(`## Error ${r}`),e.push("```"),e.push(_mt.ErrorUtils.toString(_mt.ErrorUtils.fromUnknown(this.error))),e.push("```")),this.response&&(e.push(`## Response ${r}`),e.push(`
Click to view `),e.push("````"),e.push(this.response),e.push("````"),e.push(`
`)),this._responseResults&&(e.push(`## Response Results ${r}`),e.push(`
Click to view -`),e.push("```"),e.push(Ufi.stringify(this._responseResults,null," ")),e.push("```"),e.push(` +`),e.push("```"),e.push(qfi.stringify(this._responseResults,null," ")),e.push("```"),e.push(`
`)),this._promptSectionTokens){let n=this._promptSectionTokens;e.push(`## Prompt section tokens ${r}`),e.push(`
Click to view `),e.push(`Approximate (char/4) token counts per prompt section. @@ -530,8 +530,8 @@ ${n.text} `),e.push("```"),e.push(...this._trace),e.push("```"),e.push(`
`)),e.join(` -`)}toMinimalLog(){let e=[];return this._nesTypePicked==="diagnostics"&&this._diagnosticsResultEdit?(e.push("## Result (Diagnostics):"),e.push("``` patch"),e.push(this._diagnosticsResultEdit.toString()),e.push("```")):this._nesTypePicked==="llm"&&this._resultEdit?(e.push("## Result:"),e.push("``` patch"),typeof this._resultEdit=="string"?e.push(this._resultEdit):e.push(this._resultEdit.toString()),e.push("```")):e.push("## Result: "),this.error&&(e.push("## Error:"),e.push("```"),e.push(ymt.ErrorUtils.toString(ymt.ErrorUtils.fromUnknown(this.error))),e.push("```")),e.push("### Info:"),e.push(`**From cache:** ${this._logContextOfCachedEdit?`YES (Request: ${this._logContextOfCachedEdit.requestId})`:"NO"}`),this._context&&(e.push(`**Trigger Kind:** ${this._context.triggerKind===0?"Manual":"Automatic"}`),e.push(`**Request UUID:** ${this._context.requestUuid}`)),e.join(` -`)}setStatelessNextEditProviderId(e){this._statelessNextEditProviderId=e}setRequestInput(e){this._isVisible=!0,this._nextEditRequest=e,this.fireDidChange()}setResult(e){this._isVisible=!0,this._resultEdit=e,this.fireDidChange()}setDiagnosticsResult(e){this._isVisible=!0,this._diagnosticsResultEdit=e,this.fireDidChange()}setPickedNESType(e){return this._nesTypePicked=e,this}setIsCachedResult(e){this._logContextOfCachedEdit=e,this.recordingBookmark=e.recordingBookmark,this._nextEditRequest=e._nextEditRequest??this._nextEditRequest,this._resultEdit=e._resultEdit??this._resultEdit,this._diagnosticsResultEdit=e._diagnosticsResultEdit??this._diagnosticsResultEdit,this._endpointInfo=e._endpointInfo??this._endpointInfo,this._headerRequestId=e._headerRequestId??this._headerRequestId,e._prompt&&(this._prompt=e._prompt),this._promptSectionTokens=e._promptSectionTokens??this._promptSectionTokens,this.response=e.response??this.response,this._responseResults=e._responseResults??this._responseResults,e.fullResponsePromise&&this.setFullResponse(e.fullResponsePromise),this._error=e._error??this._error,this._isVisible=!0,this._outcome="cached",this.fireDidChange()}setIsReusedInFlightResult(e){this._logContextOfCachedEdit=e,this.recordingBookmark=e.recordingBookmark,this._nextEditRequest=e._nextEditRequest??this._nextEditRequest,this._resultEdit=e._resultEdit??this._resultEdit,this._diagnosticsResultEdit=e._diagnosticsResultEdit??this._diagnosticsResultEdit,this._endpointInfo=e._endpointInfo??this._endpointInfo,this._headerRequestId=e._headerRequestId??this._headerRequestId,e._prompt&&(this._prompt=e._prompt),this._promptSectionTokens=e._promptSectionTokens??this._promptSectionTokens,this.response=e.response??this.response,this._responseResults=e._responseResults??this._responseResults,e.fullResponsePromise&&this.setFullResponse(e.fullResponsePromise),this._error=e._error??this._error,this._isVisible=!0,this._outcome="reusedInFlight",this.fireDidChange()}setEndpointInfo(e,r){this._endpointInfo={url:e,modelName:r},this.fireDidChange()}get endpointInfo(){return this._endpointInfo}setHeaderRequestId(e){this._headerRequestId=e,this.fireDidChange()}get headerRequestId(){return this._headerRequestId}get prompt(){return this._prompt}get rawMessages(){return this._rawMessages}setPrompt(e){this._isVisible=!0,typeof e=="string"?this._prompt=e:(this._rawMessages=e,this._prompt=(0,cfa.stringifyChatMessages)(e)),this.fireDidChange()}setPromptSectionTokens(e){this._promptSectionTokens=e,this.fireDidChange()}get cursorJumpRawMessages(){return this._cursorJumpRawMessages}get cursorJumpKeptRange(){return this._cursorJumpKeptRange}setCursorJumpPrompt(e,r){this._cursorJumpRawMessages=e,this._cursorJumpKeptRange=r,this.fireDidChange()}_setOutcome(e){this._outcome=e}_resolveIcon(){switch(this._outcome){case"pending":return this._isCompleted?z_.Icon.check:z_.Icon.loading;case"succeeded":return z_.Icon.lightbulbFull;case"noSuggestions":return z_.Icon.circleSlash;case"cached":case"cachedFromGhostText":return z_.Icon.database;case"reusedInFlight":return z_.Icon.gitMerge;case"skipped":case"cancelled":return z_.Icon.skipped;case"errored":return z_.Icon.error;case"previouslyRejected":return z_.Icon.thumbsdown}}getIcon(){return this._resolveIcon().themeIcon}setIsSkipped(){this._setOutcome("skipped"),this._isVisible=!1,this.fireDidChange()}markAsFromCache(){this._setOutcome("cachedFromGhostText"),this._isVisible=!0,this.fireDidChange()}markAsNoSuggestions(){this._setOutcome("noSuggestions"),this._isVisible=!0,this.fireDidChange()}markAsPreviouslyRejected(){this._setOutcome("previouslyRejected"),this._isVisible=!0,this.fireDidChange()}get error(){return this._error}setError(e){this._isVisible=!0,this._error=e,this._error instanceof sfa.FetchCancellationError?this._setOutcome("skipped"):(0,ifa.isCancellationError)(this._error)?(this._setOutcome("cancelled"),this._isVisible=!1):this._setOutcome("errored"),this.fireDidChange()}setResponse(e){this._isVisible=!0,this.response=e,this.fireDidChange()}setFullResponse(e){this.fullResponsePromise=e,e.then(r=>this.fullResponse=r)}async allPromisesResolved(){await this.fullResponsePromise}setProviderStartTime(){this.providerStartTime=Date.now(),this.fireDidChange()}setProviderEndTime(){this.providerEndTime=Date.now(),this.fireDidChange()}setFetchStartTime(){this.fetchStartTime=Date.now(),this.fireDidChange()}setFetchEndTime(){this.fetchEndTime=Date.now(),this.fireDidChange()}get responseResults(){return this._responseResults}setResponseResults(e){this._isVisible=!0,this._responseResults=e,this._outcome==="pending"&&(this._outcome="succeeded"),this.fireDidChange()}getDebugName(){return`NES | ${lfa(this.filePath)} (v${this.version})`}getMarkdownTitle(){return`${this._resolveIcon().svg} `+this.getDebugName()}setRecentEdit(e){this._recentEdit=e}trace(e){this._trace.push(e),this.fireDidChange()}_renderTraceDiagram(){if(this._trace.length===0)return[];let e=[];e.push("## Trace Diagram"),e.push(`
Trace Diagram +`)}toMinimalLog(){let e=[];return this._nesTypePicked==="diagnostics"&&this._diagnosticsResultEdit?(e.push("## Result (Diagnostics):"),e.push("``` patch"),e.push(this._diagnosticsResultEdit.toString()),e.push("```")):this._nesTypePicked==="llm"&&this._resultEdit?(e.push("## Result:"),e.push("``` patch"),typeof this._resultEdit=="string"?e.push(this._resultEdit):e.push(this._resultEdit.toString()),e.push("```")):e.push("## Result: "),this.error&&(e.push("## Error:"),e.push("```"),e.push(_mt.ErrorUtils.toString(_mt.ErrorUtils.fromUnknown(this.error))),e.push("```")),e.push("### Info:"),e.push(`**From cache:** ${this._logContextOfCachedEdit?`YES (Request: ${this._logContextOfCachedEdit.requestId})`:"NO"}`),this._context&&(e.push(`**Trigger Kind:** ${this._context.triggerKind===0?"Manual":"Automatic"}`),e.push(`**Request UUID:** ${this._context.requestUuid}`)),e.join(` +`)}setStatelessNextEditProviderId(e){this._statelessNextEditProviderId=e}setRequestInput(e){this._isVisible=!0,this._nextEditRequest=e,this.fireDidChange()}setResult(e){this._isVisible=!0,this._resultEdit=e,this.fireDidChange()}setDiagnosticsResult(e){this._isVisible=!0,this._diagnosticsResultEdit=e,this.fireDidChange()}setPickedNESType(e){return this._nesTypePicked=e,this}setIsCachedResult(e){this._logContextOfCachedEdit=e,this.recordingBookmark=e.recordingBookmark,this._nextEditRequest=e._nextEditRequest??this._nextEditRequest,this._resultEdit=e._resultEdit??this._resultEdit,this._diagnosticsResultEdit=e._diagnosticsResultEdit??this._diagnosticsResultEdit,this._endpointInfo=e._endpointInfo??this._endpointInfo,this._headerRequestId=e._headerRequestId??this._headerRequestId,e._prompt&&(this._prompt=e._prompt),this._promptSectionTokens=e._promptSectionTokens??this._promptSectionTokens,this.response=e.response??this.response,this._responseResults=e._responseResults??this._responseResults,e.fullResponsePromise&&this.setFullResponse(e.fullResponsePromise),this._error=e._error??this._error,this._isVisible=!0,this._outcome="cached",this.fireDidChange()}setIsReusedInFlightResult(e){this._logContextOfCachedEdit=e,this.recordingBookmark=e.recordingBookmark,this._nextEditRequest=e._nextEditRequest??this._nextEditRequest,this._resultEdit=e._resultEdit??this._resultEdit,this._diagnosticsResultEdit=e._diagnosticsResultEdit??this._diagnosticsResultEdit,this._endpointInfo=e._endpointInfo??this._endpointInfo,this._headerRequestId=e._headerRequestId??this._headerRequestId,e._prompt&&(this._prompt=e._prompt),this._promptSectionTokens=e._promptSectionTokens??this._promptSectionTokens,this.response=e.response??this.response,this._responseResults=e._responseResults??this._responseResults,e.fullResponsePromise&&this.setFullResponse(e.fullResponsePromise),this._error=e._error??this._error,this._isVisible=!0,this._outcome="reusedInFlight",this.fireDidChange()}setEndpointInfo(e,r){this._endpointInfo={url:e,modelName:r},this.fireDidChange()}get endpointInfo(){return this._endpointInfo}setHeaderRequestId(e){this._headerRequestId=e,this.fireDidChange()}get headerRequestId(){return this._headerRequestId}get prompt(){return this._prompt}get rawMessages(){return this._rawMessages}setPrompt(e){this._isVisible=!0,typeof e=="string"?this._prompt=e:(this._rawMessages=e,this._prompt=(0,ufa.stringifyChatMessages)(e)),this.fireDidChange()}setPromptSectionTokens(e){this._promptSectionTokens=e,this.fireDidChange()}get cursorJumpRawMessages(){return this._cursorJumpRawMessages}get cursorJumpKeptRange(){return this._cursorJumpKeptRange}setCursorJumpPrompt(e,r){this._cursorJumpRawMessages=e,this._cursorJumpKeptRange=r,this.fireDidChange()}_setOutcome(e){this._outcome=e}_resolveIcon(){switch(this._outcome){case"pending":return this._isCompleted?z_.Icon.check:z_.Icon.loading;case"succeeded":return z_.Icon.lightbulbFull;case"noSuggestions":return z_.Icon.circleSlash;case"cached":case"cachedFromGhostText":return z_.Icon.database;case"reusedInFlight":return z_.Icon.gitMerge;case"skipped":case"cancelled":return z_.Icon.skipped;case"errored":return z_.Icon.error;case"previouslyRejected":return z_.Icon.thumbsdown}}getIcon(){return this._resolveIcon().themeIcon}setIsSkipped(){this._setOutcome("skipped"),this._isVisible=!1,this.fireDidChange()}markAsFromCache(){this._setOutcome("cachedFromGhostText"),this._isVisible=!0,this.fireDidChange()}markAsNoSuggestions(){this._setOutcome("noSuggestions"),this._isVisible=!0,this.fireDidChange()}markAsPreviouslyRejected(){this._setOutcome("previouslyRejected"),this._isVisible=!0,this.fireDidChange()}get error(){return this._error}setError(e){this._isVisible=!0,this._error=e,this._error instanceof cfa.FetchCancellationError?this._setOutcome("skipped"):(0,sfa.isCancellationError)(this._error)?(this._setOutcome("cancelled"),this._isVisible=!1):this._setOutcome("errored"),this.fireDidChange()}setResponse(e){this._isVisible=!0,this.response=e,this.fireDidChange()}setFullResponse(e){this.fullResponsePromise=e,e.then(r=>this.fullResponse=r)}async allPromisesResolved(){await this.fullResponsePromise}setProviderStartTime(){this.providerStartTime=Date.now(),this.fireDidChange()}setProviderEndTime(){this.providerEndTime=Date.now(),this.fireDidChange()}setFetchStartTime(){this.fetchStartTime=Date.now(),this.fireDidChange()}setFetchEndTime(){this.fetchEndTime=Date.now(),this.fireDidChange()}get responseResults(){return this._responseResults}setResponseResults(e){this._isVisible=!0,this._responseResults=e,this._outcome==="pending"&&(this._outcome="succeeded"),this.fireDidChange()}getDebugName(){return`NES | ${dfa(this.filePath)} (v${this.version})`}getMarkdownTitle(){return`${this._resolveIcon().svg} `+this.getDebugName()}setRecentEdit(e){this._recentEdit=e}trace(e){this._trace.push(e),this.fireDidChange()}_renderTraceDiagram(){if(this._trace.length===0)return[];let e=[];e.push("## Trace Diagram"),e.push(`
Trace Diagram `),e.push("```");let r=this._trace.map(d=>{let f=d.match(/^\[\s*(\d+)ms\]/),h=f?parseInt(f[1],10):0,m=d.replace(/^\[\s*\d+ms\]\s*/,""),g=[],A=m,y;for(;y=A.match(/^\[([^\]]+)\]/);)g.push(y[1]),A=A.slice(y[0].length);let _=A.trim();return{timestamp:h,segments:g,message:_}});if(r.length===0)return e.push("(no trace data)"),e.push("```"),e.push(`
`),e;let n=Math.max(...r.map(d=>d.timestamp)),o=Math.max(6,String(n).length+3),s=new Map,c=[];r.forEach((d,f)=>{let h=d.segments.join("|");for(let[g,A]of s)!h.startsWith(g)&&h!==g&&(c.push({path:g,startTime:A.startTime,endTime:d.timestamp,depth:A.depth,name:g.split("|").pop()||""}),s.delete(g));let m="";d.segments.forEach((g,A)=>{m=m?`${m}|${g}`:g,s.has(m)||s.set(m,{startTime:d.timestamp,depth:A})})});let l=r[r.length-1]?.timestamp||0;for(let[d,f]of s)c.push({path:d,startTime:f.startTime,endTime:l,depth:f.depth,name:d.split("|").pop()||""});e.push(""),e.push("Timeline (nested call hierarchy):"),e.push("\u2500".repeat(60));let u=[];for(let d of r){let f=`[${String(d.timestamp).padStart(o-3)}ms]`,h="\u2502 ",m="\u251C\u2500\u2500 ",g="",A="",y=!1;for(let _=0;_this.addLog(`- ${r}`))}addCodeblockToLog(e,r=""){this._logs.push(`\`\`\`${r} ${e} \`\`\` -`)}setDiagnosticsData(e){this._fileDiagnostics=e}setTerminalData(e){this._terminalOutput=e}setLanguageContext(e){this._languageContext=e}toJSON(){return{requestId:this.requestId,time:this.time,filePath:this.filePath,version:this.version,statelessNextEditProviderId:this._statelessNextEditProviderId,nextEditRequest:this._nextEditRequest?.serialize(),diagnosticsResultEdit:this._diagnosticsResultEdit?.toString(),resultEdit:this._resultEdit?.toString(),isCachedResult:!!this._logContextOfCachedEdit,prompt:this.prompt,error:String(this.error),response:this.fullResponse,responseResults:Ufi.stringify(this._responseResults,null," "),providerStartTime:this.providerStartTime,providerEndTime:this.providerEndTime,fetchStartTime:this.fetchStartTime,fetchEndTime:this.fetchEndTime,logs:this._logs,isAccepted:this._isAccepted,languageContext:this._languageContext?(0,afa.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};X4.InlineEditRequestLogContext=Y_r;function lfa(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(lfa,"basename")});var Qfi=I(Emt=>{"use strict";p();Object.defineProperty(Emt,"__esModule",{value:!0});Emt.GhostTextLogContext=void 0;var ufa=_mt(),dfa=$A(),K_r=class extends ufa.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,dfa.basename)(this.filePath)} (v${this.version})`}};Emt.GhostTextLogContext=K_r});var zG=I(g0e=>{"use strict";p();Object.defineProperty(g0e,"__esModule",{value:!0});g0e.CopilotTokenStore=g0e.ICopilotTokenStore=void 0;var ffa=an(),pfa=Fc(),hfa=Po();g0e.ICopilotTokenStore=(0,ffa.createServiceIdentifier)("ICopilotTokenStore");var J_r=class extends hfa.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new pfa.Emitter),this.onDidStoreUpdate=this._onDidStoreUpdate.event}get copilotToken(){return this._copilotToken}set copilotToken(e){let r=this._copilotToken?.token;this._copilotToken=e,r!==e?.token&&this._onDidStoreUpdate.fire()}};g0e.CopilotTokenStore=J_r});var bh=I(vy=>{"use strict";p();var mfa=vy&&vy.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},gfa=vy&&vy.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vy,"__esModule",{value:!0});vy.TelemetryTrustedValue=vy.ITelemetryService=vy.TelemetryUserConfigImpl=vy.ITelemetryUserConfig=void 0;vy.createTrackingIdGetter=yfa;vy.multiplexProperties=Efa;var qfi=an(),Afa=zG();vy.ITelemetryUserConfig=(0,qfi.createServiceIdentifier)("ITelemetryUserConfig");var Z_r=class{static{a(this,"TelemetryUserConfigImpl")}constructor(e,r,n){this._tokenStore=n,this.trackingId=e,this.optedIn=r??!1,this.updateFromToken(this._tokenStore.copilotToken),this._tokenStore.onDidStoreUpdate(()=>{this.updateFromToken(this._tokenStore.copilotToken)})}updateFromToken(e){if(!e)return;let r=e.getTokenValue("rt")==="1",n=e.getTokenValue("tid");n!==void 0&&(this.trackingId=n,this.organizationsList=e.organizationList.toString(),this.enterpriseList=e.enterpriseList.toString(),this.optedIn=r)}};vy.TelemetryUserConfigImpl=Z_r;vy.TelemetryUserConfigImpl=Z_r=mfa([gfa(2,Afa.ICopilotTokenStore)],Z_r);function yfa(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(yfa,"createTrackingIdGetter");vy.ITelemetryService=(0,qfi.createServiceIdentifier)("ITelemetryService");var X_r=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};vy.TelemetryTrustedValue=X_r;var t5e=8192,_fa=50;function Efa(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>t5e){let s=0,c=0;for(;o>0&&c<_fa;){c+=1;let l=r;c>1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+t5e;o{"use strict";p();var vfa=Vo&&Vo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Cfa=Vo&&Vo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bfa=Vo&&Vo.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&vfa(e,t,r);return Cfa(e,t),e},eEr=Vo&&Vo.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},tEr=Vo&&Vo.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var iEr=fte&&fte.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},oEr=fte&&fte.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]this.maxSizeBytes?[4,this._createBackupFile(r)]:[3,14];case 13:return u.sent(),[3,16];case 14:return[4,eL.appendFileAsync(this._fileFullPath,r)];case 15:u.sent(),u.label=16;case 16:return[3,18];case 17:return l=u.sent(),console.log(this.TAG,"Failed to create backup file: "+(l&&l.message)),[3,18];case 18:return[2]}})})},t.prototype._createBackupFile=function(e){return iEr(this,void 0,void 0,function(){var r,n,o;return oEr(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,eL.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=dte.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,eL.writeFileAsync(n,r)];case 2:return s.sent(),[3,5];case 3:return o=s.sent(),console.log("Failed to generate backup log file",o),[3,5];case 4:return eL.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return iEr(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return oEr(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,eL.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return dte.basename(u).indexOf(c._backUpNameFormat)>-1}),e.sort(function(u,d){var f=new Date(parseInt(u.split(c._backUpNameFormat)[0])),h=new Date(parseInt(d.split(c._backUpNameFormat)[0]));if(f=h)return 1}),r=e.length,n=0,l.label=2;case 2:return n{"use strict";p();var Vfi=$fi(),Pfa="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",Dfa="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",Nfa=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{Mfa.exports={}});var Cmt=I(A0e=>{"use strict";p();var Ofa=A0e&&A0e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(A0e,"__esModule",{value:!0});A0e.JsonConfig=void 0;var Lfa=require("fs"),vmt=require("path"),sEr=lu(),Bfa=Ofa(zfi()),Ffa="APPLICATIONINSIGHTS_CONFIGURATION_FILE",Ufa="APPLICATIONINSIGHTS_CONNECTION_STRING",Yfi="APPSETTING_",Kfi="APPINSIGHTS_INSTRUMENTATIONKEY",Jfi="APPINSIGHTS_INSTRUMENTATION_KEY",Qfa="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",qfa="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",jfa="http_proxy",Hfa="https_proxy",Gfa="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",$fa="APPLICATION_INSIGHTS_NO_STATSBEAT",Vfa="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",Wfa="APPLICATION_INSIGHTS_NO_PATCH_MODULES",zfa="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",Yfa="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",Kfa="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",Jfa="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",Zfa="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",Xfa=(function(){function t(){this.connectionString=process.env[Ufa],this.instrumentationKey=process.env[Kfi]||process.env[Yfi+Kfi]||process.env[Jfi]||process.env[Yfi+Jfi],!this.connectionString&&this.instrumentationKey&&sEr.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[qfa],this.extendedMetricDisablers=process.env[Qfa],this.proxyHttpUrl=process.env[jfa],this.proxyHttpsUrl=process.env[Hfa],this.noDiagnosticChannel=!!process.env[Gfa],this.disableStatsbeat=!!process.env[$fa],this.noHttpAgentKeepAlive=!!process.env[Vfa],this.noPatchModules=process.env[Wfa]||"",this.enableWebInstrumentation=!!process.env[zfa]||!!process.env[Jfa],this.webInstrumentationSrc=process.env[Kfa]||"",this.webInstrumentationConnectionString=process.env[Yfa]||process.env[Zfa]||"",this.enableAutoWebSnippetInjection=this.enableWebInstrumentation,this.webSnippetConnectionString=this.webInstrumentationConnectionString,this._loadJsonFile()}return a(t,"JsonConfig"),t.getInstance=function(){return t._instance||(t._instance=new t),t._instance},t.prototype._loadJsonFile=function(){var e="",r=process.env.APPLICATIONINSIGHTS_CONFIGURATION_CONTENT;if(r)e=r;else{var n="applicationinsights.json",o=vmt.join(__dirname,"../../");this._tempDir=vmt.join(o,n);var s=process.env[Ffa];if(s){vmt.isAbsolute(s)?this._tempDir=s:this._tempDir=vmt.join(o,s);try{e=Lfa.readFileSync(this._tempDir,"utf8")}catch(l){sEr.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(Bfa.default)}try{var c=JSON.parse(e);c.disableStatsbeat!=null&&(this.disableStatsbeat=c.disableStatsbeat),c.disableAllExtendedMetrics!=null&&(this.disableAllExtendedMetrics=c.disableStatsbeat),c.noDiagnosticChannel!=null&&(this.noDiagnosticChannel=c.noDiagnosticChannel),c.noHttpAgentKeepAlive!=null&&(this.noHttpAgentKeepAlive=c.noHttpAgentKeepAlive),c.connectionString!=null&&(this.connectionString=c.connectionString),c.extendedMetricDisablers!=null&&(this.extendedMetricDisablers=c.extendedMetricDisablers),c.noDiagnosticChannel!=null&&(this.noDiagnosticChannel=c.noDiagnosticChannel),c.proxyHttpUrl!=null&&(this.proxyHttpUrl=c.proxyHttpUrl),c.proxyHttpsUrl!=null&&(this.proxyHttpsUrl=c.proxyHttpsUrl),c.proxyHttpsUrl!=null&&(this.proxyHttpsUrl=c.proxyHttpsUrl),c.noPatchModules!=null&&(this.noPatchModules=c.noPatchModules),c.enableAutoWebSnippetInjection!=null&&(this.enableWebInstrumentation=c.enableAutoWebSnippetInjection,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation),c.enableWebInstrumentation!=null&&(this.enableWebInstrumentation=c.enableWebInstrumentation,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation),c.webSnippetConnectionString!=null&&(this.webInstrumentationConnectionString=c.webSnippetConnectionString,this.webSnippetConnectionString=this.webInstrumentationConnectionString),c.webInstrumentationConnectionString!=null&&(this.webInstrumentationConnectionString=c.webInstrumentationConnectionString,this.webSnippetConnectionString=this.webInstrumentationConnectionString),c.webInstrumentationConfig!=null&&(this.webInstrumentationConfig=c.webInstrumentationConfig),c.webInstrumentationSrc!=null&&(this.webInstrumentationSrc=c.webInstrumentationSrc),c.enableLoggerErrorToTrace!=null&&(this.enableLoggerErrorToTrace=c.enableLoggerErrorToTrace),this.endpointUrl=c.endpointUrl,this.maxBatchSize=c.maxBatchSize,this.maxBatchIntervalMs=c.maxBatchIntervalMs,this.disableAppInsights=c.disableAppInsights,this.samplingPercentage=c.samplingPercentage,this.correlationIdRetryIntervalMs=c.correlationIdRetryIntervalMs,this.correlationHeaderExcludedDomains=c.correlationHeaderExcludedDomains,this.ignoreLegacyHeaders=c.ignoreLegacyHeaders,this.distributedTracingMode=c.distributedTracingMode,this.enableAutoCollectExternalLoggers=c.enableAutoCollectExternalLoggers,this.enableAutoCollectConsole=c.enableAutoCollectConsole,this.enableLoggerErrorToTrace=c.enableLoggerErrorToTrace,this.enableAutoCollectExceptions=c.enableAutoCollectExceptions,this.enableAutoCollectPerformance=c.enableAutoCollectPerformance,this.enableAutoCollectExtendedMetrics=c.enableAutoCollectExtendedMetrics,this.enableAutoCollectPreAggregatedMetrics=c.enableAutoCollectPreAggregatedMetrics,this.enableAutoCollectHeartbeat=c.enableAutoCollectHeartbeat,this.enableAutoCollectRequests=c.enableAutoCollectRequests,this.enableAutoCollectDependencies=c.enableAutoCollectDependencies,this.enableAutoDependencyCorrelation=c.enableAutoDependencyCorrelation,this.enableAutoCollectIncomingRequestAzureFunctions=c.enableAutoCollectIncomingRequestAzureFunctions,this.enableUseAsyncHooks=c.enableUseAsyncHooks,this.enableUseDiskRetryCaching=c.enableUseDiskRetryCaching,this.enableResendInterval=c.enableResendInterval,this.enableMaxBytesOnDisk=c.enableMaxBytesOnDisk,this.enableInternalDebugLogging=c.enableInternalDebugLogging,this.enableInternalWarningLogging=c.enableInternalWarningLogging,this.enableSendLiveMetrics=c.enableSendLiveMetrics,this.quickPulseHost=c.quickPulseHost}catch(l){sEr.warn("Invalid JSON config file: ",l)}},t})();A0e.JsonConfig=Xfa});var aEr=I(bmt=>{"use strict";p();Object.defineProperty(bmt,"__esModule",{value:!0});bmt.makePatchingRequire=void 0;var epa=require("path"),tpa=WP(),Zfi=Pp(),epi=require("module"),rpa=Object.keys(process.binding("natives")),Xfi=epi.prototype.require;function npa(t){var e={};return a(function(n){var o=Xfi.apply(this,arguments);if(t[n]){var s=epi._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(rpa.indexOf(n)<0)try{c=Xfi.call(this,epa.join(n,"package.json")).version}catch{return o}else c=process.version.substring(1);var l=c.indexOf("-");l>=0&&(c=c.substring(0,l));for(var u=o,d=0,f=t[n];d{ipa.exports={name:"diagnostic-channel",version:"1.1.1",main:"./dist/src/channel.js",types:"./dist/src/channel.d.ts",scripts:{build:"tsc",lint:"eslint ./ --fix",clean:"rimraf ./dist",test:"mocha ./dist/tests/**/*.js",debug:"mocha --inspect-brk ./dist/tests/**/*.js"},homepage:"https://github.com/Microsoft/node-diagnostic-channel",bugs:{url:"https://github.com/Microsoft/node-diagnostic-channel/issues"},repository:{type:"git",url:"https://github.com/Microsoft/node-diagnostic-channel.git"},description:"Provides a context-saving pub/sub channel to connect diagnostic event publishers and subscribers",dependencies:{semver:"^7.5.3"},devDependencies:{"@types/mocha":"^2.2.40","@types/node":"~8.0.0",mocha:"^3.2.0",rimraf:"^2.6.1",sinon:"1.17.6",typescript:"4.1.2"},files:["dist/src/**/*.d.ts","dist/src/**/*.js","LICENSE","README.md","package.json"],license:"MIT"}});var Pp=I(UR=>{"use strict";p();Object.defineProperty(UR,"__esModule",{value:!0});UR.channel=UR.ContextPreservingEventEmitter=UR.trueFilter=UR.makePatchingRequire=void 0;var opa=aEr(),spa=aEr();Object.defineProperty(UR,"makePatchingRequire",{enumerable:!0,get:a(function(){return spa.makePatchingRequire},"get")});var apa=a(function(t){return!0},"trueFilter");UR.trueFilter=apa;var npi=(function(){function t(){this.version=tpi().version,this.subscribers={},this.contextPreservationFunction=function(e){return e},this.knownPatches={},this.modulesPatched=[],this.currentlyPublishing=!1}return a(t,"ContextPreservingEventEmitter"),t.prototype.shouldPublish=function(e){var r=this.subscribers[e];return r?r.some(function(n){var o=n.filter;return!o||o(!1)}):!1},t.prototype.publish=function(e,r){if(!this.currentlyPublishing){var n=this.subscribers[e];if(n){var o={timestamp:Date.now(),data:r};this.currentlyPublishing=!0,n.forEach(function(s){var c=s.listener,l=s.filter;try{l&&l(!0)&&c(o)}catch{}}),this.currentlyPublishing=!1}}},t.prototype.subscribe=function(e,r,n,o){n===void 0&&(n=UR.trueFilter),this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push({listener:r,filter:n,patchCallback:o});var s=this.checkIfModuleIsAlreadyPatched(e);s&&o&&o(s.name,s.version)},t.prototype.unsubscribe=function(e,r,n){n===void 0&&(n=UR.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();ipi=typeof globalThis=="object"?globalThis:global});var spi=Se(()=>{p();opi()});var api=Se(()=>{p();spi()});var g6,cEr=Se(()=>{p();g6="1.9.0"});function cpa(t){var e=new Set([t]),r=new Set,n=t.match(cpi);if(!n)return function(){return!1};var o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(o.prerelease!=null)return a(function(u){return u===t},"isExactmatch");function s(l){return r.add(l),!1}a(s,"_reject");function c(l){return e.add(l),!0}return a(c,"_accept"),a(function(u){if(e.has(u))return!0;if(r.has(u))return!1;var d=u.match(cpi);if(!d)return s(u);var f={major:+d[1],minor:+d[2],patch:+d[3],prerelease:d[4]};return f.prerelease!=null||o.major!==f.major?s(u):o.major===0?o.minor===f.minor&&o.patch<=f.patch?c(u):s(u):o.minor<=f.minor?c(u):s(u)},"isCompatible")}var cpi,lpi,upi=Se(()=>{p();cEr();cpi=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(cpa,"_makeCompatibilityCheck");lpi=cpa(g6)});function tL(t,e,r,n){var o;n===void 0&&(n=!1);var s=n5e[r5e]=(o=n5e[r5e])!==null&&o!==void 0?o:{version:g6};if(!n&&s[t]){var c=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(c.stack||c.message),!1}if(s.version!==g6){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+g6);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+g6+"."),!0}function hI(t){var e,r,n=(e=n5e[r5e])===null||e===void 0?void 0:e.version;if(!(!n||!lpi(n)))return(r=n5e[r5e])===null||r===void 0?void 0:r[t]}function rL(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+g6+".");var r=n5e[r5e];r&&delete r[t]}var lpa,r5e,n5e,pte=Se(()=>{p();api();cEr();upi();lpa=g6.split(".")[0],r5e=Symbol.for("opentelemetry.js.api."+lpa),n5e=ipi;a(tL,"registerGlobal");a(hI,"getGlobal");a(rL,"unregisterGlobal")});function i5e(t,e,r){var n=hI("diag");if(n)return r.unshift(e),n[t].apply(n,dpa([],upa(r),!1))}var upa,dpa,dpi,fpi=Se(()=>{p();pte();upa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},dpa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(Ua||(Ua={}))});function ppi(t,e){tUa.ALL&&(t=Ua.ALL),e=e||{};function r(n,o){var s=e[n];return typeof s=="function"&&t>=o?s.bind(e):function(){}}return a(r,"_filterFunc"),{error:r("error",Ua.ERROR),warn:r("warn",Ua.WARN),info:r("info",Ua.INFO),debug:r("debug",Ua.DEBUG),verbose:r("verbose",Ua.VERBOSE)}}var hpi=Se(()=>{p();Smt();a(ppi,"createLogLevelDiagLogger")});var fpa,ppa,hpa,Y_,hte=Se(()=>{p();fpi();hpi();Smt();pte();fpa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},ppa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n";f.warn("Current logger will be overwritten from "+m),h.warn("Current logger will overwrite one already registered from "+m)}return tL("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){rL(hpa,r)},r.createComponentLogger=function(o){return new dpi(o)},r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}return a(t,"DiagAPI"),t.instance=function(){return this._instance||(this._instance=new t),this._instance},t})()});var mpa,gpa,mpi,gpi=Se(()=>{p();mpa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},gpa=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},mpi=(function(){function t(e){this._entries=e?new Map(e):new Map}return a(t,"BaggageImpl"),t.prototype.getEntry=function(e){var r=this._entries.get(e);if(r)return Object.assign({},r)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var r=mpa(e,2),n=r[0],o=r[1];return[n,o]})},t.prototype.setEntry=function(e,r){var n=new t(this._entries);return n._entries.set(e,r),n},t.prototype.removeEntry=function(e){var r=new t(this._entries);return r._entries.delete(e),r},t.prototype.removeEntries=function(){for(var e,r,n=[],o=0;o{p();Api=Symbol("BaggageEntryMetadata")});function _pi(t){return t===void 0&&(t={}),new mpi(new Map(Object.entries(t)))}function y0e(t){return typeof t!="string"&&(Apa.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:Api,toString:a(function(){return t},"toString")}}var Apa,lEr=Se(()=>{p();hte();gpi();ypi();Apa=Y_.instance();a(_pi,"createBaggage");a(y0e,"baggageEntryMetadataFromString")});function oS(t){return Symbol.for(t)}var ypa,Tmt,o5e=Se(()=>{p();a(oS,"createContextKey");ypa=(function(){function t(e){var r=this;r._currentContext=e?new Map(e):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,o){var s=new t(r._currentContext);return s._currentContext.set(n,o),s},r.deleteValue=function(n){var o=new t(r._currentContext);return o._currentContext.delete(n),o}}return a(t,"BaseContext"),t})(),Tmt=new ypa});var uEr,Epi,vpi=Se(()=>{p();uEr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],Epi=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();mte=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),_pa=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return wpa},t.prototype.createHistogram=function(e,r){return Rpa},t.prototype.createCounter=function(e,r){return xpa},t.prototype.createUpDownCounter=function(e,r){return kpa},t.prototype.createObservableGauge=function(e,r){return Dpa},t.prototype.createObservableCounter=function(e,r){return Ppa},t.prototype.createObservableUpDownCounter=function(e,r){return Npa},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),Imt=(function(){function t(){}return a(t,"NoopMetric"),t})(),Epa=(function(t){mte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(Imt),vpa=(function(t){mte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(Imt),Cpa=(function(t){mte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(Imt),bpa=(function(t){mte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(Imt),dEr=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),Spa=(function(t){mte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(dEr),Tpa=(function(t){mte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(dEr),Ipa=(function(t){mte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(dEr),fEr=new _pa,xpa=new Epa,wpa=new Cpa,Rpa=new bpa,kpa=new vpa,Ppa=new Spa,Dpa=new Tpa,Npa=new Ipa;a(Cpi,"createNoopMeter")});var xmt,bpi=Se(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(xmt||(xmt={}))});var wmt,Rmt,hEr=Se(()=>{p();wmt={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},Rmt={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var Mpa,Opa,Spi,Tpi=Se(()=>{p();o5e();Mpa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Opa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();Tpi();pte();hte();Lpa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Bpa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Uf||(Uf={}))});var a5e,c5e,_0e,kmt=Se(()=>{p();gEr();a5e="0000000000000000",c5e="00000000000000000000000000000000",_0e={traceId:c5e,spanId:a5e,traceFlags:Uf.NONE}});var KG,Pmt=Se(()=>{p();kmt();KG=(function(){function t(e){e===void 0&&(e=_0e),this._spanContext=e}return a(t,"NonRecordingSpan"),t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.addLink=function(e){return this},t.prototype.addLinks=function(e){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t})()});function Dmt(t){return t.getValue(AEr)||void 0}function Ipi(){return Dmt(YG.getInstance().active())}function l5e(t,e){return t.setValue(AEr,e)}function xpi(t){return t.deleteValue(AEr)}function wpi(t,e){return l5e(t,new KG(e))}function Nmt(t){var e;return(e=Dmt(t))===null||e===void 0?void 0:e.spanContext()}var AEr,yEr=Se(()=>{p();o5e();Pmt();s5e();AEr=oS("OpenTelemetry Context Key SPAN");a(Dmt,"getSpan");a(Ipi,"getActiveSpan");a(l5e,"setSpan");a(xpi,"deleteSpan");a(wpi,"setSpanContext");a(Nmt,"getSpanContext")});function gte(t){return Upa.test(t)&&t!==c5e}function _Er(t){return Qpa.test(t)&&t!==a5e}function sS(t){return gte(t.traceId)&&_Er(t.spanId)}function Rpi(t){return new KG(t)}var Upa,Qpa,Mmt=Se(()=>{p();kmt();Pmt();Upa=/^([0-9a-f]{32})$/i,Qpa=/^[0-9a-f]{16}$/i;a(gte,"isValidTraceId");a(_Er,"isValidSpanId");a(sS,"isSpanContextValid");a(Rpi,"wrapSpanContext")});function qpa(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var EEr,Omt,vEr=Se(()=>{p();s5e();yEr();Pmt();Mmt();EEr=YG.getInstance(),Omt=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=EEr.active());var o=!!r?.root;if(o)return new KG;var s=n&&Nmt(n);return qpa(s)&&sS(s)?new KG(s):new KG},t.prototype.startActiveSpan=function(e,r,n,o){var s,c,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,c=n,l=o);var u=c??EEr.active(),d=this.startSpan(e,s,u),f=l5e(u,d);return EEr.with(f,l,void 0,d)}},t})();a(qpa,"isSpanContext")});var jpa,Lmt,CEr=Se(()=>{p();vEr();jpa=new Omt,Lmt=(function(){function t(e,r,n,o){this._provider=e,this.name=r,this.version=n,this.options=o}return a(t,"ProxyTracer"),t.prototype.startSpan=function(e,r,n){return this._getTracer().startSpan(e,r,n)},t.prototype.startActiveSpan=function(e,r,n,o){var s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):jpa},t})()});var kpi,Ppi=Se(()=>{p();vEr();kpi=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new Omt},t})()});var Hpa,u5e,bEr=Se(()=>{p();CEr();Ppi();Hpa=new kpi,u5e=(function(){function t(){}return a(t,"ProxyTracerProvider"),t.prototype.getTracer=function(e,r,n){var o;return(o=this.getDelegateTracer(e,r,n))!==null&&o!==void 0?o:new Lmt(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Hpa},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,r,n)},t})()});var aS,Dpi=Se(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(aS||(aS={}))});var E0e,Npi=Se(()=>{p();(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(E0e||(E0e={}))});var v0e,Mpi=Se(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(v0e||(v0e={}))});function Opi(t){return Vpa.test(t)}function Lpi(t){return Wpa.test(t)&&!zpa.test(t)}var SEr,Gpa,$pa,Vpa,Wpa,zpa,Bpi=Se(()=>{p();SEr="[_0-9a-z-*/]",Gpa="[a-z]"+SEr+"{0,255}",$pa="[a-z0-9]"+SEr+"{0,240}@[a-z]"+SEr+"{0,13}",Vpa=new RegExp("^(?:"+Gpa+"|"+$pa+")$"),Wpa=/^[ -~]{0,255}[!-~]$/,zpa=/,|=/;a(Opi,"validateKey");a(Lpi,"validateValue")});var Fpi,Ypa,Upi,Qpi,qpi,jpi=Se(()=>{p();Bpi();Fpi=32,Ypa=512,Upi=",",Qpi="=",qpi=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return a(t,"TraceStateImpl"),t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+Qpi+e.get(n)),r},[]).join(Upi)},t.prototype._parse=function(e){e.length>Ypa||(this._internalState=e.split(Upi).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(Qpi);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);Opi(c)&&Lpi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Fpi&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Fpi))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function Hpi(t){return new qpi(t)}var Gpi=Se(()=>{p();jpi();a(Hpi,"createTraceState")});var X0,$pi=Se(()=>{p();s5e();X0=YG.getInstance()});var On,Vpi=Se(()=>{p();hte();On=Y_.instance()});var Kpa,Wpi,zpi=Se(()=>{p();pEr();Kpa=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return fEr},t})(),Wpi=new Kpa});var TEr,Ypi,Kpi=Se(()=>{p();zpi();pte();hte();TEr="metrics",Ypi=(function(){function t(){}return a(t,"MetricsAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return tL(TEr,e,Y_.instance())},t.prototype.getMeterProvider=function(){return hI(TEr)||Wpi},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){rL(TEr,Y_.instance())},t})()});var Ate,Jpi=Se(()=>{p();Kpi();Ate=Ypi.getInstance()});var Zpi,Xpi=Se(()=>{p();Zpi=(function(){function t(){}return a(t,"NoopTextMapPropagator"),t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})()});function xEr(t){return t.getValue(IEr)||void 0}function ehi(){return xEr(YG.getInstance().active())}function thi(t,e){return t.setValue(IEr,e)}function rhi(t){return t.deleteValue(IEr)}var IEr,nhi=Se(()=>{p();s5e();o5e();IEr=oS("OpenTelemetry Baggage Key");a(xEr,"getBaggage");a(ehi,"getActiveBaggage");a(thi,"setBaggage");a(rhi,"deleteBaggage")});var wEr,Jpa,ihi,ohi=Se(()=>{p();pte();Xpi();hEr();nhi();lEr();hte();wEr="propagation",Jpa=new Zpi,ihi=(function(){function t(){this.createBaggage=_pi,this.getBaggage=xEr,this.getActiveBaggage=ehi,this.setBaggage=thi,this.deleteBaggage=rhi}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return tL(wEr,e,Y_.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=Rmt),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=wmt),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){rL(wEr,Y_.instance())},t.prototype._getGlobalPropagator=function(){return hI(wEr)||Jpa},t})()});var mI,shi=Se(()=>{p();ohi();mI=ihi.getInstance()});var REr,ahi,chi=Se(()=>{p();pte();bEr();Mmt();yEr();hte();REr="trace",ahi=(function(){function t(){this._proxyTracerProvider=new u5e,this.wrapSpanContext=Rpi,this.isSpanContextValid=sS,this.deleteSpan=xpi,this.getSpan=Dmt,this.getActiveSpan=Ipi,this.getSpanContext=Nmt,this.setSpan=l5e,this.setSpanContext=wpi}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=tL(REr,this._proxyTracerProvider,Y_.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return hI(REr)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){rL(REr,Y_.instance()),this._proxyTracerProvider=new u5e},t})()});var Uu,lhi=Se(()=>{p();chi();Uu=ahi.getInstance()});var A6={};Ti(A6,{DiagConsoleLogger:()=>Epi,DiagLogLevel:()=>Ua,INVALID_SPANID:()=>a5e,INVALID_SPAN_CONTEXT:()=>_0e,INVALID_TRACEID:()=>c5e,ProxyTracer:()=>Lmt,ProxyTracerProvider:()=>u5e,ROOT_CONTEXT:()=>Tmt,SamplingDecision:()=>aS,SpanKind:()=>E0e,SpanStatusCode:()=>v0e,TraceFlags:()=>Uf,ValueType:()=>xmt,baggageEntryMetadataFromString:()=>y0e,context:()=>X0,createContextKey:()=>oS,createNoopMeter:()=>Cpi,createTraceState:()=>Hpi,default:()=>Zpa,defaultTextMapGetter:()=>wmt,defaultTextMapSetter:()=>Rmt,diag:()=>On,isSpanContextValid:()=>sS,isValidSpanId:()=>_Er,isValidTraceId:()=>gte,metrics:()=>Ate,propagation:()=>mI,trace:()=>Uu});var Zpa,go=Se(()=>{p();lEr();o5e();vpi();Smt();pEr();bpi();hEr();CEr();bEr();Dpi();Npi();Mpi();gEr();Gpi();Mmt();kmt();$pi();Vpi();Jpi();shi();lhi();Zpa={context:X0,diag:On,metrics:Ate,propagation:mI,trace:Uu}});function C0e(t){return t.setValue(kEr,!0)}function uhi(t){return t.deleteValue(kEr)}function JG(t){return t.getValue(kEr)===!0}var kEr,d5e=Se(()=>{p();go();kEr=oS("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(C0e,"suppressTracing");a(uhi,"unsuppressTracing");a(JG,"isTracingSuppressed")});var dhi,Bmt,b0e,Fmt,fhi,phi,hhi,PEr=Se(()=>{p();dhi="=",Bmt=";",b0e=",",Fmt="baggage",fhi=180,phi=4096,hhi=8192});function Umt(t){return t.reduce(function(e,r){var n=""+e+(e!==""?b0e:"")+r;return n.length>hhi?e:n},"")}function Qmt(t){return t.getAllEntries().map(function(e){var r=Xpa(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=Bmt+o.metadata.toString()),s})}function f5e(t){var e=t.split(Bmt);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(dhi);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=y0e(e.join(Bmt))),{key:o,value:s,metadata:c}}}}}function mhi(t){return typeof t!="string"||t.length===0?{}:t.split(b0e).map(function(e){return f5e(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var Xpa,DEr=Se(()=>{p();go();PEr();Xpa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s};a(Umt,"serializeKeyPairs");a(Qmt,"getKeyPairs");a(f5e,"parsePairKeyValue");a(mhi,"parseKeyPairsIntoRecord")});var qmt,ghi=Se(()=>{p();go();d5e();PEr();DEr();qmt=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=mI.getBaggage(e);if(!(!o||JG(e))){var s=Qmt(o).filter(function(l){return l.length<=phi}).slice(0,fhi),c=Umt(s);c.length>0&&n.set(r,Fmt,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,Fmt),s=Array.isArray(o)?o.join(b0e):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(b0e);return l.forEach(function(u){var d=f5e(u);if(d){var f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0?e:mI.setBaggage(e,mI.createBaggage(c))},t.prototype.fields=function(){return[Fmt]},t})()});var Ahi,yhi=Se(()=>{p();Ahi=(function(){function t(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}return a(t,"AnchoredClock"),t.prototype.now=function(){var e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e},t})()});function ZG(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=_hi(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=eha(s.value,2),l=c[0],u=c[1];if(!NEr(l)){On.warn("Invalid attribute key: "+l);continue}if(!p5e(u)){On.warn("Invalid attribute value set for key: "+l);continue}Array.isArray(u)?n[l]=u.slice():n[l]=u}}catch(d){e={error:d}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}function NEr(t){return typeof t=="string"&&t.length>0}function p5e(t){return t==null?!0:Array.isArray(t)?tha(t):Ehi(t)}function tha(t){var e,r,n;try{for(var o=_hi(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if(Ehi(c)){n=typeof c;continue}return!1}if(typeof c!==n)return!1}}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return!0}function Ehi(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var _hi,eha,vhi=Se(()=>{p();go();_hi=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},eha=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s};a(ZG,"sanitizeAttributes");a(NEr,"isAttributeKey");a(p5e,"isAttributeValue");a(tha,"isHomogeneousAttributeValueArray");a(Ehi,"isValidPrimitiveAttributeValue")});function jmt(){return function(t){On.error(rha(t))}}function rha(t){return typeof t=="string"?t:JSON.stringify(nha(t))}function nha(t){for(var e={},r=t;r!==null;)Object.getOwnPropertyNames(r).forEach(function(n){if(!e[n]){var o=r[n];o&&(e[n]=String(o))}}),r=Object.getPrototypeOf(r);return e}var MEr=Se(()=>{p();go();a(jmt,"loggingErrorHandler");a(rha,"stringifyException");a(nha,"flattenException")});function bhi(t){Chi=t}function Fv(t){try{Chi(t)}catch{}}var Chi,OEr=Se(()=>{p();MEr();Chi=jmt();a(bhi,"setGlobalErrorHandler");a(Fv,"globalErrorHandler")});var cS,LEr=Se(()=>{p();(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(cS||(cS={}))});function sha(t){return oha.indexOf(t)>-1}function cha(t){return aha.indexOf(t)>-1}function uha(t){return lha.indexOf(t)>-1}function dha(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function fha(t,e,r,n,o){if(n===void 0&&(n=-1/0),o===void 0&&(o=1/0),typeof r[t]<"u"){var s=Number(r[t]);isNaN(s)||(so?e[t]=o:e[t]=s)}}function pha(t,e,r,n){n===void 0&&(n=iha);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function mha(t,e,r){var n=r[t];if(typeof n=="string"){var o=hha[n.toUpperCase()];o!=null&&(e[t]=o)}}function m5e(t){var e={};for(var r in h5e){var n=r;switch(n){case"OTEL_LOG_LEVEL":mha(n,e,t);break;default:if(sha(n))dha(n,e,t);else if(cha(n))fha(n,e,t);else if(uha(n))pha(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var iha,oha,aha,lha,yte,_te,BEr,FEr,h5e,hha,UEr=Se(()=>{p();go();LEr();iha=",",oha=["OTEL_SDK_DISABLED"];a(sha,"isEnvVarABoolean");aha=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];a(cha,"isEnvVarANumber");lha=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(uha,"isEnvVarAList");yte=1/0,_te=128,BEr=128,FEr=128,h5e={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:Ua.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:yte,OTEL_ATTRIBUTE_COUNT_LIMIT:_te,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:yte,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:_te,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:yte,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:_te,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:BEr,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:FEr,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:cS.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};a(dha,"parseBoolean");a(fha,"parseNumber");a(pha,"parseStringList");hha={ALL:Ua.ALL,VERBOSE:Ua.VERBOSE,DEBUG:Ua.DEBUG,INFO:Ua.INFO,WARN:Ua.WARN,ERROR:Ua.ERROR,NONE:Ua.NONE};a(mha,"setLogLevelFromEnv");a(m5e,"parseEnvironment")});function QR(){var t=m5e(process.env);return Object.assign({},h5e,t)}function S0e(){return m5e(process.env)}var Shi=Se(()=>{p();UEr();a(QR,"getEnv");a(S0e,"getEnvWithoutDefaults")});var Hmt,Thi=Se(()=>{p();Hmt=typeof globalThis=="object"?globalThis:global});function Ihi(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Gmt(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(Ihi,"intValue");a(Gmt,"hexToBinary")});function $mt(t){return Buffer.from(Gmt(t)).toString("base64")}var xhi=Se(()=>{p();QEr();a($mt,"hexToBase64")});function whi(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(Vmt[t-1]=1);return Vmt.toString("hex",0,t)},"generateId")}var gha,Rhi,Wmt,Vmt,khi=Se(()=>{p();gha=8,Rhi=16,Wmt=(function(){function t(){this.generateTraceId=whi(Rhi),this.generateSpanId=whi(gha)}return a(t,"RandomIdGenerator"),t})(),Vmt=Buffer.allocUnsafe(Rhi);a(whi,"getIdGenerator")});var Phi,qR,Dhi=Se(()=>{p();Phi=require("perf_hooks"),qR=Phi.performance});var zmt,qEr=Se(()=>{p();zmt="1.30.1"});var Nhi=Se(()=>{p()});var Mhi=Se(()=>{p();Nhi()});var Aha,yha,_ha,Eha,Ohi,Lhi,Bhi,Fhi,vha,Uhi,Qhi=Se(()=>{p();Aha="process.runtime.name",yha="telemetry.sdk.name",_ha="telemetry.sdk.language",Eha="telemetry.sdk.version",Ohi=Aha,Lhi=yha,Bhi=_ha,Fhi=Eha,vha="nodejs",Uhi=vha});var qhi=Se(()=>{p();Qhi()});var jhi=Se(()=>{p()});var Hhi=Se(()=>{p()});var Ghi=Se(()=>{p();Mhi();qhi();jhi();Hhi()});var T0e,XG,$hi=Se(()=>{p();qEr();Ghi();XG=(T0e={},T0e[Lhi]="opentelemetry",T0e[Ohi]="node",T0e[Bhi]=Uhi,T0e[Fhi]=zmt,T0e)});function I0e(t){t.unref()}var Vhi=Se(()=>{p();a(I0e,"unrefTimer")});var Whi=Se(()=>{p();Shi();Thi();xhi();khi();Dhi();$hi();Vhi()});var jEr=Se(()=>{p();Whi()});function kD(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*bha);return[r,n]}function x0e(){var t=qR.timeOrigin;if(typeof t!="number"){var e=qR;t=e.timing&&e.timing.fetchStart}return t}function g5e(t){var e=kD(x0e()),r=kD(typeof t=="number"?t:qR.now());return _5e(e,r)}function Yhi(t){if(w0e(t))return t;if(typeof t=="number")return t=Ymt&&(r[1]-=Ymt,r[0]+=1),r}var zhi,Cha,bha,Ymt,Xhi=Se(()=>{p();jEr();zhi=9,Cha=6,bha=Math.pow(10,Cha),Ymt=Math.pow(10,zhi);a(kD,"millisToHrTime");a(x0e,"getTimeOrigin");a(g5e,"hrTime");a(Yhi,"timeInputToHrTime");a(Kmt,"hrTimeDuration");a(Khi,"hrTimeToTimeStamp");a(Jhi,"hrTimeToNanoseconds");a(Zhi,"hrTimeToMilliseconds");a(A5e,"hrTimeToMicroseconds");a(w0e,"isTimeInputHrTime");a(y5e,"isTimeInput");a(_5e,"addHrTimes")});var gI,emi=Se(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(gI||(gI={}))});var Sha,Jmt,tmi=Se(()=>{p();go();Sha=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Jmt=(function(){function t(e){e===void 0&&(e={});var r;this._propagators=(r=e.propagators)!==null&&r!==void 0?r:[],this._fields=Array.from(new Set(this._propagators.map(function(n){return typeof n.fields=="function"?n.fields():[]}).reduce(function(n,o){return n.concat(o)},[])))}return a(t,"CompositePropagator"),t.prototype.inject=function(e,r,n){var o,s;try{for(var c=Sha(this._propagators),l=c.next();!l.done;l=c.next()){var u=l.value;try{u.inject(e,r,n)}catch(d){On.warn("Failed to inject with "+u.constructor.name+". Err: "+d.message)}}}catch(d){o={error:d}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}},t.prototype.extract=function(e,r,n){return this._propagators.reduce(function(o,s){try{return s.extract(o,r,n)}catch(c){On.warn("Failed to extract with "+s.constructor.name+". Err: "+c.message)}return o},e)},t.prototype.fields=function(){return this._fields.slice()},t})()});function rmi(t){return xha.test(t)}function nmi(t){return wha.test(t)&&!Rha.test(t)}var HEr,Tha,Iha,xha,wha,Rha,imi=Se(()=>{p();HEr="[_0-9a-z-*/]",Tha="[a-z]"+HEr+"{0,255}",Iha="[a-z0-9]"+HEr+"{0,240}@[a-z]"+HEr+"{0,13}",xha=new RegExp("^(?:"+Tha+"|"+Iha+")$"),wha=/^[ -~]{0,255}[!-~]$/,Rha=/,|=/;a(rmi,"validateKey");a(nmi,"validateValue")});var omi,kha,smi,ami,Zmt,GEr=Se(()=>{p();imi();omi=32,kha=512,smi=",",ami="=",Zmt=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return a(t,"TraceState"),t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+ami+e.get(n)),r},[]).join(smi)},t.prototype._parse=function(e){e.length>kha||(this._internalState=e.split(smi).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(ami);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);rmi(c)&&nmi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>omi&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,omi))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function $Er(t){var e=Lha.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var E5e,v5e,Pha,Dha,Nha,Mha,Oha,Lha,Xmt,cmi=Se(()=>{p();go();d5e();GEr();E5e="traceparent",v5e="tracestate",Pha="00",Dha="(?!ff)[\\da-f]{2}",Nha="(?![0]{32})[\\da-f]{32}",Mha="(?![0]{16})[\\da-f]{16}",Oha="[\\da-f]{2}",Lha=new RegExp("^\\s?("+Dha+")-("+Nha+")-("+Mha+")-("+Oha+")(-.*)?\\s?$");a($Er,"parseTraceParent");Xmt=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=Uu.getSpanContext(e);if(!(!o||JG(e)||!sS(o))){var s=Pha+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||Uf.NONE).toString(16);n.set(r,E5e,s),o.traceState&&n.set(r,v5e,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,E5e);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=$Er(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,v5e);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new Zmt(typeof u=="string"?u:void 0)}return Uu.setSpanContext(e,c)},t.prototype.fields=function(){return[E5e,v5e]},t})()});function lmi(t,e){return t.setValue(VEr,e)}function umi(t){return t.deleteValue(VEr)}function dmi(t){return t.getValue(VEr)}var VEr,egt,fmi=Se(()=>{p();go();VEr=oS("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(egt||(egt={}));a(lmi,"setRPCMetadata");a(umi,"deleteRPCMetadata");a(dmi,"getRPCMetadata")});var C5e,WEr=Se(()=>{p();go();C5e=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:aS.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var R0e,zEr=Se(()=>{p();go();R0e=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:aS.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var pmi,hmi=Se(()=>{p();go();OEr();WEr();zEr();pmi=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(Fv(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new R0e),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new R0e,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new C5e,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new R0e,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new C5e}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=Uu.getSpanContext(e);return!l||!sS(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&Uf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&Uf.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,s,c):this._localParentNotSampled.shouldSample(e,r,n,o,s,c)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t})()});var mmi,gmi=Se(()=>{p();go();mmi=(function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return a(t,"TraceIdRatioBasedSampler"),t.prototype.shouldSample=function(e,r){return{decision:gte(r)&&this._accumulate(r)=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n>>0}return r},t})()});function Hha(t,e){return function(r){return t(e(r))}}function YEr(t){if(!Gha(t)||$ha(t)!==Bha)return!1;var e=jha(t);if(e===null)return!0;var r=_mi.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Ami.call(r)===qha}function Gha(t){return t!=null&&typeof t=="object"}function $ha(t){return t==null?t===void 0?Uha:Fha:Ete&&Ete in Object(t)?Vha(t):Wha(t)}function Vha(t){var e=_mi.call(t,Ete),r=t[Ete],n=!1;try{t[Ete]=void 0,n=!0}catch{}var o=Emi.call(t);return n&&(e?t[Ete]=r:delete t[Ete]),o}function Wha(t){return Emi.call(t)}var Bha,Fha,Uha,Qha,Ami,qha,jha,ymi,_mi,Ete,Emi,vmi=Se(()=>{p();Bha="[object Object]",Fha="[object Null]",Uha="[object Undefined]",Qha=Function.prototype,Ami=Qha.toString,qha=Ami.call(Object),jha=Hha(Object.getPrototypeOf,Object),ymi=Object.prototype,_mi=ymi.hasOwnProperty,Ete=Symbol?Symbol.toStringTag:void 0,Emi=ymi.toString;a(Hha,"overArg");a(YEr,"isPlainObject");a(Gha,"isObjectLike");a($ha,"baseGetTag");a(Vha,"getRawTag");a(Wha,"objectToString")});function ngt(){for(var t=[],e=0;e0;)r=bmi(r,t.shift(),0,n);return r}function KEr(t){return rgt(t)?t.slice():t}function bmi(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>zha)){if(r++,tgt(t)||tgt(e)||Smi(e))o=KEr(e);else if(rgt(t)){if(o=t.slice(),rgt(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(Cmi(t,u,n)||Cmi(e,u,n))delete o[u];else{if(b5e(f)&&b5e(h)){var m=n.get(f)||[],g=n.get(h)||[];m.push({obj:t,key:u}),g.push({obj:e,key:u}),n.set(f,m),n.set(h,g)}o[u]=bmi(o[u],d,r,n)}}}}else o=e;return o}}function Cmi(t,e,r){for(var n=r.get(t[e])||[],o=0,s=n.length;o"u"||t instanceof Date||t instanceof RegExp||t===null}function Yha(t,e){return!(!YEr(t)||!YEr(e))}var zha,Tmi=Se(()=>{p();vmi();zha=20;a(ngt,"merge");a(KEr,"takeValue");a(bmi,"mergeTwoObjects");a(Cmi,"wasObjectReferenced");a(rgt,"isArray");a(Smi,"isFunction");a(b5e,"isObject");a(tgt,"isPrimitive");a(Yha,"shouldMerge")});function Imi(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new JEr("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(function(o){return clearTimeout(r),o},function(o){throw clearTimeout(r),o})}var Kha,JEr,xmi=Se(()=>{p();Kha=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),JEr=(function(t){Kha(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return a(e,"TimeoutError"),e})(Error);a(Imi,"callWithTimeout")});function ZEr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function wmi(t,e){var r,n;if(!e)return!1;try{for(var o=Jha(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(ZEr(t,c))return!0}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}var Jha,Rmi=Se(()=>{p();Jha=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};a(ZEr,"urlMatches");a(wmi,"isUrlIgnored")});function kmi(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var Pmi=Se(()=>{p();a(kmi,"isWrapped")});var Dmi,Nmi=Se(()=>{p();Dmi=(function(){function t(){var e=this;this._promise=new Promise(function(r,n){e._resolve=r,e._reject=n})}return a(t,"Deferred"),Object.defineProperty(t.prototype,"promise",{get:a(function(){return this._promise},"get"),enumerable:!1,configurable:!0}),t.prototype.resolve=function(e){this._resolve(e)},t.prototype.reject=function(e){this._reject(e)},t})()});var Zha,Xha,k0e,Mmi=Se(()=>{p();Nmi();Zha=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Xha=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();go();d5e();a(Omi,"_export")});var Bmi={};Ti(Bmi,{AlwaysOffSampler:()=>C5e,AlwaysOnSampler:()=>R0e,AnchoredClock:()=>Ahi,BindOnceFuture:()=>k0e,CompositePropagator:()=>Jmt,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>_te,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>yte,DEFAULT_ENVIRONMENT:()=>h5e,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>BEr,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>FEr,ExportResultCode:()=>gI,ParentBasedSampler:()=>pmi,RPCType:()=>egt,RandomIdGenerator:()=>Wmt,SDK_INFO:()=>XG,TRACE_PARENT_HEADER:()=>E5e,TRACE_STATE_HEADER:()=>v5e,TimeoutError:()=>JEr,TraceIdRatioBasedSampler:()=>mmi,TraceState:()=>Zmt,TracesSamplerValues:()=>cS,VERSION:()=>zmt,W3CBaggagePropagator:()=>qmt,W3CTraceContextPropagator:()=>Xmt,_globalThis:()=>Hmt,addHrTimes:()=>_5e,baggageUtils:()=>ema,callWithTimeout:()=>Imi,deleteRPCMetadata:()=>umi,getEnv:()=>QR,getEnvWithoutDefaults:()=>S0e,getRPCMetadata:()=>dmi,getTimeOrigin:()=>x0e,globalErrorHandler:()=>Fv,hexToBase64:()=>$mt,hexToBinary:()=>Gmt,hrTime:()=>g5e,hrTimeDuration:()=>Kmt,hrTimeToMicroseconds:()=>A5e,hrTimeToMilliseconds:()=>Zhi,hrTimeToNanoseconds:()=>Jhi,hrTimeToTimeStamp:()=>Khi,internal:()=>XEr,isAttributeKey:()=>NEr,isAttributeValue:()=>p5e,isTimeInput:()=>y5e,isTimeInputHrTime:()=>w0e,isTracingSuppressed:()=>JG,isUrlIgnored:()=>wmi,isWrapped:()=>kmi,loggingErrorHandler:()=>jmt,merge:()=>ngt,millisToHrTime:()=>kD,otperformance:()=>qR,parseEnvironment:()=>m5e,parseTraceParent:()=>$Er,sanitizeAttributes:()=>ZG,setGlobalErrorHandler:()=>bhi,setRPCMetadata:()=>lmi,suppressTracing:()=>C0e,timeInputToHrTime:()=>Yhi,unrefTimer:()=>I0e,unsuppressTracing:()=>uhi,urlMatches:()=>ZEr});var ema,XEr,lS=Se(()=>{p();ghi();yhi();vhi();OEr();MEr();Xhi();QEr();emi();DEr();jEr();tmi();cmi();fmi();WEr();zEr();hmi();gmi();d5e();GEr();UEr();Tmi();LEr();xmi();Rmi();Pmi();Mmi();qEr();Lmi();ema={getKeyPairs:Qmt,serializeKeyPairs:Umt,parseKeyPairsIntoRecord:mhi,parsePairKeyValue:f5e},XEr={_export:Omi}});var tma,rma,nma,igt,ogt,Fmi,Umi=Se(()=>{p();tma="exception.type",rma="exception.message",nma="exception.stacktrace",igt=tma,ogt=rma,Fmi=nma});var Qmi=Se(()=>{p();Umi()});var qmi=Se(()=>{p()});var jmi=Se(()=>{p();qmi()});var Hmi=Se(()=>{p()});var Gmi=Se(()=>{p()});var $mi=Se(()=>{p();Qmi();jmi();Hmi();Gmi()});var Vmi,Wmi=Se(()=>{p();Vmi="exception"});var evr,ima,zmi,oma,sgt,tvr=Se(()=>{p();go();lS();$mi();Wmi();evr=function(){return evr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zmi=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},oma=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this):(On.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var o=ima(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=zmi(s.value,2),l=c[0],u=c[1];this.setAttribute(l,u)}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return this},t.prototype.addEvent=function(e,r,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return On.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&On.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),y5e(r)&&(y5e(n)||(n=r),r=void 0);var o=ZG(r);return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:0}),this},t.prototype.addLink=function(e){return this.links.push(e),this},t.prototype.addLinks=function(e){var r;return(r=this.links).push.apply(r,oma([],zmi(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=evr({},e),this.status.message!=null&&typeof e.message!="string"&&(On.warn("Dropping invalid status.message of type '"+typeof e.message+"', expected 'string'"),delete this.status.message),this)},t.prototype.updateName=function(e){return this._isSpanEnded()?this:(this.name=e,this)},t.prototype.end=function(e){if(this._isSpanEnded()){On.error(this.name+" "+this._spanContext.traceId+"-"+this._spanContext.spanId+" - You can only call end() on a span once.");return}this._ended=!0,this.endTime=this._getTime(e),this._duration=Kmt(this.startTime,this.endTime),this._duration[0]<0&&(On.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&On.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<=qR.now())return g5e(e+this._performanceOffset);if(typeof e=="number")return kD(e);if(e instanceof Date)return kD(e.getTime());if(w0e(e))return e;if(this._startTimeProvided)return kD(Date.now());var r=qR.now()-this._performanceStartTime;return _5e(this.startTime,kD(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[ogt]=e:e&&(e.code?n[igt]=e.code.toString():e.name&&(n[igt]=e.name),e.message&&(n[ogt]=e.message),e.stack&&(n[Fmi]=e.stack)),n[igt]||n[ogt]?this.addEvent(Vmi,n,r):On.warn("Failed to record an exception "+e)},Object.defineProperty(t.prototype,"duration",{get:a(function(){return this._duration},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ended",{get:a(function(){return this._ended},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedAttributesCount",{get:a(function(){return this._droppedAttributesCount},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedEventsCount",{get:a(function(){return this._droppedEventsCount},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedLinksCount",{get:a(function(){return this._droppedLinksCount},"get"),enumerable:!1,configurable:!0}),t.prototype._isSpanEnded=function(){return this._ended&&On.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},t.prototype._truncateToLimitUtil=function(e,r){return e.length<=r?e:e.substring(0,r)},t.prototype._truncateToSize=function(e){var r=this,n=this._attributeValueLengthLimit;return n<=0?(On.warn("Attribute value limit must be positive, got "+n),e):typeof e=="string"?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map(function(o){return typeof o=="string"?r._truncateToLimitUtil(o,n):o}):e},t})()});var PD,S5e=Se(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(PD||(PD={}))});var e$,agt=Se(()=>{p();S5e();e$=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:PD.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var nL,cgt=Se(()=>{p();S5e();nL=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:PD.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var P0e,rvr=Se(()=>{p();go();lS();agt();cgt();P0e=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(Fv(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new nL),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new nL,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new e$,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new nL,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new e$}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=Uu.getSpanContext(e);return!l||!sS(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&Uf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&Uf.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,s,c):this._localParentNotSampled.shouldSample(e,r,n,o,s,c)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t})()});var T5e,nvr=Se(()=>{p();go();S5e();T5e=(function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return a(t,"TraceIdRatioBasedSampler"),t.prototype.shouldSample=function(e,r){return{decision:gte(r)&&this._accumulate(r)=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n>>0}return r},t})()});function lgt(){var t=QR();return{sampler:ivr(t),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:t.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:t.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:t.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:t.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function ivr(t){switch(t===void 0&&(t=QR()),t.OTEL_TRACES_SAMPLER){case cS.AlwaysOn:return new nL;case cS.AlwaysOff:return new e$;case cS.ParentBasedAlwaysOn:return new P0e({root:new nL});case cS.ParentBasedAlwaysOff:return new P0e({root:new e$});case cS.TraceIdRatio:return new T5e(Ymi(t));case cS.ParentBasedTraceIdRatio:return new P0e({root:new T5e(Ymi(t))});default:return On.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+sma+'".'),new nL}}function Ymi(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return On.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+D0e+"."),D0e;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(On.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+D0e+"."),D0e):e<0||e>1?(On.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+D0e+"."),D0e):e}var sma,D0e,ovr=Se(()=>{p();go();lS();agt();cgt();rvr();nvr();sma=cS.AlwaysOn,D0e=1;a(lgt,"loadDefaultConfig");a(ivr,"buildSamplerFromEnv");a(Ymi,"getSamplerProbabilityFromEnv")});function Kmi(t){var e={sampler:ivr()},r=lgt(),n=Object.assign({},r,e,t);return n.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),n}function Jmi(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=S0e();return g.attributeCountLimit=(c=(s=(o=(r=(e=t.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&r!==void 0?r:(n=t.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&o!==void 0?o:A.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:A.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&c!==void 0?c:_te,g.attributeValueLengthLimit=(m=(h=(f=(u=(l=t.spanLimits)===null||l===void 0?void 0:l.attributeValueLengthLimit)!==null&&u!==void 0?u:(d=t.generalLimits)===null||d===void 0?void 0:d.attributeValueLengthLimit)!==null&&f!==void 0?f:A.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&h!==void 0?h:A.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&m!==void 0?m:yte,Object.assign({},t,{spanLimits:g})}var svr=Se(()=>{p();ovr();lS();a(Kmi,"mergeConfig");a(Jmi,"reconfigureLimits")});var Zmi,Xmi=Se(()=>{p();go();lS();Zmi=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=QR();this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new k0e(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(On.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return a(t,"BatchSpanProcessorBase"),t.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Uf.SAMPLED)!==0&&this._addToBuffer(e)},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){var e=this;return Promise.resolve().then(function(){return e.onShutdown()}).then(function(){return e._flushAll()}).then(function(){return e._exporter.shutdown()})},t.prototype._addToBuffer=function(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&On.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(On.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()},t.prototype._flushAll=function(){var e=this;return new Promise(function(r,n){for(var o=[],s=Math.ceil(e._finishedSpans.length/e._maxExportBatchSize),c=0,l=s;c0&&(e._clearTimer(),e._maybeStartTimer())}).catch(function(n){e._isExporting=!1,Fv(n)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),I0e(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var ama,N0e,egi=Se(()=>{p();Xmi();ama=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),N0e=(function(t){ama(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(Zmi)});function tgi(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(ugt[t-1]=1);return ugt.toString("hex",0,t)},"generateId")}var cma,rgi,M0e,ugt,ngi=Se(()=>{p();cma=8,rgi=16,M0e=(function(){function t(){this.generateTraceId=tgi(rgi),this.generateSpanId=tgi(cma)}return a(t,"RandomIdGenerator"),t})(),ugt=Buffer.allocUnsafe(rgi);a(tgi,"getIdGenerator")});var igi=Se(()=>{p();egi();ngi()});var dgt=Se(()=>{p();igi()});var fgt,avr=Se(()=>{p();go();lS();tvr();svr();dgt();fgt=(function(){function t(e,r,n){this._tracerProvider=n;var o=Kmi(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new M0e,this.resource=n.resource,this.instrumentationLibrary=e}return a(t,"Tracer"),t.prototype.startSpan=function(e,r,n){var o,s,c;r===void 0&&(r={}),n===void 0&&(n=X0.active()),r.root&&(n=Uu.deleteSpan(n));var l=Uu.getSpan(n);if(JG(n)){On.debug("Instrumentation suppressed, returning Noop Span");var u=Uu.wrapSpanContext(_0e);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!Uu.isSpanContextValid(d)?h=this._idGenerator.generateTraceId():(h=d.traceId,m=d.traceState,g=d.spanId);var A=(o=r.kind)!==null&&o!==void 0?o:E0e.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:ZG(R.attributes)}}),_=ZG(r.attributes),E=this._sampler.shouldSample(n,h,e,A,_,y);m=(c=E.traceState)!==null&&c!==void 0?c:m;var v=E.decision===aS.RECORD_AND_SAMPLED?Uf.SAMPLED:Uf.NONE,S={traceId:h,spanId:f,traceFlags:v,traceState:m};if(E.decision===aS.NOT_RECORD){On.debug("Recording is off, propagating context in a non-recording span");var u=Uu.wrapSpanContext(S);return u}var T=ZG(Object.assign(_,E.attributes)),w=new sgt(this,n,e,S,A,g,y,r.startTime,void 0,T);return w},t.prototype.startActiveSpan=function(e,r,n,o){var s,c,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,c=n,l=o);var u=c??X0.active(),d=this.startSpan(e,s,u),f=Uu.setSpan(u,d);return X0.with(f,l,void 0,d)}},t.prototype.getGeneralLimits=function(){return this._generalLimits},t.prototype.getSpanLimits=function(){return this._spanLimits},t.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},t})()});var ogi=Se(()=>{p()});var sgi=Se(()=>{p();ogi()});var lma,uma,dma,fma,agi,cvr,lvr,uvr,cgi=Se(()=>{p();lma="service.name",uma="telemetry.sdk.name",dma="telemetry.sdk.language",fma="telemetry.sdk.version",agi=lma,cvr=uma,lvr=dma,uvr=fma});var lgi=Se(()=>{p();cgi()});var ugi=Se(()=>{p()});var dgi=Se(()=>{p()});var fgi=Se(()=>{p();sgi();lgi();ugi();dgi()});function pgt(){return"unknown_service:"+process.argv0}var pgi=Se(()=>{p();a(pgt,"defaultServiceName")});var hgi=Se(()=>{p();pgi()});var mgi=Se(()=>{p();hgi()});var t$,pma,hma,mma,hgt,ggi=Se(()=>{p();go();fgi();lS();mgi();t$=function(){return t$=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},hgt=(function(){function t(e,r){var n=this,o;this._attributes=e,this.asyncAttributesPending=r!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=r?.then(function(s){return n._attributes=Object.assign({},n._attributes,s),n.asyncAttributesPending=!1,s},function(s){return On.debug("a resource's async attributes promise rejected: %s",s),n.asyncAttributesPending=!1,{}})}return a(t,"Resource"),t.empty=function(){return t.EMPTY},t.default=function(){var e;return new t((e={},e[agi]=pgt(),e[lvr]=XG[lvr],e[cvr]=XG[cvr],e[uvr]=XG[uvr],e))},Object.defineProperty(t.prototype,"attributes",{get:a(function(){var e;return this.asyncAttributesPending&&On.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}},"get"),enumerable:!1,configurable:!0}),t.prototype.waitForAsyncAttributes=function(){return pma(this,void 0,void 0,function(){return hma(this,function(e){switch(e.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.merge=function(e){var r=this,n;if(!e)return this;var o=t$(t$({},this._syncAttributes),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new t(o);var s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(function(c){var l,u=mma(c,2),d=u[0],f=u[1];return t$(t$(t$(t$({},r._syncAttributes),d),(l=e._syncAttributes)!==null&&l!==void 0?l:e.attributes),f)});return new t(o,s)},t.EMPTY=new t({}),t})()});var Agi=Se(()=>{p();ggi()});var mgt,dvr,ygi=Se(()=>{p();lS();mgt=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},dvr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=mgt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;n.push(c.forceFlush())}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return new Promise(function(l){Promise.all(n).then(function(){l()}).catch(function(u){Fv(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},t.prototype.onStart=function(e,r){var n,o;try{for(var s=mgt(this._spanProcessors),c=s.next();!c.done;c=s.next()){var l=c.value;l.onStart(e,r)}}catch(u){n={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}},t.prototype.onEnd=function(e){var r,n;try{for(var o=mgt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;c.onEnd(e)}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},t.prototype.shutdown=function(){var e,r,n=[];try{for(var o=mgt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;n.push(c.shutdown())}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return new Promise(function(l,u){Promise.all(n).then(function(){l()},u)})},t})()});var ggt,fvr=Se(()=>{p();ggt=(function(){function t(){}return a(t,"NoopSpanProcessor"),t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){},t.prototype.shutdown=function(){return Promise.resolve()},t.prototype.forceFlush=function(){return Promise.resolve()},t})()});var gma,Ama,y6,_gi,Egi=Se(()=>{p();go();lS();Agi();avr();ovr();ygi();fvr();dgt();svr();gma=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Ama=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n0?o(c):n()}).catch(function(s){return o([s])})})},t.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},t.prototype._getPropagator=function(e){var r;return(r=this.constructor._registeredPropagators.get(e))===null||r===void 0?void 0:r()},t.prototype._getSpanExporter=function(e){var r;return(r=this.constructor._registeredExporters.get(e))===null||r===void 0?void 0:r()},t.prototype._buildPropagatorFromEnv=function(){var e=this,r=Array.from(new Set(QR().OTEL_PROPAGATORS)),n=r.map(function(s){var c=e._getPropagator(s);return c||On.warn('Propagator "'+s+'" requested through environment variable is unavailable.'),c}),o=n.reduce(function(s,c){return c&&s.push(c),s},[]);if(o.length!==0)return r.length===1?o[0]:new Jmt({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=QR().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||On.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new Xmt}],["baggage",function(){return new qmt}]]),t._registeredExporters=new Map,t})()});var yma,vgi,Cgi=Se(()=>{p();lS();yma=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vgi=(function(){function t(){}return a(t,"ConsoleSpanExporter"),t.prototype.export=function(e,r){return this._sendSpans(e,r)},t.prototype.shutdown=function(){return this._sendSpans([]),this.forceFlush()},t.prototype.forceFlush=function(){return Promise.resolve()},t.prototype._exportInfo=function(e){var r;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(r=e.spanContext().traceState)===null||r===void 0?void 0:r.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:A5e(e.startTime),duration:A5e(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}},t.prototype._sendSpans=function(e,r){var n,o;try{for(var s=yma(e),c=s.next();!c.done;c=s.next()){var l=c.value;console.dir(this._exportInfo(l),{depth:3})}}catch(u){n={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}if(r)return r({code:gI.SUCCESS})},t})()});var _ma,Ema,bgi,Sgi=Se(()=>{p();lS();_ma=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Ema=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();go();lS();vma=function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Cma=function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]e$,AlwaysOnSampler:()=>nL,BasicTracerProvider:()=>_gi,BatchSpanProcessor:()=>N0e,ConsoleSpanExporter:()=>vgi,ForceFlushState:()=>y6,InMemorySpanExporter:()=>bgi,NoopSpanProcessor:()=>ggt,ParentBasedSampler:()=>P0e,RandomIdGenerator:()=>M0e,SamplingDecision:()=>PD,SimpleSpanProcessor:()=>Tgi,Span:()=>sgt,TraceIdRatioBasedSampler:()=>T5e,Tracer:()=>fgt});var wgi=Se(()=>{p();avr();Egi();dgt();Cgi();Sgi();Igi();fvr();agt();cgt();rvr();nvr();S5e();tvr()});var I5e,Rgi,pvr=Se(()=>{p();I5e=class{static{a(this,"NoopLogger")}emit(e){}},Rgi=new I5e});var hvr,Agt,mvr=Se(()=>{p();pvr();hvr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new I5e}},Agt=new hvr});var ygt,kgi=Se(()=>{p();pvr();ygt=class{static{a(this,"ProxyLogger")}constructor(e,r,n,o){this._provider=e,this.name=r,this.version=n,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Rgi}}});var x5e,Pgi=Se(()=>{p();mvr();kgi();x5e=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new ygt(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Agt}setDelegate(e){this._delegate=e}getDelegateLogger(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,r,n)}}});var _gt,Dgi=Se(()=>{p();_gt=typeof globalThis=="object"?globalThis:global});var Ngi=Se(()=>{p();Dgi()});var Mgi=Se(()=>{p();Ngi()});function Ogi(t,e,r){return n=>n===t?e:r}var w5e,O0e,gvr,Lgi=Se(()=>{p();Mgi();w5e=Symbol.for("io.opentelemetry.js.api.logs"),O0e=_gt;a(Ogi,"makeGetter");gvr=1});var Egt,Bgi=Se(()=>{p();Lgi();mvr();Pgi();Egt=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new x5e}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return O0e[w5e]?this.getLoggerProvider():(O0e[w5e]=Ogi(gvr,e,Agt),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=O0e[w5e])===null||e===void 0?void 0:e.call(O0e,gvr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete O0e[w5e],this._proxyLoggerProvider=new x5e}}});var vgt,Avr=Se(()=>{p();Bgi();vgt=Egt.getInstance()});function Fgi(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var Qgi=Se(()=>{p();a(Fgi,"enableInstrumentations");a(Ugi,"disableInstrumentations")});function qgi(t){let e=t.tracerProvider||Uu.getTracerProvider(),r=t.meterProvider||Ate.getMeterProvider(),n=t.loggerProvider||vgt.getLoggerProvider(),o=t.instrumentations?.flat()??[];return Fgi(o,e,r,n),()=>{Ugi(o)}}var jgi=Se(()=>{p();go();Avr();Qgi();a(qgi,"registerInstrumentations")});function zgi(t,e,r){if(!Tma(t))return On.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=Rma(t);if(!n)return!1;let o=[],s=Ygi(n,e,o,r);return s&&!r?.includePrerelease?xma(n,o):s}function Tma(t){return typeof t=="string"&&Wgi.test(t)}function Ygi(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(yvr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=Kma(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!yvr(t,s,r,n))return!1;return!0}return yvr(t,e,r,n)}function yvr(t,e,r,n){if(e=wma(e,n),e.includes(" "))return Ygi(t,e,r,n);{let o=kma(e);return r.push(o),Ima(t,o)}}function Ima(t,e){if(e.invalid)return!1;if(!e.version||Evr(e.version))return!0;let r=Ggi(t.versionSegments||[],e.versionSegments||[]);if(r===0){let n=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!n.length&&!o.length?r=0:!n.length&&o.length?r=1:n.length&&!o.length?r=-1:r=Ggi(n,o)}return Sma[e.op]?.includes(r)}function xma(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function wma(t,e){return t=t.trim(),t=zma(t,e),t=Wma(t),t=Yma(t,e),t=t.trim(),t}function Uv(t){return!t||t.toLowerCase()==="x"||t==="*"}function Rma(t){let e=t.match(Wgi);if(!e){On.error(`Invalid version: ${t}`);return}let r=e.groups.version,n=e.groups.prerelease,o=e.groups.build,s=r.split("."),c=n?.split(".");return{op:void 0,version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:n,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:o}}function kma(t){if(!t)return{};let e=t.match(bma);if(!e)return On.error(`Invalid range: ${t}`),{invalid:!0};let r=e.groups.op,n=e.groups.version,o=e.groups.prerelease,s=e.groups.build,c=n.split("."),l=o?.split(".");return r==="=="&&(r="="),{op:r||"=",version:n,versionSegments:c,versionSegmentCount:c.length,prerelease:o,prereleaseSegments:l,prereleaseSegmentCount:l?l.length:0,build:s}}function Evr(t){return t==="*"||t==="x"||t==="X"}function Hgi(t){let e=parseInt(t,10);return isNaN(e)?t:e}function Pma(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function Dma(t,e){if(Evr(t)||Evr(e))return 0;let[r,n]=Pma(Hgi(t),Hgi(e));return r>n?1:r{let l;return Uv(n)?l="":Uv(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:Uv(s)?l=`>=${n}.${o}.0 <${n}.${+o+1}.0-0`:c?l=`>=${n}.${o}.${s}-${c} <${n}.${+o+1}.0-0`:l=`>=${n}.${o}.${s} <${n}.${+o+1}.0-0`,l})}function zma(t,e){let r=Vma,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return Uv(s)?d="":Uv(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Uv(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?s==="0"?c==="0"?d=`>=${s}.${c}.${l}-${u} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l}-${u} <${+s+1}.0.0-0`:s==="0"?c==="0"?d=`>=${s}.${c}.${l}${n} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`,d})}function Yma(t,e){let r=Fma;return t.replace(r,(n,o,s,c,l,u)=>{let d=Uv(s),f=d||Uv(c),h=f||Uv(l),m=h;return o==="="&&m&&(o=""),u=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),o==="<"&&(u="-0"),n=`${o+s}.${c}.${l}${u}`):f?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${c}.0${u} <${s}.${+c+1}.0-0`),n})}function Kma(t,e){let r=Qma;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(Uv(s)?o="":Uv(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:Uv(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,Uv(h)?f="":Uv(m)?f=`<${+h+1}.0.0-0`:Uv(g)?f=`<${h}.${+m+1}.0-0`:A?f=`<=${h}.${m}.${g}-${A}`:e?.includePrerelease?f=`<${h}.${m}.${+g+1}-0`:f=`<=${f}`,`${o} ${f}`.trim()))}var Wgi,bma,Sma,Kgi,Jgi,Nma,Mma,$gi,Oma,Vgi,Lma,_vr,R5e,Bma,Fma,Uma,Qma,qma,jma,Hma,Gma,$ma,Vma,Zgi=Se(()=>{p();go();Wgi=/^(?:v)?(?(?0|[1-9]\d*)\.(?0|[1-9]\d*)\.(?0|[1-9]\d*))(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,bma=/^(?<|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?(?x|X|\*|0|[1-9]\d*)(?:\.(?x|X|\*|0|[1-9]\d*))?(?:\.(?x|X|\*|0|[1-9]\d*))?)(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Sma={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(zgi,"satisfies");a(Tma,"_validateVersion");a(Ygi,"_doSatisfies");a(yvr,"_checkRange");a(Ima,"_satisfies");a(xma,"_doPreleaseCheck");a(wma,"_normalizeRange");a(Uv,"isX");a(Rma,"_parseVersion");a(kma,"_parseRange");a(Evr,"_isWildcard");a(Hgi,"_parseVersionString");a(Pma,"_normalizeVersionType");a(Dma,"_compareVersionStrings");a(Ggi,"_compareVersionSegments");Kgi="[a-zA-Z0-9-]",Jgi="0|[1-9]\\d*",Nma=`\\d*[a-zA-Z-]${Kgi}*`,Mma="((?:<|>)?=?)",$gi=`(?:${Jgi}|${Nma})`,Oma=`(?:-(${$gi}(?:\\.${$gi})*))`,Vgi=`${Kgi}+`,Lma=`(?:\\+(${Vgi}(?:\\.${Vgi})*))`,_vr=`${Jgi}|x|X|\\*`,R5e=`[v=\\s]*(${_vr})(?:\\.(${_vr})(?:\\.(${_vr})(?:${Oma})?${Lma}?)?)?`,Bma=`^${Mma}\\s*${R5e}$`,Fma=new RegExp(Bma),Uma=`^\\s*(${R5e})\\s+-\\s+(${R5e})\\s*$`,Qma=new RegExp(Uma),qma="(?:~>?)",jma=`^${qma}${R5e}$`,Hma=new RegExp(jma),Gma="(?:\\^)",$ma=`^${Gma}${R5e}$`,Vma=new RegExp($ma);a(Wma,"replaceTilde");a(zma,"replaceCaret");a(Yma,"replaceXRange");a(Kma,"replaceHyphen")});var L0e=I((H_p,t0i)=>{"use strict";p();function vvr(t){return typeof t=="function"}a(vvr,"isFunction");var Qv=console.error.bind(console);function k5e(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(k5e,"defineProperty");function P5e(t){t&&t.logger&&(vvr(t.logger)?Qv=t.logger:Qv("new logger isn't a function, not replacing"))}a(P5e,"shimmer");function Xgi(t,e,r){if(!t||!t[e]){Qv("no original function "+e+" to wrap");return}if(!r){Qv("no wrapper function"),Qv(new Error().stack);return}if(!vvr(t[e])||!vvr(r)){Qv("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return k5e(o,"__original",n),k5e(o,"__unwrap",function(){t[e]===o&&k5e(t,e,n)}),k5e(o,"__wrapped",!0),k5e(t,e,o),o}a(Xgi,"wrap");function Jma(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{Qv("must provide one or more modules to patch"),Qv(new Error().stack);return}if(!(e&&Array.isArray(e))){Qv("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){Xgi(n,o,r)})})}a(Jma,"massWrap");function e0i(t,e){if(!t||!t[e]){Qv("no function to unwrap."),Qv(new Error().stack);return}if(!t[e].__unwrap)Qv("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(e0i,"unwrap");function Zma(t,e){if(t)Array.isArray(t)||(t=[t]);else{Qv("must provide one or more modules to patch"),Qv(new Error().stack);return}if(!(e&&Array.isArray(e))){Qv("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){e0i(r,n)})})}a(Zma,"massUnwrap");P5e.wrap=Xgi;P5e.massWrap=Jma;P5e.unwrap=e0i;P5e.massUnwrap=Zma;t0i.exports=P5e});var r$,Cgt,r0i=Se(()=>{p();go();Avr();r$=fe(L0e()),Cgt=class{static{a(this,"InstrumentationAbstract")}instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(n),this._diag=On.createComponentLogger({namespace:e}),this._tracer=Uu.getTracer(e,r),this._meter=Ate.getMeter(e,r),this._logger=vgt.getLogger(e,r),this._updateMetricInstruments()}_wrap=r$.wrap;_unwrap=r$.unwrap;_massWrap=r$.massWrap;_massUnwrap=r$.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,r,n,o){if(e)try{e(n,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},s)}}}});var i0i=I((J_p,n0i)=>{p();var B0e=1e3,F0e=B0e*60,U0e=F0e*60,vte=U0e*24,Xma=vte*7,ega=vte*365.25;n0i.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return tga(t);if(r==="number"&&isFinite(t))return e.long?nga(t):rga(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function tga(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*ega;case"weeks":case"week":case"w":return r*Xma;case"days":case"day":case"d":return r*vte;case"hours":case"hour":case"hrs":case"hr":case"h":return r*U0e;case"minutes":case"minute":case"mins":case"min":case"m":return r*F0e;case"seconds":case"second":case"secs":case"sec":case"s":return r*B0e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(tga,"parse");function rga(t){var e=Math.abs(t);return e>=vte?Math.round(t/vte)+"d":e>=U0e?Math.round(t/U0e)+"h":e>=F0e?Math.round(t/F0e)+"m":e>=B0e?Math.round(t/B0e)+"s":t+"ms"}a(rga,"fmtShort");function nga(t){var e=Math.abs(t);return e>=vte?bgt(t,e,vte,"day"):e>=U0e?bgt(t,e,U0e,"hour"):e>=F0e?bgt(t,e,F0e,"minute"):e>=B0e?bgt(t,e,B0e,"second"):t+" ms"}a(nga,"fmtLong");function bgt(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(bgt,"plural")});var Cvr=I((eEp,o0i)=>{p();function iga(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=i0i(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let k=r.formatters[x];if(typeof k=="function"){let D=_[T];R=k.call(E,D),_.splice(T,1),T--}return R}),r.formatArgs.call(E,_),(E.log||r.log).apply(E,_)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(_=>{m=_},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}a(o,"enable");function s(f,h){let m=0,g=0,A=-1,y=0;for(;m"-"+h)].join(",");return r.enable(""),f}a(c,"disable");function l(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}a(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}a(u,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(d,"destroy"),r.enable(r.load()),r}a(iga,"setup");o0i.exports=iga});var s0i=I((uS,Sgt)=>{p();uS.formatArgs=sga;uS.save=aga;uS.load=cga;uS.useColors=oga;uS.storage=lga();uS.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();uS.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function oga(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(oga,"useColors");function sga(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Sgt.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(sga,"formatArgs");uS.log=console.debug||console.log||(()=>{});function aga(t){try{t?uS.storage.setItem("debug",t):uS.storage.removeItem("debug")}catch{}}a(aga,"save");function cga(){let t;try{t=uS.storage.getItem("debug")||uS.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(cga,"load");function lga(){try{return localStorage}catch{}}a(lga,"localstorage");Sgt.exports=Cvr()(uS);var{formatters:uga}=Sgt.exports;uga.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var c0i=I((eA,Igt)=>{p();var dga=require("tty"),Tgt=require("util");eA.init=yga;eA.log=mga;eA.formatArgs=pga;eA.save=gga;eA.load=Aga;eA.useColors=fga;eA.destroy=Tgt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");eA.colors=[6,2,3,4,5,1];try{let t=RVe();t&&(t.stderr||t).level>=2&&(eA.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}eA.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function fga(){return"colors"in eA.inspectOpts?!!eA.inspectOpts.colors:dga.isatty(process.stderr.fd)}a(fga,"useColors");function pga(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` +`)}setDiagnosticsData(e){this._fileDiagnostics=e}setTerminalData(e){this._terminalOutput=e}setLanguageContext(e){this._languageContext=e}toJSON(){return{requestId:this.requestId,time:this.time,filePath:this.filePath,version:this.version,statelessNextEditProviderId:this._statelessNextEditProviderId,nextEditRequest:this._nextEditRequest?.serialize(),diagnosticsResultEdit:this._diagnosticsResultEdit?.toString(),resultEdit:this._resultEdit?.toString(),isCachedResult:!!this._logContextOfCachedEdit,prompt:this.prompt,error:String(this.error),response:this.fullResponse,responseResults:qfi.stringify(this._responseResults,null," "),providerStartTime:this.providerStartTime,providerEndTime:this.providerEndTime,fetchStartTime:this.fetchStartTime,fetchEndTime:this.fetchEndTime,logs:this._logs,isAccepted:this._isAccepted,languageContext:this._languageContext?(0,lfa.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};X4.InlineEditRequestLogContext=K_r;function dfa(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(dfa,"basename")});var jfi=I(vmt=>{"use strict";p();Object.defineProperty(vmt,"__esModule",{value:!0});vmt.GhostTextLogContext=void 0;var ffa=Emt(),pfa=$A(),J_r=class extends ffa.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,pfa.basename)(this.filePath)} (v${this.version})`}};vmt.GhostTextLogContext=J_r});var YG=I(g0e=>{"use strict";p();Object.defineProperty(g0e,"__esModule",{value:!0});g0e.CopilotTokenStore=g0e.ICopilotTokenStore=void 0;var hfa=an(),mfa=Fc(),gfa=Po();g0e.ICopilotTokenStore=(0,hfa.createServiceIdentifier)("ICopilotTokenStore");var Z_r=class extends gfa.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new mfa.Emitter),this.onDidStoreUpdate=this._onDidStoreUpdate.event}get copilotToken(){return this._copilotToken}set copilotToken(e){let r=this._copilotToken?.token;this._copilotToken=e,r!==e?.token&&this._onDidStoreUpdate.fire()}};g0e.CopilotTokenStore=Z_r});var bh=I(vy=>{"use strict";p();var Afa=vy&&vy.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},yfa=vy&&vy.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vy,"__esModule",{value:!0});vy.TelemetryTrustedValue=vy.ITelemetryService=vy.TelemetryUserConfigImpl=vy.ITelemetryUserConfig=void 0;vy.createTrackingIdGetter=Efa;vy.multiplexProperties=Cfa;var Hfi=an(),_fa=YG();vy.ITelemetryUserConfig=(0,Hfi.createServiceIdentifier)("ITelemetryUserConfig");var X_r=class{static{a(this,"TelemetryUserConfigImpl")}constructor(e,r,n){this._tokenStore=n,this.trackingId=e,this.optedIn=r??!1,this.updateFromToken(this._tokenStore.copilotToken),this._tokenStore.onDidStoreUpdate(()=>{this.updateFromToken(this._tokenStore.copilotToken)})}updateFromToken(e){if(!e)return;let r=e.getTokenValue("rt")==="1",n=e.getTokenValue("tid");n!==void 0&&(this.trackingId=n,this.organizationsList=e.organizationList.toString(),this.enterpriseList=e.enterpriseList.toString(),this.optedIn=r)}};vy.TelemetryUserConfigImpl=X_r;vy.TelemetryUserConfigImpl=X_r=Afa([yfa(2,_fa.ICopilotTokenStore)],X_r);function Efa(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(Efa,"createTrackingIdGetter");vy.ITelemetryService=(0,Hfi.createServiceIdentifier)("ITelemetryService");var eEr=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};vy.TelemetryTrustedValue=eEr;var t5e=8192,vfa=50;function Cfa(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>t5e){let s=0,c=0;for(;o>0&&c1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+t5e;o{"use strict";p();var bfa=Vo&&Vo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Sfa=Vo&&Vo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Tfa=Vo&&Vo.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&bfa(e,t,r);return Sfa(e,t),e},tEr=Vo&&Vo.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},rEr=Vo&&Vo.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var oEr=pte&&pte.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},sEr=pte&&pte.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]this.maxSizeBytes?[4,this._createBackupFile(r)]:[3,14];case 13:return u.sent(),[3,16];case 14:return[4,eL.appendFileAsync(this._fileFullPath,r)];case 15:u.sent(),u.label=16;case 16:return[3,18];case 17:return l=u.sent(),console.log(this.TAG,"Failed to create backup file: "+(l&&l.message)),[3,18];case 18:return[2]}})})},t.prototype._createBackupFile=function(e){return oEr(this,void 0,void 0,function(){var r,n,o;return sEr(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,eL.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=fte.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,eL.writeFileAsync(n,r)];case 2:return s.sent(),[3,5];case 3:return o=s.sent(),console.log("Failed to generate backup log file",o),[3,5];case 4:return eL.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return oEr(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return sEr(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,eL.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return fte.basename(u).indexOf(c._backUpNameFormat)>-1}),e.sort(function(u,d){var f=new Date(parseInt(u.split(c._backUpNameFormat)[0])),h=new Date(parseInt(d.split(c._backUpNameFormat)[0]));if(f=h)return 1}),r=e.length,n=0,l.label=2;case 2:return n{"use strict";p();var zfi=Wfi(),Nfa="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",Mfa="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",Ofa=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{Lfa.exports={}});var bmt=I(A0e=>{"use strict";p();var Bfa=A0e&&A0e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(A0e,"__esModule",{value:!0});A0e.JsonConfig=void 0;var Ffa=require("fs"),Cmt=require("path"),aEr=lu(),Ufa=Bfa(Kfi()),Qfa="APPLICATIONINSIGHTS_CONFIGURATION_FILE",qfa="APPLICATIONINSIGHTS_CONNECTION_STRING",Jfi="APPSETTING_",Zfi="APPINSIGHTS_INSTRUMENTATIONKEY",Xfi="APPINSIGHTS_INSTRUMENTATION_KEY",jfa="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",Hfa="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",Gfa="http_proxy",$fa="https_proxy",Vfa="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",Wfa="APPLICATION_INSIGHTS_NO_STATSBEAT",zfa="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",Yfa="APPLICATION_INSIGHTS_NO_PATCH_MODULES",Kfa="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",Jfa="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",Zfa="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",Xfa="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",epa="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",tpa=(function(){function t(){this.connectionString=process.env[qfa],this.instrumentationKey=process.env[Zfi]||process.env[Jfi+Zfi]||process.env[Xfi]||process.env[Jfi+Xfi],!this.connectionString&&this.instrumentationKey&&aEr.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[Hfa],this.extendedMetricDisablers=process.env[jfa],this.proxyHttpUrl=process.env[Gfa],this.proxyHttpsUrl=process.env[$fa],this.noDiagnosticChannel=!!process.env[Vfa],this.disableStatsbeat=!!process.env[Wfa],this.noHttpAgentKeepAlive=!!process.env[zfa],this.noPatchModules=process.env[Yfa]||"",this.enableWebInstrumentation=!!process.env[Kfa]||!!process.env[Xfa],this.webInstrumentationSrc=process.env[Zfa]||"",this.webInstrumentationConnectionString=process.env[Jfa]||process.env[epa]||"",this.enableAutoWebSnippetInjection=this.enableWebInstrumentation,this.webSnippetConnectionString=this.webInstrumentationConnectionString,this._loadJsonFile()}return a(t,"JsonConfig"),t.getInstance=function(){return t._instance||(t._instance=new t),t._instance},t.prototype._loadJsonFile=function(){var e="",r=process.env.APPLICATIONINSIGHTS_CONFIGURATION_CONTENT;if(r)e=r;else{var n="applicationinsights.json",o=Cmt.join(__dirname,"../../");this._tempDir=Cmt.join(o,n);var s=process.env[Qfa];if(s){Cmt.isAbsolute(s)?this._tempDir=s:this._tempDir=Cmt.join(o,s);try{e=Ffa.readFileSync(this._tempDir,"utf8")}catch(l){aEr.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(Ufa.default)}try{var c=JSON.parse(e);c.disableStatsbeat!=null&&(this.disableStatsbeat=c.disableStatsbeat),c.disableAllExtendedMetrics!=null&&(this.disableAllExtendedMetrics=c.disableStatsbeat),c.noDiagnosticChannel!=null&&(this.noDiagnosticChannel=c.noDiagnosticChannel),c.noHttpAgentKeepAlive!=null&&(this.noHttpAgentKeepAlive=c.noHttpAgentKeepAlive),c.connectionString!=null&&(this.connectionString=c.connectionString),c.extendedMetricDisablers!=null&&(this.extendedMetricDisablers=c.extendedMetricDisablers),c.noDiagnosticChannel!=null&&(this.noDiagnosticChannel=c.noDiagnosticChannel),c.proxyHttpUrl!=null&&(this.proxyHttpUrl=c.proxyHttpUrl),c.proxyHttpsUrl!=null&&(this.proxyHttpsUrl=c.proxyHttpsUrl),c.proxyHttpsUrl!=null&&(this.proxyHttpsUrl=c.proxyHttpsUrl),c.noPatchModules!=null&&(this.noPatchModules=c.noPatchModules),c.enableAutoWebSnippetInjection!=null&&(this.enableWebInstrumentation=c.enableAutoWebSnippetInjection,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation),c.enableWebInstrumentation!=null&&(this.enableWebInstrumentation=c.enableWebInstrumentation,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation),c.webSnippetConnectionString!=null&&(this.webInstrumentationConnectionString=c.webSnippetConnectionString,this.webSnippetConnectionString=this.webInstrumentationConnectionString),c.webInstrumentationConnectionString!=null&&(this.webInstrumentationConnectionString=c.webInstrumentationConnectionString,this.webSnippetConnectionString=this.webInstrumentationConnectionString),c.webInstrumentationConfig!=null&&(this.webInstrumentationConfig=c.webInstrumentationConfig),c.webInstrumentationSrc!=null&&(this.webInstrumentationSrc=c.webInstrumentationSrc),c.enableLoggerErrorToTrace!=null&&(this.enableLoggerErrorToTrace=c.enableLoggerErrorToTrace),this.endpointUrl=c.endpointUrl,this.maxBatchSize=c.maxBatchSize,this.maxBatchIntervalMs=c.maxBatchIntervalMs,this.disableAppInsights=c.disableAppInsights,this.samplingPercentage=c.samplingPercentage,this.correlationIdRetryIntervalMs=c.correlationIdRetryIntervalMs,this.correlationHeaderExcludedDomains=c.correlationHeaderExcludedDomains,this.ignoreLegacyHeaders=c.ignoreLegacyHeaders,this.distributedTracingMode=c.distributedTracingMode,this.enableAutoCollectExternalLoggers=c.enableAutoCollectExternalLoggers,this.enableAutoCollectConsole=c.enableAutoCollectConsole,this.enableLoggerErrorToTrace=c.enableLoggerErrorToTrace,this.enableAutoCollectExceptions=c.enableAutoCollectExceptions,this.enableAutoCollectPerformance=c.enableAutoCollectPerformance,this.enableAutoCollectExtendedMetrics=c.enableAutoCollectExtendedMetrics,this.enableAutoCollectPreAggregatedMetrics=c.enableAutoCollectPreAggregatedMetrics,this.enableAutoCollectHeartbeat=c.enableAutoCollectHeartbeat,this.enableAutoCollectRequests=c.enableAutoCollectRequests,this.enableAutoCollectDependencies=c.enableAutoCollectDependencies,this.enableAutoDependencyCorrelation=c.enableAutoDependencyCorrelation,this.enableAutoCollectIncomingRequestAzureFunctions=c.enableAutoCollectIncomingRequestAzureFunctions,this.enableUseAsyncHooks=c.enableUseAsyncHooks,this.enableUseDiskRetryCaching=c.enableUseDiskRetryCaching,this.enableResendInterval=c.enableResendInterval,this.enableMaxBytesOnDisk=c.enableMaxBytesOnDisk,this.enableInternalDebugLogging=c.enableInternalDebugLogging,this.enableInternalWarningLogging=c.enableInternalWarningLogging,this.enableSendLiveMetrics=c.enableSendLiveMetrics,this.quickPulseHost=c.quickPulseHost}catch(l){aEr.warn("Invalid JSON config file: ",l)}},t})();A0e.JsonConfig=tpa});var cEr=I(Smt=>{"use strict";p();Object.defineProperty(Smt,"__esModule",{value:!0});Smt.makePatchingRequire=void 0;var rpa=require("path"),npa=WP(),epi=Pp(),rpi=require("module"),ipa=Object.keys(process.binding("natives")),tpi=rpi.prototype.require;function opa(t){var e={};return a(function(n){var o=tpi.apply(this,arguments);if(t[n]){var s=rpi._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(ipa.indexOf(n)<0)try{c=tpi.call(this,rpa.join(n,"package.json")).version}catch{return o}else c=process.version.substring(1);var l=c.indexOf("-");l>=0&&(c=c.substring(0,l));for(var u=o,d=0,f=t[n];d{spa.exports={name:"diagnostic-channel",version:"1.1.1",main:"./dist/src/channel.js",types:"./dist/src/channel.d.ts",scripts:{build:"tsc",lint:"eslint ./ --fix",clean:"rimraf ./dist",test:"mocha ./dist/tests/**/*.js",debug:"mocha --inspect-brk ./dist/tests/**/*.js"},homepage:"https://github.com/Microsoft/node-diagnostic-channel",bugs:{url:"https://github.com/Microsoft/node-diagnostic-channel/issues"},repository:{type:"git",url:"https://github.com/Microsoft/node-diagnostic-channel.git"},description:"Provides a context-saving pub/sub channel to connect diagnostic event publishers and subscribers",dependencies:{semver:"^7.5.3"},devDependencies:{"@types/mocha":"^2.2.40","@types/node":"~8.0.0",mocha:"^3.2.0",rimraf:"^2.6.1",sinon:"1.17.6",typescript:"4.1.2"},files:["dist/src/**/*.d.ts","dist/src/**/*.js","LICENSE","README.md","package.json"],license:"MIT"}});var Pp=I(UR=>{"use strict";p();Object.defineProperty(UR,"__esModule",{value:!0});UR.channel=UR.ContextPreservingEventEmitter=UR.trueFilter=UR.makePatchingRequire=void 0;var apa=cEr(),cpa=cEr();Object.defineProperty(UR,"makePatchingRequire",{enumerable:!0,get:a(function(){return cpa.makePatchingRequire},"get")});var lpa=a(function(t){return!0},"trueFilter");UR.trueFilter=lpa;var opi=(function(){function t(){this.version=npi().version,this.subscribers={},this.contextPreservationFunction=function(e){return e},this.knownPatches={},this.modulesPatched=[],this.currentlyPublishing=!1}return a(t,"ContextPreservingEventEmitter"),t.prototype.shouldPublish=function(e){var r=this.subscribers[e];return r?r.some(function(n){var o=n.filter;return!o||o(!1)}):!1},t.prototype.publish=function(e,r){if(!this.currentlyPublishing){var n=this.subscribers[e];if(n){var o={timestamp:Date.now(),data:r};this.currentlyPublishing=!0,n.forEach(function(s){var c=s.listener,l=s.filter;try{l&&l(!0)&&c(o)}catch{}}),this.currentlyPublishing=!1}}},t.prototype.subscribe=function(e,r,n,o){n===void 0&&(n=UR.trueFilter),this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push({listener:r,filter:n,patchCallback:o});var s=this.checkIfModuleIsAlreadyPatched(e);s&&o&&o(s.name,s.version)},t.prototype.unsubscribe=function(e,r,n){n===void 0&&(n=UR.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();spi=typeof globalThis=="object"?globalThis:global});var cpi=Se(()=>{p();api()});var lpi=Se(()=>{p();cpi()});var g6,lEr=Se(()=>{p();g6="1.9.0"});function upa(t){var e=new Set([t]),r=new Set,n=t.match(upi);if(!n)return function(){return!1};var o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(o.prerelease!=null)return a(function(u){return u===t},"isExactmatch");function s(l){return r.add(l),!1}a(s,"_reject");function c(l){return e.add(l),!0}return a(c,"_accept"),a(function(u){if(e.has(u))return!0;if(r.has(u))return!1;var d=u.match(upi);if(!d)return s(u);var f={major:+d[1],minor:+d[2],patch:+d[3],prerelease:d[4]};return f.prerelease!=null||o.major!==f.major?s(u):o.major===0?o.minor===f.minor&&o.patch<=f.patch?c(u):s(u):o.minor<=f.minor?c(u):s(u)},"isCompatible")}var upi,dpi,fpi=Se(()=>{p();lEr();upi=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(upa,"_makeCompatibilityCheck");dpi=upa(g6)});function tL(t,e,r,n){var o;n===void 0&&(n=!1);var s=n5e[r5e]=(o=n5e[r5e])!==null&&o!==void 0?o:{version:g6};if(!n&&s[t]){var c=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(c.stack||c.message),!1}if(s.version!==g6){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+g6);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+g6+"."),!0}function hI(t){var e,r,n=(e=n5e[r5e])===null||e===void 0?void 0:e.version;if(!(!n||!dpi(n)))return(r=n5e[r5e])===null||r===void 0?void 0:r[t]}function rL(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+g6+".");var r=n5e[r5e];r&&delete r[t]}var dpa,r5e,n5e,hte=Se(()=>{p();lpi();lEr();fpi();dpa=g6.split(".")[0],r5e=Symbol.for("opentelemetry.js.api."+dpa),n5e=spi;a(tL,"registerGlobal");a(hI,"getGlobal");a(rL,"unregisterGlobal")});function i5e(t,e,r){var n=hI("diag");if(n)return r.unshift(e),n[t].apply(n,ppa([],fpa(r),!1))}var fpa,ppa,ppi,hpi=Se(()=>{p();hte();fpa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},ppa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(Ua||(Ua={}))});function mpi(t,e){tUa.ALL&&(t=Ua.ALL),e=e||{};function r(n,o){var s=e[n];return typeof s=="function"&&t>=o?s.bind(e):function(){}}return a(r,"_filterFunc"),{error:r("error",Ua.ERROR),warn:r("warn",Ua.WARN),info:r("info",Ua.INFO),debug:r("debug",Ua.DEBUG),verbose:r("verbose",Ua.VERBOSE)}}var gpi=Se(()=>{p();Tmt();a(mpi,"createLogLevelDiagLogger")});var hpa,mpa,gpa,Y_,mte=Se(()=>{p();hpi();gpi();Tmt();hte();hpa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},mpa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n";f.warn("Current logger will be overwritten from "+m),h.warn("Current logger will overwrite one already registered from "+m)}return tL("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){rL(gpa,r)},r.createComponentLogger=function(o){return new ppi(o)},r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}return a(t,"DiagAPI"),t.instance=function(){return this._instance||(this._instance=new t),this._instance},t})()});var Apa,ypa,Api,ypi=Se(()=>{p();Apa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},ypa=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Api=(function(){function t(e){this._entries=e?new Map(e):new Map}return a(t,"BaggageImpl"),t.prototype.getEntry=function(e){var r=this._entries.get(e);if(r)return Object.assign({},r)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var r=Apa(e,2),n=r[0],o=r[1];return[n,o]})},t.prototype.setEntry=function(e,r){var n=new t(this._entries);return n._entries.set(e,r),n},t.prototype.removeEntry=function(e){var r=new t(this._entries);return r._entries.delete(e),r},t.prototype.removeEntries=function(){for(var e,r,n=[],o=0;o{p();_pi=Symbol("BaggageEntryMetadata")});function vpi(t){return t===void 0&&(t={}),new Api(new Map(Object.entries(t)))}function y0e(t){return typeof t!="string"&&(_pa.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:_pi,toString:a(function(){return t},"toString")}}var _pa,uEr=Se(()=>{p();mte();ypi();Epi();_pa=Y_.instance();a(vpi,"createBaggage");a(y0e,"baggageEntryMetadataFromString")});function oS(t){return Symbol.for(t)}var Epa,Imt,o5e=Se(()=>{p();a(oS,"createContextKey");Epa=(function(){function t(e){var r=this;r._currentContext=e?new Map(e):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,o){var s=new t(r._currentContext);return s._currentContext.set(n,o),s},r.deleteValue=function(n){var o=new t(r._currentContext);return o._currentContext.delete(n),o}}return a(t,"BaseContext"),t})(),Imt=new Epa});var dEr,Cpi,bpi=Se(()=>{p();dEr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],Cpi=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();gte=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),vpa=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return kpa},t.prototype.createHistogram=function(e,r){return Ppa},t.prototype.createCounter=function(e,r){return Rpa},t.prototype.createUpDownCounter=function(e,r){return Dpa},t.prototype.createObservableGauge=function(e,r){return Mpa},t.prototype.createObservableCounter=function(e,r){return Npa},t.prototype.createObservableUpDownCounter=function(e,r){return Opa},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),xmt=(function(){function t(){}return a(t,"NoopMetric"),t})(),Cpa=(function(t){gte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(xmt),bpa=(function(t){gte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(xmt),Spa=(function(t){gte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(xmt),Tpa=(function(t){gte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(xmt),fEr=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),Ipa=(function(t){gte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(fEr),xpa=(function(t){gte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(fEr),wpa=(function(t){gte(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(fEr),pEr=new vpa,Rpa=new Cpa,kpa=new Spa,Ppa=new Tpa,Dpa=new bpa,Npa=new Ipa,Mpa=new xpa,Opa=new wpa;a(Spi,"createNoopMeter")});var wmt,Tpi=Se(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(wmt||(wmt={}))});var Rmt,kmt,mEr=Se(()=>{p();Rmt={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},kmt={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var Lpa,Bpa,Ipi,xpi=Se(()=>{p();o5e();Lpa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Bpa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();xpi();hte();mte();Fpa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Upa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Uf||(Uf={}))});var a5e,c5e,_0e,Pmt=Se(()=>{p();AEr();a5e="0000000000000000",c5e="00000000000000000000000000000000",_0e={traceId:c5e,spanId:a5e,traceFlags:Uf.NONE}});var JG,Dmt=Se(()=>{p();Pmt();JG=(function(){function t(e){e===void 0&&(e=_0e),this._spanContext=e}return a(t,"NonRecordingSpan"),t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.addLink=function(e){return this},t.prototype.addLinks=function(e){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t})()});function Nmt(t){return t.getValue(yEr)||void 0}function wpi(){return Nmt(KG.getInstance().active())}function l5e(t,e){return t.setValue(yEr,e)}function Rpi(t){return t.deleteValue(yEr)}function kpi(t,e){return l5e(t,new JG(e))}function Mmt(t){var e;return(e=Nmt(t))===null||e===void 0?void 0:e.spanContext()}var yEr,_Er=Se(()=>{p();o5e();Dmt();s5e();yEr=oS("OpenTelemetry Context Key SPAN");a(Nmt,"getSpan");a(wpi,"getActiveSpan");a(l5e,"setSpan");a(Rpi,"deleteSpan");a(kpi,"setSpanContext");a(Mmt,"getSpanContext")});function Ate(t){return qpa.test(t)&&t!==c5e}function EEr(t){return jpa.test(t)&&t!==a5e}function sS(t){return Ate(t.traceId)&&EEr(t.spanId)}function Ppi(t){return new JG(t)}var qpa,jpa,Omt=Se(()=>{p();Pmt();Dmt();qpa=/^([0-9a-f]{32})$/i,jpa=/^[0-9a-f]{16}$/i;a(Ate,"isValidTraceId");a(EEr,"isValidSpanId");a(sS,"isSpanContextValid");a(Ppi,"wrapSpanContext")});function Hpa(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var vEr,Lmt,CEr=Se(()=>{p();s5e();_Er();Dmt();Omt();vEr=KG.getInstance(),Lmt=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=vEr.active());var o=!!r?.root;if(o)return new JG;var s=n&&Mmt(n);return Hpa(s)&&sS(s)?new JG(s):new JG},t.prototype.startActiveSpan=function(e,r,n,o){var s,c,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,c=n,l=o);var u=c??vEr.active(),d=this.startSpan(e,s,u),f=l5e(u,d);return vEr.with(f,l,void 0,d)}},t})();a(Hpa,"isSpanContext")});var Gpa,Bmt,bEr=Se(()=>{p();CEr();Gpa=new Lmt,Bmt=(function(){function t(e,r,n,o){this._provider=e,this.name=r,this.version=n,this.options=o}return a(t,"ProxyTracer"),t.prototype.startSpan=function(e,r,n){return this._getTracer().startSpan(e,r,n)},t.prototype.startActiveSpan=function(e,r,n,o){var s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Gpa},t})()});var Dpi,Npi=Se(()=>{p();CEr();Dpi=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new Lmt},t})()});var $pa,u5e,SEr=Se(()=>{p();bEr();Npi();$pa=new Dpi,u5e=(function(){function t(){}return a(t,"ProxyTracerProvider"),t.prototype.getTracer=function(e,r,n){var o;return(o=this.getDelegateTracer(e,r,n))!==null&&o!==void 0?o:new Bmt(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:$pa},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,r,n)},t})()});var aS,Mpi=Se(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(aS||(aS={}))});var E0e,Opi=Se(()=>{p();(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(E0e||(E0e={}))});var v0e,Lpi=Se(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(v0e||(v0e={}))});function Bpi(t){return zpa.test(t)}function Fpi(t){return Ypa.test(t)&&!Kpa.test(t)}var TEr,Vpa,Wpa,zpa,Ypa,Kpa,Upi=Se(()=>{p();TEr="[_0-9a-z-*/]",Vpa="[a-z]"+TEr+"{0,255}",Wpa="[a-z0-9]"+TEr+"{0,240}@[a-z]"+TEr+"{0,13}",zpa=new RegExp("^(?:"+Vpa+"|"+Wpa+")$"),Ypa=/^[ -~]{0,255}[!-~]$/,Kpa=/,|=/;a(Bpi,"validateKey");a(Fpi,"validateValue")});var Qpi,Jpa,qpi,jpi,Hpi,Gpi=Se(()=>{p();Upi();Qpi=32,Jpa=512,qpi=",",jpi="=",Hpi=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return a(t,"TraceStateImpl"),t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+jpi+e.get(n)),r},[]).join(qpi)},t.prototype._parse=function(e){e.length>Jpa||(this._internalState=e.split(qpi).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(jpi);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);Bpi(c)&&Fpi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Qpi&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Qpi))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function $pi(t){return new Hpi(t)}var Vpi=Se(()=>{p();Gpi();a($pi,"createTraceState")});var X0,Wpi=Se(()=>{p();s5e();X0=KG.getInstance()});var On,zpi=Se(()=>{p();mte();On=Y_.instance()});var Zpa,Ypi,Kpi=Se(()=>{p();hEr();Zpa=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return pEr},t})(),Ypi=new Zpa});var IEr,Jpi,Zpi=Se(()=>{p();Kpi();hte();mte();IEr="metrics",Jpi=(function(){function t(){}return a(t,"MetricsAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return tL(IEr,e,Y_.instance())},t.prototype.getMeterProvider=function(){return hI(IEr)||Ypi},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){rL(IEr,Y_.instance())},t})()});var yte,Xpi=Se(()=>{p();Zpi();yte=Jpi.getInstance()});var ehi,thi=Se(()=>{p();ehi=(function(){function t(){}return a(t,"NoopTextMapPropagator"),t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})()});function wEr(t){return t.getValue(xEr)||void 0}function rhi(){return wEr(KG.getInstance().active())}function nhi(t,e){return t.setValue(xEr,e)}function ihi(t){return t.deleteValue(xEr)}var xEr,ohi=Se(()=>{p();s5e();o5e();xEr=oS("OpenTelemetry Baggage Key");a(wEr,"getBaggage");a(rhi,"getActiveBaggage");a(nhi,"setBaggage");a(ihi,"deleteBaggage")});var REr,Xpa,shi,ahi=Se(()=>{p();hte();thi();mEr();ohi();uEr();mte();REr="propagation",Xpa=new ehi,shi=(function(){function t(){this.createBaggage=vpi,this.getBaggage=wEr,this.getActiveBaggage=rhi,this.setBaggage=nhi,this.deleteBaggage=ihi}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return tL(REr,e,Y_.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=kmt),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=Rmt),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){rL(REr,Y_.instance())},t.prototype._getGlobalPropagator=function(){return hI(REr)||Xpa},t})()});var mI,chi=Se(()=>{p();ahi();mI=shi.getInstance()});var kEr,lhi,uhi=Se(()=>{p();hte();SEr();Omt();_Er();mte();kEr="trace",lhi=(function(){function t(){this._proxyTracerProvider=new u5e,this.wrapSpanContext=Ppi,this.isSpanContextValid=sS,this.deleteSpan=Rpi,this.getSpan=Nmt,this.getActiveSpan=wpi,this.getSpanContext=Mmt,this.setSpan=l5e,this.setSpanContext=kpi}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=tL(kEr,this._proxyTracerProvider,Y_.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return hI(kEr)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){rL(kEr,Y_.instance()),this._proxyTracerProvider=new u5e},t})()});var Uu,dhi=Se(()=>{p();uhi();Uu=lhi.getInstance()});var A6={};Ti(A6,{DiagConsoleLogger:()=>Cpi,DiagLogLevel:()=>Ua,INVALID_SPANID:()=>a5e,INVALID_SPAN_CONTEXT:()=>_0e,INVALID_TRACEID:()=>c5e,ProxyTracer:()=>Bmt,ProxyTracerProvider:()=>u5e,ROOT_CONTEXT:()=>Imt,SamplingDecision:()=>aS,SpanKind:()=>E0e,SpanStatusCode:()=>v0e,TraceFlags:()=>Uf,ValueType:()=>wmt,baggageEntryMetadataFromString:()=>y0e,context:()=>X0,createContextKey:()=>oS,createNoopMeter:()=>Spi,createTraceState:()=>$pi,default:()=>eha,defaultTextMapGetter:()=>Rmt,defaultTextMapSetter:()=>kmt,diag:()=>On,isSpanContextValid:()=>sS,isValidSpanId:()=>EEr,isValidTraceId:()=>Ate,metrics:()=>yte,propagation:()=>mI,trace:()=>Uu});var eha,go=Se(()=>{p();uEr();o5e();bpi();Tmt();hEr();Tpi();mEr();bEr();SEr();Mpi();Opi();Lpi();AEr();Vpi();Omt();Pmt();Wpi();zpi();Xpi();chi();dhi();eha={context:X0,diag:On,metrics:yte,propagation:mI,trace:Uu}});function C0e(t){return t.setValue(PEr,!0)}function fhi(t){return t.deleteValue(PEr)}function ZG(t){return t.getValue(PEr)===!0}var PEr,d5e=Se(()=>{p();go();PEr=oS("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(C0e,"suppressTracing");a(fhi,"unsuppressTracing");a(ZG,"isTracingSuppressed")});var phi,Fmt,b0e,Umt,hhi,mhi,ghi,DEr=Se(()=>{p();phi="=",Fmt=";",b0e=",",Umt="baggage",hhi=180,mhi=4096,ghi=8192});function Qmt(t){return t.reduce(function(e,r){var n=""+e+(e!==""?b0e:"")+r;return n.length>ghi?e:n},"")}function qmt(t){return t.getAllEntries().map(function(e){var r=tha(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=Fmt+o.metadata.toString()),s})}function f5e(t){var e=t.split(Fmt);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(phi);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=y0e(e.join(Fmt))),{key:o,value:s,metadata:c}}}}}function Ahi(t){return typeof t!="string"||t.length===0?{}:t.split(b0e).map(function(e){return f5e(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var tha,NEr=Se(()=>{p();go();DEr();tha=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s};a(Qmt,"serializeKeyPairs");a(qmt,"getKeyPairs");a(f5e,"parsePairKeyValue");a(Ahi,"parseKeyPairsIntoRecord")});var jmt,yhi=Se(()=>{p();go();d5e();DEr();NEr();jmt=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=mI.getBaggage(e);if(!(!o||ZG(e))){var s=qmt(o).filter(function(l){return l.length<=mhi}).slice(0,hhi),c=Qmt(s);c.length>0&&n.set(r,Umt,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,Umt),s=Array.isArray(o)?o.join(b0e):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(b0e);return l.forEach(function(u){var d=f5e(u);if(d){var f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0?e:mI.setBaggage(e,mI.createBaggage(c))},t.prototype.fields=function(){return[Umt]},t})()});var _hi,Ehi=Se(()=>{p();_hi=(function(){function t(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}return a(t,"AnchoredClock"),t.prototype.now=function(){var e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e},t})()});function XG(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=vhi(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=rha(s.value,2),l=c[0],u=c[1];if(!MEr(l)){On.warn("Invalid attribute key: "+l);continue}if(!p5e(u)){On.warn("Invalid attribute value set for key: "+l);continue}Array.isArray(u)?n[l]=u.slice():n[l]=u}}catch(d){e={error:d}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}function MEr(t){return typeof t=="string"&&t.length>0}function p5e(t){return t==null?!0:Array.isArray(t)?nha(t):Chi(t)}function nha(t){var e,r,n;try{for(var o=vhi(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if(Chi(c)){n=typeof c;continue}return!1}if(typeof c!==n)return!1}}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return!0}function Chi(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var vhi,rha,bhi=Se(()=>{p();go();vhi=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},rha=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s};a(XG,"sanitizeAttributes");a(MEr,"isAttributeKey");a(p5e,"isAttributeValue");a(nha,"isHomogeneousAttributeValueArray");a(Chi,"isValidPrimitiveAttributeValue")});function Hmt(){return function(t){On.error(iha(t))}}function iha(t){return typeof t=="string"?t:JSON.stringify(oha(t))}function oha(t){for(var e={},r=t;r!==null;)Object.getOwnPropertyNames(r).forEach(function(n){if(!e[n]){var o=r[n];o&&(e[n]=String(o))}}),r=Object.getPrototypeOf(r);return e}var OEr=Se(()=>{p();go();a(Hmt,"loggingErrorHandler");a(iha,"stringifyException");a(oha,"flattenException")});function Thi(t){Shi=t}function Fv(t){try{Shi(t)}catch{}}var Shi,LEr=Se(()=>{p();OEr();Shi=Hmt();a(Thi,"setGlobalErrorHandler");a(Fv,"globalErrorHandler")});var cS,BEr=Se(()=>{p();(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(cS||(cS={}))});function cha(t){return aha.indexOf(t)>-1}function uha(t){return lha.indexOf(t)>-1}function fha(t){return dha.indexOf(t)>-1}function pha(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function hha(t,e,r,n,o){if(n===void 0&&(n=-1/0),o===void 0&&(o=1/0),typeof r[t]<"u"){var s=Number(r[t]);isNaN(s)||(so?e[t]=o:e[t]=s)}}function mha(t,e,r,n){n===void 0&&(n=sha);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function Aha(t,e,r){var n=r[t];if(typeof n=="string"){var o=gha[n.toUpperCase()];o!=null&&(e[t]=o)}}function m5e(t){var e={};for(var r in h5e){var n=r;switch(n){case"OTEL_LOG_LEVEL":Aha(n,e,t);break;default:if(cha(n))pha(n,e,t);else if(uha(n))hha(n,e,t);else if(fha(n))mha(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var sha,aha,lha,dha,_te,Ete,FEr,UEr,h5e,gha,QEr=Se(()=>{p();go();BEr();sha=",",aha=["OTEL_SDK_DISABLED"];a(cha,"isEnvVarABoolean");lha=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];a(uha,"isEnvVarANumber");dha=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(fha,"isEnvVarAList");_te=1/0,Ete=128,FEr=128,UEr=128,h5e={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:Ua.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:_te,OTEL_ATTRIBUTE_COUNT_LIMIT:Ete,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:_te,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Ete,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:_te,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Ete,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:FEr,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:UEr,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:cS.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};a(pha,"parseBoolean");a(hha,"parseNumber");a(mha,"parseStringList");gha={ALL:Ua.ALL,VERBOSE:Ua.VERBOSE,DEBUG:Ua.DEBUG,INFO:Ua.INFO,WARN:Ua.WARN,ERROR:Ua.ERROR,NONE:Ua.NONE};a(Aha,"setLogLevelFromEnv");a(m5e,"parseEnvironment")});function QR(){var t=m5e(process.env);return Object.assign({},h5e,t)}function S0e(){return m5e(process.env)}var Ihi=Se(()=>{p();QEr();a(QR,"getEnv");a(S0e,"getEnvWithoutDefaults")});var Gmt,xhi=Se(()=>{p();Gmt=typeof globalThis=="object"?globalThis:global});function whi(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function $mt(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(whi,"intValue");a($mt,"hexToBinary")});function Vmt(t){return Buffer.from($mt(t)).toString("base64")}var Rhi=Se(()=>{p();qEr();a(Vmt,"hexToBase64")});function khi(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(Wmt[t-1]=1);return Wmt.toString("hex",0,t)},"generateId")}var yha,Phi,zmt,Wmt,Dhi=Se(()=>{p();yha=8,Phi=16,zmt=(function(){function t(){this.generateTraceId=khi(Phi),this.generateSpanId=khi(yha)}return a(t,"RandomIdGenerator"),t})(),Wmt=Buffer.allocUnsafe(Phi);a(khi,"getIdGenerator")});var Nhi,qR,Mhi=Se(()=>{p();Nhi=require("perf_hooks"),qR=Nhi.performance});var Ymt,jEr=Se(()=>{p();Ymt="1.30.1"});var Ohi=Se(()=>{p()});var Lhi=Se(()=>{p();Ohi()});var _ha,Eha,vha,Cha,Bhi,Fhi,Uhi,Qhi,bha,qhi,jhi=Se(()=>{p();_ha="process.runtime.name",Eha="telemetry.sdk.name",vha="telemetry.sdk.language",Cha="telemetry.sdk.version",Bhi=_ha,Fhi=Eha,Uhi=vha,Qhi=Cha,bha="nodejs",qhi=bha});var Hhi=Se(()=>{p();jhi()});var Ghi=Se(()=>{p()});var $hi=Se(()=>{p()});var Vhi=Se(()=>{p();Lhi();Hhi();Ghi();$hi()});var T0e,e$,Whi=Se(()=>{p();jEr();Vhi();e$=(T0e={},T0e[Fhi]="opentelemetry",T0e[Bhi]="node",T0e[Uhi]=qhi,T0e[Qhi]=Ymt,T0e)});function I0e(t){t.unref()}var zhi=Se(()=>{p();a(I0e,"unrefTimer")});var Yhi=Se(()=>{p();Ihi();xhi();Rhi();Dhi();Mhi();Whi();zhi()});var HEr=Se(()=>{p();Yhi()});function kD(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*Tha);return[r,n]}function x0e(){var t=qR.timeOrigin;if(typeof t!="number"){var e=qR;t=e.timing&&e.timing.fetchStart}return t}function g5e(t){var e=kD(x0e()),r=kD(typeof t=="number"?t:qR.now());return _5e(e,r)}function Jhi(t){if(w0e(t))return t;if(typeof t=="number")return t=Kmt&&(r[1]-=Kmt,r[0]+=1),r}var Khi,Sha,Tha,Kmt,tmi=Se(()=>{p();HEr();Khi=9,Sha=6,Tha=Math.pow(10,Sha),Kmt=Math.pow(10,Khi);a(kD,"millisToHrTime");a(x0e,"getTimeOrigin");a(g5e,"hrTime");a(Jhi,"timeInputToHrTime");a(Jmt,"hrTimeDuration");a(Zhi,"hrTimeToTimeStamp");a(Xhi,"hrTimeToNanoseconds");a(emi,"hrTimeToMilliseconds");a(A5e,"hrTimeToMicroseconds");a(w0e,"isTimeInputHrTime");a(y5e,"isTimeInput");a(_5e,"addHrTimes")});var gI,rmi=Se(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(gI||(gI={}))});var Iha,Zmt,nmi=Se(()=>{p();go();Iha=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Zmt=(function(){function t(e){e===void 0&&(e={});var r;this._propagators=(r=e.propagators)!==null&&r!==void 0?r:[],this._fields=Array.from(new Set(this._propagators.map(function(n){return typeof n.fields=="function"?n.fields():[]}).reduce(function(n,o){return n.concat(o)},[])))}return a(t,"CompositePropagator"),t.prototype.inject=function(e,r,n){var o,s;try{for(var c=Iha(this._propagators),l=c.next();!l.done;l=c.next()){var u=l.value;try{u.inject(e,r,n)}catch(d){On.warn("Failed to inject with "+u.constructor.name+". Err: "+d.message)}}}catch(d){o={error:d}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}},t.prototype.extract=function(e,r,n){return this._propagators.reduce(function(o,s){try{return s.extract(o,r,n)}catch(c){On.warn("Failed to extract with "+s.constructor.name+". Err: "+c.message)}return o},e)},t.prototype.fields=function(){return this._fields.slice()},t})()});function imi(t){return Rha.test(t)}function omi(t){return kha.test(t)&&!Pha.test(t)}var GEr,xha,wha,Rha,kha,Pha,smi=Se(()=>{p();GEr="[_0-9a-z-*/]",xha="[a-z]"+GEr+"{0,255}",wha="[a-z0-9]"+GEr+"{0,240}@[a-z]"+GEr+"{0,13}",Rha=new RegExp("^(?:"+xha+"|"+wha+")$"),kha=/^[ -~]{0,255}[!-~]$/,Pha=/,|=/;a(imi,"validateKey");a(omi,"validateValue")});var ami,Dha,cmi,lmi,Xmt,$Er=Se(()=>{p();smi();ami=32,Dha=512,cmi=",",lmi="=",Xmt=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return a(t,"TraceState"),t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+lmi+e.get(n)),r},[]).join(cmi)},t.prototype._parse=function(e){e.length>Dha||(this._internalState=e.split(cmi).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(lmi);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);imi(c)&&omi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>ami&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,ami))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function VEr(t){var e=Fha.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var E5e,v5e,Nha,Mha,Oha,Lha,Bha,Fha,egt,umi=Se(()=>{p();go();d5e();$Er();E5e="traceparent",v5e="tracestate",Nha="00",Mha="(?!ff)[\\da-f]{2}",Oha="(?![0]{32})[\\da-f]{32}",Lha="(?![0]{16})[\\da-f]{16}",Bha="[\\da-f]{2}",Fha=new RegExp("^\\s?("+Mha+")-("+Oha+")-("+Lha+")-("+Bha+")(-.*)?\\s?$");a(VEr,"parseTraceParent");egt=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=Uu.getSpanContext(e);if(!(!o||ZG(e)||!sS(o))){var s=Nha+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||Uf.NONE).toString(16);n.set(r,E5e,s),o.traceState&&n.set(r,v5e,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,E5e);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=VEr(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,v5e);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new Xmt(typeof u=="string"?u:void 0)}return Uu.setSpanContext(e,c)},t.prototype.fields=function(){return[E5e,v5e]},t})()});function dmi(t,e){return t.setValue(WEr,e)}function fmi(t){return t.deleteValue(WEr)}function pmi(t){return t.getValue(WEr)}var WEr,tgt,hmi=Se(()=>{p();go();WEr=oS("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(tgt||(tgt={}));a(dmi,"setRPCMetadata");a(fmi,"deleteRPCMetadata");a(pmi,"getRPCMetadata")});var C5e,zEr=Se(()=>{p();go();C5e=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:aS.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var R0e,YEr=Se(()=>{p();go();R0e=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:aS.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var mmi,gmi=Se(()=>{p();go();LEr();zEr();YEr();mmi=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(Fv(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new R0e),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new R0e,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new C5e,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new R0e,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new C5e}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=Uu.getSpanContext(e);return!l||!sS(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&Uf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&Uf.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,s,c):this._localParentNotSampled.shouldSample(e,r,n,o,s,c)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t})()});var Ami,ymi=Se(()=>{p();go();Ami=(function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return a(t,"TraceIdRatioBasedSampler"),t.prototype.shouldSample=function(e,r){return{decision:Ate(r)&&this._accumulate(r)=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n>>0}return r},t})()});function $ha(t,e){return function(r){return t(e(r))}}function KEr(t){if(!Vha(t)||Wha(t)!==Uha)return!1;var e=Gha(t);if(e===null)return!0;var r=vmi.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&_mi.call(r)===Hha}function Vha(t){return t!=null&&typeof t=="object"}function Wha(t){return t==null?t===void 0?qha:Qha:vte&&vte in Object(t)?zha(t):Yha(t)}function zha(t){var e=vmi.call(t,vte),r=t[vte],n=!1;try{t[vte]=void 0,n=!0}catch{}var o=Cmi.call(t);return n&&(e?t[vte]=r:delete t[vte]),o}function Yha(t){return Cmi.call(t)}var Uha,Qha,qha,jha,_mi,Hha,Gha,Emi,vmi,vte,Cmi,bmi=Se(()=>{p();Uha="[object Object]",Qha="[object Null]",qha="[object Undefined]",jha=Function.prototype,_mi=jha.toString,Hha=_mi.call(Object),Gha=$ha(Object.getPrototypeOf,Object),Emi=Object.prototype,vmi=Emi.hasOwnProperty,vte=Symbol?Symbol.toStringTag:void 0,Cmi=Emi.toString;a($ha,"overArg");a(KEr,"isPlainObject");a(Vha,"isObjectLike");a(Wha,"baseGetTag");a(zha,"getRawTag");a(Yha,"objectToString")});function igt(){for(var t=[],e=0;e0;)r=Tmi(r,t.shift(),0,n);return r}function JEr(t){return ngt(t)?t.slice():t}function Tmi(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>Kha)){if(r++,rgt(t)||rgt(e)||Imi(e))o=JEr(e);else if(ngt(t)){if(o=t.slice(),ngt(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(Smi(t,u,n)||Smi(e,u,n))delete o[u];else{if(b5e(f)&&b5e(h)){var m=n.get(f)||[],g=n.get(h)||[];m.push({obj:t,key:u}),g.push({obj:e,key:u}),n.set(f,m),n.set(h,g)}o[u]=Tmi(o[u],d,r,n)}}}}else o=e;return o}}function Smi(t,e,r){for(var n=r.get(t[e])||[],o=0,s=n.length;o"u"||t instanceof Date||t instanceof RegExp||t===null}function Jha(t,e){return!(!KEr(t)||!KEr(e))}var Kha,xmi=Se(()=>{p();bmi();Kha=20;a(igt,"merge");a(JEr,"takeValue");a(Tmi,"mergeTwoObjects");a(Smi,"wasObjectReferenced");a(ngt,"isArray");a(Imi,"isFunction");a(b5e,"isObject");a(rgt,"isPrimitive");a(Jha,"shouldMerge")});function wmi(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new ZEr("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(function(o){return clearTimeout(r),o},function(o){throw clearTimeout(r),o})}var Zha,ZEr,Rmi=Se(()=>{p();Zha=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),ZEr=(function(t){Zha(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return a(e,"TimeoutError"),e})(Error);a(wmi,"callWithTimeout")});function XEr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function kmi(t,e){var r,n;if(!e)return!1;try{for(var o=Xha(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(XEr(t,c))return!0}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}var Xha,Pmi=Se(()=>{p();Xha=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};a(XEr,"urlMatches");a(kmi,"isUrlIgnored")});function Dmi(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var Nmi=Se(()=>{p();a(Dmi,"isWrapped")});var Mmi,Omi=Se(()=>{p();Mmi=(function(){function t(){var e=this;this._promise=new Promise(function(r,n){e._resolve=r,e._reject=n})}return a(t,"Deferred"),Object.defineProperty(t.prototype,"promise",{get:a(function(){return this._promise},"get"),enumerable:!1,configurable:!0}),t.prototype.resolve=function(e){this._resolve(e)},t.prototype.reject=function(e){this._reject(e)},t})()});var ema,tma,k0e,Lmi=Se(()=>{p();Omi();ema=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},tma=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();go();d5e();a(Bmi,"_export")});var Umi={};Ti(Umi,{AlwaysOffSampler:()=>C5e,AlwaysOnSampler:()=>R0e,AnchoredClock:()=>_hi,BindOnceFuture:()=>k0e,CompositePropagator:()=>Zmt,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>Ete,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>_te,DEFAULT_ENVIRONMENT:()=>h5e,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>FEr,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>UEr,ExportResultCode:()=>gI,ParentBasedSampler:()=>mmi,RPCType:()=>tgt,RandomIdGenerator:()=>zmt,SDK_INFO:()=>e$,TRACE_PARENT_HEADER:()=>E5e,TRACE_STATE_HEADER:()=>v5e,TimeoutError:()=>ZEr,TraceIdRatioBasedSampler:()=>Ami,TraceState:()=>Xmt,TracesSamplerValues:()=>cS,VERSION:()=>Ymt,W3CBaggagePropagator:()=>jmt,W3CTraceContextPropagator:()=>egt,_globalThis:()=>Gmt,addHrTimes:()=>_5e,baggageUtils:()=>rma,callWithTimeout:()=>wmi,deleteRPCMetadata:()=>fmi,getEnv:()=>QR,getEnvWithoutDefaults:()=>S0e,getRPCMetadata:()=>pmi,getTimeOrigin:()=>x0e,globalErrorHandler:()=>Fv,hexToBase64:()=>Vmt,hexToBinary:()=>$mt,hrTime:()=>g5e,hrTimeDuration:()=>Jmt,hrTimeToMicroseconds:()=>A5e,hrTimeToMilliseconds:()=>emi,hrTimeToNanoseconds:()=>Xhi,hrTimeToTimeStamp:()=>Zhi,internal:()=>evr,isAttributeKey:()=>MEr,isAttributeValue:()=>p5e,isTimeInput:()=>y5e,isTimeInputHrTime:()=>w0e,isTracingSuppressed:()=>ZG,isUrlIgnored:()=>kmi,isWrapped:()=>Dmi,loggingErrorHandler:()=>Hmt,merge:()=>igt,millisToHrTime:()=>kD,otperformance:()=>qR,parseEnvironment:()=>m5e,parseTraceParent:()=>VEr,sanitizeAttributes:()=>XG,setGlobalErrorHandler:()=>Thi,setRPCMetadata:()=>dmi,suppressTracing:()=>C0e,timeInputToHrTime:()=>Jhi,unrefTimer:()=>I0e,unsuppressTracing:()=>fhi,urlMatches:()=>XEr});var rma,evr,lS=Se(()=>{p();yhi();Ehi();bhi();LEr();OEr();tmi();qEr();rmi();NEr();HEr();nmi();umi();hmi();zEr();YEr();gmi();ymi();d5e();$Er();QEr();xmi();BEr();Rmi();Pmi();Nmi();Lmi();jEr();Fmi();rma={getKeyPairs:qmt,serializeKeyPairs:Qmt,parseKeyPairsIntoRecord:Ahi,parsePairKeyValue:f5e},evr={_export:Bmi}});var nma,ima,oma,ogt,sgt,Qmi,qmi=Se(()=>{p();nma="exception.type",ima="exception.message",oma="exception.stacktrace",ogt=nma,sgt=ima,Qmi=oma});var jmi=Se(()=>{p();qmi()});var Hmi=Se(()=>{p()});var Gmi=Se(()=>{p();Hmi()});var $mi=Se(()=>{p()});var Vmi=Se(()=>{p()});var Wmi=Se(()=>{p();jmi();Gmi();$mi();Vmi()});var zmi,Ymi=Se(()=>{p();zmi="exception"});var tvr,sma,Kmi,ama,agt,rvr=Se(()=>{p();go();lS();Wmi();Ymi();tvr=function(){return tvr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kmi=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},ama=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this):(On.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var o=sma(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=Kmi(s.value,2),l=c[0],u=c[1];this.setAttribute(l,u)}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return this},t.prototype.addEvent=function(e,r,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return On.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&On.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),y5e(r)&&(y5e(n)||(n=r),r=void 0);var o=XG(r);return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:0}),this},t.prototype.addLink=function(e){return this.links.push(e),this},t.prototype.addLinks=function(e){var r;return(r=this.links).push.apply(r,ama([],Kmi(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=tvr({},e),this.status.message!=null&&typeof e.message!="string"&&(On.warn("Dropping invalid status.message of type '"+typeof e.message+"', expected 'string'"),delete this.status.message),this)},t.prototype.updateName=function(e){return this._isSpanEnded()?this:(this.name=e,this)},t.prototype.end=function(e){if(this._isSpanEnded()){On.error(this.name+" "+this._spanContext.traceId+"-"+this._spanContext.spanId+" - You can only call end() on a span once.");return}this._ended=!0,this.endTime=this._getTime(e),this._duration=Jmt(this.startTime,this.endTime),this._duration[0]<0&&(On.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&On.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<=qR.now())return g5e(e+this._performanceOffset);if(typeof e=="number")return kD(e);if(e instanceof Date)return kD(e.getTime());if(w0e(e))return e;if(this._startTimeProvided)return kD(Date.now());var r=qR.now()-this._performanceStartTime;return _5e(this.startTime,kD(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[sgt]=e:e&&(e.code?n[ogt]=e.code.toString():e.name&&(n[ogt]=e.name),e.message&&(n[sgt]=e.message),e.stack&&(n[Qmi]=e.stack)),n[ogt]||n[sgt]?this.addEvent(zmi,n,r):On.warn("Failed to record an exception "+e)},Object.defineProperty(t.prototype,"duration",{get:a(function(){return this._duration},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ended",{get:a(function(){return this._ended},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedAttributesCount",{get:a(function(){return this._droppedAttributesCount},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedEventsCount",{get:a(function(){return this._droppedEventsCount},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedLinksCount",{get:a(function(){return this._droppedLinksCount},"get"),enumerable:!1,configurable:!0}),t.prototype._isSpanEnded=function(){return this._ended&&On.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},t.prototype._truncateToLimitUtil=function(e,r){return e.length<=r?e:e.substring(0,r)},t.prototype._truncateToSize=function(e){var r=this,n=this._attributeValueLengthLimit;return n<=0?(On.warn("Attribute value limit must be positive, got "+n),e):typeof e=="string"?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map(function(o){return typeof o=="string"?r._truncateToLimitUtil(o,n):o}):e},t})()});var PD,S5e=Se(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(PD||(PD={}))});var t$,cgt=Se(()=>{p();S5e();t$=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:PD.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var nL,lgt=Se(()=>{p();S5e();nL=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:PD.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var P0e,nvr=Se(()=>{p();go();lS();cgt();lgt();P0e=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(Fv(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new nL),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new nL,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new t$,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new nL,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new t$}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=Uu.getSpanContext(e);return!l||!sS(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&Uf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&Uf.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,s,c):this._localParentNotSampled.shouldSample(e,r,n,o,s,c)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t})()});var T5e,ivr=Se(()=>{p();go();S5e();T5e=(function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return a(t,"TraceIdRatioBasedSampler"),t.prototype.shouldSample=function(e,r){return{decision:Ate(r)&&this._accumulate(r)=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n>>0}return r},t})()});function ugt(){var t=QR();return{sampler:ovr(t),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:t.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:t.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:t.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:t.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function ovr(t){switch(t===void 0&&(t=QR()),t.OTEL_TRACES_SAMPLER){case cS.AlwaysOn:return new nL;case cS.AlwaysOff:return new t$;case cS.ParentBasedAlwaysOn:return new P0e({root:new nL});case cS.ParentBasedAlwaysOff:return new P0e({root:new t$});case cS.TraceIdRatio:return new T5e(Jmi(t));case cS.ParentBasedTraceIdRatio:return new P0e({root:new T5e(Jmi(t))});default:return On.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+cma+'".'),new nL}}function Jmi(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return On.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+D0e+"."),D0e;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(On.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+D0e+"."),D0e):e<0||e>1?(On.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+D0e+"."),D0e):e}var cma,D0e,svr=Se(()=>{p();go();lS();cgt();lgt();nvr();ivr();cma=cS.AlwaysOn,D0e=1;a(ugt,"loadDefaultConfig");a(ovr,"buildSamplerFromEnv");a(Jmi,"getSamplerProbabilityFromEnv")});function Zmi(t){var e={sampler:ovr()},r=ugt(),n=Object.assign({},r,e,t);return n.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),n}function Xmi(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=S0e();return g.attributeCountLimit=(c=(s=(o=(r=(e=t.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&r!==void 0?r:(n=t.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&o!==void 0?o:A.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:A.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&c!==void 0?c:Ete,g.attributeValueLengthLimit=(m=(h=(f=(u=(l=t.spanLimits)===null||l===void 0?void 0:l.attributeValueLengthLimit)!==null&&u!==void 0?u:(d=t.generalLimits)===null||d===void 0?void 0:d.attributeValueLengthLimit)!==null&&f!==void 0?f:A.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&h!==void 0?h:A.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&m!==void 0?m:_te,Object.assign({},t,{spanLimits:g})}var avr=Se(()=>{p();svr();lS();a(Zmi,"mergeConfig");a(Xmi,"reconfigureLimits")});var egi,tgi=Se(()=>{p();go();lS();egi=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=QR();this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new k0e(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(On.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return a(t,"BatchSpanProcessorBase"),t.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Uf.SAMPLED)!==0&&this._addToBuffer(e)},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){var e=this;return Promise.resolve().then(function(){return e.onShutdown()}).then(function(){return e._flushAll()}).then(function(){return e._exporter.shutdown()})},t.prototype._addToBuffer=function(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&On.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(On.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()},t.prototype._flushAll=function(){var e=this;return new Promise(function(r,n){for(var o=[],s=Math.ceil(e._finishedSpans.length/e._maxExportBatchSize),c=0,l=s;c0&&(e._clearTimer(),e._maybeStartTimer())}).catch(function(n){e._isExporting=!1,Fv(n)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),I0e(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var lma,N0e,rgi=Se(()=>{p();tgi();lma=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),N0e=(function(t){lma(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(egi)});function ngi(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(dgt[t-1]=1);return dgt.toString("hex",0,t)},"generateId")}var uma,igi,M0e,dgt,ogi=Se(()=>{p();uma=8,igi=16,M0e=(function(){function t(){this.generateTraceId=ngi(igi),this.generateSpanId=ngi(uma)}return a(t,"RandomIdGenerator"),t})(),dgt=Buffer.allocUnsafe(igi);a(ngi,"getIdGenerator")});var sgi=Se(()=>{p();rgi();ogi()});var fgt=Se(()=>{p();sgi()});var pgt,cvr=Se(()=>{p();go();lS();rvr();avr();fgt();pgt=(function(){function t(e,r,n){this._tracerProvider=n;var o=Zmi(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new M0e,this.resource=n.resource,this.instrumentationLibrary=e}return a(t,"Tracer"),t.prototype.startSpan=function(e,r,n){var o,s,c;r===void 0&&(r={}),n===void 0&&(n=X0.active()),r.root&&(n=Uu.deleteSpan(n));var l=Uu.getSpan(n);if(ZG(n)){On.debug("Instrumentation suppressed, returning Noop Span");var u=Uu.wrapSpanContext(_0e);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!Uu.isSpanContextValid(d)?h=this._idGenerator.generateTraceId():(h=d.traceId,m=d.traceState,g=d.spanId);var A=(o=r.kind)!==null&&o!==void 0?o:E0e.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:XG(R.attributes)}}),_=XG(r.attributes),E=this._sampler.shouldSample(n,h,e,A,_,y);m=(c=E.traceState)!==null&&c!==void 0?c:m;var v=E.decision===aS.RECORD_AND_SAMPLED?Uf.SAMPLED:Uf.NONE,S={traceId:h,spanId:f,traceFlags:v,traceState:m};if(E.decision===aS.NOT_RECORD){On.debug("Recording is off, propagating context in a non-recording span");var u=Uu.wrapSpanContext(S);return u}var T=XG(Object.assign(_,E.attributes)),w=new agt(this,n,e,S,A,g,y,r.startTime,void 0,T);return w},t.prototype.startActiveSpan=function(e,r,n,o){var s,c,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,c=n,l=o);var u=c??X0.active(),d=this.startSpan(e,s,u),f=Uu.setSpan(u,d);return X0.with(f,l,void 0,d)}},t.prototype.getGeneralLimits=function(){return this._generalLimits},t.prototype.getSpanLimits=function(){return this._spanLimits},t.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},t})()});var agi=Se(()=>{p()});var cgi=Se(()=>{p();agi()});var dma,fma,pma,hma,lgi,lvr,uvr,dvr,ugi=Se(()=>{p();dma="service.name",fma="telemetry.sdk.name",pma="telemetry.sdk.language",hma="telemetry.sdk.version",lgi=dma,lvr=fma,uvr=pma,dvr=hma});var dgi=Se(()=>{p();ugi()});var fgi=Se(()=>{p()});var pgi=Se(()=>{p()});var hgi=Se(()=>{p();cgi();dgi();fgi();pgi()});function hgt(){return"unknown_service:"+process.argv0}var mgi=Se(()=>{p();a(hgt,"defaultServiceName")});var ggi=Se(()=>{p();mgi()});var Agi=Se(()=>{p();ggi()});var r$,mma,gma,Ama,mgt,ygi=Se(()=>{p();go();hgi();lS();Agi();r$=function(){return r$=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},mgt=(function(){function t(e,r){var n=this,o;this._attributes=e,this.asyncAttributesPending=r!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=r?.then(function(s){return n._attributes=Object.assign({},n._attributes,s),n.asyncAttributesPending=!1,s},function(s){return On.debug("a resource's async attributes promise rejected: %s",s),n.asyncAttributesPending=!1,{}})}return a(t,"Resource"),t.empty=function(){return t.EMPTY},t.default=function(){var e;return new t((e={},e[lgi]=hgt(),e[uvr]=e$[uvr],e[lvr]=e$[lvr],e[dvr]=e$[dvr],e))},Object.defineProperty(t.prototype,"attributes",{get:a(function(){var e;return this.asyncAttributesPending&&On.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}},"get"),enumerable:!1,configurable:!0}),t.prototype.waitForAsyncAttributes=function(){return mma(this,void 0,void 0,function(){return gma(this,function(e){switch(e.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.merge=function(e){var r=this,n;if(!e)return this;var o=r$(r$({},this._syncAttributes),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new t(o);var s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(function(c){var l,u=Ama(c,2),d=u[0],f=u[1];return r$(r$(r$(r$({},r._syncAttributes),d),(l=e._syncAttributes)!==null&&l!==void 0?l:e.attributes),f)});return new t(o,s)},t.EMPTY=new t({}),t})()});var _gi=Se(()=>{p();ygi()});var ggt,fvr,Egi=Se(()=>{p();lS();ggt=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fvr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=ggt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;n.push(c.forceFlush())}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return new Promise(function(l){Promise.all(n).then(function(){l()}).catch(function(u){Fv(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},t.prototype.onStart=function(e,r){var n,o;try{for(var s=ggt(this._spanProcessors),c=s.next();!c.done;c=s.next()){var l=c.value;l.onStart(e,r)}}catch(u){n={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}},t.prototype.onEnd=function(e){var r,n;try{for(var o=ggt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;c.onEnd(e)}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},t.prototype.shutdown=function(){var e,r,n=[];try{for(var o=ggt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;n.push(c.shutdown())}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return new Promise(function(l,u){Promise.all(n).then(function(){l()},u)})},t})()});var Agt,pvr=Se(()=>{p();Agt=(function(){function t(){}return a(t,"NoopSpanProcessor"),t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){},t.prototype.shutdown=function(){return Promise.resolve()},t.prototype.forceFlush=function(){return Promise.resolve()},t})()});var yma,_ma,y6,vgi,Cgi=Se(()=>{p();go();lS();_gi();cvr();svr();Egi();pvr();fgt();avr();yma=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},_ma=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n0?o(c):n()}).catch(function(s){return o([s])})})},t.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},t.prototype._getPropagator=function(e){var r;return(r=this.constructor._registeredPropagators.get(e))===null||r===void 0?void 0:r()},t.prototype._getSpanExporter=function(e){var r;return(r=this.constructor._registeredExporters.get(e))===null||r===void 0?void 0:r()},t.prototype._buildPropagatorFromEnv=function(){var e=this,r=Array.from(new Set(QR().OTEL_PROPAGATORS)),n=r.map(function(s){var c=e._getPropagator(s);return c||On.warn('Propagator "'+s+'" requested through environment variable is unavailable.'),c}),o=n.reduce(function(s,c){return c&&s.push(c),s},[]);if(o.length!==0)return r.length===1?o[0]:new Zmt({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=QR().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||On.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new egt}],["baggage",function(){return new jmt}]]),t._registeredExporters=new Map,t})()});var Ema,bgi,Sgi=Se(()=>{p();lS();Ema=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},bgi=(function(){function t(){}return a(t,"ConsoleSpanExporter"),t.prototype.export=function(e,r){return this._sendSpans(e,r)},t.prototype.shutdown=function(){return this._sendSpans([]),this.forceFlush()},t.prototype.forceFlush=function(){return Promise.resolve()},t.prototype._exportInfo=function(e){var r;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(r=e.spanContext().traceState)===null||r===void 0?void 0:r.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:A5e(e.startTime),duration:A5e(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}},t.prototype._sendSpans=function(e,r){var n,o;try{for(var s=Ema(e),c=s.next();!c.done;c=s.next()){var l=c.value;console.dir(this._exportInfo(l),{depth:3})}}catch(u){n={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}if(r)return r({code:gI.SUCCESS})},t})()});var vma,Cma,Tgi,Igi=Se(()=>{p();lS();vma=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Cma=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();go();lS();bma=function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Sma=function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]t$,AlwaysOnSampler:()=>nL,BasicTracerProvider:()=>vgi,BatchSpanProcessor:()=>N0e,ConsoleSpanExporter:()=>bgi,ForceFlushState:()=>y6,InMemorySpanExporter:()=>Tgi,NoopSpanProcessor:()=>Agt,ParentBasedSampler:()=>P0e,RandomIdGenerator:()=>M0e,SamplingDecision:()=>PD,SimpleSpanProcessor:()=>xgi,Span:()=>agt,TraceIdRatioBasedSampler:()=>T5e,Tracer:()=>pgt});var kgi=Se(()=>{p();cvr();Cgi();fgt();Sgi();Igi();wgi();pvr();cgt();lgt();nvr();ivr();S5e();rvr()});var I5e,Pgi,hvr=Se(()=>{p();I5e=class{static{a(this,"NoopLogger")}emit(e){}},Pgi=new I5e});var mvr,ygt,gvr=Se(()=>{p();hvr();mvr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new I5e}},ygt=new mvr});var _gt,Dgi=Se(()=>{p();hvr();_gt=class{static{a(this,"ProxyLogger")}constructor(e,r,n,o){this._provider=e,this.name=r,this.version=n,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Pgi}}});var x5e,Ngi=Se(()=>{p();gvr();Dgi();x5e=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new _gt(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:ygt}setDelegate(e){this._delegate=e}getDelegateLogger(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,r,n)}}});var Egt,Mgi=Se(()=>{p();Egt=typeof globalThis=="object"?globalThis:global});var Ogi=Se(()=>{p();Mgi()});var Lgi=Se(()=>{p();Ogi()});function Bgi(t,e,r){return n=>n===t?e:r}var w5e,O0e,Avr,Fgi=Se(()=>{p();Lgi();w5e=Symbol.for("io.opentelemetry.js.api.logs"),O0e=Egt;a(Bgi,"makeGetter");Avr=1});var vgt,Ugi=Se(()=>{p();Fgi();gvr();Ngi();vgt=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new x5e}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return O0e[w5e]?this.getLoggerProvider():(O0e[w5e]=Bgi(Avr,e,ygt),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=O0e[w5e])===null||e===void 0?void 0:e.call(O0e,Avr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete O0e[w5e],this._proxyLoggerProvider=new x5e}}});var Cgt,yvr=Se(()=>{p();Ugi();Cgt=vgt.getInstance()});function Qgi(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var jgi=Se(()=>{p();a(Qgi,"enableInstrumentations");a(qgi,"disableInstrumentations")});function Hgi(t){let e=t.tracerProvider||Uu.getTracerProvider(),r=t.meterProvider||yte.getMeterProvider(),n=t.loggerProvider||Cgt.getLoggerProvider(),o=t.instrumentations?.flat()??[];return Qgi(o,e,r,n),()=>{qgi(o)}}var Ggi=Se(()=>{p();go();yvr();jgi();a(Hgi,"registerInstrumentations")});function Kgi(t,e,r){if(!xma(t))return On.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=Pma(t);if(!n)return!1;let o=[],s=Jgi(n,e,o,r);return s&&!r?.includePrerelease?Rma(n,o):s}function xma(t){return typeof t=="string"&&Ygi.test(t)}function Jgi(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(_vr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=Zma(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!_vr(t,s,r,n))return!1;return!0}return _vr(t,e,r,n)}function _vr(t,e,r,n){if(e=kma(e,n),e.includes(" "))return Jgi(t,e,r,n);{let o=Dma(e);return r.push(o),wma(t,o)}}function wma(t,e){if(e.invalid)return!1;if(!e.version||vvr(e.version))return!0;let r=Vgi(t.versionSegments||[],e.versionSegments||[]);if(r===0){let n=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!n.length&&!o.length?r=0:!n.length&&o.length?r=1:n.length&&!o.length?r=-1:r=Vgi(n,o)}return Ima[e.op]?.includes(r)}function Rma(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function kma(t,e){return t=t.trim(),t=Kma(t,e),t=Yma(t),t=Jma(t,e),t=t.trim(),t}function Uv(t){return!t||t.toLowerCase()==="x"||t==="*"}function Pma(t){let e=t.match(Ygi);if(!e){On.error(`Invalid version: ${t}`);return}let r=e.groups.version,n=e.groups.prerelease,o=e.groups.build,s=r.split("."),c=n?.split(".");return{op:void 0,version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:n,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:o}}function Dma(t){if(!t)return{};let e=t.match(Tma);if(!e)return On.error(`Invalid range: ${t}`),{invalid:!0};let r=e.groups.op,n=e.groups.version,o=e.groups.prerelease,s=e.groups.build,c=n.split("."),l=o?.split(".");return r==="=="&&(r="="),{op:r||"=",version:n,versionSegments:c,versionSegmentCount:c.length,prerelease:o,prereleaseSegments:l,prereleaseSegmentCount:l?l.length:0,build:s}}function vvr(t){return t==="*"||t==="x"||t==="X"}function $gi(t){let e=parseInt(t,10);return isNaN(e)?t:e}function Nma(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function Mma(t,e){if(vvr(t)||vvr(e))return 0;let[r,n]=Nma($gi(t),$gi(e));return r>n?1:r{let l;return Uv(n)?l="":Uv(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:Uv(s)?l=`>=${n}.${o}.0 <${n}.${+o+1}.0-0`:c?l=`>=${n}.${o}.${s}-${c} <${n}.${+o+1}.0-0`:l=`>=${n}.${o}.${s} <${n}.${+o+1}.0-0`,l})}function Kma(t,e){let r=zma,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return Uv(s)?d="":Uv(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Uv(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?s==="0"?c==="0"?d=`>=${s}.${c}.${l}-${u} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l}-${u} <${+s+1}.0.0-0`:s==="0"?c==="0"?d=`>=${s}.${c}.${l}${n} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`,d})}function Jma(t,e){let r=Qma;return t.replace(r,(n,o,s,c,l,u)=>{let d=Uv(s),f=d||Uv(c),h=f||Uv(l),m=h;return o==="="&&m&&(o=""),u=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),o==="<"&&(u="-0"),n=`${o+s}.${c}.${l}${u}`):f?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${c}.0${u} <${s}.${+c+1}.0-0`),n})}function Zma(t,e){let r=jma;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(Uv(s)?o="":Uv(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:Uv(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,Uv(h)?f="":Uv(m)?f=`<${+h+1}.0.0-0`:Uv(g)?f=`<${h}.${+m+1}.0-0`:A?f=`<=${h}.${m}.${g}-${A}`:e?.includePrerelease?f=`<${h}.${m}.${+g+1}-0`:f=`<=${f}`,`${o} ${f}`.trim()))}var Ygi,Tma,Ima,Zgi,Xgi,Oma,Lma,Wgi,Bma,zgi,Fma,Evr,R5e,Uma,Qma,qma,jma,Hma,Gma,$ma,Vma,Wma,zma,e0i=Se(()=>{p();go();Ygi=/^(?:v)?(?(?0|[1-9]\d*)\.(?0|[1-9]\d*)\.(?0|[1-9]\d*))(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Tma=/^(?<|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?(?x|X|\*|0|[1-9]\d*)(?:\.(?x|X|\*|0|[1-9]\d*))?(?:\.(?x|X|\*|0|[1-9]\d*))?)(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Ima={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(Kgi,"satisfies");a(xma,"_validateVersion");a(Jgi,"_doSatisfies");a(_vr,"_checkRange");a(wma,"_satisfies");a(Rma,"_doPreleaseCheck");a(kma,"_normalizeRange");a(Uv,"isX");a(Pma,"_parseVersion");a(Dma,"_parseRange");a(vvr,"_isWildcard");a($gi,"_parseVersionString");a(Nma,"_normalizeVersionType");a(Mma,"_compareVersionStrings");a(Vgi,"_compareVersionSegments");Zgi="[a-zA-Z0-9-]",Xgi="0|[1-9]\\d*",Oma=`\\d*[a-zA-Z-]${Zgi}*`,Lma="((?:<|>)?=?)",Wgi=`(?:${Xgi}|${Oma})`,Bma=`(?:-(${Wgi}(?:\\.${Wgi})*))`,zgi=`${Zgi}+`,Fma=`(?:\\+(${zgi}(?:\\.${zgi})*))`,Evr=`${Xgi}|x|X|\\*`,R5e=`[v=\\s]*(${Evr})(?:\\.(${Evr})(?:\\.(${Evr})(?:${Bma})?${Fma}?)?)?`,Uma=`^${Lma}\\s*${R5e}$`,Qma=new RegExp(Uma),qma=`^\\s*(${R5e})\\s+-\\s+(${R5e})\\s*$`,jma=new RegExp(qma),Hma="(?:~>?)",Gma=`^${Hma}${R5e}$`,$ma=new RegExp(Gma),Vma="(?:\\^)",Wma=`^${Vma}${R5e}$`,zma=new RegExp(Wma);a(Yma,"replaceTilde");a(Kma,"replaceCaret");a(Jma,"replaceXRange");a(Zma,"replaceHyphen")});var L0e=I((W_p,n0i)=>{"use strict";p();function Cvr(t){return typeof t=="function"}a(Cvr,"isFunction");var Qv=console.error.bind(console);function k5e(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(k5e,"defineProperty");function P5e(t){t&&t.logger&&(Cvr(t.logger)?Qv=t.logger:Qv("new logger isn't a function, not replacing"))}a(P5e,"shimmer");function t0i(t,e,r){if(!t||!t[e]){Qv("no original function "+e+" to wrap");return}if(!r){Qv("no wrapper function"),Qv(new Error().stack);return}if(!Cvr(t[e])||!Cvr(r)){Qv("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return k5e(o,"__original",n),k5e(o,"__unwrap",function(){t[e]===o&&k5e(t,e,n)}),k5e(o,"__wrapped",!0),k5e(t,e,o),o}a(t0i,"wrap");function Xma(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{Qv("must provide one or more modules to patch"),Qv(new Error().stack);return}if(!(e&&Array.isArray(e))){Qv("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){t0i(n,o,r)})})}a(Xma,"massWrap");function r0i(t,e){if(!t||!t[e]){Qv("no function to unwrap."),Qv(new Error().stack);return}if(!t[e].__unwrap)Qv("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(r0i,"unwrap");function ega(t,e){if(t)Array.isArray(t)||(t=[t]);else{Qv("must provide one or more modules to patch"),Qv(new Error().stack);return}if(!(e&&Array.isArray(e))){Qv("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){r0i(r,n)})})}a(ega,"massUnwrap");P5e.wrap=t0i;P5e.massWrap=Xma;P5e.unwrap=r0i;P5e.massUnwrap=ega;n0i.exports=P5e});var n$,bgt,i0i=Se(()=>{p();go();yvr();n$=fe(L0e()),bgt=class{static{a(this,"InstrumentationAbstract")}instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(n),this._diag=On.createComponentLogger({namespace:e}),this._tracer=Uu.getTracer(e,r),this._meter=yte.getMeter(e,r),this._logger=Cgt.getLogger(e,r),this._updateMetricInstruments()}_wrap=n$.wrap;_unwrap=n$.unwrap;_massWrap=n$.massWrap;_massUnwrap=n$.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,r,n,o){if(e)try{e(n,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},s)}}}});var s0i=I((tEp,o0i)=>{p();var B0e=1e3,F0e=B0e*60,U0e=F0e*60,Cte=U0e*24,tga=Cte*7,rga=Cte*365.25;o0i.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return nga(t);if(r==="number"&&isFinite(t))return e.long?oga(t):iga(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function nga(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*rga;case"weeks":case"week":case"w":return r*tga;case"days":case"day":case"d":return r*Cte;case"hours":case"hour":case"hrs":case"hr":case"h":return r*U0e;case"minutes":case"minute":case"mins":case"min":case"m":return r*F0e;case"seconds":case"second":case"secs":case"sec":case"s":return r*B0e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(nga,"parse");function iga(t){var e=Math.abs(t);return e>=Cte?Math.round(t/Cte)+"d":e>=U0e?Math.round(t/U0e)+"h":e>=F0e?Math.round(t/F0e)+"m":e>=B0e?Math.round(t/B0e)+"s":t+"ms"}a(iga,"fmtShort");function oga(t){var e=Math.abs(t);return e>=Cte?Sgt(t,e,Cte,"day"):e>=U0e?Sgt(t,e,U0e,"hour"):e>=F0e?Sgt(t,e,F0e,"minute"):e>=B0e?Sgt(t,e,B0e,"second"):t+" ms"}a(oga,"fmtLong");function Sgt(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(Sgt,"plural")});var bvr=I((iEp,a0i)=>{p();function sga(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=s0i(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let k=r.formatters[x];if(typeof k=="function"){let D=_[T];R=k.call(E,D),_.splice(T,1),T--}return R}),r.formatArgs.call(E,_),(E.log||r.log).apply(E,_)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(_=>{m=_},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}a(o,"enable");function s(f,h){let m=0,g=0,A=-1,y=0;for(;m"-"+h)].join(",");return r.enable(""),f}a(c,"disable");function l(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}a(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}a(u,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(d,"destroy"),r.enable(r.load()),r}a(sga,"setup");a0i.exports=sga});var c0i=I((uS,Tgt)=>{p();uS.formatArgs=cga;uS.save=lga;uS.load=uga;uS.useColors=aga;uS.storage=dga();uS.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();uS.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function aga(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(aga,"useColors");function cga(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Tgt.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(cga,"formatArgs");uS.log=console.debug||console.log||(()=>{});function lga(t){try{t?uS.storage.setItem("debug",t):uS.storage.removeItem("debug")}catch{}}a(lga,"save");function uga(){let t;try{t=uS.storage.getItem("debug")||uS.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(uga,"load");function dga(){try{return localStorage}catch{}}a(dga,"localstorage");Tgt.exports=bvr()(uS);var{formatters:fga}=Tgt.exports;fga.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var u0i=I((eA,xgt)=>{p();var pga=require("tty"),Igt=require("util");eA.init=Ega;eA.log=Aga;eA.formatArgs=mga;eA.save=yga;eA.load=_ga;eA.useColors=hga;eA.destroy=Igt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");eA.colors=[6,2,3,4,5,1];try{let t=RVe();t&&(t.stderr||t).level>=2&&(eA.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}eA.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function hga(){return"colors"in eA.inspectOpts?!!eA.inspectOpts.colors:pga.isatty(process.stderr.fd)}a(hga,"useColors");function mga(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` `).join(` -`+s),t.push(o+"m+"+Igt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=hga()+e+" "+t[0]}a(pga,"formatArgs");function hga(){return eA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(hga,"getDate");function mga(...t){return process.stderr.write(Tgt.formatWithOptions(eA.inspectOpts,...t)+` -`)}a(mga,"log");function gga(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(gga,"save");function Aga(){return process.env.DEBUG}a(Aga,"load");function yga(t){t.inspectOpts={};let e=Object.keys(eA.inspectOpts);for(let r=0;re.trim()).join(" ")};a0i.O=function(t){return this.inspectOpts.colors=this.useColors,Tgt.inspect(t,this.inspectOpts)}});var l0i=I((aEp,bvr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?bvr.exports=s0i():bvr.exports=c0i()});var Tvr=I((lEp,u0i)=>{"use strict";p();var Svr=require("path").sep;u0i.exports=function(t){var e=t.split(Svr),r=e.lastIndexOf("node_modules");if(r!==-1&&e[r+1]){for(var n=e[r+1][0]==="@",o=n?e[r+1]+"/"+e[r+2]:e[r+1],s=n?3:2,c="",l=r+s-1,u=0;u<=l;u++)u===l?c+=e[u]:c+=e[u]+Svr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+Svr;return{name:o,basedir:c,path:d}}}});var Ivr=I((dEp,d0i)=>{"use strict";p();var _ga=require("os");d0i.exports=_ga.homedir||a(function(){var e=process.env.HOME,r=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform==="darwin"?e||(r?"/Users/"+r:null):process.platform==="linux"?e||(process.getuid()===0?"/root":r?"/home/"+r:null):e||null},"homedir")});var xvr=I((hEp,f0i)=>{p();f0i.exports=function(){var t=Error.prepareStackTrace;Error.prepareStackTrace=function(r,n){return n};var e=new Error().stack;return Error.prepareStackTrace=t,e[2].getFileName()}});var p0i=I((gEp,D5e)=>{"use strict";p();var Ega=process.platform==="win32",vga=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,wvr={};function Cga(t){return vga.exec(t).slice(1)}a(Cga,"win32SplitPath");wvr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Cga(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var bga=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Rvr={};function Sga(t){return bga.exec(t).slice(1)}a(Sga,"posixSplitPath");Rvr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Sga(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};Ega?D5e.exports=wvr.parse:D5e.exports=Rvr.parse;D5e.exports.posix=Rvr.parse;D5e.exports.win32=wvr.parse});var kvr=I((_Ep,A0i)=>{p();var g0i=require("path"),h0i=g0i.parse||p0i(),m0i=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=h0i(e);s.dir!==o[o.length-1];)o.push(s.dir),s=h0i(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return g0i.resolve(n,l,u)}))},[])},"getNodeModulesDirs");A0i.exports=a(function(e,r,n){var o=r&&r.moduleDirectory?[].concat(r.moduleDirectory):["node_modules"];if(r&&typeof r.paths=="function")return r.paths(n,e,function(){return m0i(e,o)},r);var s=m0i(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var Pvr=I((CEp,y0i)=>{p();y0i.exports=function(t,e){return e||{}}});var v0i=I((SEp,E0i)=>{"use strict";p();var Tga="Function.prototype.bind called on incompatible ",Iga=Object.prototype.toString,xga=Math.max,wga="[object Function]",_0i=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var Pga=v0i();C0i.exports=Function.prototype.bind||Pga});var T0i=I((REp,S0i)=>{"use strict";p();var Dga=Function.prototype.call,Nga=Object.prototype.hasOwnProperty,Mga=b0i();S0i.exports=Mga.call(Dga,Nga)});var I0i=I((PEp,Oga)=>{Oga.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var N5e=I((DEp,R0i)=>{"use strict";p();var Lga=T0i();function Bga(t,e){for(var r=t.split("."),n=e.split(" "),o=n.length>1?n[0]:"=",s=(n.length>1?n[1]:n[0]).split("."),c=0;c<3;++c){var l=parseInt(r[c]||0,10),u=parseInt(s[c]||0,10);if(l!==u)return o==="<"?l="?l>=u:!1}return o===">="}a(Bga,"specifierIncluded");function x0i(t,e){var r=e.split(/ ?&& ?/);if(r.length===0)return!1;for(var n=0;n"u"?process.versions&&process.versions.node:t;if(typeof r!="string")throw new TypeError(typeof t>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(e&&typeof e=="object"){for(var n=0;n{p();var Cte=require("fs"),Uga=Ivr(),Dm=require("path"),Qga=xvr(),qga=kvr(),jga=Pvr(),Hga=N5e(),Gga=process.platform!=="win32"&&Cte.realpath&&typeof Cte.realpath.native=="function"?Cte.realpath.native:Cte.realpath,k0i=Uga(),$ga=a(function(){return[Dm.join(k0i,".node_modules"),Dm.join(k0i,".node_libraries")]},"defaultPaths"),Vga=a(function(e,r){Cte.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isFile()||o.isFIFO())})},"isFile"),Wga=a(function(e,r){Cte.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),zga=a(function(e,r){Gga(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),M5e=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),Yga=a(function(e,r,n){e(r,function(o,s){if(o)n(o);else try{var c=JSON.parse(s);n(null,c)}catch{n(null)}})},"defaultReadPackage"),Kga=a(function(e,r,n){for(var o=qga(r,n,e),s=0;s{Jga.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var B0i=I((UEp,L0i)=>{"use strict";p();var Zga=N5e(),M0i=N0i(),O0i={};for(xgt in M0i)Object.prototype.hasOwnProperty.call(M0i,xgt)&&(O0i[xgt]=Zga(xgt));var xgt;L0i.exports=O0i});var U0i=I((qEp,F0i)=>{p();var Xga=N5e();F0i.exports=a(function(e){return Xga(e)},"isCore")});var j0i=I((GEp,q0i)=>{p();var e0a=N5e(),bte=require("fs"),K_=require("path"),t0a=Ivr(),r0a=xvr(),n0a=kvr(),i0a=Pvr(),o0a=process.platform!=="win32"&&bte.realpathSync&&typeof bte.realpathSync.native=="function"?bte.realpathSync.native:bte.realpathSync,Q0i=t0a(),s0a=a(function(){return[K_.join(Q0i,".node_modules"),K_.join(Q0i,".node_libraries")]},"defaultPaths"),a0a=a(function(e){try{var r=bte.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&(r.isFile()||r.isFIFO())},"isFile"),c0a=a(function(e){try{var r=bte.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),l0a=a(function(e){try{return o0a(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),O5e=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),u0a=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),d0a=a(function(e,r,n){for(var o=n0a(r,n,e),s=0;s{p();var wgt=D0i();wgt.core=B0i();wgt.isCore=U0i();wgt.sync=j0i();H0i.exports=wgt});var G0i=I((YEp,f0a)=>{f0a.exports={name:"require-in-the-middle",version:"7.5.2",description:"Module to hook into the Node.js require function",main:"index.js",types:"types/index.d.ts",dependencies:{debug:"^4.3.5","module-details-from-path":"^1.0.3",resolve:"^1.22.8"},devDependencies:{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@babel/preset-typescript":"^7.9.0","@babel/register":"^7.9.0","ipp-printer":"^1.0.0",patterns:"^1.0.3",roundround:"^0.2.0",semver:"^6.3.0",standard:"^14.3.1",tape:"^4.11.0"},scripts:{test:"npm run test:lint && npm run test:tape && npm run test:babel","test:lint":"standard","test:tape":"tape test/*.js","test:babel":"node test/babel/babel-register.js"},repository:{type:"git",url:"git+https://github.com/nodejs/require-in-the-middle.git"},keywords:["require","hook","shim","shimmer","shimming","patch","monkey","monkeypatch","module","load"],files:["types"],author:"Thomas Watson Steen (https://twitter.com/wa7son)",license:"MIT",bugs:{url:"https://github.com/nodejs/require-in-the-middle/issues"},homepage:"https://github.com/nodejs/require-in-the-middle#readme",engines:{node:">=8.6.0"}}});var Lvr=I((KEp,Ovr)=>{"use strict";p();var q0e=require("path"),DD=require("module"),Sh=l0i()("require-in-the-middle"),p0a=Tvr();Ovr.exports=L5e;Ovr.exports.Hook=L5e;var Nvr,Q0e;if(DD.isBuiltin)Q0e=DD.isBuiltin;else if(DD.builtinModules)Q0e=a(t=>t.startsWith("node:")?!0:(Nvr===void 0&&(Nvr=new Set(DD.builtinModules)),Nvr.has(t)),"isCore");else{let t=Dvr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?Q0e=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):Q0e=a(n=>!!t.core[n],"isCore")}var Rgt;function h0a(t,e){if(!Rgt)if(require.resolve&&require.resolve.paths)Rgt=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=Dvr();Rgt=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return Rgt(t,e)}a(h0a,"resolve");var m0a=/([/\\]index)?(\.js)?$/,Mvr=class{static{a(this,"ExportsCache")}constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,r){if(this._localCache.has(e))return!0;if(r)return!1;{let n=require.cache[e];return!!(n&&this._kRitmExports in n)}}get(e,r){let n=this._localCache.get(e);if(n!==void 0)return n;if(!r){let o=require.cache[e];return o&&o[this._kRitmExports]}}set(e,r,n){n?this._localCache.set(e,r):e in require.cache?require.cache[e][this._kRitmExports]=r:(Sh('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function L5e(t,e,r){if(!(this instanceof L5e))return new L5e(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof DD._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof DD._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,G0i().bugs.url);return}this._cache=new Mvr,this._unhooked=!1,this._origRequire=DD.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);Sh("registering require hook"),this._require=DD.prototype.require=function(u){return n._unhooked===!0?(Sh("ignoring require call - module is soft-unhooked"),n._origRequire.apply(this,arguments)):l.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(u){return n._unhooked===!0?(Sh("ignoring process.getBuiltinModule call - module is soft-unhooked"),n._origGetBuiltinModule.apply(this,arguments)):l.call(this,arguments,!0)});function l(u,d){let f=u[0],h=Q0e(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);Q0e(v)&&(m=v)}}else{if(d)return Sh("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=DD._resolveFilename(f,this)}catch(v){return Sh('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(Sh("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return Sh("returning already patched cached module: %s",m),n._cache.get(m,h);let y=o.has(m);y===!1&&o.add(m);let _=d?n._origGetBuiltinModule.apply(this,u):n._origRequire.apply(this,u);if(y===!0)return Sh("module is in the process of being patched already - ignoring: %s",m),_;if(o.delete(m),h===!0){if(c===!0&&t.includes(m)===!1)return Sh("ignoring core module not on whitelist: %s",m),_;g=m}else if(c===!0&&t.includes(m)){let v=q0e.parse(m);g=v.name,A=v.dir}else{let v=p0a(m);if(v===void 0)return Sh("could not parse filename: %s",m),_;g=v.name,A=v.basedir;let S=g0a(v);Sh("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",g,f,S,A);let T=!1;if(c){if(!f.startsWith(".")&&t.includes(f)&&(g=f,T=!0),!t.includes(g)&&!t.includes(S))return _;t.includes(S)&&S!==g&&(g=S,T=!0)}if(!T){let w;try{w=h0a(g,A)}catch{return Sh("could not resolve module: %s",g),n._cache.set(m,_,h),_}if(w!==m)if(s===!0)g=g+q0e.sep+q0e.relative(A,m),Sh("preparing to process require of internal file: %s",g);else return Sh("ignoring require of non-main module file: %s",w),n._cache.set(m,_,h),_}}n._cache.set(m,_,h),Sh("calling require hook: %s",g);let E=r(_,g,A);return n._cache.set(m,E,h),Sh("returning module: %s",g),E}a(l,"patchedRequire")}a(L5e,"Hook");L5e.prototype.unhook=function(){this._unhooked=!0,this._require===DD.prototype.require?(DD.prototype.require=this._origRequire,Sh("require unhook successful")):Sh("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Sh("process.getBuiltinModule unhook successful")):Sh("process.getBuiltinModule unhook unsuccessful"))};function g0a(t){let e=q0e.sep!=="/"?t.path.split(q0e.sep).join("/"):t.path;return q0e.posix.join(t.name,e).replace(m0a,"")}a(g0a,"resolveModuleName")});var kgt,Pgt,$0i=Se(()=>{p();kgt=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},Pgt=class{static{a(this,"ModuleNameTrie")}_trie=new kgt;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new kgt,r.children.set(n,o)),r=o}r.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:r,fullOnly:n}={}){let o=this._trie,s=[],c=!0;for(let l of e.split("/")){let u=o.children.get(l);if(!u){c=!1;break}n||s.push(...u.hooks),o=u}return n&&c&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(r&&s.sort((l,u)=>l.insertedId-u.insertedId),s.map(({hook:l})=>l))}}});function y0a(t){return Bvr.sep!=="/"?t.split(Bvr.sep).join("/"):t}var W0i,Bvr,A0a,Dgt,z0i=Se(()=>{p();W0i=fe(Lvr()),Bvr=fe(require("path"));$0i();A0a=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),Dgt=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new Pgt;static _instance;constructor(){this._initialize()}_initialize(){new W0i.Hook(null,{internals:!0},(e,r,n)=>{let o=y0a(r),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:n===void 0});for(let{onRequire:c}of s)e=c(e,r,n);return e})}register(e,r){let n={moduleName:e,onRequire:r};return this._moduleNameTrie.insert(n),n}static getInstance(){return A0a?new t:this._instance=this._instance??new t}};a(y0a,"normalizePathSeparators")});var eAi=I(Ste=>{p();var Y0i=[],Fvr=new WeakMap,K0i=new WeakMap,J0i=new Map,Z0i=[],_0a={set(t,e,r){return Fvr.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=K0i.get(t)[e];if(typeof r=="function")return r()},defineProperty(t,e,r){if(!("value"in r))throw new Error("Getters/setters are not supported for exports property descriptors.");return Fvr.get(t)[e](r.value)}};function E0a(t,e,r,n,o){J0i.set(t,o),Fvr.set(e,r),K0i.set(e,n);let s=new Proxy(e,_0a);Y0i.forEach(c=>c(t,s)),Z0i.push([t,s])}a(E0a,"register");var X0i=!1;function v0a(){return X0i}a(v0a,"getExperimentalPatchInternals");function C0a(t){X0i=t}a(C0a,"setExperimentalPatchInternals");Ste.register=E0a;Ste.importHooks=Y0i;Ste.specifiers=J0i;Ste.toHook=Z0i;Ste.getExperimentalPatchInternals=v0a;Ste.setExperimentalPatchInternals=C0a});var sAi=I((lvp,j0e)=>{p();var tAi=require("path"),b0a=Tvr(),{fileURLToPath:rAi}=require("url"),{MessageChannel:S0a}=require("worker_threads"),{importHooks:Uvr,specifiers:T0a,toHook:I0a,getExperimentalPatchInternals:x0a}=eAi();function iAi(t){Uvr.push(t),I0a.forEach(([e,r])=>t(e,r))}a(iAi,"addHook");function oAi(t){let e=Uvr.indexOf(t);e>-1&&Uvr.splice(e,1)}a(oAi,"removeHook");function nAi(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(nAi,"callHookFn");var Qvr;function w0a(){let{port1:t,port2:e}=new S0a,r=0,n;Qvr=a(l=>{r++,t.postMessage(l)},"sendModulesToLoader"),t.on("message",()=>{r--,n&&r<=0&&n()}).unref();function o(){let l=setInterval(()=>{},1e3),u=new Promise(d=>{n=d}).then(()=>{clearInterval(l)});return r===0&&n(),u}a(o,"waitForAllMessagesAcknowledged");let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}a(w0a,"createAddHookMessageChannel");function B5e(t,e,r){if(!(this instanceof B5e))return new B5e(t,e,r);typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n=e?e.internals===!0:!1;Qvr&&Array.isArray(t)&&Qvr(t),this._iitmHook=(o,s)=>{let c=o,l=o.startsWith("node:"),u;if(l)o=o.replace(/^node:/,"");else{if(o.startsWith("file://"))try{o=rAi(o)}catch{}let d=b0a(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+tAi.sep+tAi.relative(u,rAi(c));else if(!x0a()&&!u.endsWith(T0a.get(c)))continue}nAi(r,s,o,u)}}else nAi(r,s,o,u)},iAi(this._iitmHook)}a(B5e,"Hook");B5e.prototype.unhook=function(){oAi(this._iitmHook)};j0e.exports=B5e;j0e.exports.Hook=B5e;j0e.exports.addHook=iAi;j0e.exports.removeHook=oAi;j0e.exports.createAddHookMessageChannel=w0a});function aAi(t,e,r){let n,o;try{o=t()}catch(s){n=s}finally{if(e(n,o),n&&!r)throw n;return o}}async function cAi(t,e,r){let n,o;try{o=await t()}catch(s){n=s}finally{if(e(n,o),n&&!r)throw n;return o}}function Ngt(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var qvr=Se(()=>{p();a(aAi,"safeExecuteInTheMiddle");a(cAi,"safeExecuteInTheMiddleAsync");a(Ngt,"isWrapped")});function lAi(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>zgi(e,n,{includePrerelease:r}))}var _6,jvr,F5e,uAi,dAi,fAi,H0e,pAi=Se(()=>{p();_6=fe(require("path")),jvr=require("util");Zgi();F5e=fe(L0e());r0i();z0i();uAi=fe(sAi());go();dAi=fe(Lvr()),fAi=require("fs");qvr();H0e=class extends Cgt{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=Dgt.getInstance();_enabled=!1;constructor(e,r,n){super(e,r,n);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=a((e,r,n)=>{if(Ngt(e[r])&&this._unwrap(e,r),jvr.types.isProxy(e)){let o=(0,F5e.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,F5e.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>jvr.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,F5e.unwrap)(e,r),"_unwrap");_massWrap=a((e,r,n)=>{if(e)Array.isArray(e)||(e=[e]);else{On.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){On.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{r.forEach(s=>{this._wrap(o,s,n)})})},"_massWrap");_massUnwrap=a((e,r)=>{if(e)Array.isArray(e)||(e=[e]);else{On.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){On.error("must provide one or more functions to wrap on modules");return}e.forEach(n=>{r.forEach(o=>{this._unwrap(n,o)})})},"_massUnwrap");_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:r}=e;try{let n=require.resolve(r);require.cache[n]&&this._diag.warn(`Module ${r} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${r}`)}catch{}})}_extractPackageVersion(e){try{let r=(0,fAi.readFileSync)(_6.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{On.warn("Failed extracting version",e)}}_onRequire(e,r,n,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(r)):r;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===n)return lAi(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(r,e.moduleVersion)):r;let c=e.files??[],l=_6.normalize(n);return c.filter(d=>d.name===l).filter(d=>lAi(d.supportedVersions,s,e.includePrerelease)).reduce((d,f)=>(f.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:o}),f.patch(d,e.moduleVersion)):d),r)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.patch(r.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let r=a((c,l,u)=>{if(!u&&_6.isAbsolute(l)){let d=_6.parse(l);l=d.name,u=d.dir}return this._onRequire(e,c,l,u)},"hookFn"),n=a((c,l,u)=>this._onRequire(e,c,l,u),"onRequire"),o=_6.isAbsolute(e.name)?new dAi.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new uAi.Hook([e.name],{internals:!1},r);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.unpatch(r.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};a(lAi,"isSupported")});var U5e,hAi=Se(()=>{p();U5e=require("path")});var mAi=Se(()=>{p();pAi();hAi()});var Hvr=Se(()=>{p();mAi()});var Mgt,gAi=Se(()=>{p();Mgt=class{static{a(this,"InstrumentationNodeModuleDefinition")}name;supportedVersions;patch;unpatch;files;constructor(e,r,n,o,s){this.name=e,this.supportedVersions=r,this.patch=n,this.unpatch=o,this.files=s||[]}}});var Ogt,AAi=Se(()=>{p();Hvr();Ogt=class{static{a(this,"InstrumentationNodeModuleFile")}supportedVersions;patch;unpatch;name;constructor(e,r,n,o){this.supportedVersions=r,this.patch=n,this.unpatch=o,this.name=(0,U5e.normalize)(e)}}});var Gvr={};Ti(Gvr,{InstrumentationBase:()=>H0e,InstrumentationNodeModuleDefinition:()=>Mgt,InstrumentationNodeModuleFile:()=>Ogt,isWrapped:()=>Ngt,registerInstrumentations:()=>qgi,safeExecuteInTheMiddle:()=>aAi,safeExecuteInTheMiddleAsync:()=>cAi});var $vr=Se(()=>{p();jgi();Hvr();gAi();AAi();qvr()});var _Ai=I(Vvr=>{"use strict";p();Object.defineProperty(Vvr,"__esModule",{value:!0});Vvr.log=D0a;var yAi=(Y3(),Wa(jQ)),R0a=require("node:os"),k0a=yAi.__importDefault(require("node:util")),P0a=yAi.__importStar(require("node:process"));function D0a(t,...e){P0a.stderr.write(`${k0a.default.format(t,...e)}${R0a.EOL}`)}a(D0a,"log")});var SAi=I(Jvr=>{"use strict";p();Object.defineProperty(Jvr,"__esModule",{value:!0});var N0a=_Ai(),EAi=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,vAi,Wvr=[],zvr=[],Lgt=[];EAi&&Yvr(EAi);var CAi=Object.assign(t=>bAi(t),{enable:Yvr,enabled:Kvr,disable:M0a,log:N0a.log});function Yvr(t){vAi=t,Wvr=[],zvr=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?zvr.push(new RegExp(`^${n.substr(1)}$`)):Wvr.push(new RegExp(`^${n}$`));for(let n of Lgt)n.enabled=Kvr(n.namespace)}a(Yvr,"enable");function Kvr(t){if(t.endsWith("*"))return!0;for(let e of zvr)if(e.test(t))return!1;for(let e of Wvr)if(e.test(t))return!0;return!1}a(Kvr,"enabled");function M0a(){let t=vAi||"";return Yvr(""),t}a(M0a,"disable");function bAi(t){let e=Object.assign(r,{enabled:Kvr(t),destroy:O0a,log:CAi.log,namespace:t,extend:L0a});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),Lgt.push(e),e}a(bAi,"createDebugger");function O0a(){let t=Lgt.indexOf(this);return t>=0?(Lgt.splice(t,1),!0):!1}a(O0a,"destroy");function L0a(t){let e=bAi(`${this.namespace}:${t}`);return e.log=this.log,e}a(L0a,"extend");Jvr.default=CAi});var Qgt=I(iL=>{"use strict";p();Object.defineProperty(iL,"__esModule",{value:!0});iL.AzureLogger=void 0;iL.setLogLevel=xAi;iL.getLogLevel=F0a;iL.createClientLogger=U0a;var B0a=(Y3(),Wa(jQ)),Q5e=B0a.__importDefault(SAi()),IAi=new Set,Bgt=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,Ugt;iL.AzureLogger=(0,Q5e.default)("azure");iL.AzureLogger.log=(...t)=>{Q5e.default.log(...t)};var Zvr=["verbose","info","warning","error"];Bgt&&(kAi(Bgt)?xAi(Bgt):console.error(`AZURE_LOG_LEVEL set to unknown log level '${Bgt}'; logging is not enabled. Acceptable values: ${Zvr.join(", ")}.`));function xAi(t){if(t&&!kAi(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${Zvr.join(",")}`);Ugt=t;let e=[];for(let r of IAi)RAi(r)&&e.push(r.namespace);Q5e.default.enable(e.join(","))}a(xAi,"setLogLevel");function F0a(){return Ugt}a(F0a,"getLogLevel");var TAi={verbose:400,info:300,warning:200,error:100};function U0a(t){let e=iL.AzureLogger.extend(t);return wAi(iL.AzureLogger,e),{error:Fgt(e,"error"),warning:Fgt(e,"warning"),info:Fgt(e,"info"),verbose:Fgt(e,"verbose")}}a(U0a,"createClientLogger");function wAi(t,e){e.log=(...r)=>{t.log(...r)}}a(wAi,"patchLogMethod");function Fgt(t,e){let r=Object.assign(t.extend(e),{level:e});if(wAi(t,r),RAi(r)){let n=Q5e.default.disable();Q5e.default.enable(n+","+r.namespace)}return IAi.add(r),r}a(Fgt,"createLogger");function RAi(t){return!!(Ugt&&TAi[t.level]<=TAi[Ugt])}a(RAi,"shouldEnable");function kAi(t){return Zvr.includes(t)}a(kAi,"isAzureLogLevel")});var Xvr=I(qgt=>{"use strict";p();Object.defineProperty(qgt,"__esModule",{value:!0});qgt.logger=void 0;var Q0a=Qgt();qgt.logger=(0,Q0a.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function jgt(t){return t.setValue(eCr,!0)}function PAi(t){return t.deleteValue(eCr)}function G0e(t){return t.getValue(eCr)===!0}var eCr,q5e=Se(()=>{p();go();eCr=oS("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(jgt,"suppressTracing");a(PAi,"unsuppressTracing");a(G0e,"isTracingSuppressed")});var Hgt,DAi=Se(()=>{p();Hgt="baggage"});function MAi(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function OAi(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=";"+r.metadata.toString()),n})}function tCr(t){let e=t.split(";");if(e.length<=0)return;let r=e.shift();if(!r)return;let n=r.indexOf("=");if(n<=0)return;let o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=y0e(e.join(";"))),{key:o,value:s,metadata:c}}function LAi(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=tCr(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var rCr=Se(()=>{p();go();a(MAi,"serializeKeyPairs");a(OAi,"getKeyPairs");a(tCr,"parsePairKeyValue");a(LAi,"parseKeyPairsIntoRecord")});var $gt,BAi=Se(()=>{p();go();q5e();DAi();rCr();$gt=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=mI.getBaggage(e);if(!o||G0e(e))return;let s=OAi(o).filter(l=>l.length<=4096).slice(0,180),c=MAi(s);c.length>0&&n.set(r,Hgt,c)}extract(e,r,n){let o=n.get(r,Hgt),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=tCr(u);if(d){let f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0)?e:mI.setBaggage(e,mI.createBaggage(c))}fields(){return[Hgt]}}});var Vgt,FAi=Se(()=>{p();Vgt=class{static{a(this,"AnchoredClock")}_monotonicClock;_epochMillis;_performanceMillis;constructor(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function UAi(t){let e={};if(typeof t!="object"||t==null)return e;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(!H0a(r)){On.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!nCr(n)){On.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function H0a(t){return typeof t=="string"&&t!==""}function nCr(t){return t==null?!0:Array.isArray(t)?G0a(t):QAi(typeof t)}function G0a(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(QAi(n)){e=n;continue}return!1}return!1}}return!0}function QAi(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var qAi=Se(()=>{p();go();a(UAi,"sanitizeAttributes");a(H0a,"isAttributeKey");a(nCr,"isAttributeValue");a(G0a,"isHomogeneousAttributeValueArray");a(QAi,"isValidPrimitiveAttributeValueType")});function Wgt(){return t=>{On.error($0a(t))}}function $0a(t){return typeof t=="string"?t:JSON.stringify(V0a(t))}function V0a(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let o=r[n];o&&(e[n]=String(o))}),r=Object.getPrototypeOf(r);return e}var iCr=Se(()=>{p();go();a(Wgt,"loggingErrorHandler");a($0a,"stringifyException");a(V0a,"flattenException")});function HAi(t){jAi=t}function GAi(t){try{jAi(t)}catch{}}var jAi,$Ai=Se(()=>{p();iCr();jAi=Wgt();a(HAi,"setGlobalErrorHandler");a(GAi,"globalErrorHandler")});function zgt(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){On.warn(`Unknown value ${(0,oCr.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function j5e(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function Ygt(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||On.warn(`Unknown value ${(0,oCr.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function Kgt(t){return j5e(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var oCr,VAi=Se(()=>{p();go();oCr=require("util");a(zgt,"getNumberFromEnv");a(j5e,"getStringFromEnv");a(Ygt,"getBooleanFromEnv");a(Kgt,"getStringListFromEnv")});var Jgt,WAi=Se(()=>{p();Jgt=typeof globalThis=="object"?globalThis:global});var zAi,n$,YAi=Se(()=>{p();zAi=require("perf_hooks"),n$=zAi.performance});var KAi,JAi=Se(()=>{p();KAi="2.2.0"});function Th(t){let e={},r=t.length;for(let n=0;n{p();a(Th,"createConstMap")});var ZAi,XAi,eyi,tyi,ryi,nyi,iyi,oyi,syi,ayi,cyi,lyi,uyi,dyi,fyi,pyi,hyi,myi,gyi,Ayi,yyi,_yi,Eyi,vyi,Cyi,byi,Syi,Tyi,Iyi,xyi,wyi,Ryi,kyi,Pyi,Dyi,Nyi,Myi,Oyi,Lyi,Byi,Fyi,Uyi,Qyi,qyi,jyi,Hyi,Gyi,$yi,Vyi,Wyi,zyi,Yyi,Kyi,Jyi,Zyi,Xyi,e_i,t_i,r_i,n_i,i_i,o_i,s_i,a_i,c_i,l_i,u_i,d_i,f_i,p_i,h_i,m_i,g_i,A_i,y_i,__i,E_i,v_i,C_i,b_i,S_i,T_i,I_i,x_i,w_i,R_i,k_i,P_i,D_i,N_i,M_i,O_i,L_i,B_i,F_i,U_i,Q_i,q_i,j_i,H_i,G_i,$_i,V_i,W_i,z_i,Y_i,K_i,J_i,Z_i,X_i,eEi,tEi,rEi,nEi,iEi,oEi,sEi,aEi,cEi,lEi,uEi,dEi,fEi,pEi,hEi,mEi,gEi,AEi,W0a,z0a,Y0a,K0a,J0a,Z0a,X0a,eAa,tAa,rAa,nAa,iAa,oAa,sAa,aAa,cAa,lAa,uAa,dAa,fAa,pAa,hAa,mAa,gAa,AAa,yAa,_Aa,EAa,vAa,CAa,bAa,SAa,TAa,IAa,xAa,wAa,RAa,kAa,PAa,DAa,NAa,MAa,OAa,LAa,BAa,FAa,UAa,QAa,qAa,jAa,HAa,GAa,$Aa,VAa,WAa,zAa,YAa,KAa,JAa,ZAa,XAa,eya,tya,rya,nya,iya,oya,sya,aya,cya,lya,uya,dya,fya,pya,hya,mya,gya,Aya,yya,_ya,Eya,vya,Cya,bya,Sya,Tya,Iya,xya,wya,Rya,kya,Pya,Dya,Nya,Mya,Oya,Lya,Bya,Fya,Uya,Qya,qya,jya,Hya,Gya,$ya,Vya,Wya,zya,Yya,Kya,Jya,Zya,Xya,e_a,t_a,r_a,n_a,i_a,o_a,s_a,a_a,c_a,l_a,u_a,d_a,f_a,p_a,yEi,_Ei,EEi,vEi,CEi,bEi,SEi,TEi,IEi,xEi,wEi,REi,kEi,PEi,DEi,NEi,MEi,OEi,LEi,BEi,FEi,UEi,QEi,qEi,jEi,HEi,GEi,$Ei,VEi,WEi,zEi,YEi,KEi,JEi,ZEi,XEi,evi,tvi,rvi,nvi,ivi,ovi,svi,avi,cvi,lvi,uvi,h_a,m_a,g_a,A_a,y_a,__a,E_a,v_a,C_a,b_a,S_a,T_a,I_a,x_a,w_a,R_a,k_a,P_a,D_a,N_a,M_a,O_a,L_a,B_a,F_a,U_a,Q_a,q_a,j_a,H_a,G_a,$_a,V_a,W_a,z_a,Y_a,K_a,J_a,Z_a,X_a,eEa,tEa,rEa,nEa,iEa,oEa,sEa,aEa,dvi,fvi,pvi,hvi,mvi,gvi,Avi,yvi,_vi,Evi,vvi,cEa,lEa,uEa,dEa,fEa,pEa,hEa,mEa,gEa,AEa,yEa,_Ea,Cvi,bvi,Svi,Tvi,Ivi,EEa,vEa,CEa,bEa,SEa,TEa,xvi,wvi,Rvi,IEa,xEa,wEa,REa,kvi,Pvi,Dvi,Nvi,kEa,PEa,DEa,NEa,MEa,Mvi,Ovi,Lvi,Bvi,Fvi,Uvi,Qvi,OEa,LEa,BEa,FEa,UEa,QEa,qEa,jEa,qvi,jvi,Hvi,Gvi,$vi,HEa,GEa,$Ea,VEa,WEa,zEa,Vvi,Wvi,zvi,Yvi,Kvi,Jvi,Zvi,Xvi,eCi,tCi,rCi,nCi,iCi,oCi,sCi,aCi,cCi,lCi,uCi,dCi,fCi,YEa,KEa,JEa,ZEa,XEa,eva,tva,rva,nva,iva,ova,sva,ava,cva,lva,uva,dva,fva,pva,hva,mva,gva,pCi,hCi,mCi,gCi,ACi,Ava,yva,_va,Eva,vva,Cva,yCi,_Ci,bva,Sva,Tva,ECi,vCi,Iva,xva,wva,CCi,bCi,SCi,TCi,ICi,xCi,wCi,RCi,kCi,PCi,DCi,NCi,MCi,OCi,LCi,BCi,FCi,Rva,kva,Pva,Dva,Nva,Mva,Ova,Lva,Bva,Fva,Uva,Qva,qva,jva,Hva,Gva,$va,Vva,UCi,QCi,Wva,zva,Yva,qCi=Se(()=>{p();sCr();ZAi="aws.lambda.invoked_arn",XAi="db.system",eyi="db.connection_string",tyi="db.user",ryi="db.jdbc.driver_classname",nyi="db.name",iyi="db.statement",oyi="db.operation",syi="db.mssql.instance_name",ayi="db.cassandra.keyspace",cyi="db.cassandra.page_size",lyi="db.cassandra.consistency_level",uyi="db.cassandra.table",dyi="db.cassandra.idempotence",fyi="db.cassandra.speculative_execution_count",pyi="db.cassandra.coordinator.id",hyi="db.cassandra.coordinator.dc",myi="db.hbase.namespace",gyi="db.redis.database_index",Ayi="db.mongodb.collection",yyi="db.sql.table",_yi="exception.type",Eyi="exception.message",vyi="exception.stacktrace",Cyi="exception.escaped",byi="faas.trigger",Syi="faas.execution",Tyi="faas.document.collection",Iyi="faas.document.operation",xyi="faas.document.time",wyi="faas.document.name",Ryi="faas.time",kyi="faas.cron",Pyi="faas.coldstart",Dyi="faas.invoked_name",Nyi="faas.invoked_provider",Myi="faas.invoked_region",Oyi="net.transport",Lyi="net.peer.ip",Byi="net.peer.port",Fyi="net.peer.name",Uyi="net.host.ip",Qyi="net.host.port",qyi="net.host.name",jyi="net.host.connection.type",Hyi="net.host.connection.subtype",Gyi="net.host.carrier.name",$yi="net.host.carrier.mcc",Vyi="net.host.carrier.mnc",Wyi="net.host.carrier.icc",zyi="peer.service",Yyi="enduser.id",Kyi="enduser.role",Jyi="enduser.scope",Zyi="thread.id",Xyi="thread.name",e_i="code.function",t_i="code.namespace",r_i="code.filepath",n_i="code.lineno",i_i="http.method",o_i="http.url",s_i="http.target",a_i="http.host",c_i="http.scheme",l_i="http.status_code",u_i="http.flavor",d_i="http.user_agent",f_i="http.request_content_length",p_i="http.request_content_length_uncompressed",h_i="http.response_content_length",m_i="http.response_content_length_uncompressed",g_i="http.server_name",A_i="http.route",y_i="http.client_ip",__i="aws.dynamodb.table_names",E_i="aws.dynamodb.consumed_capacity",v_i="aws.dynamodb.item_collection_metrics",C_i="aws.dynamodb.provisioned_read_capacity",b_i="aws.dynamodb.provisioned_write_capacity",S_i="aws.dynamodb.consistent_read",T_i="aws.dynamodb.projection",I_i="aws.dynamodb.limit",x_i="aws.dynamodb.attributes_to_get",w_i="aws.dynamodb.index_name",R_i="aws.dynamodb.select",k_i="aws.dynamodb.global_secondary_indexes",P_i="aws.dynamodb.local_secondary_indexes",D_i="aws.dynamodb.exclusive_start_table",N_i="aws.dynamodb.table_count",M_i="aws.dynamodb.scan_forward",O_i="aws.dynamodb.segment",L_i="aws.dynamodb.total_segments",B_i="aws.dynamodb.count",F_i="aws.dynamodb.scanned_count",U_i="aws.dynamodb.attribute_definitions",Q_i="aws.dynamodb.global_secondary_index_updates",q_i="messaging.system",j_i="messaging.destination",H_i="messaging.destination_kind",G_i="messaging.temp_destination",$_i="messaging.protocol",V_i="messaging.protocol_version",W_i="messaging.url",z_i="messaging.message_id",Y_i="messaging.conversation_id",K_i="messaging.message_payload_size_bytes",J_i="messaging.message_payload_compressed_size_bytes",Z_i="messaging.operation",X_i="messaging.consumer_id",eEi="messaging.rabbitmq.routing_key",tEi="messaging.kafka.message_key",rEi="messaging.kafka.consumer_group",nEi="messaging.kafka.client_id",iEi="messaging.kafka.partition",oEi="messaging.kafka.tombstone",sEi="rpc.system",aEi="rpc.service",cEi="rpc.method",lEi="rpc.grpc.status_code",uEi="rpc.jsonrpc.version",dEi="rpc.jsonrpc.request_id",fEi="rpc.jsonrpc.error_code",pEi="rpc.jsonrpc.error_message",hEi="message.type",mEi="message.id",gEi="message.compressed_size",AEi="message.uncompressed_size",W0a=ZAi,z0a=XAi,Y0a=eyi,K0a=tyi,J0a=ryi,Z0a=nyi,X0a=iyi,eAa=oyi,tAa=syi,rAa=ayi,nAa=cyi,iAa=lyi,oAa=uyi,sAa=dyi,aAa=fyi,cAa=pyi,lAa=hyi,uAa=myi,dAa=gyi,fAa=Ayi,pAa=yyi,hAa=_yi,mAa=Eyi,gAa=vyi,AAa=Cyi,yAa=byi,_Aa=Syi,EAa=Tyi,vAa=Iyi,CAa=xyi,bAa=wyi,SAa=Ryi,TAa=kyi,IAa=Pyi,xAa=Dyi,wAa=Nyi,RAa=Myi,kAa=Oyi,PAa=Lyi,DAa=Byi,NAa=Fyi,MAa=Uyi,OAa=Qyi,LAa=qyi,BAa=jyi,FAa=Hyi,UAa=Gyi,QAa=$yi,qAa=Vyi,jAa=Wyi,HAa=zyi,GAa=Yyi,$Aa=Kyi,VAa=Jyi,WAa=Zyi,zAa=Xyi,YAa=e_i,KAa=t_i,JAa=r_i,ZAa=n_i,XAa=i_i,eya=o_i,tya=s_i,rya=a_i,nya=c_i,iya=l_i,oya=u_i,sya=d_i,aya=f_i,cya=p_i,lya=h_i,uya=m_i,dya=g_i,fya=A_i,pya=y_i,hya=__i,mya=E_i,gya=v_i,Aya=C_i,yya=b_i,_ya=S_i,Eya=T_i,vya=I_i,Cya=x_i,bya=w_i,Sya=R_i,Tya=k_i,Iya=P_i,xya=D_i,wya=N_i,Rya=M_i,kya=O_i,Pya=L_i,Dya=B_i,Nya=F_i,Mya=U_i,Oya=Q_i,Lya=q_i,Bya=j_i,Fya=H_i,Uya=G_i,Qya=$_i,qya=V_i,jya=W_i,Hya=z_i,Gya=Y_i,$ya=K_i,Vya=J_i,Wya=Z_i,zya=X_i,Yya=eEi,Kya=tEi,Jya=rEi,Zya=nEi,Xya=iEi,e_a=oEi,t_a=sEi,r_a=aEi,n_a=cEi,i_a=lEi,o_a=uEi,s_a=dEi,a_a=fEi,c_a=pEi,l_a=hEi,u_a=mEi,d_a=gEi,f_a=AEi,p_a=Th([ZAi,XAi,eyi,tyi,ryi,nyi,iyi,oyi,syi,ayi,cyi,lyi,uyi,dyi,fyi,pyi,hyi,myi,gyi,Ayi,yyi,_yi,Eyi,vyi,Cyi,byi,Syi,Tyi,Iyi,xyi,wyi,Ryi,kyi,Pyi,Dyi,Nyi,Myi,Oyi,Lyi,Byi,Fyi,Uyi,Qyi,qyi,jyi,Hyi,Gyi,$yi,Vyi,Wyi,zyi,Yyi,Kyi,Jyi,Zyi,Xyi,e_i,t_i,r_i,n_i,i_i,o_i,s_i,a_i,c_i,l_i,u_i,d_i,f_i,p_i,h_i,m_i,g_i,A_i,y_i,__i,E_i,v_i,C_i,b_i,S_i,T_i,I_i,x_i,w_i,R_i,k_i,P_i,D_i,N_i,M_i,O_i,L_i,B_i,F_i,U_i,Q_i,q_i,j_i,H_i,G_i,$_i,V_i,W_i,z_i,Y_i,K_i,J_i,Z_i,X_i,eEi,tEi,rEi,nEi,iEi,oEi,sEi,aEi,cEi,lEi,uEi,dEi,fEi,pEi,hEi,mEi,gEi,AEi]),yEi="other_sql",_Ei="mssql",EEi="mysql",vEi="oracle",CEi="db2",bEi="postgresql",SEi="redshift",TEi="hive",IEi="cloudscape",xEi="hsqldb",wEi="progress",REi="maxdb",kEi="hanadb",PEi="ingres",DEi="firstsql",NEi="edb",MEi="cache",OEi="adabas",LEi="firebird",BEi="derby",FEi="filemaker",UEi="informix",QEi="instantdb",qEi="interbase",jEi="mariadb",HEi="netezza",GEi="pervasive",$Ei="pointbase",VEi="sqlite",WEi="sybase",zEi="teradata",YEi="vertica",KEi="h2",JEi="coldfusion",ZEi="cassandra",XEi="hbase",evi="mongodb",tvi="redis",rvi="couchbase",nvi="couchdb",ivi="cosmosdb",ovi="dynamodb",svi="neo4j",avi="geode",cvi="elasticsearch",lvi="memcached",uvi="cockroachdb",h_a=yEi,m_a=_Ei,g_a=EEi,A_a=vEi,y_a=CEi,__a=bEi,E_a=SEi,v_a=TEi,C_a=IEi,b_a=xEi,S_a=wEi,T_a=REi,I_a=kEi,x_a=PEi,w_a=DEi,R_a=NEi,k_a=MEi,P_a=OEi,D_a=LEi,N_a=BEi,M_a=FEi,O_a=UEi,L_a=QEi,B_a=qEi,F_a=jEi,U_a=HEi,Q_a=GEi,q_a=$Ei,j_a=VEi,H_a=WEi,G_a=zEi,$_a=YEi,V_a=KEi,W_a=JEi,z_a=ZEi,Y_a=XEi,K_a=evi,J_a=tvi,Z_a=rvi,X_a=nvi,eEa=ivi,tEa=ovi,rEa=svi,nEa=avi,iEa=cvi,oEa=lvi,sEa=uvi,aEa=Th([yEi,_Ei,EEi,vEi,CEi,bEi,SEi,TEi,IEi,xEi,wEi,REi,kEi,PEi,DEi,NEi,MEi,OEi,LEi,BEi,FEi,UEi,QEi,qEi,jEi,HEi,GEi,$Ei,VEi,WEi,zEi,YEi,KEi,JEi,ZEi,XEi,evi,tvi,rvi,nvi,ivi,ovi,svi,avi,cvi,lvi,uvi]),dvi="all",fvi="each_quorum",pvi="quorum",hvi="local_quorum",mvi="one",gvi="two",Avi="three",yvi="local_one",_vi="any",Evi="serial",vvi="local_serial",cEa=dvi,lEa=fvi,uEa=pvi,dEa=hvi,fEa=mvi,pEa=gvi,hEa=Avi,mEa=yvi,gEa=_vi,AEa=Evi,yEa=vvi,_Ea=Th([dvi,fvi,pvi,hvi,mvi,gvi,Avi,yvi,_vi,Evi,vvi]),Cvi="datasource",bvi="http",Svi="pubsub",Tvi="timer",Ivi="other",EEa=Cvi,vEa=bvi,CEa=Svi,bEa=Tvi,SEa=Ivi,TEa=Th([Cvi,bvi,Svi,Tvi,Ivi]),xvi="insert",wvi="edit",Rvi="delete",IEa=xvi,xEa=wvi,wEa=Rvi,REa=Th([xvi,wvi,Rvi]),kvi="alibaba_cloud",Pvi="aws",Dvi="azure",Nvi="gcp",kEa=kvi,PEa=Pvi,DEa=Dvi,NEa=Nvi,MEa=Th([kvi,Pvi,Dvi,Nvi]),Mvi="ip_tcp",Ovi="ip_udp",Lvi="ip",Bvi="unix",Fvi="pipe",Uvi="inproc",Qvi="other",OEa=Mvi,LEa=Ovi,BEa=Lvi,FEa=Bvi,UEa=Fvi,QEa=Uvi,qEa=Qvi,jEa=Th([Mvi,Ovi,Lvi,Bvi,Fvi,Uvi,Qvi]),qvi="wifi",jvi="wired",Hvi="cell",Gvi="unavailable",$vi="unknown",HEa=qvi,GEa=jvi,$Ea=Hvi,VEa=Gvi,WEa=$vi,zEa=Th([qvi,jvi,Hvi,Gvi,$vi]),Vvi="gprs",Wvi="edge",zvi="umts",Yvi="cdma",Kvi="evdo_0",Jvi="evdo_a",Zvi="cdma2000_1xrtt",Xvi="hsdpa",eCi="hsupa",tCi="hspa",rCi="iden",nCi="evdo_b",iCi="lte",oCi="ehrpd",sCi="hspap",aCi="gsm",cCi="td_scdma",lCi="iwlan",uCi="nr",dCi="nrnsa",fCi="lte_ca",YEa=Vvi,KEa=Wvi,JEa=zvi,ZEa=Yvi,XEa=Kvi,eva=Jvi,tva=Zvi,rva=Xvi,nva=eCi,iva=tCi,ova=rCi,sva=nCi,ava=iCi,cva=oCi,lva=sCi,uva=aCi,dva=cCi,fva=lCi,pva=uCi,hva=dCi,mva=fCi,gva=Th([Vvi,Wvi,zvi,Yvi,Kvi,Jvi,Zvi,Xvi,eCi,tCi,rCi,nCi,iCi,oCi,sCi,aCi,cCi,lCi,uCi,dCi,fCi]),pCi="1.0",hCi="1.1",mCi="2.0",gCi="SPDY",ACi="QUIC",Ava=pCi,yva=hCi,_va=mCi,Eva=gCi,vva=ACi,Cva={HTTP_1_0:pCi,HTTP_1_1:hCi,HTTP_2_0:mCi,SPDY:gCi,QUIC:ACi},yCi="queue",_Ci="topic",bva=yCi,Sva=_Ci,Tva=Th([yCi,_Ci]),ECi="receive",vCi="process",Iva=ECi,xva=vCi,wva=Th([ECi,vCi]),CCi=0,bCi=1,SCi=2,TCi=3,ICi=4,xCi=5,wCi=6,RCi=7,kCi=8,PCi=9,DCi=10,NCi=11,MCi=12,OCi=13,LCi=14,BCi=15,FCi=16,Rva=CCi,kva=bCi,Pva=SCi,Dva=TCi,Nva=ICi,Mva=xCi,Ova=wCi,Lva=RCi,Bva=kCi,Fva=PCi,Uva=DCi,Qva=NCi,qva=MCi,jva=OCi,Hva=LCi,Gva=BCi,$va=FCi,Vva={OK:CCi,CANCELLED:bCi,UNKNOWN:SCi,INVALID_ARGUMENT:TCi,DEADLINE_EXCEEDED:ICi,NOT_FOUND:xCi,ALREADY_EXISTS:wCi,PERMISSION_DENIED:RCi,RESOURCE_EXHAUSTED:kCi,FAILED_PRECONDITION:PCi,ABORTED:DCi,OUT_OF_RANGE:NCi,UNIMPLEMENTED:MCi,INTERNAL:OCi,UNAVAILABLE:LCi,DATA_LOSS:BCi,UNAUTHENTICATED:FCi},UCi="SENT",QCi="RECEIVED",Wva=UCi,zva=QCi,Yva=Th([UCi,QCi])});var jCi=Se(()=>{p();qCi()});var HCi,GCi,$Ci,VCi,WCi,zCi,YCi,KCi,JCi,ZCi,XCi,ebi,tbi,rbi,nbi,ibi,obi,sbi,abi,cbi,lbi,ubi,dbi,fbi,pbi,hbi,mbi,gbi,Abi,ybi,_bi,Ebi,vbi,Cbi,bbi,Sbi,Tbi,Ibi,xbi,wbi,Rbi,kbi,Pbi,Dbi,Nbi,Mbi,Obi,Lbi,Bbi,Fbi,Ubi,Qbi,qbi,jbi,Hbi,Gbi,$bi,Vbi,Wbi,zbi,Ybi,Kbi,Jbi,Zbi,Xbi,eSi,tSi,rSi,nSi,iSi,oSi,sSi,aSi,cSi,lSi,uSi,dSi,fSi,pSi,hSi,mSi,Kva,Jva,Zva,Xva,eCa,tCa,rCa,nCa,iCa,oCa,sCa,aCa,cCa,lCa,uCa,dCa,fCa,pCa,hCa,mCa,gCa,ACa,yCa,_Ca,ECa,vCa,CCa,bCa,SCa,TCa,ICa,xCa,wCa,RCa,kCa,PCa,DCa,NCa,MCa,OCa,LCa,BCa,FCa,UCa,QCa,qCa,jCa,HCa,GCa,$Ca,VCa,WCa,zCa,YCa,KCa,JCa,ZCa,XCa,eba,tba,rba,nba,iba,oba,sba,aba,cba,lba,uba,dba,fba,pba,hba,mba,gba,Aba,yba,_ba,Eba,vba,Cba,bba,gSi,ASi,ySi,_Si,Sba,Tba,Iba,xba,wba,ESi,vSi,CSi,bSi,SSi,TSi,ISi,xSi,wSi,RSi,kSi,PSi,DSi,NSi,MSi,OSi,LSi,Rba,kba,Pba,Dba,Nba,Mba,Oba,Lba,Bba,Fba,Uba,Qba,qba,jba,Hba,Gba,$ba,Vba,BSi,FSi,Wba,zba,Yba,USi,QSi,qSi,jSi,HSi,GSi,$Si,Kba,Jba,Zba,Xba,eSa,tSa,rSa,nSa,VSi,WSi,zSi,YSi,KSi,JSi,ZSi,XSi,e1i,t1i,r1i,iSa,oSa,sSa,aSa,cSa,lSa,uSa,dSa,fSa,pSa,hSa,mSa,n1i,i1i,o1i,s1i,a1i,c1i,l1i,u1i,d1i,f1i,gSa,ASa,ySa,_Sa,ESa,vSa,CSa,bSa,SSa,TSa,ISa,p1i=Se(()=>{p();sCr();HCi="cloud.provider",GCi="cloud.account.id",$Ci="cloud.region",VCi="cloud.availability_zone",WCi="cloud.platform",zCi="aws.ecs.container.arn",YCi="aws.ecs.cluster.arn",KCi="aws.ecs.launchtype",JCi="aws.ecs.task.arn",ZCi="aws.ecs.task.family",XCi="aws.ecs.task.revision",ebi="aws.eks.cluster.arn",tbi="aws.log.group.names",rbi="aws.log.group.arns",nbi="aws.log.stream.names",ibi="aws.log.stream.arns",obi="container.name",sbi="container.id",abi="container.runtime",cbi="container.image.name",lbi="container.image.tag",ubi="deployment.environment",dbi="device.id",fbi="device.model.identifier",pbi="device.model.name",hbi="faas.name",mbi="faas.id",gbi="faas.version",Abi="faas.instance",ybi="faas.max_memory",_bi="host.id",Ebi="host.name",vbi="host.type",Cbi="host.arch",bbi="host.image.name",Sbi="host.image.id",Tbi="host.image.version",Ibi="k8s.cluster.name",xbi="k8s.node.name",wbi="k8s.node.uid",Rbi="k8s.namespace.name",kbi="k8s.pod.uid",Pbi="k8s.pod.name",Dbi="k8s.container.name",Nbi="k8s.replicaset.uid",Mbi="k8s.replicaset.name",Obi="k8s.deployment.uid",Lbi="k8s.deployment.name",Bbi="k8s.statefulset.uid",Fbi="k8s.statefulset.name",Ubi="k8s.daemonset.uid",Qbi="k8s.daemonset.name",qbi="k8s.job.uid",jbi="k8s.job.name",Hbi="k8s.cronjob.uid",Gbi="k8s.cronjob.name",$bi="os.type",Vbi="os.description",Wbi="os.name",zbi="os.version",Ybi="process.pid",Kbi="process.executable.name",Jbi="process.executable.path",Zbi="process.command",Xbi="process.command_line",eSi="process.command_args",tSi="process.owner",rSi="process.runtime.name",nSi="process.runtime.version",iSi="process.runtime.description",oSi="service.name",sSi="service.namespace",aSi="service.instance.id",cSi="service.version",lSi="telemetry.sdk.name",uSi="telemetry.sdk.language",dSi="telemetry.sdk.version",fSi="telemetry.auto.version",pSi="webengine.name",hSi="webengine.version",mSi="webengine.description",Kva=HCi,Jva=GCi,Zva=$Ci,Xva=VCi,eCa=WCi,tCa=zCi,rCa=YCi,nCa=KCi,iCa=JCi,oCa=ZCi,sCa=XCi,aCa=ebi,cCa=tbi,lCa=rbi,uCa=nbi,dCa=ibi,fCa=obi,pCa=sbi,hCa=abi,mCa=cbi,gCa=lbi,ACa=ubi,yCa=dbi,_Ca=fbi,ECa=pbi,vCa=hbi,CCa=mbi,bCa=gbi,SCa=Abi,TCa=ybi,ICa=_bi,xCa=Ebi,wCa=vbi,RCa=Cbi,kCa=bbi,PCa=Sbi,DCa=Tbi,NCa=Ibi,MCa=xbi,OCa=wbi,LCa=Rbi,BCa=kbi,FCa=Pbi,UCa=Dbi,QCa=Nbi,qCa=Mbi,jCa=Obi,HCa=Lbi,GCa=Bbi,$Ca=Fbi,VCa=Ubi,WCa=Qbi,zCa=qbi,YCa=jbi,KCa=Hbi,JCa=Gbi,ZCa=$bi,XCa=Vbi,eba=Wbi,tba=zbi,rba=Ybi,nba=Kbi,iba=Jbi,oba=Zbi,sba=Xbi,aba=eSi,cba=tSi,lba=rSi,uba=nSi,dba=iSi,fba=oSi,pba=sSi,hba=aSi,mba=cSi,gba=lSi,Aba=uSi,yba=dSi,_ba=fSi,Eba=pSi,vba=hSi,Cba=mSi,bba=Th([HCi,GCi,$Ci,VCi,WCi,zCi,YCi,KCi,JCi,ZCi,XCi,ebi,tbi,rbi,nbi,ibi,obi,sbi,abi,cbi,lbi,ubi,dbi,fbi,pbi,hbi,mbi,gbi,Abi,ybi,_bi,Ebi,vbi,Cbi,bbi,Sbi,Tbi,Ibi,xbi,wbi,Rbi,kbi,Pbi,Dbi,Nbi,Mbi,Obi,Lbi,Bbi,Fbi,Ubi,Qbi,qbi,jbi,Hbi,Gbi,$bi,Vbi,Wbi,zbi,Ybi,Kbi,Jbi,Zbi,Xbi,eSi,tSi,rSi,nSi,iSi,oSi,sSi,aSi,cSi,lSi,uSi,dSi,fSi,pSi,hSi,mSi]),gSi="alibaba_cloud",ASi="aws",ySi="azure",_Si="gcp",Sba=gSi,Tba=ASi,Iba=ySi,xba=_Si,wba=Th([gSi,ASi,ySi,_Si]),ESi="alibaba_cloud_ecs",vSi="alibaba_cloud_fc",CSi="aws_ec2",bSi="aws_ecs",SSi="aws_eks",TSi="aws_lambda",ISi="aws_elastic_beanstalk",xSi="azure_vm",wSi="azure_container_instances",RSi="azure_aks",kSi="azure_functions",PSi="azure_app_service",DSi="gcp_compute_engine",NSi="gcp_cloud_run",MSi="gcp_kubernetes_engine",OSi="gcp_cloud_functions",LSi="gcp_app_engine",Rba=ESi,kba=vSi,Pba=CSi,Dba=bSi,Nba=SSi,Mba=TSi,Oba=ISi,Lba=xSi,Bba=wSi,Fba=RSi,Uba=kSi,Qba=PSi,qba=DSi,jba=NSi,Hba=MSi,Gba=OSi,$ba=LSi,Vba=Th([ESi,vSi,CSi,bSi,SSi,TSi,ISi,xSi,wSi,RSi,kSi,PSi,DSi,NSi,MSi,OSi,LSi]),BSi="ec2",FSi="fargate",Wba=BSi,zba=FSi,Yba=Th([BSi,FSi]),USi="amd64",QSi="arm32",qSi="arm64",jSi="ia64",HSi="ppc32",GSi="ppc64",$Si="x86",Kba=USi,Jba=QSi,Zba=qSi,Xba=jSi,eSa=HSi,tSa=GSi,rSa=$Si,nSa=Th([USi,QSi,qSi,jSi,HSi,GSi,$Si]),VSi="windows",WSi="linux",zSi="darwin",YSi="freebsd",KSi="netbsd",JSi="openbsd",ZSi="dragonflybsd",XSi="hpux",e1i="aix",t1i="solaris",r1i="z_os",iSa=VSi,oSa=WSi,sSa=zSi,aSa=YSi,cSa=KSi,lSa=JSi,uSa=ZSi,dSa=XSi,fSa=e1i,pSa=t1i,hSa=r1i,mSa=Th([VSi,WSi,zSi,YSi,KSi,JSi,ZSi,XSi,e1i,t1i,r1i]),n1i="cpp",i1i="dotnet",o1i="erlang",s1i="go",a1i="java",c1i="nodejs",l1i="php",u1i="python",d1i="ruby",f1i="webjs",gSa=n1i,ASa=i1i,ySa=o1i,_Sa=s1i,ESa=a1i,vSa=c1i,CSa=l1i,bSa=u1i,SSa=d1i,TSa=f1i,ISa=Th([n1i,i1i,o1i,s1i,a1i,c1i,l1i,u1i,d1i,f1i])});var h1i=Se(()=>{p();p1i()});var xSa,wSa,RSa,kSa,PSa,DSa,NSa,MSa,OSa,LSa,BSa,FSa,USa,QSa,qSa,jSa,HSa,GSa,$Sa,VSa,WSa,zSa,YSa,KSa,JSa,ZSa,XSa,e1a,t1a,r1a,n1a,i1a,o1a,s1a,a1a,c1a,l1a,u1a,d1a,f1a,p1a,h1a,abp,cbp,m1a,g1a,A1a,y1a,_1a,E1a,v1a,C1a,b1a,S1a,T1a,I1a,x1a,w1a,R1a,k1a,P1a,D1a,N1a,M1a,O1a,L1a,B1a,F1a,U1a,Q1a,q1a,j1a,H1a,G1a,$1a,V1a,W1a,z1a,Y1a,K1a,J1a,Z1a,X1a,eTa,tTa,rTa,nTa,iTa,oTa,sTa,aTa,cTa,lTa,uTa,dTa,fTa,pTa,hTa,mTa,gTa,ATa,yTa,_Ta,ETa,vTa,CTa,bTa,STa,TTa,ITa,xTa,wTa,RTa,kTa,aCr,PTa,DTa,NTa,MTa,OTa,cCr,LTa,BTa,FTa,UTa,QTa,qTa,lCr,uCr,jTa,HTa,GTa,$Ta,VTa,WTa,m1i=Se(()=>{p();xSa="aspnetcore.diagnostics.exception.result",wSa="aborted",RSa="handled",kSa="skipped",PSa="unhandled",DSa="aspnetcore.diagnostics.handler.type",NSa="aspnetcore.rate_limiting.policy",MSa="aspnetcore.rate_limiting.result",OSa="acquired",LSa="endpoint_limiter",BSa="global_limiter",FSa="request_canceled",USa="aspnetcore.request.is_unhandled",QSa="aspnetcore.routing.is_fallback",qSa="aspnetcore.routing.match_status",jSa="failure",HSa="success",GSa="aspnetcore.user.is_authenticated",$Sa="client.address",VSa="client.port",WSa="code.column.number",zSa="code.file.path",YSa="code.function.name",KSa="code.line.number",JSa="code.stacktrace",ZSa="db.collection.name",XSa="db.namespace",e1a="db.operation.batch.size",t1a="db.operation.name",r1a="db.query.summary",n1a="db.query.text",i1a="db.response.status_code",o1a="db.stored_procedure.name",s1a="db.system.name",a1a="mariadb",c1a="microsoft.sql_server",l1a="mysql",u1a="postgresql",d1a="dotnet.gc.heap.generation",f1a="gen0",p1a="gen1",h1a="gen2",abp="loh",cbp="poh",m1a="error.type",g1a="_OTHER",A1a="exception.escaped",y1a="exception.message",_1a="exception.stacktrace",E1a="exception.type",v1a=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),C1a="http.request.method",b1a="_OTHER",S1a="CONNECT",T1a="DELETE",I1a="GET",x1a="HEAD",w1a="OPTIONS",R1a="PATCH",k1a="POST",P1a="PUT",D1a="TRACE",N1a="http.request.method_original",M1a="http.request.resend_count",O1a=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),L1a="http.response.status_code",B1a="http.route",F1a="jvm.gc.action",U1a="jvm.gc.name",Q1a="jvm.memory.pool.name",q1a="jvm.memory.type",j1a="heap",H1a="non_heap",G1a="jvm.thread.daemon",$1a="jvm.thread.state",V1a="blocked",W1a="new",z1a="runnable",Y1a="terminated",K1a="timed_waiting",J1a="waiting",Z1a="network.local.address",X1a="network.local.port",eTa="network.peer.address",tTa="network.peer.port",rTa="network.protocol.name",nTa="network.protocol.version",iTa="network.transport",oTa="pipe",sTa="quic",aTa="tcp",cTa="udp",lTa="unix",uTa="network.type",dTa="ipv4",fTa="ipv6",pTa="otel.scope.name",hTa="otel.scope.version",mTa="otel.status_code",gTa="ERROR",ATa="OK",yTa="otel.status_description",_Ta="server.address",ETa="server.port",vTa="service.name",CTa="service.version",bTa="signalr.connection.status",STa="app_shutdown",TTa="normal_closure",ITa="timeout",xTa="signalr.transport",wTa="long_polling",RTa="server_sent_events",kTa="web_sockets",aCr="telemetry.sdk.language",PTa="cpp",DTa="dotnet",NTa="erlang",MTa="go",OTa="java",cCr="nodejs",LTa="php",BTa="python",FTa="ruby",UTa="rust",QTa="swift",qTa="webjs",lCr="telemetry.sdk.name",uCr="telemetry.sdk.version",jTa="url.fragment",HTa="url.full",GTa="url.path",$Ta="url.query",VTa="url.scheme",WTa="user_agent.original"});var zTa,YTa,KTa,JTa,ZTa,XTa,eIa,tIa,rIa,nIa,iIa,oIa,sIa,aIa,cIa,lIa,uIa,dIa,fIa,pIa,hIa,mIa,gIa,AIa,yIa,_Ia,EIa,vIa,CIa,bIa,SIa,TIa,IIa,xIa,wIa,RIa,kIa,PIa,DIa,NIa,MIa,OIa,LIa,BIa,FIa,UIa,QIa,qIa,jIa,HIa,GIa,g1i=Se(()=>{p();zTa="aspnetcore.diagnostics.exceptions",YTa="aspnetcore.rate_limiting.active_request_leases",KTa="aspnetcore.rate_limiting.queued_requests",JTa="aspnetcore.rate_limiting.request.time_in_queue",ZTa="aspnetcore.rate_limiting.request_lease.duration",XTa="aspnetcore.rate_limiting.requests",eIa="aspnetcore.routing.match_attempts",tIa="db.client.operation.duration",rIa="dotnet.assembly.count",nIa="dotnet.exceptions",iIa="dotnet.gc.collections",oIa="dotnet.gc.heap.total_allocated",sIa="dotnet.gc.last_collection.heap.fragmentation.size",aIa="dotnet.gc.last_collection.heap.size",cIa="dotnet.gc.last_collection.memory.committed_size",lIa="dotnet.gc.pause.time",uIa="dotnet.jit.compilation.time",dIa="dotnet.jit.compiled_il.size",fIa="dotnet.jit.compiled_methods",pIa="dotnet.monitor.lock_contentions",hIa="dotnet.process.cpu.count",mIa="dotnet.process.cpu.time",gIa="dotnet.process.memory.working_set",AIa="dotnet.thread_pool.queue.length",yIa="dotnet.thread_pool.thread.count",_Ia="dotnet.thread_pool.work_item.count",EIa="dotnet.timer.count",vIa="http.client.request.duration",CIa="http.server.request.duration",bIa="jvm.class.count",SIa="jvm.class.loaded",TIa="jvm.class.unloaded",IIa="jvm.cpu.count",xIa="jvm.cpu.recent_utilization",wIa="jvm.cpu.time",RIa="jvm.gc.duration",kIa="jvm.memory.committed",PIa="jvm.memory.limit",DIa="jvm.memory.used",NIa="jvm.memory.used_after_last_gc",MIa="jvm.thread.count",OIa="kestrel.active_connections",LIa="kestrel.active_tls_handshakes",BIa="kestrel.connection.duration",FIa="kestrel.queued_connections",UIa="kestrel.queued_requests",QIa="kestrel.rejected_connections",qIa="kestrel.tls_handshake.duration",jIa="kestrel.upgraded_connections",HIa="signalr.server.active_connections",GIa="signalr.server.connection.duration"});var $Ia,A1i=Se(()=>{p();$Ia="exception"});var dCr={};Ti(dCr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>wSa,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>RSa,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>kSa,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>PSa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>OSa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>LSa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>BSa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>FSa,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>jSa,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>HSa,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>xSa,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>DSa,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>NSa,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>MSa,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>USa,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>QSa,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>qSa,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>GSa,ATTR_CLIENT_ADDRESS:()=>$Sa,ATTR_CLIENT_PORT:()=>VSa,ATTR_CODE_COLUMN_NUMBER:()=>WSa,ATTR_CODE_FILE_PATH:()=>zSa,ATTR_CODE_FUNCTION_NAME:()=>YSa,ATTR_CODE_LINE_NUMBER:()=>KSa,ATTR_CODE_STACKTRACE:()=>JSa,ATTR_DB_COLLECTION_NAME:()=>ZSa,ATTR_DB_NAMESPACE:()=>XSa,ATTR_DB_OPERATION_BATCH_SIZE:()=>e1a,ATTR_DB_OPERATION_NAME:()=>t1a,ATTR_DB_QUERY_SUMMARY:()=>r1a,ATTR_DB_QUERY_TEXT:()=>n1a,ATTR_DB_RESPONSE_STATUS_CODE:()=>i1a,ATTR_DB_STORED_PROCEDURE_NAME:()=>o1a,ATTR_DB_SYSTEM_NAME:()=>s1a,ATTR_DOTNET_GC_HEAP_GENERATION:()=>d1a,ATTR_ERROR_TYPE:()=>m1a,ATTR_EXCEPTION_ESCAPED:()=>A1a,ATTR_EXCEPTION_MESSAGE:()=>y1a,ATTR_EXCEPTION_STACKTRACE:()=>_1a,ATTR_EXCEPTION_TYPE:()=>E1a,ATTR_HTTP_REQUEST_HEADER:()=>v1a,ATTR_HTTP_REQUEST_METHOD:()=>C1a,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>N1a,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>M1a,ATTR_HTTP_RESPONSE_HEADER:()=>O1a,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>L1a,ATTR_HTTP_ROUTE:()=>B1a,ATTR_JVM_GC_ACTION:()=>F1a,ATTR_JVM_GC_NAME:()=>U1a,ATTR_JVM_MEMORY_POOL_NAME:()=>Q1a,ATTR_JVM_MEMORY_TYPE:()=>q1a,ATTR_JVM_THREAD_DAEMON:()=>G1a,ATTR_JVM_THREAD_STATE:()=>$1a,ATTR_NETWORK_LOCAL_ADDRESS:()=>Z1a,ATTR_NETWORK_LOCAL_PORT:()=>X1a,ATTR_NETWORK_PEER_ADDRESS:()=>eTa,ATTR_NETWORK_PEER_PORT:()=>tTa,ATTR_NETWORK_PROTOCOL_NAME:()=>rTa,ATTR_NETWORK_PROTOCOL_VERSION:()=>nTa,ATTR_NETWORK_TRANSPORT:()=>iTa,ATTR_NETWORK_TYPE:()=>uTa,ATTR_OTEL_SCOPE_NAME:()=>pTa,ATTR_OTEL_SCOPE_VERSION:()=>hTa,ATTR_OTEL_STATUS_CODE:()=>mTa,ATTR_OTEL_STATUS_DESCRIPTION:()=>yTa,ATTR_SERVER_ADDRESS:()=>_Ta,ATTR_SERVER_PORT:()=>ETa,ATTR_SERVICE_NAME:()=>vTa,ATTR_SERVICE_VERSION:()=>CTa,ATTR_SIGNALR_CONNECTION_STATUS:()=>bTa,ATTR_SIGNALR_TRANSPORT:()=>xTa,ATTR_TELEMETRY_SDK_LANGUAGE:()=>aCr,ATTR_TELEMETRY_SDK_NAME:()=>lCr,ATTR_TELEMETRY_SDK_VERSION:()=>uCr,ATTR_URL_FRAGMENT:()=>jTa,ATTR_URL_FULL:()=>HTa,ATTR_URL_PATH:()=>GTa,ATTR_URL_QUERY:()=>$Ta,ATTR_URL_SCHEME:()=>VTa,ATTR_USER_AGENT_ORIGINAL:()=>WTa,AWSECSLAUNCHTYPEVALUES_EC2:()=>Wba,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>zba,AwsEcsLaunchtypeValues:()=>Yba,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Rba,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>kba,CLOUDPLATFORMVALUES_AWS_EC2:()=>Pba,CLOUDPLATFORMVALUES_AWS_ECS:()=>Dba,CLOUDPLATFORMVALUES_AWS_EKS:()=>Nba,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>Oba,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Mba,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Fba,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>Qba,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>Bba,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>Uba,CLOUDPLATFORMVALUES_AZURE_VM:()=>Lba,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>$ba,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Gba,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>jba,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>qba,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Hba,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Sba,CLOUDPROVIDERVALUES_AWS:()=>Tba,CLOUDPROVIDERVALUES_AZURE:()=>Iba,CLOUDPROVIDERVALUES_GCP:()=>xba,CloudPlatformValues:()=>Vba,CloudProviderValues:()=>wba,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>cEa,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>gEa,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>lEa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>mEa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>dEa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>yEa,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>fEa,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>uEa,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>AEa,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>hEa,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>pEa,DBSYSTEMVALUES_ADABAS:()=>P_a,DBSYSTEMVALUES_CACHE:()=>k_a,DBSYSTEMVALUES_CASSANDRA:()=>z_a,DBSYSTEMVALUES_CLOUDSCAPE:()=>C_a,DBSYSTEMVALUES_COCKROACHDB:()=>sEa,DBSYSTEMVALUES_COLDFUSION:()=>W_a,DBSYSTEMVALUES_COSMOSDB:()=>eEa,DBSYSTEMVALUES_COUCHBASE:()=>Z_a,DBSYSTEMVALUES_COUCHDB:()=>X_a,DBSYSTEMVALUES_DB2:()=>y_a,DBSYSTEMVALUES_DERBY:()=>N_a,DBSYSTEMVALUES_DYNAMODB:()=>tEa,DBSYSTEMVALUES_EDB:()=>R_a,DBSYSTEMVALUES_ELASTICSEARCH:()=>iEa,DBSYSTEMVALUES_FILEMAKER:()=>M_a,DBSYSTEMVALUES_FIREBIRD:()=>D_a,DBSYSTEMVALUES_FIRSTSQL:()=>w_a,DBSYSTEMVALUES_GEODE:()=>nEa,DBSYSTEMVALUES_H2:()=>V_a,DBSYSTEMVALUES_HANADB:()=>I_a,DBSYSTEMVALUES_HBASE:()=>Y_a,DBSYSTEMVALUES_HIVE:()=>v_a,DBSYSTEMVALUES_HSQLDB:()=>b_a,DBSYSTEMVALUES_INFORMIX:()=>O_a,DBSYSTEMVALUES_INGRES:()=>x_a,DBSYSTEMVALUES_INSTANTDB:()=>L_a,DBSYSTEMVALUES_INTERBASE:()=>B_a,DBSYSTEMVALUES_MARIADB:()=>F_a,DBSYSTEMVALUES_MAXDB:()=>T_a,DBSYSTEMVALUES_MEMCACHED:()=>oEa,DBSYSTEMVALUES_MONGODB:()=>K_a,DBSYSTEMVALUES_MSSQL:()=>m_a,DBSYSTEMVALUES_MYSQL:()=>g_a,DBSYSTEMVALUES_NEO4J:()=>rEa,DBSYSTEMVALUES_NETEZZA:()=>U_a,DBSYSTEMVALUES_ORACLE:()=>A_a,DBSYSTEMVALUES_OTHER_SQL:()=>h_a,DBSYSTEMVALUES_PERVASIVE:()=>Q_a,DBSYSTEMVALUES_POINTBASE:()=>q_a,DBSYSTEMVALUES_POSTGRESQL:()=>__a,DBSYSTEMVALUES_PROGRESS:()=>S_a,DBSYSTEMVALUES_REDIS:()=>J_a,DBSYSTEMVALUES_REDSHIFT:()=>E_a,DBSYSTEMVALUES_SQLITE:()=>j_a,DBSYSTEMVALUES_SYBASE:()=>H_a,DBSYSTEMVALUES_TERADATA:()=>G_a,DBSYSTEMVALUES_VERTICA:()=>$_a,DB_SYSTEM_NAME_VALUE_MARIADB:()=>a1a,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>c1a,DB_SYSTEM_NAME_VALUE_MYSQL:()=>l1a,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>u1a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>f1a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>p1a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>h1a,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>abp,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>cbp,DbCassandraConsistencyLevelValues:()=>_Ea,DbSystemValues:()=>aEa,ERROR_TYPE_VALUE_OTHER:()=>g1a,EVENT_EXCEPTION:()=>$Ia,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>wEa,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>xEa,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>IEa,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>kEa,FAASINVOKEDPROVIDERVALUES_AWS:()=>PEa,FAASINVOKEDPROVIDERVALUES_AZURE:()=>DEa,FAASINVOKEDPROVIDERVALUES_GCP:()=>NEa,FAASTRIGGERVALUES_DATASOURCE:()=>EEa,FAASTRIGGERVALUES_HTTP:()=>vEa,FAASTRIGGERVALUES_OTHER:()=>SEa,FAASTRIGGERVALUES_PUBSUB:()=>CEa,FAASTRIGGERVALUES_TIMER:()=>bEa,FaasDocumentOperationValues:()=>REa,FaasInvokedProviderValues:()=>MEa,FaasTriggerValues:()=>TEa,HOSTARCHVALUES_AMD64:()=>Kba,HOSTARCHVALUES_ARM32:()=>Jba,HOSTARCHVALUES_ARM64:()=>Zba,HOSTARCHVALUES_IA64:()=>Xba,HOSTARCHVALUES_PPC32:()=>eSa,HOSTARCHVALUES_PPC64:()=>tSa,HOSTARCHVALUES_X86:()=>rSa,HTTPFLAVORVALUES_HTTP_1_0:()=>Ava,HTTPFLAVORVALUES_HTTP_1_1:()=>yva,HTTPFLAVORVALUES_HTTP_2_0:()=>_va,HTTPFLAVORVALUES_QUIC:()=>vva,HTTPFLAVORVALUES_SPDY:()=>Eva,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>S1a,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>T1a,HTTP_REQUEST_METHOD_VALUE_GET:()=>I1a,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>x1a,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>w1a,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>b1a,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>R1a,HTTP_REQUEST_METHOD_VALUE_POST:()=>k1a,HTTP_REQUEST_METHOD_VALUE_PUT:()=>P1a,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>D1a,HostArchValues:()=>nSa,HttpFlavorValues:()=>Cva,JVM_MEMORY_TYPE_VALUE_HEAP:()=>j1a,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>H1a,JVM_THREAD_STATE_VALUE_BLOCKED:()=>V1a,JVM_THREAD_STATE_VALUE_NEW:()=>W1a,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>z1a,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Y1a,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>K1a,JVM_THREAD_STATE_VALUE_WAITING:()=>J1a,MESSAGETYPEVALUES_RECEIVED:()=>zva,MESSAGETYPEVALUES_SENT:()=>Wva,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>bva,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Sva,MESSAGINGOPERATIONVALUES_PROCESS:()=>xva,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Iva,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>zTa,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>YTa,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>KTa,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>XTa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>ZTa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>JTa,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>eIa,METRIC_DB_CLIENT_OPERATION_DURATION:()=>tIa,METRIC_DOTNET_ASSEMBLY_COUNT:()=>rIa,METRIC_DOTNET_EXCEPTIONS:()=>nIa,METRIC_DOTNET_GC_COLLECTIONS:()=>iIa,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>oIa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>sIa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>aIa,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>cIa,METRIC_DOTNET_GC_PAUSE_TIME:()=>lIa,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>uIa,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>dIa,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>fIa,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>pIa,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>hIa,METRIC_DOTNET_PROCESS_CPU_TIME:()=>mIa,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>gIa,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>AIa,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>yIa,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>_Ia,METRIC_DOTNET_TIMER_COUNT:()=>EIa,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>vIa,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>CIa,METRIC_JVM_CLASS_COUNT:()=>bIa,METRIC_JVM_CLASS_LOADED:()=>SIa,METRIC_JVM_CLASS_UNLOADED:()=>TIa,METRIC_JVM_CPU_COUNT:()=>IIa,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>xIa,METRIC_JVM_CPU_TIME:()=>wIa,METRIC_JVM_GC_DURATION:()=>RIa,METRIC_JVM_MEMORY_COMMITTED:()=>kIa,METRIC_JVM_MEMORY_LIMIT:()=>PIa,METRIC_JVM_MEMORY_USED:()=>DIa,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>NIa,METRIC_JVM_THREAD_COUNT:()=>MIa,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>OIa,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>LIa,METRIC_KESTREL_CONNECTION_DURATION:()=>BIa,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>FIa,METRIC_KESTREL_QUEUED_REQUESTS:()=>UIa,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>QIa,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>qIa,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>jIa,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>HIa,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>GIa,MessageTypeValues:()=>Yva,MessagingDestinationKindValues:()=>Tva,MessagingOperationValues:()=>wva,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>ZEa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>tva,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>KEa,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>cva,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>XEa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>eva,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>sva,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>YEa,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>uva,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>rva,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>iva,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>lva,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>nva,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>ova,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>fva,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>ava,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>mva,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>pva,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>hva,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>dva,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>JEa,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>$Ea,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>VEa,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>WEa,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>HEa,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>GEa,NETTRANSPORTVALUES_INPROC:()=>QEa,NETTRANSPORTVALUES_IP:()=>BEa,NETTRANSPORTVALUES_IP_TCP:()=>OEa,NETTRANSPORTVALUES_IP_UDP:()=>LEa,NETTRANSPORTVALUES_OTHER:()=>qEa,NETTRANSPORTVALUES_PIPE:()=>UEa,NETTRANSPORTVALUES_UNIX:()=>FEa,NETWORK_TRANSPORT_VALUE_PIPE:()=>oTa,NETWORK_TRANSPORT_VALUE_QUIC:()=>sTa,NETWORK_TRANSPORT_VALUE_TCP:()=>aTa,NETWORK_TRANSPORT_VALUE_UDP:()=>cTa,NETWORK_TRANSPORT_VALUE_UNIX:()=>lTa,NETWORK_TYPE_VALUE_IPV4:()=>dTa,NETWORK_TYPE_VALUE_IPV6:()=>fTa,NetHostConnectionSubtypeValues:()=>gva,NetHostConnectionTypeValues:()=>zEa,NetTransportValues:()=>jEa,OSTYPEVALUES_AIX:()=>fSa,OSTYPEVALUES_DARWIN:()=>sSa,OSTYPEVALUES_DRAGONFLYBSD:()=>uSa,OSTYPEVALUES_FREEBSD:()=>aSa,OSTYPEVALUES_HPUX:()=>dSa,OSTYPEVALUES_LINUX:()=>oSa,OSTYPEVALUES_NETBSD:()=>cSa,OSTYPEVALUES_OPENBSD:()=>lSa,OSTYPEVALUES_SOLARIS:()=>pSa,OSTYPEVALUES_WINDOWS:()=>iSa,OSTYPEVALUES_Z_OS:()=>hSa,OTEL_STATUS_CODE_VALUE_ERROR:()=>gTa,OTEL_STATUS_CODE_VALUE_OK:()=>ATa,OsTypeValues:()=>mSa,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>Uva,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>Ova,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>kva,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>Gva,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>Nva,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Fva,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>jva,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>Dva,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>Mva,RPCGRPCSTATUSCODEVALUES_OK:()=>Rva,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>Qva,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>Lva,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>Bva,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>$va,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>Hva,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>qva,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Pva,RpcGrpcStatusCodeValues:()=>Vva,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>Cya,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>Mya,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>_ya,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>mya,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Dya,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>xya,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Tya,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>Oya,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>bya,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>gya,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>vya,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>Iya,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Eya,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>Aya,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>yya,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>Nya,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Rya,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>kya,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Sya,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>wya,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>hya,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Pya,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>W0a,SEMATTRS_CODE_FILEPATH:()=>JAa,SEMATTRS_CODE_FUNCTION:()=>YAa,SEMATTRS_CODE_LINENO:()=>ZAa,SEMATTRS_CODE_NAMESPACE:()=>KAa,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>iAa,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>lAa,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>cAa,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>sAa,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>rAa,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>nAa,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>aAa,SEMATTRS_DB_CASSANDRA_TABLE:()=>oAa,SEMATTRS_DB_CONNECTION_STRING:()=>Y0a,SEMATTRS_DB_HBASE_NAMESPACE:()=>uAa,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>J0a,SEMATTRS_DB_MONGODB_COLLECTION:()=>fAa,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>tAa,SEMATTRS_DB_NAME:()=>Z0a,SEMATTRS_DB_OPERATION:()=>eAa,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>dAa,SEMATTRS_DB_SQL_TABLE:()=>pAa,SEMATTRS_DB_STATEMENT:()=>X0a,SEMATTRS_DB_SYSTEM:()=>z0a,SEMATTRS_DB_USER:()=>K0a,SEMATTRS_ENDUSER_ID:()=>GAa,SEMATTRS_ENDUSER_ROLE:()=>$Aa,SEMATTRS_ENDUSER_SCOPE:()=>VAa,SEMATTRS_EXCEPTION_ESCAPED:()=>AAa,SEMATTRS_EXCEPTION_MESSAGE:()=>mAa,SEMATTRS_EXCEPTION_STACKTRACE:()=>gAa,SEMATTRS_EXCEPTION_TYPE:()=>hAa,SEMATTRS_FAAS_COLDSTART:()=>IAa,SEMATTRS_FAAS_CRON:()=>TAa,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>EAa,SEMATTRS_FAAS_DOCUMENT_NAME:()=>bAa,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>vAa,SEMATTRS_FAAS_DOCUMENT_TIME:()=>CAa,SEMATTRS_FAAS_EXECUTION:()=>_Aa,SEMATTRS_FAAS_INVOKED_NAME:()=>xAa,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>wAa,SEMATTRS_FAAS_INVOKED_REGION:()=>RAa,SEMATTRS_FAAS_TIME:()=>SAa,SEMATTRS_FAAS_TRIGGER:()=>yAa,SEMATTRS_HTTP_CLIENT_IP:()=>pya,SEMATTRS_HTTP_FLAVOR:()=>oya,SEMATTRS_HTTP_HOST:()=>rya,SEMATTRS_HTTP_METHOD:()=>XAa,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>aya,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>cya,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>lya,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>uya,SEMATTRS_HTTP_ROUTE:()=>fya,SEMATTRS_HTTP_SCHEME:()=>nya,SEMATTRS_HTTP_SERVER_NAME:()=>dya,SEMATTRS_HTTP_STATUS_CODE:()=>iya,SEMATTRS_HTTP_TARGET:()=>tya,SEMATTRS_HTTP_URL:()=>eya,SEMATTRS_HTTP_USER_AGENT:()=>sya,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>d_a,SEMATTRS_MESSAGE_ID:()=>u_a,SEMATTRS_MESSAGE_TYPE:()=>l_a,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>f_a,SEMATTRS_MESSAGING_CONSUMER_ID:()=>zya,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>Gya,SEMATTRS_MESSAGING_DESTINATION:()=>Bya,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>Fya,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Zya,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Jya,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Kya,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>Xya,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>e_a,SEMATTRS_MESSAGING_MESSAGE_ID:()=>Hya,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Vya,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>$ya,SEMATTRS_MESSAGING_OPERATION:()=>Wya,SEMATTRS_MESSAGING_PROTOCOL:()=>Qya,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>qya,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Yya,SEMATTRS_MESSAGING_SYSTEM:()=>Lya,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Uya,SEMATTRS_MESSAGING_URL:()=>jya,SEMATTRS_NET_HOST_CARRIER_ICC:()=>jAa,SEMATTRS_NET_HOST_CARRIER_MCC:()=>QAa,SEMATTRS_NET_HOST_CARRIER_MNC:()=>qAa,SEMATTRS_NET_HOST_CARRIER_NAME:()=>UAa,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>FAa,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>BAa,SEMATTRS_NET_HOST_IP:()=>MAa,SEMATTRS_NET_HOST_NAME:()=>LAa,SEMATTRS_NET_HOST_PORT:()=>OAa,SEMATTRS_NET_PEER_IP:()=>PAa,SEMATTRS_NET_PEER_NAME:()=>NAa,SEMATTRS_NET_PEER_PORT:()=>DAa,SEMATTRS_NET_TRANSPORT:()=>kAa,SEMATTRS_PEER_SERVICE:()=>HAa,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>i_a,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>a_a,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>c_a,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>s_a,SEMATTRS_RPC_JSONRPC_VERSION:()=>o_a,SEMATTRS_RPC_METHOD:()=>n_a,SEMATTRS_RPC_SERVICE:()=>r_a,SEMATTRS_RPC_SYSTEM:()=>t_a,SEMATTRS_THREAD_ID:()=>WAa,SEMATTRS_THREAD_NAME:()=>zAa,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>rCa,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>tCa,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>nCa,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>iCa,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>oCa,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>sCa,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>aCa,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>lCa,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>cCa,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>dCa,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>uCa,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Jva,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>Xva,SEMRESATTRS_CLOUD_PLATFORM:()=>eCa,SEMRESATTRS_CLOUD_PROVIDER:()=>Kva,SEMRESATTRS_CLOUD_REGION:()=>Zva,SEMRESATTRS_CONTAINER_ID:()=>pCa,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>mCa,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>gCa,SEMRESATTRS_CONTAINER_NAME:()=>fCa,SEMRESATTRS_CONTAINER_RUNTIME:()=>hCa,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>ACa,SEMRESATTRS_DEVICE_ID:()=>yCa,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>_Ca,SEMRESATTRS_DEVICE_MODEL_NAME:()=>ECa,SEMRESATTRS_FAAS_ID:()=>CCa,SEMRESATTRS_FAAS_INSTANCE:()=>SCa,SEMRESATTRS_FAAS_MAX_MEMORY:()=>TCa,SEMRESATTRS_FAAS_NAME:()=>vCa,SEMRESATTRS_FAAS_VERSION:()=>bCa,SEMRESATTRS_HOST_ARCH:()=>RCa,SEMRESATTRS_HOST_ID:()=>ICa,SEMRESATTRS_HOST_IMAGE_ID:()=>PCa,SEMRESATTRS_HOST_IMAGE_NAME:()=>kCa,SEMRESATTRS_HOST_IMAGE_VERSION:()=>DCa,SEMRESATTRS_HOST_NAME:()=>xCa,SEMRESATTRS_HOST_TYPE:()=>wCa,SEMRESATTRS_K8S_CLUSTER_NAME:()=>NCa,SEMRESATTRS_K8S_CONTAINER_NAME:()=>UCa,SEMRESATTRS_K8S_CRONJOB_NAME:()=>JCa,SEMRESATTRS_K8S_CRONJOB_UID:()=>KCa,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>WCa,SEMRESATTRS_K8S_DAEMONSET_UID:()=>VCa,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>HCa,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>jCa,SEMRESATTRS_K8S_JOB_NAME:()=>YCa,SEMRESATTRS_K8S_JOB_UID:()=>zCa,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>LCa,SEMRESATTRS_K8S_NODE_NAME:()=>MCa,SEMRESATTRS_K8S_NODE_UID:()=>OCa,SEMRESATTRS_K8S_POD_NAME:()=>FCa,SEMRESATTRS_K8S_POD_UID:()=>BCa,SEMRESATTRS_K8S_REPLICASET_NAME:()=>qCa,SEMRESATTRS_K8S_REPLICASET_UID:()=>QCa,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>$Ca,SEMRESATTRS_K8S_STATEFULSET_UID:()=>GCa,SEMRESATTRS_OS_DESCRIPTION:()=>XCa,SEMRESATTRS_OS_NAME:()=>eba,SEMRESATTRS_OS_TYPE:()=>ZCa,SEMRESATTRS_OS_VERSION:()=>tba,SEMRESATTRS_PROCESS_COMMAND:()=>oba,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>aba,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>sba,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>nba,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>iba,SEMRESATTRS_PROCESS_OWNER:()=>cba,SEMRESATTRS_PROCESS_PID:()=>rba,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>dba,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>lba,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>uba,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>hba,SEMRESATTRS_SERVICE_NAME:()=>fba,SEMRESATTRS_SERVICE_NAMESPACE:()=>pba,SEMRESATTRS_SERVICE_VERSION:()=>mba,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>_ba,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Aba,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>gba,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>yba,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Cba,SEMRESATTRS_WEBENGINE_NAME:()=>Eba,SEMRESATTRS_WEBENGINE_VERSION:()=>vba,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>STa,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>TTa,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>ITa,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>wTa,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>RTa,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>kTa,SemanticAttributes:()=>p_a,SemanticResourceAttributes:()=>bba,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>gSa,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>ASa,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>ySa,TELEMETRYSDKLANGUAGEVALUES_GO:()=>_Sa,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>ESa,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>vSa,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>CSa,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>bSa,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>SSa,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>TSa,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>PTa,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>DTa,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>NTa,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>MTa,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>OTa,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>cCr,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>LTa,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>BTa,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>FTa,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>UTa,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>QTa,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>qTa,TelemetrySdkLanguageValues:()=>ISa});var Zgt=Se(()=>{p();jCi();h1i();m1i();g1i();A1i()});var y1i,_1i=Se(()=>{p();y1i="process.runtime.name"});var Xgt,E1i=Se(()=>{p();JAi();Zgt();_1i();Xgt={[lCr]:"opentelemetry",[y1i]:"node",[aCr]:cCr,[uCr]:KAi}});var v1i=Se(()=>{p();VAi();WAi();YAi();E1i()});var fCr=Se(()=>{p();v1i()});function $0e(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*WIa);return[r,n]}function t0t(){let t=n$.timeOrigin;if(typeof t!="number"){let e=n$;t=e.timing&&e.timing.fetchStart}return t}function pCr(t){let e=$0e(t0t()),r=$0e(typeof t=="number"?t:n$.now());return hCr(e,r)}function b1i(t){if(r0t(t))return t;if(typeof t=="number")return t=e0t&&(r[1]-=e0t,r[0]+=1),r}var C1i,VIa,WIa,e0t,k1i=Se(()=>{p();fCr();C1i=9,VIa=6,WIa=Math.pow(10,VIa),e0t=Math.pow(10,C1i);a($0e,"millisToHrTime");a(t0t,"getTimeOrigin");a(pCr,"hrTime");a(b1i,"timeInputToHrTime");a(S1i,"hrTimeDuration");a(T1i,"hrTimeToTimeStamp");a(I1i,"hrTimeToNanoseconds");a(x1i,"hrTimeToMilliseconds");a(w1i,"hrTimeToMicroseconds");a(r0t,"isTimeInputHrTime");a(R1i,"isTimeInput");a(hCr,"addHrTimes")});function P1i(t){typeof t!="number"&&t.unref()}var D1i=Se(()=>{p();a(P1i,"unrefTimer")});var n0t,N1i=Se(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(n0t||(n0t={}))});var i0t,M1i=Se(()=>{p();go();i0t=class{static{a(this,"CompositePropagator")}_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,n)=>r.concat(n),[])))}inject(e,r,n){for(let o of this._propagators)try{o.inject(e,r,n)}catch(s){On.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}}extract(e,r,n){return this._propagators.reduce((o,s)=>{try{return s.extract(o,r,n)}catch(c){On.warn(`Failed to extract with ${s.constructor.name}. Err: ${c.message}`)}return o},e)}fields(){return this._fields.slice()}}});function O1i(t){return KIa.test(t)}function L1i(t){return JIa.test(t)&&!ZIa.test(t)}var mCr,zIa,YIa,KIa,JIa,ZIa,B1i=Se(()=>{p();mCr="[_0-9a-z-*/]",zIa=`[a-z]${mCr}{0,255}`,YIa=`[a-z0-9]${mCr}{0,240}@[a-z]${mCr}{0,13}`,KIa=new RegExp(`^(?:${zIa}|${YIa})$`),JIa=/^[ -~]{0,255}[!-~]$/,ZIa=/,|=/;a(O1i,"validateKey");a(L1i,"validateValue")});var F1i,XIa,U1i,Q1i,V0e,gCr=Se(()=>{p();B1i();F1i=32,XIa=512,U1i=",",Q1i="=",V0e=class t{static{a(this,"TraceState")}_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,r){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n}unset(e){let r=this._clone();return r._internalState.delete(e),r}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,r)=>(e.push(r+Q1i+this.get(r)),e),[]).join(U1i)}_parse(e){e.length>XIa||(this._internalState=e.split(U1i).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(Q1i);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);O1i(c)&&L1i(l)&&r.set(c,l)}return r},new Map),this._internalState.size>F1i&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,F1i))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function ACr(t){let e=oxa.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var H5e,G5e,exa,txa,rxa,nxa,ixa,oxa,o0t,q1i=Se(()=>{p();go();q5e();gCr();H5e="traceparent",G5e="tracestate",exa="00",txa="(?!ff)[\\da-f]{2}",rxa="(?![0]{32})[\\da-f]{32}",nxa="(?![0]{16})[\\da-f]{16}",ixa="[\\da-f]{2}",oxa=new RegExp(`^\\s?(${txa})-(${rxa})-(${nxa})-(${ixa})(-.*)?\\s?$`);a(ACr,"parseTraceParent");o0t=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=Uu.getSpanContext(e);if(!o||G0e(e)||!sS(o))return;let s=`${exa}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||Uf.NONE).toString(16)}`;n.set(r,H5e,s),o.traceState&&n.set(r,G5e,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,H5e);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=ACr(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,G5e);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new V0e(typeof u=="string"?u:void 0)}return Uu.setSpanContext(e,c)}fields(){return[H5e,G5e]}}});function j1i(t,e){return t.setValue(yCr,e)}function H1i(t){return t.deleteValue(yCr)}function G1i(t){return t.getValue(yCr)}var yCr,s0t,$1i=Se(()=>{p();go();yCr=oS("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(s0t||(s0t={}));a(j1i,"setRPCMetadata");a(H1i,"deleteRPCMetadata");a(G1i,"getRPCMetadata")});function _Cr(t){if(!fxa(t)||pxa(t)!==sxa)return!1;let e=dxa(t);if(e===null)return!0;let r=z1i.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&V1i.call(r)===uxa}function fxa(t){return t!=null&&typeof t=="object"}function pxa(t){return t==null?t===void 0?cxa:axa:Tte&&Tte in Object(t)?hxa(t):mxa(t)}function hxa(t){let e=z1i.call(t,Tte),r=t[Tte],n=!1;try{t[Tte]=void 0,n=!0}catch{}let o=Y1i.call(t);return n&&(e?t[Tte]=r:delete t[Tte]),o}function mxa(t){return Y1i.call(t)}var sxa,axa,cxa,lxa,V1i,uxa,dxa,W1i,z1i,Tte,Y1i,K1i=Se(()=>{p();sxa="[object Object]",axa="[object Null]",cxa="[object Undefined]",lxa=Function.prototype,V1i=lxa.toString,uxa=V1i.call(Object),dxa=Object.getPrototypeOf,W1i=Object.prototype,z1i=W1i.hasOwnProperty,Tte=Symbol?Symbol.toStringTag:void 0,Y1i=W1i.toString;a(_Cr,"isPlainObject");a(fxa,"isObjectLike");a(pxa,"baseGetTag");a(hxa,"getRawTag");a(mxa,"objectToString")});function Z1i(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=X1i(e,t.shift(),0,r);return e}function ECr(t){return c0t(t)?t.slice():t}function X1i(t,e,r=0,n){let o;if(!(r>gxa)){if(r++,a0t(t)||a0t(e)||eTi(e))o=ECr(e);else if(c0t(t)){if(o=t.slice(),c0t(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(J1i(t,u,n)||J1i(e,u,n))delete o[u];else{if($5e(f)&&$5e(h)){let m=n.get(f)||[],g=n.get(h)||[];m.push({obj:t,key:u}),g.push({obj:e,key:u}),n.set(f,m),n.set(h,g)}o[u]=X1i(o[u],d,r,n)}}}}else o=e;return o}}function J1i(t,e,r){let n=r.get(t[e])||[];for(let o=0,s=n.length;o"u"||t instanceof Date||t instanceof RegExp||t===null}function Axa(t,e){return!(!_Cr(t)||!_Cr(e))}var gxa,tTi=Se(()=>{p();K1i();gxa=20;a(Z1i,"merge");a(ECr,"takeValue");a(X1i,"mergeTwoObjects");a(J1i,"wasObjectReferenced");a(c0t,"isArray");a(eTi,"isFunction");a($5e,"isObject");a(a0t,"isPrimitive");a(Axa,"shouldMerge")});function rTi(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new V5e("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var V5e,nTi=Se(()=>{p();V5e=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(rTi,"callWithTimeout")});function vCr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function iTi(t,e){if(!e)return!1;for(let r of e)if(vCr(t,r))return!0;return!1}var oTi=Se(()=>{p();a(vCr,"urlMatches");a(iTi,"isUrlIgnored")});var l0t,sTi=Se(()=>{p();l0t=class{static{a(this,"Deferred")}_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var u0t,aTi=Se(()=>{p();sTi();u0t=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new l0t;constructor(e,r){this._callback=e,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}});function lTi(t){if(t==null)return;let e=cTi[t.toUpperCase()];return e??(On.warn(`Unknown log level "${t}", expected one of ${Object.keys(cTi)}, using default`),Ua.INFO)}var cTi,uTi=Se(()=>{p();go();cTi={ALL:Ua.ALL,VERBOSE:Ua.VERBOSE,DEBUG:Ua.DEBUG,INFO:Ua.INFO,WARN:Ua.WARN,ERROR:Ua.ERROR,NONE:Ua.NONE};a(lTi,"diagLogLevelFromString")});function dTi(t,e){return new Promise(r=>{X0.with(jgt(X0.active()),()=>{t.export(e,n=>{r(n)})})})}var fTi=Se(()=>{p();go();q5e();a(dTi,"_export")});var d0t={};Ti(d0t,{AnchoredClock:()=>Vgt,BindOnceFuture:()=>u0t,CompositePropagator:()=>i0t,ExportResultCode:()=>n0t,RPCType:()=>s0t,SDK_INFO:()=>Xgt,TRACE_PARENT_HEADER:()=>H5e,TRACE_STATE_HEADER:()=>G5e,TimeoutError:()=>V5e,TraceState:()=>V0e,W3CBaggagePropagator:()=>$gt,W3CTraceContextPropagator:()=>o0t,_globalThis:()=>Jgt,addHrTimes:()=>hCr,callWithTimeout:()=>rTi,deleteRPCMetadata:()=>H1i,diagLogLevelFromString:()=>lTi,getBooleanFromEnv:()=>Ygt,getNumberFromEnv:()=>zgt,getRPCMetadata:()=>G1i,getStringFromEnv:()=>j5e,getStringListFromEnv:()=>Kgt,getTimeOrigin:()=>t0t,globalErrorHandler:()=>GAi,hrTime:()=>pCr,hrTimeDuration:()=>S1i,hrTimeToMicroseconds:()=>w1i,hrTimeToMilliseconds:()=>x1i,hrTimeToNanoseconds:()=>I1i,hrTimeToTimeStamp:()=>T1i,internal:()=>yxa,isAttributeValue:()=>nCr,isTimeInput:()=>R1i,isTimeInputHrTime:()=>r0t,isTracingSuppressed:()=>G0e,isUrlIgnored:()=>iTi,loggingErrorHandler:()=>Wgt,merge:()=>Z1i,millisToHrTime:()=>$0e,otperformance:()=>n$,parseKeyPairsIntoRecord:()=>LAi,parseTraceParent:()=>ACr,sanitizeAttributes:()=>UAi,setGlobalErrorHandler:()=>HAi,setRPCMetadata:()=>j1i,suppressTracing:()=>jgt,timeInputToHrTime:()=>b1i,unrefTimer:()=>P1i,unsuppressTracing:()=>PAi,urlMatches:()=>vCr});var yxa,f0t=Se(()=>{p();BAi();FAi();qAi();$Ai();iCr();k1i();D1i();N1i();rCr();fCr();M1i();q1i();$1i();q5e();gCr();tTi();nTi();oTi();aTi();uTi();fTi();yxa={_export:dTi}});var mTi=I(p0t=>{"use strict";p();Object.defineProperty(p0t,"__esModule",{value:!0});p0t.OpenTelemetrySpanWrapper=void 0;var pTi=(go(),Wa(A6)),hTi=(f0t(),Wa(d0t)),_xa=Xvr(),CCr=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&Exa(e.error)?e.error?(this._span.setStatus({code:pTi.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:pTi.SpanStatusCode.ERROR}):e.status==="success"&&_xa.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,hTi.isAttributeValue)(r)&&this._span.setAttribute(e,r)}end(){this._span.end()}recordException(e){this._span.recordException(e)}isRecording(){return this._span.isRecording()}addEvent(e,r={}){this._span.addEvent(e,(0,hTi.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};p0t.OpenTelemetrySpanWrapper=CCr;function Exa(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(Exa,"isRecordableError")});var bCr=I(oL=>{"use strict";p();Object.defineProperty(oL,"__esModule",{value:!0});oL.environmentCache=oL.SDK_VERSION=void 0;oL.envVarToBoolean=vxa;oL.SDK_VERSION="1.0.0-beta.9";oL.environmentCache=new Map;function vxa(t){var e;oL.environmentCache.has(t)||Cxa(t);let r=((e=oL.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a(vxa,"envVarToBoolean");function Cxa(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];oL.environmentCache.set(t,r)}}a(Cxa,"loadEnvironmentVariable")});var _Ti=I(h0t=>{"use strict";p();Object.defineProperty(h0t,"__esModule",{value:!0});h0t.toOpenTelemetrySpanKind=yTi;h0t.toSpanOptions=Sxa;var gTi=(go(),Wa(A6)),ATi=(f0t(),Wa(d0t));function yTi(t){let e=(t||"internal").toUpperCase();return gTi.SpanKind[e]}a(yTi,"toOpenTelemetrySpanKind");function bxa(t=[]){return t.reduce((e,r)=>{let n=gTi.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,ATi.sanitizeAttributes)(r.attributes)}),e},[])}a(bxa,"toOpenTelemetryLinks");function Sxa(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,ATi.sanitizeAttributes)(e),s=yTi(n),c=bxa(r);return{attributes:o,kind:s,links:c}}a(Sxa,"toSpanOptions")});var CTi=I(i$=>{"use strict";p();Object.defineProperty(i$,"__esModule",{value:!0});i$.OpenTelemetryInstrumenter=i$.propagator=void 0;var sL=(go(),Wa(A6)),vTi=(f0t(),Wa(d0t)),Txa=mTi(),ETi=bCr(),Ixa=_Ti();i$.propagator=new vTi.W3CTraceContextPropagator;var SCr=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||sL.context.active(),o;return(0,ETi.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=sL.trace.wrapSpanContext(sL.INVALID_SPAN_CONTEXT):(o=sL.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,Ixa.toSpanOptions)(r),n),(0,ETi.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,vTi.suppressTracing)(n))),{span:new Txa.OpenTelemetrySpanWrapper(o),tracingContext:sL.trace.setSpan(n,o)}}withContext(e,r,...n){return sL.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return i$.propagator.extract(sL.context.active(),{traceparent:e},sL.defaultTextMapGetter)}createRequestHeaders(e){let r={};return i$.propagator.inject(e||sL.context.active(),r,sL.defaultTextMapSetter),r}};i$.OpenTelemetryInstrumenter=SCr});var STi=I(W5e=>{"use strict";p();Object.defineProperty(W5e,"__esModule",{value:!0});W5e.AzureSdkInstrumentation=void 0;W5e.createAzureSdkInstrumentation=Rxa;var bTi=($vr(),Wa(Gvr)),xxa=CTi(),wxa=bCr(),m0t=class extends bTi.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",wxa.SDK_VERSION,Object.assign({},e))}init(){let e=new bTi.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new xxa.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};W5e.AzureSdkInstrumentation=m0t;function Rxa(t={}){return new m0t(t)}a(Rxa,"createAzureSdkInstrumentation")});var ITi=I(g0t=>{"use strict";p();Object.defineProperty(g0t,"__esModule",{value:!0});var TTi=(Y3(),Wa(jQ));TTi.__exportStar(Xvr(),g0t);TTi.__exportStar(STi(),g0t)});var wTi=I(jR=>{"use strict";p();Object.defineProperty(jR,"__esModule",{value:!0});jR.enable=jR.azureCoreTracing=jR.AzureMonitorSymbol=void 0;var TCr=Pp();jR.AzureMonitorSymbol="Azure_Monitor_Tracer";var ICr="azure-coretracing",xTi=!1,kxa=a(function(t){if(xTi)return t;try{var e=(wgi(),Wa(xgi)),r=(go(),Wa(A6)),n=new e.BasicTracerProvider,o=n.getTracer("applicationinsights tracer");if(t.setTracer){var s=t.setTracer;t.setTracer=function(d){var f=d.startSpan;d.startSpan=function(h,m,g){var A=f.call(this,h,m,g),y=A.end;return A.end=function(){var _=y.apply(this,arguments);return TCr.channel.publish(ICr,A),_},A},d[jR.AzureMonitorSymbol]=!0,s.call(this,d)},r.trace.getSpan(r.context.active()),t.setTracer(o)}else{var c=r.trace.setGlobalTracerProvider;r.trace.setGlobalTracerProvider=function(d){var f=d.getTracer;return d.getTracer=function(h,m){var g=f.call(this,h,m);if(!g[jR.AzureMonitorSymbol]){var A=g.startSpan;g.startSpan=function(y,_,E){var v=A.call(this,y,_,E),S=v.end;return v.end=function(){var T=S.apply(this,arguments);return TCr.channel.publish(ICr,v),T},v},g[jR.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=($vr(),Wa(Gvr)),u=ITi();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}xTi=!0}catch{}return t},"azureCoreTracingPatchFunction");jR.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:kxa,publisherName:ICr};function Pxa(){TCr.channel.registerMonkeyPatch("@azure/core-tracing",jR.azureCoreTracing)}a(Pxa,"enable");jR.enable=Pxa});var kTi=I(Ite=>{"use strict";p();Object.defineProperty(Ite,"__esModule",{value:!0});Ite.enable=Ite.bunyan=void 0;var RTi=Pp(),Dxa=a(function(t){var e=t.prototype._emit;return t.prototype._emit=function(r,n){var o=e.apply(this,arguments);if(!n){var s=o;s||(s=e.call(this,r,!0)),RTi.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");Ite.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:Dxa};function Nxa(){RTi.channel.registerMonkeyPatch("bunyan",Ite.bunyan)}a(Nxa,"enable");Ite.enable=Nxa});var DTi=I(xte=>{"use strict";p();Object.defineProperty(xte,"__esModule",{value:!0});xte.enable=xte.console=void 0;var xCr=Pp(),PTi=require("stream"),Mxa=a(function(t){var e=new PTi.Writable,r=new PTi.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return xCr.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return xCr.channel.publish("console",{message:f,stderr:!0}),!0};for(var n=new t.Console(e,r),o=["log","info","warn","error","dir","time","timeEnd","trace","assert"],s=a(function(d){var f=t[d];f&&(t[d]=function(){if(n[d])try{n[d].apply(n,arguments)}catch{}return f.apply(t,arguments)})},"_loop_1"),c=0,l=o;c= 4.0.0",patch:Mxa};function Oxa(){xCr.channel.registerMonkeyPatch("console",xte.console),require("console")}a(Oxa,"enable");xte.enable=Oxa});var NTi=I(wte=>{"use strict";p();Object.defineProperty(wte,"__esModule",{value:!0});wte.enable=wte.mongoCore=void 0;var wCr=Pp(),Lxa=a(function(t){var e=t.Server.prototype.connect;return t.Server.prototype.connect=a(function(){var n=e.apply(this,arguments),o=this.s.pool.write;this.s.pool.write=a(function(){var l=typeof arguments[1]=="function"?1:2;return typeof arguments[l]=="function"&&(arguments[l]=wCr.channel.bindToContext(arguments[l])),o.apply(this,arguments)},"contextPreservingWrite");var s=this.s.pool.logout;return this.s.pool.logout=a(function(){return typeof arguments[1]=="function"&&(arguments[1]=wCr.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");wte.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:Lxa};function Bxa(){wCr.channel.registerMonkeyPatch("mongodb-core",wte.mongoCore)}a(Bxa,"enable");wte.enable=Bxa});var MTi=I(qv=>{"use strict";p();var W0e=qv&&qv.__assign||function(){return W0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:Fxa};qv.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:Uxa};qv.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:qxa};function jxa(){J_.channel.registerMonkeyPatch("mongodb",qv.mongo2),J_.channel.registerMonkeyPatch("mongodb",qv.mongo3),J_.channel.registerMonkeyPatch("mongodb",qv.mongo330)}a(jxa,"enable");qv.enable=jxa});var LTi=I(Rte=>{"use strict";p();Object.defineProperty(Rte,"__esModule",{value:!0});Rte.enable=Rte.mysql=void 0;var A0t=Pp(),OTi=require("path"),Hxa=a(function(t,e){var r=a(function(u,d){return function(f,h){var m=u[f];m&&(u[f]=a(function(){for(var A=arguments.length-1,y=arguments.length-1;y>=0;--y)if(typeof arguments[y]=="function"){A=y;break}else if(typeof arguments[y]<"u")break;var _=arguments[A],E={result:null,startTime:null,startDate:null};typeof _=="function"&&(h?(E.startTime=process.hrtime(),E.startDate=new Date,arguments[A]=A0t.channel.bindToContext(h(E,_))):arguments[A]=A0t.channel.bindToContext(_));var v=m.apply(this,arguments);return E.result=v,v},"mysqlContextPreserver"))}},"patchObjectFunction"),n=a(function(u,d){return r(u.prototype,d+".prototype")},"patchClassMemberFunction"),o=["connect","changeUser","ping","statistics","end"],s=require(OTi.dirname(e)+"/lib/Connection");o.forEach(function(u){return n(s,"Connection")(u)}),r(s,"Connection")("createQuery",function(u,d){return function(f){var h=process.hrtime(u.startTime),m=h[0]*1e3+h[1]/1e6|0;A0t.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(OTi.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");Rte.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:Hxa};function Gxa(){A0t.channel.registerMonkeyPatch("mysql",Rte.mysql)}a(Gxa,"enable");Rte.enable=Gxa});var FTi=I(kte=>{"use strict";p();Object.defineProperty(kte,"__esModule",{value:!0});kte.enable=kte.postgresPool1=void 0;var BTi=Pp();function $xa(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=BTi.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a($xa,"postgresPool1PatchFunction");kte.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:$xa};function Vxa(){BTi.channel.registerMonkeyPatch("pg-pool",kte.postgresPool1)}a(Vxa,"enable");kte.enable=Vxa});var QTi=I(aL=>{"use strict";p();Object.defineProperty(aL,"__esModule",{value:!0});aL.enable=aL.postgres=aL.postgres6=void 0;var z0e=Pp(),UTi=require("events"),RCr="postgres";function Wxa(t,e){var r=t.Client.prototype.query,n="__diagnosticOriginalFunc";return t.Client.prototype.query=a(function(s,c,l){var u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},d=process.hrtime(),f;function h(m){m&&m[n]&&(m=m[n]);var g=z0e.channel.bindToContext(function(A,y){var _=process.hrtime(d);if(u.result=y&&{rowCount:y.rowCount,command:y.command},u.error=A,u.duration=Math.ceil(_[0]*1e3+_[1]/1e6),z0e.channel.publish(RCr,u),A){if(m)return m.apply(this,arguments);f&&f instanceof UTi.EventEmitter&&f.emit("error",A)}else m&&m.apply(this,arguments)});try{return Object.defineProperty(g,n,{value:m}),g}catch{return m}}a(h,"patchCallback");try{typeof s=="string"?c instanceof Array?(u.query.preparable={text:s,args:c},l=h(l)):(u.query.text=s,l?l=h(l):c=h(c)):(typeof s.name=="string"?u.query.plan=s.name:s.values instanceof Array?u.query.preparable={text:s.text,args:s.values}:u.query.text=s.text,l?l=h(l):c?c=h(c):s.callback=h(s.callback))}catch{return r.apply(this,arguments)}return arguments[0]=s,arguments[1]=c,arguments[2]=l,arguments.length=arguments.length>3?arguments.length:3,f=r.apply(this,arguments),f},"query"),t}a(Wxa,"postgres6PatchFunction");function zxa(t,e){var r=t.Client.prototype.query,n="__diagnosticOriginalFunc";return t.Client.prototype.query=a(function(s,c,l){var u=this,d,f,h=!!l,m={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},g,A=process.hrtime();function y(v){v&&v[n]&&(v=v[n]);var S=z0e.channel.bindToContext(function(T,w){var R=process.hrtime(A);if(m.result=w&&{rowCount:w.rowCount,command:w.command},m.error=T,m.duration=Math.ceil(R[0]*1e3+R[1]/1e6),z0e.channel.publish(RCr,m),T){if(v)return v.apply(this,arguments);g&&g instanceof UTi.EventEmitter&&g.emit("error",T)}else v&&v.apply(this,arguments)});try{return Object.defineProperty(S,n,{value:v}),S}catch{return v}}a(y,"patchCallback");try{typeof s=="string"?c instanceof Array?(m.query.preparable={text:s,args:c},h=typeof l=="function",l=h?y(l):l):(m.query.text=s,l?(h=typeof l=="function",l=h?y(l):l):(h=typeof c=="function",c=h?y(c):c)):(typeof s.name=="string"?m.query.plan=s.name:s.values instanceof Array?m.query.preparable={text:s.text,args:s.values}:s.cursor?m.query.text=(d=s.cursor)===null||d===void 0?void 0:d.text:m.query.text=s.text,l?(h=typeof l=="function",l=y(l)):c?(h=typeof c=="function",c=h?y(c):c):(h=typeof s.callback=="function",s.callback=h?y(s.callback):s.callback))}catch{return r.apply(this,arguments)}arguments[0]=s,arguments[1]=c,arguments[2]=l,arguments.length=arguments.length>3?arguments.length:3;try{g=r.apply(this,arguments)}catch(v){throw y()(v,void 0),v}if(!h){if(g instanceof Promise)return g.then(function(v){return y()(void 0,v),new u._Promise(function(S,T){S(v)})}).catch(function(v){return y()(v,void 0),new u._Promise(function(S,T){T(v)})});var _=g.text?g.text:"";if(g.cursor&&(_=(f=g.cursor)===null||f===void 0?void 0:f.text),_){var E={command:_,rowCount:0};y()(void 0,E)}}return g},"query"),t}a(zxa,"postgresLatestPatchFunction");aL.postgres6={versionSpecifier:"6.*",patch:Wxa};aL.postgres={versionSpecifier:">=7.* <=8.*",patch:zxa,publisherName:RCr};function Yxa(){z0e.channel.registerMonkeyPatch("pg",aL.postgres6),z0e.channel.registerMonkeyPatch("pg",aL.postgres)}a(Yxa,"enable");aL.enable=Yxa});var qTi=I(Pte=>{"use strict";p();Object.defineProperty(Pte,"__esModule",{value:!0});Pte.enable=Pte.redis=void 0;var kCr=Pp(),Kxa=a(function(t){var e=t.RedisClient.prototype.internal_send_command;return t.RedisClient.prototype.internal_send_command=function(r){if(r){var n=r.callback;if(!n||!n.pubsubBound){var o=this.address,s=process.hrtime(),c=new Date;r.callback=kCr.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;kCr.channel.publish("redis",{duration:f,address:o,commandObj:r,err:l,result:u,time:c}),typeof n=="function"&&n.apply(this,arguments)}),r.callback.pubsubBound=!0}}return e.call(this,r)},t},"redisPatchFunction");Pte.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:Kxa};function Jxa(){kCr.channel.registerMonkeyPatch("redis",Pte.redis)}a(Jxa,"enable");Pte.enable=Jxa});var jTi=I(E6=>{"use strict";p();var y0t=E6&&E6.__assign||function(){return y0t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:Zxa};function Xxa(){PCr.channel.registerMonkeyPatch("tedious",E6.tedious)}a(Xxa,"enable");E6.enable=Xxa});var HTi=I(dS=>{"use strict";p();var ewa=dS&&dS.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),twa=dS&&dS.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);od[f]?h:f);return f}a(n,"getLogLevel");function o(l){this.add(new r(t,{level:n(l)}))}a(o,"patchedConfigure");var s=t.createLogger;t.createLogger=a(function(u){var d=s.call(this,u);d.add(new r(t,{level:n(u)}));var f=d.configure;return d.configure=function(){f.apply(this,arguments),o.apply(this,arguments)},d},"patchedCreate");var c=t.configure;return t.configure=function(){c.apply(this,arguments),o.apply(this,arguments)},t.add(new r(t)),t},"winston3PatchFunction");dS.winston3={versionSpecifier:"3.x",patch:nwa};dS.winston2={versionSpecifier:"2.x",patch:rwa};function iwa(){_0t.channel.registerMonkeyPatch("winston",dS.winston2),_0t.channel.registerMonkeyPatch("winston",dS.winston3)}a(iwa,"enable");dS.enable=iwa});var tIi=I(Qu=>{"use strict";p();Object.defineProperty(Qu,"__esModule",{value:!0});Qu.enable=Qu.tedious=Qu.pgPool=Qu.pg=Qu.winston=Qu.redis=Qu.mysql=Qu.mongodb=Qu.mongodbCore=Qu.console=Qu.bunyan=Qu.azuresdk=void 0;var GTi=wTi();Qu.azuresdk=GTi;var $Ti=kTi();Qu.bunyan=$Ti;var VTi=DTi();Qu.console=VTi;var WTi=NTi();Qu.mongodbCore=WTi;var zTi=MTi();Qu.mongodb=zTi;var YTi=LTi();Qu.mysql=YTi;var KTi=FTi();Qu.pgPool=KTi;var JTi=QTi();Qu.pg=JTi;var ZTi=qTi();Qu.redis=ZTi;var XTi=jTi();Qu.tedious=XTi;var eIi=HTi();Qu.winston=eIi;function owa(){$Ti.enable(),VTi.enable(),WTi.enable(),zTi.enable(),YTi.enable(),JTi.enable(),KTi.enable(),ZTi.enable(),eIi.enable(),GTi.enable(),XTi.enable()}a(owa,"enable");Qu.enable=owa});var C0t=I(Dte=>{"use strict";p();Object.defineProperty(Dte,"__esModule",{value:!0});Dte.IsInitialized=void 0;Dte.registerContextPreservation=swa;var DCr=lu(),nIi=Cmt();Dte.IsInitialized=!nIi.JsonConfig.getInstance().noDiagnosticChannel;var NCr="DiagnosticChannel";if(Dte.IsInitialized){ND=tIi(),rIi=nIi.JsonConfig.getInstance().noPatchModules,E0t=rIi.split(","),MCr={bunyan:ND.bunyan,console:ND.console,mongodb:ND.mongodb,mongodbCore:ND.mongodbCore,mysql:ND.mysql,redis:ND.redis,pg:ND.pg,pgPool:ND.pgPool,winston:ND.winston,azuresdk:ND.azuresdk};for(v0t in MCr)E0t.indexOf(v0t)===-1&&(MCr[v0t].enable(),DCr.info(NCr,"Subscribed to ".concat(v0t," events")));E0t.length>0&&DCr.info(NCr,"Some modules will not be patched",E0t)}else DCr.info(NCr,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var ND,rIi,E0t,MCr,v0t;function swa(t){if(Dte.IsInitialized){var e=Pp();e.channel.addContextPreservation(t)}}a(swa,"registerContextPreservation")});var Y0e=I((pTp,iIi)=>{"use strict";p();iIi.exports={requestContextHeader:"request-context",requestContextSourceKey:"appId",requestContextTargetKey:"appId",requestIdHeader:"request-id",parentIdHeader:"x-ms-request-id",rootIdHeader:"x-ms-request-root-id",correlationContextHeader:"correlation-context",traceparentHeader:"traceparent",traceStateHeader:"tracestate"}});var Cy=I((BCr,oIi)=>{"use strict";p();var s$=BCr&&BCr.__assign||function(){return s$=Object.assign||function(t){for(var e,r=1,n=arguments.length;r>u&255)},"toChar"),n=a(function(l){return r(l,24)+r(l,16)+r(l,8)+r(l,0)},"int32AsString"),o=e.map(n).join(""),s=Buffer.from?Buffer.from(o,"binary"):new Buffer(o,"binary"),c=s.toString("base64");return c.substr(0,c.indexOf("="))},t.random32=function(){return 4294967296*Math.random()|0},t.randomu32=function(){return t.random32()+2147483648},t.w3cTraceId=function(){for(var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],r="",n,o=0;o<4;o++)n=t.random32(),r+=e[n&15]+e[n>>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15];var s=e[8+Math.random()*4|0];return r.substr(0,8)+r.substr(9,4)+"4"+r.substr(13,3)+s+r.substr(16,3)+r.substr(19,12)},t.w3cSpanId=function(){return t.w3cTraceId().substring(16)},t.isValidW3CId=function(e){return e.length===32&&e!=="00000000000000000000000000000000"},t.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"},t.isError=function(e){return Object.prototype.toString.call(e)==="[object Error]"},t.isPrimitive=function(e){var r=typeof e;return r==="string"||r==="number"||r==="boolean"},t.isDate=function(e){return Object.prototype.toString.call(e)==="[object Date]"},t.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var r=(e/1e3%60).toFixed(7).replace(/0{0,4}$/,""),n=""+Math.floor(e/(1e3*60))%60,o=""+Math.floor(e/(1e3*60*60))%24,s=Math.floor(e/(1e3*60*60*24));r=r.indexOf(".")<2?"0"+r:r,n=n.length<2?"0"+n:n,o=o.length<2?"0"+o:o;var c=s>0?s+".":"";return c+o+":"+n+":"+r},t.extractError=function(e){var r=e;return{message:e.message,code:r.code||r.id||""}},t.extractObject=function(e){return e instanceof Error?t.extractError(e):typeof e.toJSON=="function"?e.toJSON():e},t.validateStringMap=function(e){if(typeof e!="object"){Nte.info("Invalid properties dropped from payload");return}var r={};for(var n in e){var o="",s=e[n],c=typeof s;if(t.isPrimitive(s))o=s.toString();else if(s===null||c==="undefined")o="";else if(c==="function"){Nte.info("key: "+n+" was function; will not serialize");continue}else{var l=t.isArray(s)?s:t.extractObject(s);try{t.isPrimitive(l)?o=l:o=JSON.stringify(l)}catch(u){o=s.constructor.name.toString()+" (Error: "+u.message+")",Nte.info("key: "+n+", could not be serialized")}}r[n]=o.substring(0,t.MAX_PROPERTY_LENGTH)}return r},t.canIncludeCorrelationHeader=function(e,r){var n=e&&e.config&&e.config.correlationHeaderExcludedDomains;if(!n||n.length==0||!r)return!0;for(var o=0;o{"use strict";p();var FCr=Cy(),uwa=(function(){function t(){}return a(t,"CorrelationIdManager"),t.queryCorrelationId=function(e,r){},t.cancelCorrelationIdQuery=function(e,r){},t.generateRequestId=function(e){if(e){e=e[0]=="|"?e:"|"+e,e[e.length-1]!=="."&&(e+=".");var r=(t.currentRootId++).toString(16);return t.appendSuffix(e,r,"_")}else return t.generateRootId()},t.getRootId=function(e){var r=e.indexOf(".");r<0&&(r=e.length);var n=e[0]==="|"?1:0;return e.substring(n,r)},t.generateRootId=function(){return"|"+FCr.w3cTraceId()+"."},t.appendSuffix=function(e,r,n){if(e.length+r.lengtho)for(;o>1;--o){var s=e[o-1];if(s==="."||s==="_")break}if(o<=1)return t.generateRootId();for(r=FCr.randomu32().toString(16);r.length<8;)r="0"+r;return e.substring(0,o)+r+"#"},t.correlationIdPrefix="cid-v1:",t.w3cEnabled=!0,t.HTTP_TIMEOUT=2500,t.requestIdMaxLength=1024,t.currentRootId=FCr.randomu32(),t})();sIi.exports=uwa});var b0t=I((ETp,aIi)=>{"use strict";p();var by=Cy(),dwa=Mte(),fwa=(function(){function t(e,r){if(this.traceFlag=t.DEFAULT_TRACE_FLAG,this.version=t.DEFAULT_VERSION,e&&typeof e=="string")if(e.split(",").length>1)this.traceId=by.w3cTraceId(),this.spanId=by.w3cTraceId().substr(0,16);else{var n=e.trim().split("-"),o=n.length;o>=4?(this.version=n[0],this.traceId=n[1],this.spanId=n[2],this.traceFlag=n[3]):(this.traceId=by.w3cTraceId(),this.spanId=by.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=by.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=by.w3cTraceId(),this.spanId=by.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=by.w3cTraceId(),this.spanId=by.w3cTraceId().substr(0,16)),this.version.match(/^0[0-9a-f]$/g)||(this.version=t.DEFAULT_VERSION),this.traceFlag.match(/^[0-9a-f]{2}$/g)||(this.traceFlag=t.DEFAULT_TRACE_FLAG,this.traceId=by.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=by.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=by.w3cTraceId().substr(0,16),this.traceId=by.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=dwa.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=by.w3cTraceId()),r.indexOf("|")!==-1&&(r=r.substring(1+r.substring(0,r.length-1).lastIndexOf("."),r.length-1)),this.traceId=s,this.spanId=r}else this.traceId=by.w3cTraceId(),this.spanId=by.w3cTraceId().substr(0,16)}return a(t,"Traceparent"),t.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&e!=="00000000000000000000000000000000"},t.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&e!=="0000000000000000"},t.formatOpenTelemetryTraceFlags=function(e){var r="0"+e.toString(16);return r.substring(r.length-2)},t.prototype.getBackCompatRequestId=function(){return"|".concat(this.traceId,".").concat(this.spanId,".")},t.prototype.toString=function(){return"".concat(this.version,"-").concat(this.traceId,"-").concat(this.spanId,"-").concat(this.traceFlag)},t.prototype.updateSpanId=function(){this.spanId=by.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();aIi.exports=fwa});var UCr=I((bTp,cIi)=>{"use strict";p();var pwa=(function(){function t(e){this.fieldmap=[],e&&(this.fieldmap=this.parseHeader(e))}return a(t,"Tracestate"),t.prototype.toString=function(){var e=this.fieldmap;return!e||e.length==0?null:e.join(", ")},t.validateKeyChars=function(e){var r=e.split("@");if(r.length==2){var n=r[0].trim(),o=r[1].trim(),s=!!n.match(/^[\ ]?[a-z0-9\*\-\_/]{1,241}$/),c=!!o.match(/^[\ ]?[a-z0-9\*\-\_/]{1,14}$/);return s&&c}else if(r.length==1)return!!e.match(/^[\ ]?[a-z0-9\*\-\_/]{1,256}$/);return!1},t.prototype.parseHeader=function(e){var r=[],n={},o=e.split(",");if(o.length>32)return null;for(var s=0,c=o;s{"use strict";p();var hwa=(function(){function t(){}return a(t,"Domain"),t})();lIi.exports=hwa});var dIi=I((QCr,uIi)=>{"use strict";p();var mwa=QCr&&QCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),gwa=v6(),Awa=(function(t){mwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(gwa);uIi.exports=Awa});var qCr=I((PTp,fIi)=>{"use strict";p();var ywa=(function(){function t(){}return a(t,"Base"),t})();fIi.exports=ywa});var hIi=I((MTp,pIi)=>{"use strict";p();var _wa=(function(){function t(){this.applicationVersion="ai.application.ver",this.deviceId="ai.device.id",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceOEMName="ai.device.oemName",this.deviceOSVersion="ai.device.osVersion",this.deviceType="ai.device.type",this.locationIp="ai.location.ip",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.userAccountId="ai.user.accountId",this.userId="ai.user.id",this.userAuthUserId="ai.user.authUserId",this.cloudRole="ai.cloud.role",this.cloudRoleInstance="ai.cloud.roleInstance",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"}return a(t,"ContextTagKeys"),t})();pIi.exports=_wa});var gIi=I((jCr,mIi)=>{"use strict";p();var Ewa=jCr&&jCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),vwa=qCr(),Cwa=(function(t){Ewa(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})(vwa);mIi.exports=Cwa});var GCr=I((UTp,AIi)=>{"use strict";p();var HCr;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(HCr||(HCr={}));AIi.exports=HCr});var _Ii=I((qTp,yIi)=>{"use strict";p();var bwa=GCr(),Swa=(function(){function t(){this.kind=bwa.Measurement}return a(t,"DataPoint"),t})();yIi.exports=Swa});var vIi=I((GTp,EIi)=>{"use strict";p();var Twa=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();EIi.exports=Twa});var VCr=I(($Cr,CIi)=>{"use strict";p();var Iwa=$Cr&&$Cr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),xwa=v6(),wwa=(function(t){Iwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"EventData"),e})(xwa);CIi.exports=wwa});var SIi=I((WCr,bIi)=>{"use strict";p();var Rwa=WCr&&WCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),kwa=v6(),Pwa=(function(t){Rwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.exceptions=[],r.properties={},r.measurements={},r}return a(e,"ExceptionData"),e})(kwa);bIi.exports=Pwa});var IIi=I((JTp,TIi)=>{"use strict";p();var Dwa=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();TIi.exports=Dwa});var wIi=I((zCr,xIi)=>{"use strict";p();var Nwa=zCr&&zCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Mwa=v6(),Owa=(function(t){Nwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(Mwa);xIi.exports=Owa});var kIi=I((YCr,RIi)=>{"use strict";p();var Lwa=YCr&&YCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Bwa=v6(),Fwa=(function(t){Lwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.metrics=[],r.properties={},r}return a(e,"MetricData"),e})(Bwa);RIi.exports=Fwa});var DIi=I((KCr,PIi)=>{"use strict";p();var Uwa=KCr&&KCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Qwa=VCr(),qwa=(function(t){Uwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"PageViewData"),e})(Qwa);PIi.exports=qwa});var MIi=I((JCr,NIi)=>{"use strict";p();var jwa=JCr&&JCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Hwa=v6(),Gwa=(function(t){jwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.success=!0,r.properties={},r.measurements={},r}return a(e,"RemoteDependencyData"),e})(Hwa);NIi.exports=Gwa});var LIi=I((ZCr,OIi)=>{"use strict";p();var $wa=ZCr&&ZCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Vwa=v6(),Wwa=(function(t){$wa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"RequestData"),e})(Vwa);OIi.exports=Wwa});var FIi=I((uIp,BIi)=>{"use strict";p();var XCr;(function(t){t[t.Verbose=0]="Verbose",t[t.Information=1]="Information",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.Critical=4]="Critical"})(XCr||(XCr={}));BIi.exports=XCr});var QIi=I((fIp,UIi)=>{"use strict";p();var zwa=(function(){function t(){}return a(t,"StackFrame"),t})();UIi.exports=zwa});var ebr=I(Nm=>{"use strict";p();Object.defineProperty(Nm,"__esModule",{value:!0});Nm.AvailabilityData=dIi();Nm.Base=qCr();Nm.ContextTagKeys=hIi();Nm.Data=gIi();Nm.DataPoint=_Ii();Nm.DataPointType=GCr();Nm.Domain=v6();Nm.Envelope=vIi();Nm.EventData=VCr();Nm.ExceptionData=SIi();Nm.ExceptionDetails=IIi();Nm.MessageData=wIi();Nm.MetricData=kIi();Nm.PageViewData=DIi();Nm.RemoteDependencyData=MIi();Nm.RequestData=LIi();Nm.SeverityLevel=FIi();Nm.StackFrame=QIi()});var qIi=I(z5e=>{"use strict";p();Object.defineProperty(z5e,"__esModule",{value:!0});z5e.RemoteDependencyDataConstants=void 0;z5e.domainSupportsProperties=Kwa;var Ote=ebr(),Ywa=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();z5e.RemoteDependencyDataConstants=Ywa;function Kwa(t){return"properties"in t||t instanceof Ote.EventData||t instanceof Ote.ExceptionData||t instanceof Ote.MessageData||t instanceof Ote.MetricData||t instanceof Ote.PageViewData||t instanceof Ote.RemoteDependencyData||t instanceof Ote.RequestData}a(Kwa,"domainSupportsProperties")});var HIi=I(jIi=>{"use strict";p();Object.defineProperty(jIi,"__esModule",{value:!0})});var $Ii=I(GIi=>{"use strict";p();Object.defineProperty(GIi,"__esModule",{value:!0})});var WIi=I(VIi=>{"use strict";p();Object.defineProperty(VIi,"__esModule",{value:!0})});var YIi=I(zIi=>{"use strict";p();Object.defineProperty(zIi,"__esModule",{value:!0})});var JIi=I(KIi=>{"use strict";p();Object.defineProperty(KIi,"__esModule",{value:!0})});var XIi=I(ZIi=>{"use strict";p();Object.defineProperty(ZIi,"__esModule",{value:!0})});var txi=I(exi=>{"use strict";p();Object.defineProperty(exi,"__esModule",{value:!0})});var nxi=I(rxi=>{"use strict";p();Object.defineProperty(rxi,"__esModule",{value:!0})});var oxi=I(ixi=>{"use strict";p();Object.defineProperty(ixi,"__esModule",{value:!0})});var axi=I(sxi=>{"use strict";p();Object.defineProperty(sxi,"__esModule",{value:!0})});var lxi=I(cxi=>{"use strict";p();Object.defineProperty(cxi,"__esModule",{value:!0})});var dxi=I(uxi=>{"use strict";p();Object.defineProperty(uxi,"__esModule",{value:!0})});var fxi=I(a$=>{"use strict";p();Object.defineProperty(a$,"__esModule",{value:!0});a$.TelemetryType=a$.TelemetryTypeString=void 0;a$.telemetryTypeToBaseType=Jwa;a$.baseTypeToTelemetryType=Zwa;function Jwa(t){switch(t){case tA.Event:return"EventData";case tA.Exception:return"ExceptionData";case tA.Trace:return"MessageData";case tA.Metric:return"MetricData";case tA.Request:return"RequestData";case tA.Dependency:return"RemoteDependencyData";case tA.Availability:return"AvailabilityData";case tA.PageView:return"PageViewData"}}a(Jwa,"telemetryTypeToBaseType");function Zwa(t){switch(t){case"EventData":return tA.Event;case"ExceptionData":return tA.Exception;case"MessageData":return tA.Trace;case"MetricData":return tA.Metric;case"RequestData":return tA.Request;case"RemoteDependencyData":return tA.Dependency;case"AvailabilityData":return tA.Availability;case"PageViewData":return tA.PageView}}a(Zwa,"baseTypeToTelemetryType");a$.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var tA;(function(t){t[t.Event=0]="Event",t[t.Exception=1]="Exception",t[t.Trace=2]="Trace",t[t.Metric=3]="Metric",t[t.Request=4]="Request",t[t.Dependency=5]="Dependency",t[t.Availability=6]="Availability",t[t.PageView=7]="PageView"})(tA||(a$.TelemetryType=tA={}))});var pxi=I(Ng=>{"use strict";p();var Xwa=Ng&&Ng.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),AI=Ng&&Ng.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Xwa(e,t,r)};Object.defineProperty(Ng,"__esModule",{value:!0});AI(HIi(),Ng);AI($Ii(),Ng);AI(WIi(),Ng);AI(YIi(),Ng);AI(JIi(),Ng);AI(XIi(),Ng);AI(txi(),Ng);AI(nxi(),Ng);AI(oxi(),Ng);AI(axi(),Ng);AI(lxi(),Ng);AI(dxi(),Ng);AI(fxi(),Ng)});var mxi=I(hxi=>{"use strict";p();Object.defineProperty(hxi,"__esModule",{value:!0})});var Axi=I(gxi=>{"use strict";p();Object.defineProperty(gxi,"__esModule",{value:!0})});var _xi=I(yxi=>{"use strict";p();Object.defineProperty(yxi,"__esModule",{value:!0})});var vxi=I(Exi=>{"use strict";p();Object.defineProperty(Exi,"__esModule",{value:!0})});var bxi=I(Cxi=>{"use strict";p();Object.defineProperty(Cxi,"__esModule",{value:!0})});var Txi=I(Sxi=>{"use strict";p();Object.defineProperty(Sxi,"__esModule",{value:!0})});var xxi=I(Ixi=>{"use strict";p();Object.defineProperty(Ixi,"__esModule",{value:!0})});var Rxi=I(wxi=>{"use strict";p();Object.defineProperty(wxi,"__esModule",{value:!0})});var kxi=I(fS=>{"use strict";p();var eRa=fS&&fS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),c$=fS&&fS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eRa(e,t,r)};Object.defineProperty(fS,"__esModule",{value:!0});c$(mxi(),fS);c$(Axi(),fS);c$(_xi(),fS);c$(vxi(),fS);c$(bxi(),fS);c$(Txi(),fS);c$(xxi(),fS);c$(Rxi(),fS)});var Z_=I(cL=>{"use strict";p();var tRa=cL&&cL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),S0t=cL&&cL.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tRa(e,t,r)};Object.defineProperty(cL,"__esModule",{value:!0});S0t(qIi(),cL);S0t(ebr(),cL);S0t(pxi(),cL);S0t(kxi(),cL)});var tbr=I((yxp,Pxi)=>{"use strict";p();var rRa=(function(){function t(){}return a(t,"RequestParser"),t.prototype.getUrl=function(){return this.url},t.prototype.RequestParser=function(){this.startTime=+new Date},t.prototype._setStatus=function(e,r){var n=+new Date;this.duration=n-this.startTime,this.statusCode=e;var o=this.properties||{};if(r){if(typeof r=="string")o.error=r;else if(r instanceof Error)o.error=r.message;else if(typeof r=="object")for(var s in r)o[s]=r[s]&&r[s].toString&&r[s].toString()}this.properties=o},t.prototype._isSuccess=function(){return 0{"use strict";p();var MD;Object.defineProperty(Vr,"__esModule",{value:!0});Vr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE=Vr.WEB_INSTRUMENTATION_DEFAULT_SOURCE=Vr.TIME_SINCE_ENQUEUED=Vr.ENQUEUED_TIME=Vr.MessageBusDestination=Vr.MicrosoftEventHub=Vr.AzNamespace=Vr.AttachTypePrefix=Vr.HttpRequestCookieNames=Vr.StatsbeatNetworkCategory=Vr.StatsbeatFeatureType=Vr.StatsbeatInstrumentation=Vr.StatsbeatFeature=Vr.StatsbeatCounter=Vr.StatsbeatAttach=Vr.StatsbeatResourceProvider=Vr.StatsbeatTelemetryName=Vr.HeartBeatMetricName=Vr.DependencyTypeName=Vr.TelemetryTypeStringToQuickPulseDocumentType=Vr.TelemetryTypeStringToQuickPulseType=Vr.QuickPulseType=Vr.QuickPulseDocumentType=Vr.PerformanceToQuickPulseCounter=Vr.MetricId=Vr.PerformanceCounter=Vr.QuickPulseCounter=Vr.DEFAULT_LIVEMETRICS_HOST=Vr.DEFAULT_LIVEMETRICS_ENDPOINT=Vr.DEFAULT_BREEZE_ENDPOINT=Vr.APPLICATION_INSIGHTS_SDK_VERSION=void 0;Vr.APPLICATION_INSIGHTS_SDK_VERSION="2.9.8";Vr.DEFAULT_BREEZE_ENDPOINT="https://dc.services.visualstudio.com";Vr.DEFAULT_LIVEMETRICS_ENDPOINT="https://rt.services.visualstudio.com";Vr.DEFAULT_LIVEMETRICS_HOST="rt.services.visualstudio.com";var Sy;(function(t){t.COMMITTED_BYTES="\\Memory\\Committed Bytes",t.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",t.REQUEST_RATE="\\ApplicationInsights\\Requests/Sec",t.REQUEST_FAILURE_RATE="\\ApplicationInsights\\Requests Failed/Sec",t.REQUEST_DURATION="\\ApplicationInsights\\Request Duration",t.DEPENDENCY_RATE="\\ApplicationInsights\\Dependency Calls/Sec",t.DEPENDENCY_FAILURE_RATE="\\ApplicationInsights\\Dependency Calls Failed/Sec",t.DEPENDENCY_DURATION="\\ApplicationInsights\\Dependency Call Duration",t.EXCEPTION_RATE="\\ApplicationInsights\\Exceptions/Sec"})(Sy||(Vr.QuickPulseCounter=Sy={}));var Y5e;(function(t){t.PRIVATE_BYTES="\\Process(??APP_WIN32_PROC??)\\Private Bytes",t.AVAILABLE_BYTES="\\Memory\\Available Bytes",t.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",t.PROCESS_TIME="\\Process(??APP_WIN32_PROC??)\\% Processor Time",t.REQUEST_RATE="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec",t.REQUEST_DURATION="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time"})(Y5e||(Vr.PerformanceCounter=Y5e={}));var Dxi;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(Dxi||(Vr.MetricId=Dxi={}));Vr.PerformanceToQuickPulseCounter=(MD={},MD[Y5e.PROCESSOR_TIME]=Sy.PROCESSOR_TIME,MD[Y5e.REQUEST_RATE]=Sy.REQUEST_RATE,MD[Y5e.REQUEST_DURATION]=Sy.REQUEST_DURATION,MD[Sy.COMMITTED_BYTES]=Sy.COMMITTED_BYTES,MD[Sy.REQUEST_FAILURE_RATE]=Sy.REQUEST_FAILURE_RATE,MD[Sy.DEPENDENCY_RATE]=Sy.DEPENDENCY_RATE,MD[Sy.DEPENDENCY_FAILURE_RATE]=Sy.DEPENDENCY_FAILURE_RATE,MD[Sy.DEPENDENCY_DURATION]=Sy.DEPENDENCY_DURATION,MD[Sy.EXCEPTION_RATE]=Sy.EXCEPTION_RATE,MD);Vr.QuickPulseDocumentType={Event:"Event",Exception:"Exception",Trace:"Trace",Metric:"Metric",Request:"Request",Dependency:"RemoteDependency",Availability:"Availability",PageView:"PageView"};Vr.QuickPulseType={Event:"EventTelemetryDocument",Exception:"ExceptionTelemetryDocument",Trace:"TraceTelemetryDocument",Metric:"MetricTelemetryDocument",Request:"RequestTelemetryDocument",Dependency:"DependencyTelemetryDocument",Availability:"AvailabilityTelemetryDocument",PageView:"PageViewTelemetryDocument"};Vr.TelemetryTypeStringToQuickPulseType={EventData:Vr.QuickPulseType.Event,ExceptionData:Vr.QuickPulseType.Exception,MessageData:Vr.QuickPulseType.Trace,MetricData:Vr.QuickPulseType.Metric,RequestData:Vr.QuickPulseType.Request,RemoteDependencyData:Vr.QuickPulseType.Dependency,AvailabilityData:Vr.QuickPulseType.Availability,PageViewData:Vr.QuickPulseType.PageView};Vr.TelemetryTypeStringToQuickPulseDocumentType={EventData:Vr.QuickPulseDocumentType.Event,ExceptionData:Vr.QuickPulseDocumentType.Exception,MessageData:Vr.QuickPulseDocumentType.Trace,MetricData:Vr.QuickPulseDocumentType.Metric,RequestData:Vr.QuickPulseDocumentType.Request,RemoteDependencyData:Vr.QuickPulseDocumentType.Dependency,AvailabilityData:Vr.QuickPulseDocumentType.Availability,PageViewData:Vr.QuickPulseDocumentType.PageView};Vr.DependencyTypeName={Grpc:"GRPC",Http:"HTTP",InProc:"InProc",Sql:"SQL",QueueMessage:"Queue Message"};Vr.HeartBeatMetricName="HeartbeatState";Vr.StatsbeatTelemetryName="Statsbeat";Vr.StatsbeatResourceProvider={appsvc:"appsvc",aks:"aks",functions:"functions",vm:"vm",unknown:"unknown"};Vr.StatsbeatAttach={codeless:"IntegratedAuto",sdk:"Manual"};Vr.StatsbeatCounter={REQUEST_SUCCESS:"Request_Success_Count",REQUEST_FAILURE:"Request_Failure_Count",REQUEST_DURATION:"Request_Duration",RETRY_COUNT:"Retry_Count",THROTTLE_COUNT:"Throttle_Count",EXCEPTION_COUNT:"Exception_Count",ATTACH:"Attach",FEATURE:"Feature"};var Nxi;(function(t){t[t.NONE=0]="NONE",t[t.DISK_RETRY=1]="DISK_RETRY",t[t.AAD_HANDLING=2]="AAD_HANDLING",t[t.BROWSER_SDK_LOADER=4]="BROWSER_SDK_LOADER",t[t.LIVE_METRICS=16]="LIVE_METRICS",t[t.NATIVE_METRICS=8192]="NATIVE_METRICS"})(Nxi||(Vr.StatsbeatFeature=Nxi={}));var Mxi;(function(t){t[t.NONE=0]="NONE",t[t.AZURE_CORE_TRACING=1]="AZURE_CORE_TRACING",t[t.MONGODB=2]="MONGODB",t[t.MYSQL=4]="MYSQL",t[t.REDIS=8]="REDIS",t[t.POSTGRES=16]="POSTGRES",t[t.BUNYAN=32]="BUNYAN",t[t.WINSTON=64]="WINSTON",t[t.CONSOLE=128]="CONSOLE"})(Mxi||(Vr.StatsbeatInstrumentation=Mxi={}));var Oxi;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(Oxi||(Vr.StatsbeatFeatureType=Oxi={}));var Lxi;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(Lxi||(Vr.StatsbeatNetworkCategory=Lxi={}));var Bxi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(Bxi||(Vr.HttpRequestCookieNames=Bxi={}));var Fxi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(Fxi||(Vr.AttachTypePrefix=Fxi={}));Vr.AzNamespace="az.namespace";Vr.MicrosoftEventHub="Microsoft.EventHub";Vr.MessageBusDestination="message_bus.destination";Vr.ENQUEUED_TIME="enqueuedTime";Vr.TIME_SINCE_ENQUEUED="timeSinceEnqueued";Vr.WEB_INSTRUMENTATION_DEFAULT_SOURCE="https://js.monitor.azure.com/scripts/b/ai";Vr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE="https://az416426.vo.msecnd.net/scripts/b/ai"});var obr=I((ibr,Uxi)=>{"use strict";p();var nRa=ibr&&ibr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),T0t=require("url"),iRa=Z_(),rbr=Cy(),yI=Y0e(),oRa=tbr(),l$=Mte(),sRa=UCr(),nbr=b0t(),aRa=lu(),I0t=Id(),cRa=(function(t){nRa(e,t);function e(r,n){var o=t.call(this)||this;return r&&(o.method=r.method,o.url=o._getAbsoluteUrl(r),o.startTime=+new Date,o.socketRemoteAddress=r.socket&&r.socket.remoteAddress,o.parseHeaders(r,n),r.connection&&(o.connectionRemoteAddress=r.connection.remoteAddress,o.legacySocketRemoteAddress=r.connection.socket&&r.connection.socket.remoteAddress)),o}return a(e,"HttpRequestParser"),e.prototype.onError=function(r,n){this._setStatus(void 0,r),n&&(this.duration=n)},e.prototype.onResponse=function(r,n){this._setStatus(r.statusCode,void 0),n&&(this.duration=n)},e.prototype.getRequestTelemetry=function(r){var n=this.method;try{n+=" "+new T0t.URL(this.url).pathname}catch{}var o={id:this.requestId,name:n,url:this.url,source:this.sourceCorrelationId,duration:this.duration,resultCode:this.statusCode?this.statusCode.toString():null,success:this._isSuccess(),properties:this.properties};if(r&&r.time?o.time=r.time:this.startTime&&(o.time=new Date(this.startTime)),r){for(var s in r)o[s]||(o[s]=r[s]);if(r.properties)for(var s in r.properties)o.properties[s]=r.properties[s]}return o},e.prototype.getRequestTags=function(r){var n={};for(var o in r)n[o]=r[o];return n[e.keys.locationIp]=r[e.keys.locationIp]||this._getIp(),n[e.keys.sessionId]=r[e.keys.sessionId]||this._getId(I0t.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(I0t.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(I0t.HttpRequestCookieNames.AUTH_USER),n[e.keys.operationName]=this.getOperationName(r),n[e.keys.operationParentId]=this.getOperationParentId(r),n[e.keys.operationId]=this.getOperationId(r),n},e.prototype.getOperationId=function(r){return r[e.keys.operationId]||this.operationId},e.prototype.getOperationParentId=function(r){return r[e.keys.operationParentId]||this.parentId||this.getOperationId(r)},e.prototype.getOperationName=function(r){if(r[e.keys.operationName])return r[e.keys.operationName];var n="";try{n=new T0t.URL(this.url).pathname}catch{}var o=this.method;return n&&(o+=" "+n),o},e.prototype.getRequestId=function(){return this.requestId},e.prototype.getCorrelationContextHeader=function(){return this.correlationContextHeader},e.prototype.getTraceparent=function(){return this.traceparent},e.prototype.getTracestate=function(){return this.tracestate},e.prototype.getLegacyRootId=function(){return this.legacyRootId},e.prototype._getAbsoluteUrl=function(r){if(!r.headers)return r.url;var n=r.connection?r.connection.encrypted:null,o=n||r.headers["x-forwarded-proto"]=="https"?"https":"http",s=o+"://"+r.headers.host+"/",c="",l="";try{var u=new T0t.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=T0t.format({protocol:o,host:r.headers.host,pathname:c,search:l});return d},e.prototype._getIp=function(){var r=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/,n=a(function(s){var c=r.exec(s);if(c)return c[0]},"check"),o=n(this.rawHeaders["x-forwarded-for"])||n(this.rawHeaders["x-client-ip"])||n(this.rawHeaders["x-real-ip"])||n(this.connectionRemoteAddress)||n(this.socketRemoteAddress)||n(this.legacySocketRemoteAddress);return!o&&this.connectionRemoteAddress&&this.connectionRemoteAddress.substr&&this.connectionRemoteAddress.substr(0,2)==="::"&&(o="127.0.0.1"),o},e.prototype._getId=function(r){var n=this.rawHeaders&&this.rawHeaders.cookie&&typeof this.rawHeaders.cookie=="string"&&this.rawHeaders.cookie||"";if(r===I0t.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",aRa.warn("Could not decode the auth cookie with error: ",rbr.dumpObj(s))}var o=e.parseId(rbr.getCookie(r,n));return o},e.prototype.setBackCompatFromThisTraceContext=function(){this.operationId=this.traceparent.traceId,this.traceparent.legacyRootId&&(this.legacyRootId=this.traceparent.legacyRootId),this.parentId=this.traceparent.parentId,this.traceparent.updateSpanId(),this.requestId=this.traceparent.getBackCompatRequestId()},e.prototype.parseHeaders=function(r,n){if(this.rawHeaders=r.headers||r.rawHeaders,this.userAgent=r.headers&&r.headers["user-agent"],this.sourceCorrelationId=rbr.getCorrelationContextTarget(r,yI.requestContextSourceKey),r.headers){var o=r.headers[yI.traceStateHeader]?r.headers[yI.traceStateHeader].toString():null,s=r.headers[yI.traceparentHeader]?r.headers[yI.traceparentHeader].toString():null,c=r.headers[yI.requestIdHeader]?r.headers[yI.requestIdHeader].toString():null,l=r.headers[yI.parentIdHeader]?r.headers[yI.parentIdHeader].toString():null,u=r.headers[yI.rootIdHeader]?r.headers[yI.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[yI.correlationContextHeader]?r.headers[yI.correlationContextHeader].toString():null,l$.w3cEnabled&&(s||o)?(this.traceparent=new nbr(s?s.toString():null),this.tracestate=s&&o&&new sRa(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?l$.w3cEnabled?(this.traceparent=new nbr(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=l$.generateRequestId(this.parentId),this.operationId=l$.getRootId(this.requestId)):l$.w3cEnabled?(this.traceparent=new nbr,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=l$.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=l$.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=l$.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new iRa.ContextTagKeys,e})(oRa);Uxi.exports=cRa});var rwi=I((Eo,twi)=>{p();Eo=twi.exports=Qa;var Cl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?Cl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):Cl=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var K5e=256,x0t=Number.MAX_SAFE_INTEGER||9007199254740991,sbr=16,lRa=K5e-6,J5e=Eo.re=[],qu=Eo.safeRe=[],ir=Eo.src=[],ba=0,dbr="[a-zA-Z0-9-]",abr=[["\\s",1],["\\d",K5e],[dbr,lRa]];function N0t(t){for(var e=0;e)?=?)";var w0t=ba++;ir[w0t]=ir[Z0e]+"|x|X|\\*";var R0t=ba++;ir[R0t]=ir[J0e]+"|x|X|\\*";var Lte=ba++;ir[Lte]="[v=\\s]*("+ir[R0t]+")(?:\\.("+ir[R0t]+")(?:\\.("+ir[R0t]+")(?:"+ir[pbr]+")?"+ir[X5e]+"?)?)?";var eAe=ba++;ir[eAe]="[v=\\s]*("+ir[w0t]+")(?:\\.("+ir[w0t]+")(?:\\.("+ir[w0t]+")(?:"+ir[hbr]+")?"+ir[X5e]+"?)?)?";var Gxi=ba++;ir[Gxi]="^"+ir[nAe]+"\\s*"+ir[Lte]+"$";var $xi=ba++;ir[$xi]="^"+ir[nAe]+"\\s*"+ir[eAe]+"$";var Vxi=ba++;ir[Vxi]="(?:^|[^\\d])(\\d{1,"+sbr+"})(?:\\.(\\d{1,"+sbr+"}))?(?:\\.(\\d{1,"+sbr+"}))?(?:$|[^\\d])";var M0t=ba++;ir[M0t]="(?:~>?)";var tAe=ba++;ir[tAe]="(\\s*)"+ir[M0t]+"\\s+";J5e[tAe]=new RegExp(ir[tAe],"g");qu[tAe]=new RegExp(N0t(ir[tAe]),"g");var uRa="$1~",Wxi=ba++;ir[Wxi]="^"+ir[M0t]+ir[Lte]+"$";var zxi=ba++;ir[zxi]="^"+ir[M0t]+ir[eAe]+"$";var O0t=ba++;ir[O0t]="(?:\\^)";var rAe=ba++;ir[rAe]="(\\s*)"+ir[O0t]+"\\s+";J5e[rAe]=new RegExp(ir[rAe],"g");qu[rAe]=new RegExp(N0t(ir[rAe]),"g");var dRa="$1^",Yxi=ba++;ir[Yxi]="^"+ir[O0t]+ir[Lte]+"$";var Kxi=ba++;ir[Kxi]="^"+ir[O0t]+ir[eAe]+"$";var ybr=ba++;ir[ybr]="^"+ir[nAe]+"\\s*("+gbr+")$|^$";var _br=ba++;ir[_br]="^"+ir[nAe]+"\\s*("+Hxi+")$|^$";var Bte=ba++;ir[Bte]="(\\s*)"+ir[nAe]+"\\s*("+gbr+"|"+ir[Lte]+")";J5e[Bte]=new RegExp(ir[Bte],"g");qu[Bte]=new RegExp(N0t(ir[Bte]),"g");var fRa="$1$2$3",Jxi=ba++;ir[Jxi]="^\\s*("+ir[Lte]+")\\s+-\\s+("+ir[Lte]+")\\s*$";var Zxi=ba++;ir[Zxi]="^\\s*("+ir[eAe]+")\\s+-\\s+("+ir[eAe]+")\\s*$";var Xxi=ba++;ir[Xxi]="(<|>)?=?\\s*\\*";for(lL=0;lLK5e)return null;var r=e.loose?qu[Abr]:qu[mbr];if(!r.test(t))return null;try{return new Qa(t,e)}catch{return null}}a(Fte,"parse");Eo.valid=pRa;function pRa(t,e){var r=Fte(t,e);return r?r.version:null}a(pRa,"valid");Eo.clean=hRa;function hRa(t,e){var r=Fte(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(hRa,"clean");Eo.SemVer=Qa;function Qa(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Qa){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>K5e)throw new TypeError("version is longer than "+K5e+" characters");if(!(this instanceof Qa))return new Qa(t,e);Cl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?qu[Abr]:qu[mbr]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>x0t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>x0t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>x0t||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var o=+n;if(o>=0&&o=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};Eo.inc=mRa;function mRa(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Qa(t,r).inc(e,n).version}catch{return null}}a(mRa,"inc");Eo.diff=gRa;function gRa(t,e){if(Ebr(t,e))return null;var r=Fte(t),n=Fte(e),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var s="prerelease"}for(var c in r)if((c==="major"||c==="minor"||c==="patch")&&r[c]!==n[c])return o+c;return s}a(gRa,"diff");Eo.compareIdentifiers=X0e;var Qxi=/^[0-9]+$/;function X0e(t,e){var r=Qxi.test(t),n=Qxi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(Z5e,"gt");Eo.lt=k0t;function k0t(t,e,r){return C6(t,e,r)<0}a(k0t,"lt");Eo.eq=Ebr;function Ebr(t,e,r){return C6(t,e,r)===0}a(Ebr,"eq");Eo.neq=ewi;function ewi(t,e,r){return C6(t,e,r)!==0}a(ewi,"neq");Eo.gte=vbr;function vbr(t,e,r){return C6(t,e,r)>=0}a(vbr,"gte");Eo.lte=Cbr;function Cbr(t,e,r){return C6(t,e,r)<=0}a(Cbr,"lte");Eo.cmp=P0t;function P0t(t,e,r,n){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Ebr(t,r,n);case"!=":return ewi(t,r,n);case">":return Z5e(t,r,n);case">=":return vbr(t,r,n);case"<":return k0t(t,r,n);case"<=":return Cbr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(P0t,"cmp");Eo.Comparator=HR;function HR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof HR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof HR))return new HR(t,e);t=t.trim().split(/\s+/).join(" "),Cl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===e4e?this.value="":this.value=this.operator+this.semver.version,Cl("comp",this)}a(HR,"Comparator");var e4e={};HR.prototype.parse=function(t){var e=this.options.loose?qu[ybr]:qu[_br],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new Qa(r[2],this.options.loose):this.semver=e4e};HR.prototype.toString=function(){return this.value};HR.prototype.test=function(t){return Cl("Comparator.test",t,this.options.loose),this.semver===e4e?!0:(typeof t=="string"&&(t=new Qa(t,this.options)),P0t(t,this.operator,this.semver,this.options))};HR.prototype.intersects=function(t,e){if(!(t instanceof HR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Qf(t.value,e),D0t(this.value,r,e);if(t.operator==="")return r=new Qf(this.value,e),D0t(t.semver,r,e);var n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),l=P0t(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=P0t(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=Qf;function Qf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Qf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Qf(t.raw,e);if(t instanceof HR)return new Qf(t.value,e);if(!(this instanceof Qf))return new Qf(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}a(Qf,"Range");Qf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Qf.prototype.toString=function(){return this.range};Qf.prototype.parseRange=function(t){var e=this.options.loose,r=e?qu[Zxi]:qu[Jxi];t=t.replace(r,MRa),Cl("hyphen replace",t),t=t.replace(qu[Bte],fRa),Cl("comparator trim",t,qu[Bte]),t=t.replace(qu[tAe],uRa),t=t.replace(qu[rAe],dRa);var n=e?qu[ybr]:qu[_br],o=t.split(" ").map(function(s){return IRa(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter(function(s){return!!s.match(n)})),o=o.map(function(s){return new HR(s,this.options)},this),o};Qf.prototype.intersects=function(t,e){if(!(t instanceof Qf))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return t.set.some(function(o){return o.every(function(s){return n.intersects(s,e)})})})})};Eo.toComparators=TRa;function TRa(t,e){return new Qf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(TRa,"toComparators");function IRa(t,e){return Cl("comp",t,e),t=RRa(t,e),Cl("caret",t),t=xRa(t,e),Cl("tildes",t),t=PRa(t,e),Cl("xrange",t),t=NRa(t,e),Cl("stars",t),t}a(IRa,"parseComparator");function jv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(jv,"isX");function xRa(t,e){return t.trim().split(/\s+/).map(function(r){return wRa(r,e)}).join(" ")}a(xRa,"replaceTildes");function wRa(t,e){var r=e.loose?qu[zxi]:qu[Wxi];return t.replace(r,function(n,o,s,c,l){Cl("tilde",t,n,o,s,c,l);var u;return jv(o)?u="":jv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":jv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(Cl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",Cl("tilde return",u),u})}a(wRa,"replaceTilde");function RRa(t,e){return t.trim().split(/\s+/).map(function(r){return kRa(r,e)}).join(" ")}a(RRa,"replaceCarets");function kRa(t,e){Cl("caret",t,e);var r=e.loose?qu[Kxi]:qu[Yxi];return t.replace(r,function(n,o,s,c,l){Cl("caret",t,n,o,s,c,l);var u;return jv(o)?u="":jv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":jv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(Cl("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(Cl("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),Cl("caret return",u),u})}a(kRa,"replaceCaret");function PRa(t,e){return Cl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return DRa(r,e)}).join(" ")}a(PRa,"replaceXRanges");function DRa(t,e){t=t.trim();var r=e.loose?qu[$xi]:qu[Gxi];return t.replace(r,function(n,o,s,c,l,u){Cl("xRange",t,n,o,s,c,l,u);var d=jv(s),f=d||jv(c),h=f||jv(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),Cl("xRange return",n),n})}a(DRa,"replaceXRange");function NRa(t,e){return Cl("replaceStars",t,e),t.trim().replace(qu[Xxi],"")}a(NRa,"replaceStars");function MRa(t,e,r,n,o,s,c,l,u,d,f,h,m){return jv(r)?e="":jv(n)?e=">="+r+".0.0":jv(o)?e=">="+r+"."+n+".0":e=">="+e,jv(u)?l="":jv(d)?l="<"+(+u+1)+".0.0":jv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(MRa,"hyphenReplace");Qf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Qa(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(ORa,"testSet");Eo.satisfies=D0t;function D0t(t,e,r){try{e=new Qf(e,r)}catch{return!1}return e.test(t)}a(D0t,"satisfies");Eo.maxSatisfying=LRa;function LRa(t,e,r){var n=null,o=null;try{var s=new Qf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Qa(n,r))}),n}a(LRa,"maxSatisfying");Eo.minSatisfying=BRa;function BRa(t,e,r){var n=null,o=null;try{var s=new Qf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Qa(n,r))}),n}a(BRa,"minSatisfying");Eo.minVersion=FRa;function FRa(t,e){t=new Qf(t,e);var r=new Qa("0.0.0");if(t.test(r)||(r=new Qa("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||Z5e(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(FRa,"minVersion");Eo.validRange=URa;function URa(t,e){try{return new Qf(t,e).range||"*"}catch{return null}}a(URa,"validRange");Eo.ltr=QRa;function QRa(t,e,r){return bbr(t,e,"<",r)}a(QRa,"ltr");Eo.gtr=qRa;function qRa(t,e,r){return bbr(t,e,">",r)}a(qRa,"gtr");Eo.outside=bbr;function bbr(t,e,r,n){t=new Qa(t,n),e=new Qf(e,n);var o,s,c,l,u;switch(r){case">":o=Z5e,s=Cbr,c=k0t,l=">",u=">=";break;case"<":o=k0t,s=vbr,c=Z5e,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(D0t(t,e,n))return!1;for(var d=0;d=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0}a(bbr,"outside");Eo.prerelease=jRa;function jRa(t,e){var r=Fte(t,e);return r&&r.prerelease.length?r.prerelease:null}a(jRa,"prerelease");Eo.intersects=HRa;function HRa(t,e,r){return t=new Qf(t,r),e=new Qf(e,r),t.intersects(e)}a(HRa,"intersects");Eo.coerce=GRa;function GRa(t){if(t instanceof Qa)return t;if(typeof t!="string")return null;var e=t.match(qu[Vxi]);return e==null?null:Fte(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(GRa,"coerce")});var F0t=I((xxp,swi)=>{"use strict";p();var iwi=L0e(),iAe=iwi.wrap,L0t=iwi.unwrap,b6="wrap@before";function B0t(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(B0t,"defineProperty");function $Ra(t,e){for(var r=e.length,n=0;n0&&$Ra(t,o)}a(VRa,"_findAndProcess");function nwi(t,e){if(t){var r=t;if(typeof t=="function")r=e(t);else if(Array.isArray(t)){r=[];for(var n=0;n{"use strict";p();var jc=require("util"),S6=require("assert"),WRa=F0t(),xd=require("async_hooks"),t4e="cls@contexts",r4e="error@context",qf=process.env.DEBUG_CLS_HOOKED,qc=-1;lwi.exports={getNamespace:awi,createNamespace:zRa,destroyNamespace:cwi,reset:YRa,ERROR_SYMBOL:r4e};function GR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}a(GR,"Namespace");GR.prototype.set=a(function(e,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");if(this.active[e]=r,qf){let n=" ".repeat(this._indent<0?0:this._indent);af(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+qc+" active:"+jc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");GR.prototype.get=a(function(e){if(!this.active){if(qf){let r=xd.currentId(),n=xd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);af(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${qc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(qf){let r=xd.executionAsyncId(),n=xd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);af(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+qc+" active:"+jc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),af(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${qc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${jc.inspect(this.active)}`)}return this.active[e]},"get");GR.prototype.createContext=a(function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=qc,qf){let r=xd.executionAsyncId(),n=xd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);af(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${qc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${jc.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},"createContext");GR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{if(qf){let n=xd.triggerAsyncId(),o=xd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);af(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${qc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${jc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[r4e]=r),n}finally{if(qf){let n=xd.triggerAsyncId(),o=xd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);af(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${qc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${jc.inspect(r)}`)}this.exit(r)}},"run");GR.prototype.runAndReturn=a(function(e){let r;return this.run(function(n){r=e(n)}),r},"runAndReturn");GR.prototype.runPromise=a(function(e){let r=this.createContext();this.enter(r);let n=e(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return qf&&af("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+qc+" len:"+this._set.length+" "+jc.inspect(r)),n.then(o=>(qf&&af("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+qc+" len:"+this._set.length+" "+jc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[r4e]=r,qf&&af("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+qc+" len:"+this._set.length+" "+jc.inspect(r)),this.exit(r),o})},"runPromise");GR.prototype.bind=a(function(e,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return a(function(){n.enter(r);try{return e.apply(this,arguments)}catch(s){throw s&&(s[r4e]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");GR.prototype.enter=a(function(e){if(S6.ok(e,"context must be provided for entering"),qf){let r=xd.executionAsyncId(),n=xd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);af(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${qc} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${jc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");GR.prototype.exit=a(function(e){if(S6.ok(e,"context must be provided for exiting"),qf){let n=xd.executionAsyncId(),o=xd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);af(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${qc} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${jc.inspect(e)}`)}if(this.active===e){S6.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(qf&&af("??ERROR?? context exiting but not entered - ignoring: "+jc.inspect(e)),S6.ok(r>=0,`context not currently entered; can't exit. +`+s),t.push(o+"m+"+xgt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=gga()+e+" "+t[0]}a(mga,"formatArgs");function gga(){return eA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(gga,"getDate");function Aga(...t){return process.stderr.write(Igt.formatWithOptions(eA.inspectOpts,...t)+` +`)}a(Aga,"log");function yga(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(yga,"save");function _ga(){return process.env.DEBUG}a(_ga,"load");function Ega(t){t.inspectOpts={};let e=Object.keys(eA.inspectOpts);for(let r=0;re.trim()).join(" ")};l0i.O=function(t){return this.inspectOpts.colors=this.useColors,Igt.inspect(t,this.inspectOpts)}});var d0i=I((dEp,Svr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Svr.exports=c0i():Svr.exports=u0i()});var Ivr=I((pEp,f0i)=>{"use strict";p();var Tvr=require("path").sep;f0i.exports=function(t){var e=t.split(Tvr),r=e.lastIndexOf("node_modules");if(r!==-1&&e[r+1]){for(var n=e[r+1][0]==="@",o=n?e[r+1]+"/"+e[r+2]:e[r+1],s=n?3:2,c="",l=r+s-1,u=0;u<=l;u++)u===l?c+=e[u]:c+=e[u]+Tvr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+Tvr;return{name:o,basedir:c,path:d}}}});var xvr=I((mEp,p0i)=>{"use strict";p();var vga=require("os");p0i.exports=vga.homedir||a(function(){var e=process.env.HOME,r=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform==="darwin"?e||(r?"/Users/"+r:null):process.platform==="linux"?e||(process.getuid()===0?"/root":r?"/home/"+r:null):e||null},"homedir")});var wvr=I((yEp,h0i)=>{p();h0i.exports=function(){var t=Error.prepareStackTrace;Error.prepareStackTrace=function(r,n){return n};var e=new Error().stack;return Error.prepareStackTrace=t,e[2].getFileName()}});var m0i=I((EEp,D5e)=>{"use strict";p();var Cga=process.platform==="win32",bga=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Rvr={};function Sga(t){return bga.exec(t).slice(1)}a(Sga,"win32SplitPath");Rvr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Sga(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var Tga=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,kvr={};function Iga(t){return Tga.exec(t).slice(1)}a(Iga,"posixSplitPath");kvr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Iga(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};Cga?D5e.exports=Rvr.parse:D5e.exports=kvr.parse;D5e.exports.posix=kvr.parse;D5e.exports.win32=Rvr.parse});var Pvr=I((bEp,_0i)=>{p();var y0i=require("path"),g0i=y0i.parse||m0i(),A0i=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=g0i(e);s.dir!==o[o.length-1];)o.push(s.dir),s=g0i(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return y0i.resolve(n,l,u)}))},[])},"getNodeModulesDirs");_0i.exports=a(function(e,r,n){var o=r&&r.moduleDirectory?[].concat(r.moduleDirectory):["node_modules"];if(r&&typeof r.paths=="function")return r.paths(n,e,function(){return A0i(e,o)},r);var s=A0i(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var Dvr=I((IEp,E0i)=>{p();E0i.exports=function(t,e){return e||{}}});var b0i=I((wEp,C0i)=>{"use strict";p();var xga="Function.prototype.bind called on incompatible ",wga=Object.prototype.toString,Rga=Math.max,kga="[object Function]",v0i=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var Nga=b0i();S0i.exports=Function.prototype.bind||Nga});var x0i=I((NEp,I0i)=>{"use strict";p();var Mga=Function.prototype.call,Oga=Object.prototype.hasOwnProperty,Lga=T0i();I0i.exports=Lga.call(Mga,Oga)});var w0i=I((OEp,Bga)=>{Bga.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var N5e=I((LEp,P0i)=>{"use strict";p();var Fga=x0i();function Uga(t,e){for(var r=t.split("."),n=e.split(" "),o=n.length>1?n[0]:"=",s=(n.length>1?n[1]:n[0]).split("."),c=0;c<3;++c){var l=parseInt(r[c]||0,10),u=parseInt(s[c]||0,10);if(l!==u)return o==="<"?l="?l>=u:!1}return o===">="}a(Uga,"specifierIncluded");function R0i(t,e){var r=e.split(/ ?&& ?/);if(r.length===0)return!1;for(var n=0;n"u"?process.versions&&process.versions.node:t;if(typeof r!="string")throw new TypeError(typeof t>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(e&&typeof e=="object"){for(var n=0;n{p();var bte=require("fs"),qga=xvr(),Nm=require("path"),jga=wvr(),Hga=Pvr(),Gga=Dvr(),$ga=N5e(),Vga=process.platform!=="win32"&&bte.realpath&&typeof bte.realpath.native=="function"?bte.realpath.native:bte.realpath,D0i=qga(),Wga=a(function(){return[Nm.join(D0i,".node_modules"),Nm.join(D0i,".node_libraries")]},"defaultPaths"),zga=a(function(e,r){bte.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isFile()||o.isFIFO())})},"isFile"),Yga=a(function(e,r){bte.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),Kga=a(function(e,r){Vga(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),M5e=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),Jga=a(function(e,r,n){e(r,function(o,s){if(o)n(o);else try{var c=JSON.parse(s);n(null,c)}catch{n(null)}})},"defaultReadPackage"),Zga=a(function(e,r,n){for(var o=Hga(r,n,e),s=0;s{Xga.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var U0i=I((HEp,F0i)=>{"use strict";p();var e0a=N5e(),L0i=O0i(),B0i={};for(wgt in L0i)Object.prototype.hasOwnProperty.call(L0i,wgt)&&(B0i[wgt]=e0a(wgt));var wgt;F0i.exports=B0i});var q0i=I(($Ep,Q0i)=>{p();var t0a=N5e();Q0i.exports=a(function(e){return t0a(e)},"isCore")});var G0i=I((zEp,H0i)=>{p();var r0a=N5e(),Ste=require("fs"),K_=require("path"),n0a=xvr(),i0a=wvr(),o0a=Pvr(),s0a=Dvr(),a0a=process.platform!=="win32"&&Ste.realpathSync&&typeof Ste.realpathSync.native=="function"?Ste.realpathSync.native:Ste.realpathSync,j0i=n0a(),c0a=a(function(){return[K_.join(j0i,".node_modules"),K_.join(j0i,".node_libraries")]},"defaultPaths"),l0a=a(function(e){try{var r=Ste.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&(r.isFile()||r.isFIFO())},"isFile"),u0a=a(function(e){try{var r=Ste.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),d0a=a(function(e){try{return a0a(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),O5e=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),f0a=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),p0a=a(function(e,r,n){for(var o=o0a(r,n,e),s=0;s{p();var Rgt=M0i();Rgt.core=U0i();Rgt.isCore=q0i();Rgt.sync=G0i();$0i.exports=Rgt});var V0i=I((XEp,h0a)=>{h0a.exports={name:"require-in-the-middle",version:"7.5.2",description:"Module to hook into the Node.js require function",main:"index.js",types:"types/index.d.ts",dependencies:{debug:"^4.3.5","module-details-from-path":"^1.0.3",resolve:"^1.22.8"},devDependencies:{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@babel/preset-typescript":"^7.9.0","@babel/register":"^7.9.0","ipp-printer":"^1.0.0",patterns:"^1.0.3",roundround:"^0.2.0",semver:"^6.3.0",standard:"^14.3.1",tape:"^4.11.0"},scripts:{test:"npm run test:lint && npm run test:tape && npm run test:babel","test:lint":"standard","test:tape":"tape test/*.js","test:babel":"node test/babel/babel-register.js"},repository:{type:"git",url:"git+https://github.com/nodejs/require-in-the-middle.git"},keywords:["require","hook","shim","shimmer","shimming","patch","monkey","monkeypatch","module","load"],files:["types"],author:"Thomas Watson Steen (https://twitter.com/wa7son)",license:"MIT",bugs:{url:"https://github.com/nodejs/require-in-the-middle/issues"},homepage:"https://github.com/nodejs/require-in-the-middle#readme",engines:{node:">=8.6.0"}}});var Bvr=I((evp,Lvr)=>{"use strict";p();var q0e=require("path"),DD=require("module"),Sh=d0i()("require-in-the-middle"),m0a=Ivr();Lvr.exports=L5e;Lvr.exports.Hook=L5e;var Mvr,Q0e;if(DD.isBuiltin)Q0e=DD.isBuiltin;else if(DD.builtinModules)Q0e=a(t=>t.startsWith("node:")?!0:(Mvr===void 0&&(Mvr=new Set(DD.builtinModules)),Mvr.has(t)),"isCore");else{let t=Nvr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?Q0e=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):Q0e=a(n=>!!t.core[n],"isCore")}var kgt;function g0a(t,e){if(!kgt)if(require.resolve&&require.resolve.paths)kgt=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=Nvr();kgt=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return kgt(t,e)}a(g0a,"resolve");var A0a=/([/\\]index)?(\.js)?$/,Ovr=class{static{a(this,"ExportsCache")}constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,r){if(this._localCache.has(e))return!0;if(r)return!1;{let n=require.cache[e];return!!(n&&this._kRitmExports in n)}}get(e,r){let n=this._localCache.get(e);if(n!==void 0)return n;if(!r){let o=require.cache[e];return o&&o[this._kRitmExports]}}set(e,r,n){n?this._localCache.set(e,r):e in require.cache?require.cache[e][this._kRitmExports]=r:(Sh('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function L5e(t,e,r){if(!(this instanceof L5e))return new L5e(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof DD._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof DD._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,V0i().bugs.url);return}this._cache=new Ovr,this._unhooked=!1,this._origRequire=DD.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);Sh("registering require hook"),this._require=DD.prototype.require=function(u){return n._unhooked===!0?(Sh("ignoring require call - module is soft-unhooked"),n._origRequire.apply(this,arguments)):l.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(u){return n._unhooked===!0?(Sh("ignoring process.getBuiltinModule call - module is soft-unhooked"),n._origGetBuiltinModule.apply(this,arguments)):l.call(this,arguments,!0)});function l(u,d){let f=u[0],h=Q0e(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);Q0e(v)&&(m=v)}}else{if(d)return Sh("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=DD._resolveFilename(f,this)}catch(v){return Sh('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(Sh("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return Sh("returning already patched cached module: %s",m),n._cache.get(m,h);let y=o.has(m);y===!1&&o.add(m);let _=d?n._origGetBuiltinModule.apply(this,u):n._origRequire.apply(this,u);if(y===!0)return Sh("module is in the process of being patched already - ignoring: %s",m),_;if(o.delete(m),h===!0){if(c===!0&&t.includes(m)===!1)return Sh("ignoring core module not on whitelist: %s",m),_;g=m}else if(c===!0&&t.includes(m)){let v=q0e.parse(m);g=v.name,A=v.dir}else{let v=m0a(m);if(v===void 0)return Sh("could not parse filename: %s",m),_;g=v.name,A=v.basedir;let S=y0a(v);Sh("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",g,f,S,A);let T=!1;if(c){if(!f.startsWith(".")&&t.includes(f)&&(g=f,T=!0),!t.includes(g)&&!t.includes(S))return _;t.includes(S)&&S!==g&&(g=S,T=!0)}if(!T){let w;try{w=g0a(g,A)}catch{return Sh("could not resolve module: %s",g),n._cache.set(m,_,h),_}if(w!==m)if(s===!0)g=g+q0e.sep+q0e.relative(A,m),Sh("preparing to process require of internal file: %s",g);else return Sh("ignoring require of non-main module file: %s",w),n._cache.set(m,_,h),_}}n._cache.set(m,_,h),Sh("calling require hook: %s",g);let E=r(_,g,A);return n._cache.set(m,E,h),Sh("returning module: %s",g),E}a(l,"patchedRequire")}a(L5e,"Hook");L5e.prototype.unhook=function(){this._unhooked=!0,this._require===DD.prototype.require?(DD.prototype.require=this._origRequire,Sh("require unhook successful")):Sh("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Sh("process.getBuiltinModule unhook successful")):Sh("process.getBuiltinModule unhook unsuccessful"))};function y0a(t){let e=q0e.sep!=="/"?t.path.split(q0e.sep).join("/"):t.path;return q0e.posix.join(t.name,e).replace(A0a,"")}a(y0a,"resolveModuleName")});var Pgt,Dgt,W0i=Se(()=>{p();Pgt=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},Dgt=class{static{a(this,"ModuleNameTrie")}_trie=new Pgt;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new Pgt,r.children.set(n,o)),r=o}r.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:r,fullOnly:n}={}){let o=this._trie,s=[],c=!0;for(let l of e.split("/")){let u=o.children.get(l);if(!u){c=!1;break}n||s.push(...u.hooks),o=u}return n&&c&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(r&&s.sort((l,u)=>l.insertedId-u.insertedId),s.map(({hook:l})=>l))}}});function E0a(t){return Fvr.sep!=="/"?t.split(Fvr.sep).join("/"):t}var Y0i,Fvr,_0a,Ngt,K0i=Se(()=>{p();Y0i=fe(Bvr()),Fvr=fe(require("path"));W0i();_0a=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),Ngt=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new Dgt;static _instance;constructor(){this._initialize()}_initialize(){new Y0i.Hook(null,{internals:!0},(e,r,n)=>{let o=E0a(r),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:n===void 0});for(let{onRequire:c}of s)e=c(e,r,n);return e})}register(e,r){let n={moduleName:e,onRequire:r};return this._moduleNameTrie.insert(n),n}static getInstance(){return _0a?new t:this._instance=this._instance??new t}};a(E0a,"normalizePathSeparators")});var rAi=I(Tte=>{p();var J0i=[],Uvr=new WeakMap,Z0i=new WeakMap,X0i=new Map,eAi=[],v0a={set(t,e,r){return Uvr.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=Z0i.get(t)[e];if(typeof r=="function")return r()},defineProperty(t,e,r){if(!("value"in r))throw new Error("Getters/setters are not supported for exports property descriptors.");return Uvr.get(t)[e](r.value)}};function C0a(t,e,r,n,o){X0i.set(t,o),Uvr.set(e,r),Z0i.set(e,n);let s=new Proxy(e,v0a);J0i.forEach(c=>c(t,s)),eAi.push([t,s])}a(C0a,"register");var tAi=!1;function b0a(){return tAi}a(b0a,"getExperimentalPatchInternals");function S0a(t){tAi=t}a(S0a,"setExperimentalPatchInternals");Tte.register=C0a;Tte.importHooks=J0i;Tte.specifiers=X0i;Tte.toHook=eAi;Tte.getExperimentalPatchInternals=b0a;Tte.setExperimentalPatchInternals=S0a});var cAi=I((pvp,j0e)=>{p();var nAi=require("path"),T0a=Ivr(),{fileURLToPath:iAi}=require("url"),{MessageChannel:I0a}=require("worker_threads"),{importHooks:Qvr,specifiers:x0a,toHook:w0a,getExperimentalPatchInternals:R0a}=rAi();function sAi(t){Qvr.push(t),w0a.forEach(([e,r])=>t(e,r))}a(sAi,"addHook");function aAi(t){let e=Qvr.indexOf(t);e>-1&&Qvr.splice(e,1)}a(aAi,"removeHook");function oAi(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(oAi,"callHookFn");var qvr;function k0a(){let{port1:t,port2:e}=new I0a,r=0,n;qvr=a(l=>{r++,t.postMessage(l)},"sendModulesToLoader"),t.on("message",()=>{r--,n&&r<=0&&n()}).unref();function o(){let l=setInterval(()=>{},1e3),u=new Promise(d=>{n=d}).then(()=>{clearInterval(l)});return r===0&&n(),u}a(o,"waitForAllMessagesAcknowledged");let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}a(k0a,"createAddHookMessageChannel");function B5e(t,e,r){if(!(this instanceof B5e))return new B5e(t,e,r);typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n=e?e.internals===!0:!1;qvr&&Array.isArray(t)&&qvr(t),this._iitmHook=(o,s)=>{let c=o,l=o.startsWith("node:"),u;if(l)o=o.replace(/^node:/,"");else{if(o.startsWith("file://"))try{o=iAi(o)}catch{}let d=T0a(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+nAi.sep+nAi.relative(u,iAi(c));else if(!R0a()&&!u.endsWith(x0a.get(c)))continue}oAi(r,s,o,u)}}else oAi(r,s,o,u)},sAi(this._iitmHook)}a(B5e,"Hook");B5e.prototype.unhook=function(){aAi(this._iitmHook)};j0e.exports=B5e;j0e.exports.Hook=B5e;j0e.exports.addHook=sAi;j0e.exports.removeHook=aAi;j0e.exports.createAddHookMessageChannel=k0a});function lAi(t,e,r){let n,o;try{o=t()}catch(s){n=s}finally{if(e(n,o),n&&!r)throw n;return o}}async function uAi(t,e,r){let n,o;try{o=await t()}catch(s){n=s}finally{if(e(n,o),n&&!r)throw n;return o}}function Mgt(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var jvr=Se(()=>{p();a(lAi,"safeExecuteInTheMiddle");a(uAi,"safeExecuteInTheMiddleAsync");a(Mgt,"isWrapped")});function dAi(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>Kgi(e,n,{includePrerelease:r}))}var _6,Hvr,F5e,fAi,pAi,hAi,H0e,mAi=Se(()=>{p();_6=fe(require("path")),Hvr=require("util");e0i();F5e=fe(L0e());i0i();K0i();fAi=fe(cAi());go();pAi=fe(Bvr()),hAi=require("fs");jvr();H0e=class extends bgt{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=Ngt.getInstance();_enabled=!1;constructor(e,r,n){super(e,r,n);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=a((e,r,n)=>{if(Mgt(e[r])&&this._unwrap(e,r),Hvr.types.isProxy(e)){let o=(0,F5e.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,F5e.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>Hvr.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,F5e.unwrap)(e,r),"_unwrap");_massWrap=a((e,r,n)=>{if(e)Array.isArray(e)||(e=[e]);else{On.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){On.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{r.forEach(s=>{this._wrap(o,s,n)})})},"_massWrap");_massUnwrap=a((e,r)=>{if(e)Array.isArray(e)||(e=[e]);else{On.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){On.error("must provide one or more functions to wrap on modules");return}e.forEach(n=>{r.forEach(o=>{this._unwrap(n,o)})})},"_massUnwrap");_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:r}=e;try{let n=require.resolve(r);require.cache[n]&&this._diag.warn(`Module ${r} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${r}`)}catch{}})}_extractPackageVersion(e){try{let r=(0,hAi.readFileSync)(_6.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{On.warn("Failed extracting version",e)}}_onRequire(e,r,n,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(r)):r;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===n)return dAi(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(r,e.moduleVersion)):r;let c=e.files??[],l=_6.normalize(n);return c.filter(d=>d.name===l).filter(d=>dAi(d.supportedVersions,s,e.includePrerelease)).reduce((d,f)=>(f.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:o}),f.patch(d,e.moduleVersion)):d),r)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.patch(r.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let r=a((c,l,u)=>{if(!u&&_6.isAbsolute(l)){let d=_6.parse(l);l=d.name,u=d.dir}return this._onRequire(e,c,l,u)},"hookFn"),n=a((c,l,u)=>this._onRequire(e,c,l,u),"onRequire"),o=_6.isAbsolute(e.name)?new pAi.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new fAi.Hook([e.name],{internals:!1},r);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.unpatch(r.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};a(dAi,"isSupported")});var U5e,gAi=Se(()=>{p();U5e=require("path")});var AAi=Se(()=>{p();mAi();gAi()});var Gvr=Se(()=>{p();AAi()});var Ogt,yAi=Se(()=>{p();Ogt=class{static{a(this,"InstrumentationNodeModuleDefinition")}name;supportedVersions;patch;unpatch;files;constructor(e,r,n,o,s){this.name=e,this.supportedVersions=r,this.patch=n,this.unpatch=o,this.files=s||[]}}});var Lgt,_Ai=Se(()=>{p();Gvr();Lgt=class{static{a(this,"InstrumentationNodeModuleFile")}supportedVersions;patch;unpatch;name;constructor(e,r,n,o){this.supportedVersions=r,this.patch=n,this.unpatch=o,this.name=(0,U5e.normalize)(e)}}});var $vr={};Ti($vr,{InstrumentationBase:()=>H0e,InstrumentationNodeModuleDefinition:()=>Ogt,InstrumentationNodeModuleFile:()=>Lgt,isWrapped:()=>Mgt,registerInstrumentations:()=>Hgi,safeExecuteInTheMiddle:()=>lAi,safeExecuteInTheMiddleAsync:()=>uAi});var Vvr=Se(()=>{p();Ggi();Gvr();yAi();_Ai();jvr()});var vAi=I(Wvr=>{"use strict";p();Object.defineProperty(Wvr,"__esModule",{value:!0});Wvr.log=M0a;var EAi=(Y3(),Wa(jQ)),P0a=require("node:os"),D0a=EAi.__importDefault(require("node:util")),N0a=EAi.__importStar(require("node:process"));function M0a(t,...e){N0a.stderr.write(`${D0a.default.format(t,...e)}${P0a.EOL}`)}a(M0a,"log")});var IAi=I(Zvr=>{"use strict";p();Object.defineProperty(Zvr,"__esModule",{value:!0});var O0a=vAi(),CAi=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,bAi,zvr=[],Yvr=[],Bgt=[];CAi&&Kvr(CAi);var SAi=Object.assign(t=>TAi(t),{enable:Kvr,enabled:Jvr,disable:L0a,log:O0a.log});function Kvr(t){bAi=t,zvr=[],Yvr=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?Yvr.push(new RegExp(`^${n.substr(1)}$`)):zvr.push(new RegExp(`^${n}$`));for(let n of Bgt)n.enabled=Jvr(n.namespace)}a(Kvr,"enable");function Jvr(t){if(t.endsWith("*"))return!0;for(let e of Yvr)if(e.test(t))return!1;for(let e of zvr)if(e.test(t))return!0;return!1}a(Jvr,"enabled");function L0a(){let t=bAi||"";return Kvr(""),t}a(L0a,"disable");function TAi(t){let e=Object.assign(r,{enabled:Jvr(t),destroy:B0a,log:SAi.log,namespace:t,extend:F0a});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),Bgt.push(e),e}a(TAi,"createDebugger");function B0a(){let t=Bgt.indexOf(this);return t>=0?(Bgt.splice(t,1),!0):!1}a(B0a,"destroy");function F0a(t){let e=TAi(`${this.namespace}:${t}`);return e.log=this.log,e}a(F0a,"extend");Zvr.default=SAi});var qgt=I(iL=>{"use strict";p();Object.defineProperty(iL,"__esModule",{value:!0});iL.AzureLogger=void 0;iL.setLogLevel=RAi;iL.getLogLevel=Q0a;iL.createClientLogger=q0a;var U0a=(Y3(),Wa(jQ)),Q5e=U0a.__importDefault(IAi()),wAi=new Set,Fgt=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,Qgt;iL.AzureLogger=(0,Q5e.default)("azure");iL.AzureLogger.log=(...t)=>{Q5e.default.log(...t)};var Xvr=["verbose","info","warning","error"];Fgt&&(DAi(Fgt)?RAi(Fgt):console.error(`AZURE_LOG_LEVEL set to unknown log level '${Fgt}'; logging is not enabled. Acceptable values: ${Xvr.join(", ")}.`));function RAi(t){if(t&&!DAi(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${Xvr.join(",")}`);Qgt=t;let e=[];for(let r of wAi)PAi(r)&&e.push(r.namespace);Q5e.default.enable(e.join(","))}a(RAi,"setLogLevel");function Q0a(){return Qgt}a(Q0a,"getLogLevel");var xAi={verbose:400,info:300,warning:200,error:100};function q0a(t){let e=iL.AzureLogger.extend(t);return kAi(iL.AzureLogger,e),{error:Ugt(e,"error"),warning:Ugt(e,"warning"),info:Ugt(e,"info"),verbose:Ugt(e,"verbose")}}a(q0a,"createClientLogger");function kAi(t,e){e.log=(...r)=>{t.log(...r)}}a(kAi,"patchLogMethod");function Ugt(t,e){let r=Object.assign(t.extend(e),{level:e});if(kAi(t,r),PAi(r)){let n=Q5e.default.disable();Q5e.default.enable(n+","+r.namespace)}return wAi.add(r),r}a(Ugt,"createLogger");function PAi(t){return!!(Qgt&&xAi[t.level]<=xAi[Qgt])}a(PAi,"shouldEnable");function DAi(t){return Xvr.includes(t)}a(DAi,"isAzureLogLevel")});var eCr=I(jgt=>{"use strict";p();Object.defineProperty(jgt,"__esModule",{value:!0});jgt.logger=void 0;var j0a=qgt();jgt.logger=(0,j0a.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function Hgt(t){return t.setValue(tCr,!0)}function NAi(t){return t.deleteValue(tCr)}function G0e(t){return t.getValue(tCr)===!0}var tCr,q5e=Se(()=>{p();go();tCr=oS("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(Hgt,"suppressTracing");a(NAi,"unsuppressTracing");a(G0e,"isTracingSuppressed")});var Ggt,MAi=Se(()=>{p();Ggt="baggage"});function LAi(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function BAi(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=";"+r.metadata.toString()),n})}function rCr(t){let e=t.split(";");if(e.length<=0)return;let r=e.shift();if(!r)return;let n=r.indexOf("=");if(n<=0)return;let o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=y0e(e.join(";"))),{key:o,value:s,metadata:c}}function FAi(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=rCr(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var nCr=Se(()=>{p();go();a(LAi,"serializeKeyPairs");a(BAi,"getKeyPairs");a(rCr,"parsePairKeyValue");a(FAi,"parseKeyPairsIntoRecord")});var Vgt,UAi=Se(()=>{p();go();q5e();MAi();nCr();Vgt=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=mI.getBaggage(e);if(!o||G0e(e))return;let s=BAi(o).filter(l=>l.length<=4096).slice(0,180),c=LAi(s);c.length>0&&n.set(r,Ggt,c)}extract(e,r,n){let o=n.get(r,Ggt),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=rCr(u);if(d){let f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0)?e:mI.setBaggage(e,mI.createBaggage(c))}fields(){return[Ggt]}}});var Wgt,QAi=Se(()=>{p();Wgt=class{static{a(this,"AnchoredClock")}_monotonicClock;_epochMillis;_performanceMillis;constructor(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function qAi(t){let e={};if(typeof t!="object"||t==null)return e;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(!$0a(r)){On.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!iCr(n)){On.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function $0a(t){return typeof t=="string"&&t!==""}function iCr(t){return t==null?!0:Array.isArray(t)?V0a(t):jAi(typeof t)}function V0a(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(jAi(n)){e=n;continue}return!1}return!1}}return!0}function jAi(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var HAi=Se(()=>{p();go();a(qAi,"sanitizeAttributes");a($0a,"isAttributeKey");a(iCr,"isAttributeValue");a(V0a,"isHomogeneousAttributeValueArray");a(jAi,"isValidPrimitiveAttributeValueType")});function zgt(){return t=>{On.error(W0a(t))}}function W0a(t){return typeof t=="string"?t:JSON.stringify(z0a(t))}function z0a(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let o=r[n];o&&(e[n]=String(o))}),r=Object.getPrototypeOf(r);return e}var oCr=Se(()=>{p();go();a(zgt,"loggingErrorHandler");a(W0a,"stringifyException");a(z0a,"flattenException")});function $Ai(t){GAi=t}function VAi(t){try{GAi(t)}catch{}}var GAi,WAi=Se(()=>{p();oCr();GAi=zgt();a($Ai,"setGlobalErrorHandler");a(VAi,"globalErrorHandler")});function Ygt(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){On.warn(`Unknown value ${(0,sCr.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function j5e(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function Kgt(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||On.warn(`Unknown value ${(0,sCr.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function Jgt(t){return j5e(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var sCr,zAi=Se(()=>{p();go();sCr=require("util");a(Ygt,"getNumberFromEnv");a(j5e,"getStringFromEnv");a(Kgt,"getBooleanFromEnv");a(Jgt,"getStringListFromEnv")});var Zgt,YAi=Se(()=>{p();Zgt=typeof globalThis=="object"?globalThis:global});var KAi,i$,JAi=Se(()=>{p();KAi=require("perf_hooks"),i$=KAi.performance});var ZAi,XAi=Se(()=>{p();ZAi="2.2.0"});function Th(t){let e={},r=t.length;for(let n=0;n{p();a(Th,"createConstMap")});var eyi,tyi,ryi,nyi,iyi,oyi,syi,ayi,cyi,lyi,uyi,dyi,fyi,pyi,hyi,myi,gyi,Ayi,yyi,_yi,Eyi,vyi,Cyi,byi,Syi,Tyi,Iyi,xyi,wyi,Ryi,kyi,Pyi,Dyi,Nyi,Myi,Oyi,Lyi,Byi,Fyi,Uyi,Qyi,qyi,jyi,Hyi,Gyi,$yi,Vyi,Wyi,zyi,Yyi,Kyi,Jyi,Zyi,Xyi,e_i,t_i,r_i,n_i,i_i,o_i,s_i,a_i,c_i,l_i,u_i,d_i,f_i,p_i,h_i,m_i,g_i,A_i,y_i,__i,E_i,v_i,C_i,b_i,S_i,T_i,I_i,x_i,w_i,R_i,k_i,P_i,D_i,N_i,M_i,O_i,L_i,B_i,F_i,U_i,Q_i,q_i,j_i,H_i,G_i,$_i,V_i,W_i,z_i,Y_i,K_i,J_i,Z_i,X_i,eEi,tEi,rEi,nEi,iEi,oEi,sEi,aEi,cEi,lEi,uEi,dEi,fEi,pEi,hEi,mEi,gEi,AEi,yEi,_Ei,Y0a,K0a,J0a,Z0a,X0a,eAa,tAa,rAa,nAa,iAa,oAa,sAa,aAa,cAa,lAa,uAa,dAa,fAa,pAa,hAa,mAa,gAa,AAa,yAa,_Aa,EAa,vAa,CAa,bAa,SAa,TAa,IAa,xAa,wAa,RAa,kAa,PAa,DAa,NAa,MAa,OAa,LAa,BAa,FAa,UAa,QAa,qAa,jAa,HAa,GAa,$Aa,VAa,WAa,zAa,YAa,KAa,JAa,ZAa,XAa,eya,tya,rya,nya,iya,oya,sya,aya,cya,lya,uya,dya,fya,pya,hya,mya,gya,Aya,yya,_ya,Eya,vya,Cya,bya,Sya,Tya,Iya,xya,wya,Rya,kya,Pya,Dya,Nya,Mya,Oya,Lya,Bya,Fya,Uya,Qya,qya,jya,Hya,Gya,$ya,Vya,Wya,zya,Yya,Kya,Jya,Zya,Xya,e_a,t_a,r_a,n_a,i_a,o_a,s_a,a_a,c_a,l_a,u_a,d_a,f_a,p_a,h_a,m_a,EEi,vEi,CEi,bEi,SEi,TEi,IEi,xEi,wEi,REi,kEi,PEi,DEi,NEi,MEi,OEi,LEi,BEi,FEi,UEi,QEi,qEi,jEi,HEi,GEi,$Ei,VEi,WEi,zEi,YEi,KEi,JEi,ZEi,XEi,evi,tvi,rvi,nvi,ivi,ovi,svi,avi,cvi,lvi,uvi,dvi,fvi,g_a,A_a,y_a,__a,E_a,v_a,C_a,b_a,S_a,T_a,I_a,x_a,w_a,R_a,k_a,P_a,D_a,N_a,M_a,O_a,L_a,B_a,F_a,U_a,Q_a,q_a,j_a,H_a,G_a,$_a,V_a,W_a,z_a,Y_a,K_a,J_a,Z_a,X_a,eEa,tEa,rEa,nEa,iEa,oEa,sEa,aEa,cEa,lEa,pvi,hvi,mvi,gvi,Avi,yvi,_vi,Evi,vvi,Cvi,bvi,uEa,dEa,fEa,pEa,hEa,mEa,gEa,AEa,yEa,_Ea,EEa,vEa,Svi,Tvi,Ivi,xvi,wvi,CEa,bEa,SEa,TEa,IEa,xEa,Rvi,kvi,Pvi,wEa,REa,kEa,PEa,Dvi,Nvi,Mvi,Ovi,DEa,NEa,MEa,OEa,LEa,Lvi,Bvi,Fvi,Uvi,Qvi,qvi,jvi,BEa,FEa,UEa,QEa,qEa,jEa,HEa,GEa,Hvi,Gvi,$vi,Vvi,Wvi,$Ea,VEa,WEa,zEa,YEa,KEa,zvi,Yvi,Kvi,Jvi,Zvi,Xvi,eCi,tCi,rCi,nCi,iCi,oCi,sCi,aCi,cCi,lCi,uCi,dCi,fCi,pCi,hCi,JEa,ZEa,XEa,eva,tva,rva,nva,iva,ova,sva,ava,cva,lva,uva,dva,fva,pva,hva,mva,gva,Ava,yva,mCi,gCi,ACi,yCi,_Ci,_va,Eva,vva,Cva,bva,Sva,ECi,vCi,Tva,Iva,xva,CCi,bCi,wva,Rva,kva,SCi,TCi,ICi,xCi,wCi,RCi,kCi,PCi,DCi,NCi,MCi,OCi,LCi,BCi,FCi,UCi,QCi,Pva,Dva,Nva,Mva,Ova,Lva,Bva,Fva,Uva,Qva,qva,jva,Hva,Gva,$va,Vva,Wva,zva,qCi,jCi,Yva,Kva,Jva,HCi=Se(()=>{p();aCr();eyi="aws.lambda.invoked_arn",tyi="db.system",ryi="db.connection_string",nyi="db.user",iyi="db.jdbc.driver_classname",oyi="db.name",syi="db.statement",ayi="db.operation",cyi="db.mssql.instance_name",lyi="db.cassandra.keyspace",uyi="db.cassandra.page_size",dyi="db.cassandra.consistency_level",fyi="db.cassandra.table",pyi="db.cassandra.idempotence",hyi="db.cassandra.speculative_execution_count",myi="db.cassandra.coordinator.id",gyi="db.cassandra.coordinator.dc",Ayi="db.hbase.namespace",yyi="db.redis.database_index",_yi="db.mongodb.collection",Eyi="db.sql.table",vyi="exception.type",Cyi="exception.message",byi="exception.stacktrace",Syi="exception.escaped",Tyi="faas.trigger",Iyi="faas.execution",xyi="faas.document.collection",wyi="faas.document.operation",Ryi="faas.document.time",kyi="faas.document.name",Pyi="faas.time",Dyi="faas.cron",Nyi="faas.coldstart",Myi="faas.invoked_name",Oyi="faas.invoked_provider",Lyi="faas.invoked_region",Byi="net.transport",Fyi="net.peer.ip",Uyi="net.peer.port",Qyi="net.peer.name",qyi="net.host.ip",jyi="net.host.port",Hyi="net.host.name",Gyi="net.host.connection.type",$yi="net.host.connection.subtype",Vyi="net.host.carrier.name",Wyi="net.host.carrier.mcc",zyi="net.host.carrier.mnc",Yyi="net.host.carrier.icc",Kyi="peer.service",Jyi="enduser.id",Zyi="enduser.role",Xyi="enduser.scope",e_i="thread.id",t_i="thread.name",r_i="code.function",n_i="code.namespace",i_i="code.filepath",o_i="code.lineno",s_i="http.method",a_i="http.url",c_i="http.target",l_i="http.host",u_i="http.scheme",d_i="http.status_code",f_i="http.flavor",p_i="http.user_agent",h_i="http.request_content_length",m_i="http.request_content_length_uncompressed",g_i="http.response_content_length",A_i="http.response_content_length_uncompressed",y_i="http.server_name",__i="http.route",E_i="http.client_ip",v_i="aws.dynamodb.table_names",C_i="aws.dynamodb.consumed_capacity",b_i="aws.dynamodb.item_collection_metrics",S_i="aws.dynamodb.provisioned_read_capacity",T_i="aws.dynamodb.provisioned_write_capacity",I_i="aws.dynamodb.consistent_read",x_i="aws.dynamodb.projection",w_i="aws.dynamodb.limit",R_i="aws.dynamodb.attributes_to_get",k_i="aws.dynamodb.index_name",P_i="aws.dynamodb.select",D_i="aws.dynamodb.global_secondary_indexes",N_i="aws.dynamodb.local_secondary_indexes",M_i="aws.dynamodb.exclusive_start_table",O_i="aws.dynamodb.table_count",L_i="aws.dynamodb.scan_forward",B_i="aws.dynamodb.segment",F_i="aws.dynamodb.total_segments",U_i="aws.dynamodb.count",Q_i="aws.dynamodb.scanned_count",q_i="aws.dynamodb.attribute_definitions",j_i="aws.dynamodb.global_secondary_index_updates",H_i="messaging.system",G_i="messaging.destination",$_i="messaging.destination_kind",V_i="messaging.temp_destination",W_i="messaging.protocol",z_i="messaging.protocol_version",Y_i="messaging.url",K_i="messaging.message_id",J_i="messaging.conversation_id",Z_i="messaging.message_payload_size_bytes",X_i="messaging.message_payload_compressed_size_bytes",eEi="messaging.operation",tEi="messaging.consumer_id",rEi="messaging.rabbitmq.routing_key",nEi="messaging.kafka.message_key",iEi="messaging.kafka.consumer_group",oEi="messaging.kafka.client_id",sEi="messaging.kafka.partition",aEi="messaging.kafka.tombstone",cEi="rpc.system",lEi="rpc.service",uEi="rpc.method",dEi="rpc.grpc.status_code",fEi="rpc.jsonrpc.version",pEi="rpc.jsonrpc.request_id",hEi="rpc.jsonrpc.error_code",mEi="rpc.jsonrpc.error_message",gEi="message.type",AEi="message.id",yEi="message.compressed_size",_Ei="message.uncompressed_size",Y0a=eyi,K0a=tyi,J0a=ryi,Z0a=nyi,X0a=iyi,eAa=oyi,tAa=syi,rAa=ayi,nAa=cyi,iAa=lyi,oAa=uyi,sAa=dyi,aAa=fyi,cAa=pyi,lAa=hyi,uAa=myi,dAa=gyi,fAa=Ayi,pAa=yyi,hAa=_yi,mAa=Eyi,gAa=vyi,AAa=Cyi,yAa=byi,_Aa=Syi,EAa=Tyi,vAa=Iyi,CAa=xyi,bAa=wyi,SAa=Ryi,TAa=kyi,IAa=Pyi,xAa=Dyi,wAa=Nyi,RAa=Myi,kAa=Oyi,PAa=Lyi,DAa=Byi,NAa=Fyi,MAa=Uyi,OAa=Qyi,LAa=qyi,BAa=jyi,FAa=Hyi,UAa=Gyi,QAa=$yi,qAa=Vyi,jAa=Wyi,HAa=zyi,GAa=Yyi,$Aa=Kyi,VAa=Jyi,WAa=Zyi,zAa=Xyi,YAa=e_i,KAa=t_i,JAa=r_i,ZAa=n_i,XAa=i_i,eya=o_i,tya=s_i,rya=a_i,nya=c_i,iya=l_i,oya=u_i,sya=d_i,aya=f_i,cya=p_i,lya=h_i,uya=m_i,dya=g_i,fya=A_i,pya=y_i,hya=__i,mya=E_i,gya=v_i,Aya=C_i,yya=b_i,_ya=S_i,Eya=T_i,vya=I_i,Cya=x_i,bya=w_i,Sya=R_i,Tya=k_i,Iya=P_i,xya=D_i,wya=N_i,Rya=M_i,kya=O_i,Pya=L_i,Dya=B_i,Nya=F_i,Mya=U_i,Oya=Q_i,Lya=q_i,Bya=j_i,Fya=H_i,Uya=G_i,Qya=$_i,qya=V_i,jya=W_i,Hya=z_i,Gya=Y_i,$ya=K_i,Vya=J_i,Wya=Z_i,zya=X_i,Yya=eEi,Kya=tEi,Jya=rEi,Zya=nEi,Xya=iEi,e_a=oEi,t_a=sEi,r_a=aEi,n_a=cEi,i_a=lEi,o_a=uEi,s_a=dEi,a_a=fEi,c_a=pEi,l_a=hEi,u_a=mEi,d_a=gEi,f_a=AEi,p_a=yEi,h_a=_Ei,m_a=Th([eyi,tyi,ryi,nyi,iyi,oyi,syi,ayi,cyi,lyi,uyi,dyi,fyi,pyi,hyi,myi,gyi,Ayi,yyi,_yi,Eyi,vyi,Cyi,byi,Syi,Tyi,Iyi,xyi,wyi,Ryi,kyi,Pyi,Dyi,Nyi,Myi,Oyi,Lyi,Byi,Fyi,Uyi,Qyi,qyi,jyi,Hyi,Gyi,$yi,Vyi,Wyi,zyi,Yyi,Kyi,Jyi,Zyi,Xyi,e_i,t_i,r_i,n_i,i_i,o_i,s_i,a_i,c_i,l_i,u_i,d_i,f_i,p_i,h_i,m_i,g_i,A_i,y_i,__i,E_i,v_i,C_i,b_i,S_i,T_i,I_i,x_i,w_i,R_i,k_i,P_i,D_i,N_i,M_i,O_i,L_i,B_i,F_i,U_i,Q_i,q_i,j_i,H_i,G_i,$_i,V_i,W_i,z_i,Y_i,K_i,J_i,Z_i,X_i,eEi,tEi,rEi,nEi,iEi,oEi,sEi,aEi,cEi,lEi,uEi,dEi,fEi,pEi,hEi,mEi,gEi,AEi,yEi,_Ei]),EEi="other_sql",vEi="mssql",CEi="mysql",bEi="oracle",SEi="db2",TEi="postgresql",IEi="redshift",xEi="hive",wEi="cloudscape",REi="hsqldb",kEi="progress",PEi="maxdb",DEi="hanadb",NEi="ingres",MEi="firstsql",OEi="edb",LEi="cache",BEi="adabas",FEi="firebird",UEi="derby",QEi="filemaker",qEi="informix",jEi="instantdb",HEi="interbase",GEi="mariadb",$Ei="netezza",VEi="pervasive",WEi="pointbase",zEi="sqlite",YEi="sybase",KEi="teradata",JEi="vertica",ZEi="h2",XEi="coldfusion",evi="cassandra",tvi="hbase",rvi="mongodb",nvi="redis",ivi="couchbase",ovi="couchdb",svi="cosmosdb",avi="dynamodb",cvi="neo4j",lvi="geode",uvi="elasticsearch",dvi="memcached",fvi="cockroachdb",g_a=EEi,A_a=vEi,y_a=CEi,__a=bEi,E_a=SEi,v_a=TEi,C_a=IEi,b_a=xEi,S_a=wEi,T_a=REi,I_a=kEi,x_a=PEi,w_a=DEi,R_a=NEi,k_a=MEi,P_a=OEi,D_a=LEi,N_a=BEi,M_a=FEi,O_a=UEi,L_a=QEi,B_a=qEi,F_a=jEi,U_a=HEi,Q_a=GEi,q_a=$Ei,j_a=VEi,H_a=WEi,G_a=zEi,$_a=YEi,V_a=KEi,W_a=JEi,z_a=ZEi,Y_a=XEi,K_a=evi,J_a=tvi,Z_a=rvi,X_a=nvi,eEa=ivi,tEa=ovi,rEa=svi,nEa=avi,iEa=cvi,oEa=lvi,sEa=uvi,aEa=dvi,cEa=fvi,lEa=Th([EEi,vEi,CEi,bEi,SEi,TEi,IEi,xEi,wEi,REi,kEi,PEi,DEi,NEi,MEi,OEi,LEi,BEi,FEi,UEi,QEi,qEi,jEi,HEi,GEi,$Ei,VEi,WEi,zEi,YEi,KEi,JEi,ZEi,XEi,evi,tvi,rvi,nvi,ivi,ovi,svi,avi,cvi,lvi,uvi,dvi,fvi]),pvi="all",hvi="each_quorum",mvi="quorum",gvi="local_quorum",Avi="one",yvi="two",_vi="three",Evi="local_one",vvi="any",Cvi="serial",bvi="local_serial",uEa=pvi,dEa=hvi,fEa=mvi,pEa=gvi,hEa=Avi,mEa=yvi,gEa=_vi,AEa=Evi,yEa=vvi,_Ea=Cvi,EEa=bvi,vEa=Th([pvi,hvi,mvi,gvi,Avi,yvi,_vi,Evi,vvi,Cvi,bvi]),Svi="datasource",Tvi="http",Ivi="pubsub",xvi="timer",wvi="other",CEa=Svi,bEa=Tvi,SEa=Ivi,TEa=xvi,IEa=wvi,xEa=Th([Svi,Tvi,Ivi,xvi,wvi]),Rvi="insert",kvi="edit",Pvi="delete",wEa=Rvi,REa=kvi,kEa=Pvi,PEa=Th([Rvi,kvi,Pvi]),Dvi="alibaba_cloud",Nvi="aws",Mvi="azure",Ovi="gcp",DEa=Dvi,NEa=Nvi,MEa=Mvi,OEa=Ovi,LEa=Th([Dvi,Nvi,Mvi,Ovi]),Lvi="ip_tcp",Bvi="ip_udp",Fvi="ip",Uvi="unix",Qvi="pipe",qvi="inproc",jvi="other",BEa=Lvi,FEa=Bvi,UEa=Fvi,QEa=Uvi,qEa=Qvi,jEa=qvi,HEa=jvi,GEa=Th([Lvi,Bvi,Fvi,Uvi,Qvi,qvi,jvi]),Hvi="wifi",Gvi="wired",$vi="cell",Vvi="unavailable",Wvi="unknown",$Ea=Hvi,VEa=Gvi,WEa=$vi,zEa=Vvi,YEa=Wvi,KEa=Th([Hvi,Gvi,$vi,Vvi,Wvi]),zvi="gprs",Yvi="edge",Kvi="umts",Jvi="cdma",Zvi="evdo_0",Xvi="evdo_a",eCi="cdma2000_1xrtt",tCi="hsdpa",rCi="hsupa",nCi="hspa",iCi="iden",oCi="evdo_b",sCi="lte",aCi="ehrpd",cCi="hspap",lCi="gsm",uCi="td_scdma",dCi="iwlan",fCi="nr",pCi="nrnsa",hCi="lte_ca",JEa=zvi,ZEa=Yvi,XEa=Kvi,eva=Jvi,tva=Zvi,rva=Xvi,nva=eCi,iva=tCi,ova=rCi,sva=nCi,ava=iCi,cva=oCi,lva=sCi,uva=aCi,dva=cCi,fva=lCi,pva=uCi,hva=dCi,mva=fCi,gva=pCi,Ava=hCi,yva=Th([zvi,Yvi,Kvi,Jvi,Zvi,Xvi,eCi,tCi,rCi,nCi,iCi,oCi,sCi,aCi,cCi,lCi,uCi,dCi,fCi,pCi,hCi]),mCi="1.0",gCi="1.1",ACi="2.0",yCi="SPDY",_Ci="QUIC",_va=mCi,Eva=gCi,vva=ACi,Cva=yCi,bva=_Ci,Sva={HTTP_1_0:mCi,HTTP_1_1:gCi,HTTP_2_0:ACi,SPDY:yCi,QUIC:_Ci},ECi="queue",vCi="topic",Tva=ECi,Iva=vCi,xva=Th([ECi,vCi]),CCi="receive",bCi="process",wva=CCi,Rva=bCi,kva=Th([CCi,bCi]),SCi=0,TCi=1,ICi=2,xCi=3,wCi=4,RCi=5,kCi=6,PCi=7,DCi=8,NCi=9,MCi=10,OCi=11,LCi=12,BCi=13,FCi=14,UCi=15,QCi=16,Pva=SCi,Dva=TCi,Nva=ICi,Mva=xCi,Ova=wCi,Lva=RCi,Bva=kCi,Fva=PCi,Uva=DCi,Qva=NCi,qva=MCi,jva=OCi,Hva=LCi,Gva=BCi,$va=FCi,Vva=UCi,Wva=QCi,zva={OK:SCi,CANCELLED:TCi,UNKNOWN:ICi,INVALID_ARGUMENT:xCi,DEADLINE_EXCEEDED:wCi,NOT_FOUND:RCi,ALREADY_EXISTS:kCi,PERMISSION_DENIED:PCi,RESOURCE_EXHAUSTED:DCi,FAILED_PRECONDITION:NCi,ABORTED:MCi,OUT_OF_RANGE:OCi,UNIMPLEMENTED:LCi,INTERNAL:BCi,UNAVAILABLE:FCi,DATA_LOSS:UCi,UNAUTHENTICATED:QCi},qCi="SENT",jCi="RECEIVED",Yva=qCi,Kva=jCi,Jva=Th([qCi,jCi])});var GCi=Se(()=>{p();HCi()});var $Ci,VCi,WCi,zCi,YCi,KCi,JCi,ZCi,XCi,ebi,tbi,rbi,nbi,ibi,obi,sbi,abi,cbi,lbi,ubi,dbi,fbi,pbi,hbi,mbi,gbi,Abi,ybi,_bi,Ebi,vbi,Cbi,bbi,Sbi,Tbi,Ibi,xbi,wbi,Rbi,kbi,Pbi,Dbi,Nbi,Mbi,Obi,Lbi,Bbi,Fbi,Ubi,Qbi,qbi,jbi,Hbi,Gbi,$bi,Vbi,Wbi,zbi,Ybi,Kbi,Jbi,Zbi,Xbi,eSi,tSi,rSi,nSi,iSi,oSi,sSi,aSi,cSi,lSi,uSi,dSi,fSi,pSi,hSi,mSi,gSi,ASi,Zva,Xva,eCa,tCa,rCa,nCa,iCa,oCa,sCa,aCa,cCa,lCa,uCa,dCa,fCa,pCa,hCa,mCa,gCa,ACa,yCa,_Ca,ECa,vCa,CCa,bCa,SCa,TCa,ICa,xCa,wCa,RCa,kCa,PCa,DCa,NCa,MCa,OCa,LCa,BCa,FCa,UCa,QCa,qCa,jCa,HCa,GCa,$Ca,VCa,WCa,zCa,YCa,KCa,JCa,ZCa,XCa,eba,tba,rba,nba,iba,oba,sba,aba,cba,lba,uba,dba,fba,pba,hba,mba,gba,Aba,yba,_ba,Eba,vba,Cba,bba,Sba,Tba,ySi,_Si,ESi,vSi,Iba,xba,wba,Rba,kba,CSi,bSi,SSi,TSi,ISi,xSi,wSi,RSi,kSi,PSi,DSi,NSi,MSi,OSi,LSi,BSi,FSi,Pba,Dba,Nba,Mba,Oba,Lba,Bba,Fba,Uba,Qba,qba,jba,Hba,Gba,$ba,Vba,Wba,zba,USi,QSi,Yba,Kba,Jba,qSi,jSi,HSi,GSi,$Si,VSi,WSi,Zba,Xba,eSa,tSa,rSa,nSa,iSa,oSa,zSi,YSi,KSi,JSi,ZSi,XSi,e1i,t1i,r1i,n1i,i1i,sSa,aSa,cSa,lSa,uSa,dSa,fSa,pSa,hSa,mSa,gSa,ASa,o1i,s1i,a1i,c1i,l1i,u1i,d1i,f1i,p1i,h1i,ySa,_Sa,ESa,vSa,CSa,bSa,SSa,TSa,ISa,xSa,wSa,m1i=Se(()=>{p();aCr();$Ci="cloud.provider",VCi="cloud.account.id",WCi="cloud.region",zCi="cloud.availability_zone",YCi="cloud.platform",KCi="aws.ecs.container.arn",JCi="aws.ecs.cluster.arn",ZCi="aws.ecs.launchtype",XCi="aws.ecs.task.arn",ebi="aws.ecs.task.family",tbi="aws.ecs.task.revision",rbi="aws.eks.cluster.arn",nbi="aws.log.group.names",ibi="aws.log.group.arns",obi="aws.log.stream.names",sbi="aws.log.stream.arns",abi="container.name",cbi="container.id",lbi="container.runtime",ubi="container.image.name",dbi="container.image.tag",fbi="deployment.environment",pbi="device.id",hbi="device.model.identifier",mbi="device.model.name",gbi="faas.name",Abi="faas.id",ybi="faas.version",_bi="faas.instance",Ebi="faas.max_memory",vbi="host.id",Cbi="host.name",bbi="host.type",Sbi="host.arch",Tbi="host.image.name",Ibi="host.image.id",xbi="host.image.version",wbi="k8s.cluster.name",Rbi="k8s.node.name",kbi="k8s.node.uid",Pbi="k8s.namespace.name",Dbi="k8s.pod.uid",Nbi="k8s.pod.name",Mbi="k8s.container.name",Obi="k8s.replicaset.uid",Lbi="k8s.replicaset.name",Bbi="k8s.deployment.uid",Fbi="k8s.deployment.name",Ubi="k8s.statefulset.uid",Qbi="k8s.statefulset.name",qbi="k8s.daemonset.uid",jbi="k8s.daemonset.name",Hbi="k8s.job.uid",Gbi="k8s.job.name",$bi="k8s.cronjob.uid",Vbi="k8s.cronjob.name",Wbi="os.type",zbi="os.description",Ybi="os.name",Kbi="os.version",Jbi="process.pid",Zbi="process.executable.name",Xbi="process.executable.path",eSi="process.command",tSi="process.command_line",rSi="process.command_args",nSi="process.owner",iSi="process.runtime.name",oSi="process.runtime.version",sSi="process.runtime.description",aSi="service.name",cSi="service.namespace",lSi="service.instance.id",uSi="service.version",dSi="telemetry.sdk.name",fSi="telemetry.sdk.language",pSi="telemetry.sdk.version",hSi="telemetry.auto.version",mSi="webengine.name",gSi="webengine.version",ASi="webengine.description",Zva=$Ci,Xva=VCi,eCa=WCi,tCa=zCi,rCa=YCi,nCa=KCi,iCa=JCi,oCa=ZCi,sCa=XCi,aCa=ebi,cCa=tbi,lCa=rbi,uCa=nbi,dCa=ibi,fCa=obi,pCa=sbi,hCa=abi,mCa=cbi,gCa=lbi,ACa=ubi,yCa=dbi,_Ca=fbi,ECa=pbi,vCa=hbi,CCa=mbi,bCa=gbi,SCa=Abi,TCa=ybi,ICa=_bi,xCa=Ebi,wCa=vbi,RCa=Cbi,kCa=bbi,PCa=Sbi,DCa=Tbi,NCa=Ibi,MCa=xbi,OCa=wbi,LCa=Rbi,BCa=kbi,FCa=Pbi,UCa=Dbi,QCa=Nbi,qCa=Mbi,jCa=Obi,HCa=Lbi,GCa=Bbi,$Ca=Fbi,VCa=Ubi,WCa=Qbi,zCa=qbi,YCa=jbi,KCa=Hbi,JCa=Gbi,ZCa=$bi,XCa=Vbi,eba=Wbi,tba=zbi,rba=Ybi,nba=Kbi,iba=Jbi,oba=Zbi,sba=Xbi,aba=eSi,cba=tSi,lba=rSi,uba=nSi,dba=iSi,fba=oSi,pba=sSi,hba=aSi,mba=cSi,gba=lSi,Aba=uSi,yba=dSi,_ba=fSi,Eba=pSi,vba=hSi,Cba=mSi,bba=gSi,Sba=ASi,Tba=Th([$Ci,VCi,WCi,zCi,YCi,KCi,JCi,ZCi,XCi,ebi,tbi,rbi,nbi,ibi,obi,sbi,abi,cbi,lbi,ubi,dbi,fbi,pbi,hbi,mbi,gbi,Abi,ybi,_bi,Ebi,vbi,Cbi,bbi,Sbi,Tbi,Ibi,xbi,wbi,Rbi,kbi,Pbi,Dbi,Nbi,Mbi,Obi,Lbi,Bbi,Fbi,Ubi,Qbi,qbi,jbi,Hbi,Gbi,$bi,Vbi,Wbi,zbi,Ybi,Kbi,Jbi,Zbi,Xbi,eSi,tSi,rSi,nSi,iSi,oSi,sSi,aSi,cSi,lSi,uSi,dSi,fSi,pSi,hSi,mSi,gSi,ASi]),ySi="alibaba_cloud",_Si="aws",ESi="azure",vSi="gcp",Iba=ySi,xba=_Si,wba=ESi,Rba=vSi,kba=Th([ySi,_Si,ESi,vSi]),CSi="alibaba_cloud_ecs",bSi="alibaba_cloud_fc",SSi="aws_ec2",TSi="aws_ecs",ISi="aws_eks",xSi="aws_lambda",wSi="aws_elastic_beanstalk",RSi="azure_vm",kSi="azure_container_instances",PSi="azure_aks",DSi="azure_functions",NSi="azure_app_service",MSi="gcp_compute_engine",OSi="gcp_cloud_run",LSi="gcp_kubernetes_engine",BSi="gcp_cloud_functions",FSi="gcp_app_engine",Pba=CSi,Dba=bSi,Nba=SSi,Mba=TSi,Oba=ISi,Lba=xSi,Bba=wSi,Fba=RSi,Uba=kSi,Qba=PSi,qba=DSi,jba=NSi,Hba=MSi,Gba=OSi,$ba=LSi,Vba=BSi,Wba=FSi,zba=Th([CSi,bSi,SSi,TSi,ISi,xSi,wSi,RSi,kSi,PSi,DSi,NSi,MSi,OSi,LSi,BSi,FSi]),USi="ec2",QSi="fargate",Yba=USi,Kba=QSi,Jba=Th([USi,QSi]),qSi="amd64",jSi="arm32",HSi="arm64",GSi="ia64",$Si="ppc32",VSi="ppc64",WSi="x86",Zba=qSi,Xba=jSi,eSa=HSi,tSa=GSi,rSa=$Si,nSa=VSi,iSa=WSi,oSa=Th([qSi,jSi,HSi,GSi,$Si,VSi,WSi]),zSi="windows",YSi="linux",KSi="darwin",JSi="freebsd",ZSi="netbsd",XSi="openbsd",e1i="dragonflybsd",t1i="hpux",r1i="aix",n1i="solaris",i1i="z_os",sSa=zSi,aSa=YSi,cSa=KSi,lSa=JSi,uSa=ZSi,dSa=XSi,fSa=e1i,pSa=t1i,hSa=r1i,mSa=n1i,gSa=i1i,ASa=Th([zSi,YSi,KSi,JSi,ZSi,XSi,e1i,t1i,r1i,n1i,i1i]),o1i="cpp",s1i="dotnet",a1i="erlang",c1i="go",l1i="java",u1i="nodejs",d1i="php",f1i="python",p1i="ruby",h1i="webjs",ySa=o1i,_Sa=s1i,ESa=a1i,vSa=c1i,CSa=l1i,bSa=u1i,SSa=d1i,TSa=f1i,ISa=p1i,xSa=h1i,wSa=Th([o1i,s1i,a1i,c1i,l1i,u1i,d1i,f1i,p1i,h1i])});var g1i=Se(()=>{p();m1i()});var RSa,kSa,PSa,DSa,NSa,MSa,OSa,LSa,BSa,FSa,USa,QSa,qSa,jSa,HSa,GSa,$Sa,VSa,WSa,zSa,YSa,KSa,JSa,ZSa,XSa,e1a,t1a,r1a,n1a,i1a,o1a,s1a,a1a,c1a,l1a,u1a,d1a,f1a,p1a,h1a,m1a,g1a,dbp,fbp,A1a,y1a,_1a,E1a,v1a,C1a,b1a,S1a,T1a,I1a,x1a,w1a,R1a,k1a,P1a,D1a,N1a,M1a,O1a,L1a,B1a,F1a,U1a,Q1a,q1a,j1a,H1a,G1a,$1a,V1a,W1a,z1a,Y1a,K1a,J1a,Z1a,X1a,eTa,tTa,rTa,nTa,iTa,oTa,sTa,aTa,cTa,lTa,uTa,dTa,fTa,pTa,hTa,mTa,gTa,ATa,yTa,_Ta,ETa,vTa,CTa,bTa,STa,TTa,ITa,xTa,wTa,RTa,kTa,PTa,DTa,cCr,NTa,MTa,OTa,LTa,BTa,lCr,FTa,UTa,QTa,qTa,jTa,HTa,uCr,dCr,GTa,$Ta,VTa,WTa,zTa,YTa,A1i=Se(()=>{p();RSa="aspnetcore.diagnostics.exception.result",kSa="aborted",PSa="handled",DSa="skipped",NSa="unhandled",MSa="aspnetcore.diagnostics.handler.type",OSa="aspnetcore.rate_limiting.policy",LSa="aspnetcore.rate_limiting.result",BSa="acquired",FSa="endpoint_limiter",USa="global_limiter",QSa="request_canceled",qSa="aspnetcore.request.is_unhandled",jSa="aspnetcore.routing.is_fallback",HSa="aspnetcore.routing.match_status",GSa="failure",$Sa="success",VSa="aspnetcore.user.is_authenticated",WSa="client.address",zSa="client.port",YSa="code.column.number",KSa="code.file.path",JSa="code.function.name",ZSa="code.line.number",XSa="code.stacktrace",e1a="db.collection.name",t1a="db.namespace",r1a="db.operation.batch.size",n1a="db.operation.name",i1a="db.query.summary",o1a="db.query.text",s1a="db.response.status_code",a1a="db.stored_procedure.name",c1a="db.system.name",l1a="mariadb",u1a="microsoft.sql_server",d1a="mysql",f1a="postgresql",p1a="dotnet.gc.heap.generation",h1a="gen0",m1a="gen1",g1a="gen2",dbp="loh",fbp="poh",A1a="error.type",y1a="_OTHER",_1a="exception.escaped",E1a="exception.message",v1a="exception.stacktrace",C1a="exception.type",b1a=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),S1a="http.request.method",T1a="_OTHER",I1a="CONNECT",x1a="DELETE",w1a="GET",R1a="HEAD",k1a="OPTIONS",P1a="PATCH",D1a="POST",N1a="PUT",M1a="TRACE",O1a="http.request.method_original",L1a="http.request.resend_count",B1a=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),F1a="http.response.status_code",U1a="http.route",Q1a="jvm.gc.action",q1a="jvm.gc.name",j1a="jvm.memory.pool.name",H1a="jvm.memory.type",G1a="heap",$1a="non_heap",V1a="jvm.thread.daemon",W1a="jvm.thread.state",z1a="blocked",Y1a="new",K1a="runnable",J1a="terminated",Z1a="timed_waiting",X1a="waiting",eTa="network.local.address",tTa="network.local.port",rTa="network.peer.address",nTa="network.peer.port",iTa="network.protocol.name",oTa="network.protocol.version",sTa="network.transport",aTa="pipe",cTa="quic",lTa="tcp",uTa="udp",dTa="unix",fTa="network.type",pTa="ipv4",hTa="ipv6",mTa="otel.scope.name",gTa="otel.scope.version",ATa="otel.status_code",yTa="ERROR",_Ta="OK",ETa="otel.status_description",vTa="server.address",CTa="server.port",bTa="service.name",STa="service.version",TTa="signalr.connection.status",ITa="app_shutdown",xTa="normal_closure",wTa="timeout",RTa="signalr.transport",kTa="long_polling",PTa="server_sent_events",DTa="web_sockets",cCr="telemetry.sdk.language",NTa="cpp",MTa="dotnet",OTa="erlang",LTa="go",BTa="java",lCr="nodejs",FTa="php",UTa="python",QTa="ruby",qTa="rust",jTa="swift",HTa="webjs",uCr="telemetry.sdk.name",dCr="telemetry.sdk.version",GTa="url.fragment",$Ta="url.full",VTa="url.path",WTa="url.query",zTa="url.scheme",YTa="user_agent.original"});var KTa,JTa,ZTa,XTa,eIa,tIa,rIa,nIa,iIa,oIa,sIa,aIa,cIa,lIa,uIa,dIa,fIa,pIa,hIa,mIa,gIa,AIa,yIa,_Ia,EIa,vIa,CIa,bIa,SIa,TIa,IIa,xIa,wIa,RIa,kIa,PIa,DIa,NIa,MIa,OIa,LIa,BIa,FIa,UIa,QIa,qIa,jIa,HIa,GIa,$Ia,VIa,y1i=Se(()=>{p();KTa="aspnetcore.diagnostics.exceptions",JTa="aspnetcore.rate_limiting.active_request_leases",ZTa="aspnetcore.rate_limiting.queued_requests",XTa="aspnetcore.rate_limiting.request.time_in_queue",eIa="aspnetcore.rate_limiting.request_lease.duration",tIa="aspnetcore.rate_limiting.requests",rIa="aspnetcore.routing.match_attempts",nIa="db.client.operation.duration",iIa="dotnet.assembly.count",oIa="dotnet.exceptions",sIa="dotnet.gc.collections",aIa="dotnet.gc.heap.total_allocated",cIa="dotnet.gc.last_collection.heap.fragmentation.size",lIa="dotnet.gc.last_collection.heap.size",uIa="dotnet.gc.last_collection.memory.committed_size",dIa="dotnet.gc.pause.time",fIa="dotnet.jit.compilation.time",pIa="dotnet.jit.compiled_il.size",hIa="dotnet.jit.compiled_methods",mIa="dotnet.monitor.lock_contentions",gIa="dotnet.process.cpu.count",AIa="dotnet.process.cpu.time",yIa="dotnet.process.memory.working_set",_Ia="dotnet.thread_pool.queue.length",EIa="dotnet.thread_pool.thread.count",vIa="dotnet.thread_pool.work_item.count",CIa="dotnet.timer.count",bIa="http.client.request.duration",SIa="http.server.request.duration",TIa="jvm.class.count",IIa="jvm.class.loaded",xIa="jvm.class.unloaded",wIa="jvm.cpu.count",RIa="jvm.cpu.recent_utilization",kIa="jvm.cpu.time",PIa="jvm.gc.duration",DIa="jvm.memory.committed",NIa="jvm.memory.limit",MIa="jvm.memory.used",OIa="jvm.memory.used_after_last_gc",LIa="jvm.thread.count",BIa="kestrel.active_connections",FIa="kestrel.active_tls_handshakes",UIa="kestrel.connection.duration",QIa="kestrel.queued_connections",qIa="kestrel.queued_requests",jIa="kestrel.rejected_connections",HIa="kestrel.tls_handshake.duration",GIa="kestrel.upgraded_connections",$Ia="signalr.server.active_connections",VIa="signalr.server.connection.duration"});var WIa,_1i=Se(()=>{p();WIa="exception"});var fCr={};Ti(fCr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>kSa,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>PSa,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>DSa,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>NSa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>BSa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>FSa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>USa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>QSa,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>GSa,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>$Sa,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>RSa,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>MSa,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>OSa,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>LSa,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>qSa,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>jSa,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>HSa,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>VSa,ATTR_CLIENT_ADDRESS:()=>WSa,ATTR_CLIENT_PORT:()=>zSa,ATTR_CODE_COLUMN_NUMBER:()=>YSa,ATTR_CODE_FILE_PATH:()=>KSa,ATTR_CODE_FUNCTION_NAME:()=>JSa,ATTR_CODE_LINE_NUMBER:()=>ZSa,ATTR_CODE_STACKTRACE:()=>XSa,ATTR_DB_COLLECTION_NAME:()=>e1a,ATTR_DB_NAMESPACE:()=>t1a,ATTR_DB_OPERATION_BATCH_SIZE:()=>r1a,ATTR_DB_OPERATION_NAME:()=>n1a,ATTR_DB_QUERY_SUMMARY:()=>i1a,ATTR_DB_QUERY_TEXT:()=>o1a,ATTR_DB_RESPONSE_STATUS_CODE:()=>s1a,ATTR_DB_STORED_PROCEDURE_NAME:()=>a1a,ATTR_DB_SYSTEM_NAME:()=>c1a,ATTR_DOTNET_GC_HEAP_GENERATION:()=>p1a,ATTR_ERROR_TYPE:()=>A1a,ATTR_EXCEPTION_ESCAPED:()=>_1a,ATTR_EXCEPTION_MESSAGE:()=>E1a,ATTR_EXCEPTION_STACKTRACE:()=>v1a,ATTR_EXCEPTION_TYPE:()=>C1a,ATTR_HTTP_REQUEST_HEADER:()=>b1a,ATTR_HTTP_REQUEST_METHOD:()=>S1a,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>O1a,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>L1a,ATTR_HTTP_RESPONSE_HEADER:()=>B1a,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>F1a,ATTR_HTTP_ROUTE:()=>U1a,ATTR_JVM_GC_ACTION:()=>Q1a,ATTR_JVM_GC_NAME:()=>q1a,ATTR_JVM_MEMORY_POOL_NAME:()=>j1a,ATTR_JVM_MEMORY_TYPE:()=>H1a,ATTR_JVM_THREAD_DAEMON:()=>V1a,ATTR_JVM_THREAD_STATE:()=>W1a,ATTR_NETWORK_LOCAL_ADDRESS:()=>eTa,ATTR_NETWORK_LOCAL_PORT:()=>tTa,ATTR_NETWORK_PEER_ADDRESS:()=>rTa,ATTR_NETWORK_PEER_PORT:()=>nTa,ATTR_NETWORK_PROTOCOL_NAME:()=>iTa,ATTR_NETWORK_PROTOCOL_VERSION:()=>oTa,ATTR_NETWORK_TRANSPORT:()=>sTa,ATTR_NETWORK_TYPE:()=>fTa,ATTR_OTEL_SCOPE_NAME:()=>mTa,ATTR_OTEL_SCOPE_VERSION:()=>gTa,ATTR_OTEL_STATUS_CODE:()=>ATa,ATTR_OTEL_STATUS_DESCRIPTION:()=>ETa,ATTR_SERVER_ADDRESS:()=>vTa,ATTR_SERVER_PORT:()=>CTa,ATTR_SERVICE_NAME:()=>bTa,ATTR_SERVICE_VERSION:()=>STa,ATTR_SIGNALR_CONNECTION_STATUS:()=>TTa,ATTR_SIGNALR_TRANSPORT:()=>RTa,ATTR_TELEMETRY_SDK_LANGUAGE:()=>cCr,ATTR_TELEMETRY_SDK_NAME:()=>uCr,ATTR_TELEMETRY_SDK_VERSION:()=>dCr,ATTR_URL_FRAGMENT:()=>GTa,ATTR_URL_FULL:()=>$Ta,ATTR_URL_PATH:()=>VTa,ATTR_URL_QUERY:()=>WTa,ATTR_URL_SCHEME:()=>zTa,ATTR_USER_AGENT_ORIGINAL:()=>YTa,AWSECSLAUNCHTYPEVALUES_EC2:()=>Yba,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Kba,AwsEcsLaunchtypeValues:()=>Jba,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Pba,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Dba,CLOUDPLATFORMVALUES_AWS_EC2:()=>Nba,CLOUDPLATFORMVALUES_AWS_ECS:()=>Mba,CLOUDPLATFORMVALUES_AWS_EKS:()=>Oba,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>Bba,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Lba,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Qba,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>jba,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>Uba,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>qba,CLOUDPLATFORMVALUES_AZURE_VM:()=>Fba,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Wba,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Vba,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>Gba,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Hba,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>$ba,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Iba,CLOUDPROVIDERVALUES_AWS:()=>xba,CLOUDPROVIDERVALUES_AZURE:()=>wba,CLOUDPROVIDERVALUES_GCP:()=>Rba,CloudPlatformValues:()=>zba,CloudProviderValues:()=>kba,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>uEa,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>yEa,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>dEa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>AEa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>pEa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>EEa,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>hEa,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>fEa,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>_Ea,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>gEa,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>mEa,DBSYSTEMVALUES_ADABAS:()=>N_a,DBSYSTEMVALUES_CACHE:()=>D_a,DBSYSTEMVALUES_CASSANDRA:()=>K_a,DBSYSTEMVALUES_CLOUDSCAPE:()=>S_a,DBSYSTEMVALUES_COCKROACHDB:()=>cEa,DBSYSTEMVALUES_COLDFUSION:()=>Y_a,DBSYSTEMVALUES_COSMOSDB:()=>rEa,DBSYSTEMVALUES_COUCHBASE:()=>eEa,DBSYSTEMVALUES_COUCHDB:()=>tEa,DBSYSTEMVALUES_DB2:()=>E_a,DBSYSTEMVALUES_DERBY:()=>O_a,DBSYSTEMVALUES_DYNAMODB:()=>nEa,DBSYSTEMVALUES_EDB:()=>P_a,DBSYSTEMVALUES_ELASTICSEARCH:()=>sEa,DBSYSTEMVALUES_FILEMAKER:()=>L_a,DBSYSTEMVALUES_FIREBIRD:()=>M_a,DBSYSTEMVALUES_FIRSTSQL:()=>k_a,DBSYSTEMVALUES_GEODE:()=>oEa,DBSYSTEMVALUES_H2:()=>z_a,DBSYSTEMVALUES_HANADB:()=>w_a,DBSYSTEMVALUES_HBASE:()=>J_a,DBSYSTEMVALUES_HIVE:()=>b_a,DBSYSTEMVALUES_HSQLDB:()=>T_a,DBSYSTEMVALUES_INFORMIX:()=>B_a,DBSYSTEMVALUES_INGRES:()=>R_a,DBSYSTEMVALUES_INSTANTDB:()=>F_a,DBSYSTEMVALUES_INTERBASE:()=>U_a,DBSYSTEMVALUES_MARIADB:()=>Q_a,DBSYSTEMVALUES_MAXDB:()=>x_a,DBSYSTEMVALUES_MEMCACHED:()=>aEa,DBSYSTEMVALUES_MONGODB:()=>Z_a,DBSYSTEMVALUES_MSSQL:()=>A_a,DBSYSTEMVALUES_MYSQL:()=>y_a,DBSYSTEMVALUES_NEO4J:()=>iEa,DBSYSTEMVALUES_NETEZZA:()=>q_a,DBSYSTEMVALUES_ORACLE:()=>__a,DBSYSTEMVALUES_OTHER_SQL:()=>g_a,DBSYSTEMVALUES_PERVASIVE:()=>j_a,DBSYSTEMVALUES_POINTBASE:()=>H_a,DBSYSTEMVALUES_POSTGRESQL:()=>v_a,DBSYSTEMVALUES_PROGRESS:()=>I_a,DBSYSTEMVALUES_REDIS:()=>X_a,DBSYSTEMVALUES_REDSHIFT:()=>C_a,DBSYSTEMVALUES_SQLITE:()=>G_a,DBSYSTEMVALUES_SYBASE:()=>$_a,DBSYSTEMVALUES_TERADATA:()=>V_a,DBSYSTEMVALUES_VERTICA:()=>W_a,DB_SYSTEM_NAME_VALUE_MARIADB:()=>l1a,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>u1a,DB_SYSTEM_NAME_VALUE_MYSQL:()=>d1a,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>f1a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>h1a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>m1a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>g1a,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>dbp,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>fbp,DbCassandraConsistencyLevelValues:()=>vEa,DbSystemValues:()=>lEa,ERROR_TYPE_VALUE_OTHER:()=>y1a,EVENT_EXCEPTION:()=>WIa,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>kEa,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>REa,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>wEa,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>DEa,FAASINVOKEDPROVIDERVALUES_AWS:()=>NEa,FAASINVOKEDPROVIDERVALUES_AZURE:()=>MEa,FAASINVOKEDPROVIDERVALUES_GCP:()=>OEa,FAASTRIGGERVALUES_DATASOURCE:()=>CEa,FAASTRIGGERVALUES_HTTP:()=>bEa,FAASTRIGGERVALUES_OTHER:()=>IEa,FAASTRIGGERVALUES_PUBSUB:()=>SEa,FAASTRIGGERVALUES_TIMER:()=>TEa,FaasDocumentOperationValues:()=>PEa,FaasInvokedProviderValues:()=>LEa,FaasTriggerValues:()=>xEa,HOSTARCHVALUES_AMD64:()=>Zba,HOSTARCHVALUES_ARM32:()=>Xba,HOSTARCHVALUES_ARM64:()=>eSa,HOSTARCHVALUES_IA64:()=>tSa,HOSTARCHVALUES_PPC32:()=>rSa,HOSTARCHVALUES_PPC64:()=>nSa,HOSTARCHVALUES_X86:()=>iSa,HTTPFLAVORVALUES_HTTP_1_0:()=>_va,HTTPFLAVORVALUES_HTTP_1_1:()=>Eva,HTTPFLAVORVALUES_HTTP_2_0:()=>vva,HTTPFLAVORVALUES_QUIC:()=>bva,HTTPFLAVORVALUES_SPDY:()=>Cva,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>I1a,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>x1a,HTTP_REQUEST_METHOD_VALUE_GET:()=>w1a,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>R1a,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>k1a,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>T1a,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>P1a,HTTP_REQUEST_METHOD_VALUE_POST:()=>D1a,HTTP_REQUEST_METHOD_VALUE_PUT:()=>N1a,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>M1a,HostArchValues:()=>oSa,HttpFlavorValues:()=>Sva,JVM_MEMORY_TYPE_VALUE_HEAP:()=>G1a,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>$1a,JVM_THREAD_STATE_VALUE_BLOCKED:()=>z1a,JVM_THREAD_STATE_VALUE_NEW:()=>Y1a,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>K1a,JVM_THREAD_STATE_VALUE_TERMINATED:()=>J1a,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>Z1a,JVM_THREAD_STATE_VALUE_WAITING:()=>X1a,MESSAGETYPEVALUES_RECEIVED:()=>Kva,MESSAGETYPEVALUES_SENT:()=>Yva,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>Tva,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Iva,MESSAGINGOPERATIONVALUES_PROCESS:()=>Rva,MESSAGINGOPERATIONVALUES_RECEIVE:()=>wva,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>KTa,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>JTa,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>ZTa,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>tIa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>eIa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>XTa,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>rIa,METRIC_DB_CLIENT_OPERATION_DURATION:()=>nIa,METRIC_DOTNET_ASSEMBLY_COUNT:()=>iIa,METRIC_DOTNET_EXCEPTIONS:()=>oIa,METRIC_DOTNET_GC_COLLECTIONS:()=>sIa,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>aIa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>cIa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>lIa,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>uIa,METRIC_DOTNET_GC_PAUSE_TIME:()=>dIa,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>fIa,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>pIa,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>hIa,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>mIa,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>gIa,METRIC_DOTNET_PROCESS_CPU_TIME:()=>AIa,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>yIa,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>_Ia,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>EIa,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>vIa,METRIC_DOTNET_TIMER_COUNT:()=>CIa,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>bIa,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>SIa,METRIC_JVM_CLASS_COUNT:()=>TIa,METRIC_JVM_CLASS_LOADED:()=>IIa,METRIC_JVM_CLASS_UNLOADED:()=>xIa,METRIC_JVM_CPU_COUNT:()=>wIa,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>RIa,METRIC_JVM_CPU_TIME:()=>kIa,METRIC_JVM_GC_DURATION:()=>PIa,METRIC_JVM_MEMORY_COMMITTED:()=>DIa,METRIC_JVM_MEMORY_LIMIT:()=>NIa,METRIC_JVM_MEMORY_USED:()=>MIa,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>OIa,METRIC_JVM_THREAD_COUNT:()=>LIa,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>BIa,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>FIa,METRIC_KESTREL_CONNECTION_DURATION:()=>UIa,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>QIa,METRIC_KESTREL_QUEUED_REQUESTS:()=>qIa,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>jIa,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>HIa,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>GIa,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>$Ia,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>VIa,MessageTypeValues:()=>Jva,MessagingDestinationKindValues:()=>xva,MessagingOperationValues:()=>kva,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>eva,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>nva,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>ZEa,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>uva,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>tva,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>rva,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>cva,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>JEa,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>fva,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>iva,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>sva,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>dva,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>ova,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>ava,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>hva,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>lva,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Ava,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>mva,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>gva,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>pva,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>XEa,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>WEa,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>zEa,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>YEa,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>$Ea,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>VEa,NETTRANSPORTVALUES_INPROC:()=>jEa,NETTRANSPORTVALUES_IP:()=>UEa,NETTRANSPORTVALUES_IP_TCP:()=>BEa,NETTRANSPORTVALUES_IP_UDP:()=>FEa,NETTRANSPORTVALUES_OTHER:()=>HEa,NETTRANSPORTVALUES_PIPE:()=>qEa,NETTRANSPORTVALUES_UNIX:()=>QEa,NETWORK_TRANSPORT_VALUE_PIPE:()=>aTa,NETWORK_TRANSPORT_VALUE_QUIC:()=>cTa,NETWORK_TRANSPORT_VALUE_TCP:()=>lTa,NETWORK_TRANSPORT_VALUE_UDP:()=>uTa,NETWORK_TRANSPORT_VALUE_UNIX:()=>dTa,NETWORK_TYPE_VALUE_IPV4:()=>pTa,NETWORK_TYPE_VALUE_IPV6:()=>hTa,NetHostConnectionSubtypeValues:()=>yva,NetHostConnectionTypeValues:()=>KEa,NetTransportValues:()=>GEa,OSTYPEVALUES_AIX:()=>hSa,OSTYPEVALUES_DARWIN:()=>cSa,OSTYPEVALUES_DRAGONFLYBSD:()=>fSa,OSTYPEVALUES_FREEBSD:()=>lSa,OSTYPEVALUES_HPUX:()=>pSa,OSTYPEVALUES_LINUX:()=>aSa,OSTYPEVALUES_NETBSD:()=>uSa,OSTYPEVALUES_OPENBSD:()=>dSa,OSTYPEVALUES_SOLARIS:()=>mSa,OSTYPEVALUES_WINDOWS:()=>sSa,OSTYPEVALUES_Z_OS:()=>gSa,OTEL_STATUS_CODE_VALUE_ERROR:()=>yTa,OTEL_STATUS_CODE_VALUE_OK:()=>_Ta,OsTypeValues:()=>ASa,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>qva,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>Bva,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Dva,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>Vva,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>Ova,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Qva,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>Gva,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>Mva,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>Lva,RPCGRPCSTATUSCODEVALUES_OK:()=>Pva,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>jva,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>Fva,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>Uva,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Wva,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>$va,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>Hva,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Nva,RpcGrpcStatusCodeValues:()=>zva,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>Sya,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>Lya,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>vya,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Aya,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Mya,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Rya,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>xya,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>Bya,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Tya,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>yya,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>bya,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>wya,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Cya,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>_ya,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Eya,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>Oya,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Pya,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Dya,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Iya,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>kya,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>gya,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Nya,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Y0a,SEMATTRS_CODE_FILEPATH:()=>XAa,SEMATTRS_CODE_FUNCTION:()=>JAa,SEMATTRS_CODE_LINENO:()=>eya,SEMATTRS_CODE_NAMESPACE:()=>ZAa,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>sAa,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>dAa,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>uAa,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>cAa,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>iAa,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>oAa,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>lAa,SEMATTRS_DB_CASSANDRA_TABLE:()=>aAa,SEMATTRS_DB_CONNECTION_STRING:()=>J0a,SEMATTRS_DB_HBASE_NAMESPACE:()=>fAa,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>X0a,SEMATTRS_DB_MONGODB_COLLECTION:()=>hAa,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>nAa,SEMATTRS_DB_NAME:()=>eAa,SEMATTRS_DB_OPERATION:()=>rAa,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>pAa,SEMATTRS_DB_SQL_TABLE:()=>mAa,SEMATTRS_DB_STATEMENT:()=>tAa,SEMATTRS_DB_SYSTEM:()=>K0a,SEMATTRS_DB_USER:()=>Z0a,SEMATTRS_ENDUSER_ID:()=>VAa,SEMATTRS_ENDUSER_ROLE:()=>WAa,SEMATTRS_ENDUSER_SCOPE:()=>zAa,SEMATTRS_EXCEPTION_ESCAPED:()=>_Aa,SEMATTRS_EXCEPTION_MESSAGE:()=>AAa,SEMATTRS_EXCEPTION_STACKTRACE:()=>yAa,SEMATTRS_EXCEPTION_TYPE:()=>gAa,SEMATTRS_FAAS_COLDSTART:()=>wAa,SEMATTRS_FAAS_CRON:()=>xAa,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>CAa,SEMATTRS_FAAS_DOCUMENT_NAME:()=>TAa,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>bAa,SEMATTRS_FAAS_DOCUMENT_TIME:()=>SAa,SEMATTRS_FAAS_EXECUTION:()=>vAa,SEMATTRS_FAAS_INVOKED_NAME:()=>RAa,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>kAa,SEMATTRS_FAAS_INVOKED_REGION:()=>PAa,SEMATTRS_FAAS_TIME:()=>IAa,SEMATTRS_FAAS_TRIGGER:()=>EAa,SEMATTRS_HTTP_CLIENT_IP:()=>mya,SEMATTRS_HTTP_FLAVOR:()=>aya,SEMATTRS_HTTP_HOST:()=>iya,SEMATTRS_HTTP_METHOD:()=>tya,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>lya,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>uya,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>dya,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>fya,SEMATTRS_HTTP_ROUTE:()=>hya,SEMATTRS_HTTP_SCHEME:()=>oya,SEMATTRS_HTTP_SERVER_NAME:()=>pya,SEMATTRS_HTTP_STATUS_CODE:()=>sya,SEMATTRS_HTTP_TARGET:()=>nya,SEMATTRS_HTTP_URL:()=>rya,SEMATTRS_HTTP_USER_AGENT:()=>cya,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>p_a,SEMATTRS_MESSAGE_ID:()=>f_a,SEMATTRS_MESSAGE_TYPE:()=>d_a,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>h_a,SEMATTRS_MESSAGING_CONSUMER_ID:()=>Kya,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>Vya,SEMATTRS_MESSAGING_DESTINATION:()=>Uya,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>Qya,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>e_a,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Xya,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Zya,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>t_a,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>r_a,SEMATTRS_MESSAGING_MESSAGE_ID:()=>$ya,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>zya,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Wya,SEMATTRS_MESSAGING_OPERATION:()=>Yya,SEMATTRS_MESSAGING_PROTOCOL:()=>jya,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Hya,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Jya,SEMATTRS_MESSAGING_SYSTEM:()=>Fya,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>qya,SEMATTRS_MESSAGING_URL:()=>Gya,SEMATTRS_NET_HOST_CARRIER_ICC:()=>GAa,SEMATTRS_NET_HOST_CARRIER_MCC:()=>jAa,SEMATTRS_NET_HOST_CARRIER_MNC:()=>HAa,SEMATTRS_NET_HOST_CARRIER_NAME:()=>qAa,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>QAa,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>UAa,SEMATTRS_NET_HOST_IP:()=>LAa,SEMATTRS_NET_HOST_NAME:()=>FAa,SEMATTRS_NET_HOST_PORT:()=>BAa,SEMATTRS_NET_PEER_IP:()=>NAa,SEMATTRS_NET_PEER_NAME:()=>OAa,SEMATTRS_NET_PEER_PORT:()=>MAa,SEMATTRS_NET_TRANSPORT:()=>DAa,SEMATTRS_PEER_SERVICE:()=>$Aa,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>s_a,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>l_a,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>u_a,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>c_a,SEMATTRS_RPC_JSONRPC_VERSION:()=>a_a,SEMATTRS_RPC_METHOD:()=>o_a,SEMATTRS_RPC_SERVICE:()=>i_a,SEMATTRS_RPC_SYSTEM:()=>n_a,SEMATTRS_THREAD_ID:()=>YAa,SEMATTRS_THREAD_NAME:()=>KAa,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>iCa,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>nCa,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>oCa,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>sCa,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>aCa,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>cCa,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>lCa,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>dCa,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>uCa,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>pCa,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>fCa,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Xva,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>tCa,SEMRESATTRS_CLOUD_PLATFORM:()=>rCa,SEMRESATTRS_CLOUD_PROVIDER:()=>Zva,SEMRESATTRS_CLOUD_REGION:()=>eCa,SEMRESATTRS_CONTAINER_ID:()=>mCa,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>ACa,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>yCa,SEMRESATTRS_CONTAINER_NAME:()=>hCa,SEMRESATTRS_CONTAINER_RUNTIME:()=>gCa,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>_Ca,SEMRESATTRS_DEVICE_ID:()=>ECa,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>vCa,SEMRESATTRS_DEVICE_MODEL_NAME:()=>CCa,SEMRESATTRS_FAAS_ID:()=>SCa,SEMRESATTRS_FAAS_INSTANCE:()=>ICa,SEMRESATTRS_FAAS_MAX_MEMORY:()=>xCa,SEMRESATTRS_FAAS_NAME:()=>bCa,SEMRESATTRS_FAAS_VERSION:()=>TCa,SEMRESATTRS_HOST_ARCH:()=>PCa,SEMRESATTRS_HOST_ID:()=>wCa,SEMRESATTRS_HOST_IMAGE_ID:()=>NCa,SEMRESATTRS_HOST_IMAGE_NAME:()=>DCa,SEMRESATTRS_HOST_IMAGE_VERSION:()=>MCa,SEMRESATTRS_HOST_NAME:()=>RCa,SEMRESATTRS_HOST_TYPE:()=>kCa,SEMRESATTRS_K8S_CLUSTER_NAME:()=>OCa,SEMRESATTRS_K8S_CONTAINER_NAME:()=>qCa,SEMRESATTRS_K8S_CRONJOB_NAME:()=>XCa,SEMRESATTRS_K8S_CRONJOB_UID:()=>ZCa,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>YCa,SEMRESATTRS_K8S_DAEMONSET_UID:()=>zCa,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>$Ca,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>GCa,SEMRESATTRS_K8S_JOB_NAME:()=>JCa,SEMRESATTRS_K8S_JOB_UID:()=>KCa,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>FCa,SEMRESATTRS_K8S_NODE_NAME:()=>LCa,SEMRESATTRS_K8S_NODE_UID:()=>BCa,SEMRESATTRS_K8S_POD_NAME:()=>QCa,SEMRESATTRS_K8S_POD_UID:()=>UCa,SEMRESATTRS_K8S_REPLICASET_NAME:()=>HCa,SEMRESATTRS_K8S_REPLICASET_UID:()=>jCa,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>WCa,SEMRESATTRS_K8S_STATEFULSET_UID:()=>VCa,SEMRESATTRS_OS_DESCRIPTION:()=>tba,SEMRESATTRS_OS_NAME:()=>rba,SEMRESATTRS_OS_TYPE:()=>eba,SEMRESATTRS_OS_VERSION:()=>nba,SEMRESATTRS_PROCESS_COMMAND:()=>aba,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>lba,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>cba,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>oba,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>sba,SEMRESATTRS_PROCESS_OWNER:()=>uba,SEMRESATTRS_PROCESS_PID:()=>iba,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>pba,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>dba,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>fba,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>gba,SEMRESATTRS_SERVICE_NAME:()=>hba,SEMRESATTRS_SERVICE_NAMESPACE:()=>mba,SEMRESATTRS_SERVICE_VERSION:()=>Aba,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>vba,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>_ba,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>yba,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Eba,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Sba,SEMRESATTRS_WEBENGINE_NAME:()=>Cba,SEMRESATTRS_WEBENGINE_VERSION:()=>bba,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>ITa,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>xTa,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>wTa,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>kTa,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>PTa,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>DTa,SemanticAttributes:()=>m_a,SemanticResourceAttributes:()=>Tba,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>ySa,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>_Sa,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>ESa,TELEMETRYSDKLANGUAGEVALUES_GO:()=>vSa,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>CSa,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>bSa,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>SSa,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>TSa,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>ISa,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>xSa,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>NTa,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>MTa,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>OTa,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>LTa,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>BTa,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>lCr,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>FTa,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>UTa,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>QTa,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>qTa,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>jTa,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>HTa,TelemetrySdkLanguageValues:()=>wSa});var Xgt=Se(()=>{p();GCi();g1i();A1i();y1i();_1i()});var E1i,v1i=Se(()=>{p();E1i="process.runtime.name"});var e0t,C1i=Se(()=>{p();XAi();Xgt();v1i();e0t={[uCr]:"opentelemetry",[E1i]:"node",[cCr]:lCr,[dCr]:ZAi}});var b1i=Se(()=>{p();zAi();YAi();JAi();C1i()});var pCr=Se(()=>{p();b1i()});function $0e(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*YIa);return[r,n]}function r0t(){let t=i$.timeOrigin;if(typeof t!="number"){let e=i$;t=e.timing&&e.timing.fetchStart}return t}function hCr(t){let e=$0e(r0t()),r=$0e(typeof t=="number"?t:i$.now());return mCr(e,r)}function T1i(t){if(n0t(t))return t;if(typeof t=="number")return t=t0t&&(r[1]-=t0t,r[0]+=1),r}var S1i,zIa,YIa,t0t,D1i=Se(()=>{p();pCr();S1i=9,zIa=6,YIa=Math.pow(10,zIa),t0t=Math.pow(10,S1i);a($0e,"millisToHrTime");a(r0t,"getTimeOrigin");a(hCr,"hrTime");a(T1i,"timeInputToHrTime");a(I1i,"hrTimeDuration");a(x1i,"hrTimeToTimeStamp");a(w1i,"hrTimeToNanoseconds");a(R1i,"hrTimeToMilliseconds");a(k1i,"hrTimeToMicroseconds");a(n0t,"isTimeInputHrTime");a(P1i,"isTimeInput");a(mCr,"addHrTimes")});function N1i(t){typeof t!="number"&&t.unref()}var M1i=Se(()=>{p();a(N1i,"unrefTimer")});var i0t,O1i=Se(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(i0t||(i0t={}))});var o0t,L1i=Se(()=>{p();go();o0t=class{static{a(this,"CompositePropagator")}_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,n)=>r.concat(n),[])))}inject(e,r,n){for(let o of this._propagators)try{o.inject(e,r,n)}catch(s){On.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}}extract(e,r,n){return this._propagators.reduce((o,s)=>{try{return s.extract(o,r,n)}catch(c){On.warn(`Failed to extract with ${s.constructor.name}. Err: ${c.message}`)}return o},e)}fields(){return this._fields.slice()}}});function B1i(t){return ZIa.test(t)}function F1i(t){return XIa.test(t)&&!exa.test(t)}var gCr,KIa,JIa,ZIa,XIa,exa,U1i=Se(()=>{p();gCr="[_0-9a-z-*/]",KIa=`[a-z]${gCr}{0,255}`,JIa=`[a-z0-9]${gCr}{0,240}@[a-z]${gCr}{0,13}`,ZIa=new RegExp(`^(?:${KIa}|${JIa})$`),XIa=/^[ -~]{0,255}[!-~]$/,exa=/,|=/;a(B1i,"validateKey");a(F1i,"validateValue")});var Q1i,txa,q1i,j1i,V0e,ACr=Se(()=>{p();U1i();Q1i=32,txa=512,q1i=",",j1i="=",V0e=class t{static{a(this,"TraceState")}_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,r){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n}unset(e){let r=this._clone();return r._internalState.delete(e),r}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,r)=>(e.push(r+j1i+this.get(r)),e),[]).join(q1i)}_parse(e){e.length>txa||(this._internalState=e.split(q1i).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(j1i);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);B1i(c)&&F1i(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Q1i&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Q1i))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function yCr(t){let e=axa.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var H5e,G5e,rxa,nxa,ixa,oxa,sxa,axa,s0t,H1i=Se(()=>{p();go();q5e();ACr();H5e="traceparent",G5e="tracestate",rxa="00",nxa="(?!ff)[\\da-f]{2}",ixa="(?![0]{32})[\\da-f]{32}",oxa="(?![0]{16})[\\da-f]{16}",sxa="[\\da-f]{2}",axa=new RegExp(`^\\s?(${nxa})-(${ixa})-(${oxa})-(${sxa})(-.*)?\\s?$`);a(yCr,"parseTraceParent");s0t=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=Uu.getSpanContext(e);if(!o||G0e(e)||!sS(o))return;let s=`${rxa}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||Uf.NONE).toString(16)}`;n.set(r,H5e,s),o.traceState&&n.set(r,G5e,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,H5e);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=yCr(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,G5e);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new V0e(typeof u=="string"?u:void 0)}return Uu.setSpanContext(e,c)}fields(){return[H5e,G5e]}}});function G1i(t,e){return t.setValue(_Cr,e)}function $1i(t){return t.deleteValue(_Cr)}function V1i(t){return t.getValue(_Cr)}var _Cr,a0t,W1i=Se(()=>{p();go();_Cr=oS("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(a0t||(a0t={}));a(G1i,"setRPCMetadata");a($1i,"deleteRPCMetadata");a(V1i,"getRPCMetadata")});function ECr(t){if(!hxa(t)||mxa(t)!==cxa)return!1;let e=pxa(t);if(e===null)return!0;let r=K1i.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&z1i.call(r)===fxa}function hxa(t){return t!=null&&typeof t=="object"}function mxa(t){return t==null?t===void 0?uxa:lxa:Ite&&Ite in Object(t)?gxa(t):Axa(t)}function gxa(t){let e=K1i.call(t,Ite),r=t[Ite],n=!1;try{t[Ite]=void 0,n=!0}catch{}let o=J1i.call(t);return n&&(e?t[Ite]=r:delete t[Ite]),o}function Axa(t){return J1i.call(t)}var cxa,lxa,uxa,dxa,z1i,fxa,pxa,Y1i,K1i,Ite,J1i,Z1i=Se(()=>{p();cxa="[object Object]",lxa="[object Null]",uxa="[object Undefined]",dxa=Function.prototype,z1i=dxa.toString,fxa=z1i.call(Object),pxa=Object.getPrototypeOf,Y1i=Object.prototype,K1i=Y1i.hasOwnProperty,Ite=Symbol?Symbol.toStringTag:void 0,J1i=Y1i.toString;a(ECr,"isPlainObject");a(hxa,"isObjectLike");a(mxa,"baseGetTag");a(gxa,"getRawTag");a(Axa,"objectToString")});function eTi(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=tTi(e,t.shift(),0,r);return e}function vCr(t){return l0t(t)?t.slice():t}function tTi(t,e,r=0,n){let o;if(!(r>yxa)){if(r++,c0t(t)||c0t(e)||rTi(e))o=vCr(e);else if(l0t(t)){if(o=t.slice(),l0t(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(X1i(t,u,n)||X1i(e,u,n))delete o[u];else{if($5e(f)&&$5e(h)){let m=n.get(f)||[],g=n.get(h)||[];m.push({obj:t,key:u}),g.push({obj:e,key:u}),n.set(f,m),n.set(h,g)}o[u]=tTi(o[u],d,r,n)}}}}else o=e;return o}}function X1i(t,e,r){let n=r.get(t[e])||[];for(let o=0,s=n.length;o"u"||t instanceof Date||t instanceof RegExp||t===null}function _xa(t,e){return!(!ECr(t)||!ECr(e))}var yxa,nTi=Se(()=>{p();Z1i();yxa=20;a(eTi,"merge");a(vCr,"takeValue");a(tTi,"mergeTwoObjects");a(X1i,"wasObjectReferenced");a(l0t,"isArray");a(rTi,"isFunction");a($5e,"isObject");a(c0t,"isPrimitive");a(_xa,"shouldMerge")});function iTi(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new V5e("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var V5e,oTi=Se(()=>{p();V5e=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(iTi,"callWithTimeout")});function CCr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function sTi(t,e){if(!e)return!1;for(let r of e)if(CCr(t,r))return!0;return!1}var aTi=Se(()=>{p();a(CCr,"urlMatches");a(sTi,"isUrlIgnored")});var u0t,cTi=Se(()=>{p();u0t=class{static{a(this,"Deferred")}_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var d0t,lTi=Se(()=>{p();cTi();d0t=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new u0t;constructor(e,r){this._callback=e,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}});function dTi(t){if(t==null)return;let e=uTi[t.toUpperCase()];return e??(On.warn(`Unknown log level "${t}", expected one of ${Object.keys(uTi)}, using default`),Ua.INFO)}var uTi,fTi=Se(()=>{p();go();uTi={ALL:Ua.ALL,VERBOSE:Ua.VERBOSE,DEBUG:Ua.DEBUG,INFO:Ua.INFO,WARN:Ua.WARN,ERROR:Ua.ERROR,NONE:Ua.NONE};a(dTi,"diagLogLevelFromString")});function pTi(t,e){return new Promise(r=>{X0.with(Hgt(X0.active()),()=>{t.export(e,n=>{r(n)})})})}var hTi=Se(()=>{p();go();q5e();a(pTi,"_export")});var f0t={};Ti(f0t,{AnchoredClock:()=>Wgt,BindOnceFuture:()=>d0t,CompositePropagator:()=>o0t,ExportResultCode:()=>i0t,RPCType:()=>a0t,SDK_INFO:()=>e0t,TRACE_PARENT_HEADER:()=>H5e,TRACE_STATE_HEADER:()=>G5e,TimeoutError:()=>V5e,TraceState:()=>V0e,W3CBaggagePropagator:()=>Vgt,W3CTraceContextPropagator:()=>s0t,_globalThis:()=>Zgt,addHrTimes:()=>mCr,callWithTimeout:()=>iTi,deleteRPCMetadata:()=>$1i,diagLogLevelFromString:()=>dTi,getBooleanFromEnv:()=>Kgt,getNumberFromEnv:()=>Ygt,getRPCMetadata:()=>V1i,getStringFromEnv:()=>j5e,getStringListFromEnv:()=>Jgt,getTimeOrigin:()=>r0t,globalErrorHandler:()=>VAi,hrTime:()=>hCr,hrTimeDuration:()=>I1i,hrTimeToMicroseconds:()=>k1i,hrTimeToMilliseconds:()=>R1i,hrTimeToNanoseconds:()=>w1i,hrTimeToTimeStamp:()=>x1i,internal:()=>Exa,isAttributeValue:()=>iCr,isTimeInput:()=>P1i,isTimeInputHrTime:()=>n0t,isTracingSuppressed:()=>G0e,isUrlIgnored:()=>sTi,loggingErrorHandler:()=>zgt,merge:()=>eTi,millisToHrTime:()=>$0e,otperformance:()=>i$,parseKeyPairsIntoRecord:()=>FAi,parseTraceParent:()=>yCr,sanitizeAttributes:()=>qAi,setGlobalErrorHandler:()=>$Ai,setRPCMetadata:()=>G1i,suppressTracing:()=>Hgt,timeInputToHrTime:()=>T1i,unrefTimer:()=>N1i,unsuppressTracing:()=>NAi,urlMatches:()=>CCr});var Exa,p0t=Se(()=>{p();UAi();QAi();HAi();WAi();oCr();D1i();M1i();O1i();nCr();pCr();L1i();H1i();W1i();q5e();ACr();nTi();oTi();aTi();lTi();fTi();hTi();Exa={_export:pTi}});var ATi=I(h0t=>{"use strict";p();Object.defineProperty(h0t,"__esModule",{value:!0});h0t.OpenTelemetrySpanWrapper=void 0;var mTi=(go(),Wa(A6)),gTi=(p0t(),Wa(f0t)),vxa=eCr(),bCr=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&Cxa(e.error)?e.error?(this._span.setStatus({code:mTi.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:mTi.SpanStatusCode.ERROR}):e.status==="success"&&vxa.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,gTi.isAttributeValue)(r)&&this._span.setAttribute(e,r)}end(){this._span.end()}recordException(e){this._span.recordException(e)}isRecording(){return this._span.isRecording()}addEvent(e,r={}){this._span.addEvent(e,(0,gTi.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};h0t.OpenTelemetrySpanWrapper=bCr;function Cxa(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(Cxa,"isRecordableError")});var SCr=I(oL=>{"use strict";p();Object.defineProperty(oL,"__esModule",{value:!0});oL.environmentCache=oL.SDK_VERSION=void 0;oL.envVarToBoolean=bxa;oL.SDK_VERSION="1.0.0-beta.9";oL.environmentCache=new Map;function bxa(t){var e;oL.environmentCache.has(t)||Sxa(t);let r=((e=oL.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a(bxa,"envVarToBoolean");function Sxa(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];oL.environmentCache.set(t,r)}}a(Sxa,"loadEnvironmentVariable")});var vTi=I(m0t=>{"use strict";p();Object.defineProperty(m0t,"__esModule",{value:!0});m0t.toOpenTelemetrySpanKind=ETi;m0t.toSpanOptions=Ixa;var yTi=(go(),Wa(A6)),_Ti=(p0t(),Wa(f0t));function ETi(t){let e=(t||"internal").toUpperCase();return yTi.SpanKind[e]}a(ETi,"toOpenTelemetrySpanKind");function Txa(t=[]){return t.reduce((e,r)=>{let n=yTi.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,_Ti.sanitizeAttributes)(r.attributes)}),e},[])}a(Txa,"toOpenTelemetryLinks");function Ixa(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,_Ti.sanitizeAttributes)(e),s=ETi(n),c=Txa(r);return{attributes:o,kind:s,links:c}}a(Ixa,"toSpanOptions")});var STi=I(o$=>{"use strict";p();Object.defineProperty(o$,"__esModule",{value:!0});o$.OpenTelemetryInstrumenter=o$.propagator=void 0;var sL=(go(),Wa(A6)),bTi=(p0t(),Wa(f0t)),xxa=ATi(),CTi=SCr(),wxa=vTi();o$.propagator=new bTi.W3CTraceContextPropagator;var TCr=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||sL.context.active(),o;return(0,CTi.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=sL.trace.wrapSpanContext(sL.INVALID_SPAN_CONTEXT):(o=sL.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,wxa.toSpanOptions)(r),n),(0,CTi.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,bTi.suppressTracing)(n))),{span:new xxa.OpenTelemetrySpanWrapper(o),tracingContext:sL.trace.setSpan(n,o)}}withContext(e,r,...n){return sL.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return o$.propagator.extract(sL.context.active(),{traceparent:e},sL.defaultTextMapGetter)}createRequestHeaders(e){let r={};return o$.propagator.inject(e||sL.context.active(),r,sL.defaultTextMapSetter),r}};o$.OpenTelemetryInstrumenter=TCr});var ITi=I(W5e=>{"use strict";p();Object.defineProperty(W5e,"__esModule",{value:!0});W5e.AzureSdkInstrumentation=void 0;W5e.createAzureSdkInstrumentation=Pxa;var TTi=(Vvr(),Wa($vr)),Rxa=STi(),kxa=SCr(),g0t=class extends TTi.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",kxa.SDK_VERSION,Object.assign({},e))}init(){let e=new TTi.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new Rxa.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};W5e.AzureSdkInstrumentation=g0t;function Pxa(t={}){return new g0t(t)}a(Pxa,"createAzureSdkInstrumentation")});var wTi=I(A0t=>{"use strict";p();Object.defineProperty(A0t,"__esModule",{value:!0});var xTi=(Y3(),Wa(jQ));xTi.__exportStar(eCr(),A0t);xTi.__exportStar(ITi(),A0t)});var kTi=I(jR=>{"use strict";p();Object.defineProperty(jR,"__esModule",{value:!0});jR.enable=jR.azureCoreTracing=jR.AzureMonitorSymbol=void 0;var ICr=Pp();jR.AzureMonitorSymbol="Azure_Monitor_Tracer";var xCr="azure-coretracing",RTi=!1,Dxa=a(function(t){if(RTi)return t;try{var e=(kgi(),Wa(Rgi)),r=(go(),Wa(A6)),n=new e.BasicTracerProvider,o=n.getTracer("applicationinsights tracer");if(t.setTracer){var s=t.setTracer;t.setTracer=function(d){var f=d.startSpan;d.startSpan=function(h,m,g){var A=f.call(this,h,m,g),y=A.end;return A.end=function(){var _=y.apply(this,arguments);return ICr.channel.publish(xCr,A),_},A},d[jR.AzureMonitorSymbol]=!0,s.call(this,d)},r.trace.getSpan(r.context.active()),t.setTracer(o)}else{var c=r.trace.setGlobalTracerProvider;r.trace.setGlobalTracerProvider=function(d){var f=d.getTracer;return d.getTracer=function(h,m){var g=f.call(this,h,m);if(!g[jR.AzureMonitorSymbol]){var A=g.startSpan;g.startSpan=function(y,_,E){var v=A.call(this,y,_,E),S=v.end;return v.end=function(){var T=S.apply(this,arguments);return ICr.channel.publish(xCr,v),T},v},g[jR.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=(Vvr(),Wa($vr)),u=wTi();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}RTi=!0}catch{}return t},"azureCoreTracingPatchFunction");jR.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:Dxa,publisherName:xCr};function Nxa(){ICr.channel.registerMonkeyPatch("@azure/core-tracing",jR.azureCoreTracing)}a(Nxa,"enable");jR.enable=Nxa});var DTi=I(xte=>{"use strict";p();Object.defineProperty(xte,"__esModule",{value:!0});xte.enable=xte.bunyan=void 0;var PTi=Pp(),Mxa=a(function(t){var e=t.prototype._emit;return t.prototype._emit=function(r,n){var o=e.apply(this,arguments);if(!n){var s=o;s||(s=e.call(this,r,!0)),PTi.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");xte.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:Mxa};function Oxa(){PTi.channel.registerMonkeyPatch("bunyan",xte.bunyan)}a(Oxa,"enable");xte.enable=Oxa});var MTi=I(wte=>{"use strict";p();Object.defineProperty(wte,"__esModule",{value:!0});wte.enable=wte.console=void 0;var wCr=Pp(),NTi=require("stream"),Lxa=a(function(t){var e=new NTi.Writable,r=new NTi.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return wCr.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return wCr.channel.publish("console",{message:f,stderr:!0}),!0};for(var n=new t.Console(e,r),o=["log","info","warn","error","dir","time","timeEnd","trace","assert"],s=a(function(d){var f=t[d];f&&(t[d]=function(){if(n[d])try{n[d].apply(n,arguments)}catch{}return f.apply(t,arguments)})},"_loop_1"),c=0,l=o;c= 4.0.0",patch:Lxa};function Bxa(){wCr.channel.registerMonkeyPatch("console",wte.console),require("console")}a(Bxa,"enable");wte.enable=Bxa});var OTi=I(Rte=>{"use strict";p();Object.defineProperty(Rte,"__esModule",{value:!0});Rte.enable=Rte.mongoCore=void 0;var RCr=Pp(),Fxa=a(function(t){var e=t.Server.prototype.connect;return t.Server.prototype.connect=a(function(){var n=e.apply(this,arguments),o=this.s.pool.write;this.s.pool.write=a(function(){var l=typeof arguments[1]=="function"?1:2;return typeof arguments[l]=="function"&&(arguments[l]=RCr.channel.bindToContext(arguments[l])),o.apply(this,arguments)},"contextPreservingWrite");var s=this.s.pool.logout;return this.s.pool.logout=a(function(){return typeof arguments[1]=="function"&&(arguments[1]=RCr.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");Rte.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:Fxa};function Uxa(){RCr.channel.registerMonkeyPatch("mongodb-core",Rte.mongoCore)}a(Uxa,"enable");Rte.enable=Uxa});var LTi=I(qv=>{"use strict";p();var W0e=qv&&qv.__assign||function(){return W0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:Qxa};qv.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:qxa};qv.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:Hxa};function Gxa(){J_.channel.registerMonkeyPatch("mongodb",qv.mongo2),J_.channel.registerMonkeyPatch("mongodb",qv.mongo3),J_.channel.registerMonkeyPatch("mongodb",qv.mongo330)}a(Gxa,"enable");qv.enable=Gxa});var FTi=I(kte=>{"use strict";p();Object.defineProperty(kte,"__esModule",{value:!0});kte.enable=kte.mysql=void 0;var y0t=Pp(),BTi=require("path"),$xa=a(function(t,e){var r=a(function(u,d){return function(f,h){var m=u[f];m&&(u[f]=a(function(){for(var A=arguments.length-1,y=arguments.length-1;y>=0;--y)if(typeof arguments[y]=="function"){A=y;break}else if(typeof arguments[y]<"u")break;var _=arguments[A],E={result:null,startTime:null,startDate:null};typeof _=="function"&&(h?(E.startTime=process.hrtime(),E.startDate=new Date,arguments[A]=y0t.channel.bindToContext(h(E,_))):arguments[A]=y0t.channel.bindToContext(_));var v=m.apply(this,arguments);return E.result=v,v},"mysqlContextPreserver"))}},"patchObjectFunction"),n=a(function(u,d){return r(u.prototype,d+".prototype")},"patchClassMemberFunction"),o=["connect","changeUser","ping","statistics","end"],s=require(BTi.dirname(e)+"/lib/Connection");o.forEach(function(u){return n(s,"Connection")(u)}),r(s,"Connection")("createQuery",function(u,d){return function(f){var h=process.hrtime(u.startTime),m=h[0]*1e3+h[1]/1e6|0;y0t.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(BTi.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");kte.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:$xa};function Vxa(){y0t.channel.registerMonkeyPatch("mysql",kte.mysql)}a(Vxa,"enable");kte.enable=Vxa});var QTi=I(Pte=>{"use strict";p();Object.defineProperty(Pte,"__esModule",{value:!0});Pte.enable=Pte.postgresPool1=void 0;var UTi=Pp();function Wxa(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=UTi.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a(Wxa,"postgresPool1PatchFunction");Pte.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:Wxa};function zxa(){UTi.channel.registerMonkeyPatch("pg-pool",Pte.postgresPool1)}a(zxa,"enable");Pte.enable=zxa});var jTi=I(aL=>{"use strict";p();Object.defineProperty(aL,"__esModule",{value:!0});aL.enable=aL.postgres=aL.postgres6=void 0;var z0e=Pp(),qTi=require("events"),kCr="postgres";function Yxa(t,e){var r=t.Client.prototype.query,n="__diagnosticOriginalFunc";return t.Client.prototype.query=a(function(s,c,l){var u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},d=process.hrtime(),f;function h(m){m&&m[n]&&(m=m[n]);var g=z0e.channel.bindToContext(function(A,y){var _=process.hrtime(d);if(u.result=y&&{rowCount:y.rowCount,command:y.command},u.error=A,u.duration=Math.ceil(_[0]*1e3+_[1]/1e6),z0e.channel.publish(kCr,u),A){if(m)return m.apply(this,arguments);f&&f instanceof qTi.EventEmitter&&f.emit("error",A)}else m&&m.apply(this,arguments)});try{return Object.defineProperty(g,n,{value:m}),g}catch{return m}}a(h,"patchCallback");try{typeof s=="string"?c instanceof Array?(u.query.preparable={text:s,args:c},l=h(l)):(u.query.text=s,l?l=h(l):c=h(c)):(typeof s.name=="string"?u.query.plan=s.name:s.values instanceof Array?u.query.preparable={text:s.text,args:s.values}:u.query.text=s.text,l?l=h(l):c?c=h(c):s.callback=h(s.callback))}catch{return r.apply(this,arguments)}return arguments[0]=s,arguments[1]=c,arguments[2]=l,arguments.length=arguments.length>3?arguments.length:3,f=r.apply(this,arguments),f},"query"),t}a(Yxa,"postgres6PatchFunction");function Kxa(t,e){var r=t.Client.prototype.query,n="__diagnosticOriginalFunc";return t.Client.prototype.query=a(function(s,c,l){var u=this,d,f,h=!!l,m={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},g,A=process.hrtime();function y(v){v&&v[n]&&(v=v[n]);var S=z0e.channel.bindToContext(function(T,w){var R=process.hrtime(A);if(m.result=w&&{rowCount:w.rowCount,command:w.command},m.error=T,m.duration=Math.ceil(R[0]*1e3+R[1]/1e6),z0e.channel.publish(kCr,m),T){if(v)return v.apply(this,arguments);g&&g instanceof qTi.EventEmitter&&g.emit("error",T)}else v&&v.apply(this,arguments)});try{return Object.defineProperty(S,n,{value:v}),S}catch{return v}}a(y,"patchCallback");try{typeof s=="string"?c instanceof Array?(m.query.preparable={text:s,args:c},h=typeof l=="function",l=h?y(l):l):(m.query.text=s,l?(h=typeof l=="function",l=h?y(l):l):(h=typeof c=="function",c=h?y(c):c)):(typeof s.name=="string"?m.query.plan=s.name:s.values instanceof Array?m.query.preparable={text:s.text,args:s.values}:s.cursor?m.query.text=(d=s.cursor)===null||d===void 0?void 0:d.text:m.query.text=s.text,l?(h=typeof l=="function",l=y(l)):c?(h=typeof c=="function",c=h?y(c):c):(h=typeof s.callback=="function",s.callback=h?y(s.callback):s.callback))}catch{return r.apply(this,arguments)}arguments[0]=s,arguments[1]=c,arguments[2]=l,arguments.length=arguments.length>3?arguments.length:3;try{g=r.apply(this,arguments)}catch(v){throw y()(v,void 0),v}if(!h){if(g instanceof Promise)return g.then(function(v){return y()(void 0,v),new u._Promise(function(S,T){S(v)})}).catch(function(v){return y()(v,void 0),new u._Promise(function(S,T){T(v)})});var _=g.text?g.text:"";if(g.cursor&&(_=(f=g.cursor)===null||f===void 0?void 0:f.text),_){var E={command:_,rowCount:0};y()(void 0,E)}}return g},"query"),t}a(Kxa,"postgresLatestPatchFunction");aL.postgres6={versionSpecifier:"6.*",patch:Yxa};aL.postgres={versionSpecifier:">=7.* <=8.*",patch:Kxa,publisherName:kCr};function Jxa(){z0e.channel.registerMonkeyPatch("pg",aL.postgres6),z0e.channel.registerMonkeyPatch("pg",aL.postgres)}a(Jxa,"enable");aL.enable=Jxa});var HTi=I(Dte=>{"use strict";p();Object.defineProperty(Dte,"__esModule",{value:!0});Dte.enable=Dte.redis=void 0;var PCr=Pp(),Zxa=a(function(t){var e=t.RedisClient.prototype.internal_send_command;return t.RedisClient.prototype.internal_send_command=function(r){if(r){var n=r.callback;if(!n||!n.pubsubBound){var o=this.address,s=process.hrtime(),c=new Date;r.callback=PCr.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;PCr.channel.publish("redis",{duration:f,address:o,commandObj:r,err:l,result:u,time:c}),typeof n=="function"&&n.apply(this,arguments)}),r.callback.pubsubBound=!0}}return e.call(this,r)},t},"redisPatchFunction");Dte.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:Zxa};function Xxa(){PCr.channel.registerMonkeyPatch("redis",Dte.redis)}a(Xxa,"enable");Dte.enable=Xxa});var GTi=I(E6=>{"use strict";p();var _0t=E6&&E6.__assign||function(){return _0t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:ewa};function twa(){DCr.channel.registerMonkeyPatch("tedious",E6.tedious)}a(twa,"enable");E6.enable=twa});var $Ti=I(dS=>{"use strict";p();var rwa=dS&&dS.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),nwa=dS&&dS.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);od[f]?h:f);return f}a(n,"getLogLevel");function o(l){this.add(new r(t,{level:n(l)}))}a(o,"patchedConfigure");var s=t.createLogger;t.createLogger=a(function(u){var d=s.call(this,u);d.add(new r(t,{level:n(u)}));var f=d.configure;return d.configure=function(){f.apply(this,arguments),o.apply(this,arguments)},d},"patchedCreate");var c=t.configure;return t.configure=function(){c.apply(this,arguments),o.apply(this,arguments)},t.add(new r(t)),t},"winston3PatchFunction");dS.winston3={versionSpecifier:"3.x",patch:owa};dS.winston2={versionSpecifier:"2.x",patch:iwa};function swa(){E0t.channel.registerMonkeyPatch("winston",dS.winston2),E0t.channel.registerMonkeyPatch("winston",dS.winston3)}a(swa,"enable");dS.enable=swa});var nIi=I(Qu=>{"use strict";p();Object.defineProperty(Qu,"__esModule",{value:!0});Qu.enable=Qu.tedious=Qu.pgPool=Qu.pg=Qu.winston=Qu.redis=Qu.mysql=Qu.mongodb=Qu.mongodbCore=Qu.console=Qu.bunyan=Qu.azuresdk=void 0;var VTi=kTi();Qu.azuresdk=VTi;var WTi=DTi();Qu.bunyan=WTi;var zTi=MTi();Qu.console=zTi;var YTi=OTi();Qu.mongodbCore=YTi;var KTi=LTi();Qu.mongodb=KTi;var JTi=FTi();Qu.mysql=JTi;var ZTi=QTi();Qu.pgPool=ZTi;var XTi=jTi();Qu.pg=XTi;var eIi=HTi();Qu.redis=eIi;var tIi=GTi();Qu.tedious=tIi;var rIi=$Ti();Qu.winston=rIi;function awa(){WTi.enable(),zTi.enable(),YTi.enable(),KTi.enable(),JTi.enable(),XTi.enable(),ZTi.enable(),eIi.enable(),rIi.enable(),VTi.enable(),tIi.enable()}a(awa,"enable");Qu.enable=awa});var b0t=I(Nte=>{"use strict";p();Object.defineProperty(Nte,"__esModule",{value:!0});Nte.IsInitialized=void 0;Nte.registerContextPreservation=cwa;var NCr=lu(),oIi=bmt();Nte.IsInitialized=!oIi.JsonConfig.getInstance().noDiagnosticChannel;var MCr="DiagnosticChannel";if(Nte.IsInitialized){ND=nIi(),iIi=oIi.JsonConfig.getInstance().noPatchModules,v0t=iIi.split(","),OCr={bunyan:ND.bunyan,console:ND.console,mongodb:ND.mongodb,mongodbCore:ND.mongodbCore,mysql:ND.mysql,redis:ND.redis,pg:ND.pg,pgPool:ND.pgPool,winston:ND.winston,azuresdk:ND.azuresdk};for(C0t in OCr)v0t.indexOf(C0t)===-1&&(OCr[C0t].enable(),NCr.info(MCr,"Subscribed to ".concat(C0t," events")));v0t.length>0&&NCr.info(MCr,"Some modules will not be patched",v0t)}else NCr.info(MCr,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var ND,iIi,v0t,OCr,C0t;function cwa(t){if(Nte.IsInitialized){var e=Pp();e.channel.addContextPreservation(t)}}a(cwa,"registerContextPreservation")});var Y0e=I((ATp,sIi)=>{"use strict";p();sIi.exports={requestContextHeader:"request-context",requestContextSourceKey:"appId",requestContextTargetKey:"appId",requestIdHeader:"request-id",parentIdHeader:"x-ms-request-id",rootIdHeader:"x-ms-request-root-id",correlationContextHeader:"correlation-context",traceparentHeader:"traceparent",traceStateHeader:"tracestate"}});var Cy=I((FCr,aIi)=>{"use strict";p();var a$=FCr&&FCr.__assign||function(){return a$=Object.assign||function(t){for(var e,r=1,n=arguments.length;r>u&255)},"toChar"),n=a(function(l){return r(l,24)+r(l,16)+r(l,8)+r(l,0)},"int32AsString"),o=e.map(n).join(""),s=Buffer.from?Buffer.from(o,"binary"):new Buffer(o,"binary"),c=s.toString("base64");return c.substr(0,c.indexOf("="))},t.random32=function(){return 4294967296*Math.random()|0},t.randomu32=function(){return t.random32()+2147483648},t.w3cTraceId=function(){for(var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],r="",n,o=0;o<4;o++)n=t.random32(),r+=e[n&15]+e[n>>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15];var s=e[8+Math.random()*4|0];return r.substr(0,8)+r.substr(9,4)+"4"+r.substr(13,3)+s+r.substr(16,3)+r.substr(19,12)},t.w3cSpanId=function(){return t.w3cTraceId().substring(16)},t.isValidW3CId=function(e){return e.length===32&&e!=="00000000000000000000000000000000"},t.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"},t.isError=function(e){return Object.prototype.toString.call(e)==="[object Error]"},t.isPrimitive=function(e){var r=typeof e;return r==="string"||r==="number"||r==="boolean"},t.isDate=function(e){return Object.prototype.toString.call(e)==="[object Date]"},t.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var r=(e/1e3%60).toFixed(7).replace(/0{0,4}$/,""),n=""+Math.floor(e/(1e3*60))%60,o=""+Math.floor(e/(1e3*60*60))%24,s=Math.floor(e/(1e3*60*60*24));r=r.indexOf(".")<2?"0"+r:r,n=n.length<2?"0"+n:n,o=o.length<2?"0"+o:o;var c=s>0?s+".":"";return c+o+":"+n+":"+r},t.extractError=function(e){var r=e;return{message:e.message,code:r.code||r.id||""}},t.extractObject=function(e){return e instanceof Error?t.extractError(e):typeof e.toJSON=="function"?e.toJSON():e},t.validateStringMap=function(e){if(typeof e!="object"){Mte.info("Invalid properties dropped from payload");return}var r={};for(var n in e){var o="",s=e[n],c=typeof s;if(t.isPrimitive(s))o=s.toString();else if(s===null||c==="undefined")o="";else if(c==="function"){Mte.info("key: "+n+" was function; will not serialize");continue}else{var l=t.isArray(s)?s:t.extractObject(s);try{t.isPrimitive(l)?o=l:o=JSON.stringify(l)}catch(u){o=s.constructor.name.toString()+" (Error: "+u.message+")",Mte.info("key: "+n+", could not be serialized")}}r[n]=o.substring(0,t.MAX_PROPERTY_LENGTH)}return r},t.canIncludeCorrelationHeader=function(e,r){var n=e&&e.config&&e.config.correlationHeaderExcludedDomains;if(!n||n.length==0||!r)return!0;for(var o=0;o{"use strict";p();var UCr=Cy(),fwa=(function(){function t(){}return a(t,"CorrelationIdManager"),t.queryCorrelationId=function(e,r){},t.cancelCorrelationIdQuery=function(e,r){},t.generateRequestId=function(e){if(e){e=e[0]=="|"?e:"|"+e,e[e.length-1]!=="."&&(e+=".");var r=(t.currentRootId++).toString(16);return t.appendSuffix(e,r,"_")}else return t.generateRootId()},t.getRootId=function(e){var r=e.indexOf(".");r<0&&(r=e.length);var n=e[0]==="|"?1:0;return e.substring(n,r)},t.generateRootId=function(){return"|"+UCr.w3cTraceId()+"."},t.appendSuffix=function(e,r,n){if(e.length+r.lengtho)for(;o>1;--o){var s=e[o-1];if(s==="."||s==="_")break}if(o<=1)return t.generateRootId();for(r=UCr.randomu32().toString(16);r.length<8;)r="0"+r;return e.substring(0,o)+r+"#"},t.correlationIdPrefix="cid-v1:",t.w3cEnabled=!0,t.HTTP_TIMEOUT=2500,t.requestIdMaxLength=1024,t.currentRootId=UCr.randomu32(),t})();cIi.exports=fwa});var S0t=I((STp,lIi)=>{"use strict";p();var by=Cy(),pwa=Ote(),hwa=(function(){function t(e,r){if(this.traceFlag=t.DEFAULT_TRACE_FLAG,this.version=t.DEFAULT_VERSION,e&&typeof e=="string")if(e.split(",").length>1)this.traceId=by.w3cTraceId(),this.spanId=by.w3cTraceId().substr(0,16);else{var n=e.trim().split("-"),o=n.length;o>=4?(this.version=n[0],this.traceId=n[1],this.spanId=n[2],this.traceFlag=n[3]):(this.traceId=by.w3cTraceId(),this.spanId=by.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=by.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=by.w3cTraceId(),this.spanId=by.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=by.w3cTraceId(),this.spanId=by.w3cTraceId().substr(0,16)),this.version.match(/^0[0-9a-f]$/g)||(this.version=t.DEFAULT_VERSION),this.traceFlag.match(/^[0-9a-f]{2}$/g)||(this.traceFlag=t.DEFAULT_TRACE_FLAG,this.traceId=by.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=by.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=by.w3cTraceId().substr(0,16),this.traceId=by.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=pwa.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=by.w3cTraceId()),r.indexOf("|")!==-1&&(r=r.substring(1+r.substring(0,r.length-1).lastIndexOf("."),r.length-1)),this.traceId=s,this.spanId=r}else this.traceId=by.w3cTraceId(),this.spanId=by.w3cTraceId().substr(0,16)}return a(t,"Traceparent"),t.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&e!=="00000000000000000000000000000000"},t.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&e!=="0000000000000000"},t.formatOpenTelemetryTraceFlags=function(e){var r="0"+e.toString(16);return r.substring(r.length-2)},t.prototype.getBackCompatRequestId=function(){return"|".concat(this.traceId,".").concat(this.spanId,".")},t.prototype.toString=function(){return"".concat(this.version,"-").concat(this.traceId,"-").concat(this.spanId,"-").concat(this.traceFlag)},t.prototype.updateSpanId=function(){this.spanId=by.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();lIi.exports=hwa});var QCr=I((xTp,uIi)=>{"use strict";p();var mwa=(function(){function t(e){this.fieldmap=[],e&&(this.fieldmap=this.parseHeader(e))}return a(t,"Tracestate"),t.prototype.toString=function(){var e=this.fieldmap;return!e||e.length==0?null:e.join(", ")},t.validateKeyChars=function(e){var r=e.split("@");if(r.length==2){var n=r[0].trim(),o=r[1].trim(),s=!!n.match(/^[\ ]?[a-z0-9\*\-\_/]{1,241}$/),c=!!o.match(/^[\ ]?[a-z0-9\*\-\_/]{1,14}$/);return s&&c}else if(r.length==1)return!!e.match(/^[\ ]?[a-z0-9\*\-\_/]{1,256}$/);return!1},t.prototype.parseHeader=function(e){var r=[],n={},o=e.split(",");if(o.length>32)return null;for(var s=0,c=o;s{"use strict";p();var gwa=(function(){function t(){}return a(t,"Domain"),t})();dIi.exports=gwa});var pIi=I((qCr,fIi)=>{"use strict";p();var Awa=qCr&&qCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),ywa=v6(),_wa=(function(t){Awa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(ywa);fIi.exports=_wa});var jCr=I((OTp,hIi)=>{"use strict";p();var Ewa=(function(){function t(){}return a(t,"Base"),t})();hIi.exports=Ewa});var gIi=I((FTp,mIi)=>{"use strict";p();var vwa=(function(){function t(){this.applicationVersion="ai.application.ver",this.deviceId="ai.device.id",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceOEMName="ai.device.oemName",this.deviceOSVersion="ai.device.osVersion",this.deviceType="ai.device.type",this.locationIp="ai.location.ip",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.userAccountId="ai.user.accountId",this.userId="ai.user.id",this.userAuthUserId="ai.user.authUserId",this.cloudRole="ai.cloud.role",this.cloudRoleInstance="ai.cloud.roleInstance",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"}return a(t,"ContextTagKeys"),t})();mIi.exports=vwa});var yIi=I((HCr,AIi)=>{"use strict";p();var Cwa=HCr&&HCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),bwa=jCr(),Swa=(function(t){Cwa(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})(bwa);AIi.exports=Swa});var $Cr=I((HTp,_Ii)=>{"use strict";p();var GCr;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(GCr||(GCr={}));_Ii.exports=GCr});var vIi=I(($Tp,EIi)=>{"use strict";p();var Twa=$Cr(),Iwa=(function(){function t(){this.kind=Twa.Measurement}return a(t,"DataPoint"),t})();EIi.exports=Iwa});var bIi=I((zTp,CIi)=>{"use strict";p();var xwa=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();CIi.exports=xwa});var WCr=I((VCr,SIi)=>{"use strict";p();var wwa=VCr&&VCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Rwa=v6(),kwa=(function(t){wwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"EventData"),e})(Rwa);SIi.exports=kwa});var IIi=I((zCr,TIi)=>{"use strict";p();var Pwa=zCr&&zCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Dwa=v6(),Nwa=(function(t){Pwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.exceptions=[],r.properties={},r.measurements={},r}return a(e,"ExceptionData"),e})(Dwa);TIi.exports=Nwa});var wIi=I((tIp,xIi)=>{"use strict";p();var Mwa=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();xIi.exports=Mwa});var kIi=I((YCr,RIi)=>{"use strict";p();var Owa=YCr&&YCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Lwa=v6(),Bwa=(function(t){Owa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(Lwa);RIi.exports=Bwa});var DIi=I((KCr,PIi)=>{"use strict";p();var Fwa=KCr&&KCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Uwa=v6(),Qwa=(function(t){Fwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.metrics=[],r.properties={},r}return a(e,"MetricData"),e})(Uwa);PIi.exports=Qwa});var MIi=I((JCr,NIi)=>{"use strict";p();var qwa=JCr&&JCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),jwa=WCr(),Hwa=(function(t){qwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"PageViewData"),e})(jwa);NIi.exports=Hwa});var LIi=I((ZCr,OIi)=>{"use strict";p();var Gwa=ZCr&&ZCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),$wa=v6(),Vwa=(function(t){Gwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.success=!0,r.properties={},r.measurements={},r}return a(e,"RemoteDependencyData"),e})($wa);OIi.exports=Vwa});var FIi=I((XCr,BIi)=>{"use strict";p();var Wwa=XCr&&XCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),zwa=v6(),Ywa=(function(t){Wwa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"RequestData"),e})(zwa);BIi.exports=Ywa});var QIi=I((hIp,UIi)=>{"use strict";p();var ebr;(function(t){t[t.Verbose=0]="Verbose",t[t.Information=1]="Information",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.Critical=4]="Critical"})(ebr||(ebr={}));UIi.exports=ebr});var jIi=I((gIp,qIi)=>{"use strict";p();var Kwa=(function(){function t(){}return a(t,"StackFrame"),t})();qIi.exports=Kwa});var tbr=I(Mm=>{"use strict";p();Object.defineProperty(Mm,"__esModule",{value:!0});Mm.AvailabilityData=pIi();Mm.Base=jCr();Mm.ContextTagKeys=gIi();Mm.Data=yIi();Mm.DataPoint=vIi();Mm.DataPointType=$Cr();Mm.Domain=v6();Mm.Envelope=bIi();Mm.EventData=WCr();Mm.ExceptionData=IIi();Mm.ExceptionDetails=wIi();Mm.MessageData=kIi();Mm.MetricData=DIi();Mm.PageViewData=MIi();Mm.RemoteDependencyData=LIi();Mm.RequestData=FIi();Mm.SeverityLevel=QIi();Mm.StackFrame=jIi()});var HIi=I(z5e=>{"use strict";p();Object.defineProperty(z5e,"__esModule",{value:!0});z5e.RemoteDependencyDataConstants=void 0;z5e.domainSupportsProperties=Zwa;var Lte=tbr(),Jwa=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();z5e.RemoteDependencyDataConstants=Jwa;function Zwa(t){return"properties"in t||t instanceof Lte.EventData||t instanceof Lte.ExceptionData||t instanceof Lte.MessageData||t instanceof Lte.MetricData||t instanceof Lte.PageViewData||t instanceof Lte.RemoteDependencyData||t instanceof Lte.RequestData}a(Zwa,"domainSupportsProperties")});var $Ii=I(GIi=>{"use strict";p();Object.defineProperty(GIi,"__esModule",{value:!0})});var WIi=I(VIi=>{"use strict";p();Object.defineProperty(VIi,"__esModule",{value:!0})});var YIi=I(zIi=>{"use strict";p();Object.defineProperty(zIi,"__esModule",{value:!0})});var JIi=I(KIi=>{"use strict";p();Object.defineProperty(KIi,"__esModule",{value:!0})});var XIi=I(ZIi=>{"use strict";p();Object.defineProperty(ZIi,"__esModule",{value:!0})});var txi=I(exi=>{"use strict";p();Object.defineProperty(exi,"__esModule",{value:!0})});var nxi=I(rxi=>{"use strict";p();Object.defineProperty(rxi,"__esModule",{value:!0})});var oxi=I(ixi=>{"use strict";p();Object.defineProperty(ixi,"__esModule",{value:!0})});var axi=I(sxi=>{"use strict";p();Object.defineProperty(sxi,"__esModule",{value:!0})});var lxi=I(cxi=>{"use strict";p();Object.defineProperty(cxi,"__esModule",{value:!0})});var dxi=I(uxi=>{"use strict";p();Object.defineProperty(uxi,"__esModule",{value:!0})});var pxi=I(fxi=>{"use strict";p();Object.defineProperty(fxi,"__esModule",{value:!0})});var hxi=I(c$=>{"use strict";p();Object.defineProperty(c$,"__esModule",{value:!0});c$.TelemetryType=c$.TelemetryTypeString=void 0;c$.telemetryTypeToBaseType=Xwa;c$.baseTypeToTelemetryType=eRa;function Xwa(t){switch(t){case tA.Event:return"EventData";case tA.Exception:return"ExceptionData";case tA.Trace:return"MessageData";case tA.Metric:return"MetricData";case tA.Request:return"RequestData";case tA.Dependency:return"RemoteDependencyData";case tA.Availability:return"AvailabilityData";case tA.PageView:return"PageViewData"}}a(Xwa,"telemetryTypeToBaseType");function eRa(t){switch(t){case"EventData":return tA.Event;case"ExceptionData":return tA.Exception;case"MessageData":return tA.Trace;case"MetricData":return tA.Metric;case"RequestData":return tA.Request;case"RemoteDependencyData":return tA.Dependency;case"AvailabilityData":return tA.Availability;case"PageViewData":return tA.PageView}}a(eRa,"baseTypeToTelemetryType");c$.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var tA;(function(t){t[t.Event=0]="Event",t[t.Exception=1]="Exception",t[t.Trace=2]="Trace",t[t.Metric=3]="Metric",t[t.Request=4]="Request",t[t.Dependency=5]="Dependency",t[t.Availability=6]="Availability",t[t.PageView=7]="PageView"})(tA||(c$.TelemetryType=tA={}))});var mxi=I(Mg=>{"use strict";p();var tRa=Mg&&Mg.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),AI=Mg&&Mg.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tRa(e,t,r)};Object.defineProperty(Mg,"__esModule",{value:!0});AI($Ii(),Mg);AI(WIi(),Mg);AI(YIi(),Mg);AI(JIi(),Mg);AI(XIi(),Mg);AI(txi(),Mg);AI(nxi(),Mg);AI(oxi(),Mg);AI(axi(),Mg);AI(lxi(),Mg);AI(dxi(),Mg);AI(pxi(),Mg);AI(hxi(),Mg)});var Axi=I(gxi=>{"use strict";p();Object.defineProperty(gxi,"__esModule",{value:!0})});var _xi=I(yxi=>{"use strict";p();Object.defineProperty(yxi,"__esModule",{value:!0})});var vxi=I(Exi=>{"use strict";p();Object.defineProperty(Exi,"__esModule",{value:!0})});var bxi=I(Cxi=>{"use strict";p();Object.defineProperty(Cxi,"__esModule",{value:!0})});var Txi=I(Sxi=>{"use strict";p();Object.defineProperty(Sxi,"__esModule",{value:!0})});var xxi=I(Ixi=>{"use strict";p();Object.defineProperty(Ixi,"__esModule",{value:!0})});var Rxi=I(wxi=>{"use strict";p();Object.defineProperty(wxi,"__esModule",{value:!0})});var Pxi=I(kxi=>{"use strict";p();Object.defineProperty(kxi,"__esModule",{value:!0})});var Dxi=I(fS=>{"use strict";p();var rRa=fS&&fS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),l$=fS&&fS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rRa(e,t,r)};Object.defineProperty(fS,"__esModule",{value:!0});l$(Axi(),fS);l$(_xi(),fS);l$(vxi(),fS);l$(bxi(),fS);l$(Txi(),fS);l$(xxi(),fS);l$(Rxi(),fS);l$(Pxi(),fS)});var Z_=I(cL=>{"use strict";p();var nRa=cL&&cL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),T0t=cL&&cL.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nRa(e,t,r)};Object.defineProperty(cL,"__esModule",{value:!0});T0t(HIi(),cL);T0t(tbr(),cL);T0t(mxi(),cL);T0t(Dxi(),cL)});var rbr=I((Cxp,Nxi)=>{"use strict";p();var iRa=(function(){function t(){}return a(t,"RequestParser"),t.prototype.getUrl=function(){return this.url},t.prototype.RequestParser=function(){this.startTime=+new Date},t.prototype._setStatus=function(e,r){var n=+new Date;this.duration=n-this.startTime,this.statusCode=e;var o=this.properties||{};if(r){if(typeof r=="string")o.error=r;else if(r instanceof Error)o.error=r.message;else if(typeof r=="object")for(var s in r)o[s]=r[s]&&r[s].toString&&r[s].toString()}this.properties=o},t.prototype._isSuccess=function(){return 0{"use strict";p();var MD;Object.defineProperty(Vr,"__esModule",{value:!0});Vr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE=Vr.WEB_INSTRUMENTATION_DEFAULT_SOURCE=Vr.TIME_SINCE_ENQUEUED=Vr.ENQUEUED_TIME=Vr.MessageBusDestination=Vr.MicrosoftEventHub=Vr.AzNamespace=Vr.AttachTypePrefix=Vr.HttpRequestCookieNames=Vr.StatsbeatNetworkCategory=Vr.StatsbeatFeatureType=Vr.StatsbeatInstrumentation=Vr.StatsbeatFeature=Vr.StatsbeatCounter=Vr.StatsbeatAttach=Vr.StatsbeatResourceProvider=Vr.StatsbeatTelemetryName=Vr.HeartBeatMetricName=Vr.DependencyTypeName=Vr.TelemetryTypeStringToQuickPulseDocumentType=Vr.TelemetryTypeStringToQuickPulseType=Vr.QuickPulseType=Vr.QuickPulseDocumentType=Vr.PerformanceToQuickPulseCounter=Vr.MetricId=Vr.PerformanceCounter=Vr.QuickPulseCounter=Vr.DEFAULT_LIVEMETRICS_HOST=Vr.DEFAULT_LIVEMETRICS_ENDPOINT=Vr.DEFAULT_BREEZE_ENDPOINT=Vr.APPLICATION_INSIGHTS_SDK_VERSION=void 0;Vr.APPLICATION_INSIGHTS_SDK_VERSION="2.9.8";Vr.DEFAULT_BREEZE_ENDPOINT="https://dc.services.visualstudio.com";Vr.DEFAULT_LIVEMETRICS_ENDPOINT="https://rt.services.visualstudio.com";Vr.DEFAULT_LIVEMETRICS_HOST="rt.services.visualstudio.com";var Sy;(function(t){t.COMMITTED_BYTES="\\Memory\\Committed Bytes",t.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",t.REQUEST_RATE="\\ApplicationInsights\\Requests/Sec",t.REQUEST_FAILURE_RATE="\\ApplicationInsights\\Requests Failed/Sec",t.REQUEST_DURATION="\\ApplicationInsights\\Request Duration",t.DEPENDENCY_RATE="\\ApplicationInsights\\Dependency Calls/Sec",t.DEPENDENCY_FAILURE_RATE="\\ApplicationInsights\\Dependency Calls Failed/Sec",t.DEPENDENCY_DURATION="\\ApplicationInsights\\Dependency Call Duration",t.EXCEPTION_RATE="\\ApplicationInsights\\Exceptions/Sec"})(Sy||(Vr.QuickPulseCounter=Sy={}));var Y5e;(function(t){t.PRIVATE_BYTES="\\Process(??APP_WIN32_PROC??)\\Private Bytes",t.AVAILABLE_BYTES="\\Memory\\Available Bytes",t.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",t.PROCESS_TIME="\\Process(??APP_WIN32_PROC??)\\% Processor Time",t.REQUEST_RATE="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec",t.REQUEST_DURATION="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time"})(Y5e||(Vr.PerformanceCounter=Y5e={}));var Mxi;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(Mxi||(Vr.MetricId=Mxi={}));Vr.PerformanceToQuickPulseCounter=(MD={},MD[Y5e.PROCESSOR_TIME]=Sy.PROCESSOR_TIME,MD[Y5e.REQUEST_RATE]=Sy.REQUEST_RATE,MD[Y5e.REQUEST_DURATION]=Sy.REQUEST_DURATION,MD[Sy.COMMITTED_BYTES]=Sy.COMMITTED_BYTES,MD[Sy.REQUEST_FAILURE_RATE]=Sy.REQUEST_FAILURE_RATE,MD[Sy.DEPENDENCY_RATE]=Sy.DEPENDENCY_RATE,MD[Sy.DEPENDENCY_FAILURE_RATE]=Sy.DEPENDENCY_FAILURE_RATE,MD[Sy.DEPENDENCY_DURATION]=Sy.DEPENDENCY_DURATION,MD[Sy.EXCEPTION_RATE]=Sy.EXCEPTION_RATE,MD);Vr.QuickPulseDocumentType={Event:"Event",Exception:"Exception",Trace:"Trace",Metric:"Metric",Request:"Request",Dependency:"RemoteDependency",Availability:"Availability",PageView:"PageView"};Vr.QuickPulseType={Event:"EventTelemetryDocument",Exception:"ExceptionTelemetryDocument",Trace:"TraceTelemetryDocument",Metric:"MetricTelemetryDocument",Request:"RequestTelemetryDocument",Dependency:"DependencyTelemetryDocument",Availability:"AvailabilityTelemetryDocument",PageView:"PageViewTelemetryDocument"};Vr.TelemetryTypeStringToQuickPulseType={EventData:Vr.QuickPulseType.Event,ExceptionData:Vr.QuickPulseType.Exception,MessageData:Vr.QuickPulseType.Trace,MetricData:Vr.QuickPulseType.Metric,RequestData:Vr.QuickPulseType.Request,RemoteDependencyData:Vr.QuickPulseType.Dependency,AvailabilityData:Vr.QuickPulseType.Availability,PageViewData:Vr.QuickPulseType.PageView};Vr.TelemetryTypeStringToQuickPulseDocumentType={EventData:Vr.QuickPulseDocumentType.Event,ExceptionData:Vr.QuickPulseDocumentType.Exception,MessageData:Vr.QuickPulseDocumentType.Trace,MetricData:Vr.QuickPulseDocumentType.Metric,RequestData:Vr.QuickPulseDocumentType.Request,RemoteDependencyData:Vr.QuickPulseDocumentType.Dependency,AvailabilityData:Vr.QuickPulseDocumentType.Availability,PageViewData:Vr.QuickPulseDocumentType.PageView};Vr.DependencyTypeName={Grpc:"GRPC",Http:"HTTP",InProc:"InProc",Sql:"SQL",QueueMessage:"Queue Message"};Vr.HeartBeatMetricName="HeartbeatState";Vr.StatsbeatTelemetryName="Statsbeat";Vr.StatsbeatResourceProvider={appsvc:"appsvc",aks:"aks",functions:"functions",vm:"vm",unknown:"unknown"};Vr.StatsbeatAttach={codeless:"IntegratedAuto",sdk:"Manual"};Vr.StatsbeatCounter={REQUEST_SUCCESS:"Request_Success_Count",REQUEST_FAILURE:"Request_Failure_Count",REQUEST_DURATION:"Request_Duration",RETRY_COUNT:"Retry_Count",THROTTLE_COUNT:"Throttle_Count",EXCEPTION_COUNT:"Exception_Count",ATTACH:"Attach",FEATURE:"Feature"};var Oxi;(function(t){t[t.NONE=0]="NONE",t[t.DISK_RETRY=1]="DISK_RETRY",t[t.AAD_HANDLING=2]="AAD_HANDLING",t[t.BROWSER_SDK_LOADER=4]="BROWSER_SDK_LOADER",t[t.LIVE_METRICS=16]="LIVE_METRICS",t[t.NATIVE_METRICS=8192]="NATIVE_METRICS"})(Oxi||(Vr.StatsbeatFeature=Oxi={}));var Lxi;(function(t){t[t.NONE=0]="NONE",t[t.AZURE_CORE_TRACING=1]="AZURE_CORE_TRACING",t[t.MONGODB=2]="MONGODB",t[t.MYSQL=4]="MYSQL",t[t.REDIS=8]="REDIS",t[t.POSTGRES=16]="POSTGRES",t[t.BUNYAN=32]="BUNYAN",t[t.WINSTON=64]="WINSTON",t[t.CONSOLE=128]="CONSOLE"})(Lxi||(Vr.StatsbeatInstrumentation=Lxi={}));var Bxi;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(Bxi||(Vr.StatsbeatFeatureType=Bxi={}));var Fxi;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(Fxi||(Vr.StatsbeatNetworkCategory=Fxi={}));var Uxi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(Uxi||(Vr.HttpRequestCookieNames=Uxi={}));var Qxi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(Qxi||(Vr.AttachTypePrefix=Qxi={}));Vr.AzNamespace="az.namespace";Vr.MicrosoftEventHub="Microsoft.EventHub";Vr.MessageBusDestination="message_bus.destination";Vr.ENQUEUED_TIME="enqueuedTime";Vr.TIME_SINCE_ENQUEUED="timeSinceEnqueued";Vr.WEB_INSTRUMENTATION_DEFAULT_SOURCE="https://js.monitor.azure.com/scripts/b/ai";Vr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE="https://az416426.vo.msecnd.net/scripts/b/ai"});var sbr=I((obr,qxi)=>{"use strict";p();var oRa=obr&&obr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),I0t=require("url"),sRa=Z_(),nbr=Cy(),yI=Y0e(),aRa=rbr(),u$=Ote(),cRa=QCr(),ibr=S0t(),lRa=lu(),x0t=xd(),uRa=(function(t){oRa(e,t);function e(r,n){var o=t.call(this)||this;return r&&(o.method=r.method,o.url=o._getAbsoluteUrl(r),o.startTime=+new Date,o.socketRemoteAddress=r.socket&&r.socket.remoteAddress,o.parseHeaders(r,n),r.connection&&(o.connectionRemoteAddress=r.connection.remoteAddress,o.legacySocketRemoteAddress=r.connection.socket&&r.connection.socket.remoteAddress)),o}return a(e,"HttpRequestParser"),e.prototype.onError=function(r,n){this._setStatus(void 0,r),n&&(this.duration=n)},e.prototype.onResponse=function(r,n){this._setStatus(r.statusCode,void 0),n&&(this.duration=n)},e.prototype.getRequestTelemetry=function(r){var n=this.method;try{n+=" "+new I0t.URL(this.url).pathname}catch{}var o={id:this.requestId,name:n,url:this.url,source:this.sourceCorrelationId,duration:this.duration,resultCode:this.statusCode?this.statusCode.toString():null,success:this._isSuccess(),properties:this.properties};if(r&&r.time?o.time=r.time:this.startTime&&(o.time=new Date(this.startTime)),r){for(var s in r)o[s]||(o[s]=r[s]);if(r.properties)for(var s in r.properties)o.properties[s]=r.properties[s]}return o},e.prototype.getRequestTags=function(r){var n={};for(var o in r)n[o]=r[o];return n[e.keys.locationIp]=r[e.keys.locationIp]||this._getIp(),n[e.keys.sessionId]=r[e.keys.sessionId]||this._getId(x0t.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(x0t.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(x0t.HttpRequestCookieNames.AUTH_USER),n[e.keys.operationName]=this.getOperationName(r),n[e.keys.operationParentId]=this.getOperationParentId(r),n[e.keys.operationId]=this.getOperationId(r),n},e.prototype.getOperationId=function(r){return r[e.keys.operationId]||this.operationId},e.prototype.getOperationParentId=function(r){return r[e.keys.operationParentId]||this.parentId||this.getOperationId(r)},e.prototype.getOperationName=function(r){if(r[e.keys.operationName])return r[e.keys.operationName];var n="";try{n=new I0t.URL(this.url).pathname}catch{}var o=this.method;return n&&(o+=" "+n),o},e.prototype.getRequestId=function(){return this.requestId},e.prototype.getCorrelationContextHeader=function(){return this.correlationContextHeader},e.prototype.getTraceparent=function(){return this.traceparent},e.prototype.getTracestate=function(){return this.tracestate},e.prototype.getLegacyRootId=function(){return this.legacyRootId},e.prototype._getAbsoluteUrl=function(r){if(!r.headers)return r.url;var n=r.connection?r.connection.encrypted:null,o=n||r.headers["x-forwarded-proto"]=="https"?"https":"http",s=o+"://"+r.headers.host+"/",c="",l="";try{var u=new I0t.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=I0t.format({protocol:o,host:r.headers.host,pathname:c,search:l});return d},e.prototype._getIp=function(){var r=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/,n=a(function(s){var c=r.exec(s);if(c)return c[0]},"check"),o=n(this.rawHeaders["x-forwarded-for"])||n(this.rawHeaders["x-client-ip"])||n(this.rawHeaders["x-real-ip"])||n(this.connectionRemoteAddress)||n(this.socketRemoteAddress)||n(this.legacySocketRemoteAddress);return!o&&this.connectionRemoteAddress&&this.connectionRemoteAddress.substr&&this.connectionRemoteAddress.substr(0,2)==="::"&&(o="127.0.0.1"),o},e.prototype._getId=function(r){var n=this.rawHeaders&&this.rawHeaders.cookie&&typeof this.rawHeaders.cookie=="string"&&this.rawHeaders.cookie||"";if(r===x0t.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",lRa.warn("Could not decode the auth cookie with error: ",nbr.dumpObj(s))}var o=e.parseId(nbr.getCookie(r,n));return o},e.prototype.setBackCompatFromThisTraceContext=function(){this.operationId=this.traceparent.traceId,this.traceparent.legacyRootId&&(this.legacyRootId=this.traceparent.legacyRootId),this.parentId=this.traceparent.parentId,this.traceparent.updateSpanId(),this.requestId=this.traceparent.getBackCompatRequestId()},e.prototype.parseHeaders=function(r,n){if(this.rawHeaders=r.headers||r.rawHeaders,this.userAgent=r.headers&&r.headers["user-agent"],this.sourceCorrelationId=nbr.getCorrelationContextTarget(r,yI.requestContextSourceKey),r.headers){var o=r.headers[yI.traceStateHeader]?r.headers[yI.traceStateHeader].toString():null,s=r.headers[yI.traceparentHeader]?r.headers[yI.traceparentHeader].toString():null,c=r.headers[yI.requestIdHeader]?r.headers[yI.requestIdHeader].toString():null,l=r.headers[yI.parentIdHeader]?r.headers[yI.parentIdHeader].toString():null,u=r.headers[yI.rootIdHeader]?r.headers[yI.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[yI.correlationContextHeader]?r.headers[yI.correlationContextHeader].toString():null,u$.w3cEnabled&&(s||o)?(this.traceparent=new ibr(s?s.toString():null),this.tracestate=s&&o&&new cRa(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?u$.w3cEnabled?(this.traceparent=new ibr(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=u$.generateRequestId(this.parentId),this.operationId=u$.getRootId(this.requestId)):u$.w3cEnabled?(this.traceparent=new ibr,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=u$.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=u$.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=u$.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new sRa.ContextTagKeys,e})(aRa);qxi.exports=uRa});var iwi=I((Eo,nwi)=>{p();Eo=nwi.exports=Qa;var Cl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?Cl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):Cl=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var K5e=256,w0t=Number.MAX_SAFE_INTEGER||9007199254740991,abr=16,dRa=K5e-6,J5e=Eo.re=[],qu=Eo.safeRe=[],ir=Eo.src=[],ba=0,fbr="[a-zA-Z0-9-]",cbr=[["\\s",1],["\\d",K5e],[fbr,dRa]];function M0t(t){for(var e=0;e)?=?)";var R0t=ba++;ir[R0t]=ir[Z0e]+"|x|X|\\*";var k0t=ba++;ir[k0t]=ir[J0e]+"|x|X|\\*";var Bte=ba++;ir[Bte]="[v=\\s]*("+ir[k0t]+")(?:\\.("+ir[k0t]+")(?:\\.("+ir[k0t]+")(?:"+ir[hbr]+")?"+ir[X5e]+"?)?)?";var eAe=ba++;ir[eAe]="[v=\\s]*("+ir[R0t]+")(?:\\.("+ir[R0t]+")(?:\\.("+ir[R0t]+")(?:"+ir[mbr]+")?"+ir[X5e]+"?)?)?";var Vxi=ba++;ir[Vxi]="^"+ir[nAe]+"\\s*"+ir[Bte]+"$";var Wxi=ba++;ir[Wxi]="^"+ir[nAe]+"\\s*"+ir[eAe]+"$";var zxi=ba++;ir[zxi]="(?:^|[^\\d])(\\d{1,"+abr+"})(?:\\.(\\d{1,"+abr+"}))?(?:\\.(\\d{1,"+abr+"}))?(?:$|[^\\d])";var O0t=ba++;ir[O0t]="(?:~>?)";var tAe=ba++;ir[tAe]="(\\s*)"+ir[O0t]+"\\s+";J5e[tAe]=new RegExp(ir[tAe],"g");qu[tAe]=new RegExp(M0t(ir[tAe]),"g");var fRa="$1~",Yxi=ba++;ir[Yxi]="^"+ir[O0t]+ir[Bte]+"$";var Kxi=ba++;ir[Kxi]="^"+ir[O0t]+ir[eAe]+"$";var L0t=ba++;ir[L0t]="(?:\\^)";var rAe=ba++;ir[rAe]="(\\s*)"+ir[L0t]+"\\s+";J5e[rAe]=new RegExp(ir[rAe],"g");qu[rAe]=new RegExp(M0t(ir[rAe]),"g");var pRa="$1^",Jxi=ba++;ir[Jxi]="^"+ir[L0t]+ir[Bte]+"$";var Zxi=ba++;ir[Zxi]="^"+ir[L0t]+ir[eAe]+"$";var _br=ba++;ir[_br]="^"+ir[nAe]+"\\s*("+Abr+")$|^$";var Ebr=ba++;ir[Ebr]="^"+ir[nAe]+"\\s*("+$xi+")$|^$";var Fte=ba++;ir[Fte]="(\\s*)"+ir[nAe]+"\\s*("+Abr+"|"+ir[Bte]+")";J5e[Fte]=new RegExp(ir[Fte],"g");qu[Fte]=new RegExp(M0t(ir[Fte]),"g");var hRa="$1$2$3",Xxi=ba++;ir[Xxi]="^\\s*("+ir[Bte]+")\\s+-\\s+("+ir[Bte]+")\\s*$";var ewi=ba++;ir[ewi]="^\\s*("+ir[eAe]+")\\s+-\\s+("+ir[eAe]+")\\s*$";var twi=ba++;ir[twi]="(<|>)?=?\\s*\\*";for(lL=0;lLK5e)return null;var r=e.loose?qu[ybr]:qu[gbr];if(!r.test(t))return null;try{return new Qa(t,e)}catch{return null}}a(Ute,"parse");Eo.valid=mRa;function mRa(t,e){var r=Ute(t,e);return r?r.version:null}a(mRa,"valid");Eo.clean=gRa;function gRa(t,e){var r=Ute(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(gRa,"clean");Eo.SemVer=Qa;function Qa(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Qa){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>K5e)throw new TypeError("version is longer than "+K5e+" characters");if(!(this instanceof Qa))return new Qa(t,e);Cl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?qu[ybr]:qu[gbr]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>w0t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>w0t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>w0t||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var o=+n;if(o>=0&&o=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};Eo.inc=ARa;function ARa(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Qa(t,r).inc(e,n).version}catch{return null}}a(ARa,"inc");Eo.diff=yRa;function yRa(t,e){if(vbr(t,e))return null;var r=Ute(t),n=Ute(e),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var s="prerelease"}for(var c in r)if((c==="major"||c==="minor"||c==="patch")&&r[c]!==n[c])return o+c;return s}a(yRa,"diff");Eo.compareIdentifiers=X0e;var jxi=/^[0-9]+$/;function X0e(t,e){var r=jxi.test(t),n=jxi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(Z5e,"gt");Eo.lt=P0t;function P0t(t,e,r){return C6(t,e,r)<0}a(P0t,"lt");Eo.eq=vbr;function vbr(t,e,r){return C6(t,e,r)===0}a(vbr,"eq");Eo.neq=rwi;function rwi(t,e,r){return C6(t,e,r)!==0}a(rwi,"neq");Eo.gte=Cbr;function Cbr(t,e,r){return C6(t,e,r)>=0}a(Cbr,"gte");Eo.lte=bbr;function bbr(t,e,r){return C6(t,e,r)<=0}a(bbr,"lte");Eo.cmp=D0t;function D0t(t,e,r,n){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return vbr(t,r,n);case"!=":return rwi(t,r,n);case">":return Z5e(t,r,n);case">=":return Cbr(t,r,n);case"<":return P0t(t,r,n);case"<=":return bbr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(D0t,"cmp");Eo.Comparator=HR;function HR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof HR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof HR))return new HR(t,e);t=t.trim().split(/\s+/).join(" "),Cl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===e4e?this.value="":this.value=this.operator+this.semver.version,Cl("comp",this)}a(HR,"Comparator");var e4e={};HR.prototype.parse=function(t){var e=this.options.loose?qu[_br]:qu[Ebr],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new Qa(r[2],this.options.loose):this.semver=e4e};HR.prototype.toString=function(){return this.value};HR.prototype.test=function(t){return Cl("Comparator.test",t,this.options.loose),this.semver===e4e?!0:(typeof t=="string"&&(t=new Qa(t,this.options)),D0t(t,this.operator,this.semver,this.options))};HR.prototype.intersects=function(t,e){if(!(t instanceof HR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Qf(t.value,e),N0t(this.value,r,e);if(t.operator==="")return r=new Qf(this.value,e),N0t(t.semver,r,e);var n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),l=D0t(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=D0t(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=Qf;function Qf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Qf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Qf(t.raw,e);if(t instanceof HR)return new Qf(t.value,e);if(!(this instanceof Qf))return new Qf(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}a(Qf,"Range");Qf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Qf.prototype.toString=function(){return this.range};Qf.prototype.parseRange=function(t){var e=this.options.loose,r=e?qu[ewi]:qu[Xxi];t=t.replace(r,LRa),Cl("hyphen replace",t),t=t.replace(qu[Fte],hRa),Cl("comparator trim",t,qu[Fte]),t=t.replace(qu[tAe],fRa),t=t.replace(qu[rAe],pRa);var n=e?qu[_br]:qu[Ebr],o=t.split(" ").map(function(s){return wRa(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter(function(s){return!!s.match(n)})),o=o.map(function(s){return new HR(s,this.options)},this),o};Qf.prototype.intersects=function(t,e){if(!(t instanceof Qf))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return t.set.some(function(o){return o.every(function(s){return n.intersects(s,e)})})})})};Eo.toComparators=xRa;function xRa(t,e){return new Qf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(xRa,"toComparators");function wRa(t,e){return Cl("comp",t,e),t=PRa(t,e),Cl("caret",t),t=RRa(t,e),Cl("tildes",t),t=NRa(t,e),Cl("xrange",t),t=ORa(t,e),Cl("stars",t),t}a(wRa,"parseComparator");function jv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(jv,"isX");function RRa(t,e){return t.trim().split(/\s+/).map(function(r){return kRa(r,e)}).join(" ")}a(RRa,"replaceTildes");function kRa(t,e){var r=e.loose?qu[Kxi]:qu[Yxi];return t.replace(r,function(n,o,s,c,l){Cl("tilde",t,n,o,s,c,l);var u;return jv(o)?u="":jv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":jv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(Cl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",Cl("tilde return",u),u})}a(kRa,"replaceTilde");function PRa(t,e){return t.trim().split(/\s+/).map(function(r){return DRa(r,e)}).join(" ")}a(PRa,"replaceCarets");function DRa(t,e){Cl("caret",t,e);var r=e.loose?qu[Zxi]:qu[Jxi];return t.replace(r,function(n,o,s,c,l){Cl("caret",t,n,o,s,c,l);var u;return jv(o)?u="":jv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":jv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(Cl("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(Cl("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),Cl("caret return",u),u})}a(DRa,"replaceCaret");function NRa(t,e){return Cl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return MRa(r,e)}).join(" ")}a(NRa,"replaceXRanges");function MRa(t,e){t=t.trim();var r=e.loose?qu[Wxi]:qu[Vxi];return t.replace(r,function(n,o,s,c,l,u){Cl("xRange",t,n,o,s,c,l,u);var d=jv(s),f=d||jv(c),h=f||jv(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),Cl("xRange return",n),n})}a(MRa,"replaceXRange");function ORa(t,e){return Cl("replaceStars",t,e),t.trim().replace(qu[twi],"")}a(ORa,"replaceStars");function LRa(t,e,r,n,o,s,c,l,u,d,f,h,m){return jv(r)?e="":jv(n)?e=">="+r+".0.0":jv(o)?e=">="+r+"."+n+".0":e=">="+e,jv(u)?l="":jv(d)?l="<"+(+u+1)+".0.0":jv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(LRa,"hyphenReplace");Qf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Qa(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(BRa,"testSet");Eo.satisfies=N0t;function N0t(t,e,r){try{e=new Qf(e,r)}catch{return!1}return e.test(t)}a(N0t,"satisfies");Eo.maxSatisfying=FRa;function FRa(t,e,r){var n=null,o=null;try{var s=new Qf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Qa(n,r))}),n}a(FRa,"maxSatisfying");Eo.minSatisfying=URa;function URa(t,e,r){var n=null,o=null;try{var s=new Qf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Qa(n,r))}),n}a(URa,"minSatisfying");Eo.minVersion=QRa;function QRa(t,e){t=new Qf(t,e);var r=new Qa("0.0.0");if(t.test(r)||(r=new Qa("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||Z5e(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(QRa,"minVersion");Eo.validRange=qRa;function qRa(t,e){try{return new Qf(t,e).range||"*"}catch{return null}}a(qRa,"validRange");Eo.ltr=jRa;function jRa(t,e,r){return Sbr(t,e,"<",r)}a(jRa,"ltr");Eo.gtr=HRa;function HRa(t,e,r){return Sbr(t,e,">",r)}a(HRa,"gtr");Eo.outside=Sbr;function Sbr(t,e,r,n){t=new Qa(t,n),e=new Qf(e,n);var o,s,c,l,u;switch(r){case">":o=Z5e,s=bbr,c=P0t,l=">",u=">=";break;case"<":o=P0t,s=Cbr,c=Z5e,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(N0t(t,e,n))return!1;for(var d=0;d=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0}a(Sbr,"outside");Eo.prerelease=GRa;function GRa(t,e){var r=Ute(t,e);return r&&r.prerelease.length?r.prerelease:null}a(GRa,"prerelease");Eo.intersects=$Ra;function $Ra(t,e,r){return t=new Qf(t,r),e=new Qf(e,r),t.intersects(e)}a($Ra,"intersects");Eo.coerce=VRa;function VRa(t){if(t instanceof Qa)return t;if(typeof t!="string")return null;var e=t.match(qu[zxi]);return e==null?null:Ute(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(VRa,"coerce")});var U0t=I((Pxp,cwi)=>{"use strict";p();var swi=L0e(),iAe=swi.wrap,B0t=swi.unwrap,b6="wrap@before";function F0t(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(F0t,"defineProperty");function WRa(t,e){for(var r=e.length,n=0;n0&&WRa(t,o)}a(zRa,"_findAndProcess");function owi(t,e){if(t){var r=t;if(typeof t=="function")r=e(t);else if(Array.isArray(t)){r=[];for(var n=0;n{"use strict";p();var jc=require("util"),S6=require("assert"),YRa=U0t(),wd=require("async_hooks"),t4e="cls@contexts",r4e="error@context",qf=process.env.DEBUG_CLS_HOOKED,qc=-1;dwi.exports={getNamespace:lwi,createNamespace:KRa,destroyNamespace:uwi,reset:JRa,ERROR_SYMBOL:r4e};function GR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}a(GR,"Namespace");GR.prototype.set=a(function(e,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");if(this.active[e]=r,qf){let n=" ".repeat(this._indent<0?0:this._indent);af(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+qc+" active:"+jc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");GR.prototype.get=a(function(e){if(!this.active){if(qf){let r=wd.currentId(),n=wd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);af(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${qc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(qf){let r=wd.executionAsyncId(),n=wd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);af(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+qc+" active:"+jc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),af(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${qc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${jc.inspect(this.active)}`)}return this.active[e]},"get");GR.prototype.createContext=a(function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=qc,qf){let r=wd.executionAsyncId(),n=wd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);af(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${qc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${jc.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},"createContext");GR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{if(qf){let n=wd.triggerAsyncId(),o=wd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);af(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${qc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${jc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[r4e]=r),n}finally{if(qf){let n=wd.triggerAsyncId(),o=wd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);af(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${qc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${jc.inspect(r)}`)}this.exit(r)}},"run");GR.prototype.runAndReturn=a(function(e){let r;return this.run(function(n){r=e(n)}),r},"runAndReturn");GR.prototype.runPromise=a(function(e){let r=this.createContext();this.enter(r);let n=e(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return qf&&af("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+qc+" len:"+this._set.length+" "+jc.inspect(r)),n.then(o=>(qf&&af("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+qc+" len:"+this._set.length+" "+jc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[r4e]=r,qf&&af("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+qc+" len:"+this._set.length+" "+jc.inspect(r)),this.exit(r),o})},"runPromise");GR.prototype.bind=a(function(e,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return a(function(){n.enter(r);try{return e.apply(this,arguments)}catch(s){throw s&&(s[r4e]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");GR.prototype.enter=a(function(e){if(S6.ok(e,"context must be provided for entering"),qf){let r=wd.executionAsyncId(),n=wd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);af(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${qc} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${jc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");GR.prototype.exit=a(function(e){if(S6.ok(e,"context must be provided for exiting"),qf){let n=wd.executionAsyncId(),o=wd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);af(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${qc} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${jc.inspect(e)}`)}if(this.active===e){S6.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(qf&&af("??ERROR?? context exiting but not entered - ignoring: "+jc.inspect(e)),S6.ok(r>=0,`context not currently entered; can't exit. `+jc.inspect(this)+` -`+jc.inspect(e))):(S6.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");GR.prototype.bindEmitter=a(function(e){S6.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[t4e]||(c[t4e]=Object.create(null)),c[t4e][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[t4e]))return c;let l=c,u=c[t4e];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),WRa(e,o,s)},"bindEmitter");GR.prototype.fromException=a(function(e){return e[r4e]},"fromException");function awi(t){return process.namespaces[t]}a(awi,"getNamespace");function zRa(t){S6.ok(t,"namespace must be given a name."),qf&&af(`NS-CREATING NAMESPACE (${t})`);let e=new GR(t);return e.id=qc,xd.createHook({init(n,o,s,c){if(qc=xd.executionAsyncId(),e.active){if(e._contexts.set(n,e.active),qf){let l=" ".repeat(e._indent<0?0:e._indent);af(`${l}INIT [${o}] (${t}) asyncId:${n} currentUid:${qc} triggerId:${s} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(qc===0){let l=xd.triggerAsyncId(),u=e._contexts.get(l);if(u){if(e._contexts.set(n,u),qf){let d=" ".repeat(e._indent<0?0:e._indent);af(`${d}INIT USING CONTEXT FROM TRIGGERID [${o}] (${t}) asyncId:${n} currentUid:${qc} triggerId:${l} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(qf){let d=" ".repeat(e._indent<0?0:e._indent);af(`${d}INIT MISSING CONTEXT [${o}] (${t}) asyncId:${n} currentUid:${qc} triggerId:${l} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}if(qf&&o==="PROMISE"){af(jc.inspect(c,{showHidden:!0}));let l=c.parentId,u=" ".repeat(e._indent<0?0:e._indent);af(`${u}INIT RESOURCE-PROMISE [${o}] (${t}) parentId:${l} asyncId:${n} currentUid:${qc} triggerId:${s} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}},before(n){qc=xd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(qc),o){if(qf){let s=xd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);af(`${c}BEFORE (${t}) asyncId:${n} currentUid:${qc} triggerId:${s} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${jc.inspect(o)}`),e._indent+=2}e.enter(o)}else if(qf){let s=xd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);af(`${c}BEFORE MISSING CONTEXT (${t}) asyncId:${n} currentUid:${qc} triggerId:${s} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${jc.inspect(e._contexts,{showHidden:!0,depth:2,colors:!0})}`),e._indent+=2}},after(n){qc=xd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(qc),o){if(qf){let s=xd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);af(`${c}AFTER (${t}) asyncId:${n} currentUid:${qc} triggerId:${s} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${jc.inspect(o)}`)}e.exit(o)}else if(qf){let s=xd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);af(`${c}AFTER MISSING CONTEXT (${t}) asyncId:${n} currentUid:${qc} triggerId:${s} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${jc.inspect(o)}`)}},destroy(n){if(qc=xd.executionAsyncId(),qf){let o=xd.triggerAsyncId(),s=" ".repeat(e._indent<0?0:e._indent);af(`${s}DESTROY (${t}) currentUid:${qc} asyncId:${n} triggerId:${o} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${jc.inspect(e._contexts.get(qc))}`)}e._contexts.delete(n)}}).enable(),process.namespaces[t]=e,e}a(zRa,"createNamespace");function cwi(t){let e=awi(t);S6.ok(e,`can't delete nonexistent namespace! "`+t+'"'),S6.ok(e.id,"don't assign to process.namespaces directly! "+jc.inspect(e)),process.namespaces[t]=null}a(cwi,"destroyNamespace");function YRa(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){cwi(t)}),process.namespaces=Object.create(null)}a(YRa,"reset");process.namespaces={};function af(...t){qf&&process._rawDebug(`${jc.format(...t)}`)}a(af,"debug2")});var fwi=I((Nxp,dwi)=>{"use strict";p();function KRa(){}a(KRa,"NextTickWrap");dwi.exports=a(function(){let e=this._hooks,r=this._state,n=process.nextTick;process.nextTick=function(){if(!r.enabled)return n.apply(process,arguments);let o=new Array(arguments.length);for(let u=0;u0&&process.once("uncaughtException",function(){e.post.call(c,l,!0),e.destroy.call(null,l)})}e.post.call(c,l,!1),e.destroy.call(null,l)},n.apply(process,o)}},"patch")});var hwi=I((Lxp,pwi)=>{"use strict";p();function JRa(){}a(JRa,"PromiseWrap");pwi.exports=a(function(){let e=this._hooks,r=this._state,n=global.Promise,o=n.prototype.then;n.prototype.then=u;function s(d,f,h,m){return typeof d!="function"?m?c(h):l(h):a(function(){e.pre.call(f,h);try{return d.apply(this,arguments)}finally{e.post.call(f,h,!1),e.destroy.call(null,h)}},"wrappedHandler")}a(s,"makeWrappedHandler");function c(d){return a(function(h){return e.destroy.call(null,d),h},"unhandledResolutionHandler")}a(c,"makeUnhandledResolutionHandler");function l(d){return a(function(h){throw e.destroy.call(null,d),h},"unhandledRejectedHandler")}a(l,"makeUnhandledRejectionHandler");function u(d,f){if(!r.enabled)return o.call(this,d,f);let h=new JRa,m=--r.counter;return e.init.call(h,m,0,null,null),o.call(this,s(d,h,m,!0),s(f,h,m,!1))}a(u,"wrappedThen")},"patchPromise")});var gwi=I((Uxp,mwi)=>{"use strict";p();var _I=require("timers");function ZRa(){}a(ZRa,"TimeoutWrap");function XRa(){}a(XRa,"IntervalWrap");function eka(){}a(eka,"ImmediateWrap");var tka=new Map,rka=new Map,nka=new Map,Sbr=null,Tbr=!1;mwi.exports=a(function(){Ibr(this._hooks,this._state,"setTimeout","clearTimeout",ZRa,tka,!0),Ibr(this._hooks,this._state,"setInterval","clearInterval",XRa,rka,!1),Ibr(this._hooks,this._state,"setImmediate","clearImmediate",eka,nka,!0),global.setTimeout=_I.setTimeout,global.setInterval=_I.setInterval,global.setImmediate=_I.setImmediate,global.clearTimeout=_I.clearTimeout,global.clearInterval=_I.clearInterval,global.clearImmediate=_I.clearImmediate},"patch");function Ibr(t,e,r,n,o,s,c){let l=_I[r],u=_I[n];_I[r]=function(){if(!e.enabled)return l.apply(_I,arguments);let d=new Array(arguments.length);for(let A=0;A0&&process.once("uncaughtException",function(){t.post.call(h,m,!0),s.delete(g),t.destroy.call(null,m)})}t.post.call(h,m,!1),Sbr=null,(c||Tbr)&&(Tbr=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(_I,d),s.set(g,m),g},_I[n]=function(d){if(Sbr===d&&d!==null)Tbr=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(_I,arguments)}}a(Ibr,"patchTimer")});var xbr=I((jxp,ika)=>{ika.exports={name:"async-hook-jl",description:"Inspect the life of handle objects in node",version:"1.7.6",author:"Andreas Madsen ",main:"./index.js",scripts:{test:"node ./test/runner.js && eslint ."},repository:{type:"git",url:"git://github.com/jeff-lewis/async-hook-jl.git"},keywords:["async","async hooks","inspect","async wrap"],license:"MIT",dependencies:{"stack-chain":"^1.3.7"},devDependencies:{async:"1.5.x","cli-color":"1.1.x",eslint:"^3.4.0",endpoint:"0.4.x"},engines:{node:"^4.7 || >=6.9 || >=7.3"}}});var _wi=I((Hxp,ywi)=>{"use strict";p();var i4e=process.binding("async_wrap"),oka=i4e.Providers.TIMERWRAP,Awi={nextTick:fwi(),promise:hwi(),timers:gwi()},n4e=new Set;function ska(){this.enabled=!1,this.counter=0}a(ska,"State");function wbr(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===oka){n4e.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!n4e.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!n4e.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(n4e.has(o)){n4e.delete(o);return}for(let s of n)s(o)}}a(wbr,"Hooks");wbr.prototype.add=function(t){t.init&&this.initFns.push(t.init),t.pre&&this.preFns.push(t.pre),t.post&&this.postFns.push(t.post),t.destroy&&this.destroyFns.push(t.destroy)};function U0t(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(U0t,"removeElement");wbr.prototype.remove=function(t){t.init&&U0t(this.initFns,t.init),t.pre&&U0t(this.preFns,t.pre),t.post&&U0t(this.postFns,t.post),t.destroy&&U0t(this.destroyFns,t.destroy)};function o4e(){this._state=new ska,this._hooks=new wbr,this.version=xbr().version,this.providers=i4e.Providers;for(let t of Object.keys(Awi))Awi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),i4e.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(o4e,"AsyncHook");ywi.exports=o4e;o4e.prototype.addHooks=function(t){this._hooks.add(t)};o4e.prototype.removeHooks=function(t){this._hooks.remove(t)};o4e.prototype.enable=function(){this._state.enabled=!0,i4e.enable()};o4e.prototype.disable=function(){this._state.enabled=!1,i4e.disable()}});var Rbr=I((Vxp,aka)=>{aka.exports={name:"stack-chain",description:"API for combining call site modifiers",version:"1.3.7",author:"Andreas Madsen ",scripts:{test:"tap ./test/simple"},repository:{type:"git",url:"git://github.com/AndreasMadsen/stack-chain.git"},keywords:["stack","chain","trace","call site","concat","format"],devDependencies:{tap:"2.x.x","uglify-js":"2.5.x"},license:"MIT"}});var vwi=I((Wxp,Ewi)=>{p();function cka(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(cka,"FormatErrorString");Ewi.exports=a(function(e,r){var n=[];n.push(cka(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` -`)},"FormatStackTrace")});var Twi=I((Kxp,Swi)=>{p();var Q0t=vwi();function bwi(){this.extend=new s4e,this.filter=new s4e,this.format=new a4e,this.version=Rbr().version}a(bwi,"stackChain");var Pbr=!1;bwi.prototype.callSite=a(function t(e){e||(e={}),Pbr=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return Pbr=!1,n=n.slice(e.slice||0),e.extend&&(n=this.extend._modify(r,n)),e.filter&&(n=this.filter._modify(r,n)),n},"collectCallSites");var u$=new bwi;function s4e(){this._modifiers=[]}a(s4e,"TraceModifier");s4e.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===Rbr().version)Dbr.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else Dbr.exports=global._stackChain=Twi()});var Iwi=I((twp,Mbr)=>{"use strict";p();var uka=_wi();if(global._asyncHook)if(global._asyncHook.version===xbr().version)Mbr.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else Nbr().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),Mbr.exports=global._asyncHook=new uka});var Dwi=I((nwp,Pwi)=>{"use strict";p();var xh=require("util"),T6=require("assert"),dka=F0t(),oAe=Iwi(),c4e="cls@contexts",l4e="error@context",wwi=[];for(let t in oAe.providers)wwi[oAe.providers[t]]=t;var Dp=process.env.DEBUG_CLS_HOOKED,Mm=-1;Pwi.exports={getNamespace:Rwi,createNamespace:fka,destroyNamespace:kwi,reset:pka,ERROR_SYMBOL:l4e};function $R(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a($R,"Namespace");$R.prototype.set=a(function(e,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return Dp&&Ih(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+Mm+" active:"+xh.inspect(this.active,!0)),this.active[e]=r,r},"set");$R.prototype.get=a(function(e){if(!this.active){Dp&&Ih(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+Mm+" active:"+xh.inspect(this.active,!0));return}return Dp&&Ih(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+Mm+" active:"+xh.inspect(this.active,!0)),this.active[e]},"get");$R.prototype.createContext=a(function(){Dp&&Ih(" CREATING Context: "+this.name+" uid:"+Mm+" len:"+this._set.length+" active:"+xh.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=Mm,Dp&&Ih(" CREATED Context: "+this.name+" uid:"+Mm+" len:"+this._set.length+" context:"+xh.inspect(e,!0,2,!0)),e},"createContext");$R.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return Dp&&Ih(" BEFORE RUN: "+this.name+" uid:"+Mm+" len:"+this._set.length+" "+xh.inspect(r)),e(r),r}catch(n){throw n&&(n[l4e]=r),n}finally{Dp&&Ih(" AFTER RUN: "+this.name+" uid:"+Mm+" len:"+this._set.length+" "+xh.inspect(r)),this.exit(r)}},"run");$R.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");$R.prototype.runPromise=a(function(e){let r=this.createContext();this.enter(r);let n=e(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return Dp&&Ih(" BEFORE runPromise: "+this.name+" uid:"+Mm+" len:"+this._set.length+" "+xh.inspect(r)),n.then(o=>(Dp&&Ih(" AFTER runPromise: "+this.name+" uid:"+Mm+" len:"+this._set.length+" "+xh.inspect(r)),this.exit(r),o)).catch(o=>{throw o[l4e]=r,Dp&&Ih(" AFTER runPromise: "+this.name+" uid:"+Mm+" len:"+this._set.length+" "+xh.inspect(r)),this.exit(r),o})},"runPromise");$R.prototype.bind=a(function(e,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return a(function(){n.enter(r);try{return e.apply(this,arguments)}catch(s){throw s&&(s[l4e]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");$R.prototype.enter=a(function(e){T6.ok(e,"context must be provided for entering"),Dp&&Ih(" ENTER "+this.name+" uid:"+Mm+" len:"+this._set.length+" context: "+xh.inspect(e)),this._set.push(this.active),this.active=e},"enter");$R.prototype.exit=a(function(e){if(T6.ok(e,"context must be provided for exiting"),Dp&&Ih(" EXIT "+this.name+" uid:"+Mm+" len:"+this._set.length+" context: "+xh.inspect(e)),this.active===e){T6.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(Dp&&Ih("??ERROR?? context exiting but not entered - ignoring: "+xh.inspect(e)),T6.ok(r>=0,`context not currently entered; can't exit. +`+jc.inspect(e))):(S6.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");GR.prototype.bindEmitter=a(function(e){S6.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[t4e]||(c[t4e]=Object.create(null)),c[t4e][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[t4e]))return c;let l=c,u=c[t4e];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),YRa(e,o,s)},"bindEmitter");GR.prototype.fromException=a(function(e){return e[r4e]},"fromException");function lwi(t){return process.namespaces[t]}a(lwi,"getNamespace");function KRa(t){S6.ok(t,"namespace must be given a name."),qf&&af(`NS-CREATING NAMESPACE (${t})`);let e=new GR(t);return e.id=qc,wd.createHook({init(n,o,s,c){if(qc=wd.executionAsyncId(),e.active){if(e._contexts.set(n,e.active),qf){let l=" ".repeat(e._indent<0?0:e._indent);af(`${l}INIT [${o}] (${t}) asyncId:${n} currentUid:${qc} triggerId:${s} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(qc===0){let l=wd.triggerAsyncId(),u=e._contexts.get(l);if(u){if(e._contexts.set(n,u),qf){let d=" ".repeat(e._indent<0?0:e._indent);af(`${d}INIT USING CONTEXT FROM TRIGGERID [${o}] (${t}) asyncId:${n} currentUid:${qc} triggerId:${l} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(qf){let d=" ".repeat(e._indent<0?0:e._indent);af(`${d}INIT MISSING CONTEXT [${o}] (${t}) asyncId:${n} currentUid:${qc} triggerId:${l} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}if(qf&&o==="PROMISE"){af(jc.inspect(c,{showHidden:!0}));let l=c.parentId,u=" ".repeat(e._indent<0?0:e._indent);af(`${u}INIT RESOURCE-PROMISE [${o}] (${t}) parentId:${l} asyncId:${n} currentUid:${qc} triggerId:${s} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}},before(n){qc=wd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(qc),o){if(qf){let s=wd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);af(`${c}BEFORE (${t}) asyncId:${n} currentUid:${qc} triggerId:${s} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${jc.inspect(o)}`),e._indent+=2}e.enter(o)}else if(qf){let s=wd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);af(`${c}BEFORE MISSING CONTEXT (${t}) asyncId:${n} currentUid:${qc} triggerId:${s} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${jc.inspect(e._contexts,{showHidden:!0,depth:2,colors:!0})}`),e._indent+=2}},after(n){qc=wd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(qc),o){if(qf){let s=wd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);af(`${c}AFTER (${t}) asyncId:${n} currentUid:${qc} triggerId:${s} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${jc.inspect(o)}`)}e.exit(o)}else if(qf){let s=wd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);af(`${c}AFTER MISSING CONTEXT (${t}) asyncId:${n} currentUid:${qc} triggerId:${s} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${jc.inspect(o)}`)}},destroy(n){if(qc=wd.executionAsyncId(),qf){let o=wd.triggerAsyncId(),s=" ".repeat(e._indent<0?0:e._indent);af(`${s}DESTROY (${t}) currentUid:${qc} asyncId:${n} triggerId:${o} active:${jc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${jc.inspect(e._contexts.get(qc))}`)}e._contexts.delete(n)}}).enable(),process.namespaces[t]=e,e}a(KRa,"createNamespace");function uwi(t){let e=lwi(t);S6.ok(e,`can't delete nonexistent namespace! "`+t+'"'),S6.ok(e.id,"don't assign to process.namespaces directly! "+jc.inspect(e)),process.namespaces[t]=null}a(uwi,"destroyNamespace");function JRa(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){uwi(t)}),process.namespaces=Object.create(null)}a(JRa,"reset");process.namespaces={};function af(...t){qf&&process._rawDebug(`${jc.format(...t)}`)}a(af,"debug2")});var hwi=I((Bxp,pwi)=>{"use strict";p();function ZRa(){}a(ZRa,"NextTickWrap");pwi.exports=a(function(){let e=this._hooks,r=this._state,n=process.nextTick;process.nextTick=function(){if(!r.enabled)return n.apply(process,arguments);let o=new Array(arguments.length);for(let u=0;u0&&process.once("uncaughtException",function(){e.post.call(c,l,!0),e.destroy.call(null,l)})}e.post.call(c,l,!1),e.destroy.call(null,l)},n.apply(process,o)}},"patch")});var gwi=I((Qxp,mwi)=>{"use strict";p();function XRa(){}a(XRa,"PromiseWrap");mwi.exports=a(function(){let e=this._hooks,r=this._state,n=global.Promise,o=n.prototype.then;n.prototype.then=u;function s(d,f,h,m){return typeof d!="function"?m?c(h):l(h):a(function(){e.pre.call(f,h);try{return d.apply(this,arguments)}finally{e.post.call(f,h,!1),e.destroy.call(null,h)}},"wrappedHandler")}a(s,"makeWrappedHandler");function c(d){return a(function(h){return e.destroy.call(null,d),h},"unhandledResolutionHandler")}a(c,"makeUnhandledResolutionHandler");function l(d){return a(function(h){throw e.destroy.call(null,d),h},"unhandledRejectedHandler")}a(l,"makeUnhandledRejectionHandler");function u(d,f){if(!r.enabled)return o.call(this,d,f);let h=new XRa,m=--r.counter;return e.init.call(h,m,0,null,null),o.call(this,s(d,h,m,!0),s(f,h,m,!1))}a(u,"wrappedThen")},"patchPromise")});var ywi=I((Hxp,Awi)=>{"use strict";p();var _I=require("timers");function eka(){}a(eka,"TimeoutWrap");function tka(){}a(tka,"IntervalWrap");function rka(){}a(rka,"ImmediateWrap");var nka=new Map,ika=new Map,oka=new Map,Tbr=null,Ibr=!1;Awi.exports=a(function(){xbr(this._hooks,this._state,"setTimeout","clearTimeout",eka,nka,!0),xbr(this._hooks,this._state,"setInterval","clearInterval",tka,ika,!1),xbr(this._hooks,this._state,"setImmediate","clearImmediate",rka,oka,!0),global.setTimeout=_I.setTimeout,global.setInterval=_I.setInterval,global.setImmediate=_I.setImmediate,global.clearTimeout=_I.clearTimeout,global.clearInterval=_I.clearInterval,global.clearImmediate=_I.clearImmediate},"patch");function xbr(t,e,r,n,o,s,c){let l=_I[r],u=_I[n];_I[r]=function(){if(!e.enabled)return l.apply(_I,arguments);let d=new Array(arguments.length);for(let A=0;A0&&process.once("uncaughtException",function(){t.post.call(h,m,!0),s.delete(g),t.destroy.call(null,m)})}t.post.call(h,m,!1),Tbr=null,(c||Ibr)&&(Ibr=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(_I,d),s.set(g,m),g},_I[n]=function(d){if(Tbr===d&&d!==null)Ibr=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(_I,arguments)}}a(xbr,"patchTimer")});var wbr=I((Vxp,ska)=>{ska.exports={name:"async-hook-jl",description:"Inspect the life of handle objects in node",version:"1.7.6",author:"Andreas Madsen ",main:"./index.js",scripts:{test:"node ./test/runner.js && eslint ."},repository:{type:"git",url:"git://github.com/jeff-lewis/async-hook-jl.git"},keywords:["async","async hooks","inspect","async wrap"],license:"MIT",dependencies:{"stack-chain":"^1.3.7"},devDependencies:{async:"1.5.x","cli-color":"1.1.x",eslint:"^3.4.0",endpoint:"0.4.x"},engines:{node:"^4.7 || >=6.9 || >=7.3"}}});var vwi=I((Wxp,Ewi)=>{"use strict";p();var i4e=process.binding("async_wrap"),aka=i4e.Providers.TIMERWRAP,_wi={nextTick:hwi(),promise:gwi(),timers:ywi()},n4e=new Set;function cka(){this.enabled=!1,this.counter=0}a(cka,"State");function Rbr(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===aka){n4e.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!n4e.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!n4e.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(n4e.has(o)){n4e.delete(o);return}for(let s of n)s(o)}}a(Rbr,"Hooks");Rbr.prototype.add=function(t){t.init&&this.initFns.push(t.init),t.pre&&this.preFns.push(t.pre),t.post&&this.postFns.push(t.post),t.destroy&&this.destroyFns.push(t.destroy)};function Q0t(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(Q0t,"removeElement");Rbr.prototype.remove=function(t){t.init&&Q0t(this.initFns,t.init),t.pre&&Q0t(this.preFns,t.pre),t.post&&Q0t(this.postFns,t.post),t.destroy&&Q0t(this.destroyFns,t.destroy)};function o4e(){this._state=new cka,this._hooks=new Rbr,this.version=wbr().version,this.providers=i4e.Providers;for(let t of Object.keys(_wi))_wi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),i4e.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(o4e,"AsyncHook");Ewi.exports=o4e;o4e.prototype.addHooks=function(t){this._hooks.add(t)};o4e.prototype.removeHooks=function(t){this._hooks.remove(t)};o4e.prototype.enable=function(){this._state.enabled=!0,i4e.enable()};o4e.prototype.disable=function(){this._state.enabled=!1,i4e.disable()}});var kbr=I((Kxp,lka)=>{lka.exports={name:"stack-chain",description:"API for combining call site modifiers",version:"1.3.7",author:"Andreas Madsen ",scripts:{test:"tap ./test/simple"},repository:{type:"git",url:"git://github.com/AndreasMadsen/stack-chain.git"},keywords:["stack","chain","trace","call site","concat","format"],devDependencies:{tap:"2.x.x","uglify-js":"2.5.x"},license:"MIT"}});var bwi=I((Jxp,Cwi)=>{p();function uka(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(uka,"FormatErrorString");Cwi.exports=a(function(e,r){var n=[];n.push(uka(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` +`)},"FormatStackTrace")});var xwi=I((ewp,Iwi)=>{p();var q0t=bwi();function Twi(){this.extend=new s4e,this.filter=new s4e,this.format=new a4e,this.version=kbr().version}a(Twi,"stackChain");var Dbr=!1;Twi.prototype.callSite=a(function t(e){e||(e={}),Dbr=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return Dbr=!1,n=n.slice(e.slice||0),e.extend&&(n=this.extend._modify(r,n)),e.filter&&(n=this.filter._modify(r,n)),n},"collectCallSites");var d$=new Twi;function s4e(){this._modifiers=[]}a(s4e,"TraceModifier");s4e.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===kbr().version)Nbr.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else Nbr.exports=global._stackChain=xwi()});var wwi=I((owp,Obr)=>{"use strict";p();var fka=vwi();if(global._asyncHook)if(global._asyncHook.version===wbr().version)Obr.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else Mbr().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),Obr.exports=global._asyncHook=new fka});var Mwi=I((awp,Nwi)=>{"use strict";p();var xh=require("util"),T6=require("assert"),pka=U0t(),oAe=wwi(),c4e="cls@contexts",l4e="error@context",kwi=[];for(let t in oAe.providers)kwi[oAe.providers[t]]=t;var Dp=process.env.DEBUG_CLS_HOOKED,Om=-1;Nwi.exports={getNamespace:Pwi,createNamespace:hka,destroyNamespace:Dwi,reset:mka,ERROR_SYMBOL:l4e};function $R(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a($R,"Namespace");$R.prototype.set=a(function(e,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return Dp&&Ih(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+Om+" active:"+xh.inspect(this.active,!0)),this.active[e]=r,r},"set");$R.prototype.get=a(function(e){if(!this.active){Dp&&Ih(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+Om+" active:"+xh.inspect(this.active,!0));return}return Dp&&Ih(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+Om+" active:"+xh.inspect(this.active,!0)),this.active[e]},"get");$R.prototype.createContext=a(function(){Dp&&Ih(" CREATING Context: "+this.name+" uid:"+Om+" len:"+this._set.length+" active:"+xh.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=Om,Dp&&Ih(" CREATED Context: "+this.name+" uid:"+Om+" len:"+this._set.length+" context:"+xh.inspect(e,!0,2,!0)),e},"createContext");$R.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return Dp&&Ih(" BEFORE RUN: "+this.name+" uid:"+Om+" len:"+this._set.length+" "+xh.inspect(r)),e(r),r}catch(n){throw n&&(n[l4e]=r),n}finally{Dp&&Ih(" AFTER RUN: "+this.name+" uid:"+Om+" len:"+this._set.length+" "+xh.inspect(r)),this.exit(r)}},"run");$R.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");$R.prototype.runPromise=a(function(e){let r=this.createContext();this.enter(r);let n=e(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return Dp&&Ih(" BEFORE runPromise: "+this.name+" uid:"+Om+" len:"+this._set.length+" "+xh.inspect(r)),n.then(o=>(Dp&&Ih(" AFTER runPromise: "+this.name+" uid:"+Om+" len:"+this._set.length+" "+xh.inspect(r)),this.exit(r),o)).catch(o=>{throw o[l4e]=r,Dp&&Ih(" AFTER runPromise: "+this.name+" uid:"+Om+" len:"+this._set.length+" "+xh.inspect(r)),this.exit(r),o})},"runPromise");$R.prototype.bind=a(function(e,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return a(function(){n.enter(r);try{return e.apply(this,arguments)}catch(s){throw s&&(s[l4e]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");$R.prototype.enter=a(function(e){T6.ok(e,"context must be provided for entering"),Dp&&Ih(" ENTER "+this.name+" uid:"+Om+" len:"+this._set.length+" context: "+xh.inspect(e)),this._set.push(this.active),this.active=e},"enter");$R.prototype.exit=a(function(e){if(T6.ok(e,"context must be provided for exiting"),Dp&&Ih(" EXIT "+this.name+" uid:"+Om+" len:"+this._set.length+" context: "+xh.inspect(e)),this.active===e){T6.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(Dp&&Ih("??ERROR?? context exiting but not entered - ignoring: "+xh.inspect(e)),T6.ok(r>=0,`context not currently entered; can't exit. `+xh.inspect(this)+` -`+xh.inspect(e))):(T6.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");$R.prototype.bindEmitter=a(function(e){T6.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[c4e]||(c[c4e]=Object.create(null)),c[c4e][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[c4e]))return c;let l=c,u=c[c4e];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),dka(e,o,s)},"bindEmitter");$R.prototype.fromException=a(function(e){return e[l4e]},"fromException");function Rwi(t){return process.namespaces[t]}a(Rwi,"getNamespace");function fka(t){T6.ok(t,"namespace must be given a name."),Dp&&Ih("CREATING NAMESPACE "+t);let e=new $R(t);return e.id=Mm,oAe.addHooks({init(r,n,o,s,c){Mm=r,s?(e._contexts.set(r,e._contexts.get(s)),Dp&&Ih("PARENTID: "+t+" uid:"+r+" parent:"+s+" provider:"+o)):e._contexts.set(Mm,e.active),Dp&&Ih("INIT "+t+" uid:"+r+" parent:"+s+" provider:"+wwi[o]+" active:"+xh.inspect(e.active,!0))},pre(r,n){Mm=r;let o=e._contexts.get(r);o?(Dp&&Ih(" PRE "+t+" uid:"+r+" handle:"+q0t(n)+" context:"+xh.inspect(o)),e.enter(o)):Dp&&Ih(" PRE MISSING CONTEXT "+t+" uid:"+r+" handle:"+q0t(n))},post(r,n){Mm=r;let o=e._contexts.get(r);o?(Dp&&Ih(" POST "+t+" uid:"+r+" handle:"+q0t(n)+" context:"+xh.inspect(o)),e.exit(o)):Dp&&Ih(" POST MISSING CONTEXT "+t+" uid:"+r+" handle:"+q0t(n))},destroy(r){Mm=r,Dp&&Ih("DESTROY "+t+" uid:"+r+" context:"+xh.inspect(e._contexts.get(Mm))+" active:"+xh.inspect(e.active,!0)),e._contexts.delete(r)}}),process.namespaces[t]=e,e}a(fka,"createNamespace");function kwi(t){let e=Rwi(t);T6.ok(e,`can't delete nonexistent namespace! "`+t+'"'),T6.ok(e.id,"don't assign to process.namespaces directly! "+xh.inspect(e)),process.namespaces[t]=null}a(kwi,"destroyNamespace");function pka(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){kwi(t)}),process.namespaces=Object.create(null)}a(pka,"reset");process.namespaces={};oAe._state&&!oAe._state.enabled&&oAe.enable();function Ih(t){process.env.DEBUG&&process._rawDebug(t)}a(Ih,"debug2");function q0t(t){if(!t)return t;if(typeof t=="function")return t.name?t.name:(t.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1];if(t.constructor&&t.constructor.name)return t.constructor.name}a(q0t,"getFunctionName");if(Dp){Obr=Nbr();for(xwi in Obr.filter._modifiers)Obr.filter.deattach(xwi)}var Obr,xwi});var Nwi=I((swp,Lbr)=>{"use strict";p();var hka=rwi();process&&hka.gte(process.versions.node,"8.0.0")?Lbr.exports=uwi():Lbr.exports=Dwi()});var Kwi=I((vo,Ywi)=>{p();vo=Ywi.exports=qa;var bl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?bl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):bl=a(function(){},"debug");vo.SEMVER_SPEC_VERSION="2.0.0";var u4e=256,j0t=Number.MAX_SAFE_INTEGER||9007199254740991,Bbr=16,mka=u4e-6,d4e=vo.re=[],ju=vo.safeRe=[],or=vo.src=[],Sa=0,jbr="[a-zA-Z0-9-]",Fbr=[["\\s",1],["\\d",u4e],[jbr,mka]];function z0t(t){for(var e=0;e)?=?)";var H0t=Sa++;or[H0t]=or[aAe]+"|x|X|\\*";var G0t=Sa++;or[G0t]=or[sAe]+"|x|X|\\*";var Ute=Sa++;or[Ute]="[v=\\s]*("+or[G0t]+")(?:\\.("+or[G0t]+")(?:\\.("+or[G0t]+")(?:"+or[Gbr]+")?"+or[p4e]+"?)?)?";var lAe=Sa++;or[lAe]="[v=\\s]*("+or[H0t]+")(?:\\.("+or[H0t]+")(?:\\.("+or[H0t]+")(?:"+or[$br]+")?"+or[p4e]+"?)?)?";var Fwi=Sa++;or[Fwi]="^"+or[fAe]+"\\s*"+or[Ute]+"$";var Uwi=Sa++;or[Uwi]="^"+or[fAe]+"\\s*"+or[lAe]+"$";var Qwi=Sa++;or[Qwi]="(?:^|[^\\d])(\\d{1,"+Bbr+"})(?:\\.(\\d{1,"+Bbr+"}))?(?:\\.(\\d{1,"+Bbr+"}))?(?:$|[^\\d])";var Y0t=Sa++;or[Y0t]="(?:~>?)";var uAe=Sa++;or[uAe]="(\\s*)"+or[Y0t]+"\\s+";d4e[uAe]=new RegExp(or[uAe],"g");ju[uAe]=new RegExp(z0t(or[uAe]),"g");var gka="$1~",qwi=Sa++;or[qwi]="^"+or[Y0t]+or[Ute]+"$";var jwi=Sa++;or[jwi]="^"+or[Y0t]+or[lAe]+"$";var K0t=Sa++;or[K0t]="(?:\\^)";var dAe=Sa++;or[dAe]="(\\s*)"+or[K0t]+"\\s+";d4e[dAe]=new RegExp(or[dAe],"g");ju[dAe]=new RegExp(z0t(or[dAe]),"g");var Aka="$1^",Hwi=Sa++;or[Hwi]="^"+or[K0t]+or[Ute]+"$";var Gwi=Sa++;or[Gwi]="^"+or[K0t]+or[lAe]+"$";var Ybr=Sa++;or[Ybr]="^"+or[fAe]+"\\s*("+Wbr+")$|^$";var Kbr=Sa++;or[Kbr]="^"+or[fAe]+"\\s*("+Bwi+")$|^$";var Qte=Sa++;or[Qte]="(\\s*)"+or[fAe]+"\\s*("+Wbr+"|"+or[Ute]+")";d4e[Qte]=new RegExp(or[Qte],"g");ju[Qte]=new RegExp(z0t(or[Qte]),"g");var yka="$1$2$3",$wi=Sa++;or[$wi]="^\\s*("+or[Ute]+")\\s+-\\s+("+or[Ute]+")\\s*$";var Vwi=Sa++;or[Vwi]="^\\s*("+or[lAe]+")\\s+-\\s+("+or[lAe]+")\\s*$";var Wwi=Sa++;or[Wwi]="(<|>)?=?\\s*\\*";for(uL=0;uLu4e)return null;var r=e.loose?ju[zbr]:ju[Vbr];if(!r.test(t))return null;try{return new qa(t,e)}catch{return null}}a(qte,"parse");vo.valid=_ka;function _ka(t,e){var r=qte(t,e);return r?r.version:null}a(_ka,"valid");vo.clean=Eka;function Eka(t,e){var r=qte(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(Eka,"clean");vo.SemVer=qa;function qa(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof qa){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>u4e)throw new TypeError("version is longer than "+u4e+" characters");if(!(this instanceof qa))return new qa(t,e);bl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?ju[zbr]:ju[Vbr]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>j0t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>j0t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>j0t||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var o=+n;if(o>=0&&o=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};vo.inc=vka;function vka(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new qa(t,r).inc(e,n).version}catch{return null}}a(vka,"inc");vo.diff=Cka;function Cka(t,e){if(Jbr(t,e))return null;var r=qte(t),n=qte(e),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var s="prerelease"}for(var c in r)if((c==="major"||c==="minor"||c==="patch")&&r[c]!==n[c])return o+c;return s}a(Cka,"diff");vo.compareIdentifiers=cAe;var Mwi=/^[0-9]+$/;function cAe(t,e){var r=Mwi.test(t),n=Mwi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(f4e,"gt");vo.lt=$0t;function $0t(t,e,r){return I6(t,e,r)<0}a($0t,"lt");vo.eq=Jbr;function Jbr(t,e,r){return I6(t,e,r)===0}a(Jbr,"eq");vo.neq=zwi;function zwi(t,e,r){return I6(t,e,r)!==0}a(zwi,"neq");vo.gte=Zbr;function Zbr(t,e,r){return I6(t,e,r)>=0}a(Zbr,"gte");vo.lte=Xbr;function Xbr(t,e,r){return I6(t,e,r)<=0}a(Xbr,"lte");vo.cmp=V0t;function V0t(t,e,r,n){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Jbr(t,r,n);case"!=":return zwi(t,r,n);case">":return f4e(t,r,n);case">=":return Zbr(t,r,n);case"<":return $0t(t,r,n);case"<=":return Xbr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(V0t,"cmp");vo.Comparator=VR;function VR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof VR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof VR))return new VR(t,e);t=t.trim().split(/\s+/).join(" "),bl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===h4e?this.value="":this.value=this.operator+this.semver.version,bl("comp",this)}a(VR,"Comparator");var h4e={};VR.prototype.parse=function(t){var e=this.options.loose?ju[Ybr]:ju[Kbr],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new qa(r[2],this.options.loose):this.semver=h4e};VR.prototype.toString=function(){return this.value};VR.prototype.test=function(t){return bl("Comparator.test",t,this.options.loose),this.semver===h4e?!0:(typeof t=="string"&&(t=new qa(t,this.options)),V0t(t,this.operator,this.semver,this.options))};VR.prototype.intersects=function(t,e){if(!(t instanceof VR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new jf(t.value,e),W0t(this.value,r,e);if(t.operator==="")return r=new jf(this.value,e),W0t(t.semver,r,e);var n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),l=V0t(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=V0t(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};vo.Range=jf;function jf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof jf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new jf(t.raw,e);if(t instanceof VR)return new jf(t.value,e);if(!(this instanceof jf))return new jf(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}a(jf,"Range");jf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};jf.prototype.toString=function(){return this.range};jf.prototype.parseRange=function(t){var e=this.options.loose,r=e?ju[Vwi]:ju[$wi];t=t.replace(r,Qka),bl("hyphen replace",t),t=t.replace(ju[Qte],yka),bl("comparator trim",t,ju[Qte]),t=t.replace(ju[uAe],gka),t=t.replace(ju[dAe],Aka);var n=e?ju[Ybr]:ju[Kbr],o=t.split(" ").map(function(s){return Dka(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter(function(s){return!!s.match(n)})),o=o.map(function(s){return new VR(s,this.options)},this),o};jf.prototype.intersects=function(t,e){if(!(t instanceof jf))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return t.set.some(function(o){return o.every(function(s){return n.intersects(s,e)})})})})};vo.toComparators=Pka;function Pka(t,e){return new jf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(Pka,"toComparators");function Dka(t,e){return bl("comp",t,e),t=Oka(t,e),bl("caret",t),t=Nka(t,e),bl("tildes",t),t=Bka(t,e),bl("xrange",t),t=Uka(t,e),bl("stars",t),t}a(Dka,"parseComparator");function Hv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(Hv,"isX");function Nka(t,e){return t.trim().split(/\s+/).map(function(r){return Mka(r,e)}).join(" ")}a(Nka,"replaceTildes");function Mka(t,e){var r=e.loose?ju[jwi]:ju[qwi];return t.replace(r,function(n,o,s,c,l){bl("tilde",t,n,o,s,c,l);var u;return Hv(o)?u="":Hv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Hv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(bl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",bl("tilde return",u),u})}a(Mka,"replaceTilde");function Oka(t,e){return t.trim().split(/\s+/).map(function(r){return Lka(r,e)}).join(" ")}a(Oka,"replaceCarets");function Lka(t,e){bl("caret",t,e);var r=e.loose?ju[Gwi]:ju[Hwi];return t.replace(r,function(n,o,s,c,l){bl("caret",t,n,o,s,c,l);var u;return Hv(o)?u="":Hv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Hv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(bl("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(bl("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),bl("caret return",u),u})}a(Lka,"replaceCaret");function Bka(t,e){return bl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return Fka(r,e)}).join(" ")}a(Bka,"replaceXRanges");function Fka(t,e){t=t.trim();var r=e.loose?ju[Uwi]:ju[Fwi];return t.replace(r,function(n,o,s,c,l,u){bl("xRange",t,n,o,s,c,l,u);var d=Hv(s),f=d||Hv(c),h=f||Hv(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),bl("xRange return",n),n})}a(Fka,"replaceXRange");function Uka(t,e){return bl("replaceStars",t,e),t.trim().replace(ju[Wwi],"")}a(Uka,"replaceStars");function Qka(t,e,r,n,o,s,c,l,u,d,f,h,m){return Hv(r)?e="":Hv(n)?e=">="+r+".0.0":Hv(o)?e=">="+r+"."+n+".0":e=">="+e,Hv(u)?l="":Hv(d)?l="<"+(+u+1)+".0.0":Hv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(Qka,"hyphenReplace");jf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new qa(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(qka,"testSet");vo.satisfies=W0t;function W0t(t,e,r){try{e=new jf(e,r)}catch{return!1}return e.test(t)}a(W0t,"satisfies");vo.maxSatisfying=jka;function jka(t,e,r){var n=null,o=null;try{var s=new jf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new qa(n,r))}),n}a(jka,"maxSatisfying");vo.minSatisfying=Hka;function Hka(t,e,r){var n=null,o=null;try{var s=new jf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new qa(n,r))}),n}a(Hka,"minSatisfying");vo.minVersion=Gka;function Gka(t,e){t=new jf(t,e);var r=new qa("0.0.0");if(t.test(r)||(r=new qa("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||f4e(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(Gka,"minVersion");vo.validRange=$ka;function $ka(t,e){try{return new jf(t,e).range||"*"}catch{return null}}a($ka,"validRange");vo.ltr=Vka;function Vka(t,e,r){return eSr(t,e,"<",r)}a(Vka,"ltr");vo.gtr=Wka;function Wka(t,e,r){return eSr(t,e,">",r)}a(Wka,"gtr");vo.outside=eSr;function eSr(t,e,r,n){t=new qa(t,n),e=new jf(e,n);var o,s,c,l,u;switch(r){case">":o=f4e,s=Xbr,c=$0t,l=">",u=">=";break;case"<":o=$0t,s=Zbr,c=f4e,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(W0t(t,e,n))return!1;for(var d=0;d=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0}a(eSr,"outside");vo.prerelease=zka;function zka(t,e){var r=qte(t,e);return r&&r.prerelease.length?r.prerelease:null}a(zka,"prerelease");vo.intersects=Yka;function Yka(t,e,r){return t=new jf(t,r),e=new jf(e,r),t.intersects(e)}a(Yka,"intersects");vo.coerce=Kka;function Kka(t){if(t instanceof qa)return t;if(typeof t!="string")return null;var e=t.match(ju[Qwi]);return e==null?null:qte(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(Kka,"coerce")});var Xwi=I((uwp,Zwi)=>{p();var Jka=L0e().wrap,rSr=1,nSr=2,iSr=4,Z0t=8,uu=[],Zka=0,X_=!1,d$=[],pAe,oSr;function sSr(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(uu=d$.pop()),hAe=void 0,n&&!X_},"asyncCatcher"),oSr=a(function(e,r,n){var o=[];X_=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);X_=!1;var d=e.apply(this,arguments);for(X_=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return X_=!1,uu=d$.pop(),hAe=void 0,d}},"asyncWrap"),Jka(process,"_fatalException",function(t){return a(function(r){return pAe(r)||t(r)},"_asyncFatalException")})):(tSr=!1,pAe=a(function(e){if(tSr)throw e;for(var r=!1,n=uu.length,o=0;o0&&r[f].before(this,o[r[f].uid]);X_=!1;var h;try{h=e.apply(this,arguments)}catch(m){u=!0;for(var f=0;f0&&r[f].after(this,o[r[f].uid]);X_=!1}uu=d$.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",pAe));var J0t,hAe,tSr;function Xka(t,e,r){X_=!0;for(var n=0;n0)return oSr(t,r,e);return Xka(t,r,e)}a(ePa,"wrapCallback");function dL(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=rSr),typeof t.before=="function"&&(this.before=t.before,this.flags|=nSr),typeof t.after=="function"&&(this.after=t.after,this.flags|=iSr),typeof t.error=="function"&&(this.error=t.error,this.flags|=Z0t),this.uid=++Zka,this.data=e===void 0?null:e}a(dL,"AsyncListener");dL.prototype.create=void 0;dL.prototype.before=void 0;dL.prototype.after=void 0;dL.prototype.error=void 0;dL.prototype.data=void 0;dL.prototype.uid=0;dL.prototype.flags=0;function Jwi(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof dL?t:new dL(t,e)}a(Jwi,"createAsyncListener");function tPa(t,e){var r;t instanceof dL?r=t:r=Jwi(t,e);for(var n=!1,o=0;o{"use strict";p();eRi.exports=(t,e)=>class extends t{static{a(this,"WrappedPromise")}constructor(n){var o,s;super(l);var c=this;try{n.apply(o,s)}catch(u){s[1](u)}return c;function l(u,d){o=this,s=[f,h];function f(m){return e(c,!1),u(m)}a(f,"wrappedResolve");function h(m){return e(c,!1),d(m)}a(h,"wrappedReject")}}}});var cRi=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var oRi=L0e(),eAt=Kwi(),pS=oRi.wrap,f$=oRi.massWrap,Hf=Xwi(),nPa=require("util"),iPa=eAt.gte(process.version,"6.0.0"),lSr=eAt.gte(process.version,"7.0.0"),oPa=eAt.gte(process.version,"8.0.0"),sPa=eAt.gte(process.version,"11.0.0"),fL=require("net");lSr&&!fL._normalizeArgs?fL._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:dPa(e)?r.path=e:(r.port=e,t.length>1&&typeof t[1]=="string"&&(r.host=t[1]));var n=t[t.length-1];return typeof n!="function"?[r,null]:[r,n]}:!lSr&&!fL._normalizeConnectArgs&&(fL._normalizeConnectArgs=function(t){var e={};function r(o){return(o=Number(o))>=0?o:!1}a(r,"toNumber"),typeof t[0]=="object"&&t[0]!==null?e=t[0]:typeof t[0]=="string"&&r(t[0])===!1?e.path=t[0]:(e.port=t[0],typeof t[1]=="string"&&(e.host=t[1]));var n=t[t.length-1];return typeof n=="function"?[e,n]:[e]});"_setUpListenHandle"in fL.Server.prototype?pS(fL.Server.prototype,"_setUpListenHandle",rRi):pS(fL.Server.prototype,"_listen2",rRi);function rRi(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=Hf(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=Hf(this._handle.onconnection))}}}a(rRi,"wrapSetUpListenHandle");function sRi(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=Hf(e._originalOnread)}}a(sRi,"patchOnRead");pS(fL.Socket.prototype,"connect",function(t){return function(){var e;oPa&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=lSr?fL._normalizeArgs(arguments):fL._normalizeConnectArgs(arguments),e[1]&&(e[1]=Hf(e[1]));var r=t.apply(this,e);return sRi(this),r}});var aPa=require("http");pS(aPa.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=Hf(function(n){return sRi(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var aSr=require("child_process");function nRi(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=Hf(e._handle.onread),pS(e._handle,"close",tAt))}),t._handle&&(t._handle.onexit=Hf(t._handle.onexit))}a(nRi,"wrapChildProcess");aSr.ChildProcess?pS(aSr.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return nRi(this),e}}):f$(aSr,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return nRi(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var fSr=[];process._nextDomainTick&&fSr.push("_nextDomainTick");process._tickDomainCallback&&fSr.push("_tickDomainCallback");f$(process,fSr,pL);pS(process,"nextTick",tAt);var pSr=["setTimeout","setInterval"];global.setImmediate&&pSr.push("setImmediate");var aRi=require("timers"),cPa=global.setTimeout===aRi.setTimeout;f$(aRi,pSr,tAt);cPa&&f$(global,pSr,tAt);var uSr=require("dns");f$(uSr,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],pL);uSr.resolveNaptr&&pS(uSr,"resolveNaptr",pL);var Hte=require("fs");f$(Hte,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],pL);Hte.lchown&&pS(Hte,"lchown",pL);Hte.lchmod&&pS(Hte,"lchmod",pL);Hte.ftruncate&&pS(Hte,"ftruncate",pL);var m4e;try{m4e=require("zlib")}catch{}m4e&&m4e.Deflate&&m4e.Deflate.prototype&&(jte=Object.getPrototypeOf(m4e.Deflate.prototype),jte._transform?pS(jte,"_transform",pL):jte.write&&jte.flush&&jte.end&&f$(jte,["write","flush","end"],pL));var jte,dSr;try{dSr=require("crypto")}catch{}dSr&&(cSr=["pbkdf2","randomBytes"],sPa||cSr.push("pseudoRandomBytes"),f$(dSr,cSr,pL));var cSr,X0t=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";X0t&&(iRi=process.addAsyncListener({create:a(function(){X0t=!1},"create")}),global.Promise.resolve(!0).then(a(function(){X0t=!1},"notSync")),process.removeAsyncListener(iRi));var iRi;X0t&&lPa();function lPa(){var t=global.Promise;function e(c){if(!(this instanceof e))return t(c);if(typeof c!="function")return new t(c);var l,u,d=new t(f);d.__proto__=e.prototype;try{c.apply(l,u)}catch(h){u[1](h)}return d;function f(h,m){l=this,u=[g,A];function g(y){return n(d,!1),h(y)}a(g,"wrappedResolve");function A(y){return n(d,!1),m(y)}a(A,"wrappedReject")}}if(a(e,"wrappedPromise"),nPa.inherits(e,t),pS(t.prototype,"then",s),t.prototype.chain&&pS(t.prototype,"chain",s),iPa)global.Promise=tRi()(t,n);else{var r=["all","race","reject","resolve","accept","defer"];r.forEach(function(c){typeof t[c]=="function"&&(e[c]=t[c])}),global.Promise=e}function n(c,l){(!c.__asl_wrapper||l)&&(c.__asl_wrapper=Hf(o))}a(n,"ensureAslWrapper");function o(c,l,u,d){var f;try{return f=l.call(c,u),{returnVal:f,error:!1}}catch(h){return{errorVal:h,error:!0}}finally{f instanceof t?d.__asl_wrapper=a(function(){var m=f.__asl_wrapper||o;return m.apply(this,arguments)},"proxyWrapper"):n(d,!0)}}a(o,"propagateAslWrapper");function s(c){return a(function(){var u=this,d=c.apply(u,Array.prototype.map.call(arguments,f));return d.__asl_wrapper=a(function(m,g,A,y){return u.__asl_wrapper?(u.__asl_wrapper(m,function(){},null,d),d.__asl_wrapper(m,g,A,y)):o(m,g,A,y)},"proxyWrapper"),d;function f(h){return typeof h!="function"?h:Hf(function(m){var g=(u.__asl_wrapper||o)(this,h,m,d);if(g.error)throw g.errorVal;return g.returnVal})}a(f,"bind")},"wrappedThen")}a(s,"wrapThen")}a(lPa,"wrapPromise");function pL(t){var e=a(function(){var r,n=arguments.length-1;if(typeof arguments[n]=="function"){r=Array(arguments.length);for(var o=0;o=0?t:!1}a(uPa,"toNumber");function dPa(t){return typeof t=="string"&&uPa(t)===!1}a(dPa,"isPipeName")});var pRi=I((vwp,fRi)=>{"use strict";p();var x6=require("assert"),fPa=F0t(),g4e="cls@contexts",hSr="error@context";process.addAsyncListener||cRi();function OD(t){this.name=t,this.active=null,this._set=[],this.id=null}a(OD,"Namespace");OD.prototype.set=function(t,e){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[t]=e,e};OD.prototype.get=function(t){if(this.active)return this.active[t]};OD.prototype.createContext=function(){return Object.create(this.active)};OD.prototype.run=function(t){var e=this.createContext();this.enter(e);try{return t(e),e}catch(r){throw r&&(r[hSr]=e),r}finally{this.exit(e)}};OD.prototype.runAndReturn=function(t){var e;return this.run(function(r){e=t(r)}),e};OD.prototype.bind=function(t,e){e||(this.active?e=this.active:e=this.createContext());var r=this;return function(){r.enter(e);try{return t.apply(this,arguments)}catch(n){throw n&&(n[hSr]=e),n}finally{r.exit(e)}}};OD.prototype.enter=function(t){x6.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};OD.prototype.exit=function(t){if(x6.ok(t,"context must be provided for exiting"),this.active===t){x6.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);x6.ok(e>=0,"context not currently entered; can't exit"),x6.ok(e,"can't remove top context"),this._set.splice(e,1)};OD.prototype.bindEmitter=function(t){x6.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[g4e]||(s[g4e]=Object.create(null)),s[g4e][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[g4e]))return s;var c=s,l=s[g4e];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),fPa(t,n,o)};OD.prototype.fromException=function(t){return t[hSr]};function lRi(t){return process.namespaces[t]}a(lRi,"get");function pPa(t){x6.ok(t,"namespace must be given a name!");var e=new OD(t);return e.id=process.addAsyncListener({create:a(function(){return e.active},"create"),before:a(function(r,n){n&&e.enter(n)},"before"),after:a(function(r,n){n&&e.exit(n)},"after"),error:a(function(r){r&&e.exit(r)},"error")}),process.namespaces[t]=e,e}a(pPa,"create");function uRi(t){var e=lRi(t);x6.ok(e,"can't delete nonexistent namespace!"),x6.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a(uRi,"destroy");function dRi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){uRi(t)}),process.namespaces=Object.create(null)}a(dRi,"reset");process.namespaces||dRi();fRi.exports={getNamespace:lRi,createNamespace:pPa,destroyNamespace:uRi,reset:dRi}});var h$=I(hL=>{"use strict";p();var hPa=hL&&hL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mPa=hL&&hL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gPa=hL&&hL.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&hPa(e,t,r);return mPa(e,t),e};Object.defineProperty(hL,"__esModule",{value:!0});hL.CorrelationContextManager=void 0;var p$=lu(),APa=gPa(C0t()),Gte=b0t(),mSr=UCr(),hRi=obr(),mAe=Cy(),yPa=(function(){function t(){}return a(t,"CorrelationContextManager"),t.getCurrentContext=function(){if(!t.enabled)return null;var e=t.session.get(t.CONTEXT_NAME);return e===void 0?null:e},t.generateContextObject=function(e,r,n,o,s,c){return r=r||e,this.enabled?{operation:{name:n,id:e,parentId:r,traceparent:s,tracestate:c},customProperties:new _Pa(o)}:null},t.spanToContextObject=function(e,r,n){var o=new Gte;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=Gte.formatOpenTelemetryTraceFlags(e.traceFlags)||Gte.DEFAULT_TRACE_FLAG,o.parentId=r,t.generateContextObject(o.traceId,o.parentId,n,null,o)},t.runWithContext=function(e,r){var n;if(t.enabled)try{return t.session.bind(r,(n={},n[t.CONTEXT_NAME]=e,n))()}catch(o){p$.warn("Error binding to session context",mAe.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){p$.warn("Error binding to session context",mAe.dumpObj(r))}},t.wrapCallback=function(e,r){var n;if(t.enabled)try{return t.session.bind(e,r?(n={},n[t.CONTEXT_NAME]=r,n):void 0)}catch(o){p$.warn("Error binding to session context",mAe.dumpObj(o))}return e},t.enable=function(e){if(!this.enabled){if(!this.isNodeVersionCompatible()){this.enabled=!1;return}if(!t.hasEverEnabled){this.forceClsHooked=e,this.hasEverEnabled=!0,typeof this.cls>"u"&&(t.forceClsHooked===!0||t.forceClsHooked===void 0&&t.shouldUseClsHooked()?this.cls=Nwi():this.cls=pRi());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){p$.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",mAe.dumpObj(r)),this.enabled=!1;return}APa.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){p$.warn("Error binding to session context",mAe.dumpObj(n))}})}this.enabled=!0}},t.startOperation=function(e,r){var n=e&&e.traceContext||null,o=e&&e.spanContext?e:null,s=e&&e.traceId?e:null,c=e&&e.headers;if(o)return this.spanToContextObject(o.spanContext(),o.parentSpanId,o.name);if(s)return this.spanToContextObject(s,"|".concat(s.traceId,".").concat(s.spanId,"."),typeof r=="string"?r:"");var l=typeof r=="string"?r:"";if(n){var u=null,d=null;if(l=n.attributes.OperationName||l,r){var f=r;f.headers&&(f.headers.traceparent?u=new Gte(f.headers.traceparent):f.headers["request-id"]&&(u=new Gte(null,f.headers["request-id"])),f.headers.tracestate&&(d=new mSr(f.headers.tracestate)))}u||(u=new Gte(n.traceParent||n.traceparent)),d||(d=new mSr(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new hRi(r);h=m.getCorrelationContextHeader(),l=m.getOperationName({})}var g=t.generateContextObject(u.traceId,u.parentId,l,h,u,d);return g}if(c){var u=new Gte(c.traceparent?c.traceparent.toString():null),d=new mSr(c.tracestate?c.tracestate.toString():null),m=new hRi(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return p$.warn("startOperation was called with invalid arguments",arguments),null},t.disable=function(){this.enabled=!1},t.reset=function(){if(t.hasEverEnabled){t.session=null;try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(e){p$.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",mAe.dumpObj(e)),this.enabled=!1;return}}},t.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},t.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},t.canUseClsHooked=function(){var e=process.versions.node.split("."),r=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,o=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(r&&n)&&o},t.enabled=!1,t.hasEverEnabled=!1,t.forceClsHooked=void 0,t.CONTEXT_NAME="ApplicationInsights-Context",t})();hL.CorrelationContextManager=yPa;var _Pa=(function(){function t(e){this.props=[],this.addHeaderData(e)}return a(t,"CustomPropertiesImpl"),t.prototype.addHeaderData=function(e){var r=e?e.split(", "):[];this.props=r.map(function(n){var o=n.split("=");return{key:o[0],value:o[1]}}).concat(this.props)},t.prototype.serializeToHeader=function(){return this.props.map(function(e){return"".concat(e.key,"=").concat(e.value)}).join(", ")},t.prototype.getProperty=function(e){for(var r=0;r'+r+""+s,n},"insertSnippetByIndex");Oo.insertSnippetByIndex=A2a;var y2a=a(function(t){var e=!1,r=t.getHeader("Content-Type");return r&&(typeof r=="string"?e=r.indexOf("html")>=0:e=r.toString().indexOf("html")>=0),e},"isContentTypeHeaderHtml");Oo.isContentTypeHeaderHtml=y2a});var CSr=I((cRp,MRi)=>{"use strict";p();var NRi=Id(),_2a=(function(){function t(){}return a(t,"ConnectionStringParser"),t.parse=function(e){if(!e)return{};var r=e.split(t._FIELDS_SEPARATOR),n=r.reduce(function(s,c){var l=c.split(t._FIELD_KEY_VALUE_SEPARATOR);if(l.length===2){var u=l[0].toLowerCase(),d=l[1];s[u]=d}return s},{});if(Object.keys(n).length>0){if(n.endpointsuffix){var o=n.location?n.location+".":"";n.ingestionendpoint=n.ingestionendpoint||"https://"+o+"dc."+n.endpointsuffix,n.liveendpoint=n.liveendpoint||"https://"+o+"live."+n.endpointsuffix}n.ingestionendpoint=n.ingestionendpoint||NRi.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||NRi.DEFAULT_LIVEMETRICS_ENDPOINT}return n},t.isIkeyValid=function(e){if(!e||e=="")return!1;var r="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",n=new RegExp(r);return n.test(e)},t._FIELDS_SEPARATOR=";",t._FIELD_KEY_VALUE_SEPARATOR="=",t})();MRi.exports=_2a});var ORi={};Ti(ORi,{webSnippet:()=>E2a});var E2a,LRi=Se(()=>{p();E2a=`!function(T,l,y){var S=T.location,k="script",D="instrumentationKey",C="ingestionendpoint",I="disableExceptionTracking",E="ai.device.",b="toLowerCase",w="crossOrigin",N="POST",e="appInsightsSDK",t=y.name||"appInsights";(y.name||T[e])&&(T[e]=t);var n=T[t]||function(d){var g=!1,f=!1,m={initialize:!0,queue:[],sv:"5",version:2,config:d};function v(e,t){var n={},a="Browser";return n[E+"id"]=a[b](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(m.sv||m.version),{time:function(){var e=new Date;function t(e){var t=""+e;return 1===t.length&&(t="0"+t),t}return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}(),iKey:e,name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}}}var h=d.url||y.src;if(h){function a(e){var t,n,a,i,r,o,s,c,u,p,l;g=!0,m.queue=[],f||(f=!0,t=h,s=function(){var e={},t=d.connectionString;if(t)for(var n=t.split(";"),a=0;a{"use strict";p();var gka=iwi();process&&gka.gte(process.versions.node,"8.0.0")?Bbr.exports=fwi():Bbr.exports=Mwi()});var Zwi=I((vo,Jwi)=>{p();vo=Jwi.exports=qa;var bl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?bl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):bl=a(function(){},"debug");vo.SEMVER_SPEC_VERSION="2.0.0";var u4e=256,H0t=Number.MAX_SAFE_INTEGER||9007199254740991,Fbr=16,Aka=u4e-6,d4e=vo.re=[],ju=vo.safeRe=[],or=vo.src=[],Sa=0,Hbr="[a-zA-Z0-9-]",Ubr=[["\\s",1],["\\d",u4e],[Hbr,Aka]];function Y0t(t){for(var e=0;e)?=?)";var G0t=Sa++;or[G0t]=or[aAe]+"|x|X|\\*";var $0t=Sa++;or[$0t]=or[sAe]+"|x|X|\\*";var Qte=Sa++;or[Qte]="[v=\\s]*("+or[$0t]+")(?:\\.("+or[$0t]+")(?:\\.("+or[$0t]+")(?:"+or[$br]+")?"+or[p4e]+"?)?)?";var lAe=Sa++;or[lAe]="[v=\\s]*("+or[G0t]+")(?:\\.("+or[G0t]+")(?:\\.("+or[G0t]+")(?:"+or[Vbr]+")?"+or[p4e]+"?)?)?";var Qwi=Sa++;or[Qwi]="^"+or[fAe]+"\\s*"+or[Qte]+"$";var qwi=Sa++;or[qwi]="^"+or[fAe]+"\\s*"+or[lAe]+"$";var jwi=Sa++;or[jwi]="(?:^|[^\\d])(\\d{1,"+Fbr+"})(?:\\.(\\d{1,"+Fbr+"}))?(?:\\.(\\d{1,"+Fbr+"}))?(?:$|[^\\d])";var K0t=Sa++;or[K0t]="(?:~>?)";var uAe=Sa++;or[uAe]="(\\s*)"+or[K0t]+"\\s+";d4e[uAe]=new RegExp(or[uAe],"g");ju[uAe]=new RegExp(Y0t(or[uAe]),"g");var yka="$1~",Hwi=Sa++;or[Hwi]="^"+or[K0t]+or[Qte]+"$";var Gwi=Sa++;or[Gwi]="^"+or[K0t]+or[lAe]+"$";var J0t=Sa++;or[J0t]="(?:\\^)";var dAe=Sa++;or[dAe]="(\\s*)"+or[J0t]+"\\s+";d4e[dAe]=new RegExp(or[dAe],"g");ju[dAe]=new RegExp(Y0t(or[dAe]),"g");var _ka="$1^",$wi=Sa++;or[$wi]="^"+or[J0t]+or[Qte]+"$";var Vwi=Sa++;or[Vwi]="^"+or[J0t]+or[lAe]+"$";var Kbr=Sa++;or[Kbr]="^"+or[fAe]+"\\s*("+zbr+")$|^$";var Jbr=Sa++;or[Jbr]="^"+or[fAe]+"\\s*("+Uwi+")$|^$";var qte=Sa++;or[qte]="(\\s*)"+or[fAe]+"\\s*("+zbr+"|"+or[Qte]+")";d4e[qte]=new RegExp(or[qte],"g");ju[qte]=new RegExp(Y0t(or[qte]),"g");var Eka="$1$2$3",Wwi=Sa++;or[Wwi]="^\\s*("+or[Qte]+")\\s+-\\s+("+or[Qte]+")\\s*$";var zwi=Sa++;or[zwi]="^\\s*("+or[lAe]+")\\s+-\\s+("+or[lAe]+")\\s*$";var Ywi=Sa++;or[Ywi]="(<|>)?=?\\s*\\*";for(uL=0;uLu4e)return null;var r=e.loose?ju[Ybr]:ju[Wbr];if(!r.test(t))return null;try{return new qa(t,e)}catch{return null}}a(jte,"parse");vo.valid=vka;function vka(t,e){var r=jte(t,e);return r?r.version:null}a(vka,"valid");vo.clean=Cka;function Cka(t,e){var r=jte(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(Cka,"clean");vo.SemVer=qa;function qa(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof qa){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>u4e)throw new TypeError("version is longer than "+u4e+" characters");if(!(this instanceof qa))return new qa(t,e);bl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?ju[Ybr]:ju[Wbr]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>H0t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>H0t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>H0t||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var o=+n;if(o>=0&&o=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};vo.inc=bka;function bka(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new qa(t,r).inc(e,n).version}catch{return null}}a(bka,"inc");vo.diff=Ska;function Ska(t,e){if(Zbr(t,e))return null;var r=jte(t),n=jte(e),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var s="prerelease"}for(var c in r)if((c==="major"||c==="minor"||c==="patch")&&r[c]!==n[c])return o+c;return s}a(Ska,"diff");vo.compareIdentifiers=cAe;var Lwi=/^[0-9]+$/;function cAe(t,e){var r=Lwi.test(t),n=Lwi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(f4e,"gt");vo.lt=V0t;function V0t(t,e,r){return I6(t,e,r)<0}a(V0t,"lt");vo.eq=Zbr;function Zbr(t,e,r){return I6(t,e,r)===0}a(Zbr,"eq");vo.neq=Kwi;function Kwi(t,e,r){return I6(t,e,r)!==0}a(Kwi,"neq");vo.gte=Xbr;function Xbr(t,e,r){return I6(t,e,r)>=0}a(Xbr,"gte");vo.lte=eSr;function eSr(t,e,r){return I6(t,e,r)<=0}a(eSr,"lte");vo.cmp=W0t;function W0t(t,e,r,n){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Zbr(t,r,n);case"!=":return Kwi(t,r,n);case">":return f4e(t,r,n);case">=":return Xbr(t,r,n);case"<":return V0t(t,r,n);case"<=":return eSr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(W0t,"cmp");vo.Comparator=VR;function VR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof VR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof VR))return new VR(t,e);t=t.trim().split(/\s+/).join(" "),bl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===h4e?this.value="":this.value=this.operator+this.semver.version,bl("comp",this)}a(VR,"Comparator");var h4e={};VR.prototype.parse=function(t){var e=this.options.loose?ju[Kbr]:ju[Jbr],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new qa(r[2],this.options.loose):this.semver=h4e};VR.prototype.toString=function(){return this.value};VR.prototype.test=function(t){return bl("Comparator.test",t,this.options.loose),this.semver===h4e?!0:(typeof t=="string"&&(t=new qa(t,this.options)),W0t(t,this.operator,this.semver,this.options))};VR.prototype.intersects=function(t,e){if(!(t instanceof VR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new jf(t.value,e),z0t(this.value,r,e);if(t.operator==="")return r=new jf(this.value,e),z0t(t.semver,r,e);var n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),l=W0t(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=W0t(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};vo.Range=jf;function jf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof jf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new jf(t.raw,e);if(t instanceof VR)return new jf(t.value,e);if(!(this instanceof jf))return new jf(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}a(jf,"Range");jf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};jf.prototype.toString=function(){return this.range};jf.prototype.parseRange=function(t){var e=this.options.loose,r=e?ju[zwi]:ju[Wwi];t=t.replace(r,jka),bl("hyphen replace",t),t=t.replace(ju[qte],Eka),bl("comparator trim",t,ju[qte]),t=t.replace(ju[uAe],yka),t=t.replace(ju[dAe],_ka);var n=e?ju[Kbr]:ju[Jbr],o=t.split(" ").map(function(s){return Mka(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter(function(s){return!!s.match(n)})),o=o.map(function(s){return new VR(s,this.options)},this),o};jf.prototype.intersects=function(t,e){if(!(t instanceof jf))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return t.set.some(function(o){return o.every(function(s){return n.intersects(s,e)})})})})};vo.toComparators=Nka;function Nka(t,e){return new jf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(Nka,"toComparators");function Mka(t,e){return bl("comp",t,e),t=Bka(t,e),bl("caret",t),t=Oka(t,e),bl("tildes",t),t=Uka(t,e),bl("xrange",t),t=qka(t,e),bl("stars",t),t}a(Mka,"parseComparator");function Hv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(Hv,"isX");function Oka(t,e){return t.trim().split(/\s+/).map(function(r){return Lka(r,e)}).join(" ")}a(Oka,"replaceTildes");function Lka(t,e){var r=e.loose?ju[Gwi]:ju[Hwi];return t.replace(r,function(n,o,s,c,l){bl("tilde",t,n,o,s,c,l);var u;return Hv(o)?u="":Hv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Hv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(bl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",bl("tilde return",u),u})}a(Lka,"replaceTilde");function Bka(t,e){return t.trim().split(/\s+/).map(function(r){return Fka(r,e)}).join(" ")}a(Bka,"replaceCarets");function Fka(t,e){bl("caret",t,e);var r=e.loose?ju[Vwi]:ju[$wi];return t.replace(r,function(n,o,s,c,l){bl("caret",t,n,o,s,c,l);var u;return Hv(o)?u="":Hv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Hv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(bl("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(bl("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),bl("caret return",u),u})}a(Fka,"replaceCaret");function Uka(t,e){return bl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return Qka(r,e)}).join(" ")}a(Uka,"replaceXRanges");function Qka(t,e){t=t.trim();var r=e.loose?ju[qwi]:ju[Qwi];return t.replace(r,function(n,o,s,c,l,u){bl("xRange",t,n,o,s,c,l,u);var d=Hv(s),f=d||Hv(c),h=f||Hv(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),bl("xRange return",n),n})}a(Qka,"replaceXRange");function qka(t,e){return bl("replaceStars",t,e),t.trim().replace(ju[Ywi],"")}a(qka,"replaceStars");function jka(t,e,r,n,o,s,c,l,u,d,f,h,m){return Hv(r)?e="":Hv(n)?e=">="+r+".0.0":Hv(o)?e=">="+r+"."+n+".0":e=">="+e,Hv(u)?l="":Hv(d)?l="<"+(+u+1)+".0.0":Hv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(jka,"hyphenReplace");jf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new qa(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(Hka,"testSet");vo.satisfies=z0t;function z0t(t,e,r){try{e=new jf(e,r)}catch{return!1}return e.test(t)}a(z0t,"satisfies");vo.maxSatisfying=Gka;function Gka(t,e,r){var n=null,o=null;try{var s=new jf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new qa(n,r))}),n}a(Gka,"maxSatisfying");vo.minSatisfying=$ka;function $ka(t,e,r){var n=null,o=null;try{var s=new jf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new qa(n,r))}),n}a($ka,"minSatisfying");vo.minVersion=Vka;function Vka(t,e){t=new jf(t,e);var r=new qa("0.0.0");if(t.test(r)||(r=new qa("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||f4e(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(Vka,"minVersion");vo.validRange=Wka;function Wka(t,e){try{return new jf(t,e).range||"*"}catch{return null}}a(Wka,"validRange");vo.ltr=zka;function zka(t,e,r){return tSr(t,e,"<",r)}a(zka,"ltr");vo.gtr=Yka;function Yka(t,e,r){return tSr(t,e,">",r)}a(Yka,"gtr");vo.outside=tSr;function tSr(t,e,r,n){t=new qa(t,n),e=new jf(e,n);var o,s,c,l,u;switch(r){case">":o=f4e,s=eSr,c=V0t,l=">",u=">=";break;case"<":o=V0t,s=Xbr,c=f4e,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(z0t(t,e,n))return!1;for(var d=0;d=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0}a(tSr,"outside");vo.prerelease=Kka;function Kka(t,e){var r=jte(t,e);return r&&r.prerelease.length?r.prerelease:null}a(Kka,"prerelease");vo.intersects=Jka;function Jka(t,e,r){return t=new jf(t,r),e=new jf(e,r),t.intersects(e)}a(Jka,"intersects");vo.coerce=Zka;function Zka(t){if(t instanceof qa)return t;if(typeof t!="string")return null;var e=t.match(ju[jwi]);return e==null?null:jte(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(Zka,"coerce")});var tRi=I((hwp,eRi)=>{p();var Xka=L0e().wrap,nSr=1,iSr=2,oSr=4,X0t=8,uu=[],ePa=0,X_=!1,f$=[],pAe,sSr;function aSr(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(uu=f$.pop()),hAe=void 0,n&&!X_},"asyncCatcher"),sSr=a(function(e,r,n){var o=[];X_=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);X_=!1;var d=e.apply(this,arguments);for(X_=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return X_=!1,uu=f$.pop(),hAe=void 0,d}},"asyncWrap"),Xka(process,"_fatalException",function(t){return a(function(r){return pAe(r)||t(r)},"_asyncFatalException")})):(rSr=!1,pAe=a(function(e){if(rSr)throw e;for(var r=!1,n=uu.length,o=0;o0&&r[f].before(this,o[r[f].uid]);X_=!1;var h;try{h=e.apply(this,arguments)}catch(m){u=!0;for(var f=0;f0&&r[f].after(this,o[r[f].uid]);X_=!1}uu=f$.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",pAe));var Z0t,hAe,rSr;function tPa(t,e,r){X_=!0;for(var n=0;n0)return sSr(t,r,e);return tPa(t,r,e)}a(rPa,"wrapCallback");function dL(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=nSr),typeof t.before=="function"&&(this.before=t.before,this.flags|=iSr),typeof t.after=="function"&&(this.after=t.after,this.flags|=oSr),typeof t.error=="function"&&(this.error=t.error,this.flags|=X0t),this.uid=++ePa,this.data=e===void 0?null:e}a(dL,"AsyncListener");dL.prototype.create=void 0;dL.prototype.before=void 0;dL.prototype.after=void 0;dL.prototype.error=void 0;dL.prototype.data=void 0;dL.prototype.uid=0;dL.prototype.flags=0;function Xwi(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof dL?t:new dL(t,e)}a(Xwi,"createAsyncListener");function nPa(t,e){var r;t instanceof dL?r=t:r=Xwi(t,e);for(var n=!1,o=0;o{"use strict";p();rRi.exports=(t,e)=>class extends t{static{a(this,"WrappedPromise")}constructor(n){var o,s;super(l);var c=this;try{n.apply(o,s)}catch(u){s[1](u)}return c;function l(u,d){o=this,s=[f,h];function f(m){return e(c,!1),u(m)}a(f,"wrappedResolve");function h(m){return e(c,!1),d(m)}a(h,"wrappedReject")}}}});var uRi=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var aRi=L0e(),tAt=Zwi(),pS=aRi.wrap,p$=aRi.massWrap,Hf=tRi(),oPa=require("util"),sPa=tAt.gte(process.version,"6.0.0"),uSr=tAt.gte(process.version,"7.0.0"),aPa=tAt.gte(process.version,"8.0.0"),cPa=tAt.gte(process.version,"11.0.0"),fL=require("net");uSr&&!fL._normalizeArgs?fL._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:pPa(e)?r.path=e:(r.port=e,t.length>1&&typeof t[1]=="string"&&(r.host=t[1]));var n=t[t.length-1];return typeof n!="function"?[r,null]:[r,n]}:!uSr&&!fL._normalizeConnectArgs&&(fL._normalizeConnectArgs=function(t){var e={};function r(o){return(o=Number(o))>=0?o:!1}a(r,"toNumber"),typeof t[0]=="object"&&t[0]!==null?e=t[0]:typeof t[0]=="string"&&r(t[0])===!1?e.path=t[0]:(e.port=t[0],typeof t[1]=="string"&&(e.host=t[1]));var n=t[t.length-1];return typeof n=="function"?[e,n]:[e]});"_setUpListenHandle"in fL.Server.prototype?pS(fL.Server.prototype,"_setUpListenHandle",iRi):pS(fL.Server.prototype,"_listen2",iRi);function iRi(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=Hf(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=Hf(this._handle.onconnection))}}}a(iRi,"wrapSetUpListenHandle");function cRi(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=Hf(e._originalOnread)}}a(cRi,"patchOnRead");pS(fL.Socket.prototype,"connect",function(t){return function(){var e;aPa&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=uSr?fL._normalizeArgs(arguments):fL._normalizeConnectArgs(arguments),e[1]&&(e[1]=Hf(e[1]));var r=t.apply(this,e);return cRi(this),r}});var lPa=require("http");pS(lPa.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=Hf(function(n){return cRi(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var cSr=require("child_process");function oRi(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=Hf(e._handle.onread),pS(e._handle,"close",rAt))}),t._handle&&(t._handle.onexit=Hf(t._handle.onexit))}a(oRi,"wrapChildProcess");cSr.ChildProcess?pS(cSr.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return oRi(this),e}}):p$(cSr,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return oRi(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var pSr=[];process._nextDomainTick&&pSr.push("_nextDomainTick");process._tickDomainCallback&&pSr.push("_tickDomainCallback");p$(process,pSr,pL);pS(process,"nextTick",rAt);var hSr=["setTimeout","setInterval"];global.setImmediate&&hSr.push("setImmediate");var lRi=require("timers"),uPa=global.setTimeout===lRi.setTimeout;p$(lRi,hSr,rAt);uPa&&p$(global,hSr,rAt);var dSr=require("dns");p$(dSr,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],pL);dSr.resolveNaptr&&pS(dSr,"resolveNaptr",pL);var Gte=require("fs");p$(Gte,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],pL);Gte.lchown&&pS(Gte,"lchown",pL);Gte.lchmod&&pS(Gte,"lchmod",pL);Gte.ftruncate&&pS(Gte,"ftruncate",pL);var m4e;try{m4e=require("zlib")}catch{}m4e&&m4e.Deflate&&m4e.Deflate.prototype&&(Hte=Object.getPrototypeOf(m4e.Deflate.prototype),Hte._transform?pS(Hte,"_transform",pL):Hte.write&&Hte.flush&&Hte.end&&p$(Hte,["write","flush","end"],pL));var Hte,fSr;try{fSr=require("crypto")}catch{}fSr&&(lSr=["pbkdf2","randomBytes"],cPa||lSr.push("pseudoRandomBytes"),p$(fSr,lSr,pL));var lSr,eAt=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";eAt&&(sRi=process.addAsyncListener({create:a(function(){eAt=!1},"create")}),global.Promise.resolve(!0).then(a(function(){eAt=!1},"notSync")),process.removeAsyncListener(sRi));var sRi;eAt&&dPa();function dPa(){var t=global.Promise;function e(c){if(!(this instanceof e))return t(c);if(typeof c!="function")return new t(c);var l,u,d=new t(f);d.__proto__=e.prototype;try{c.apply(l,u)}catch(h){u[1](h)}return d;function f(h,m){l=this,u=[g,A];function g(y){return n(d,!1),h(y)}a(g,"wrappedResolve");function A(y){return n(d,!1),m(y)}a(A,"wrappedReject")}}if(a(e,"wrappedPromise"),oPa.inherits(e,t),pS(t.prototype,"then",s),t.prototype.chain&&pS(t.prototype,"chain",s),sPa)global.Promise=nRi()(t,n);else{var r=["all","race","reject","resolve","accept","defer"];r.forEach(function(c){typeof t[c]=="function"&&(e[c]=t[c])}),global.Promise=e}function n(c,l){(!c.__asl_wrapper||l)&&(c.__asl_wrapper=Hf(o))}a(n,"ensureAslWrapper");function o(c,l,u,d){var f;try{return f=l.call(c,u),{returnVal:f,error:!1}}catch(h){return{errorVal:h,error:!0}}finally{f instanceof t?d.__asl_wrapper=a(function(){var m=f.__asl_wrapper||o;return m.apply(this,arguments)},"proxyWrapper"):n(d,!0)}}a(o,"propagateAslWrapper");function s(c){return a(function(){var u=this,d=c.apply(u,Array.prototype.map.call(arguments,f));return d.__asl_wrapper=a(function(m,g,A,y){return u.__asl_wrapper?(u.__asl_wrapper(m,function(){},null,d),d.__asl_wrapper(m,g,A,y)):o(m,g,A,y)},"proxyWrapper"),d;function f(h){return typeof h!="function"?h:Hf(function(m){var g=(u.__asl_wrapper||o)(this,h,m,d);if(g.error)throw g.errorVal;return g.returnVal})}a(f,"bind")},"wrappedThen")}a(s,"wrapThen")}a(dPa,"wrapPromise");function pL(t){var e=a(function(){var r,n=arguments.length-1;if(typeof arguments[n]=="function"){r=Array(arguments.length);for(var o=0;o=0?t:!1}a(fPa,"toNumber");function pPa(t){return typeof t=="string"&&fPa(t)===!1}a(pPa,"isPipeName")});var mRi=I((Twp,hRi)=>{"use strict";p();var x6=require("assert"),hPa=U0t(),g4e="cls@contexts",mSr="error@context";process.addAsyncListener||uRi();function OD(t){this.name=t,this.active=null,this._set=[],this.id=null}a(OD,"Namespace");OD.prototype.set=function(t,e){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[t]=e,e};OD.prototype.get=function(t){if(this.active)return this.active[t]};OD.prototype.createContext=function(){return Object.create(this.active)};OD.prototype.run=function(t){var e=this.createContext();this.enter(e);try{return t(e),e}catch(r){throw r&&(r[mSr]=e),r}finally{this.exit(e)}};OD.prototype.runAndReturn=function(t){var e;return this.run(function(r){e=t(r)}),e};OD.prototype.bind=function(t,e){e||(this.active?e=this.active:e=this.createContext());var r=this;return function(){r.enter(e);try{return t.apply(this,arguments)}catch(n){throw n&&(n[mSr]=e),n}finally{r.exit(e)}}};OD.prototype.enter=function(t){x6.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};OD.prototype.exit=function(t){if(x6.ok(t,"context must be provided for exiting"),this.active===t){x6.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);x6.ok(e>=0,"context not currently entered; can't exit"),x6.ok(e,"can't remove top context"),this._set.splice(e,1)};OD.prototype.bindEmitter=function(t){x6.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[g4e]||(s[g4e]=Object.create(null)),s[g4e][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[g4e]))return s;var c=s,l=s[g4e];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),hPa(t,n,o)};OD.prototype.fromException=function(t){return t[mSr]};function dRi(t){return process.namespaces[t]}a(dRi,"get");function mPa(t){x6.ok(t,"namespace must be given a name!");var e=new OD(t);return e.id=process.addAsyncListener({create:a(function(){return e.active},"create"),before:a(function(r,n){n&&e.enter(n)},"before"),after:a(function(r,n){n&&e.exit(n)},"after"),error:a(function(r){r&&e.exit(r)},"error")}),process.namespaces[t]=e,e}a(mPa,"create");function fRi(t){var e=dRi(t);x6.ok(e,"can't delete nonexistent namespace!"),x6.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a(fRi,"destroy");function pRi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){fRi(t)}),process.namespaces=Object.create(null)}a(pRi,"reset");process.namespaces||pRi();hRi.exports={getNamespace:dRi,createNamespace:mPa,destroyNamespace:fRi,reset:pRi}});var m$=I(hL=>{"use strict";p();var gPa=hL&&hL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),APa=hL&&hL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),yPa=hL&&hL.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&gPa(e,t,r);return APa(e,t),e};Object.defineProperty(hL,"__esModule",{value:!0});hL.CorrelationContextManager=void 0;var h$=lu(),_Pa=yPa(b0t()),$te=S0t(),gSr=QCr(),gRi=sbr(),mAe=Cy(),EPa=(function(){function t(){}return a(t,"CorrelationContextManager"),t.getCurrentContext=function(){if(!t.enabled)return null;var e=t.session.get(t.CONTEXT_NAME);return e===void 0?null:e},t.generateContextObject=function(e,r,n,o,s,c){return r=r||e,this.enabled?{operation:{name:n,id:e,parentId:r,traceparent:s,tracestate:c},customProperties:new vPa(o)}:null},t.spanToContextObject=function(e,r,n){var o=new $te;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=$te.formatOpenTelemetryTraceFlags(e.traceFlags)||$te.DEFAULT_TRACE_FLAG,o.parentId=r,t.generateContextObject(o.traceId,o.parentId,n,null,o)},t.runWithContext=function(e,r){var n;if(t.enabled)try{return t.session.bind(r,(n={},n[t.CONTEXT_NAME]=e,n))()}catch(o){h$.warn("Error binding to session context",mAe.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){h$.warn("Error binding to session context",mAe.dumpObj(r))}},t.wrapCallback=function(e,r){var n;if(t.enabled)try{return t.session.bind(e,r?(n={},n[t.CONTEXT_NAME]=r,n):void 0)}catch(o){h$.warn("Error binding to session context",mAe.dumpObj(o))}return e},t.enable=function(e){if(!this.enabled){if(!this.isNodeVersionCompatible()){this.enabled=!1;return}if(!t.hasEverEnabled){this.forceClsHooked=e,this.hasEverEnabled=!0,typeof this.cls>"u"&&(t.forceClsHooked===!0||t.forceClsHooked===void 0&&t.shouldUseClsHooked()?this.cls=Owi():this.cls=mRi());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){h$.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",mAe.dumpObj(r)),this.enabled=!1;return}_Pa.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){h$.warn("Error binding to session context",mAe.dumpObj(n))}})}this.enabled=!0}},t.startOperation=function(e,r){var n=e&&e.traceContext||null,o=e&&e.spanContext?e:null,s=e&&e.traceId?e:null,c=e&&e.headers;if(o)return this.spanToContextObject(o.spanContext(),o.parentSpanId,o.name);if(s)return this.spanToContextObject(s,"|".concat(s.traceId,".").concat(s.spanId,"."),typeof r=="string"?r:"");var l=typeof r=="string"?r:"";if(n){var u=null,d=null;if(l=n.attributes.OperationName||l,r){var f=r;f.headers&&(f.headers.traceparent?u=new $te(f.headers.traceparent):f.headers["request-id"]&&(u=new $te(null,f.headers["request-id"])),f.headers.tracestate&&(d=new gSr(f.headers.tracestate)))}u||(u=new $te(n.traceParent||n.traceparent)),d||(d=new gSr(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new gRi(r);h=m.getCorrelationContextHeader(),l=m.getOperationName({})}var g=t.generateContextObject(u.traceId,u.parentId,l,h,u,d);return g}if(c){var u=new $te(c.traceparent?c.traceparent.toString():null),d=new gSr(c.tracestate?c.tracestate.toString():null),m=new gRi(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return h$.warn("startOperation was called with invalid arguments",arguments),null},t.disable=function(){this.enabled=!1},t.reset=function(){if(t.hasEverEnabled){t.session=null;try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(e){h$.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",mAe.dumpObj(e)),this.enabled=!1;return}}},t.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},t.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},t.canUseClsHooked=function(){var e=process.versions.node.split("."),r=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,o=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(r&&n)&&o},t.enabled=!1,t.hasEverEnabled=!1,t.forceClsHooked=void 0,t.CONTEXT_NAME="ApplicationInsights-Context",t})();hL.CorrelationContextManager=EPa;var vPa=(function(){function t(e){this.props=[],this.addHeaderData(e)}return a(t,"CustomPropertiesImpl"),t.prototype.addHeaderData=function(e){var r=e?e.split(", "):[];this.props=r.map(function(n){var o=n.split("=");return{key:o[0],value:o[1]}}).concat(this.props)},t.prototype.serializeToHeader=function(){return this.props.map(function(e){return"".concat(e.key,"=").concat(e.value)}).join(", ")},t.prototype.getProperty=function(e){for(var r=0;r'+r+""+s,n},"insertSnippetByIndex");Oo.insertSnippetByIndex=_2a;var E2a=a(function(t){var e=!1,r=t.getHeader("Content-Type");return r&&(typeof r=="string"?e=r.indexOf("html")>=0:e=r.toString().indexOf("html")>=0),e},"isContentTypeHeaderHtml");Oo.isContentTypeHeaderHtml=E2a});var bSr=I((fRp,LRi)=>{"use strict";p();var ORi=xd(),v2a=(function(){function t(){}return a(t,"ConnectionStringParser"),t.parse=function(e){if(!e)return{};var r=e.split(t._FIELDS_SEPARATOR),n=r.reduce(function(s,c){var l=c.split(t._FIELD_KEY_VALUE_SEPARATOR);if(l.length===2){var u=l[0].toLowerCase(),d=l[1];s[u]=d}return s},{});if(Object.keys(n).length>0){if(n.endpointsuffix){var o=n.location?n.location+".":"";n.ingestionendpoint=n.ingestionendpoint||"https://"+o+"dc."+n.endpointsuffix,n.liveendpoint=n.liveendpoint||"https://"+o+"live."+n.endpointsuffix}n.ingestionendpoint=n.ingestionendpoint||ORi.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||ORi.DEFAULT_LIVEMETRICS_ENDPOINT}return n},t.isIkeyValid=function(e){if(!e||e=="")return!1;var r="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",n=new RegExp(r);return n.test(e)},t._FIELDS_SEPARATOR=";",t._FIELD_KEY_VALUE_SEPARATOR="=",t})();LRi.exports=v2a});var BRi={};Ti(BRi,{webSnippet:()=>C2a});var C2a,FRi=Se(()=>{p();C2a=`!function(T,l,y){var S=T.location,k="script",D="instrumentationKey",C="ingestionendpoint",I="disableExceptionTracking",E="ai.device.",b="toLowerCase",w="crossOrigin",N="POST",e="appInsightsSDK",t=y.name||"appInsights";(y.name||T[e])&&(T[e]=t);var n=T[t]||function(d){var g=!1,f=!1,m={initialize:!0,queue:[],sv:"5",version:2,config:d};function v(e,t){var n={},a="Browser";return n[E+"id"]=a[b](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(m.sv||m.version),{time:function(){var e=new Date;function t(e){var t=""+e;return 1===t.length&&(t="0"+t),t}return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}(),iKey:e,name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}}}var h=d.url||y.src;if(h){function a(e){var t,n,a,i,r,o,s,c,u,p,l;g=!0,m.queue=[],f||(f=!0,t=h,s=function(){var e={},t=d.connectionString;if(t)for(var n=t.split(";"),a=0;a{"use strict";p();var BRi=require("http"),FRi=require("https"),_Ae=require("zlib"),mL=lu(),zR=DRi(),URi=vSr(),y4e=Id(),QRi=CSr(),v2a=(LRi(),Wa(ORi)),C2a=(function(){function t(e){var r;if(this._isIkeyValid=!0,t.INSTANCE)throw new Error("Web snippet injection should be configured from the applicationInsights object");t.INSTANCE=this,t._aiUrl=y4e.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=y4e.WEB_INSTRUMENTATION_DEPRECATED_SOURCE;var n=this._getWebSnippetIkey((r=e.config)===null||r===void 0?void 0:r.webInstrumentationConnectionString);this._webInstrumentationIkey=n||e.config.instrumentationKey,this._clientWebInstrumentationConfig=e.config.webInstrumentationConfig,this._clientWebInstrumentationSrc=e.config.webInstrumentationSrc,this._statsbeat=e?.getStatsbeat()}return a(t,"WebSnippet"),t.prototype.enable=function(e,r){this._isEnabled=e,this._webInstrumentationIkey=this._getWebSnippetIkey(r)||this._webInstrumentationIkey,t._snippet=this._getWebInstrumentationReplacedStr(),this._isEnabled&&!this._isInitialized&&this._isIkeyValid?(this._statsbeat&&this._statsbeat.addFeature(y4e.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(y4e.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=QRi.parse(e),o=n.instrumentationkey||"";QRi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,mL.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){mL.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=URi.getOsPrefix(),n=URi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r +}});`});var GRi=I((gRp,HRi)=>{"use strict";p();var URi=require("http"),QRi=require("https"),_Ae=require("zlib"),mL=lu(),zR=MRi(),qRi=CSr(),y4e=xd(),jRi=bSr(),b2a=(FRi(),Wa(BRi)),S2a=(function(){function t(e){var r;if(this._isIkeyValid=!0,t.INSTANCE)throw new Error("Web snippet injection should be configured from the applicationInsights object");t.INSTANCE=this,t._aiUrl=y4e.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=y4e.WEB_INSTRUMENTATION_DEPRECATED_SOURCE;var n=this._getWebSnippetIkey((r=e.config)===null||r===void 0?void 0:r.webInstrumentationConnectionString);this._webInstrumentationIkey=n||e.config.instrumentationKey,this._clientWebInstrumentationConfig=e.config.webInstrumentationConfig,this._clientWebInstrumentationSrc=e.config.webInstrumentationSrc,this._statsbeat=e?.getStatsbeat()}return a(t,"WebSnippet"),t.prototype.enable=function(e,r){this._isEnabled=e,this._webInstrumentationIkey=this._getWebSnippetIkey(r)||this._webInstrumentationIkey,t._snippet=this._getWebInstrumentationReplacedStr(),this._isEnabled&&!this._isInitialized&&this._isIkeyValid?(this._statsbeat&&this._statsbeat.addFeature(y4e.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(y4e.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=jRi.parse(e),o=n.instrumentationkey||"";jRi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,mL.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){mL.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=qRi.getOsPrefix(),n=qRi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r `).concat(e,` disableIkeyDeprecationMessage: true,\r - sdkExtension: "`).concat(n).concat(r,"d_n_"),s=v2a.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(y4e.WEB_INSTRUMENTATION_DEFAULT_SOURCE,".2.min.js"),this._clientWebInstrumentationSrc):s},t.prototype._getClientWebInstrumentationConfigStr=function(e){var r="";try{e!=null&&e.length>0&&e.forEach(function(n){var o=n.name;if(o!==void 0){var s=n.value,c="";switch(typeof s){case"function":break;case"object":break;case"string":c=" ".concat(o,': "').concat(s,`",\r + sdkExtension: "`).concat(n).concat(r,"d_n_"),s=b2a.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(y4e.WEB_INSTRUMENTATION_DEFAULT_SOURCE,".2.min.js"),this._clientWebInstrumentationSrc):s},t.prototype._getClientWebInstrumentationConfigStr=function(e){var r="";try{e!=null&&e.length>0&&e.forEach(function(n){var o=n.name;if(o!==void 0){var s=n.value,c="";switch(typeof s){case"function":break;case"object":break;case"string":c=" ".concat(o,': "').concat(s,`",\r `),r+=c;break;default:c=" ".concat(o,": ").concat(s,`,\r -`),r+=c;break}}})}catch{this._isEnabled=!1,mL.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=BRi.createServer,r=FRi.createServer,n=this._isEnabled;BRi.createServer=function(o){var s=o;return s&&(o=a(function(c,l){var u=l.write,d=c.method=="GET";l.write=a(function(m,g,A){try{if(n&&d){var y=zR.getContentEncodingFromHeaders(l),_=void 0;if(typeof g=="string"&&(_=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,_));else if(y.length){var E=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,E)}}}catch(v){mL.warn("Inject snippet error: "+v)}return u.apply(l,arguments)},"wrap");var f=l.end;return l.end=a(function(m,g,A){if(n&&d)try{if(n&&d){var y=zR.getContentEncodingFromHeaders(l),_=void 0;if(typeof g=="string"&&(_=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,_));else if(y.length){var E=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,E)}}}catch(v){mL.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},FRi.createServer=function(o,s){var c=s;if(c)return s=a(function(l,u){var d=l.method=="GET",f=u.write,h=u.end;return u.write=a(function(g,A,y){try{if(n&&d){var _=zR.getContentEncodingFromHeaders(u),E=void 0;if(typeof A=="string"&&(E=A),_==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=this.InjectWebSnippet(u,g,void 0,E));else if(_.length){var v=_[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(S){mL.warn("Inject snippet error: "+S)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var _=zR.getContentEncodingFromHeaders(u),E=void 0;if(typeof A=="string"&&(E=A),_==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,void 0,E));else if(_.length){var v=_[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(S){mL.warn("Inject snippet error: "+S)}return h.apply(u,arguments)},"wrap"),c(l,u)},"httpsRequestListener"),r(o,s)}},t.prototype.ValidateInjection=function(e,r){try{if(!e||!r||e.statusCode!=200)return!1;var n=zR.isContentTypeHeaderHtml(e);if(!n)return!1;var o=r.slice().toString();if(o.indexOf("")>=0&&o.indexOf("")>=0&&o.indexOf(t._aiUrl)<0&&o.indexOf(t._aiDeprecatedUrl)<0)return!0}catch(s){mL.info("validate injections error: "+s)}return!1},t.prototype.InjectWebSnippet=function(e,r,n,o){try{var s=!!n;if(s)e.removeHeader("Content-Length"),r=this._getInjectedCompressBuffer(e,r,n),e.setHeader("Content-Length",r.length);else{var c=r.toString(),l=c.indexOf("");if(l<0)return r;var u=zR.insertSnippetByIndex(l,c,t._snippet);if(typeof r=="string")e.removeHeader("Content-Length"),r=u,e.setHeader("Content-Length",Buffer.byteLength(r));else if(Buffer.isBuffer(r)){var d=o||"utf8",f=zR.isBufferType(r,d);if(f){e.removeHeader("Content-Length");var h=Buffer.from(u).toString(d);r=Buffer.from(h,d),e.setHeader("Content-Length",r.length)}}}}catch(m){mL.warn("Failed to inject web snippet and change content-lenght headers. Exception:"+m)}return r},t.prototype._getInjectedCompressBuffer=function(e,r,n){try{switch(n){case zR.contentEncodingMethod.GZIP:var o=_Ae.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=_Ae.gzipSync(s)}break;case zR.contentEncodingMethod.DEFLATE:var c=_Ae.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=_Ae.deflateSync(l)}break;case zR.contentEncodingMethod.BR:var u=zR.getBrotliDecompressSync(_Ae),d=zR.getBrotliCompressSync(_Ae);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){mL.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();qRi.exports=C2a});var GRi=I((SSr,HRi)=>{"use strict";p();var b2a=SSr&&SSr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),YR=require("url"),bSr=Z_(),S2a=Cy(),T2a=Y0e(),I2a=tbr(),x2a=Mte(),w2a=(function(t){b2a(e,t);function e(r,n){var o=t.call(this)||this;return n&&n.method&&r&&(o.method=n.method,o.url=e._getUrlFromRequestOptions(r,n),o.startTime=+new Date),o}return a(e,"HttpDependencyParser"),e.prototype.onError=function(r){this._setStatus(void 0,r)},e.prototype.onResponse=function(r){this._setStatus(r.statusCode,void 0),this.correlationId=S2a.getCorrelationContextTarget(r,T2a.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=bSr.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new YR.URL(this.url);l.search=void 0,l.hash=void 0,o+=" "+l.pathname,c=l.hostname,l.port&&(c+=":"+l.port)}catch{}this.correlationId?(s=bSr.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==x2a.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=bSr.RemoteDependencyDataConstants.TYPE_HTTP;var u={id:n,name:o,data:this.url,duration:this.duration,success:this._isSuccess(),resultCode:this.statusCode?this.statusCode.toString():null,properties:this.properties||{},dependencyTypeName:s,target:c};if(r&&r.time?u.time=r.time:this.startTime&&(u.time=new Date(this.startTime)),r){for(var d in r)u[d]||(u[d]=r[d]);if(r.properties)for(var d in r.properties)u.properties[d]=r.properties[d]}return u},e._getUrlFromRequestOptions=function(r,n){if(typeof r=="string")if(r.indexOf("http://")===0||r.indexOf("https://")===0)try{r=new YR.URL(r)}catch{}else try{var o=new YR.URL("http://"+r);o.port==="443"?r=new YR.URL("https://"+r):r=new YR.URL("http://"+r)}catch{}else{if(r&&typeof YR.URL=="function"&&r instanceof YR.URL)return YR.format(r);var s=r;r={},s&&Object.keys(s).forEach(function(u){r[u]=s[u]})}if(r.path&&r.host)try{var c=new YR.URL(r.path,"http://"+r.host+r.path);r.pathname=c.pathname,r.search=c.search}catch{}if(r.path&&r.hostname&&!r.host)try{var c=new YR.URL(r.path,"http://"+r.hostname+r.path);r.pathname=c.pathname,r.search=c.search}catch{}if(r.host&&r.port)try{var l=new YR.URL("http://".concat(r.host));!l.port&&r.port&&(r.hostname=r.host,delete r.host)}catch{}return r.protocol=r.protocol||n.agent&&n.agent.protocol||n.protocol||void 0,r.hostname=r.hostname||"localhost",YR.format(r)},e})(I2a);HRi.exports=w2a});var $Ri=I(EAe=>{"use strict";p();var gAt=EAe&&EAe.__assign||function(){return gAt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var N2a=k6&&k6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M2a=k6&&k6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),O2a=k6&&k6.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&N2a(e,t,r);return M2a(e,t),e};Object.defineProperty(k6,"__esModule",{value:!0});k6.spanToTelemetryContract=j2a;var VRi=require("url"),LD=(go(),Wa(A6)),Ts=(Zgt(),Wa(dCr)),R6=O2a(Id()),L2a=$Ri(),B2a=Cy();function F2a(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=B2a.stringify(s)),e}a(F2a,"createPropertiesFromSpan");function U2a(t){return t===Ts.DbSystemValues.DB2||t===Ts.DbSystemValues.DERBY||t===Ts.DbSystemValues.MARIADB||t===Ts.DbSystemValues.MSSQL||t===Ts.DbSystemValues.ORACLE||t===Ts.DbSystemValues.SQLITE||t===Ts.DbSystemValues.OTHER_SQL||t===Ts.DbSystemValues.HSQLDB||t===Ts.DbSystemValues.H2}a(U2a,"isSqlDB");function WRi(t){var e=t.attributes[Ts.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[Ts.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[Ts.SemanticAttributes.HTTP_SCHEME],o=t.attributes[Ts.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[Ts.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[Ts.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[Ts.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[Ts.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(WRi,"getUrl");function ISr(t){var e=t.attributes[Ts.SemanticAttributes.PEER_SERVICE],r=t.attributes[Ts.SemanticAttributes.HTTP_HOST],n=t.attributes[Ts.SemanticAttributes.HTTP_URL],o=t.attributes[Ts.SemanticAttributes.NET_PEER_NAME],s=t.attributes[Ts.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(ISr,"getDependencyTarget");function Q2a(t){var e={name:t.name,success:t.status.code!=LD.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===LD.SpanKind.PRODUCER&&(e.dependencyTypeName=R6.DependencyTypeName.QueueMessage),t.kind===LD.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=R6.DependencyTypeName.InProc);var r=t.attributes[Ts.SemanticAttributes.HTTP_METHOD],n=t.attributes[Ts.SemanticAttributes.DB_SYSTEM],o=t.attributes[Ts.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=R6.DependencyTypeName.Http;var s=t.attributes[Ts.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new VRi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=WRi(t);var u=t.attributes[Ts.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=ISr(t);if(d){try{var f=new RegExp(/(https?)(:\/\/.*)(:\d+)(\S*)/),h=f.exec(d);if(h!=null){var m=h[1],g=h[3];(m=="https"&&g==":443"||m=="http"&&g==":80")&&(d=h[1]+h[2]+h[4])}}catch{}e.target="".concat(d)}}else if(n){String(n)===Ts.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===Ts.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===Ts.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===Ts.DbSystemValues.REDIS?e.dependencyTypeName="redis":U2a(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[Ts.SemanticAttributes.DB_STATEMENT],y=t.attributes[Ts.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=ISr(t),_=t.attributes[Ts.SemanticAttributes.DB_NAME];d?e.target=_?"".concat(d,"|").concat(_):"".concat(d):e.target=_?"".concat(_):"".concat(n)}else if(o){e.dependencyTypeName=R6.DependencyTypeName.Grpc;var E=t.attributes[Ts.SemanticAttributes.RPC_GRPC_STATUS_CODE];E&&(e.resultCode=String(E));var d=ISr(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(Q2a,"createDependencyData");function q2a(t){var e={name:t.name,success:t.status.code!=LD.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[Ts.SemanticAttributes.HTTP_METHOD],n=t.attributes[Ts.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==LD.SpanKind.SERVER){var o=t.attributes[Ts.SemanticAttributes.HTTP_ROUTE],s=t.attributes[Ts.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new VRi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=WRi(t);var l=t.attributes[Ts.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(q2a,"createRequestData");function j2a(t){var e;switch(t.kind){case LD.SpanKind.CLIENT:case LD.SpanKind.PRODUCER:case LD.SpanKind.INTERNAL:e=Q2a(t);break;case LD.SpanKind.SERVER:case LD.SpanKind.CONSUMER:e=q2a(t);break}var r=t.spanContext?t.spanContext():t.context(),n="".concat(r.spanId),o=Math.round(t.duration[0]*1e3+t.duration[1]/1e6);return e.id=n,e.duration=o,e.properties=F2a(t),t.attributes[R6.AzNamespace]&&(t.kind===LD.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat(R6.DependencyTypeName.InProc," | ").concat(t.attributes[R6.AzNamespace])),t.attributes[R6.AzNamespace]===R6.MicrosoftEventHub&&(0,L2a.parseEventHubSpan)(t,e)),e}a(j2a,"spanToTelemetryContract")});var KRi=I(_$=>{"use strict";p();var vAe=_$&&_$.__assign||function(){return vAe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var G2a=EI&&EI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$2a=EI&&EI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),V2a=EI&&EI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&G2a(e,t,r);return $2a(e,t),e};Object.defineProperty(EI,"__esModule",{value:!0});EI.subscriber=void 0;EI.enable=J2a;var E4e=(go(),Wa(A6)),W2a=Id(),xSr=Pp(),z2a=V2a(zRi()),Y2a=KRi(),Wte=[],K2a=a(function(t){try{var e=t.data,r=z2a.spanToTelemetryContract(e);Y2a.AsyncScopeManager.with(e,function(){Wte.forEach(function(n){e.kind===E4e.SpanKind.SERVER||e.kind===E4e.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===E4e.SpanKind.CLIENT||e.kind===E4e.SpanKind.INTERNAL||e.kind===E4e.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");EI.subscriber=K2a;function J2a(t,e){if(t){var r=Wte.find(function(n){return n==e});if(r)return;Wte.length===0&&xSr.channel.subscribe("azure-coretracing",EI.subscriber,xSr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(W2a.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),Wte.push(e)}else Wte=Wte.filter(function(n){return n!=e}),Wte.length===0&&xSr.channel.unsubscribe("azure-coretracing",EI.subscriber)}a(J2a,"enable")});var ZRi=I(Yte=>{"use strict";p();Object.defineProperty(Yte,"__esModule",{value:!0});Yte.subscriber=void 0;Yte.enable=eDa;var Z2a=Id(),wSr=Pp(),zte=[],X2a=a(function(t){t.data.event.commandName!=="ismaster"&&zte.forEach(function(e){var r=t.data.startedData&&t.data.startedData.databaseName||"Unknown database";e.trackDependency({target:r,data:t.data.event.commandName,name:t.data.event.commandName,duration:t.data.event.duration,success:t.data.succeeded,resultCode:t.data.succeeded?"0":"1",time:t.data.startedData.time,dependencyTypeName:"mongodb"})})},"subscriber");Yte.subscriber=X2a;function eDa(t,e){if(t){var r=zte.find(function(n){return n==e});if(r)return;zte.length===0&&wSr.channel.subscribe("mongodb",Yte.subscriber,wSr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(Z2a.StatsbeatInstrumentation.MONGODB)}),zte.push(e)}else zte=zte.filter(function(n){return n!=e}),zte.length===0&&wSr.channel.unsubscribe("mongodb",Yte.subscriber)}a(eDa,"enable")});var XRi=I(Jte=>{"use strict";p();Object.defineProperty(Jte,"__esModule",{value:!0});Jte.subscriber=void 0;Jte.enable=nDa;var tDa=Id(),RSr=Pp(),Kte=[],rDa=a(function(t){Kte.forEach(function(e){var r=t.data.query||{},n=r.sql||"Unknown query",o=!t.data.err,s=r._connection||{},c=s.config||{},l=c.socketPath?c.socketPath:"".concat(c.host||"localhost",":").concat(c.port);e.trackDependency({target:l,data:n,name:n,duration:t.data.duration,success:o,resultCode:o?"0":"1",time:t.data.time,dependencyTypeName:"mysql"})})},"subscriber");Jte.subscriber=rDa;function nDa(t,e){if(t){var r=Kte.find(function(n){return n==e});if(r)return;Kte.length===0&&RSr.channel.subscribe("mysql",Jte.subscriber,RSr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(tDa.StatsbeatInstrumentation.MYSQL)}),Kte.push(e)}else Kte=Kte.filter(function(n){return n!=e}),Kte.length===0&&RSr.channel.unsubscribe("mysql",Jte.subscriber)}a(nDa,"enable")});var eki=I(Xte=>{"use strict";p();Object.defineProperty(Xte,"__esModule",{value:!0});Xte.subscriber=void 0;Xte.enable=sDa;var iDa=Id(),kSr=Pp(),Zte=[],oDa=a(function(t){Zte.forEach(function(e){t.data.commandObj.command!=="info"&&e.trackDependency({target:t.data.address,name:t.data.commandObj.command,data:t.data.commandObj.command,duration:t.data.duration,success:!t.data.err,resultCode:t.data.err?"1":"0",time:t.data.time,dependencyTypeName:"redis"})})},"subscriber");Xte.subscriber=oDa;function sDa(t,e){if(t){var r=Zte.find(function(n){return n==e});if(r)return;Zte.length===0&&kSr.channel.subscribe("redis",Xte.subscriber,kSr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(iDa.StatsbeatInstrumentation.REDIS)}),Zte.push(e)}else Zte=Zte.filter(function(n){return n!=e}),Zte.length===0&&kSr.channel.unsubscribe("redis",Xte.subscriber)}a(sDa,"enable")});var tki=I(tre=>{"use strict";p();Object.defineProperty(tre,"__esModule",{value:!0});tre.subscriber=void 0;tre.enable=lDa;var aDa=Id(),PSr=Pp(),ere=[],cDa=a(function(t){ere.forEach(function(e){var r=t.data.query,n=r.preparable&&r.preparable.text||r.plan||r.text||"unknown query",o=!t.data.error,s="".concat(t.data.database.host,":").concat(t.data.database.port);e.trackDependency({target:s,data:n,name:n,duration:t.data.duration,success:o,resultCode:o?"0":"1",time:t.data.time,dependencyTypeName:"postgres"})})},"subscriber");tre.subscriber=cDa;function lDa(t,e){if(t){var r=ere.find(function(n){return n==e});if(r)return;ere.length===0&&PSr.channel.subscribe("postgres",tre.subscriber,PSr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(aDa.StatsbeatInstrumentation.POSTGRES)}),ere.push(e)}else ere=ere.filter(function(n){return n!=e}),ere.length===0&&PSr.channel.unsubscribe("postgres",tre.subscriber)}a(lDa,"enable")});var SAe=I((P6,rki)=>{"use strict";p();var uDa=P6&&P6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dDa=P6&&P6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fDa=P6&&P6.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&uDa(e,t,r);return dDa(e,t),e},AAt=P6&&P6.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var nki=require("http"),iki=require("https"),oki=lu(),ski=Cy(),gDa=Y0e(),NSr=obr(),D6=h$(),ADa=uAt(),yDa=(function(){function t(e){if(t.INSTANCE)throw new Error("Server request tracking should be configured from the applicationInsights object");t.INSTANCE=this,this._client=e}return a(t,"AutoCollectHttpRequests"),t.prototype.enable=function(e){this._isEnabled=e,(this._isAutoCorrelating||this._isEnabled||ADa.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?D6.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&D6.CorrelationContextManager.disable(),this._isAutoCorrelating=e},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype.isAutoCorrelating=function(){return this._isAutoCorrelating},t.prototype._generateCorrelationContext=function(e){if(this._isAutoCorrelating)return D6.CorrelationContextManager.generateContextObject(e.getOperationId(this._client.context.tags),e.getRequestId(),e.getOperationName(this._client.context.tags),e.getCorrelationContextHeader(),e.getTraceparent(),e.getTracestate())},t.prototype._registerRequest=function(e,r,n){var o=this,s=new NSr(e),c=this._generateCorrelationContext(s);D6.CorrelationContextManager.runWithContext(c,function(){o._isEnabled&&(e[t.alreadyAutoCollectedFlag]=!0,t.trackRequest(o._client,{request:e,response:r},s)),typeof n=="function"&&n(e,r)})},t.prototype._initialize=function(){if(this._isInitialized=!0,!t.HANDLER_READY){t.HANDLER_READY=!0;var e=a(function(s){if(s){if(typeof s!="function")throw new Error("onRequest handler must be a function");return function(c,l){D6.CorrelationContextManager.wrapEmitter(c),D6.CorrelationContextManager.wrapEmitter(l);var u=c&&!c[t.alreadyAutoCollectedFlag];c&&u&&t.INSTANCE?t.INSTANCE._registerRequest(c,l,s):s(c,l)}}},"wrapOnRequestHandler"),r=a(function(s){var c=s.addListener.bind(s);s.addListener=function(l,u){switch(l){case"request":case"checkContinue":return c(l,e(u));default:return c(l,u)}},s.on=s.addListener},"wrapServerEventHandler"),n=nki.createServer;nki.createServer=function(s,c){if(c&&typeof c=="function"){var l=n(s,e(c));return r(l),l}else{var l=n(e(s));return r(l),l}};var o=iki.createServer;iki.createServer=function(s,c){var l=o(s,e(c));return r(l),l}}},t.trackRequestSync=function(e,r){if(!r.request||!r.response||!e){oki.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=D6.CorrelationContextManager.getCurrentContext(),o=new NSr(r.request,n&&n.operation.parentId);n&&(n.operation.id=o.getOperationId(e.context.tags)||n.operation.id,n.operation.name=o.getOperationName(e.context.tags)||n.operation.name,n.operation.parentId=o.getRequestId()||n.operation.parentId,n.customProperties.addHeaderData(o.getCorrelationContextHeader())),t.endRequest(e,o,r,r.duration,r.error)},t.trackRequest=function(e,r,n){if(!r.request||!r.response||!e){oki.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=D6.CorrelationContextManager.getCurrentContext(),s=n||new NSr(r.request,o&&o.operation.parentId);ski.canIncludeCorrelationHeader(e,s.getUrl())&&t.addResponseCorrelationIdHeader(e,r.response),o&&!n&&(o.operation.id=s.getOperationId(e.context.tags)||o.operation.id,o.operation.name=s.getOperationName(e.context.tags)||o.operation.name,o.operation.parentId=s.getOperationParentId(e.context.tags)||o.operation.parentId,o.customProperties.addHeaderData(s.getCorrelationContextHeader())),r.response.once&&r.response.once("finish",function(){t.endRequest(e,s,r,null,null)}),r.request.on&&r.request.on("error",function(c){t.endRequest(e,s,r,null,c)}),r.request.on&&r.request.on("aborted",function(){var c="The request has been aborted and the network socket has closed.";t.endRequest(e,s,r,null,c)})},t.addResponseCorrelationIdHeader=function(e,r){if(e.config&&e.config.correlationId&&r.getHeader&&r.setHeader&&!r.headersSent){var n=r.getHeader(gDa.requestContextHeader);ski.safeIncludeCorrelationHeader(e,r,n)}},t.endRequest=function(e,r,n,o,s){if(!n.isProcessed){n.isProcessed=!0,s?r.onError(s,o):r.onResponse(n.response,o);var c=r.getRequestTelemetry(n);if(c.tagOverrides=r.getRequestTags(e.context.tags),n.tagOverrides)for(var l in n.tagOverrides)c.tagOverrides[l]=n.tagOverrides[l];var u=r.getLegacyRootId();u&&(c.properties.ai_legacyRootId=u),c.contextObjects=c.contextObjects||{},c.contextObjects["http.ServerRequest"]=n.request,c.contextObjects["http.ServerResponse"]=n.response,e.trackRequest(c)}},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1,D6.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();aki.exports=yDa});var uki=I((LSr,lki)=>{"use strict";p();var KR=LSr&&LSr.__assign||function(){return KR=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0?r:null,InstrumentationKey:n.instrumentationKey||"",Metrics:e.length>0?e:null,InvariantVersion:1,Timestamp:"/Date(".concat(Date.now(),")/"),Version:o.tags[o.keys.internalSdkVersion],StreamId:vDa,MachineName:s,Instance:c,RoleName:l};return u},t.createQuickPulseMetric=function(e){var r;return r={Name:e.name,Value:e.value,Weight:e.count||1},r},t.telemetryEnvelopeToQuickPulseDocument=function(e){switch(e.data.baseType){case rre.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case rre.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case rre.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case rre.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case rre.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=KR(KR({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=KR(KR({},r),{Message:e.data.baseData.message,SeverityLevel:rre.SeverityLevel[n]});return o},t.createQuickPulseExceptionDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.exceptions,o="",s="",c="";n&&n.length>0&&(n[0].parsedStack&&n[0].parsedStack.length>0?n[0].parsedStack.forEach(function(u){o+=u.assembly+` -`}):n[0].stack&&n[0].stack.length>0&&(o=n[0].stack),s=n[0].message,c=n[0].typeName);var l=KR(KR({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=KR(KR({},r),{Name:n.name,Success:n.success,Duration:n.duration,ResponseCode:n.responseCode,OperationName:n.name});return o},t.createQuickPulseDependencyDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=KR(KR({},r),{Name:n.name,Target:n.target,Success:n.success,Duration:n.duration,ResultCode:n.resultCode,CommandName:n.data,OperationName:r.OperationId,DependencyTypeName:n.type});return o},t.createQuickPulseDocument=function(e){var r,n,o,s;e.data.baseType?(n=cki.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=cki.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):EDa.warn("Document type invalid; not sending live metric document",e.data.baseType),o=e.tags[t.keys.operationId],s=t.aggregateProperties(e);var c={DocumentType:r,__type:n,OperationId:o,Version:"1.0",Properties:s};return c},t.aggregateProperties=function(e){var r=[],n=e.data.baseData.measurements||{};for(var o in n)if(n.hasOwnProperty(o)){var s=n[o],c={key:o,value:s};r.push(c)}var l=e.data.baseData.properties||{};for(var o in l)if(l.hasOwnProperty(o)){var s=l[o],c={key:o,value:s};r.push(c)}return r},t.keys=new rre.ContextTagKeys,t})();lki.exports=CDa});var fki=I((zRp,dki)=>{"use strict";p();var bDa=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");dki.exports={getTransmissionTime:bDa}});var gki=I((b4e,mki)=>{"use strict";p();var pki=b4e&&b4e.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},hki=b4e&&b4e.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0?r:this._config.quickPulseHost,m.method=JR.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[JR.time]=IDa.getTransmissionTime(),g["Content-Type"]="application/json",g["Content-Length"]=Buffer.byteLength(c),g),m),s&&s.length>0&&s.forEach(function(_){return l.headers[_.name]=_.value}),o!=="post")return[3,4];if(u=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!u)return[3,4];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,u.addAuthorizationHeader(l)];case 2:return y.sent(),[3,4];case 3:return d=y.sent(),f="Failed to get AAD bearer token for the Application. Error:",BSr.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=FSr.tlsRestrictedAgent,h=SDa.request(l,function(_){if(_.statusCode==200){var E=_.headers[JR.subscribed]==="true",v=null;try{v=_.headers[JR.endpointRedirect]?new xDa.URL(_.headers[JR.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+FSr.dumpObj(T))}var S=_.headers[JR.pollingIntervalHint]?parseInt(_.headers[JR.pollingIntervalHint].toString()):null;A._consecutiveErrors=0,n(E,_,v,S)}else A._onError("StatusCode:"+_.statusCode+" StatusMessage:"+_.statusMessage),n()}),h.on("error",function(_){A._onError(_),n()}),h.write(c),h.end(),[2]}})})},t.prototype._onError=function(e){this._consecutiveErrors++;var r="Transient error connecting to the Live Metrics endpoint. This packet will not appear in your Live Metrics Stream. Error:";this._consecutiveErrors%t.MAX_QPS_FAILURES_BEFORE_WARN===0?(r="Live Metrics endpoint could not be reached ".concat(this._consecutiveErrors," consecutive times. Most recent error:"),BSr.warn(t.TAG,r,e)):BSr.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();mki.exports=wDa});var Cki=I((S4e,vki)=>{"use strict";p();var Aki=S4e&&S4e.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},yki=S4e&&S4e.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0?this._pollingIntervalHint:t.PING_INTERVAL,o=this._isCollectingData?t.POST_INTERVAL:n,this._isCollectingData&&Date.now()-this._lastSuccessTime>=t.MAX_POST_WAIT_TIME&&!this._lastSendSucceeded?(this._isCollectingData=!1,o=t.FALLBACK_INTERVAL):!this._isCollectingData&&Date.now()-this._lastSuccessTime>=t.MAX_PING_WAIT_TIME&&!this._lastSendSucceeded&&(o=t.FALLBACK_INTERVAL),this._lastSendSucceeded=null,this._handle=setTimeout(this._goQuickPulse.bind(this),o),this._handle.unref(),[2]}})})},t.prototype._ping=function(e){this._sender.ping(e,this._redirectedHost,this._quickPulseDone.bind(this))},t.prototype._post=function(e){return Aki(this,void 0,void 0,function(){return yki(this,function(r){switch(r.label){case 0:return[4,this._sender.post(e,this._redirectedHost,this._quickPulseDone.bind(this))];case 1:return r.sent(),[2]}})})},t.prototype._quickPulseDone=function(e,r,n,o){e!=null?(this._isCollectingData!==e&&(_ki.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,_ki.info("Redirecting endpoint to: ",n)),o&&o>0&&(this._pollingIntervalHint=o),r&&r.statusCode<300&&r.statusCode>=200?(this._lastSuccessTime=Date.now(),this._lastSendSucceeded=!0):this._lastSendSucceeded=!1):this._lastSendSucceeded=!1},t.MAX_POST_WAIT_TIME=2e4,t.MAX_PING_WAIT_TIME=6e4,t.FALLBACK_INTERVAL=6e4,t.PING_INTERVAL=5e3,t.POST_INTERVAL=1e3,t})();vki.exports=PDa});var Ski=I(TAe=>{"use strict";p();var EAt=TAe&&TAe.__assign||function(){return EAt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var Tki=v$&&v$.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Iki=v$&&v$.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var BDa=Mte(),wki=CSr(),FDa=lu(),Rki=Id(),UDa=require("url"),QDa=Cmt(),qDa=(function(){function t(e){this._endpointBase=Rki.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=wki.parse(e),o=wki.parse(r),s=!n.instrumentationkey&&Object.keys(n).length>0?null:e,c=this._instrumentationKey;this.instrumentationKey=n.instrumentationkey||s||o.instrumentationkey||c;var l="".concat(this.endpointUrl||n.ingestionendpoint||o.ingestionendpoint||this._endpointBase);l.endsWith("/")&&(l=l.slice(0,-1)),this.endpointUrl="".concat(l,"/v2.1/track"),this.maxBatchSize=this.maxBatchSize||250,this.maxBatchIntervalMs=this.maxBatchIntervalMs||15e3,this.disableAppInsights=this.disableAppInsights||!1,this.samplingPercentage=this.samplingPercentage||100,this.correlationIdRetryIntervalMs=this.correlationIdRetryIntervalMs||30*1e3,this.enableWebInstrumentation=this.enableWebInstrumentation||this.enableAutoWebSnippetInjection||!1,this.webInstrumentationConfig=this.webInstrumentationConfig||null,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation,this.correlationHeaderExcludedDomains=this.correlationHeaderExcludedDomains||["*.core.windows.net","*.core.chinacloudapi.cn","*.core.cloudapi.de","*.core.usgovcloudapi.net","*.core.microsoft.scloud","*.core.eaglex.ic.gov"],this.ignoreLegacyHeaders=this.ignoreLegacyHeaders||!1,this.profileQueryEndpoint=n.ingestionendpoint||o.ingestionendpoint||process.env[t.ENV_profileQueryEndpoint]||this._endpointBase,this.quickPulseHost=this.quickPulseHost||n.liveendpoint||o.liveendpoint||process.env[t.ENV_quickPulseHost]||Rki.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new UDa.URL(this.quickPulseHost).host),this.aadAudience=n.aadaudience||o.aadaudience}return a(t,"Config"),Object.defineProperty(t.prototype,"profileQueryEndpoint",{get:a(function(){return this._profileQueryEndpoint},"get"),set:a(function(e){this._profileQueryEndpoint=e,this.correlationId=BDa.correlationIdPrefix},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instrumentationKey",{get:a(function(){return this._instrumentationKey},"get"),set:a(function(e){t._validateInstrumentationKey(e)||FDa.warn("An invalid instrumentation key was provided. There may be resulting telemetry loss",this.instrumentationKey),this._instrumentationKey=e},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webSnippetConnectionString",{get:a(function(){return this._webInstrumentationConnectionString},"get"),set:a(function(e){this._webInstrumentationConnectionString=e},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webInstrumentationConnectionString",{get:a(function(){return this._webInstrumentationConnectionString},"get"),set:a(function(e){this._webInstrumentationConnectionString=e},"set"),enumerable:!1,configurable:!0}),t.prototype._mergeConfig=function(){var e=QDa.JsonConfig.getInstance();this._connectionString=e.connectionString,this._instrumentationKey=e.instrumentationKey,this.correlationHeaderExcludedDomains=e.correlationHeaderExcludedDomains,this.correlationIdRetryIntervalMs=e.correlationIdRetryIntervalMs,this.disableAllExtendedMetrics=e.disableAllExtendedMetrics,this.disableAppInsights=e.disableAppInsights,this.disableStatsbeat=e.disableStatsbeat,this.distributedTracingMode=e.distributedTracingMode,this.enableAutoCollectConsole=e.enableAutoCollectConsole,this.enableLoggerErrorToTrace=e.enableLoggerErrorToTrace,this.enableAutoCollectDependencies=e.enableAutoCollectDependencies,this.enableAutoCollectIncomingRequestAzureFunctions=e.enableAutoCollectIncomingRequestAzureFunctions,this.enableAutoCollectExceptions=e.enableAutoCollectExceptions,this.enableAutoCollectExtendedMetrics=e.enableAutoCollectExtendedMetrics,this.enableAutoCollectExternalLoggers=e.enableAutoCollectExternalLoggers,this.enableAutoCollectHeartbeat=e.enableAutoCollectHeartbeat,this.enableAutoCollectPerformance=e.enableAutoCollectPerformance,this.enableAutoCollectPreAggregatedMetrics=e.enableAutoCollectPreAggregatedMetrics,this.enableAutoCollectRequests=e.enableAutoCollectRequests,this.enableAutoDependencyCorrelation=e.enableAutoDependencyCorrelation,this.enableInternalDebugLogging=e.enableInternalDebugLogging,this.enableInternalWarningLogging=e.enableInternalWarningLogging,this.enableResendInterval=e.enableResendInterval,this.enableMaxBytesOnDisk=e.enableMaxBytesOnDisk,this.enableSendLiveMetrics=e.enableSendLiveMetrics,this.enableUseAsyncHooks=e.enableUseAsyncHooks,this.enableUseDiskRetryCaching=e.enableUseDiskRetryCaching,this.endpointUrl=e.endpointUrl,this.extendedMetricDisablers=e.extendedMetricDisablers,this.ignoreLegacyHeaders=e.ignoreLegacyHeaders,this.maxBatchIntervalMs=e.maxBatchIntervalMs,this.maxBatchSize=e.maxBatchSize,this.proxyHttpUrl=e.proxyHttpUrl,this.proxyHttpsUrl=e.proxyHttpsUrl,this.quickPulseHost=e.quickPulseHost,this.samplingPercentage=e.samplingPercentage,this.enableWebInstrumentation=e.enableWebInstrumentation,this._webInstrumentationConnectionString=e.webInstrumentationConnectionString,this.webInstrumentationConfig=e.webInstrumentationConfig,this.webInstrumentationSrc=e.webInstrumentationSrc},t._validateInstrumentationKey=function(e){var r="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",n=new RegExp(r);return n.test(e)},t.ENV_azurePrefix="APPSETTING_",t.ENV_iKey="APPINSIGHTS_INSTRUMENTATIONKEY",t.legacy_ENV_iKey="APPINSIGHTS_INSTRUMENTATION_KEY",t.ENV_profileQueryEndpoint="APPINSIGHTS_PROFILE_QUERY_ENDPOINT",t.ENV_quickPulseHost="APPINSIGHTS_QUICKPULSE_HOST",t})();kki.exports=qDa});var GSr=I(HSr=>{"use strict";p();Object.defineProperty(HSr,"__esModule",{value:!0});HSr.createEmptyPipeline=jDa;var Pki=new Set(["Deserialize","Serialize","Retry","Sign"]),jSr=class t{static{a(this,"HttpPipeline")}constructor(e){var r;this._policies=[],this._policies=(r=e?.slice(0))!==null&&r!==void 0?r:[],this._orderedPolicies=void 0}addPolicy(e,r={}){if(r.phase&&r.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(r.phase&&!Pki.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!Pki.has(r.afterPhase))throw new Error(`Invalid afterPhase name: ${r.afterPhase}`);this._policies.push({policy:e,options:r}),this._orderedPolicies=void 0}removePolicy(e){let r=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(r.push(n.policy),!1):!0),this._orderedPolicies=void 0,r}sendRequest(e,r){return this.getOrderedPolicies().reduceRight((s,c)=>l=>c.sendRequest(l,s),s=>e.sendRequest(s))(r)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],r=new Map;function n(A){return{name:A,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}a(n,"createPhase");let o=n("Serialize"),s=n("None"),c=n("Deserialize"),l=n("Retry"),u=n("Sign"),d=[o,s,c,l,u];function f(A){return A==="Retry"?l:A==="Serialize"?o:A==="Deserialize"?c:A==="Sign"?u:s}a(f,"getPhase");for(let A of this._policies){let y=A.policy,_=A.options,E=y.name;if(r.has(E))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};_.afterPhase&&(v.afterPhase=f(_.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(E,v),f(_.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:_}=A,E=y.name,v=r.get(E);if(!v)throw new Error(`Missing node for policy ${E}`);if(_.afterPolicies)for(let S of _.afterPolicies){let T=r.get(S);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(_.beforePolicies)for(let S of _.beforePolicies){let T=r.get(S);T&&(T.dependsOn.add(v),v.dependants.add(T))}}function h(A){A.hasRun=!0;for(let y of A.policies)if(!(y.afterPhase&&(!y.afterPhase.hasRun||y.afterPhase.policies.size))&&y.dependsOn.size===0){e.push(y.policy);for(let _ of y.dependants)_.dependsOn.delete(y);r.delete(y.policy.name),A.policies.delete(y)}}a(h,"walkPhase");function m(){for(let A of d){if(h(A),A.policies.size>0&&A!==s){s.hasRun||h(s);return}A.hasAfterPolicies&&h(s)}}a(m,"walkPhases");let g=0;for(;r.size>0;){g++;let A=e.length;if(m(),e.length<=A&&g>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function jDa(){return jSr.create()}a(jDa,"createEmptyPipeline")});var nre=I(CAt=>{"use strict";p();Object.defineProperty(CAt,"__esModule",{value:!0});CAt.logger=void 0;var HDa=Qgt();CAt.logger=(0,HDa.createClientLogger)("core-rest-pipeline")});var VSr=I($Sr=>{"use strict";p();Object.defineProperty($Sr,"__esModule",{value:!0});$Sr.getRandomIntegerInclusive=GDa;function GDa(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(GDa,"getRandomIntegerInclusive")});var Dki=I(WSr=>{"use strict";p();Object.defineProperty(WSr,"__esModule",{value:!0});WSr.calculateRetryDelay=VDa;var $Da=VSr();function VDa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,$Da.getRandomIntegerInclusive)(0,n/2)}}a(VDa,"calculateRetryDelay")});var bAt=I(zSr=>{"use strict";p();Object.defineProperty(zSr,"__esModule",{value:!0});zSr.isObject=WDa;function WDa(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(WDa,"isObject")});var Nki=I(YSr=>{"use strict";p();Object.defineProperty(YSr,"__esModule",{value:!0});YSr.isError=YDa;var zDa=bAt();function YDa(t){if((0,zDa.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(YDa,"isError")});var Oki=I(SAt=>{"use strict";p();Object.defineProperty(SAt,"__esModule",{value:!0});SAt.computeSha256Hmac=KDa;SAt.computeSha256Hash=JDa;var Mki=require("node:crypto");async function KDa(t,e,r){let n=Buffer.from(t,"base64");return(0,Mki.createHmac)("sha256",n).update(e).digest(r)}a(KDa,"computeSha256Hmac");async function JDa(t,e){return(0,Mki.createHash)("sha256").update(t).digest(e)}a(JDa,"computeSha256Hash")});var Lki=I(JSr=>{"use strict";p();var KSr;Object.defineProperty(JSr,"__esModule",{value:!0});JSr.randomUUID=eNa;var ZDa=require("node:crypto"),XDa=typeof((KSr=globalThis?.crypto)===null||KSr===void 0?void 0:KSr.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):ZDa.randomUUID;function eNa(){return XDa()}a(eNa,"randomUUID")});var Bki=I(Mg=>{"use strict";p();var ZSr,XSr,e1r,t1r;Object.defineProperty(Mg,"__esModule",{value:!0});Mg.isReactNative=Mg.isNodeRuntime=Mg.isNodeLike=Mg.isBun=Mg.isDeno=Mg.isWebWorker=Mg.isBrowser=void 0;Mg.isBrowser=typeof window<"u"&&typeof window.document<"u";Mg.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((ZSr=self.constructor)===null||ZSr===void 0?void 0:ZSr.name)==="DedicatedWorkerGlobalScope"||((XSr=self.constructor)===null||XSr===void 0?void 0:XSr.name)==="ServiceWorkerGlobalScope"||((e1r=self.constructor)===null||e1r===void 0?void 0:e1r.name)==="SharedWorkerGlobalScope");Mg.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";Mg.isBun=typeof Bun<"u"&&typeof Bun.version<"u";Mg.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((t1r=globalThis.process.versions)===null||t1r===void 0)&&t1r.node);Mg.isNodeRuntime=Mg.isNodeLike&&!Mg.isBun&&!Mg.isDeno;Mg.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var Fki=I(TAt=>{"use strict";p();Object.defineProperty(TAt,"__esModule",{value:!0});TAt.uint8ArrayToString=tNa;TAt.stringToUint8Array=rNa;function tNa(t,e){return Buffer.from(t).toString(e)}a(tNa,"uint8ArrayToString");function rNa(t,e){return Buffer.from(t,e)}a(rNa,"stringToUint8Array")});var Uki=I(IAt=>{"use strict";p();Object.defineProperty(IAt,"__esModule",{value:!0});IAt.Sanitizer=void 0;var nNa=bAt(),r1r="REDACTED",iNa=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],oNa=["api-version"],n1r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=iNa.concat(e),r=oNa.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||(0,nNa.isObject)(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,r1r);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=r1r;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=r1r;return r}};IAt.Sanitizer=n1r});var xAt=I(Ta=>{"use strict";p();Object.defineProperty(Ta,"__esModule",{value:!0});Ta.Sanitizer=Ta.uint8ArrayToString=Ta.stringToUint8Array=Ta.isWebWorker=Ta.isReactNative=Ta.isDeno=Ta.isNodeRuntime=Ta.isNodeLike=Ta.isBun=Ta.isBrowser=Ta.randomUUID=Ta.computeSha256Hmac=Ta.computeSha256Hash=Ta.isError=Ta.isObject=Ta.getRandomIntegerInclusive=Ta.calculateRetryDelay=void 0;var sNa=Dki();Object.defineProperty(Ta,"calculateRetryDelay",{enumerable:!0,get:a(function(){return sNa.calculateRetryDelay},"get")});var aNa=VSr();Object.defineProperty(Ta,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return aNa.getRandomIntegerInclusive},"get")});var cNa=bAt();Object.defineProperty(Ta,"isObject",{enumerable:!0,get:a(function(){return cNa.isObject},"get")});var lNa=Nki();Object.defineProperty(Ta,"isError",{enumerable:!0,get:a(function(){return lNa.isError},"get")});var Qki=Oki();Object.defineProperty(Ta,"computeSha256Hash",{enumerable:!0,get:a(function(){return Qki.computeSha256Hash},"get")});Object.defineProperty(Ta,"computeSha256Hmac",{enumerable:!0,get:a(function(){return Qki.computeSha256Hmac},"get")});var uNa=Lki();Object.defineProperty(Ta,"randomUUID",{enumerable:!0,get:a(function(){return uNa.randomUUID},"get")});var ire=Bki();Object.defineProperty(Ta,"isBrowser",{enumerable:!0,get:a(function(){return ire.isBrowser},"get")});Object.defineProperty(Ta,"isBun",{enumerable:!0,get:a(function(){return ire.isBun},"get")});Object.defineProperty(Ta,"isNodeLike",{enumerable:!0,get:a(function(){return ire.isNodeLike},"get")});Object.defineProperty(Ta,"isNodeRuntime",{enumerable:!0,get:a(function(){return ire.isNodeRuntime},"get")});Object.defineProperty(Ta,"isDeno",{enumerable:!0,get:a(function(){return ire.isDeno},"get")});Object.defineProperty(Ta,"isReactNative",{enumerable:!0,get:a(function(){return ire.isReactNative},"get")});Object.defineProperty(Ta,"isWebWorker",{enumerable:!0,get:a(function(){return ire.isWebWorker},"get")});var qki=Fki();Object.defineProperty(Ta,"stringToUint8Array",{enumerable:!0,get:a(function(){return qki.stringToUint8Array},"get")});Object.defineProperty(Ta,"uint8ArrayToString",{enumerable:!0,get:a(function(){return qki.uint8ArrayToString},"get")});var dNa=Uki();Object.defineProperty(Ta,"Sanitizer",{enumerable:!0,get:a(function(){return dNa.Sanitizer},"get")})});var jki=I(i1r=>{"use strict";p();Object.defineProperty(i1r,"__esModule",{value:!0});i1r.cancelablePromiseRace=fNa;async function fNa(t,e){var r,n;let o=new AbortController;function s(){o.abort()}a(s,"abortHandler"),(r=e?.abortSignal)===null||r===void 0||r.addEventListener("abort",s);try{return await Promise.race(t.map(c=>c({abortSignal:o.signal})))}finally{o.abort(),(n=e?.abortSignal)===null||n===void 0||n.removeEventListener("abort",s)}}a(fNa,"cancelablePromiseRace")});var Hki=I(wAt=>{"use strict";p();Object.defineProperty(wAt,"__esModule",{value:!0});wAt.AbortError=void 0;var o1r=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};wAt.AbortError=o1r});var I4e=I(RAt=>{"use strict";p();Object.defineProperty(RAt,"__esModule",{value:!0});RAt.AbortError=void 0;var pNa=Hki();Object.defineProperty(RAt,"AbortError",{enumerable:!0,get:a(function(){return pNa.AbortError},"get")})});var a1r=I(s1r=>{"use strict";p();Object.defineProperty(s1r,"__esModule",{value:!0});s1r.createAbortablePromise=mNa;var hNa=I4e();function mNa(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new hNa.AbortError(o??"The operation was aborted."))}a(l,"rejectOnAbort");function u(){n?.removeEventListener("abort",d)}a(u,"removeListeners");function d(){r?.(),u(),l()}if(a(d,"onAbort"),n?.aborted)return l();try{t(f=>{u(),s(f)},f=>{u(),c(f)})}catch(f){c(f)}n?.addEventListener("abort",d)})}a(mNa,"createAbortablePromise")});var Gki=I(kAt=>{"use strict";p();Object.defineProperty(kAt,"__esModule",{value:!0});kAt.delay=_Na;kAt.calculateRetryDelay=ENa;var gNa=a1r(),ANa=xAt(),yNa="The delay was aborted.";function _Na(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,gNa.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??yNa})}a(_Na,"delay");function ENa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,ANa.getRandomIntegerInclusive)(0,n/2)}}a(ENa,"calculateRetryDelay")});var $ki=I(c1r=>{"use strict";p();Object.defineProperty(c1r,"__esModule",{value:!0});c1r.getErrorMessage=CNa;var vNa=xAt();function CNa(t){if((0,vNa.isError)(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}a(CNa,"getErrorMessage")});var Wki=I(x4e=>{"use strict";p();Object.defineProperty(x4e,"__esModule",{value:!0});x4e.isDefined=l1r;x4e.isObjectWithProperties=bNa;x4e.objectHasProperty=Vki;function l1r(t){return typeof t<"u"&&t!==null}a(l1r,"isDefined");function bNa(t,e){if(!l1r(t)||typeof t!="object")return!1;for(let r of e)if(!Vki(t,r))return!1;return!0}a(bNa,"isObjectWithProperties");function Vki(t,e){return l1r(t)&&typeof t=="object"&&e in t}a(Vki,"objectHasProperty")});var gL=I(ms=>{"use strict";p();Object.defineProperty(ms,"__esModule",{value:!0});ms.isWebWorker=ms.isReactNative=ms.isNodeRuntime=ms.isNodeLike=ms.isNode=ms.isDeno=ms.isBun=ms.isBrowser=ms.objectHasProperty=ms.isObjectWithProperties=ms.isDefined=ms.getErrorMessage=ms.delay=ms.createAbortablePromise=ms.cancelablePromiseRace=void 0;ms.calculateRetryDelay=RNa;ms.computeSha256Hash=kNa;ms.computeSha256Hmac=PNa;ms.getRandomIntegerInclusive=DNa;ms.isError=NNa;ms.isObject=MNa;ms.randomUUID=ONa;ms.uint8ArrayToString=LNa;ms.stringToUint8Array=BNa;var SNa=(Y3(),Wa(jQ)),Iy=SNa.__importStar(xAt()),TNa=jki();Object.defineProperty(ms,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return TNa.cancelablePromiseRace},"get")});var INa=a1r();Object.defineProperty(ms,"createAbortablePromise",{enumerable:!0,get:a(function(){return INa.createAbortablePromise},"get")});var xNa=Gki();Object.defineProperty(ms,"delay",{enumerable:!0,get:a(function(){return xNa.delay},"get")});var wNa=$ki();Object.defineProperty(ms,"getErrorMessage",{enumerable:!0,get:a(function(){return wNa.getErrorMessage},"get")});var u1r=Wki();Object.defineProperty(ms,"isDefined",{enumerable:!0,get:a(function(){return u1r.isDefined},"get")});Object.defineProperty(ms,"isObjectWithProperties",{enumerable:!0,get:a(function(){return u1r.isObjectWithProperties},"get")});Object.defineProperty(ms,"objectHasProperty",{enumerable:!0,get:a(function(){return u1r.objectHasProperty},"get")});function RNa(t,e){return Iy.calculateRetryDelay(t,e)}a(RNa,"calculateRetryDelay");function kNa(t,e){return Iy.computeSha256Hash(t,e)}a(kNa,"computeSha256Hash");function PNa(t,e,r){return Iy.computeSha256Hmac(t,e,r)}a(PNa,"computeSha256Hmac");function DNa(t,e){return Iy.getRandomIntegerInclusive(t,e)}a(DNa,"getRandomIntegerInclusive");function NNa(t){return Iy.isError(t)}a(NNa,"isError");function MNa(t){return Iy.isObject(t)}a(MNa,"isObject");function ONa(){return Iy.randomUUID()}a(ONa,"randomUUID");ms.isBrowser=Iy.isBrowser;ms.isBun=Iy.isBun;ms.isDeno=Iy.isDeno;ms.isNode=Iy.isNodeLike;ms.isNodeLike=Iy.isNodeLike;ms.isNodeRuntime=Iy.isNodeRuntime;ms.isReactNative=Iy.isReactNative;ms.isWebWorker=Iy.isWebWorker;function LNa(t,e){return Iy.uint8ArrayToString(t,e)}a(LNa,"uint8ArrayToString");function BNa(t,e){return Iy.stringToUint8Array(t,e)}a(BNa,"stringToUint8Array")});var DAt=I(PAt=>{"use strict";p();Object.defineProperty(PAt,"__esModule",{value:!0});PAt.Sanitizer=void 0;var FNa=gL(),d1r="REDACTED",UNa=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],QNa=["api-version"],f1r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=UNa.concat(e),r=QNa.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||(0,FNa.isObject)(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,d1r);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=d1r;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=d1r;return r}};PAt.Sanitizer=f1r});var p1r=I(IAe=>{"use strict";p();Object.defineProperty(IAe,"__esModule",{value:!0});IAe.logPolicyName=void 0;IAe.logPolicy=HNa;var qNa=nre(),jNa=DAt();IAe.logPolicyName="logPolicy";function HNa(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:qNa.logger.info,n=new jNa.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:IAe.logPolicyName,async sendRequest(o,s){if(!r.enabled)return s(o);r(`Request: ${n.sanitize(o)}`);let c=await s(o);return r(`Response status code: ${c.status}`),r(`Headers: ${n.sanitize(c.headers)}`),c}}}a(HNa,"logPolicy")});var h1r=I(xAe=>{"use strict";p();Object.defineProperty(xAe,"__esModule",{value:!0});xAe.redirectPolicyName=void 0;xAe.redirectPolicy=GNa;xAe.redirectPolicyName="redirectPolicy";var zki=["GET","HEAD"];function GNa(t={}){let{maxRetries:e=20}=t;return{name:xAe.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return Yki(n,o,e)}}}a(GNa,"redirectPolicy");async function Yki(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&zki.includes(o.method)||s===302&&zki.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(NAt,"__esModule",{value:!0});NAt.getHeaderName=$Na;NAt.setPlatformSpecificData=VNa;var Kki=(Y3(),Wa(jQ)),m1r=Kki.__importStar(require("node:os")),g1r=Kki.__importStar(require("node:process"));function $Na(){return"User-Agent"}a($Na,"getHeaderName");async function VNa(t){if(g1r&&g1r.versions){let e=g1r.versions;e.bun?t.set("Bun",e.bun):e.deno?t.set("Deno",e.deno):e.node&&t.set("Node",e.node)}t.set("OS",`(${m1r.arch()}-${m1r.type()}-${m1r.release()})`)}a(VNa,"setPlatformSpecificData")});var C$=I(wAe=>{"use strict";p();Object.defineProperty(wAe,"__esModule",{value:!0});wAe.DEFAULT_RETRY_POLICY_COUNT=wAe.SDK_VERSION=void 0;wAe.SDK_VERSION="1.16.3";wAe.DEFAULT_RETRY_POLICY_COUNT=3});var A1r=I(MAt=>{"use strict";p();Object.defineProperty(MAt,"__esModule",{value:!0});MAt.getUserAgentHeaderName=YNa;MAt.getUserAgentValue=KNa;var Zki=Jki(),WNa=C$();function zNa(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(zNa,"getUserAgentString");function YNa(){return(0,Zki.getHeaderName)()}a(YNa,"getUserAgentHeaderName");async function KNa(t){let e=new Map;e.set("core-rest-pipeline",WNa.SDK_VERSION),await(0,Zki.setPlatformSpecificData)(e);let r=zNa(e);return t?`${t} ${r}`:r}a(KNa,"getUserAgentValue")});var y1r=I(RAe=>{"use strict";p();Object.defineProperty(RAe,"__esModule",{value:!0});RAe.userAgentPolicyName=void 0;RAe.userAgentPolicy=JNa;var ePi=A1r(),Xki=(0,ePi.getUserAgentHeaderName)();RAe.userAgentPolicyName="userAgentPolicy";function JNa(t={}){let e=(0,ePi.getUserAgentValue)(t.userAgentPrefix);return{name:RAe.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(Xki)||r.headers.set(Xki,await e),n(r)}}}a(JNa,"userAgentPolicy")});var OAt=I(kAe=>{"use strict";p();Object.defineProperty(kAe,"__esModule",{value:!0});kAe.isNodeReadableStream=tPi;kAe.isWebReadableStream=rPi;kAe.isReadableStream=ZNa;kAe.isBlob=XNa;function tPi(t){return!!(t&&typeof t.pipe=="function")}a(tPi,"isNodeReadableStream");function rPi(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(rPi,"isWebReadableStream");function ZNa(t){return tPi(t)||rPi(t)}a(ZNa,"isReadableStream");function XNa(t){return typeof t.stream=="function"}a(XNa,"isBlob")});var _1r=I(w4e=>{"use strict";p();Object.defineProperty(w4e,"__esModule",{value:!0});w4e.getRawContent=nMa;w4e.createFileFromStream=iMa;w4e.createFile=oMa;var eMa=gL(),tMa=OAt(),nPi={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},LAt=Symbol("rawContent");function rMa(t){return typeof t[LAt]=="function"}a(rMa,"hasRawContent");function nMa(t){return rMa(t)?t[LAt]():t.stream()}a(nMa,"getRawContent");function iMa(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},nPi),{type:(n=r.type)!==null&&n!==void 0?n:"",lastModified:(o=r.lastModified)!==null&&o!==void 0?o:new Date().getTime(),webkitRelativePath:(s=r.webkitRelativePath)!==null&&s!==void 0?s:"",size:(c=r.size)!==null&&c!==void 0?c:-1,name:e,stream:a(()=>{let l=t();if((0,tMa.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[LAt]:t})}a(iMa,"createFileFromStream");function oMa(t,e,r={}){var n,o,s;return eMa.isNodeLike?Object.assign(Object.assign({},nPi),{type:(n=r.type)!==null&&n!==void 0?n:"",lastModified:(o=r.lastModified)!==null&&o!==void 0?o:new Date().getTime(),webkitRelativePath:(s=r.webkitRelativePath)!==null&&s!==void 0?s:"",size:t.byteLength,name:e,arrayBuffer:a(async()=>t.buffer,"arrayBuffer"),stream:a(()=>new Blob([t]).stream(),"stream"),[LAt]:()=>t}):new File([t],e,r)}a(oMa,"createFile")});var sPi=I(v1r=>{"use strict";p();Object.defineProperty(v1r,"__esModule",{value:!0});v1r.concat=uMa;var N6=(Y3(),Wa(jQ)),E1r=require("node:stream"),sMa=OAt(),aMa=_1r();function iPi(){return N6.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield N6.__await(e.read());if(r)return yield N6.__await(void 0);yield yield N6.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(iPi,"streamAsyncIterator");function cMa(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=iPi.bind(t)),t.values||(t.values=iPi.bind(t))}a(cMa,"makeAsyncIterable");function lMa(t){return t instanceof ReadableStream?(cMa(t),E1r.Readable.fromWeb(t)):t}a(lMa,"ensureNodeStream");function oPi(t){return t instanceof Uint8Array?E1r.Readable.from(Buffer.from(t)):(0,sMa.isBlob)(t)?oPi((0,aMa.getRawContent)(t)):lMa(t)}a(oPi,"toStream");async function uMa(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(oPi);return E1r.Readable.from((function(){return N6.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,N6.__asyncValues(d)),u;u=yield N6.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield N6.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield N6.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(uMa,"concat")});var C1r=I(PAe=>{"use strict";p();Object.defineProperty(PAe,"__esModule",{value:!0});PAe.multipartPolicyName=void 0;PAe.multipartPolicy=vMa;var ore=gL(),dMa=sPi(),fMa=OAt();function pMa(){return`----AzSDKFormBoundary${(0,ore.randomUUID)()}`}a(pMa,"generateBoundary");function hMa(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(hMa,"encodeHeaders");function mMa(t){return t instanceof Uint8Array?t.byteLength:(0,fMa.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(mMa,"getLength");function gMa(t){let e=0;for(let r of t){let n=mMa(r);if(n===void 0)return;e+=n}return e}a(gMa,"getTotalLength");async function AMa(t,e,r){let n=[(0,ore.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,ore.stringToUint8Array)(`\r -`,"utf-8"),(0,ore.stringToUint8Array)(hMa(s.headers),"utf-8"),(0,ore.stringToUint8Array)(`\r -`,"utf-8"),s.body,(0,ore.stringToUint8Array)(`\r ---${r}`,"utf-8")]),(0,ore.stringToUint8Array)(`--\r +`),r+=c;break}}})}catch{this._isEnabled=!1,mL.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=URi.createServer,r=QRi.createServer,n=this._isEnabled;URi.createServer=function(o){var s=o;return s&&(o=a(function(c,l){var u=l.write,d=c.method=="GET";l.write=a(function(m,g,A){try{if(n&&d){var y=zR.getContentEncodingFromHeaders(l),_=void 0;if(typeof g=="string"&&(_=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,_));else if(y.length){var E=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,E)}}}catch(v){mL.warn("Inject snippet error: "+v)}return u.apply(l,arguments)},"wrap");var f=l.end;return l.end=a(function(m,g,A){if(n&&d)try{if(n&&d){var y=zR.getContentEncodingFromHeaders(l),_=void 0;if(typeof g=="string"&&(_=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,_));else if(y.length){var E=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,E)}}}catch(v){mL.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},QRi.createServer=function(o,s){var c=s;if(c)return s=a(function(l,u){var d=l.method=="GET",f=u.write,h=u.end;return u.write=a(function(g,A,y){try{if(n&&d){var _=zR.getContentEncodingFromHeaders(u),E=void 0;if(typeof A=="string"&&(E=A),_==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=this.InjectWebSnippet(u,g,void 0,E));else if(_.length){var v=_[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(S){mL.warn("Inject snippet error: "+S)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var _=zR.getContentEncodingFromHeaders(u),E=void 0;if(typeof A=="string"&&(E=A),_==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,void 0,E));else if(_.length){var v=_[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(S){mL.warn("Inject snippet error: "+S)}return h.apply(u,arguments)},"wrap"),c(l,u)},"httpsRequestListener"),r(o,s)}},t.prototype.ValidateInjection=function(e,r){try{if(!e||!r||e.statusCode!=200)return!1;var n=zR.isContentTypeHeaderHtml(e);if(!n)return!1;var o=r.slice().toString();if(o.indexOf("")>=0&&o.indexOf("")>=0&&o.indexOf(t._aiUrl)<0&&o.indexOf(t._aiDeprecatedUrl)<0)return!0}catch(s){mL.info("validate injections error: "+s)}return!1},t.prototype.InjectWebSnippet=function(e,r,n,o){try{var s=!!n;if(s)e.removeHeader("Content-Length"),r=this._getInjectedCompressBuffer(e,r,n),e.setHeader("Content-Length",r.length);else{var c=r.toString(),l=c.indexOf("");if(l<0)return r;var u=zR.insertSnippetByIndex(l,c,t._snippet);if(typeof r=="string")e.removeHeader("Content-Length"),r=u,e.setHeader("Content-Length",Buffer.byteLength(r));else if(Buffer.isBuffer(r)){var d=o||"utf8",f=zR.isBufferType(r,d);if(f){e.removeHeader("Content-Length");var h=Buffer.from(u).toString(d);r=Buffer.from(h,d),e.setHeader("Content-Length",r.length)}}}}catch(m){mL.warn("Failed to inject web snippet and change content-lenght headers. Exception:"+m)}return r},t.prototype._getInjectedCompressBuffer=function(e,r,n){try{switch(n){case zR.contentEncodingMethod.GZIP:var o=_Ae.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=_Ae.gzipSync(s)}break;case zR.contentEncodingMethod.DEFLATE:var c=_Ae.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=_Ae.deflateSync(l)}break;case zR.contentEncodingMethod.BR:var u=zR.getBrotliDecompressSync(_Ae),d=zR.getBrotliCompressSync(_Ae);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){mL.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();HRi.exports=S2a});var VRi=I((TSr,$Ri)=>{"use strict";p();var T2a=TSr&&TSr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),YR=require("url"),SSr=Z_(),I2a=Cy(),x2a=Y0e(),w2a=rbr(),R2a=Ote(),k2a=(function(t){T2a(e,t);function e(r,n){var o=t.call(this)||this;return n&&n.method&&r&&(o.method=n.method,o.url=e._getUrlFromRequestOptions(r,n),o.startTime=+new Date),o}return a(e,"HttpDependencyParser"),e.prototype.onError=function(r){this._setStatus(void 0,r)},e.prototype.onResponse=function(r){this._setStatus(r.statusCode,void 0),this.correlationId=I2a.getCorrelationContextTarget(r,x2a.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=SSr.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new YR.URL(this.url);l.search=void 0,l.hash=void 0,o+=" "+l.pathname,c=l.hostname,l.port&&(c+=":"+l.port)}catch{}this.correlationId?(s=SSr.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==R2a.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=SSr.RemoteDependencyDataConstants.TYPE_HTTP;var u={id:n,name:o,data:this.url,duration:this.duration,success:this._isSuccess(),resultCode:this.statusCode?this.statusCode.toString():null,properties:this.properties||{},dependencyTypeName:s,target:c};if(r&&r.time?u.time=r.time:this.startTime&&(u.time=new Date(this.startTime)),r){for(var d in r)u[d]||(u[d]=r[d]);if(r.properties)for(var d in r.properties)u.properties[d]=r.properties[d]}return u},e._getUrlFromRequestOptions=function(r,n){if(typeof r=="string")if(r.indexOf("http://")===0||r.indexOf("https://")===0)try{r=new YR.URL(r)}catch{}else try{var o=new YR.URL("http://"+r);o.port==="443"?r=new YR.URL("https://"+r):r=new YR.URL("http://"+r)}catch{}else{if(r&&typeof YR.URL=="function"&&r instanceof YR.URL)return YR.format(r);var s=r;r={},s&&Object.keys(s).forEach(function(u){r[u]=s[u]})}if(r.path&&r.host)try{var c=new YR.URL(r.path,"http://"+r.host+r.path);r.pathname=c.pathname,r.search=c.search}catch{}if(r.path&&r.hostname&&!r.host)try{var c=new YR.URL(r.path,"http://"+r.hostname+r.path);r.pathname=c.pathname,r.search=c.search}catch{}if(r.host&&r.port)try{var l=new YR.URL("http://".concat(r.host));!l.port&&r.port&&(r.hostname=r.host,delete r.host)}catch{}return r.protocol=r.protocol||n.agent&&n.agent.protocol||n.protocol||void 0,r.hostname=r.hostname||"localhost",YR.format(r)},e})(w2a);$Ri.exports=k2a});var WRi=I(EAe=>{"use strict";p();var AAt=EAe&&EAe.__assign||function(){return AAt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var O2a=k6&&k6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L2a=k6&&k6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),B2a=k6&&k6.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&O2a(e,t,r);return L2a(e,t),e};Object.defineProperty(k6,"__esModule",{value:!0});k6.spanToTelemetryContract=G2a;var zRi=require("url"),LD=(go(),Wa(A6)),Ts=(Xgt(),Wa(fCr)),R6=B2a(xd()),F2a=WRi(),U2a=Cy();function Q2a(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=U2a.stringify(s)),e}a(Q2a,"createPropertiesFromSpan");function q2a(t){return t===Ts.DbSystemValues.DB2||t===Ts.DbSystemValues.DERBY||t===Ts.DbSystemValues.MARIADB||t===Ts.DbSystemValues.MSSQL||t===Ts.DbSystemValues.ORACLE||t===Ts.DbSystemValues.SQLITE||t===Ts.DbSystemValues.OTHER_SQL||t===Ts.DbSystemValues.HSQLDB||t===Ts.DbSystemValues.H2}a(q2a,"isSqlDB");function YRi(t){var e=t.attributes[Ts.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[Ts.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[Ts.SemanticAttributes.HTTP_SCHEME],o=t.attributes[Ts.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[Ts.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[Ts.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[Ts.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[Ts.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(YRi,"getUrl");function xSr(t){var e=t.attributes[Ts.SemanticAttributes.PEER_SERVICE],r=t.attributes[Ts.SemanticAttributes.HTTP_HOST],n=t.attributes[Ts.SemanticAttributes.HTTP_URL],o=t.attributes[Ts.SemanticAttributes.NET_PEER_NAME],s=t.attributes[Ts.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(xSr,"getDependencyTarget");function j2a(t){var e={name:t.name,success:t.status.code!=LD.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===LD.SpanKind.PRODUCER&&(e.dependencyTypeName=R6.DependencyTypeName.QueueMessage),t.kind===LD.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=R6.DependencyTypeName.InProc);var r=t.attributes[Ts.SemanticAttributes.HTTP_METHOD],n=t.attributes[Ts.SemanticAttributes.DB_SYSTEM],o=t.attributes[Ts.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=R6.DependencyTypeName.Http;var s=t.attributes[Ts.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new zRi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=YRi(t);var u=t.attributes[Ts.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=xSr(t);if(d){try{var f=new RegExp(/(https?)(:\/\/.*)(:\d+)(\S*)/),h=f.exec(d);if(h!=null){var m=h[1],g=h[3];(m=="https"&&g==":443"||m=="http"&&g==":80")&&(d=h[1]+h[2]+h[4])}}catch{}e.target="".concat(d)}}else if(n){String(n)===Ts.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===Ts.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===Ts.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===Ts.DbSystemValues.REDIS?e.dependencyTypeName="redis":q2a(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[Ts.SemanticAttributes.DB_STATEMENT],y=t.attributes[Ts.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=xSr(t),_=t.attributes[Ts.SemanticAttributes.DB_NAME];d?e.target=_?"".concat(d,"|").concat(_):"".concat(d):e.target=_?"".concat(_):"".concat(n)}else if(o){e.dependencyTypeName=R6.DependencyTypeName.Grpc;var E=t.attributes[Ts.SemanticAttributes.RPC_GRPC_STATUS_CODE];E&&(e.resultCode=String(E));var d=xSr(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(j2a,"createDependencyData");function H2a(t){var e={name:t.name,success:t.status.code!=LD.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[Ts.SemanticAttributes.HTTP_METHOD],n=t.attributes[Ts.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==LD.SpanKind.SERVER){var o=t.attributes[Ts.SemanticAttributes.HTTP_ROUTE],s=t.attributes[Ts.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new zRi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=YRi(t);var l=t.attributes[Ts.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(H2a,"createRequestData");function G2a(t){var e;switch(t.kind){case LD.SpanKind.CLIENT:case LD.SpanKind.PRODUCER:case LD.SpanKind.INTERNAL:e=j2a(t);break;case LD.SpanKind.SERVER:case LD.SpanKind.CONSUMER:e=H2a(t);break}var r=t.spanContext?t.spanContext():t.context(),n="".concat(r.spanId),o=Math.round(t.duration[0]*1e3+t.duration[1]/1e6);return e.id=n,e.duration=o,e.properties=Q2a(t),t.attributes[R6.AzNamespace]&&(t.kind===LD.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat(R6.DependencyTypeName.InProc," | ").concat(t.attributes[R6.AzNamespace])),t.attributes[R6.AzNamespace]===R6.MicrosoftEventHub&&(0,F2a.parseEventHubSpan)(t,e)),e}a(G2a,"spanToTelemetryContract")});var ZRi=I(E$=>{"use strict";p();var vAe=E$&&E$.__assign||function(){return vAe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var V2a=EI&&EI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),W2a=EI&&EI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),z2a=EI&&EI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&V2a(e,t,r);return W2a(e,t),e};Object.defineProperty(EI,"__esModule",{value:!0});EI.subscriber=void 0;EI.enable=X2a;var E4e=(go(),Wa(A6)),Y2a=xd(),wSr=Pp(),K2a=z2a(KRi()),J2a=ZRi(),zte=[],Z2a=a(function(t){try{var e=t.data,r=K2a.spanToTelemetryContract(e);J2a.AsyncScopeManager.with(e,function(){zte.forEach(function(n){e.kind===E4e.SpanKind.SERVER||e.kind===E4e.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===E4e.SpanKind.CLIENT||e.kind===E4e.SpanKind.INTERNAL||e.kind===E4e.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");EI.subscriber=Z2a;function X2a(t,e){if(t){var r=zte.find(function(n){return n==e});if(r)return;zte.length===0&&wSr.channel.subscribe("azure-coretracing",EI.subscriber,wSr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(Y2a.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),zte.push(e)}else zte=zte.filter(function(n){return n!=e}),zte.length===0&&wSr.channel.unsubscribe("azure-coretracing",EI.subscriber)}a(X2a,"enable")});var eki=I(Kte=>{"use strict";p();Object.defineProperty(Kte,"__esModule",{value:!0});Kte.subscriber=void 0;Kte.enable=rDa;var eDa=xd(),RSr=Pp(),Yte=[],tDa=a(function(t){t.data.event.commandName!=="ismaster"&&Yte.forEach(function(e){var r=t.data.startedData&&t.data.startedData.databaseName||"Unknown database";e.trackDependency({target:r,data:t.data.event.commandName,name:t.data.event.commandName,duration:t.data.event.duration,success:t.data.succeeded,resultCode:t.data.succeeded?"0":"1",time:t.data.startedData.time,dependencyTypeName:"mongodb"})})},"subscriber");Kte.subscriber=tDa;function rDa(t,e){if(t){var r=Yte.find(function(n){return n==e});if(r)return;Yte.length===0&&RSr.channel.subscribe("mongodb",Kte.subscriber,RSr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(eDa.StatsbeatInstrumentation.MONGODB)}),Yte.push(e)}else Yte=Yte.filter(function(n){return n!=e}),Yte.length===0&&RSr.channel.unsubscribe("mongodb",Kte.subscriber)}a(rDa,"enable")});var tki=I(Zte=>{"use strict";p();Object.defineProperty(Zte,"__esModule",{value:!0});Zte.subscriber=void 0;Zte.enable=oDa;var nDa=xd(),kSr=Pp(),Jte=[],iDa=a(function(t){Jte.forEach(function(e){var r=t.data.query||{},n=r.sql||"Unknown query",o=!t.data.err,s=r._connection||{},c=s.config||{},l=c.socketPath?c.socketPath:"".concat(c.host||"localhost",":").concat(c.port);e.trackDependency({target:l,data:n,name:n,duration:t.data.duration,success:o,resultCode:o?"0":"1",time:t.data.time,dependencyTypeName:"mysql"})})},"subscriber");Zte.subscriber=iDa;function oDa(t,e){if(t){var r=Jte.find(function(n){return n==e});if(r)return;Jte.length===0&&kSr.channel.subscribe("mysql",Zte.subscriber,kSr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(nDa.StatsbeatInstrumentation.MYSQL)}),Jte.push(e)}else Jte=Jte.filter(function(n){return n!=e}),Jte.length===0&&kSr.channel.unsubscribe("mysql",Zte.subscriber)}a(oDa,"enable")});var rki=I(ere=>{"use strict";p();Object.defineProperty(ere,"__esModule",{value:!0});ere.subscriber=void 0;ere.enable=cDa;var sDa=xd(),PSr=Pp(),Xte=[],aDa=a(function(t){Xte.forEach(function(e){t.data.commandObj.command!=="info"&&e.trackDependency({target:t.data.address,name:t.data.commandObj.command,data:t.data.commandObj.command,duration:t.data.duration,success:!t.data.err,resultCode:t.data.err?"1":"0",time:t.data.time,dependencyTypeName:"redis"})})},"subscriber");ere.subscriber=aDa;function cDa(t,e){if(t){var r=Xte.find(function(n){return n==e});if(r)return;Xte.length===0&&PSr.channel.subscribe("redis",ere.subscriber,PSr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(sDa.StatsbeatInstrumentation.REDIS)}),Xte.push(e)}else Xte=Xte.filter(function(n){return n!=e}),Xte.length===0&&PSr.channel.unsubscribe("redis",ere.subscriber)}a(cDa,"enable")});var nki=I(rre=>{"use strict";p();Object.defineProperty(rre,"__esModule",{value:!0});rre.subscriber=void 0;rre.enable=dDa;var lDa=xd(),DSr=Pp(),tre=[],uDa=a(function(t){tre.forEach(function(e){var r=t.data.query,n=r.preparable&&r.preparable.text||r.plan||r.text||"unknown query",o=!t.data.error,s="".concat(t.data.database.host,":").concat(t.data.database.port);e.trackDependency({target:s,data:n,name:n,duration:t.data.duration,success:o,resultCode:o?"0":"1",time:t.data.time,dependencyTypeName:"postgres"})})},"subscriber");rre.subscriber=uDa;function dDa(t,e){if(t){var r=tre.find(function(n){return n==e});if(r)return;tre.length===0&&DSr.channel.subscribe("postgres",rre.subscriber,DSr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(lDa.StatsbeatInstrumentation.POSTGRES)}),tre.push(e)}else tre=tre.filter(function(n){return n!=e}),tre.length===0&&DSr.channel.unsubscribe("postgres",rre.subscriber)}a(dDa,"enable")});var SAe=I((P6,iki)=>{"use strict";p();var fDa=P6&&P6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pDa=P6&&P6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hDa=P6&&P6.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&fDa(e,t,r);return pDa(e,t),e},yAt=P6&&P6.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var oki=require("http"),ski=require("https"),aki=lu(),cki=Cy(),yDa=Y0e(),MSr=sbr(),D6=m$(),_Da=dAt(),EDa=(function(){function t(e){if(t.INSTANCE)throw new Error("Server request tracking should be configured from the applicationInsights object");t.INSTANCE=this,this._client=e}return a(t,"AutoCollectHttpRequests"),t.prototype.enable=function(e){this._isEnabled=e,(this._isAutoCorrelating||this._isEnabled||_Da.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?D6.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&D6.CorrelationContextManager.disable(),this._isAutoCorrelating=e},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype.isAutoCorrelating=function(){return this._isAutoCorrelating},t.prototype._generateCorrelationContext=function(e){if(this._isAutoCorrelating)return D6.CorrelationContextManager.generateContextObject(e.getOperationId(this._client.context.tags),e.getRequestId(),e.getOperationName(this._client.context.tags),e.getCorrelationContextHeader(),e.getTraceparent(),e.getTracestate())},t.prototype._registerRequest=function(e,r,n){var o=this,s=new MSr(e),c=this._generateCorrelationContext(s);D6.CorrelationContextManager.runWithContext(c,function(){o._isEnabled&&(e[t.alreadyAutoCollectedFlag]=!0,t.trackRequest(o._client,{request:e,response:r},s)),typeof n=="function"&&n(e,r)})},t.prototype._initialize=function(){if(this._isInitialized=!0,!t.HANDLER_READY){t.HANDLER_READY=!0;var e=a(function(s){if(s){if(typeof s!="function")throw new Error("onRequest handler must be a function");return function(c,l){D6.CorrelationContextManager.wrapEmitter(c),D6.CorrelationContextManager.wrapEmitter(l);var u=c&&!c[t.alreadyAutoCollectedFlag];c&&u&&t.INSTANCE?t.INSTANCE._registerRequest(c,l,s):s(c,l)}}},"wrapOnRequestHandler"),r=a(function(s){var c=s.addListener.bind(s);s.addListener=function(l,u){switch(l){case"request":case"checkContinue":return c(l,e(u));default:return c(l,u)}},s.on=s.addListener},"wrapServerEventHandler"),n=oki.createServer;oki.createServer=function(s,c){if(c&&typeof c=="function"){var l=n(s,e(c));return r(l),l}else{var l=n(e(s));return r(l),l}};var o=ski.createServer;ski.createServer=function(s,c){var l=o(s,e(c));return r(l),l}}},t.trackRequestSync=function(e,r){if(!r.request||!r.response||!e){aki.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=D6.CorrelationContextManager.getCurrentContext(),o=new MSr(r.request,n&&n.operation.parentId);n&&(n.operation.id=o.getOperationId(e.context.tags)||n.operation.id,n.operation.name=o.getOperationName(e.context.tags)||n.operation.name,n.operation.parentId=o.getRequestId()||n.operation.parentId,n.customProperties.addHeaderData(o.getCorrelationContextHeader())),t.endRequest(e,o,r,r.duration,r.error)},t.trackRequest=function(e,r,n){if(!r.request||!r.response||!e){aki.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=D6.CorrelationContextManager.getCurrentContext(),s=n||new MSr(r.request,o&&o.operation.parentId);cki.canIncludeCorrelationHeader(e,s.getUrl())&&t.addResponseCorrelationIdHeader(e,r.response),o&&!n&&(o.operation.id=s.getOperationId(e.context.tags)||o.operation.id,o.operation.name=s.getOperationName(e.context.tags)||o.operation.name,o.operation.parentId=s.getOperationParentId(e.context.tags)||o.operation.parentId,o.customProperties.addHeaderData(s.getCorrelationContextHeader())),r.response.once&&r.response.once("finish",function(){t.endRequest(e,s,r,null,null)}),r.request.on&&r.request.on("error",function(c){t.endRequest(e,s,r,null,c)}),r.request.on&&r.request.on("aborted",function(){var c="The request has been aborted and the network socket has closed.";t.endRequest(e,s,r,null,c)})},t.addResponseCorrelationIdHeader=function(e,r){if(e.config&&e.config.correlationId&&r.getHeader&&r.setHeader&&!r.headersSent){var n=r.getHeader(yDa.requestContextHeader);cki.safeIncludeCorrelationHeader(e,r,n)}},t.endRequest=function(e,r,n,o,s){if(!n.isProcessed){n.isProcessed=!0,s?r.onError(s,o):r.onResponse(n.response,o);var c=r.getRequestTelemetry(n);if(c.tagOverrides=r.getRequestTags(e.context.tags),n.tagOverrides)for(var l in n.tagOverrides)c.tagOverrides[l]=n.tagOverrides[l];var u=r.getLegacyRootId();u&&(c.properties.ai_legacyRootId=u),c.contextObjects=c.contextObjects||{},c.contextObjects["http.ServerRequest"]=n.request,c.contextObjects["http.ServerResponse"]=n.response,e.trackRequest(c)}},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1,D6.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();lki.exports=EDa});var fki=I((BSr,dki)=>{"use strict";p();var KR=BSr&&BSr.__assign||function(){return KR=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0?r:null,InstrumentationKey:n.instrumentationKey||"",Metrics:e.length>0?e:null,InvariantVersion:1,Timestamp:"/Date(".concat(Date.now(),")/"),Version:o.tags[o.keys.internalSdkVersion],StreamId:bDa,MachineName:s,Instance:c,RoleName:l};return u},t.createQuickPulseMetric=function(e){var r;return r={Name:e.name,Value:e.value,Weight:e.count||1},r},t.telemetryEnvelopeToQuickPulseDocument=function(e){switch(e.data.baseType){case nre.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case nre.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case nre.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case nre.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case nre.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=KR(KR({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=KR(KR({},r),{Message:e.data.baseData.message,SeverityLevel:nre.SeverityLevel[n]});return o},t.createQuickPulseExceptionDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.exceptions,o="",s="",c="";n&&n.length>0&&(n[0].parsedStack&&n[0].parsedStack.length>0?n[0].parsedStack.forEach(function(u){o+=u.assembly+` +`}):n[0].stack&&n[0].stack.length>0&&(o=n[0].stack),s=n[0].message,c=n[0].typeName);var l=KR(KR({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=KR(KR({},r),{Name:n.name,Success:n.success,Duration:n.duration,ResponseCode:n.responseCode,OperationName:n.name});return o},t.createQuickPulseDependencyDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=KR(KR({},r),{Name:n.name,Target:n.target,Success:n.success,Duration:n.duration,ResultCode:n.resultCode,CommandName:n.data,OperationName:r.OperationId,DependencyTypeName:n.type});return o},t.createQuickPulseDocument=function(e){var r,n,o,s;e.data.baseType?(n=uki.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=uki.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):CDa.warn("Document type invalid; not sending live metric document",e.data.baseType),o=e.tags[t.keys.operationId],s=t.aggregateProperties(e);var c={DocumentType:r,__type:n,OperationId:o,Version:"1.0",Properties:s};return c},t.aggregateProperties=function(e){var r=[],n=e.data.baseData.measurements||{};for(var o in n)if(n.hasOwnProperty(o)){var s=n[o],c={key:o,value:s};r.push(c)}var l=e.data.baseData.properties||{};for(var o in l)if(l.hasOwnProperty(o)){var s=l[o],c={key:o,value:s};r.push(c)}return r},t.keys=new nre.ContextTagKeys,t})();dki.exports=SDa});var hki=I((ZRp,pki)=>{"use strict";p();var TDa=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");pki.exports={getTransmissionTime:TDa}});var yki=I((b4e,Aki)=>{"use strict";p();var mki=b4e&&b4e.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},gki=b4e&&b4e.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0?r:this._config.quickPulseHost,m.method=JR.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[JR.time]=wDa.getTransmissionTime(),g["Content-Type"]="application/json",g["Content-Length"]=Buffer.byteLength(c),g),m),s&&s.length>0&&s.forEach(function(_){return l.headers[_.name]=_.value}),o!=="post")return[3,4];if(u=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!u)return[3,4];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,u.addAuthorizationHeader(l)];case 2:return y.sent(),[3,4];case 3:return d=y.sent(),f="Failed to get AAD bearer token for the Application. Error:",FSr.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=USr.tlsRestrictedAgent,h=IDa.request(l,function(_){if(_.statusCode==200){var E=_.headers[JR.subscribed]==="true",v=null;try{v=_.headers[JR.endpointRedirect]?new RDa.URL(_.headers[JR.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+USr.dumpObj(T))}var S=_.headers[JR.pollingIntervalHint]?parseInt(_.headers[JR.pollingIntervalHint].toString()):null;A._consecutiveErrors=0,n(E,_,v,S)}else A._onError("StatusCode:"+_.statusCode+" StatusMessage:"+_.statusMessage),n()}),h.on("error",function(_){A._onError(_),n()}),h.write(c),h.end(),[2]}})})},t.prototype._onError=function(e){this._consecutiveErrors++;var r="Transient error connecting to the Live Metrics endpoint. This packet will not appear in your Live Metrics Stream. Error:";this._consecutiveErrors%t.MAX_QPS_FAILURES_BEFORE_WARN===0?(r="Live Metrics endpoint could not be reached ".concat(this._consecutiveErrors," consecutive times. Most recent error:"),FSr.warn(t.TAG,r,e)):FSr.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();Aki.exports=kDa});var Ski=I((S4e,bki)=>{"use strict";p();var _ki=S4e&&S4e.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Eki=S4e&&S4e.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0?this._pollingIntervalHint:t.PING_INTERVAL,o=this._isCollectingData?t.POST_INTERVAL:n,this._isCollectingData&&Date.now()-this._lastSuccessTime>=t.MAX_POST_WAIT_TIME&&!this._lastSendSucceeded?(this._isCollectingData=!1,o=t.FALLBACK_INTERVAL):!this._isCollectingData&&Date.now()-this._lastSuccessTime>=t.MAX_PING_WAIT_TIME&&!this._lastSendSucceeded&&(o=t.FALLBACK_INTERVAL),this._lastSendSucceeded=null,this._handle=setTimeout(this._goQuickPulse.bind(this),o),this._handle.unref(),[2]}})})},t.prototype._ping=function(e){this._sender.ping(e,this._redirectedHost,this._quickPulseDone.bind(this))},t.prototype._post=function(e){return _ki(this,void 0,void 0,function(){return Eki(this,function(r){switch(r.label){case 0:return[4,this._sender.post(e,this._redirectedHost,this._quickPulseDone.bind(this))];case 1:return r.sent(),[2]}})})},t.prototype._quickPulseDone=function(e,r,n,o){e!=null?(this._isCollectingData!==e&&(vki.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,vki.info("Redirecting endpoint to: ",n)),o&&o>0&&(this._pollingIntervalHint=o),r&&r.statusCode<300&&r.statusCode>=200?(this._lastSuccessTime=Date.now(),this._lastSendSucceeded=!0):this._lastSendSucceeded=!1):this._lastSendSucceeded=!1},t.MAX_POST_WAIT_TIME=2e4,t.MAX_PING_WAIT_TIME=6e4,t.FALLBACK_INTERVAL=6e4,t.PING_INTERVAL=5e3,t.POST_INTERVAL=1e3,t})();bki.exports=NDa});var Iki=I(TAe=>{"use strict";p();var vAt=TAe&&TAe.__assign||function(){return vAt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var xki=C$&&C$.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},wki=C$&&C$.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var UDa=Ote(),kki=bSr(),QDa=lu(),Pki=xd(),qDa=require("url"),jDa=bmt(),HDa=(function(){function t(e){this._endpointBase=Pki.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=kki.parse(e),o=kki.parse(r),s=!n.instrumentationkey&&Object.keys(n).length>0?null:e,c=this._instrumentationKey;this.instrumentationKey=n.instrumentationkey||s||o.instrumentationkey||c;var l="".concat(this.endpointUrl||n.ingestionendpoint||o.ingestionendpoint||this._endpointBase);l.endsWith("/")&&(l=l.slice(0,-1)),this.endpointUrl="".concat(l,"/v2.1/track"),this.maxBatchSize=this.maxBatchSize||250,this.maxBatchIntervalMs=this.maxBatchIntervalMs||15e3,this.disableAppInsights=this.disableAppInsights||!1,this.samplingPercentage=this.samplingPercentage||100,this.correlationIdRetryIntervalMs=this.correlationIdRetryIntervalMs||30*1e3,this.enableWebInstrumentation=this.enableWebInstrumentation||this.enableAutoWebSnippetInjection||!1,this.webInstrumentationConfig=this.webInstrumentationConfig||null,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation,this.correlationHeaderExcludedDomains=this.correlationHeaderExcludedDomains||["*.core.windows.net","*.core.chinacloudapi.cn","*.core.cloudapi.de","*.core.usgovcloudapi.net","*.core.microsoft.scloud","*.core.eaglex.ic.gov"],this.ignoreLegacyHeaders=this.ignoreLegacyHeaders||!1,this.profileQueryEndpoint=n.ingestionendpoint||o.ingestionendpoint||process.env[t.ENV_profileQueryEndpoint]||this._endpointBase,this.quickPulseHost=this.quickPulseHost||n.liveendpoint||o.liveendpoint||process.env[t.ENV_quickPulseHost]||Pki.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new qDa.URL(this.quickPulseHost).host),this.aadAudience=n.aadaudience||o.aadaudience}return a(t,"Config"),Object.defineProperty(t.prototype,"profileQueryEndpoint",{get:a(function(){return this._profileQueryEndpoint},"get"),set:a(function(e){this._profileQueryEndpoint=e,this.correlationId=UDa.correlationIdPrefix},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instrumentationKey",{get:a(function(){return this._instrumentationKey},"get"),set:a(function(e){t._validateInstrumentationKey(e)||QDa.warn("An invalid instrumentation key was provided. There may be resulting telemetry loss",this.instrumentationKey),this._instrumentationKey=e},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webSnippetConnectionString",{get:a(function(){return this._webInstrumentationConnectionString},"get"),set:a(function(e){this._webInstrumentationConnectionString=e},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webInstrumentationConnectionString",{get:a(function(){return this._webInstrumentationConnectionString},"get"),set:a(function(e){this._webInstrumentationConnectionString=e},"set"),enumerable:!1,configurable:!0}),t.prototype._mergeConfig=function(){var e=jDa.JsonConfig.getInstance();this._connectionString=e.connectionString,this._instrumentationKey=e.instrumentationKey,this.correlationHeaderExcludedDomains=e.correlationHeaderExcludedDomains,this.correlationIdRetryIntervalMs=e.correlationIdRetryIntervalMs,this.disableAllExtendedMetrics=e.disableAllExtendedMetrics,this.disableAppInsights=e.disableAppInsights,this.disableStatsbeat=e.disableStatsbeat,this.distributedTracingMode=e.distributedTracingMode,this.enableAutoCollectConsole=e.enableAutoCollectConsole,this.enableLoggerErrorToTrace=e.enableLoggerErrorToTrace,this.enableAutoCollectDependencies=e.enableAutoCollectDependencies,this.enableAutoCollectIncomingRequestAzureFunctions=e.enableAutoCollectIncomingRequestAzureFunctions,this.enableAutoCollectExceptions=e.enableAutoCollectExceptions,this.enableAutoCollectExtendedMetrics=e.enableAutoCollectExtendedMetrics,this.enableAutoCollectExternalLoggers=e.enableAutoCollectExternalLoggers,this.enableAutoCollectHeartbeat=e.enableAutoCollectHeartbeat,this.enableAutoCollectPerformance=e.enableAutoCollectPerformance,this.enableAutoCollectPreAggregatedMetrics=e.enableAutoCollectPreAggregatedMetrics,this.enableAutoCollectRequests=e.enableAutoCollectRequests,this.enableAutoDependencyCorrelation=e.enableAutoDependencyCorrelation,this.enableInternalDebugLogging=e.enableInternalDebugLogging,this.enableInternalWarningLogging=e.enableInternalWarningLogging,this.enableResendInterval=e.enableResendInterval,this.enableMaxBytesOnDisk=e.enableMaxBytesOnDisk,this.enableSendLiveMetrics=e.enableSendLiveMetrics,this.enableUseAsyncHooks=e.enableUseAsyncHooks,this.enableUseDiskRetryCaching=e.enableUseDiskRetryCaching,this.endpointUrl=e.endpointUrl,this.extendedMetricDisablers=e.extendedMetricDisablers,this.ignoreLegacyHeaders=e.ignoreLegacyHeaders,this.maxBatchIntervalMs=e.maxBatchIntervalMs,this.maxBatchSize=e.maxBatchSize,this.proxyHttpUrl=e.proxyHttpUrl,this.proxyHttpsUrl=e.proxyHttpsUrl,this.quickPulseHost=e.quickPulseHost,this.samplingPercentage=e.samplingPercentage,this.enableWebInstrumentation=e.enableWebInstrumentation,this._webInstrumentationConnectionString=e.webInstrumentationConnectionString,this.webInstrumentationConfig=e.webInstrumentationConfig,this.webInstrumentationSrc=e.webInstrumentationSrc},t._validateInstrumentationKey=function(e){var r="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",n=new RegExp(r);return n.test(e)},t.ENV_azurePrefix="APPSETTING_",t.ENV_iKey="APPINSIGHTS_INSTRUMENTATIONKEY",t.legacy_ENV_iKey="APPINSIGHTS_INSTRUMENTATION_KEY",t.ENV_profileQueryEndpoint="APPINSIGHTS_PROFILE_QUERY_ENDPOINT",t.ENV_quickPulseHost="APPINSIGHTS_QUICKPULSE_HOST",t})();Dki.exports=HDa});var $Sr=I(GSr=>{"use strict";p();Object.defineProperty(GSr,"__esModule",{value:!0});GSr.createEmptyPipeline=GDa;var Nki=new Set(["Deserialize","Serialize","Retry","Sign"]),HSr=class t{static{a(this,"HttpPipeline")}constructor(e){var r;this._policies=[],this._policies=(r=e?.slice(0))!==null&&r!==void 0?r:[],this._orderedPolicies=void 0}addPolicy(e,r={}){if(r.phase&&r.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(r.phase&&!Nki.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!Nki.has(r.afterPhase))throw new Error(`Invalid afterPhase name: ${r.afterPhase}`);this._policies.push({policy:e,options:r}),this._orderedPolicies=void 0}removePolicy(e){let r=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(r.push(n.policy),!1):!0),this._orderedPolicies=void 0,r}sendRequest(e,r){return this.getOrderedPolicies().reduceRight((s,c)=>l=>c.sendRequest(l,s),s=>e.sendRequest(s))(r)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],r=new Map;function n(A){return{name:A,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}a(n,"createPhase");let o=n("Serialize"),s=n("None"),c=n("Deserialize"),l=n("Retry"),u=n("Sign"),d=[o,s,c,l,u];function f(A){return A==="Retry"?l:A==="Serialize"?o:A==="Deserialize"?c:A==="Sign"?u:s}a(f,"getPhase");for(let A of this._policies){let y=A.policy,_=A.options,E=y.name;if(r.has(E))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};_.afterPhase&&(v.afterPhase=f(_.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(E,v),f(_.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:_}=A,E=y.name,v=r.get(E);if(!v)throw new Error(`Missing node for policy ${E}`);if(_.afterPolicies)for(let S of _.afterPolicies){let T=r.get(S);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(_.beforePolicies)for(let S of _.beforePolicies){let T=r.get(S);T&&(T.dependsOn.add(v),v.dependants.add(T))}}function h(A){A.hasRun=!0;for(let y of A.policies)if(!(y.afterPhase&&(!y.afterPhase.hasRun||y.afterPhase.policies.size))&&y.dependsOn.size===0){e.push(y.policy);for(let _ of y.dependants)_.dependsOn.delete(y);r.delete(y.policy.name),A.policies.delete(y)}}a(h,"walkPhase");function m(){for(let A of d){if(h(A),A.policies.size>0&&A!==s){s.hasRun||h(s);return}A.hasAfterPolicies&&h(s)}}a(m,"walkPhases");let g=0;for(;r.size>0;){g++;let A=e.length;if(m(),e.length<=A&&g>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function GDa(){return HSr.create()}a(GDa,"createEmptyPipeline")});var ire=I(bAt=>{"use strict";p();Object.defineProperty(bAt,"__esModule",{value:!0});bAt.logger=void 0;var $Da=qgt();bAt.logger=(0,$Da.createClientLogger)("core-rest-pipeline")});var WSr=I(VSr=>{"use strict";p();Object.defineProperty(VSr,"__esModule",{value:!0});VSr.getRandomIntegerInclusive=VDa;function VDa(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(VDa,"getRandomIntegerInclusive")});var Mki=I(zSr=>{"use strict";p();Object.defineProperty(zSr,"__esModule",{value:!0});zSr.calculateRetryDelay=zDa;var WDa=WSr();function zDa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,WDa.getRandomIntegerInclusive)(0,n/2)}}a(zDa,"calculateRetryDelay")});var SAt=I(YSr=>{"use strict";p();Object.defineProperty(YSr,"__esModule",{value:!0});YSr.isObject=YDa;function YDa(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(YDa,"isObject")});var Oki=I(KSr=>{"use strict";p();Object.defineProperty(KSr,"__esModule",{value:!0});KSr.isError=JDa;var KDa=SAt();function JDa(t){if((0,KDa.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(JDa,"isError")});var Bki=I(TAt=>{"use strict";p();Object.defineProperty(TAt,"__esModule",{value:!0});TAt.computeSha256Hmac=ZDa;TAt.computeSha256Hash=XDa;var Lki=require("node:crypto");async function ZDa(t,e,r){let n=Buffer.from(t,"base64");return(0,Lki.createHmac)("sha256",n).update(e).digest(r)}a(ZDa,"computeSha256Hmac");async function XDa(t,e){return(0,Lki.createHash)("sha256").update(t).digest(e)}a(XDa,"computeSha256Hash")});var Fki=I(ZSr=>{"use strict";p();var JSr;Object.defineProperty(ZSr,"__esModule",{value:!0});ZSr.randomUUID=rNa;var eNa=require("node:crypto"),tNa=typeof((JSr=globalThis?.crypto)===null||JSr===void 0?void 0:JSr.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):eNa.randomUUID;function rNa(){return tNa()}a(rNa,"randomUUID")});var Uki=I(Og=>{"use strict";p();var XSr,e1r,t1r,r1r;Object.defineProperty(Og,"__esModule",{value:!0});Og.isReactNative=Og.isNodeRuntime=Og.isNodeLike=Og.isBun=Og.isDeno=Og.isWebWorker=Og.isBrowser=void 0;Og.isBrowser=typeof window<"u"&&typeof window.document<"u";Og.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((XSr=self.constructor)===null||XSr===void 0?void 0:XSr.name)==="DedicatedWorkerGlobalScope"||((e1r=self.constructor)===null||e1r===void 0?void 0:e1r.name)==="ServiceWorkerGlobalScope"||((t1r=self.constructor)===null||t1r===void 0?void 0:t1r.name)==="SharedWorkerGlobalScope");Og.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";Og.isBun=typeof Bun<"u"&&typeof Bun.version<"u";Og.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((r1r=globalThis.process.versions)===null||r1r===void 0)&&r1r.node);Og.isNodeRuntime=Og.isNodeLike&&!Og.isBun&&!Og.isDeno;Og.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var Qki=I(IAt=>{"use strict";p();Object.defineProperty(IAt,"__esModule",{value:!0});IAt.uint8ArrayToString=nNa;IAt.stringToUint8Array=iNa;function nNa(t,e){return Buffer.from(t).toString(e)}a(nNa,"uint8ArrayToString");function iNa(t,e){return Buffer.from(t,e)}a(iNa,"stringToUint8Array")});var qki=I(xAt=>{"use strict";p();Object.defineProperty(xAt,"__esModule",{value:!0});xAt.Sanitizer=void 0;var oNa=SAt(),n1r="REDACTED",sNa=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],aNa=["api-version"],i1r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=sNa.concat(e),r=aNa.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||(0,oNa.isObject)(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,n1r);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=n1r;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=n1r;return r}};xAt.Sanitizer=i1r});var wAt=I(Ta=>{"use strict";p();Object.defineProperty(Ta,"__esModule",{value:!0});Ta.Sanitizer=Ta.uint8ArrayToString=Ta.stringToUint8Array=Ta.isWebWorker=Ta.isReactNative=Ta.isDeno=Ta.isNodeRuntime=Ta.isNodeLike=Ta.isBun=Ta.isBrowser=Ta.randomUUID=Ta.computeSha256Hmac=Ta.computeSha256Hash=Ta.isError=Ta.isObject=Ta.getRandomIntegerInclusive=Ta.calculateRetryDelay=void 0;var cNa=Mki();Object.defineProperty(Ta,"calculateRetryDelay",{enumerable:!0,get:a(function(){return cNa.calculateRetryDelay},"get")});var lNa=WSr();Object.defineProperty(Ta,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return lNa.getRandomIntegerInclusive},"get")});var uNa=SAt();Object.defineProperty(Ta,"isObject",{enumerable:!0,get:a(function(){return uNa.isObject},"get")});var dNa=Oki();Object.defineProperty(Ta,"isError",{enumerable:!0,get:a(function(){return dNa.isError},"get")});var jki=Bki();Object.defineProperty(Ta,"computeSha256Hash",{enumerable:!0,get:a(function(){return jki.computeSha256Hash},"get")});Object.defineProperty(Ta,"computeSha256Hmac",{enumerable:!0,get:a(function(){return jki.computeSha256Hmac},"get")});var fNa=Fki();Object.defineProperty(Ta,"randomUUID",{enumerable:!0,get:a(function(){return fNa.randomUUID},"get")});var ore=Uki();Object.defineProperty(Ta,"isBrowser",{enumerable:!0,get:a(function(){return ore.isBrowser},"get")});Object.defineProperty(Ta,"isBun",{enumerable:!0,get:a(function(){return ore.isBun},"get")});Object.defineProperty(Ta,"isNodeLike",{enumerable:!0,get:a(function(){return ore.isNodeLike},"get")});Object.defineProperty(Ta,"isNodeRuntime",{enumerable:!0,get:a(function(){return ore.isNodeRuntime},"get")});Object.defineProperty(Ta,"isDeno",{enumerable:!0,get:a(function(){return ore.isDeno},"get")});Object.defineProperty(Ta,"isReactNative",{enumerable:!0,get:a(function(){return ore.isReactNative},"get")});Object.defineProperty(Ta,"isWebWorker",{enumerable:!0,get:a(function(){return ore.isWebWorker},"get")});var Hki=Qki();Object.defineProperty(Ta,"stringToUint8Array",{enumerable:!0,get:a(function(){return Hki.stringToUint8Array},"get")});Object.defineProperty(Ta,"uint8ArrayToString",{enumerable:!0,get:a(function(){return Hki.uint8ArrayToString},"get")});var pNa=qki();Object.defineProperty(Ta,"Sanitizer",{enumerable:!0,get:a(function(){return pNa.Sanitizer},"get")})});var Gki=I(o1r=>{"use strict";p();Object.defineProperty(o1r,"__esModule",{value:!0});o1r.cancelablePromiseRace=hNa;async function hNa(t,e){var r,n;let o=new AbortController;function s(){o.abort()}a(s,"abortHandler"),(r=e?.abortSignal)===null||r===void 0||r.addEventListener("abort",s);try{return await Promise.race(t.map(c=>c({abortSignal:o.signal})))}finally{o.abort(),(n=e?.abortSignal)===null||n===void 0||n.removeEventListener("abort",s)}}a(hNa,"cancelablePromiseRace")});var $ki=I(RAt=>{"use strict";p();Object.defineProperty(RAt,"__esModule",{value:!0});RAt.AbortError=void 0;var s1r=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};RAt.AbortError=s1r});var I4e=I(kAt=>{"use strict";p();Object.defineProperty(kAt,"__esModule",{value:!0});kAt.AbortError=void 0;var mNa=$ki();Object.defineProperty(kAt,"AbortError",{enumerable:!0,get:a(function(){return mNa.AbortError},"get")})});var c1r=I(a1r=>{"use strict";p();Object.defineProperty(a1r,"__esModule",{value:!0});a1r.createAbortablePromise=ANa;var gNa=I4e();function ANa(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new gNa.AbortError(o??"The operation was aborted."))}a(l,"rejectOnAbort");function u(){n?.removeEventListener("abort",d)}a(u,"removeListeners");function d(){r?.(),u(),l()}if(a(d,"onAbort"),n?.aborted)return l();try{t(f=>{u(),s(f)},f=>{u(),c(f)})}catch(f){c(f)}n?.addEventListener("abort",d)})}a(ANa,"createAbortablePromise")});var Vki=I(PAt=>{"use strict";p();Object.defineProperty(PAt,"__esModule",{value:!0});PAt.delay=vNa;PAt.calculateRetryDelay=CNa;var yNa=c1r(),_Na=wAt(),ENa="The delay was aborted.";function vNa(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,yNa.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??ENa})}a(vNa,"delay");function CNa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,_Na.getRandomIntegerInclusive)(0,n/2)}}a(CNa,"calculateRetryDelay")});var Wki=I(l1r=>{"use strict";p();Object.defineProperty(l1r,"__esModule",{value:!0});l1r.getErrorMessage=SNa;var bNa=wAt();function SNa(t){if((0,bNa.isError)(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}a(SNa,"getErrorMessage")});var Yki=I(x4e=>{"use strict";p();Object.defineProperty(x4e,"__esModule",{value:!0});x4e.isDefined=u1r;x4e.isObjectWithProperties=TNa;x4e.objectHasProperty=zki;function u1r(t){return typeof t<"u"&&t!==null}a(u1r,"isDefined");function TNa(t,e){if(!u1r(t)||typeof t!="object")return!1;for(let r of e)if(!zki(t,r))return!1;return!0}a(TNa,"isObjectWithProperties");function zki(t,e){return u1r(t)&&typeof t=="object"&&e in t}a(zki,"objectHasProperty")});var gL=I(ms=>{"use strict";p();Object.defineProperty(ms,"__esModule",{value:!0});ms.isWebWorker=ms.isReactNative=ms.isNodeRuntime=ms.isNodeLike=ms.isNode=ms.isDeno=ms.isBun=ms.isBrowser=ms.objectHasProperty=ms.isObjectWithProperties=ms.isDefined=ms.getErrorMessage=ms.delay=ms.createAbortablePromise=ms.cancelablePromiseRace=void 0;ms.calculateRetryDelay=PNa;ms.computeSha256Hash=DNa;ms.computeSha256Hmac=NNa;ms.getRandomIntegerInclusive=MNa;ms.isError=ONa;ms.isObject=LNa;ms.randomUUID=BNa;ms.uint8ArrayToString=FNa;ms.stringToUint8Array=UNa;var INa=(Y3(),Wa(jQ)),Iy=INa.__importStar(wAt()),xNa=Gki();Object.defineProperty(ms,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return xNa.cancelablePromiseRace},"get")});var wNa=c1r();Object.defineProperty(ms,"createAbortablePromise",{enumerable:!0,get:a(function(){return wNa.createAbortablePromise},"get")});var RNa=Vki();Object.defineProperty(ms,"delay",{enumerable:!0,get:a(function(){return RNa.delay},"get")});var kNa=Wki();Object.defineProperty(ms,"getErrorMessage",{enumerable:!0,get:a(function(){return kNa.getErrorMessage},"get")});var d1r=Yki();Object.defineProperty(ms,"isDefined",{enumerable:!0,get:a(function(){return d1r.isDefined},"get")});Object.defineProperty(ms,"isObjectWithProperties",{enumerable:!0,get:a(function(){return d1r.isObjectWithProperties},"get")});Object.defineProperty(ms,"objectHasProperty",{enumerable:!0,get:a(function(){return d1r.objectHasProperty},"get")});function PNa(t,e){return Iy.calculateRetryDelay(t,e)}a(PNa,"calculateRetryDelay");function DNa(t,e){return Iy.computeSha256Hash(t,e)}a(DNa,"computeSha256Hash");function NNa(t,e,r){return Iy.computeSha256Hmac(t,e,r)}a(NNa,"computeSha256Hmac");function MNa(t,e){return Iy.getRandomIntegerInclusive(t,e)}a(MNa,"getRandomIntegerInclusive");function ONa(t){return Iy.isError(t)}a(ONa,"isError");function LNa(t){return Iy.isObject(t)}a(LNa,"isObject");function BNa(){return Iy.randomUUID()}a(BNa,"randomUUID");ms.isBrowser=Iy.isBrowser;ms.isBun=Iy.isBun;ms.isDeno=Iy.isDeno;ms.isNode=Iy.isNodeLike;ms.isNodeLike=Iy.isNodeLike;ms.isNodeRuntime=Iy.isNodeRuntime;ms.isReactNative=Iy.isReactNative;ms.isWebWorker=Iy.isWebWorker;function FNa(t,e){return Iy.uint8ArrayToString(t,e)}a(FNa,"uint8ArrayToString");function UNa(t,e){return Iy.stringToUint8Array(t,e)}a(UNa,"stringToUint8Array")});var NAt=I(DAt=>{"use strict";p();Object.defineProperty(DAt,"__esModule",{value:!0});DAt.Sanitizer=void 0;var QNa=gL(),f1r="REDACTED",qNa=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],jNa=["api-version"],p1r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=qNa.concat(e),r=jNa.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||(0,QNa.isObject)(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,f1r);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=f1r;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=f1r;return r}};DAt.Sanitizer=p1r});var h1r=I(IAe=>{"use strict";p();Object.defineProperty(IAe,"__esModule",{value:!0});IAe.logPolicyName=void 0;IAe.logPolicy=$Na;var HNa=ire(),GNa=NAt();IAe.logPolicyName="logPolicy";function $Na(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:HNa.logger.info,n=new GNa.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:IAe.logPolicyName,async sendRequest(o,s){if(!r.enabled)return s(o);r(`Request: ${n.sanitize(o)}`);let c=await s(o);return r(`Response status code: ${c.status}`),r(`Headers: ${n.sanitize(c.headers)}`),c}}}a($Na,"logPolicy")});var m1r=I(xAe=>{"use strict";p();Object.defineProperty(xAe,"__esModule",{value:!0});xAe.redirectPolicyName=void 0;xAe.redirectPolicy=VNa;xAe.redirectPolicyName="redirectPolicy";var Kki=["GET","HEAD"];function VNa(t={}){let{maxRetries:e=20}=t;return{name:xAe.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return Jki(n,o,e)}}}a(VNa,"redirectPolicy");async function Jki(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&Kki.includes(o.method)||s===302&&Kki.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(MAt,"__esModule",{value:!0});MAt.getHeaderName=WNa;MAt.setPlatformSpecificData=zNa;var Zki=(Y3(),Wa(jQ)),g1r=Zki.__importStar(require("node:os")),A1r=Zki.__importStar(require("node:process"));function WNa(){return"User-Agent"}a(WNa,"getHeaderName");async function zNa(t){if(A1r&&A1r.versions){let e=A1r.versions;e.bun?t.set("Bun",e.bun):e.deno?t.set("Deno",e.deno):e.node&&t.set("Node",e.node)}t.set("OS",`(${g1r.arch()}-${g1r.type()}-${g1r.release()})`)}a(zNa,"setPlatformSpecificData")});var b$=I(wAe=>{"use strict";p();Object.defineProperty(wAe,"__esModule",{value:!0});wAe.DEFAULT_RETRY_POLICY_COUNT=wAe.SDK_VERSION=void 0;wAe.SDK_VERSION="1.16.3";wAe.DEFAULT_RETRY_POLICY_COUNT=3});var y1r=I(OAt=>{"use strict";p();Object.defineProperty(OAt,"__esModule",{value:!0});OAt.getUserAgentHeaderName=JNa;OAt.getUserAgentValue=ZNa;var ePi=Xki(),YNa=b$();function KNa(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(KNa,"getUserAgentString");function JNa(){return(0,ePi.getHeaderName)()}a(JNa,"getUserAgentHeaderName");async function ZNa(t){let e=new Map;e.set("core-rest-pipeline",YNa.SDK_VERSION),await(0,ePi.setPlatformSpecificData)(e);let r=KNa(e);return t?`${t} ${r}`:r}a(ZNa,"getUserAgentValue")});var _1r=I(RAe=>{"use strict";p();Object.defineProperty(RAe,"__esModule",{value:!0});RAe.userAgentPolicyName=void 0;RAe.userAgentPolicy=XNa;var rPi=y1r(),tPi=(0,rPi.getUserAgentHeaderName)();RAe.userAgentPolicyName="userAgentPolicy";function XNa(t={}){let e=(0,rPi.getUserAgentValue)(t.userAgentPrefix);return{name:RAe.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(tPi)||r.headers.set(tPi,await e),n(r)}}}a(XNa,"userAgentPolicy")});var LAt=I(kAe=>{"use strict";p();Object.defineProperty(kAe,"__esModule",{value:!0});kAe.isNodeReadableStream=nPi;kAe.isWebReadableStream=iPi;kAe.isReadableStream=eMa;kAe.isBlob=tMa;function nPi(t){return!!(t&&typeof t.pipe=="function")}a(nPi,"isNodeReadableStream");function iPi(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(iPi,"isWebReadableStream");function eMa(t){return nPi(t)||iPi(t)}a(eMa,"isReadableStream");function tMa(t){return typeof t.stream=="function"}a(tMa,"isBlob")});var E1r=I(w4e=>{"use strict";p();Object.defineProperty(w4e,"__esModule",{value:!0});w4e.getRawContent=oMa;w4e.createFileFromStream=sMa;w4e.createFile=aMa;var rMa=gL(),nMa=LAt(),oPi={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},BAt=Symbol("rawContent");function iMa(t){return typeof t[BAt]=="function"}a(iMa,"hasRawContent");function oMa(t){return iMa(t)?t[BAt]():t.stream()}a(oMa,"getRawContent");function sMa(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},oPi),{type:(n=r.type)!==null&&n!==void 0?n:"",lastModified:(o=r.lastModified)!==null&&o!==void 0?o:new Date().getTime(),webkitRelativePath:(s=r.webkitRelativePath)!==null&&s!==void 0?s:"",size:(c=r.size)!==null&&c!==void 0?c:-1,name:e,stream:a(()=>{let l=t();if((0,nMa.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[BAt]:t})}a(sMa,"createFileFromStream");function aMa(t,e,r={}){var n,o,s;return rMa.isNodeLike?Object.assign(Object.assign({},oPi),{type:(n=r.type)!==null&&n!==void 0?n:"",lastModified:(o=r.lastModified)!==null&&o!==void 0?o:new Date().getTime(),webkitRelativePath:(s=r.webkitRelativePath)!==null&&s!==void 0?s:"",size:t.byteLength,name:e,arrayBuffer:a(async()=>t.buffer,"arrayBuffer"),stream:a(()=>new Blob([t]).stream(),"stream"),[BAt]:()=>t}):new File([t],e,r)}a(aMa,"createFile")});var cPi=I(C1r=>{"use strict";p();Object.defineProperty(C1r,"__esModule",{value:!0});C1r.concat=fMa;var N6=(Y3(),Wa(jQ)),v1r=require("node:stream"),cMa=LAt(),lMa=E1r();function sPi(){return N6.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield N6.__await(e.read());if(r)return yield N6.__await(void 0);yield yield N6.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(sPi,"streamAsyncIterator");function uMa(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=sPi.bind(t)),t.values||(t.values=sPi.bind(t))}a(uMa,"makeAsyncIterable");function dMa(t){return t instanceof ReadableStream?(uMa(t),v1r.Readable.fromWeb(t)):t}a(dMa,"ensureNodeStream");function aPi(t){return t instanceof Uint8Array?v1r.Readable.from(Buffer.from(t)):(0,cMa.isBlob)(t)?aPi((0,lMa.getRawContent)(t)):dMa(t)}a(aPi,"toStream");async function fMa(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(aPi);return v1r.Readable.from((function(){return N6.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,N6.__asyncValues(d)),u;u=yield N6.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield N6.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield N6.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(fMa,"concat")});var b1r=I(PAe=>{"use strict";p();Object.defineProperty(PAe,"__esModule",{value:!0});PAe.multipartPolicyName=void 0;PAe.multipartPolicy=bMa;var sre=gL(),pMa=cPi(),hMa=LAt();function mMa(){return`----AzSDKFormBoundary${(0,sre.randomUUID)()}`}a(mMa,"generateBoundary");function gMa(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r +`;return e}a(gMa,"encodeHeaders");function AMa(t){return t instanceof Uint8Array?t.byteLength:(0,hMa.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(AMa,"getLength");function yMa(t){let e=0;for(let r of t){let n=AMa(r);if(n===void 0)return;e+=n}return e}a(yMa,"getTotalLength");async function _Ma(t,e,r){let n=[(0,sre.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,sre.stringToUint8Array)(`\r +`,"utf-8"),(0,sre.stringToUint8Array)(gMa(s.headers),"utf-8"),(0,sre.stringToUint8Array)(`\r +`,"utf-8"),s.body,(0,sre.stringToUint8Array)(`\r +--${r}`,"utf-8")]),(0,sre.stringToUint8Array)(`--\r \r -`,"utf-8")],o=gMa(n);o&&t.headers.set("Content-Length",o),t.body=await(0,dMa.concat)(n)}a(AMa,"buildRequestBody");PAe.multipartPolicyName="multipartPolicy";var yMa=70,_Ma=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function EMa(t){if(t.length>yMa)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!_Ma.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(EMa,"assertValidBoundary");function vMa(){return{name:PAe.multipartPolicyName,async sendRequest(t,e){var r;if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,o=(r=t.headers.get("Content-Type"))!==null&&r!==void 0?r:"multipart/mixed",s=o.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!s)throw new Error(`Got multipart request body, but content-type header was not multipart: ${o}`);let[,c,l]=s;if(l&&n&&l!==n)throw new Error(`Multipart boundary was specified as ${l} in the header, but got ${n} in the request body`);return n??(n=l),n?EMa(n):n=pMa(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await AMa(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(vMa,"multipartPolicy")});var b1r=I(DAe=>{"use strict";p();Object.defineProperty(DAe,"__esModule",{value:!0});DAe.decompressResponsePolicyName=void 0;DAe.decompressResponsePolicy=CMa;DAe.decompressResponsePolicyName="decompressResponsePolicy";function CMa(){return{name:DAe.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(CMa,"decompressResponsePolicy")});var FAt=I(BAt=>{"use strict";p();Object.defineProperty(BAt,"__esModule",{value:!0});BAt.delay=TMa;BAt.parseHeaderValueAsNumber=IMa;var bMa=I4e(),SMa="The operation was aborted.";function TMa(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new bMa.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:SMa)),"rejectOnAbort"),u=a(()=>{r?.abortSignal&&c&&r.abortSignal.removeEventListener("abort",c)},"removeListeners");if(c=a(()=>(s&&clearTimeout(s),u(),l()),"onAborted"),r?.abortSignal&&r.abortSignal.aborted)return l();s=setTimeout(()=>{u(),n(e)},t),r?.abortSignal&&r.abortSignal.addEventListener("abort",c)})}a(TMa,"delay");function IMa(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(IMa,"parseHeaderValueAsNumber")});var QAt=I(UAt=>{"use strict";p();Object.defineProperty(UAt,"__esModule",{value:!0});UAt.isThrottlingRetryResponse=RMa;UAt.throttlingRetryStrategy=kMa;var xMa=FAt(),S1r="Retry-After",wMa=["retry-after-ms","x-ms-retry-after-ms",S1r];function aPi(t){if(t&&[429,503].includes(t.status))try{for(let o of wMa){let s=(0,xMa.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===S1r?1e3:1)}let e=t.headers.get(S1r);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(aPi,"getRetryAfterInMs");function RMa(t){return Number.isFinite(aPi(t))}a(RMa,"isThrottlingRetryResponse");function kMa(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=aPi(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(kMa,"throttlingRetryStrategy")});var qAt=I(R4e=>{"use strict";p();Object.defineProperty(R4e,"__esModule",{value:!0});R4e.exponentialRetryStrategy=OMa;R4e.isExponentialRetryResponse=cPi;R4e.isSystemError=lPi;var PMa=gL(),DMa=QAt(),NMa=1e3,MMa=1e3*64;function OMa(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:NMa,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:MMa,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=lPi(u),f=d&&t.ignoreSystemErrors,h=cPi(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,DMa.isThrottlingRetryResponse)(l)||!h)||m||f)return{skipStrategy:!0};if(u&&!d&&!h)return{errorToThrow:u};let A=s*Math.pow(2,c),y=Math.min(o,A);return s=y/2+(0,PMa.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(OMa,"exponentialRetryStrategy");function cPi(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(cPi,"isExponentialRetryResponse");function lPi(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(lPi,"isSystemError")});var NAe=I(T1r=>{"use strict";p();Object.defineProperty(T1r,"__esModule",{value:!0});T1r.retryPolicy=QMa;var LMa=FAt(),BMa=Qgt(),FMa=I4e(),uPi=C$(),dPi=(0,BMa.createClientLogger)("core-rest-pipeline retryPolicy"),UMa="retryPolicy";function QMa(t,e={maxRetries:uPi.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||dPi;return{name:UMa,async sendRequest(n,o){var s,c;let l,u,d=-1;e:for(;;){d+=1,l=void 0,u=void 0;try{r.info(`Retry ${d}: Attempting to send request`,n.requestId),l=await o(n),r.info(`Retry ${d}: Received a response from request`,n.requestId)}catch(f){if(r.error(`Retry ${d}: Received an error from request`,n.requestId),u=f,!f||u.name!=="RestError")throw f;l=u.response}if(!((s=n.abortSignal)===null||s===void 0)&&s.aborted)throw r.error(`Retry ${d}: Request aborted.`),new FMa.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:uPi.DEFAULT_RETRY_POLICY_COUNT)){if(r.info(`Retry ${d}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),u)throw u;if(l)return l;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${d}: Processing ${t.length} retry strategies.`);t:for(let f of t){let h=f.logger||dPi;h.info(`Retry ${d}: Processing retry strategy ${f.name}.`);let m=f.retry({retryCount:d,response:l,responseError:u});if(m.skipStrategy){h.info(`Retry ${d}: Skipped.`);continue t}let{errorToThrow:g,retryAfterInMs:A,redirectTo:y}=m;if(g)throw h.error(`Retry ${d}: Retry strategy ${f.name} throws error:`,g),g;if(A||A===0){h.info(`Retry ${d}: Retry strategy ${f.name} retries after ${A}`),await(0,LMa.delay)(A,void 0,{abortSignal:n.abortSignal});continue e}if(y){h.info(`Retry ${d}: Retry strategy ${f.name} redirects to ${y}`),n.url=y;continue e}}if(u)throw r.info("None of the retry strategies could work with the received error. Throwing it."),u;if(l)return r.info("None of the retry strategies could work with the received response. Returning it."),l}}}}a(QMa,"retryPolicy")});var I1r=I(MAe=>{"use strict";p();Object.defineProperty(MAe,"__esModule",{value:!0});MAe.defaultRetryPolicyName=void 0;MAe.defaultRetryPolicy=$Ma;var qMa=qAt(),jMa=QAt(),HMa=NAe(),GMa=C$();MAe.defaultRetryPolicyName="defaultRetryPolicy";function $Ma(t={}){var e;return{name:MAe.defaultRetryPolicyName,sendRequest:(0,HMa.retryPolicy)([(0,jMa.throttlingRetryStrategy)(),(0,qMa.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:GMa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a($Ma,"defaultRetryPolicy")});var k4e=I(w1r=>{"use strict";p();Object.defineProperty(w1r,"__esModule",{value:!0});w1r.createHttpHeaders=WMa;function jAt(t){return t.toLowerCase()}a(jAt,"normalizeName");function*VMa(t){for(let e of t.values())yield[e.name,e.value]}a(VMa,"headerIterator");var x1r=class{static{a(this,"HttpHeadersImpl")}constructor(e){if(this._headersMap=new Map,e)for(let r of Object.keys(e))this.set(r,e[r])}set(e,r){this._headersMap.set(jAt(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(jAt(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(jAt(e))}delete(e){this._headersMap.delete(jAt(e))}toJSON(e={}){let r={};if(e.preserveCase)for(let n of this._headersMap.values())r[n.name]=n.value;else for(let[n,o]of this._headersMap)r[n]=o.value;return r}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return VMa(this._headersMap)}};function WMa(t){return new x1r(t)}a(WMa,"createHttpHeaders")});var R1r=I(OAe=>{"use strict";p();Object.defineProperty(OAe,"__esModule",{value:!0});OAe.formDataPolicyName=void 0;OAe.formDataPolicy=YMa;var pPi=gL(),fPi=k4e();OAe.formDataPolicyName="formDataPolicy";function zMa(t){var e;let r={};for(let[n,o]of t.entries())(e=r[n])!==null&&e!==void 0||(r[n]=[]),r[n].push(o);return r}a(zMa,"formDataToFormDataMap");function YMa(){return{name:OAe.formDataPolicyName,async sendRequest(t,e){if(pPi.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=zMa(t.body),t.body=void 0),t.formData){let r=t.headers.get("Content-Type");r&&r.indexOf("application/x-www-form-urlencoded")!==-1?t.body=KMa(t.formData):await JMa(t.formData,t),t.formData=void 0}return e(t)}}}a(YMa,"formDataPolicy");function KMa(t){let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.append(r,o.toString());else e.append(r,n.toString());return e.toString()}a(KMa,"wwwFormUrlEncode");async function JMa(t,e){let r=e.headers.get("Content-Type");if(r&&!r.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",r??"multipart/form-data");let n=[];for(let[o,s]of Object.entries(t))for(let c of Array.isArray(s)?s:[s])if(typeof c=="string")n.push({headers:(0,fPi.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,pPi.stringToUint8Array)(c,"utf-8")});else{if(c==null||typeof c!="object")throw new Error(`Unexpected value for key ${o}: ${c}. Value should be serialized to string first.`);{let l=c.name||"blob",u=(0,fPi.createHttpHeaders)();u.set("Content-Disposition",`form-data; name="${o}"; filename="${l}"`),u.set("Content-Type",c.type||"application/octet-stream"),n.push({headers:u,body:c})}}e.multipartBody={parts:n}}a(JMa,"prepareFormData")});var k1r=I(ZR=>{"use strict";p();Object.defineProperty(ZR,"__esModule",{value:!0});ZR.globalNoProxyList=ZR.proxyPolicyName=void 0;ZR.loadNoProxy=yPi;ZR.getDefaultProxySettings=aOa;ZR.proxyPolicy=lOa;var ZMa=k6t(),XMa=P6t(),eOa=nre(),tOa="HTTPS_PROXY",rOa="HTTP_PROXY",nOa="ALL_PROXY",iOa="NO_PROXY";ZR.proxyPolicyName="proxyPolicy";ZR.globalNoProxyList=[];var gPi=!1,oOa=new Map;function HAt(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(HAt,"getEnvironmentValue");function APi(){if(!process)return;let t=HAt(tOa),e=HAt(nOa),r=HAt(rOa);return t||e||r}a(APi,"loadEnvironmentProxyValue");function sOa(t,e,r){if(e.length===0)return!1;let n=new URL(t).hostname;if(r?.has(n))return r.get(n);let o=!1;for(let s of e)s[0]==="."?(n.endsWith(s)||n.length===s.length-1&&n===s.slice(1))&&(o=!0):n===s&&(o=!0);return r?.set(n,o),o}a(sOa,"isBypassed");function yPi(){let t=HAt(iOa);return gPi=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(yPi,"loadNoProxy");function aOa(t){if(!t&&(t=APi(),!t))return;let e=new URL(t);return{host:(e.protocol?e.protocol+"//":"")+e.hostname,port:Number.parseInt(e.port||"80"),username:e.username,password:e.password}}a(aOa,"getDefaultProxySettings");function cOa(){let t=APi();return t?new URL(t):void 0}a(cOa,"getDefaultProxySettingsInternal");function hPi(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}a(hPi,"getUrlFromProxySettings");function mPi(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&eOa.logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let s=t.headers.toJSON();o?(e.httpProxyAgent||(e.httpProxyAgent=new XMa.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new ZMa.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(mPi,"setProxyAgentOnRequest");function lOa(t,e){gPi||ZR.globalNoProxyList.push(...yPi());let r=t?hPi(t):cOa(),n={};return{name:ZR.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!sOa(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:ZR.globalNoProxyList,e?.customNoProxyList?void 0:oOa)?mPi(o,n,r):o.proxySettings&&mPi(o,n,hPi(o.proxySettings)),s(o)}}}a(lOa,"proxyPolicy")});var P1r=I(LAe=>{"use strict";p();Object.defineProperty(LAe,"__esModule",{value:!0});LAe.setClientRequestIdPolicyName=void 0;LAe.setClientRequestIdPolicy=uOa;LAe.setClientRequestIdPolicyName="setClientRequestIdPolicy";function uOa(t="x-ms-client-request-id"){return{name:LAe.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(uOa,"setClientRequestIdPolicy")});var D1r=I(BAe=>{"use strict";p();Object.defineProperty(BAe,"__esModule",{value:!0});BAe.tlsPolicyName=void 0;BAe.tlsPolicy=dOa;BAe.tlsPolicyName="tlsPolicy";function dOa(t){return{name:BAe.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(dOa,"tlsPolicy")});var N1r=I(M6=>{"use strict";p();Object.defineProperty(M6,"__esModule",{value:!0});M6.TracingContextImpl=M6.knownContextKeys=void 0;M6.createTracingContext=fOa;M6.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function fOa(t={}){let e=new GAt(t.parentContext);return t.span&&(e=e.setValue(M6.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(M6.knownContextKeys.namespace,t.namespace)),e}a(fOa,"createTracingContext");var GAt=class t{static{a(this,"TracingContextImpl")}constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,r){let n=new t(this);return n._contextMap.set(e,r),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let r=new t(this);return r._contextMap.delete(e),r}};M6.TracingContextImpl=GAt});var M1r=I(FAe=>{"use strict";p();Object.defineProperty(FAe,"__esModule",{value:!0});FAe.createDefaultTracingSpan=_Pi;FAe.createDefaultInstrumenter=EPi;FAe.useInstrumenter=hOa;FAe.getInstrumenter=mOa;var pOa=N1r(),$At=SBt();function _Pi(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(_Pi,"createDefaultTracingSpan");function EPi(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:_Pi(),tracingContext:(0,pOa.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(EPi,"createDefaultInstrumenter");function hOa(t){$At.state.instrumenterImplementation=t}a(hOa,"useInstrumenter");function mOa(){return $At.state.instrumenterImplementation||($At.state.instrumenterImplementation=EPi()),$At.state.instrumenterImplementation}a(mOa,"getInstrumenter")});var vPi=I(L1r=>{"use strict";p();Object.defineProperty(L1r,"__esModule",{value:!0});L1r.createTracingClient=gOa;var VAt=M1r(),O1r=N1r();function gOa(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,VAt.getInstrumenter)().startSpan(d,Object.assign(Object.assign({},h),{packageName:r,packageVersion:n,tracingContext:(m=f?.tracingOptions)===null||m===void 0?void 0:m.tracingContext})),A=g.tracingContext,y=g.span;A.getValue(O1r.knownContextKeys.namespace)||(A=A.setValue(O1r.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(O1r.knownContextKeys.namespace));let _=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:_}}a(o,"startSpan");async function s(d,f,h,m){let{span:g,updatedOptions:A}=o(d,f,m);try{let y=await c(A.tracingOptions.tracingContext,()=>Promise.resolve(h(A,g)));return g.setStatus({status:"success"}),y}catch(y){throw g.setStatus({status:"error",error:y}),y}finally{g.end()}}a(s,"withSpan");function c(d,f,...h){return(0,VAt.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,VAt.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,VAt.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(gOa,"createTracingClient")});var CPi=I(UAe=>{"use strict";p();Object.defineProperty(UAe,"__esModule",{value:!0});UAe.createTracingClient=UAe.useInstrumenter=void 0;var AOa=M1r();Object.defineProperty(UAe,"useInstrumenter",{enumerable:!0,get:a(function(){return AOa.useInstrumenter},"get")});var yOa=vPi();Object.defineProperty(UAe,"createTracingClient",{enumerable:!0,get:a(function(){return yOa.createTracingClient},"get")})});var bPi=I(WAt=>{"use strict";p();Object.defineProperty(WAt,"__esModule",{value:!0});WAt.custom=void 0;var _Oa=require("node:util");WAt.custom=_Oa.inspect.custom});var zAt=I(P4e=>{"use strict";p();Object.defineProperty(P4e,"__esModule",{value:!0});P4e.RestError=void 0;P4e.isRestError=SOa;var EOa=gL(),vOa=bPi(),COa=DAt(),bOa=new COa.Sanitizer,QAe=class t extends Error{static{a(this,"RestError")}constructor(e,r={}){super(e),this.name="RestError",this.code=r.code,this.statusCode=r.statusCode,Object.defineProperty(this,"request",{value:r.request,enumerable:!1}),Object.defineProperty(this,"response",{value:r.response,enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}[vOa.custom](){return`RestError: ${this.message} - ${bOa.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};P4e.RestError=QAe;QAe.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";QAe.PARSE_ERROR="PARSE_ERROR";function SOa(t){return t instanceof QAe?!0:(0,EOa.isError)(t)&&t.name==="RestError"}a(SOa,"isRestError")});var B1r=I(qAe=>{"use strict";p();Object.defineProperty(qAe,"__esModule",{value:!0});qAe.tracingPolicyName=void 0;qAe.tracingPolicy=kOa;var TOa=CPi(),IOa=C$(),xOa=A1r(),YAt=nre(),D4e=gL(),wOa=zAt(),ROa=DAt();qAe.tracingPolicyName="tracingPolicy";function kOa(t={}){let e=(0,xOa.getUserAgentValue)(t.userAgentPrefix),r=new ROa.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=POa();return{name:qAe.tracingPolicyName,async sendRequest(o,s){var c,l;if(!n||!(!((c=o.tracingOptions)===null||c===void 0)&&c.tracingContext))return s(o);let u=await e,d={"http.url":r.sanitizeUrl(o.url),"http.method":o.method,"http.user_agent":u,requestId:o.requestId};u&&(d["http.user_agent"]=u);let{span:f,tracingContext:h}=(l=DOa(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return MOa(f,m),m}catch(m){throw NOa(f,m),m}}}}a(kOa,"tracingPolicy");function POa(){try{return(0,TOa.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:IOa.SDK_VERSION})}catch(t){YAt.logger.warning(`Error when creating the TracingClient: ${(0,D4e.getErrorMessage)(t)}`);return}}a(POa,"tryCreateTracingClient");function DOa(t,e,r){try{let{span:n,updatedOptions:o}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let s=t.createRequestHeaders(o.tracingOptions.tracingContext);for(let[c,l]of Object.entries(s))e.headers.set(c,l);return{span:n,tracingContext:o.tracingOptions.tracingContext}}catch(n){YAt.logger.warning(`Skipping creating a tracing span due to an error: ${(0,D4e.getErrorMessage)(n)}`);return}}a(DOa,"tryCreateSpan");function NOa(t,e){try{t.setStatus({status:"error",error:(0,D4e.isError)(e)?e:void 0}),(0,wOa.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){YAt.logger.warning(`Skipping tracing span processing due to an error: ${(0,D4e.getErrorMessage)(r)}`)}}a(NOa,"tryProcessError");function MOa(t,e){try{t.setAttribute("http.status_code",e.status);let r=e.headers.get("x-ms-request-id");r&&t.setAttribute("serviceRequestId",r),t.setStatus({status:"success"}),t.end()}catch(r){YAt.logger.warning(`Skipping tracing span processing due to an error: ${(0,D4e.getErrorMessage)(r)}`)}}a(MOa,"tryProcessResponse")});var IPi=I(F1r=>{"use strict";p();Object.defineProperty(F1r,"__esModule",{value:!0});F1r.createPipelineFromOptions=VOa;var OOa=p1r(),LOa=GSr(),BOa=h1r(),FOa=y1r(),SPi=C1r(),UOa=b1r(),QOa=I1r(),qOa=R1r(),TPi=gL(),jOa=k1r(),HOa=P1r(),GOa=D1r(),$Oa=B1r();function VOa(t){var e;let r=(0,LOa.createEmptyPipeline)();return TPi.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,GOa.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,jOa.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,UOa.decompressResponsePolicy)())),r.addPolicy((0,qOa.formDataPolicy)(),{beforePolicies:[SPi.multipartPolicyName]}),r.addPolicy((0,FOa.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,HOa.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,SPi.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,QOa.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,$Oa.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),TPi.isNodeLike&&r.addPolicy((0,BOa.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,OOa.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(VOa,"createPipelineFromOptions")});var DPi=I(JAt=>{"use strict";p();Object.defineProperty(JAt,"__esModule",{value:!0});JAt.getBodyLength=PPi;JAt.createNodeHttpClient=XOa;var j1r=(Y3(),Wa(jQ)),U1r=j1r.__importStar(require("node:http")),Q1r=j1r.__importStar(require("node:https")),xPi=j1r.__importStar(require("node:zlib")),WOa=require("node:stream"),wPi=I4e(),zOa=k4e(),O4e=zAt(),N4e=nre(),YOa={};function M4e(t){return t&&typeof t.pipe=="function"}a(M4e,"isReadableStream");function RPi(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(RPi,"isStreamComplete");function kPi(t){return t&&typeof t.byteLength=="number"}a(kPi,"isArrayBuffer");var KAt=class extends WOa.Transform{static{a(this,"ReportTransform")}_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(o){n(o)}}constructor(e){super(),this.loadedBytes=0,this.progressCallback=e}},q1r=class{static{a(this,"NodeHttpClient")}constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(e){var r,n,o;let s=new AbortController,c;if(e.abortSignal){if(e.abortSignal.aborted)throw new wPi.AbortError("The operation was aborted.");c=a(h=>{h.type==="abort"&&s.abort()},"abortListener"),e.abortSignal.addEventListener("abort",c)}e.timeout>0&&setTimeout(()=>{s.abort()},e.timeout);let l=e.headers.get("Accept-Encoding"),u=l?.includes("gzip")||l?.includes("deflate"),d=typeof e.body=="function"?e.body():e.body;if(d&&!e.headers.has("Content-Length")){let h=PPi(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let _=e.onUploadProgress,E=new KAt(_);E.on("error",v=>{N4e.logger.error("Error in upload progress",v)}),M4e(d)?d.pipe(E):E.end(d),d=E}let h=await this.makeRequest(e,s,d),m=KOa(h),A={status:(r=h.statusCode)!==null&&r!==void 0?r:0,headers:m,request:e};if(e.method==="HEAD")return h.resume(),A;f=u?JOa(h,m):h;let y=e.onDownloadProgress;if(y){let _=new KAt(y);_.on("error",E=>{N4e.logger.error("Error in download progress",E)}),f.pipe(_),f=_}return!((n=e.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((o=e.streamResponseStatusCodes)===null||o===void 0)&&o.has(A.status)?A.readableStreamBody=f:A.bodyAsText=await ZOa(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();M4e(d)&&(h=RPi(d));let m=Promise.resolve();M4e(f)&&(m=RPi(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{N4e.logger.warning("Error when cleaning up abortListener on httpRequest",g)})}}}makeRequest(e,r,n){var o;let s=new URL(e.url),c=s.protocol!=="https:";if(c&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let u={agent:(o=e.agent)!==null&&o!==void 0?o:this.getOrCreateAgent(e,c),hostname:s.hostname,path:`${s.pathname}${s.search}`,port:s.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0})};return new Promise((d,f)=>{let h=c?U1r.request(u,d):Q1r.request(u,d);h.once("error",m=>{var g;f(new O4e.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:O4e.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new wPi.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&M4e(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):kPi(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(N4e.logger.error("Unrecognized body type",n),f(new O4e.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?U1r.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new U1r.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return Q1r.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:YOa,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(N4e.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new Q1r.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function KOa(t){let e=(0,zOa.createHttpHeaders)();for(let r of Object.keys(t.headers)){let n=t.headers[r];Array.isArray(n)?n.length>0&&e.set(r,n[0]):n&&e.set(r,n)}return e}a(KOa,"getResponseHeaders");function JOa(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=xPi.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=xPi.createInflate();return t.pipe(n),n}return t}a(JOa,"getDecodedResponseStream");function ZOa(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{Buffer.isBuffer(o)?n.push(o):n.push(Buffer.from(o))}),t.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),t.on("error",o=>{o&&o?.name==="AbortError"?r(o):r(new O4e.RestError(`Error reading response as text: ${o.message}`,{code:O4e.RestError.PARSE_ERROR}))})})}a(ZOa,"streamToText");function PPi(t){return t?Buffer.isBuffer(t)?t.length:M4e(t)?null:kPi(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(PPi,"getBodyLength");function XOa(){return new q1r}a(XOa,"createNodeHttpClient")});var NPi=I(H1r=>{"use strict";p();Object.defineProperty(H1r,"__esModule",{value:!0});H1r.createDefaultHttpClient=t5a;var e5a=DPi();function t5a(){return(0,e5a.createNodeHttpClient)()}a(t5a,"createDefaultHttpClient")});var MPi=I($1r=>{"use strict";p();Object.defineProperty($1r,"__esModule",{value:!0});$1r.createPipelineRequest=i5a;var r5a=k4e(),n5a=gL(),G1r=class{static{a(this,"PipelineRequestImpl")}constructor(e){var r,n,o,s,c,l,u;this.url=e.url,this.body=e.body,this.headers=(r=e.headers)!==null&&r!==void 0?r:(0,r5a.createHttpHeaders)(),this.method=(n=e.method)!==null&&n!==void 0?n:"GET",this.timeout=(o=e.timeout)!==null&&o!==void 0?o:0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=(s=e.disableKeepAlive)!==null&&s!==void 0?s:!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=(c=e.withCredentials)!==null&&c!==void 0?c:!1,this.abortSignal=e.abortSignal,this.tracingOptions=e.tracingOptions,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||(0,n5a.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function i5a(t){return new G1r(t)}a(i5a,"createPipelineRequest")});var OPi=I(L4e=>{"use strict";p();Object.defineProperty(L4e,"__esModule",{value:!0});L4e.exponentialRetryPolicyName=void 0;L4e.exponentialRetryPolicy=c5a;var o5a=qAt(),s5a=NAe(),a5a=C$();L4e.exponentialRetryPolicyName="exponentialRetryPolicy";function c5a(t={}){var e;return(0,s5a.retryPolicy)([(0,o5a.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:a5a.DEFAULT_RETRY_POLICY_COUNT})}a(c5a,"exponentialRetryPolicy")});var LPi=I(jAe=>{"use strict";p();Object.defineProperty(jAe,"__esModule",{value:!0});jAe.systemErrorRetryPolicyName=void 0;jAe.systemErrorRetryPolicy=f5a;var l5a=qAt(),u5a=NAe(),d5a=C$();jAe.systemErrorRetryPolicyName="systemErrorRetryPolicy";function f5a(t={}){var e;return{name:jAe.systemErrorRetryPolicyName,sendRequest:(0,u5a.retryPolicy)([(0,l5a.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:d5a.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(f5a,"systemErrorRetryPolicy")});var BPi=I(HAe=>{"use strict";p();Object.defineProperty(HAe,"__esModule",{value:!0});HAe.throttlingRetryPolicyName=void 0;HAe.throttlingRetryPolicy=g5a;var p5a=QAt(),h5a=NAe(),m5a=C$();HAe.throttlingRetryPolicyName="throttlingRetryPolicy";function g5a(t={}){var e;return{name:HAe.throttlingRetryPolicyName,sendRequest:(0,h5a.retryPolicy)([(0,p5a.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:m5a.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(g5a,"throttlingRetryPolicy")});var V1r=I(GAe=>{"use strict";p();Object.defineProperty(GAe,"__esModule",{value:!0});GAe.DEFAULT_CYCLER_OPTIONS=void 0;GAe.createTokenCycler=_5a;var A5a=FAt();GAe.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function y5a(t,e,r){async function n(){if(Date.now()t.getToken(u,d),"tryGetAccessToken"),s.retryIntervalInMs,(f=n?.expiresOnTimestamp)!==null&&f!==void 0?f:Date.now()).then(m=>(r=null,n=m,o=d.tenantId,n)).catch(m=>{throw r=null,n=null,o=void 0,m})),r}return a(l,"refresh"),async(u,d)=>{let f=!!d.claims,h=o!==d.tenantId;return f&&(n=null),h||f||c.mustRefresh?l(u,d):(c.shouldRefresh&&l(u,d),n)}}a(_5a,"createTokenCycler")});var FPi=I($Ae=>{"use strict";p();Object.defineProperty($Ae,"__esModule",{value:!0});$Ae.bearerTokenAuthenticationPolicyName=void 0;$Ae.bearerTokenAuthenticationPolicy=S5a;var E5a=V1r(),v5a=nre();$Ae.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function C5a(t){let{scopes:e,getAccessToken:r,request:n}=t,o={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions},s=await r(e,o);s&&t.request.headers.set("Authorization",`Bearer ${s.token}`)}a(C5a,"defaultAuthorizeRequest");function b5a(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a(b5a,"getChallenge");function S5a(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||v5a.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:C5a,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,E5a.createTokenCycler)(r):()=>Promise.resolve(null);return{name:$Ae.bearerTokenAuthenticationPolicyName,async sendRequest(u,d){if(!u.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await c.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:u,getAccessToken:l,logger:s});let f,h;try{f=await d(u)}catch(m){h=m,f=m.response}if(c.authorizeRequestOnChallenge&&f?.status===401&&b5a(f)&&await c.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:u,response:f,getAccessToken:l,logger:s}))return d(u);if(h)throw h;return f}}}a(S5a,"bearerTokenAuthenticationPolicy")});var UPi=I(VAe=>{"use strict";p();Object.defineProperty(VAe,"__esModule",{value:!0});VAe.ndJsonPolicyName=void 0;VAe.ndJsonPolicy=T5a;VAe.ndJsonPolicyName="ndJsonPolicy";function T5a(){return{name:VAe.ndJsonPolicyName,async sendRequest(t,e){if(typeof t.body=="string"&&t.body.startsWith("[")){let r=JSON.parse(t.body);Array.isArray(r)&&(t.body=r.map(n=>JSON.stringify(n)+` -`).join(""))}return e(t)}}}a(T5a,"ndJsonPolicy")});var qPi=I(sre=>{"use strict";p();Object.defineProperty(sre,"__esModule",{value:!0});sre.auxiliaryAuthenticationHeaderPolicyName=void 0;sre.auxiliaryAuthenticationHeaderPolicy=R5a;var I5a=V1r(),x5a=nre();sre.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var QPi="x-ms-authorization-auxiliary";async function w5a(t){var e,r;let{scopes:n,getAccessToken:o,request:s}=t,c={abortSignal:s.abortSignal,tracingOptions:s.tracingOptions};return(r=(e=await o(n,c))===null||e===void 0?void 0:e.token)!==null&&r!==void 0?r:""}a(w5a,"sendAuthorizeRequest");function R5a(t){let{credentials:e,scopes:r}=t,n=t.logger||x5a.logger,o=new WeakMap;return{name:sre.auxiliaryAuthenticationHeaderPolicyName,async sendRequest(s,c){if(!s.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication for auxiliary header is not permitted for non-TLS protected (non-https) URLs.");if(!e||e.length===0)return n.info(`${sre.auxiliaryAuthenticationHeaderPolicyName} header will not be set due to empty credentials.`),c(s);let l=[];for(let d of e){let f=o.get(d);f||(f=(0,I5a.createTokenCycler)(d),o.set(d,f)),l.push(w5a({scopes:Array.isArray(r)?r:[r],request:s,getAccessToken:f,logger:n}))}let u=(await Promise.all(l)).filter(d=>!!d);return u.length===0?(n.warning(`None of the auxiliary tokens are valid. ${QPi} header will not be set.`),c(s)):(s.headers.set(QPi,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(R5a,"auxiliaryAuthenticationHeaderPolicy")});var o2i=I(xr=>{"use strict";p();Object.defineProperty(xr,"__esModule",{value:!0});xr.createFileFromStream=xr.createFile=xr.auxiliaryAuthenticationHeaderPolicyName=xr.auxiliaryAuthenticationHeaderPolicy=xr.ndJsonPolicyName=xr.ndJsonPolicy=xr.bearerTokenAuthenticationPolicyName=xr.bearerTokenAuthenticationPolicy=xr.formDataPolicyName=xr.formDataPolicy=xr.tlsPolicyName=xr.tlsPolicy=xr.userAgentPolicyName=xr.userAgentPolicy=xr.defaultRetryPolicy=xr.tracingPolicyName=xr.tracingPolicy=xr.retryPolicy=xr.throttlingRetryPolicyName=xr.throttlingRetryPolicy=xr.systemErrorRetryPolicyName=xr.systemErrorRetryPolicy=xr.redirectPolicyName=xr.redirectPolicy=xr.getDefaultProxySettings=xr.proxyPolicyName=xr.proxyPolicy=xr.multipartPolicyName=xr.multipartPolicy=xr.logPolicyName=xr.logPolicy=xr.setClientRequestIdPolicyName=xr.setClientRequestIdPolicy=xr.exponentialRetryPolicyName=xr.exponentialRetryPolicy=xr.decompressResponsePolicyName=xr.decompressResponsePolicy=xr.isRestError=xr.RestError=xr.createPipelineRequest=xr.createHttpHeaders=xr.createDefaultHttpClient=xr.createPipelineFromOptions=xr.createEmptyPipeline=void 0;var k5a=GSr();Object.defineProperty(xr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return k5a.createEmptyPipeline},"get")});var P5a=IPi();Object.defineProperty(xr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return P5a.createPipelineFromOptions},"get")});var D5a=NPi();Object.defineProperty(xr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return D5a.createDefaultHttpClient},"get")});var N5a=k4e();Object.defineProperty(xr,"createHttpHeaders",{enumerable:!0,get:a(function(){return N5a.createHttpHeaders},"get")});var M5a=MPi();Object.defineProperty(xr,"createPipelineRequest",{enumerable:!0,get:a(function(){return M5a.createPipelineRequest},"get")});var jPi=zAt();Object.defineProperty(xr,"RestError",{enumerable:!0,get:a(function(){return jPi.RestError},"get")});Object.defineProperty(xr,"isRestError",{enumerable:!0,get:a(function(){return jPi.isRestError},"get")});var HPi=b1r();Object.defineProperty(xr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return HPi.decompressResponsePolicy},"get")});Object.defineProperty(xr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return HPi.decompressResponsePolicyName},"get")});var GPi=OPi();Object.defineProperty(xr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return GPi.exponentialRetryPolicy},"get")});Object.defineProperty(xr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return GPi.exponentialRetryPolicyName},"get")});var $Pi=P1r();Object.defineProperty(xr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return $Pi.setClientRequestIdPolicy},"get")});Object.defineProperty(xr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return $Pi.setClientRequestIdPolicyName},"get")});var VPi=p1r();Object.defineProperty(xr,"logPolicy",{enumerable:!0,get:a(function(){return VPi.logPolicy},"get")});Object.defineProperty(xr,"logPolicyName",{enumerable:!0,get:a(function(){return VPi.logPolicyName},"get")});var WPi=C1r();Object.defineProperty(xr,"multipartPolicy",{enumerable:!0,get:a(function(){return WPi.multipartPolicy},"get")});Object.defineProperty(xr,"multipartPolicyName",{enumerable:!0,get:a(function(){return WPi.multipartPolicyName},"get")});var W1r=k1r();Object.defineProperty(xr,"proxyPolicy",{enumerable:!0,get:a(function(){return W1r.proxyPolicy},"get")});Object.defineProperty(xr,"proxyPolicyName",{enumerable:!0,get:a(function(){return W1r.proxyPolicyName},"get")});Object.defineProperty(xr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return W1r.getDefaultProxySettings},"get")});var zPi=h1r();Object.defineProperty(xr,"redirectPolicy",{enumerable:!0,get:a(function(){return zPi.redirectPolicy},"get")});Object.defineProperty(xr,"redirectPolicyName",{enumerable:!0,get:a(function(){return zPi.redirectPolicyName},"get")});var YPi=LPi();Object.defineProperty(xr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return YPi.systemErrorRetryPolicy},"get")});Object.defineProperty(xr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return YPi.systemErrorRetryPolicyName},"get")});var KPi=BPi();Object.defineProperty(xr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return KPi.throttlingRetryPolicy},"get")});Object.defineProperty(xr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return KPi.throttlingRetryPolicyName},"get")});var O5a=NAe();Object.defineProperty(xr,"retryPolicy",{enumerable:!0,get:a(function(){return O5a.retryPolicy},"get")});var JPi=B1r();Object.defineProperty(xr,"tracingPolicy",{enumerable:!0,get:a(function(){return JPi.tracingPolicy},"get")});Object.defineProperty(xr,"tracingPolicyName",{enumerable:!0,get:a(function(){return JPi.tracingPolicyName},"get")});var L5a=I1r();Object.defineProperty(xr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return L5a.defaultRetryPolicy},"get")});var ZPi=y1r();Object.defineProperty(xr,"userAgentPolicy",{enumerable:!0,get:a(function(){return ZPi.userAgentPolicy},"get")});Object.defineProperty(xr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return ZPi.userAgentPolicyName},"get")});var XPi=D1r();Object.defineProperty(xr,"tlsPolicy",{enumerable:!0,get:a(function(){return XPi.tlsPolicy},"get")});Object.defineProperty(xr,"tlsPolicyName",{enumerable:!0,get:a(function(){return XPi.tlsPolicyName},"get")});var e2i=R1r();Object.defineProperty(xr,"formDataPolicy",{enumerable:!0,get:a(function(){return e2i.formDataPolicy},"get")});Object.defineProperty(xr,"formDataPolicyName",{enumerable:!0,get:a(function(){return e2i.formDataPolicyName},"get")});var t2i=FPi();Object.defineProperty(xr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return t2i.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(xr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return t2i.bearerTokenAuthenticationPolicyName},"get")});var r2i=UPi();Object.defineProperty(xr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return r2i.ndJsonPolicy},"get")});Object.defineProperty(xr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return r2i.ndJsonPolicyName},"get")});var n2i=qPi();Object.defineProperty(xr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return n2i.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(xr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return n2i.auxiliaryAuthenticationHeaderPolicyName},"get")});var i2i=_1r();Object.defineProperty(xr,"createFile",{enumerable:!0,get:a(function(){return i2i.createFile},"get")});Object.defineProperty(xr,"createFileFromStream",{enumerable:!0,get:a(function(){return i2i.createFileFromStream},"get")})});var a2i=I((F4e,s2i)=>{"use strict";p();var B5a=F4e&&F4e.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},F5a=F4e&&F4e.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var H5a=lu(),G5a=Cy(),$5a=(function(){function t(e,r,n,o){this._buffer=[],this._lastSend=0,this._isDisabled=e,this._getBatchSize=r,this._getBatchIntervalMs=n,this._sender=o}return a(t,"Channel"),t.prototype.setUseDiskRetryCaching=function(e,r,n){this._sender.setDiskRetryMode(e,r,n)},t.prototype.send=function(e){var r=this;if(!this._isDisabled()){if(!e){H5a.warn("Cannot send null/undefined telemetry");return}if(this._buffer.push(e),this._buffer.length>=this._getBatchSize()){this.triggerSend(!1);return}!this._timeoutHandle&&this._buffer.length>0&&(this._timeoutHandle=setTimeout(function(){r._timeoutHandle=null,r.triggerSend(!1)},this._getBatchIntervalMs()))}},t.prototype.triggerSend=function(e,r){var n=this._buffer.length<1;n||(e||G5a.isNodeExit?(this._sender.saveOnCrash(this._buffer),typeof r=="function"&&r("data saved on crash")):this._sender.send(this._buffer,r)),this._lastSend=+new Date,this._buffer=[],clearTimeout(this._timeoutHandle),this._timeoutHandle=null,n&&typeof r=="function"&&r("no data to send")},t})();c2i.exports=$5a});var u2i=I(z1r=>{"use strict";p();Object.defineProperty(z1r,"__esModule",{value:!0});z1r.azureRoleEnvironmentTelemetryProcessor=V5a;function V5a(t,e){}a(V5a,"azureRoleEnvironmentTelemetryProcessor")});var p2i=I(ZAt=>{"use strict";p();Object.defineProperty(ZAt,"__esModule",{value:!0});ZAt.samplingTelemetryProcessor=W5a;ZAt.getSamplingHashCode=f2i;var d2i=Z_();function W5a(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&d2i.TelemetryType.Metric===d2i.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=f2i(e.correlationContext.operation.id){"use strict";p();var z5a=O6&&O6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Y5a=O6&&O6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K5a=O6&&O6.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&z5a(e,t,r);return Y5a(e,t),e};Object.defineProperty(O6,"__esModule",{value:!0});O6.performanceMetricsTelemetryProcessor=J5a;var Y1r=uAt(),K1r=K5a(Z_());function J5a(t,e){switch(e&&e.addDocument(t),t.data.baseType){case K1r.TelemetryTypeString.Exception:Y1r.countException();break;case K1r.TelemetryTypeString.Request:var r=t.data.baseData;Y1r.countRequest(r.duration,r.success);break;case K1r.TelemetryTypeString.Dependency:var n=t.data.baseData;Y1r.countDependency(n.duration,n.success);break}return!0}a(J5a,"performanceMetricsTelemetryProcessor")});var m2i=I(BD=>{"use strict";p();var AL=BD&&BD.__assign||function(){return AL=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var n4a=yL&&yL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eyt=yL&&yL.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&n4a(e,t,r)};Object.defineProperty(yL,"__esModule",{value:!0});eyt(u2i(),yL);eyt(p2i(),yL);eyt(h2i(),yL);eyt(m2i(),yL)});var J1r=I((WDp,_2i)=>{"use strict";p();var no=Z_(),hS=Cy(),A2i=h$(),i4a=lu(),o4a=(function(){function t(){}return a(t,"EnvelopeFactory"),t.createEnvelope=function(e,r,n,o,s){var c=null;switch(r){case no.TelemetryType.Trace:c=t.createTraceData(e);break;case no.TelemetryType.Dependency:c=t.createDependencyData(e);break;case no.TelemetryType.Event:c=t.createEventData(e);break;case no.TelemetryType.Exception:c=t.createExceptionData(e);break;case no.TelemetryType.Request:c=t.createRequestData(e);break;case no.TelemetryType.Metric:c=t.createMetricData(e);break;case no.TelemetryType.Availability:c=t.createAvailabilityData(e);break;case no.TelemetryType.PageView:c=t.createPageViewData(e);break}if(c&&c.baseData&&no.domainSupportsProperties(c.baseData)){if(n)if(!c.baseData.properties)c.baseData.properties=n;else for(var l in n)c.baseData.properties[l]||(c.baseData.properties[l]=n[l]);t.addAzureFunctionsCorrelationProperties(c.baseData.properties),c.baseData.properties&&(c.baseData.properties=hS.validateStringMap(c.baseData.properties))}var u=s&&s.instrumentationKey||"",d=new no.Envelope;return d.data=c,d.iKey=u,d.name="Microsoft.ApplicationInsights."+u.replace(/-/g,"")+"."+c.baseType.substr(0,c.baseType.length-4),d.tags=this.getTags(o,e.tagOverrides),d.time=new Date().toISOString(),d.ver=1,d.sampleRate=s?s.samplingPercentage:100,r===no.TelemetryType.Metric&&(d.sampleRate=100),d},t.addAzureFunctionsCorrelationProperties=function(e){var r=A2i.CorrelationContextManager.getCurrentContext();if(r&&r.customProperties&&r.customProperties.getProperty instanceof Function){e=e||{};var n=r.customProperties.getProperty("InvocationId");n&&(e.InvocationId=n),n=r.customProperties.getProperty("ProcessId"),n&&(e.ProcessId=n),n=r.customProperties.getProperty("LogLevel"),n&&(e.LogLevel=n),n=r.customProperties.getProperty("Category"),n&&(e.Category=n),n=r.customProperties.getProperty("HostInstanceId"),n&&(e.HostInstanceId=n),n=r.customProperties.getProperty("AzFuncLiveLogsSessionId"),n&&(e.AzFuncLiveLogsSessionId=n)}},t.truncateProperties=function(e){if(e.properties)try{for(var r={},n=Object.keys(e.properties),o=Object.values(e.properties),s=0;s0,o.exceptions.push(c);var l=new no.Data;return l.baseType=no.telemetryTypeToBaseType(no.TelemetryType.Exception),l.baseData=o,l},t.createRequestData=function(e){var r,n,o,s,c=new no.RequestData;e.id?c.id=e.id:c.id=hS.w3cTraceId(),c.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),c.url=(n=e.url)===null||n===void 0?void 0:n.substring(0,2048),c.source=(o=e.source)===null||o===void 0?void 0:o.substring(0,1024),c.duration=hS.msToTimeSpan(e.duration),c.responseCode=(s=e.resultCode?e.resultCode.toString():"0")===null||s===void 0?void 0:s.substring(0,1024),c.success=e.success,c.properties=this.truncateProperties(e),c.measurements=e.measurements;var l=new no.Data;return l.baseType=no.telemetryTypeToBaseType(no.TelemetryType.Request),l.baseData=c,l},t.createMetricData=function(e){var r,n=new no.MetricData;n.metrics=[];var o=new no.DataPoint;o.count=isNaN(e.count)?1:e.count,o.kind=no.DataPointType.Aggregation,o.max=isNaN(e.max)?e.value:e.max,o.min=isNaN(e.min)?e.value:e.min,o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.stdDev=isNaN(e.stdDev)?0:e.stdDev,o.value=e.value,o.ns=e.namespace,n.metrics.push(o),n.properties=this.truncateProperties(e);var s=new no.Data;return s.baseType=no.telemetryTypeToBaseType(no.TelemetryType.Metric),s.baseData=n,s},t.createAvailabilityData=function(e){var r,n,o=new no.AvailabilityData;e.id?o.id=e.id:o.id=hS.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=hS.msToTimeSpan(e.duration),o.success=e.success,o.runLocation=e.runLocation,o.message=(n=e.message)===null||n===void 0?void 0:n.substring(0,8192),o.measurements=e.measurements,o.properties=this.truncateProperties(e);var s=new no.Data;return s.baseType=no.telemetryTypeToBaseType(no.TelemetryType.Availability),s.baseData=o,s},t.createPageViewData=function(e){var r,n,o=new no.PageViewData;o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=hS.msToTimeSpan(e.duration),o.url=(n=e.url)===null||n===void 0?void 0:n.substring(0,2048),o.measurements=e.measurements,o.properties=this.truncateProperties(e);var s=new no.Data;return s.baseType=no.telemetryTypeToBaseType(no.TelemetryType.PageView),s.baseData=o,s},t.getTags=function(e,r){var n=A2i.CorrelationContextManager.getCurrentContext(),o={};if(e&&e.tags)for(var s in e.tags)o[s]=e.tags[s];if(r)for(var s in r)o[s]=r[s];return n&&(o[e.keys.operationId]=o[e.keys.operationId]||n.operation.id,o[e.keys.operationName]=o[e.keys.operationName]||n.operation.name,o[e.keys.operationParentId]=o[e.keys.operationParentId]||n.operation.parentId),o},t.parseStack=function(e){var r=void 0;if(typeof e=="string"){var n=e.split(` -`);r=[];for(var o=0,s=0,c=0;c<=n.length;c++){var l=n[c];if(y2i.regex.test(l)){var u=new y2i(n[c],o++);s+=u.sizeInBytes,r.push(u)}}var d=32*1024;if(s>d)for(var f=0,h=r.length-1,m=0,g=f,A=h;fd){var E=A-g+1;r.splice(g,E);break}g=f,A=h,f++,h--}}return r},t})(),y2i=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=hS.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=hS.trim(n[2])||this.method,this.fileName=hS.trim(n[4])||"",this.line=parseInt(n[5])||0),this.sizeInBytes+=this.method.length,this.sizeInBytes+=this.fileName.length,this.sizeInBytes+=this.assembly.length,this.sizeInBytes+=t.baseSize,this.sizeInBytes+=this.level.toString().length,this.sizeInBytes+=this.line.toString().length}return a(t,"_StackFrame"),t.regex=/^(\s+at)?(.*?)(\@|\s\(|\s)([^\(\n]+):(\d+):(\d+)(\)?)$/,t.baseSize=58,t})();_2i.exports=o4a});var E2i=I(b$=>{"use strict";p();var s4a=b$&&b$.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},a4a=b$&&b$.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var tyt=q4e&&q4e.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},ryt=q4e&&q4e.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=0&&(this._resendInterval=Math.floor(r)),typeof n=="number"&&n>=0&&(this._maxBytesOnDisk=Math.floor(n)),e&&!Q4e.FileAccessControl.OS_PROVIDES_FILE_PROTECTION&&(this._enableDiskRetryMode=!1,this._logWarn("Ignoring request to enable disk retry mode. Sufficient file protection capabilities were not detected.")),this._enableDiskRetryMode?(this._statsbeat&&this._statsbeat.addFeature(S$.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(S$.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return tyt(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return ryt(this,function(m){switch(m.label){case 0:if(!(e&&e.length>0))return[3,5];if(n=this._redirectedHost||this._config.endpointUrl,o=new m4a.URL(n).hostname,s={method:"POST",withCredentials:!1,headers:{"Content-Type":"application/x-json-stream"}},c=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!c)return[3,4];this._statsbeat&&this._statsbeat.addFeature(S$.StatsbeatFeature.AAD_HANDLING),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,c.addAuthorizationHeader(s)];case 2:return m.sent(),[3,4];case 3:return l=m.sent(),u="Failed to get AAD bearer token for the Application.",this._enableDiskRetryMode&&(u+="This batch of telemetry items will be retried. ",this._storeToDisk(e)),u+="Error:"+l.toString(),this._logWarn(u),typeof r=="function"&&r(u),[2];case 4:if(d="",e.forEach(function(g){var A=mS.stringify(g);typeof A=="string"&&(d+=A+` -`)}),d.length>0&&(d=d.substring(0,d.length-1)),d.length===0)return typeof r=="function"&&r("Empty batch of telemetry items. Nothing to send."),[2];f=Buffer.from?Buffer.from(d):new Buffer(d),p4a.gzip(f,function(g,A){var y=A;g?(h._logWarn(mS.dumpObj(g)),y=f,s.headers["Content-Length"]=f.length.toString()):(s.headers["Content-Encoding"]="gzip",s.headers["Content-Length"]=A.length.toString()),h._logInfo(mS.dumpObj(s)),s[h4a.disableCollectionRequestOption]=!0;var _=+new Date,E=a(function(S){S.setEncoding("utf-8");var T="";S.on("data",function(w){T+=w}),S.on("end",function(){var w,R=+new Date,x=R-_;if(h._numConsecutiveFailures=0,T.includes(_4a)&&S.statusCode===400&&(X1r.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(y4a.includes(S.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(S.statusCode==A4a||S.statusCode==g4a?h._statsbeat.countThrottle(S$.StatsbeatNetworkCategory.Breeze,o,S.statusCode):h._statsbeat.countRequest(S$.StatsbeatNetworkCategory.Breeze,o,x,S.statusCode===200,S.statusCode)),h._enableDiskRetryMode){if(S.statusCode===200)h._resendTimer||(h._resendTimer=setTimeout(function(){h._resendTimer=null,h._sendFirstFileOnDisk()},h._resendInterval),h._resendTimer.unref());else if(h._isRetriable(S.statusCode))try{h._statsbeat&&h._statsbeat.countRetry(S$.StatsbeatNetworkCategory.Breeze,o,S.statusCode);var k=JSON.parse(T),D=[];k.errors&&(k.errors.forEach(function(B){(B.statusCode==429||B.statusCode==500||B.statusCode==503)&&D.push(e[B.index])}),D.length>0&&h._storeToDisk(D))}catch{h._storeToDisk(e)}}if(S.statusCode===307||S.statusCode===308)if(h._numConsecutiveRedirects++,h._numConsecutiveRedirects<10){var N=S.headers.location?S.headers.location.toString():null;N&&(h._redirectedHost=N,h.send(e,r))}else{var O={name:"Circular Redirect",message:"Error sending telemetry because of circular redirects."};h._statsbeat&&h._statsbeat.countException(S$.StatsbeatNetworkCategory.Breeze,o,O),typeof r=="function"&&r("Error sending telemetry because of circular redirects.")}else h._numConsecutiveRedirects=0,typeof r=="function"&&r(T),h._logInfo(T),typeof h._onSuccess=="function"&&h._onSuccess(T)})},"requestCallback"),v=mS.makeRequest(h._config,n,s,E);v.setTimeout(t.HTTP_TIMEOUT,function(){h._requestTimedOut=!0,v.abort()}),v.on("error",function(S){if(h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&h._statsbeatFailedToIngest(),h._numConsecutiveFailures++,h._statsbeat&&h._statsbeat.countException(S$.StatsbeatNetworkCategory.Breeze,o,S),!h._enableDiskRetryMode||h._numConsecutiveFailures>0&&h._numConsecutiveFailures%t.MAX_CONNECTION_FAILURES_BEFORE_WARN===0){var T="Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:";h._enableDiskRetryMode&&(T="Ingestion endpoint could not be reached ".concat(h._numConsecutiveFailures," consecutive times. There may be resulting telemetry loss. Most recent error:")),h._logWarn(T,mS.dumpObj(S))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,mS.dumpObj(S))}h._onErrorHelper(S),typeof r=="function"&&(S?(h._requestTimedOut&&(S.name="telemetry timeout",S.message="telemetry request timed out"),r(mS.dumpObj(S))):r("Error sending telemetry")),h._enableDiskRetryMode&&h._storeToDisk(e)}),v.write(y),v.end()}),m.label=5;case 5:return[2]}})})},t.prototype.saveOnCrash=function(e){this._enableDiskRetryMode&&this._storeToDiskSync(mS.stringify(e))},t.prototype._isRetriable=function(e){return e===206||e===401||e===403||e===408||e===429||e===500||e===502||e===503||e===504},t.prototype._logInfo=function(e){for(var r=[],n=1;n=3&&this._shutdownStatsbeat())},t.prototype._storeToDisk=function(e){return tyt(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return ryt(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),this._logInfo("Checking existence of data storage directory: "+this._tempDir),[4,L6.confirmDirExists(this._tempDir)];case 1:return d.sent(),[3,3];case 2:return r=d.sent(),this._logWarn("Failed to create folder to put telemetry: "+mS.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,Q4e.FileAccessControl.applyACLRules(this._tempDir)];case 4:return d.sent(),[3,6];case 5:return n=d.sent(),this._logWarn("Failed to apply file access control to folder: "+mS.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,L6.getShallowDirectorySize(this._tempDir)];case 7:return o=d.sent(),o>this._maxBytesOnDisk?(this._logWarn("Not saving data due to max size limit being met. Directory size in bytes is: "+o),[2]):[3,9];case 8:return s=d.sent(),this._logWarn("Failed to read directory for retriable telemetry: "+mS.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=are.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,L6.writeFileAsync(l,mS.stringify(e),{mode:384})];case 10:return d.sent(),[3,12];case 11:return u=d.sent(),this._logWarn("Failed to persist telemetry to disk: "+mS.dumpObj(u)),this._onErrorHelper(u),[2];case 12:return[2]}})})},t.prototype._storeToDiskSync=function(e){try{this._logInfo("Checking existence of data storage directory: "+this._tempDir),Z1r.existsSync(this._tempDir)||Z1r.mkdirSync(this._tempDir),Q4e.FileAccessControl.applyACLRulesSync(this._tempDir);var r=L6.getShallowDirectorySizeSync(this._tempDir);if(r>this._maxBytesOnDisk){this._logInfo("Not saving data due to max size limit being met. Directory size in bytes is: "+r);return}var n="".concat(new Date().getTime(),".ai.json"),o=are.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),Z1r.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+mS.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return tyt(this,void 0,void 0,function(){var e,r,n,o,s,c;return ryt(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,L6.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return are.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=are.join(this._tempDir,r),[4,L6.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,L6.unlinkAsync(n)];case 3:return l.sent(),s=JSON.parse(o.toString()),[4,this.send(s)];case 4:l.sent(),l.label=5;case 5:return[3,7];case 6:return c=l.sent(),this._onErrorHelper(c),[3,7];case 7:return[2]}})})},t.prototype._onErrorHelper=function(e){typeof this._onError=="function"&&this._onError(e)},t.prototype._fileCleanupTask=function(){return tyt(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return ryt(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,L6.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return are.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=are.join(this._tempDir,e[r]),[4,L6.unlinkAsync(s).catch(function(d){l._onErrorHelper(d)})]):[3,4]):[3,5];case 3:u.sent(),u.label=4;case 4:return r++,[3,2];case 5:return[3,7];case 6:return c=u.sent(),c.code!="ENOENT"&&this._onErrorHelper(c),[3,7];case 7:return[2]}})})},t.TAG="Sender",t.WAIT_BETWEEN_RESEND=60*1e3,t.MAX_BYTES_ON_DISK=50*1024*1024,t.MAX_CONNECTION_FAILURES_BEFORE_WARN=5,t.CLEANUP_TIMEOUT=3600*1e3,t.FILE_RETEMPTION_PERIOD=10080*60*1e3,t.TEMPDIR_PREFIX="appInsights-node",t.HTTP_TIMEOUT=2e4,t})();v2i.exports=E4a});var b2i=I(nyt=>{"use strict";p();Object.defineProperty(nyt,"__esModule",{value:!0});nyt.AzureVirtualMachine=void 0;var C2i=lu(),v4a=Cy(),C4a=SAe(),b4a="http://169.254.169.254/metadata/instance/compute",S4a="api-version=2017-12-01",T4a="format=json",I4a="UNREACH",x4a=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat(b4a,"?").concat(S4a,"&").concat(T4a),l=(n={method:"GET"},n[C4a.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=v4a.makeRequest(e,c,l,function(d){if(d.statusCode===200){s.isVM=!0;var f="";d.on("data",function(h){f+=h}),d.on("end",function(){try{var h=JSON.parse(f);s.id=h.vmId||"",s.subscriptionId=h.subscriptionId||"",s.osType=h.osType||""}catch(m){C2i.info(t.TAG,m)}r(s)})}else r(s)},!1,!1);u&&(setTimeout(function(){o._requestTimedOut=!0,u.abort()},t.HTTP_TIMEOUT),u.on("error",function(d){o._requestTimedOut&&d&&(d.name="telemetry timeout",d.message="telemetry request timed out"),d&&d.message&&d.message.indexOf(I4a)>-1?s.isVM=!1:C2i.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();nyt.AzureVirtualMachine=x4a});var S2i=I(iyt=>{"use strict";p();Object.defineProperty(iyt,"__esModule",{value:!0});iyt.NetworkStatsbeat=void 0;var w4a=(function(){function t(e,r){this.endpoint=e,this.host=r,this.totalRequestCount=0,this.totalSuccesfulRequestCount=0,this.totalFailedRequestCount=[],this.retryCount=[],this.exceptionCount=[],this.throttleCount=[],this.intervalRequestExecutionTime=0,this.lastIntervalRequestExecutionTime=0,this.lastTime=+new Date,this.lastRequestCount=0}return a(t,"NetworkStatsbeat"),t})();iyt.NetworkStatsbeat=w4a});var R2i=I((cre,w2i)=>{"use strict";p();var _L=cre&&cre.__assign||function(){return _L=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0&&s/o||0;if(n.lastIntervalRequestExecutionTime=n.intervalRequestExecutionTime,o>0){var l=Object.assign({endpoint:this._networkStatsbeatCollection[r].endpoint,host:this._networkStatsbeatCollection[r].host},e);this._statbeatMetrics.push({name:wd.StatsbeatCounter.REQUEST_DURATION,value:c,properties:l})}n.lastRequestCount=n.totalRequestCount,n.lastTime=n.time}},t.prototype._getShortHost=function(e){var r=e;try{var n=new RegExp(/^https?:\/\/(?:www\.)?([^\/.-]+)/),o=n.exec(e);o!=null&&o.length>1&&(r=o[1]),r=r.replace(".in.applicationinsights.azure.com","")}catch{}return r},t.prototype._trackRequestsCount=function(e){for(var r=this,n=a(function(l){s=o._networkStatsbeatCollection[l];var u=Object.assign({endpoint:s.endpoint,host:s.host},e);s.totalSuccesfulRequestCount>0&&(o._statbeatMetrics.push({name:wd.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(_L(_L({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:wd.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(_L(_L({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:wd.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(_L(_L({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:wd.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(_L(_L({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:wd.StatsbeatCounter.EXCEPTION_COUNT,value:d.count,properties:u})}),s.exceptionCount=[])},"_loop_1"),o=this,s,c=0;c0))return[3,2];for(e=[],r=0;r-1)return t.EU_CONNECTION_STRING;return t.NON_EU_CONNECTION_STRING},t.NON_EU_CONNECTION_STRING="InstrumentationKey=c4a29126-a7cb-47e5-b348-11414998b11e;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com",t.EU_CONNECTION_STRING="InstrumentationKey=7dc56bab-3c0c-4e9f-9ebb-d1acadee8d0f;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com",t.STATS_COLLECTION_SHORT_INTERVAL=9e5,t.STATS_COLLECTION_LONG_INTERVAL=864e5,t.STATS_COLLECTION_INITIAL_DELAY=15e3,t.TAG="Statsbeat",t})();w2i.exports=B4a});var D2i=I((lNp,P2i)=>{"use strict";p();var F4a=require("url"),U4a=qSr(),Q4a=a2i(),q4a=AAe(),B6=Z_(),j4a=l2i(),nTr=g2i(),k2i=h$(),H4a=R2i(),G4a=eTr(),iTr=Cy(),oyt=lu(),$4a=J1r(),V4a=(function(){function t(e){this._telemetryProcessors=[];var r=new U4a(e);if(this.config=r,!this.config.instrumentationKey||this.config.instrumentationKey=="")throw new Error("Instrumentation key not found, please provide a connection string before starting Application Insights SDK.");this.context=new q4a,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new H4a(this.config,this.context),this._statsbeat.enable(!0));var n=new G4a(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new j4a(function(){return r.disableAppInsights},function(){return r.maxBatchSize},function(){return r.maxBatchIntervalMs},n)}return a(t,"TelemetryClient"),t.prototype.trackAvailability=function(e){this.track(e,B6.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,B6.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,B6.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,B6.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!iTr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,B6.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,B6.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,B6.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new F4a.URL(e.data).host}catch(r){e.target=null,oyt.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,B6.TelemetryType.Dependency)},t.prototype.flush=function(e){this.channel.triggerSend(e?!!e.isAppCrashing:!1,e?e.callback:void 0)},t.prototype.track=function(e,r){if(e&&B6.telemetryTypeToBaseType(r)){var n=$4a.createEnvelope(e,r,this.commonProperties,this.context,this.config);e.time&&(n.time=e.time.toISOString());var o=this.runTelemetryProcessors(n,e.contextObjects);o=o&&nTr.samplingTelemetryProcessor(n,{correlationContext:k2i.CorrelationContextManager.getCurrentContext()}),nTr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(nTr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else oyt.warn(t.TAG,"track() requires telemetry object and telemetryType to be specified.")},t.prototype.setAutoPopulateAzureProperties=function(e){},t.prototype.getAuthorizationHandler=function(e){return e&&e.aadTokenCredential?(this.authorizationHandler||(oyt.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new Q4a(e.aadTokenCredential,e.aadAudience)),this.authorizationHandler):null},t.prototype.addTelemetryProcessor=function(e){this._telemetryProcessors.push(e)},t.prototype.clearTelemetryProcessors=function(){this._telemetryProcessors=[]},t.prototype.runTelemetryProcessors=function(e,r){var n=!0,o=this._telemetryProcessors.length;if(o===0)return n;r=r||{},r.correlationContext=k2i.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var W4a=oTr&&oTr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),z4a=D2i(),N2i=MSr(),Y4a=SAe(),syt=lu(),K4a=(function(t){W4a(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NodeClient"),e.prototype.trackNodeHttpRequestSync=function(r){r&&r.request&&r.response&&r.duration?N2i.trackRequestSync(this,r):syt.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&syt.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?N2i.trackRequest(this,r):syt.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?Y4a.trackRequest(this,r):syt.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(z4a);M2i.exports=K4a});var B2i=I(L2i=>{"use strict";p();Object.defineProperty(L2i,"__esModule",{value:!0})});var q2i=I(At=>{"use strict";p();Object.defineProperty(At,"__esModule",{value:!0});At.Configuration=At.liveMetricsClient=At.defaultClient=At.DistributedTracingModes=void 0;At.setup=oLa;At.start=Q2i;At.getCorrelationContext=aLa;At.startOperation=cLa;At.wrapWithCorrelationContext=lLa;At.dispose=uLa;var aTr=h$(),J4a=_Ri(),Z4a=vRi(),cTr=uAt(),X4a=ESr(),eLa=PRi(),tLa=jRi(),rLa=SAe(),nLa=MSr(),F2i=Mte(),j4e=lu(),U2i=Cki(),lTr=Ski(),iLa=xki();At.TelemetryClient=O2i();At.Contracts=Z_();At.azureFunctionsTypes=B2i();var sTr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(sTr||(At.DistributedTracingModes=sTr={}));var H4e,G4e,$4e,V4e,W4e,zAe,YAe,lre,z4e,Y4e,vI=!1,ayt;function oLa(t){return At.defaultClient?j4e.info("The default client is already setup"):(At.defaultClient=new At.TelemetryClient(t),H4e=new J4a(At.defaultClient),G4e=new Z4a(At.defaultClient),$4e=new cTr(At.defaultClient),V4e=new X4a(At.defaultClient),W4e=new eLa(At.defaultClient),zAe=new tLa(At.defaultClient),lre=new nLa(At.defaultClient),z4e=new rLa(At.defaultClient),YAe||(YAe=new lTr.AutoCollectNativePerformance(At.defaultClient)),Y4e=new iLa.AzureFunctionsHook(At.defaultClient)),uTr}a(oLa,"setup");function sLa(){At.defaultClient&&(At.defaultClient.config.enableAutoCollectExternalLoggers==null&&(At.defaultClient.config.enableAutoCollectExternalLoggers=!0),At.defaultClient.config.enableAutoCollectConsole==null&&(At.defaultClient.config.enableAutoCollectConsole=!1),At.defaultClient.config.enableAutoCollectExceptions==null&&(At.defaultClient.config.enableAutoCollectExceptions=!0),At.defaultClient.config.enableAutoCollectPerformance==null&&(At.defaultClient.config.enableAutoCollectPerformance=!0),At.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),At.defaultClient.config.enableAutoCollectHeartbeat==null&&(At.defaultClient.config.enableAutoCollectHeartbeat=!0),At.defaultClient.config.enableAutoCollectRequests==null&&(At.defaultClient.config.enableAutoCollectRequests=!0),At.defaultClient.config.enableAutoCollectDependencies==null&&(At.defaultClient.config.enableAutoCollectDependencies=!0),At.defaultClient.config.enableUseDiskRetryCaching==null&&(At.defaultClient.config.enableUseDiskRetryCaching=!0),At.defaultClient.config.enableAutoDependencyCorrelation==null&&(At.defaultClient.config.enableAutoDependencyCorrelation=!0),At.defaultClient.config.enableSendLiveMetrics==null&&(At.defaultClient.config.enableSendLiveMetrics=!1),At.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(At.defaultClient.config.enableAutoCollectExtendedMetrics=!0),At.defaultClient.config.enableWebInstrumentation==null&&(At.defaultClient.config.enableWebInstrumentation=!1),At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}a(sLa,"_setDefaultConfig");function Q2i(){if(At.defaultClient){vI=!0,sLa(),H4e.enable(At.defaultClient.config.enableAutoCollectExternalLoggers,At.defaultClient.config.enableAutoCollectConsole),G4e.enable(At.defaultClient.config.enableAutoCollectExceptions),$4e.enable(At.defaultClient.config.enableAutoCollectPerformance),V4e.enable(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics),W4e.enable(At.defaultClient.config.enableAutoCollectHeartbeat),lre.useAutoCorrelation(At.defaultClient.config.enableAutoDependencyCorrelation,At.defaultClient.config.enableUseAsyncHooks),lre.enable(At.defaultClient.config.enableAutoCollectRequests),z4e.enable(At.defaultClient.config.enableAutoCollectDependencies),zAe.enable(At.defaultClient.config.enableWebInstrumentation,At.defaultClient.config.webInstrumentationConnectionString),At.defaultClient.config.enableSendLiveMetrics&&(At.liveMetricsClient||(At.liveMetricsClient=new U2i(At.defaultClient.config,At.defaultClient.context,At.defaultClient.getAuthorizationHandler,At.defaultClient),ayt=new cTr(At.liveMetricsClient,1e3,!0),At.liveMetricsClient.addCollector(ayt),At.defaultClient.quickPulseClient=At.liveMetricsClient),At.liveMetricsClient.enable(At.defaultClient.config.enableSendLiveMetrics)),Y4e.enable(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=lTr.AutoCollectNativePerformance.parseEnabled(At.defaultClient.config.enableAutoCollectExtendedMetrics,At.defaultClient.config);YAe.enable(At.defaultClient.config.enableAutoCollectExtendedMetrics,t.disabledMetrics),At.defaultClient&&At.defaultClient.channel&&At.defaultClient.channel.setUseDiskRetryCaching(At.defaultClient.config.enableUseDiskRetryCaching,At.defaultClient.config.enableResendInterval,At.defaultClient.config.enableMaxBytesOnDisk)}else j4e.warn("Start cannot be called before setup");return uTr}a(Q2i,"start");function aLa(){return aTr.CorrelationContextManager.getCurrentContext()}a(aLa,"getCorrelationContext");function cLa(t,e){return aTr.CorrelationContextManager.startOperation(t,e)}a(cLa,"startOperation");function lLa(t,e){return aTr.CorrelationContextManager.wrapCallback(t,e)}a(lLa,"wrapWithCorrelationContext");var uTr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return F2i.w3cEnabled=e===sTr.AI_AND_W3C,t},t.setAutoCollectConsole=function(e,r){return r===void 0&&(r=!1),At.defaultClient&&(At.defaultClient.config.enableAutoCollectExternalLoggers=e,At.defaultClient.config.enableAutoCollectConsole=r,vI&&H4e.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectExceptions=e,vI&&G4e.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),At.defaultClient){At.defaultClient.config.enableAutoCollectPerformance=e;var n=lTr.AutoCollectNativePerformance.parseEnabled(r,At.defaultClient.config);At.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,vI&&($4e.enable(e),YAe.enable(At.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,vI&&V4e.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectHeartbeat=e,vI&&W4e.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableWebInstrumentation=e,At.defaultClient.config.webInstrumentationConnectionString=r,vI&&zAe.enable(At.defaultClient.config.enableAutoWebSnippetInjection,At.defaultClient.config.webSnippetConnectionString)),t},t.enableWebInstrumentation=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableWebInstrumentation=e,At.defaultClient.config.webInstrumentationConnectionString=r,vI&&zAe.enable(At.defaultClient.config.enableWebInstrumentation,At.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectRequests=e,vI&&lre.enable(e)),t},t.setAutoCollectDependencies=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectDependencies=e,vI&&z4e.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableAutoDependencyCorrelation=e,At.defaultClient.config.enableUseAsyncHooks=r,vI&&lre.useAutoCorrelation(e,r)),t},t.setUseDiskRetryCaching=function(e,r,n){return At.defaultClient&&(At.defaultClient.config.enableUseDiskRetryCaching=e,At.defaultClient.config.enableResendInterval=r,At.defaultClient.config.enableMaxBytesOnDisk=n,At.defaultClient.channel&&At.defaultClient.channel.setUseDiskRetryCaching(At.defaultClient.config.enableUseDiskRetryCaching,At.defaultClient.config.enableResendInterval,At.defaultClient.config.enableMaxBytesOnDisk)),t},t.setInternalLogging=function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!0),j4e.enableDebug=e,j4e.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,vI&&Y4e.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),At.defaultClient?(!At.liveMetricsClient&&e?(At.liveMetricsClient=new U2i(At.defaultClient.config,At.defaultClient.context,At.defaultClient.getAuthorizationHandler,At.defaultClient),ayt=new cTr(At.liveMetricsClient,1e3,!0),At.liveMetricsClient.addCollector(ayt),At.defaultClient.quickPulseClient=At.liveMetricsClient):At.liveMetricsClient&&At.liveMetricsClient.enable(e),At.defaultClient.config.enableSendLiveMetrics=e,t):(j4e.warn("Live metrics client cannot be setup without the default client"),t)},t.start=Q2i,t})();At.Configuration=uTr;function uLa(){F2i.w3cEnabled=!0,At.defaultClient=null,vI=!1,H4e&&H4e.dispose(),G4e&&G4e.dispose(),$4e&&$4e.dispose(),V4e&&V4e.dispose(),W4e&&W4e.dispose(),zAe&&zAe.dispose(),YAe&&YAe.dispose(),lre&&lre.dispose(),z4e&&z4e.dispose(),At.liveMetricsClient&&(At.liveMetricsClient.enable(!1),At.liveMetricsClient=void 0),Y4e&&Y4e.dispose()}a(uLa,"dispose")});var fTr=I(XR=>{"use strict";p();var dLa=XR&&XR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fLa=XR&&XR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),j2i=XR&&XR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{this.client.flush({callback:a(()=>{e(void 0)},"callback")})})}massageEventName(e){return gLa(e)?H2i(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};XR.AzureInsightReporter=dTr;function ALa(t,e,r){let n=new pLa.TelemetryClient(r);return n.config.enableAutoCollectRequests=!1,n.config.enableAutoCollectPerformance=!1,n.config.enableAutoCollectExceptions=!1,n.config.enableAutoCollectConsole=!1,n.config.enableAutoCollectDependencies=!1,n.config.noDiagnosticChannel=!0,G2i(t,e,n),n}a(ALa,"createAppInsightsClient");function G2i(t,e,r){r.commonProperties=yLa(r.commonProperties,e),r.context.tags[r.context.keys.cloudRoleInstance]="REDACTED",r.context.tags[r.context.keys.sessionId]=e.sessionId;let n=t.copilotTelemetryURL;n&&URL.canParse(n)&&(r.config.endpointUrl=n)}a(G2i,"configureReporter");function yLa(t,e){return t=t||{},t.common_os=cyt.platform(),t.common_platformversion=cyt.release(),t.common_arch=cyt.arch(),t.common_cpu=Array.from(new Set(cyt.cpus().map(r=>r.model))).join(),t.common_vscodemachineid=e.machineId,t.common_vscodesessionid=e.sessionId,t.client_deviceid=e.devDeviceId,t.common_uikind=e.uiKind,t.common_remotename=e.remoteName??"none",t.common_isnewappinstall="",t}a(yLa,"decorateWithCommonProperties")});var $2i=I((CNp,_La)=>{_La.exports={name:"copilot-chat",displayName:"GitHub Copilot",description:"AI chat features powered by Copilot",version:"0.57.0",build:"1",completionsCoreVersion:"1.378.1799",internalLargeStorageAriaKey:"ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917",ariaKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",buildType:"dev",publisher:"GitHub",homepage:"https://github.com/features/copilot?editor=vscode",license:"SEE LICENSE IN LICENSE.txt",repository:{type:"git",url:"https://github.com/microsoft/vscode-copilot-chat"},bugs:{url:"https://github.com/microsoft/vscode/issues"},qna:"https://github.com/github-community/community/discussions/categories/copilot",icon:"assets/copilot.png",pricing:"Trial",engines:{vscode:"^1.129.0",npm:">=9.0.0",node:">=22.14.0"},categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["ai","openai","codex","pilot","snippets","documentation","autocomplete","intellisense","refactor","javascript","python","typescript","php","go","golang","ruby","c++","c#","java","kotlin","co-pilot"],badges:[{url:"https://img.shields.io/badge/GitHub%20Copilot-Subscription%20Required-orange",href:"https://github.com/github-copilot/signup?editor=vscode",description:"%github.copilot.badge.signUp%"},{url:"https://img.shields.io/github/stars/github/copilot-docs?style=social",href:"https://github.com/github/copilot-docs",description:"%github.copilot.badge.star%"},{url:"https://img.shields.io/youtube/channel/views/UC7c3Kb6jYCRj4JOHHZTxKsQ?style=social",href:"https://www.youtube.com/@GitHub/search?query=copilot",description:"%github.copilot.badge.youtube%"},{url:"https://img.shields.io/twitter/follow/github?style=social",href:"https://twitter.com/github",description:"%github.copilot.badge.twitter%"}],activationEvents:["onStartupFinished","onLanguageModelChat:copilot","onUri","onFileSystem:ccreq","onFileSystem:ccsettings"],main:"./dist/extension",l10n:"./l10n",enabledApiProposals:["agentSessionsWorkspace","agentsWindowConfiguration","chatDebug","chatHooks","extensionsAny","newSymbolNamesProvider","interactive","codeActionAI","activeComment","commentReveal","contribCommentThreadAdditionalMenu","contribCommentsViewThreadMenus","contribChatEditorInlineGutterMenu","documentFiltersExclusive","embeddings","findTextInFiles","findTextInFiles2","languageModelToolSupportsModel","findFiles2","textSearchProvider","terminalDataWriteEvent","terminalExecuteCommandEvent","terminalSelection","terminalQuickFixProvider","mappedEditsProvider","aiRelatedInformation","aiSettingsSearch","chatParticipantAdditions","defaultChatParticipant","contribSourceControlInputBoxMenu","authLearnMore","testObserver","aiTextSearchProvider","chatParticipantPrivate","chatProvider","contribDebugCreateConfiguration","chatReferenceDiagnostic","textSearchProvider2","chatReferenceBinaryData","languageModelSystem","languageModelCapabilities","languageModelPricing","inlineCompletionsAdditions","chatStatusItem","chatInputNotification","taskProblemMatcherStatus","contribLanguageModelToolSets","textDocumentChangeReason","resolvers","taskExecutionTerminal","dataChannels","languageModelThinkingPart","chatSessionsProvider","devDeviceId","contribEditorContentMenu","chatPromptFiles","mcpServerDefinitions","tabInputMultiDiff","workspaceTrust","environmentPower","terminalTitle","toolInvocationApproveCombination","chatSessionCustomizationProvider"],contributes:{languageModelTools:[{name:"copilot_searchCodebase",toolReferenceName:"codebase",displayName:"%copilot.tools.searchCodebase.name%",icon:"$(folder)",userDescription:"%copilot.codebase.tool.description%",modelDescription:"Run a natural language search for relevant code or documentation comments from the user's current workspace. Returns relevant code snippets from the user's current workspace if it is large, or the full contents of the workspace if it is small.",tags:["codesearch","vscode_codesearch"],inputSchema:{type:"object",properties:{query:{type:"string",description:"The query to search the codebase for. Should contain all relevant context. Should ideally be text that might appear in the codebase, such as function names, variable names, or comments."}},required:["query"]}},{name:"execution_subagent",toolReferenceName:"executionSubagent",displayName:"%copilot.tools.executionSubagent.name%",icon:"$(play)",userDescription:"%copilot.tools.executionSubagent.description%",modelDescription:`Launch an iterative execution-focused subagent that performs an execution-based task. +`,"utf-8")],o=yMa(n);o&&t.headers.set("Content-Length",o),t.body=await(0,pMa.concat)(n)}a(_Ma,"buildRequestBody");PAe.multipartPolicyName="multipartPolicy";var EMa=70,vMa=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function CMa(t){if(t.length>EMa)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!vMa.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(CMa,"assertValidBoundary");function bMa(){return{name:PAe.multipartPolicyName,async sendRequest(t,e){var r;if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,o=(r=t.headers.get("Content-Type"))!==null&&r!==void 0?r:"multipart/mixed",s=o.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!s)throw new Error(`Got multipart request body, but content-type header was not multipart: ${o}`);let[,c,l]=s;if(l&&n&&l!==n)throw new Error(`Multipart boundary was specified as ${l} in the header, but got ${n} in the request body`);return n??(n=l),n?CMa(n):n=mMa(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await _Ma(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(bMa,"multipartPolicy")});var S1r=I(DAe=>{"use strict";p();Object.defineProperty(DAe,"__esModule",{value:!0});DAe.decompressResponsePolicyName=void 0;DAe.decompressResponsePolicy=SMa;DAe.decompressResponsePolicyName="decompressResponsePolicy";function SMa(){return{name:DAe.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(SMa,"decompressResponsePolicy")});var UAt=I(FAt=>{"use strict";p();Object.defineProperty(FAt,"__esModule",{value:!0});FAt.delay=xMa;FAt.parseHeaderValueAsNumber=wMa;var TMa=I4e(),IMa="The operation was aborted.";function xMa(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new TMa.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:IMa)),"rejectOnAbort"),u=a(()=>{r?.abortSignal&&c&&r.abortSignal.removeEventListener("abort",c)},"removeListeners");if(c=a(()=>(s&&clearTimeout(s),u(),l()),"onAborted"),r?.abortSignal&&r.abortSignal.aborted)return l();s=setTimeout(()=>{u(),n(e)},t),r?.abortSignal&&r.abortSignal.addEventListener("abort",c)})}a(xMa,"delay");function wMa(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(wMa,"parseHeaderValueAsNumber")});var qAt=I(QAt=>{"use strict";p();Object.defineProperty(QAt,"__esModule",{value:!0});QAt.isThrottlingRetryResponse=PMa;QAt.throttlingRetryStrategy=DMa;var RMa=UAt(),T1r="Retry-After",kMa=["retry-after-ms","x-ms-retry-after-ms",T1r];function lPi(t){if(t&&[429,503].includes(t.status))try{for(let o of kMa){let s=(0,RMa.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===T1r?1e3:1)}let e=t.headers.get(T1r);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(lPi,"getRetryAfterInMs");function PMa(t){return Number.isFinite(lPi(t))}a(PMa,"isThrottlingRetryResponse");function DMa(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=lPi(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(DMa,"throttlingRetryStrategy")});var jAt=I(R4e=>{"use strict";p();Object.defineProperty(R4e,"__esModule",{value:!0});R4e.exponentialRetryStrategy=BMa;R4e.isExponentialRetryResponse=uPi;R4e.isSystemError=dPi;var NMa=gL(),MMa=qAt(),OMa=1e3,LMa=1e3*64;function BMa(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:OMa,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:LMa,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=dPi(u),f=d&&t.ignoreSystemErrors,h=uPi(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,MMa.isThrottlingRetryResponse)(l)||!h)||m||f)return{skipStrategy:!0};if(u&&!d&&!h)return{errorToThrow:u};let A=s*Math.pow(2,c),y=Math.min(o,A);return s=y/2+(0,NMa.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(BMa,"exponentialRetryStrategy");function uPi(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(uPi,"isExponentialRetryResponse");function dPi(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(dPi,"isSystemError")});var NAe=I(I1r=>{"use strict";p();Object.defineProperty(I1r,"__esModule",{value:!0});I1r.retryPolicy=jMa;var FMa=UAt(),UMa=qgt(),QMa=I4e(),fPi=b$(),pPi=(0,UMa.createClientLogger)("core-rest-pipeline retryPolicy"),qMa="retryPolicy";function jMa(t,e={maxRetries:fPi.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||pPi;return{name:qMa,async sendRequest(n,o){var s,c;let l,u,d=-1;e:for(;;){d+=1,l=void 0,u=void 0;try{r.info(`Retry ${d}: Attempting to send request`,n.requestId),l=await o(n),r.info(`Retry ${d}: Received a response from request`,n.requestId)}catch(f){if(r.error(`Retry ${d}: Received an error from request`,n.requestId),u=f,!f||u.name!=="RestError")throw f;l=u.response}if(!((s=n.abortSignal)===null||s===void 0)&&s.aborted)throw r.error(`Retry ${d}: Request aborted.`),new QMa.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:fPi.DEFAULT_RETRY_POLICY_COUNT)){if(r.info(`Retry ${d}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),u)throw u;if(l)return l;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${d}: Processing ${t.length} retry strategies.`);t:for(let f of t){let h=f.logger||pPi;h.info(`Retry ${d}: Processing retry strategy ${f.name}.`);let m=f.retry({retryCount:d,response:l,responseError:u});if(m.skipStrategy){h.info(`Retry ${d}: Skipped.`);continue t}let{errorToThrow:g,retryAfterInMs:A,redirectTo:y}=m;if(g)throw h.error(`Retry ${d}: Retry strategy ${f.name} throws error:`,g),g;if(A||A===0){h.info(`Retry ${d}: Retry strategy ${f.name} retries after ${A}`),await(0,FMa.delay)(A,void 0,{abortSignal:n.abortSignal});continue e}if(y){h.info(`Retry ${d}: Retry strategy ${f.name} redirects to ${y}`),n.url=y;continue e}}if(u)throw r.info("None of the retry strategies could work with the received error. Throwing it."),u;if(l)return r.info("None of the retry strategies could work with the received response. Returning it."),l}}}}a(jMa,"retryPolicy")});var x1r=I(MAe=>{"use strict";p();Object.defineProperty(MAe,"__esModule",{value:!0});MAe.defaultRetryPolicyName=void 0;MAe.defaultRetryPolicy=WMa;var HMa=jAt(),GMa=qAt(),$Ma=NAe(),VMa=b$();MAe.defaultRetryPolicyName="defaultRetryPolicy";function WMa(t={}){var e;return{name:MAe.defaultRetryPolicyName,sendRequest:(0,$Ma.retryPolicy)([(0,GMa.throttlingRetryStrategy)(),(0,HMa.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:VMa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(WMa,"defaultRetryPolicy")});var k4e=I(R1r=>{"use strict";p();Object.defineProperty(R1r,"__esModule",{value:!0});R1r.createHttpHeaders=YMa;function HAt(t){return t.toLowerCase()}a(HAt,"normalizeName");function*zMa(t){for(let e of t.values())yield[e.name,e.value]}a(zMa,"headerIterator");var w1r=class{static{a(this,"HttpHeadersImpl")}constructor(e){if(this._headersMap=new Map,e)for(let r of Object.keys(e))this.set(r,e[r])}set(e,r){this._headersMap.set(HAt(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(HAt(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(HAt(e))}delete(e){this._headersMap.delete(HAt(e))}toJSON(e={}){let r={};if(e.preserveCase)for(let n of this._headersMap.values())r[n.name]=n.value;else for(let[n,o]of this._headersMap)r[n]=o.value;return r}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return zMa(this._headersMap)}};function YMa(t){return new w1r(t)}a(YMa,"createHttpHeaders")});var k1r=I(OAe=>{"use strict";p();Object.defineProperty(OAe,"__esModule",{value:!0});OAe.formDataPolicyName=void 0;OAe.formDataPolicy=JMa;var mPi=gL(),hPi=k4e();OAe.formDataPolicyName="formDataPolicy";function KMa(t){var e;let r={};for(let[n,o]of t.entries())(e=r[n])!==null&&e!==void 0||(r[n]=[]),r[n].push(o);return r}a(KMa,"formDataToFormDataMap");function JMa(){return{name:OAe.formDataPolicyName,async sendRequest(t,e){if(mPi.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=KMa(t.body),t.body=void 0),t.formData){let r=t.headers.get("Content-Type");r&&r.indexOf("application/x-www-form-urlencoded")!==-1?t.body=ZMa(t.formData):await XMa(t.formData,t),t.formData=void 0}return e(t)}}}a(JMa,"formDataPolicy");function ZMa(t){let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.append(r,o.toString());else e.append(r,n.toString());return e.toString()}a(ZMa,"wwwFormUrlEncode");async function XMa(t,e){let r=e.headers.get("Content-Type");if(r&&!r.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",r??"multipart/form-data");let n=[];for(let[o,s]of Object.entries(t))for(let c of Array.isArray(s)?s:[s])if(typeof c=="string")n.push({headers:(0,hPi.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,mPi.stringToUint8Array)(c,"utf-8")});else{if(c==null||typeof c!="object")throw new Error(`Unexpected value for key ${o}: ${c}. Value should be serialized to string first.`);{let l=c.name||"blob",u=(0,hPi.createHttpHeaders)();u.set("Content-Disposition",`form-data; name="${o}"; filename="${l}"`),u.set("Content-Type",c.type||"application/octet-stream"),n.push({headers:u,body:c})}}e.multipartBody={parts:n}}a(XMa,"prepareFormData")});var P1r=I(ZR=>{"use strict";p();Object.defineProperty(ZR,"__esModule",{value:!0});ZR.globalNoProxyList=ZR.proxyPolicyName=void 0;ZR.loadNoProxy=EPi;ZR.getDefaultProxySettings=lOa;ZR.proxyPolicy=dOa;var eOa=P6t(),tOa=D6t(),rOa=ire(),nOa="HTTPS_PROXY",iOa="HTTP_PROXY",oOa="ALL_PROXY",sOa="NO_PROXY";ZR.proxyPolicyName="proxyPolicy";ZR.globalNoProxyList=[];var yPi=!1,aOa=new Map;function GAt(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(GAt,"getEnvironmentValue");function _Pi(){if(!process)return;let t=GAt(nOa),e=GAt(oOa),r=GAt(iOa);return t||e||r}a(_Pi,"loadEnvironmentProxyValue");function cOa(t,e,r){if(e.length===0)return!1;let n=new URL(t).hostname;if(r?.has(n))return r.get(n);let o=!1;for(let s of e)s[0]==="."?(n.endsWith(s)||n.length===s.length-1&&n===s.slice(1))&&(o=!0):n===s&&(o=!0);return r?.set(n,o),o}a(cOa,"isBypassed");function EPi(){let t=GAt(sOa);return yPi=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(EPi,"loadNoProxy");function lOa(t){if(!t&&(t=_Pi(),!t))return;let e=new URL(t);return{host:(e.protocol?e.protocol+"//":"")+e.hostname,port:Number.parseInt(e.port||"80"),username:e.username,password:e.password}}a(lOa,"getDefaultProxySettings");function uOa(){let t=_Pi();return t?new URL(t):void 0}a(uOa,"getDefaultProxySettingsInternal");function gPi(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}a(gPi,"getUrlFromProxySettings");function APi(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&rOa.logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let s=t.headers.toJSON();o?(e.httpProxyAgent||(e.httpProxyAgent=new tOa.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new eOa.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(APi,"setProxyAgentOnRequest");function dOa(t,e){yPi||ZR.globalNoProxyList.push(...EPi());let r=t?gPi(t):uOa(),n={};return{name:ZR.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!cOa(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:ZR.globalNoProxyList,e?.customNoProxyList?void 0:aOa)?APi(o,n,r):o.proxySettings&&APi(o,n,gPi(o.proxySettings)),s(o)}}}a(dOa,"proxyPolicy")});var D1r=I(LAe=>{"use strict";p();Object.defineProperty(LAe,"__esModule",{value:!0});LAe.setClientRequestIdPolicyName=void 0;LAe.setClientRequestIdPolicy=fOa;LAe.setClientRequestIdPolicyName="setClientRequestIdPolicy";function fOa(t="x-ms-client-request-id"){return{name:LAe.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(fOa,"setClientRequestIdPolicy")});var N1r=I(BAe=>{"use strict";p();Object.defineProperty(BAe,"__esModule",{value:!0});BAe.tlsPolicyName=void 0;BAe.tlsPolicy=pOa;BAe.tlsPolicyName="tlsPolicy";function pOa(t){return{name:BAe.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(pOa,"tlsPolicy")});var M1r=I(M6=>{"use strict";p();Object.defineProperty(M6,"__esModule",{value:!0});M6.TracingContextImpl=M6.knownContextKeys=void 0;M6.createTracingContext=hOa;M6.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function hOa(t={}){let e=new $At(t.parentContext);return t.span&&(e=e.setValue(M6.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(M6.knownContextKeys.namespace,t.namespace)),e}a(hOa,"createTracingContext");var $At=class t{static{a(this,"TracingContextImpl")}constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,r){let n=new t(this);return n._contextMap.set(e,r),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let r=new t(this);return r._contextMap.delete(e),r}};M6.TracingContextImpl=$At});var O1r=I(FAe=>{"use strict";p();Object.defineProperty(FAe,"__esModule",{value:!0});FAe.createDefaultTracingSpan=vPi;FAe.createDefaultInstrumenter=CPi;FAe.useInstrumenter=gOa;FAe.getInstrumenter=AOa;var mOa=M1r(),VAt=TBt();function vPi(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(vPi,"createDefaultTracingSpan");function CPi(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:vPi(),tracingContext:(0,mOa.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(CPi,"createDefaultInstrumenter");function gOa(t){VAt.state.instrumenterImplementation=t}a(gOa,"useInstrumenter");function AOa(){return VAt.state.instrumenterImplementation||(VAt.state.instrumenterImplementation=CPi()),VAt.state.instrumenterImplementation}a(AOa,"getInstrumenter")});var bPi=I(B1r=>{"use strict";p();Object.defineProperty(B1r,"__esModule",{value:!0});B1r.createTracingClient=yOa;var WAt=O1r(),L1r=M1r();function yOa(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,WAt.getInstrumenter)().startSpan(d,Object.assign(Object.assign({},h),{packageName:r,packageVersion:n,tracingContext:(m=f?.tracingOptions)===null||m===void 0?void 0:m.tracingContext})),A=g.tracingContext,y=g.span;A.getValue(L1r.knownContextKeys.namespace)||(A=A.setValue(L1r.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(L1r.knownContextKeys.namespace));let _=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:_}}a(o,"startSpan");async function s(d,f,h,m){let{span:g,updatedOptions:A}=o(d,f,m);try{let y=await c(A.tracingOptions.tracingContext,()=>Promise.resolve(h(A,g)));return g.setStatus({status:"success"}),y}catch(y){throw g.setStatus({status:"error",error:y}),y}finally{g.end()}}a(s,"withSpan");function c(d,f,...h){return(0,WAt.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,WAt.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,WAt.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(yOa,"createTracingClient")});var SPi=I(UAe=>{"use strict";p();Object.defineProperty(UAe,"__esModule",{value:!0});UAe.createTracingClient=UAe.useInstrumenter=void 0;var _Oa=O1r();Object.defineProperty(UAe,"useInstrumenter",{enumerable:!0,get:a(function(){return _Oa.useInstrumenter},"get")});var EOa=bPi();Object.defineProperty(UAe,"createTracingClient",{enumerable:!0,get:a(function(){return EOa.createTracingClient},"get")})});var TPi=I(zAt=>{"use strict";p();Object.defineProperty(zAt,"__esModule",{value:!0});zAt.custom=void 0;var vOa=require("node:util");zAt.custom=vOa.inspect.custom});var YAt=I(P4e=>{"use strict";p();Object.defineProperty(P4e,"__esModule",{value:!0});P4e.RestError=void 0;P4e.isRestError=IOa;var COa=gL(),bOa=TPi(),SOa=NAt(),TOa=new SOa.Sanitizer,QAe=class t extends Error{static{a(this,"RestError")}constructor(e,r={}){super(e),this.name="RestError",this.code=r.code,this.statusCode=r.statusCode,Object.defineProperty(this,"request",{value:r.request,enumerable:!1}),Object.defineProperty(this,"response",{value:r.response,enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}[bOa.custom](){return`RestError: ${this.message} + ${TOa.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};P4e.RestError=QAe;QAe.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";QAe.PARSE_ERROR="PARSE_ERROR";function IOa(t){return t instanceof QAe?!0:(0,COa.isError)(t)&&t.name==="RestError"}a(IOa,"isRestError")});var F1r=I(qAe=>{"use strict";p();Object.defineProperty(qAe,"__esModule",{value:!0});qAe.tracingPolicyName=void 0;qAe.tracingPolicy=DOa;var xOa=SPi(),wOa=b$(),ROa=y1r(),KAt=ire(),D4e=gL(),kOa=YAt(),POa=NAt();qAe.tracingPolicyName="tracingPolicy";function DOa(t={}){let e=(0,ROa.getUserAgentValue)(t.userAgentPrefix),r=new POa.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=NOa();return{name:qAe.tracingPolicyName,async sendRequest(o,s){var c,l;if(!n||!(!((c=o.tracingOptions)===null||c===void 0)&&c.tracingContext))return s(o);let u=await e,d={"http.url":r.sanitizeUrl(o.url),"http.method":o.method,"http.user_agent":u,requestId:o.requestId};u&&(d["http.user_agent"]=u);let{span:f,tracingContext:h}=(l=MOa(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return LOa(f,m),m}catch(m){throw OOa(f,m),m}}}}a(DOa,"tracingPolicy");function NOa(){try{return(0,xOa.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:wOa.SDK_VERSION})}catch(t){KAt.logger.warning(`Error when creating the TracingClient: ${(0,D4e.getErrorMessage)(t)}`);return}}a(NOa,"tryCreateTracingClient");function MOa(t,e,r){try{let{span:n,updatedOptions:o}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let s=t.createRequestHeaders(o.tracingOptions.tracingContext);for(let[c,l]of Object.entries(s))e.headers.set(c,l);return{span:n,tracingContext:o.tracingOptions.tracingContext}}catch(n){KAt.logger.warning(`Skipping creating a tracing span due to an error: ${(0,D4e.getErrorMessage)(n)}`);return}}a(MOa,"tryCreateSpan");function OOa(t,e){try{t.setStatus({status:"error",error:(0,D4e.isError)(e)?e:void 0}),(0,kOa.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){KAt.logger.warning(`Skipping tracing span processing due to an error: ${(0,D4e.getErrorMessage)(r)}`)}}a(OOa,"tryProcessError");function LOa(t,e){try{t.setAttribute("http.status_code",e.status);let r=e.headers.get("x-ms-request-id");r&&t.setAttribute("serviceRequestId",r),t.setStatus({status:"success"}),t.end()}catch(r){KAt.logger.warning(`Skipping tracing span processing due to an error: ${(0,D4e.getErrorMessage)(r)}`)}}a(LOa,"tryProcessResponse")});var wPi=I(U1r=>{"use strict";p();Object.defineProperty(U1r,"__esModule",{value:!0});U1r.createPipelineFromOptions=zOa;var BOa=h1r(),FOa=$Sr(),UOa=m1r(),QOa=_1r(),IPi=b1r(),qOa=S1r(),jOa=x1r(),HOa=k1r(),xPi=gL(),GOa=P1r(),$Oa=D1r(),VOa=N1r(),WOa=F1r();function zOa(t){var e;let r=(0,FOa.createEmptyPipeline)();return xPi.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,VOa.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,GOa.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,qOa.decompressResponsePolicy)())),r.addPolicy((0,HOa.formDataPolicy)(),{beforePolicies:[IPi.multipartPolicyName]}),r.addPolicy((0,QOa.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,$Oa.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,IPi.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,jOa.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,WOa.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),xPi.isNodeLike&&r.addPolicy((0,UOa.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,BOa.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(zOa,"createPipelineFromOptions")});var MPi=I(ZAt=>{"use strict";p();Object.defineProperty(ZAt,"__esModule",{value:!0});ZAt.getBodyLength=NPi;ZAt.createNodeHttpClient=t5a;var H1r=(Y3(),Wa(jQ)),Q1r=H1r.__importStar(require("node:http")),q1r=H1r.__importStar(require("node:https")),RPi=H1r.__importStar(require("node:zlib")),YOa=require("node:stream"),kPi=I4e(),KOa=k4e(),O4e=YAt(),N4e=ire(),JOa={};function M4e(t){return t&&typeof t.pipe=="function"}a(M4e,"isReadableStream");function PPi(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(PPi,"isStreamComplete");function DPi(t){return t&&typeof t.byteLength=="number"}a(DPi,"isArrayBuffer");var JAt=class extends YOa.Transform{static{a(this,"ReportTransform")}_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(o){n(o)}}constructor(e){super(),this.loadedBytes=0,this.progressCallback=e}},j1r=class{static{a(this,"NodeHttpClient")}constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(e){var r,n,o;let s=new AbortController,c;if(e.abortSignal){if(e.abortSignal.aborted)throw new kPi.AbortError("The operation was aborted.");c=a(h=>{h.type==="abort"&&s.abort()},"abortListener"),e.abortSignal.addEventListener("abort",c)}e.timeout>0&&setTimeout(()=>{s.abort()},e.timeout);let l=e.headers.get("Accept-Encoding"),u=l?.includes("gzip")||l?.includes("deflate"),d=typeof e.body=="function"?e.body():e.body;if(d&&!e.headers.has("Content-Length")){let h=NPi(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let _=e.onUploadProgress,E=new JAt(_);E.on("error",v=>{N4e.logger.error("Error in upload progress",v)}),M4e(d)?d.pipe(E):E.end(d),d=E}let h=await this.makeRequest(e,s,d),m=ZOa(h),A={status:(r=h.statusCode)!==null&&r!==void 0?r:0,headers:m,request:e};if(e.method==="HEAD")return h.resume(),A;f=u?XOa(h,m):h;let y=e.onDownloadProgress;if(y){let _=new JAt(y);_.on("error",E=>{N4e.logger.error("Error in download progress",E)}),f.pipe(_),f=_}return!((n=e.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((o=e.streamResponseStatusCodes)===null||o===void 0)&&o.has(A.status)?A.readableStreamBody=f:A.bodyAsText=await e5a(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();M4e(d)&&(h=PPi(d));let m=Promise.resolve();M4e(f)&&(m=PPi(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{N4e.logger.warning("Error when cleaning up abortListener on httpRequest",g)})}}}makeRequest(e,r,n){var o;let s=new URL(e.url),c=s.protocol!=="https:";if(c&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let u={agent:(o=e.agent)!==null&&o!==void 0?o:this.getOrCreateAgent(e,c),hostname:s.hostname,path:`${s.pathname}${s.search}`,port:s.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0})};return new Promise((d,f)=>{let h=c?Q1r.request(u,d):q1r.request(u,d);h.once("error",m=>{var g;f(new O4e.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:O4e.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new kPi.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&M4e(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):DPi(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(N4e.logger.error("Unrecognized body type",n),f(new O4e.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?Q1r.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new Q1r.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return q1r.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:JOa,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(N4e.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new q1r.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function ZOa(t){let e=(0,KOa.createHttpHeaders)();for(let r of Object.keys(t.headers)){let n=t.headers[r];Array.isArray(n)?n.length>0&&e.set(r,n[0]):n&&e.set(r,n)}return e}a(ZOa,"getResponseHeaders");function XOa(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=RPi.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=RPi.createInflate();return t.pipe(n),n}return t}a(XOa,"getDecodedResponseStream");function e5a(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{Buffer.isBuffer(o)?n.push(o):n.push(Buffer.from(o))}),t.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),t.on("error",o=>{o&&o?.name==="AbortError"?r(o):r(new O4e.RestError(`Error reading response as text: ${o.message}`,{code:O4e.RestError.PARSE_ERROR}))})})}a(e5a,"streamToText");function NPi(t){return t?Buffer.isBuffer(t)?t.length:M4e(t)?null:DPi(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(NPi,"getBodyLength");function t5a(){return new j1r}a(t5a,"createNodeHttpClient")});var OPi=I(G1r=>{"use strict";p();Object.defineProperty(G1r,"__esModule",{value:!0});G1r.createDefaultHttpClient=n5a;var r5a=MPi();function n5a(){return(0,r5a.createNodeHttpClient)()}a(n5a,"createDefaultHttpClient")});var LPi=I(V1r=>{"use strict";p();Object.defineProperty(V1r,"__esModule",{value:!0});V1r.createPipelineRequest=s5a;var i5a=k4e(),o5a=gL(),$1r=class{static{a(this,"PipelineRequestImpl")}constructor(e){var r,n,o,s,c,l,u;this.url=e.url,this.body=e.body,this.headers=(r=e.headers)!==null&&r!==void 0?r:(0,i5a.createHttpHeaders)(),this.method=(n=e.method)!==null&&n!==void 0?n:"GET",this.timeout=(o=e.timeout)!==null&&o!==void 0?o:0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=(s=e.disableKeepAlive)!==null&&s!==void 0?s:!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=(c=e.withCredentials)!==null&&c!==void 0?c:!1,this.abortSignal=e.abortSignal,this.tracingOptions=e.tracingOptions,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||(0,o5a.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function s5a(t){return new $1r(t)}a(s5a,"createPipelineRequest")});var BPi=I(L4e=>{"use strict";p();Object.defineProperty(L4e,"__esModule",{value:!0});L4e.exponentialRetryPolicyName=void 0;L4e.exponentialRetryPolicy=u5a;var a5a=jAt(),c5a=NAe(),l5a=b$();L4e.exponentialRetryPolicyName="exponentialRetryPolicy";function u5a(t={}){var e;return(0,c5a.retryPolicy)([(0,a5a.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:l5a.DEFAULT_RETRY_POLICY_COUNT})}a(u5a,"exponentialRetryPolicy")});var FPi=I(jAe=>{"use strict";p();Object.defineProperty(jAe,"__esModule",{value:!0});jAe.systemErrorRetryPolicyName=void 0;jAe.systemErrorRetryPolicy=h5a;var d5a=jAt(),f5a=NAe(),p5a=b$();jAe.systemErrorRetryPolicyName="systemErrorRetryPolicy";function h5a(t={}){var e;return{name:jAe.systemErrorRetryPolicyName,sendRequest:(0,f5a.retryPolicy)([(0,d5a.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:p5a.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(h5a,"systemErrorRetryPolicy")});var UPi=I(HAe=>{"use strict";p();Object.defineProperty(HAe,"__esModule",{value:!0});HAe.throttlingRetryPolicyName=void 0;HAe.throttlingRetryPolicy=y5a;var m5a=qAt(),g5a=NAe(),A5a=b$();HAe.throttlingRetryPolicyName="throttlingRetryPolicy";function y5a(t={}){var e;return{name:HAe.throttlingRetryPolicyName,sendRequest:(0,g5a.retryPolicy)([(0,m5a.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:A5a.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(y5a,"throttlingRetryPolicy")});var W1r=I(GAe=>{"use strict";p();Object.defineProperty(GAe,"__esModule",{value:!0});GAe.DEFAULT_CYCLER_OPTIONS=void 0;GAe.createTokenCycler=v5a;var _5a=UAt();GAe.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function E5a(t,e,r){async function n(){if(Date.now()t.getToken(u,d),"tryGetAccessToken"),s.retryIntervalInMs,(f=n?.expiresOnTimestamp)!==null&&f!==void 0?f:Date.now()).then(m=>(r=null,n=m,o=d.tenantId,n)).catch(m=>{throw r=null,n=null,o=void 0,m})),r}return a(l,"refresh"),async(u,d)=>{let f=!!d.claims,h=o!==d.tenantId;return f&&(n=null),h||f||c.mustRefresh?l(u,d):(c.shouldRefresh&&l(u,d),n)}}a(v5a,"createTokenCycler")});var QPi=I($Ae=>{"use strict";p();Object.defineProperty($Ae,"__esModule",{value:!0});$Ae.bearerTokenAuthenticationPolicyName=void 0;$Ae.bearerTokenAuthenticationPolicy=I5a;var C5a=W1r(),b5a=ire();$Ae.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function S5a(t){let{scopes:e,getAccessToken:r,request:n}=t,o={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions},s=await r(e,o);s&&t.request.headers.set("Authorization",`Bearer ${s.token}`)}a(S5a,"defaultAuthorizeRequest");function T5a(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a(T5a,"getChallenge");function I5a(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||b5a.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:S5a,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,C5a.createTokenCycler)(r):()=>Promise.resolve(null);return{name:$Ae.bearerTokenAuthenticationPolicyName,async sendRequest(u,d){if(!u.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await c.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:u,getAccessToken:l,logger:s});let f,h;try{f=await d(u)}catch(m){h=m,f=m.response}if(c.authorizeRequestOnChallenge&&f?.status===401&&T5a(f)&&await c.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:u,response:f,getAccessToken:l,logger:s}))return d(u);if(h)throw h;return f}}}a(I5a,"bearerTokenAuthenticationPolicy")});var qPi=I(VAe=>{"use strict";p();Object.defineProperty(VAe,"__esModule",{value:!0});VAe.ndJsonPolicyName=void 0;VAe.ndJsonPolicy=x5a;VAe.ndJsonPolicyName="ndJsonPolicy";function x5a(){return{name:VAe.ndJsonPolicyName,async sendRequest(t,e){if(typeof t.body=="string"&&t.body.startsWith("[")){let r=JSON.parse(t.body);Array.isArray(r)&&(t.body=r.map(n=>JSON.stringify(n)+` +`).join(""))}return e(t)}}}a(x5a,"ndJsonPolicy")});var HPi=I(are=>{"use strict";p();Object.defineProperty(are,"__esModule",{value:!0});are.auxiliaryAuthenticationHeaderPolicyName=void 0;are.auxiliaryAuthenticationHeaderPolicy=P5a;var w5a=W1r(),R5a=ire();are.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var jPi="x-ms-authorization-auxiliary";async function k5a(t){var e,r;let{scopes:n,getAccessToken:o,request:s}=t,c={abortSignal:s.abortSignal,tracingOptions:s.tracingOptions};return(r=(e=await o(n,c))===null||e===void 0?void 0:e.token)!==null&&r!==void 0?r:""}a(k5a,"sendAuthorizeRequest");function P5a(t){let{credentials:e,scopes:r}=t,n=t.logger||R5a.logger,o=new WeakMap;return{name:are.auxiliaryAuthenticationHeaderPolicyName,async sendRequest(s,c){if(!s.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication for auxiliary header is not permitted for non-TLS protected (non-https) URLs.");if(!e||e.length===0)return n.info(`${are.auxiliaryAuthenticationHeaderPolicyName} header will not be set due to empty credentials.`),c(s);let l=[];for(let d of e){let f=o.get(d);f||(f=(0,w5a.createTokenCycler)(d),o.set(d,f)),l.push(k5a({scopes:Array.isArray(r)?r:[r],request:s,getAccessToken:f,logger:n}))}let u=(await Promise.all(l)).filter(d=>!!d);return u.length===0?(n.warning(`None of the auxiliary tokens are valid. ${jPi} header will not be set.`),c(s)):(s.headers.set(jPi,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(P5a,"auxiliaryAuthenticationHeaderPolicy")});var a2i=I(xr=>{"use strict";p();Object.defineProperty(xr,"__esModule",{value:!0});xr.createFileFromStream=xr.createFile=xr.auxiliaryAuthenticationHeaderPolicyName=xr.auxiliaryAuthenticationHeaderPolicy=xr.ndJsonPolicyName=xr.ndJsonPolicy=xr.bearerTokenAuthenticationPolicyName=xr.bearerTokenAuthenticationPolicy=xr.formDataPolicyName=xr.formDataPolicy=xr.tlsPolicyName=xr.tlsPolicy=xr.userAgentPolicyName=xr.userAgentPolicy=xr.defaultRetryPolicy=xr.tracingPolicyName=xr.tracingPolicy=xr.retryPolicy=xr.throttlingRetryPolicyName=xr.throttlingRetryPolicy=xr.systemErrorRetryPolicyName=xr.systemErrorRetryPolicy=xr.redirectPolicyName=xr.redirectPolicy=xr.getDefaultProxySettings=xr.proxyPolicyName=xr.proxyPolicy=xr.multipartPolicyName=xr.multipartPolicy=xr.logPolicyName=xr.logPolicy=xr.setClientRequestIdPolicyName=xr.setClientRequestIdPolicy=xr.exponentialRetryPolicyName=xr.exponentialRetryPolicy=xr.decompressResponsePolicyName=xr.decompressResponsePolicy=xr.isRestError=xr.RestError=xr.createPipelineRequest=xr.createHttpHeaders=xr.createDefaultHttpClient=xr.createPipelineFromOptions=xr.createEmptyPipeline=void 0;var D5a=$Sr();Object.defineProperty(xr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return D5a.createEmptyPipeline},"get")});var N5a=wPi();Object.defineProperty(xr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return N5a.createPipelineFromOptions},"get")});var M5a=OPi();Object.defineProperty(xr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return M5a.createDefaultHttpClient},"get")});var O5a=k4e();Object.defineProperty(xr,"createHttpHeaders",{enumerable:!0,get:a(function(){return O5a.createHttpHeaders},"get")});var L5a=LPi();Object.defineProperty(xr,"createPipelineRequest",{enumerable:!0,get:a(function(){return L5a.createPipelineRequest},"get")});var GPi=YAt();Object.defineProperty(xr,"RestError",{enumerable:!0,get:a(function(){return GPi.RestError},"get")});Object.defineProperty(xr,"isRestError",{enumerable:!0,get:a(function(){return GPi.isRestError},"get")});var $Pi=S1r();Object.defineProperty(xr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return $Pi.decompressResponsePolicy},"get")});Object.defineProperty(xr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return $Pi.decompressResponsePolicyName},"get")});var VPi=BPi();Object.defineProperty(xr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return VPi.exponentialRetryPolicy},"get")});Object.defineProperty(xr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return VPi.exponentialRetryPolicyName},"get")});var WPi=D1r();Object.defineProperty(xr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return WPi.setClientRequestIdPolicy},"get")});Object.defineProperty(xr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return WPi.setClientRequestIdPolicyName},"get")});var zPi=h1r();Object.defineProperty(xr,"logPolicy",{enumerable:!0,get:a(function(){return zPi.logPolicy},"get")});Object.defineProperty(xr,"logPolicyName",{enumerable:!0,get:a(function(){return zPi.logPolicyName},"get")});var YPi=b1r();Object.defineProperty(xr,"multipartPolicy",{enumerable:!0,get:a(function(){return YPi.multipartPolicy},"get")});Object.defineProperty(xr,"multipartPolicyName",{enumerable:!0,get:a(function(){return YPi.multipartPolicyName},"get")});var z1r=P1r();Object.defineProperty(xr,"proxyPolicy",{enumerable:!0,get:a(function(){return z1r.proxyPolicy},"get")});Object.defineProperty(xr,"proxyPolicyName",{enumerable:!0,get:a(function(){return z1r.proxyPolicyName},"get")});Object.defineProperty(xr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return z1r.getDefaultProxySettings},"get")});var KPi=m1r();Object.defineProperty(xr,"redirectPolicy",{enumerable:!0,get:a(function(){return KPi.redirectPolicy},"get")});Object.defineProperty(xr,"redirectPolicyName",{enumerable:!0,get:a(function(){return KPi.redirectPolicyName},"get")});var JPi=FPi();Object.defineProperty(xr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return JPi.systemErrorRetryPolicy},"get")});Object.defineProperty(xr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return JPi.systemErrorRetryPolicyName},"get")});var ZPi=UPi();Object.defineProperty(xr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return ZPi.throttlingRetryPolicy},"get")});Object.defineProperty(xr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return ZPi.throttlingRetryPolicyName},"get")});var B5a=NAe();Object.defineProperty(xr,"retryPolicy",{enumerable:!0,get:a(function(){return B5a.retryPolicy},"get")});var XPi=F1r();Object.defineProperty(xr,"tracingPolicy",{enumerable:!0,get:a(function(){return XPi.tracingPolicy},"get")});Object.defineProperty(xr,"tracingPolicyName",{enumerable:!0,get:a(function(){return XPi.tracingPolicyName},"get")});var F5a=x1r();Object.defineProperty(xr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return F5a.defaultRetryPolicy},"get")});var e2i=_1r();Object.defineProperty(xr,"userAgentPolicy",{enumerable:!0,get:a(function(){return e2i.userAgentPolicy},"get")});Object.defineProperty(xr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return e2i.userAgentPolicyName},"get")});var t2i=N1r();Object.defineProperty(xr,"tlsPolicy",{enumerable:!0,get:a(function(){return t2i.tlsPolicy},"get")});Object.defineProperty(xr,"tlsPolicyName",{enumerable:!0,get:a(function(){return t2i.tlsPolicyName},"get")});var r2i=k1r();Object.defineProperty(xr,"formDataPolicy",{enumerable:!0,get:a(function(){return r2i.formDataPolicy},"get")});Object.defineProperty(xr,"formDataPolicyName",{enumerable:!0,get:a(function(){return r2i.formDataPolicyName},"get")});var n2i=QPi();Object.defineProperty(xr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return n2i.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(xr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return n2i.bearerTokenAuthenticationPolicyName},"get")});var i2i=qPi();Object.defineProperty(xr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return i2i.ndJsonPolicy},"get")});Object.defineProperty(xr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return i2i.ndJsonPolicyName},"get")});var o2i=HPi();Object.defineProperty(xr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return o2i.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(xr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return o2i.auxiliaryAuthenticationHeaderPolicyName},"get")});var s2i=E1r();Object.defineProperty(xr,"createFile",{enumerable:!0,get:a(function(){return s2i.createFile},"get")});Object.defineProperty(xr,"createFileFromStream",{enumerable:!0,get:a(function(){return s2i.createFileFromStream},"get")})});var l2i=I((F4e,c2i)=>{"use strict";p();var U5a=F4e&&F4e.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Q5a=F4e&&F4e.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var $5a=lu(),V5a=Cy(),W5a=(function(){function t(e,r,n,o){this._buffer=[],this._lastSend=0,this._isDisabled=e,this._getBatchSize=r,this._getBatchIntervalMs=n,this._sender=o}return a(t,"Channel"),t.prototype.setUseDiskRetryCaching=function(e,r,n){this._sender.setDiskRetryMode(e,r,n)},t.prototype.send=function(e){var r=this;if(!this._isDisabled()){if(!e){$5a.warn("Cannot send null/undefined telemetry");return}if(this._buffer.push(e),this._buffer.length>=this._getBatchSize()){this.triggerSend(!1);return}!this._timeoutHandle&&this._buffer.length>0&&(this._timeoutHandle=setTimeout(function(){r._timeoutHandle=null,r.triggerSend(!1)},this._getBatchIntervalMs()))}},t.prototype.triggerSend=function(e,r){var n=this._buffer.length<1;n||(e||V5a.isNodeExit?(this._sender.saveOnCrash(this._buffer),typeof r=="function"&&r("data saved on crash")):this._sender.send(this._buffer,r)),this._lastSend=+new Date,this._buffer=[],clearTimeout(this._timeoutHandle),this._timeoutHandle=null,n&&typeof r=="function"&&r("no data to send")},t})();u2i.exports=W5a});var f2i=I(Y1r=>{"use strict";p();Object.defineProperty(Y1r,"__esModule",{value:!0});Y1r.azureRoleEnvironmentTelemetryProcessor=z5a;function z5a(t,e){}a(z5a,"azureRoleEnvironmentTelemetryProcessor")});var m2i=I(XAt=>{"use strict";p();Object.defineProperty(XAt,"__esModule",{value:!0});XAt.samplingTelemetryProcessor=Y5a;XAt.getSamplingHashCode=h2i;var p2i=Z_();function Y5a(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&p2i.TelemetryType.Metric===p2i.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=h2i(e.correlationContext.operation.id){"use strict";p();var K5a=O6&&O6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),J5a=O6&&O6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Z5a=O6&&O6.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&K5a(e,t,r);return J5a(e,t),e};Object.defineProperty(O6,"__esModule",{value:!0});O6.performanceMetricsTelemetryProcessor=X5a;var K1r=dAt(),J1r=Z5a(Z_());function X5a(t,e){switch(e&&e.addDocument(t),t.data.baseType){case J1r.TelemetryTypeString.Exception:K1r.countException();break;case J1r.TelemetryTypeString.Request:var r=t.data.baseData;K1r.countRequest(r.duration,r.success);break;case J1r.TelemetryTypeString.Dependency:var n=t.data.baseData;K1r.countDependency(n.duration,n.success);break}return!0}a(X5a,"performanceMetricsTelemetryProcessor")});var A2i=I(BD=>{"use strict";p();var AL=BD&&BD.__assign||function(){return AL=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var o4a=yL&&yL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tyt=yL&&yL.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&o4a(e,t,r)};Object.defineProperty(yL,"__esModule",{value:!0});tyt(f2i(),yL);tyt(m2i(),yL);tyt(g2i(),yL);tyt(A2i(),yL)});var Z1r=I((JDp,v2i)=>{"use strict";p();var no=Z_(),hS=Cy(),_2i=m$(),s4a=lu(),a4a=(function(){function t(){}return a(t,"EnvelopeFactory"),t.createEnvelope=function(e,r,n,o,s){var c=null;switch(r){case no.TelemetryType.Trace:c=t.createTraceData(e);break;case no.TelemetryType.Dependency:c=t.createDependencyData(e);break;case no.TelemetryType.Event:c=t.createEventData(e);break;case no.TelemetryType.Exception:c=t.createExceptionData(e);break;case no.TelemetryType.Request:c=t.createRequestData(e);break;case no.TelemetryType.Metric:c=t.createMetricData(e);break;case no.TelemetryType.Availability:c=t.createAvailabilityData(e);break;case no.TelemetryType.PageView:c=t.createPageViewData(e);break}if(c&&c.baseData&&no.domainSupportsProperties(c.baseData)){if(n)if(!c.baseData.properties)c.baseData.properties=n;else for(var l in n)c.baseData.properties[l]||(c.baseData.properties[l]=n[l]);t.addAzureFunctionsCorrelationProperties(c.baseData.properties),c.baseData.properties&&(c.baseData.properties=hS.validateStringMap(c.baseData.properties))}var u=s&&s.instrumentationKey||"",d=new no.Envelope;return d.data=c,d.iKey=u,d.name="Microsoft.ApplicationInsights."+u.replace(/-/g,"")+"."+c.baseType.substr(0,c.baseType.length-4),d.tags=this.getTags(o,e.tagOverrides),d.time=new Date().toISOString(),d.ver=1,d.sampleRate=s?s.samplingPercentage:100,r===no.TelemetryType.Metric&&(d.sampleRate=100),d},t.addAzureFunctionsCorrelationProperties=function(e){var r=_2i.CorrelationContextManager.getCurrentContext();if(r&&r.customProperties&&r.customProperties.getProperty instanceof Function){e=e||{};var n=r.customProperties.getProperty("InvocationId");n&&(e.InvocationId=n),n=r.customProperties.getProperty("ProcessId"),n&&(e.ProcessId=n),n=r.customProperties.getProperty("LogLevel"),n&&(e.LogLevel=n),n=r.customProperties.getProperty("Category"),n&&(e.Category=n),n=r.customProperties.getProperty("HostInstanceId"),n&&(e.HostInstanceId=n),n=r.customProperties.getProperty("AzFuncLiveLogsSessionId"),n&&(e.AzFuncLiveLogsSessionId=n)}},t.truncateProperties=function(e){if(e.properties)try{for(var r={},n=Object.keys(e.properties),o=Object.values(e.properties),s=0;s0,o.exceptions.push(c);var l=new no.Data;return l.baseType=no.telemetryTypeToBaseType(no.TelemetryType.Exception),l.baseData=o,l},t.createRequestData=function(e){var r,n,o,s,c=new no.RequestData;e.id?c.id=e.id:c.id=hS.w3cTraceId(),c.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),c.url=(n=e.url)===null||n===void 0?void 0:n.substring(0,2048),c.source=(o=e.source)===null||o===void 0?void 0:o.substring(0,1024),c.duration=hS.msToTimeSpan(e.duration),c.responseCode=(s=e.resultCode?e.resultCode.toString():"0")===null||s===void 0?void 0:s.substring(0,1024),c.success=e.success,c.properties=this.truncateProperties(e),c.measurements=e.measurements;var l=new no.Data;return l.baseType=no.telemetryTypeToBaseType(no.TelemetryType.Request),l.baseData=c,l},t.createMetricData=function(e){var r,n=new no.MetricData;n.metrics=[];var o=new no.DataPoint;o.count=isNaN(e.count)?1:e.count,o.kind=no.DataPointType.Aggregation,o.max=isNaN(e.max)?e.value:e.max,o.min=isNaN(e.min)?e.value:e.min,o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.stdDev=isNaN(e.stdDev)?0:e.stdDev,o.value=e.value,o.ns=e.namespace,n.metrics.push(o),n.properties=this.truncateProperties(e);var s=new no.Data;return s.baseType=no.telemetryTypeToBaseType(no.TelemetryType.Metric),s.baseData=n,s},t.createAvailabilityData=function(e){var r,n,o=new no.AvailabilityData;e.id?o.id=e.id:o.id=hS.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=hS.msToTimeSpan(e.duration),o.success=e.success,o.runLocation=e.runLocation,o.message=(n=e.message)===null||n===void 0?void 0:n.substring(0,8192),o.measurements=e.measurements,o.properties=this.truncateProperties(e);var s=new no.Data;return s.baseType=no.telemetryTypeToBaseType(no.TelemetryType.Availability),s.baseData=o,s},t.createPageViewData=function(e){var r,n,o=new no.PageViewData;o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=hS.msToTimeSpan(e.duration),o.url=(n=e.url)===null||n===void 0?void 0:n.substring(0,2048),o.measurements=e.measurements,o.properties=this.truncateProperties(e);var s=new no.Data;return s.baseType=no.telemetryTypeToBaseType(no.TelemetryType.PageView),s.baseData=o,s},t.getTags=function(e,r){var n=_2i.CorrelationContextManager.getCurrentContext(),o={};if(e&&e.tags)for(var s in e.tags)o[s]=e.tags[s];if(r)for(var s in r)o[s]=r[s];return n&&(o[e.keys.operationId]=o[e.keys.operationId]||n.operation.id,o[e.keys.operationName]=o[e.keys.operationName]||n.operation.name,o[e.keys.operationParentId]=o[e.keys.operationParentId]||n.operation.parentId),o},t.parseStack=function(e){var r=void 0;if(typeof e=="string"){var n=e.split(` +`);r=[];for(var o=0,s=0,c=0;c<=n.length;c++){var l=n[c];if(E2i.regex.test(l)){var u=new E2i(n[c],o++);s+=u.sizeInBytes,r.push(u)}}var d=32*1024;if(s>d)for(var f=0,h=r.length-1,m=0,g=f,A=h;fd){var E=A-g+1;r.splice(g,E);break}g=f,A=h,f++,h--}}return r},t})(),E2i=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=hS.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=hS.trim(n[2])||this.method,this.fileName=hS.trim(n[4])||"",this.line=parseInt(n[5])||0),this.sizeInBytes+=this.method.length,this.sizeInBytes+=this.fileName.length,this.sizeInBytes+=this.assembly.length,this.sizeInBytes+=t.baseSize,this.sizeInBytes+=this.level.toString().length,this.sizeInBytes+=this.line.toString().length}return a(t,"_StackFrame"),t.regex=/^(\s+at)?(.*?)(\@|\s\(|\s)([^\(\n]+):(\d+):(\d+)(\)?)$/,t.baseSize=58,t})();v2i.exports=a4a});var C2i=I(S$=>{"use strict";p();var c4a=S$&&S$.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},l4a=S$&&S$.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var ryt=q4e&&q4e.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},nyt=q4e&&q4e.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=0&&(this._resendInterval=Math.floor(r)),typeof n=="number"&&n>=0&&(this._maxBytesOnDisk=Math.floor(n)),e&&!Q4e.FileAccessControl.OS_PROVIDES_FILE_PROTECTION&&(this._enableDiskRetryMode=!1,this._logWarn("Ignoring request to enable disk retry mode. Sufficient file protection capabilities were not detected.")),this._enableDiskRetryMode?(this._statsbeat&&this._statsbeat.addFeature(T$.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(T$.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return ryt(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return nyt(this,function(m){switch(m.label){case 0:if(!(e&&e.length>0))return[3,5];if(n=this._redirectedHost||this._config.endpointUrl,o=new A4a.URL(n).hostname,s={method:"POST",withCredentials:!1,headers:{"Content-Type":"application/x-json-stream"}},c=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!c)return[3,4];this._statsbeat&&this._statsbeat.addFeature(T$.StatsbeatFeature.AAD_HANDLING),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,c.addAuthorizationHeader(s)];case 2:return m.sent(),[3,4];case 3:return l=m.sent(),u="Failed to get AAD bearer token for the Application.",this._enableDiskRetryMode&&(u+="This batch of telemetry items will be retried. ",this._storeToDisk(e)),u+="Error:"+l.toString(),this._logWarn(u),typeof r=="function"&&r(u),[2];case 4:if(d="",e.forEach(function(g){var A=mS.stringify(g);typeof A=="string"&&(d+=A+` +`)}),d.length>0&&(d=d.substring(0,d.length-1)),d.length===0)return typeof r=="function"&&r("Empty batch of telemetry items. Nothing to send."),[2];f=Buffer.from?Buffer.from(d):new Buffer(d),m4a.gzip(f,function(g,A){var y=A;g?(h._logWarn(mS.dumpObj(g)),y=f,s.headers["Content-Length"]=f.length.toString()):(s.headers["Content-Encoding"]="gzip",s.headers["Content-Length"]=A.length.toString()),h._logInfo(mS.dumpObj(s)),s[g4a.disableCollectionRequestOption]=!0;var _=+new Date,E=a(function(S){S.setEncoding("utf-8");var T="";S.on("data",function(w){T+=w}),S.on("end",function(){var w,R=+new Date,x=R-_;if(h._numConsecutiveFailures=0,T.includes(v4a)&&S.statusCode===400&&(eTr.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(E4a.includes(S.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(S.statusCode==_4a||S.statusCode==y4a?h._statsbeat.countThrottle(T$.StatsbeatNetworkCategory.Breeze,o,S.statusCode):h._statsbeat.countRequest(T$.StatsbeatNetworkCategory.Breeze,o,x,S.statusCode===200,S.statusCode)),h._enableDiskRetryMode){if(S.statusCode===200)h._resendTimer||(h._resendTimer=setTimeout(function(){h._resendTimer=null,h._sendFirstFileOnDisk()},h._resendInterval),h._resendTimer.unref());else if(h._isRetriable(S.statusCode))try{h._statsbeat&&h._statsbeat.countRetry(T$.StatsbeatNetworkCategory.Breeze,o,S.statusCode);var k=JSON.parse(T),D=[];k.errors&&(k.errors.forEach(function(B){(B.statusCode==429||B.statusCode==500||B.statusCode==503)&&D.push(e[B.index])}),D.length>0&&h._storeToDisk(D))}catch{h._storeToDisk(e)}}if(S.statusCode===307||S.statusCode===308)if(h._numConsecutiveRedirects++,h._numConsecutiveRedirects<10){var N=S.headers.location?S.headers.location.toString():null;N&&(h._redirectedHost=N,h.send(e,r))}else{var O={name:"Circular Redirect",message:"Error sending telemetry because of circular redirects."};h._statsbeat&&h._statsbeat.countException(T$.StatsbeatNetworkCategory.Breeze,o,O),typeof r=="function"&&r("Error sending telemetry because of circular redirects.")}else h._numConsecutiveRedirects=0,typeof r=="function"&&r(T),h._logInfo(T),typeof h._onSuccess=="function"&&h._onSuccess(T)})},"requestCallback"),v=mS.makeRequest(h._config,n,s,E);v.setTimeout(t.HTTP_TIMEOUT,function(){h._requestTimedOut=!0,v.abort()}),v.on("error",function(S){if(h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&h._statsbeatFailedToIngest(),h._numConsecutiveFailures++,h._statsbeat&&h._statsbeat.countException(T$.StatsbeatNetworkCategory.Breeze,o,S),!h._enableDiskRetryMode||h._numConsecutiveFailures>0&&h._numConsecutiveFailures%t.MAX_CONNECTION_FAILURES_BEFORE_WARN===0){var T="Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:";h._enableDiskRetryMode&&(T="Ingestion endpoint could not be reached ".concat(h._numConsecutiveFailures," consecutive times. There may be resulting telemetry loss. Most recent error:")),h._logWarn(T,mS.dumpObj(S))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,mS.dumpObj(S))}h._onErrorHelper(S),typeof r=="function"&&(S?(h._requestTimedOut&&(S.name="telemetry timeout",S.message="telemetry request timed out"),r(mS.dumpObj(S))):r("Error sending telemetry")),h._enableDiskRetryMode&&h._storeToDisk(e)}),v.write(y),v.end()}),m.label=5;case 5:return[2]}})})},t.prototype.saveOnCrash=function(e){this._enableDiskRetryMode&&this._storeToDiskSync(mS.stringify(e))},t.prototype._isRetriable=function(e){return e===206||e===401||e===403||e===408||e===429||e===500||e===502||e===503||e===504},t.prototype._logInfo=function(e){for(var r=[],n=1;n=3&&this._shutdownStatsbeat())},t.prototype._storeToDisk=function(e){return ryt(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return nyt(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),this._logInfo("Checking existence of data storage directory: "+this._tempDir),[4,L6.confirmDirExists(this._tempDir)];case 1:return d.sent(),[3,3];case 2:return r=d.sent(),this._logWarn("Failed to create folder to put telemetry: "+mS.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,Q4e.FileAccessControl.applyACLRules(this._tempDir)];case 4:return d.sent(),[3,6];case 5:return n=d.sent(),this._logWarn("Failed to apply file access control to folder: "+mS.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,L6.getShallowDirectorySize(this._tempDir)];case 7:return o=d.sent(),o>this._maxBytesOnDisk?(this._logWarn("Not saving data due to max size limit being met. Directory size in bytes is: "+o),[2]):[3,9];case 8:return s=d.sent(),this._logWarn("Failed to read directory for retriable telemetry: "+mS.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=cre.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,L6.writeFileAsync(l,mS.stringify(e),{mode:384})];case 10:return d.sent(),[3,12];case 11:return u=d.sent(),this._logWarn("Failed to persist telemetry to disk: "+mS.dumpObj(u)),this._onErrorHelper(u),[2];case 12:return[2]}})})},t.prototype._storeToDiskSync=function(e){try{this._logInfo("Checking existence of data storage directory: "+this._tempDir),X1r.existsSync(this._tempDir)||X1r.mkdirSync(this._tempDir),Q4e.FileAccessControl.applyACLRulesSync(this._tempDir);var r=L6.getShallowDirectorySizeSync(this._tempDir);if(r>this._maxBytesOnDisk){this._logInfo("Not saving data due to max size limit being met. Directory size in bytes is: "+r);return}var n="".concat(new Date().getTime(),".ai.json"),o=cre.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),X1r.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+mS.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return ryt(this,void 0,void 0,function(){var e,r,n,o,s,c;return nyt(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,L6.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return cre.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=cre.join(this._tempDir,r),[4,L6.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,L6.unlinkAsync(n)];case 3:return l.sent(),s=JSON.parse(o.toString()),[4,this.send(s)];case 4:l.sent(),l.label=5;case 5:return[3,7];case 6:return c=l.sent(),this._onErrorHelper(c),[3,7];case 7:return[2]}})})},t.prototype._onErrorHelper=function(e){typeof this._onError=="function"&&this._onError(e)},t.prototype._fileCleanupTask=function(){return ryt(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return nyt(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,L6.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return cre.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=cre.join(this._tempDir,e[r]),[4,L6.unlinkAsync(s).catch(function(d){l._onErrorHelper(d)})]):[3,4]):[3,5];case 3:u.sent(),u.label=4;case 4:return r++,[3,2];case 5:return[3,7];case 6:return c=u.sent(),c.code!="ENOENT"&&this._onErrorHelper(c),[3,7];case 7:return[2]}})})},t.TAG="Sender",t.WAIT_BETWEEN_RESEND=60*1e3,t.MAX_BYTES_ON_DISK=50*1024*1024,t.MAX_CONNECTION_FAILURES_BEFORE_WARN=5,t.CLEANUP_TIMEOUT=3600*1e3,t.FILE_RETEMPTION_PERIOD=10080*60*1e3,t.TEMPDIR_PREFIX="appInsights-node",t.HTTP_TIMEOUT=2e4,t})();b2i.exports=C4a});var T2i=I(iyt=>{"use strict";p();Object.defineProperty(iyt,"__esModule",{value:!0});iyt.AzureVirtualMachine=void 0;var S2i=lu(),b4a=Cy(),S4a=SAe(),T4a="http://169.254.169.254/metadata/instance/compute",I4a="api-version=2017-12-01",x4a="format=json",w4a="UNREACH",R4a=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat(T4a,"?").concat(I4a,"&").concat(x4a),l=(n={method:"GET"},n[S4a.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=b4a.makeRequest(e,c,l,function(d){if(d.statusCode===200){s.isVM=!0;var f="";d.on("data",function(h){f+=h}),d.on("end",function(){try{var h=JSON.parse(f);s.id=h.vmId||"",s.subscriptionId=h.subscriptionId||"",s.osType=h.osType||""}catch(m){S2i.info(t.TAG,m)}r(s)})}else r(s)},!1,!1);u&&(setTimeout(function(){o._requestTimedOut=!0,u.abort()},t.HTTP_TIMEOUT),u.on("error",function(d){o._requestTimedOut&&d&&(d.name="telemetry timeout",d.message="telemetry request timed out"),d&&d.message&&d.message.indexOf(w4a)>-1?s.isVM=!1:S2i.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();iyt.AzureVirtualMachine=R4a});var I2i=I(oyt=>{"use strict";p();Object.defineProperty(oyt,"__esModule",{value:!0});oyt.NetworkStatsbeat=void 0;var k4a=(function(){function t(e,r){this.endpoint=e,this.host=r,this.totalRequestCount=0,this.totalSuccesfulRequestCount=0,this.totalFailedRequestCount=[],this.retryCount=[],this.exceptionCount=[],this.throttleCount=[],this.intervalRequestExecutionTime=0,this.lastIntervalRequestExecutionTime=0,this.lastTime=+new Date,this.lastRequestCount=0}return a(t,"NetworkStatsbeat"),t})();oyt.NetworkStatsbeat=k4a});var P2i=I((lre,k2i)=>{"use strict";p();var _L=lre&&lre.__assign||function(){return _L=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0&&s/o||0;if(n.lastIntervalRequestExecutionTime=n.intervalRequestExecutionTime,o>0){var l=Object.assign({endpoint:this._networkStatsbeatCollection[r].endpoint,host:this._networkStatsbeatCollection[r].host},e);this._statbeatMetrics.push({name:Rd.StatsbeatCounter.REQUEST_DURATION,value:c,properties:l})}n.lastRequestCount=n.totalRequestCount,n.lastTime=n.time}},t.prototype._getShortHost=function(e){var r=e;try{var n=new RegExp(/^https?:\/\/(?:www\.)?([^\/.-]+)/),o=n.exec(e);o!=null&&o.length>1&&(r=o[1]),r=r.replace(".in.applicationinsights.azure.com","")}catch{}return r},t.prototype._trackRequestsCount=function(e){for(var r=this,n=a(function(l){s=o._networkStatsbeatCollection[l];var u=Object.assign({endpoint:s.endpoint,host:s.host},e);s.totalSuccesfulRequestCount>0&&(o._statbeatMetrics.push({name:Rd.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(_L(_L({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Rd.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(_L(_L({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Rd.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(_L(_L({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Rd.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(_L(_L({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:Rd.StatsbeatCounter.EXCEPTION_COUNT,value:d.count,properties:u})}),s.exceptionCount=[])},"_loop_1"),o=this,s,c=0;c0))return[3,2];for(e=[],r=0;r-1)return t.EU_CONNECTION_STRING;return t.NON_EU_CONNECTION_STRING},t.NON_EU_CONNECTION_STRING="InstrumentationKey=c4a29126-a7cb-47e5-b348-11414998b11e;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com",t.EU_CONNECTION_STRING="InstrumentationKey=7dc56bab-3c0c-4e9f-9ebb-d1acadee8d0f;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com",t.STATS_COLLECTION_SHORT_INTERVAL=9e5,t.STATS_COLLECTION_LONG_INTERVAL=864e5,t.STATS_COLLECTION_INITIAL_DELAY=15e3,t.TAG="Statsbeat",t})();k2i.exports=U4a});var M2i=I((pNp,N2i)=>{"use strict";p();var Q4a=require("url"),q4a=jSr(),j4a=l2i(),H4a=AAe(),B6=Z_(),G4a=d2i(),iTr=y2i(),D2i=m$(),$4a=P2i(),V4a=tTr(),oTr=Cy(),syt=lu(),W4a=Z1r(),z4a=(function(){function t(e){this._telemetryProcessors=[];var r=new q4a(e);if(this.config=r,!this.config.instrumentationKey||this.config.instrumentationKey=="")throw new Error("Instrumentation key not found, please provide a connection string before starting Application Insights SDK.");this.context=new H4a,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new $4a(this.config,this.context),this._statsbeat.enable(!0));var n=new V4a(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new G4a(function(){return r.disableAppInsights},function(){return r.maxBatchSize},function(){return r.maxBatchIntervalMs},n)}return a(t,"TelemetryClient"),t.prototype.trackAvailability=function(e){this.track(e,B6.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,B6.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,B6.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,B6.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!oTr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,B6.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,B6.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,B6.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new Q4a.URL(e.data).host}catch(r){e.target=null,syt.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,B6.TelemetryType.Dependency)},t.prototype.flush=function(e){this.channel.triggerSend(e?!!e.isAppCrashing:!1,e?e.callback:void 0)},t.prototype.track=function(e,r){if(e&&B6.telemetryTypeToBaseType(r)){var n=W4a.createEnvelope(e,r,this.commonProperties,this.context,this.config);e.time&&(n.time=e.time.toISOString());var o=this.runTelemetryProcessors(n,e.contextObjects);o=o&&iTr.samplingTelemetryProcessor(n,{correlationContext:D2i.CorrelationContextManager.getCurrentContext()}),iTr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(iTr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else syt.warn(t.TAG,"track() requires telemetry object and telemetryType to be specified.")},t.prototype.setAutoPopulateAzureProperties=function(e){},t.prototype.getAuthorizationHandler=function(e){return e&&e.aadTokenCredential?(this.authorizationHandler||(syt.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new j4a(e.aadTokenCredential,e.aadAudience)),this.authorizationHandler):null},t.prototype.addTelemetryProcessor=function(e){this._telemetryProcessors.push(e)},t.prototype.clearTelemetryProcessors=function(){this._telemetryProcessors=[]},t.prototype.runTelemetryProcessors=function(e,r){var n=!0,o=this._telemetryProcessors.length;if(o===0)return n;r=r||{},r.correlationContext=D2i.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var Y4a=sTr&&sTr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),K4a=M2i(),O2i=OSr(),J4a=SAe(),ayt=lu(),Z4a=(function(t){Y4a(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NodeClient"),e.prototype.trackNodeHttpRequestSync=function(r){r&&r.request&&r.response&&r.duration?O2i.trackRequestSync(this,r):ayt.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&ayt.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?O2i.trackRequest(this,r):ayt.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?J4a.trackRequest(this,r):ayt.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(K4a);L2i.exports=Z4a});var U2i=I(F2i=>{"use strict";p();Object.defineProperty(F2i,"__esModule",{value:!0})});var H2i=I(At=>{"use strict";p();Object.defineProperty(At,"__esModule",{value:!0});At.Configuration=At.liveMetricsClient=At.defaultClient=At.DistributedTracingModes=void 0;At.setup=aLa;At.start=j2i;At.getCorrelationContext=lLa;At.startOperation=uLa;At.wrapWithCorrelationContext=dLa;At.dispose=fLa;var cTr=m$(),X4a=vRi(),eLa=bRi(),lTr=dAt(),tLa=vSr(),rLa=NRi(),nLa=GRi(),iLa=SAe(),oLa=OSr(),Q2i=Ote(),j4e=lu(),q2i=Ski(),uTr=Iki(),sLa=Rki();At.TelemetryClient=B2i();At.Contracts=Z_();At.azureFunctionsTypes=U2i();var aTr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(aTr||(At.DistributedTracingModes=aTr={}));var H4e,G4e,$4e,V4e,W4e,zAe,YAe,ure,z4e,Y4e,vI=!1,cyt;function aLa(t){return At.defaultClient?j4e.info("The default client is already setup"):(At.defaultClient=new At.TelemetryClient(t),H4e=new X4a(At.defaultClient),G4e=new eLa(At.defaultClient),$4e=new lTr(At.defaultClient),V4e=new tLa(At.defaultClient),W4e=new rLa(At.defaultClient),zAe=new nLa(At.defaultClient),ure=new oLa(At.defaultClient),z4e=new iLa(At.defaultClient),YAe||(YAe=new uTr.AutoCollectNativePerformance(At.defaultClient)),Y4e=new sLa.AzureFunctionsHook(At.defaultClient)),dTr}a(aLa,"setup");function cLa(){At.defaultClient&&(At.defaultClient.config.enableAutoCollectExternalLoggers==null&&(At.defaultClient.config.enableAutoCollectExternalLoggers=!0),At.defaultClient.config.enableAutoCollectConsole==null&&(At.defaultClient.config.enableAutoCollectConsole=!1),At.defaultClient.config.enableAutoCollectExceptions==null&&(At.defaultClient.config.enableAutoCollectExceptions=!0),At.defaultClient.config.enableAutoCollectPerformance==null&&(At.defaultClient.config.enableAutoCollectPerformance=!0),At.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),At.defaultClient.config.enableAutoCollectHeartbeat==null&&(At.defaultClient.config.enableAutoCollectHeartbeat=!0),At.defaultClient.config.enableAutoCollectRequests==null&&(At.defaultClient.config.enableAutoCollectRequests=!0),At.defaultClient.config.enableAutoCollectDependencies==null&&(At.defaultClient.config.enableAutoCollectDependencies=!0),At.defaultClient.config.enableUseDiskRetryCaching==null&&(At.defaultClient.config.enableUseDiskRetryCaching=!0),At.defaultClient.config.enableAutoDependencyCorrelation==null&&(At.defaultClient.config.enableAutoDependencyCorrelation=!0),At.defaultClient.config.enableSendLiveMetrics==null&&(At.defaultClient.config.enableSendLiveMetrics=!1),At.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(At.defaultClient.config.enableAutoCollectExtendedMetrics=!0),At.defaultClient.config.enableWebInstrumentation==null&&(At.defaultClient.config.enableWebInstrumentation=!1),At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}a(cLa,"_setDefaultConfig");function j2i(){if(At.defaultClient){vI=!0,cLa(),H4e.enable(At.defaultClient.config.enableAutoCollectExternalLoggers,At.defaultClient.config.enableAutoCollectConsole),G4e.enable(At.defaultClient.config.enableAutoCollectExceptions),$4e.enable(At.defaultClient.config.enableAutoCollectPerformance),V4e.enable(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics),W4e.enable(At.defaultClient.config.enableAutoCollectHeartbeat),ure.useAutoCorrelation(At.defaultClient.config.enableAutoDependencyCorrelation,At.defaultClient.config.enableUseAsyncHooks),ure.enable(At.defaultClient.config.enableAutoCollectRequests),z4e.enable(At.defaultClient.config.enableAutoCollectDependencies),zAe.enable(At.defaultClient.config.enableWebInstrumentation,At.defaultClient.config.webInstrumentationConnectionString),At.defaultClient.config.enableSendLiveMetrics&&(At.liveMetricsClient||(At.liveMetricsClient=new q2i(At.defaultClient.config,At.defaultClient.context,At.defaultClient.getAuthorizationHandler,At.defaultClient),cyt=new lTr(At.liveMetricsClient,1e3,!0),At.liveMetricsClient.addCollector(cyt),At.defaultClient.quickPulseClient=At.liveMetricsClient),At.liveMetricsClient.enable(At.defaultClient.config.enableSendLiveMetrics)),Y4e.enable(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=uTr.AutoCollectNativePerformance.parseEnabled(At.defaultClient.config.enableAutoCollectExtendedMetrics,At.defaultClient.config);YAe.enable(At.defaultClient.config.enableAutoCollectExtendedMetrics,t.disabledMetrics),At.defaultClient&&At.defaultClient.channel&&At.defaultClient.channel.setUseDiskRetryCaching(At.defaultClient.config.enableUseDiskRetryCaching,At.defaultClient.config.enableResendInterval,At.defaultClient.config.enableMaxBytesOnDisk)}else j4e.warn("Start cannot be called before setup");return dTr}a(j2i,"start");function lLa(){return cTr.CorrelationContextManager.getCurrentContext()}a(lLa,"getCorrelationContext");function uLa(t,e){return cTr.CorrelationContextManager.startOperation(t,e)}a(uLa,"startOperation");function dLa(t,e){return cTr.CorrelationContextManager.wrapCallback(t,e)}a(dLa,"wrapWithCorrelationContext");var dTr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return Q2i.w3cEnabled=e===aTr.AI_AND_W3C,t},t.setAutoCollectConsole=function(e,r){return r===void 0&&(r=!1),At.defaultClient&&(At.defaultClient.config.enableAutoCollectExternalLoggers=e,At.defaultClient.config.enableAutoCollectConsole=r,vI&&H4e.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectExceptions=e,vI&&G4e.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),At.defaultClient){At.defaultClient.config.enableAutoCollectPerformance=e;var n=uTr.AutoCollectNativePerformance.parseEnabled(r,At.defaultClient.config);At.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,vI&&($4e.enable(e),YAe.enable(At.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,vI&&V4e.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectHeartbeat=e,vI&&W4e.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableWebInstrumentation=e,At.defaultClient.config.webInstrumentationConnectionString=r,vI&&zAe.enable(At.defaultClient.config.enableAutoWebSnippetInjection,At.defaultClient.config.webSnippetConnectionString)),t},t.enableWebInstrumentation=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableWebInstrumentation=e,At.defaultClient.config.webInstrumentationConnectionString=r,vI&&zAe.enable(At.defaultClient.config.enableWebInstrumentation,At.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectRequests=e,vI&&ure.enable(e)),t},t.setAutoCollectDependencies=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectDependencies=e,vI&&z4e.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableAutoDependencyCorrelation=e,At.defaultClient.config.enableUseAsyncHooks=r,vI&&ure.useAutoCorrelation(e,r)),t},t.setUseDiskRetryCaching=function(e,r,n){return At.defaultClient&&(At.defaultClient.config.enableUseDiskRetryCaching=e,At.defaultClient.config.enableResendInterval=r,At.defaultClient.config.enableMaxBytesOnDisk=n,At.defaultClient.channel&&At.defaultClient.channel.setUseDiskRetryCaching(At.defaultClient.config.enableUseDiskRetryCaching,At.defaultClient.config.enableResendInterval,At.defaultClient.config.enableMaxBytesOnDisk)),t},t.setInternalLogging=function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!0),j4e.enableDebug=e,j4e.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,vI&&Y4e.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),At.defaultClient?(!At.liveMetricsClient&&e?(At.liveMetricsClient=new q2i(At.defaultClient.config,At.defaultClient.context,At.defaultClient.getAuthorizationHandler,At.defaultClient),cyt=new lTr(At.liveMetricsClient,1e3,!0),At.liveMetricsClient.addCollector(cyt),At.defaultClient.quickPulseClient=At.liveMetricsClient):At.liveMetricsClient&&At.liveMetricsClient.enable(e),At.defaultClient.config.enableSendLiveMetrics=e,t):(j4e.warn("Live metrics client cannot be setup without the default client"),t)},t.start=j2i,t})();At.Configuration=dTr;function fLa(){Q2i.w3cEnabled=!0,At.defaultClient=null,vI=!1,H4e&&H4e.dispose(),G4e&&G4e.dispose(),$4e&&$4e.dispose(),V4e&&V4e.dispose(),W4e&&W4e.dispose(),zAe&&zAe.dispose(),YAe&&YAe.dispose(),ure&&ure.dispose(),z4e&&z4e.dispose(),At.liveMetricsClient&&(At.liveMetricsClient.enable(!1),At.liveMetricsClient=void 0),Y4e&&Y4e.dispose()}a(fLa,"dispose")});var pTr=I(XR=>{"use strict";p();var pLa=XR&&XR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hLa=XR&&XR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),G2i=XR&&XR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{this.client.flush({callback:a(()=>{e(void 0)},"callback")})})}massageEventName(e){return yLa(e)?$2i(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};XR.AzureInsightReporter=fTr;function _La(t,e,r){let n=new mLa.TelemetryClient(r);return n.config.enableAutoCollectRequests=!1,n.config.enableAutoCollectPerformance=!1,n.config.enableAutoCollectExceptions=!1,n.config.enableAutoCollectConsole=!1,n.config.enableAutoCollectDependencies=!1,n.config.noDiagnosticChannel=!0,V2i(t,e,n),n}a(_La,"createAppInsightsClient");function V2i(t,e,r){r.commonProperties=ELa(r.commonProperties,e),r.context.tags[r.context.keys.cloudRoleInstance]="REDACTED",r.context.tags[r.context.keys.sessionId]=e.sessionId;let n=t.copilotTelemetryURL;n&&URL.canParse(n)&&(r.config.endpointUrl=n)}a(V2i,"configureReporter");function ELa(t,e){return t=t||{},t.common_os=lyt.platform(),t.common_platformversion=lyt.release(),t.common_arch=lyt.arch(),t.common_cpu=Array.from(new Set(lyt.cpus().map(r=>r.model))).join(),t.common_vscodemachineid=e.machineId,t.common_vscodesessionid=e.sessionId,t.client_deviceid=e.devDeviceId,t.common_uikind=e.uiKind,t.common_remotename=e.remoteName??"none",t.common_isnewappinstall="",t}a(ELa,"decorateWithCommonProperties")});var W2i=I((INp,vLa)=>{vLa.exports={name:"copilot-chat",displayName:"GitHub Copilot",description:"AI chat features powered by Copilot",version:"0.57.0",build:"1",completionsCoreVersion:"1.378.1799",internalLargeStorageAriaKey:"ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917",ariaKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",buildType:"dev",publisher:"GitHub",homepage:"https://github.com/features/copilot?editor=vscode",license:"SEE LICENSE IN LICENSE.txt",repository:{type:"git",url:"https://github.com/microsoft/vscode-copilot-chat"},bugs:{url:"https://github.com/microsoft/vscode/issues"},qna:"https://github.com/github-community/community/discussions/categories/copilot",icon:"assets/copilot.png",pricing:"Trial",engines:{vscode:"^1.129.0",npm:">=9.0.0",node:">=22.14.0"},categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["ai","openai","codex","pilot","snippets","documentation","autocomplete","intellisense","refactor","javascript","python","typescript","php","go","golang","ruby","c++","c#","java","kotlin","co-pilot"],badges:[{url:"https://img.shields.io/badge/GitHub%20Copilot-Subscription%20Required-orange",href:"https://github.com/github-copilot/signup?editor=vscode",description:"%github.copilot.badge.signUp%"},{url:"https://img.shields.io/github/stars/github/copilot-docs?style=social",href:"https://github.com/github/copilot-docs",description:"%github.copilot.badge.star%"},{url:"https://img.shields.io/youtube/channel/views/UC7c3Kb6jYCRj4JOHHZTxKsQ?style=social",href:"https://www.youtube.com/@GitHub/search?query=copilot",description:"%github.copilot.badge.youtube%"},{url:"https://img.shields.io/twitter/follow/github?style=social",href:"https://twitter.com/github",description:"%github.copilot.badge.twitter%"}],activationEvents:["onStartupFinished","onLanguageModelChat:copilot","onUri","onFileSystem:ccreq","onFileSystem:ccsettings"],main:"./dist/extension",l10n:"./l10n",enabledApiProposals:["agentSessionsWorkspace","agentsWindowConfiguration","chatDebug","chatHooks","extensionsAny","newSymbolNamesProvider","interactive","codeActionAI","activeComment","commentReveal","contribCommentThreadAdditionalMenu","contribCommentsViewThreadMenus","contribChatEditorInlineGutterMenu","documentFiltersExclusive","embeddings","findTextInFiles","findTextInFiles2","languageModelToolSupportsModel","findFiles2","textSearchProvider","terminalDataWriteEvent","terminalExecuteCommandEvent","terminalSelection","terminalQuickFixProvider","mappedEditsProvider","aiRelatedInformation","aiSettingsSearch","chatParticipantAdditions","defaultChatParticipant","contribSourceControlInputBoxMenu","authLearnMore","testObserver","aiTextSearchProvider","chatParticipantPrivate","chatProvider","contribDebugCreateConfiguration","chatReferenceDiagnostic","textSearchProvider2","chatReferenceBinaryData","languageModelSystem","languageModelCapabilities","languageModelPricing","inlineCompletionsAdditions","chatStatusItem","chatInputNotification","taskProblemMatcherStatus","contribLanguageModelToolSets","textDocumentChangeReason","resolvers","taskExecutionTerminal","dataChannels","languageModelThinkingPart","chatSessionsProvider","devDeviceId","contribEditorContentMenu","chatPromptFiles","mcpServerDefinitions","tabInputMultiDiff","workspaceTrust","environmentPower","terminalTitle","toolInvocationApproveCombination","chatSessionCustomizationProvider"],contributes:{languageModelTools:[{name:"copilot_searchCodebase",toolReferenceName:"codebase",displayName:"%copilot.tools.searchCodebase.name%",icon:"$(folder)",userDescription:"%copilot.codebase.tool.description%",modelDescription:"Run a natural language search for relevant code or documentation comments from the user's current workspace. Returns relevant code snippets from the user's current workspace if it is large, or the full contents of the workspace if it is small.",tags:["codesearch","vscode_codesearch"],inputSchema:{type:"object",properties:{query:{type:"string",description:"The query to search the codebase for. Should contain all relevant context. Should ideally be text that might appear in the codebase, such as function names, variable names, or comments."}},required:["query"]}},{name:"execution_subagent",toolReferenceName:"executionSubagent",displayName:"%copilot.tools.executionSubagent.name%",icon:"$(play)",userDescription:"%copilot.tools.executionSubagent.description%",modelDescription:`Launch an iterative execution-focused subagent that performs an execution-based task. USE THIS INSTEAD OF RUNNING INDIVIDUAL COMMANDS WITH run_in_terminal EXCEPT IN THE RARE CASES THAT YOU NEED THE FULL OUTPUT OF A COMMAND. Here are some examples of how it can be used: - Run tests and filter the output to summarize which tests failed and why. @@ -764,51 +764,51 @@ EXAMPLES: **Note**: This is an advanced setting.`,tags:["advanced","experimental"]},"github.copilot.chat.reasoningEffortOverride":{type:["string","null"],default:null,markdownDescription:"Overrides the reasoning/thinking effort sent to model APIs. The configured value must match a reasoning-effort value supported by the selected model or endpoint (for example, `low`, `medium`, `high`, or other model-specific values). Used by evals.\n\n**Note**: This is an advanced debugging setting.",tags:["advanced"]},"github.copilot.chat.anthropic.promptCaching.extendedTtl":{type:"boolean",default:!1,tags:["advanced","experimental","onExp"],description:"%github.copilot.config.anthropic.promptCaching.extendedTtl%"},"github.copilot.chat.anthropic.promptCaching.extendedTtlMessages":{type:"boolean",default:!1,tags:["advanced","experimental","onExp"],description:"%github.copilot.config.anthropic.promptCaching.extendedTtlMessages%"},"github.copilot.chat.modelCapabilityOverrides":{type:"object",default:{},markdownDescription:"%github.copilot.config.modelCapabilityOverrides%",additionalProperties:{type:"object",properties:{family:{type:"string",description:"Alias the model's family for capability routing (e.g. 'claude-opus-4.7')."}},additionalProperties:!1},tags:["advanced"]},"github.copilot.chat.installExtensionSkill.enabled":{type:"boolean",default:!1,tags:["advanced","experimental","onExp"],description:"%github.copilot.config.installExtensionSkill.enabled%"},"github.copilot.chat.debug.promptOverrideString":{type:["string","null"],default:null,markdownDescription:"YAML string that overrides the system prompt and/or tool descriptions sent to the model. When both this setting and `github.copilot.chat.debug.promptOverrideFile` are configured, this setting takes precedence.\n\n**Note**: This is an advanced debugging setting.",tags:["advanced","experimental"]},"github.copilot.chat.debug.promptOverrideFile":{type:["string","null"],default:null,markdownDescription:`Path to a YAML file that overrides the system prompt and/or tool descriptions sent to the model. -**Note**: This is an advanced debugging setting.`,tags:["advanced","experimental"]},"github.copilot.chat.edits.gemini3MultiReplaceString":{type:"boolean",default:!1,markdownDescription:"Enable the modern `multi_replace_string_in_file` edit tool when generating edits with Gemini 3 models.",tags:["advanced","experimental","onExp"]},"github.copilot.chat.edits.batchReplaceStringDescriptions":{type:"boolean",default:!1,markdownDescription:"Update tool descriptions to promote `multi_replace_string_in_file` as the primary multi-edit tool.",tags:["advanced","experimental","onExp"]},"github.copilot.chat.projectLabels.expanded":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.projectLabels.expanded%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.projectLabels.chat":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.projectLabels.chat%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.projectLabels.inline":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.projectLabels.inline%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.maxLocalIndexSize":{type:"number",default:1e5,markdownDescription:"%github.copilot.config.workspace.maxLocalIndexSize%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.enableCodeSearch":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.workspace.enableCodeSearch%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.preferredEmbeddingsModel":{type:"string",default:"",markdownDescription:"%github.copilot.config.workspace.preferredEmbeddingsModel%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.prototypeAdoCodeSearchEndpointOverride":{type:"string",default:"",markdownDescription:"%github.copilot.config.workspace.prototypeAdoCodeSearchEndpointOverride%",tags:["advanced","experimental"]},"github.copilot.chat.feedback.onChange":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.feedback.onChange%",tags:["advanced","experimental"]},"github.copilot.chat.review.intent":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.review.intent%",tags:["advanced","experimental"]},"github.copilot.chat.notebook.summaryExperimentEnabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.notebook.summaryExperimentEnabled%",tags:["advanced","experimental"]},"github.copilot.chat.notebook.variableFilteringEnabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.notebook.variableFilteringEnabled%",tags:["advanced","experimental"]},"github.copilot.chat.notebook.alternativeFormat":{type:"string",default:"xml",enum:["xml","markdown"],markdownDescription:"%github.copilot.config.notebook.alternativeFormat%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.notebook.alternativeNESFormat.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.notebook.alternativeNESFormat.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.debugTerminalCommandPatterns":{type:"array",default:[],items:{type:"string"},markdownDescription:"%github.copilot.config.debugTerminalCommandPatterns%",tags:["advanced","experimental"]},"github.copilot.chat.localWorkspaceRecording.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.localWorkspaceRecording.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.editRecording.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.editRecording.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.inlineChat.reasoningEffort":{type:"string",default:"low",enum:["none","minimal","low","medium","high"],markdownDescription:"%github.copilot.config.inlineChat.reasoningEffort%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineChat.enableThinking":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.inlineChat.enableThinking%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.debug.requestLogger.maxEntries":{type:"number",default:100,markdownDescription:"%github.copilot.config.debug.requestLogger.maxEntries%",tags:["advanced","experimental"]},"github.copilot.chat.inlineEdits.diagnosticsContextProvider.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.inlineEdits.diagnosticsContextProvider.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.chatSessionContextProvider.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.inlineEdits.chatSessionContextProvider.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.codesearch.agent.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.codesearch.agent.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.agent.temperature":{type:["number","null"],markdownDescription:"%github.copilot.config.agent.temperature%",tags:["advanced","experimental"]},"github.copilot.chat.agent.omitFileAttachmentContents":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.agent.omitFileAttachmentContents%",tags:["advanced","experimental"]},"github.copilot.chat.agent.backgroundTodoAgent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.agent.backgroundTodoAgent.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.longToolCallCachePreservation.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.agent.longToolCallCachePreservation.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.longToolCallCachePreservation.maxProbes":{type:"number",default:1,markdownDescription:"%github.copilot.config.agent.longToolCallCachePreservation.maxProbes%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.largeToolResultsToDisk.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.agent.largeToolResultsToDisk.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.largeToolResultsToDisk.thresholdBytes":{type:"number",default:8192,markdownDescription:"%github.copilot.config.agent.largeToolResultsToDisk.thresholdBytes%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.instantApply.shortContextModelName":{type:"string",default:"gpt-4o-instant-apply-full-ft-v66-short",markdownDescription:"%github.copilot.config.instantApply.shortContextModelName%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.instantApply.shortContextLimit":{type:"number",default:8e3,markdownDescription:"%github.copilot.config.instantApply.shortContextLimit%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.enableUserPreferences":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.enableUserPreferences%",tags:["advanced","experimental"]},"github.copilot.chat.skillTool.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.skill.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.getChangedFilesTool.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.getChangedFilesTool.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.executionSubagent.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.model":{type:"string",default:"gemini-3-flash",markdownDescription:"%github.copilot.config.executionSubagent.model%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.useAgenticProxy":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.executionSubagent.useAgenticProxy%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.toolCallLimit":{type:"number",default:10,markdownDescription:"%github.copilot.config.executionSubagent.toolCallLimit%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.summarizeAgentConversationHistoryThreshold":{type:["number","null"],markdownDescription:"%github.copilot.config.summarizeAgentConversationHistoryThreshold%",tags:["advanced","experimental"]},"github.copilot.chat.agentHistorySummarizationMode":{type:["string","null"],markdownDescription:"%github.copilot.config.agentHistorySummarizationMode%",tags:["advanced","experimental"]},"github.copilot.chat.useResponsesApiTruncation":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.useResponsesApiTruncation%",tags:["advanced","experimental"]},"github.copilot.chat.omitBaseAgentInstructions":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.omitBaseAgentInstructions%",tags:["advanced","experimental"]},"github.copilot.chat.promptFileContextProvider.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.promptFileContextProvider.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.tools.defaultToolsGrouped":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.tools.defaultToolsGrouped%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.gpt5AlternativePatch":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.gpt5AlternativePatch%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.triggerOnEditorChangeAfterSeconds":{type:["number","null"],default:10,markdownDescription:"%github.copilot.config.inlineEdits.triggerOnEditorChangeAfterSeconds%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.nextCursorPrediction.displayLine":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.inlineEdits.nextCursorPrediction.displayLine%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens":{type:"number",default:3e3,markdownDescription:"%github.copilot.config.inlineEdits.nextCursorPrediction.currentFileMaxTokens%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.renameSymbolSuggestions":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.inlineEdits.renameSymbolSuggestions%",tags:["advanced","experimental","onExp"]},"github.copilot.nextEditSuggestions.preferredModel":{type:"string",default:"none",markdownDescription:"%github.copilot.config.nextEditSuggestions.preferredModel%",tags:["advanced","experimental","onExp"]},"github.copilot.nextEditSuggestions.eagerness":{type:"string",default:"auto",enum:["auto","low","medium","high"],enumItemLabels:["%github.copilot.config.nextEditSuggestions.eagerness.auto.label%","%github.copilot.config.nextEditSuggestions.eagerness.low.label%","%github.copilot.config.nextEditSuggestions.eagerness.medium.label%","%github.copilot.config.nextEditSuggestions.eagerness.high.label%"],enumDescriptions:["%github.copilot.config.nextEditSuggestions.eagerness.auto%","%github.copilot.config.nextEditSuggestions.eagerness.low%","%github.copilot.config.nextEditSuggestions.eagerness.medium%","%github.copilot.config.nextEditSuggestions.eagerness.high%"],markdownDescription:"%github.copilot.config.nextEditSuggestions.eagerness%",tags:["advanced","experimental"]},"github.copilot.chat.cli.mcp.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.mcp.enabled%",tags:["advanced","experimental"],agentsWindow:{default:!0}},"github.copilot.chat.cli.sandbox.enabled":{type:"string",enum:["off","on","allowNetwork"],enumDescriptions:["%github.copilot.config.cli.sandbox.enabled.offDescription%","%github.copilot.config.cli.sandbox.enabled.onDescription%","%github.copilot.config.cli.sandbox.enabled.allowNetworkDescription%"],default:"off",markdownDescription:"%github.copilot.config.cli.sandbox.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.cli.branchSupport.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.branchSupport.enabled%",tags:["advanced"],agentsWindow:{default:!0}},"github.copilot.chat.cli.showExternalSessions":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.showExternalSessions%",tags:["advanced"],agentsWindow:{default:!1}},"github.copilot.chat.cli.planExitMode.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.planExitMode.enabled%",tags:["advanced"]},"github.copilot.chat.cli.autoModel.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.autoModel.enabled%",tags:["advanced"]},"github.copilot.chat.agent.modelDetails.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.chat.agent.modelDetails.enabled%",tags:["advanced"]},"github.copilot.chat.cli.planCommand.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.planCommand.enabled%",tags:["advanced"]},"github.copilot.chat.cli.lazyLoadSessionItem.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.lazyLoadSessionItem.enabled%",tags:["advanced"],agentsWindow:{default:!1}},"github.copilot.chat.cli.aiGenerateBranchNames.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.aiGenerateBranchNames.enabled%",tags:["advanced"]},"github.copilot.chat.cli.forkSessions.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.forkSessions.enabled%",tags:["advanced"]},"github.copilot.chat.cli.isolationOption.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.isolationOption.enabled%",tags:["advanced"],agentsWindow:{default:!0}},"github.copilot.chat.cli.autoCommit.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.autoCommit.enabled%",tags:["advanced","experimental"],agentsWindow:{default:!1}},"github.copilot.chat.cli.sessionController.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.sessionController.enabled%",tags:["advanced"],agentsWindow:{default:!1,readOnly:!0}},"github.copilot.chat.cli.thinkingEffort.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.thinkingEffort.enabled%",tags:["advanced"]},"github.copilot.chat.cli.sessionControllerForSessionsApp.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.sessionControllerForSessionsApp.enabled%",tags:["advanced"]},"github.copilot.chat.cli.terminalLinks.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.terminalLinks.enabled%",tags:["advanced"]},"github.copilot.chat.cli.remote.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.remote.enabled%",tags:["advanced"],agentsWindow:{default:!1}},"github.copilot.chat.searchSubagent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.searchSubagent.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.searchSubagent.useAgenticProxy":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.searchSubagent.useAgenticProxy%",tags:["advanced"]},"github.copilot.chat.searchSubagent.model":{type:"string",default:"",markdownDescription:"%github.copilot.config.searchSubagent.model%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.searchSubagent.toolCallLimit":{type:"number",default:4,markdownDescription:"%github.copilot.config.searchSubagent.toolCallLimit%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.searchSubagent.thoroughnessEnabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.searchSubagent.thoroughnessEnabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agentDebugLog.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.enabled%",deprecationMessage:"%github.copilot.config.chat.agentDebugLog.enabled.deprecated%",tags:["advanced","experimental"]},"github.copilot.chat.agentDebugLog.fileLogging.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agentDebugLog.fileLogging.flushIntervalMs":{type:"number",default:4e3,minimum:2e3,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.flushIntervalMs%",tags:["advanced","experimental"]},"github.copilot.chat.agentDebugLog.fileLogging.maxRetainedSessionLogs":{type:"number",default:50,minimum:1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.maxRetainedSessionLogs%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agentDebugLog.fileLogging.maxSessionLogSizeMB":{type:"number",default:100,minimum:1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.maxSessionLogSizeMB%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.otel.enabled":{type:"boolean",default:!1,scope:"application",policyReference:{name:"CopilotOtelEnabled"},markdownDescription:"Enable OpenTelemetry trace/metric/log emission for Copilot Chat operations. Precedence: enterprise policy > env var `COPILOT_OTEL_ENABLED` > user setting. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.exporterType":{type:"string",enum:["otlp-grpc","otlp-http","console","file"],default:"otlp-http",scope:"application",policyReference:{name:"CopilotOtelProtocol"},markdownDescription:"OTel exporter type for Copilot Chat telemetry. Configurable in user settings or managed by enterprise policy (policy takes precedence). Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.protocol":{type:"string",enum:["","http/json","http/protobuf","grpc"],default:"",scope:"application",policyReference:{name:"CopilotOtelOtlpProtocol"},markdownDescription:"OTLP wire protocol for Copilot Chat OTel data, mirroring `OTEL_EXPORTER_OTLP_PROTOCOL`. `http/protobuf` selects the protobuf-over-HTTP exporter; the default (empty) uses `http/json`. Precedence: enterprise policy > env var > user setting. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.otlpEndpoint":{type:"string",default:"http://localhost:4318",scope:"application",policyReference:{name:"CopilotOtelEndpoint"},markdownDescription:"OTLP collector endpoint URL for Copilot Chat OTel data. Precedence: enterprise policy > env var `OTEL_EXPORTER_OTLP_ENDPOINT` > user setting. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.captureContent":{type:"boolean",default:!1,scope:"application",policyReference:{name:"CopilotOtelCaptureContent"},markdownDescription:"Capture input/output messages, system instructions, and tool definitions in OTel telemetry. **Contains potentially sensitive data.** Precedence: enterprise policy > env var `COPILOT_OTEL_CAPTURE_CONTENT` > user setting. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.serviceName":{type:"string",default:"",scope:"application",policyReference:{name:"CopilotOtelServiceName"},markdownDescription:"OTel `service.name` resource attribute for Copilot Chat OTel data. Configurable in user settings only. Env var `OTEL_SERVICE_NAME` takes precedence over the setting; enterprise policy takes precedence over both. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.resourceAttributes":{type:"object",additionalProperties:{type:"string"},default:{},scope:"application",policyReference:{name:"CopilotOtelResourceAttributes"},markdownDescription:'Additional OTel resource attributes for Copilot Chat OTel data, as a `{ "key": "value" }` map. Configurable in user settings only. Merged per-key with `OTEL_RESOURCE_ATTRIBUTES` env (env wins over the setting); enterprise policy wins over both. Requires window reload.',tags:["advanced"]},"github.copilot.chat.otel.headers":{type:"object",additionalProperties:{type:"string"},default:{},scope:"application",policyReference:{name:"CopilotOtelHeaders"},markdownDescription:'Extra OTLP exporter headers (e.g. auth tokens) for Copilot Chat OTel data, as a `{ "key": "value" }` map. Applied directly to the OTLP exporter, not via environment variables. Configurable in user settings only. Merged per-key with `OTEL_EXPORTER_OTLP_HEADERS` env (env wins over the setting); enterprise policy wins over both. **Contains potentially sensitive credentials.** Requires window reload.',tags:["advanced"]},"github.copilot.chat.otel.maxAttributeSizeChars":{type:"integer",default:0,minimum:0,scope:"application",markdownDescription:"Maximum size **in characters** for free-form OTel content attributes (prompts, responses, tool arguments/results, hook input/output). `0` (the default) disables truncation so backends without per-attribute size limits receive full JSON payloads. Set to a positive value when your OTel backend caps attribute size \u2014 consult your backend's documentation for its per-attribute limit. Truncated values are suffixed with `...[truncated, original N chars]`. Configurable in user settings only. Env var `COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.outfile":{type:"string",default:"",scope:"application",policyReference:{name:"CopilotOtelOutfile"},markdownDescription:"File path for file-based OTel exporter output (JSON-lines). When set, overrides exporter type to `file`. Configurable in user settings or managed by enterprise policy (policy takes precedence). Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.dbSpanExporter.enabled":{type:"boolean",default:!1,scope:"application",markdownDescription:"Enable SQLite DB span exporter. Persists OTel spans to a local SQLite database. Automatically enables OTel when set to true. Configurable in user settings only. Requires window reload.",tags:["advanced"]},"github.copilot.chat.workspace.codeSearchExternalIngest.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.workspace.codeSearchExternalIngest.enabled%",tags:["advanced","onExp"]}}}],submenus:[{id:"copilot/reviewComment/additionalActions/applyAndNext",label:"%github.copilot.submenu.reviewComment.applyAndNext.label%"},{id:"copilot/reviewComment/additionalActions/discardAndNext",label:"%github.copilot.submenu.reviewComment.discardAndNext.label%"},{id:"copilot/reviewComment/additionalActions/discard",label:"%github.copilot.submenu.reviewComment.discard.label%"},{id:"github.copilot.chat.debug.filter",label:"Filter",icon:"$(filter)"},{id:"github.copilot.chat.debug.exportAllPromptLogsAsJson",label:"Export All Logs as JSON",icon:"$(file-export)"}],menus:{"editor/title":[{command:"github.copilot.debug.generateInlineEditTests",when:"resourceScheme == 'ccreq'"},{command:"github.copilot.chat.notebook.enableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && !github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && !config.notebook.globalToolbar",group:"navigation@10"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && !config.notebook.globalToolbar",group:"navigation@10"},{command:"github.copilot.chat.copilotCLI.acceptDiff",group:"navigation@1",when:"github.copilot.chat.copilotCLI.hasActiveDiff"},{command:"github.copilot.chat.copilotCLI.rejectDiff",group:"navigation@2",when:"github.copilot.chat.copilotCLI.hasActiveDiff"}],"editor/title/context":[{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"}],"explorer/context":[{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !explorerResourceIsFolder"}],"editor/context":[{command:"github.copilot.chat.fix",when:"!github.copilot.interactiveSession.disabled && chatSetupCompleted && !editorReadonly && editorSelectionHasDiagnostics",group:"1_chat@4"},{command:"github.copilot.chat.explain",when:"!github.copilot.interactiveSession.disabled && chatSetupCompleted",group:"1_chat@5"},{command:"github.copilot.chat.review",when:"config.github.copilot.chat.reviewSelection.enabled && !github.copilot.interactiveSession.disabled && chatSetupCompleted && resourceScheme != 'vscode-chat-code-block'",group:"1_chat@6"},{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"},{command:"github.copilot.chat.copilotCLI.addSelection",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && editorHasSelection && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"}],"chat/editor/inlineGutter":[{command:"github.copilot.chat.explain",when:"!github.copilot.interactiveSession.disabled && editor.hasSelection && !inlineChatFileBelongsToChat",group:"2_chat@2"},{command:"github.copilot.chat.review",when:"!github.copilot.interactiveSession.disabled && editor.hasSelection && config.github.copilot.chat.reviewSelection.enabled && !inlineChatFileBelongsToChat",group:"2_chat@3"}],"chat/input/editing/sessionToolbar":[{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply",when:"chatSessionType == copilotcli && workbenchState != empty && !isSessionsWindow",group:"navigation@0"},{command:"github.copilot.chat.checkoutPullRequestReroute",when:"chatSessionType == copilot-cloud-agent && !github.vscode-pull-request-github.activated && gitOpenRepositoryCount != 0",group:"navigation@0"},{command:"github.copilot.chat.cloudSessions.createPullRequestForTask",when:"chatSessionType == copilot-cloud-agent && github.copilot.chat.cloudTaskCanCreatePullRequest && !isSessionsWindow",group:"navigation@0"},{command:"github.copilot.chat.cloudSessions.openPullRequestForTask",when:"chatSessionType == copilot-cloud-agent && github.copilot.chat.cloudTaskCanOpenPullRequest && !isSessionsWindow",group:"navigation@0"}],"agents/changes/actions/primary":[{command:"github.copilot.sessions.initializeRepository",when:"sessionType == copilotcli && isSessionsWindow && sessions.isolationMode == workspace && !sessions.hasGitRepository && !sessions.isAgentHostSession",group:"0_init@1"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",when:"sessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && !sessions.isMergeBaseBranchProtected && !sessions.hasPullRequest && (sessions.hasUncommittedChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"1_merge@1"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync",when:"sessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && !sessions.isMergeBaseBranchProtected && !sessions.hasPullRequest && (sessions.hasUncommittedChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"1_merge@2"},{command:"github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR",when:"sessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && sessions.hasGitHubRemote && !sessions.hasPullRequest && sessions.hasBranchChanges && !sessions.isAgentHostSession",group:"2_pull_request@1"},{command:"github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR",when:"sessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && sessions.hasGitHubRemote && !sessions.hasPullRequest && sessions.hasBranchChanges && !sessions.isAgentHostSession",group:"2_pull_request@2"},{command:"github.copilot.sessions.commit",when:"sessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && !sessions.isAgentHostSession",group:"3_commit@1"},{command:"github.copilot.sessions.commitAndSync",when:"sessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && !sessions.isAgentHostSession",group:"3_commit@2"},{command:"github.copilot.sessions.sync",when:"sessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUpstream && !sessions.hasUncommittedChanges && (sessions.hasIncomingChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"4_sync@1"},{command:"github.copilot.claude.sessions.initializeRepository",when:"sessionType == claude-code && isSessionsWindow && !sessions.hasGitRepository",group:"init@1"},{command:"github.copilot.claude.sessions.commit",when:"sessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges",group:"commit@1"},{command:"github.copilot.claude.sessions.commitAndSync",when:"sessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && sessions.hasUpstream",group:"commit@2"},{command:"github.copilot.claude.sessions.sync",when:"sessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && !sessions.hasUncommittedChanges && sessions.hasUpstream",group:"sync@1"}],"agents/change/inline":[{command:"github.copilot.sessions.discardChanges",when:"sessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && !sessionIsArchived && !sessions.isAgentHostSession",group:"navigation@2"}],"chat/contextUsage/actions":[{command:"github.copilot.chat.compact",when:"!chatIsAgentHostSession"}],"chat/input/status":[{command:"github.copilot.chat.otel.statusActive",when:"github.copilot.otel.enabledExplicitly && isSessionsWindow",group:"otel@1"}],"chat/newSession":[{command:"github.copilot.cli.newSession",group:"4_recommendations@0"}],"testing/item/result":[{command:"github.copilot.tests.fixTestFailure.fromInline",when:"testResultState == failed && !testResultOutdated",group:"inline@2"}],"testing/item/context":[{command:"github.copilot.tests.fixTestFailure.fromInline",when:"testResultState == failed && !testResultOutdated",group:"inline@2"}],commandPalette:[{command:"github.copilot.cli.openInCopilotCLI",when:"false"},{command:"github.copilot.debug.extensionState",when:"false"},{command:"github.copilot.cli.sessions.commitToWorktree",when:"false"},{command:"github.copilot.cli.sessions.commitToRepository",when:"false"},{command:"github.copilot.chat.triggerPermissiveSignIn",when:"false"},{command:"github.copilot.chat.otel.statusActive",when:"false"},{command:"github.copilot.interactiveSession.feedback",when:"github.copilot-chat.activated && !github.copilot.interactiveSession.disabled"},{command:"github.copilot.debug.workbenchState",when:"true"},{command:"github.copilot.chat.rerunWithCopilotDebug",when:"false"},{command:"github.copilot.chat.startCopilotDebugCommand",when:"false"},{command:"github.copilot.git.generateCommitMessage",when:"false"},{command:"github.copilot.git.resolveMergeConflicts",when:"false"},{command:"github.copilot.chat.explain",when:"false"},{command:"github.copilot.chat.review",when:"!github.copilot.interactiveSession.disabled"},{command:"github.copilot.chat.review.apply",when:"false"},{command:"github.copilot.chat.review.applyAndNext",when:"false"},{command:"github.copilot.chat.review.discard",when:"false"},{command:"github.copilot.chat.review.discardAndNext",when:"false"},{command:"github.copilot.chat.review.discardAll",when:"false"},{command:"github.copilot.chat.review.stagedChanges",when:"false"},{command:"github.copilot.chat.review.unstagedChanges",when:"false"},{command:"github.copilot.chat.review.changes",when:"false"},{command:"github.copilot.chat.review.stagedFileChange",when:"false"},{command:"github.copilot.chat.review.unstagedFileChange",when:"false"},{command:"github.copilot.chat.review.previous",when:"false"},{command:"github.copilot.chat.review.next",when:"false"},{command:"github.copilot.chat.review.continueInInlineChat",when:"false"},{command:"github.copilot.chat.review.continueInChat",when:"false"},{command:"github.copilot.chat.review.markHelpful",when:"false"},{command:"github.copilot.chat.review.markUnhelpful",when:"false"},{command:"github.copilot.devcontainer.generateDevContainerConfig",when:"false"},{command:"github.copilot.tests.fixTestFailure",when:"false"},{command:"github.copilot.tests.fixTestFailure.fromInline",when:"false"},{command:"github.copilot.search.markHelpful",when:"false"},{command:"github.copilot.search.markUnhelpful",when:"false"},{command:"github.copilot.search.feedback",when:"false"},{command:"github.copilot.chat.debug.showElements",when:"false"},{command:"github.copilot.chat.debug.hideElements",when:"false"},{command:"github.copilot.chat.debug.showTools",when:"false"},{command:"github.copilot.chat.debug.hideTools",when:"false"},{command:"github.copilot.chat.debug.showNesRequests",when:"false"},{command:"github.copilot.chat.debug.hideNesRequests",when:"false"},{command:"github.copilot.chat.debug.showGhostRequests",when:"false"},{command:"github.copilot.chat.debug.hideGhostRequests",when:"false"},{command:"github.copilot.chat.debug.exportLogItem",when:"false"},{command:"github.copilot.chat.debug.exportPromptArchive",when:"false"},{command:"github.copilot.chat.debug.exportPromptLogsAsJson",when:"false"},{command:"github.copilot.chat.debug.exportAllPromptLogsAsJson",when:"false"},{command:"github.copilot.chat.mcp.setup.check",when:"false"},{command:"github.copilot.chat.mcp.setup.validatePackage",when:"false"},{command:"github.copilot.chat.mcp.setup.flow",when:"false"},{command:"github.copilot.chat.debug.showRawRequestBody",when:"false"},{command:"github.copilot.debug.showOutputChannel",when:"false"},{command:"github.copilot.cli.sessions.delete",when:"false"},{command:"github.copilot.cli.sessions.resumeInTerminal",when:"false"},{command:"github.copilot.cli.sessions.rename",when:"false"},{command:"github.copilot.claude.sessions.rename",when:"false"},{command:"github.copilot.cli.sessions.setTitle",when:"false"},{command:"github.copilot.cli.sessions.openRepository",when:"false"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",when:"false"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",when:"false"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",when:"false"},{command:"github.copilot.cloud.sessions.openInBrowser",when:"false"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",when:"false"},{command:"github.copilot.cloud.sessions.installPRExtension",when:"false"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"false"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply",when:"false"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",when:"false"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync",when:"false"},{command:"github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR",when:"false"},{command:"github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR",when:"false"},{command:"github.copilot.chat.checkoutPullRequestReroute",when:"false"},{command:"github.copilot.chat.cloudSessions.openRepository",when:"false"},{command:"github.copilot.chat.cloudSessions.createPullRequestForTask",when:"false"},{command:"github.copilot.chat.cloudSessions.openPullRequestForTask",when:"false"},{command:"github.copilot.nes.captureExpected.start",when:"github.copilot.inlineEditsEnabled"},{command:"github.copilot.nes.captureExpected.submit",when:"github.copilot.inlineEditsEnabled"},{command:"github.copilot.sessions.commit",when:"false"},{command:"github.copilot.sessions.commitAndSync",when:"false"},{command:"github.copilot.sessions.sync",when:"false"},{command:"github.copilot.sessions.discardChanges",when:"false"},{command:"github.copilot.sessions.refreshChanges",when:"false"},{command:"github.copilot.sessions.initializeRepository",when:"false"},{command:"github.copilot.claude.sessions.commit",when:"false"},{command:"github.copilot.claude.sessions.commitAndSync",when:"false"},{command:"github.copilot.claude.sessions.sync",when:"false"},{command:"github.copilot.claude.sessions.initializeRepository",when:"false"}],"view/title":[{submenu:"github.copilot.chat.debug.filter",when:"view == copilot-chat",group:"navigation"},{command:"github.copilot.chat.debug.exportAllPromptLogsAsJson",when:"view == copilot-chat",group:"export@1"},{command:"workbench.action.chat.openAgentDebugPanel",when:"view == copilot-chat",group:"3_show@0"},{command:"github.copilot.debug.showOutputChannel",when:"view == copilot-chat",group:"3_show@1"},{command:"github.copilot.debug.showChatLogView",when:"view == workbench.panel.chat.view.copilot",group:"3_show"}],"view/item/context":[{command:"github.copilot.chat.debug.showRawRequestBody",when:"view == copilot-chat && viewItem == request",group:"export@0"},{command:"github.copilot.chat.debug.exportLogItem",when:"view == copilot-chat && (viewItem == toolcall || viewItem == request)",group:"export@1"},{command:"github.copilot.chat.debug.exportPromptArchive",when:"view == copilot-chat && viewItem == chatprompt",group:"export@2"},{command:"github.copilot.chat.debug.exportPromptLogsAsJson",when:"view == copilot-chat && viewItem == chatprompt",group:"export@3"}],"searchPanel/aiResults/commands":[{command:"github.copilot.search.markHelpful",group:"inline@0",when:"aiResultsTitle && aiResultsRequested"},{command:"github.copilot.search.markUnhelpful",group:"inline@1",when:"aiResultsTitle && aiResultsRequested"},{command:"github.copilot.search.feedback",group:"inline@2",when:"aiResultsTitle && aiResultsRequested && github.copilot.debugReportFeedback"}],"comments/comment/title":[{command:"github.copilot.chat.review.markHelpful",group:"inline@0",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.markUnhelpful",group:"inline@1",when:"commentController == github-copilot-review"}],"commentsView/commentThread/context":[{command:"github.copilot.chat.review.apply",group:"context@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discard",group:"context@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discardAll",group:"context@3",when:"commentController == github-copilot-review"}],"comments/commentThread/additionalActions":[{submenu:"copilot/reviewComment/additionalActions/applyAndNext",group:"inline@1",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments > 1"},{command:"github.copilot.chat.review.apply",group:"inline@1",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"},{submenu:"copilot/reviewComment/additionalActions/discardAndNext",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments > 1"},{submenu:"copilot/reviewComment/additionalActions/discard",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"}],"copilot/reviewComment/additionalActions/applyAndNext":[{command:"github.copilot.chat.review.applyAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.apply",group:"inline@2",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discardAndNext":[{command:"github.copilot.chat.review.discardAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discard":[{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"comments/commentThread/title":[{command:"github.copilot.chat.review.previous",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.next",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInChat",group:"inline@3",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discardAll",group:"inline@4",when:"commentController == github-copilot-review"}],"scm/title":[{command:"github.copilot.chat.review.changes",group:"navigation",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmProviderRootUri in github.copilot.chat.reviewDiff.enabledRootUris"}],"scm/sourceControl":[{command:"github.copilot.cli.openInCopilotCLI",group:"3_worktree@1",when:"scmProvider == git"}],"scm/resourceGroup/context":[{command:"github.copilot.chat.review.stagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index",group:"inline@-3"},{command:"github.copilot.chat.review.unstagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree",group:"inline@-3"}],"scm/resourceState/context":[{command:"github.copilot.git.resolveMergeConflicts",when:"scmProvider == git && scmResourceGroup == merge && git.activeResourceHasMergeConflicts",group:"z_chat@1"},{command:"github.copilot.chat.review.stagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index"},{command:"github.copilot.chat.review.unstagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree"}],"scm/inputBox":[{command:"github.copilot.git.generateCommitMessage",when:"scmProvider == git && chatSetupCompleted"}],"testing/message/context":[{command:"github.copilot.tests.fixTestFailure",when:"testing.testItemHasUri",group:"inline@1"}],"issue/reporter":[{command:"github.copilot.report"}],"github.copilot.chat.debug.filter":[{command:"github.copilot.chat.debug.showElements",when:"github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.hideElements",when:"!github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.showTools",when:"github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.hideTools",when:"!github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.showNesRequests",when:"github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.hideNesRequests",when:"!github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.showGhostRequests",when:"github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"},{command:"github.copilot.chat.debug.hideGhostRequests",when:"!github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"}],"notebook/toolbar":[{command:"github.copilot.chat.notebook.enableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && !github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"}],"editor/content":[{command:"github.copilot.git.resolveMergeConflicts",group:"z_chat@1",when:"config.git.enabled && !git.missing && !isInDiffEditor && !isMergeEditor && resource in git.mergeChanges && git.activeResourceHasMergeConflicts && chatSetupCompleted"}],"multiDiffEditor/content":[{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"resourceScheme == copilotcli-worktree-changes && workbenchState != empty && !isSessionsWindow"}],"chat/chatSessions":[{command:"github.copilot.claude.sessions.rename",when:"chatSessionType == claude-code",group:"1_edit@4"},{command:"github.copilot.cli.sessions.delete",when:"chatSessionType == copilotcli",group:"1_edit@10"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli",group:"1_edit@4"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",when:"chatSessionType == copilotcli && !isSessionsWindow",group:"2_open@1"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@2"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",when:"chatSessionType == copilotcli",group:"2_open@3"},{command:"github.copilot.cli.sessions.resumeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@4"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"chatSessionType == copilotcli && workbenchState != empty && !isSessionsWindow",group:"3_apply@0"},{command:"github.copilot.cloud.sessions.openInBrowser",when:"chatSessionType == copilot-cloud-agent",group:"navigation@10"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",when:"chatSessionType == copilot-cloud-agent",group:"1_edit@10"}],"chatSessions/item/context":[{command:"github.copilot.claude.sessions.rename",when:"sessionType == claude-code && sessionProviderId == default-copilot",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"sessionType == copilotcli && sessionProviderId == default-copilot",group:"1_edit@4"}],"chat/multiDiff/context":[{command:"github.copilot.cloud.sessions.installPRExtension",when:"chatSessionType == copilot-cloud-agent && !github.copilot.prExtensionInstalled",group:"inline@1"}],"chat/input/editing/sessionTitleToolbar":[{command:"github.copilot.sessions.refreshChanges",when:"sessionType == copilotcli && isSessionsWindow && !sessions.isAgentHostSession",group:"9_refresh@1"}],"chat/customizations/create":[{command:"copilot.claude.agents",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == agents",group:"navigation@1"},{command:"copilot.claude.hooks",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == hooks",group:"navigation@1"},{command:"copilot.claude.memory",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == instructions",group:"navigation@1"}]},icons:{"copilot-logo":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0041"}},"copilot-warning":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0042"}},"copilot-notconnected":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0043"}}},iconFonts:[{id:"copilot-font",src:[{path:"assets/copilot.woff",format:"woff"}]}],terminalQuickFixes:[{id:"copilot-chat.fixWithCopilot",commandLineMatcher:".+",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0},kind:"explain"},{id:"copilot-chat.generateCommitMessage",commandLineMatcher:"git add .+",commandExitResult:"success",kind:"explain",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0}},{id:"copilot-chat.terminalToDebugging",commandLineMatcher:".+",kind:"explain",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}},{id:"copilot-chat.terminalToDebuggingSuccess",commandLineMatcher:".+",kind:"explain",commandExitResult:"success",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}}],languages:[{id:"ignore",filenamePatterns:[".copilotignore"],aliases:[]},{id:"markdown",extensions:[".copilotmd"]}],views:{"copilot-chat":[{id:"copilot-chat",name:"Chat Debug",icon:"assets/debug-icon.svg",when:"github.copilot.chat.showLogView"}],"context-inspector":[{id:"context-inspector",name:"Language Context Inspector",icon:"$(inspect)",when:"github.copilot.chat.showContextInspectorView"}]},viewsContainers:{activitybar:[{id:"copilot-chat",title:"Chat Debug",icon:"assets/debug-icon.svg"},{id:"context-inspector",title:"Language Context Inspector",icon:"$(inspect)"}]},configurationDefaults:{"workbench.editorAssociations":{"*.copilotmd":"vscode.markdown.preview.editor"}},keybindings:[{command:"github.copilot.chat.copilotCLI.addFileReference",key:"ctrl+shift+.",mac:"cmd+shift+.",when:"github.copilot.chat.copilotCLI.hasSession && editorTextFocus"},{command:"github.copilot.chat.rerunWithCopilotDebug",key:"ctrl+alt+.",mac:"cmd+alt+.",when:"github.copilot-chat.activated && terminalShellIntegrationEnabled && terminalFocus && !terminalAltBufferActive"},{command:"github.copilot.nes.captureExpected.confirm",key:"ctrl+enter",mac:"cmd+enter",when:"copilotNesCaptureMode && editorTextFocus"},{command:"github.copilot.nes.captureExpected.abort",key:"escape",when:"copilotNesCaptureMode && editorTextFocus"}],walkthroughs:[{id:"copilotWelcome",title:"%github.copilot.walkthrough.title%",description:"%github.copilot.walkthrough.description%",when:"!isWeb",steps:[{id:"copilot.setup.signIn",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.signIn.description%",when:"chatEntitlementSignedOut && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signInNoAction",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatEntitlementSignedOut && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUp",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.signUp.description%",when:"chatPlanCanSignUp && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUpNoAction",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatPlanCanSignUp && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.panelChat",title:"%github.copilot.walkthrough.panelChat.title%",description:"%github.copilot.walkthrough.panelChat.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.edits",title:"%github.copilot.walkthrough.edits.title%",description:"%github.copilot.walkthrough.edits.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hclight.mp4"},altText:"%github.copilot.walkthrough.edits.media.altText%"}},{id:"copilot.firstSuggest",title:"%github.copilot.walkthrough.firstSuggest.title%",description:"%github.copilot.walkthrough.firstSuggest.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hclight.mp4"},altText:"%github.copilot.walkthrough.firstSuggest.media.altText%"}},{id:"copilot.inlineChatNotMac",title:"%github.copilot.walkthrough.inlineChatNotMac.title%",description:"%github.copilot.walkthrough.inlineChatNotMac.description%",when:"!isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatNotMac.media.altText%"}},{id:"copilot.inlineChatMac",title:"%github.copilot.walkthrough.inlineChatMac.title%",description:"%github.copilot.walkthrough.inlineChatMac.description%",when:"isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatMac.media.altText%"}},{id:"copilot.sparkle",title:"%github.copilot.walkthrough.sparkle.title%",description:"%github.copilot.walkthrough.sparkle.description%",when:"!chatEntitlementSignedOut || chatIsEnabled",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hclight.mp4"},altText:"%github.copilot.walkthrough.sparkle.media.altText%"}}]}],jsonValidation:[{fileMatch:"settings.json",url:"ccsettings://root/schema.json"}],typescriptServerPlugins:[{name:"@vscode/copilot-typescript-server-plugin",enableForWorkspaceTypeScriptVersions:!0}],chatSessions:[{type:"claude-code",name:"claude",displayName:"Claude",icon:"$(claude)",welcomeTitle:"Claude Agent",welcomeMessage:"Powered by the same agent as Claude Code",inputPlaceholder:"Run local tasks with Claude, type `#` for adding context",order:3,description:"%github.copilot.session.providerDescription.claude%",when:"config.github.copilot.chat.claudeAgent.enabled && ((isSessionsWindow && !config.chat.agents.claude.preferAgentHost) || (!isSessionsWindow && !config.chat.editor.claude.preferAgentHost))",canDelegate:!0,requiresCustomModels:!0,supportsAutoModel:!1,requiresCopilotSignIn:!0,capabilities:{supportsFileAttachments:!0,supportsImageAttachments:!0},commands:[{name:"init",description:"Initialize a new CLAUDE.md file with codebase documentation"},{name:"pr-comments",description:"Get comments from a GitHub pull request"},{name:"review",description:"Review a pull request"},{name:"security-review",description:"Complete a security review of the pending changes on the current branch"},{name:"simplify",description:"Review changed code for reuse, quality, and efficiency"},{name:"claude-api",description:"Help building with Claude API or Anthropic SDK"},{name:"agents",description:"Create and manage specialized Claude agents"},{name:"hooks",description:"Configure Claude Code hooks for tool execution and events"},{name:"memory",description:"Open memory files (CLAUDE.md) for editing"},{name:"compact",description:"Compact the conversation history to save context tokens"}]},{type:"copilotcli",name:"cli",displayName:"Copilot CLI",icon:"$(copilot)",welcomeTitle:"Copilot CLI",welcomeMessage:"Run tasks in the background with the Copilot CLI",inputPlaceholder:"Run tasks in the background with the Copilot CLI, type `#` for adding context",order:1,canDelegate:!0,description:"%github.copilot.session.providerDescription.background%",when:"config.github.copilot.chat.backgroundAgent.enabled",supportsAutoModel:!0,requiresCopilotSignIn:!0,capabilities:{supportsFileAttachments:!0,supportsProblemAttachments:!0,supportsToolAttachments:!1,supportsImageAttachments:!0,supportsSymbolAttachments:!0,supportsSearchResultAttachments:!0,supportsSourceControlAttachments:!0,supportsPromptAttachments:!0,supportsHandOffs:!0},commands:[{name:"delegate",description:"Delegate chat session to cloud agent and create associated PR",when:"config.github.copilot.chat.cloudAgent.enabled"},{name:"compact",description:"%github.copilot.command.cli.compact.description%"},{name:"plan",description:"%github.copilot.command.cli.plan.description%",when:"config.github.copilot.chat.cli.planCommand.enabled"},{name:"fleet",description:"%github.copilot.command.cli.fleet.description%",when:"false"},{name:"remote",description:"%github.copilot.command.cli.remote.description%",when:"config.github.copilot.chat.cli.remote.enabled"}],customAgentTarget:"github-copilot",requiresCustomModels:!0,autoAttachReferences:!0,useRequestToPopulateBuiltInPickers:!0},{type:"copilot-cloud-agent",alternativeIds:["copilot-swe-agent"],name:"cloud",displayName:"Cloud",icon:"$(cloud)",welcomeTitle:"Cloud Agent",welcomeMessage:"Delegate tasks to the cloud",inputPlaceholder:"Delegate tasks to the cloud, type `#` for adding context",order:2,canDelegate:!0,description:"%github.copilot.session.providerDescription.cloud%",when:"config.github.copilot.chat.cloudAgent.enabled",supportsAutoModel:!1,requiresCopilotSignIn:!0,capabilities:{supportsFileAttachments:!0},autoAttachReferences:!0}],chatAgents:[],chatPromptFiles:[{path:"./assets/prompts/plan.prompt.md",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-standup.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-cost-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-improve.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-reindex.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-search.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],chatSkills:[{path:"./assets/prompts/skills/project-setup-info-local/SKILL.md",when:"!config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/project-setup-info-context7/SKILL.md",when:"config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/install-vscode-extension/SKILL.md",when:"config.github.copilot.chat.installExtensionSkill.enabled && config.github.copilot.chat.newWorkspaceCreation.enabled",sessionTypes:["local"]},{path:"./assets/prompts/skills/get-search-view-results/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/troubleshoot/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/agent-customization/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/init/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-prompt/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-instructions/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-skill/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-agent/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-hook/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/chronicle/SKILL.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],terminal:{profiles:[{icon:"copilot",id:"copilot-cli",title:"GitHub Copilot CLI",titleTemplate:"${sequence}"}]}},prettier:{useTabs:!0,tabWidth:4,singleQuote:!0},scripts:{postinstall:"tsx ./script/postinstall.ts",build:"node .esbuild.mts --sourcemaps",compile:"node .esbuild.mts --dev",watch:"npm-run-all -lp watch:esbuild watch:typecheck","watch:esbuild":"node .esbuild.mts --watch --dev","watch:typecheck":"npx tsgo --noEmit --watch --preserveWatchOutput --project tsconfig.json","watch:typecheck-extension":"npx tsgo --noEmit --watch --project tsconfig.json","watch:typecheck-extension-web":"npx tsgo --noEmit --watch --project tsconfig.worker.json","watch:typecheck-simulation-workbench":"npx tsgo --noEmit --watch --project test/simulation/workbench/tsconfig.json",typecheck:"npx tsgo --noEmit --project tsconfig.json && npx tsgo --noEmit --project test/simulation/workbench/tsconfig.json && npx tsgo --noEmit --project tsconfig.worker.json && npx tsgo --noEmit --project src/extension/completions-core/vscode-node/extension/src/copilotPanel/webView/tsconfig.json",lint:"npx eslint . --max-warnings=0","lint-staged":"npx eslint --max-warnings=0",tsfmt:"npx tsfmt -r --verify",test:"npm-run-all test:*","test:extension":"vscode-test","test:sanity":"vscode-test --sanity","test:unit":"vitest --run --pool=forks",vitest:"vitest",bench:"vitest bench",get_env:"tsx script/setup/getEnv.mts",get_token:"tsx script/setup/getToken.mts",prettier:"prettier --list-different --write --cache .",simulate:"node dist/simulationMain.js","simulate-require-cache":"node dist/simulationMain.js --require-cache","simulate-ci":"node dist/simulationMain.js --ci --require-cache","simulate-update-baseline":"node dist/simulationMain.js --update-baseline","simulate-gc":"node dist/simulationMain.js --require-cache --gc",setup:"npm run get_env && npm run get_token","setup:dotnet":"run-script-os","setup:dotnet:darwin:linux":"curl -O https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.sh && chmod u+x dotnet-install.sh && ./dotnet-install.sh --channel 10.0 && rm dotnet-install.sh","setup:dotnet:win32":'powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.ps1 -OutFile dotnet-install.ps1; ./dotnet-install.ps1 -channel 10.0; Remove-Item dotnet-install.ps1"',"analyze-edits":"tsx script/analyzeEdits.ts","extract-chat-lib":"tsx script/build/extractChatLib.ts",create_venv:"tsx script/setup/createVenv.mts",package:"vsce package",web:"vscode-test-web --headless --extensionDevelopmentPath=. .","test:prompt":'mocha "src/extension/completions-core/vscode-node/prompt/**/test/**/*.test.{ts,tsx}"',"test:completions-core":"tsx src/extension/completions-core/vscode-node/extension/test/runTest.ts"},devDependencies:{"@azure/identity":"4.9.1","@azure/keyvault-secrets":"^4.10.0","@azure/msal-node":"^3.6.3","@c4312/scip":"^0.1.0","@fluentui/react-components":"^9.66.6","@fluentui/react-icons":"^2.0.305","@hediet/node-reload":"^0.8.0","@octokit/types":"^14.1.0","@stylistic/eslint-plugin":"^3.0.1","@types/eslint":"^9.0.0","@types/express":"^5.0.6","@types/google-protobuf":"^3.15.12","@types/js-yaml":"^4.0.9","@types/markdown-it":"^14.0.0","@types/minimist":"^1.2.5","@types/mocha":"^10.0.10","@types/node":"^22.16.3","@types/picomatch":"^4.0.0","@types/react":"17.0.44","@types/react-dom":"^18.2.17","@types/sinon":"^17.0.4","@types/source-map-support":"^0.5.10","@types/tar":"^6.1.13","@types/vinyl":"^2.0.12","@types/vscode-webview":"^1.57.5","@types/ws":"^8.5.3","@types/yargs":"^17.0.24","@typescript-eslint/eslint-plugin":"^8.35.0","@typescript-eslint/parser":"^8.32.0","@typescript-eslint/typescript-estree":"^8.26.1","@typescript/native-preview":"^7.0.0-dev.20260429","@vitest/coverage-v8":"^4.1.8","@vitest/snapshot":"^1.5.0","@vscode/debugadapter":"^1.68.0","@vscode/debugprotocol":"^1.68.0","@vscode/dts":"^0.4.1","@vscode/lsif-language-service":"^0.1.0-pre.4","@vscode/test-cli":"^0.0.11","@vscode/test-electron":"^2.5.2","@vscode/test-web":"^0.0.81","@vscode/vsce":"3.6.0",copyfiles:"^2.4.1","csv-parse":"^6.0.0",dotenv:"^17.2.0",electron:"^42.5.0",esbuild:"0.28.1",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.3.0",minimist:"^1.2.8",mobx:"^6.13.7","mobx-react-lite":"^4.1.0",mocha:"^11.7.1","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","monaco-editor":"0.44.0","npm-run-all":"^4.1.5",open:"^10.1.2",openai:"^6.7.0",outdent:"^0.8.0",picomatch:"^4.0.4",playwright:"^1.61.1",prettier:"^3.6.2",react:"^17.0.2","react-dom":"17.0.2",rimraf:"^6.0.1","run-script-os":"^1.1.6",shiki:"~1.15.0",sinon:"^21.0.0","source-map-support":"^0.5.21",tar:"^7.5.16","ts-dedent":"^2.2.0",tsx:"^4.22.4",typescript:"^5.8.3","vite-plugin-wasm":"^3.6.0",vitest:"^4.1.8","vscode-languageserver-protocol":"^3.17.5","vscode-languageserver-textdocument":"^1.0.12","vscode-languageserver-types":"^3.17.5",yaml:"^2.8.0",yargs:"^17.7.2",zod:"3.25.76"},dependencies:{"@anthropic-ai/claude-agent-sdk":"0.2.112","@anthropic-ai/sdk":"^0.82.0","@github/blackbird-external-ingest-utils":"^0.3.0","@github/copilot":"^1.0.70-0","@google/genai":"^1.22.0","@humanwhocodes/gitignore-to-minimatch":"1.0.2","@microsoft/tiktokenizer":"^1.0.10","@modelcontextprotocol/sdk":"^1.25.2","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.212.0","@opentelemetry/exporter-logs-otlp-grpc":"^0.219.0","@opentelemetry/exporter-logs-otlp-http":"^0.219.0","@opentelemetry/exporter-logs-otlp-proto":"^0.219.0","@opentelemetry/exporter-metrics-otlp-grpc":"^0.219.0","@opentelemetry/exporter-metrics-otlp-http":"^0.219.0","@opentelemetry/exporter-metrics-otlp-proto":"^0.219.0","@opentelemetry/exporter-trace-otlp-grpc":"^0.219.0","@opentelemetry/exporter-trace-otlp-http":"^0.219.0","@opentelemetry/exporter-trace-otlp-proto":"^0.219.0","@opentelemetry/resources":"^2.5.1","@opentelemetry/sdk-logs":"^0.212.0","@opentelemetry/sdk-metrics":"^2.5.1","@opentelemetry/sdk-trace-node":"^2.5.1","@opentelemetry/semantic-conventions":"^1.39.0","@sinclair/typebox":"^0.34.41","@vscode/copilot-api":"^0.4.3","@vscode/extension-telemetry":"^1.5.1","@vscode/l10n":"^0.0.18","@vscode/prompt-tsx":"^0.4.0-alpha.8","@vscode/tree-sitter-wasm":"0.0.5-php.2","@vscode/webview-ui-toolkit":"^1.3.1","@xterm/headless":"^5.5.0",ajv:"^8.18.0",applicationinsights:"^2.9.7","best-effort-json-parser":"^1.2.1",diff:"^8.0.3",express:"^5.2.1",ignore:"^7.0.5",isbinaryfile:"^5.0.4","jsonc-parser":"^3.3.1","lru-cache":"^11.1.0","markdown-it":"^14.2.0",minimatch:"^10.2.1",undici:"^7.24.1","vscode-tas-client":"^0.1.84","web-tree-sitter":"^0.23.0"},overrides:{string_decoder:"npm:string_decoder@1.2.0",yauzl:"^3.3.1",zod:"3.25.76"},vscodeCommit:"94c8e2adc50e26ef70af85a0de3a9efed757acaa",__metadata:{id:"7ec7d6e6-b89e-4cc5-a59b-d6c4d238246f",publisherId:{publisherId:"7c1c19cd-78eb-4dfb-8999-99caf7679002",publisherName:"github",displayName:"GitHub",flags:"verified"},publisherDisplayName:"GitHub"},allowScripts:{"esbuild@0.28.1":!0,"keytar@7.9.0":!0,"@playwright/browser-chromium@1.61.1":!0,"@vscode/vsce-sign@2.0.5":!0,protobufjs:!1,"fsevents@2.3.3":!0,"fsevents@2.3.2":!0}}});var K4e=I(gS=>{"use strict";p();Object.defineProperty(gS,"__esModule",{value:!0});gS.vscodeEngineVersion=gS.isPreRelease=gS.isProduction=gS.packageJson=void 0;gS.packageJson=$2i();gS.isProduction=gS.packageJson.buildType!=="dev";gS.isPreRelease=gS.packageJson.isPreRelease||!gS.isProduction;gS.vscodeEngineVersion=gS.packageJson.engines.vscode});var FD=I(Gv=>{"use strict";p();Object.defineProperty(Gv,"__esModule",{value:!0});Gv.isScenarioAutomation=Gv.AbstractEnvService=Gv.INativeEnvService=Gv.IEnvService=Gv.NameAndVersion=Gv.OperatingSystem=void 0;Gv.getEditorVersionHeaders=ELa;var W2i=an(),z2i=BRe(),KAe=K4e(),V2i;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(V2i||(Gv.OperatingSystem=V2i={}));var pTr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};Gv.NameAndVersion=pTr;Gv.IEnvService=(0,W2i.createServiceIdentifier)("IEnvService");Gv.INativeEnvService=(0,W2i.createServiceIdentifier)("INativeEnvService");var hTr=class{static{a(this,"AbstractEnvService")}isProduction(){return KAe.isProduction}isPreRelease(){return KAe.isPreRelease}isSimulation(){return z2i.env.SIMULATION==="1"}getBuildType(){return KAe.packageJson.buildType}getVersion(){return KAe.packageJson.version}getBuild(){return KAe.packageJson.build}getName(){return KAe.packageJson.name}};Gv.AbstractEnvService=hTr;function ELa(t){return{"Editor-Version":t.getEditorInfo().format(),"Editor-Plugin-Version":t.getEditorPluginInfo().format()}}a(ELa,"getEditorVersionHeaders");Gv.isScenarioAutomation=z2i.env.IS_SCENARIO_AUTOMATION==="1"});var Og=I(ure=>{"use strict";p();Object.defineProperty(ure,"__esModule",{value:!0});ure.generateUuid=void 0;ure.isUUID=CLa;ure.prefixedUuid=bLa;var vLa=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function CLa(t){return vLa.test(t)}a(CLa,"isUUID");ure.generateUuid=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let t=new Uint8Array(16),e=[];for(let r=0;r<256;r++)e.push(r.toString(16).padStart(2,"0"));return a(function(){crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=0,o="";return o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o},"generateUuid")})();function bLa(t){return`${t}-${(0,ure.generateUuid)()}`}a(bLa,"prefixedUuid")});var Y2i=I(lyt=>{"use strict";p();Object.defineProperty(lyt,"__esModule",{value:!0});lyt.CopilotConfigPrefix=void 0;lyt.CopilotConfigPrefix="github.copilot"});var gTr=I(UD=>{"use strict";p();var SLa=UD&&UD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TLa=UD&&UD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ILa=UD&&UD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o(n&&(r=r.bind(n)),t(a(c=>{let l=e(c);l!==void 0&&r(l)},"wrappedListener"),void 0,o))}a(wLa,"transformEvent")});var eE=I(jr=>{"use strict";p();Object.defineProperty(jr,"__esModule",{value:!0});jr.apiVersion=jr.ICompletionsEditorAndPluginInfo=jr.BuildInfo=jr.InMemoryConfigProvider=jr.DefaultsOnlyConfigProvider=jr.ConfigProvider=jr.ICompletionsConfigProvider=jr.BuildType=jr.BlockMode=jr.userScopeOnlyKeys=jr.ConfigKey=jr.packageJson=void 0;jr.shouldDoServerTrimming=PLa;jr.getConfigKeyRecursively=DLa;jr.getConfigDefaultForKey=J2i;jr.getOptionalConfigDefaultForKey=Z2i;jr.getConfig=NLa;jr.dumpForTelemetry=MLa;jr.formatNameAndVersion=ETr;jr.editorVersionHeaders=OLa;var uyt=K4e();Object.defineProperty(jr,"packageJson",{enumerable:!0,get:a(function(){return uyt.packageJson},"get")});var K2i=an(),RLa=Y2i(),kLa=gTr();jr.ConfigKey={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",UseSplitContextPrompt:"internal.useSplitContextPrompt"};jr.userScopeOnlyKeys=new Set([jr.ConfigKey.DebugOverrideCapiUrl,jr.ConfigKey.DebugOverrideCapiUrlLegacy,jr.ConfigKey.DebugTestOverrideCapiUrl,jr.ConfigKey.DebugTestOverrideCapiUrlLegacy,jr.ConfigKey.DebugOverrideProxyUrl,jr.ConfigKey.DebugOverrideProxyUrlLegacy,jr.ConfigKey.DebugTestOverrideProxyUrl,jr.ConfigKey.DebugTestOverrideProxyUrlLegacy]);var dyt;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(dyt||(jr.BlockMode=dyt={}));function PLa(t){return[dyt.Server,dyt.ParsingAndServer].includes(t)}a(PLa,"shouldDoServerTrimming");var dre;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(dre||(jr.BuildType=dre={}));jr.ICompletionsConfigProvider=(0,K2i.createServiceIdentifier)("ICompletionsConfigProvider");var J4e=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};jr.ConfigProvider=J4e;var ATr=class extends J4e{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return J2i(e)}getOptionalConfig(e){return Z2i(e)}dumpForTelemetry(){return{}}};jr.DefaultsOnlyConfigProvider=ATr;var yTr=class extends J4e{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new kLa.Emitter,this.onDidChangeCopilotSettings=this.copilotEmitter.event,this.overrides=new Map}setOverrides(e){this.overrides=e}clearOverrides(){this.overrides.clear()}getOptionalOverride(e){return this.overrides.get(e)}getConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getConfig(e)}getOptionalConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getOptionalConfig(e)}setConfig(e,r){this.setCopilotSettings({[e]:r})}setCopilotSettings(e){for(let[r,n]of Object.entries(e))n!==void 0?this.overrides.set(r,n):this.overrides.delete(r);this.copilotEmitter.fire(this)}dumpForTelemetry(){let e=this.baseConfigProvider.dumpForTelemetry();for(let r of[jr.ConfigKey.ShowEditorCompletions,jr.ConfigKey.EnableAutoCompletions,jr.ConfigKey.DelayCompletions,jr.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};jr.InMemoryConfigProvider=yTr;function DLa(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(DLa,"getConfigKeyRecursively");function J2i(t){if(_Tr.has(t))return _Tr.get(t);throw new Error(`Missing config default value: ${RLa.CopilotConfigPrefix}.${t}`)}a(J2i,"getConfigDefaultForKey");function Z2i(t){return _Tr.get(t)}a(Z2i,"getOptionalConfigDefaultForKey");var _Tr=new Map([[jr.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[jr.ConfigKey.RelatedFilesVSCodeCSharp,!1],[jr.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[jr.ConfigKey.RelatedFilesVSCode,!1],[jr.ConfigKey.IncludeNeighboringFiles,!1],[jr.ConfigKey.ExcludeRelatedFiles,!1],[jr.ConfigKey.ContextProviders,[]],[jr.ConfigKey.DebugSnippyOverrideUrl,""],[jr.ConfigKey.UseSubsetMatching,null],[jr.ConfigKey.ContextProviderTimeBudget,void 0],[jr.ConfigKey.DebugOverrideCapiUrl,""],[jr.ConfigKey.DebugTestOverrideCapiUrl,""],[jr.ConfigKey.DebugOverrideProxyUrl,""],[jr.ConfigKey.DebugTestOverrideProxyUrl,""],[jr.ConfigKey.DebugOverrideEngine,""],[jr.ConfigKey.AlwaysRequestMultiline,void 0],[jr.ConfigKey.CompletionsDebounce,void 0],[jr.ConfigKey.CompletionsDelay,void 0],[jr.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[jr.ConfigKey.UseWorkspaceContextCoordinator,void 0],[jr.ConfigKey.ShowEditorCompletions,void 0],[jr.ConfigKey.EnableAutoCompletions,void 0],[jr.ConfigKey.DelayCompletions,void 0],[jr.ConfigKey.FilterCompletions,void 0],[jr.ConfigKey.UseSplitContextPrompt,!0],[jr.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[jr.ConfigKey.UserSelectedCompletionModel,""],[jr.ConfigKey.DebugOverrideEngineLegacy,""],[jr.ConfigKey.DebugOverrideProxyUrlLegacy,""],[jr.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[jr.ConfigKey.DebugOverrideCapiUrlLegacy,""],[jr.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[jr.ConfigKey.DebugFilterLogCategories,[]]]);function NLa(t,e){return t.get(jr.ICompletionsConfigProvider).getConfig(e)}a(NLa,"getConfig");function MLa(t){try{return t.get(jr.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(MLa,"dumpForTelemetry");var fyt=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===dre.NIGHTLY}static isProduction(){return this.getBuildType()!==dre.DEV}static getBuildType(){return uyt.packageJson.buildType==="prod"?t.getVersion().length===15?dre.NIGHTLY:dre.PROD:dre.DEV}static getVersion(){return uyt.packageJson.version}static getBuild(){return uyt.packageJson.build}};jr.BuildInfo=fyt;function ETr({name:t,version:e}){return`${t}/${e}`}a(ETr,"formatNameAndVersion");jr.ICompletionsEditorAndPluginInfo=(0,K2i.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");jr.apiVersion="2025-05-01";function OLa(t){let e=t.get(jr.ICompletionsEditorAndPluginInfo);return{"Editor-Version":ETr(e.getEditorInfo()),"Editor-Plugin-Version":ETr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":fyt.getVersion()}}a(OLa,"editorVersionHeaders")});var vTr=I(pyt=>{"use strict";p();Object.defineProperty(pyt,"__esModule",{value:!0});pyt.ExpServiceTelemetryNames=void 0;var X2i;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(X2i||(pyt.ExpServiceTelemetryNames=X2i={}))});var hyt=I(JAe=>{"use strict";p();Object.defineProperty(JAe,"__esModule",{value:!0});JAe.ExpConfig=JAe.ExpTreatmentVariables=void 0;var LLa=nA(),BLa=vTr(),eDi;(function(t){t.CustomEngine="copilotcustomengine",t.CustomEngineTargetEngine="copilotcustomenginetargetengine",t.OverrideBlockMode="copilotoverrideblockmode",t.SuffixPercent="CopilotSuffixPercent",t.CppHeadersEnableSwitch="copilotcppheadersenableswitch",t.UseSubsetMatching="copilotsubsetmatching",t.SuffixMatchThreshold="copilotsuffixmatchthreshold",t.MaxPromptCompletionTokens="maxpromptcompletionTokens",t.StableContextPercent="copilotstablecontextpercent",t.VolatileContextPercent="copilotvolatilecontextpercent",t.RelatedFilesVSCodeCSharp="copilotrelatedfilesvscodecsharp",t.RelatedFilesVSCodeTypeScript="copilotrelatedfilesvscodetypescript",t.RelatedFilesVSCode="copilotrelatedfilesvscode",t.ContextProviders="copilotcontextproviders",t.IncludeNeighboringFiles="copilotincludeneighboringfiles",t.ExcludeRelatedFiles="copilotexcluderelatedfiles",t.ContextProviderTimeBudget="copilotcontextprovidertimebudget",t.CppContextProviderParams="copilotcppContextProviderParams",t.CSharpContextProviderParams="copilotcsharpcontextproviderparams",t.JavaContextProviderParams="copilotjavacontextproviderparams",t.MultiLanguageContextProviderParams="copilotmultilanguagecontextproviderparams",t.TsContextProviderParams="copilottscontextproviderparams",t.CompletionsDebounce="copilotcompletionsdebounce",t.ElectronFetcher="copilotelectronfetcher",t.FetchFetcher="copilotfetchfetcher",t.AsyncCompletionsTimeout="copilotasynccompletionstimeout",t.EnablePromptContextProxyField="copilotenablepromptcontextproxyfield",t.ProgressiveReveal="copilotprogressivereveal",t.ModelAlwaysTerminatesSingleline="copilotmodelterminatesingleline",t.ProgressiveRevealLongLookaheadSize="copilotprogressivereveallonglookaheadsize",t.ProgressiveRevealShortLookaheadSize="copilotprogressiverevealshortlookaheadsize",t.MaxMultilineTokens="copilotmaxmultilinetokens",t.MultilineAfterAcceptLines="copilotmultilineafteracceptlines",t.CompletionsDelay="copilotcompletionsdelay",t.SingleLineUnlessAccepted="copilotsinglelineunlessaccepted"})(eDi||(JAe.ExpTreatmentVariables=eDi={}));var CTr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,LLa.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[BLa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};JAe.ExpConfig=CTr});var xy=I(myt=>{"use strict";p();Object.defineProperty(myt,"__esModule",{value:!0});myt.ICompletionsFeaturesService=void 0;var FLa=an();myt.ICompletionsFeaturesService=(0,FLa.createServiceIdentifier)("ICompletionsFeaturesService")});var gyt=I(T$=>{"use strict";p();Object.defineProperty(T$,"__esModule",{value:!0});T$.FilterSettings=T$.Release=T$.Filter=void 0;var fre;(function(t){t.ExtensionRelease="X-VSCode-ExtensionRelease",t.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",t.CopilotEngine="X-Copilot-Engine",t.CopilotOverrideEngine="X-Copilot-OverrideEngine",t.CopilotRepository="X-Copilot-Repository",t.CopilotFileType="X-Copilot-FileType",t.CopilotUserKind="X-Copilot-UserKind",t.CopilotDogfood="X-Copilot-Dogfood",t.CopilotCustomModel="X-Copilot-CustomModel",t.CopilotOrgs="X-Copilot-Orgs",t.CopilotCustomModelNames="X-Copilot-CustomModelNames",t.CopilotTrackingId="X-Copilot-CopilotTrackingId",t.CopilotClientVersion="X-Copilot-ClientVersion",t.CopilotRelatedPluginVersionCppTools="X-Copilot-RelatedPluginVersion-msvscodecpptools",t.CopilotRelatedPluginVersionCMakeTools="X-Copilot-RelatedPluginVersion-msvscodecmaketools",t.CopilotRelatedPluginVersionMakefileTools="X-Copilot-RelatedPluginVersion-msvscodemakefiletools",t.CopilotRelatedPluginVersionCSharpDevKit="X-Copilot-RelatedPluginVersion-msdotnettoolscsdevkit",t.CopilotRelatedPluginVersionPython="X-Copilot-RelatedPluginVersion-mspythonpython",t.CopilotRelatedPluginVersionPylance="X-Copilot-RelatedPluginVersion-mspythonvscodepylance",t.CopilotRelatedPluginVersionJavaPack="X-Copilot-RelatedPluginVersion-vscjavavscodejavapack",t.CopilotRelatedPluginVersionJavaManager="X-Copilot-RelatedPluginVersion-vscjavavscodejavadependency",t.CopilotRelatedPluginVersionTypescript="X-Copilot-RelatedPluginVersion-vscodetypescriptlanguagefeatures",t.CopilotRelatedPluginVersionTypescriptNext="X-Copilot-RelatedPluginVersion-msvscodevscodetypescriptnext",t.CopilotRelatedPluginVersionCSharp="X-Copilot-RelatedPluginVersion-msdotnettoolscsharp",t.CopilotRelatedPluginVersionGithubCopilotChat="X-Copilot-RelatedPluginVersion-githubcopilotchat",t.CopilotRelatedPluginVersionGithubCopilot="X-Copilot-RelatedPluginVersion-githubcopilot"})(fre||(T$.Filter=fre={}));var tDi;(function(t){t.Stable="stable",t.Nightly="nightly"})(tDi||(T$.Release=tDi={}));var ULa={[fre.CopilotClientTimeBucket]:"timeBucket",[fre.CopilotOverrideEngine]:"engine",[fre.CopilotRepository]:"repo",[fre.CopilotFileType]:"fileType",[fre.CopilotUserKind]:"userKind"},bTr=class{static{a(this,"FilterSettings")}constructor(e){this.filters=e;for(let[r,n]of Object.entries(this.filters))n===""&&delete this.filters[r]}addToTelemetry(e){for(let[r,n]of Object.entries(this.filters)){let o=ULa[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};T$.FilterSettings=bTr});var iDi=I(ZAe=>{"use strict";p();Object.defineProperty(ZAe,"__esModule",{value:!0});ZAe.JointCompletionsProviderTriggerChangeStrategy=ZAe.JointCompletionsProviderStrategy=void 0;var rDi;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(rDi||(ZAe.JointCompletionsProviderStrategy=rDi={}));var nDi;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(nDi||(ZAe.JointCompletionsProviderTriggerChangeStrategy=nDi={}))});var I$=I(Lg=>{"use strict";p();Object.defineProperty(Lg,"__esModule",{value:!0});Lg.vString=qLa;Lg.vNumber=HLa;Lg.vBoolean=$La;Lg.vObjAny=WLa;Lg.vUndefined=YLa;Lg.vNull=KLa;Lg.vNullable=JLa;Lg.vUnchecked=sDi;Lg.vUnknown=ZLa;Lg.vRequired=XLa;Lg.vObj=eBa;Lg.vArray=tBa;Lg.vTuple=rBa;Lg.vUnion=aDi;Lg.vEnum=nBa;Lg.vLiteral=iBa;Lg.vLazy=oBa;var pre=class{static{a(this,"TypeofValidator")}constructor(e){this.type=e}validate(e){return typeof e!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}:{content:e,error:void 0}}toSchema(){return{type:this.type}}},QLa=new pre("string");function qLa(){return QLa}a(qLa,"vString");var jLa=new pre("number");function HLa(){return jLa}a(HLa,"vNumber");var GLa=new pre("boolean");function $La(){return GLa}a($La,"vBoolean");var VLa=new pre("object");function WLa(){return VLa}a(WLa,"vObjAny");var zLa=new pre("undefined");function YLa(){return zLa}a(YLa,"vUndefined");var STr=class{static{a(this,"NullValidator")}validate(e){return e!==null?{content:void 0,error:{message:`Expected null, but got ${typeof e}`}}:{content:null,error:void 0}}toSchema(){return{type:"null"}}},oDi=new STr;function KLa(){return oDi}a(KLa,"vNull");function JLa(t){return aDi(t,oDi)}a(JLa,"vNullable");function sDi(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(sDi,"vUnchecked");function ZLa(){return sDi()}a(ZLa,"vUnknown");function XLa(t){return{validate(e){return e===void 0?{content:void 0,error:{message:"Required field is missing"}}:t.validate(e)},toSchema(){return t.toSchema()},isRequired(){return!0}}}a(XLa,"vRequired");function eBa(t){return{validate(e){if(typeof e!="object"||e===null)return{content:void 0,error:{message:"Expected object"}};let r={};for(let n in t){let o=t[n],s=e[n],c=o.isRequired?.()??!1;if(c&&s===void 0)return{content:void 0,error:{message:`Required field '${n}' is missing`}};if(!c&&s===void 0)continue;let{content:l,error:u}=o.validate(s);if(u)return{content:void 0,error:{message:`Error in property '${n}': ${u.message}`}};r[n]=l}return{content:r,error:void 0}},toSchema(){let e=[],r={};for(let[o,s]of Object.entries(t))r[o]=s.toSchema(),s.isRequired?.()&&e.push(o);return{type:"object",properties:r,...e.length>0?{required:e}:{}}}}}a(eBa,"vObj");function tBa(t){return{validate(e){if(!Array.isArray(e))return{content:void 0,error:{message:"Expected array"}};let r=[];for(let n=0;ne.toSchema())}}}}a(rBa,"vTuple");function aDi(...t){return{validate(e){let r;for(let n of t){let{content:o,error:s}=n.validate(e);if(!s)return{content:o,error:void 0};r=s}return{content:void 0,error:r}},toSchema(){return{oneOf:t.map(e=>e.toSchema())}}}}a(aDi,"vUnion");function nBa(...t){return{validate(e){return t.indexOf(e)===-1?{content:void 0,error:{message:`Expected one of: ${t.join(", ")}`}}:{content:e,error:void 0}},toSchema(){return{enum:t}}}}a(nBa,"vEnum");function iBa(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(iBa,"vLiteral");function oBa(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(oBa,"vLazy")});var cDi=I(Z4e=>{"use strict";p();Object.defineProperty(Z4e,"__esModule",{value:!0});Z4e.DocumentSwitchTriggerStrategy=void 0;var sBa=I$(),Ayt;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(Ayt||(Z4e.DocumentSwitchTriggerStrategy=Ayt={}));(function(t){t.VALIDATOR=(0,sBa.vEnum)(t.Always,t.AfterAcceptance)})(Ayt||(Z4e.DocumentSwitchTriggerStrategy=Ayt={}))});var TTr=I(X4e=>{"use strict";p();Object.defineProperty(X4e,"__esModule",{value:!0});X4e.DiffHistoryMergeStrategy=void 0;var aBa=I$(),yyt;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(yyt||(X4e.DiffHistoryMergeStrategy=yyt={}));(function(t){t.VALIDATOR=(0,aBa.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(yyt||(X4e.DiffHistoryMergeStrategy=yyt={}))});var Eyt=I(eLe=>{"use strict";p();Object.defineProperty(eLe,"__esModule",{value:!0});eLe.ImportChanges=void 0;var cBa=I$(),_yt;(function(t){t.All="all",t.None="none"})(_yt||(eLe.ImportChanges=_yt={}));(function(t){t.VALIDATOR=(0,cBa.vEnum)(t.All,t.None)})(_yt||(eLe.ImportChanges=_yt={}))});var wy=I(An=>{"use strict";p();Object.defineProperty(An,"__esModule",{value:!0});An.PatchModelPrediction=An.SpeculativeRequestsAutoExpandEditWindowLines=An.SpeculativeRequestsCursorPlacement=An.DuplicateAdditionsMode=An.SpeculativeRequestsEnablement=An.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=An.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=An.MODEL_CONFIGURATION_VALIDATOR=An.LINT_OPTIONS_VALIDATOR=An.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=An.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=An.DEFAULT_OPTIONS=An.ResponseFormat=An.PromptingStrategy=An.EditIntent=An.EarlyDivergenceCancellationMode=An.AggressivenessLevel=An.AggressivenessSetting=An.LintOptionShowCode=An.LintOptionWarning=An.CurrentFileOptions=An.GlobalBudgetOptions=An.NeighborFilesOptions=An.RecentlyViewedDocumentsOptions=An.RecentFileClippingStrategy=An.IncludeLineNumbersOption=void 0;An.isPromptingStrategy=lBa;An.isAggressivenessStrategy=uBa;An.applyStrategyConfig=fBa;An.parseLintOptionString=pBa;An.parseUserHappinessScoreConfigurationString=hBa;var vyt=xT(),fDi=pd(),Ar=I$(),ITr=Eyt(),AS;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(AS||(An.IncludeLineNumbersOption=AS={}));var hre;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(hre||(An.RecentFileClippingStrategy=hre={}));(function(t){t.VALIDATOR=(0,Ar.vEnum)(t.AroundEditRange,t.Proportional)})(hre||(An.RecentFileClippingStrategy=hre={}));var xTr;(function(t){t.VALIDATOR=(0,Ar.vObj)({nDocuments:(0,Ar.vNumber)(),maxTokens:(0,Ar.vNumber)(),includeViewedFiles:(0,Ar.vBoolean)(),includeLineNumbers:(0,Ar.vEnum)(AS.WithSpaceAfter,AS.WithoutSpace,AS.None),clippingStrategy:(0,Ar.vEnum)(hre.AroundEditRange,hre.Proportional),useLeftoverBudgetFromAbove:(0,Ar.vBoolean)()})})(xTr||(An.RecentlyViewedDocumentsOptions=xTr={}));var lDi;(function(t){t.VALIDATOR=(0,Ar.vObj)({enabled:(0,Ar.vBoolean)(),maxTokens:(0,Ar.vNumber)()})})(lDi||(An.NeighborFilesOptions=lDi={}));var uDi;(function(t){t.DEFAULT_ORDER=["languageContext","recentlyViewedDocuments","neighborFiles","diffHistory"],t.DEFAULT_SHARES={currentFile:1500/7500,recentlyViewedDocuments:2e3/7500,languageContext:2e3/7500,neighborFiles:1e3/7500,diffHistory:1e3/7500},t.DEFAULT_TOTAL_TOKENS=7500;function e(o){return Math.max(0,Math.floor(o.totalTokens*(o.shares.currentFile??0)))}a(e,"currentFileBudget"),t.currentFileBudget=e;function r(o){if(!Number.isFinite(o.totalTokens)||o.totalTokens<0)throw new Error(`globalBudget.totalTokens must be a finite, non-negative number, got ${o.totalTokens}`);let s=new Set;for(let f of o.order){if(s.has(f))throw new Error(`globalBudget.order contains duplicate part '${f}'`);if(s.add(f),typeof o.shares[f]!="number")throw new Error(`globalBudget.shares is missing entry for '${f}'`);if(!Number.isFinite(o.shares[f])||o.shares[f]<0)throw new Error(`globalBudget.shares['${f}'] must be a finite, non-negative number, got ${o.shares[f]}`)}if(typeof o.shares.currentFile!="number")throw new Error("globalBudget.shares is missing entry for 'currentFile'");if(!Number.isFinite(o.shares.currentFile)||o.shares.currentFile<0)throw new Error(`globalBudget.shares['currentFile'] must be a finite, non-negative number, got ${o.shares.currentFile}`);let c=o.order.indexOf("recentlyViewedDocuments"),l=o.order.indexOf("neighborFiles");if(c!==-1&&l!==-1&&lf+o.shares[h],0)+o.shares.currentFile;if(Math.abs(u-1)>.001)throw new Error(`globalBudget.shares across order must sum to ~1, got ${u}`)}a(r,"validate"),t.validate=r,t.VALIDATOR=(0,Ar.vObj)({totalTokens:(0,Ar.vUnion)((0,Ar.vNumber)(),(0,Ar.vUndefined)()),order:(0,Ar.vUnion)((0,Ar.vArray)((0,Ar.vEnum)("languageContext","recentlyViewedDocuments","neighborFiles","diffHistory")),(0,Ar.vUndefined)()),shares:(0,Ar.vUnion)((0,Ar.vObj)({currentFile:(0,Ar.vRequired)((0,Ar.vNumber)()),recentlyViewedDocuments:(0,Ar.vRequired)((0,Ar.vNumber)()),languageContext:(0,Ar.vRequired)((0,Ar.vNumber)()),neighborFiles:(0,Ar.vRequired)((0,Ar.vNumber)()),diffHistory:(0,Ar.vRequired)((0,Ar.vNumber)())}),(0,Ar.vUndefined)())});function n(o){let s;try{s=JSON.parse(o)}catch(d){return vyt.Result.error(`Failed to parse globalBudget config string: ${d instanceof Error?d.message:String(d)}`)}let{content:c,error:l}=t.VALIDATOR.validate(s);if(l)return vyt.Result.error(`globalBudget config validation failed: ${l.message}`);let u={totalTokens:c.totalTokens??t.DEFAULT_TOTAL_TOKENS,order:c.order??t.DEFAULT_ORDER,shares:c.shares??t.DEFAULT_SHARES};try{r(u)}catch(d){return vyt.Result.error(d instanceof Error?d.message:String(d))}return vyt.Result.ok(u)}a(n,"fromConfigString"),t.fromConfigString=n})(uDi||(An.GlobalBudgetOptions=uDi={}));var wTr;(function(t){t.VALIDATOR=(0,Ar.vObj)({maxTokens:(0,Ar.vNumber)(),includeTags:(0,Ar.vBoolean)(),includeLineNumbers:(0,Ar.vEnum)(AS.WithSpaceAfter,AS.WithoutSpace,AS.None),includeCursorTag:(0,Ar.vBoolean)(),prioritizeAboveCursor:(0,Ar.vBoolean)(),useLeftoverBudgetFromAbove:(0,Ar.vBoolean)()})})(wTr||(An.CurrentFileOptions=wTr={}));var XAe;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(XAe||(An.LintOptionWarning=XAe={}));var eye;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})(eye||(An.LintOptionShowCode=eye={}));var Cyt;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})(Cyt||(An.AggressivenessSetting=Cyt={}));var x$;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(x$||(An.AggressivenessLevel=x$={}));var byt;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(byt||(An.EarlyDivergenceCancellationMode=byt={}));(function(t){t.VALIDATOR=(0,Ar.vEnum)(t.Cursor,t.EditWindow,t.Off)})(byt||(An.EarlyDivergenceCancellationMode=byt={}));(function(t){t.VALIDATOR=(0,Ar.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return x$.Low;case t.Medium:return x$.Medium;case t.High:return x$.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})(Cyt||(An.AggressivenessSetting=Cyt={}));var Syt;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(Syt||(An.EditIntent=Syt={}));(function(t){function e(o){switch(o){case"no_edit":return t.NoEdit;case"low":return t.Low;case"medium":return t.Medium;case"high":return t.High;default:return t.High}}a(e,"fromString"),t.fromString=e;function r(o){switch(o){case"N":return t.NoEdit;case"L":return t.Low;case"M":return t.Medium;case"H":return t.High;default:return}}a(r,"fromShortName"),t.fromShortName=r;function n(o,s){switch(o){case t.NoEdit:return!1;case t.High:return!0;case t.Medium:return s===x$.Medium||s===x$.High;case t.Low:return s===x$.High;default:(0,fDi.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(Syt||(An.EditIntent=Syt={}));var jl;(function(t){t.CopilotNesXtab="copilotNesXtab",t.UnifiedModel="xtabUnifiedModel",t.Codexv21NesUnified="codexv21nesUnified",t.Nes41Miniv3="nes41miniv3",t.SimplifiedSystemPrompt="simplifiedSystemPrompt",t.Xtab275="xtab275",t.XtabAggressiveness="xtabAggressiveness",t.Xtab275Aggressiveness="xtab275Aggressiveness",t.Xtab275AggressivenessHighLow="xtab275AggressivenessHighLow",t.PatchBased="patchBased",t.PatchBased01="patchBased01",t.PatchBased02="patchBased02",t.PatchBased02WithRecentLineNumbers="patchBased02WithRecentLineNumbers",t.PatchBased02WithoutRecentLineNumbers="patchBased02WithoutRecentLineNumbers",t.Xtab275EditIntent="xtab275EditIntent",t.Xtab275EditIntentShort="xtab275EditIntentShort"})(jl||(An.PromptingStrategy=jl={}));function lBa(t){return Object.values(jl).includes(t)}a(lBa,"isPromptingStrategy");function uBa(t){return t===jl.XtabAggressiveness||t===jl.Xtab275Aggressiveness||t===jl.Xtab275AggressivenessHighLow||t===jl.Xtab275EditIntent||t===jl.Xtab275EditIntentShort}a(uBa,"isAggressivenessStrategy");var Tyt;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})(Tyt||(An.ResponseFormat=Tyt={}));(function(t){function e(r){switch(r){case jl.UnifiedModel:case jl.Codexv21NesUnified:case jl.Nes41Miniv3:return t.UnifiedWithXml;case jl.Xtab275:case jl.XtabAggressiveness:case jl.Xtab275Aggressiveness:case jl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case jl.PatchBased:case jl.PatchBased01:case jl.PatchBased02:case jl.PatchBased02WithRecentLineNumbers:case jl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case jl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case jl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case jl.SimplifiedSystemPrompt:case jl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,fDi.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})(Tyt||(An.ResponseFormat=Tyt={}));An.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:1500,includeTags:!0,includeLineNumbers:AS.None,includeCursorTag:!1,prioritizeAboveCursor:!1,useLeftoverBudgetFromAbove:!0},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:AS.None,clippingStrategy:hre.AroundEditRange,useLeftoverBudgetFromAbove:!1},languageContext:{enabled:!1,maxTokens:2e3,traitPosition:"after"},neighborFiles:{enabled:!1,maxTokens:1e3},diffHistory:{nEntries:25,maxTokens:1e3,onlyForDocsInPrompt:!1,useRelativePaths:!1},lintOptions:void 0,includePostScript:!0};An.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:eye.YES_WITH_SURROUNDING,tagName:"linter",warnings:XAe.YES_IF_NO_ERRORS,nRecentFiles:0};An.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var dBa={[jl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[jl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:AS.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:AS.WithoutSpace},supportsNextCursorLinePrediction:!1,allowImportChanges:ITr.ImportChanges.All},[jl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:AS.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:AS.None},supportsNextCursorLinePrediction:!1,allowImportChanges:ITr.ImportChanges.All}};function fBa(t){let e=t.promptingStrategy===void 0?void 0:dBa[t.promptingStrategy];if(!e)return t;let r=t.currentFile!==void 0||e.currentFile!==void 0,n=t.recentlyViewedDocuments!==void 0||e.recentlyViewedDocuments!==void 0,o=t.lintOptions!==void 0||e.lintOptions!==void 0;return{...t,...e,currentFile:r?{...t.currentFile,...e.currentFile}:void 0,recentlyViewedDocuments:n?{...t.recentlyViewedDocuments,...e.recentlyViewedDocuments}:void 0,lintOptions:o?{...t.lintOptions,...e.lintOptions}:void 0}}a(fBa,"applyStrategyConfig");An.LINT_OPTIONS_VALIDATOR=(0,Ar.vObj)({tagName:(0,Ar.vString)(),warnings:(0,Ar.vEnum)(XAe.YES,XAe.NO,XAe.YES_IF_NO_ERRORS),showCode:(0,Ar.vEnum)(eye.NO,eye.YES,eye.YES_WITH_SURROUNDING),maxLints:(0,Ar.vNumber)(),maxLineDistance:(0,Ar.vNumber)(),nRecentFiles:(0,Ar.vNumber)()});An.MODEL_CONFIGURATION_VALIDATOR=(0,Ar.vObj)({modelName:(0,Ar.vRequired)((0,Ar.vString)()),promptingStrategy:(0,Ar.vUnion)((0,Ar.vEnum)(...Object.values(jl)),(0,Ar.vUndefined)()),includeTagsInCurrentFile:(0,Ar.vRequired)((0,Ar.vBoolean)()),includePostScript:(0,Ar.vUnion)((0,Ar.vBoolean)(),(0,Ar.vUndefined)()),currentFile:(0,Ar.vUnion)(wTr.VALIDATOR,(0,Ar.vUndefined)()),recentlyViewedDocuments:(0,Ar.vUnion)(xTr.VALIDATOR,(0,Ar.vUndefined)()),lintOptions:(0,Ar.vUnion)(An.LINT_OPTIONS_VALIDATOR,(0,Ar.vUndefined)()),supportsNextCursorLinePrediction:(0,Ar.vUnion)((0,Ar.vBoolean)(),(0,Ar.vUndefined)()),allowImportChanges:(0,Ar.vUnion)(ITr.ImportChanges.VALIDATOR,(0,Ar.vUndefined)())});function pBa(t,e){try{let r=JSON.parse(t),n=An.LINT_OPTIONS_VALIDATOR.validate(r);if(n.error)throw new Error(`Lint options validation failed: ${n.error.message}`);return{...e,...n.content}}catch(r){throw new Error(`Failed to parse lint options string: ${r}`)}}a(pBa,"parseLintOptionString");An.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var dDi=(0,Ar.vObj)({acceptedScore:(0,Ar.vRequired)((0,Ar.vNumber)()),rejectedScore:(0,Ar.vRequired)((0,Ar.vNumber)()),ignoredScore:(0,Ar.vRequired)((0,Ar.vNumber)()),highThreshold:(0,Ar.vRequired)((0,Ar.vNumber)()),mediumThreshold:(0,Ar.vRequired)((0,Ar.vNumber)()),includeIgnored:(0,Ar.vRequired)((0,Ar.vBoolean)()),ignoredLimit:(0,Ar.vRequired)((0,Ar.vNumber)()),limitConsecutiveIgnored:(0,Ar.vRequired)((0,Ar.vBoolean)()),limitTotalIgnored:(0,Ar.vRequired)((0,Ar.vBoolean)())});function tLe(t,e,r){return t>=e&&t<=r}a(tLe,"isInRange");An.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=dDi.validate(t);if(e.error)return e;let r=e.content;return tLe(r.acceptedScore,0,1)?tLe(r.rejectedScore,0,1)?tLe(r.ignoredScore,0,1)?tLe(r.highThreshold,0,1)?tLe(r.mediumThreshold,0,1)?r.acceptedScore<=r.rejectedScore?{content:void 0,error:{message:"acceptedScore must be greater than rejectedScore to prevent division by zero"}}:r.ignoredScore{"use strict";p();Object.defineProperty(tye,"__esModule",{value:!0});tye.TextReplacement=tye.TextEdit=void 0;var pDi=Ml(),hDi=pd(),Nyt=Os(),Pyt=ym(),w$=iv(),Om=uh(),Myt=Vge(),mDi=dI(),Oyt=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>$v.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new $v(e,r)])}static delete(e){return new t([new $v(e,"")])}static insert(e,r){return new t([new $v(Om.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,pDi.compareBy)(n=>n.range,Om.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,hDi.assertFn)(()=>(0,hDi.checkAdjacentItems)(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}normalize(){let e=[];for(let r of this.replacements)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(r.range.getStartPosition())){let n=e[e.length-1];e[e.length-1]=new $v(n.range.plusRange(r.range),n.text+r.text)}else r.isEmpty||e.push(r);return new t(e)}mapPosition(e){let r=0,n=0,o=0;for(let s of this.replacements){let c=s.range.getStartPosition();if(e.isBeforeOrEqual(c))break;let l=s.range.getEndPosition(),u=Myt.TextLength.ofText(s.text);if(e.isBefore(l)){let d=new w$.Position(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return Dyt(d,f)}c.lineNumber+r!==n&&(o=0),r+=u.lineCount-(s.range.endLineNumber-s.range.startLineNumber),u.lineCount===0?l.lineNumber!==c.lineNumber?o+=u.columnCount-(l.column-1):o+=u.columnCount-(l.column-c.column):o=u.columnCount,n=l.lineNumber+r}return new w$.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof w$.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof w$.Position?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return Dyt(o,s)}inverseMapPosition(e,r){return this.inverse(r).mapPosition(e)}inverseMapRange(e,r){return this.inverse(r).mapRange(e)}apply(e){let r="",n=new w$.Position(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=Dyt(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=Dyt(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new mDi.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new $v(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=Myt.TextLength.ofText(s.text),l=w$.Position.lift({lineNumber:s.range.startLineNumber+n,column:s.range.startColumn+(s.range.startLineNumber===r?o:0)}),u=c.createRange(l);e.push(u),n=u.endLineNumber-s.range.endLineNumber,o=u.endColumn-s.range.endColumn,r=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Nyt.BugIndicatingError;if(this.replacements.length===1)return this.replacements[0];let r=this.replacements[0].range.getStartPosition(),n=this.replacements[this.replacements.length-1].range.getEndPosition(),o="";for(let s=0;sr.equals(n))}compose(e){let r=this.normalize(),n=e.normalize();if(r.replacements.length===0)return n;if(n.replacements.length===0)return r;let o=[],s=0,c=1,l=1,u=0,d=0,f=0,h=0,m=null,g=0,A=0,y=!1,_=!1,E=1,v=1;function S(){if(!y)if(sr.toString()).join(` -`):typeof e=="string"?this.toString(new mDi.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Om.Range.fromPositions(new w$.Position(Math.max(1,r.range.startLineNumber-1),1),r.range.getStartPosition()),c=e.getValueOfRange(s);c.length>10&&(c="..."+c.substring(c.length-10));let l=Om.Range.fromPositions(r.range.getEndPosition(),new w$.Position(r.range.endLineNumber+1,1)),u=e.getValueOfRange(l);u.length>10&&(u=u.substring(0,10)+"...");let d=o;if(d.length>10){let h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}let f=r.text;if(f.length>10){let h=Math.floor(5);f=f.substring(0,h)+"..."+f.substring(f.length-h)}return d.length===0?`${c}\u2770${f}\u2771${u}`:`${c}\u2770${d}\u21A6${f}\u2771${u}`}).join(` -`)}};tye.TextEdit=Oyt;var $v=class t{static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new Nyt.BugIndicatingError;if(e.length===1)return e[0];let n=e[0].range.getStartPosition(),o=e[e.length-1].range.getEndPosition(),s="";for(let c=0;c env var `COPILOT_OTEL_ENABLED` > user setting. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.exporterType":{type:"string",enum:["otlp-grpc","otlp-http","console","file"],default:"otlp-http",scope:"application",policyReference:{name:"CopilotOtelProtocol"},markdownDescription:"OTel exporter type for Copilot Chat telemetry. Configurable in user settings or managed by enterprise policy (policy takes precedence). Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.protocol":{type:"string",enum:["","http/json","http/protobuf","grpc"],default:"",scope:"application",policyReference:{name:"CopilotOtelOtlpProtocol"},markdownDescription:"OTLP wire protocol for Copilot Chat OTel data, mirroring `OTEL_EXPORTER_OTLP_PROTOCOL`. `http/protobuf` selects the protobuf-over-HTTP exporter; the default (empty) uses `http/json`. Precedence: enterprise policy > env var > user setting. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.otlpEndpoint":{type:"string",default:"http://localhost:4318",scope:"application",policyReference:{name:"CopilotOtelEndpoint"},markdownDescription:"OTLP collector endpoint URL for Copilot Chat OTel data. Precedence: enterprise policy > env var `OTEL_EXPORTER_OTLP_ENDPOINT` > user setting. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.captureContent":{type:"boolean",default:!1,scope:"application",policyReference:{name:"CopilotOtelCaptureContent"},markdownDescription:"Capture input/output messages, system instructions, and tool definitions in OTel telemetry. **Contains potentially sensitive data.** Precedence: enterprise policy > env var `COPILOT_OTEL_CAPTURE_CONTENT` > user setting. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.serviceName":{type:"string",default:"",scope:"application",policyReference:{name:"CopilotOtelServiceName"},markdownDescription:"OTel `service.name` resource attribute for Copilot Chat OTel data. Configurable in user settings only. Env var `OTEL_SERVICE_NAME` takes precedence over the setting; enterprise policy takes precedence over both. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.resourceAttributes":{type:"object",additionalProperties:{type:"string"},default:{},scope:"application",policyReference:{name:"CopilotOtelResourceAttributes"},markdownDescription:'Additional OTel resource attributes for Copilot Chat OTel data, as a `{ "key": "value" }` map. Configurable in user settings only. Merged per-key with `OTEL_RESOURCE_ATTRIBUTES` env (env wins over the setting); enterprise policy wins over both. Requires window reload.',tags:["advanced"]},"github.copilot.chat.otel.headers":{type:"object",additionalProperties:{type:"string"},default:{},scope:"application",policyReference:{name:"CopilotOtelHeaders"},markdownDescription:'Extra OTLP exporter headers (e.g. auth tokens) for Copilot Chat OTel data, as a `{ "key": "value" }` map. Applied directly to the OTLP exporter, not via environment variables. Configurable in user settings only. Merged per-key with `OTEL_EXPORTER_OTLP_HEADERS` env (env wins over the setting); enterprise policy wins over both. **Contains potentially sensitive credentials.** Requires window reload.',tags:["advanced"]},"github.copilot.chat.otel.maxAttributeSizeChars":{type:"integer",default:0,minimum:0,scope:"application",markdownDescription:"Maximum size **in characters** for free-form OTel content attributes (prompts, responses, tool arguments/results, hook input/output). `0` (the default) disables truncation so backends without per-attribute size limits receive full JSON payloads. Set to a positive value when your OTel backend caps attribute size \u2014 consult your backend's documentation for its per-attribute limit. Truncated values are suffixed with `...[truncated, original N chars]`. Configurable in user settings only. Env var `COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.outfile":{type:"string",default:"",scope:"application",policyReference:{name:"CopilotOtelOutfile"},markdownDescription:"File path for file-based OTel exporter output (JSON-lines). When set, overrides exporter type to `file`. Configurable in user settings or managed by enterprise policy (policy takes precedence). Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.dbSpanExporter.enabled":{type:"boolean",default:!1,scope:"application",markdownDescription:"Enable SQLite DB span exporter. Persists OTel spans to a local SQLite database. Automatically enables OTel when set to true. Configurable in user settings only. Requires window reload.",tags:["advanced"]},"github.copilot.chat.workspace.codeSearchExternalIngest.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.workspace.codeSearchExternalIngest.enabled%",tags:["advanced","onExp"]}}}],submenus:[{id:"copilot/reviewComment/additionalActions/applyAndNext",label:"%github.copilot.submenu.reviewComment.applyAndNext.label%"},{id:"copilot/reviewComment/additionalActions/discardAndNext",label:"%github.copilot.submenu.reviewComment.discardAndNext.label%"},{id:"copilot/reviewComment/additionalActions/discard",label:"%github.copilot.submenu.reviewComment.discard.label%"},{id:"github.copilot.chat.debug.filter",label:"Filter",icon:"$(filter)"},{id:"github.copilot.chat.debug.exportAllPromptLogsAsJson",label:"Export All Logs as JSON",icon:"$(file-export)"}],menus:{"editor/title":[{command:"github.copilot.debug.generateInlineEditTests",when:"resourceScheme == 'ccreq'"},{command:"github.copilot.chat.notebook.enableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && !github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && !config.notebook.globalToolbar",group:"navigation@10"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && !config.notebook.globalToolbar",group:"navigation@10"},{command:"github.copilot.chat.copilotCLI.acceptDiff",group:"navigation@1",when:"github.copilot.chat.copilotCLI.hasActiveDiff"},{command:"github.copilot.chat.copilotCLI.rejectDiff",group:"navigation@2",when:"github.copilot.chat.copilotCLI.hasActiveDiff"}],"editor/title/context":[{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"}],"explorer/context":[{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !explorerResourceIsFolder"}],"editor/context":[{command:"github.copilot.chat.fix",when:"!github.copilot.interactiveSession.disabled && chatSetupCompleted && !editorReadonly && editorSelectionHasDiagnostics",group:"1_chat@4"},{command:"github.copilot.chat.explain",when:"!github.copilot.interactiveSession.disabled && chatSetupCompleted",group:"1_chat@5"},{command:"github.copilot.chat.review",when:"config.github.copilot.chat.reviewSelection.enabled && !github.copilot.interactiveSession.disabled && chatSetupCompleted && resourceScheme != 'vscode-chat-code-block'",group:"1_chat@6"},{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"},{command:"github.copilot.chat.copilotCLI.addSelection",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && editorHasSelection && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"}],"chat/editor/inlineGutter":[{command:"github.copilot.chat.explain",when:"!github.copilot.interactiveSession.disabled && editor.hasSelection && !inlineChatFileBelongsToChat",group:"2_chat@2"},{command:"github.copilot.chat.review",when:"!github.copilot.interactiveSession.disabled && editor.hasSelection && config.github.copilot.chat.reviewSelection.enabled && !inlineChatFileBelongsToChat",group:"2_chat@3"}],"chat/input/editing/sessionToolbar":[{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply",when:"chatSessionType == copilotcli && workbenchState != empty && !isSessionsWindow",group:"navigation@0"},{command:"github.copilot.chat.checkoutPullRequestReroute",when:"chatSessionType == copilot-cloud-agent && !github.vscode-pull-request-github.activated && gitOpenRepositoryCount != 0",group:"navigation@0"},{command:"github.copilot.chat.cloudSessions.createPullRequestForTask",when:"chatSessionType == copilot-cloud-agent && github.copilot.chat.cloudTaskCanCreatePullRequest && !isSessionsWindow",group:"navigation@0"},{command:"github.copilot.chat.cloudSessions.openPullRequestForTask",when:"chatSessionType == copilot-cloud-agent && github.copilot.chat.cloudTaskCanOpenPullRequest && !isSessionsWindow",group:"navigation@0"}],"agents/changes/actions/primary":[{command:"github.copilot.sessions.initializeRepository",when:"sessionType == copilotcli && isSessionsWindow && sessions.isolationMode == workspace && !sessions.hasGitRepository && !sessions.isAgentHostSession",group:"0_init@1"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",when:"sessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && !sessions.isMergeBaseBranchProtected && !sessions.hasPullRequest && (sessions.hasUncommittedChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"1_merge@1"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync",when:"sessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && !sessions.isMergeBaseBranchProtected && !sessions.hasPullRequest && (sessions.hasUncommittedChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"1_merge@2"},{command:"github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR",when:"sessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && sessions.hasGitHubRemote && !sessions.hasPullRequest && sessions.hasBranchChanges && !sessions.isAgentHostSession",group:"2_pull_request@1"},{command:"github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR",when:"sessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && sessions.hasGitHubRemote && !sessions.hasPullRequest && sessions.hasBranchChanges && !sessions.isAgentHostSession",group:"2_pull_request@2"},{command:"github.copilot.sessions.commit",when:"sessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && !sessions.isAgentHostSession",group:"3_commit@1"},{command:"github.copilot.sessions.commitAndSync",when:"sessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && !sessions.isAgentHostSession",group:"3_commit@2"},{command:"github.copilot.sessions.sync",when:"sessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUpstream && !sessions.hasUncommittedChanges && (sessions.hasIncomingChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"4_sync@1"},{command:"github.copilot.claude.sessions.initializeRepository",when:"sessionType == claude-code && isSessionsWindow && !sessions.hasGitRepository",group:"init@1"},{command:"github.copilot.claude.sessions.commit",when:"sessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges",group:"commit@1"},{command:"github.copilot.claude.sessions.commitAndSync",when:"sessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && sessions.hasUpstream",group:"commit@2"},{command:"github.copilot.claude.sessions.sync",when:"sessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && !sessions.hasUncommittedChanges && sessions.hasUpstream",group:"sync@1"}],"agents/change/inline":[{command:"github.copilot.sessions.discardChanges",when:"sessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && !sessionIsArchived && !sessions.isAgentHostSession",group:"navigation@2"}],"chat/contextUsage/actions":[{command:"github.copilot.chat.compact",when:"!chatIsAgentHostSession"}],"chat/input/status":[{command:"github.copilot.chat.otel.statusActive",when:"github.copilot.otel.enabledExplicitly && isSessionsWindow",group:"otel@1"}],"chat/newSession":[{command:"github.copilot.cli.newSession",group:"4_recommendations@0"}],"testing/item/result":[{command:"github.copilot.tests.fixTestFailure.fromInline",when:"testResultState == failed && !testResultOutdated",group:"inline@2"}],"testing/item/context":[{command:"github.copilot.tests.fixTestFailure.fromInline",when:"testResultState == failed && !testResultOutdated",group:"inline@2"}],commandPalette:[{command:"github.copilot.cli.openInCopilotCLI",when:"false"},{command:"github.copilot.debug.extensionState",when:"false"},{command:"github.copilot.cli.sessions.commitToWorktree",when:"false"},{command:"github.copilot.cli.sessions.commitToRepository",when:"false"},{command:"github.copilot.chat.triggerPermissiveSignIn",when:"false"},{command:"github.copilot.chat.otel.statusActive",when:"false"},{command:"github.copilot.interactiveSession.feedback",when:"github.copilot-chat.activated && !github.copilot.interactiveSession.disabled"},{command:"github.copilot.debug.workbenchState",when:"true"},{command:"github.copilot.chat.rerunWithCopilotDebug",when:"false"},{command:"github.copilot.chat.startCopilotDebugCommand",when:"false"},{command:"github.copilot.git.generateCommitMessage",when:"false"},{command:"github.copilot.git.resolveMergeConflicts",when:"false"},{command:"github.copilot.chat.explain",when:"false"},{command:"github.copilot.chat.review",when:"!github.copilot.interactiveSession.disabled"},{command:"github.copilot.chat.review.apply",when:"false"},{command:"github.copilot.chat.review.applyAndNext",when:"false"},{command:"github.copilot.chat.review.discard",when:"false"},{command:"github.copilot.chat.review.discardAndNext",when:"false"},{command:"github.copilot.chat.review.discardAll",when:"false"},{command:"github.copilot.chat.review.stagedChanges",when:"false"},{command:"github.copilot.chat.review.unstagedChanges",when:"false"},{command:"github.copilot.chat.review.changes",when:"false"},{command:"github.copilot.chat.review.stagedFileChange",when:"false"},{command:"github.copilot.chat.review.unstagedFileChange",when:"false"},{command:"github.copilot.chat.review.previous",when:"false"},{command:"github.copilot.chat.review.next",when:"false"},{command:"github.copilot.chat.review.continueInInlineChat",when:"false"},{command:"github.copilot.chat.review.continueInChat",when:"false"},{command:"github.copilot.chat.review.markHelpful",when:"false"},{command:"github.copilot.chat.review.markUnhelpful",when:"false"},{command:"github.copilot.devcontainer.generateDevContainerConfig",when:"false"},{command:"github.copilot.tests.fixTestFailure",when:"false"},{command:"github.copilot.tests.fixTestFailure.fromInline",when:"false"},{command:"github.copilot.search.markHelpful",when:"false"},{command:"github.copilot.search.markUnhelpful",when:"false"},{command:"github.copilot.search.feedback",when:"false"},{command:"github.copilot.chat.debug.showElements",when:"false"},{command:"github.copilot.chat.debug.hideElements",when:"false"},{command:"github.copilot.chat.debug.showTools",when:"false"},{command:"github.copilot.chat.debug.hideTools",when:"false"},{command:"github.copilot.chat.debug.showNesRequests",when:"false"},{command:"github.copilot.chat.debug.hideNesRequests",when:"false"},{command:"github.copilot.chat.debug.showGhostRequests",when:"false"},{command:"github.copilot.chat.debug.hideGhostRequests",when:"false"},{command:"github.copilot.chat.debug.exportLogItem",when:"false"},{command:"github.copilot.chat.debug.exportPromptArchive",when:"false"},{command:"github.copilot.chat.debug.exportPromptLogsAsJson",when:"false"},{command:"github.copilot.chat.debug.exportAllPromptLogsAsJson",when:"false"},{command:"github.copilot.chat.mcp.setup.check",when:"false"},{command:"github.copilot.chat.mcp.setup.validatePackage",when:"false"},{command:"github.copilot.chat.mcp.setup.flow",when:"false"},{command:"github.copilot.chat.debug.showRawRequestBody",when:"false"},{command:"github.copilot.debug.showOutputChannel",when:"false"},{command:"github.copilot.cli.sessions.delete",when:"false"},{command:"github.copilot.cli.sessions.resumeInTerminal",when:"false"},{command:"github.copilot.cli.sessions.rename",when:"false"},{command:"github.copilot.claude.sessions.rename",when:"false"},{command:"github.copilot.cli.sessions.setTitle",when:"false"},{command:"github.copilot.cli.sessions.openRepository",when:"false"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",when:"false"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",when:"false"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",when:"false"},{command:"github.copilot.cloud.sessions.openInBrowser",when:"false"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",when:"false"},{command:"github.copilot.cloud.sessions.installPRExtension",when:"false"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"false"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply",when:"false"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",when:"false"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync",when:"false"},{command:"github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR",when:"false"},{command:"github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR",when:"false"},{command:"github.copilot.chat.checkoutPullRequestReroute",when:"false"},{command:"github.copilot.chat.cloudSessions.openRepository",when:"false"},{command:"github.copilot.chat.cloudSessions.createPullRequestForTask",when:"false"},{command:"github.copilot.chat.cloudSessions.openPullRequestForTask",when:"false"},{command:"github.copilot.nes.captureExpected.start",when:"github.copilot.inlineEditsEnabled"},{command:"github.copilot.nes.captureExpected.submit",when:"github.copilot.inlineEditsEnabled"},{command:"github.copilot.sessions.commit",when:"false"},{command:"github.copilot.sessions.commitAndSync",when:"false"},{command:"github.copilot.sessions.sync",when:"false"},{command:"github.copilot.sessions.discardChanges",when:"false"},{command:"github.copilot.sessions.refreshChanges",when:"false"},{command:"github.copilot.sessions.initializeRepository",when:"false"},{command:"github.copilot.claude.sessions.commit",when:"false"},{command:"github.copilot.claude.sessions.commitAndSync",when:"false"},{command:"github.copilot.claude.sessions.sync",when:"false"},{command:"github.copilot.claude.sessions.initializeRepository",when:"false"}],"view/title":[{submenu:"github.copilot.chat.debug.filter",when:"view == copilot-chat",group:"navigation"},{command:"github.copilot.chat.debug.exportAllPromptLogsAsJson",when:"view == copilot-chat",group:"export@1"},{command:"workbench.action.chat.openAgentDebugPanel",when:"view == copilot-chat",group:"3_show@0"},{command:"github.copilot.debug.showOutputChannel",when:"view == copilot-chat",group:"3_show@1"},{command:"github.copilot.debug.showChatLogView",when:"view == workbench.panel.chat.view.copilot",group:"3_show"}],"view/item/context":[{command:"github.copilot.chat.debug.showRawRequestBody",when:"view == copilot-chat && viewItem == request",group:"export@0"},{command:"github.copilot.chat.debug.exportLogItem",when:"view == copilot-chat && (viewItem == toolcall || viewItem == request)",group:"export@1"},{command:"github.copilot.chat.debug.exportPromptArchive",when:"view == copilot-chat && viewItem == chatprompt",group:"export@2"},{command:"github.copilot.chat.debug.exportPromptLogsAsJson",when:"view == copilot-chat && viewItem == chatprompt",group:"export@3"}],"searchPanel/aiResults/commands":[{command:"github.copilot.search.markHelpful",group:"inline@0",when:"aiResultsTitle && aiResultsRequested"},{command:"github.copilot.search.markUnhelpful",group:"inline@1",when:"aiResultsTitle && aiResultsRequested"},{command:"github.copilot.search.feedback",group:"inline@2",when:"aiResultsTitle && aiResultsRequested && github.copilot.debugReportFeedback"}],"comments/comment/title":[{command:"github.copilot.chat.review.markHelpful",group:"inline@0",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.markUnhelpful",group:"inline@1",when:"commentController == github-copilot-review"}],"commentsView/commentThread/context":[{command:"github.copilot.chat.review.apply",group:"context@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discard",group:"context@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discardAll",group:"context@3",when:"commentController == github-copilot-review"}],"comments/commentThread/additionalActions":[{submenu:"copilot/reviewComment/additionalActions/applyAndNext",group:"inline@1",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments > 1"},{command:"github.copilot.chat.review.apply",group:"inline@1",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"},{submenu:"copilot/reviewComment/additionalActions/discardAndNext",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments > 1"},{submenu:"copilot/reviewComment/additionalActions/discard",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"}],"copilot/reviewComment/additionalActions/applyAndNext":[{command:"github.copilot.chat.review.applyAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.apply",group:"inline@2",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discardAndNext":[{command:"github.copilot.chat.review.discardAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discard":[{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"comments/commentThread/title":[{command:"github.copilot.chat.review.previous",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.next",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInChat",group:"inline@3",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discardAll",group:"inline@4",when:"commentController == github-copilot-review"}],"scm/title":[{command:"github.copilot.chat.review.changes",group:"navigation",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmProviderRootUri in github.copilot.chat.reviewDiff.enabledRootUris"}],"scm/sourceControl":[{command:"github.copilot.cli.openInCopilotCLI",group:"3_worktree@1",when:"scmProvider == git"}],"scm/resourceGroup/context":[{command:"github.copilot.chat.review.stagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index",group:"inline@-3"},{command:"github.copilot.chat.review.unstagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree",group:"inline@-3"}],"scm/resourceState/context":[{command:"github.copilot.git.resolveMergeConflicts",when:"scmProvider == git && scmResourceGroup == merge && git.activeResourceHasMergeConflicts",group:"z_chat@1"},{command:"github.copilot.chat.review.stagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index"},{command:"github.copilot.chat.review.unstagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree"}],"scm/inputBox":[{command:"github.copilot.git.generateCommitMessage",when:"scmProvider == git && chatSetupCompleted"}],"testing/message/context":[{command:"github.copilot.tests.fixTestFailure",when:"testing.testItemHasUri",group:"inline@1"}],"issue/reporter":[{command:"github.copilot.report"}],"github.copilot.chat.debug.filter":[{command:"github.copilot.chat.debug.showElements",when:"github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.hideElements",when:"!github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.showTools",when:"github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.hideTools",when:"!github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.showNesRequests",when:"github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.hideNesRequests",when:"!github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.showGhostRequests",when:"github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"},{command:"github.copilot.chat.debug.hideGhostRequests",when:"!github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"}],"notebook/toolbar":[{command:"github.copilot.chat.notebook.enableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && !github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"}],"editor/content":[{command:"github.copilot.git.resolveMergeConflicts",group:"z_chat@1",when:"config.git.enabled && !git.missing && !isInDiffEditor && !isMergeEditor && resource in git.mergeChanges && git.activeResourceHasMergeConflicts && chatSetupCompleted"}],"multiDiffEditor/content":[{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"resourceScheme == copilotcli-worktree-changes && workbenchState != empty && !isSessionsWindow"}],"chat/chatSessions":[{command:"github.copilot.claude.sessions.rename",when:"chatSessionType == claude-code",group:"1_edit@4"},{command:"github.copilot.cli.sessions.delete",when:"chatSessionType == copilotcli",group:"1_edit@10"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli",group:"1_edit@4"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",when:"chatSessionType == copilotcli && !isSessionsWindow",group:"2_open@1"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@2"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",when:"chatSessionType == copilotcli",group:"2_open@3"},{command:"github.copilot.cli.sessions.resumeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@4"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"chatSessionType == copilotcli && workbenchState != empty && !isSessionsWindow",group:"3_apply@0"},{command:"github.copilot.cloud.sessions.openInBrowser",when:"chatSessionType == copilot-cloud-agent",group:"navigation@10"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",when:"chatSessionType == copilot-cloud-agent",group:"1_edit@10"}],"chatSessions/item/context":[{command:"github.copilot.claude.sessions.rename",when:"sessionType == claude-code && sessionProviderId == default-copilot",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"sessionType == copilotcli && sessionProviderId == default-copilot",group:"1_edit@4"}],"chat/multiDiff/context":[{command:"github.copilot.cloud.sessions.installPRExtension",when:"chatSessionType == copilot-cloud-agent && !github.copilot.prExtensionInstalled",group:"inline@1"}],"chat/input/editing/sessionTitleToolbar":[{command:"github.copilot.sessions.refreshChanges",when:"sessionType == copilotcli && isSessionsWindow && !sessions.isAgentHostSession",group:"9_refresh@1"}],"chat/customizations/create":[{command:"copilot.claude.agents",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == agents",group:"navigation@1"},{command:"copilot.claude.hooks",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == hooks",group:"navigation@1"},{command:"copilot.claude.memory",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == instructions",group:"navigation@1"}]},icons:{"copilot-logo":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0041"}},"copilot-warning":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0042"}},"copilot-notconnected":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0043"}}},iconFonts:[{id:"copilot-font",src:[{path:"assets/copilot.woff",format:"woff"}]}],terminalQuickFixes:[{id:"copilot-chat.fixWithCopilot",commandLineMatcher:".+",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0},kind:"explain"},{id:"copilot-chat.generateCommitMessage",commandLineMatcher:"git add .+",commandExitResult:"success",kind:"explain",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0}},{id:"copilot-chat.terminalToDebugging",commandLineMatcher:".+",kind:"explain",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}},{id:"copilot-chat.terminalToDebuggingSuccess",commandLineMatcher:".+",kind:"explain",commandExitResult:"success",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}}],languages:[{id:"ignore",filenamePatterns:[".copilotignore"],aliases:[]},{id:"markdown",extensions:[".copilotmd"]}],views:{"copilot-chat":[{id:"copilot-chat",name:"Chat Debug",icon:"assets/debug-icon.svg",when:"github.copilot.chat.showLogView"}],"context-inspector":[{id:"context-inspector",name:"Language Context Inspector",icon:"$(inspect)",when:"github.copilot.chat.showContextInspectorView"}]},viewsContainers:{activitybar:[{id:"copilot-chat",title:"Chat Debug",icon:"assets/debug-icon.svg"},{id:"context-inspector",title:"Language Context Inspector",icon:"$(inspect)"}]},configurationDefaults:{"workbench.editorAssociations":{"*.copilotmd":"vscode.markdown.preview.editor"}},keybindings:[{command:"github.copilot.chat.copilotCLI.addFileReference",key:"ctrl+shift+.",mac:"cmd+shift+.",when:"github.copilot.chat.copilotCLI.hasSession && editorTextFocus"},{command:"github.copilot.chat.rerunWithCopilotDebug",key:"ctrl+alt+.",mac:"cmd+alt+.",when:"github.copilot-chat.activated && terminalShellIntegrationEnabled && terminalFocus && !terminalAltBufferActive"},{command:"github.copilot.nes.captureExpected.confirm",key:"ctrl+enter",mac:"cmd+enter",when:"copilotNesCaptureMode && editorTextFocus"},{command:"github.copilot.nes.captureExpected.abort",key:"escape",when:"copilotNesCaptureMode && editorTextFocus"}],walkthroughs:[{id:"copilotWelcome",title:"%github.copilot.walkthrough.title%",description:"%github.copilot.walkthrough.description%",when:"!isWeb",steps:[{id:"copilot.setup.signIn",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.signIn.description%",when:"chatEntitlementSignedOut && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signInNoAction",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatEntitlementSignedOut && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUp",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.signUp.description%",when:"chatPlanCanSignUp && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUpNoAction",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatPlanCanSignUp && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.panelChat",title:"%github.copilot.walkthrough.panelChat.title%",description:"%github.copilot.walkthrough.panelChat.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.edits",title:"%github.copilot.walkthrough.edits.title%",description:"%github.copilot.walkthrough.edits.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hclight.mp4"},altText:"%github.copilot.walkthrough.edits.media.altText%"}},{id:"copilot.firstSuggest",title:"%github.copilot.walkthrough.firstSuggest.title%",description:"%github.copilot.walkthrough.firstSuggest.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hclight.mp4"},altText:"%github.copilot.walkthrough.firstSuggest.media.altText%"}},{id:"copilot.inlineChatNotMac",title:"%github.copilot.walkthrough.inlineChatNotMac.title%",description:"%github.copilot.walkthrough.inlineChatNotMac.description%",when:"!isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatNotMac.media.altText%"}},{id:"copilot.inlineChatMac",title:"%github.copilot.walkthrough.inlineChatMac.title%",description:"%github.copilot.walkthrough.inlineChatMac.description%",when:"isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatMac.media.altText%"}},{id:"copilot.sparkle",title:"%github.copilot.walkthrough.sparkle.title%",description:"%github.copilot.walkthrough.sparkle.description%",when:"!chatEntitlementSignedOut || chatIsEnabled",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hclight.mp4"},altText:"%github.copilot.walkthrough.sparkle.media.altText%"}}]}],jsonValidation:[{fileMatch:"settings.json",url:"ccsettings://root/schema.json"}],typescriptServerPlugins:[{name:"@vscode/copilot-typescript-server-plugin",enableForWorkspaceTypeScriptVersions:!0}],chatSessions:[{type:"claude-code",name:"claude",displayName:"Claude",icon:"$(claude)",welcomeTitle:"Claude Agent",welcomeMessage:"Powered by the same agent as Claude Code",inputPlaceholder:"Run local tasks with Claude, type `#` for adding context",order:3,description:"%github.copilot.session.providerDescription.claude%",when:"config.github.copilot.chat.claudeAgent.enabled && ((isSessionsWindow && !config.chat.agents.claude.preferAgentHost) || (!isSessionsWindow && !config.chat.editor.claude.preferAgentHost))",canDelegate:!0,requiresCustomModels:!0,supportsAutoModel:!1,requiresCopilotSignIn:!0,capabilities:{supportsFileAttachments:!0,supportsImageAttachments:!0},commands:[{name:"init",description:"Initialize a new CLAUDE.md file with codebase documentation"},{name:"pr-comments",description:"Get comments from a GitHub pull request"},{name:"review",description:"Review a pull request"},{name:"security-review",description:"Complete a security review of the pending changes on the current branch"},{name:"simplify",description:"Review changed code for reuse, quality, and efficiency"},{name:"claude-api",description:"Help building with Claude API or Anthropic SDK"},{name:"agents",description:"Create and manage specialized Claude agents"},{name:"hooks",description:"Configure Claude Code hooks for tool execution and events"},{name:"memory",description:"Open memory files (CLAUDE.md) for editing"},{name:"compact",description:"Compact the conversation history to save context tokens"}]},{type:"copilotcli",name:"cli",displayName:"Copilot CLI",icon:"$(copilot)",welcomeTitle:"Copilot CLI",welcomeMessage:"Run tasks in the background with the Copilot CLI",inputPlaceholder:"Run tasks in the background with the Copilot CLI, type `#` for adding context",order:1,canDelegate:!0,description:"%github.copilot.session.providerDescription.background%",when:"config.github.copilot.chat.backgroundAgent.enabled",supportsAutoModel:!0,requiresCopilotSignIn:!0,capabilities:{supportsFileAttachments:!0,supportsProblemAttachments:!0,supportsToolAttachments:!1,supportsImageAttachments:!0,supportsSymbolAttachments:!0,supportsSearchResultAttachments:!0,supportsSourceControlAttachments:!0,supportsPromptAttachments:!0,supportsHandOffs:!0},commands:[{name:"delegate",description:"Delegate chat session to cloud agent and create associated PR",when:"config.github.copilot.chat.cloudAgent.enabled"},{name:"compact",description:"%github.copilot.command.cli.compact.description%"},{name:"plan",description:"%github.copilot.command.cli.plan.description%",when:"config.github.copilot.chat.cli.planCommand.enabled"},{name:"fleet",description:"%github.copilot.command.cli.fleet.description%",when:"false"},{name:"remote",description:"%github.copilot.command.cli.remote.description%",when:"config.github.copilot.chat.cli.remote.enabled"}],customAgentTarget:"github-copilot",requiresCustomModels:!0,autoAttachReferences:!0,useRequestToPopulateBuiltInPickers:!0},{type:"copilot-cloud-agent",alternativeIds:["copilot-swe-agent"],name:"cloud",displayName:"Cloud",icon:"$(cloud)",welcomeTitle:"Cloud Agent",welcomeMessage:"Delegate tasks to the cloud",inputPlaceholder:"Delegate tasks to the cloud, type `#` for adding context",order:2,canDelegate:!0,description:"%github.copilot.session.providerDescription.cloud%",when:"config.github.copilot.chat.cloudAgent.enabled",supportsAutoModel:!1,requiresCopilotSignIn:!0,capabilities:{supportsFileAttachments:!0},autoAttachReferences:!0}],chatAgents:[],chatPromptFiles:[{path:"./assets/prompts/plan.prompt.md",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-standup.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-cost-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-improve.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-reindex.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-search.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],chatSkills:[{path:"./assets/prompts/skills/project-setup-info-local/SKILL.md",when:"!config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/project-setup-info-context7/SKILL.md",when:"config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/install-vscode-extension/SKILL.md",when:"config.github.copilot.chat.installExtensionSkill.enabled && config.github.copilot.chat.newWorkspaceCreation.enabled",sessionTypes:["local"]},{path:"./assets/prompts/skills/get-search-view-results/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/troubleshoot/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/agent-customization/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/init/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-prompt/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-instructions/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-skill/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-agent/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-hook/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/chronicle/SKILL.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],terminal:{profiles:[{icon:"copilot",id:"copilot-cli",title:"GitHub Copilot CLI",titleTemplate:"${sequence}"}]}},prettier:{useTabs:!0,tabWidth:4,singleQuote:!0},scripts:{postinstall:"tsx ./script/postinstall.ts",build:"node .esbuild.mts --sourcemaps",compile:"node .esbuild.mts --dev",watch:"npm-run-all -lp watch:esbuild watch:typecheck","watch:esbuild":"node .esbuild.mts --watch --dev","watch:typecheck":"npx tsgo --noEmit --watch --preserveWatchOutput --project tsconfig.json","watch:typecheck-extension":"npx tsgo --noEmit --watch --project tsconfig.json","watch:typecheck-extension-web":"npx tsgo --noEmit --watch --project tsconfig.worker.json","watch:typecheck-simulation-workbench":"npx tsgo --noEmit --watch --project test/simulation/workbench/tsconfig.json",typecheck:"npx tsgo --noEmit --project tsconfig.json && npx tsgo --noEmit --project test/simulation/workbench/tsconfig.json && npx tsgo --noEmit --project tsconfig.worker.json && npx tsgo --noEmit --project src/extension/completions-core/vscode-node/extension/src/copilotPanel/webView/tsconfig.json",lint:"npx eslint . --max-warnings=0","lint-staged":"npx eslint --max-warnings=0",tsfmt:"npx tsfmt -r --verify",test:"npm-run-all test:*","test:extension":"vscode-test","test:sanity":"vscode-test --sanity","test:unit":"vitest --run --pool=forks",vitest:"vitest",bench:"vitest bench",get_env:"tsx script/setup/getEnv.mts",get_token:"tsx script/setup/getToken.mts",prettier:"prettier --list-different --write --cache .",simulate:"node dist/simulationMain.js","simulate-require-cache":"node dist/simulationMain.js --require-cache","simulate-ci":"node dist/simulationMain.js --ci --require-cache","simulate-update-baseline":"node dist/simulationMain.js --update-baseline","simulate-gc":"node dist/simulationMain.js --require-cache --gc",setup:"npm run get_env && npm run get_token","setup:dotnet":"run-script-os","setup:dotnet:darwin:linux":"curl -O https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.sh && chmod u+x dotnet-install.sh && ./dotnet-install.sh --channel 10.0 && rm dotnet-install.sh","setup:dotnet:win32":'powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.ps1 -OutFile dotnet-install.ps1; ./dotnet-install.ps1 -channel 10.0; Remove-Item dotnet-install.ps1"',"analyze-edits":"tsx script/analyzeEdits.ts","extract-chat-lib":"tsx script/build/extractChatLib.ts",create_venv:"tsx script/setup/createVenv.mts",package:"vsce package",web:"vscode-test-web --headless --extensionDevelopmentPath=. .","test:prompt":'mocha "src/extension/completions-core/vscode-node/prompt/**/test/**/*.test.{ts,tsx}"',"test:completions-core":"tsx src/extension/completions-core/vscode-node/extension/test/runTest.ts"},devDependencies:{"@azure/identity":"4.9.1","@azure/keyvault-secrets":"^4.10.0","@azure/msal-node":"^3.6.3","@c4312/scip":"^0.1.0","@fluentui/react-components":"^9.66.6","@fluentui/react-icons":"^2.0.305","@hediet/node-reload":"^0.8.0","@octokit/types":"^14.1.0","@stylistic/eslint-plugin":"^3.0.1","@types/eslint":"^9.0.0","@types/express":"^5.0.6","@types/google-protobuf":"^3.15.12","@types/js-yaml":"^4.0.9","@types/markdown-it":"^14.0.0","@types/minimist":"^1.2.5","@types/mocha":"^10.0.10","@types/node":"^22.16.3","@types/picomatch":"^4.0.0","@types/react":"17.0.44","@types/react-dom":"^18.2.17","@types/sinon":"^17.0.4","@types/source-map-support":"^0.5.10","@types/tar":"^6.1.13","@types/vinyl":"^2.0.12","@types/vscode-webview":"^1.57.5","@types/ws":"^8.5.3","@types/yargs":"^17.0.24","@typescript-eslint/eslint-plugin":"^8.35.0","@typescript-eslint/parser":"^8.32.0","@typescript-eslint/typescript-estree":"^8.26.1","@typescript/native-preview":"^7.0.0-dev.20260429","@vitest/coverage-v8":"^4.1.8","@vitest/snapshot":"^1.5.0","@vscode/debugadapter":"^1.68.0","@vscode/debugprotocol":"^1.68.0","@vscode/dts":"^0.4.1","@vscode/lsif-language-service":"^0.1.0-pre.4","@vscode/test-cli":"^0.0.11","@vscode/test-electron":"^2.5.2","@vscode/test-web":"^0.0.81","@vscode/vsce":"3.6.0",copyfiles:"^2.4.1","csv-parse":"^6.0.0",dotenv:"^17.2.0",electron:"^42.5.0",esbuild:"0.28.1",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.3.0",minimist:"^1.2.8",mobx:"^6.13.7","mobx-react-lite":"^4.1.0",mocha:"^11.7.1","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","monaco-editor":"0.44.0","npm-run-all":"^4.1.5",open:"^10.1.2",openai:"^6.7.0",outdent:"^0.8.0",picomatch:"^4.0.4",playwright:"^1.61.1",prettier:"^3.6.2",react:"^17.0.2","react-dom":"17.0.2",rimraf:"^6.0.1","run-script-os":"^1.1.6",shiki:"~1.15.0",sinon:"^21.0.0","source-map-support":"^0.5.21",tar:"^7.5.16","ts-dedent":"^2.2.0",tsx:"^4.22.4",typescript:"^5.8.3","vite-plugin-wasm":"^3.6.0",vitest:"^4.1.8","vscode-languageserver-protocol":"^3.17.5","vscode-languageserver-textdocument":"^1.0.12","vscode-languageserver-types":"^3.17.5",yaml:"^2.8.0",yargs:"^17.7.2",zod:"3.25.76"},dependencies:{"@anthropic-ai/claude-agent-sdk":"0.2.112","@anthropic-ai/sdk":"^0.82.0","@github/blackbird-external-ingest-utils":"^0.3.0","@github/copilot":"^1.0.70-0","@google/genai":"^1.22.0","@humanwhocodes/gitignore-to-minimatch":"1.0.2","@microsoft/tiktokenizer":"^1.0.10","@modelcontextprotocol/sdk":"^1.25.2","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.212.0","@opentelemetry/exporter-logs-otlp-grpc":"^0.219.0","@opentelemetry/exporter-logs-otlp-http":"^0.219.0","@opentelemetry/exporter-logs-otlp-proto":"^0.219.0","@opentelemetry/exporter-metrics-otlp-grpc":"^0.219.0","@opentelemetry/exporter-metrics-otlp-http":"^0.219.0","@opentelemetry/exporter-metrics-otlp-proto":"^0.219.0","@opentelemetry/exporter-trace-otlp-grpc":"^0.219.0","@opentelemetry/exporter-trace-otlp-http":"^0.219.0","@opentelemetry/exporter-trace-otlp-proto":"^0.219.0","@opentelemetry/resources":"^2.5.1","@opentelemetry/sdk-logs":"^0.212.0","@opentelemetry/sdk-metrics":"^2.5.1","@opentelemetry/sdk-trace-node":"^2.5.1","@opentelemetry/semantic-conventions":"^1.39.0","@sinclair/typebox":"^0.34.41","@vscode/copilot-api":"^0.4.3","@vscode/extension-telemetry":"^1.5.1","@vscode/l10n":"^0.0.18","@vscode/prompt-tsx":"^0.4.0-alpha.8","@vscode/tree-sitter-wasm":"0.0.5-php.2","@vscode/webview-ui-toolkit":"^1.3.1","@xterm/headless":"^5.5.0",ajv:"^8.18.0",applicationinsights:"^2.9.7","best-effort-json-parser":"^1.2.1",diff:"^8.0.3",express:"^5.2.1",ignore:"^7.0.5",isbinaryfile:"^5.0.4","jsonc-parser":"^3.3.1","lru-cache":"^11.1.0","markdown-it":"^14.2.0",minimatch:"^10.2.1",undici:"^7.24.1","vscode-tas-client":"^0.1.84","web-tree-sitter":"^0.23.0"},overrides:{string_decoder:"npm:string_decoder@1.2.0",yauzl:"^3.3.1",zod:"3.25.76"},vscodeCommit:"94c8e2adc50e26ef70af85a0de3a9efed757acaa",__metadata:{id:"7ec7d6e6-b89e-4cc5-a59b-d6c4d238246f",publisherId:{publisherId:"7c1c19cd-78eb-4dfb-8999-99caf7679002",publisherName:"github",displayName:"GitHub",flags:"verified"},publisherDisplayName:"GitHub"},allowScripts:{"esbuild@0.28.1":!0,"keytar@7.9.0":!0,"@playwright/browser-chromium@1.61.1":!0,"@vscode/vsce-sign@2.0.5":!0,protobufjs:!1,"fsevents@2.3.3":!0,"fsevents@2.3.2":!0}}});var K4e=I(gS=>{"use strict";p();Object.defineProperty(gS,"__esModule",{value:!0});gS.vscodeEngineVersion=gS.isPreRelease=gS.isProduction=gS.packageJson=void 0;gS.packageJson=W2i();gS.isProduction=gS.packageJson.buildType!=="dev";gS.isPreRelease=gS.packageJson.isPreRelease||!gS.isProduction;gS.vscodeEngineVersion=gS.packageJson.engines.vscode});var FD=I(Gv=>{"use strict";p();Object.defineProperty(Gv,"__esModule",{value:!0});Gv.isScenarioAutomation=Gv.AbstractEnvService=Gv.INativeEnvService=Gv.IEnvService=Gv.NameAndVersion=Gv.OperatingSystem=void 0;Gv.getEditorVersionHeaders=CLa;var Y2i=an(),K2i=BRe(),KAe=K4e(),z2i;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(z2i||(Gv.OperatingSystem=z2i={}));var hTr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};Gv.NameAndVersion=hTr;Gv.IEnvService=(0,Y2i.createServiceIdentifier)("IEnvService");Gv.INativeEnvService=(0,Y2i.createServiceIdentifier)("INativeEnvService");var mTr=class{static{a(this,"AbstractEnvService")}isProduction(){return KAe.isProduction}isPreRelease(){return KAe.isPreRelease}isSimulation(){return K2i.env.SIMULATION==="1"}getBuildType(){return KAe.packageJson.buildType}getVersion(){return KAe.packageJson.version}getBuild(){return KAe.packageJson.build}getName(){return KAe.packageJson.name}};Gv.AbstractEnvService=mTr;function CLa(t){return{"Editor-Version":t.getEditorInfo().format(),"Editor-Plugin-Version":t.getEditorPluginInfo().format()}}a(CLa,"getEditorVersionHeaders");Gv.isScenarioAutomation=K2i.env.IS_SCENARIO_AUTOMATION==="1"});var Lg=I(dre=>{"use strict";p();Object.defineProperty(dre,"__esModule",{value:!0});dre.generateUuid=void 0;dre.isUUID=SLa;dre.prefixedUuid=TLa;var bLa=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function SLa(t){return bLa.test(t)}a(SLa,"isUUID");dre.generateUuid=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let t=new Uint8Array(16),e=[];for(let r=0;r<256;r++)e.push(r.toString(16).padStart(2,"0"));return a(function(){crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=0,o="";return o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o},"generateUuid")})();function TLa(t){return`${t}-${(0,dre.generateUuid)()}`}a(TLa,"prefixedUuid")});var J2i=I(uyt=>{"use strict";p();Object.defineProperty(uyt,"__esModule",{value:!0});uyt.CopilotConfigPrefix=void 0;uyt.CopilotConfigPrefix="github.copilot"});var ATr=I(UD=>{"use strict";p();var ILa=UD&&UD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xLa=UD&&UD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wLa=UD&&UD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o(n&&(r=r.bind(n)),t(a(c=>{let l=e(c);l!==void 0&&r(l)},"wrappedListener"),void 0,o))}a(kLa,"transformEvent")});var eE=I(jr=>{"use strict";p();Object.defineProperty(jr,"__esModule",{value:!0});jr.apiVersion=jr.ICompletionsEditorAndPluginInfo=jr.BuildInfo=jr.InMemoryConfigProvider=jr.DefaultsOnlyConfigProvider=jr.ConfigProvider=jr.ICompletionsConfigProvider=jr.BuildType=jr.BlockMode=jr.userScopeOnlyKeys=jr.ConfigKey=jr.packageJson=void 0;jr.shouldDoServerTrimming=NLa;jr.getConfigKeyRecursively=MLa;jr.getConfigDefaultForKey=X2i;jr.getOptionalConfigDefaultForKey=eDi;jr.getConfig=OLa;jr.dumpForTelemetry=LLa;jr.formatNameAndVersion=vTr;jr.editorVersionHeaders=BLa;var dyt=K4e();Object.defineProperty(jr,"packageJson",{enumerable:!0,get:a(function(){return dyt.packageJson},"get")});var Z2i=an(),PLa=J2i(),DLa=ATr();jr.ConfigKey={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",UseSplitContextPrompt:"internal.useSplitContextPrompt"};jr.userScopeOnlyKeys=new Set([jr.ConfigKey.DebugOverrideCapiUrl,jr.ConfigKey.DebugOverrideCapiUrlLegacy,jr.ConfigKey.DebugTestOverrideCapiUrl,jr.ConfigKey.DebugTestOverrideCapiUrlLegacy,jr.ConfigKey.DebugOverrideProxyUrl,jr.ConfigKey.DebugOverrideProxyUrlLegacy,jr.ConfigKey.DebugTestOverrideProxyUrl,jr.ConfigKey.DebugTestOverrideProxyUrlLegacy]);var fyt;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(fyt||(jr.BlockMode=fyt={}));function NLa(t){return[fyt.Server,fyt.ParsingAndServer].includes(t)}a(NLa,"shouldDoServerTrimming");var fre;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(fre||(jr.BuildType=fre={}));jr.ICompletionsConfigProvider=(0,Z2i.createServiceIdentifier)("ICompletionsConfigProvider");var J4e=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};jr.ConfigProvider=J4e;var yTr=class extends J4e{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return X2i(e)}getOptionalConfig(e){return eDi(e)}dumpForTelemetry(){return{}}};jr.DefaultsOnlyConfigProvider=yTr;var _Tr=class extends J4e{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new DLa.Emitter,this.onDidChangeCopilotSettings=this.copilotEmitter.event,this.overrides=new Map}setOverrides(e){this.overrides=e}clearOverrides(){this.overrides.clear()}getOptionalOverride(e){return this.overrides.get(e)}getConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getConfig(e)}getOptionalConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getOptionalConfig(e)}setConfig(e,r){this.setCopilotSettings({[e]:r})}setCopilotSettings(e){for(let[r,n]of Object.entries(e))n!==void 0?this.overrides.set(r,n):this.overrides.delete(r);this.copilotEmitter.fire(this)}dumpForTelemetry(){let e=this.baseConfigProvider.dumpForTelemetry();for(let r of[jr.ConfigKey.ShowEditorCompletions,jr.ConfigKey.EnableAutoCompletions,jr.ConfigKey.DelayCompletions,jr.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};jr.InMemoryConfigProvider=_Tr;function MLa(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(MLa,"getConfigKeyRecursively");function X2i(t){if(ETr.has(t))return ETr.get(t);throw new Error(`Missing config default value: ${PLa.CopilotConfigPrefix}.${t}`)}a(X2i,"getConfigDefaultForKey");function eDi(t){return ETr.get(t)}a(eDi,"getOptionalConfigDefaultForKey");var ETr=new Map([[jr.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[jr.ConfigKey.RelatedFilesVSCodeCSharp,!1],[jr.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[jr.ConfigKey.RelatedFilesVSCode,!1],[jr.ConfigKey.IncludeNeighboringFiles,!1],[jr.ConfigKey.ExcludeRelatedFiles,!1],[jr.ConfigKey.ContextProviders,[]],[jr.ConfigKey.DebugSnippyOverrideUrl,""],[jr.ConfigKey.UseSubsetMatching,null],[jr.ConfigKey.ContextProviderTimeBudget,void 0],[jr.ConfigKey.DebugOverrideCapiUrl,""],[jr.ConfigKey.DebugTestOverrideCapiUrl,""],[jr.ConfigKey.DebugOverrideProxyUrl,""],[jr.ConfigKey.DebugTestOverrideProxyUrl,""],[jr.ConfigKey.DebugOverrideEngine,""],[jr.ConfigKey.AlwaysRequestMultiline,void 0],[jr.ConfigKey.CompletionsDebounce,void 0],[jr.ConfigKey.CompletionsDelay,void 0],[jr.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[jr.ConfigKey.UseWorkspaceContextCoordinator,void 0],[jr.ConfigKey.ShowEditorCompletions,void 0],[jr.ConfigKey.EnableAutoCompletions,void 0],[jr.ConfigKey.DelayCompletions,void 0],[jr.ConfigKey.FilterCompletions,void 0],[jr.ConfigKey.UseSplitContextPrompt,!0],[jr.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[jr.ConfigKey.UserSelectedCompletionModel,""],[jr.ConfigKey.DebugOverrideEngineLegacy,""],[jr.ConfigKey.DebugOverrideProxyUrlLegacy,""],[jr.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[jr.ConfigKey.DebugOverrideCapiUrlLegacy,""],[jr.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[jr.ConfigKey.DebugFilterLogCategories,[]]]);function OLa(t,e){return t.get(jr.ICompletionsConfigProvider).getConfig(e)}a(OLa,"getConfig");function LLa(t){try{return t.get(jr.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(LLa,"dumpForTelemetry");var pyt=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===fre.NIGHTLY}static isProduction(){return this.getBuildType()!==fre.DEV}static getBuildType(){return dyt.packageJson.buildType==="prod"?t.getVersion().length===15?fre.NIGHTLY:fre.PROD:fre.DEV}static getVersion(){return dyt.packageJson.version}static getBuild(){return dyt.packageJson.build}};jr.BuildInfo=pyt;function vTr({name:t,version:e}){return`${t}/${e}`}a(vTr,"formatNameAndVersion");jr.ICompletionsEditorAndPluginInfo=(0,Z2i.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");jr.apiVersion="2025-05-01";function BLa(t){let e=t.get(jr.ICompletionsEditorAndPluginInfo);return{"Editor-Version":vTr(e.getEditorInfo()),"Editor-Plugin-Version":vTr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":pyt.getVersion()}}a(BLa,"editorVersionHeaders")});var CTr=I(hyt=>{"use strict";p();Object.defineProperty(hyt,"__esModule",{value:!0});hyt.ExpServiceTelemetryNames=void 0;var tDi;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(tDi||(hyt.ExpServiceTelemetryNames=tDi={}))});var myt=I(JAe=>{"use strict";p();Object.defineProperty(JAe,"__esModule",{value:!0});JAe.ExpConfig=JAe.ExpTreatmentVariables=void 0;var FLa=nA(),ULa=CTr(),rDi;(function(t){t.CustomEngine="copilotcustomengine",t.CustomEngineTargetEngine="copilotcustomenginetargetengine",t.OverrideBlockMode="copilotoverrideblockmode",t.SuffixPercent="CopilotSuffixPercent",t.CppHeadersEnableSwitch="copilotcppheadersenableswitch",t.UseSubsetMatching="copilotsubsetmatching",t.SuffixMatchThreshold="copilotsuffixmatchthreshold",t.MaxPromptCompletionTokens="maxpromptcompletionTokens",t.StableContextPercent="copilotstablecontextpercent",t.VolatileContextPercent="copilotvolatilecontextpercent",t.RelatedFilesVSCodeCSharp="copilotrelatedfilesvscodecsharp",t.RelatedFilesVSCodeTypeScript="copilotrelatedfilesvscodetypescript",t.RelatedFilesVSCode="copilotrelatedfilesvscode",t.ContextProviders="copilotcontextproviders",t.IncludeNeighboringFiles="copilotincludeneighboringfiles",t.ExcludeRelatedFiles="copilotexcluderelatedfiles",t.ContextProviderTimeBudget="copilotcontextprovidertimebudget",t.CppContextProviderParams="copilotcppContextProviderParams",t.CSharpContextProviderParams="copilotcsharpcontextproviderparams",t.JavaContextProviderParams="copilotjavacontextproviderparams",t.MultiLanguageContextProviderParams="copilotmultilanguagecontextproviderparams",t.TsContextProviderParams="copilottscontextproviderparams",t.CompletionsDebounce="copilotcompletionsdebounce",t.ElectronFetcher="copilotelectronfetcher",t.FetchFetcher="copilotfetchfetcher",t.AsyncCompletionsTimeout="copilotasynccompletionstimeout",t.EnablePromptContextProxyField="copilotenablepromptcontextproxyfield",t.ProgressiveReveal="copilotprogressivereveal",t.ModelAlwaysTerminatesSingleline="copilotmodelterminatesingleline",t.ProgressiveRevealLongLookaheadSize="copilotprogressivereveallonglookaheadsize",t.ProgressiveRevealShortLookaheadSize="copilotprogressiverevealshortlookaheadsize",t.MaxMultilineTokens="copilotmaxmultilinetokens",t.MultilineAfterAcceptLines="copilotmultilineafteracceptlines",t.CompletionsDelay="copilotcompletionsdelay",t.SingleLineUnlessAccepted="copilotsinglelineunlessaccepted"})(rDi||(JAe.ExpTreatmentVariables=rDi={}));var bTr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,FLa.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[ULa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};JAe.ExpConfig=bTr});var xy=I(gyt=>{"use strict";p();Object.defineProperty(gyt,"__esModule",{value:!0});gyt.ICompletionsFeaturesService=void 0;var QLa=an();gyt.ICompletionsFeaturesService=(0,QLa.createServiceIdentifier)("ICompletionsFeaturesService")});var Ayt=I(I$=>{"use strict";p();Object.defineProperty(I$,"__esModule",{value:!0});I$.FilterSettings=I$.Release=I$.Filter=void 0;var pre;(function(t){t.ExtensionRelease="X-VSCode-ExtensionRelease",t.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",t.CopilotEngine="X-Copilot-Engine",t.CopilotOverrideEngine="X-Copilot-OverrideEngine",t.CopilotRepository="X-Copilot-Repository",t.CopilotFileType="X-Copilot-FileType",t.CopilotUserKind="X-Copilot-UserKind",t.CopilotDogfood="X-Copilot-Dogfood",t.CopilotCustomModel="X-Copilot-CustomModel",t.CopilotOrgs="X-Copilot-Orgs",t.CopilotCustomModelNames="X-Copilot-CustomModelNames",t.CopilotTrackingId="X-Copilot-CopilotTrackingId",t.CopilotClientVersion="X-Copilot-ClientVersion",t.CopilotRelatedPluginVersionCppTools="X-Copilot-RelatedPluginVersion-msvscodecpptools",t.CopilotRelatedPluginVersionCMakeTools="X-Copilot-RelatedPluginVersion-msvscodecmaketools",t.CopilotRelatedPluginVersionMakefileTools="X-Copilot-RelatedPluginVersion-msvscodemakefiletools",t.CopilotRelatedPluginVersionCSharpDevKit="X-Copilot-RelatedPluginVersion-msdotnettoolscsdevkit",t.CopilotRelatedPluginVersionPython="X-Copilot-RelatedPluginVersion-mspythonpython",t.CopilotRelatedPluginVersionPylance="X-Copilot-RelatedPluginVersion-mspythonvscodepylance",t.CopilotRelatedPluginVersionJavaPack="X-Copilot-RelatedPluginVersion-vscjavavscodejavapack",t.CopilotRelatedPluginVersionJavaManager="X-Copilot-RelatedPluginVersion-vscjavavscodejavadependency",t.CopilotRelatedPluginVersionTypescript="X-Copilot-RelatedPluginVersion-vscodetypescriptlanguagefeatures",t.CopilotRelatedPluginVersionTypescriptNext="X-Copilot-RelatedPluginVersion-msvscodevscodetypescriptnext",t.CopilotRelatedPluginVersionCSharp="X-Copilot-RelatedPluginVersion-msdotnettoolscsharp",t.CopilotRelatedPluginVersionGithubCopilotChat="X-Copilot-RelatedPluginVersion-githubcopilotchat",t.CopilotRelatedPluginVersionGithubCopilot="X-Copilot-RelatedPluginVersion-githubcopilot"})(pre||(I$.Filter=pre={}));var nDi;(function(t){t.Stable="stable",t.Nightly="nightly"})(nDi||(I$.Release=nDi={}));var qLa={[pre.CopilotClientTimeBucket]:"timeBucket",[pre.CopilotOverrideEngine]:"engine",[pre.CopilotRepository]:"repo",[pre.CopilotFileType]:"fileType",[pre.CopilotUserKind]:"userKind"},STr=class{static{a(this,"FilterSettings")}constructor(e){this.filters=e;for(let[r,n]of Object.entries(this.filters))n===""&&delete this.filters[r]}addToTelemetry(e){for(let[r,n]of Object.entries(this.filters)){let o=qLa[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};I$.FilterSettings=STr});var sDi=I(ZAe=>{"use strict";p();Object.defineProperty(ZAe,"__esModule",{value:!0});ZAe.JointCompletionsProviderTriggerChangeStrategy=ZAe.JointCompletionsProviderStrategy=void 0;var iDi;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(iDi||(ZAe.JointCompletionsProviderStrategy=iDi={}));var oDi;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(oDi||(ZAe.JointCompletionsProviderTriggerChangeStrategy=oDi={}))});var x$=I(Bg=>{"use strict";p();Object.defineProperty(Bg,"__esModule",{value:!0});Bg.vString=HLa;Bg.vNumber=$La;Bg.vBoolean=WLa;Bg.vObjAny=YLa;Bg.vUndefined=JLa;Bg.vNull=ZLa;Bg.vNullable=XLa;Bg.vUnchecked=cDi;Bg.vUnknown=eBa;Bg.vRequired=tBa;Bg.vObj=rBa;Bg.vArray=nBa;Bg.vTuple=iBa;Bg.vUnion=lDi;Bg.vEnum=oBa;Bg.vLiteral=sBa;Bg.vLazy=aBa;var hre=class{static{a(this,"TypeofValidator")}constructor(e){this.type=e}validate(e){return typeof e!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}:{content:e,error:void 0}}toSchema(){return{type:this.type}}},jLa=new hre("string");function HLa(){return jLa}a(HLa,"vString");var GLa=new hre("number");function $La(){return GLa}a($La,"vNumber");var VLa=new hre("boolean");function WLa(){return VLa}a(WLa,"vBoolean");var zLa=new hre("object");function YLa(){return zLa}a(YLa,"vObjAny");var KLa=new hre("undefined");function JLa(){return KLa}a(JLa,"vUndefined");var TTr=class{static{a(this,"NullValidator")}validate(e){return e!==null?{content:void 0,error:{message:`Expected null, but got ${typeof e}`}}:{content:null,error:void 0}}toSchema(){return{type:"null"}}},aDi=new TTr;function ZLa(){return aDi}a(ZLa,"vNull");function XLa(t){return lDi(t,aDi)}a(XLa,"vNullable");function cDi(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(cDi,"vUnchecked");function eBa(){return cDi()}a(eBa,"vUnknown");function tBa(t){return{validate(e){return e===void 0?{content:void 0,error:{message:"Required field is missing"}}:t.validate(e)},toSchema(){return t.toSchema()},isRequired(){return!0}}}a(tBa,"vRequired");function rBa(t){return{validate(e){if(typeof e!="object"||e===null)return{content:void 0,error:{message:"Expected object"}};let r={};for(let n in t){let o=t[n],s=e[n],c=o.isRequired?.()??!1;if(c&&s===void 0)return{content:void 0,error:{message:`Required field '${n}' is missing`}};if(!c&&s===void 0)continue;let{content:l,error:u}=o.validate(s);if(u)return{content:void 0,error:{message:`Error in property '${n}': ${u.message}`}};r[n]=l}return{content:r,error:void 0}},toSchema(){let e=[],r={};for(let[o,s]of Object.entries(t))r[o]=s.toSchema(),s.isRequired?.()&&e.push(o);return{type:"object",properties:r,...e.length>0?{required:e}:{}}}}}a(rBa,"vObj");function nBa(t){return{validate(e){if(!Array.isArray(e))return{content:void 0,error:{message:"Expected array"}};let r=[];for(let n=0;ne.toSchema())}}}}a(iBa,"vTuple");function lDi(...t){return{validate(e){let r;for(let n of t){let{content:o,error:s}=n.validate(e);if(!s)return{content:o,error:void 0};r=s}return{content:void 0,error:r}},toSchema(){return{oneOf:t.map(e=>e.toSchema())}}}}a(lDi,"vUnion");function oBa(...t){return{validate(e){return t.indexOf(e)===-1?{content:void 0,error:{message:`Expected one of: ${t.join(", ")}`}}:{content:e,error:void 0}},toSchema(){return{enum:t}}}}a(oBa,"vEnum");function sBa(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(sBa,"vLiteral");function aBa(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(aBa,"vLazy")});var uDi=I(Z4e=>{"use strict";p();Object.defineProperty(Z4e,"__esModule",{value:!0});Z4e.DocumentSwitchTriggerStrategy=void 0;var cBa=x$(),yyt;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(yyt||(Z4e.DocumentSwitchTriggerStrategy=yyt={}));(function(t){t.VALIDATOR=(0,cBa.vEnum)(t.Always,t.AfterAcceptance)})(yyt||(Z4e.DocumentSwitchTriggerStrategy=yyt={}))});var ITr=I(X4e=>{"use strict";p();Object.defineProperty(X4e,"__esModule",{value:!0});X4e.DiffHistoryMergeStrategy=void 0;var lBa=x$(),_yt;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(_yt||(X4e.DiffHistoryMergeStrategy=_yt={}));(function(t){t.VALIDATOR=(0,lBa.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(_yt||(X4e.DiffHistoryMergeStrategy=_yt={}))});var vyt=I(eLe=>{"use strict";p();Object.defineProperty(eLe,"__esModule",{value:!0});eLe.ImportChanges=void 0;var uBa=x$(),Eyt;(function(t){t.All="all",t.None="none"})(Eyt||(eLe.ImportChanges=Eyt={}));(function(t){t.VALIDATOR=(0,uBa.vEnum)(t.All,t.None)})(Eyt||(eLe.ImportChanges=Eyt={}))});var wy=I(An=>{"use strict";p();Object.defineProperty(An,"__esModule",{value:!0});An.PatchModelPrediction=An.SpeculativeRequestsAutoExpandEditWindowLines=An.SpeculativeRequestsCursorPlacement=An.DuplicateAdditionsMode=An.SpeculativeRequestsEnablement=An.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=An.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=An.MODEL_CONFIGURATION_VALIDATOR=An.LINT_OPTIONS_VALIDATOR=An.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=An.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=An.DEFAULT_OPTIONS=An.ResponseFormat=An.PromptingStrategy=An.EditIntent=An.EarlyDivergenceCancellationMode=An.AggressivenessLevel=An.AggressivenessSetting=An.LintOptionShowCode=An.LintOptionWarning=An.CurrentFileOptions=An.GlobalBudgetOptions=An.NeighborFilesOptions=An.RecentlyViewedDocumentsOptions=An.RecentFileClippingStrategy=An.IncludeLineNumbersOption=void 0;An.isPromptingStrategy=dBa;An.isAggressivenessStrategy=fBa;An.applyStrategyConfig=hBa;An.parseLintOptionString=mBa;An.parseUserHappinessScoreConfigurationString=gBa;var Cyt=xT(),hDi=pd(),Ar=x$(),xTr=vyt(),AS;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(AS||(An.IncludeLineNumbersOption=AS={}));var mre;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(mre||(An.RecentFileClippingStrategy=mre={}));(function(t){t.VALIDATOR=(0,Ar.vEnum)(t.AroundEditRange,t.Proportional)})(mre||(An.RecentFileClippingStrategy=mre={}));var wTr;(function(t){t.VALIDATOR=(0,Ar.vObj)({nDocuments:(0,Ar.vNumber)(),maxTokens:(0,Ar.vNumber)(),includeViewedFiles:(0,Ar.vBoolean)(),includeLineNumbers:(0,Ar.vEnum)(AS.WithSpaceAfter,AS.WithoutSpace,AS.None),clippingStrategy:(0,Ar.vEnum)(mre.AroundEditRange,mre.Proportional),useLeftoverBudgetFromAbove:(0,Ar.vBoolean)()})})(wTr||(An.RecentlyViewedDocumentsOptions=wTr={}));var dDi;(function(t){t.VALIDATOR=(0,Ar.vObj)({enabled:(0,Ar.vBoolean)(),maxTokens:(0,Ar.vNumber)()})})(dDi||(An.NeighborFilesOptions=dDi={}));var fDi;(function(t){t.DEFAULT_ORDER=["languageContext","recentlyViewedDocuments","neighborFiles","diffHistory"],t.DEFAULT_SHARES={currentFile:1500/7500,recentlyViewedDocuments:2e3/7500,languageContext:2e3/7500,neighborFiles:1e3/7500,diffHistory:1e3/7500},t.DEFAULT_TOTAL_TOKENS=7500;function e(o){return Math.max(0,Math.floor(o.totalTokens*(o.shares.currentFile??0)))}a(e,"currentFileBudget"),t.currentFileBudget=e;function r(o){if(!Number.isFinite(o.totalTokens)||o.totalTokens<0)throw new Error(`globalBudget.totalTokens must be a finite, non-negative number, got ${o.totalTokens}`);let s=new Set;for(let f of o.order){if(s.has(f))throw new Error(`globalBudget.order contains duplicate part '${f}'`);if(s.add(f),typeof o.shares[f]!="number")throw new Error(`globalBudget.shares is missing entry for '${f}'`);if(!Number.isFinite(o.shares[f])||o.shares[f]<0)throw new Error(`globalBudget.shares['${f}'] must be a finite, non-negative number, got ${o.shares[f]}`)}if(typeof o.shares.currentFile!="number")throw new Error("globalBudget.shares is missing entry for 'currentFile'");if(!Number.isFinite(o.shares.currentFile)||o.shares.currentFile<0)throw new Error(`globalBudget.shares['currentFile'] must be a finite, non-negative number, got ${o.shares.currentFile}`);let c=o.order.indexOf("recentlyViewedDocuments"),l=o.order.indexOf("neighborFiles");if(c!==-1&&l!==-1&&lf+o.shares[h],0)+o.shares.currentFile;if(Math.abs(u-1)>.001)throw new Error(`globalBudget.shares across order must sum to ~1, got ${u}`)}a(r,"validate"),t.validate=r,t.VALIDATOR=(0,Ar.vObj)({totalTokens:(0,Ar.vUnion)((0,Ar.vNumber)(),(0,Ar.vUndefined)()),order:(0,Ar.vUnion)((0,Ar.vArray)((0,Ar.vEnum)("languageContext","recentlyViewedDocuments","neighborFiles","diffHistory")),(0,Ar.vUndefined)()),shares:(0,Ar.vUnion)((0,Ar.vObj)({currentFile:(0,Ar.vRequired)((0,Ar.vNumber)()),recentlyViewedDocuments:(0,Ar.vRequired)((0,Ar.vNumber)()),languageContext:(0,Ar.vRequired)((0,Ar.vNumber)()),neighborFiles:(0,Ar.vRequired)((0,Ar.vNumber)()),diffHistory:(0,Ar.vRequired)((0,Ar.vNumber)())}),(0,Ar.vUndefined)())});function n(o){let s;try{s=JSON.parse(o)}catch(d){return Cyt.Result.error(`Failed to parse globalBudget config string: ${d instanceof Error?d.message:String(d)}`)}let{content:c,error:l}=t.VALIDATOR.validate(s);if(l)return Cyt.Result.error(`globalBudget config validation failed: ${l.message}`);let u={totalTokens:c.totalTokens??t.DEFAULT_TOTAL_TOKENS,order:c.order??t.DEFAULT_ORDER,shares:c.shares??t.DEFAULT_SHARES};try{r(u)}catch(d){return Cyt.Result.error(d instanceof Error?d.message:String(d))}return Cyt.Result.ok(u)}a(n,"fromConfigString"),t.fromConfigString=n})(fDi||(An.GlobalBudgetOptions=fDi={}));var RTr;(function(t){t.VALIDATOR=(0,Ar.vObj)({maxTokens:(0,Ar.vNumber)(),includeTags:(0,Ar.vBoolean)(),includeLineNumbers:(0,Ar.vEnum)(AS.WithSpaceAfter,AS.WithoutSpace,AS.None),includeCursorTag:(0,Ar.vBoolean)(),prioritizeAboveCursor:(0,Ar.vBoolean)(),useLeftoverBudgetFromAbove:(0,Ar.vBoolean)()})})(RTr||(An.CurrentFileOptions=RTr={}));var XAe;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(XAe||(An.LintOptionWarning=XAe={}));var eye;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})(eye||(An.LintOptionShowCode=eye={}));var byt;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})(byt||(An.AggressivenessSetting=byt={}));var w$;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(w$||(An.AggressivenessLevel=w$={}));var Syt;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(Syt||(An.EarlyDivergenceCancellationMode=Syt={}));(function(t){t.VALIDATOR=(0,Ar.vEnum)(t.Cursor,t.EditWindow,t.Off)})(Syt||(An.EarlyDivergenceCancellationMode=Syt={}));(function(t){t.VALIDATOR=(0,Ar.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return w$.Low;case t.Medium:return w$.Medium;case t.High:return w$.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})(byt||(An.AggressivenessSetting=byt={}));var Tyt;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(Tyt||(An.EditIntent=Tyt={}));(function(t){function e(o){switch(o){case"no_edit":return t.NoEdit;case"low":return t.Low;case"medium":return t.Medium;case"high":return t.High;default:return t.High}}a(e,"fromString"),t.fromString=e;function r(o){switch(o){case"N":return t.NoEdit;case"L":return t.Low;case"M":return t.Medium;case"H":return t.High;default:return}}a(r,"fromShortName"),t.fromShortName=r;function n(o,s){switch(o){case t.NoEdit:return!1;case t.High:return!0;case t.Medium:return s===w$.Medium||s===w$.High;case t.Low:return s===w$.High;default:(0,hDi.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(Tyt||(An.EditIntent=Tyt={}));var jl;(function(t){t.CopilotNesXtab="copilotNesXtab",t.UnifiedModel="xtabUnifiedModel",t.Codexv21NesUnified="codexv21nesUnified",t.Nes41Miniv3="nes41miniv3",t.SimplifiedSystemPrompt="simplifiedSystemPrompt",t.Xtab275="xtab275",t.XtabAggressiveness="xtabAggressiveness",t.Xtab275Aggressiveness="xtab275Aggressiveness",t.Xtab275AggressivenessHighLow="xtab275AggressivenessHighLow",t.PatchBased="patchBased",t.PatchBased01="patchBased01",t.PatchBased02="patchBased02",t.PatchBased02WithRecentLineNumbers="patchBased02WithRecentLineNumbers",t.PatchBased02WithoutRecentLineNumbers="patchBased02WithoutRecentLineNumbers",t.Xtab275EditIntent="xtab275EditIntent",t.Xtab275EditIntentShort="xtab275EditIntentShort"})(jl||(An.PromptingStrategy=jl={}));function dBa(t){return Object.values(jl).includes(t)}a(dBa,"isPromptingStrategy");function fBa(t){return t===jl.XtabAggressiveness||t===jl.Xtab275Aggressiveness||t===jl.Xtab275AggressivenessHighLow||t===jl.Xtab275EditIntent||t===jl.Xtab275EditIntentShort}a(fBa,"isAggressivenessStrategy");var Iyt;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})(Iyt||(An.ResponseFormat=Iyt={}));(function(t){function e(r){switch(r){case jl.UnifiedModel:case jl.Codexv21NesUnified:case jl.Nes41Miniv3:return t.UnifiedWithXml;case jl.Xtab275:case jl.XtabAggressiveness:case jl.Xtab275Aggressiveness:case jl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case jl.PatchBased:case jl.PatchBased01:case jl.PatchBased02:case jl.PatchBased02WithRecentLineNumbers:case jl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case jl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case jl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case jl.SimplifiedSystemPrompt:case jl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,hDi.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})(Iyt||(An.ResponseFormat=Iyt={}));An.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:1500,includeTags:!0,includeLineNumbers:AS.None,includeCursorTag:!1,prioritizeAboveCursor:!1,useLeftoverBudgetFromAbove:!0},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:AS.None,clippingStrategy:mre.AroundEditRange,useLeftoverBudgetFromAbove:!1},languageContext:{enabled:!1,maxTokens:2e3,traitPosition:"after"},neighborFiles:{enabled:!1,maxTokens:1e3},diffHistory:{nEntries:25,maxTokens:1e3,onlyForDocsInPrompt:!1,useRelativePaths:!1},lintOptions:void 0,includePostScript:!0};An.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:eye.YES_WITH_SURROUNDING,tagName:"linter",warnings:XAe.YES_IF_NO_ERRORS,nRecentFiles:0};An.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var pBa={[jl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[jl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:AS.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:AS.WithoutSpace},supportsNextCursorLinePrediction:!1,allowImportChanges:xTr.ImportChanges.All},[jl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:AS.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:AS.None},supportsNextCursorLinePrediction:!1,allowImportChanges:xTr.ImportChanges.All}};function hBa(t){let e=t.promptingStrategy===void 0?void 0:pBa[t.promptingStrategy];if(!e)return t;let r=t.currentFile!==void 0||e.currentFile!==void 0,n=t.recentlyViewedDocuments!==void 0||e.recentlyViewedDocuments!==void 0,o=t.lintOptions!==void 0||e.lintOptions!==void 0;return{...t,...e,currentFile:r?{...t.currentFile,...e.currentFile}:void 0,recentlyViewedDocuments:n?{...t.recentlyViewedDocuments,...e.recentlyViewedDocuments}:void 0,lintOptions:o?{...t.lintOptions,...e.lintOptions}:void 0}}a(hBa,"applyStrategyConfig");An.LINT_OPTIONS_VALIDATOR=(0,Ar.vObj)({tagName:(0,Ar.vString)(),warnings:(0,Ar.vEnum)(XAe.YES,XAe.NO,XAe.YES_IF_NO_ERRORS),showCode:(0,Ar.vEnum)(eye.NO,eye.YES,eye.YES_WITH_SURROUNDING),maxLints:(0,Ar.vNumber)(),maxLineDistance:(0,Ar.vNumber)(),nRecentFiles:(0,Ar.vNumber)()});An.MODEL_CONFIGURATION_VALIDATOR=(0,Ar.vObj)({modelName:(0,Ar.vRequired)((0,Ar.vString)()),promptingStrategy:(0,Ar.vUnion)((0,Ar.vEnum)(...Object.values(jl)),(0,Ar.vUndefined)()),includeTagsInCurrentFile:(0,Ar.vRequired)((0,Ar.vBoolean)()),includePostScript:(0,Ar.vUnion)((0,Ar.vBoolean)(),(0,Ar.vUndefined)()),currentFile:(0,Ar.vUnion)(RTr.VALIDATOR,(0,Ar.vUndefined)()),recentlyViewedDocuments:(0,Ar.vUnion)(wTr.VALIDATOR,(0,Ar.vUndefined)()),lintOptions:(0,Ar.vUnion)(An.LINT_OPTIONS_VALIDATOR,(0,Ar.vUndefined)()),supportsNextCursorLinePrediction:(0,Ar.vUnion)((0,Ar.vBoolean)(),(0,Ar.vUndefined)()),allowImportChanges:(0,Ar.vUnion)(xTr.ImportChanges.VALIDATOR,(0,Ar.vUndefined)())});function mBa(t,e){try{let r=JSON.parse(t),n=An.LINT_OPTIONS_VALIDATOR.validate(r);if(n.error)throw new Error(`Lint options validation failed: ${n.error.message}`);return{...e,...n.content}}catch(r){throw new Error(`Failed to parse lint options string: ${r}`)}}a(mBa,"parseLintOptionString");An.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var pDi=(0,Ar.vObj)({acceptedScore:(0,Ar.vRequired)((0,Ar.vNumber)()),rejectedScore:(0,Ar.vRequired)((0,Ar.vNumber)()),ignoredScore:(0,Ar.vRequired)((0,Ar.vNumber)()),highThreshold:(0,Ar.vRequired)((0,Ar.vNumber)()),mediumThreshold:(0,Ar.vRequired)((0,Ar.vNumber)()),includeIgnored:(0,Ar.vRequired)((0,Ar.vBoolean)()),ignoredLimit:(0,Ar.vRequired)((0,Ar.vNumber)()),limitConsecutiveIgnored:(0,Ar.vRequired)((0,Ar.vBoolean)()),limitTotalIgnored:(0,Ar.vRequired)((0,Ar.vBoolean)())});function tLe(t,e,r){return t>=e&&t<=r}a(tLe,"isInRange");An.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=pDi.validate(t);if(e.error)return e;let r=e.content;return tLe(r.acceptedScore,0,1)?tLe(r.rejectedScore,0,1)?tLe(r.ignoredScore,0,1)?tLe(r.highThreshold,0,1)?tLe(r.mediumThreshold,0,1)?r.acceptedScore<=r.rejectedScore?{content:void 0,error:{message:"acceptedScore must be greater than rejectedScore to prevent division by zero"}}:r.ignoredScore{"use strict";p();Object.defineProperty(tye,"__esModule",{value:!0});tye.TextReplacement=tye.TextEdit=void 0;var mDi=Ml(),gDi=pd(),Myt=Os(),Dyt=ym(),R$=iv(),Lm=uh(),Oyt=Vge(),ADi=dI(),Lyt=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>$v.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new $v(e,r)])}static delete(e){return new t([new $v(e,"")])}static insert(e,r){return new t([new $v(Lm.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,mDi.compareBy)(n=>n.range,Lm.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,gDi.assertFn)(()=>(0,gDi.checkAdjacentItems)(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}normalize(){let e=[];for(let r of this.replacements)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(r.range.getStartPosition())){let n=e[e.length-1];e[e.length-1]=new $v(n.range.plusRange(r.range),n.text+r.text)}else r.isEmpty||e.push(r);return new t(e)}mapPosition(e){let r=0,n=0,o=0;for(let s of this.replacements){let c=s.range.getStartPosition();if(e.isBeforeOrEqual(c))break;let l=s.range.getEndPosition(),u=Oyt.TextLength.ofText(s.text);if(e.isBefore(l)){let d=new R$.Position(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return Nyt(d,f)}c.lineNumber+r!==n&&(o=0),r+=u.lineCount-(s.range.endLineNumber-s.range.startLineNumber),u.lineCount===0?l.lineNumber!==c.lineNumber?o+=u.columnCount-(l.column-1):o+=u.columnCount-(l.column-c.column):o=u.columnCount,n=l.lineNumber+r}return new R$.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof R$.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof R$.Position?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return Nyt(o,s)}inverseMapPosition(e,r){return this.inverse(r).mapPosition(e)}inverseMapRange(e,r){return this.inverse(r).mapRange(e)}apply(e){let r="",n=new R$.Position(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=Nyt(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=Nyt(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new ADi.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new $v(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=Oyt.TextLength.ofText(s.text),l=R$.Position.lift({lineNumber:s.range.startLineNumber+n,column:s.range.startColumn+(s.range.startLineNumber===r?o:0)}),u=c.createRange(l);e.push(u),n=u.endLineNumber-s.range.endLineNumber,o=u.endColumn-s.range.endColumn,r=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Myt.BugIndicatingError;if(this.replacements.length===1)return this.replacements[0];let r=this.replacements[0].range.getStartPosition(),n=this.replacements[this.replacements.length-1].range.getEndPosition(),o="";for(let s=0;sr.equals(n))}compose(e){let r=this.normalize(),n=e.normalize();if(r.replacements.length===0)return n;if(n.replacements.length===0)return r;let o=[],s=0,c=1,l=1,u=0,d=0,f=0,h=0,m=null,g=0,A=0,y=!1,_=!1,E=1,v=1;function S(){if(!y)if(sr.toString()).join(` +`):typeof e=="string"?this.toString(new ADi.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Lm.Range.fromPositions(new R$.Position(Math.max(1,r.range.startLineNumber-1),1),r.range.getStartPosition()),c=e.getValueOfRange(s);c.length>10&&(c="..."+c.substring(c.length-10));let l=Lm.Range.fromPositions(r.range.getEndPosition(),new R$.Position(r.range.endLineNumber+1,1)),u=e.getValueOfRange(l);u.length>10&&(u=u.substring(0,10)+"...");let d=o;if(d.length>10){let h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}let f=r.text;if(f.length>10){let h=Math.floor(5);f=f.substring(0,h)+"..."+f.substring(f.length-h)}return d.length===0?`${c}\u2770${f}\u2771${u}`:`${c}\u2770${d}\u21A6${f}\u2771${u}`}).join(` +`)}};tye.TextEdit=Lyt;var $v=class t{static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new Myt.BugIndicatingError;if(e.length===1)return e[0];let n=e[0].range.getStartPosition(),o=e[e.length-1].range.getEndPosition(),s="";for(let c=0;c ${r.lineNumber},${r.column}): "${this.text}"`}};tye.TextReplacement=$v;function Dyt(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return Om.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Nyt.BugIndicatingError("start must be before end");return new Om.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(Dyt,"rangeFromPositions")});var k$=I(R$=>{"use strict";p();Object.defineProperty(R$,"__esModule",{value:!0});R$.SerializedLineReplacement=R$.LineReplacement=R$.LineEdit=void 0;var RTr=Ml(),gDi=pd(),mBa=ym(),nLe=vD(),yDi=W_(),rye=iv(),nye=uh(),iye=rLe(),Lyt=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>mre.deserialize(r)))}static fromStringEdit(e,r){let n=iye.TextEdit.fromStringEdit(e,r);return t.fromTextEdit(n,r)}static fromTextEdit(e,r){let n=e.replacements,o=[],s=[];for(let c=0;cn.lineRange.startLineNumber,RTr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,gDi.assert)((0,gDi.checkAdjacentItems)(e,(r,n)=>r.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}isEmpty(){return this.replacements.length===0}toEdit(e){let r=[];for(let n of this.replacements){let o=n.toSingleEdit(e);r.push(o)}return new yDi.StringEdit(r)}toString(){return this.replacements.map(e=>e.toString()).join(",")}serialize(){return this.replacements.map(e=>e.serialize())}getNewLineRanges(){let e=[],r=0;for(let n of this.replacements)e.push(nLe.LineRange.ofLength(n.lineRange.startLineNumber+r,n.newLines.length)),r+=n.newLines.length-n.lineRange.length;return e}mapLineNumber(e){let r=0;for(let n of this.replacements){if(n.lineRange.endLineNumberExclusive>e)break;r+=n.newLines.length-n.lineRange.length}return e+r}mapLineRange(e){return new nLe.LineRange(this.mapLineNumber(e.startLineNumber),this.mapLineNumber(e.endLineNumberExclusive))}mapBackLineRange(e,r){return this.inverse(r).mapLineRange(e)}touches(e){return this.replacements.some(r=>e.replacements.some(n=>r.lineRange.intersect(n.lineRange)))}rebase(e){return new t(this.replacements.map(r=>new mre(e.mapLineRange(r.lineRange),r.newLines)))}humanReadablePatch(e){let r=[];function n(l,u,d,f){let h=d==="unmodified"?" ":d==="deleted"?"-":"+";f===void 0&&(f="[[[[[ WARNING: LINE DOES NOT EXIST ]]]]]");let m=l===-1?" ":l.toString().padStart(3," "),g=u===-1?" ":u.toString().padStart(3," ");r.push(`${h} ${m} ${g} ${f}`)}a(n,"pushLine");function o(){r.push("---")}a(o,"pushSeperator");let s=0,c=!0;for(let l of(0,RTr.groupAdjacentBy)(this.replacements,(u,d)=>u.lineRange.distanceToRange(d.lineRange)<=5)){c?c=!1:o();let u=l[0].lineRange.startLineNumber-2;for(let d of l){for(let m=Math.max(1,u);mg)){let g=e[m-1];n(m,-1,"deleted",g)}for(let m=0;mnew mre(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};R$.LineEdit=Lyt;var mre=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(nLe.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,mBa.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(nye.Range.fromPositions(new rye.Position(e.range.startLineNumber,1),e.range.getStartPosition()));n[0]=s+n[0];let c=e.range.endLineNumber+1,l=r.getTransformer().getLineLength(e.range.endLineNumber)+1,u=r.getValueOfRange(nye.Range.fromPositions(e.range.getEndPosition(),new rye.Position(e.range.endLineNumber,l)));n[n.length-1]=n[n.length-1]+u;let d=e.range.startColumn===r.getTransformer().getLineLength(e.range.startLineNumber)+1,f=e.range.endColumn===1;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o1){let s=this.lineRange.startLineNumber-1,c=e.getTransformer().getLineLength(s)+1;n=new rye.Position(s,c)}else n=new rye.Position(1,1);let o=r.addToPosition(new rye.Position(1,1));return new iye.TextReplacement(nye.Range.fromPositions(n,o),"")}else return new iye.TextReplacement(new nye.Range(this.lineRange.startLineNumber,1,this.lineRange.endLineNumberExclusive,1),"")}else if(this.lineRange.isEmpty){let r,n,o,s=this.lineRange.startLineNumber;return s===e.getTransformer().textLength.lineCount+2?(r=s-1,n=e.getTransformer().getLineLength(r)+1,o=this.newLines.map(c=>` +`),o=(0,Dyt.commonPrefixLength)(r,n);r=r.substring(o),n=n.substring(o);let s=(0,Dyt.commonSuffixLength)(r,n);return r=r.substring(0,r.length-s),n=n.substring(0,n.length-s),r===""}toString(){let e=this.range.getStartPosition(),r=this.range.getEndPosition();return`(${e.lineNumber},${e.column} -> ${r.lineNumber},${r.column}): "${this.text}"`}};tye.TextReplacement=$v;function Nyt(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return Lm.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Myt.BugIndicatingError("start must be before end");return new Lm.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(Nyt,"rangeFromPositions")});var P$=I(k$=>{"use strict";p();Object.defineProperty(k$,"__esModule",{value:!0});k$.SerializedLineReplacement=k$.LineReplacement=k$.LineEdit=void 0;var kTr=Ml(),yDi=pd(),ABa=ym(),nLe=vD(),EDi=W_(),rye=iv(),nye=uh(),iye=rLe(),Byt=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>gre.deserialize(r)))}static fromStringEdit(e,r){let n=iye.TextEdit.fromStringEdit(e,r);return t.fromTextEdit(n,r)}static fromTextEdit(e,r){let n=e.replacements,o=[],s=[];for(let c=0;cn.lineRange.startLineNumber,kTr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,yDi.assert)((0,yDi.checkAdjacentItems)(e,(r,n)=>r.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}isEmpty(){return this.replacements.length===0}toEdit(e){let r=[];for(let n of this.replacements){let o=n.toSingleEdit(e);r.push(o)}return new EDi.StringEdit(r)}toString(){return this.replacements.map(e=>e.toString()).join(",")}serialize(){return this.replacements.map(e=>e.serialize())}getNewLineRanges(){let e=[],r=0;for(let n of this.replacements)e.push(nLe.LineRange.ofLength(n.lineRange.startLineNumber+r,n.newLines.length)),r+=n.newLines.length-n.lineRange.length;return e}mapLineNumber(e){let r=0;for(let n of this.replacements){if(n.lineRange.endLineNumberExclusive>e)break;r+=n.newLines.length-n.lineRange.length}return e+r}mapLineRange(e){return new nLe.LineRange(this.mapLineNumber(e.startLineNumber),this.mapLineNumber(e.endLineNumberExclusive))}mapBackLineRange(e,r){return this.inverse(r).mapLineRange(e)}touches(e){return this.replacements.some(r=>e.replacements.some(n=>r.lineRange.intersect(n.lineRange)))}rebase(e){return new t(this.replacements.map(r=>new gre(e.mapLineRange(r.lineRange),r.newLines)))}humanReadablePatch(e){let r=[];function n(l,u,d,f){let h=d==="unmodified"?" ":d==="deleted"?"-":"+";f===void 0&&(f="[[[[[ WARNING: LINE DOES NOT EXIST ]]]]]");let m=l===-1?" ":l.toString().padStart(3," "),g=u===-1?" ":u.toString().padStart(3," ");r.push(`${h} ${m} ${g} ${f}`)}a(n,"pushLine");function o(){r.push("---")}a(o,"pushSeperator");let s=0,c=!0;for(let l of(0,kTr.groupAdjacentBy)(this.replacements,(u,d)=>u.lineRange.distanceToRange(d.lineRange)<=5)){c?c=!1:o();let u=l[0].lineRange.startLineNumber-2;for(let d of l){for(let m=Math.max(1,u);mg)){let g=e[m-1];n(m,-1,"deleted",g)}for(let m=0;mnew gre(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};k$.LineEdit=Byt;var gre=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(nLe.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,ABa.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(nye.Range.fromPositions(new rye.Position(e.range.startLineNumber,1),e.range.getStartPosition()));n[0]=s+n[0];let c=e.range.endLineNumber+1,l=r.getTransformer().getLineLength(e.range.endLineNumber)+1,u=r.getValueOfRange(nye.Range.fromPositions(e.range.getEndPosition(),new rye.Position(e.range.endLineNumber,l)));n[n.length-1]=n[n.length-1]+u;let d=e.range.startColumn===r.getTransformer().getLineLength(e.range.startLineNumber)+1,f=e.range.endColumn===1;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o1){let s=this.lineRange.startLineNumber-1,c=e.getTransformer().getLineLength(s)+1;n=new rye.Position(s,c)}else n=new rye.Position(1,1);let o=r.addToPosition(new rye.Position(1,1));return new iye.TextReplacement(nye.Range.fromPositions(n,o),"")}else return new iye.TextReplacement(new nye.Range(this.lineRange.startLineNumber,1,this.lineRange.endLineNumberExclusive,1),"")}else if(this.lineRange.isEmpty){let r,n,o,s=this.lineRange.startLineNumber;return s===e.getTransformer().textLength.lineCount+2?(r=s-1,n=e.getTransformer().getLineLength(r)+1,o=this.newLines.map(c=>` `+c).join("")):(r=s,n=1,o=this.newLines.map(c=>c+` `).join("")),new iye.TextReplacement(nye.Range.fromPositions(new rye.Position(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new nye.Range(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` -`);return new iye.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new yDi.StringReplacement(n,r.text)}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}serialize(){return[this.lineRange.startLineNumber,this.lineRange.endLineNumberExclusive,this.newLines]}removeCommonSuffixPrefixLines(e){let r=this.lineRange.startLineNumber,n=this.lineRange.endLineNumberExclusive,o=0;for(;rtypeof n=="string")}a(e,"is"),t.is=e})(ADi||(R$.SerializedLineReplacement=ADi={}))});var Qyt=I(oye=>{"use strict";p();Object.defineProperty(oye,"__esModule",{value:!0});oye.ArrayMap=oye.ResponseProcessor=void 0;var gBa=Os(),Byt=k$(),Fyt=vD(),_Di;(function(t){t.DEFAULT_DIFF_PARAMS={emitFastCursorLineChange:"off",nSignificantLinesToConverge:2,nLinesToConverge:3};function e(l){return l===!0?"additiveOnly":l===!1?"off":l}a(e,"mapEmitFastCursorLineChange"),t.mapEmitFastCursorLineChange=e;async function*r(l,u,d,f){let h=new Uyt;for(let[y,_]of l.entries())h.add(_,y);let m=0,g=-1,A={k:"aligned"};for await(let y of u){if(++g,m>=l.length){switch(A.k){case"aligned":{A={k:"diverged",startLineIdx:m,newLines:[y]};break}case"diverged":A.newLines.push(y)}continue}if(A.k==="aligned"){if(l[m]===y){++m;continue}A={k:"diverged",startLineIdx:m,newLines:[]}}A.newLines.push(y);let _=c(l,d,h,A,m,f);_&&(yield _.singleLineEdit,m=_.convergenceEndIdx,A={k:"aligned"})}switch(A.k){case"diverged":{let y=new Fyt.LineRange(A.startLineIdx+1,l.length+1);yield new Byt.LineReplacement(y,A.newLines);break}case"aligned":{if(mu.length)return!1;let d=0;for(let f=0;f[B,B]);if(A.length===0){if(m.emitFastCursorLineChange==="off"||h!==u||f.newLines.length>1)return;let B=l[h],q=f.newLines[0];if(B.trim()===""&&h+10&&v[0]-f.startLineIdx===f.newLines.length-1&&(E="found_significant_matches");g>=0&&(A=A.map(([B,q])=>[B,q-1]),A=A.filter(([B,q])=>q>=0&&h<=q),A=A.filter(([B,q])=>l[q]===f.newLines[g]),A.length!==0);--g)if(++y,n(f.newLines[g])&&++_,_===m.nSignificantLinesToConverge&&(E="found_significant_matches",v=A[0]),y===m.nLinesToConverge){E="found_matches",v=A[0];break}if(!E)return;let S=v[1],T=v[0],w=T-S+1,R=S-f.startLineIdx,x=f.newLines.slice(0,f.newLines.length-w),k=x.length;if(R-k>1&&k>0)return;let D=[f.startLineIdx,S],N=new Fyt.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new Byt.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(_Di||(oye.ResponseProcessor=_Di={}));var Uyt=class{static{a(this,"ArrayMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n?n.push(r):this.map.set(e,[r])}get(e){return this.map.get(e)||[]}};oye.ArrayMap=Uyt});var vDi=I(qyt=>{"use strict";p();Object.defineProperty(qyt,"__esModule",{value:!0});qyt.AlternativeNotebookFormat=void 0;var EDi;(function(t){t.json="json",t.xml="xml",t.text="text"})(EDi||(qyt.AlternativeNotebookFormat=EDi={}))});var Hl=I(Wo=>{"use strict";p();var ABa=Wo&&Wo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yBa=Wo&&Wo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oLe=Wo&&Wo.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{this._setUserInfo({isInternal:!!e.copilotToken?.isInternal})}))}getConfigMixedWithDefaults(e){if(e.options?.valueIgnoredForExternals&&!this._isInternal)return this.getDefaultValue(e);let r=this.getConfig(e);return r===void 0?this.getDefaultValue(e):CDi.isObject(r)&&CDi.isObject(e.defaultValue)?{...e.defaultValue,...r}:r}getDefaultValue(e){let r=this.getDefaultValueForConfig(e),n=r==null||r===!1||r===0||r==="";return e.defaultValue===void 0&&n?e.defaultValue:r!==void 0?r:e.defaultValue}_setUserInfo(e){if(this._isInternal===e.isInternal)return;let r=this._isInternal!==e.isInternal;this._isInternal=e.isInternal;let n=new Set;for(let o of Wo.globalConfigRegistry.configs.values())r&&o.options?.valueIgnoredForExternals&&n.add(o.fullyQualifiedId);n.size>0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a(o=>{for(let s of n)if(s===o||s.startsWith(o+".")||o.startsWith(s+"."))return!0;return!1},"affectsConfiguration")})}updateExperimentBasedConfiguration(e){e.length!==0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a(()=>!0,"affectsConfiguration")})}getConfigObservable(e){return this._getObservable_$show2FramesUp(e,()=>this.getConfig(e))}getExperimentBasedConfigObservable(e,r){return this._getObservable_$show2FramesUp(e,()=>this.getExperimentBasedConfig(e,r))}_getObservable_$show2FramesUp(e,r){let n=this.observables.get(e.id);return n||(n=(0,CBa.observableFromEventOpts)({debugName:a(()=>`Configuration Key "${e.id}"`,"debugName")},o=>this._register(this.onDidChangeConfiguration(s=>{s.affectsConfiguration(e.fullyQualifiedId)&&o(s)})),r),this.observables.set(e.id,n)),n}isConfigured(e,r){let n=this.inspectConfig(e,r);return n?.globalValue!==void 0||n?.globalLanguageValue!==void 0||n?.workspaceFolderValue!==void 0||n?.workspaceFolderLanguageValue!==void 0||n?.workspaceValue!==void 0||n?.workspaceLanguageValue!==void 0}getDefaultValueForConfig(e){}};Wo.AbstractConfigurationService=PTr;var jyt;function TBa(){if(!jyt){jyt=new Map;let e=bBa.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)jyt.set(n,r[n].default)}return jyt}a(TBa,"getPackageJsonDefaults");function xDi(t,e,r){let n=`${Wo.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Wo.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=TBa(),c=s.has(n),l=s.get(n);if(c&&!vBa.equals(e,l))throw new kTr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new kTr.BugIndicatingError(`The setting ${t} is public, it therefore cannot be restricted to internal!`);let u=n.startsWith("github.copilot.advanced.")?n.substring(24):void 0;return{id:t,oldId:r?.oldKey,isPublic:c,fullyQualifiedId:n,fullyQualifiedOldId:o,advancedSubKey:u,defaultValue:e,options:r}}a(xDi,"toBaseConfig");var DTr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Wo.globalConfigRegistry=new DTr;var NTr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new wDi.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Wo.ConfigurationMigrationRegistry=new NTr;function at(t,e,r,n,o,s){if(e===1){let l={...xDi(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new kTr.BugIndicatingError("Shared settings cannot be experiment based");return Wo.globalConfigRegistry.registerConfig(l),l}let c={...xDi(t,r,o),configType:0,validator:n};return Wo.globalConfigRegistry.registerConfig(c),c}a(at,"defineSetting");function Ot(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?at(t,e,r,n,o):at(t,e,r,n,o,s)}a(Ot,"defineTeamInternalSetting");function BTr(t,e){Wo.ConfigurationMigrationRegistry.registerConfigurationMigrations([{key:`${Wo.CopilotConfigPrefix}.${e}`,migrateFn:a(async r=>[[`${Wo.CopilotConfigPrefix}.${t}`,{value:r}],[`${Wo.CopilotConfigPrefix}.${e}`,{value:void 0}]],"migrateFn")}])}a(BTr,"migrateSetting");function iA(t,e,r,n){return BTr(e,t),at(e,0,r,void 0,{...n,oldKey:t})}a(iA,"defineAndMigrateSetting");function Bg(t,e,r,n,o){return BTr(e,t),at(e,1,r,void 0,{...n,oldKey:t},o)}a(Bg,"defineAndMigrateExpSetting");Wo.HARD_TOOL_LIMIT=128;var MTr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(MTr||(Wo.AuthProviderId=MTr={}));var OTr;(function(t){t.Default="default",t.Minimal="minimal"})(OTr||(Wo.AuthPermissionMode=OTr={}));var iLe;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(iLe||(Wo.AzureAuthMode=iLe={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(iLe||(Wo.AzureAuthMode=iLe={}));Wo.XTabProviderId="XtabProvider";var LTr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=at("advanced.debug.overrideProxyUrl",0,void 0,void 0,{userScopeOnly:!0}),s.DebugOverrideAuthType=at("advanced.debug.overrideAuthType",0,"hmac"),s.DebugOverrideCAPIUrl=at("advanced.debug.overrideCapiUrl",0,void 0,void 0,{userScopeOnly:!0}),s.DebugUseNodeFetchFetcher=at("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=at("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=at("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=at("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=at("advanced.authProvider",0,MTr.GitHub),s.AuthPermissions=at("advanced.authPermissions",0,OTr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=at("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=at("chat.debug.promptOverrideFile",0,null),s.WorkspacePrototypeAdoCodeSearchEndpointOverride=iA("chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride","chat.workspace.prototypeAdoCodeSearchEndpointOverride",""),s.FeedbackOnChange=iA("chat.advanced.feedback.onChange","chat.feedback.onChange",!1),s.ReviewIntent=iA("chat.advanced.review.intent","chat.review.intent",!1),s.NotebookSummaryExperimentEnabled=iA("chat.advanced.notebook.summaryExperimentEnabled","chat.notebook.summaryExperimentEnabled",!1),s.NotebookVariableFilteringEnabled=iA("chat.advanced.notebook.variableFilteringEnabled","chat.notebook.variableFilteringEnabled",!1),s.TerminalToDebuggerPatterns=iA("chat.advanced.debugTerminalCommandPatterns","chat.debugTerminalCommandPatterns",[]),s.WorkspaceRecordingEnabled=iA("chat.advanced.localWorkspaceRecording.enabled","chat.localWorkspaceRecording.enabled",!1),s.EditRecordingEnabled=iA("chat.advanced.editRecording.enabled","chat.editRecording.enabled",!1),s.CodeSearchAgentEnabled=iA("chat.advanced.codesearch.agent.enabled","chat.codesearch.agent.enabled",!0),s.AgentTemperature=iA("chat.advanced.agent.temperature","chat.agent.temperature",void 0),s.EnableUserPreferences=iA("chat.advanced.enableUserPreferences","chat.enableUserPreferences",!1),s.SummarizeAgentConversationHistoryThreshold=iA("chat.advanced.summarizeAgentConversationHistoryThreshold","chat.summarizeAgentConversationHistoryThreshold",void 0),s.AgentHistorySummarizationMode=iA("chat.advanced.agentHistorySummarizationMode","chat.agentHistorySummarizationMode",void 0),s.UseResponsesApiTruncation=iA("chat.advanced.useResponsesApiTruncation","chat.useResponsesApiTruncation",!1),s.OmitBaseAgentInstructions=iA("chat.advanced.omitBaseAgentInstructions","chat.omitBaseAgentInstructions",!1),s.CLIShowExternalSessions=at("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=at("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=at("chat.cli.autoModel.enabled",0,!0),s.CLIModelDetailsEnabled=at("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=at("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=at("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=at("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=at("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=iA("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLISandboxEnabled=at("chat.cli.sandbox.enabled",1,"off"),s.CLIBranchSupport=at("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=at("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=at("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=at("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=at("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=at("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=at("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=at("chat.cli.terminalLinks.enabled",0,!0),s.CLISessionEventLoggingEnabled=at("chat.cli.sessionEventLogging.enabled",0,!1),s.RequestLoggerMaxEntries=iA("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=Bg("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=Bg("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=Bg("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=Bg("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=Bg("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=at("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=Bg("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=Bg("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",SBa.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=Bg("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=at("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=at("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=Bg("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=Bg("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=Bg("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=Bg("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=Bg("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=at("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=at("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=at("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=at("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=at("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=at("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=at("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=at("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=at("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=at("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=at("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=at("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=Bg("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=Bg("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=Bg("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=at("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=at("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=at("nextEditSuggestions.eagerness",1,Sl.AggressivenessSetting.Default,Sl.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=Bg("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=at("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=at("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=at("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=at("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=at("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=at("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=at("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=at("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=Bg("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=Bg("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=iA("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=at("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=at("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=at("chat.otel.enabled",0,!1),s.OTelExporterType=at("chat.otel.exporterType",0,"otlp-http"),s.OTelProtocol=at("chat.otel.protocol",0,""),s.OTelOtlpEndpoint=at("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=at("chat.otel.captureContent",0,!1),s.OTelServiceName=at("chat.otel.serviceName",0,""),s.OTelResourceAttributes=at("chat.otel.resourceAttributes",0,{}),s.OTelHeaders=at("chat.otel.headers",0,{}),s.OTelMaxAttributeSizeChars=at("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=at("chat.otel.outfile",0,""),s.OTelDbSpanExporter=at("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=at("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=at("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=at("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=at("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=at("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=at("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return BTr(l,c),at(l,0,null,Sl.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=Ot("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=Ot("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=Ot("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=Ot("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,wh.vBoolean)()),s.InlineEditsModelPickerEnabled=Ot("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,wh.vBoolean)()),s.InlineEditsUseSlashModels=Ot("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=Ot("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=Ot("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,wh.vBoolean)()),s.InlineEditsLogCancelledRequests=Ot("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,wh.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=Ot("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,wh.vString)()),s.InlineEditsNextCursorPredictionApiKey=Ot("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,wh.vString)()),s.InlineEditsXtabProviderUrl=Ot("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,wh.vString)()),s.InlineEditsXtabProviderApiKey=Ot("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,wh.vString)()),s.InlineEditsNextCursorPredictionLintOptions=Ot("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,Sl.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=Ot("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,wh.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=Ot("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,wh.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=Ot("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,wh.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=Ot("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,wh.vBoolean)()),s.InlineEditsXtabProviderPatchModelPredictionKind=Ot("chat.advanced.inlineEdits.xtabProvider.patchModelPredictionKind",1,Sl.PatchModelPrediction.FilePath,Sl.PatchModelPrediction.VALIDATOR),s.InlineEditsXtabProviderPatchFastYieldLineWithCursor=Ot("chat.advanced.inlineEdits.xtabProvider.patchFastYieldLineWithCursor",1,!0,(0,wh.vBoolean)()),s.InlineEditsXtabProviderPatchFastYieldLineWithCursorMultiLine=Ot("chat.advanced.inlineEdits.xtabProvider.patchFastYieldLineWithCursorMultiLine",1,!1,(0,wh.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=Ot("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,QD.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=Ot("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=Ot("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=Ot("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=Ot("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=Ot("chat.advanced.promptRenderer.trace",0,!1),s.DebugCollectFetcherTelemetry=Ot("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=Ot("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=Ot("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=Ot("chat.advanced.modelProviderPreference",0,void 0,(0,wh.vString)()),s.UseVSCodeTelemetryLibForGH=Ot("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=Ot("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=Ot("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=Ot("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=Ot("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsDebounceUseCoreRequestTime=Ot("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=Ot("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=Ot("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=Ot("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=Ot("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=Ot("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=Ot("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=Ot("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=Ot("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=Ot("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=Ot("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=Ot("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=Ot("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=Ot("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,1,(0,wh.vNumber)()),s.InlineEditsBackoffDebounceEnabled=Ot("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=Ot("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=Ot("chat.advanced.inlineEdits.speculativeRequests",1,QD.SpeculativeRequestsEnablement.Off,QD.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=Ot("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,QD.SpeculativeRequestsCursorPlacement.AfterEditApplied,QD.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=Ot("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,QD.SpeculativeRequestsAutoExpandEditWindowLines.Off,QD.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=Ot("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=Ot("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=Ot("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,SDi.DocumentSwitchTriggerStrategy.AfterAcceptance,SDi.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=Ot("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=Ot("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=Ot("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=Ot("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,wh.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=Ot("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=Ot("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=Ot("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=Ot("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=Ot("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=Ot("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=Ot("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=Ot("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=Ot("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,Sl.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=Ot("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,Sl.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=Ot("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,Sl.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=Ot("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,Sl.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=Ot("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,Sl.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=Ot("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,Sl.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=Ot("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,TDi.DiffHistoryMergeStrategy.SameStartLine,TDi.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=Ot("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,wh.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=Ot("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,wh.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=Ot("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=Ot("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,Sl.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=Ot("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,Sl.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,Sl.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove=Ot("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.useLeftoverBudgetFromAbove",1,Sl.DEFAULT_OPTIONS.recentlyViewedDocuments.useLeftoverBudgetFromAbove),s.InlineEditsXtabPageSize=Ot("chat.advanced.inlineEdits.xtabProvider.pageSize",1,Sl.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=Ot("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=Ot("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,Sl.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=Ot("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,Sl.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=Ot("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,Sl.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=Ot("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,Sl.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=Ot("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,Sl.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove=Ot("chat.advanced.inlineEdits.xtabProvider.currentFile.useLeftoverBudgetFromAbove",1,Sl.DEFAULT_OPTIONS.currentFile.useLeftoverBudgetFromAbove),s.InlineEditsXtabDiffOnlyForDocsInPrompt=Ot("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,Sl.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=Ot("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,Sl.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=Ot("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,IDi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=Ot("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,IDi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=Ot("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,QD.EarlyDivergenceCancellationMode.Off,QD.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=Ot("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,Sl.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=Ot("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,Sl.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=Ot("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,Sl.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=Ot("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,Sl.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudget=Ot("chat.advanced.inlineEdits.xtabProvider.globalBudget",1,void 0),s.InlineEditsXtabMaxMergeConflictLines=Ot("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=Ot("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=Ot("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,QD.DuplicateAdditionsMode.Off,QD.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabSplitPatchOnDiff=Ot("chat.advanced.inlineEdits.xtabProvider.diffPatch.splitOnDiff",1,!1,(0,wh.vBoolean)()),s.InlineEditsXtabAggressivenessLevel=Ot("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=Ot("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=Ot("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=Ot("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=Ot("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=Ot("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=Ot("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsIgnoreWhenSuggestVisible=Ot("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=Ot("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=Ot("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,bDi.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=Ot("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,bDi.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=Ot("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=Ot("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.InlineCompletionsDefaultDiagnosticsOptions=Ot("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=Ot("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=Ot("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=Ot("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=at("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=at("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=at("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=at("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=at("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=Ot("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=Ot("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=Ot("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=Ot("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=Ot("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=at("chat.planAgent.model",0,""),s.OllamaEndpoint=at("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=at("chat.azureModels",0,{}),s.CustomOAIModels=at("chat.customOAIModels",0,{}),s.AzureAuthType=at("chat.azureAuthType",0,iLe.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=at("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=at("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=at("chat.rateLimitAutoSwitchToAuto",0,!1,(0,wh.vBoolean)()),t.ConversationUsePrismCompaction=at("chat.conversationCompaction.usePrismCompaction",1,!1),t.ConversationCompactionModel=at("chat.conversationCompaction.model",1,""),t.ConversationPrismCompactionModelFilter=at("chat.conversationCompaction.prismModelFilter",1,"claude-haiku-4.5,claude-sonnet-4.5,claude-sonnet-4.6,gemini-2.5-pro,gemini-3-flash,gemini-3.5-flash"),t.UseAnthropicMessagesApi=at("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=at("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiContextManagementEnabled=at("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=at("chat.responsesApi.promptCacheKey.enabled",1,!1),t.ResponsesApiPromptCacheBreakpointEnabled=at("chat.responsesApi.promptCacheBreakpoint.enabled",1,!1),t.Updated53CodexPromptEnabled=at("chat.updated53CodexPrompt.enabled",1,!0),t.Claude48OpusPromptEnabled=at("chat.claude48OpusPrompt.enabled",1,!1),t.ClaudeSonnet5PromptEnabled=at("chat.claudeSonnet5Prompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=at("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=at("chat.gemini3GetChangedFilesTool.enabled",1,!1),t.EnableGemini3LowReasoningEffort=at("chat.gemini3LowReasoningEffort.enabled",1,!1),t.EnableGpt55ReadFileTool=at("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableChatImageUpload=at("chat.imageUpload.enabled",0,!0),t.AnthropicWebSearchToolEnabled=at("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=at("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=at("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=at("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=at("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=at("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=at("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=at("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=at("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=at("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=at("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=at("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=at("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=at("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=at("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=at("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=at("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=at("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=at("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=at("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=at("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=at("chat.scopeSelection",0,!1),t.EnableCodeActions=at("editor.enableCodeActions",0,!0),t.LocaleOverride=at("chat.localeOverride",0,"auto"),t.TerminalChatLocation=at("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=at("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=at("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=at("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=at("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=at("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=at("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=at("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=at("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=at("nextEditSuggestions.enabled",1,!0),t.CompletionsInChatEnabled=at("completions.chat.enabled",0,!1),t.InlineEditsEnableDiagnosticsProvider=at("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=at("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=at("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=at("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=at("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=at("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=at("chat.virtualTools.threshold",1,Wo.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=at("chat.agent.currentEditorContext.enabled",0,!0),t.PreferLongContext=at("chat.preferLongContext.enabled",0,!1),t.AutoFixDiagnostics=at("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=at("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=at("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=at("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=at("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=at("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableGemini35FlashReducedToolUsePrompt=at("chat.gemini35FlashReducedToolUsePrompt.enabled",1,!0),t.EnableOrganizationCustomAgents=at("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=at("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=at("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=at("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=at("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=at("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=at("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=at("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=at("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=at("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=at("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=at("chat.cloudAgentBackend.version",1,"v1"),t.AdditionalReadAccessPaths=at("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=at("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=at("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=at("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=at("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=at("chat.askAgent.model",0,""),t.ExploreAgentEnabled=at("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=at("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=at("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=at("chat.localIndex.enabled",1,!0),t.GrepSearchOutputFormat=at("chat.tools.grepSearch.outputFormat",1,"grep"),t.GrepSearchDefaultMaxResults=at("chat.tools.grepSearch.defaultMaxResults",1,20),t.GrepSearchMaxResultsCap=at("chat.tools.grepSearch.maxResultsCap",1,200)})(LTr||(Wo.ConfigKey=LTr={}));function IBa(){return Object.values(LTr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(IBa,"getAllConfigKeys");var xBa=[];function wBa(t){return xBa.push(t),t}a(wBa,"registerNextEditProviderId")});var Np=I(Ry=>{"use strict";p();Object.defineProperty(Ry,"__esModule",{value:!0});Ry.LogMemory=Ry.LogServiceImpl=Ry.ConsoleLog=Ry.LogTarget=Ry.LogLevel=Ry.ILogService=void 0;Ry.collectErrorMessages=kDi;Ry.collectSingleLineErrorMessage=PBa;Ry.sanitizeNetworkErrorForTelemetry=DBa;var RBa=an(),kBa=Po();Ry.ILogService=(0,RBa.createServiceIdentifier)("ILogService");var tE;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(tE||(Ry.LogLevel=tE={}));var RDi;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(RDi||(Ry.LogTarget=RDi={}));var FTr=class{static{a(this,"ConsoleLog")}constructor(e,r=tE.Warning){this.prefix=e,this.minLogLevel=r}logIt(e,r,...n){this.prefix&&(r=`${this.prefix}${r}`),e===tE.Error?console.error(r,...n):e===tE.Warning?console.warn(r,...n):e>=this.minLogLevel&&console.log(r,...n)}};Ry.ConsoleLog=FTr;var UTr=class extends kBa.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new QTr(e)}trace(e){this.logger.trace(e)}debug(e){this.logger.debug(e)}info(e){this.logger.info(e)}warn(e){this.logger.warn(e)}error(e,r){this.logger.error(e,r)}show(e){this.logger.show(e)}createSubLogger(e){return this.logger.createSubLogger(e)}withExtraTarget(e){return this.logger.withExtraTarget(e)}};Ry.LogServiceImpl=UTr;var QTr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){Gyt.addLog(tE[e],r),this._logTargets.forEach(n=>n.logIt(e,r))}trace(e){this._logIt(tE.Trace,e)}debug(e){this._logIt(tE.Debug,e)}info(e){this._logIt(tE.Info,e)}warn(e){this._logIt(tE.Warning,e)}error(e,r){this._logIt(tE.Error,kDi(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new qTr(this,e)}withExtraTarget(e){return new Hyt(this,[e])}},qTr=class t{static{a(this,"SubLogger")}constructor(e,r,n){this._parent=e;let s=(Array.isArray(r)?r:[r]).map(c=>`[${c}]`).join("");this._prefix=n?n+s:s}_prefixMessage(e){return`${this._prefix} ${e}`}trace(e){this._parent.trace(this._prefixMessage(e))}debug(e){this._parent.debug(this._prefixMessage(e))}info(e){this._parent.info(this._prefixMessage(e))}warn(e){this._parent.warn(this._prefixMessage(e))}error(e,r){let n=r?this._prefixMessage(r):this._prefix;this._parent.error(e,n)}show(e){this._parent.show(e)}createSubLogger(e){return new t(this._parent,e,this._prefix)}withExtraTarget(e){return new Hyt(this,[e],this._prefix)}},Hyt=class t{static{a(this,"LoggerWithExtraTargets")}constructor(e,r,n=""){this._parent=e,this._extraTargets=r,this._prefix=n}_notifyExtraTargets(e,r){let n=this._prefix?`${this._prefix} ${r}`:r;for(let o of this._extraTargets)try{o.logIt(e,n)}catch{}}trace(e){this._notifyExtraTargets(tE.Trace,e),this._parent.trace(e)}debug(e){this._notifyExtraTargets(tE.Debug,e),this._parent.debug(e)}info(e){this._notifyExtraTargets(tE.Info,e),this._parent.info(e)}warn(e){this._notifyExtraTargets(tE.Warning,e),this._parent.warn(e)}error(e,r){let n=typeof e=="string"?e:e.message||"Error",o=r?`${n}: ${r}`:n;this._notifyExtraTargets(tE.Error,o),this._parent.error(e,r)}show(e){this._parent.show(e);for(let r of this._extraTargets)try{r.show?.(e)}catch{}}createSubLogger(e){let r=Array.isArray(e)?e:[e],n=this._prefix+r.map(o=>`[${o}]`).join("");return new t(this._parent.createSubLogger(e),this._extraTargets,n)}withExtraTarget(e){return new t(this._parent,[...this._extraTargets,e],this._prefix)}};function kDi(t){let e=new Set;function r(n,o){if(!n||!["object","string"].includes(typeof n)||e.has(n))return"";e.add(n);let c=(typeof n=="string"?n:n.stack||n.message||n.code||"").toString?.()||"";return[c?`${c.split(` +`);return new iye.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new EDi.StringReplacement(n,r.text)}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}serialize(){return[this.lineRange.startLineNumber,this.lineRange.endLineNumberExclusive,this.newLines]}removeCommonSuffixPrefixLines(e){let r=this.lineRange.startLineNumber,n=this.lineRange.endLineNumberExclusive,o=0;for(;rtypeof n=="string")}a(e,"is"),t.is=e})(_Di||(k$.SerializedLineReplacement=_Di={}))});var qyt=I(oye=>{"use strict";p();Object.defineProperty(oye,"__esModule",{value:!0});oye.ArrayMap=oye.ResponseProcessor=void 0;var yBa=Os(),Fyt=P$(),Uyt=vD(),vDi;(function(t){t.DEFAULT_DIFF_PARAMS={emitFastCursorLineChange:"off",nSignificantLinesToConverge:2,nLinesToConverge:3};function e(l){return l===!0?"additiveOnly":l===!1?"off":l}a(e,"mapEmitFastCursorLineChange"),t.mapEmitFastCursorLineChange=e;async function*r(l,u,d,f){let h=new Qyt;for(let[y,_]of l.entries())h.add(_,y);let m=0,g=-1,A={k:"aligned"};for await(let y of u){if(++g,m>=l.length){switch(A.k){case"aligned":{A={k:"diverged",startLineIdx:m,newLines:[y]};break}case"diverged":A.newLines.push(y)}continue}if(A.k==="aligned"){if(l[m]===y){++m;continue}A={k:"diverged",startLineIdx:m,newLines:[]}}A.newLines.push(y);let _=c(l,d,h,A,m,f);_&&(yield _.singleLineEdit,m=_.convergenceEndIdx,A={k:"aligned"})}switch(A.k){case"diverged":{let y=new Uyt.LineRange(A.startLineIdx+1,l.length+1);yield new Fyt.LineReplacement(y,A.newLines);break}case"aligned":{if(mu.length)return!1;let d=0;for(let f=0;f[B,B]);if(A.length===0){if(m.emitFastCursorLineChange==="off"||h!==u||f.newLines.length>1)return;let B=l[h],q=f.newLines[0];if(B.trim()===""&&h+10&&v[0]-f.startLineIdx===f.newLines.length-1&&(E="found_significant_matches");g>=0&&(A=A.map(([B,q])=>[B,q-1]),A=A.filter(([B,q])=>q>=0&&h<=q),A=A.filter(([B,q])=>l[q]===f.newLines[g]),A.length!==0);--g)if(++y,n(f.newLines[g])&&++_,_===m.nSignificantLinesToConverge&&(E="found_significant_matches",v=A[0]),y===m.nLinesToConverge){E="found_matches",v=A[0];break}if(!E)return;let S=v[1],T=v[0],w=T-S+1,R=S-f.startLineIdx,x=f.newLines.slice(0,f.newLines.length-w),k=x.length;if(R-k>1&&k>0)return;let D=[f.startLineIdx,S],N=new Uyt.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new Fyt.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(vDi||(oye.ResponseProcessor=vDi={}));var Qyt=class{static{a(this,"ArrayMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n?n.push(r):this.map.set(e,[r])}get(e){return this.map.get(e)||[]}};oye.ArrayMap=Qyt});var bDi=I(jyt=>{"use strict";p();Object.defineProperty(jyt,"__esModule",{value:!0});jyt.AlternativeNotebookFormat=void 0;var CDi;(function(t){t.json="json",t.xml="xml",t.text="text"})(CDi||(jyt.AlternativeNotebookFormat=CDi={}))});var Hl=I(Wo=>{"use strict";p();var _Ba=Wo&&Wo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EBa=Wo&&Wo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oLe=Wo&&Wo.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{this._setUserInfo({isInternal:!!e.copilotToken?.isInternal})}))}getConfigMixedWithDefaults(e){if(e.options?.valueIgnoredForExternals&&!this._isInternal)return this.getDefaultValue(e);let r=this.getConfig(e);return r===void 0?this.getDefaultValue(e):SDi.isObject(r)&&SDi.isObject(e.defaultValue)?{...e.defaultValue,...r}:r}getDefaultValue(e){let r=this.getDefaultValueForConfig(e),n=r==null||r===!1||r===0||r==="";return e.defaultValue===void 0&&n?e.defaultValue:r!==void 0?r:e.defaultValue}_setUserInfo(e){if(this._isInternal===e.isInternal)return;let r=this._isInternal!==e.isInternal;this._isInternal=e.isInternal;let n=new Set;for(let o of Wo.globalConfigRegistry.configs.values())r&&o.options?.valueIgnoredForExternals&&n.add(o.fullyQualifiedId);n.size>0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a(o=>{for(let s of n)if(s===o||s.startsWith(o+".")||o.startsWith(s+"."))return!0;return!1},"affectsConfiguration")})}updateExperimentBasedConfiguration(e){e.length!==0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a(()=>!0,"affectsConfiguration")})}getConfigObservable(e){return this._getObservable_$show2FramesUp(e,()=>this.getConfig(e))}getExperimentBasedConfigObservable(e,r){return this._getObservable_$show2FramesUp(e,()=>this.getExperimentBasedConfig(e,r))}_getObservable_$show2FramesUp(e,r){let n=this.observables.get(e.id);return n||(n=(0,SBa.observableFromEventOpts)({debugName:a(()=>`Configuration Key "${e.id}"`,"debugName")},o=>this._register(this.onDidChangeConfiguration(s=>{s.affectsConfiguration(e.fullyQualifiedId)&&o(s)})),r),this.observables.set(e.id,n)),n}isConfigured(e,r){let n=this.inspectConfig(e,r);return n?.globalValue!==void 0||n?.globalLanguageValue!==void 0||n?.workspaceFolderValue!==void 0||n?.workspaceFolderLanguageValue!==void 0||n?.workspaceValue!==void 0||n?.workspaceLanguageValue!==void 0}getDefaultValueForConfig(e){}};Wo.AbstractConfigurationService=DTr;var Hyt;function xBa(){if(!Hyt){Hyt=new Map;let e=TBa.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)Hyt.set(n,r[n].default)}return Hyt}a(xBa,"getPackageJsonDefaults");function RDi(t,e,r){let n=`${Wo.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Wo.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=xBa(),c=s.has(n),l=s.get(n);if(c&&!bBa.equals(e,l))throw new PTr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new PTr.BugIndicatingError(`The setting ${t} is public, it therefore cannot be restricted to internal!`);let u=n.startsWith("github.copilot.advanced.")?n.substring(24):void 0;return{id:t,oldId:r?.oldKey,isPublic:c,fullyQualifiedId:n,fullyQualifiedOldId:o,advancedSubKey:u,defaultValue:e,options:r}}a(RDi,"toBaseConfig");var NTr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Wo.globalConfigRegistry=new NTr;var MTr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new kDi.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Wo.ConfigurationMigrationRegistry=new MTr;function at(t,e,r,n,o,s){if(e===1){let l={...RDi(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new PTr.BugIndicatingError("Shared settings cannot be experiment based");return Wo.globalConfigRegistry.registerConfig(l),l}let c={...RDi(t,r,o),configType:0,validator:n};return Wo.globalConfigRegistry.registerConfig(c),c}a(at,"defineSetting");function Ot(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?at(t,e,r,n,o):at(t,e,r,n,o,s)}a(Ot,"defineTeamInternalSetting");function FTr(t,e){Wo.ConfigurationMigrationRegistry.registerConfigurationMigrations([{key:`${Wo.CopilotConfigPrefix}.${e}`,migrateFn:a(async r=>[[`${Wo.CopilotConfigPrefix}.${t}`,{value:r}],[`${Wo.CopilotConfigPrefix}.${e}`,{value:void 0}]],"migrateFn")}])}a(FTr,"migrateSetting");function iA(t,e,r,n){return FTr(e,t),at(e,0,r,void 0,{...n,oldKey:t})}a(iA,"defineAndMigrateSetting");function Fg(t,e,r,n,o){return FTr(e,t),at(e,1,r,void 0,{...n,oldKey:t},o)}a(Fg,"defineAndMigrateExpSetting");Wo.HARD_TOOL_LIMIT=128;var OTr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(OTr||(Wo.AuthProviderId=OTr={}));var LTr;(function(t){t.Default="default",t.Minimal="minimal"})(LTr||(Wo.AuthPermissionMode=LTr={}));var iLe;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(iLe||(Wo.AzureAuthMode=iLe={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(iLe||(Wo.AzureAuthMode=iLe={}));Wo.XTabProviderId="XtabProvider";var BTr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=at("advanced.debug.overrideProxyUrl",0,void 0,void 0,{userScopeOnly:!0}),s.DebugOverrideAuthType=at("advanced.debug.overrideAuthType",0,"hmac"),s.DebugOverrideCAPIUrl=at("advanced.debug.overrideCapiUrl",0,void 0,void 0,{userScopeOnly:!0}),s.DebugUseNodeFetchFetcher=at("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=at("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=at("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=at("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=at("advanced.authProvider",0,OTr.GitHub),s.AuthPermissions=at("advanced.authPermissions",0,LTr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=at("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=at("chat.debug.promptOverrideFile",0,null),s.WorkspacePrototypeAdoCodeSearchEndpointOverride=iA("chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride","chat.workspace.prototypeAdoCodeSearchEndpointOverride",""),s.FeedbackOnChange=iA("chat.advanced.feedback.onChange","chat.feedback.onChange",!1),s.ReviewIntent=iA("chat.advanced.review.intent","chat.review.intent",!1),s.NotebookSummaryExperimentEnabled=iA("chat.advanced.notebook.summaryExperimentEnabled","chat.notebook.summaryExperimentEnabled",!1),s.NotebookVariableFilteringEnabled=iA("chat.advanced.notebook.variableFilteringEnabled","chat.notebook.variableFilteringEnabled",!1),s.TerminalToDebuggerPatterns=iA("chat.advanced.debugTerminalCommandPatterns","chat.debugTerminalCommandPatterns",[]),s.WorkspaceRecordingEnabled=iA("chat.advanced.localWorkspaceRecording.enabled","chat.localWorkspaceRecording.enabled",!1),s.EditRecordingEnabled=iA("chat.advanced.editRecording.enabled","chat.editRecording.enabled",!1),s.CodeSearchAgentEnabled=iA("chat.advanced.codesearch.agent.enabled","chat.codesearch.agent.enabled",!0),s.AgentTemperature=iA("chat.advanced.agent.temperature","chat.agent.temperature",void 0),s.EnableUserPreferences=iA("chat.advanced.enableUserPreferences","chat.enableUserPreferences",!1),s.SummarizeAgentConversationHistoryThreshold=iA("chat.advanced.summarizeAgentConversationHistoryThreshold","chat.summarizeAgentConversationHistoryThreshold",void 0),s.AgentHistorySummarizationMode=iA("chat.advanced.agentHistorySummarizationMode","chat.agentHistorySummarizationMode",void 0),s.UseResponsesApiTruncation=iA("chat.advanced.useResponsesApiTruncation","chat.useResponsesApiTruncation",!1),s.OmitBaseAgentInstructions=iA("chat.advanced.omitBaseAgentInstructions","chat.omitBaseAgentInstructions",!1),s.CLIShowExternalSessions=at("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=at("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=at("chat.cli.autoModel.enabled",0,!0),s.CLIModelDetailsEnabled=at("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=at("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=at("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=at("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=at("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=iA("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLISandboxEnabled=at("chat.cli.sandbox.enabled",1,"off"),s.CLIBranchSupport=at("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=at("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=at("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=at("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=at("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=at("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=at("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=at("chat.cli.terminalLinks.enabled",0,!0),s.CLISessionEventLoggingEnabled=at("chat.cli.sessionEventLogging.enabled",0,!1),s.RequestLoggerMaxEntries=iA("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=Fg("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=Fg("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=Fg("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=Fg("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=Fg("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=at("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=Fg("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=Fg("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",IBa.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=Fg("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=at("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=at("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=Fg("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=Fg("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=Fg("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=Fg("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=Fg("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=at("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=at("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=at("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=at("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=at("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=at("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=at("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=at("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=at("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=at("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=at("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=at("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=Fg("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=Fg("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=Fg("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=at("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=at("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=at("nextEditSuggestions.eagerness",1,Sl.AggressivenessSetting.Default,Sl.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=Fg("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=at("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=at("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=at("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=at("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=at("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=at("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=at("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=at("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=Fg("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=Fg("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=iA("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=at("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=at("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=at("chat.otel.enabled",0,!1),s.OTelExporterType=at("chat.otel.exporterType",0,"otlp-http"),s.OTelProtocol=at("chat.otel.protocol",0,""),s.OTelOtlpEndpoint=at("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=at("chat.otel.captureContent",0,!1),s.OTelServiceName=at("chat.otel.serviceName",0,""),s.OTelResourceAttributes=at("chat.otel.resourceAttributes",0,{}),s.OTelHeaders=at("chat.otel.headers",0,{}),s.OTelMaxAttributeSizeChars=at("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=at("chat.otel.outfile",0,""),s.OTelDbSpanExporter=at("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=at("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=at("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=at("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=at("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=at("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=at("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return FTr(l,c),at(l,0,null,Sl.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=Ot("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=Ot("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=Ot("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=Ot("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,wh.vBoolean)()),s.InlineEditsModelPickerEnabled=Ot("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,wh.vBoolean)()),s.InlineEditsUseSlashModels=Ot("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=Ot("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=Ot("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,wh.vBoolean)()),s.InlineEditsLogCancelledRequests=Ot("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,wh.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=Ot("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,wh.vString)()),s.InlineEditsNextCursorPredictionApiKey=Ot("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,wh.vString)()),s.InlineEditsXtabProviderUrl=Ot("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,wh.vString)()),s.InlineEditsXtabProviderApiKey=Ot("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,wh.vString)()),s.InlineEditsNextCursorPredictionLintOptions=Ot("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,Sl.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=Ot("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,wh.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=Ot("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,wh.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=Ot("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,wh.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=Ot("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,wh.vBoolean)()),s.InlineEditsXtabProviderPatchModelPredictionKind=Ot("chat.advanced.inlineEdits.xtabProvider.patchModelPredictionKind",1,Sl.PatchModelPrediction.FilePath,Sl.PatchModelPrediction.VALIDATOR),s.InlineEditsXtabProviderPatchFastYieldLineWithCursor=Ot("chat.advanced.inlineEdits.xtabProvider.patchFastYieldLineWithCursor",1,!0,(0,wh.vBoolean)()),s.InlineEditsXtabProviderPatchFastYieldLineWithCursorMultiLine=Ot("chat.advanced.inlineEdits.xtabProvider.patchFastYieldLineWithCursorMultiLine",1,!1,(0,wh.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=Ot("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,QD.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=Ot("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=Ot("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=Ot("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=Ot("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=Ot("chat.advanced.promptRenderer.trace",0,!1),s.DebugCollectFetcherTelemetry=Ot("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=Ot("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=Ot("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=Ot("chat.advanced.modelProviderPreference",0,void 0,(0,wh.vString)()),s.UseVSCodeTelemetryLibForGH=Ot("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=Ot("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=Ot("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=Ot("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=Ot("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsDebounceUseCoreRequestTime=Ot("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=Ot("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=Ot("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=Ot("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=Ot("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=Ot("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=Ot("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=Ot("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=Ot("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=Ot("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=Ot("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=Ot("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=Ot("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=Ot("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,1,(0,wh.vNumber)()),s.InlineEditsBackoffDebounceEnabled=Ot("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=Ot("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=Ot("chat.advanced.inlineEdits.speculativeRequests",1,QD.SpeculativeRequestsEnablement.Off,QD.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=Ot("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,QD.SpeculativeRequestsCursorPlacement.AfterEditApplied,QD.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=Ot("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,QD.SpeculativeRequestsAutoExpandEditWindowLines.Off,QD.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=Ot("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=Ot("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=Ot("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,IDi.DocumentSwitchTriggerStrategy.AfterAcceptance,IDi.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=Ot("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=Ot("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=Ot("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=Ot("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,wh.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=Ot("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=Ot("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=Ot("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=Ot("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=Ot("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=Ot("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=Ot("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=Ot("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=Ot("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,Sl.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=Ot("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,Sl.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=Ot("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,Sl.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=Ot("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,Sl.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=Ot("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,Sl.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=Ot("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,Sl.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=Ot("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,xDi.DiffHistoryMergeStrategy.SameStartLine,xDi.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=Ot("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,wh.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=Ot("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,wh.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=Ot("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=Ot("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,Sl.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=Ot("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,Sl.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,Sl.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove=Ot("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.useLeftoverBudgetFromAbove",1,Sl.DEFAULT_OPTIONS.recentlyViewedDocuments.useLeftoverBudgetFromAbove),s.InlineEditsXtabPageSize=Ot("chat.advanced.inlineEdits.xtabProvider.pageSize",1,Sl.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=Ot("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=Ot("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,Sl.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=Ot("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,Sl.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=Ot("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,Sl.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=Ot("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,Sl.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=Ot("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,Sl.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove=Ot("chat.advanced.inlineEdits.xtabProvider.currentFile.useLeftoverBudgetFromAbove",1,Sl.DEFAULT_OPTIONS.currentFile.useLeftoverBudgetFromAbove),s.InlineEditsXtabDiffOnlyForDocsInPrompt=Ot("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,Sl.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=Ot("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,Sl.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=Ot("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,wDi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=Ot("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,wDi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=Ot("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,QD.EarlyDivergenceCancellationMode.Off,QD.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=Ot("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,Sl.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=Ot("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,Sl.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=Ot("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,Sl.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=Ot("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,Sl.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudget=Ot("chat.advanced.inlineEdits.xtabProvider.globalBudget",1,void 0),s.InlineEditsXtabMaxMergeConflictLines=Ot("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=Ot("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=Ot("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,QD.DuplicateAdditionsMode.Off,QD.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabSplitPatchOnDiff=Ot("chat.advanced.inlineEdits.xtabProvider.diffPatch.splitOnDiff",1,!1,(0,wh.vBoolean)()),s.InlineEditsXtabAggressivenessLevel=Ot("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=Ot("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=Ot("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=Ot("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=Ot("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=Ot("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=Ot("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsIgnoreWhenSuggestVisible=Ot("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=Ot("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=Ot("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,TDi.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=Ot("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,TDi.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=Ot("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=Ot("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.InlineCompletionsDefaultDiagnosticsOptions=Ot("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=Ot("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=Ot("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=Ot("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=at("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=at("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=at("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=at("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=at("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=Ot("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=Ot("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=Ot("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=Ot("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=Ot("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=at("chat.planAgent.model",0,""),s.OllamaEndpoint=at("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=at("chat.azureModels",0,{}),s.CustomOAIModels=at("chat.customOAIModels",0,{}),s.AzureAuthType=at("chat.azureAuthType",0,iLe.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=at("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=at("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=at("chat.rateLimitAutoSwitchToAuto",0,!1,(0,wh.vBoolean)()),t.ConversationUsePrismCompaction=at("chat.conversationCompaction.usePrismCompaction",1,!1),t.ConversationCompactionModel=at("chat.conversationCompaction.model",1,""),t.ConversationPrismCompactionModelFilter=at("chat.conversationCompaction.prismModelFilter",1,"claude-haiku-4.5,claude-sonnet-4.5,claude-sonnet-4.6,gemini-2.5-pro,gemini-3-flash,gemini-3.5-flash"),t.UseAnthropicMessagesApi=at("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=at("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiContextManagementEnabled=at("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=at("chat.responsesApi.promptCacheKey.enabled",1,!1),t.ResponsesApiPromptCacheBreakpointEnabled=at("chat.responsesApi.promptCacheBreakpoint.enabled",1,!1),t.Updated53CodexPromptEnabled=at("chat.updated53CodexPrompt.enabled",1,!0),t.Claude48OpusPromptEnabled=at("chat.claude48OpusPrompt.enabled",1,!1),t.ClaudeSonnet5PromptEnabled=at("chat.claudeSonnet5Prompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=at("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=at("chat.gemini3GetChangedFilesTool.enabled",1,!1),t.EnableGemini3LowReasoningEffort=at("chat.gemini3LowReasoningEffort.enabled",1,!1),t.EnableGpt55ReadFileTool=at("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableChatImageUpload=at("chat.imageUpload.enabled",0,!0),t.AnthropicWebSearchToolEnabled=at("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=at("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=at("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=at("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=at("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=at("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=at("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=at("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=at("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=at("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=at("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=at("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=at("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=at("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=at("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=at("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=at("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=at("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=at("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=at("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=at("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=at("chat.scopeSelection",0,!1),t.EnableCodeActions=at("editor.enableCodeActions",0,!0),t.LocaleOverride=at("chat.localeOverride",0,"auto"),t.TerminalChatLocation=at("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=at("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=at("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=at("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=at("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=at("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=at("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=at("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=at("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=at("nextEditSuggestions.enabled",1,!0),t.CompletionsInChatEnabled=at("completions.chat.enabled",0,!1),t.InlineEditsEnableDiagnosticsProvider=at("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=at("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=at("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=at("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=at("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=at("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=at("chat.virtualTools.threshold",1,Wo.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=at("chat.agent.currentEditorContext.enabled",0,!0),t.PreferLongContext=at("chat.preferLongContext.enabled",0,!1),t.AutoFixDiagnostics=at("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=at("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=at("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=at("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=at("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=at("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableGemini35FlashReducedToolUsePrompt=at("chat.gemini35FlashReducedToolUsePrompt.enabled",1,!0),t.EnableOrganizationCustomAgents=at("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=at("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=at("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=at("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=at("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=at("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=at("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=at("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=at("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=at("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=at("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=at("chat.cloudAgentBackend.version",1,"v1"),t.AdditionalReadAccessPaths=at("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=at("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=at("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=at("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=at("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=at("chat.askAgent.model",0,""),t.ExploreAgentEnabled=at("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=at("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=at("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=at("chat.localIndex.enabled",1,!0),t.GrepSearchOutputFormat=at("chat.tools.grepSearch.outputFormat",1,"grep"),t.GrepSearchDefaultMaxResults=at("chat.tools.grepSearch.defaultMaxResults",1,20),t.GrepSearchMaxResultsCap=at("chat.tools.grepSearch.maxResultsCap",1,200)})(BTr||(Wo.ConfigKey=BTr={}));function wBa(){return Object.values(BTr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(wBa,"getAllConfigKeys");var RBa=[];function kBa(t){return RBa.push(t),t}a(kBa,"registerNextEditProviderId")});var Np=I(Ry=>{"use strict";p();Object.defineProperty(Ry,"__esModule",{value:!0});Ry.LogMemory=Ry.LogServiceImpl=Ry.ConsoleLog=Ry.LogTarget=Ry.LogLevel=Ry.ILogService=void 0;Ry.collectErrorMessages=DDi;Ry.collectSingleLineErrorMessage=NBa;Ry.sanitizeNetworkErrorForTelemetry=MBa;var PBa=an(),DBa=Po();Ry.ILogService=(0,PBa.createServiceIdentifier)("ILogService");var tE;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(tE||(Ry.LogLevel=tE={}));var PDi;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(PDi||(Ry.LogTarget=PDi={}));var UTr=class{static{a(this,"ConsoleLog")}constructor(e,r=tE.Warning){this.prefix=e,this.minLogLevel=r}logIt(e,r,...n){this.prefix&&(r=`${this.prefix}${r}`),e===tE.Error?console.error(r,...n):e===tE.Warning?console.warn(r,...n):e>=this.minLogLevel&&console.log(r,...n)}};Ry.ConsoleLog=UTr;var QTr=class extends DBa.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new qTr(e)}trace(e){this.logger.trace(e)}debug(e){this.logger.debug(e)}info(e){this.logger.info(e)}warn(e){this.logger.warn(e)}error(e,r){this.logger.error(e,r)}show(e){this.logger.show(e)}createSubLogger(e){return this.logger.createSubLogger(e)}withExtraTarget(e){return this.logger.withExtraTarget(e)}};Ry.LogServiceImpl=QTr;var qTr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){$yt.addLog(tE[e],r),this._logTargets.forEach(n=>n.logIt(e,r))}trace(e){this._logIt(tE.Trace,e)}debug(e){this._logIt(tE.Debug,e)}info(e){this._logIt(tE.Info,e)}warn(e){this._logIt(tE.Warning,e)}error(e,r){this._logIt(tE.Error,DDi(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new jTr(this,e)}withExtraTarget(e){return new Gyt(this,[e])}},jTr=class t{static{a(this,"SubLogger")}constructor(e,r,n){this._parent=e;let s=(Array.isArray(r)?r:[r]).map(c=>`[${c}]`).join("");this._prefix=n?n+s:s}_prefixMessage(e){return`${this._prefix} ${e}`}trace(e){this._parent.trace(this._prefixMessage(e))}debug(e){this._parent.debug(this._prefixMessage(e))}info(e){this._parent.info(this._prefixMessage(e))}warn(e){this._parent.warn(this._prefixMessage(e))}error(e,r){let n=r?this._prefixMessage(r):this._prefix;this._parent.error(e,n)}show(e){this._parent.show(e)}createSubLogger(e){return new t(this._parent,e,this._prefix)}withExtraTarget(e){return new Gyt(this,[e],this._prefix)}},Gyt=class t{static{a(this,"LoggerWithExtraTargets")}constructor(e,r,n=""){this._parent=e,this._extraTargets=r,this._prefix=n}_notifyExtraTargets(e,r){let n=this._prefix?`${this._prefix} ${r}`:r;for(let o of this._extraTargets)try{o.logIt(e,n)}catch{}}trace(e){this._notifyExtraTargets(tE.Trace,e),this._parent.trace(e)}debug(e){this._notifyExtraTargets(tE.Debug,e),this._parent.debug(e)}info(e){this._notifyExtraTargets(tE.Info,e),this._parent.info(e)}warn(e){this._notifyExtraTargets(tE.Warning,e),this._parent.warn(e)}error(e,r){let n=typeof e=="string"?e:e.message||"Error",o=r?`${n}: ${r}`:n;this._notifyExtraTargets(tE.Error,o),this._parent.error(e,r)}show(e){this._parent.show(e);for(let r of this._extraTargets)try{r.show?.(e)}catch{}}createSubLogger(e){let r=Array.isArray(e)?e:[e],n=this._prefix+r.map(o=>`[${o}]`).join("");return new t(this._parent.createSubLogger(e),this._extraTargets,n)}withExtraTarget(e){return new t(this._parent,[...this._extraTargets,e],this._prefix)}};function DDi(t){let e=new Set;function r(n,o){if(!n||!["object","string"].includes(typeof n)||e.has(n))return"";e.add(n);let c=(typeof n=="string"?n:n.stack||n.message||n.code||"").toString?.()||"";return[c?`${c.split(` `).map(l=>`${o}${l}`).join(` `)} -`:"",n.chromiumDetails?`${o}${JSON.stringify(PDi(n.chromiumDetails))} -`:"",r(n.cause,o+" "),...Array.isArray(n.errors)?n.errors.map(l=>r(l,o+" ")):[]].join("")}return a(r,"collect"),r(t,"").trim()}a(kDi,"collectErrorMessages");function PBa(t,e=!1){let r=new Set;function n(o){if(!o||!["object","string"].includes(typeof o)||r.has(o))return"";r.add(o);let l=((typeof o=="string"?o:o.message||o.code||"").toString?.()||"").trim().split(` -`).join(" "),u=[...e&&o.chromiumDetails?[JSON.stringify(PDi(o.chromiumDetails))]:[],...o.cause?[n(o.cause)]:[],...Array.isArray(o.errors)?o.errors.map(d=>n(d)):[]].join(", ");return u?`${l}: ${u}`:l}return a(n,"collect"),n(t)}a(PBa,"collectSingleLineErrorMessage");function DBa(t){return t=t.replace(/(\b(?:PROXY|HTTPS?|SOCKS[45]?)\s+)[^\s]+@([^\s:\/]+)/gi,"$1@"),t=t.replace(/(\b(?:PROXY|HTTPS?|SOCKS[45]?)\s+)([a-zA-Z0-9][-a-zA-Z0-9.]*)/gi,"$1"),t=t.replace(/(\/\/)[^\s/]+@([^\s:\/]+)/g,"$1@"),t=t.replace(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,""),t=t.replace(/(?"),t=t.replace(/(?"),t=t.replace(/\b([a-zA-Z0-9][-a-zA-Z0-9]*\.)+[a-zA-Z]{2,}\b/g,""),t}a(DBa,"sanitizeNetworkErrorForTelemetry");function PDi(t){if(!t||typeof t!="object")return{};if(t.is_request_error!==void 0&&t.session_state===void 0)return{is_request_error:t.is_request_error,network_process_crashed:t.network_process_crashed};let e={drain_error:t.drain_error,drain_description:t.drain_description,go_away_error:t.go_away_error,go_away_error_details:t.go_away_error_details,go_away_debug_data:t.go_away_debug_data,rst_stream_error:t.rst_stream_error,rst_stream_error_details:t.rst_stream_error_details,rst_stream_description:t.rst_stream_description,last_framer_error:t.last_framer_error,last_framer_error_details:t.last_framer_error_details,error_source:t.error_source,aliases_length:Array.isArray(t.aliases)?t.aliases.length:void 0};if(t.proxy){let n=[...String(t.proxy).matchAll(/([a-z][a-z0-9+.-]*):\/\//gi)].map(o=>o[1]);n.length>0&&(e.proxy_schemes=n)}if(t.in_flight_write&&typeof t.in_flight_write=="object"&&(e.in_flight_write={frame_type:t.in_flight_write.frame_type,frame_size:t.in_flight_write.frame_size,remaining_size:t.in_flight_write.remaining_size}),t.buffered_spdy_framer&&typeof t.buffered_spdy_framer=="object"&&(e.buffered_spdy_framer={frames_received:t.buffered_spdy_framer.frames_received,has_error:t.buffered_spdy_framer.has_error,message_fully_read:t.buffered_spdy_framer.message_fully_read}),t.session_state&&typeof t.session_state=="object"){let r=t.session_state;e.session_state={availability_state:r.availability_state,session_send_window:r.session_send_window,session_recv_window:r.session_recv_window,stream_initial_send_window:r.stream_initial_send_window,stream_initial_recv_window:r.stream_initial_recv_window,send_stalled_by_session_window:r.send_stalled_by_session_window,active_stream_count:r.active_stream_count,created_stream_count:r.created_stream_count,max_concurrent_streams:r.max_concurrent_streams,highest_stream_id_sent:r.highest_stream_id_sent,frames_sent:r.frames_sent,frames_received:r.frames_received,ping_in_flight:r.ping_in_flight,last_ping_sent_ms:r.last_ping_sent_ms,next_ping_id:r.next_ping_id,failed_ping_count:r.failed_ping_count,support_websocket:r.support_websocket,deprecate_http2_priorities:r.deprecate_http2_priorities,streams_initiated_count:r.streams_initiated_count,streams_abandoned_count:r.streams_abandoned_count,read_state:r.read_state,write_state:r.write_state,pending_create_stream_request_count:r.pending_create_stream_request_count,error:r.error,error_on_unavailable:r.error_on_unavailable,unacked_recv_window_bytes:r.unacked_recv_window_bytes,last_good_stream_id:r.last_good_stream_id,debug_stream_id:r.debug_stream_id,has_ping_based_connection_checking:r.has_ping_based_connection_checking,num_broken_connection_detection_requests:r.num_broken_connection_detection_requests,session_max_queued_capped_frames:r.session_max_queued_capped_frames,num_queued_capped_frames:r.num_queued_capped_frames,check_ping_status_pending:r.check_ping_status_pending,in_confirm_handshake:r.in_confirm_handshake,http2_end_stream_with_data_frame:r.http2_end_stream_with_data_frame,reused:r.reused,session_max_recv_window_size:r.session_max_recv_window_size,max_header_table_size:r.max_header_table_size,time_since_last_read_ms:r.time_since_last_read_ms,time_since_last_write_ms:r.time_since_last_write_ms,time_since_last_recv_window_update_ms:r.time_since_last_recv_window_update_ms}}if(t.tls_info&&typeof t.tls_info=="object"){let r=t.tls_info;e.tls_info={is_secure_connection:r.is_secure_connection,ssl_version:r.ssl_version,cipher_suite:r.cipher_suite,negotiated_alpn:r.negotiated_alpn,cert_status:r.cert_status,is_issued_by_known_root:r.is_issued_by_known_root,handshake_type:r.handshake_type,client_cert_sent:r.client_cert_sent,exchange_group:r.key_exchange_group,ct_compliance:r.ct_compliance,alps_negotiated:r.alps_negotiated}}if(t.socket_info&&typeof t.socket_info=="object"){let r=t.socket_info;e.socket_info={is_connected:r.is_connected,was_ever_used:r.was_ever_used,dns_lookup_duration_ms:r.dns_lookup_duration_ms,tcp_connect_duration_ms:r.tcp_connect_duration_ms,ssl_handshake_duration_ms:r.ssl_handshake_duration_ms,owned_socket:r.owned_socket,socket_reuse_type:r.socket_reuse_type}}return t.url_loader_error&&typeof t.url_loader_error=="object"&&(e.url_loader_error={is_request_error:t.url_loader_error.is_request_error,network_process_crashed:t.url_loader_error.network_process_crashed}),Array.isArray(t.active_stream_details)&&(e.active_stream_details=t.active_stream_details.map(r=>({stream_id:r.stream_id,io_state:r.io_state,type:r.type,priority:r.priority,send_window_size:r.send_window_size,recv_window_size:r.recv_window_size,max_recv_window_size:r.max_recv_window_size,unacked_recv_window_bytes:r.unacked_recv_window_bytes,send_stalled_by_flow_control:r.send_stalled_by_flow_control,raw_sent_bytes:r.raw_sent_bytes,raw_received_bytes:r.raw_received_bytes,recv_bytes:r.recv_bytes,pending_send_status:r.pending_send_status,response_state:r.response_state,pending_send_data_remaining:r.pending_send_data_remaining,request_time_ms:r.request_time_ms,response_time_ms:r.response_time_ms}))),Array.isArray(t.closed_stream_details)&&(e.closed_stream_details=t.closed_stream_details.map(r=>({stream_id:r.stream_id,io_state:r.io_state,type:r.type,priority:r.priority,send_window_size:r.send_window_size,recv_window_size:r.recv_window_size,max_recv_window_size:r.max_recv_window_size,unacked_recv_window_bytes:r.unacked_recv_window_bytes,send_stalled_by_flow_control:r.send_stalled_by_flow_control,raw_sent_bytes:r.raw_sent_bytes,raw_received_bytes:r.raw_received_bytes,recv_bytes:r.recv_bytes,pending_send_status:r.pending_send_status,response_state:r.response_state,pending_send_data_remaining:r.pending_send_data_remaining,request_time_ms:r.request_time_ms,response_time_ms:r.response_time_ms}))),e}a(PDi,"extractChromiumDetails");var Gyt=class{static{a(this,"LogMemory")}static{this._logs=[]}static{this._requestIds=[]}static{this.MAX_LOGS=50}static extractRequestIdFromMessage(e){let r=e.match(/request done: requestId: \[([0-9a-fA-F-]+)\] model deployment ID: \[/);if(r){let n=r[1];if(!this._requestIds.includes(n))return n}}static addLog(e,r){this._logs.length>=this.MAX_LOGS&&this._logs.shift(),this._logs.push(`${e}: ${r}`),this._requestIds.length>=this.MAX_LOGS&&this._requestIds.shift();let n=this.extractRequestIdFromMessage(r);n&&this._requestIds.push(n)}static getLogs(){return this._logs}static getRequestIds(){return this._requestIds}};Ry.LogMemory=Gyt});var aLe=I(sLe=>{"use strict";p();Object.defineProperty(sLe,"__esModule",{value:!0});sLe.ICopilotTokenManager=void 0;sLe.nowSeconds=MBa;var NBa=an();sLe.ICopilotTokenManager=(0,NBa.createServiceIdentifier)("ICopilotTokenManager");function MBa(){return Math.floor(Date.now()/1e3)}a(MBa,"nowSeconds")});var rE=I(Lm=>{"use strict";p();var OBa=Lm&&Lm.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},$yt=Lm&&Lm.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Lm,"__esModule",{value:!0});Lm.BaseAuthenticationService=Lm.IAuthenticationService=Lm.MinimalModeError=Lm.GITHUB_SCOPE_ALIGNED=Lm.GITHUB_SCOPE_READ_USER=Lm.GITHUB_SCOPE_USER_EMAIL=void 0;Lm.authProviderId=jBa;var LBa=an(),Vyt=Fc(),BBa=Po(),FBa=o6(),gre=Hl(),UBa=Np(),QBa=aLe(),qBa=zG();Lm.GITHUB_SCOPE_USER_EMAIL=["user:email"];Lm.GITHUB_SCOPE_READ_USER=["read:user"];Lm.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var jTr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};Lm.MinimalModeError=jTr;Lm.IAuthenticationService=(0,LBa.createServiceIdentifier)("IAuthenticationService");var HTr=class extends BBa.Disposable{static{a(this,"BaseAuthenticationService")}fireAuthenticationChange(e){let r=!!this.copilotToken;this._logService.info(`AuthenticationService: firing onDidAuthenticationChange from ${e}. Has token: ${r}`),this._onDidAuthenticationChange.fire()}fireCopilotTokenChange(e){this._logService.debug(`AuthenticationService: firing onDidCopilotTokenChange from ${e}.`),this._onDidCopilotTokenChange.fire()}constructor(e,r,n,o){super(),this._logService=e,this._tokenStore=r,this._tokenManager=n,this._configurationService=o,this._onDidAuthenticationChange=this._register(new Vyt.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidCopilotTokenChange=this._register(new Vyt.Emitter),this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event,this._onDidAccessTokenChange=this._register(new Vyt.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new Vyt.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,FBa.derived)(s=>this._configurationService.getConfigObservable(gre.ConfigKey.Shared.AuthPermissions).read(s)===gre.AuthPermissionMode.Minimal),this._register(n.onDidCopilotTokenRefresh(()=>{this._logService.debug("Handling CopilotToken refresh."),this._handleAuthChangeEvent()}))}get isMinimalMode(){return this._isMinimalMode.get()}get anyGitHubSession(){return this._anyGitHubSession}get hasCopilotTokenSource(){return!!this._anyGitHubSession}get permissiveGitHubSession(){return this._permissiveGitHubSession}get anyAdoSession(){return this._anyAdoSession}get copilotToken(){return this._tokenStore.copilotToken}async getCopilotToken(e){try{let r=this._tokenStore.copilotToken,n=await this._tokenManager.getCopilotToken(e);return this._tokenStore.copilotToken=n,this._copilotTokenError=void 0,r?.token!==n.token&&this.fireCopilotTokenChange("getCopilotToken"),n}catch(r){let n=this._tokenStore.copilotToken;this._tokenStore.copilotToken=void 0;let o=this._copilotTokenError;throw this._copilotTokenError=r,n?this.fireCopilotTokenChange("getCopilotToken token lost"):o&&r&&o.message!==r.message&&this.fireCopilotTokenChange("getCopilotToken error change"),r}}resetCopilotToken(e){let r=!!this._tokenStore.copilotToken;this._tokenStore.copilotToken=void 0,this._tokenManager.resetCopilotToken(e),r&&this.fireCopilotTokenChange("resetCopilotToken")}async _handleAuthChangeEvent(){let e=this._anyGitHubSession,r=this._permissiveGitHubSession,n=this._anyAdoSession,o=await Promise.allSettled([this.getGitHubSession("any",{silent:!0}),this.getGitHubSession("permissive",{silent:!0}),this.getAnyAdoSession({silent:!0})]);for(let s of o)s.status==="rejected"&&this._logService.error(`Error getting a session: ${s.reason}`);if(e?.accessToken!==this._anyGitHubSession?.accessToken||r?.accessToken!==this._permissiveGitHubSession?.accessToken){this._onDidAccessTokenChange.fire(),this._logService.debug("Auth state changed (identity change), minting a new CopilotToken...");try{await this.getCopilotToken(!0)}catch{}this._logService.debug("Minted a new CopilotToken."),this.fireAuthenticationChange("handleAuthChangeEvent identity change");return}n?.accessToken!==this._anyAdoSession?.accessToken&&(this._logService.debug(`Ado auth state changed, firing event. Had token before: ${!!n?.accessToken}. Has token now: ${!!this._anyAdoSession?.accessToken}.`),this._onDidAdoAuthenticationChange.fire());try{await this.getCopilotToken()}catch{}this._logService.debug("Finished handling auth change event.")}};Lm.BaseAuthenticationService=HTr;Lm.BaseAuthenticationService=HTr=OBa([$yt(0,UBa.ILogService),$yt(1,qBa.ICopilotTokenStore),$yt(2,QBa.ICopilotTokenManager),$yt(3,gre.IConfigurationService)],HTr);function jBa(t){return t.getConfig(gre.ConfigKey.Shared.AuthProvider)===gre.AuthProviderId.GitHubEnterprise?gre.AuthProviderId.GitHubEnterprise:gre.AuthProviderId.GitHub}a(jBa,"authProviderId")});var Wyt=I(GTr=>{"use strict";p();Object.defineProperty(GTr,"__esModule",{value:!0});GTr.onCopilotToken=HBa;function HBa(t,e){return t.onDidCopilotTokenChange(()=>{let r=t.copilotToken;r&&e(r)})}a(HBa,"onCopilotToken")});var VTr=I(qD=>{"use strict";p();var GBa=qD&&qD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},$Ba=qD&&qD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(qD,"__esModule",{value:!0});qD.TelemetryUserConfig=qD.ICompletionsTelemetryUserConfigService=void 0;var VBa=rE(),WBa=an(),zBa=Po(),YBa=Wyt();function KBa(t){let e=t.getTokenValue("tid"),r=t.organizationList,n=t.enterpriseList,o=t.getTokenValue("sku");if(!e)return;let s={copilot_trackingId:e};return r&&(s.organizations_list=r.toString()),n&&(s.enterprise_list=n.toString()),o&&(s.sku=o),s}a(KBa,"propertiesFromCopilotToken");qD.ICompletionsTelemetryUserConfigService=(0,WBa.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var $Tr=class extends zBa.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,YBa.onCopilotToken)(e,n=>this.updateFromToken(n)));let r=e.copilotToken;r&&this.updateFromToken(r)}getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=KBa(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};qD.TelemetryUserConfig=$Tr;qD.TelemetryUserConfig=$Tr=GBa([$Ba(0,VBa.IAuthenticationService)],$Tr)});var cLe=I(sye=>{"use strict";p();Object.defineProperty(sye,"__esModule",{value:!0});sye.PromiseQueue=sye.ICompletionsPromiseQueueService=void 0;var JBa=an();sye.ICompletionsPromiseQueueService=(0,JBa.createServiceIdentifier)("completionsPromiseQueueService");var WTr=class{static{a(this,"PromiseQueue")}constructor(){this.promises=new Set}register(e){this.promises.add(e),e.finally(()=>this.promises.delete(e))}async flush(){await Promise.allSettled(this.promises)}};sye.PromiseQueue=WTr});var nA=I(Rd=>{"use strict";p();Object.defineProperty(Rd,"__esModule",{value:!0});Rd.TelemetryReporters=Rd.ICompletionsTelemetryReporters=Rd.CopilotTelemetryReporter=Rd.TelemetryWithExp=Rd.TelemetryData=Rd.TelemetryStore=void 0;Rd.telemetrizePromptLength=l3a;Rd.now=cye;Rd.telemetry=rIr;Rd.telemetryExpProblem=f3a;Rd.telemetryRaw=h3a;Rd.telemetryException=MDi;Rd.telemetryCatch=m3a;Rd.telemetryError=g3a;Rd.logEngineCompletion=y3a;Rd.logEnginePrompt=_3a;var ZBa=FD(),XBa=an(),e3a=Og(),JTr=Ks(),zyt=Are(),EL=eE(),t3a=hyt(),r3a=xy(),n3a=gyt(),i3a=vTr(),ZTr=VTr(),XTr=cLe(),CI;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(CI||(Rd.TelemetryStore=CI={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(CI||(Rd.TelemetryStore=CI={}));function aye(t){return t===CI.Enhanced}a(aye,"isEnhanced");var o3a=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],lLe=8192,s3a=21,vL=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[i3a.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},cye())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=cye())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(r3a.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(ZBa.IEnvService),n=e.get(EL.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,EL.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,EL.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${EL.BuildInfo.getVersion()}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`),this.properties.common_extname=n.getEditorPluginInfo().name,this.properties.common_extversion=n.getEditorPluginInfo().version,this.properties.common_vscodeversion=(0,EL.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,EL.dumpForTelemetry)(e);r["copilot.build"]=EL.BuildInfo.getBuild(),r["copilot.buildType"]=EL.BuildInfo.getBuildType(),this.properties={...this.properties,...r}}extendWithRequestId(e){let r={headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetry=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromProperties(e,r){if(aye(e))return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetry.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements);for(let e in this.measurements)isNaN(this.measurements[e])&&delete this.measurements[e]}multiplexProperties(){this.properties=t.multiplexProperties(this.properties)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}static multiplexProperties(e){let r={...e};for(let n in e){let o=e[n],s=o?.length??0;if(s>lLe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+lLe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(l3a,"telemetrizePromptLength");function cye(){return performance.now()}a(cye,"now");function u3a(t){return Math.floor(t/1e3)}a(u3a,"nowSeconds");function tIr(t){return t.get(ZTr.ICompletionsTelemetryUserConfigService).optedIn}a(tIr,"shouldSendEnhanced");function DDi(t){return t.get(ZTr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(DDi,"shouldSendFinetuningTelemetry");function rIr(t,e,r,n){return t.get(XTr.ICompletionsPromiseQueueService).register(d3a(t,e,cye(),r?.extendedBy(),n))}a(rIr,"telemetry");async function d3a(t,e,r,n,o=CI.Standard){let s=t.get(zyt.ICompletionsTelemetryService),c=t.get(JTr.IInstantiationService),l=n||vL.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!aye(o)||c.invokeFunction(tIr))&&eIr(s,o,e,l),aye(o)&&o3a.includes(e)&&c.invokeFunction(DDi)&&c.invokeFunction(c3a,o,e,l)}a(d3a,"_telemetry");function f3a(t,e){return t.get(XTr.ICompletionsPromiseQueueService).register(p3a(t,e,cye()))}a(f3a,"telemetryExpProblem");async function p3a(t,e,r){let n=t.get(zyt.ICompletionsTelemetryService),o="expProblem",s=vL.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,CI.Standard,"SkipExp",r),eIr(n,CI.Standard,o,s)}a(p3a,"_telemetryExpProblem");function h3a(t,e,r,n){let o=t.get(zyt.ICompletionsTelemetryService),s={...r,...NDi(t)};eIr(o,CI.Standard,e,{properties:s,measurements:n})}a(h3a,"telemetryRaw");function NDi(t){let e=t.get(EL.ICompletionsEditorAndPluginInfo),r={unique_id:(0,e3a.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,EL.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(ZTr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(NDi,"createRequiredProperties");function MDi(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(MDi,"telemetryException");function m3a(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){MDi(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(m3a,"telemetryCatch");function g3a(t,e,r,n){return t.get(XTr.ICompletionsPromiseQueueService).register(A3a(t,e,cye(),r?.extendedBy(),n))}a(g3a,"telemetryError");async function A3a(t,e,r,n,o=CI.Standard){if(aye(o)&&!tIr(t))return;let s=t.get(JTr.IInstantiationService),c=n||vL.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(a3a,o,e,c)}a(A3a,"_telemetryError");function y3a(t,e,r,n,o){let s=vL.createAndMarkAsIssued({completionTextJson:JSON.stringify(e),choiceIndex:o.toString()});if(r.logprobs)for(let[c,l]of Object.entries(r.logprobs))s.properties["logprobs_"+c]=JSON.stringify(l)??"unset";return s.extendWithRequestId(n),rIr(t,"engine.completion",s,CI.Enhanced)}a(y3a,"logEngineCompletion");function _3a(t,e,r){let n={promptJson:JSON.stringify({prefix:e.prefix,context:e.context}),promptSuffixJson:JSON.stringify(e.suffix)};if(e.context){let s=r.properties["request.option.extra"]?JSON.parse(r.properties["request.option.extra"]):{};s.context=e.context,n["request.option.extra"]=JSON.stringify(s)}let o=r.extendedBy(n);return rIr(t,"engine.prompt",o,CI.Enhanced)}a(_3a,"logEnginePrompt");var YTr=class{static{a(this,"CopilotTelemetryReporter")}};Rd.CopilotTelemetryReporter=YTr;Rd.ICompletionsTelemetryReporters=(0,XBa.createServiceIdentifier)("ICompletionsTelemetryReporters");var KTr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=CI.Standard){return aye(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(tIr(e))return this.reporterEnhanced}getFTReporter(e){}setReporter(e){this.reporter=e}setEnhancedReporter(e){this.reporterEnhanced=e}setFTReporter(e){this.reporterFT=e}async deactivate(){let e=[this.reporter,this.reporterEnhanced,this.reporterFT];this.reporter=this.reporterEnhanced=this.reporterFT=void 0,await Promise.all(e.map(r=>r?.dispose()))}};Rd.TelemetryReporters=KTr});var Are=I(jD=>{"use strict";p();var E3a=jD&&jD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},v3a=jD&&jD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jD,"__esModule",{value:!0});jD.CompletionsTelemetryServiceBridge=jD.ICompletionsTelemetryService=void 0;var C3a=bh(),nIr=fTr(),b3a=an(),uLe=nA();jD.ICompletionsTelemetryService=(0,b3a.createServiceIdentifier)("completionsTelemetryService");var iIr=class{static{a(this,"CompletionsTelemetryServiceBridge")}constructor(e){this.telemetryService=e,this.reporter=void 0,this.enhancedReporter=void 0}sendGHTelemetryEvent(e,r,n,o){this.telemetryService.sendGHTelemetryEvent((0,nIr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??uLe.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,nIr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??uLe.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,nIr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??uLe.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??uLe.TelemetryStore.Enhanced)?.sendTelemetryException(e,void 0,void 0)}setSpyReporters(e,r){this.reporter=e,this.enhancedReporter=r}clearSpyReporters(){this.reporter=void 0,this.enhancedReporter=void 0}getSpyReporters(e){return uLe.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};jD.CompletionsTelemetryServiceBridge=iIr;jD.CompletionsTelemetryServiceBridge=iIr=E3a([v3a(0,C3a.ITelemetryService)],iIr)});var ODi=I(lye=>{"use strict";p();Object.defineProperty(lye,"__esModule",{value:!0});lye.CopilotExtensionStatus=lye.ICompletionsExtensionStatus=void 0;var S3a=an();lye.ICompletionsExtensionStatus=(0,S3a.createServiceIdentifier)("ICompletionsExtensionStatus");var oIr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};lye.CopilotExtensionStatus=oIr});var Yyt=I(HD=>{"use strict";p();Object.defineProperty(HD,"__esModule",{value:!0});HD.CopilotToken=void 0;HD.containsInternalOrg=LDi;HD.containsVSCodeOrg=UDi;HD.validateTokenEnvelope=QDi;HD.isTokenEnvelope=k3a;HD.isErrorEnvelope=P3a;HD.isStandardErrorEnvelope=D3a;HD.createTestExtendedTokenInfo=N3a;var Gn=I$();function LDi(t){return BDi(t)||FDi(t)}a(LDi,"containsInternalOrg");function BDi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(BDi,"containsGitHubOrg");function FDi(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(FDi,"containsMicrosoftOrg");function UDi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(UDi,"containsVSCodeOrg");var sIr=class{static{a(this,"CopilotToken")}constructor(e){this._info=e,this.tokenMap=this.parseToken(e.token)}parseToken(e){let r=new Map,o=e?.split(":")[0]?.split(";");for(let s of o){let[c,l]=s.split("=");r.set(c,l)}return r}get token(){return this._info.token}get sku(){return this._info.sku}get isIndividual(){return this._info.individual??!1}get organizationList(){return this._info.organization_list||[]}get organizationLoginList(){return this._info.organization_login_list||[]}get enterpriseList(){return this._info.enterprise_list||[]}get endpoints(){return this._info.endpoints}get isInternal(){return LDi(this.organizationList)}get isMicrosoftInternal(){return FDi(this.organizationList)}get isGitHubInternal(){return BDi(this.organizationList)}get isFreeUser(){return this.sku==="free_limited_copilot"}get isNoAuthUser(){return this.sku==="no_auth_limited_copilot"}get isManagedPlan(){let e=this.copilotPlan;return e==="business"||e==="enterprise"}get isUsageBasedBilling(){return this._info.token_based_billing===!0}get isChatQuotaExceeded(){return this.isFreeUser&&(this._info.limited_user_quotas?.chat??1)<=0}get isCompletionsQuotaExceeded(){return this.isFreeUser&&(this._info.limited_user_quotas?.completions??1)<=0}get codeQuoteEnabled(){return this._info.code_quote_enabled??!1}get isVscodeTeamMember(){return this._info.isVscodeTeamMember||UDi(this.organizationList)}get codexAgentEnabled(){return this._info.codex_agent_enabled??!1}get copilotPlan(){if(this.isFreeUser)return"free";let e=this._info.copilot_plan;switch(e){case"individual":case"individual_pro":case"individual_max":case"business":case"enterprise":return e;default:return"individual"}}get rawCopilotPlan(){return this.isFreeUser?"free":this._info.copilot_plan??"individual"}get quotaInfo(){return{quota_snapshots:this._info.quota_snapshots,quota_reset_date:this._info.quota_reset_date}}get tokenBasedBilling(){return this._info.token_based_billing}get username(){return this._info.username}isTelemetryEnabled(){return this._isTelemetryEnabled===void 0&&(this._isTelemetryEnabled=this._info.telemetry==="enabled"),this._isTelemetryEnabled}isPublicSuggestionsEnabled(){return this._isPublicSuggestionsEnabled===void 0&&(this._isPublicSuggestionsEnabled=this._info.public_suggestions==="enabled"),this._isPublicSuggestionsEnabled}isCopilotIgnoreEnabled(){return this._info.copilotignore_enabled??!1}get isCopilotCodeReviewEnabled(){return this._info.code_review_enabled??this.getTokenValue("ccr")==="1"}isEditorPreviewFeaturesEnabled(){return this.getTokenValue("editor_preview_features")!=="0"}isBlackbirdExternalIndexingEnabled(){return this.getTokenValue("blackbird_external_indexing")==="1"}isMcpEnabled(){return this.getTokenValue("mcp")!=="0"}isClientBYOKEnabled(){return this.getTokenValue("client_byok")==="1"}getTokenValue(e){return this.tokenMap.get(e)}isExpandedClientSideIndexingEnabled(){return this._info.blackbird_clientside_indexing===!0}isFcv1(){return this.tokenMap.get("fcv1")==="1"}isSn(){return this.tokenMap.get("sn")==="1"}};HD.CopilotToken=sIr;var T3a=(0,Gn.vObj)({message:(0,Gn.vRequired)((0,Gn.vString)()),notification_id:(0,Gn.vRequired)((0,Gn.vString)()),title:(0,Gn.vRequired)((0,Gn.vString)()),url:(0,Gn.vRequired)((0,Gn.vString)())}),I3a=(0,Gn.vObj)({can_signup_for_limited:(0,Gn.vNullable)((0,Gn.vBoolean)()),error_details:(0,Gn.vRequired)(T3a),message:(0,Gn.vRequired)((0,Gn.vString)()),reason:(0,Gn.vString)()}),x3a=(0,Gn.vObj)({token:(0,Gn.vRequired)((0,Gn.vString)()),expires_at:(0,Gn.vRequired)((0,Gn.vNumber)()),refresh_in:(0,Gn.vRequired)((0,Gn.vNumber)()),sku:(0,Gn.vString)(),individual:(0,Gn.vBoolean)(),blackbird_clientside_indexing:(0,Gn.vBoolean)(),code_quote_enabled:(0,Gn.vBoolean)(),code_review_enabled:(0,Gn.vBoolean)(),codesearch:(0,Gn.vBoolean)(),copilotignore_enabled:(0,Gn.vBoolean)(),public_suggestions:(0,Gn.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Gn.vEnum)("enabled","disabled"),endpoints:(0,Gn.vObj)({api:(0,Gn.vString)(),"origin-tracker":(0,Gn.vString)(),proxy:(0,Gn.vString)(),telemetry:(0,Gn.vString)()}),enterprise_list:(0,Gn.vNullable)((0,Gn.vArray)((0,Gn.vNumber)())),limited_user_quotas:(0,Gn.vNullable)((0,Gn.vObj)({chat:(0,Gn.vRequired)((0,Gn.vNumber)()),completions:(0,Gn.vRequired)((0,Gn.vNumber)())})),limited_user_reset_date:(0,Gn.vNullable)((0,Gn.vNumber)()),organization_list:(0,Gn.vArray)((0,Gn.vString)())}),w3a=(0,Gn.vObj)({message:(0,Gn.vRequired)((0,Gn.vString)()),documentation_url:(0,Gn.vRequired)((0,Gn.vString)()),status:(0,Gn.vRequired)((0,Gn.vString)())}),R3a=(0,Gn.vObj)({token:(0,Gn.vRequired)((0,Gn.vString)()),expires_at:(0,Gn.vRequired)((0,Gn.vNumber)()),refresh_in:(0,Gn.vRequired)((0,Gn.vNumber)())});function QDi(t){let e=x3a.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=R3a.validate(t);return n.error===void 0?{valid:!0,strategy:"fallback",strictError:r,envelope:t}:{valid:!1,strategy:"failed",strictError:r,fallbackError:n.error.message}}a(QDi,"validateTokenEnvelope");function k3a(t){return QDi(t).valid}a(k3a,"isTokenEnvelope");function P3a(t){return I3a.validate(t).error===void 0}a(P3a,"isErrorEnvelope");function D3a(t){return w3a.validate(t).error===void 0}a(D3a,"isStandardErrorEnvelope");function N3a(t){return{token:"test-token",expires_at:0,refresh_in:0,sku:"free_limited_copilot",individual:!0,blackbird_clientside_indexing:!1,code_quote_enabled:!1,code_review_enabled:!1,codesearch:!1,copilotignore_enabled:!1,public_suggestions:"enabled",telemetry:"enabled",username:"testuser",isVscodeTeamMember:!1,copilot_plan:"free",organization_login_list:[],...t}}a(N3a,"createTestExtendedTokenInfo")});var uye=I(bI=>{"use strict";p();var M3a=bI&&bI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},O3a=bI&&bI.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(bI,"__esModule",{value:!0});bI.CopilotTokenManagerImpl=bI.ICompletionsCopilotTokenManager=bI.CopilotToken=void 0;var L3a=rE(),B3a=an(),F3a=pl(),U3a=Po(),Q3a=Yyt();Object.defineProperty(bI,"CopilotToken",{enumerable:!0,get:a(function(){return Q3a.CopilotToken},"get")});bI.ICompletionsCopilotTokenManager=(0,B3a.createServiceIdentifier)("ICompletionsCopilotTokenManager");var aIr=class extends U3a.Disposable{static{a(this,"CopilotTokenManagerImpl")}get token(){return this.tokenRefetcher.trigger(()=>this.updateCachedToken()),this._token}constructor(e=!1,r){super(),this.primed=e,this.authenticationService=r,this.tokenRefetcher=new F3a.ThrottledDelayer(5e3),this.updateCachedToken(),this._register(this.authenticationService.onDidCopilotTokenChange(()=>this.updateCachedToken()))}primeToken(){try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async getToken(){return this.updateCachedToken()}async updateCachedToken(){return this._token=await this.authenticationService.getCopilotToken(),this._token}resetToken(e){this.authenticationService.resetCopilotToken()}getLastToken(){return this.authenticationService.copilotToken}};bI.CopilotTokenManagerImpl=aIr;bI.CopilotTokenManagerImpl=aIr=M3a([O3a(1,L3a.IAuthenticationService)],aIr)});var Kyt=I(dye=>{"use strict";p();Object.defineProperty(dye,"__esModule",{value:!0});dye.NoOpCitationManager=dye.ICompletionsCitationManager=void 0;var q3a=an(),j3a=Po();dye.ICompletionsCitationManager=(0,q3a.createServiceIdentifier)("ICompletionsCitationManager");var cIr=class{static{a(this,"NoOpCitationManager")}register(){return j3a.Disposable.None}async handleIPCodeCitation(e){}};dye.NoOpCitationManager=cIr});var Vv=I(oA=>{"use strict";p();Object.defineProperty(oA,"__esModule",{value:!0});oA.HasPropertyKey=H3a;oA.IsAsyncIterator=G3a;oA.IsArray=lIr;oA.IsBigInt=$3a;oA.IsBoolean=V3a;oA.IsDate=W3a;oA.IsFunction=z3a;oA.IsIterator=Y3a;oA.IsNull=K3a;oA.IsNumber=J3a;oA.IsObject=uIr;oA.IsRegExp=Z3a;oA.IsString=X3a;oA.IsSymbol=eFa;oA.IsUint8Array=dIr;oA.IsUndefined=tFa;function H3a(t,e){return e in t}a(H3a,"HasPropertyKey");function G3a(t){return uIr(t)&&!lIr(t)&&!dIr(t)&&Symbol.asyncIterator in t}a(G3a,"IsAsyncIterator");function lIr(t){return Array.isArray(t)}a(lIr,"IsArray");function $3a(t){return typeof t=="bigint"}a($3a,"IsBigInt");function V3a(t){return typeof t=="boolean"}a(V3a,"IsBoolean");function W3a(t){return t instanceof globalThis.Date}a(W3a,"IsDate");function z3a(t){return typeof t=="function"}a(z3a,"IsFunction");function Y3a(t){return uIr(t)&&!lIr(t)&&!dIr(t)&&Symbol.iterator in t}a(Y3a,"IsIterator");function K3a(t){return t===null}a(K3a,"IsNull");function J3a(t){return typeof t=="number"}a(J3a,"IsNumber");function uIr(t){return typeof t=="object"&&t!==null}a(uIr,"IsObject");function Z3a(t){return t instanceof globalThis.RegExp}a(Z3a,"IsRegExp");function X3a(t){return typeof t=="string"}a(X3a,"IsString");function eFa(t){return typeof t=="symbol"}a(eFa,"IsSymbol");function dIr(t){return t instanceof globalThis.Uint8Array}a(dIr,"IsUint8Array");function tFa(t){return t===void 0}a(tFa,"IsUndefined")});var yS=I(F6=>{"use strict";p();var rFa=F6&&F6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nFa=F6&&F6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),iFa=F6&&F6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oJyt(e))}a(oFa,"ArrayType");function sFa(t){return new Date(t.getTime())}a(sFa,"DateType");function aFa(t){return new Uint8Array(t)}a(aFa,"Uint8ArrayType");function cFa(t){return new RegExp(t.source,t.flags)}a(cFa,"RegExpType");function lFa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Jyt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Jyt(t[r]);return e}a(lFa,"ObjectType");function Jyt(t){return dLe.IsArray(t)?oFa(t):dLe.IsDate(t)?sFa(t):dLe.IsUint8Array(t)?aFa(t):dLe.IsRegExp(t)?cFa(t):dLe.IsObject(t)?lFa(t):t}a(Jyt,"Visit");function uFa(t){return Jyt(t)}a(uFa,"Clone")});var Xyt=I(Zyt=>{"use strict";p();Object.defineProperty(Zyt,"__esModule",{value:!0});Zyt.CloneRest=dFa;Zyt.CloneType=jDi;var qDi=yS();function dFa(t){return t.map(e=>jDi(e))}a(dFa,"CloneRest");function jDi(t,e){return e===void 0?(0,qDi.Clone)(t):(0,qDi.Clone)({...e,...t})}a(jDi,"CloneType")});var fIr=I(P$=>{"use strict";p();var fFa=P$&&P$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HDi=P$&&P$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fFa(e,t,r)};Object.defineProperty(P$,"__esModule",{value:!0});HDi(Xyt(),P$);HDi(yS(),P$)});var e_t=I(Ia=>{"use strict";p();Object.defineProperty(Ia,"__esModule",{value:!0});Ia.IsAsyncIterator=pFa;Ia.IsIterator=hFa;Ia.IsStandardObject=mFa;Ia.IsInstanceObject=gFa;Ia.IsPromise=AFa;Ia.IsDate=yFa;Ia.IsMap=_Fa;Ia.IsSet=EFa;Ia.IsRegExp=vFa;Ia.IsTypedArray=CFa;Ia.IsInt8Array=bFa;Ia.IsUint8Array=SFa;Ia.IsUint8ClampedArray=TFa;Ia.IsInt16Array=IFa;Ia.IsUint16Array=xFa;Ia.IsInt32Array=wFa;Ia.IsUint32Array=RFa;Ia.IsFloat32Array=kFa;Ia.IsFloat64Array=PFa;Ia.IsBigInt64Array=DFa;Ia.IsBigUint64Array=NFa;Ia.HasPropertyKey=MFa;Ia.IsObject=fLe;Ia.IsArray=GDi;Ia.IsUndefined=$Di;Ia.IsNull=VDi;Ia.IsBoolean=WDi;Ia.IsNumber=zDi;Ia.IsInteger=OFa;Ia.IsBigInt=YDi;Ia.IsString=KDi;Ia.IsFunction=JDi;Ia.IsSymbol=ZDi;Ia.IsValueType=LFa;function pFa(t){return fLe(t)&&globalThis.Symbol.asyncIterator in t}a(pFa,"IsAsyncIterator");function hFa(t){return fLe(t)&&globalThis.Symbol.iterator in t}a(hFa,"IsIterator");function mFa(t){return fLe(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(mFa,"IsStandardObject");function gFa(t){return fLe(t)&&!GDi(t)&&JDi(t.constructor)&&t.constructor.name!=="Object"}a(gFa,"IsInstanceObject");function AFa(t){return t instanceof globalThis.Promise}a(AFa,"IsPromise");function yFa(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(yFa,"IsDate");function _Fa(t){return t instanceof globalThis.Map}a(_Fa,"IsMap");function EFa(t){return t instanceof globalThis.Set}a(EFa,"IsSet");function vFa(t){return t instanceof globalThis.RegExp}a(vFa,"IsRegExp");function CFa(t){return globalThis.ArrayBuffer.isView(t)}a(CFa,"IsTypedArray");function bFa(t){return t instanceof globalThis.Int8Array}a(bFa,"IsInt8Array");function SFa(t){return t instanceof globalThis.Uint8Array}a(SFa,"IsUint8Array");function TFa(t){return t instanceof globalThis.Uint8ClampedArray}a(TFa,"IsUint8ClampedArray");function IFa(t){return t instanceof globalThis.Int16Array}a(IFa,"IsInt16Array");function xFa(t){return t instanceof globalThis.Uint16Array}a(xFa,"IsUint16Array");function wFa(t){return t instanceof globalThis.Int32Array}a(wFa,"IsInt32Array");function RFa(t){return t instanceof globalThis.Uint32Array}a(RFa,"IsUint32Array");function kFa(t){return t instanceof globalThis.Float32Array}a(kFa,"IsFloat32Array");function PFa(t){return t instanceof globalThis.Float64Array}a(PFa,"IsFloat64Array");function DFa(t){return t instanceof globalThis.BigInt64Array}a(DFa,"IsBigInt64Array");function NFa(t){return t instanceof globalThis.BigUint64Array}a(NFa,"IsBigUint64Array");function MFa(t,e){return e in t}a(MFa,"HasPropertyKey");function fLe(t){return t!==null&&typeof t=="object"}a(fLe,"IsObject");function GDi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(GDi,"IsArray");function $Di(t){return t===void 0}a($Di,"IsUndefined");function VDi(t){return t===null}a(VDi,"IsNull");function WDi(t){return typeof t=="boolean"}a(WDi,"IsBoolean");function zDi(t){return typeof t=="number"}a(zDi,"IsNumber");function OFa(t){return globalThis.Number.isInteger(t)}a(OFa,"IsInteger");function YDi(t){return typeof t=="bigint"}a(YDi,"IsBigInt");function KDi(t){return typeof t=="string"}a(KDi,"IsString");function JDi(t){return typeof t=="function"}a(JDi,"IsFunction");function ZDi(t){return typeof t=="symbol"}a(ZDi,"IsSymbol");function LFa(t){return YDi(t)||WDi(t)||VDi(t)||zDi(t)||KDi(t)||ZDi(t)||$Di(t)}a(LFa,"IsValueType")});var Fg=I(yre=>{"use strict";p();var BFa=yre&&yre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),FFa=yre&&yre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&BFa(e,t,r)};Object.defineProperty(yre,"__esModule",{value:!0});FFa(e_t(),yre)});var pLe=I(r_t=>{"use strict";p();Object.defineProperty(r_t,"__esModule",{value:!0});r_t.TypeSystemPolicy=void 0;var t_t=Fg(),XDi;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(c,l){return t.ExactOptionalPropertyTypes?l in c:c[l]!==void 0}a(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function r(c){let l=(0,t_t.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,t_t.IsArray)(c)}a(r,"IsObjectLike"),t.IsObjectLike=r;function n(c){return r(c)&&!(c instanceof Date)&&!(c instanceof Uint8Array)}a(n,"IsRecordLike"),t.IsRecordLike=n;function o(c){return t.AllowNaN?(0,t_t.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,t_t.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(XDi||(r_t.TypeSystemPolicy=XDi={}))});var eNi=I(U6=>{"use strict";p();var UFa=U6&&U6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QFa=U6&&U6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qFa=U6&&U6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;on_t(e))}a(jFa,"ImmutableArray");function HFa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=n_t(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=n_t(t[r]);return globalThis.Object.freeze(e)}a(HFa,"ImmutableObject");function n_t(t){return hLe.IsArray(t)?jFa(t):hLe.IsDate(t)?t:hLe.IsUint8Array(t)?t:hLe.IsRegExp(t)?t:hLe.IsObject(t)?HFa(t):t}a(n_t,"Immutable")});var Pi=I(pIr=>{"use strict";p();Object.defineProperty(pIr,"__esModule",{value:!0});pIr.CreateType=WFa;var GFa=pLe(),$Fa=eNi(),VFa=yS();function WFa(t,e){let r=e!==void 0?{...e,...t}:t;switch(GFa.TypeSystemPolicy.InstanceMode){case"freeze":return(0,$Fa.Immutable)(r);case"clone":return(0,VFa.Clone)(r);default:return r}}a(WFa,"CreateType")});var Q6=I(_re=>{"use strict";p();var zFa=_re&&_re.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YFa=_re&&_re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zFa(e,t,r)};Object.defineProperty(_re,"__esModule",{value:!0});YFa(Pi(),_re)});var mIr=I(i_t=>{"use strict";p();Object.defineProperty(i_t,"__esModule",{value:!0});i_t.TypeBoxError=void 0;var hIr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};i_t.TypeBoxError=hIr});var Gf=I(Ere=>{"use strict";p();var KFa=Ere&&Ere.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JFa=Ere&&Ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&KFa(e,t,r)};Object.defineProperty(Ere,"__esModule",{value:!0});JFa(mIr(),Ere)});var mLe=I(ek=>{"use strict";p();Object.defineProperty(ek,"__esModule",{value:!0});ek.Kind=ek.Hint=ek.OptionalKind=ek.ReadonlyKind=ek.TransformKind=void 0;ek.TransformKind=Symbol.for("TypeBox.Transform");ek.ReadonlyKind=Symbol.for("TypeBox.Readonly");ek.OptionalKind=Symbol.for("TypeBox.Optional");ek.Hint=Symbol.for("TypeBox.Hint");ek.Kind=Symbol.for("TypeBox.Kind")});var Tn=I(vre=>{"use strict";p();var ZFa=vre&&vre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XFa=vre&&vre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZFa(e,t,r)};Object.defineProperty(vre,"__esModule",{value:!0});XFa(mLe(),vre)});var Is=I(pi=>{"use strict";p();var e8a=pi&&pi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),t8a=pi&&pi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),r8a=pi&&pi.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var h8a=Xn&&Xn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),m8a=Xn&&Xn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),g8a=Xn&&Xn.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=7&&r<=13||r===27||r===127)return!1}return!0}a(AIr,"IsControlCharacterFree");function FNi(t){return yIr(t)||sA(t)}a(FNi,"IsAdditionalProperties");function ALe(t){return ci.IsUndefined(t)||ci.IsBigInt(t)}a(ALe,"IsOptionalBigInt");function du(t){return ci.IsUndefined(t)||ci.IsNumber(t)}a(du,"IsOptionalNumber");function yIr(t){return ci.IsUndefined(t)||ci.IsBoolean(t)}a(yIr,"IsOptionalBoolean");function Tl(t){return ci.IsUndefined(t)||ci.IsString(t)}a(Tl,"IsOptionalString");function _8a(t){return ci.IsUndefined(t)||ci.IsString(t)&&AIr(t)&&BNi(t)}a(_8a,"IsOptionalPattern");function E8a(t){return ci.IsUndefined(t)||ci.IsString(t)&&AIr(t)}a(E8a,"IsOptionalFormat");function UNi(t){return ci.IsUndefined(t)||sA(t)}a(UNi,"IsOptionalSchema");function v8a(t){return ci.IsObject(t)&&t[CL.ReadonlyKind]==="Readonly"}a(v8a,"IsReadonly");function C8a(t){return ci.IsObject(t)&&t[CL.OptionalKind]==="Optional"}a(C8a,"IsOptional");function QNi(t){return Zs(t,"Any")&&Tl(t.$id)}a(QNi,"IsAny");function qNi(t){return Zs(t,"Argument")&&ci.IsNumber(t.index)}a(qNi,"IsArgument");function jNi(t){return Zs(t,"Array")&&t.type==="array"&&Tl(t.$id)&&sA(t.items)&&du(t.minItems)&&du(t.maxItems)&&yIr(t.uniqueItems)&&UNi(t.contains)&&du(t.minContains)&&du(t.maxContains)}a(jNi,"IsArray");function HNi(t){return Zs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&Tl(t.$id)&&sA(t.items)}a(HNi,"IsAsyncIterator");function GNi(t){return Zs(t,"BigInt")&&t.type==="bigint"&&Tl(t.$id)&&ALe(t.exclusiveMaximum)&&ALe(t.exclusiveMinimum)&&ALe(t.maximum)&&ALe(t.minimum)&&ALe(t.multipleOf)}a(GNi,"IsBigInt");function $Ni(t){return Zs(t,"Boolean")&&t.type==="boolean"&&Tl(t.$id)}a($Ni,"IsBoolean");function VNi(t){return Zs(t,"Computed")&&ci.IsString(t.target)&&ci.IsArray(t.parameters)&&t.parameters.every(e=>sA(e))}a(VNi,"IsComputed");function WNi(t){return Zs(t,"Constructor")&&t.type==="Constructor"&&Tl(t.$id)&&ci.IsArray(t.parameters)&&t.parameters.every(e=>sA(e))&&sA(t.returns)}a(WNi,"IsConstructor");function zNi(t){return Zs(t,"Date")&&t.type==="Date"&&Tl(t.$id)&&du(t.exclusiveMaximumTimestamp)&&du(t.exclusiveMinimumTimestamp)&&du(t.maximumTimestamp)&&du(t.minimumTimestamp)&&du(t.multipleOfTimestamp)}a(zNi,"IsDate");function YNi(t){return Zs(t,"Function")&&t.type==="Function"&&Tl(t.$id)&&ci.IsArray(t.parameters)&&t.parameters.every(e=>sA(e))&&sA(t.returns)}a(YNi,"IsFunction");function b8a(t){return Zs(t,"Import")&&ci.HasPropertyKey(t,"$defs")&&ci.IsObject(t.$defs)&&o_t(t.$defs)&&ci.HasPropertyKey(t,"$ref")&&ci.IsString(t.$ref)&&t.$ref in t.$defs}a(b8a,"IsImport");function KNi(t){return Zs(t,"Integer")&&t.type==="integer"&&Tl(t.$id)&&du(t.exclusiveMaximum)&&du(t.exclusiveMinimum)&&du(t.maximum)&&du(t.minimum)&&du(t.multipleOf)}a(KNi,"IsInteger");function o_t(t){return ci.IsObject(t)&&Object.entries(t).every(([e,r])=>AIr(e)&&sA(r))}a(o_t,"IsProperties");function JNi(t){return Zs(t,"Intersect")&&!(ci.IsString(t.type)&&t.type!=="object")&&ci.IsArray(t.allOf)&&t.allOf.every(e=>sA(e)&&!AMi(e))&&Tl(t.type)&&(yIr(t.unevaluatedProperties)||UNi(t.unevaluatedProperties))&&Tl(t.$id)}a(JNi,"IsIntersect");function ZNi(t){return Zs(t,"Iterator")&&t.type==="Iterator"&&Tl(t.$id)&&sA(t.items)}a(ZNi,"IsIterator");function Zs(t,e){return ci.IsObject(t)&&CL.Kind in t&&t[CL.Kind]===e}a(Zs,"IsKindOf");function XNi(t){return yLe(t)&&ci.IsString(t.const)}a(XNi,"IsLiteralString");function eMi(t){return yLe(t)&&ci.IsNumber(t.const)}a(eMi,"IsLiteralNumber");function S8a(t){return yLe(t)&&ci.IsBoolean(t.const)}a(S8a,"IsLiteralBoolean");function yLe(t){return Zs(t,"Literal")&&Tl(t.$id)&&tMi(t.const)}a(yLe,"IsLiteral");function tMi(t){return ci.IsBoolean(t)||ci.IsNumber(t)||ci.IsString(t)}a(tMi,"IsLiteralValue");function rMi(t){return Zs(t,"MappedKey")&&ci.IsArray(t.keys)&&t.keys.every(e=>ci.IsNumber(e)||ci.IsString(e))}a(rMi,"IsMappedKey");function nMi(t){return Zs(t,"MappedResult")&&o_t(t.properties)}a(nMi,"IsMappedResult");function iMi(t){return Zs(t,"Never")&&ci.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(iMi,"IsNever");function oMi(t){return Zs(t,"Not")&&sA(t.not)}a(oMi,"IsNot");function sMi(t){return Zs(t,"Null")&&t.type==="null"&&Tl(t.$id)}a(sMi,"IsNull");function aMi(t){return Zs(t,"Number")&&t.type==="number"&&Tl(t.$id)&&du(t.exclusiveMaximum)&&du(t.exclusiveMinimum)&&du(t.maximum)&&du(t.minimum)&&du(t.multipleOf)}a(aMi,"IsNumber");function cMi(t){return Zs(t,"Object")&&t.type==="object"&&Tl(t.$id)&&o_t(t.properties)&&FNi(t.additionalProperties)&&du(t.minProperties)&&du(t.maxProperties)}a(cMi,"IsObject");function lMi(t){return Zs(t,"Promise")&&t.type==="Promise"&&Tl(t.$id)&&sA(t.item)}a(lMi,"IsPromise");function uMi(t){return Zs(t,"Record")&&t.type==="object"&&Tl(t.$id)&&FNi(t.additionalProperties)&&ci.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&BNi(r[0])&&ci.IsObject(e.patternProperties)&&sA(e.patternProperties[r[0]])})(t)}a(uMi,"IsRecord");function T8a(t){return ci.IsObject(t)&&CL.Hint in t&&t[CL.Hint]==="Recursive"}a(T8a,"IsRecursive");function dMi(t){return Zs(t,"Ref")&&Tl(t.$id)&&ci.IsString(t.$ref)}a(dMi,"IsRef");function fMi(t){return Zs(t,"RegExp")&&Tl(t.$id)&&ci.IsString(t.source)&&ci.IsString(t.flags)&&du(t.maxLength)&&du(t.minLength)}a(fMi,"IsRegExp");function pMi(t){return Zs(t,"String")&&t.type==="string"&&Tl(t.$id)&&du(t.minLength)&&du(t.maxLength)&&_8a(t.pattern)&&E8a(t.format)}a(pMi,"IsString");function hMi(t){return Zs(t,"Symbol")&&t.type==="symbol"&&Tl(t.$id)}a(hMi,"IsSymbol");function mMi(t){return Zs(t,"TemplateLiteral")&&t.type==="string"&&ci.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(mMi,"IsTemplateLiteral");function gMi(t){return Zs(t,"This")&&Tl(t.$id)&&ci.IsString(t.$ref)}a(gMi,"IsThis");function AMi(t){return ci.IsObject(t)&&CL.TransformKind in t}a(AMi,"IsTransform");function yMi(t){return Zs(t,"Tuple")&&t.type==="array"&&Tl(t.$id)&&ci.IsNumber(t.minItems)&&ci.IsNumber(t.maxItems)&&t.minItems===t.maxItems&&(ci.IsUndefined(t.items)&&ci.IsUndefined(t.additionalItems)&&t.minItems===0||ci.IsArray(t.items)&&t.items.every(e=>sA(e)))}a(yMi,"IsTuple");function _Mi(t){return Zs(t,"Undefined")&&t.type==="undefined"&&Tl(t.$id)}a(_Mi,"IsUndefined");function I8a(t){return _Ir(t)&&t.anyOf.every(e=>XNi(e)||eMi(e))}a(I8a,"IsUnionLiteral");function _Ir(t){return Zs(t,"Union")&&Tl(t.$id)&&ci.IsObject(t)&&ci.IsArray(t.anyOf)&&t.anyOf.every(e=>sA(e))}a(_Ir,"IsUnion");function EMi(t){return Zs(t,"Uint8Array")&&t.type==="Uint8Array"&&Tl(t.$id)&&du(t.minByteLength)&&du(t.maxByteLength)}a(EMi,"IsUint8Array");function vMi(t){return Zs(t,"Unknown")&&Tl(t.$id)}a(vMi,"IsUnknown");function CMi(t){return Zs(t,"Unsafe")}a(CMi,"IsUnsafe");function bMi(t){return Zs(t,"Void")&&t.type==="void"&&Tl(t.$id)}a(bMi,"IsVoid");function SMi(t){return ci.IsObject(t)&&CL.Kind in t&&ci.IsString(t[CL.Kind])&&!y8a.includes(t[CL.Kind])}a(SMi,"IsKind");function sA(t){return ci.IsObject(t)&&(QNi(t)||qNi(t)||jNi(t)||$Ni(t)||GNi(t)||HNi(t)||VNi(t)||WNi(t)||zNi(t)||YNi(t)||KNi(t)||JNi(t)||ZNi(t)||yLe(t)||rMi(t)||nMi(t)||iMi(t)||oMi(t)||sMi(t)||aMi(t)||cMi(t)||lMi(t)||uMi(t)||dMi(t)||fMi(t)||pMi(t)||hMi(t)||mMi(t)||gMi(t)||yMi(t)||_Mi(t)||_Ir(t)||EMi(t)||vMi(t)||CMi(t)||bMi(t)||SMi(t))}a(sA,"IsSchema")});var vIr=I(ES=>{"use strict";p();var x8a=ES&&ES.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),w8a=ES&&ES.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),EIr=ES&&ES.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(CIr,"__esModule",{value:!0});CIr.Increment=R8a;function R8a(t){return(parseInt(t)+1).toString()}a(R8a,"Increment")});var xMi=I(Cre=>{"use strict";p();var k8a=Cre&&Cre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),P8a=Cre&&Cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&k8a(e,t,r)};Object.defineProperty(Cre,"__esModule",{value:!0});P8a(IMi(),Cre)});var wMi=I(Mp=>{"use strict";p();Object.defineProperty(Mp,"__esModule",{value:!0});Mp.PatternNeverExact=Mp.PatternStringExact=Mp.PatternNumberExact=Mp.PatternBooleanExact=Mp.PatternNever=Mp.PatternString=Mp.PatternNumber=Mp.PatternBoolean=void 0;Mp.PatternBoolean="(true|false)";Mp.PatternNumber="(0|[1-9][0-9]*)";Mp.PatternString="(.*)";Mp.PatternNever="(?!.*)";Mp.PatternBooleanExact=`^${Mp.PatternBoolean}$`;Mp.PatternNumberExact=`^${Mp.PatternNumber}$`;Mp.PatternStringExact=`^${Mp.PatternString}$`;Mp.PatternNeverExact=`^${Mp.PatternNever}$`});var _Le=I(bre=>{"use strict";p();var D8a=bre&&bre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N8a=bre&&bre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&D8a(e,t,r)};Object.defineProperty(bre,"__esModule",{value:!0});N8a(wMi(),bre)});var RMi=I(D$=>{"use strict";p();Object.defineProperty(D$,"__esModule",{value:!0});D$.Entries=M8a;D$.Clear=O8a;D$.Delete=L8a;D$.Has=B8a;D$.Set=F8a;D$.Get=U8a;var fye=new Map;function M8a(){return new Map(fye)}a(M8a,"Entries");function O8a(){return fye.clear()}a(O8a,"Clear");function L8a(t){return fye.delete(t)}a(L8a,"Delete");function B8a(t){return fye.has(t)}a(B8a,"Has");function F8a(t,e){fye.set(t,e)}a(F8a,"Set");function U8a(t){return fye.get(t)}a(U8a,"Get")});var kMi=I(N$=>{"use strict";p();Object.defineProperty(N$,"__esModule",{value:!0});N$.Entries=Q8a;N$.Clear=q8a;N$.Delete=j8a;N$.Has=H8a;N$.Set=G8a;N$.Get=$8a;var pye=new Map;function Q8a(){return new Map(pye)}a(Q8a,"Entries");function q8a(){return pye.clear()}a(q8a,"Clear");function j8a(t){return pye.delete(t)}a(j8a,"Delete");function H8a(t){return pye.has(t)}a(H8a,"Has");function G8a(t,e){pye.set(t,e)}a(G8a,"Set");function $8a(t){return pye.get(t)}a($8a,"Get")});var hye=I(tk=>{"use strict";p();var V8a=tk&&tk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),W8a=tk&&tk.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PMi=tk&&tk.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(bL,"__esModule",{value:!0});bL.SetIncludes=DMi;bL.SetIsSubset=z8a;bL.SetDistinct=Y8a;bL.SetIntersect=NMi;bL.SetUnion=K8a;bL.SetComplement=J8a;bL.SetIntersectMany=X8a;bL.SetUnionMany=e6a;function DMi(t,e){return t.includes(e)}a(DMi,"SetIncludes");function z8a(t,e){return t.every(r=>DMi(e,r))}a(z8a,"SetIsSubset");function Y8a(t){return[...new Set(t)]}a(Y8a,"SetDistinct");function NMi(t,e){return t.filter(r=>e.includes(r))}a(NMi,"SetIntersect");function K8a(t,e){return[...t,...e]}a(K8a,"SetUnion");function J8a(t,e){return t.filter(r=>!e.includes(r))}a(J8a,"SetComplement");function Z8a(t,e){return t.reduce((r,n)=>NMi(r,n),e)}a(Z8a,"SetIntersectManyResolve");function X8a(t){return t.length===1?t[0]:t.length>1?Z8a(t.slice(1),t[0]):[]}a(X8a,"SetIntersectMany");function e6a(t){let e=[];for(let r of t)e.push(...r);return e}a(e6a,"SetUnionMany")});var ELe=I(Sre=>{"use strict";p();var t6a=Sre&&Sre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),r6a=Sre&&Sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t6a(e,t,r)};Object.defineProperty(Sre,"__esModule",{value:!0});r6a(MMi(),Sre)});var OMi=I(bIr=>{"use strict";p();Object.defineProperty(bIr,"__esModule",{value:!0});bIr.Any=o6a;var n6a=Q6(),i6a=Tn();function o6a(t){return(0,n6a.CreateType)({[i6a.Kind]:"Any"},t)}a(o6a,"Any")});var mye=I(Tre=>{"use strict";p();var s6a=Tre&&Tre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),a6a=Tre&&Tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s6a(e,t,r)};Object.defineProperty(Tre,"__esModule",{value:!0});a6a(OMi(),Tre)});var LMi=I(SIr=>{"use strict";p();Object.defineProperty(SIr,"__esModule",{value:!0});SIr.Array=u6a;var c6a=Pi(),l6a=Tn();function u6a(t,e){return(0,c6a.CreateType)({[l6a.Kind]:"Array",type:"array",items:t},e)}a(u6a,"Array")});var gye=I(Ire=>{"use strict";p();var d6a=Ire&&Ire.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),f6a=Ire&&Ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&d6a(e,t,r)};Object.defineProperty(Ire,"__esModule",{value:!0});f6a(LMi(),Ire)});var BMi=I(TIr=>{"use strict";p();Object.defineProperty(TIr,"__esModule",{value:!0});TIr.Argument=m6a;var p6a=Pi(),h6a=Tn();function m6a(t){return(0,p6a.CreateType)({[h6a.Kind]:"Argument",index:t})}a(m6a,"Argument")});var s_t=I(xre=>{"use strict";p();var g6a=xre&&xre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),A6a=xre&&xre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&g6a(e,t,r)};Object.defineProperty(xre,"__esModule",{value:!0});A6a(BMi(),xre)});var FMi=I(IIr=>{"use strict";p();Object.defineProperty(IIr,"__esModule",{value:!0});IIr.AsyncIterator=E6a;var y6a=Tn(),_6a=Pi();function E6a(t,e){return(0,_6a.CreateType)({[y6a.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(E6a,"AsyncIterator")});var Aye=I(wre=>{"use strict";p();var v6a=wre&&wre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),C6a=wre&&wre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v6a(e,t,r)};Object.defineProperty(wre,"__esModule",{value:!0});C6a(FMi(),wre)});var UMi=I(xIr=>{"use strict";p();Object.defineProperty(xIr,"__esModule",{value:!0});xIr.Computed=T6a;var b6a=Q6(),S6a=mLe();function T6a(t,e,r){return(0,b6a.CreateType)({[S6a.Kind]:"Computed",target:t,parameters:e},r)}a(T6a,"Computed")});var M$=I(Rre=>{"use strict";p();var I6a=Rre&&Rre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),x6a=Rre&&Rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I6a(e,t,r)};Object.defineProperty(Rre,"__esModule",{value:!0});x6a(UMi(),Rre)});var a_t=I(wIr=>{"use strict";p();Object.defineProperty(wIr,"__esModule",{value:!0});wIr.Discard=R6a;function w6a(t,e){let{[e]:r,...n}=t;return n}a(w6a,"DiscardKey");function R6a(t,e){return e.reduce((r,n)=>w6a(r,n),t)}a(R6a,"Discard")});var j6=I(kre=>{"use strict";p();var k6a=kre&&kre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),P6a=kre&&kre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&k6a(e,t,r)};Object.defineProperty(kre,"__esModule",{value:!0});P6a(a_t(),kre)});var QMi=I(RIr=>{"use strict";p();Object.defineProperty(RIr,"__esModule",{value:!0});RIr.Never=M6a;var D6a=Pi(),N6a=Tn();function M6a(t){return(0,D6a.CreateType)({[N6a.Kind]:"Never",not:{}},t)}a(M6a,"Never")});var Bm=I(Pre=>{"use strict";p();var O6a=Pre&&Pre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L6a=Pre&&Pre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&O6a(e,t,r)};Object.defineProperty(Pre,"__esModule",{value:!0});L6a(QMi(),Pre)});var qMi=I(kIr=>{"use strict";p();Object.defineProperty(kIr,"__esModule",{value:!0});kIr.MappedKey=U6a;var B6a=Pi(),F6a=Tn();function U6a(t){return(0,B6a.CreateType)({[F6a.Kind]:"MappedKey",keys:t})}a(U6a,"MappedKey")});var DIr=I(PIr=>{"use strict";p();Object.defineProperty(PIr,"__esModule",{value:!0});PIr.MappedResult=j6a;var Q6a=Pi(),q6a=Tn();function j6a(t){return(0,Q6a.CreateType)({[q6a.Kind]:"MappedResult",properties:t})}a(j6a,"MappedResult")});var jMi=I(NIr=>{"use strict";p();Object.defineProperty(NIr,"__esModule",{value:!0});NIr.Constructor=$6a;var H6a=Pi(),G6a=Tn();function $6a(t,e,r){return(0,H6a.CreateType)({[G6a.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a($6a,"Constructor")});var yye=I(Dre=>{"use strict";p();var V6a=Dre&&Dre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),W6a=Dre&&Dre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&V6a(e,t,r)};Object.defineProperty(Dre,"__esModule",{value:!0});W6a(jMi(),Dre)});var HMi=I(MIr=>{"use strict";p();Object.defineProperty(MIr,"__esModule",{value:!0});MIr.Function=K6a;var z6a=Pi(),Y6a=Tn();function K6a(t,e,r){return(0,z6a.CreateType)({[Y6a.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(K6a,"Function")});var O$=I(Nre=>{"use strict";p();var J6a=Nre&&Nre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Z6a=Nre&&Nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&J6a(e,t,r)};Object.defineProperty(Nre,"__esModule",{value:!0});Z6a(HMi(),Nre)});var LIr=I(OIr=>{"use strict";p();Object.defineProperty(OIr,"__esModule",{value:!0});OIr.UnionCreate=tUa;var X6a=Pi(),eUa=Tn();function tUa(t,e){return(0,X6a.CreateType)({[eUa.Kind]:"Union",anyOf:t},e)}a(tUa,"UnionCreate")});var WMi=I(BIr=>{"use strict";p();Object.defineProperty(BIr,"__esModule",{value:!0});BIr.UnionEvaluated=uUa;var rUa=Pi(),nUa=Tn(),iUa=j6(),oUa=Bm(),sUa=SL(),GMi=LIr(),VMi=Is();function aUa(t){return t.some(e=>(0,VMi.IsOptional)(e))}a(aUa,"IsUnionOptional");function $Mi(t){return t.map(e=>(0,VMi.IsOptional)(e)?cUa(e):e)}a($Mi,"RemoveOptionalFromRest");function cUa(t){return(0,iUa.Discard)(t,[nUa.OptionalKind])}a(cUa,"RemoveOptionalFromType");function lUa(t,e){return aUa(t)?(0,sUa.Optional)((0,GMi.UnionCreate)($Mi(t),e)):(0,GMi.UnionCreate)($Mi(t),e)}a(lUa,"ResolveUnion");function uUa(t,e){return t.length===1?(0,rUa.CreateType)(t[0],e):t.length===0?(0,oUa.Never)(e):lUa(t,e)}a(uUa,"UnionEvaluated")});var YMi=I(zMi=>{"use strict";p();Object.defineProperty(zMi,"__esModule",{value:!0});var H4p=Tn()});var KMi=I(FIr=>{"use strict";p();Object.defineProperty(FIr,"__esModule",{value:!0});FIr.Union=hUa;var dUa=Bm(),fUa=Pi(),pUa=LIr();function hUa(t,e){return t.length===0?(0,dUa.Never)(e):t.length===1?(0,fUa.CreateType)(t[0],e):(0,pUa.UnionCreate)(t,e)}a(hUa,"Union")});var Op=I(H6=>{"use strict";p();var mUa=H6&&H6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UIr=H6&&H6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mUa(e,t,r)};Object.defineProperty(H6,"__esModule",{value:!0});UIr(WMi(),H6);UIr(YMi(),H6);UIr(KMi(),H6)});var c_t=I(_ye=>{"use strict";p();Object.defineProperty(_ye,"__esModule",{value:!0});_ye.TemplateLiteralParserError=void 0;_ye.TemplateLiteralParse=Mre;_ye.TemplateLiteralParseExact=SUa;var gUa=Gf(),vLe=class extends gUa.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};_ye.TemplateLiteralParserError=vLe;function AUa(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(AUa,"Unescape");function QIr(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(QIr,"IsNonEscaped");function G6(t,e){return QIr(t,e,"(")}a(G6,"IsOpenParen");function CLe(t,e){return QIr(t,e,")")}a(CLe,"IsCloseParen");function JMi(t,e){return QIr(t,e,"|")}a(JMi,"IsSeparator");function yUa(t){if(!(G6(t,0)&&CLe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Mre(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Mre(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(CUa,"Or");function bUa(t){function e(o,s){if(!G6(o,s))throw new vLe("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Mre(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(bUa,"And");function Mre(t){return yUa(t)?Mre(_Ua(t)):EUa(t)?CUa(t):vUa(t)?bUa(t):{type:"const",const:AUa(t)}}a(Mre,"TemplateLiteralParse");function SUa(t){return Mre(t.slice(1,t.length-1))}a(SUa,"TemplateLiteralParseExact")});var qIr=I(Eye=>{"use strict";p();Object.defineProperty(Eye,"__esModule",{value:!0});Eye.TemplateLiteralFiniteError=void 0;Eye.IsTemplateLiteralExpressionFinite=u_t;Eye.IsTemplateLiteralFinite=kUa;var TUa=c_t(),IUa=Gf(),l_t=class extends IUa.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};Eye.TemplateLiteralFiniteError=l_t;function xUa(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}a(xUa,"IsNumberExpression");function wUa(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}a(wUa,"IsBooleanExpression");function RUa(t){return t.type==="const"&&t.const===".*"}a(RUa,"IsStringExpression");function u_t(t){return xUa(t)||RUa(t)?!1:wUa(t)?!0:t.type==="and"?t.expr.every(e=>u_t(e)):t.type==="or"?t.expr.every(e=>u_t(e)):t.type==="const"?!0:(()=>{throw new l_t("Unknown expression type")})()}a(u_t,"IsTemplateLiteralExpressionFinite");function kUa(t){let e=(0,TUa.TemplateLiteralParseExact)(t.pattern);return u_t(e)}a(kUa,"IsTemplateLiteralFinite")});var jIr=I(vye=>{"use strict";p();Object.defineProperty(vye,"__esModule",{value:!0});vye.TemplateLiteralGenerateError=void 0;vye.TemplateLiteralExpressionGenerate=f_t;vye.TemplateLiteralGenerate=BUa;var PUa=qIr(),DUa=c_t(),NUa=Gf(),d_t=class extends NUa.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};vye.TemplateLiteralGenerateError=d_t;function*ZMi(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of ZMi(t.slice(1)))yield`${e}${r}`}a(ZMi,"GenerateReduce");function*MUa(t){return yield*ZMi(t.expr.map(e=>[...f_t(e)]))}a(MUa,"GenerateAnd");function*OUa(t){for(let e of t.expr)yield*f_t(e)}a(OUa,"GenerateOr");function*LUa(t){return yield t.const}a(LUa,"GenerateConst");function*f_t(t){return t.type==="and"?yield*MUa(t):t.type==="or"?yield*OUa(t):t.type==="const"?yield*LUa(t):(()=>{throw new d_t("Unknown expression")})()}a(f_t,"TemplateLiteralExpressionGenerate");function BUa(t){let e=(0,DUa.TemplateLiteralParseExact)(t.pattern);return(0,PUa.IsTemplateLiteralExpressionFinite)(e)?[...f_t(e)]:[]}a(BUa,"TemplateLiteralGenerate")});var XMi=I(HIr=>{"use strict";p();Object.defineProperty(HIr,"__esModule",{value:!0});HIr.Literal=QUa;var FUa=Pi(),UUa=Tn();function QUa(t,e){return(0,FUa.CreateType)({[UUa.Kind]:"Literal",const:t,type:typeof t},e)}a(QUa,"Literal")});var nE=I(Ore=>{"use strict";p();var qUa=Ore&&Ore.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jUa=Ore&&Ore.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qUa(e,t,r)};Object.defineProperty(Ore,"__esModule",{value:!0});jUa(XMi(),Ore)});var eOi=I(GIr=>{"use strict";p();Object.defineProperty(GIr,"__esModule",{value:!0});GIr.Boolean=$Ua;var HUa=Tn(),GUa=Q6();function $Ua(t){return(0,GUa.CreateType)({[HUa.Kind]:"Boolean",type:"boolean"},t)}a($Ua,"Boolean")});var bLe=I(Lre=>{"use strict";p();var VUa=Lre&&Lre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WUa=Lre&&Lre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&VUa(e,t,r)};Object.defineProperty(Lre,"__esModule",{value:!0});WUa(eOi(),Lre)});var tOi=I($Ir=>{"use strict";p();Object.defineProperty($Ir,"__esModule",{value:!0});$Ir.BigInt=KUa;var zUa=Tn(),YUa=Q6();function KUa(t){return(0,YUa.CreateType)({[zUa.Kind]:"BigInt",type:"bigint"},t)}a(KUa,"BigInt")});var Cye=I(Bre=>{"use strict";p();var JUa=Bre&&Bre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZUa=Bre&&Bre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JUa(e,t,r)};Object.defineProperty(Bre,"__esModule",{value:!0});ZUa(tOi(),Bre)});var rOi=I(VIr=>{"use strict";p();Object.defineProperty(VIr,"__esModule",{value:!0});VIr.Number=t9a;var XUa=Pi(),e9a=Tn();function t9a(t){return(0,XUa.CreateType)({[e9a.Kind]:"Number",type:"number"},t)}a(t9a,"Number")});var L$=I(Fre=>{"use strict";p();var r9a=Fre&&Fre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),n9a=Fre&&Fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&r9a(e,t,r)};Object.defineProperty(Fre,"__esModule",{value:!0});n9a(rOi(),Fre)});var nOi=I(WIr=>{"use strict";p();Object.defineProperty(WIr,"__esModule",{value:!0});WIr.String=s9a;var i9a=Pi(),o9a=Tn();function s9a(t){return(0,i9a.CreateType)({[o9a.Kind]:"String",type:"string"},t)}a(s9a,"String")});var B$=I(Ure=>{"use strict";p();var a9a=Ure&&Ure.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),c9a=Ure&&Ure.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&a9a(e,t,r)};Object.defineProperty(Ure,"__esModule",{value:!0});c9a(nOi(),Ure)});var KIr=I(YIr=>{"use strict";p();Object.defineProperty(YIr,"__esModule",{value:!0});YIr.TemplateLiteralSyntax=A9a;var SLe=nE(),l9a=bLe(),u9a=Cye(),d9a=L$(),f9a=B$(),p9a=Op(),h9a=Bm();function*m9a(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,l9a.Boolean)():e==="number"?yield(0,d9a.Number)():e==="bigint"?yield(0,u9a.BigInt)():e==="string"?yield(0,f9a.String)():yield(()=>{let r=e.split("|").map(n=>(0,SLe.Literal)(n.trim()));return r.length===0?(0,h9a.Never)():r.length===1?r[0]:(0,p9a.UnionEvaluated)(r)})()}a(m9a,"FromUnion");function*g9a(t){if(t[1]!=="{"){let e=(0,SLe.Literal)("$"),r=zIr(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(ILe,"__esModule",{value:!0});ILe.TemplateLiteralPatternError=void 0;ILe.TemplateLiteralPattern=v9a;var TLe=_Le(),y9a=Tn(),_9a=Gf(),F$=Is(),p_t=class extends _9a.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};ILe.TemplateLiteralPatternError=p_t;function E9a(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(E9a,"Escape");function iOi(t,e){return(0,F$.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,F$.IsUnion)(t)?`(${t.anyOf.map(r=>iOi(r,e)).join("|")})`:(0,F$.IsNumber)(t)?`${e}${TLe.PatternNumber}`:(0,F$.IsInteger)(t)?`${e}${TLe.PatternNumber}`:(0,F$.IsBigInt)(t)?`${e}${TLe.PatternNumber}`:(0,F$.IsString)(t)?`${e}${TLe.PatternString}`:(0,F$.IsLiteral)(t)?`${e}${E9a(t.const.toString())}`:(0,F$.IsBoolean)(t)?`${e}${TLe.PatternBoolean}`:(()=>{throw new p_t(`Unexpected Kind '${t[y9a.Kind]}'`)})()}a(iOi,"Visit");function v9a(t){return`^${t.map(e=>iOi(e,"")).join("")}$`}a(v9a,"TemplateLiteralPattern")});var oOi=I(ZIr=>{"use strict";p();Object.defineProperty(ZIr,"__esModule",{value:!0});ZIr.TemplateLiteralToUnion=T9a;var C9a=Op(),b9a=nE(),S9a=jIr();function T9a(t){let r=(0,S9a.TemplateLiteralGenerate)(t).map(n=>(0,b9a.Literal)(n));return(0,C9a.UnionEvaluated)(r)}a(T9a,"TemplateLiteralToUnion")});var aOi=I(XIr=>{"use strict";p();Object.defineProperty(XIr,"__esModule",{value:!0});XIr.TemplateLiteral=k9a;var I9a=Pi(),x9a=KIr(),sOi=JIr(),w9a=Vv(),R9a=Tn();function k9a(t,e){let r=(0,w9a.IsString)(t)?(0,sOi.TemplateLiteralPattern)((0,x9a.TemplateLiteralSyntax)(t)):(0,sOi.TemplateLiteralPattern)(t);return(0,I9a.CreateType)({[R9a.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(k9a,"TemplateLiteral")});var GD=I(SI=>{"use strict";p();var P9a=SI&&SI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qre=SI&&SI.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P9a(e,t,r)};Object.defineProperty(SI,"__esModule",{value:!0});Qre(qIr(),SI);Qre(jIr(),SI);Qre(KIr(),SI);Qre(c_t(),SI);Qre(JIr(),SI);Qre(oOi(),SI);Qre(aOi(),SI)});var h_t=I(exr=>{"use strict";p();Object.defineProperty(exr,"__esModule",{value:!0});exr.IndexPropertyKeys=cOi;var D9a=GD(),xLe=Is();function N9a(t){return(0,D9a.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(N9a,"FromTemplateLiteral");function M9a(t){let e=[];for(let r of t)e.push(...cOi(r));return e}a(M9a,"FromUnion");function O9a(t){return[t.toString()]}a(O9a,"FromLiteral");function cOi(t){return[...new Set((0,xLe.IsTemplateLiteral)(t)?N9a(t):(0,xLe.IsUnion)(t)?M9a(t.anyOf):(0,xLe.IsLiteral)(t)?O9a(t.const):(0,xLe.IsNumber)(t)?["[number]"]:(0,xLe.IsInteger)(t)?["[number]"]:[])]}a(cOi,"IndexPropertyKeys")});var rxr=I(txr=>{"use strict";p();Object.defineProperty(txr,"__esModule",{value:!0});txr.IndexFromMappedResult=q9a;var L9a=Fm(),B9a=h_t(),F9a=$D();function U9a(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,F9a.Index)(t,(0,B9a.IndexPropertyKeys)(e[o]),r);return n}a(U9a,"FromProperties");function Q9a(t,e,r){return U9a(t,e.properties,r)}a(Q9a,"FromMappedResult");function q9a(t,e,r){let n=Q9a(t,e,r);return(0,L9a.MappedResult)(n)}a(q9a,"IndexFromMappedResult")});var g_t=I(bye=>{"use strict";p();Object.defineProperty(bye,"__esModule",{value:!0});bye.IndexFromPropertyKey=ixr;bye.IndexFromPropertyKeys=fOi;bye.IndexFromComputed=t7a;bye.Index=r7a;var j9a=Pi(),H9a=Gf(),uOi=M$(),m_t=Bm(),G9a=TI(),nxr=Op(),$9a=h_t(),V9a=oxr(),W9a=rxr(),vS=Is();function dOi(t,e){return t.map(r=>ixr(r,e))}a(dOi,"FromRest");function z9a(t){return t.filter(e=>!(0,vS.IsNever)(e))}a(z9a,"FromIntersectRest");function Y9a(t,e){return(0,G9a.IntersectEvaluated)(z9a(dOi(t,e)))}a(Y9a,"FromIntersect");function K9a(t){return t.some(e=>(0,vS.IsNever)(e))?[]:t}a(K9a,"FromUnionRest");function J9a(t,e){return(0,nxr.UnionEvaluated)(K9a(dOi(t,e)))}a(J9a,"FromUnion");function Z9a(t,e){return e in t?t[e]:e==="[number]"?(0,nxr.UnionEvaluated)(t):(0,m_t.Never)()}a(Z9a,"FromTuple");function X9a(t,e){return e==="[number]"?t:(0,m_t.Never)()}a(X9a,"FromArray");function e7a(t,e){return e in t?t[e]:(0,m_t.Never)()}a(e7a,"FromProperty");function ixr(t,e){return(0,vS.IsIntersect)(t)?Y9a(t.allOf,e):(0,vS.IsUnion)(t)?J9a(t.anyOf,e):(0,vS.IsTuple)(t)?Z9a(t.items??[],e):(0,vS.IsArray)(t)?X9a(t.items,e):(0,vS.IsObject)(t)?e7a(t.properties,e):(0,m_t.Never)()}a(ixr,"IndexFromPropertyKey");function fOi(t,e){return e.map(r=>ixr(t,r))}a(fOi,"IndexFromPropertyKeys");function lOi(t,e){return(0,nxr.UnionEvaluated)(fOi(t,e))}a(lOi,"FromSchema");function t7a(t,e){return(0,uOi.Computed)("Index",[t,e])}a(t7a,"IndexFromComputed");function r7a(t,e,r){if((0,vS.IsRef)(t)||(0,vS.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,vS.IsSchema)(t)||!(0,vS.IsSchema)(e))throw new H9a.TypeBoxError(n);return(0,uOi.Computed)("Index",[t,e])}return(0,vS.IsMappedResult)(e)?(0,W9a.IndexFromMappedResult)(t,e,r):(0,vS.IsMappedKey)(e)?(0,V9a.IndexFromMappedKey)(t,e,r):(0,j9a.CreateType)((0,vS.IsSchema)(e)?lOi(t,(0,$9a.IndexPropertyKeys)(e)):lOi(t,e),r)}a(r7a,"Index")});var oxr=I(sxr=>{"use strict";p();Object.defineProperty(sxr,"__esModule",{value:!0});sxr.IndexFromMappedKey=l7a;var n7a=g_t(),i7a=Fm(),o7a=yS();function s7a(t,e,r){return{[e]:(0,n7a.Index)(t,[e],(0,o7a.Clone)(r))}}a(s7a,"MappedIndexPropertyKey");function a7a(t,e,r){return e.reduce((n,o)=>({...n,...s7a(t,o,r)}),{})}a(a7a,"MappedIndexPropertyKeys");function c7a(t,e,r){return a7a(t,e.keys,r)}a(c7a,"MappedIndexProperties");function l7a(t,e,r){let n=c7a(t,e,r);return(0,i7a.MappedResult)(n)}a(l7a,"IndexFromMappedKey")});var $D=I(TL=>{"use strict";p();var u7a=TL&&TL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),A_t=TL&&TL.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&u7a(e,t,r)};Object.defineProperty(TL,"__esModule",{value:!0});A_t(oxr(),TL);A_t(rxr(),TL);A_t(h_t(),TL);A_t(g_t(),TL)});var pOi=I(axr=>{"use strict";p();Object.defineProperty(axr,"__esModule",{value:!0});axr.Iterator=p7a;var d7a=Pi(),f7a=Tn();function p7a(t,e){return(0,d7a.CreateType)({[f7a.Kind]:"Iterator",type:"Iterator",items:t},e)}a(p7a,"Iterator")});var Sye=I(qre=>{"use strict";p();var h7a=qre&&qre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),m7a=qre&&qre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&h7a(e,t,r)};Object.defineProperty(qre,"__esModule",{value:!0});m7a(pOi(),qre)});var mOi=I(y_t=>{"use strict";p();Object.defineProperty(y_t,"__esModule",{value:!0});y_t.Object=void 0;var g7a=Pi(),hOi=Tn(),A7a=Is();function y7a(t){return globalThis.Object.keys(t).filter(e=>!(0,A7a.IsOptional)(t[e]))}a(y7a,"RequiredArray");function _7a(t,e){let r=y7a(t),n=r.length>0?{[hOi.Kind]:"Object",type:"object",required:r,properties:t}:{[hOi.Kind]:"Object",type:"object",properties:t};return(0,g7a.CreateType)(n,e)}a(_7a,"_Object_");y_t.Object=_7a});var Wv=I(jre=>{"use strict";p();var E7a=jre&&jre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),v7a=jre&&jre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&E7a(e,t,r)};Object.defineProperty(jre,"__esModule",{value:!0});v7a(mOi(),jre)});var gOi=I(cxr=>{"use strict";p();Object.defineProperty(cxr,"__esModule",{value:!0});cxr.Promise=S7a;var C7a=Pi(),b7a=Tn();function S7a(t,e){return(0,C7a.CreateType)({[b7a.Kind]:"Promise",type:"Promise",item:t},e)}a(S7a,"Promise")});var wLe=I(Hre=>{"use strict";p();var T7a=Hre&&Hre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),I7a=Hre&&Hre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&T7a(e,t,r)};Object.defineProperty(Hre,"__esModule",{value:!0});I7a(gOi(),Hre)});var uxr=I(lxr=>{"use strict";p();Object.defineProperty(lxr,"__esModule",{value:!0});lxr.Readonly=N7a;var AOi=Pi(),yOi=Tn(),x7a=j6(),w7a=dxr(),R7a=Is();function k7a(t){return(0,AOi.CreateType)((0,x7a.Discard)(t,[yOi.ReadonlyKind]))}a(k7a,"RemoveReadonly");function P7a(t){return(0,AOi.CreateType)({...t,[yOi.ReadonlyKind]:"Readonly"})}a(P7a,"AddReadonly");function D7a(t,e){return e===!1?k7a(t):P7a(t)}a(D7a,"ReadonlyWithFlag");function N7a(t,e){let r=e??!0;return(0,R7a.IsMappedResult)(t)?(0,w7a.ReadonlyFromMappedResult)(t,r):D7a(t,r)}a(N7a,"Readonly")});var dxr=I(fxr=>{"use strict";p();Object.defineProperty(fxr,"__esModule",{value:!0});fxr.ReadonlyFromMappedResult=F7a;var M7a=Fm(),O7a=uxr();function L7a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,O7a.Readonly)(t[n],e);return r}a(L7a,"FromProperties");function B7a(t,e){return L7a(t.properties,e)}a(B7a,"FromMappedResult");function F7a(t,e){let r=B7a(t,e);return(0,M7a.MappedResult)(r)}a(F7a,"ReadonlyFromMappedResult")});var Q$=I(U$=>{"use strict";p();var U7a=U$&&U$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Oi=U$&&U$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&U7a(e,t,r)};Object.defineProperty(U$,"__esModule",{value:!0});_Oi(dxr(),U$);_Oi(uxr(),U$)});var vOi=I(pxr=>{"use strict";p();Object.defineProperty(pxr,"__esModule",{value:!0});pxr.Tuple=q7a;var Q7a=Pi(),EOi=Tn();function q7a(t,e){return(0,Q7a.CreateType)(t.length>0?{[EOi.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[EOi.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(q7a,"Tuple")});var $6=I(Gre=>{"use strict";p();var j7a=Gre&&Gre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),H7a=Gre&&Gre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j7a(e,t,r)};Object.defineProperty(Gre,"__esModule",{value:!0});H7a(vOi(),Gre)});var xOi=I(__t=>{"use strict";p();Object.defineProperty(__t,"__esModule",{value:!0});__t.MappedFunctionReturnType=IOi;__t.Mapped=lQa;var hxr=Tn(),COi=j6(),G7a=gye(),$7a=Aye(),V7a=yye(),W7a=O$(),z7a=$D(),Y7a=TI(),K7a=Sye(),bOi=nE(),SOi=Wv(),J7a=SL(),Z7a=wLe(),X7a=Q$(),eQa=$6(),tQa=Op(),rQa=ELe(),nQa=DIr(),zv=Is();function TOi(t,e){return t in e?rk(t,e[t]):(0,nQa.MappedResult)(e)}a(TOi,"FromMappedResult");function iQa(t){return{[t]:(0,bOi.Literal)(t)}}a(iQa,"MappedKeyToKnownMappedResultProperties");function oQa(t){let e={};for(let r of t)e[r]=(0,bOi.Literal)(r);return e}a(oQa,"MappedKeyToUnknownMappedResultProperties");function sQa(t,e){return(0,rQa.SetIncludes)(e,t)?iQa(t):oQa(e)}a(sQa,"MappedKeyToMappedResultProperties");function aQa(t,e){let r=sQa(t,e);return TOi(t,r)}a(aQa,"FromMappedKey");function RLe(t,e){return e.map(r=>rk(t,r))}a(RLe,"FromRest");function cQa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=rk(t,e[n]);return r}a(cQa,"FromProperties");function rk(t,e){let r={...e};return(0,zv.IsOptional)(e)?(0,J7a.Optional)(rk(t,(0,COi.Discard)(e,[hxr.OptionalKind]))):(0,zv.IsReadonly)(e)?(0,X7a.Readonly)(rk(t,(0,COi.Discard)(e,[hxr.ReadonlyKind]))):(0,zv.IsMappedResult)(e)?TOi(t,e.properties):(0,zv.IsMappedKey)(e)?aQa(t,e.keys):(0,zv.IsConstructor)(e)?(0,V7a.Constructor)(RLe(t,e.parameters),rk(t,e.returns),r):(0,zv.IsFunction)(e)?(0,W7a.Function)(RLe(t,e.parameters),rk(t,e.returns),r):(0,zv.IsAsyncIterator)(e)?(0,$7a.AsyncIterator)(rk(t,e.items),r):(0,zv.IsIterator)(e)?(0,K7a.Iterator)(rk(t,e.items),r):(0,zv.IsIntersect)(e)?(0,Y7a.Intersect)(RLe(t,e.allOf),r):(0,zv.IsUnion)(e)?(0,tQa.Union)(RLe(t,e.anyOf),r):(0,zv.IsTuple)(e)?(0,eQa.Tuple)(RLe(t,e.items??[]),r):(0,zv.IsObject)(e)?(0,SOi.Object)(cQa(t,e.properties),r):(0,zv.IsArray)(e)?(0,G7a.Array)(rk(t,e.items),r):(0,zv.IsPromise)(e)?(0,Z7a.Promise)(rk(t,e.item),r):e}a(rk,"FromSchemaType");function IOi(t,e){let r={};for(let n of t)r[n]=rk(n,e);return r}a(IOi,"MappedFunctionReturnType");function lQa(t,e,r){let n=(0,zv.IsSchema)(t)?(0,z7a.IndexPropertyKeys)(t):t,o=e({[hxr.Kind]:"MappedKey",keys:n}),s=IOi(n,o);return(0,SOi.Object)(s,r)}a(lQa,"Mapped")});var Fm=I(V6=>{"use strict";p();var uQa=V6&&V6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mxr=V6&&V6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uQa(e,t,r)};Object.defineProperty(V6,"__esModule",{value:!0});mxr(qMi(),V6);mxr(DIr(),V6);mxr(xOi(),V6)});var Axr=I(gxr=>{"use strict";p();Object.defineProperty(gxr,"__esModule",{value:!0});gxr.Optional=AQa;var wOi=Pi(),ROi=Tn(),dQa=j6(),fQa=yxr(),pQa=Is();function hQa(t){return(0,wOi.CreateType)((0,dQa.Discard)(t,[ROi.OptionalKind]))}a(hQa,"RemoveOptional");function mQa(t){return(0,wOi.CreateType)({...t,[ROi.OptionalKind]:"Optional"})}a(mQa,"AddOptional");function gQa(t,e){return e===!1?hQa(t):mQa(t)}a(gQa,"OptionalWithFlag");function AQa(t,e){let r=e??!0;return(0,pQa.IsMappedResult)(t)?(0,fQa.OptionalFromMappedResult)(t,r):gQa(t,r)}a(AQa,"Optional")});var yxr=I(_xr=>{"use strict";p();Object.defineProperty(_xr,"__esModule",{value:!0});_xr.OptionalFromMappedResult=CQa;var yQa=Fm(),_Qa=Axr();function EQa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,_Qa.Optional)(t[n],e);return r}a(EQa,"FromProperties");function vQa(t,e){return EQa(t.properties,e)}a(vQa,"FromMappedResult");function CQa(t,e){let r=vQa(t,e);return(0,yQa.MappedResult)(r)}a(CQa,"OptionalFromMappedResult")});var SL=I(q$=>{"use strict";p();var bQa=q$&&q$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kOi=q$&&q$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bQa(e,t,r)};Object.defineProperty(q$,"__esModule",{value:!0});kOi(yxr(),q$);kOi(Axr(),q$)});var Cxr=I(vxr=>{"use strict";p();Object.defineProperty(vxr,"__esModule",{value:!0});vxr.IntersectCreate=TQa;var SQa=Pi(),POi=Tn(),Exr=Is();function TQa(t,e={}){let r=t.every(o=>(0,Exr.IsObject)(o)),n=(0,Exr.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,SQa.CreateType)(e.unevaluatedProperties===!1||(0,Exr.IsSchema)(e.unevaluatedProperties)||r?{...n,[POi.Kind]:"Intersect",type:"object",allOf:t}:{...n,[POi.Kind]:"Intersect",allOf:t},e)}a(TQa,"IntersectCreate")});var MOi=I(Sxr=>{"use strict";p();Object.defineProperty(Sxr,"__esModule",{value:!0});Sxr.IntersectEvaluated=MQa;var IQa=Tn(),xQa=Pi(),wQa=j6(),RQa=Bm(),kQa=SL(),DOi=Cxr(),bxr=Is();function PQa(t){return t.every(e=>(0,bxr.IsOptional)(e))}a(PQa,"IsIntersectOptional");function DQa(t){return(0,wQa.Discard)(t,[IQa.OptionalKind])}a(DQa,"RemoveOptionalFromType");function NOi(t){return t.map(e=>(0,bxr.IsOptional)(e)?DQa(e):e)}a(NOi,"RemoveOptionalFromRest");function NQa(t,e){return PQa(t)?(0,kQa.Optional)((0,DOi.IntersectCreate)(NOi(t),e)):(0,DOi.IntersectCreate)(NOi(t),e)}a(NQa,"ResolveIntersect");function MQa(t,e={}){if(t.length===1)return(0,xQa.CreateType)(t[0],e);if(t.length===0)return(0,RQa.Never)(e);if(t.some(r=>(0,bxr.IsTransform)(r)))throw new Error("Cannot intersect transform types");return NQa(t,e)}a(MQa,"IntersectEvaluated")});var LOi=I(OOi=>{"use strict";p();Object.defineProperty(OOi,"__esModule",{value:!0});var p3p=Tn()});var BOi=I(Txr=>{"use strict";p();Object.defineProperty(Txr,"__esModule",{value:!0});Txr.Intersect=UQa;var OQa=Pi(),LQa=Bm(),BQa=Cxr(),FQa=Is();function UQa(t,e){if(t.length===1)return(0,OQa.CreateType)(t[0],e);if(t.length===0)return(0,LQa.Never)(e);if(t.some(r=>(0,FQa.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,BQa.IntersectCreate)(t,e)}a(UQa,"Intersect")});var TI=I(W6=>{"use strict";p();var QQa=W6&&W6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ixr=W6&&W6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&QQa(e,t,r)};Object.defineProperty(W6,"__esModule",{value:!0});Ixr(MOi(),W6);Ixr(LOi(),W6);Ixr(BOi(),W6)});var FOi=I(xxr=>{"use strict";p();Object.defineProperty(xxr,"__esModule",{value:!0});xxr.Ref=GQa;var qQa=Gf(),jQa=Pi(),HQa=Tn();function GQa(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new qQa.TypeBoxError("Ref: $ref must be a string");return(0,jQa.CreateType)({[HQa.Kind]:"Ref",$ref:e},r)}a(GQa,"Ref")});var j$=I($re=>{"use strict";p();var $Qa=$re&&$re.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),VQa=$re&&$re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Qa(e,t,r)};Object.defineProperty($re,"__esModule",{value:!0});VQa(FOi(),$re)});var QOi=I(kxr=>{"use strict";p();Object.defineProperty(kxr,"__esModule",{value:!0});kxr.Awaited=Rxr;var WQa=Pi(),wxr=M$(),zQa=TI(),YQa=Op(),KQa=j$(),kLe=Is();function JQa(t,e){return(0,wxr.Computed)("Awaited",[(0,wxr.Computed)(t,e)])}a(JQa,"FromComputed");function ZQa(t){return(0,wxr.Computed)("Awaited",[(0,KQa.Ref)(t)])}a(ZQa,"FromRef");function XQa(t){return(0,zQa.Intersect)(UOi(t))}a(XQa,"FromIntersect");function eqa(t){return(0,YQa.Union)(UOi(t))}a(eqa,"FromUnion");function tqa(t){return Rxr(t)}a(tqa,"FromPromise");function UOi(t){return t.map(e=>Rxr(e))}a(UOi,"FromRest");function Rxr(t,e){return(0,WQa.CreateType)((0,kLe.IsComputed)(t)?JQa(t.target,t.parameters):(0,kLe.IsIntersect)(t)?XQa(t.allOf):(0,kLe.IsUnion)(t)?eqa(t.anyOf):(0,kLe.IsPromise)(t)?tqa(t.item):(0,kLe.IsRef)(t)?ZQa(t.$ref):t,e)}a(Rxr,"Awaited")});var PLe=I(Vre=>{"use strict";p();var rqa=Vre&&Vre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nqa=Vre&&Vre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rqa(e,t,r)};Object.defineProperty(Vre,"__esModule",{value:!0});nqa(QOi(),Vre)});var v_t=I(E_t=>{"use strict";p();Object.defineProperty(E_t,"__esModule",{value:!0});E_t.KeyOfPropertyKeys=Dxr;E_t.KeyOfPattern=uqa;var qOi=ELe(),Tye=Is();function jOi(t){let e=[];for(let r of t)e.push(Dxr(r));return e}a(jOi,"FromRest");function iqa(t){let e=jOi(t);return(0,qOi.SetUnionMany)(e)}a(iqa,"FromIntersect");function oqa(t){let e=jOi(t);return(0,qOi.SetIntersectMany)(e)}a(oqa,"FromUnion");function sqa(t){return t.map((e,r)=>r.toString())}a(sqa,"FromTuple");function aqa(t){return["[number]"]}a(aqa,"FromArray");function cqa(t){return globalThis.Object.getOwnPropertyNames(t)}a(cqa,"FromProperties");function lqa(t){return Pxr?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(lqa,"FromPatternProperties");function Dxr(t){return(0,Tye.IsIntersect)(t)?iqa(t.allOf):(0,Tye.IsUnion)(t)?oqa(t.anyOf):(0,Tye.IsTuple)(t)?sqa(t.items??[]):(0,Tye.IsArray)(t)?aqa(t.items):(0,Tye.IsObject)(t)?cqa(t.properties):(0,Tye.IsRecord)(t)?lqa(t.patternProperties):[]}a(Dxr,"KeyOfPropertyKeys");var Pxr=!1;function uqa(t){Pxr=!0;let e=Dxr(t);return Pxr=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(uqa,"KeyOfPattern")});var Oxr=I(C_t=>{"use strict";p();Object.defineProperty(C_t,"__esModule",{value:!0});C_t.KeyOfPropertyKeysToRest=HOi;C_t.KeyOf=vqa;var dqa=Pi(),fqa=nE(),pqa=L$(),Mxr=M$(),hqa=j$(),mqa=v_t(),gqa=Op(),Aqa=Lxr(),Nxr=Is();function yqa(t,e){return(0,Mxr.Computed)("KeyOf",[(0,Mxr.Computed)(t,e)])}a(yqa,"FromComputed");function _qa(t){return(0,Mxr.Computed)("KeyOf",[(0,hqa.Ref)(t)])}a(_qa,"FromRef");function Eqa(t,e){let r=(0,mqa.KeyOfPropertyKeys)(t),n=HOi(r),o=(0,gqa.UnionEvaluated)(n);return(0,dqa.CreateType)(o,e)}a(Eqa,"KeyOfFromType");function HOi(t){return t.map(e=>e==="[number]"?(0,pqa.Number)():(0,fqa.Literal)(e))}a(HOi,"KeyOfPropertyKeysToRest");function vqa(t,e){return(0,Nxr.IsComputed)(t)?yqa(t.target,t.parameters):(0,Nxr.IsRef)(t)?_qa(t.$ref):(0,Nxr.IsMappedResult)(t)?(0,Aqa.KeyOfFromMappedResult)(t,e):Eqa(t,e)}a(vqa,"KeyOf")});var Lxr=I(Bxr=>{"use strict";p();Object.defineProperty(Bxr,"__esModule",{value:!0});Bxr.KeyOfFromMappedResult=xqa;var Cqa=Fm(),bqa=Oxr(),Sqa=yS();function Tqa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,bqa.KeyOf)(t[n],(0,Sqa.Clone)(e));return r}a(Tqa,"FromProperties");function Iqa(t,e){return Tqa(t.properties,e)}a(Iqa,"FromMappedResult");function xqa(t,e){let r=Iqa(t,e);return(0,Cqa.MappedResult)(r)}a(xqa,"KeyOfFromMappedResult")});var GOi=I(Fxr=>{"use strict";p();Object.defineProperty(Fxr,"__esModule",{value:!0});Fxr.KeyOfPropertyEntries=kqa;var wqa=g_t(),Rqa=v_t();function kqa(t){let e=(0,Rqa.KeyOfPropertyKeys)(t),r=(0,wqa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(kqa,"KeyOfPropertyEntries")});var VD=I(IL=>{"use strict";p();var Pqa=IL&&IL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),b_t=IL&&IL.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Pqa(e,t,r)};Object.defineProperty(IL,"__esModule",{value:!0});b_t(Lxr(),IL);b_t(GOi(),IL);b_t(v_t(),IL);b_t(Oxr(),IL)});var $Oi=I(Uxr=>{"use strict";p();Object.defineProperty(Uxr,"__esModule",{value:!0});Uxr.Composite=jqa;var Dqa=TI(),Nqa=$D(),Mqa=VD(),Oqa=Wv(),Lqa=ELe(),Bqa=Is();function Fqa(t){let e=[];for(let r of t)e.push(...(0,Mqa.KeyOfPropertyKeys)(r));return(0,Lqa.SetDistinct)(e)}a(Fqa,"CompositeKeys");function Uqa(t){return t.filter(e=>!(0,Bqa.IsNever)(e))}a(Uqa,"FilterNever");function Qqa(t,e){let r=[];for(let n of t)r.push(...(0,Nqa.IndexFromPropertyKeys)(n,[e]));return Uqa(r)}a(Qqa,"CompositeProperty");function qqa(t,e){let r={};for(let n of e)r[n]=(0,Dqa.IntersectEvaluated)(Qqa(t,n));return r}a(qqa,"CompositeProperties");function jqa(t,e){let r=Fqa(t),n=qqa(t,r);return(0,Oqa.Object)(n,e)}a(jqa,"Composite")});var S_t=I(Wre=>{"use strict";p();var Hqa=Wre&&Wre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gqa=Wre&&Wre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hqa(e,t,r)};Object.defineProperty(Wre,"__esModule",{value:!0});Gqa($Oi(),Wre)});var VOi=I(Qxr=>{"use strict";p();Object.defineProperty(Qxr,"__esModule",{value:!0});Qxr.Date=Wqa;var $qa=Tn(),Vqa=Pi();function Wqa(t){return(0,Vqa.CreateType)({[$qa.Kind]:"Date",type:"Date"},t)}a(Wqa,"Date")});var DLe=I(zre=>{"use strict";p();var zqa=zre&&zre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Yqa=zre&&zre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zqa(e,t,r)};Object.defineProperty(zre,"__esModule",{value:!0});Yqa(VOi(),zre)});var WOi=I(qxr=>{"use strict";p();Object.defineProperty(qxr,"__esModule",{value:!0});qxr.Null=Zqa;var Kqa=Pi(),Jqa=Tn();function Zqa(t){return(0,Kqa.CreateType)({[Jqa.Kind]:"Null",type:"null"},t)}a(Zqa,"Null")});var NLe=I(Yre=>{"use strict";p();var Xqa=Yre&&Yre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eja=Yre&&Yre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Xqa(e,t,r)};Object.defineProperty(Yre,"__esModule",{value:!0});eja(WOi(),Yre)});var zOi=I(jxr=>{"use strict";p();Object.defineProperty(jxr,"__esModule",{value:!0});jxr.Symbol=nja;var tja=Pi(),rja=Tn();function nja(t){return(0,tja.CreateType)({[rja.Kind]:"Symbol",type:"symbol"},t)}a(nja,"Symbol")});var MLe=I(Kre=>{"use strict";p();var ija=Kre&&Kre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oja=Kre&&Kre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ija(e,t,r)};Object.defineProperty(Kre,"__esModule",{value:!0});oja(zOi(),Kre)});var YOi=I(Hxr=>{"use strict";p();Object.defineProperty(Hxr,"__esModule",{value:!0});Hxr.Undefined=cja;var sja=Pi(),aja=Tn();function cja(t){return(0,sja.CreateType)({[aja.Kind]:"Undefined",type:"undefined"},t)}a(cja,"Undefined")});var OLe=I(Jre=>{"use strict";p();var lja=Jre&&Jre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uja=Jre&&Jre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lja(e,t,r)};Object.defineProperty(Jre,"__esModule",{value:!0});uja(YOi(),Jre)});var KOi=I(Gxr=>{"use strict";p();Object.defineProperty(Gxr,"__esModule",{value:!0});Gxr.Uint8Array=pja;var dja=Pi(),fja=Tn();function pja(t){return(0,dja.CreateType)({[fja.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(pja,"Uint8Array")});var LLe=I(Zre=>{"use strict";p();var hja=Zre&&Zre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mja=Zre&&Zre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hja(e,t,r)};Object.defineProperty(Zre,"__esModule",{value:!0});mja(KOi(),Zre)});var JOi=I($xr=>{"use strict";p();Object.defineProperty($xr,"__esModule",{value:!0});$xr.Unknown=yja;var gja=Pi(),Aja=Tn();function yja(t){return(0,gja.CreateType)({[Aja.Kind]:"Unknown"},t)}a(yja,"Unknown")});var H$=I(Xre=>{"use strict";p();var _ja=Xre&&Xre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Eja=Xre&&Xre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_ja(e,t,r)};Object.defineProperty(Xre,"__esModule",{value:!0});Eja(JOi(),Xre)});var e5i=I(Yxr=>{"use strict";p();Object.defineProperty(Yxr,"__esModule",{value:!0});Yxr.Const=Nja;var ZOi=mye(),vja=Cye(),Cja=DLe(),bja=O$(),Vxr=nE(),Sja=NLe(),XOi=Wv(),Tja=MLe(),Ija=$6(),Wxr=Q$(),xja=OLe(),wja=LLe(),Rja=H$(),kja=Q6(),CS=Vv();function Pja(t){return t.map(e=>zxr(e,!1))}a(Pja,"FromArray");function Dja(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,Wxr.Readonly)(zxr(t[r],!1));return e}a(Dja,"FromProperties");function T_t(t,e){return e===!0?t:(0,Wxr.Readonly)(t)}a(T_t,"ConditionalReadonly");function zxr(t,e){return(0,CS.IsAsyncIterator)(t)||(0,CS.IsIterator)(t)?T_t((0,ZOi.Any)(),e):(0,CS.IsArray)(t)?(0,Wxr.Readonly)((0,Ija.Tuple)(Pja(t))):(0,CS.IsUint8Array)(t)?(0,wja.Uint8Array)():(0,CS.IsDate)(t)?(0,Cja.Date)():(0,CS.IsObject)(t)?T_t((0,XOi.Object)(Dja(t)),e):(0,CS.IsFunction)(t)?T_t((0,bja.Function)([],(0,Rja.Unknown)()),e):(0,CS.IsUndefined)(t)?(0,xja.Undefined)():(0,CS.IsNull)(t)?(0,Sja.Null)():(0,CS.IsSymbol)(t)?(0,Tja.Symbol)():(0,CS.IsBigInt)(t)?(0,vja.BigInt)():(0,CS.IsNumber)(t)||(0,CS.IsBoolean)(t)||(0,CS.IsString)(t)?(0,Vxr.Literal)(t):(0,XOi.Object)({})}a(zxr,"FromValue");function Nja(t,e){return(0,kja.CreateType)(zxr(t,!0),e)}a(Nja,"Const")});var I_t=I(ene=>{"use strict";p();var Mja=ene&&ene.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Oja=ene&&ene.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mja(e,t,r)};Object.defineProperty(ene,"__esModule",{value:!0});Oja(e5i(),ene)});var t5i=I(z6=>{"use strict";p();var Lja=z6&&z6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bja=z6&&z6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Fja=z6&&z6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var Hja=tne&&tne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gja=tne&&tne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hja(e,t,r)};Object.defineProperty(tne,"__esModule",{value:!0});Gja(t5i(),tne)});var r5i=I(Kxr=>{"use strict";p();Object.defineProperty(Kxr,"__esModule",{value:!0});Kxr.Enum=Yja;var $ja=nE(),Vja=Tn(),Wja=Op(),zja=Vv();function Yja(t,e){if((0,zja.IsUndefined)(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>(0,$ja.Literal)(s));return(0,Wja.Union)(o,{...e,[Vja.Hint]:"Enum"})}a(Yja,"Enum")});var w_t=I(rne=>{"use strict";p();var Kja=rne&&rne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Jja=rne&&rne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Kja(e,t,r)};Object.defineProperty(rne,"__esModule",{value:!0});Jja(r5i(),rne)});var iwr=I(nne=>{"use strict";p();Object.defineProperty(nne,"__esModule",{value:!0});nne.ExtendsResult=nne.ExtendsResolverError=void 0;nne.ExtendsCheck=QHa;var n5i=mye(),Zja=O$(),twr=L$(),Zxr=B$(),Xja=H$(),i5i=GD(),Iye=_Le(),l5i=Tn(),eHa=Gf(),rt=vIr(),R_t=class extends eHa.TypeBoxError{static{a(this,"ExtendsResolverError")}};nne.ExtendsResolverError=R_t;var Bt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Bt||(nne.ExtendsResult=Bt={}));function nk(t){return t===Bt.False?t:Bt.True}a(nk,"IntoBooleanResult");function xye(t){throw new R_t(t)}a(xye,"Throw");function Um(t){return rt.TypeGuard.IsNever(t)||rt.TypeGuard.IsIntersect(t)||rt.TypeGuard.IsUnion(t)||rt.TypeGuard.IsUnknown(t)||rt.TypeGuard.IsAny(t)}a(Um,"IsStructuralRight");function Qm(t,e){return rt.TypeGuard.IsNever(e)?f5i(t,e):rt.TypeGuard.IsIntersect(e)?k_t(t,e):rt.TypeGuard.IsUnion(e)?nwr(t,e):rt.TypeGuard.IsUnknown(e)?g5i(t,e):rt.TypeGuard.IsAny(e)?rwr(t,e):xye("StructuralRight")}a(Qm,"StructuralRight");function rwr(t,e){return Bt.True}a(rwr,"FromAnyRight");function tHa(t,e){return rt.TypeGuard.IsIntersect(e)?k_t(t,e):rt.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>rt.TypeGuard.IsAny(r)||rt.TypeGuard.IsUnknown(r))?Bt.True:rt.TypeGuard.IsUnion(e)?Bt.Union:rt.TypeGuard.IsUnknown(e)||rt.TypeGuard.IsAny(e)?Bt.True:Bt.Union}a(tHa,"FromAny");function rHa(t,e){return rt.TypeGuard.IsUnknown(t)?Bt.False:rt.TypeGuard.IsAny(t)?Bt.Union:rt.TypeGuard.IsNever(t)?Bt.True:Bt.False}a(rHa,"FromArrayRight");function nHa(t,e){return rt.TypeGuard.IsObject(e)&&P_t(e)?Bt.True:Um(e)?Qm(t,e):rt.TypeGuard.IsArray(e)?nk(Il(t.items,e.items)):Bt.False}a(nHa,"FromArray");function iHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsAsyncIterator(e)?nk(Il(t.items,e.items)):Bt.False}a(iHa,"FromAsyncIterator");function oHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsBigInt(e)?Bt.True:Bt.False}a(oHa,"FromBigInt");function u5i(t,e){return rt.TypeGuard.IsLiteralBoolean(t)||rt.TypeGuard.IsBoolean(t)?Bt.True:Bt.False}a(u5i,"FromBooleanRight");function sHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsBoolean(e)?Bt.True:Bt.False}a(sHa,"FromBoolean");function aHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Bt.False:t.parameters.every((r,n)=>nk(Il(e.parameters[n],r))===Bt.True)?nk(Il(t.returns,e.returns)):Bt.False:Bt.False}a(aHa,"FromConstructor");function cHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsDate(e)?Bt.True:Bt.False}a(cHa,"FromDate");function lHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Bt.False:t.parameters.every((r,n)=>nk(Il(e.parameters[n],r))===Bt.True)?nk(Il(t.returns,e.returns)):Bt.False:Bt.False}a(lHa,"FromFunction");function d5i(t,e){return rt.TypeGuard.IsLiteral(t)&&rt.ValueGuard.IsNumber(t.const)||rt.TypeGuard.IsNumber(t)||rt.TypeGuard.IsInteger(t)?Bt.True:Bt.False}a(d5i,"FromIntegerRight");function uHa(t,e){return rt.TypeGuard.IsInteger(e)||rt.TypeGuard.IsNumber(e)?Bt.True:Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):Bt.False}a(uHa,"FromInteger");function k_t(t,e){return e.allOf.every(r=>Il(t,r)===Bt.True)?Bt.True:Bt.False}a(k_t,"FromIntersectRight");function dHa(t,e){return t.allOf.some(r=>Il(r,e)===Bt.True)?Bt.True:Bt.False}a(dHa,"FromIntersect");function fHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsIterator(e)?nk(Il(t.items,e.items)):Bt.False}a(fHa,"FromIterator");function pHa(t,e){return rt.TypeGuard.IsLiteral(e)&&e.const===t.const?Bt.True:Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsString(e)?m5i(t,e):rt.TypeGuard.IsNumber(e)?p5i(t,e):rt.TypeGuard.IsInteger(e)?d5i(t,e):rt.TypeGuard.IsBoolean(e)?u5i(t,e):Bt.False}a(pHa,"FromLiteral");function f5i(t,e){return Bt.False}a(f5i,"FromNeverRight");function hHa(t,e){return Bt.True}a(hHa,"FromNever");function o5i(t){let[e,r]=[t,0];for(;rt.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,Xja.Unknown)()}a(o5i,"UnwrapTNot");function mHa(t,e){return rt.TypeGuard.IsNot(t)?Il(o5i(t),e):rt.TypeGuard.IsNot(e)?Il(t,o5i(e)):xye("Invalid fallthrough for Not")}a(mHa,"FromNot");function gHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsNull(e)?Bt.True:Bt.False}a(gHa,"FromNull");function p5i(t,e){return rt.TypeGuard.IsLiteralNumber(t)||rt.TypeGuard.IsNumber(t)||rt.TypeGuard.IsInteger(t)?Bt.True:Bt.False}a(p5i,"FromNumberRight");function AHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsInteger(e)||rt.TypeGuard.IsNumber(e)?Bt.True:Bt.False}a(AHa,"FromNumber");function bS(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(bS,"IsObjectPropertyCount");function s5i(t){return P_t(t)}a(s5i,"IsObjectStringLike");function a5i(t){return bS(t,0)||bS(t,1)&&"description"in t.properties&&rt.TypeGuard.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(rt.TypeGuard.IsString(t.properties.description.anyOf[0])&&rt.TypeGuard.IsUndefined(t.properties.description.anyOf[1])||rt.TypeGuard.IsString(t.properties.description.anyOf[1])&&rt.TypeGuard.IsUndefined(t.properties.description.anyOf[0]))}a(a5i,"IsObjectSymbolLike");function Jxr(t){return bS(t,0)}a(Jxr,"IsObjectNumberLike");function c5i(t){return bS(t,0)}a(c5i,"IsObjectBooleanLike");function yHa(t){return bS(t,0)}a(yHa,"IsObjectBigIntLike");function _Ha(t){return bS(t,0)}a(_Ha,"IsObjectDateLike");function EHa(t){return P_t(t)}a(EHa,"IsObjectUint8ArrayLike");function vHa(t){let e=(0,twr.Number)();return bS(t,0)||bS(t,1)&&"length"in t.properties&&nk(Il(t.properties.length,e))===Bt.True}a(vHa,"IsObjectFunctionLike");function CHa(t){return bS(t,0)}a(CHa,"IsObjectConstructorLike");function P_t(t){let e=(0,twr.Number)();return bS(t,0)||bS(t,1)&&"length"in t.properties&&nk(Il(t.properties.length,e))===Bt.True}a(P_t,"IsObjectArrayLike");function bHa(t){let e=(0,Zja.Function)([(0,n5i.Any)()],(0,n5i.Any)());return bS(t,0)||bS(t,1)&&"then"in t.properties&&nk(Il(t.properties.then,e))===Bt.True}a(bHa,"IsObjectPromiseLike");function h5i(t,e){return Il(t,e)===Bt.False||rt.TypeGuard.IsOptional(t)&&!rt.TypeGuard.IsOptional(e)?Bt.False:Bt.True}a(h5i,"Property");function iE(t,e){return rt.TypeGuard.IsUnknown(t)?Bt.False:rt.TypeGuard.IsAny(t)?Bt.Union:rt.TypeGuard.IsNever(t)||rt.TypeGuard.IsLiteralString(t)&&s5i(e)||rt.TypeGuard.IsLiteralNumber(t)&&Jxr(e)||rt.TypeGuard.IsLiteralBoolean(t)&&c5i(e)||rt.TypeGuard.IsSymbol(t)&&a5i(e)||rt.TypeGuard.IsBigInt(t)&&yHa(e)||rt.TypeGuard.IsString(t)&&s5i(e)||rt.TypeGuard.IsSymbol(t)&&a5i(e)||rt.TypeGuard.IsNumber(t)&&Jxr(e)||rt.TypeGuard.IsInteger(t)&&Jxr(e)||rt.TypeGuard.IsBoolean(t)&&c5i(e)||rt.TypeGuard.IsUint8Array(t)&&EHa(e)||rt.TypeGuard.IsDate(t)&&_Ha(e)||rt.TypeGuard.IsConstructor(t)&&CHa(e)||rt.TypeGuard.IsFunction(t)&&vHa(e)?Bt.True:rt.TypeGuard.IsRecord(t)&&rt.TypeGuard.IsString(Xxr(t))?e[l5i.Hint]==="Record"?Bt.True:Bt.False:rt.TypeGuard.IsRecord(t)&&rt.TypeGuard.IsNumber(Xxr(t))&&bS(e,0)?Bt.True:Bt.False}a(iE,"FromObjectRight");function SHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!rt.TypeGuard.IsOptional(e.properties[r]))return Bt.False;if(rt.TypeGuard.IsOptional(e.properties[r]))return Bt.True;if(h5i(t.properties[r],e.properties[r])===Bt.False)return Bt.False}return Bt.True})():Bt.False}a(SHa,"FromObject");function THa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)&&bHa(e)?Bt.True:rt.TypeGuard.IsPromise(e)?nk(Il(t.item,e.item)):Bt.False}a(THa,"FromPromise");function Xxr(t){return Iye.PatternNumberExact in t.patternProperties?(0,twr.Number)():Iye.PatternStringExact in t.patternProperties?(0,Zxr.String)():xye("Unknown record key pattern")}a(Xxr,"RecordKey");function ewr(t){return Iye.PatternNumberExact in t.patternProperties?t.patternProperties[Iye.PatternNumberExact]:Iye.PatternStringExact in t.patternProperties?t.patternProperties[Iye.PatternStringExact]:xye("Unable to get record value schema")}a(ewr,"RecordValue");function ik(t,e){let[r,n]=[Xxr(e),ewr(e)];return rt.TypeGuard.IsLiteralString(t)&&rt.TypeGuard.IsNumber(r)&&nk(Il(t,n))===Bt.True?Bt.True:rt.TypeGuard.IsUint8Array(t)&&rt.TypeGuard.IsNumber(r)||rt.TypeGuard.IsString(t)&&rt.TypeGuard.IsNumber(r)||rt.TypeGuard.IsArray(t)&&rt.TypeGuard.IsNumber(r)?Il(t,n):rt.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(h5i(n,t.properties[o])===Bt.False)return Bt.False;return Bt.True})():Bt.False}a(ik,"FromRecordRight");function IHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?Il(ewr(t),ewr(e)):Bt.False}a(IHa,"FromRecord");function xHa(t,e){let r=rt.TypeGuard.IsRegExp(t)?(0,Zxr.String)():t,n=rt.TypeGuard.IsRegExp(e)?(0,Zxr.String)():e;return Il(r,n)}a(xHa,"FromRegExp");function m5i(t,e){return rt.TypeGuard.IsLiteral(t)&&rt.ValueGuard.IsString(t.const)||rt.TypeGuard.IsString(t)?Bt.True:Bt.False}a(m5i,"FromStringRight");function wHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsString(e)?Bt.True:Bt.False}a(wHa,"FromString");function RHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsSymbol(e)?Bt.True:Bt.False}a(RHa,"FromSymbol");function kHa(t,e){return rt.TypeGuard.IsTemplateLiteral(t)?Il((0,i5i.TemplateLiteralToUnion)(t),e):rt.TypeGuard.IsTemplateLiteral(e)?Il(t,(0,i5i.TemplateLiteralToUnion)(e)):xye("Invalid fallthrough for TemplateLiteral")}a(kHa,"FromTemplateLiteral");function PHa(t,e){return rt.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Il(r,e.items)===Bt.True)}a(PHa,"IsArrayOfTuple");function DHa(t,e){return rt.TypeGuard.IsNever(t)?Bt.True:rt.TypeGuard.IsUnknown(t)?Bt.False:rt.TypeGuard.IsAny(t)?Bt.Union:Bt.False}a(DHa,"FromTupleRight");function NHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)&&P_t(e)||rt.TypeGuard.IsArray(e)&&PHa(t,e)?Bt.True:rt.TypeGuard.IsTuple(e)?rt.ValueGuard.IsUndefined(t.items)&&!rt.ValueGuard.IsUndefined(e.items)||!rt.ValueGuard.IsUndefined(t.items)&&rt.ValueGuard.IsUndefined(e.items)?Bt.False:rt.ValueGuard.IsUndefined(t.items)&&!rt.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>Il(r,e.items[n])===Bt.True)?Bt.True:Bt.False:Bt.False}a(NHa,"FromTuple");function MHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsUint8Array(e)?Bt.True:Bt.False}a(MHa,"FromUint8Array");function OHa(t,e){return Um(e)?Qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsVoid(e)?FHa(t,e):rt.TypeGuard.IsUndefined(e)?Bt.True:Bt.False}a(OHa,"FromUndefined");function nwr(t,e){return e.anyOf.some(r=>Il(t,r)===Bt.True)?Bt.True:Bt.False}a(nwr,"FromUnionRight");function LHa(t,e){return t.anyOf.every(r=>Il(r,e)===Bt.True)?Bt.True:Bt.False}a(LHa,"FromUnion");function g5i(t,e){return Bt.True}a(g5i,"FromUnknownRight");function BHa(t,e){return rt.TypeGuard.IsNever(e)?f5i(t,e):rt.TypeGuard.IsIntersect(e)?k_t(t,e):rt.TypeGuard.IsUnion(e)?nwr(t,e):rt.TypeGuard.IsAny(e)?rwr(t,e):rt.TypeGuard.IsString(e)?m5i(t,e):rt.TypeGuard.IsNumber(e)?p5i(t,e):rt.TypeGuard.IsInteger(e)?d5i(t,e):rt.TypeGuard.IsBoolean(e)?u5i(t,e):rt.TypeGuard.IsArray(e)?rHa(t,e):rt.TypeGuard.IsTuple(e)?DHa(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsUnknown(e)?Bt.True:Bt.False}a(BHa,"FromUnknown");function FHa(t,e){return rt.TypeGuard.IsUndefined(t)||rt.TypeGuard.IsUndefined(t)?Bt.True:Bt.False}a(FHa,"FromVoidRight");function UHa(t,e){return rt.TypeGuard.IsIntersect(e)?k_t(t,e):rt.TypeGuard.IsUnion(e)?nwr(t,e):rt.TypeGuard.IsUnknown(e)?g5i(t,e):rt.TypeGuard.IsAny(e)?rwr(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsVoid(e)?Bt.True:Bt.False}a(UHa,"FromVoid");function Il(t,e){return rt.TypeGuard.IsTemplateLiteral(t)||rt.TypeGuard.IsTemplateLiteral(e)?kHa(t,e):rt.TypeGuard.IsRegExp(t)||rt.TypeGuard.IsRegExp(e)?xHa(t,e):rt.TypeGuard.IsNot(t)||rt.TypeGuard.IsNot(e)?mHa(t,e):rt.TypeGuard.IsAny(t)?tHa(t,e):rt.TypeGuard.IsArray(t)?nHa(t,e):rt.TypeGuard.IsBigInt(t)?oHa(t,e):rt.TypeGuard.IsBoolean(t)?sHa(t,e):rt.TypeGuard.IsAsyncIterator(t)?iHa(t,e):rt.TypeGuard.IsConstructor(t)?aHa(t,e):rt.TypeGuard.IsDate(t)?cHa(t,e):rt.TypeGuard.IsFunction(t)?lHa(t,e):rt.TypeGuard.IsInteger(t)?uHa(t,e):rt.TypeGuard.IsIntersect(t)?dHa(t,e):rt.TypeGuard.IsIterator(t)?fHa(t,e):rt.TypeGuard.IsLiteral(t)?pHa(t,e):rt.TypeGuard.IsNever(t)?hHa(t,e):rt.TypeGuard.IsNull(t)?gHa(t,e):rt.TypeGuard.IsNumber(t)?AHa(t,e):rt.TypeGuard.IsObject(t)?SHa(t,e):rt.TypeGuard.IsRecord(t)?IHa(t,e):rt.TypeGuard.IsString(t)?wHa(t,e):rt.TypeGuard.IsSymbol(t)?RHa(t,e):rt.TypeGuard.IsTuple(t)?NHa(t,e):rt.TypeGuard.IsPromise(t)?THa(t,e):rt.TypeGuard.IsUint8Array(t)?MHa(t,e):rt.TypeGuard.IsUndefined(t)?OHa(t,e):rt.TypeGuard.IsUnion(t)?LHa(t,e):rt.TypeGuard.IsUnknown(t)?BHa(t,e):rt.TypeGuard.IsVoid(t)?UHa(t,e):xye(`Unknown left type operand '${t[l5i.Kind]}'`)}a(Il,"Visit");function QHa(t,e){return Il(t,e)}a(QHa,"ExtendsCheck")});var swr=I(owr=>{"use strict";p();Object.defineProperty(owr,"__esModule",{value:!0});owr.ExtendsFromMappedResult=VHa;var qHa=Fm(),jHa=D_t(),HHa=yS();function GHa(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,jHa.Extends)(t[c],e,r,n,(0,HHa.Clone)(o));return s}a(GHa,"FromProperties");function $Ha(t,e,r,n,o){return GHa(t.properties,e,r,n,o)}a($Ha,"FromMappedResult");function VHa(t,e,r,n,o){let s=$Ha(t,e,r,n,o);return(0,qHa.MappedResult)(s)}a(VHa,"ExtendsFromMappedResult")});var D_t=I(cwr=>{"use strict";p();Object.defineProperty(cwr,"__esModule",{value:!0});cwr.Extends=JHa;var A5i=Pi(),WHa=Op(),awr=iwr(),zHa=lwr(),YHa=swr(),y5i=Is();function KHa(t,e,r,n){let o=(0,awr.ExtendsCheck)(t,e);return o===awr.ExtendsResult.Union?(0,WHa.Union)([r,n]):o===awr.ExtendsResult.True?r:n}a(KHa,"ExtendsResolve");function JHa(t,e,r,n,o){return(0,y5i.IsMappedResult)(t)?(0,YHa.ExtendsFromMappedResult)(t,e,r,n,o):(0,y5i.IsMappedKey)(t)?(0,A5i.CreateType)((0,zHa.ExtendsFromMappedKey)(t,e,r,n,o)):(0,A5i.CreateType)(KHa(t,e,r,n),o)}a(JHa,"Extends")});var lwr=I(uwr=>{"use strict";p();Object.defineProperty(uwr,"__esModule",{value:!0});uwr.ExtendsFromMappedKey=oGa;var ZHa=Fm(),XHa=nE(),eGa=D_t(),tGa=yS();function rGa(t,e,r,n,o){return{[t]:(0,eGa.Extends)((0,XHa.Literal)(t),e,r,n,(0,tGa.Clone)(o))}}a(rGa,"FromPropertyKey");function nGa(t,e,r,n,o){return t.reduce((s,c)=>({...s,...rGa(c,e,r,n,o)}),{})}a(nGa,"FromPropertyKeys");function iGa(t,e,r,n,o){return nGa(t.keys,e,r,n,o)}a(iGa,"FromMappedKey");function oGa(t,e,r,n,o){let s=iGa(t,e,r,n,o);return(0,ZHa.MappedResult)(s)}a(oGa,"ExtendsFromMappedKey")});var fwr=I(dwr=>{"use strict";p();Object.defineProperty(dwr,"__esModule",{value:!0});dwr.ExtendsUndefinedCheck=M_t;var N_t=Tn();function sGa(t){return t.allOf.every(e=>M_t(e))}a(sGa,"Intersect");function aGa(t){return t.anyOf.some(e=>M_t(e))}a(aGa,"Union");function cGa(t){return!M_t(t.not)}a(cGa,"Not");function M_t(t){return t[N_t.Kind]==="Intersect"?sGa(t):t[N_t.Kind]==="Union"?aGa(t):t[N_t.Kind]==="Not"?cGa(t):t[N_t.Kind]==="Undefined"}a(M_t,"ExtendsUndefinedCheck")});var ine=I(WD=>{"use strict";p();var lGa=WD&&WD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),BLe=WD&&WD.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lGa(e,t,r)};Object.defineProperty(WD,"__esModule",{value:!0});BLe(iwr(),WD);BLe(lwr(),WD);BLe(swr(),WD);BLe(fwr(),WD);BLe(D_t(),WD)});var hwr=I(pwr=>{"use strict";p();Object.defineProperty(pwr,"__esModule",{value:!0});pwr.ExcludeFromTemplateLiteral=fGa;var uGa=O_t(),dGa=GD();function fGa(t,e){return(0,uGa.Exclude)((0,dGa.TemplateLiteralToUnion)(t),e)}a(fGa,"ExcludeFromTemplateLiteral")});var O_t=I(Awr=>{"use strict";p();Object.defineProperty(Awr,"__esModule",{value:!0});Awr.Exclude=yGa;var mwr=Pi(),pGa=Op(),hGa=Bm(),L_t=ine(),mGa=ywr(),gGa=hwr(),gwr=Is();function AGa(t,e){let r=t.filter(n=>(0,L_t.ExtendsCheck)(n,e)===L_t.ExtendsResult.False);return r.length===1?r[0]:(0,pGa.Union)(r)}a(AGa,"ExcludeRest");function yGa(t,e,r={}){return(0,gwr.IsTemplateLiteral)(t)?(0,mwr.CreateType)((0,gGa.ExcludeFromTemplateLiteral)(t,e),r):(0,gwr.IsMappedResult)(t)?(0,mwr.CreateType)((0,mGa.ExcludeFromMappedResult)(t,e),r):(0,mwr.CreateType)((0,gwr.IsUnion)(t)?AGa(t.anyOf,e):(0,L_t.ExtendsCheck)(t,e)!==L_t.ExtendsResult.False?(0,hGa.Never)():t,r)}a(yGa,"Exclude")});var ywr=I(_wr=>{"use strict";p();Object.defineProperty(_wr,"__esModule",{value:!0});_wr.ExcludeFromMappedResult=bGa;var _Ga=Fm(),EGa=O_t();function vGa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,EGa.Exclude)(t[n],e);return r}a(vGa,"FromProperties");function CGa(t,e){return vGa(t.properties,e)}a(CGa,"FromMappedResult");function bGa(t,e){let r=CGa(t,e);return(0,_Ga.MappedResult)(r)}a(bGa,"ExcludeFromMappedResult")});var B_t=I(Y6=>{"use strict";p();var SGa=Y6&&Y6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ewr=Y6&&Y6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&SGa(e,t,r)};Object.defineProperty(Y6,"__esModule",{value:!0});Ewr(ywr(),Y6);Ewr(hwr(),Y6);Ewr(O_t(),Y6)});var Cwr=I(vwr=>{"use strict";p();Object.defineProperty(vwr,"__esModule",{value:!0});vwr.ExtractFromTemplateLiteral=xGa;var TGa=F_t(),IGa=GD();function xGa(t,e){return(0,TGa.Extract)((0,IGa.TemplateLiteralToUnion)(t),e)}a(xGa,"ExtractFromTemplateLiteral")});var F_t=I(Twr=>{"use strict";p();Object.defineProperty(Twr,"__esModule",{value:!0});Twr.Extract=NGa;var bwr=Pi(),wGa=Op(),RGa=Bm(),U_t=ine(),kGa=Iwr(),PGa=Cwr(),Swr=Is();function DGa(t,e){let r=t.filter(n=>(0,U_t.ExtendsCheck)(n,e)!==U_t.ExtendsResult.False);return r.length===1?r[0]:(0,wGa.Union)(r)}a(DGa,"ExtractRest");function NGa(t,e,r){return(0,Swr.IsTemplateLiteral)(t)?(0,bwr.CreateType)((0,PGa.ExtractFromTemplateLiteral)(t,e),r):(0,Swr.IsMappedResult)(t)?(0,bwr.CreateType)((0,kGa.ExtractFromMappedResult)(t,e),r):(0,bwr.CreateType)((0,Swr.IsUnion)(t)?DGa(t.anyOf,e):(0,U_t.ExtendsCheck)(t,e)!==U_t.ExtendsResult.False?t:(0,RGa.Never)(),r)}a(NGa,"Extract")});var Iwr=I(xwr=>{"use strict";p();Object.defineProperty(xwr,"__esModule",{value:!0});xwr.ExtractFromMappedResult=FGa;var MGa=Fm(),OGa=F_t();function LGa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,OGa.Extract)(t[n],e);return r}a(LGa,"FromProperties");function BGa(t,e){return LGa(t.properties,e)}a(BGa,"FromMappedResult");function FGa(t,e){let r=BGa(t,e);return(0,MGa.MappedResult)(r)}a(FGa,"ExtractFromMappedResult")});var Q_t=I(K6=>{"use strict";p();var UGa=K6&&K6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wwr=K6&&K6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UGa(e,t,r)};Object.defineProperty(K6,"__esModule",{value:!0});wwr(Iwr(),K6);wwr(Cwr(),K6);wwr(F_t(),K6)});var _5i=I(J6=>{"use strict";p();var QGa=J6&&J6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qGa=J6&&J6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jGa=J6&&J6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var WGa=one&&one.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zGa=one&&one.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WGa(e,t,r)};Object.defineProperty(one,"__esModule",{value:!0});zGa(_5i(),one)});var E5i=I(Rwr=>{"use strict";p();Object.defineProperty(Rwr,"__esModule",{value:!0});Rwr.ReadonlyOptional=JGa;var YGa=Q$(),KGa=SL();function JGa(t){return(0,YGa.Readonly)((0,KGa.Optional)(t))}a(JGa,"ReadonlyOptional")});var FLe=I(sne=>{"use strict";p();var ZGa=sne&&sne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XGa=sne&&sne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZGa(e,t,r)};Object.defineProperty(sne,"__esModule",{value:!0});XGa(E5i(),sne)});var T5i=I(wye=>{"use strict";p();Object.defineProperty(wye,"__esModule",{value:!0});wye.Record=g$a;wye.RecordPattern=Pwr;wye.RecordKey=A$a;wye.RecordValue=y$a;var e$a=Pi(),C5i=Tn(),t$a=Bm(),r$a=L$(),b5i=Wv(),v5i=B$(),n$a=Op(),i$a=GD(),ane=_Le(),S5i=$D(),o$a=Vv(),xL=Is();function cne(t,e,r){return(0,e$a.CreateType)({[C5i.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(cne,"RecordCreateFromPattern");function kwr(t,e,r){let n={};for(let o of t)n[o]=e;return(0,b5i.Object)(n,{...r,[C5i.Hint]:"Record"})}a(kwr,"RecordCreateFromKeys");function s$a(t,e,r){return(0,i$a.IsTemplateLiteralFinite)(t)?kwr((0,S5i.IndexPropertyKeys)(t),e,r):cne(t.pattern,e,r)}a(s$a,"FromTemplateLiteralKey");function a$a(t,e,r){return kwr((0,S5i.IndexPropertyKeys)((0,n$a.Union)(t)),e,r)}a(a$a,"FromUnionKey");function c$a(t,e,r){return kwr([t.toString()],e,r)}a(c$a,"FromLiteralKey");function l$a(t,e,r){return cne(t.source,e,r)}a(l$a,"FromRegExpKey");function u$a(t,e,r){let n=(0,o$a.IsUndefined)(t.pattern)?ane.PatternStringExact:t.pattern;return cne(n,e,r)}a(u$a,"FromStringKey");function d$a(t,e,r){return cne(ane.PatternStringExact,e,r)}a(d$a,"FromAnyKey");function f$a(t,e,r){return cne(ane.PatternNeverExact,e,r)}a(f$a,"FromNeverKey");function p$a(t,e,r){return(0,b5i.Object)({true:e,false:e},r)}a(p$a,"FromBooleanKey");function h$a(t,e,r){return cne(ane.PatternNumberExact,e,r)}a(h$a,"FromIntegerKey");function m$a(t,e,r){return cne(ane.PatternNumberExact,e,r)}a(m$a,"FromNumberKey");function g$a(t,e,r={}){return(0,xL.IsUnion)(t)?a$a(t.anyOf,e,r):(0,xL.IsTemplateLiteral)(t)?s$a(t,e,r):(0,xL.IsLiteral)(t)?c$a(t.const,e,r):(0,xL.IsBoolean)(t)?p$a(t,e,r):(0,xL.IsInteger)(t)?h$a(t,e,r):(0,xL.IsNumber)(t)?m$a(t,e,r):(0,xL.IsRegExp)(t)?l$a(t,e,r):(0,xL.IsString)(t)?u$a(t,e,r):(0,xL.IsAny)(t)?d$a(t,e,r):(0,xL.IsNever)(t)?f$a(t,e,r):(0,t$a.Never)(r)}a(g$a,"Record");function Pwr(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(Pwr,"RecordPattern");function A$a(t){let e=Pwr(t);return e===ane.PatternStringExact?(0,v5i.String)():e===ane.PatternNumberExact?(0,r$a.Number)():(0,v5i.String)({pattern:e})}a(A$a,"RecordKey");function y$a(t){return t.patternProperties[Pwr(t)]}a(y$a,"RecordValue")});var Rye=I(lne=>{"use strict";p();var _$a=lne&&lne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),E$a=lne&&lne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_$a(e,t,r)};Object.defineProperty(lne,"__esModule",{value:!0});E$a(T5i(),lne)});var x5i=I(wL=>{"use strict";p();var v$a=wL&&wL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),C$a=wL&&wL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),I5i=wL&&wL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o({...r,[n]:j$a(t,e[n])}),{})}a(H$a,"FromProperties");function kye(t,e){return e.map(r=>zD(t,r))}a(kye,"FromTypes");function zD(t,e){return SS.IsConstructor(e)?k$a(t,e):SS.IsFunction(e)?P$a(t,e):SS.IsIntersect(e)?D$a(t,e):SS.IsUnion(e)?N$a(t,e):SS.IsTuple(e)?M$a(t,e):SS.IsArray(e)?O$a(t,e):SS.IsAsyncIterator(e)?L$a(t,e):SS.IsIterator(e)?B$a(t,e):SS.IsPromise(e)?F$a(t,e):SS.IsObject(e)?U$a(t,e):SS.IsRecord(e)?Q$a(t,e):SS.IsArgument(e)?q$a(t,e):e}a(zD,"FromType");function G$a(t,e){return zD(e,(0,b$a.CloneType)(t))}a(G$a,"Instantiate")});var j_t=I(une=>{"use strict";p();var $$a=une&&une.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),V$a=une&&une.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$$a(e,t,r)};Object.defineProperty(une,"__esModule",{value:!0});V$a(x5i(),une)});var w5i=I(Nwr=>{"use strict";p();Object.defineProperty(Nwr,"__esModule",{value:!0});Nwr.Integer=Y$a;var W$a=Pi(),z$a=Tn();function Y$a(t){return(0,W$a.CreateType)({[z$a.Kind]:"Integer",type:"integer"},t)}a(Y$a,"Integer")});var H_t=I(dne=>{"use strict";p();var K$a=dne&&dne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),J$a=dne&&dne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&K$a(e,t,r)};Object.defineProperty(dne,"__esModule",{value:!0});J$a(w5i(),dne)});var Owr=I(Mwr=>{"use strict";p();Object.defineProperty(Mwr,"__esModule",{value:!0});Mwr.IntrinsicFromMappedKey=oVa;var Z$a=Fm(),X$a=fne(),eVa=nE(),tVa=yS();function rVa(t,e,r){return{[t]:(0,X$a.Intrinsic)((0,eVa.Literal)(t),e,(0,tVa.Clone)(r))}}a(rVa,"MappedIntrinsicPropertyKey");function nVa(t,e,r){return t.reduce((o,s)=>({...o,...rVa(s,e,r)}),{})}a(nVa,"MappedIntrinsicPropertyKeys");function iVa(t,e,r){return nVa(t.keys,e,r)}a(iVa,"MappedIntrinsicProperties");function oVa(t,e,r){let n=iVa(t,e,r);return(0,Z$a.MappedResult)(n)}a(oVa,"IntrinsicFromMappedKey")});var fne=I(Lwr=>{"use strict";p();Object.defineProperty(Lwr,"__esModule",{value:!0});Lwr.Intrinsic=N5i;var sVa=Pi(),G_t=GD(),aVa=Owr(),R5i=nE(),k5i=Op(),$_t=Is();function cVa(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(cVa,"ApplyUncapitalize");function lVa(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(lVa,"ApplyCapitalize");function uVa(t){return t.toUpperCase()}a(uVa,"ApplyUppercase");function dVa(t){return t.toLowerCase()}a(dVa,"ApplyLowercase");function fVa(t,e,r){let n=(0,G_t.TemplateLiteralParseExact)(t.pattern);if(!(0,G_t.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:P5i(t.pattern,e)};let c=[...(0,G_t.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,R5i.Literal)(d)),l=D5i(c,e),u=(0,k5i.Union)(l);return(0,G_t.TemplateLiteral)([u],r)}a(fVa,"FromTemplateLiteral");function P5i(t,e){return typeof t=="string"?e==="Uncapitalize"?cVa(t):e==="Capitalize"?lVa(t):e==="Uppercase"?uVa(t):e==="Lowercase"?dVa(t):t:t.toString()}a(P5i,"FromLiteralValue");function D5i(t,e){return t.map(r=>N5i(r,e))}a(D5i,"FromRest");function N5i(t,e,r={}){return(0,$_t.IsMappedKey)(t)?(0,aVa.IntrinsicFromMappedKey)(t,e,r):(0,$_t.IsTemplateLiteral)(t)?fVa(t,e,r):(0,$_t.IsUnion)(t)?(0,k5i.Union)(D5i(t.anyOf,e),r):(0,$_t.IsLiteral)(t)?(0,R5i.Literal)(P5i(t.const,e),r):(0,sVa.CreateType)(t,r)}a(N5i,"Intrinsic")});var M5i=I(Bwr=>{"use strict";p();Object.defineProperty(Bwr,"__esModule",{value:!0});Bwr.Capitalize=hVa;var pVa=fne();function hVa(t,e={}){return(0,pVa.Intrinsic)(t,"Capitalize",e)}a(hVa,"Capitalize")});var O5i=I(Fwr=>{"use strict";p();Object.defineProperty(Fwr,"__esModule",{value:!0});Fwr.Lowercase=gVa;var mVa=fne();function gVa(t,e={}){return(0,mVa.Intrinsic)(t,"Lowercase",e)}a(gVa,"Lowercase")});var L5i=I(Uwr=>{"use strict";p();Object.defineProperty(Uwr,"__esModule",{value:!0});Uwr.Uncapitalize=yVa;var AVa=fne();function yVa(t,e={}){return(0,AVa.Intrinsic)(t,"Uncapitalize",e)}a(yVa,"Uncapitalize")});var B5i=I(Qwr=>{"use strict";p();Object.defineProperty(Qwr,"__esModule",{value:!0});Qwr.Uppercase=EVa;var _Va=fne();function EVa(t,e={}){return(0,_Va.Intrinsic)(t,"Uppercase",e)}a(EVa,"Uppercase")});var V_t=I(ok=>{"use strict";p();var vVa=ok&&ok.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pye=ok&&ok.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vVa(e,t,r)};Object.defineProperty(ok,"__esModule",{value:!0});Pye(M5i(),ok);Pye(Owr(),ok);Pye(fne(),ok);Pye(O5i(),ok);Pye(L5i(),ok);Pye(B5i(),ok)});var jwr=I(qwr=>{"use strict";p();Object.defineProperty(qwr,"__esModule",{value:!0});qwr.OmitFromMappedResult=xVa;var CVa=Fm(),bVa=W_t(),SVa=yS();function TVa(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,bVa.Omit)(t[o],e,(0,SVa.Clone)(r));return n}a(TVa,"FromProperties");function IVa(t,e,r){return TVa(t.properties,e,r)}a(IVa,"FromMappedResult");function xVa(t,e,r){let n=IVa(t,e,r);return(0,CVa.MappedResult)(n)}a(xVa,"OmitFromMappedResult")});var W_t=I($wr=>{"use strict";p();Object.defineProperty($wr,"__esModule",{value:!0});$wr.Omit=HVa;var wVa=Pi(),RVa=a_t(),kVa=mLe(),Hwr=M$(),PVa=nE(),DVa=$D(),NVa=TI(),F5i=Op(),U5i=Wv(),MVa=Vwr(),OVa=jwr(),Z6=Is(),LVa=Vv();function BVa(t,e){return t.map(r=>Gwr(r,e))}a(BVa,"FromIntersect");function FVa(t,e){return t.map(r=>Gwr(r,e))}a(FVa,"FromUnion");function UVa(t,e){let{[e]:r,...n}=t;return n}a(UVa,"FromProperty");function QVa(t,e){return e.reduce((r,n)=>UVa(r,n),t)}a(QVa,"FromProperties");function qVa(t,e,r){let n=(0,RVa.Discard)(t,[kVa.TransformKind,"$id","required","properties"]),o=QVa(r,e);return(0,U5i.Object)(o,n)}a(qVa,"FromObject");function jVa(t){let e=t.reduce((r,n)=>(0,Z6.IsLiteralValue)(n)?[...r,(0,PVa.Literal)(n)]:r,[]);return(0,F5i.Union)(e)}a(jVa,"UnionFromPropertyKeys");function Gwr(t,e){return(0,Z6.IsIntersect)(t)?(0,NVa.Intersect)(BVa(t.allOf,e)):(0,Z6.IsUnion)(t)?(0,F5i.Union)(FVa(t.anyOf,e)):(0,Z6.IsObject)(t)?qVa(t,e,t.properties):(0,U5i.Object)({})}a(Gwr,"OmitResolve");function HVa(t,e,r){let n=(0,LVa.IsArray)(e)?jVa(e):e,o=(0,Z6.IsSchema)(e)?(0,DVa.IndexPropertyKeys)(e):e,s=(0,Z6.IsRef)(t),c=(0,Z6.IsRef)(e);return(0,Z6.IsMappedResult)(t)?(0,OVa.OmitFromMappedResult)(t,o,r):(0,Z6.IsMappedKey)(e)?(0,MVa.OmitFromMappedKey)(t,e,r):s&&c?(0,Hwr.Computed)("Omit",[t,n],r):!s&&c?(0,Hwr.Computed)("Omit",[t,n],r):s&&!c?(0,Hwr.Computed)("Omit",[t,n],r):(0,wVa.CreateType)({...Gwr(t,o),...r})}a(HVa,"Omit")});var Vwr=I(Wwr=>{"use strict";p();Object.defineProperty(Wwr,"__esModule",{value:!0});Wwr.OmitFromMappedKey=KVa;var GVa=Fm(),$Va=W_t(),VVa=yS();function WVa(t,e,r){return{[e]:(0,$Va.Omit)(t,[e],(0,VVa.Clone)(r))}}a(WVa,"FromPropertyKey");function zVa(t,e,r){return e.reduce((n,o)=>({...n,...WVa(t,o,r)}),{})}a(zVa,"FromPropertyKeys");function YVa(t,e,r){return zVa(t,e.keys,r)}a(YVa,"FromMappedKey");function KVa(t,e,r){let n=YVa(t,e,r);return(0,GVa.MappedResult)(n)}a(KVa,"OmitFromMappedKey")});var ULe=I(X6=>{"use strict";p();var JVa=X6&&X6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zwr=X6&&X6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JVa(e,t,r)};Object.defineProperty(X6,"__esModule",{value:!0});zwr(Vwr(),X6);zwr(jwr(),X6);zwr(W_t(),X6)});var Kwr=I(Ywr=>{"use strict";p();Object.defineProperty(Ywr,"__esModule",{value:!0});Ywr.PickFromMappedResult=nWa;var ZVa=Fm(),XVa=z_t(),eWa=yS();function tWa(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,XVa.Pick)(t[o],e,(0,eWa.Clone)(r));return n}a(tWa,"FromProperties");function rWa(t,e,r){return tWa(t.properties,e,r)}a(rWa,"FromMappedResult");function nWa(t,e,r){let n=rWa(t,e,r);return(0,ZVa.MappedResult)(n)}a(nWa,"PickFromMappedResult")});var z_t=I(Xwr=>{"use strict";p();Object.defineProperty(Xwr,"__esModule",{value:!0});Xwr.Pick=yWa;var iWa=Pi(),oWa=a_t(),Jwr=M$(),sWa=TI(),aWa=nE(),Q5i=Wv(),q5i=Op(),cWa=$D(),lWa=mLe(),eU=Is(),uWa=Vv(),dWa=eRr(),fWa=Kwr();function pWa(t,e){return t.map(r=>Zwr(r,e))}a(pWa,"FromIntersect");function hWa(t,e){return t.map(r=>Zwr(r,e))}a(hWa,"FromUnion");function mWa(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(mWa,"FromProperties");function gWa(t,e,r){let n=(0,oWa.Discard)(t,[lWa.TransformKind,"$id","required","properties"]),o=mWa(r,e);return(0,Q5i.Object)(o,n)}a(gWa,"FromObject");function AWa(t){let e=t.reduce((r,n)=>(0,eU.IsLiteralValue)(n)?[...r,(0,aWa.Literal)(n)]:r,[]);return(0,q5i.Union)(e)}a(AWa,"UnionFromPropertyKeys");function Zwr(t,e){return(0,eU.IsIntersect)(t)?(0,sWa.Intersect)(pWa(t.allOf,e)):(0,eU.IsUnion)(t)?(0,q5i.Union)(hWa(t.anyOf,e)):(0,eU.IsObject)(t)?gWa(t,e,t.properties):(0,Q5i.Object)({})}a(Zwr,"PickResolve");function yWa(t,e,r){let n=(0,uWa.IsArray)(e)?AWa(e):e,o=(0,eU.IsSchema)(e)?(0,cWa.IndexPropertyKeys)(e):e,s=(0,eU.IsRef)(t),c=(0,eU.IsRef)(e);return(0,eU.IsMappedResult)(t)?(0,fWa.PickFromMappedResult)(t,o,r):(0,eU.IsMappedKey)(e)?(0,dWa.PickFromMappedKey)(t,e,r):s&&c?(0,Jwr.Computed)("Pick",[t,n],r):!s&&c?(0,Jwr.Computed)("Pick",[t,n],r):s&&!c?(0,Jwr.Computed)("Pick",[t,n],r):(0,iWa.CreateType)({...Zwr(t,o),...r})}a(yWa,"Pick")});var eRr=I(tRr=>{"use strict";p();Object.defineProperty(tRr,"__esModule",{value:!0});tRr.PickFromMappedKey=TWa;var _Wa=Fm(),EWa=z_t(),vWa=yS();function CWa(t,e,r){return{[e]:(0,EWa.Pick)(t,[e],(0,vWa.Clone)(r))}}a(CWa,"FromPropertyKey");function bWa(t,e,r){return e.reduce((n,o)=>({...n,...CWa(t,o,r)}),{})}a(bWa,"FromPropertyKeys");function SWa(t,e,r){return bWa(t,e.keys,r)}a(SWa,"FromMappedKey");function TWa(t,e,r){let n=SWa(t,e,r);return(0,_Wa.MappedResult)(n)}a(TWa,"PickFromMappedKey")});var QLe=I(tU=>{"use strict";p();var IWa=tU&&tU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rRr=tU&&tU.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IWa(e,t,r)};Object.defineProperty(tU,"__esModule",{value:!0});rRr(eRr(),tU);rRr(Kwr(),tU);rRr(z_t(),tU)});var iRr=I(rU=>{"use strict";p();var xWa=rU&&rU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wWa=rU&&rU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),RWa=rU&&rU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oG5i(e))}a(j5i,"FromRest");function G5i(t){return Yv.IsComputed(t)?FWa(t.target,t.parameters):Yv.IsRef(t)?UWa(t.$ref):Yv.IsIntersect(t)?(0,DWa.Intersect)(j5i(t.allOf)):Yv.IsUnion(t)?(0,NWa.Union)(j5i(t.anyOf)):Yv.IsObject(t)?qWa(t,t.properties):Yv.IsBigInt(t)||Yv.IsBoolean(t)||Yv.IsInteger(t)||Yv.IsLiteral(t)||Yv.IsNull(t)||Yv.IsNumber(t)||Yv.IsString(t)||Yv.IsSymbol(t)||Yv.IsUndefined(t)?t:(0,H5i.Object)({})}a(G5i,"PartialResolve");function jWa(t,e){return Yv.IsMappedResult(t)?(0,BWa.PartialFromMappedResult)(t,e):(0,kWa.CreateType)({...G5i(t),...e})}a(jWa,"Partial")});var oRr=I(sRr=>{"use strict";p();Object.defineProperty(sRr,"__esModule",{value:!0});sRr.PartialFromMappedResult=zWa;var HWa=Fm(),GWa=iRr(),$Wa=yS();function VWa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,GWa.Partial)(t[n],(0,$Wa.Clone)(e));return r}a(VWa,"FromProperties");function WWa(t,e){return VWa(t.properties,e)}a(WWa,"FromMappedResult");function zWa(t,e){let r=WWa(t,e);return(0,HWa.MappedResult)(r)}a(zWa,"PartialFromMappedResult")});var qLe=I(G$=>{"use strict";p();var YWa=G$&&G$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$5i=G$&&G$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YWa(e,t,r)};Object.defineProperty(G$,"__esModule",{value:!0});$5i(oRr(),G$);$5i(iRr(),G$)});var cRr=I(nU=>{"use strict";p();var KWa=nU&&nU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JWa=nU&&nU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ZWa=nU&&nU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oK5i(e))}a(V5i,"FromRest");function K5i(t){return Kv.IsComputed(t)?iza(t.target,t.parameters):Kv.IsRef(t)?oza(t.$ref):Kv.IsIntersect(t)?(0,eza.Intersect)(V5i(t.allOf)):Kv.IsUnion(t)?(0,tza.Union)(V5i(t.anyOf)):Kv.IsObject(t)?aza(t,t.properties):Kv.IsBigInt(t)||Kv.IsBoolean(t)||Kv.IsInteger(t)||Kv.IsLiteral(t)||Kv.IsNull(t)||Kv.IsNumber(t)||Kv.IsString(t)||Kv.IsSymbol(t)||Kv.IsUndefined(t)?t:(0,W5i.Object)({})}a(K5i,"RequiredResolve");function cza(t,e){return Kv.IsMappedResult(t)?(0,nza.RequiredFromMappedResult)(t,e):(0,XWa.CreateType)({...K5i(t),...e})}a(cza,"Required")});var lRr=I(uRr=>{"use strict";p();Object.defineProperty(uRr,"__esModule",{value:!0});uRr.RequiredFromMappedResult=pza;var lza=Fm(),uza=cRr();function dza(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,uza.Required)(t[n],e);return r}a(dza,"FromProperties");function fza(t,e){return dza(t.properties,e)}a(fza,"FromMappedResult");function pza(t,e){let r=fza(t,e);return(0,lza.MappedResult)(r)}a(pza,"RequiredFromMappedResult")});var jLe=I($$=>{"use strict";p();var hza=$$&&$$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),J5i=$$&&$$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hza(e,t,r)};Object.defineProperty($$,"__esModule",{value:!0});J5i(lRr(),$$);J5i(cRr(),$$)});var t4i=I(YD=>{"use strict";p();var mza=YD&&YD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gza=YD&&YD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Aza=YD&&YD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oky.IsRef(r)?fRr(t,r.$ref):IS(t,r))}a(Oza,"DereferenceParameters");function fRr(t,e){return e in t?ky.IsRef(t[e])?fRr(t,t[e].$ref):IS(t,t[e]):(0,dRr.Never)()}a(fRr,"Dereference");function Lza(t){return(0,Eza.Awaited)(t[0])}a(Lza,"FromAwaited");function Bza(t){return(0,bza.Index)(t[0],t[1])}a(Bza,"FromIndex");function Fza(t){return(0,xza.KeyOf)(t[0])}a(Fza,"FromKeyOf");function Uza(t){return(0,Pza.Partial)(t[0])}a(Uza,"FromPartial");function Qza(t){return(0,Rza.Omit)(t[0],t[1])}a(Qza,"FromOmit");function qza(t){return(0,kza.Pick)(t[0],t[1])}a(qza,"FromPick");function jza(t){return(0,Dza.Required)(t[0])}a(jza,"FromRequired");function Hza(t,e,r){let n=Oza(t,r);return e==="Awaited"?Lza(n):e==="Index"?Bza(n):e==="KeyOf"?Fza(n):e==="Partial"?Uza(n):e==="Omit"?Qza(n):e==="Pick"?qza(n):e==="Required"?jza(n):(0,dRr.Never)()}a(Hza,"FromComputed");function Gza(t,e){return(0,_za.Array)(IS(t,e))}a(Gza,"FromArray");function $za(t,e){return(0,vza.AsyncIterator)(IS(t,e))}a($za,"FromAsyncIterator");function Vza(t,e,r){return(0,Cza.Constructor)(HLe(t,e),IS(t,r))}a(Vza,"FromConstructor");function Wza(t,e,r){return(0,Sza.Function)(HLe(t,e),IS(t,r))}a(Wza,"FromFunction");function zza(t,e){return(0,Tza.Intersect)(HLe(t,e))}a(zza,"FromIntersect");function Yza(t,e){return(0,Iza.Iterator)(IS(t,e))}a(Yza,"FromIterator");function Kza(t,e){return(0,wza.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:IS(t,e[n])}),{}))}a(Kza,"FromObject");function Jza(t,e){let[r,n]=[IS(t,(0,X5i.RecordValue)(e)),(0,X5i.RecordPattern)(e)],o=(0,yza.CloneType)(e);return o.patternProperties[n]=r,o}a(Jza,"FromRecord");function Zza(t,e){return ky.IsRef(e)?{...fRr(t,e.$ref),[Y_t.TransformKind]:e[Y_t.TransformKind]}:e}a(Zza,"FromTransform");function Xza(t,e){return(0,Nza.Tuple)(HLe(t,e))}a(Xza,"FromTuple");function eYa(t,e){return(0,Mza.Union)(HLe(t,e))}a(eYa,"FromUnion");function HLe(t,e){return e.map(r=>IS(t,r))}a(HLe,"FromTypes");function IS(t,e){return ky.IsOptional(e)?(0,TS.CreateType)(IS(t,(0,Z5i.Discard)(e,[Y_t.OptionalKind])),e):ky.IsReadonly(e)?(0,TS.CreateType)(IS(t,(0,Z5i.Discard)(e,[Y_t.ReadonlyKind])),e):ky.IsTransform(e)?(0,TS.CreateType)(Zza(t,e),e):ky.IsArray(e)?(0,TS.CreateType)(Gza(t,e.items),e):ky.IsAsyncIterator(e)?(0,TS.CreateType)($za(t,e.items),e):ky.IsComputed(e)?(0,TS.CreateType)(Hza(t,e.target,e.parameters)):ky.IsConstructor(e)?(0,TS.CreateType)(Vza(t,e.parameters,e.returns),e):ky.IsFunction(e)?(0,TS.CreateType)(Wza(t,e.parameters,e.returns),e):ky.IsIntersect(e)?(0,TS.CreateType)(zza(t,e.allOf),e):ky.IsIterator(e)?(0,TS.CreateType)(Yza(t,e.items),e):ky.IsObject(e)?(0,TS.CreateType)(Kza(t,e.properties),e):ky.IsRecord(e)?(0,TS.CreateType)(Jza(t,e)):ky.IsTuple(e)?(0,TS.CreateType)(Xza(t,e.items||[]),e):ky.IsUnion(e)?(0,TS.CreateType)(eYa(t,e.anyOf),e):e}a(IS,"FromType");function e4i(t,e){return e in t?IS(t,t[e]):(0,dRr.Never)()}a(e4i,"ComputeType");function tYa(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:e4i(t,r)}),{})}a(tYa,"ComputeModuleProperties")});var n4i=I(GLe=>{"use strict";p();Object.defineProperty(GLe,"__esModule",{value:!0});GLe.TModule=void 0;GLe.Module=iYa;var r4i=Q6(),rYa=Tn(),nYa=t4i(),K_t=class{static{a(this,"TModule")}constructor(e){let r=(0,nYa.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,r4i.CreateType)(this.$defs[e],r)};return(0,r4i.CreateType)({[rYa.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};GLe.TModule=K_t;function iYa(t){return new K_t(t)}a(iYa,"Module")});var J_t=I(pne=>{"use strict";p();var oYa=pne&&pne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sYa=pne&&pne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&oYa(e,t,r)};Object.defineProperty(pne,"__esModule",{value:!0});sYa(n4i(),pne)});var i4i=I(pRr=>{"use strict";p();Object.defineProperty(pRr,"__esModule",{value:!0});pRr.Not=lYa;var aYa=Pi(),cYa=Tn();function lYa(t,e){return(0,aYa.CreateType)({[cYa.Kind]:"Not",not:t},e)}a(lYa,"Not")});var Z_t=I(hne=>{"use strict";p();var uYa=hne&&hne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dYa=hne&&hne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uYa(e,t,r)};Object.defineProperty(hne,"__esModule",{value:!0});dYa(i4i(),hne)});var o4i=I(iU=>{"use strict";p();var fYa=iU&&iU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pYa=iU&&iU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hYa=iU&&iU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var _Ya=mne&&mne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EYa=mne&&mne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Ya(e,t,r)};Object.defineProperty(mne,"__esModule",{value:!0});EYa(o4i(),mne)});var a4i=I(hRr=>{"use strict";p();Object.defineProperty(hRr,"__esModule",{value:!0});hRr.Recursive=TYa;var vYa=Xyt(),CYa=Pi(),bYa=Vv(),s4i=Tn(),SYa=0;function TYa(t,e={}){(0,bYa.IsUndefined)(e.$id)&&(e.$id=`T${SYa++}`);let r=(0,vYa.CloneType)(t({[s4i.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,CYa.CreateType)({[s4i.Hint]:"Recursive",...r},e)}a(TYa,"Recursive")});var eEt=I(gne=>{"use strict";p();var IYa=gne&&gne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xYa=gne&&gne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IYa(e,t,r)};Object.defineProperty(gne,"__esModule",{value:!0});xYa(a4i(),gne)});var c4i=I(mRr=>{"use strict";p();Object.defineProperty(mRr,"__esModule",{value:!0});mRr.RegExp=PYa;var wYa=Pi(),RYa=Vv(),kYa=Tn();function PYa(t,e){let r=(0,RYa.IsString)(t)?new globalThis.RegExp(t):t;return(0,wYa.CreateType)({[kYa.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(PYa,"RegExp")});var tEt=I(Ane=>{"use strict";p();var DYa=Ane&&Ane.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NYa=Ane&&Ane.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&DYa(e,t,r)};Object.defineProperty(Ane,"__esModule",{value:!0});NYa(c4i(),Ane)});var l4i=I(ARr=>{"use strict";p();Object.defineProperty(ARr,"__esModule",{value:!0});ARr.Rest=OYa;var gRr=Is();function MYa(t){return(0,gRr.IsIntersect)(t)?t.allOf:(0,gRr.IsUnion)(t)?t.anyOf:(0,gRr.IsTuple)(t)?t.items??[]:[]}a(MYa,"RestResolve");function OYa(t){return MYa(t)}a(OYa,"Rest")});var rEt=I(yne=>{"use strict";p();var LYa=yne&&yne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),BYa=yne&&yne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LYa(e,t,r)};Object.defineProperty(yne,"__esModule",{value:!0});BYa(l4i(),yne)});var u4i=I(oU=>{"use strict";p();var FYa=oU&&oU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UYa=oU&&oU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),QYa=oU&&oU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var $Ya=_ne&&_ne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),VYa=_ne&&_ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Ya(e,t,r)};Object.defineProperty(_ne,"__esModule",{value:!0});VYa(u4i(),_ne)});var f4i=I(d4i=>{"use strict";p();Object.defineProperty(d4i,"__esModule",{value:!0})});var h4i=I(p4i=>{"use strict";p();Object.defineProperty(p4i,"__esModule",{value:!0});var v9p=Tn()});var g4i=I(V$=>{"use strict";p();var WYa=V$&&V$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),m4i=V$&&V$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WYa(e,t,r)};Object.defineProperty(V$,"__esModule",{value:!0});m4i(f4i(),V$);m4i(h4i(),V$)});var y4i=I(A4i=>{"use strict";p();Object.defineProperty(A4i,"__esModule",{value:!0})});var _4i=I(Ene=>{"use strict";p();var zYa=Ene&&Ene.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YYa=Ene&&Ene.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zYa(e,t,r)};Object.defineProperty(Ene,"__esModule",{value:!0});YYa(y4i(),Ene)});var E4i=I(vne=>{"use strict";p();Object.defineProperty(vne,"__esModule",{value:!0});vne.TransformEncodeBuilder=vne.TransformDecodeBuilder=void 0;vne.Transform=JYa;var iEt=Tn(),KYa=Is(),oEt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new sEt(this.schema,e)}};vne.TransformDecodeBuilder=oEt;var sEt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[iEt.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[iEt.TransformKind].Decode(c)),"Decode")};return{...r,[iEt.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[iEt.TransformKind]:n}}Encode(e){return(0,KYa.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};vne.TransformEncodeBuilder=sEt;function JYa(t){return new oEt(t)}a(JYa,"Transform")});var aEt=I(Cne=>{"use strict";p();var ZYa=Cne&&Cne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XYa=Cne&&Cne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZYa(e,t,r)};Object.defineProperty(Cne,"__esModule",{value:!0});XYa(E4i(),Cne)});var C4i=I(yRr=>{"use strict";p();Object.defineProperty(yRr,"__esModule",{value:!0});yRr.Unsafe=tKa;var eKa=Pi(),v4i=Tn();function tKa(t={}){return(0,eKa.CreateType)({[v4i.Kind]:t[v4i.Kind]??"Unsafe"},t)}a(tKa,"Unsafe")});var $Le=I(bne=>{"use strict";p();var rKa=bne&&bne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nKa=bne&&bne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rKa(e,t,r)};Object.defineProperty(bne,"__esModule",{value:!0});nKa(C4i(),bne)});var b4i=I(_Rr=>{"use strict";p();Object.defineProperty(_Rr,"__esModule",{value:!0});_Rr.Void=sKa;var iKa=Pi(),oKa=Tn();function sKa(t){return(0,iKa.CreateType)({[oKa.Kind]:"Void",type:"void"},t)}a(sKa,"Void")});var cEt=I(Sne=>{"use strict";p();var aKa=Sne&&Sne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cKa=Sne&&Sne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&aKa(e,t,r)};Object.defineProperty(Sne,"__esModule",{value:!0});cKa(b4i(),Sne)});var vRr=I(uEt=>{"use strict";p();Object.defineProperty(uEt,"__esModule",{value:!0});uEt.JsonTypeBuilder=void 0;var lKa=mye(),uKa=gye(),dKa=bLe(),fKa=S_t(),pKa=I_t(),hKa=w_t(),mKa=B_t(),gKa=ine(),AKa=Q_t(),yKa=$D(),_Ka=H_t(),EKa=TI(),lEt=V_t(),vKa=VD(),CKa=nE(),bKa=Fm(),SKa=Bm(),TKa=Z_t(),IKa=NLe(),xKa=J_t(),wKa=L$(),RKa=Wv(),kKa=ULe(),PKa=SL(),DKa=qLe(),NKa=QLe(),MKa=Q$(),OKa=FLe(),LKa=Rye(),BKa=eEt(),FKa=j$(),UKa=jLe(),QKa=rEt(),qKa=B$(),jKa=GD(),HKa=aEt(),GKa=$6(),$Ka=Op(),VKa=H$(),WKa=$Le(),ERr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,OKa.ReadonlyOptional)(e)}Readonly(e,r){return(0,MKa.Readonly)(e,r??!0)}Optional(e,r){return(0,PKa.Optional)(e,r??!0)}Any(e){return(0,lKa.Any)(e)}Array(e,r){return(0,uKa.Array)(e,r)}Boolean(e){return(0,dKa.Boolean)(e)}Capitalize(e,r){return(0,lEt.Capitalize)(e,r)}Composite(e,r){return(0,fKa.Composite)(e,r)}Const(e,r){return(0,pKa.Const)(e,r)}Enum(e,r){return(0,hKa.Enum)(e,r)}Exclude(e,r,n){return(0,mKa.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,gKa.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,AKa.Extract)(e,r,n)}Index(e,r,n){return(0,yKa.Index)(e,r,n)}Integer(e){return(0,_Ka.Integer)(e)}Intersect(e,r){return(0,EKa.Intersect)(e,r)}KeyOf(e,r){return(0,vKa.KeyOf)(e,r)}Literal(e,r){return(0,CKa.Literal)(e,r)}Lowercase(e,r){return(0,lEt.Lowercase)(e,r)}Mapped(e,r,n){return(0,bKa.Mapped)(e,r,n)}Module(e){return(0,xKa.Module)(e)}Never(e){return(0,SKa.Never)(e)}Not(e,r){return(0,TKa.Not)(e,r)}Null(e){return(0,IKa.Null)(e)}Number(e){return(0,wKa.Number)(e)}Object(e,r){return(0,RKa.Object)(e,r)}Omit(e,r,n){return(0,kKa.Omit)(e,r,n)}Partial(e,r){return(0,DKa.Partial)(e,r)}Pick(e,r,n){return(0,NKa.Pick)(e,r,n)}Record(e,r,n){return(0,LKa.Record)(e,r,n)}Recursive(e,r){return(0,BKa.Recursive)(e,r)}Ref(...e){return(0,FKa.Ref)(e[0],e[1])}Required(e,r){return(0,UKa.Required)(e,r)}Rest(e){return(0,QKa.Rest)(e)}String(e){return(0,qKa.String)(e)}TemplateLiteral(e,r){return(0,jKa.TemplateLiteral)(e,r)}Transform(e){return(0,HKa.Transform)(e)}Tuple(e,r){return(0,GKa.Tuple)(e,r)}Uncapitalize(e,r){return(0,lEt.Uncapitalize)(e,r)}Union(e,r){return(0,$Ka.Union)(e,r)}Unknown(e){return(0,VKa.Unknown)(e)}Unsafe(e){return(0,WKa.Unsafe)(e)}Uppercase(e,r){return(0,lEt.Uppercase)(e,r)}};uEt.JsonTypeBuilder=ERr});var S4i=I(Lt=>{"use strict";p();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.Rest=Lt.Required=Lt.RegExp=Lt.Ref=Lt.Recursive=Lt.Record=Lt.ReadonlyOptional=Lt.Readonly=Lt.Promise=Lt.Pick=Lt.Partial=Lt.Parameters=Lt.Optional=Lt.Omit=Lt.Object=Lt.Number=Lt.Null=Lt.Not=Lt.Never=Lt.Module=Lt.Mapped=Lt.Literal=Lt.KeyOf=Lt.Iterator=Lt.Uppercase=Lt.Lowercase=Lt.Uncapitalize=Lt.Capitalize=Lt.Intersect=Lt.Integer=Lt.Instantiate=Lt.InstanceType=Lt.Index=Lt.Function=Lt.Extract=Lt.Extends=Lt.Exclude=Lt.Enum=Lt.Date=Lt.ConstructorParameters=Lt.Constructor=Lt.Const=Lt.Composite=Lt.Boolean=Lt.BigInt=Lt.Awaited=Lt.AsyncIterator=Lt.Array=Lt.Argument=Lt.Any=void 0;Lt.Void=Lt.Unsafe=Lt.Unknown=Lt.Union=Lt.Undefined=Lt.Uint8Array=Lt.Tuple=Lt.Transform=Lt.TemplateLiteral=Lt.Symbol=Lt.String=Lt.ReturnType=void 0;var zKa=mye();Object.defineProperty(Lt,"Any",{enumerable:!0,get:a(function(){return zKa.Any},"get")});var YKa=s_t();Object.defineProperty(Lt,"Argument",{enumerable:!0,get:a(function(){return YKa.Argument},"get")});var KKa=gye();Object.defineProperty(Lt,"Array",{enumerable:!0,get:a(function(){return KKa.Array},"get")});var JKa=Aye();Object.defineProperty(Lt,"AsyncIterator",{enumerable:!0,get:a(function(){return JKa.AsyncIterator},"get")});var ZKa=PLe();Object.defineProperty(Lt,"Awaited",{enumerable:!0,get:a(function(){return ZKa.Awaited},"get")});var XKa=Cye();Object.defineProperty(Lt,"BigInt",{enumerable:!0,get:a(function(){return XKa.BigInt},"get")});var eJa=bLe();Object.defineProperty(Lt,"Boolean",{enumerable:!0,get:a(function(){return eJa.Boolean},"get")});var tJa=S_t();Object.defineProperty(Lt,"Composite",{enumerable:!0,get:a(function(){return tJa.Composite},"get")});var rJa=I_t();Object.defineProperty(Lt,"Const",{enumerable:!0,get:a(function(){return rJa.Const},"get")});var nJa=yye();Object.defineProperty(Lt,"Constructor",{enumerable:!0,get:a(function(){return nJa.Constructor},"get")});var iJa=x_t();Object.defineProperty(Lt,"ConstructorParameters",{enumerable:!0,get:a(function(){return iJa.ConstructorParameters},"get")});var oJa=DLe();Object.defineProperty(Lt,"Date",{enumerable:!0,get:a(function(){return oJa.Date},"get")});var sJa=w_t();Object.defineProperty(Lt,"Enum",{enumerable:!0,get:a(function(){return sJa.Enum},"get")});var aJa=B_t();Object.defineProperty(Lt,"Exclude",{enumerable:!0,get:a(function(){return aJa.Exclude},"get")});var cJa=ine();Object.defineProperty(Lt,"Extends",{enumerable:!0,get:a(function(){return cJa.Extends},"get")});var lJa=Q_t();Object.defineProperty(Lt,"Extract",{enumerable:!0,get:a(function(){return lJa.Extract},"get")});var uJa=O$();Object.defineProperty(Lt,"Function",{enumerable:!0,get:a(function(){return uJa.Function},"get")});var dJa=$D();Object.defineProperty(Lt,"Index",{enumerable:!0,get:a(function(){return dJa.Index},"get")});var fJa=q_t();Object.defineProperty(Lt,"InstanceType",{enumerable:!0,get:a(function(){return fJa.InstanceType},"get")});var pJa=j_t();Object.defineProperty(Lt,"Instantiate",{enumerable:!0,get:a(function(){return pJa.Instantiate},"get")});var hJa=H_t();Object.defineProperty(Lt,"Integer",{enumerable:!0,get:a(function(){return hJa.Integer},"get")});var mJa=TI();Object.defineProperty(Lt,"Intersect",{enumerable:!0,get:a(function(){return mJa.Intersect},"get")});var dEt=V_t();Object.defineProperty(Lt,"Capitalize",{enumerable:!0,get:a(function(){return dEt.Capitalize},"get")});Object.defineProperty(Lt,"Uncapitalize",{enumerable:!0,get:a(function(){return dEt.Uncapitalize},"get")});Object.defineProperty(Lt,"Lowercase",{enumerable:!0,get:a(function(){return dEt.Lowercase},"get")});Object.defineProperty(Lt,"Uppercase",{enumerable:!0,get:a(function(){return dEt.Uppercase},"get")});var gJa=Sye();Object.defineProperty(Lt,"Iterator",{enumerable:!0,get:a(function(){return gJa.Iterator},"get")});var AJa=VD();Object.defineProperty(Lt,"KeyOf",{enumerable:!0,get:a(function(){return AJa.KeyOf},"get")});var yJa=nE();Object.defineProperty(Lt,"Literal",{enumerable:!0,get:a(function(){return yJa.Literal},"get")});var _Ja=Fm();Object.defineProperty(Lt,"Mapped",{enumerable:!0,get:a(function(){return _Ja.Mapped},"get")});var EJa=J_t();Object.defineProperty(Lt,"Module",{enumerable:!0,get:a(function(){return EJa.Module},"get")});var vJa=Bm();Object.defineProperty(Lt,"Never",{enumerable:!0,get:a(function(){return vJa.Never},"get")});var CJa=Z_t();Object.defineProperty(Lt,"Not",{enumerable:!0,get:a(function(){return CJa.Not},"get")});var bJa=NLe();Object.defineProperty(Lt,"Null",{enumerable:!0,get:a(function(){return bJa.Null},"get")});var SJa=L$();Object.defineProperty(Lt,"Number",{enumerable:!0,get:a(function(){return SJa.Number},"get")});var TJa=Wv();Object.defineProperty(Lt,"Object",{enumerable:!0,get:a(function(){return TJa.Object},"get")});var IJa=ULe();Object.defineProperty(Lt,"Omit",{enumerable:!0,get:a(function(){return IJa.Omit},"get")});var xJa=SL();Object.defineProperty(Lt,"Optional",{enumerable:!0,get:a(function(){return xJa.Optional},"get")});var wJa=X_t();Object.defineProperty(Lt,"Parameters",{enumerable:!0,get:a(function(){return wJa.Parameters},"get")});var RJa=qLe();Object.defineProperty(Lt,"Partial",{enumerable:!0,get:a(function(){return RJa.Partial},"get")});var kJa=QLe();Object.defineProperty(Lt,"Pick",{enumerable:!0,get:a(function(){return kJa.Pick},"get")});var PJa=wLe();Object.defineProperty(Lt,"Promise",{enumerable:!0,get:a(function(){return PJa.Promise},"get")});var DJa=Q$();Object.defineProperty(Lt,"Readonly",{enumerable:!0,get:a(function(){return DJa.Readonly},"get")});var NJa=FLe();Object.defineProperty(Lt,"ReadonlyOptional",{enumerable:!0,get:a(function(){return NJa.ReadonlyOptional},"get")});var MJa=Rye();Object.defineProperty(Lt,"Record",{enumerable:!0,get:a(function(){return MJa.Record},"get")});var OJa=eEt();Object.defineProperty(Lt,"Recursive",{enumerable:!0,get:a(function(){return OJa.Recursive},"get")});var LJa=j$();Object.defineProperty(Lt,"Ref",{enumerable:!0,get:a(function(){return LJa.Ref},"get")});var BJa=tEt();Object.defineProperty(Lt,"RegExp",{enumerable:!0,get:a(function(){return BJa.RegExp},"get")});var FJa=jLe();Object.defineProperty(Lt,"Required",{enumerable:!0,get:a(function(){return FJa.Required},"get")});var UJa=rEt();Object.defineProperty(Lt,"Rest",{enumerable:!0,get:a(function(){return UJa.Rest},"get")});var QJa=nEt();Object.defineProperty(Lt,"ReturnType",{enumerable:!0,get:a(function(){return QJa.ReturnType},"get")});var qJa=B$();Object.defineProperty(Lt,"String",{enumerable:!0,get:a(function(){return qJa.String},"get")});var jJa=MLe();Object.defineProperty(Lt,"Symbol",{enumerable:!0,get:a(function(){return jJa.Symbol},"get")});var HJa=GD();Object.defineProperty(Lt,"TemplateLiteral",{enumerable:!0,get:a(function(){return HJa.TemplateLiteral},"get")});var GJa=aEt();Object.defineProperty(Lt,"Transform",{enumerable:!0,get:a(function(){return GJa.Transform},"get")});var $Ja=$6();Object.defineProperty(Lt,"Tuple",{enumerable:!0,get:a(function(){return $Ja.Tuple},"get")});var VJa=LLe();Object.defineProperty(Lt,"Uint8Array",{enumerable:!0,get:a(function(){return VJa.Uint8Array},"get")});var WJa=OLe();Object.defineProperty(Lt,"Undefined",{enumerable:!0,get:a(function(){return WJa.Undefined},"get")});var zJa=Op();Object.defineProperty(Lt,"Union",{enumerable:!0,get:a(function(){return zJa.Union},"get")});var YJa=H$();Object.defineProperty(Lt,"Unknown",{enumerable:!0,get:a(function(){return YJa.Unknown},"get")});var KJa=$Le();Object.defineProperty(Lt,"Unsafe",{enumerable:!0,get:a(function(){return KJa.Unsafe},"get")});var JJa=cEt();Object.defineProperty(Lt,"Void",{enumerable:!0,get:a(function(){return JJa.Void},"get")})});var T4i=I(fEt=>{"use strict";p();Object.defineProperty(fEt,"__esModule",{value:!0});fEt.JavaScriptTypeBuilder=void 0;var ZJa=vRr(),XJa=s_t(),eZa=Aye(),tZa=PLe(),rZa=Cye(),nZa=yye(),iZa=x_t(),oZa=DLe(),sZa=O$(),aZa=q_t(),cZa=j_t(),lZa=Sye(),uZa=X_t(),dZa=wLe(),fZa=tEt(),pZa=nEt(),hZa=MLe(),mZa=LLe(),gZa=OLe(),AZa=cEt(),CRr=class extends ZJa.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,XJa.Argument)(e)}AsyncIterator(e,r){return(0,eZa.AsyncIterator)(e,r)}Awaited(e,r){return(0,tZa.Awaited)(e,r)}BigInt(e){return(0,rZa.BigInt)(e)}ConstructorParameters(e,r){return(0,iZa.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,nZa.Constructor)(e,r,n)}Date(e={}){return(0,oZa.Date)(e)}Function(e,r,n){return(0,sZa.Function)(e,r,n)}InstanceType(e,r){return(0,aZa.InstanceType)(e,r)}Instantiate(e,r){return(0,cZa.Instantiate)(e,r)}Iterator(e,r){return(0,lZa.Iterator)(e,r)}Parameters(e,r){return(0,uZa.Parameters)(e,r)}Promise(e,r){return(0,dZa.Promise)(e,r)}RegExp(e,r){return(0,fZa.RegExp)(e,r)}ReturnType(e,r){return(0,pZa.ReturnType)(e,r)}Symbol(e){return(0,hZa.Symbol)(e)}Undefined(e){return(0,gZa.Undefined)(e)}Uint8Array(e){return(0,mZa.Uint8Array)(e)}Void(e){return(0,AZa.Void)(e)}};fEt.JavaScriptTypeBuilder=CRr});var I4i=I(xS=>{"use strict";p();var yZa=xS&&xS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Za=xS&&xS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),EZa=xS&&xS.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var TZa=nn&&nn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),En=nn&&nn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TZa(e,t,r)};Object.defineProperty(nn,"__esModule",{value:!0});En(fIr(),nn);En(Q6(),nn);En(Gf(),nn);En(vIr(),nn);En(xMi(),nn);En(_Le(),nn);En(hye(),nn);En(ELe(),nn);En(Tn(),nn);En(mye(),nn);En(gye(),nn);En(s_t(),nn);En(Aye(),nn);En(PLe(),nn);En(Cye(),nn);En(bLe(),nn);En(S_t(),nn);En(I_t(),nn);En(yye(),nn);En(x_t(),nn);En(DLe(),nn);En(w_t(),nn);En(B_t(),nn);En(ine(),nn);En(Q_t(),nn);En(O$(),nn);En($D(),nn);En(q_t(),nn);En(j_t(),nn);En(H_t(),nn);En(TI(),nn);En(Sye(),nn);En(V_t(),nn);En(VD(),nn);En(nE(),nn);En(J_t(),nn);En(Fm(),nn);En(Bm(),nn);En(Z_t(),nn);En(NLe(),nn);En(L$(),nn);En(Wv(),nn);En(ULe(),nn);En(SL(),nn);En(X_t(),nn);En(qLe(),nn);En(QLe(),nn);En(wLe(),nn);En(Q$(),nn);En(FLe(),nn);En(Rye(),nn);En(eEt(),nn);En(j$(),nn);En(tEt(),nn);En(jLe(),nn);En(rEt(),nn);En(nEt(),nn);En(g4i(),nn);En(_4i(),nn);En(B$(),nn);En(MLe(),nn);En(GD(),nn);En(aEt(),nn);En($6(),nn);En(LLe(),nn);En(OLe(),nn);En(Op(),nn);En(H$(),nn);En($Le(),nn);En(cEt(),nn);En(I4i(),nn)});var w4i=I(sk=>{"use strict";p();var IZa=sk&&sk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xZa=sk&&sk.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wZa=sk&&sk.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var kZa=RL&&RL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),PZa=RL&&RL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),DZa=RL&&RL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(hEt,"__esModule",{value:!0});hEt.ContextItemOrigin=void 0;var P4i;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(P4i||(hEt.ContextItemOrigin=P4i={}))});var M4i=I(Hu=>{"use strict";p();Object.defineProperty(Hu,"__esModule",{value:!0});Hu.RangeSchema=Hu.WorkspaceFolder=Hu.VersionedTextDocumentIdentifier=Hu.TextEdit=Hu.TextDocumentItem=Hu.Range=Hu.Position=Hu.DocumentUri=Hu.Disposable=Hu.Command=Hu.CancellationTokenSource=Hu.CancellationToken=void 0;var mEt=pEt(),KD=ii();Object.defineProperty(Hu,"CancellationToken",{enumerable:!0,get:a(function(){return KD.CancellationToken},"get")});Object.defineProperty(Hu,"CancellationTokenSource",{enumerable:!0,get:a(function(){return KD.CancellationTokenSource},"get")});Object.defineProperty(Hu,"Command",{enumerable:!0,get:a(function(){return KD.Command},"get")});Object.defineProperty(Hu,"Disposable",{enumerable:!0,get:a(function(){return KD.Disposable},"get")});Object.defineProperty(Hu,"DocumentUri",{enumerable:!0,get:a(function(){return KD.DocumentUri},"get")});Object.defineProperty(Hu,"Position",{enumerable:!0,get:a(function(){return KD.Position},"get")});Object.defineProperty(Hu,"Range",{enumerable:!0,get:a(function(){return KD.Range},"get")});Object.defineProperty(Hu,"TextDocumentItem",{enumerable:!0,get:a(function(){return KD.TextDocumentItem},"get")});Object.defineProperty(Hu,"TextEdit",{enumerable:!0,get:a(function(){return KD.TextEdit},"get")});Object.defineProperty(Hu,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return KD.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(Hu,"WorkspaceFolder",{enumerable:!0,get:a(function(){return KD.WorkspaceFolder},"get")});var N4i=mEt.Type.Object({line:mEt.Type.Integer({minimum:0}),character:mEt.Type.Integer({minimum:0})});Hu.RangeSchema=mEt.Type.Object({start:N4i,end:N4i})});var L4i=I(O4i=>{"use strict";p();Object.defineProperty(O4i,"__esModule",{value:!0})});var WLe=I($f=>{"use strict";p();var MZa=$f&&$f.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),VLe=$f&&$f.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MZa(e,t,r)};Object.defineProperty($f,"__esModule",{value:!0});$f.TextEdit=$f.Range=$f.Position=$f.Disposable=$f.CancellationTokenSource=$f.CancellationToken=void 0;var Dye=ii();Object.defineProperty($f,"CancellationToken",{enumerable:!0,get:a(function(){return Dye.CancellationToken},"get")});Object.defineProperty($f,"CancellationTokenSource",{enumerable:!0,get:a(function(){return Dye.CancellationTokenSource},"get")});Object.defineProperty($f,"Disposable",{enumerable:!0,get:a(function(){return Dye.Disposable},"get")});Object.defineProperty($f,"Position",{enumerable:!0,get:a(function(){return Dye.Position},"get")});Object.defineProperty($f,"Range",{enumerable:!0,get:a(function(){return Dye.Range},"get")});Object.defineProperty($f,"TextEdit",{enumerable:!0,get:a(function(){return Dye.TextEdit},"get")});VLe(w4i(),$f);VLe(k4i(),$f);VLe(D4i(),$f);VLe(M4i(),$f);VLe(L4i(),$f)});var SRr=I(II=>{"use strict";p();var OZa=II&&II.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},B4i=II&&II.__param||function(t,e){return function(r,n){e(r,n,t)}},LZa=II&&II.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(II,"__esModule",{value:!0});II.CompletionNotifier=II.ICompletionsNotifierService=void 0;var BZa=LZa(require("events")),FZa=an(),UZa=Are(),QZa=WLe(),qZa=nA(),jZa=cLe(),gEt="CompletionRequested";II.ICompletionsNotifierService=(0,FZa.createServiceIdentifier)("ICompletionsNotifierService");var bRr=class{static{a(this,"CompletionNotifier")}#e=new BZa.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(gEt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,qZa.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${gEt}`);return this.#e.on(gEt,r),QZa.Disposable.create(()=>this.#e.off(gEt,r))}};II.CompletionNotifier=bRr;II.CompletionNotifier=bRr=OZa([B4i(0,jZa.ICompletionsPromiseQueueService),B4i(1,UZa.ICompletionsTelemetryService)],bRr)});var TRr=I(AEt=>{"use strict";p();Object.defineProperty(AEt,"__esModule",{value:!0});AEt.ICompletionsObservableWorkspace=void 0;var HZa=Ks();AEt.ICompletionsObservableWorkspace=(0,HZa.createDecorator)("ICompletionsObservableWorkspace")});var Gl=I(JD=>{"use strict";p();Object.defineProperty(JD,"__esModule",{value:!0});JD.logger=JD.Logger=JD.ICompletionsLogTargetService=JD.LogLevel=void 0;var GZa=an(),$Za=Are(),VZa=nA(),Tne;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(Tne||(JD.LogLevel=Tne={}));JD.ICompletionsLogTargetService=(0,GZa.createServiceIdentifier)("ICompletionsLogTargetService");var yEt=class{static{a(this,"Logger")}constructor(e){this.category=e}log(e,r,...n){e.logIt(r,this.category,...n)}debug(e,...r){this.log(e,Tne.DEBUG,...r)}info(e,...r){this.log(e,Tne.INFO,...r)}warn(e,...r){this.log(e,Tne.WARN,...r)}error(e,...r){this.log(e,Tne.ERROR,...r)}exception(e,r,n){if(r instanceof Error&&r.name==="Canceled"&&r.message==="Canceled")return;let o=n;n.startsWith(".")&&(o=n.substring(1),n=`${this.category}${n}`),(0,VZa.telemetryException)(e.get($Za.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(JD.ICompletionsLogTargetService),Tne.ERROR,`${o}:`,s)}};JD.Logger=yEt;JD.logger=new yEt("default")});var U4i=I(W$=>{"use strict";p();Object.defineProperty(W$,"__esModule",{value:!0});W$.INotificationService=W$.NullNotificationService=W$.ProgressLocation=void 0;var WZa=an(),zZa=S2(),F4i;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(F4i||(W$.ProgressLocation=F4i={}));var IRr=class{static{a(this,"NullNotificationService")}showInformationMessage(e,r,...n){return Promise.resolve(void 0)}showWarningMessage(e,...r){return Promise.resolve(void 0)}showQuotaExceededDialog(e){return Promise.resolve()}withProgress(e,r){return Promise.resolve(r({report:a(()=>{},"report")},zZa.CancellationToken.None))}};W$.NullNotificationService=IRr;W$.INotificationService=(0,WZa.createServiceIdentifier)("INotificationService")});var wRr=I(ZD=>{"use strict";p();var YZa=ZD&&ZD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},KZa=ZD&&ZD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ZD,"__esModule",{value:!0});ZD.ExtensionNotificationSender=ZD.ICompletionsNotificationSender=void 0;var JZa=U4i(),ZZa=an();ZD.ICompletionsNotificationSender=(0,ZZa.createServiceIdentifier)("ICompletionsNotificationSender");var xRr=class{static{a(this,"ExtensionNotificationSender")}constructor(e){this.notificationService=e}async showWarningMessage(e,...r){let n=await this.notificationService.showWarningMessage(e,...r.map(o=>o.title));if(n!==void 0)return{title:n}}};ZD.ExtensionNotificationSender=xRr;ZD.ExtensionNotificationSender=xRr=YZa([KZa(0,JZa.INotificationService)],xRr)});var PRr=I(XD=>{"use strict";p();var XZa=XD&&XD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},RRr=XD&&XD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(XD,"__esModule",{value:!0});XD.UserErrorNotifier=XD.ICompletionsUserErrorNotifierService=void 0;var eXa=FD(),tXa=an(),rXa=hd(),j4i=Gl(),nXa=wRr(),iXa=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],Q4i="Your proxy connection requires a trusted certificate. Please make sure the proxy certificate and any issuers are configured correctly and trusted by your operating system.",q4i="https://gh.io/copilot-network-errors";XD.ICompletionsUserErrorNotifierService=(0,tXa.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var kRr=class{static{a(this,"UserErrorNotifier")}constructor(e,r,n){this._logTarget=e,this._notificationSender=r,this._env=n,this.notifiedErrorCodes=[]}notifyUser(e){if(!(e instanceof Error))return;let r=e;r.code&&iXa.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new j4i.Logger("certificates").error(this._logTarget,`${Q4i} Please visit ${q4i} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(Q4i,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(rXa.URI.parse(q4i))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};XD.UserErrorNotifier=kRr;XD.UserErrorNotifier=kRr=XZa([RRr(0,j4i.ICompletionsLogTargetService),RRr(1,nXa.ICompletionsNotificationSender),RRr(2,eXa.IEnvService)],kRr)});var Rh=I(Nye=>{"use strict";p();Object.defineProperty(Nye,"__esModule",{value:!0});Nye.NullExperimentationService=Nye.IExperimentationService=void 0;var oXa=an(),sXa=Fc();Nye.IExperimentationService=(0,oXa.createServiceIdentifier)("IExperimentationService");var DRr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new sXa.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};Nye.NullExperimentationService=DRr});var z$=I(wS=>{"use strict";p();Object.defineProperty(wS,"__esModule",{value:!0});wS.DEFAULT_PROMPT_ALLOCATION_PERCENT=wS.DEFAULT_SUFFIX_MATCH_THRESHOLD=wS.DEFAULT_NUM_SNIPPETS=wS.DEFAULT_MAX_PROMPT_LENGTH=wS.DEFAULT_MAX_COMPLETION_LENGTH=void 0;wS.normalizeLanguageId=cXa;wS.DEFAULT_MAX_COMPLETION_LENGTH=500;wS.DEFAULT_MAX_PROMPT_LENGTH=8192-wS.DEFAULT_MAX_COMPLETION_LENGTH;wS.DEFAULT_NUM_SNIPPETS=4;wS.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;wS.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var aXa={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function cXa(t){return t=t.toLowerCase(),aXa[t]??t}a(cXa,"normalizeLanguageId")});var H4i=I(NRr=>{"use strict";p();Object.defineProperty(NRr,"__esModule",{value:!0});NRr.getUserKind=uXa;function lXa(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(lXa,"findKnownOrg");function uXa(t){let e=t.organizationList??[];return lXa(e)??""}a(uXa,"getUserKind")});var zLe=I(kL=>{"use strict";p();Object.defineProperty(kL,"__esModule",{value:!0});kL.IEndpointProvider=kL.ModelSupportedEndpoint=void 0;kL.isEndpointEditToolName=pXa;kL.isChatModelInformation=hXa;kL.isEmbeddingModelInformation=mXa;kL.isCompletionModelInformation=gXa;var dXa=an(),fXa=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function pXa(t){return fXa.has(t)}a(pXa,"isEndpointEditToolName");var G4i;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(G4i||(kL.ModelSupportedEndpoint=G4i={}));function hXa(t){return t.capabilities.type==="chat"}a(hXa,"isChatModelInformation");function mXa(t){return t.capabilities.type==="embeddings"}a(mXa,"isEmbeddingModelInformation");function gXa(t){return t.capabilities.type==="completion"}a(gXa,"isCompletionModelInformation");kL.IEndpointProvider=(0,dXa.createServiceIdentifier)("IEndpointProvider")});var V4i=I(MRr=>{"use strict";p();Object.defineProperty(MRr,"__esModule",{value:!0});MRr.getUserSelectedModelConfiguration=AXa;var $4i=eE();function AXa(t){let e=(0,$4i.getConfig)(t,$4i.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(AXa,"getUserSelectedModelConfiguration")});var W4i=I(DL=>{"use strict";p();Object.defineProperty(DL,"__esModule",{value:!0});DL.bytePairEncode=DL.BinaryMap=DL.binaryMapKey=void 0;var yXa=a((t,e,r)=>{let n=r-e,o=16777215>>>Math.max(0,(3-n)*8),s=(t[e+0]|t[e+1]<<8|t[e+2]<<16)&o,c=16777215>>>Math.min(31,Math.max(0,(6-n)*8)),l=(t[e+3]|t[e+4]<<8|t[e+5]<<16)&c;return s+16777216*l},"binaryMapKey");DL.binaryMapKey=yXa;var ORr=class t{static{a(this,"BinaryMap")}constructor(){this.nested=new Map,this.final=new Map}get(e,r=0,n=e.length){let o=n<6+r,s=(0,DL.binaryMapKey)(e,r,n);return o?this.final.get(s):this.nested.get(s)?.get(e,6+r,n)}set(e,r){let n=(0,DL.binaryMapKey)(e,0,e.length);if(e.length<6){this.final.set(n,r);return}let s=this.nested.get(n);if(s instanceof t)s.set(e.subarray(6),r);else{let c=new t;c.set(e.subarray(6),r),this.nested.set(n,c)}}};DL.BinaryMap=ORr;var PL=new Int32Array(128),Zv=new Int32Array(128);function _Xa(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;PL.length0&&(PL[Zv[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(_Et,"__esModule",{value:!0});_Et.makeTextEncoder=void 0;var LRr=class{static{a(this,"UniversalTextEncoder")}constructor(){this.length=0,this.encoder=new TextEncoder}encode(e){let r=this.encoder.encode(e);return this.length=r.length,r}},BRr=class{static{a(this,"NodeTextEncoder")}constructor(){this.buffer=Buffer.alloc(256),this.length=0}encode(e){for(;;){if(this.length=this.buffer.write(e,"utf8"),this.lengthtypeof Buffer<"u"?new BRr:new LRr,"makeTextEncoder");_Et.makeTextEncoder=EXa});var Y4i=I(EEt=>{"use strict";p();Object.defineProperty(EEt,"__esModule",{value:!0});EEt.LRUCache=void 0;var FRr=class{static{a(this,"LRUCache")}constructor(e){this.size=e,this.nodes=new Map}get(e){let r=this.nodes.get(e);if(r)return this.moveToHead(r),r.value}set(e,r){let n=this.nodes.get(e);if(n)n.value=r,this.moveToHead(n);else{let o=new URr(e,r);this.nodes.set(e,o),this.addNode(o),this.nodes.size>this.size&&(this.nodes.delete(this.tail.key),this.removeNode(this.tail))}}moveToHead(e){this.removeNode(e),e.next=void 0,e.prev=void 0,this.addNode(e)}addNode(e){this.head&&(this.head.prev=e,e.next=this.head),this.tail||(this.tail=e),this.head=e}removeNode(e){e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev}};EEt.LRUCache=FRr;var URr=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var qRr=I(CEt=>{"use strict";p();Object.defineProperty(CEt,"__esModule",{value:!0});CEt.TikTokenizer=void 0;var vEt=W4i(),vXa=z4i(),CXa=Y4i();function bXa(t){let e=new Map;try{let o=require("fs").readFileSync(t,"utf-8");return r(o),e}catch(n){throw new Error(`Failed to load from BPE encoder file stream: ${n}`)}function r(n){for(let o of n.split(/[\r\n]+/)){if(o.trim()==="")continue;let s=o.split(" ");if(s.length!==2)throw new Error("Invalid format in the BPE encoder file stream");let c=new Uint8Array(Buffer.from(s[0],"base64")),l=parseInt(s[1]);if(!isNaN(l))e.set(c,l);else throw new Error(`Can't parse ${s[1]} to integer`)}}a(r,"processBpeRanks")}a(bXa,"loadTikTokenBpe");function SXa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(SXa,"escapeRegExp");var QRr=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,vXa.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new CXa.LRUCache(o);let s=typeof e=="string"?bXa(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new vEt.BinaryMap;for(let[o,s]of e)this.encoder.set(o,s);this.regex=new RegExp(n,"gu"),this.specialTokensRegex=new RegExp(Array.from(r.keys()).map(o=>SXa(o)).join("|")),this.specialTokensEncoder=r,this.decoder=new Map;for(let[o,s]of e)this.decoder.set(s,o);if(e.size!==this.decoder.size)throw new Error("Encoder and decoder sizes do not match");this.specialTokensDecoder=new Map;for(let[o,s]of r)this.specialTokensDecoder.set(s,o)}findNextSpecialToken(e,r,n){let o=r,s=null;if(n&&this.specialTokensRegex)for(;s=e.slice(o).match(this.specialTokensRegex),!(!s||n&&n.includes(s[0]));)o+=s.index+1;let c=s?o+s.index:e.length;return[s,c]}encode(e,r){let n=[],o=0;for(;;){let s,c;if([s,c]=this.findNextSpecialToken(e,o,r),c>o&&this.encodeByIndex(e,n,o,c),s){if(o=o+this.encodeSpecialToken(n,s),o>=e.length)break}else break}return n}encodeSpecialToken(e,r){let n=this.specialTokensEncoder?.get(r[0]);return e.push(n),r.index+r[0].length}encodeByIndex(e,r,n,o){let s,c=e.substring(n,o);for(this.regex.lastIndex=0;s=this.regex.exec(c);){let l=this.cache.get(s[0]);if(l)for(let u of l)r.push(u);else{let u=this.textEncoder.encode(s[0]),d=this.encoder.get(u,0,this.textEncoder.length);if(d!==void 0)r.push(d),this.cache.set(s[0],[d]);else{let f=(0,vEt.bytePairEncode)(u,this.encoder,this.textEncoder.length);for(let h of f)r.push(h);this.cache.set(s[0],f)}}}}encodeTrimSuffixByIndex(e,r,n,o,s,c,l){let u,d=e.substring(n,o);for(this.regex.lastIndex=0;u=this.regex.exec(d);){let f=u[0],h=this.cache.get(f);if(h)if(c+h.length<=s)c+=h.length,l+=f.length,r.push(...h);else{let m=s-c;c+=m,l+=f.length,r.push(...h.slice(0,m));break}else{let m=this.textEncoder.encode(f),g=this.encoder.get(m,0,m.length);if(g!==void 0)if(this.cache.set(f,[g]),c+1<=s)c++,l+=f.length,r.push(g);else break;else{let A=(0,vEt.bytePairEncode)(m,this.encoder,this.textEncoder.length);if(this.cache.set(f,A),c+A.length<=s){c+=A.length,l+=f.length;for(let y of A)r.push(y)}else{let y=s-c;c+=y,l+=f.length;for(let _=0;_=s)break}return{tokenCount:c,encodeLength:l}}encodeTrimSuffix(e,r,n){let o=[],s=0,c=0,l=0;for(;;){let d,f;if([d,f]=this.findNextSpecialToken(e,s,n),f>s){let{tokenCount:h,encodeLength:m}=this.encodeTrimSuffixByIndex(e,o,s,f,r,c,l);if(c=h,l=m,c>=r)break}if(d!==null){if(c++,c<=r&&(s=s+this.encodeSpecialToken(o,d),l+=d[0].length,s>=e.length)||c>=r)break}else break}let u=l===e.length?e:e.slice(0,l);return{tokenIds:o,text:u}}encodeTrimPrefix(e,r,n){let o=[],s=0,c=0,l=0,u=new Map;for(u.set(c,l);;){let m,g;if([m,g]=this.findNextSpecialToken(e,s,n),g>s){let A,y=e.substring(s,g);for(this.regex.lastIndex=0;A=this.regex.exec(y);){let _=A[0],E=this.cache.get(_);if(E)c+=E.length,l+=_.length,o.push(...E),u.set(c,l);else{let v=this.textEncoder.encode(_),S=this.encoder.get(v);if(S!==void 0)this.cache.set(_,[S]),c++,l+=_.length,o.push(S),u.set(c,l);else{let T=(0,vEt.bytePairEncode)(v,this.encoder,this.textEncoder.length);this.cache.set(_,T),c+=T.length,l+=_.length;for(let w of T)o.push(w);u.set(c,l)}}}}if(m!==null){if(s=s+this.encodeSpecialToken(o,m),c++,l+=m[0].length,u.set(c,l),s>=e.length)break}else break}if(c<=r)return{tokenIds:o,text:e};let d=c-r,f=0,h=0;for(let[m,g]of u)if(m>=d){f=m,h=g;break}if(f>r){let m=this.encode(e,n),g=m.slice(m.length-r);return{tokenIds:g,text:this.decode(g)}}return{tokenIds:o.slice(f),text:e.slice(h)}}decode(e){let r=[];for(let n of e){let o=[],s=this.decoder?.get(n);if(s!==void 0)o=Array.from(s);else{let c=this.specialTokensDecoder?.get(n);if(c!==void 0){let l=this.textEncoder.encode(c);o=Array.from(l.subarray(0,this.textEncoder.length))}}r.push(...o)}return this.textDecoder.decode(new Uint8Array(r))}};CEt.TikTokenizer=QRr});var oLi=I(qm=>{"use strict";p();Object.defineProperty(qm,"__esModule",{value:!0});qm.createTokenizer=qm.createByEncoderName=qm.createByModelName=qm.getRegexByModel=qm.getRegexByEncoder=qm.getSpecialTokensByModel=qm.getSpecialTokensByEncoder=qm.MODEL_TO_ENCODING=void 0;var TXa=qRr(),IXa=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);qm.MODEL_TO_ENCODING=new Map([["gpt-4o","o200k_base"],["gpt-4","cl100k_base"],["gpt-3.5-turbo","cl100k_base"],["text-davinci-003","p50k_base"],["text-davinci-002","p50k_base"],["text-davinci-001","r50k_base"],["text-curie-001","r50k_base"],["text-babbage-001","r50k_base"],["text-ada-001","r50k_base"],["davinci","r50k_base"],["curie","r50k_base"],["babbage","r50k_base"],["ada","r50k_base"],["code-davinci-002","p50k_base"],["code-davinci-001","p50k_base"],["code-cushman-002","p50k_base"],["code-cushman-001","p50k_base"],["davinci-codex","p50k_base"],["cushman-codex","p50k_base"],["text-davinci-edit-001","p50k_edit"],["code-davinci-edit-001","p50k_edit"],["text-embedding-ada-002","cl100k_base"],["text-similarity-davinci-001","r50k_base"],["text-similarity-curie-001","r50k_base"],["text-similarity-babbage-001","r50k_base"],["text-similarity-ada-001","r50k_base"],["text-search-davinci-doc-001","r50k_base"],["text-search-curie-doc-001","r50k_base"],["text-search-babbage-doc-001","r50k_base"],["text-search-ada-doc-001","r50k_base"],["code-search-babbage-code-001","r50k_base"],["code-search-ada-code-001","r50k_base"],["gpt2","gpt2"]]);var bEt="<|endoftext|>",K4i="<|fim_prefix|>",J4i="<|fim_middle|>",Z4i="<|fim_suffix|>",X4i="<|endofprompt|>",YLe="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",eLi="(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)|[^\\r\\n\\p{L}\\p{N}]?\\p{L}+|\\p{N}{1,3}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",xXa=[`[^\r +`:"",n.chromiumDetails?`${o}${JSON.stringify(NDi(n.chromiumDetails))} +`:"",r(n.cause,o+" "),...Array.isArray(n.errors)?n.errors.map(l=>r(l,o+" ")):[]].join("")}return a(r,"collect"),r(t,"").trim()}a(DDi,"collectErrorMessages");function NBa(t,e=!1){let r=new Set;function n(o){if(!o||!["object","string"].includes(typeof o)||r.has(o))return"";r.add(o);let l=((typeof o=="string"?o:o.message||o.code||"").toString?.()||"").trim().split(` +`).join(" "),u=[...e&&o.chromiumDetails?[JSON.stringify(NDi(o.chromiumDetails))]:[],...o.cause?[n(o.cause)]:[],...Array.isArray(o.errors)?o.errors.map(d=>n(d)):[]].join(", ");return u?`${l}: ${u}`:l}return a(n,"collect"),n(t)}a(NBa,"collectSingleLineErrorMessage");function MBa(t){return t=t.replace(/(\b(?:PROXY|HTTPS?|SOCKS[45]?)\s+)[^\s]+@([^\s:\/]+)/gi,"$1@"),t=t.replace(/(\b(?:PROXY|HTTPS?|SOCKS[45]?)\s+)([a-zA-Z0-9][-a-zA-Z0-9.]*)/gi,"$1"),t=t.replace(/(\/\/)[^\s/]+@([^\s:\/]+)/g,"$1@"),t=t.replace(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,""),t=t.replace(/(?"),t=t.replace(/(?"),t=t.replace(/\b([a-zA-Z0-9][-a-zA-Z0-9]*\.)+[a-zA-Z]{2,}\b/g,""),t}a(MBa,"sanitizeNetworkErrorForTelemetry");function NDi(t){if(!t||typeof t!="object")return{};if(t.is_request_error!==void 0&&t.session_state===void 0)return{is_request_error:t.is_request_error,network_process_crashed:t.network_process_crashed};let e={drain_error:t.drain_error,drain_description:t.drain_description,go_away_error:t.go_away_error,go_away_error_details:t.go_away_error_details,go_away_debug_data:t.go_away_debug_data,rst_stream_error:t.rst_stream_error,rst_stream_error_details:t.rst_stream_error_details,rst_stream_description:t.rst_stream_description,last_framer_error:t.last_framer_error,last_framer_error_details:t.last_framer_error_details,error_source:t.error_source,aliases_length:Array.isArray(t.aliases)?t.aliases.length:void 0};if(t.proxy){let n=[...String(t.proxy).matchAll(/([a-z][a-z0-9+.-]*):\/\//gi)].map(o=>o[1]);n.length>0&&(e.proxy_schemes=n)}if(t.in_flight_write&&typeof t.in_flight_write=="object"&&(e.in_flight_write={frame_type:t.in_flight_write.frame_type,frame_size:t.in_flight_write.frame_size,remaining_size:t.in_flight_write.remaining_size}),t.buffered_spdy_framer&&typeof t.buffered_spdy_framer=="object"&&(e.buffered_spdy_framer={frames_received:t.buffered_spdy_framer.frames_received,has_error:t.buffered_spdy_framer.has_error,message_fully_read:t.buffered_spdy_framer.message_fully_read}),t.session_state&&typeof t.session_state=="object"){let r=t.session_state;e.session_state={availability_state:r.availability_state,session_send_window:r.session_send_window,session_recv_window:r.session_recv_window,stream_initial_send_window:r.stream_initial_send_window,stream_initial_recv_window:r.stream_initial_recv_window,send_stalled_by_session_window:r.send_stalled_by_session_window,active_stream_count:r.active_stream_count,created_stream_count:r.created_stream_count,max_concurrent_streams:r.max_concurrent_streams,highest_stream_id_sent:r.highest_stream_id_sent,frames_sent:r.frames_sent,frames_received:r.frames_received,ping_in_flight:r.ping_in_flight,last_ping_sent_ms:r.last_ping_sent_ms,next_ping_id:r.next_ping_id,failed_ping_count:r.failed_ping_count,support_websocket:r.support_websocket,deprecate_http2_priorities:r.deprecate_http2_priorities,streams_initiated_count:r.streams_initiated_count,streams_abandoned_count:r.streams_abandoned_count,read_state:r.read_state,write_state:r.write_state,pending_create_stream_request_count:r.pending_create_stream_request_count,error:r.error,error_on_unavailable:r.error_on_unavailable,unacked_recv_window_bytes:r.unacked_recv_window_bytes,last_good_stream_id:r.last_good_stream_id,debug_stream_id:r.debug_stream_id,has_ping_based_connection_checking:r.has_ping_based_connection_checking,num_broken_connection_detection_requests:r.num_broken_connection_detection_requests,session_max_queued_capped_frames:r.session_max_queued_capped_frames,num_queued_capped_frames:r.num_queued_capped_frames,check_ping_status_pending:r.check_ping_status_pending,in_confirm_handshake:r.in_confirm_handshake,http2_end_stream_with_data_frame:r.http2_end_stream_with_data_frame,reused:r.reused,session_max_recv_window_size:r.session_max_recv_window_size,max_header_table_size:r.max_header_table_size,time_since_last_read_ms:r.time_since_last_read_ms,time_since_last_write_ms:r.time_since_last_write_ms,time_since_last_recv_window_update_ms:r.time_since_last_recv_window_update_ms}}if(t.tls_info&&typeof t.tls_info=="object"){let r=t.tls_info;e.tls_info={is_secure_connection:r.is_secure_connection,ssl_version:r.ssl_version,cipher_suite:r.cipher_suite,negotiated_alpn:r.negotiated_alpn,cert_status:r.cert_status,is_issued_by_known_root:r.is_issued_by_known_root,handshake_type:r.handshake_type,client_cert_sent:r.client_cert_sent,exchange_group:r.key_exchange_group,ct_compliance:r.ct_compliance,alps_negotiated:r.alps_negotiated}}if(t.socket_info&&typeof t.socket_info=="object"){let r=t.socket_info;e.socket_info={is_connected:r.is_connected,was_ever_used:r.was_ever_used,dns_lookup_duration_ms:r.dns_lookup_duration_ms,tcp_connect_duration_ms:r.tcp_connect_duration_ms,ssl_handshake_duration_ms:r.ssl_handshake_duration_ms,owned_socket:r.owned_socket,socket_reuse_type:r.socket_reuse_type}}return t.url_loader_error&&typeof t.url_loader_error=="object"&&(e.url_loader_error={is_request_error:t.url_loader_error.is_request_error,network_process_crashed:t.url_loader_error.network_process_crashed}),Array.isArray(t.active_stream_details)&&(e.active_stream_details=t.active_stream_details.map(r=>({stream_id:r.stream_id,io_state:r.io_state,type:r.type,priority:r.priority,send_window_size:r.send_window_size,recv_window_size:r.recv_window_size,max_recv_window_size:r.max_recv_window_size,unacked_recv_window_bytes:r.unacked_recv_window_bytes,send_stalled_by_flow_control:r.send_stalled_by_flow_control,raw_sent_bytes:r.raw_sent_bytes,raw_received_bytes:r.raw_received_bytes,recv_bytes:r.recv_bytes,pending_send_status:r.pending_send_status,response_state:r.response_state,pending_send_data_remaining:r.pending_send_data_remaining,request_time_ms:r.request_time_ms,response_time_ms:r.response_time_ms}))),Array.isArray(t.closed_stream_details)&&(e.closed_stream_details=t.closed_stream_details.map(r=>({stream_id:r.stream_id,io_state:r.io_state,type:r.type,priority:r.priority,send_window_size:r.send_window_size,recv_window_size:r.recv_window_size,max_recv_window_size:r.max_recv_window_size,unacked_recv_window_bytes:r.unacked_recv_window_bytes,send_stalled_by_flow_control:r.send_stalled_by_flow_control,raw_sent_bytes:r.raw_sent_bytes,raw_received_bytes:r.raw_received_bytes,recv_bytes:r.recv_bytes,pending_send_status:r.pending_send_status,response_state:r.response_state,pending_send_data_remaining:r.pending_send_data_remaining,request_time_ms:r.request_time_ms,response_time_ms:r.response_time_ms}))),e}a(NDi,"extractChromiumDetails");var $yt=class{static{a(this,"LogMemory")}static{this._logs=[]}static{this._requestIds=[]}static{this.MAX_LOGS=50}static extractRequestIdFromMessage(e){let r=e.match(/request done: requestId: \[([0-9a-fA-F-]+)\] model deployment ID: \[/);if(r){let n=r[1];if(!this._requestIds.includes(n))return n}}static addLog(e,r){this._logs.length>=this.MAX_LOGS&&this._logs.shift(),this._logs.push(`${e}: ${r}`),this._requestIds.length>=this.MAX_LOGS&&this._requestIds.shift();let n=this.extractRequestIdFromMessage(r);n&&this._requestIds.push(n)}static getLogs(){return this._logs}static getRequestIds(){return this._requestIds}};Ry.LogMemory=$yt});var aLe=I(sLe=>{"use strict";p();Object.defineProperty(sLe,"__esModule",{value:!0});sLe.ICopilotTokenManager=void 0;sLe.nowSeconds=LBa;var OBa=an();sLe.ICopilotTokenManager=(0,OBa.createServiceIdentifier)("ICopilotTokenManager");function LBa(){return Math.floor(Date.now()/1e3)}a(LBa,"nowSeconds")});var rE=I(Bm=>{"use strict";p();var BBa=Bm&&Bm.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Vyt=Bm&&Bm.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Bm,"__esModule",{value:!0});Bm.BaseAuthenticationService=Bm.IAuthenticationService=Bm.MinimalModeError=Bm.GITHUB_SCOPE_ALIGNED=Bm.GITHUB_SCOPE_READ_USER=Bm.GITHUB_SCOPE_USER_EMAIL=void 0;Bm.authProviderId=GBa;var FBa=an(),Wyt=Fc(),UBa=Po(),QBa=o6(),Are=Hl(),qBa=Np(),jBa=aLe(),HBa=YG();Bm.GITHUB_SCOPE_USER_EMAIL=["user:email"];Bm.GITHUB_SCOPE_READ_USER=["read:user"];Bm.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var HTr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};Bm.MinimalModeError=HTr;Bm.IAuthenticationService=(0,FBa.createServiceIdentifier)("IAuthenticationService");var GTr=class extends UBa.Disposable{static{a(this,"BaseAuthenticationService")}fireAuthenticationChange(e){let r=!!this.copilotToken;this._logService.info(`AuthenticationService: firing onDidAuthenticationChange from ${e}. Has token: ${r}`),this._onDidAuthenticationChange.fire()}fireCopilotTokenChange(e){this._logService.debug(`AuthenticationService: firing onDidCopilotTokenChange from ${e}.`),this._onDidCopilotTokenChange.fire()}constructor(e,r,n,o){super(),this._logService=e,this._tokenStore=r,this._tokenManager=n,this._configurationService=o,this._onDidAuthenticationChange=this._register(new Wyt.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidCopilotTokenChange=this._register(new Wyt.Emitter),this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event,this._onDidAccessTokenChange=this._register(new Wyt.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new Wyt.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,QBa.derived)(s=>this._configurationService.getConfigObservable(Are.ConfigKey.Shared.AuthPermissions).read(s)===Are.AuthPermissionMode.Minimal),this._register(n.onDidCopilotTokenRefresh(()=>{this._logService.debug("Handling CopilotToken refresh."),this._handleAuthChangeEvent()}))}get isMinimalMode(){return this._isMinimalMode.get()}get anyGitHubSession(){return this._anyGitHubSession}get hasCopilotTokenSource(){return!!this._anyGitHubSession}get permissiveGitHubSession(){return this._permissiveGitHubSession}get anyAdoSession(){return this._anyAdoSession}get copilotToken(){return this._tokenStore.copilotToken}async getCopilotToken(e){try{let r=this._tokenStore.copilotToken,n=await this._tokenManager.getCopilotToken(e);return this._tokenStore.copilotToken=n,this._copilotTokenError=void 0,r?.token!==n.token&&this.fireCopilotTokenChange("getCopilotToken"),n}catch(r){let n=this._tokenStore.copilotToken;this._tokenStore.copilotToken=void 0;let o=this._copilotTokenError;throw this._copilotTokenError=r,n?this.fireCopilotTokenChange("getCopilotToken token lost"):o&&r&&o.message!==r.message&&this.fireCopilotTokenChange("getCopilotToken error change"),r}}resetCopilotToken(e){let r=!!this._tokenStore.copilotToken;this._tokenStore.copilotToken=void 0,this._tokenManager.resetCopilotToken(e),r&&this.fireCopilotTokenChange("resetCopilotToken")}async _handleAuthChangeEvent(){let e=this._anyGitHubSession,r=this._permissiveGitHubSession,n=this._anyAdoSession,o=await Promise.allSettled([this.getGitHubSession("any",{silent:!0}),this.getGitHubSession("permissive",{silent:!0}),this.getAnyAdoSession({silent:!0})]);for(let s of o)s.status==="rejected"&&this._logService.error(`Error getting a session: ${s.reason}`);if(e?.accessToken!==this._anyGitHubSession?.accessToken||r?.accessToken!==this._permissiveGitHubSession?.accessToken){this._onDidAccessTokenChange.fire(),this._logService.debug("Auth state changed (identity change), minting a new CopilotToken...");try{await this.getCopilotToken(!0)}catch{}this._logService.debug("Minted a new CopilotToken."),this.fireAuthenticationChange("handleAuthChangeEvent identity change");return}n?.accessToken!==this._anyAdoSession?.accessToken&&(this._logService.debug(`Ado auth state changed, firing event. Had token before: ${!!n?.accessToken}. Has token now: ${!!this._anyAdoSession?.accessToken}.`),this._onDidAdoAuthenticationChange.fire());try{await this.getCopilotToken()}catch{}this._logService.debug("Finished handling auth change event.")}};Bm.BaseAuthenticationService=GTr;Bm.BaseAuthenticationService=GTr=BBa([Vyt(0,qBa.ILogService),Vyt(1,HBa.ICopilotTokenStore),Vyt(2,jBa.ICopilotTokenManager),Vyt(3,Are.IConfigurationService)],GTr);function GBa(t){return t.getConfig(Are.ConfigKey.Shared.AuthProvider)===Are.AuthProviderId.GitHubEnterprise?Are.AuthProviderId.GitHubEnterprise:Are.AuthProviderId.GitHub}a(GBa,"authProviderId")});var zyt=I($Tr=>{"use strict";p();Object.defineProperty($Tr,"__esModule",{value:!0});$Tr.onCopilotToken=$Ba;function $Ba(t,e){return t.onDidCopilotTokenChange(()=>{let r=t.copilotToken;r&&e(r)})}a($Ba,"onCopilotToken")});var WTr=I(qD=>{"use strict";p();var VBa=qD&&qD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},WBa=qD&&qD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(qD,"__esModule",{value:!0});qD.TelemetryUserConfig=qD.ICompletionsTelemetryUserConfigService=void 0;var zBa=rE(),YBa=an(),KBa=Po(),JBa=zyt();function ZBa(t){let e=t.getTokenValue("tid"),r=t.organizationList,n=t.enterpriseList,o=t.getTokenValue("sku");if(!e)return;let s={copilot_trackingId:e};return r&&(s.organizations_list=r.toString()),n&&(s.enterprise_list=n.toString()),o&&(s.sku=o),s}a(ZBa,"propertiesFromCopilotToken");qD.ICompletionsTelemetryUserConfigService=(0,YBa.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var VTr=class extends KBa.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,JBa.onCopilotToken)(e,n=>this.updateFromToken(n)));let r=e.copilotToken;r&&this.updateFromToken(r)}getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=ZBa(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};qD.TelemetryUserConfig=VTr;qD.TelemetryUserConfig=VTr=VBa([WBa(0,zBa.IAuthenticationService)],VTr)});var cLe=I(sye=>{"use strict";p();Object.defineProperty(sye,"__esModule",{value:!0});sye.PromiseQueue=sye.ICompletionsPromiseQueueService=void 0;var XBa=an();sye.ICompletionsPromiseQueueService=(0,XBa.createServiceIdentifier)("completionsPromiseQueueService");var zTr=class{static{a(this,"PromiseQueue")}constructor(){this.promises=new Set}register(e){this.promises.add(e),e.finally(()=>this.promises.delete(e))}async flush(){await Promise.allSettled(this.promises)}};sye.PromiseQueue=zTr});var nA=I(kd=>{"use strict";p();Object.defineProperty(kd,"__esModule",{value:!0});kd.TelemetryReporters=kd.ICompletionsTelemetryReporters=kd.CopilotTelemetryReporter=kd.TelemetryWithExp=kd.TelemetryData=kd.TelemetryStore=void 0;kd.telemetrizePromptLength=d3a;kd.now=cye;kd.telemetry=nIr;kd.telemetryExpProblem=h3a;kd.telemetryRaw=g3a;kd.telemetryException=LDi;kd.telemetryCatch=A3a;kd.telemetryError=y3a;kd.logEngineCompletion=E3a;kd.logEnginePrompt=v3a;var e3a=FD(),t3a=an(),r3a=Lg(),ZTr=Ks(),Yyt=yre(),EL=eE(),n3a=myt(),i3a=xy(),o3a=Ayt(),s3a=CTr(),XTr=WTr(),eIr=cLe(),CI;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(CI||(kd.TelemetryStore=CI={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(CI||(kd.TelemetryStore=CI={}));function aye(t){return t===CI.Enhanced}a(aye,"isEnhanced");var a3a=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],lLe=8192,c3a=21,vL=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[s3a.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},cye())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=cye())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(i3a.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(e3a.IEnvService),n=e.get(EL.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,EL.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,EL.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${EL.BuildInfo.getVersion()}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`),this.properties.common_extname=n.getEditorPluginInfo().name,this.properties.common_extversion=n.getEditorPluginInfo().version,this.properties.common_vscodeversion=(0,EL.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,EL.dumpForTelemetry)(e);r["copilot.build"]=EL.BuildInfo.getBuild(),r["copilot.buildType"]=EL.BuildInfo.getBuildType(),this.properties={...this.properties,...r}}extendWithRequestId(e){let r={headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetry=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromProperties(e,r){if(aye(e))return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetry.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements);for(let e in this.measurements)isNaN(this.measurements[e])&&delete this.measurements[e]}multiplexProperties(){this.properties=t.multiplexProperties(this.properties)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}static multiplexProperties(e){let r={...e};for(let n in e){let o=e[n],s=o?.length??0;if(s>lLe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+lLe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(d3a,"telemetrizePromptLength");function cye(){return performance.now()}a(cye,"now");function f3a(t){return Math.floor(t/1e3)}a(f3a,"nowSeconds");function rIr(t){return t.get(XTr.ICompletionsTelemetryUserConfigService).optedIn}a(rIr,"shouldSendEnhanced");function MDi(t){return t.get(XTr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(MDi,"shouldSendFinetuningTelemetry");function nIr(t,e,r,n){return t.get(eIr.ICompletionsPromiseQueueService).register(p3a(t,e,cye(),r?.extendedBy(),n))}a(nIr,"telemetry");async function p3a(t,e,r,n,o=CI.Standard){let s=t.get(Yyt.ICompletionsTelemetryService),c=t.get(ZTr.IInstantiationService),l=n||vL.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!aye(o)||c.invokeFunction(rIr))&&tIr(s,o,e,l),aye(o)&&a3a.includes(e)&&c.invokeFunction(MDi)&&c.invokeFunction(u3a,o,e,l)}a(p3a,"_telemetry");function h3a(t,e){return t.get(eIr.ICompletionsPromiseQueueService).register(m3a(t,e,cye()))}a(h3a,"telemetryExpProblem");async function m3a(t,e,r){let n=t.get(Yyt.ICompletionsTelemetryService),o="expProblem",s=vL.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,CI.Standard,"SkipExp",r),tIr(n,CI.Standard,o,s)}a(m3a,"_telemetryExpProblem");function g3a(t,e,r,n){let o=t.get(Yyt.ICompletionsTelemetryService),s={...r,...ODi(t)};tIr(o,CI.Standard,e,{properties:s,measurements:n})}a(g3a,"telemetryRaw");function ODi(t){let e=t.get(EL.ICompletionsEditorAndPluginInfo),r={unique_id:(0,r3a.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,EL.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(XTr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(ODi,"createRequiredProperties");function LDi(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(LDi,"telemetryException");function A3a(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){LDi(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(A3a,"telemetryCatch");function y3a(t,e,r,n){return t.get(eIr.ICompletionsPromiseQueueService).register(_3a(t,e,cye(),r?.extendedBy(),n))}a(y3a,"telemetryError");async function _3a(t,e,r,n,o=CI.Standard){if(aye(o)&&!rIr(t))return;let s=t.get(ZTr.IInstantiationService),c=n||vL.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(l3a,o,e,c)}a(_3a,"_telemetryError");function E3a(t,e,r,n,o){let s=vL.createAndMarkAsIssued({completionTextJson:JSON.stringify(e),choiceIndex:o.toString()});if(r.logprobs)for(let[c,l]of Object.entries(r.logprobs))s.properties["logprobs_"+c]=JSON.stringify(l)??"unset";return s.extendWithRequestId(n),nIr(t,"engine.completion",s,CI.Enhanced)}a(E3a,"logEngineCompletion");function v3a(t,e,r){let n={promptJson:JSON.stringify({prefix:e.prefix,context:e.context}),promptSuffixJson:JSON.stringify(e.suffix)};if(e.context){let s=r.properties["request.option.extra"]?JSON.parse(r.properties["request.option.extra"]):{};s.context=e.context,n["request.option.extra"]=JSON.stringify(s)}let o=r.extendedBy(n);return nIr(t,"engine.prompt",o,CI.Enhanced)}a(v3a,"logEnginePrompt");var KTr=class{static{a(this,"CopilotTelemetryReporter")}};kd.CopilotTelemetryReporter=KTr;kd.ICompletionsTelemetryReporters=(0,t3a.createServiceIdentifier)("ICompletionsTelemetryReporters");var JTr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=CI.Standard){return aye(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(rIr(e))return this.reporterEnhanced}getFTReporter(e){}setReporter(e){this.reporter=e}setEnhancedReporter(e){this.reporterEnhanced=e}setFTReporter(e){this.reporterFT=e}async deactivate(){let e=[this.reporter,this.reporterEnhanced,this.reporterFT];this.reporter=this.reporterEnhanced=this.reporterFT=void 0,await Promise.all(e.map(r=>r?.dispose()))}};kd.TelemetryReporters=JTr});var yre=I(jD=>{"use strict";p();var C3a=jD&&jD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},b3a=jD&&jD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jD,"__esModule",{value:!0});jD.CompletionsTelemetryServiceBridge=jD.ICompletionsTelemetryService=void 0;var S3a=bh(),iIr=pTr(),T3a=an(),uLe=nA();jD.ICompletionsTelemetryService=(0,T3a.createServiceIdentifier)("completionsTelemetryService");var oIr=class{static{a(this,"CompletionsTelemetryServiceBridge")}constructor(e){this.telemetryService=e,this.reporter=void 0,this.enhancedReporter=void 0}sendGHTelemetryEvent(e,r,n,o){this.telemetryService.sendGHTelemetryEvent((0,iIr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??uLe.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,iIr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??uLe.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,iIr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??uLe.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??uLe.TelemetryStore.Enhanced)?.sendTelemetryException(e,void 0,void 0)}setSpyReporters(e,r){this.reporter=e,this.enhancedReporter=r}clearSpyReporters(){this.reporter=void 0,this.enhancedReporter=void 0}getSpyReporters(e){return uLe.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};jD.CompletionsTelemetryServiceBridge=oIr;jD.CompletionsTelemetryServiceBridge=oIr=C3a([b3a(0,S3a.ITelemetryService)],oIr)});var BDi=I(lye=>{"use strict";p();Object.defineProperty(lye,"__esModule",{value:!0});lye.CopilotExtensionStatus=lye.ICompletionsExtensionStatus=void 0;var I3a=an();lye.ICompletionsExtensionStatus=(0,I3a.createServiceIdentifier)("ICompletionsExtensionStatus");var sIr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};lye.CopilotExtensionStatus=sIr});var Kyt=I(HD=>{"use strict";p();Object.defineProperty(HD,"__esModule",{value:!0});HD.CopilotToken=void 0;HD.containsInternalOrg=FDi;HD.containsVSCodeOrg=qDi;HD.validateTokenEnvelope=jDi;HD.isTokenEnvelope=D3a;HD.isErrorEnvelope=N3a;HD.isStandardErrorEnvelope=M3a;HD.createTestExtendedTokenInfo=O3a;var Gn=x$();function FDi(t){return UDi(t)||QDi(t)}a(FDi,"containsInternalOrg");function UDi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(UDi,"containsGitHubOrg");function QDi(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(QDi,"containsMicrosoftOrg");function qDi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(qDi,"containsVSCodeOrg");var aIr=class{static{a(this,"CopilotToken")}constructor(e){this._info=e,this.tokenMap=this.parseToken(e.token)}parseToken(e){let r=new Map,o=e?.split(":")[0]?.split(";");for(let s of o){let[c,l]=s.split("=");r.set(c,l)}return r}get token(){return this._info.token}get sku(){return this._info.sku}get isIndividual(){return this._info.individual??!1}get organizationList(){return this._info.organization_list||[]}get organizationLoginList(){return this._info.organization_login_list||[]}get enterpriseList(){return this._info.enterprise_list||[]}get endpoints(){return this._info.endpoints}get isInternal(){return FDi(this.organizationList)}get isMicrosoftInternal(){return QDi(this.organizationList)}get isGitHubInternal(){return UDi(this.organizationList)}get isFreeUser(){return this.sku==="free_limited_copilot"}get isNoAuthUser(){return this.sku==="no_auth_limited_copilot"}get isManagedPlan(){let e=this.copilotPlan;return e==="business"||e==="enterprise"}get isUsageBasedBilling(){return this._info.token_based_billing===!0}get isChatQuotaExceeded(){return this.isFreeUser&&(this._info.limited_user_quotas?.chat??1)<=0}get isCompletionsQuotaExceeded(){return this.isFreeUser&&(this._info.limited_user_quotas?.completions??1)<=0}get codeQuoteEnabled(){return this._info.code_quote_enabled??!1}get isVscodeTeamMember(){return this._info.isVscodeTeamMember||qDi(this.organizationList)}get codexAgentEnabled(){return this._info.codex_agent_enabled??!1}get copilotPlan(){if(this.isFreeUser)return"free";let e=this._info.copilot_plan;switch(e){case"individual":case"individual_pro":case"individual_max":case"business":case"enterprise":return e;default:return"individual"}}get rawCopilotPlan(){return this.isFreeUser?"free":this._info.copilot_plan??"individual"}get quotaInfo(){return{quota_snapshots:this._info.quota_snapshots,quota_reset_date:this._info.quota_reset_date}}get tokenBasedBilling(){return this._info.token_based_billing}get username(){return this._info.username}isTelemetryEnabled(){return this._isTelemetryEnabled===void 0&&(this._isTelemetryEnabled=this._info.telemetry==="enabled"),this._isTelemetryEnabled}isPublicSuggestionsEnabled(){return this._isPublicSuggestionsEnabled===void 0&&(this._isPublicSuggestionsEnabled=this._info.public_suggestions==="enabled"),this._isPublicSuggestionsEnabled}isCopilotIgnoreEnabled(){return this._info.copilotignore_enabled??!1}get isCopilotCodeReviewEnabled(){return this._info.code_review_enabled??this.getTokenValue("ccr")==="1"}isEditorPreviewFeaturesEnabled(){return this.getTokenValue("editor_preview_features")!=="0"}isBlackbirdExternalIndexingEnabled(){return this.getTokenValue("blackbird_external_indexing")==="1"}isMcpEnabled(){return this.getTokenValue("mcp")!=="0"}isClientBYOKEnabled(){return this.getTokenValue("client_byok")==="1"}getTokenValue(e){return this.tokenMap.get(e)}isExpandedClientSideIndexingEnabled(){return this._info.blackbird_clientside_indexing===!0}isFcv1(){return this.tokenMap.get("fcv1")==="1"}isSn(){return this.tokenMap.get("sn")==="1"}};HD.CopilotToken=aIr;var x3a=(0,Gn.vObj)({message:(0,Gn.vRequired)((0,Gn.vString)()),notification_id:(0,Gn.vRequired)((0,Gn.vString)()),title:(0,Gn.vRequired)((0,Gn.vString)()),url:(0,Gn.vRequired)((0,Gn.vString)())}),w3a=(0,Gn.vObj)({can_signup_for_limited:(0,Gn.vNullable)((0,Gn.vBoolean)()),error_details:(0,Gn.vRequired)(x3a),message:(0,Gn.vRequired)((0,Gn.vString)()),reason:(0,Gn.vString)()}),R3a=(0,Gn.vObj)({token:(0,Gn.vRequired)((0,Gn.vString)()),expires_at:(0,Gn.vRequired)((0,Gn.vNumber)()),refresh_in:(0,Gn.vRequired)((0,Gn.vNumber)()),sku:(0,Gn.vString)(),individual:(0,Gn.vBoolean)(),blackbird_clientside_indexing:(0,Gn.vBoolean)(),code_quote_enabled:(0,Gn.vBoolean)(),code_review_enabled:(0,Gn.vBoolean)(),codesearch:(0,Gn.vBoolean)(),copilotignore_enabled:(0,Gn.vBoolean)(),public_suggestions:(0,Gn.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Gn.vEnum)("enabled","disabled"),endpoints:(0,Gn.vObj)({api:(0,Gn.vString)(),"origin-tracker":(0,Gn.vString)(),proxy:(0,Gn.vString)(),telemetry:(0,Gn.vString)()}),enterprise_list:(0,Gn.vNullable)((0,Gn.vArray)((0,Gn.vNumber)())),limited_user_quotas:(0,Gn.vNullable)((0,Gn.vObj)({chat:(0,Gn.vRequired)((0,Gn.vNumber)()),completions:(0,Gn.vRequired)((0,Gn.vNumber)())})),limited_user_reset_date:(0,Gn.vNullable)((0,Gn.vNumber)()),organization_list:(0,Gn.vArray)((0,Gn.vString)())}),k3a=(0,Gn.vObj)({message:(0,Gn.vRequired)((0,Gn.vString)()),documentation_url:(0,Gn.vRequired)((0,Gn.vString)()),status:(0,Gn.vRequired)((0,Gn.vString)())}),P3a=(0,Gn.vObj)({token:(0,Gn.vRequired)((0,Gn.vString)()),expires_at:(0,Gn.vRequired)((0,Gn.vNumber)()),refresh_in:(0,Gn.vRequired)((0,Gn.vNumber)())});function jDi(t){let e=R3a.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=P3a.validate(t);return n.error===void 0?{valid:!0,strategy:"fallback",strictError:r,envelope:t}:{valid:!1,strategy:"failed",strictError:r,fallbackError:n.error.message}}a(jDi,"validateTokenEnvelope");function D3a(t){return jDi(t).valid}a(D3a,"isTokenEnvelope");function N3a(t){return w3a.validate(t).error===void 0}a(N3a,"isErrorEnvelope");function M3a(t){return k3a.validate(t).error===void 0}a(M3a,"isStandardErrorEnvelope");function O3a(t){return{token:"test-token",expires_at:0,refresh_in:0,sku:"free_limited_copilot",individual:!0,blackbird_clientside_indexing:!1,code_quote_enabled:!1,code_review_enabled:!1,codesearch:!1,copilotignore_enabled:!1,public_suggestions:"enabled",telemetry:"enabled",username:"testuser",isVscodeTeamMember:!1,copilot_plan:"free",organization_login_list:[],...t}}a(O3a,"createTestExtendedTokenInfo")});var uye=I(bI=>{"use strict";p();var L3a=bI&&bI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},B3a=bI&&bI.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(bI,"__esModule",{value:!0});bI.CopilotTokenManagerImpl=bI.ICompletionsCopilotTokenManager=bI.CopilotToken=void 0;var F3a=rE(),U3a=an(),Q3a=pl(),q3a=Po(),j3a=Kyt();Object.defineProperty(bI,"CopilotToken",{enumerable:!0,get:a(function(){return j3a.CopilotToken},"get")});bI.ICompletionsCopilotTokenManager=(0,U3a.createServiceIdentifier)("ICompletionsCopilotTokenManager");var cIr=class extends q3a.Disposable{static{a(this,"CopilotTokenManagerImpl")}get token(){return this.tokenRefetcher.trigger(()=>this.updateCachedToken()),this._token}constructor(e=!1,r){super(),this.primed=e,this.authenticationService=r,this.tokenRefetcher=new Q3a.ThrottledDelayer(5e3),this.updateCachedToken(),this._register(this.authenticationService.onDidCopilotTokenChange(()=>this.updateCachedToken()))}primeToken(){try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async getToken(){return this.updateCachedToken()}async updateCachedToken(){return this._token=await this.authenticationService.getCopilotToken(),this._token}resetToken(e){this.authenticationService.resetCopilotToken()}getLastToken(){return this.authenticationService.copilotToken}};bI.CopilotTokenManagerImpl=cIr;bI.CopilotTokenManagerImpl=cIr=L3a([B3a(1,F3a.IAuthenticationService)],cIr)});var Jyt=I(dye=>{"use strict";p();Object.defineProperty(dye,"__esModule",{value:!0});dye.NoOpCitationManager=dye.ICompletionsCitationManager=void 0;var H3a=an(),G3a=Po();dye.ICompletionsCitationManager=(0,H3a.createServiceIdentifier)("ICompletionsCitationManager");var lIr=class{static{a(this,"NoOpCitationManager")}register(){return G3a.Disposable.None}async handleIPCodeCitation(e){}};dye.NoOpCitationManager=lIr});var Vv=I(oA=>{"use strict";p();Object.defineProperty(oA,"__esModule",{value:!0});oA.HasPropertyKey=$3a;oA.IsAsyncIterator=V3a;oA.IsArray=uIr;oA.IsBigInt=W3a;oA.IsBoolean=z3a;oA.IsDate=Y3a;oA.IsFunction=K3a;oA.IsIterator=J3a;oA.IsNull=Z3a;oA.IsNumber=X3a;oA.IsObject=dIr;oA.IsRegExp=eFa;oA.IsString=tFa;oA.IsSymbol=rFa;oA.IsUint8Array=fIr;oA.IsUndefined=nFa;function $3a(t,e){return e in t}a($3a,"HasPropertyKey");function V3a(t){return dIr(t)&&!uIr(t)&&!fIr(t)&&Symbol.asyncIterator in t}a(V3a,"IsAsyncIterator");function uIr(t){return Array.isArray(t)}a(uIr,"IsArray");function W3a(t){return typeof t=="bigint"}a(W3a,"IsBigInt");function z3a(t){return typeof t=="boolean"}a(z3a,"IsBoolean");function Y3a(t){return t instanceof globalThis.Date}a(Y3a,"IsDate");function K3a(t){return typeof t=="function"}a(K3a,"IsFunction");function J3a(t){return dIr(t)&&!uIr(t)&&!fIr(t)&&Symbol.iterator in t}a(J3a,"IsIterator");function Z3a(t){return t===null}a(Z3a,"IsNull");function X3a(t){return typeof t=="number"}a(X3a,"IsNumber");function dIr(t){return typeof t=="object"&&t!==null}a(dIr,"IsObject");function eFa(t){return t instanceof globalThis.RegExp}a(eFa,"IsRegExp");function tFa(t){return typeof t=="string"}a(tFa,"IsString");function rFa(t){return typeof t=="symbol"}a(rFa,"IsSymbol");function fIr(t){return t instanceof globalThis.Uint8Array}a(fIr,"IsUint8Array");function nFa(t){return t===void 0}a(nFa,"IsUndefined")});var yS=I(F6=>{"use strict";p();var iFa=F6&&F6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oFa=F6&&F6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),sFa=F6&&F6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oZyt(e))}a(aFa,"ArrayType");function cFa(t){return new Date(t.getTime())}a(cFa,"DateType");function lFa(t){return new Uint8Array(t)}a(lFa,"Uint8ArrayType");function uFa(t){return new RegExp(t.source,t.flags)}a(uFa,"RegExpType");function dFa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Zyt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Zyt(t[r]);return e}a(dFa,"ObjectType");function Zyt(t){return dLe.IsArray(t)?aFa(t):dLe.IsDate(t)?cFa(t):dLe.IsUint8Array(t)?lFa(t):dLe.IsRegExp(t)?uFa(t):dLe.IsObject(t)?dFa(t):t}a(Zyt,"Visit");function fFa(t){return Zyt(t)}a(fFa,"Clone")});var e_t=I(Xyt=>{"use strict";p();Object.defineProperty(Xyt,"__esModule",{value:!0});Xyt.CloneRest=pFa;Xyt.CloneType=GDi;var HDi=yS();function pFa(t){return t.map(e=>GDi(e))}a(pFa,"CloneRest");function GDi(t,e){return e===void 0?(0,HDi.Clone)(t):(0,HDi.Clone)({...e,...t})}a(GDi,"CloneType")});var pIr=I(D$=>{"use strict";p();var hFa=D$&&D$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Di=D$&&D$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hFa(e,t,r)};Object.defineProperty(D$,"__esModule",{value:!0});$Di(e_t(),D$);$Di(yS(),D$)});var t_t=I(Ia=>{"use strict";p();Object.defineProperty(Ia,"__esModule",{value:!0});Ia.IsAsyncIterator=mFa;Ia.IsIterator=gFa;Ia.IsStandardObject=AFa;Ia.IsInstanceObject=yFa;Ia.IsPromise=_Fa;Ia.IsDate=EFa;Ia.IsMap=vFa;Ia.IsSet=CFa;Ia.IsRegExp=bFa;Ia.IsTypedArray=SFa;Ia.IsInt8Array=TFa;Ia.IsUint8Array=IFa;Ia.IsUint8ClampedArray=xFa;Ia.IsInt16Array=wFa;Ia.IsUint16Array=RFa;Ia.IsInt32Array=kFa;Ia.IsUint32Array=PFa;Ia.IsFloat32Array=DFa;Ia.IsFloat64Array=NFa;Ia.IsBigInt64Array=MFa;Ia.IsBigUint64Array=OFa;Ia.HasPropertyKey=LFa;Ia.IsObject=fLe;Ia.IsArray=VDi;Ia.IsUndefined=WDi;Ia.IsNull=zDi;Ia.IsBoolean=YDi;Ia.IsNumber=KDi;Ia.IsInteger=BFa;Ia.IsBigInt=JDi;Ia.IsString=ZDi;Ia.IsFunction=XDi;Ia.IsSymbol=eNi;Ia.IsValueType=FFa;function mFa(t){return fLe(t)&&globalThis.Symbol.asyncIterator in t}a(mFa,"IsAsyncIterator");function gFa(t){return fLe(t)&&globalThis.Symbol.iterator in t}a(gFa,"IsIterator");function AFa(t){return fLe(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(AFa,"IsStandardObject");function yFa(t){return fLe(t)&&!VDi(t)&&XDi(t.constructor)&&t.constructor.name!=="Object"}a(yFa,"IsInstanceObject");function _Fa(t){return t instanceof globalThis.Promise}a(_Fa,"IsPromise");function EFa(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(EFa,"IsDate");function vFa(t){return t instanceof globalThis.Map}a(vFa,"IsMap");function CFa(t){return t instanceof globalThis.Set}a(CFa,"IsSet");function bFa(t){return t instanceof globalThis.RegExp}a(bFa,"IsRegExp");function SFa(t){return globalThis.ArrayBuffer.isView(t)}a(SFa,"IsTypedArray");function TFa(t){return t instanceof globalThis.Int8Array}a(TFa,"IsInt8Array");function IFa(t){return t instanceof globalThis.Uint8Array}a(IFa,"IsUint8Array");function xFa(t){return t instanceof globalThis.Uint8ClampedArray}a(xFa,"IsUint8ClampedArray");function wFa(t){return t instanceof globalThis.Int16Array}a(wFa,"IsInt16Array");function RFa(t){return t instanceof globalThis.Uint16Array}a(RFa,"IsUint16Array");function kFa(t){return t instanceof globalThis.Int32Array}a(kFa,"IsInt32Array");function PFa(t){return t instanceof globalThis.Uint32Array}a(PFa,"IsUint32Array");function DFa(t){return t instanceof globalThis.Float32Array}a(DFa,"IsFloat32Array");function NFa(t){return t instanceof globalThis.Float64Array}a(NFa,"IsFloat64Array");function MFa(t){return t instanceof globalThis.BigInt64Array}a(MFa,"IsBigInt64Array");function OFa(t){return t instanceof globalThis.BigUint64Array}a(OFa,"IsBigUint64Array");function LFa(t,e){return e in t}a(LFa,"HasPropertyKey");function fLe(t){return t!==null&&typeof t=="object"}a(fLe,"IsObject");function VDi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(VDi,"IsArray");function WDi(t){return t===void 0}a(WDi,"IsUndefined");function zDi(t){return t===null}a(zDi,"IsNull");function YDi(t){return typeof t=="boolean"}a(YDi,"IsBoolean");function KDi(t){return typeof t=="number"}a(KDi,"IsNumber");function BFa(t){return globalThis.Number.isInteger(t)}a(BFa,"IsInteger");function JDi(t){return typeof t=="bigint"}a(JDi,"IsBigInt");function ZDi(t){return typeof t=="string"}a(ZDi,"IsString");function XDi(t){return typeof t=="function"}a(XDi,"IsFunction");function eNi(t){return typeof t=="symbol"}a(eNi,"IsSymbol");function FFa(t){return JDi(t)||YDi(t)||zDi(t)||KDi(t)||ZDi(t)||eNi(t)||WDi(t)}a(FFa,"IsValueType")});var Ug=I(_re=>{"use strict";p();var UFa=_re&&_re.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QFa=_re&&_re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UFa(e,t,r)};Object.defineProperty(_re,"__esModule",{value:!0});QFa(t_t(),_re)});var pLe=I(n_t=>{"use strict";p();Object.defineProperty(n_t,"__esModule",{value:!0});n_t.TypeSystemPolicy=void 0;var r_t=Ug(),tNi;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(c,l){return t.ExactOptionalPropertyTypes?l in c:c[l]!==void 0}a(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function r(c){let l=(0,r_t.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,r_t.IsArray)(c)}a(r,"IsObjectLike"),t.IsObjectLike=r;function n(c){return r(c)&&!(c instanceof Date)&&!(c instanceof Uint8Array)}a(n,"IsRecordLike"),t.IsRecordLike=n;function o(c){return t.AllowNaN?(0,r_t.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,r_t.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(tNi||(n_t.TypeSystemPolicy=tNi={}))});var rNi=I(U6=>{"use strict";p();var qFa=U6&&U6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jFa=U6&&U6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HFa=U6&&U6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oi_t(e))}a(GFa,"ImmutableArray");function $Fa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=i_t(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=i_t(t[r]);return globalThis.Object.freeze(e)}a($Fa,"ImmutableObject");function i_t(t){return hLe.IsArray(t)?GFa(t):hLe.IsDate(t)?t:hLe.IsUint8Array(t)?t:hLe.IsRegExp(t)?t:hLe.IsObject(t)?$Fa(t):t}a(i_t,"Immutable")});var Pi=I(hIr=>{"use strict";p();Object.defineProperty(hIr,"__esModule",{value:!0});hIr.CreateType=YFa;var VFa=pLe(),WFa=rNi(),zFa=yS();function YFa(t,e){let r=e!==void 0?{...e,...t}:t;switch(VFa.TypeSystemPolicy.InstanceMode){case"freeze":return(0,WFa.Immutable)(r);case"clone":return(0,zFa.Clone)(r);default:return r}}a(YFa,"CreateType")});var Q6=I(Ere=>{"use strict";p();var KFa=Ere&&Ere.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JFa=Ere&&Ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&KFa(e,t,r)};Object.defineProperty(Ere,"__esModule",{value:!0});JFa(Pi(),Ere)});var gIr=I(o_t=>{"use strict";p();Object.defineProperty(o_t,"__esModule",{value:!0});o_t.TypeBoxError=void 0;var mIr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};o_t.TypeBoxError=mIr});var Gf=I(vre=>{"use strict";p();var ZFa=vre&&vre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XFa=vre&&vre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZFa(e,t,r)};Object.defineProperty(vre,"__esModule",{value:!0});XFa(gIr(),vre)});var mLe=I(ek=>{"use strict";p();Object.defineProperty(ek,"__esModule",{value:!0});ek.Kind=ek.Hint=ek.OptionalKind=ek.ReadonlyKind=ek.TransformKind=void 0;ek.TransformKind=Symbol.for("TypeBox.Transform");ek.ReadonlyKind=Symbol.for("TypeBox.Readonly");ek.OptionalKind=Symbol.for("TypeBox.Optional");ek.Hint=Symbol.for("TypeBox.Hint");ek.Kind=Symbol.for("TypeBox.Kind")});var Tn=I(Cre=>{"use strict";p();var e8a=Cre&&Cre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),t8a=Cre&&Cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&e8a(e,t,r)};Object.defineProperty(Cre,"__esModule",{value:!0});t8a(mLe(),Cre)});var Is=I(pi=>{"use strict";p();var r8a=pi&&pi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),n8a=pi&&pi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),i8a=pi&&pi.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var g8a=Xn&&Xn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),A8a=Xn&&Xn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),y8a=Xn&&Xn.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=7&&r<=13||r===27||r===127)return!1}return!0}a(yIr,"IsControlCharacterFree");function QNi(t){return _Ir(t)||sA(t)}a(QNi,"IsAdditionalProperties");function ALe(t){return ci.IsUndefined(t)||ci.IsBigInt(t)}a(ALe,"IsOptionalBigInt");function du(t){return ci.IsUndefined(t)||ci.IsNumber(t)}a(du,"IsOptionalNumber");function _Ir(t){return ci.IsUndefined(t)||ci.IsBoolean(t)}a(_Ir,"IsOptionalBoolean");function Tl(t){return ci.IsUndefined(t)||ci.IsString(t)}a(Tl,"IsOptionalString");function v8a(t){return ci.IsUndefined(t)||ci.IsString(t)&&yIr(t)&&UNi(t)}a(v8a,"IsOptionalPattern");function C8a(t){return ci.IsUndefined(t)||ci.IsString(t)&&yIr(t)}a(C8a,"IsOptionalFormat");function qNi(t){return ci.IsUndefined(t)||sA(t)}a(qNi,"IsOptionalSchema");function b8a(t){return ci.IsObject(t)&&t[CL.ReadonlyKind]==="Readonly"}a(b8a,"IsReadonly");function S8a(t){return ci.IsObject(t)&&t[CL.OptionalKind]==="Optional"}a(S8a,"IsOptional");function jNi(t){return Zs(t,"Any")&&Tl(t.$id)}a(jNi,"IsAny");function HNi(t){return Zs(t,"Argument")&&ci.IsNumber(t.index)}a(HNi,"IsArgument");function GNi(t){return Zs(t,"Array")&&t.type==="array"&&Tl(t.$id)&&sA(t.items)&&du(t.minItems)&&du(t.maxItems)&&_Ir(t.uniqueItems)&&qNi(t.contains)&&du(t.minContains)&&du(t.maxContains)}a(GNi,"IsArray");function $Ni(t){return Zs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&Tl(t.$id)&&sA(t.items)}a($Ni,"IsAsyncIterator");function VNi(t){return Zs(t,"BigInt")&&t.type==="bigint"&&Tl(t.$id)&&ALe(t.exclusiveMaximum)&&ALe(t.exclusiveMinimum)&&ALe(t.maximum)&&ALe(t.minimum)&&ALe(t.multipleOf)}a(VNi,"IsBigInt");function WNi(t){return Zs(t,"Boolean")&&t.type==="boolean"&&Tl(t.$id)}a(WNi,"IsBoolean");function zNi(t){return Zs(t,"Computed")&&ci.IsString(t.target)&&ci.IsArray(t.parameters)&&t.parameters.every(e=>sA(e))}a(zNi,"IsComputed");function YNi(t){return Zs(t,"Constructor")&&t.type==="Constructor"&&Tl(t.$id)&&ci.IsArray(t.parameters)&&t.parameters.every(e=>sA(e))&&sA(t.returns)}a(YNi,"IsConstructor");function KNi(t){return Zs(t,"Date")&&t.type==="Date"&&Tl(t.$id)&&du(t.exclusiveMaximumTimestamp)&&du(t.exclusiveMinimumTimestamp)&&du(t.maximumTimestamp)&&du(t.minimumTimestamp)&&du(t.multipleOfTimestamp)}a(KNi,"IsDate");function JNi(t){return Zs(t,"Function")&&t.type==="Function"&&Tl(t.$id)&&ci.IsArray(t.parameters)&&t.parameters.every(e=>sA(e))&&sA(t.returns)}a(JNi,"IsFunction");function T8a(t){return Zs(t,"Import")&&ci.HasPropertyKey(t,"$defs")&&ci.IsObject(t.$defs)&&s_t(t.$defs)&&ci.HasPropertyKey(t,"$ref")&&ci.IsString(t.$ref)&&t.$ref in t.$defs}a(T8a,"IsImport");function ZNi(t){return Zs(t,"Integer")&&t.type==="integer"&&Tl(t.$id)&&du(t.exclusiveMaximum)&&du(t.exclusiveMinimum)&&du(t.maximum)&&du(t.minimum)&&du(t.multipleOf)}a(ZNi,"IsInteger");function s_t(t){return ci.IsObject(t)&&Object.entries(t).every(([e,r])=>yIr(e)&&sA(r))}a(s_t,"IsProperties");function XNi(t){return Zs(t,"Intersect")&&!(ci.IsString(t.type)&&t.type!=="object")&&ci.IsArray(t.allOf)&&t.allOf.every(e=>sA(e)&&!_Mi(e))&&Tl(t.type)&&(_Ir(t.unevaluatedProperties)||qNi(t.unevaluatedProperties))&&Tl(t.$id)}a(XNi,"IsIntersect");function eMi(t){return Zs(t,"Iterator")&&t.type==="Iterator"&&Tl(t.$id)&&sA(t.items)}a(eMi,"IsIterator");function Zs(t,e){return ci.IsObject(t)&&CL.Kind in t&&t[CL.Kind]===e}a(Zs,"IsKindOf");function tMi(t){return yLe(t)&&ci.IsString(t.const)}a(tMi,"IsLiteralString");function rMi(t){return yLe(t)&&ci.IsNumber(t.const)}a(rMi,"IsLiteralNumber");function I8a(t){return yLe(t)&&ci.IsBoolean(t.const)}a(I8a,"IsLiteralBoolean");function yLe(t){return Zs(t,"Literal")&&Tl(t.$id)&&nMi(t.const)}a(yLe,"IsLiteral");function nMi(t){return ci.IsBoolean(t)||ci.IsNumber(t)||ci.IsString(t)}a(nMi,"IsLiteralValue");function iMi(t){return Zs(t,"MappedKey")&&ci.IsArray(t.keys)&&t.keys.every(e=>ci.IsNumber(e)||ci.IsString(e))}a(iMi,"IsMappedKey");function oMi(t){return Zs(t,"MappedResult")&&s_t(t.properties)}a(oMi,"IsMappedResult");function sMi(t){return Zs(t,"Never")&&ci.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(sMi,"IsNever");function aMi(t){return Zs(t,"Not")&&sA(t.not)}a(aMi,"IsNot");function cMi(t){return Zs(t,"Null")&&t.type==="null"&&Tl(t.$id)}a(cMi,"IsNull");function lMi(t){return Zs(t,"Number")&&t.type==="number"&&Tl(t.$id)&&du(t.exclusiveMaximum)&&du(t.exclusiveMinimum)&&du(t.maximum)&&du(t.minimum)&&du(t.multipleOf)}a(lMi,"IsNumber");function uMi(t){return Zs(t,"Object")&&t.type==="object"&&Tl(t.$id)&&s_t(t.properties)&&QNi(t.additionalProperties)&&du(t.minProperties)&&du(t.maxProperties)}a(uMi,"IsObject");function dMi(t){return Zs(t,"Promise")&&t.type==="Promise"&&Tl(t.$id)&&sA(t.item)}a(dMi,"IsPromise");function fMi(t){return Zs(t,"Record")&&t.type==="object"&&Tl(t.$id)&&QNi(t.additionalProperties)&&ci.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&UNi(r[0])&&ci.IsObject(e.patternProperties)&&sA(e.patternProperties[r[0]])})(t)}a(fMi,"IsRecord");function x8a(t){return ci.IsObject(t)&&CL.Hint in t&&t[CL.Hint]==="Recursive"}a(x8a,"IsRecursive");function pMi(t){return Zs(t,"Ref")&&Tl(t.$id)&&ci.IsString(t.$ref)}a(pMi,"IsRef");function hMi(t){return Zs(t,"RegExp")&&Tl(t.$id)&&ci.IsString(t.source)&&ci.IsString(t.flags)&&du(t.maxLength)&&du(t.minLength)}a(hMi,"IsRegExp");function mMi(t){return Zs(t,"String")&&t.type==="string"&&Tl(t.$id)&&du(t.minLength)&&du(t.maxLength)&&v8a(t.pattern)&&C8a(t.format)}a(mMi,"IsString");function gMi(t){return Zs(t,"Symbol")&&t.type==="symbol"&&Tl(t.$id)}a(gMi,"IsSymbol");function AMi(t){return Zs(t,"TemplateLiteral")&&t.type==="string"&&ci.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(AMi,"IsTemplateLiteral");function yMi(t){return Zs(t,"This")&&Tl(t.$id)&&ci.IsString(t.$ref)}a(yMi,"IsThis");function _Mi(t){return ci.IsObject(t)&&CL.TransformKind in t}a(_Mi,"IsTransform");function EMi(t){return Zs(t,"Tuple")&&t.type==="array"&&Tl(t.$id)&&ci.IsNumber(t.minItems)&&ci.IsNumber(t.maxItems)&&t.minItems===t.maxItems&&(ci.IsUndefined(t.items)&&ci.IsUndefined(t.additionalItems)&&t.minItems===0||ci.IsArray(t.items)&&t.items.every(e=>sA(e)))}a(EMi,"IsTuple");function vMi(t){return Zs(t,"Undefined")&&t.type==="undefined"&&Tl(t.$id)}a(vMi,"IsUndefined");function w8a(t){return EIr(t)&&t.anyOf.every(e=>tMi(e)||rMi(e))}a(w8a,"IsUnionLiteral");function EIr(t){return Zs(t,"Union")&&Tl(t.$id)&&ci.IsObject(t)&&ci.IsArray(t.anyOf)&&t.anyOf.every(e=>sA(e))}a(EIr,"IsUnion");function CMi(t){return Zs(t,"Uint8Array")&&t.type==="Uint8Array"&&Tl(t.$id)&&du(t.minByteLength)&&du(t.maxByteLength)}a(CMi,"IsUint8Array");function bMi(t){return Zs(t,"Unknown")&&Tl(t.$id)}a(bMi,"IsUnknown");function SMi(t){return Zs(t,"Unsafe")}a(SMi,"IsUnsafe");function TMi(t){return Zs(t,"Void")&&t.type==="void"&&Tl(t.$id)}a(TMi,"IsVoid");function IMi(t){return ci.IsObject(t)&&CL.Kind in t&&ci.IsString(t[CL.Kind])&&!E8a.includes(t[CL.Kind])}a(IMi,"IsKind");function sA(t){return ci.IsObject(t)&&(jNi(t)||HNi(t)||GNi(t)||WNi(t)||VNi(t)||$Ni(t)||zNi(t)||YNi(t)||KNi(t)||JNi(t)||ZNi(t)||XNi(t)||eMi(t)||yLe(t)||iMi(t)||oMi(t)||sMi(t)||aMi(t)||cMi(t)||lMi(t)||uMi(t)||dMi(t)||fMi(t)||pMi(t)||hMi(t)||mMi(t)||gMi(t)||AMi(t)||yMi(t)||EMi(t)||vMi(t)||EIr(t)||CMi(t)||bMi(t)||SMi(t)||TMi(t)||IMi(t))}a(sA,"IsSchema")});var CIr=I(ES=>{"use strict";p();var R8a=ES&&ES.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),k8a=ES&&ES.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vIr=ES&&ES.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(bIr,"__esModule",{value:!0});bIr.Increment=P8a;function P8a(t){return(parseInt(t)+1).toString()}a(P8a,"Increment")});var RMi=I(bre=>{"use strict";p();var D8a=bre&&bre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N8a=bre&&bre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&D8a(e,t,r)};Object.defineProperty(bre,"__esModule",{value:!0});N8a(wMi(),bre)});var kMi=I(Mp=>{"use strict";p();Object.defineProperty(Mp,"__esModule",{value:!0});Mp.PatternNeverExact=Mp.PatternStringExact=Mp.PatternNumberExact=Mp.PatternBooleanExact=Mp.PatternNever=Mp.PatternString=Mp.PatternNumber=Mp.PatternBoolean=void 0;Mp.PatternBoolean="(true|false)";Mp.PatternNumber="(0|[1-9][0-9]*)";Mp.PatternString="(.*)";Mp.PatternNever="(?!.*)";Mp.PatternBooleanExact=`^${Mp.PatternBoolean}$`;Mp.PatternNumberExact=`^${Mp.PatternNumber}$`;Mp.PatternStringExact=`^${Mp.PatternString}$`;Mp.PatternNeverExact=`^${Mp.PatternNever}$`});var _Le=I(Sre=>{"use strict";p();var M8a=Sre&&Sre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),O8a=Sre&&Sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&M8a(e,t,r)};Object.defineProperty(Sre,"__esModule",{value:!0});O8a(kMi(),Sre)});var PMi=I(N$=>{"use strict";p();Object.defineProperty(N$,"__esModule",{value:!0});N$.Entries=L8a;N$.Clear=B8a;N$.Delete=F8a;N$.Has=U8a;N$.Set=Q8a;N$.Get=q8a;var fye=new Map;function L8a(){return new Map(fye)}a(L8a,"Entries");function B8a(){return fye.clear()}a(B8a,"Clear");function F8a(t){return fye.delete(t)}a(F8a,"Delete");function U8a(t){return fye.has(t)}a(U8a,"Has");function Q8a(t,e){fye.set(t,e)}a(Q8a,"Set");function q8a(t){return fye.get(t)}a(q8a,"Get")});var DMi=I(M$=>{"use strict";p();Object.defineProperty(M$,"__esModule",{value:!0});M$.Entries=j8a;M$.Clear=H8a;M$.Delete=G8a;M$.Has=$8a;M$.Set=V8a;M$.Get=W8a;var pye=new Map;function j8a(){return new Map(pye)}a(j8a,"Entries");function H8a(){return pye.clear()}a(H8a,"Clear");function G8a(t){return pye.delete(t)}a(G8a,"Delete");function $8a(t){return pye.has(t)}a($8a,"Has");function V8a(t,e){pye.set(t,e)}a(V8a,"Set");function W8a(t){return pye.get(t)}a(W8a,"Get")});var hye=I(tk=>{"use strict";p();var z8a=tk&&tk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Y8a=tk&&tk.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),NMi=tk&&tk.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(bL,"__esModule",{value:!0});bL.SetIncludes=MMi;bL.SetIsSubset=K8a;bL.SetDistinct=J8a;bL.SetIntersect=OMi;bL.SetUnion=Z8a;bL.SetComplement=X8a;bL.SetIntersectMany=t6a;bL.SetUnionMany=r6a;function MMi(t,e){return t.includes(e)}a(MMi,"SetIncludes");function K8a(t,e){return t.every(r=>MMi(e,r))}a(K8a,"SetIsSubset");function J8a(t){return[...new Set(t)]}a(J8a,"SetDistinct");function OMi(t,e){return t.filter(r=>e.includes(r))}a(OMi,"SetIntersect");function Z8a(t,e){return[...t,...e]}a(Z8a,"SetUnion");function X8a(t,e){return t.filter(r=>!e.includes(r))}a(X8a,"SetComplement");function e6a(t,e){return t.reduce((r,n)=>OMi(r,n),e)}a(e6a,"SetIntersectManyResolve");function t6a(t){return t.length===1?t[0]:t.length>1?e6a(t.slice(1),t[0]):[]}a(t6a,"SetIntersectMany");function r6a(t){let e=[];for(let r of t)e.push(...r);return e}a(r6a,"SetUnionMany")});var ELe=I(Tre=>{"use strict";p();var n6a=Tre&&Tre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i6a=Tre&&Tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&n6a(e,t,r)};Object.defineProperty(Tre,"__esModule",{value:!0});i6a(LMi(),Tre)});var BMi=I(SIr=>{"use strict";p();Object.defineProperty(SIr,"__esModule",{value:!0});SIr.Any=a6a;var o6a=Q6(),s6a=Tn();function a6a(t){return(0,o6a.CreateType)({[s6a.Kind]:"Any"},t)}a(a6a,"Any")});var mye=I(Ire=>{"use strict";p();var c6a=Ire&&Ire.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),l6a=Ire&&Ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&c6a(e,t,r)};Object.defineProperty(Ire,"__esModule",{value:!0});l6a(BMi(),Ire)});var FMi=I(TIr=>{"use strict";p();Object.defineProperty(TIr,"__esModule",{value:!0});TIr.Array=f6a;var u6a=Pi(),d6a=Tn();function f6a(t,e){return(0,u6a.CreateType)({[d6a.Kind]:"Array",type:"array",items:t},e)}a(f6a,"Array")});var gye=I(xre=>{"use strict";p();var p6a=xre&&xre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),h6a=xre&&xre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&p6a(e,t,r)};Object.defineProperty(xre,"__esModule",{value:!0});h6a(FMi(),xre)});var UMi=I(IIr=>{"use strict";p();Object.defineProperty(IIr,"__esModule",{value:!0});IIr.Argument=A6a;var m6a=Pi(),g6a=Tn();function A6a(t){return(0,m6a.CreateType)({[g6a.Kind]:"Argument",index:t})}a(A6a,"Argument")});var a_t=I(wre=>{"use strict";p();var y6a=wre&&wre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_6a=wre&&wre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&y6a(e,t,r)};Object.defineProperty(wre,"__esModule",{value:!0});_6a(UMi(),wre)});var QMi=I(xIr=>{"use strict";p();Object.defineProperty(xIr,"__esModule",{value:!0});xIr.AsyncIterator=C6a;var E6a=Tn(),v6a=Pi();function C6a(t,e){return(0,v6a.CreateType)({[E6a.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(C6a,"AsyncIterator")});var Aye=I(Rre=>{"use strict";p();var b6a=Rre&&Rre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),S6a=Rre&&Rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&b6a(e,t,r)};Object.defineProperty(Rre,"__esModule",{value:!0});S6a(QMi(),Rre)});var qMi=I(wIr=>{"use strict";p();Object.defineProperty(wIr,"__esModule",{value:!0});wIr.Computed=x6a;var T6a=Q6(),I6a=mLe();function x6a(t,e,r){return(0,T6a.CreateType)({[I6a.Kind]:"Computed",target:t,parameters:e},r)}a(x6a,"Computed")});var O$=I(kre=>{"use strict";p();var w6a=kre&&kre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),R6a=kre&&kre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&w6a(e,t,r)};Object.defineProperty(kre,"__esModule",{value:!0});R6a(qMi(),kre)});var c_t=I(RIr=>{"use strict";p();Object.defineProperty(RIr,"__esModule",{value:!0});RIr.Discard=P6a;function k6a(t,e){let{[e]:r,...n}=t;return n}a(k6a,"DiscardKey");function P6a(t,e){return e.reduce((r,n)=>k6a(r,n),t)}a(P6a,"Discard")});var j6=I(Pre=>{"use strict";p();var D6a=Pre&&Pre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N6a=Pre&&Pre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&D6a(e,t,r)};Object.defineProperty(Pre,"__esModule",{value:!0});N6a(c_t(),Pre)});var jMi=I(kIr=>{"use strict";p();Object.defineProperty(kIr,"__esModule",{value:!0});kIr.Never=L6a;var M6a=Pi(),O6a=Tn();function L6a(t){return(0,M6a.CreateType)({[O6a.Kind]:"Never",not:{}},t)}a(L6a,"Never")});var Fm=I(Dre=>{"use strict";p();var B6a=Dre&&Dre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F6a=Dre&&Dre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&B6a(e,t,r)};Object.defineProperty(Dre,"__esModule",{value:!0});F6a(jMi(),Dre)});var HMi=I(PIr=>{"use strict";p();Object.defineProperty(PIr,"__esModule",{value:!0});PIr.MappedKey=q6a;var U6a=Pi(),Q6a=Tn();function q6a(t){return(0,U6a.CreateType)({[Q6a.Kind]:"MappedKey",keys:t})}a(q6a,"MappedKey")});var NIr=I(DIr=>{"use strict";p();Object.defineProperty(DIr,"__esModule",{value:!0});DIr.MappedResult=G6a;var j6a=Pi(),H6a=Tn();function G6a(t){return(0,j6a.CreateType)({[H6a.Kind]:"MappedResult",properties:t})}a(G6a,"MappedResult")});var GMi=I(MIr=>{"use strict";p();Object.defineProperty(MIr,"__esModule",{value:!0});MIr.Constructor=W6a;var $6a=Pi(),V6a=Tn();function W6a(t,e,r){return(0,$6a.CreateType)({[V6a.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(W6a,"Constructor")});var yye=I(Nre=>{"use strict";p();var z6a=Nre&&Nre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Y6a=Nre&&Nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&z6a(e,t,r)};Object.defineProperty(Nre,"__esModule",{value:!0});Y6a(GMi(),Nre)});var $Mi=I(OIr=>{"use strict";p();Object.defineProperty(OIr,"__esModule",{value:!0});OIr.Function=Z6a;var K6a=Pi(),J6a=Tn();function Z6a(t,e,r){return(0,K6a.CreateType)({[J6a.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(Z6a,"Function")});var L$=I(Mre=>{"use strict";p();var X6a=Mre&&Mre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eUa=Mre&&Mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&X6a(e,t,r)};Object.defineProperty(Mre,"__esModule",{value:!0});eUa($Mi(),Mre)});var BIr=I(LIr=>{"use strict";p();Object.defineProperty(LIr,"__esModule",{value:!0});LIr.UnionCreate=nUa;var tUa=Pi(),rUa=Tn();function nUa(t,e){return(0,tUa.CreateType)({[rUa.Kind]:"Union",anyOf:t},e)}a(nUa,"UnionCreate")});var YMi=I(FIr=>{"use strict";p();Object.defineProperty(FIr,"__esModule",{value:!0});FIr.UnionEvaluated=fUa;var iUa=Pi(),oUa=Tn(),sUa=j6(),aUa=Fm(),cUa=SL(),VMi=BIr(),zMi=Is();function lUa(t){return t.some(e=>(0,zMi.IsOptional)(e))}a(lUa,"IsUnionOptional");function WMi(t){return t.map(e=>(0,zMi.IsOptional)(e)?uUa(e):e)}a(WMi,"RemoveOptionalFromRest");function uUa(t){return(0,sUa.Discard)(t,[oUa.OptionalKind])}a(uUa,"RemoveOptionalFromType");function dUa(t,e){return lUa(t)?(0,cUa.Optional)((0,VMi.UnionCreate)(WMi(t),e)):(0,VMi.UnionCreate)(WMi(t),e)}a(dUa,"ResolveUnion");function fUa(t,e){return t.length===1?(0,iUa.CreateType)(t[0],e):t.length===0?(0,aUa.Never)(e):dUa(t,e)}a(fUa,"UnionEvaluated")});var JMi=I(KMi=>{"use strict";p();Object.defineProperty(KMi,"__esModule",{value:!0});var W4p=Tn()});var ZMi=I(UIr=>{"use strict";p();Object.defineProperty(UIr,"__esModule",{value:!0});UIr.Union=gUa;var pUa=Fm(),hUa=Pi(),mUa=BIr();function gUa(t,e){return t.length===0?(0,pUa.Never)(e):t.length===1?(0,hUa.CreateType)(t[0],e):(0,mUa.UnionCreate)(t,e)}a(gUa,"Union")});var Op=I(H6=>{"use strict";p();var AUa=H6&&H6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QIr=H6&&H6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&AUa(e,t,r)};Object.defineProperty(H6,"__esModule",{value:!0});QIr(YMi(),H6);QIr(JMi(),H6);QIr(ZMi(),H6)});var l_t=I(_ye=>{"use strict";p();Object.defineProperty(_ye,"__esModule",{value:!0});_ye.TemplateLiteralParserError=void 0;_ye.TemplateLiteralParse=Ore;_ye.TemplateLiteralParseExact=IUa;var yUa=Gf(),vLe=class extends yUa.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};_ye.TemplateLiteralParserError=vLe;function _Ua(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(_Ua,"Unescape");function qIr(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(qIr,"IsNonEscaped");function G6(t,e){return qIr(t,e,"(")}a(G6,"IsOpenParen");function CLe(t,e){return qIr(t,e,")")}a(CLe,"IsCloseParen");function XMi(t,e){return qIr(t,e,"|")}a(XMi,"IsSeparator");function EUa(t){if(!(G6(t,0)&&CLe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Ore(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Ore(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(SUa,"Or");function TUa(t){function e(o,s){if(!G6(o,s))throw new vLe("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Ore(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(TUa,"And");function Ore(t){return EUa(t)?Ore(vUa(t)):CUa(t)?SUa(t):bUa(t)?TUa(t):{type:"const",const:_Ua(t)}}a(Ore,"TemplateLiteralParse");function IUa(t){return Ore(t.slice(1,t.length-1))}a(IUa,"TemplateLiteralParseExact")});var jIr=I(Eye=>{"use strict";p();Object.defineProperty(Eye,"__esModule",{value:!0});Eye.TemplateLiteralFiniteError=void 0;Eye.IsTemplateLiteralExpressionFinite=d_t;Eye.IsTemplateLiteralFinite=DUa;var xUa=l_t(),wUa=Gf(),u_t=class extends wUa.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};Eye.TemplateLiteralFiniteError=u_t;function RUa(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}a(RUa,"IsNumberExpression");function kUa(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}a(kUa,"IsBooleanExpression");function PUa(t){return t.type==="const"&&t.const===".*"}a(PUa,"IsStringExpression");function d_t(t){return RUa(t)||PUa(t)?!1:kUa(t)?!0:t.type==="and"?t.expr.every(e=>d_t(e)):t.type==="or"?t.expr.every(e=>d_t(e)):t.type==="const"?!0:(()=>{throw new u_t("Unknown expression type")})()}a(d_t,"IsTemplateLiteralExpressionFinite");function DUa(t){let e=(0,xUa.TemplateLiteralParseExact)(t.pattern);return d_t(e)}a(DUa,"IsTemplateLiteralFinite")});var HIr=I(vye=>{"use strict";p();Object.defineProperty(vye,"__esModule",{value:!0});vye.TemplateLiteralGenerateError=void 0;vye.TemplateLiteralExpressionGenerate=p_t;vye.TemplateLiteralGenerate=UUa;var NUa=jIr(),MUa=l_t(),OUa=Gf(),f_t=class extends OUa.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};vye.TemplateLiteralGenerateError=f_t;function*eOi(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of eOi(t.slice(1)))yield`${e}${r}`}a(eOi,"GenerateReduce");function*LUa(t){return yield*eOi(t.expr.map(e=>[...p_t(e)]))}a(LUa,"GenerateAnd");function*BUa(t){for(let e of t.expr)yield*p_t(e)}a(BUa,"GenerateOr");function*FUa(t){return yield t.const}a(FUa,"GenerateConst");function*p_t(t){return t.type==="and"?yield*LUa(t):t.type==="or"?yield*BUa(t):t.type==="const"?yield*FUa(t):(()=>{throw new f_t("Unknown expression")})()}a(p_t,"TemplateLiteralExpressionGenerate");function UUa(t){let e=(0,MUa.TemplateLiteralParseExact)(t.pattern);return(0,NUa.IsTemplateLiteralExpressionFinite)(e)?[...p_t(e)]:[]}a(UUa,"TemplateLiteralGenerate")});var tOi=I(GIr=>{"use strict";p();Object.defineProperty(GIr,"__esModule",{value:!0});GIr.Literal=jUa;var QUa=Pi(),qUa=Tn();function jUa(t,e){return(0,QUa.CreateType)({[qUa.Kind]:"Literal",const:t,type:typeof t},e)}a(jUa,"Literal")});var nE=I(Lre=>{"use strict";p();var HUa=Lre&&Lre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),GUa=Lre&&Lre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&HUa(e,t,r)};Object.defineProperty(Lre,"__esModule",{value:!0});GUa(tOi(),Lre)});var rOi=I($Ir=>{"use strict";p();Object.defineProperty($Ir,"__esModule",{value:!0});$Ir.Boolean=WUa;var $Ua=Tn(),VUa=Q6();function WUa(t){return(0,VUa.CreateType)({[$Ua.Kind]:"Boolean",type:"boolean"},t)}a(WUa,"Boolean")});var bLe=I(Bre=>{"use strict";p();var zUa=Bre&&Bre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YUa=Bre&&Bre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zUa(e,t,r)};Object.defineProperty(Bre,"__esModule",{value:!0});YUa(rOi(),Bre)});var nOi=I(VIr=>{"use strict";p();Object.defineProperty(VIr,"__esModule",{value:!0});VIr.BigInt=ZUa;var KUa=Tn(),JUa=Q6();function ZUa(t){return(0,JUa.CreateType)({[KUa.Kind]:"BigInt",type:"bigint"},t)}a(ZUa,"BigInt")});var Cye=I(Fre=>{"use strict";p();var XUa=Fre&&Fre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),e9a=Fre&&Fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XUa(e,t,r)};Object.defineProperty(Fre,"__esModule",{value:!0});e9a(nOi(),Fre)});var iOi=I(WIr=>{"use strict";p();Object.defineProperty(WIr,"__esModule",{value:!0});WIr.Number=n9a;var t9a=Pi(),r9a=Tn();function n9a(t){return(0,t9a.CreateType)({[r9a.Kind]:"Number",type:"number"},t)}a(n9a,"Number")});var B$=I(Ure=>{"use strict";p();var i9a=Ure&&Ure.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),o9a=Ure&&Ure.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&i9a(e,t,r)};Object.defineProperty(Ure,"__esModule",{value:!0});o9a(iOi(),Ure)});var oOi=I(zIr=>{"use strict";p();Object.defineProperty(zIr,"__esModule",{value:!0});zIr.String=c9a;var s9a=Pi(),a9a=Tn();function c9a(t){return(0,s9a.CreateType)({[a9a.Kind]:"String",type:"string"},t)}a(c9a,"String")});var F$=I(Qre=>{"use strict";p();var l9a=Qre&&Qre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),u9a=Qre&&Qre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&l9a(e,t,r)};Object.defineProperty(Qre,"__esModule",{value:!0});u9a(oOi(),Qre)});var JIr=I(KIr=>{"use strict";p();Object.defineProperty(KIr,"__esModule",{value:!0});KIr.TemplateLiteralSyntax=_9a;var SLe=nE(),d9a=bLe(),f9a=Cye(),p9a=B$(),h9a=F$(),m9a=Op(),g9a=Fm();function*A9a(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,d9a.Boolean)():e==="number"?yield(0,p9a.Number)():e==="bigint"?yield(0,f9a.BigInt)():e==="string"?yield(0,h9a.String)():yield(()=>{let r=e.split("|").map(n=>(0,SLe.Literal)(n.trim()));return r.length===0?(0,g9a.Never)():r.length===1?r[0]:(0,m9a.UnionEvaluated)(r)})()}a(A9a,"FromUnion");function*y9a(t){if(t[1]!=="{"){let e=(0,SLe.Literal)("$"),r=YIr(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(ILe,"__esModule",{value:!0});ILe.TemplateLiteralPatternError=void 0;ILe.TemplateLiteralPattern=b9a;var TLe=_Le(),E9a=Tn(),v9a=Gf(),U$=Is(),h_t=class extends v9a.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};ILe.TemplateLiteralPatternError=h_t;function C9a(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(C9a,"Escape");function sOi(t,e){return(0,U$.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,U$.IsUnion)(t)?`(${t.anyOf.map(r=>sOi(r,e)).join("|")})`:(0,U$.IsNumber)(t)?`${e}${TLe.PatternNumber}`:(0,U$.IsInteger)(t)?`${e}${TLe.PatternNumber}`:(0,U$.IsBigInt)(t)?`${e}${TLe.PatternNumber}`:(0,U$.IsString)(t)?`${e}${TLe.PatternString}`:(0,U$.IsLiteral)(t)?`${e}${C9a(t.const.toString())}`:(0,U$.IsBoolean)(t)?`${e}${TLe.PatternBoolean}`:(()=>{throw new h_t(`Unexpected Kind '${t[E9a.Kind]}'`)})()}a(sOi,"Visit");function b9a(t){return`^${t.map(e=>sOi(e,"")).join("")}$`}a(b9a,"TemplateLiteralPattern")});var aOi=I(XIr=>{"use strict";p();Object.defineProperty(XIr,"__esModule",{value:!0});XIr.TemplateLiteralToUnion=x9a;var S9a=Op(),T9a=nE(),I9a=HIr();function x9a(t){let r=(0,I9a.TemplateLiteralGenerate)(t).map(n=>(0,T9a.Literal)(n));return(0,S9a.UnionEvaluated)(r)}a(x9a,"TemplateLiteralToUnion")});var lOi=I(exr=>{"use strict";p();Object.defineProperty(exr,"__esModule",{value:!0});exr.TemplateLiteral=D9a;var w9a=Pi(),R9a=JIr(),cOi=ZIr(),k9a=Vv(),P9a=Tn();function D9a(t,e){let r=(0,k9a.IsString)(t)?(0,cOi.TemplateLiteralPattern)((0,R9a.TemplateLiteralSyntax)(t)):(0,cOi.TemplateLiteralPattern)(t);return(0,w9a.CreateType)({[P9a.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(D9a,"TemplateLiteral")});var GD=I(SI=>{"use strict";p();var N9a=SI&&SI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qre=SI&&SI.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&N9a(e,t,r)};Object.defineProperty(SI,"__esModule",{value:!0});qre(jIr(),SI);qre(HIr(),SI);qre(JIr(),SI);qre(l_t(),SI);qre(ZIr(),SI);qre(aOi(),SI);qre(lOi(),SI)});var m_t=I(txr=>{"use strict";p();Object.defineProperty(txr,"__esModule",{value:!0});txr.IndexPropertyKeys=uOi;var M9a=GD(),xLe=Is();function O9a(t){return(0,M9a.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(O9a,"FromTemplateLiteral");function L9a(t){let e=[];for(let r of t)e.push(...uOi(r));return e}a(L9a,"FromUnion");function B9a(t){return[t.toString()]}a(B9a,"FromLiteral");function uOi(t){return[...new Set((0,xLe.IsTemplateLiteral)(t)?O9a(t):(0,xLe.IsUnion)(t)?L9a(t.anyOf):(0,xLe.IsLiteral)(t)?B9a(t.const):(0,xLe.IsNumber)(t)?["[number]"]:(0,xLe.IsInteger)(t)?["[number]"]:[])]}a(uOi,"IndexPropertyKeys")});var nxr=I(rxr=>{"use strict";p();Object.defineProperty(rxr,"__esModule",{value:!0});rxr.IndexFromMappedResult=H9a;var F9a=Um(),U9a=m_t(),Q9a=$D();function q9a(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,Q9a.Index)(t,(0,U9a.IndexPropertyKeys)(e[o]),r);return n}a(q9a,"FromProperties");function j9a(t,e,r){return q9a(t,e.properties,r)}a(j9a,"FromMappedResult");function H9a(t,e,r){let n=j9a(t,e,r);return(0,F9a.MappedResult)(n)}a(H9a,"IndexFromMappedResult")});var A_t=I(bye=>{"use strict";p();Object.defineProperty(bye,"__esModule",{value:!0});bye.IndexFromPropertyKey=oxr;bye.IndexFromPropertyKeys=hOi;bye.IndexFromComputed=n7a;bye.Index=i7a;var G9a=Pi(),$9a=Gf(),fOi=O$(),g_t=Fm(),V9a=TI(),ixr=Op(),W9a=m_t(),z9a=sxr(),Y9a=nxr(),vS=Is();function pOi(t,e){return t.map(r=>oxr(r,e))}a(pOi,"FromRest");function K9a(t){return t.filter(e=>!(0,vS.IsNever)(e))}a(K9a,"FromIntersectRest");function J9a(t,e){return(0,V9a.IntersectEvaluated)(K9a(pOi(t,e)))}a(J9a,"FromIntersect");function Z9a(t){return t.some(e=>(0,vS.IsNever)(e))?[]:t}a(Z9a,"FromUnionRest");function X9a(t,e){return(0,ixr.UnionEvaluated)(Z9a(pOi(t,e)))}a(X9a,"FromUnion");function e7a(t,e){return e in t?t[e]:e==="[number]"?(0,ixr.UnionEvaluated)(t):(0,g_t.Never)()}a(e7a,"FromTuple");function t7a(t,e){return e==="[number]"?t:(0,g_t.Never)()}a(t7a,"FromArray");function r7a(t,e){return e in t?t[e]:(0,g_t.Never)()}a(r7a,"FromProperty");function oxr(t,e){return(0,vS.IsIntersect)(t)?J9a(t.allOf,e):(0,vS.IsUnion)(t)?X9a(t.anyOf,e):(0,vS.IsTuple)(t)?e7a(t.items??[],e):(0,vS.IsArray)(t)?t7a(t.items,e):(0,vS.IsObject)(t)?r7a(t.properties,e):(0,g_t.Never)()}a(oxr,"IndexFromPropertyKey");function hOi(t,e){return e.map(r=>oxr(t,r))}a(hOi,"IndexFromPropertyKeys");function dOi(t,e){return(0,ixr.UnionEvaluated)(hOi(t,e))}a(dOi,"FromSchema");function n7a(t,e){return(0,fOi.Computed)("Index",[t,e])}a(n7a,"IndexFromComputed");function i7a(t,e,r){if((0,vS.IsRef)(t)||(0,vS.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,vS.IsSchema)(t)||!(0,vS.IsSchema)(e))throw new $9a.TypeBoxError(n);return(0,fOi.Computed)("Index",[t,e])}return(0,vS.IsMappedResult)(e)?(0,Y9a.IndexFromMappedResult)(t,e,r):(0,vS.IsMappedKey)(e)?(0,z9a.IndexFromMappedKey)(t,e,r):(0,G9a.CreateType)((0,vS.IsSchema)(e)?dOi(t,(0,W9a.IndexPropertyKeys)(e)):dOi(t,e),r)}a(i7a,"Index")});var sxr=I(axr=>{"use strict";p();Object.defineProperty(axr,"__esModule",{value:!0});axr.IndexFromMappedKey=d7a;var o7a=A_t(),s7a=Um(),a7a=yS();function c7a(t,e,r){return{[e]:(0,o7a.Index)(t,[e],(0,a7a.Clone)(r))}}a(c7a,"MappedIndexPropertyKey");function l7a(t,e,r){return e.reduce((n,o)=>({...n,...c7a(t,o,r)}),{})}a(l7a,"MappedIndexPropertyKeys");function u7a(t,e,r){return l7a(t,e.keys,r)}a(u7a,"MappedIndexProperties");function d7a(t,e,r){let n=u7a(t,e,r);return(0,s7a.MappedResult)(n)}a(d7a,"IndexFromMappedKey")});var $D=I(TL=>{"use strict";p();var f7a=TL&&TL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y_t=TL&&TL.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f7a(e,t,r)};Object.defineProperty(TL,"__esModule",{value:!0});y_t(sxr(),TL);y_t(nxr(),TL);y_t(m_t(),TL);y_t(A_t(),TL)});var mOi=I(cxr=>{"use strict";p();Object.defineProperty(cxr,"__esModule",{value:!0});cxr.Iterator=m7a;var p7a=Pi(),h7a=Tn();function m7a(t,e){return(0,p7a.CreateType)({[h7a.Kind]:"Iterator",type:"Iterator",items:t},e)}a(m7a,"Iterator")});var Sye=I(jre=>{"use strict";p();var g7a=jre&&jre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),A7a=jre&&jre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&g7a(e,t,r)};Object.defineProperty(jre,"__esModule",{value:!0});A7a(mOi(),jre)});var AOi=I(__t=>{"use strict";p();Object.defineProperty(__t,"__esModule",{value:!0});__t.Object=void 0;var y7a=Pi(),gOi=Tn(),_7a=Is();function E7a(t){return globalThis.Object.keys(t).filter(e=>!(0,_7a.IsOptional)(t[e]))}a(E7a,"RequiredArray");function v7a(t,e){let r=E7a(t),n=r.length>0?{[gOi.Kind]:"Object",type:"object",required:r,properties:t}:{[gOi.Kind]:"Object",type:"object",properties:t};return(0,y7a.CreateType)(n,e)}a(v7a,"_Object_");__t.Object=v7a});var Wv=I(Hre=>{"use strict";p();var C7a=Hre&&Hre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),b7a=Hre&&Hre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&C7a(e,t,r)};Object.defineProperty(Hre,"__esModule",{value:!0});b7a(AOi(),Hre)});var yOi=I(lxr=>{"use strict";p();Object.defineProperty(lxr,"__esModule",{value:!0});lxr.Promise=I7a;var S7a=Pi(),T7a=Tn();function I7a(t,e){return(0,S7a.CreateType)({[T7a.Kind]:"Promise",type:"Promise",item:t},e)}a(I7a,"Promise")});var wLe=I(Gre=>{"use strict";p();var x7a=Gre&&Gre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),w7a=Gre&&Gre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&x7a(e,t,r)};Object.defineProperty(Gre,"__esModule",{value:!0});w7a(yOi(),Gre)});var dxr=I(uxr=>{"use strict";p();Object.defineProperty(uxr,"__esModule",{value:!0});uxr.Readonly=O7a;var _Oi=Pi(),EOi=Tn(),R7a=j6(),k7a=fxr(),P7a=Is();function D7a(t){return(0,_Oi.CreateType)((0,R7a.Discard)(t,[EOi.ReadonlyKind]))}a(D7a,"RemoveReadonly");function N7a(t){return(0,_Oi.CreateType)({...t,[EOi.ReadonlyKind]:"Readonly"})}a(N7a,"AddReadonly");function M7a(t,e){return e===!1?D7a(t):N7a(t)}a(M7a,"ReadonlyWithFlag");function O7a(t,e){let r=e??!0;return(0,P7a.IsMappedResult)(t)?(0,k7a.ReadonlyFromMappedResult)(t,r):M7a(t,r)}a(O7a,"Readonly")});var fxr=I(pxr=>{"use strict";p();Object.defineProperty(pxr,"__esModule",{value:!0});pxr.ReadonlyFromMappedResult=Q7a;var L7a=Um(),B7a=dxr();function F7a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,B7a.Readonly)(t[n],e);return r}a(F7a,"FromProperties");function U7a(t,e){return F7a(t.properties,e)}a(U7a,"FromMappedResult");function Q7a(t,e){let r=U7a(t,e);return(0,L7a.MappedResult)(r)}a(Q7a,"ReadonlyFromMappedResult")});var q$=I(Q$=>{"use strict";p();var q7a=Q$&&Q$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vOi=Q$&&Q$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&q7a(e,t,r)};Object.defineProperty(Q$,"__esModule",{value:!0});vOi(fxr(),Q$);vOi(dxr(),Q$)});var bOi=I(hxr=>{"use strict";p();Object.defineProperty(hxr,"__esModule",{value:!0});hxr.Tuple=H7a;var j7a=Pi(),COi=Tn();function H7a(t,e){return(0,j7a.CreateType)(t.length>0?{[COi.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[COi.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(H7a,"Tuple")});var $6=I($re=>{"use strict";p();var G7a=$re&&$re.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$7a=$re&&$re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&G7a(e,t,r)};Object.defineProperty($re,"__esModule",{value:!0});$7a(bOi(),$re)});var ROi=I(E_t=>{"use strict";p();Object.defineProperty(E_t,"__esModule",{value:!0});E_t.MappedFunctionReturnType=wOi;E_t.Mapped=dQa;var mxr=Tn(),SOi=j6(),V7a=gye(),W7a=Aye(),z7a=yye(),Y7a=L$(),K7a=$D(),J7a=TI(),Z7a=Sye(),TOi=nE(),IOi=Wv(),X7a=SL(),eQa=wLe(),tQa=q$(),rQa=$6(),nQa=Op(),iQa=ELe(),oQa=NIr(),zv=Is();function xOi(t,e){return t in e?rk(t,e[t]):(0,oQa.MappedResult)(e)}a(xOi,"FromMappedResult");function sQa(t){return{[t]:(0,TOi.Literal)(t)}}a(sQa,"MappedKeyToKnownMappedResultProperties");function aQa(t){let e={};for(let r of t)e[r]=(0,TOi.Literal)(r);return e}a(aQa,"MappedKeyToUnknownMappedResultProperties");function cQa(t,e){return(0,iQa.SetIncludes)(e,t)?sQa(t):aQa(e)}a(cQa,"MappedKeyToMappedResultProperties");function lQa(t,e){let r=cQa(t,e);return xOi(t,r)}a(lQa,"FromMappedKey");function RLe(t,e){return e.map(r=>rk(t,r))}a(RLe,"FromRest");function uQa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=rk(t,e[n]);return r}a(uQa,"FromProperties");function rk(t,e){let r={...e};return(0,zv.IsOptional)(e)?(0,X7a.Optional)(rk(t,(0,SOi.Discard)(e,[mxr.OptionalKind]))):(0,zv.IsReadonly)(e)?(0,tQa.Readonly)(rk(t,(0,SOi.Discard)(e,[mxr.ReadonlyKind]))):(0,zv.IsMappedResult)(e)?xOi(t,e.properties):(0,zv.IsMappedKey)(e)?lQa(t,e.keys):(0,zv.IsConstructor)(e)?(0,z7a.Constructor)(RLe(t,e.parameters),rk(t,e.returns),r):(0,zv.IsFunction)(e)?(0,Y7a.Function)(RLe(t,e.parameters),rk(t,e.returns),r):(0,zv.IsAsyncIterator)(e)?(0,W7a.AsyncIterator)(rk(t,e.items),r):(0,zv.IsIterator)(e)?(0,Z7a.Iterator)(rk(t,e.items),r):(0,zv.IsIntersect)(e)?(0,J7a.Intersect)(RLe(t,e.allOf),r):(0,zv.IsUnion)(e)?(0,nQa.Union)(RLe(t,e.anyOf),r):(0,zv.IsTuple)(e)?(0,rQa.Tuple)(RLe(t,e.items??[]),r):(0,zv.IsObject)(e)?(0,IOi.Object)(uQa(t,e.properties),r):(0,zv.IsArray)(e)?(0,V7a.Array)(rk(t,e.items),r):(0,zv.IsPromise)(e)?(0,eQa.Promise)(rk(t,e.item),r):e}a(rk,"FromSchemaType");function wOi(t,e){let r={};for(let n of t)r[n]=rk(n,e);return r}a(wOi,"MappedFunctionReturnType");function dQa(t,e,r){let n=(0,zv.IsSchema)(t)?(0,K7a.IndexPropertyKeys)(t):t,o=e({[mxr.Kind]:"MappedKey",keys:n}),s=wOi(n,o);return(0,IOi.Object)(s,r)}a(dQa,"Mapped")});var Um=I(V6=>{"use strict";p();var fQa=V6&&V6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gxr=V6&&V6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fQa(e,t,r)};Object.defineProperty(V6,"__esModule",{value:!0});gxr(HMi(),V6);gxr(NIr(),V6);gxr(ROi(),V6)});var yxr=I(Axr=>{"use strict";p();Object.defineProperty(Axr,"__esModule",{value:!0});Axr.Optional=_Qa;var kOi=Pi(),POi=Tn(),pQa=j6(),hQa=_xr(),mQa=Is();function gQa(t){return(0,kOi.CreateType)((0,pQa.Discard)(t,[POi.OptionalKind]))}a(gQa,"RemoveOptional");function AQa(t){return(0,kOi.CreateType)({...t,[POi.OptionalKind]:"Optional"})}a(AQa,"AddOptional");function yQa(t,e){return e===!1?gQa(t):AQa(t)}a(yQa,"OptionalWithFlag");function _Qa(t,e){let r=e??!0;return(0,mQa.IsMappedResult)(t)?(0,hQa.OptionalFromMappedResult)(t,r):yQa(t,r)}a(_Qa,"Optional")});var _xr=I(Exr=>{"use strict";p();Object.defineProperty(Exr,"__esModule",{value:!0});Exr.OptionalFromMappedResult=SQa;var EQa=Um(),vQa=yxr();function CQa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,vQa.Optional)(t[n],e);return r}a(CQa,"FromProperties");function bQa(t,e){return CQa(t.properties,e)}a(bQa,"FromMappedResult");function SQa(t,e){let r=bQa(t,e);return(0,EQa.MappedResult)(r)}a(SQa,"OptionalFromMappedResult")});var SL=I(j$=>{"use strict";p();var TQa=j$&&j$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DOi=j$&&j$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TQa(e,t,r)};Object.defineProperty(j$,"__esModule",{value:!0});DOi(_xr(),j$);DOi(yxr(),j$)});var bxr=I(Cxr=>{"use strict";p();Object.defineProperty(Cxr,"__esModule",{value:!0});Cxr.IntersectCreate=xQa;var IQa=Pi(),NOi=Tn(),vxr=Is();function xQa(t,e={}){let r=t.every(o=>(0,vxr.IsObject)(o)),n=(0,vxr.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,IQa.CreateType)(e.unevaluatedProperties===!1||(0,vxr.IsSchema)(e.unevaluatedProperties)||r?{...n,[NOi.Kind]:"Intersect",type:"object",allOf:t}:{...n,[NOi.Kind]:"Intersect",allOf:t},e)}a(xQa,"IntersectCreate")});var LOi=I(Txr=>{"use strict";p();Object.defineProperty(Txr,"__esModule",{value:!0});Txr.IntersectEvaluated=LQa;var wQa=Tn(),RQa=Pi(),kQa=j6(),PQa=Fm(),DQa=SL(),MOi=bxr(),Sxr=Is();function NQa(t){return t.every(e=>(0,Sxr.IsOptional)(e))}a(NQa,"IsIntersectOptional");function MQa(t){return(0,kQa.Discard)(t,[wQa.OptionalKind])}a(MQa,"RemoveOptionalFromType");function OOi(t){return t.map(e=>(0,Sxr.IsOptional)(e)?MQa(e):e)}a(OOi,"RemoveOptionalFromRest");function OQa(t,e){return NQa(t)?(0,DQa.Optional)((0,MOi.IntersectCreate)(OOi(t),e)):(0,MOi.IntersectCreate)(OOi(t),e)}a(OQa,"ResolveIntersect");function LQa(t,e={}){if(t.length===1)return(0,RQa.CreateType)(t[0],e);if(t.length===0)return(0,PQa.Never)(e);if(t.some(r=>(0,Sxr.IsTransform)(r)))throw new Error("Cannot intersect transform types");return OQa(t,e)}a(LQa,"IntersectEvaluated")});var FOi=I(BOi=>{"use strict";p();Object.defineProperty(BOi,"__esModule",{value:!0});var A3p=Tn()});var UOi=I(Ixr=>{"use strict";p();Object.defineProperty(Ixr,"__esModule",{value:!0});Ixr.Intersect=qQa;var BQa=Pi(),FQa=Fm(),UQa=bxr(),QQa=Is();function qQa(t,e){if(t.length===1)return(0,BQa.CreateType)(t[0],e);if(t.length===0)return(0,FQa.Never)(e);if(t.some(r=>(0,QQa.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,UQa.IntersectCreate)(t,e)}a(qQa,"Intersect")});var TI=I(W6=>{"use strict";p();var jQa=W6&&W6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xxr=W6&&W6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jQa(e,t,r)};Object.defineProperty(W6,"__esModule",{value:!0});xxr(LOi(),W6);xxr(FOi(),W6);xxr(UOi(),W6)});var QOi=I(wxr=>{"use strict";p();Object.defineProperty(wxr,"__esModule",{value:!0});wxr.Ref=VQa;var HQa=Gf(),GQa=Pi(),$Qa=Tn();function VQa(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new HQa.TypeBoxError("Ref: $ref must be a string");return(0,GQa.CreateType)({[$Qa.Kind]:"Ref",$ref:e},r)}a(VQa,"Ref")});var H$=I(Vre=>{"use strict";p();var WQa=Vre&&Vre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zQa=Vre&&Vre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WQa(e,t,r)};Object.defineProperty(Vre,"__esModule",{value:!0});zQa(QOi(),Vre)});var jOi=I(Pxr=>{"use strict";p();Object.defineProperty(Pxr,"__esModule",{value:!0});Pxr.Awaited=kxr;var YQa=Pi(),Rxr=O$(),KQa=TI(),JQa=Op(),ZQa=H$(),kLe=Is();function XQa(t,e){return(0,Rxr.Computed)("Awaited",[(0,Rxr.Computed)(t,e)])}a(XQa,"FromComputed");function eqa(t){return(0,Rxr.Computed)("Awaited",[(0,ZQa.Ref)(t)])}a(eqa,"FromRef");function tqa(t){return(0,KQa.Intersect)(qOi(t))}a(tqa,"FromIntersect");function rqa(t){return(0,JQa.Union)(qOi(t))}a(rqa,"FromUnion");function nqa(t){return kxr(t)}a(nqa,"FromPromise");function qOi(t){return t.map(e=>kxr(e))}a(qOi,"FromRest");function kxr(t,e){return(0,YQa.CreateType)((0,kLe.IsComputed)(t)?XQa(t.target,t.parameters):(0,kLe.IsIntersect)(t)?tqa(t.allOf):(0,kLe.IsUnion)(t)?rqa(t.anyOf):(0,kLe.IsPromise)(t)?nqa(t.item):(0,kLe.IsRef)(t)?eqa(t.$ref):t,e)}a(kxr,"Awaited")});var PLe=I(Wre=>{"use strict";p();var iqa=Wre&&Wre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oqa=Wre&&Wre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iqa(e,t,r)};Object.defineProperty(Wre,"__esModule",{value:!0});oqa(jOi(),Wre)});var C_t=I(v_t=>{"use strict";p();Object.defineProperty(v_t,"__esModule",{value:!0});v_t.KeyOfPropertyKeys=Nxr;v_t.KeyOfPattern=fqa;var HOi=ELe(),Tye=Is();function GOi(t){let e=[];for(let r of t)e.push(Nxr(r));return e}a(GOi,"FromRest");function sqa(t){let e=GOi(t);return(0,HOi.SetUnionMany)(e)}a(sqa,"FromIntersect");function aqa(t){let e=GOi(t);return(0,HOi.SetIntersectMany)(e)}a(aqa,"FromUnion");function cqa(t){return t.map((e,r)=>r.toString())}a(cqa,"FromTuple");function lqa(t){return["[number]"]}a(lqa,"FromArray");function uqa(t){return globalThis.Object.getOwnPropertyNames(t)}a(uqa,"FromProperties");function dqa(t){return Dxr?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(dqa,"FromPatternProperties");function Nxr(t){return(0,Tye.IsIntersect)(t)?sqa(t.allOf):(0,Tye.IsUnion)(t)?aqa(t.anyOf):(0,Tye.IsTuple)(t)?cqa(t.items??[]):(0,Tye.IsArray)(t)?lqa(t.items):(0,Tye.IsObject)(t)?uqa(t.properties):(0,Tye.IsRecord)(t)?dqa(t.patternProperties):[]}a(Nxr,"KeyOfPropertyKeys");var Dxr=!1;function fqa(t){Dxr=!0;let e=Nxr(t);return Dxr=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(fqa,"KeyOfPattern")});var Lxr=I(b_t=>{"use strict";p();Object.defineProperty(b_t,"__esModule",{value:!0});b_t.KeyOfPropertyKeysToRest=$Oi;b_t.KeyOf=bqa;var pqa=Pi(),hqa=nE(),mqa=B$(),Oxr=O$(),gqa=H$(),Aqa=C_t(),yqa=Op(),_qa=Bxr(),Mxr=Is();function Eqa(t,e){return(0,Oxr.Computed)("KeyOf",[(0,Oxr.Computed)(t,e)])}a(Eqa,"FromComputed");function vqa(t){return(0,Oxr.Computed)("KeyOf",[(0,gqa.Ref)(t)])}a(vqa,"FromRef");function Cqa(t,e){let r=(0,Aqa.KeyOfPropertyKeys)(t),n=$Oi(r),o=(0,yqa.UnionEvaluated)(n);return(0,pqa.CreateType)(o,e)}a(Cqa,"KeyOfFromType");function $Oi(t){return t.map(e=>e==="[number]"?(0,mqa.Number)():(0,hqa.Literal)(e))}a($Oi,"KeyOfPropertyKeysToRest");function bqa(t,e){return(0,Mxr.IsComputed)(t)?Eqa(t.target,t.parameters):(0,Mxr.IsRef)(t)?vqa(t.$ref):(0,Mxr.IsMappedResult)(t)?(0,_qa.KeyOfFromMappedResult)(t,e):Cqa(t,e)}a(bqa,"KeyOf")});var Bxr=I(Fxr=>{"use strict";p();Object.defineProperty(Fxr,"__esModule",{value:!0});Fxr.KeyOfFromMappedResult=Rqa;var Sqa=Um(),Tqa=Lxr(),Iqa=yS();function xqa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,Tqa.KeyOf)(t[n],(0,Iqa.Clone)(e));return r}a(xqa,"FromProperties");function wqa(t,e){return xqa(t.properties,e)}a(wqa,"FromMappedResult");function Rqa(t,e){let r=wqa(t,e);return(0,Sqa.MappedResult)(r)}a(Rqa,"KeyOfFromMappedResult")});var VOi=I(Uxr=>{"use strict";p();Object.defineProperty(Uxr,"__esModule",{value:!0});Uxr.KeyOfPropertyEntries=Dqa;var kqa=A_t(),Pqa=C_t();function Dqa(t){let e=(0,Pqa.KeyOfPropertyKeys)(t),r=(0,kqa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(Dqa,"KeyOfPropertyEntries")});var VD=I(IL=>{"use strict";p();var Nqa=IL&&IL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),S_t=IL&&IL.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Nqa(e,t,r)};Object.defineProperty(IL,"__esModule",{value:!0});S_t(Bxr(),IL);S_t(VOi(),IL);S_t(C_t(),IL);S_t(Lxr(),IL)});var WOi=I(Qxr=>{"use strict";p();Object.defineProperty(Qxr,"__esModule",{value:!0});Qxr.Composite=Gqa;var Mqa=TI(),Oqa=$D(),Lqa=VD(),Bqa=Wv(),Fqa=ELe(),Uqa=Is();function Qqa(t){let e=[];for(let r of t)e.push(...(0,Lqa.KeyOfPropertyKeys)(r));return(0,Fqa.SetDistinct)(e)}a(Qqa,"CompositeKeys");function qqa(t){return t.filter(e=>!(0,Uqa.IsNever)(e))}a(qqa,"FilterNever");function jqa(t,e){let r=[];for(let n of t)r.push(...(0,Oqa.IndexFromPropertyKeys)(n,[e]));return qqa(r)}a(jqa,"CompositeProperty");function Hqa(t,e){let r={};for(let n of e)r[n]=(0,Mqa.IntersectEvaluated)(jqa(t,n));return r}a(Hqa,"CompositeProperties");function Gqa(t,e){let r=Qqa(t),n=Hqa(t,r);return(0,Bqa.Object)(n,e)}a(Gqa,"Composite")});var T_t=I(zre=>{"use strict";p();var $qa=zre&&zre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vqa=zre&&zre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$qa(e,t,r)};Object.defineProperty(zre,"__esModule",{value:!0});Vqa(WOi(),zre)});var zOi=I(qxr=>{"use strict";p();Object.defineProperty(qxr,"__esModule",{value:!0});qxr.Date=Yqa;var Wqa=Tn(),zqa=Pi();function Yqa(t){return(0,zqa.CreateType)({[Wqa.Kind]:"Date",type:"Date"},t)}a(Yqa,"Date")});var DLe=I(Yre=>{"use strict";p();var Kqa=Yre&&Yre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Jqa=Yre&&Yre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Kqa(e,t,r)};Object.defineProperty(Yre,"__esModule",{value:!0});Jqa(zOi(),Yre)});var YOi=I(jxr=>{"use strict";p();Object.defineProperty(jxr,"__esModule",{value:!0});jxr.Null=eja;var Zqa=Pi(),Xqa=Tn();function eja(t){return(0,Zqa.CreateType)({[Xqa.Kind]:"Null",type:"null"},t)}a(eja,"Null")});var NLe=I(Kre=>{"use strict";p();var tja=Kre&&Kre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rja=Kre&&Kre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tja(e,t,r)};Object.defineProperty(Kre,"__esModule",{value:!0});rja(YOi(),Kre)});var KOi=I(Hxr=>{"use strict";p();Object.defineProperty(Hxr,"__esModule",{value:!0});Hxr.Symbol=oja;var nja=Pi(),ija=Tn();function oja(t){return(0,nja.CreateType)({[ija.Kind]:"Symbol",type:"symbol"},t)}a(oja,"Symbol")});var MLe=I(Jre=>{"use strict";p();var sja=Jre&&Jre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aja=Jre&&Jre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sja(e,t,r)};Object.defineProperty(Jre,"__esModule",{value:!0});aja(KOi(),Jre)});var JOi=I(Gxr=>{"use strict";p();Object.defineProperty(Gxr,"__esModule",{value:!0});Gxr.Undefined=uja;var cja=Pi(),lja=Tn();function uja(t){return(0,cja.CreateType)({[lja.Kind]:"Undefined",type:"undefined"},t)}a(uja,"Undefined")});var OLe=I(Zre=>{"use strict";p();var dja=Zre&&Zre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fja=Zre&&Zre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dja(e,t,r)};Object.defineProperty(Zre,"__esModule",{value:!0});fja(JOi(),Zre)});var ZOi=I($xr=>{"use strict";p();Object.defineProperty($xr,"__esModule",{value:!0});$xr.Uint8Array=mja;var pja=Pi(),hja=Tn();function mja(t){return(0,pja.CreateType)({[hja.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(mja,"Uint8Array")});var LLe=I(Xre=>{"use strict";p();var gja=Xre&&Xre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Aja=Xre&&Xre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gja(e,t,r)};Object.defineProperty(Xre,"__esModule",{value:!0});Aja(ZOi(),Xre)});var XOi=I(Vxr=>{"use strict";p();Object.defineProperty(Vxr,"__esModule",{value:!0});Vxr.Unknown=Eja;var yja=Pi(),_ja=Tn();function Eja(t){return(0,yja.CreateType)({[_ja.Kind]:"Unknown"},t)}a(Eja,"Unknown")});var G$=I(ene=>{"use strict";p();var vja=ene&&ene.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Cja=ene&&ene.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vja(e,t,r)};Object.defineProperty(ene,"__esModule",{value:!0});Cja(XOi(),ene)});var r5i=I(Kxr=>{"use strict";p();Object.defineProperty(Kxr,"__esModule",{value:!0});Kxr.Const=Oja;var e5i=mye(),bja=Cye(),Sja=DLe(),Tja=L$(),Wxr=nE(),Ija=NLe(),t5i=Wv(),xja=MLe(),wja=$6(),zxr=q$(),Rja=OLe(),kja=LLe(),Pja=G$(),Dja=Q6(),CS=Vv();function Nja(t){return t.map(e=>Yxr(e,!1))}a(Nja,"FromArray");function Mja(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,zxr.Readonly)(Yxr(t[r],!1));return e}a(Mja,"FromProperties");function I_t(t,e){return e===!0?t:(0,zxr.Readonly)(t)}a(I_t,"ConditionalReadonly");function Yxr(t,e){return(0,CS.IsAsyncIterator)(t)||(0,CS.IsIterator)(t)?I_t((0,e5i.Any)(),e):(0,CS.IsArray)(t)?(0,zxr.Readonly)((0,wja.Tuple)(Nja(t))):(0,CS.IsUint8Array)(t)?(0,kja.Uint8Array)():(0,CS.IsDate)(t)?(0,Sja.Date)():(0,CS.IsObject)(t)?I_t((0,t5i.Object)(Mja(t)),e):(0,CS.IsFunction)(t)?I_t((0,Tja.Function)([],(0,Pja.Unknown)()),e):(0,CS.IsUndefined)(t)?(0,Rja.Undefined)():(0,CS.IsNull)(t)?(0,Ija.Null)():(0,CS.IsSymbol)(t)?(0,xja.Symbol)():(0,CS.IsBigInt)(t)?(0,bja.BigInt)():(0,CS.IsNumber)(t)||(0,CS.IsBoolean)(t)||(0,CS.IsString)(t)?(0,Wxr.Literal)(t):(0,t5i.Object)({})}a(Yxr,"FromValue");function Oja(t,e){return(0,Dja.CreateType)(Yxr(t,!0),e)}a(Oja,"Const")});var x_t=I(tne=>{"use strict";p();var Lja=tne&&tne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bja=tne&&tne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lja(e,t,r)};Object.defineProperty(tne,"__esModule",{value:!0});Bja(r5i(),tne)});var n5i=I(z6=>{"use strict";p();var Fja=z6&&z6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Uja=z6&&z6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Qja=z6&&z6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var $ja=rne&&rne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vja=rne&&rne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$ja(e,t,r)};Object.defineProperty(rne,"__esModule",{value:!0});Vja(n5i(),rne)});var i5i=I(Jxr=>{"use strict";p();Object.defineProperty(Jxr,"__esModule",{value:!0});Jxr.Enum=Jja;var Wja=nE(),zja=Tn(),Yja=Op(),Kja=Vv();function Jja(t,e){if((0,Kja.IsUndefined)(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>(0,Wja.Literal)(s));return(0,Yja.Union)(o,{...e,[zja.Hint]:"Enum"})}a(Jja,"Enum")});var R_t=I(nne=>{"use strict";p();var Zja=nne&&nne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xja=nne&&nne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zja(e,t,r)};Object.defineProperty(nne,"__esModule",{value:!0});Xja(i5i(),nne)});var owr=I(ine=>{"use strict";p();Object.defineProperty(ine,"__esModule",{value:!0});ine.ExtendsResult=ine.ExtendsResolverError=void 0;ine.ExtendsCheck=jHa;var o5i=mye(),eHa=L$(),rwr=B$(),Xxr=F$(),tHa=G$(),s5i=GD(),Iye=_Le(),d5i=Tn(),rHa=Gf(),rt=CIr(),k_t=class extends rHa.TypeBoxError{static{a(this,"ExtendsResolverError")}};ine.ExtendsResolverError=k_t;var Bt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Bt||(ine.ExtendsResult=Bt={}));function nk(t){return t===Bt.False?t:Bt.True}a(nk,"IntoBooleanResult");function xye(t){throw new k_t(t)}a(xye,"Throw");function Qm(t){return rt.TypeGuard.IsNever(t)||rt.TypeGuard.IsIntersect(t)||rt.TypeGuard.IsUnion(t)||rt.TypeGuard.IsUnknown(t)||rt.TypeGuard.IsAny(t)}a(Qm,"IsStructuralRight");function qm(t,e){return rt.TypeGuard.IsNever(e)?h5i(t,e):rt.TypeGuard.IsIntersect(e)?P_t(t,e):rt.TypeGuard.IsUnion(e)?iwr(t,e):rt.TypeGuard.IsUnknown(e)?y5i(t,e):rt.TypeGuard.IsAny(e)?nwr(t,e):xye("StructuralRight")}a(qm,"StructuralRight");function nwr(t,e){return Bt.True}a(nwr,"FromAnyRight");function nHa(t,e){return rt.TypeGuard.IsIntersect(e)?P_t(t,e):rt.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>rt.TypeGuard.IsAny(r)||rt.TypeGuard.IsUnknown(r))?Bt.True:rt.TypeGuard.IsUnion(e)?Bt.Union:rt.TypeGuard.IsUnknown(e)||rt.TypeGuard.IsAny(e)?Bt.True:Bt.Union}a(nHa,"FromAny");function iHa(t,e){return rt.TypeGuard.IsUnknown(t)?Bt.False:rt.TypeGuard.IsAny(t)?Bt.Union:rt.TypeGuard.IsNever(t)?Bt.True:Bt.False}a(iHa,"FromArrayRight");function oHa(t,e){return rt.TypeGuard.IsObject(e)&&D_t(e)?Bt.True:Qm(e)?qm(t,e):rt.TypeGuard.IsArray(e)?nk(Il(t.items,e.items)):Bt.False}a(oHa,"FromArray");function sHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsAsyncIterator(e)?nk(Il(t.items,e.items)):Bt.False}a(sHa,"FromAsyncIterator");function aHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsBigInt(e)?Bt.True:Bt.False}a(aHa,"FromBigInt");function f5i(t,e){return rt.TypeGuard.IsLiteralBoolean(t)||rt.TypeGuard.IsBoolean(t)?Bt.True:Bt.False}a(f5i,"FromBooleanRight");function cHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsBoolean(e)?Bt.True:Bt.False}a(cHa,"FromBoolean");function lHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Bt.False:t.parameters.every((r,n)=>nk(Il(e.parameters[n],r))===Bt.True)?nk(Il(t.returns,e.returns)):Bt.False:Bt.False}a(lHa,"FromConstructor");function uHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsDate(e)?Bt.True:Bt.False}a(uHa,"FromDate");function dHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Bt.False:t.parameters.every((r,n)=>nk(Il(e.parameters[n],r))===Bt.True)?nk(Il(t.returns,e.returns)):Bt.False:Bt.False}a(dHa,"FromFunction");function p5i(t,e){return rt.TypeGuard.IsLiteral(t)&&rt.ValueGuard.IsNumber(t.const)||rt.TypeGuard.IsNumber(t)||rt.TypeGuard.IsInteger(t)?Bt.True:Bt.False}a(p5i,"FromIntegerRight");function fHa(t,e){return rt.TypeGuard.IsInteger(e)||rt.TypeGuard.IsNumber(e)?Bt.True:Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):Bt.False}a(fHa,"FromInteger");function P_t(t,e){return e.allOf.every(r=>Il(t,r)===Bt.True)?Bt.True:Bt.False}a(P_t,"FromIntersectRight");function pHa(t,e){return t.allOf.some(r=>Il(r,e)===Bt.True)?Bt.True:Bt.False}a(pHa,"FromIntersect");function hHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsIterator(e)?nk(Il(t.items,e.items)):Bt.False}a(hHa,"FromIterator");function mHa(t,e){return rt.TypeGuard.IsLiteral(e)&&e.const===t.const?Bt.True:Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsString(e)?A5i(t,e):rt.TypeGuard.IsNumber(e)?m5i(t,e):rt.TypeGuard.IsInteger(e)?p5i(t,e):rt.TypeGuard.IsBoolean(e)?f5i(t,e):Bt.False}a(mHa,"FromLiteral");function h5i(t,e){return Bt.False}a(h5i,"FromNeverRight");function gHa(t,e){return Bt.True}a(gHa,"FromNever");function a5i(t){let[e,r]=[t,0];for(;rt.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,tHa.Unknown)()}a(a5i,"UnwrapTNot");function AHa(t,e){return rt.TypeGuard.IsNot(t)?Il(a5i(t),e):rt.TypeGuard.IsNot(e)?Il(t,a5i(e)):xye("Invalid fallthrough for Not")}a(AHa,"FromNot");function yHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsNull(e)?Bt.True:Bt.False}a(yHa,"FromNull");function m5i(t,e){return rt.TypeGuard.IsLiteralNumber(t)||rt.TypeGuard.IsNumber(t)||rt.TypeGuard.IsInteger(t)?Bt.True:Bt.False}a(m5i,"FromNumberRight");function _Ha(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsInteger(e)||rt.TypeGuard.IsNumber(e)?Bt.True:Bt.False}a(_Ha,"FromNumber");function bS(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(bS,"IsObjectPropertyCount");function c5i(t){return D_t(t)}a(c5i,"IsObjectStringLike");function l5i(t){return bS(t,0)||bS(t,1)&&"description"in t.properties&&rt.TypeGuard.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(rt.TypeGuard.IsString(t.properties.description.anyOf[0])&&rt.TypeGuard.IsUndefined(t.properties.description.anyOf[1])||rt.TypeGuard.IsString(t.properties.description.anyOf[1])&&rt.TypeGuard.IsUndefined(t.properties.description.anyOf[0]))}a(l5i,"IsObjectSymbolLike");function Zxr(t){return bS(t,0)}a(Zxr,"IsObjectNumberLike");function u5i(t){return bS(t,0)}a(u5i,"IsObjectBooleanLike");function EHa(t){return bS(t,0)}a(EHa,"IsObjectBigIntLike");function vHa(t){return bS(t,0)}a(vHa,"IsObjectDateLike");function CHa(t){return D_t(t)}a(CHa,"IsObjectUint8ArrayLike");function bHa(t){let e=(0,rwr.Number)();return bS(t,0)||bS(t,1)&&"length"in t.properties&&nk(Il(t.properties.length,e))===Bt.True}a(bHa,"IsObjectFunctionLike");function SHa(t){return bS(t,0)}a(SHa,"IsObjectConstructorLike");function D_t(t){let e=(0,rwr.Number)();return bS(t,0)||bS(t,1)&&"length"in t.properties&&nk(Il(t.properties.length,e))===Bt.True}a(D_t,"IsObjectArrayLike");function THa(t){let e=(0,eHa.Function)([(0,o5i.Any)()],(0,o5i.Any)());return bS(t,0)||bS(t,1)&&"then"in t.properties&&nk(Il(t.properties.then,e))===Bt.True}a(THa,"IsObjectPromiseLike");function g5i(t,e){return Il(t,e)===Bt.False||rt.TypeGuard.IsOptional(t)&&!rt.TypeGuard.IsOptional(e)?Bt.False:Bt.True}a(g5i,"Property");function iE(t,e){return rt.TypeGuard.IsUnknown(t)?Bt.False:rt.TypeGuard.IsAny(t)?Bt.Union:rt.TypeGuard.IsNever(t)||rt.TypeGuard.IsLiteralString(t)&&c5i(e)||rt.TypeGuard.IsLiteralNumber(t)&&Zxr(e)||rt.TypeGuard.IsLiteralBoolean(t)&&u5i(e)||rt.TypeGuard.IsSymbol(t)&&l5i(e)||rt.TypeGuard.IsBigInt(t)&&EHa(e)||rt.TypeGuard.IsString(t)&&c5i(e)||rt.TypeGuard.IsSymbol(t)&&l5i(e)||rt.TypeGuard.IsNumber(t)&&Zxr(e)||rt.TypeGuard.IsInteger(t)&&Zxr(e)||rt.TypeGuard.IsBoolean(t)&&u5i(e)||rt.TypeGuard.IsUint8Array(t)&&CHa(e)||rt.TypeGuard.IsDate(t)&&vHa(e)||rt.TypeGuard.IsConstructor(t)&&SHa(e)||rt.TypeGuard.IsFunction(t)&&bHa(e)?Bt.True:rt.TypeGuard.IsRecord(t)&&rt.TypeGuard.IsString(ewr(t))?e[d5i.Hint]==="Record"?Bt.True:Bt.False:rt.TypeGuard.IsRecord(t)&&rt.TypeGuard.IsNumber(ewr(t))&&bS(e,0)?Bt.True:Bt.False}a(iE,"FromObjectRight");function IHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!rt.TypeGuard.IsOptional(e.properties[r]))return Bt.False;if(rt.TypeGuard.IsOptional(e.properties[r]))return Bt.True;if(g5i(t.properties[r],e.properties[r])===Bt.False)return Bt.False}return Bt.True})():Bt.False}a(IHa,"FromObject");function xHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)&&THa(e)?Bt.True:rt.TypeGuard.IsPromise(e)?nk(Il(t.item,e.item)):Bt.False}a(xHa,"FromPromise");function ewr(t){return Iye.PatternNumberExact in t.patternProperties?(0,rwr.Number)():Iye.PatternStringExact in t.patternProperties?(0,Xxr.String)():xye("Unknown record key pattern")}a(ewr,"RecordKey");function twr(t){return Iye.PatternNumberExact in t.patternProperties?t.patternProperties[Iye.PatternNumberExact]:Iye.PatternStringExact in t.patternProperties?t.patternProperties[Iye.PatternStringExact]:xye("Unable to get record value schema")}a(twr,"RecordValue");function ik(t,e){let[r,n]=[ewr(e),twr(e)];return rt.TypeGuard.IsLiteralString(t)&&rt.TypeGuard.IsNumber(r)&&nk(Il(t,n))===Bt.True?Bt.True:rt.TypeGuard.IsUint8Array(t)&&rt.TypeGuard.IsNumber(r)||rt.TypeGuard.IsString(t)&&rt.TypeGuard.IsNumber(r)||rt.TypeGuard.IsArray(t)&&rt.TypeGuard.IsNumber(r)?Il(t,n):rt.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(g5i(n,t.properties[o])===Bt.False)return Bt.False;return Bt.True})():Bt.False}a(ik,"FromRecordRight");function wHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?Il(twr(t),twr(e)):Bt.False}a(wHa,"FromRecord");function RHa(t,e){let r=rt.TypeGuard.IsRegExp(t)?(0,Xxr.String)():t,n=rt.TypeGuard.IsRegExp(e)?(0,Xxr.String)():e;return Il(r,n)}a(RHa,"FromRegExp");function A5i(t,e){return rt.TypeGuard.IsLiteral(t)&&rt.ValueGuard.IsString(t.const)||rt.TypeGuard.IsString(t)?Bt.True:Bt.False}a(A5i,"FromStringRight");function kHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsString(e)?Bt.True:Bt.False}a(kHa,"FromString");function PHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsSymbol(e)?Bt.True:Bt.False}a(PHa,"FromSymbol");function DHa(t,e){return rt.TypeGuard.IsTemplateLiteral(t)?Il((0,s5i.TemplateLiteralToUnion)(t),e):rt.TypeGuard.IsTemplateLiteral(e)?Il(t,(0,s5i.TemplateLiteralToUnion)(e)):xye("Invalid fallthrough for TemplateLiteral")}a(DHa,"FromTemplateLiteral");function NHa(t,e){return rt.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Il(r,e.items)===Bt.True)}a(NHa,"IsArrayOfTuple");function MHa(t,e){return rt.TypeGuard.IsNever(t)?Bt.True:rt.TypeGuard.IsUnknown(t)?Bt.False:rt.TypeGuard.IsAny(t)?Bt.Union:Bt.False}a(MHa,"FromTupleRight");function OHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)&&D_t(e)||rt.TypeGuard.IsArray(e)&&NHa(t,e)?Bt.True:rt.TypeGuard.IsTuple(e)?rt.ValueGuard.IsUndefined(t.items)&&!rt.ValueGuard.IsUndefined(e.items)||!rt.ValueGuard.IsUndefined(t.items)&&rt.ValueGuard.IsUndefined(e.items)?Bt.False:rt.ValueGuard.IsUndefined(t.items)&&!rt.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>Il(r,e.items[n])===Bt.True)?Bt.True:Bt.False:Bt.False}a(OHa,"FromTuple");function LHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsUint8Array(e)?Bt.True:Bt.False}a(LHa,"FromUint8Array");function BHa(t,e){return Qm(e)?qm(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsRecord(e)?ik(t,e):rt.TypeGuard.IsVoid(e)?QHa(t,e):rt.TypeGuard.IsUndefined(e)?Bt.True:Bt.False}a(BHa,"FromUndefined");function iwr(t,e){return e.anyOf.some(r=>Il(t,r)===Bt.True)?Bt.True:Bt.False}a(iwr,"FromUnionRight");function FHa(t,e){return t.anyOf.every(r=>Il(r,e)===Bt.True)?Bt.True:Bt.False}a(FHa,"FromUnion");function y5i(t,e){return Bt.True}a(y5i,"FromUnknownRight");function UHa(t,e){return rt.TypeGuard.IsNever(e)?h5i(t,e):rt.TypeGuard.IsIntersect(e)?P_t(t,e):rt.TypeGuard.IsUnion(e)?iwr(t,e):rt.TypeGuard.IsAny(e)?nwr(t,e):rt.TypeGuard.IsString(e)?A5i(t,e):rt.TypeGuard.IsNumber(e)?m5i(t,e):rt.TypeGuard.IsInteger(e)?p5i(t,e):rt.TypeGuard.IsBoolean(e)?f5i(t,e):rt.TypeGuard.IsArray(e)?iHa(t,e):rt.TypeGuard.IsTuple(e)?MHa(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsUnknown(e)?Bt.True:Bt.False}a(UHa,"FromUnknown");function QHa(t,e){return rt.TypeGuard.IsUndefined(t)||rt.TypeGuard.IsUndefined(t)?Bt.True:Bt.False}a(QHa,"FromVoidRight");function qHa(t,e){return rt.TypeGuard.IsIntersect(e)?P_t(t,e):rt.TypeGuard.IsUnion(e)?iwr(t,e):rt.TypeGuard.IsUnknown(e)?y5i(t,e):rt.TypeGuard.IsAny(e)?nwr(t,e):rt.TypeGuard.IsObject(e)?iE(t,e):rt.TypeGuard.IsVoid(e)?Bt.True:Bt.False}a(qHa,"FromVoid");function Il(t,e){return rt.TypeGuard.IsTemplateLiteral(t)||rt.TypeGuard.IsTemplateLiteral(e)?DHa(t,e):rt.TypeGuard.IsRegExp(t)||rt.TypeGuard.IsRegExp(e)?RHa(t,e):rt.TypeGuard.IsNot(t)||rt.TypeGuard.IsNot(e)?AHa(t,e):rt.TypeGuard.IsAny(t)?nHa(t,e):rt.TypeGuard.IsArray(t)?oHa(t,e):rt.TypeGuard.IsBigInt(t)?aHa(t,e):rt.TypeGuard.IsBoolean(t)?cHa(t,e):rt.TypeGuard.IsAsyncIterator(t)?sHa(t,e):rt.TypeGuard.IsConstructor(t)?lHa(t,e):rt.TypeGuard.IsDate(t)?uHa(t,e):rt.TypeGuard.IsFunction(t)?dHa(t,e):rt.TypeGuard.IsInteger(t)?fHa(t,e):rt.TypeGuard.IsIntersect(t)?pHa(t,e):rt.TypeGuard.IsIterator(t)?hHa(t,e):rt.TypeGuard.IsLiteral(t)?mHa(t,e):rt.TypeGuard.IsNever(t)?gHa(t,e):rt.TypeGuard.IsNull(t)?yHa(t,e):rt.TypeGuard.IsNumber(t)?_Ha(t,e):rt.TypeGuard.IsObject(t)?IHa(t,e):rt.TypeGuard.IsRecord(t)?wHa(t,e):rt.TypeGuard.IsString(t)?kHa(t,e):rt.TypeGuard.IsSymbol(t)?PHa(t,e):rt.TypeGuard.IsTuple(t)?OHa(t,e):rt.TypeGuard.IsPromise(t)?xHa(t,e):rt.TypeGuard.IsUint8Array(t)?LHa(t,e):rt.TypeGuard.IsUndefined(t)?BHa(t,e):rt.TypeGuard.IsUnion(t)?FHa(t,e):rt.TypeGuard.IsUnknown(t)?UHa(t,e):rt.TypeGuard.IsVoid(t)?qHa(t,e):xye(`Unknown left type operand '${t[d5i.Kind]}'`)}a(Il,"Visit");function jHa(t,e){return Il(t,e)}a(jHa,"ExtendsCheck")});var awr=I(swr=>{"use strict";p();Object.defineProperty(swr,"__esModule",{value:!0});swr.ExtendsFromMappedResult=zHa;var HHa=Um(),GHa=N_t(),$Ha=yS();function VHa(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,GHa.Extends)(t[c],e,r,n,(0,$Ha.Clone)(o));return s}a(VHa,"FromProperties");function WHa(t,e,r,n,o){return VHa(t.properties,e,r,n,o)}a(WHa,"FromMappedResult");function zHa(t,e,r,n,o){let s=WHa(t,e,r,n,o);return(0,HHa.MappedResult)(s)}a(zHa,"ExtendsFromMappedResult")});var N_t=I(lwr=>{"use strict";p();Object.defineProperty(lwr,"__esModule",{value:!0});lwr.Extends=XHa;var _5i=Pi(),YHa=Op(),cwr=owr(),KHa=uwr(),JHa=awr(),E5i=Is();function ZHa(t,e,r,n){let o=(0,cwr.ExtendsCheck)(t,e);return o===cwr.ExtendsResult.Union?(0,YHa.Union)([r,n]):o===cwr.ExtendsResult.True?r:n}a(ZHa,"ExtendsResolve");function XHa(t,e,r,n,o){return(0,E5i.IsMappedResult)(t)?(0,JHa.ExtendsFromMappedResult)(t,e,r,n,o):(0,E5i.IsMappedKey)(t)?(0,_5i.CreateType)((0,KHa.ExtendsFromMappedKey)(t,e,r,n,o)):(0,_5i.CreateType)(ZHa(t,e,r,n),o)}a(XHa,"Extends")});var uwr=I(dwr=>{"use strict";p();Object.defineProperty(dwr,"__esModule",{value:!0});dwr.ExtendsFromMappedKey=aGa;var eGa=Um(),tGa=nE(),rGa=N_t(),nGa=yS();function iGa(t,e,r,n,o){return{[t]:(0,rGa.Extends)((0,tGa.Literal)(t),e,r,n,(0,nGa.Clone)(o))}}a(iGa,"FromPropertyKey");function oGa(t,e,r,n,o){return t.reduce((s,c)=>({...s,...iGa(c,e,r,n,o)}),{})}a(oGa,"FromPropertyKeys");function sGa(t,e,r,n,o){return oGa(t.keys,e,r,n,o)}a(sGa,"FromMappedKey");function aGa(t,e,r,n,o){let s=sGa(t,e,r,n,o);return(0,eGa.MappedResult)(s)}a(aGa,"ExtendsFromMappedKey")});var pwr=I(fwr=>{"use strict";p();Object.defineProperty(fwr,"__esModule",{value:!0});fwr.ExtendsUndefinedCheck=O_t;var M_t=Tn();function cGa(t){return t.allOf.every(e=>O_t(e))}a(cGa,"Intersect");function lGa(t){return t.anyOf.some(e=>O_t(e))}a(lGa,"Union");function uGa(t){return!O_t(t.not)}a(uGa,"Not");function O_t(t){return t[M_t.Kind]==="Intersect"?cGa(t):t[M_t.Kind]==="Union"?lGa(t):t[M_t.Kind]==="Not"?uGa(t):t[M_t.Kind]==="Undefined"}a(O_t,"ExtendsUndefinedCheck")});var one=I(WD=>{"use strict";p();var dGa=WD&&WD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),BLe=WD&&WD.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dGa(e,t,r)};Object.defineProperty(WD,"__esModule",{value:!0});BLe(owr(),WD);BLe(uwr(),WD);BLe(awr(),WD);BLe(pwr(),WD);BLe(N_t(),WD)});var mwr=I(hwr=>{"use strict";p();Object.defineProperty(hwr,"__esModule",{value:!0});hwr.ExcludeFromTemplateLiteral=hGa;var fGa=L_t(),pGa=GD();function hGa(t,e){return(0,fGa.Exclude)((0,pGa.TemplateLiteralToUnion)(t),e)}a(hGa,"ExcludeFromTemplateLiteral")});var L_t=I(ywr=>{"use strict";p();Object.defineProperty(ywr,"__esModule",{value:!0});ywr.Exclude=EGa;var gwr=Pi(),mGa=Op(),gGa=Fm(),B_t=one(),AGa=_wr(),yGa=mwr(),Awr=Is();function _Ga(t,e){let r=t.filter(n=>(0,B_t.ExtendsCheck)(n,e)===B_t.ExtendsResult.False);return r.length===1?r[0]:(0,mGa.Union)(r)}a(_Ga,"ExcludeRest");function EGa(t,e,r={}){return(0,Awr.IsTemplateLiteral)(t)?(0,gwr.CreateType)((0,yGa.ExcludeFromTemplateLiteral)(t,e),r):(0,Awr.IsMappedResult)(t)?(0,gwr.CreateType)((0,AGa.ExcludeFromMappedResult)(t,e),r):(0,gwr.CreateType)((0,Awr.IsUnion)(t)?_Ga(t.anyOf,e):(0,B_t.ExtendsCheck)(t,e)!==B_t.ExtendsResult.False?(0,gGa.Never)():t,r)}a(EGa,"Exclude")});var _wr=I(Ewr=>{"use strict";p();Object.defineProperty(Ewr,"__esModule",{value:!0});Ewr.ExcludeFromMappedResult=TGa;var vGa=Um(),CGa=L_t();function bGa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,CGa.Exclude)(t[n],e);return r}a(bGa,"FromProperties");function SGa(t,e){return bGa(t.properties,e)}a(SGa,"FromMappedResult");function TGa(t,e){let r=SGa(t,e);return(0,vGa.MappedResult)(r)}a(TGa,"ExcludeFromMappedResult")});var F_t=I(Y6=>{"use strict";p();var IGa=Y6&&Y6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vwr=Y6&&Y6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IGa(e,t,r)};Object.defineProperty(Y6,"__esModule",{value:!0});vwr(_wr(),Y6);vwr(mwr(),Y6);vwr(L_t(),Y6)});var bwr=I(Cwr=>{"use strict";p();Object.defineProperty(Cwr,"__esModule",{value:!0});Cwr.ExtractFromTemplateLiteral=RGa;var xGa=U_t(),wGa=GD();function RGa(t,e){return(0,xGa.Extract)((0,wGa.TemplateLiteralToUnion)(t),e)}a(RGa,"ExtractFromTemplateLiteral")});var U_t=I(Iwr=>{"use strict";p();Object.defineProperty(Iwr,"__esModule",{value:!0});Iwr.Extract=OGa;var Swr=Pi(),kGa=Op(),PGa=Fm(),Q_t=one(),DGa=xwr(),NGa=bwr(),Twr=Is();function MGa(t,e){let r=t.filter(n=>(0,Q_t.ExtendsCheck)(n,e)!==Q_t.ExtendsResult.False);return r.length===1?r[0]:(0,kGa.Union)(r)}a(MGa,"ExtractRest");function OGa(t,e,r){return(0,Twr.IsTemplateLiteral)(t)?(0,Swr.CreateType)((0,NGa.ExtractFromTemplateLiteral)(t,e),r):(0,Twr.IsMappedResult)(t)?(0,Swr.CreateType)((0,DGa.ExtractFromMappedResult)(t,e),r):(0,Swr.CreateType)((0,Twr.IsUnion)(t)?MGa(t.anyOf,e):(0,Q_t.ExtendsCheck)(t,e)!==Q_t.ExtendsResult.False?t:(0,PGa.Never)(),r)}a(OGa,"Extract")});var xwr=I(wwr=>{"use strict";p();Object.defineProperty(wwr,"__esModule",{value:!0});wwr.ExtractFromMappedResult=QGa;var LGa=Um(),BGa=U_t();function FGa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,BGa.Extract)(t[n],e);return r}a(FGa,"FromProperties");function UGa(t,e){return FGa(t.properties,e)}a(UGa,"FromMappedResult");function QGa(t,e){let r=UGa(t,e);return(0,LGa.MappedResult)(r)}a(QGa,"ExtractFromMappedResult")});var q_t=I(K6=>{"use strict";p();var qGa=K6&&K6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Rwr=K6&&K6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qGa(e,t,r)};Object.defineProperty(K6,"__esModule",{value:!0});Rwr(xwr(),K6);Rwr(bwr(),K6);Rwr(U_t(),K6)});var v5i=I(J6=>{"use strict";p();var jGa=J6&&J6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HGa=J6&&J6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),GGa=J6&&J6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var YGa=sne&&sne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KGa=sne&&sne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YGa(e,t,r)};Object.defineProperty(sne,"__esModule",{value:!0});KGa(v5i(),sne)});var C5i=I(kwr=>{"use strict";p();Object.defineProperty(kwr,"__esModule",{value:!0});kwr.ReadonlyOptional=XGa;var JGa=q$(),ZGa=SL();function XGa(t){return(0,JGa.Readonly)((0,ZGa.Optional)(t))}a(XGa,"ReadonlyOptional")});var FLe=I(ane=>{"use strict";p();var e$a=ane&&ane.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),t$a=ane&&ane.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&e$a(e,t,r)};Object.defineProperty(ane,"__esModule",{value:!0});t$a(C5i(),ane)});var x5i=I(wye=>{"use strict";p();Object.defineProperty(wye,"__esModule",{value:!0});wye.Record=y$a;wye.RecordPattern=Dwr;wye.RecordKey=_$a;wye.RecordValue=E$a;var r$a=Pi(),S5i=Tn(),n$a=Fm(),i$a=B$(),T5i=Wv(),b5i=F$(),o$a=Op(),s$a=GD(),cne=_Le(),I5i=$D(),a$a=Vv(),xL=Is();function lne(t,e,r){return(0,r$a.CreateType)({[S5i.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(lne,"RecordCreateFromPattern");function Pwr(t,e,r){let n={};for(let o of t)n[o]=e;return(0,T5i.Object)(n,{...r,[S5i.Hint]:"Record"})}a(Pwr,"RecordCreateFromKeys");function c$a(t,e,r){return(0,s$a.IsTemplateLiteralFinite)(t)?Pwr((0,I5i.IndexPropertyKeys)(t),e,r):lne(t.pattern,e,r)}a(c$a,"FromTemplateLiteralKey");function l$a(t,e,r){return Pwr((0,I5i.IndexPropertyKeys)((0,o$a.Union)(t)),e,r)}a(l$a,"FromUnionKey");function u$a(t,e,r){return Pwr([t.toString()],e,r)}a(u$a,"FromLiteralKey");function d$a(t,e,r){return lne(t.source,e,r)}a(d$a,"FromRegExpKey");function f$a(t,e,r){let n=(0,a$a.IsUndefined)(t.pattern)?cne.PatternStringExact:t.pattern;return lne(n,e,r)}a(f$a,"FromStringKey");function p$a(t,e,r){return lne(cne.PatternStringExact,e,r)}a(p$a,"FromAnyKey");function h$a(t,e,r){return lne(cne.PatternNeverExact,e,r)}a(h$a,"FromNeverKey");function m$a(t,e,r){return(0,T5i.Object)({true:e,false:e},r)}a(m$a,"FromBooleanKey");function g$a(t,e,r){return lne(cne.PatternNumberExact,e,r)}a(g$a,"FromIntegerKey");function A$a(t,e,r){return lne(cne.PatternNumberExact,e,r)}a(A$a,"FromNumberKey");function y$a(t,e,r={}){return(0,xL.IsUnion)(t)?l$a(t.anyOf,e,r):(0,xL.IsTemplateLiteral)(t)?c$a(t,e,r):(0,xL.IsLiteral)(t)?u$a(t.const,e,r):(0,xL.IsBoolean)(t)?m$a(t,e,r):(0,xL.IsInteger)(t)?g$a(t,e,r):(0,xL.IsNumber)(t)?A$a(t,e,r):(0,xL.IsRegExp)(t)?d$a(t,e,r):(0,xL.IsString)(t)?f$a(t,e,r):(0,xL.IsAny)(t)?p$a(t,e,r):(0,xL.IsNever)(t)?h$a(t,e,r):(0,n$a.Never)(r)}a(y$a,"Record");function Dwr(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(Dwr,"RecordPattern");function _$a(t){let e=Dwr(t);return e===cne.PatternStringExact?(0,b5i.String)():e===cne.PatternNumberExact?(0,i$a.Number)():(0,b5i.String)({pattern:e})}a(_$a,"RecordKey");function E$a(t){return t.patternProperties[Dwr(t)]}a(E$a,"RecordValue")});var Rye=I(une=>{"use strict";p();var v$a=une&&une.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),C$a=une&&une.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v$a(e,t,r)};Object.defineProperty(une,"__esModule",{value:!0});C$a(x5i(),une)});var R5i=I(wL=>{"use strict";p();var b$a=wL&&wL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),S$a=wL&&wL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w5i=wL&&wL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o({...r,[n]:G$a(t,e[n])}),{})}a($$a,"FromProperties");function kye(t,e){return e.map(r=>zD(t,r))}a(kye,"FromTypes");function zD(t,e){return SS.IsConstructor(e)?D$a(t,e):SS.IsFunction(e)?N$a(t,e):SS.IsIntersect(e)?M$a(t,e):SS.IsUnion(e)?O$a(t,e):SS.IsTuple(e)?L$a(t,e):SS.IsArray(e)?B$a(t,e):SS.IsAsyncIterator(e)?F$a(t,e):SS.IsIterator(e)?U$a(t,e):SS.IsPromise(e)?Q$a(t,e):SS.IsObject(e)?q$a(t,e):SS.IsRecord(e)?j$a(t,e):SS.IsArgument(e)?H$a(t,e):e}a(zD,"FromType");function V$a(t,e){return zD(e,(0,T$a.CloneType)(t))}a(V$a,"Instantiate")});var H_t=I(dne=>{"use strict";p();var W$a=dne&&dne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),z$a=dne&&dne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W$a(e,t,r)};Object.defineProperty(dne,"__esModule",{value:!0});z$a(R5i(),dne)});var k5i=I(Mwr=>{"use strict";p();Object.defineProperty(Mwr,"__esModule",{value:!0});Mwr.Integer=J$a;var Y$a=Pi(),K$a=Tn();function J$a(t){return(0,Y$a.CreateType)({[K$a.Kind]:"Integer",type:"integer"},t)}a(J$a,"Integer")});var G_t=I(fne=>{"use strict";p();var Z$a=fne&&fne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),X$a=fne&&fne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Z$a(e,t,r)};Object.defineProperty(fne,"__esModule",{value:!0});X$a(k5i(),fne)});var Lwr=I(Owr=>{"use strict";p();Object.defineProperty(Owr,"__esModule",{value:!0});Owr.IntrinsicFromMappedKey=aVa;var eVa=Um(),tVa=pne(),rVa=nE(),nVa=yS();function iVa(t,e,r){return{[t]:(0,tVa.Intrinsic)((0,rVa.Literal)(t),e,(0,nVa.Clone)(r))}}a(iVa,"MappedIntrinsicPropertyKey");function oVa(t,e,r){return t.reduce((o,s)=>({...o,...iVa(s,e,r)}),{})}a(oVa,"MappedIntrinsicPropertyKeys");function sVa(t,e,r){return oVa(t.keys,e,r)}a(sVa,"MappedIntrinsicProperties");function aVa(t,e,r){let n=sVa(t,e,r);return(0,eVa.MappedResult)(n)}a(aVa,"IntrinsicFromMappedKey")});var pne=I(Bwr=>{"use strict";p();Object.defineProperty(Bwr,"__esModule",{value:!0});Bwr.Intrinsic=O5i;var cVa=Pi(),$_t=GD(),lVa=Lwr(),P5i=nE(),D5i=Op(),V_t=Is();function uVa(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(uVa,"ApplyUncapitalize");function dVa(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(dVa,"ApplyCapitalize");function fVa(t){return t.toUpperCase()}a(fVa,"ApplyUppercase");function pVa(t){return t.toLowerCase()}a(pVa,"ApplyLowercase");function hVa(t,e,r){let n=(0,$_t.TemplateLiteralParseExact)(t.pattern);if(!(0,$_t.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:N5i(t.pattern,e)};let c=[...(0,$_t.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,P5i.Literal)(d)),l=M5i(c,e),u=(0,D5i.Union)(l);return(0,$_t.TemplateLiteral)([u],r)}a(hVa,"FromTemplateLiteral");function N5i(t,e){return typeof t=="string"?e==="Uncapitalize"?uVa(t):e==="Capitalize"?dVa(t):e==="Uppercase"?fVa(t):e==="Lowercase"?pVa(t):t:t.toString()}a(N5i,"FromLiteralValue");function M5i(t,e){return t.map(r=>O5i(r,e))}a(M5i,"FromRest");function O5i(t,e,r={}){return(0,V_t.IsMappedKey)(t)?(0,lVa.IntrinsicFromMappedKey)(t,e,r):(0,V_t.IsTemplateLiteral)(t)?hVa(t,e,r):(0,V_t.IsUnion)(t)?(0,D5i.Union)(M5i(t.anyOf,e),r):(0,V_t.IsLiteral)(t)?(0,P5i.Literal)(N5i(t.const,e),r):(0,cVa.CreateType)(t,r)}a(O5i,"Intrinsic")});var L5i=I(Fwr=>{"use strict";p();Object.defineProperty(Fwr,"__esModule",{value:!0});Fwr.Capitalize=gVa;var mVa=pne();function gVa(t,e={}){return(0,mVa.Intrinsic)(t,"Capitalize",e)}a(gVa,"Capitalize")});var B5i=I(Uwr=>{"use strict";p();Object.defineProperty(Uwr,"__esModule",{value:!0});Uwr.Lowercase=yVa;var AVa=pne();function yVa(t,e={}){return(0,AVa.Intrinsic)(t,"Lowercase",e)}a(yVa,"Lowercase")});var F5i=I(Qwr=>{"use strict";p();Object.defineProperty(Qwr,"__esModule",{value:!0});Qwr.Uncapitalize=EVa;var _Va=pne();function EVa(t,e={}){return(0,_Va.Intrinsic)(t,"Uncapitalize",e)}a(EVa,"Uncapitalize")});var U5i=I(qwr=>{"use strict";p();Object.defineProperty(qwr,"__esModule",{value:!0});qwr.Uppercase=CVa;var vVa=pne();function CVa(t,e={}){return(0,vVa.Intrinsic)(t,"Uppercase",e)}a(CVa,"Uppercase")});var W_t=I(ok=>{"use strict";p();var bVa=ok&&ok.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pye=ok&&ok.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bVa(e,t,r)};Object.defineProperty(ok,"__esModule",{value:!0});Pye(L5i(),ok);Pye(Lwr(),ok);Pye(pne(),ok);Pye(B5i(),ok);Pye(F5i(),ok);Pye(U5i(),ok)});var Hwr=I(jwr=>{"use strict";p();Object.defineProperty(jwr,"__esModule",{value:!0});jwr.OmitFromMappedResult=RVa;var SVa=Um(),TVa=z_t(),IVa=yS();function xVa(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,TVa.Omit)(t[o],e,(0,IVa.Clone)(r));return n}a(xVa,"FromProperties");function wVa(t,e,r){return xVa(t.properties,e,r)}a(wVa,"FromMappedResult");function RVa(t,e,r){let n=wVa(t,e,r);return(0,SVa.MappedResult)(n)}a(RVa,"OmitFromMappedResult")});var z_t=I(Vwr=>{"use strict";p();Object.defineProperty(Vwr,"__esModule",{value:!0});Vwr.Omit=$Va;var kVa=Pi(),PVa=c_t(),DVa=mLe(),Gwr=O$(),NVa=nE(),MVa=$D(),OVa=TI(),Q5i=Op(),q5i=Wv(),LVa=Wwr(),BVa=Hwr(),Z6=Is(),FVa=Vv();function UVa(t,e){return t.map(r=>$wr(r,e))}a(UVa,"FromIntersect");function QVa(t,e){return t.map(r=>$wr(r,e))}a(QVa,"FromUnion");function qVa(t,e){let{[e]:r,...n}=t;return n}a(qVa,"FromProperty");function jVa(t,e){return e.reduce((r,n)=>qVa(r,n),t)}a(jVa,"FromProperties");function HVa(t,e,r){let n=(0,PVa.Discard)(t,[DVa.TransformKind,"$id","required","properties"]),o=jVa(r,e);return(0,q5i.Object)(o,n)}a(HVa,"FromObject");function GVa(t){let e=t.reduce((r,n)=>(0,Z6.IsLiteralValue)(n)?[...r,(0,NVa.Literal)(n)]:r,[]);return(0,Q5i.Union)(e)}a(GVa,"UnionFromPropertyKeys");function $wr(t,e){return(0,Z6.IsIntersect)(t)?(0,OVa.Intersect)(UVa(t.allOf,e)):(0,Z6.IsUnion)(t)?(0,Q5i.Union)(QVa(t.anyOf,e)):(0,Z6.IsObject)(t)?HVa(t,e,t.properties):(0,q5i.Object)({})}a($wr,"OmitResolve");function $Va(t,e,r){let n=(0,FVa.IsArray)(e)?GVa(e):e,o=(0,Z6.IsSchema)(e)?(0,MVa.IndexPropertyKeys)(e):e,s=(0,Z6.IsRef)(t),c=(0,Z6.IsRef)(e);return(0,Z6.IsMappedResult)(t)?(0,BVa.OmitFromMappedResult)(t,o,r):(0,Z6.IsMappedKey)(e)?(0,LVa.OmitFromMappedKey)(t,e,r):s&&c?(0,Gwr.Computed)("Omit",[t,n],r):!s&&c?(0,Gwr.Computed)("Omit",[t,n],r):s&&!c?(0,Gwr.Computed)("Omit",[t,n],r):(0,kVa.CreateType)({...$wr(t,o),...r})}a($Va,"Omit")});var Wwr=I(zwr=>{"use strict";p();Object.defineProperty(zwr,"__esModule",{value:!0});zwr.OmitFromMappedKey=ZVa;var VVa=Um(),WVa=z_t(),zVa=yS();function YVa(t,e,r){return{[e]:(0,WVa.Omit)(t,[e],(0,zVa.Clone)(r))}}a(YVa,"FromPropertyKey");function KVa(t,e,r){return e.reduce((n,o)=>({...n,...YVa(t,o,r)}),{})}a(KVa,"FromPropertyKeys");function JVa(t,e,r){return KVa(t,e.keys,r)}a(JVa,"FromMappedKey");function ZVa(t,e,r){let n=JVa(t,e,r);return(0,VVa.MappedResult)(n)}a(ZVa,"OmitFromMappedKey")});var ULe=I(X6=>{"use strict";p();var XVa=X6&&X6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ywr=X6&&X6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XVa(e,t,r)};Object.defineProperty(X6,"__esModule",{value:!0});Ywr(Wwr(),X6);Ywr(Hwr(),X6);Ywr(z_t(),X6)});var Jwr=I(Kwr=>{"use strict";p();Object.defineProperty(Kwr,"__esModule",{value:!0});Kwr.PickFromMappedResult=oWa;var eWa=Um(),tWa=Y_t(),rWa=yS();function nWa(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,tWa.Pick)(t[o],e,(0,rWa.Clone)(r));return n}a(nWa,"FromProperties");function iWa(t,e,r){return nWa(t.properties,e,r)}a(iWa,"FromMappedResult");function oWa(t,e,r){let n=iWa(t,e,r);return(0,eWa.MappedResult)(n)}a(oWa,"PickFromMappedResult")});var Y_t=I(eRr=>{"use strict";p();Object.defineProperty(eRr,"__esModule",{value:!0});eRr.Pick=EWa;var sWa=Pi(),aWa=c_t(),Zwr=O$(),cWa=TI(),lWa=nE(),j5i=Wv(),H5i=Op(),uWa=$D(),dWa=mLe(),eU=Is(),fWa=Vv(),pWa=tRr(),hWa=Jwr();function mWa(t,e){return t.map(r=>Xwr(r,e))}a(mWa,"FromIntersect");function gWa(t,e){return t.map(r=>Xwr(r,e))}a(gWa,"FromUnion");function AWa(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(AWa,"FromProperties");function yWa(t,e,r){let n=(0,aWa.Discard)(t,[dWa.TransformKind,"$id","required","properties"]),o=AWa(r,e);return(0,j5i.Object)(o,n)}a(yWa,"FromObject");function _Wa(t){let e=t.reduce((r,n)=>(0,eU.IsLiteralValue)(n)?[...r,(0,lWa.Literal)(n)]:r,[]);return(0,H5i.Union)(e)}a(_Wa,"UnionFromPropertyKeys");function Xwr(t,e){return(0,eU.IsIntersect)(t)?(0,cWa.Intersect)(mWa(t.allOf,e)):(0,eU.IsUnion)(t)?(0,H5i.Union)(gWa(t.anyOf,e)):(0,eU.IsObject)(t)?yWa(t,e,t.properties):(0,j5i.Object)({})}a(Xwr,"PickResolve");function EWa(t,e,r){let n=(0,fWa.IsArray)(e)?_Wa(e):e,o=(0,eU.IsSchema)(e)?(0,uWa.IndexPropertyKeys)(e):e,s=(0,eU.IsRef)(t),c=(0,eU.IsRef)(e);return(0,eU.IsMappedResult)(t)?(0,hWa.PickFromMappedResult)(t,o,r):(0,eU.IsMappedKey)(e)?(0,pWa.PickFromMappedKey)(t,e,r):s&&c?(0,Zwr.Computed)("Pick",[t,n],r):!s&&c?(0,Zwr.Computed)("Pick",[t,n],r):s&&!c?(0,Zwr.Computed)("Pick",[t,n],r):(0,sWa.CreateType)({...Xwr(t,o),...r})}a(EWa,"Pick")});var tRr=I(rRr=>{"use strict";p();Object.defineProperty(rRr,"__esModule",{value:!0});rRr.PickFromMappedKey=xWa;var vWa=Um(),CWa=Y_t(),bWa=yS();function SWa(t,e,r){return{[e]:(0,CWa.Pick)(t,[e],(0,bWa.Clone)(r))}}a(SWa,"FromPropertyKey");function TWa(t,e,r){return e.reduce((n,o)=>({...n,...SWa(t,o,r)}),{})}a(TWa,"FromPropertyKeys");function IWa(t,e,r){return TWa(t,e.keys,r)}a(IWa,"FromMappedKey");function xWa(t,e,r){let n=IWa(t,e,r);return(0,vWa.MappedResult)(n)}a(xWa,"PickFromMappedKey")});var QLe=I(tU=>{"use strict";p();var wWa=tU&&tU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nRr=tU&&tU.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wWa(e,t,r)};Object.defineProperty(tU,"__esModule",{value:!0});nRr(tRr(),tU);nRr(Jwr(),tU);nRr(Y_t(),tU)});var oRr=I(rU=>{"use strict";p();var RWa=rU&&rU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kWa=rU&&rU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PWa=rU&&rU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oV5i(e))}a(G5i,"FromRest");function V5i(t){return Yv.IsComputed(t)?QWa(t.target,t.parameters):Yv.IsRef(t)?qWa(t.$ref):Yv.IsIntersect(t)?(0,MWa.Intersect)(G5i(t.allOf)):Yv.IsUnion(t)?(0,OWa.Union)(G5i(t.anyOf)):Yv.IsObject(t)?HWa(t,t.properties):Yv.IsBigInt(t)||Yv.IsBoolean(t)||Yv.IsInteger(t)||Yv.IsLiteral(t)||Yv.IsNull(t)||Yv.IsNumber(t)||Yv.IsString(t)||Yv.IsSymbol(t)||Yv.IsUndefined(t)?t:(0,$5i.Object)({})}a(V5i,"PartialResolve");function GWa(t,e){return Yv.IsMappedResult(t)?(0,UWa.PartialFromMappedResult)(t,e):(0,DWa.CreateType)({...V5i(t),...e})}a(GWa,"Partial")});var sRr=I(aRr=>{"use strict";p();Object.defineProperty(aRr,"__esModule",{value:!0});aRr.PartialFromMappedResult=KWa;var $Wa=Um(),VWa=oRr(),WWa=yS();function zWa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,VWa.Partial)(t[n],(0,WWa.Clone)(e));return r}a(zWa,"FromProperties");function YWa(t,e){return zWa(t.properties,e)}a(YWa,"FromMappedResult");function KWa(t,e){let r=YWa(t,e);return(0,$Wa.MappedResult)(r)}a(KWa,"PartialFromMappedResult")});var qLe=I($$=>{"use strict";p();var JWa=$$&&$$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),W5i=$$&&$$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JWa(e,t,r)};Object.defineProperty($$,"__esModule",{value:!0});W5i(sRr(),$$);W5i(oRr(),$$)});var lRr=I(nU=>{"use strict";p();var ZWa=nU&&nU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XWa=nU&&nU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),eza=nU&&nU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oZ5i(e))}a(z5i,"FromRest");function Z5i(t){return Kv.IsComputed(t)?sza(t.target,t.parameters):Kv.IsRef(t)?aza(t.$ref):Kv.IsIntersect(t)?(0,rza.Intersect)(z5i(t.allOf)):Kv.IsUnion(t)?(0,nza.Union)(z5i(t.anyOf)):Kv.IsObject(t)?lza(t,t.properties):Kv.IsBigInt(t)||Kv.IsBoolean(t)||Kv.IsInteger(t)||Kv.IsLiteral(t)||Kv.IsNull(t)||Kv.IsNumber(t)||Kv.IsString(t)||Kv.IsSymbol(t)||Kv.IsUndefined(t)?t:(0,Y5i.Object)({})}a(Z5i,"RequiredResolve");function uza(t,e){return Kv.IsMappedResult(t)?(0,oza.RequiredFromMappedResult)(t,e):(0,tza.CreateType)({...Z5i(t),...e})}a(uza,"Required")});var uRr=I(dRr=>{"use strict";p();Object.defineProperty(dRr,"__esModule",{value:!0});dRr.RequiredFromMappedResult=mza;var dza=Um(),fza=lRr();function pza(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,fza.Required)(t[n],e);return r}a(pza,"FromProperties");function hza(t,e){return pza(t.properties,e)}a(hza,"FromMappedResult");function mza(t,e){let r=hza(t,e);return(0,dza.MappedResult)(r)}a(mza,"RequiredFromMappedResult")});var jLe=I(V$=>{"use strict";p();var gza=V$&&V$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),X5i=V$&&V$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gza(e,t,r)};Object.defineProperty(V$,"__esModule",{value:!0});X5i(uRr(),V$);X5i(lRr(),V$)});var n4i=I(YD=>{"use strict";p();var Aza=YD&&YD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yza=YD&&YD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_za=YD&&YD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oky.IsRef(r)?pRr(t,r.$ref):IS(t,r))}a(Bza,"DereferenceParameters");function pRr(t,e){return e in t?ky.IsRef(t[e])?pRr(t,t[e].$ref):IS(t,t[e]):(0,fRr.Never)()}a(pRr,"Dereference");function Fza(t){return(0,Cza.Awaited)(t[0])}a(Fza,"FromAwaited");function Uza(t){return(0,Tza.Index)(t[0],t[1])}a(Uza,"FromIndex");function Qza(t){return(0,Rza.KeyOf)(t[0])}a(Qza,"FromKeyOf");function qza(t){return(0,Nza.Partial)(t[0])}a(qza,"FromPartial");function jza(t){return(0,Pza.Omit)(t[0],t[1])}a(jza,"FromOmit");function Hza(t){return(0,Dza.Pick)(t[0],t[1])}a(Hza,"FromPick");function Gza(t){return(0,Mza.Required)(t[0])}a(Gza,"FromRequired");function $za(t,e,r){let n=Bza(t,r);return e==="Awaited"?Fza(n):e==="Index"?Uza(n):e==="KeyOf"?Qza(n):e==="Partial"?qza(n):e==="Omit"?jza(n):e==="Pick"?Hza(n):e==="Required"?Gza(n):(0,fRr.Never)()}a($za,"FromComputed");function Vza(t,e){return(0,vza.Array)(IS(t,e))}a(Vza,"FromArray");function Wza(t,e){return(0,bza.AsyncIterator)(IS(t,e))}a(Wza,"FromAsyncIterator");function zza(t,e,r){return(0,Sza.Constructor)(HLe(t,e),IS(t,r))}a(zza,"FromConstructor");function Yza(t,e,r){return(0,Iza.Function)(HLe(t,e),IS(t,r))}a(Yza,"FromFunction");function Kza(t,e){return(0,xza.Intersect)(HLe(t,e))}a(Kza,"FromIntersect");function Jza(t,e){return(0,wza.Iterator)(IS(t,e))}a(Jza,"FromIterator");function Zza(t,e){return(0,kza.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:IS(t,e[n])}),{}))}a(Zza,"FromObject");function Xza(t,e){let[r,n]=[IS(t,(0,t4i.RecordValue)(e)),(0,t4i.RecordPattern)(e)],o=(0,Eza.CloneType)(e);return o.patternProperties[n]=r,o}a(Xza,"FromRecord");function eYa(t,e){return ky.IsRef(e)?{...pRr(t,e.$ref),[K_t.TransformKind]:e[K_t.TransformKind]}:e}a(eYa,"FromTransform");function tYa(t,e){return(0,Oza.Tuple)(HLe(t,e))}a(tYa,"FromTuple");function rYa(t,e){return(0,Lza.Union)(HLe(t,e))}a(rYa,"FromUnion");function HLe(t,e){return e.map(r=>IS(t,r))}a(HLe,"FromTypes");function IS(t,e){return ky.IsOptional(e)?(0,TS.CreateType)(IS(t,(0,e4i.Discard)(e,[K_t.OptionalKind])),e):ky.IsReadonly(e)?(0,TS.CreateType)(IS(t,(0,e4i.Discard)(e,[K_t.ReadonlyKind])),e):ky.IsTransform(e)?(0,TS.CreateType)(eYa(t,e),e):ky.IsArray(e)?(0,TS.CreateType)(Vza(t,e.items),e):ky.IsAsyncIterator(e)?(0,TS.CreateType)(Wza(t,e.items),e):ky.IsComputed(e)?(0,TS.CreateType)($za(t,e.target,e.parameters)):ky.IsConstructor(e)?(0,TS.CreateType)(zza(t,e.parameters,e.returns),e):ky.IsFunction(e)?(0,TS.CreateType)(Yza(t,e.parameters,e.returns),e):ky.IsIntersect(e)?(0,TS.CreateType)(Kza(t,e.allOf),e):ky.IsIterator(e)?(0,TS.CreateType)(Jza(t,e.items),e):ky.IsObject(e)?(0,TS.CreateType)(Zza(t,e.properties),e):ky.IsRecord(e)?(0,TS.CreateType)(Xza(t,e)):ky.IsTuple(e)?(0,TS.CreateType)(tYa(t,e.items||[]),e):ky.IsUnion(e)?(0,TS.CreateType)(rYa(t,e.anyOf),e):e}a(IS,"FromType");function r4i(t,e){return e in t?IS(t,t[e]):(0,fRr.Never)()}a(r4i,"ComputeType");function nYa(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:r4i(t,r)}),{})}a(nYa,"ComputeModuleProperties")});var o4i=I(GLe=>{"use strict";p();Object.defineProperty(GLe,"__esModule",{value:!0});GLe.TModule=void 0;GLe.Module=sYa;var i4i=Q6(),iYa=Tn(),oYa=n4i(),J_t=class{static{a(this,"TModule")}constructor(e){let r=(0,oYa.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,i4i.CreateType)(this.$defs[e],r)};return(0,i4i.CreateType)({[iYa.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};GLe.TModule=J_t;function sYa(t){return new J_t(t)}a(sYa,"Module")});var Z_t=I(hne=>{"use strict";p();var aYa=hne&&hne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cYa=hne&&hne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&aYa(e,t,r)};Object.defineProperty(hne,"__esModule",{value:!0});cYa(o4i(),hne)});var s4i=I(hRr=>{"use strict";p();Object.defineProperty(hRr,"__esModule",{value:!0});hRr.Not=dYa;var lYa=Pi(),uYa=Tn();function dYa(t,e){return(0,lYa.CreateType)({[uYa.Kind]:"Not",not:t},e)}a(dYa,"Not")});var X_t=I(mne=>{"use strict";p();var fYa=mne&&mne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pYa=mne&&mne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fYa(e,t,r)};Object.defineProperty(mne,"__esModule",{value:!0});pYa(s4i(),mne)});var a4i=I(iU=>{"use strict";p();var hYa=iU&&iU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mYa=iU&&iU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gYa=iU&&iU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var vYa=gne&&gne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CYa=gne&&gne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vYa(e,t,r)};Object.defineProperty(gne,"__esModule",{value:!0});CYa(a4i(),gne)});var l4i=I(mRr=>{"use strict";p();Object.defineProperty(mRr,"__esModule",{value:!0});mRr.Recursive=xYa;var bYa=e_t(),SYa=Pi(),TYa=Vv(),c4i=Tn(),IYa=0;function xYa(t,e={}){(0,TYa.IsUndefined)(e.$id)&&(e.$id=`T${IYa++}`);let r=(0,bYa.CloneType)(t({[c4i.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,SYa.CreateType)({[c4i.Hint]:"Recursive",...r},e)}a(xYa,"Recursive")});var tEt=I(Ane=>{"use strict";p();var wYa=Ane&&Ane.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RYa=Ane&&Ane.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wYa(e,t,r)};Object.defineProperty(Ane,"__esModule",{value:!0});RYa(l4i(),Ane)});var u4i=I(gRr=>{"use strict";p();Object.defineProperty(gRr,"__esModule",{value:!0});gRr.RegExp=NYa;var kYa=Pi(),PYa=Vv(),DYa=Tn();function NYa(t,e){let r=(0,PYa.IsString)(t)?new globalThis.RegExp(t):t;return(0,kYa.CreateType)({[DYa.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(NYa,"RegExp")});var rEt=I(yne=>{"use strict";p();var MYa=yne&&yne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),OYa=yne&&yne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MYa(e,t,r)};Object.defineProperty(yne,"__esModule",{value:!0});OYa(u4i(),yne)});var d4i=I(yRr=>{"use strict";p();Object.defineProperty(yRr,"__esModule",{value:!0});yRr.Rest=BYa;var ARr=Is();function LYa(t){return(0,ARr.IsIntersect)(t)?t.allOf:(0,ARr.IsUnion)(t)?t.anyOf:(0,ARr.IsTuple)(t)?t.items??[]:[]}a(LYa,"RestResolve");function BYa(t){return LYa(t)}a(BYa,"Rest")});var nEt=I(_ne=>{"use strict";p();var FYa=_ne&&_ne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UYa=_ne&&_ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&FYa(e,t,r)};Object.defineProperty(_ne,"__esModule",{value:!0});UYa(d4i(),_ne)});var f4i=I(oU=>{"use strict";p();var QYa=oU&&oU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qYa=oU&&oU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jYa=oU&&oU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var WYa=Ene&&Ene.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zYa=Ene&&Ene.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WYa(e,t,r)};Object.defineProperty(Ene,"__esModule",{value:!0});zYa(f4i(),Ene)});var h4i=I(p4i=>{"use strict";p();Object.defineProperty(p4i,"__esModule",{value:!0})});var g4i=I(m4i=>{"use strict";p();Object.defineProperty(m4i,"__esModule",{value:!0});var T9p=Tn()});var y4i=I(W$=>{"use strict";p();var YYa=W$&&W$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),A4i=W$&&W$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YYa(e,t,r)};Object.defineProperty(W$,"__esModule",{value:!0});A4i(h4i(),W$);A4i(g4i(),W$)});var E4i=I(_4i=>{"use strict";p();Object.defineProperty(_4i,"__esModule",{value:!0})});var v4i=I(vne=>{"use strict";p();var KYa=vne&&vne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JYa=vne&&vne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&KYa(e,t,r)};Object.defineProperty(vne,"__esModule",{value:!0});JYa(E4i(),vne)});var C4i=I(Cne=>{"use strict";p();Object.defineProperty(Cne,"__esModule",{value:!0});Cne.TransformEncodeBuilder=Cne.TransformDecodeBuilder=void 0;Cne.Transform=XYa;var oEt=Tn(),ZYa=Is(),sEt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new aEt(this.schema,e)}};Cne.TransformDecodeBuilder=sEt;var aEt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[oEt.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[oEt.TransformKind].Decode(c)),"Decode")};return{...r,[oEt.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[oEt.TransformKind]:n}}Encode(e){return(0,ZYa.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};Cne.TransformEncodeBuilder=aEt;function XYa(t){return new sEt(t)}a(XYa,"Transform")});var cEt=I(bne=>{"use strict";p();var eKa=bne&&bne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tKa=bne&&bne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eKa(e,t,r)};Object.defineProperty(bne,"__esModule",{value:!0});tKa(C4i(),bne)});var S4i=I(_Rr=>{"use strict";p();Object.defineProperty(_Rr,"__esModule",{value:!0});_Rr.Unsafe=nKa;var rKa=Pi(),b4i=Tn();function nKa(t={}){return(0,rKa.CreateType)({[b4i.Kind]:t[b4i.Kind]??"Unsafe"},t)}a(nKa,"Unsafe")});var $Le=I(Sne=>{"use strict";p();var iKa=Sne&&Sne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oKa=Sne&&Sne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iKa(e,t,r)};Object.defineProperty(Sne,"__esModule",{value:!0});oKa(S4i(),Sne)});var T4i=I(ERr=>{"use strict";p();Object.defineProperty(ERr,"__esModule",{value:!0});ERr.Void=cKa;var sKa=Pi(),aKa=Tn();function cKa(t){return(0,sKa.CreateType)({[aKa.Kind]:"Void",type:"void"},t)}a(cKa,"Void")});var lEt=I(Tne=>{"use strict";p();var lKa=Tne&&Tne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uKa=Tne&&Tne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lKa(e,t,r)};Object.defineProperty(Tne,"__esModule",{value:!0});uKa(T4i(),Tne)});var CRr=I(dEt=>{"use strict";p();Object.defineProperty(dEt,"__esModule",{value:!0});dEt.JsonTypeBuilder=void 0;var dKa=mye(),fKa=gye(),pKa=bLe(),hKa=T_t(),mKa=x_t(),gKa=R_t(),AKa=F_t(),yKa=one(),_Ka=q_t(),EKa=$D(),vKa=G_t(),CKa=TI(),uEt=W_t(),bKa=VD(),SKa=nE(),TKa=Um(),IKa=Fm(),xKa=X_t(),wKa=NLe(),RKa=Z_t(),kKa=B$(),PKa=Wv(),DKa=ULe(),NKa=SL(),MKa=qLe(),OKa=QLe(),LKa=q$(),BKa=FLe(),FKa=Rye(),UKa=tEt(),QKa=H$(),qKa=jLe(),jKa=nEt(),HKa=F$(),GKa=GD(),$Ka=cEt(),VKa=$6(),WKa=Op(),zKa=G$(),YKa=$Le(),vRr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,BKa.ReadonlyOptional)(e)}Readonly(e,r){return(0,LKa.Readonly)(e,r??!0)}Optional(e,r){return(0,NKa.Optional)(e,r??!0)}Any(e){return(0,dKa.Any)(e)}Array(e,r){return(0,fKa.Array)(e,r)}Boolean(e){return(0,pKa.Boolean)(e)}Capitalize(e,r){return(0,uEt.Capitalize)(e,r)}Composite(e,r){return(0,hKa.Composite)(e,r)}Const(e,r){return(0,mKa.Const)(e,r)}Enum(e,r){return(0,gKa.Enum)(e,r)}Exclude(e,r,n){return(0,AKa.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,yKa.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,_Ka.Extract)(e,r,n)}Index(e,r,n){return(0,EKa.Index)(e,r,n)}Integer(e){return(0,vKa.Integer)(e)}Intersect(e,r){return(0,CKa.Intersect)(e,r)}KeyOf(e,r){return(0,bKa.KeyOf)(e,r)}Literal(e,r){return(0,SKa.Literal)(e,r)}Lowercase(e,r){return(0,uEt.Lowercase)(e,r)}Mapped(e,r,n){return(0,TKa.Mapped)(e,r,n)}Module(e){return(0,RKa.Module)(e)}Never(e){return(0,IKa.Never)(e)}Not(e,r){return(0,xKa.Not)(e,r)}Null(e){return(0,wKa.Null)(e)}Number(e){return(0,kKa.Number)(e)}Object(e,r){return(0,PKa.Object)(e,r)}Omit(e,r,n){return(0,DKa.Omit)(e,r,n)}Partial(e,r){return(0,MKa.Partial)(e,r)}Pick(e,r,n){return(0,OKa.Pick)(e,r,n)}Record(e,r,n){return(0,FKa.Record)(e,r,n)}Recursive(e,r){return(0,UKa.Recursive)(e,r)}Ref(...e){return(0,QKa.Ref)(e[0],e[1])}Required(e,r){return(0,qKa.Required)(e,r)}Rest(e){return(0,jKa.Rest)(e)}String(e){return(0,HKa.String)(e)}TemplateLiteral(e,r){return(0,GKa.TemplateLiteral)(e,r)}Transform(e){return(0,$Ka.Transform)(e)}Tuple(e,r){return(0,VKa.Tuple)(e,r)}Uncapitalize(e,r){return(0,uEt.Uncapitalize)(e,r)}Union(e,r){return(0,WKa.Union)(e,r)}Unknown(e){return(0,zKa.Unknown)(e)}Unsafe(e){return(0,YKa.Unsafe)(e)}Uppercase(e,r){return(0,uEt.Uppercase)(e,r)}};dEt.JsonTypeBuilder=vRr});var I4i=I(Lt=>{"use strict";p();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.Rest=Lt.Required=Lt.RegExp=Lt.Ref=Lt.Recursive=Lt.Record=Lt.ReadonlyOptional=Lt.Readonly=Lt.Promise=Lt.Pick=Lt.Partial=Lt.Parameters=Lt.Optional=Lt.Omit=Lt.Object=Lt.Number=Lt.Null=Lt.Not=Lt.Never=Lt.Module=Lt.Mapped=Lt.Literal=Lt.KeyOf=Lt.Iterator=Lt.Uppercase=Lt.Lowercase=Lt.Uncapitalize=Lt.Capitalize=Lt.Intersect=Lt.Integer=Lt.Instantiate=Lt.InstanceType=Lt.Index=Lt.Function=Lt.Extract=Lt.Extends=Lt.Exclude=Lt.Enum=Lt.Date=Lt.ConstructorParameters=Lt.Constructor=Lt.Const=Lt.Composite=Lt.Boolean=Lt.BigInt=Lt.Awaited=Lt.AsyncIterator=Lt.Array=Lt.Argument=Lt.Any=void 0;Lt.Void=Lt.Unsafe=Lt.Unknown=Lt.Union=Lt.Undefined=Lt.Uint8Array=Lt.Tuple=Lt.Transform=Lt.TemplateLiteral=Lt.Symbol=Lt.String=Lt.ReturnType=void 0;var KKa=mye();Object.defineProperty(Lt,"Any",{enumerable:!0,get:a(function(){return KKa.Any},"get")});var JKa=a_t();Object.defineProperty(Lt,"Argument",{enumerable:!0,get:a(function(){return JKa.Argument},"get")});var ZKa=gye();Object.defineProperty(Lt,"Array",{enumerable:!0,get:a(function(){return ZKa.Array},"get")});var XKa=Aye();Object.defineProperty(Lt,"AsyncIterator",{enumerable:!0,get:a(function(){return XKa.AsyncIterator},"get")});var eJa=PLe();Object.defineProperty(Lt,"Awaited",{enumerable:!0,get:a(function(){return eJa.Awaited},"get")});var tJa=Cye();Object.defineProperty(Lt,"BigInt",{enumerable:!0,get:a(function(){return tJa.BigInt},"get")});var rJa=bLe();Object.defineProperty(Lt,"Boolean",{enumerable:!0,get:a(function(){return rJa.Boolean},"get")});var nJa=T_t();Object.defineProperty(Lt,"Composite",{enumerable:!0,get:a(function(){return nJa.Composite},"get")});var iJa=x_t();Object.defineProperty(Lt,"Const",{enumerable:!0,get:a(function(){return iJa.Const},"get")});var oJa=yye();Object.defineProperty(Lt,"Constructor",{enumerable:!0,get:a(function(){return oJa.Constructor},"get")});var sJa=w_t();Object.defineProperty(Lt,"ConstructorParameters",{enumerable:!0,get:a(function(){return sJa.ConstructorParameters},"get")});var aJa=DLe();Object.defineProperty(Lt,"Date",{enumerable:!0,get:a(function(){return aJa.Date},"get")});var cJa=R_t();Object.defineProperty(Lt,"Enum",{enumerable:!0,get:a(function(){return cJa.Enum},"get")});var lJa=F_t();Object.defineProperty(Lt,"Exclude",{enumerable:!0,get:a(function(){return lJa.Exclude},"get")});var uJa=one();Object.defineProperty(Lt,"Extends",{enumerable:!0,get:a(function(){return uJa.Extends},"get")});var dJa=q_t();Object.defineProperty(Lt,"Extract",{enumerable:!0,get:a(function(){return dJa.Extract},"get")});var fJa=L$();Object.defineProperty(Lt,"Function",{enumerable:!0,get:a(function(){return fJa.Function},"get")});var pJa=$D();Object.defineProperty(Lt,"Index",{enumerable:!0,get:a(function(){return pJa.Index},"get")});var hJa=j_t();Object.defineProperty(Lt,"InstanceType",{enumerable:!0,get:a(function(){return hJa.InstanceType},"get")});var mJa=H_t();Object.defineProperty(Lt,"Instantiate",{enumerable:!0,get:a(function(){return mJa.Instantiate},"get")});var gJa=G_t();Object.defineProperty(Lt,"Integer",{enumerable:!0,get:a(function(){return gJa.Integer},"get")});var AJa=TI();Object.defineProperty(Lt,"Intersect",{enumerable:!0,get:a(function(){return AJa.Intersect},"get")});var fEt=W_t();Object.defineProperty(Lt,"Capitalize",{enumerable:!0,get:a(function(){return fEt.Capitalize},"get")});Object.defineProperty(Lt,"Uncapitalize",{enumerable:!0,get:a(function(){return fEt.Uncapitalize},"get")});Object.defineProperty(Lt,"Lowercase",{enumerable:!0,get:a(function(){return fEt.Lowercase},"get")});Object.defineProperty(Lt,"Uppercase",{enumerable:!0,get:a(function(){return fEt.Uppercase},"get")});var yJa=Sye();Object.defineProperty(Lt,"Iterator",{enumerable:!0,get:a(function(){return yJa.Iterator},"get")});var _Ja=VD();Object.defineProperty(Lt,"KeyOf",{enumerable:!0,get:a(function(){return _Ja.KeyOf},"get")});var EJa=nE();Object.defineProperty(Lt,"Literal",{enumerable:!0,get:a(function(){return EJa.Literal},"get")});var vJa=Um();Object.defineProperty(Lt,"Mapped",{enumerable:!0,get:a(function(){return vJa.Mapped},"get")});var CJa=Z_t();Object.defineProperty(Lt,"Module",{enumerable:!0,get:a(function(){return CJa.Module},"get")});var bJa=Fm();Object.defineProperty(Lt,"Never",{enumerable:!0,get:a(function(){return bJa.Never},"get")});var SJa=X_t();Object.defineProperty(Lt,"Not",{enumerable:!0,get:a(function(){return SJa.Not},"get")});var TJa=NLe();Object.defineProperty(Lt,"Null",{enumerable:!0,get:a(function(){return TJa.Null},"get")});var IJa=B$();Object.defineProperty(Lt,"Number",{enumerable:!0,get:a(function(){return IJa.Number},"get")});var xJa=Wv();Object.defineProperty(Lt,"Object",{enumerable:!0,get:a(function(){return xJa.Object},"get")});var wJa=ULe();Object.defineProperty(Lt,"Omit",{enumerable:!0,get:a(function(){return wJa.Omit},"get")});var RJa=SL();Object.defineProperty(Lt,"Optional",{enumerable:!0,get:a(function(){return RJa.Optional},"get")});var kJa=eEt();Object.defineProperty(Lt,"Parameters",{enumerable:!0,get:a(function(){return kJa.Parameters},"get")});var PJa=qLe();Object.defineProperty(Lt,"Partial",{enumerable:!0,get:a(function(){return PJa.Partial},"get")});var DJa=QLe();Object.defineProperty(Lt,"Pick",{enumerable:!0,get:a(function(){return DJa.Pick},"get")});var NJa=wLe();Object.defineProperty(Lt,"Promise",{enumerable:!0,get:a(function(){return NJa.Promise},"get")});var MJa=q$();Object.defineProperty(Lt,"Readonly",{enumerable:!0,get:a(function(){return MJa.Readonly},"get")});var OJa=FLe();Object.defineProperty(Lt,"ReadonlyOptional",{enumerable:!0,get:a(function(){return OJa.ReadonlyOptional},"get")});var LJa=Rye();Object.defineProperty(Lt,"Record",{enumerable:!0,get:a(function(){return LJa.Record},"get")});var BJa=tEt();Object.defineProperty(Lt,"Recursive",{enumerable:!0,get:a(function(){return BJa.Recursive},"get")});var FJa=H$();Object.defineProperty(Lt,"Ref",{enumerable:!0,get:a(function(){return FJa.Ref},"get")});var UJa=rEt();Object.defineProperty(Lt,"RegExp",{enumerable:!0,get:a(function(){return UJa.RegExp},"get")});var QJa=jLe();Object.defineProperty(Lt,"Required",{enumerable:!0,get:a(function(){return QJa.Required},"get")});var qJa=nEt();Object.defineProperty(Lt,"Rest",{enumerable:!0,get:a(function(){return qJa.Rest},"get")});var jJa=iEt();Object.defineProperty(Lt,"ReturnType",{enumerable:!0,get:a(function(){return jJa.ReturnType},"get")});var HJa=F$();Object.defineProperty(Lt,"String",{enumerable:!0,get:a(function(){return HJa.String},"get")});var GJa=MLe();Object.defineProperty(Lt,"Symbol",{enumerable:!0,get:a(function(){return GJa.Symbol},"get")});var $Ja=GD();Object.defineProperty(Lt,"TemplateLiteral",{enumerable:!0,get:a(function(){return $Ja.TemplateLiteral},"get")});var VJa=cEt();Object.defineProperty(Lt,"Transform",{enumerable:!0,get:a(function(){return VJa.Transform},"get")});var WJa=$6();Object.defineProperty(Lt,"Tuple",{enumerable:!0,get:a(function(){return WJa.Tuple},"get")});var zJa=LLe();Object.defineProperty(Lt,"Uint8Array",{enumerable:!0,get:a(function(){return zJa.Uint8Array},"get")});var YJa=OLe();Object.defineProperty(Lt,"Undefined",{enumerable:!0,get:a(function(){return YJa.Undefined},"get")});var KJa=Op();Object.defineProperty(Lt,"Union",{enumerable:!0,get:a(function(){return KJa.Union},"get")});var JJa=G$();Object.defineProperty(Lt,"Unknown",{enumerable:!0,get:a(function(){return JJa.Unknown},"get")});var ZJa=$Le();Object.defineProperty(Lt,"Unsafe",{enumerable:!0,get:a(function(){return ZJa.Unsafe},"get")});var XJa=lEt();Object.defineProperty(Lt,"Void",{enumerable:!0,get:a(function(){return XJa.Void},"get")})});var x4i=I(pEt=>{"use strict";p();Object.defineProperty(pEt,"__esModule",{value:!0});pEt.JavaScriptTypeBuilder=void 0;var eZa=CRr(),tZa=a_t(),rZa=Aye(),nZa=PLe(),iZa=Cye(),oZa=yye(),sZa=w_t(),aZa=DLe(),cZa=L$(),lZa=j_t(),uZa=H_t(),dZa=Sye(),fZa=eEt(),pZa=wLe(),hZa=rEt(),mZa=iEt(),gZa=MLe(),AZa=LLe(),yZa=OLe(),_Za=lEt(),bRr=class extends eZa.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,tZa.Argument)(e)}AsyncIterator(e,r){return(0,rZa.AsyncIterator)(e,r)}Awaited(e,r){return(0,nZa.Awaited)(e,r)}BigInt(e){return(0,iZa.BigInt)(e)}ConstructorParameters(e,r){return(0,sZa.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,oZa.Constructor)(e,r,n)}Date(e={}){return(0,aZa.Date)(e)}Function(e,r,n){return(0,cZa.Function)(e,r,n)}InstanceType(e,r){return(0,lZa.InstanceType)(e,r)}Instantiate(e,r){return(0,uZa.Instantiate)(e,r)}Iterator(e,r){return(0,dZa.Iterator)(e,r)}Parameters(e,r){return(0,fZa.Parameters)(e,r)}Promise(e,r){return(0,pZa.Promise)(e,r)}RegExp(e,r){return(0,hZa.RegExp)(e,r)}ReturnType(e,r){return(0,mZa.ReturnType)(e,r)}Symbol(e){return(0,gZa.Symbol)(e)}Undefined(e){return(0,yZa.Undefined)(e)}Uint8Array(e){return(0,AZa.Uint8Array)(e)}Void(e){return(0,_Za.Void)(e)}};pEt.JavaScriptTypeBuilder=bRr});var w4i=I(xS=>{"use strict";p();var EZa=xS&&xS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vZa=xS&&xS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),CZa=xS&&xS.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var xZa=nn&&nn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),En=nn&&nn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xZa(e,t,r)};Object.defineProperty(nn,"__esModule",{value:!0});En(pIr(),nn);En(Q6(),nn);En(Gf(),nn);En(CIr(),nn);En(RMi(),nn);En(_Le(),nn);En(hye(),nn);En(ELe(),nn);En(Tn(),nn);En(mye(),nn);En(gye(),nn);En(a_t(),nn);En(Aye(),nn);En(PLe(),nn);En(Cye(),nn);En(bLe(),nn);En(T_t(),nn);En(x_t(),nn);En(yye(),nn);En(w_t(),nn);En(DLe(),nn);En(R_t(),nn);En(F_t(),nn);En(one(),nn);En(q_t(),nn);En(L$(),nn);En($D(),nn);En(j_t(),nn);En(H_t(),nn);En(G_t(),nn);En(TI(),nn);En(Sye(),nn);En(W_t(),nn);En(VD(),nn);En(nE(),nn);En(Z_t(),nn);En(Um(),nn);En(Fm(),nn);En(X_t(),nn);En(NLe(),nn);En(B$(),nn);En(Wv(),nn);En(ULe(),nn);En(SL(),nn);En(eEt(),nn);En(qLe(),nn);En(QLe(),nn);En(wLe(),nn);En(q$(),nn);En(FLe(),nn);En(Rye(),nn);En(tEt(),nn);En(H$(),nn);En(rEt(),nn);En(jLe(),nn);En(nEt(),nn);En(iEt(),nn);En(y4i(),nn);En(v4i(),nn);En(F$(),nn);En(MLe(),nn);En(GD(),nn);En(cEt(),nn);En($6(),nn);En(LLe(),nn);En(OLe(),nn);En(Op(),nn);En(G$(),nn);En($Le(),nn);En(lEt(),nn);En(w4i(),nn)});var k4i=I(sk=>{"use strict";p();var wZa=sk&&sk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RZa=sk&&sk.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kZa=sk&&sk.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var DZa=RL&&RL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NZa=RL&&RL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),MZa=RL&&RL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(mEt,"__esModule",{value:!0});mEt.ContextItemOrigin=void 0;var N4i;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(N4i||(mEt.ContextItemOrigin=N4i={}))});var L4i=I(Hu=>{"use strict";p();Object.defineProperty(Hu,"__esModule",{value:!0});Hu.RangeSchema=Hu.WorkspaceFolder=Hu.VersionedTextDocumentIdentifier=Hu.TextEdit=Hu.TextDocumentItem=Hu.Range=Hu.Position=Hu.DocumentUri=Hu.Disposable=Hu.Command=Hu.CancellationTokenSource=Hu.CancellationToken=void 0;var gEt=hEt(),KD=ii();Object.defineProperty(Hu,"CancellationToken",{enumerable:!0,get:a(function(){return KD.CancellationToken},"get")});Object.defineProperty(Hu,"CancellationTokenSource",{enumerable:!0,get:a(function(){return KD.CancellationTokenSource},"get")});Object.defineProperty(Hu,"Command",{enumerable:!0,get:a(function(){return KD.Command},"get")});Object.defineProperty(Hu,"Disposable",{enumerable:!0,get:a(function(){return KD.Disposable},"get")});Object.defineProperty(Hu,"DocumentUri",{enumerable:!0,get:a(function(){return KD.DocumentUri},"get")});Object.defineProperty(Hu,"Position",{enumerable:!0,get:a(function(){return KD.Position},"get")});Object.defineProperty(Hu,"Range",{enumerable:!0,get:a(function(){return KD.Range},"get")});Object.defineProperty(Hu,"TextDocumentItem",{enumerable:!0,get:a(function(){return KD.TextDocumentItem},"get")});Object.defineProperty(Hu,"TextEdit",{enumerable:!0,get:a(function(){return KD.TextEdit},"get")});Object.defineProperty(Hu,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return KD.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(Hu,"WorkspaceFolder",{enumerable:!0,get:a(function(){return KD.WorkspaceFolder},"get")});var O4i=gEt.Type.Object({line:gEt.Type.Integer({minimum:0}),character:gEt.Type.Integer({minimum:0})});Hu.RangeSchema=gEt.Type.Object({start:O4i,end:O4i})});var F4i=I(B4i=>{"use strict";p();Object.defineProperty(B4i,"__esModule",{value:!0})});var WLe=I($f=>{"use strict";p();var LZa=$f&&$f.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),VLe=$f&&$f.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LZa(e,t,r)};Object.defineProperty($f,"__esModule",{value:!0});$f.TextEdit=$f.Range=$f.Position=$f.Disposable=$f.CancellationTokenSource=$f.CancellationToken=void 0;var Dye=ii();Object.defineProperty($f,"CancellationToken",{enumerable:!0,get:a(function(){return Dye.CancellationToken},"get")});Object.defineProperty($f,"CancellationTokenSource",{enumerable:!0,get:a(function(){return Dye.CancellationTokenSource},"get")});Object.defineProperty($f,"Disposable",{enumerable:!0,get:a(function(){return Dye.Disposable},"get")});Object.defineProperty($f,"Position",{enumerable:!0,get:a(function(){return Dye.Position},"get")});Object.defineProperty($f,"Range",{enumerable:!0,get:a(function(){return Dye.Range},"get")});Object.defineProperty($f,"TextEdit",{enumerable:!0,get:a(function(){return Dye.TextEdit},"get")});VLe(k4i(),$f);VLe(D4i(),$f);VLe(M4i(),$f);VLe(L4i(),$f);VLe(F4i(),$f)});var TRr=I(II=>{"use strict";p();var BZa=II&&II.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},U4i=II&&II.__param||function(t,e){return function(r,n){e(r,n,t)}},FZa=II&&II.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(II,"__esModule",{value:!0});II.CompletionNotifier=II.ICompletionsNotifierService=void 0;var UZa=FZa(require("events")),QZa=an(),qZa=yre(),jZa=WLe(),HZa=nA(),GZa=cLe(),AEt="CompletionRequested";II.ICompletionsNotifierService=(0,QZa.createServiceIdentifier)("ICompletionsNotifierService");var SRr=class{static{a(this,"CompletionNotifier")}#e=new UZa.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(AEt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,HZa.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${AEt}`);return this.#e.on(AEt,r),jZa.Disposable.create(()=>this.#e.off(AEt,r))}};II.CompletionNotifier=SRr;II.CompletionNotifier=SRr=BZa([U4i(0,GZa.ICompletionsPromiseQueueService),U4i(1,qZa.ICompletionsTelemetryService)],SRr)});var IRr=I(yEt=>{"use strict";p();Object.defineProperty(yEt,"__esModule",{value:!0});yEt.ICompletionsObservableWorkspace=void 0;var $Za=Ks();yEt.ICompletionsObservableWorkspace=(0,$Za.createDecorator)("ICompletionsObservableWorkspace")});var Gl=I(JD=>{"use strict";p();Object.defineProperty(JD,"__esModule",{value:!0});JD.logger=JD.Logger=JD.ICompletionsLogTargetService=JD.LogLevel=void 0;var VZa=an(),WZa=yre(),zZa=nA(),Ine;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(Ine||(JD.LogLevel=Ine={}));JD.ICompletionsLogTargetService=(0,VZa.createServiceIdentifier)("ICompletionsLogTargetService");var _Et=class{static{a(this,"Logger")}constructor(e){this.category=e}log(e,r,...n){e.logIt(r,this.category,...n)}debug(e,...r){this.log(e,Ine.DEBUG,...r)}info(e,...r){this.log(e,Ine.INFO,...r)}warn(e,...r){this.log(e,Ine.WARN,...r)}error(e,...r){this.log(e,Ine.ERROR,...r)}exception(e,r,n){if(r instanceof Error&&r.name==="Canceled"&&r.message==="Canceled")return;let o=n;n.startsWith(".")&&(o=n.substring(1),n=`${this.category}${n}`),(0,zZa.telemetryException)(e.get(WZa.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(JD.ICompletionsLogTargetService),Ine.ERROR,`${o}:`,s)}};JD.Logger=_Et;JD.logger=new _Et("default")});var q4i=I(z$=>{"use strict";p();Object.defineProperty(z$,"__esModule",{value:!0});z$.INotificationService=z$.NullNotificationService=z$.ProgressLocation=void 0;var YZa=an(),KZa=S2(),Q4i;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(Q4i||(z$.ProgressLocation=Q4i={}));var xRr=class{static{a(this,"NullNotificationService")}showInformationMessage(e,r,...n){return Promise.resolve(void 0)}showWarningMessage(e,...r){return Promise.resolve(void 0)}showQuotaExceededDialog(e){return Promise.resolve()}withProgress(e,r){return Promise.resolve(r({report:a(()=>{},"report")},KZa.CancellationToken.None))}};z$.NullNotificationService=xRr;z$.INotificationService=(0,YZa.createServiceIdentifier)("INotificationService")});var RRr=I(ZD=>{"use strict";p();var JZa=ZD&&ZD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ZZa=ZD&&ZD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ZD,"__esModule",{value:!0});ZD.ExtensionNotificationSender=ZD.ICompletionsNotificationSender=void 0;var XZa=q4i(),eXa=an();ZD.ICompletionsNotificationSender=(0,eXa.createServiceIdentifier)("ICompletionsNotificationSender");var wRr=class{static{a(this,"ExtensionNotificationSender")}constructor(e){this.notificationService=e}async showWarningMessage(e,...r){let n=await this.notificationService.showWarningMessage(e,...r.map(o=>o.title));if(n!==void 0)return{title:n}}};ZD.ExtensionNotificationSender=wRr;ZD.ExtensionNotificationSender=wRr=JZa([ZZa(0,XZa.INotificationService)],wRr)});var DRr=I(XD=>{"use strict";p();var tXa=XD&&XD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},kRr=XD&&XD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(XD,"__esModule",{value:!0});XD.UserErrorNotifier=XD.ICompletionsUserErrorNotifierService=void 0;var rXa=FD(),nXa=an(),iXa=hd(),G4i=Gl(),oXa=RRr(),sXa=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],j4i="Your proxy connection requires a trusted certificate. Please make sure the proxy certificate and any issuers are configured correctly and trusted by your operating system.",H4i="https://gh.io/copilot-network-errors";XD.ICompletionsUserErrorNotifierService=(0,nXa.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var PRr=class{static{a(this,"UserErrorNotifier")}constructor(e,r,n){this._logTarget=e,this._notificationSender=r,this._env=n,this.notifiedErrorCodes=[]}notifyUser(e){if(!(e instanceof Error))return;let r=e;r.code&&sXa.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new G4i.Logger("certificates").error(this._logTarget,`${j4i} Please visit ${H4i} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(j4i,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(iXa.URI.parse(H4i))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};XD.UserErrorNotifier=PRr;XD.UserErrorNotifier=PRr=tXa([kRr(0,G4i.ICompletionsLogTargetService),kRr(1,oXa.ICompletionsNotificationSender),kRr(2,rXa.IEnvService)],PRr)});var Rh=I(Nye=>{"use strict";p();Object.defineProperty(Nye,"__esModule",{value:!0});Nye.NullExperimentationService=Nye.IExperimentationService=void 0;var aXa=an(),cXa=Fc();Nye.IExperimentationService=(0,aXa.createServiceIdentifier)("IExperimentationService");var NRr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new cXa.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};Nye.NullExperimentationService=NRr});var Y$=I(wS=>{"use strict";p();Object.defineProperty(wS,"__esModule",{value:!0});wS.DEFAULT_PROMPT_ALLOCATION_PERCENT=wS.DEFAULT_SUFFIX_MATCH_THRESHOLD=wS.DEFAULT_NUM_SNIPPETS=wS.DEFAULT_MAX_PROMPT_LENGTH=wS.DEFAULT_MAX_COMPLETION_LENGTH=void 0;wS.normalizeLanguageId=uXa;wS.DEFAULT_MAX_COMPLETION_LENGTH=500;wS.DEFAULT_MAX_PROMPT_LENGTH=8192-wS.DEFAULT_MAX_COMPLETION_LENGTH;wS.DEFAULT_NUM_SNIPPETS=4;wS.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;wS.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var lXa={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function uXa(t){return t=t.toLowerCase(),lXa[t]??t}a(uXa,"normalizeLanguageId")});var $4i=I(MRr=>{"use strict";p();Object.defineProperty(MRr,"__esModule",{value:!0});MRr.getUserKind=fXa;function dXa(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(dXa,"findKnownOrg");function fXa(t){let e=t.organizationList??[];return dXa(e)??""}a(fXa,"getUserKind")});var zLe=I(kL=>{"use strict";p();Object.defineProperty(kL,"__esModule",{value:!0});kL.IEndpointProvider=kL.ModelSupportedEndpoint=void 0;kL.isEndpointEditToolName=mXa;kL.isChatModelInformation=gXa;kL.isEmbeddingModelInformation=AXa;kL.isCompletionModelInformation=yXa;var pXa=an(),hXa=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function mXa(t){return hXa.has(t)}a(mXa,"isEndpointEditToolName");var V4i;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(V4i||(kL.ModelSupportedEndpoint=V4i={}));function gXa(t){return t.capabilities.type==="chat"}a(gXa,"isChatModelInformation");function AXa(t){return t.capabilities.type==="embeddings"}a(AXa,"isEmbeddingModelInformation");function yXa(t){return t.capabilities.type==="completion"}a(yXa,"isCompletionModelInformation");kL.IEndpointProvider=(0,pXa.createServiceIdentifier)("IEndpointProvider")});var z4i=I(ORr=>{"use strict";p();Object.defineProperty(ORr,"__esModule",{value:!0});ORr.getUserSelectedModelConfiguration=_Xa;var W4i=eE();function _Xa(t){let e=(0,W4i.getConfig)(t,W4i.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(_Xa,"getUserSelectedModelConfiguration")});var Y4i=I(DL=>{"use strict";p();Object.defineProperty(DL,"__esModule",{value:!0});DL.bytePairEncode=DL.BinaryMap=DL.binaryMapKey=void 0;var EXa=a((t,e,r)=>{let n=r-e,o=16777215>>>Math.max(0,(3-n)*8),s=(t[e+0]|t[e+1]<<8|t[e+2]<<16)&o,c=16777215>>>Math.min(31,Math.max(0,(6-n)*8)),l=(t[e+3]|t[e+4]<<8|t[e+5]<<16)&c;return s+16777216*l},"binaryMapKey");DL.binaryMapKey=EXa;var LRr=class t{static{a(this,"BinaryMap")}constructor(){this.nested=new Map,this.final=new Map}get(e,r=0,n=e.length){let o=n<6+r,s=(0,DL.binaryMapKey)(e,r,n);return o?this.final.get(s):this.nested.get(s)?.get(e,6+r,n)}set(e,r){let n=(0,DL.binaryMapKey)(e,0,e.length);if(e.length<6){this.final.set(n,r);return}let s=this.nested.get(n);if(s instanceof t)s.set(e.subarray(6),r);else{let c=new t;c.set(e.subarray(6),r),this.nested.set(n,c)}}};DL.BinaryMap=LRr;var PL=new Int32Array(128),Zv=new Int32Array(128);function vXa(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;PL.length0&&(PL[Zv[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(EEt,"__esModule",{value:!0});EEt.makeTextEncoder=void 0;var BRr=class{static{a(this,"UniversalTextEncoder")}constructor(){this.length=0,this.encoder=new TextEncoder}encode(e){let r=this.encoder.encode(e);return this.length=r.length,r}},FRr=class{static{a(this,"NodeTextEncoder")}constructor(){this.buffer=Buffer.alloc(256),this.length=0}encode(e){for(;;){if(this.length=this.buffer.write(e,"utf8"),this.lengthtypeof Buffer<"u"?new FRr:new BRr,"makeTextEncoder");EEt.makeTextEncoder=CXa});var J4i=I(vEt=>{"use strict";p();Object.defineProperty(vEt,"__esModule",{value:!0});vEt.LRUCache=void 0;var URr=class{static{a(this,"LRUCache")}constructor(e){this.size=e,this.nodes=new Map}get(e){let r=this.nodes.get(e);if(r)return this.moveToHead(r),r.value}set(e,r){let n=this.nodes.get(e);if(n)n.value=r,this.moveToHead(n);else{let o=new QRr(e,r);this.nodes.set(e,o),this.addNode(o),this.nodes.size>this.size&&(this.nodes.delete(this.tail.key),this.removeNode(this.tail))}}moveToHead(e){this.removeNode(e),e.next=void 0,e.prev=void 0,this.addNode(e)}addNode(e){this.head&&(this.head.prev=e,e.next=this.head),this.tail||(this.tail=e),this.head=e}removeNode(e){e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev}};vEt.LRUCache=URr;var QRr=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var jRr=I(bEt=>{"use strict";p();Object.defineProperty(bEt,"__esModule",{value:!0});bEt.TikTokenizer=void 0;var CEt=Y4i(),bXa=K4i(),SXa=J4i();function TXa(t){let e=new Map;try{let o=require("fs").readFileSync(t,"utf-8");return r(o),e}catch(n){throw new Error(`Failed to load from BPE encoder file stream: ${n}`)}function r(n){for(let o of n.split(/[\r\n]+/)){if(o.trim()==="")continue;let s=o.split(" ");if(s.length!==2)throw new Error("Invalid format in the BPE encoder file stream");let c=new Uint8Array(Buffer.from(s[0],"base64")),l=parseInt(s[1]);if(!isNaN(l))e.set(c,l);else throw new Error(`Can't parse ${s[1]} to integer`)}}a(r,"processBpeRanks")}a(TXa,"loadTikTokenBpe");function IXa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(IXa,"escapeRegExp");var qRr=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,bXa.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new SXa.LRUCache(o);let s=typeof e=="string"?TXa(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new CEt.BinaryMap;for(let[o,s]of e)this.encoder.set(o,s);this.regex=new RegExp(n,"gu"),this.specialTokensRegex=new RegExp(Array.from(r.keys()).map(o=>IXa(o)).join("|")),this.specialTokensEncoder=r,this.decoder=new Map;for(let[o,s]of e)this.decoder.set(s,o);if(e.size!==this.decoder.size)throw new Error("Encoder and decoder sizes do not match");this.specialTokensDecoder=new Map;for(let[o,s]of r)this.specialTokensDecoder.set(s,o)}findNextSpecialToken(e,r,n){let o=r,s=null;if(n&&this.specialTokensRegex)for(;s=e.slice(o).match(this.specialTokensRegex),!(!s||n&&n.includes(s[0]));)o+=s.index+1;let c=s?o+s.index:e.length;return[s,c]}encode(e,r){let n=[],o=0;for(;;){let s,c;if([s,c]=this.findNextSpecialToken(e,o,r),c>o&&this.encodeByIndex(e,n,o,c),s){if(o=o+this.encodeSpecialToken(n,s),o>=e.length)break}else break}return n}encodeSpecialToken(e,r){let n=this.specialTokensEncoder?.get(r[0]);return e.push(n),r.index+r[0].length}encodeByIndex(e,r,n,o){let s,c=e.substring(n,o);for(this.regex.lastIndex=0;s=this.regex.exec(c);){let l=this.cache.get(s[0]);if(l)for(let u of l)r.push(u);else{let u=this.textEncoder.encode(s[0]),d=this.encoder.get(u,0,this.textEncoder.length);if(d!==void 0)r.push(d),this.cache.set(s[0],[d]);else{let f=(0,CEt.bytePairEncode)(u,this.encoder,this.textEncoder.length);for(let h of f)r.push(h);this.cache.set(s[0],f)}}}}encodeTrimSuffixByIndex(e,r,n,o,s,c,l){let u,d=e.substring(n,o);for(this.regex.lastIndex=0;u=this.regex.exec(d);){let f=u[0],h=this.cache.get(f);if(h)if(c+h.length<=s)c+=h.length,l+=f.length,r.push(...h);else{let m=s-c;c+=m,l+=f.length,r.push(...h.slice(0,m));break}else{let m=this.textEncoder.encode(f),g=this.encoder.get(m,0,m.length);if(g!==void 0)if(this.cache.set(f,[g]),c+1<=s)c++,l+=f.length,r.push(g);else break;else{let A=(0,CEt.bytePairEncode)(m,this.encoder,this.textEncoder.length);if(this.cache.set(f,A),c+A.length<=s){c+=A.length,l+=f.length;for(let y of A)r.push(y)}else{let y=s-c;c+=y,l+=f.length;for(let _=0;_=s)break}return{tokenCount:c,encodeLength:l}}encodeTrimSuffix(e,r,n){let o=[],s=0,c=0,l=0;for(;;){let d,f;if([d,f]=this.findNextSpecialToken(e,s,n),f>s){let{tokenCount:h,encodeLength:m}=this.encodeTrimSuffixByIndex(e,o,s,f,r,c,l);if(c=h,l=m,c>=r)break}if(d!==null){if(c++,c<=r&&(s=s+this.encodeSpecialToken(o,d),l+=d[0].length,s>=e.length)||c>=r)break}else break}let u=l===e.length?e:e.slice(0,l);return{tokenIds:o,text:u}}encodeTrimPrefix(e,r,n){let o=[],s=0,c=0,l=0,u=new Map;for(u.set(c,l);;){let m,g;if([m,g]=this.findNextSpecialToken(e,s,n),g>s){let A,y=e.substring(s,g);for(this.regex.lastIndex=0;A=this.regex.exec(y);){let _=A[0],E=this.cache.get(_);if(E)c+=E.length,l+=_.length,o.push(...E),u.set(c,l);else{let v=this.textEncoder.encode(_),S=this.encoder.get(v);if(S!==void 0)this.cache.set(_,[S]),c++,l+=_.length,o.push(S),u.set(c,l);else{let T=(0,CEt.bytePairEncode)(v,this.encoder,this.textEncoder.length);this.cache.set(_,T),c+=T.length,l+=_.length;for(let w of T)o.push(w);u.set(c,l)}}}}if(m!==null){if(s=s+this.encodeSpecialToken(o,m),c++,l+=m[0].length,u.set(c,l),s>=e.length)break}else break}if(c<=r)return{tokenIds:o,text:e};let d=c-r,f=0,h=0;for(let[m,g]of u)if(m>=d){f=m,h=g;break}if(f>r){let m=this.encode(e,n),g=m.slice(m.length-r);return{tokenIds:g,text:this.decode(g)}}return{tokenIds:o.slice(f),text:e.slice(h)}}decode(e){let r=[];for(let n of e){let o=[],s=this.decoder?.get(n);if(s!==void 0)o=Array.from(s);else{let c=this.specialTokensDecoder?.get(n);if(c!==void 0){let l=this.textEncoder.encode(c);o=Array.from(l.subarray(0,this.textEncoder.length))}}r.push(...o)}return this.textDecoder.decode(new Uint8Array(r))}};bEt.TikTokenizer=qRr});var aLi=I(jm=>{"use strict";p();Object.defineProperty(jm,"__esModule",{value:!0});jm.createTokenizer=jm.createByEncoderName=jm.createByModelName=jm.getRegexByModel=jm.getRegexByEncoder=jm.getSpecialTokensByModel=jm.getSpecialTokensByEncoder=jm.MODEL_TO_ENCODING=void 0;var xXa=jRr(),wXa=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);jm.MODEL_TO_ENCODING=new Map([["gpt-4o","o200k_base"],["gpt-4","cl100k_base"],["gpt-3.5-turbo","cl100k_base"],["text-davinci-003","p50k_base"],["text-davinci-002","p50k_base"],["text-davinci-001","r50k_base"],["text-curie-001","r50k_base"],["text-babbage-001","r50k_base"],["text-ada-001","r50k_base"],["davinci","r50k_base"],["curie","r50k_base"],["babbage","r50k_base"],["ada","r50k_base"],["code-davinci-002","p50k_base"],["code-davinci-001","p50k_base"],["code-cushman-002","p50k_base"],["code-cushman-001","p50k_base"],["davinci-codex","p50k_base"],["cushman-codex","p50k_base"],["text-davinci-edit-001","p50k_edit"],["code-davinci-edit-001","p50k_edit"],["text-embedding-ada-002","cl100k_base"],["text-similarity-davinci-001","r50k_base"],["text-similarity-curie-001","r50k_base"],["text-similarity-babbage-001","r50k_base"],["text-similarity-ada-001","r50k_base"],["text-search-davinci-doc-001","r50k_base"],["text-search-curie-doc-001","r50k_base"],["text-search-babbage-doc-001","r50k_base"],["text-search-ada-doc-001","r50k_base"],["code-search-babbage-code-001","r50k_base"],["code-search-ada-code-001","r50k_base"],["gpt2","gpt2"]]);var SEt="<|endoftext|>",Z4i="<|fim_prefix|>",X4i="<|fim_middle|>",eLi="<|fim_suffix|>",tLi="<|endofprompt|>",YLe="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",rLi="(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)|[^\\r\\n\\p{L}\\p{N}]?\\p{L}+|\\p{N}{1,3}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",RXa=[`[^\r \\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]*[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]+(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)?`,`[^\r -\\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]+[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]*(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)?`,"\\p{N}{1,3}"," ?[^\\s\\p{L}\\p{N}]+[\\r\\n/]*","\\s*[\\r\\n]+","\\s+(?!\\S)","\\s+"],tLi=xXa.join("|");function jRr(t){let e="";if(qm.MODEL_TO_ENCODING.has(t))e=qm.MODEL_TO_ENCODING.get(t);else for(let[r,n]of IXa)if(t.startsWith(r)){e=n;break}return e}a(jRr,"getEncoderFromModelName");async function wXa(t,e){let r=require("fs"),n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch file from ${t}. Status code: ${n.status}`);let o=await n.text();r.writeFileSync(e,o)}a(wXa,"fetchAndSaveFile");function HRr(t){let e=new Map([[bEt,50256]]);switch(t){case"o200k_base":e=new Map([[bEt,199999],[X4i,200018]]);break;case"cl100k_base":e=new Map([[bEt,100257],[K4i,100258],[J4i,100259],[Z4i,100260],[X4i,100276]]);break;case"p50k_edit":e=new Map([[bEt,50256],[K4i,50281],[J4i,50282],[Z4i,50283]]);break;default:break}return e}a(HRr,"getSpecialTokensByEncoder");qm.getSpecialTokensByEncoder=HRr;function RXa(t){let e=jRr(t);return HRr(e)}a(RXa,"getSpecialTokensByModel");qm.getSpecialTokensByModel=RXa;function rLi(t){switch(t){case"o200k_base":return tLi;case"cl100k_base":return eLi;default:break}return YLe}a(rLi,"getRegexByEncoder");qm.getRegexByEncoder=rLi;function kXa(t){let e=jRr(t);return rLi(e)}a(kXa,"getRegexByModel");qm.getRegexByModel=kXa;async function PXa(t,e=null){return nLi(jRr(t),e)}a(PXa,"createByModelName");qm.createByModelName=PXa;async function nLi(t,e=null){let r,n,o=HRr(t);switch(t){case"o200k_base":r=tLi,n="https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken";break;case"cl100k_base":r=eLi,n="https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken";break;case"p50k_base":r=YLe,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"p50k_edit":r=YLe,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"r50k_base":r=YLe,n="https://openaipublic.blob.core.windows.net/encodings/r50k_base.tiktoken";break;case"gpt2":r=YLe,n="https://raw.githubusercontent.com/microsoft/Tokenizer/main/model/gpt2.tiktoken";break;default:throw new Error(`Doesn't support this encoder [${t}]`)}e!==null&&(o=new Map([...o,...e]));let s=require("fs"),c=require("path"),l=c.basename(n),u=c.resolve(__dirname,"..","model");s.existsSync(u)||s.mkdirSync(u,{recursive:!0});let d=c.resolve(u,l);return s.existsSync(d)||(console.log(`Downloading file from ${n}`),await wXa(n,d),console.log(`Saved file to ${d}`)),iLi(d,o,r)}a(nLi,"createByEncoderName");qm.createByEncoderName=nLi;function iLi(t,e,r,n=8192){return new TXa.TikTokenizer(t,e,r,n)}a(iLi,"createTokenizer");qm.createTokenizer=iLi});var GRr=I(jm=>{"use strict";p();Object.defineProperty(jm,"__esModule",{value:!0});jm.createTokenizer=jm.createByEncoderName=jm.createByModelName=jm.getSpecialTokensByModel=jm.getSpecialTokensByEncoder=jm.getRegexByModel=jm.getRegexByEncoder=jm.MODEL_TO_ENCODING=jm.TikTokenizer=void 0;var DXa=qRr();Object.defineProperty(jm,"TikTokenizer",{enumerable:!0,get:a(function(){return DXa.TikTokenizer},"get")});var Y$=oLi();Object.defineProperty(jm,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return Y$.MODEL_TO_ENCODING},"get")});Object.defineProperty(jm,"getRegexByEncoder",{enumerable:!0,get:a(function(){return Y$.getRegexByEncoder},"get")});Object.defineProperty(jm,"getRegexByModel",{enumerable:!0,get:a(function(){return Y$.getRegexByModel},"get")});Object.defineProperty(jm,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return Y$.getSpecialTokensByEncoder},"get")});Object.defineProperty(jm,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return Y$.getSpecialTokensByModel},"get")});Object.defineProperty(jm,"createByModelName",{enumerable:!0,get:a(function(){return Y$.createByModelName},"get")});Object.defineProperty(jm,"createByEncoderName",{enumerable:!0,get:a(function(){return Y$.createByEncoderName},"get")});Object.defineProperty(jm,"createTokenizer",{enumerable:!0,get:a(function(){return Y$.createTokenizer},"get")})});var aLi=I(Py=>{"use strict";p();Object.defineProperty(Py,"__esModule",{value:!0});Py.isReadable=MXa;Py.isReadableStream=sLi;Py.isReadableBufferedStream=OXa;Py.newWriteableStream=KLe;Py.consumeReadable=LXa;Py.peekReadable=BXa;Py.consumeStream=FXa;Py.listenStream=TEt;Py.peekStream=UXa;Py.toStream=QXa;Py.emptyStream=qXa;Py.toReadable=jXa;Py.transform=HXa;Py.prefixedReadable=GXa;Py.prefixedStream=$Xa;var NXa=Os(),SEt=Po();function MXa(t){let e=t;return e?typeof e.read=="function":!1}a(MXa,"isReadable");function sLi(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(sLi,"isReadableStream");function OXa(t){let e=t;return e?sLi(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a(OXa,"isReadableBufferedStream");function KLe(t,e){return new $Rr(t,e)}a(KLe,"newWriteableStream");var $Rr=class{static{a(this,"WriteableStreamImpl")}constructor(e,r){this.reducer=e,this.options=r,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(r=>this.pendingWritePromises.push(r))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(typeof e<"u"&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(r=>r(e))}emitError(e){this.listeners.error.length===0?(0,NXa.onUnexpectedError)(e):this.listeners.error.slice(0).forEach(r=>r(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,r){if(!this.state.destroyed)switch(e){case"data":this.listeners.data.push(r),this.resume();break;case"end":this.listeners.end.push(r),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(r),this.state.flowing&&this.flowErrors();break}}removeListener(e,r){if(this.state.destroyed)return;let n;switch(e){case"data":n=this.listeners.data;break;case"end":n=this.listeners.end;break;case"error":n=this.listeners.error;break}if(n){let o=n.indexOf(r);o>=0&&n.splice(o,1)}}flowData(){if(this.buffer.data.length===0)return;if(typeof this.reducer=="function"){let r=this.reducer(this.buffer.data);this.emitData(r)}else for(let r of this.buffer.data)this.emitData(r);this.buffer.data.length=0;let e=[...this.pendingWritePromises];this.pendingWritePromises.length=0,e.forEach(r=>r())}flowErrors(){if(this.listeners.error.length>0){for(let e of this.buffer.error)this.emitError(e);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}};function LXa(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(LXa,"consumeReadable");function BXa(t,e,r){let n=[],o;for(;(o=t.read())!==null&&n.length0?e(n):{read:a(()=>{if(n.length>0)return n.shift();if(typeof o<"u"){let s=o;return o=void 0,s}return t.read()},"read")}}a(BXa,"peekReadable");function FXa(t,e){return new Promise((r,n)=>{let o=[];TEt(t,{onData:a(s=>{e&&o.push(s)},"onData"),onError:a(s=>{e?n(s):r(void 0)},"onError"),onEnd:a(()=>{r(e?e(o):void 0)},"onEnd")})})}a(FXa,"consumeStream");function TEt(t,e,r){t.on("error",n=>{r?.isCancellationRequested||e.onError(n)}),t.on("end",()=>{r?.isCancellationRequested||e.onEnd()}),t.on("data",n=>{r?.isCancellationRequested||e.onData(n)})}a(TEt,"listenStream");function UXa(t,e){return new Promise((r,n)=>{let o=new SEt.DisposableStore,s=[],c=a(d=>{if(s.push(d),s.length>e)return o.dispose(),t.pause(),r({stream:t,buffer:s,ended:!1})},"dataListener"),l=a(d=>(o.dispose(),n(d)),"errorListener"),u=a(()=>(o.dispose(),r({stream:t,buffer:s,ended:!0})),"endListener");o.add((0,SEt.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,SEt.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,SEt.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(UXa,"peekStream");function QXa(t,e){let r=KLe(e);return r.end(t),r}a(QXa,"toStream");function qXa(){let t=KLe(()=>{throw new Error("not supported")});return t.end(),t}a(qXa,"emptyStream");function jXa(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(jXa,"toReadable");function HXa(t,e,r){let n=KLe(r);return TEt(t,{onData:a(o=>n.write(e.data(o)),"onData"),onError:a(o=>n.error(e.error?e.error(o):o),"onError"),onEnd:a(()=>n.end(),"onEnd")}),n}a(HXa,"transform");function GXa(t,e,r){let n=!1;return{read:a(()=>{let o=e.read();return n?o:(n=!0,o!==null?r([t,o]):t)},"read")}}a(GXa,"prefixedReadable");function $Xa(t,e,r){let n=!1,o=KLe(r);return TEt(e,{onData:a(s=>n?o.write(s):(n=!0,o.write(r([t,s]))),"onData"),onError:a(s=>o.error(s),"onError"),onEnd:a(()=>{n||(n=!0,o.write(t)),o.end()},"onEnd")}),o}a($Xa,"prefixedStream")});var J$=I(Pc=>{"use strict";p();var VXa=Pc&&Pc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WXa=Pc&&Pc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zXa=Pc&&Pc.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;onew Uint8Array(256)),VRr,WRr,oE=class t{static{a(this,"VSBuffer")}static alloc(e){return JLe?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return JLe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&JLe?new t(Buffer.from(e)):(VRr||(VRr=new TextEncoder),new t(VRr.encode(e)))}static fromByteArray(e){let r=t.alloc(e.length);for(let n=0,o=e.length;n"u"){r=0;for(let s=0,c=e.length;sr===e.buffer[n])}};Pc.VSBuffer=oE;function uLi(t,e,r=0){let n=e.byteLength,o=t.byteLength;if(n===0)return 0;if(n===1)return t.indexOf(e[0],r);if(n>o-r)return-1;let s=KXa.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(JXa,"readUInt16LE");function ZXa(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(ZXa,"writeUInt16LE");function dLi(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(dLi,"readUInt32BE");function fLi(t,e,r){t[r+3]=e,e=e>>>8,t[r+2]=e,e=e>>>8,t[r+1]=e,e=e>>>8,t[r]=e}a(fLi,"writeUInt32BE");function pLi(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(pLi,"readUInt32LE");function hLi(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255,e=e>>>8,t[r+2]=e&255,e=e>>>8,t[r+3]=e&255}a(hLi,"writeUInt32LE");function mLi(t,e){return t[e]}a(mLi,"readUInt8");function gLi(t,e,r){t[r]=e}a(gLi,"writeUInt8");function XXa(t){return K$.consumeReadable(t,e=>oE.concat(e))}a(XXa,"readableToBuffer");function eec(t){return K$.toReadable(t)}a(eec,"bufferToReadable");function ALi(t){return K$.consumeStream(t,e=>oE.concat(e))}a(ALi,"streamToBuffer");async function tec(t){return t.ended?oE.concat(t.buffer):oE.concat([...t.buffer,await ALi(t.stream)])}a(tec,"bufferedStreamToBuffer");function rec(t){return K$.toStream(t,e=>oE.concat(e))}a(rec,"bufferToStream");function nec(t){return K$.transform(t,{data:a(e=>typeof e=="string"?oE.fromString(e):oE.wrap(e),"data")},e=>oE.concat(e))}a(nec,"streamToBufferReadableStream");function iec(t){return K$.newWriteableStream(e=>oE.concat(e),t)}a(iec,"newWriteableBufferStream");function oec(t,e){return K$.prefixedReadable(t,e,r=>oE.concat(r))}a(oec,"prefixedBufferReadable");function sec(t,e){return K$.prefixedStream(t,e,r=>oE.concat(r))}a(sec,"prefixedBufferStream");function aec(t){let e=0,r=0,n=0,o=new Uint8Array(Math.floor(t.length/4*3)),s=a(l=>{switch(r){case 3:o[n++]=e|l,r=0;break;case 2:o[n++]=e|l>>>2,e=l<<6,r=3;break;case 1:o[n++]=e|l>>>4,e=l<<4,r=2;break;default:e=l<<2,r=1}},"append");for(let l=0;l=65&&u<=90)s(u-65);else if(u>=97&&u<=122)s(u-97+26);else if(u>=48&&u<=57)s(u-48+52);else if(u===43||u===45)s(62);else if(u===47||u===95)s(63);else{if(u===61)break;throw new SyntaxError(`Unexpected base64 character ${t[l]}`)}}let c=n;for(;r>0;)s(0);return oE.wrap(o).slice(0,c)}a(aec,"decodeBase64");var cec="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lec="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function uec({buffer:t},e=!0,r=!1){let n=r?lec:cec,o="",s=t.byteLength%3,c=0;for(;c>>2],o+=n[(l<<4|u>>>4)&63],o+=n[(u<<2|d>>>6)&63],o+=n[d&63]}if(s===1){let l=t[c+0];o+=n[l>>>2],o+=n[l<<4&63],e&&(o+="==")}else if(s===2){let l=t[c+0],u=t[c+1];o+=n[l>>>2],o+=n[(l<<4|u>>>4)&63],o+=n[u<<2&63],e&&(o+="=")}return o}a(uec,"encodeBase64");var cLi="0123456789abcdef";function dec({buffer:t}){let e="";for(let r=0;r>>4],e+=cLi[n&15]}return e}a(dec,"encodeHex");function fec(t){if(t.length%2!==0)throw new SyntaxError("Hex string must have an even length");let e=new Uint8Array(t.length>>1);for(let r=0;r>1]=lLi(t,r++)<<4|lLi(t,r++);return oE.wrap(e)}a(fec,"decodeHex");function lLi(t,e){let r=t.charCodeAt(e);if(r>=48&&r<=57)return r-48;if(r>=97&&r<=102)return r-87;if(r>=65&&r<=70)return r-55;throw new SyntaxError(`Invalid hex character at position ${e}`)}a(lLi,"decodeHexChar")});var yLi=I(IEt=>{"use strict";p();Object.defineProperty(IEt,"__esModule",{value:!0});IEt.readVariableLengthQuantity=hec;IEt.writeVariableLengthQuantity=mec;var pec=J$();function hec(t,e){let r=0,n=0,o;do o=t.readUInt8(e+n),r|=(o&127)<>>=7,t!==0&&(r|=128),e.push(r)}while(t!==0);return pec.VSBuffer.fromByteArray(e)}a(mec,"writeVariableLengthQuantity")});var zRr=I(xEt=>{"use strict";p();Object.defineProperty(xEt,"__esModule",{value:!0});xEt.parseTikTokenBinary=void 0;var gec=require("fs"),Aec=yLi(),yec=J$(),_ec=a(t=>{let e=(0,gec.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(wEt,"__esModule",{value:!0});wEt.CopilotPromptLoadFailure=void 0;var YRr=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};wEt.CopilotPromptLoadFailure=YRr});var JRr=I(ak=>{"use strict";p();var Eec=ak&&ak.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vec=ak&&ak.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Cec=ak&&ak.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(ck,"__esModule",{value:!0});ck.ApproximateTokenizer=ck.TTokenizer=ck.TokenizerName=void 0;ck.setExternalTokenizerProvider=Rec;ck.getTokenizer=kec;ck.ensureTokenizersLoaded=Dec;ck.resetTokenizersForTest=Nec;var ZRr=GRr(),Iec=zRr(),xec=KRr(),wec=JRr(),eN;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(eN||(ck.TokenizerName=eN={}));var Mye=new Map,xne;function Rec(t){xne||NEt||(xne=t)}a(Rec,"setExternalTokenizerProvider");function kec(t=eN.o200k){if(xne)try{return xne.getTokenizer(t)}catch{}let e=Mye.get(t);return e!==void 0||(CLi(),e=Mye.get(eN.o200k),e!==void 0)?e:new DEt}a(kec,"getTokenizer");var kEt=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,ZRr.createTokenizer)((0,Iec.parseTikTokenBinary)((0,wec.locateFile)(`${e}.tiktoken`)),(0,ZRr.getSpecialTokensByEncoder)(e),(0,ZRr.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new xec.CopilotPromptLoadFailure("Could not load tokenizer",r):r}}tokenize(e){return this._tokenizer.encode(e)}detokenize(e){return this._tokenizer.decode(e)}tokenLength(e){return this.tokenize(e).length}tokenizeStrings(e){return this.tokenize(e).map(n=>this.detokenize([n]))}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.length{"use strict";p();Object.defineProperty(Hm,"__esModule",{value:!0});Hm.createTokenizer=Hm.createByEncoderName=Hm.createByModelName=Hm.getSpecialTokensByModel=Hm.getSpecialTokensByEncoder=Hm.getRegexByModel=Hm.getRegexByEncoder=Hm.MODEL_TO_ENCODING=Hm.TikTokenizer=void 0;var MXa=jRr();Object.defineProperty(Hm,"TikTokenizer",{enumerable:!0,get:a(function(){return MXa.TikTokenizer},"get")});var K$=aLi();Object.defineProperty(Hm,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return K$.MODEL_TO_ENCODING},"get")});Object.defineProperty(Hm,"getRegexByEncoder",{enumerable:!0,get:a(function(){return K$.getRegexByEncoder},"get")});Object.defineProperty(Hm,"getRegexByModel",{enumerable:!0,get:a(function(){return K$.getRegexByModel},"get")});Object.defineProperty(Hm,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return K$.getSpecialTokensByEncoder},"get")});Object.defineProperty(Hm,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return K$.getSpecialTokensByModel},"get")});Object.defineProperty(Hm,"createByModelName",{enumerable:!0,get:a(function(){return K$.createByModelName},"get")});Object.defineProperty(Hm,"createByEncoderName",{enumerable:!0,get:a(function(){return K$.createByEncoderName},"get")});Object.defineProperty(Hm,"createTokenizer",{enumerable:!0,get:a(function(){return K$.createTokenizer},"get")})});var lLi=I(Py=>{"use strict";p();Object.defineProperty(Py,"__esModule",{value:!0});Py.isReadable=LXa;Py.isReadableStream=cLi;Py.isReadableBufferedStream=BXa;Py.newWriteableStream=KLe;Py.consumeReadable=FXa;Py.peekReadable=UXa;Py.consumeStream=QXa;Py.listenStream=IEt;Py.peekStream=qXa;Py.toStream=jXa;Py.emptyStream=HXa;Py.toReadable=GXa;Py.transform=$Xa;Py.prefixedReadable=VXa;Py.prefixedStream=WXa;var OXa=Os(),TEt=Po();function LXa(t){let e=t;return e?typeof e.read=="function":!1}a(LXa,"isReadable");function cLi(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(cLi,"isReadableStream");function BXa(t){let e=t;return e?cLi(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a(BXa,"isReadableBufferedStream");function KLe(t,e){return new VRr(t,e)}a(KLe,"newWriteableStream");var VRr=class{static{a(this,"WriteableStreamImpl")}constructor(e,r){this.reducer=e,this.options=r,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(r=>this.pendingWritePromises.push(r))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(typeof e<"u"&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(r=>r(e))}emitError(e){this.listeners.error.length===0?(0,OXa.onUnexpectedError)(e):this.listeners.error.slice(0).forEach(r=>r(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,r){if(!this.state.destroyed)switch(e){case"data":this.listeners.data.push(r),this.resume();break;case"end":this.listeners.end.push(r),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(r),this.state.flowing&&this.flowErrors();break}}removeListener(e,r){if(this.state.destroyed)return;let n;switch(e){case"data":n=this.listeners.data;break;case"end":n=this.listeners.end;break;case"error":n=this.listeners.error;break}if(n){let o=n.indexOf(r);o>=0&&n.splice(o,1)}}flowData(){if(this.buffer.data.length===0)return;if(typeof this.reducer=="function"){let r=this.reducer(this.buffer.data);this.emitData(r)}else for(let r of this.buffer.data)this.emitData(r);this.buffer.data.length=0;let e=[...this.pendingWritePromises];this.pendingWritePromises.length=0,e.forEach(r=>r())}flowErrors(){if(this.listeners.error.length>0){for(let e of this.buffer.error)this.emitError(e);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}};function FXa(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(FXa,"consumeReadable");function UXa(t,e,r){let n=[],o;for(;(o=t.read())!==null&&n.length0?e(n):{read:a(()=>{if(n.length>0)return n.shift();if(typeof o<"u"){let s=o;return o=void 0,s}return t.read()},"read")}}a(UXa,"peekReadable");function QXa(t,e){return new Promise((r,n)=>{let o=[];IEt(t,{onData:a(s=>{e&&o.push(s)},"onData"),onError:a(s=>{e?n(s):r(void 0)},"onError"),onEnd:a(()=>{r(e?e(o):void 0)},"onEnd")})})}a(QXa,"consumeStream");function IEt(t,e,r){t.on("error",n=>{r?.isCancellationRequested||e.onError(n)}),t.on("end",()=>{r?.isCancellationRequested||e.onEnd()}),t.on("data",n=>{r?.isCancellationRequested||e.onData(n)})}a(IEt,"listenStream");function qXa(t,e){return new Promise((r,n)=>{let o=new TEt.DisposableStore,s=[],c=a(d=>{if(s.push(d),s.length>e)return o.dispose(),t.pause(),r({stream:t,buffer:s,ended:!1})},"dataListener"),l=a(d=>(o.dispose(),n(d)),"errorListener"),u=a(()=>(o.dispose(),r({stream:t,buffer:s,ended:!0})),"endListener");o.add((0,TEt.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,TEt.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,TEt.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(qXa,"peekStream");function jXa(t,e){let r=KLe(e);return r.end(t),r}a(jXa,"toStream");function HXa(){let t=KLe(()=>{throw new Error("not supported")});return t.end(),t}a(HXa,"emptyStream");function GXa(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(GXa,"toReadable");function $Xa(t,e,r){let n=KLe(r);return IEt(t,{onData:a(o=>n.write(e.data(o)),"onData"),onError:a(o=>n.error(e.error?e.error(o):o),"onError"),onEnd:a(()=>n.end(),"onEnd")}),n}a($Xa,"transform");function VXa(t,e,r){let n=!1;return{read:a(()=>{let o=e.read();return n?o:(n=!0,o!==null?r([t,o]):t)},"read")}}a(VXa,"prefixedReadable");function WXa(t,e,r){let n=!1,o=KLe(r);return IEt(e,{onData:a(s=>n?o.write(s):(n=!0,o.write(r([t,s]))),"onData"),onError:a(s=>o.error(s),"onError"),onEnd:a(()=>{n||(n=!0,o.write(t)),o.end()},"onEnd")}),o}a(WXa,"prefixedStream")});var Z$=I(Pc=>{"use strict";p();var zXa=Pc&&Pc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YXa=Pc&&Pc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),KXa=Pc&&Pc.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;onew Uint8Array(256)),WRr,zRr,oE=class t{static{a(this,"VSBuffer")}static alloc(e){return JLe?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return JLe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&JLe?new t(Buffer.from(e)):(WRr||(WRr=new TextEncoder),new t(WRr.encode(e)))}static fromByteArray(e){let r=t.alloc(e.length);for(let n=0,o=e.length;n"u"){r=0;for(let s=0,c=e.length;sr===e.buffer[n])}};Pc.VSBuffer=oE;function fLi(t,e,r=0){let n=e.byteLength,o=t.byteLength;if(n===0)return 0;if(n===1)return t.indexOf(e[0],r);if(n>o-r)return-1;let s=ZXa.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(XXa,"readUInt16LE");function eec(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(eec,"writeUInt16LE");function pLi(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(pLi,"readUInt32BE");function hLi(t,e,r){t[r+3]=e,e=e>>>8,t[r+2]=e,e=e>>>8,t[r+1]=e,e=e>>>8,t[r]=e}a(hLi,"writeUInt32BE");function mLi(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(mLi,"readUInt32LE");function gLi(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255,e=e>>>8,t[r+2]=e&255,e=e>>>8,t[r+3]=e&255}a(gLi,"writeUInt32LE");function ALi(t,e){return t[e]}a(ALi,"readUInt8");function yLi(t,e,r){t[r]=e}a(yLi,"writeUInt8");function tec(t){return J$.consumeReadable(t,e=>oE.concat(e))}a(tec,"readableToBuffer");function rec(t){return J$.toReadable(t)}a(rec,"bufferToReadable");function _Li(t){return J$.consumeStream(t,e=>oE.concat(e))}a(_Li,"streamToBuffer");async function nec(t){return t.ended?oE.concat(t.buffer):oE.concat([...t.buffer,await _Li(t.stream)])}a(nec,"bufferedStreamToBuffer");function iec(t){return J$.toStream(t,e=>oE.concat(e))}a(iec,"bufferToStream");function oec(t){return J$.transform(t,{data:a(e=>typeof e=="string"?oE.fromString(e):oE.wrap(e),"data")},e=>oE.concat(e))}a(oec,"streamToBufferReadableStream");function sec(t){return J$.newWriteableStream(e=>oE.concat(e),t)}a(sec,"newWriteableBufferStream");function aec(t,e){return J$.prefixedReadable(t,e,r=>oE.concat(r))}a(aec,"prefixedBufferReadable");function cec(t,e){return J$.prefixedStream(t,e,r=>oE.concat(r))}a(cec,"prefixedBufferStream");function lec(t){let e=0,r=0,n=0,o=new Uint8Array(Math.floor(t.length/4*3)),s=a(l=>{switch(r){case 3:o[n++]=e|l,r=0;break;case 2:o[n++]=e|l>>>2,e=l<<6,r=3;break;case 1:o[n++]=e|l>>>4,e=l<<4,r=2;break;default:e=l<<2,r=1}},"append");for(let l=0;l=65&&u<=90)s(u-65);else if(u>=97&&u<=122)s(u-97+26);else if(u>=48&&u<=57)s(u-48+52);else if(u===43||u===45)s(62);else if(u===47||u===95)s(63);else{if(u===61)break;throw new SyntaxError(`Unexpected base64 character ${t[l]}`)}}let c=n;for(;r>0;)s(0);return oE.wrap(o).slice(0,c)}a(lec,"decodeBase64");var uec="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dec="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function fec({buffer:t},e=!0,r=!1){let n=r?dec:uec,o="",s=t.byteLength%3,c=0;for(;c>>2],o+=n[(l<<4|u>>>4)&63],o+=n[(u<<2|d>>>6)&63],o+=n[d&63]}if(s===1){let l=t[c+0];o+=n[l>>>2],o+=n[l<<4&63],e&&(o+="==")}else if(s===2){let l=t[c+0],u=t[c+1];o+=n[l>>>2],o+=n[(l<<4|u>>>4)&63],o+=n[u<<2&63],e&&(o+="=")}return o}a(fec,"encodeBase64");var uLi="0123456789abcdef";function pec({buffer:t}){let e="";for(let r=0;r>>4],e+=uLi[n&15]}return e}a(pec,"encodeHex");function hec(t){if(t.length%2!==0)throw new SyntaxError("Hex string must have an even length");let e=new Uint8Array(t.length>>1);for(let r=0;r>1]=dLi(t,r++)<<4|dLi(t,r++);return oE.wrap(e)}a(hec,"decodeHex");function dLi(t,e){let r=t.charCodeAt(e);if(r>=48&&r<=57)return r-48;if(r>=97&&r<=102)return r-87;if(r>=65&&r<=70)return r-55;throw new SyntaxError(`Invalid hex character at position ${e}`)}a(dLi,"decodeHexChar")});var ELi=I(xEt=>{"use strict";p();Object.defineProperty(xEt,"__esModule",{value:!0});xEt.readVariableLengthQuantity=gec;xEt.writeVariableLengthQuantity=Aec;var mec=Z$();function gec(t,e){let r=0,n=0,o;do o=t.readUInt8(e+n),r|=(o&127)<>>=7,t!==0&&(r|=128),e.push(r)}while(t!==0);return mec.VSBuffer.fromByteArray(e)}a(Aec,"writeVariableLengthQuantity")});var YRr=I(wEt=>{"use strict";p();Object.defineProperty(wEt,"__esModule",{value:!0});wEt.parseTikTokenBinary=void 0;var yec=require("fs"),_ec=ELi(),Eec=Z$(),vec=a(t=>{let e=(0,yec.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(REt,"__esModule",{value:!0});REt.CopilotPromptLoadFailure=void 0;var KRr=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};REt.CopilotPromptLoadFailure=KRr});var ZRr=I(ak=>{"use strict";p();var Cec=ak&&ak.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bec=ak&&ak.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Sec=ak&&ak.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(ck,"__esModule",{value:!0});ck.ApproximateTokenizer=ck.TTokenizer=ck.TokenizerName=void 0;ck.setExternalTokenizerProvider=Pec;ck.getTokenizer=Dec;ck.ensureTokenizersLoaded=Mec;ck.resetTokenizersForTest=Oec;var XRr=$Rr(),wec=YRr(),Rec=JRr(),kec=ZRr(),eN;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(eN||(ck.TokenizerName=eN={}));var Mye=new Map,wne;function Pec(t){wne||MEt||(wne=t)}a(Pec,"setExternalTokenizerProvider");function Dec(t=eN.o200k){if(wne)try{return wne.getTokenizer(t)}catch{}let e=Mye.get(t);return e!==void 0||(SLi(),e=Mye.get(eN.o200k),e!==void 0)?e:new NEt}a(Dec,"getTokenizer");var PEt=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,XRr.createTokenizer)((0,wec.parseTikTokenBinary)((0,kec.locateFile)(`${e}.tiktoken`)),(0,XRr.getSpecialTokensByEncoder)(e),(0,XRr.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new Rec.CopilotPromptLoadFailure("Could not load tokenizer",r):r}}tokenize(e){return this._tokenizer.encode(e)}detokenize(e){return this._tokenizer.decode(e)}tokenLength(e){return this.tokenize(e).length}tokenizeStrings(e){return this.tokenize(e).map(n=>this.detokenize([n]))}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.length{let r=0;for(let n=0;nr.toString()).join(" ")}tokenizeStrings(e){return e.split(/\b/)}tokenLength(e){return this.tokenizeStrings(e).length}takeLastTokens(e,r){let n=this.tokenizeStrings(e).slice(-r);return{text:n.join(""),tokens:n.map(this.hash)}}takeFirstTokens(e,r){let n=this.tokenizeStrings(e).slice(0,r);return{text:n.join(""),tokens:n.map(this.hash)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` +`);return n.substring(o+1)}};ck.TTokenizer=PEt;var DEt=class{static{a(this,"MockTokenizer")}constructor(){this.hash=e=>{let r=0;for(let n=0;nr.toString()).join(" ")}tokenizeStrings(e){return e.split(/\b/)}tokenLength(e){return this.tokenizeStrings(e).length}takeLastTokens(e,r){let n=this.tokenizeStrings(e).slice(-r);return{text:n.join(""),tokens:n.map(this.hash)}}takeFirstTokens(e,r){let n=this.tokenizeStrings(e).slice(0,r);return{text:n.join(""),tokens:n.map(this.hash)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` `)return n;let o=n.indexOf(` -`);return n.substring(o+1)}},Pec={[eN.cl100k]:{python:3.99,typescript:4.54,typescriptreact:4.58,javascript:4.76,csharp:5.13,java:4.86,cpp:3.85,php:4.1,html:4.57,vue:4.22,go:3.93,dart:5.66,javascriptreact:4.81,css:3.37},[eN.o200k]:{python:4.05,typescript:4.12,typescriptreact:5.01,javascript:4.47,csharp:5.47,java:4.86,cpp:3.8,php:4.35,html:4.86,vue:4.3,go:4.21,dart:5.7,javascriptreact:4.83,css:3.33}},XRr=4,DEt=class{static{a(this,"ApproximateTokenizer")}constructor(e=eN.o200k,r){this.languageId=r,this.tokenizerName=e}tokenize(e){return this.tokenizeStrings(e).map(r=>{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-XRr),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-XRr)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?Pec[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(-Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeFirstTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(0,Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` +`);return n.substring(o+1)}},Nec={[eN.cl100k]:{python:3.99,typescript:4.54,typescriptreact:4.58,javascript:4.76,csharp:5.13,java:4.86,cpp:3.85,php:4.1,html:4.57,vue:4.22,go:3.93,dart:5.66,javascriptreact:4.81,css:3.37},[eN.o200k]:{python:4.05,typescript:4.12,typescriptreact:5.01,javascript:4.47,csharp:5.47,java:4.86,cpp:3.8,php:4.35,html:4.86,vue:4.3,go:4.21,dart:5.7,javascriptreact:4.83,css:3.33}},ekr=4,NEt=class{static{a(this,"ApproximateTokenizer")}constructor(e=eN.o200k,r){this.languageId=r,this.tokenizerName=e}tokenize(e){return this.tokenizeStrings(e).map(r=>{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-ekr),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-ekr)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?Nec[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(-Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeFirstTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(0,Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` `)return n;let o=n.indexOf(` -`);return n.substring(o+1)}};ck.ApproximateTokenizer=DEt;async function vLi(t){try{let e=await kEt.create(t);Mye.set(t,e)}catch{}}a(vLi,"setTokenizer");Mye.set(eN.mock,new PEt);var NEt,REt;function CLi(){if(xne){let t=xne;return REt??=Promise.resolve().then(()=>t.ensureLoaded()).catch(()=>{REt=void 0}),REt}return NEt??=Promise.all([vLi(eN.cl100k),vLi(eN.o200k)]).then(()=>{}),NEt}a(CLi,"loadTokenizers");function Dec(){return CLi()}a(Dec,"ensureTokenizersLoaded");function Nec(){xne=void 0,NEt=void 0,REt=void 0,Mye.clear(),Mye.set(eN.mock,new PEt)}a(Nec,"resetTokenizersForTest")});var Rne=I(wne=>{"use strict";p();var Mec=wne&&wne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Oec=wne&&wne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mec(e,t,r)};Object.defineProperty(wne,"__esModule",{value:!0});Oec(bLi(),wne)});var tkr=I(tN=>{"use strict";p();var Lec=tN&&tN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ZLe=tN&&tN.__param||function(t,e){return function(r,n){e(r,n,t)}},XLe;Object.defineProperty(tN,"__esModule",{value:!0});tN.AvailableModelsManager=tN.ICompletionsModelManagerService=void 0;var Bec=rE(),Fec=zLe(),Uec=an(),Qec=Po(),qec=Ks(),jec=V4i(),Hec=Rne(),Gec=gTr(),$ec=Wyt(),MEt=eE(),Vec=xy(),SLi=Gl();tN.ICompletionsModelManagerService=(0,Uec.createServiceIdentifier)("ICompletionsModelManagerService");var Wec="gpt-41-copilot",ekr=XLe=class extends Qec.Disposable{static{a(this,"AvailableModelsManager")}constructor(e=!0,r,n,o,s,c){super(),this._instantiationService=r,this._featuresService=n,this._endpointProvider=o,this._logService=c,this.fetchedModelData=[],this.customModels=[],this.editorPreviewFeaturesDisabled=!1,this._onDidChangeModels=this._register(new Gec.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,$ec.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=XLe.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return Wec}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=XLe.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return XLe.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:Hec.TokenizerName.o200k}static filterCompletionModels(e,r){return e.filter(n=>n.capabilities.type==="completion").filter(n=>!r||n.preview===!1||n.preview===void 0)}static filterModelsWithEditorPreviewFeatures(e,r){return e.filter(n=>!r||n.preview===!1||n.preview===void 0)}static mapCompletionModels(e){return e.map(r=>({modelId:r.id,label:r.name,preview:!!r.preview,tokenizer:r.capabilities.tokenizer}))}getCurrentModelRequestInfo(e=void 0){let r=this.getDefaultModelId(),n=this._instantiationService.invokeFunction(jec.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(SLi.LogLevel.INFO,`User selected model ${n} is not in the list of generic models: ${l.join(", ")}, falling back to default model.`),n=null),r===n&&(n=null)}let o=this._instantiationService.invokeFunction(MEt.getConfig,MEt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(MEt.getConfig,MEt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new Z$(o,"override");let s=e?this._featuresService.customEngine(e):void 0,c=e?this._featuresService.customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new Z$(s,"exp"):new Z$(n,"modelpicker"):s?new Z$(s,"exp"):this.customModels.length>0?new Z$(this.customModels[0],"custommodel"):new Z$(r,"default")}};tN.AvailableModelsManager=ekr;tN.AvailableModelsManager=ekr=XLe=Lec([ZLe(1,qec.IInstantiationService),ZLe(2,Vec.ICompletionsFeaturesService),ZLe(3,Fec.IEndpointProvider),ZLe(4,Bec.IAuthenticationService),ZLe(5,SLi.ICompletionsLogTargetService)],ekr);var Z$=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var nkr=I(rkr=>{"use strict";p();Object.defineProperty(rkr,"__esModule",{value:!0});rkr.getEngineRequestInfo=Yec;var zec=tkr();function Yec(t,e=void 0){let r=t.get(zec.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(Yec,"getEngineRequestInfo")});var wLi=I(OEt=>{"use strict";p();Object.defineProperty(OEt,"__esModule",{value:!0});OEt.setupCompletionsExperimentationService=etc;OEt.createCompletionsFilters=xLi;var Kec=rE(),Jec=Rh(),Zec=Ks(),TLi=H4i(),X$=eE(),Xec=nkr(),lk=gyt();function etc(t){let e=t.get(Kec.IAuthenticationService),r=t.get(Zec.IInstantiationService),n=e.onDidCopilotTokenChange(()=>{r.invokeFunction(ILi,e.copilotToken)});return ILi(t,e.copilotToken),n}a(etc,"setupCompletionsExperimentationService");function ttc(t){return X$.BuildInfo.getBuildType()===X$.BuildType.NIGHTLY?lk.Release.Nightly:lk.Release.Stable}a(ttc,"getPluginRelease");function ILi(t,e){let r=t.get(Jec.IExperimentationService),n=xLi(t,e);r.setCompletionsFilters(n)}a(ILi,"updateCompletionsFilters");function xLi(t,e){let r=new Map;if(r.set(lk.Filter.ExtensionRelease,ttc(t)),r.set(lk.Filter.CopilotOverrideEngine,(0,X$.getConfig)(t,X$.ConfigKey.DebugOverrideEngine)||(0,X$.getConfig)(t,X$.ConfigKey.DebugOverrideEngineLegacy)),r.set(lk.Filter.CopilotClientVersion,X$.BuildInfo.isProduction()?X$.BuildInfo.getVersion():"1.999.0"),e){let o=(0,TLi.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(lk.Filter.CopilotUserKind,o),r.set(lk.Filter.CopilotCustomModel,s),r.set(lk.Filter.CopilotOrgs,c),r.set(lk.Filter.CopilotCustomModelNames,l),r.set(lk.Filter.CopilotTrackingId,u),r.set(lk.Filter.CopilotUserKind,(0,TLi.getUserKind)(e))}let n=(0,Xec.getEngineRequestInfo)(t).modelId;return r.set(lk.Filter.CopilotEngine,n),r}a(xLi,"createCompletionsFilters")});var RLi=I(sU=>{"use strict";p();var rtc=sU&&sU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ikr=sU&&sU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(sU,"__esModule",{value:!0});sU.Features=void 0;var ntc=Np(),itc=Rh(),otc=Ks(),Oye=z$(),stc=uye(),okr=nA(),atc=wLi(),ja=hyt(),ctc=gyt(),skr=class{static{a(this,"Features")}constructor(e,r,n){this.instantiationService=e,this.experimentationService=r,this.copilotTokenManager=n,this.includeNeighboringFilesDefault=new Map,this.excludeRelatedFilesDefault=new Map}async updateExPValuesAndAssignments(e,r=okr.TelemetryData.createAndMarkAsIssued()){if(r instanceof okr.TelemetryWithExp)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let n=this.copilotTokenManager.token??await this.copilotTokenManager.getToken(),{filters:o,exp:s}=this.createExpConfigAndFilters(n);return new okr.TelemetryWithExp(r.properties,r.measurements,r.issuedTime,{filters:o,exp:s})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){return await this.updateExPValuesAndAssignments(e,r)}createExpConfigAndFilters(e){let r={};for(let u of Object.values(ja.ExpTreatmentVariables)){let d=this.experimentationService.getTreatmentVariable(u);d!==void 0&&(r[u]=d)}let n=Object.entries(r).map(([u,d])=>u+(d?"":"cf")),o=new ja.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(atc.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new ctc.FilterSettings(c),exp:o}}async getFallbackExpAndFilters(){let e=this.copilotTokenManager.token??await this.copilotTokenManager.getToken();return this.createExpConfigAndFilters(e)}overrideBlockMode(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.SuffixPercent]??Oye.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.SuffixMatchThreshold]??Oye.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ContextProviderTimeBudget]??150;return n||(this.getContextProviderExpSettings(e)?.timeBudget??150)}setIncludeNeighboringFilesDefault(e,r){this.includeNeighboringFilesDefault.set(e,r)}includeNeighboringFiles(e,r){return r.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.IncludeNeighboringFiles]??!1?!0:this.getContextProviderExpSettings(e)?.includeNeighboringFiles??this.includeNeighboringFilesDefault.get(e)??!1}setExcludeRelatedFilesDefault(e,r){this.excludeRelatedFilesDefault.set(e,r)}excludeRelatedFiles(e,r){return r.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ExcludeRelatedFiles]??!1?!0:this.getContextProviderExpSettings(e)?.excludeRelatedFiles??this.excludeRelatedFilesDefault.get(e)??!1}getContextProviderExpSettings(e){let r=this.experimentationService.getTreatmentVariable(`config.github.copilot.chat.contextprovider.${e}`);if(typeof r=="string")try{let n=JSON.parse(r),o=this.getProviderIDs(n);return delete n.id,delete n.ids,Object.assign({ids:o},{includeNeighboringFiles:!1,excludeRelatedFiles:!1,timeBudget:150},n)}catch{this.instantiationService.invokeFunction(o=>{o.get(ntc.ILogService).error(`Failed to parse context provider exp settings for language ${e}`)});return}else return}getProviderIDs(e){let r=[];if(typeof e.id=="string"&&e.id.length>0&&r.push(e.id),Array.isArray(e.ids))for(let n of e.ids)typeof n=="string"&&n.length>0&&r.push(n);return r}maxPromptCompletionTokens(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.MaxPromptCompletionTokens]??Oye.DEFAULT_MAX_PROMPT_LENGTH+Oye.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.StableContextPercent]??Oye.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.VolatileContextPercent]??Oye.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};sU.Features=skr;sU.Features=skr=rtc([ikr(0,otc.IInstantiationService),ikr(1,itc.IExperimentationService),ikr(2,stc.ICompletionsCopilotTokenManager)],skr)});var eV=I(Lye=>{"use strict";p();Object.defineProperty(Lye,"__esModule",{value:!0});Lye.ICompletionsFileSystemService=Lye.FileType=void 0;var ltc=an(),kLi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(kLi||(Lye.FileType=kLi={}));Lye.ICompletionsFileSystemService=(0,ltc.createServiceIdentifier)("ICompletionsFileSystemService")});var akr=I(LEt=>{"use strict";p();Object.defineProperty(LEt,"__esModule",{value:!0});LEt.knownLanguages=void 0;LEt.knownLanguages={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}}});var DLi=I(tV=>{"use strict";p();Object.defineProperty(tV,"__esModule",{value:!0});tV.knownFileExtensions=tV.templateLanguageLimitations=tV.knownTemplateLanguageExtensions=void 0;var PLi=akr();tV.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];tV.templateLanguageLimitations={".php":[".blade"]};tV.knownFileExtensions=Object.keys(PLi.knownLanguages).flatMap(t=>PLi.knownLanguages[t].extensions)});var rV=I(rN=>{"use strict";p();Object.defineProperty(rN,"__esModule",{value:!0});rN.makeFsUri=htc;rN.validateUri=mtc;rN.normalizeUri=gtc;rN.fsPath=LLi;rN.getFsPath=BLi;rN.getFsUri=Atc;rN.joinPath=ytc;rN.basename=vtc;rN.dirname=Ctc;var utc=require("os"),dtc=require("path"),ftc=x2(),eBe=hd();function MLi(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+MLi(t.substring(3)):t}}a(MLi,"decodeURIComponentGraceful");var NLi=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ptc(t){return t.match(NLi)?t.replace(NLi,e=>MLi(e)):t}a(ptc,"percentDecode");function htc(t){if(/^[A-Za-z][A-Za-z0-9+.-]+:/.test(t))throw new Error("Path must not contain a scheme");if(!t)throw new Error("Path must not be empty");return eBe.URI.file(t).toString()}a(htc,"makeFsUri");function tBe(t){if(typeof t!="string"&&(t=t.uri),/^[A-Za-z]:\\/.test(t))throw new Error(`Could not parse <${t}>: Windows-style path`);try{let e=t.match(/^(?:([^:/?#]+?:)?\/\/)(\/\/.*)$/);return e?eBe.URI.parse(e[1]+e[2],!0):eBe.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(tBe,"parseUri");function mtc(t){return tBe(t),t}a(mtc,"validateUri");function gtc(t){try{return tBe(t).toString()}catch{return t}}a(gtc,"normalizeUri");var OLi=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function LLi(t){let e=tBe(t);if(!OLi.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,utc.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,dtc.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(LLi,"fsPath");function BLi(t){try{return LLi(t)}catch{return}}a(BLi,"getFsPath");function Atc(t){let e=BLi(t);if(e)return eBe.URI.file(e).toString()}a(Atc,"getFsUri");function ytc(t,...e){let r=eBe.URI.joinPath(tBe(t),...e.map(_tc)).toString();return typeof t=="string"?r:{uri:r}}a(ytc,"joinPath");function _tc(t){return Etc(t)?t.replaceAll("\\","/"):t}a(_tc,"pathToURIPath");function Etc(t){return/^[^/\\]*\\/.test(t)}a(Etc,"isWinPath");function vtc(t){return ptc((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(vtc,"basename");function Ctc(t){let e=(0,ftc.dirname)(tBe(t)),r;return OLi.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(Ctc,"dirname")});var ULi=I(sE=>{"use strict";p();var btc=sE&&sE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Stc=sE&&sE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Ttc=sE&&sE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0&&ckr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=ckr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(Bye.has(e))return{languageId:Bye.get(e)[0],isGuess:!1};let n=lkr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),Bye.has(e))return{languageId:Bye.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},dkr=class extends Fye{static{a(this,"GroupingLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){let r=this.delegate.detectLanguage(e),n=r.languageId;return n==="c"||n==="cpp"?new kne("cpp",r.isGuess,r.fileExtension):r}},fkr=class extends Fye{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new kne(e.languageId,!0,""):this.delegate.detectLanguage(e)}};sE.languageDetection=new dkr(new fkr(new ukr));function wtc({uri:t,languageId:e}){let r=sE.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(wtc,"detectLanguage")});var Qye=I(Uye=>{"use strict";p();Object.defineProperty(Uye,"__esModule",{value:!0});Uye.CopilotTextDocument=Uye.LocationFactory=void 0;var Rtc=ULi(),ktc=rV(),rBe=(r7t(),Wa(nAn)),nV=PSe(),pkr=class{static{a(this,"LocationFactory")}static{this.range=nV.Range.create.bind(nV.Range)}static{this.position=nV.Position.create.bind(nV.Position)}};Uye.LocationFactory=pkr;var hkr=class t{static{a(this,"CopilotTextDocument")}constructor(e,r,n){this.uri=e,this._textDocument=r,this.detectedLanguageId=n}static withChanges(e,r,n){let o=rBe.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return rBe.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=rBe.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return rBe.TextDocument.update(r,e.map(n=>({text:n.newText,range:n.range})),this.version),new t(this.uri,r,this.detectedLanguageId)}static create(e,r,n,o,s=(0,Rtc.detectLanguage)({uri:e,languageId:r})){return new t((0,ktc.normalizeUri)(e),rBe.TextDocument.create(e,r,n,o),s)}get clientUri(){return this._textDocument.uri}get clientLanguageId(){return this._textDocument.languageId}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){let r=typeof e=="number"?e:e.line;if(r<0||r>=this.lineCount)throw new RangeError("Illegal value for lineNumber");let n=nV.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=nV.Range.create(nV.Position.create(r,0),nV.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};Uye.CopilotTextDocument=hkr});var iBe=I((Iqp,HLi)=>{"use strict";p();var mkr=Object.defineProperty,Ptc=Object.getOwnPropertyDescriptor,Dtc=Object.getOwnPropertyNames,Ntc=Object.prototype.hasOwnProperty,Mtc=a((t,e)=>{for(var r in e)mkr(t,r,{get:e[r],enumerable:!0})},"__export"),Otc=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Dtc(e))!Ntc.call(t,o)&&o!==r&&mkr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=Ptc(e,o))||n.enumerable});return t},"__copyProps"),Ltc=a(t=>Otc(mkr({},"__esModule",{value:!0}),t),"__toCommonJS"),qLi={};Mtc(qLi,{config:a(()=>qtc,"config"),t:a(()=>jLi,"t")});HLi.exports=Ltc(qLi);var Btc=require("fs"),Ftc=require("fs/promises");async function Utc(t){if(t.protocol==="file:")return await(0,Ftc.readFile)(t,"utf8");if(t.protocol==="http:"||t.protocol==="https:"){let e=await fetch(t.toString(),{headers:{"Accept-Encoding":"gzip, deflate",Accept:"application/json"},redirect:"follow"});if(!e.ok){let n=`Unexpected ${e.status} response while trying to read ${t}`;try{n+=`: ${await e.text()}`}catch{}throw new Error(n)}return await e.text()}throw new Error("Unsupported protocol")}a(Utc,"readFileFromUri");function Qtc(t){return(0,Btc.readFileSync)(t,"utf8")}a(Qtc,"readFileFromFsPath");var nBe;function qtc(t){if("contents"in t){typeof t.contents=="string"?nBe=JSON.parse(t.contents):nBe=t.contents;return}if("fsPath"in t){let e=Qtc(t.fsPath),r=JSON.parse(e);nBe=QLi(r)?r.contents.bundle:r;return}if(t.uri){let e=t.uri;return typeof t.uri=="string"&&(e=new URL(t.uri)),new Promise((r,n)=>{Utc(e).then(o=>{try{let s=JSON.parse(o);nBe=QLi(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(qtc,"config");function jLi(...t){let e=t[0],r,n,o;if(typeof e=="string")r=e,n=e,t.splice(0,1),o=!t||typeof t[0]!="object"?t:t[0];else if(e instanceof Array){let c=t.slice(1);if(e.length!==c.length+1)throw new Error("expected a string as the first argument to l10n.t");let l=e[0];for(let u=1;u0&&(r+=`/${Array.isArray(e.comment)?e.comment.join(""):e.comment}`),o=e.args??{};let s=nBe?.[r];return s?typeof s=="string"?BEt(s,o):s.comment?BEt(s.message,o):BEt(n,o):BEt(n,o)}a(jLi,"t");var jtc=/{([^}]+)}/g;function BEt(t,e){return Object.keys(e).length===0?t:t.replace(jtc,(r,n)=>e[n]??r)}a(BEt,"format");function QLi(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a(QLi,"isBuiltinExtension")});var Pne=I(Xv=>{"use strict";p();var Htc=Xv&&Xv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gtc=Xv&&Xv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$tc=Xv&&Xv.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot.ensureLoaded()).catch(()=>{kEt=void 0}),kEt}return MEt??=Promise.all([bLi(eN.cl100k),bLi(eN.o200k)]).then(()=>{}),MEt}a(SLi,"loadTokenizers");function Mec(){return SLi()}a(Mec,"ensureTokenizersLoaded");function Oec(){wne=void 0,MEt=void 0,kEt=void 0,Mye.clear(),Mye.set(eN.mock,new DEt)}a(Oec,"resetTokenizersForTest")});var kne=I(Rne=>{"use strict";p();var Lec=Rne&&Rne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bec=Rne&&Rne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lec(e,t,r)};Object.defineProperty(Rne,"__esModule",{value:!0});Bec(TLi(),Rne)});var rkr=I(tN=>{"use strict";p();var Fec=tN&&tN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ZLe=tN&&tN.__param||function(t,e){return function(r,n){e(r,n,t)}},XLe;Object.defineProperty(tN,"__esModule",{value:!0});tN.AvailableModelsManager=tN.ICompletionsModelManagerService=void 0;var Uec=rE(),Qec=zLe(),qec=an(),jec=Po(),Hec=Ks(),Gec=z4i(),$ec=kne(),Vec=ATr(),Wec=zyt(),OEt=eE(),zec=xy(),ILi=Gl();tN.ICompletionsModelManagerService=(0,qec.createServiceIdentifier)("ICompletionsModelManagerService");var Yec="gpt-41-copilot",tkr=XLe=class extends jec.Disposable{static{a(this,"AvailableModelsManager")}constructor(e=!0,r,n,o,s,c){super(),this._instantiationService=r,this._featuresService=n,this._endpointProvider=o,this._logService=c,this.fetchedModelData=[],this.customModels=[],this.editorPreviewFeaturesDisabled=!1,this._onDidChangeModels=this._register(new Vec.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,Wec.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=XLe.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return Yec}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=XLe.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return XLe.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:$ec.TokenizerName.o200k}static filterCompletionModels(e,r){return e.filter(n=>n.capabilities.type==="completion").filter(n=>!r||n.preview===!1||n.preview===void 0)}static filterModelsWithEditorPreviewFeatures(e,r){return e.filter(n=>!r||n.preview===!1||n.preview===void 0)}static mapCompletionModels(e){return e.map(r=>({modelId:r.id,label:r.name,preview:!!r.preview,tokenizer:r.capabilities.tokenizer}))}getCurrentModelRequestInfo(e=void 0){let r=this.getDefaultModelId(),n=this._instantiationService.invokeFunction(Gec.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(ILi.LogLevel.INFO,`User selected model ${n} is not in the list of generic models: ${l.join(", ")}, falling back to default model.`),n=null),r===n&&(n=null)}let o=this._instantiationService.invokeFunction(OEt.getConfig,OEt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(OEt.getConfig,OEt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new X$(o,"override");let s=e?this._featuresService.customEngine(e):void 0,c=e?this._featuresService.customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new X$(s,"exp"):new X$(n,"modelpicker"):s?new X$(s,"exp"):this.customModels.length>0?new X$(this.customModels[0],"custommodel"):new X$(r,"default")}};tN.AvailableModelsManager=tkr;tN.AvailableModelsManager=tkr=XLe=Fec([ZLe(1,Hec.IInstantiationService),ZLe(2,zec.ICompletionsFeaturesService),ZLe(3,Qec.IEndpointProvider),ZLe(4,Uec.IAuthenticationService),ZLe(5,ILi.ICompletionsLogTargetService)],tkr);var X$=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var ikr=I(nkr=>{"use strict";p();Object.defineProperty(nkr,"__esModule",{value:!0});nkr.getEngineRequestInfo=Jec;var Kec=rkr();function Jec(t,e=void 0){let r=t.get(Kec.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(Jec,"getEngineRequestInfo")});var kLi=I(LEt=>{"use strict";p();Object.defineProperty(LEt,"__esModule",{value:!0});LEt.setupCompletionsExperimentationService=rtc;LEt.createCompletionsFilters=RLi;var Zec=rE(),Xec=Rh(),etc=Ks(),xLi=$4i(),eV=eE(),ttc=ikr(),lk=Ayt();function rtc(t){let e=t.get(Zec.IAuthenticationService),r=t.get(etc.IInstantiationService),n=e.onDidCopilotTokenChange(()=>{r.invokeFunction(wLi,e.copilotToken)});return wLi(t,e.copilotToken),n}a(rtc,"setupCompletionsExperimentationService");function ntc(t){return eV.BuildInfo.getBuildType()===eV.BuildType.NIGHTLY?lk.Release.Nightly:lk.Release.Stable}a(ntc,"getPluginRelease");function wLi(t,e){let r=t.get(Xec.IExperimentationService),n=RLi(t,e);r.setCompletionsFilters(n)}a(wLi,"updateCompletionsFilters");function RLi(t,e){let r=new Map;if(r.set(lk.Filter.ExtensionRelease,ntc(t)),r.set(lk.Filter.CopilotOverrideEngine,(0,eV.getConfig)(t,eV.ConfigKey.DebugOverrideEngine)||(0,eV.getConfig)(t,eV.ConfigKey.DebugOverrideEngineLegacy)),r.set(lk.Filter.CopilotClientVersion,eV.BuildInfo.isProduction()?eV.BuildInfo.getVersion():"1.999.0"),e){let o=(0,xLi.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(lk.Filter.CopilotUserKind,o),r.set(lk.Filter.CopilotCustomModel,s),r.set(lk.Filter.CopilotOrgs,c),r.set(lk.Filter.CopilotCustomModelNames,l),r.set(lk.Filter.CopilotTrackingId,u),r.set(lk.Filter.CopilotUserKind,(0,xLi.getUserKind)(e))}let n=(0,ttc.getEngineRequestInfo)(t).modelId;return r.set(lk.Filter.CopilotEngine,n),r}a(RLi,"createCompletionsFilters")});var PLi=I(sU=>{"use strict";p();var itc=sU&&sU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},okr=sU&&sU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(sU,"__esModule",{value:!0});sU.Features=void 0;var otc=Np(),stc=Rh(),atc=Ks(),Oye=Y$(),ctc=uye(),skr=nA(),ltc=kLi(),ja=myt(),utc=Ayt(),akr=class{static{a(this,"Features")}constructor(e,r,n){this.instantiationService=e,this.experimentationService=r,this.copilotTokenManager=n,this.includeNeighboringFilesDefault=new Map,this.excludeRelatedFilesDefault=new Map}async updateExPValuesAndAssignments(e,r=skr.TelemetryData.createAndMarkAsIssued()){if(r instanceof skr.TelemetryWithExp)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let n=this.copilotTokenManager.token??await this.copilotTokenManager.getToken(),{filters:o,exp:s}=this.createExpConfigAndFilters(n);return new skr.TelemetryWithExp(r.properties,r.measurements,r.issuedTime,{filters:o,exp:s})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){return await this.updateExPValuesAndAssignments(e,r)}createExpConfigAndFilters(e){let r={};for(let u of Object.values(ja.ExpTreatmentVariables)){let d=this.experimentationService.getTreatmentVariable(u);d!==void 0&&(r[u]=d)}let n=Object.entries(r).map(([u,d])=>u+(d?"":"cf")),o=new ja.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(ltc.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new utc.FilterSettings(c),exp:o}}async getFallbackExpAndFilters(){let e=this.copilotTokenManager.token??await this.copilotTokenManager.getToken();return this.createExpConfigAndFilters(e)}overrideBlockMode(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.SuffixPercent]??Oye.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.SuffixMatchThreshold]??Oye.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ContextProviderTimeBudget]??150;return n||(this.getContextProviderExpSettings(e)?.timeBudget??150)}setIncludeNeighboringFilesDefault(e,r){this.includeNeighboringFilesDefault.set(e,r)}includeNeighboringFiles(e,r){return r.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.IncludeNeighboringFiles]??!1?!0:this.getContextProviderExpSettings(e)?.includeNeighboringFiles??this.includeNeighboringFilesDefault.get(e)??!1}setExcludeRelatedFilesDefault(e,r){this.excludeRelatedFilesDefault.set(e,r)}excludeRelatedFiles(e,r){return r.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ExcludeRelatedFiles]??!1?!0:this.getContextProviderExpSettings(e)?.excludeRelatedFiles??this.excludeRelatedFilesDefault.get(e)??!1}getContextProviderExpSettings(e){let r=this.experimentationService.getTreatmentVariable(`config.github.copilot.chat.contextprovider.${e}`);if(typeof r=="string")try{let n=JSON.parse(r),o=this.getProviderIDs(n);return delete n.id,delete n.ids,Object.assign({ids:o},{includeNeighboringFiles:!1,excludeRelatedFiles:!1,timeBudget:150},n)}catch{this.instantiationService.invokeFunction(o=>{o.get(otc.ILogService).error(`Failed to parse context provider exp settings for language ${e}`)});return}else return}getProviderIDs(e){let r=[];if(typeof e.id=="string"&&e.id.length>0&&r.push(e.id),Array.isArray(e.ids))for(let n of e.ids)typeof n=="string"&&n.length>0&&r.push(n);return r}maxPromptCompletionTokens(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.MaxPromptCompletionTokens]??Oye.DEFAULT_MAX_PROMPT_LENGTH+Oye.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.StableContextPercent]??Oye.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.VolatileContextPercent]??Oye.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[ja.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};sU.Features=akr;sU.Features=akr=itc([okr(0,atc.IInstantiationService),okr(1,stc.IExperimentationService),okr(2,ctc.ICompletionsCopilotTokenManager)],akr)});var tV=I(Lye=>{"use strict";p();Object.defineProperty(Lye,"__esModule",{value:!0});Lye.ICompletionsFileSystemService=Lye.FileType=void 0;var dtc=an(),DLi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(DLi||(Lye.FileType=DLi={}));Lye.ICompletionsFileSystemService=(0,dtc.createServiceIdentifier)("ICompletionsFileSystemService")});var ckr=I(BEt=>{"use strict";p();Object.defineProperty(BEt,"__esModule",{value:!0});BEt.knownLanguages=void 0;BEt.knownLanguages={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}}});var MLi=I(rV=>{"use strict";p();Object.defineProperty(rV,"__esModule",{value:!0});rV.knownFileExtensions=rV.templateLanguageLimitations=rV.knownTemplateLanguageExtensions=void 0;var NLi=ckr();rV.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];rV.templateLanguageLimitations={".php":[".blade"]};rV.knownFileExtensions=Object.keys(NLi.knownLanguages).flatMap(t=>NLi.knownLanguages[t].extensions)});var nV=I(rN=>{"use strict";p();Object.defineProperty(rN,"__esModule",{value:!0});rN.makeFsUri=gtc;rN.validateUri=Atc;rN.normalizeUri=ytc;rN.fsPath=FLi;rN.getFsPath=ULi;rN.getFsUri=_tc;rN.joinPath=Etc;rN.basename=btc;rN.dirname=Stc;var ftc=require("os"),ptc=require("path"),htc=x2(),eBe=hd();function LLi(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+LLi(t.substring(3)):t}}a(LLi,"decodeURIComponentGraceful");var OLi=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function mtc(t){return t.match(OLi)?t.replace(OLi,e=>LLi(e)):t}a(mtc,"percentDecode");function gtc(t){if(/^[A-Za-z][A-Za-z0-9+.-]+:/.test(t))throw new Error("Path must not contain a scheme");if(!t)throw new Error("Path must not be empty");return eBe.URI.file(t).toString()}a(gtc,"makeFsUri");function tBe(t){if(typeof t!="string"&&(t=t.uri),/^[A-Za-z]:\\/.test(t))throw new Error(`Could not parse <${t}>: Windows-style path`);try{let e=t.match(/^(?:([^:/?#]+?:)?\/\/)(\/\/.*)$/);return e?eBe.URI.parse(e[1]+e[2],!0):eBe.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(tBe,"parseUri");function Atc(t){return tBe(t),t}a(Atc,"validateUri");function ytc(t){try{return tBe(t).toString()}catch{return t}}a(ytc,"normalizeUri");var BLi=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function FLi(t){let e=tBe(t);if(!BLi.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,ftc.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,ptc.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(FLi,"fsPath");function ULi(t){try{return FLi(t)}catch{return}}a(ULi,"getFsPath");function _tc(t){let e=ULi(t);if(e)return eBe.URI.file(e).toString()}a(_tc,"getFsUri");function Etc(t,...e){let r=eBe.URI.joinPath(tBe(t),...e.map(vtc)).toString();return typeof t=="string"?r:{uri:r}}a(Etc,"joinPath");function vtc(t){return Ctc(t)?t.replaceAll("\\","/"):t}a(vtc,"pathToURIPath");function Ctc(t){return/^[^/\\]*\\/.test(t)}a(Ctc,"isWinPath");function btc(t){return mtc((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(btc,"basename");function Stc(t){let e=(0,htc.dirname)(tBe(t)),r;return BLi.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(Stc,"dirname")});var qLi=I(sE=>{"use strict";p();var Ttc=sE&&sE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Itc=sE&&sE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xtc=sE&&sE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0&&lkr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=lkr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(Bye.has(e))return{languageId:Bye.get(e)[0],isGuess:!1};let n=ukr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),Bye.has(e))return{languageId:Bye.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},fkr=class extends Fye{static{a(this,"GroupingLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){let r=this.delegate.detectLanguage(e),n=r.languageId;return n==="c"||n==="cpp"?new Pne("cpp",r.isGuess,r.fileExtension):r}},pkr=class extends Fye{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new Pne(e.languageId,!0,""):this.delegate.detectLanguage(e)}};sE.languageDetection=new fkr(new pkr(new dkr));function ktc({uri:t,languageId:e}){let r=sE.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(ktc,"detectLanguage")});var Qye=I(Uye=>{"use strict";p();Object.defineProperty(Uye,"__esModule",{value:!0});Uye.CopilotTextDocument=Uye.LocationFactory=void 0;var Ptc=qLi(),Dtc=nV(),rBe=(n7t(),Wa(iAn)),iV=PSe(),hkr=class{static{a(this,"LocationFactory")}static{this.range=iV.Range.create.bind(iV.Range)}static{this.position=iV.Position.create.bind(iV.Position)}};Uye.LocationFactory=hkr;var mkr=class t{static{a(this,"CopilotTextDocument")}constructor(e,r,n){this.uri=e,this._textDocument=r,this.detectedLanguageId=n}static withChanges(e,r,n){let o=rBe.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return rBe.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=rBe.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return rBe.TextDocument.update(r,e.map(n=>({text:n.newText,range:n.range})),this.version),new t(this.uri,r,this.detectedLanguageId)}static create(e,r,n,o,s=(0,Ptc.detectLanguage)({uri:e,languageId:r})){return new t((0,Dtc.normalizeUri)(e),rBe.TextDocument.create(e,r,n,o),s)}get clientUri(){return this._textDocument.uri}get clientLanguageId(){return this._textDocument.languageId}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){let r=typeof e=="number"?e:e.line;if(r<0||r>=this.lineCount)throw new RangeError("Illegal value for lineNumber");let n=iV.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=iV.Range.create(iV.Position.create(r,0),iV.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};Uye.CopilotTextDocument=mkr});var iBe=I((kqp,$Li)=>{"use strict";p();var gkr=Object.defineProperty,Ntc=Object.getOwnPropertyDescriptor,Mtc=Object.getOwnPropertyNames,Otc=Object.prototype.hasOwnProperty,Ltc=a((t,e)=>{for(var r in e)gkr(t,r,{get:e[r],enumerable:!0})},"__export"),Btc=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Mtc(e))!Otc.call(t,o)&&o!==r&&gkr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=Ntc(e,o))||n.enumerable});return t},"__copyProps"),Ftc=a(t=>Btc(gkr({},"__esModule",{value:!0}),t),"__toCommonJS"),HLi={};Ltc(HLi,{config:a(()=>Htc,"config"),t:a(()=>GLi,"t")});$Li.exports=Ftc(HLi);var Utc=require("fs"),Qtc=require("fs/promises");async function qtc(t){if(t.protocol==="file:")return await(0,Qtc.readFile)(t,"utf8");if(t.protocol==="http:"||t.protocol==="https:"){let e=await fetch(t.toString(),{headers:{"Accept-Encoding":"gzip, deflate",Accept:"application/json"},redirect:"follow"});if(!e.ok){let n=`Unexpected ${e.status} response while trying to read ${t}`;try{n+=`: ${await e.text()}`}catch{}throw new Error(n)}return await e.text()}throw new Error("Unsupported protocol")}a(qtc,"readFileFromUri");function jtc(t){return(0,Utc.readFileSync)(t,"utf8")}a(jtc,"readFileFromFsPath");var nBe;function Htc(t){if("contents"in t){typeof t.contents=="string"?nBe=JSON.parse(t.contents):nBe=t.contents;return}if("fsPath"in t){let e=jtc(t.fsPath),r=JSON.parse(e);nBe=jLi(r)?r.contents.bundle:r;return}if(t.uri){let e=t.uri;return typeof t.uri=="string"&&(e=new URL(t.uri)),new Promise((r,n)=>{qtc(e).then(o=>{try{let s=JSON.parse(o);nBe=jLi(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(Htc,"config");function GLi(...t){let e=t[0],r,n,o;if(typeof e=="string")r=e,n=e,t.splice(0,1),o=!t||typeof t[0]!="object"?t:t[0];else if(e instanceof Array){let c=t.slice(1);if(e.length!==c.length+1)throw new Error("expected a string as the first argument to l10n.t");let l=e[0];for(let u=1;u0&&(r+=`/${Array.isArray(e.comment)?e.comment.join(""):e.comment}`),o=e.args??{};let s=nBe?.[r];return s?typeof s=="string"?FEt(s,o):s.comment?FEt(s.message,o):FEt(n,o):FEt(n,o)}a(GLi,"t");var Gtc=/{([^}]+)}/g;function FEt(t,e){return Object.keys(e).length===0?t:t.replace(Gtc,(r,n)=>e[n]??r)}a(FEt,"format");function jLi(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a(jLi,"isBuiltinExtension")});var Dne=I(Xv=>{"use strict";p();var $tc=Xv&&Xv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vtc=Xv&&Xv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Wtc=Xv&&Xv.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(Akr,"__esModule",{value:!0});Akr.isDocumentValid=Jtc;var Ytc=Pne(),Ktc=hd();async function Jtc(t,e){return await t.get(Ytc.IIgnoreService).isCopilotIgnored(Ktc.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(Jtc,"isDocumentValid")});var RS=I(nN=>{"use strict";p();var Ztc=nN&&nN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},GLi=nN&&nN.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(nN,"__esModule",{value:!0});nN.TextDocumentManager=nN.ICompletionsTextDocumentManagerService=void 0;var Xtc=an(),erc=Ks(),trc=eV(),$Li=ykr(),qye=rV();nN.ICompletionsTextDocumentManagerService=(0,Xtc.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var _kr=class{static{a(this,"TextDocumentManager")}constructor(e,r){this.instantiationService=e,this.fileSystem=r}async textDocuments(){let e=this.getTextDocumentsUnsafe(),r=[];for(let n of e)(await this.instantiationService.invokeFunction($Li.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,qye.normalizeUri)(e.uri);return this.getTextDocumentsUnsafe().find(n=>n.uri===r)}async getTextDocument(e){return this.getTextDocumentWithValidation(e).then(r=>{if(r.status==="valid")return r.document})}async validateTextDocument(e){return await this.instantiationService.invokeFunction($Li.isDocumentValid,e)}async getTextDocumentValidation(e){try{return await this.validateTextDocument(e)}catch{return this.notFoundResult(e)}}async getTextDocumentWithValidation(e){let r=this.getTextDocumentUnsafe(e);if(!r)return this.notFoundResult(e);let n=await this.validateTextDocument(e);return n.status==="valid"?{status:"valid",document:r}:n}notFoundResult({uri:e}){return{status:"notfound",message:`Document for URI could not be found: ${e}`}}async readTextDocumentFromDisk(e){try{if((await this.fileSystem.stat(e)).size>5*1024*1024)return}catch{return}return await this.fileSystem.readFileString(e)}getWorkspaceFolder(e){let r=(0,qye.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,qye.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,qye.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,qye.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,qye.basename)(r)}};nN.TextDocumentManager=_kr;nN.TextDocumentManager=_kr=Ztc([GLi(0,erc.IInstantiationService),GLi(1,trc.ICompletionsFileSystemService)],_kr)});var Ckr=I(iN=>{"use strict";p();var rrc=iN&&iN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Ekr=iN&&iN.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(iN,"__esModule",{value:!0});iN.FileReader=iN.ICompletionsFileReaderService=void 0;var nrc=an(),irc=Ks(),orc=eV(),src=Qye(),arc=RS(),crc=ykr(),lrc=rV();iN.ICompletionsFileReaderService=(0,nrc.createServiceIdentifier)("ICompletionsFileReaderService");var vkr=class{static{a(this,"FileReader")}constructor(e,r,n){this.documentManagerService=e,this.instantiationService=r,this.fileSystemService=n}getRelativePath(e){return this.documentManagerService.getRelativePath(e)??(0,lrc.basename)(e.uri)}getOrReadTextDocument(e){return this.readFile(e.uri)}getOrReadTextDocumentWithFakeClientProperties(e){return this.readFile(e.uri)}async readFile(e){let r=await this.documentManagerService.getTextDocumentWithValidation({uri:e});if(r.status!=="notfound")return r;try{if(await this.getFileSizeMB(e)>1)return{status:"notfound",message:"File too large"};let o=await this.doReadFile(e),s=await this.instantiationService.invokeFunction(crc.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:src.CopilotTextDocument.create(e,"UNKNOWN",-1,o)}:s}catch{return{status:"notfound",message:"File not found"}}}async doReadFile(e){return await this.fileSystemService.readFileString(e)}async getFileSizeMB(e){return(await this.fileSystemService.stat(e)).size/1024/1024}};iN.FileReader=vkr;iN.FileReader=vkr=rrc([Ekr(0,arc.ICompletionsTextDocumentManagerService),Ekr(1,irc.IInstantiationService),Ekr(2,orc.ICompletionsFileSystemService)],vkr)});var aU=I(FEt=>{"use strict";p();Object.defineProperty(FEt,"__esModule",{value:!0});FEt.LRUCacheMap=void 0;var bkr=class{static{a(this,"LRUCacheMap")}constructor(e=10){if(this.valueMap=new Map,e<1)throw new Error("Size limit must be at least 1");this.sizeLimit=e}set(e,r){if(this.has(e))this.valueMap.delete(e);else if(this.valueMap.size>=this.sizeLimit){let n=this.valueMap.keys().next().value;this.delete(n)}return this.valueMap.set(e,r),this}get(e){if(this.valueMap.has(e)){let r=this.valueMap.get(e);return this.valueMap.delete(e),this.valueMap.set(e,r),r}}delete(e){return this.valueMap.delete(e)}clear(){this.valueMap.clear()}get size(){return this.valueMap.size}keys(){return new Map(this.valueMap).keys()}values(){return new Map(this.valueMap).values()}entries(){return new Map(this.valueMap).entries()}[Symbol.iterator](){return this.entries()}has(e){return this.valueMap.has(e)}forEach(e,r){new Map(this.valueMap).forEach(e,r)}get[Symbol.toStringTag](){return"LRUCacheMap"}peek(e){return this.valueMap.get(e)}};FEt.LRUCacheMap=bkr});var sBe=I(oBe=>{"use strict";p();Object.defineProperty(oBe,"__esModule",{value:!0});oBe.Deferred=void 0;oBe.delay=urc;var Skr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};oBe.Deferred=Skr;function urc(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(urc,"delay")});var VLi=I(jye=>{"use strict";p();Object.defineProperty(jye,"__esModule",{value:!0});jye.ReplaySubject=jye.Subject=void 0;var UEt=class{static{a(this,"Subject")}constructor(){this.observers=new Set}subscribe(e){return this.observers.add(e),()=>this.observers.delete(e)}next(e){for(let r of this.observers)r.next(e)}error(e){for(let r of this.observers)r.error?.(e)}complete(){for(let e of this.observers)e.complete?.()}};jye.Subject=UEt;var Tkr=class extends UEt{static{a(this,"ReplaySubject")}subscribe(e){let r=super.subscribe(e);return this._value!==void 0&&e.next(this._value),r}next(e){this._value=e,super.next(e)}};jye.ReplaySubject=Tkr});var wkr=I(oN=>{"use strict";p();var drc=oN&&oN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},WLi=oN&&oN.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(oN,"__esModule",{value:!0});oN.AsyncCompletionManager=oN.ICompletionsAsyncManagerService=void 0;var frc=an(),prc=xy(),hrc=aU(),zLi=Gl(),mrc=sBe(),grc=VLi(),Dne;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(Dne||(Dne={}));oN.ICompletionsAsyncManagerService=(0,frc.createServiceIdentifier)("ICompletionsAsyncManagerService");var xkr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new zLi.Logger("AsyncCompletionManager"),this.requests=new hrc.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(Ikr(e,r,o))return!0;return!1}updateCompletion(e,r){let n=this.requests.get(e);n!==void 0&&(n.partialCompletionText=r,n.subject.next(n))}queueCompletionRequest(e,r,n,o,s){this.#e.debug(this.logTarget,`[${e}] Queueing async completion request:`,r.substring(r.lastIndexOf(` -`)+1));let c=new grc.ReplaySubject;return this.requests.set(e,{state:Dne.Pending,cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c}),s.then(l=>{if(this.requests.delete(e),l.type!=="success"){this.#e.debug(this.logTarget,`[${e}] Request failed with`,l.reason),c.error(l.reason);return}let u={cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c,choice:l.value[0],result:l,state:Dne.Completed,allChoicesPromise:l.value[1]};this.requests.set(e,u),c.next(u),c.complete()}).catch(l=>{this.#e.error(this.logTarget,`[${e}] Request errored with`,l),this.requests.delete(e),c.error(l)})}getFirstMatchingRequestWithTimeout(e,r,n,o,s){let c=this.featuresService.asyncCompletionsTimeout(s);return c<0?(this.#e.debug(this.logTarget,`[${e}] Waiting for completions without timeout`),this.getFirstMatchingRequest(e,r,n,o)):(this.#e.debug(this.logTarget,`[${e}] Waiting for completions with timeout of ${c}ms`),Promise.race([this.getFirstMatchingRequest(e,r,n,o),new Promise(l=>setTimeout(()=>l(null),c))]).then(l=>{if(l===null){this.#e.debug(this.logTarget,`[${e}] Timed out waiting for completion`);return}return l}))}async getFirstMatchingRequest(e,r,n,o){o||(this.mostRecentRequestId=e);let s=!1,c=new mrc.Deferred,l=new Map,u=a(f=>()=>{let h=l.get(f);h!==void 0&&(h(),l.delete(f),!s&&l.size===0&&(s=!0,this.#e.debug(this.logTarget,`[${e}] No matching completions found`),c.resolve(void 0)))},"finishRequest"),d=a(f=>{if(Ikr(r,n,f)){if(f.state===Dne.Completed){let h=r.substring(f.prefix.length),{completionText:m}=f.choice;if(!m.startsWith(h)||m.length<=h.length){u(f.headerRequestId)();return}m=m.substring(h.length),f.choice.telemetryData.measurements.foundOffset=h.length,this.#e.debug(this.logTarget,`[${e}] Found completion at offset ${h.length}: ${JSON.stringify(m)}`),c.resolve([{...f.choice,completionText:m},f.allChoicesPromise]),s=!0}}else this.cancelRequest(e,f),u(f.headerRequestId)()},"next");for(let[f,h]of this.requests)Ikr(r,n,h)?l.set(f,h.subject.subscribe({next:d,error:u(f),complete:u(f)})):this.cancelRequest(e,h);return c.promise.finally(()=>{for(let f of l.values())f()})}cancelRequest(e,r){e===this.mostRecentRequestId&&r.state!==Dne.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};oN.AsyncCompletionManager=xkr;oN.AsyncCompletionManager=xkr=drc([WLi(0,prc.ICompletionsFeaturesService),WLi(1,zLi.ICompletionsLogTargetService)],xkr);function Ikr(t,e,r){if(r.prompt.suffix!==e.suffix||!t.startsWith(r.prefix))return!1;let n=t.substring(r.prefix.length);return r.state===Dne.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(Ikr,"isCandidate")});var YLi=I(QEt=>{"use strict";p();Object.defineProperty(QEt,"__esModule",{value:!0});QEt.LRURadixTrie=void 0;var Rkr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new aBe,this.leafNodes=new Set}set(e,r){let{node:n,remainingKey:o}=this.findClosestNode(e);if(o.length>0){for(let[s,c]of n.children)if(s.startsWith(o)){let l=s.slice(0,o.length),u=new aBe;n.removeChild(s),n.addChild(l,u),u.addChild(s.slice(l.length),c),n=u,o=o.slice(l.length);break}if(o.length>0){let s=new aBe;n.addChild(o,s),n=s}}n.value=r,this.leafNodes.add(n),this.leafNodes.size>this.maxSize&&this.evictLeastRecentlyUsed()}findAll(e){return this.findClosestNode(e).stack.map(({node:r,remainingKey:n})=>r.value!==void 0?{remainingKey:n,value:r.value}:void 0).filter(r=>r!==void 0)}delete(e){let{node:r,remainingKey:n}=this.findClosestNode(e);n.length>0||this.deleteNode(r)}findClosestNode(e){let r=!0,n=this.root,o=[{node:n,remainingKey:e}];for(;e.length>0&&r;){r=!1;for(let[s,c]of n.children)if(e.startsWith(s)){e=e.slice(s.length),o.unshift({node:c,remainingKey:e}),n=c,r=!0;break}}return{node:n,remainingKey:e,stack:o}}deleteNode(e){if(e.value=void 0,this.leafNodes.delete(e),e.parent===void 0||e.childCount>1)return;let{node:r,edge:n}=e.parent;if(e.childCount===1){let[s,c]=Array.from(e.children)[0];e.removeChild(s),r.removeChild(n),r.addChild(n+s,c);return}if(r.removeChild(n),r.parent===void 0)return;let o=r.parent;if(r.value===void 0&&r.childCount===1){let[s,c]=Array.from(r.children)[0],l=o.edge+s;r.removeChild(s),o.node.removeChild(o.edge),o.node.addChild(l,c)}}evictLeastRecentlyUsed(){let e=this.findLeastRecentlyUsed();e&&this.deleteNode(e)}findLeastRecentlyUsed(){let e;for(let r of this.leafNodes)(e===void 0||r.touched{"use strict";p();Object.defineProperty(Hye,"__esModule",{value:!0});Hye.CompletionsCache=Hye.ICompletionsCacheService=void 0;var Arc=an(),KLi=YLi();Hye.ICompletionsCacheService=(0,Arc.createServiceIdentifier)("ICompletionsCacheService");var kkr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new KLi.LRURadixTrie(100)}findAll(e,r){return this.cache.findAll(e).flatMap(({remainingKey:n,value:o})=>o.content.filter(s=>s.suffix===r&&s.choice.completionText.startsWith(n)&&s.choice.completionText.length>n.length).map(s=>({...s.choice,completionText:s.choice.completionText.slice(n.length),telemetryData:s.choice.telemetryData.extendedBy({},{foundOffset:n.length})})))}append(e,r,n){let o=this.cache.findAll(e);if(o.length>0&&o[0].remainingKey===""){let s=o[0].value.content;this.cache.set(e,{content:[...s,{suffix:r,choice:n}]})}else this.cache.set(e,{content:[{suffix:r,choice:n}]})}clear(){this.cache=new KLi.LRURadixTrie(100)}};Hye.CompletionsCache=kkr});var JLi=I(Gye=>{"use strict";p();Object.defineProperty(Gye,"__esModule",{value:!0});Gye.BlockMode=void 0;Gye.shouldDoParsingTrimming=yrc;Gye.shouldDoServerTrimming=_rc;var Nne;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Nne||(Gye.BlockMode=Nne={}));function yrc(t){return[Nne.Parsing,Nne.ParsingAndServer,Nne.MoreMultiline].includes(t)}a(yrc,"shouldDoParsingTrimming");function _rc(t){return[Nne.Server,Nne.ParsingAndServer].includes(t)}a(_rc,"shouldDoServerTrimming")});var Mne=I(xI=>{"use strict";p();var Erc=xI&&xI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xI,"__esModule",{value:!0});xI.WASMLanguage=void 0;xI.isSupportedLanguageId=Crc;xI.languageIdToWasmLanguage=Okr;xI.getLanguage=XLi;xI.parseTreeSitter=Src;xI.parseTreeSitterIncludingVersion=eBi;xI.getBlockCloseToken=Trc;xI.queryPythonIsDocstring=wrc;var Dkr=Erc(eue()),vrc=KRr(),ZLi=JRr(),kd;(function(t){t.Python="python",t.JavaScript="javascript",t.TypeScript="typescript",t.TSX="tsx",t.Go="go",t.Ruby="ruby",t.CSharp="c-sharp",t.Java="java",t.Php="php",t.Cpp="cpp"})(kd||(xI.WASMLanguage=kd={}));var Nkr={python:kd.Python,javascript:kd.JavaScript,javascriptreact:kd.JavaScript,jsx:kd.JavaScript,typescript:kd.TypeScript,typescriptreact:kd.TSX,go:kd.Go,ruby:kd.Ruby,csharp:kd.CSharp,java:kd.Java,php:kd.Php,c:kd.Cpp,cpp:kd.Cpp};function Crc(t){return t in Nkr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(Crc,"isSupportedLanguageId");function Okr(t){if(!(t in Nkr))throw new Error(`Unrecognized language: ${t}`);return Nkr[t]}a(Okr,"languageIdToWasmLanguage");var Pkr=new Map;async function brc(t){let e;try{e=await(0,ZLi.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new vrc.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return Dkr.default.Language.load(e)}a(brc,"loadWasmLanguage");function XLi(t){let e=Okr(t);if(!Pkr.has(e)){let r=brc(e);Pkr.set(e,r)}return Pkr.get(e)}a(XLi,"getLanguage");var Mkr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function Src(t,e){return(await eBi(t,e))[0]}a(Src,"parseTreeSitter");async function eBi(t,e){await Dkr.default.init({locateFile:a(s=>(0,ZLi.locateFile)(s),"locateFile")});let r;try{r=new Dkr.default}catch(s){throw s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&s.message.includes("table index is out of bounds")?new Mkr(`Could not init Parse for language <${t}>`,s):s}let n=await XLi(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(eBi,"parseTreeSitterIncludingVersion");function Trc(t){switch(Okr(t)){case kd.Python:return null;case kd.JavaScript:case kd.TypeScript:case kd.TSX:case kd.Go:case kd.CSharp:case kd.Java:case kd.Php:case kd.Cpp:return"}";case kd.Ruby:return"end"}}a(Trc,"getBlockCloseToken");function Irc(t,e){let r=[];for(let n of t){if(!n[1]){let o=e.tree.getLanguage();n[1]=o.query(n[0])}r.push(...n[1].matches(e))}return r}a(Irc,"innerQuery");var xrc=[`[ +**Note:** Some files were excluded from the context due to content exclusion rules. Click [here](https://docs.github.com/en/copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot) to learn more.`);Xv.IIgnoreService=(0,Ytc.createServiceIdentifier)("IIgnoreService");var Akr=class t{static{a(this,"NullIgnoreService")}static{this.Instance=new t}dispose(){}get isEnabled(){return!1}get isRegexExclusionsEnabled(){return!1}async init(){}async isCopilotIgnored(e){return!1}async asMinimatchPattern(){}};Xv.NullIgnoreService=Akr;async function Ktc(t,e){let r=[];for(let n of e)await t.isCopilotIgnored(n)||r.push(n);return r}a(Ktc,"filterIngoredResources")});var _kr=I(ykr=>{"use strict";p();Object.defineProperty(ykr,"__esModule",{value:!0});ykr.isDocumentValid=Xtc;var Jtc=Dne(),Ztc=hd();async function Xtc(t,e){return await t.get(Jtc.IIgnoreService).isCopilotIgnored(Ztc.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(Xtc,"isDocumentValid")});var RS=I(nN=>{"use strict";p();var erc=nN&&nN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},VLi=nN&&nN.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(nN,"__esModule",{value:!0});nN.TextDocumentManager=nN.ICompletionsTextDocumentManagerService=void 0;var trc=an(),rrc=Ks(),nrc=tV(),WLi=_kr(),qye=nV();nN.ICompletionsTextDocumentManagerService=(0,trc.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var Ekr=class{static{a(this,"TextDocumentManager")}constructor(e,r){this.instantiationService=e,this.fileSystem=r}async textDocuments(){let e=this.getTextDocumentsUnsafe(),r=[];for(let n of e)(await this.instantiationService.invokeFunction(WLi.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,qye.normalizeUri)(e.uri);return this.getTextDocumentsUnsafe().find(n=>n.uri===r)}async getTextDocument(e){return this.getTextDocumentWithValidation(e).then(r=>{if(r.status==="valid")return r.document})}async validateTextDocument(e){return await this.instantiationService.invokeFunction(WLi.isDocumentValid,e)}async getTextDocumentValidation(e){try{return await this.validateTextDocument(e)}catch{return this.notFoundResult(e)}}async getTextDocumentWithValidation(e){let r=this.getTextDocumentUnsafe(e);if(!r)return this.notFoundResult(e);let n=await this.validateTextDocument(e);return n.status==="valid"?{status:"valid",document:r}:n}notFoundResult({uri:e}){return{status:"notfound",message:`Document for URI could not be found: ${e}`}}async readTextDocumentFromDisk(e){try{if((await this.fileSystem.stat(e)).size>5*1024*1024)return}catch{return}return await this.fileSystem.readFileString(e)}getWorkspaceFolder(e){let r=(0,qye.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,qye.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,qye.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,qye.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,qye.basename)(r)}};nN.TextDocumentManager=Ekr;nN.TextDocumentManager=Ekr=erc([VLi(0,rrc.IInstantiationService),VLi(1,nrc.ICompletionsFileSystemService)],Ekr)});var bkr=I(iN=>{"use strict";p();var irc=iN&&iN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},vkr=iN&&iN.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(iN,"__esModule",{value:!0});iN.FileReader=iN.ICompletionsFileReaderService=void 0;var orc=an(),src=Ks(),arc=tV(),crc=Qye(),lrc=RS(),urc=_kr(),drc=nV();iN.ICompletionsFileReaderService=(0,orc.createServiceIdentifier)("ICompletionsFileReaderService");var Ckr=class{static{a(this,"FileReader")}constructor(e,r,n){this.documentManagerService=e,this.instantiationService=r,this.fileSystemService=n}getRelativePath(e){return this.documentManagerService.getRelativePath(e)??(0,drc.basename)(e.uri)}getOrReadTextDocument(e){return this.readFile(e.uri)}getOrReadTextDocumentWithFakeClientProperties(e){return this.readFile(e.uri)}async readFile(e){let r=await this.documentManagerService.getTextDocumentWithValidation({uri:e});if(r.status!=="notfound")return r;try{if(await this.getFileSizeMB(e)>1)return{status:"notfound",message:"File too large"};let o=await this.doReadFile(e),s=await this.instantiationService.invokeFunction(urc.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:crc.CopilotTextDocument.create(e,"UNKNOWN",-1,o)}:s}catch{return{status:"notfound",message:"File not found"}}}async doReadFile(e){return await this.fileSystemService.readFileString(e)}async getFileSizeMB(e){return(await this.fileSystemService.stat(e)).size/1024/1024}};iN.FileReader=Ckr;iN.FileReader=Ckr=irc([vkr(0,lrc.ICompletionsTextDocumentManagerService),vkr(1,src.IInstantiationService),vkr(2,arc.ICompletionsFileSystemService)],Ckr)});var aU=I(UEt=>{"use strict";p();Object.defineProperty(UEt,"__esModule",{value:!0});UEt.LRUCacheMap=void 0;var Skr=class{static{a(this,"LRUCacheMap")}constructor(e=10){if(this.valueMap=new Map,e<1)throw new Error("Size limit must be at least 1");this.sizeLimit=e}set(e,r){if(this.has(e))this.valueMap.delete(e);else if(this.valueMap.size>=this.sizeLimit){let n=this.valueMap.keys().next().value;this.delete(n)}return this.valueMap.set(e,r),this}get(e){if(this.valueMap.has(e)){let r=this.valueMap.get(e);return this.valueMap.delete(e),this.valueMap.set(e,r),r}}delete(e){return this.valueMap.delete(e)}clear(){this.valueMap.clear()}get size(){return this.valueMap.size}keys(){return new Map(this.valueMap).keys()}values(){return new Map(this.valueMap).values()}entries(){return new Map(this.valueMap).entries()}[Symbol.iterator](){return this.entries()}has(e){return this.valueMap.has(e)}forEach(e,r){new Map(this.valueMap).forEach(e,r)}get[Symbol.toStringTag](){return"LRUCacheMap"}peek(e){return this.valueMap.get(e)}};UEt.LRUCacheMap=Skr});var sBe=I(oBe=>{"use strict";p();Object.defineProperty(oBe,"__esModule",{value:!0});oBe.Deferred=void 0;oBe.delay=frc;var Tkr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};oBe.Deferred=Tkr;function frc(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(frc,"delay")});var zLi=I(jye=>{"use strict";p();Object.defineProperty(jye,"__esModule",{value:!0});jye.ReplaySubject=jye.Subject=void 0;var QEt=class{static{a(this,"Subject")}constructor(){this.observers=new Set}subscribe(e){return this.observers.add(e),()=>this.observers.delete(e)}next(e){for(let r of this.observers)r.next(e)}error(e){for(let r of this.observers)r.error?.(e)}complete(){for(let e of this.observers)e.complete?.()}};jye.Subject=QEt;var Ikr=class extends QEt{static{a(this,"ReplaySubject")}subscribe(e){let r=super.subscribe(e);return this._value!==void 0&&e.next(this._value),r}next(e){this._value=e,super.next(e)}};jye.ReplaySubject=Ikr});var Rkr=I(oN=>{"use strict";p();var prc=oN&&oN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},YLi=oN&&oN.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(oN,"__esModule",{value:!0});oN.AsyncCompletionManager=oN.ICompletionsAsyncManagerService=void 0;var hrc=an(),mrc=xy(),grc=aU(),KLi=Gl(),Arc=sBe(),yrc=zLi(),Nne;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(Nne||(Nne={}));oN.ICompletionsAsyncManagerService=(0,hrc.createServiceIdentifier)("ICompletionsAsyncManagerService");var wkr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new KLi.Logger("AsyncCompletionManager"),this.requests=new grc.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(xkr(e,r,o))return!0;return!1}updateCompletion(e,r){let n=this.requests.get(e);n!==void 0&&(n.partialCompletionText=r,n.subject.next(n))}queueCompletionRequest(e,r,n,o,s){this.#e.debug(this.logTarget,`[${e}] Queueing async completion request:`,r.substring(r.lastIndexOf(` +`)+1));let c=new yrc.ReplaySubject;return this.requests.set(e,{state:Nne.Pending,cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c}),s.then(l=>{if(this.requests.delete(e),l.type!=="success"){this.#e.debug(this.logTarget,`[${e}] Request failed with`,l.reason),c.error(l.reason);return}let u={cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c,choice:l.value[0],result:l,state:Nne.Completed,allChoicesPromise:l.value[1]};this.requests.set(e,u),c.next(u),c.complete()}).catch(l=>{this.#e.error(this.logTarget,`[${e}] Request errored with`,l),this.requests.delete(e),c.error(l)})}getFirstMatchingRequestWithTimeout(e,r,n,o,s){let c=this.featuresService.asyncCompletionsTimeout(s);return c<0?(this.#e.debug(this.logTarget,`[${e}] Waiting for completions without timeout`),this.getFirstMatchingRequest(e,r,n,o)):(this.#e.debug(this.logTarget,`[${e}] Waiting for completions with timeout of ${c}ms`),Promise.race([this.getFirstMatchingRequest(e,r,n,o),new Promise(l=>setTimeout(()=>l(null),c))]).then(l=>{if(l===null){this.#e.debug(this.logTarget,`[${e}] Timed out waiting for completion`);return}return l}))}async getFirstMatchingRequest(e,r,n,o){o||(this.mostRecentRequestId=e);let s=!1,c=new Arc.Deferred,l=new Map,u=a(f=>()=>{let h=l.get(f);h!==void 0&&(h(),l.delete(f),!s&&l.size===0&&(s=!0,this.#e.debug(this.logTarget,`[${e}] No matching completions found`),c.resolve(void 0)))},"finishRequest"),d=a(f=>{if(xkr(r,n,f)){if(f.state===Nne.Completed){let h=r.substring(f.prefix.length),{completionText:m}=f.choice;if(!m.startsWith(h)||m.length<=h.length){u(f.headerRequestId)();return}m=m.substring(h.length),f.choice.telemetryData.measurements.foundOffset=h.length,this.#e.debug(this.logTarget,`[${e}] Found completion at offset ${h.length}: ${JSON.stringify(m)}`),c.resolve([{...f.choice,completionText:m},f.allChoicesPromise]),s=!0}}else this.cancelRequest(e,f),u(f.headerRequestId)()},"next");for(let[f,h]of this.requests)xkr(r,n,h)?l.set(f,h.subject.subscribe({next:d,error:u(f),complete:u(f)})):this.cancelRequest(e,h);return c.promise.finally(()=>{for(let f of l.values())f()})}cancelRequest(e,r){e===this.mostRecentRequestId&&r.state!==Nne.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};oN.AsyncCompletionManager=wkr;oN.AsyncCompletionManager=wkr=prc([YLi(0,mrc.ICompletionsFeaturesService),YLi(1,KLi.ICompletionsLogTargetService)],wkr);function xkr(t,e,r){if(r.prompt.suffix!==e.suffix||!t.startsWith(r.prefix))return!1;let n=t.substring(r.prefix.length);return r.state===Nne.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(xkr,"isCandidate")});var JLi=I(qEt=>{"use strict";p();Object.defineProperty(qEt,"__esModule",{value:!0});qEt.LRURadixTrie=void 0;var kkr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new aBe,this.leafNodes=new Set}set(e,r){let{node:n,remainingKey:o}=this.findClosestNode(e);if(o.length>0){for(let[s,c]of n.children)if(s.startsWith(o)){let l=s.slice(0,o.length),u=new aBe;n.removeChild(s),n.addChild(l,u),u.addChild(s.slice(l.length),c),n=u,o=o.slice(l.length);break}if(o.length>0){let s=new aBe;n.addChild(o,s),n=s}}n.value=r,this.leafNodes.add(n),this.leafNodes.size>this.maxSize&&this.evictLeastRecentlyUsed()}findAll(e){return this.findClosestNode(e).stack.map(({node:r,remainingKey:n})=>r.value!==void 0?{remainingKey:n,value:r.value}:void 0).filter(r=>r!==void 0)}delete(e){let{node:r,remainingKey:n}=this.findClosestNode(e);n.length>0||this.deleteNode(r)}findClosestNode(e){let r=!0,n=this.root,o=[{node:n,remainingKey:e}];for(;e.length>0&&r;){r=!1;for(let[s,c]of n.children)if(e.startsWith(s)){e=e.slice(s.length),o.unshift({node:c,remainingKey:e}),n=c,r=!0;break}}return{node:n,remainingKey:e,stack:o}}deleteNode(e){if(e.value=void 0,this.leafNodes.delete(e),e.parent===void 0||e.childCount>1)return;let{node:r,edge:n}=e.parent;if(e.childCount===1){let[s,c]=Array.from(e.children)[0];e.removeChild(s),r.removeChild(n),r.addChild(n+s,c);return}if(r.removeChild(n),r.parent===void 0)return;let o=r.parent;if(r.value===void 0&&r.childCount===1){let[s,c]=Array.from(r.children)[0],l=o.edge+s;r.removeChild(s),o.node.removeChild(o.edge),o.node.addChild(l,c)}}evictLeastRecentlyUsed(){let e=this.findLeastRecentlyUsed();e&&this.deleteNode(e)}findLeastRecentlyUsed(){let e;for(let r of this.leafNodes)(e===void 0||r.touched{"use strict";p();Object.defineProperty(Hye,"__esModule",{value:!0});Hye.CompletionsCache=Hye.ICompletionsCacheService=void 0;var _rc=an(),ZLi=JLi();Hye.ICompletionsCacheService=(0,_rc.createServiceIdentifier)("ICompletionsCacheService");var Pkr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new ZLi.LRURadixTrie(100)}findAll(e,r){return this.cache.findAll(e).flatMap(({remainingKey:n,value:o})=>o.content.filter(s=>s.suffix===r&&s.choice.completionText.startsWith(n)&&s.choice.completionText.length>n.length).map(s=>({...s.choice,completionText:s.choice.completionText.slice(n.length),telemetryData:s.choice.telemetryData.extendedBy({},{foundOffset:n.length})})))}append(e,r,n){let o=this.cache.findAll(e);if(o.length>0&&o[0].remainingKey===""){let s=o[0].value.content;this.cache.set(e,{content:[...s,{suffix:r,choice:n}]})}else this.cache.set(e,{content:[{suffix:r,choice:n}]})}clear(){this.cache=new ZLi.LRURadixTrie(100)}};Hye.CompletionsCache=Pkr});var XLi=I(Gye=>{"use strict";p();Object.defineProperty(Gye,"__esModule",{value:!0});Gye.BlockMode=void 0;Gye.shouldDoParsingTrimming=Erc;Gye.shouldDoServerTrimming=vrc;var Mne;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Mne||(Gye.BlockMode=Mne={}));function Erc(t){return[Mne.Parsing,Mne.ParsingAndServer,Mne.MoreMultiline].includes(t)}a(Erc,"shouldDoParsingTrimming");function vrc(t){return[Mne.Server,Mne.ParsingAndServer].includes(t)}a(vrc,"shouldDoServerTrimming")});var One=I(xI=>{"use strict";p();var Crc=xI&&xI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xI,"__esModule",{value:!0});xI.WASMLanguage=void 0;xI.isSupportedLanguageId=Src;xI.languageIdToWasmLanguage=Lkr;xI.getLanguage=tBi;xI.parseTreeSitter=Irc;xI.parseTreeSitterIncludingVersion=rBi;xI.getBlockCloseToken=xrc;xI.queryPythonIsDocstring=krc;var Nkr=Crc(tue()),brc=JRr(),eBi=ZRr(),Pd;(function(t){t.Python="python",t.JavaScript="javascript",t.TypeScript="typescript",t.TSX="tsx",t.Go="go",t.Ruby="ruby",t.CSharp="c-sharp",t.Java="java",t.Php="php",t.Cpp="cpp"})(Pd||(xI.WASMLanguage=Pd={}));var Mkr={python:Pd.Python,javascript:Pd.JavaScript,javascriptreact:Pd.JavaScript,jsx:Pd.JavaScript,typescript:Pd.TypeScript,typescriptreact:Pd.TSX,go:Pd.Go,ruby:Pd.Ruby,csharp:Pd.CSharp,java:Pd.Java,php:Pd.Php,c:Pd.Cpp,cpp:Pd.Cpp};function Src(t){return t in Mkr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(Src,"isSupportedLanguageId");function Lkr(t){if(!(t in Mkr))throw new Error(`Unrecognized language: ${t}`);return Mkr[t]}a(Lkr,"languageIdToWasmLanguage");var Dkr=new Map;async function Trc(t){let e;try{e=await(0,eBi.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new brc.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return Nkr.default.Language.load(e)}a(Trc,"loadWasmLanguage");function tBi(t){let e=Lkr(t);if(!Dkr.has(e)){let r=Trc(e);Dkr.set(e,r)}return Dkr.get(e)}a(tBi,"getLanguage");var Okr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function Irc(t,e){return(await rBi(t,e))[0]}a(Irc,"parseTreeSitter");async function rBi(t,e){await Nkr.default.init({locateFile:a(s=>(0,eBi.locateFile)(s),"locateFile")});let r;try{r=new Nkr.default}catch(s){throw s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&s.message.includes("table index is out of bounds")?new Okr(`Could not init Parse for language <${t}>`,s):s}let n=await tBi(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(rBi,"parseTreeSitterIncludingVersion");function xrc(t){switch(Lkr(t)){case Pd.Python:return null;case Pd.JavaScript:case Pd.TypeScript:case Pd.TSX:case Pd.Go:case Pd.CSharp:case Pd.Java:case Pd.Php:case Pd.Cpp:return"}";case Pd.Ruby:return"end"}}a(xrc,"getBlockCloseToken");function wrc(t,e){let r=[];for(let n of t){if(!n[1]){let o=e.tree.getLanguage();n[1]=o.query(n[0])}r.push(...n[1].matches(e))}return r}a(wrc,"innerQuery");var Rrc=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function wrc(t){return Irc([xrc],t).length===1}a(wrc,"queryPythonIsDocstring")});var Hkr=I(zye=>{"use strict";p();Object.defineProperty(zye,"__esModule",{value:!0});zye.StatementTree=zye.StatementNode=void 0;var Rrc=Mne(),sN=class{static{a(this,"StatementNode")}constructor(e){this.node=e,this.children=[],this.collapsed=!1}addChild(e){e.parent=this,e.nextSibling=void 0,this.children.length>0&&(this.children[this.children.length-1].nextSibling=e),this.children.push(e)}childrenFinished(){}containsStatement(e){return this.node.startIndex<=e.node.startIndex&&this.node.endIndex>=e.node.endIndex}statementAt(e){if(this.node.startIndex>e||this.node.endIndex(r=n.statementAt(e),r!==void 0)),r??this}collapse(){this.children.length=0,this.collapsed=!0}get description(){return`${this.node.type} ([${this.node.startPosition.row},${this.node.startPosition.column}]..[${this.node.endPosition.row},${this.node.endPosition.column}]): ${JSON.stringify(this.node.text.length>33?this.node.text.substring(0,15)+"..."+this.node.text.slice(-15):this.node.text)}`}dump(e="",r=""){let n=[`${e}${this.description}`];return this.children.forEach(o=>{n.push(o.dump(`${r}+- `,o.nextSibling===void 0?`${r} `:`${r}| `))}),n.join(` +]`];function krc(t){return wrc([Rrc],t).length===1}a(krc,"queryPythonIsDocstring")});var Gkr=I(zye=>{"use strict";p();Object.defineProperty(zye,"__esModule",{value:!0});zye.StatementTree=zye.StatementNode=void 0;var Prc=One(),sN=class{static{a(this,"StatementNode")}constructor(e){this.node=e,this.children=[],this.collapsed=!1}addChild(e){e.parent=this,e.nextSibling=void 0,this.children.length>0&&(this.children[this.children.length-1].nextSibling=e),this.children.push(e)}childrenFinished(){}containsStatement(e){return this.node.startIndex<=e.node.startIndex&&this.node.endIndex>=e.node.endIndex}statementAt(e){if(this.node.startIndex>e||this.node.endIndex(r=n.statementAt(e),r!==void 0)),r??this}collapse(){this.children.length=0,this.collapsed=!0}get description(){return`${this.node.type} ([${this.node.startPosition.row},${this.node.startPosition.column}]..[${this.node.endPosition.row},${this.node.endPosition.column}]): ${JSON.stringify(this.node.text.length>33?this.node.text.substring(0,15)+"..."+this.node.text.slice(-15):this.node.text)}`}dump(e="",r=""){let n=[`${e}${this.description}`];return this.children.forEach(o=>{n.push(o.dump(`${r}+- `,o.nextSibling===void 0?`${r} `:`${r}| `))}),n.join(` `)}dumpPath(e="",r="",n=!1){if(this.parent){let o=this.parent.dumpPath(e,r,!0),s=o.length-o.lastIndexOf(` `)-1-r.length,c=" ".repeat(s),l=n?` ${r}${c}+- `:"";return o+this.description+l}else{let o=n?` -${r}+- `:"";return e+this.description+o}}};zye.StatementNode=sN;var uk=class{static{a(this,"StatementTree")}static isSupported(e){return $ye.languageIds.has(e)||Vye.languageIds.has(e)||lBe.languageIds.has(e)||Wye.languageIds.has(e)||uBe.languageIds.has(e)||dBe.languageIds.has(e)||fBe.languageIds.has(e)||pBe.languageIds.has(e)||hBe.languageIds.has(e)}static isTrimmedByDefault(e){return $ye.languageIds.has(e)||Vye.languageIds.has(e)||Wye.languageIds.has(e)}static create(e,r,n,o){if($ye.languageIds.has(e))return new $ye(e,r,n,o);if(Vye.languageIds.has(e))return new Vye(e,r,n,o);if(lBe.languageIds.has(e))return new lBe(e,r,n,o);if(Wye.languageIds.has(e))return new Wye(e,r,n,o);if(fBe.languageIds.has(e))return new fBe(e,r,n,o);if(uBe.languageIds.has(e))return new uBe(e,r,n,o);if(dBe.languageIds.has(e))return new dBe(e,r,n,o);if(pBe.languageIds.has(e))return new pBe(e,r,n,o);if(hBe.languageIds.has(e))return new hBe(e,r,n,o);throw new Error(`Unsupported languageId: ${e}`)}constructor(e,r,n,o){this.languageId=e,this.text=r,this.startOffset=n,this.endOffset=o,this.statements=[]}[Symbol.dispose](){this.tree&&(this.tree.delete(),this.tree=void 0)}clear(){this.statements.length=0}statementAt(e){let r;return this.statements.find(n=>(r=n.statementAt(e),r!==void 0)),r}async build(){let e=[];this.clear();let r=await this.parse();this.getStatementQuery(r).captures(r.rootNode,{startPosition:this.offsetToPosition(this.startOffset),endPosition:this.offsetToPosition(this.endOffset)}).forEach(o=>{let s=this.createNode(o.node);for(;e.length>0&&!e[0].containsStatement(s);)e.shift()?.childrenFinished();e.length>0?e[0].addChild(s):this.addStatement(s),e.unshift(s)}),e.forEach(o=>o.childrenFinished())}addStatement(e){e.parent=void 0,e.nextSibling=void 0,this.statements.length>0&&(this.statements[this.statements.length-1].nextSibling=e),this.statements.push(e)}async parse(){return this.tree||(this.tree=await(0,Rrc.parseTreeSitter)(this.languageId,this.text)),this.tree}getStatementQuery(e){return this.getQuery(e.getLanguage(),this.getStatementQueryText())}getQuery(e,r){return e.query(r)}offsetToPosition(e){let r=this.text.slice(0,e).split(` +${r}+- `:"";return e+this.description+o}}};zye.StatementNode=sN;var uk=class{static{a(this,"StatementTree")}static isSupported(e){return $ye.languageIds.has(e)||Vye.languageIds.has(e)||lBe.languageIds.has(e)||Wye.languageIds.has(e)||uBe.languageIds.has(e)||dBe.languageIds.has(e)||fBe.languageIds.has(e)||pBe.languageIds.has(e)||hBe.languageIds.has(e)}static isTrimmedByDefault(e){return $ye.languageIds.has(e)||Vye.languageIds.has(e)||Wye.languageIds.has(e)}static create(e,r,n,o){if($ye.languageIds.has(e))return new $ye(e,r,n,o);if(Vye.languageIds.has(e))return new Vye(e,r,n,o);if(lBe.languageIds.has(e))return new lBe(e,r,n,o);if(Wye.languageIds.has(e))return new Wye(e,r,n,o);if(fBe.languageIds.has(e))return new fBe(e,r,n,o);if(uBe.languageIds.has(e))return new uBe(e,r,n,o);if(dBe.languageIds.has(e))return new dBe(e,r,n,o);if(pBe.languageIds.has(e))return new pBe(e,r,n,o);if(hBe.languageIds.has(e))return new hBe(e,r,n,o);throw new Error(`Unsupported languageId: ${e}`)}constructor(e,r,n,o){this.languageId=e,this.text=r,this.startOffset=n,this.endOffset=o,this.statements=[]}[Symbol.dispose](){this.tree&&(this.tree.delete(),this.tree=void 0)}clear(){this.statements.length=0}statementAt(e){let r;return this.statements.find(n=>(r=n.statementAt(e),r!==void 0)),r}async build(){let e=[];this.clear();let r=await this.parse();this.getStatementQuery(r).captures(r.rootNode,{startPosition:this.offsetToPosition(this.startOffset),endPosition:this.offsetToPosition(this.endOffset)}).forEach(o=>{let s=this.createNode(o.node);for(;e.length>0&&!e[0].containsStatement(s);)e.shift()?.childrenFinished();e.length>0?e[0].addChild(s):this.addStatement(s),e.unshift(s)}),e.forEach(o=>o.childrenFinished())}addStatement(e){e.parent=void 0,e.nextSibling=void 0,this.statements.length>0&&(this.statements[this.statements.length-1].nextSibling=e),this.statements.push(e)}async parse(){return this.tree||(this.tree=await(0,Prc.parseTreeSitter)(this.languageId,this.text)),this.tree}getStatementQuery(e){return this.getQuery(e.getLanguage(),this.getStatementQueryText())}getQuery(e,r){return e.query(r)}offsetToPosition(e){let r=this.text.slice(0,e).split(` `),n=r.length-1,o=r[r.length-1].length;return{row:n,column:o}}dump(e=""){let r=[];return this.statements.forEach((n,o)=>{let s=`[${o}]`,c=" ".repeat(s.length);r.push(n.dump(`${e} ${s} `,`${e} ${c} `))}),r.join(` -`)}};zye.StatementTree=uk;var qEt=class t extends sN{static{a(this,"JSStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","generator_function_declaration","class_declaration","statement_block","if_statement","switch_statement","for_statement","for_in_statement","while_statement","do_statement","try_statement","with_statement","labeled_statement","method_definition","interface_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="statement_block"||this.children.length===2&&this.node.childForFieldName("alternative")!==null&&this.children[0].node.type!=="statement_block"&&this.children[1].node.type!=="statement_block"}},$ye=class extends uk{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new qEt(e)}getStatementQueryText(){return`[ +`)}};zye.StatementTree=uk;var jEt=class t extends sN{static{a(this,"JSStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","generator_function_declaration","class_declaration","statement_block","if_statement","switch_statement","for_statement","for_in_statement","while_statement","do_statement","try_statement","with_statement","labeled_statement","method_definition","interface_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="statement_block"||this.children.length===2&&this.node.childForFieldName("alternative")!==null&&this.children[0].node.type!=="statement_block"&&this.children[1].node.type!=="statement_block"}},$ye=class extends uk{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new jEt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -831,7 +831,7 @@ ${r}+- `:"";return e+this.description+o}}};zye.StatementNode=sN;var uk=class{sta (labeled_statement) (method_definition) (field_definition) - ] @statement`}},Vye=class extends uk{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new qEt(e)}getStatementQueryText(){return`[ + ] @statement`}},Vye=class extends uk{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new jEt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -854,7 +854,7 @@ ${r}+- `:"";return e+this.description+o}}};zye.StatementNode=sN;var uk=class{sta (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},Lkr=class t extends sN{static{a(this,"PyStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","for_statement","while_statement","try_statement","with_statement","function_definition","class_definition","decorated_definition","match_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"?!1:this.node.startPosition.row===this.node.endPosition.row}},lBe=class extends uk{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new Lkr(e)}getStatementQueryText(){return`[ + ] @statement`}},Bkr=class t extends sN{static{a(this,"PyStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","for_statement","while_statement","try_statement","with_statement","function_definition","class_definition","decorated_definition","match_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"?!1:this.node.startPosition.row===this.node.endPosition.row}},lBe=class extends uk{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new Bkr(e)}getStatementQueryText(){return`[ (future_import_statement) (import_statement) (import_from_statement) @@ -880,24 +880,24 @@ ${r}+- `:"";return e+this.description+o}}};zye.StatementNode=sN;var uk=class{sta (decorated_definition) (match_statement) (block) - ] @statement`}},Bkr=class t extends sN{static{a(this,"GoStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","method_declaration","if_statement","for_statement","expression_switch_statement","type_switch_statement","select_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},Wye=class extends uk{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new Bkr(e)}getStatementQueryText(){return`[ + ] @statement`}},Fkr=class t extends sN{static{a(this,"GoStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","method_declaration","if_statement","for_statement","expression_switch_statement","type_switch_statement","select_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},Wye=class extends uk{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new Fkr(e)}getStatementQueryText(){return`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},Fkr=class t extends sN{static{a(this,"PhpStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","else_clause","else_if_clause","for_statement","foreach_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","finally_clause","anonymous_function","compound_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},uBe=class extends uk{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new Fkr(e)}getStatementQueryText(){return`[ + ] @statement`}},Ukr=class t extends sN{static{a(this,"PhpStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","else_clause","else_if_clause","for_statement","foreach_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","finally_clause","anonymous_function","compound_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},uBe=class extends uk{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new Ukr(e)}getStatementQueryText(){return`[ (statement) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},Ukr=class t extends sN{static{a(this,"RubyStatementNode")}static{this.compoundTypeNames=new Set(["if","case","while","until","for","begin","module","class","method"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},dBe=class extends uk{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new Ukr(e)}getStatementQueryText(){return`[ + ] @statement`}},Qkr=class t extends sN{static{a(this,"RubyStatementNode")}static{this.compoundTypeNames=new Set(["if","case","while","until","for","begin","module","class","method"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},dBe=class extends uk{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new Qkr(e)}getStatementQueryText(){return`[ (_statement) (when) - ] @statement`}},Qkr=class t extends sN{static{a(this,"JavaStatementNode")}static{this.compoundTypeNames=new Set(["block","do_statement","enhanced_for_statement","for_statement","if_statement","labeled_statement","switch_expression","synchronized_statement","try_statement","try_with_resources_statement","while_statement","interface_declaration","method_declaration","constructor_declaration","compact_constructor_declaration","class_declaration","annotation_type_declaration","static_initializer"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},fBe=class extends uk{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new Qkr(e)}getStatementQueryText(){return`[ + ] @statement`}},qkr=class t extends sN{static{a(this,"JavaStatementNode")}static{this.compoundTypeNames=new Set(["block","do_statement","enhanced_for_statement","for_statement","if_statement","labeled_statement","switch_expression","synchronized_statement","try_statement","try_with_resources_statement","while_statement","interface_declaration","method_declaration","constructor_declaration","compact_constructor_declaration","class_declaration","annotation_type_declaration","static_initializer"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},fBe=class extends uk{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new qkr(e)}getStatementQueryText(){return`[ (statement) (field_declaration) (record_declaration) @@ -910,7 +910,7 @@ ${r}+- `:"";return e+this.description+o}}};zye.StatementNode=sN;var uk=class{sta (block) (static_initializer) (constructor_declaration) - ] @statement`}},qkr=class t extends sN{static{a(this,"CSharpStatementNode")}static{this.compoundTypeNames=new Set(["block","checked_statement","class_declaration","constructor_declaration","destructor_declaration","do_statement","fixed_statement","for_statement","foreach_statement","if_statement","interface_declaration","lock_statement","method_declaration","struct_declaration","switch_statement","try_statement","unsafe_statement","while_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},pBe=class extends uk{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new qkr(e)}getStatementQueryText(){return`[ + ] @statement`}},jkr=class t extends sN{static{a(this,"CSharpStatementNode")}static{this.compoundTypeNames=new Set(["block","checked_statement","class_declaration","constructor_declaration","destructor_declaration","do_statement","fixed_statement","for_statement","foreach_statement","if_statement","interface_declaration","lock_statement","method_declaration","struct_declaration","switch_statement","try_statement","unsafe_statement","while_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},pBe=class extends uk{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new jkr(e)}getStatementQueryText(){return`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -922,7 +922,7 @@ ${r}+- `:"";return e+this.description+o}}};zye.StatementNode=sN;var uk=class{sta (declaration) (accessor_declaration) (block) - ] @statement`}},jkr=class t extends sN{static{a(this,"CStatementNode")}static{this.compoundTypeNames=new Set(["declaration","function_definition","enum_specifier","field_declaration_list","type_definition","compound_statement","if_statement","switch_statement","while_statement","for_statement","do_statement","preproc_if","preproc_ifdef","namespace_definition","class_specifier","field_declaration_list","concept_definition","template_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){(this.isSingleLineDeclarationStatement()||this.isSingleLineConceptDefinition())&&this.collapse()}isSingleLineDeclarationStatement(){return!(this.node.type!=="declaration"||this.node.startPosition.row!==this.node.endPosition.row)}isSingleLineConceptDefinition(){return!(this.node.type!=="concept_definition"||this.node.startPosition.row!==this.node.endPosition.row)}},hBe=class extends uk{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new jkr(e)}getStatementQueryText(){return`[ + ] @statement`}},Hkr=class t extends sN{static{a(this,"CStatementNode")}static{this.compoundTypeNames=new Set(["declaration","function_definition","enum_specifier","field_declaration_list","type_definition","compound_statement","if_statement","switch_statement","while_statement","for_statement","do_statement","preproc_if","preproc_ifdef","namespace_definition","class_specifier","field_declaration_list","concept_definition","template_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){(this.isSingleLineDeclarationStatement()||this.isSingleLineConceptDefinition())&&this.collapse()}isSingleLineDeclarationStatement(){return!(this.node.type!=="declaration"||this.node.startPosition.row!==this.node.endPosition.row)}isSingleLineConceptDefinition(){return!(this.node.type!=="concept_definition"||this.node.startPosition.row!==this.node.endPosition.row)}},hBe=class extends uk{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new Hkr(e)}getStatementQueryText(){return`[ (declaration) (function_definition) (type_definition) @@ -959,30 +959,30 @@ ${r}+- `:"";return e+this.description+o}}};zye.StatementNode=sN;var uk=class{sta (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}}});var Yye=I(aN=>{"use strict";p();Object.defineProperty(aN,"__esModule",{value:!0});aN.BlockPositionType=aN.TerseBlockTrimmer=aN.VerboseBlockTrimmer=aN.BlockTrimmer=void 0;aN.getBlockPositionType=krc;var jEt=Hkr(),mBe=class{static{a(this,"BlockTrimmer")}static isSupported(e){return jEt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return jEt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=jEt.StatementTree.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length);await r.build();try{return await e(r)}finally{r[Symbol.dispose]()}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};aN.BlockTrimmer=mBe;var Gkr=class extends mBe{static{a(this,"VerboseBlockTrimmer")}constructor(e,r,n,o=10){super(e,r,n),this.lineLimit=o;let s=[...this.completion.matchAll(/\n/g)];s.length>=this.lineLimit&&this.lineLimit>0?this.offsetLimit=s[this.lineLimit-1].index:this.offsetLimit=void 0}async getCompletionTrimOffset(){return await this.withParsedStatementTree(e=>{let r=this.getStatementAtCursor(e),n=this.getContainingBlockOffset(r);return this.isWithinLimit(n)||(n=this.trimToBlankLine(n)),this.isWithinLimit(n)||(n=this.trimToStatement(r,n)),n})}isWithinLimit(e){return this.offsetLimit===void 0||e!==void 0&&e<=this.offsetLimit}trimToBlankLine(e){let r=[...this.trimmedCompletion(e).matchAll(/\r?\n\s*\r?\n/g)].reverse();for(;r.length>0&&!this.isWithinLimit(e);)e=r.pop().index;return e}trimToStatement(e,r){let n=this.prefix.length,o=this.prefix.length+(this.offsetLimit??this.completion.length),s=e,c=e?.nextSibling;for(;c&&c.node.endIndex<=o&&!this.hasNonStatementContentAfter(s);)s=c,c=c.nextSibling;return s&&s===e&&s.node.endIndex<=n&&(s=c),s&&s.node.endIndex>o?this.trimToStatement(s.children[0],this.asCompletionOffset(s.node.endIndex)):this.asCompletionOffset(s?.node?.endIndex)??r}};aN.VerboseBlockTrimmer=Gkr;var $kr=class extends mBe{static{a(this,"TerseBlockTrimmer")}constructor(e,r,n,o=3,s=7){super(e,r,n),this.lineLimit=o,this.lookAhead=s;let c=[...this.completion.matchAll(/\n/g)],l=this.lineLimit+this.lookAhead;c.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=c[this.lineLimit-1].index),c.length>=l&&l>0&&(this.lookAheadOffset=c[l-1].index)}async getCompletionTrimOffset(){return await this.withParsedStatementTree(e=>{let r=e.statementAt(this.stmtStartPos()),n=this.getContainingBlockOffset(r);return n=this.trimAtFirstBlankLine(n),r&&(n=this.trimAtStatementChange(r,n)),this.limitOffset&&this.lookAheadOffset&&(n===void 0||n>this.lookAheadOffset)?this.limitOffset:n})}stmtStartPos(){let e=this.completion.match(/\S/);return e&&e.index!==void 0?this.prefix.length+e.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(e){let r=[...this.trimmedCompletion(e).matchAll(/\r?\n\s*\r?\n/g)];for(;r.length>0&&(e===void 0||e>r[0].index);){let n=r.shift();if(this.completion.substring(0,n.index).trim()!=="")return n.index}return e}trimAtStatementChange(e,r){let n=this.prefix.length,o=this.prefix.length+(r??this.completion.length);if(e.node.endIndex>n&&this.isCompoundStatement(e))return e.nextSibling&&e.node.endIndexn&&s.node.endIndex{"use strict";p();var Prc=cN&&cN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},tBi=cN&&cN.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(cN,"__esModule",{value:!0});cN.ConfigBlockModeConfig=cN.ICompletionsBlockModeConfig=void 0;var Drc=an(),Nrc=Ks(),NL=JLi(),nBi=Mne(),rBi=eE(),Mrc=xy(),Orc=Yye(),Lrc=Hkr();cN.ICompletionsBlockModeConfig=(0,Drc.createServiceIdentifier)("ICompletionsBlockModeConfig");var Wkr=class{static{a(this,"ConfigBlockModeConfig")}constructor(e,r){this.instantiationService=e,this.featuresService=r}forLanguage(e,r){let n=this.featuresService.overrideBlockMode(r);if(n)return Vkr(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(rBi.getConfig,rBi.ConfigKey.AlwaysRequestMultiline)??o)||Orc.BlockTrimmer.isTrimmedByDefault(e)?Vkr(NL.BlockMode.MoreMultiline,e):e==="ruby"?NL.BlockMode.Parsing:(0,nBi.isSupportedLanguageId)(e)?NL.BlockMode.ParsingAndServer:NL.BlockMode.Server}};cN.ConfigBlockModeConfig=Wkr;cN.ConfigBlockModeConfig=Wkr=Prc([tBi(0,Nrc.IInstantiationService),tBi(1,Mrc.ICompletionsFeaturesService)],Wkr);function Brc(t){return[NL.BlockMode.Parsing,NL.BlockMode.ParsingAndServer,NL.BlockMode.MoreMultiline].includes(t)}a(Brc,"blockModeRequiresTreeSitter");function Vkr(t,e){return t===NL.BlockMode.MoreMultiline&&Lrc.StatementTree.isSupported(e)?t:Brc(t)&&!(0,nBi.isSupportedLanguageId)(e)?NL.BlockMode.Server:t}a(Vkr,"toApplicableBlockMode")});var iV=I(HEt=>{"use strict";p();Object.defineProperty(HEt,"__esModule",{value:!0});HEt.ResultType=void 0;var iBi;(function(t){t[t.Network=0]="Network",t[t.Cache=1]="Cache",t[t.TypingAsSuggested=2]="TypingAsSuggested",t[t.Cycling=3]="Cycling",t[t.Async=4]="Async"})(iBi||(HEt.ResultType=iBi={}))});var Kkr=I(Kye=>{"use strict";p();Object.defineProperty(Kye,"__esModule",{value:!0});Kye.CurrentGhostText=Kye.ICompletionsCurrentGhostText=void 0;var Frc=an(),Urc=iV();Kye.ICompletionsCurrentGhostText=(0,Frc.createServiceIdentifier)("ICompletionsCurrentGhostText");var Ykr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==Urc.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&oBi(this.choices[0].completionText,n))return Qrc(this.choices,n)}hasAcceptedCurrentCompletion(e,r){let n=this.getRemainingPrefix(e,r);if(n===void 0)return!1;let o=n===this.choices?.[0].completionText,s=this.choices?.[0].finishReason;return o&&s==="stop"}getRemainingPrefix(e,r){if(!(this.prefix===void 0||this.suffix===void 0||this.choices.length===0)&&this.suffix===r&&e.startsWith(this.prefix))return e.substring(this.prefix.length)}};Kye.CurrentGhostText=Ykr;function Qrc(t,e){return t.filter(r=>oBi(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(Qrc,"adjustChoicesStart");function oBi(t,e){return t.startsWith(e)&&t.length>e.length}a(oBi,"startsWithAndExceeds")});var sBi=I(lU=>{"use strict";p();var qrc=lU&&lU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},jrc=lU&&lU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(lU,"__esModule",{value:!0});lU.ChangeTracker=void 0;var Hrc=RS(),Jkr=class{static{a(this,"ChangeTracker")}get offset(){return this._offset}constructor(e,r,n){this._referenceCount=0,this._isDisposed=!1,this._offset=r,this._tracker=n.onDidChangeTextDocument(o=>{if(o.document.uri===e){for(let s of o.contentChanges)if(s.rangeOffset+s.rangeLength<=this.offset){let c=s.text.length-s.rangeLength;this._offset=this._offset+c}}})}push(e,r){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout(()=>{e(),this._referenceCount--,this._referenceCount===0&&(this._tracker.dispose(),this._isDisposed=!0)},r)}};lU.ChangeTracker=Jkr;lU.ChangeTracker=Jkr=qrc([jrc(2,Hrc.ICompletionsTextDocumentManagerService)],Jkr)});var Xkr=I(gBe=>{"use strict";p();Object.defineProperty(gBe,"__esModule",{value:!0});gBe.CompletionState=void 0;gBe.createCompletionState=Grc;var Zkr=WLe(),GEt=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??Zkr.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{"use strict";p();Object.defineProperty(Jye,"__esModule",{value:!0});Jye.SpeculativeRequestCache=Jye.ICompletionsSpeculativeRequestCache=void 0;var $rc=an(),Vrc=aU();Jye.ICompletionsSpeculativeRequestCache=(0,$rc.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var ePr=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new Vrc.LRUCacheMap(100)}set(e,r){this.cache.set(e,r)}async request(e){let r=this.cache.get(e);r!==void 0&&(this.cache.delete(e),await r())}};Jye.SpeculativeRequestCache=ePr});var Zye=I(eC=>{"use strict";p();Object.defineProperty(eC,"__esModule",{value:!0});eC.logger=eC.GHOST_TEXT_CATEGORY=void 0;eC.telemetryShown=zrc;eC.telemetryAccepted=Yrc;eC.telemetryRejected=Krc;eC.mkCanceledResultTelemetry=Jrc;eC.mkBasicResultTelemetry=Zrc;eC.handleGhostTextResultTelemetry=Xrc;eC.resultTypeToString=tPr;var aBi=Gl(),One=nA(),ABe=iV(),Wrc=$Et();eC.GHOST_TEXT_CATEGORY="ghostText";eC.logger=new aBi.Logger("getCompletions");function zrc(t,e){t.get(Wrc.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=tPr(e.resultType),(0,One.telemetry)(t,"ghostText.shown",e.telemetry)}a(zrc,"telemetryShown");function Yrc(t,e,r){let n=e+".accepted";(0,One.telemetry)(t,n,r)}a(Yrc,"telemetryAccepted");function Krc(t,e,r){let n=e+".rejected";(0,One.telemetry)(t,n,r)}a(Krc,"telemetryRejected");function Jrc(t,e={}){return{...e,telemetryBlob:t}}a(Jrc,"mkCanceledResultTelemetry");function Zrc(t){let e={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId};return t.properties.sku!==void 0&&(e.sku=t.properties.sku),t.properties.opportunityId!==void 0&&(e.opportunityId=t.properties.opportunityId),t.properties.organizations_list!==void 0&&(e.organizations_list=t.properties.organizations_list),t.properties.enterprise_list!==void 0&&(e.enterprise_list=t.properties.enterprise_list),t.properties.clientCompletionId!==void 0&&(e.clientCompletionId=t.properties.clientCompletionId),e}a(Zrc,"mkBasicResultTelemetry");function Xrc(t,e){let r=t.get(aBi.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,One.now)()-e.telemetryBlob.issuedTime,o=tPr(e.resultType),s=JSON.stringify(e.performanceMetrics),c={...e.telemetryData,reason:o,performanceMetrics:s},{foundOffset:l}=e.telemetryBlob.measurements,u=e.performanceMetrics?.map(([d,f])=>` -${f.toFixed(2)} ${d}`).join("")??"";return eC.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,One.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(eC.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,One.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,One.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(Xrc,"handleGhostTextResultTelemetry");function tPr(t){switch(t){case ABe.ResultType.Network:return"network";case ABe.ResultType.Cache:return"cache";case ABe.ResultType.Cycling:return"cycling";case ABe.ResultType.TypingAsSuggested:return"typingAsSuggested";case ABe.ResultType.Async:return"async"}}a(tPr,"resultTypeToString")});var uBi=I(Xye=>{"use strict";p();Object.defineProperty(Xye,"__esModule",{value:!0});Xye.getBlockParser=zEt;Xye.isEmptyBlockStart=nnc;Xye.isBlockBodyFinished=inc;Xye.getNodeStart=onc;var oV=Mne(),VEt=class{static{a(this,"BaseBlockParser")}constructor(e,r,n){this.languageId=e,this.nodeMatch=r,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,r,n){let o=await(0,oV.parseTreeSitter)(this.languageId,e);try{let c=o.rootNode.descendantForIndex(r);for(;c;){let l=this.nodeMatch[c.type];if(l){if(!this.nodeTypesWithBlockOrStmtChild.has(c.type))break;let u=this.nodeTypesWithBlockOrStmtChild.get(c.type);if((u===""?c.namedChildren[0]:c.childForFieldName(u))?.type===l)break}c=c.parent}return c?n(c):void 0}finally{o.delete()}}getNextBlockAtPosition(e,r,n){return this.getNodeMatchAtPosition(e,r,o=>{let s=o.children.reverse().find(c=>c.type===this.nodeMatch[o.type]);if(s){if(this.languageId==="python"&&s.parent){let c=s.parent.type===":"?s.parent.parent:s.parent,l=c?.nextSibling;for(;l&&l.type==="comment";){let u=l.startPosition.row===s.endPosition.row&&l.startPosition.column>=s.endPosition.column,d=l.startPosition.row>c.endPosition.row&&l.startPosition.column>c.startPosition.column;if(u||d)s=l,l=l.nextSibling;else break}}if(!(s.endIndex>=s.tree.rootNode.endIndex-1&&(s.hasError||s.parent.hasError)))return n(s)}})}async isBlockBodyFinished(e,r,n){let o=(e+r).trimEnd(),s=await this.getNextBlockAtPosition(o,n,c=>c.endIndex);if(s!==void 0&&s0?c:void 0}}getNodeStart(e,r){let n=e.trimEnd();return this.getNodeMatchAtPosition(n,r,o=>o.startIndex)}},WEt=class extends VEt{static{a(this,"RegexBasedBlockParser")}constructor(e,r,n,o,s){super(e,o,s),this.blockEmptyMatch=r,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,r){let n=await this.getNextBlockAtPosition(e,r,o=>{o.startIndex{"use strict";p();Object.defineProperty(aN,"__esModule",{value:!0});aN.BlockPositionType=aN.TerseBlockTrimmer=aN.VerboseBlockTrimmer=aN.BlockTrimmer=void 0;aN.getBlockPositionType=Drc;var HEt=Gkr(),mBe=class{static{a(this,"BlockTrimmer")}static isSupported(e){return HEt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return HEt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=HEt.StatementTree.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length);await r.build();try{return await e(r)}finally{r[Symbol.dispose]()}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};aN.BlockTrimmer=mBe;var $kr=class extends mBe{static{a(this,"VerboseBlockTrimmer")}constructor(e,r,n,o=10){super(e,r,n),this.lineLimit=o;let s=[...this.completion.matchAll(/\n/g)];s.length>=this.lineLimit&&this.lineLimit>0?this.offsetLimit=s[this.lineLimit-1].index:this.offsetLimit=void 0}async getCompletionTrimOffset(){return await this.withParsedStatementTree(e=>{let r=this.getStatementAtCursor(e),n=this.getContainingBlockOffset(r);return this.isWithinLimit(n)||(n=this.trimToBlankLine(n)),this.isWithinLimit(n)||(n=this.trimToStatement(r,n)),n})}isWithinLimit(e){return this.offsetLimit===void 0||e!==void 0&&e<=this.offsetLimit}trimToBlankLine(e){let r=[...this.trimmedCompletion(e).matchAll(/\r?\n\s*\r?\n/g)].reverse();for(;r.length>0&&!this.isWithinLimit(e);)e=r.pop().index;return e}trimToStatement(e,r){let n=this.prefix.length,o=this.prefix.length+(this.offsetLimit??this.completion.length),s=e,c=e?.nextSibling;for(;c&&c.node.endIndex<=o&&!this.hasNonStatementContentAfter(s);)s=c,c=c.nextSibling;return s&&s===e&&s.node.endIndex<=n&&(s=c),s&&s.node.endIndex>o?this.trimToStatement(s.children[0],this.asCompletionOffset(s.node.endIndex)):this.asCompletionOffset(s?.node?.endIndex)??r}};aN.VerboseBlockTrimmer=$kr;var Vkr=class extends mBe{static{a(this,"TerseBlockTrimmer")}constructor(e,r,n,o=3,s=7){super(e,r,n),this.lineLimit=o,this.lookAhead=s;let c=[...this.completion.matchAll(/\n/g)],l=this.lineLimit+this.lookAhead;c.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=c[this.lineLimit-1].index),c.length>=l&&l>0&&(this.lookAheadOffset=c[l-1].index)}async getCompletionTrimOffset(){return await this.withParsedStatementTree(e=>{let r=e.statementAt(this.stmtStartPos()),n=this.getContainingBlockOffset(r);return n=this.trimAtFirstBlankLine(n),r&&(n=this.trimAtStatementChange(r,n)),this.limitOffset&&this.lookAheadOffset&&(n===void 0||n>this.lookAheadOffset)?this.limitOffset:n})}stmtStartPos(){let e=this.completion.match(/\S/);return e&&e.index!==void 0?this.prefix.length+e.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(e){let r=[...this.trimmedCompletion(e).matchAll(/\r?\n\s*\r?\n/g)];for(;r.length>0&&(e===void 0||e>r[0].index);){let n=r.shift();if(this.completion.substring(0,n.index).trim()!=="")return n.index}return e}trimAtStatementChange(e,r){let n=this.prefix.length,o=this.prefix.length+(r??this.completion.length);if(e.node.endIndex>n&&this.isCompoundStatement(e))return e.nextSibling&&e.node.endIndexn&&s.node.endIndex{"use strict";p();var Nrc=cN&&cN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},nBi=cN&&cN.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(cN,"__esModule",{value:!0});cN.ConfigBlockModeConfig=cN.ICompletionsBlockModeConfig=void 0;var Mrc=an(),Orc=Ks(),NL=XLi(),oBi=One(),iBi=eE(),Lrc=xy(),Brc=Yye(),Frc=Gkr();cN.ICompletionsBlockModeConfig=(0,Mrc.createServiceIdentifier)("ICompletionsBlockModeConfig");var zkr=class{static{a(this,"ConfigBlockModeConfig")}constructor(e,r){this.instantiationService=e,this.featuresService=r}forLanguage(e,r){let n=this.featuresService.overrideBlockMode(r);if(n)return Wkr(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(iBi.getConfig,iBi.ConfigKey.AlwaysRequestMultiline)??o)||Brc.BlockTrimmer.isTrimmedByDefault(e)?Wkr(NL.BlockMode.MoreMultiline,e):e==="ruby"?NL.BlockMode.Parsing:(0,oBi.isSupportedLanguageId)(e)?NL.BlockMode.ParsingAndServer:NL.BlockMode.Server}};cN.ConfigBlockModeConfig=zkr;cN.ConfigBlockModeConfig=zkr=Nrc([nBi(0,Orc.IInstantiationService),nBi(1,Lrc.ICompletionsFeaturesService)],zkr);function Urc(t){return[NL.BlockMode.Parsing,NL.BlockMode.ParsingAndServer,NL.BlockMode.MoreMultiline].includes(t)}a(Urc,"blockModeRequiresTreeSitter");function Wkr(t,e){return t===NL.BlockMode.MoreMultiline&&Frc.StatementTree.isSupported(e)?t:Urc(t)&&!(0,oBi.isSupportedLanguageId)(e)?NL.BlockMode.Server:t}a(Wkr,"toApplicableBlockMode")});var oV=I(GEt=>{"use strict";p();Object.defineProperty(GEt,"__esModule",{value:!0});GEt.ResultType=void 0;var sBi;(function(t){t[t.Network=0]="Network",t[t.Cache=1]="Cache",t[t.TypingAsSuggested=2]="TypingAsSuggested",t[t.Cycling=3]="Cycling",t[t.Async=4]="Async"})(sBi||(GEt.ResultType=sBi={}))});var Jkr=I(Kye=>{"use strict";p();Object.defineProperty(Kye,"__esModule",{value:!0});Kye.CurrentGhostText=Kye.ICompletionsCurrentGhostText=void 0;var Qrc=an(),qrc=oV();Kye.ICompletionsCurrentGhostText=(0,Qrc.createServiceIdentifier)("ICompletionsCurrentGhostText");var Kkr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==qrc.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&aBi(this.choices[0].completionText,n))return jrc(this.choices,n)}hasAcceptedCurrentCompletion(e,r){let n=this.getRemainingPrefix(e,r);if(n===void 0)return!1;let o=n===this.choices?.[0].completionText,s=this.choices?.[0].finishReason;return o&&s==="stop"}getRemainingPrefix(e,r){if(!(this.prefix===void 0||this.suffix===void 0||this.choices.length===0)&&this.suffix===r&&e.startsWith(this.prefix))return e.substring(this.prefix.length)}};Kye.CurrentGhostText=Kkr;function jrc(t,e){return t.filter(r=>aBi(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(jrc,"adjustChoicesStart");function aBi(t,e){return t.startsWith(e)&&t.length>e.length}a(aBi,"startsWithAndExceeds")});var cBi=I(lU=>{"use strict";p();var Hrc=lU&&lU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Grc=lU&&lU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(lU,"__esModule",{value:!0});lU.ChangeTracker=void 0;var $rc=RS(),Zkr=class{static{a(this,"ChangeTracker")}get offset(){return this._offset}constructor(e,r,n){this._referenceCount=0,this._isDisposed=!1,this._offset=r,this._tracker=n.onDidChangeTextDocument(o=>{if(o.document.uri===e){for(let s of o.contentChanges)if(s.rangeOffset+s.rangeLength<=this.offset){let c=s.text.length-s.rangeLength;this._offset=this._offset+c}}})}push(e,r){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout(()=>{e(),this._referenceCount--,this._referenceCount===0&&(this._tracker.dispose(),this._isDisposed=!0)},r)}};lU.ChangeTracker=Zkr;lU.ChangeTracker=Zkr=Hrc([Grc(2,$rc.ICompletionsTextDocumentManagerService)],Zkr)});var ePr=I(gBe=>{"use strict";p();Object.defineProperty(gBe,"__esModule",{value:!0});gBe.CompletionState=void 0;gBe.createCompletionState=Vrc;var Xkr=WLe(),$Et=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??Xkr.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{"use strict";p();Object.defineProperty(Jye,"__esModule",{value:!0});Jye.SpeculativeRequestCache=Jye.ICompletionsSpeculativeRequestCache=void 0;var Wrc=an(),zrc=aU();Jye.ICompletionsSpeculativeRequestCache=(0,Wrc.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var tPr=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new zrc.LRUCacheMap(100)}set(e,r){this.cache.set(e,r)}async request(e){let r=this.cache.get(e);r!==void 0&&(this.cache.delete(e),await r())}};Jye.SpeculativeRequestCache=tPr});var Zye=I(eC=>{"use strict";p();Object.defineProperty(eC,"__esModule",{value:!0});eC.logger=eC.GHOST_TEXT_CATEGORY=void 0;eC.telemetryShown=Krc;eC.telemetryAccepted=Jrc;eC.telemetryRejected=Zrc;eC.mkCanceledResultTelemetry=Xrc;eC.mkBasicResultTelemetry=enc;eC.handleGhostTextResultTelemetry=tnc;eC.resultTypeToString=rPr;var lBi=Gl(),Lne=nA(),ABe=oV(),Yrc=VEt();eC.GHOST_TEXT_CATEGORY="ghostText";eC.logger=new lBi.Logger("getCompletions");function Krc(t,e){t.get(Yrc.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=rPr(e.resultType),(0,Lne.telemetry)(t,"ghostText.shown",e.telemetry)}a(Krc,"telemetryShown");function Jrc(t,e,r){let n=e+".accepted";(0,Lne.telemetry)(t,n,r)}a(Jrc,"telemetryAccepted");function Zrc(t,e,r){let n=e+".rejected";(0,Lne.telemetry)(t,n,r)}a(Zrc,"telemetryRejected");function Xrc(t,e={}){return{...e,telemetryBlob:t}}a(Xrc,"mkCanceledResultTelemetry");function enc(t){let e={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId};return t.properties.sku!==void 0&&(e.sku=t.properties.sku),t.properties.opportunityId!==void 0&&(e.opportunityId=t.properties.opportunityId),t.properties.organizations_list!==void 0&&(e.organizations_list=t.properties.organizations_list),t.properties.enterprise_list!==void 0&&(e.enterprise_list=t.properties.enterprise_list),t.properties.clientCompletionId!==void 0&&(e.clientCompletionId=t.properties.clientCompletionId),e}a(enc,"mkBasicResultTelemetry");function tnc(t,e){let r=t.get(lBi.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,Lne.now)()-e.telemetryBlob.issuedTime,o=rPr(e.resultType),s=JSON.stringify(e.performanceMetrics),c={...e.telemetryData,reason:o,performanceMetrics:s},{foundOffset:l}=e.telemetryBlob.measurements,u=e.performanceMetrics?.map(([d,f])=>` +${f.toFixed(2)} ${d}`).join("")??"";return eC.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,Lne.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(eC.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,Lne.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,Lne.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(tnc,"handleGhostTextResultTelemetry");function rPr(t){switch(t){case ABe.ResultType.Network:return"network";case ABe.ResultType.Cache:return"cache";case ABe.ResultType.Cycling:return"cycling";case ABe.ResultType.TypingAsSuggested:return"typingAsSuggested";case ABe.ResultType.Async:return"async"}}a(rPr,"resultTypeToString")});var fBi=I(Xye=>{"use strict";p();Object.defineProperty(Xye,"__esModule",{value:!0});Xye.getBlockParser=YEt;Xye.isEmptyBlockStart=onc;Xye.isBlockBodyFinished=snc;Xye.getNodeStart=anc;var sV=One(),WEt=class{static{a(this,"BaseBlockParser")}constructor(e,r,n){this.languageId=e,this.nodeMatch=r,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,r,n){let o=await(0,sV.parseTreeSitter)(this.languageId,e);try{let c=o.rootNode.descendantForIndex(r);for(;c;){let l=this.nodeMatch[c.type];if(l){if(!this.nodeTypesWithBlockOrStmtChild.has(c.type))break;let u=this.nodeTypesWithBlockOrStmtChild.get(c.type);if((u===""?c.namedChildren[0]:c.childForFieldName(u))?.type===l)break}c=c.parent}return c?n(c):void 0}finally{o.delete()}}getNextBlockAtPosition(e,r,n){return this.getNodeMatchAtPosition(e,r,o=>{let s=o.children.reverse().find(c=>c.type===this.nodeMatch[o.type]);if(s){if(this.languageId==="python"&&s.parent){let c=s.parent.type===":"?s.parent.parent:s.parent,l=c?.nextSibling;for(;l&&l.type==="comment";){let u=l.startPosition.row===s.endPosition.row&&l.startPosition.column>=s.endPosition.column,d=l.startPosition.row>c.endPosition.row&&l.startPosition.column>c.startPosition.column;if(u||d)s=l,l=l.nextSibling;else break}}if(!(s.endIndex>=s.tree.rootNode.endIndex-1&&(s.hasError||s.parent.hasError)))return n(s)}})}async isBlockBodyFinished(e,r,n){let o=(e+r).trimEnd(),s=await this.getNextBlockAtPosition(o,n,c=>c.endIndex);if(s!==void 0&&s0?c:void 0}}getNodeStart(e,r){let n=e.trimEnd();return this.getNodeMatchAtPosition(n,r,o=>o.startIndex)}},zEt=class extends WEt{static{a(this,"RegexBasedBlockParser")}constructor(e,r,n,o,s){super(e,o,s),this.blockEmptyMatch=r,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,r){let n=await this.getNextBlockAtPosition(e,r,o=>{o.startIndex0&&/\s/.test(t.charAt(r-1));)r--;return r}a(lBi,"rewindToNearestNonWs");function cBi(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(cBi,"indent");function tnc(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=cBi(t,r),o=cBi(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(tnc,"outdented");var ML=class extends VEt{static{a(this,"TreeSitterBasedBlockParser")}constructor(e,r,n,o,s,c,l){super(e,r,n),this.startKeywords=o,this.blockNodeType=s,this.emptyStatementType=c,this.curlyBraceLanguage=l}isBlockEmpty(e,r){let n=e.text.trim();return this.curlyBraceLanguage&&(n.startsWith("{")&&(n=n.slice(1)),n.endsWith("}")&&(n=n.slice(0,-1)),n=n.trim()),!!(n.length===0||this.languageId==="python"&&(e.parent?.type==="class_definition"||e.parent?.type==="function_definition")&&e.children.length===1&&(0,oV.queryPythonIsDocstring)(e.parent))}async isEmptyBlockStart(e,r){if(r>e.length)throw new RangeError("Invalid offset");for(let s=r;sg.type===";")&&f.endIndex<=r}f=f.parent}}let c=null,l=null,u=null,d=s;for(;d!==null;){if(d.type===this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if(d.type==="ERROR"){c=d;break}d=d.parent}if(l!==null){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if(this.languageId==="python"){let f=l.previousSibling;if(f!==null&&f.hasError&&(f.text.startsWith('"""')||f.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,r)}if(c!==null){if(c.previousSibling?.type==="module"||c.previousSibling?.type==="internal_module"||c.previousSibling?.type==="def")return!0;if(this.languageId==="python"&&o>=14&&c.hasError&&(c.text.startsWith('"')||c.text.startsWith("'"))){let g=c.parent?.type;if(g==="function_definition"||g==="class_definition"||g==="module")return!0}let f=[...c.children].reverse(),h=f.find(g=>this.startKeywords.includes(g.type)),m=f.find(g=>g.type===this.blockNodeType);if(h){switch(this.languageId){case"python":{h.type==="try"&&s.type==="identifier"&&s.text.length>4&&(m=f.find(y=>y.hasError)?.children.find(y=>y.type==="block"));let g,A=0;for(let y of c.children){if(y.type===":"&&A===0){g=y;break}y.type==="("&&(A+=1),y.type===")"&&(A-=1)}if(g&&h.endIndex<=g.startIndex&&g.nextSibling){if(h.type==="def"){let y=g.nextSibling;if(y.type==='"'||y.type==="'"||y.type==="ERROR"&&(y.text==='"""'||y.text==="'''"))return!0}return!1}break}case"javascript":{if(h.type==="class")if(o<=13){if(f.find(_=>_.type==="formal_parameters"))return!0}else{let y=c.children;for(let _=0;_y.type==="{");if(g&&g.startIndex>h.endIndex&&g.nextSibling!==null||f.find(y=>y.type==="do")&&h.type==="while"||h.type==="=>"&&h.nextSibling&&h.nextSibling.type!=="{")return!1;break}case"typescript":{let g=f.find(y=>y.type==="{");if(g&&g.startIndex>h.endIndex&&g.nextSibling!==null||f.find(y=>y.type==="do")&&h.type==="while"||h.type==="=>"&&h.nextSibling&&h.nextSibling.type!=="{")return!1;break}}return m&&m.startIndex>h.endIndex?this.isBlockEmpty(m,r):!0}}if(u!==null){let f=this.nodeMatch[u.type],h=u.children.slice().reverse().find(m=>m.type===f);if(h)return this.isBlockEmpty(h,r);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){let m=this.nodeTypesWithBlockOrStmtChild.get(u.type),g=m===""?u.children[0]:u.childForFieldName(m);if(g&&g.type!==this.blockNodeType&&g.type!==this.emptyStatementType)return!1}return!0}return!1}finally{n.delete()}}},rnc={python:new ML("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new ML("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new ML("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),tsx:new ML("typescriptreact",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new WEt("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new WEt("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map),"c-sharp":new ML("csharp",{},new Map([]),[],"block",null,!0),java:new ML("java",{},new Map([]),[],"block",null,!0),php:new ML("php",{},new Map([]),[],"block",null,!0),cpp:new ML("cpp",{},new Map([]),[],"block",null,!0)};function zEt(t){if(!(0,oV.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return rnc[(0,oV.languageIdToWasmLanguage)(t)]}a(zEt,"getBlockParser");async function nnc(t,e,r){return(0,oV.isSupportedLanguageId)(t)?zEt(t).isEmptyBlockStart(e,r):!1}a(nnc,"isEmptyBlockStart");async function inc(t,e,r,n){if((0,oV.isSupportedLanguageId)(t))return zEt(t).isBlockBodyFinished(e,r,n)}a(inc,"isBlockBodyFinished");async function onc(t,e,r){if((0,oV.isSupportedLanguageId)(t))return zEt(t).getNodeStart(e,r)}a(onc,"getNodeStart")});var JEt=I(sV=>{"use strict";p();Object.defineProperty(sV,"__esModule",{value:!0});sV.parsingBlockFinished=snc;sV.isEmptyBlockStartUtil=anc;sV.getNodeStartUtil=cnc;sV.contextIndentation=fnc;sV.contextIndentationFromText=dBi;sV.indentationBlockFinished=mnc;var rPr=uBi(),KEt=Qye();function snc(t,e){let r=t.getText(KEt.LocationFactory.range(KEt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,rPr.isBlockBodyFinished)(o,r,s,n)}a(snc,"parsingBlockFinished");function anc(t,e){return(0,rPr.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(anc,"isEmptyBlockStartUtil");async function cnc(t,e,r){let o=t.getText(KEt.LocationFactory.range(KEt.LocationFactory.position(0,0),e))+r,s=await(0,rPr.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a(cnc,"getNodeStartUtil");var lnc=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),unc=new RegExp(`^(${lnc.join("|")})`);function dnc(t){return unc.test(t.trimLeft().toLowerCase())}a(dnc,"isContinuationLine");function YEt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(YEt,"indentationOfLine");function fnc(t,e){let r=t.getText(),n=t.offsetAt(e);return dBi(r,n,t.detectedLanguageId)}a(fnc,"contextIndentation");function dBi(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(rnc,"getLineAtOffset");function dBi(t,e){let r=e;for(;r>0&&/\s/.test(t.charAt(r-1));)r--;return r}a(dBi,"rewindToNearestNonWs");function uBi(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(uBi,"indent");function nnc(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=uBi(t,r),o=uBi(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(nnc,"outdented");var ML=class extends WEt{static{a(this,"TreeSitterBasedBlockParser")}constructor(e,r,n,o,s,c,l){super(e,r,n),this.startKeywords=o,this.blockNodeType=s,this.emptyStatementType=c,this.curlyBraceLanguage=l}isBlockEmpty(e,r){let n=e.text.trim();return this.curlyBraceLanguage&&(n.startsWith("{")&&(n=n.slice(1)),n.endsWith("}")&&(n=n.slice(0,-1)),n=n.trim()),!!(n.length===0||this.languageId==="python"&&(e.parent?.type==="class_definition"||e.parent?.type==="function_definition")&&e.children.length===1&&(0,sV.queryPythonIsDocstring)(e.parent))}async isEmptyBlockStart(e,r){if(r>e.length)throw new RangeError("Invalid offset");for(let s=r;sg.type===";")&&f.endIndex<=r}f=f.parent}}let c=null,l=null,u=null,d=s;for(;d!==null;){if(d.type===this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if(d.type==="ERROR"){c=d;break}d=d.parent}if(l!==null){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if(this.languageId==="python"){let f=l.previousSibling;if(f!==null&&f.hasError&&(f.text.startsWith('"""')||f.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,r)}if(c!==null){if(c.previousSibling?.type==="module"||c.previousSibling?.type==="internal_module"||c.previousSibling?.type==="def")return!0;if(this.languageId==="python"&&o>=14&&c.hasError&&(c.text.startsWith('"')||c.text.startsWith("'"))){let g=c.parent?.type;if(g==="function_definition"||g==="class_definition"||g==="module")return!0}let f=[...c.children].reverse(),h=f.find(g=>this.startKeywords.includes(g.type)),m=f.find(g=>g.type===this.blockNodeType);if(h){switch(this.languageId){case"python":{h.type==="try"&&s.type==="identifier"&&s.text.length>4&&(m=f.find(y=>y.hasError)?.children.find(y=>y.type==="block"));let g,A=0;for(let y of c.children){if(y.type===":"&&A===0){g=y;break}y.type==="("&&(A+=1),y.type===")"&&(A-=1)}if(g&&h.endIndex<=g.startIndex&&g.nextSibling){if(h.type==="def"){let y=g.nextSibling;if(y.type==='"'||y.type==="'"||y.type==="ERROR"&&(y.text==='"""'||y.text==="'''"))return!0}return!1}break}case"javascript":{if(h.type==="class")if(o<=13){if(f.find(_=>_.type==="formal_parameters"))return!0}else{let y=c.children;for(let _=0;_y.type==="{");if(g&&g.startIndex>h.endIndex&&g.nextSibling!==null||f.find(y=>y.type==="do")&&h.type==="while"||h.type==="=>"&&h.nextSibling&&h.nextSibling.type!=="{")return!1;break}case"typescript":{let g=f.find(y=>y.type==="{");if(g&&g.startIndex>h.endIndex&&g.nextSibling!==null||f.find(y=>y.type==="do")&&h.type==="while"||h.type==="=>"&&h.nextSibling&&h.nextSibling.type!=="{")return!1;break}}return m&&m.startIndex>h.endIndex?this.isBlockEmpty(m,r):!0}}if(u!==null){let f=this.nodeMatch[u.type],h=u.children.slice().reverse().find(m=>m.type===f);if(h)return this.isBlockEmpty(h,r);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){let m=this.nodeTypesWithBlockOrStmtChild.get(u.type),g=m===""?u.children[0]:u.childForFieldName(m);if(g&&g.type!==this.blockNodeType&&g.type!==this.emptyStatementType)return!1}return!0}return!1}finally{n.delete()}}},inc={python:new ML("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new ML("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new ML("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),tsx:new ML("typescriptreact",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new zEt("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new zEt("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map),"c-sharp":new ML("csharp",{},new Map([]),[],"block",null,!0),java:new ML("java",{},new Map([]),[],"block",null,!0),php:new ML("php",{},new Map([]),[],"block",null,!0),cpp:new ML("cpp",{},new Map([]),[],"block",null,!0)};function YEt(t){if(!(0,sV.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return inc[(0,sV.languageIdToWasmLanguage)(t)]}a(YEt,"getBlockParser");async function onc(t,e,r){return(0,sV.isSupportedLanguageId)(t)?YEt(t).isEmptyBlockStart(e,r):!1}a(onc,"isEmptyBlockStart");async function snc(t,e,r,n){if((0,sV.isSupportedLanguageId)(t))return YEt(t).isBlockBodyFinished(e,r,n)}a(snc,"isBlockBodyFinished");async function anc(t,e,r){if((0,sV.isSupportedLanguageId)(t))return YEt(t).getNodeStart(e,r)}a(anc,"getNodeStart")});var ZEt=I(aV=>{"use strict";p();Object.defineProperty(aV,"__esModule",{value:!0});aV.parsingBlockFinished=cnc;aV.isEmptyBlockStartUtil=lnc;aV.getNodeStartUtil=unc;aV.contextIndentation=hnc;aV.contextIndentationFromText=pBi;aV.indentationBlockFinished=Anc;var nPr=fBi(),JEt=Qye();function cnc(t,e){let r=t.getText(JEt.LocationFactory.range(JEt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,nPr.isBlockBodyFinished)(o,r,s,n)}a(cnc,"parsingBlockFinished");function lnc(t,e){return(0,nPr.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(lnc,"isEmptyBlockStartUtil");async function unc(t,e,r){let o=t.getText(JEt.LocationFactory.range(JEt.LocationFactory.position(0,0),e))+r,s=await(0,nPr.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a(unc,"getNodeStartUtil");var dnc=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),fnc=new RegExp(`^(${dnc.join("|")})`);function pnc(t){return fnc.test(t.trimLeft().toLowerCase())}a(pnc,"isContinuationLine");function KEt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(KEt,"indentationOfLine");function hnc(t,e){let r=t.getText(),n=t.offsetAt(e);return pBi(r,n,t.detectedLanguageId)}a(hnc,"contextIndentation");function pBi(t,e,r){let n=t.slice(0,e).split(` `),o=t.slice(e).split(` -`);function s(f,h,m){let g=h,A,y;for(;A===void 0&&g>=0&&g=0&&!f[g].trim().startsWith('"""');)g--;if(g>=0)for(A=void 0,g--;A===void 0&&g>=0;)A=YEt(f[g]),y=g,g--}}return[A,y]}a(s,"seekNonBlank");let[c,l]=s(n,n.length-1,-1),u=(()=>{if(!(c===void 0||l===void 0))for(let f=l-1;f>=0;f--){let h=YEt(n[f]);if(h!==void 0&&h=0&&g=0&&!f[g].trim().startsWith('"""');)g--;if(g>=0)for(A=void 0,g--;A===void 0&&g>=0;)A=KEt(f[g]),y=g,g--}}return[A,y]}a(s,"seekNonBlank");let[c,l]=s(n,n.length-1,-1),u=(()=>{if(!(c===void 0||l===void 0))for(let f=l-1;f>=0;f--){let h=KEt(n[f]);if(h!==void 0&&h{let n=hnc(r,t,e);return n==="continue"?void 0:n}}a(mnc,"indentationBlockFinished")});var yBe=I(aA=>{"use strict";p();Object.defineProperty(aA,"__esModule",{value:!0});aA.languageMarkers=void 0;aA.mdCodeBlockLangToLanguageId=gnc;aA.isShebangLine=_nc;aA.hasLanguageMarker=pBi;aA.comment=hBi;aA.commentBlockAsSingles=Enc;aA.getLanguageMarker=vnc;aA.getPathMarker=Cnc;aA.newLineEnded=bnc;aA.getLanguage=Snc;aA.languageMarkers={abap:{lineComment:{start:'"',end:""},markdownLanguageIds:["abap","sap-abap"]},aspdotnet:{lineComment:{start:"<%--",end:"--%>"}},bat:{lineComment:{start:"REM",end:""}},bibtex:{lineComment:{start:"%",end:""},markdownLanguageIds:["bibtex"]},blade:{lineComment:{start:"#",end:""}},BluespecSystemVerilog:{lineComment:{start:"//",end:""}},c:{lineComment:{start:"//",end:""},markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";",end:""},markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["coffeescript","coffee","cson","iced"]},cpp:{lineComment:{start:"//",end:""},markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"]},csharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["csharp","cs"]},css:{lineComment:{start:"/*",end:"*/"}},cuda:{lineComment:{start:"//",end:""}},dart:{lineComment:{start:"//",end:""}},dockerfile:{lineComment:{start:"#",end:""},markdownLanguageIds:["dockerfile","docker"]},dotenv:{lineComment:{start:"#",end:""}},elixir:{lineComment:{start:"#",end:""}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%",end:""},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"]},go:{lineComment:{start:"//",end:""},markdownLanguageIds:["go","golang"]},graphql:{lineComment:{start:"#",end:""}},groovy:{lineComment:{start:"//",end:""}},haml:{lineComment:{start:"-#",end:""}},handlebars:{lineComment:{start:"{{!",end:"}}"},markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"]},haskell:{lineComment:{start:"--",end:""},markdownLanguageIds:["haskell","hs"]},hlsl:{lineComment:{start:"//",end:""}},html:{lineComment:{start:""},markdownLanguageIds:["html","xhtml"]},ini:{lineComment:{start:";",end:""}},java:{lineComment:{start:"//",end:""},markdownLanguageIds:["java","jsp"]},javascript:{lineComment:{start:"//",end:""},markdownLanguageIds:["javascript","js"]},javascriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},jsonc:{lineComment:{start:"//",end:""}},jsx:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#",end:""},markdownLanguageIds:["julia","jl"]},kotlin:{lineComment:{start:"//",end:""},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%",end:""},markdownLanguageIds:["tex"]},legend:{lineComment:{start:"//",end:""}},less:{lineComment:{start:"//",end:""}},lua:{lineComment:{start:"--",end:""},markdownLanguageIds:["lua","pluto"]},makefile:{lineComment:{start:"#",end:""},markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:"[]: #",end:""},markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec","mm","objc","obj-c"]},"objective-cpp":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#",end:""},markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//",end:""}},powershell:{lineComment:{start:"#",end:""},markdownLanguageIds:["powershell","ps","ps1"]},pug:{lineComment:{start:"//",end:""}},python:{lineComment:{start:"#",end:""},markdownLanguageIds:["python","py","gyp"]},ql:{lineComment:{start:"//",end:""}},r:{lineComment:{start:"#",end:""}},razor:{lineComment:{start:""},markdownLanguageIds:["cshtml","razor","razor-cshtml"]},ruby:{lineComment:{start:"#",end:""},markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"]},rust:{lineComment:{start:"//",end:""},markdownLanguageIds:["rust","rs"]},sass:{lineComment:{start:"//",end:""}},scala:{lineComment:{start:"//",end:""}},scss:{lineComment:{start:"//",end:""}},shellscript:{lineComment:{start:"#",end:""},markdownLanguageIds:["bash","sh","zsh"]},slang:{lineComment:{start:"//",end:""}},slim:{lineComment:{start:"/",end:""}},solidity:{lineComment:{start:"//",end:""},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--",end:""}},stylus:{lineComment:{start:"//",end:""}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//",end:""}},systemverilog:{lineComment:{start:"//",end:""}},terraform:{lineComment:{start:"#",end:""}},tex:{lineComment:{start:"%",end:""}},typescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["typescript","ts"]},typescriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["tsx"]},vb:{lineComment:{start:"'",end:""},markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//",end:""}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//",end:""}},xml:{lineComment:{start:""}},xsl:{lineComment:{start:""}},yaml:{lineComment:{start:"#",end:""},markdownLanguageIds:["yaml","yml"]}};var nPr={};for(let[t,e]of Object.entries(aA.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)nPr[r]=t;else nPr[t]=t;function gnc(t){return nPr[t]}a(gnc,"mdCodeBlockLangToLanguageId");var Anc={start:"//",end:""},ync=["php","plaintext"],iPr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function _nc(t){return Object.values(iPr).includes(t.trim())}a(_nc,"isShebangLine");function pBi({source:t}){return t.startsWith("#!")||t.startsWith("{let n=gnc(r,t,e);return n==="continue"?void 0:n}}a(Anc,"indentationBlockFinished")});var yBe=I(aA=>{"use strict";p();Object.defineProperty(aA,"__esModule",{value:!0});aA.languageMarkers=void 0;aA.mdCodeBlockLangToLanguageId=ync;aA.isShebangLine=vnc;aA.hasLanguageMarker=mBi;aA.comment=gBi;aA.commentBlockAsSingles=Cnc;aA.getLanguageMarker=bnc;aA.getPathMarker=Snc;aA.newLineEnded=Tnc;aA.getLanguage=Inc;aA.languageMarkers={abap:{lineComment:{start:'"',end:""},markdownLanguageIds:["abap","sap-abap"]},aspdotnet:{lineComment:{start:"<%--",end:"--%>"}},bat:{lineComment:{start:"REM",end:""}},bibtex:{lineComment:{start:"%",end:""},markdownLanguageIds:["bibtex"]},blade:{lineComment:{start:"#",end:""}},BluespecSystemVerilog:{lineComment:{start:"//",end:""}},c:{lineComment:{start:"//",end:""},markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";",end:""},markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["coffeescript","coffee","cson","iced"]},cpp:{lineComment:{start:"//",end:""},markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"]},csharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["csharp","cs"]},css:{lineComment:{start:"/*",end:"*/"}},cuda:{lineComment:{start:"//",end:""}},dart:{lineComment:{start:"//",end:""}},dockerfile:{lineComment:{start:"#",end:""},markdownLanguageIds:["dockerfile","docker"]},dotenv:{lineComment:{start:"#",end:""}},elixir:{lineComment:{start:"#",end:""}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%",end:""},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"]},go:{lineComment:{start:"//",end:""},markdownLanguageIds:["go","golang"]},graphql:{lineComment:{start:"#",end:""}},groovy:{lineComment:{start:"//",end:""}},haml:{lineComment:{start:"-#",end:""}},handlebars:{lineComment:{start:"{{!",end:"}}"},markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"]},haskell:{lineComment:{start:"--",end:""},markdownLanguageIds:["haskell","hs"]},hlsl:{lineComment:{start:"//",end:""}},html:{lineComment:{start:""},markdownLanguageIds:["html","xhtml"]},ini:{lineComment:{start:";",end:""}},java:{lineComment:{start:"//",end:""},markdownLanguageIds:["java","jsp"]},javascript:{lineComment:{start:"//",end:""},markdownLanguageIds:["javascript","js"]},javascriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},jsonc:{lineComment:{start:"//",end:""}},jsx:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#",end:""},markdownLanguageIds:["julia","jl"]},kotlin:{lineComment:{start:"//",end:""},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%",end:""},markdownLanguageIds:["tex"]},legend:{lineComment:{start:"//",end:""}},less:{lineComment:{start:"//",end:""}},lua:{lineComment:{start:"--",end:""},markdownLanguageIds:["lua","pluto"]},makefile:{lineComment:{start:"#",end:""},markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:"[]: #",end:""},markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec","mm","objc","obj-c"]},"objective-cpp":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#",end:""},markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//",end:""}},powershell:{lineComment:{start:"#",end:""},markdownLanguageIds:["powershell","ps","ps1"]},pug:{lineComment:{start:"//",end:""}},python:{lineComment:{start:"#",end:""},markdownLanguageIds:["python","py","gyp"]},ql:{lineComment:{start:"//",end:""}},r:{lineComment:{start:"#",end:""}},razor:{lineComment:{start:""},markdownLanguageIds:["cshtml","razor","razor-cshtml"]},ruby:{lineComment:{start:"#",end:""},markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"]},rust:{lineComment:{start:"//",end:""},markdownLanguageIds:["rust","rs"]},sass:{lineComment:{start:"//",end:""}},scala:{lineComment:{start:"//",end:""}},scss:{lineComment:{start:"//",end:""}},shellscript:{lineComment:{start:"#",end:""},markdownLanguageIds:["bash","sh","zsh"]},slang:{lineComment:{start:"//",end:""}},slim:{lineComment:{start:"/",end:""}},solidity:{lineComment:{start:"//",end:""},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--",end:""}},stylus:{lineComment:{start:"//",end:""}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//",end:""}},systemverilog:{lineComment:{start:"//",end:""}},terraform:{lineComment:{start:"#",end:""}},tex:{lineComment:{start:"%",end:""}},typescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["typescript","ts"]},typescriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["tsx"]},vb:{lineComment:{start:"'",end:""},markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//",end:""}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//",end:""}},xml:{lineComment:{start:""}},xsl:{lineComment:{start:""}},yaml:{lineComment:{start:"#",end:""},markdownLanguageIds:["yaml","yml"]}};var iPr={};for(let[t,e]of Object.entries(aA.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)iPr[r]=t;else iPr[t]=t;function ync(t){return iPr[t]}a(ync,"mdCodeBlockLangToLanguageId");var _nc={start:"//",end:""},Enc=["php","plaintext"],oPr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function vnc(t){return Object.values(oPr).includes(t.trim())}a(vnc,"isShebangLine");function mBi({source:t}){return t.startsWith("#!")||t.startsWith("hBi(s,e)).join(` +`).map(s=>gBi(s,e)).join(` `);return r?o+` -`:o}a(Enc,"commentBlockAsSingles");function vnc(t){let{languageId:e}=t;return ync.indexOf(e)===-1&&!pBi(t)?e in iPr?iPr[e]:`Language: ${e}`:""}a(vnc,"getLanguageMarker");function Cnc(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(Cnc,"getPathMarker");function bnc(t){return t===""||t.endsWith(` +`:o}a(Cnc,"commentBlockAsSingles");function bnc(t){let{languageId:e}=t;return Enc.indexOf(e)===-1&&!mBi(t)?e in oPr?oPr[e]:`Language: ${e}`:""}a(bnc,"getLanguageMarker");function Snc(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(Snc,"getPathMarker");function Tnc(t){return t===""||t.endsWith(` `)?t:t+` -`}a(bnc,"newLineEnded");function Snc(t){return fBi(typeof t=="string"?t:"plaintext")}a(Snc,"getLanguage");function fBi(t){return aA.languageMarkers[t]!==void 0?{languageId:t,...aA.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a(fBi,"_getLanguage")});var sPr=I(oPr=>{"use strict";p();Object.defineProperty(oPr,"__esModule",{value:!0});oPr.getCursorContext=xnc;var mBi=Rne(),Tnc={tokenizerName:mBi.TokenizerName.o200k};function Inc(t){return{...Tnc,...t}}a(Inc,"cursorContextOptions");function xnc(t,e={}){let r=Inc(e),n=(0,mBi.getTokenizer)(r.tokenizerName);if(r.maxLineCount!==void 0&&r.maxLineCount<0)throw new Error("maxLineCount must be non-negative if defined");if(r.maxTokenLength!==void 0&&r.maxTokenLength<0)throw new Error("maxTokenLength must be non-negative if defined");if(r.maxLineCount===0||r.maxTokenLength===0)return{context:"",lineCount:0,tokenLength:0,tokenizerName:r.tokenizerName};let o=t.source.slice(0,t.offset);return r.maxLineCount!==void 0&&(o=o.split(` +`}a(Tnc,"newLineEnded");function Inc(t){return hBi(typeof t=="string"?t:"plaintext")}a(Inc,"getLanguage");function hBi(t){return aA.languageMarkers[t]!==void 0?{languageId:t,...aA.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a(hBi,"_getLanguage")});var aPr=I(sPr=>{"use strict";p();Object.defineProperty(sPr,"__esModule",{value:!0});sPr.getCursorContext=Rnc;var ABi=kne(),xnc={tokenizerName:ABi.TokenizerName.o200k};function wnc(t){return{...xnc,...t}}a(wnc,"cursorContextOptions");function Rnc(t,e={}){let r=wnc(e),n=(0,ABi.getTokenizer)(r.tokenizerName);if(r.maxLineCount!==void 0&&r.maxLineCount<0)throw new Error("maxLineCount must be non-negative if defined");if(r.maxTokenLength!==void 0&&r.maxTokenLength<0)throw new Error("maxTokenLength must be non-negative if defined");if(r.maxLineCount===0||r.maxTokenLength===0)return{context:"",lineCount:0,tokenLength:0,tokenizerName:r.tokenizerName};let o=t.source.slice(0,t.offset);return r.maxLineCount!==void 0&&(o=o.split(` `).slice(-r.maxLineCount).join(` `)),r.maxTokenLength!==void 0&&(o=n.takeLastLinesTokens(o,r.maxTokenLength)),{context:o,lineCount:o.split(` -`).length,tokenLength:n.tokenLength(o),tokenizerName:r.tokenizerName}}a(xnc,"getCursorContext")});var XEt=I(e_e=>{"use strict";p();Object.defineProperty(e_e,"__esModule",{value:!0});e_e.DisposablesLRUCache=e_e.LRUCache=void 0;var _Be=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},ZEt=class{static{a(this,"LRUCache")}constructor(e=10){if(e<1)throw new Error("Cache size must be at least 1");this._capacity=e,this._cache=new Map,this._head=new _Be("",null),this._tail=new _Be("",null),this._head.next=this._tail,this._tail.prev=this._head}_addNode(e){e.prev=this._head,e.next=this._head.next,this._head.next.prev=e,this._head.next=e}_removeNode(e){let r=e.prev,n=e.next;r.next=n,n.prev=r}_moveToHead(e){this._removeNode(e),this._addNode(e)}_popTail(){let e=this._tail.prev;return this._removeNode(e),e}clear(){this._cache.clear(),this._head.next=this._tail,this._tail.prev=this._head}deleteKey(e){let r=this._cache.get(e);if(r)return this._removeNode(r),this._cache.delete(e),r.value}get(e){let r=this._cache.get(e);if(r)return this._moveToHead(r),r.value}keys(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push(r.key),r=r.next;return e}getValues(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push(r.value),r=r.next;return e}put(e,r){let n=this._cache.get(e);if(n)n.value=r,this._moveToHead(n);else if(n=new _Be(e,r),this._cache.set(e,n),this._addNode(n),this._cache.size>this._capacity){let o=this._popTail();return this._cache.delete(o.key),[o.key,o.value]}}entries(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push([r.key,r.value]),r=r.next;return e}};e_e.LRUCache=ZEt;var aPr=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new ZEt(e)}dispose(){this.clear()}clear(){let e=this.actual.getValues();for(let r of e)r.dispose();this.actual.clear()}deleteKey(e){let r=this.actual.deleteKey(e);r&&r.dispose()}get(e){return this.actual.get(e)}keys(){return this.actual.keys()}getValues(){return this.actual.getValues()}put(e,r){let n=this.actual.put(e,r);n&&n[1].dispose()}};e_e.DisposablesLRUCache=aPr});var cPr=I(Lne=>{"use strict";p();Object.defineProperty(Lne,"__esModule",{value:!0});Lne.SnippetSemantics=Lne.SnippetProviderType=void 0;Lne.announceSnippet=Rnc;var gBi;(function(t){t.SimilarFiles="similar-files",t.Path="path"})(gBi||(Lne.SnippetProviderType=gBi={}));var kS;(function(t){t.Function="function",t.Snippet="snippet",t.Snippets="snippets",t.Variable="variable",t.Parameter="parameter",t.Method="method",t.Class="class",t.Module="module",t.Alias="alias",t.Enum="enum member",t.Interface="interface"})(kS||(Lne.SnippetSemantics=kS={}));var wnc={[kS.Function]:"function",[kS.Snippet]:"snippet",[kS.Snippets]:"snippets",[kS.Variable]:"variable",[kS.Parameter]:"parameter",[kS.Method]:"method",[kS.Class]:"class",[kS.Module]:"module",[kS.Alias]:"alias",[kS.Enum]:"enum member",[kS.Interface]:"interface"};function Rnc(t){let e=wnc[t.semantics],r=[kS.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(Rnc,"announceSnippet")});var dPr=I(Fne=>{"use strict";p();Object.defineProperty(Fne,"__esModule",{value:!0});Fne.WindowedMatcher=Fne.SortOptions=void 0;Fne.splitIntoWords=_Bi;var knc=XEt(),ABi=cPr(),Bne;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(Bne||(Fne.SortOptions=Bne={}));var lPr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=Nnc.get(e.languageId)??Dnc}tokenize(e){return new Set(_Bi(e).filter(r=>!this.stopsForLanguage.has(r)))}},yBi=new knc.LRUCache(20),uPr=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new lPr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=Bne.Descending){return r===Bne.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===Bne.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=Bne.Descending){let n=[];if(e.source.length===0||(await this.referenceTokens).size===0)return n;let o=e.source.split(` -`),s=this.id()+":"+e.source,c=yBi.get(s)??[],l=c.length===0,u=l?o.map(d=>this.tokenizer.tokenize(d),this.tokenizer):[];for(let[d,[f,h]]of this.getWindowsDelineations(o).entries()){if(l){let A=new Set;u.slice(f,h).forEach(y=>y.forEach(_=>A.add(_),A)),c.push(A)}let m=c[d],g=this.similarityScore(m,await this.referenceTokens);if(n.length&&f>0&&n[n.length-1].endLine>f){n[n.length-1].scoree.length>0)}a(_Bi,"splitIntoWords");var Pnc=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),Dnc=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...Pnc]),Nnc=new Map([])});var fPr=I(dk=>{"use strict";p();Object.defineProperty(dk,"__esModule",{value:!0});dk.virtualNode=Mnc;dk.lineNode=Onc;dk.blankNode=Lnc;dk.topNode=Bnc;dk.isBlank=Fnc;dk.isLine=Unc;dk.isVirtual=EBi;dk.isTop=vBi;dk.cutTreeAfterLine=Qnc;dk.duplicateTree=qnc;function Mnc(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(Mnc,"virtualNode");function Onc(t,e,r,n,o){if(r==="")throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:t,lineNumber:e,sourceLine:r,subs:n,label:o}}a(Onc,"lineNode");function Lnc(t){return{type:"blank",lineNumber:t,subs:[]}}a(Lnc,"blankNode");function Bnc(t){return{type:"top",indentation:-1,subs:t??[]}}a(Bnc,"topNode");function Fnc(t){return t.type==="blank"}a(Fnc,"isBlank");function Unc(t){return t.type==="line"}a(Unc,"isLine");function EBi(t){return t.type==="virtual"}a(EBi,"isVirtual");function vBi(t){return t.type==="top"}a(vBi,"isTop");function Qnc(t,e){function r(n){if(!EBi(n)&&!vBi(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty(OL,"__esModule",{value:!0});OL.clearLabels=jnc;OL.clearLabelsIf=Hnc;OL.mapLabels=hPr;OL.resetLineNumbers=Gnc;OL.visitTree=EBe;OL.visitTreeConditionally=$nc;OL.foldTree=Vnc;OL.rebuildTree=Wnc;var pPr=fPr();function jnc(t){return EBe(t,e=>{e.label=void 0},"bottomUp"),t}a(jnc,"clearLabels");function Hnc(t,e){return EBe(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(Hnc,"clearLabelsIf");function hPr(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>hPr(n,e));return{...t,subs:r,label:t.label?e(t.label):void 0}}case"blank":return{...t,label:t.label?e(t.label):void 0};case"top":return{...t,subs:t.subs.map(r=>hPr(r,e)),label:t.label?e(t.label):void 0}}}a(hPr,"mapLabels");function Gnc(t){let e=0;function r(n){!(0,pPr.isVirtual)(n)&&!(0,pPr.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),EBe(t,r,"topDown")}a(Gnc,"resetLineNumbers");function EBe(t,e,r){function n(o){r==="topDown"&&e(o),o.subs.forEach(s=>{n(s)}),r==="bottomUp"&&e(o)}a(n,"_visit"),n(t)}a(EBe,"visitTree");function $nc(t,e,r){function n(o){if(r==="topDown"&&!e(o))return!1;let s=!0;return o.subs.forEach(c=>{s=s&&n(c)}),r==="bottomUp"&&(s=s&&e(o)),s}a(n,"_visit"),n(t)}a($nc,"visitTreeConditionally");function Vnc(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),EBe(t,s,n),o}a(Vnc,"foldTree");function Wnc(t,e,r){let n=a(s=>{if(r!==void 0&&r(s))return s;{let c=s.subs.map(n).filter(l=>l!==void 0);return s.subs=c,e(s)}},"rebuild"),o=n(t);return o!==void 0?o:(0,pPr.topNode)()}a(Wnc,"rebuildTree")});var xBi=I(lN=>{"use strict";p();Object.defineProperty(lN,"__esModule",{value:!0});lN.parseRaw=CBi;lN.labelLines=bBi;lN.labelVirtualInherited=znc;lN.buildLabelRules=SBi;lN.combineClosersAndOpeners=TBi;lN.groupBlocks=Ync;lN.flattenVirtual=Knc;lN.registerLanguageSpecificParser=Xnc;lN.parseTree=eic;var cA=fPr(),t_e=mPr();function CBi(t){let e=t.split(` -`),r=e.map(d=>d.match(/^\s*/)[0].length),n=e.map(d=>d.trimLeft());function o(d){let[f,h]=s(d+1,r[d]);return[(0,cA.lineNode)(r[d],d,n[d],f),h]}a(o,"parseNode");function s(d,f){let h,m=[],g=d,A;for(;gf);)if(n[g]==="")A===void 0&&(A=g),g+=1;else{if(A!==void 0){for(let y=A;ys.matches(n.sourceLine));o&&(n.label=o.label)}}a(r,"visitor"),(0,t_e.visitTree)(t,r,"bottomUp")}a(bBi,"labelLines");function znc(t){function e(r){if((0,cA.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,cA.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,t_e.visitTree)(t,e,"bottomUp")}a(znc,"labelVirtualInherited");function SBi(t){return Object.keys(t).map(e=>{let r;return t[e].test?r=a(n=>t[e].test(n),"matches"):r=t[e],{matches:r,label:e}})}a(SBi,"buildLabelRules");function TBi(t){let e=a(function(n){if(n.subs.length===0||n.subs.findIndex(c=>c.label==="closer"||c.label==="opener")===-1)return n;let o=[],s;for(let c=0;cu.subs.push(d)),l.subs=[];else if(l.label==="closer"&&s!==void 0&&((0,cA.isLine)(l)||(0,cA.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,cA.isBlank)(o[d]);)d-=1;if(s.subs.push(...o.splice(d+1)),l.subs.length>0){let f=s.subs.findIndex(A=>A.label!=="newVirtual"),h=s.subs.slice(0,f),m=s.subs.slice(f),g=m.length>0?[(0,cA.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,cA.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,t_e.rebuildTree)(t,e);return(0,t_e.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(TBi,"combineClosersAndOpeners");function Ync(t,e=cA.isBlank,r){let n=a(function(o){if(o.subs.length<=1)return o;let s=[],c=[],l,u=!1;function d(f=!1){if(l!==void 0&&(s.length>0||!f)){let h=(0,cA.virtualNode)(l,c,r);s.push(h)}else c.forEach(h=>s.push(h))}a(d,"flushBlockIntoNewSubs");for(let f=0;f{"use strict";p();Object.defineProperty(evt,"__esModule",{value:!0});evt.getBasicWindowDelineations=ric;evt.getIndentationWindowsDelineations=nic;var wBi=mPr(),tic=xBi();function ric(t,e){let r=[],n=e.length;if(n===0)return[];if(n{if(c.type==="blank"){c.label={totalLength:1,firstLineAfter:c.lineNumber+1};return}let l=c.type==="line"?1:0,u=c.type==="line"?c.lineNumber+1:NaN;function d(A){return A===-1?u-l:c.subs[A].label.firstLineAfter-c.subs[A].label.totalLength}a(d,"getStartLine");function f(A,y){return A===0?y+1:c.subs[A-1].label.firstLineAfter}a(f,"getEndLine");let h=c.type==="line"?-1:0,m=c.type==="line"?1:0,g=0;for(let A=0;A=0&&hn){let y=d(h),_=f(A,y),E=g===A?_:f(g,y);for(r<=_-y&&o.push([y,E]);m>n;)m-=h===-1?c.type==="line"?1:0:c.subs[h].label.totalLength,h++}}if(hc[0]-l[0]||c[1]-l[1]).filter((c,l,u)=>l===0||c[0]!==u[l-1][0]||c[1]!==u[l-1][1])}a(nic,"getIndentationWindowsDelineations")});var kBi=I(vBe=>{"use strict";p();Object.defineProperty(vBe,"__esModule",{value:!0});vBe.FixedWindowSizeJaccardMatcher=void 0;vBe.computeScore=RBi;var iic=sPr(),oic=dPr(),sic=gPr(),APr=class t extends oic.WindowedMatcher{static{a(this,"FixedWindowSizeJaccardMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=e=>({to:a(r=>new t(r,e),"to")})}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return(0,sic.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,iic.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return RBi(e,r)}};vBe.FixedWindowSizeJaccardMatcher=APr;function RBi(t,e){let r=new Set;return t.forEach(n=>{e.has(n)&&r.add(n)}),r.size/(t.size+e.size-r.size)}a(RBi,"computeScore")});var DBi=I(tvt=>{"use strict";p();Object.defineProperty(tvt,"__esModule",{value:!0});tvt.BlockTokenSubsetMatcher=void 0;var aic=Mne(),PBi=sPr(),cic=dPr(),lic=gPr(),yPr=class t extends cic.WindowedMatcher{static{a(this,"BlockTokenSubsetMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=e=>({to:a(r=>new t(r,e),"to")})}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return(0,lic.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,PBi.getCursorContext)(e,{maxLineCount:this.windowLength})}get referenceTokens(){return this.createReferenceTokensForLanguage()}async createReferenceTokensForLanguage(){return this.referenceTokensCache?this.referenceTokensCache:(this.referenceTokensCache=t.syntaxAwareSupportsLanguage(this.referenceDoc.languageId)?await this.syntaxAwareReferenceTokens():await super.referenceTokens,this.referenceTokensCache)}async syntaxAwareReferenceTokens(){let e=(await this.getEnclosingMemberStart(this.referenceDoc.source,this.referenceDoc.offset))?.startIndex,r=this.referenceDoc.offset,n=e?this.referenceDoc.source.slice(e,r):(0,PBi.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return uic(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,aic.parseTreeSitter)(this.referenceDoc.languageId,e);let o=n.rootNode.namedDescendantForIndex(r);for(;o&&!(t.isMember(o)||t.isBlock(o));)o=o.parent??void 0;return o}finally{n?.delete()}}static isMember(e){switch(e?.type){case"method_declaration":case"property_declaration":case"field_declaration":case"constructor_declaration":return!0;default:return!1}}static isBlock(e){switch(e?.type){case"class_declaration":case"struct_declaration":case"record_declaration":case"enum_declaration":case"interface_declaration":return!0;default:return!1}}};tvt.BlockTokenSubsetMatcher=yPr;function uic(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(uic,"computeScore")});var rvt=I(uN=>{"use strict";p();Object.defineProperty(uN,"__esModule",{value:!0});uN.defaultCppSimilarFilesOptions=uN.nullSimilarFilesOptions=uN.conservativeFilesOptions=uN.defaultSimilarFilesOptions=void 0;uN.getSimilarSnippets=yic;var dic=kBi(),fic=DBi(),pic=0,hic=60,mic=4,gic=1,NBi=20,MBi=1e4;uN.defaultSimilarFilesOptions={snippetLength:hic,threshold:pic,maxTopSnippets:mic,maxCharPerFile:MBi,maxNumberOfFiles:NBi,maxSnippetsPerFile:gic,useSubsetMatching:!1};uN.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:MBi,maxNumberOfFiles:NBi,maxSnippetsPerFile:1};uN.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};uN.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function Aic(t,e){return(e.useSubsetMatching?fic.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):dic.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(Aic,"getMatcher");async function yic(t,e,r){let n=Aic(t,r);return r.maxTopSnippets===0?[]:(await e.filter(s=>s.source.length0).slice(0,r.maxNumberOfFiles).reduce(async(s,c)=>(await s).concat((await n.findMatches(c,r.maxSnippetsPerFile)).map(l=>({relativePath:c.relativePath,...l}))),Promise.resolve([]))).filter(s=>s.score&&s.snippet&&s.score>r.threshold).sort((s,c)=>s.score-c.score).slice(-r.maxTopSnippets)}a(yic,"getSimilarSnippets")});var LBi=I(nvt=>{"use strict";p();Object.defineProperty(nvt,"__esModule",{value:!0});nvt.getCppSimilarFilesOptions=Eic;nvt.getCppNumberOfSnippets=vic;var OBi=rvt(),_ic=ivt();function Eic(t,e){return{...OBi.defaultCppSimilarFilesOptions,useSubsetMatching:(0,_ic.useSubsetMatching)(t,e)}}a(Eic,"getCppSimilarFilesOptions");function vic(t){return OBi.defaultCppSimilarFilesOptions.maxTopSnippets}a(vic,"getCppNumberOfSnippets")});var ivt=I(CBe=>{"use strict";p();Object.defineProperty(CBe,"__esModule",{value:!0});CBe.getSimilarFilesOptions=Iic;CBe.getNumberOfSnippets=wic;CBe.useSubsetMatching=UBi;var Cic=z$(),bic=rvt(),BBi=eE(),Sic=hyt(),FBi=LBi(),Tic=new Map([["cpp",FBi.getCppSimilarFilesOptions]]);function Iic(t,e,r){let n=Tic.get(r);return n?n(t,e):{...bic.defaultSimilarFilesOptions,useSubsetMatching:UBi(t,e)}}a(Iic,"getSimilarFilesOptions");var xic=new Map([["cpp",FBi.getCppNumberOfSnippets]]);function wic(t,e){let r=xic.get(e);return r?r(t):Cic.DEFAULT_NUM_SNIPPETS}a(wic,"getNumberOfSnippets");function UBi(t,e){return(e.filtersAndExp.exp.variables[Sic.ExpTreatmentVariables.UseSubsetMatching]||(0,BBi.getConfig)(t,BBi.ConfigKey.UseSubsetMatching))??!1}a(UBi,"useSubsetMatching")});var bBe=I(Une=>{"use strict";p();Object.defineProperty(Une,"__esModule",{value:!0});Une.convertToAPIChoice=Dic;Une.getTemperatureForSamples=Oic;Une.getStops=Bic;Une.getTopP=Fic;Une.getMaxSolutionTokens=Uic;var Ric=Og(),kic=z$(),QBi=Gl(),Pic=nA();function Dic(t,e,r,n,o,s,c){return(0,Pic.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:Nic(t,r),meanAlternativeLogProb:Mic(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,Ric.generateUuid)(),finishReason:r.finish_reason}}a(Dic,"convertToAPIChoice");function Nic(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){QBi.logger.exception(t,r,"Error calculating mean prob")}}a(Nic,"calculateMeanLogProb");function Mic(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){QBi.logger.exception(t,r,"Error calculating mean prob")}}a(Mic,"calculateMeanAlternativeLogProb");function Oic(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(Oic,"getTemperatureForSamples");var Lic={markdown:[` +`).length,tokenLength:n.tokenLength(o),tokenizerName:r.tokenizerName}}a(Rnc,"getCursorContext")});var evt=I(e_e=>{"use strict";p();Object.defineProperty(e_e,"__esModule",{value:!0});e_e.DisposablesLRUCache=e_e.LRUCache=void 0;var _Be=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},XEt=class{static{a(this,"LRUCache")}constructor(e=10){if(e<1)throw new Error("Cache size must be at least 1");this._capacity=e,this._cache=new Map,this._head=new _Be("",null),this._tail=new _Be("",null),this._head.next=this._tail,this._tail.prev=this._head}_addNode(e){e.prev=this._head,e.next=this._head.next,this._head.next.prev=e,this._head.next=e}_removeNode(e){let r=e.prev,n=e.next;r.next=n,n.prev=r}_moveToHead(e){this._removeNode(e),this._addNode(e)}_popTail(){let e=this._tail.prev;return this._removeNode(e),e}clear(){this._cache.clear(),this._head.next=this._tail,this._tail.prev=this._head}deleteKey(e){let r=this._cache.get(e);if(r)return this._removeNode(r),this._cache.delete(e),r.value}get(e){let r=this._cache.get(e);if(r)return this._moveToHead(r),r.value}keys(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push(r.key),r=r.next;return e}getValues(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push(r.value),r=r.next;return e}put(e,r){let n=this._cache.get(e);if(n)n.value=r,this._moveToHead(n);else if(n=new _Be(e,r),this._cache.set(e,n),this._addNode(n),this._cache.size>this._capacity){let o=this._popTail();return this._cache.delete(o.key),[o.key,o.value]}}entries(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push([r.key,r.value]),r=r.next;return e}};e_e.LRUCache=XEt;var cPr=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new XEt(e)}dispose(){this.clear()}clear(){let e=this.actual.getValues();for(let r of e)r.dispose();this.actual.clear()}deleteKey(e){let r=this.actual.deleteKey(e);r&&r.dispose()}get(e){return this.actual.get(e)}keys(){return this.actual.keys()}getValues(){return this.actual.getValues()}put(e,r){let n=this.actual.put(e,r);n&&n[1].dispose()}};e_e.DisposablesLRUCache=cPr});var lPr=I(Bne=>{"use strict";p();Object.defineProperty(Bne,"__esModule",{value:!0});Bne.SnippetSemantics=Bne.SnippetProviderType=void 0;Bne.announceSnippet=Pnc;var yBi;(function(t){t.SimilarFiles="similar-files",t.Path="path"})(yBi||(Bne.SnippetProviderType=yBi={}));var kS;(function(t){t.Function="function",t.Snippet="snippet",t.Snippets="snippets",t.Variable="variable",t.Parameter="parameter",t.Method="method",t.Class="class",t.Module="module",t.Alias="alias",t.Enum="enum member",t.Interface="interface"})(kS||(Bne.SnippetSemantics=kS={}));var knc={[kS.Function]:"function",[kS.Snippet]:"snippet",[kS.Snippets]:"snippets",[kS.Variable]:"variable",[kS.Parameter]:"parameter",[kS.Method]:"method",[kS.Class]:"class",[kS.Module]:"module",[kS.Alias]:"alias",[kS.Enum]:"enum member",[kS.Interface]:"interface"};function Pnc(t){let e=knc[t.semantics],r=[kS.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(Pnc,"announceSnippet")});var fPr=I(Une=>{"use strict";p();Object.defineProperty(Une,"__esModule",{value:!0});Une.WindowedMatcher=Une.SortOptions=void 0;Une.splitIntoWords=vBi;var Dnc=evt(),_Bi=lPr(),Fne;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(Fne||(Une.SortOptions=Fne={}));var uPr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=Onc.get(e.languageId)??Mnc}tokenize(e){return new Set(vBi(e).filter(r=>!this.stopsForLanguage.has(r)))}},EBi=new Dnc.LRUCache(20),dPr=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new uPr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=Fne.Descending){return r===Fne.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===Fne.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=Fne.Descending){let n=[];if(e.source.length===0||(await this.referenceTokens).size===0)return n;let o=e.source.split(` +`),s=this.id()+":"+e.source,c=EBi.get(s)??[],l=c.length===0,u=l?o.map(d=>this.tokenizer.tokenize(d),this.tokenizer):[];for(let[d,[f,h]]of this.getWindowsDelineations(o).entries()){if(l){let A=new Set;u.slice(f,h).forEach(y=>y.forEach(_=>A.add(_),A)),c.push(A)}let m=c[d],g=this.similarityScore(m,await this.referenceTokens);if(n.length&&f>0&&n[n.length-1].endLine>f){n[n.length-1].scoree.length>0)}a(vBi,"splitIntoWords");var Nnc=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),Mnc=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...Nnc]),Onc=new Map([])});var pPr=I(dk=>{"use strict";p();Object.defineProperty(dk,"__esModule",{value:!0});dk.virtualNode=Lnc;dk.lineNode=Bnc;dk.blankNode=Fnc;dk.topNode=Unc;dk.isBlank=Qnc;dk.isLine=qnc;dk.isVirtual=CBi;dk.isTop=bBi;dk.cutTreeAfterLine=jnc;dk.duplicateTree=Hnc;function Lnc(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(Lnc,"virtualNode");function Bnc(t,e,r,n,o){if(r==="")throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:t,lineNumber:e,sourceLine:r,subs:n,label:o}}a(Bnc,"lineNode");function Fnc(t){return{type:"blank",lineNumber:t,subs:[]}}a(Fnc,"blankNode");function Unc(t){return{type:"top",indentation:-1,subs:t??[]}}a(Unc,"topNode");function Qnc(t){return t.type==="blank"}a(Qnc,"isBlank");function qnc(t){return t.type==="line"}a(qnc,"isLine");function CBi(t){return t.type==="virtual"}a(CBi,"isVirtual");function bBi(t){return t.type==="top"}a(bBi,"isTop");function jnc(t,e){function r(n){if(!CBi(n)&&!bBi(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty(OL,"__esModule",{value:!0});OL.clearLabels=Gnc;OL.clearLabelsIf=$nc;OL.mapLabels=mPr;OL.resetLineNumbers=Vnc;OL.visitTree=EBe;OL.visitTreeConditionally=Wnc;OL.foldTree=znc;OL.rebuildTree=Ync;var hPr=pPr();function Gnc(t){return EBe(t,e=>{e.label=void 0},"bottomUp"),t}a(Gnc,"clearLabels");function $nc(t,e){return EBe(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a($nc,"clearLabelsIf");function mPr(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>mPr(n,e));return{...t,subs:r,label:t.label?e(t.label):void 0}}case"blank":return{...t,label:t.label?e(t.label):void 0};case"top":return{...t,subs:t.subs.map(r=>mPr(r,e)),label:t.label?e(t.label):void 0}}}a(mPr,"mapLabels");function Vnc(t){let e=0;function r(n){!(0,hPr.isVirtual)(n)&&!(0,hPr.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),EBe(t,r,"topDown")}a(Vnc,"resetLineNumbers");function EBe(t,e,r){function n(o){r==="topDown"&&e(o),o.subs.forEach(s=>{n(s)}),r==="bottomUp"&&e(o)}a(n,"_visit"),n(t)}a(EBe,"visitTree");function Wnc(t,e,r){function n(o){if(r==="topDown"&&!e(o))return!1;let s=!0;return o.subs.forEach(c=>{s=s&&n(c)}),r==="bottomUp"&&(s=s&&e(o)),s}a(n,"_visit"),n(t)}a(Wnc,"visitTreeConditionally");function znc(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),EBe(t,s,n),o}a(znc,"foldTree");function Ync(t,e,r){let n=a(s=>{if(r!==void 0&&r(s))return s;{let c=s.subs.map(n).filter(l=>l!==void 0);return s.subs=c,e(s)}},"rebuild"),o=n(t);return o!==void 0?o:(0,hPr.topNode)()}a(Ync,"rebuildTree")});var RBi=I(lN=>{"use strict";p();Object.defineProperty(lN,"__esModule",{value:!0});lN.parseRaw=SBi;lN.labelLines=TBi;lN.labelVirtualInherited=Knc;lN.buildLabelRules=IBi;lN.combineClosersAndOpeners=xBi;lN.groupBlocks=Jnc;lN.flattenVirtual=Znc;lN.registerLanguageSpecificParser=tic;lN.parseTree=ric;var cA=pPr(),t_e=gPr();function SBi(t){let e=t.split(` +`),r=e.map(d=>d.match(/^\s*/)[0].length),n=e.map(d=>d.trimLeft());function o(d){let[f,h]=s(d+1,r[d]);return[(0,cA.lineNode)(r[d],d,n[d],f),h]}a(o,"parseNode");function s(d,f){let h,m=[],g=d,A;for(;gf);)if(n[g]==="")A===void 0&&(A=g),g+=1;else{if(A!==void 0){for(let y=A;ys.matches(n.sourceLine));o&&(n.label=o.label)}}a(r,"visitor"),(0,t_e.visitTree)(t,r,"bottomUp")}a(TBi,"labelLines");function Knc(t){function e(r){if((0,cA.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,cA.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,t_e.visitTree)(t,e,"bottomUp")}a(Knc,"labelVirtualInherited");function IBi(t){return Object.keys(t).map(e=>{let r;return t[e].test?r=a(n=>t[e].test(n),"matches"):r=t[e],{matches:r,label:e}})}a(IBi,"buildLabelRules");function xBi(t){let e=a(function(n){if(n.subs.length===0||n.subs.findIndex(c=>c.label==="closer"||c.label==="opener")===-1)return n;let o=[],s;for(let c=0;cu.subs.push(d)),l.subs=[];else if(l.label==="closer"&&s!==void 0&&((0,cA.isLine)(l)||(0,cA.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,cA.isBlank)(o[d]);)d-=1;if(s.subs.push(...o.splice(d+1)),l.subs.length>0){let f=s.subs.findIndex(A=>A.label!=="newVirtual"),h=s.subs.slice(0,f),m=s.subs.slice(f),g=m.length>0?[(0,cA.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,cA.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,t_e.rebuildTree)(t,e);return(0,t_e.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(xBi,"combineClosersAndOpeners");function Jnc(t,e=cA.isBlank,r){let n=a(function(o){if(o.subs.length<=1)return o;let s=[],c=[],l,u=!1;function d(f=!1){if(l!==void 0&&(s.length>0||!f)){let h=(0,cA.virtualNode)(l,c,r);s.push(h)}else c.forEach(h=>s.push(h))}a(d,"flushBlockIntoNewSubs");for(let f=0;f{"use strict";p();Object.defineProperty(tvt,"__esModule",{value:!0});tvt.getBasicWindowDelineations=iic;tvt.getIndentationWindowsDelineations=oic;var kBi=gPr(),nic=RBi();function iic(t,e){let r=[],n=e.length;if(n===0)return[];if(n{if(c.type==="blank"){c.label={totalLength:1,firstLineAfter:c.lineNumber+1};return}let l=c.type==="line"?1:0,u=c.type==="line"?c.lineNumber+1:NaN;function d(A){return A===-1?u-l:c.subs[A].label.firstLineAfter-c.subs[A].label.totalLength}a(d,"getStartLine");function f(A,y){return A===0?y+1:c.subs[A-1].label.firstLineAfter}a(f,"getEndLine");let h=c.type==="line"?-1:0,m=c.type==="line"?1:0,g=0;for(let A=0;A=0&&hn){let y=d(h),_=f(A,y),E=g===A?_:f(g,y);for(r<=_-y&&o.push([y,E]);m>n;)m-=h===-1?c.type==="line"?1:0:c.subs[h].label.totalLength,h++}}if(hc[0]-l[0]||c[1]-l[1]).filter((c,l,u)=>l===0||c[0]!==u[l-1][0]||c[1]!==u[l-1][1])}a(oic,"getIndentationWindowsDelineations")});var DBi=I(vBe=>{"use strict";p();Object.defineProperty(vBe,"__esModule",{value:!0});vBe.FixedWindowSizeJaccardMatcher=void 0;vBe.computeScore=PBi;var sic=aPr(),aic=fPr(),cic=APr(),yPr=class t extends aic.WindowedMatcher{static{a(this,"FixedWindowSizeJaccardMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=e=>({to:a(r=>new t(r,e),"to")})}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return(0,cic.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,sic.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return PBi(e,r)}};vBe.FixedWindowSizeJaccardMatcher=yPr;function PBi(t,e){let r=new Set;return t.forEach(n=>{e.has(n)&&r.add(n)}),r.size/(t.size+e.size-r.size)}a(PBi,"computeScore")});var MBi=I(rvt=>{"use strict";p();Object.defineProperty(rvt,"__esModule",{value:!0});rvt.BlockTokenSubsetMatcher=void 0;var lic=One(),NBi=aPr(),uic=fPr(),dic=APr(),_Pr=class t extends uic.WindowedMatcher{static{a(this,"BlockTokenSubsetMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=e=>({to:a(r=>new t(r,e),"to")})}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return(0,dic.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,NBi.getCursorContext)(e,{maxLineCount:this.windowLength})}get referenceTokens(){return this.createReferenceTokensForLanguage()}async createReferenceTokensForLanguage(){return this.referenceTokensCache?this.referenceTokensCache:(this.referenceTokensCache=t.syntaxAwareSupportsLanguage(this.referenceDoc.languageId)?await this.syntaxAwareReferenceTokens():await super.referenceTokens,this.referenceTokensCache)}async syntaxAwareReferenceTokens(){let e=(await this.getEnclosingMemberStart(this.referenceDoc.source,this.referenceDoc.offset))?.startIndex,r=this.referenceDoc.offset,n=e?this.referenceDoc.source.slice(e,r):(0,NBi.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return fic(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,lic.parseTreeSitter)(this.referenceDoc.languageId,e);let o=n.rootNode.namedDescendantForIndex(r);for(;o&&!(t.isMember(o)||t.isBlock(o));)o=o.parent??void 0;return o}finally{n?.delete()}}static isMember(e){switch(e?.type){case"method_declaration":case"property_declaration":case"field_declaration":case"constructor_declaration":return!0;default:return!1}}static isBlock(e){switch(e?.type){case"class_declaration":case"struct_declaration":case"record_declaration":case"enum_declaration":case"interface_declaration":return!0;default:return!1}}};rvt.BlockTokenSubsetMatcher=_Pr;function fic(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(fic,"computeScore")});var nvt=I(uN=>{"use strict";p();Object.defineProperty(uN,"__esModule",{value:!0});uN.defaultCppSimilarFilesOptions=uN.nullSimilarFilesOptions=uN.conservativeFilesOptions=uN.defaultSimilarFilesOptions=void 0;uN.getSimilarSnippets=Eic;var pic=DBi(),hic=MBi(),mic=0,gic=60,Aic=4,yic=1,OBi=20,LBi=1e4;uN.defaultSimilarFilesOptions={snippetLength:gic,threshold:mic,maxTopSnippets:Aic,maxCharPerFile:LBi,maxNumberOfFiles:OBi,maxSnippetsPerFile:yic,useSubsetMatching:!1};uN.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:LBi,maxNumberOfFiles:OBi,maxSnippetsPerFile:1};uN.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};uN.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function _ic(t,e){return(e.useSubsetMatching?hic.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):pic.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(_ic,"getMatcher");async function Eic(t,e,r){let n=_ic(t,r);return r.maxTopSnippets===0?[]:(await e.filter(s=>s.source.length0).slice(0,r.maxNumberOfFiles).reduce(async(s,c)=>(await s).concat((await n.findMatches(c,r.maxSnippetsPerFile)).map(l=>({relativePath:c.relativePath,...l}))),Promise.resolve([]))).filter(s=>s.score&&s.snippet&&s.score>r.threshold).sort((s,c)=>s.score-c.score).slice(-r.maxTopSnippets)}a(Eic,"getSimilarSnippets")});var FBi=I(ivt=>{"use strict";p();Object.defineProperty(ivt,"__esModule",{value:!0});ivt.getCppSimilarFilesOptions=Cic;ivt.getCppNumberOfSnippets=bic;var BBi=nvt(),vic=ovt();function Cic(t,e){return{...BBi.defaultCppSimilarFilesOptions,useSubsetMatching:(0,vic.useSubsetMatching)(t,e)}}a(Cic,"getCppSimilarFilesOptions");function bic(t){return BBi.defaultCppSimilarFilesOptions.maxTopSnippets}a(bic,"getCppNumberOfSnippets")});var ovt=I(CBe=>{"use strict";p();Object.defineProperty(CBe,"__esModule",{value:!0});CBe.getSimilarFilesOptions=wic;CBe.getNumberOfSnippets=kic;CBe.useSubsetMatching=qBi;var Sic=Y$(),Tic=nvt(),UBi=eE(),Iic=myt(),QBi=FBi(),xic=new Map([["cpp",QBi.getCppSimilarFilesOptions]]);function wic(t,e,r){let n=xic.get(r);return n?n(t,e):{...Tic.defaultSimilarFilesOptions,useSubsetMatching:qBi(t,e)}}a(wic,"getSimilarFilesOptions");var Ric=new Map([["cpp",QBi.getCppNumberOfSnippets]]);function kic(t,e){let r=Ric.get(e);return r?r(t):Sic.DEFAULT_NUM_SNIPPETS}a(kic,"getNumberOfSnippets");function qBi(t,e){return(e.filtersAndExp.exp.variables[Iic.ExpTreatmentVariables.UseSubsetMatching]||(0,UBi.getConfig)(t,UBi.ConfigKey.UseSubsetMatching))??!1}a(qBi,"useSubsetMatching")});var bBe=I(Qne=>{"use strict";p();Object.defineProperty(Qne,"__esModule",{value:!0});Qne.convertToAPIChoice=Mic;Qne.getTemperatureForSamples=Bic;Qne.getStops=Uic;Qne.getTopP=Qic;Qne.getMaxSolutionTokens=qic;var Pic=Lg(),Dic=Y$(),jBi=Gl(),Nic=nA();function Mic(t,e,r,n,o,s,c){return(0,Nic.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:Oic(t,r),meanAlternativeLogProb:Lic(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,Pic.generateUuid)(),finishReason:r.finish_reason}}a(Mic,"convertToAPIChoice");function Oic(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){jBi.logger.exception(t,r,"Error calculating mean prob")}}a(Oic,"calculateMeanLogProb");function Lic(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){jBi.logger.exception(t,r,"Error calculating mean prob")}}a(Lic,"calculateMeanAlternativeLogProb");function Bic(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(Bic,"getTemperatureForSamples");var Fic={markdown:[` `],python:[` @@ -990,31 +990,31 @@ def `,` class `,` if `,` -#`]};function Bic(t){return Lic[t??""]??[` +#`]};function Uic(t){return Fic[t??""]??[` -`,"\n```"]}a(Bic,"getStops");function Fic(){return 1}a(Fic,"getTopP");function Uic(){return kic.DEFAULT_MAX_COMPLETION_LENGTH}a(Uic,"getMaxSolutionTokens")});var LL=I(SBe=>{"use strict";p();Object.defineProperty(SBe,"__esModule",{value:!0});SBe.Fragment=jBi;SBe.jsx=qBi;SBe.jsxs=qBi;function qBi(t,e,r){let n=[];Array.isArray(e.children)?n=e.children:e.children&&(n=[e.children]);let o={...e,children:n};return r&&(o.key=r),{type:t,props:o}}a(qBi,"functionComponentFunction");function jBi(t){return{type:"f",children:t}}a(jBi,"fragmentFunction");jBi.isFragmentFunction=!0});var dN=I(_Pr=>{"use strict";p();Object.defineProperty(_Pr,"__esModule",{value:!0});_Pr.es5ClassCompat=Qic;function Qic(t){return Object.assign(t,{apply:a(function(...r){if(r.length===0)return Reflect.construct(t,[]);{let n=r.length===1?[]:r[1];return Reflect.construct(t,n,r[0].constructor)}},"apply"),call:a(function(...r){if(r.length===0)return Reflect.construct(t,[]);{let[n,...o]=r;return Reflect.construct(t,o,n.constructor)}},"call")})}a(Qic,"es5ClassCompat")});var r_e=I(qne=>{"use strict";p();var qic=qne&&qne.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Qne;Object.defineProperty(qne,"__esModule",{value:!0});qne.Position=void 0;var ovt=Os(),jic=dN(),EPr=Qne=class{static{a(this,"Position")}static Min(...e){if(e.length===0)throw new TypeError;let r=e[0];for(let n=1;ne.line?1:this._charactere._character?1:0}translate(e,r=0){if(e===null||r===null)throw(0,ovt.illegalArgument)();let n;return typeof e>"u"?n=0:typeof e=="number"?n=e:(n=typeof e.lineDelta=="number"?e.lineDelta:0,r=typeof e.characterDelta=="number"?e.characterDelta:0),n===0&&r===0?this:new Qne(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,ovt.illegalArgument)();let n;return typeof e>"u"?n=this.line:typeof e=="number"?n=e:(n=typeof e.line=="number"?e.line:this.line,r=typeof e.character=="number"?e.character:this.character),n===this.line&&r===this.character?this:new Qne(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};qne.Position=EPr;qne.Position=EPr=Qne=qic([jic.es5ClassCompat],EPr)});var BL=I(aV=>{"use strict";p();var Hic=aV&&aV.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},uU;Object.defineProperty(aV,"__esModule",{value:!0});aV.Range=void 0;aV.getDebugDescriptionOfRange=HBi;var Gic=Os(),$ic=dN(),tC=r_e(),vPr=uU=class{static{a(this,"Range")}static isRange(e){return e instanceof uU?!0:!e||typeof e!="object"?!1:tC.Position.isPosition(e.start)&&tC.Position.isPosition(e.end)}static of(e){if(e instanceof uU)return e;if(this.isRange(e))return new uU(e.start,e.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(e,r,n,o){let s,c;if(typeof e=="number"&&typeof r=="number"&&typeof n=="number"&&typeof o=="number"?(s=new tC.Position(e,r),c=new tC.Position(n,o)):tC.Position.isPosition(e)&&tC.Position.isPosition(r)&&(s=tC.Position.of(e),c=tC.Position.of(r)),!s||!c)throw new Error("Invalid arguments");s.isBefore(c)?(this._start=s,this._end=c):(this._start=c,this._end=s)}contains(e){return uU.isRange(e)?this.contains(e.start)&&this.contains(e.end):tC.Position.isPosition(e)?!(tC.Position.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){let r=tC.Position.Max(e.start,this._start),n=tC.Position.Min(e.end,this._end);if(!r.isAfter(n))return new uU(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=tC.Position.Min(e.start,this._start),n=tC.Position.Max(e.end,this.end);return new uU(r,n)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,r=this.end){if(e===null||r===null)throw(0,Gic.illegalArgument)();let n;return e?tC.Position.isPosition(e)?n=e:(n=e.start||this.start,r=e.end||this.end):n=this.start,n.isEqual(this._start)&&r.isEqual(this.end)?this:new uU(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return HBi(this)}};aV.Range=vPr;aV.Range=vPr=uU=Hic([$ic.es5ClassCompat],vPr);function HBi(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a(HBi,"getDebugDescriptionOfRange")});var bPr=I(PS=>{"use strict";p();var VBi=PS&&PS.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(PS,"__esModule",{value:!0});PS.Diagnostic=PS.DiagnosticRelatedInformation=PS.DiagnosticSeverity=PS.DiagnosticTag=void 0;var GBi=Ml(),Vic=hd(),WBi=dN(),zBi=BL(),$Bi;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})($Bi||(PS.DiagnosticTag=$Bi={}));var svt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(svt||(PS.DiagnosticSeverity=svt={}));var avt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&zBi.Range.isRange(e.location.range)&&Vic.URI.isUri(e.location.uri):!1}constructor(e,r){this.location=e,this.message=r}static isEqual(e,r){return e===r?!0:!e||!r?!1:e.message===r.message&&e.location.range.isEqual(r.location.range)&&e.location.uri.toString()===r.location.uri.toString()}};PS.DiagnosticRelatedInformation=avt;PS.DiagnosticRelatedInformation=avt=VBi([WBi.es5ClassCompat],avt);var CPr=class{static{a(this,"Diagnostic")}constructor(e,r,n=svt.Error){if(!zBi.Range.isRange(e))throw new TypeError("range must be set");if(!r)throw new TypeError("message must be set");this.range=e,this.message=r,this.severity=n}toJSON(){return{severity:svt[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,r){return e===r?!0:!e||!r?!1:e.message===r.message&&e.severity===r.severity&&e.code===r.code&&e.severity===r.severity&&e.source===r.source&&e.range.isEqual(r.range)&&(0,GBi.equals)(e.tags,r.tags)&&(0,GBi.equals)(e.relatedInformation,r.relatedInformation,avt.isEqual)}};PS.Diagnostic=CPr;PS.Diagnostic=CPr=VBi([WBi.es5ClassCompat],CPr)});var IPr=I(jne=>{"use strict";p();var Wic=jne&&jne.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},SPr;Object.defineProperty(jne,"__esModule",{value:!0});jne.Location=void 0;var zic=hd(),Yic=dN(),Kic=r_e(),cvt=BL(),TPr=SPr=class{static{a(this,"Location")}static isLocation(e){return e instanceof SPr?!0:e?cvt.Range.isRange(e.range)&&zic.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(cvt.Range.isRange(r))this.range=cvt.Range.of(r);else if(Kic.Position.isPosition(r))this.range=new cvt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};jne.Location=TPr;jne.Location=TPr=SPr=Wic([Yic.es5ClassCompat],TPr)});var YBi=I(kPr=>{"use strict";p();Object.defineProperty(kPr,"__esModule",{value:!0});kPr.getKoreanAltChars=Jic;function Jic(t){let e=Zic(t);if(e&&e.length>0)return new Uint32Array(e)}a(Jic,"getKoreanAltChars");var DS=0,cV=new Uint32Array(10);function Zic(t){if(DS=0,FL(t,xPr,4352),DS>0||(FL(t,wPr,4449),DS>0)||(FL(t,RPr,4520),DS>0)||(FL(t,Hne,12593),DS))return cV.subarray(0,DS);if(t>=44032&&t<=55203){let e=t-44032,r=e%588,n=Math.floor(e/588),o=Math.floor(r/28),s=r%28-1;if(n=0&&(s0)return cV.subarray(0,DS)}}a(Zic,"disassembleKorean");function FL(t,e,r){t>=r&&t>8&&(cV[DS++]=t>>8&255),t>>16&&(cV[DS++]=t>>16&255))}a(Xic,"addCodesToBuffer");var xPr=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),wPr=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),RPr=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),Hne=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108])});var ZBi=I(n_e=>{"use strict";p();Object.defineProperty(n_e,"__esModule",{value:!0});n_e.tryNormalizeToBase=void 0;n_e.normalizeNFC=toc;n_e.normalizeNFD=KBi;var PPr=b2(),eoc=new PPr.LRUCache(1e4);function toc(t){return JBi(t,"NFC",eoc)}a(toc,"normalizeNFC");var roc=new PPr.LRUCache(1e4);function KBi(t){return JBi(t,"NFD",roc)}a(KBi,"normalizeNFD");var noc=/[^\u0000-\u0080]/;function JBi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return noc.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(JBi,"normalize");n_e.tryNormalizeToBase=(function(){let t=new PPr.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=KBi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var y3i=I(vc=>{"use strict";p();var ioc=vc&&vc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ooc=vc&&vc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),soc=vc&&vc.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0?[{start:0,end:e.length}]:[]:null}a(o3i,"_matchesPrefix");function s3i(t,e){if(t.length>e.length)return null;let r=e.toLowerCase().indexOf(t.toLowerCase());return r===-1?null:[{start:r,end:r+t.length}]}a(s3i,"matchesContiguousSubString");function loc(t,e){if(t.length>e.length)return null;t=(0,dvt.tryNormalizeToBase)(t),e=(0,dvt.tryNormalizeToBase)(e);let r=e.indexOf(t);return r===-1?null:[{start:r,end:r+t.length}]}a(loc,"matchesBaseContiguousSubString");function a3i(t,e){return t.length>e.length?null:MPr(t.toLowerCase(),e.toLowerCase(),0,0)}a(a3i,"matchesSubString");function MPr(t,e,r,n){if(r===t.length)return[];if(n===e.length)return null;if(t[r]===e[n]){let o=null;return(o=MPr(t,e,r+1,n+1))?jPr({start:n,end:n+1},o):null}return MPr(t,e,r,n+1)}a(MPr,"_matchesSubString");function QPr(t){return 97<=t&&t<=122}a(QPr,"isLower");function xBe(t){return 65<=t&&t<=90}a(xBe,"isUpper");function qPr(t){return 48<=t&&t<=57}a(qPr,"isNumber");function c3i(t){return t===32||t===9||t===10||t===13}a(c3i,"isWhitespace");var l3i=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>l3i.add(t.charCodeAt(0)));function fvt(t){return c3i(t)||l3i.has(t)}a(fvt,"isWordSeparator");function XBi(t,e){return t===e||fvt(t)&&fvt(e)}a(XBi,"charactersMatch");var DPr=new Map;function e3i(t){if(DPr.has(t))return DPr.get(t);let e,r=(0,coc.getKoreanAltChars)(t);return r&&(e=r),DPr.set(t,e),e}a(e3i,"getAlternateCodes");function u3i(t){return QPr(t)||xBe(t)||qPr(t)}a(u3i,"isAlphanumeric");function jPr(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(jPr,"join");function d3i(t,e){for(let r=e;r0&&!u3i(t.charCodeAt(r-1)))return r}return t.length}a(d3i,"nextAnchor");function OPr(t,e,r,n){if(r===t.length)return[];if(n===e.length)return null;if(t[r]!==e[n].toLowerCase())return null;{let o=null,s=n+1;for(o=OPr(t,e,r+1,n+1);!o&&(s=d3i(e,s)).6}a(doc,"isUpperCaseWord");function foc(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(foc,"isCamelCaseWord");function poc(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=uoc(e);if(!foc(r)){if(!doc(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&fvt(t.charCodeAt(r-1)))return r;return t.length}a(f3i,"nextWord");var goc=UPr(vc.matchesPrefix,HPr,s3i),Aoc=UPr(vc.matchesPrefix,HPr,a3i),r3i=new aoc.LRUCache(1e4);function yoc(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=r3i.get(t);n||(n=new RegExp(FPr.convertSimple2RegExpPattern(t),"i"),r3i.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?Aoc(t,e):goc(t,e)}a(yoc,"matchesFuzzy");function _oc(t,e){let r=IBe(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?p3i(r):null}a(_oc,"matchesFuzzy2");function Eoc(t,e,r,n,o,s){let c=Math.min(13,t.length);for(;r"u")return[];let e=[],r=t[1];for(let n=t.length-1;n>1;n--){let o=t[n]+r,s=e[e.length-1];s&&s.end===o?s.end=o+1:e.push({start:o,end:o+1})}return e}a(p3i,"createMatches");var uV=128;function GPr(){let t=[],e=[];for(let r=0;r<=uV;r++)e[r]=0;for(let r=0;r<=uV;r++)t.push(e.slice(0));return t}a(GPr,"initTable");function h3i(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(h3i,"initArr");var m3i=h3i(2*uV),BPr=h3i(2*uV),UL=GPr(),lV=GPr(),TBe=GPr(),voc=!1;function NPr(t,e,r,n,o){function s(l,u,d=" "){for(;l.lengths(l,3)).join("|")} +`,"\n```"]}a(Uic,"getStops");function Qic(){return 1}a(Qic,"getTopP");function qic(){return Dic.DEFAULT_MAX_COMPLETION_LENGTH}a(qic,"getMaxSolutionTokens")});var LL=I(SBe=>{"use strict";p();Object.defineProperty(SBe,"__esModule",{value:!0});SBe.Fragment=GBi;SBe.jsx=HBi;SBe.jsxs=HBi;function HBi(t,e,r){let n=[];Array.isArray(e.children)?n=e.children:e.children&&(n=[e.children]);let o={...e,children:n};return r&&(o.key=r),{type:t,props:o}}a(HBi,"functionComponentFunction");function GBi(t){return{type:"f",children:t}}a(GBi,"fragmentFunction");GBi.isFragmentFunction=!0});var dN=I(EPr=>{"use strict";p();Object.defineProperty(EPr,"__esModule",{value:!0});EPr.es5ClassCompat=jic;function jic(t){return Object.assign(t,{apply:a(function(...r){if(r.length===0)return Reflect.construct(t,[]);{let n=r.length===1?[]:r[1];return Reflect.construct(t,n,r[0].constructor)}},"apply"),call:a(function(...r){if(r.length===0)return Reflect.construct(t,[]);{let[n,...o]=r;return Reflect.construct(t,o,n.constructor)}},"call")})}a(jic,"es5ClassCompat")});var r_e=I(jne=>{"use strict";p();var Hic=jne&&jne.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},qne;Object.defineProperty(jne,"__esModule",{value:!0});jne.Position=void 0;var svt=Os(),Gic=dN(),vPr=qne=class{static{a(this,"Position")}static Min(...e){if(e.length===0)throw new TypeError;let r=e[0];for(let n=1;ne.line?1:this._charactere._character?1:0}translate(e,r=0){if(e===null||r===null)throw(0,svt.illegalArgument)();let n;return typeof e>"u"?n=0:typeof e=="number"?n=e:(n=typeof e.lineDelta=="number"?e.lineDelta:0,r=typeof e.characterDelta=="number"?e.characterDelta:0),n===0&&r===0?this:new qne(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,svt.illegalArgument)();let n;return typeof e>"u"?n=this.line:typeof e=="number"?n=e:(n=typeof e.line=="number"?e.line:this.line,r=typeof e.character=="number"?e.character:this.character),n===this.line&&r===this.character?this:new qne(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};jne.Position=vPr;jne.Position=vPr=qne=Hic([Gic.es5ClassCompat],vPr)});var BL=I(cV=>{"use strict";p();var $ic=cV&&cV.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},uU;Object.defineProperty(cV,"__esModule",{value:!0});cV.Range=void 0;cV.getDebugDescriptionOfRange=$Bi;var Vic=Os(),Wic=dN(),tC=r_e(),CPr=uU=class{static{a(this,"Range")}static isRange(e){return e instanceof uU?!0:!e||typeof e!="object"?!1:tC.Position.isPosition(e.start)&&tC.Position.isPosition(e.end)}static of(e){if(e instanceof uU)return e;if(this.isRange(e))return new uU(e.start,e.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(e,r,n,o){let s,c;if(typeof e=="number"&&typeof r=="number"&&typeof n=="number"&&typeof o=="number"?(s=new tC.Position(e,r),c=new tC.Position(n,o)):tC.Position.isPosition(e)&&tC.Position.isPosition(r)&&(s=tC.Position.of(e),c=tC.Position.of(r)),!s||!c)throw new Error("Invalid arguments");s.isBefore(c)?(this._start=s,this._end=c):(this._start=c,this._end=s)}contains(e){return uU.isRange(e)?this.contains(e.start)&&this.contains(e.end):tC.Position.isPosition(e)?!(tC.Position.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){let r=tC.Position.Max(e.start,this._start),n=tC.Position.Min(e.end,this._end);if(!r.isAfter(n))return new uU(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=tC.Position.Min(e.start,this._start),n=tC.Position.Max(e.end,this.end);return new uU(r,n)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,r=this.end){if(e===null||r===null)throw(0,Vic.illegalArgument)();let n;return e?tC.Position.isPosition(e)?n=e:(n=e.start||this.start,r=e.end||this.end):n=this.start,n.isEqual(this._start)&&r.isEqual(this.end)?this:new uU(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return $Bi(this)}};cV.Range=CPr;cV.Range=CPr=uU=$ic([Wic.es5ClassCompat],CPr);function $Bi(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a($Bi,"getDebugDescriptionOfRange")});var SPr=I(PS=>{"use strict";p();var zBi=PS&&PS.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(PS,"__esModule",{value:!0});PS.Diagnostic=PS.DiagnosticRelatedInformation=PS.DiagnosticSeverity=PS.DiagnosticTag=void 0;var VBi=Ml(),zic=hd(),YBi=dN(),KBi=BL(),WBi;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(WBi||(PS.DiagnosticTag=WBi={}));var avt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(avt||(PS.DiagnosticSeverity=avt={}));var cvt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&KBi.Range.isRange(e.location.range)&&zic.URI.isUri(e.location.uri):!1}constructor(e,r){this.location=e,this.message=r}static isEqual(e,r){return e===r?!0:!e||!r?!1:e.message===r.message&&e.location.range.isEqual(r.location.range)&&e.location.uri.toString()===r.location.uri.toString()}};PS.DiagnosticRelatedInformation=cvt;PS.DiagnosticRelatedInformation=cvt=zBi([YBi.es5ClassCompat],cvt);var bPr=class{static{a(this,"Diagnostic")}constructor(e,r,n=avt.Error){if(!KBi.Range.isRange(e))throw new TypeError("range must be set");if(!r)throw new TypeError("message must be set");this.range=e,this.message=r,this.severity=n}toJSON(){return{severity:avt[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,r){return e===r?!0:!e||!r?!1:e.message===r.message&&e.severity===r.severity&&e.code===r.code&&e.severity===r.severity&&e.source===r.source&&e.range.isEqual(r.range)&&(0,VBi.equals)(e.tags,r.tags)&&(0,VBi.equals)(e.relatedInformation,r.relatedInformation,cvt.isEqual)}};PS.Diagnostic=bPr;PS.Diagnostic=bPr=zBi([YBi.es5ClassCompat],bPr)});var xPr=I(Hne=>{"use strict";p();var Yic=Hne&&Hne.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},TPr;Object.defineProperty(Hne,"__esModule",{value:!0});Hne.Location=void 0;var Kic=hd(),Jic=dN(),Zic=r_e(),lvt=BL(),IPr=TPr=class{static{a(this,"Location")}static isLocation(e){return e instanceof TPr?!0:e?lvt.Range.isRange(e.range)&&Kic.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(lvt.Range.isRange(r))this.range=lvt.Range.of(r);else if(Zic.Position.isPosition(r))this.range=new lvt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};Hne.Location=IPr;Hne.Location=IPr=TPr=Yic([Jic.es5ClassCompat],IPr)});var JBi=I(PPr=>{"use strict";p();Object.defineProperty(PPr,"__esModule",{value:!0});PPr.getKoreanAltChars=Xic;function Xic(t){let e=eoc(t);if(e&&e.length>0)return new Uint32Array(e)}a(Xic,"getKoreanAltChars");var DS=0,lV=new Uint32Array(10);function eoc(t){if(DS=0,FL(t,wPr,4352),DS>0||(FL(t,RPr,4449),DS>0)||(FL(t,kPr,4520),DS>0)||(FL(t,Gne,12593),DS))return lV.subarray(0,DS);if(t>=44032&&t<=55203){let e=t-44032,r=e%588,n=Math.floor(e/588),o=Math.floor(r/28),s=r%28-1;if(n=0&&(s0)return lV.subarray(0,DS)}}a(eoc,"disassembleKorean");function FL(t,e,r){t>=r&&t>8&&(lV[DS++]=t>>8&255),t>>16&&(lV[DS++]=t>>16&255))}a(toc,"addCodesToBuffer");var wPr=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),RPr=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),kPr=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),Gne=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108])});var e3i=I(n_e=>{"use strict";p();Object.defineProperty(n_e,"__esModule",{value:!0});n_e.tryNormalizeToBase=void 0;n_e.normalizeNFC=noc;n_e.normalizeNFD=ZBi;var DPr=b2(),roc=new DPr.LRUCache(1e4);function noc(t){return XBi(t,"NFC",roc)}a(noc,"normalizeNFC");var ioc=new DPr.LRUCache(1e4);function ZBi(t){return XBi(t,"NFD",ioc)}a(ZBi,"normalizeNFD");var ooc=/[^\u0000-\u0080]/;function XBi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return ooc.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(XBi,"normalize");n_e.tryNormalizeToBase=(function(){let t=new DPr.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=ZBi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var E3i=I(vc=>{"use strict";p();var soc=vc&&vc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aoc=vc&&vc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),coc=vc&&vc.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0?[{start:0,end:e.length}]:[]:null}a(a3i,"_matchesPrefix");function c3i(t,e){if(t.length>e.length)return null;let r=e.toLowerCase().indexOf(t.toLowerCase());return r===-1?null:[{start:r,end:r+t.length}]}a(c3i,"matchesContiguousSubString");function doc(t,e){if(t.length>e.length)return null;t=(0,fvt.tryNormalizeToBase)(t),e=(0,fvt.tryNormalizeToBase)(e);let r=e.indexOf(t);return r===-1?null:[{start:r,end:r+t.length}]}a(doc,"matchesBaseContiguousSubString");function l3i(t,e){return t.length>e.length?null:OPr(t.toLowerCase(),e.toLowerCase(),0,0)}a(l3i,"matchesSubString");function OPr(t,e,r,n){if(r===t.length)return[];if(n===e.length)return null;if(t[r]===e[n]){let o=null;return(o=OPr(t,e,r+1,n+1))?HPr({start:n,end:n+1},o):null}return OPr(t,e,r,n+1)}a(OPr,"_matchesSubString");function qPr(t){return 97<=t&&t<=122}a(qPr,"isLower");function xBe(t){return 65<=t&&t<=90}a(xBe,"isUpper");function jPr(t){return 48<=t&&t<=57}a(jPr,"isNumber");function u3i(t){return t===32||t===9||t===10||t===13}a(u3i,"isWhitespace");var d3i=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>d3i.add(t.charCodeAt(0)));function pvt(t){return u3i(t)||d3i.has(t)}a(pvt,"isWordSeparator");function t3i(t,e){return t===e||pvt(t)&&pvt(e)}a(t3i,"charactersMatch");var NPr=new Map;function r3i(t){if(NPr.has(t))return NPr.get(t);let e,r=(0,uoc.getKoreanAltChars)(t);return r&&(e=r),NPr.set(t,e),e}a(r3i,"getAlternateCodes");function f3i(t){return qPr(t)||xBe(t)||jPr(t)}a(f3i,"isAlphanumeric");function HPr(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(HPr,"join");function p3i(t,e){for(let r=e;r0&&!f3i(t.charCodeAt(r-1)))return r}return t.length}a(p3i,"nextAnchor");function LPr(t,e,r,n){if(r===t.length)return[];if(n===e.length)return null;if(t[r]!==e[n].toLowerCase())return null;{let o=null,s=n+1;for(o=LPr(t,e,r+1,n+1);!o&&(s=p3i(e,s)).6}a(poc,"isUpperCaseWord");function hoc(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(hoc,"isCamelCaseWord");function moc(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=foc(e);if(!hoc(r)){if(!poc(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&pvt(t.charCodeAt(r-1)))return r;return t.length}a(h3i,"nextWord");var yoc=QPr(vc.matchesPrefix,GPr,c3i),_oc=QPr(vc.matchesPrefix,GPr,l3i),i3i=new loc.LRUCache(1e4);function Eoc(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=i3i.get(t);n||(n=new RegExp(UPr.convertSimple2RegExpPattern(t),"i"),i3i.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?_oc(t,e):yoc(t,e)}a(Eoc,"matchesFuzzy");function voc(t,e){let r=IBe(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?m3i(r):null}a(voc,"matchesFuzzy2");function Coc(t,e,r,n,o,s){let c=Math.min(13,t.length);for(;r"u")return[];let e=[],r=t[1];for(let n=t.length-1;n>1;n--){let o=t[n]+r,s=e[e.length-1];s&&s.end===o?s.end=o+1:e.push({start:o,end:o+1})}return e}a(m3i,"createMatches");var dV=128;function $Pr(){let t=[],e=[];for(let r=0;r<=dV;r++)e[r]=0;for(let r=0;r<=dV;r++)t.push(e.slice(0));return t}a($Pr,"initTable");function g3i(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(g3i,"initArr");var A3i=g3i(2*dV),FPr=g3i(2*dV),UL=$Pr(),uV=$Pr(),TBe=$Pr(),boc=!1;function MPr(t,e,r,n,o){function s(l,u,d=" "){for(;l.lengths(l,3)).join("|")} `;for(let l=0;l<=r;l++)l===0?c+=" |":c+=`${e[l-1]}|`,c+=t[l].slice(0,o+1).map(u=>s(u.toString(),3)).join("|")+` -`;return c}a(NPr,"printTable");function Coc(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(NPr(lV,t,t.length,r,r.length)),console.log(NPr(TBe,t,t.length,r,r.length)),console.log(NPr(UL,t,t.length,r,r.length))}a(Coc,"printTables");function lvt(t,e){if(e<0||e>=t.length)return!1;let r=t.codePointAt(e);switch(r){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!FPr.isEmojiImprecise(r)}}a(lvt,"isSeparatorAtPos");function n3i(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a(n3i,"isWhitespaceAtPos");function uvt(t,e,r){return e[t]!==r[t]}a(uvt,"isUpperCaseAtPos");function g3i(t,e,r,n,o,s,c=!1){for(;euV?uV:t.length,u=n.length>uV?uV:n.length;if(r>=l||s>=u||l-r>u-s||!g3i(e,r,l,o,s,u,!0))return;boc(l,u,r,s,e,o);let d=1,f=1,h=r,m=s,g=[!1];for(d=1,h=r;hv,D=k?lV[d][f-1]+(UL[d][f-1]>0?-5:0):0,N=m>v+1&&UL[d][f-1]>0,O=N?lV[d][f-2]+(UL[d][f-2]>0?-5:0):0;if(N&&(!k||O>=D)&&(!R||O>=x))lV[d][f]=O,TBe[d][f]=3,UL[d][f]=0;else if(k&&(!R||D>=x))lV[d][f]=D,TBe[d][f]=2,UL[d][f]=0;else if(R)lV[d][f]=x,TBe[d][f]=1,UL[d][f]=UL[d-1][f-1]+1;else throw new Error("not possible")}}if(voc&&Coc(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[lV[d][f],s],y=0,_=0;for(;d>=1;){let v=f;do{let S=TBe[d][v];if(S===3)v=v-2;else if(S===2)v=v-1;else break}while(v>=1);y>1&&e[r+d-1]===o[s+f-1]&&!uvt(v+s-1,n,o)&&y+1>UL[d][v]&&(v=f),v===f?y++:y=1,_||(_=v),d--,f=v-1,A.push(f)}u-s===l&&c.boostFullMatch&&(A[0]+=2);let E=_-l;return A[0]-=E,A}a(IBe,"fuzzyScore");function boc(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(BPr[c]=l,c--),l--}a(boc,"_fillInMaxWordMatchPos");function Soc(t,e,r,n,o,s,c,l,u,d,f){if(e[r]!==s[c])return Number.MIN_SAFE_INTEGER;let h=1,m=!1;return c===r-n?h=t[r]===o[c]?7:5:uvt(c,o,s)&&(c===0||!uvt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):lvt(s,c)&&(c===0||!lvt(s,c-1))?h=5:(lvt(s,c-1)||n3i(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=uvt(c,o,s)||lvt(s,c-1)||n3i(s,c-1)),r===n?c>u&&(h-=m?3:5):d?h+=m?2:0:h+=m?0:1,c+1===l&&(h-=m?3:5),h}a(Soc,"_doScore");function Toc(t,e,r,n,o,s,c){return A3i(t,e,r,n,o,s,!0,c)}a(Toc,"fuzzyScoreGracefulAggressive");function Ioc(t,e,r,n,o,s,c){return A3i(t,e,r,n,o,s,!1,c)}a(Ioc,"fuzzyScoreGraceful");function A3i(t,e,r,n,o,s,c,l){let u=IBe(t,e,r,n,o,s,l);if(u&&!c)return u;if(t.length>=3){let d=Math.min(7,t.length-1);for(let f=r+1;fu[0])&&(u=m))}}}return u}a(A3i,"fuzzyScoreWithPermutations");function xoc(t,e){if(e+1>=t.length)return;let r=t[e],n=t[e+1];if(r!==n)return t.slice(0,e)+n+r+t.slice(e+2)}a(xoc,"nextTypoPermutation")});var E3i=I(dV=>{"use strict";p();Object.defineProperty(dV,"__esModule",{value:!0});dV.escapeIcons=Poc;dV.markdownEscapeEscapedIcons=Noc;dV.stripIcons=Ooc;dV.getCodiconAriaLabel=Loc;dV.parseLabelWithIcons=Boc;dV.matchesFuzzyIconAware=Foc;var _3i=y3i(),woc=ym(),VPr=W_r(),Roc="$(",WPr=new RegExp(`\\$\\(${VPr.ThemeIcon.iconNameExpression}(?:${VPr.ThemeIcon.iconModifierExpression})?\\)`,"g"),koc=new RegExp(`(\\\\)?${WPr.source}`,"g");function Poc(t){return t.replace(koc,(e,r)=>r?e:`\\${e}`)}a(Poc,"escapeIcons");var Doc=new RegExp(`\\\\${WPr.source}`,"g");function Noc(t){return t.replace(Doc,e=>`\\${e}`)}a(Noc,"markdownEscapeEscapedIcons");var Moc=new RegExp(`(\\s)?(\\\\)?${WPr.source}(\\s)?`,"g");function Ooc(t){return t.indexOf(Roc)===-1?t:t.replace(Moc,(e,r,n,o)=>n?e:r||o||"")}a(Ooc,"stripIcons");function Loc(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(Loc,"getCodiconAriaLabel");var $Pr=new RegExp(`\\$\\(${VPr.ThemeIcon.iconNameCharacter}+\\)`,"g");function Boc(t){$Pr.lastIndex=0;let e="",r=[],n=0;for(;;){let o=$Pr.lastIndex,s=$Pr.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(Dy,"__esModule",{value:!0});Dy.MarkdownString=void 0;Dy.isEmptyMarkdownString=v3i;Dy.isMarkdownString=C3i;Dy.markdownStringEqual=Goc;Dy.escapeMarkdownSyntaxTokens=gvt;Dy.escapeMarkdownLinkLabel=$oc;Dy.appendEscapedMarkdownCodeBlockFence=b3i;Dy.appendEscapedMarkdownInlineCode=Voc;Dy.escapeDoubleQuotes=Woc;Dy.removeMarkdownEscapes=zoc;Dy.parseHrefAndDimensions=Yoc;Dy.createMarkdownLink=S3i;Dy.createMarkdownCommandLink=Koc;Dy.createCommandUri=T3i;var Uoc=Os(),Qoc=E3i(),qoc=XJ(),joc=x2(),Hoc=ym(),hvt=hd(),mvt=class t{static{a(this,"MarkdownString")}static lift(e){let r=new t(e.value,e);return r.uris=e.uris,r.baseUri=e.baseUri?hvt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,Uoc.illegalArgument)("value");typeof r=="boolean"?(this.isTrusted=r,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=r.isTrusted??void 0,this.supportThemeIcons=r.supportThemeIcons??!1,this.supportHtml=r.supportHtml??!1,this.supportAlertSyntax=r.supportAlertSyntax??!1)}appendText(e,r=0){return this.value+=gvt(this.supportThemeIcons?(0,Qoc.escapeIcons)(e):e).replace(/([ \t]+)/g,(n,o)=>" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,r===1?`\\ +`;return c}a(MPr,"printTable");function Soc(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(MPr(uV,t,t.length,r,r.length)),console.log(MPr(TBe,t,t.length,r,r.length)),console.log(MPr(UL,t,t.length,r,r.length))}a(Soc,"printTables");function uvt(t,e){if(e<0||e>=t.length)return!1;let r=t.codePointAt(e);switch(r){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!UPr.isEmojiImprecise(r)}}a(uvt,"isSeparatorAtPos");function o3i(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a(o3i,"isWhitespaceAtPos");function dvt(t,e,r){return e[t]!==r[t]}a(dvt,"isUpperCaseAtPos");function y3i(t,e,r,n,o,s,c=!1){for(;edV?dV:t.length,u=n.length>dV?dV:n.length;if(r>=l||s>=u||l-r>u-s||!y3i(e,r,l,o,s,u,!0))return;Toc(l,u,r,s,e,o);let d=1,f=1,h=r,m=s,g=[!1];for(d=1,h=r;hv,D=k?uV[d][f-1]+(UL[d][f-1]>0?-5:0):0,N=m>v+1&&UL[d][f-1]>0,O=N?uV[d][f-2]+(UL[d][f-2]>0?-5:0):0;if(N&&(!k||O>=D)&&(!R||O>=x))uV[d][f]=O,TBe[d][f]=3,UL[d][f]=0;else if(k&&(!R||D>=x))uV[d][f]=D,TBe[d][f]=2,UL[d][f]=0;else if(R)uV[d][f]=x,TBe[d][f]=1,UL[d][f]=UL[d-1][f-1]+1;else throw new Error("not possible")}}if(boc&&Soc(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[uV[d][f],s],y=0,_=0;for(;d>=1;){let v=f;do{let S=TBe[d][v];if(S===3)v=v-2;else if(S===2)v=v-1;else break}while(v>=1);y>1&&e[r+d-1]===o[s+f-1]&&!dvt(v+s-1,n,o)&&y+1>UL[d][v]&&(v=f),v===f?y++:y=1,_||(_=v),d--,f=v-1,A.push(f)}u-s===l&&c.boostFullMatch&&(A[0]+=2);let E=_-l;return A[0]-=E,A}a(IBe,"fuzzyScore");function Toc(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(FPr[c]=l,c--),l--}a(Toc,"_fillInMaxWordMatchPos");function Ioc(t,e,r,n,o,s,c,l,u,d,f){if(e[r]!==s[c])return Number.MIN_SAFE_INTEGER;let h=1,m=!1;return c===r-n?h=t[r]===o[c]?7:5:dvt(c,o,s)&&(c===0||!dvt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):uvt(s,c)&&(c===0||!uvt(s,c-1))?h=5:(uvt(s,c-1)||o3i(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=dvt(c,o,s)||uvt(s,c-1)||o3i(s,c-1)),r===n?c>u&&(h-=m?3:5):d?h+=m?2:0:h+=m?0:1,c+1===l&&(h-=m?3:5),h}a(Ioc,"_doScore");function xoc(t,e,r,n,o,s,c){return _3i(t,e,r,n,o,s,!0,c)}a(xoc,"fuzzyScoreGracefulAggressive");function woc(t,e,r,n,o,s,c){return _3i(t,e,r,n,o,s,!1,c)}a(woc,"fuzzyScoreGraceful");function _3i(t,e,r,n,o,s,c,l){let u=IBe(t,e,r,n,o,s,l);if(u&&!c)return u;if(t.length>=3){let d=Math.min(7,t.length-1);for(let f=r+1;fu[0])&&(u=m))}}}return u}a(_3i,"fuzzyScoreWithPermutations");function Roc(t,e){if(e+1>=t.length)return;let r=t[e],n=t[e+1];if(r!==n)return t.slice(0,e)+n+r+t.slice(e+2)}a(Roc,"nextTypoPermutation")});var C3i=I(fV=>{"use strict";p();Object.defineProperty(fV,"__esModule",{value:!0});fV.escapeIcons=Noc;fV.markdownEscapeEscapedIcons=Ooc;fV.stripIcons=Boc;fV.getCodiconAriaLabel=Foc;fV.parseLabelWithIcons=Uoc;fV.matchesFuzzyIconAware=Qoc;var v3i=E3i(),koc=ym(),WPr=z_r(),Poc="$(",zPr=new RegExp(`\\$\\(${WPr.ThemeIcon.iconNameExpression}(?:${WPr.ThemeIcon.iconModifierExpression})?\\)`,"g"),Doc=new RegExp(`(\\\\)?${zPr.source}`,"g");function Noc(t){return t.replace(Doc,(e,r)=>r?e:`\\${e}`)}a(Noc,"escapeIcons");var Moc=new RegExp(`\\\\${zPr.source}`,"g");function Ooc(t){return t.replace(Moc,e=>`\\${e}`)}a(Ooc,"markdownEscapeEscapedIcons");var Loc=new RegExp(`(\\s)?(\\\\)?${zPr.source}(\\s)?`,"g");function Boc(t){return t.indexOf(Poc)===-1?t:t.replace(Loc,(e,r,n,o)=>n?e:r||o||"")}a(Boc,"stripIcons");function Foc(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(Foc,"getCodiconAriaLabel");var VPr=new RegExp(`\\$\\(${WPr.ThemeIcon.iconNameCharacter}+\\)`,"g");function Uoc(t){VPr.lastIndex=0;let e="",r=[],n=0;for(;;){let o=VPr.lastIndex,s=VPr.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(Dy,"__esModule",{value:!0});Dy.MarkdownString=void 0;Dy.isEmptyMarkdownString=b3i;Dy.isMarkdownString=S3i;Dy.markdownStringEqual=Voc;Dy.escapeMarkdownSyntaxTokens=Avt;Dy.escapeMarkdownLinkLabel=Woc;Dy.appendEscapedMarkdownCodeBlockFence=T3i;Dy.appendEscapedMarkdownInlineCode=zoc;Dy.escapeDoubleQuotes=Yoc;Dy.removeMarkdownEscapes=Koc;Dy.parseHrefAndDimensions=Joc;Dy.createMarkdownLink=I3i;Dy.createMarkdownCommandLink=Zoc;Dy.createCommandUri=x3i;var qoc=Os(),joc=C3i(),Hoc=eZ(),Goc=x2(),$oc=ym(),mvt=hd(),gvt=class t{static{a(this,"MarkdownString")}static lift(e){let r=new t(e.value,e);return r.uris=e.uris,r.baseUri=e.baseUri?mvt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,qoc.illegalArgument)("value");typeof r=="boolean"?(this.isTrusted=r,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=r.isTrusted??void 0,this.supportThemeIcons=r.supportThemeIcons??!1,this.supportHtml=r.supportHtml??!1,this.supportAlertSyntax=r.supportAlertSyntax??!1)}appendText(e,r=0){return this.value+=Avt(this.supportThemeIcons?(0,joc.escapeIcons)(e):e).replace(/([ \t]+)/g,(n,o)=>" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,r===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,r){return this.value+=` -${b3i(r,e)} -`,this}appendLink(e,r,n){return this.value+="[",this.value+=this._escape(r,"]"),this.value+="](",this.value+=this._escape(String(e),")"),n&&(this.value+=` "${this._escape(this._escape(n,'"'),")")}"`),this.value+=")",this}_escape(e,r){let n=new RegExp((0,Hoc.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};Dy.MarkdownString=mvt;function v3i(t){return C3i(t)?!t.value:Array.isArray(t)?t.every(v3i):!0}a(v3i,"isEmptyMarkdownString");function C3i(t){return t instanceof mvt?!0:t&&typeof t=="object"?typeof t.value=="string"&&(typeof t.isTrusted=="boolean"||typeof t.isTrusted=="object"||t.isTrusted===void 0)&&(typeof t.supportThemeIcons=="boolean"||t.supportThemeIcons===void 0)&&(typeof t.supportAlertSyntax=="boolean"||t.supportAlertSyntax===void 0):!1}a(C3i,"isMarkdownString");function Goc(t,e){return t===e?!0:!t||!e?!1:t.value===e.value&&t.isTrusted===e.isTrusted&&t.supportThemeIcons===e.supportThemeIcons&&t.supportHtml===e.supportHtml&&t.supportAlertSyntax===e.supportAlertSyntax&&(t.baseUri===e.baseUri||!!t.baseUri&&!!e.baseUri&&(0,joc.isEqual)(hvt.URI.from(t.baseUri),hvt.URI.from(e.baseUri)))}a(Goc,"markdownStringEqual");function gvt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(gvt,"escapeMarkdownSyntaxTokens");function $oc(t){return t.replace(/[\\\]]/g,"\\$&")}a($oc,"escapeMarkdownLinkLabel");function b3i(t,e){let r=t.match(/^`+/gm)?.reduce((o,s)=>o.length>s.length?o:s).length??0,n=r>=3?r+1:3;return[`${"`".repeat(n)}${e}`,t,`${"`".repeat(n)}`].join(` -`)}a(b3i,"appendEscapedMarkdownCodeBlockFence");function Voc(t){let e=Math.max(0,...(t.match(/`+/g)??[]).map(s=>s.length)),r="`".repeat(e+1),o=t.startsWith("`")||t.endsWith("`")?` ${t} `:t;return`${r}${o}${r}`}a(Voc,"appendEscapedMarkdownInlineCode");function Woc(t){return t.replace(/"/g,""")}a(Woc,"escapeDoubleQuotes");function zoc(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(zoc,"removeMarkdownEscapes");function Yoc(t){let e=[],r=t.split("|").map(o=>o.trim());t=r[0];let n=r[1];if(n){let o=/height=(\d+)/.exec(n),s=/width=(\d+)/.exec(n),c=o?o[1]:"",l=s?s[1]:"",u=isFinite(parseInt(l)),d=isFinite(parseInt(c));u&&e.push(`width="${l}"`),d&&e.push(`height="${c}"`)}return{href:t,dimensions:e}}a(Yoc,"parseHrefAndDimensions");function S3i(t,e,r,n=!0){return`[${n?gvt(t):t}](${e}${r?` "${gvt(r)}"`:""})`}a(S3i,"createMarkdownLink");function Koc(t,e=!0){let r=T3i(t.id,...t.arguments||[]).toString();return S3i(t.text,r,t.tooltip,e)}a(Koc,"createMarkdownCommandLink");function T3i(t,...e){return hvt.URI.from({scheme:qoc.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(T3i,"createCommandUri")});var KPr=I(Gne=>{"use strict";p();var Joc=Gne&&Gne.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},zPr;Object.defineProperty(Gne,"__esModule",{value:!0});Gne.MarkdownString=void 0;var Zoc=I3i(),Xoc=dN(),YPr=zPr=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof zPr?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new Zoc.MarkdownString(e,{supportThemeIcons:r})}get value(){return this.#e.value}set value(e){this.#e.value=e}get isTrusted(){return this.#e.isTrusted}set isTrusted(e){this.#e.isTrusted=e}get supportThemeIcons(){return this.#e.supportThemeIcons}set supportThemeIcons(e){this.#e.supportThemeIcons=e}get supportHtml(){return this.#e.supportHtml}set supportHtml(e){this.#e.supportHtml=e}get supportAlertSyntax(){return this.#e.supportAlertSyntax}set supportAlertSyntax(e){this.#e.supportAlertSyntax=e}get baseUri(){return this.#e.baseUri}set baseUri(e){this.#e.baseUri=e}appendText(e){return this.#e.appendText(e),this}appendMarkdown(e){return this.#e.appendMarkdown(e),this}appendCodeblock(e,r){return this.#e.appendCodeblock(r??"",e),this}};Gne.MarkdownString=YPr;Gne.MarkdownString=YPr=zPr=Joc([Xoc.es5ClassCompat],YPr)});var R3i=I(dU=>{"use strict";p();Object.defineProperty(dU,"__esModule",{value:!0});dU.Mimes=void 0;dU.getMediaOrTextMime=tsc;dU.getMediaMime=w3i;dU.getExtensionForMimeType=rsc;dU.normalizeMimeType=isc;dU.isTextStreamMime=osc;var x3i=$A();dU.Mimes=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list",html:"text/html"});var esc={".css":"text/css",".csv":"text/csv",".htm":"text/html",".html":"text/html",".ics":"text/calendar",".js":"text/javascript",".mjs":"text/javascript",".txt":"text/plain",".xml":"text/xml"},JPr={".aac":"audio/x-aac",".avi":"video/x-msvideo",".bmp":"image/bmp",".flv":"video/x-flv",".gif":"image/gif",".ico":"image/x-icon",".jpe":["image/jpg","image/jpeg"],".jpeg":["image/jpg","image/jpeg"],".jpg":["image/jpg","image/jpeg"],".m1v":"video/mpeg",".m2a":"audio/mpeg",".m2v":"video/mpeg",".m3a":"audio/mpeg",".mid":"audio/midi",".midi":"audio/midi",".mk3d":"video/x-matroska",".mks":"video/x-matroska",".mkv":"video/x-matroska",".mov":"video/quicktime",".movie":"video/x-sgi-movie",".mp2":"audio/mpeg",".mp2a":"audio/mpeg",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4a":"audio/mp4",".mp4v":"video/mp4",".mpe":"video/mpeg",".mpeg":"video/mpeg",".mpg":"video/mpeg",".mpg4":"video/mp4",".mpga":"audio/mpeg",".oga":"audio/ogg",".ogg":"audio/ogg",".opus":"audio/opus",".ogv":"video/ogg",".png":"image/png",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".spx":"audio/ogg",".svg":"image/svg+xml",".tga":"image/x-tga",".tif":"image/tiff",".tiff":"image/tiff",".wav":"audio/x-wav",".webm":"video/webm",".webp":"image/webp",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".woff":"application/font-woff"};function tsc(t){let e=(0,x3i.extname)(t),r=esc[e.toLowerCase()];return r!==void 0?r:w3i(t)}a(tsc,"getMediaOrTextMime");function w3i(t){let e=(0,x3i.extname)(t),r=JPr[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a(w3i,"getMediaMime");function rsc(t){for(let e in JPr){let r=JPr[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(rsc,"getExtensionForMimeType");var nsc=/^(.+)\/(.+?)(;.+)?$/;function isc(t,e){let r=nsc.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(isc,"normalizeMimeType");function osc(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(osc,"isTextStreamMime")});var D3i=I(Ug=>{"use strict";p();var ssc=Ug&&Ug.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},fV;Object.defineProperty(Ug,"__esModule",{value:!0});Ug.NotebookCellOutput=Ug.NotebookCellOutputItem=Ug.NotebookEdit=Ug.NotebookData=Ug.NotebookCellData=Ug.NotebookRange=Ug.NotebookCellKind=void 0;var asc=dN(),k3i=Os(),Avt=R3i(),csc=Og(),P3i;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(P3i||(Ug.NotebookCellKind=P3i={}));var $ne=class t{static{a(this,"NotebookRange")}static isNotebookRange(e){return e instanceof t?!0:e?typeof e.start=="number"&&typeof e.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,r){if(e<0)throw(0,k3i.illegalArgument)("start must be positive");if(r<0)throw(0,k3i.illegalArgument)("end must be positive");e<=r?(this._start=e,this._end=r):(this._start=r,this._end=e)}with(e){let r=this._start,n=this._end;return e.start!==void 0&&(r=e.start),e.end!==void 0&&(n=e.end),r===this._start&&n===this._end?this:new t(r,n)}};Ug.NotebookRange=$ne;var ZPr=class t{static{a(this,"NotebookCellData")}static validate(e){if(typeof e.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof e.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof e.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(e){return Array.isArray(e)&&e.every(r=>t.isNotebookCellData(r))}static isNotebookCellData(e){return!0}constructor(e,r,n,o,s,c,l){this.kind=e,this.value=r,this.languageId=n,this.mime=o,this.outputs=s??[],this.metadata=c,this.executionSummary=l,t.validate(this)}};Ug.NotebookCellData=ZPr;var XPr=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};Ug.NotebookData=XPr;var e2r=fV=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof fV?!0:e?$ne.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new fV(e,r)}static insertCells(e,r){return new fV(new $ne(e,e),r)}static deleteCells(e){return new fV(e,[])}static updateCellMetadata(e,r){let n=new fV(new $ne(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new fV(new $ne(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};Ug.NotebookEdit=e2r;Ug.NotebookEdit=e2r=fV=ssc([asc.es5ClassCompat],e2r);var t2r=class t{static{a(this,"NotebookCellOutputItem")}static isNotebookCellOutputItem(e){return e instanceof t?!0:e?typeof e.mime=="string"&&e.data instanceof Uint8Array:!1}static error(e){let r={name:e.name,message:e.message,stack:e.stack};return t.json(r,"application/vnd.code.notebook.error")}static stdout(e){return t.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return t.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,r="application/octet-stream"){return new t(e,r)}static#e=new TextEncoder;static text(e,r=Avt.Mimes.text){let n=t.#e.encode(String(e));return new t(n,r)}static json(e,r="text/x-json"){let n=JSON.stringify(e,void 0," ");return t.text(n,r)}constructor(e,r){this.data=e,this.mime=r;let n=(0,Avt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};Ug.NotebookCellOutputItem=t2r;var r2r=class t{static{a(this,"NotebookCellOutput")}static isNotebookCellOutput(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,r=!1){let n=new Set,o=new Set;for(let s=0;s!o.has(c))}constructor(e,r,n){this.items=t.ensureUniqueMimeTypes(e,!0),typeof r=="string"?(this.id=r,this.metadata=n):(this.id=(0,csc.generateUuid)(),this.metadata=r??n)}};Ug.NotebookCellOutput=r2r});var M3i=I(hV=>{"use strict";p();var lsc=hV&&hV.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n2r;Object.defineProperty(hV,"__esModule",{value:!0});hV.Selection=void 0;hV.getDebugDescriptionOfSelection=N3i;var usc=dN(),pV=r_e(),i2r=BL(),o2r=n2r=class extends i2r.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof n2r?!0:!e||typeof e!="object"?!1:i2r.Range.isRange(e)&&pV.Position.isPosition(e.anchor)&&pV.Position.isPosition(e.active)&&typeof e.isReversed=="boolean"}get anchor(){return this._anchor}get active(){return this._active}constructor(e,r,n,o){let s,c;if(typeof e=="number"&&typeof r=="number"&&typeof n=="number"&&typeof o=="number"?(s=new pV.Position(e,r),c=new pV.Position(n,o)):pV.Position.isPosition(e)&&pV.Position.isPosition(r)&&(s=pV.Position.of(e),c=pV.Position.of(r)),!s||!c)throw new Error("Invalid arguments");super(s,c),this._anchor=s,this._active=c}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}[Symbol.for("debug.description")](){return N3i(this)}};hV.Selection=o2r;hV.Selection=o2r=n2r=lsc([usc.es5ClassCompat],o2r);function N3i(t){let e=(0,i2r.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(N3i,"getDebugDescriptionOfSelection")});var a2r=I(Wne=>{"use strict";p();var dsc=Wne&&Wne.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Vne;Object.defineProperty(Wne,"__esModule",{value:!0});Wne.SnippetString=void 0;var fsc=dN(),s2r=Vne=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof Vne?!0:!e||typeof e!="object"?!1:typeof e.value=="string"}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){this._tabstop=1,this.value=e||""}appendText(e){return this.value+=Vne._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,r=this._tabstop++){if(typeof e=="function"){let n=new Vne;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Vne._escape(e);return this.value+="${",this.value+=r,this.value+=":",this.value+=e,this.value+="}",this}appendChoice(e,r=this._tabstop++){let n=e.map(o=>o.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=r,this.value+="|",this.value+=n,this.value+="|}",this}appendVariable(e,r){if(typeof r=="function"){let n=new Vne;n._tabstop=this._tabstop,r(n),this._tabstop=n._tabstop,r=n.value}else typeof r=="string"&&(r=r.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,r&&(this.value+=":",this.value+=r),this.value+="}",this}};Wne.SnippetString=s2r;Wne.SnippetString=s2r=Vne=dsc([fsc.es5ClassCompat],s2r)});var l2r=I(yvt=>{"use strict";p();Object.defineProperty(yvt,"__esModule",{value:!0});yvt.SnippetTextEdit=void 0;var psc=a2r(),O3i=BL(),c2r=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?O3i.Range.isRange(e.range)&&psc.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new O3i.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};yvt.SnippetTextEdit=c2r});var F3i=I(fN=>{"use strict";p();var hsc=fN&&fN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},u2r;Object.defineProperty(fN,"__esModule",{value:!0});fN.SymbolInformation=fN.SymbolTag=fN.SymbolKind=void 0;var msc=dN(),L3i=IPr(),gsc=BL(),d2r;(function(t){t[t.File=0]="File",t[t.Module=1]="Module",t[t.Namespace=2]="Namespace",t[t.Package=3]="Package",t[t.Class=4]="Class",t[t.Method=5]="Method",t[t.Property=6]="Property",t[t.Field=7]="Field",t[t.Constructor=8]="Constructor",t[t.Enum=9]="Enum",t[t.Interface=10]="Interface",t[t.Function=11]="Function",t[t.Variable=12]="Variable",t[t.Constant=13]="Constant",t[t.String=14]="String",t[t.Number=15]="Number",t[t.Boolean=16]="Boolean",t[t.Array=17]="Array",t[t.Object=18]="Object",t[t.Key=19]="Key",t[t.Null=20]="Null",t[t.EnumMember=21]="EnumMember",t[t.Struct=22]="Struct",t[t.Event=23]="Event",t[t.Operator=24]="Operator",t[t.TypeParameter=25]="TypeParameter"})(d2r||(fN.SymbolKind=d2r={}));var B3i;(function(t){t[t.Deprecated=1]="Deprecated"})(B3i||(fN.SymbolTag=B3i={}));var f2r=u2r=class{static{a(this,"SymbolInformation")}static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,r,n,o,s){this.name=e,this.kind=r,this.containerName=s,typeof n=="string"&&(this.containerName=n),o instanceof L3i.Location?this.location=o:n instanceof gsc.Range&&(this.location=new L3i.Location(o,n)),u2r.validate(this)}toJSON(){return{name:this.name,kind:d2r[this.kind],location:this.location,containerName:this.containerName}}};fN.SymbolInformation=f2r;fN.SymbolInformation=f2r=u2r=hsc([msc.es5ClassCompat],f2r)});var m2r=I(fU=>{"use strict";p();var Asc=fU&&fU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},zne;Object.defineProperty(fU,"__esModule",{value:!0});fU.TextEdit=fU.EndOfLine=void 0;var p2r=Os(),ysc=dN(),U3i=r_e(),_vt=BL(),Q3i;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(Q3i||(fU.EndOfLine=Q3i={}));var h2r=zne=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof zne?!0:!e||typeof e!="object"?!1:_vt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new zne(e,r)}static insert(e,r){return zne.replace(new _vt.Range(e,e),r)}static delete(e){return zne.replace(e,"")}static setEndOfLine(e){let r=new zne(new _vt.Range(new U3i.Position(0,0),new U3i.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!_vt.Range.isRange(e))throw(0,p2r.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,p2r.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,p2r.illegalArgument)("newEol");this._newEol=e}constructor(e,r){this._range=e,this._newText=r}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};fU.TextEdit=h2r;fU.TextEdit=h2r=zne=Asc([ysc.es5ClassCompat],h2r)});var Z3i=I(It=>{"use strict";p();Object.defineProperty(It,"__esModule",{value:!0});It.ChatRequestEditedFileEventKind=It.ChatInputNotificationSeverity=It.ChatErrorLevel=It.AISearchKeyword=It.TextSearchMatch2=It.ExcludeSettingOptions=It.LanguageModelPromptTsxPart=It.ChatImageMimeType=It.LanguageModelDataPart2=It.LanguageModelDataPart=It.LanguageModelThinkingPart=It.LanguageModelTextPart2=It.LanguageModelPartAudience=It.LanguageModelTextPart=It.LanguageModelToolResult2=It.LanguageModelToolResult=It.ChatReferenceBinaryData=It.ChatReferenceDiagnostic=It.ChatRequestNotebookData=It.ChatRequestEditorData=It.ChatResponseTurn=It.ChatRequestTurn2=It.ChatRequestTurn=It.ChatResponseQuestionCarouselPart=It.ChatQuestion=It.ChatQuestionType=It.ChatResponseConfirmationPart=It.ChatResponseWorkspaceEditPart=It.ChatResponseNotebookEditPart=It.ChatResponseTextEditPart=It.ChatResponseMarkdownWithVulnerabilitiesPart=It.ChatResponseCommandButtonPart=It.ChatResponseCodeCitationPart=It.ChatResponseAutoModeResolutionPart=It.ChatResponsePullRequestPart=It.ChatResponseExtensionsPart=It.ChatResponseMovePart=It.ChatResponseReferencePart2=It.ChatResponseReferencePart=It.ChatResponseInfoPart=It.ChatResponseWarningPart=It.ChatResponseProgressPart2=It.ChatResponseExternalEditPart=It.ChatResponseHookPart=It.ChatResponseThinkingProgressPart=It.ChatResponseProgressPart=It.ChatResponseAnchorPart=It.ChatResponseFileTreePart=It.ChatResponseCodeblockUriPart=It.ChatResponseMarkdownPart=void 0;It.McpHttpServerDefinition=It.McpStdioServerDefinition=It.ChatResource=It.LanguageModelError=It.ChatSessionStatus=It.ChatResponseTurn2=It.ChatSubagentToolInvocationData=It.ChatToolInvocationPart=It.McpToolInvocationContentData=It.LanguageModelChatMessage=It.LanguageModelChatToolMode=It.LanguageModelChatMessageRole=It.LanguageModelToolResultPart2=It.LanguageModelToolResultPart=It.LanguageModelToolCallPart=It.LanguageModelToolMCPSource=It.LanguageModelToolExtensionSource=It.ChatResponseClearToPreviousToolInvocationReason=void 0;var q3i=J$(),bvt=KPr(),g2r=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new bvt.MarkdownString(e):e}};It.ChatResponseMarkdownPart=g2r;var A2r=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};It.ChatResponseCodeblockUriPart=A2r;var y2r=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};It.ChatResponseFileTreePart=y2r;var _2r=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};It.ChatResponseAnchorPart=_2r;var E2r=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};It.ChatResponseProgressPart=E2r;var v2r=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};It.ChatResponseThinkingProgressPart=v2r;var C2r=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};It.ChatResponseHookPart=C2r;var b2r=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};It.ChatResponseExternalEditPart=b2r;var S2r=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};It.ChatResponseProgressPart2=S2r;var T2r=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new bvt.MarkdownString(e):e}};It.ChatResponseWarningPart=T2r;var I2r=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new bvt.MarkdownString(e):e}};It.ChatResponseInfoPart=I2r;var x2r=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};It.ChatResponseReferencePart=x2r;var w2r=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};It.ChatResponseReferencePart2=w2r;var R2r=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};It.ChatResponseMovePart=R2r;var k2r=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};It.ChatResponseExtensionsPart=k2r;var P2r=class{static{a(this,"ChatResponsePullRequestPart")}constructor(e,r,n,o,s){"command"in e&&typeof e.command=="string"?this.command=e:(this.uri=e,this.command={title:"View Pull Request",command:"vscode.open",arguments:[e]}),this.title=r,this.description=n,this.author=o,this.linkTag=s}};It.ChatResponsePullRequestPart=P2r;var D2r=class{static{a(this,"ChatResponseAutoModeResolutionPart")}constructor(e,r,n,o){this.resolvedModel=e,this.resolvedModelName=r,this.predictedLabel=n,this.confidence=o}};It.ChatResponseAutoModeResolutionPart=D2r;var N2r=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};It.ChatResponseCodeCitationPart=N2r;var M2r=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};It.ChatResponseCommandButtonPart=M2r;var O2r=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new bvt.MarkdownString(e):e,this.vulnerabilities=r}};It.ChatResponseMarkdownWithVulnerabilitiesPart=O2r;var L2r=class{static{a(this,"ChatResponseTextEditPart")}constructor(e,r){this.uri=e,r===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(r)?r:[r]}};It.ChatResponseTextEditPart=L2r;var B2r=class{static{a(this,"ChatResponseNotebookEditPart")}constructor(e,r){this.uri=e,r===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(r)?r:[r]}};It.ChatResponseNotebookEditPart=B2r;var F2r=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};It.ChatResponseWorkspaceEditPart=F2r;var U2r=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};It.ChatResponseConfirmationPart=U2r;var j3i;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(j3i||(It.ChatQuestionType=j3i={}));var Q2r=class{static{a(this,"ChatQuestion")}constructor(e,r,n,o){this.id=e,this.type=r,this.title=n,o&&(this.message=o.message,this.options=o.options,this.defaultValue=o.defaultValue,this.allowFreeformInput=o.allowFreeformInput)}};It.ChatQuestion=Q2r;var q2r=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};It.ChatResponseQuestionCarouselPart=q2r;var j2r=class{static{a(this,"ChatRequestTurn")}constructor(e,r,n,o,s){this.prompt=e,this.command=r,this.references=n,this.participant=o,this.toolReferences=s}};It.ChatRequestTurn=j2r;var H2r=class{static{a(this,"ChatRequestTurn2")}constructor(e,r,n,o,s,c,l,u,d){this.prompt=e,this.command=r,this.references=n,this.participant=o,this.toolReferences=s,this.editedFileEvents=c,this.id=l,this.modelId=u,this.modeInstructions2=d}};It.ChatRequestTurn2=H2r;var G2r=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};It.ChatResponseTurn=G2r;var $2r=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};It.ChatRequestEditorData=$2r;var V2r=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};It.ChatRequestNotebookData=V2r;var W2r=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};It.ChatReferenceDiagnostic=W2r;var z2r=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};It.ChatReferenceBinaryData=z2r;var Y2r=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};It.LanguageModelToolResult=Y2r;var K2r=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};It.LanguageModelToolResult2=K2r;var Evt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};It.LanguageModelTextPart=Evt;var H3i;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})(H3i||(It.LanguageModelPartAudience=H3i={}));var J2r=class extends Evt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};It.LanguageModelTextPart2=J2r;var Z2r=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};It.LanguageModelThinkingPart=Z2r;var vvt=class t{static{a(this,"LanguageModelDataPart")}constructor(e,r){this.mimeType=r,this.data=e}static image(e,r){return new t(e,r)}static json(e){let r=JSON.stringify(e,void 0," ");return new t(q3i.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t(q3i.VSBuffer.fromString(e).buffer,"text/plain")}};It.LanguageModelDataPart=vvt;var X2r=class extends vvt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};It.LanguageModelDataPart2=X2r;var G3i;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(G3i||(It.ChatImageMimeType=G3i={}));var eDr=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};It.LanguageModelPromptTsxPart=eDr;var $3i;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})($3i||(It.ExcludeSettingOptions=$3i={}));var tDr=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};It.TextSearchMatch2=tDr;var rDr=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};It.AISearchKeyword=rDr;var V3i;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(V3i||(It.ChatErrorLevel=V3i={}));var W3i;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(W3i||(It.ChatInputNotificationSeverity=W3i={}));var z3i;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(z3i||(It.ChatRequestEditedFileEventKind=z3i={}));var Y3i;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(Y3i||(It.ChatResponseClearToPreviousToolInvocationReason=Y3i={}));var nDr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};It.LanguageModelToolExtensionSource=nDr;var iDr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};It.LanguageModelToolMCPSource=iDr;var oDr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};It.LanguageModelToolCallPart=oDr;var sDr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};It.LanguageModelToolResultPart=sDr;var aDr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};It.LanguageModelToolResultPart2=aDr;var Cvt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(Cvt||(It.LanguageModelChatMessageRole=Cvt={}));var K3i;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(K3i||(It.LanguageModelChatToolMode=K3i={}));var cDr=class t{static{a(this,"LanguageModelChatMessage")}constructor(e,r,n){this.role=e,this.content=typeof r=="string"?[{type:"text",value:r}]:r,this.name=n}static User(e,r){return new t(Cvt.User,e,r)}static Assistant(e,r){return new t(Cvt.Assistant,e,r)}};It.LanguageModelChatMessage=cDr;var lDr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};It.McpToolInvocationContentData=lDr;var uDr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};It.ChatToolInvocationPart=uDr;var dDr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};It.ChatSubagentToolInvocationData=dDr;var fDr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};It.ChatResponseTurn2=fDr;var J3i;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(J3i||(It.ChatSessionStatus=J3i={}));var pDr=class t extends Error{static{a(this,"LanguageModelError")}static#e="LanguageModelError";static NotFound(e){return new t(e,t.NotFound.name)}static NoPermissions(e){return new t(e,t.NoPermissions.name)}static Blocked(e){return new t(e,t.Blocked.name)}constructor(e,r,n){super(e,{cause:n}),this.name=t.#e,this.code=r??""}};It.LanguageModelError=pDr;var hDr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};It.ChatResource=hDr;var mDr=class{static{a(this,"McpStdioServerDefinition")}constructor(e,r,n,o,s){this.label=e,this.command=r,this.args=n??[],this.env=o??{},this.version=s}};It.McpStdioServerDefinition=mDr;var gDr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};It.McpHttpServerDefinition=gDr});var tFi=I(mV=>{"use strict";p();Object.defineProperty(mV,"__esModule",{value:!0});mV.TextDocumentChangeReason=mV.TextEditorSelectionChangeKind=mV.WorkspaceEdit=void 0;var _sc=Ml(),Esc=b2(),vsc=BL(),Csc=l2r(),bsc=m2r(),ADr=class{static{a(this,"WorkspaceEdit")}constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,r,n,o){this._edits.push({_type:1,from:e,to:r,options:n,metadata:o})}createFile(e,r,n){this._edits.push({_type:1,from:void 0,to:e,options:r,metadata:n})}deleteFile(e,r,n){this._edits.push({_type:1,from:e,to:void 0,options:r,metadata:n})}replace(e,r,n,o){this._edits.push({_type:2,uri:e,edit:new bsc.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new vsc.Range(r,r),n,o)}delete(e,r,n){this.replace(e,r,"",n)}has(e){return this._edits.some(r=>r._type===2&&r.uri.toString()===e.toString())}set(e,r){if(r)for(let n of r){if(!n)continue;let o,s;Array.isArray(n)?(o=n[0],s=n[1]):o=n,Csc.SnippetTextEdit.isSnippetTextEdit(o)?this._edits.push({_type:6,uri:e,range:o.range,edit:o.snippet,metadata:s}):this._edits.push({_type:2,uri:e,edit:o,metadata:s})}else{for(let n=0;n{"use strict";p();Object.defineProperty(Lp,"__esModule",{value:!0});Lp.FileType=Lp.ChatSessionStatus=Lp.ChatLocation=Lp.ChatVariableLevel=Lp.ExtensionMode=Lp.DiagnosticSeverity=Lp.TextEditorRevealType=Lp.TextEditorLineNumbersStyle=Lp.TextEditorCursorStyle=Lp.InteractiveEditorResponseFeedbackKind=void 0;var rFi;(function(t){t[t.Unhelpful=0]="Unhelpful",t[t.Helpful=1]="Helpful",t[t.Undone=2]="Undone",t[t.Accepted=3]="Accepted",t[t.Bug=4]="Bug"})(rFi||(Lp.InteractiveEditorResponseFeedbackKind=rFi={}));var nFi;(function(t){t[t.Line=1]="Line",t[t.Block=2]="Block",t[t.Underline=3]="Underline",t[t.LineThin=4]="LineThin",t[t.BlockOutline=5]="BlockOutline",t[t.UnderlineThin=6]="UnderlineThin"})(nFi||(Lp.TextEditorCursorStyle=nFi={}));var iFi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(iFi||(Lp.TextEditorLineNumbersStyle=iFi={}));var oFi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(oFi||(Lp.TextEditorRevealType=oFi={}));var sFi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(sFi||(Lp.DiagnosticSeverity=sFi={}));var aFi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(aFi||(Lp.ExtensionMode=aFi={}));var cFi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(cFi||(Lp.ChatVariableLevel=cFi={}));var lFi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(lFi||(Lp.ChatLocation=lFi={}));var uFi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(uFi||(Lp.ChatSessionStatus=uFi={}));var dFi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(dFi||(Lp.FileType=dFi={}))});var hFi=I(yDr=>{"use strict";p();Object.defineProperty(yDr,"__esModule",{value:!0});yDr.t=Ssc;function Ssc(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return pFi({message:e,args:r})}return pFi(t[0])}a(Ssc,"t");function pFi(t){let{message:e,args:r}=t;return Isc(e,r??{})}a(pFi,"getMessage");var Tsc=/{([^}]+)}/g;function Isc(t,e){return t.replace(Tsc,(r,n)=>e[n]??r)}a(Isc,"format2")});var AFi=I(gV=>{"use strict";p();Object.defineProperty(gV,"__esModule",{value:!0});gV.NewSymbolName=gV.NewSymbolNameTriggerKind=gV.NewSymbolNameTag=void 0;var mFi;(function(t){t[t.AIGenerated=1]="AIGenerated"})(mFi||(gV.NewSymbolNameTag=mFi={}));var gFi;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(gFi||(gV.NewSymbolNameTriggerKind=gFi={}));var _Dr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};gV.NewSymbolName=_Dr});var _Fi=I(Svt=>{"use strict";p();Object.defineProperty(Svt,"__esModule",{value:!0});Svt.TerminalShellExecutionCommandLineConfidence=void 0;var yFi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(yFi||(Svt.TerminalShellExecutionCommandLineConfidence=yFi={}))});var EFi=I(i_e=>{"use strict";p();Object.defineProperty(i_e,"__esModule",{value:!0});i_e.ThemeColor=i_e.ThemeIcon=void 0;var EDr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};i_e.ThemeIcon=EDr;var vDr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};i_e.ThemeColor=vDr});var Qg=I((y$p,SFi)=>{"use strict";p();var xsc=S2(),wsc=Fc(),Rsc=hd(),vFi=bPr(),ksc=IPr(),Psc=KPr(),wBe=D3i(),Dsc=r_e(),Nsc=BL(),Msc=M3i(),Osc=a2r(),Lsc=l2r(),CFi=F3i(),bFi=m2r(),Ln=Z3i(),CDr=tFi(),AV=fFi(),Bsc=hFi(),bDr=AFi(),Fsc=_Fi(),Usc=EFi(),Qsc={Position:Dsc.Position,Range:Nsc.Range,Selection:Msc.Selection,EventEmitter:wsc.Emitter,CancellationTokenSource:xsc.CancellationTokenSource,Diagnostic:vFi.Diagnostic,Location:ksc.Location,DiagnosticRelatedInformation:vFi.DiagnosticRelatedInformation,TextEdit:bFi.TextEdit,WorkspaceEdit:CDr.WorkspaceEdit,Uri:Rsc.URI,MarkdownString:Psc.MarkdownString,DiagnosticSeverity:AV.DiagnosticSeverity,TextEditorCursorStyle:AV.TextEditorCursorStyle,TextEditorLineNumbersStyle:AV.TextEditorLineNumbersStyle,TextEditorRevealType:AV.TextEditorRevealType,EndOfLine:bFi.EndOfLine,l10n:{t:Bsc.t},ExtensionMode:AV.ExtensionMode,ChatVariableLevel:AV.ChatVariableLevel,ChatResponseClearToPreviousToolInvocationReason:Ln.ChatResponseClearToPreviousToolInvocationReason,ChatResponseMarkdownPart:Ln.ChatResponseMarkdownPart,ChatResponseFileTreePart:Ln.ChatResponseFileTreePart,ChatResponseAnchorPart:Ln.ChatResponseAnchorPart,ChatResponseMovePart:Ln.ChatResponseMovePart,ChatResponseExtensionsPart:Ln.ChatResponseExtensionsPart,ChatResponseProgressPart:Ln.ChatResponseProgressPart,ChatResponseProgressPart2:Ln.ChatResponseProgressPart2,ChatResponseWarningPart:Ln.ChatResponseWarningPart,ChatResponseInfoPart:Ln.ChatResponseInfoPart,ChatResponseHookPart:Ln.ChatResponseHookPart,ChatResponseReferencePart:Ln.ChatResponseReferencePart,ChatResponseReferencePart2:Ln.ChatResponseReferencePart2,ChatResponseCodeCitationPart:Ln.ChatResponseCodeCitationPart,ChatResponseCommandButtonPart:Ln.ChatResponseCommandButtonPart,ChatResponseExternalEditPart:Ln.ChatResponseExternalEditPart,ChatResponseMarkdownWithVulnerabilitiesPart:Ln.ChatResponseMarkdownWithVulnerabilitiesPart,ChatResponseCodeblockUriPart:Ln.ChatResponseCodeblockUriPart,ChatResponseTextEditPart:Ln.ChatResponseTextEditPart,ChatResponseNotebookEditPart:Ln.ChatResponseNotebookEditPart,ChatResponseWorkspaceEditPart:Ln.ChatResponseWorkspaceEditPart,ChatResponseConfirmationPart:Ln.ChatResponseConfirmationPart,ChatQuestion:Ln.ChatQuestion,ChatQuestionType:Ln.ChatQuestionType,ChatResponseQuestionCarouselPart:Ln.ChatResponseQuestionCarouselPart,ChatRequestTurn:Ln.ChatRequestTurn,ChatResponseTurn:Ln.ChatResponseTurn,ChatRequestEditorData:Ln.ChatRequestEditorData,ChatRequestNotebookData:Ln.ChatRequestNotebookData,NewSymbolName:bDr.NewSymbolName,NewSymbolNameTag:bDr.NewSymbolNameTag,NewSymbolNameTriggerKind:bDr.NewSymbolNameTriggerKind,ChatLocation:AV.ChatLocation,SymbolInformation:CFi.SymbolInformation,LanguageModelToolResult:Ln.LanguageModelToolResult,ExtendedLanguageModelToolResult:Ln.LanguageModelToolResult,LanguageModelToolResult2:Ln.LanguageModelToolResult2,LanguageModelPromptTsxPart:Ln.LanguageModelPromptTsxPart,LanguageModelTextPart:Ln.LanguageModelTextPart,LanguageModelDataPart:Ln.LanguageModelDataPart,LanguageModelToolExtensionSource:Ln.LanguageModelToolExtensionSource,LanguageModelToolMCPSource:Ln.LanguageModelToolMCPSource,ChatReferenceBinaryData:Ln.ChatReferenceBinaryData,ChatReferenceDiagnostic:Ln.ChatReferenceDiagnostic,TextSearchMatch2:Ln.TextSearchMatch2,AISearchKeyword:Ln.AISearchKeyword,ExcludeSettingOptions:Ln.ExcludeSettingOptions,NotebookCellKind:wBe.NotebookCellKind,NotebookRange:wBe.NotebookRange,NotebookEdit:wBe.NotebookEdit,NotebookCellData:wBe.NotebookCellData,NotebookData:wBe.NotebookData,ChatErrorLevel:Ln.ChatErrorLevel,ChatInputNotificationSeverity:Ln.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:Fsc.TerminalShellExecutionCommandLineConfidence,ChatRequestEditedFileEventKind:Ln.ChatRequestEditedFileEventKind,ChatResponsePullRequestPart:Ln.ChatResponsePullRequestPart,ChatResponseAutoModeResolutionPart:Ln.ChatResponseAutoModeResolutionPart,LanguageModelTextPart2:Ln.LanguageModelTextPart2,LanguageModelDataPart2:Ln.LanguageModelDataPart2,LanguageModelThinkingPart:Ln.LanguageModelThinkingPart,LanguageModelPartAudience:Ln.LanguageModelPartAudience,ChatResponseThinkingProgressPart:Ln.ChatResponseThinkingProgressPart,LanguageModelToolCallPart:Ln.LanguageModelToolCallPart,LanguageModelToolResultPart:Ln.LanguageModelToolResultPart,LanguageModelToolResultPart2:Ln.LanguageModelToolResultPart2,LanguageModelChatMessageRole:Ln.LanguageModelChatMessageRole,LanguageModelChatMessage:Ln.LanguageModelChatMessage,LanguageModelChatToolMode:Ln.LanguageModelChatToolMode,TextEditorSelectionChangeKind:CDr.TextEditorSelectionChangeKind,TextDocumentChangeReason:CDr.TextDocumentChangeReason,ChatToolInvocationPart:Ln.ChatToolInvocationPart,ChatSubagentToolInvocationData:Ln.ChatSubagentToolInvocationData,McpToolInvocationContentData:Ln.McpToolInvocationContentData,ChatResponseTurn2:Ln.ChatResponseTurn2,ChatRequestTurn2:Ln.ChatRequestTurn2,LanguageModelError:Ln.LanguageModelError,SymbolKind:CFi.SymbolKind,SnippetString:Osc.SnippetString,SnippetTextEdit:Lsc.SnippetTextEdit,FileType:AV.FileType,ChatSessionStatus:Ln.ChatSessionStatus,authentication:{getSession:a(async()=>{throw new Error("authentication.getSession not mocked in test")},"getSession")},McpHttpServerDefinition:Ln.McpHttpServerDefinition,McpStdioServerDefinition:Ln.McpStdioServerDefinition,ThemeIcon:Usc.ThemeIcon};SFi.exports=Qsc});var TFi=I(o_e=>{"use strict";p();Object.defineProperty(o_e,"__esModule",{value:!0});o_e.UseData=o_e.UseState=void 0;var SDr=class{static{a(this,"UseState")}constructor(e){this.states=e,this.currentIndex=0,this.stateChanged=!1}useState(e){let r=this.currentIndex;if(this.states[r]===void 0){let o=typeof e=="function"?e():e;this.states[r]=o}let n=a(o=>{let s=typeof o=="function"?o(this.states[r]):o;this.states[r]=s,this.stateChanged=!0},"setState");return this.currentIndex++,[this.states[r],n]}hasChanged(){return this.stateChanged}};o_e.UseState=SDr;var TDr=class{static{a(this,"UseData")}constructor(e){this.measureUpdateTime=e,this.consumers=[]}useData(e,r){this.consumers.push(n=>{if(e(n))return r(n)})}async updateData(e){if(this.consumers.length>0){let r=performance.now();for(let n of this.consumers)await n(e);this.measureUpdateTime(performance.now()-r)}}};o_e.UseData=TDr});var xFi=I(Tvt=>{"use strict";p();Object.defineProperty(Tvt,"__esModule",{value:!0});Tvt.VirtualPromptReconciler=void 0;var IFi=TFi(),IDr=class{static{a(this,"VirtualPromptReconciler")}constructor(e){this.lifecycleData=new Map,this.vTree=this.virtualizeElement(e,"$",0)}reconcile(e){if(!this.vTree)throw new Error("No tree to reconcile, make sure to pass a valid prompt");return e?.isCancellationRequested?this.vTree:(this.vTree=this.reconcileNode(this.vTree,"$",0,e),this.vTree)}reconcileNode(e,r,n,o){if(!e.children&&!e.lifecycle)return e;let s=e;if(e.lifecycle?.isRemountRequired()){let l=this.collectChildPaths(e);s=this.virtualizeElement(e.component,r,n);let u=this.collectChildPaths(s);this.cleanupState(l,u)}else if(e.children){let l=[];for(let u=0;u"u")){if(typeof e=="string"||typeof e=="number")return{name:typeof e,path:`${r}[${n}]`,props:{value:e},component:e};if(qsc(e.type)){let o=e.type(e.props.children),s=r!=="$"?`[${n}]`:"",c=`${r}${s}.${o.type}`,l=o.children.map((u,d)=>this.virtualizeElement(u,c,d));return this.ensureUniqueKeys(l),{name:o.type,path:c,children:l.flat().filter(u=>u!==void 0),component:e}}return this.virtualizeFunctionComponent(r,n,e,e.type)}}virtualizeFunctionComponent(e,r,n,o){let s=n.props.key?`["${n.props.key}"]`:`[${r}]`,c=`${e}${s}.${o.name}`,l=new wDr(this.getOrCreateLifecycleData(c)),u=o(n.props,l),h=(Array.isArray(u)?u:[u]).map((m,g)=>this.virtualizeElement(m,c,g)).flat().filter(m=>m!==void 0);return this.ensureUniqueKeys(h),{name:o.name,path:c,props:n.props,children:h,component:n,lifecycle:l}}ensureUniqueKeys(e){let r=new Map;for(let o of e){if(!o)continue;let s=o.props?.key;s&&r.set(s,(r.get(s)||0)+1)}let n=Array.from(r.entries()).filter(([o,s])=>s>1).map(([o])=>o);if(n.length>0)throw new Error(`Duplicate keys found: ${n.join(", ")}`)}collectChildPaths(e){let r=[];if(e?.children)for(let n of e.children)n&&(r.push(n.path),r.push(...this.collectChildPaths(n)));return r}cleanupState(e,r){for(let n of e)r.includes(n)||this.lifecycleData.delete(n)}getOrCreateLifecycleData(e){return this.lifecycleData.has(e)||this.lifecycleData.set(e,new xDr([])),this.lifecycleData.get(e)}createPipe(){return{pump:a(async e=>{await this.pumpData(e)},"pump")}}async pumpData(e){if(!this.vTree)throw new Error("No tree to pump data into. Pumping data before initializing?");await this.recursivelyPumpData(e,this.vTree)}async recursivelyPumpData(e,r){if(!r)throw new Error("Can't pump data into undefined node.");await r.lifecycle?.dataHook.updateData(e);for(let n of r.children||[])await this.recursivelyPumpData(e,n)}};Tvt.VirtualPromptReconciler=IDr;var xDr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},wDr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new IFi.UseState(e.state),this.dataHook=new IFi.UseData(r=>{e._updateTimeMs=r})}useState(e){return this.stateHook.useState(e)}useData(e,r){this.dataHook.useData(e,r)}isRemountRequired(){return this.stateHook.hasChanged()}};function qsc(t){return typeof t=="function"&&"isFragmentFunction"in t}a(qsc,"isFragmentFunction")});var wFi=I(Ivt=>{"use strict";p();Object.defineProperty(Ivt,"__esModule",{value:!0});Ivt.VirtualPrompt=void 0;var jsc=xFi(),RDr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new jsc.VirtualPromptReconciler(e)}snapshotNode(e,r){if(!e)return;if(r?.isCancellationRequested)return"cancelled";let n=[];for(let o of e.children??[]){let s=this.snapshotNode(o,r);if(s==="cancelled")return"cancelled";s!==void 0&&n.push(s)}return{value:e.props?.value?.toString(),name:e.name,path:e.path,props:e.props,children:n,statistics:{updateDataTimeMs:e.lifecycle?.lifecycleData.getUpdateTimeMsAndReset()}}}snapshot(e){try{let r=this.reconciler.reconcile(e);if(e?.isCancellationRequested)return{snapshot:void 0,status:"cancelled"};if(!r)throw new Error("Invalid virtual prompt tree");let n=this.snapshotNode(r,e);return n==="cancelled"||e?.isCancellationRequested?{snapshot:void 0,status:"cancelled"}:{snapshot:n,status:"ok"}}catch(r){return{snapshot:void 0,status:"error",error:r}}}createPipe(){return this.reconciler.createPipe()}};Ivt.VirtualPrompt=RDr});var pU=I(xvt=>{"use strict";p();Object.defineProperty(xvt,"__esModule",{value:!0});xvt.Text=Hsc;xvt.Chunk=Gsc;function Hsc(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(Hsc,"Text");function Gsc(t){return t.children}a(Gsc,"Chunk")});var yV=I(hU=>{"use strict";p();Object.defineProperty(hU,"__esModule",{value:!0});hU.PerCompletionContextProviderStatistics=hU.ContextProviderStatistics=hU.ICompletionsContextProviderService=void 0;hU.componentStatisticsToPromptMatcher=Wsc;var $sc=an(),Vsc=aU();hU.ICompletionsContextProviderService=(0,$sc.createServiceIdentifier)("ICompletionsContextProviderService");var kDr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new wvt){this.createStatistics=e,this.statistics=new Vsc.LRUCacheMap(25)}getStatisticsForCompletion(e){let r=this.statistics.get(e);if(r)return r;let n=this.createStatistics();return this.statistics.set(e,n),n}getPreviousStatisticsForCompletion(e){let r=Array.from(this.statistics.keys());for(let n=r.length-1;n>=0;n--){let o=r[n];if(o!==e)return this.statistics.peek(o)}}};hU.ContextProviderStatistics=kDr;var wvt=class{static{a(this,"PerCompletionContextProviderStatistics")}constructor(){this._expectations=new Map,this._lastResolution=new Map,this._statistics=new Map,this.opportunityId=void 0}addExpectations(e,r){let n=this._expectations.get(e)??[];this._expectations.set(e,[...n,...r])}clearExpectations(){this._expectations.clear()}setLastResolution(e,r){this._lastResolution.set(e,r)}setOpportunityId(e){this.opportunityId=e}get(e){return this._statistics.get(e)}getAllUsageStatistics(){return this._statistics.entries()}computeMatch(e){try{for(let[r,n]of this._expectations){if(n.length===0)continue;let o=this._lastResolution.get(r)??"none";if(o==="none"||o==="error"){this._statistics.set(r,{usage:"none",resolution:o});continue}let s=[];for(let[d,f]of n){let h={id:d.id,type:d.type};if(d.origin&&(h.origin=d.origin),f==="content_excluded"){s.push({...h,usage:"none_content_excluded"});continue}let m=e.find(g=>g.source===d);m===void 0?s.push({...h,usage:"error"}):s.push({...h,usage:m.expectedTokens>0&&m.expectedTokens===m.actualTokens?"full":m.actualTokens>0?"partial":"none",expectedTokens:m.expectedTokens,actualTokens:m.actualTokens})}let l=s.reduce((d,f)=>f.usage==="full"?d+1:f.usage==="partial"?d+.5:d,0)/n.length,u=l===1?"full":l===0?"none":"partial";this._statistics.set(r,{resolution:o,usage:u,usageDetails:s})}}finally{this.clearExpectations(),this._lastResolution.clear()}}};hU.PerCompletionContextProviderStatistics=wvt;function Wsc(t){return t.map(e=>{if(!(e.source===void 0||e.expectedTokens===void 0||e.actualTokens===void 0))return{source:e.source,expectedTokens:e.expectedTokens,actualTokens:e.actualTokens}}).filter(e=>e!==void 0)}a(Wsc,"componentStatisticsToPromptMatcher")});var PBe=I(kBe=>{"use strict";p();Object.defineProperty(kBe,"__esModule",{value:!0});kBe.filterContextItemsByType=Jsc;kBe.filterSupportedContextItems=Zsc;kBe.addOrValidateContextItemsIDs=eac;var zsc=Qg(),Ysc=hd(),PDr=Og(),Ksc=WLe(),DDr=Gl(),RBe;(function(t){function e(r){return!(r.importance!==void 0&&(typeof r.importance!="number"||!Number.isInteger(r.importance)||r.importance<0||r.importance>100)||r.id!==void 0&&typeof r.id!="string"||r.origin!==void 0&&!Ksc.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})(RBe||(RBe={}));var NDr;(function(t){function e(r){if(!RBe.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(NDr||(NDr={}));var MDr;(function(t){function e(r){if(!RBe.is(r))return!1;let n=r;if(typeof n.uri!="string"||typeof n.value!="string")return!1;if(n.additionalUris===void 0)return!0;if(!Array.isArray(n.additionalUris))return!1;for(let o of n.additionalUris)if(typeof o!="string")return!1;return!0}a(e,"is"),t.is=e})(MDr||(MDr={}));var ODr;(function(t){function e(r){if(!RBe.is(r))return!1;let n=r;if(!Ysc.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof zsc.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(ODr||(ODr={}));var LDr;(function(t){function e(r){if(NDr.is(r))return"Trait";if(MDr.is(r))return"CodeSnippet";if(ODr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(LDr||(LDr={}));function Jsc(t,e){return t.map(r=>{let n=r.data.filter(o=>o.type===e);return n.length>0?{...r,data:n}:void 0}).filter(r=>r!==void 0)}a(Jsc,"filterContextItemsByType");function Zsc(t){let e=[],r=0;return t.forEach(n=>{let o=LDr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(Zsc,"filterSupportedContextItems");function Xsc(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(Xsc,"validateContextItemId");function eac(t,e){let r=new Set,n=t.get(DDr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,PDr.generateUuid)();if(!Xsc(c)){let l=(0,PDr.generateUuid)();DDr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,PDr.generateUuid)();DDr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(eac,"addOrValidateContextItemsIDs")});var BDr=I(Rvt=>{"use strict";p();Object.defineProperty(Rvt,"__esModule",{value:!0});Rvt.getCodeSnippetsFromContextItems=oac;Rvt.addRelativePathToCodeSnippets=sac;var tac=RS(),rac=yV(),nac=PBe(),iac="content_excluded";async function oac(t,e,r,n){let o=(0,nac.filterContextItemsByType)(r,"CodeSnippet");if(o.length===0)return[];let s=new Set,c=o.flatMap(h=>h.data.map(m=>(s.add(m.uri),m.additionalUris?.forEach(g=>s.add(g)),{providerId:h.providerId,data:m}))),l=t.get(rac.ICompletionsContextProviderService),u=t.get(tac.ICompletionsTextDocumentManagerService),d=new Map;await Promise.all(Array.from(s).map(async h=>{d.set(h,await u.getTextDocumentValidation({uri:h}))}));let f=l.getStatisticsForCompletion(e);return c.filter(h=>{let g=[h.data.uri,...h.data.additionalUris??[]].every(A=>d.get(A)?.status==="valid");return g?f.addExpectations(h.providerId,[[h.data,"included"]]):f.addExpectations(h.providerId,[[h.data,iac]]),g}).map(h=>h.data)}a(oac,"getCodeSnippetsFromContextItems");function sac(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(sac,"addRelativePathToCodeSnippets")});var FDr=I(Dvt=>{"use strict";p();Object.defineProperty(Dvt,"__esModule",{value:!0});Dvt.CodeSnippets=void 0;var kvt=LL(),Pvt=pU(),aac=mU(),cac=BDr(),lac=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(aac.isCompletionRequestData,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=(0,cac.addRelativePathToCodeSnippets)(t.tdms,r),l=new Map;for(let d of c){let f=d.relativePath??d.snippet.uri,h=l.get(f);h===void 0&&(h=[],l.set(f,h)),h.push(d)}let u=[];for(let[d,f]of l.entries()){let h=f.filter(m=>m.snippet.value.length>0);h.length>0&&u.push({chunkElements:h.map(m=>m.snippet),importance:Math.max(...h.map(m=>m.snippet.importance??0)),uri:d})}if(u.length!==0)return u.sort((d,f)=>f.importance-d.importance),u.reverse(),u.map(d=>{let f=[];return f.push((0,kvt.jsx)(Pvt.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,kvt.jsx)(Pvt.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(s_e,"__esModule",{value:!0});s_e.CompletionsContext=RFi;s_e.StableCompletionsContext=kFi;s_e.AdditionalCompletionsContext=PFi;s_e.isContextNode=uac;function RFi(t){return t.children}a(RFi,"CompletionsContext");function kFi(t){return t.children}a(kFi,"StableCompletionsContext");function PFi(t){return t.children}a(PFi,"AdditionalCompletionsContext");function uac(t){return t.name===RFi.name||t.name===kFi.name||t.name===PFi.name}a(uac,"isContextNode")});var QDr=I(NBe=>{"use strict";p();Object.defineProperty(NBe,"__esModule",{value:!0});NBe.SnapshotWalker=void 0;NBe.defaultTransformers=DFi;var dac=pU(),UDr=class{static{a(this,"SnapshotWalker")}constructor(e,r=DFi()){this.snapshot=e,this.transformers=r}walkSnapshot(e){this.walkSnapshotNode(this.snapshot,void 0,e,{})}walkSnapshotNode(e,r,n,o){let s=this.transformers.reduce((l,u)=>u(e,r,l),{...o});if(n(e,r,s))for(let l of e.children??[])this.walkSnapshotNode(l,e,n,s)}};NBe.SnapshotWalker=UDr;function DFi(){return[(t,e,r)=>{r.weight===void 0&&(r.weight=1);let n=t.props?.weight??1,o=typeof n=="number"?Math.max(0,Math.min(1,n)):1;return{...r,weight:o*r.weight}},(t,e,r)=>{if(t.name===dac.Chunk.name){let n=r.chunks?new Set(r.chunks):new Set;return n.add(t.path),{...r,chunks:n}}return r},(t,e,r)=>t.props?.source!==void 0?{...r,source:t.props.source}:r]}a(DFi,"defaultTransformers")});var NFi=I(qDr=>{"use strict";p();Object.defineProperty(qDr,"__esModule",{value:!0});qDr.findEditDistanceScore=fac;function fac(t,e){if(t.length===0||e.length===0)return{score:t.length+e.length};let r=Array.from({length:t.length}).map(()=>Array.from({length:e.length}).map(()=>0));for(let n=0;n{"use strict";p();Object.defineProperty(pN,"__esModule",{value:!0});pN.MAX_EDIT_DISTANCE_LENGTH=void 0;pN.CurrentFile=gac;pN.BeforeCursor=GDr;pN.AfterCursor=$Dr;pN.DocumentPrefix=Aac;pN.DocumentSuffix=yac;var fk=LL(),a_e=pU(),pac=z$(),hac=NFi(),mac=Rne(),jDr=mU();pN.MAX_EDIT_DISTANCE_LENGTH=50;function HDr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(HDr,"approximateMaxCharacters");function gac(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(jDr.isCompletionRequestData,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=HDr(c);return(0,fk.jsxs)(fk.Fragment,{children:[(0,fk.jsx)(GDr,{document:r,position:o,maxCharacters:m}),(0,fk.jsx)($Dr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(gac,"CurrentFile");function GDr(t){if(t.document===void 0||t.position===void 0)return(0,fk.jsx)(a_e.Text,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),(0,fk.jsx)(a_e.Text,{children:e})}a(GDr,"BeforeCursor");function $Dr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,fk.jsx)(a_e.Text,{});let o=t.document.getText({start:t.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}});o.length>t.maxCharacters&&(o=o.slice(0,t.maxCharacters));let s=o.replace(/^.*/,"").trimStart();if(s==="")return(0,fk.jsx)(a_e.Text,{});if(r===s)return(0,fk.jsx)(a_e.Text,{children:r});let c=s;if(r!==""){let l=(0,mac.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,pN.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,pN.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,hac.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??pac.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,fk.jsx)(a_e.Text,{children:c})}a($Dr,"AfterCursor");function Aac(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(jDr.isCompletionRequestData,d=>{let f=d.document;(d.document.uri!==r?.uri||f.getText()!==r?.getText())&&n(f),d.position!==o&&s(d.position),d.maxPromptTokens!==c&&l(d.maxPromptTokens)});let u=HDr(c);return(0,fk.jsx)(GDr,{document:r,position:o,maxCharacters:u})}a(Aac,"DocumentPrefix");function yac(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(jDr.isCompletionRequestData,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=HDr(c);return(0,fk.jsx)($Dr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(yac,"DocumentSuffix")});var WDr=I(Yne=>{"use strict";p();Object.defineProperty(Yne,"__esModule",{value:!0});Yne.WishlistElision=void 0;Yne.makePrompt=_ac;Yne.makePrefixPrompt=Eac;Yne.makeContextPrompt=vac;var VDr=class{static{a(this,"WishlistElision")}elide(e,r,n,o,s){if(r<=0)throw new Error("Prefix limit must be greater than 0");let[c,l]=this.preparePrefixBlocks(e,s),{elidedSuffix:u,adjustedPrefixTokenLimit:d}=this.elideSuffix(n,o,r,l,s),f=this.elidePrefix(c,d,l,s);return{blocks:[u,...f],cycles:1}}preparePrefixBlocks(e,r){let n=0,o=new Set;return[e.map((c,l)=>{let u=0,f=c.value.split(/([^\n]*\n+)/).filter(m=>m!=="").map(m=>{let g=r.tokenLength(m);return u+=g,n+=g,{line:m,componentPath:c.componentPath,tokens:g}}),h=c.componentPath;if(o.has(h))throw new Error(`Duplicate component path in prefix blocks: ${h}`);return o.add(h),{...c,tokens:u,markedForRemoval:!1,originalIndex:l,lines:f}}),n]}elideSuffix(e,r,n,o,s){let c=e.value;if(c.length===0||r<=0)return{elidedSuffix:{...e,tokens:0,elidedValue:"",elidedTokens:0},adjustedPrefixTokenLimit:n+Math.max(0,r)};o!f.markedForRemoval).flatMap(f=>f.lines);if(c.length===0)return[];let[l,u]=this.trimPrefixLinesToFit(c,r,o),d=u;return s.map(f=>{if(f.markedForRemoval)return d+f.tokens<=r&&!f.chunks?(d+=f.tokens,{...f,elidedValue:f.value,elidedTokens:f.tokens}):{...f,elidedValue:"",elidedTokens:0};let h=l.filter(g=>g.componentPath===f.componentPath&&g.line!=="").map(g=>g.line).join(""),m=f.tokens;return h!==f.value&&(m=h!==""?o.tokenLength(h):0),{...f,elidedValue:h,elidedTokens:m}})}removeLowWeightPrefixBlocks(e,r,n){let o=n;e.sort((s,c)=>s.weight-c.weight);for(let s of e){if(o<=r)break;if(s.weight!==1&&!(s.chunks&&s.markedForRemoval))if(s.chunks&&s.chunks.size>0)for(let c of e)!c.markedForRemoval&&c.chunks&&[...s.chunks].every(l=>c.chunks?.has(l))&&(c.markedForRemoval=!0,o-=c.tokens);else s.markedForRemoval=!0,o-=s.tokens}return e.sort((s,c)=>s.originalIndex-c.originalIndex)}trimPrefixLinesToFit(e,r,n){let o=0,s=[];for(let c=e.length-1;c>=0;c--){let l=e[c],u=l.tokens;if(o+u<=r)s.unshift(l),o+=u;else break}if(s.length===0){let c=e[e.length-1];if(c&&c.line.length>0){let u=n.takeLastTokens(c.line,r);return s.push({line:u.text,componentPath:c.componentPath,tokens:u.tokens.length}),[s,u.tokens.length]}let l=`Cannot fit prefix within limit of ${r} tokens`;throw new Error(l)}return[s,o]}};Yne.WishlistElision=VDr;function _ac(t){return t.map(e=>e.elidedValue).join("")}a(_ac,"makePrompt");function Eac(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(Eac,"makePrefixPrompt");function vac(t){if(t.length===0)return[];let e=new Map;for(let o of t)if(o.type==="context"&&o.index!==void 0){e.has(o.index)||e.set(o.index,[]);let s=o.elidedValue.trim();s.length>0&&e.get(o.index).push(s)}let r=Math.max(...Array.from(e.keys()),-1),n=[];for(let o=0;o<=r;o++){let s=e.get(o);if(s&&s.length>0){let c=s.join(` -`).trim();n.push(c)}else n.push("")}return n}a(vac,"makeContextPrompt")});var KDr=I(_V=>{"use strict";p();Object.defineProperty(_V,"__esModule",{value:!0});_V.transformers=_V.CompletionsPromptRenderer=void 0;_V.normalizeLineEndings=YDr;var BFi=QDr(),MFi=yBe(),OFi=Rne(),Cac=DBe(),Nvt=MBe(),LFi=WDr(),bac=5,zDr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=LFi.makePrompt}render(e,r,n){let o=this.renderId++,s=performance.now();try{if(n?.isCancellationRequested)return{status:"cancelled"};let c=r.delimiter??"",l=r.tokenizer??OFi.TokenizerName.o200k,{prefixBlocks:u,suffixBlock:d,componentStatistics:f}=this.processSnapshot(e,c,r.languageId),{prefixTokenLimit:h,suffixTokenLimit:m}=this.getPromptLimits(d,r),g=performance.now(),A=new LFi.WishlistElision,{blocks:[y,..._]}=A.elide(u,h,d,m,(0,OFi.getTokenizer)(l)),E=performance.now(),v=this.formatPrefix(_),S=this.formatContext?this.formatContext(_):void 0,T=y.elidedValue,w=_.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...Sac([..._,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:S,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:E-g,renderTimeMs:performance.now()-s,componentStatistics:f,updateDataTimeMs:f.reduce((R,x)=>R+(x.updateDataTimeMs??0),0)}}}catch(c){return{status:"error",error:c}}}getPromptLimits(e,r){let n=e?.value??"",o=r.promptTokenLimit,s=r.suffixPercent;if(n.length===0||s===0)return{prefixTokenLimit:o,suffixTokenLimit:0};o=n.length>0?o-bac:o;let c=Math.ceil(o*(s/100));return{prefixTokenLimit:o-c,suffixTokenLimit:c}}processSnapshot(e,r,n){let o=[],s=[],c=[],l=!1;if(new BFi.SnapshotWalker(e,_V.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===Nvt.CurrentFile.name&&(l=!0),f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.value===void 0||f.value===""))return!0;let g=m.chunks;if(m.type==="suffix")s.push({value:YDr(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let A=f.value.endsWith(r)?f.value:f.value+r,y=A;m.type==="prefix"?y=f.value:(0,MFi.isShebangLine)(f.value)?y=A:y=(0,MFi.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:YDr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${Nvt.CurrentFile.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}};_V.CompletionsPromptRenderer=zDr;_V.transformers=[...(0,BFi.defaultTransformers)(),(t,e,r)=>(0,Cac.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===Nvt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===Nvt.AfterCursor.name?{...r,type:"suffix"}:r];function Sac(t){return t.map(e=>{let r={componentPath:e.componentPath};return e.tokens!==0&&(r.expectedTokens=e.tokens,r.actualTokens=e.elidedTokens),e.nodeStatistics.updateDataTimeMs!==void 0&&(r.updateDataTimeMs=e.nodeStatistics.updateDataTimeMs),e.source&&(r.source=e.source),r})}a(Sac,"computeComponentStatistics");function YDr(t){return t.replace(/\r\n?/g,` -`)}a(YDr,"normalizeLineEndings")});var Mvt=I(c_e=>{"use strict";p();Object.defineProperty(c_e,"__esModule",{value:!0});c_e.ILanguageContextProviderService=c_e.ProviderTarget=void 0;var Tac=an(),FFi;(function(t){t.NES="nes",t.Completions="completions"})(FFi||(c_e.ProviderTarget=FFi={}));c_e.ILanguageContextProviderService=(0,Tac.createServiceIdentifier)("ILanguageContextProviderService")});var Kne=I(l_e=>{"use strict";p();Object.defineProperty(l_e,"__esModule",{value:!0});l_e.RuntimeMode=l_e.ICompletionsRuntimeModeService=void 0;var Iac=an();l_e.ICompletionsRuntimeModeService=(0,Iac.createServiceIdentifier)("completionsRuntimeModeService");var JDr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:UFi(r,n),verboseLogging:wac(r,n),testMode:e,simulation:xac(n)})}isRunningInTest(){return this.flags.testMode}shouldFailForDebugPurposes(){return this.isRunningInTest()}isDebugEnabled(){return this.flags.debug}isVerboseLoggingEnabled(){return this.flags.verboseLogging}isRunningInSimulation(){return this.flags.simulation}};l_e.RuntimeMode=JDr;function UFi(t,e){return t.includes("--debug")||ZDr(e,"DEBUG")}a(UFi,"determineDebugFlag");function xac(t){return ZDr(t,"SIMULATION")}a(xac,"determineSimulationFlag");function wac(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||ZDr(e,"VERBOSE")||UFi(t,e)}a(wac,"determineVerboseLoggingEnabled");function ZDr(t,e){for(let r of["GH_COPILOT_","GITHUB_COPILOT_"]){let n=t[`${r}${e}`];if(n)return n==="1"||n?.toLowerCase()==="true"}return!1}a(ZDr,"determineEnvFlagEnabled")});var HFi=I(OBe=>{"use strict";p();Object.defineProperty(OBe,"__esModule",{value:!0});OBe.eventToPromise=Rac;OBe.isArrayOfT=jFi;OBe.resolveAll=Pac;var QFi=sBe();async function Rac(t){let e=new QFi.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(Rac,"eventToPromise");async function kac(t){if(t.isCancellationRequested)return;let e=new QFi.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(kac,"cancellationTokenToPromise");async function qFi(t,e){if(e){let r=kac(e);await Promise.race([t,r])}else await t}a(qFi,"raceCancellation");function jFi(t){return Array.isArray(t)}a(jFi,"isArrayOfT");async function Pac(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await Dac(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(Pac,"resolveAll");async function Dac(t,e){let r;return t instanceof Promise?r=await Nac(t,e):r=await Mac(t,e),r}a(Dac,"resolve");async function Nac(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{let s=await t;if(e?.isCancellationRequested)return;n={status:"full",resolutionTime:0,value:jFi(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await qFi(o,e),n.resolutionTime=performance.now()-r,n}a(Nac,"resolvePromise");async function Mac(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{for await(let s of t){if(e?.isCancellationRequested)return;n.status!=="partial"&&(n={status:"partial",resolutionTime:0,value:[]}),n.value.push(s)}e?.isCancellationRequested||(n.status!=="partial"?n={status:"full",resolutionTime:0,value:[]}:n.status="full")}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await qFi(o,e),n.resolutionTime=performance.now()-r,n}a(Mac,"resolveIterable")});var GFi=I(eNr=>{"use strict";p();Object.defineProperty(eNr,"__esModule",{value:!0});eNr.fillInCppVSCodeActiveExperiments=Fac;var Oac=xy(),XDr=Gl(),Lac={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},Bac="ms-vscode.cpptools";function Fac(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Bac))&&Uac(t,r,n)}a(Fac,"fillInCppVSCodeActiveExperiments");function Uac(t,e,r){try{let n=t.get(Oac.ICompletionsFeaturesService),o=t.get(XDr.ICompletionsLogTargetService),s=Lac,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){XDr.logger.error(o,"Failed to parse cppContextProviderParams",l)}else{let l=n.getContextProviderExpSettings("cpp")?.params;l&&(s={...l})}for(let[l,u]of Object.entries(s))e.set(l,u)}catch(n){XDr.logger.exception(t,n,"fillInCppActiveExperiments")}}a(Uac,"addActiveExperiments")});var VFi=I(tNr=>{"use strict";p();Object.defineProperty(tNr,"__esModule",{value:!0});tNr.fillInCSharpActiveExperiments=qac;var Qac=xy(),$Fi=Gl();function qac(t,e,r){let n=t.get(Qac.ICompletionsFeaturesService),o=t.get($Fi.ICompletionsLogTargetService);try{let s=n.csharpContextProviderParams(r);if(s){let c=JSON.parse(s);for(let[l,u]of Object.entries(c))e.set(l,u)}else{let c=n.getContextProviderExpSettings("csharp")?.params;if(c)for(let[l,u]of Object.entries(c))e.set(l,u)}}catch(s){return $Fi.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a(qac,"fillInCSharpActiveExperiments")});var WFi=I(EV=>{"use strict";p();Object.defineProperty(EV,"__esModule",{value:!0});EV.multiLanguageContextProviderParamsDefault=void 0;EV.fillInMultiLanguageActiveExperiments=Gac;EV.getMultiLanguageContextProviderParamsFromActiveExperiments=Wac;var jac=xy(),rNr=Gl(),Hac="fallbackContextProvider";EV.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function Gac(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Hac))&&$ac(t,r,n)}a(Gac,"fillInMultiLanguageActiveExperiments");function $ac(t,e,r){try{let n=Vac(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){rNr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a($ac,"addActiveExperiments");function Vac(t,e){let r=EV.multiLanguageContextProviderParamsDefault,n=t.get(rNr.ICompletionsLogTargetService),s=t.get(jac.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){rNr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(Vac,"getMultiLanguageContextProviderParamsFromExp");function Wac(t){let e={...EV.multiLanguageContextProviderParamsDefault};return t.has("mlcpMaxContextItems")&&(e.mlcpMaxContextItems=Number(t.get("mlcpMaxContextItems"))),t.has("mlcpMaxSymbolMatches")&&(e.mlcpMaxSymbolMatches=Number(t.get("mlcpMaxSymbolMatches"))),t.has("mlcpEnableImports")&&(e.mlcpEnableImports=String(t.get("mlcpEnableImports"))==="true"),e}a(Wac,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var YFi=I(u_e=>{"use strict";p();Object.defineProperty(u_e,"__esModule",{value:!0});u_e.TS_CONTEXT_PROVIDER_ID=void 0;u_e.fillInTsActiveExperiments=Yac;var zac=xy(),zFi=Gl();u_e.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function Yac(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(u_e.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(zFi.ICompletionsLogTargetService),s=t.get(zac.ICompletionsFeaturesService);try{let c=s.tsContextProviderParams(n);if(c){let l=JSON.parse(c);for(let[u,d]of Object.entries(l))r.set(u,d)}else{let l=s.getContextProviderExpSettings("typescript")?.params;if(l)for(let[u,d]of Object.entries(l))r.set(u,d)}}catch(c){return zFi.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(Yac,"fillInTsActiveExperiments")});var Bvt=I($l=>{"use strict";p();var aNr=$l&&$l.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},hN=$l&&$l.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty($l,"__esModule",{value:!0});$l.DefaultDiagnosticSettings=$l.CachedContextProviderRegistry=$l.MutableContextProviderRegistry=$l.CoreContextProviderRegistry=$l.DefaultContextProvidersContainer=$l.ICompletionsDefaultContextProviders=$l.ICompletionsContextProviderRegistryService=void 0;$l.telemetrizeContextItems=icc;$l.matchContextItems=occ;$l.useContextProviderAPI=acc;$l.getDefaultDiagnosticSettings=lcc;var Kac=ii(),KFi=Hl(),cNr=Mvt(),Jac=Rh(),XFi=an(),Zac=Os(),lNr=Ks(),Ovt=eE(),e8i=xy(),Xac=aU(),gU=Gl(),uNr=Kne(),JFi=HFi(),ecc=GFi(),tcc=VFi(),rcc=WFi(),ncc=YFi(),ZFi=PBe(),t8i=yV();$l.ICompletionsContextProviderRegistryService=(0,XFi.createServiceIdentifier)("ICompletionsContextProviderRegistryService");$l.ICompletionsDefaultContextProviders=(0,XFi.createServiceIdentifier)("ICompletionsDefaultContextProviders");var nNr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};$l.DefaultContextProvidersContainer=nNr;var Lvt=class{static{a(this,"CoreContextProviderRegistry")}constructor(e,r,n,o,s,c){this.match=e,this.registryService=r,this.runtimeMode=n,this.instantiationService=o,this.logTarget=s,this.contextProviderStatistics=c}registerContextProvider(e){throw new Error("Should not be call. Use ILanguageContextProviderService")}unregisterContextProvider(e){throw new Error("Should not be call. Use ILanguageContextProviderService")}get providers(){return this.registryService.getAllProviders([cNr.ProviderTarget.Completions]).slice()}async resolveAllProviders(e,r,n,o,s,c){if(s?.isCancellationRequested)return gU.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction(tcc.fillInCSharpActiveExperiments,l,o);let u=[],d=this.providers;if(d.length===0)return u;let f=await this.matchProviders(d,n,o),h=f.filter(w=>w[1]>0);if(f.filter(w=>w[1]<=0).forEach(([w,R])=>{let x={providerId:w.id,matchScore:R,resolution:"none",resolutionTimeMs:0,data:[]};u.push(x)}),h.length===0)return u;if(s?.isCancellationRequested)return gU.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(ecc.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(rcc.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(ncc.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new Kac.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(ccc,n.languageId,o),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,_;A>0&&(_=setTimeout(()=>{g.cancel(),g.dispose()},A));let E=new Map,v={completionId:e,opportunityId:r,documentContext:n,activeExperiments:l,timeBudget:A,timeoutEnd:y,data:c};for(let[w]of h){let R=this.contextProviderStatistics.getPreviousStatisticsForCompletion(e)?.get(w.id);R&&(v.previousUsageStatistics=R);let x=w.resolver.resolve(v,g.token);E.set(w.id,x)}let S=this.contextProviderStatistics.getStatisticsForCompletion(e);S.setOpportunityId(r);let T=await(0,JFi.resolveAll)(E,g.token);_&&clearTimeout(_);for(let[w,R]of h){let x=T.get(w.id);if(x){if(x.status==="error")(0,Zac.isCancellationError)(x.reason)||gU.logger.error(this.logTarget,`Error resolving context from ${w.id}: `,x.reason),u.push({providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:[]});else{let k=[...x.value??[]];if((x.status==="none"||x.status==="partial")&&(gU.logger.info(this.logTarget,`Context provider ${w.id} exceeded time budget of ${A}ms`),w.resolver.resolveOnTimeout))try{let q=w.resolver.resolveOnTimeout(v);(0,JFi.isArrayOfT)(q)?k.push(...q):q&&k.push(q),k.length>0&&(x.status="partial")}catch(q){gU.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,q)}let[D,N]=(0,ZFi.filterSupportedContextItems)(k);N&&gU.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let O=this.instantiationService.invokeFunction(ZFi.addOrValidateContextItemsIDs,D),B={providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:O};u.push(B)}S.setLastResolution(w.id,x.status)}else gU.logger.error(this.logTarget,`Context provider ${w.id} not found in results`)}return u.sort((w,R)=>R.matchScore-w.matchScore)}async matchProviders(e,r,n){let o=this.instantiationService.invokeFunction(r8i,r.languageId,n),s=o.length===1&&o[0]==="*";return await Promise.all(e.map(async l=>{if(!s&&!o.includes(l.id))return[l,0];let u=await this.match(this.instantiationService,l.selector,r);return[l,u]}))}};$l.CoreContextProviderRegistry=Lvt;$l.CoreContextProviderRegistry=Lvt=aNr([hN(1,cNr.ILanguageContextProviderService),hN(2,uNr.ICompletionsRuntimeModeService),hN(3,lNr.IInstantiationService),hN(4,gU.ICompletionsLogTargetService),hN(5,t8i.ICompletionsContextProviderService)],Lvt);var iNr=class extends Lvt{static{a(this,"MutableContextProviderRegistry")}constructor(e,r,n,o,s,c){super(e,r,n,o,s,c),this._providers=[]}registerContextProvider(e){if(e.id.includes(",")||e.id.includes("*"))throw new Error(`A context provider id cannot contain a comma or an asterisk. The id ${e.id} is invalid.`);if(this._providers.find(r=>r.id===e.id))throw new Error(`A context provider with id ${e.id} has already been registered`);this._providers.push(e)}unregisterContextProvider(e){this._providers=this._providers.filter(r=>r.id!==e)}get providers(){return this._providers.slice().concat(super.providers)}};$l.MutableContextProviderRegistry=iNr;$l.MutableContextProviderRegistry=iNr=aNr([hN(1,cNr.ILanguageContextProviderService),hN(2,uNr.ICompletionsRuntimeModeService),hN(3,lNr.IInstantiationService),hN(4,gU.ICompletionsLogTargetService),hN(5,t8i.ICompletionsContextProviderService)],iNr);var oNr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new Xac.LRUCacheMap(5),this.delegate=n.createInstance(e,r)}registerContextProvider(e){this.delegate.registerContextProvider(e)}unregisterContextProvider(e){this.delegate.unregisterContextProvider(e)}get providers(){return this.delegate.providers}async resolveAllProviders(e,r,n,o,s,c){let l=this._cachedContextItems.get(e);if(e&&l&&l.length>0)return l;let u=await this.delegate.resolveAllProviders(e,r,n,o,s,c);return u.length>0&&e&&this._cachedContextItems.set(e,u),u}};$l.CachedContextProviderRegistry=oNr;$l.CachedContextProviderRegistry=oNr=aNr([hN(2,lNr.IInstantiationService)],oNr);function icc(t,e,r){let n=t.getStatisticsForCompletion(e);return r.map(s=>{let{providerId:c,resolution:l,resolutionTimeMs:u,matchScore:d,data:f}=s,h=n.get(c),m=h?.usage??"none";(d<=0||l==="none"||l==="error")&&(m="none");let g={providerId:c,resolution:l,resolutionTimeMs:u,usage:m,usageDetails:h?.usageDetails,matched:d>0,numResolvedItems:f.length},A=h?.usageDetails!==void 0?h?.usageDetails.filter(_=>_.usage==="full"||_.usage==="partial"||_.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(_=>_.usage==="partial"||_.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(icc,"telemetrizeContextItems");function occ(t){return t.matchScore>0&&t.resolution!=="error"}a(occ,"matchContextItems");function r8i(t,e,r){let n=scc(t,e,r),o=(0,Ovt.getConfig)(t,Ovt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get($l.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(r8i,"getActiveContextProviders");function scc(t,e,r){if(t.get(uNr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(e8i.ICompletionsFeaturesService),o=n.contextProviders(r),s=n.getContextProviderExpSettings(e);if(s!==void 0)for(let c of s.ids)o.includes(c)||o.push(c);return o}a(scc,"getExpContextProviders");function acc(t,e,r){return r8i(t,e,r).length>0}a(acc,"useContextProviderAPI");function ccc(t,e,r){let n=(0,Ovt.getConfig)(t,Ovt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(e8i.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(ccc,"getContextProviderTimeBudget");var sNr;(function(t){function e(n){if(n)try{let o=JSON.parse(n);if(o.warnings===void 0&&o.maxDiagnostics===void 0&&o.maxLineDistance===void 0)return;let s=r(o),c=typeof o.maxLineDistance=="number"&&o.maxLineDistance>=0?o.maxLineDistance:10,l=typeof o.maxDiagnostics=="number"&&o.maxDiagnostics>0?o.maxDiagnostics:5;return{warnings:s,maxLineDistance:c,maxDiagnostics:l}}catch{return}}a(e,"from"),t.from=e;function r(n){let o=n?.warnings;return o==="yes"||o==="no"||o==="yesIfNoErrors"?o:"no"}a(r,"getWarnings")})(sNr||($l.DefaultDiagnosticSettings=sNr={}));function lcc(t){let e=t.get(KFi.IConfigurationService),r=t.get(Jac.IExperimentationService),n=e.getExperimentBasedConfig(KFi.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return sNr.from(n)}a(lcc,"getDefaultDiagnosticSettings")});var Fvt=I(mN=>{"use strict";p();var ucc=mN&&mN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},dcc=mN&&mN.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(mN,"__esModule",{value:!0});mN.ContextProviderBridge=mN.ICompletionsContextProviderBridgeService=void 0;var fcc=an(),pcc=aU(),hcc=Bvt();mN.ICompletionsContextProviderBridgeService=(0,fcc.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var dNr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new pcc.LRUCacheMap(25)}schedule(e,r,n,o,s,c){let{textDocument:l,originalPosition:u,originalOffset:d,originalVersion:f,editsWithPosition:h}=e,m=this.contextProviderRegistry.resolveAllProviders(r,n,{uri:l.uri,languageId:l.detectedLanguageId,version:f,offset:d,position:u,proposedEdits:h.length>0?h:void 0},o,s,c?.data);this.scheduledResolutions.set(r,m)}async resolution(e){let r=this.scheduledResolutions.get(e);return r?await r:[]}};mN.ContextProviderBridge=dNr;mN.ContextProviderBridge=dNr=ucc([dcc(0,hcc.ICompletionsContextProviderRegistryService)],dNr)});var hNr=I(Uvt=>{"use strict";p();Object.defineProperty(Uvt,"__esModule",{value:!0});Uvt.Diagnostics=void 0;var fNr=LL(),mcc=Qg(),pNr=pU(),gcc=z$(),Acc=mU();function ycc(t){if(t.code!==void 0){if(typeof t.code=="string")return t.code;if(typeof t.code=="number")return t.code.toString();if(typeof t.code=="object"&&t.code!==null&&t.code.value)return t.code.value.toString()}}a(ycc,"getCode");function _cc(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a(_cc,"getRelativePath");var Ecc=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(Acc.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,gcc.normalizeLanguageId)(h.document.detectedLanguageId);m!==o&&s(m),h.position!==c&&l(h.position),h.document.uri!==u?.uri&&d(h.document)}),!r||r.length===0||!o)return;let f=r.filter(h=>h.values.length>0);if(f.length!==0)return f.sort((h,m)=>(m.importance??0)-(h.importance??0)),f.reverse(),f.map(h=>{let m=[];m.push((0,fNr.jsx)(pNr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${_cc(t.tdms,h)}:`},h.id));let g=h.values;return u!==void 0&&u.uri.toString()===h.uri.toString()&&c!==void 0&&(g=h.values.slice(),g.sort((A,y)=>{let _=Math.abs(A.range.start.line-c.line),E=Math.abs(y.range.start.line-c.line);return _-E})),g.forEach(A=>{let y="",_=ycc(A);_!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${_}`);let E=A.range.start;m.push((0,fNr.jsx)(pNr.Text,{children:`${E.line+1}:${E.character+1} - ${mcc.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,fNr.jsx)(pNr.Chunk,{children:m})})},"Diagnostics");Uvt.Diagnostics=Ecc});var mNr=I(qvt=>{"use strict";p();Object.defineProperty(qvt,"__esModule",{value:!0});qvt.DocumentMarker=void 0;var Qvt=LL(),n8i=pU(),i8i=yBe(),vcc=mU(),Ccc=a((t,e)=>{let[r,n]=e.useState();if(e.useData(vcc.isCompletionRequestData,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.tdms.getRelativePath(r),s={uri:r.uri,source:r.getText(),relativePath:o,languageId:r.detectedLanguageId},c=t.tdms.findNotebook(r);return s.relativePath&&!c?(0,Qvt.jsx)(bcc,{docInfo:s}):(0,Qvt.jsx)(Scc,{docInfo:s})}},"DocumentMarker");qvt.DocumentMarker=Ccc;var bcc=a(t=>(0,Qvt.jsx)(n8i.Text,{children:(0,i8i.getPathMarker)(t.docInfo)}),"PathMarker"),Scc=a(t=>(0,Qvt.jsx)(n8i.Text,{children:(0,i8i.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var gNr=I(LBe=>{"use strict";p();Object.defineProperty(LBe,"__esModule",{value:!0});LBe.RecentEdits=void 0;LBe.editIsTooCloseToCursor=a8i;var o8i=LL(),s8i=pU(),jvt=yBe(),Tcc=mU();function a8i(t,e=!1,r=void 0,n){if(e&&(r===void 0||n===void 0))throw new Error("cursorLine and activeDocDistanceLimitFromCursor are required when filterByCursorLine is true");let o=t.startLine-1,s=t.endLine-1;return!!(e&&(Math.abs(o-r)<=n||Math.abs(s-r)<=n))}a(a8i,"editIsTooCloseToCursor");var Icc=a((t,e)=>{let[r,n]=e.useState();return e.useData(Tcc.isCompletionRequestData,async o=>{if(!o.document)return;let s=t.recentEditsProvider;if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.tdms,f=[];for(let m=l.length-1;m>=0&&!(f.length>=c.maxEdits);m--){let g=l[m];if(!await d.getTextDocument({uri:g.file}))continue;let A=!u.has(g.file);if(u.size+(A?1:0)>c.maxFiles)break;let _=g.file===o.document?.uri,E=_?o.position.line:void 0;if(a8i(g,_,E,c.activeDocDistanceLimitFromCursor))continue;let S=s.getEditSummary(g);if(S){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift((0,jvt.newLineEnded)(`File: ${T}`)+(0,jvt.newLineEnded)(S))}}if(f.length===0){n(void 0);return}let h=(0,jvt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,jvt.newLineEnded)("End of recent edits");n(h)}),r?(0,o8i.jsx)(s8i.Chunk,{children:(0,o8i.jsx)(s8i.Text,{children:r})}):void 0},"RecentEdits");LBe.RecentEdits=Icc});var c8i=I(QL=>{"use strict";p();Object.defineProperty(QL,"__esModule",{value:!0});QL.registerDocumentTracker=QL.accessTimes=void 0;QL.sortByAccessTimes=Rcc;var xcc=aU(),wcc=RS();QL.accessTimes=new xcc.LRUCacheMap;function Rcc(t){return[...t].sort((e,r)=>{let n=QL.accessTimes.get(e.uri)??0;return(QL.accessTimes.get(r.uri)??0)-n})}a(Rcc,"sortByAccessTimes");var kcc=a(t=>t.get(wcc.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&QL.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");QL.registerDocumentTracker=kcc});var l8i=I(AU=>{"use strict";p();var Pcc=AU&&AU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Dcc=AU&&AU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(AU,"__esModule",{value:!0});AU.OpenTabFiles=void 0;var Ncc=c8i(),Mcc=RS(),ANr=d_e(),yNr=class{static{a(this,"OpenTabFiles")}constructor(e){this.docManager=e}truncateDocs(e,r,n,o){let s=new Map,c=0;for(let l of e)if(!(c+l.getText().length>ANr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,ANr.considerNeighborFile)(n,l.detectedLanguageId)&&(s.set(l.uri.toString(),{uri:l.uri.toString(),relativePath:this.docManager.getRelativePath(l),source:l.getText()}),c+=l.getText().length),s.size>=o))break;return s}async getNeighborFiles(e,r,n){let o=new Map,s=new Map;return o=this.truncateDocs((0,Ncc.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(ANr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};AU.OpenTabFiles=yNr;AU.OpenTabFiles=yNr=Pcc([Dcc(0,Mcc.ICompletionsTextDocumentManagerService)],yNr)});var u8i=I(_Nr=>{"use strict";p();Object.defineProperty(_Nr,"__esModule",{value:!0});_Nr.shortCircuit=Occ;function Occ(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(Occ,"shortCircuit")});var zvt=I(Vl=>{"use strict";p();var Lcc=Vl&&Vl.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Hvt=Vl&&Vl.__param||function(t,e){return function(r,n){e(r,n,t)}},ENr;Object.defineProperty(Vl,"__esModule",{value:!0});Vl.RelatedFilesProvider=Vl.ICompletionsRelatedFilesProviderService=Vl.relatedFilesLogger=Vl.PromiseExpirationCacheMap=Vl.EmptyRelatedFilesResponse=void 0;Vl.getRelatedFilesAndTraits=Vcc;var Bcc=Pne(),Fcc=an(),Ucc=hd(),bNr=Ks(),Qcc=eV(),qcc=aU(),Wvt=Gl(),jcc=nA(),Hcc=u8i();Vl.EmptyRelatedFilesResponse={entries:[],traits:[]};var Gvt={entries:new Map,traits:[]},$vt=class extends qcc.LRUCacheMap{static{a(this,"PromiseExpirationCacheMap")}constructor(e,r=120*1e3){super(e),this.defaultEvictionTimeMs=r,this._cacheTimestamps=new Map}bumpRetryCount(e){let r=this._cacheTimestamps.get(e);return r?++r.retryCount:(this._cacheTimestamps.set(e,{timestamp:Date.now(),retryCount:0}),0)}has(e){return this.isValid(e)?super.has(e):(this.deleteExpiredEntry(e),!1)}get(e){let r=super.get(e);if(this.isValid(e))return r;this.deleteExpiredEntry(e)}set(e,r){let n=super.set(e,r);return this.isValid(e)||this._cacheTimestamps.set(e,{timestamp:Date.now(),retryCount:0}),n}clear(){super.clear(),this._cacheTimestamps.clear()}isValid(e){let r=this._cacheTimestamps.get(e);return r!==void 0&&Date.now()-r.timestampVl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};Vl.RelatedFilesProvider=vNr;Vl.RelatedFilesProvider=vNr=ENr=Lcc([Hvt(0,bNr.IInstantiationService),Hvt(1,Bcc.IIgnoreService),Hvt(2,Wvt.ICompletionsLogTargetService),Hvt(3,Qcc.ICompletionsFileSystemService)],vNr);var $cc=3,BBe=new $vt(Gcc);async function d8i(t,e,r,n,o){let s=t.get(bNr.IInstantiationService),c=t.get(Wvt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>Vl.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(BBe.bumpRetryCount(e.uri)>=$cc?u=Gvt:u=void 0);let d=performance.now()-l;if(Vl.relatedFilesLogger.debug(c,u!==void 0?`Fetched ${[...u.entries.values()].map(f=>f.size).reduce((f,h)=>f+h,0)} related files for '${e.uri}' in ${d}ms.`:`Failing fetching files for '${e.uri}' in ${d}ms.`),u===void 0)throw new Vvt;return u}a(d8i,"getRelatedFiles");var CNr=a(function(t,e,r,n,o){let s=`${e.uri}`;if(BBe.has(s))return BBe.get(s);let c=d8i(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw BBe.delete(s),l})),BBe.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");CNr=(0,Hcc.shortCircuit)(CNr,200,Gvt);async function Vcc(t,e,r,n,o,s=!1){let c=t.get(bNr.IInstantiationService),l=t.get(Wvt.ICompletionsLogTargetService),u=t.get(Vl.ICompletionsRelatedFilesProviderService),d=Gvt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(d8i,f,r,n,u):await c.invokeFunction(CNr,f,r,n,u)}catch(f){d=Gvt,f instanceof Vvt&&c.invokeFunction(jcc.telemetry,"getRelatedFilesList",r)}return Vl.relatedFilesLogger.debug(l,d!=null?`Fetched following traits ${d.traits.map(f=>`{${f.name} : ${f.value}}`).join("")} for '${e.uri}'`:`Failing fecthing traits for '${e.uri}'.`),d}a(Vcc,"getRelatedFilesAndTraits")});var d_e=I(vV=>{"use strict";p();Object.defineProperty(vV,"__esModule",{value:!0});vV.NeighborSource=vV.NeighboringFileType=void 0;vV.considerNeighborFile=Jcc;vV.isIncludeNeighborFilesActive=Zcc;var Wcc=Ks(),f8i=z$(),h8i=xy(),zcc=Gl(),Ycc=RS(),Kcc=l8i(),Yvt=zvt(),p8i;(function(t){t.None="none",t.OpenTabs="opentabs",t.CursorMostRecent="cursormostrecent",t.CursorMostCount="cursormostcount",t.WorkspaceSharingSameFolder="workspacesharingsamefolder",t.WorkspaceSmallestPathDist="workspacesmallestpathdist",t.OpenTabsAndCocommitted="opentabsandcocommitted",t.RelatedCSharp="related/csharp",t.RelatedCSharpRoslyn="related/csharproslyn",t.RelatedCpp="related/cpp",t.RelatedTypeScript="related/typescript",t.RelatedCppSemanticCodeContext="related/cppsemanticcodecontext",t.RelatedOther="related/other"})(p8i||(vV.NeighboringFileType=p8i={}));function Jcc(t,e){return(0,f8i.normalizeLanguageId)(t)===(0,f8i.normalizeLanguageId)(e)}a(Jcc,"considerNeighborFile");var SNr=class t{static{a(this,"NeighborSource")}static{this.MAX_NEIGHBOR_AGGREGATE_LENGTH=2e5}static{this.MAX_NEIGHBOR_FILES=20}static{this.EXCLUDED_NEIGHBORS=["node_modules","dist","site-packages"]}static defaultEmptyResult(){return{docs:new Map,neighborSource:new Map,traits:[]}}static reset(){t.instance=void 0}static async getNeighborFilesAndTraits(e,r,n,o,s,c,l){let u=e.get(h8i.ICompletionsFeaturesService),d=e.get(zcc.ICompletionsLogTargetService),f=e.get(Wcc.IInstantiationService),h=e.get(Ycc.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(Kcc.OpenTabFiles));let m={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(u.excludeRelatedFiles(n,o))return m;let g=await h.getTextDocument({uri:r});if(!g)return Yvt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: failed to get the document ${r}`),m;let A=h.getWorkspaceFolder(g);if(!A)return Yvt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(Yvt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(Yvt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),m.traits.push(...y.traits),m):(y.entries.forEach((_,E)=>{let v=[];_.forEach((S,T)=>{let w=t.getRelativePath(T,A.uri);if(!w||m.docs.has(T))return;let R={relativePath:w,uri:T,source:S};v.unshift(R),m.docs.set(T,R)}),v.length>0&&m.neighborSource.set(E,v.map(S=>S.uri.toString()))}),m.traits.push(...y.traits),m)}static basename(e){return decodeURIComponent(e.replace(/[#?].*$/,"").replace(/^.*[/:]/,""))}static getRelativePath(e,r){let n=r.toString().replace(/[#?].*/,"").replace(/\/?$/,"/");return e.toString().startsWith(n)?e.toString().slice(n.length):t.basename(e)}};vV.NeighborSource=SNr;function Zcc(t,e,r){return t.get(h8i.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(Zcc,"isIncludeNeighborFilesActive")});var INr=I(Kvt=>{"use strict";p();Object.defineProperty(Kvt,"__esModule",{value:!0});Kvt.SimilarFiles=void 0;var f_e=LL(),TNr=pU(),Xcc=rvt(),elc=cPr(),tlc=ivt(),rlc=mU(),nlc=p_e(),m8i=d_e(),ilc=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(rlc.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=m8i.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await m8i.NeighborSource.getNeighborFilesAndTraits(h,u.document.uri,u.document.detectedLanguageId,u.telemetryData,u.cancellationToken,u.data)));let f=await c(u.telemetryData,u.document,u,d);s(f)});async function c(u,d,f,h){let m=t.instantiationService.invokeFunction(nlc.getPromptOptions,u,d.detectedLanguageId);return(await l(m,u,d,f,h)).filter(A=>A.snippet.length>0).sort((A,y)=>A.score-y.score).map(A=>({...(0,elc.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction(tlc.getSimilarFilesOptions,d,f.detectedLanguageId),y=t.tdms.getRelativePath(f),_={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await(0,Xcc.getSimilarSnippets)(_,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,f_e.jsxs)(f_e.Fragment,{children:[...o.map((u,d)=>(0,f_e.jsx)(olc,{snippet:u}))]})},"SimilarFiles");Kvt.SimilarFiles=ilc;var olc=a((t,e)=>(0,f_e.jsxs)(TNr.Chunk,{children:[(0,f_e.jsx)(TNr.Text,{children:t.snippet.headline}),(0,f_e.jsx)(TNr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var b8i=I(wI=>{"use strict";p();Object.defineProperty(wI,"__esModule",{value:!0});wI.getAllRecentEditsByTimestamp=slc;wI.findChangeSpan=xNr;wI.getDiff=A8i;wI.unifiedDiff=y8i;wI.findReplaceDiff=_8i;wI.editsOverlap=E8i;wI.updateEdits=v8i;wI.buildIncomingEdit=wNr;wI.trimOldFilesFromState=C8i;wI.recentEditsReducer=llc;wI.summarizeEdit=ulc;function slc(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(slc,"getAllRecentEditsByTimestamp");function xNr(t,e){let r=0;for(;r=r&&o>=r&&t[n]===e[o];)n--,o--;return r>n&&r>o?null:{start:r,endPrev:n,endNew:o}}a(xNr,"findChangeSpan");function A8i(t,e,r,n,o,s,c){let l=Math.max(0,n-c),u=Math.min(r.length,s+c+1);return{file:t,pre:l,post:u,before:e.slice(l,n),removed:e.slice(n,o+1),added:r.slice(n,s+1),after:r.slice(s+1,u)}}a(A8i,"getDiff");function alc(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(alc,"measureDiffSize");function y8i(t,e=!1,r=!1,n=!1){let o=[];o.push(`--- a/${t.file}`),o.push(`+++ b/${t.file}`);let s=t.before.length+t.removed.length+t.after.length,c=t.before.length+t.added.length+t.after.length;o.push(`@@ -${t.pre+1},${s} +${t.pre+1},${c} @@`);for(let l of t.before)o.push(" "+l);if(r)for(let l of t.added)o.push("+"+l);if(!e){let l=n?" --- IGNORE ---":"";for(let u of t.removed)o.push("-"+u+l)}if(!r)for(let l of t.added)o.push("+"+l);for(let l of t.after)o.push(" "+l);return o.join(` +${T3i(r,e)} +`,this}appendLink(e,r,n){return this.value+="[",this.value+=this._escape(r,"]"),this.value+="](",this.value+=this._escape(String(e),")"),n&&(this.value+=` "${this._escape(this._escape(n,'"'),")")}"`),this.value+=")",this}_escape(e,r){let n=new RegExp((0,$oc.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};Dy.MarkdownString=gvt;function b3i(t){return S3i(t)?!t.value:Array.isArray(t)?t.every(b3i):!0}a(b3i,"isEmptyMarkdownString");function S3i(t){return t instanceof gvt?!0:t&&typeof t=="object"?typeof t.value=="string"&&(typeof t.isTrusted=="boolean"||typeof t.isTrusted=="object"||t.isTrusted===void 0)&&(typeof t.supportThemeIcons=="boolean"||t.supportThemeIcons===void 0)&&(typeof t.supportAlertSyntax=="boolean"||t.supportAlertSyntax===void 0):!1}a(S3i,"isMarkdownString");function Voc(t,e){return t===e?!0:!t||!e?!1:t.value===e.value&&t.isTrusted===e.isTrusted&&t.supportThemeIcons===e.supportThemeIcons&&t.supportHtml===e.supportHtml&&t.supportAlertSyntax===e.supportAlertSyntax&&(t.baseUri===e.baseUri||!!t.baseUri&&!!e.baseUri&&(0,Goc.isEqual)(mvt.URI.from(t.baseUri),mvt.URI.from(e.baseUri)))}a(Voc,"markdownStringEqual");function Avt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(Avt,"escapeMarkdownSyntaxTokens");function Woc(t){return t.replace(/[\\\]]/g,"\\$&")}a(Woc,"escapeMarkdownLinkLabel");function T3i(t,e){let r=t.match(/^`+/gm)?.reduce((o,s)=>o.length>s.length?o:s).length??0,n=r>=3?r+1:3;return[`${"`".repeat(n)}${e}`,t,`${"`".repeat(n)}`].join(` +`)}a(T3i,"appendEscapedMarkdownCodeBlockFence");function zoc(t){let e=Math.max(0,...(t.match(/`+/g)??[]).map(s=>s.length)),r="`".repeat(e+1),o=t.startsWith("`")||t.endsWith("`")?` ${t} `:t;return`${r}${o}${r}`}a(zoc,"appendEscapedMarkdownInlineCode");function Yoc(t){return t.replace(/"/g,""")}a(Yoc,"escapeDoubleQuotes");function Koc(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(Koc,"removeMarkdownEscapes");function Joc(t){let e=[],r=t.split("|").map(o=>o.trim());t=r[0];let n=r[1];if(n){let o=/height=(\d+)/.exec(n),s=/width=(\d+)/.exec(n),c=o?o[1]:"",l=s?s[1]:"",u=isFinite(parseInt(l)),d=isFinite(parseInt(c));u&&e.push(`width="${l}"`),d&&e.push(`height="${c}"`)}return{href:t,dimensions:e}}a(Joc,"parseHrefAndDimensions");function I3i(t,e,r,n=!0){return`[${n?Avt(t):t}](${e}${r?` "${Avt(r)}"`:""})`}a(I3i,"createMarkdownLink");function Zoc(t,e=!0){let r=x3i(t.id,...t.arguments||[]).toString();return I3i(t.text,r,t.tooltip,e)}a(Zoc,"createMarkdownCommandLink");function x3i(t,...e){return mvt.URI.from({scheme:Hoc.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(x3i,"createCommandUri")});var JPr=I($ne=>{"use strict";p();var Xoc=$ne&&$ne.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},YPr;Object.defineProperty($ne,"__esModule",{value:!0});$ne.MarkdownString=void 0;var esc=w3i(),tsc=dN(),KPr=YPr=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof YPr?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new esc.MarkdownString(e,{supportThemeIcons:r})}get value(){return this.#e.value}set value(e){this.#e.value=e}get isTrusted(){return this.#e.isTrusted}set isTrusted(e){this.#e.isTrusted=e}get supportThemeIcons(){return this.#e.supportThemeIcons}set supportThemeIcons(e){this.#e.supportThemeIcons=e}get supportHtml(){return this.#e.supportHtml}set supportHtml(e){this.#e.supportHtml=e}get supportAlertSyntax(){return this.#e.supportAlertSyntax}set supportAlertSyntax(e){this.#e.supportAlertSyntax=e}get baseUri(){return this.#e.baseUri}set baseUri(e){this.#e.baseUri=e}appendText(e){return this.#e.appendText(e),this}appendMarkdown(e){return this.#e.appendMarkdown(e),this}appendCodeblock(e,r){return this.#e.appendCodeblock(r??"",e),this}};$ne.MarkdownString=KPr;$ne.MarkdownString=KPr=YPr=Xoc([tsc.es5ClassCompat],KPr)});var P3i=I(dU=>{"use strict";p();Object.defineProperty(dU,"__esModule",{value:!0});dU.Mimes=void 0;dU.getMediaOrTextMime=nsc;dU.getMediaMime=k3i;dU.getExtensionForMimeType=isc;dU.normalizeMimeType=ssc;dU.isTextStreamMime=asc;var R3i=$A();dU.Mimes=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list",html:"text/html"});var rsc={".css":"text/css",".csv":"text/csv",".htm":"text/html",".html":"text/html",".ics":"text/calendar",".js":"text/javascript",".mjs":"text/javascript",".txt":"text/plain",".xml":"text/xml"},ZPr={".aac":"audio/x-aac",".avi":"video/x-msvideo",".bmp":"image/bmp",".flv":"video/x-flv",".gif":"image/gif",".ico":"image/x-icon",".jpe":["image/jpg","image/jpeg"],".jpeg":["image/jpg","image/jpeg"],".jpg":["image/jpg","image/jpeg"],".m1v":"video/mpeg",".m2a":"audio/mpeg",".m2v":"video/mpeg",".m3a":"audio/mpeg",".mid":"audio/midi",".midi":"audio/midi",".mk3d":"video/x-matroska",".mks":"video/x-matroska",".mkv":"video/x-matroska",".mov":"video/quicktime",".movie":"video/x-sgi-movie",".mp2":"audio/mpeg",".mp2a":"audio/mpeg",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4a":"audio/mp4",".mp4v":"video/mp4",".mpe":"video/mpeg",".mpeg":"video/mpeg",".mpg":"video/mpeg",".mpg4":"video/mp4",".mpga":"audio/mpeg",".oga":"audio/ogg",".ogg":"audio/ogg",".opus":"audio/opus",".ogv":"video/ogg",".png":"image/png",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".spx":"audio/ogg",".svg":"image/svg+xml",".tga":"image/x-tga",".tif":"image/tiff",".tiff":"image/tiff",".wav":"audio/x-wav",".webm":"video/webm",".webp":"image/webp",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".woff":"application/font-woff"};function nsc(t){let e=(0,R3i.extname)(t),r=rsc[e.toLowerCase()];return r!==void 0?r:k3i(t)}a(nsc,"getMediaOrTextMime");function k3i(t){let e=(0,R3i.extname)(t),r=ZPr[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a(k3i,"getMediaMime");function isc(t){for(let e in ZPr){let r=ZPr[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(isc,"getExtensionForMimeType");var osc=/^(.+)\/(.+?)(;.+)?$/;function ssc(t,e){let r=osc.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(ssc,"normalizeMimeType");function asc(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(asc,"isTextStreamMime")});var M3i=I(Qg=>{"use strict";p();var csc=Qg&&Qg.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},pV;Object.defineProperty(Qg,"__esModule",{value:!0});Qg.NotebookCellOutput=Qg.NotebookCellOutputItem=Qg.NotebookEdit=Qg.NotebookData=Qg.NotebookCellData=Qg.NotebookRange=Qg.NotebookCellKind=void 0;var lsc=dN(),D3i=Os(),yvt=P3i(),usc=Lg(),N3i;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(N3i||(Qg.NotebookCellKind=N3i={}));var Vne=class t{static{a(this,"NotebookRange")}static isNotebookRange(e){return e instanceof t?!0:e?typeof e.start=="number"&&typeof e.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,r){if(e<0)throw(0,D3i.illegalArgument)("start must be positive");if(r<0)throw(0,D3i.illegalArgument)("end must be positive");e<=r?(this._start=e,this._end=r):(this._start=r,this._end=e)}with(e){let r=this._start,n=this._end;return e.start!==void 0&&(r=e.start),e.end!==void 0&&(n=e.end),r===this._start&&n===this._end?this:new t(r,n)}};Qg.NotebookRange=Vne;var XPr=class t{static{a(this,"NotebookCellData")}static validate(e){if(typeof e.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof e.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof e.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(e){return Array.isArray(e)&&e.every(r=>t.isNotebookCellData(r))}static isNotebookCellData(e){return!0}constructor(e,r,n,o,s,c,l){this.kind=e,this.value=r,this.languageId=n,this.mime=o,this.outputs=s??[],this.metadata=c,this.executionSummary=l,t.validate(this)}};Qg.NotebookCellData=XPr;var e2r=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};Qg.NotebookData=e2r;var t2r=pV=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof pV?!0:e?Vne.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new pV(e,r)}static insertCells(e,r){return new pV(new Vne(e,e),r)}static deleteCells(e){return new pV(e,[])}static updateCellMetadata(e,r){let n=new pV(new Vne(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new pV(new Vne(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};Qg.NotebookEdit=t2r;Qg.NotebookEdit=t2r=pV=csc([lsc.es5ClassCompat],t2r);var r2r=class t{static{a(this,"NotebookCellOutputItem")}static isNotebookCellOutputItem(e){return e instanceof t?!0:e?typeof e.mime=="string"&&e.data instanceof Uint8Array:!1}static error(e){let r={name:e.name,message:e.message,stack:e.stack};return t.json(r,"application/vnd.code.notebook.error")}static stdout(e){return t.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return t.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,r="application/octet-stream"){return new t(e,r)}static#e=new TextEncoder;static text(e,r=yvt.Mimes.text){let n=t.#e.encode(String(e));return new t(n,r)}static json(e,r="text/x-json"){let n=JSON.stringify(e,void 0," ");return t.text(n,r)}constructor(e,r){this.data=e,this.mime=r;let n=(0,yvt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};Qg.NotebookCellOutputItem=r2r;var n2r=class t{static{a(this,"NotebookCellOutput")}static isNotebookCellOutput(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,r=!1){let n=new Set,o=new Set;for(let s=0;s!o.has(c))}constructor(e,r,n){this.items=t.ensureUniqueMimeTypes(e,!0),typeof r=="string"?(this.id=r,this.metadata=n):(this.id=(0,usc.generateUuid)(),this.metadata=r??n)}};Qg.NotebookCellOutput=n2r});var L3i=I(mV=>{"use strict";p();var dsc=mV&&mV.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i2r;Object.defineProperty(mV,"__esModule",{value:!0});mV.Selection=void 0;mV.getDebugDescriptionOfSelection=O3i;var fsc=dN(),hV=r_e(),o2r=BL(),s2r=i2r=class extends o2r.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof i2r?!0:!e||typeof e!="object"?!1:o2r.Range.isRange(e)&&hV.Position.isPosition(e.anchor)&&hV.Position.isPosition(e.active)&&typeof e.isReversed=="boolean"}get anchor(){return this._anchor}get active(){return this._active}constructor(e,r,n,o){let s,c;if(typeof e=="number"&&typeof r=="number"&&typeof n=="number"&&typeof o=="number"?(s=new hV.Position(e,r),c=new hV.Position(n,o)):hV.Position.isPosition(e)&&hV.Position.isPosition(r)&&(s=hV.Position.of(e),c=hV.Position.of(r)),!s||!c)throw new Error("Invalid arguments");super(s,c),this._anchor=s,this._active=c}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}[Symbol.for("debug.description")](){return O3i(this)}};mV.Selection=s2r;mV.Selection=s2r=i2r=dsc([fsc.es5ClassCompat],s2r);function O3i(t){let e=(0,o2r.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(O3i,"getDebugDescriptionOfSelection")});var c2r=I(zne=>{"use strict";p();var psc=zne&&zne.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Wne;Object.defineProperty(zne,"__esModule",{value:!0});zne.SnippetString=void 0;var hsc=dN(),a2r=Wne=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof Wne?!0:!e||typeof e!="object"?!1:typeof e.value=="string"}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){this._tabstop=1,this.value=e||""}appendText(e){return this.value+=Wne._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,r=this._tabstop++){if(typeof e=="function"){let n=new Wne;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Wne._escape(e);return this.value+="${",this.value+=r,this.value+=":",this.value+=e,this.value+="}",this}appendChoice(e,r=this._tabstop++){let n=e.map(o=>o.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=r,this.value+="|",this.value+=n,this.value+="|}",this}appendVariable(e,r){if(typeof r=="function"){let n=new Wne;n._tabstop=this._tabstop,r(n),this._tabstop=n._tabstop,r=n.value}else typeof r=="string"&&(r=r.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,r&&(this.value+=":",this.value+=r),this.value+="}",this}};zne.SnippetString=a2r;zne.SnippetString=a2r=Wne=psc([hsc.es5ClassCompat],a2r)});var u2r=I(_vt=>{"use strict";p();Object.defineProperty(_vt,"__esModule",{value:!0});_vt.SnippetTextEdit=void 0;var msc=c2r(),B3i=BL(),l2r=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?B3i.Range.isRange(e.range)&&msc.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new B3i.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};_vt.SnippetTextEdit=l2r});var Q3i=I(fN=>{"use strict";p();var gsc=fN&&fN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},d2r;Object.defineProperty(fN,"__esModule",{value:!0});fN.SymbolInformation=fN.SymbolTag=fN.SymbolKind=void 0;var Asc=dN(),F3i=xPr(),ysc=BL(),f2r;(function(t){t[t.File=0]="File",t[t.Module=1]="Module",t[t.Namespace=2]="Namespace",t[t.Package=3]="Package",t[t.Class=4]="Class",t[t.Method=5]="Method",t[t.Property=6]="Property",t[t.Field=7]="Field",t[t.Constructor=8]="Constructor",t[t.Enum=9]="Enum",t[t.Interface=10]="Interface",t[t.Function=11]="Function",t[t.Variable=12]="Variable",t[t.Constant=13]="Constant",t[t.String=14]="String",t[t.Number=15]="Number",t[t.Boolean=16]="Boolean",t[t.Array=17]="Array",t[t.Object=18]="Object",t[t.Key=19]="Key",t[t.Null=20]="Null",t[t.EnumMember=21]="EnumMember",t[t.Struct=22]="Struct",t[t.Event=23]="Event",t[t.Operator=24]="Operator",t[t.TypeParameter=25]="TypeParameter"})(f2r||(fN.SymbolKind=f2r={}));var U3i;(function(t){t[t.Deprecated=1]="Deprecated"})(U3i||(fN.SymbolTag=U3i={}));var p2r=d2r=class{static{a(this,"SymbolInformation")}static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,r,n,o,s){this.name=e,this.kind=r,this.containerName=s,typeof n=="string"&&(this.containerName=n),o instanceof F3i.Location?this.location=o:n instanceof ysc.Range&&(this.location=new F3i.Location(o,n)),d2r.validate(this)}toJSON(){return{name:this.name,kind:f2r[this.kind],location:this.location,containerName:this.containerName}}};fN.SymbolInformation=p2r;fN.SymbolInformation=p2r=d2r=gsc([Asc.es5ClassCompat],p2r)});var g2r=I(fU=>{"use strict";p();var _sc=fU&&fU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Yne;Object.defineProperty(fU,"__esModule",{value:!0});fU.TextEdit=fU.EndOfLine=void 0;var h2r=Os(),Esc=dN(),q3i=r_e(),Evt=BL(),j3i;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(j3i||(fU.EndOfLine=j3i={}));var m2r=Yne=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof Yne?!0:!e||typeof e!="object"?!1:Evt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new Yne(e,r)}static insert(e,r){return Yne.replace(new Evt.Range(e,e),r)}static delete(e){return Yne.replace(e,"")}static setEndOfLine(e){let r=new Yne(new Evt.Range(new q3i.Position(0,0),new q3i.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!Evt.Range.isRange(e))throw(0,h2r.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,h2r.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,h2r.illegalArgument)("newEol");this._newEol=e}constructor(e,r){this._range=e,this._newText=r}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};fU.TextEdit=m2r;fU.TextEdit=m2r=Yne=_sc([Esc.es5ClassCompat],m2r)});var eFi=I(It=>{"use strict";p();Object.defineProperty(It,"__esModule",{value:!0});It.ChatRequestEditedFileEventKind=It.ChatInputNotificationSeverity=It.ChatErrorLevel=It.AISearchKeyword=It.TextSearchMatch2=It.ExcludeSettingOptions=It.LanguageModelPromptTsxPart=It.ChatImageMimeType=It.LanguageModelDataPart2=It.LanguageModelDataPart=It.LanguageModelThinkingPart=It.LanguageModelTextPart2=It.LanguageModelPartAudience=It.LanguageModelTextPart=It.LanguageModelToolResult2=It.LanguageModelToolResult=It.ChatReferenceBinaryData=It.ChatReferenceDiagnostic=It.ChatRequestNotebookData=It.ChatRequestEditorData=It.ChatResponseTurn=It.ChatRequestTurn2=It.ChatRequestTurn=It.ChatResponseQuestionCarouselPart=It.ChatQuestion=It.ChatQuestionType=It.ChatResponseConfirmationPart=It.ChatResponseWorkspaceEditPart=It.ChatResponseNotebookEditPart=It.ChatResponseTextEditPart=It.ChatResponseMarkdownWithVulnerabilitiesPart=It.ChatResponseCommandButtonPart=It.ChatResponseCodeCitationPart=It.ChatResponseAutoModeResolutionPart=It.ChatResponsePullRequestPart=It.ChatResponseExtensionsPart=It.ChatResponseMovePart=It.ChatResponseReferencePart2=It.ChatResponseReferencePart=It.ChatResponseInfoPart=It.ChatResponseWarningPart=It.ChatResponseProgressPart2=It.ChatResponseExternalEditPart=It.ChatResponseHookPart=It.ChatResponseThinkingProgressPart=It.ChatResponseProgressPart=It.ChatResponseAnchorPart=It.ChatResponseFileTreePart=It.ChatResponseCodeblockUriPart=It.ChatResponseMarkdownPart=void 0;It.McpHttpServerDefinition=It.McpStdioServerDefinition=It.ChatResource=It.LanguageModelError=It.ChatSessionStatus=It.ChatResponseTurn2=It.ChatSubagentToolInvocationData=It.ChatToolInvocationPart=It.McpToolInvocationContentData=It.LanguageModelChatMessage=It.LanguageModelChatToolMode=It.LanguageModelChatMessageRole=It.LanguageModelToolResultPart2=It.LanguageModelToolResultPart=It.LanguageModelToolCallPart=It.LanguageModelToolMCPSource=It.LanguageModelToolExtensionSource=It.ChatResponseClearToPreviousToolInvocationReason=void 0;var H3i=Z$(),Svt=JPr(),A2r=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new Svt.MarkdownString(e):e}};It.ChatResponseMarkdownPart=A2r;var y2r=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};It.ChatResponseCodeblockUriPart=y2r;var _2r=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};It.ChatResponseFileTreePart=_2r;var E2r=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};It.ChatResponseAnchorPart=E2r;var v2r=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};It.ChatResponseProgressPart=v2r;var C2r=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};It.ChatResponseThinkingProgressPart=C2r;var b2r=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};It.ChatResponseHookPart=b2r;var S2r=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};It.ChatResponseExternalEditPart=S2r;var T2r=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};It.ChatResponseProgressPart2=T2r;var I2r=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new Svt.MarkdownString(e):e}};It.ChatResponseWarningPart=I2r;var x2r=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new Svt.MarkdownString(e):e}};It.ChatResponseInfoPart=x2r;var w2r=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};It.ChatResponseReferencePart=w2r;var R2r=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};It.ChatResponseReferencePart2=R2r;var k2r=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};It.ChatResponseMovePart=k2r;var P2r=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};It.ChatResponseExtensionsPart=P2r;var D2r=class{static{a(this,"ChatResponsePullRequestPart")}constructor(e,r,n,o,s){"command"in e&&typeof e.command=="string"?this.command=e:(this.uri=e,this.command={title:"View Pull Request",command:"vscode.open",arguments:[e]}),this.title=r,this.description=n,this.author=o,this.linkTag=s}};It.ChatResponsePullRequestPart=D2r;var N2r=class{static{a(this,"ChatResponseAutoModeResolutionPart")}constructor(e,r,n,o){this.resolvedModel=e,this.resolvedModelName=r,this.predictedLabel=n,this.confidence=o}};It.ChatResponseAutoModeResolutionPart=N2r;var M2r=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};It.ChatResponseCodeCitationPart=M2r;var O2r=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};It.ChatResponseCommandButtonPart=O2r;var L2r=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new Svt.MarkdownString(e):e,this.vulnerabilities=r}};It.ChatResponseMarkdownWithVulnerabilitiesPart=L2r;var B2r=class{static{a(this,"ChatResponseTextEditPart")}constructor(e,r){this.uri=e,r===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(r)?r:[r]}};It.ChatResponseTextEditPart=B2r;var F2r=class{static{a(this,"ChatResponseNotebookEditPart")}constructor(e,r){this.uri=e,r===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(r)?r:[r]}};It.ChatResponseNotebookEditPart=F2r;var U2r=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};It.ChatResponseWorkspaceEditPart=U2r;var Q2r=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};It.ChatResponseConfirmationPart=Q2r;var G3i;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(G3i||(It.ChatQuestionType=G3i={}));var q2r=class{static{a(this,"ChatQuestion")}constructor(e,r,n,o){this.id=e,this.type=r,this.title=n,o&&(this.message=o.message,this.options=o.options,this.defaultValue=o.defaultValue,this.allowFreeformInput=o.allowFreeformInput)}};It.ChatQuestion=q2r;var j2r=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};It.ChatResponseQuestionCarouselPart=j2r;var H2r=class{static{a(this,"ChatRequestTurn")}constructor(e,r,n,o,s){this.prompt=e,this.command=r,this.references=n,this.participant=o,this.toolReferences=s}};It.ChatRequestTurn=H2r;var G2r=class{static{a(this,"ChatRequestTurn2")}constructor(e,r,n,o,s,c,l,u,d){this.prompt=e,this.command=r,this.references=n,this.participant=o,this.toolReferences=s,this.editedFileEvents=c,this.id=l,this.modelId=u,this.modeInstructions2=d}};It.ChatRequestTurn2=G2r;var $2r=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};It.ChatResponseTurn=$2r;var V2r=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};It.ChatRequestEditorData=V2r;var W2r=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};It.ChatRequestNotebookData=W2r;var z2r=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};It.ChatReferenceDiagnostic=z2r;var Y2r=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};It.ChatReferenceBinaryData=Y2r;var K2r=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};It.LanguageModelToolResult=K2r;var J2r=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};It.LanguageModelToolResult2=J2r;var vvt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};It.LanguageModelTextPart=vvt;var $3i;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})($3i||(It.LanguageModelPartAudience=$3i={}));var Z2r=class extends vvt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};It.LanguageModelTextPart2=Z2r;var X2r=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};It.LanguageModelThinkingPart=X2r;var Cvt=class t{static{a(this,"LanguageModelDataPart")}constructor(e,r){this.mimeType=r,this.data=e}static image(e,r){return new t(e,r)}static json(e){let r=JSON.stringify(e,void 0," ");return new t(H3i.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t(H3i.VSBuffer.fromString(e).buffer,"text/plain")}};It.LanguageModelDataPart=Cvt;var eDr=class extends Cvt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};It.LanguageModelDataPart2=eDr;var V3i;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(V3i||(It.ChatImageMimeType=V3i={}));var tDr=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};It.LanguageModelPromptTsxPart=tDr;var W3i;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(W3i||(It.ExcludeSettingOptions=W3i={}));var rDr=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};It.TextSearchMatch2=rDr;var nDr=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};It.AISearchKeyword=nDr;var z3i;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(z3i||(It.ChatErrorLevel=z3i={}));var Y3i;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(Y3i||(It.ChatInputNotificationSeverity=Y3i={}));var K3i;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(K3i||(It.ChatRequestEditedFileEventKind=K3i={}));var J3i;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(J3i||(It.ChatResponseClearToPreviousToolInvocationReason=J3i={}));var iDr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};It.LanguageModelToolExtensionSource=iDr;var oDr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};It.LanguageModelToolMCPSource=oDr;var sDr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};It.LanguageModelToolCallPart=sDr;var aDr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};It.LanguageModelToolResultPart=aDr;var cDr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};It.LanguageModelToolResultPart2=cDr;var bvt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(bvt||(It.LanguageModelChatMessageRole=bvt={}));var Z3i;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(Z3i||(It.LanguageModelChatToolMode=Z3i={}));var lDr=class t{static{a(this,"LanguageModelChatMessage")}constructor(e,r,n){this.role=e,this.content=typeof r=="string"?[{type:"text",value:r}]:r,this.name=n}static User(e,r){return new t(bvt.User,e,r)}static Assistant(e,r){return new t(bvt.Assistant,e,r)}};It.LanguageModelChatMessage=lDr;var uDr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};It.McpToolInvocationContentData=uDr;var dDr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};It.ChatToolInvocationPart=dDr;var fDr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};It.ChatSubagentToolInvocationData=fDr;var pDr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};It.ChatResponseTurn2=pDr;var X3i;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(X3i||(It.ChatSessionStatus=X3i={}));var hDr=class t extends Error{static{a(this,"LanguageModelError")}static#e="LanguageModelError";static NotFound(e){return new t(e,t.NotFound.name)}static NoPermissions(e){return new t(e,t.NoPermissions.name)}static Blocked(e){return new t(e,t.Blocked.name)}constructor(e,r,n){super(e,{cause:n}),this.name=t.#e,this.code=r??""}};It.LanguageModelError=hDr;var mDr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};It.ChatResource=mDr;var gDr=class{static{a(this,"McpStdioServerDefinition")}constructor(e,r,n,o,s){this.label=e,this.command=r,this.args=n??[],this.env=o??{},this.version=s}};It.McpStdioServerDefinition=gDr;var ADr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};It.McpHttpServerDefinition=ADr});var nFi=I(gV=>{"use strict";p();Object.defineProperty(gV,"__esModule",{value:!0});gV.TextDocumentChangeReason=gV.TextEditorSelectionChangeKind=gV.WorkspaceEdit=void 0;var vsc=Ml(),Csc=b2(),bsc=BL(),Ssc=u2r(),Tsc=g2r(),yDr=class{static{a(this,"WorkspaceEdit")}constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,r,n,o){this._edits.push({_type:1,from:e,to:r,options:n,metadata:o})}createFile(e,r,n){this._edits.push({_type:1,from:void 0,to:e,options:r,metadata:n})}deleteFile(e,r,n){this._edits.push({_type:1,from:e,to:void 0,options:r,metadata:n})}replace(e,r,n,o){this._edits.push({_type:2,uri:e,edit:new Tsc.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new bsc.Range(r,r),n,o)}delete(e,r,n){this.replace(e,r,"",n)}has(e){return this._edits.some(r=>r._type===2&&r.uri.toString()===e.toString())}set(e,r){if(r)for(let n of r){if(!n)continue;let o,s;Array.isArray(n)?(o=n[0],s=n[1]):o=n,Ssc.SnippetTextEdit.isSnippetTextEdit(o)?this._edits.push({_type:6,uri:e,range:o.range,edit:o.snippet,metadata:s}):this._edits.push({_type:2,uri:e,edit:o,metadata:s})}else{for(let n=0;n{"use strict";p();Object.defineProperty(Lp,"__esModule",{value:!0});Lp.FileType=Lp.ChatSessionStatus=Lp.ChatLocation=Lp.ChatVariableLevel=Lp.ExtensionMode=Lp.DiagnosticSeverity=Lp.TextEditorRevealType=Lp.TextEditorLineNumbersStyle=Lp.TextEditorCursorStyle=Lp.InteractiveEditorResponseFeedbackKind=void 0;var iFi;(function(t){t[t.Unhelpful=0]="Unhelpful",t[t.Helpful=1]="Helpful",t[t.Undone=2]="Undone",t[t.Accepted=3]="Accepted",t[t.Bug=4]="Bug"})(iFi||(Lp.InteractiveEditorResponseFeedbackKind=iFi={}));var oFi;(function(t){t[t.Line=1]="Line",t[t.Block=2]="Block",t[t.Underline=3]="Underline",t[t.LineThin=4]="LineThin",t[t.BlockOutline=5]="BlockOutline",t[t.UnderlineThin=6]="UnderlineThin"})(oFi||(Lp.TextEditorCursorStyle=oFi={}));var sFi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(sFi||(Lp.TextEditorLineNumbersStyle=sFi={}));var aFi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(aFi||(Lp.TextEditorRevealType=aFi={}));var cFi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(cFi||(Lp.DiagnosticSeverity=cFi={}));var lFi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(lFi||(Lp.ExtensionMode=lFi={}));var uFi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(uFi||(Lp.ChatVariableLevel=uFi={}));var dFi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(dFi||(Lp.ChatLocation=dFi={}));var fFi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(fFi||(Lp.ChatSessionStatus=fFi={}));var pFi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(pFi||(Lp.FileType=pFi={}))});var gFi=I(_Dr=>{"use strict";p();Object.defineProperty(_Dr,"__esModule",{value:!0});_Dr.t=Isc;function Isc(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return mFi({message:e,args:r})}return mFi(t[0])}a(Isc,"t");function mFi(t){let{message:e,args:r}=t;return wsc(e,r??{})}a(mFi,"getMessage");var xsc=/{([^}]+)}/g;function wsc(t,e){return t.replace(xsc,(r,n)=>e[n]??r)}a(wsc,"format2")});var _Fi=I(AV=>{"use strict";p();Object.defineProperty(AV,"__esModule",{value:!0});AV.NewSymbolName=AV.NewSymbolNameTriggerKind=AV.NewSymbolNameTag=void 0;var AFi;(function(t){t[t.AIGenerated=1]="AIGenerated"})(AFi||(AV.NewSymbolNameTag=AFi={}));var yFi;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(yFi||(AV.NewSymbolNameTriggerKind=yFi={}));var EDr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};AV.NewSymbolName=EDr});var vFi=I(Tvt=>{"use strict";p();Object.defineProperty(Tvt,"__esModule",{value:!0});Tvt.TerminalShellExecutionCommandLineConfidence=void 0;var EFi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(EFi||(Tvt.TerminalShellExecutionCommandLineConfidence=EFi={}))});var CFi=I(i_e=>{"use strict";p();Object.defineProperty(i_e,"__esModule",{value:!0});i_e.ThemeColor=i_e.ThemeIcon=void 0;var vDr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};i_e.ThemeIcon=vDr;var CDr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};i_e.ThemeColor=CDr});var qg=I((C$p,IFi)=>{"use strict";p();var Rsc=S2(),ksc=Fc(),Psc=hd(),bFi=SPr(),Dsc=xPr(),Nsc=JPr(),wBe=M3i(),Msc=r_e(),Osc=BL(),Lsc=L3i(),Bsc=c2r(),Fsc=u2r(),SFi=Q3i(),TFi=g2r(),Ln=eFi(),bDr=nFi(),yV=hFi(),Usc=gFi(),SDr=_Fi(),Qsc=vFi(),qsc=CFi(),jsc={Position:Msc.Position,Range:Osc.Range,Selection:Lsc.Selection,EventEmitter:ksc.Emitter,CancellationTokenSource:Rsc.CancellationTokenSource,Diagnostic:bFi.Diagnostic,Location:Dsc.Location,DiagnosticRelatedInformation:bFi.DiagnosticRelatedInformation,TextEdit:TFi.TextEdit,WorkspaceEdit:bDr.WorkspaceEdit,Uri:Psc.URI,MarkdownString:Nsc.MarkdownString,DiagnosticSeverity:yV.DiagnosticSeverity,TextEditorCursorStyle:yV.TextEditorCursorStyle,TextEditorLineNumbersStyle:yV.TextEditorLineNumbersStyle,TextEditorRevealType:yV.TextEditorRevealType,EndOfLine:TFi.EndOfLine,l10n:{t:Usc.t},ExtensionMode:yV.ExtensionMode,ChatVariableLevel:yV.ChatVariableLevel,ChatResponseClearToPreviousToolInvocationReason:Ln.ChatResponseClearToPreviousToolInvocationReason,ChatResponseMarkdownPart:Ln.ChatResponseMarkdownPart,ChatResponseFileTreePart:Ln.ChatResponseFileTreePart,ChatResponseAnchorPart:Ln.ChatResponseAnchorPart,ChatResponseMovePart:Ln.ChatResponseMovePart,ChatResponseExtensionsPart:Ln.ChatResponseExtensionsPart,ChatResponseProgressPart:Ln.ChatResponseProgressPart,ChatResponseProgressPart2:Ln.ChatResponseProgressPart2,ChatResponseWarningPart:Ln.ChatResponseWarningPart,ChatResponseInfoPart:Ln.ChatResponseInfoPart,ChatResponseHookPart:Ln.ChatResponseHookPart,ChatResponseReferencePart:Ln.ChatResponseReferencePart,ChatResponseReferencePart2:Ln.ChatResponseReferencePart2,ChatResponseCodeCitationPart:Ln.ChatResponseCodeCitationPart,ChatResponseCommandButtonPart:Ln.ChatResponseCommandButtonPart,ChatResponseExternalEditPart:Ln.ChatResponseExternalEditPart,ChatResponseMarkdownWithVulnerabilitiesPart:Ln.ChatResponseMarkdownWithVulnerabilitiesPart,ChatResponseCodeblockUriPart:Ln.ChatResponseCodeblockUriPart,ChatResponseTextEditPart:Ln.ChatResponseTextEditPart,ChatResponseNotebookEditPart:Ln.ChatResponseNotebookEditPart,ChatResponseWorkspaceEditPart:Ln.ChatResponseWorkspaceEditPart,ChatResponseConfirmationPart:Ln.ChatResponseConfirmationPart,ChatQuestion:Ln.ChatQuestion,ChatQuestionType:Ln.ChatQuestionType,ChatResponseQuestionCarouselPart:Ln.ChatResponseQuestionCarouselPart,ChatRequestTurn:Ln.ChatRequestTurn,ChatResponseTurn:Ln.ChatResponseTurn,ChatRequestEditorData:Ln.ChatRequestEditorData,ChatRequestNotebookData:Ln.ChatRequestNotebookData,NewSymbolName:SDr.NewSymbolName,NewSymbolNameTag:SDr.NewSymbolNameTag,NewSymbolNameTriggerKind:SDr.NewSymbolNameTriggerKind,ChatLocation:yV.ChatLocation,SymbolInformation:SFi.SymbolInformation,LanguageModelToolResult:Ln.LanguageModelToolResult,ExtendedLanguageModelToolResult:Ln.LanguageModelToolResult,LanguageModelToolResult2:Ln.LanguageModelToolResult2,LanguageModelPromptTsxPart:Ln.LanguageModelPromptTsxPart,LanguageModelTextPart:Ln.LanguageModelTextPart,LanguageModelDataPart:Ln.LanguageModelDataPart,LanguageModelToolExtensionSource:Ln.LanguageModelToolExtensionSource,LanguageModelToolMCPSource:Ln.LanguageModelToolMCPSource,ChatReferenceBinaryData:Ln.ChatReferenceBinaryData,ChatReferenceDiagnostic:Ln.ChatReferenceDiagnostic,TextSearchMatch2:Ln.TextSearchMatch2,AISearchKeyword:Ln.AISearchKeyword,ExcludeSettingOptions:Ln.ExcludeSettingOptions,NotebookCellKind:wBe.NotebookCellKind,NotebookRange:wBe.NotebookRange,NotebookEdit:wBe.NotebookEdit,NotebookCellData:wBe.NotebookCellData,NotebookData:wBe.NotebookData,ChatErrorLevel:Ln.ChatErrorLevel,ChatInputNotificationSeverity:Ln.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:Qsc.TerminalShellExecutionCommandLineConfidence,ChatRequestEditedFileEventKind:Ln.ChatRequestEditedFileEventKind,ChatResponsePullRequestPart:Ln.ChatResponsePullRequestPart,ChatResponseAutoModeResolutionPart:Ln.ChatResponseAutoModeResolutionPart,LanguageModelTextPart2:Ln.LanguageModelTextPart2,LanguageModelDataPart2:Ln.LanguageModelDataPart2,LanguageModelThinkingPart:Ln.LanguageModelThinkingPart,LanguageModelPartAudience:Ln.LanguageModelPartAudience,ChatResponseThinkingProgressPart:Ln.ChatResponseThinkingProgressPart,LanguageModelToolCallPart:Ln.LanguageModelToolCallPart,LanguageModelToolResultPart:Ln.LanguageModelToolResultPart,LanguageModelToolResultPart2:Ln.LanguageModelToolResultPart2,LanguageModelChatMessageRole:Ln.LanguageModelChatMessageRole,LanguageModelChatMessage:Ln.LanguageModelChatMessage,LanguageModelChatToolMode:Ln.LanguageModelChatToolMode,TextEditorSelectionChangeKind:bDr.TextEditorSelectionChangeKind,TextDocumentChangeReason:bDr.TextDocumentChangeReason,ChatToolInvocationPart:Ln.ChatToolInvocationPart,ChatSubagentToolInvocationData:Ln.ChatSubagentToolInvocationData,McpToolInvocationContentData:Ln.McpToolInvocationContentData,ChatResponseTurn2:Ln.ChatResponseTurn2,ChatRequestTurn2:Ln.ChatRequestTurn2,LanguageModelError:Ln.LanguageModelError,SymbolKind:SFi.SymbolKind,SnippetString:Bsc.SnippetString,SnippetTextEdit:Fsc.SnippetTextEdit,FileType:yV.FileType,ChatSessionStatus:Ln.ChatSessionStatus,authentication:{getSession:a(async()=>{throw new Error("authentication.getSession not mocked in test")},"getSession")},McpHttpServerDefinition:Ln.McpHttpServerDefinition,McpStdioServerDefinition:Ln.McpStdioServerDefinition,ThemeIcon:qsc.ThemeIcon};IFi.exports=jsc});var xFi=I(o_e=>{"use strict";p();Object.defineProperty(o_e,"__esModule",{value:!0});o_e.UseData=o_e.UseState=void 0;var TDr=class{static{a(this,"UseState")}constructor(e){this.states=e,this.currentIndex=0,this.stateChanged=!1}useState(e){let r=this.currentIndex;if(this.states[r]===void 0){let o=typeof e=="function"?e():e;this.states[r]=o}let n=a(o=>{let s=typeof o=="function"?o(this.states[r]):o;this.states[r]=s,this.stateChanged=!0},"setState");return this.currentIndex++,[this.states[r],n]}hasChanged(){return this.stateChanged}};o_e.UseState=TDr;var IDr=class{static{a(this,"UseData")}constructor(e){this.measureUpdateTime=e,this.consumers=[]}useData(e,r){this.consumers.push(n=>{if(e(n))return r(n)})}async updateData(e){if(this.consumers.length>0){let r=performance.now();for(let n of this.consumers)await n(e);this.measureUpdateTime(performance.now()-r)}}};o_e.UseData=IDr});var RFi=I(Ivt=>{"use strict";p();Object.defineProperty(Ivt,"__esModule",{value:!0});Ivt.VirtualPromptReconciler=void 0;var wFi=xFi(),xDr=class{static{a(this,"VirtualPromptReconciler")}constructor(e){this.lifecycleData=new Map,this.vTree=this.virtualizeElement(e,"$",0)}reconcile(e){if(!this.vTree)throw new Error("No tree to reconcile, make sure to pass a valid prompt");return e?.isCancellationRequested?this.vTree:(this.vTree=this.reconcileNode(this.vTree,"$",0,e),this.vTree)}reconcileNode(e,r,n,o){if(!e.children&&!e.lifecycle)return e;let s=e;if(e.lifecycle?.isRemountRequired()){let l=this.collectChildPaths(e);s=this.virtualizeElement(e.component,r,n);let u=this.collectChildPaths(s);this.cleanupState(l,u)}else if(e.children){let l=[];for(let u=0;u"u")){if(typeof e=="string"||typeof e=="number")return{name:typeof e,path:`${r}[${n}]`,props:{value:e},component:e};if(Hsc(e.type)){let o=e.type(e.props.children),s=r!=="$"?`[${n}]`:"",c=`${r}${s}.${o.type}`,l=o.children.map((u,d)=>this.virtualizeElement(u,c,d));return this.ensureUniqueKeys(l),{name:o.type,path:c,children:l.flat().filter(u=>u!==void 0),component:e}}return this.virtualizeFunctionComponent(r,n,e,e.type)}}virtualizeFunctionComponent(e,r,n,o){let s=n.props.key?`["${n.props.key}"]`:`[${r}]`,c=`${e}${s}.${o.name}`,l=new RDr(this.getOrCreateLifecycleData(c)),u=o(n.props,l),h=(Array.isArray(u)?u:[u]).map((m,g)=>this.virtualizeElement(m,c,g)).flat().filter(m=>m!==void 0);return this.ensureUniqueKeys(h),{name:o.name,path:c,props:n.props,children:h,component:n,lifecycle:l}}ensureUniqueKeys(e){let r=new Map;for(let o of e){if(!o)continue;let s=o.props?.key;s&&r.set(s,(r.get(s)||0)+1)}let n=Array.from(r.entries()).filter(([o,s])=>s>1).map(([o])=>o);if(n.length>0)throw new Error(`Duplicate keys found: ${n.join(", ")}`)}collectChildPaths(e){let r=[];if(e?.children)for(let n of e.children)n&&(r.push(n.path),r.push(...this.collectChildPaths(n)));return r}cleanupState(e,r){for(let n of e)r.includes(n)||this.lifecycleData.delete(n)}getOrCreateLifecycleData(e){return this.lifecycleData.has(e)||this.lifecycleData.set(e,new wDr([])),this.lifecycleData.get(e)}createPipe(){return{pump:a(async e=>{await this.pumpData(e)},"pump")}}async pumpData(e){if(!this.vTree)throw new Error("No tree to pump data into. Pumping data before initializing?");await this.recursivelyPumpData(e,this.vTree)}async recursivelyPumpData(e,r){if(!r)throw new Error("Can't pump data into undefined node.");await r.lifecycle?.dataHook.updateData(e);for(let n of r.children||[])await this.recursivelyPumpData(e,n)}};Ivt.VirtualPromptReconciler=xDr;var wDr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},RDr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new wFi.UseState(e.state),this.dataHook=new wFi.UseData(r=>{e._updateTimeMs=r})}useState(e){return this.stateHook.useState(e)}useData(e,r){this.dataHook.useData(e,r)}isRemountRequired(){return this.stateHook.hasChanged()}};function Hsc(t){return typeof t=="function"&&"isFragmentFunction"in t}a(Hsc,"isFragmentFunction")});var kFi=I(xvt=>{"use strict";p();Object.defineProperty(xvt,"__esModule",{value:!0});xvt.VirtualPrompt=void 0;var Gsc=RFi(),kDr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new Gsc.VirtualPromptReconciler(e)}snapshotNode(e,r){if(!e)return;if(r?.isCancellationRequested)return"cancelled";let n=[];for(let o of e.children??[]){let s=this.snapshotNode(o,r);if(s==="cancelled")return"cancelled";s!==void 0&&n.push(s)}return{value:e.props?.value?.toString(),name:e.name,path:e.path,props:e.props,children:n,statistics:{updateDataTimeMs:e.lifecycle?.lifecycleData.getUpdateTimeMsAndReset()}}}snapshot(e){try{let r=this.reconciler.reconcile(e);if(e?.isCancellationRequested)return{snapshot:void 0,status:"cancelled"};if(!r)throw new Error("Invalid virtual prompt tree");let n=this.snapshotNode(r,e);return n==="cancelled"||e?.isCancellationRequested?{snapshot:void 0,status:"cancelled"}:{snapshot:n,status:"ok"}}catch(r){return{snapshot:void 0,status:"error",error:r}}}createPipe(){return this.reconciler.createPipe()}};xvt.VirtualPrompt=kDr});var pU=I(wvt=>{"use strict";p();Object.defineProperty(wvt,"__esModule",{value:!0});wvt.Text=$sc;wvt.Chunk=Vsc;function $sc(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a($sc,"Text");function Vsc(t){return t.children}a(Vsc,"Chunk")});var _V=I(hU=>{"use strict";p();Object.defineProperty(hU,"__esModule",{value:!0});hU.PerCompletionContextProviderStatistics=hU.ContextProviderStatistics=hU.ICompletionsContextProviderService=void 0;hU.componentStatisticsToPromptMatcher=Ysc;var Wsc=an(),zsc=aU();hU.ICompletionsContextProviderService=(0,Wsc.createServiceIdentifier)("ICompletionsContextProviderService");var PDr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new Rvt){this.createStatistics=e,this.statistics=new zsc.LRUCacheMap(25)}getStatisticsForCompletion(e){let r=this.statistics.get(e);if(r)return r;let n=this.createStatistics();return this.statistics.set(e,n),n}getPreviousStatisticsForCompletion(e){let r=Array.from(this.statistics.keys());for(let n=r.length-1;n>=0;n--){let o=r[n];if(o!==e)return this.statistics.peek(o)}}};hU.ContextProviderStatistics=PDr;var Rvt=class{static{a(this,"PerCompletionContextProviderStatistics")}constructor(){this._expectations=new Map,this._lastResolution=new Map,this._statistics=new Map,this.opportunityId=void 0}addExpectations(e,r){let n=this._expectations.get(e)??[];this._expectations.set(e,[...n,...r])}clearExpectations(){this._expectations.clear()}setLastResolution(e,r){this._lastResolution.set(e,r)}setOpportunityId(e){this.opportunityId=e}get(e){return this._statistics.get(e)}getAllUsageStatistics(){return this._statistics.entries()}computeMatch(e){try{for(let[r,n]of this._expectations){if(n.length===0)continue;let o=this._lastResolution.get(r)??"none";if(o==="none"||o==="error"){this._statistics.set(r,{usage:"none",resolution:o});continue}let s=[];for(let[d,f]of n){let h={id:d.id,type:d.type};if(d.origin&&(h.origin=d.origin),f==="content_excluded"){s.push({...h,usage:"none_content_excluded"});continue}let m=e.find(g=>g.source===d);m===void 0?s.push({...h,usage:"error"}):s.push({...h,usage:m.expectedTokens>0&&m.expectedTokens===m.actualTokens?"full":m.actualTokens>0?"partial":"none",expectedTokens:m.expectedTokens,actualTokens:m.actualTokens})}let l=s.reduce((d,f)=>f.usage==="full"?d+1:f.usage==="partial"?d+.5:d,0)/n.length,u=l===1?"full":l===0?"none":"partial";this._statistics.set(r,{resolution:o,usage:u,usageDetails:s})}}finally{this.clearExpectations(),this._lastResolution.clear()}}};hU.PerCompletionContextProviderStatistics=Rvt;function Ysc(t){return t.map(e=>{if(!(e.source===void 0||e.expectedTokens===void 0||e.actualTokens===void 0))return{source:e.source,expectedTokens:e.expectedTokens,actualTokens:e.actualTokens}}).filter(e=>e!==void 0)}a(Ysc,"componentStatisticsToPromptMatcher")});var PBe=I(kBe=>{"use strict";p();Object.defineProperty(kBe,"__esModule",{value:!0});kBe.filterContextItemsByType=Xsc;kBe.filterSupportedContextItems=eac;kBe.addOrValidateContextItemsIDs=rac;var Ksc=qg(),Jsc=hd(),DDr=Lg(),Zsc=WLe(),NDr=Gl(),RBe;(function(t){function e(r){return!(r.importance!==void 0&&(typeof r.importance!="number"||!Number.isInteger(r.importance)||r.importance<0||r.importance>100)||r.id!==void 0&&typeof r.id!="string"||r.origin!==void 0&&!Zsc.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})(RBe||(RBe={}));var MDr;(function(t){function e(r){if(!RBe.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(MDr||(MDr={}));var ODr;(function(t){function e(r){if(!RBe.is(r))return!1;let n=r;if(typeof n.uri!="string"||typeof n.value!="string")return!1;if(n.additionalUris===void 0)return!0;if(!Array.isArray(n.additionalUris))return!1;for(let o of n.additionalUris)if(typeof o!="string")return!1;return!0}a(e,"is"),t.is=e})(ODr||(ODr={}));var LDr;(function(t){function e(r){if(!RBe.is(r))return!1;let n=r;if(!Jsc.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof Ksc.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(LDr||(LDr={}));var BDr;(function(t){function e(r){if(MDr.is(r))return"Trait";if(ODr.is(r))return"CodeSnippet";if(LDr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(BDr||(BDr={}));function Xsc(t,e){return t.map(r=>{let n=r.data.filter(o=>o.type===e);return n.length>0?{...r,data:n}:void 0}).filter(r=>r!==void 0)}a(Xsc,"filterContextItemsByType");function eac(t){let e=[],r=0;return t.forEach(n=>{let o=BDr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(eac,"filterSupportedContextItems");function tac(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(tac,"validateContextItemId");function rac(t,e){let r=new Set,n=t.get(NDr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,DDr.generateUuid)();if(!tac(c)){let l=(0,DDr.generateUuid)();NDr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,DDr.generateUuid)();NDr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(rac,"addOrValidateContextItemsIDs")});var FDr=I(kvt=>{"use strict";p();Object.defineProperty(kvt,"__esModule",{value:!0});kvt.getCodeSnippetsFromContextItems=aac;kvt.addRelativePathToCodeSnippets=cac;var nac=RS(),iac=_V(),oac=PBe(),sac="content_excluded";async function aac(t,e,r,n){let o=(0,oac.filterContextItemsByType)(r,"CodeSnippet");if(o.length===0)return[];let s=new Set,c=o.flatMap(h=>h.data.map(m=>(s.add(m.uri),m.additionalUris?.forEach(g=>s.add(g)),{providerId:h.providerId,data:m}))),l=t.get(iac.ICompletionsContextProviderService),u=t.get(nac.ICompletionsTextDocumentManagerService),d=new Map;await Promise.all(Array.from(s).map(async h=>{d.set(h,await u.getTextDocumentValidation({uri:h}))}));let f=l.getStatisticsForCompletion(e);return c.filter(h=>{let g=[h.data.uri,...h.data.additionalUris??[]].every(A=>d.get(A)?.status==="valid");return g?f.addExpectations(h.providerId,[[h.data,"included"]]):f.addExpectations(h.providerId,[[h.data,sac]]),g}).map(h=>h.data)}a(aac,"getCodeSnippetsFromContextItems");function cac(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(cac,"addRelativePathToCodeSnippets")});var UDr=I(Nvt=>{"use strict";p();Object.defineProperty(Nvt,"__esModule",{value:!0});Nvt.CodeSnippets=void 0;var Pvt=LL(),Dvt=pU(),lac=mU(),uac=FDr(),dac=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(lac.isCompletionRequestData,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=(0,uac.addRelativePathToCodeSnippets)(t.tdms,r),l=new Map;for(let d of c){let f=d.relativePath??d.snippet.uri,h=l.get(f);h===void 0&&(h=[],l.set(f,h)),h.push(d)}let u=[];for(let[d,f]of l.entries()){let h=f.filter(m=>m.snippet.value.length>0);h.length>0&&u.push({chunkElements:h.map(m=>m.snippet),importance:Math.max(...h.map(m=>m.snippet.importance??0)),uri:d})}if(u.length!==0)return u.sort((d,f)=>f.importance-d.importance),u.reverse(),u.map(d=>{let f=[];return f.push((0,Pvt.jsx)(Dvt.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,Pvt.jsx)(Dvt.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(s_e,"__esModule",{value:!0});s_e.CompletionsContext=PFi;s_e.StableCompletionsContext=DFi;s_e.AdditionalCompletionsContext=NFi;s_e.isContextNode=fac;function PFi(t){return t.children}a(PFi,"CompletionsContext");function DFi(t){return t.children}a(DFi,"StableCompletionsContext");function NFi(t){return t.children}a(NFi,"AdditionalCompletionsContext");function fac(t){return t.name===PFi.name||t.name===DFi.name||t.name===NFi.name}a(fac,"isContextNode")});var qDr=I(NBe=>{"use strict";p();Object.defineProperty(NBe,"__esModule",{value:!0});NBe.SnapshotWalker=void 0;NBe.defaultTransformers=MFi;var pac=pU(),QDr=class{static{a(this,"SnapshotWalker")}constructor(e,r=MFi()){this.snapshot=e,this.transformers=r}walkSnapshot(e){this.walkSnapshotNode(this.snapshot,void 0,e,{})}walkSnapshotNode(e,r,n,o){let s=this.transformers.reduce((l,u)=>u(e,r,l),{...o});if(n(e,r,s))for(let l of e.children??[])this.walkSnapshotNode(l,e,n,s)}};NBe.SnapshotWalker=QDr;function MFi(){return[(t,e,r)=>{r.weight===void 0&&(r.weight=1);let n=t.props?.weight??1,o=typeof n=="number"?Math.max(0,Math.min(1,n)):1;return{...r,weight:o*r.weight}},(t,e,r)=>{if(t.name===pac.Chunk.name){let n=r.chunks?new Set(r.chunks):new Set;return n.add(t.path),{...r,chunks:n}}return r},(t,e,r)=>t.props?.source!==void 0?{...r,source:t.props.source}:r]}a(MFi,"defaultTransformers")});var OFi=I(jDr=>{"use strict";p();Object.defineProperty(jDr,"__esModule",{value:!0});jDr.findEditDistanceScore=hac;function hac(t,e){if(t.length===0||e.length===0)return{score:t.length+e.length};let r=Array.from({length:t.length}).map(()=>Array.from({length:e.length}).map(()=>0));for(let n=0;n{"use strict";p();Object.defineProperty(pN,"__esModule",{value:!0});pN.MAX_EDIT_DISTANCE_LENGTH=void 0;pN.CurrentFile=yac;pN.BeforeCursor=$Dr;pN.AfterCursor=VDr;pN.DocumentPrefix=_ac;pN.DocumentSuffix=Eac;var fk=LL(),a_e=pU(),mac=Y$(),gac=OFi(),Aac=kne(),HDr=mU();pN.MAX_EDIT_DISTANCE_LENGTH=50;function GDr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(GDr,"approximateMaxCharacters");function yac(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(HDr.isCompletionRequestData,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=GDr(c);return(0,fk.jsxs)(fk.Fragment,{children:[(0,fk.jsx)($Dr,{document:r,position:o,maxCharacters:m}),(0,fk.jsx)(VDr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(yac,"CurrentFile");function $Dr(t){if(t.document===void 0||t.position===void 0)return(0,fk.jsx)(a_e.Text,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),(0,fk.jsx)(a_e.Text,{children:e})}a($Dr,"BeforeCursor");function VDr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,fk.jsx)(a_e.Text,{});let o=t.document.getText({start:t.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}});o.length>t.maxCharacters&&(o=o.slice(0,t.maxCharacters));let s=o.replace(/^.*/,"").trimStart();if(s==="")return(0,fk.jsx)(a_e.Text,{});if(r===s)return(0,fk.jsx)(a_e.Text,{children:r});let c=s;if(r!==""){let l=(0,Aac.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,pN.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,pN.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,gac.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??mac.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,fk.jsx)(a_e.Text,{children:c})}a(VDr,"AfterCursor");function _ac(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(HDr.isCompletionRequestData,d=>{let f=d.document;(d.document.uri!==r?.uri||f.getText()!==r?.getText())&&n(f),d.position!==o&&s(d.position),d.maxPromptTokens!==c&&l(d.maxPromptTokens)});let u=GDr(c);return(0,fk.jsx)($Dr,{document:r,position:o,maxCharacters:u})}a(_ac,"DocumentPrefix");function Eac(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(HDr.isCompletionRequestData,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=GDr(c);return(0,fk.jsx)(VDr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(Eac,"DocumentSuffix")});var zDr=I(Kne=>{"use strict";p();Object.defineProperty(Kne,"__esModule",{value:!0});Kne.WishlistElision=void 0;Kne.makePrompt=vac;Kne.makePrefixPrompt=Cac;Kne.makeContextPrompt=bac;var WDr=class{static{a(this,"WishlistElision")}elide(e,r,n,o,s){if(r<=0)throw new Error("Prefix limit must be greater than 0");let[c,l]=this.preparePrefixBlocks(e,s),{elidedSuffix:u,adjustedPrefixTokenLimit:d}=this.elideSuffix(n,o,r,l,s),f=this.elidePrefix(c,d,l,s);return{blocks:[u,...f],cycles:1}}preparePrefixBlocks(e,r){let n=0,o=new Set;return[e.map((c,l)=>{let u=0,f=c.value.split(/([^\n]*\n+)/).filter(m=>m!=="").map(m=>{let g=r.tokenLength(m);return u+=g,n+=g,{line:m,componentPath:c.componentPath,tokens:g}}),h=c.componentPath;if(o.has(h))throw new Error(`Duplicate component path in prefix blocks: ${h}`);return o.add(h),{...c,tokens:u,markedForRemoval:!1,originalIndex:l,lines:f}}),n]}elideSuffix(e,r,n,o,s){let c=e.value;if(c.length===0||r<=0)return{elidedSuffix:{...e,tokens:0,elidedValue:"",elidedTokens:0},adjustedPrefixTokenLimit:n+Math.max(0,r)};o!f.markedForRemoval).flatMap(f=>f.lines);if(c.length===0)return[];let[l,u]=this.trimPrefixLinesToFit(c,r,o),d=u;return s.map(f=>{if(f.markedForRemoval)return d+f.tokens<=r&&!f.chunks?(d+=f.tokens,{...f,elidedValue:f.value,elidedTokens:f.tokens}):{...f,elidedValue:"",elidedTokens:0};let h=l.filter(g=>g.componentPath===f.componentPath&&g.line!=="").map(g=>g.line).join(""),m=f.tokens;return h!==f.value&&(m=h!==""?o.tokenLength(h):0),{...f,elidedValue:h,elidedTokens:m}})}removeLowWeightPrefixBlocks(e,r,n){let o=n;e.sort((s,c)=>s.weight-c.weight);for(let s of e){if(o<=r)break;if(s.weight!==1&&!(s.chunks&&s.markedForRemoval))if(s.chunks&&s.chunks.size>0)for(let c of e)!c.markedForRemoval&&c.chunks&&[...s.chunks].every(l=>c.chunks?.has(l))&&(c.markedForRemoval=!0,o-=c.tokens);else s.markedForRemoval=!0,o-=s.tokens}return e.sort((s,c)=>s.originalIndex-c.originalIndex)}trimPrefixLinesToFit(e,r,n){let o=0,s=[];for(let c=e.length-1;c>=0;c--){let l=e[c],u=l.tokens;if(o+u<=r)s.unshift(l),o+=u;else break}if(s.length===0){let c=e[e.length-1];if(c&&c.line.length>0){let u=n.takeLastTokens(c.line,r);return s.push({line:u.text,componentPath:c.componentPath,tokens:u.tokens.length}),[s,u.tokens.length]}let l=`Cannot fit prefix within limit of ${r} tokens`;throw new Error(l)}return[s,o]}};Kne.WishlistElision=WDr;function vac(t){return t.map(e=>e.elidedValue).join("")}a(vac,"makePrompt");function Cac(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(Cac,"makePrefixPrompt");function bac(t){if(t.length===0)return[];let e=new Map;for(let o of t)if(o.type==="context"&&o.index!==void 0){e.has(o.index)||e.set(o.index,[]);let s=o.elidedValue.trim();s.length>0&&e.get(o.index).push(s)}let r=Math.max(...Array.from(e.keys()),-1),n=[];for(let o=0;o<=r;o++){let s=e.get(o);if(s&&s.length>0){let c=s.join(` +`).trim();n.push(c)}else n.push("")}return n}a(bac,"makeContextPrompt")});var JDr=I(EV=>{"use strict";p();Object.defineProperty(EV,"__esModule",{value:!0});EV.transformers=EV.CompletionsPromptRenderer=void 0;EV.normalizeLineEndings=KDr;var UFi=qDr(),LFi=yBe(),BFi=kne(),Sac=DBe(),Mvt=MBe(),FFi=zDr(),Tac=5,YDr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=FFi.makePrompt}render(e,r,n){let o=this.renderId++,s=performance.now();try{if(n?.isCancellationRequested)return{status:"cancelled"};let c=r.delimiter??"",l=r.tokenizer??BFi.TokenizerName.o200k,{prefixBlocks:u,suffixBlock:d,componentStatistics:f}=this.processSnapshot(e,c,r.languageId),{prefixTokenLimit:h,suffixTokenLimit:m}=this.getPromptLimits(d,r),g=performance.now(),A=new FFi.WishlistElision,{blocks:[y,..._]}=A.elide(u,h,d,m,(0,BFi.getTokenizer)(l)),E=performance.now(),v=this.formatPrefix(_),S=this.formatContext?this.formatContext(_):void 0,T=y.elidedValue,w=_.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...Iac([..._,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:S,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:E-g,renderTimeMs:performance.now()-s,componentStatistics:f,updateDataTimeMs:f.reduce((R,x)=>R+(x.updateDataTimeMs??0),0)}}}catch(c){return{status:"error",error:c}}}getPromptLimits(e,r){let n=e?.value??"",o=r.promptTokenLimit,s=r.suffixPercent;if(n.length===0||s===0)return{prefixTokenLimit:o,suffixTokenLimit:0};o=n.length>0?o-Tac:o;let c=Math.ceil(o*(s/100));return{prefixTokenLimit:o-c,suffixTokenLimit:c}}processSnapshot(e,r,n){let o=[],s=[],c=[],l=!1;if(new UFi.SnapshotWalker(e,EV.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===Mvt.CurrentFile.name&&(l=!0),f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.value===void 0||f.value===""))return!0;let g=m.chunks;if(m.type==="suffix")s.push({value:KDr(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let A=f.value.endsWith(r)?f.value:f.value+r,y=A;m.type==="prefix"?y=f.value:(0,LFi.isShebangLine)(f.value)?y=A:y=(0,LFi.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:KDr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${Mvt.CurrentFile.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}};EV.CompletionsPromptRenderer=YDr;EV.transformers=[...(0,UFi.defaultTransformers)(),(t,e,r)=>(0,Sac.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===Mvt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===Mvt.AfterCursor.name?{...r,type:"suffix"}:r];function Iac(t){return t.map(e=>{let r={componentPath:e.componentPath};return e.tokens!==0&&(r.expectedTokens=e.tokens,r.actualTokens=e.elidedTokens),e.nodeStatistics.updateDataTimeMs!==void 0&&(r.updateDataTimeMs=e.nodeStatistics.updateDataTimeMs),e.source&&(r.source=e.source),r})}a(Iac,"computeComponentStatistics");function KDr(t){return t.replace(/\r\n?/g,` +`)}a(KDr,"normalizeLineEndings")});var Ovt=I(c_e=>{"use strict";p();Object.defineProperty(c_e,"__esModule",{value:!0});c_e.ILanguageContextProviderService=c_e.ProviderTarget=void 0;var xac=an(),QFi;(function(t){t.NES="nes",t.Completions="completions"})(QFi||(c_e.ProviderTarget=QFi={}));c_e.ILanguageContextProviderService=(0,xac.createServiceIdentifier)("ILanguageContextProviderService")});var Jne=I(l_e=>{"use strict";p();Object.defineProperty(l_e,"__esModule",{value:!0});l_e.RuntimeMode=l_e.ICompletionsRuntimeModeService=void 0;var wac=an();l_e.ICompletionsRuntimeModeService=(0,wac.createServiceIdentifier)("completionsRuntimeModeService");var ZDr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:qFi(r,n),verboseLogging:kac(r,n),testMode:e,simulation:Rac(n)})}isRunningInTest(){return this.flags.testMode}shouldFailForDebugPurposes(){return this.isRunningInTest()}isDebugEnabled(){return this.flags.debug}isVerboseLoggingEnabled(){return this.flags.verboseLogging}isRunningInSimulation(){return this.flags.simulation}};l_e.RuntimeMode=ZDr;function qFi(t,e){return t.includes("--debug")||XDr(e,"DEBUG")}a(qFi,"determineDebugFlag");function Rac(t){return XDr(t,"SIMULATION")}a(Rac,"determineSimulationFlag");function kac(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||XDr(e,"VERBOSE")||qFi(t,e)}a(kac,"determineVerboseLoggingEnabled");function XDr(t,e){for(let r of["GH_COPILOT_","GITHUB_COPILOT_"]){let n=t[`${r}${e}`];if(n)return n==="1"||n?.toLowerCase()==="true"}return!1}a(XDr,"determineEnvFlagEnabled")});var $Fi=I(OBe=>{"use strict";p();Object.defineProperty(OBe,"__esModule",{value:!0});OBe.eventToPromise=Pac;OBe.isArrayOfT=GFi;OBe.resolveAll=Nac;var jFi=sBe();async function Pac(t){let e=new jFi.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(Pac,"eventToPromise");async function Dac(t){if(t.isCancellationRequested)return;let e=new jFi.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(Dac,"cancellationTokenToPromise");async function HFi(t,e){if(e){let r=Dac(e);await Promise.race([t,r])}else await t}a(HFi,"raceCancellation");function GFi(t){return Array.isArray(t)}a(GFi,"isArrayOfT");async function Nac(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await Mac(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(Nac,"resolveAll");async function Mac(t,e){let r;return t instanceof Promise?r=await Oac(t,e):r=await Lac(t,e),r}a(Mac,"resolve");async function Oac(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{let s=await t;if(e?.isCancellationRequested)return;n={status:"full",resolutionTime:0,value:GFi(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await HFi(o,e),n.resolutionTime=performance.now()-r,n}a(Oac,"resolvePromise");async function Lac(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{for await(let s of t){if(e?.isCancellationRequested)return;n.status!=="partial"&&(n={status:"partial",resolutionTime:0,value:[]}),n.value.push(s)}e?.isCancellationRequested||(n.status!=="partial"?n={status:"full",resolutionTime:0,value:[]}:n.status="full")}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await HFi(o,e),n.resolutionTime=performance.now()-r,n}a(Lac,"resolveIterable")});var VFi=I(tNr=>{"use strict";p();Object.defineProperty(tNr,"__esModule",{value:!0});tNr.fillInCppVSCodeActiveExperiments=Qac;var Bac=xy(),eNr=Gl(),Fac={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},Uac="ms-vscode.cpptools";function Qac(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Uac))&&qac(t,r,n)}a(Qac,"fillInCppVSCodeActiveExperiments");function qac(t,e,r){try{let n=t.get(Bac.ICompletionsFeaturesService),o=t.get(eNr.ICompletionsLogTargetService),s=Fac,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){eNr.logger.error(o,"Failed to parse cppContextProviderParams",l)}else{let l=n.getContextProviderExpSettings("cpp")?.params;l&&(s={...l})}for(let[l,u]of Object.entries(s))e.set(l,u)}catch(n){eNr.logger.exception(t,n,"fillInCppActiveExperiments")}}a(qac,"addActiveExperiments")});var zFi=I(rNr=>{"use strict";p();Object.defineProperty(rNr,"__esModule",{value:!0});rNr.fillInCSharpActiveExperiments=Hac;var jac=xy(),WFi=Gl();function Hac(t,e,r){let n=t.get(jac.ICompletionsFeaturesService),o=t.get(WFi.ICompletionsLogTargetService);try{let s=n.csharpContextProviderParams(r);if(s){let c=JSON.parse(s);for(let[l,u]of Object.entries(c))e.set(l,u)}else{let c=n.getContextProviderExpSettings("csharp")?.params;if(c)for(let[l,u]of Object.entries(c))e.set(l,u)}}catch(s){return WFi.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a(Hac,"fillInCSharpActiveExperiments")});var YFi=I(vV=>{"use strict";p();Object.defineProperty(vV,"__esModule",{value:!0});vV.multiLanguageContextProviderParamsDefault=void 0;vV.fillInMultiLanguageActiveExperiments=Vac;vV.getMultiLanguageContextProviderParamsFromActiveExperiments=Yac;var Gac=xy(),nNr=Gl(),$ac="fallbackContextProvider";vV.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function Vac(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes($ac))&&Wac(t,r,n)}a(Vac,"fillInMultiLanguageActiveExperiments");function Wac(t,e,r){try{let n=zac(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){nNr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(Wac,"addActiveExperiments");function zac(t,e){let r=vV.multiLanguageContextProviderParamsDefault,n=t.get(nNr.ICompletionsLogTargetService),s=t.get(Gac.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){nNr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(zac,"getMultiLanguageContextProviderParamsFromExp");function Yac(t){let e={...vV.multiLanguageContextProviderParamsDefault};return t.has("mlcpMaxContextItems")&&(e.mlcpMaxContextItems=Number(t.get("mlcpMaxContextItems"))),t.has("mlcpMaxSymbolMatches")&&(e.mlcpMaxSymbolMatches=Number(t.get("mlcpMaxSymbolMatches"))),t.has("mlcpEnableImports")&&(e.mlcpEnableImports=String(t.get("mlcpEnableImports"))==="true"),e}a(Yac,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var JFi=I(u_e=>{"use strict";p();Object.defineProperty(u_e,"__esModule",{value:!0});u_e.TS_CONTEXT_PROVIDER_ID=void 0;u_e.fillInTsActiveExperiments=Jac;var Kac=xy(),KFi=Gl();u_e.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function Jac(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(u_e.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(KFi.ICompletionsLogTargetService),s=t.get(Kac.ICompletionsFeaturesService);try{let c=s.tsContextProviderParams(n);if(c){let l=JSON.parse(c);for(let[u,d]of Object.entries(l))r.set(u,d)}else{let l=s.getContextProviderExpSettings("typescript")?.params;if(l)for(let[u,d]of Object.entries(l))r.set(u,d)}}catch(c){return KFi.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(Jac,"fillInTsActiveExperiments")});var Fvt=I($l=>{"use strict";p();var cNr=$l&&$l.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},hN=$l&&$l.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty($l,"__esModule",{value:!0});$l.DefaultDiagnosticSettings=$l.CachedContextProviderRegistry=$l.MutableContextProviderRegistry=$l.CoreContextProviderRegistry=$l.DefaultContextProvidersContainer=$l.ICompletionsDefaultContextProviders=$l.ICompletionsContextProviderRegistryService=void 0;$l.telemetrizeContextItems=scc;$l.matchContextItems=acc;$l.useContextProviderAPI=lcc;$l.getDefaultDiagnosticSettings=dcc;var Zac=ii(),ZFi=Hl(),lNr=Ovt(),Xac=Rh(),t8i=an(),ecc=Os(),uNr=Ks(),Lvt=eE(),r8i=xy(),tcc=aU(),gU=Gl(),dNr=Jne(),XFi=$Fi(),rcc=VFi(),ncc=zFi(),icc=YFi(),occ=JFi(),e8i=PBe(),n8i=_V();$l.ICompletionsContextProviderRegistryService=(0,t8i.createServiceIdentifier)("ICompletionsContextProviderRegistryService");$l.ICompletionsDefaultContextProviders=(0,t8i.createServiceIdentifier)("ICompletionsDefaultContextProviders");var iNr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};$l.DefaultContextProvidersContainer=iNr;var Bvt=class{static{a(this,"CoreContextProviderRegistry")}constructor(e,r,n,o,s,c){this.match=e,this.registryService=r,this.runtimeMode=n,this.instantiationService=o,this.logTarget=s,this.contextProviderStatistics=c}registerContextProvider(e){throw new Error("Should not be call. Use ILanguageContextProviderService")}unregisterContextProvider(e){throw new Error("Should not be call. Use ILanguageContextProviderService")}get providers(){return this.registryService.getAllProviders([lNr.ProviderTarget.Completions]).slice()}async resolveAllProviders(e,r,n,o,s,c){if(s?.isCancellationRequested)return gU.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction(ncc.fillInCSharpActiveExperiments,l,o);let u=[],d=this.providers;if(d.length===0)return u;let f=await this.matchProviders(d,n,o),h=f.filter(w=>w[1]>0);if(f.filter(w=>w[1]<=0).forEach(([w,R])=>{let x={providerId:w.id,matchScore:R,resolution:"none",resolutionTimeMs:0,data:[]};u.push(x)}),h.length===0)return u;if(s?.isCancellationRequested)return gU.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(rcc.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(icc.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(occ.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new Zac.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(ucc,n.languageId,o),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,_;A>0&&(_=setTimeout(()=>{g.cancel(),g.dispose()},A));let E=new Map,v={completionId:e,opportunityId:r,documentContext:n,activeExperiments:l,timeBudget:A,timeoutEnd:y,data:c};for(let[w]of h){let R=this.contextProviderStatistics.getPreviousStatisticsForCompletion(e)?.get(w.id);R&&(v.previousUsageStatistics=R);let x=w.resolver.resolve(v,g.token);E.set(w.id,x)}let S=this.contextProviderStatistics.getStatisticsForCompletion(e);S.setOpportunityId(r);let T=await(0,XFi.resolveAll)(E,g.token);_&&clearTimeout(_);for(let[w,R]of h){let x=T.get(w.id);if(x){if(x.status==="error")(0,ecc.isCancellationError)(x.reason)||gU.logger.error(this.logTarget,`Error resolving context from ${w.id}: `,x.reason),u.push({providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:[]});else{let k=[...x.value??[]];if((x.status==="none"||x.status==="partial")&&(gU.logger.info(this.logTarget,`Context provider ${w.id} exceeded time budget of ${A}ms`),w.resolver.resolveOnTimeout))try{let q=w.resolver.resolveOnTimeout(v);(0,XFi.isArrayOfT)(q)?k.push(...q):q&&k.push(q),k.length>0&&(x.status="partial")}catch(q){gU.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,q)}let[D,N]=(0,e8i.filterSupportedContextItems)(k);N&&gU.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let O=this.instantiationService.invokeFunction(e8i.addOrValidateContextItemsIDs,D),B={providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:O};u.push(B)}S.setLastResolution(w.id,x.status)}else gU.logger.error(this.logTarget,`Context provider ${w.id} not found in results`)}return u.sort((w,R)=>R.matchScore-w.matchScore)}async matchProviders(e,r,n){let o=this.instantiationService.invokeFunction(i8i,r.languageId,n),s=o.length===1&&o[0]==="*";return await Promise.all(e.map(async l=>{if(!s&&!o.includes(l.id))return[l,0];let u=await this.match(this.instantiationService,l.selector,r);return[l,u]}))}};$l.CoreContextProviderRegistry=Bvt;$l.CoreContextProviderRegistry=Bvt=cNr([hN(1,lNr.ILanguageContextProviderService),hN(2,dNr.ICompletionsRuntimeModeService),hN(3,uNr.IInstantiationService),hN(4,gU.ICompletionsLogTargetService),hN(5,n8i.ICompletionsContextProviderService)],Bvt);var oNr=class extends Bvt{static{a(this,"MutableContextProviderRegistry")}constructor(e,r,n,o,s,c){super(e,r,n,o,s,c),this._providers=[]}registerContextProvider(e){if(e.id.includes(",")||e.id.includes("*"))throw new Error(`A context provider id cannot contain a comma or an asterisk. The id ${e.id} is invalid.`);if(this._providers.find(r=>r.id===e.id))throw new Error(`A context provider with id ${e.id} has already been registered`);this._providers.push(e)}unregisterContextProvider(e){this._providers=this._providers.filter(r=>r.id!==e)}get providers(){return this._providers.slice().concat(super.providers)}};$l.MutableContextProviderRegistry=oNr;$l.MutableContextProviderRegistry=oNr=cNr([hN(1,lNr.ILanguageContextProviderService),hN(2,dNr.ICompletionsRuntimeModeService),hN(3,uNr.IInstantiationService),hN(4,gU.ICompletionsLogTargetService),hN(5,n8i.ICompletionsContextProviderService)],oNr);var sNr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new tcc.LRUCacheMap(5),this.delegate=n.createInstance(e,r)}registerContextProvider(e){this.delegate.registerContextProvider(e)}unregisterContextProvider(e){this.delegate.unregisterContextProvider(e)}get providers(){return this.delegate.providers}async resolveAllProviders(e,r,n,o,s,c){let l=this._cachedContextItems.get(e);if(e&&l&&l.length>0)return l;let u=await this.delegate.resolveAllProviders(e,r,n,o,s,c);return u.length>0&&e&&this._cachedContextItems.set(e,u),u}};$l.CachedContextProviderRegistry=sNr;$l.CachedContextProviderRegistry=sNr=cNr([hN(2,uNr.IInstantiationService)],sNr);function scc(t,e,r){let n=t.getStatisticsForCompletion(e);return r.map(s=>{let{providerId:c,resolution:l,resolutionTimeMs:u,matchScore:d,data:f}=s,h=n.get(c),m=h?.usage??"none";(d<=0||l==="none"||l==="error")&&(m="none");let g={providerId:c,resolution:l,resolutionTimeMs:u,usage:m,usageDetails:h?.usageDetails,matched:d>0,numResolvedItems:f.length},A=h?.usageDetails!==void 0?h?.usageDetails.filter(_=>_.usage==="full"||_.usage==="partial"||_.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(_=>_.usage==="partial"||_.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(scc,"telemetrizeContextItems");function acc(t){return t.matchScore>0&&t.resolution!=="error"}a(acc,"matchContextItems");function i8i(t,e,r){let n=ccc(t,e,r),o=(0,Lvt.getConfig)(t,Lvt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get($l.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(i8i,"getActiveContextProviders");function ccc(t,e,r){if(t.get(dNr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(r8i.ICompletionsFeaturesService),o=n.contextProviders(r),s=n.getContextProviderExpSettings(e);if(s!==void 0)for(let c of s.ids)o.includes(c)||o.push(c);return o}a(ccc,"getExpContextProviders");function lcc(t,e,r){return i8i(t,e,r).length>0}a(lcc,"useContextProviderAPI");function ucc(t,e,r){let n=(0,Lvt.getConfig)(t,Lvt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(r8i.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(ucc,"getContextProviderTimeBudget");var aNr;(function(t){function e(n){if(n)try{let o=JSON.parse(n);if(o.warnings===void 0&&o.maxDiagnostics===void 0&&o.maxLineDistance===void 0)return;let s=r(o),c=typeof o.maxLineDistance=="number"&&o.maxLineDistance>=0?o.maxLineDistance:10,l=typeof o.maxDiagnostics=="number"&&o.maxDiagnostics>0?o.maxDiagnostics:5;return{warnings:s,maxLineDistance:c,maxDiagnostics:l}}catch{return}}a(e,"from"),t.from=e;function r(n){let o=n?.warnings;return o==="yes"||o==="no"||o==="yesIfNoErrors"?o:"no"}a(r,"getWarnings")})(aNr||($l.DefaultDiagnosticSettings=aNr={}));function dcc(t){let e=t.get(ZFi.IConfigurationService),r=t.get(Xac.IExperimentationService),n=e.getExperimentBasedConfig(ZFi.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return aNr.from(n)}a(dcc,"getDefaultDiagnosticSettings")});var Uvt=I(mN=>{"use strict";p();var fcc=mN&&mN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},pcc=mN&&mN.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(mN,"__esModule",{value:!0});mN.ContextProviderBridge=mN.ICompletionsContextProviderBridgeService=void 0;var hcc=an(),mcc=aU(),gcc=Fvt();mN.ICompletionsContextProviderBridgeService=(0,hcc.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var fNr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new mcc.LRUCacheMap(25)}schedule(e,r,n,o,s,c){let{textDocument:l,originalPosition:u,originalOffset:d,originalVersion:f,editsWithPosition:h}=e,m=this.contextProviderRegistry.resolveAllProviders(r,n,{uri:l.uri,languageId:l.detectedLanguageId,version:f,offset:d,position:u,proposedEdits:h.length>0?h:void 0},o,s,c?.data);this.scheduledResolutions.set(r,m)}async resolution(e){let r=this.scheduledResolutions.get(e);return r?await r:[]}};mN.ContextProviderBridge=fNr;mN.ContextProviderBridge=fNr=fcc([pcc(0,gcc.ICompletionsContextProviderRegistryService)],fNr)});var mNr=I(Qvt=>{"use strict";p();Object.defineProperty(Qvt,"__esModule",{value:!0});Qvt.Diagnostics=void 0;var pNr=LL(),Acc=qg(),hNr=pU(),ycc=Y$(),_cc=mU();function Ecc(t){if(t.code!==void 0){if(typeof t.code=="string")return t.code;if(typeof t.code=="number")return t.code.toString();if(typeof t.code=="object"&&t.code!==null&&t.code.value)return t.code.value.toString()}}a(Ecc,"getCode");function vcc(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a(vcc,"getRelativePath");var Ccc=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(_cc.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,ycc.normalizeLanguageId)(h.document.detectedLanguageId);m!==o&&s(m),h.position!==c&&l(h.position),h.document.uri!==u?.uri&&d(h.document)}),!r||r.length===0||!o)return;let f=r.filter(h=>h.values.length>0);if(f.length!==0)return f.sort((h,m)=>(m.importance??0)-(h.importance??0)),f.reverse(),f.map(h=>{let m=[];m.push((0,pNr.jsx)(hNr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${vcc(t.tdms,h)}:`},h.id));let g=h.values;return u!==void 0&&u.uri.toString()===h.uri.toString()&&c!==void 0&&(g=h.values.slice(),g.sort((A,y)=>{let _=Math.abs(A.range.start.line-c.line),E=Math.abs(y.range.start.line-c.line);return _-E})),g.forEach(A=>{let y="",_=Ecc(A);_!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${_}`);let E=A.range.start;m.push((0,pNr.jsx)(hNr.Text,{children:`${E.line+1}:${E.character+1} - ${Acc.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,pNr.jsx)(hNr.Chunk,{children:m})})},"Diagnostics");Qvt.Diagnostics=Ccc});var gNr=I(jvt=>{"use strict";p();Object.defineProperty(jvt,"__esModule",{value:!0});jvt.DocumentMarker=void 0;var qvt=LL(),o8i=pU(),s8i=yBe(),bcc=mU(),Scc=a((t,e)=>{let[r,n]=e.useState();if(e.useData(bcc.isCompletionRequestData,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.tdms.getRelativePath(r),s={uri:r.uri,source:r.getText(),relativePath:o,languageId:r.detectedLanguageId},c=t.tdms.findNotebook(r);return s.relativePath&&!c?(0,qvt.jsx)(Tcc,{docInfo:s}):(0,qvt.jsx)(Icc,{docInfo:s})}},"DocumentMarker");jvt.DocumentMarker=Scc;var Tcc=a(t=>(0,qvt.jsx)(o8i.Text,{children:(0,s8i.getPathMarker)(t.docInfo)}),"PathMarker"),Icc=a(t=>(0,qvt.jsx)(o8i.Text,{children:(0,s8i.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var ANr=I(LBe=>{"use strict";p();Object.defineProperty(LBe,"__esModule",{value:!0});LBe.RecentEdits=void 0;LBe.editIsTooCloseToCursor=l8i;var a8i=LL(),c8i=pU(),Hvt=yBe(),xcc=mU();function l8i(t,e=!1,r=void 0,n){if(e&&(r===void 0||n===void 0))throw new Error("cursorLine and activeDocDistanceLimitFromCursor are required when filterByCursorLine is true");let o=t.startLine-1,s=t.endLine-1;return!!(e&&(Math.abs(o-r)<=n||Math.abs(s-r)<=n))}a(l8i,"editIsTooCloseToCursor");var wcc=a((t,e)=>{let[r,n]=e.useState();return e.useData(xcc.isCompletionRequestData,async o=>{if(!o.document)return;let s=t.recentEditsProvider;if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.tdms,f=[];for(let m=l.length-1;m>=0&&!(f.length>=c.maxEdits);m--){let g=l[m];if(!await d.getTextDocument({uri:g.file}))continue;let A=!u.has(g.file);if(u.size+(A?1:0)>c.maxFiles)break;let _=g.file===o.document?.uri,E=_?o.position.line:void 0;if(l8i(g,_,E,c.activeDocDistanceLimitFromCursor))continue;let S=s.getEditSummary(g);if(S){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift((0,Hvt.newLineEnded)(`File: ${T}`)+(0,Hvt.newLineEnded)(S))}}if(f.length===0){n(void 0);return}let h=(0,Hvt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,Hvt.newLineEnded)("End of recent edits");n(h)}),r?(0,a8i.jsx)(c8i.Chunk,{children:(0,a8i.jsx)(c8i.Text,{children:r})}):void 0},"RecentEdits");LBe.RecentEdits=wcc});var u8i=I(QL=>{"use strict";p();Object.defineProperty(QL,"__esModule",{value:!0});QL.registerDocumentTracker=QL.accessTimes=void 0;QL.sortByAccessTimes=Pcc;var Rcc=aU(),kcc=RS();QL.accessTimes=new Rcc.LRUCacheMap;function Pcc(t){return[...t].sort((e,r)=>{let n=QL.accessTimes.get(e.uri)??0;return(QL.accessTimes.get(r.uri)??0)-n})}a(Pcc,"sortByAccessTimes");var Dcc=a(t=>t.get(kcc.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&QL.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");QL.registerDocumentTracker=Dcc});var d8i=I(AU=>{"use strict";p();var Ncc=AU&&AU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Mcc=AU&&AU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(AU,"__esModule",{value:!0});AU.OpenTabFiles=void 0;var Occ=u8i(),Lcc=RS(),yNr=d_e(),_Nr=class{static{a(this,"OpenTabFiles")}constructor(e){this.docManager=e}truncateDocs(e,r,n,o){let s=new Map,c=0;for(let l of e)if(!(c+l.getText().length>yNr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,yNr.considerNeighborFile)(n,l.detectedLanguageId)&&(s.set(l.uri.toString(),{uri:l.uri.toString(),relativePath:this.docManager.getRelativePath(l),source:l.getText()}),c+=l.getText().length),s.size>=o))break;return s}async getNeighborFiles(e,r,n){let o=new Map,s=new Map;return o=this.truncateDocs((0,Occ.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(yNr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};AU.OpenTabFiles=_Nr;AU.OpenTabFiles=_Nr=Ncc([Mcc(0,Lcc.ICompletionsTextDocumentManagerService)],_Nr)});var f8i=I(ENr=>{"use strict";p();Object.defineProperty(ENr,"__esModule",{value:!0});ENr.shortCircuit=Bcc;function Bcc(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(Bcc,"shortCircuit")});var Yvt=I(Vl=>{"use strict";p();var Fcc=Vl&&Vl.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Gvt=Vl&&Vl.__param||function(t,e){return function(r,n){e(r,n,t)}},vNr;Object.defineProperty(Vl,"__esModule",{value:!0});Vl.RelatedFilesProvider=Vl.ICompletionsRelatedFilesProviderService=Vl.relatedFilesLogger=Vl.PromiseExpirationCacheMap=Vl.EmptyRelatedFilesResponse=void 0;Vl.getRelatedFilesAndTraits=zcc;var Ucc=Dne(),Qcc=an(),qcc=hd(),SNr=Ks(),jcc=tV(),Hcc=aU(),zvt=Gl(),Gcc=nA(),$cc=f8i();Vl.EmptyRelatedFilesResponse={entries:[],traits:[]};var $vt={entries:new Map,traits:[]},Vvt=class extends Hcc.LRUCacheMap{static{a(this,"PromiseExpirationCacheMap")}constructor(e,r=120*1e3){super(e),this.defaultEvictionTimeMs=r,this._cacheTimestamps=new Map}bumpRetryCount(e){let r=this._cacheTimestamps.get(e);return r?++r.retryCount:(this._cacheTimestamps.set(e,{timestamp:Date.now(),retryCount:0}),0)}has(e){return this.isValid(e)?super.has(e):(this.deleteExpiredEntry(e),!1)}get(e){let r=super.get(e);if(this.isValid(e))return r;this.deleteExpiredEntry(e)}set(e,r){let n=super.set(e,r);return this.isValid(e)||this._cacheTimestamps.set(e,{timestamp:Date.now(),retryCount:0}),n}clear(){super.clear(),this._cacheTimestamps.clear()}isValid(e){let r=this._cacheTimestamps.get(e);return r!==void 0&&Date.now()-r.timestampVl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};Vl.RelatedFilesProvider=CNr;Vl.RelatedFilesProvider=CNr=vNr=Fcc([Gvt(0,SNr.IInstantiationService),Gvt(1,Ucc.IIgnoreService),Gvt(2,zvt.ICompletionsLogTargetService),Gvt(3,jcc.ICompletionsFileSystemService)],CNr);var Wcc=3,BBe=new Vvt(Vcc);async function p8i(t,e,r,n,o){let s=t.get(SNr.IInstantiationService),c=t.get(zvt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>Vl.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(BBe.bumpRetryCount(e.uri)>=Wcc?u=$vt:u=void 0);let d=performance.now()-l;if(Vl.relatedFilesLogger.debug(c,u!==void 0?`Fetched ${[...u.entries.values()].map(f=>f.size).reduce((f,h)=>f+h,0)} related files for '${e.uri}' in ${d}ms.`:`Failing fetching files for '${e.uri}' in ${d}ms.`),u===void 0)throw new Wvt;return u}a(p8i,"getRelatedFiles");var bNr=a(function(t,e,r,n,o){let s=`${e.uri}`;if(BBe.has(s))return BBe.get(s);let c=p8i(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw BBe.delete(s),l})),BBe.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");bNr=(0,$cc.shortCircuit)(bNr,200,$vt);async function zcc(t,e,r,n,o,s=!1){let c=t.get(SNr.IInstantiationService),l=t.get(zvt.ICompletionsLogTargetService),u=t.get(Vl.ICompletionsRelatedFilesProviderService),d=$vt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(p8i,f,r,n,u):await c.invokeFunction(bNr,f,r,n,u)}catch(f){d=$vt,f instanceof Wvt&&c.invokeFunction(Gcc.telemetry,"getRelatedFilesList",r)}return Vl.relatedFilesLogger.debug(l,d!=null?`Fetched following traits ${d.traits.map(f=>`{${f.name} : ${f.value}}`).join("")} for '${e.uri}'`:`Failing fecthing traits for '${e.uri}'.`),d}a(zcc,"getRelatedFilesAndTraits")});var d_e=I(CV=>{"use strict";p();Object.defineProperty(CV,"__esModule",{value:!0});CV.NeighborSource=CV.NeighboringFileType=void 0;CV.considerNeighborFile=Xcc;CV.isIncludeNeighborFilesActive=elc;var Ycc=Ks(),h8i=Y$(),g8i=xy(),Kcc=Gl(),Jcc=RS(),Zcc=d8i(),Kvt=Yvt(),m8i;(function(t){t.None="none",t.OpenTabs="opentabs",t.CursorMostRecent="cursormostrecent",t.CursorMostCount="cursormostcount",t.WorkspaceSharingSameFolder="workspacesharingsamefolder",t.WorkspaceSmallestPathDist="workspacesmallestpathdist",t.OpenTabsAndCocommitted="opentabsandcocommitted",t.RelatedCSharp="related/csharp",t.RelatedCSharpRoslyn="related/csharproslyn",t.RelatedCpp="related/cpp",t.RelatedTypeScript="related/typescript",t.RelatedCppSemanticCodeContext="related/cppsemanticcodecontext",t.RelatedOther="related/other"})(m8i||(CV.NeighboringFileType=m8i={}));function Xcc(t,e){return(0,h8i.normalizeLanguageId)(t)===(0,h8i.normalizeLanguageId)(e)}a(Xcc,"considerNeighborFile");var TNr=class t{static{a(this,"NeighborSource")}static{this.MAX_NEIGHBOR_AGGREGATE_LENGTH=2e5}static{this.MAX_NEIGHBOR_FILES=20}static{this.EXCLUDED_NEIGHBORS=["node_modules","dist","site-packages"]}static defaultEmptyResult(){return{docs:new Map,neighborSource:new Map,traits:[]}}static reset(){t.instance=void 0}static async getNeighborFilesAndTraits(e,r,n,o,s,c,l){let u=e.get(g8i.ICompletionsFeaturesService),d=e.get(Kcc.ICompletionsLogTargetService),f=e.get(Ycc.IInstantiationService),h=e.get(Jcc.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(Zcc.OpenTabFiles));let m={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(u.excludeRelatedFiles(n,o))return m;let g=await h.getTextDocument({uri:r});if(!g)return Kvt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: failed to get the document ${r}`),m;let A=h.getWorkspaceFolder(g);if(!A)return Kvt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(Kvt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(Kvt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),m.traits.push(...y.traits),m):(y.entries.forEach((_,E)=>{let v=[];_.forEach((S,T)=>{let w=t.getRelativePath(T,A.uri);if(!w||m.docs.has(T))return;let R={relativePath:w,uri:T,source:S};v.unshift(R),m.docs.set(T,R)}),v.length>0&&m.neighborSource.set(E,v.map(S=>S.uri.toString()))}),m.traits.push(...y.traits),m)}static basename(e){return decodeURIComponent(e.replace(/[#?].*$/,"").replace(/^.*[/:]/,""))}static getRelativePath(e,r){let n=r.toString().replace(/[#?].*/,"").replace(/\/?$/,"/");return e.toString().startsWith(n)?e.toString().slice(n.length):t.basename(e)}};CV.NeighborSource=TNr;function elc(t,e,r){return t.get(g8i.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(elc,"isIncludeNeighborFilesActive")});var xNr=I(Jvt=>{"use strict";p();Object.defineProperty(Jvt,"__esModule",{value:!0});Jvt.SimilarFiles=void 0;var f_e=LL(),INr=pU(),tlc=nvt(),rlc=lPr(),nlc=ovt(),ilc=mU(),olc=p_e(),A8i=d_e(),slc=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(ilc.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=A8i.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await A8i.NeighborSource.getNeighborFilesAndTraits(h,u.document.uri,u.document.detectedLanguageId,u.telemetryData,u.cancellationToken,u.data)));let f=await c(u.telemetryData,u.document,u,d);s(f)});async function c(u,d,f,h){let m=t.instantiationService.invokeFunction(olc.getPromptOptions,u,d.detectedLanguageId);return(await l(m,u,d,f,h)).filter(A=>A.snippet.length>0).sort((A,y)=>A.score-y.score).map(A=>({...(0,rlc.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction(nlc.getSimilarFilesOptions,d,f.detectedLanguageId),y=t.tdms.getRelativePath(f),_={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await(0,tlc.getSimilarSnippets)(_,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,f_e.jsxs)(f_e.Fragment,{children:[...o.map((u,d)=>(0,f_e.jsx)(alc,{snippet:u}))]})},"SimilarFiles");Jvt.SimilarFiles=slc;var alc=a((t,e)=>(0,f_e.jsxs)(INr.Chunk,{children:[(0,f_e.jsx)(INr.Text,{children:t.snippet.headline}),(0,f_e.jsx)(INr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var T8i=I(wI=>{"use strict";p();Object.defineProperty(wI,"__esModule",{value:!0});wI.getAllRecentEditsByTimestamp=clc;wI.findChangeSpan=wNr;wI.getDiff=_8i;wI.unifiedDiff=E8i;wI.findReplaceDiff=v8i;wI.editsOverlap=C8i;wI.updateEdits=b8i;wI.buildIncomingEdit=RNr;wI.trimOldFilesFromState=S8i;wI.recentEditsReducer=dlc;wI.summarizeEdit=flc;function clc(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(clc,"getAllRecentEditsByTimestamp");function wNr(t,e){let r=0;for(;r=r&&o>=r&&t[n]===e[o];)n--,o--;return r>n&&r>o?null:{start:r,endPrev:n,endNew:o}}a(wNr,"findChangeSpan");function _8i(t,e,r,n,o,s,c){let l=Math.max(0,n-c),u=Math.min(r.length,s+c+1);return{file:t,pre:l,post:u,before:e.slice(l,n),removed:e.slice(n,o+1),added:r.slice(n,s+1),after:r.slice(s+1,u)}}a(_8i,"getDiff");function llc(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(llc,"measureDiffSize");function E8i(t,e=!1,r=!1,n=!1){let o=[];o.push(`--- a/${t.file}`),o.push(`+++ b/${t.file}`);let s=t.before.length+t.removed.length+t.after.length,c=t.before.length+t.added.length+t.after.length;o.push(`@@ -${t.pre+1},${s} +${t.pre+1},${c} @@`);for(let l of t.before)o.push(" "+l);if(r)for(let l of t.added)o.push("+"+l);if(!e){let l=n?" --- IGNORE ---":"";for(let u of t.removed)o.push("-"+u+l)}if(!r)for(let l of t.added)o.push("+"+l);for(let l of t.after)o.push(" "+l);return o.join(` `)+` -`}a(y8i,"unifiedDiff");function clc(t,e=!1){let{before:r,removed:n,added:o,after:s}=t,c=[];return c.push(">>>>>>> SEARCH"),c.push(...r),e?c.push("..."):c.push(...n),c.push(...s),c.push("======="),c.push(...r),c.push(...o),c.push(...s),c.push("<<<<<<<<< REPLACE"),c.join(` -`)}a(clc,"aidersDiff");function _8i(t,e=!1){let{before:r,removed:n,added:o,after:s}=t,c=e?["..."]:n.map(f=>`${f} --- DO NOT REPLY WITH CODE FROM THIS LINE ---`),l=[...r,...c,...s],u=[...r,...o,...s],d=[];return d.push("--- User edited code: ---"),d.push(...l),c.length===0?d.push(`--- and added ${o.length} line${o.length===1?"":"s"} to make: ---`):o.length===0?d.push(`--- and deleted ${c.length} line${c.length===1?"":"s"} to make: ---`):d.push("--- and replaced it with: ---"),d.push(...u),d.push("--- End of edit ---"),d.join(` -`)}a(_8i,"findReplaceDiff");function g8i(t,e){for(let r of e){let n=t.slice(0,r.startLine),o=t.slice(r.endLine+1),s=r.diff.added?r.diff.added:[];t=[...n,...s,...o]}return t}a(g8i,"applyEditsToLines");function E8i(t,e,r){let{added:n}=e.diff,o=e.startLine,s=e.startLine+n.length,c=t.startLine,l=t.endLine+1;return c<=s+r&&l>=o-r}a(E8i,"editsOverlap");function v8i(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if(E8i(r,c,o.editMergeLineDistance)){let u=g8i(t.split(` -`),s.slice(0,-1)),d=xNr(u,n);d&&(r=wNr(r.file,u,n,d,o),s=[...s.slice(0,-1),r])}else s.push(r)}else s.push(r);if(s.length>o.maxEdits){let c=s.slice(0,s.length-o.maxEdits);s=s.slice(s.length-o.maxEdits,s.length),t=g8i(t.split(` +`}a(E8i,"unifiedDiff");function ulc(t,e=!1){let{before:r,removed:n,added:o,after:s}=t,c=[];return c.push(">>>>>>> SEARCH"),c.push(...r),e?c.push("..."):c.push(...n),c.push(...s),c.push("======="),c.push(...r),c.push(...o),c.push(...s),c.push("<<<<<<<<< REPLACE"),c.join(` +`)}a(ulc,"aidersDiff");function v8i(t,e=!1){let{before:r,removed:n,added:o,after:s}=t,c=e?["..."]:n.map(f=>`${f} --- DO NOT REPLY WITH CODE FROM THIS LINE ---`),l=[...r,...c,...s],u=[...r,...o,...s],d=[];return d.push("--- User edited code: ---"),d.push(...l),c.length===0?d.push(`--- and added ${o.length} line${o.length===1?"":"s"} to make: ---`):o.length===0?d.push(`--- and deleted ${c.length} line${c.length===1?"":"s"} to make: ---`):d.push("--- and replaced it with: ---"),d.push(...u),d.push("--- End of edit ---"),d.join(` +`)}a(v8i,"findReplaceDiff");function y8i(t,e){for(let r of e){let n=t.slice(0,r.startLine),o=t.slice(r.endLine+1),s=r.diff.added?r.diff.added:[];t=[...n,...s,...o]}return t}a(y8i,"applyEditsToLines");function C8i(t,e,r){let{added:n}=e.diff,o=e.startLine,s=e.startLine+n.length,c=t.startLine,l=t.endLine+1;return c<=s+r&&l>=o-r}a(C8i,"editsOverlap");function b8i(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if(C8i(r,c,o.editMergeLineDistance)){let u=y8i(t.split(` +`),s.slice(0,-1)),d=wNr(u,n);d&&(r=RNr(r.file,u,n,d,o),s=[...s.slice(0,-1),r])}else s.push(r)}else s.push(r);if(s.length>o.maxEdits){let c=s.slice(0,s.length-o.maxEdits);s=s.slice(s.length-o.maxEdits,s.length),t=y8i(t.split(` `),c).join(` -`)}return{originalContent:t,edits:s}}a(v8i,"updateEdits");function wNr(t,e,r,n,o){let{start:s,endPrev:c,endNew:l}=n;if(!o||typeof o.diffContextLines!="number")throw new Error("Invalid configuration passed to buildIncomingEdit");let u=A8i(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a(wNr,"buildIncomingEdit");function C8i(t,e){let r={...t},n=Object.entries(t).filter(([s])=>t[s].edits.length).sort(([s,c],[l,u])=>c.edits[c.edits.length-1].timestamp-u.edits[u.edits.length-1].timestamp),o=Math.max(0,n.length-e);if(o)for(let s=0;s2*1024*1024)return t;let o=t[e];if(!o)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};if(o.currentContent===r)return t;let s=o.currentContent.split(` +`)}return{originalContent:t,edits:s}}a(b8i,"updateEdits");function RNr(t,e,r,n,o){let{start:s,endPrev:c,endNew:l}=n;if(!o||typeof o.diffContextLines!="number")throw new Error("Invalid configuration passed to buildIncomingEdit");let u=_8i(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a(RNr,"buildIncomingEdit");function S8i(t,e){let r={...t},n=Object.entries(t).filter(([s])=>t[s].edits.length).sort(([s,c],[l,u])=>c.edits[c.edits.length-1].timestamp-u.edits[u.edits.length-1].timestamp),o=Math.max(0,n.length-e);if(o)for(let s=0;s2*1024*1024)return t;let o=t[e];if(!o)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};if(o.currentContent===r)return t;let s=o.currentContent.split(` `),c=r.split(` -`),l=xNr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=wNr(e,s,c,l,n);if(alc(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=v8i(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return C8i(h,n.maxFiles)}a(llc,"recentEditsReducer");function ulc(t,e){let r=t.diff.removed.filter(s=>s.trim().length>0),n=t.diff.added.filter(s=>s.trim().length>0),o;if(e.removeDeletedLines&&n.length===0)o=null;else if(r.length===0&&n.length===0)o=null;else if(r.join("").trim()===n.join("").trim())o=null;else if(t.diff.added.length>e.maxLinesPerEdit||t.diff.removed.length>e.maxLinesPerEdit)o=null;else if(e.summarizationFormat==="aiders-diff")o=clc(t.diff);else if(e.summarizationFormat==="diff")o=y8i(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=_8i(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(ulc,"summarizeEdit")});var Jvt=I(gN=>{"use strict";p();var dlc=gN&&gN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},flc=gN&&gN.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(gN,"__esModule",{value:!0});gN.FullRecentEditsProvider=gN.ICompletionsRecentEditsProviderService=void 0;var plc=W4(),hlc=an(),mlc=Po(),glc=o6(),Alc=TRr(),RNr=b8i();gN.ICompletionsRecentEditsProviderService=(0,hlc.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var ylc=Object.freeze({maxFiles:20,maxEdits:8,diffContextLines:3,editMergeLineDistance:1,maxCharsPerEdit:2e3,debounceTimeout:500,summarizationFormat:"diff",removeDeletedLines:!1,insertionsBeforeDeletions:!0,appendNoReplyMarker:!0,activeDocDistanceLimitFromCursor:100,maxLinesPerEdit:10}),kNr=class extends mlc.Disposable{static{a(this,"FullRecentEditsProvider")}constructor(e,r){super(),this.observableWorkspace=r,this._started=!1,this.recentEditMap={},this.recentEdits=[],this.recentEditSummaries=new WeakMap,this.debounceTimeouts={},this._config=e??Object.assign({},ylc)}get config(){return this._config}isEnabled(){return!0}getRecentEdits(){return this.recentEdits}getEditSummary(e){return this.recentEditSummaries.get(e)??null}updateRecentEdits(e,r){this.recentEditMap=(0,RNr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,RNr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,RNr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,glc.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,plc.autorunWithChanges)(this,{value:e.value,selection:e.selection,languageId:e.languageId},n=>{if(n.value.changes.length>0){let o=n.value.previous?.value,s=n.value.value.value,c=e.id.toString();clearTimeout(this.debounceTimeouts[c]),!this.recentEditMap[c]&&o?this.updateRecentEdits(c,o):this._config.debounceTimeout===0?this.updateRecentEdits(c,s):this.debounceTimeouts[c]=setTimeout(()=>{this.updateRecentEdits(c,s)},this._config.debounceTimeout??500)}}))},e=>e.id).recomputeInitiallyAndOnChange(this._store))}};gN.FullRecentEditsProvider=kNr;gN.FullRecentEditsProvider=kNr=dlc([flc(1,Alc.ICompletionsObservableWorkspace)],kNr)});var PNr=I(Xvt=>{"use strict";p();Object.defineProperty(Xvt,"__esModule",{value:!0});Xvt.Traits=void 0;var Zvt=LL(),S8i=pU(),_lc=z$(),Elc=mU(),vlc=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(Elc.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,_lc.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,Zvt.jsxs)(Zvt.Fragment,{children:[(0,Zvt.jsx)(S8i.Text,{children:`Consider this related information: -`}),...r.map(c=>(0,Zvt.jsx)(S8i.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");Xvt.Traits=vlc});var x8i=I(DNr=>{"use strict";p();Object.defineProperty(DNr,"__esModule",{value:!0});DNr.splitContextCompletionsPrompt=Plc;var pk=LL(),Clc=Ks(),blc=RS(),Slc=Jvt(),Tlc=FDr(),T8i=DBe(),I8i=MBe(),Ilc=hNr(),xlc=mNr(),wlc=gNr(),Rlc=INr(),klc=PNr();function Plc(t){let e=t.get(Clc.IInstantiationService),r=t.get(blc.ICompletionsTextDocumentManagerService),n=t.get(Slc.ICompletionsRecentEditsProviderService);return(0,pk.jsxs)(pk.Fragment,{children:[(0,pk.jsxs)(T8i.StableCompletionsContext,{children:[(0,pk.jsx)(xlc.DocumentMarker,{tdms:r,weight:.7}),(0,pk.jsx)(klc.Traits,{weight:.6}),(0,pk.jsx)(Ilc.Diagnostics,{tdms:r,weight:.65}),(0,pk.jsx)(Tlc.CodeSnippets,{tdms:r,weight:.9}),(0,pk.jsx)(Rlc.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,pk.jsx)(I8i.DocumentSuffix,{weight:1}),(0,pk.jsx)(T8i.AdditionalCompletionsContext,{children:(0,pk.jsx)(wlc.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,pk.jsx)(I8i.DocumentPrefix,{weight:1})]})}a(Plc,"splitContextCompletionsPrompt")});var P8i=I(tCt=>{"use strict";p();Object.defineProperty(tCt,"__esModule",{value:!0});tCt.SplitContextPromptRenderer=void 0;var Dlc=QDr(),Nlc=DBe(),eCt=KDr(),w8i=MBe(),R8i=WDr(),k8i=0;function Mlc(){k8i=0}a(Mlc,"resetContextIndex");function Olc(){return k8i++}a(Olc,"getNextContextIndex");var NNr=class extends eCt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=R8i.makePrefixPrompt,this.formatContext=R8i.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(Mlc(),new Dlc.SnapshotWalker(e,Llc).walkSnapshot((d,f,h)=>{if(d===e||(d.statistics.updateDataTimeMs&&d.statistics.updateDataTimeMs>0&&s.push({componentPath:d.path,updateDataTimeMs:d.statistics.updateDataTimeMs}),d.name===w8i.BeforeCursor.name&&(c=!0),d.value===void 0||d.value===""))return!0;let m=h.chunks,g=h.type;if(g==="suffix")o.push({value:(0,eCt.normalizeLineEndings)(d.value),type:"suffix",weight:h.weight,componentPath:d.path,nodeStatistics:d.statistics,chunks:m,source:h.source});else{let A=g==="prefix",y=A||d.value.endsWith(r)?d.value:d.value+r;n.push({type:A?"prefix":"context",value:(0,eCt.normalizeLineEndings)(y),weight:h.weight,componentPath:d.path,nodeStatistics:d.statistics,chunks:m,source:h.source,index:A?void 0:h.index})}return!0}),!c)throw new Error(`Node of type ${w8i.BeforeCursor.name} not found`);if(o.length>1)throw new Error("Only one suffix is allowed");let u=o.length===1?o[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:n,suffixBlock:u,componentStatistics:s}}};tCt.SplitContextPromptRenderer=NNr;var Llc=[...eCt.transformers,(t,e,r)=>(0,Nlc.isContextNode)(t)?{...r,index:Olc()}:r]});var CV=I(yU=>{"use strict";p();Object.defineProperty(yU,"__esModule",{value:!0});yU.AbstractLanguageDiagnosticsService=yU.ILanguageDiagnosticsService=void 0;yU.rangeSpanningDiagnostics=Ulc;yU.isError=Qlc;yU.getDiagnosticsAtSelection=qlc;var Blc=an(),Flc=x2(),MNr=Qg();yU.ILanguageDiagnosticsService=(0,Blc.createServiceIdentifier)("ILanguageDiagnosticService");var ONr=class{static{a(this,"AbstractLanguageDiagnosticsService")}waitForNewDiagnostics(e,r,n=5e3){let o,s,c;return new Promise(l=>{o=r.onCancellationRequested(()=>l([])),c=setTimeout(()=>l(this.getDiagnostics(e)),n),s=this.onDidChangeDiagnostics(u=>{for(let d of u.uris)if((0,Flc.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};yU.AbstractLanguageDiagnosticsService=ONr;function Ulc(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a(Ulc,"rangeSpanningDiagnostics");function Qlc(t){return t.severity===MNr.DiagnosticSeverity.Error}a(Qlc,"isError");function qlc(t,e,r=[MNr.DiagnosticSeverity.Error,MNr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a(qlc,"getDiagnosticsAtSelection")});var N8i=I(LNr=>{"use strict";p();Object.defineProperty(LNr,"__esModule",{value:!0});LNr.getDiagnosticsFromContextItems=$lc;var jlc=RS(),D8i=yV(),Hlc=PBe(),Glc="content_excluded";async function $lc(t,e,r){let n=(0,Hlc.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)Vlc(t,e,h.data,h.providerId);let o=new Set,s=[];for(let h of n)for(let m of h.data)o.add(m.uri.toString()),s.push({providerId:h.providerId,bag:m});if(s.length===0)return[];let c=t.get(D8i.ICompletionsContextProviderService),l=t.get(jlc.ICompletionsTextDocumentManagerService),u=new Map;await Promise.all(Array.from(o).map(async h=>{u.set(h,await l.getTextDocumentValidation({uri:h}))}));let d=c.getStatisticsForCompletion(e);return s.filter(h=>{let m=u.get(h.bag.uri.toString())?.status==="valid";return m?d.addExpectations(h.providerId,[[h.bag,"included"]]):d.addExpectations(h.providerId,[[h.bag,Glc]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a($lc,"getDiagnosticsFromContextItems");function Vlc(t,e,r,n){let o=t.get(D8i.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(Vlc,"setupExpectationsForDiagnosticBags")});var M8i=I(rCt=>{"use strict";p();Object.defineProperty(rCt,"__esModule",{value:!0});rCt.getTraitsFromContextItems=Klc;rCt.ReportTraitsTelemetry=Xlc;var Wlc=nA(),zlc=yV(),Ylc=PBe();function Klc(t,e,r){let n=(0,Ylc.filterContextItemsByType)(r,"Trait");for(let s of n)Jlc(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(Klc,"getTraitsFromContextItems");function Jlc(t,e,r,n){let o=t.get(zlc.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(Jlc,"setupExpectationsForTraits");var Zlc=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Xlc(t,e,r,n,o,s){if(r.length>0){let c={};c.detectedLanguageId=n,c.languageId=o;for(let u of r){let d=Zlc.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,Wlc.telemetry)(t,e,l)}}a(Xlc,"ReportTraitsTelemetry")});var mU=I(MS=>{"use strict";p();var F8i=MS&&MS.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},NS=MS&&MS.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(MS,"__esModule",{value:!0});MS.TestComponentsCompletionsPromptFactory=MS.ComponentsCompletionsPromptFactory=MS.PromptOrdering=void 0;MS.isCompletionRequestData=yuc;var qL=LL(),O8i=Qg(),qNr=Gl(),U8i=Pne(),BNr=hd(),jNr=Ks(),Q8i=Are(),L8i=wFi(),euc=nA(),tuc=RS(),ruc=FDr(),nuc=DBe(),iuc=KDr(),q8i=Fvt(),ouc=MBe(),suc=hNr(),auc=mNr(),cuc=gNr(),luc=INr(),uuc=x8i(),duc=P8i(),fuc=PNr(),j8i=CV(),puc=Og(),FBe=Bvt(),huc=BDr(),muc=N8i(),B8i=M8i(),HNr=yV(),AN=p_e(),guc=Jvt(),Auc=d_e();function yuc(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.document||!e.position||e.position.line===void 0||e.position.character===void 0||!e.telemetryData)}a(yuc,"isCompletionRequestData");var bV;(function(t){t.Default="default",t.SplitContext="splitContext"})(bV||(MS.PromptOrdering=bV={}));var FNr={[bV.Default]:{promptFunction:H8i,renderer:iuc.CompletionsPromptRenderer},[bV.SplitContext]:{promptFunction:uuc.splitContextCompletionsPrompt,renderer:duc.SplitContextPromptRenderer}};function H8i(t){let e=t.get(tuc.ICompletionsTextDocumentManagerService),r=t.get(jNr.IInstantiationService),n=t.get(guc.ICompletionsRecentEditsProviderService);return(0,qL.jsxs)(qL.Fragment,{children:[(0,qL.jsxs)(nuc.CompletionsContext,{children:[(0,qL.jsx)(auc.DocumentMarker,{tdms:e,weight:.7}),(0,qL.jsx)(fuc.Traits,{weight:.6}),(0,qL.jsx)(suc.Diagnostics,{tdms:e,weight:.65}),(0,qL.jsx)(ruc.CodeSnippets,{tdms:e,weight:.9}),(0,qL.jsx)(luc.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,qL.jsx)(cuc.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,qL.jsx)(ouc.CurrentFile,{weight:1})]})}a(H8i,"defaultCompletionsPrompt");var nCt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l,u,d){this.instantiationService=n,this.completionsTelemetryService=o,this.ignoreService=s,this.contextProviderBridge=c,this.logTarget=l,this.contextProviderStatistics=u,this.languageDiagnosticsService=d,this.promptOrdering=r??bV.Default,this.virtualPrompt=e??new L8i.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe(),this.renderer=this.getRenderer()}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}async createPromptUnsafe({completionId:e,completionState:r,telemetryData:n,promptOpts:o},s){let{maxPromptLength:c,suffixPercent:l,suffixMatchThreshold:u}=this.instantiationService.invokeFunction(AN.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?bV.SplitContext:bV.Default;this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,diagnostics:A,turnOffSimilarFiles:y,resolvedContextItems:_}=await this.resolveContext(e,r,n,s,o);if(await this.updateComponentData(r.textDocument,r.position,m,g,A,n,y,c,s,o,u,o?.tokenizer),s?.isCancellationRequested)return AN._promptCancelled;let E=this.virtualPrompt.snapshot(s),v=E.status;if(v==="cancelled")return AN._promptCancelled;if(v==="error")return this.errorPrompt(E.error);let S=this.renderer.render(E.snapshot,{delimiter:` -`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(S.status==="cancelled")return AN._promptCancelled;if(S.status==="error")return this.errorPrompt(S.error);let[T,w]=(0,AN.trimLastLine)(S.prefix),R={...S,prefix:T},x,k=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(FBe.useContextProviderAPI,k,n)){let N=(0,HNr.componentStatisticsToPromptMatcher)(S.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,FBe.telemetrizeContextItems)(this.contextProviderStatistics,e,_),qNr.logger.debug(this.logTarget,`Context providers telemetry: '${JSON.stringify(x)}'`)}let D=performance.now();return this.resetIfEmpty(S),this.successPrompt(R,D,h,w,x)}async updateComponentData(e,r,n,o,s,c,l,u,d,f={},h,m){let g=this.createRequestData(e,r,c,d,f,u,n,o,s,l,h,m);await this.pipe.pump(g)}async resolveContext(e,r,n,o,s={}){let c=[],l,u,d,f=!1;if(this.instantiationService.invokeFunction(FBe.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(FBe.matchContextItems);this.instantiationService.invokeFunction(_uc,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(B8i.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(B8i.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction(huc.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(muc.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(FBe.getDefaultDiagnosticSettings);return d=this.addDefaultDiagnosticBag(c,d,e,r,h),{traits:l,codeSnippets:u,diagnostics:d,turnOffSimilarFiles:f,resolvedContextItems:c}}async failFastPrompt(e,r,n,o){if(o?.isCancellationRequested)return AN._promptCancelled;if(await this.ignoreService.isCopilotIgnored(BNr.URI.parse(e.uri)))return AN._copilotContentExclusion;if((n>0?e.getText().length:e.offsetAt(r))0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return(0,euc.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),AN._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new L8i.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=FNr[this.promptOrdering]?.promptFunction??H8i;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=FNr[this.promptOrdering]??FNr[bV.Default];return new e.renderer}addDefaultDiagnosticBag(e,r,n,o,s){if(s===void 0)return r;let c=o.textDocument;if(r!==void 0&&r.some(E=>E.uri.toString()===c.uri))return r;let l=performance.now(),u=this.languageDiagnosticsService.getDiagnostics(BNr.URI.parse(c.uri));if(u.length===0)return r;let d=[],f=[],h=s.warnings==="yes"||s.warnings==="yesIfNoErrors",m=o.position;for(let E of u)Math.abs(E.range.start.line-m.line)<=s.maxLineDistance&&(E.severity===O8i.DiagnosticSeverity.Error?d.push(E):E.severity===O8i.DiagnosticSeverity.Warning&&h&&f.push(E));let g=[...d,...s.warnings==="yes"||s.warnings==="yesIfNoErrors"&&d.length===0?f:[]];if(g.length===0)return r;g.sort((E,v)=>{let S=Math.abs(E.range.start.line-m.line),T=Math.abs(v.range.start.line-m.line);return S-T});let A={type:"DiagnosticBag",uri:BNr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,puc.generateUuid)()},y="copilot.chat.defaultDiagnostics",_=this.contextProviderStatistics.getStatisticsForCompletion(n);return _.addExpectations(y,[[A,"included"]]),e.push({providerId:y,matchScore:10,resolution:"full",resolutionTimeMs:performance.now()-l,data:[A]}),_.setLastResolution(y,"full"),r===void 0?[A]:(r.push(A),r)}};nCt=F8i([NS(2,jNr.IInstantiationService),NS(3,Q8i.ICompletionsTelemetryService),NS(4,U8i.IIgnoreService),NS(5,q8i.ICompletionsContextProviderBridgeService),NS(6,qNr.ICompletionsLogTargetService),NS(7,HNr.ICompletionsContextProviderService),NS(8,j8i.ILanguageDiagnosticsService)],nCt);var UNr=class extends nCt{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};MS.ComponentsCompletionsPromptFactory=UNr;MS.ComponentsCompletionsPromptFactory=UNr=F8i([NS(0,jNr.IInstantiationService),NS(1,Q8i.ICompletionsTelemetryService),NS(2,U8i.IIgnoreService),NS(3,q8i.ICompletionsContextProviderBridgeService),NS(4,qNr.ICompletionsLogTargetService),NS(5,HNr.ICompletionsContextProviderService),NS(6,j8i.ILanguageDiagnosticsService)],UNr);var QNr=class extends nCt{static{a(this,"TestComponentsCompletionsPromptFactory")}};MS.TestComponentsCompletionsPromptFactory=QNr;function _uc(t,e,r,n){let o=["cpp","c"];return(0,Auc.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(_uc,"similarFilesEnabled")});var YNr=I(aE=>{"use strict";p();var G8i=aE&&aE.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},$8i=aE&&aE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(aE,"__esModule",{value:!0});aE.TestCompletionsPromptFactory=aE.CompletionsPromptFactory=aE.DEFAULT_PROMPT_TIMEOUT=aE.ICompletionsPromptFactoryService=void 0;var Euc=ii(),V8i=Ks(),GNr=p_e(),vuc=mU(),Cuc=an();aE.ICompletionsPromptFactoryService=(0,Cuc.createServiceIdentifier)("ICompletionsPromptFactoryService");var $Nr=class{static{a(this,"SequentialCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){return this.lastPromise=this.promptAsync(e,r),this.lastPromise}async promptAsync(e,r){if(await this.lastPromise,r?.isCancellationRequested)return GNr._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return GNr._promptError}}};aE.DEFAULT_PROMPT_TIMEOUT=1200;var VNr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new Euc.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(GNr._promptTimeout)},aE.DEFAULT_PROMPT_TIMEOUT)})])}},iCt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new $Nr(new VNr(n.createInstance(vuc.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};iCt=G8i([$8i(2,V8i.IInstantiationService)],iCt);var WNr=class extends iCt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};aE.CompletionsPromptFactory=WNr;aE.CompletionsPromptFactory=WNr=G8i([$8i(0,V8i.IInstantiationService)],WNr);var zNr=class extends iCt{static{a(this,"TestCompletionsPromptFactory")}};aE.TestCompletionsPromptFactory=zNr});var p_e=I(kh=>{"use strict";p();Object.defineProperty(kh,"__esModule",{value:!0});kh.PromptResponse=kh._promptTimeout=kh._promptCancelled=kh._promptError=kh._copilotContentExclusion=kh._contextTooShort=kh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=kh.MIN_PROMPT_CHARS=void 0;kh.trimLastLine=Ruc;kh.extractPrompt=kuc;kh.getPromptOptions=Nuc;var buc=yBe(),Suc=xy(),W8i=ivt(),Tuc=bBe(),Iuc=RS(),xuc=YNr(),wuc=d_e();kh.MIN_PROMPT_CHARS=10;kh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];kh._contextTooShort={type:"contextTooShort"};kh._copilotContentExclusion={type:"copilotContentExclusion"};kh._promptError={type:"promptError"};kh._promptCancelled={type:"promptCancelled"};kh._promptTimeout={type:"promptTimeout"};var z8i;(function(t){function e(r){return r.type==="prompt"?[{header:"PREFIX",content:r.prompt.prefix},{header:"SUFFIX",content:r.prompt.suffix},{header:"CONTEXT",content:(r.prompt.context||[]).join(` +`),l=wNr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=RNr(e,s,c,l,n);if(llc(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=b8i(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return S8i(h,n.maxFiles)}a(dlc,"recentEditsReducer");function flc(t,e){let r=t.diff.removed.filter(s=>s.trim().length>0),n=t.diff.added.filter(s=>s.trim().length>0),o;if(e.removeDeletedLines&&n.length===0)o=null;else if(r.length===0&&n.length===0)o=null;else if(r.join("").trim()===n.join("").trim())o=null;else if(t.diff.added.length>e.maxLinesPerEdit||t.diff.removed.length>e.maxLinesPerEdit)o=null;else if(e.summarizationFormat==="aiders-diff")o=ulc(t.diff);else if(e.summarizationFormat==="diff")o=E8i(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=v8i(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(flc,"summarizeEdit")});var Zvt=I(gN=>{"use strict";p();var plc=gN&&gN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},hlc=gN&&gN.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(gN,"__esModule",{value:!0});gN.FullRecentEditsProvider=gN.ICompletionsRecentEditsProviderService=void 0;var mlc=W4(),glc=an(),Alc=Po(),ylc=o6(),_lc=IRr(),kNr=T8i();gN.ICompletionsRecentEditsProviderService=(0,glc.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var Elc=Object.freeze({maxFiles:20,maxEdits:8,diffContextLines:3,editMergeLineDistance:1,maxCharsPerEdit:2e3,debounceTimeout:500,summarizationFormat:"diff",removeDeletedLines:!1,insertionsBeforeDeletions:!0,appendNoReplyMarker:!0,activeDocDistanceLimitFromCursor:100,maxLinesPerEdit:10}),PNr=class extends Alc.Disposable{static{a(this,"FullRecentEditsProvider")}constructor(e,r){super(),this.observableWorkspace=r,this._started=!1,this.recentEditMap={},this.recentEdits=[],this.recentEditSummaries=new WeakMap,this.debounceTimeouts={},this._config=e??Object.assign({},Elc)}get config(){return this._config}isEnabled(){return!0}getRecentEdits(){return this.recentEdits}getEditSummary(e){return this.recentEditSummaries.get(e)??null}updateRecentEdits(e,r){this.recentEditMap=(0,kNr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,kNr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,kNr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,ylc.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,mlc.autorunWithChanges)(this,{value:e.value,selection:e.selection,languageId:e.languageId},n=>{if(n.value.changes.length>0){let o=n.value.previous?.value,s=n.value.value.value,c=e.id.toString();clearTimeout(this.debounceTimeouts[c]),!this.recentEditMap[c]&&o?this.updateRecentEdits(c,o):this._config.debounceTimeout===0?this.updateRecentEdits(c,s):this.debounceTimeouts[c]=setTimeout(()=>{this.updateRecentEdits(c,s)},this._config.debounceTimeout??500)}}))},e=>e.id).recomputeInitiallyAndOnChange(this._store))}};gN.FullRecentEditsProvider=PNr;gN.FullRecentEditsProvider=PNr=plc([hlc(1,_lc.ICompletionsObservableWorkspace)],PNr)});var DNr=I(eCt=>{"use strict";p();Object.defineProperty(eCt,"__esModule",{value:!0});eCt.Traits=void 0;var Xvt=LL(),I8i=pU(),vlc=Y$(),Clc=mU(),blc=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(Clc.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,vlc.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,Xvt.jsxs)(Xvt.Fragment,{children:[(0,Xvt.jsx)(I8i.Text,{children:`Consider this related information: +`}),...r.map(c=>(0,Xvt.jsx)(I8i.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");eCt.Traits=blc});var R8i=I(NNr=>{"use strict";p();Object.defineProperty(NNr,"__esModule",{value:!0});NNr.splitContextCompletionsPrompt=Nlc;var pk=LL(),Slc=Ks(),Tlc=RS(),Ilc=Zvt(),xlc=UDr(),x8i=DBe(),w8i=MBe(),wlc=mNr(),Rlc=gNr(),klc=ANr(),Plc=xNr(),Dlc=DNr();function Nlc(t){let e=t.get(Slc.IInstantiationService),r=t.get(Tlc.ICompletionsTextDocumentManagerService),n=t.get(Ilc.ICompletionsRecentEditsProviderService);return(0,pk.jsxs)(pk.Fragment,{children:[(0,pk.jsxs)(x8i.StableCompletionsContext,{children:[(0,pk.jsx)(Rlc.DocumentMarker,{tdms:r,weight:.7}),(0,pk.jsx)(Dlc.Traits,{weight:.6}),(0,pk.jsx)(wlc.Diagnostics,{tdms:r,weight:.65}),(0,pk.jsx)(xlc.CodeSnippets,{tdms:r,weight:.9}),(0,pk.jsx)(Plc.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,pk.jsx)(w8i.DocumentSuffix,{weight:1}),(0,pk.jsx)(x8i.AdditionalCompletionsContext,{children:(0,pk.jsx)(klc.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,pk.jsx)(w8i.DocumentPrefix,{weight:1})]})}a(Nlc,"splitContextCompletionsPrompt")});var N8i=I(rCt=>{"use strict";p();Object.defineProperty(rCt,"__esModule",{value:!0});rCt.SplitContextPromptRenderer=void 0;var Mlc=qDr(),Olc=DBe(),tCt=JDr(),k8i=MBe(),P8i=zDr(),D8i=0;function Llc(){D8i=0}a(Llc,"resetContextIndex");function Blc(){return D8i++}a(Blc,"getNextContextIndex");var MNr=class extends tCt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=P8i.makePrefixPrompt,this.formatContext=P8i.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(Llc(),new Mlc.SnapshotWalker(e,Flc).walkSnapshot((d,f,h)=>{if(d===e||(d.statistics.updateDataTimeMs&&d.statistics.updateDataTimeMs>0&&s.push({componentPath:d.path,updateDataTimeMs:d.statistics.updateDataTimeMs}),d.name===k8i.BeforeCursor.name&&(c=!0),d.value===void 0||d.value===""))return!0;let m=h.chunks,g=h.type;if(g==="suffix")o.push({value:(0,tCt.normalizeLineEndings)(d.value),type:"suffix",weight:h.weight,componentPath:d.path,nodeStatistics:d.statistics,chunks:m,source:h.source});else{let A=g==="prefix",y=A||d.value.endsWith(r)?d.value:d.value+r;n.push({type:A?"prefix":"context",value:(0,tCt.normalizeLineEndings)(y),weight:h.weight,componentPath:d.path,nodeStatistics:d.statistics,chunks:m,source:h.source,index:A?void 0:h.index})}return!0}),!c)throw new Error(`Node of type ${k8i.BeforeCursor.name} not found`);if(o.length>1)throw new Error("Only one suffix is allowed");let u=o.length===1?o[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:n,suffixBlock:u,componentStatistics:s}}};rCt.SplitContextPromptRenderer=MNr;var Flc=[...tCt.transformers,(t,e,r)=>(0,Olc.isContextNode)(t)?{...r,index:Blc()}:r]});var bV=I(yU=>{"use strict";p();Object.defineProperty(yU,"__esModule",{value:!0});yU.AbstractLanguageDiagnosticsService=yU.ILanguageDiagnosticsService=void 0;yU.rangeSpanningDiagnostics=qlc;yU.isError=jlc;yU.getDiagnosticsAtSelection=Hlc;var Ulc=an(),Qlc=x2(),ONr=qg();yU.ILanguageDiagnosticsService=(0,Ulc.createServiceIdentifier)("ILanguageDiagnosticService");var LNr=class{static{a(this,"AbstractLanguageDiagnosticsService")}waitForNewDiagnostics(e,r,n=5e3){let o,s,c;return new Promise(l=>{o=r.onCancellationRequested(()=>l([])),c=setTimeout(()=>l(this.getDiagnostics(e)),n),s=this.onDidChangeDiagnostics(u=>{for(let d of u.uris)if((0,Qlc.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};yU.AbstractLanguageDiagnosticsService=LNr;function qlc(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a(qlc,"rangeSpanningDiagnostics");function jlc(t){return t.severity===ONr.DiagnosticSeverity.Error}a(jlc,"isError");function Hlc(t,e,r=[ONr.DiagnosticSeverity.Error,ONr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a(Hlc,"getDiagnosticsAtSelection")});var O8i=I(BNr=>{"use strict";p();Object.defineProperty(BNr,"__esModule",{value:!0});BNr.getDiagnosticsFromContextItems=Wlc;var Glc=RS(),M8i=_V(),$lc=PBe(),Vlc="content_excluded";async function Wlc(t,e,r){let n=(0,$lc.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)zlc(t,e,h.data,h.providerId);let o=new Set,s=[];for(let h of n)for(let m of h.data)o.add(m.uri.toString()),s.push({providerId:h.providerId,bag:m});if(s.length===0)return[];let c=t.get(M8i.ICompletionsContextProviderService),l=t.get(Glc.ICompletionsTextDocumentManagerService),u=new Map;await Promise.all(Array.from(o).map(async h=>{u.set(h,await l.getTextDocumentValidation({uri:h}))}));let d=c.getStatisticsForCompletion(e);return s.filter(h=>{let m=u.get(h.bag.uri.toString())?.status==="valid";return m?d.addExpectations(h.providerId,[[h.bag,"included"]]):d.addExpectations(h.providerId,[[h.bag,Vlc]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a(Wlc,"getDiagnosticsFromContextItems");function zlc(t,e,r,n){let o=t.get(M8i.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(zlc,"setupExpectationsForDiagnosticBags")});var L8i=I(nCt=>{"use strict";p();Object.defineProperty(nCt,"__esModule",{value:!0});nCt.getTraitsFromContextItems=Zlc;nCt.ReportTraitsTelemetry=tuc;var Ylc=nA(),Klc=_V(),Jlc=PBe();function Zlc(t,e,r){let n=(0,Jlc.filterContextItemsByType)(r,"Trait");for(let s of n)Xlc(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(Zlc,"getTraitsFromContextItems");function Xlc(t,e,r,n){let o=t.get(Klc.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(Xlc,"setupExpectationsForTraits");var euc=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function tuc(t,e,r,n,o,s){if(r.length>0){let c={};c.detectedLanguageId=n,c.languageId=o;for(let u of r){let d=euc.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,Ylc.telemetry)(t,e,l)}}a(tuc,"ReportTraitsTelemetry")});var mU=I(MS=>{"use strict";p();var Q8i=MS&&MS.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},NS=MS&&MS.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(MS,"__esModule",{value:!0});MS.TestComponentsCompletionsPromptFactory=MS.ComponentsCompletionsPromptFactory=MS.PromptOrdering=void 0;MS.isCompletionRequestData=Euc;var qL=LL(),B8i=qg(),jNr=Gl(),q8i=Dne(),FNr=hd(),HNr=Ks(),j8i=yre(),F8i=kFi(),ruc=nA(),nuc=RS(),iuc=UDr(),ouc=DBe(),suc=JDr(),H8i=Uvt(),auc=MBe(),cuc=mNr(),luc=gNr(),uuc=ANr(),duc=xNr(),fuc=R8i(),puc=N8i(),huc=DNr(),G8i=bV(),muc=Lg(),FBe=Fvt(),guc=FDr(),Auc=O8i(),U8i=L8i(),GNr=_V(),AN=p_e(),yuc=Zvt(),_uc=d_e();function Euc(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.document||!e.position||e.position.line===void 0||e.position.character===void 0||!e.telemetryData)}a(Euc,"isCompletionRequestData");var SV;(function(t){t.Default="default",t.SplitContext="splitContext"})(SV||(MS.PromptOrdering=SV={}));var UNr={[SV.Default]:{promptFunction:$8i,renderer:suc.CompletionsPromptRenderer},[SV.SplitContext]:{promptFunction:fuc.splitContextCompletionsPrompt,renderer:puc.SplitContextPromptRenderer}};function $8i(t){let e=t.get(nuc.ICompletionsTextDocumentManagerService),r=t.get(HNr.IInstantiationService),n=t.get(yuc.ICompletionsRecentEditsProviderService);return(0,qL.jsxs)(qL.Fragment,{children:[(0,qL.jsxs)(ouc.CompletionsContext,{children:[(0,qL.jsx)(luc.DocumentMarker,{tdms:e,weight:.7}),(0,qL.jsx)(huc.Traits,{weight:.6}),(0,qL.jsx)(cuc.Diagnostics,{tdms:e,weight:.65}),(0,qL.jsx)(iuc.CodeSnippets,{tdms:e,weight:.9}),(0,qL.jsx)(duc.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,qL.jsx)(uuc.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,qL.jsx)(auc.CurrentFile,{weight:1})]})}a($8i,"defaultCompletionsPrompt");var iCt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l,u,d){this.instantiationService=n,this.completionsTelemetryService=o,this.ignoreService=s,this.contextProviderBridge=c,this.logTarget=l,this.contextProviderStatistics=u,this.languageDiagnosticsService=d,this.promptOrdering=r??SV.Default,this.virtualPrompt=e??new F8i.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe(),this.renderer=this.getRenderer()}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}async createPromptUnsafe({completionId:e,completionState:r,telemetryData:n,promptOpts:o},s){let{maxPromptLength:c,suffixPercent:l,suffixMatchThreshold:u}=this.instantiationService.invokeFunction(AN.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?SV.SplitContext:SV.Default;this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,diagnostics:A,turnOffSimilarFiles:y,resolvedContextItems:_}=await this.resolveContext(e,r,n,s,o);if(await this.updateComponentData(r.textDocument,r.position,m,g,A,n,y,c,s,o,u,o?.tokenizer),s?.isCancellationRequested)return AN._promptCancelled;let E=this.virtualPrompt.snapshot(s),v=E.status;if(v==="cancelled")return AN._promptCancelled;if(v==="error")return this.errorPrompt(E.error);let S=this.renderer.render(E.snapshot,{delimiter:` +`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(S.status==="cancelled")return AN._promptCancelled;if(S.status==="error")return this.errorPrompt(S.error);let[T,w]=(0,AN.trimLastLine)(S.prefix),R={...S,prefix:T},x,k=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(FBe.useContextProviderAPI,k,n)){let N=(0,GNr.componentStatisticsToPromptMatcher)(S.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,FBe.telemetrizeContextItems)(this.contextProviderStatistics,e,_),jNr.logger.debug(this.logTarget,`Context providers telemetry: '${JSON.stringify(x)}'`)}let D=performance.now();return this.resetIfEmpty(S),this.successPrompt(R,D,h,w,x)}async updateComponentData(e,r,n,o,s,c,l,u,d,f={},h,m){let g=this.createRequestData(e,r,c,d,f,u,n,o,s,l,h,m);await this.pipe.pump(g)}async resolveContext(e,r,n,o,s={}){let c=[],l,u,d,f=!1;if(this.instantiationService.invokeFunction(FBe.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(FBe.matchContextItems);this.instantiationService.invokeFunction(vuc,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(U8i.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(U8i.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction(guc.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(Auc.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(FBe.getDefaultDiagnosticSettings);return d=this.addDefaultDiagnosticBag(c,d,e,r,h),{traits:l,codeSnippets:u,diagnostics:d,turnOffSimilarFiles:f,resolvedContextItems:c}}async failFastPrompt(e,r,n,o){if(o?.isCancellationRequested)return AN._promptCancelled;if(await this.ignoreService.isCopilotIgnored(FNr.URI.parse(e.uri)))return AN._copilotContentExclusion;if((n>0?e.getText().length:e.offsetAt(r))0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return(0,ruc.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),AN._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new F8i.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=UNr[this.promptOrdering]?.promptFunction??$8i;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=UNr[this.promptOrdering]??UNr[SV.Default];return new e.renderer}addDefaultDiagnosticBag(e,r,n,o,s){if(s===void 0)return r;let c=o.textDocument;if(r!==void 0&&r.some(E=>E.uri.toString()===c.uri))return r;let l=performance.now(),u=this.languageDiagnosticsService.getDiagnostics(FNr.URI.parse(c.uri));if(u.length===0)return r;let d=[],f=[],h=s.warnings==="yes"||s.warnings==="yesIfNoErrors",m=o.position;for(let E of u)Math.abs(E.range.start.line-m.line)<=s.maxLineDistance&&(E.severity===B8i.DiagnosticSeverity.Error?d.push(E):E.severity===B8i.DiagnosticSeverity.Warning&&h&&f.push(E));let g=[...d,...s.warnings==="yes"||s.warnings==="yesIfNoErrors"&&d.length===0?f:[]];if(g.length===0)return r;g.sort((E,v)=>{let S=Math.abs(E.range.start.line-m.line),T=Math.abs(v.range.start.line-m.line);return S-T});let A={type:"DiagnosticBag",uri:FNr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,muc.generateUuid)()},y="copilot.chat.defaultDiagnostics",_=this.contextProviderStatistics.getStatisticsForCompletion(n);return _.addExpectations(y,[[A,"included"]]),e.push({providerId:y,matchScore:10,resolution:"full",resolutionTimeMs:performance.now()-l,data:[A]}),_.setLastResolution(y,"full"),r===void 0?[A]:(r.push(A),r)}};iCt=Q8i([NS(2,HNr.IInstantiationService),NS(3,j8i.ICompletionsTelemetryService),NS(4,q8i.IIgnoreService),NS(5,H8i.ICompletionsContextProviderBridgeService),NS(6,jNr.ICompletionsLogTargetService),NS(7,GNr.ICompletionsContextProviderService),NS(8,G8i.ILanguageDiagnosticsService)],iCt);var QNr=class extends iCt{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};MS.ComponentsCompletionsPromptFactory=QNr;MS.ComponentsCompletionsPromptFactory=QNr=Q8i([NS(0,HNr.IInstantiationService),NS(1,j8i.ICompletionsTelemetryService),NS(2,q8i.IIgnoreService),NS(3,H8i.ICompletionsContextProviderBridgeService),NS(4,jNr.ICompletionsLogTargetService),NS(5,GNr.ICompletionsContextProviderService),NS(6,G8i.ILanguageDiagnosticsService)],QNr);var qNr=class extends iCt{static{a(this,"TestComponentsCompletionsPromptFactory")}};MS.TestComponentsCompletionsPromptFactory=qNr;function vuc(t,e,r,n){let o=["cpp","c"];return(0,_uc.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(vuc,"similarFilesEnabled")});var KNr=I(aE=>{"use strict";p();var V8i=aE&&aE.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},W8i=aE&&aE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(aE,"__esModule",{value:!0});aE.TestCompletionsPromptFactory=aE.CompletionsPromptFactory=aE.DEFAULT_PROMPT_TIMEOUT=aE.ICompletionsPromptFactoryService=void 0;var Cuc=ii(),z8i=Ks(),$Nr=p_e(),buc=mU(),Suc=an();aE.ICompletionsPromptFactoryService=(0,Suc.createServiceIdentifier)("ICompletionsPromptFactoryService");var VNr=class{static{a(this,"SequentialCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){return this.lastPromise=this.promptAsync(e,r),this.lastPromise}async promptAsync(e,r){if(await this.lastPromise,r?.isCancellationRequested)return $Nr._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return $Nr._promptError}}};aE.DEFAULT_PROMPT_TIMEOUT=1200;var WNr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new Cuc.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s($Nr._promptTimeout)},aE.DEFAULT_PROMPT_TIMEOUT)})])}},oCt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new VNr(new WNr(n.createInstance(buc.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};oCt=V8i([W8i(2,z8i.IInstantiationService)],oCt);var zNr=class extends oCt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};aE.CompletionsPromptFactory=zNr;aE.CompletionsPromptFactory=zNr=V8i([W8i(0,z8i.IInstantiationService)],zNr);var YNr=class extends oCt{static{a(this,"TestCompletionsPromptFactory")}};aE.TestCompletionsPromptFactory=YNr});var p_e=I(kh=>{"use strict";p();Object.defineProperty(kh,"__esModule",{value:!0});kh.PromptResponse=kh._promptTimeout=kh._promptCancelled=kh._promptError=kh._copilotContentExclusion=kh._contextTooShort=kh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=kh.MIN_PROMPT_CHARS=void 0;kh.trimLastLine=Puc;kh.extractPrompt=Duc;kh.getPromptOptions=Ouc;var Tuc=yBe(),Iuc=xy(),Y8i=ovt(),xuc=bBe(),wuc=RS(),Ruc=KNr(),kuc=d_e();kh.MIN_PROMPT_CHARS=10;kh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];kh._contextTooShort={type:"contextTooShort"};kh._copilotContentExclusion={type:"copilotContentExclusion"};kh._promptError={type:"promptError"};kh._promptCancelled={type:"promptCancelled"};kh._promptTimeout={type:"promptTimeout"};var K8i;(function(t){function e(r){return r.type==="prompt"?[{header:"PREFIX",content:r.prompt.prefix},{header:"SUFFIX",content:r.prompt.suffix},{header:"CONTEXT",content:(r.prompt.context||[]).join(` --- `)},{header:"FIM",content:"Is Fim enabled: "+r.prompt.isFimEnabled},{header:"TOKENS",content:`Prefix tokens: ${r.prompt.prefixTokens} Suffix tokens: ${r.prompt.suffixTokens}`},{header:"NEIGHBORS",content:Array.from(r.neighborSource.entries()).map(([n,o])=>`neighboring file type: ${n} @@ -1024,14 +1024,14 @@ ${o.join(", ")}`).join(` --- ${n.content} ---------------`).join(` -`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(z8i||(kh.PromptResponse=z8i={}));function Ruc(t){let e=t.split(` -`),r=e[e.length-1],n=r.length-r.trimEnd().length,o=t.slice(0,t.length-n),s=t.slice(o.length);return[r.length===n?o:t,s]}a(Ruc,"trimLastLine");function kuc(t,e,r,n,o,s={}){let l=t.get(Iuc.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=Duc(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(xuc.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(kuc,"extractPrompt");function Puc(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,buc.commentBlockAsSingles)(n,e)}a(Puc,"addNeighboringCellsToPrompt");function Duc(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>Puc(l,r.document.detectedLanguageId)).join(` +`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(K8i||(kh.PromptResponse=K8i={}));function Puc(t){let e=t.split(` +`),r=e[e.length-1],n=r.length-r.trimEnd().length,o=t.slice(0,t.length-n),s=t.slice(o.length);return[r.length===n?o:t,s]}a(Puc,"trimLastLine");function Duc(t,e,r,n,o,s={}){let l=t.get(wuc.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=Muc(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(Ruc.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(Duc,"extractPrompt");function Nuc(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,Tuc.commentBlockAsSingles)(n,e)}a(Nuc,"addNeighboringCellsToPrompt");function Muc(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>Nuc(l,r.document.detectedLanguageId)).join(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(Duc,"applyEditsForNotebook");function Nuc(t,e,r){let n=t.get(Suc.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,Tuc.getMaxSolutionTokens)(),c=(0,W8i.getNumberOfSnippets)(e,r),l=(0,W8i.getSimilarFilesOptions)(t,e,r),u=n.suffixPercent(e),d=n.suffixMatchThreshold(e);if(u<0||u>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${u}`);if(d<0||d>100)throw new Error(`suffixMatchThreshold must be between 0 and 100, but was ${d}`);return{maxPromptLength:s,similarFilesOptions:l,numberOfSnippets:c,suffixPercent:u,suffixMatchThreshold:d}}a(Nuc,"getPromptOptions")});var Y8i=I(KNr=>{"use strict";p();Object.defineProperty(KNr,"__esModule",{value:!0});KNr.Evaluate=Muc;function Muc(...t){return new globalThis.Function(...t)}a(Muc,"Evaluate")});var Z8i=I(SV=>{"use strict";p();Object.defineProperty(SV,"__esModule",{value:!0});SV.TypeSystem=SV.TypeSystemDuplicateFormat=SV.TypeSystemDuplicateTypeKind=void 0;var oCt=hye(),Ouc=$Le(),Luc=Tn(),J8i=Gf(),sCt=class extends J8i.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};SV.TypeSystemDuplicateTypeKind=sCt;var aCt=class extends J8i.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};SV.TypeSystemDuplicateFormat=aCt;var K8i;(function(t){function e(n,o){if(oCt.TypeRegistry.Has(n))throw new sCt(n);return oCt.TypeRegistry.Set(n,o),(s={})=>(0,Ouc.Unsafe)({...s,[Luc.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(oCt.FormatRegistry.Has(n))throw new aCt(n);return oCt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(K8i||(SV.TypeSystem=K8i={}))});var ZNr=I(_U=>{"use strict";p();var Buc=_U&&_U.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JNr=_U&&_U.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Buc(e,t,r)};Object.defineProperty(_U,"__esModule",{value:!0});JNr(Y8i(),_U);JNr(pLe(),_U);JNr(Z8i(),_U)});var XNr=I(UBe=>{"use strict";p();Object.defineProperty(UBe,"__esModule",{value:!0});UBe.DefaultErrorFunction=X8i;UBe.SetErrorFunction=Uuc;UBe.GetErrorFunction=Quc;var Fuc=Tn(),$n=eMr();function X8i(t){switch(t.errorType){case $n.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case $n.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case $n.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case $n.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case $n.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case $n.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case $n.ValueErrorType.Array:return"Expected array";case $n.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case $n.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case $n.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case $n.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case $n.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case $n.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case $n.ValueErrorType.BigInt:return"Expected bigint";case $n.ValueErrorType.Boolean:return"Expected boolean";case $n.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case $n.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case $n.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case $n.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case $n.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case $n.ValueErrorType.Date:return"Expected Date";case $n.ValueErrorType.Function:return"Expected function";case $n.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case $n.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case $n.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case $n.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case $n.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case $n.ValueErrorType.Integer:return"Expected integer";case $n.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case $n.ValueErrorType.Intersect:return"Expected all values to match";case $n.ValueErrorType.Iterator:return"Expected Iterator";case $n.ValueErrorType.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case $n.ValueErrorType.Never:return"Never";case $n.ValueErrorType.Not:return"Value should not match";case $n.ValueErrorType.Null:return"Expected null";case $n.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case $n.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case $n.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case $n.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case $n.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case $n.ValueErrorType.Number:return"Expected number";case $n.ValueErrorType.Object:return"Expected object";case $n.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case $n.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case $n.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case $n.ValueErrorType.ObjectRequiredProperty:return"Expected required property";case $n.ValueErrorType.Promise:return"Expected Promise";case $n.ValueErrorType.RegExp:return"Expected string to match regular expression";case $n.ValueErrorType.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case $n.ValueErrorType.StringFormat:return`Expected string to match '${t.schema.format}' format`;case $n.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case $n.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case $n.ValueErrorType.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case $n.ValueErrorType.String:return"Expected string";case $n.ValueErrorType.Symbol:return"Expected symbol";case $n.ValueErrorType.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case $n.ValueErrorType.Tuple:return"Expected tuple";case $n.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case $n.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case $n.ValueErrorType.Uint8Array:return"Expected Uint8Array";case $n.ValueErrorType.Undefined:return"Expected undefined";case $n.ValueErrorType.Union:return"Expected union value";case $n.ValueErrorType.Void:return"Expected void";case $n.ValueErrorType.Kind:return`Expected kind '${t.schema[Fuc.Kind]}'`;default:return"Unknown error type"}}a(X8i,"DefaultErrorFunction");var e6i=X8i;function Uuc(t){e6i=t}a(Uuc,"SetErrorFunction");function Quc(){return e6i}a(Quc,"GetErrorFunction")});var n6i=I(h_e=>{"use strict";p();Object.defineProperty(h_e,"__esModule",{value:!0});h_e.TypeDereferenceError=void 0;h_e.Pushref=Guc;h_e.Deref=r6i;var quc=Gf(),t6i=Tn(),juc=e_t(),cCt=class extends quc.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};h_e.TypeDereferenceError=cCt;function Huc(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new cCt(t);return r6i(r,e)}a(Huc,"Resolve");function Guc(t,e){return!(0,juc.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Guc,"Pushref");function r6i(t,e){return t[t6i.Kind]==="This"||t[t6i.Kind]==="Ref"?Huc(t,e):t}a(r6i,"Deref")});var yN=I(Jne=>{"use strict";p();var $uc=Jne&&Jne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vuc=Jne&&Jne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$uc(e,t,r)};Object.defineProperty(Jne,"__esModule",{value:!0});Vuc(n6i(),Jne)});var a6i=I(QBe=>{"use strict";p();Object.defineProperty(QBe,"__esModule",{value:!0});QBe.ValueHashError=void 0;QBe.Hash=ldc;var _N=Fg(),Wuc=Gf(),lCt=class extends Wuc.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};QBe.ValueHashError=lCt;var RI;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(RI||(RI={}));var m_e=BigInt("14695981039346656037"),[zuc,Yuc]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Kuc=Array.from({length:256}).map((t,e)=>BigInt(e)),i6i=new Float64Array(1),o6i=new DataView(i6i.buffer),s6i=new Uint8Array(i6i.buffer);function*Juc(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let r=0;r>8*(e-1-r)&255}a(Juc,"NumberToBytes");function Zuc(t){cE(RI.Array);for(let e of t)g_e(e)}a(Zuc,"ArrayType");function Xuc(t){cE(RI.Boolean),cE(t?1:0)}a(Xuc,"BooleanType");function edc(t){cE(RI.BigInt),o6i.setBigInt64(0,t);for(let e of s6i)cE(e)}a(edc,"BigIntType");function tdc(t){cE(RI.Date),g_e(t.getTime())}a(tdc,"DateType");function rdc(t){cE(RI.Null)}a(rdc,"NullType");function ndc(t){cE(RI.Number),o6i.setFloat64(0,t);for(let e of s6i)cE(e)}a(ndc,"NumberType");function idc(t){cE(RI.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())g_e(e),g_e(t[e])}a(idc,"ObjectType");function odc(t){cE(RI.String);for(let e=0;e{"use strict";p();var udc=Zne&&Zne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ddc=Zne&&Zne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&udc(e,t,r)};Object.defineProperty(Zne,"__esModule",{value:!0});ddc(a6i(),Zne)});var rMr=I(GBe=>{"use strict";p();Object.defineProperty(GBe,"__esModule",{value:!0});GBe.ValueCheckUnknownTypeError=void 0;GBe.Check=Zdc;var jBe=ZNr(),tMr=yN(),fdc=qBe(),A_e=Tn(),c6i=VD(),pdc=ine(),HBe=hye(),hdc=Gf(),mdc=Bm(),Hm=Fg(),gdc=Is(),uCt=class extends hdc.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};GBe.ValueCheckUnknownTypeError=uCt;function Adc(t){return t[A_e.Kind]==="Any"||t[A_e.Kind]==="Unknown"}a(Adc,"IsAnyOrUnknown");function ua(t){return t!==void 0}a(ua,"IsDefined");function ydc(t,e,r){return!0}a(ydc,"FromAny");function _dc(t,e,r){return!0}a(_dc,"FromArgument");function Edc(t,e,r){if(!(0,Hm.IsArray)(r)||ua(t.minItems)&&!(r.length>=t.minItems)||ua(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!lA(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=(0,fdc.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(ua(t.contains)||(0,Hm.IsNumber)(t.minContains)||(0,Hm.IsNumber)(t.maxContains)))return!0;let n=ua(t.contains)?t.contains:(0,mdc.Never)(),o=r.reduce((s,c)=>lA(n,e,c)?s+1:s,0);return!(o===0||(0,Hm.IsNumber)(t.minContains)&&ot.maxContains)}a(Edc,"FromArray");function vdc(t,e,r){return(0,Hm.IsAsyncIterator)(r)}a(vdc,"FromAsyncIterator");function Cdc(t,e,r){return!(!(0,Hm.IsBigInt)(r)||ua(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ua(t.maximum)&&!(r<=t.maximum)||ua(t.minimum)&&!(r>=t.minimum)||ua(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(Cdc,"FromBigInt");function bdc(t,e,r){return(0,Hm.IsBoolean)(r)}a(bdc,"FromBoolean");function Sdc(t,e,r){return lA(t.returns,e,r.prototype)}a(Sdc,"FromConstructor");function Tdc(t,e,r){return!(!(0,Hm.IsDate)(r)||ua(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||ua(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||ua(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||ua(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(Tdc,"FromDate");function Idc(t,e,r){return(0,Hm.IsFunction)(r)}a(Idc,"FromFunction");function xdc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return lA(o,[...e,...n],r)}a(xdc,"FromImport");function wdc(t,e,r){return!(!(0,Hm.IsInteger)(r)||ua(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ua(t.maximum)&&!(r<=t.maximum)||ua(t.minimum)&&!(r>=t.minimum)||ua(t.multipleOf)&&r%t.multipleOf!==0)}a(wdc,"FromInteger");function Rdc(t,e,r){let n=t.allOf.every(o=>lA(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,c6i.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,gdc.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,c6i.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||lA(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(Rdc,"FromIntersect");function kdc(t,e,r){return(0,Hm.IsIterator)(r)}a(kdc,"FromIterator");function Pdc(t,e,r){return r===t.const}a(Pdc,"FromLiteral");function Ddc(t,e,r){return!1}a(Ddc,"FromNever");function Ndc(t,e,r){return!lA(t.not,e,r)}a(Ndc,"FromNot");function Mdc(t,e,r){return(0,Hm.IsNull)(r)}a(Mdc,"FromNull");function Odc(t,e,r){return!(!jBe.TypeSystemPolicy.IsNumberLike(r)||ua(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ua(t.minimum)&&!(r>=t.minimum)||ua(t.maximum)&&!(r<=t.maximum)||ua(t.multipleOf)&&r%t.multipleOf!==0)}a(Odc,"FromNumber");function Ldc(t,e,r){if(!jBe.TypeSystemPolicy.IsObjectLike(r)||ua(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ua(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!lA(s,e,r[o])||((0,pdc.ExtendsUndefinedCheck)(s)||Adc(s))&&!(o in r))return!1}else if(jBe.TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!lA(s,e,r[o]))return!1}if(t.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return t.required&&t.required.length===n.length&&o.length===n.length?!0:o.every(s=>n.includes(s))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||lA(t.additionalProperties,e,r[s])):!0}a(Ldc,"FromObject");function Bdc(t,e,r){return(0,Hm.IsPromise)(r)}a(Bdc,"FromPromise");function Fdc(t,e,r){if(!jBe.TypeSystemPolicy.IsRecordLike(r)||ua(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ua(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?lA(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:lA(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(Fdc,"FromRecord");function Udc(t,e,r){return lA((0,tMr.Deref)(t,e),e,r)}a(Udc,"FromRef");function Qdc(t,e,r){let n=new RegExp(t.source,t.flags);return ua(t.minLength)&&!(r.length>=t.minLength)||ua(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(Qdc,"FromRegExp");function qdc(t,e,r){return!(0,Hm.IsString)(r)||ua(t.minLength)&&!(r.length>=t.minLength)||ua(t.maxLength)&&!(r.length<=t.maxLength)||ua(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:ua(t.format)?HBe.FormatRegistry.Has(t.format)?HBe.FormatRegistry.Get(t.format)(r):!1:!0}a(qdc,"FromString");function jdc(t,e,r){return(0,Hm.IsSymbol)(r)}a(jdc,"FromSymbol");function Hdc(t,e,r){return(0,Hm.IsString)(r)&&new RegExp(t.pattern).test(r)}a(Hdc,"FromTemplateLiteral");function Gdc(t,e,r){return lA((0,tMr.Deref)(t,e),e,r)}a(Gdc,"FromThis");function $dc(t,e,r){if(!(0,Hm.IsArray)(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nlA(n,e,r))}a(Wdc,"FromUnion");function zdc(t,e,r){return!(!(0,Hm.IsUint8Array)(r)||ua(t.maxByteLength)&&!(r.length<=t.maxByteLength)||ua(t.minByteLength)&&!(r.length>=t.minByteLength))}a(zdc,"FromUint8Array");function Ydc(t,e,r){return!0}a(Ydc,"FromUnknown");function Kdc(t,e,r){return jBe.TypeSystemPolicy.IsVoidLike(r)}a(Kdc,"FromVoid");function Jdc(t,e,r){return HBe.TypeRegistry.Has(t[A_e.Kind])?HBe.TypeRegistry.Get(t[A_e.Kind])(t,r):!1}a(Jdc,"FromKind");function lA(t,e,r){let n=ua(t.$id)?(0,tMr.Pushref)(t,e):e,o=t;switch(o[A_e.Kind]){case"Any":return ydc(o,n,r);case"Argument":return _dc(o,n,r);case"Array":return Edc(o,n,r);case"AsyncIterator":return vdc(o,n,r);case"BigInt":return Cdc(o,n,r);case"Boolean":return bdc(o,n,r);case"Constructor":return Sdc(o,n,r);case"Date":return Tdc(o,n,r);case"Function":return Idc(o,n,r);case"Import":return xdc(o,n,r);case"Integer":return wdc(o,n,r);case"Intersect":return Rdc(o,n,r);case"Iterator":return kdc(o,n,r);case"Literal":return Pdc(o,n,r);case"Never":return Ddc(o,n,r);case"Not":return Ndc(o,n,r);case"Null":return Mdc(o,n,r);case"Number":return Odc(o,n,r);case"Object":return Ldc(o,n,r);case"Promise":return Bdc(o,n,r);case"Record":return Fdc(o,n,r);case"Ref":return Udc(o,n,r);case"RegExp":return Qdc(o,n,r);case"String":return qdc(o,n,r);case"Symbol":return jdc(o,n,r);case"TemplateLiteral":return Hdc(o,n,r);case"This":return Gdc(o,n,r);case"Tuple":return $dc(o,n,r);case"Undefined":return Vdc(o,n,r);case"Union":return Wdc(o,n,r);case"Uint8Array":return zdc(o,n,r);case"Unknown":return Ydc(o,n,r);case"Void":return Kdc(o,n,r);default:if(!HBe.TypeRegistry.Has(o[A_e.Kind]))throw new uCt(o);return Jdc(o,n,r)}}a(lA,"Visit");function Zdc(...t){return t.length===3?lA(t[0],t[1],t[2]):lA(t[0],[],t[1])}a(Zdc,"Check")});var kI=I(Xne=>{"use strict";p();var Xdc=Xne&&Xne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),efc=Xne&&Xne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Xdc(e,t,r)};Object.defineProperty(Xne,"__esModule",{value:!0});efc(rMr(),Xne)});var eMr=I(vU=>{"use strict";p();Object.defineProperty(vU,"__esModule",{value:!0});vU.ValueErrorIterator=vU.ValueErrorsUnknownTypeError=vU.ValueErrorType=void 0;vU.Errors=qfc;var $Be=ZNr(),l6i=VD(),dCt=hye(),tfc=fwr(),rfc=XNr(),nfc=Gf(),u6i=yN(),ifc=qBe(),ofc=kI(),nMr=Tn(),sfc=Bm(),Ph=Fg(),on;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(on||(vU.ValueErrorType=on={}));var fCt=class extends nfc.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};vU.ValueErrorsUnknownTypeError=fCt;function EU(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(EU,"EscapeKey");function da(t){return t!==void 0}a(da,"IsDefined");var VBe=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};vU.ValueErrorIterator=VBe;function pn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,rfc.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(pn,"Create");function*afc(t,e,r,n){}a(afc,"FromAny");function*cfc(t,e,r,n){}a(cfc,"FromArgument");function*lfc(t,e,r,n){if(!(0,Ph.IsArray)(n))return yield pn(on.Array,t,r,n);da(t.minItems)&&!(n.length>=t.minItems)&&(yield pn(on.ArrayMinItems,t,r,n)),da(t.maxItems)&&!(n.length<=t.maxItems)&&(yield pn(on.ArrayMaxItems,t,r,n));for(let c=0;cuA(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield pn(on.ArrayContains,t,r,n)),(0,Ph.IsNumber)(t.minContains)&&st.maxContains&&(yield pn(on.ArrayMaxContains,t,r,n))}a(lfc,"FromArray");function*ufc(t,e,r,n){(0,Ph.IsAsyncIterator)(n)||(yield pn(on.AsyncIterator,t,r,n))}a(ufc,"FromAsyncIterator");function*dfc(t,e,r,n){if(!(0,Ph.IsBigInt)(n))return yield pn(on.BigInt,t,r,n);da(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield pn(on.BigIntExclusiveMinimum,t,r,n)),da(t.maximum)&&!(n<=t.maximum)&&(yield pn(on.BigIntMaximum,t,r,n)),da(t.minimum)&&!(n>=t.minimum)&&(yield pn(on.BigIntMinimum,t,r,n)),da(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield pn(on.BigIntMultipleOf,t,r,n))}a(dfc,"FromBigInt");function*ffc(t,e,r,n){(0,Ph.IsBoolean)(n)||(yield pn(on.Boolean,t,r,n))}a(ffc,"FromBoolean");function*pfc(t,e,r,n){yield*uA(t.returns,e,r,n.prototype)}a(pfc,"FromConstructor");function*hfc(t,e,r,n){if(!(0,Ph.IsDate)(n))return yield pn(on.Date,t,r,n);da(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield pn(on.DateExclusiveMinimumTimestamp,t,r,n)),da(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield pn(on.DateMaximumTimestamp,t,r,n)),da(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield pn(on.DateMinimumTimestamp,t,r,n)),da(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield pn(on.DateMultipleOfTimestamp,t,r,n))}a(hfc,"FromDate");function*mfc(t,e,r,n){(0,Ph.IsFunction)(n)||(yield pn(on.Function,t,r,n))}a(mfc,"FromFunction");function*gfc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*uA(s,[...e,...o],r,n)}a(gfc,"FromImport");function*Afc(t,e,r,n){if(!(0,Ph.IsInteger)(n))return yield pn(on.Integer,t,r,n);da(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield pn(on.IntegerExclusiveMinimum,t,r,n)),da(t.maximum)&&!(n<=t.maximum)&&(yield pn(on.IntegerMaximum,t,r,n)),da(t.minimum)&&!(n>=t.minimum)&&(yield pn(on.IntegerMinimum,t,r,n)),da(t.multipleOf)&&n%t.multipleOf!==0&&(yield pn(on.IntegerMultipleOf,t,r,n))}a(Afc,"FromInteger");function*yfc(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of uA(s,e,r,n))o=!0,yield c;if(o)return yield pn(on.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,l6i.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield pn(on.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,l6i.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=uA(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(yfc,"FromIntersect");function*_fc(t,e,r,n){(0,Ph.IsIterator)(n)||(yield pn(on.Iterator,t,r,n))}a(_fc,"FromIterator");function*Efc(t,e,r,n){n!==t.const&&(yield pn(on.Literal,t,r,n))}a(Efc,"FromLiteral");function*vfc(t,e,r,n){yield pn(on.Never,t,r,n)}a(vfc,"FromNever");function*Cfc(t,e,r,n){uA(t.not,e,r,n).next().done===!0&&(yield pn(on.Not,t,r,n))}a(Cfc,"FromNot");function*bfc(t,e,r,n){(0,Ph.IsNull)(n)||(yield pn(on.Null,t,r,n))}a(bfc,"FromNull");function*Sfc(t,e,r,n){if(!$Be.TypeSystemPolicy.IsNumberLike(n))return yield pn(on.Number,t,r,n);da(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield pn(on.NumberExclusiveMinimum,t,r,n)),da(t.maximum)&&!(n<=t.maximum)&&(yield pn(on.NumberMaximum,t,r,n)),da(t.minimum)&&!(n>=t.minimum)&&(yield pn(on.NumberMinimum,t,r,n)),da(t.multipleOf)&&n%t.multipleOf!==0&&(yield pn(on.NumberMultipleOf,t,r,n))}a(Sfc,"FromNumber");function*Tfc(t,e,r,n){if(!$Be.TypeSystemPolicy.IsObjectLike(n))return yield pn(on.Object,t,r,n);da(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield pn(on.ObjectMinProperties,t,r,n)),da(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield pn(on.ObjectMaxProperties,t,r,n));let o=Array.isArray(t.required)?t.required:[],s=Object.getOwnPropertyNames(t.properties),c=Object.getOwnPropertyNames(n);for(let l of o)c.includes(l)||(yield pn(on.ObjectRequiredProperty,t.properties[l],`${r}/${EU(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield pn(on.ObjectAdditionalProperties,t,`${r}/${EU(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*uA(t.additionalProperties,e,`${r}/${EU(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*uA(u,e,`${r}/${EU(l)}`,n[l]),(0,tfc.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield pn(on.ObjectRequiredProperty,u,`${r}/${EU(l)}`,void 0))):$Be.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*uA(u,e,`${r}/${EU(l)}`,n[l]))}}a(Tfc,"FromObject");function*Ifc(t,e,r,n){(0,Ph.IsPromise)(n)||(yield pn(on.Promise,t,r,n))}a(Ifc,"FromPromise");function*xfc(t,e,r,n){if(!$Be.TypeSystemPolicy.IsRecordLike(n))return yield pn(on.Object,t,r,n);da(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield pn(on.ObjectMinProperties,t,r,n)),da(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield pn(on.ObjectMaxProperties,t,r,n));let[o,s]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let[l,u]of Object.entries(n))c.test(l)&&(yield*uA(s,e,`${r}/${EU(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*uA(t.additionalProperties,e,`${r}/${EU(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield pn(on.ObjectAdditionalProperties,t,`${r}/${EU(l)}`,u)}}a(xfc,"FromRecord");function*wfc(t,e,r,n){yield*uA((0,u6i.Deref)(t,e),e,r,n)}a(wfc,"FromRef");function*Rfc(t,e,r,n){if(!(0,Ph.IsString)(n))return yield pn(on.String,t,r,n);if(da(t.minLength)&&!(n.length>=t.minLength)&&(yield pn(on.StringMinLength,t,r,n)),da(t.maxLength)&&!(n.length<=t.maxLength)&&(yield pn(on.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield pn(on.RegExp,t,r,n)}a(Rfc,"FromRegExp");function*kfc(t,e,r,n){if(!(0,Ph.IsString)(n))return yield pn(on.String,t,r,n);da(t.minLength)&&!(n.length>=t.minLength)&&(yield pn(on.StringMinLength,t,r,n)),da(t.maxLength)&&!(n.length<=t.maxLength)&&(yield pn(on.StringMaxLength,t,r,n)),(0,Ph.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield pn(on.StringPattern,t,r,n))),(0,Ph.IsString)(t.format)&&(dCt.FormatRegistry.Has(t.format)?dCt.FormatRegistry.Get(t.format)(n)||(yield pn(on.StringFormat,t,r,n)):yield pn(on.StringFormatUnknown,t,r,n))}a(kfc,"FromString");function*Pfc(t,e,r,n){(0,Ph.IsSymbol)(n)||(yield pn(on.Symbol,t,r,n))}a(Pfc,"FromSymbol");function*Dfc(t,e,r,n){if(!(0,Ph.IsString)(n))return yield pn(on.String,t,r,n);new RegExp(t.pattern).test(n)||(yield pn(on.StringPattern,t,r,n))}a(Dfc,"FromTemplateLiteral");function*Nfc(t,e,r,n){yield*uA((0,u6i.Deref)(t,e),e,r,n)}a(Nfc,"FromThis");function*Mfc(t,e,r,n){if(!(0,Ph.IsArray)(n))return yield pn(on.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield pn(on.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield pn(on.TupleLength,t,r,n);if(t.items)for(let o=0;onew VBe(uA(s,e,r,n)));yield pn(on.Union,t,r,n,o)}a(Lfc,"FromUnion");function*Bfc(t,e,r,n){if(!(0,Ph.IsUint8Array)(n))return yield pn(on.Uint8Array,t,r,n);da(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield pn(on.Uint8ArrayMaxByteLength,t,r,n)),da(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield pn(on.Uint8ArrayMinByteLength,t,r,n))}a(Bfc,"FromUint8Array");function*Ffc(t,e,r,n){}a(Ffc,"FromUnknown");function*Ufc(t,e,r,n){$Be.TypeSystemPolicy.IsVoidLike(n)||(yield pn(on.Void,t,r,n))}a(Ufc,"FromVoid");function*Qfc(t,e,r,n){dCt.TypeRegistry.Get(t[nMr.Kind])(t,n)||(yield pn(on.Kind,t,r,n))}a(Qfc,"FromKind");function*uA(t,e,r,n){let o=da(t.$id)?[...e,t]:e,s=t;switch(s[nMr.Kind]){case"Any":return yield*afc(s,o,r,n);case"Argument":return yield*cfc(s,o,r,n);case"Array":return yield*lfc(s,o,r,n);case"AsyncIterator":return yield*ufc(s,o,r,n);case"BigInt":return yield*dfc(s,o,r,n);case"Boolean":return yield*ffc(s,o,r,n);case"Constructor":return yield*pfc(s,o,r,n);case"Date":return yield*hfc(s,o,r,n);case"Function":return yield*mfc(s,o,r,n);case"Import":return yield*gfc(s,o,r,n);case"Integer":return yield*Afc(s,o,r,n);case"Intersect":return yield*yfc(s,o,r,n);case"Iterator":return yield*_fc(s,o,r,n);case"Literal":return yield*Efc(s,o,r,n);case"Never":return yield*vfc(s,o,r,n);case"Not":return yield*Cfc(s,o,r,n);case"Null":return yield*bfc(s,o,r,n);case"Number":return yield*Sfc(s,o,r,n);case"Object":return yield*Tfc(s,o,r,n);case"Promise":return yield*Ifc(s,o,r,n);case"Record":return yield*xfc(s,o,r,n);case"Ref":return yield*wfc(s,o,r,n);case"RegExp":return yield*Rfc(s,o,r,n);case"String":return yield*kfc(s,o,r,n);case"Symbol":return yield*Pfc(s,o,r,n);case"TemplateLiteral":return yield*Dfc(s,o,r,n);case"This":return yield*Nfc(s,o,r,n);case"Tuple":return yield*Mfc(s,o,r,n);case"Undefined":return yield*Ofc(s,o,r,n);case"Union":return yield*Lfc(s,o,r,n);case"Uint8Array":return yield*Bfc(s,o,r,n);case"Unknown":return yield*Ffc(s,o,r,n);case"Void":return yield*Ufc(s,o,r,n);default:if(!dCt.TypeRegistry.Has(s[nMr.Kind]))throw new fCt(t);return yield*Qfc(s,o,r,n)}}a(uA,"Visit");function qfc(...t){let e=t.length===3?uA(t[0],t[1],"",t[2]):uA(t[0],[],"",t[1]);return new VBe(e)}a(qfc,"Errors")});var y_e=I(TV=>{"use strict";p();var jfc=TV&&TV.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),d6i=TV&&TV.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jfc(e,t,r)};Object.defineProperty(TV,"__esModule",{value:!0});d6i(eMr(),TV);d6i(XNr(),TV)});var g6i=I(CU=>{"use strict";p();var Hfc=CU&&CU.__classPrivateFieldSet||function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},p6i=CU&&CU.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},iMr,pCt,h6i;Object.defineProperty(CU,"__esModule",{value:!0});CU.AssertError=void 0;CU.Assert=Vfc;var m6i=y_e(),Gfc=mIr(),$fc=rMr(),hCt=class extends Gfc.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),iMr.add(this),pCt.set(this,void 0),Hfc(this,pCt,e,"f"),this.error=r}Errors(){return new m6i.ValueErrorIterator(p6i(this,iMr,"m",h6i).call(this))}};CU.AssertError=hCt;pCt=new WeakMap,iMr=new WeakSet,h6i=a(function*(){this.error&&(yield this.error),yield*p6i(this,pCt,"f")},"_AssertError_Iterator");function f6i(t,e,r){if(!(0,$fc.Check)(t,e,r))throw new hCt((0,m6i.Errors)(t,e,r))}a(f6i,"AssertValue");function Vfc(...t){return t.length===3?f6i(t[0],t[1],t[2]):f6i(t[0],[],t[1])}a(Vfc,"Assert")});var mCt=I(eie=>{"use strict";p();var Wfc=eie&&eie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zfc=eie&&eie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Wfc(e,t,r)};Object.defineProperty(eie,"__esModule",{value:!0});zfc(g6i(),eie)});var A6i=I(oMr=>{"use strict";p();Object.defineProperty(oMr,"__esModule",{value:!0});oMr.Clone=__e;var tie=Fg();function Yfc(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=__e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=__e(t[r]);return e}a(Yfc,"FromObject");function Kfc(t){return t.map(e=>__e(e))}a(Kfc,"FromArray");function Jfc(t){return t.slice()}a(Jfc,"FromTypedArray");function Zfc(t){return new Map(__e([...t.entries()]))}a(Zfc,"FromMap");function Xfc(t){return new Set(__e([...t.entries()]))}a(Xfc,"FromSet");function epc(t){return new Date(t.toISOString())}a(epc,"FromDate");function __e(t){if((0,tie.IsArray)(t))return Kfc(t);if((0,tie.IsDate)(t))return epc(t);if((0,tie.IsTypedArray)(t))return Jfc(t);if((0,tie.IsMap)(t))return Zfc(t);if((0,tie.IsSet)(t))return Xfc(t);if((0,tie.IsObject)(t))return Yfc(t);if((0,tie.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(__e,"Clone")});var EN=I(rie=>{"use strict";p();var tpc=rie&&rie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rpc=rie&&rie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tpc(e,t,r)};Object.defineProperty(rie,"__esModule",{value:!0});rpc(A6i(),rie)});var v6i=I(WBe=>{"use strict";p();Object.defineProperty(WBe,"__esModule",{value:!0});WBe.ValueCreateError=void 0;WBe.Create=Hpc;var Ha=Fg(),npc=kI(),ipc=EN(),sMr=yN(),y6i=GD(),opc=hye(),_6i=Tn(),spc=Gf(),apc=e_t(),OS=class extends spc.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};WBe.ValueCreateError=OS;function cc(t){return(0,apc.IsFunction)(t)?t():(0,ipc.Clone)(t)}a(cc,"FromDefault");function cpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):{}}a(cpc,"FromAny");function lpc(t,e){return{}}a(lpc,"FromArgument");function upc(t,e){if(t.uniqueItems===!0&&!(0,Ha.HasPropertyKey)(t,"default"))throw new OS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,Ha.HasPropertyKey)(t,"default"))throw new OS(t,"Array with the contains constraint requires a default value");return"default"in t?cc(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>PI(t.items,e)):[]}a(upc,"FromArray");function dpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):(async function*(){})()}a(dpc,"FromAsyncIterator");function fpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):BigInt(0)}a(fpc,"FromBigInt");function ppc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):!1}a(ppc,"FromBoolean");function hpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);{let r=PI(t.returns,e);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let s=this;s[n]=o}}}:class{}}}a(hpc,"FromConstructor");function mpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(mpc,"FromDate");function gpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):()=>PI(t.returns,e)}a(gpc,"FromFunction");function Apc(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return PI(n,[...e,...r])}a(Apc,"FromImport");function ypc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.minimum!==void 0?t.minimum:0}a(ypc,"FromInteger");function _pc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);{let r=t.allOf.reduce((n,o)=>{let s=PI(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,npc.Check)(t,e,r))throw new OS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(_pc,"FromIntersect");function Epc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):(function*(){})()}a(Epc,"FromIterator");function vpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.const}a(vpc,"FromLiteral");function Cpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);throw new OS(t,"Never types cannot be created. Consider using a default value.")}a(Cpc,"FromNever");function bpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);throw new OS(t,"Not types must have a default value")}a(bpc,"FromNot");function Spc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):null}a(Spc,"FromNull");function Tpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.minimum!==void 0?t.minimum:0}a(Tpc,"FromNumber");function Ipc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=PI(s,e));return n}}a(Ipc,"FromObject");function xpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):Promise.resolve(PI(t.item,e))}a(xpc,"FromPromise");function wpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):{}}a(wpc,"FromRecord");function Rpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):PI((0,sMr.Deref)(t,e),e)}a(Rpc,"FromRef");function kpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);throw new OS(t,"RegExp types cannot be created. Consider using a default value.")}a(kpc,"FromRegExp");function Ppc(t,e){if(t.pattern!==void 0){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);throw new OS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);throw new OS(t,"String types with formats must specify a default value")}else return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(Ppc,"FromString");function Dpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(Dpc,"FromSymbol");function Npc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);if(!(0,y6i.IsTemplateLiteralFinite)(t))throw new OS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,y6i.TemplateLiteralGenerate)(t)[0]}a(Npc,"FromTemplateLiteral");function Mpc(t,e){if(E6i++>jpc)throw new OS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):PI((0,sMr.Deref)(t,e),e)}a(Mpc,"FromThis");function Opc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>PI(t.items[n],e))}a(Opc,"FromTuple");function Lpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default)}a(Lpc,"FromUndefined");function Bpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return PI(t.anyOf[0],e)}a(Bpc,"FromUnion");function Fpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(Fpc,"FromUint8Array");function Upc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):{}}a(Upc,"FromUnknown");function Qpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default)}a(Qpc,"FromVoid");function qpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);throw new Error("User defined types must specify a default value")}a(qpc,"FromKind");function PI(t,e){let r=(0,sMr.Pushref)(t,e),n=t;switch(n[_6i.Kind]){case"Any":return cpc(n,r);case"Argument":return lpc(n,r);case"Array":return upc(n,r);case"AsyncIterator":return dpc(n,r);case"BigInt":return fpc(n,r);case"Boolean":return ppc(n,r);case"Constructor":return hpc(n,r);case"Date":return mpc(n,r);case"Function":return gpc(n,r);case"Import":return Apc(n,r);case"Integer":return ypc(n,r);case"Intersect":return _pc(n,r);case"Iterator":return Epc(n,r);case"Literal":return vpc(n,r);case"Never":return Cpc(n,r);case"Not":return bpc(n,r);case"Null":return Spc(n,r);case"Number":return Tpc(n,r);case"Object":return Ipc(n,r);case"Promise":return xpc(n,r);case"Record":return wpc(n,r);case"Ref":return Rpc(n,r);case"RegExp":return kpc(n,r);case"String":return Ppc(n,r);case"Symbol":return Dpc(n,r);case"TemplateLiteral":return Npc(n,r);case"This":return Mpc(n,r);case"Tuple":return Opc(n,r);case"Undefined":return Lpc(n,r);case"Union":return Bpc(n,r);case"Uint8Array":return Fpc(n,r);case"Unknown":return Upc(n,r);case"Void":return Qpc(n,r);default:if(!opc.TypeRegistry.Has(n[_6i.Kind]))throw new OS(n,"Unknown type");return qpc(n,r)}}a(PI,"Visit");var jpc=512,E6i=0;function Hpc(...t){return E6i=0,t.length===2?PI(t[0],t[1]):PI(t[0],[])}a(Hpc,"Create")});var gCt=I(nie=>{"use strict";p();var Gpc=nie&&nie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$pc=nie&&nie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gpc(e,t,r)};Object.defineProperty(nie,"__esModule",{value:!0});$pc(v6i(),nie)});var T6i=I(KBe=>{"use strict";p();Object.defineProperty(KBe,"__esModule",{value:!0});KBe.ValueCastError=void 0;KBe.Cast=S6i;var hk=Fg(),Vpc=Gf(),ACt=Tn(),IV=gCt(),DI=kI(),iie=EN(),YBe=yN(),zBe=class extends Vpc.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};KBe.ValueCastError=zBe;function C6i(t,e,r){if(t[ACt.Kind]==="Object"&&typeof r=="object"&&!(0,hk.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[ACt.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,DI.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[ACt.Kind]==="Union"){let o=t.anyOf.map(s=>(0,YBe.Deref)(s,e)).map(s=>C6i(s,e,r));return Math.max(...o)}else return(0,DI.Check)(t,e,r)?1:0}a(C6i,"ScoreUnion");function Wpc(t,e,r){let n=t.anyOf.map(c=>(0,YBe.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=C6i(c,e,r);l>s&&(o=c,s=l)}return o}a(Wpc,"SelectUnion");function zpc(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,iie.Clone)(t.default);{let n=Wpc(t,e,r);return S6i(n,e,r)}}a(zpc,"CastUnion");function Ypc(t,e,r){return(0,DI.Check)(t,e,r)?(0,iie.Clone)(r):(0,IV.Create)(t,e)}a(Ypc,"DefaultClone");function Kpc(t,e,r){return(0,DI.Check)(t,e,r)?r:(0,IV.Create)(t,e)}a(Kpc,"Default");function Jpc(t,e,r){if((0,DI.Check)(t,e,r))return(0,iie.Clone)(r);let n=(0,hk.IsArray)(r)?(0,iie.Clone)(r):(0,IV.Create)(t,e),o=(0,hk.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,hk.IsNumber)(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>vN(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!(0,DI.Check)(t,e,l))throw new zBe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(Jpc,"FromArray");function Zpc(t,e,r){if((0,DI.Check)(t,e,r))return(0,IV.Create)(t,e);let n=new Set(t.returns.required||[]),o=a(function(){},"result");for(let[s,c]of Object.entries(t.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(o.prototype[s]=vN(c,e,r.prototype[s]));return o}a(Zpc,"FromConstructor");function Xpc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return vN(o,[...e,...n],r)}a(Xpc,"FromImport");function b6i(t,e){return(0,hk.IsObject)(t)&&!(0,hk.IsObject)(e)||!(0,hk.IsObject)(t)&&(0,hk.IsObject)(e)?t:!(0,hk.IsObject)(t)||!(0,hk.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?b6i(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(b6i,"IntersectAssign");function ehc(t,e,r){if((0,DI.Check)(t,e,r))return r;let n=(0,IV.Create)(t,e),o=b6i(n,r);return(0,DI.Check)(t,e,o)?o:n}a(ehc,"FromIntersect");function thc(t,e,r){throw new zBe(t,"Never types cannot be cast")}a(thc,"FromNever");function rhc(t,e,r){if((0,DI.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,IV.Create)(t,e);let n=new Set(t.required||[]),o={};for(let[s,c]of Object.entries(t.properties))!n.has(s)&&r[s]===void 0||(o[s]=vN(c,e,r[s]));if(typeof t.additionalProperties=="object"){let s=Object.getOwnPropertyNames(t.properties);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||(o[c]=vN(t.additionalProperties,e,r[c]))}return o}a(rhc,"FromObject");function nhc(t,e,r){if((0,DI.Check)(t,e,r))return(0,iie.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,IV.Create)(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=vN(o,e,l);return s}a(nhc,"FromRecord");function ihc(t,e,r){return vN((0,YBe.Deref)(t,e),e,r)}a(ihc,"FromRef");function ohc(t,e,r){return vN((0,YBe.Deref)(t,e),e,r)}a(ohc,"FromThis");function shc(t,e,r){return(0,DI.Check)(t,e,r)?(0,iie.Clone)(r):(0,hk.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>vN(n,e,r[o])):(0,IV.Create)(t,e)}a(shc,"FromTuple");function ahc(t,e,r){return(0,DI.Check)(t,e,r)?(0,iie.Clone)(r):zpc(t,e,r)}a(ahc,"FromUnion");function vN(t,e,r){let n=(0,hk.IsString)(t.$id)?(0,YBe.Pushref)(t,e):e,o=t;switch(t[ACt.Kind]){case"Array":return Jpc(o,n,r);case"Constructor":return Zpc(o,n,r);case"Import":return Xpc(o,n,r);case"Intersect":return ehc(o,n,r);case"Never":return thc(o,n,r);case"Object":return rhc(o,n,r);case"Record":return nhc(o,n,r);case"Ref":return ihc(o,n,r);case"This":return ohc(o,n,r);case"Tuple":return shc(o,n,r);case"Union":return ahc(o,n,r);case"Date":case"Symbol":case"Uint8Array":return Ypc(t,e,r);default:return Kpc(o,n,r)}}a(vN,"Visit");function S6i(...t){return t.length===3?vN(t[0],t[1],t[2]):vN(t[0],[],t[1])}a(S6i,"Cast")});var yCt=I(oie=>{"use strict";p();var chc=oie&&oie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lhc=oie&&oie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&chc(e,t,r)};Object.defineProperty(oie,"__esModule",{value:!0});lhc(T6i(),oie)});var x6i=I(cMr=>{"use strict";p();Object.defineProperty(cMr,"__esModule",{value:!0});cMr.Clean=Chc;var uhc=VD(),_Ct=kI(),dhc=EN(),aMr=yN(),I6i=Tn(),CN=Fg(),ECt=Is();function fhc(t){return(0,ECt.IsKind)(t)&&t[I6i.Kind]!=="Unsafe"}a(fhc,"IsCheckable");function phc(t,e,r){return(0,CN.IsArray)(r)?r.map(n=>LS(t.items,e,n)):r}a(phc,"FromArray");function hhc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return LS(o,[...e,...n],r)}a(hhc,"FromImport");function mhc(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>LS(l,e,(0,dhc.Clone)(r))).reduce((l,u)=>(0,CN.IsObject)(u)?{...l,...u}:u,{});if(!(0,CN.IsObject)(r)||!(0,CN.IsObject)(s)||!(0,ECt.IsKind)(n))return s;let c=(0,uhc.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,_Ct.Check)(n,e,r[l])&&(s[l]=LS(n,e,r[l]));return s}a(mhc,"FromIntersect");function ghc(t,e,r){if(!(0,CN.IsObject)(r)||(0,CN.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,CN.HasPropertyKey)(t.properties,o)){r[o]=LS(t.properties[o],e,r[o]);continue}if((0,ECt.IsKind)(n)&&(0,_Ct.Check)(n,e,r[o])){r[o]=LS(n,e,r[o]);continue}delete r[o]}return r}a(ghc,"FromObject");function Ahc(t,e,r){if(!(0,CN.IsObject)(r))return r;let n=t.additionalProperties,o=Object.getOwnPropertyNames(r),[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of o){if(l.test(u)){r[u]=LS(c,e,r[u]);continue}if((0,ECt.IsKind)(n)&&(0,_Ct.Check)(n,e,r[u])){r[u]=LS(n,e,r[u]);continue}delete r[u]}return r}a(Ahc,"FromRecord");function yhc(t,e,r){return LS((0,aMr.Deref)(t,e),e,r)}a(yhc,"FromRef");function _hc(t,e,r){return LS((0,aMr.Deref)(t,e),e,r)}a(_hc,"FromThis");function Ehc(t,e,r){if(!(0,CN.IsArray)(r))return r;if((0,CN.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(Ehc,"FromTuple");function vhc(t,e,r){for(let n of t.anyOf)if(fhc(n)&&(0,_Ct.Check)(n,e,r))return LS(n,e,r);return r}a(vhc,"FromUnion");function LS(t,e,r){let n=(0,CN.IsString)(t.$id)?(0,aMr.Pushref)(t,e):e,o=t;switch(o[I6i.Kind]){case"Array":return phc(o,n,r);case"Import":return hhc(o,n,r);case"Intersect":return mhc(o,n,r);case"Object":return ghc(o,n,r);case"Record":return Ahc(o,n,r);case"Ref":return yhc(o,n,r);case"This":return _hc(o,n,r);case"Tuple":return Ehc(o,n,r);case"Union":return vhc(o,n,r);default:return r}}a(LS,"Visit");function Chc(...t){return t.length===3?LS(t[0],t[1],t[2]):LS(t[0],[],t[1])}a(Chc,"Clean")});var vCt=I(sie=>{"use strict";p();var bhc=sie&&sie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Shc=sie&&sie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bhc(e,t,r)};Object.defineProperty(sie,"__esModule",{value:!0});Shc(x6i(),sie)});var D6i=I(uMr=>{"use strict";p();Object.defineProperty(uMr,"__esModule",{value:!0});uMr.Convert=amc;var Thc=EN(),w6i=kI(),lMr=yN(),Ihc=Tn(),Ga=Fg();function CCt(t){return(0,Ga.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(CCt,"IsStringNumeric");function xhc(t){return(0,Ga.IsBigInt)(t)||(0,Ga.IsBoolean)(t)||(0,Ga.IsNumber)(t)}a(xhc,"IsValueToString");function JBe(t){return t===!0||(0,Ga.IsNumber)(t)&&t===1||(0,Ga.IsBigInt)(t)&&t===BigInt("1")||(0,Ga.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(JBe,"IsValueTrue");function ZBe(t){return t===!1||(0,Ga.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,Ga.IsBigInt)(t)&&t===BigInt("0")||(0,Ga.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(ZBe,"IsValueFalse");function whc(t){return(0,Ga.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(whc,"IsTimeStringWithTimeZone");function Rhc(t){return(0,Ga.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(Rhc,"IsTimeStringWithoutTimeZone");function khc(t){return(0,Ga.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(khc,"IsDateTimeStringWithTimeZone");function Phc(t){return(0,Ga.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(Phc,"IsDateTimeStringWithoutTimeZone");function Dhc(t){return(0,Ga.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(Dhc,"IsDateString");function Nhc(t,e){let r=k6i(t);return r===e?r:t}a(Nhc,"TryConvertLiteralString");function Mhc(t,e){let r=P6i(t);return r===e?r:t}a(Mhc,"TryConvertLiteralNumber");function Ohc(t,e){let r=R6i(t);return r===e?r:t}a(Ohc,"TryConvertLiteralBoolean");function Lhc(t,e){return(0,Ga.IsString)(t.const)?Nhc(e,t.const):(0,Ga.IsNumber)(t.const)?Mhc(e,t.const):(0,Ga.IsBoolean)(t.const)?Ohc(e,t.const):e}a(Lhc,"TryConvertLiteral");function R6i(t){return JBe(t)?!0:ZBe(t)?!1:t}a(R6i,"TryConvertBoolean");function Bhc(t){let e=a(r=>r.split(".")[0],"truncateInteger");return CCt(t)?BigInt(e(t)):(0,Ga.IsNumber)(t)?BigInt(Math.trunc(t)):ZBe(t)?BigInt(0):JBe(t)?BigInt(1):t}a(Bhc,"TryConvertBigInt");function k6i(t){return(0,Ga.IsSymbol)(t)&&t.description!==void 0?t.description.toString():xhc(t)?t.toString():t}a(k6i,"TryConvertString");function P6i(t){return CCt(t)?parseFloat(t):JBe(t)?1:ZBe(t)?0:t}a(P6i,"TryConvertNumber");function Fhc(t){return CCt(t)?parseInt(t):(0,Ga.IsNumber)(t)?Math.trunc(t):JBe(t)?1:ZBe(t)?0:t}a(Fhc,"TryConvertInteger");function Uhc(t){return(0,Ga.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(Uhc,"TryConvertNull");function Qhc(t){return(0,Ga.IsString)(t)&&t==="undefined"?void 0:t}a(Qhc,"TryConvertUndefined");function qhc(t){return(0,Ga.IsDate)(t)?t:(0,Ga.IsNumber)(t)?new Date(t):JBe(t)?new Date(1):ZBe(t)?new Date(0):CCt(t)?new Date(parseInt(t)):Rhc(t)?new Date(`1970-01-01T${t}.000Z`):whc(t)?new Date(`1970-01-01T${t}`):Phc(t)?new Date(`${t}.000Z`):khc(t)?new Date(t):Dhc(t)?new Date(`${t}T00:00:00.000Z`):t}a(qhc,"TryConvertDate");function jhc(t,e,r){return((0,Ga.IsArray)(r)?r:[r]).map(o=>bN(t.items,e,o))}a(jhc,"FromArray");function Hhc(t,e,r){return Bhc(r)}a(Hhc,"FromBigInt");function Ghc(t,e,r){return R6i(r)}a(Ghc,"FromBoolean");function $hc(t,e,r){return qhc(r)}a($hc,"FromDate");function Vhc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return bN(o,[...e,...n],r)}a(Vhc,"FromImport");function Whc(t,e,r){return Fhc(r)}a(Whc,"FromInteger");function zhc(t,e,r){return t.allOf.reduce((n,o)=>bN(o,e,n),r)}a(zhc,"FromIntersect");function Yhc(t,e,r){return Lhc(t,r)}a(Yhc,"FromLiteral");function Khc(t,e,r){return Uhc(r)}a(Khc,"FromNull");function Jhc(t,e,r){return P6i(r)}a(Jhc,"FromNumber");function Zhc(t,e,r){if(!(0,Ga.IsObject)(r)||(0,Ga.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,Ga.HasPropertyKey)(r,n)&&(r[n]=bN(t.properties[n],e,r[n]));return r}a(Zhc,"FromObject");function Xhc(t,e,r){if(!((0,Ga.IsObject)(r)&&!(0,Ga.IsArray)(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=bN(s,e,l);return r}a(Xhc,"FromRecord");function emc(t,e,r){return bN((0,lMr.Deref)(t,e),e,r)}a(emc,"FromRef");function tmc(t,e,r){return k6i(r)}a(tmc,"FromString");function rmc(t,e,r){return(0,Ga.IsString)(r)||(0,Ga.IsNumber)(r)?Symbol(r):r}a(rmc,"FromSymbol");function nmc(t,e,r){return bN((0,lMr.Deref)(t,e),e,r)}a(nmc,"FromThis");function imc(t,e,r){return(0,Ga.IsArray)(r)&&!(0,Ga.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var cmc=aie&&aie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lmc=aie&&aie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cmc(e,t,r)};Object.defineProperty(aie,"__esModule",{value:!0});lmc(D6i(),aie)});var L6i=I(cie=>{"use strict";p();Object.defineProperty(cie,"__esModule",{value:!0});cie.TransformDecodeError=cie.TransformDecodeCheckError=void 0;cie.TransformDecode=Cmc;var umc=pLe(),N6i=Tn(),M6i=Gf(),O6i=VD(),fMr=yN(),dmc=kI(),bU=Fg(),XBe=Is(),dMr=class extends M6i.TypeBoxError{static{a(this,"TransformDecodeCheckError")}constructor(e,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=r,this.error=n}};cie.TransformDecodeCheckError=dMr;var SCt=class extends M6i.TypeBoxError{static{a(this,"TransformDecodeError")}constructor(e,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=e,this.path=r,this.value=n,this.error=o}};cie.TransformDecodeError=SCt;function cf(t,e,r){try{return(0,XBe.IsTransform)(t)?t[N6i.TransformKind].Decode(r):r}catch(n){throw new SCt(t,e,r,n)}}a(cf,"Default");function fmc(t,e,r,n){return(0,bU.IsArray)(n)?cf(t,r,n.map((o,s)=>SN(t.items,e,`${r}/${s}`,o))):cf(t,r,n)}a(fmc,"FromArray");function pmc(t,e,r,n){if(!(0,bU.IsObject)(n)||(0,bU.IsValueType)(n))return cf(t,r,n);let o=(0,O6i.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=SN(h,e,`${r}/${f}`,c[f]));if(!(0,XBe.IsTransform)(t.unevaluatedProperties))return cf(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=cf(u,`${r}/${f}`,d[f]));return cf(t,r,d)}a(pmc,"FromIntersect");function hmc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=SN(s,[...e,...o],r,n);return cf(t,r,c)}a(hmc,"FromImport");function mmc(t,e,r,n){return cf(t,r,SN(t.not,e,r,n))}a(mmc,"FromNot");function gmc(t,e,r,n){if(!(0,bU.IsObject)(n))return cf(t,r,n);let o=(0,O6i.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,bU.HasPropertyKey)(s,d)&&((0,bU.IsUndefined)(s[d])&&(!(0,XBe.IsUndefined)(t.properties[d])||umc.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=SN(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,XBe.IsSchema)(t.additionalProperties))return cf(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=cf(l,`${r}/${d}`,u[d]));return cf(t,r,u)}a(gmc,"FromObject");function Amc(t,e,r,n){if(!(0,bU.IsObject)(n))return cf(t,r,n);let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=new RegExp(o),c={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(c[f]=SN(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,XBe.IsSchema)(t.additionalProperties))return cf(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=cf(u,`${r}/${f}`,d[f]));return cf(t,r,d)}a(Amc,"FromRecord");function ymc(t,e,r,n){let o=(0,fMr.Deref)(t,e);return cf(t,r,SN(o,e,r,n))}a(ymc,"FromRef");function _mc(t,e,r,n){let o=(0,fMr.Deref)(t,e);return cf(t,r,SN(o,e,r,n))}a(_mc,"FromThis");function Emc(t,e,r,n){return(0,bU.IsArray)(n)&&(0,bU.IsArray)(t.items)?cf(t,r,t.items.map((o,s)=>SN(o,e,`${r}/${s}`,n[s]))):cf(t,r,n)}a(Emc,"FromTuple");function vmc(t,e,r,n){for(let o of t.anyOf){if(!(0,dmc.Check)(o,e,n))continue;let s=SN(o,e,r,n);return cf(t,r,s)}return cf(t,r,n)}a(vmc,"FromUnion");function SN(t,e,r,n){let o=(0,fMr.Pushref)(t,e),s=t;switch(t[N6i.Kind]){case"Array":return fmc(s,o,r,n);case"Import":return hmc(s,o,r,n);case"Intersect":return pmc(s,o,r,n);case"Not":return mmc(s,o,r,n);case"Object":return gmc(s,o,r,n);case"Record":return Amc(s,o,r,n);case"Ref":return ymc(s,o,r,n);case"Symbol":return cf(s,r,n);case"This":return _mc(s,o,r,n);case"Tuple":return Emc(s,o,r,n);case"Union":return vmc(s,o,r,n);default:return cf(s,r,n)}}a(SN,"Visit");function Cmc(t,e,r){return SN(t,e,"",r)}a(Cmc,"TransformDecode")});var q6i=I(lie=>{"use strict";p();Object.defineProperty(lie,"__esModule",{value:!0});lie.TransformEncodeError=lie.TransformEncodeCheckError=void 0;lie.TransformEncode=Mmc;var bmc=pLe(),F6i=Tn(),U6i=Gf(),Q6i=VD(),hMr=yN(),B6i=kI(),xV=Fg(),e3e=Is(),pMr=class extends U6i.TypeBoxError{static{a(this,"TransformEncodeCheckError")}constructor(e,r,n){super("The encoded value does not match the expected schema"),this.schema=e,this.value=r,this.error=n}};lie.TransformEncodeCheckError=pMr;var TCt=class extends U6i.TypeBoxError{static{a(this,"TransformEncodeError")}constructor(e,r,n,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=e,this.path=r,this.value=n,this.error=o}};lie.TransformEncodeError=TCt;function Ny(t,e,r){try{return(0,e3e.IsTransform)(t)?t[F6i.TransformKind].Encode(r):r}catch(n){throw new TCt(t,e,r,n)}}a(Ny,"Default");function Smc(t,e,r,n){let o=Ny(t,r,n);return(0,xV.IsArray)(o)?o.map((s,c)=>TN(t.items,e,`${r}/${c}`,s)):o}a(Smc,"FromArray");function Tmc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Ny(t,r,n);return TN(s,[...e,...o],r,c)}a(Tmc,"FromImport");function Imc(t,e,r,n){let o=Ny(t,r,n);if(!(0,xV.IsObject)(n)||(0,xV.IsValueType)(n))return o;let s=(0,Q6i.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=TN(m,e,`${r}/${h}`,l[h]));if(!(0,e3e.IsTransform)(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=Ny(d,`${r}/${h}`,f[h]));return f}a(Imc,"FromIntersect");function xmc(t,e,r,n){return Ny(t.not,r,Ny(t,r,n))}a(xmc,"FromNot");function wmc(t,e,r,n){let o=Ny(t,r,n);if(!(0,xV.IsObject)(o))return o;let s=(0,Q6i.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,xV.HasPropertyKey)(c,f)&&((0,xV.IsUndefined)(c[f])&&(!(0,e3e.IsUndefined)(t.properties[f])||bmc.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=TN(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,e3e.IsSchema)(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Ny(u,`${r}/${f}`,d[f]));return d}a(wmc,"FromObject");function Rmc(t,e,r,n){let o=Ny(t,r,n);if(!(0,xV.IsObject)(n))return o;let s=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(s),l={...o};for(let h of Object.getOwnPropertyNames(n))c.test(h)&&(l[h]=TN(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,e3e.IsSchema)(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=Ny(d,`${r}/${h}`,f[h]));return f}a(Rmc,"FromRecord");function kmc(t,e,r,n){let o=(0,hMr.Deref)(t,e),s=TN(o,e,r,n);return Ny(t,r,s)}a(kmc,"FromRef");function Pmc(t,e,r,n){let o=(0,hMr.Deref)(t,e),s=TN(o,e,r,n);return Ny(t,r,s)}a(Pmc,"FromThis");function Dmc(t,e,r,n){let o=Ny(t,r,n);return(0,xV.IsArray)(t.items)?t.items.map((s,c)=>TN(s,e,`${r}/${c}`,o[c])):[]}a(Dmc,"FromTuple");function Nmc(t,e,r,n){for(let o of t.anyOf){if(!(0,B6i.Check)(o,e,n))continue;let s=TN(o,e,r,n);return Ny(t,r,s)}for(let o of t.anyOf){let s=TN(o,e,r,n);if((0,B6i.Check)(t,e,s))return Ny(t,r,s)}return Ny(t,r,n)}a(Nmc,"FromUnion");function TN(t,e,r,n){let o=(0,hMr.Pushref)(t,e),s=t;switch(t[F6i.Kind]){case"Array":return Smc(s,o,r,n);case"Import":return Tmc(s,o,r,n);case"Intersect":return Imc(s,o,r,n);case"Not":return xmc(s,o,r,n);case"Object":return wmc(s,o,r,n);case"Record":return Rmc(s,o,r,n);case"Ref":return kmc(s,o,r,n);case"This":return Pmc(s,o,r,n);case"Tuple":return Dmc(s,o,r,n);case"Union":return Nmc(s,o,r,n);default:return Ny(s,r,n)}}a(TN,"Visit");function Mmc(t,e,r){return TN(t,e,"",r)}a(Mmc,"TransformEncode")});var j6i=I(AMr=>{"use strict";p();Object.defineProperty(AMr,"__esModule",{value:!0});AMr.HasTransform=Zmc;var gMr=yN(),Omc=Tn(),Gm=Is(),Lmc=Fg();function Bmc(t,e){return(0,Gm.IsTransform)(t)||qg(t.items,e)}a(Bmc,"FromArray");function Fmc(t,e){return(0,Gm.IsTransform)(t)||qg(t.items,e)}a(Fmc,"FromAsyncIterator");function Umc(t,e){return(0,Gm.IsTransform)(t)||qg(t.returns,e)||t.parameters.some(r=>qg(r,e))}a(Umc,"FromConstructor");function Qmc(t,e){return(0,Gm.IsTransform)(t)||qg(t.returns,e)||t.parameters.some(r=>qg(r,e))}a(Qmc,"FromFunction");function qmc(t,e){return(0,Gm.IsTransform)(t)||(0,Gm.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>qg(r,e))}a(qmc,"FromIntersect");function jmc(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,Gm.IsTransform)(t)||qg(n,[...r,...e])}a(jmc,"FromImport");function Hmc(t,e){return(0,Gm.IsTransform)(t)||qg(t.items,e)}a(Hmc,"FromIterator");function Gmc(t,e){return(0,Gm.IsTransform)(t)||qg(t.not,e)}a(Gmc,"FromNot");function $mc(t,e){return(0,Gm.IsTransform)(t)||Object.values(t.properties).some(r=>qg(r,e))||(0,Gm.IsSchema)(t.additionalProperties)&&qg(t.additionalProperties,e)}a($mc,"FromObject");function Vmc(t,e){return(0,Gm.IsTransform)(t)||qg(t.item,e)}a(Vmc,"FromPromise");function Wmc(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,Gm.IsTransform)(t)||qg(n,e)||(0,Gm.IsSchema)(t.additionalProperties)&&(0,Gm.IsTransform)(t.additionalProperties)}a(Wmc,"FromRecord");function zmc(t,e){return(0,Gm.IsTransform)(t)?!0:qg((0,gMr.Deref)(t,e),e)}a(zmc,"FromRef");function Ymc(t,e){return(0,Gm.IsTransform)(t)?!0:qg((0,gMr.Deref)(t,e),e)}a(Ymc,"FromThis");function Kmc(t,e){return(0,Gm.IsTransform)(t)||!(0,Lmc.IsUndefined)(t.items)&&t.items.some(r=>qg(r,e))}a(Kmc,"FromTuple");function Jmc(t,e){return(0,Gm.IsTransform)(t)||t.anyOf.some(r=>qg(r,e))}a(Jmc,"FromUnion");function qg(t,e){let r=(0,gMr.Pushref)(t,e),n=t;if(t.$id&&mMr.has(t.$id))return!1;switch(t.$id&&mMr.add(t.$id),t[Omc.Kind]){case"Array":return Bmc(n,r);case"AsyncIterator":return Fmc(n,r);case"Constructor":return Umc(n,r);case"Function":return Qmc(n,r);case"Import":return jmc(n,r);case"Intersect":return qmc(n,r);case"Iterator":return Hmc(n,r);case"Not":return Gmc(n,r);case"Object":return $mc(n,r);case"Promise":return Vmc(n,r);case"Record":return Wmc(n,r);case"Ref":return zmc(n,r);case"This":return Ymc(n,r);case"Tuple":return Kmc(n,r);case"Union":return Jmc(n,r);default:return(0,Gm.IsTransform)(t)}}a(qg,"Visit");var mMr=new Set;function Zmc(t,e){return mMr.clear(),qg(t,e)}a(Zmc,"HasTransform")});var t3e=I(SU=>{"use strict";p();var Xmc=SU&&SU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yMr=SU&&SU.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Xmc(e,t,r)};Object.defineProperty(SU,"__esModule",{value:!0});yMr(L6i(),SU);yMr(q6i(),SU);yMr(j6i(),SU)});var H6i=I(EMr=>{"use strict";p();Object.defineProperty(EMr,"__esModule",{value:!0});EMr.Decode=rgc;var _Mr=t3e(),egc=kI(),tgc=y_e();function rgc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,egc.Check)(e,r,n))throw new _Mr.TransformDecodeCheckError(e,n,(0,tgc.Errors)(e,r,n).First());return(0,_Mr.HasTransform)(e,r)?(0,_Mr.TransformDecode)(e,r,n):n}a(rgc,"Decode")});var vMr=I(uie=>{"use strict";p();var ngc=uie&&uie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),igc=uie&&uie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ngc(e,t,r)};Object.defineProperty(uie,"__esModule",{value:!0});igc(H6i(),uie)});var $6i=I(SMr=>{"use strict";p();Object.defineProperty(SMr,"__esModule",{value:!0});SMr.Default=ygc;var ogc=kI(),G6i=EN(),bMr=yN(),sgc=Tn(),BS=Fg(),agc=Is();function TU(t,e){let r=(0,BS.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,BS.IsFunction)(r)?r():(0,G6i.Clone)(r);return(0,BS.IsUndefined)(e)?n:(0,BS.IsObject)(e)&&(0,BS.IsObject)(n)?Object.assign(n,e):e}a(TU,"ValueOrDefault");function CMr(t){return(0,agc.IsKind)(t)&&"default"in t}a(CMr,"HasDefaultProperty");function cgc(t,e,r){if((0,BS.IsArray)(r)){for(let o=0;o{let c=rC(s,e,n);return(0,BS.IsObject)(c)?{...o,...c}:c},{})}a(dgc,"FromIntersect");function fgc(t,e,r){let n=TU(t,r);if(!(0,BS.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=rC(t.properties[s],e,n[s]);(0,BS.IsUndefined)(c)||(n[s]=rC(t.properties[s],e,n[s]))}if(!CMr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=rC(t.additionalProperties,e,n[s]));return n}a(fgc,"FromObject");function pgc(t,e,r){let n=TU(t,r);if(!(0,BS.IsObject)(n))return n;let o=t.additionalProperties,[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of Object.getOwnPropertyNames(n))l.test(u)&&CMr(c)&&(n[u]=rC(c,e,n[u]));if(!CMr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=rC(o,e,n[u]));return n}a(pgc,"FromRecord");function hgc(t,e,r){return rC((0,bMr.Deref)(t,e),e,TU(t,r))}a(hgc,"FromRef");function mgc(t,e,r){return rC((0,bMr.Deref)(t,e),e,r)}a(mgc,"FromThis");function ggc(t,e,r){let n=TU(t,r);if(!(0,BS.IsArray)(n)||(0,BS.IsUndefined)(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;c{"use strict";p();var _gc=die&&die.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Egc=die&&die.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_gc(e,t,r)};Object.defineProperty(die,"__esModule",{value:!0});Egc($6i(),die)});var z6i=I(IN=>{"use strict";p();Object.defineProperty(IN,"__esModule",{value:!0});IN.ValuePointerRootDeleteError=IN.ValuePointerRootSetError=void 0;IN.Format=r3e;IN.Set=vgc;IN.Delete=Cgc;IN.Has=bgc;IN.Get=Sgc;var W6i=Gf(),xCt=class extends W6i.TypeBoxError{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}};IN.ValuePointerRootSetError=xCt;var wCt=class extends W6i.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};IN.ValuePointerRootDeleteError=wCt;function V6i(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(V6i,"Escape");function*r3e(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var Tgc=jL&&jL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Igc=jL&&jL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xgc=jL&&jL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(TMr,"__esModule",{value:!0});TMr.Equal=kCt;var IU=Fg();function wgc(t,e){if(!(0,IU.IsObject)(e))return!1;let r=[...Object.keys(t),...Object.getOwnPropertySymbols(t)],n=[...Object.keys(e),...Object.getOwnPropertySymbols(e)];return r.length!==n.length?!1:r.every(o=>kCt(t[o],e[o]))}a(wgc,"ObjectType");function Rgc(t,e){return(0,IU.IsDate)(e)&&t.getTime()===e.getTime()}a(Rgc,"DateType");function kgc(t,e){return!(0,IU.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>kCt(r,e[n]))}a(kgc,"ArrayType");function Pgc(t,e){return!(0,IU.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>kCt(r,e[n]))}a(Pgc,"TypedArrayType");function Dgc(t,e){return t===e}a(Dgc,"ValueType");function kCt(t,e){if((0,IU.IsDate)(t))return Rgc(t,e);if((0,IU.IsTypedArray)(t))return Pgc(t,e);if((0,IU.IsArray)(t))return kgc(t,e);if((0,IU.IsObject)(t))return wgc(t,e);if((0,IU.IsValueType)(t))return Dgc(t,e);throw new Error("ValueEquals: Unable to compare value")}a(kCt,"Equal")});var X6i=I(My=>{"use strict";p();Object.defineProperty(My,"__esModule",{value:!0});My.ValueDiffError=My.Edit=My.Delete=My.Update=My.Insert=void 0;My.Diff=Qgc;My.Patch=Hgc;var HL=Fg(),xMr=RCt(),wMr=EN(),Ngc=IMr(),Mgc=Gf(),RMr=nE(),kMr=Wv(),PMr=B$(),K6i=H$(),Ogc=Op();My.Insert=(0,kMr.Object)({type:(0,RMr.Literal)("insert"),path:(0,PMr.String)(),value:(0,K6i.Unknown)()});My.Update=(0,kMr.Object)({type:(0,RMr.Literal)("update"),path:(0,PMr.String)(),value:(0,K6i.Unknown)()});My.Delete=(0,kMr.Object)({type:(0,RMr.Literal)("delete"),path:(0,PMr.String)()});My.Edit=(0,Ogc.Union)([My.Insert,My.Update,My.Delete]);var n3e=class extends Mgc.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};My.ValueDiffError=n3e;function PCt(t,e){return{type:"update",path:t,value:e}}a(PCt,"CreateUpdate");function J6i(t,e){return{type:"insert",path:t,value:e}}a(J6i,"CreateInsert");function Z6i(t){return{type:"delete",path:t}}a(Z6i,"CreateDelete");function Y6i(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new n3e(t,"Cannot diff objects with symbols")}a(Y6i,"AssertDiffable");function*Lgc(t,e,r){if(Y6i(e),Y6i(r),!(0,HL.IsStandardObject)(r))return yield PCt(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,HL.HasPropertyKey)(e,s)||(yield J6i(`${t}/${s}`,r[s]));for(let s of n)(0,HL.HasPropertyKey)(r,s)&&((0,Ngc.Equal)(e,r)||(yield*DCt(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,HL.HasPropertyKey)(r,s)||(yield Z6i(`${t}/${s}`))}a(Lgc,"ObjectType");function*Bgc(t,e,r){if(!(0,HL.IsArray)(r))return yield PCt(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(qgc,"IsRootUpdate");function jgc(t){return t.length===0}a(jgc,"IsIdentity");function Hgc(t,e){if(qgc(e))return(0,wMr.Clone)(e[0].value);if(jgc(e))return(0,wMr.Clone)(t);let r=(0,wMr.Clone)(t);for(let n of e)switch(n.type){case"insert":{xMr.ValuePointer.Set(r,n.path,n.value);break}case"update":{xMr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{xMr.ValuePointer.Delete(r,n.path);break}}return r}a(Hgc,"Patch")});var DMr=I(fie=>{"use strict";p();var Ggc=fie&&fie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$gc=fie&&fie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ggc(e,t,r)};Object.defineProperty(fie,"__esModule",{value:!0});$gc(X6i(),fie)});var eUi=I(MMr=>{"use strict";p();Object.defineProperty(MMr,"__esModule",{value:!0});MMr.Encode=zgc;var NMr=t3e(),Vgc=kI(),Wgc=y_e();function zgc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,NMr.HasTransform)(e,r)?(0,NMr.TransformEncode)(e,r,n):n;if(!(0,Vgc.Check)(e,r,o))throw new NMr.TransformEncodeCheckError(e,o,(0,Wgc.Errors)(e,r,o).First());return o}a(zgc,"Encode")});var OMr=I(pie=>{"use strict";p();var Ygc=pie&&pie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Kgc=pie&&pie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ygc(e,t,r)};Object.defineProperty(pie,"__esModule",{value:!0});Kgc(eUi(),pie)});var LMr=I(hie=>{"use strict";p();var Jgc=hie&&hie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zgc=hie&&hie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Jgc(e,t,r)};Object.defineProperty(hie,"__esModule",{value:!0});Zgc(IMr(),hie)});var rUi=I(o3e=>{"use strict";p();Object.defineProperty(o3e,"__esModule",{value:!0});o3e.ValueMutateError=void 0;o3e.Mutate=o0c;var xN=Fg(),MCt=RCt(),BMr=EN(),Xgc=Gf();function NCt(t){return(0,xN.IsObject)(t)&&!(0,xN.IsArray)(t)}a(NCt,"IsStandardObject");var i3e=class extends Xgc.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};o3e.ValueMutateError=i3e;function e0c(t,e,r,n){if(!NCt(r))MCt.ValuePointer.Set(t,e,(0,BMr.Clone)(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)FMr(t,`${e}/${c}`,r[c],n[c])}}a(e0c,"ObjectType");function t0c(t,e,r,n){if(!(0,xN.IsArray)(r))MCt.ValuePointer.Set(t,e,(0,BMr.Clone)(n));else{for(let o=0;o{"use strict";p();var s0c=mie&&mie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),a0c=mie&&mie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s0c(e,t,r)};Object.defineProperty(mie,"__esModule",{value:!0});a0c(rUi(),mie)});var iUi=I(wN=>{"use strict";p();Object.defineProperty(wN,"__esModule",{value:!0});wN.ParseDefault=wN.ParseRegistry=wN.ParseError=void 0;wN.Parse=g0c;var c0c=Gf(),OCt=t3e(),l0c=mCt(),u0c=yCt(),d0c=vCt(),f0c=EN(),p0c=bCt(),h0c=ICt(),nUi=Fg(),s3e=class extends c0c.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};wN.ParseError=s3e;var QMr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,l0c.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,u0c.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,d0c.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,f0c.Clone)(l)],["Convert",(s,c,l)=>(0,p0c.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,OCt.HasTransform)(s,c)?(0,OCt.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,h0c.Default)(s,c,l)],["Encode",(s,c,l)=>(0,OCt.HasTransform)(s,c)?(0,OCt.TransformEncode)(s,c,l):l]]);function r(s){e.delete(s)}a(r,"Delete"),t.Delete=r;function n(s,c){e.set(s,c)}a(n,"Set"),t.Set=n;function o(s){return e.get(s)}a(o,"Get"),t.Get=o})(QMr||(wN.ParseRegistry=QMr={}));wN.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function m0c(t,e,r,n){return t.reduce((o,s)=>{let c=QMr.Get(s);if((0,nUi.IsUndefined)(c))throw new s3e(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(m0c,"ParseValue");function g0c(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,nUi.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[wN.ParseDefault,t[0],t[1],t[2]]:t.length===2?[wN.ParseDefault,t[0],[],t[1]]:(()=>{throw new s3e("Invalid Arguments")})();return m0c(e,r,n,o)}a(g0c,"Parse")});var qMr=I(gie=>{"use strict";p();var A0c=gie&&gie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y0c=gie&&gie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A0c(e,t,r)};Object.defineProperty(gie,"__esModule",{value:!0});y0c(iUi(),gie)});var sUi=I(xs=>{"use strict";p();Object.defineProperty(xs,"__esModule",{value:!0});xs.Parse=xs.Mutate=xs.Hash=xs.Equal=xs.Encode=xs.Edit=xs.Patch=xs.Diff=xs.Default=xs.Decode=xs.Create=xs.Convert=xs.Clone=xs.Clean=xs.Check=xs.Cast=xs.Assert=xs.ValueErrorIterator=xs.Errors=void 0;var oUi=y_e();Object.defineProperty(xs,"Errors",{enumerable:!0,get:a(function(){return oUi.Errors},"get")});Object.defineProperty(xs,"ValueErrorIterator",{enumerable:!0,get:a(function(){return oUi.ValueErrorIterator},"get")});var _0c=mCt();Object.defineProperty(xs,"Assert",{enumerable:!0,get:a(function(){return _0c.Assert},"get")});var E0c=yCt();Object.defineProperty(xs,"Cast",{enumerable:!0,get:a(function(){return E0c.Cast},"get")});var v0c=kI();Object.defineProperty(xs,"Check",{enumerable:!0,get:a(function(){return v0c.Check},"get")});var C0c=vCt();Object.defineProperty(xs,"Clean",{enumerable:!0,get:a(function(){return C0c.Clean},"get")});var b0c=EN();Object.defineProperty(xs,"Clone",{enumerable:!0,get:a(function(){return b0c.Clone},"get")});var S0c=bCt();Object.defineProperty(xs,"Convert",{enumerable:!0,get:a(function(){return S0c.Convert},"get")});var T0c=gCt();Object.defineProperty(xs,"Create",{enumerable:!0,get:a(function(){return T0c.Create},"get")});var I0c=vMr();Object.defineProperty(xs,"Decode",{enumerable:!0,get:a(function(){return I0c.Decode},"get")});var x0c=ICt();Object.defineProperty(xs,"Default",{enumerable:!0,get:a(function(){return x0c.Default},"get")});var jMr=DMr();Object.defineProperty(xs,"Diff",{enumerable:!0,get:a(function(){return jMr.Diff},"get")});Object.defineProperty(xs,"Patch",{enumerable:!0,get:a(function(){return jMr.Patch},"get")});Object.defineProperty(xs,"Edit",{enumerable:!0,get:a(function(){return jMr.Edit},"get")});var w0c=OMr();Object.defineProperty(xs,"Encode",{enumerable:!0,get:a(function(){return w0c.Encode},"get")});var R0c=LMr();Object.defineProperty(xs,"Equal",{enumerable:!0,get:a(function(){return R0c.Equal},"get")});var k0c=qBe();Object.defineProperty(xs,"Hash",{enumerable:!0,get:a(function(){return k0c.Hash},"get")});var P0c=UMr();Object.defineProperty(xs,"Mutate",{enumerable:!0,get:a(function(){return P0c.Mutate},"get")});var D0c=qMr();Object.defineProperty(xs,"Parse",{enumerable:!0,get:a(function(){return D0c.Parse},"get")})});var aUi=I(GL=>{"use strict";p();var N0c=GL&&GL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M0c=GL&&GL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),O0c=GL&&GL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var L0c=nl&&nl.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dA=nl&&nl.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&L0c(e,t,r)};Object.defineProperty(nl,"__esModule",{value:!0});nl.Value=nl.ValueErrorIterator=nl.ValueErrorType=void 0;var cUi=y_e();Object.defineProperty(nl,"ValueErrorType",{enumerable:!0,get:a(function(){return cUi.ValueErrorType},"get")});Object.defineProperty(nl,"ValueErrorIterator",{enumerable:!0,get:a(function(){return cUi.ValueErrorIterator},"get")});dA(Fg(),nl);dA(mCt(),nl);dA(yCt(),nl);dA(kI(),nl);dA(vCt(),nl);dA(EN(),nl);dA(bCt(),nl);dA(gCt(),nl);dA(vMr(),nl);dA(ICt(),nl);dA(DMr(),nl);dA(OMr(),nl);dA(LMr(),nl);dA(qBe(),nl);dA(UMr(),nl);dA(qMr(),nl);dA(RCt(),nl);dA(t3e(),nl);var B0c=aUi();Object.defineProperty(nl,"Value",{enumerable:!0,get:a(function(){return B0c.Value},"get")})});var uUi=I(LCt=>{"use strict";p();Object.defineProperty(LCt,"__esModule",{value:!0});LCt.assertShape=void 0;var lUi=HMr(),F0c=a((t,e)=>{if(lUi.Value.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...lUi.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");LCt.assertShape=F0c});var Aie={};Ti(Aie,{CAPIClient:()=>G0c,RequestType:()=>fUi});async function j0c(t){if(!t)return;let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),r=Math.floor(Date.now()/1e3).toString(),n=new TextEncoder().encode(r),o=await crypto.subtle.sign("HMAC",e,n),s=Array.from(new Uint8Array(o)).map(c=>c.toString(16).padStart(2,"0")).join("");return`${r}.${s}`}function H0c(t){return new Set(["ChatCompletions","ChatResponses","ChatMessages","CAPIEmbeddings","Models","RemoteAgent","CodeReviewAgent","RemoteAgentChat","ListSkills","SearchSkill","ModelPolicy","ListModel","AutoModels","CopilotSessionLogs","CopilotSessionDetails","CopilotSessions","CopilotAgentJob","CCAModelsList","CopilotCustomAgents","CopilotAgentMemory","ModelRouter"]).has(t)}var U0c,GMr,a3e,Q0c,q0c,fUi,G0c,yie=Se(()=>{p();U0c=class{static{a(this,"y")}async fetch(t,e){let r={method:e.method||"GET",headers:e.headers,signal:e.signal};e.json?(r.body=JSON.stringify(e.json),r.headers={"Content-Type":"application/json",...r.headers}):e.body&&(r.body=e.body);let n,o;e.timeout&&!e.signal&&(o=new AbortController,r.signal=o.signal,n=setTimeout(()=>{o.abort()},e.timeout));try{let s=await fetch(t,r);return n&&clearTimeout(n),s}catch(s){throw n&&clearTimeout(n),s}}async fetchWithPagination(t,e){let r=[],n=e.pageSize??20,o=e.startPage??1,s=!1;do{let c=e.buildUrl(t,n,o),l=await this.fetch(c,e);if(!l.ok)return r;let u=await l.json(),d=e.getItemsFromResponse(u);r.push(...d),s=d.length===n,o++}while(s);return r}createWebSocket(t,e){return{webSocket:new WebSocket(t)}}},GMr=class dUi{static{a(this,"h")}constructor(){this._telemetryBaseUrl="https://copilot-telemetry.githubusercontent.com",this._originTrackerUrl="https://origin-tracker.githubusercontent.com",this._dotcomAPIUrl=this._getDotComAPIUrl(),this._proxyBaseUrl=this._getProxyUrl(void 0),this._capiBaseUrl=this._getCAPIUrl(void 0)}updateDomains(e,r){let n=this._dotcomAPIUrl,o=this._capiBaseUrl,s=this._telemetryBaseUrl,c=this._proxyBaseUrl;return this._enterpriseUrlConfig!==r&&(this._enterpriseUrlConfig=r,this._dotcomAPIUrl=this._getDotComAPIUrl()),e?(this._proxyBaseUrl=this._getProxyUrl(e),this._capiBaseUrl=this._getCAPIUrl(e),this._telemetryBaseUrl=e.endpoints.telemetry||"https://copilot-telemetry.githubusercontent.com",e.endpoints["origin-tracker"]&&(this._originTrackerUrl=e.endpoints["origin-tracker"])):(this._capiBaseUrl="https://api.githubcopilot.com",this._telemetryBaseUrl="https://copilot-telemetry.githubusercontent.com"),{dotcomUrlChanged:n!==this._dotcomAPIUrl,capiUrlChanged:o!==this._capiBaseUrl,telemetryUrlChanged:s!==this._telemetryBaseUrl,proxyUrlChanged:c!==this._proxyBaseUrl}}_getDotComAPIUrl(){if(this._enterpriseUrlConfig)try{let e=new URL(this._enterpriseUrlConfig);return`${e.protocol}//api.${e.hostname}${e.port?":"+e.port:""}`}catch(e){return console.warn("Failed to parse enterprise URL config:",this._enterpriseUrlConfig,e),"https://api.github.com"}return"https://api.github.com"}_getCAPIUrl(e){return e&&e.endpoints.api||"https://api.githubcopilot.com"}_getProxyUrl(e){return e&&e.endpoints.proxy||dUi.DEFAULT_PROXY_BASE_URL}get proxyBaseURL(){return this._proxyBaseUrl}get capiBaseURL(){return this._capiBaseUrl}get capiChatURL(){return`${this._capiBaseUrl}/chat/completions`}get capiResponsesURL(){return`${this._capiBaseUrl}/responses`}get capiMessagesURL(){return`${this._capiBaseUrl}/v1/messages`}get capiEmbeddingsURL(){return`${this._capiBaseUrl}/embeddings`}get capiModelsURL(){return`${this._capiBaseUrl}/models`}get capiAutoModelURL(){return`${this.capiModelsURL}/session`}get capiModelRouterURL(){return`${this.capiAutoModelURL}/intent`}get embeddingsModelURL(){return`${this.embeddingsURL}/models`}get chunksURL(){return`${this.dotComAPIURL}/chunks`}get embeddingsURL(){return`${this.dotComAPIURL}/embeddings`}get embeddingsCodeSearchURL(){return`${this.dotComAPIURL}/embeddings/code/search`}get telemetryURL(){return`${this._telemetryBaseUrl}/telemetry`}get remoteAgentsURL(){return`${this._capiBaseUrl}/agents`}get listSkillsURL(){return`${this._capiBaseUrl}/skills`}get searchSkillURL(){return`${this._capiBaseUrl}/search`}get contentExclusionURL(){return`${this._dotcomAPIUrl}/copilot_internal/content_exclusion`}get copilotUserInfoURL(){return`${this._dotcomAPIUrl}/copilot_internal/user`}get tokenURL(){return this._dotcomAPIUrl+"/copilot_internal/v2/token"}get tokenNoAuthURL(){return`${this._dotcomAPIUrl}/copilot_internal/v2/nltoken`}get dotComAPIURL(){return this._dotcomAPIUrl}get originTrackerURL(){return this._originTrackerUrl}get chatAttachmentUploadURL(){return"https://uploads.github.com/copilot/chat/attachments"}get copilotAgentSessionsURL(){return`${this._capiBaseUrl}/agents/sessions`}get copilotAgentJobsURL(){return`${this._capiBaseUrl}/agents/swe`}get copilotAgentTasksURL(){return`${this._dotcomAPIUrl}/cmc_internal/api/agents`}get CCAModelsURL(){return`${this._capiBaseUrl}/agents/swe/models`}get copilotCustomAgentsURL(){return`${this._capiBaseUrl}/agents/swe/custom-agents`}get copilotAgentMemoryURL(){return`${this._capiBaseUrl}/agents/swe/internal/memory/v0`}};GMr.DEFAULT_PROXY_BASE_URL="https://copilot-proxy.githubusercontent.com",GMr.CAPI_MODEL_LAB_URL="https://api-model-lab.githubcopilot.com";a3e=GMr,Q0c=`The \u201C@vscode/copilot-api\u201D npm Module Terms and Conditions ("Terms") are a legal agreement between you (either as an individual or on behalf of an entity) and GitHub, Inc. regarding your use of \u201C@vscode/copilot-api\u201D npm library and associated documentation (collectively, the "Software"). By using the Software, you accept these Terms. Please read all of these Terms; in many cases, provisions set forth later in the Terms limit and qualify provisions set forth earlier in the Terms. If you do not accept these Terms, do not download, install, use, or copy the Software. +`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(Muc,"applyEditsForNotebook");function Ouc(t,e,r){let n=t.get(Iuc.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,xuc.getMaxSolutionTokens)(),c=(0,Y8i.getNumberOfSnippets)(e,r),l=(0,Y8i.getSimilarFilesOptions)(t,e,r),u=n.suffixPercent(e),d=n.suffixMatchThreshold(e);if(u<0||u>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${u}`);if(d<0||d>100)throw new Error(`suffixMatchThreshold must be between 0 and 100, but was ${d}`);return{maxPromptLength:s,similarFilesOptions:l,numberOfSnippets:c,suffixPercent:u,suffixMatchThreshold:d}}a(Ouc,"getPromptOptions")});var J8i=I(JNr=>{"use strict";p();Object.defineProperty(JNr,"__esModule",{value:!0});JNr.Evaluate=Luc;function Luc(...t){return new globalThis.Function(...t)}a(Luc,"Evaluate")});var e6i=I(TV=>{"use strict";p();Object.defineProperty(TV,"__esModule",{value:!0});TV.TypeSystem=TV.TypeSystemDuplicateFormat=TV.TypeSystemDuplicateTypeKind=void 0;var sCt=hye(),Buc=$Le(),Fuc=Tn(),X8i=Gf(),aCt=class extends X8i.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};TV.TypeSystemDuplicateTypeKind=aCt;var cCt=class extends X8i.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};TV.TypeSystemDuplicateFormat=cCt;var Z8i;(function(t){function e(n,o){if(sCt.TypeRegistry.Has(n))throw new aCt(n);return sCt.TypeRegistry.Set(n,o),(s={})=>(0,Buc.Unsafe)({...s,[Fuc.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(sCt.FormatRegistry.Has(n))throw new cCt(n);return sCt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(Z8i||(TV.TypeSystem=Z8i={}))});var XNr=I(_U=>{"use strict";p();var Uuc=_U&&_U.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZNr=_U&&_U.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Uuc(e,t,r)};Object.defineProperty(_U,"__esModule",{value:!0});ZNr(J8i(),_U);ZNr(pLe(),_U);ZNr(e6i(),_U)});var eMr=I(UBe=>{"use strict";p();Object.defineProperty(UBe,"__esModule",{value:!0});UBe.DefaultErrorFunction=t6i;UBe.SetErrorFunction=quc;UBe.GetErrorFunction=juc;var Quc=Tn(),$n=tMr();function t6i(t){switch(t.errorType){case $n.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case $n.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case $n.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case $n.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case $n.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case $n.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case $n.ValueErrorType.Array:return"Expected array";case $n.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case $n.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case $n.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case $n.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case $n.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case $n.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case $n.ValueErrorType.BigInt:return"Expected bigint";case $n.ValueErrorType.Boolean:return"Expected boolean";case $n.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case $n.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case $n.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case $n.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case $n.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case $n.ValueErrorType.Date:return"Expected Date";case $n.ValueErrorType.Function:return"Expected function";case $n.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case $n.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case $n.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case $n.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case $n.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case $n.ValueErrorType.Integer:return"Expected integer";case $n.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case $n.ValueErrorType.Intersect:return"Expected all values to match";case $n.ValueErrorType.Iterator:return"Expected Iterator";case $n.ValueErrorType.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case $n.ValueErrorType.Never:return"Never";case $n.ValueErrorType.Not:return"Value should not match";case $n.ValueErrorType.Null:return"Expected null";case $n.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case $n.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case $n.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case $n.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case $n.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case $n.ValueErrorType.Number:return"Expected number";case $n.ValueErrorType.Object:return"Expected object";case $n.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case $n.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case $n.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case $n.ValueErrorType.ObjectRequiredProperty:return"Expected required property";case $n.ValueErrorType.Promise:return"Expected Promise";case $n.ValueErrorType.RegExp:return"Expected string to match regular expression";case $n.ValueErrorType.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case $n.ValueErrorType.StringFormat:return`Expected string to match '${t.schema.format}' format`;case $n.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case $n.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case $n.ValueErrorType.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case $n.ValueErrorType.String:return"Expected string";case $n.ValueErrorType.Symbol:return"Expected symbol";case $n.ValueErrorType.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case $n.ValueErrorType.Tuple:return"Expected tuple";case $n.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case $n.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case $n.ValueErrorType.Uint8Array:return"Expected Uint8Array";case $n.ValueErrorType.Undefined:return"Expected undefined";case $n.ValueErrorType.Union:return"Expected union value";case $n.ValueErrorType.Void:return"Expected void";case $n.ValueErrorType.Kind:return`Expected kind '${t.schema[Quc.Kind]}'`;default:return"Unknown error type"}}a(t6i,"DefaultErrorFunction");var r6i=t6i;function quc(t){r6i=t}a(quc,"SetErrorFunction");function juc(){return r6i}a(juc,"GetErrorFunction")});var o6i=I(h_e=>{"use strict";p();Object.defineProperty(h_e,"__esModule",{value:!0});h_e.TypeDereferenceError=void 0;h_e.Pushref=Vuc;h_e.Deref=i6i;var Huc=Gf(),n6i=Tn(),Guc=t_t(),lCt=class extends Huc.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};h_e.TypeDereferenceError=lCt;function $uc(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new lCt(t);return i6i(r,e)}a($uc,"Resolve");function Vuc(t,e){return!(0,Guc.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Vuc,"Pushref");function i6i(t,e){return t[n6i.Kind]==="This"||t[n6i.Kind]==="Ref"?$uc(t,e):t}a(i6i,"Deref")});var yN=I(Zne=>{"use strict";p();var Wuc=Zne&&Zne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zuc=Zne&&Zne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Wuc(e,t,r)};Object.defineProperty(Zne,"__esModule",{value:!0});zuc(o6i(),Zne)});var l6i=I(QBe=>{"use strict";p();Object.defineProperty(QBe,"__esModule",{value:!0});QBe.ValueHashError=void 0;QBe.Hash=ddc;var _N=Ug(),Yuc=Gf(),uCt=class extends Yuc.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};QBe.ValueHashError=uCt;var RI;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(RI||(RI={}));var m_e=BigInt("14695981039346656037"),[Kuc,Juc]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Zuc=Array.from({length:256}).map((t,e)=>BigInt(e)),s6i=new Float64Array(1),a6i=new DataView(s6i.buffer),c6i=new Uint8Array(s6i.buffer);function*Xuc(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let r=0;r>8*(e-1-r)&255}a(Xuc,"NumberToBytes");function edc(t){cE(RI.Array);for(let e of t)g_e(e)}a(edc,"ArrayType");function tdc(t){cE(RI.Boolean),cE(t?1:0)}a(tdc,"BooleanType");function rdc(t){cE(RI.BigInt),a6i.setBigInt64(0,t);for(let e of c6i)cE(e)}a(rdc,"BigIntType");function ndc(t){cE(RI.Date),g_e(t.getTime())}a(ndc,"DateType");function idc(t){cE(RI.Null)}a(idc,"NullType");function odc(t){cE(RI.Number),a6i.setFloat64(0,t);for(let e of c6i)cE(e)}a(odc,"NumberType");function sdc(t){cE(RI.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())g_e(e),g_e(t[e])}a(sdc,"ObjectType");function adc(t){cE(RI.String);for(let e=0;e{"use strict";p();var fdc=Xne&&Xne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pdc=Xne&&Xne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fdc(e,t,r)};Object.defineProperty(Xne,"__esModule",{value:!0});pdc(l6i(),Xne)});var nMr=I(GBe=>{"use strict";p();Object.defineProperty(GBe,"__esModule",{value:!0});GBe.ValueCheckUnknownTypeError=void 0;GBe.Check=efc;var jBe=XNr(),rMr=yN(),hdc=qBe(),A_e=Tn(),u6i=VD(),mdc=one(),HBe=hye(),gdc=Gf(),Adc=Fm(),Gm=Ug(),ydc=Is(),dCt=class extends gdc.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};GBe.ValueCheckUnknownTypeError=dCt;function _dc(t){return t[A_e.Kind]==="Any"||t[A_e.Kind]==="Unknown"}a(_dc,"IsAnyOrUnknown");function ua(t){return t!==void 0}a(ua,"IsDefined");function Edc(t,e,r){return!0}a(Edc,"FromAny");function vdc(t,e,r){return!0}a(vdc,"FromArgument");function Cdc(t,e,r){if(!(0,Gm.IsArray)(r)||ua(t.minItems)&&!(r.length>=t.minItems)||ua(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!lA(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=(0,hdc.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(ua(t.contains)||(0,Gm.IsNumber)(t.minContains)||(0,Gm.IsNumber)(t.maxContains)))return!0;let n=ua(t.contains)?t.contains:(0,Adc.Never)(),o=r.reduce((s,c)=>lA(n,e,c)?s+1:s,0);return!(o===0||(0,Gm.IsNumber)(t.minContains)&&ot.maxContains)}a(Cdc,"FromArray");function bdc(t,e,r){return(0,Gm.IsAsyncIterator)(r)}a(bdc,"FromAsyncIterator");function Sdc(t,e,r){return!(!(0,Gm.IsBigInt)(r)||ua(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ua(t.maximum)&&!(r<=t.maximum)||ua(t.minimum)&&!(r>=t.minimum)||ua(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(Sdc,"FromBigInt");function Tdc(t,e,r){return(0,Gm.IsBoolean)(r)}a(Tdc,"FromBoolean");function Idc(t,e,r){return lA(t.returns,e,r.prototype)}a(Idc,"FromConstructor");function xdc(t,e,r){return!(!(0,Gm.IsDate)(r)||ua(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||ua(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||ua(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||ua(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(xdc,"FromDate");function wdc(t,e,r){return(0,Gm.IsFunction)(r)}a(wdc,"FromFunction");function Rdc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return lA(o,[...e,...n],r)}a(Rdc,"FromImport");function kdc(t,e,r){return!(!(0,Gm.IsInteger)(r)||ua(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ua(t.maximum)&&!(r<=t.maximum)||ua(t.minimum)&&!(r>=t.minimum)||ua(t.multipleOf)&&r%t.multipleOf!==0)}a(kdc,"FromInteger");function Pdc(t,e,r){let n=t.allOf.every(o=>lA(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,u6i.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,ydc.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,u6i.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||lA(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(Pdc,"FromIntersect");function Ddc(t,e,r){return(0,Gm.IsIterator)(r)}a(Ddc,"FromIterator");function Ndc(t,e,r){return r===t.const}a(Ndc,"FromLiteral");function Mdc(t,e,r){return!1}a(Mdc,"FromNever");function Odc(t,e,r){return!lA(t.not,e,r)}a(Odc,"FromNot");function Ldc(t,e,r){return(0,Gm.IsNull)(r)}a(Ldc,"FromNull");function Bdc(t,e,r){return!(!jBe.TypeSystemPolicy.IsNumberLike(r)||ua(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ua(t.minimum)&&!(r>=t.minimum)||ua(t.maximum)&&!(r<=t.maximum)||ua(t.multipleOf)&&r%t.multipleOf!==0)}a(Bdc,"FromNumber");function Fdc(t,e,r){if(!jBe.TypeSystemPolicy.IsObjectLike(r)||ua(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ua(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!lA(s,e,r[o])||((0,mdc.ExtendsUndefinedCheck)(s)||_dc(s))&&!(o in r))return!1}else if(jBe.TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!lA(s,e,r[o]))return!1}if(t.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return t.required&&t.required.length===n.length&&o.length===n.length?!0:o.every(s=>n.includes(s))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||lA(t.additionalProperties,e,r[s])):!0}a(Fdc,"FromObject");function Udc(t,e,r){return(0,Gm.IsPromise)(r)}a(Udc,"FromPromise");function Qdc(t,e,r){if(!jBe.TypeSystemPolicy.IsRecordLike(r)||ua(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ua(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?lA(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:lA(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(Qdc,"FromRecord");function qdc(t,e,r){return lA((0,rMr.Deref)(t,e),e,r)}a(qdc,"FromRef");function jdc(t,e,r){let n=new RegExp(t.source,t.flags);return ua(t.minLength)&&!(r.length>=t.minLength)||ua(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(jdc,"FromRegExp");function Hdc(t,e,r){return!(0,Gm.IsString)(r)||ua(t.minLength)&&!(r.length>=t.minLength)||ua(t.maxLength)&&!(r.length<=t.maxLength)||ua(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:ua(t.format)?HBe.FormatRegistry.Has(t.format)?HBe.FormatRegistry.Get(t.format)(r):!1:!0}a(Hdc,"FromString");function Gdc(t,e,r){return(0,Gm.IsSymbol)(r)}a(Gdc,"FromSymbol");function $dc(t,e,r){return(0,Gm.IsString)(r)&&new RegExp(t.pattern).test(r)}a($dc,"FromTemplateLiteral");function Vdc(t,e,r){return lA((0,rMr.Deref)(t,e),e,r)}a(Vdc,"FromThis");function Wdc(t,e,r){if(!(0,Gm.IsArray)(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nlA(n,e,r))}a(Ydc,"FromUnion");function Kdc(t,e,r){return!(!(0,Gm.IsUint8Array)(r)||ua(t.maxByteLength)&&!(r.length<=t.maxByteLength)||ua(t.minByteLength)&&!(r.length>=t.minByteLength))}a(Kdc,"FromUint8Array");function Jdc(t,e,r){return!0}a(Jdc,"FromUnknown");function Zdc(t,e,r){return jBe.TypeSystemPolicy.IsVoidLike(r)}a(Zdc,"FromVoid");function Xdc(t,e,r){return HBe.TypeRegistry.Has(t[A_e.Kind])?HBe.TypeRegistry.Get(t[A_e.Kind])(t,r):!1}a(Xdc,"FromKind");function lA(t,e,r){let n=ua(t.$id)?(0,rMr.Pushref)(t,e):e,o=t;switch(o[A_e.Kind]){case"Any":return Edc(o,n,r);case"Argument":return vdc(o,n,r);case"Array":return Cdc(o,n,r);case"AsyncIterator":return bdc(o,n,r);case"BigInt":return Sdc(o,n,r);case"Boolean":return Tdc(o,n,r);case"Constructor":return Idc(o,n,r);case"Date":return xdc(o,n,r);case"Function":return wdc(o,n,r);case"Import":return Rdc(o,n,r);case"Integer":return kdc(o,n,r);case"Intersect":return Pdc(o,n,r);case"Iterator":return Ddc(o,n,r);case"Literal":return Ndc(o,n,r);case"Never":return Mdc(o,n,r);case"Not":return Odc(o,n,r);case"Null":return Ldc(o,n,r);case"Number":return Bdc(o,n,r);case"Object":return Fdc(o,n,r);case"Promise":return Udc(o,n,r);case"Record":return Qdc(o,n,r);case"Ref":return qdc(o,n,r);case"RegExp":return jdc(o,n,r);case"String":return Hdc(o,n,r);case"Symbol":return Gdc(o,n,r);case"TemplateLiteral":return $dc(o,n,r);case"This":return Vdc(o,n,r);case"Tuple":return Wdc(o,n,r);case"Undefined":return zdc(o,n,r);case"Union":return Ydc(o,n,r);case"Uint8Array":return Kdc(o,n,r);case"Unknown":return Jdc(o,n,r);case"Void":return Zdc(o,n,r);default:if(!HBe.TypeRegistry.Has(o[A_e.Kind]))throw new dCt(o);return Xdc(o,n,r)}}a(lA,"Visit");function efc(...t){return t.length===3?lA(t[0],t[1],t[2]):lA(t[0],[],t[1])}a(efc,"Check")});var kI=I(eie=>{"use strict";p();var tfc=eie&&eie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rfc=eie&&eie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tfc(e,t,r)};Object.defineProperty(eie,"__esModule",{value:!0});rfc(nMr(),eie)});var tMr=I(vU=>{"use strict";p();Object.defineProperty(vU,"__esModule",{value:!0});vU.ValueErrorIterator=vU.ValueErrorsUnknownTypeError=vU.ValueErrorType=void 0;vU.Errors=Hfc;var $Be=XNr(),d6i=VD(),fCt=hye(),nfc=pwr(),ifc=eMr(),ofc=Gf(),f6i=yN(),sfc=qBe(),afc=kI(),iMr=Tn(),cfc=Fm(),Ph=Ug(),on;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(on||(vU.ValueErrorType=on={}));var pCt=class extends ofc.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};vU.ValueErrorsUnknownTypeError=pCt;function EU(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(EU,"EscapeKey");function da(t){return t!==void 0}a(da,"IsDefined");var VBe=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};vU.ValueErrorIterator=VBe;function pn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,ifc.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(pn,"Create");function*lfc(t,e,r,n){}a(lfc,"FromAny");function*ufc(t,e,r,n){}a(ufc,"FromArgument");function*dfc(t,e,r,n){if(!(0,Ph.IsArray)(n))return yield pn(on.Array,t,r,n);da(t.minItems)&&!(n.length>=t.minItems)&&(yield pn(on.ArrayMinItems,t,r,n)),da(t.maxItems)&&!(n.length<=t.maxItems)&&(yield pn(on.ArrayMaxItems,t,r,n));for(let c=0;cuA(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield pn(on.ArrayContains,t,r,n)),(0,Ph.IsNumber)(t.minContains)&&st.maxContains&&(yield pn(on.ArrayMaxContains,t,r,n))}a(dfc,"FromArray");function*ffc(t,e,r,n){(0,Ph.IsAsyncIterator)(n)||(yield pn(on.AsyncIterator,t,r,n))}a(ffc,"FromAsyncIterator");function*pfc(t,e,r,n){if(!(0,Ph.IsBigInt)(n))return yield pn(on.BigInt,t,r,n);da(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield pn(on.BigIntExclusiveMinimum,t,r,n)),da(t.maximum)&&!(n<=t.maximum)&&(yield pn(on.BigIntMaximum,t,r,n)),da(t.minimum)&&!(n>=t.minimum)&&(yield pn(on.BigIntMinimum,t,r,n)),da(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield pn(on.BigIntMultipleOf,t,r,n))}a(pfc,"FromBigInt");function*hfc(t,e,r,n){(0,Ph.IsBoolean)(n)||(yield pn(on.Boolean,t,r,n))}a(hfc,"FromBoolean");function*mfc(t,e,r,n){yield*uA(t.returns,e,r,n.prototype)}a(mfc,"FromConstructor");function*gfc(t,e,r,n){if(!(0,Ph.IsDate)(n))return yield pn(on.Date,t,r,n);da(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield pn(on.DateExclusiveMinimumTimestamp,t,r,n)),da(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield pn(on.DateMaximumTimestamp,t,r,n)),da(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield pn(on.DateMinimumTimestamp,t,r,n)),da(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield pn(on.DateMultipleOfTimestamp,t,r,n))}a(gfc,"FromDate");function*Afc(t,e,r,n){(0,Ph.IsFunction)(n)||(yield pn(on.Function,t,r,n))}a(Afc,"FromFunction");function*yfc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*uA(s,[...e,...o],r,n)}a(yfc,"FromImport");function*_fc(t,e,r,n){if(!(0,Ph.IsInteger)(n))return yield pn(on.Integer,t,r,n);da(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield pn(on.IntegerExclusiveMinimum,t,r,n)),da(t.maximum)&&!(n<=t.maximum)&&(yield pn(on.IntegerMaximum,t,r,n)),da(t.minimum)&&!(n>=t.minimum)&&(yield pn(on.IntegerMinimum,t,r,n)),da(t.multipleOf)&&n%t.multipleOf!==0&&(yield pn(on.IntegerMultipleOf,t,r,n))}a(_fc,"FromInteger");function*Efc(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of uA(s,e,r,n))o=!0,yield c;if(o)return yield pn(on.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,d6i.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield pn(on.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,d6i.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=uA(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(Efc,"FromIntersect");function*vfc(t,e,r,n){(0,Ph.IsIterator)(n)||(yield pn(on.Iterator,t,r,n))}a(vfc,"FromIterator");function*Cfc(t,e,r,n){n!==t.const&&(yield pn(on.Literal,t,r,n))}a(Cfc,"FromLiteral");function*bfc(t,e,r,n){yield pn(on.Never,t,r,n)}a(bfc,"FromNever");function*Sfc(t,e,r,n){uA(t.not,e,r,n).next().done===!0&&(yield pn(on.Not,t,r,n))}a(Sfc,"FromNot");function*Tfc(t,e,r,n){(0,Ph.IsNull)(n)||(yield pn(on.Null,t,r,n))}a(Tfc,"FromNull");function*Ifc(t,e,r,n){if(!$Be.TypeSystemPolicy.IsNumberLike(n))return yield pn(on.Number,t,r,n);da(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield pn(on.NumberExclusiveMinimum,t,r,n)),da(t.maximum)&&!(n<=t.maximum)&&(yield pn(on.NumberMaximum,t,r,n)),da(t.minimum)&&!(n>=t.minimum)&&(yield pn(on.NumberMinimum,t,r,n)),da(t.multipleOf)&&n%t.multipleOf!==0&&(yield pn(on.NumberMultipleOf,t,r,n))}a(Ifc,"FromNumber");function*xfc(t,e,r,n){if(!$Be.TypeSystemPolicy.IsObjectLike(n))return yield pn(on.Object,t,r,n);da(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield pn(on.ObjectMinProperties,t,r,n)),da(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield pn(on.ObjectMaxProperties,t,r,n));let o=Array.isArray(t.required)?t.required:[],s=Object.getOwnPropertyNames(t.properties),c=Object.getOwnPropertyNames(n);for(let l of o)c.includes(l)||(yield pn(on.ObjectRequiredProperty,t.properties[l],`${r}/${EU(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield pn(on.ObjectAdditionalProperties,t,`${r}/${EU(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*uA(t.additionalProperties,e,`${r}/${EU(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*uA(u,e,`${r}/${EU(l)}`,n[l]),(0,nfc.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield pn(on.ObjectRequiredProperty,u,`${r}/${EU(l)}`,void 0))):$Be.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*uA(u,e,`${r}/${EU(l)}`,n[l]))}}a(xfc,"FromObject");function*wfc(t,e,r,n){(0,Ph.IsPromise)(n)||(yield pn(on.Promise,t,r,n))}a(wfc,"FromPromise");function*Rfc(t,e,r,n){if(!$Be.TypeSystemPolicy.IsRecordLike(n))return yield pn(on.Object,t,r,n);da(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield pn(on.ObjectMinProperties,t,r,n)),da(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield pn(on.ObjectMaxProperties,t,r,n));let[o,s]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let[l,u]of Object.entries(n))c.test(l)&&(yield*uA(s,e,`${r}/${EU(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*uA(t.additionalProperties,e,`${r}/${EU(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield pn(on.ObjectAdditionalProperties,t,`${r}/${EU(l)}`,u)}}a(Rfc,"FromRecord");function*kfc(t,e,r,n){yield*uA((0,f6i.Deref)(t,e),e,r,n)}a(kfc,"FromRef");function*Pfc(t,e,r,n){if(!(0,Ph.IsString)(n))return yield pn(on.String,t,r,n);if(da(t.minLength)&&!(n.length>=t.minLength)&&(yield pn(on.StringMinLength,t,r,n)),da(t.maxLength)&&!(n.length<=t.maxLength)&&(yield pn(on.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield pn(on.RegExp,t,r,n)}a(Pfc,"FromRegExp");function*Dfc(t,e,r,n){if(!(0,Ph.IsString)(n))return yield pn(on.String,t,r,n);da(t.minLength)&&!(n.length>=t.minLength)&&(yield pn(on.StringMinLength,t,r,n)),da(t.maxLength)&&!(n.length<=t.maxLength)&&(yield pn(on.StringMaxLength,t,r,n)),(0,Ph.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield pn(on.StringPattern,t,r,n))),(0,Ph.IsString)(t.format)&&(fCt.FormatRegistry.Has(t.format)?fCt.FormatRegistry.Get(t.format)(n)||(yield pn(on.StringFormat,t,r,n)):yield pn(on.StringFormatUnknown,t,r,n))}a(Dfc,"FromString");function*Nfc(t,e,r,n){(0,Ph.IsSymbol)(n)||(yield pn(on.Symbol,t,r,n))}a(Nfc,"FromSymbol");function*Mfc(t,e,r,n){if(!(0,Ph.IsString)(n))return yield pn(on.String,t,r,n);new RegExp(t.pattern).test(n)||(yield pn(on.StringPattern,t,r,n))}a(Mfc,"FromTemplateLiteral");function*Ofc(t,e,r,n){yield*uA((0,f6i.Deref)(t,e),e,r,n)}a(Ofc,"FromThis");function*Lfc(t,e,r,n){if(!(0,Ph.IsArray)(n))return yield pn(on.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield pn(on.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield pn(on.TupleLength,t,r,n);if(t.items)for(let o=0;onew VBe(uA(s,e,r,n)));yield pn(on.Union,t,r,n,o)}a(Ffc,"FromUnion");function*Ufc(t,e,r,n){if(!(0,Ph.IsUint8Array)(n))return yield pn(on.Uint8Array,t,r,n);da(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield pn(on.Uint8ArrayMaxByteLength,t,r,n)),da(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield pn(on.Uint8ArrayMinByteLength,t,r,n))}a(Ufc,"FromUint8Array");function*Qfc(t,e,r,n){}a(Qfc,"FromUnknown");function*qfc(t,e,r,n){$Be.TypeSystemPolicy.IsVoidLike(n)||(yield pn(on.Void,t,r,n))}a(qfc,"FromVoid");function*jfc(t,e,r,n){fCt.TypeRegistry.Get(t[iMr.Kind])(t,n)||(yield pn(on.Kind,t,r,n))}a(jfc,"FromKind");function*uA(t,e,r,n){let o=da(t.$id)?[...e,t]:e,s=t;switch(s[iMr.Kind]){case"Any":return yield*lfc(s,o,r,n);case"Argument":return yield*ufc(s,o,r,n);case"Array":return yield*dfc(s,o,r,n);case"AsyncIterator":return yield*ffc(s,o,r,n);case"BigInt":return yield*pfc(s,o,r,n);case"Boolean":return yield*hfc(s,o,r,n);case"Constructor":return yield*mfc(s,o,r,n);case"Date":return yield*gfc(s,o,r,n);case"Function":return yield*Afc(s,o,r,n);case"Import":return yield*yfc(s,o,r,n);case"Integer":return yield*_fc(s,o,r,n);case"Intersect":return yield*Efc(s,o,r,n);case"Iterator":return yield*vfc(s,o,r,n);case"Literal":return yield*Cfc(s,o,r,n);case"Never":return yield*bfc(s,o,r,n);case"Not":return yield*Sfc(s,o,r,n);case"Null":return yield*Tfc(s,o,r,n);case"Number":return yield*Ifc(s,o,r,n);case"Object":return yield*xfc(s,o,r,n);case"Promise":return yield*wfc(s,o,r,n);case"Record":return yield*Rfc(s,o,r,n);case"Ref":return yield*kfc(s,o,r,n);case"RegExp":return yield*Pfc(s,o,r,n);case"String":return yield*Dfc(s,o,r,n);case"Symbol":return yield*Nfc(s,o,r,n);case"TemplateLiteral":return yield*Mfc(s,o,r,n);case"This":return yield*Ofc(s,o,r,n);case"Tuple":return yield*Lfc(s,o,r,n);case"Undefined":return yield*Bfc(s,o,r,n);case"Union":return yield*Ffc(s,o,r,n);case"Uint8Array":return yield*Ufc(s,o,r,n);case"Unknown":return yield*Qfc(s,o,r,n);case"Void":return yield*qfc(s,o,r,n);default:if(!fCt.TypeRegistry.Has(s[iMr.Kind]))throw new pCt(t);return yield*jfc(s,o,r,n)}}a(uA,"Visit");function Hfc(...t){let e=t.length===3?uA(t[0],t[1],"",t[2]):uA(t[0],[],"",t[1]);return new VBe(e)}a(Hfc,"Errors")});var y_e=I(IV=>{"use strict";p();var Gfc=IV&&IV.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),p6i=IV&&IV.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gfc(e,t,r)};Object.defineProperty(IV,"__esModule",{value:!0});p6i(tMr(),IV);p6i(eMr(),IV)});var y6i=I(CU=>{"use strict";p();var $fc=CU&&CU.__classPrivateFieldSet||function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},m6i=CU&&CU.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},oMr,hCt,g6i;Object.defineProperty(CU,"__esModule",{value:!0});CU.AssertError=void 0;CU.Assert=zfc;var A6i=y_e(),Vfc=gIr(),Wfc=nMr(),mCt=class extends Vfc.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),oMr.add(this),hCt.set(this,void 0),$fc(this,hCt,e,"f"),this.error=r}Errors(){return new A6i.ValueErrorIterator(m6i(this,oMr,"m",g6i).call(this))}};CU.AssertError=mCt;hCt=new WeakMap,oMr=new WeakSet,g6i=a(function*(){this.error&&(yield this.error),yield*m6i(this,hCt,"f")},"_AssertError_Iterator");function h6i(t,e,r){if(!(0,Wfc.Check)(t,e,r))throw new mCt((0,A6i.Errors)(t,e,r))}a(h6i,"AssertValue");function zfc(...t){return t.length===3?h6i(t[0],t[1],t[2]):h6i(t[0],[],t[1])}a(zfc,"Assert")});var gCt=I(tie=>{"use strict";p();var Yfc=tie&&tie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Kfc=tie&&tie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yfc(e,t,r)};Object.defineProperty(tie,"__esModule",{value:!0});Kfc(y6i(),tie)});var _6i=I(sMr=>{"use strict";p();Object.defineProperty(sMr,"__esModule",{value:!0});sMr.Clone=__e;var rie=Ug();function Jfc(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=__e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=__e(t[r]);return e}a(Jfc,"FromObject");function Zfc(t){return t.map(e=>__e(e))}a(Zfc,"FromArray");function Xfc(t){return t.slice()}a(Xfc,"FromTypedArray");function epc(t){return new Map(__e([...t.entries()]))}a(epc,"FromMap");function tpc(t){return new Set(__e([...t.entries()]))}a(tpc,"FromSet");function rpc(t){return new Date(t.toISOString())}a(rpc,"FromDate");function __e(t){if((0,rie.IsArray)(t))return Zfc(t);if((0,rie.IsDate)(t))return rpc(t);if((0,rie.IsTypedArray)(t))return Xfc(t);if((0,rie.IsMap)(t))return epc(t);if((0,rie.IsSet)(t))return tpc(t);if((0,rie.IsObject)(t))return Jfc(t);if((0,rie.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(__e,"Clone")});var EN=I(nie=>{"use strict";p();var npc=nie&&nie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ipc=nie&&nie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&npc(e,t,r)};Object.defineProperty(nie,"__esModule",{value:!0});ipc(_6i(),nie)});var b6i=I(WBe=>{"use strict";p();Object.defineProperty(WBe,"__esModule",{value:!0});WBe.ValueCreateError=void 0;WBe.Create=$pc;var Ha=Ug(),opc=kI(),spc=EN(),aMr=yN(),E6i=GD(),apc=hye(),v6i=Tn(),cpc=Gf(),lpc=t_t(),OS=class extends cpc.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};WBe.ValueCreateError=OS;function cc(t){return(0,lpc.IsFunction)(t)?t():(0,spc.Clone)(t)}a(cc,"FromDefault");function upc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):{}}a(upc,"FromAny");function dpc(t,e){return{}}a(dpc,"FromArgument");function fpc(t,e){if(t.uniqueItems===!0&&!(0,Ha.HasPropertyKey)(t,"default"))throw new OS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,Ha.HasPropertyKey)(t,"default"))throw new OS(t,"Array with the contains constraint requires a default value");return"default"in t?cc(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>PI(t.items,e)):[]}a(fpc,"FromArray");function ppc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):(async function*(){})()}a(ppc,"FromAsyncIterator");function hpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):BigInt(0)}a(hpc,"FromBigInt");function mpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):!1}a(mpc,"FromBoolean");function gpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);{let r=PI(t.returns,e);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let s=this;s[n]=o}}}:class{}}}a(gpc,"FromConstructor");function Apc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(Apc,"FromDate");function ypc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):()=>PI(t.returns,e)}a(ypc,"FromFunction");function _pc(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return PI(n,[...e,...r])}a(_pc,"FromImport");function Epc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.minimum!==void 0?t.minimum:0}a(Epc,"FromInteger");function vpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);{let r=t.allOf.reduce((n,o)=>{let s=PI(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,opc.Check)(t,e,r))throw new OS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(vpc,"FromIntersect");function Cpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):(function*(){})()}a(Cpc,"FromIterator");function bpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.const}a(bpc,"FromLiteral");function Spc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);throw new OS(t,"Never types cannot be created. Consider using a default value.")}a(Spc,"FromNever");function Tpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);throw new OS(t,"Not types must have a default value")}a(Tpc,"FromNot");function Ipc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):null}a(Ipc,"FromNull");function xpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.minimum!==void 0?t.minimum:0}a(xpc,"FromNumber");function wpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=PI(s,e));return n}}a(wpc,"FromObject");function Rpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):Promise.resolve(PI(t.item,e))}a(Rpc,"FromPromise");function kpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):{}}a(kpc,"FromRecord");function Ppc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):PI((0,aMr.Deref)(t,e),e)}a(Ppc,"FromRef");function Dpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);throw new OS(t,"RegExp types cannot be created. Consider using a default value.")}a(Dpc,"FromRegExp");function Npc(t,e){if(t.pattern!==void 0){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);throw new OS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);throw new OS(t,"String types with formats must specify a default value")}else return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(Npc,"FromString");function Mpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(Mpc,"FromSymbol");function Opc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);if(!(0,E6i.IsTemplateLiteralFinite)(t))throw new OS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,E6i.TemplateLiteralGenerate)(t)[0]}a(Opc,"FromTemplateLiteral");function Lpc(t,e){if(C6i++>Gpc)throw new OS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):PI((0,aMr.Deref)(t,e),e)}a(Lpc,"FromThis");function Bpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>PI(t.items[n],e))}a(Bpc,"FromTuple");function Fpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default)}a(Fpc,"FromUndefined");function Upc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return PI(t.anyOf[0],e)}a(Upc,"FromUnion");function Qpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(Qpc,"FromUint8Array");function qpc(t,e){return(0,Ha.HasPropertyKey)(t,"default")?cc(t.default):{}}a(qpc,"FromUnknown");function jpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default)}a(jpc,"FromVoid");function Hpc(t,e){if((0,Ha.HasPropertyKey)(t,"default"))return cc(t.default);throw new Error("User defined types must specify a default value")}a(Hpc,"FromKind");function PI(t,e){let r=(0,aMr.Pushref)(t,e),n=t;switch(n[v6i.Kind]){case"Any":return upc(n,r);case"Argument":return dpc(n,r);case"Array":return fpc(n,r);case"AsyncIterator":return ppc(n,r);case"BigInt":return hpc(n,r);case"Boolean":return mpc(n,r);case"Constructor":return gpc(n,r);case"Date":return Apc(n,r);case"Function":return ypc(n,r);case"Import":return _pc(n,r);case"Integer":return Epc(n,r);case"Intersect":return vpc(n,r);case"Iterator":return Cpc(n,r);case"Literal":return bpc(n,r);case"Never":return Spc(n,r);case"Not":return Tpc(n,r);case"Null":return Ipc(n,r);case"Number":return xpc(n,r);case"Object":return wpc(n,r);case"Promise":return Rpc(n,r);case"Record":return kpc(n,r);case"Ref":return Ppc(n,r);case"RegExp":return Dpc(n,r);case"String":return Npc(n,r);case"Symbol":return Mpc(n,r);case"TemplateLiteral":return Opc(n,r);case"This":return Lpc(n,r);case"Tuple":return Bpc(n,r);case"Undefined":return Fpc(n,r);case"Union":return Upc(n,r);case"Uint8Array":return Qpc(n,r);case"Unknown":return qpc(n,r);case"Void":return jpc(n,r);default:if(!apc.TypeRegistry.Has(n[v6i.Kind]))throw new OS(n,"Unknown type");return Hpc(n,r)}}a(PI,"Visit");var Gpc=512,C6i=0;function $pc(...t){return C6i=0,t.length===2?PI(t[0],t[1]):PI(t[0],[])}a($pc,"Create")});var ACt=I(iie=>{"use strict";p();var Vpc=iie&&iie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wpc=iie&&iie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vpc(e,t,r)};Object.defineProperty(iie,"__esModule",{value:!0});Wpc(b6i(),iie)});var x6i=I(KBe=>{"use strict";p();Object.defineProperty(KBe,"__esModule",{value:!0});KBe.ValueCastError=void 0;KBe.Cast=I6i;var hk=Ug(),zpc=Gf(),yCt=Tn(),xV=ACt(),DI=kI(),oie=EN(),YBe=yN(),zBe=class extends zpc.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};KBe.ValueCastError=zBe;function S6i(t,e,r){if(t[yCt.Kind]==="Object"&&typeof r=="object"&&!(0,hk.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[yCt.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,DI.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[yCt.Kind]==="Union"){let o=t.anyOf.map(s=>(0,YBe.Deref)(s,e)).map(s=>S6i(s,e,r));return Math.max(...o)}else return(0,DI.Check)(t,e,r)?1:0}a(S6i,"ScoreUnion");function Ypc(t,e,r){let n=t.anyOf.map(c=>(0,YBe.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=S6i(c,e,r);l>s&&(o=c,s=l)}return o}a(Ypc,"SelectUnion");function Kpc(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,oie.Clone)(t.default);{let n=Ypc(t,e,r);return I6i(n,e,r)}}a(Kpc,"CastUnion");function Jpc(t,e,r){return(0,DI.Check)(t,e,r)?(0,oie.Clone)(r):(0,xV.Create)(t,e)}a(Jpc,"DefaultClone");function Zpc(t,e,r){return(0,DI.Check)(t,e,r)?r:(0,xV.Create)(t,e)}a(Zpc,"Default");function Xpc(t,e,r){if((0,DI.Check)(t,e,r))return(0,oie.Clone)(r);let n=(0,hk.IsArray)(r)?(0,oie.Clone)(r):(0,xV.Create)(t,e),o=(0,hk.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,hk.IsNumber)(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>vN(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!(0,DI.Check)(t,e,l))throw new zBe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(Xpc,"FromArray");function ehc(t,e,r){if((0,DI.Check)(t,e,r))return(0,xV.Create)(t,e);let n=new Set(t.returns.required||[]),o=a(function(){},"result");for(let[s,c]of Object.entries(t.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(o.prototype[s]=vN(c,e,r.prototype[s]));return o}a(ehc,"FromConstructor");function thc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return vN(o,[...e,...n],r)}a(thc,"FromImport");function T6i(t,e){return(0,hk.IsObject)(t)&&!(0,hk.IsObject)(e)||!(0,hk.IsObject)(t)&&(0,hk.IsObject)(e)?t:!(0,hk.IsObject)(t)||!(0,hk.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?T6i(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(T6i,"IntersectAssign");function rhc(t,e,r){if((0,DI.Check)(t,e,r))return r;let n=(0,xV.Create)(t,e),o=T6i(n,r);return(0,DI.Check)(t,e,o)?o:n}a(rhc,"FromIntersect");function nhc(t,e,r){throw new zBe(t,"Never types cannot be cast")}a(nhc,"FromNever");function ihc(t,e,r){if((0,DI.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,xV.Create)(t,e);let n=new Set(t.required||[]),o={};for(let[s,c]of Object.entries(t.properties))!n.has(s)&&r[s]===void 0||(o[s]=vN(c,e,r[s]));if(typeof t.additionalProperties=="object"){let s=Object.getOwnPropertyNames(t.properties);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||(o[c]=vN(t.additionalProperties,e,r[c]))}return o}a(ihc,"FromObject");function ohc(t,e,r){if((0,DI.Check)(t,e,r))return(0,oie.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,xV.Create)(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=vN(o,e,l);return s}a(ohc,"FromRecord");function shc(t,e,r){return vN((0,YBe.Deref)(t,e),e,r)}a(shc,"FromRef");function ahc(t,e,r){return vN((0,YBe.Deref)(t,e),e,r)}a(ahc,"FromThis");function chc(t,e,r){return(0,DI.Check)(t,e,r)?(0,oie.Clone)(r):(0,hk.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>vN(n,e,r[o])):(0,xV.Create)(t,e)}a(chc,"FromTuple");function lhc(t,e,r){return(0,DI.Check)(t,e,r)?(0,oie.Clone)(r):Kpc(t,e,r)}a(lhc,"FromUnion");function vN(t,e,r){let n=(0,hk.IsString)(t.$id)?(0,YBe.Pushref)(t,e):e,o=t;switch(t[yCt.Kind]){case"Array":return Xpc(o,n,r);case"Constructor":return ehc(o,n,r);case"Import":return thc(o,n,r);case"Intersect":return rhc(o,n,r);case"Never":return nhc(o,n,r);case"Object":return ihc(o,n,r);case"Record":return ohc(o,n,r);case"Ref":return shc(o,n,r);case"This":return ahc(o,n,r);case"Tuple":return chc(o,n,r);case"Union":return lhc(o,n,r);case"Date":case"Symbol":case"Uint8Array":return Jpc(t,e,r);default:return Zpc(o,n,r)}}a(vN,"Visit");function I6i(...t){return t.length===3?vN(t[0],t[1],t[2]):vN(t[0],[],t[1])}a(I6i,"Cast")});var _Ct=I(sie=>{"use strict";p();var uhc=sie&&sie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dhc=sie&&sie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uhc(e,t,r)};Object.defineProperty(sie,"__esModule",{value:!0});dhc(x6i(),sie)});var R6i=I(lMr=>{"use strict";p();Object.defineProperty(lMr,"__esModule",{value:!0});lMr.Clean=Shc;var fhc=VD(),ECt=kI(),phc=EN(),cMr=yN(),w6i=Tn(),CN=Ug(),vCt=Is();function hhc(t){return(0,vCt.IsKind)(t)&&t[w6i.Kind]!=="Unsafe"}a(hhc,"IsCheckable");function mhc(t,e,r){return(0,CN.IsArray)(r)?r.map(n=>LS(t.items,e,n)):r}a(mhc,"FromArray");function ghc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return LS(o,[...e,...n],r)}a(ghc,"FromImport");function Ahc(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>LS(l,e,(0,phc.Clone)(r))).reduce((l,u)=>(0,CN.IsObject)(u)?{...l,...u}:u,{});if(!(0,CN.IsObject)(r)||!(0,CN.IsObject)(s)||!(0,vCt.IsKind)(n))return s;let c=(0,fhc.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,ECt.Check)(n,e,r[l])&&(s[l]=LS(n,e,r[l]));return s}a(Ahc,"FromIntersect");function yhc(t,e,r){if(!(0,CN.IsObject)(r)||(0,CN.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,CN.HasPropertyKey)(t.properties,o)){r[o]=LS(t.properties[o],e,r[o]);continue}if((0,vCt.IsKind)(n)&&(0,ECt.Check)(n,e,r[o])){r[o]=LS(n,e,r[o]);continue}delete r[o]}return r}a(yhc,"FromObject");function _hc(t,e,r){if(!(0,CN.IsObject)(r))return r;let n=t.additionalProperties,o=Object.getOwnPropertyNames(r),[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of o){if(l.test(u)){r[u]=LS(c,e,r[u]);continue}if((0,vCt.IsKind)(n)&&(0,ECt.Check)(n,e,r[u])){r[u]=LS(n,e,r[u]);continue}delete r[u]}return r}a(_hc,"FromRecord");function Ehc(t,e,r){return LS((0,cMr.Deref)(t,e),e,r)}a(Ehc,"FromRef");function vhc(t,e,r){return LS((0,cMr.Deref)(t,e),e,r)}a(vhc,"FromThis");function Chc(t,e,r){if(!(0,CN.IsArray)(r))return r;if((0,CN.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(Chc,"FromTuple");function bhc(t,e,r){for(let n of t.anyOf)if(hhc(n)&&(0,ECt.Check)(n,e,r))return LS(n,e,r);return r}a(bhc,"FromUnion");function LS(t,e,r){let n=(0,CN.IsString)(t.$id)?(0,cMr.Pushref)(t,e):e,o=t;switch(o[w6i.Kind]){case"Array":return mhc(o,n,r);case"Import":return ghc(o,n,r);case"Intersect":return Ahc(o,n,r);case"Object":return yhc(o,n,r);case"Record":return _hc(o,n,r);case"Ref":return Ehc(o,n,r);case"This":return vhc(o,n,r);case"Tuple":return Chc(o,n,r);case"Union":return bhc(o,n,r);default:return r}}a(LS,"Visit");function Shc(...t){return t.length===3?LS(t[0],t[1],t[2]):LS(t[0],[],t[1])}a(Shc,"Clean")});var CCt=I(aie=>{"use strict";p();var Thc=aie&&aie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ihc=aie&&aie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Thc(e,t,r)};Object.defineProperty(aie,"__esModule",{value:!0});Ihc(R6i(),aie)});var M6i=I(dMr=>{"use strict";p();Object.defineProperty(dMr,"__esModule",{value:!0});dMr.Convert=lmc;var xhc=EN(),k6i=kI(),uMr=yN(),whc=Tn(),Ga=Ug();function bCt(t){return(0,Ga.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(bCt,"IsStringNumeric");function Rhc(t){return(0,Ga.IsBigInt)(t)||(0,Ga.IsBoolean)(t)||(0,Ga.IsNumber)(t)}a(Rhc,"IsValueToString");function JBe(t){return t===!0||(0,Ga.IsNumber)(t)&&t===1||(0,Ga.IsBigInt)(t)&&t===BigInt("1")||(0,Ga.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(JBe,"IsValueTrue");function ZBe(t){return t===!1||(0,Ga.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,Ga.IsBigInt)(t)&&t===BigInt("0")||(0,Ga.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(ZBe,"IsValueFalse");function khc(t){return(0,Ga.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(khc,"IsTimeStringWithTimeZone");function Phc(t){return(0,Ga.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(Phc,"IsTimeStringWithoutTimeZone");function Dhc(t){return(0,Ga.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(Dhc,"IsDateTimeStringWithTimeZone");function Nhc(t){return(0,Ga.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(Nhc,"IsDateTimeStringWithoutTimeZone");function Mhc(t){return(0,Ga.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(Mhc,"IsDateString");function Ohc(t,e){let r=D6i(t);return r===e?r:t}a(Ohc,"TryConvertLiteralString");function Lhc(t,e){let r=N6i(t);return r===e?r:t}a(Lhc,"TryConvertLiteralNumber");function Bhc(t,e){let r=P6i(t);return r===e?r:t}a(Bhc,"TryConvertLiteralBoolean");function Fhc(t,e){return(0,Ga.IsString)(t.const)?Ohc(e,t.const):(0,Ga.IsNumber)(t.const)?Lhc(e,t.const):(0,Ga.IsBoolean)(t.const)?Bhc(e,t.const):e}a(Fhc,"TryConvertLiteral");function P6i(t){return JBe(t)?!0:ZBe(t)?!1:t}a(P6i,"TryConvertBoolean");function Uhc(t){let e=a(r=>r.split(".")[0],"truncateInteger");return bCt(t)?BigInt(e(t)):(0,Ga.IsNumber)(t)?BigInt(Math.trunc(t)):ZBe(t)?BigInt(0):JBe(t)?BigInt(1):t}a(Uhc,"TryConvertBigInt");function D6i(t){return(0,Ga.IsSymbol)(t)&&t.description!==void 0?t.description.toString():Rhc(t)?t.toString():t}a(D6i,"TryConvertString");function N6i(t){return bCt(t)?parseFloat(t):JBe(t)?1:ZBe(t)?0:t}a(N6i,"TryConvertNumber");function Qhc(t){return bCt(t)?parseInt(t):(0,Ga.IsNumber)(t)?Math.trunc(t):JBe(t)?1:ZBe(t)?0:t}a(Qhc,"TryConvertInteger");function qhc(t){return(0,Ga.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(qhc,"TryConvertNull");function jhc(t){return(0,Ga.IsString)(t)&&t==="undefined"?void 0:t}a(jhc,"TryConvertUndefined");function Hhc(t){return(0,Ga.IsDate)(t)?t:(0,Ga.IsNumber)(t)?new Date(t):JBe(t)?new Date(1):ZBe(t)?new Date(0):bCt(t)?new Date(parseInt(t)):Phc(t)?new Date(`1970-01-01T${t}.000Z`):khc(t)?new Date(`1970-01-01T${t}`):Nhc(t)?new Date(`${t}.000Z`):Dhc(t)?new Date(t):Mhc(t)?new Date(`${t}T00:00:00.000Z`):t}a(Hhc,"TryConvertDate");function Ghc(t,e,r){return((0,Ga.IsArray)(r)?r:[r]).map(o=>bN(t.items,e,o))}a(Ghc,"FromArray");function $hc(t,e,r){return Uhc(r)}a($hc,"FromBigInt");function Vhc(t,e,r){return P6i(r)}a(Vhc,"FromBoolean");function Whc(t,e,r){return Hhc(r)}a(Whc,"FromDate");function zhc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return bN(o,[...e,...n],r)}a(zhc,"FromImport");function Yhc(t,e,r){return Qhc(r)}a(Yhc,"FromInteger");function Khc(t,e,r){return t.allOf.reduce((n,o)=>bN(o,e,n),r)}a(Khc,"FromIntersect");function Jhc(t,e,r){return Fhc(t,r)}a(Jhc,"FromLiteral");function Zhc(t,e,r){return qhc(r)}a(Zhc,"FromNull");function Xhc(t,e,r){return N6i(r)}a(Xhc,"FromNumber");function emc(t,e,r){if(!(0,Ga.IsObject)(r)||(0,Ga.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,Ga.HasPropertyKey)(r,n)&&(r[n]=bN(t.properties[n],e,r[n]));return r}a(emc,"FromObject");function tmc(t,e,r){if(!((0,Ga.IsObject)(r)&&!(0,Ga.IsArray)(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=bN(s,e,l);return r}a(tmc,"FromRecord");function rmc(t,e,r){return bN((0,uMr.Deref)(t,e),e,r)}a(rmc,"FromRef");function nmc(t,e,r){return D6i(r)}a(nmc,"FromString");function imc(t,e,r){return(0,Ga.IsString)(r)||(0,Ga.IsNumber)(r)?Symbol(r):r}a(imc,"FromSymbol");function omc(t,e,r){return bN((0,uMr.Deref)(t,e),e,r)}a(omc,"FromThis");function smc(t,e,r){return(0,Ga.IsArray)(r)&&!(0,Ga.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var umc=cie&&cie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dmc=cie&&cie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&umc(e,t,r)};Object.defineProperty(cie,"__esModule",{value:!0});dmc(M6i(),cie)});var F6i=I(lie=>{"use strict";p();Object.defineProperty(lie,"__esModule",{value:!0});lie.TransformDecodeError=lie.TransformDecodeCheckError=void 0;lie.TransformDecode=Smc;var fmc=pLe(),O6i=Tn(),L6i=Gf(),B6i=VD(),pMr=yN(),pmc=kI(),bU=Ug(),XBe=Is(),fMr=class extends L6i.TypeBoxError{static{a(this,"TransformDecodeCheckError")}constructor(e,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=r,this.error=n}};lie.TransformDecodeCheckError=fMr;var TCt=class extends L6i.TypeBoxError{static{a(this,"TransformDecodeError")}constructor(e,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=e,this.path=r,this.value=n,this.error=o}};lie.TransformDecodeError=TCt;function cf(t,e,r){try{return(0,XBe.IsTransform)(t)?t[O6i.TransformKind].Decode(r):r}catch(n){throw new TCt(t,e,r,n)}}a(cf,"Default");function hmc(t,e,r,n){return(0,bU.IsArray)(n)?cf(t,r,n.map((o,s)=>SN(t.items,e,`${r}/${s}`,o))):cf(t,r,n)}a(hmc,"FromArray");function mmc(t,e,r,n){if(!(0,bU.IsObject)(n)||(0,bU.IsValueType)(n))return cf(t,r,n);let o=(0,B6i.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=SN(h,e,`${r}/${f}`,c[f]));if(!(0,XBe.IsTransform)(t.unevaluatedProperties))return cf(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=cf(u,`${r}/${f}`,d[f]));return cf(t,r,d)}a(mmc,"FromIntersect");function gmc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=SN(s,[...e,...o],r,n);return cf(t,r,c)}a(gmc,"FromImport");function Amc(t,e,r,n){return cf(t,r,SN(t.not,e,r,n))}a(Amc,"FromNot");function ymc(t,e,r,n){if(!(0,bU.IsObject)(n))return cf(t,r,n);let o=(0,B6i.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,bU.HasPropertyKey)(s,d)&&((0,bU.IsUndefined)(s[d])&&(!(0,XBe.IsUndefined)(t.properties[d])||fmc.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=SN(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,XBe.IsSchema)(t.additionalProperties))return cf(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=cf(l,`${r}/${d}`,u[d]));return cf(t,r,u)}a(ymc,"FromObject");function _mc(t,e,r,n){if(!(0,bU.IsObject)(n))return cf(t,r,n);let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=new RegExp(o),c={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(c[f]=SN(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,XBe.IsSchema)(t.additionalProperties))return cf(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=cf(u,`${r}/${f}`,d[f]));return cf(t,r,d)}a(_mc,"FromRecord");function Emc(t,e,r,n){let o=(0,pMr.Deref)(t,e);return cf(t,r,SN(o,e,r,n))}a(Emc,"FromRef");function vmc(t,e,r,n){let o=(0,pMr.Deref)(t,e);return cf(t,r,SN(o,e,r,n))}a(vmc,"FromThis");function Cmc(t,e,r,n){return(0,bU.IsArray)(n)&&(0,bU.IsArray)(t.items)?cf(t,r,t.items.map((o,s)=>SN(o,e,`${r}/${s}`,n[s]))):cf(t,r,n)}a(Cmc,"FromTuple");function bmc(t,e,r,n){for(let o of t.anyOf){if(!(0,pmc.Check)(o,e,n))continue;let s=SN(o,e,r,n);return cf(t,r,s)}return cf(t,r,n)}a(bmc,"FromUnion");function SN(t,e,r,n){let o=(0,pMr.Pushref)(t,e),s=t;switch(t[O6i.Kind]){case"Array":return hmc(s,o,r,n);case"Import":return gmc(s,o,r,n);case"Intersect":return mmc(s,o,r,n);case"Not":return Amc(s,o,r,n);case"Object":return ymc(s,o,r,n);case"Record":return _mc(s,o,r,n);case"Ref":return Emc(s,o,r,n);case"Symbol":return cf(s,r,n);case"This":return vmc(s,o,r,n);case"Tuple":return Cmc(s,o,r,n);case"Union":return bmc(s,o,r,n);default:return cf(s,r,n)}}a(SN,"Visit");function Smc(t,e,r){return SN(t,e,"",r)}a(Smc,"TransformDecode")});var H6i=I(uie=>{"use strict";p();Object.defineProperty(uie,"__esModule",{value:!0});uie.TransformEncodeError=uie.TransformEncodeCheckError=void 0;uie.TransformEncode=Lmc;var Tmc=pLe(),Q6i=Tn(),q6i=Gf(),j6i=VD(),mMr=yN(),U6i=kI(),wV=Ug(),e3e=Is(),hMr=class extends q6i.TypeBoxError{static{a(this,"TransformEncodeCheckError")}constructor(e,r,n){super("The encoded value does not match the expected schema"),this.schema=e,this.value=r,this.error=n}};uie.TransformEncodeCheckError=hMr;var ICt=class extends q6i.TypeBoxError{static{a(this,"TransformEncodeError")}constructor(e,r,n,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=e,this.path=r,this.value=n,this.error=o}};uie.TransformEncodeError=ICt;function Ny(t,e,r){try{return(0,e3e.IsTransform)(t)?t[Q6i.TransformKind].Encode(r):r}catch(n){throw new ICt(t,e,r,n)}}a(Ny,"Default");function Imc(t,e,r,n){let o=Ny(t,r,n);return(0,wV.IsArray)(o)?o.map((s,c)=>TN(t.items,e,`${r}/${c}`,s)):o}a(Imc,"FromArray");function xmc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Ny(t,r,n);return TN(s,[...e,...o],r,c)}a(xmc,"FromImport");function wmc(t,e,r,n){let o=Ny(t,r,n);if(!(0,wV.IsObject)(n)||(0,wV.IsValueType)(n))return o;let s=(0,j6i.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=TN(m,e,`${r}/${h}`,l[h]));if(!(0,e3e.IsTransform)(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=Ny(d,`${r}/${h}`,f[h]));return f}a(wmc,"FromIntersect");function Rmc(t,e,r,n){return Ny(t.not,r,Ny(t,r,n))}a(Rmc,"FromNot");function kmc(t,e,r,n){let o=Ny(t,r,n);if(!(0,wV.IsObject)(o))return o;let s=(0,j6i.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,wV.HasPropertyKey)(c,f)&&((0,wV.IsUndefined)(c[f])&&(!(0,e3e.IsUndefined)(t.properties[f])||Tmc.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=TN(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,e3e.IsSchema)(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Ny(u,`${r}/${f}`,d[f]));return d}a(kmc,"FromObject");function Pmc(t,e,r,n){let o=Ny(t,r,n);if(!(0,wV.IsObject)(n))return o;let s=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(s),l={...o};for(let h of Object.getOwnPropertyNames(n))c.test(h)&&(l[h]=TN(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,e3e.IsSchema)(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=Ny(d,`${r}/${h}`,f[h]));return f}a(Pmc,"FromRecord");function Dmc(t,e,r,n){let o=(0,mMr.Deref)(t,e),s=TN(o,e,r,n);return Ny(t,r,s)}a(Dmc,"FromRef");function Nmc(t,e,r,n){let o=(0,mMr.Deref)(t,e),s=TN(o,e,r,n);return Ny(t,r,s)}a(Nmc,"FromThis");function Mmc(t,e,r,n){let o=Ny(t,r,n);return(0,wV.IsArray)(t.items)?t.items.map((s,c)=>TN(s,e,`${r}/${c}`,o[c])):[]}a(Mmc,"FromTuple");function Omc(t,e,r,n){for(let o of t.anyOf){if(!(0,U6i.Check)(o,e,n))continue;let s=TN(o,e,r,n);return Ny(t,r,s)}for(let o of t.anyOf){let s=TN(o,e,r,n);if((0,U6i.Check)(t,e,s))return Ny(t,r,s)}return Ny(t,r,n)}a(Omc,"FromUnion");function TN(t,e,r,n){let o=(0,mMr.Pushref)(t,e),s=t;switch(t[Q6i.Kind]){case"Array":return Imc(s,o,r,n);case"Import":return xmc(s,o,r,n);case"Intersect":return wmc(s,o,r,n);case"Not":return Rmc(s,o,r,n);case"Object":return kmc(s,o,r,n);case"Record":return Pmc(s,o,r,n);case"Ref":return Dmc(s,o,r,n);case"This":return Nmc(s,o,r,n);case"Tuple":return Mmc(s,o,r,n);case"Union":return Omc(s,o,r,n);default:return Ny(s,r,n)}}a(TN,"Visit");function Lmc(t,e,r){return TN(t,e,"",r)}a(Lmc,"TransformEncode")});var G6i=I(yMr=>{"use strict";p();Object.defineProperty(yMr,"__esModule",{value:!0});yMr.HasTransform=egc;var AMr=yN(),Bmc=Tn(),$m=Is(),Fmc=Ug();function Umc(t,e){return(0,$m.IsTransform)(t)||jg(t.items,e)}a(Umc,"FromArray");function Qmc(t,e){return(0,$m.IsTransform)(t)||jg(t.items,e)}a(Qmc,"FromAsyncIterator");function qmc(t,e){return(0,$m.IsTransform)(t)||jg(t.returns,e)||t.parameters.some(r=>jg(r,e))}a(qmc,"FromConstructor");function jmc(t,e){return(0,$m.IsTransform)(t)||jg(t.returns,e)||t.parameters.some(r=>jg(r,e))}a(jmc,"FromFunction");function Hmc(t,e){return(0,$m.IsTransform)(t)||(0,$m.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>jg(r,e))}a(Hmc,"FromIntersect");function Gmc(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,$m.IsTransform)(t)||jg(n,[...r,...e])}a(Gmc,"FromImport");function $mc(t,e){return(0,$m.IsTransform)(t)||jg(t.items,e)}a($mc,"FromIterator");function Vmc(t,e){return(0,$m.IsTransform)(t)||jg(t.not,e)}a(Vmc,"FromNot");function Wmc(t,e){return(0,$m.IsTransform)(t)||Object.values(t.properties).some(r=>jg(r,e))||(0,$m.IsSchema)(t.additionalProperties)&&jg(t.additionalProperties,e)}a(Wmc,"FromObject");function zmc(t,e){return(0,$m.IsTransform)(t)||jg(t.item,e)}a(zmc,"FromPromise");function Ymc(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,$m.IsTransform)(t)||jg(n,e)||(0,$m.IsSchema)(t.additionalProperties)&&(0,$m.IsTransform)(t.additionalProperties)}a(Ymc,"FromRecord");function Kmc(t,e){return(0,$m.IsTransform)(t)?!0:jg((0,AMr.Deref)(t,e),e)}a(Kmc,"FromRef");function Jmc(t,e){return(0,$m.IsTransform)(t)?!0:jg((0,AMr.Deref)(t,e),e)}a(Jmc,"FromThis");function Zmc(t,e){return(0,$m.IsTransform)(t)||!(0,Fmc.IsUndefined)(t.items)&&t.items.some(r=>jg(r,e))}a(Zmc,"FromTuple");function Xmc(t,e){return(0,$m.IsTransform)(t)||t.anyOf.some(r=>jg(r,e))}a(Xmc,"FromUnion");function jg(t,e){let r=(0,AMr.Pushref)(t,e),n=t;if(t.$id&&gMr.has(t.$id))return!1;switch(t.$id&&gMr.add(t.$id),t[Bmc.Kind]){case"Array":return Umc(n,r);case"AsyncIterator":return Qmc(n,r);case"Constructor":return qmc(n,r);case"Function":return jmc(n,r);case"Import":return Gmc(n,r);case"Intersect":return Hmc(n,r);case"Iterator":return $mc(n,r);case"Not":return Vmc(n,r);case"Object":return Wmc(n,r);case"Promise":return zmc(n,r);case"Record":return Ymc(n,r);case"Ref":return Kmc(n,r);case"This":return Jmc(n,r);case"Tuple":return Zmc(n,r);case"Union":return Xmc(n,r);default:return(0,$m.IsTransform)(t)}}a(jg,"Visit");var gMr=new Set;function egc(t,e){return gMr.clear(),jg(t,e)}a(egc,"HasTransform")});var t3e=I(SU=>{"use strict";p();var tgc=SU&&SU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Mr=SU&&SU.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tgc(e,t,r)};Object.defineProperty(SU,"__esModule",{value:!0});_Mr(F6i(),SU);_Mr(H6i(),SU);_Mr(G6i(),SU)});var $6i=I(vMr=>{"use strict";p();Object.defineProperty(vMr,"__esModule",{value:!0});vMr.Decode=igc;var EMr=t3e(),rgc=kI(),ngc=y_e();function igc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,rgc.Check)(e,r,n))throw new EMr.TransformDecodeCheckError(e,n,(0,ngc.Errors)(e,r,n).First());return(0,EMr.HasTransform)(e,r)?(0,EMr.TransformDecode)(e,r,n):n}a(igc,"Decode")});var CMr=I(die=>{"use strict";p();var ogc=die&&die.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sgc=die&&die.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ogc(e,t,r)};Object.defineProperty(die,"__esModule",{value:!0});sgc($6i(),die)});var W6i=I(TMr=>{"use strict";p();Object.defineProperty(TMr,"__esModule",{value:!0});TMr.Default=Egc;var agc=kI(),V6i=EN(),SMr=yN(),cgc=Tn(),BS=Ug(),lgc=Is();function TU(t,e){let r=(0,BS.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,BS.IsFunction)(r)?r():(0,V6i.Clone)(r);return(0,BS.IsUndefined)(e)?n:(0,BS.IsObject)(e)&&(0,BS.IsObject)(n)?Object.assign(n,e):e}a(TU,"ValueOrDefault");function bMr(t){return(0,lgc.IsKind)(t)&&"default"in t}a(bMr,"HasDefaultProperty");function ugc(t,e,r){if((0,BS.IsArray)(r)){for(let o=0;o{let c=rC(s,e,n);return(0,BS.IsObject)(c)?{...o,...c}:c},{})}a(pgc,"FromIntersect");function hgc(t,e,r){let n=TU(t,r);if(!(0,BS.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=rC(t.properties[s],e,n[s]);(0,BS.IsUndefined)(c)||(n[s]=rC(t.properties[s],e,n[s]))}if(!bMr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=rC(t.additionalProperties,e,n[s]));return n}a(hgc,"FromObject");function mgc(t,e,r){let n=TU(t,r);if(!(0,BS.IsObject)(n))return n;let o=t.additionalProperties,[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of Object.getOwnPropertyNames(n))l.test(u)&&bMr(c)&&(n[u]=rC(c,e,n[u]));if(!bMr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=rC(o,e,n[u]));return n}a(mgc,"FromRecord");function ggc(t,e,r){return rC((0,SMr.Deref)(t,e),e,TU(t,r))}a(ggc,"FromRef");function Agc(t,e,r){return rC((0,SMr.Deref)(t,e),e,r)}a(Agc,"FromThis");function ygc(t,e,r){let n=TU(t,r);if(!(0,BS.IsArray)(n)||(0,BS.IsUndefined)(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;c{"use strict";p();var vgc=fie&&fie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Cgc=fie&&fie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vgc(e,t,r)};Object.defineProperty(fie,"__esModule",{value:!0});Cgc(W6i(),fie)});var K6i=I(IN=>{"use strict";p();Object.defineProperty(IN,"__esModule",{value:!0});IN.ValuePointerRootDeleteError=IN.ValuePointerRootSetError=void 0;IN.Format=r3e;IN.Set=bgc;IN.Delete=Sgc;IN.Has=Tgc;IN.Get=Igc;var Y6i=Gf(),wCt=class extends Y6i.TypeBoxError{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}};IN.ValuePointerRootSetError=wCt;var RCt=class extends Y6i.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};IN.ValuePointerRootDeleteError=RCt;function z6i(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(z6i,"Escape");function*r3e(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var xgc=jL&&jL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wgc=jL&&jL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Rgc=jL&&jL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(IMr,"__esModule",{value:!0});IMr.Equal=PCt;var IU=Ug();function kgc(t,e){if(!(0,IU.IsObject)(e))return!1;let r=[...Object.keys(t),...Object.getOwnPropertySymbols(t)],n=[...Object.keys(e),...Object.getOwnPropertySymbols(e)];return r.length!==n.length?!1:r.every(o=>PCt(t[o],e[o]))}a(kgc,"ObjectType");function Pgc(t,e){return(0,IU.IsDate)(e)&&t.getTime()===e.getTime()}a(Pgc,"DateType");function Dgc(t,e){return!(0,IU.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>PCt(r,e[n]))}a(Dgc,"ArrayType");function Ngc(t,e){return!(0,IU.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>PCt(r,e[n]))}a(Ngc,"TypedArrayType");function Mgc(t,e){return t===e}a(Mgc,"ValueType");function PCt(t,e){if((0,IU.IsDate)(t))return Pgc(t,e);if((0,IU.IsTypedArray)(t))return Ngc(t,e);if((0,IU.IsArray)(t))return Dgc(t,e);if((0,IU.IsObject)(t))return kgc(t,e);if((0,IU.IsValueType)(t))return Mgc(t,e);throw new Error("ValueEquals: Unable to compare value")}a(PCt,"Equal")});var tUi=I(My=>{"use strict";p();Object.defineProperty(My,"__esModule",{value:!0});My.ValueDiffError=My.Edit=My.Delete=My.Update=My.Insert=void 0;My.Diff=jgc;My.Patch=$gc;var HL=Ug(),wMr=kCt(),RMr=EN(),Ogc=xMr(),Lgc=Gf(),kMr=nE(),PMr=Wv(),DMr=F$(),Z6i=G$(),Bgc=Op();My.Insert=(0,PMr.Object)({type:(0,kMr.Literal)("insert"),path:(0,DMr.String)(),value:(0,Z6i.Unknown)()});My.Update=(0,PMr.Object)({type:(0,kMr.Literal)("update"),path:(0,DMr.String)(),value:(0,Z6i.Unknown)()});My.Delete=(0,PMr.Object)({type:(0,kMr.Literal)("delete"),path:(0,DMr.String)()});My.Edit=(0,Bgc.Union)([My.Insert,My.Update,My.Delete]);var n3e=class extends Lgc.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};My.ValueDiffError=n3e;function DCt(t,e){return{type:"update",path:t,value:e}}a(DCt,"CreateUpdate");function X6i(t,e){return{type:"insert",path:t,value:e}}a(X6i,"CreateInsert");function eUi(t){return{type:"delete",path:t}}a(eUi,"CreateDelete");function J6i(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new n3e(t,"Cannot diff objects with symbols")}a(J6i,"AssertDiffable");function*Fgc(t,e,r){if(J6i(e),J6i(r),!(0,HL.IsStandardObject)(r))return yield DCt(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,HL.HasPropertyKey)(e,s)||(yield X6i(`${t}/${s}`,r[s]));for(let s of n)(0,HL.HasPropertyKey)(r,s)&&((0,Ogc.Equal)(e,r)||(yield*NCt(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,HL.HasPropertyKey)(r,s)||(yield eUi(`${t}/${s}`))}a(Fgc,"ObjectType");function*Ugc(t,e,r){if(!(0,HL.IsArray)(r))return yield DCt(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(Hgc,"IsRootUpdate");function Ggc(t){return t.length===0}a(Ggc,"IsIdentity");function $gc(t,e){if(Hgc(e))return(0,RMr.Clone)(e[0].value);if(Ggc(e))return(0,RMr.Clone)(t);let r=(0,RMr.Clone)(t);for(let n of e)switch(n.type){case"insert":{wMr.ValuePointer.Set(r,n.path,n.value);break}case"update":{wMr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{wMr.ValuePointer.Delete(r,n.path);break}}return r}a($gc,"Patch")});var NMr=I(pie=>{"use strict";p();var Vgc=pie&&pie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wgc=pie&&pie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vgc(e,t,r)};Object.defineProperty(pie,"__esModule",{value:!0});Wgc(tUi(),pie)});var rUi=I(OMr=>{"use strict";p();Object.defineProperty(OMr,"__esModule",{value:!0});OMr.Encode=Kgc;var MMr=t3e(),zgc=kI(),Ygc=y_e();function Kgc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,MMr.HasTransform)(e,r)?(0,MMr.TransformEncode)(e,r,n):n;if(!(0,zgc.Check)(e,r,o))throw new MMr.TransformEncodeCheckError(e,o,(0,Ygc.Errors)(e,r,o).First());return o}a(Kgc,"Encode")});var LMr=I(hie=>{"use strict";p();var Jgc=hie&&hie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zgc=hie&&hie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Jgc(e,t,r)};Object.defineProperty(hie,"__esModule",{value:!0});Zgc(rUi(),hie)});var BMr=I(mie=>{"use strict";p();var Xgc=mie&&mie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),e0c=mie&&mie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Xgc(e,t,r)};Object.defineProperty(mie,"__esModule",{value:!0});e0c(xMr(),mie)});var iUi=I(o3e=>{"use strict";p();Object.defineProperty(o3e,"__esModule",{value:!0});o3e.ValueMutateError=void 0;o3e.Mutate=a0c;var xN=Ug(),OCt=kCt(),FMr=EN(),t0c=Gf();function MCt(t){return(0,xN.IsObject)(t)&&!(0,xN.IsArray)(t)}a(MCt,"IsStandardObject");var i3e=class extends t0c.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};o3e.ValueMutateError=i3e;function r0c(t,e,r,n){if(!MCt(r))OCt.ValuePointer.Set(t,e,(0,FMr.Clone)(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)UMr(t,`${e}/${c}`,r[c],n[c])}}a(r0c,"ObjectType");function n0c(t,e,r,n){if(!(0,xN.IsArray)(r))OCt.ValuePointer.Set(t,e,(0,FMr.Clone)(n));else{for(let o=0;o{"use strict";p();var c0c=gie&&gie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),l0c=gie&&gie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&c0c(e,t,r)};Object.defineProperty(gie,"__esModule",{value:!0});l0c(iUi(),gie)});var sUi=I(wN=>{"use strict";p();Object.defineProperty(wN,"__esModule",{value:!0});wN.ParseDefault=wN.ParseRegistry=wN.ParseError=void 0;wN.Parse=y0c;var u0c=Gf(),LCt=t3e(),d0c=gCt(),f0c=_Ct(),p0c=CCt(),h0c=EN(),m0c=SCt(),g0c=xCt(),oUi=Ug(),s3e=class extends u0c.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};wN.ParseError=s3e;var qMr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,d0c.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,f0c.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,p0c.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,h0c.Clone)(l)],["Convert",(s,c,l)=>(0,m0c.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,LCt.HasTransform)(s,c)?(0,LCt.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,g0c.Default)(s,c,l)],["Encode",(s,c,l)=>(0,LCt.HasTransform)(s,c)?(0,LCt.TransformEncode)(s,c,l):l]]);function r(s){e.delete(s)}a(r,"Delete"),t.Delete=r;function n(s,c){e.set(s,c)}a(n,"Set"),t.Set=n;function o(s){return e.get(s)}a(o,"Get"),t.Get=o})(qMr||(wN.ParseRegistry=qMr={}));wN.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function A0c(t,e,r,n){return t.reduce((o,s)=>{let c=qMr.Get(s);if((0,oUi.IsUndefined)(c))throw new s3e(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(A0c,"ParseValue");function y0c(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,oUi.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[wN.ParseDefault,t[0],t[1],t[2]]:t.length===2?[wN.ParseDefault,t[0],[],t[1]]:(()=>{throw new s3e("Invalid Arguments")})();return A0c(e,r,n,o)}a(y0c,"Parse")});var jMr=I(Aie=>{"use strict";p();var _0c=Aie&&Aie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),E0c=Aie&&Aie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_0c(e,t,r)};Object.defineProperty(Aie,"__esModule",{value:!0});E0c(sUi(),Aie)});var cUi=I(xs=>{"use strict";p();Object.defineProperty(xs,"__esModule",{value:!0});xs.Parse=xs.Mutate=xs.Hash=xs.Equal=xs.Encode=xs.Edit=xs.Patch=xs.Diff=xs.Default=xs.Decode=xs.Create=xs.Convert=xs.Clone=xs.Clean=xs.Check=xs.Cast=xs.Assert=xs.ValueErrorIterator=xs.Errors=void 0;var aUi=y_e();Object.defineProperty(xs,"Errors",{enumerable:!0,get:a(function(){return aUi.Errors},"get")});Object.defineProperty(xs,"ValueErrorIterator",{enumerable:!0,get:a(function(){return aUi.ValueErrorIterator},"get")});var v0c=gCt();Object.defineProperty(xs,"Assert",{enumerable:!0,get:a(function(){return v0c.Assert},"get")});var C0c=_Ct();Object.defineProperty(xs,"Cast",{enumerable:!0,get:a(function(){return C0c.Cast},"get")});var b0c=kI();Object.defineProperty(xs,"Check",{enumerable:!0,get:a(function(){return b0c.Check},"get")});var S0c=CCt();Object.defineProperty(xs,"Clean",{enumerable:!0,get:a(function(){return S0c.Clean},"get")});var T0c=EN();Object.defineProperty(xs,"Clone",{enumerable:!0,get:a(function(){return T0c.Clone},"get")});var I0c=SCt();Object.defineProperty(xs,"Convert",{enumerable:!0,get:a(function(){return I0c.Convert},"get")});var x0c=ACt();Object.defineProperty(xs,"Create",{enumerable:!0,get:a(function(){return x0c.Create},"get")});var w0c=CMr();Object.defineProperty(xs,"Decode",{enumerable:!0,get:a(function(){return w0c.Decode},"get")});var R0c=xCt();Object.defineProperty(xs,"Default",{enumerable:!0,get:a(function(){return R0c.Default},"get")});var HMr=NMr();Object.defineProperty(xs,"Diff",{enumerable:!0,get:a(function(){return HMr.Diff},"get")});Object.defineProperty(xs,"Patch",{enumerable:!0,get:a(function(){return HMr.Patch},"get")});Object.defineProperty(xs,"Edit",{enumerable:!0,get:a(function(){return HMr.Edit},"get")});var k0c=LMr();Object.defineProperty(xs,"Encode",{enumerable:!0,get:a(function(){return k0c.Encode},"get")});var P0c=BMr();Object.defineProperty(xs,"Equal",{enumerable:!0,get:a(function(){return P0c.Equal},"get")});var D0c=qBe();Object.defineProperty(xs,"Hash",{enumerable:!0,get:a(function(){return D0c.Hash},"get")});var N0c=QMr();Object.defineProperty(xs,"Mutate",{enumerable:!0,get:a(function(){return N0c.Mutate},"get")});var M0c=jMr();Object.defineProperty(xs,"Parse",{enumerable:!0,get:a(function(){return M0c.Parse},"get")})});var lUi=I(GL=>{"use strict";p();var O0c=GL&&GL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L0c=GL&&GL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),B0c=GL&&GL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var F0c=nl&&nl.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dA=nl&&nl.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&F0c(e,t,r)};Object.defineProperty(nl,"__esModule",{value:!0});nl.Value=nl.ValueErrorIterator=nl.ValueErrorType=void 0;var uUi=y_e();Object.defineProperty(nl,"ValueErrorType",{enumerable:!0,get:a(function(){return uUi.ValueErrorType},"get")});Object.defineProperty(nl,"ValueErrorIterator",{enumerable:!0,get:a(function(){return uUi.ValueErrorIterator},"get")});dA(Ug(),nl);dA(gCt(),nl);dA(_Ct(),nl);dA(kI(),nl);dA(CCt(),nl);dA(EN(),nl);dA(SCt(),nl);dA(ACt(),nl);dA(CMr(),nl);dA(xCt(),nl);dA(NMr(),nl);dA(LMr(),nl);dA(BMr(),nl);dA(qBe(),nl);dA(QMr(),nl);dA(jMr(),nl);dA(kCt(),nl);dA(t3e(),nl);var U0c=lUi();Object.defineProperty(nl,"Value",{enumerable:!0,get:a(function(){return U0c.Value},"get")})});var fUi=I(BCt=>{"use strict";p();Object.defineProperty(BCt,"__esModule",{value:!0});BCt.assertShape=void 0;var dUi=GMr(),Q0c=a((t,e)=>{if(dUi.Value.Check(t,e))return e;let r=`Typebox schema validation failed: +${[...dUi.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` +`)}`;throw new Error(r)},"assertShape");BCt.assertShape=Q0c});var yie={};Ti(yie,{CAPIClient:()=>V0c,RequestType:()=>hUi});async function G0c(t){if(!t)return;let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),r=Math.floor(Date.now()/1e3).toString(),n=new TextEncoder().encode(r),o=await crypto.subtle.sign("HMAC",e,n),s=Array.from(new Uint8Array(o)).map(c=>c.toString(16).padStart(2,"0")).join("");return`${r}.${s}`}function $0c(t){return new Set(["ChatCompletions","ChatResponses","ChatMessages","CAPIEmbeddings","Models","RemoteAgent","CodeReviewAgent","RemoteAgentChat","ListSkills","SearchSkill","ModelPolicy","ListModel","AutoModels","CopilotSessionLogs","CopilotSessionDetails","CopilotSessions","CopilotAgentJob","CCAModelsList","CopilotCustomAgents","CopilotAgentMemory","ModelRouter"]).has(t)}var q0c,$Mr,a3e,j0c,H0c,hUi,V0c,_ie=Se(()=>{p();q0c=class{static{a(this,"y")}async fetch(t,e){let r={method:e.method||"GET",headers:e.headers,signal:e.signal};e.json?(r.body=JSON.stringify(e.json),r.headers={"Content-Type":"application/json",...r.headers}):e.body&&(r.body=e.body);let n,o;e.timeout&&!e.signal&&(o=new AbortController,r.signal=o.signal,n=setTimeout(()=>{o.abort()},e.timeout));try{let s=await fetch(t,r);return n&&clearTimeout(n),s}catch(s){throw n&&clearTimeout(n),s}}async fetchWithPagination(t,e){let r=[],n=e.pageSize??20,o=e.startPage??1,s=!1;do{let c=e.buildUrl(t,n,o),l=await this.fetch(c,e);if(!l.ok)return r;let u=await l.json(),d=e.getItemsFromResponse(u);r.push(...d),s=d.length===n,o++}while(s);return r}createWebSocket(t,e){return{webSocket:new WebSocket(t)}}},$Mr=class pUi{static{a(this,"h")}constructor(){this._telemetryBaseUrl="https://copilot-telemetry.githubusercontent.com",this._originTrackerUrl="https://origin-tracker.githubusercontent.com",this._dotcomAPIUrl=this._getDotComAPIUrl(),this._proxyBaseUrl=this._getProxyUrl(void 0),this._capiBaseUrl=this._getCAPIUrl(void 0)}updateDomains(e,r){let n=this._dotcomAPIUrl,o=this._capiBaseUrl,s=this._telemetryBaseUrl,c=this._proxyBaseUrl;return this._enterpriseUrlConfig!==r&&(this._enterpriseUrlConfig=r,this._dotcomAPIUrl=this._getDotComAPIUrl()),e?(this._proxyBaseUrl=this._getProxyUrl(e),this._capiBaseUrl=this._getCAPIUrl(e),this._telemetryBaseUrl=e.endpoints.telemetry||"https://copilot-telemetry.githubusercontent.com",e.endpoints["origin-tracker"]&&(this._originTrackerUrl=e.endpoints["origin-tracker"])):(this._capiBaseUrl="https://api.githubcopilot.com",this._telemetryBaseUrl="https://copilot-telemetry.githubusercontent.com"),{dotcomUrlChanged:n!==this._dotcomAPIUrl,capiUrlChanged:o!==this._capiBaseUrl,telemetryUrlChanged:s!==this._telemetryBaseUrl,proxyUrlChanged:c!==this._proxyBaseUrl}}_getDotComAPIUrl(){if(this._enterpriseUrlConfig)try{let e=new URL(this._enterpriseUrlConfig);return`${e.protocol}//api.${e.hostname}${e.port?":"+e.port:""}`}catch(e){return console.warn("Failed to parse enterprise URL config:",this._enterpriseUrlConfig,e),"https://api.github.com"}return"https://api.github.com"}_getCAPIUrl(e){return e&&e.endpoints.api||"https://api.githubcopilot.com"}_getProxyUrl(e){return e&&e.endpoints.proxy||pUi.DEFAULT_PROXY_BASE_URL}get proxyBaseURL(){return this._proxyBaseUrl}get capiBaseURL(){return this._capiBaseUrl}get capiChatURL(){return`${this._capiBaseUrl}/chat/completions`}get capiResponsesURL(){return`${this._capiBaseUrl}/responses`}get capiMessagesURL(){return`${this._capiBaseUrl}/v1/messages`}get capiEmbeddingsURL(){return`${this._capiBaseUrl}/embeddings`}get capiModelsURL(){return`${this._capiBaseUrl}/models`}get capiAutoModelURL(){return`${this.capiModelsURL}/session`}get capiModelRouterURL(){return`${this.capiAutoModelURL}/intent`}get embeddingsModelURL(){return`${this.embeddingsURL}/models`}get chunksURL(){return`${this.dotComAPIURL}/chunks`}get embeddingsURL(){return`${this.dotComAPIURL}/embeddings`}get embeddingsCodeSearchURL(){return`${this.dotComAPIURL}/embeddings/code/search`}get telemetryURL(){return`${this._telemetryBaseUrl}/telemetry`}get remoteAgentsURL(){return`${this._capiBaseUrl}/agents`}get listSkillsURL(){return`${this._capiBaseUrl}/skills`}get searchSkillURL(){return`${this._capiBaseUrl}/search`}get contentExclusionURL(){return`${this._dotcomAPIUrl}/copilot_internal/content_exclusion`}get copilotUserInfoURL(){return`${this._dotcomAPIUrl}/copilot_internal/user`}get tokenURL(){return this._dotcomAPIUrl+"/copilot_internal/v2/token"}get tokenNoAuthURL(){return`${this._dotcomAPIUrl}/copilot_internal/v2/nltoken`}get dotComAPIURL(){return this._dotcomAPIUrl}get originTrackerURL(){return this._originTrackerUrl}get chatAttachmentUploadURL(){return"https://uploads.github.com/copilot/chat/attachments"}get copilotAgentSessionsURL(){return`${this._capiBaseUrl}/agents/sessions`}get copilotAgentJobsURL(){return`${this._capiBaseUrl}/agents/swe`}get copilotAgentTasksURL(){return`${this._dotcomAPIUrl}/cmc_internal/api/agents`}get CCAModelsURL(){return`${this._capiBaseUrl}/agents/swe/models`}get copilotCustomAgentsURL(){return`${this._capiBaseUrl}/agents/swe/custom-agents`}get copilotAgentMemoryURL(){return`${this._capiBaseUrl}/agents/swe/internal/memory/v0`}};$Mr.DEFAULT_PROXY_BASE_URL="https://copilot-proxy.githubusercontent.com",$Mr.CAPI_MODEL_LAB_URL="https://api-model-lab.githubcopilot.com";a3e=$Mr,j0c=`The \u201C@vscode/copilot-api\u201D npm Module Terms and Conditions ("Terms") are a legal agreement between you (either as an individual or on behalf of an entity) and GitHub, Inc. regarding your use of \u201C@vscode/copilot-api\u201D npm library and associated documentation (collectively, the "Software"). By using the Software, you accept these Terms. Please read all of these Terms; in many cases, provisions set forth later in the Terms limit and qualify provisions set forth earlier in the Terms. If you do not accept these Terms, do not download, install, use, or copy the Software. IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. @@ -1073,52 +1073,52 @@ Subject to the foregoing clause (ii), GitHub will only be liable for slight negl This limitation applies to (a) anything related to the software, services, content (including code) on third party Internet sites, or third party applications; and (b) claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law. -It also applies even if GitHub knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.`,q0c=`I have read and agree to the following license terms: +It also applies even if GitHub knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.`,H0c=`I have read and agree to the following license terms: -${Q0c} -`,fUi=(t=>(t.CopilotToken="CopilotToken",t.CopilotNLToken="CopilotNLToken",t.ChatCompletions="ChatCompletions",t.ChatResponses="ChatResponses",t.ChatMessages="ChatMessages",t.ProxyCompletions="ProxyCompletions",t.ProxyChatCompletions="ProxyChatCompletions",t.RemoteAgent="RemoteAgent",t.RemoteAgentChat="RemoteAgentChat",t.CodeReviewAgent="CodeReviewAgent",t.CAPIEmbeddings="CAPIEmbeddings",t.DotcomEmbeddings="DotcomEmbeddings",t.EmbeddingsModels="EmbeddingsModels",t.Models="Models",t.AutoModels="AutoModels",t.Chunks="Chunks",t.EmbeddingsCodeSearch="EmbeddingsCodeSearch",t.ListSkills="ListSkills",t.SearchSkill="SearchSkill",t.ContentExclusion="ContentExclusion",t.Telemetry="Telemetry",t.CopilotUserInfo="CopilotUserInfo",t.ModelPolicy="ModelPolicy",t.ListModel="ListModel",t.SnippyMatch="SnippyMatch",t.SnippyFilesForMatch="SnippyFlesForMatch",t.CodingGuidelines="CodingGuidelines",t.EmbeddingsIndex="EmbedingsIndex",t.ChatAttachmentUpload="ChatAttachmentUpload",t.CopilotSessionLogs="CopilotSessionLogs",t.CopilotSessionDetails="CopilotSessionDetails",t.CopilotSessions="CopilotSessions",t.CopilotAgentJob="CopilotAgentJob",t.CCAModelsList="CCAModelsList",t.CopilotCustomAgents="CopilotCustomAgents",t.CopilotCustomAgentsDetail="CopilotCustomAgentsDetail",t.OrgCustomInstructions="OrgCustomInstructions",t.CopilotAgentMemory="CopilotAgentMemory",t.CopilotAgentJobEnabled="CopilotAgentJobEnabled",t.AgentTask="AgentTask",t.ModelRouter="ModelRouter",t))(fUi||{});a(j0c,"v");a(H0c,"_");G0c=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===q0c&&(this._licenseCheckSucceeded=!0),this._domainService=new a3e,this._fetcherService=r??new U0c,this._hmacSecret=n,this._integrationId==="vscode-chat"||this._integrationId==="code-oss")throw new Error(`Integration ID ${this._integrationId} is reserved and cannot be used.`)}updateDomains(t,e){return t&&t.sku&&(this._copilotSku=t.sku),this._domainService.updateDomains(t,e)}async makeRequest(t,e){let{type:r}=e;await this._mixinHeaders(t,e);let n={...t,callSite:t.callSite??r};switch(r){case"CopilotToken":return this._fetcherService.fetch(this._domainService.tokenURL,n);case"CopilotNLToken":return this._fetcherService.fetch(this._domainService.tokenNoAuthURL,n);case"ProxyCompletions":return this._fetcherService.fetch(`${this._domainService.proxyBaseURL}/v1/engines/gpt-4o-copilot/completions`,n);case"ProxyChatCompletions":return this._fetcherService.fetch(`${this._domainService.proxyBaseURL}/chat/completions`,n);case"RemoteAgent":return this._fetcherService.fetch(this._domainService.remoteAgentsURL,n);case"CodeReviewAgent":return this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/github-code-review`,n);case"CAPIEmbeddings":return this._fetcherService.fetch(this._domainService.capiEmbeddingsURL,n);case"DotcomEmbeddings":return this._fetcherService.fetch(this._domainService.embeddingsURL,n);case"EmbeddingsModels":return this._fetcherService.fetch(this._domainService.embeddingsModelURL,n);case"Chunks":return this._fetcherService.fetch(this._domainService.chunksURL,n);case"EmbeddingsCodeSearch":return this._fetcherService.fetch(this._domainService.embeddingsCodeSearchURL,n);case"ListSkills":return this._fetcherService.fetch(this._domainService.listSkillsURL,n);case"Telemetry":return this._fetcherService.fetch(this._domainService.telemetryURL,n);case"CopilotUserInfo":return this._fetcherService.fetch(this._domainService.copilotUserInfoURL,n);case"SnippyMatch":return this._fetcherService.fetch(`${this._domainService.originTrackerURL}/twirp/github.snippy.v1.SnippyAPI/Match`,n);case"SnippyFlesForMatch":return this._fetcherService.fetch(`${this._domainService.originTrackerURL}/twirp/github.snippy.v1.SnippyAPI/FilesForMatch`,n);case"EmbedingsIndex":if(!("repoWithOwner"in e))throw new Error("repoWithOwner is required for EmbeddingsIndex request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/repos/${e.repoWithOwner}/copilot_internal/embeddings_index`,n);case"CodingGuidelines":if(!("repoWithOwner"in e))throw new Error("repoWithOwner is required for CodingGuidelines request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/repos/${e.repoWithOwner}/copilot_internal/coding_guidelines`,n);case"AutoModels":return this._fetcherService.fetch(this._domainService.capiAutoModelURL,n);case"ModelRouter":return this._fetcherService.fetch(this._domainService.capiModelRouterURL,n);case"Models":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${a3e.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${a3e.CAPI_MODEL_LAB_URL}/chat/completions`,n):this._fetcherService.fetch(this._domainService.capiChatURL,n);case"ChatResponses":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${a3e.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${a3e.CAPI_MODEL_LAB_URL}/v1/messages`,n):this._fetcherService.fetch(this._domainService.capiMessagesURL,n);case"ContentExclusion":if(!("repos"in e))throw new Error("Repos are required for ContentExclusion request");return this._fetcherService.fetch(this._prepareContentExclusionUrl(e.repos),n);case"RemoteAgentChat":return"slug"in e&&e.slug?this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/${e.slug}?chat`,n):this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/chat`,n);case"SearchSkill":if(!("slug"in e))throw new Error("Skill slug is required for SearchSkill request");return this._fetcherService.fetch(`${this._domainService.searchSkillURL}/${e.slug}`,n);case"ModelPolicy":if(!("modelId"in e))throw new Error("Model ID is required for ModelPolicy request");return this._fetcherService.fetch(`${this._domainService.capiModelsURL}/${e.modelId}/policy`,n);case"ListModel":if(!("modelId"in e))throw new Error("Model ID is required for ListModel request");return this._fetcherService.fetch(`${this._domainService.capiModelsURL}/${e.modelId}`,n);case"ChatAttachmentUpload":if(!("uploadName"in e)||!("mimeType"in e))throw new Error("uploadName and mimeType are required for ChatAttachmentUpload request");return this._fetcherService.fetch(`${this._domainService.chatAttachmentUploadURL}?name=${e.uploadName}&content_type=${e.mimeType}`,n);case"CopilotSessionLogs":if(!("sessionId"in e))throw new Error("sessionId is required for CopilotSessionLogs request");return this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/${e.sessionId}/logs`,n);case"CopilotSessionDetails":if(!("sessionId"in e))throw new Error("sessionId is required for CopilotSessionDetails request");return this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/${e.sessionId}`,n);case"CopilotSessions":let o={...n,getItemsFromResponse:a(s=>{let c=s;return c&&Array.isArray(c.sessions)?c.sessions:[]},"getItemsFromResponse"),buildUrl:a((s,c,l)=>{let u=new URL(s);return u.searchParams.set("page_size",c.toString()),u.searchParams.set("page_number",l.toString()),"resourceState"in e&&e.resourceState&&u.searchParams.set("resource_state",e.resourceState),"nwo"in e&&e.nwo&&u.searchParams.set("repo_nwo",e.nwo),u.toString()},"buildUrl")};return"prId"in e&&e.prId?this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/resource/pull/${e.prId}`,n):this._fetcherService.fetchWithPagination(this._domainService.copilotAgentSessionsURL,o);case"CopilotAgentJob":if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotAgentJob request");if("jobId"in e&&e.jobId){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}/${e.jobId}`,n)}if("sessionId"in e&&e.sessionId){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}/session/${e.sessionId}`,n)}if("payload"in e&&e.payload){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}`,n)}throw new Error("jobId or sessionId is required for CopilotAgentJob request");case"CCAModelsList":return this._fetcherService.fetch(this._domainService.CCAModelsURL,n);case"CopilotCustomAgents":{if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotCustomAgents request");let s=new URL(`${this._domainService.copilotCustomAgentsURL}/${e.owner}/${e.repo}`);return"target"in e&&e.target&&s.searchParams.set("target",e.target),"exclude_invalid_config"in e&&e.exclude_invalid_config!==void 0&&s.searchParams.set("exclude_invalid_config",e.exclude_invalid_config.toString()),"dedupe"in e&&e.dedupe!==void 0&&s.searchParams.set("dedupe",e.dedupe.toString()),"include_sources"in e&&e.include_sources&&s.searchParams.set("include_sources",e.include_sources.join(",")),this._fetcherService.fetch(s.toString(),n)}case"CopilotCustomAgentsDetail":{if(!("owner"in e)||!("repo"in e)||!("customAgentName"in e))throw new Error("owner, repo and customAgentName are required for CopilotCustomAgents request");let s=new URL(`${this._domainService.copilotCustomAgentsURL}/${e.owner}/${e.repo}/${e.customAgentName}`);return"version"in e&&e.version&&s.searchParams.set("version",e.version),this._fetcherService.fetch(s.toString(),n)}case"OrgCustomInstructions":if(!("orgLogin"in e))throw new Error("orgLogin is required for OrgCustomInstructions request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/copilot_internal/org_custom_instructions/${e.orgLogin}`,n);case"CopilotAgentMemory":{if(!("repo"in e))throw new Error("repo is required for CopilotAgentMemory request");let s="action"in e?e.action:"",c=`${this._domainService.copilotAgentMemoryURL}/${e.repo}`;return s&&(c+=`/${s}`,s==="recent"&&"limit"in e&&e.limit!==void 0&&(c+=`?limit=${e.limit}`)),this._fetcherService.fetch(c,n)}case"CopilotAgentJobEnabled":{if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotAgentJobEnabled request");return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/v1/jobs/${e.owner}/${e.repo}/enabled`,n)}case"AgentTask":return this._fetcherService.fetch(this._buildAgentTaskURL(e),n);default:throw new Error(`Unsupported request type: ${r}`)}}_buildAgentTaskURL(t){let e=this._domainService.copilotAgentTasksURL,{action:r,owner:n,repo:o,taskId:s,searchParams:c}=t,l=a(()=>{if(!s)throw new Error(`taskId is required for AgentTask action "${r}"`);return s},"l"),u=a(()=>{if(!n||!o)throw new Error(`owner and repo are required for AgentTask action "${r}"`);return{owner:n,repo:o}},"g"),d;switch(r){case"create":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks`;break}case"list":d="/tasks";break;case"list-for-repo":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks`;break}case"get":d=`/tasks/${l()}`;break;case"events":d=`/tasks/${l()}/events`;break;case"steer":d=`/tasks/${l()}/steer`;break;case"create-pr":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks/${l()}/pulls`;break}case"archive":d=`/tasks/${l()}/archive`;break;case"unarchive":d=`/tasks/${l()}/unarchive`;break;default:{let h=r;throw new Error(`Unsupported AgentTask action: ${h}`)}}let f=`${e}${d}`;if(c){let h=new URLSearchParams;for(let[g,A]of Object.entries(c))A!=null&&h.set(g,String(A));let m=h.toString();m&&(f+=`?${m}`)}return f}async createResponsesWebSocket(t){return await this._mixinHeaders(t,{type:"ChatResponses"}),this._fetcherService.createWebSocket(this._domainService.capiResponsesURL,t)}_prepareContentExclusionUrl(t){let e=t.join(","),r=new URL(this._domainService.contentExclusionURL);return t.length!==0&&r.searchParams.set("repos",e),r.searchParams.set("scope","repo"),r.toString()}async _mixinHeaders(t,e){if(!H0c(e.type))return;let r=t.headers||{};r["X-GitHub-Api-Version"]="2026-06-01",r["VScode-SessionId"]=this._extensionInfo.sessionId,r["VScode-MachineId"]=this._extensionInfo.machineId,r["Editor-Device-Id"]=this._extensionInfo.deviceId,r["Editor-Plugin-Version"]=`copilot-chat/${this._extensionInfo.version}`,r["Editor-Version"]=`vscode/${this._extensionInfo.vscodeVersion}`;let n="";t.suppressIntegrationId||(n="code-oss",this._integrationId&&this._hmacSecret?n=this._integrationId:this._copilotSku==="no_auth_limited_copilot"?n="vscode-nl":this._licenseCheckSucceeded&&this._extensionInfo.buildType==="prod"?n="vscode-chat":this._extensionInfo.buildType==="dev"&&this._hmacSecret&&(n="vscode-chat-dev"),r["Copilot-Integration-Id"]=n),n==="vscode-chat-dev"&&(r["Request-Hmac"]=await j0c(this._hmacSecret)),t.headers=r}get copilotTelemetryURL(){return this._domainService.telemetryURL}get dotcomAPIURL(){return this._domainService.dotComAPIURL}get capiPingURL(){return`${this._domainService.capiBaseURL}/_ping`}get proxyBaseURL(){return this._domainService.proxyBaseURL}get originTrackerURL(){return this._domainService.originTrackerURL}get snippyMatchPath(){return"twirp/github.snippy.v1.SnippyAPI/Match"}get snippyFilesForMatchPath(){return"twirp/github.snippy.v1.SnippyAPI/FilesForMatch"}}});var Oy=I(nC=>{"use strict";p();Object.defineProperty(nC,"__esModule",{value:!0});nC.DestroyableStream=nC.HeadersImpl=nC.Response=nC.NO_FETCH_TELEMETRY=nC.IFetcherService=void 0;nC.jsonVerboseError=V0c;nC.isAbortError=pUi;nC.safeGetHostname=W0c;var $0c=an();nC.IFetcherService=(0,$0c.createServiceIdentifier)("IFetcherService");nC.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var $Mr=class t{static{a(this,"Response")}get bytesReceived(){return this._bytesReceived}constructor(e,r,n,o,s,c,l,u,d){this.status=e,this.statusText=r,this.headers=n,this.fetcher=s,this._reportEvent=c,this._internalId=l,this._hostname=u,this.cacheStatus=d,this.ok=this.status>=200&&this.status<300,this._bytesReceived=0;let f={transform:a((g,A)=>{this._bytesReceived+=g.length,A.enqueue(g)},"transform"),flush:a(()=>{this._reportEvent({internalId:this._internalId,timestamp:Date.now(),outcome:"success",phase:"responseStreaming",fetcher:this.fetcher,hostname:this._hostname,bytesReceived:this._bytesReceived})},"flush"),cancel:a(g=>{let A=g&&!pUi(g)?"error":"cancel";this._reportEvent({internalId:this._internalId,timestamp:Date.now(),outcome:A,phase:"responseStreaming",fetcher:this.fetcher,hostname:this._hostname,reason:g,bytesReceived:this._bytesReceived})},"cancel")},h=new TransformStream(f),m=o??new ReadableStream({start(g){g.close()}});this.body=new BCt(m.pipeThrough(h))}static fromText(e,r,n,o,s){return new t(e,r,n,new ReadableStream({start(c){c.enqueue(new TextEncoder().encode(o)),c.close()}}),s,()=>{},"in-memory","in-memory")}async text(){let e=[];for await(let s of this.body)e.push(s);let r=e.reduce((s,c)=>s+c.length,0),n=new Uint8Array(r),o=0;for(let s of e)n.set(s,o),o+=s.length;return new TextDecoder().decode(n)}async json(){return JSON.parse(await this.text())}};nC.Response=$Mr;var VMr=class t{static{a(this,"HeadersImpl")}constructor(e){this._record=e}static fromMap(e){return new t(Object.fromEntries(e))}get(e){let r=this._record[e];return Array.isArray(r)?r[0]:r??null}[Symbol.iterator](){let e=Object.keys(this._record),r=0;return{next:a(()=>{if(r>=e.length)return{done:!0,value:void 0};let n=e[r++];return{done:!1,value:[n,this.get(n)]}},"next")}}};nC.HeadersImpl=VMr;var BCt=class t{static{a(this,"DestroyableStream")}constructor(e){this.stream=e}toReadableStream(){return this.stream}pipeThrough(e){let r=new t(this.stream.pipeThrough(e));return this.pipedHead=r,r}async*[Symbol.asyncIterator](){this.reader=this.stream.getReader();try{for(;;){let{done:e,value:r}=await this.reader.read();if(e)break;yield r}}finally{this.reader.releaseLock(),this.reader=void 0}}destroy(){return this.pipedHead?this.pipedHead.destroy():this.reader?this.reader.cancel():this.stream.cancel()}};nC.DestroyableStream=BCt;async function V0c(t){let e=await t.text();try{return JSON.parse(e)}catch(r){let n=e.split(` +${j0c} +`,hUi=(t=>(t.CopilotToken="CopilotToken",t.CopilotNLToken="CopilotNLToken",t.ChatCompletions="ChatCompletions",t.ChatResponses="ChatResponses",t.ChatMessages="ChatMessages",t.ProxyCompletions="ProxyCompletions",t.ProxyChatCompletions="ProxyChatCompletions",t.RemoteAgent="RemoteAgent",t.RemoteAgentChat="RemoteAgentChat",t.CodeReviewAgent="CodeReviewAgent",t.CAPIEmbeddings="CAPIEmbeddings",t.DotcomEmbeddings="DotcomEmbeddings",t.EmbeddingsModels="EmbeddingsModels",t.Models="Models",t.AutoModels="AutoModels",t.Chunks="Chunks",t.EmbeddingsCodeSearch="EmbeddingsCodeSearch",t.ListSkills="ListSkills",t.SearchSkill="SearchSkill",t.ContentExclusion="ContentExclusion",t.Telemetry="Telemetry",t.CopilotUserInfo="CopilotUserInfo",t.ModelPolicy="ModelPolicy",t.ListModel="ListModel",t.SnippyMatch="SnippyMatch",t.SnippyFilesForMatch="SnippyFlesForMatch",t.CodingGuidelines="CodingGuidelines",t.EmbeddingsIndex="EmbedingsIndex",t.ChatAttachmentUpload="ChatAttachmentUpload",t.CopilotSessionLogs="CopilotSessionLogs",t.CopilotSessionDetails="CopilotSessionDetails",t.CopilotSessions="CopilotSessions",t.CopilotAgentJob="CopilotAgentJob",t.CCAModelsList="CCAModelsList",t.CopilotCustomAgents="CopilotCustomAgents",t.CopilotCustomAgentsDetail="CopilotCustomAgentsDetail",t.OrgCustomInstructions="OrgCustomInstructions",t.CopilotAgentMemory="CopilotAgentMemory",t.CopilotAgentJobEnabled="CopilotAgentJobEnabled",t.AgentTask="AgentTask",t.ModelRouter="ModelRouter",t))(hUi||{});a(G0c,"v");a($0c,"_");V0c=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===H0c&&(this._licenseCheckSucceeded=!0),this._domainService=new a3e,this._fetcherService=r??new q0c,this._hmacSecret=n,this._integrationId==="vscode-chat"||this._integrationId==="code-oss")throw new Error(`Integration ID ${this._integrationId} is reserved and cannot be used.`)}updateDomains(t,e){return t&&t.sku&&(this._copilotSku=t.sku),this._domainService.updateDomains(t,e)}async makeRequest(t,e){let{type:r}=e;await this._mixinHeaders(t,e);let n={...t,callSite:t.callSite??r};switch(r){case"CopilotToken":return this._fetcherService.fetch(this._domainService.tokenURL,n);case"CopilotNLToken":return this._fetcherService.fetch(this._domainService.tokenNoAuthURL,n);case"ProxyCompletions":return this._fetcherService.fetch(`${this._domainService.proxyBaseURL}/v1/engines/gpt-4o-copilot/completions`,n);case"ProxyChatCompletions":return this._fetcherService.fetch(`${this._domainService.proxyBaseURL}/chat/completions`,n);case"RemoteAgent":return this._fetcherService.fetch(this._domainService.remoteAgentsURL,n);case"CodeReviewAgent":return this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/github-code-review`,n);case"CAPIEmbeddings":return this._fetcherService.fetch(this._domainService.capiEmbeddingsURL,n);case"DotcomEmbeddings":return this._fetcherService.fetch(this._domainService.embeddingsURL,n);case"EmbeddingsModels":return this._fetcherService.fetch(this._domainService.embeddingsModelURL,n);case"Chunks":return this._fetcherService.fetch(this._domainService.chunksURL,n);case"EmbeddingsCodeSearch":return this._fetcherService.fetch(this._domainService.embeddingsCodeSearchURL,n);case"ListSkills":return this._fetcherService.fetch(this._domainService.listSkillsURL,n);case"Telemetry":return this._fetcherService.fetch(this._domainService.telemetryURL,n);case"CopilotUserInfo":return this._fetcherService.fetch(this._domainService.copilotUserInfoURL,n);case"SnippyMatch":return this._fetcherService.fetch(`${this._domainService.originTrackerURL}/twirp/github.snippy.v1.SnippyAPI/Match`,n);case"SnippyFlesForMatch":return this._fetcherService.fetch(`${this._domainService.originTrackerURL}/twirp/github.snippy.v1.SnippyAPI/FilesForMatch`,n);case"EmbedingsIndex":if(!("repoWithOwner"in e))throw new Error("repoWithOwner is required for EmbeddingsIndex request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/repos/${e.repoWithOwner}/copilot_internal/embeddings_index`,n);case"CodingGuidelines":if(!("repoWithOwner"in e))throw new Error("repoWithOwner is required for CodingGuidelines request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/repos/${e.repoWithOwner}/copilot_internal/coding_guidelines`,n);case"AutoModels":return this._fetcherService.fetch(this._domainService.capiAutoModelURL,n);case"ModelRouter":return this._fetcherService.fetch(this._domainService.capiModelRouterURL,n);case"Models":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${a3e.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${a3e.CAPI_MODEL_LAB_URL}/chat/completions`,n):this._fetcherService.fetch(this._domainService.capiChatURL,n);case"ChatResponses":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${a3e.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${a3e.CAPI_MODEL_LAB_URL}/v1/messages`,n):this._fetcherService.fetch(this._domainService.capiMessagesURL,n);case"ContentExclusion":if(!("repos"in e))throw new Error("Repos are required for ContentExclusion request");return this._fetcherService.fetch(this._prepareContentExclusionUrl(e.repos),n);case"RemoteAgentChat":return"slug"in e&&e.slug?this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/${e.slug}?chat`,n):this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/chat`,n);case"SearchSkill":if(!("slug"in e))throw new Error("Skill slug is required for SearchSkill request");return this._fetcherService.fetch(`${this._domainService.searchSkillURL}/${e.slug}`,n);case"ModelPolicy":if(!("modelId"in e))throw new Error("Model ID is required for ModelPolicy request");return this._fetcherService.fetch(`${this._domainService.capiModelsURL}/${e.modelId}/policy`,n);case"ListModel":if(!("modelId"in e))throw new Error("Model ID is required for ListModel request");return this._fetcherService.fetch(`${this._domainService.capiModelsURL}/${e.modelId}`,n);case"ChatAttachmentUpload":if(!("uploadName"in e)||!("mimeType"in e))throw new Error("uploadName and mimeType are required for ChatAttachmentUpload request");return this._fetcherService.fetch(`${this._domainService.chatAttachmentUploadURL}?name=${e.uploadName}&content_type=${e.mimeType}`,n);case"CopilotSessionLogs":if(!("sessionId"in e))throw new Error("sessionId is required for CopilotSessionLogs request");return this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/${e.sessionId}/logs`,n);case"CopilotSessionDetails":if(!("sessionId"in e))throw new Error("sessionId is required for CopilotSessionDetails request");return this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/${e.sessionId}`,n);case"CopilotSessions":let o={...n,getItemsFromResponse:a(s=>{let c=s;return c&&Array.isArray(c.sessions)?c.sessions:[]},"getItemsFromResponse"),buildUrl:a((s,c,l)=>{let u=new URL(s);return u.searchParams.set("page_size",c.toString()),u.searchParams.set("page_number",l.toString()),"resourceState"in e&&e.resourceState&&u.searchParams.set("resource_state",e.resourceState),"nwo"in e&&e.nwo&&u.searchParams.set("repo_nwo",e.nwo),u.toString()},"buildUrl")};return"prId"in e&&e.prId?this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/resource/pull/${e.prId}`,n):this._fetcherService.fetchWithPagination(this._domainService.copilotAgentSessionsURL,o);case"CopilotAgentJob":if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotAgentJob request");if("jobId"in e&&e.jobId){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}/${e.jobId}`,n)}if("sessionId"in e&&e.sessionId){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}/session/${e.sessionId}`,n)}if("payload"in e&&e.payload){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}`,n)}throw new Error("jobId or sessionId is required for CopilotAgentJob request");case"CCAModelsList":return this._fetcherService.fetch(this._domainService.CCAModelsURL,n);case"CopilotCustomAgents":{if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotCustomAgents request");let s=new URL(`${this._domainService.copilotCustomAgentsURL}/${e.owner}/${e.repo}`);return"target"in e&&e.target&&s.searchParams.set("target",e.target),"exclude_invalid_config"in e&&e.exclude_invalid_config!==void 0&&s.searchParams.set("exclude_invalid_config",e.exclude_invalid_config.toString()),"dedupe"in e&&e.dedupe!==void 0&&s.searchParams.set("dedupe",e.dedupe.toString()),"include_sources"in e&&e.include_sources&&s.searchParams.set("include_sources",e.include_sources.join(",")),this._fetcherService.fetch(s.toString(),n)}case"CopilotCustomAgentsDetail":{if(!("owner"in e)||!("repo"in e)||!("customAgentName"in e))throw new Error("owner, repo and customAgentName are required for CopilotCustomAgents request");let s=new URL(`${this._domainService.copilotCustomAgentsURL}/${e.owner}/${e.repo}/${e.customAgentName}`);return"version"in e&&e.version&&s.searchParams.set("version",e.version),this._fetcherService.fetch(s.toString(),n)}case"OrgCustomInstructions":if(!("orgLogin"in e))throw new Error("orgLogin is required for OrgCustomInstructions request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/copilot_internal/org_custom_instructions/${e.orgLogin}`,n);case"CopilotAgentMemory":{if(!("repo"in e))throw new Error("repo is required for CopilotAgentMemory request");let s="action"in e?e.action:"",c=`${this._domainService.copilotAgentMemoryURL}/${e.repo}`;return s&&(c+=`/${s}`,s==="recent"&&"limit"in e&&e.limit!==void 0&&(c+=`?limit=${e.limit}`)),this._fetcherService.fetch(c,n)}case"CopilotAgentJobEnabled":{if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotAgentJobEnabled request");return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/v1/jobs/${e.owner}/${e.repo}/enabled`,n)}case"AgentTask":return this._fetcherService.fetch(this._buildAgentTaskURL(e),n);default:throw new Error(`Unsupported request type: ${r}`)}}_buildAgentTaskURL(t){let e=this._domainService.copilotAgentTasksURL,{action:r,owner:n,repo:o,taskId:s,searchParams:c}=t,l=a(()=>{if(!s)throw new Error(`taskId is required for AgentTask action "${r}"`);return s},"l"),u=a(()=>{if(!n||!o)throw new Error(`owner and repo are required for AgentTask action "${r}"`);return{owner:n,repo:o}},"g"),d;switch(r){case"create":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks`;break}case"list":d="/tasks";break;case"list-for-repo":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks`;break}case"get":d=`/tasks/${l()}`;break;case"events":d=`/tasks/${l()}/events`;break;case"steer":d=`/tasks/${l()}/steer`;break;case"create-pr":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks/${l()}/pulls`;break}case"archive":d=`/tasks/${l()}/archive`;break;case"unarchive":d=`/tasks/${l()}/unarchive`;break;default:{let h=r;throw new Error(`Unsupported AgentTask action: ${h}`)}}let f=`${e}${d}`;if(c){let h=new URLSearchParams;for(let[g,A]of Object.entries(c))A!=null&&h.set(g,String(A));let m=h.toString();m&&(f+=`?${m}`)}return f}async createResponsesWebSocket(t){return await this._mixinHeaders(t,{type:"ChatResponses"}),this._fetcherService.createWebSocket(this._domainService.capiResponsesURL,t)}_prepareContentExclusionUrl(t){let e=t.join(","),r=new URL(this._domainService.contentExclusionURL);return t.length!==0&&r.searchParams.set("repos",e),r.searchParams.set("scope","repo"),r.toString()}async _mixinHeaders(t,e){if(!$0c(e.type))return;let r=t.headers||{};r["X-GitHub-Api-Version"]="2026-06-01",r["VScode-SessionId"]=this._extensionInfo.sessionId,r["VScode-MachineId"]=this._extensionInfo.machineId,r["Editor-Device-Id"]=this._extensionInfo.deviceId,r["Editor-Plugin-Version"]=`copilot-chat/${this._extensionInfo.version}`,r["Editor-Version"]=`vscode/${this._extensionInfo.vscodeVersion}`;let n="";t.suppressIntegrationId||(n="code-oss",this._integrationId&&this._hmacSecret?n=this._integrationId:this._copilotSku==="no_auth_limited_copilot"?n="vscode-nl":this._licenseCheckSucceeded&&this._extensionInfo.buildType==="prod"?n="vscode-chat":this._extensionInfo.buildType==="dev"&&this._hmacSecret&&(n="vscode-chat-dev"),r["Copilot-Integration-Id"]=n),n==="vscode-chat-dev"&&(r["Request-Hmac"]=await G0c(this._hmacSecret)),t.headers=r}get copilotTelemetryURL(){return this._domainService.telemetryURL}get dotcomAPIURL(){return this._domainService.dotComAPIURL}get capiPingURL(){return`${this._domainService.capiBaseURL}/_ping`}get proxyBaseURL(){return this._domainService.proxyBaseURL}get originTrackerURL(){return this._domainService.originTrackerURL}get snippyMatchPath(){return"twirp/github.snippy.v1.SnippyAPI/Match"}get snippyFilesForMatchPath(){return"twirp/github.snippy.v1.SnippyAPI/FilesForMatch"}}});var Oy=I(nC=>{"use strict";p();Object.defineProperty(nC,"__esModule",{value:!0});nC.DestroyableStream=nC.HeadersImpl=nC.Response=nC.NO_FETCH_TELEMETRY=nC.IFetcherService=void 0;nC.jsonVerboseError=z0c;nC.isAbortError=mUi;nC.safeGetHostname=Y0c;var W0c=an();nC.IFetcherService=(0,W0c.createServiceIdentifier)("IFetcherService");nC.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var VMr=class t{static{a(this,"Response")}get bytesReceived(){return this._bytesReceived}constructor(e,r,n,o,s,c,l,u,d){this.status=e,this.statusText=r,this.headers=n,this.fetcher=s,this._reportEvent=c,this._internalId=l,this._hostname=u,this.cacheStatus=d,this.ok=this.status>=200&&this.status<300,this._bytesReceived=0;let f={transform:a((g,A)=>{this._bytesReceived+=g.length,A.enqueue(g)},"transform"),flush:a(()=>{this._reportEvent({internalId:this._internalId,timestamp:Date.now(),outcome:"success",phase:"responseStreaming",fetcher:this.fetcher,hostname:this._hostname,bytesReceived:this._bytesReceived})},"flush"),cancel:a(g=>{let A=g&&!mUi(g)?"error":"cancel";this._reportEvent({internalId:this._internalId,timestamp:Date.now(),outcome:A,phase:"responseStreaming",fetcher:this.fetcher,hostname:this._hostname,reason:g,bytesReceived:this._bytesReceived})},"cancel")},h=new TransformStream(f),m=o??new ReadableStream({start(g){g.close()}});this.body=new FCt(m.pipeThrough(h))}static fromText(e,r,n,o,s){return new t(e,r,n,new ReadableStream({start(c){c.enqueue(new TextEncoder().encode(o)),c.close()}}),s,()=>{},"in-memory","in-memory")}async text(){let e=[];for await(let s of this.body)e.push(s);let r=e.reduce((s,c)=>s+c.length,0),n=new Uint8Array(r),o=0;for(let s of e)n.set(s,o),o+=s.length;return new TextDecoder().decode(n)}async json(){return JSON.parse(await this.text())}};nC.Response=VMr;var WMr=class t{static{a(this,"HeadersImpl")}constructor(e){this._record=e}static fromMap(e){return new t(Object.fromEntries(e))}get(e){let r=this._record[e];return Array.isArray(r)?r[0]:r??null}[Symbol.iterator](){let e=Object.keys(this._record),r=0;return{next:a(()=>{if(r>=e.length)return{done:!0,value:void 0};let n=e[r++];return{done:!1,value:[n,this.get(n)]}},"next")}}};nC.HeadersImpl=WMr;var FCt=class t{static{a(this,"DestroyableStream")}constructor(e){this.stream=e}toReadableStream(){return this.stream}pipeThrough(e){let r=new t(this.stream.pipeThrough(e));return this.pipedHead=r,r}async*[Symbol.asyncIterator](){this.reader=this.stream.getReader();try{for(;;){let{done:e,value:r}=await this.reader.read();if(e)break;yield r}}finally{this.reader.releaseLock(),this.reader=void 0}}destroy(){return this.pipedHead?this.pipedHead.destroy():this.reader?this.reader.cancel():this.stream.cancel()}};nC.DestroyableStream=FCt;async function z0c(t){let e=await t.text();try{return JSON.parse(e)}catch(r){let n=e.split(` `),o=n.length>50?[...n.slice(0,25),"[...]",...n.slice(n.length-25)].join(` -`):e;throw r.message=`${r.message}. Response: ${o}`,r}}a(V0c,"jsonVerboseError");function pUi(t){return t&&t.name==="AbortError"}a(pUi,"isAbortError");function W0c(t){try{return new URL(t).hostname}catch{return"unknown"}}a(W0c,"safeGetHostname")});var hUi=I(E_e=>{"use strict";p();Object.defineProperty(E_e,"__esModule",{value:!0});E_e.INTEGRATION_ID=E_e.LICENSE_AGREEMENT=void 0;E_e.LICENSE_AGREEMENT=void 0;E_e.INTEGRATION_ID="code-oss"});var lE=I(v_e=>{"use strict";p();Object.defineProperty(v_e,"__esModule",{value:!0});v_e.ICAPIClientService=v_e.BaseCAPIClientService=void 0;var c3e=(yie(),Wa(Aie)),z0c=an(),Y0c=Oy(),K0c=hUi(),WMr=class extends c3e.CAPIClient{static{a(this,"BaseCAPIClientService")}constructor(e,r,n,o){super({machineId:o.machineId,deviceId:o.devDeviceId,sessionId:o.sessionId,vscodeVersion:o.vscodeVersion,buildType:o.getBuildType(),name:o.getName(),version:o.getVersion()},K0c.LICENSE_AGREEMENT,n,e,r)}makeRequest(e,r){return this.abExpContext&&(e.headers||(e.headers={}),e.headers["VScode-ABExpContext"]=this.abExpContext,e.headers["X-Copilot-Client-Exp-Assignment-Context"]=this.abExpContext),(r.type===c3e.RequestType.Telemetry||r.type===c3e.RequestType.ChatCompletions||r.type===c3e.RequestType.ChatMessages||r.type===c3e.RequestType.ChatResponses)&&(e.callSite=Y0c.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};v_e.BaseCAPIClientService=WMr;v_e.ICAPIClientService=(0,z0c.createServiceIdentifier)("ICAPIClientService")});var UCt=I(FCt=>{"use strict";p();Object.defineProperty(FCt,"__esModule",{value:!0});FCt.getEndpointUrl=rAc;FCt.getLastKnownEndpoints=nAc;var J0c=rE(),Z0c=lE(),wV=eE(),X0c=Kne(),eAc=rV();function gUi(t){let e=t.get(Z0c.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a(gUi,"getDefaultEndpoints");function mUi(t,e,r){if(r!==void 0&&t.get(X0c.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,wV.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,wV.getConfig)(t,n);if(o)return o}}a(mUi,"urlConfigOverride");function tAc(t,e){switch(e){case"proxy":return mUi(t,[wV.ConfigKey.DebugOverrideProxyUrl,wV.ConfigKey.DebugOverrideProxyUrlLegacy],[wV.ConfigKey.DebugTestOverrideProxyUrl,wV.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!wV.BuildInfo.isProduction())return mUi(t,[wV.ConfigKey.DebugSnippyOverrideUrl])}}a(tAc,"getEndpointOverrideUrl");function rAc(t,e,r,...n){let o=tAc(t,r)??(e.endpoints?e.endpoints[r]:void 0)??gUi(t)[r];return(0,eAc.joinPath)(o,...n)}a(rAc,"getEndpointUrl");function nAc(t){return t.get(J0c.IAuthenticationService).copilotToken?.endpoints??gUi(t)}a(nAc,"getLastKnownEndpoints")});var YMr=I(l3e=>{"use strict";p();Object.defineProperty(l3e,"__esModule",{value:!0});l3e.Response=void 0;l3e.isAbortError=oAc;var iAc=Oy();Object.defineProperty(l3e,"Response",{enumerable:!0,get:a(function(){return iAc.Response},"get")});var zMr=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function oAc(t){return!t||typeof t!="object"?!1:t instanceof zMr||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(oAc,"isAbortError")});var C_e=I(jg=>{"use strict";p();var sAc=jg&&jg.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aAc=jg&&jg.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},cAc=jg&&jg.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sAc(e,t,r)},KMr=jg&&jg.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jg,"__esModule",{value:!0});jg.Fetcher=jg.CompletionsFetcher=jg.ICompletionsFetcherService=void 0;jg.isInterruptedNetworkError=fAc;cAc(YMr(),jg);var AUi=Hl(),lAc=Oy(),uAc=Rh(),dAc=an();jg.ICompletionsFetcherService=(0,dAc.createServiceIdentifier)("ICompletionsFetcherService");var JMr=class{static{a(this,"CompletionsFetcher")}constructor(e,r,n){this.configurationService=e,this.fetcherService=r,this.experimentationService=n}getImplementation(){return this}fetch(e,r){let n=this.configurationService.getExperimentBasedConfig(AUi.ConfigKey.CompletionsFetcher,this.experimentationService)||void 0,o=n?{...r,useFetcher:n}:r;return this.fetcherService.fetch(e,{...o,callSite:o.callSite??"completions-core"})}disconnectAll(){return this.fetcherService.disconnectAll()}};jg.CompletionsFetcher=JMr;jg.CompletionsFetcher=JMr=aAc([KMr(0,AUi.IConfigurationService),KMr(1,lAc.IFetcherService),KMr(2,uAc.IExperimentationService)],JMr);var ZMr=class{static{a(this,"Fetcher")}getImplementation(){return this}};jg.Fetcher=ZMr;function fAc(t){return t instanceof Error?t.message==="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code==="ECONNRESET"||t.code==="ETIMEDOUT"||t.code==="ERR_HTTP2_INVALID_SESSION":!1:!1}a(fAc,"isInterruptedNetworkError")});var yUi=I(b_e=>{"use strict";p();Object.defineProperty(b_e,"__esModule",{value:!0});b_e.FeatureName=b_e.OutputPaneShowCommand=void 0;b_e.OutputPaneShowCommand="codereferencing.showOutputPane2";b_e.FeatureName="code-referencing"});var u3e=I(QCt=>{"use strict";p();Object.defineProperty(QCt,"__esModule",{value:!0});QCt.codeReferenceLogger=void 0;var pAc=Gl(),hAc=yUi();QCt.codeReferenceLogger=new pAc.Logger(hAc.FeatureName)});var vUi=I(HCt=>{"use strict";p();Object.defineProperty(HCt,"__esModule",{value:!0});HCt.ConnectionState=void 0;var mAc=Ks(),gAc=Gl(),AAc=UCt(),yAc=C_e(),d3e=u3e(),_Ac=3e3,XMr=2,_Ui=256,EUi=Math.log(_Ui)/Math.log(XMr)/XMr,RN={connection:"disabled",maxAttempts:EUi,retryAttempts:0,initialWait:!1},qCt,jCt=[];function EAc(){if(qCt)return qCt;function t(E){return jCt.push(E),()=>{let v=jCt.indexOf(E);v!==-1&&jCt.splice(v,1)}}a(t,"subscribe");function e(){for(let E of jCt)E()}a(e,"afterUpdateConnection");function r(E){RN.connection!==E&&(RN.connection=E,e())}a(r,"updateConnection");function n(){return RN.connection==="connected"}a(n,"isConnected");function o(){return RN.connection==="disconnected"}a(o,"isDisconnected");function s(){return RN.connection==="retry"}a(s,"isRetrying");function c(){return RN.connection==="disabled"}a(c,"isDisabled");function l(){r("connected"),h(!1)}a(l,"setConnected");function u(){r("disconnected")}a(u,"setDisconnected");function d(){r("retry")}a(d,"setRetrying");function f(){r("disabled")}a(f,"setDisabled");function h(E){RN.initialWait!==E&&(RN.initialWait=E)}a(h,"setInitialWait");function m(E,v=_Ac){s()||(d(),h(!0),A(E,v))}a(m,"enableRetry");function g(){return RN.initialWait}a(g,"isInitialWait");async function A(E,v){let S=E.get(gAc.ICompletionsLogTargetService),T=E.get(yAc.ICompletionsFetcherService),w=E.get(mAc.IInstantiationService);d3e.codeReferenceLogger.info(S,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>_Ui){d3e.codeReferenceLogger.info(S,"Max retry time reached, disabling."),f();return}let k=a(async()=>{RN.retryAttempts=Math.min(RN.retryAttempts+1,EUi);try{d3e.codeReferenceLogger.info(S,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(AAc.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{d3e.codeReferenceLogger.info(S,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{k()},x*1e3)}a(R,"succeedOrRetry"),d3e.codeReferenceLogger.info(S,"Attempting to reconnect."),R(XMr)}a(A,"attemptToPing");let y=a(E=>new Promise(v=>setTimeout(v,E)),"timeout");function _(E){return{dispose:t(E)}}return a(_,"listen"),qCt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:_,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},qCt}a(EAc,"registerConnectionState");HCt.ConnectionState=EAc()});var bUi=I(fA=>{"use strict";p();Object.defineProperty(fA,"__esModule",{value:!0});fA.ErrorMessages=fA.ErrorReasons=void 0;fA.getErrorType=CUi;fA.createErrorResponse=vAc;fA.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};fA.ErrorMessages={[fA.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[fA.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[fA.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function CUi(t){return t===401?fA.ErrorReasons.Unauthorized:t===400?fA.ErrorReasons.BadArguments:t===404?fA.ErrorReasons.NotFound:t===429?fA.ErrorReasons.RateLimit:t>=500&&t<600?fA.ErrorReasons.InternalError:t>=600?fA.ErrorReasons.ConnectionError:fA.ErrorReasons.Unknown}a(CUi,"getErrorType");function vAc(t,e,r={}){return{kind:"failure",reason:CUi(Number(t)),code:Number(t),msg:e,meta:r}}a(vAc,"createErrorResponse")});var iOr=I($L=>{"use strict";p();Object.defineProperty($L,"__esModule",{value:!0});$L.NoopTelemetryReporter=$L.snippyTelemetry=$L.matchNotificationTelemetry=$L.copilotOutputLogTelemetry=void 0;var CAc=Gl(),uE=nA(),bAc=u3e(),SAc=/^[1-6][0-9][0-9]$/,TAc=/([A-Z][a-z]+)/,IAc="code_referencing",S_e=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[IAc,this.baseKey,...e].join(".")}},eOr=class extends S_e{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=uE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(uE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=uE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(uE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=uE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(uE.telemetry,n,r)}};$L.copilotOutputLogTelemetry=new eOr;var tOr=class extends S_e{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=uE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(uE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=uE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(uE.telemetry,o,n)}};$L.matchNotificationTelemetry=new tOr;var rOr=class extends S_e{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=uE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(uE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=uE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(uE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(SAc)){e.invokeFunction(l=>bAc.codeReferenceLogger.debug(l.get(CAc.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(TAc).filter(l=>!!l).join("_").toLowerCase(),c=uE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(uE.telemetryError,this.buildKey(s,r),c)}};$L.snippyTelemetry=new rOr;var nOr=class extends S_e{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};$L.NoopTelemetryReporter=nOr});var SUi=I(oOr=>{"use strict";p();Object.defineProperty(oOr,"__esModule",{value:!0});oOr.call=OAc;var xAc=Ks(),wAc=uye(),RAc=eE(),kAc=Gl(),PAc=UCt(),DAc=C_e(),T_e=vUi(),Dh=bUi(),NAc=u3e(),MAc=iOr();async function OAc(t,e,r,n){let o,s=t.get(kAc.ICompletionsLogTargetService),c=t.get(xAc.IInstantiationService),l=t.get(wAc.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return T_e.ConnectionState.setDisconnected(),(0,Dh.createErrorResponse)(401,Dh.ErrorMessages[Dh.ErrorReasons.Unauthorized])}if(NAc.codeReferenceLogger.info(s,`Calling ${e}`),T_e.ConnectionState.isRetrying())return(0,Dh.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(T_e.ConnectionState.isDisconnected())return(0,Dh.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(E=>E.get(DAc.ICompletionsFetcherService).fetch((0,PAc.getEndpointUrl)(E,o,"origin-tracker",e),{callSite:"snippy-network",method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...(0,RAc.editorVersionHeaders)(E)},signal:n}))}catch{return c.invokeFunction(T_e.ConnectionState.enableRetry),(0,Dh.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(E){let v=E.message;throw MAc.snippyTelemetry.handleUnexpectedError({instantiationService:c,origin:"snippyNetwork",reason:v}),E}if(u.ok)return{kind:"success",...d};let f={...d,code:Number(u.status)},{code:h,msg:m,meta:g}=f,A=Number(h),y=(0,Dh.getErrorType)(A),_=m||"unknown error";switch(y){case Dh.ErrorReasons.Unauthorized:return(0,Dh.createErrorResponse)(h,Dh.ErrorMessages[Dh.ErrorReasons.Unauthorized],g);case Dh.ErrorReasons.BadArguments:return(0,Dh.createErrorResponse)(h,_,g);case Dh.ErrorReasons.RateLimit:return c.invokeFunction(E=>T_e.ConnectionState.enableRetry(E,60*1e3)),(0,Dh.createErrorResponse)(h,Dh.ErrorMessages.RateLimitError,g);case Dh.ErrorReasons.InternalError:return c.invokeFunction(E=>T_e.ConnectionState.enableRetry(E)),(0,Dh.createErrorResponse)(h,Dh.ErrorMessages[Dh.ErrorReasons.InternalError],g);default:return(0,Dh.createErrorResponse)(h,_,g)}}a(OAc,"call")});var sOr=I(FS=>{"use strict";p();Object.defineProperty(FS,"__esModule",{value:!0});FS.FileMatchResponse=FS.FileMatchRequest=FS.MatchResponse=FS.MatchRequest=FS.MatchError=void 0;var xa=pEt();FS.MatchError=xa.Type.Object({kind:xa.Type.Literal("failure"),reason:xa.Type.String(),code:xa.Type.Number(),msg:xa.Type.String(),meta:xa.Type.Optional(xa.Type.Any())});var LAc=xa.Type.Object({matched_source:xa.Type.String(),occurrences:xa.Type.String(),capped:xa.Type.Boolean(),cursor:xa.Type.String(),github_url:xa.Type.String()});FS.MatchRequest=xa.Type.Object({source:xa.Type.String()});var BAc=xa.Type.Object({snippets:xa.Type.Array(LAc)});FS.MatchResponse=xa.Type.Union([BAc,FS.MatchError]);FS.FileMatchRequest=xa.Type.Object({cursor:xa.Type.String()});var FAc=xa.Type.Object({commit_id:xa.Type.String(),license:xa.Type.String(),nwo:xa.Type.String(),path:xa.Type.String(),url:xa.Type.String()}),UAc=xa.Type.Object({has_next_page:xa.Type.Boolean(),cursor:xa.Type.String()}),QAc=xa.Type.Object({count:xa.Type.Record(xa.Type.String(),xa.Type.String())}),qAc=xa.Type.Object({file_matches:xa.Type.Array(FAc),page_info:UAc,license_stats:QAc});FS.FileMatchResponse=xa.Type.Union([qAc,FS.MatchError])});var wUi=I(VL=>{"use strict";p();var jAc=VL&&VL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HAc=VL&&VL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),TUi=VL&&VL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(xU,"__esModule",{value:!0});xU.MinTokenLength=void 0;xU.lexemeLength=RUi;xU.offsetLastLexemes=WAc;xU.hasMinLexemeLength=zAc;var f3e=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");xU.MinTokenLength=65;function RUi(t){let e=0,r;f3e.lastIndex=0;do if(r=f3e.exec(t),r&&(e+=1),e>=xU.MinTokenLength)break;while(r);return e}a(RUi,"lexemeLength");function VAc(t,e){let r=0,n;f3e.lastIndex=0;do if(n=f3e.exec(t),n&&(r+=1,r>=e))return f3e.lastIndex;while(n);return t.length}a(VAc,"offsetFirstLexemes");function WAc(t,e){let r=t.split("").reverse().join(""),n=VAc(r,e);return r.length-n}a(WAc,"offsetLastLexemes");function zAc(t){return RUi(t)>=xU.MinTokenLength}a(zAc,"hasMinLexemeLength")});var LUi=I(wU=>{"use strict";p();var YAc=wU&&wU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KAc=wU&&wU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),MUi=wU&&wU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oDUi(_,()=>PUi.Match(_,f)));if(!h||NUi(h)||!h.snippets.length){aOr.codeReferenceLogger.info(s,"No match found");return}aOr.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async _=>{let E=await o.invokeFunction(T=>DUi(T,()=>PUi.FilesForMatch(T,{cursor:_.cursor})));if(!E||NUi(E))return;let v=E.file_matches,S=E.license_stats;return{match:_,files:v,licenseStats:S}}),y=(await Promise.all(g)).filter(_=>_!==void 0);if(y.length)for(let _ of y){let E=new Set(Object.keys(_.licenseStats?.count??{}));E.has("NOASSERTION")&&(E.delete("NOASSERTION"),E.add("unknown"));let v=Array.from(E).sort(),S=n,T=n+_.match.matched_source.length,w=u.positionAt(S),R=u.positionAt(T);await l.handleIPCodeCitation({inDocumentUri:e,offsetStart:S,offsetEnd:T,version:u.version,location:{start:w,end:R},matchingText:f,details:v.map(x=>({license:x,url:_.match.github_url}))})}}a(iyc,"fetchCitations")});var jUi=I(RV=>{"use strict";p();Object.defineProperty(RV,"__esModule",{value:!0});RV.editDistance=FUi;RV.emptyLexDictionary=UUi;RV.reverseLexDictionary=QUi;RV.lexGeneratorWords=qUi;RV.lexicalAnalyzer=cOr;RV.lexEditDistance=oyc;function FUi(t,e,r=(n,o)=>n===o?0:1){if(e.length===0||t.length===0)return{distance:e.length,startOffset:0,endOffset:0};let n=new Array(e.length+1).fill(0),o=new Array(e.length+1).fill(0),s=new Array(t.length+1).fill(0),c=new Array(t.length+1).fill(0),l=e[0];for(let d=0;d0?d-1:0;for(let d=1;d0&&(yield e),e=o,n=s)}e.length>0&&(yield e)}a(qUi,"lexGeneratorWords");function cOr(t,e,r,n){let o=[],s=0;for(let c of r(t))n(c)&&(e.has(c)||e.set(c,e.size),o.push([e.get(c),s])),s+=c.length;return[o,e]}a(cOr,"lexicalAnalyzer");function BUi(t){return t!==" "}a(BUi,"notSingleSpace");function oyc(t,e,r=qUi){let[n,o]=cOr(t,UUi(),r,BUi),[s,c]=cOr(e,o,r,BUi);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=QUi(c),u=s.length,d=l[s[0][0]],f=l[s[u-1][0]];function h(y,_,E,v){if(v===0||v===u-1){let S=l[n[E][0]];return v===0&&S.endsWith(d)||v===u-1&&S.startsWith(f)?0:1}else return y===_?0:1}a(h,"compare");let m=FUi(n.map(y=>y[0]),s.map(y=>y[0]),h),g=n[m.startOffset][1],A=m.endOffset0&&t[A-1]===" "&&--A,{lexDistance:m.distance,startOffset:g,endOffset:A,haystackLexLength:n.length,needleLexLength:s.length}}a(oyc,"lexEditDistance")});var lOr=I(_ie=>{"use strict";p();Object.defineProperty(_ie,"__esModule",{value:!0});_ie.PartialAcceptTriggerKind=void 0;_ie.computeCompCharLen=syc;_ie.countLines=ayc;_ie.computeCompletionText=cyc;var HUi;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})(HUi||(_ie.PartialAcceptTriggerKind=HUi={}));function syc(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(syc,"computeCompCharLen");function ayc(t){return t.length===0?0:t.split(` -`).length}a(ayc,"countLines");function cyc(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(cyc,"computeCompletionText")});var XUi=I(zCt=>{"use strict";p();Object.defineProperty(zCt,"__esModule",{value:!0});zCt.postRejectionTasks=Eyc;zCt.postInsertionTasks=vyc;var WCt=Ks(),VUi=Are(),lyc=uye(),VCt=sBi(),uyc=Kyt(),dyc=Xkr(),WUi=Ckr(),zUi=Zye(),x_e=Gl(),GUi=JEt(),fyc=p_e(),pyc=LUi(),$Ui=jUi(),hyc=lOr(),kV=nA(),myc=RS(),YUi=cLe(),gyc=Kne(),PV=new x_e.Logger("postInsertion"),KUi=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}],JUi=50,Ayc=1500,yyc=.5,_yc=500,uOr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function ZUi(t,e,r,n,o){let s=t.get(WCt.IInstantiationService),c=t.get(x_e.ICompletionsLogTargetService),l=await t.get(WUi.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return PV.info(c,`Could not get document for ${e}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1},capturedCode:"",terminationOffset:0};let u=l.document,d=u.getText(),f=d.substring(0,n),h=u.positionAt(n),m=await s.invokeFunction(fyc.extractPrompt,r.properties.headerRequestId,(0,dyc.createCompletionState)(u,h),r),g=m.type==="prompt"?m.prompt:{prefix:f,suffix:"",isFimEnabled:!1};if(g.isFimEnabled&&o!==void 0){let A=d.substring(n,o);return g.suffix=d.substring(o),{prompt:g,capturedCode:A,terminationOffset:0}}else{let A=d.substring(n),y=(0,GUi.contextIndentationFromText)(f,n,u.detectedLanguageId),E=(0,GUi.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(E?E*2:_yc)),S=d.substring(n,v);return{prompt:g,capturedCode:S,terminationOffset:E??-1}}}a(ZUi,"captureCode");function Eyc(t,e,r,n,o){let s=t.get(x_e.ICompletionsLogTargetService),c=t.get(WCt.IInstantiationService),l=t.get(VUi.ICompletionsTelemetryService),u=t.get(YUi.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{PV.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(zUi.telemetryRejected,e,g)});let d=c.createInstance(VCt.ChangeTracker,n,r-1),f=c.createInstance(VCt.ChangeTracker,n,r),h=a(async m=>{PV.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:_}=await c.invokeFunction(ZUi,n,g,d.offset+1,f.offset),E={hypotheticalPromptJson:JSON.stringify({prefix:A.prefix,context:A.context}),hypotheticalPromptSuffixJson:JSON.stringify(A.suffix)},v=g.extendedBy({...E,capturedCodeJson:JSON.stringify(y)},{timeout:m.seconds,insertionOffset:r,trackedOffset:d.offset,terminationOffsetInCapturedCode:_});PV.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(kV.telemetry,e+".capturedAfterRejected",v,kV.TelemetryStore.Enhanced)},"checkInCode");KUi.filter(m=>m.captureRejection).map(m=>d.push((0,kV.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a(Eyc,"postRejectionTasks");function vyc(t,e,r,n,o,s,c,l){let u=t.get(x_e.ICompletionsLogTargetService),d=t.get(WCt.IInstantiationService),f=t.get(YUi.ICompletionsPromiseQueueService),h=t.get(VUi.ICompletionsTelemetryService),m=t.get(gyc.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});PV.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(zUi.telemetryAccepted,e,g);let A=r;r=(0,hyc.computeCompletionText)(r,c);let y=r.trim(),_=d.createInstance(VCt.ChangeTracker,o,n),E=d.createInstance(VCt.ChangeTracker,o,n+r.length),v=a(async S=>{await d.invokeFunction(Tyc,e,y,n,o,S,g,_,E)},"stillInCodeCheck");if(uOr.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let S=v({seconds:0,captureCode:uOr.captureCode,captureRejection:uOr.captureRejection});f.register(S)}else KUi.map(S=>_.push((0,kV.telemetryCatch)(h,f,()=>v(S),"postInsertionTasks"),S.seconds*1e3));d.invokeFunction(S=>(0,kV.telemetryCatch)(h,f,Cyc,"post insertion citation check")(S,o,A,r,n,l))}a(vyc,"postInsertionTasks");async function Cyc(t,e,r,n,o,s){let c=t.get(x_e.ICompletionsLogTargetService),l=t.get(myc.ICompletionsTextDocumentManagerService),u=t.get(lyc.ICompletionsCopilotTokenManager),d=t.get(uyc.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,pyc.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=dOr(f.getText(),n,JUi,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=byc(r.length,n.length,h.start_offset);if(m===void 0){PV.info(c,`Full completion for ${e} contains a reference matching public code, but the partially inserted text did not include the match.`);continue}let g=o+m,A=f?.positionAt(g),y=o+Syc(r.length,n.length,h.stop_offset),_=f?.positionAt(y),E=A&&_?f?.getText({start:A,end:_}):"";await d.handleIPCodeCitation({inDocumentUri:e,offsetStart:g,offsetEnd:y,version:f?.version,location:A&&_?{start:A,end:_}:void 0,matchingText:E,details:h.details.citations})}}a(Cyc,"citationCheck");function byc(t,e,r){if(!(ee))return r}a(byc,"computeCitationStart");function Syc(t,e,r){return e{"use strict";p();Object.defineProperty(Ly,"__esModule",{value:!0});Ly.LastGhostText=Ly.ICompletionsLastGhostText=void 0;Ly.rejectLastShown=r9i;Ly.setLastShown=Ryc;Ly.handleGhostTextShown=kyc;Ly.handleGhostTextPostInsert=Dyc;Ly.handlePartialGhostTextPostInsert=Nyc;var Iyc=an(),e9i=Gl(),pOr=XUi(),YCt=lOr(),t9i=iV(),hOr=Zye(),xyc=new e9i.Logger("ghostText");Ly.ICompletionsLastGhostText=(0,Iyc.createServiceIdentifier)("ICompletionsLastGhostText");var fOr=class{static{a(this,"LastGhostText")}constructor(){this.#r=[],this.linesAccepted=0}#e;#t;#r;get position(){return this.#e}get shownCompletions(){return this.#r||[]}get uri(){return this.#t}resetState(){this.#t=void 0,this.#e=void 0,this.#r=[],this.resetPartialAcceptanceState()}setState({uri:e},r){this.#t=e,this.#e=r,this.#r=[]}resetPartialAcceptanceState(){this.partiallyAcceptedLength=0,this.totalLength=void 0,this.linesLeft=void 0,this.linesAccepted=0}};Ly.LastGhostText=fOr;function wyc(t){let e=[];return t.shownCompletions.forEach(r=>{if(r.displayText&&r.telemetry){let n,o;t.partiallyAcceptedLength?(n=r.displayText.substring(t.partiallyAcceptedLength-1),o=r.telemetry.extendedBy({compType:"partial"},{compCharLen:n.length})):(n=r.displayText,o=r.telemetry);let s={completionText:n,completionTelemetryData:o,offset:r.offset};e.push(s)}}),e}a(wyc,"computeRejectedCompletions");function r9i(t,e){let r=t.get(Ly.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=wyc(r);n.length>0&&(0,pOr.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(r9i,"rejectLastShown");function Ryc(t,e,r,n){let o=t.get(Ly.ICompletionsLastGhostText);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==t9i.ResultType.TypingAsSuggested&&r9i(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(Ryc,"setLastShown");function kyc(t,e){let r=t.get(e9i.ICompletionsLogTargetService),n=t.get(Ly.ICompletionsLastGhostText);if(n.index=e.index,!n.shownCompletions.find(o=>o.index===e.index)&&(e.uri===n.uri&&n.position?.line===e.position.line&&n.position?.character===e.position.character&&n.shownCompletions.push(e),e.displayText)){let o=e.resultType!==t9i.ResultType.Network;xyc.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,hOr.telemetryShown)(t,e)}}a(kyc,"handleGhostTextShown");function Pyc(t,e,r){let n=t.get(Ly.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,YCt.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,YCt.countLines)(e.displayText));let o=(0,YCt.countLines)(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(Pyc,"handleLineAcceptance");function Dyc(t,e){let r=t.get(Ly.ICompletionsLastGhostText),n;return r.partiallyAcceptedLength?n={compType:"full",acceptedLength:(r.partiallyAcceptedLength||0)+e.displayText.length,acceptedLines:r.linesAccepted+(r.linesLeft??0)}:n={compType:"full",acceptedLength:e.displayText.length,acceptedLines:(0,YCt.countLines)(e.displayText)},r.resetState(),(0,pOr.postInsertionTasks)(t,hOr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(Dyc,"handleGhostTextPostInsert");function Nyc(t,e,r){let n=t.get(Ly.ICompletionsLastGhostText);Pyc(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,pOr.postInsertionTasks)(t,hOr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Nyc,"handlePartialGhostTextPostInsert")});var n9i=I(gOr=>{"use strict";p();Object.defineProperty(gOr,"__esModule",{value:!0});gOr.normalizeIndentCharacter=Myc;function Myc(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` +`):e;throw r.message=`${r.message}. Response: ${o}`,r}}a(z0c,"jsonVerboseError");function mUi(t){return t&&t.name==="AbortError"}a(mUi,"isAbortError");function Y0c(t){try{return new URL(t).hostname}catch{return"unknown"}}a(Y0c,"safeGetHostname")});var gUi=I(E_e=>{"use strict";p();Object.defineProperty(E_e,"__esModule",{value:!0});E_e.INTEGRATION_ID=E_e.LICENSE_AGREEMENT=void 0;E_e.LICENSE_AGREEMENT=void 0;E_e.INTEGRATION_ID="code-oss"});var lE=I(v_e=>{"use strict";p();Object.defineProperty(v_e,"__esModule",{value:!0});v_e.ICAPIClientService=v_e.BaseCAPIClientService=void 0;var c3e=(_ie(),Wa(yie)),K0c=an(),J0c=Oy(),Z0c=gUi(),zMr=class extends c3e.CAPIClient{static{a(this,"BaseCAPIClientService")}constructor(e,r,n,o){super({machineId:o.machineId,deviceId:o.devDeviceId,sessionId:o.sessionId,vscodeVersion:o.vscodeVersion,buildType:o.getBuildType(),name:o.getName(),version:o.getVersion()},Z0c.LICENSE_AGREEMENT,n,e,r)}makeRequest(e,r){return this.abExpContext&&(e.headers||(e.headers={}),e.headers["VScode-ABExpContext"]=this.abExpContext,e.headers["X-Copilot-Client-Exp-Assignment-Context"]=this.abExpContext),(r.type===c3e.RequestType.Telemetry||r.type===c3e.RequestType.ChatCompletions||r.type===c3e.RequestType.ChatMessages||r.type===c3e.RequestType.ChatResponses)&&(e.callSite=J0c.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};v_e.BaseCAPIClientService=zMr;v_e.ICAPIClientService=(0,K0c.createServiceIdentifier)("ICAPIClientService")});var QCt=I(UCt=>{"use strict";p();Object.defineProperty(UCt,"__esModule",{value:!0});UCt.getEndpointUrl=iAc;UCt.getLastKnownEndpoints=oAc;var X0c=rE(),eAc=lE(),RV=eE(),tAc=Jne(),rAc=nV();function yUi(t){let e=t.get(eAc.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a(yUi,"getDefaultEndpoints");function AUi(t,e,r){if(r!==void 0&&t.get(tAc.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,RV.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,RV.getConfig)(t,n);if(o)return o}}a(AUi,"urlConfigOverride");function nAc(t,e){switch(e){case"proxy":return AUi(t,[RV.ConfigKey.DebugOverrideProxyUrl,RV.ConfigKey.DebugOverrideProxyUrlLegacy],[RV.ConfigKey.DebugTestOverrideProxyUrl,RV.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!RV.BuildInfo.isProduction())return AUi(t,[RV.ConfigKey.DebugSnippyOverrideUrl])}}a(nAc,"getEndpointOverrideUrl");function iAc(t,e,r,...n){let o=nAc(t,r)??(e.endpoints?e.endpoints[r]:void 0)??yUi(t)[r];return(0,rAc.joinPath)(o,...n)}a(iAc,"getEndpointUrl");function oAc(t){return t.get(X0c.IAuthenticationService).copilotToken?.endpoints??yUi(t)}a(oAc,"getLastKnownEndpoints")});var KMr=I(l3e=>{"use strict";p();Object.defineProperty(l3e,"__esModule",{value:!0});l3e.Response=void 0;l3e.isAbortError=aAc;var sAc=Oy();Object.defineProperty(l3e,"Response",{enumerable:!0,get:a(function(){return sAc.Response},"get")});var YMr=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function aAc(t){return!t||typeof t!="object"?!1:t instanceof YMr||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(aAc,"isAbortError")});var C_e=I(Hg=>{"use strict";p();var cAc=Hg&&Hg.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lAc=Hg&&Hg.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},uAc=Hg&&Hg.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cAc(e,t,r)},JMr=Hg&&Hg.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Hg,"__esModule",{value:!0});Hg.Fetcher=Hg.CompletionsFetcher=Hg.ICompletionsFetcherService=void 0;Hg.isInterruptedNetworkError=hAc;uAc(KMr(),Hg);var _Ui=Hl(),dAc=Oy(),fAc=Rh(),pAc=an();Hg.ICompletionsFetcherService=(0,pAc.createServiceIdentifier)("ICompletionsFetcherService");var ZMr=class{static{a(this,"CompletionsFetcher")}constructor(e,r,n){this.configurationService=e,this.fetcherService=r,this.experimentationService=n}getImplementation(){return this}fetch(e,r){let n=this.configurationService.getExperimentBasedConfig(_Ui.ConfigKey.CompletionsFetcher,this.experimentationService)||void 0,o=n?{...r,useFetcher:n}:r;return this.fetcherService.fetch(e,{...o,callSite:o.callSite??"completions-core"})}disconnectAll(){return this.fetcherService.disconnectAll()}};Hg.CompletionsFetcher=ZMr;Hg.CompletionsFetcher=ZMr=lAc([JMr(0,_Ui.IConfigurationService),JMr(1,dAc.IFetcherService),JMr(2,fAc.IExperimentationService)],ZMr);var XMr=class{static{a(this,"Fetcher")}getImplementation(){return this}};Hg.Fetcher=XMr;function hAc(t){return t instanceof Error?t.message==="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code==="ECONNRESET"||t.code==="ETIMEDOUT"||t.code==="ERR_HTTP2_INVALID_SESSION":!1:!1}a(hAc,"isInterruptedNetworkError")});var EUi=I(b_e=>{"use strict";p();Object.defineProperty(b_e,"__esModule",{value:!0});b_e.FeatureName=b_e.OutputPaneShowCommand=void 0;b_e.OutputPaneShowCommand="codereferencing.showOutputPane2";b_e.FeatureName="code-referencing"});var u3e=I(qCt=>{"use strict";p();Object.defineProperty(qCt,"__esModule",{value:!0});qCt.codeReferenceLogger=void 0;var mAc=Gl(),gAc=EUi();qCt.codeReferenceLogger=new mAc.Logger(gAc.FeatureName)});var bUi=I(GCt=>{"use strict";p();Object.defineProperty(GCt,"__esModule",{value:!0});GCt.ConnectionState=void 0;var AAc=Ks(),yAc=Gl(),_Ac=QCt(),EAc=C_e(),d3e=u3e(),vAc=3e3,eOr=2,vUi=256,CUi=Math.log(vUi)/Math.log(eOr)/eOr,RN={connection:"disabled",maxAttempts:CUi,retryAttempts:0,initialWait:!1},jCt,HCt=[];function CAc(){if(jCt)return jCt;function t(E){return HCt.push(E),()=>{let v=HCt.indexOf(E);v!==-1&&HCt.splice(v,1)}}a(t,"subscribe");function e(){for(let E of HCt)E()}a(e,"afterUpdateConnection");function r(E){RN.connection!==E&&(RN.connection=E,e())}a(r,"updateConnection");function n(){return RN.connection==="connected"}a(n,"isConnected");function o(){return RN.connection==="disconnected"}a(o,"isDisconnected");function s(){return RN.connection==="retry"}a(s,"isRetrying");function c(){return RN.connection==="disabled"}a(c,"isDisabled");function l(){r("connected"),h(!1)}a(l,"setConnected");function u(){r("disconnected")}a(u,"setDisconnected");function d(){r("retry")}a(d,"setRetrying");function f(){r("disabled")}a(f,"setDisabled");function h(E){RN.initialWait!==E&&(RN.initialWait=E)}a(h,"setInitialWait");function m(E,v=vAc){s()||(d(),h(!0),A(E,v))}a(m,"enableRetry");function g(){return RN.initialWait}a(g,"isInitialWait");async function A(E,v){let S=E.get(yAc.ICompletionsLogTargetService),T=E.get(EAc.ICompletionsFetcherService),w=E.get(AAc.IInstantiationService);d3e.codeReferenceLogger.info(S,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>vUi){d3e.codeReferenceLogger.info(S,"Max retry time reached, disabling."),f();return}let k=a(async()=>{RN.retryAttempts=Math.min(RN.retryAttempts+1,CUi);try{d3e.codeReferenceLogger.info(S,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(_Ac.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{d3e.codeReferenceLogger.info(S,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{k()},x*1e3)}a(R,"succeedOrRetry"),d3e.codeReferenceLogger.info(S,"Attempting to reconnect."),R(eOr)}a(A,"attemptToPing");let y=a(E=>new Promise(v=>setTimeout(v,E)),"timeout");function _(E){return{dispose:t(E)}}return a(_,"listen"),jCt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:_,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},jCt}a(CAc,"registerConnectionState");GCt.ConnectionState=CAc()});var TUi=I(fA=>{"use strict";p();Object.defineProperty(fA,"__esModule",{value:!0});fA.ErrorMessages=fA.ErrorReasons=void 0;fA.getErrorType=SUi;fA.createErrorResponse=bAc;fA.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};fA.ErrorMessages={[fA.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[fA.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[fA.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function SUi(t){return t===401?fA.ErrorReasons.Unauthorized:t===400?fA.ErrorReasons.BadArguments:t===404?fA.ErrorReasons.NotFound:t===429?fA.ErrorReasons.RateLimit:t>=500&&t<600?fA.ErrorReasons.InternalError:t>=600?fA.ErrorReasons.ConnectionError:fA.ErrorReasons.Unknown}a(SUi,"getErrorType");function bAc(t,e,r={}){return{kind:"failure",reason:SUi(Number(t)),code:Number(t),msg:e,meta:r}}a(bAc,"createErrorResponse")});var oOr=I($L=>{"use strict";p();Object.defineProperty($L,"__esModule",{value:!0});$L.NoopTelemetryReporter=$L.snippyTelemetry=$L.matchNotificationTelemetry=$L.copilotOutputLogTelemetry=void 0;var SAc=Gl(),uE=nA(),TAc=u3e(),IAc=/^[1-6][0-9][0-9]$/,xAc=/([A-Z][a-z]+)/,wAc="code_referencing",S_e=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[wAc,this.baseKey,...e].join(".")}},tOr=class extends S_e{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=uE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(uE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=uE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(uE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=uE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(uE.telemetry,n,r)}};$L.copilotOutputLogTelemetry=new tOr;var rOr=class extends S_e{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=uE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(uE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=uE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(uE.telemetry,o,n)}};$L.matchNotificationTelemetry=new rOr;var nOr=class extends S_e{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=uE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(uE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=uE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(uE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(IAc)){e.invokeFunction(l=>TAc.codeReferenceLogger.debug(l.get(SAc.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(xAc).filter(l=>!!l).join("_").toLowerCase(),c=uE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(uE.telemetryError,this.buildKey(s,r),c)}};$L.snippyTelemetry=new nOr;var iOr=class extends S_e{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};$L.NoopTelemetryReporter=iOr});var IUi=I(sOr=>{"use strict";p();Object.defineProperty(sOr,"__esModule",{value:!0});sOr.call=BAc;var RAc=Ks(),kAc=uye(),PAc=eE(),DAc=Gl(),NAc=QCt(),MAc=C_e(),T_e=bUi(),Dh=TUi(),OAc=u3e(),LAc=oOr();async function BAc(t,e,r,n){let o,s=t.get(DAc.ICompletionsLogTargetService),c=t.get(RAc.IInstantiationService),l=t.get(kAc.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return T_e.ConnectionState.setDisconnected(),(0,Dh.createErrorResponse)(401,Dh.ErrorMessages[Dh.ErrorReasons.Unauthorized])}if(OAc.codeReferenceLogger.info(s,`Calling ${e}`),T_e.ConnectionState.isRetrying())return(0,Dh.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(T_e.ConnectionState.isDisconnected())return(0,Dh.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(E=>E.get(MAc.ICompletionsFetcherService).fetch((0,NAc.getEndpointUrl)(E,o,"origin-tracker",e),{callSite:"snippy-network",method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...(0,PAc.editorVersionHeaders)(E)},signal:n}))}catch{return c.invokeFunction(T_e.ConnectionState.enableRetry),(0,Dh.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(E){let v=E.message;throw LAc.snippyTelemetry.handleUnexpectedError({instantiationService:c,origin:"snippyNetwork",reason:v}),E}if(u.ok)return{kind:"success",...d};let f={...d,code:Number(u.status)},{code:h,msg:m,meta:g}=f,A=Number(h),y=(0,Dh.getErrorType)(A),_=m||"unknown error";switch(y){case Dh.ErrorReasons.Unauthorized:return(0,Dh.createErrorResponse)(h,Dh.ErrorMessages[Dh.ErrorReasons.Unauthorized],g);case Dh.ErrorReasons.BadArguments:return(0,Dh.createErrorResponse)(h,_,g);case Dh.ErrorReasons.RateLimit:return c.invokeFunction(E=>T_e.ConnectionState.enableRetry(E,60*1e3)),(0,Dh.createErrorResponse)(h,Dh.ErrorMessages.RateLimitError,g);case Dh.ErrorReasons.InternalError:return c.invokeFunction(E=>T_e.ConnectionState.enableRetry(E)),(0,Dh.createErrorResponse)(h,Dh.ErrorMessages[Dh.ErrorReasons.InternalError],g);default:return(0,Dh.createErrorResponse)(h,_,g)}}a(BAc,"call")});var aOr=I(FS=>{"use strict";p();Object.defineProperty(FS,"__esModule",{value:!0});FS.FileMatchResponse=FS.FileMatchRequest=FS.MatchResponse=FS.MatchRequest=FS.MatchError=void 0;var xa=hEt();FS.MatchError=xa.Type.Object({kind:xa.Type.Literal("failure"),reason:xa.Type.String(),code:xa.Type.Number(),msg:xa.Type.String(),meta:xa.Type.Optional(xa.Type.Any())});var FAc=xa.Type.Object({matched_source:xa.Type.String(),occurrences:xa.Type.String(),capped:xa.Type.Boolean(),cursor:xa.Type.String(),github_url:xa.Type.String()});FS.MatchRequest=xa.Type.Object({source:xa.Type.String()});var UAc=xa.Type.Object({snippets:xa.Type.Array(FAc)});FS.MatchResponse=xa.Type.Union([UAc,FS.MatchError]);FS.FileMatchRequest=xa.Type.Object({cursor:xa.Type.String()});var QAc=xa.Type.Object({commit_id:xa.Type.String(),license:xa.Type.String(),nwo:xa.Type.String(),path:xa.Type.String(),url:xa.Type.String()}),qAc=xa.Type.Object({has_next_page:xa.Type.Boolean(),cursor:xa.Type.String()}),jAc=xa.Type.Object({count:xa.Type.Record(xa.Type.String(),xa.Type.String())}),HAc=xa.Type.Object({file_matches:xa.Type.Array(QAc),page_info:qAc,license_stats:jAc});FS.FileMatchResponse=xa.Type.Union([HAc,FS.MatchError])});var kUi=I(VL=>{"use strict";p();var GAc=VL&&VL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Ac=VL&&VL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xUi=VL&&VL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(xU,"__esModule",{value:!0});xU.MinTokenLength=void 0;xU.lexemeLength=PUi;xU.offsetLastLexemes=YAc;xU.hasMinLexemeLength=KAc;var f3e=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");xU.MinTokenLength=65;function PUi(t){let e=0,r;f3e.lastIndex=0;do if(r=f3e.exec(t),r&&(e+=1),e>=xU.MinTokenLength)break;while(r);return e}a(PUi,"lexemeLength");function zAc(t,e){let r=0,n;f3e.lastIndex=0;do if(n=f3e.exec(t),n&&(r+=1,r>=e))return f3e.lastIndex;while(n);return t.length}a(zAc,"offsetFirstLexemes");function YAc(t,e){let r=t.split("").reverse().join(""),n=zAc(r,e);return r.length-n}a(YAc,"offsetLastLexemes");function KAc(t){return PUi(t)>=xU.MinTokenLength}a(KAc,"hasMinLexemeLength")});var FUi=I(wU=>{"use strict";p();var JAc=wU&&wU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZAc=wU&&wU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),LUi=wU&&wU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oMUi(_,()=>NUi.Match(_,f)));if(!h||OUi(h)||!h.snippets.length){cOr.codeReferenceLogger.info(s,"No match found");return}cOr.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async _=>{let E=await o.invokeFunction(T=>MUi(T,()=>NUi.FilesForMatch(T,{cursor:_.cursor})));if(!E||OUi(E))return;let v=E.file_matches,S=E.license_stats;return{match:_,files:v,licenseStats:S}}),y=(await Promise.all(g)).filter(_=>_!==void 0);if(y.length)for(let _ of y){let E=new Set(Object.keys(_.licenseStats?.count??{}));E.has("NOASSERTION")&&(E.delete("NOASSERTION"),E.add("unknown"));let v=Array.from(E).sort(),S=n,T=n+_.match.matched_source.length,w=u.positionAt(S),R=u.positionAt(T);await l.handleIPCodeCitation({inDocumentUri:e,offsetStart:S,offsetEnd:T,version:u.version,location:{start:w,end:R},matchingText:f,details:v.map(x=>({license:x,url:_.match.github_url}))})}}a(syc,"fetchCitations")});var GUi=I(kV=>{"use strict";p();Object.defineProperty(kV,"__esModule",{value:!0});kV.editDistance=QUi;kV.emptyLexDictionary=qUi;kV.reverseLexDictionary=jUi;kV.lexGeneratorWords=HUi;kV.lexicalAnalyzer=lOr;kV.lexEditDistance=ayc;function QUi(t,e,r=(n,o)=>n===o?0:1){if(e.length===0||t.length===0)return{distance:e.length,startOffset:0,endOffset:0};let n=new Array(e.length+1).fill(0),o=new Array(e.length+1).fill(0),s=new Array(t.length+1).fill(0),c=new Array(t.length+1).fill(0),l=e[0];for(let d=0;d0?d-1:0;for(let d=1;d0&&(yield e),e=o,n=s)}e.length>0&&(yield e)}a(HUi,"lexGeneratorWords");function lOr(t,e,r,n){let o=[],s=0;for(let c of r(t))n(c)&&(e.has(c)||e.set(c,e.size),o.push([e.get(c),s])),s+=c.length;return[o,e]}a(lOr,"lexicalAnalyzer");function UUi(t){return t!==" "}a(UUi,"notSingleSpace");function ayc(t,e,r=HUi){let[n,o]=lOr(t,qUi(),r,UUi),[s,c]=lOr(e,o,r,UUi);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=jUi(c),u=s.length,d=l[s[0][0]],f=l[s[u-1][0]];function h(y,_,E,v){if(v===0||v===u-1){let S=l[n[E][0]];return v===0&&S.endsWith(d)||v===u-1&&S.startsWith(f)?0:1}else return y===_?0:1}a(h,"compare");let m=QUi(n.map(y=>y[0]),s.map(y=>y[0]),h),g=n[m.startOffset][1],A=m.endOffset0&&t[A-1]===" "&&--A,{lexDistance:m.distance,startOffset:g,endOffset:A,haystackLexLength:n.length,needleLexLength:s.length}}a(ayc,"lexEditDistance")});var uOr=I(Eie=>{"use strict";p();Object.defineProperty(Eie,"__esModule",{value:!0});Eie.PartialAcceptTriggerKind=void 0;Eie.computeCompCharLen=cyc;Eie.countLines=lyc;Eie.computeCompletionText=uyc;var $Ui;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})($Ui||(Eie.PartialAcceptTriggerKind=$Ui={}));function cyc(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(cyc,"computeCompCharLen");function lyc(t){return t.length===0?0:t.split(` +`).length}a(lyc,"countLines");function uyc(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(uyc,"computeCompletionText")});var t9i=I(YCt=>{"use strict";p();Object.defineProperty(YCt,"__esModule",{value:!0});YCt.postRejectionTasks=Cyc;YCt.postInsertionTasks=byc;var zCt=Ks(),zUi=yre(),dyc=uye(),WCt=cBi(),fyc=Jyt(),pyc=ePr(),YUi=bkr(),KUi=Zye(),x_e=Gl(),VUi=ZEt(),hyc=p_e(),myc=FUi(),WUi=GUi(),gyc=uOr(),PV=nA(),Ayc=RS(),JUi=cLe(),yyc=Jne(),DV=new x_e.Logger("postInsertion"),ZUi=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}],XUi=50,_yc=1500,Eyc=.5,vyc=500,dOr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function e9i(t,e,r,n,o){let s=t.get(zCt.IInstantiationService),c=t.get(x_e.ICompletionsLogTargetService),l=await t.get(YUi.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return DV.info(c,`Could not get document for ${e}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1},capturedCode:"",terminationOffset:0};let u=l.document,d=u.getText(),f=d.substring(0,n),h=u.positionAt(n),m=await s.invokeFunction(hyc.extractPrompt,r.properties.headerRequestId,(0,pyc.createCompletionState)(u,h),r),g=m.type==="prompt"?m.prompt:{prefix:f,suffix:"",isFimEnabled:!1};if(g.isFimEnabled&&o!==void 0){let A=d.substring(n,o);return g.suffix=d.substring(o),{prompt:g,capturedCode:A,terminationOffset:0}}else{let A=d.substring(n),y=(0,VUi.contextIndentationFromText)(f,n,u.detectedLanguageId),E=(0,VUi.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(E?E*2:vyc)),S=d.substring(n,v);return{prompt:g,capturedCode:S,terminationOffset:E??-1}}}a(e9i,"captureCode");function Cyc(t,e,r,n,o){let s=t.get(x_e.ICompletionsLogTargetService),c=t.get(zCt.IInstantiationService),l=t.get(zUi.ICompletionsTelemetryService),u=t.get(JUi.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{DV.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(KUi.telemetryRejected,e,g)});let d=c.createInstance(WCt.ChangeTracker,n,r-1),f=c.createInstance(WCt.ChangeTracker,n,r),h=a(async m=>{DV.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:_}=await c.invokeFunction(e9i,n,g,d.offset+1,f.offset),E={hypotheticalPromptJson:JSON.stringify({prefix:A.prefix,context:A.context}),hypotheticalPromptSuffixJson:JSON.stringify(A.suffix)},v=g.extendedBy({...E,capturedCodeJson:JSON.stringify(y)},{timeout:m.seconds,insertionOffset:r,trackedOffset:d.offset,terminationOffsetInCapturedCode:_});DV.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(PV.telemetry,e+".capturedAfterRejected",v,PV.TelemetryStore.Enhanced)},"checkInCode");ZUi.filter(m=>m.captureRejection).map(m=>d.push((0,PV.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a(Cyc,"postRejectionTasks");function byc(t,e,r,n,o,s,c,l){let u=t.get(x_e.ICompletionsLogTargetService),d=t.get(zCt.IInstantiationService),f=t.get(JUi.ICompletionsPromiseQueueService),h=t.get(zUi.ICompletionsTelemetryService),m=t.get(yyc.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});DV.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(KUi.telemetryAccepted,e,g);let A=r;r=(0,gyc.computeCompletionText)(r,c);let y=r.trim(),_=d.createInstance(WCt.ChangeTracker,o,n),E=d.createInstance(WCt.ChangeTracker,o,n+r.length),v=a(async S=>{await d.invokeFunction(xyc,e,y,n,o,S,g,_,E)},"stillInCodeCheck");if(dOr.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let S=v({seconds:0,captureCode:dOr.captureCode,captureRejection:dOr.captureRejection});f.register(S)}else ZUi.map(S=>_.push((0,PV.telemetryCatch)(h,f,()=>v(S),"postInsertionTasks"),S.seconds*1e3));d.invokeFunction(S=>(0,PV.telemetryCatch)(h,f,Syc,"post insertion citation check")(S,o,A,r,n,l))}a(byc,"postInsertionTasks");async function Syc(t,e,r,n,o,s){let c=t.get(x_e.ICompletionsLogTargetService),l=t.get(Ayc.ICompletionsTextDocumentManagerService),u=t.get(dyc.ICompletionsCopilotTokenManager),d=t.get(fyc.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,myc.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=fOr(f.getText(),n,XUi,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=Tyc(r.length,n.length,h.start_offset);if(m===void 0){DV.info(c,`Full completion for ${e} contains a reference matching public code, but the partially inserted text did not include the match.`);continue}let g=o+m,A=f?.positionAt(g),y=o+Iyc(r.length,n.length,h.stop_offset),_=f?.positionAt(y),E=A&&_?f?.getText({start:A,end:_}):"";await d.handleIPCodeCitation({inDocumentUri:e,offsetStart:g,offsetEnd:y,version:f?.version,location:A&&_?{start:A,end:_}:void 0,matchingText:E,details:h.details.citations})}}a(Syc,"citationCheck");function Tyc(t,e,r){if(!(ee))return r}a(Tyc,"computeCitationStart");function Iyc(t,e,r){return e{"use strict";p();Object.defineProperty(Ly,"__esModule",{value:!0});Ly.LastGhostText=Ly.ICompletionsLastGhostText=void 0;Ly.rejectLastShown=i9i;Ly.setLastShown=Pyc;Ly.handleGhostTextShown=Dyc;Ly.handleGhostTextPostInsert=Myc;Ly.handlePartialGhostTextPostInsert=Oyc;var wyc=an(),r9i=Gl(),hOr=t9i(),KCt=uOr(),n9i=oV(),mOr=Zye(),Ryc=new r9i.Logger("ghostText");Ly.ICompletionsLastGhostText=(0,wyc.createServiceIdentifier)("ICompletionsLastGhostText");var pOr=class{static{a(this,"LastGhostText")}constructor(){this.#r=[],this.linesAccepted=0}#e;#t;#r;get position(){return this.#e}get shownCompletions(){return this.#r||[]}get uri(){return this.#t}resetState(){this.#t=void 0,this.#e=void 0,this.#r=[],this.resetPartialAcceptanceState()}setState({uri:e},r){this.#t=e,this.#e=r,this.#r=[]}resetPartialAcceptanceState(){this.partiallyAcceptedLength=0,this.totalLength=void 0,this.linesLeft=void 0,this.linesAccepted=0}};Ly.LastGhostText=pOr;function kyc(t){let e=[];return t.shownCompletions.forEach(r=>{if(r.displayText&&r.telemetry){let n,o;t.partiallyAcceptedLength?(n=r.displayText.substring(t.partiallyAcceptedLength-1),o=r.telemetry.extendedBy({compType:"partial"},{compCharLen:n.length})):(n=r.displayText,o=r.telemetry);let s={completionText:n,completionTelemetryData:o,offset:r.offset};e.push(s)}}),e}a(kyc,"computeRejectedCompletions");function i9i(t,e){let r=t.get(Ly.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=kyc(r);n.length>0&&(0,hOr.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(i9i,"rejectLastShown");function Pyc(t,e,r,n){let o=t.get(Ly.ICompletionsLastGhostText);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==n9i.ResultType.TypingAsSuggested&&i9i(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(Pyc,"setLastShown");function Dyc(t,e){let r=t.get(r9i.ICompletionsLogTargetService),n=t.get(Ly.ICompletionsLastGhostText);if(n.index=e.index,!n.shownCompletions.find(o=>o.index===e.index)&&(e.uri===n.uri&&n.position?.line===e.position.line&&n.position?.character===e.position.character&&n.shownCompletions.push(e),e.displayText)){let o=e.resultType!==n9i.ResultType.Network;Ryc.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,mOr.telemetryShown)(t,e)}}a(Dyc,"handleGhostTextShown");function Nyc(t,e,r){let n=t.get(Ly.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,KCt.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,KCt.countLines)(e.displayText));let o=(0,KCt.countLines)(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(Nyc,"handleLineAcceptance");function Myc(t,e){let r=t.get(Ly.ICompletionsLastGhostText),n;return r.partiallyAcceptedLength?n={compType:"full",acceptedLength:(r.partiallyAcceptedLength||0)+e.displayText.length,acceptedLines:r.linesAccepted+(r.linesLeft??0)}:n={compType:"full",acceptedLength:e.displayText.length,acceptedLines:(0,KCt.countLines)(e.displayText)},r.resetState(),(0,hOr.postInsertionTasks)(t,mOr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(Myc,"handleGhostTextPostInsert");function Oyc(t,e,r){let n=t.get(Ly.ICompletionsLastGhostText);Nyc(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,hOr.postInsertionTasks)(t,mOr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Oyc,"handlePartialGhostTextPostInsert")});var o9i=I(AOr=>{"use strict";p();Object.defineProperty(AOr,"__esModule",{value:!0});AOr.normalizeIndentCharacter=Lyc;function Lyc(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` `).map(d=>{let f=d.replace(u,""),h=d.length-f.length;return l(h)+f}).join(` `)}a(n,"replace");let o;if(t.tabSize===void 0||typeof t.tabSize=="string"?o=4:o=t.tabSize,t.insertSpaces===!1){let s=a(c=>n(c," ",l=>" ".repeat(Math.floor(l/o))+" ".repeat(l%o)),"r");e.displayText=s(e.displayText),e.completionText=s(e.completionText)}else if(t.insertSpaces===!0){let s=a(c=>n(c," ",l=>" ".repeat(l*o)),"r");if(e.displayText=s(e.displayText),e.completionText=s(e.completionText),r){let c=a(l=>{if(l==="")return l;let u=l.split(` -`)[0],d=u.length-u.trimStart().length,f=d%o;if(f!==0&&d>0){let h=" ".repeat(f);return n(l,h,m=>" ".repeat((Math.floor(m/o)+1)*o))}else return l},"re");e.displayText=c(e.displayText),e.completionText=c(e.completionText)}}return e}a(Myc,"normalizeIndentCharacter")});var i9i=I(AOr=>{"use strict";p();Object.defineProperty(AOr,"__esModule",{value:!0});AOr.completionsFromGhostTextResults=Fyc;var Oyc=Og(),KCt=Qye(),Lyc=n9i(),Byc=iV();function Fyc(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=KCt.LocationFactory.range(KCt.LocationFactory.position(n.line,0),KCt.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,Lyc.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=KCt.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,Oyc.generateUuid)(),insertText:f,range:d,uri:r.uri,index:u.completion.completionIndex,telemetry:u.telemetry,displayText:u.completion.displayText,position:n,offset:r.offsetAt(n),resultType:e,copilotAnnotations:u.copilotAnnotations,clientCompletionId:u.clientCompletionId}});if(e===Byc.ResultType.TypingAsSuggested&&s!==void 0){let u=l.find(d=>d.index===s);if(u){let d=l.filter(f=>f.index!==s);l=[u,...d]}}return l}a(Fyc,"completionsFromGhostTextResults")});var EOr=I(kN=>{"use strict";p();var Uyc=kN&&kN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qyc=kN&&kN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qyc=kN&&kN.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ou.toString(16).padStart(2,"0")).join("");return`${r}.${l}`}a(jyc,"createRequestHMAC");async function Hyc(t){let e=typeof t=="string"?new TextEncoder().encode(t):t,r=await crypto.subtle.digest("SHA-256",e),n=new Uint8Array(r),o="";for(let s of n)o+=s.toString(16).padStart(2,"0");return o}a(Hyc,"createSha256Hash");var yOr=new Map;function Gyc(t){if(yOr.has(t))return yOr.get(t);let e=$yc(t);return yOr.set(t,e),e}a(Gyc,"getCachedSha256Hash");function $yc(t){let e=new _Or;return e.update(t),e.digest()}a($yc,"createSha256HashSyncInsecure");function DV(t,e=32){return t instanceof ArrayBuffer?(0,o9i.encodeHex)(o9i.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(DV,"toHexString");function WL(t,e){return(t>>>e|t<<32-e)>>>0}a(WL,"rightRotate");var _Or=class t{static{a(this,"StringSHA256Insecure")}static{this._k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]}static{this._bigBlock32=new DataView(new ArrayBuffer(256))}constructor(){this._h0=1779033703,this._h1=3144134277,this._h2=1013904242,this._h3=2773480762,this._h4=1359893119,this._h5=2600822924,this._h6=528734635,this._h7=1541459225,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let r=e.length;if(r===0)return;let n=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,c,l;for(s!==0?(c=s,l=-1,s=0):(c=e.charCodeAt(0),l=0);;){let u=c;if(JCt.isHighSurrogate(c))if(l+1>>6,e[r++]=128|(n&63)>>>0):n<65536?(e[r++]=224|(n&61440)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0):(e[r++]=240|(n&1835008)>>>18,e[r++]=128|(n&258048)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0),r>=64&&(this._step(),r-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),r}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),DV(this._h0)+DV(this._h1)+DV(this._h2)+DV(this._h3)+DV(this._h4)+DV(this._h5)+DV(this._h6)+DV(this._h7)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=t._bigBlock32,r=this._buffDV,n=t._k;for(let m=0;m<64;m+=4)e.setUint32(m,r.getUint32(m,!1),!1);for(let m=16;m<64;m++){let g=m*4,A=e.getUint32((m-15)*4,!1),y=e.getUint32((m-2)*4,!1),_=WL(A,7)^WL(A,18)^A>>>3,E=WL(y,17)^WL(y,19)^y>>>10,v=e.getUint32((m-16)*4,!1),S=e.getUint32((m-7)*4,!1);e.setUint32(g,v+_+S+E>>>0,!1)}let o=this._h0,s=this._h1,c=this._h2,l=this._h3,u=this._h4,d=this._h5,f=this._h6,h=this._h7;for(let m=0;m<64;m++){let g=WL(u,6)^WL(u,11)^WL(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,_=WL(o,2)^WL(o,13)^WL(o,22),E=o&s^o&c^s&c,v=_+E>>>0;h=f,f=d,d=u,u=l+y>>>0,l=c,c=s,s=o,o=y+v>>>0}this._h0=this._h0+o>>>0,this._h1=this._h1+s>>>0,this._h2=this._h2+c>>>0,this._h3=this._h3+l>>>0,this._h4=this._h4+u>>>0,this._h5=this._h5+d>>>0,this._h6=this._h6+f>>>0,this._h7=this._h7+h>>>0}}});var vOr=I(ZCt=>{"use strict";p();Object.defineProperty(ZCt,"__esModule",{value:!0});ZCt.isInlineSuggestionFromTextAfterCursor=s9i;ZCt.determineIsInlineSuggestionPosition=Vyc;function s9i(t){let e=Wyc(t),r=zyc(t);if(!(e&&!r))return e&&r}a(s9i,"isInlineSuggestionFromTextAfterCursor");function Vyc(t){let e=t.textAfterCursor();return s9i(e)}a(Vyc,"determineIsInlineSuggestionPosition");function Wyc(t){return t.trim().length!==0}a(Wyc,"isMiddleOfTheLineFromTextAfterCursor");function zyc(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(zyc,"isValidMiddleOfTheLineFromTextAfterCursor")});var ebt=I(NV=>{"use strict";p();Object.defineProperty(NV,"__esModule",{value:!0});NV.NoOpStatusReporter=NV.StatusReporter=NV.ICompletionsStatusReporter=void 0;var Yyc=an();NV.ICompletionsStatusReporter=(0,Yyc.createServiceIdentifier)("ICompletionsStatusReporter");var XCt=class{static{a(this,"StatusReporter")}#e=0;#t="Normal";#r;#n;#i=!0;get busy(){return this.#e>0}withProgress(e){return this.#t==="Warning"&&this.forceNormal(),this.#e++===0&&this.#o(),e().finally(()=>{--this.#e===0&&this.#o()})}forceStatus(e,r,n){this.#t===e&&this.#r===r&&!n&&!this.#n&&!this.#i||(this.#t=e,this.#r=r,this.#n=n,this.#i=!1,this.#o())}forceNormal(){this.#t!=="Inactive"&&this.forceStatus("Normal")}setError(e,r){this.forceStatus("Error",e,r)}setWarning(e){this.#t!=="Error"&&this.forceStatus("Warning",e)}setInactive(e){this.#t==="Error"||this.#t==="Warning"||this.forceStatus("Inactive",e)}clearInactive(){this.#t==="Inactive"&&this.forceStatus("Normal")}#o(){let e={kind:this.#t,message:this.#r,busy:this.busy,command:this.#n};this.didChange(e)}};NV.StatusReporter=XCt;var COr=class extends XCt{static{a(this,"NoOpStatusReporter")}didChange(){}};NV.NoOpStatusReporter=COr});var xOr=I(By=>{"use strict";p();Object.defineProperty(By,"__esModule",{value:!0});By.AdoRepoId=By.GithubRepoId=By.IGitService=void 0;By.getGitHubRepoInfoFromContext=Zyc;By.getOrderedRepoInfosFromContext=Xyc;By.getOrderedRemoteUrlsFromContext=SOr;By.parseRemoteUrl=TOr;By.toGithubNwo=a9i;By.toGithubWebUrl=e_c;By.getGithubRepoIdFromFetchUrl=IOr;By.getAdoRepoIdFromFetchUrl=c9i;By.normalizeFetchUrl=t_c;var Kyc=an(),bOr=ym(),Jyc=hd();By.IGitService=(0,Kyc.createServiceIdentifier)("IGitService");function Zyc(t){for(let e of SOr(t))if(e){let r=IOr(e);if(r)return{id:r,remoteUrl:e}}}a(Zyc,"getGitHubRepoInfoFromContext");function*Xyc(t){for(let e of SOr(t)){let r=IOr(e)??c9i(e);r&&(yield{repoId:r,fetchUrl:e})}}a(Xyc,"getOrderedRepoInfosFromContext");function SOr(t){let e=new Set;if(t.remoteFetchUrls?.length===1)return e.add(t.remoteFetchUrls[0]),e;let r=t.remotes.findIndex(o=>o===t.upstreamRemote);if(r!==-1){let o=t.remoteFetchUrls?.[r];o&&e.add(o)}let n=t.remotes.findIndex(o=>o==="origin");if(n!==-1){let o=t.remoteFetchUrls?.[n];o&&e.add(o)}for(let o of t.remoteFetchUrls??[])o&&e.add(o);return e}a(SOr,"getOrderedRemoteUrlsFromContext");function TOr(t){t=t.trim();try{if(/^[\w\d\-]+@/i.test(t)){let u=t.split(":");if(u.length!==2)return;t="ssh://"+u[0]+"/"+u[1]}let e=Jyc.URI.parse(t),r=e.authority,n=e.path;if(!((0,bOr.equalsIgnoreCase)(e.scheme,"ssh")||(0,bOr.equalsIgnoreCase)(e.scheme,"https")||(0,bOr.equalsIgnoreCase)(e.scheme,"http")))return;let o=r.split("@");if(o.length>2)return;let s=o.at(-1);if(!s)return;let c=s.toLowerCase().replace(/:\d+$/,"");return{host:c.replace(/^[\w\-]+-/,"").replace(/-[\w\-]+$/,""),rawHost:c,path:n}}catch{return}}a(TOr,"parseRemoteUrl");var tbt=class t{static{a(this,"GithubRepoId")}static parse(e){let r=e.split("/");if(r.length===2)return new t(r[0],r[1])}constructor(e,r,n="github.com"){this.org=e,this.repo=r,this.host=n,this.type="github"}toString(){return a9i(this)}};By.GithubRepoId=tbt;function a9i(t){return`${t.org}/${t.repo}`.toLowerCase()}a(a9i,"toGithubNwo");function e_c(t){return`https://${t.host}/${t.org}/${t.repo}`}a(e_c,"toGithubWebUrl");function IOr(t){let e=TOr(t);if(!e)return;let n=["github.com","ghe.com"].find(c=>e.host===c||e.host.endsWith("."+c));if(!n)return;let o=n==="ghe.com"?e.rawHost:"github.com",s=e.path.match(/^\/?([^/]+)\/([^/]+?)(\/|\.git\/?)?$/i);return s?new tbt(s[1],s[2],o):void 0}a(IOr,"getGithubRepoIdFromFetchUrl");var w_e=class{static{a(this,"AdoRepoId")}constructor(e,r,n){this.org=e,this.project=r,this.repo=n,this.type="ado"}toString(){return`${this.org}/${this.project}/${this.repo}`.toLowerCase()}};By.AdoRepoId=w_e;function c9i(t){let e=TOr(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new w_e(r.groups.org,r.groups.project,r.groups.repo):void 0}if(e.host==="ssh.dev.azure.com"){let r=e.path.match(/^\/?v3\/(?[^/]+)\/(?[^/]+?)\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new w_e(r.groups.org,r.groups.project,r.groups.repo):void 0}if(e.host.endsWith(".visualstudio.com")){let r=e.host.match(/^(?[^\.]+)\.visualstudio\.com$/i);if(!r?.groups)return;let n=e.path.match(/^\/(v3\/)(?[^/]+?)\/(?[^/]+?)\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i)??e.path.match(/^\/?((?[^/]+?)\/)?(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return n?.groups?new w_e(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(c9i,"getAdoRepoIdFromFetchUrl");function t_c(t){if(/^[\w\d\-]+@[\w\d\.\-]+:/.test(t))return t=t.replace(/([\w\d\-]+)@([\w\d\.\-]+):(.+)/,"https://$2/$3"),t;let e;try{e=new URL(t)}catch{return t}let r=e.pathname.match(/^\/scm\/scm\.git/),n=new URL("https://"+e.hostname+e.pathname);return!r&&/^\/scm\/[^/]/.test(n.pathname)&&(n.pathname=n.pathname.replace(/^\/scm\//,"/")),n.toString()}a(t_c,"normalizeFetchUrl")});var kOr=I(Eie=>{"use strict";p();Object.defineProperty(Eie,"__esModule",{value:!0});Eie.ComputationStatus=void 0;Eie.tryGetGitHubNWO=i_c;Eie.extractRepoInfoInBackground=o_c;Eie.extractRepoInfo=l9i;var wOr=xOr(),r_c=eV(),n_c=aU(),p3e=rV();function i_c(t){if(t!==void 0&&t!==h3e.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(i_c,"tryGetGitHubNWO");function o_c(t,e){let r=(0,p3e.dirname)(e);return s_c(t,r)}a(o_c,"extractRepoInfoInBackground");var s_c=u_c(l9i,1e4);async function l9i(t,e){let r=t.get(r_c.ICompletionsFileSystemService),n=(0,p3e.getFsUri)(e);if(!n)return;let o=await c_c(r,n);if(!o)return;let s=(0,p3e.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=l_c(c)??"",u=a_c(l),d={uri:o};return u===void 0?{baseFolder:d,url:l,hostname:"",pathname:"",repoId:void 0}:{baseFolder:d,url:l,hostname:u.host,pathname:u.path,repoId:u.repoId}}a(l9i,"extractRepoInfo");function a_c(t){let e=(0,wOr.parseRemoteUrl)(t);if(!e)return;let r=(0,wOr.getGithubRepoIdFromFetchUrl)(t)??(0,wOr.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(a_c,"parseRepoUrl");async function c_c(t,e){let r=e+"_add_to_make_longer";for(;e!=="file:///"&&e.length{let c=JSON.stringify(s),l=r.get(c);if(l)return l.result;if(n.has(c))return h3e.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new ROr(d)),n.delete(c)}),h3e.PENDING}}a(u_c,"computeInBackgroundAndMemoize")});var d9i=I(POr=>{"use strict";p();Object.defineProperty(POr,"__esModule",{value:!0});POr.isRepetitive=f_c;var d_c=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function f_c(t){let e=t.slice();return e.reverse(),u9i(e)||u9i(e.filter(r=>r.trim().length>0))}a(f_c,"isRepetitive");function u9i(t){let e=p_c(t);for(let r of d_c){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(p_c,"kmp_prefix_function")});var p9i=I(m3e=>{"use strict";p();Object.defineProperty(m3e,"__esModule",{value:!0});m3e.maybeSnipCompletionImpl=f9i;m3e.postProcessChoiceInContext=__c;m3e.checkSuffix=E_c;var h_c=Mne(),vie=nA(),m_c=d9i();function g_c(t,e,r,n){let o="}";try{o=(0,h_c.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return f9i({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(g_c,"maybeSnipCompletion");function f9i(t,e,r,n){let o=A_c(r),s=o.lines;if(s.length===1)return r;for(let c=1;c=t.getLineCount()?void 0:t.getLineText(y),h!==void 0&&h.trim()==="")u++;else break}let m,g;for(;m=c+f+d,g=m>=s.length?void 0:s[m],g!==void 0&&g.trim()==="";)d++;let A=m===s.length-1;if(!g||!(h&&(A?h.startsWith(g)||g.startsWith(h):h===g&&g.trim()===n))){l=!1;break}}if(l)return s.slice(0,c).join(o.newLineCharacter)}return r}a(f9i,"maybeSnipCompletionImpl");function A_c(t){let e=t.includes(`\r +`)[0],d=u.length-u.trimStart().length,f=d%o;if(f!==0&&d>0){let h=" ".repeat(f);return n(l,h,m=>" ".repeat((Math.floor(m/o)+1)*o))}else return l},"re");e.displayText=c(e.displayText),e.completionText=c(e.completionText)}}return e}a(Lyc,"normalizeIndentCharacter")});var s9i=I(yOr=>{"use strict";p();Object.defineProperty(yOr,"__esModule",{value:!0});yOr.completionsFromGhostTextResults=Qyc;var Byc=Lg(),JCt=Qye(),Fyc=o9i(),Uyc=oV();function Qyc(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=JCt.LocationFactory.range(JCt.LocationFactory.position(n.line,0),JCt.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,Fyc.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=JCt.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,Byc.generateUuid)(),insertText:f,range:d,uri:r.uri,index:u.completion.completionIndex,telemetry:u.telemetry,displayText:u.completion.displayText,position:n,offset:r.offsetAt(n),resultType:e,copilotAnnotations:u.copilotAnnotations,clientCompletionId:u.clientCompletionId}});if(e===Uyc.ResultType.TypingAsSuggested&&s!==void 0){let u=l.find(d=>d.index===s);if(u){let d=l.filter(f=>f.index!==s);l=[u,...d]}}return l}a(Qyc,"completionsFromGhostTextResults")});var vOr=I(kN=>{"use strict";p();var qyc=kN&&kN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jyc=kN&&kN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Hyc=kN&&kN.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ou.toString(16).padStart(2,"0")).join("");return`${r}.${l}`}a(Gyc,"createRequestHMAC");async function $yc(t){let e=typeof t=="string"?new TextEncoder().encode(t):t,r=await crypto.subtle.digest("SHA-256",e),n=new Uint8Array(r),o="";for(let s of n)o+=s.toString(16).padStart(2,"0");return o}a($yc,"createSha256Hash");var _Or=new Map;function Vyc(t){if(_Or.has(t))return _Or.get(t);let e=Wyc(t);return _Or.set(t,e),e}a(Vyc,"getCachedSha256Hash");function Wyc(t){let e=new EOr;return e.update(t),e.digest()}a(Wyc,"createSha256HashSyncInsecure");function NV(t,e=32){return t instanceof ArrayBuffer?(0,a9i.encodeHex)(a9i.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(NV,"toHexString");function WL(t,e){return(t>>>e|t<<32-e)>>>0}a(WL,"rightRotate");var EOr=class t{static{a(this,"StringSHA256Insecure")}static{this._k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]}static{this._bigBlock32=new DataView(new ArrayBuffer(256))}constructor(){this._h0=1779033703,this._h1=3144134277,this._h2=1013904242,this._h3=2773480762,this._h4=1359893119,this._h5=2600822924,this._h6=528734635,this._h7=1541459225,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let r=e.length;if(r===0)return;let n=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,c,l;for(s!==0?(c=s,l=-1,s=0):(c=e.charCodeAt(0),l=0);;){let u=c;if(ZCt.isHighSurrogate(c))if(l+1>>6,e[r++]=128|(n&63)>>>0):n<65536?(e[r++]=224|(n&61440)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0):(e[r++]=240|(n&1835008)>>>18,e[r++]=128|(n&258048)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0),r>=64&&(this._step(),r-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),r}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),NV(this._h0)+NV(this._h1)+NV(this._h2)+NV(this._h3)+NV(this._h4)+NV(this._h5)+NV(this._h6)+NV(this._h7)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=t._bigBlock32,r=this._buffDV,n=t._k;for(let m=0;m<64;m+=4)e.setUint32(m,r.getUint32(m,!1),!1);for(let m=16;m<64;m++){let g=m*4,A=e.getUint32((m-15)*4,!1),y=e.getUint32((m-2)*4,!1),_=WL(A,7)^WL(A,18)^A>>>3,E=WL(y,17)^WL(y,19)^y>>>10,v=e.getUint32((m-16)*4,!1),S=e.getUint32((m-7)*4,!1);e.setUint32(g,v+_+S+E>>>0,!1)}let o=this._h0,s=this._h1,c=this._h2,l=this._h3,u=this._h4,d=this._h5,f=this._h6,h=this._h7;for(let m=0;m<64;m++){let g=WL(u,6)^WL(u,11)^WL(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,_=WL(o,2)^WL(o,13)^WL(o,22),E=o&s^o&c^s&c,v=_+E>>>0;h=f,f=d,d=u,u=l+y>>>0,l=c,c=s,s=o,o=y+v>>>0}this._h0=this._h0+o>>>0,this._h1=this._h1+s>>>0,this._h2=this._h2+c>>>0,this._h3=this._h3+l>>>0,this._h4=this._h4+u>>>0,this._h5=this._h5+d>>>0,this._h6=this._h6+f>>>0,this._h7=this._h7+h>>>0}}});var COr=I(XCt=>{"use strict";p();Object.defineProperty(XCt,"__esModule",{value:!0});XCt.isInlineSuggestionFromTextAfterCursor=c9i;XCt.determineIsInlineSuggestionPosition=zyc;function c9i(t){let e=Yyc(t),r=Kyc(t);if(!(e&&!r))return e&&r}a(c9i,"isInlineSuggestionFromTextAfterCursor");function zyc(t){let e=t.textAfterCursor();return c9i(e)}a(zyc,"determineIsInlineSuggestionPosition");function Yyc(t){return t.trim().length!==0}a(Yyc,"isMiddleOfTheLineFromTextAfterCursor");function Kyc(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(Kyc,"isValidMiddleOfTheLineFromTextAfterCursor")});var tbt=I(MV=>{"use strict";p();Object.defineProperty(MV,"__esModule",{value:!0});MV.NoOpStatusReporter=MV.StatusReporter=MV.ICompletionsStatusReporter=void 0;var Jyc=an();MV.ICompletionsStatusReporter=(0,Jyc.createServiceIdentifier)("ICompletionsStatusReporter");var ebt=class{static{a(this,"StatusReporter")}#e=0;#t="Normal";#r;#n;#i=!0;get busy(){return this.#e>0}withProgress(e){return this.#t==="Warning"&&this.forceNormal(),this.#e++===0&&this.#o(),e().finally(()=>{--this.#e===0&&this.#o()})}forceStatus(e,r,n){this.#t===e&&this.#r===r&&!n&&!this.#n&&!this.#i||(this.#t=e,this.#r=r,this.#n=n,this.#i=!1,this.#o())}forceNormal(){this.#t!=="Inactive"&&this.forceStatus("Normal")}setError(e,r){this.forceStatus("Error",e,r)}setWarning(e){this.#t!=="Error"&&this.forceStatus("Warning",e)}setInactive(e){this.#t==="Error"||this.#t==="Warning"||this.forceStatus("Inactive",e)}clearInactive(){this.#t==="Inactive"&&this.forceStatus("Normal")}#o(){let e={kind:this.#t,message:this.#r,busy:this.busy,command:this.#n};this.didChange(e)}};MV.StatusReporter=ebt;var bOr=class extends ebt{static{a(this,"NoOpStatusReporter")}didChange(){}};MV.NoOpStatusReporter=bOr});var wOr=I(By=>{"use strict";p();Object.defineProperty(By,"__esModule",{value:!0});By.AdoRepoId=By.GithubRepoId=By.IGitService=void 0;By.getGitHubRepoInfoFromContext=e_c;By.getOrderedRepoInfosFromContext=t_c;By.getOrderedRemoteUrlsFromContext=TOr;By.parseRemoteUrl=IOr;By.toGithubNwo=l9i;By.toGithubWebUrl=r_c;By.getGithubRepoIdFromFetchUrl=xOr;By.getAdoRepoIdFromFetchUrl=u9i;By.normalizeFetchUrl=n_c;var Zyc=an(),SOr=ym(),Xyc=hd();By.IGitService=(0,Zyc.createServiceIdentifier)("IGitService");function e_c(t){for(let e of TOr(t))if(e){let r=xOr(e);if(r)return{id:r,remoteUrl:e}}}a(e_c,"getGitHubRepoInfoFromContext");function*t_c(t){for(let e of TOr(t)){let r=xOr(e)??u9i(e);r&&(yield{repoId:r,fetchUrl:e})}}a(t_c,"getOrderedRepoInfosFromContext");function TOr(t){let e=new Set;if(t.remoteFetchUrls?.length===1)return e.add(t.remoteFetchUrls[0]),e;let r=t.remotes.findIndex(o=>o===t.upstreamRemote);if(r!==-1){let o=t.remoteFetchUrls?.[r];o&&e.add(o)}let n=t.remotes.findIndex(o=>o==="origin");if(n!==-1){let o=t.remoteFetchUrls?.[n];o&&e.add(o)}for(let o of t.remoteFetchUrls??[])o&&e.add(o);return e}a(TOr,"getOrderedRemoteUrlsFromContext");function IOr(t){t=t.trim();try{if(/^[\w\d\-]+@/i.test(t)){let u=t.split(":");if(u.length!==2)return;t="ssh://"+u[0]+"/"+u[1]}let e=Xyc.URI.parse(t),r=e.authority,n=e.path;if(!((0,SOr.equalsIgnoreCase)(e.scheme,"ssh")||(0,SOr.equalsIgnoreCase)(e.scheme,"https")||(0,SOr.equalsIgnoreCase)(e.scheme,"http")))return;let o=r.split("@");if(o.length>2)return;let s=o.at(-1);if(!s)return;let c=s.toLowerCase().replace(/:\d+$/,"");return{host:c.replace(/^[\w\-]+-/,"").replace(/-[\w\-]+$/,""),rawHost:c,path:n}}catch{return}}a(IOr,"parseRemoteUrl");var rbt=class t{static{a(this,"GithubRepoId")}static parse(e){let r=e.split("/");if(r.length===2)return new t(r[0],r[1])}constructor(e,r,n="github.com"){this.org=e,this.repo=r,this.host=n,this.type="github"}toString(){return l9i(this)}};By.GithubRepoId=rbt;function l9i(t){return`${t.org}/${t.repo}`.toLowerCase()}a(l9i,"toGithubNwo");function r_c(t){return`https://${t.host}/${t.org}/${t.repo}`}a(r_c,"toGithubWebUrl");function xOr(t){let e=IOr(t);if(!e)return;let n=["github.com","ghe.com"].find(c=>e.host===c||e.host.endsWith("."+c));if(!n)return;let o=n==="ghe.com"?e.rawHost:"github.com",s=e.path.match(/^\/?([^/]+)\/([^/]+?)(\/|\.git\/?)?$/i);return s?new rbt(s[1],s[2],o):void 0}a(xOr,"getGithubRepoIdFromFetchUrl");var w_e=class{static{a(this,"AdoRepoId")}constructor(e,r,n){this.org=e,this.project=r,this.repo=n,this.type="ado"}toString(){return`${this.org}/${this.project}/${this.repo}`.toLowerCase()}};By.AdoRepoId=w_e;function u9i(t){let e=IOr(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new w_e(r.groups.org,r.groups.project,r.groups.repo):void 0}if(e.host==="ssh.dev.azure.com"){let r=e.path.match(/^\/?v3\/(?[^/]+)\/(?[^/]+?)\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new w_e(r.groups.org,r.groups.project,r.groups.repo):void 0}if(e.host.endsWith(".visualstudio.com")){let r=e.host.match(/^(?[^\.]+)\.visualstudio\.com$/i);if(!r?.groups)return;let n=e.path.match(/^\/(v3\/)(?[^/]+?)\/(?[^/]+?)\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i)??e.path.match(/^\/?((?[^/]+?)\/)?(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return n?.groups?new w_e(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(u9i,"getAdoRepoIdFromFetchUrl");function n_c(t){if(/^[\w\d\-]+@[\w\d\.\-]+:/.test(t))return t=t.replace(/([\w\d\-]+)@([\w\d\.\-]+):(.+)/,"https://$2/$3"),t;let e;try{e=new URL(t)}catch{return t}let r=e.pathname.match(/^\/scm\/scm\.git/),n=new URL("https://"+e.hostname+e.pathname);return!r&&/^\/scm\/[^/]/.test(n.pathname)&&(n.pathname=n.pathname.replace(/^\/scm\//,"/")),n.toString()}a(n_c,"normalizeFetchUrl")});var POr=I(vie=>{"use strict";p();Object.defineProperty(vie,"__esModule",{value:!0});vie.ComputationStatus=void 0;vie.tryGetGitHubNWO=s_c;vie.extractRepoInfoInBackground=a_c;vie.extractRepoInfo=d9i;var ROr=wOr(),i_c=tV(),o_c=aU(),p3e=nV();function s_c(t){if(t!==void 0&&t!==h3e.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(s_c,"tryGetGitHubNWO");function a_c(t,e){let r=(0,p3e.dirname)(e);return c_c(t,r)}a(a_c,"extractRepoInfoInBackground");var c_c=f_c(d9i,1e4);async function d9i(t,e){let r=t.get(i_c.ICompletionsFileSystemService),n=(0,p3e.getFsUri)(e);if(!n)return;let o=await u_c(r,n);if(!o)return;let s=(0,p3e.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=d_c(c)??"",u=l_c(l),d={uri:o};return u===void 0?{baseFolder:d,url:l,hostname:"",pathname:"",repoId:void 0}:{baseFolder:d,url:l,hostname:u.host,pathname:u.path,repoId:u.repoId}}a(d9i,"extractRepoInfo");function l_c(t){let e=(0,ROr.parseRemoteUrl)(t);if(!e)return;let r=(0,ROr.getGithubRepoIdFromFetchUrl)(t)??(0,ROr.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(l_c,"parseRepoUrl");async function u_c(t,e){let r=e+"_add_to_make_longer";for(;e!=="file:///"&&e.length{let c=JSON.stringify(s),l=r.get(c);if(l)return l.result;if(n.has(c))return h3e.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new kOr(d)),n.delete(c)}),h3e.PENDING}}a(f_c,"computeInBackgroundAndMemoize")});var p9i=I(DOr=>{"use strict";p();Object.defineProperty(DOr,"__esModule",{value:!0});DOr.isRepetitive=h_c;var p_c=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function h_c(t){let e=t.slice();return e.reverse(),f9i(e)||f9i(e.filter(r=>r.trim().length>0))}a(h_c,"isRepetitive");function f9i(t){let e=m_c(t);for(let r of p_c){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(m_c,"kmp_prefix_function")});var m9i=I(m3e=>{"use strict";p();Object.defineProperty(m3e,"__esModule",{value:!0});m3e.maybeSnipCompletionImpl=h9i;m3e.postProcessChoiceInContext=v_c;m3e.checkSuffix=C_c;var g_c=One(),Cie=nA(),A_c=p9i();function y_c(t,e,r,n){let o="}";try{o=(0,g_c.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return h9i({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(y_c,"maybeSnipCompletion");function h9i(t,e,r,n){let o=__c(r),s=o.lines;if(s.length===1)return r;for(let c=1;c=t.getLineCount()?void 0:t.getLineText(y),h!==void 0&&h.trim()==="")u++;else break}let m,g;for(;m=c+f+d,g=m>=s.length?void 0:s[m],g!==void 0&&g.trim()==="";)d++;let A=m===s.length-1;if(!g||!(h&&(A?h.startsWith(g)||g.startsWith(h):h===g&&g.trim()===n))){l=!1;break}}if(l)return s.slice(0,c).join(o.newLineCharacter)}return r}a(h9i,"maybeSnipCompletionImpl");function __c(t){let e=t.includes(`\r `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(A_c,"splitByNewLine");function y_c(t,e,r,n){let o="",s=e.line+1,c=n?r.trim():r;for(;o===""&&s0){if(r.completionText.indexOf(o)!==-1)return o.length;{let s=-1,c=0;for(let l of o){let u=r.completionText.indexOf(l,s+1);if(u>s)c++,s=u;else break}return c}}return 0}a(E_c,"checkSuffix")});var A9i=I(MV=>{"use strict";p();Object.defineProperty(MV,"__esModule",{value:!0});MV.DocumentLogEntry=void 0;MV.serializeOffsetRange=v_c;MV.deserializeOffsetRange=C_c;MV.serializeEdit=b_c;MV.deserializeEdit=S_c;var h9i=W_(),g9i=Td(),m9i;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(m9i||(MV.DocumentLogEntry=m9i={}));function v_c(t){return[t.start,t.endExclusive]}a(v_c,"serializeOffsetRange");function C_c(t){return new g9i.OffsetRange(t[0],t[1])}a(C_c,"deserializeOffsetRange");function b_c(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(b_c,"serializeEdit");function S_c(t){return h9i.StringEdit.create(t.map(e=>h9i.StringReplacement.replace(new g9i.OffsetRange(e[0],e[1]),e[2])))}a(S_c,"deserializeEdit")});var R_e=I($m=>{"use strict";p();Object.defineProperty($m,"__esModule",{value:!0});$m.StatelessNextEditTelemetryBuilder=$m.StatelessNextEditResult=$m.NoNextEditReason=$m.FilteredOutReason=$m.StatelessNextEditDocument=$m.StatelessNextEditRequest=$m.RequestEditWindowWithCursorJump=$m.RequestEditWindow=$m.WithStatelessProviderTelemetry=void 0;var y9i=xT(),DOr=pd(),T_c=pl(),I_c=S2(),x_c=W_(),w_c=dI(),R_c=A9i(),k_c=q_r(),NOr=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};$m.WithStatelessProviderTelemetry=NOr;var MOr=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};$m.RequestEditWindow=MOr;var OOr=class{static{a(this,"RequestEditWindowWithCursorJump")}constructor(e,r){this.window=e,this.originalWindow=r}containsCursor(e){return this.window.containsRange(e)||this.originalWindow.containsRange(e)}};$m.RequestEditWindowWithCursorJump=OOr;var LOr=class t{static{a(this,"StatelessNextEditRequest")}static{this.ID=0}get result(){return this._result.p}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g){this.headerRequestId=e,this.opportunityId=r,this.documentBeforeEdits=n,this.documents=o,this.activeDocumentIdx=s,this.xtabEditHistory=c,this.firstEdit=l,this.expandedEditWindowNLines=u,this.isSpeculative=d,this.logContext=f,this.recordingBookmark=h,this.recording=m,this.providerRequestStartDateTime=g,this.seqid=String(++t.ID),this.cancellationTokenSource=new I_c.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=x_c.StringEdit.empty,this._result=new T_c.DeferredPromise,(0,DOr.assert)(o.length>0),(0,DOr.assert)(s>=0&&sr.id===e)!==void 0}getActiveDocument(){return this.documents[this.activeDocumentIdx]}serialize(){return{id:this.headerRequestId,documents:this.documents.map(e=>e.serialize()),activeDocumentIdx:this.activeDocumentIdx,recording:this.recording}}toString(){return this.toMarkdown()}toMarkdown(){return`### StatelessNextEditRequest +`;return{lines:t.split(e),newLineCharacter:e}}a(__c,"splitByNewLine");function E_c(t,e,r,n){let o="",s=e.line+1,c=n?r.trim():r;for(;o===""&&s0){if(r.completionText.indexOf(o)!==-1)return o.length;{let s=-1,c=0;for(let l of o){let u=r.completionText.indexOf(l,s+1);if(u>s)c++,s=u;else break}return c}}return 0}a(C_c,"checkSuffix")});var _9i=I(OV=>{"use strict";p();Object.defineProperty(OV,"__esModule",{value:!0});OV.DocumentLogEntry=void 0;OV.serializeOffsetRange=b_c;OV.deserializeOffsetRange=S_c;OV.serializeEdit=T_c;OV.deserializeEdit=I_c;var g9i=W_(),y9i=Id(),A9i;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(A9i||(OV.DocumentLogEntry=A9i={}));function b_c(t){return[t.start,t.endExclusive]}a(b_c,"serializeOffsetRange");function S_c(t){return new y9i.OffsetRange(t[0],t[1])}a(S_c,"deserializeOffsetRange");function T_c(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(T_c,"serializeEdit");function I_c(t){return g9i.StringEdit.create(t.map(e=>g9i.StringReplacement.replace(new y9i.OffsetRange(e[0],e[1]),e[2])))}a(I_c,"deserializeEdit")});var R_e=I(Vm=>{"use strict";p();Object.defineProperty(Vm,"__esModule",{value:!0});Vm.StatelessNextEditTelemetryBuilder=Vm.StatelessNextEditResult=Vm.NoNextEditReason=Vm.FilteredOutReason=Vm.StatelessNextEditDocument=Vm.StatelessNextEditRequest=Vm.RequestEditWindowWithCursorJump=Vm.RequestEditWindow=Vm.WithStatelessProviderTelemetry=void 0;var E9i=xT(),NOr=pd(),x_c=pl(),w_c=S2(),R_c=W_(),k_c=dI(),P_c=_9i(),D_c=j_r(),MOr=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};Vm.WithStatelessProviderTelemetry=MOr;var OOr=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};Vm.RequestEditWindow=OOr;var LOr=class{static{a(this,"RequestEditWindowWithCursorJump")}constructor(e,r){this.window=e,this.originalWindow=r}containsCursor(e){return this.window.containsRange(e)||this.originalWindow.containsRange(e)}};Vm.RequestEditWindowWithCursorJump=LOr;var BOr=class t{static{a(this,"StatelessNextEditRequest")}static{this.ID=0}get result(){return this._result.p}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g){this.headerRequestId=e,this.opportunityId=r,this.documentBeforeEdits=n,this.documents=o,this.activeDocumentIdx=s,this.xtabEditHistory=c,this.firstEdit=l,this.expandedEditWindowNLines=u,this.isSpeculative=d,this.logContext=f,this.recordingBookmark=h,this.recording=m,this.providerRequestStartDateTime=g,this.seqid=String(++t.ID),this.cancellationTokenSource=new w_c.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=R_c.StringEdit.empty,this._result=new x_c.DeferredPromise,(0,NOr.assert)(o.length>0),(0,NOr.assert)(s>=0&&sr.id===e)!==void 0}getActiveDocument(){return this.documents[this.activeDocumentIdx]}serialize(){return{id:this.headerRequestId,documents:this.documents.map(e=>e.serialize()),activeDocumentIdx:this.activeDocumentIdx,recording:this.recording}}toString(){return this.toMarkdown()}toMarkdown(){return`### StatelessNextEditRequest ${this.documents.map((r,n)=>` * [${n+1}/${this.documents.length}] ${n===this.activeDocumentIdx?"(active document) ":""}`+r.toMarkdown()).join(` -`)}`}};$m.StatelessNextEditRequest=LOr;var BOr=class{static{a(this,"StatelessNextEditDocument")}constructor(e,r,n,o,s,c,l,u=void 0){this.id=e,this.workspaceRoot=r,this.languageId=n,this.documentLinesBeforeEdit=o,this.recentEdit=s,this.documentBeforeEdits=c,this.recentEdits=l,this.lastSelectionInAfterEdit=u,this.documentAfterEdits=new w_c.StringText(this.recentEdits.apply(this.documentBeforeEdits.value)),this.documentAfterEditsLines=this.documentAfterEdits.getLines()}serialize(){return{id:this.id.uri,workspaceRoot:this.workspaceRoot?.toString(),languageId:this.languageId,documentLinesBeforeEdit:this.documentLinesBeforeEdit,recentEdit:this.recentEdit.serialize(),documentBeforeEdits:this.documentBeforeEdits.value,recentEdits:this.recentEdits.serialize(),lastSelectionInAfterEdit:this.lastSelectionInAfterEdit===void 0?void 0:(0,R_c.serializeOffsetRange)(this.lastSelectionInAfterEdit)}}toString(){return this.toMarkdown()}toMarkdown(){let e=[];return e.push(`StatelessNextEditDocument: **${this.id.uri}** +`)}`}};Vm.StatelessNextEditRequest=BOr;var FOr=class{static{a(this,"StatelessNextEditDocument")}constructor(e,r,n,o,s,c,l,u=void 0){this.id=e,this.workspaceRoot=r,this.languageId=n,this.documentLinesBeforeEdit=o,this.recentEdit=s,this.documentBeforeEdits=c,this.recentEdits=l,this.lastSelectionInAfterEdit=u,this.documentAfterEdits=new k_c.StringText(this.recentEdits.apply(this.documentBeforeEdits.value)),this.documentAfterEditsLines=this.documentAfterEdits.getLines()}serialize(){return{id:this.id.uri,workspaceRoot:this.workspaceRoot?.toString(),languageId:this.languageId,documentLinesBeforeEdit:this.documentLinesBeforeEdit,recentEdit:this.recentEdit.serialize(),documentBeforeEdits:this.documentBeforeEdits.value,recentEdits:this.recentEdits.serialize(),lastSelectionInAfterEdit:this.lastSelectionInAfterEdit===void 0?void 0:(0,P_c.serializeOffsetRange)(this.lastSelectionInAfterEdit)}}toString(){return this.toMarkdown()}toMarkdown(){let e=[];return e.push(`StatelessNextEditDocument: **${this.id.uri}** `),e.push("```patch"),e.push(this.recentEdit.humanReadablePatch(this.documentLinesBeforeEdit)),e.push("```"),e.push(""),e.join(` -`)}};$m.StatelessNextEditDocument=BOr;var _9i;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(_9i||($m.FilteredOutReason=_9i={}));var zL;(function(t){class e{static{a(this,"NoNextEditReason")}}class r extends e{static{a(this,"ActiveDocumentHasNoEdits")}constructor(){super(...arguments),this.kind="activeDocumentHasNoEdits"}toString(){return this.kind}}t.ActiveDocumentHasNoEdits=r;class n extends e{static{a(this,"NoSuggestions")}constructor(h,m,g,A){super(),this.documentBeforeEdits=h,this.window=m,this.nextCursorPosition=g,this.nextCursorDocumentId=A,this.kind="noSuggestions"}toString(){return this.kind}}t.NoSuggestions=n;class o extends e{static{a(this,"GotCancelled")}constructor(h){super(),this.message=h,this.kind="gotCancelled"}toString(){return`${this.kind}:${this.message}`}}t.GotCancelled=o;class s extends e{static{a(this,"FetchFailure")}constructor(h){super(),this.error=h,this.kind="fetchFailure"}toString(){return`${this.kind}:${this.error.message}`}}t.FetchFailure=s;class c extends e{static{a(this,"FilteredOut")}constructor(h){super(),this.message=h,this.kind="filteredOut"}toString(){return`${this.kind}:${this.message}`}}t.FilteredOut=c;class l extends e{static{a(this,"PromptTooLarge")}constructor(h){super(),this.message=h,this.kind="promptTooLarge"}toString(){return`${this.kind}:${this.message}`}}t.PromptTooLarge=l;class u extends e{static{a(this,"Uncategorized")}constructor(h){super(),this.error=h,this.kind="uncategorized"}toString(){return`${this.kind}:${this.error.message}`}}t.Uncategorized=u;class d extends e{static{a(this,"Unexpected")}constructor(h){super(),this.error=h,this.kind="unexpected"}toString(){return`${this.kind}:${this.error.message}`}}t.Unexpected=d})(zL||($m.NoNextEditReason=zL={}));var FOr=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=y9i.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=y9i.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};$m.StatelessNextEditResult=FOr;var UOr=class{static{a(this,"StatelessNextEditTelemetryBuilder")}constructor(e){this._nextCursorPrediction={nextCursorLineError:void 0,nextCursorLineDistance:void 0,isCrossFile:void 0},this.startTime=Date.now(),this.requestUuid=e}build(e){let n=Date.now()-this.startTime,o=this._prompt?JSON.stringify(this._prompt.map(({role:f,content:h})=>({role:f,content:h}))):void 0,s=this._prompt?(0,k_c.stringifyChatMessages)(this._prompt):void 0,c=s?.split(` -`).length,l=s?.length,u=e.isOk()?void 0:e.err.kind,d;return e.isError()&&(e.err instanceof zL.ActiveDocumentHasNoEdits||e.err instanceof zL.NoSuggestions||(e.err instanceof zL.GotCancelled||e.err instanceof zL.FilteredOut||e.err instanceof zL.PromptTooLarge?d=e.err.message:e.err instanceof zL.FetchFailure||e.err instanceof zL.Uncategorized||e.err instanceof zL.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,DOr.assertNever)(e.err))),{hadStatelessNextEditProviderCall:!0,noNextEditReasonKind:u,noNextEditReasonMessage:d,statelessNextEditProviderDuration:n,logProbThreshold:this._logProbThreshold,mergeConflictExpanded:this._mergeConflictExpanded,nLinesOfCurrentFileInPrompt:this._nLinesOfCurrentFileInPrompt,modelName:this._modelName,prompt:o,promptLineCount:c,promptCharCount:l,isCursorAtEndOfLine:this._isCursorAtLineEnd,isInlineSuggestion:this._isInlineSuggestion,debounceTime:this._debounceTime,artificialDelay:this._artificialDelay,fetchStartedAt:this._fetchStartedAt,hadLowLogProbSuggestion:this._hadLowLogProbSuggestion,response:this._response,nEditsSuggested:this._nEditsSuggested,nextEditLogprob:this._nextEditLogProb,nextCursorPrediction:this._nextCursorPrediction,lineDistanceToMostRecentEdit:this._lineDistanceToMostRecentEdit,xtabAggressivenessLevel:this._xtabAggressivenessLevel,xtabUserHappinessScore:this._xtabUserHappinessScore,userAggressivenessSetting:this._userAggressivenessSetting,editIntent:this._editIntent,editIntentParseError:this._editIntentParseError,cursorJumpModelName:this._cursorJumpModelName,cursorJumpPrompt:this._cursorJumpPrompt?JSON.stringify(this._cursorJumpPrompt.map(({role:f,content:h})=>({role:f,content:h}))):void 0,cursorJumpResponse:this._cursorJumpResponse,nDiffsInPrompt:this._nDiffsInPrompt,promptSectionTokens:this._promptSectionTokens,nNeighborSnippetsComputed:this._nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:this._nNeighborSnippetsInPrompt,neighborSnippetIndicesInPrompt:this._neighborSnippetIndicesInPrompt,lintErrors:this._lintErrors,terminalOutput:this._terminalOutput,similarFilesContext:this._similarFilesContext,modelConfig:this._modelConfig}}setLogProbThreshold(e){return this._logProbThreshold=e,this}setMergeConflictExpanded(e){return this._mergeConflictExpanded=e,this}setHadLowLogProbSuggestion(e){return this._hadLowLogProbSuggestion=e,this}setNLinesOfCurrentFileInPrompt(e){return this._nLinesOfCurrentFileInPrompt=e,this}setModelName(e){return this._modelName=e,this}setPrompt(e){return this._prompt=e,this}setIsCursorAtLineEnd(e){return this._isCursorAtLineEnd=e,this}setIsInlineSuggestion(e){return this._isInlineSuggestion=e,this}setDebounceTime(e){return this._debounceTime=e,this}setArtificialDelay(e){return this._artificialDelay=e,this}setFetchStartedAt(){return this._fetchStartedAt=Date.now(),this}get fetchStartedAt(){return this._fetchStartedAt}setResponse(e){return this._response=e.then(({response:r,ttft:n})=>{let o=Date.now()-this._fetchStartedAt,s=r.type;return{ttft:n,response:r,fetchTime:o,fetchResult:s}}),this}setCursorJumpModelName(e){return this._cursorJumpModelName=e,this}setCursorJumpPrompt(e){return this._cursorJumpPrompt=e,this}setCursorJumpResponse(e){return this._cursorJumpResponse=e,this}setNextEditLogProb(e){return this._nextEditLogProb=e,this}setNEditsSuggested(e){return this._nEditsSuggested=e,this}setLineDistanceToMostRecentEdit(e){return this._lineDistanceToMostRecentEdit=e,this}setNextCursorLineError(e){return this._nextCursorPrediction.nextCursorLineError=e,this}setNextCursorLineDistance(e){return this._nextCursorPrediction.nextCursorLineDistance=e,this}setNextCursorIsCrossFile(e){return this._nextCursorPrediction.isCrossFile=e,this}setXtabAggressivenessLevel(e){return this._xtabAggressivenessLevel=e,this}setXtabUserHappinessScore(e){return this._xtabUserHappinessScore=e,this}setUserAggressivenessSetting(e){return this._userAggressivenessSetting=e,this}setEditIntent(e){return this._editIntent=e,this}setEditIntentParseError(e){return this._editIntentParseError=e,this}setNDiffsInPrompt(e){return this._nDiffsInPrompt=e,this}setPromptSectionTokens(e){return this._promptSectionTokens=e,this}setNNeighborSnippetsComputed(e){return this._nNeighborSnippetsComputed=e,this}setNNeighborSnippetsInPrompt(e){return this._nNeighborSnippetsInPrompt=e,this}setNeighborSnippetIndicesInPrompt(e){return this._neighborSnippetIndicesInPrompt=JSON.stringify(e),this}setLintErrors(e){return this._lintErrors=e,this}setTerminalOutput(e){return this._terminalOutput=e,this}setSimilarFilesContext(e){return this._similarFilesContext=e,this}setModelConfig(e){return this._modelConfig=e,this}};$m.StatelessNextEditTelemetryBuilder=UOr});var E9i=I(rbt=>{"use strict";p();Object.defineProperty(rbt,"__esModule",{value:!0});rbt.StreamCopilotAnnotations=void 0;var QOr=class{static{a(this,"StreamCopilotAnnotations")}constructor(){this.current={}}update(e){Object.entries(e).forEach(([r,n])=>{n.forEach(o=>this.update_namespace(r,o))})}update_namespace(e,r){this.current[e]||(this.current[e]=[]);let n=this.current[e],o=n.findIndex(s=>s.id===r.id);o>=0?n[o]=r:n.push(r)}for(e){return this.current[e]??[]}};rbt.StreamCopilotAnnotations=QOr});var nbt=I(OV=>{"use strict";p();Object.defineProperty(OV,"__esModule",{value:!0});OV.ICompletionsFetchService=OV.CompletionsFetchError=OV.Completions=void 0;var P_c=an(),v9i;(function(t){class e{static{a(this,"RequestCancelled")}constructor(){this.kind="cancelled"}}t.RequestCancelled=e;class r{static{a(this,"UnsuccessfulResponse")}constructor(s,c,l,u){this.status=s,this.statusText=c,this.headers=l,this.text=u,this.kind="not-200-status"}}t.UnsuccessfulResponse=r;class n{static{a(this,"Unexpected")}constructor(s){this.error=s,this.kind="unexpected"}}t.Unexpected=n})(v9i||(OV.Completions=v9i={}));var qOr=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};OV.CompletionsFetchError=qOr;OV.ICompletionsFetchService=(0,P_c.createServiceIdentifier)("ICompletionsFetchService")});var g3e=I(k_e=>{"use strict";p();Object.defineProperty(k_e,"__esModule",{value:!0});k_e.CacheType=k_e.CustomDataPartMimeTypes=void 0;var C9i;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(C9i||(k_e.CustomDataPartMimeTypes=C9i={}));k_e.CacheType="ephemeral"});var HOr=I(A3e=>{"use strict";p();Object.defineProperty(A3e,"__esModule",{value:!0});A3e.ThinkingDataContainer=void 0;A3e.rawPartAsThinkingData=N_c;var D_c=wo(),b9i=g3e(),jOr=class extends D_c.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:b9i.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};A3e.ThinkingDataContainer=jOr;function N_c(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===b9i.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(N_c,"rawPartAsThinkingData")});var RU=I(dE=>{"use strict";p();Object.defineProperty(dE,"__esModule",{value:!0});dE.FilterReason=dE.FinishedCompletionReason=dE.ChatRole=dE.modelsWithoutResponsesContextManagement=dE.openAIContextManagementCompactionType=void 0;dE.isApiUsage=L_c;dE.nanoAiuToCredits=B_c;dE.getCAPITextPart=x9i;dE.rawMessageToCAPI=w9i;var ibt=wo(),M_c=jwe(),O_c=HOr();function L_c(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(L_c,"isApiUsage");function B_c(t){return typeof t=="number"&&t>=0?t/1e9:void 0}a(B_c,"nanoAiuToCredits");dE.openAIContextManagementCompactionType="compaction";dE.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var S9i;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(S9i||(dE.ChatRole=S9i={}));function x9i(t){return Array.isArray(t)?t.map(e=>x9i(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(x9i,"getCAPITextPart");function w9i(t,e){if(Array.isArray(t))return t.map(n=>w9i(n,e));let r=(0,ibt.toMode)(ibt.OutputMode.OpenAI,t);if("copilot_references"in t&&(r.copilot_references=t.copilot_references),"copilot_confirmations"in t&&(r.copilot_confirmations=t.copilot_confirmations),typeof r.content=="string")r.content=r.content.trimEnd();else for(let n=0;nn.type===M_c.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===ibt.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,O_c.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a(w9i,"rawMessageToCAPI");var T9i;(function(t){t.Stop="stop",t.Length="length",t.FunctionCall="function_call",t.ToolCalls="tool_calls",t.ContentFilter="content_filter",t.ServerError="error",t.ClientTrimmed="client-trimmed",t.ClientIterationDone="Iteration Done",t.ClientDone="DONE"})(T9i||(dE.FinishedCompletionReason=T9i={}));var I9i;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(I9i||(dE.FilterReason=I9i={}))});var PU=I(kU=>{"use strict";p();Object.defineProperty(kU,"__esModule",{value:!0});kU.getRequestId=U_c;kU.isCopilotAnnotation=Q_c;kU.isCodeCitationAnnotation=q_c;kU.isCopilotWebReference=j_c;kU.isOpenAIContextManagementResponse=H_c;kU.isAnthropicContextManagementResponse=G_c;kU.isOpenAiFunctionTool=$_c;var F_c=RU();function U_c(t,e){let r=t.get("X-Copilot-Experiment")||"",n=t.get("x-copilot-api-exp-assignment-context")||"";return{headerRequestId:t.get("x-request-id")||"",gitHubRequestId:t.get("x-github-request-id")||"",completionId:e&&e.id?e.id:"",created:e&&e.created?e.created:0,serverExperiments:r&&n?`${r};${n}`:r||n,deploymentId:t.get("azureml-model-deployment")||""}}a(U_c,"getRequestId");function Q_c(t){if(typeof t!="object"||t===null||!("details"in t))return!1;let{details:e}=t;return typeof e=="object"&&e!==null&&"type"in e&&"description"in e&&typeof e.type=="string"&&typeof e.description=="string"}a(Q_c,"isCopilotAnnotation");function q_c(t){if(typeof t!="object"||t===null||!("citations"in t))return!1;let{citations:e}=t;return typeof e=="object"&&e!==null&&"url"in e&&"license"in e&&typeof e.url=="string"&&typeof e.license=="string"}a(q_c,"isCodeCitationAnnotation");function j_c(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(j_c,"isCopilotWebReference");function H_c(t){return"type"in t&&t.type===F_c.openAIContextManagementCompactionType}a(H_c,"isOpenAIContextManagementResponse");function G_c(t){return"applied_edits"in t}a(G_c,"isAnthropicContextManagementResponse");function $_c(t){return t.function!==void 0}a($_c,"isOpenAiFunctionTool")});var R9i=I(PN=>{"use strict";p();Object.defineProperty(PN,"__esModule",{value:!0});PN.asyncIterableMap=V_c;PN.asyncIterableFilter=W_c;PN.asyncIterableMapFilter=z_c;PN.asyncIterableFromArray=Y_c;PN.asyncIterableToArray=K_c;PN.asyncIterableConcat=J_c;PN.asyncIterableCount=Z_c;PN.iterableMap=X_c;PN.iterableMapFilter=eEc;async function*V_c(t,e){for await(let r of t)yield e(r)}a(V_c,"asyncIterableMap");async function*W_c(t,e){for await(let r of t)await e(r)&&(yield r)}a(W_c,"asyncIterableFilter");async function*z_c(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(z_c,"asyncIterableMapFilter");async function*Y_c(t){for(let e of t)yield Promise.resolve(e)}a(Y_c,"asyncIterableFromArray");async function K_c(t){let e=[];for await(let r of t)e.push(r);return e}a(K_c,"asyncIterableToArray");async function*J_c(...t){for(let e of t)yield*e}a(J_c,"asyncIterableConcat");async function Z_c(t){let e=0;for await(let r of t)e++;return e}a(Z_c,"asyncIterableCount");function*X_c(t,e){for(let r of t)yield e(r)}a(X_c,"iterableMap");function*eEc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(eEc,"iterableMapFilter")});var k9i=I(GOr=>{"use strict";p();Object.defineProperty(GOr,"__esModule",{value:!0});GOr.getKey=rEc;function tEc(t,e){return t!==null&&typeof t=="object"&&e in t}a(tEc,"hasKey");function rEc(t,e){return tEc(t,e)?t[e]:void 0}a(rEc,"getKey")});var zOr=I(Vm=>{"use strict";p();var nEc=Vm&&Vm.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},LV=Vm&&Vm.__param||function(t,e){return function(r,n){e(r,n,t)}},$Or;Object.defineProperty(Vm,"__esModule",{value:!0});Vm.LiveOpenAIFetcher=Vm.CMDQuotaExceeded=Vm.OpenAIFetcher=Vm.ICompletionsOpenAIFetcherService=Vm.CopilotUiKind=void 0;Vm.sanitizeRequestOptionTelemetry=L9i;Vm.postProcessChoices=B9i;var iEc=rE(),oEc=E9i(),sEc=FD(),_3e=nbt(),aEc=PU(),P9i=bh(),cEc=an(),lEc=pd(),uEc=S2(),dEc=E5(),fEc=Og(),pEc=Ks(),hEc=uye(),mEc=Wyt(),D9i=eE(),gEc=R9i(),O9i=Gl(),AEc=UCt(),N9i=C_e(),yEc=ebt(),_Ec=kOr(),NI=nA(),EEc=sBe(),vEc=Kne(),y3e=k9i(),obt=bBe(),pA=new O9i.Logger("fetchCompletions"),sbt;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(sbt||(Vm.CopilotUiKind=sbt={}));function CEc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(CEc,"getProcessingTime");function bEc(t){switch(t){case sbt.GhostText:return"copilot-ghost";case sbt.Panel:return"copilot-panel"}}a(bEc,"uiKindToIntent");Vm.ICompletionsOpenAIFetcherService=(0,cEc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var abt=class{static{a(this,"OpenAIFetcher")}};Vm.OpenAIFetcher=abt;function SEc(t,e,r,n){return(0,AEc.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(SEc,"getProxyEngineUrl");function L9i(t,e,r,n){for(let[o,s]of Object.entries(t)){if(r.includes(o))continue;let c=s;if(o==="extra"&&n){let l={...c};for(let u of n)delete l[u];c=l}e.properties[`request.option.${o}`]=JSON.stringify(c)??"undefined"}}a(L9i,"sanitizeRequestOptionTelemetry");function B9i(t){return(0,gEc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(B9i,"postProcessChoices");Vm.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var VOr=$Or=class extends abt{static{a(this,"LiveOpenAIFetcher")}#e;constructor(e,r,n,o,s,c,l,u){super(),this.instantiationService=e,this.runtimeModeService=r,this.logTargetService=n,this.copilotTokenManager=o,this.statusReporter=s,this.authenticationService=c,this.fetchService=l,this.envService=u}async fetchAndStreamCompletions(e,r,n,o){if(this.#e)return{type:"canceled",reason:this.#e};let s="completions",c=this.copilotTokenManager.token??await this.copilotTokenManager.getToken(),l={prompt:e.prompt.prefix,suffix:e.prompt.suffix,max_tokens:(0,obt.getMaxSolutionTokens)(),temperature:(0,obt.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,obt.getTopP)(),n:e.count,stop:(0,obt.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,_Ec.tryGetGitHubNWO)(e.repoInfo);if(u!==void 0&&(l.nwo=u),e.postOptions&&Object.assign(l,e.postOptions),e.prompt.context&&e.prompt.context.length>0&&(l.extra.context=e.prompt.context),await(0,EEc.delay)(0),o?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"}}{let u=e.prompt,d=e.engineModelId,f=e.ourRequestId,h=r,m=e.uiKind,g=e.headers,A=this.instantiationService.invokeFunction(SEc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,NI.telemetrizePromptLength)(u));L9i(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(NI.telemetry,"request.sent",y);let _=bEc(m),E;E={...g,...this.instantiationService.invokeFunction(D9i.editorVersionHeaders)},E["Openai-Organization"]="github-copilot",E["X-Request-Id"]=f,E["VScode-SessionId"]=this.envService.sessionId,E["VScode-MachineId"]=this.envService.machineId,E["X-GitHub-Api-Version"]=D9i.apiVersion,_&&(E["OpenAI-Intent"]=_);let v=new dEc.StopWatch,S=o??uEc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,S,E).then(w=>w.isError()&&w.err instanceof _3e.Completions.Unexpected&&(0,N9i.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(NI.telemetry,"networking.disconnectAll"),this.fetchService.disconnectAll().then(()=>this.fetchService.fetch(A,c.token,l,f,S,E))):w);try{if(T.isError()){let x=T.err;if(x instanceof _3e.Completions.RequestCancelled)return this.instantiationService.invokeFunction(NI.telemetry,"networking.cancelRequest",NI.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(NI.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof _3e.Completions.UnsuccessfulResponse){let k=(0,aEc.getRequestId)(x.headers);y.extendWithRequestId(k),k.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(P9i.ITelemetryService).setSharedProperty("capi.assignmentcontext",k.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),pA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),pA.debug(this.logTargetService,"request.response properties",y.properties),pA.debug(this.logTargetService,"request.response measurements",y.measurements),pA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(NI.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof _3e.Completions.Unexpected){let k=x.error;if((0,N9i.isAbortError)(k))throw this.instantiationService.invokeFunction(NI.telemetry,"request.cancel",y),k;this.statusReporter.setWarning((0,y3e.getKey)(k,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(NI.telemetry,"request.shownWarning",D),y.properties.message=String((0,y3e.getKey)(k,"name")??""),y.properties.code=String((0,y3e.getKey)(k,"code")??""),y.properties.errno=String((0,y3e.getKey)(k,"errno")??""),y.properties.type=String((0,y3e.getKey)(k,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,pA.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(k)} after ${N}ms`),pA.debug(this.logTargetService,"request.error properties",y.properties),pA.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(NI.telemetry,"request.error",y),k}else(0,lEc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(P9i.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let k=v.elapsed();y.measurements.totalTimeMs=k;let D=200;pA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${k}ms`),y.properties.status=String(D),pA.debug(this.logTargetService,"request.response properties",y.properties),pA.debug(this.logTargetService,"request.response measurements",y.measurements),pA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(NI.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(k=>pA.exception(k,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=$Or.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:B9i(R),getProcessingTime:a(()=>CEc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(NI.logEnginePrompt,u,y)}}}static async*convertStreamToApiChoices(e,r,n,o){let s=a((l,u,d,f,h)=>({choiceIndex:l,completionText:u,requestId:e.requestId,finishReason:d,tokens:f.chunks,numTokens:f.chunks.length,blockFinished:h,telemetryData:n,clientCompletionId:(0,fEc.generateUuid)(),meanLogProb:void 0,meanAlternativeLogProb:void 0,copilotAnnotations:f.annotations.current}),"createAPIChoice"),c=[];try{for await(let l of e.stream){if(o?.isCancellationRequested)return;for(let u=0;u-1,y;if((m||A)&&(y=await r(f.accumulator.responseSoFar,{index:d,text:f.accumulator.responseSoFar,finished:m,requestId:e.requestId,telemetryData:n,annotations:f.accumulator.annotations,getAPIJsonData:a(()=>({text:f.accumulator.responseSoFar,tokens:f.accumulator.chunks,finish_reason:f.accumulator.finishReason??"stop",copilot_annotations:f.accumulator.annotations.current}),"getAPIJsonData")}),o?.isCancellationRequested))return;if(m&&(y===void 0||typeof y!="object"?y={yieldSolution:!0,continueStreaming:!1}:(y.yieldSolution=!0,y.continueStreaming=!1)),y!==void 0&&(typeof y=="number"||y.yieldSolution)){let _=m||typeof y=="number"||y!==void 0&&!y.continueStreaming;f.isFinished=_;let E=l.choices[u].finish_reason;E&&(f.accumulator.finishReason=E);let v=typeof y=="number"?y:y&&y.finishOffset!==void 0?y.finishOffset:void 0,S=v===void 0?f.accumulator.responseSoFar:f.accumulator.responseSoFar.slice(0,v);if(f.yielded||(f.yielded=!0,yield s(d,S,f.accumulator.finishReason??"stop",f.accumulator,v!==void 0)),o?.isCancellationRequested)return}}}for(let[l,u]of c.entries())if(!u.isFinished){if(await r(u.accumulator.responseSoFar,{index:l,text:u.accumulator.responseSoFar,finished:!0,requestId:e.requestId,telemetryData:n,annotations:u.accumulator.annotations,getAPIJsonData:a(()=>({text:u.accumulator.responseSoFar,tokens:u.accumulator.chunks,finish_reason:u.accumulator.finishReason??"stop",copilot_annotations:u.accumulator.annotations.current}),"getAPIJsonData")}),o?.isCancellationRequested)return;if(u.yielded)continue;if(u.yielded=!0,yield s(l,u.accumulator.responseSoFar,u.accumulator.finishReason??"stop",u.accumulator,!1),o?.isCancellationRequested)return}}finally{try{await e.destroy()}catch{}}}async handleError(e,r,n,o){let s=await n.text();if(n.status===402){this.#e="monthly free code completions exhausted",e.setError("Completions limit reached",{command:Vm.CMDQuotaExceeded,title:"Learn More"});let l=(0,mEc.onCopilotToken)(this.authenticationService,u=>{this.#e=void 0,u.isCompletionsQuotaExceeded||(e.forceNormal(),l.dispose())});return{type:"failed",reason:this.#e}}if(n.status===466)return e.setError(s),pA.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(M9i(n)&&!n.headers.get("x-github-request-id")){let c=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;pA.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else M9i(n)?(pA.warn(this.logTargetService,`Response status was ${n.status}:`,s),e.setWarning(`Last response was a ${n.status} error: ${s}`),r.properties.error=`Response status was ${n.status}: ${s}`):(e.setWarning(`Last response was a ${n.status} error`),r.properties.error=`Response status was ${n.status}`);return r.properties.status=String(n.status),this.instantiationService.invokeFunction(NI.telemetry,"request.shownWarning",r),n.status===401||n.status===403?(this.copilotTokenManager.resetToken(n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`}):n.status===429?(setTimeout(()=>{this.#e=void 0},10*1e3),this.#e="rate limited",pA.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(pA.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(pA.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};Vm.LiveOpenAIFetcher=VOr;Vm.LiveOpenAIFetcher=VOr=$Or=nEc([LV(0,pEc.IInstantiationService),LV(1,vEc.ICompletionsRuntimeModeService),LV(2,O9i.ICompletionsLogTargetService),LV(3,hEc.ICompletionsCopilotTokenManager),LV(4,yEc.ICompletionsStatusReporter),LV(5,iEc.IAuthenticationService),LV(6,_3e.ICompletionsFetchService),LV(7,sEc.IEnvService)],VOr);function M9i(t){return t.status>=400&&t.status<500}a(M9i,"isClientError");var WOr=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new oEc.StreamCopilotAnnotations}get responseSoFar(){return this._responseSoFar}get chunks(){return this._chunks}set finishReason(e){this._finishReason=e}get finishReason(){return this._finishReason}append(e){let r=e.text;r&&(this._chunks.push(r),this._responseSoFar=this._responseSoFar+r),e.copilot_annotations&&this.annotations.update(e.copilot_annotations)}}});var KOr=I(YOr=>{"use strict";p();Object.defineProperty(YOr,"__esModule",{value:!0});YOr.appendToCache=TEc;function TEc(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(TEc,"appendToCache")});var j9i=I(lf=>{"use strict";p();var IEc=lf&&lf.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Cie=lf&&lf.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(lf,"__esModule",{value:!0});lf.CompletionsFromNetwork=lf.logger=void 0;lf.postProcessChoices=cbt;lf.makeGhostAPIChoice=q9i;lf.telemetryPerformance=e5r;var E3e=R_e(),xEc=gv(),v3e=xT(),wEc=pd(),REc=dI(),kEc=Ks(),F9i=eE(),PEc=PRr(),DEc=xy(),Q9i=Gl(),NEc=YMr(),ZOr=zOr(),MEc=bBe(),OEc=nA(),LEc=Kne(),BEc=Yye(),JOr=KOr(),FEc=cBe(),U9i=iV(),DN=Zye();lf.logger=new Q9i.Logger("ghostText");var XOr=class{static{a(this,"CompletionsFromNetwork")}constructor(e,r,n,o,s,c,l){this.instantiationService=e,this.fetcherService=r,this.featuresService=n,this.runtimeMode=o,this.logTarget=s,this.completionsCacheService=c,this.userErrorNotifier=l}async getCompletionsFromNetwork(e,r,n,o,s){return this.genericGetCompletionsFromNetwork(e,r,n,o,s,"completions",async(c,l,u)=>{let f=await u[Symbol.asyncIterator]().next();if(f.done)return lf.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,DN.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return lf.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,DN.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return lf.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,DN.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction(e5r,"performance",h,c,l),lf.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=cbt(h);m&&((0,JOr.appendToCache)(this.completionsCacheService,e,m),lf.logger.debug(this.logTarget,`GhostText first completion (index ${m?.choiceIndex}): ${JSON.stringify(m?.completionText)}`));let g=(async()=>{let A=m!==void 0?[m]:[];for await(let y of u){if(y===void 0)continue;lf.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let _=cbt(y,A);_&&(A.push(_),(0,JOr.appendToCache)(this.completionsCacheService,e,_))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[q9i(m,{forceSingleLine:!1}),g],telemetryData:(0,DN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:U9i.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,DN.mkBasicResultTelemetry)(r)}})}async getAllCompletionsFromNetwork(e,r,n,o,s){return this.genericGetCompletionsFromNetwork(e,r,n,o,s,"all completions",async(c,l,u)=>{let d=[];for await(let f of u){if(n?.isCancellationRequested)return lf.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,DN.mkCanceledResultTelemetry)(r)};let h=cbt(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,JOr.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction(e5r,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,DN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:U9i.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new E3e.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=v3e.Result.ok(void 0);break;case"canceled":f=v3e.Result.error(new E3e.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=v3e.Result.error(new E3e.NoNextEditReason.NoSuggestions(new REc.StringText(""),void 0));break;case"failed":f=v3e.Result.error(new E3e.NoNextEditReason.Uncategorized(xEc.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=v3e.Result.error(new E3e.NoNextEditReason.GotCancelled(d.reason));break;default:(0,wEc.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){lf.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,MEc.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,F9i.shouldDoServerTrimming)(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},h={n:u,temperature:d,code_annotations:!1},m=this.featuresService.modelAlwaysTerminatesSingleline(r),g=e.blockMode===F9i.BlockMode.MoreMultiline&&BEc.BlockTrimmer.isSupported(e.languageId)&&!m;!e.multiline&&!g?h.stop=[` -`]:e.stop&&(h.stop=e.stop),e.maxTokens!==void 0&&(h.max_tokens=e.maxTokens);let A=Date.now(),y={endpoint:"completions",uiKind:ZOr.CopilotUiKind.GhostText,temperature:JSON.stringify(d),n:JSON.stringify(u),stop:JSON.stringify(h.stop)??"unset",logit_bias:JSON.stringify(null)};Object.assign(r.properties,y);try{let _={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:u,uiKind:ZOr.CopilotUiKind.GhostText,postOptions:h,headers:e.headers,extra:f},E=await this.fetcherService.fetchAndStreamCompletions(_,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:(0,DN.mkBasicResultTelemetry)(r)}:E.type==="canceled"?(lf.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:(0,DN.mkCanceledResultTelemetry)(r)}):l(A,E.getProcessingTime(),E.choices)}catch(_){if((0,NEc.isAbortError)(_))return{type:"canceled",reason:"network request aborted",telemetryData:(0,DN.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(E=>lf.logger.exception(E,_,"Error on ghost text request")),this.userErrorNotifier.notifyUser(_),this.runtimeMode.shouldFailForDebugPurposes())throw _;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,DN.mkBasicResultTelemetry)(r)}}}};lf.CompletionsFromNetwork=XOr;lf.CompletionsFromNetwork=XOr=IEc([Cie(0,kEc.IInstantiationService),Cie(1,ZOr.ICompletionsOpenAIFetcherService),Cie(2,DEc.ICompletionsFeaturesService),Cie(3,LEc.ICompletionsRuntimeModeService),Cie(4,Q9i.ICompletionsLogTargetService),Cie(5,FEc.ICompletionsCacheService),Cie(6,PEc.ICompletionsUserErrorNotifierService)],XOr);function cbt(t,e){if(e||(e=[]),t.completionText=t.completionText.trimEnd(),!!t.completionText&&e.findIndex(r=>r.completionText.trim()===t.completionText.trim())===-1)return t}a(cbt,"postProcessChoices");function q9i(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` +`)}};Vm.StatelessNextEditDocument=FOr;var v9i;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(v9i||(Vm.FilteredOutReason=v9i={}));var zL;(function(t){class e{static{a(this,"NoNextEditReason")}}class r extends e{static{a(this,"ActiveDocumentHasNoEdits")}constructor(){super(...arguments),this.kind="activeDocumentHasNoEdits"}toString(){return this.kind}}t.ActiveDocumentHasNoEdits=r;class n extends e{static{a(this,"NoSuggestions")}constructor(h,m,g,A){super(),this.documentBeforeEdits=h,this.window=m,this.nextCursorPosition=g,this.nextCursorDocumentId=A,this.kind="noSuggestions"}toString(){return this.kind}}t.NoSuggestions=n;class o extends e{static{a(this,"GotCancelled")}constructor(h){super(),this.message=h,this.kind="gotCancelled"}toString(){return`${this.kind}:${this.message}`}}t.GotCancelled=o;class s extends e{static{a(this,"FetchFailure")}constructor(h){super(),this.error=h,this.kind="fetchFailure"}toString(){return`${this.kind}:${this.error.message}`}}t.FetchFailure=s;class c extends e{static{a(this,"FilteredOut")}constructor(h){super(),this.message=h,this.kind="filteredOut"}toString(){return`${this.kind}:${this.message}`}}t.FilteredOut=c;class l extends e{static{a(this,"PromptTooLarge")}constructor(h){super(),this.message=h,this.kind="promptTooLarge"}toString(){return`${this.kind}:${this.message}`}}t.PromptTooLarge=l;class u extends e{static{a(this,"Uncategorized")}constructor(h){super(),this.error=h,this.kind="uncategorized"}toString(){return`${this.kind}:${this.error.message}`}}t.Uncategorized=u;class d extends e{static{a(this,"Unexpected")}constructor(h){super(),this.error=h,this.kind="unexpected"}toString(){return`${this.kind}:${this.error.message}`}}t.Unexpected=d})(zL||(Vm.NoNextEditReason=zL={}));var UOr=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=E9i.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=E9i.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};Vm.StatelessNextEditResult=UOr;var QOr=class{static{a(this,"StatelessNextEditTelemetryBuilder")}constructor(e){this._nextCursorPrediction={nextCursorLineError:void 0,nextCursorLineDistance:void 0,isCrossFile:void 0},this.startTime=Date.now(),this.requestUuid=e}build(e){let n=Date.now()-this.startTime,o=this._prompt?JSON.stringify(this._prompt.map(({role:f,content:h})=>({role:f,content:h}))):void 0,s=this._prompt?(0,D_c.stringifyChatMessages)(this._prompt):void 0,c=s?.split(` +`).length,l=s?.length,u=e.isOk()?void 0:e.err.kind,d;return e.isError()&&(e.err instanceof zL.ActiveDocumentHasNoEdits||e.err instanceof zL.NoSuggestions||(e.err instanceof zL.GotCancelled||e.err instanceof zL.FilteredOut||e.err instanceof zL.PromptTooLarge?d=e.err.message:e.err instanceof zL.FetchFailure||e.err instanceof zL.Uncategorized||e.err instanceof zL.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,NOr.assertNever)(e.err))),{hadStatelessNextEditProviderCall:!0,noNextEditReasonKind:u,noNextEditReasonMessage:d,statelessNextEditProviderDuration:n,logProbThreshold:this._logProbThreshold,mergeConflictExpanded:this._mergeConflictExpanded,nLinesOfCurrentFileInPrompt:this._nLinesOfCurrentFileInPrompt,modelName:this._modelName,prompt:o,promptLineCount:c,promptCharCount:l,isCursorAtEndOfLine:this._isCursorAtLineEnd,isInlineSuggestion:this._isInlineSuggestion,debounceTime:this._debounceTime,artificialDelay:this._artificialDelay,fetchStartedAt:this._fetchStartedAt,hadLowLogProbSuggestion:this._hadLowLogProbSuggestion,response:this._response,nEditsSuggested:this._nEditsSuggested,nextEditLogprob:this._nextEditLogProb,nextCursorPrediction:this._nextCursorPrediction,lineDistanceToMostRecentEdit:this._lineDistanceToMostRecentEdit,xtabAggressivenessLevel:this._xtabAggressivenessLevel,xtabUserHappinessScore:this._xtabUserHappinessScore,userAggressivenessSetting:this._userAggressivenessSetting,editIntent:this._editIntent,editIntentParseError:this._editIntentParseError,cursorJumpModelName:this._cursorJumpModelName,cursorJumpPrompt:this._cursorJumpPrompt?JSON.stringify(this._cursorJumpPrompt.map(({role:f,content:h})=>({role:f,content:h}))):void 0,cursorJumpResponse:this._cursorJumpResponse,nDiffsInPrompt:this._nDiffsInPrompt,promptSectionTokens:this._promptSectionTokens,nNeighborSnippetsComputed:this._nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:this._nNeighborSnippetsInPrompt,neighborSnippetIndicesInPrompt:this._neighborSnippetIndicesInPrompt,lintErrors:this._lintErrors,terminalOutput:this._terminalOutput,similarFilesContext:this._similarFilesContext,modelConfig:this._modelConfig}}setLogProbThreshold(e){return this._logProbThreshold=e,this}setMergeConflictExpanded(e){return this._mergeConflictExpanded=e,this}setHadLowLogProbSuggestion(e){return this._hadLowLogProbSuggestion=e,this}setNLinesOfCurrentFileInPrompt(e){return this._nLinesOfCurrentFileInPrompt=e,this}setModelName(e){return this._modelName=e,this}setPrompt(e){return this._prompt=e,this}setIsCursorAtLineEnd(e){return this._isCursorAtLineEnd=e,this}setIsInlineSuggestion(e){return this._isInlineSuggestion=e,this}setDebounceTime(e){return this._debounceTime=e,this}setArtificialDelay(e){return this._artificialDelay=e,this}setFetchStartedAt(){return this._fetchStartedAt=Date.now(),this}get fetchStartedAt(){return this._fetchStartedAt}setResponse(e){return this._response=e.then(({response:r,ttft:n})=>{let o=Date.now()-this._fetchStartedAt,s=r.type;return{ttft:n,response:r,fetchTime:o,fetchResult:s}}),this}setCursorJumpModelName(e){return this._cursorJumpModelName=e,this}setCursorJumpPrompt(e){return this._cursorJumpPrompt=e,this}setCursorJumpResponse(e){return this._cursorJumpResponse=e,this}setNextEditLogProb(e){return this._nextEditLogProb=e,this}setNEditsSuggested(e){return this._nEditsSuggested=e,this}setLineDistanceToMostRecentEdit(e){return this._lineDistanceToMostRecentEdit=e,this}setNextCursorLineError(e){return this._nextCursorPrediction.nextCursorLineError=e,this}setNextCursorLineDistance(e){return this._nextCursorPrediction.nextCursorLineDistance=e,this}setNextCursorIsCrossFile(e){return this._nextCursorPrediction.isCrossFile=e,this}setXtabAggressivenessLevel(e){return this._xtabAggressivenessLevel=e,this}setXtabUserHappinessScore(e){return this._xtabUserHappinessScore=e,this}setUserAggressivenessSetting(e){return this._userAggressivenessSetting=e,this}setEditIntent(e){return this._editIntent=e,this}setEditIntentParseError(e){return this._editIntentParseError=e,this}setNDiffsInPrompt(e){return this._nDiffsInPrompt=e,this}setPromptSectionTokens(e){return this._promptSectionTokens=e,this}setNNeighborSnippetsComputed(e){return this._nNeighborSnippetsComputed=e,this}setNNeighborSnippetsInPrompt(e){return this._nNeighborSnippetsInPrompt=e,this}setNeighborSnippetIndicesInPrompt(e){return this._neighborSnippetIndicesInPrompt=JSON.stringify(e),this}setLintErrors(e){return this._lintErrors=e,this}setTerminalOutput(e){return this._terminalOutput=e,this}setSimilarFilesContext(e){return this._similarFilesContext=e,this}setModelConfig(e){return this._modelConfig=e,this}};Vm.StatelessNextEditTelemetryBuilder=QOr});var C9i=I(nbt=>{"use strict";p();Object.defineProperty(nbt,"__esModule",{value:!0});nbt.StreamCopilotAnnotations=void 0;var qOr=class{static{a(this,"StreamCopilotAnnotations")}constructor(){this.current={}}update(e){Object.entries(e).forEach(([r,n])=>{n.forEach(o=>this.update_namespace(r,o))})}update_namespace(e,r){this.current[e]||(this.current[e]=[]);let n=this.current[e],o=n.findIndex(s=>s.id===r.id);o>=0?n[o]=r:n.push(r)}for(e){return this.current[e]??[]}};nbt.StreamCopilotAnnotations=qOr});var ibt=I(LV=>{"use strict";p();Object.defineProperty(LV,"__esModule",{value:!0});LV.ICompletionsFetchService=LV.CompletionsFetchError=LV.Completions=void 0;var N_c=an(),b9i;(function(t){class e{static{a(this,"RequestCancelled")}constructor(){this.kind="cancelled"}}t.RequestCancelled=e;class r{static{a(this,"UnsuccessfulResponse")}constructor(s,c,l,u){this.status=s,this.statusText=c,this.headers=l,this.text=u,this.kind="not-200-status"}}t.UnsuccessfulResponse=r;class n{static{a(this,"Unexpected")}constructor(s){this.error=s,this.kind="unexpected"}}t.Unexpected=n})(b9i||(LV.Completions=b9i={}));var jOr=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};LV.CompletionsFetchError=jOr;LV.ICompletionsFetchService=(0,N_c.createServiceIdentifier)("ICompletionsFetchService")});var g3e=I(k_e=>{"use strict";p();Object.defineProperty(k_e,"__esModule",{value:!0});k_e.CacheType=k_e.CustomDataPartMimeTypes=void 0;var S9i;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(S9i||(k_e.CustomDataPartMimeTypes=S9i={}));k_e.CacheType="ephemeral"});var GOr=I(A3e=>{"use strict";p();Object.defineProperty(A3e,"__esModule",{value:!0});A3e.ThinkingDataContainer=void 0;A3e.rawPartAsThinkingData=O_c;var M_c=wo(),T9i=g3e(),HOr=class extends M_c.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:T9i.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};A3e.ThinkingDataContainer=HOr;function O_c(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===T9i.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(O_c,"rawPartAsThinkingData")});var RU=I(dE=>{"use strict";p();Object.defineProperty(dE,"__esModule",{value:!0});dE.FilterReason=dE.FinishedCompletionReason=dE.ChatRole=dE.modelsWithoutResponsesContextManagement=dE.openAIContextManagementCompactionType=void 0;dE.isApiUsage=F_c;dE.nanoAiuToCredits=U_c;dE.getCAPITextPart=R9i;dE.rawMessageToCAPI=k9i;var obt=wo(),L_c=jwe(),B_c=GOr();function F_c(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(F_c,"isApiUsage");function U_c(t){return typeof t=="number"&&t>=0?t/1e9:void 0}a(U_c,"nanoAiuToCredits");dE.openAIContextManagementCompactionType="compaction";dE.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var I9i;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(I9i||(dE.ChatRole=I9i={}));function R9i(t){return Array.isArray(t)?t.map(e=>R9i(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(R9i,"getCAPITextPart");function k9i(t,e){if(Array.isArray(t))return t.map(n=>k9i(n,e));let r=(0,obt.toMode)(obt.OutputMode.OpenAI,t);if("copilot_references"in t&&(r.copilot_references=t.copilot_references),"copilot_confirmations"in t&&(r.copilot_confirmations=t.copilot_confirmations),typeof r.content=="string")r.content=r.content.trimEnd();else for(let n=0;nn.type===L_c.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===obt.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,B_c.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a(k9i,"rawMessageToCAPI");var x9i;(function(t){t.Stop="stop",t.Length="length",t.FunctionCall="function_call",t.ToolCalls="tool_calls",t.ContentFilter="content_filter",t.ServerError="error",t.ClientTrimmed="client-trimmed",t.ClientIterationDone="Iteration Done",t.ClientDone="DONE"})(x9i||(dE.FinishedCompletionReason=x9i={}));var w9i;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(w9i||(dE.FilterReason=w9i={}))});var PU=I(kU=>{"use strict";p();Object.defineProperty(kU,"__esModule",{value:!0});kU.getRequestId=q_c;kU.isCopilotAnnotation=j_c;kU.isCodeCitationAnnotation=H_c;kU.isCopilotWebReference=G_c;kU.isOpenAIContextManagementResponse=$_c;kU.isAnthropicContextManagementResponse=V_c;kU.isOpenAiFunctionTool=W_c;var Q_c=RU();function q_c(t,e){let r=t.get("X-Copilot-Experiment")||"",n=t.get("x-copilot-api-exp-assignment-context")||"";return{headerRequestId:t.get("x-request-id")||"",gitHubRequestId:t.get("x-github-request-id")||"",completionId:e&&e.id?e.id:"",created:e&&e.created?e.created:0,serverExperiments:r&&n?`${r};${n}`:r||n,deploymentId:t.get("azureml-model-deployment")||""}}a(q_c,"getRequestId");function j_c(t){if(typeof t!="object"||t===null||!("details"in t))return!1;let{details:e}=t;return typeof e=="object"&&e!==null&&"type"in e&&"description"in e&&typeof e.type=="string"&&typeof e.description=="string"}a(j_c,"isCopilotAnnotation");function H_c(t){if(typeof t!="object"||t===null||!("citations"in t))return!1;let{citations:e}=t;return typeof e=="object"&&e!==null&&"url"in e&&"license"in e&&typeof e.url=="string"&&typeof e.license=="string"}a(H_c,"isCodeCitationAnnotation");function G_c(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(G_c,"isCopilotWebReference");function $_c(t){return"type"in t&&t.type===Q_c.openAIContextManagementCompactionType}a($_c,"isOpenAIContextManagementResponse");function V_c(t){return"applied_edits"in t}a(V_c,"isAnthropicContextManagementResponse");function W_c(t){return t.function!==void 0}a(W_c,"isOpenAiFunctionTool")});var P9i=I(PN=>{"use strict";p();Object.defineProperty(PN,"__esModule",{value:!0});PN.asyncIterableMap=z_c;PN.asyncIterableFilter=Y_c;PN.asyncIterableMapFilter=K_c;PN.asyncIterableFromArray=J_c;PN.asyncIterableToArray=Z_c;PN.asyncIterableConcat=X_c;PN.asyncIterableCount=eEc;PN.iterableMap=tEc;PN.iterableMapFilter=rEc;async function*z_c(t,e){for await(let r of t)yield e(r)}a(z_c,"asyncIterableMap");async function*Y_c(t,e){for await(let r of t)await e(r)&&(yield r)}a(Y_c,"asyncIterableFilter");async function*K_c(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(K_c,"asyncIterableMapFilter");async function*J_c(t){for(let e of t)yield Promise.resolve(e)}a(J_c,"asyncIterableFromArray");async function Z_c(t){let e=[];for await(let r of t)e.push(r);return e}a(Z_c,"asyncIterableToArray");async function*X_c(...t){for(let e of t)yield*e}a(X_c,"asyncIterableConcat");async function eEc(t){let e=0;for await(let r of t)e++;return e}a(eEc,"asyncIterableCount");function*tEc(t,e){for(let r of t)yield e(r)}a(tEc,"iterableMap");function*rEc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(rEc,"iterableMapFilter")});var D9i=I($Or=>{"use strict";p();Object.defineProperty($Or,"__esModule",{value:!0});$Or.getKey=iEc;function nEc(t,e){return t!==null&&typeof t=="object"&&e in t}a(nEc,"hasKey");function iEc(t,e){return nEc(t,e)?t[e]:void 0}a(iEc,"getKey")});var YOr=I(Wm=>{"use strict";p();var oEc=Wm&&Wm.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},BV=Wm&&Wm.__param||function(t,e){return function(r,n){e(r,n,t)}},VOr;Object.defineProperty(Wm,"__esModule",{value:!0});Wm.LiveOpenAIFetcher=Wm.CMDQuotaExceeded=Wm.OpenAIFetcher=Wm.ICompletionsOpenAIFetcherService=Wm.CopilotUiKind=void 0;Wm.sanitizeRequestOptionTelemetry=F9i;Wm.postProcessChoices=U9i;var sEc=rE(),aEc=C9i(),cEc=FD(),_3e=ibt(),lEc=PU(),N9i=bh(),uEc=an(),dEc=pd(),fEc=S2(),pEc=E5(),hEc=Lg(),mEc=Ks(),gEc=uye(),AEc=zyt(),M9i=eE(),yEc=P9i(),B9i=Gl(),_Ec=QCt(),O9i=C_e(),EEc=tbt(),vEc=POr(),NI=nA(),CEc=sBe(),bEc=Jne(),y3e=D9i(),sbt=bBe(),pA=new B9i.Logger("fetchCompletions"),abt;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(abt||(Wm.CopilotUiKind=abt={}));function SEc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(SEc,"getProcessingTime");function TEc(t){switch(t){case abt.GhostText:return"copilot-ghost";case abt.Panel:return"copilot-panel"}}a(TEc,"uiKindToIntent");Wm.ICompletionsOpenAIFetcherService=(0,uEc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var cbt=class{static{a(this,"OpenAIFetcher")}};Wm.OpenAIFetcher=cbt;function IEc(t,e,r,n){return(0,_Ec.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(IEc,"getProxyEngineUrl");function F9i(t,e,r,n){for(let[o,s]of Object.entries(t)){if(r.includes(o))continue;let c=s;if(o==="extra"&&n){let l={...c};for(let u of n)delete l[u];c=l}e.properties[`request.option.${o}`]=JSON.stringify(c)??"undefined"}}a(F9i,"sanitizeRequestOptionTelemetry");function U9i(t){return(0,yEc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(U9i,"postProcessChoices");Wm.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var WOr=VOr=class extends cbt{static{a(this,"LiveOpenAIFetcher")}#e;constructor(e,r,n,o,s,c,l,u){super(),this.instantiationService=e,this.runtimeModeService=r,this.logTargetService=n,this.copilotTokenManager=o,this.statusReporter=s,this.authenticationService=c,this.fetchService=l,this.envService=u}async fetchAndStreamCompletions(e,r,n,o){if(this.#e)return{type:"canceled",reason:this.#e};let s="completions",c=this.copilotTokenManager.token??await this.copilotTokenManager.getToken(),l={prompt:e.prompt.prefix,suffix:e.prompt.suffix,max_tokens:(0,sbt.getMaxSolutionTokens)(),temperature:(0,sbt.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,sbt.getTopP)(),n:e.count,stop:(0,sbt.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,vEc.tryGetGitHubNWO)(e.repoInfo);if(u!==void 0&&(l.nwo=u),e.postOptions&&Object.assign(l,e.postOptions),e.prompt.context&&e.prompt.context.length>0&&(l.extra.context=e.prompt.context),await(0,CEc.delay)(0),o?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"}}{let u=e.prompt,d=e.engineModelId,f=e.ourRequestId,h=r,m=e.uiKind,g=e.headers,A=this.instantiationService.invokeFunction(IEc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,NI.telemetrizePromptLength)(u));F9i(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(NI.telemetry,"request.sent",y);let _=TEc(m),E;E={...g,...this.instantiationService.invokeFunction(M9i.editorVersionHeaders)},E["Openai-Organization"]="github-copilot",E["X-Request-Id"]=f,E["VScode-SessionId"]=this.envService.sessionId,E["VScode-MachineId"]=this.envService.machineId,E["X-GitHub-Api-Version"]=M9i.apiVersion,_&&(E["OpenAI-Intent"]=_);let v=new pEc.StopWatch,S=o??fEc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,S,E).then(w=>w.isError()&&w.err instanceof _3e.Completions.Unexpected&&(0,O9i.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(NI.telemetry,"networking.disconnectAll"),this.fetchService.disconnectAll().then(()=>this.fetchService.fetch(A,c.token,l,f,S,E))):w);try{if(T.isError()){let x=T.err;if(x instanceof _3e.Completions.RequestCancelled)return this.instantiationService.invokeFunction(NI.telemetry,"networking.cancelRequest",NI.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(NI.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof _3e.Completions.UnsuccessfulResponse){let k=(0,lEc.getRequestId)(x.headers);y.extendWithRequestId(k),k.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(N9i.ITelemetryService).setSharedProperty("capi.assignmentcontext",k.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),pA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),pA.debug(this.logTargetService,"request.response properties",y.properties),pA.debug(this.logTargetService,"request.response measurements",y.measurements),pA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(NI.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof _3e.Completions.Unexpected){let k=x.error;if((0,O9i.isAbortError)(k))throw this.instantiationService.invokeFunction(NI.telemetry,"request.cancel",y),k;this.statusReporter.setWarning((0,y3e.getKey)(k,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(NI.telemetry,"request.shownWarning",D),y.properties.message=String((0,y3e.getKey)(k,"name")??""),y.properties.code=String((0,y3e.getKey)(k,"code")??""),y.properties.errno=String((0,y3e.getKey)(k,"errno")??""),y.properties.type=String((0,y3e.getKey)(k,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,pA.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(k)} after ${N}ms`),pA.debug(this.logTargetService,"request.error properties",y.properties),pA.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(NI.telemetry,"request.error",y),k}else(0,dEc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(N9i.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let k=v.elapsed();y.measurements.totalTimeMs=k;let D=200;pA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${k}ms`),y.properties.status=String(D),pA.debug(this.logTargetService,"request.response properties",y.properties),pA.debug(this.logTargetService,"request.response measurements",y.measurements),pA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(NI.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(k=>pA.exception(k,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=VOr.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:U9i(R),getProcessingTime:a(()=>SEc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(NI.logEnginePrompt,u,y)}}}static async*convertStreamToApiChoices(e,r,n,o){let s=a((l,u,d,f,h)=>({choiceIndex:l,completionText:u,requestId:e.requestId,finishReason:d,tokens:f.chunks,numTokens:f.chunks.length,blockFinished:h,telemetryData:n,clientCompletionId:(0,hEc.generateUuid)(),meanLogProb:void 0,meanAlternativeLogProb:void 0,copilotAnnotations:f.annotations.current}),"createAPIChoice"),c=[];try{for await(let l of e.stream){if(o?.isCancellationRequested)return;for(let u=0;u-1,y;if((m||A)&&(y=await r(f.accumulator.responseSoFar,{index:d,text:f.accumulator.responseSoFar,finished:m,requestId:e.requestId,telemetryData:n,annotations:f.accumulator.annotations,getAPIJsonData:a(()=>({text:f.accumulator.responseSoFar,tokens:f.accumulator.chunks,finish_reason:f.accumulator.finishReason??"stop",copilot_annotations:f.accumulator.annotations.current}),"getAPIJsonData")}),o?.isCancellationRequested))return;if(m&&(y===void 0||typeof y!="object"?y={yieldSolution:!0,continueStreaming:!1}:(y.yieldSolution=!0,y.continueStreaming=!1)),y!==void 0&&(typeof y=="number"||y.yieldSolution)){let _=m||typeof y=="number"||y!==void 0&&!y.continueStreaming;f.isFinished=_;let E=l.choices[u].finish_reason;E&&(f.accumulator.finishReason=E);let v=typeof y=="number"?y:y&&y.finishOffset!==void 0?y.finishOffset:void 0,S=v===void 0?f.accumulator.responseSoFar:f.accumulator.responseSoFar.slice(0,v);if(f.yielded||(f.yielded=!0,yield s(d,S,f.accumulator.finishReason??"stop",f.accumulator,v!==void 0)),o?.isCancellationRequested)return}}}for(let[l,u]of c.entries())if(!u.isFinished){if(await r(u.accumulator.responseSoFar,{index:l,text:u.accumulator.responseSoFar,finished:!0,requestId:e.requestId,telemetryData:n,annotations:u.accumulator.annotations,getAPIJsonData:a(()=>({text:u.accumulator.responseSoFar,tokens:u.accumulator.chunks,finish_reason:u.accumulator.finishReason??"stop",copilot_annotations:u.accumulator.annotations.current}),"getAPIJsonData")}),o?.isCancellationRequested)return;if(u.yielded)continue;if(u.yielded=!0,yield s(l,u.accumulator.responseSoFar,u.accumulator.finishReason??"stop",u.accumulator,!1),o?.isCancellationRequested)return}}finally{try{await e.destroy()}catch{}}}async handleError(e,r,n,o){let s=await n.text();if(n.status===402){this.#e="monthly free code completions exhausted",e.setError("Completions limit reached",{command:Wm.CMDQuotaExceeded,title:"Learn More"});let l=(0,AEc.onCopilotToken)(this.authenticationService,u=>{this.#e=void 0,u.isCompletionsQuotaExceeded||(e.forceNormal(),l.dispose())});return{type:"failed",reason:this.#e}}if(n.status===466)return e.setError(s),pA.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(L9i(n)&&!n.headers.get("x-github-request-id")){let c=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;pA.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else L9i(n)?(pA.warn(this.logTargetService,`Response status was ${n.status}:`,s),e.setWarning(`Last response was a ${n.status} error: ${s}`),r.properties.error=`Response status was ${n.status}: ${s}`):(e.setWarning(`Last response was a ${n.status} error`),r.properties.error=`Response status was ${n.status}`);return r.properties.status=String(n.status),this.instantiationService.invokeFunction(NI.telemetry,"request.shownWarning",r),n.status===401||n.status===403?(this.copilotTokenManager.resetToken(n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`}):n.status===429?(setTimeout(()=>{this.#e=void 0},10*1e3),this.#e="rate limited",pA.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(pA.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(pA.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};Wm.LiveOpenAIFetcher=WOr;Wm.LiveOpenAIFetcher=WOr=VOr=oEc([BV(0,mEc.IInstantiationService),BV(1,bEc.ICompletionsRuntimeModeService),BV(2,B9i.ICompletionsLogTargetService),BV(3,gEc.ICompletionsCopilotTokenManager),BV(4,EEc.ICompletionsStatusReporter),BV(5,sEc.IAuthenticationService),BV(6,_3e.ICompletionsFetchService),BV(7,cEc.IEnvService)],WOr);function L9i(t){return t.status>=400&&t.status<500}a(L9i,"isClientError");var zOr=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new aEc.StreamCopilotAnnotations}get responseSoFar(){return this._responseSoFar}get chunks(){return this._chunks}set finishReason(e){this._finishReason=e}get finishReason(){return this._finishReason}append(e){let r=e.text;r&&(this._chunks.push(r),this._responseSoFar=this._responseSoFar+r),e.copilot_annotations&&this.annotations.update(e.copilot_annotations)}}});var JOr=I(KOr=>{"use strict";p();Object.defineProperty(KOr,"__esModule",{value:!0});KOr.appendToCache=xEc;function xEc(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(xEc,"appendToCache")});var G9i=I(lf=>{"use strict";p();var wEc=lf&&lf.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},bie=lf&&lf.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(lf,"__esModule",{value:!0});lf.CompletionsFromNetwork=lf.logger=void 0;lf.postProcessChoices=lbt;lf.makeGhostAPIChoice=H9i;lf.telemetryPerformance=t5r;var E3e=R_e(),REc=gv(),v3e=xT(),kEc=pd(),PEc=dI(),DEc=Ks(),Q9i=eE(),NEc=DRr(),MEc=xy(),j9i=Gl(),OEc=KMr(),XOr=YOr(),LEc=bBe(),BEc=nA(),FEc=Jne(),UEc=Yye(),ZOr=JOr(),QEc=cBe(),q9i=oV(),DN=Zye();lf.logger=new j9i.Logger("ghostText");var e5r=class{static{a(this,"CompletionsFromNetwork")}constructor(e,r,n,o,s,c,l){this.instantiationService=e,this.fetcherService=r,this.featuresService=n,this.runtimeMode=o,this.logTarget=s,this.completionsCacheService=c,this.userErrorNotifier=l}async getCompletionsFromNetwork(e,r,n,o,s){return this.genericGetCompletionsFromNetwork(e,r,n,o,s,"completions",async(c,l,u)=>{let f=await u[Symbol.asyncIterator]().next();if(f.done)return lf.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,DN.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return lf.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,DN.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return lf.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,DN.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction(t5r,"performance",h,c,l),lf.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=lbt(h);m&&((0,ZOr.appendToCache)(this.completionsCacheService,e,m),lf.logger.debug(this.logTarget,`GhostText first completion (index ${m?.choiceIndex}): ${JSON.stringify(m?.completionText)}`));let g=(async()=>{let A=m!==void 0?[m]:[];for await(let y of u){if(y===void 0)continue;lf.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let _=lbt(y,A);_&&(A.push(_),(0,ZOr.appendToCache)(this.completionsCacheService,e,_))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[H9i(m,{forceSingleLine:!1}),g],telemetryData:(0,DN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:q9i.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,DN.mkBasicResultTelemetry)(r)}})}async getAllCompletionsFromNetwork(e,r,n,o,s){return this.genericGetCompletionsFromNetwork(e,r,n,o,s,"all completions",async(c,l,u)=>{let d=[];for await(let f of u){if(n?.isCancellationRequested)return lf.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,DN.mkCanceledResultTelemetry)(r)};let h=lbt(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,ZOr.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction(t5r,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,DN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:q9i.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new E3e.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=v3e.Result.ok(void 0);break;case"canceled":f=v3e.Result.error(new E3e.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=v3e.Result.error(new E3e.NoNextEditReason.NoSuggestions(new PEc.StringText(""),void 0));break;case"failed":f=v3e.Result.error(new E3e.NoNextEditReason.Uncategorized(REc.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=v3e.Result.error(new E3e.NoNextEditReason.GotCancelled(d.reason));break;default:(0,kEc.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){lf.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,LEc.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,Q9i.shouldDoServerTrimming)(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},h={n:u,temperature:d,code_annotations:!1},m=this.featuresService.modelAlwaysTerminatesSingleline(r),g=e.blockMode===Q9i.BlockMode.MoreMultiline&&UEc.BlockTrimmer.isSupported(e.languageId)&&!m;!e.multiline&&!g?h.stop=[` +`]:e.stop&&(h.stop=e.stop),e.maxTokens!==void 0&&(h.max_tokens=e.maxTokens);let A=Date.now(),y={endpoint:"completions",uiKind:XOr.CopilotUiKind.GhostText,temperature:JSON.stringify(d),n:JSON.stringify(u),stop:JSON.stringify(h.stop)??"unset",logit_bias:JSON.stringify(null)};Object.assign(r.properties,y);try{let _={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:u,uiKind:XOr.CopilotUiKind.GhostText,postOptions:h,headers:e.headers,extra:f},E=await this.fetcherService.fetchAndStreamCompletions(_,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:(0,DN.mkBasicResultTelemetry)(r)}:E.type==="canceled"?(lf.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:(0,DN.mkCanceledResultTelemetry)(r)}):l(A,E.getProcessingTime(),E.choices)}catch(_){if((0,OEc.isAbortError)(_))return{type:"canceled",reason:"network request aborted",telemetryData:(0,DN.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(E=>lf.logger.exception(E,_,"Error on ghost text request")),this.userErrorNotifier.notifyUser(_),this.runtimeMode.shouldFailForDebugPurposes())throw _;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,DN.mkBasicResultTelemetry)(r)}}}};lf.CompletionsFromNetwork=e5r;lf.CompletionsFromNetwork=e5r=wEc([bie(0,DEc.IInstantiationService),bie(1,XOr.ICompletionsOpenAIFetcherService),bie(2,MEc.ICompletionsFeaturesService),bie(3,FEc.ICompletionsRuntimeModeService),bie(4,j9i.ICompletionsLogTargetService),bie(5,QEc.ICompletionsCacheService),bie(6,NEc.ICompletionsUserErrorNotifierService)],e5r);function lbt(t,e){if(e||(e=[]),t.completionText=t.completionText.trimEnd(),!!t.completionText&&e.findIndex(r=>r.completionText.trim()===t.completionText.trim())===-1)return t}a(lbt,"postProcessChoices");function H9i(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` `)[1]:r.completionText=n.split(` -`)[0]}return r}a(q9i,"makeGhostAPIChoice");function e5r(t,e,r,n,o){let s=Date.now()-n,c=s-o,l=r.telemetryData.extendedBy({},{completionCharLen:r.completionText.length,requestTimeMs:s,processingTimeMs:o,deltaMs:c,meanLogProb:r.meanLogProb||NaN,meanAlternativeLogProb:r.meanAlternativeLogProb||NaN});l.extendWithRequestId(r.requestId),(0,OEc.telemetry)(t,`ghostText.${e}`,l)}a(e5r,"telemetryPerformance")});var H9i=I(lbt=>{"use strict";p();Object.defineProperty(lbt,"__esModule",{value:!0});lbt.contextualFilterCharacterMap=void 0;lbt.contextualFilterCharacterMap={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95}});var G9i=I(t5r=>{"use strict";p();Object.defineProperty(t5r,"__esModule",{value:!0});t5r.multilineModelPredict=UEc;function UEc(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let _;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?_=.003325460510319164:_=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?_=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?_=.0697359767152808:t[230]>1e-35?_=.06513506845651572:_=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?_=.013616385013146277:_=.04171540100223404:_=-.04360396575094823:t[212]>1e-35?_=.025945477945627522:_=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?_=-.07856453318384411:_=-.014803893522351739:t[39]>1e-35?_=-.09185452630751932:t[149]>1e-35?_=-.07122426086157027:t[134]>1e-35?_=-.04231052091434186:t[227]>1e-35?_=-.029815824273994197:t[50]>1e-35?_=-.15736496271211153:t[222]>1e-35?_=-.02360285356956629:t[128]>1e-35?_=-.03922080193836443:t[136]>1e-35?_=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?_=-.0029736170756835783:_=-.06482902102259112:t[84]>1e-35?_=-.11340924635708383:t[94]>1e-35?_=-.03635703457792193:t[118]>1e-35?_=-.058181913914186034:t[126]>1e-35?_=-.062030576241517366:t[116]>1e-35?_=-.045086301850604006:t[25]>1e-35?_=-.031665223656767286:t[203]>1e-35?_=-.009444685731407691:_=.0112265153772187;let E;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?E=.022717227245241684:E=-.049700413274686266:E=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?E=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?E=-.12263724050601095:E=.0070743478891288035:t[288]>1e-35?E=-.050439138582109:E=.0255701593657891:E=-.005812703740580558:t[6]>49.50000000000001?E=-.008542694147899113:E=.035147383686665:E=-.0960461939274094:t[32]>1e-35?E=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?E=-.01800870272656664:E=-.07817304234604389:t[30]>1e-35?E=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?E=.08778416018479411:E=-.026563982720830256:E=-.05296139548112329:t[50]>1e-35?E=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?E=-.036572140520852024:t[183]>1e-35?E=-.10766853736801459:E=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?E=.09513215942486053:E=-.03641865277445567:t[10]>59.50000000000001?E=.03177172388687933:t[39]>1e-35?E=-.10234241303898953:t[243]>1e-35?E=-.02966738115984321:t[190]>1e-35?E=-.04312785336449181:t[118]>1e-35?E=-.05808521194081524:E=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let S;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?S=-.0024117174588695603:S=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?S=.04575380761203418:S=-.10025595041353463:t[15]>1e-35?S=.17705790384964004:S=.0073813837628615014:S=.07676373681392407:S=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?S=.07078572910026419:t[4]>23.500000000000004?S=.005513918674164821:S=.0206586476926392:t[0]>5269.500000000001?S=.07706773525822633:S=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?S=-.03204783603215824:S=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?S=-.0930246911392012:S=.011173087289703683:t[3]>24.500000000000004?S=.03281421918878597:S=.12449335091369843:t[204]>1e-35?S=.06634531187326123:S=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?S=-.041196758517013515:t[4]>7.500000000000001?S=-2942718111029724e-20:t[4]>6.500000000000001?S=.11953909558532852:S=.03188615019450534:t[122]>1e-35?S=-.0616037324662157:t[101]>1e-35?S=.027230889593349412:t[8]>4968.500000000001?S=-.1113986516540856:t[3]>2.5000000000000004?S=-.002045140426885727:t[129]>1e-35?S=.12641163374304432:S=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let k;t[306]>1e-35?t[149]>1e-35?k=-.1389218965136736:k=-.032218642644416894:t[13]>1e-35?k=.006465035217331847:t[50]>1e-35?k=-.1381687930130022:t[179]>1e-35?k=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?k=-.03262719498763048:k=.023342916702125613:t[191]>1e-35?k=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?k=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?k=-.09989343595668776:k=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?k=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?k=-.09165257825246746:t[9]>32.50000000000001?k=.02484870392366004:k=-.008499493096971395:t[8]>24.500000000000004?k=.02459679192828244:k=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?k=.0015644546318714849:k=-.06579524865022705:k=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?k=.03331853632960164:k=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?k=-.019091477207111116:k=.037878468575478504:t[94]>1e-35?k=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?k=.16919658785098224:t[243]>1e-35?k=-.06580584936754524:k=.01567555159935563:t[129]>1e-35?k=.06721746994993226:t[10]>32.50000000000001?k=-.046394462507797975:k=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let O;t[308]>1e-35?O=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?O=.023223358334607133:O=-.04383410185346742:O=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?O=.023406489302867494:O=-.085521220804058:O=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?O=.028120059780969632:O=-.04211009474298743:t[294]>1e-35?O=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?O=-.0993035220737934:O=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?O=.029770210551187937:O=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?O=.06421359317599738:O=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?O=.024368404612215164:O=-.04045232374803373:t[131]>1e-35?O=.017372701982485795:t[120]>1e-35?O=.08812710275150198:t[18]>1e-35?t[90]>1e-35?O=.18451364351180236:t[7]>33.50000000000001?O=-.03850813130183531:t[195]>1e-35?O=.06966114053446336:t[3]>16.500000000000004?O=-.0012869181693341211:t[0]>4242.500000000001?O=-.054625548611291035:O=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?O=.006302103427145562:O=.13967622319898698:t[121]>1e-35?O=-.038798585213145644:t[5]>4544.500000000001?O=-.08050498033009466:O=-.002986974112681435;let B;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?B=-.03461119351456781:B=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?B=-.12404435523286539:B=-.0034376913880382956:B=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?B=.0037507103585310234:B=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?B=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?B=-.04832024079663151:t[37]>1e-35?B=-.037103393468366934:B=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?B=.032539071163832034:t[5]>1643.5000000000002?B=.036408625378035665:t[0]>1500.5000000000002?B=-.1346358322854993:B=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?B=-.1133991164577881:t[9]>52.50000000000001?B=-.024478640359723122:B=.03673777861098756:B=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?B=.002583438691776944:B=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?B=-.02141222346712401:B=.06392462314316179:t[4]>12.500000000000002?B=.08700122294434816:t[8]>267.50000000000006?B=.056923170082743224:B=-.07716309825583327:t[32]>1e-35?B=-.03961343943752142:B=.002674914122888783:t[1]>42.50000000000001?B=-.05217539654421676:t[145]>1e-35?B=.09553630282946368:B=-.009424791262477729;let q;t[183]>1e-35?q=-.05753337139158443:t[308]>1e-35?q=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?q=-.10477869875380448:q=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?q=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?q=-.04442302951713574:q=.00012409888451734224:q=-.092199119633697:t[225]>1e-35?q=.13773072450201831:t[0]>2882.5000000000005?q=.0028540012229920533:t[298]>1e-35?q=.07134486044361629:q=.014297412329837425:t[145]>1e-35?q=.05608385321902638:t[92]>1e-35?q=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?q=-.0039957800609801315:q=.0776927564241081:t[203]>1e-35?q=-.05502900859432093:t[105]>1e-35?q=.06062892720841595:q=-.009574839629252128:t[31]>1e-35?q=.009488858841144216:t[23]>1e-35?t[20]>1e-35?q=.08818126313644752:t[8]>161.50000000000003?q=.014353968957885408:q=-.022240738532827903:t[210]>1e-35?q=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?q=-.043902062079383485:q=-.014741559220396223:q=-.00934935734853194:t[6]>32.50000000000001?q=.1514593126307404:q=.010771222510801532:t[10]>22.500000000000004?q=.01412495209334078:q=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let L;t[294]>1e-35?L=-.042529778074638265:t[266]>1e-35?L=-.1180276669679798:t[134]>1e-35?L=-.026818144353279623:t[183]>1e-35?L=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?L=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?L=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?L=-.03049646619610203:t[1]>50.50000000000001?L=.20634590755061122:L=.06956378103625731:t[0]>3770.5000000000005?L=-.07946414366134913:t[19]>1e-35?L=.17083312065604694:t[2]>21.500000000000004?L=-.02327981978127724:L=.129717297518715:t[145]>1e-35?L=.006891245076133524:L=-.0789123467863741:t[3]>99.50000000000001?L=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?L=.06447639919732716:L=-.05457561977645972:t[306]>1e-35?L=-.029995903305383882:t[191]>1e-35?L=.030596508110850414:t[242]>1e-35?L=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?L=.09518584795377832:L=-.018197744600833596:t[13]>1e-35?L=.006751790086127549:t[148]>1e-35?L=.01904174573618417:t[99]>1e-35?L=.025287735102561926:t[4]>14.500000000000002?L=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?L=-.09467943982430241:t[243]>1e-35?L=-.02521824751996268:L=.005437570718352172:L=-.022476214821960674;let U;t[0]>384.50000000000006?t[84]>1e-35?U=-.06088131453064195:t[147]>1e-35?U=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?U=.04219361472548491:U=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?U=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?U=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?U=-.11431764534511478:U=.013549717238356157:U=-.020987333767091276:t[6]>2.5000000000000004?U=-.02914877855133127:U=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?U=-.10087072787978416:t[37]>1e-35?U=-.030467397753331196:t[229]>1e-35?U=-.1017559811057469:t[4]>20.500000000000004?U=-.00413177742240167:t[20]>1e-35?U=.05213315982685969:U=.0037921635866823133:t[8]>51.50000000000001?U=.07327913092421544:t[6]>49.50000000000001?U=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?U=.02744420891894289:U=.11288946357194463:U=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?U=-.012329314369909049:U=.026816658655600168:U=-.0872405354618811:U=.007872673500247845:t[1]>42.50000000000001?U=-.04309044198258254:t[145]>1e-35?U=.07572529147860785:t[7]>5.500000000000001?U=-.013837187093264945:t[1]>17.500000000000004?U=.04208698439539668:U=-.06284346769019863;let j;t[294]>1e-35?j=-.0384794324818203:t[266]>1e-35?j=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?j=.07432960094940501:j=-.035248735855751855:t[134]>1e-35?j=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?j=-.01706896375068821:j=.08212247914968074:t[2]>59.50000000000001?j=-.09546478958824225:t[6]>53.50000000000001?j=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?j=.02816463285971267:j=.15449139016588445:j=-.10199787406123524:j=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?j=-.13924786681478077:j=-.0072772442570213335:t[39]>1e-35?j=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?j=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?j=-.11174465335620831:j=.00013144040097180107:j=-.08493919336681105:t[42]>1e-35?j=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?j=-.015540659878839153:j=-.14442609417300142:t[21]>1e-35?j=-.025251979447574083:j=.0023698372645272847:t[18]>1e-35?j=.07269739695712212:t[8]>2592.5000000000005?j=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?j=-.01835130329646532:t[9]>45.50000000000001?j=.02023047454629885:j=.16469378262221102:j=-.042975030085836426;let Q;t[8]>2915.5000000000005?t[297]>1e-35?Q=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?Q=-.01034964686484714:Q=-.07357437440667927:Q=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?Q=-.09476398869062203:t[9]>72.50000000000001?Q=-.0757383854264379:Q=.02806542779508718:Q=-.05147742568418084:Q=.10212721564444344:Q=.0518263760642861:Q=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?Q=-.10669213185972036:Q=.027050434286384796:t[302]>1e-35?Q=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?Q=.06354599160071946:t[1]>67.50000000000001?Q=.05317447949011187:Q=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?Q=-.09369289448773599:t[0]>2215.5000000000005?Q=.04077965380363924:t[0]>807.5000000000001?Q=-.0591771776458298:Q=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?Q=-.016323380219241672:Q=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?Q=.03720704290087811:Q=-.008730548158766654:t[4]>80.50000000000001?Q=-.05346644687473197:Q=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?Q=.019984510398089086:Q=-.03917825025861855:t[9]>170.50000000000003?Q=-.09759719821334525:Q=-.0023586682752856298;let Y;t[183]>1e-35?t[17]>1e-35?Y=.030100940443356424:t[10]>1.5000000000000002?Y=-.10861112216742408:Y=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?Y=-.032062878390325456:Y=-.10808232631806887:t[8]>1641.5000000000002?Y=-.06147013392655731:t[4]>12.500000000000002?Y=.03324767551088266:t[145]>1e-35?Y=.028851633810612017:Y=-.054871239091792784:t[134]>1e-35?Y=-.023813968121342108:t[266]>1e-35?Y=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?Y=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?Y=-.025350325484720576:Y=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?Y=.056817276537534815:Y=-.07674158463557636:Y=-.06335553143454145:t[1]>56.50000000000001?Y=.16390494217299284:Y=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?Y=.041717597065890205:Y=-.10357913492269129:t[10]>29.500000000000004?Y=.1365512866715726:Y=.020600048310575665:Y=.09708785634773187:Y=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?Y=-.03146213719547347:Y=.11784024316238083:Y=-.050940520532045355:Y=-.047988344143075616:t[191]>1e-35?Y=.028764654731460032:Y=.0011911575567860023;let W;t[294]>1e-35?t[10]>50.50000000000001?W=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?W=-.05103908560370243:W=.05002066201169583:W=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?W=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?W=.127983140816313:W=-.05436534163636867:W=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?W=-.009504203657088933:t[8]>819.5000000000001?W=.18689664822602375:W=.03635576744011826:W=-.029862411809998525:t[223]>1e-35?W=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?W=-.09405026597863717:t[0]>4153.500000000001?W=.053577663326799765:W=-.05062127873995668:W=.06512222894425874:t[39]>1e-35?W=-.04985311717827547:t[51]>1e-35?W=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?W=-.02860634573675884:W=.08863753005590103:W=.11158892111063744:t[0]>655.5000000000001?W=-.031005736641654926:W=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?W=-.00843386136334982:W=-.05273594615999777:W=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?W=-.015774115523598486:W=.10147367091236065:W=-.048307000563071016:W=.002118376117677254;let V;t[8]>1014.5000000000001?t[9]>137.50000000000003?V=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?V=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?V=.07211107542565391:V=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?V=-.0751486415451188:t[1]>59.50000000000001?V=.13459005084554104:V=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?V=.06715575425741895:V=-.005895690393702183:t[8]>2915.5000000000005?V=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?V=-.00029068886245881074:V=.0613467393188786:t[148]>1e-35?V=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?V=.003887223773199377:V=-.08553893131979015:V=.025654192706396767:V=-.05651733979610658:V=-.02039913645229667:t[2]>7.500000000000001?V=-.1058450646728524:V=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?V=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?V=.1283258201586378:V=-.01718135372229775:V=-.07702452408491414:t[125]>1e-35?V=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?V=.04273051857848212:V=-.04533122948101463:t[2]>196.50000000000003?V=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?V=.0231032972703664:V=-.04807386814498683:V=.002729435991332102;let z;t[179]>1e-35?z=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?z=.026484626664041125:t[10]>1.5000000000000002?z=-.10187000872941615:z=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?z=.09574540795390041:z=-.06454986703691233:z=-.11411849349353141:t[266]>1e-35?z=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?z=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?z=-.04403391373512386:z=.1132928075412222:t[2]>47.50000000000001?z=-.09700191391838056:z=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?z=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?z=-.001668912999010927:z=-.02363511102970245:t[8]>58.50000000000001?z=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?z=.0911011436534449:t[1]>28.500000000000004?z=-.07192390493729035:z=.06913818091291246:z=-.012312625373699222:z=.06784496312307986:z=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?z=.0026564453057705273:z=-.025425772389361445:t[122]>1e-35?z=-.12046786388602149:t[0]>3183.5000000000005?z=.01162092842804907:t[91]>1e-35?z=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?z=-.0001647792543020228:z=-.023664538532907665:z=.01609078206180752;let ie;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ie=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ie=-.017696526862422682:ie=.1450050954613223:ie=-.05406930069823832:ie=-.08308700260259043:t[120]>1e-35?ie=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ie=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ie=.038431826961746934:ie=-.05937462906539856:t[9]>65.50000000000001?ie=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ie=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ie=-.09579030954062734:ie=.025064711572811746:ie=.02579440518821548:ie=.1044440128091862:ie=-.058348633139536844:ie=.07766788227934436:ie=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ie=.07463684068207214:ie=.18244269035484484:t[6]>39.50000000000001?ie=-.06050050067471004:ie=.05787759066913493:ie=.010783225857972171:ie=.1674891243602606:t[4]>9.500000000000002?ie=-.004814132027475892:ie=-.14543299413454813:ie=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ie=-.07634466313617769:ie=.0287825335169114:ie=-.06894721943300268:ie=-.00023988459059521937;let H;t[131]>1e-35?t[1]>93.50000000000001?H=-.05706887458825395:t[2]>1.5000000000000002?H=.011446637886629108:H=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?H=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?H=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?H=.026278724448495064:H=.17053138400480508:t[0]>4463.500000000001?H=-.06482289890096041:H=.03026516489536295:H=-.031785170717683144:H=.1312690622980455:t[13]>1e-35?H=.14336922540461444:H=.03523850945454039:H=-.015407465968975714:t[39]>1e-35?H=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?H=-.0659975068798723:H=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?H=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?H=.057409156184759516:H=.2024322059866388:H=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?H=.010648654146284154:t[308]>1e-35?H=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?H=.12364025998551711:H=-.02247495081065243:t[1]>22.500000000000004?H=-.0726295464624251:H=.03481895086048152:t[0]>4331.500000000001?H=-.04775443357020673:H=.07172377425057568:t[2]>89.50000000000001?H=-.11782645274716962:H=.00010092665257989378;let re;t[147]>1e-35?re=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?re=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?re=-.016101990375700172:t[0]>2579.5000000000005?re=-.13045089661551845:re=-.02874367814784938:re=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?re=.17084176915326055:re=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?re=.10591712319944074:re=-.024082167264285:re=.16497698867036126:re=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?re=-.021012910475524206:re=-.13058422554298485:t[0]>1102.5000000000002?re=.10955864175201457:re=-.03566689354348996:t[1]>11.500000000000002?re=-.02093884208606101:re=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?re=-.013861861436128482:re=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?re=.10163873449625677:re=-.02779270277623805:t[1]>26.500000000000004?re=-.08035058228527389:re=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?re=-.007028075523033826:re=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?re=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?re=-.0032075580718124892:re=-.04442829143298883:re=-.06597073245775804:re=.0015594090939337751;let le;t[223]>1e-35?t[8]>668.5000000000001?le=-.12803889879260094:le=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?le=.08967966612917375:t[1]>39.50000000000001?le=-.059791671514498074:le=.05648934961902822:t[2]>59.50000000000001?le=-.08633234097449628:t[6]>53.50000000000001?le=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?le=.025606129643140924:le=.13835395886271978:le=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?le=-.09975506556937946:t[10]>36.50000000000001?le=-.09427724661655643:t[10]>24.500000000000004?le=.07329330653410447:le=-.02271182965807972:le=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?le=-.05082091374050816:le=.1687114435254966:t[0]>2314.5000000000005?le=-.06422664016383926:le=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?le=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?le=-.1274167728754332:le=.01308079126447365:t[4]>73.50000000000001?le=.13854015371106546:t[4]>48.50000000000001?le=-.03684255740123261:t[6]>45.50000000000001?le=.10329912215813097:t[10]>77.50000000000001?le=-.08630788656925215:le=.031022006843800853:t[1]>25.500000000000004?le=-.08278381528048026:le=.06664374548141594:t[84]>1e-35?le=-.05624227409079396:le=.00012184182357340415;let Le;t[179]>1e-35?Le=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Le=-.07595415373151816:Le=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Le=.022822510448266862:Le=.17491569312933697:Le=-.058362287133533565:t[2]>2.5000000000000004?Le=-.03633895806364428:Le=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Le=-.07294848747514579:Le=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Le=-.07009535282685533:t[8]>2640.0000000000005?Le=-.051761240111316276:t[131]>1e-35?Le=-.06245774419231631:Le=.03495606662854905:Le=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Le=.0015036626973581122:Le=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Le=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Le=.022343994371919224:Le=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Le=.07724450228328664:t[0]>3853.5000000000005?Le=-.15671707454435677:t[10]>28.500000000000004?Le=-.10179090671841723:Le=.014878216919760927:Le=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Le=.14054154485273487:Le=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Le=-.08632985141410315:Le=.005524157938954954:Le=-.08802502622523681:Le=-.0004649168897260341;let me;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?me=-.007458687464321174:me=-.09444966249102484:t[1]>23.500000000000004?me=.08564129697360716:me=-.07105002902845851:me=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?me=-.10326216566705966:t[1]>26.500000000000004?me=.0050539832484585365:me=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?me=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?me=.05783632021087773:t[10]>17.500000000000004?me=-.06720598671764105:t[1]>47.50000000000001?me=.097495825172558:me=-.013372242800584872:me=-.06463226787713715:t[42]>1e-35?me=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?me=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?me=.11051270080118503:me=.027719462817590454:t[8]>597.5000000000001?me=-.08441503592016869:me=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?me=-.12190088985091102:me=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?me=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?me=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?me=.016585157185448045:me=-.11032043771149425:me=.01586986028570486:t[8]>388.50000000000006?me=-.10592413013261853:me=.04930703248769364:t[13]>1e-35?me=.003621937787920821:me=-.0013786331198611841;let Oe;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Oe=.009769895322846493:Oe=-.10620052926943656:t[9]>19.500000000000004?Oe=.03781202525403449:t[9]>14.500000000000002?Oe=-.11485785321365344:t[9]>6.500000000000001?Oe=.07677177833073881:t[0]>4342.500000000001?Oe=-.07079285609687631:t[49]>1e-35?Oe=.06156814809246001:Oe=-.014788509042554625:Oe=-.032659201618470655:t[5]>5207.500000000001?Oe=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Oe=-.03094160322187924:t[1]>29.500000000000004?Oe=.09474646043921069:Oe=.023445783928231618:Oe=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Oe=-.07164443768784848:t[1]>29.500000000000004?Oe=.089473622509272:t[8]>597.5000000000001?Oe=-.08155349903101317:Oe=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Oe=-.004003900679358653:t[190]>1e-35?Oe=-.09236113461485262:t[8]>3198.5000000000005?Oe=-.0124130160451179:Oe=.018453070064009328:t[15]>1e-35?Oe=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Oe=-.0009580759587680961:Oe=-.03227283036698222:Oe=.01369287669536875:t[1]>50.50000000000001?Oe=-.04213060332500437:t[35]>1e-35?Oe=-.11508095777767471:t[190]>1e-35?Oe=-.08611884672400155:t[297]>1e-35?Oe=.05723551879433584:Oe=-.004829340082311461;let Te;t[183]>1e-35?Te=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Te=-.11753465135886734:Te=-.007515490299047085:Te=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Te=-.12371142493530439:t[1]>36.50000000000001?Te=.032189417575190435:Te=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Te=-.0784518658439288:t[2]>54.50000000000001?Te=.12477882322370665:Te=.000313468482399738:Te=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Te=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Te=.0353146070135579:Te=-.06327619611098285:Te=.02813577701641991:Te=-.12354390728506215:t[34]>1e-35?Te=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Te=-.01245803535276381:Te=-.07169472553475001:t[1]>11.500000000000002?Te=.12989984824561698:Te=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Te=.010390226893521422:t[10]>14.500000000000002?Te=.16790888126487719:Te=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Te=-.043398307129729134:Te=.09963544907820426:t[9]>30.500000000000004?Te=-.13540713124984502:t[9]>17.500000000000004?Te=.0509435850590757:Te=-.04761897852404613:t[4]>78.50000000000001?Te=.09197086656470652:Te=.0006771050176682337;let te;t[122]>1e-35?t[6]>36.50000000000001?te=.05686884451670743:te=-.05334759543084309:t[266]>1e-35?te=-.08603579519816038:t[157]>1e-35?te=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?te=-.0499592651503952:t[0]>725.5000000000001?te=.11780353905132664:te=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?te=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?te=-.03190157229022304:te=.07985197845805492:te=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?te=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?te=-.027174047777029083:te=.057117284879796476:t[3]>43.50000000000001?te=-.0016147040913107311:te=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?te=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?te=-.01466076988151239:te=.13375695925484857:te=-.04885873081899647:t[0]>5566.500000000001?te=.11086813028591343:t[8]>992.5000000000001?te=-.07622304217072383:te=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?te=.03285858361708423:te=-.12354858211764992:te=.0672788301823281:t[15]>1e-35?te=.08658836986585006:te=-.02741484278509758:t[290]>1e-35?te=-.08161310335133287:t[135]>1e-35?te=-.04824156054814152:te=.0009156904299554183;let ee;t[3]>7.500000000000001?ee=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ee=.03642374718166293:ee=.16379973756366603:ee=-.03946685266127979:t[186]>1e-35?ee=.07618896623420895:t[96]>1e-35?ee=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?ee=-.022822371600847505:ee=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?ee=.044416424920571296:ee=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?ee=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?ee=.1061937286809567:t[7]>54.50000000000001?ee=.11487507743121311:t[8]>819.5000000000001?ee=-.07181278009001418:t[10]>25.500000000000004?ee=.13499019430369633:t[1]>31.500000000000004?ee=.09032979489780704:ee=-.12754166393372374:t[9]>37.50000000000001?ee=-.05093963635361407:ee=-.005026651151683848:t[9]>2.5000000000000004?ee=.07619735785573735:ee=.012363301341532136:t[26]>1e-35?ee=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?ee=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?ee=-.10764172927882483:ee=.01890760098464703:ee=.06573095405846417:t[8]>634.5000000000001?ee=-.00783575973273707:ee=-.050612689680229306:t[1]>22.500000000000004?ee=-.0016842490401359626:ee=.0738227088444087:ee=-.02663970950432175;let K;t[31]>1e-35?t[8]>17.500000000000004?K=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?K=.007191286124908192:K=-.09347881647636902:t[10]>1.5000000000000002?K=.07938758708008091:K=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?K=.12321804057595996:K=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?K=-.04644244754790671:K=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?K=.0706108609273337:t[2]>40.50000000000001?K=-.028046629962303716:K=-.06497613993109329:K=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?K=-.03056331974267756:K=-.11886389712497057:K=.053364962175658184:t[8]>2233.5000000000005?K=-.0448152521157682:K=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?K=.03818796510453344:K=.23673992112982362:K=.02858814226507374:t[10]>44.50000000000001?K=-.1125863771551199:K=.009129996952394916:t[1]>7.500000000000001?K=-.004374525302461639:K=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?K=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?K=-.13677189943034931:t[10]>2.5000000000000004?K=.039591891437078086:K=-.09312596849507347:K=-.02423172142089822:K=.0009836986075266283;let he;t[189]>1e-35?t[0]>5269.500000000001?he=-.103183298350443:t[2]>51.50000000000001?he=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?he=-.05186168947388339:he=.0496996365539082:t[10]>23.500000000000004?he=.1404445738719:t[93]>1e-35?he=.0027146310074558505:t[5]>3821.5000000000005?he=.002153033152069652:t[4]>2.5000000000000004?he=.007663539551317215:he=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?he=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?he=-.021479467709980358:he=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?he=.021660293256233334:he=-.0927396152303864:he=.0665074081601698:t[0]>1550.5000000000002?he=.08972407105958534:he=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?he=.06761927942466854:he=-.015762168112653286:t[17]>1e-35?he=.10311304131145381:he=-.017672785252336027:he=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?he=-.10638321435298535:he=.0007073011744385905:t[18]>1e-35?he=-.027056185501334325:t[145]>1e-35?he=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?he=.09762140519655171:t[9]>110.50000000000001?he=-.06581942957595835:t[6]>54.50000000000001?he=.04959634035251596:he=.0022616298654554207:he=-.007437620924990854;let X;t[179]>1e-35?X=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?X=.1470294450403005:X=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?X=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?X=.07965955447707423:t[10]>10.500000000000002?X=-.09236156404262426:X=.03396273196231458:X=-.13246465021467432:X=.07092822261735353:X=-.08753829085942:X=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?X=.004705878789890202:X=.13775378964952867:X=-.04770928980587811:t[10]>29.500000000000004?X=.011221519891071544:t[0]>3853.5000000000005?X=.06365381191628273:X=.15506252245336827:t[1]>37.50000000000001?X=-.07254777021042061:X=.026514587757252385:t[308]>1e-35?X=.04115804816617256:t[10]>26.500000000000004?X=.02077721353011946:t[5]>3548.5000000000005?X=-.1280907116663952:X=-.021974774274438:t[306]>1e-35?X=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?X=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?X=-.005710865560475598:t[94]>1e-35?X=-.06751507982853555:X=.027250040757588703:t[9]>52.50000000000001?X=.07060357924595577:X=-.030297760713011795:X=-.0006005400085266517;let de;t[113]>1e-35?de=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?de=-.06996356565314456:de=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?de=-.08317707559926495:t[21]>1e-35?de=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?de=-.010538203005984922:de=.08454819465349446:t[9]>124.50000000000001?de=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?de=-.08542251249346582:t[9]>50.50000000000001?de=-.023428882537657472:de=.010042500833979073:de=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?de=.03006025206979096:t[9]>108.50000000000001?de=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?de=.04222035773042132:de=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?de=-.07209095448054853:de=.028065954981903313:de=.08714651929917122:de=-.006678820669279169:t[10]>40.50000000000001?de=.006982396294941626:de=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?de=-.09351114982645548:t[4]>3.5000000000000004?de=-.004837550129223451:de=-.08324141237464677:t[303]>1e-35?de=.10703037493990825:t[9]>156.50000000000003?de=-.10803018621648303:t[116]>1e-35?de=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?de=.10261721665006701:de=.018994509090668264:de=.0011244262442038839;let Be;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?Be=-.08404263465005328:t[0]>3682.5000000000005?Be=.041259223920298876:t[1]>29.500000000000004?Be=-.09541257493441671:Be=.001482192721625409:Be=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?Be=-.08268996098437432:t[230]>1e-35?Be=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?Be=-913218977737457e-19:t[4]>10.500000000000002?Be=-.056334165674005156:t[127]>1e-35?Be=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?Be=-.04231200150318989:t[10]>42.50000000000001?Be=.10182973257894812:Be=.015934763950068445:Be=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?Be=-.041117068322885315:Be=.1167767830037126:Be=.13611206992387337:t[10]>41.50000000000001?Be=-.07120286010564107:Be=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?Be=-.07702290997669524:t[198]>1e-35?Be=.08776558554437136:Be=-.008290740324975692:t[2]>32.50000000000001?Be=.07198457624219955:Be=.005463113714361629:Be=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Be=.03295785445437507:Be=.15140250150674536:Be=-.035613213948910254:t[186]>1e-35?Be=.06849425535860769:t[96]>1e-35?Be=.06028225812727254:Be=-.007582543288662308;let ne;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ne=.08396556264106572:ne=-.0562516995099192:ne=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ne=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ne=.0052017514017035915:ne=-.11194119432743639:ne=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ne=-.025692451287403446:ne=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ne=-.11892250746801664:t[10]>22.500000000000004?ne=.07548493166973796:ne=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ne=.13750699058082427:t[18]>1e-35?ne=.06535408879552801:ne=-.054118179035040674:ne=.1344282838979622:t[0]>3982.5000000000005?ne=-.10409582202467015:t[19]>1e-35?ne=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ne=.012705935670766466:ne=.14149359442527545:ne=-.047977876173706004:t[20]>1e-35?ne=.057945228080337946:t[0]>3642.5000000000005?ne=-.008726535792122467:ne=-.08424769891378858:t[34]>1e-35?ne=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ne=.01196849566739346:ne=.1614642278429876:ne=-.043022338150701625:t[3]>5.500000000000001?ne=-.03907848255033881:ne=.018280601026175593:ne=.0006654540402589085;let ue;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ue=-.01386103677247845:ue=.11386694333005128:t[4]>27.500000000000004?ue=-.021862617610091336:t[2]>31.500000000000004?ue=.0828858469030438:ue=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ue=.11303635767048735:ue=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ue=-.04238798044549342:ue=.022091190130494303:t[5]>5082.500000000001?ue=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ue=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ue=-.04291104140431434:t[17]>1e-35?ue=.11256797532342613:ue=-.017206916368289193:ue=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ue=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ue=.03581712466863222:ue=.14770264307668884:t[8]>73.50000000000001?ue=-.13093289429740068:ue=.042461737442702936:t[52]>1e-35?ue=.0501831919044939:ue=-.010450249720465756:ue=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ue=.0005381332165438493:ue=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ue=.04849637311285226:ue=-.036671377119808564:t[0]>421.50000000000006?ue=.00020968499911058945:ue=.11636422423182405:ue=-.12687837788222575:ue=.0012774367867215346;let Ne;t[120]>1e-35?Ne=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ne=-.042799574885345304:Ne=.07412430171193245:Ne=-.11248270469336048:t[193]>1e-35?Ne=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ne=.028911612178122104:Ne=.12326369727728437:t[0]>4091.5000000000005?Ne=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ne=.1159839898100149:Ne=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ne=-.0216343737351583:Ne=-.1220272260878369:t[2]>18.500000000000004?Ne=.09152924475072398:t[8]>55.50000000000001?Ne=.039508716651005665:Ne=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ne=.06793009902674053:Ne=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ne=-.04391068849624096:Ne=.04009967593394672:t[8]>1085.5000000000002?Ne=-.024773826356034825:Ne=-.13919707884246582:Ne=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ne=-.11567917501901476:Ne=-.006813640337684114:t[3]>7.500000000000001?Ne=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ne=-.001754586408351048:Ne=-.055422422450722056:Ne=-.06090032532532226:t[0]>5269.500000000001?Ne=.11787981735983527:Ne=-.00198119768540783:Ne=.00210412924303036;let xe;t[294]>1e-35?t[10]>50.50000000000001?xe=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?xe=-.06063239096209816:xe=.03317022411417386:xe=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?xe=-.013608609329298802:xe=.09078000157330264:t[99]>1e-35?xe=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?xe=-.07536137260189814:xe=.006253266595455118:t[10]>28.500000000000004?xe=-.006106041147592768:t[9]>156.50000000000003?xe=-.11828932797811101:t[94]>1e-35?xe=-.02566078479505714:t[303]>1e-35?xe=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?xe=-.08401252789168523:t[5]>4244.500000000001?xe=.026372887658499107:t[1]>16.500000000000004?xe=-.027836756345634026:xe=.09205362097909099:xe=.00934612788718244:t[203]>1e-35?xe=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?xe=-.09580979052540028:t[1]>50.50000000000001?xe=-.06402211827281554:xe=.08342858760095972:t[2]>36.50000000000001?xe=.008114897658204584:t[92]>1e-35?xe=.09541587072672864:xe=-.022342147210555434:xe=-.01660492519175128:xe=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?xe=.15846731118501817:xe=.039498507912023195:t[245]>1e-35?xe=.07008718676813333:xe=.0019806389728814727;let Fe;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Fe=-.01192072916082109:Fe=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Fe=.06874032717466054:t[4]>40.50000000000001?Fe=-.07752510020707537:t[1]>76.50000000000001?Fe=-.09944032260703917:t[8]>1381.5000000000002?Fe=-.054466635810800745:t[1]>32.50000000000001?Fe=.05974084520839573:Fe=-.0384718740755954:Fe=-.11374190719134032:t[0]>2151.5000000000005?Fe=-.13703645155803298:Fe=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Fe=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Fe=.013539805885738608:Fe=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Fe=.09941880179344399:Fe=-.01608127391210995:Fe=.08025226531247417:t[9]>67.50000000000001?Fe=.13525448212444113:t[6]>61.50000000000001?Fe=-.05511099182158894:t[94]>1e-35?Fe=-.06821509831783572:t[128]>1e-35?Fe=.11361314817714643:Fe=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Fe=-.09954181329804547:t[197]>1e-35?Fe=.10102833149755386:t[188]>1e-35?Fe=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Fe=-.03781554214742005:Fe=.09927933385592314:Fe=-.020006000056720083:Fe=-.10520473615957895:Fe=-.12006990846253787:Fe=-.00026111570975317574;let tt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[0]>1725.5000000000002?t[7]>14.500000000000002?t[2]>38.50000000000001?tt=-.019188245509744628:tt=-.13354864350075848:t[0]>2461.5000000000005?tt=.051885477468354396:tt=-.0833581968852119:tt=.08233441701532287:tt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?tt=.09926337893072812:tt=-.027753610497327715:t[0]>1972.5000000000002?tt=-.09780045823152517:tt=.032380915168504935:tt=.11502632261226381:t[17]>1e-35?tt=-.06094965899579662:t[10]>40.50000000000001?tt=-.07500475582440802:tt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?tt=-.09584538995220808:tt=-.00908705814304442:tt=.03203281520813893:t[10]>49.50000000000001?tt=-.03146271513986384:t[2]>63.50000000000001?tt=.13172001315536286:t[224]>1e-35?tt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?tt=.09521549382082259:tt=-.04414925613522197:t[0]>1847.5000000000002?tt=-.09118580379557353:tt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?tt=.03525144509943896:tt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?tt=-.04766112322938157:t[2]>10.500000000000002?tt=.0728516504357201:tt=-.05049625965272536:tt=-.10868663055825774:tt=.0005382613419948969;let st;t[147]>1e-35?t[1]>53.50000000000001?st=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?st=-.030504020655417463:st=.07102458639110094:st=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?st=.055304563442710876:t[1]>53.50000000000001?st=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?st=-.1568835288372895:st=-.0279829124400056:st=.04493843959601833:st=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?st=-.054133834303687026:t[9]>48.50000000000001?st=.11263810289007213:t[9]>9.500000000000002?st=-.02202034562838259:t[4]>45.50000000000001?st=-.03410927569045158:st=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?st=-.029687297407295893:st=.10673602850001934:t[4]>42.50000000000001?st=.0036275562945108117:st=-.0760789221330622:st=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?st=.08274426793676076:st=-.07076234425516396:st=.13890177606150175:st=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?st=-.09250637750836187:st=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?st=-.01897867921812603:st=.04890781705365262:st=-.11569892307597907:t[2]>106.50000000000001?st=.09032697440623969:st=.00047935919155035045;let vt;t[115]>1e-35?vt=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?vt=-.10131179514695865:t[8]>938.5000000000001?vt=.10203729808015481:vt=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?vt=.03574015165562999:vt=-.07763042506449493:vt=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?vt=.0665706259130275:vt=-.06586817559309924:vt=.11925564412287476:vt=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?vt=.046017146627455346:vt=-.08623321630086885:t[8]>1765.5000000000002?vt=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?vt=.11143827902215087:vt=-.01817808730473413:vt=.16980985030210127:vt=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?vt=.010168994879727824:vt=-.09099594488792513:t[9]>1.5000000000000002?vt=.0533459678147928:vt=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?vt=-.062346959148773695:t[1]>47.50000000000001?vt=-.0021578343835599316:t[2]>27.500000000000004?vt=.19567373210166172:vt=.07851555379116423:t[18]>1e-35?vt=.03711549097804649:t[8]>359.50000000000006?vt=.012492346746905587:t[4]>20.500000000000004?vt=.047511695735697544:vt=-.07999269063948773:vt=6802045404471004e-20;let Pt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Pt=.0011484728213539738:Pt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Pt=-.09828874964938798:t[8]>1586.5000000000002?Pt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Pt=.011938269926919522:Pt=.17541983715953954:t[19]>1e-35?Pt=.023002786011088672:Pt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Pt=.06508934844183291:Pt=-.10168553534835639:Pt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Pt=.021140806225203937:Pt=-.1167833342453639:t[2]>33.50000000000001?Pt=.13163585734056618:Pt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Pt=.06314479201263888:Pt=-.09639088327091713:t[10]>29.500000000000004?Pt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Pt=40577156464836036e-21:Pt=.12322387121810757:Pt=-.03697224045046014:t[1]>22.500000000000004?Pt=.016474835887320276:Pt=.16919298733903063:Pt=.07633203630214054:Pt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Pt=.14150493354700563:Pt=-.01831155354975749:t[1]>28.500000000000004?Pt=-.07952557178685365:t[10]>28.500000000000004?Pt=.0665695554984927:Pt=-.053640139319277094:Pt=.0004754840665898665;let Ht;t[76]>1e-35?Ht=-.06814884255939921:t[179]>1e-35?Ht=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?Ht=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?Ht=.004193658608848433:Ht=-.1066968975983452:t[8]>302.50000000000006?Ht=.05476730110440451:Ht=-.06382970920394895:t[218]>1e-35?t[2]>3.5000000000000004?t[6]>13.500000000000002?t[2]>19.500000000000004?t[0]>3200.5000000000005?t[4]>91.50000000000001?Ht=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?Ht=.013555772109446666:Ht=-.09856116699770784:Ht=.0284329611813383:t[2]>52.50000000000001?Ht=.04008708444763762:t[9]>29.500000000000004?Ht=-.1289599546008197:Ht=-.018566534248335896:t[8]>747.5000000000001?Ht=.02236484980076122:Ht=.1148871655157582:t[8]>3084.0000000000005?Ht=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?Ht=.03164751204281298:Ht=.11752140436184891:t[9]>42.50000000000001?Ht=-.07180559595410106:t[22]>1e-35?Ht=.09325040416256854:Ht=-.016041122807939914:Ht=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?Ht=-.010718250133458515:Ht=.09818827994853763:Ht=.010180038981174032:Ht=-.039472162599295535:t[9]>170.50000000000003?Ht=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?Ht=-.08674788057474031:Ht=.02077653508548371:Ht=-.0003536561382007414;let F;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?F=.018337297491457794:F=-.05926206443180149:F=.024026520855881126:t[288]>1e-35?t[184]>1e-35?F=.10747078482128616:t[126]>1e-35?F=-.10550625192391357:t[7]>71.50000000000001?F=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?F=.1317396472229434:F=-.025035791351328947:F=-.0728334305864372:t[8]>963.5000000000001?F=.023642201723096064:F=.183010326734258:t[128]>1e-35?F=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?F=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?F=-.1088876900335281:F=.02758317023002635:F=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?F=-.01928020117446408:F=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?F=.07893723375925096:F=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?F=-.10301657587280551:F=.005787463140224318:F=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?F=-.019296977889522397:F=-.07274529751752634:t[1]>30.500000000000004?F=-.050368901143148286:F=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?F=.0015332402792773946:F=.09930153676749967:F=-.06370844564357069:F=.00042272155209927616;let se;t[71]>1e-35?t[4]>17.500000000000004?se=.12586844370423247:se=-.006791999603126354:t[222]>1e-35?t[1]>10.500000000000002?t[30]>1e-35?t[1]>36.50000000000001?t[9]>1.5000000000000002?t[10]>25.500000000000004?se=-.08474891624263797:t[8]>125.50000000000001?se=.08125086980439704:se=-.04082085238068532:t[0]>3863.5000000000005?se=.020481535807469208:se=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?se=-.019110200161573936:se=-.12387719685855114:t[0]>1102.5000000000002?se=.08376595701957407:se=-.031821919580524834:t[9]>4.500000000000001?se=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?se=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?se=.1349841206807871:se=.011864053595560297:t[1]>41.50000000000001?se=-.08203662486612544:t[2]>18.500000000000004?se=-.009541865642346947:se=.08345043168501759:t[2]>10.500000000000002?se=-.09585031818030947:se=.019432330487099865:se=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?se=.11951517733981365:se=-.016651014735738538:t[1]>28.500000000000004?se=-.07410922545030711:t[10]>28.500000000000004?se=.05886430683844788:se=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?se=.04802269879144705:se=-.026208212831796737:t[4]>45.50000000000001?se=-.03227476944664786:se=.05124575625622705:se=.00020506696916003137;let be;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?be=-.03042091758483443:t[10]>14.500000000000002?be=.09816619204768777:be=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?be=-.02381165060401718:be=-.10950361804974783:be=.03538211665111128:t[212]>1e-35?t[19]>1e-35?be=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?be=-.06371052144380579:be=.0835500621252692:be=-.10408255929333915:t[1]>74.50000000000001?be=.13208968122712403:t[1]>64.50000000000001?be=-.04778844603644965:t[8]>51.50000000000001?t[8]>201.50000000000003?t[8]>660.5000000000001?t[6]>4.500000000000001?t[9]>5.500000000000001?t[1]>29.500000000000004?t[0]>3830.5000000000005?be=.09922816902423433:be=.016366955328796718:be=.1592412560903584:t[1]>39.50000000000001?be=.05409467990258923:be=-.08260633210459611:be=-.06307205775247567:t[9]>36.50000000000001?be=.040253940015648144:be=.14202568969471283:be=-.028761848341594044:be=.08994073058773508:t[0]>807.5000000000001?be=-.043427848826323195:be=.04573516446846493:t[20]>1e-35?t[188]>1e-35?be=-.0758877731600639:t[23]>1e-35?be=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?be=.08124700978741987:be=.013296063087086852:t[7]>5.500000000000001?be=-.01640196088612987:be=-.12685498840146067:be=-.0004940792382459551;let Ue;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Ue=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?Ue=.08513773825688947:Ue=-.1184664832315282:Ue=.05676963535893477:Ue=.14263843210340613:Ue=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?Ue=-.10669720555606924:Ue=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?Ue=.0664744575868955:Ue=-.08469256188890871:Ue=-.026746678040592144:t[281]>1e-35?Ue=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Ue=.012131807587207655:Ue=-.12776015795398743:Ue=.04320472481083551:Ue=.08390980661550446:t[10]>227.50000000000003?Ue=-.09771783809101153:t[10]>130.50000000000003?Ue=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?Ue=-.07610698254064358:t[8]>902.5000000000001?Ue=-.03136381213599649:t[131]>1e-35?Ue=.0704821739127936:t[224]>1e-35?Ue=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?Ue=.10431473040024908:t[8]>841.5000000000001?Ue=.07304745320500514:Ue=-.038011541882439825:Ue=-.01679746695007364:t[0]>3129.5000000000005?Ue=.05589952587431965:t[210]>1e-35?Ue=.06227198085800842:Ue=-.0011341890997947812:t[8]>740.5000000000001?Ue=.04817300084412584:Ue=-.000577001010789238;let Qe;t[187]>1e-35?t[6]>12.500000000000002?t[10]>8.500000000000002?t[10]>16.500000000000004?t[8]>234.50000000000003?t[4]>43.50000000000001?t[0]>4476.500000000001?Qe=-.10504730480402079:t[5]>3341.5000000000005?Qe=.11087894671081754:Qe=-.0406668834674614:Qe=.03308382165616109:t[8]>104.50000000000001?Qe=-.10431436764549162:Qe=.0073928337244891455:t[4]>34.50000000000001?Qe=-.10571751512748416:Qe=-.006081128814142983:t[13]>1e-35?Qe=.1299673566095023:t[4]>60.50000000000001?Qe=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Qe=.04857126072645073:Qe=-.03431365358104773:t[4]>16.500000000000004?Qe=.04101865986596709:Qe=.16480274980378218:t[10]>26.500000000000004?Qe=.03673978504199255:t[10]>9.500000000000002?Qe=-.10996402743800027:t[308]>1e-35?Qe=.0553693735082498:Qe=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Qe=.010902983761213922:Qe=.1325118659895645:Qe=-.064362945508595:t[1]>66.50000000000001?Qe=.033416767779331176:Qe=-.054080316225040496:t[42]>1e-35?Qe=-.07762364337810815:t[10]>1089.5000000000002?Qe=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Qe=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Qe=.0220102041325908:Qe=-.06516708740003069:Qe=.012833498905748267:t[224]>1e-35?Qe=-.007038418272997865:Qe=.00037666304316290967;let ge;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ge=.07554189644995735:ge=-.052089349455904946:ge=-.10148206848169845:t[113]>1e-35?ge=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?ge=.07172653627995676:ge=-.07602959317610998:ge=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?ge=-.0399322883690891:ge=.06523495517476098:ge=-.10358715295743802:t[193]>1e-35?ge=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?ge=.015928764772252406:ge=.1341513061552287:ge=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?ge=-.033592997607280156:ge=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?ge=-.08402551858097379:ge=.017401984506038796:t[1]>25.500000000000004?ge=.13337205393591278:ge=-.01160208350090984:ge=.06708317942315471:t[8]>227.50000000000003?ge=-.08486943882418681:ge=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?ge=-.10496268177586783:ge=-.020921489532370493:ge=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?ge=.11639296062157028:ge=-.004275784356569115:t[32]>1e-35?ge=-.07297384970166025:ge=.006026841626381599:ge=.002034611134960428;let Z;t[248]>1e-35?Z=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Z=-.06455513326540585:t[1]>29.500000000000004?Z=.07718474591552532:t[4]>7.500000000000001?Z=.040139336931404826:Z=-.09685734690563386:Z=.00015327283570347363:t[9]>88.50000000000001?Z=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Z=-.04077257804338707:Z=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Z=.03778141591008941:Z=-.06459919920634845:Z=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Z=.14063930759326346:t[0]>179.50000000000003?Z=.07287482250668585:t[8]>1180.5000000000002?Z=-.14419393112726253:t[10]>28.500000000000004?Z=-.07993142770099469:t[17]>1e-35?Z=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Z=.05527969663610186:Z=-.10824385941441346:t[3]>11.500000000000002?Z=.12358502961047915:Z=-.017509147119622873:t[0]>74.50000000000001?Z=-.014907705458730486:t[8]>95.50000000000001?Z=-.02225118168342062:Z=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Z=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Z=.04962819555610421:Z=-.07213577821855309:Z=.09139529824708481:t[19]>1e-35?Z=.013439401088345224:Z=-.049274647207292056:Z=.10531673719686951;let ve;t[40]>1e-35?t[0]>1937.5000000000002?ve=-.06421671152073961:ve=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?ve=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?ve=-.03520420769287065:t[8]>1085.5000000000002?ve=-.019817352506127633:ve=.11444439424520964:ve=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?ve=-.010490117519863269:ve=.08104430117757461:t[121]>1e-35?t[243]>1e-35?ve=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?ve=.06619344145920268:t[0]>4091.5000000000005?ve=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?ve=.10016091391222309:ve=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?ve=-.019511460451434884:ve=-.11643672465055221:t[2]>18.500000000000004?ve=.07848228087333317:t[8]>55.50000000000001?ve=.032583027899956235:ve=-.11209832692153521:t[11]>1e-35?ve=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?ve=-.09996887746328006:t[9]>2.5000000000000004?ve=.02157682011863397:ve=-.05247727848991843:ve=.07409150201483244:t[1]>38.50000000000001?ve=-.11378466075449625:t[224]>1e-35?ve=-.10741749127732923:t[1]>26.500000000000004?ve=.07343136534146562:ve=-.07013573628594773:t[25]>1e-35?ve=-.04626669734164317:ve=.05518333197956482:ve=.00032434010867555516;let Ge;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?Ge=.026313251010808853:Ge=-.08997339150292381:Ge=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?Ge=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?Ge=.0905155504503746:t[8]>1049.5000000000002?Ge=-.062312558183394054:t[8]>719.5000000000001?Ge=.09583836191410239:t[0]>3719.5000000000005?Ge=-.0778097309430818:Ge=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?Ge=-.12920865648544927:t[0]>2699.5000000000005?Ge=-.07086587879041864:Ge=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?Ge=-.11377786322600797:Ge=-.009486325820117998:t[1]>55.50000000000001?Ge=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?Ge=-.07938291201004219:t[2]>36.50000000000001?Ge=.01520046732530246:Ge=.13649854049662832:Ge=-.07145015938528873:t[8]>407.50000000000006?Ge=-.00350257360822279:Ge=.11332047082193297:Ge=-.10060624458629897:Ge=.05429496612497562:t[8]>1446.5000000000002?Ge=.006073419197482838:Ge=-.08718676350883998:Ge=-.11532497988252638:Ge=.10766270463068293:t[34]>1e-35?Ge=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?Ge=-.0004109812623829506:Ge=.021601073497455662:Ge=-7343540098965853e-20;let qe;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?qe=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?qe=.05995640200798119:t[0]>3443.5000000000005?qe=-.14698883458733583:qe=-.030039164579240187:t[189]>1e-35?qe=-.06086763220538141:t[1]>86.50000000000001?qe=-.05096727866142538:t[4]>64.50000000000001?qe=.11240554253834577:t[4]>45.50000000000001?qe=-.030279760168394117:t[6]>45.50000000000001?qe=.10161088917815142:t[10]>77.50000000000001?qe=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?qe=-.06672020005240323:qe=.08831457502630258:t[8]>2592.5000000000005?qe=-.052617701047376654:t[10]>29.500000000000004?qe=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?qe=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?qe=-.064099222705728:qe=.044332487521538365:t[0]>2882.5000000000005?qe=.031099546885005065:qe=.12938467051623853:t[0]>4221.500000000001?qe=-.0928676413498701:t[9]>30.500000000000004?qe=-.05781824812803708:qe=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?qe=-.06648105454098469:qe=.05985487552383097:qe=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?qe=.05282385499619401:t[1]>66.50000000000001?qe=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?qe=.027885690791379255:qe=-.08407126408362446:qe=.014432924125571093:qe=-9903435845205118e-20;let je;t[76]>1e-35?je=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?je=.013633653464240465:je=-.10164319411983509:je=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?je=.00632864847804078:je=-.08393000368134668:je=.07870508617440916:t[284]>1e-35?je=.1092302727710421:je=-.0025505047582483234:t[248]>1e-35?je=.07101822393621864:t[274]>1e-35?je=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?je=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?je=.025081789181021243:je=-.014813325803582618:t[9]>33.50000000000001?je=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?je=.11926990418060353:je=.01852125513565268:je=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?je=-.1178464984373743:t[283]>1e-35?je=.043370859226927405:t[5]>4320.500000000001?je=-.01103141226366587:t[8]>1104.5000000000002?je=-.023053423988095886:je=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?je=.000579145585864887:je=.03389152834202143:t[128]>1e-35?je=-.14527722052568462:t[210]>1e-35?je=-.08915971541902741:t[7]>9.500000000000002?je=-.03307314577076116:t[18]>1e-35?je=-.05521712302023565:je=.009315605032770029:je=.0036332551852289933;let J;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?J=-.07583539600416284:t[188]>1e-35?J=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?J=-.011038193049597113:J=.08154028164397753:t[1]>85.50000000000001?J=.10259361975201933:J=.011640408330521594:J=-.00023319159023748508:t[92]>1e-35?J=.13771692859530546:J=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?J=.09967230141007705:t[30]>1e-35?J=-.08888529037551285:J=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?J=.08284665960761373:J=-.029292565021289504:t[7]>7.500000000000001?J=-.09945093355204493:J=-.008381393701708593:t[20]>1e-35?J=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?J=.07585582641438211:t[8]>284.50000000000006?J=-.029387993239886723:J=.07716738177321587:t[1]>18.500000000000004?J=.026745348497993746:J=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?J=.02337306890530338:J=-.10390355904767366:J=.07390521199638532:J=-.06788247515155237:J=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?J=-.06360325615644084:J=.04342192339836601:J=-.10598779152030145:J=.05253384605768211;let ae;t[3]>7.500000000000001?t[157]>1e-35?ae=-.07514182877923786:ae=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ae=.028692053800951845:ae=.14081686716133598:ae=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?ae=.0037139292567243084:ae=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?ae=.01202688580305612:ae=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?ae=.043935495082738626:ae=-.05639305759669704:t[247]>1e-35?ae=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?ae=.10331836202616368:ae=.0006926658459781341:t[96]>1e-35?ae=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?ae=-.0741403257305367:ae=.022900127535540854:t[7]>3.5000000000000004?ae=.038110741403836294:ae=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?ae=-.09552842289807008:t[1]>27.500000000000004?ae=.012505935885798007:ae=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?ae=-.1046104767723845:ae=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?ae=.023466328488582572:ae=.11730925774586994:ae=-.04771965631104874:ae=.17059689880751394:ae=-.08181850955999449:t[26]>1e-35?ae=-.12727482696678769:ae=-.014343123272734182;let Ce;t[147]>1e-35?t[1]>53.50000000000001?Ce=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Ce=-.02763546051134888:Ce=.06423344777499343:Ce=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?Ce=.049825139823021586:t[7]>22.500000000000004?Ce=-.01131680751379858:t[0]>2579.5000000000005?Ce=-.10673674485369694:Ce=-.015387212937189957:Ce=.04347325151148724:t[179]>1e-35?Ce=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Ce=.0650355590939066:Ce=-.0473332870892226:Ce=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?Ce=.11139543329789044:t[126]>1e-35?Ce=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?Ce=.06370903833231022:t[10]>29.500000000000004?Ce=.03415223859607161:t[10]>3.5000000000000004?Ce=-.07415518117873297:Ce=-.0014119203473324082:Ce=.12617652343819508:t[9]>41.50000000000001?Ce=-.10311145857176976:t[8]>2757.5000000000005?Ce=-.08106484219011428:t[7]>71.50000000000001?Ce=-.09783384432091176:t[1]>88.50000000000001?Ce=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?Ce=-.008884084501608536:Ce=.061339437777743616:Ce=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?Ce=.01526664064166223:Ce=.13534828515415498:Ce=-.06985484465894776:Ce=.0005758961943178744;let Re;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Re=-.029152732370514342:Re=.07173628916139178:t[1]>36.50000000000001?Re=-.08859111297255318:Re=.0018030071815630785:Re=.13652461563759322:Re=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Re=-.07145140450454163:t[21]>1e-35?Re=-.07422841663493233:Re=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Re=.11864240653986852:t[3]>33.50000000000001?Re=-.08821209591953476:Re=.05706392280054726:Re=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Re=.01953613016837112:Re=-.059781039130025006:t[148]>1e-35?Re=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Re=.07207826841738371:t[202]>1e-35?Re=.08163917539410503:Re=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Re=-.06858280496900336:Re=-.1781828899516648:Re=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Re=.018232649414147116:Re=-.04419781124222661:Re=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Re=.11452368095776105:Re=-.036496437259924026:Re=-.040445338739465486:Re=.0816572651001145:Re=-.08968914517368663:Re=.0002826343082585516;let $e;t[189]>1e-35?t[0]>5269.500000000001?$e=-.08839493050459957:t[10]>85.50000000000001?$e=.10046908365702462:t[8]>2592.5000000000005?$e=-.09632233975926387:t[8]>2000.5000000000002?$e=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?$e=.035504970430426296:t[1]>31.500000000000004?$e=-.1133764813142531:$e=-.01138280942244812:t[8]>1125.5000000000002?$e=.09800530246229806:$e=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?$e=.07316772160107896:$e=-.059095014819051765:$e=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?$e=-.09150209066166894:t[8]>3084.0000000000005?$e=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?$e=-.04449234460408263:$e=.05568837973347338:$e=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?$e=.12741077850267066:$e=.007372371864985329:t[2]>39.50000000000001?$e=.02295917234617787:$e=.14966532083907075:t[1]>39.50000000000001?$e=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?$e=-.02511861881285652:t[1]>27.500000000000004?$e=.08683660011672288:$e=.02956214835267301:t[9]>15.500000000000002?$e=-.016538805462996232:$e=.04352738094981517:$e=-.05561856645643868:t[9]>170.50000000000003?$e=-.07996752635874248:t[179]>1e-35?$e=-.09065975936933919:$e=-.00042817975060427177;let Ye;t[39]>1e-35?t[4]>25.500000000000004?Ye=.03443173196222934:Ye=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?Ye=-.0013415395759330318:Ye=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?Ye=.002297618040307216:Ye=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?Ye=-.015297257305397608:Ye=.09651828834062742:Ye=-.06636003334371929:t[10]>11.500000000000002?Ye=.17631616138309397:t[0]>1639.5000000000002?Ye=3804386478092585e-20:Ye=-.09099296398683193:Ye=-.06874415876172972:t[0]>2151.5000000000005?Ye=-.1311264883406766:Ye=.00809052010141122:t[253]>1e-35?Ye=-.06338558211939296:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?t[10]>10.500000000000002?t[0]>3615.5000000000005?Ye=.045038497754638605:Ye=-.07770167665661752:Ye=-.08596294280650517:Ye=.08538655727027213:Ye=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?Ye=.054627956617973275:t[1]>61.50000000000001?Ye=-.11994465088415499:t[4]>8.500000000000002?Ye=.06676200239406452:Ye=-.027503148069376867:t[8]>676.5000000000001?Ye=-.10363964928357075:t[4]>8.500000000000002?Ye=-.07589816227175682:Ye=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?Ye=.009093153189012338:Ye=-.06119765876605404:Ye=.0004668642103528348;let ut;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?ut=-.10100794502567233:ut=.08000205636470442:ut=-.11945419826856896:t[113]>1e-35?ut=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?ut=.1224302423880318:ut=-.01875566982911468:t[222]>1e-35?t[1]>8.500000000000002?t[1]>24.500000000000004?t[4]>3.5000000000000004?t[0]>725.5000000000001?t[0]>1682.5000000000002?t[0]>2860.5000000000005?ut=.0019277012166729114:t[1]>28.500000000000004?ut=-.054445821715687494:ut=.045645722976713245:t[30]>1e-35?ut=.13402660155331655:ut=.008921176001777645:ut=-.058547426505451076:ut=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?ut=-.13526418192218206:ut=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?ut=.0007263224246135398:ut=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?ut=-.11575657261278308:ut=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?ut=-.01995960178292952:ut=.11216586049153021:ut=-.10050961087149474:ut=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?ut=.10303451081526649:ut=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?ut=-.043799548968209395:ut=-.12451444314954115:t[4]>12.500000000000002?ut=-.03838117361958468:ut=.06504990789767144:t[57]>1e-35?ut=.06890006938293915:ut=.0003914274695562949;let yt;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?yt=.004271749009686975:yt=-.10523878297127605:yt=.04633982158107851:yt=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?yt=-.08655730561951676:t[8]>919.5000000000001?yt=-.0676453705610183:t[7]>18.500000000000004?yt=-.027787974193650575:yt=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?yt=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?yt=-.03473877164537313:t[8]>719.5000000000001?yt=.10471053866934404:yt=.008236107678382981:t[4]>57.50000000000001?yt=.09412219478825269:t[10]>66.50000000000001?yt=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?yt=-.040681323751002293:yt=.06374650297561021:yt=.12884615227401788:t[10]>5.500000000000001?yt=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?yt=-.05474068967150784:yt=.03744700650806603:yt=-.07846396348680855:t[1]>42.50000000000001?yt=.018972315810821302:yt=.10953621007604744:t[5]>4439.500000000001?yt=.010999776705494586:t[1]>40.50000000000001?yt=-.12394200059775967:t[10]>2.5000000000000004?yt=.013528093962849453:yt=-.09222088417048682:yt=-.12662967149701485:yt=.09327296405849603:t[3]>99.50000000000001?yt=-.013581954439986752:yt=.0005526498251862075;let $t;t[187]>1e-35?t[243]>1e-35?$t=-.08392792551692502:t[10]>68.50000000000001?$t=.07871769409454053:t[10]>8.500000000000002?t[10]>16.500000000000004?t[2]>17.500000000000004?t[3]>31.500000000000004?t[91]>1e-35?t[10]>21.500000000000004?t[10]>33.50000000000001?t[10]>48.50000000000001?$t=-.0825306209711224:$t=.049559996084532945:$t=-.1064938580886302:$t=.03353240732240275:$t=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?$t=.16966001471529374:t[1]>57.50000000000001?$t=-.005772777673676247:$t=.09383677041525058:t[8]>747.5000000000001?$t=.054068175469351235:$t=-.049968216310277036:t[8]>753.5000000000001?$t=-.0679383555784074:t[4]>8.500000000000002?$t=-.059757341189735386:$t=.05701083682780414:$t=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?$t=.05820296128730006:$t=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?$t=.15340611616954566:$t=.04385036188666874:t[0]>4449.500000000001?$t=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?$t=.004840354641006495:$t=.09967827580276283:$t=.11605363537391578:t[9]>19.500000000000004?$t=-.0735831692725717:$t=.019973331823355176:t[306]>1e-35?t[149]>1e-35?$t=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?$t=-.02442182361342386:$t=.10334853004243093:$t=-.030431948680167104:$t=-956078595250818e-19;let Tt;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?Tt=-.040232505718244854:t[0]>3030.5000000000005?Tt=.0634109586813073:Tt=-.04043617034245621:Tt=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?Tt=-.007859096946435131:Tt=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?Tt=.05515771679628051:Tt=-.04214471312668263:Tt=-.09589322222261765:t[193]>1e-35?Tt=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?Tt=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?Tt=-.08152604001147906:t[11]>1e-35?Tt=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?Tt=.13100930780107503:t[10]>25.500000000000004?Tt=.05921074710011526:Tt=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?Tt=.0009447118243153454:Tt=-.09820565036865991:Tt=.057146909749745546:t[0]>2115.5000000000005?Tt=-.12331216726611678:Tt=.007281983677694285:t[2]>56.50000000000001?Tt=.012310154675612615:Tt=-.08873665774670461:t[6]>25.500000000000004?Tt=.134708740821879:t[9]>5.500000000000001?Tt=-.0805901581148979:t[224]>1e-35?Tt=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?Tt=.10842593386554122:t[2]>13.500000000000002?Tt=.06466798320378395:Tt=-.08578130788886655:Tt=-.03590892078300114:Tt=.0003499894043880708;let We;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?We=.10839808814624702:We=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?We=-.007478368069393829:We=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?We=.04035247751736232:t[0]>4255.500000000001?We=-.1310865624507367:t[0]>4004.5000000000005?We=.06647367311982634:We=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?We=-.011618902907510411:We=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?We=.09356028223727986:We=-.03811765057032162:We=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?We=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?We=.1146142460964847:t[1]>62.50000000000001?We=-.09679869865322362:t[9]>71.50000000000001?We=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?We=-.039046426387852974:We=.04558778688367152:We=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?We=.03261697816211156:t[15]>1e-35?We=.02586252542264368:t[2]>14.500000000000002?We=-.016420452667484604:We=-.1011799626006976:We=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?We=.010193588102560583:We=.11748729525930773:We=-.04468162226743652:We=-.028365274393617957:t[71]>1e-35?We=.05115139346588793:We=-.0001510425316936658;let ce;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ce=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ce=.020637047900190317:ce=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?ce=-.04632587527094407:ce=.08603684785510396:ce=-.05101401015448496:ce=.025466432054358498:ce=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ce=.020385355430046367:ce=.12032592051335252:ce=-.012387370292173013:t[2]>23.500000000000004?ce=-.12568545484492677:ce=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ce=.043528764484784536:ce=.14352071657196003:ce=-.009332833816977268:ce=.11186782227735846:ce=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ce=-.05649104643152564:ce=.03884200719305747:t[42]>1e-35?ce=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ce=-.04103416502526736:ce=.04881823954656287:t[4]>15.500000000000002?ce=.009342724662897898:t[0]>3969.5000000000005?ce=-.025637309961309498:ce=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ce=-.08185697075265091:t[0]>2215.5000000000005?ce=.030063975892297354:t[0]>807.5000000000001?ce=-.03924325550733229:ce=.0415330999189793:ce=-.00024374664461674863;let Pe;t[3]>7.500000000000001?Pe=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Pe=.025798416259686565:Pe=.13251610353146012:Pe=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Pe=-.11098564237775424:Pe=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Pe=.15347826616466054:t[3]>4.500000000000001?Pe=.10379320730958941:Pe=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Pe=.03159791088468647:Pe=-.10612873364104258:Pe=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Pe=-.02335760775001469:Pe=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Pe=-.011164334474672973:Pe=-.06594044410501655:t[207]>1e-35?Pe=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Pe=-.01725821503981916:Pe=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Pe=-.04226531631656534:Pe=-.14409800530171432:Pe=-.03245576341206398:t[8]>4214.500000000001?Pe=.0895409165534886:t[247]>1e-35?Pe=-.06506383629143335:t[118]>1e-35?Pe=-.07214270121257443:t[8]>546.5000000000001?Pe=-.004385020865473831:Pe=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Pe=.046278501133958524:Pe=-.030835570926968044:t[0]>493.50000000000006?Pe=-.12794504651610425:Pe=.009415039807550776;let Me;t[304]>1e-35?Me=-.04717777269217453:t[76]>1e-35?Me=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Me=-.09648224457374217:t[132]>1e-35?Me=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Me=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Me=.10838431695638147:t[230]>1e-35?Me=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Me=.050071316251979:Me=-.006356941111525215:t[6]>8.500000000000002?Me=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Me=.10217402850540398:Me=-.048840949025349197:Me=-.03668313197909846:t[7]>39.50000000000001?Me=-.0562642841496003:t[10]>2.5000000000000004?Me=.09749777369987417:Me=-.04848223121417616:t[0]>5453.500000000001?Me=.08316648226133942:Me=-.0261979698267618:t[212]>1e-35?Me=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Me=.04837009746506856:Me=-.09184360565631328:Me=.0032411047845613606:t[0]>4733.500000000001?Me=.0977378556864798:Me=.010776545559325588:Me=-.012483310473120218:Me=-.049284121449103935:Me=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Me=-.08380361910948711:Me=.07375088778585813:Me=-.1084864186071348:Me=.0007819503469605476;let ye;t[7]>17.500000000000004?t[115]>1e-35?ye=.08741852531696623:t[167]>1e-35?ye=.10078975495600809:ye=-.0018324767784017562:t[290]>1e-35?ye=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ye=.1379733311640402:ye=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ye=-.09360083033774169:ye=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ye=-.015599362579530679:t[0]>4593.500000000001?ye=-.12029549262691491:ye=-.018917032256501397:ye=.04632831686576592:ye=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ye=-.05894883236412263:ye=.05213944998315824:ye=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ye=.07577412405680808:ye=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ye=-.0277076900736147:t[1]>65.50000000000001?ye=-.023587471585763506:ye=.10184896592433082:ye=-.057699270527916825:ye=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ye=.06566902102799584:t[10]>25.500000000000004?ye=-.07033633753181047:ye=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ye=-.08108035861059537:ye=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ye=-.12431182772561139:ye=.01886235886984271:ye=.0025579594894418116;let oe;t[8]>2915.5000000000005?t[101]>1e-35?oe=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?oe=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?oe=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?oe=.0687641681341721:t[10]>102.50000000000001?oe=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?oe=-.06762578396473291:t[10]>65.50000000000001?oe=-.05226727783610509:t[282]>1e-35?oe=.09911438410640917:t[19]>1e-35?oe=.06915156336429933:oe=-.006565637886508241:oe=-.08344300251849307:oe=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?oe=.19428463865406298:oe=.016073883020956765:t[13]>1e-35?oe=.06864077097923665:oe=-.01388867527034731:t[0]>1847.5000000000002?oe=.004655280608161356:t[1]>40.50000000000001?oe=.031406054057765996:oe=.12798062439212832:oe=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?oe=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?oe=-.0706095614785733:oe=.04227164041372561:oe=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?oe=-.07139533369873902:oe=.008952586782921625:oe=.06086212582180936:oe=-.0816938490403437:oe=-.051224901945956025:oe=-.10525399124186095:oe=.000270924147208224;let Ke;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?Ke=.029186512383291244:t[7]>1.5000000000000002?Ke=-.14984127276725573:t[1]>40.50000000000001?Ke=.032757060730648144:Ke=-.07675575422749602:t[6]>8.500000000000002?Ke=.10599766037117893:Ke=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Ke=-.051394622947855385:Ke=.03237141302699347:Ke=.12526173027943244:Ke=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Ke=-.07383912482657777:t[0]>5147.500000000001?Ke=.07008813937042091:t[10]>38.50000000000001?Ke=-.06779203808365307:Ke=-.013782769999524498:Ke=.0880038869117715:Ke=-.12846294176070952:t[281]>1e-35?Ke=-.06810806903850834:t[10]>227.50000000000003?Ke=-.08937977001661111:t[10]>130.50000000000003?Ke=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Ke=.011036530162093841:Ke=-.11500797478569702:Ke=.03702229366129399:Ke=.07242026683784307:t[189]>1e-35?Ke=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?Ke=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?Ke=-.02608892716555304:Ke=.09609599320761308:t[9]>105.50000000000001?Ke=-.06848127135991534:Ke=.0023675721254089715:t[86]>1e-35?Ke=-.11049635625500497:Ke=-.004847764219432233;let lt;t[125]>1e-35?t[0]>3969.5000000000005?lt=-.09462233499115416:lt=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?lt=-.030700661288166148:lt=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?lt=.03149547314036763:lt=-.08166208257451366:t[0]>5850.500000000001?lt=-.10228136324773157:t[102]>1e-35?lt=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?lt=.01782894842128785:t[13]>1e-35?lt=.002680190260979968:lt=.1773965720476949:t[2]>72.50000000000001?lt=.09090831938627947:t[1]>59.50000000000001?lt=-.12297206702816128:t[0]>4977.500000000001?lt=.09899015653118268:lt=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?lt=-.0675900954187773:lt=.012336403425364092:lt=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?lt=-.02671721777458802:lt=-.09242452991958029:t[284]>1e-35?lt=-.08585691288582491:lt=.013332890564324447:t[4]>14.500000000000002?lt=-.005245022074799553:t[23]>1e-35?lt=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?lt=-.09289852307936758:t[116]>1e-35?lt=-.09686573010015055:t[8]>804.5000000000001?lt=.03812547148215318:lt=.005162744968176633:t[9]>43.50000000000001?lt=-.059246106396159376:lt=.050370113808135275:lt=.000794041852811028;let Gt;t[3]>7.500000000000001?Gt=.0004981426543104341:t[9]>114.50000000000001?Gt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Gt=-.019061766497948867:Gt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Gt=-.006044199577160493:Gt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Gt=.11486607015912494:t[9]>16.500000000000004?Gt=-.08686820858087294:Gt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Gt=-.022230207980026437:Gt=.1056683690528792:Gt=-.05859530800943035:Gt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Gt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Gt=-.05177544573528314:Gt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Gt=.15159657923771555:Gt=-.0060542654587671055:t[9]>5.500000000000001?Gt=-.042808028205051786:t[1]>48.50000000000001?Gt=-.010449538258110742:Gt=.10026907521968294:Gt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Gt=-.02272452389409874:Gt=-.11202691218244319:t[5]>1809.5000000000002?Gt=-.04460413584255906:Gt=.08196329474205256:t[10]>69.50000000000001?Gt=.10221481166238167:Gt=.0004063052701699382:t[243]>1e-35?Gt=-.07563941678849846:t[18]>1e-35?Gt=.02563513231103432:Gt=-.004740081147303786;let Er;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Er=.057446442918106:Er=-.04404018270156349:Er=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Er=-.05930486238817954:t[1]>29.500000000000004?Er=.06955866121256543:t[8]>597.5000000000001?Er=-.06538593556505168:Er=.06212512595497445:Er=.00021102929959182257:t[9]>90.50000000000001?Er=.0958061289119631:t[102]>1e-35?Er=.07172059675638813:t[1]>47.50000000000001?Er=-.03879798603977766:t[297]>1e-35?Er=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?Er=.003805910996312012:Er=.09304295674749524:t[11]>1e-35?t[18]>1e-35?Er=.11252376801858695:t[288]>1e-35?Er=-.10293901912180432:Er=.014669268837893872:t[1]>42.50000000000001?Er=-.05988274123836837:t[145]>1e-35?Er=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?Er=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?Er=-.03366718308159971:Er=.11936550608549797:t[1]>31.500000000000004?Er=-.07454716789539667:Er=.027859650621164217:t[10]>10.500000000000002?Er=-.11806374092321247:Er=-.03506042229223101:Er=-.0007080765837654515:t[10]>6.500000000000001?Er=-.028077713664996503:t[2]>7.500000000000001?Er=.15803724124216814:Er=.0351381284833169:Er=-.07877953381054767;let dr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?dr=.14144941521975005:dr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?dr=.10514088112381886:t[7]>18.500000000000004?dr=-.10370643555956745:dr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?dr=-.0508129468802936:t[224]>1e-35?dr=-.037816066368733595:t[10]>43.50000000000001?dr=.07793408602607932:dr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?dr=.036972453794202324:dr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?dr=.09475302525132188:dr=-.03580104945898193:dr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?dr=-.1282448778804823:dr=-.014395808269207212:dr=-.008940927190750592:dr=-.1459118815453748:t[0]>4897.500000000001?dr=-.09733068457286576:t[1]>57.50000000000001?dr=.06575271409540207:dr=-.019556422817450115:dr=-.10623959222984136:t[18]>1e-35?dr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?dr=.008125645893104896:dr=-.11084368630465868:dr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?dr=-.05854904579626861:t[4]>5.500000000000001?dr=.02985784951394175:dr=-.03247600140149334:dr=-.11152899295304973:dr=-.00035424577714215764;let Ur;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Ur=-.06563670567578264:Ur=.067656954313663:Ur=-.10388217548685377:t[8]>2302.5000000000005?Ur=.07190621943790435:t[4]>67.50000000000001?Ur=.060020507643618604:t[4]>38.50000000000001?Ur=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Ur=-.06568134366461277:t[8]>1075.5000000000002?Ur=-.004768057709758692:Ur=.11785959165999467:Ur=-.05080221682879267:Ur=.14814206127494542:Ur=-.07241946332311736:t[253]>1e-35?Ur=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Ur=-.02471195342450034:Ur=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Ur=-.10741850739482771:Ur=.010051635824944:Ur=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Ur=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Ur=-.08992396138178163:Ur=.010944365997007212:Ur=.06221307021813793:Ur=.1286024087559141:t[127]>1e-35?Ur=.06568148624531012:t[10]>40.50000000000001?Ur=-.07567979134643352:t[5]>5647.500000000001?Ur=.07594672895572069:Ur=-.018158016446439187:t[6]>55.50000000000001?Ur=.009293422430111872:t[4]>45.50000000000001?Ur=-.017749818406964022:t[2]>46.50000000000001?Ur=.01714136511113982:Ur=-724762291423549e-19;let Wr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Wr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Wr=.07084726276890757:Wr=-.11232323677722932:Wr=.04812773089510436:Wr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Wr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Wr=.0879462816013881:Wr=-.002966662093626573:t[306]>1e-35?Wr=-.04588085188342676:Wr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Wr=-.006600332774461143:Wr=.1272481351557754:Wr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Wr=.011884312066620044:Wr=.11678751052403374:t[4]>8.500000000000002?Wr=.03627129613273813:Wr=-.12132783497902287:Wr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Wr=-.06830131718398992:t[0]>5147.500000000001?Wr=.062360406249609306:t[4]>4.500000000000001?Wr=-.013162203864592055:Wr=-.07153029184927609:Wr=.07628618062271557:Wr=-.12085065687320373:t[190]>1e-35?Wr=-.045816889524231186:t[137]>1e-35?Wr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Wr=.025895337822752502:Wr=-.06503949350616421:t[10]>227.50000000000003?Wr=-.09989456525790491:t[10]>130.50000000000003?Wr=.08616651057030683:Wr=.0001234981796706021;let zr;t[8]>1014.5000000000001?t[9]>137.50000000000003?zr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?zr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?zr=-.141732381961068:zr=-.0317152307496497:zr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?zr=.12191801556691254:zr=-.0003444689085397977:zr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?zr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?zr=-.05676033995381961:zr=.10933961076803381:t[4]>26.500000000000004?zr=-.11667582544549814:t[8]>1765.5000000000002?zr=.032174455312047705:zr=-.0755016390126608:t[293]>1e-35?zr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?zr=.026571311956824436:t[15]>1e-35?zr=.06175459479851121:zr=-.018778084411148754:t[9]>40.50000000000001?zr=-.09420232889965811:zr=-.004578248021263184:t[2]>1.5000000000000002?zr=.005453714644971445:zr=-.03907138175699279:zr=-.055296364182154736:t[23]>1e-35?zr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?zr=-.09358146510580179:zr=.060524657996178094:zr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?zr=-.12698331085931538:zr=.006059605604079918:t[2]>196.50000000000003?zr=-.09451315810804783:zr=.0011390147031687425;let zt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?zt=.05517359070460923:zt=-.04758751221404857:zt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?zt=.1040436595565776:t[9]>21.500000000000004?zt=.04032250517675179:t[107]>1e-35?zt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?zt=.1192453009230486:t[1]>51.50000000000001?zt=.0443376336292195:zt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?zt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?zt=-.08999822408398037:zt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?zt=-.061850439226075:zt=.08849196353361093:zt=.10536348167793089:t[92]>1e-35?zt=.04894947712119185:t[9]>16.500000000000004?zt=.05900227903883853:t[9]>5.500000000000001?zt=-.11946594348916476:zt=-.03652096348071964:t[1]>41.50000000000001?zt=-.07411603110840567:zt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?zt=.08493634342741495:t[11]>1e-35?zt=-.10899097825564363:zt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?zt=.08356655906359918:t[7]>25.500000000000004?zt=-.09475076526194888:t[10]>5.500000000000001?zt=-.01999406228763778:zt=.06696212545889428:t[6]>20.500000000000004?zt=.14713592661393468:zt=.0459917279002218:zt=.00027445928493734093;let Tr;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?Tr=-.06904501553217077:Tr=.05696231672035904:Tr=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?Tr=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?Tr=-.011419256378538392:t[0]>3830.5000000000005?Tr=.140315841503076:Tr=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?Tr=-.04027822909411164:Tr=.03176085103667189:Tr=.06779515865838849:t[4]>15.500000000000002?Tr=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?Tr=.06124039747298539:Tr=-.04312732764434027:Tr=.09161522761808062:Tr=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?Tr=.11211681010488772:t[13]>1e-35?Tr=.06725735814960367:Tr=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?Tr=.11743605068905603:Tr=-.011309033539148687:Tr=-.07896094707523052:Tr=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?Tr=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?Tr=.02836295848998302:Tr=.12210680366745175:Tr=-.058302317470509096:t[5]>4144.500000000001?Tr=.06123341960495106:Tr=-.03840046906926525:Tr=-.05221474543453495:Tr=.03988215485860711:Tr=-.00033074684693083496;let e0=QEc(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+_+E+v+S+T+w+R+x+k+D+N+O+B+q+M+L+U+j+Q+Y+W+V+z+ie+H+re+le+Le+me+Oe+Te+te+ee+K+he+X+de+Be+ne+ue+Ne+xe+Fe+tt+st+vt+Pt+Ht+F+se+be+Ue+Qe+ge+Z+ve+Ge+qe+je+J+ae+Ce+Re+$e+Ye+ut+yt+$t+Tt+We+ce+Pe+Me+ye+oe+Ke+lt+Gt+Er+dr+Ur+Wr+zr+zt+Tr);return[1-e0,e0]}a(UEc,"multilineModelPredict");function QEc(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(QEc,"sigmoid")});var V9i=I(FV=>{"use strict";p();Object.defineProperty(FV,"__esModule",{value:!0});FV.MultilineModelFeatures=FV.PromptFeatures=void 0;FV.hasComment=r5r;FV.requestMultilineScore=GEc;var BV=H9i(),qEc=G9i(),jEc={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},$9i={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function r5r(t,e,r,n=!0){let o=t.split(` -`);if(n&&(o=o.filter(l=>l.trim().length>0)),Math.abs(e)>o.length||e>=o.length)return!1;e<0&&(e=o.length+e);let s=o[e];return(jEc[r]??[]).some(l=>s.includes(l))}a(r5r,"hasComment");var C3e=class{static{a(this,"PromptFeatures")}constructor(e,r){let[n,o]=this.firstAndLast(e),s=this.firstAndLast(e.trimEnd());this.language=r,this.length=e.length,this.firstLineLength=n.length,this.lastLineLength=o.length,this.lastLineRstripLength=o.trimEnd().length,this.lastLineStripLength=o.trim().length,this.rstripLength=e.trimEnd().length,this.stripLength=e.trim().length,this.rstripLastLineLength=s[1].length,this.rstripLastLineStripLength=s[1].trim().length,this.secondToLastLineHasComment=r5r(e,-2,r),this.rstripSecondToLastLineHasComment=r5r(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` +`)[0]}return r}a(H9i,"makeGhostAPIChoice");function t5r(t,e,r,n,o){let s=Date.now()-n,c=s-o,l=r.telemetryData.extendedBy({},{completionCharLen:r.completionText.length,requestTimeMs:s,processingTimeMs:o,deltaMs:c,meanLogProb:r.meanLogProb||NaN,meanAlternativeLogProb:r.meanAlternativeLogProb||NaN});l.extendWithRequestId(r.requestId),(0,BEc.telemetry)(t,`ghostText.${e}`,l)}a(t5r,"telemetryPerformance")});var $9i=I(ubt=>{"use strict";p();Object.defineProperty(ubt,"__esModule",{value:!0});ubt.contextualFilterCharacterMap=void 0;ubt.contextualFilterCharacterMap={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95}});var V9i=I(r5r=>{"use strict";p();Object.defineProperty(r5r,"__esModule",{value:!0});r5r.multilineModelPredict=qEc;function qEc(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let _;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?_=.003325460510319164:_=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?_=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?_=.0697359767152808:t[230]>1e-35?_=.06513506845651572:_=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?_=.013616385013146277:_=.04171540100223404:_=-.04360396575094823:t[212]>1e-35?_=.025945477945627522:_=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?_=-.07856453318384411:_=-.014803893522351739:t[39]>1e-35?_=-.09185452630751932:t[149]>1e-35?_=-.07122426086157027:t[134]>1e-35?_=-.04231052091434186:t[227]>1e-35?_=-.029815824273994197:t[50]>1e-35?_=-.15736496271211153:t[222]>1e-35?_=-.02360285356956629:t[128]>1e-35?_=-.03922080193836443:t[136]>1e-35?_=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?_=-.0029736170756835783:_=-.06482902102259112:t[84]>1e-35?_=-.11340924635708383:t[94]>1e-35?_=-.03635703457792193:t[118]>1e-35?_=-.058181913914186034:t[126]>1e-35?_=-.062030576241517366:t[116]>1e-35?_=-.045086301850604006:t[25]>1e-35?_=-.031665223656767286:t[203]>1e-35?_=-.009444685731407691:_=.0112265153772187;let E;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?E=.022717227245241684:E=-.049700413274686266:E=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?E=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?E=-.12263724050601095:E=.0070743478891288035:t[288]>1e-35?E=-.050439138582109:E=.0255701593657891:E=-.005812703740580558:t[6]>49.50000000000001?E=-.008542694147899113:E=.035147383686665:E=-.0960461939274094:t[32]>1e-35?E=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?E=-.01800870272656664:E=-.07817304234604389:t[30]>1e-35?E=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?E=.08778416018479411:E=-.026563982720830256:E=-.05296139548112329:t[50]>1e-35?E=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?E=-.036572140520852024:t[183]>1e-35?E=-.10766853736801459:E=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?E=.09513215942486053:E=-.03641865277445567:t[10]>59.50000000000001?E=.03177172388687933:t[39]>1e-35?E=-.10234241303898953:t[243]>1e-35?E=-.02966738115984321:t[190]>1e-35?E=-.04312785336449181:t[118]>1e-35?E=-.05808521194081524:E=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let S;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?S=-.0024117174588695603:S=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?S=.04575380761203418:S=-.10025595041353463:t[15]>1e-35?S=.17705790384964004:S=.0073813837628615014:S=.07676373681392407:S=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?S=.07078572910026419:t[4]>23.500000000000004?S=.005513918674164821:S=.0206586476926392:t[0]>5269.500000000001?S=.07706773525822633:S=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?S=-.03204783603215824:S=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?S=-.0930246911392012:S=.011173087289703683:t[3]>24.500000000000004?S=.03281421918878597:S=.12449335091369843:t[204]>1e-35?S=.06634531187326123:S=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?S=-.041196758517013515:t[4]>7.500000000000001?S=-2942718111029724e-20:t[4]>6.500000000000001?S=.11953909558532852:S=.03188615019450534:t[122]>1e-35?S=-.0616037324662157:t[101]>1e-35?S=.027230889593349412:t[8]>4968.500000000001?S=-.1113986516540856:t[3]>2.5000000000000004?S=-.002045140426885727:t[129]>1e-35?S=.12641163374304432:S=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let k;t[306]>1e-35?t[149]>1e-35?k=-.1389218965136736:k=-.032218642644416894:t[13]>1e-35?k=.006465035217331847:t[50]>1e-35?k=-.1381687930130022:t[179]>1e-35?k=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?k=-.03262719498763048:k=.023342916702125613:t[191]>1e-35?k=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?k=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?k=-.09989343595668776:k=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?k=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?k=-.09165257825246746:t[9]>32.50000000000001?k=.02484870392366004:k=-.008499493096971395:t[8]>24.500000000000004?k=.02459679192828244:k=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?k=.0015644546318714849:k=-.06579524865022705:k=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?k=.03331853632960164:k=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?k=-.019091477207111116:k=.037878468575478504:t[94]>1e-35?k=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?k=.16919658785098224:t[243]>1e-35?k=-.06580584936754524:k=.01567555159935563:t[129]>1e-35?k=.06721746994993226:t[10]>32.50000000000001?k=-.046394462507797975:k=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let O;t[308]>1e-35?O=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?O=.023223358334607133:O=-.04383410185346742:O=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?O=.023406489302867494:O=-.085521220804058:O=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?O=.028120059780969632:O=-.04211009474298743:t[294]>1e-35?O=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?O=-.0993035220737934:O=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?O=.029770210551187937:O=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?O=.06421359317599738:O=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?O=.024368404612215164:O=-.04045232374803373:t[131]>1e-35?O=.017372701982485795:t[120]>1e-35?O=.08812710275150198:t[18]>1e-35?t[90]>1e-35?O=.18451364351180236:t[7]>33.50000000000001?O=-.03850813130183531:t[195]>1e-35?O=.06966114053446336:t[3]>16.500000000000004?O=-.0012869181693341211:t[0]>4242.500000000001?O=-.054625548611291035:O=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?O=.006302103427145562:O=.13967622319898698:t[121]>1e-35?O=-.038798585213145644:t[5]>4544.500000000001?O=-.08050498033009466:O=-.002986974112681435;let B;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?B=-.03461119351456781:B=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?B=-.12404435523286539:B=-.0034376913880382956:B=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?B=.0037507103585310234:B=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?B=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?B=-.04832024079663151:t[37]>1e-35?B=-.037103393468366934:B=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?B=.032539071163832034:t[5]>1643.5000000000002?B=.036408625378035665:t[0]>1500.5000000000002?B=-.1346358322854993:B=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?B=-.1133991164577881:t[9]>52.50000000000001?B=-.024478640359723122:B=.03673777861098756:B=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?B=.002583438691776944:B=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?B=-.02141222346712401:B=.06392462314316179:t[4]>12.500000000000002?B=.08700122294434816:t[8]>267.50000000000006?B=.056923170082743224:B=-.07716309825583327:t[32]>1e-35?B=-.03961343943752142:B=.002674914122888783:t[1]>42.50000000000001?B=-.05217539654421676:t[145]>1e-35?B=.09553630282946368:B=-.009424791262477729;let q;t[183]>1e-35?q=-.05753337139158443:t[308]>1e-35?q=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?q=-.10477869875380448:q=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?q=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?q=-.04442302951713574:q=.00012409888451734224:q=-.092199119633697:t[225]>1e-35?q=.13773072450201831:t[0]>2882.5000000000005?q=.0028540012229920533:t[298]>1e-35?q=.07134486044361629:q=.014297412329837425:t[145]>1e-35?q=.05608385321902638:t[92]>1e-35?q=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?q=-.0039957800609801315:q=.0776927564241081:t[203]>1e-35?q=-.05502900859432093:t[105]>1e-35?q=.06062892720841595:q=-.009574839629252128:t[31]>1e-35?q=.009488858841144216:t[23]>1e-35?t[20]>1e-35?q=.08818126313644752:t[8]>161.50000000000003?q=.014353968957885408:q=-.022240738532827903:t[210]>1e-35?q=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?q=-.043902062079383485:q=-.014741559220396223:q=-.00934935734853194:t[6]>32.50000000000001?q=.1514593126307404:q=.010771222510801532:t[10]>22.500000000000004?q=.01412495209334078:q=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let L;t[294]>1e-35?L=-.042529778074638265:t[266]>1e-35?L=-.1180276669679798:t[134]>1e-35?L=-.026818144353279623:t[183]>1e-35?L=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?L=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?L=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?L=-.03049646619610203:t[1]>50.50000000000001?L=.20634590755061122:L=.06956378103625731:t[0]>3770.5000000000005?L=-.07946414366134913:t[19]>1e-35?L=.17083312065604694:t[2]>21.500000000000004?L=-.02327981978127724:L=.129717297518715:t[145]>1e-35?L=.006891245076133524:L=-.0789123467863741:t[3]>99.50000000000001?L=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?L=.06447639919732716:L=-.05457561977645972:t[306]>1e-35?L=-.029995903305383882:t[191]>1e-35?L=.030596508110850414:t[242]>1e-35?L=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?L=.09518584795377832:L=-.018197744600833596:t[13]>1e-35?L=.006751790086127549:t[148]>1e-35?L=.01904174573618417:t[99]>1e-35?L=.025287735102561926:t[4]>14.500000000000002?L=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?L=-.09467943982430241:t[243]>1e-35?L=-.02521824751996268:L=.005437570718352172:L=-.022476214821960674;let U;t[0]>384.50000000000006?t[84]>1e-35?U=-.06088131453064195:t[147]>1e-35?U=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?U=.04219361472548491:U=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?U=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?U=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?U=-.11431764534511478:U=.013549717238356157:U=-.020987333767091276:t[6]>2.5000000000000004?U=-.02914877855133127:U=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?U=-.10087072787978416:t[37]>1e-35?U=-.030467397753331196:t[229]>1e-35?U=-.1017559811057469:t[4]>20.500000000000004?U=-.00413177742240167:t[20]>1e-35?U=.05213315982685969:U=.0037921635866823133:t[8]>51.50000000000001?U=.07327913092421544:t[6]>49.50000000000001?U=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?U=.02744420891894289:U=.11288946357194463:U=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?U=-.012329314369909049:U=.026816658655600168:U=-.0872405354618811:U=.007872673500247845:t[1]>42.50000000000001?U=-.04309044198258254:t[145]>1e-35?U=.07572529147860785:t[7]>5.500000000000001?U=-.013837187093264945:t[1]>17.500000000000004?U=.04208698439539668:U=-.06284346769019863;let j;t[294]>1e-35?j=-.0384794324818203:t[266]>1e-35?j=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?j=.07432960094940501:j=-.035248735855751855:t[134]>1e-35?j=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?j=-.01706896375068821:j=.08212247914968074:t[2]>59.50000000000001?j=-.09546478958824225:t[6]>53.50000000000001?j=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?j=.02816463285971267:j=.15449139016588445:j=-.10199787406123524:j=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?j=-.13924786681478077:j=-.0072772442570213335:t[39]>1e-35?j=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?j=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?j=-.11174465335620831:j=.00013144040097180107:j=-.08493919336681105:t[42]>1e-35?j=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?j=-.015540659878839153:j=-.14442609417300142:t[21]>1e-35?j=-.025251979447574083:j=.0023698372645272847:t[18]>1e-35?j=.07269739695712212:t[8]>2592.5000000000005?j=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?j=-.01835130329646532:t[9]>45.50000000000001?j=.02023047454629885:j=.16469378262221102:j=-.042975030085836426;let Q;t[8]>2915.5000000000005?t[297]>1e-35?Q=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?Q=-.01034964686484714:Q=-.07357437440667927:Q=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?Q=-.09476398869062203:t[9]>72.50000000000001?Q=-.0757383854264379:Q=.02806542779508718:Q=-.05147742568418084:Q=.10212721564444344:Q=.0518263760642861:Q=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?Q=-.10669213185972036:Q=.027050434286384796:t[302]>1e-35?Q=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?Q=.06354599160071946:t[1]>67.50000000000001?Q=.05317447949011187:Q=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?Q=-.09369289448773599:t[0]>2215.5000000000005?Q=.04077965380363924:t[0]>807.5000000000001?Q=-.0591771776458298:Q=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?Q=-.016323380219241672:Q=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?Q=.03720704290087811:Q=-.008730548158766654:t[4]>80.50000000000001?Q=-.05346644687473197:Q=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?Q=.019984510398089086:Q=-.03917825025861855:t[9]>170.50000000000003?Q=-.09759719821334525:Q=-.0023586682752856298;let Y;t[183]>1e-35?t[17]>1e-35?Y=.030100940443356424:t[10]>1.5000000000000002?Y=-.10861112216742408:Y=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?Y=-.032062878390325456:Y=-.10808232631806887:t[8]>1641.5000000000002?Y=-.06147013392655731:t[4]>12.500000000000002?Y=.03324767551088266:t[145]>1e-35?Y=.028851633810612017:Y=-.054871239091792784:t[134]>1e-35?Y=-.023813968121342108:t[266]>1e-35?Y=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?Y=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?Y=-.025350325484720576:Y=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?Y=.056817276537534815:Y=-.07674158463557636:Y=-.06335553143454145:t[1]>56.50000000000001?Y=.16390494217299284:Y=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?Y=.041717597065890205:Y=-.10357913492269129:t[10]>29.500000000000004?Y=.1365512866715726:Y=.020600048310575665:Y=.09708785634773187:Y=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?Y=-.03146213719547347:Y=.11784024316238083:Y=-.050940520532045355:Y=-.047988344143075616:t[191]>1e-35?Y=.028764654731460032:Y=.0011911575567860023;let W;t[294]>1e-35?t[10]>50.50000000000001?W=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?W=-.05103908560370243:W=.05002066201169583:W=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?W=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?W=.127983140816313:W=-.05436534163636867:W=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?W=-.009504203657088933:t[8]>819.5000000000001?W=.18689664822602375:W=.03635576744011826:W=-.029862411809998525:t[223]>1e-35?W=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?W=-.09405026597863717:t[0]>4153.500000000001?W=.053577663326799765:W=-.05062127873995668:W=.06512222894425874:t[39]>1e-35?W=-.04985311717827547:t[51]>1e-35?W=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?W=-.02860634573675884:W=.08863753005590103:W=.11158892111063744:t[0]>655.5000000000001?W=-.031005736641654926:W=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?W=-.00843386136334982:W=-.05273594615999777:W=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?W=-.015774115523598486:W=.10147367091236065:W=-.048307000563071016:W=.002118376117677254;let V;t[8]>1014.5000000000001?t[9]>137.50000000000003?V=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?V=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?V=.07211107542565391:V=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?V=-.0751486415451188:t[1]>59.50000000000001?V=.13459005084554104:V=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?V=.06715575425741895:V=-.005895690393702183:t[8]>2915.5000000000005?V=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?V=-.00029068886245881074:V=.0613467393188786:t[148]>1e-35?V=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?V=.003887223773199377:V=-.08553893131979015:V=.025654192706396767:V=-.05651733979610658:V=-.02039913645229667:t[2]>7.500000000000001?V=-.1058450646728524:V=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?V=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?V=.1283258201586378:V=-.01718135372229775:V=-.07702452408491414:t[125]>1e-35?V=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?V=.04273051857848212:V=-.04533122948101463:t[2]>196.50000000000003?V=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?V=.0231032972703664:V=-.04807386814498683:V=.002729435991332102;let z;t[179]>1e-35?z=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?z=.026484626664041125:t[10]>1.5000000000000002?z=-.10187000872941615:z=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?z=.09574540795390041:z=-.06454986703691233:z=-.11411849349353141:t[266]>1e-35?z=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?z=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?z=-.04403391373512386:z=.1132928075412222:t[2]>47.50000000000001?z=-.09700191391838056:z=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?z=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?z=-.001668912999010927:z=-.02363511102970245:t[8]>58.50000000000001?z=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?z=.0911011436534449:t[1]>28.500000000000004?z=-.07192390493729035:z=.06913818091291246:z=-.012312625373699222:z=.06784496312307986:z=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?z=.0026564453057705273:z=-.025425772389361445:t[122]>1e-35?z=-.12046786388602149:t[0]>3183.5000000000005?z=.01162092842804907:t[91]>1e-35?z=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?z=-.0001647792543020228:z=-.023664538532907665:z=.01609078206180752;let ie;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ie=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ie=-.017696526862422682:ie=.1450050954613223:ie=-.05406930069823832:ie=-.08308700260259043:t[120]>1e-35?ie=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ie=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ie=.038431826961746934:ie=-.05937462906539856:t[9]>65.50000000000001?ie=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ie=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ie=-.09579030954062734:ie=.025064711572811746:ie=.02579440518821548:ie=.1044440128091862:ie=-.058348633139536844:ie=.07766788227934436:ie=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ie=.07463684068207214:ie=.18244269035484484:t[6]>39.50000000000001?ie=-.06050050067471004:ie=.05787759066913493:ie=.010783225857972171:ie=.1674891243602606:t[4]>9.500000000000002?ie=-.004814132027475892:ie=-.14543299413454813:ie=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ie=-.07634466313617769:ie=.0287825335169114:ie=-.06894721943300268:ie=-.00023988459059521937;let H;t[131]>1e-35?t[1]>93.50000000000001?H=-.05706887458825395:t[2]>1.5000000000000002?H=.011446637886629108:H=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?H=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?H=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?H=.026278724448495064:H=.17053138400480508:t[0]>4463.500000000001?H=-.06482289890096041:H=.03026516489536295:H=-.031785170717683144:H=.1312690622980455:t[13]>1e-35?H=.14336922540461444:H=.03523850945454039:H=-.015407465968975714:t[39]>1e-35?H=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?H=-.0659975068798723:H=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?H=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?H=.057409156184759516:H=.2024322059866388:H=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?H=.010648654146284154:t[308]>1e-35?H=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?H=.12364025998551711:H=-.02247495081065243:t[1]>22.500000000000004?H=-.0726295464624251:H=.03481895086048152:t[0]>4331.500000000001?H=-.04775443357020673:H=.07172377425057568:t[2]>89.50000000000001?H=-.11782645274716962:H=.00010092665257989378;let re;t[147]>1e-35?re=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?re=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?re=-.016101990375700172:t[0]>2579.5000000000005?re=-.13045089661551845:re=-.02874367814784938:re=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?re=.17084176915326055:re=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?re=.10591712319944074:re=-.024082167264285:re=.16497698867036126:re=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?re=-.021012910475524206:re=-.13058422554298485:t[0]>1102.5000000000002?re=.10955864175201457:re=-.03566689354348996:t[1]>11.500000000000002?re=-.02093884208606101:re=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?re=-.013861861436128482:re=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?re=.10163873449625677:re=-.02779270277623805:t[1]>26.500000000000004?re=-.08035058228527389:re=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?re=-.007028075523033826:re=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?re=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?re=-.0032075580718124892:re=-.04442829143298883:re=-.06597073245775804:re=.0015594090939337751;let le;t[223]>1e-35?t[8]>668.5000000000001?le=-.12803889879260094:le=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?le=.08967966612917375:t[1]>39.50000000000001?le=-.059791671514498074:le=.05648934961902822:t[2]>59.50000000000001?le=-.08633234097449628:t[6]>53.50000000000001?le=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?le=.025606129643140924:le=.13835395886271978:le=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?le=-.09975506556937946:t[10]>36.50000000000001?le=-.09427724661655643:t[10]>24.500000000000004?le=.07329330653410447:le=-.02271182965807972:le=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?le=-.05082091374050816:le=.1687114435254966:t[0]>2314.5000000000005?le=-.06422664016383926:le=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?le=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?le=-.1274167728754332:le=.01308079126447365:t[4]>73.50000000000001?le=.13854015371106546:t[4]>48.50000000000001?le=-.03684255740123261:t[6]>45.50000000000001?le=.10329912215813097:t[10]>77.50000000000001?le=-.08630788656925215:le=.031022006843800853:t[1]>25.500000000000004?le=-.08278381528048026:le=.06664374548141594:t[84]>1e-35?le=-.05624227409079396:le=.00012184182357340415;let Le;t[179]>1e-35?Le=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Le=-.07595415373151816:Le=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Le=.022822510448266862:Le=.17491569312933697:Le=-.058362287133533565:t[2]>2.5000000000000004?Le=-.03633895806364428:Le=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Le=-.07294848747514579:Le=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Le=-.07009535282685533:t[8]>2640.0000000000005?Le=-.051761240111316276:t[131]>1e-35?Le=-.06245774419231631:Le=.03495606662854905:Le=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Le=.0015036626973581122:Le=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Le=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Le=.022343994371919224:Le=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Le=.07724450228328664:t[0]>3853.5000000000005?Le=-.15671707454435677:t[10]>28.500000000000004?Le=-.10179090671841723:Le=.014878216919760927:Le=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Le=.14054154485273487:Le=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Le=-.08632985141410315:Le=.005524157938954954:Le=-.08802502622523681:Le=-.0004649168897260341;let me;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?me=-.007458687464321174:me=-.09444966249102484:t[1]>23.500000000000004?me=.08564129697360716:me=-.07105002902845851:me=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?me=-.10326216566705966:t[1]>26.500000000000004?me=.0050539832484585365:me=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?me=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?me=.05783632021087773:t[10]>17.500000000000004?me=-.06720598671764105:t[1]>47.50000000000001?me=.097495825172558:me=-.013372242800584872:me=-.06463226787713715:t[42]>1e-35?me=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?me=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?me=.11051270080118503:me=.027719462817590454:t[8]>597.5000000000001?me=-.08441503592016869:me=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?me=-.12190088985091102:me=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?me=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?me=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?me=.016585157185448045:me=-.11032043771149425:me=.01586986028570486:t[8]>388.50000000000006?me=-.10592413013261853:me=.04930703248769364:t[13]>1e-35?me=.003621937787920821:me=-.0013786331198611841;let Oe;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Oe=.009769895322846493:Oe=-.10620052926943656:t[9]>19.500000000000004?Oe=.03781202525403449:t[9]>14.500000000000002?Oe=-.11485785321365344:t[9]>6.500000000000001?Oe=.07677177833073881:t[0]>4342.500000000001?Oe=-.07079285609687631:t[49]>1e-35?Oe=.06156814809246001:Oe=-.014788509042554625:Oe=-.032659201618470655:t[5]>5207.500000000001?Oe=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Oe=-.03094160322187924:t[1]>29.500000000000004?Oe=.09474646043921069:Oe=.023445783928231618:Oe=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Oe=-.07164443768784848:t[1]>29.500000000000004?Oe=.089473622509272:t[8]>597.5000000000001?Oe=-.08155349903101317:Oe=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Oe=-.004003900679358653:t[190]>1e-35?Oe=-.09236113461485262:t[8]>3198.5000000000005?Oe=-.0124130160451179:Oe=.018453070064009328:t[15]>1e-35?Oe=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Oe=-.0009580759587680961:Oe=-.03227283036698222:Oe=.01369287669536875:t[1]>50.50000000000001?Oe=-.04213060332500437:t[35]>1e-35?Oe=-.11508095777767471:t[190]>1e-35?Oe=-.08611884672400155:t[297]>1e-35?Oe=.05723551879433584:Oe=-.004829340082311461;let Te;t[183]>1e-35?Te=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Te=-.11753465135886734:Te=-.007515490299047085:Te=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Te=-.12371142493530439:t[1]>36.50000000000001?Te=.032189417575190435:Te=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Te=-.0784518658439288:t[2]>54.50000000000001?Te=.12477882322370665:Te=.000313468482399738:Te=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Te=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Te=.0353146070135579:Te=-.06327619611098285:Te=.02813577701641991:Te=-.12354390728506215:t[34]>1e-35?Te=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Te=-.01245803535276381:Te=-.07169472553475001:t[1]>11.500000000000002?Te=.12989984824561698:Te=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Te=.010390226893521422:t[10]>14.500000000000002?Te=.16790888126487719:Te=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Te=-.043398307129729134:Te=.09963544907820426:t[9]>30.500000000000004?Te=-.13540713124984502:t[9]>17.500000000000004?Te=.0509435850590757:Te=-.04761897852404613:t[4]>78.50000000000001?Te=.09197086656470652:Te=.0006771050176682337;let te;t[122]>1e-35?t[6]>36.50000000000001?te=.05686884451670743:te=-.05334759543084309:t[266]>1e-35?te=-.08603579519816038:t[157]>1e-35?te=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?te=-.0499592651503952:t[0]>725.5000000000001?te=.11780353905132664:te=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?te=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?te=-.03190157229022304:te=.07985197845805492:te=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?te=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?te=-.027174047777029083:te=.057117284879796476:t[3]>43.50000000000001?te=-.0016147040913107311:te=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?te=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?te=-.01466076988151239:te=.13375695925484857:te=-.04885873081899647:t[0]>5566.500000000001?te=.11086813028591343:t[8]>992.5000000000001?te=-.07622304217072383:te=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?te=.03285858361708423:te=-.12354858211764992:te=.0672788301823281:t[15]>1e-35?te=.08658836986585006:te=-.02741484278509758:t[290]>1e-35?te=-.08161310335133287:t[135]>1e-35?te=-.04824156054814152:te=.0009156904299554183;let ee;t[3]>7.500000000000001?ee=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ee=.03642374718166293:ee=.16379973756366603:ee=-.03946685266127979:t[186]>1e-35?ee=.07618896623420895:t[96]>1e-35?ee=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?ee=-.022822371600847505:ee=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?ee=.044416424920571296:ee=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?ee=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?ee=.1061937286809567:t[7]>54.50000000000001?ee=.11487507743121311:t[8]>819.5000000000001?ee=-.07181278009001418:t[10]>25.500000000000004?ee=.13499019430369633:t[1]>31.500000000000004?ee=.09032979489780704:ee=-.12754166393372374:t[9]>37.50000000000001?ee=-.05093963635361407:ee=-.005026651151683848:t[9]>2.5000000000000004?ee=.07619735785573735:ee=.012363301341532136:t[26]>1e-35?ee=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?ee=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?ee=-.10764172927882483:ee=.01890760098464703:ee=.06573095405846417:t[8]>634.5000000000001?ee=-.00783575973273707:ee=-.050612689680229306:t[1]>22.500000000000004?ee=-.0016842490401359626:ee=.0738227088444087:ee=-.02663970950432175;let K;t[31]>1e-35?t[8]>17.500000000000004?K=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?K=.007191286124908192:K=-.09347881647636902:t[10]>1.5000000000000002?K=.07938758708008091:K=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?K=.12321804057595996:K=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?K=-.04644244754790671:K=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?K=.0706108609273337:t[2]>40.50000000000001?K=-.028046629962303716:K=-.06497613993109329:K=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?K=-.03056331974267756:K=-.11886389712497057:K=.053364962175658184:t[8]>2233.5000000000005?K=-.0448152521157682:K=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?K=.03818796510453344:K=.23673992112982362:K=.02858814226507374:t[10]>44.50000000000001?K=-.1125863771551199:K=.009129996952394916:t[1]>7.500000000000001?K=-.004374525302461639:K=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?K=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?K=-.13677189943034931:t[10]>2.5000000000000004?K=.039591891437078086:K=-.09312596849507347:K=-.02423172142089822:K=.0009836986075266283;let he;t[189]>1e-35?t[0]>5269.500000000001?he=-.103183298350443:t[2]>51.50000000000001?he=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?he=-.05186168947388339:he=.0496996365539082:t[10]>23.500000000000004?he=.1404445738719:t[93]>1e-35?he=.0027146310074558505:t[5]>3821.5000000000005?he=.002153033152069652:t[4]>2.5000000000000004?he=.007663539551317215:he=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?he=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?he=-.021479467709980358:he=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?he=.021660293256233334:he=-.0927396152303864:he=.0665074081601698:t[0]>1550.5000000000002?he=.08972407105958534:he=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?he=.06761927942466854:he=-.015762168112653286:t[17]>1e-35?he=.10311304131145381:he=-.017672785252336027:he=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?he=-.10638321435298535:he=.0007073011744385905:t[18]>1e-35?he=-.027056185501334325:t[145]>1e-35?he=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?he=.09762140519655171:t[9]>110.50000000000001?he=-.06581942957595835:t[6]>54.50000000000001?he=.04959634035251596:he=.0022616298654554207:he=-.007437620924990854;let X;t[179]>1e-35?X=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?X=.1470294450403005:X=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?X=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?X=.07965955447707423:t[10]>10.500000000000002?X=-.09236156404262426:X=.03396273196231458:X=-.13246465021467432:X=.07092822261735353:X=-.08753829085942:X=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?X=.004705878789890202:X=.13775378964952867:X=-.04770928980587811:t[10]>29.500000000000004?X=.011221519891071544:t[0]>3853.5000000000005?X=.06365381191628273:X=.15506252245336827:t[1]>37.50000000000001?X=-.07254777021042061:X=.026514587757252385:t[308]>1e-35?X=.04115804816617256:t[10]>26.500000000000004?X=.02077721353011946:t[5]>3548.5000000000005?X=-.1280907116663952:X=-.021974774274438:t[306]>1e-35?X=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?X=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?X=-.005710865560475598:t[94]>1e-35?X=-.06751507982853555:X=.027250040757588703:t[9]>52.50000000000001?X=.07060357924595577:X=-.030297760713011795:X=-.0006005400085266517;let de;t[113]>1e-35?de=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?de=-.06996356565314456:de=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?de=-.08317707559926495:t[21]>1e-35?de=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?de=-.010538203005984922:de=.08454819465349446:t[9]>124.50000000000001?de=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?de=-.08542251249346582:t[9]>50.50000000000001?de=-.023428882537657472:de=.010042500833979073:de=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?de=.03006025206979096:t[9]>108.50000000000001?de=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?de=.04222035773042132:de=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?de=-.07209095448054853:de=.028065954981903313:de=.08714651929917122:de=-.006678820669279169:t[10]>40.50000000000001?de=.006982396294941626:de=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?de=-.09351114982645548:t[4]>3.5000000000000004?de=-.004837550129223451:de=-.08324141237464677:t[303]>1e-35?de=.10703037493990825:t[9]>156.50000000000003?de=-.10803018621648303:t[116]>1e-35?de=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?de=.10261721665006701:de=.018994509090668264:de=.0011244262442038839;let Be;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?Be=-.08404263465005328:t[0]>3682.5000000000005?Be=.041259223920298876:t[1]>29.500000000000004?Be=-.09541257493441671:Be=.001482192721625409:Be=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?Be=-.08268996098437432:t[230]>1e-35?Be=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?Be=-913218977737457e-19:t[4]>10.500000000000002?Be=-.056334165674005156:t[127]>1e-35?Be=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?Be=-.04231200150318989:t[10]>42.50000000000001?Be=.10182973257894812:Be=.015934763950068445:Be=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?Be=-.041117068322885315:Be=.1167767830037126:Be=.13611206992387337:t[10]>41.50000000000001?Be=-.07120286010564107:Be=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?Be=-.07702290997669524:t[198]>1e-35?Be=.08776558554437136:Be=-.008290740324975692:t[2]>32.50000000000001?Be=.07198457624219955:Be=.005463113714361629:Be=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Be=.03295785445437507:Be=.15140250150674536:Be=-.035613213948910254:t[186]>1e-35?Be=.06849425535860769:t[96]>1e-35?Be=.06028225812727254:Be=-.007582543288662308;let ne;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ne=.08396556264106572:ne=-.0562516995099192:ne=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ne=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ne=.0052017514017035915:ne=-.11194119432743639:ne=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ne=-.025692451287403446:ne=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ne=-.11892250746801664:t[10]>22.500000000000004?ne=.07548493166973796:ne=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ne=.13750699058082427:t[18]>1e-35?ne=.06535408879552801:ne=-.054118179035040674:ne=.1344282838979622:t[0]>3982.5000000000005?ne=-.10409582202467015:t[19]>1e-35?ne=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ne=.012705935670766466:ne=.14149359442527545:ne=-.047977876173706004:t[20]>1e-35?ne=.057945228080337946:t[0]>3642.5000000000005?ne=-.008726535792122467:ne=-.08424769891378858:t[34]>1e-35?ne=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ne=.01196849566739346:ne=.1614642278429876:ne=-.043022338150701625:t[3]>5.500000000000001?ne=-.03907848255033881:ne=.018280601026175593:ne=.0006654540402589085;let ue;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ue=-.01386103677247845:ue=.11386694333005128:t[4]>27.500000000000004?ue=-.021862617610091336:t[2]>31.500000000000004?ue=.0828858469030438:ue=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ue=.11303635767048735:ue=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ue=-.04238798044549342:ue=.022091190130494303:t[5]>5082.500000000001?ue=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ue=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ue=-.04291104140431434:t[17]>1e-35?ue=.11256797532342613:ue=-.017206916368289193:ue=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ue=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ue=.03581712466863222:ue=.14770264307668884:t[8]>73.50000000000001?ue=-.13093289429740068:ue=.042461737442702936:t[52]>1e-35?ue=.0501831919044939:ue=-.010450249720465756:ue=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ue=.0005381332165438493:ue=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ue=.04849637311285226:ue=-.036671377119808564:t[0]>421.50000000000006?ue=.00020968499911058945:ue=.11636422423182405:ue=-.12687837788222575:ue=.0012774367867215346;let Ne;t[120]>1e-35?Ne=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ne=-.042799574885345304:Ne=.07412430171193245:Ne=-.11248270469336048:t[193]>1e-35?Ne=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ne=.028911612178122104:Ne=.12326369727728437:t[0]>4091.5000000000005?Ne=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ne=.1159839898100149:Ne=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ne=-.0216343737351583:Ne=-.1220272260878369:t[2]>18.500000000000004?Ne=.09152924475072398:t[8]>55.50000000000001?Ne=.039508716651005665:Ne=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ne=.06793009902674053:Ne=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ne=-.04391068849624096:Ne=.04009967593394672:t[8]>1085.5000000000002?Ne=-.024773826356034825:Ne=-.13919707884246582:Ne=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ne=-.11567917501901476:Ne=-.006813640337684114:t[3]>7.500000000000001?Ne=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ne=-.001754586408351048:Ne=-.055422422450722056:Ne=-.06090032532532226:t[0]>5269.500000000001?Ne=.11787981735983527:Ne=-.00198119768540783:Ne=.00210412924303036;let xe;t[294]>1e-35?t[10]>50.50000000000001?xe=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?xe=-.06063239096209816:xe=.03317022411417386:xe=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?xe=-.013608609329298802:xe=.09078000157330264:t[99]>1e-35?xe=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?xe=-.07536137260189814:xe=.006253266595455118:t[10]>28.500000000000004?xe=-.006106041147592768:t[9]>156.50000000000003?xe=-.11828932797811101:t[94]>1e-35?xe=-.02566078479505714:t[303]>1e-35?xe=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?xe=-.08401252789168523:t[5]>4244.500000000001?xe=.026372887658499107:t[1]>16.500000000000004?xe=-.027836756345634026:xe=.09205362097909099:xe=.00934612788718244:t[203]>1e-35?xe=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?xe=-.09580979052540028:t[1]>50.50000000000001?xe=-.06402211827281554:xe=.08342858760095972:t[2]>36.50000000000001?xe=.008114897658204584:t[92]>1e-35?xe=.09541587072672864:xe=-.022342147210555434:xe=-.01660492519175128:xe=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?xe=.15846731118501817:xe=.039498507912023195:t[245]>1e-35?xe=.07008718676813333:xe=.0019806389728814727;let Fe;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Fe=-.01192072916082109:Fe=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Fe=.06874032717466054:t[4]>40.50000000000001?Fe=-.07752510020707537:t[1]>76.50000000000001?Fe=-.09944032260703917:t[8]>1381.5000000000002?Fe=-.054466635810800745:t[1]>32.50000000000001?Fe=.05974084520839573:Fe=-.0384718740755954:Fe=-.11374190719134032:t[0]>2151.5000000000005?Fe=-.13703645155803298:Fe=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Fe=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Fe=.013539805885738608:Fe=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Fe=.09941880179344399:Fe=-.01608127391210995:Fe=.08025226531247417:t[9]>67.50000000000001?Fe=.13525448212444113:t[6]>61.50000000000001?Fe=-.05511099182158894:t[94]>1e-35?Fe=-.06821509831783572:t[128]>1e-35?Fe=.11361314817714643:Fe=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Fe=-.09954181329804547:t[197]>1e-35?Fe=.10102833149755386:t[188]>1e-35?Fe=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Fe=-.03781554214742005:Fe=.09927933385592314:Fe=-.020006000056720083:Fe=-.10520473615957895:Fe=-.12006990846253787:Fe=-.00026111570975317574;let tt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[0]>1725.5000000000002?t[7]>14.500000000000002?t[2]>38.50000000000001?tt=-.019188245509744628:tt=-.13354864350075848:t[0]>2461.5000000000005?tt=.051885477468354396:tt=-.0833581968852119:tt=.08233441701532287:tt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?tt=.09926337893072812:tt=-.027753610497327715:t[0]>1972.5000000000002?tt=-.09780045823152517:tt=.032380915168504935:tt=.11502632261226381:t[17]>1e-35?tt=-.06094965899579662:t[10]>40.50000000000001?tt=-.07500475582440802:tt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?tt=-.09584538995220808:tt=-.00908705814304442:tt=.03203281520813893:t[10]>49.50000000000001?tt=-.03146271513986384:t[2]>63.50000000000001?tt=.13172001315536286:t[224]>1e-35?tt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?tt=.09521549382082259:tt=-.04414925613522197:t[0]>1847.5000000000002?tt=-.09118580379557353:tt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?tt=.03525144509943896:tt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?tt=-.04766112322938157:t[2]>10.500000000000002?tt=.0728516504357201:tt=-.05049625965272536:tt=-.10868663055825774:tt=.0005382613419948969;let st;t[147]>1e-35?t[1]>53.50000000000001?st=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?st=-.030504020655417463:st=.07102458639110094:st=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?st=.055304563442710876:t[1]>53.50000000000001?st=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?st=-.1568835288372895:st=-.0279829124400056:st=.04493843959601833:st=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?st=-.054133834303687026:t[9]>48.50000000000001?st=.11263810289007213:t[9]>9.500000000000002?st=-.02202034562838259:t[4]>45.50000000000001?st=-.03410927569045158:st=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?st=-.029687297407295893:st=.10673602850001934:t[4]>42.50000000000001?st=.0036275562945108117:st=-.0760789221330622:st=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?st=.08274426793676076:st=-.07076234425516396:st=.13890177606150175:st=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?st=-.09250637750836187:st=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?st=-.01897867921812603:st=.04890781705365262:st=-.11569892307597907:t[2]>106.50000000000001?st=.09032697440623969:st=.00047935919155035045;let vt;t[115]>1e-35?vt=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?vt=-.10131179514695865:t[8]>938.5000000000001?vt=.10203729808015481:vt=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?vt=.03574015165562999:vt=-.07763042506449493:vt=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?vt=.0665706259130275:vt=-.06586817559309924:vt=.11925564412287476:vt=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?vt=.046017146627455346:vt=-.08623321630086885:t[8]>1765.5000000000002?vt=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?vt=.11143827902215087:vt=-.01817808730473413:vt=.16980985030210127:vt=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?vt=.010168994879727824:vt=-.09099594488792513:t[9]>1.5000000000000002?vt=.0533459678147928:vt=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?vt=-.062346959148773695:t[1]>47.50000000000001?vt=-.0021578343835599316:t[2]>27.500000000000004?vt=.19567373210166172:vt=.07851555379116423:t[18]>1e-35?vt=.03711549097804649:t[8]>359.50000000000006?vt=.012492346746905587:t[4]>20.500000000000004?vt=.047511695735697544:vt=-.07999269063948773:vt=6802045404471004e-20;let Pt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Pt=.0011484728213539738:Pt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Pt=-.09828874964938798:t[8]>1586.5000000000002?Pt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Pt=.011938269926919522:Pt=.17541983715953954:t[19]>1e-35?Pt=.023002786011088672:Pt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Pt=.06508934844183291:Pt=-.10168553534835639:Pt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Pt=.021140806225203937:Pt=-.1167833342453639:t[2]>33.50000000000001?Pt=.13163585734056618:Pt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Pt=.06314479201263888:Pt=-.09639088327091713:t[10]>29.500000000000004?Pt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Pt=40577156464836036e-21:Pt=.12322387121810757:Pt=-.03697224045046014:t[1]>22.500000000000004?Pt=.016474835887320276:Pt=.16919298733903063:Pt=.07633203630214054:Pt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Pt=.14150493354700563:Pt=-.01831155354975749:t[1]>28.500000000000004?Pt=-.07952557178685365:t[10]>28.500000000000004?Pt=.0665695554984927:Pt=-.053640139319277094:Pt=.0004754840665898665;let Ht;t[76]>1e-35?Ht=-.06814884255939921:t[179]>1e-35?Ht=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?Ht=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?Ht=.004193658608848433:Ht=-.1066968975983452:t[8]>302.50000000000006?Ht=.05476730110440451:Ht=-.06382970920394895:t[218]>1e-35?t[2]>3.5000000000000004?t[6]>13.500000000000002?t[2]>19.500000000000004?t[0]>3200.5000000000005?t[4]>91.50000000000001?Ht=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?Ht=.013555772109446666:Ht=-.09856116699770784:Ht=.0284329611813383:t[2]>52.50000000000001?Ht=.04008708444763762:t[9]>29.500000000000004?Ht=-.1289599546008197:Ht=-.018566534248335896:t[8]>747.5000000000001?Ht=.02236484980076122:Ht=.1148871655157582:t[8]>3084.0000000000005?Ht=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?Ht=.03164751204281298:Ht=.11752140436184891:t[9]>42.50000000000001?Ht=-.07180559595410106:t[22]>1e-35?Ht=.09325040416256854:Ht=-.016041122807939914:Ht=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?Ht=-.010718250133458515:Ht=.09818827994853763:Ht=.010180038981174032:Ht=-.039472162599295535:t[9]>170.50000000000003?Ht=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?Ht=-.08674788057474031:Ht=.02077653508548371:Ht=-.0003536561382007414;let F;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?F=.018337297491457794:F=-.05926206443180149:F=.024026520855881126:t[288]>1e-35?t[184]>1e-35?F=.10747078482128616:t[126]>1e-35?F=-.10550625192391357:t[7]>71.50000000000001?F=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?F=.1317396472229434:F=-.025035791351328947:F=-.0728334305864372:t[8]>963.5000000000001?F=.023642201723096064:F=.183010326734258:t[128]>1e-35?F=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?F=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?F=-.1088876900335281:F=.02758317023002635:F=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?F=-.01928020117446408:F=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?F=.07893723375925096:F=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?F=-.10301657587280551:F=.005787463140224318:F=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?F=-.019296977889522397:F=-.07274529751752634:t[1]>30.500000000000004?F=-.050368901143148286:F=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?F=.0015332402792773946:F=.09930153676749967:F=-.06370844564357069:F=.00042272155209927616;let se;t[71]>1e-35?t[4]>17.500000000000004?se=.12586844370423247:se=-.006791999603126354:t[222]>1e-35?t[1]>10.500000000000002?t[30]>1e-35?t[1]>36.50000000000001?t[9]>1.5000000000000002?t[10]>25.500000000000004?se=-.08474891624263797:t[8]>125.50000000000001?se=.08125086980439704:se=-.04082085238068532:t[0]>3863.5000000000005?se=.020481535807469208:se=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?se=-.019110200161573936:se=-.12387719685855114:t[0]>1102.5000000000002?se=.08376595701957407:se=-.031821919580524834:t[9]>4.500000000000001?se=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?se=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?se=.1349841206807871:se=.011864053595560297:t[1]>41.50000000000001?se=-.08203662486612544:t[2]>18.500000000000004?se=-.009541865642346947:se=.08345043168501759:t[2]>10.500000000000002?se=-.09585031818030947:se=.019432330487099865:se=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?se=.11951517733981365:se=-.016651014735738538:t[1]>28.500000000000004?se=-.07410922545030711:t[10]>28.500000000000004?se=.05886430683844788:se=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?se=.04802269879144705:se=-.026208212831796737:t[4]>45.50000000000001?se=-.03227476944664786:se=.05124575625622705:se=.00020506696916003137;let be;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?be=-.03042091758483443:t[10]>14.500000000000002?be=.09816619204768777:be=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?be=-.02381165060401718:be=-.10950361804974783:be=.03538211665111128:t[212]>1e-35?t[19]>1e-35?be=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?be=-.06371052144380579:be=.0835500621252692:be=-.10408255929333915:t[1]>74.50000000000001?be=.13208968122712403:t[1]>64.50000000000001?be=-.04778844603644965:t[8]>51.50000000000001?t[8]>201.50000000000003?t[8]>660.5000000000001?t[6]>4.500000000000001?t[9]>5.500000000000001?t[1]>29.500000000000004?t[0]>3830.5000000000005?be=.09922816902423433:be=.016366955328796718:be=.1592412560903584:t[1]>39.50000000000001?be=.05409467990258923:be=-.08260633210459611:be=-.06307205775247567:t[9]>36.50000000000001?be=.040253940015648144:be=.14202568969471283:be=-.028761848341594044:be=.08994073058773508:t[0]>807.5000000000001?be=-.043427848826323195:be=.04573516446846493:t[20]>1e-35?t[188]>1e-35?be=-.0758877731600639:t[23]>1e-35?be=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?be=.08124700978741987:be=.013296063087086852:t[7]>5.500000000000001?be=-.01640196088612987:be=-.12685498840146067:be=-.0004940792382459551;let Ue;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Ue=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?Ue=.08513773825688947:Ue=-.1184664832315282:Ue=.05676963535893477:Ue=.14263843210340613:Ue=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?Ue=-.10669720555606924:Ue=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?Ue=.0664744575868955:Ue=-.08469256188890871:Ue=-.026746678040592144:t[281]>1e-35?Ue=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Ue=.012131807587207655:Ue=-.12776015795398743:Ue=.04320472481083551:Ue=.08390980661550446:t[10]>227.50000000000003?Ue=-.09771783809101153:t[10]>130.50000000000003?Ue=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?Ue=-.07610698254064358:t[8]>902.5000000000001?Ue=-.03136381213599649:t[131]>1e-35?Ue=.0704821739127936:t[224]>1e-35?Ue=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?Ue=.10431473040024908:t[8]>841.5000000000001?Ue=.07304745320500514:Ue=-.038011541882439825:Ue=-.01679746695007364:t[0]>3129.5000000000005?Ue=.05589952587431965:t[210]>1e-35?Ue=.06227198085800842:Ue=-.0011341890997947812:t[8]>740.5000000000001?Ue=.04817300084412584:Ue=-.000577001010789238;let Qe;t[187]>1e-35?t[6]>12.500000000000002?t[10]>8.500000000000002?t[10]>16.500000000000004?t[8]>234.50000000000003?t[4]>43.50000000000001?t[0]>4476.500000000001?Qe=-.10504730480402079:t[5]>3341.5000000000005?Qe=.11087894671081754:Qe=-.0406668834674614:Qe=.03308382165616109:t[8]>104.50000000000001?Qe=-.10431436764549162:Qe=.0073928337244891455:t[4]>34.50000000000001?Qe=-.10571751512748416:Qe=-.006081128814142983:t[13]>1e-35?Qe=.1299673566095023:t[4]>60.50000000000001?Qe=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Qe=.04857126072645073:Qe=-.03431365358104773:t[4]>16.500000000000004?Qe=.04101865986596709:Qe=.16480274980378218:t[10]>26.500000000000004?Qe=.03673978504199255:t[10]>9.500000000000002?Qe=-.10996402743800027:t[308]>1e-35?Qe=.0553693735082498:Qe=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Qe=.010902983761213922:Qe=.1325118659895645:Qe=-.064362945508595:t[1]>66.50000000000001?Qe=.033416767779331176:Qe=-.054080316225040496:t[42]>1e-35?Qe=-.07762364337810815:t[10]>1089.5000000000002?Qe=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Qe=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Qe=.0220102041325908:Qe=-.06516708740003069:Qe=.012833498905748267:t[224]>1e-35?Qe=-.007038418272997865:Qe=.00037666304316290967;let ge;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ge=.07554189644995735:ge=-.052089349455904946:ge=-.10148206848169845:t[113]>1e-35?ge=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?ge=.07172653627995676:ge=-.07602959317610998:ge=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?ge=-.0399322883690891:ge=.06523495517476098:ge=-.10358715295743802:t[193]>1e-35?ge=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?ge=.015928764772252406:ge=.1341513061552287:ge=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?ge=-.033592997607280156:ge=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?ge=-.08402551858097379:ge=.017401984506038796:t[1]>25.500000000000004?ge=.13337205393591278:ge=-.01160208350090984:ge=.06708317942315471:t[8]>227.50000000000003?ge=-.08486943882418681:ge=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?ge=-.10496268177586783:ge=-.020921489532370493:ge=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?ge=.11639296062157028:ge=-.004275784356569115:t[32]>1e-35?ge=-.07297384970166025:ge=.006026841626381599:ge=.002034611134960428;let Z;t[248]>1e-35?Z=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Z=-.06455513326540585:t[1]>29.500000000000004?Z=.07718474591552532:t[4]>7.500000000000001?Z=.040139336931404826:Z=-.09685734690563386:Z=.00015327283570347363:t[9]>88.50000000000001?Z=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Z=-.04077257804338707:Z=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Z=.03778141591008941:Z=-.06459919920634845:Z=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Z=.14063930759326346:t[0]>179.50000000000003?Z=.07287482250668585:t[8]>1180.5000000000002?Z=-.14419393112726253:t[10]>28.500000000000004?Z=-.07993142770099469:t[17]>1e-35?Z=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Z=.05527969663610186:Z=-.10824385941441346:t[3]>11.500000000000002?Z=.12358502961047915:Z=-.017509147119622873:t[0]>74.50000000000001?Z=-.014907705458730486:t[8]>95.50000000000001?Z=-.02225118168342062:Z=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Z=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Z=.04962819555610421:Z=-.07213577821855309:Z=.09139529824708481:t[19]>1e-35?Z=.013439401088345224:Z=-.049274647207292056:Z=.10531673719686951;let ve;t[40]>1e-35?t[0]>1937.5000000000002?ve=-.06421671152073961:ve=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?ve=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?ve=-.03520420769287065:t[8]>1085.5000000000002?ve=-.019817352506127633:ve=.11444439424520964:ve=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?ve=-.010490117519863269:ve=.08104430117757461:t[121]>1e-35?t[243]>1e-35?ve=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?ve=.06619344145920268:t[0]>4091.5000000000005?ve=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?ve=.10016091391222309:ve=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?ve=-.019511460451434884:ve=-.11643672465055221:t[2]>18.500000000000004?ve=.07848228087333317:t[8]>55.50000000000001?ve=.032583027899956235:ve=-.11209832692153521:t[11]>1e-35?ve=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?ve=-.09996887746328006:t[9]>2.5000000000000004?ve=.02157682011863397:ve=-.05247727848991843:ve=.07409150201483244:t[1]>38.50000000000001?ve=-.11378466075449625:t[224]>1e-35?ve=-.10741749127732923:t[1]>26.500000000000004?ve=.07343136534146562:ve=-.07013573628594773:t[25]>1e-35?ve=-.04626669734164317:ve=.05518333197956482:ve=.00032434010867555516;let Ge;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?Ge=.026313251010808853:Ge=-.08997339150292381:Ge=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?Ge=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?Ge=.0905155504503746:t[8]>1049.5000000000002?Ge=-.062312558183394054:t[8]>719.5000000000001?Ge=.09583836191410239:t[0]>3719.5000000000005?Ge=-.0778097309430818:Ge=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?Ge=-.12920865648544927:t[0]>2699.5000000000005?Ge=-.07086587879041864:Ge=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?Ge=-.11377786322600797:Ge=-.009486325820117998:t[1]>55.50000000000001?Ge=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?Ge=-.07938291201004219:t[2]>36.50000000000001?Ge=.01520046732530246:Ge=.13649854049662832:Ge=-.07145015938528873:t[8]>407.50000000000006?Ge=-.00350257360822279:Ge=.11332047082193297:Ge=-.10060624458629897:Ge=.05429496612497562:t[8]>1446.5000000000002?Ge=.006073419197482838:Ge=-.08718676350883998:Ge=-.11532497988252638:Ge=.10766270463068293:t[34]>1e-35?Ge=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?Ge=-.0004109812623829506:Ge=.021601073497455662:Ge=-7343540098965853e-20;let qe;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?qe=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?qe=.05995640200798119:t[0]>3443.5000000000005?qe=-.14698883458733583:qe=-.030039164579240187:t[189]>1e-35?qe=-.06086763220538141:t[1]>86.50000000000001?qe=-.05096727866142538:t[4]>64.50000000000001?qe=.11240554253834577:t[4]>45.50000000000001?qe=-.030279760168394117:t[6]>45.50000000000001?qe=.10161088917815142:t[10]>77.50000000000001?qe=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?qe=-.06672020005240323:qe=.08831457502630258:t[8]>2592.5000000000005?qe=-.052617701047376654:t[10]>29.500000000000004?qe=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?qe=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?qe=-.064099222705728:qe=.044332487521538365:t[0]>2882.5000000000005?qe=.031099546885005065:qe=.12938467051623853:t[0]>4221.500000000001?qe=-.0928676413498701:t[9]>30.500000000000004?qe=-.05781824812803708:qe=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?qe=-.06648105454098469:qe=.05985487552383097:qe=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?qe=.05282385499619401:t[1]>66.50000000000001?qe=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?qe=.027885690791379255:qe=-.08407126408362446:qe=.014432924125571093:qe=-9903435845205118e-20;let je;t[76]>1e-35?je=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?je=.013633653464240465:je=-.10164319411983509:je=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?je=.00632864847804078:je=-.08393000368134668:je=.07870508617440916:t[284]>1e-35?je=.1092302727710421:je=-.0025505047582483234:t[248]>1e-35?je=.07101822393621864:t[274]>1e-35?je=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?je=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?je=.025081789181021243:je=-.014813325803582618:t[9]>33.50000000000001?je=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?je=.11926990418060353:je=.01852125513565268:je=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?je=-.1178464984373743:t[283]>1e-35?je=.043370859226927405:t[5]>4320.500000000001?je=-.01103141226366587:t[8]>1104.5000000000002?je=-.023053423988095886:je=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?je=.000579145585864887:je=.03389152834202143:t[128]>1e-35?je=-.14527722052568462:t[210]>1e-35?je=-.08915971541902741:t[7]>9.500000000000002?je=-.03307314577076116:t[18]>1e-35?je=-.05521712302023565:je=.009315605032770029:je=.0036332551852289933;let J;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?J=-.07583539600416284:t[188]>1e-35?J=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?J=-.011038193049597113:J=.08154028164397753:t[1]>85.50000000000001?J=.10259361975201933:J=.011640408330521594:J=-.00023319159023748508:t[92]>1e-35?J=.13771692859530546:J=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?J=.09967230141007705:t[30]>1e-35?J=-.08888529037551285:J=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?J=.08284665960761373:J=-.029292565021289504:t[7]>7.500000000000001?J=-.09945093355204493:J=-.008381393701708593:t[20]>1e-35?J=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?J=.07585582641438211:t[8]>284.50000000000006?J=-.029387993239886723:J=.07716738177321587:t[1]>18.500000000000004?J=.026745348497993746:J=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?J=.02337306890530338:J=-.10390355904767366:J=.07390521199638532:J=-.06788247515155237:J=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?J=-.06360325615644084:J=.04342192339836601:J=-.10598779152030145:J=.05253384605768211;let ae;t[3]>7.500000000000001?t[157]>1e-35?ae=-.07514182877923786:ae=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ae=.028692053800951845:ae=.14081686716133598:ae=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?ae=.0037139292567243084:ae=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?ae=.01202688580305612:ae=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?ae=.043935495082738626:ae=-.05639305759669704:t[247]>1e-35?ae=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?ae=.10331836202616368:ae=.0006926658459781341:t[96]>1e-35?ae=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?ae=-.0741403257305367:ae=.022900127535540854:t[7]>3.5000000000000004?ae=.038110741403836294:ae=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?ae=-.09552842289807008:t[1]>27.500000000000004?ae=.012505935885798007:ae=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?ae=-.1046104767723845:ae=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?ae=.023466328488582572:ae=.11730925774586994:ae=-.04771965631104874:ae=.17059689880751394:ae=-.08181850955999449:t[26]>1e-35?ae=-.12727482696678769:ae=-.014343123272734182;let Ce;t[147]>1e-35?t[1]>53.50000000000001?Ce=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Ce=-.02763546051134888:Ce=.06423344777499343:Ce=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?Ce=.049825139823021586:t[7]>22.500000000000004?Ce=-.01131680751379858:t[0]>2579.5000000000005?Ce=-.10673674485369694:Ce=-.015387212937189957:Ce=.04347325151148724:t[179]>1e-35?Ce=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Ce=.0650355590939066:Ce=-.0473332870892226:Ce=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?Ce=.11139543329789044:t[126]>1e-35?Ce=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?Ce=.06370903833231022:t[10]>29.500000000000004?Ce=.03415223859607161:t[10]>3.5000000000000004?Ce=-.07415518117873297:Ce=-.0014119203473324082:Ce=.12617652343819508:t[9]>41.50000000000001?Ce=-.10311145857176976:t[8]>2757.5000000000005?Ce=-.08106484219011428:t[7]>71.50000000000001?Ce=-.09783384432091176:t[1]>88.50000000000001?Ce=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?Ce=-.008884084501608536:Ce=.061339437777743616:Ce=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?Ce=.01526664064166223:Ce=.13534828515415498:Ce=-.06985484465894776:Ce=.0005758961943178744;let Re;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Re=-.029152732370514342:Re=.07173628916139178:t[1]>36.50000000000001?Re=-.08859111297255318:Re=.0018030071815630785:Re=.13652461563759322:Re=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Re=-.07145140450454163:t[21]>1e-35?Re=-.07422841663493233:Re=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Re=.11864240653986852:t[3]>33.50000000000001?Re=-.08821209591953476:Re=.05706392280054726:Re=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Re=.01953613016837112:Re=-.059781039130025006:t[148]>1e-35?Re=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Re=.07207826841738371:t[202]>1e-35?Re=.08163917539410503:Re=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Re=-.06858280496900336:Re=-.1781828899516648:Re=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Re=.018232649414147116:Re=-.04419781124222661:Re=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Re=.11452368095776105:Re=-.036496437259924026:Re=-.040445338739465486:Re=.0816572651001145:Re=-.08968914517368663:Re=.0002826343082585516;let $e;t[189]>1e-35?t[0]>5269.500000000001?$e=-.08839493050459957:t[10]>85.50000000000001?$e=.10046908365702462:t[8]>2592.5000000000005?$e=-.09632233975926387:t[8]>2000.5000000000002?$e=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?$e=.035504970430426296:t[1]>31.500000000000004?$e=-.1133764813142531:$e=-.01138280942244812:t[8]>1125.5000000000002?$e=.09800530246229806:$e=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?$e=.07316772160107896:$e=-.059095014819051765:$e=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?$e=-.09150209066166894:t[8]>3084.0000000000005?$e=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?$e=-.04449234460408263:$e=.05568837973347338:$e=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?$e=.12741077850267066:$e=.007372371864985329:t[2]>39.50000000000001?$e=.02295917234617787:$e=.14966532083907075:t[1]>39.50000000000001?$e=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?$e=-.02511861881285652:t[1]>27.500000000000004?$e=.08683660011672288:$e=.02956214835267301:t[9]>15.500000000000002?$e=-.016538805462996232:$e=.04352738094981517:$e=-.05561856645643868:t[9]>170.50000000000003?$e=-.07996752635874248:t[179]>1e-35?$e=-.09065975936933919:$e=-.00042817975060427177;let Ye;t[39]>1e-35?t[4]>25.500000000000004?Ye=.03443173196222934:Ye=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?Ye=-.0013415395759330318:Ye=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?Ye=.002297618040307216:Ye=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?Ye=-.015297257305397608:Ye=.09651828834062742:Ye=-.06636003334371929:t[10]>11.500000000000002?Ye=.17631616138309397:t[0]>1639.5000000000002?Ye=3804386478092585e-20:Ye=-.09099296398683193:Ye=-.06874415876172972:t[0]>2151.5000000000005?Ye=-.1311264883406766:Ye=.00809052010141122:t[253]>1e-35?Ye=-.06338558211939296:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?t[10]>10.500000000000002?t[0]>3615.5000000000005?Ye=.045038497754638605:Ye=-.07770167665661752:Ye=-.08596294280650517:Ye=.08538655727027213:Ye=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?Ye=.054627956617973275:t[1]>61.50000000000001?Ye=-.11994465088415499:t[4]>8.500000000000002?Ye=.06676200239406452:Ye=-.027503148069376867:t[8]>676.5000000000001?Ye=-.10363964928357075:t[4]>8.500000000000002?Ye=-.07589816227175682:Ye=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?Ye=.009093153189012338:Ye=-.06119765876605404:Ye=.0004668642103528348;let ut;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?ut=-.10100794502567233:ut=.08000205636470442:ut=-.11945419826856896:t[113]>1e-35?ut=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?ut=.1224302423880318:ut=-.01875566982911468:t[222]>1e-35?t[1]>8.500000000000002?t[1]>24.500000000000004?t[4]>3.5000000000000004?t[0]>725.5000000000001?t[0]>1682.5000000000002?t[0]>2860.5000000000005?ut=.0019277012166729114:t[1]>28.500000000000004?ut=-.054445821715687494:ut=.045645722976713245:t[30]>1e-35?ut=.13402660155331655:ut=.008921176001777645:ut=-.058547426505451076:ut=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?ut=-.13526418192218206:ut=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?ut=.0007263224246135398:ut=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?ut=-.11575657261278308:ut=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?ut=-.01995960178292952:ut=.11216586049153021:ut=-.10050961087149474:ut=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?ut=.10303451081526649:ut=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?ut=-.043799548968209395:ut=-.12451444314954115:t[4]>12.500000000000002?ut=-.03838117361958468:ut=.06504990789767144:t[57]>1e-35?ut=.06890006938293915:ut=.0003914274695562949;let yt;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?yt=.004271749009686975:yt=-.10523878297127605:yt=.04633982158107851:yt=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?yt=-.08655730561951676:t[8]>919.5000000000001?yt=-.0676453705610183:t[7]>18.500000000000004?yt=-.027787974193650575:yt=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?yt=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?yt=-.03473877164537313:t[8]>719.5000000000001?yt=.10471053866934404:yt=.008236107678382981:t[4]>57.50000000000001?yt=.09412219478825269:t[10]>66.50000000000001?yt=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?yt=-.040681323751002293:yt=.06374650297561021:yt=.12884615227401788:t[10]>5.500000000000001?yt=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?yt=-.05474068967150784:yt=.03744700650806603:yt=-.07846396348680855:t[1]>42.50000000000001?yt=.018972315810821302:yt=.10953621007604744:t[5]>4439.500000000001?yt=.010999776705494586:t[1]>40.50000000000001?yt=-.12394200059775967:t[10]>2.5000000000000004?yt=.013528093962849453:yt=-.09222088417048682:yt=-.12662967149701485:yt=.09327296405849603:t[3]>99.50000000000001?yt=-.013581954439986752:yt=.0005526498251862075;let $t;t[187]>1e-35?t[243]>1e-35?$t=-.08392792551692502:t[10]>68.50000000000001?$t=.07871769409454053:t[10]>8.500000000000002?t[10]>16.500000000000004?t[2]>17.500000000000004?t[3]>31.500000000000004?t[91]>1e-35?t[10]>21.500000000000004?t[10]>33.50000000000001?t[10]>48.50000000000001?$t=-.0825306209711224:$t=.049559996084532945:$t=-.1064938580886302:$t=.03353240732240275:$t=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?$t=.16966001471529374:t[1]>57.50000000000001?$t=-.005772777673676247:$t=.09383677041525058:t[8]>747.5000000000001?$t=.054068175469351235:$t=-.049968216310277036:t[8]>753.5000000000001?$t=-.0679383555784074:t[4]>8.500000000000002?$t=-.059757341189735386:$t=.05701083682780414:$t=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?$t=.05820296128730006:$t=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?$t=.15340611616954566:$t=.04385036188666874:t[0]>4449.500000000001?$t=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?$t=.004840354641006495:$t=.09967827580276283:$t=.11605363537391578:t[9]>19.500000000000004?$t=-.0735831692725717:$t=.019973331823355176:t[306]>1e-35?t[149]>1e-35?$t=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?$t=-.02442182361342386:$t=.10334853004243093:$t=-.030431948680167104:$t=-956078595250818e-19;let Tt;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?Tt=-.040232505718244854:t[0]>3030.5000000000005?Tt=.0634109586813073:Tt=-.04043617034245621:Tt=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?Tt=-.007859096946435131:Tt=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?Tt=.05515771679628051:Tt=-.04214471312668263:Tt=-.09589322222261765:t[193]>1e-35?Tt=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?Tt=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?Tt=-.08152604001147906:t[11]>1e-35?Tt=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?Tt=.13100930780107503:t[10]>25.500000000000004?Tt=.05921074710011526:Tt=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?Tt=.0009447118243153454:Tt=-.09820565036865991:Tt=.057146909749745546:t[0]>2115.5000000000005?Tt=-.12331216726611678:Tt=.007281983677694285:t[2]>56.50000000000001?Tt=.012310154675612615:Tt=-.08873665774670461:t[6]>25.500000000000004?Tt=.134708740821879:t[9]>5.500000000000001?Tt=-.0805901581148979:t[224]>1e-35?Tt=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?Tt=.10842593386554122:t[2]>13.500000000000002?Tt=.06466798320378395:Tt=-.08578130788886655:Tt=-.03590892078300114:Tt=.0003499894043880708;let We;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?We=.10839808814624702:We=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?We=-.007478368069393829:We=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?We=.04035247751736232:t[0]>4255.500000000001?We=-.1310865624507367:t[0]>4004.5000000000005?We=.06647367311982634:We=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?We=-.011618902907510411:We=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?We=.09356028223727986:We=-.03811765057032162:We=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?We=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?We=.1146142460964847:t[1]>62.50000000000001?We=-.09679869865322362:t[9]>71.50000000000001?We=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?We=-.039046426387852974:We=.04558778688367152:We=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?We=.03261697816211156:t[15]>1e-35?We=.02586252542264368:t[2]>14.500000000000002?We=-.016420452667484604:We=-.1011799626006976:We=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?We=.010193588102560583:We=.11748729525930773:We=-.04468162226743652:We=-.028365274393617957:t[71]>1e-35?We=.05115139346588793:We=-.0001510425316936658;let ce;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ce=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ce=.020637047900190317:ce=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?ce=-.04632587527094407:ce=.08603684785510396:ce=-.05101401015448496:ce=.025466432054358498:ce=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ce=.020385355430046367:ce=.12032592051335252:ce=-.012387370292173013:t[2]>23.500000000000004?ce=-.12568545484492677:ce=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ce=.043528764484784536:ce=.14352071657196003:ce=-.009332833816977268:ce=.11186782227735846:ce=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ce=-.05649104643152564:ce=.03884200719305747:t[42]>1e-35?ce=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ce=-.04103416502526736:ce=.04881823954656287:t[4]>15.500000000000002?ce=.009342724662897898:t[0]>3969.5000000000005?ce=-.025637309961309498:ce=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ce=-.08185697075265091:t[0]>2215.5000000000005?ce=.030063975892297354:t[0]>807.5000000000001?ce=-.03924325550733229:ce=.0415330999189793:ce=-.00024374664461674863;let Pe;t[3]>7.500000000000001?Pe=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Pe=.025798416259686565:Pe=.13251610353146012:Pe=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Pe=-.11098564237775424:Pe=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Pe=.15347826616466054:t[3]>4.500000000000001?Pe=.10379320730958941:Pe=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Pe=.03159791088468647:Pe=-.10612873364104258:Pe=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Pe=-.02335760775001469:Pe=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Pe=-.011164334474672973:Pe=-.06594044410501655:t[207]>1e-35?Pe=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Pe=-.01725821503981916:Pe=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Pe=-.04226531631656534:Pe=-.14409800530171432:Pe=-.03245576341206398:t[8]>4214.500000000001?Pe=.0895409165534886:t[247]>1e-35?Pe=-.06506383629143335:t[118]>1e-35?Pe=-.07214270121257443:t[8]>546.5000000000001?Pe=-.004385020865473831:Pe=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Pe=.046278501133958524:Pe=-.030835570926968044:t[0]>493.50000000000006?Pe=-.12794504651610425:Pe=.009415039807550776;let Me;t[304]>1e-35?Me=-.04717777269217453:t[76]>1e-35?Me=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Me=-.09648224457374217:t[132]>1e-35?Me=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Me=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Me=.10838431695638147:t[230]>1e-35?Me=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Me=.050071316251979:Me=-.006356941111525215:t[6]>8.500000000000002?Me=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Me=.10217402850540398:Me=-.048840949025349197:Me=-.03668313197909846:t[7]>39.50000000000001?Me=-.0562642841496003:t[10]>2.5000000000000004?Me=.09749777369987417:Me=-.04848223121417616:t[0]>5453.500000000001?Me=.08316648226133942:Me=-.0261979698267618:t[212]>1e-35?Me=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Me=.04837009746506856:Me=-.09184360565631328:Me=.0032411047845613606:t[0]>4733.500000000001?Me=.0977378556864798:Me=.010776545559325588:Me=-.012483310473120218:Me=-.049284121449103935:Me=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Me=-.08380361910948711:Me=.07375088778585813:Me=-.1084864186071348:Me=.0007819503469605476;let ye;t[7]>17.500000000000004?t[115]>1e-35?ye=.08741852531696623:t[167]>1e-35?ye=.10078975495600809:ye=-.0018324767784017562:t[290]>1e-35?ye=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ye=.1379733311640402:ye=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ye=-.09360083033774169:ye=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ye=-.015599362579530679:t[0]>4593.500000000001?ye=-.12029549262691491:ye=-.018917032256501397:ye=.04632831686576592:ye=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ye=-.05894883236412263:ye=.05213944998315824:ye=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ye=.07577412405680808:ye=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ye=-.0277076900736147:t[1]>65.50000000000001?ye=-.023587471585763506:ye=.10184896592433082:ye=-.057699270527916825:ye=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ye=.06566902102799584:t[10]>25.500000000000004?ye=-.07033633753181047:ye=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ye=-.08108035861059537:ye=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ye=-.12431182772561139:ye=.01886235886984271:ye=.0025579594894418116;let oe;t[8]>2915.5000000000005?t[101]>1e-35?oe=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?oe=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?oe=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?oe=.0687641681341721:t[10]>102.50000000000001?oe=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?oe=-.06762578396473291:t[10]>65.50000000000001?oe=-.05226727783610509:t[282]>1e-35?oe=.09911438410640917:t[19]>1e-35?oe=.06915156336429933:oe=-.006565637886508241:oe=-.08344300251849307:oe=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?oe=.19428463865406298:oe=.016073883020956765:t[13]>1e-35?oe=.06864077097923665:oe=-.01388867527034731:t[0]>1847.5000000000002?oe=.004655280608161356:t[1]>40.50000000000001?oe=.031406054057765996:oe=.12798062439212832:oe=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?oe=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?oe=-.0706095614785733:oe=.04227164041372561:oe=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?oe=-.07139533369873902:oe=.008952586782921625:oe=.06086212582180936:oe=-.0816938490403437:oe=-.051224901945956025:oe=-.10525399124186095:oe=.000270924147208224;let Ke;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?Ke=.029186512383291244:t[7]>1.5000000000000002?Ke=-.14984127276725573:t[1]>40.50000000000001?Ke=.032757060730648144:Ke=-.07675575422749602:t[6]>8.500000000000002?Ke=.10599766037117893:Ke=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Ke=-.051394622947855385:Ke=.03237141302699347:Ke=.12526173027943244:Ke=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Ke=-.07383912482657777:t[0]>5147.500000000001?Ke=.07008813937042091:t[10]>38.50000000000001?Ke=-.06779203808365307:Ke=-.013782769999524498:Ke=.0880038869117715:Ke=-.12846294176070952:t[281]>1e-35?Ke=-.06810806903850834:t[10]>227.50000000000003?Ke=-.08937977001661111:t[10]>130.50000000000003?Ke=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Ke=.011036530162093841:Ke=-.11500797478569702:Ke=.03702229366129399:Ke=.07242026683784307:t[189]>1e-35?Ke=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?Ke=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?Ke=-.02608892716555304:Ke=.09609599320761308:t[9]>105.50000000000001?Ke=-.06848127135991534:Ke=.0023675721254089715:t[86]>1e-35?Ke=-.11049635625500497:Ke=-.004847764219432233;let lt;t[125]>1e-35?t[0]>3969.5000000000005?lt=-.09462233499115416:lt=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?lt=-.030700661288166148:lt=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?lt=.03149547314036763:lt=-.08166208257451366:t[0]>5850.500000000001?lt=-.10228136324773157:t[102]>1e-35?lt=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?lt=.01782894842128785:t[13]>1e-35?lt=.002680190260979968:lt=.1773965720476949:t[2]>72.50000000000001?lt=.09090831938627947:t[1]>59.50000000000001?lt=-.12297206702816128:t[0]>4977.500000000001?lt=.09899015653118268:lt=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?lt=-.0675900954187773:lt=.012336403425364092:lt=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?lt=-.02671721777458802:lt=-.09242452991958029:t[284]>1e-35?lt=-.08585691288582491:lt=.013332890564324447:t[4]>14.500000000000002?lt=-.005245022074799553:t[23]>1e-35?lt=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?lt=-.09289852307936758:t[116]>1e-35?lt=-.09686573010015055:t[8]>804.5000000000001?lt=.03812547148215318:lt=.005162744968176633:t[9]>43.50000000000001?lt=-.059246106396159376:lt=.050370113808135275:lt=.000794041852811028;let Gt;t[3]>7.500000000000001?Gt=.0004981426543104341:t[9]>114.50000000000001?Gt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Gt=-.019061766497948867:Gt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Gt=-.006044199577160493:Gt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Gt=.11486607015912494:t[9]>16.500000000000004?Gt=-.08686820858087294:Gt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Gt=-.022230207980026437:Gt=.1056683690528792:Gt=-.05859530800943035:Gt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Gt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Gt=-.05177544573528314:Gt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Gt=.15159657923771555:Gt=-.0060542654587671055:t[9]>5.500000000000001?Gt=-.042808028205051786:t[1]>48.50000000000001?Gt=-.010449538258110742:Gt=.10026907521968294:Gt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Gt=-.02272452389409874:Gt=-.11202691218244319:t[5]>1809.5000000000002?Gt=-.04460413584255906:Gt=.08196329474205256:t[10]>69.50000000000001?Gt=.10221481166238167:Gt=.0004063052701699382:t[243]>1e-35?Gt=-.07563941678849846:t[18]>1e-35?Gt=.02563513231103432:Gt=-.004740081147303786;let Er;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Er=.057446442918106:Er=-.04404018270156349:Er=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Er=-.05930486238817954:t[1]>29.500000000000004?Er=.06955866121256543:t[8]>597.5000000000001?Er=-.06538593556505168:Er=.06212512595497445:Er=.00021102929959182257:t[9]>90.50000000000001?Er=.0958061289119631:t[102]>1e-35?Er=.07172059675638813:t[1]>47.50000000000001?Er=-.03879798603977766:t[297]>1e-35?Er=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?Er=.003805910996312012:Er=.09304295674749524:t[11]>1e-35?t[18]>1e-35?Er=.11252376801858695:t[288]>1e-35?Er=-.10293901912180432:Er=.014669268837893872:t[1]>42.50000000000001?Er=-.05988274123836837:t[145]>1e-35?Er=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?Er=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?Er=-.03366718308159971:Er=.11936550608549797:t[1]>31.500000000000004?Er=-.07454716789539667:Er=.027859650621164217:t[10]>10.500000000000002?Er=-.11806374092321247:Er=-.03506042229223101:Er=-.0007080765837654515:t[10]>6.500000000000001?Er=-.028077713664996503:t[2]>7.500000000000001?Er=.15803724124216814:Er=.0351381284833169:Er=-.07877953381054767;let dr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?dr=.14144941521975005:dr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?dr=.10514088112381886:t[7]>18.500000000000004?dr=-.10370643555956745:dr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?dr=-.0508129468802936:t[224]>1e-35?dr=-.037816066368733595:t[10]>43.50000000000001?dr=.07793408602607932:dr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?dr=.036972453794202324:dr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?dr=.09475302525132188:dr=-.03580104945898193:dr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?dr=-.1282448778804823:dr=-.014395808269207212:dr=-.008940927190750592:dr=-.1459118815453748:t[0]>4897.500000000001?dr=-.09733068457286576:t[1]>57.50000000000001?dr=.06575271409540207:dr=-.019556422817450115:dr=-.10623959222984136:t[18]>1e-35?dr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?dr=.008125645893104896:dr=-.11084368630465868:dr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?dr=-.05854904579626861:t[4]>5.500000000000001?dr=.02985784951394175:dr=-.03247600140149334:dr=-.11152899295304973:dr=-.00035424577714215764;let Ur;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Ur=-.06563670567578264:Ur=.067656954313663:Ur=-.10388217548685377:t[8]>2302.5000000000005?Ur=.07190621943790435:t[4]>67.50000000000001?Ur=.060020507643618604:t[4]>38.50000000000001?Ur=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Ur=-.06568134366461277:t[8]>1075.5000000000002?Ur=-.004768057709758692:Ur=.11785959165999467:Ur=-.05080221682879267:Ur=.14814206127494542:Ur=-.07241946332311736:t[253]>1e-35?Ur=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Ur=-.02471195342450034:Ur=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Ur=-.10741850739482771:Ur=.010051635824944:Ur=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Ur=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Ur=-.08992396138178163:Ur=.010944365997007212:Ur=.06221307021813793:Ur=.1286024087559141:t[127]>1e-35?Ur=.06568148624531012:t[10]>40.50000000000001?Ur=-.07567979134643352:t[5]>5647.500000000001?Ur=.07594672895572069:Ur=-.018158016446439187:t[6]>55.50000000000001?Ur=.009293422430111872:t[4]>45.50000000000001?Ur=-.017749818406964022:t[2]>46.50000000000001?Ur=.01714136511113982:Ur=-724762291423549e-19;let Wr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Wr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Wr=.07084726276890757:Wr=-.11232323677722932:Wr=.04812773089510436:Wr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Wr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Wr=.0879462816013881:Wr=-.002966662093626573:t[306]>1e-35?Wr=-.04588085188342676:Wr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Wr=-.006600332774461143:Wr=.1272481351557754:Wr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Wr=.011884312066620044:Wr=.11678751052403374:t[4]>8.500000000000002?Wr=.03627129613273813:Wr=-.12132783497902287:Wr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Wr=-.06830131718398992:t[0]>5147.500000000001?Wr=.062360406249609306:t[4]>4.500000000000001?Wr=-.013162203864592055:Wr=-.07153029184927609:Wr=.07628618062271557:Wr=-.12085065687320373:t[190]>1e-35?Wr=-.045816889524231186:t[137]>1e-35?Wr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Wr=.025895337822752502:Wr=-.06503949350616421:t[10]>227.50000000000003?Wr=-.09989456525790491:t[10]>130.50000000000003?Wr=.08616651057030683:Wr=.0001234981796706021;let zr;t[8]>1014.5000000000001?t[9]>137.50000000000003?zr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?zr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?zr=-.141732381961068:zr=-.0317152307496497:zr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?zr=.12191801556691254:zr=-.0003444689085397977:zr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?zr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?zr=-.05676033995381961:zr=.10933961076803381:t[4]>26.500000000000004?zr=-.11667582544549814:t[8]>1765.5000000000002?zr=.032174455312047705:zr=-.0755016390126608:t[293]>1e-35?zr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?zr=.026571311956824436:t[15]>1e-35?zr=.06175459479851121:zr=-.018778084411148754:t[9]>40.50000000000001?zr=-.09420232889965811:zr=-.004578248021263184:t[2]>1.5000000000000002?zr=.005453714644971445:zr=-.03907138175699279:zr=-.055296364182154736:t[23]>1e-35?zr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?zr=-.09358146510580179:zr=.060524657996178094:zr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?zr=-.12698331085931538:zr=.006059605604079918:t[2]>196.50000000000003?zr=-.09451315810804783:zr=.0011390147031687425;let zt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?zt=.05517359070460923:zt=-.04758751221404857:zt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?zt=.1040436595565776:t[9]>21.500000000000004?zt=.04032250517675179:t[107]>1e-35?zt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?zt=.1192453009230486:t[1]>51.50000000000001?zt=.0443376336292195:zt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?zt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?zt=-.08999822408398037:zt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?zt=-.061850439226075:zt=.08849196353361093:zt=.10536348167793089:t[92]>1e-35?zt=.04894947712119185:t[9]>16.500000000000004?zt=.05900227903883853:t[9]>5.500000000000001?zt=-.11946594348916476:zt=-.03652096348071964:t[1]>41.50000000000001?zt=-.07411603110840567:zt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?zt=.08493634342741495:t[11]>1e-35?zt=-.10899097825564363:zt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?zt=.08356655906359918:t[7]>25.500000000000004?zt=-.09475076526194888:t[10]>5.500000000000001?zt=-.01999406228763778:zt=.06696212545889428:t[6]>20.500000000000004?zt=.14713592661393468:zt=.0459917279002218:zt=.00027445928493734093;let Tr;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?Tr=-.06904501553217077:Tr=.05696231672035904:Tr=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?Tr=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?Tr=-.011419256378538392:t[0]>3830.5000000000005?Tr=.140315841503076:Tr=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?Tr=-.04027822909411164:Tr=.03176085103667189:Tr=.06779515865838849:t[4]>15.500000000000002?Tr=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?Tr=.06124039747298539:Tr=-.04312732764434027:Tr=.09161522761808062:Tr=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?Tr=.11211681010488772:t[13]>1e-35?Tr=.06725735814960367:Tr=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?Tr=.11743605068905603:Tr=-.011309033539148687:Tr=-.07896094707523052:Tr=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?Tr=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?Tr=.02836295848998302:Tr=.12210680366745175:Tr=-.058302317470509096:t[5]>4144.500000000001?Tr=.06123341960495106:Tr=-.03840046906926525:Tr=-.05221474543453495:Tr=.03988215485860711:Tr=-.00033074684693083496;let t0=jEc(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+_+E+v+S+T+w+R+x+k+D+N+O+B+q+M+L+U+j+Q+Y+W+V+z+ie+H+re+le+Le+me+Oe+Te+te+ee+K+he+X+de+Be+ne+ue+Ne+xe+Fe+tt+st+vt+Pt+Ht+F+se+be+Ue+Qe+ge+Z+ve+Ge+qe+je+J+ae+Ce+Re+$e+Ye+ut+yt+$t+Tt+We+ce+Pe+Me+ye+oe+Ke+lt+Gt+Er+dr+Ur+Wr+zr+zt+Tr);return[1-t0,t0]}a(qEc,"multilineModelPredict");function jEc(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(jEc,"sigmoid")});var z9i=I(UV=>{"use strict";p();Object.defineProperty(UV,"__esModule",{value:!0});UV.MultilineModelFeatures=UV.PromptFeatures=void 0;UV.hasComment=n5r;UV.requestMultilineScore=VEc;var FV=$9i(),HEc=V9i(),GEc={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},W9i={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function n5r(t,e,r,n=!0){let o=t.split(` +`);if(n&&(o=o.filter(l=>l.trim().length>0)),Math.abs(e)>o.length||e>=o.length)return!1;e<0&&(e=o.length+e);let s=o[e];return(GEc[r]??[]).some(l=>s.includes(l))}a(n5r,"hasComment");var C3e=class{static{a(this,"PromptFeatures")}constructor(e,r){let[n,o]=this.firstAndLast(e),s=this.firstAndLast(e.trimEnd());this.language=r,this.length=e.length,this.firstLineLength=n.length,this.lastLineLength=o.length,this.lastLineRstripLength=o.trimEnd().length,this.lastLineStripLength=o.trim().length,this.rstripLength=e.trimEnd().length,this.stripLength=e.trim().length,this.rstripLastLineLength=s[1].length,this.rstripLastLineStripLength=s[1].trim().length,this.secondToLastLineHasComment=n5r(e,-2,r),this.rstripSecondToLastLineHasComment=n5r(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` `),this.lastChar=e.slice(-1),this.rstripLastChar=e.trimEnd().slice(-1),this.firstChar=e[0],this.lstripFirstChar=e.trimStart().slice(0,1)}firstAndLast(e){let r=e.split(` -`),n=r.length,o=r[0],s=r[n-1];return s===""&&n>1&&(s=r[n-2]),[o,s]}};FV.PromptFeatures=C3e;var ubt=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new C3e(e,n),this.suffixFeatures=new C3e(r,n)}constructFeatures(){let e=new Array(14).fill(0);e[0]=this.prefixFeatures.length,e[1]=this.prefixFeatures.firstLineLength,e[2]=this.prefixFeatures.lastLineLength,e[3]=this.prefixFeatures.lastLineRstripLength,e[4]=this.prefixFeatures.lastLineStripLength,e[5]=this.prefixFeatures.rstripLength,e[6]=this.prefixFeatures.rstripLastLineLength,e[7]=this.prefixFeatures.rstripLastLineStripLength,e[8]=this.suffixFeatures.length,e[9]=this.suffixFeatures.firstLineLength,e[10]=this.suffixFeatures.lastLineLength,e[11]=this.prefixFeatures.secondToLastLineHasComment?1:0,e[12]=this.prefixFeatures.rstripSecondToLastLineHasComment?1:0,e[13]=this.prefixFeatures.prefixEndsWithNewline?1:0;let r=new Array(Object.keys($9i).length+1).fill(0);r[$9i[this.language]??0]=1;let n=new Array(Object.keys(BV.contextualFilterCharacterMap).length+1).fill(0);n[BV.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(BV.contextualFilterCharacterMap).length+1).fill(0);o[BV.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(BV.contextualFilterCharacterMap).length+1).fill(0);s[BV.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(BV.contextualFilterCharacterMap).length+1).fill(0);return c[BV.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};FV.MultilineModelFeatures=ubt;function HEc(t,e){return new ubt(t.prefix,t.suffix,e)}a(HEc,"constructMultilineFeatures");function GEc(t,e){let r=HEc(t,e).constructFeatures();return(0,qEc.multilineModelPredict)(r)[1]}a(GEc,"requestMultilineScore")});var W9i=I(DU=>{"use strict";p();var $Ec=DU&&DU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},VEc=DU&&DU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(DU,"__esModule",{value:!0});DU.StreamedCompletionSplitter=void 0;var WEc=Ks(),zEc=bBe(),YEc=Yye(),n5r=class t{static{a(this,"StreamingCompletion")}constructor(e,r){this.index=e,this.documentPrefix=r,this.startOffset=0,this.text="",this.trimCount=0}updateText(e){this.text=e}get addedToPrefix(){return this.text.substring(0,this.startOffset)}get effectivePrefix(){return this.documentPrefix+this.addedToPrefix}get effectiveText(){return this.text.substring(this.startOffset)}get isFirstCompletion(){return this.trimCount===0}get firstNewlineOffset(){let e=[...this.text.matchAll(/\r?\n/g)];return e.length>0&&e[0].index===0&&e.shift(),e.length>0?e[0].index:-1}trimAt(e){let r=new t(this.index,this.documentPrefix);return r.startOffset=this.startOffset,r.text=this.text.substring(0,this.startOffset+e),r.trimCount=this.trimCount,this.startOffset+=e,this.trimCount++,r}},i5r=class{static{a(this,"StreamedCompletionSplitter")}constructor(e,r,n,o,s,c){this.prefix=e,this.languageId=r,this.initialSingleLine=n,this.trimmerLookahead=o,this.cacheFunction=s,this.instantiationService=c,this.lineLimit=3,this.completions=new Map}getFinishedCallback(){return async(e,r)=>{let n=r.index??0,o=this.getCompletion(n,e);if(o.isFirstCompletion&&this.initialSingleLine&&o.firstNewlineOffset>=0){let s={yieldSolution:!0,continueStreaming:!0,finishOffset:o.firstNewlineOffset};return o.trimAt(s.finishOffset),r.finished&&await this.trimAll(r,o),s}return r.finished?await this.trimAll(r,o):await this.trimOnce(r,o)}}getCompletion(e,r){let n=this.completions.get(e);return n||(n=new n5r(e,this.prefix),this.completions.set(e,n)),n.updateText(r),n}async trimOnce(e,r){let n=await this.trim(r);return n===void 0?{yieldSolution:!1,continueStreaming:!0}:r.isFirstCompletion?(r.trimAt(n),{yieldSolution:!0,continueStreaming:!0,finishOffset:n}):(this.cacheCompletion(e,r,n),{yieldSolution:!1,continueStreaming:!0})}async trimAll(e,r){let n,o;do n=await this.trim(r),r.isFirstCompletion?(o=n,r.trimAt(n??r.effectiveText.length)):this.cacheCompletion(e,r,n);while(n!==void 0);return o!==void 0?{yieldSolution:!0,continueStreaming:!0,finishOffset:o}:{yieldSolution:!1,continueStreaming:!0}}async trim(e){return await new YEc.TerseBlockTrimmer(this.languageId,e.effectivePrefix,e.effectiveText,this.lineLimit,this.trimmerLookahead).getCompletionTrimOffset()}cacheCompletion(e,r,n){let o=r.trimAt(n??r.effectiveText.length);if(o.effectiveText.trim()==="")return;let s=this.instantiationService.invokeFunction(zEc.convertToAPIChoice,o.effectiveText.trimEnd(),e.getAPIJsonData(),o.index,e.requestId,n!==void 0,e.telemetryData);s.copilotAnnotations=this.adjustedAnnotations(s,r,o),s.generatedChoiceIndex=o.trimCount,this.cacheFunction(o.addedToPrefix,s)}adjustedAnnotations(e,r,n){if(e.copilotAnnotations===void 0)return;let o=n.addedToPrefix.length,c=o+e.completionText.length>=r.text.length,l={};for(let[u,d]of Object.entries(e.copilotAnnotations)){let f=d.filter(h=>h.start_offset-o0).map(h=>{let m={...h};return m.start_offset-=o,m.stop_offset-=o,c||(m.stop_offset=Math.min(m.stop_offset,e.completionText.length)),m});f.length>0&&(l[u]=f)}return Object.keys(l).length>0?l:void 0}};DU.StreamedCompletionSplitter=i5r;DU.StreamedCompletionSplitter=i5r=$Ec([VEc(5,WEc.IInstantiationService)],i5r)});var t7i=I(o5r=>{"use strict";p();Object.defineProperty(o5r,"__esModule",{value:!0});o5r.getGhostTextStrategy=rvc;var X9i=Ks(),z9i=Mne(),NN=eE(),e7i=xy(),dbt=JEt(),Y9i=nA(),KEc=Qye(),b3e=Yye(),JEc=KOr(),ZEc=cBe(),XEc=zkr(),evc=V9i(),tvc=W9i(),K9i=20;function J9i(t){return e=>{let r=e?.split(` +`),n=r.length,o=r[0],s=r[n-1];return s===""&&n>1&&(s=r[n-2]),[o,s]}};UV.PromptFeatures=C3e;var dbt=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new C3e(e,n),this.suffixFeatures=new C3e(r,n)}constructFeatures(){let e=new Array(14).fill(0);e[0]=this.prefixFeatures.length,e[1]=this.prefixFeatures.firstLineLength,e[2]=this.prefixFeatures.lastLineLength,e[3]=this.prefixFeatures.lastLineRstripLength,e[4]=this.prefixFeatures.lastLineStripLength,e[5]=this.prefixFeatures.rstripLength,e[6]=this.prefixFeatures.rstripLastLineLength,e[7]=this.prefixFeatures.rstripLastLineStripLength,e[8]=this.suffixFeatures.length,e[9]=this.suffixFeatures.firstLineLength,e[10]=this.suffixFeatures.lastLineLength,e[11]=this.prefixFeatures.secondToLastLineHasComment?1:0,e[12]=this.prefixFeatures.rstripSecondToLastLineHasComment?1:0,e[13]=this.prefixFeatures.prefixEndsWithNewline?1:0;let r=new Array(Object.keys(W9i).length+1).fill(0);r[W9i[this.language]??0]=1;let n=new Array(Object.keys(FV.contextualFilterCharacterMap).length+1).fill(0);n[FV.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(FV.contextualFilterCharacterMap).length+1).fill(0);o[FV.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(FV.contextualFilterCharacterMap).length+1).fill(0);s[FV.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(FV.contextualFilterCharacterMap).length+1).fill(0);return c[FV.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};UV.MultilineModelFeatures=dbt;function $Ec(t,e){return new dbt(t.prefix,t.suffix,e)}a($Ec,"constructMultilineFeatures");function VEc(t,e){let r=$Ec(t,e).constructFeatures();return(0,HEc.multilineModelPredict)(r)[1]}a(VEc,"requestMultilineScore")});var Y9i=I(DU=>{"use strict";p();var WEc=DU&&DU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},zEc=DU&&DU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(DU,"__esModule",{value:!0});DU.StreamedCompletionSplitter=void 0;var YEc=Ks(),KEc=bBe(),JEc=Yye(),i5r=class t{static{a(this,"StreamingCompletion")}constructor(e,r){this.index=e,this.documentPrefix=r,this.startOffset=0,this.text="",this.trimCount=0}updateText(e){this.text=e}get addedToPrefix(){return this.text.substring(0,this.startOffset)}get effectivePrefix(){return this.documentPrefix+this.addedToPrefix}get effectiveText(){return this.text.substring(this.startOffset)}get isFirstCompletion(){return this.trimCount===0}get firstNewlineOffset(){let e=[...this.text.matchAll(/\r?\n/g)];return e.length>0&&e[0].index===0&&e.shift(),e.length>0?e[0].index:-1}trimAt(e){let r=new t(this.index,this.documentPrefix);return r.startOffset=this.startOffset,r.text=this.text.substring(0,this.startOffset+e),r.trimCount=this.trimCount,this.startOffset+=e,this.trimCount++,r}},o5r=class{static{a(this,"StreamedCompletionSplitter")}constructor(e,r,n,o,s,c){this.prefix=e,this.languageId=r,this.initialSingleLine=n,this.trimmerLookahead=o,this.cacheFunction=s,this.instantiationService=c,this.lineLimit=3,this.completions=new Map}getFinishedCallback(){return async(e,r)=>{let n=r.index??0,o=this.getCompletion(n,e);if(o.isFirstCompletion&&this.initialSingleLine&&o.firstNewlineOffset>=0){let s={yieldSolution:!0,continueStreaming:!0,finishOffset:o.firstNewlineOffset};return o.trimAt(s.finishOffset),r.finished&&await this.trimAll(r,o),s}return r.finished?await this.trimAll(r,o):await this.trimOnce(r,o)}}getCompletion(e,r){let n=this.completions.get(e);return n||(n=new i5r(e,this.prefix),this.completions.set(e,n)),n.updateText(r),n}async trimOnce(e,r){let n=await this.trim(r);return n===void 0?{yieldSolution:!1,continueStreaming:!0}:r.isFirstCompletion?(r.trimAt(n),{yieldSolution:!0,continueStreaming:!0,finishOffset:n}):(this.cacheCompletion(e,r,n),{yieldSolution:!1,continueStreaming:!0})}async trimAll(e,r){let n,o;do n=await this.trim(r),r.isFirstCompletion?(o=n,r.trimAt(n??r.effectiveText.length)):this.cacheCompletion(e,r,n);while(n!==void 0);return o!==void 0?{yieldSolution:!0,continueStreaming:!0,finishOffset:o}:{yieldSolution:!1,continueStreaming:!0}}async trim(e){return await new JEc.TerseBlockTrimmer(this.languageId,e.effectivePrefix,e.effectiveText,this.lineLimit,this.trimmerLookahead).getCompletionTrimOffset()}cacheCompletion(e,r,n){let o=r.trimAt(n??r.effectiveText.length);if(o.effectiveText.trim()==="")return;let s=this.instantiationService.invokeFunction(KEc.convertToAPIChoice,o.effectiveText.trimEnd(),e.getAPIJsonData(),o.index,e.requestId,n!==void 0,e.telemetryData);s.copilotAnnotations=this.adjustedAnnotations(s,r,o),s.generatedChoiceIndex=o.trimCount,this.cacheFunction(o.addedToPrefix,s)}adjustedAnnotations(e,r,n){if(e.copilotAnnotations===void 0)return;let o=n.addedToPrefix.length,c=o+e.completionText.length>=r.text.length,l={};for(let[u,d]of Object.entries(e.copilotAnnotations)){let f=d.filter(h=>h.start_offset-o0).map(h=>{let m={...h};return m.start_offset-=o,m.stop_offset-=o,c||(m.stop_offset=Math.min(m.stop_offset,e.completionText.length)),m});f.length>0&&(l[u]=f)}return Object.keys(l).length>0?l:void 0}};DU.StreamedCompletionSplitter=o5r;DU.StreamedCompletionSplitter=o5r=WEc([zEc(5,YEc.IInstantiationService)],o5r)});var n7i=I(s5r=>{"use strict";p();Object.defineProperty(s5r,"__esModule",{value:!0});s5r.getGhostTextStrategy=ivc;var t7i=Ks(),K9i=One(),NN=eE(),r7i=xy(),fbt=ZEt(),J9i=nA(),ZEc=Qye(),b3e=Yye(),XEc=JOr(),evc=cBe(),tvc=Ykr(),rvc=z9i(),nvc=Y9i(),Z9i=20;function X9i(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(J9i,"takeNLines");async function rvc(t,e,r,n,o,s,c){let l=t.get(X9i.IInstantiationService),u=t.get(e7i.ICompletionsFeaturesService),d=t.get(XEc.ICompletionsBlockModeConfig),f=u.multilineAfterAcceptLines(c),h=d.forLanguage(e.textDocument.detectedLanguageId,c);switch(h){case NN.BlockMode.Server:return s?{blockMode:NN.BlockMode.Parsing,requestMultiline:!0,finishedCb:J9i(f),stop:[` +`).length}}a(X9i,"takeNLines");async function ivc(t,e,r,n,o,s,c){let l=t.get(t7i.IInstantiationService),u=t.get(r7i.ICompletionsFeaturesService),d=t.get(tvc.ICompletionsBlockModeConfig),f=u.multilineAfterAcceptLines(c),h=d.forLanguage(e.textDocument.detectedLanguageId,c);switch(h){case NN.BlockMode.Server:return s?{blockMode:NN.BlockMode.Parsing,requestMultiline:!0,finishedCb:X9i(f),stop:[` -`],maxTokens:K9i*f}:{blockMode:NN.BlockMode.Server,requestMultiline:!0,finishedCb:a(m=>{},"finishedCb")};case NN.BlockMode.Parsing:case NN.BlockMode.ParsingAndServer:case NN.BlockMode.MoreMultiline:default:{let m;try{m=await l.invokeFunction(nvc,h,e.textDocument,e.position,o,s,n)}catch{m={requestMultiline:!1}}if(!s&&m.requestMultiline&&u.singleLineUnlessAccepted(c)&&(m.requestMultiline=!1),m.requestMultiline){let g;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?g=KEc.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(Z9i,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:NN.BlockMode.Parsing,requestMultiline:!0,finishedCb:J9i(f),stop:[` +`],maxTokens:Z9i*f}:{blockMode:NN.BlockMode.Server,requestMultiline:!0,finishedCb:a(m=>{},"finishedCb")};case NN.BlockMode.Parsing:case NN.BlockMode.ParsingAndServer:case NN.BlockMode.MoreMultiline:default:{let m;try{m=await l.invokeFunction(ovc,h,e.textDocument,e.position,o,s,n)}catch{m={requestMultiline:!1}}if(!s&&m.requestMultiline&&u.singleLineUnlessAccepted(c)&&(m.requestMultiline=!1),m.requestMultiline){let g;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?g=ZEc.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(e7i,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:NN.BlockMode.Parsing,requestMultiline:!0,finishedCb:X9i(f),stop:[` -`],maxTokens:K9i*f};return h===NN.BlockMode.MoreMultiline&&(g.blockMode=NN.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(Z9i,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(rvc,"getGhostTextStrategy");function Z9i(t,e,r,n,o,s,c,l,u){let d=t.get(e7i.ICompletionsFeaturesService),f=t.get(X9i.IInstantiationService);if(c&&e===NN.BlockMode.MoreMultiline&&b3e.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===b3e.BlockPositionType.EmptyBlock||o===b3e.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(ZEc.ICompletionsCacheService);return{finishedCb:f.createInstance(tvc.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let _={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,JEc.appendToCache)(m,_,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,dbt.parsingBlockFinished)(r,n):h=>{}}}a(Z9i,"buildFinishedCallback");async function nvc(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,Y9i.telemetry)(t,"ghostText.longFileMultilineSkip",Y9i.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===NN.BlockMode.MoreMultiline&&b3e.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,b3e.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&ivc(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,z9i.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,dbt.isEmptyBlockStartUtil)(r,n):o&&(0,z9i.isSupportedLanguageId)(r.detectedLanguageId)&&(u=await(0,dbt.isEmptyBlockStartUtil)(r,n)||await(0,dbt.isEmptyBlockStartUtil)(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=(0,evc.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(nvc,"shouldRequestMultiline");function ivc(t,e){return e.lineAt(t).text.trim().length===0}a(ivc,"isNewLine")});var a7i=I(mk=>{"use strict";p();var ovc=mk&&mk.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},MN=mk&&mk.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(mk,"__esModule",{value:!0});mk.ForceMultiLine=mk.GhostTextComputer=void 0;mk.getGhostText=Ivc;var n7i=Np(),svc=bh(),avc=EOr(),cvc=Og(),i7i=Ks(),lvc=vOr(),uvc=Rne(),dvc=WLe(),fvc=SRr(),T3e=eE(),d5r=xy(),pvc=Gl(),hvc=C_e(),mvc=nkr(),gvc=ebt(),Avc=Fvt(),yvc=yV(),_vc=JEt(),s5r=p_e(),c5r=kOr(),a5r=p9i(),P_e=nA(),fbt=Qye(),r7i=sBe(),Evc=wkr(),vvc=Yye(),Cvc=cBe(),l5r=j9i(),o7i=Kkr(),bvc=t7i(),UV=iV(),Nh=Zye(),Svc={isCycling:!1,promptOnly:!1,isSpeculative:!1};function Tvc(t,e,r){let n=t.get(d5r.ICompletionsFeaturesService),o=(0,T3e.getConfig)(t,T3e.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,P_e.now)()-r.issuedTime;return Math.max(0,o-s)}a(Tvc,"getRemainingDebounceMs");function S3e(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(S3e,"isCompletionRequestCancelled");var pbt=class{static{a(this,"GhostTextComputer")}constructor(e,r,n,o,s,c,l,u,d,f,h){this.instantiationService=e,this.telemetryService=r,this.notifierService=n,this.contextProviderBridge=o,this.currentGhostText=s,this.contextproviderStatistics=c,this.asyncCompletionManager=l,this.completionsFeaturesService=u,this.logTarget=d,this.statusReporter=f,this.logService=h}async getGhostText(e,r,n,o,s,c){let l=(0,cvc.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(Pvc,e.textDocument,l,n);await(0,uvc.ensureTokenizersLoaded)().catch(()=>{});try{this.contextProviderBridge.schedule(e,l,n?.opportunityId??"",d,r,n),this.notifierService.notifyRequest(e,l,d,r,n);let f=await this.getGhostTextWithoutAbortHandling(e,l,d,r,n,o,s,u),h=this.contextproviderStatistics.getStatisticsForCompletion(l),m=n?.opportunityId??"unknown";for(let[g,A]of h.getAllUsageStatistics())this.telemetryService.sendMSFTTelemetryEvent("context-provider.completion-stats",{requestId:l,opportunityId:m,providerId:g,resolution:A.resolution,usage:A.usage,usageDetails:JSON.stringify(A.usageDetails)},{});return f}catch(f){if((0,hvc.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,Nh.mkCanceledResultTelemetry)(d,{cancelledNetworkRequest:!0})};throw f}}async getGhostTextWithoutAbortHandling(e,r,n,o,s,c,l,u){let d=u.createSubLogger(["GhostTextComputer#getGhostTextWithoutAbortHandling"]),f=n.issuedTime,h=[];function m(v){let S=(0,P_e.now)();h.push([v,S-f]),f=S}if(a(m,"recordPerformance"),m("telemetry"),S3e(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};let g=wvc(e.textDocument,e.position);if(g===void 0)return d.debug("Completions do not trigger in the middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(mvc.getEngineRequestInfo,n),y={...Svc,...s,tokenizer:A.tokenizer},_=await this.instantiationService.invokeFunction(s5r.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(s5r.PromptResponse.toString(_)),_.type==="copilotContentExclusion")return d.debug("Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};if(_.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};if(_.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};if(y.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:_};if(_.type==="promptCancelled")return d.debug("Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};if(_.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};if(_.prompt.prefix.length===0&&_.prompt.suffix.length===0)return d.debug("Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};let E=this.instantiationService.invokeFunction(Tvc,y,n);return E>0&&(d.debug(`Debouncing ghost text request for ${E}ms`),await(0,r7i.delay)(E),S3e(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,s5r.trimLastLine)(e.textDocument.getText(fbt.LocationFactory.range(fbt.LocationFactory.position(0,0),e.position)));d.trace(`Starting ghost text computation, prefix length: ${v.length}`);let S=this.currentGhostText.hasAcceptedCurrentCompletion(v,_.prompt.suffix);d.trace(`hasAcceptedCurrentCompletion: ${S}`);let T=_.prompt,w=await this.instantiationService.invokeFunction(bvc.getGhostTextStrategy,e,v,_,g,S,n);m("strategy"),d.trace(`Ghost text strategy: blockMode=${w.blockMode}, requestMultiline=${w.requestMultiline}, stop=${w.stop}, maxTokens=${w.maxTokens}`);let R=this.instantiationService.invokeFunction(xvc,v,T,w.requestMultiline);d.trace(`Local cache lookup: ${R?`found ${R[0].length} choices`:"no cached choices"}`),m("cache");let x=this.instantiationService.invokeFunction(c5r.extractRepoInfoInBackground,e.textDocument.uri),k={blockMode:w.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:x,engineModelId:A.modelId,ourRequestId:r,prefix:v,prompt:_.prompt,multiline:w.requestMultiline,indentation:(0,_vc.contextIndentation)(e.textDocument,e.position),isCycling:y.isCycling,headers:A.headers,stop:w.stop,maxTokens:w.maxTokens,afterAccept:S};k.headers={...k.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":y.isSpeculative?"true":"false"};let D=this.instantiationService.invokeFunction(Nvc,e.textDocument,k,e.position,_,n,A,y);if(R===void 0&&!y.isCycling&&this.asyncCompletionManager.shouldWaitForAsyncCompletions(v,_.prompt)){d.trace("No cached choices, waiting for async completions from in-flight request");let Q=await this.asyncCompletionManager.getFirstMatchingRequestWithTimeout(r,v,_.prompt,y.isSpeculative,D);if(m("asyncWait"),Q){d.trace("Received choice from async completion");let Y=!w.requestMultiline;R=[[(0,l5r.makeGhostAPIChoice)(Q[0],{forceSingleLine:Y})],UV.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(S3e(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,Nh.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===T3e.BlockMode.MoreMultiline&&vvc.BlockTrimmer.isSupported(e.textDocument.detectedLanguageId);if(R!==void 0&&(d.trace(`Post-processing ${R[0].length} cached choices, isMoreMultiline=${N}`),R[0]=R[0].map(Q=>this.instantiationService.invokeFunction(a5r.postProcessChoiceInContext,e.textDocument,e.position,Q,N,d)).filter(Q=>Q!==void 0)),R&&(R[1]===UV.ResultType.Cache||R[1]===UV.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,Nh.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,Nh.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,Nh.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let Q=this.instantiationService.createInstance(l5r.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let Y=await Q.getAllCompletionsFromNetwork(k,D,o,w.finishedCb,l);if(Y.type==="success"){d.trace(`Cycling network request returned ${Y.value[0].length} choices`);let W=R?.[0]??[];Y.value[0].forEach(V=>{W.findIndex(z=>z.completionText.trim()===V.completionText.trim())===-1&&W.push(V)}),d.trace(`After deduplication: ${W.length} unique choices`),R=[W,UV.ResultType.Cycling]}else if(R===void 0)return Y}else{d.trace("Initiating network request for completions");let Y=a((ie,H)=>(this.asyncCompletionManager.updateCompletion(r,ie),w.finishedCb(ie,H)),"finishedCb"),W=new dvc.CancellationTokenSource,V=Q.getCompletionsFromNetwork(k,D,W.token,Y,l);this.asyncCompletionManager.queueCompletionRequest(r,v,_.prompt,W,V);let z=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,_.prompt,y.isSpeculative);if(z===void 0)return d.trace("Network request returned no results"),{type:"empty",reason:"received no results from async completions",telemetryData:(0,Nh.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[z[0]],UV.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,Nh.mkBasicResultTelemetry)(D)};let[O,B]=R;d.trace(`Final choices: ${O.length} from ${(0,Nh.resultTypeToString)(B)}`);let q=O.map(Q=>this.instantiationService.invokeFunction(a5r.postProcessChoiceInContext,e.textDocument,e.position,Q,N,d)).filter(Q=>Q!==void 0);d.trace(`Post-processed to ${q.length} choices`);let M=this.instantiationService.invokeFunction(T3e.getConfig,T3e.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),L=(0,P_e.now)()-n.issuedTime,U=Math.max(M-L,0);if(B!==UV.ResultType.TypingAsSuggested&&!y.isCycling&&U>0&&(d.debug(`Waiting ${U}ms before returning completion`),await(0,r7i.delay)(U),S3e(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,Nh.mkCanceledResultTelemetry)(D)};let j=[];for(let Q of q){let Y=Dvc(e.textDocument,k,Q,D),W=g?(0,a5r.checkSuffix)(e.textDocument,e.position,Q):0,z={completion:Rvc(Q.choiceIndex,Q.completionText,_.trailingWs),telemetry:Y,isMiddleOfTheLine:g,suffixCoverage:W,copilotAnnotations:Q.copilotAnnotations,clientCompletionId:Q.clientCompletionId};j.push(z)}return D.properties.clientCompletionId=j[0]?.clientCompletionId,D.measurements.foundOffset=j?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${j.length} results from ${(0,Nh.resultTypeToString)(B)} at ${D.measurements.foundOffset} offset`),S3e(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,Nh.mkCanceledResultTelemetry)(D)}:(y.isSpeculative||(d.trace("Updating current ghost text as request is not speculative"),this.currentGhostText.setGhostText(v,_.prompt.suffix,q,B)),l.setHeaderRequestId(q[0]?.requestId.headerRequestId??r),m("complete"),d.trace(`Ghost text computation complete, returning ${j.length} results`),{type:"success",value:[j,B],telemetryData:(0,Nh.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:B,performanceMetrics:h})})}};mk.GhostTextComputer=pbt;mk.GhostTextComputer=pbt=ovc([MN(0,i7i.IInstantiationService),MN(1,svc.ITelemetryService),MN(2,fvc.ICompletionsNotifierService),MN(3,Avc.ICompletionsContextProviderBridgeService),MN(4,o7i.ICompletionsCurrentGhostText),MN(5,yvc.ICompletionsContextProviderService),MN(6,Evc.ICompletionsAsyncManagerService),MN(7,d5r.ICompletionsFeaturesService),MN(8,pvc.ICompletionsLogTargetService),MN(9,gvc.ICompletionsStatusReporter),MN(10,n7i.ILogService)],pbt);async function Ivc(t,e,r,n,o,s,c){return t.get(i7i.IInstantiationService).createInstance(pbt).getGhostText(e,r,n,o,s,c)}a(Ivc,"getGhostText");function xvc(t,e,r,n){let s=t.get(o7i.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=kvc(t,e,r.suffix,n);if(s&&s.length>0){let l=(c??[]).filter(u=>!s.some(d=>d.completionText===u.completionText));return[s.concat(l),UV.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,UV.ResultType.Cache]}a(xvc,"getLocalInlineSuggestion");function wvc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,lvc.isInlineSuggestionFromTextAfterCursor)(n)}a(wvc,"isInlineSuggestion");var u5r=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};mk.ForceMultiLine=u5r;function Rvc(t,e,r){if(r.length>0){if(e.startsWith(r))return{completionIndex:t,completionText:e,displayText:e.substring(r.length),displayNeedsWsOffset:!1};{let n=e.substring(0,e.length-e.trimStart().length);return r.startsWith(n)?{completionIndex:t,completionText:e,displayText:e.trimStart(),displayNeedsWsOffset:!0}:{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}}else return{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}a(Rvc,"adjustLeadingWhitespace");function kvc(t,e,r,n){let o=t.get(n7i.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(Cvc.ICompletionsCacheService).findAll(e,r);return s.length===0?(o.debug("Found no completions in cache"),[]):(o.debug(`Found ${s.length} completions in cache`),s.map(c=>(0,l5r.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(kvc,"getCompletionsFromCache");async function Pvc(t,e,r,n){let o=t.get(d5r.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=P_e.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(Pvc,"createTelemetryWithExp");function Dvc(t,e,r,n){let o=r.requestId,s={choiceIndex:r.choiceIndex.toString(),clientCompletionId:r.clientCompletionId};r.generatedChoiceIndex!==void 0&&(s.originalChoiceIndex=s.choiceIndex,s.choiceIndex=(1e4*(r.generatedChoiceIndex+1)+r.choiceIndex).toString());let c={compCharLen:r.completionText.length,numLines:r.completionText.trim().split(` -`).length};r.meanLogProb&&(c.meanLogProb=r.meanLogProb),r.meanAlternativeLogProb&&(c.meanAlternativeLogProb=r.meanAlternativeLogProb);let l=r.telemetryData.extendedBy(s,c);return l.issuedTime=n.issuedTime,l.measurements.timeToProduceMs=performance.now()-n.issuedTime,s7i(l,t),l.extendWithRequestId(o),l}a(Dvc,"telemetryWithAddData");function Nvc(t,e,r,n,o,s,c,l){let u={languageId:e.detectedLanguageId};u.afterAccept=r.afterAccept.toString(),u.isSpeculative=l.isSpeculative.toString();let d=s.extendedBy(u);s7i(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===c5r.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==c5r.ComputationStatus.PENDING&&(d.properties.gitRepoUrl=f.url,d.properties.gitRepoHost=f.hostname,f.repoId?.type==="github"?(d.properties.gitRepoOwner=f.repoId.org,d.properties.gitRepoName=f.repoId.repo):f.repoId?.type==="ado"&&(d.properties.gitRepoOwner=f.repoId.project,d.properties.gitRepoName=f.repoId.repo),d.properties.gitRepoPath=f.pathname),d.properties.engineName=c.modelId,d.properties.engineChoiceSource=c.engineChoiceSource,d.properties.isMultiline=JSON.stringify(r.multiline),d.properties.isCycling=JSON.stringify(r.isCycling);let h=e.lineAt(n.line),m=e.getText(fbt.LocationFactory.range(h.range.start,n)),g=e.getText(fbt.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(S=>(0,avc.createSha256Hash)(S).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},_={...(0,P_e.telemetrizePromptLength)(o.prompt),promptEndPos:e.offsetAt(n),promptComputeTimeMs:o.computeTimeMs};o.metadata&&(y.promptMetadata=JSON.stringify(o.metadata)),o.contextProvidersTelemetry&&(y.contextProviders=JSON.stringify(o.contextProvidersTelemetry));let E=d.extendedBy(y,_);return(0,P_e.telemetry)(t,"ghostText.issued",E),d}a(Nvc,"telemetryIssued");function s7i(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(s7i,"addDocumentTelemetry")});var d7i=I(NU=>{"use strict";p();var Mvc=NU&&NU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},f5r=NU&&NU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(NU,"__esModule",{value:!0});NU.GhostText=void 0;var c7i=ii(),Ovc=Ks(),Lvc=Xkr(),Bvc=i9i(),l7i=a7i(),Fvc=mOr(),Uvc=iV(),Qvc=$Et(),u7i=Zye(),qvc=Gl(),p5r=class{static{a(this,"GhostText")}constructor(e,r,n){this.instantiationService=e,this.logTargetService=r,this.speculativeRequestCache=n}async getInlineCompletions(e,r,n,o={},s,c,l){jvc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,Lvc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(u7i.handleGhostTextResultTelemetry,u)}async getInlineCompletionsResult(e,r,n={},o,s,c){let l=0;n.selectedCompletionInfo?.text&&!n.selectedCompletionInfo.text.includes(")")&&(e=e.addSelectedCompletionInfo(n.selectedCompletionInfo),l=e.position.character-n.selectedCompletionInfo.range.end.character);let u=await this.instantiationService.invokeFunction(l7i.getGhostText,e,r,n,o,s,c);if(u.type!=="success")return u;let[d,f]=u.value;if(r.isCancellationRequested)return{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:u.telemetryBlob}};let h=this.instantiationService.invokeFunction(Fvc.setLastShown,e.textDocument,e.position,f),m=(0,Bvc.completionsFromGhostTextResults)(d,f,e.textDocument,e.position,n.formattingOptions,h);if(m.length===0)return{type:"empty",reason:"no completions in final result",telemetryData:u.telemetryData};if(f!==Uvc.ResultType.TypingAsSuggested){e=e.applyEdits([{newText:m[0].insertText,range:m[0].range}]);let A={isSpeculative:!0,opportunityId:n.opportunityId},y=a(()=>this.instantiationService.invokeFunction(l7i.getGhostText,e,void 0,A,o,s,c),"fn");this.speculativeRequestCache.set(m[0].clientCompletionId,y)}let g=m.map(A=>{let{start:y,end:_}=A.range,E=c7i.Range.create(y,c7i.Position.create(_.line,_.character-l));return{...A,range:E}});return{...u,value:g}}};NU.GhostText=p5r;NU.GhostText=p5r=Mvc([f5r(0,Ovc.IInstantiationService),f5r(1,qvc.ICompletionsLogTargetService),f5r(2,Qvc.ICompletionsSpeculativeRequestCache)],p5r);function jvc(t,e,r){let n=e.getText({start:{line:Math.max(r.line-1,0),character:0},end:r}),o=e.getText({start:r,end:{line:Math.min(r.line+2,e.lineCount-1),character:e.lineCount-1>r.line?0:r.character}});u7i.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(jvc,"logCompletionLocation")});var f7i=I(gbt=>{"use strict";p();Object.defineProperty(gbt,"__esModule",{value:!0});gbt.LocalFileSystem=void 0;var hbt=require("fs"),Hvc=require("path"),mbt=eV(),h5r=rV(),m5r=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await hbt.promises.readFile((0,h5r.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,h5r.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,h5r.fsPath)(e),n=await hbt.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,Hvc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await hbt.promises.lstat(e);if(r.isSymbolicLink())try{let n=await hbt.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=mbt.FileType.Unknown;return e.isFile()&&(o=mbt.FileType.File),e.isDirectory()&&(o=mbt.FileType.Directory),r.isSymbolicLink()&&n&&(o|=mbt.FileType.SymbolicLink),o}};gbt.LocalFileSystem=m5r});var g7i=I(MU=>{"use strict";p();var Gvc=MU&&MU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},I3e=MU&&MU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(MU,"__esModule",{value:!0});MU.CompositeRelatedFilesProvider=void 0;var $vc=Pne(),Vvc=Ks(),D_e=eE(),Wvc=xy(),zvc=eV(),Yvc=Gl(),x3e=d_e(),bie=zvt(),p7i=["cpp","c","cuda-cpp"],h7i=["typescript","javascript","typescriptreact","javascriptreact"],m7i=["csharp"],Kvc=new Map([...p7i.map(t=>[t,x3e.NeighboringFileType.RelatedCpp]),...h7i.map(t=>[t,x3e.NeighboringFileType.RelatedTypeScript]),...m7i.map(t=>[t,x3e.NeighboringFileType.RelatedCSharpRoslyn])]);function Jvc(t){return Kvc.get(t)??x3e.NeighboringFileType.RelatedOther}a(Jvc,"getNeighboringFileType");var g5r=class extends bie.RelatedFilesProvider{static{a(this,"CompositeRelatedFilesProvider")}constructor(e,r,n,o,s){super(e,r,o,s),this.featuresService=n,this.providers=new Map,this.telemetrySent=!1,this.reportedUnknownProviders=new Set}async getRelatedFilesResponse(e,r,n){let o=Date.now(),s=e.clientLanguageId.toLowerCase();if(Jvc(s)===x3e.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),bie.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),bie.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return bie.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),bie.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return bie.EmptyRelatedFilesResponse;try{return this.convert(e.uri,l,o,r,n)}catch{this.relatedFileNonresponseTelemetry(s,r);return}}async convert(e,r,n,o,s){s||(s={isCancellationRequested:!1,onCancellationRequested:a(()=>({dispose(){}}),"onCancellationRequested")});let c={entries:[],traits:[]},l=r.size>0;for(let u of r.values()){let d=await u.callback(e,{flags:{}},s);if(d){l=!1,c.entries.push(...d.entries),d.traits&&c.traits.push(...d.traits);for(let f of d.entries)for(let h of f.uris)bie.relatedFilesLogger.debug(this.logTarget,h.toString())}}return this.performanceTelemetry(Date.now()-n,o),l?void 0:c}registerRelatedFilesProvider(e,r,n){let o=this.providers.get(r);o?o.set(e,{extensionId:e,languageId:r,callback:n}):this.providers.set(r,new Map([[e,{extensionId:e,languageId:r,callback:n}]]))}unregisterRelatedFilesProvider(e,r,n){let o=this.providers.get(r);if(o){let s=o.get(e);s&&s.callback===n&&o.delete(e)}}isActive(e,r){return m7i.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction(D_e.getConfig,D_e.ConfigKey.RelatedFilesVSCodeCSharp):h7i.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction(D_e.getConfig,D_e.ConfigKey.RelatedFilesVSCodeTypeScript):p7i.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction(D_e.getConfig,D_e.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};MU.CompositeRelatedFilesProvider=g5r;MU.CompositeRelatedFilesProvider=g5r=Gvc([I3e(0,Vvc.IInstantiationService),I3e(1,$vc.IIgnoreService),I3e(2,Wvc.ICompletionsFeaturesService),I3e(3,Yvc.ICompletionsLogTargetService),I3e(4,zvc.ICompletionsFileSystemService)],g5r)});var Abt=I(Sie=>{"use strict";p();Object.defineProperty(Sie,"__esModule",{value:!0});Sie.PositionOffsetTransformer=Sie.PositionOffsetTransformerBase=void 0;Sie.ensureDependenciesAreSet=eCc;var A7i=W_(),y7i=rLe(),Zvc=gpt(),Xvc=Vge(),_7i=gpt();Object.defineProperty(Sie,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return _7i.PositionOffsetTransformerBase},"get")});Object.defineProperty(Sie,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return _7i.PositionOffsetTransformer},"get")});(0,Zvc._setPositionOffsetTransformerDependencies)({StringEdit:A7i.StringEdit,StringReplacement:A7i.StringReplacement,TextReplacement:y7i.TextReplacement,TextEdit:y7i.TextEdit,TextLength:Xvc.TextLength});function eCc(){}a(eCc,"ensureDependenciesAreSet")});var _bt=I(ybt=>{"use strict";p();Object.defineProperty(ybt,"__esModule",{value:!0});ybt.RootedLineEdit=void 0;var E7i=k$(),tCc=Abt(),rCc=ON();(0,tCc.ensureDependenciesAreSet)();var A5r=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=E7i.LineEdit.fromStringEdit(e.edit,e.base);return new t(e.base,r)}constructor(e,r){this.base=e,this.edit=r}toString(){return this.edit.humanReadablePatch(this.base.getLines())}toEdit(){return this.edit.toEdit(this.base)}toRootedEdit(){return new rCc.RootedEdit(this.base,this.toEdit())}getEditedState(){let e=this.base.getLines();return this.edit.apply(e)}removeCommonSuffixPrefixLines(){let e=a(n=>!n.lineRange.isEmpty||n.newLines.length>0,"isNotEmptyEdit"),r=this.edit.replacements.map(n=>n.removeCommonSuffixPrefixLines(this.base)).filter(n=>e(n));return new t(this.base,new E7i.LineEdit(r))}};ybt.RootedLineEdit=A5r});var ON=I(QV=>{"use strict";p();Object.defineProperty(QV,"__esModule",{value:!0});QV.Edits=QV.SingleEdits=QV.RootedEdit=void 0;var v7i=pd(),nCc=k$(),N_e=W_(),C7i=_5r(),iCc=_bt(),w3e=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return nCc.LineEdit.fromStringEdit(e.edit,e.base)}constructor(e,r){this.base=e,this.edit=r}getEditedState(){return this.edit.applyOnText(this.base)}rebase(e){return(0,v7i.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,v7i.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return iCc.RootedLineEdit.fromEdit(this).toString()}normalize(){return new t(this.base,this.edit.normalizeOnSource(this.base.value))}equals(e){return this.base.equals(e.base)&&this.edit.equals(e.edit)}};QV.RootedEdit=w3e;var y5r=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return N_e.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new Ebt(N_e.StringEdit,this.edits.map(e=>e.toEdit()))}};QV.SingleEdits=y5r;var Ebt=class t{static{a(this,"Edits")}static single(e){return new t(N_e.StringEdit,[e])}constructor(e,r){this._editType=e,this.edits=r}compose(){let e=new this._editType([]);for(let r of this.edits)e=e.compose(r);return e}add(e){return new t(this._editType,[...this.edits,e])}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}swap(e){let r=e,n=[];for(let o of this.edits){let s=N_e.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(N_e.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,C7i.serializeStringEdit)(e))}static deserialize(e){return new t(N_e.StringEdit,e.map(r=>(0,C7i.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=w3e.toLineEdit(new w3e(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` +`],maxTokens:Z9i*f};return h===NN.BlockMode.MoreMultiline&&(g.blockMode=NN.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(e7i,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(ivc,"getGhostTextStrategy");function e7i(t,e,r,n,o,s,c,l,u){let d=t.get(r7i.ICompletionsFeaturesService),f=t.get(t7i.IInstantiationService);if(c&&e===NN.BlockMode.MoreMultiline&&b3e.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===b3e.BlockPositionType.EmptyBlock||o===b3e.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(evc.ICompletionsCacheService);return{finishedCb:f.createInstance(nvc.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let _={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,XEc.appendToCache)(m,_,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,fbt.parsingBlockFinished)(r,n):h=>{}}}a(e7i,"buildFinishedCallback");async function ovc(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,J9i.telemetry)(t,"ghostText.longFileMultilineSkip",J9i.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===NN.BlockMode.MoreMultiline&&b3e.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,b3e.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&svc(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,K9i.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,fbt.isEmptyBlockStartUtil)(r,n):o&&(0,K9i.isSupportedLanguageId)(r.detectedLanguageId)&&(u=await(0,fbt.isEmptyBlockStartUtil)(r,n)||await(0,fbt.isEmptyBlockStartUtil)(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=(0,rvc.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(ovc,"shouldRequestMultiline");function svc(t,e){return e.lineAt(t).text.trim().length===0}a(svc,"isNewLine")});var l7i=I(mk=>{"use strict";p();var avc=mk&&mk.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},MN=mk&&mk.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(mk,"__esModule",{value:!0});mk.ForceMultiLine=mk.GhostTextComputer=void 0;mk.getGhostText=wvc;var o7i=Np(),cvc=bh(),lvc=vOr(),uvc=Lg(),s7i=Ks(),dvc=COr(),fvc=kne(),pvc=WLe(),hvc=TRr(),T3e=eE(),f5r=xy(),mvc=Gl(),gvc=C_e(),Avc=ikr(),yvc=tbt(),_vc=Uvt(),Evc=_V(),vvc=ZEt(),a5r=p_e(),l5r=POr(),c5r=m9i(),P_e=nA(),pbt=Qye(),i7i=sBe(),Cvc=Rkr(),bvc=Yye(),Svc=cBe(),u5r=G9i(),a7i=Jkr(),Tvc=n7i(),QV=oV(),Nh=Zye(),Ivc={isCycling:!1,promptOnly:!1,isSpeculative:!1};function xvc(t,e,r){let n=t.get(f5r.ICompletionsFeaturesService),o=(0,T3e.getConfig)(t,T3e.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,P_e.now)()-r.issuedTime;return Math.max(0,o-s)}a(xvc,"getRemainingDebounceMs");function S3e(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(S3e,"isCompletionRequestCancelled");var hbt=class{static{a(this,"GhostTextComputer")}constructor(e,r,n,o,s,c,l,u,d,f,h){this.instantiationService=e,this.telemetryService=r,this.notifierService=n,this.contextProviderBridge=o,this.currentGhostText=s,this.contextproviderStatistics=c,this.asyncCompletionManager=l,this.completionsFeaturesService=u,this.logTarget=d,this.statusReporter=f,this.logService=h}async getGhostText(e,r,n,o,s,c){let l=(0,uvc.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(Nvc,e.textDocument,l,n);await(0,fvc.ensureTokenizersLoaded)().catch(()=>{});try{this.contextProviderBridge.schedule(e,l,n?.opportunityId??"",d,r,n),this.notifierService.notifyRequest(e,l,d,r,n);let f=await this.getGhostTextWithoutAbortHandling(e,l,d,r,n,o,s,u),h=this.contextproviderStatistics.getStatisticsForCompletion(l),m=n?.opportunityId??"unknown";for(let[g,A]of h.getAllUsageStatistics())this.telemetryService.sendMSFTTelemetryEvent("context-provider.completion-stats",{requestId:l,opportunityId:m,providerId:g,resolution:A.resolution,usage:A.usage,usageDetails:JSON.stringify(A.usageDetails)},{});return f}catch(f){if((0,gvc.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,Nh.mkCanceledResultTelemetry)(d,{cancelledNetworkRequest:!0})};throw f}}async getGhostTextWithoutAbortHandling(e,r,n,o,s,c,l,u){let d=u.createSubLogger(["GhostTextComputer#getGhostTextWithoutAbortHandling"]),f=n.issuedTime,h=[];function m(v){let S=(0,P_e.now)();h.push([v,S-f]),f=S}if(a(m,"recordPerformance"),m("telemetry"),S3e(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};let g=kvc(e.textDocument,e.position);if(g===void 0)return d.debug("Completions do not trigger in the middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(Avc.getEngineRequestInfo,n),y={...Ivc,...s,tokenizer:A.tokenizer},_=await this.instantiationService.invokeFunction(a5r.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(a5r.PromptResponse.toString(_)),_.type==="copilotContentExclusion")return d.debug("Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};if(_.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};if(_.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};if(y.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:_};if(_.type==="promptCancelled")return d.debug("Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};if(_.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};if(_.prompt.prefix.length===0&&_.prompt.suffix.length===0)return d.debug("Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)};let E=this.instantiationService.invokeFunction(xvc,y,n);return E>0&&(d.debug(`Debouncing ghost text request for ${E}ms`),await(0,i7i.delay)(E),S3e(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,Nh.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,a5r.trimLastLine)(e.textDocument.getText(pbt.LocationFactory.range(pbt.LocationFactory.position(0,0),e.position)));d.trace(`Starting ghost text computation, prefix length: ${v.length}`);let S=this.currentGhostText.hasAcceptedCurrentCompletion(v,_.prompt.suffix);d.trace(`hasAcceptedCurrentCompletion: ${S}`);let T=_.prompt,w=await this.instantiationService.invokeFunction(Tvc.getGhostTextStrategy,e,v,_,g,S,n);m("strategy"),d.trace(`Ghost text strategy: blockMode=${w.blockMode}, requestMultiline=${w.requestMultiline}, stop=${w.stop}, maxTokens=${w.maxTokens}`);let R=this.instantiationService.invokeFunction(Rvc,v,T,w.requestMultiline);d.trace(`Local cache lookup: ${R?`found ${R[0].length} choices`:"no cached choices"}`),m("cache");let x=this.instantiationService.invokeFunction(l5r.extractRepoInfoInBackground,e.textDocument.uri),k={blockMode:w.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:x,engineModelId:A.modelId,ourRequestId:r,prefix:v,prompt:_.prompt,multiline:w.requestMultiline,indentation:(0,vvc.contextIndentation)(e.textDocument,e.position),isCycling:y.isCycling,headers:A.headers,stop:w.stop,maxTokens:w.maxTokens,afterAccept:S};k.headers={...k.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":y.isSpeculative?"true":"false"};let D=this.instantiationService.invokeFunction(Ovc,e.textDocument,k,e.position,_,n,A,y);if(R===void 0&&!y.isCycling&&this.asyncCompletionManager.shouldWaitForAsyncCompletions(v,_.prompt)){d.trace("No cached choices, waiting for async completions from in-flight request");let Q=await this.asyncCompletionManager.getFirstMatchingRequestWithTimeout(r,v,_.prompt,y.isSpeculative,D);if(m("asyncWait"),Q){d.trace("Received choice from async completion");let Y=!w.requestMultiline;R=[[(0,u5r.makeGhostAPIChoice)(Q[0],{forceSingleLine:Y})],QV.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(S3e(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,Nh.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===T3e.BlockMode.MoreMultiline&&bvc.BlockTrimmer.isSupported(e.textDocument.detectedLanguageId);if(R!==void 0&&(d.trace(`Post-processing ${R[0].length} cached choices, isMoreMultiline=${N}`),R[0]=R[0].map(Q=>this.instantiationService.invokeFunction(c5r.postProcessChoiceInContext,e.textDocument,e.position,Q,N,d)).filter(Q=>Q!==void 0)),R&&(R[1]===QV.ResultType.Cache||R[1]===QV.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,Nh.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,Nh.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,Nh.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let Q=this.instantiationService.createInstance(u5r.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let Y=await Q.getAllCompletionsFromNetwork(k,D,o,w.finishedCb,l);if(Y.type==="success"){d.trace(`Cycling network request returned ${Y.value[0].length} choices`);let W=R?.[0]??[];Y.value[0].forEach(V=>{W.findIndex(z=>z.completionText.trim()===V.completionText.trim())===-1&&W.push(V)}),d.trace(`After deduplication: ${W.length} unique choices`),R=[W,QV.ResultType.Cycling]}else if(R===void 0)return Y}else{d.trace("Initiating network request for completions");let Y=a((ie,H)=>(this.asyncCompletionManager.updateCompletion(r,ie),w.finishedCb(ie,H)),"finishedCb"),W=new pvc.CancellationTokenSource,V=Q.getCompletionsFromNetwork(k,D,W.token,Y,l);this.asyncCompletionManager.queueCompletionRequest(r,v,_.prompt,W,V);let z=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,_.prompt,y.isSpeculative);if(z===void 0)return d.trace("Network request returned no results"),{type:"empty",reason:"received no results from async completions",telemetryData:(0,Nh.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[z[0]],QV.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,Nh.mkBasicResultTelemetry)(D)};let[O,B]=R;d.trace(`Final choices: ${O.length} from ${(0,Nh.resultTypeToString)(B)}`);let q=O.map(Q=>this.instantiationService.invokeFunction(c5r.postProcessChoiceInContext,e.textDocument,e.position,Q,N,d)).filter(Q=>Q!==void 0);d.trace(`Post-processed to ${q.length} choices`);let M=this.instantiationService.invokeFunction(T3e.getConfig,T3e.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),L=(0,P_e.now)()-n.issuedTime,U=Math.max(M-L,0);if(B!==QV.ResultType.TypingAsSuggested&&!y.isCycling&&U>0&&(d.debug(`Waiting ${U}ms before returning completion`),await(0,i7i.delay)(U),S3e(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,Nh.mkCanceledResultTelemetry)(D)};let j=[];for(let Q of q){let Y=Mvc(e.textDocument,k,Q,D),W=g?(0,c5r.checkSuffix)(e.textDocument,e.position,Q):0,z={completion:Pvc(Q.choiceIndex,Q.completionText,_.trailingWs),telemetry:Y,isMiddleOfTheLine:g,suffixCoverage:W,copilotAnnotations:Q.copilotAnnotations,clientCompletionId:Q.clientCompletionId};j.push(z)}return D.properties.clientCompletionId=j[0]?.clientCompletionId,D.measurements.foundOffset=j?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${j.length} results from ${(0,Nh.resultTypeToString)(B)} at ${D.measurements.foundOffset} offset`),S3e(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,Nh.mkCanceledResultTelemetry)(D)}:(y.isSpeculative||(d.trace("Updating current ghost text as request is not speculative"),this.currentGhostText.setGhostText(v,_.prompt.suffix,q,B)),l.setHeaderRequestId(q[0]?.requestId.headerRequestId??r),m("complete"),d.trace(`Ghost text computation complete, returning ${j.length} results`),{type:"success",value:[j,B],telemetryData:(0,Nh.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:B,performanceMetrics:h})})}};mk.GhostTextComputer=hbt;mk.GhostTextComputer=hbt=avc([MN(0,s7i.IInstantiationService),MN(1,cvc.ITelemetryService),MN(2,hvc.ICompletionsNotifierService),MN(3,_vc.ICompletionsContextProviderBridgeService),MN(4,a7i.ICompletionsCurrentGhostText),MN(5,Evc.ICompletionsContextProviderService),MN(6,Cvc.ICompletionsAsyncManagerService),MN(7,f5r.ICompletionsFeaturesService),MN(8,mvc.ICompletionsLogTargetService),MN(9,yvc.ICompletionsStatusReporter),MN(10,o7i.ILogService)],hbt);async function wvc(t,e,r,n,o,s,c){return t.get(s7i.IInstantiationService).createInstance(hbt).getGhostText(e,r,n,o,s,c)}a(wvc,"getGhostText");function Rvc(t,e,r,n){let s=t.get(a7i.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=Dvc(t,e,r.suffix,n);if(s&&s.length>0){let l=(c??[]).filter(u=>!s.some(d=>d.completionText===u.completionText));return[s.concat(l),QV.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,QV.ResultType.Cache]}a(Rvc,"getLocalInlineSuggestion");function kvc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,dvc.isInlineSuggestionFromTextAfterCursor)(n)}a(kvc,"isInlineSuggestion");var d5r=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};mk.ForceMultiLine=d5r;function Pvc(t,e,r){if(r.length>0){if(e.startsWith(r))return{completionIndex:t,completionText:e,displayText:e.substring(r.length),displayNeedsWsOffset:!1};{let n=e.substring(0,e.length-e.trimStart().length);return r.startsWith(n)?{completionIndex:t,completionText:e,displayText:e.trimStart(),displayNeedsWsOffset:!0}:{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}}else return{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}a(Pvc,"adjustLeadingWhitespace");function Dvc(t,e,r,n){let o=t.get(o7i.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(Svc.ICompletionsCacheService).findAll(e,r);return s.length===0?(o.debug("Found no completions in cache"),[]):(o.debug(`Found ${s.length} completions in cache`),s.map(c=>(0,u5r.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(Dvc,"getCompletionsFromCache");async function Nvc(t,e,r,n){let o=t.get(f5r.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=P_e.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(Nvc,"createTelemetryWithExp");function Mvc(t,e,r,n){let o=r.requestId,s={choiceIndex:r.choiceIndex.toString(),clientCompletionId:r.clientCompletionId};r.generatedChoiceIndex!==void 0&&(s.originalChoiceIndex=s.choiceIndex,s.choiceIndex=(1e4*(r.generatedChoiceIndex+1)+r.choiceIndex).toString());let c={compCharLen:r.completionText.length,numLines:r.completionText.trim().split(` +`).length};r.meanLogProb&&(c.meanLogProb=r.meanLogProb),r.meanAlternativeLogProb&&(c.meanAlternativeLogProb=r.meanAlternativeLogProb);let l=r.telemetryData.extendedBy(s,c);return l.issuedTime=n.issuedTime,l.measurements.timeToProduceMs=performance.now()-n.issuedTime,c7i(l,t),l.extendWithRequestId(o),l}a(Mvc,"telemetryWithAddData");function Ovc(t,e,r,n,o,s,c,l){let u={languageId:e.detectedLanguageId};u.afterAccept=r.afterAccept.toString(),u.isSpeculative=l.isSpeculative.toString();let d=s.extendedBy(u);c7i(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===l5r.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==l5r.ComputationStatus.PENDING&&(d.properties.gitRepoUrl=f.url,d.properties.gitRepoHost=f.hostname,f.repoId?.type==="github"?(d.properties.gitRepoOwner=f.repoId.org,d.properties.gitRepoName=f.repoId.repo):f.repoId?.type==="ado"&&(d.properties.gitRepoOwner=f.repoId.project,d.properties.gitRepoName=f.repoId.repo),d.properties.gitRepoPath=f.pathname),d.properties.engineName=c.modelId,d.properties.engineChoiceSource=c.engineChoiceSource,d.properties.isMultiline=JSON.stringify(r.multiline),d.properties.isCycling=JSON.stringify(r.isCycling);let h=e.lineAt(n.line),m=e.getText(pbt.LocationFactory.range(h.range.start,n)),g=e.getText(pbt.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(S=>(0,lvc.createSha256Hash)(S).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},_={...(0,P_e.telemetrizePromptLength)(o.prompt),promptEndPos:e.offsetAt(n),promptComputeTimeMs:o.computeTimeMs};o.metadata&&(y.promptMetadata=JSON.stringify(o.metadata)),o.contextProvidersTelemetry&&(y.contextProviders=JSON.stringify(o.contextProvidersTelemetry));let E=d.extendedBy(y,_);return(0,P_e.telemetry)(t,"ghostText.issued",E),d}a(Ovc,"telemetryIssued");function c7i(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(c7i,"addDocumentTelemetry")});var p7i=I(NU=>{"use strict";p();var Lvc=NU&&NU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},p5r=NU&&NU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(NU,"__esModule",{value:!0});NU.GhostText=void 0;var u7i=ii(),Bvc=Ks(),Fvc=ePr(),Uvc=s9i(),d7i=l7i(),Qvc=gOr(),qvc=oV(),jvc=VEt(),f7i=Zye(),Hvc=Gl(),h5r=class{static{a(this,"GhostText")}constructor(e,r,n){this.instantiationService=e,this.logTargetService=r,this.speculativeRequestCache=n}async getInlineCompletions(e,r,n,o={},s,c,l){Gvc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,Fvc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(f7i.handleGhostTextResultTelemetry,u)}async getInlineCompletionsResult(e,r,n={},o,s,c){let l=0;n.selectedCompletionInfo?.text&&!n.selectedCompletionInfo.text.includes(")")&&(e=e.addSelectedCompletionInfo(n.selectedCompletionInfo),l=e.position.character-n.selectedCompletionInfo.range.end.character);let u=await this.instantiationService.invokeFunction(d7i.getGhostText,e,r,n,o,s,c);if(u.type!=="success")return u;let[d,f]=u.value;if(r.isCancellationRequested)return{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:u.telemetryBlob}};let h=this.instantiationService.invokeFunction(Qvc.setLastShown,e.textDocument,e.position,f),m=(0,Uvc.completionsFromGhostTextResults)(d,f,e.textDocument,e.position,n.formattingOptions,h);if(m.length===0)return{type:"empty",reason:"no completions in final result",telemetryData:u.telemetryData};if(f!==qvc.ResultType.TypingAsSuggested){e=e.applyEdits([{newText:m[0].insertText,range:m[0].range}]);let A={isSpeculative:!0,opportunityId:n.opportunityId},y=a(()=>this.instantiationService.invokeFunction(d7i.getGhostText,e,void 0,A,o,s,c),"fn");this.speculativeRequestCache.set(m[0].clientCompletionId,y)}let g=m.map(A=>{let{start:y,end:_}=A.range,E=u7i.Range.create(y,u7i.Position.create(_.line,_.character-l));return{...A,range:E}});return{...u,value:g}}};NU.GhostText=h5r;NU.GhostText=h5r=Lvc([p5r(0,Bvc.IInstantiationService),p5r(1,Hvc.ICompletionsLogTargetService),p5r(2,jvc.ICompletionsSpeculativeRequestCache)],h5r);function Gvc(t,e,r){let n=e.getText({start:{line:Math.max(r.line-1,0),character:0},end:r}),o=e.getText({start:r,end:{line:Math.min(r.line+2,e.lineCount-1),character:e.lineCount-1>r.line?0:r.character}});f7i.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(Gvc,"logCompletionLocation")});var h7i=I(Abt=>{"use strict";p();Object.defineProperty(Abt,"__esModule",{value:!0});Abt.LocalFileSystem=void 0;var mbt=require("fs"),$vc=require("path"),gbt=tV(),m5r=nV(),g5r=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await mbt.promises.readFile((0,m5r.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,m5r.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,m5r.fsPath)(e),n=await mbt.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,$vc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await mbt.promises.lstat(e);if(r.isSymbolicLink())try{let n=await mbt.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=gbt.FileType.Unknown;return e.isFile()&&(o=gbt.FileType.File),e.isDirectory()&&(o=gbt.FileType.Directory),r.isSymbolicLink()&&n&&(o|=gbt.FileType.SymbolicLink),o}};Abt.LocalFileSystem=g5r});var y7i=I(MU=>{"use strict";p();var Vvc=MU&&MU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},I3e=MU&&MU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(MU,"__esModule",{value:!0});MU.CompositeRelatedFilesProvider=void 0;var Wvc=Dne(),zvc=Ks(),D_e=eE(),Yvc=xy(),Kvc=tV(),Jvc=Gl(),x3e=d_e(),Sie=Yvt(),m7i=["cpp","c","cuda-cpp"],g7i=["typescript","javascript","typescriptreact","javascriptreact"],A7i=["csharp"],Zvc=new Map([...m7i.map(t=>[t,x3e.NeighboringFileType.RelatedCpp]),...g7i.map(t=>[t,x3e.NeighboringFileType.RelatedTypeScript]),...A7i.map(t=>[t,x3e.NeighboringFileType.RelatedCSharpRoslyn])]);function Xvc(t){return Zvc.get(t)??x3e.NeighboringFileType.RelatedOther}a(Xvc,"getNeighboringFileType");var A5r=class extends Sie.RelatedFilesProvider{static{a(this,"CompositeRelatedFilesProvider")}constructor(e,r,n,o,s){super(e,r,o,s),this.featuresService=n,this.providers=new Map,this.telemetrySent=!1,this.reportedUnknownProviders=new Set}async getRelatedFilesResponse(e,r,n){let o=Date.now(),s=e.clientLanguageId.toLowerCase();if(Xvc(s)===x3e.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),Sie.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),Sie.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return Sie.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),Sie.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return Sie.EmptyRelatedFilesResponse;try{return this.convert(e.uri,l,o,r,n)}catch{this.relatedFileNonresponseTelemetry(s,r);return}}async convert(e,r,n,o,s){s||(s={isCancellationRequested:!1,onCancellationRequested:a(()=>({dispose(){}}),"onCancellationRequested")});let c={entries:[],traits:[]},l=r.size>0;for(let u of r.values()){let d=await u.callback(e,{flags:{}},s);if(d){l=!1,c.entries.push(...d.entries),d.traits&&c.traits.push(...d.traits);for(let f of d.entries)for(let h of f.uris)Sie.relatedFilesLogger.debug(this.logTarget,h.toString())}}return this.performanceTelemetry(Date.now()-n,o),l?void 0:c}registerRelatedFilesProvider(e,r,n){let o=this.providers.get(r);o?o.set(e,{extensionId:e,languageId:r,callback:n}):this.providers.set(r,new Map([[e,{extensionId:e,languageId:r,callback:n}]]))}unregisterRelatedFilesProvider(e,r,n){let o=this.providers.get(r);if(o){let s=o.get(e);s&&s.callback===n&&o.delete(e)}}isActive(e,r){return A7i.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction(D_e.getConfig,D_e.ConfigKey.RelatedFilesVSCodeCSharp):g7i.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction(D_e.getConfig,D_e.ConfigKey.RelatedFilesVSCodeTypeScript):m7i.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction(D_e.getConfig,D_e.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};MU.CompositeRelatedFilesProvider=A5r;MU.CompositeRelatedFilesProvider=A5r=Vvc([I3e(0,zvc.IInstantiationService),I3e(1,Wvc.IIgnoreService),I3e(2,Yvc.ICompletionsFeaturesService),I3e(3,Jvc.ICompletionsLogTargetService),I3e(4,Kvc.ICompletionsFileSystemService)],A5r)});var ybt=I(Tie=>{"use strict";p();Object.defineProperty(Tie,"__esModule",{value:!0});Tie.PositionOffsetTransformer=Tie.PositionOffsetTransformerBase=void 0;Tie.ensureDependenciesAreSet=rCc;var _7i=W_(),E7i=rLe(),eCc=Apt(),tCc=Vge(),v7i=Apt();Object.defineProperty(Tie,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return v7i.PositionOffsetTransformerBase},"get")});Object.defineProperty(Tie,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return v7i.PositionOffsetTransformer},"get")});(0,eCc._setPositionOffsetTransformerDependencies)({StringEdit:_7i.StringEdit,StringReplacement:_7i.StringReplacement,TextReplacement:E7i.TextReplacement,TextEdit:E7i.TextEdit,TextLength:tCc.TextLength});function rCc(){}a(rCc,"ensureDependenciesAreSet")});var Ebt=I(_bt=>{"use strict";p();Object.defineProperty(_bt,"__esModule",{value:!0});_bt.RootedLineEdit=void 0;var C7i=P$(),nCc=ybt(),iCc=ON();(0,nCc.ensureDependenciesAreSet)();var y5r=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=C7i.LineEdit.fromStringEdit(e.edit,e.base);return new t(e.base,r)}constructor(e,r){this.base=e,this.edit=r}toString(){return this.edit.humanReadablePatch(this.base.getLines())}toEdit(){return this.edit.toEdit(this.base)}toRootedEdit(){return new iCc.RootedEdit(this.base,this.toEdit())}getEditedState(){let e=this.base.getLines();return this.edit.apply(e)}removeCommonSuffixPrefixLines(){let e=a(n=>!n.lineRange.isEmpty||n.newLines.length>0,"isNotEmptyEdit"),r=this.edit.replacements.map(n=>n.removeCommonSuffixPrefixLines(this.base)).filter(n=>e(n));return new t(this.base,new C7i.LineEdit(r))}};_bt.RootedLineEdit=y5r});var ON=I(qV=>{"use strict";p();Object.defineProperty(qV,"__esModule",{value:!0});qV.Edits=qV.SingleEdits=qV.RootedEdit=void 0;var b7i=pd(),oCc=P$(),N_e=W_(),S7i=E5r(),sCc=Ebt(),w3e=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return oCc.LineEdit.fromStringEdit(e.edit,e.base)}constructor(e,r){this.base=e,this.edit=r}getEditedState(){return this.edit.applyOnText(this.base)}rebase(e){return(0,b7i.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,b7i.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return sCc.RootedLineEdit.fromEdit(this).toString()}normalize(){return new t(this.base,this.edit.normalizeOnSource(this.base.value))}equals(e){return this.base.equals(e.base)&&this.edit.equals(e.edit)}};qV.RootedEdit=w3e;var _5r=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return N_e.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new vbt(N_e.StringEdit,this.edits.map(e=>e.toEdit()))}};qV.SingleEdits=_5r;var vbt=class t{static{a(this,"Edits")}static single(e){return new t(N_e.StringEdit,[e])}constructor(e,r){this._editType=e,this.edits=r}compose(){let e=new this._editType([]);for(let r of this.edits)e=e.compose(r);return e}add(e){return new t(this._editType,[...this.edits,e])}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}swap(e){let r=e,n=[];for(let o of this.edits){let s=N_e.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(N_e.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,S7i.serializeStringEdit)(e))}static deserialize(e){return new t(N_e.StringEdit,e.map(r=>(0,S7i.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=w3e.toLineEdit(new w3e(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` --- -`)}};QV.Edits=Ebt});var _5r=I(M_e=>{"use strict";p();Object.defineProperty(M_e,"__esModule",{value:!0});M_e.serializeStringEdit=aCc;M_e.serializeSingleEdit=T7i;M_e.deserializeStringEdit=cCc;M_e.decomposeStringEdit=uCc;var oCc=Os(),S7i=W_(),sCc=Td(),b7i=ON();function aCc(t){return t.replacements.map(e=>T7i(e))}a(aCc,"serializeStringEdit");function T7i(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(T7i,"serializeSingleEdit");function cCc(t){return new S7i.StringEdit(t.map(e=>lCc(e)))}a(cCc,"deserializeStringEdit");function lCc(t){return new S7i.StringReplacement(new sCc.OffsetRange(t[0],t[1]),t[2])}a(lCc,"deserializeSingleEdit");function uCc(t,e){if(e===void 0){let o=[],s=0;for(let c of t.replacements)o.push(c.delta(s)),s+=c.newText.length-c.replaceRange.length;return new b7i.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,oCc.illegalArgument)(`Number of edits ${t.replacements.length} does not match ${e.arrayLength}`);let r=[],n=t.replacements.slice();for(let o=0;o{"use strict";p();Object.defineProperty(vbt,"__esModule",{value:!0});vbt.DebugRecorderBookmark=void 0;var E5r=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};vbt.DebugRecorderBookmark=E5r});var k7i=I(bbt=>{"use strict";p();Object.defineProperty(bbt,"__esModule",{value:!0});bbt.DebugRecorder=void 0;var x7i=_5r(),dCc=I7i(),fCc=W4(),pCc=e5e(),Cbt=Ml(),w7i=Po(),hCc=XJ(),mCc=o6(),gCc=$A(),R7i=Og(),ACc=dI(),v5r=class extends w7i.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=pCc.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,mCc.mapObservableArrayCached)(this,this._workspace.openDocuments,(n,o)=>{let s=this._workspace.getWorkspaceRoot(n.id);if(!s)return;if(!this._workspaceRoot)this._workspaceRoot=s;else if(this._workspaceRoot.toString()!==s.toString())return;let c=new C5r(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,fCc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},l=>{l.languageId.changes.length>0&&(c.languageId=l.languageId.value);for(let u of l.value.changes)c.handleEdit(u);l.selection.changes.length>0&&c.handleSelections(l.selection.value)})),o.add((0,w7i.toDisposable)(()=>{this._documentHistories.delete(n.id)}))},n=>n.id).recomputeInitiallyAndOnChange(this._store)}getTimestamp(){let e=this.getNow();return this._lastTimestamp!==void 0&&e<=this._lastTimestamp&&(e=this._lastTimestamp+1),this._lastTimestamp=e,e}getRecentLog(e=void 0){if(!this._workspaceRoot)return;let r=[];r.push({entry:{documentType:"workspaceRecording@1.0",kind:"header",repoRootUri:this._workspaceRoot.toString(),time:this.getNow(),uuid:(0,R7i.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,Cbt.compareBy)(n=>n.sortTime,Cbt.numberComparator)),r.map(n=>n.entry)}getLogInRange(e,r){if(!this._workspaceRoot)return;let n=[];n.push({entry:{documentType:"workspaceRecording@1.0",kind:"header",repoRootUri:this._workspaceRoot.toString(),time:this.getNow(),uuid:(0,R7i.generateUuid)()},sortTime:0});for(let o of this._documentHistories.values())n.push(...o.getDocumentLogInRange(e,r));return n.sort((0,Cbt.compareBy)(o=>o.sortTime,Cbt.numberComparator)),n.map(o=>o.entry)}createBookmark(){return new dCc.DebugRecorderBookmark(this.getNow())}};bbt.DebugRecorder=v5r;var C5r=class{static{a(this,"DocumentHistory")}constructor(e,r,n,o,s,c){this.workspaceUri=e,this.docId=r,this.id=o,this.languageId=s,this.getNow=c,this._edits=[],this.relativePath=(()=>{let l=(0,gCc.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===hCc.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new ACc.StringText(n),this.creationTime=this.getNow(),this._baseValueTime=this.creationTime}handleSelections(e){this._edits.push({kind:"selections",selections:e,instant:this.getNow()})}handleEdit(e){e.isEmpty()||(this._edits.push({kind:"edit",edit:e,instant:this.getNow()}),this.cleanUpHistory())}cleanUpHistory(){let r=this.getNow()-3e5;for(;this._edits.length>0&&this._edits[0].instante.timeMs)break;if(o.kind==="selections"){let s=o.selections.map(c=>[c.start,c.endExclusive]);r.push({entry:{kind:"selectionChanged",id:this.id,selection:s,time:o.instant},sortTime:o.instant})}else n++,r.push({entry:{kind:"changed",id:this.id,v:n,edit:(0,x7i.serializeStringEdit)(o.edit),time:o.instant},sortTime:o.instant})}return r}getDocumentLogInRange(e,r){let n=this._edits.filter(u=>u.instant>=e&&u.instant<=r);if(n.length===0)return[];let o=this._baseValue,s=this._baseValueTime;if(e>s)for(let u of this._edits){if(u.instant>=e)break;u.kind==="edit"&&(o=u.edit.applyOnText(o),s=u.instant)}let c=[];c.push({entry:{kind:"documentEncountered",id:this.id,relativePath:this.relativePath,time:this.creationTime},sortTime:this.creationTime});let l=1;c.push({entry:{kind:"setContent",id:this.id,v:l,content:o.value,time:s},sortTime:s}),c.push({entry:{kind:"opened",id:this.id,time:s},sortTime:s});for(let u of n)if(u.kind==="selections"){let d=u.selections.map(f=>[f.start,f.endExclusive]);c.push({entry:{kind:"selectionChanged",id:this.id,selection:d,time:u.instant},sortTime:u.instant})}else l++,c.push({entry:{kind:"changed",id:this.id,v:l,edit:(0,x7i.serializeStringEdit)(u.edit),time:u.instant},sortTime:u.instant});return c}}});var P7i=I(Sbt=>{"use strict";p();Object.defineProperty(Sbt,"__esModule",{value:!0});Sbt.CapturingToken=void 0;var b5r=class{static{a(this,"CapturingToken")}constructor(e,r,n,o,s,c,l){this.label=e,this.icon=r,this.subAgentInvocationId=n,this.subAgentName=o,this.chatSessionId=s,this.parentChatSessionId=c,this.debugLogLabel=l}};Sbt.CapturingToken=b5r});var D7i=I(S5r=>{"use strict";p();Object.defineProperty(S5r,"__esModule",{value:!0});S5r.secondsToHumanReadableTime=yCc;function yCc(t){if(t<90)return`${t} seconds`;let e=Math.floor(t/60);if(t<=5400)return`${e} minutes`;let r=Math.floor(e/60),n=e%60,o=`${r} hours`;return n>0&&(o+=` ${n} minutes`),o}a(yCc,"secondsToHumanReadableTime")});var gk=I(uf=>{"use strict";p();var _Cc=uf&&uf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ECc=uf&&uf.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vCc=uf&&uf.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(M_e,"__esModule",{value:!0});M_e.serializeStringEdit=lCc;M_e.serializeSingleEdit=x7i;M_e.deserializeStringEdit=uCc;M_e.decomposeStringEdit=fCc;var aCc=Os(),I7i=W_(),cCc=Id(),T7i=ON();function lCc(t){return t.replacements.map(e=>x7i(e))}a(lCc,"serializeStringEdit");function x7i(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(x7i,"serializeSingleEdit");function uCc(t){return new I7i.StringEdit(t.map(e=>dCc(e)))}a(uCc,"deserializeStringEdit");function dCc(t){return new I7i.StringReplacement(new cCc.OffsetRange(t[0],t[1]),t[2])}a(dCc,"deserializeSingleEdit");function fCc(t,e){if(e===void 0){let o=[],s=0;for(let c of t.replacements)o.push(c.delta(s)),s+=c.newText.length-c.replaceRange.length;return new T7i.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,aCc.illegalArgument)(`Number of edits ${t.replacements.length} does not match ${e.arrayLength}`);let r=[],n=t.replacements.slice();for(let o=0;o{"use strict";p();Object.defineProperty(Cbt,"__esModule",{value:!0});Cbt.DebugRecorderBookmark=void 0;var v5r=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};Cbt.DebugRecorderBookmark=v5r});var D7i=I(Sbt=>{"use strict";p();Object.defineProperty(Sbt,"__esModule",{value:!0});Sbt.DebugRecorder=void 0;var R7i=E5r(),pCc=w7i(),hCc=W4(),mCc=e5e(),bbt=Ml(),k7i=Po(),gCc=eZ(),ACc=o6(),yCc=$A(),P7i=Lg(),_Cc=dI(),C5r=class extends k7i.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=mCc.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,ACc.mapObservableArrayCached)(this,this._workspace.openDocuments,(n,o)=>{let s=this._workspace.getWorkspaceRoot(n.id);if(!s)return;if(!this._workspaceRoot)this._workspaceRoot=s;else if(this._workspaceRoot.toString()!==s.toString())return;let c=new b5r(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,hCc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},l=>{l.languageId.changes.length>0&&(c.languageId=l.languageId.value);for(let u of l.value.changes)c.handleEdit(u);l.selection.changes.length>0&&c.handleSelections(l.selection.value)})),o.add((0,k7i.toDisposable)(()=>{this._documentHistories.delete(n.id)}))},n=>n.id).recomputeInitiallyAndOnChange(this._store)}getTimestamp(){let e=this.getNow();return this._lastTimestamp!==void 0&&e<=this._lastTimestamp&&(e=this._lastTimestamp+1),this._lastTimestamp=e,e}getRecentLog(e=void 0){if(!this._workspaceRoot)return;let r=[];r.push({entry:{documentType:"workspaceRecording@1.0",kind:"header",repoRootUri:this._workspaceRoot.toString(),time:this.getNow(),uuid:(0,P7i.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,bbt.compareBy)(n=>n.sortTime,bbt.numberComparator)),r.map(n=>n.entry)}getLogInRange(e,r){if(!this._workspaceRoot)return;let n=[];n.push({entry:{documentType:"workspaceRecording@1.0",kind:"header",repoRootUri:this._workspaceRoot.toString(),time:this.getNow(),uuid:(0,P7i.generateUuid)()},sortTime:0});for(let o of this._documentHistories.values())n.push(...o.getDocumentLogInRange(e,r));return n.sort((0,bbt.compareBy)(o=>o.sortTime,bbt.numberComparator)),n.map(o=>o.entry)}createBookmark(){return new pCc.DebugRecorderBookmark(this.getNow())}};Sbt.DebugRecorder=C5r;var b5r=class{static{a(this,"DocumentHistory")}constructor(e,r,n,o,s,c){this.workspaceUri=e,this.docId=r,this.id=o,this.languageId=s,this.getNow=c,this._edits=[],this.relativePath=(()=>{let l=(0,yCc.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===gCc.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new _Cc.StringText(n),this.creationTime=this.getNow(),this._baseValueTime=this.creationTime}handleSelections(e){this._edits.push({kind:"selections",selections:e,instant:this.getNow()})}handleEdit(e){e.isEmpty()||(this._edits.push({kind:"edit",edit:e,instant:this.getNow()}),this.cleanUpHistory())}cleanUpHistory(){let r=this.getNow()-3e5;for(;this._edits.length>0&&this._edits[0].instante.timeMs)break;if(o.kind==="selections"){let s=o.selections.map(c=>[c.start,c.endExclusive]);r.push({entry:{kind:"selectionChanged",id:this.id,selection:s,time:o.instant},sortTime:o.instant})}else n++,r.push({entry:{kind:"changed",id:this.id,v:n,edit:(0,R7i.serializeStringEdit)(o.edit),time:o.instant},sortTime:o.instant})}return r}getDocumentLogInRange(e,r){let n=this._edits.filter(u=>u.instant>=e&&u.instant<=r);if(n.length===0)return[];let o=this._baseValue,s=this._baseValueTime;if(e>s)for(let u of this._edits){if(u.instant>=e)break;u.kind==="edit"&&(o=u.edit.applyOnText(o),s=u.instant)}let c=[];c.push({entry:{kind:"documentEncountered",id:this.id,relativePath:this.relativePath,time:this.creationTime},sortTime:this.creationTime});let l=1;c.push({entry:{kind:"setContent",id:this.id,v:l,content:o.value,time:s},sortTime:s}),c.push({entry:{kind:"opened",id:this.id,time:s},sortTime:s});for(let u of n)if(u.kind==="selections"){let d=u.selections.map(f=>[f.start,f.endExclusive]);c.push({entry:{kind:"selectionChanged",id:this.id,selection:d,time:u.instant},sortTime:u.instant})}else l++,c.push({entry:{kind:"changed",id:this.id,v:l,edit:(0,R7i.serializeStringEdit)(u.edit),time:u.instant},sortTime:u.instant});return c}}});var N7i=I(Tbt=>{"use strict";p();Object.defineProperty(Tbt,"__esModule",{value:!0});Tbt.CapturingToken=void 0;var S5r=class{static{a(this,"CapturingToken")}constructor(e,r,n,o,s,c,l){this.label=e,this.icon=r,this.subAgentInvocationId=n,this.subAgentName=o,this.chatSessionId=s,this.parentChatSessionId=c,this.debugLogLabel=l}};Tbt.CapturingToken=S5r});var M7i=I(T5r=>{"use strict";p();Object.defineProperty(T5r,"__esModule",{value:!0});T5r.secondsToHumanReadableTime=ECc;function ECc(t){if(t<90)return`${t} seconds`;let e=Math.floor(t/60);if(t<=5400)return`${e} minutes`;let r=Math.floor(e/60),n=e%60,o=`${r} hours`;return n>0&&(o+=` ${n} minutes`),o}a(ECc,"secondsToHumanReadableTime")});var gk=I(uf=>{"use strict";p();var vCc=uf&&uf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CCc=uf&&uf.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bCc=uf&&uf.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(YL,"__esModule",{value:!0});YL.PendingLoggedChatRequest=YL.IRequestLogger=YL.ChatRequestScheme=void 0;YL.resolveMarkdownContent=RCc;YL.resolveMarkdownIcon=kCc;var B7i=gk(),xCc=an(),wCc=Td(),T5r=class t{static{a(this,"ChatRequestScheme")}static{this.chatRequestScheme="ccreq"}static buildUri(e,r="markdown"){let n;return r==="markdown"?n="copilotmd":r==="json"?n="json":n="request.json",e.kind==="latest"?`${t.chatRequestScheme}:latest.${n}`:`${t.chatRequestScheme}:${e.id}.${n}`}static parseUri(e){if(e===this.buildUri({kind:"latest"},"markdown"))return{data:{kind:"latest"},format:"markdown"};if(e===this.buildUri({kind:"latest"},"json"))return{data:{kind:"latest"},format:"json"};if(e===this.buildUri({kind:"latest"},"rawrequest"))return{data:{kind:"latest"},format:"rawrequest"};let r=e.match(/ccreq:([^\s]+)\.copilotmd/);if(r)return{data:{kind:"request",id:r[1]},format:"markdown"};let n=e.match(/ccreq:([^\s]+)\.request\.json/);if(n)return{data:{kind:"request",id:n[1]},format:"rawrequest"};let o=e.match(/ccreq:([^\s]+)\.json/);if(o)return{data:{kind:"request",id:o[1]},format:"json"}}static findAllUris(e){let r=/(ccreq:[^\s]+\.(copilotmd|json|request\.json))/g;return[...e.matchAll(r)].map(n=>{let o=n[1];return{uri:o,range:new wCc.OffsetRange(n.index,n.index+o.length)}})}};YL.ChatRequestScheme=T5r;YL.IRequestLogger=(0,xCc.createServiceIdentifier)("IRequestLogger");function RCc(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(RCc,"resolveMarkdownContent");function kCc(t){return typeof t.icon=="function"?t.icon():t.icon}a(kCc,"resolveMarkdownIcon");var I5r=class{static{a(this,"AbstractPendingLoggedRequest")}constructor(e,r,n,o){this._logbook=e,this._debugName=r,this._chatEndpoint=n,this._chatParams=o,this._timeToFirstToken=void 0,this._time=new Date}markTimeToFirstToken(e){this._timeToFirstToken=e}resolveWithCancelation(){this._logbook.addEntry({type:"ChatMLCancelation",debugName:this._debugName,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata})}},x5r=class extends I5r{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===B7i.ChatFetchResponseType.Success?this._logbook.addEntry({type:"ChatMLSuccess",debugName:this._debugName,usage:e.usage,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,timeToFirstToken:this._timeToFirstToken,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata,result:e,deltas:r}):this._logbook.addEntry({type:e.type===B7i.ChatFetchResponseType.Canceled?"ChatMLCancelation":"ChatMLFailure",debugName:this._debugName,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,timeToFirstToken:this._timeToFirstToken,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata,result:e})}};YL.PendingLoggedChatRequest=x5r});var R5r=I(L_e=>{"use strict";p();Object.defineProperty(L_e,"__esModule",{value:!0});L_e.NullSnippyService=L_e.ISnippyService=void 0;var PCc=an();L_e.ISnippyService=(0,PCc.createServiceIdentifier)("ISnippyService");var w5r=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};L_e.NullSnippyService=w5r});var D5r=I(B_e=>{"use strict";p();Object.defineProperty(B_e,"__esModule",{value:!0});B_e.MovedText=B_e.LinesDiff=void 0;var k5r=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};B_e.LinesDiff=k5r;var P5r=class t{static{a(this,"MovedText")}constructor(e,r){this.lineRangeMapping=e,this.changes=r}flip(){return new t(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}};B_e.MovedText=P5r});var xbt=I(BN=>{"use strict";p();Object.defineProperty(BN,"__esModule",{value:!0});BN.RangeMapping=BN.DetailedLineRangeMapping=BN.LineRangeMapping=void 0;BN.lineRangeMappingFromRangeMappings=NCc;BN.getLineRangeMapping=q7i;BN.lineRangeMappingFromChange=MCc;var DCc=Ml(),F7i=pd(),Ibt=Os(),US=vD(),LN=iv(),KL=uh(),Q7i=rLe(),R3e=class t{static{a(this,"LineRangeMapping")}static inverse(e,r,n){let o=[],s=1,c=1;for(let u of e){let d=new t(new US.LineRange(s,u.original.startLineNumber),new US.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new US.LineRange(s,r+1),new US.LineRange(c,n+1));return l.modified.isEmpty||o.push(l),o}static clip(e,r,n){let o=[];for(let s of e){let c=s.original.intersect(r),l=s.modified.intersect(n);c&&!c.isEmpty&&l&&!l.isEmpty&&o.push(new t(c,l))}return o}constructor(e,r){this.original=e,this.modified=r}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new t(this.modified,this.original)}join(e){return new t(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),r=this.modified.toInclusiveRange();if(e&&r)return new OU(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Ibt.BugIndicatingError("not a valid diff");return new OU(new KL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new KL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new OU(new KL.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new KL.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(U7i(this.original.endLineNumberExclusive,e)&&U7i(this.modified.endLineNumberExclusive,r))return new OU(new KL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new KL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new OU(KL.Range.fromPositions(new LN.Position(this.original.startLineNumber,1),F_e(new LN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),KL.Range.fromPositions(new LN.Position(this.modified.startLineNumber,1),F_e(new LN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new OU(KL.Range.fromPositions(F_e(new LN.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),F_e(new LN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),KL.Range.fromPositions(F_e(new LN.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),F_e(new LN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Ibt.BugIndicatingError}};BN.LineRangeMapping=R3e;function F_e(t,e){if(t.lineNumber<1)return new LN.Position(1,1);if(t.lineNumber>e.length)return new LN.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new LN.Position(t.lineNumber,r.length+1):t}a(F_e,"normalizePosition");function U7i(t,e){return t>=1&&t<=e.length}a(U7i,"isValidLineNumber");var k3e=class t extends R3e{static{a(this,"DetailedLineRangeMapping")}static toTextEdit(e,r){let n=[];for(let o of e)for(let s of o.innerChanges??[]){let c=s.toTextEdit(r);n.push(c)}return new Q7i.TextEdit(n)}static fromRangeMappings(e){let r=US.LineRange.join(e.map(o=>US.LineRange.fromRangeInclusive(o.originalRange))),n=US.LineRange.join(e.map(o=>US.LineRange.fromRangeInclusive(o.modifiedRange)));return new t(r,n,e)}constructor(e,r,n){super(e,r),this.innerChanges=n}flip(){return new t(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new t(this.original,this.modified,[this.toRangeMapping()])}};BN.DetailedLineRangeMapping=k3e;var OU=class t{static{a(this,"RangeMapping")}static fromEdit(e){let r=e.getNewRanges();return e.replacements.map((o,s)=>new t(o.range,r[s]))}static fromEditJoin(e){let r=e.getNewRanges(),n=e.replacements.map((o,s)=>new t(o.range,r[s]));return t.join(n)}static join(e){if(e.length===0)throw new Ibt.BugIndicatingError("Cannot join an empty list of range mappings");let r=e[0];for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new t(this.modifiedRange,this.originalRange)}toTextEdit(e){let r=e.getValueOfRange(this.modifiedRange);return new Q7i.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};BN.RangeMapping=OU;function NCc(t,e,r,n=!1){let o=[];for(let s of(0,DCc.groupAdjacentBy)(t.map(c=>q7i(c,e,r)),(c,l)=>c.original.intersectsOrTouches(l.original)||c.modified.intersectsOrTouches(l.modified))){let c=s[0],l=s[s.length-1];o.push(new k3e(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,F7i.assertFn)(()=>!n&&o.length>0&&(o[0].modified.startLineNumber!==o[0].original.startLineNumber||r.length.lineCount-o[o.length-1].modified.endLineNumberExclusive!==e.length.lineCount-o[o.length-1].original.endLineNumberExclusive)?!1:(0,F7i.checkAdjacentItems)(o,(s,c)=>c.original.startLineNumber-s.original.endLineNumberExclusive===c.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive=r.getLineLength(t.modifiedRange.startLineNumber)&&t.originalRange.startColumn-1>=e.getLineLength(t.originalRange.startLineNumber)&&t.originalRange.startLineNumber<=t.originalRange.endLineNumber+o&&t.modifiedRange.startLineNumber<=t.modifiedRange.endLineNumber+o&&(n=1);let s=new US.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new US.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new k3e(s,c,[t])}a(q7i,"getLineRangeMapping");function MCc(t){let e;t.originalEndLineNumber===0?e=new US.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new US.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new US.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new US.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new R3e(e,r)}a(MCc,"lineRangeMappingFromChange")});var Q_e=I(Ak=>{"use strict";p();Object.defineProperty(Ak,"__esModule",{value:!0});Ak.DateTimeout=Ak.InfiniteTimeout=Ak.OffsetPair=Ak.SequenceDiff=Ak.DiffAlgorithmResult=void 0;var OCc=Ml(),j7i=Os(),U_e=Td(),N5r=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new P3e(U_e.OffsetRange.ofLength(e.length),U_e.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new P3e(U_e.OffsetRange.ofLength(e.length),U_e.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};Ak.DiffAlgorithmResult=N5r;var P3e=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,OCc.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():Tie.zero,s?s.getStarts():new Tie(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new U_e.OffsetRange(e.offset1,r.offset1),new U_e.OffsetRange(e.offset2,r.offset2))}static assertSorted(e){let r;for(let n of e){if(r&&!(r.seq1Range.endExclusive<=n.seq1Range.start&&r.seq2Range.endExclusive<=n.seq2Range.start))throw new j7i.BugIndicatingError("Sequence diffs must be sorted");r=n}}constructor(e,r){this.seq1Range=e,this.seq2Range=r}swap(){return new t(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new t(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new t(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new t(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new t(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersectsOrTouches(e){return this.seq1Range.intersectsOrTouches(e.seq1Range)||this.seq2Range.intersectsOrTouches(e.seq2Range)}intersect(e){let r=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!r||!n))return new t(r,n)}getStarts(){return new Tie(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Tie(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};Ak.SequenceDiff=P3e;var Tie=class t{static{a(this,"OffsetPair")}static{this.zero=new t(0,0)}static{this.max=new t(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}constructor(e,r){this.offset1=e,this.offset2=r}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new t(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};Ak.OffsetPair=Tie;var M5r=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};Ak.InfiniteTimeout=M5r;var O5r=class{static{a(this,"DateTimeout")}constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new j7i.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime!0,this.valid=!0}};Ak.DateTimeout=O5r});var wbt=I(Iie=>{"use strict";p();Object.defineProperty(Iie,"__esModule",{value:!0});Iie.LineRangeFragment=Iie.Array2D=void 0;Iie.isSpace=LCc;var L5r=class{static{a(this,"Array2D")}constructor(e,r){this.width=e,this.height=r,this.array=[],this.array=new Array(e*r)}get(e,r){return this.array[e+r*this.width]}set(e,r,n){this.array[e+r*this.width]=n}};Iie.Array2D=L5r;function LCc(t){return t===32||t===9}a(LCc,"isSpace");var B5r=class t{static{a(this,"LineRangeFragment")}static{this.chrKeys=new Map}static getKey(e){let r=this.chrKeys.get(e);return r===void 0&&(r=this.chrKeys.size,this.chrKeys.set(e,r)),r}constructor(e,r,n){this.range=e,this.lines=r,this.source=n,this.histogram=[];let o=0;for(let s=e.startLineNumber-1;s{"use strict";p();Object.defineProperty(Rbt,"__esModule",{value:!0});Rbt.DynamicProgrammingDiffing=void 0;var H7i=Td(),D3e=Q_e(),F5r=wbt(),U5r=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=D3e.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return D3e.DiffAlgorithmResult.trivial(e,r);let s=new F5r.Array2D(e.length,r.length),c=new F5r.Array2D(e.length,r.length),l=new F5r.Array2D(e.length,r.length);for(let A=0;A0&&y>0&&c.get(A-1,y-1)===3&&(v+=l.get(A-1,y-1)),v+=o?o(A,y):1):v=-1;let S=Math.max(_,E,v);if(S===v){let T=A>0&&y>0?l.get(A-1,y-1):0;l.set(A,y,T+1),c.set(A,y,3)}else S===_?(l.set(A,y,0),c.set(A,y,1)):S===E&&(l.set(A,y,0),c.set(A,y,2));s.set(A,y,S)}let u=[],d=e.length,f=r.length;function h(A,y){(A+1!==d||y+1!==f)&&u.push(new D3e.SequenceDiff(new H7i.OffsetRange(A+1,d),new H7i.OffsetRange(y+1,f))),d=A,f=y}a(h,"reportDecreasingAligningPositions");let m=e.length-1,g=r.length-1;for(;m>=0&&g>=0;)c.get(m,g)===3?(h(m,g),m--,g--):c.get(m,g)===1?m--:g--;return h(-1,-1),u.reverse(),new D3e.DiffAlgorithmResult(u,!1)}};Rbt.DynamicProgrammingDiffing=U5r});var H5r=I(Pbt=>{"use strict";p();Object.defineProperty(Pbt,"__esModule",{value:!0});Pbt.MyersDiffAlgorithm=void 0;var $7i=Td(),N3e=Q_e(),Q5r=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=N3e.InfiniteTimeout.instance){if(e.length===0||r.length===0)return N3e.DiffAlgorithmResult.trivial(e,r);let o=e,s=r;function c(y,_){for(;yo.length||w>s.length)continue;let R=c(T,w);u.set(f,R);let x=T===v?d.get(f+1):d.get(f-1);if(d.set(f,R!==T?new kbt(x,T,w,R-T):x),u.get(f)===o.length&&u.get(f)-f===s.length)break e}}let h=d.get(f),m=[],g=o.length,A=s.length;for(;;){let y=h?h.x+h.length:0,_=h?h.y+h.length:0;if((y!==g||_!==A)&&m.push(new N3e.SequenceDiff(new $7i.OffsetRange(y,g),new $7i.OffsetRange(_,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new N3e.DiffAlgorithmResult(m,!1)}};Pbt.MyersDiffAlgorithm=Q5r;var kbt=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},q5r=class{static{a(this,"FastInt32Array")}constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,r){if(e<0){if(e=-e-1,e>=this.negativeArr.length){let n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=r}else{if(e>=this.positiveArr.length){let n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=r}}},j5r=class{static{a(this,"FastArrayNegativeIndices")}constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,r){e<0?(e=-e-1,this.negativeArr[e]=r):this.positiveArr[e]=r}}});var V5r=I(Nbt=>{"use strict";p();Object.defineProperty(Nbt,"__esModule",{value:!0});Nbt.LinesSliceCharSequence=void 0;var G5r=dj(),Dbt=Td(),BCc=iv(),V7i=uh(),FCc=wbt(),$5r=class{static{a(this,"LinesSliceCharSequence")}constructor(e,r,n){this.lines=e,this.range=r,this.considerWhitespaceChanges=n,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let o=this.range.startLineNumber;o<=this.range.endLineNumber;o++){let s=e[o-1],c=0;o===this.range.startLineNumber&&this.range.startColumn>1&&(c=this.range.startColumn-1,s=s.substring(c)),this.lineStartOffsets.push(c);let l=0;if(!n){let d=s.trimStart();l=s.length-d.length,s=d.trimEnd()}this.trimmedWsLengthsByLineIdx.push(l);let u=o===this.range.endLineNumber?Math.min(this.range.endColumn-1-c-l,s.length):s.length;for(let d=0;dString.fromCharCode(r)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){let r=Y7i(e>0?this.elements[e-1]:-1),n=Y7i(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new BCc.Position(this.range.startLineNumber+n,1+this.lineStartOffsets[n]+o+(o===0&&r==="left"?0:this.trimmedWsLengthsByLineIdx[n]))}translateRange(e){let r=this.translateOffset(e.start,"right"),n=this.translateOffset(e.endExclusive,"left");return n.isBefore(r)?V7i.Range.fromPositions(n,n):V7i.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!q_e(this.elements[e]))return;let r=e;for(;r>0&&q_e(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!q_e(this.elements[e]))return;let r=e;for(;r>0&&q_e(this.elements[r-1])&&!W7i(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,G5r.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new Dbt.OffsetRange(r,n)}};Nbt.LinesSliceCharSequence=$5r;function q_e(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(q_e,"isWordChar");function W7i(t){return t>=65&&t<=90}a(W7i,"isUpperCase");var UCc={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function z7i(t){return UCc[t]}a(z7i,"getCategoryBoundaryScore");function Y7i(t){return t===10?8:t===13?7:(0,FCc.isSpace)(t)?6:t>=97&&t<=122?0:t>=65&&t<=90?1:t>=48&&t<=57?2:t===-1?3:t===44||t===59?5:4}a(Y7i,"getCategory")});var X7i=I(W5r=>{"use strict";p();Object.defineProperty(W5r,"__esModule",{value:!0});W5r.computeMovedLines=HCc;var QCc=Q_e(),Mbt=xbt(),JL=Ml(),M3e=dj(),qCc=b2(),QS=vD(),K7i=V5r(),Obt=wbt(),jCc=H5r(),J7i=uh();function HCc(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=$Cc(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=VCc(u,n,o,e,r,s);return(0,JL.pushMany)(c,d),c=WCc(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` -`).length>=15&&GCc(h,g=>g.length>=2)>=2}),c=zCc(t,c),c}a(HCc,"computeMovedLines");function GCc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(GCc,"countWhere");function $Cc(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new Obt.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new Obt.LineRangeFragment(u.modified,r,u))),l=new Set;for(let u of s){let d=-1,f;for(let h of c){let m=u.computeSimilarity(h);m>d&&(d=m,f=h)}if(d>.9&&f&&(c.delete(f),o.push(new Mbt.LineRangeMapping(u.range,f.range)),l.add(u.source),l.add(f.source)),!n.isValid())return{moves:o,excludedChanges:l}}return{moves:o,excludedChanges:l}}a($Cc,"computeMovesFromSimpleDeletionsToSimpleInsertions");function VCc(t,e,r,n,o,s){let c=[],l=new qCc.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,JL.numberComparator));for(let m of t){let g=[];for(let A=m.modified.startLineNumber;A{for(let T of g)if(T.originalLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive&&T.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){T.originalLineRange=new QS.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new QS.LineRange(T.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),E.push(T);return}let S={modifiedLineRange:_,originalLineRange:v};u.push(S),E.push(S)}),g=E}if(!s.isValid())return[]}u.sort((0,JL.reverseOrder)((0,JL.compareBy)(m=>m.modifiedLineRange.length,JL.numberComparator)));let d=new QS.LineRangeSet,f=new QS.LineRangeSet;for(let m of u){let g=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,A=d.subtractFrom(m.modifiedLineRange),y=f.subtractFrom(m.originalLineRange).getWithDelta(g),_=A.getIntersection(y);for(let E of _.ranges){if(E.length<3)continue;let v=E,S=E.delta(-g);c.push(new Mbt.LineRangeMapping(S,v)),d.addRange(v),f.addRange(S)}}c.sort((0,JL.compareBy)(m=>m.original.startLineNumber,JL.numberComparator));let h=new M3e.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,M3e.findLastMonotonous)(t,R=>R.modified.startLineNumber<=g.modified.startLineNumber),_=Math.max(g.original.startLineNumber-A.original.startLineNumber,g.modified.startLineNumber-y.modified.startLineNumber),E=h.findLastMonotonous(R=>R.original.startLineNumberR.modified.startLineNumbern.length||x>o.length||d.contains(x)||f.contains(R)||!Z7i(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new QS.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new QS.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!Z7i(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new QS.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new QS.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new Mbt.LineRangeMapping(new QS.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new QS.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(VCc,"computeUnchangedMoves");function Z7i(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new jCc.MyersDiffAlgorithm().compute(new K7i.LinesSliceCharSequence([t],new J7i.Range(1,1,1,t.length),!1),new K7i.LinesSliceCharSequence([e],new J7i.Range(1,1,1,e.length),!1),r),s=0,c=QCc.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,Obt.isSpace)(t.charCodeAt(h))||s++});function l(f){let h=0;for(let m=0;me.length?t:e);return s/u>.6&&u>10}a(Z7i,"areLinesSimilar");function WCc(t){if(t.length===0)return t;t.sort((0,JL.compareBy)(r=>r.original.startLineNumber,JL.numberComparator));let e=[t[0]];for(let r=1;r=0&&c>=0&&s+c<=2){e[e.length-1]=n.join(o);continue}e.push(o)}return e}a(WCc,"joinCloseConsecutiveMoves");function zCc(t,e){let r=new M3e.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(xie,"__esModule",{value:!0});xie.optimizeSequenceDiffs=KCc;xie.removeShortMatches=ZCc;xie.extendDiffsToEntireWordIfAppropriate=XCc;xie.removeVeryShortMatchingLinesBetweenDiffs=tbc;xie.removeVeryShortMatchingTextBetweenLongDiffs=rbc;var YCc=Ml(),ZL=Td(),XL=Q_e();function KCc(t,e,r){let n=r;return n=eQi(t,e,n),n=eQi(t,e,n),n=JCc(t,e,n),n}a(KCc,"optimizeSequenceDiffs");function eQi(t,e,r){if(r.length===0)return r;let n=[];n.push(r[0]);for(let s=1;s0&&(l=l.delta(d))}o.push(l)}return n.length>0&&o.push(n[n.length-1]),o}a(eQi,"joinSequenceDiffsByShifting");function JCc(t,e,r){if(!t.getBoundaryScore||!e.getBoundaryScore)return r;for(let n=0;n0?r[n-1]:void 0,s=r[n],c=n+1=n.start&&t.seq2Range.start-c>=o.start&&r.isStronglyEqual(t.seq2Range.start-c,t.seq2Range.endExclusive-c)&&c<100;)c++;c--;let l=0;for(;t.seq1Range.start+ld&&(d=A,u=f)}return t.delta(u)}a(tQi,"shiftDiffToBetterPosition");function ZCc(t,e,r){let n=[];for(let o of r){let s=n[n.length-1];if(!s){n.push(o);continue}o.seq1Range.start-s.seq1Range.endExclusive<=2||o.seq2Range.start-s.seq2Range.endExclusive<=2?n[n.length-1]=new XL.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(ZCc,"removeShortMatches");function XCc(t,e,r,n,o=!1){let s=XL.SequenceDiff.invert(r,t.length),c=[],l=new XL.OffsetPair(0,0);function u(f,h){if(f.offset10;){let v=s[0];if(!(v.seq1Range.intersects(A.seq1Range)||v.seq2Range.intersects(A.seq2Range)))break;let T=n(t,v.seq1Range.start),w=n(e,v.seq2Range.start),R=new XL.SequenceDiff(T,w),x=R.intersect(v);if(_+=x.seq1Range.length,E+=x.seq2Range.length,A=A.join(R),A.seq1Range.endExclusive>=v.seq1Range.endExclusive)s.shift();else break}(o&&_+E0;){let f=s.shift();f.seq1Range.isEmpty||(u(f.getStarts(),f),u(f.getEndExclusives().delta(-1),f))}return ebc(r,c)}a(XCc,"extendDiffsToEntireWordIfAppropriate");function ebc(t,e){let r=[];for(;t.length>0||e.length>0;){let n=t[0],o=e[0],s;n&&(!o||n.seq1Range.start0&&r[r.length-1].seq1Range.endExclusive>=s.seq1Range.start?r[r.length-1]=r[r.length-1].join(s):r.push(s)}return r}a(ebc,"mergeSequenceDiffs");function tbc(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let c=[n[0]];for(let l=1;l5||g.seq1Range.length+g.seq2Range.length>5)};a(f,"shouldJoinDiffs");let u=n[l],d=c[c.length-1];f(d,u)?(s=!0,c[c.length-1]=c[c.length-1].join(u)):c.push(u)}n=c}while(o++<10&&s);return n}a(tbc,"removeVeryShortMatchingLinesBetweenDiffs");function rbc(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let l=[n[0]];for(let u=1;u5||y.length>500)return!1;let E=t.getText(y).trim();if(E.length>20||E.split(/\r\n|\r|\n/).length>1)return!1;let v=t.countLinesIn(g.seq1Range),S=g.seq1Range.length,T=e.countLinesIn(g.seq2Range),w=g.seq2Range.length,R=t.countLinesIn(A.seq1Range),x=A.seq1Range.length,k=e.countLinesIn(A.seq2Range),D=A.seq2Range.length,N=130;function O(B){return Math.min(B,N)}return a(O,"cap"),Math.pow(Math.pow(O(v*40+S),1.5)+Math.pow(O(T*40+w),1.5),1.5)+Math.pow(Math.pow(O(R*40+x),1.5)+Math.pow(O(k*40+D),1.5),1.5)>(N**1.5)**1.5*1.3};a(h,"shouldJoinDiffs");let d=n[u],f=l[l.length-1];h(f,d)?(s=!0,l[l.length-1]=l[l.length-1].join(d)):l.push(d)}n=l}while(o++<10&&s);let c=[];return(0,YCc.forEachWithNeighbors)(n,(l,u,d)=>{let f=u;function h(E){return E.length>0&&E.trim().length<=3&&u.seq1Range.length+u.seq2Range.length>100}a(h,"shouldMarkAsChanged");let m=t.extendToFullLines(u.seq1Range),g=t.getText(new ZL.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new ZL.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=XL.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():XL.OffsetPair.zero,d?d.getStarts():XL.OffsetPair.max),_=f.intersect(y);c.length>0&&_.getStarts().equals(c[c.length-1].getEndExclusives())?c[c.length-1]=c[c.length-1].join(_):c.push(_)}),c}a(rbc,"removeVeryShortMatchingTextBetweenLongDiffs")});var iQi=I(Lbt=>{"use strict";p();Object.defineProperty(Lbt,"__esModule",{value:!0});Lbt.LineSequence=void 0;var z5r=class{static{a(this,"LineSequence")}constructor(e,r){this.trimmedHash=e,this.lines=r}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){let r=e===0?0:nQi(this.lines[e-1]),n=e===this.lines.length?0:nQi(this.lines[e]);return 1e3-(r+n)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` -`)}isStronglyEqual(e,r){return this.lines[e]===this.lines[r]}};Lbt.LineSequence=z5r;function nQi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(Qbt,"__esModule",{value:!0});Qbt.DefaultLinesDiffComputer=void 0;var nbc=Ml(),oQi=pd(),Ubt=vD(),sQi=Td(),aQi=uh(),Bbt=dI(),Fbt=D5r(),Rie=xbt(),eB=Q_e(),ibc=G7i(),obc=H5r(),sbc=X7i(),wie=rQi(),cQi=iQi(),lQi=V5r(),Y5r=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new ibc.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new obc.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,nbc.equals)(e,r,(x,k)=>x===k))return new Fbt.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new Fbt.LinesDiff([new Rie.DetailedLineRangeMapping(new Ubt.LineRange(1,e.length+1),new Ubt.LineRange(1,r.length+1),[new Rie.RangeMapping(new aQi.Range(1,1,e.length,e[e.length-1].length+1),new aQi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?eB.InfiniteTimeout.instance:new eB.DateTimeout(n.maxComputationTimeMs),s=!n.ignoreTrimWhitespace,c=new Map;function l(x){let k=c.get(x);return k===void 0&&(k=c.size,c.set(x,k)),k}a(l,"getOrCreateHash");let u=e.map(x=>l(x.trim())),d=r.map(x=>l(x.trim())),f=new cQi.LineSequence(u,e),h=new cQi.LineSequence(d,r),m=f.length+h.length<1700?this.dynamicProgrammingDiffing.compute(f,h,o,(x,k)=>e[x]===r[k]?r[k].length===0?.1:1+Math.log(1+r[k].length):.99):this.myersDiffingAlgorithm.compute(f,h,o),g=m.diffs,A=m.hitTimeout;g=(0,wie.optimizeSequenceDiffs)(f,h,g),g=(0,wie.removeVeryShortMatchingLinesBetweenDiffs)(f,h,g);let y=[],_=a(x=>{if(s)for(let k=0;kx.seq1Range.start-E===x.seq2Range.start-v);let k=x.seq1Range.start-E;_(k),E=x.seq1Range.endExclusive,v=x.seq2Range.endExclusive;let D=this.refineDiff(e,r,x,o,s,n);D.hitTimeout&&(A=!0);for(let N of D.mappings)y.push(N)}_(e.length-E);let S=new Bbt.ArrayText(e),T=new Bbt.ArrayText(r),w=(0,Rie.lineRangeMappingFromRangeMappings)(y,S,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,oQi.assertFn)(()=>{function x(D,N){if(D.lineNumber<1||D.lineNumber>N.length)return!1;let O=N[D.lineNumber-1];return!(D.column<1||D.column>O.length+1)}a(x,"validatePosition");function k(D,N){return!(D.startLineNumber<1||D.startLineNumber>N.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>N.length+1)}a(k,"validateRange");for(let D of w){if(!D.innerChanges)return!1;for(let N of D.innerChanges)if(!(x(N.modifiedRange.getStartPosition(),r)&&x(N.modifiedRange.getEndPosition(),r)&&x(N.originalRange.getStartPosition(),e)&&x(N.originalRange.getEndPosition(),e)))return!1;if(!k(D.modified,r)||!k(D.original,e))return!1}return!0}),new Fbt.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,sbc.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new eB.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,Rie.lineRangeMappingFromRangeMappings)(m.mappings,new Bbt.ArrayText(r),new Bbt.ArrayText(n),!0);return new Fbt.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=abc(n).toRangeMapping2(e,r),d=new lQi.LinesSliceCharSequence(e,u.originalRange,s),f=new lQi.LinesSliceCharSequence(r,u.modifiedRange,s),h=d.length+f.length<500?this.dynamicProgrammingDiffing.compute(d,f,o):this.myersDiffingAlgorithm.compute(d,f,o),m=!1,g=h.diffs;m&&eB.SequenceDiff.assertSorted(g),g=(0,wie.optimizeSequenceDiffs)(d,f,g),m&&eB.SequenceDiff.assertSorted(g),g=(0,wie.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,_)=>y.findWordContaining(_)),m&&eB.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,wie.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,_)=>y.findSubWordContaining(_),!0),m&&eB.SequenceDiff.assertSorted(g)),g=(0,wie.removeShortMatches)(d,f,g),m&&eB.SequenceDiff.assertSorted(g),g=(0,wie.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&eB.SequenceDiff.assertSorted(g);let A=g.map(y=>new Rie.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&Rie.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};Qbt.DefaultLinesDiffComputer=Y5r;function abc(t){return new Rie.LineRangeMapping(new Ubt.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new Ubt.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(abc,"toLineRangeMapping")});var K5r=I(iC=>{"use strict";p();Object.defineProperty(iC,"__esModule",{value:!0});iC.EditDataWithIndex=iC.maxImperfectAgreementLength=iC.maxAgreementOffset=void 0;iC.tryRebase=fbc;iC.checkEditConsistency=dQi;iC.tryRebaseStringEdits=hbc;var cbc=ON(),lbc=gv(),fE=W_(),j_e=Td(),uQi=dI(),ubc=qbt(),dbc=!1;iC.maxAgreementOffset=10;iC.maxImperfectAgreementLength=5;var jbt=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};iC.EditDataWithIndex=jbt;function fbc(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:iC.maxImperfectAgreementLength}){let f=Date.now();try{return pbc(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${lbc.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(fbc,"tryRebase");function pbc(t,e,r,n,o,s,c,l,u,d){if(!dQi(t,o,s,u,!0))return"inconsistentEdits";let f=o.removeCommonSuffixAndPrefix(t),h=c[0];if(e&&h&&!f.applyToOffsetRangeOrUndefined(e)?.containsRange(h))return"outsideEditWindow";if(n.lengthfE.AnnotatedStringEdit.create(_))),g=fQi(t,m,f,l,d);if(!g)return"rebaseFailed";let A=g.replacements.reduce((_,E)=>((_[E.data.index]||=[]).push(E),_),[]),y=[];for(let _=0;_R>0?s.substring(x[R-1].replaceRange.endExclusive,w.replaceRange.start)+w.newText:w.newText).join(""),T=fE.StringReplacement.replace(v,S);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:_})}return l==="strict"&&y.length>0&&new cbc.SingleEdits(r).apply(t)!==fE.StringEdit.create(y.map(_=>_.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(pbc,"_tryRebase");function dQi(t,e,r,n,o=dbc){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(dQi,"checkEditConsistency");function hbc(t,e,r,n,o={maxImperfectAgreementLength:iC.maxImperfectAgreementLength}){return fQi(t,e.mapData(s=>new fE.VoidEditData),r,n,o)?.toStringEdit()}a(hbc,"tryRebaseStringEdits");function fQi(t,e,r,n,o){let s=r.removeCommonSuffixAndPrefix(t),c=[],l=0,u=0,d=0;for(;uf.replaceRange.start){let g=t.substring(f.replaceRange.start,m.replaceRange.start),A=g+m.newText;A.endsWith(g)&&(m=new fE.AnnotatedStringReplacement(j_e.OffsetRange.fromTo(f.replaceRange.start,m.replaceRange.endExclusive-g.length),A.substring(0,A.length-g.length),m.data))}else if(u===e.replacements.length-1&&m.replaceRange.endExclusive=f.newText.length){let g=0,A=0,y=f,_;for(;y&&m.replaceRange.containsRange(y.replaceRange);){if(A=ybc(t,m,y,_,A,n,o),A===-1)return;g+=y.newText.length-y.replaceRange.length,_=y,y=s.replacements[++l]}c.push(new fE.AnnotatedStringReplacement(new j_e.OffsetRange(m.replaceRange.start+d,m.replaceRange.endExclusive+d+g),m.newText,m.data)),u++,d+=g}else if(o.reverseAgreement&&h.replaceRange.equals(f.replaceRange)){let g=0,A;for(;uiC.maxAgreementOffset||S-g>0&&v.length>o.maxImperfectAgreementLength);if(S!==-1&&!T){g=S+v.length,A=y,u++;continue}let w=f.newText.substring(g);if(w.length>0&&v.startsWith(w)){let R=Math.max(0,w.length-E.length),x=y.newText.substring(R);x.length>0&&c.push(new fE.AnnotatedStringReplacement(j_e.OffsetRange.emptyAt(f.replaceRange.start+d+f.newText.length),x,y.data)),g=f.newText.length,A=y,u++;break}return}if(g0&&!f.newText.substring(g).startsWith(_))return}l++,d+=f.newText.length-f.replaceRange.length}else return;else if(h.replaceRange.start",'""',"''","``"]);function Abc(t){return gbc.has(t)}a(Abc,"isAutoClosePair");function ybc(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uiC.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&Abc(l)&&mbc(l,e.newText.substring(o))?o:-1}a(ybc,"agreementIndexOf");function _bc(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new ubc.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new uQi.StringText(t),f=new uQi.StringText(e);return u.changes.map(h=>(h.innerChanges||[]).map(m=>{let g=d.getTransformer().getOffsetRange(m.originalRange),A=f.getValueOfRange(m.modifiedRange);return new fE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(_bc,"computeDiff")});var hQi=I(Hbt=>{"use strict";p();Object.defineProperty(Hbt,"__esModule",{value:!0});Hbt.RejectionCollector=void 0;var Ebc=W4(),pQi=Po(),vbc=bD(),J5r=class extends pQi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new e4r(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,vbc.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new Z5r(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,Ebc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},c=>{for(let l of c.value.changes)s.handleEdit(l,c.value.value)})),o.add((0,pQi.toDisposable)(()=>{this._documentCaches.delete(n.id)}))}).recomputeInitiallyAndOnChange(this._store)}reject(e,r){let n=this._documentCaches.get(e);if(!n){this._logger.trace(`Rejecting, no document cache: ${r}`);return}let o=r.removeCommonSuffixAndPrefix(n.doc.value.get().value);this._logger.trace(`Rejecting: ${o}`),n.reject(o)}isRejected(e,r){let n=this._documentCaches.get(e);if(!n)return this._logger.trace(`Checking rejection, no document cache: ${r}`),!1;let o=r.removeCommonSuffixAndPrefix(n.doc.value.get().value),s=n.isRejected(o);return this._logger.trace(`Checking rejection, ${s?"rejected":"not rejected"}: ${o}`),s}clear(){this._garbageCollector.clear()}};Hbt.RejectionCollector=J5r;var Z5r=class{static{a(this,"DocumentRejectionTracker")}constructor(e,r,n){this.doc=e,this._garbageCollector=r,this._logger=n,this._rejectedEdits=new Set}handleEdit(e,r){for(let n of[...this._rejectedEdits])n.handleEdit(e,r)}reject(e){if(this.isRejected(e))return;let r=new X5r(e.toEdit(),()=>{this._logger.trace(`Evicting: ${e}`),this._rejectedEdits.delete(r)});this._rejectedEdits.add(r),this._garbageCollector.put(r)}isRejected(e){for(let r of this._rejectedEdits)if(r.isRejected(e))return!0;return!1}},X5r=class{static{a(this,"RejectedEdit")}constructor(e,r){this._edit=e,this._onDispose=r}handleEdit(e,r){let n=this._edit.tryRebase(e);n?this._edit=n.removeCommonSuffixAndPrefix(r.value):this.dispose()}isRejected(e){return this._edit.equals(e.toEdit())}dispose(){this._onDispose()}},e4r=class{static{a(this,"LRUGarbageCollector")}constructor(e){this._maxSize=e,this._disposables=[]}put(e){this._disposables.push(e),this._disposables.length>this._maxSize&&this._disposables.shift().dispose()}clear(){for(let e of this._disposables)e.dispose();this._disposables=[]}dispose(){this.clear()}}});var mQi=I($bt=>{"use strict";p();Object.defineProperty($bt,"__esModule",{value:!0});$bt.RebaseFailureInfo=void 0;var Cbc=W_(),t4r=class{static{a(this,"RebaseFailureInfo")}constructor(e,r,n,o,s,c,l){this.originalDocument=e,this.editWindow=r,this.originalEdits=n,this.userEditSince=o,this.currentDocument=s,this.currentSelection=c,this.nesRebaseConfigs=l}toMarkdown(){let e=[];e.push("### Original Document"),e.push("```"),e.push(this.originalDocument),e.push("```"),e.push(""),e.push("### Suggested Edits");for(let r=0;r0&&(e.push(""),e.push(`### Cursor: ${this.currentSelection.map(r=>r.toString()).join(", ")}`)),e.push(""),e.push("### Document Intended After Suggested Edits"),e.push("```");try{let r=new Cbc.StringEdit(this.originalEdits.slice()).apply(this.originalDocument);e.push(r)}catch{e.push("")}return e.push("```"),e.push(""),e.push("### Copy-Pasteable Test"),e.push("```typescript"),e.push(this._generateTest()),e.push("```"),e.join(` -`)}_generateTest(){let e=[];e.push("test('rebase failure (auto-generated)', () => {"),e.push(` const originalDocument = ${Gbt(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${Gbt(o.newText)}),`);e.push(" ];"),e.push(" const userEditSince = StringEdit.create([");for(let o of this.userEditSince.replacements)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${Gbt(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${Gbt(this.currentDocument)};`),this.editWindow?e.push(` const editWindow = new OffsetRange(${this.editWindow.start}, ${this.editWindow.endExclusive});`):e.push(" const editWindow = undefined;"),e.push(` const currentSelection = [${this.currentSelection.map(o=>`new OffsetRange(${o.start}, ${o.endExclusive})`).join(", ")}];`);let r=[];return this.nesRebaseConfigs.absorbSubsequenceTyping&&r.push(`absorbSubsequenceTyping: ${this.nesRebaseConfigs.absorbSubsequenceTyping}`),this.nesRebaseConfigs.reverseAgreement&&r.push(`reverseAgreement: ${this.nesRebaseConfigs.reverseAgreement}`),r.push(`maxImperfectAgreementLength: ${this.nesRebaseConfigs.maxImperfectAgreementLength}`),e.push(` const nesConfigs = { ${r.join(", ")} };`),e.push(""),e.push(" const logger = new TestLogService();"),e.push(" expect(userEditSince.apply(originalDocument)).toBe(currentDocumentContent);"),e.push(" expect(tryRebase(originalDocument, editWindow, originalEdits, [], userEditSince, currentDocumentContent, currentSelection, 'strict', logger, nesConfigs)).toMatchInlineSnapshot();"),e.push("});"),e.join(` -`)}};$bt.RebaseFailureInfo=t4r;function Gbt(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a(Gbt,"toBacktickLiteral")});var AQi=I(Wbt=>{"use strict";p();Object.defineProperty(Wbt,"__esModule",{value:!0});Wbt.NextEditCache=void 0;var O3e=Hl(),bbc=W4(),Sbc=XEt(),gQi=Po(),Tbc=o6(),Vbt=K5r(),Ibc=mQi(),r4r=class extends gQi.Disposable{static{a(this,"NextEditCache")}constructor(e,r,n,o){super(),this.workspace=e,this._logService=r,this._configService=n,this._expService=o,this._documentCaches=new Map,this._sharedCache=new Sbc.LRUCache(50),(0,Tbc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new n4r(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,bbc.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(O3e.ConfigKey.Advanced.InlineEditsTriggerOnEditorChangeAfterSeconds,this._expService)!==void 0)for(let[d,f]of this._sharedCache.entries())f.docId!==s.id&&this._sharedCache.deleteKey(d)})),c.add((0,gQi.toDisposable)(()=>{this._documentCaches.delete(s.id)}))}).recomputeInitiallyAndOnChange(this._store)}setKthNextEdit(e,r,n,o,s,c,l,u,d){let f=this._documentCaches.get(e);if(f)return f.setKthNextEdit(r,n,o,c,l,s,u,d)}setNoNextEdit(e,r,n,o,s){let c=this._documentCaches.get(e);c&&c.setNoNextEdit(r,n,o,s)}_getNesRebaseConfigs(){let e=this._configService.getExperimentBasedConfig(O3e.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(O3e.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(O3e.ConfigKey.TeamInternal.InlineEditsReverseAgreement,this._expService),maxImperfectAgreementLength:typeof e=="number"?Math.max(0,e):e}}lookupNextEdit(e,r,n){let o=this._documentCaches.get(e);if(!o)return;let s=this._configService.getExperimentBasedConfig(O3e.ConfigKey.TeamInternal.InlineEditsCacheCursorDistanceCheck,this._expService)??!1;return o.lookupNextEdit(r,n,this._getNesRebaseConfigs(),s)}tryRebaseCacheEntry(e,r,n){let o=this._documentCaches.get(e.docId);return o?o.tryRebaseCacheEntry(e,r,n,this._getNesRebaseConfigs()):{edit:void 0}}rejectedNextEdit(e){this._sharedCache.getValues().filter(r=>r.source.headerRequestId===e).forEach(r=>r.rejected=!0)}isRejectedNextEdit(e,r,n){let o=this._documentCaches.get(e);return o?o.isRejectedNextEdit(r,n):!1}evictedCachedEdit(e){let r=this._documentCaches.get(e.docId);r&&r.evictedCachedEdit(e)}clear(){this._documentCaches.forEach(e=>e.clear()),this._sharedCache.clear()}};Wbt.NextEditCache=r4r;var n4r=class{static{a(this,"DocumentEditCache")}constructor(e,r,n,o,s){this._nextEditCache=e,this.docId=r,this._doc=n,this._sharedCache=o,this._trackedCachedEdits=[],this._logger=s.createSubLogger(["NES","DocumentEditCache"])}handleEdit(e){let r=this._logger.createSubLogger("handleEdit");for(let n of this._trackedCachedEdits)n.userEditSince&&(n.userEditSince=n.userEditSince.compose(e),n.rebaseFailed=!1,(0,Vbt.checkEditConsistency)(n.documentBeforeEdit.value,n.userEditSince,this._doc.value.get().value,r)||(n.userEditSince=void 0))}evictedCachedEdit(e){let r=this._trackedCachedEdits.indexOf(e);r!==-1&&this._trackedCachedEdits.splice(r,1)}clear(){this._trackedCachedEdits.length=0}setKthNextEdit(e,r,n,o,s,c,l,u){let d=this._getKey(e.value),f={docId:this.docId,targetDocId:u.targetDocId,targetDocumentBeforeEdit:u.targetDocumentBeforeEdit,edit:n,edits:o,detailedEdits:[],userEditSince:s,subsequentN:c,patchIndex:u.patchIndex,patchIndices:u.patchIndices,modelTelemetry:u.modelTelemetry,source:l,documentBeforeEdit:e,editWindow:r,originalEditWindow:u.originalEditWindow,cacheTime:Date.now(),isFromCursorJump:u.isFromCursorJump,cursorOffsetAtCacheTime:u.cursorOffset};s&&((0,Vbt.checkEditConsistency)(f.documentBeforeEdit.value,s,this._doc.value.get().value,this._logger.createSubLogger("setKthNextEdit"))?this._trackedCachedEdits.unshift(f):f.userEditSince=void 0);let h=this._sharedCache.get(d);h&&this.evictedCachedEdit(h);let m=this._sharedCache.put(d,f);return m&&this._nextEditCache.evictedCachedEdit(m[1]),f}setNoNextEdit(e,r,n,o){let s=this._getKey(e.value),c={docId:this.docId,edit:void 0,edits:[],detailedEdits:[],modelTelemetry:o,source:n,documentBeforeEdit:e,editWindow:r,cacheTime:Date.now(),isFromCursorJump:!1},l=this._sharedCache.get(s);l&&this.evictedCachedEdit(l);let u=this._sharedCache.put(s,c);u&&this._nextEditCache.evictedCachedEdit(u[1])}lookupNextEdit(e,r,n,o=!1){let s=this._getKey(e.value),c=this._sharedCache.get(s);if(c){let l=c.editWindow,u=c.originalEditWindow,d=r[0],f=l?.containsRange(d),h=u?.containsRange(d);if(l&&!f&&!h)return;if(o&&!c.targetDocId&&c.edit&&(c.subsequentN===void 0||c.subsequentN===0)&&c.cursorOffsetAtCacheTime!==void 0&&d){let m=e.getTransformer(),g=m.getPosition(c.edit.replaceRange.start).lineNumber,A=m.getPosition(c.cursorOffsetAtCacheTime).lineNumber,y=m.getPosition(d.start).lineNumber;if(Math.abs(y-g)>Math.abs(A-g))return c.rejected=!0,c}return c}for(let l of this._trackedCachedEdits){let u=this.tryRebaseCacheEntry(l,e,r,n);if(u.edit)return u.edit}}tryRebaseCacheEntry(e,r,n,o){let s=this._logger.createSubLogger("tryRebaseCacheEntry");if(e.userEditSince&&!e.rebaseFailed){let c=e.edits||(e.edit?[e.edit]:[]),l=e.originalEditWindow?[e.editWindow,e.originalEditWindow]:[e.editWindow];for(let u of l){let d=(0,Vbt.tryRebase)(e.documentBeforeEdit.value,u,c,e.detailedEdits,e.userEditSince,r.value,n,"strict",s,o);if(d==="rebaseFailed")return e.rebaseFailed=!0,{edit:void 0,failureInfo:new Ibc.RebaseFailureInfo(e.documentBeforeEdit.value,u,c,e.userEditSince,r.value,n,o)};if(d==="inconsistentEdits"||d==="error")return e.userEditSince=void 0,{edit:void 0};if(d==="outsideEditWindow")continue;if(d.length)return!e.rejected&&this.isRejectedNextEdit(r,d[0].rebasedEdit)&&(e.rejected=!0),{edit:{...e,...d[0],baseCacheEntry:e}};if(!c.length)return{edit:e}}}return{edit:void 0}}isRejectedNextEdit(e,r){let n=this._logger.createSubLogger("isRejectedNextEdit"),o=r.removeCommonSuffixAndPrefix(e.value);for(let s of this._trackedCachedEdits.filter(c=>c.rejected)){if(!s.userEditSince)continue;let c=s.edits||(s.edit?[s.edit]:[]);if(!c.length)continue;let l=(0,Vbt.tryRebase)(s.documentBeforeEdit.value,void 0,c,s.detailedEdits,s.userEditSince,e.value,[],"lenient",n);if(typeof l=="string")continue;if(l.some(d=>d.rebasedEdit.removeCommonSuffixAndPrefix(e.value).equals(o)))return n.trace("Found rejected edit that matches current edit"),!0}return!1}_getKey(e){return JSON.stringify([this.docId.uri,e])}}});var yQi=I(zbt=>{"use strict";p();Object.defineProperty(zbt,"__esModule",{value:!0});zbt.NextEditResult=void 0;var i4r=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};zbt.NextEditResult=i4r});var _Qi=I(Ybt=>{"use strict";p();Object.defineProperty(Ybt,"__esModule",{value:!0});Ybt.SpeculativeRequestManager=void 0;var xbc=Po(),o4r=class extends xbc.Disposable{static{a(this,"SpeculativeRequestManager")}constructor(e){super(),this._logger=e,this._pending=null,this._scheduled=null}get pending(){return this._pending}setPending(e){this._pending&&this._pending.request!==e.request&&this._cancelPending("replaced"),this._pending=e}consumePending(){this._pending=null}schedule(e){this._scheduled=e}clearScheduled(){this._scheduled=null}consumeScheduled(e){if(this._scheduled?.headerRequestId!==e)return null;let r=this._scheduled;return this._scheduled=null,r}cancelAll(e){this._scheduled=null,this._cancelPending(e)}cancelIfMismatch(e,r,n){this._pending&&(this._pending.docId!==e||this._pending.postEditContent!==r)&&this._cancelPending(n)}onDocumentClosed(e){this._scheduled?.suggestion.result?.targetDocumentId===e&&(this._scheduled=null),this._pending?.docId===e&&this._cancelPending("documentClosed")}onActiveDocumentChanged(e,r){let n=this._pending;if(!n||n.docId!==e)return;if(r.length{"use strict";p();var wbc=MI&&MI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},L3e=MI&&MI.__param||function(t,e){return function(r,n){e(r,n,t)}},a4r;Object.defineProperty(MI,"__esModule",{value:!0});MI.NextEditFetchRequest=MI.NextEditProvider=MI.NesOutcome=void 0;var Rbc=require("path"),qS=Hl(),H_e=ON(),U3e=_bt(),B3e=wy(),kbc=_mt(),Bp=R_e(),Pbc=W4(),c4r=Np(),Dbc=P7i(),Nbc=O_e(),Mbc=R5r(),Obc=Rh(),F3e=gv(),pE=xT(),EQi=pd(),Kbt=pl(),Lbc=qXe(),d4r=Os(),Jbt=Po(),vQi=bD(),CQi=E5(),Bbc=CT(),IQi=Og(),Fbc=k$(),kie=W_(),Ubc=iv(),l4r=Td(),bQi=dI(),Qbc=K5r(),qbc=hQi(),jbc=AQi(),Zbt=yQi(),Hbc=_Qi();function Gbc(t,e,r){if(!e)return t;let n=e.endExclusive,o=r.getTransformer(),s=o.getPosition(n),c=o.getOffset(s.with(void 0,1)),l=o.getOffset(s.with(void 0,o.getLineLength(s.lineNumber)+1)),u=o.getOffset(o.getPosition(t.start).delta(1)),d=o.getPosition(t.endExclusive).delta(-2),f=o.getOffset(d.column>1?d.with(void 0,o.getLineLength(d.lineNumber)+1):d);return new l4r.OffsetRange(Math.min(u,c),Math.max(f,l))}a(Gbc,"computeReducedWindow");function $bc(t,e){let n=new U3e.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r -`)?new kie.StringEdit(n.replacements.map(o=>new kie.StringReplacement(o.replaceRange,o.newText.replace(/\n/g,`\r -`)))):n}a($bc,"convertLineEditToEdit");function s4r(t){return{modelName:t.modelName,modelConfig:t.modelConfig}}a(s4r,"getModelTelemetry");function SQi(t,e){return new Lbc.CachedFunction(n=>{let o=t.find(s=>s.nextEditDoc.id===n);if(!o){for(let s=e.length-1;s>=0;s--){let c=e[s];if(c.docId===n&&c.kind==="edit"){let l=c.edit.getEditedState();return{baseDocState:l,docContents:l,editsSoFar:kie.StringEdit.empty,nextEdits:[],patchIndices:[],docId:n}}}throw new d4r.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:kie.StringEdit.empty,nextEdits:[],patchIndices:[],docId:n}})}a(SQi,"createDocStateLookupMap");function TQi(t){return t.rebasedEditIndex!==void 0?t.patchIndices?.[t.rebasedEditIndex]:t.patchIndex}a(TQi,"getSourcePatchIndex");var Q3e;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(Q3e||(MI.NesOutcome=Q3e={}));var u4r=a4r=class extends Jbt.Disposable{static{a(this,"NextEditProvider")}get lastRejectionTime(){return this._lastRejectionTime}get lastTriggerTime(){return this._lastTriggerTime}get lastOutcome(){return this._lastOutcome}constructor(e,r,n,o,s,c,l,u,d,f){super(),this._workspace=e,this._statelessNextEditProvider=r,this._historyContextProvider=n,this._xtabHistoryTracker=o,this._debugRecorder=s,this._configService=c,this._snippyService=l,this._logService=u,this._expService=d,this._requestLogger=f,this.ID=this._statelessNextEditProvider.ID,this._rejectionCollector=this._register(new qbc.RejectionCollector(this._workspace,this._logService)),this._pendingStatelessNextEditRequest=null,this._lastShownTime=0,this._lastShownSuggestionId=void 0,this._lastRejectionTime=0,this._lastTriggerTime=0,this._shouldExpandEditWindow=!1,this._logger=this._logService.createSubLogger(["NES","NextEditProvider"]),this._nextEditCache=new jbc.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new Hbc.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,vQi.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,vQi.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,Jbt.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService)||this._pendingStatelessNextEditRequest===null)return;let o=this._pendingStatelessNextEditRequest.getActiveDocument();o.id===e&&o.documentAfterEdits.value!==r.value&&this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel()}async getNextEdit(e,r,n,o,s){let c=Date.now();this._lastTriggerTime=c;let l=new CQi.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(c4r.LogTarget.fromCallback((h,m)=>{n.trace(`[${Math.floor(l.elapsed()).toString().padStart(4," ")}ms] ${m}`)})),d=this._shouldExpandEditWindow;n.setStatelessNextEditProviderId(this._statelessNextEditProvider.ID);let f;try{f=await this._getNextEditCanThrow(e,r,c,d,u,n,o,s)}catch(h){throw n.setError(h),s.setNextEditProviderError(F3e.ErrorUtils.toString(h)),h}finally{s.markEndTime()}return this._lastNextEditResult=f,f}async _getNextEditCanThrow(e,r,n,o,s,c,l,u){let d=s.createSubLogger("_getNextEdit");d.trace(`invoked with trigger id = ${r.changeHint===void 0?"undefined":`uuid = ${r.changeHint.data.uuid}, reason = ${r.changeHint.data.reason}`}`);let f=this._workspace.getDocument(e);if(!f)throw d.trace(`Document "${e.baseName}" not found`),new d4r.BugIndicatingError(`Document "${e.baseName}" not found`);let h=f.value.get(),m=f.selection.get(),g=this.determineNesConfigs(u,c),A=this._nextEditCache.lookupNextEdit(e,h,m);if(A?.rejected){d.trace("cached edit was previously rejected"),u.setStatus("previouslyRejectedCache"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected();let O=A.rebasedEdit??A.edit;return O&&this._rejectionCollector.reject(e,O),new Zbt.NextEditResult(c.requestId,A.source,void 0)}if(A&&A.targetDocId&&A.targetDocId!==e){let O=this._workspace.getDocument(A.targetDocId);O&&A.targetDocumentBeforeEdit&&O.value.get().value===A.targetDocumentBeforeEdit.value||(d.trace(`cross-file cached edit unusable (target ${O?"changed":"not open"}); treating as cache miss and refetching`),A=void 0)}let y,_,E,v,S=e,T=!1,w=!1,R=!1,x;if(A){d.trace("using cached edit");let O=A.rebasedEdit||A.edit;O&&(y={actualEdit:O,isFromCursorJump:A.isFromCursorJump}),T=!!A.rebasedEdit,w=A.subsequentN!==void 0&&A.subsequentN>0,R=A.source.isSpeculative,v=A.source,c.setIsCachedResult(A.source.log),S=A.targetDocId??S,A.targetDocId&&A.targetDocId!==e?_=this._workspace.getDocument(A.targetDocId).value.get():_=h,u.setHeaderRequestId(v.headerRequestId),u.setIsFromCache(),u.setCachedModelTelemetry(A.modelTelemetry),u.setSubsequentEditOrder(A.rebasedEditIndex??A.subsequentN),u.setSourcePatchIndex(TQi(A)),c.recordingBookmark=v.log.recordingBookmark,x=A.baseCacheEntry??A}else{d.trace(`fetching next edit with shouldExpandEditWindow=${o}`);let O=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new q3e(r.requestUuid,c,O,!1),u.setHeaderRequestId(v.headerRequestId);let B=f.value.get();d.trace("awaiting firstEdit promise");let q=await this.fetchNextEdit(v,f,g,o,d,u,l);d.trace("resolved firstEdit promise");let M=`First edit latency: ${Date.now()-this._lastTriggerTime} ms`;if(c.addLog(M),d.trace(M),q.isError())d.trace(`failed to fetch next edit ${q.err.toString()}`),u.setStatus(`noEdit:${q.err.kind}`),E=q.err;else if(S=q.val.docId??S,_=(S?this._workspace.getDocument(S):f).value.get(),S===f.id&&B.value!==_.value)d.trace("document changed while fetching next edit"),u.setStatus("docChanged"),c.setIsSkipped();else{let j=q.val.rebasedEdit||q.val.edit;j?(d.trace("fetch succeeded"),c.setResponseResults([j]),y={actualEdit:j,isFromCursorJump:q.val.isFromCursorJump},R=q.val.isFromSpeculativeRequest??!1,x=q.val.baseCacheEntry??q.val,u.setSourcePatchIndex(TQi(q.val))):(d.trace("empty edits"),u.setStatus("emptyEdits"))}}if(E instanceof Bp.NoNextEditReason.FetchFailure||E instanceof Bp.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${E.error}`),E.error;if(E instanceof Bp.NoNextEditReason.NoSuggestions)if(E.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new Zbt.NextEditResult(c.requestId,v,{jumpToPosition:E.nextCursorPosition,targetDocumentId:E.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else E instanceof Bp.NoNextEditReason.GotCancelled&&c.setIsSkipped();let k=new Zbt.NextEditResult(c.requestId,v,void 0);if(!y)return d.trace("had no edit"),k;if(l.isCancellationRequested)return d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),k;if(this._rejectionCollector.isRejected(S,y.actualEdit)||_&&this._nextEditCache.isRejectedNextEdit(S,_,y.actualEdit))return d.trace("edit was previously rejected"),u.setStatus("previouslyRejected"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected(),k;c.setResult(U3e.RootedLineEdit.fromEdit(new H_e.RootedEdit(h,new kie.StringEdit([y.actualEdit])))),(0,EQi.assert)(_!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new Zbt.NextEditResult(c.requestId,v,{edit:y.actualEdit,isFromCursorJump:y.isFromCursorJump,documentBeforeEdits:_,targetDocumentId:S,isSubsequentEdit:w,cacheEntry:x});u.setHasNextEdit(!0);let N=this.computeMinimumResponseDelay({triggerTime:n,isRebasedCachedEdit:T,isSubsequentCachedEdit:w,isFromSpeculativeRequest:R,enforceCacheDelay:r.enforceCacheDelay},d);return N>0&&(await(0,Kbt.timeout)(N),l.isCancellationRequested)?(d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),k):(d.trace("returning next edit result"),D)}_maybeCacheCrossFileEditUnderActiveDoc(e,r,n,o,s,c,l,u,d,f){return e!==0||s===r?!1:(this._nextEditCache.setKthNextEdit(r,n,o,l,0,void 0,void 0,d,{isFromCursorJump:u.isFromCursorJump,modelTelemetry:f,originalEditWindow:u.originalWindow,patchIndex:u.patchIndex,targetDocId:s,targetDocumentBeforeEdit:c}),!0)}determineNesConfigs(e,r){let n={isAsyncCompletions:this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService)};return e.setNESConfigs({...n}),r.addCodeblockToLog(JSON.stringify(n,null," ")),n}_processDoc(e){let r=e.lastEdit.base.getLines(),n=e.lastEdits,o=U3e.RootedLineEdit.fromEdit(new H_e.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new Bp.StatelessNextEditDocument(e.docId,l,e.languageId,r,o,s,n,c);return{recentEdit:e.lastEdit,nextEditDoc:u,documentAfterEdits:u.documentAfterEdits}}async fetchNextEdit(e,r,n,o,s,c,l){let u=r.id,d=s.createSubLogger("fetchNextEdit"),f=this._historyContextProvider.getHistoryContext(u);if(!f)return pE.Result.error(new Bp.NoNextEditReason.Unexpected(new Error("DocumentMissingInHistoryContext")));let h=r.value.get(),m=r.selection.get(),g=e.log;g.setRecentEdit(f);let A=m.at(0),y=a(N=>!N.requestEditWindow||!A||N.requestEditWindow.containsCursor(A),"cursorInRequestEditWindow"),_=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value,E=!this._pendingStatelessNextEditRequest||y(this._pendingStatelessNextEditRequest),v=(_||n.isAsyncCompletions)&&E&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0,S=this._specManager.pending,T=S?.docId===u&&S?.postEditContent===h.value&&!S.request.cancellationTokenSource.token.isCancellationRequested&&y(S.request),w=T?S?.request:void 0,R=w??v;if(R){w?(d.trace(`reusing speculative pending request (opportunityId=${w.opportunityId}, headerRequestId=${w.headerRequestId})`),this._specManager.consumePending()):d.trace(`reusing in-flight pending request (opportunityId=${R.opportunityId}, headerRequestId=${R.headerRequestId})`);let N=w?T:_,O=w?"speculative":"async";if(N){let B=await this._joinNextEditRequest(R,O,c,g,l);return c.setStatelessNextEditTelemetry(B.telemetry),w?(await R.firstEdit.p).map(M=>({...M,isFromSpeculativeRequest:!0})):B.nextEdit.isError()?B.nextEdit:R.firstEdit.p}else{let B=await this._joinNextEditRequest(R,O,c,g,l),q=await R.firstEdit.p;if(q.isOk()&&q.val.edit){let U=this._nextEditCache.tryRebaseCacheEntry(q.val,h,m);if(U.edit)return c.setStatelessNextEditTelemetry(B.telemetry),pE.Result.ok(U.edit);this._logRebaseFailure(U.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(B.telemetry),pE.Result.error(new Bp.NoNextEditReason.GotCancelled("afterFailedRebase"));let L=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0;if(L){d.trace("reusing 2nd existing next edit request after rebase failed");let U=await this._joinNextEditRequest(L,"async",c,g,l);return c.setStatelessNextEditTelemetry(U.telemetry),U.nextEdit.isError()?U.nextEdit:L.firstEdit.p}d.trace("creating new next edit request after rebase failed")}}let x=await this._executeNewNextEditRequest(e,r,f,n,o,d,c,l),k=x.nextEditRequest,D=x.nextEditResult;return c.setStatelessNextEditTelemetry(D.telemetry),D.nextEdit.isError()?D.nextEdit:k.firstEdit.p}async _joinNextEditRequest(e,r,n,o,s){n.setHeaderRequestId(e.headerRequestId),n.setReusedRequest(r),n.setRequest(e),o.setRequestInput(e),o.setIsReusedInFlightResult(e.logContext);let c=this._hookupCancellation(e,s);try{return await e.result}finally{c.dispose()}}_logRebaseFailure(e,r){e&&r.setRebaseFailure(e)}_rebaseAndCacheStreamedEdit(e){let{statePerDoc:r,streamedEdit:n,ithEdit:o,activeDoc:s,userEditSince:c,modelTelemetry:l,source:u,logger:d}=e,f=r.get(n.targetDocument),h=new Fbc.LineEdit([n.edit]),g=$bc(h,f.baseDocState).tryRebase(f.editsSoFar);if(g===void 0)return;f.editsSoFar=f.editsSoFar.compose(g);let A=f.docContents,y,_=!1;if(g.replacements.length===0||g.replacements.length>1)d.trace(`WARNING: ${o} has ${g.replacements.length} edits, but expected only 1`);else{let E=g.replacements[0];f.nextEdits.push(E),f.patchIndices.push(n.patchIndex),y=this._nextEditCache.setKthNextEdit(f.docId,A,o===0?n.window:void 0,E,o,o===0?f.nextEdits:void 0,o===0?c:void 0,u,{isFromCursorJump:n.isFromCursorJump,modelTelemetry:l,originalEditWindow:n.originalWindow,cursorOffset:f.docId===s.id?s.cursorOffset:void 0,patchIndex:n.patchIndex,patchIndices:o===0?f.patchIndices:void 0}),_=this._maybeCacheCrossFileEditUnderActiveDoc(o,s.id,s.contents,n.window,f.docId,A,E,n,u,l),d.trace(`populated cache for ${o}`)}return f.docContents=g.applyOnText(A),{lineEdit:h,rebasedEdit:g,docContentsBeforeEdit:A,cachedEdit:y,crossFileCached:_}}async _executeNewNextEditRequest(e,r,n,o,s,c,l,u){let d=r.id,f=c.createSubLogger("_executeNewNextEditRequest"),h=e.log;if(this._debugRecorder){let q=this._debugRecorder.createBookmark();h.recordingBookmark=q,l.setRequestBookmark(q)}let m=Vbc(n.getDocumentAndIdx(d)),g=r.selection.get()[0],A=this._debugRecorder?.getRecentLog(),y=n.documents.map(q=>this._processDoc(q)),_=this._xtabHistoryTracker.getHistory(),E=new Kbt.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,S=new Bp.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(q=>q.nextEditDoc),m.idx,_,E,v,!1,h,h.recordingBookmark,A,e.providerRequestStartDateTime),T;this._pendingStatelessNextEditRequest&&(this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel(),this._pendingStatelessNextEditRequest=null,this._specManager.clearScheduled()),this._specManager.cancelIfMismatch(d,S.documentBeforeEdits.value,"superseded"),this._pendingStatelessNextEditRequest=S;let w=a(()=>{this._pendingStatelessNextEditRequest===S&&(this._pendingStatelessNextEditRequest=null)},"removeFromPending");l.setRequest(S),l.setStatus("requested"),h.setRequestInput(S);let R=this._hookupCancellation(S,u,o.isAsyncCompletions?(0,Pbc.autorunWithChanges)(this,{value:r.value},q=>{q.value.changes.forEach(M=>{S.intermediateUserEdit&&!M.isEmpty()&&(S.intermediateUserEdit=S.intermediateUserEdit.compose(M),(0,Qbc.checkEditConsistency)(S.documentBeforeEdits.value,S.intermediateUserEdit,q.value.value.value,f)||(S.intermediateUserEdit=void 0))})}):void 0),x=SQi(y,_),k=this._statelessNextEditProvider.provideNextEdit(S,f,h,S.cancellationTokenSource.token),D=-1,N=!1,O=a((q,M)=>{++D;let L=f.createSubLogger("processEdit");L.trace(`processing edit #${D} (starts at 0)`),L.trace("resetting shouldExpandEditWindow to false due to receiving an edit"),this._shouldExpandEditWindow=!1;let U=this._rebaseAndCacheStreamedEdit({statePerDoc:x,streamedEdit:q,ithEdit:D,activeDoc:{id:d,contents:S.documentBeforeEdits,cursorOffset:g?.start},userEditSince:S.intermediateUserEdit,modelTelemetry:s4r(M),source:e,logger:L});if(U===void 0){L.trace(`edit ${D} is undefined after rebasing`),E.isSettled||E.complete(pE.Result.error(new Bp.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}let{lineEdit:j,docContentsBeforeEdit:Q,cachedEdit:Y}=U;return N=U.crossFileCached||N,E.isSettled||(L.trace("resolving firstEdit promise"),h.setResult(new U3e.RootedLineEdit(Q,j)),E.complete(Y?pE.Result.ok(Y):pE.Result.error(new Bp.NoNextEditReason.Unexpected(new Error("No cached edit"))))),Y},"processEdit"),B=a((q,M)=>{let L=f.createSubLogger("streamEnd");if(D===-1&&q instanceof Bp.NoNextEditReason.NoSuggestions&&(L.trace("resetting shouldExpandEditWindow to false due to NoSuggestions"),this._shouldExpandEditWindow=!1),x.get(d).nextEdits.length)L.trace(`${x.get(d).nextEdits.length} edits returned`);else if(L.trace(`no edit, reason: ${q.kind}`),q instanceof Bp.NoNextEditReason.NoSuggestions&&!N){let{documentBeforeEdits:W,window:V}=q,z=V?Gbc(V,g,W):void 0;this._nextEditCache.setNoNextEdit(d,W,z,e,s4r(M))}E.isSettled||E.complete(pE.Result.error(q));let j=x.get(d).nextEdits.length>0?pE.Result.ok(void 0):pE.Result.error(q),Q=new Bp.StatelessNextEditResult(j,M);S.setResult(Q),R.dispose(),w();let Y=this._specManager.consumeScheduled(S.headerRequestId);return Y&&this._triggerSpeculativeRequest(Y.suggestion),Q},"handleStreamEnd");try{let q=await k.next();if(q.done){let M=q.value.v;T=B(M,q.value.telemetryBuilder)}else{let M=q.value.v,L=q.value.telemetryBuilder;O(M,L),(async()=>{try{for(q=await k.next();!q.done;){let j=q.value.v;O(j,q.value.telemetryBuilder),this._specManager.consumeScheduled(S.headerRequestId),q=await k.next()}let U=q.value.v;B(U,q.value.telemetryBuilder)}catch(U){f.trace(`Error while streaming further edits: ${F3e.ErrorUtils.toString(U)}`);let j=new Bp.NoNextEditReason.Unexpected(F3e.ErrorUtils.fromUnknown(U));B(j,L)}})(),T=new Bp.StatelessNextEditResult(pE.Result.ok(void 0),L)}}catch(q){throw S.setResultError(q),q}return{nextEditRequest:S,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new Jbt.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new Kbt.TimeoutTimer);return o.add(r.onCancellationRequested(()=>{if(c(),!(e.liveDependentants>0)){if(!e.fetchIssued){e.cancellationTokenSource.cancel(),n?.dispose();return}l.setIfNotSet(()=>{e.liveDependentants>0||(e.cancellationTokenSource.cancel(),n?.dispose())},1e3)}})),o.add((0,Jbt.toDisposable)(()=>{c(),e.liveDependentants===0&&n?.dispose()})),e.liveDependentants++,o}computeMinimumResponseDelay({triggerTime:e,isRebasedCachedEdit:r,isSubsequentCachedEdit:n,isFromSpeculativeRequest:o,enforceCacheDelay:s},c){if(!s)return c.trace("[minimumDelay] no minimum delay enforced due to enforceCacheDelay being false"),0;let l=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestDelay,this._expService),h=l;r&&u!==void 0?h=u:n&&d!==void 0?h=d:o&&f!==void 0&&(h=f);let m=Date.now()-e,g=Math.max(0,h-m);return c.trace(`[minimumDelay] expected delay: ${h}ms, effective delay: ${g}. isRebasedCachedEdit: ${r} (rebasedCacheDelay: ${u}), isSubsequentCachedEdit: ${n} (subsequentCacheDelay: ${d}), isFromSpeculativeRequest: ${o} (speculativeRequestDelay: ${f})`),g}handleShown(e){if(this._lastShownTime=Date.now(),this._lastShownSuggestionId=e.requestId,this._lastOutcome=void 0,this._specManager.clearScheduled(),this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===B3e.SpeculativeRequestsEnablement.On){let n=this._pendingStatelessNextEditRequest;n&&n.headerRequestId===e.source.headerRequestId?this._specManager.schedule({suggestion:e,headerRequestId:n.headerRequestId}):this._triggerSpeculativeRequest(e)}}async _triggerSpeculativeRequest(e){let r=e.result;if(!r?.edit)return;let n=r.targetDocumentId;if(!n)return;let o=new kbc.InlineEditRequestLogContext(n.uri,0,void 0),s=new CQi.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(c4r.LogTarget.fromCallback((T,w)=>{o.trace(`[${Math.floor(s.elapsed()).toString().padStart(4," ")}ms] ${w}`)})),l=r.edit.replace(r.documentBeforeEdits.value),u=r.edit.removeCommonSuffixPrefix(r.documentBeforeEdits.value),d=u.replaceRange.start+u.newText.length,f=new l4r.OffsetRange(d,d),h=[f],m=new H_e.RootedEdit(r.documentBeforeEdits,new kie.StringEdit([r.edit])),g=new bQi.StringText(l),A=this._nextEditCache.lookupNextEdit(n,g,h),y=f;if(A)if(A.edit){c.trace("already have cached edit for post-edit state");return}else if(A.editWindow){c.trace("have cached no-suggestions entry for post-edit state, but it has an edit window. Checking if shifting selection based on cursor placement config can yield a cached edit");let T=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===B3e.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=a4r.shiftSelectionAfterEditWindow(g,A.editWindow),A=this._nextEditCache.lookupNextEdit(n,g,[y]),A?.edit){c.trace("already have cached edit for post-edit state (after shifting selection)");return}else c.trace("no cached edit even after shifting selection");else c.trace(`cursor placement config is ${T}, not shifting selection`)}else{c.trace("already have cached no-suggestions entry for post-edit state");return}if(this._pendingStatelessNextEditRequest?.documentBeforeEdits.value===l){c.trace("already have pending request for post-edit state");return}let _=this._specManager.pending;if(_?.docId===n&&_?.postEditContent===l){c.trace("already have speculative request for post-edit state");return}let E=this._workspace.getDocument(n);if(!E){c.trace("document not found for speculative request");return}let v=this._historyContextProvider.getHistoryContext(n);if(!v){c.trace("no history context for speculative request");return}let S=new q3e(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,IQi.generateUuid)()}`);c.trace(`triggering speculative request for post-edit state (opportunityId=${S.opportunityId}, headerRequestId=${S.headerRequestId})`);try{let T=await this._createSpeculativeRequest(S,E,y,v,l,m,r.edit,{triggeredBySpeculativeRequest:e.source.isSpeculative,isSubsequentEdit:e.result?.isSubsequentEdit??!1},c);if(T){let w=r.documentBeforeEdits.value,R=w.slice(0,u.replaceRange.start),x=w.slice(u.replaceRange.endExclusive),k=u.newText;this._specManager.setPending({request:T,docId:n,postEditContent:l,trajectoryPrefix:R,trajectorySuffix:x,trajectoryNewText:k})}}catch(T){c.trace(`speculative request failed: ${F3e.ErrorUtils.toString(T)}`)}}async _createSpeculativeRequest(e,r,n,o,s,c,l,{triggeredBySpeculativeRequest:u,isSubsequentEdit:d},f){let h=r.id,m=this._debugRecorder?.getRecentLog(),g=e.log;g.setStatelessNextEditProviderId(this._statelessNextEditProvider.ID);let A=f.createSubLogger("_createSpeculativeRequest"),y=o.getDocumentAndIdx(h);if(!y){A.trace("active doc not found in history context");return}let _=new bQi.StringText(s),E=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let O=this._workspace.getWorkspaceRoot(h),B=new kie.StringEdit([l]),q=U3e.RootedLineEdit.fromEdit(new H_e.RootedEdit(r.value.get(),B)).removeCommonSuffixPrefixLines().edit,M=new Bp.StatelessNextEditDocument(h,O,N.languageId,r.value.get().getLines(),q,r.value.get(),H_e.Edits.single(B),n);return{recentEdit:new H_e.RootedEdit(r.value.get(),B),nextEditDoc:M,documentAfterEdits:_}}}),v=this._xtabHistoryTracker.getHistory(),S={kind:"edit",docId:h,edit:c};v.push(S);let T=new Kbt.DeferredPromise,w=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case B3e.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case B3e.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case B3e.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,EQi.assertNever)(w)}let x=new Bp.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,_,E.map(N=>N.nextEditDoc),y.idx,v,T,R,!0,g,void 0,m,void 0);g.setRequestInput(x),A.trace("starting speculative provider call");let k=`NES | spec | ${(0,Rbc.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new Dbc.CapturingToken(k,void 0);return this._requestLogger.captureInvocation(D,async()=>{this._addLiveLogContextEntry(g,k);try{await this._runSpeculativeProviderCall(x,E,h,e,n.start,A)}catch(N){g.setError(N)}finally{g.markCompleted()}}),x}async _runSpeculativeProviderCall(e,r,n,o,s,c){let l=c.createSubLogger("_runSpeculativeProviderCall"),u=e.xtabEditHistory,d=SQi(r,u),f=o.log,h=this._statelessNextEditProvider.provideNextEdit(e,l,f,e.cancellationTokenSource.token),m=-1;try{let g=await h.next();g.done?(e.firstEdit.complete(pE.Result.error(g.value.v)),e.setResult(new Bp.StatelessNextEditResult(pE.Result.error(g.value.v),g.value.telemetryBuilder)),f.markAsNoSuggestions(),l.trace("speculative request completed with no edits")):(async()=>{for(;!g.done;){++m;let A=g.value.v,y=this._rebaseAndCacheStreamedEdit({statePerDoc:d,streamedEdit:A,ithEdit:m,activeDoc:{id:n,contents:e.documentBeforeEdits,cursorOffset:s},userEditSince:void 0,modelTelemetry:s4r(g.value.telemetryBuilder),source:o,logger:l});if(y===void 0){l.trace(`speculative edit ${m} rebasing failed`),g=await h.next();continue}let{rebasedEdit:_,cachedEdit:E}=y;E&&(e.firstEdit.isSettled||(e.firstEdit.complete(pE.Result.ok(E)),e.setResult(new Bp.StatelessNextEditResult(pE.Result.ok(void 0),g.value.telemetryBuilder)),f.setResponseResults([_.replacements[0]])),l.trace(`cached speculative edit ${m}`)),g=await h.next()}})().finally(()=>{e.firstEdit.isSettled||(e.firstEdit.complete(pE.Result.error(new Bp.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new Bp.StatelessNextEditResult(pE.Result.error(new Bp.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits"))),g.value.telemetryBuilder)),f.markAsNoSuggestions())}),l.trace(`speculative request completed with ${m+1} edits`)}catch(g){l.trace(`speculative provider call error: ${F3e.ErrorUtils.toString(g)}`)}}static shiftSelectionAfterEditWindow(e,r){let n=e.getTransformer(),o=n.getPosition(r.endExclusive-1),s=o.lineNumber+11e3&&r.result.edit&&(this._rejectionCollector.reject(e,r.result.edit),this._nextEditCache.rejectedNextEdit(r.source.headerRequestId)),this._lastRejectionTime=Date.now(),this._lastOutcome=Q3e.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=Q3e.Ignored,this._lastShownSuggestionId===r.requestId&&!(n!==void 0)&&(this._specManager.cancelAll("ignoredDismissed"),this._statelessNextEditProvider.handleIgnored?.())}async runSnippy(e,r){r.result===void 0||r.result.edit===void 0||this._snippyService.handlePostInsertion(e.toUri(),r.result.documentBeforeEdits,r.result.edit)}_addLiveLogContextEntry(e,r){this._requestLogger.addEntry({type:"MarkdownContentRequest",debugName:r??e.getDebugName(),icon:a(()=>e.getIcon(),"icon"),startTimeMs:e.time,markdownContent:a(()=>e.toLogDocument(),"markdownContent"),onDidChange:e.onDidChange,isVisible:a(()=>e.includeInLogTree,"isVisible")})}clearCache(){this._nextEditCache.clear(),this._rejectionCollector.clear(),this._specManager.cancelAll("cacheCleared")}};MI.NextEditProvider=u4r;MI.NextEditProvider=u4r=a4r=wbc([L3e(5,qS.IConfigurationService),L3e(6,Mbc.ISnippyService),L3e(7,c4r.ILogService),L3e(8,Obc.IExperimentationService),L3e(9,Nbc.IRequestLogger)],u4r);function Vbc(t){if(!t)throw new d4r.BugIndicatingError("expected value to be defined, but it was not");return t}a(Vbc,"assertDefined");var q3e=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,IQi.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};MI.NextEditFetchRequest=q3e});var wQi=I(j3e=>{"use strict";p();Object.defineProperty(j3e,"__esModule",{value:!0});j3e.parseGitRemotes=Wbc;j3e.toGitUri=zbc;j3e.getUpstreamRemote=Ybc;var f4r=class t{static{a(this,"GitConfigParser")}static{this._lineSeparator=/\r?\n/}static{this._propertyRegex=/^\s*(\w+)\s*=\s*"?([^"]+)"?$/}static{this._sectionRegex=/^\s*\[\s*([^\]]+?)\s*(\"[^"]+\")*\]\s*$/}static parse(e){let r={sections:[]},n={name:"DEFAULT",properties:{}},o=a(s=>{s&&r.sections.push(s)},"addSection");for(let s of e.split(t._lineSeparator)){let c=s.match(t._sectionRegex);if(c?.length===3){o(n),n={name:c[1],subSectionName:c[2]?.replaceAll('"',""),properties:{}};continue}let l=s.match(t._propertyRegex);l?.length===3&&!Object.keys(n.properties).includes(l[1])&&(n.properties[l[1]]=l[2])}return o(n),r.sections}};function Wbc(t){let e=[];for(let r of f4r.parse(t).filter(n=>n.name==="remote"))r.subSectionName&&e.push({name:r.subSectionName,fetchUrl:r.properties.url,pushUrl:r.properties.pushurl??r.properties.url,isReadOnly:!1});return e}a(Wbc,"parseGitRemotes");function zbc(t,e,r={}){let n={path:t.fsPath,ref:e};r.submoduleOf&&(n.submoduleOf=r.submoduleOf);let o=t.path;return r.replaceFileExtension?o=`${o}.git`:r.submoduleOf&&(o=`${o}.diff`),t.with({scheme:r.scheme??"git",path:o,query:JSON.stringify(n)})}a(zbc,"toGitUri");function Ybc(t){let e=t.state.HEAD?.upstream?.remote;if(e)return t.state.remotes.find(r=>r.name===e)}a(Ybc,"getUpstreamRemote")});var BQi=I(Mh=>{"use strict";p();Object.defineProperty(Mh,"__esModule",{value:!0});Mh.GLOB_SPLIT=Mh.GLOBSTAR=void 0;Mh.getEmptyExpression=eSc;Mh.splitGlobAware=m4r;Mh.isEmptyPattern=cSc;Mh.match=pSc;Mh.parse=MQi;Mh.isRelativePattern=OQi;Mh.getBasenameTerms=hSc;Mh.getPathTerms=mSc;Mh.patternsEquals=ySc;var Kbc=Ml(),h4r=pl(),Jbc=lVt(),Zbc=b2(),qV=$A(),Xbc=pj(),H3e=ym();function eSc(){return Object.create(null)}a(eSc,"getEmptyExpression");Mh.GLOBSTAR="**";Mh.GLOB_SPLIT="/";var Xbt="[/\\\\]",eSt="[^/\\\\]",tSc=/\//g;function RQi(t,e){switch(t){case 0:return"";case 1:return`${eSt}*?`;default:return`(?:${Xbt}|${eSt}+${Xbt}${e?`|${Xbt}${eSt}+`:""})*?`}}a(RQi,"starsToRegExp");function m4r(t,e){if(!t)return[];let r=[],n=!1,o=!1,s="";for(let c of t){switch(c){case e:if(!n&&!o){r.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=c}return s&&r.push(s),r}a(m4r,"splitGlobAware");function NQi(t){if(!t)return"";let e="",r=m4r(t,Mh.GLOB_SPLIT);if(r.every(n=>n===Mh.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===Mh.GLOBSTAR){if(n)return;e+=RQi(2,s===r.length-1)}else{let c=!1,l="",u=!1,d="";for(let f of o){if(f!=="}"&&c){l+=f;continue}if(u&&(f!=="]"||!d)){let h;f==="-"?h=f:(f==="^"||f==="!")&&!d?h="^":f===Mh.GLOB_SPLIT?h="":h=(0,H3e.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${m4r(l,",").map(g=>NQi(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=eSt;continue;case"*":e+=RQi(1);continue;default:e+=(0,H3e.escapeRegExpCharacters)(f)}}su===d,endsWith:n?H3e.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,Jbc.isEqualOrParent)(u,d,e.ignoreCase??!Xbc.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=kQi.get(s);if(c)return PQi(c,t,o);let l;return rSc.test(r)?c=lSc(r.substring(4),r,o):(l=nSc.exec(p4r(r,o)))?c=uSc(l[1],r,o):(e.trimForExclusions?oSc:iSc).test(r)?c=dSc(r,o):(l=sSc.exec(p4r(r,o)))?c=DQi(l[1].substring(1),r,!0,o):(l=aSc.exec(p4r(r,o)))?c=DQi(l[1],r,!1,o):c=fSc(r,o),kQi.set(s,c),PQi(c,t,o)}a(A4r,"parsePattern");function PQi(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,H3e.ltrim)(o.substring(e.base.length),qV.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(PQi,"wrapRelativePattern");function p4r(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(p4r,"trimForExclusions");function lSc(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(lSc,"trivia1");function uSc(t,e,r){let n=`/${t}`,o=`\\${t}`,s=a(function(l,u){return typeof l!="string"?null:u?r.equals(u,t)?e:null:r.equals(l,t)||r.endsWith(l,n)||r.endsWith(l,o)?e:null},"parsedPattern"),c=[t];return s.basenames=c,s.patterns=[e],s.allBasenames=c,s}a(uSc,"trivia2");function dSc(t,e){let r=LQi(t.slice(1,-1).split(",").map(l=>A4r(l,e)).filter(l=>l!==FN),t),n=r.length;if(!n)return FN;if(n===1)return r[0];let o=a(function(l,u){for(let d=0,f=r.length;d!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(dSc,"trivia3");function DQi(t,e,r,n){let o=qV.sep===qV.posix.sep,s=o?t:t.replace(tSc,qV.sep),c=qV.sep+s,l=qV.posix.sep+t,u;return r?u=a(function(d,f){return typeof d=="string"&&(n.equals(d,s)||n.endsWith(d,c)||!o&&(n.equals(d,t)||n.endsWith(d,l)))?e:null},"parsedPattern"):u=a(function(d,f){return typeof d=="string"&&(n.equals(d,s)||!o&&n.equals(d,t))?e:null},"parsedPattern"),u.allPaths=[(r?"*/":"./")+t],u}a(DQi,"trivia4and5");function fSc(t,e){try{let r=new RegExp(`^${NQi(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return FN}}a(fSc,"toRegExp");function pSc(t,e,r){return!t||typeof e!="string"?!1:MQi(t,r)(e)}a(pSc,"match");function MQi(t,e={}){if(!t)return g4r;if(typeof t=="string"||OQi(t)){let r=A4r(t,e);if(r===FN)return g4r;let n=a(function(o,s){return!!r(o,s)},"resultPattern");return r.allBasenames&&(n.allBasenames=r.allBasenames),r.allPaths&&(n.allPaths=r.allPaths),n}return gSc(t,e)}a(MQi,"parse");function OQi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(OQi,"isRelativePattern");function hSc(t){return t.allBasenames||[]}a(hSc,"getBasenameTerms");function mSc(t){return t.allPaths||[]}a(mSc,"getPathTerms");function gSc(t,e){let r=LQi(Object.getOwnPropertyNames(t).map(l=>ASc(l,t[l],e)).filter(l=>l!==FN)),n=r.length;if(!n)return FN;if(!r.some(l=>!!l.requiresSiblings)){if(n===1)return r[0];let l=a(function(f,h){let m;for(let g=0,A=r.length;g{for(let g of m){let A=await g;if(typeof A=="string")return A}return null})():null},"resultExpression"),u=r.find(f=>!!f.allBasenames);u&&(l.allBasenames=u.allBasenames);let d=r.reduce((f,h)=>h.allPaths?f.concat(h.allPaths):f,[]);return d.length&&(l.allPaths=d),l}let o=a(function(l,u,d){let f,h;for(let m=0,g=r.length;m{for(let m of h){let g=await m;if(typeof g=="string")return g}return null})():null},"resultExpression"),s=r.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(gSc,"parsedExpression");function ASc(t,e,r){if(e===!1)return FN;let n=A4r(t,r);if(n===FN)return FN;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let s=a((c,l,u,d)=>{if(!d||!n(c,l))return null;let f=o.replace("$(basename)",()=>u),h=d(f);return(0,h4r.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(ASc,"parseExpressionPattern");function LQi(t,e){let r=t.filter(l=>!!l.basenames);if(r.length<2)return t;let n=r.reduce((l,u)=>{let d=u.basenames;return d?l.concat(d):l},[]),o;if(e){o=[];for(let l=0,u=n.length;l{let d=u.patterns;return d?l.concat(d):l},[]);let s=a(function(l,u){if(typeof l!="string")return null;if(!u){let f;for(f=l.length;f>0;f--){let h=l.charCodeAt(f-1);if(h===47||h===92)break}u=l.substring(f)}let d=n.indexOf(u);return d!==-1?o[d]:null},"aggregate");s.basenames=n,s.patterns=o,s.allBasenames=n;let c=t.filter(l=>!l.basenames);return c.push(s),c}a(LQi,"aggregateBasenameMatches");function ySc(t,e){return(0,Kbc.equals)(t,e,(r,n)=>typeof r=="string"&&typeof n=="string"?r===n:typeof r!="string"&&typeof n!="string"?r.base===n.base&&r.pattern===n.pattern:!1)}a(ySc,"patternsEquals")});var rSt=I(Wl=>{"use strict";p();var _Sc=Wl&&Wl.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ESc=Wl&&Wl.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vSc=Wl&&Wl.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o(0,FQi.isEqual)(r.uri,t)||r.uri.path===t.path||_4r(t,r))}a(y4r,"findNotebook");function _4r(t,e){if(t.scheme===G3e.Schemas.vscodeNotebookCell||t.scheme===G3e.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,FQi.isEqual)(n.document.uri,t)||n.document.uri.fragment===t.fragment&&n.document.uri.path===t.path);if(r!==-1)return e.getCells()[r]}}a(_4r,"findCell");function CSc(t,e){if(t.scheme!==G3e.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=UQi(t,e);if(!o||!o.outputs.length)return;let s=(r.get("outputIndex")?parseInt(r.get("outputIndex")||"",10):void 0)||0;if(!(s>o.outputs.length-1))return[n,o,o.outputs[s]]}a(CSc,"getNotebookCellOutput");function UQi(t,e){let r=y4r(t,e)||e.find(o=>o.uri.path===t.path);if(!r)return[void 0,void 0];let n=_4r(t,r);return n===void 0?[r,void 0]:[r,n]}a(UQi,"getNotebookAndCellFromUri");function bSc(t){return t.scheme===G3e.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a(bSc,"isNotebookCellOrNotebookChatInput");function SSc(t){return t.scheme===G3e.Schemas.vscodeNotebookCell}a(SSc,"isNotebookCell");function TSc(t){return t.path.endsWith(".ipynb")}a(TSc,"isJupyterNotebookUri");function ISc(t){return t.notebookType==="jupyter-notebook"}a(ISc,"isJupyterNotebook");function xSc(t,e={}){return JSON.stringify({cells:t.getCells().map(r=>({uri_fragment:e.cell_uri_fragment?r.document.uri.fragment:void 0,cell_type:r.kind,source:r.document.getText().split(/\r?\n/)}))})}a(xSc,"serializeNotebookDocument");function wSc(t){try{let e=t.replace(/\n/g,""),n=/```(?:json)?(.+)/g.exec(e);if(n){let o=n[1],s=o.indexOf("```"),c=s===-1?o:o.substring(0,s);return JSON.parse(c)}}catch{}}a(wSc,"extractNotebookOutline");function QQi(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||jQi(e.include))}a(QQi,"isDocumentExcludePattern");function qQi(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a(qQi,"isFilenamePattern");function jQi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(jQi,"isRelativePattern");function RSc(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(RSc,"isNotebookEditorContribution");function kSc(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(kSc,"extractEditorAssociation");function HQi(t,e){if(typeof e=="string"&&G_e.match(e.toLowerCase(),(0,$_e.basename)(t.fsPath).toLowerCase()))return!0;if(QQi(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(G_e.match(r,(0,$_e.basename)(t.fsPath).toLowerCase()))return!(n&&G_e.match(n,(0,$_e.basename)(t.fsPath).toLowerCase()))}return qQi(e)&&G_e.match(e.filenamePattern,(0,$_e.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&G_e.match(e.excludeFileNamePattern,(0,$_e.basename)(t.fsPath).toLowerCase())):!1}a(HQi,"notebookSelectorMatches");function GQi(t,e){let r=[];for(let n of e)n.filenamePattern&&G_e.match(n.filenamePattern.toLowerCase(),(0,$_e.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(GQi,"getNotebookEditorAssociations");function PSc(t,e,r,n){if(y4r(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>HQi(t,l)));if(o.length===0)return!1;let s=GQi(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??tSt.default)===tSt.default)}a(PSc,"_hasSupportedNotebooks")});var KQi=I(Hg=>{"use strict";p();var DSc=Hg&&Hg.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},NSc=Hg&&Hg.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Hg,"__esModule",{value:!0});Hg.TelemetrySender=Hg.NextEditProviderTelemetryBuilder=Hg.DiagnosticsTelemetryBuilder=Hg.LlmNESTelemetryBuilder=Hg.NES_GH_TELEMETRY_EVENT_NAME=void 0;var $Qi=gk(),VQi=wQi(),MSc=W4(),YQi=bh(),OSc=rSt(),LSc=pl(),nSt=Po(),BSc=XJ(),WQi=o6(),zQi=Qg();Hg.NES_GH_TELEMETRY_EVENT_NAME="copilot-nes/provideInlineEdit";var iSt=class extends nSt.Disposable{static{a(this,"LlmNESTelemetryBuilder")}build(e){let r,n,o,s,c,l=!1,u,d,f;if(this._request){let g=this._request.getActiveDocument();r=this._request.documents.length,n=this._request.documents.reduce((y,_)=>y+_.recentEdits.edits.length,0),o=g.recentEdits.edits.length,s=g.languageId,c=g.documentAfterEditsLines.length,l=g.id.toUri().scheme===BSc.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,OSc.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(zQi.Uri.parse(g.id.uri));if(y){let v=(0,VQi.getUpstreamRemote)(y);v?.fetchUrl&&(d=v.pushUrl||v.fetchUrl)}let _=new Set,E=[...new Set(this._request.documents.map(v=>A.getRepository(zQi.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of E){let S=v?(0,VQi.getUpstreamRemote)(v):void 0;S?.fetchUrl&&_.add(S.fetchUrl),S?.pushUrl&&_.add(S.pushUrl)}f=[..._]}}let h;if(e&&this.editCollectingInfo!==void 0){let g=this.editCollectingInfo.originalDoc.value,A;if(this._debugRecorder&&this._requestBookmark){let y=this._debugRecorder.getRecentLog(),_=JSON.stringify(y)?.length||0;A={entries:_>200*1024?void 0:y,entriesSize:_,requestTime:this._requestBookmark.timeMs}}h={text:g.length>200*1024?void 0:g,textLength:g.length,selection:this.editCollectingInfo.originalSelection.map(y=>({start:y.start,endExclusive:y.endExclusive})),edits:this.editCollectingInfo.edits.map(y=>y.edit.replacements.map(_=>({time:y.time.toISOString(),start:_.replaceRange.start,endExclusive:_.replaceRange.endExclusive,newText:_.newText}))).flat(),tags:[],recording:A}}let m=this._statelessNextEditTelemetry?.fetchStartedAt===void 0?void 0:this._statelessNextEditTelemetry.fetchStartedAt-this._startTime;return{providerId:this._providerId,headerRequestId:this._headerRequestId,nextEditProviderDuration:this._duration,isFromCache:this._isFromCache,reusedRequest:this._reusedRequest,subsequentEditOrder:this._subsequentEditOrder,sourcePatchIndex:this._sourcePatchIndex,documentsCount:r,editsCount:n,activeDocumentEditsCount:o,activeDocumentLanguageId:s,activeDocumentOriginalLineCount:c,fetchStartedAfterMs:m,hasNextEdit:this._hasNextEdit,wasPreviouslyRejected:this._wasPreviouslyRejected,isNotebook:l,notebookType:u,status:this._status,nextEditProviderError:this._nextEditProviderError,alternativeAction:h,...this._statelessNextEditTelemetry,modelName:this._statelessNextEditTelemetry?.modelName??this._cachedModelTelemetry?.modelName,modelConfig:this._statelessNextEditTelemetry?.modelConfig??this._cachedModelTelemetry?.modelConfig,activeDocumentRepository:d,repositoryUrls:f,nesConfigs:this._nesConfigs}}get originalSelectionLine(){return this.editCollectingInfo?.originalSelectionLine}setRequestBookmark(e){this._requestBookmark=e}constructor(e,r,n,o,s,c,l){super(),this._gitExtensionService=e,this._notebookService=r,this._workspaceService=n,this._providerId=o,this._doc=s,this._debugRecorder=c,this._requestBookmark=l,this._isFromCache=!1,this._hasNextEdit=!1,this._wasPreviouslyRejected=!1,this._status="new",this._startTime=Date.now(),this._doc&&(this.editCollectingInfo={originalDoc:this._doc.value.get(),originalSelection:this._doc.selection.get(),originalSelectionLine:this._doc.primarySelectionLine.get(),edits:[]},this._store.add((0,MSc.autorunWithChanges)(this,{value:this._doc.value},u=>{let d=new Date;u.value.changes.forEach(f=>{this.editCollectingInfo?.edits.push({time:d,edit:f})})})))}setNESConfigs(e){return this._nesConfigs=e,this}setHeaderRequestId(e){return this._headerRequestId=e,this}setIsFromCache(){return this._isFromCache=!0,this}setCachedModelTelemetry(e){return this._cachedModelTelemetry=e,this}setReusedRequest(e){return this._reusedRequest=e,this}setSubsequentEditOrder(e){return this._subsequentEditOrder=e,this}setSourcePatchIndex(e){return this._sourcePatchIndex=e,this}setRequest(e){return this._request=e,this}setStatelessNextEditTelemetry(e){return this._statelessNextEditTelemetry=e,this}setHasNextEdit(e){return this._hasNextEdit=e,this}setWasPreviouslyRejected(){return this._wasPreviouslyRejected=!0,this}markEndTime(){return this._duration=Date.now()-this._startTime,this}setStatus(e){return this._status=e,this}setNextEditProviderError(e){return this._nextEditProviderError=e,this}};Hg.LlmNESTelemetryBuilder=iSt;var oSt=class{static{a(this,"DiagnosticsTelemetryBuilder")}constructor(){this._droppedReasons=[]}build(){let e=this._droppedReasons.length>0?JSON.stringify(this._droppedReasons):void 0;return{diagnosticType:this._type,diagnosticDroppedReasons:e,diagnosticAlternativeImportsCount:this._diagnosticRunTelemetry?.alternativeImportsCount,diagnosticHasExistingSameFileImport:this._diagnosticRunTelemetry?.hasExistingSameFileImport,diagnosticIsLocalImport:this._diagnosticRunTelemetry?.isLocalImport,diagnosticDistanceToUnknownDiagnostic:this._diagnosticRunTelemetry?.distanceToUnknownDiagnostic,diagnosticDistanceToAlternativeDiagnostic:this._diagnosticRunTelemetry?.distanceToAlternativeDiagnostic,diagnosticHasAlternativeDiagnosticForSameRange:this._diagnosticRunTelemetry?.hasAlternativeDiagnosticForSameRange}}populate(e){this._droppedReasons.forEach(r=>e.addDroppedReason(r)),this._type&&e.setType(this._type),this._diagnosticRunTelemetry&&e.setDiagnosticRunTelemetry(this._diagnosticRunTelemetry)}setType(e){return this._type=e,this}addDroppedReason(e){return this._droppedReasons.push(e),this}setDiagnosticRunTelemetry(e){return this._diagnosticRunTelemetry=e,this}};Hg.DiagnosticsTelemetryBuilder=oSt;var E4r=class t extends nSt.Disposable{static{a(this,"NextEditProviderTelemetryBuilder")}static{this.providerIdToReqN=new Map}get isSent(){return this._isSent}markAsSent(){this._isSent=!0}build(e){let r=this._nesBuilder.build(e),n=this._diagnosticsBuilder.build();return{...r,...n,opportunityId:this._opportunityId||"",requestN:this._requestN,isShown:this._isShown,acceptance:this._acceptance,disposalReason:this._disposalReason,supersededByOpportunityId:this._supersededByOpportunityId,pickedNES:this._nesTypePicked,hadLlmNES:this._hadLlmNES,isMultilineEdit:this._isMultilineEdit,suggestionLineDistanceToCursor:this._suggestionLineDistanceToCursor,isEolDifferent:this._isEolDifferent,isActiveDocument:this._isActiveDocument,isNextEditorVisible:this._isNextEditorVisible,isNextEditorRangeVisible:this._isNextEditorRangeVisible,isNESForAnotherDoc:this._isNESForAnotherDoc,notebookId:this._notebookId,notebookCellLines:this._notebookCellLines,notebookCellMarkerCount:this._notebookCellMarkerCount,notebookCellMarkerIndex:this._notebookCellMarkerIndex,hadDiagnosticsNES:this._hadDiagnosticsNES,configIsDiagnosticsNESEnabled:this._configIsDiagnosticsNESEnabled,isNaturalLanguageDominated:this._isNaturalLanguageDominated,postProcessingOutcome:this._postProcessingOutcome,userTypingDisagreed:this._userTypingDisagreed}}get nesBuilder(){return this._nesBuilder}get diagnosticsBuilder(){return this._diagnosticsBuilder}constructor(e,r,n,o,s,c,l){super(),this.doc=s,this._isSent=!1,this._isShown=!1,this._acceptance="notAccepted",this._disposalReason=void 0,this._supersededByOpportunityId=void 0,this._userTypingDisagreed=void 0,this._notebookCellMarkerCount=0,this._notebookCellMarkerIndex=-1,this._isNESForAnotherDoc=!1,this._hadLlmNES=!1,this._hadDiagnosticsNES=!1,this._configIsDiagnosticsNESEnabled=!1,this._isNaturalLanguageDominated=!1;let u=t.providerIdToReqN.get(o)||0;this._requestN=++u,t.providerIdToReqN.set(o,u),this._nesBuilder=this._register(new iSt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new oSt}setOpportunityId(e){return this._opportunityId=e,this}setAsShown(){return this._isShown=!0,this}setAcceptance(e){return this._acceptance=e,this}setDisposalReason(e){return this._disposalReason=e,this}setSupersededBy(e){return this._supersededByOpportunityId=e,this}setUserTypingDisagreed(e){return this._userTypingDisagreed=e,this}setPickedNESType(e){return this._nesTypePicked=e,this}setIsActiveDocument(e){return this._isActiveDocument=e,this}setNotebookCellMarkerCount(e){return this._notebookCellMarkerCount=e,this}setIsMultilineEdit(e){return this._isMultilineEdit=e,this}setSuggestionLineDistanceToCursor(e){return this._suggestionLineDistanceToCursor=e,this}setIsEolDifferent(e){return this._isEolDifferent=e,this}setIsNextEditorVisible(e){return this._isNextEditorVisible=e,this}setIsNextEditorRangeVisible(e){return this._isNextEditorRangeVisible=e,this}setNotebookId(e){return this._notebookId=e,this}setNotebookCellLines(e){return this._notebookCellLines=e,this}setNotebookCellMarkerIndex(e){return this._notebookCellMarkerIndex=e,this}setIsNESForOtherEditor(e){return this._isNESForAnotherDoc=e,this}setHadLlmNES(e){return this._hadLlmNES=e,this}setHadDiagnosticsNES(e){return this._hadDiagnosticsNES=e,this}setStatus(e){return this._nesBuilder.setStatus(e),this}setConfigIsDiagnosticsNESEnabled(e){return this._configIsDiagnosticsNESEnabled=e,this}setIsNaturalLanguageDominated(e){return this._isNaturalLanguageDominated=e,this}setPostProcessingOutcome(e){let r=e.displayLocation?{label:e.displayLocation.label,range:e.displayLocation.range.toString()}:void 0;return this._postProcessingOutcome=JSON.stringify({suggestedEdit:e.edit.toString(),isInlineCompletion:e.isInlineCompletion,displayLocation:r}),this}};Hg.NextEditProviderTelemetryBuilder=E4r;var v4r=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new nSt.DisposableStore,this._disposalTracker=new nSt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new LSc.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,WQi.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,WQi.autorunHandleChanges)({owner:this,changeTracker:{createChangeSummary:a(()=>({removed:[]}),"createChangeSummary"),handleChange:a((u,d)=>(u.didChange(e.openDocuments)&&(d.removed=u.change.removed),!0),"handleChange")}},(u,d)=>{if(this._store.isDisposed)return;let f=e.openDocuments.read(u);for(let h of f)h.primarySelectionLine.read(u);if(l){l=!1;for(let h of f)this._selectionSnapshots.set(h.id.uri,h.primarySelectionLine.get());return}for(let h of d.removed)this._selectionSnapshots.delete(h.id.uri);if(!(Date.now()-this._lastEditTime<200))for(let h of f){let m=h.id.uri,g=h.primarySelectionLine.get();if(this._selectionSnapshots.get(m)!==g){this._selectionSnapshots.set(m,g),this._onUserJump(m,g);return}}}))}scheduleIdleTimer(){this._idleScheduler?.schedule()}acquire(){this._disposalTracker.acquire()}release(){this._disposalTracker.release()}forceDispose(){this._store.dispose()}},C4r=class{static{a(this,"TelemetrySender")}constructor(e,r){this._workspace=e,this._telemetryService=r,this._map=new Map}scheduleSendingEnhancedTelemetry(e,r){let n=this._map.get(e);n&&(n.builder!==r&&n.builder.dispose(),this._removeEntry(e,n));let o=setTimeout(()=>{this._enterIdleDetection(e,r)},120*1e3);this._map.set(e,{builder:r,timeout:o})}_enterIdleDetection(e,r){let n=this._workspace;if(!n){this._buildAndSendEnhancedTelemetry(e,r,{reason:"idle",details:{idleTimeoutMs:0}});return}this._idleDetector?this._idleDetector.acquire():this._idleDetector=new v4r(n,l=>this._sendAllPendingInIdlePhase({reason:"idle",details:{idleTimeoutMs:l}}),(l,u)=>this._sendAllPendingInIdlePhaseWithJump(l,u)),this._idleDetector.scheduleIdleTimer();let o=3e4,s=setTimeout(()=>{this._sendForEntry(e,{reason:"hard_cap",details:{hardCapTimeoutMs:o}})},o),c=this._map.get(e);c&&(c.hardCapTimeout=s)}_releaseIdleDetector(){this._idleDetector?.release(),this._idleDetector?.isDisposed&&(this._idleDetector=void 0)}_sendAllPendingInIdlePhase(e){let r=[];for(let[n,o]of this._map)o.hardCapTimeout!==void 0&&r.push(n);for(let n of r)this._sendForEntry(n,e)}_sendAllPendingInIdlePhaseWithJump(e,r){let n=[];for(let[o,s]of this._map)s.hardCapTimeout!==void 0&&n.push([o,s.builder]);for(let[o,s]of n){let c=s.doc?.id.uri,l=s.nesBuilder.originalSelectionLine,u=c!==void 0&&l!==void 0?{file:c,line:l}:void 0;this._sendForEntry(o,{reason:"user_jump",details:{from:u,to:{file:e,line:r}}})}}_sendForEntry(e,r){let n=this._map.get(e);if(!n)return;n.hardCapTimeout!==void 0&&(clearTimeout(n.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e);let o;try{o=n.builder.build(!0)}finally{n.builder.dispose()}this._doSendEnhancedTelemetry(o,r)}_removeEntry(e,r){clearTimeout(r.timeout),r.hardCapTimeout!==void 0&&(clearTimeout(r.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e)}_buildAndSendEnhancedTelemetry(e,r,n){let o;this._map.delete(e);try{o=r.build(!0)}finally{r.dispose()}this._doSendEnhancedTelemetry(o,n)}sendTelemetry(e,r){if(e){let o=this._map.get(e);o&&this._removeEntry(e,o)}let n=r.build(!0);r.isSent||(this._doSendTelemetry(n),r.markAsSent()),this._doSendEnhancedTelemetry(n,void 0)}sendTelemetryForBuilder(e){if(e.isSent)return;let r=e.build(!1);this._doSendTelemetry(r),e.markAsSent()}async _doSendTelemetry(e){let{opportunityId:r,headerRequestId:n,requestN:o,providerId:s,modelName:c,hadStatelessNextEditProviderCall:l,statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:f,reusedRequest:h,subsequentEditOrder:m,sourcePatchIndex:g,activeDocumentLanguageId:A,activeDocumentOriginalLineCount:y,nLinesOfCurrentFileInPrompt:_,wasPreviouslyRejected:E,isShown:v,isNotebook:S,notebookType:T,isNESForAnotherDoc:w,isActiveDocument:R,isEolDifferent:x,isMultilineEdit:k,suggestionLineDistanceToCursor:D,isNextEditorRangeVisible:N,isNextEditorVisible:O,acceptance:B,disposalReason:q,logProbThreshold:M,documentsCount:L,editsCount:U,activeDocumentEditsCount:j,promptLineCount:Q,promptCharCount:Y,hadLowLogProbSuggestion:W,nEditsSuggested:V,lineDistanceToMostRecentEdit:z,isCursorAtEndOfLine:ie,isInlineSuggestion:H,debounceTime:re,artificialDelay:le,hasNextEdit:Le,notebookCellMarkerCount:me,notebookCellMarkerIndex:Oe,notebookId:Te,notebookCellLines:te,nextEditLogprob:ee,supersededByOpportunityId:K,noNextEditReasonKind:he,noNextEditReasonMessage:X,fetchStartedAfterMs:de,response:Be,configIsDiagnosticsNESEnabled:ne,isNaturalLanguageDominated:ue,diagnosticType:Ne,diagnosticDroppedReasons:xe,diagnosticHasExistingSameFileImport:Fe,diagnosticIsLocalImport:tt,diagnosticAlternativeImportsCount:st,diagnosticDistanceToUnknownDiagnostic:vt,diagnosticDistanceToAlternativeDiagnostic:Pt,diagnosticHasAlternativeDiagnosticForSameRange:Ht,hadDiagnosticsNES:F,hadLlmNES:se,pickedNES:be,xtabAggressivenessLevel:Ue,xtabUserHappinessScore:Qe,userAggressivenessSetting:ge,modelConfig:Z}=e,ve,Ge,qe,je;if(Be!==void 0){let{response:J,ttft:ae,fetchResult:Ce,fetchTime:Re}=await Be;J.type===$Qi.ChatFetchResponseType.Success&&(ve=J.usage),Ge=ae,qe=Ce,je=Re}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:A,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:B,disposalReason:q,supersededByOpportunityId:K,noNextEditReasonKind:he,noNextEditReasonMessage:X,fetchResult:qe,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:Ne,diagnosticDroppedReasons:xe,pickedNES:be,notebookType:T,notebookId:Te,notebookCellLines:te,nextCursorLineError:e.nextCursorPrediction?.nextCursorLineError,xtabAggressivenessLevel:Ue,userAggressivenessSetting:ge,modelConfig:Z,neighborSnippetIndicesInPrompt:e.neighborSnippetIndicesInPrompt},{requestN:o,hadStatelessNextEditProviderCall:this._boolToNum(l),statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:this._boolToNum(f),subsequentEditOrder:m,sourcePatchIndex:g,activeDocumentOriginalLineCount:y,activeDocumentNLinesInPrompt:_,wasPreviouslyRejected:this._boolToNum(E),isShown:this._boolToNum(v),isNotebook:this._boolToNum(S),isNESForAnotherDoc:this._boolToNum(w),isActiveDocument:this._boolToNum(R),isEolDifferent:this._boolToNum(x),isMultilineEdit:this._boolToNum(k),suggestionLineDistanceToCursor:D,isNextEditorRangeVisible:this._boolToNum(N),isNextEditorVisible:this._boolToNum(O),hasNotebookCellMarker:me>0?1:0,notebookCellMarkerCount:me,notebookCellMarkerIndex:Oe,logProbThreshold:M,documentsCount:L,editsCount:U,activeDocumentEditsCount:j,promptLineCount:Q,promptCharCount:Y,hadLowLogProbSuggestion:this._boolToNum(W),nEditsSuggested:V,lineDistanceToMostRecentEdit:z,isCursorAtEndOfLine:this._boolToNum(ie),isInlineSuggestion:this._boolToNum(H),debounceTime:re,artificialDelay:le,fetchStartedAfterMs:de,ttft:Ge,fetchTime:je,promptTokens:ve?.prompt_tokens,responseTokens:ve?.completion_tokens,cachedTokens:ve?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:ve?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:ve?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(Le),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:ee,hadDiagnosticsNES:this._boolToNum(F),hadLlmNES:this._boolToNum(se),configIsDiagnosticsNESEnabled:this._boolToNum(ne),isNaturalLanguageDominated:this._boolToNum(ue),diagnosticHasExistingSameFileImport:this._boolToNum(Fe),diagnosticIsLocalImport:this._boolToNum(tt),diagnosticAlternativeImportsCount:st,diagnosticDistanceToUnknownDiagnostic:vt,diagnosticDistanceToAlternativeDiagnostic:Pt,diagnosticHasAlternativeDiagnosticForSameRange:this._boolToNum(Ht),nextCursorLineDistance:e.nextCursorPrediction?.nextCursorLineDistance,xtabUserHappinessScore:Qe,nDiffsInPrompt:e.nDiffsInPrompt,promptSectionTokensSystemPrompt:e.promptSectionTokens?.systemPrompt,promptSectionTokensRecentlyViewed:e.promptSectionTokens?.recentlyViewed,promptSubsectionTokensRecentlyViewedFiles:e.promptSectionTokens?.recentlyViewedSubsections.recentlyViewedFiles,promptSubsectionTokensLanguageContext:e.promptSectionTokens?.recentlyViewedSubsections.languageContext,promptSubsectionTokensNeighborFiles:e.promptSectionTokens?.recentlyViewedSubsections.neighborFiles,promptSectionTokensCurrentFile:e.promptSectionTokens?.currentFile,promptSectionTokensLintErrors:e.promptSectionTokens?.lintErrors,promptSectionTokensEditHistory:e.promptSectionTokens?.editHistory,promptSectionTokensAreaAroundCodeToEdit:e.promptSectionTokens?.areaAroundCodeToEdit,promptSectionTokensCursorLocation:e.promptSectionTokens?.cursorLocation,promptSectionTokensRelatedInformation:e.promptSectionTokens?.relatedInformation,promptSectionTokensPostScript:e.promptSectionTokens?.postScript,userPromptOverheadTokens:e.promptSectionTokens?.overhead,userPromptTotalTokens:e.promptSectionTokens?.userPromptTotal,nNeighborSnippetsComputed:e.nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:e.nNeighborSnippetsInPrompt})}_sendTelemetryToBoth(e,r){this._telemetryService.sendMSFTTelemetryEvent("provideInlineEdit",e,r),this._telemetryService.sendGHTelemetryEvent(Hg.NES_GH_TELEMETRY_EVENT_NAME,e,r)}async _doSendEnhancedTelemetry(e,r){let{opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,status:l,modelName:u,prompt:d,response:f,alternativeAction:h,postProcessingOutcome:m,activeDocumentRepository:g,repositoryUrls:A,cursorJumpModelName:y,cursorJumpPrompt:_,cursorJumpResponse:E,lintErrors:v,terminalOutput:S,similarFilesContext:T,modelConfig:w,isFromCache:R}=e,x=f===void 0?f:await f,k=await T?.catch(()=>{}),D=x?.fetchResult;this._telemetryService.sendEnhancedGHTelemetryEvent(Hg.NES_GH_TELEMETRY_EVENT_NAME,(0,YQi.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==$Qi.ChatFetchResponseType.Success?void 0:x.response.value,fetchResult:D,alternativeAction:h?JSON.stringify({...h,enhancedTelemetrySendingReason:r}):void 0,enhancedTelemetrySendingReason:!h&&r?JSON.stringify(r):void 0,postProcessingOutcome:m,activeDocumentRepository:g,repositories:JSON.stringify(A),cursorJumpModelName:y,cursorJumpPrompt:_,cursorJumpResponse:E,lintErrors:v,terminalOutput:S,similarFilesContext:k,modelConfig:w}),{isFromCache:this._boolToNum(R)})}_boolToNum(e){return e===void 0?void 0:e?1:0}dispose(){for(let e of this._map.values())clearTimeout(e.timeout),e.hardCapTimeout!==void 0&&clearTimeout(e.hardCapTimeout),e.builder.dispose();this._map.clear(),this._idleDetector&&(this._idleDetector.forceDispose(),this._idleDetector=void 0)}};Hg.TelemetrySender=C4r;Hg.TelemetrySender=C4r=DSc([NSc(1,YQi.ITelemetryService)],C4r)});var S4r=I(V_e=>{"use strict";p();Object.defineProperty(V_e,"__esModule",{value:!0});V_e.NullPowerService=V_e.IPowerService=void 0;var JQi=Fc(),FSc=Ks();V_e.IPowerService=(0,FSc.createDecorator)("IPowerService");var b4r=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=JQi.Event.None,this.onDidResume=JQi.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};V_e.NullPowerService=b4r});var LU=I(jV=>{"use strict";p();Object.defineProperty(jV,"__esModule",{value:!0});jV.FetchStreamRecorder=jV.FetchStreamSource=jV.IChatMLFetcher=void 0;var USc=an(),QSc=pl();jV.IChatMLFetcher=(0,USc.createServiceIdentifier)("IChatMLFetcher");var T4r=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new QSc.AsyncIterableSource,this._seenAnnotationTypes=new Set}pause(){this._paused??=[]}unpause(){let e=this._paused;if(e){this._paused=void 0;for(let r of e)r?this.update(r.text,r.delta):this.resolve()}}update(e,r){if(this._paused){this._paused.push({text:e,delta:r});return}r.codeVulnAnnotations&&(!((e.match(/(^|\n)```/g)?.length??0)%2===1)||e.match(/(^|\n)```\w*\s*$/))&&(r.codeVulnAnnotations=void 0),r.codeVulnAnnotations&&(r.codeVulnAnnotations=r.codeVulnAnnotations.filter(n=>!this._seenAnnotationTypes.has(n.details.type)),r.codeVulnAnnotations.forEach(n=>this._seenAnnotationTypes.add(n.details.type))),this._stream.emitOne({delta:r})}resolve(){if(this._paused){this._paused.push(void 0);return}this._stream.resolve()}reject(e){this._paused=void 0,this._stream.reject(e)}};jV.FetchStreamSource=T4r;var I4r=class{static{a(this,"FetchStreamRecorder")}get firstTokenEmittedTime(){return this._firstTokenEmittedTime}get outputChunkGapsMs(){return this._outputChunkGapsMs}constructor(e){this.deltas=[],this._outputChunkGapsMs=[],this.callback=async(r,n,o)=>{if(!!(o.text||o.beginToolCalls||typeof o.thinking?.text=="string"&&o.thinking?.text||o.thinking?.text?.length||o.copilotToolCalls||o.copilotToolCallStreamUpdates)){let l=Date.now();this._firstTokenEmittedTime===void 0?this._firstTokenEmittedTime=l:this._lastOutputChunkTime!==void 0&&this._outputChunkGapsMs.push(l-this._lastOutputChunkTime),this._lastOutputChunkTime=l}let c=e?await e(r,n,o):void 0;return this.deltas.push(o),c}}};jV.FetchStreamRecorder=I4r});var x4r=I(sSt=>{"use strict";p();Object.defineProperty(sSt,"__esModule",{value:!0});sSt.IChatQuotaService=void 0;var qSc=an();sSt.IChatQuotaService=(0,qSc.createServiceIdentifier)("IChatQuotaService")});var w4r=I(aSt=>{"use strict";p();Object.defineProperty(aSt,"__esModule",{value:!0});aSt.IConversationOptions=void 0;var jSc=an();aSt.IConversationOptions=(0,jSc.createServiceIdentifier)("ConversationOptions")});var $3e=I(W_e=>{"use strict";p();Object.defineProperty(W_e,"__esModule",{value:!0});W_e.getTextPart=GSc;W_e.toTextPart=ZQi;W_e.toTextParts=$Sc;W_e.roleToString=VSc;var Pie=wo(),HSc=pd();function GSc(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===Pie.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===Pie.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a(GSc,"getTextPart");function ZQi(t){return{type:Pie.Raw.ChatCompletionContentPartKind.Text,text:t}}a(ZQi,"toTextPart");function $Sc(t){return[ZQi(t)]}a($Sc,"toTextParts");function VSc(t){switch(t){case Pie.Raw.ChatRole.System:return"system";case Pie.Raw.ChatRole.User:return"user";case Pie.Raw.ChatRole.Assistant:return"assistant";case Pie.Raw.ChatRole.Tool:return"tool";default:(0,HSc.assertNever)(t,`unknown role (${t})`)}}a(VSc,"roleToString")});var k4r=I(z_e=>{"use strict";p();Object.defineProperty(z_e,"__esModule",{value:!0});z_e.InteractionService=z_e.IInteractionService=void 0;var WSc=an(),XQi=Og();z_e.IInteractionService=(0,WSc.createServiceIdentifier)("IInteractionService");var R4r=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,XQi.generateUuid)()}startInteraction(){this._interactionId=(0,XQi.generateUuid)()}get interactionId(){return this._interactionId}};z_e.InteractionService=R4r});var D4r=I(cSt=>{"use strict";p();Object.defineProperty(cSt,"__esModule",{value:!0});cSt.SSEParser=void 0;var P4r=class{static{a(this,"SSEParser")}constructor(e){this.dataBuffer="",this.eventTypeBuffer="",this.buffer=[],this.endedOnCR=!1,this.onEventHandler=e,this.decoder=new TextDecoder("utf-8")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let r=0;for(this.endedOnCR&&e[0]===10&&r++,this.endedOnCR=!1;r{"use strict";p();Object.defineProperty(YL,"__esModule",{value:!0});YL.PendingLoggedChatRequest=YL.IRequestLogger=YL.ChatRequestScheme=void 0;YL.resolveMarkdownContent=PCc;YL.resolveMarkdownIcon=DCc;var U7i=gk(),RCc=an(),kCc=Id(),I5r=class t{static{a(this,"ChatRequestScheme")}static{this.chatRequestScheme="ccreq"}static buildUri(e,r="markdown"){let n;return r==="markdown"?n="copilotmd":r==="json"?n="json":n="request.json",e.kind==="latest"?`${t.chatRequestScheme}:latest.${n}`:`${t.chatRequestScheme}:${e.id}.${n}`}static parseUri(e){if(e===this.buildUri({kind:"latest"},"markdown"))return{data:{kind:"latest"},format:"markdown"};if(e===this.buildUri({kind:"latest"},"json"))return{data:{kind:"latest"},format:"json"};if(e===this.buildUri({kind:"latest"},"rawrequest"))return{data:{kind:"latest"},format:"rawrequest"};let r=e.match(/ccreq:([^\s]+)\.copilotmd/);if(r)return{data:{kind:"request",id:r[1]},format:"markdown"};let n=e.match(/ccreq:([^\s]+)\.request\.json/);if(n)return{data:{kind:"request",id:n[1]},format:"rawrequest"};let o=e.match(/ccreq:([^\s]+)\.json/);if(o)return{data:{kind:"request",id:o[1]},format:"json"}}static findAllUris(e){let r=/(ccreq:[^\s]+\.(copilotmd|json|request\.json))/g;return[...e.matchAll(r)].map(n=>{let o=n[1];return{uri:o,range:new kCc.OffsetRange(n.index,n.index+o.length)}})}};YL.ChatRequestScheme=I5r;YL.IRequestLogger=(0,RCc.createServiceIdentifier)("IRequestLogger");function PCc(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(PCc,"resolveMarkdownContent");function DCc(t){return typeof t.icon=="function"?t.icon():t.icon}a(DCc,"resolveMarkdownIcon");var x5r=class{static{a(this,"AbstractPendingLoggedRequest")}constructor(e,r,n,o){this._logbook=e,this._debugName=r,this._chatEndpoint=n,this._chatParams=o,this._timeToFirstToken=void 0,this._time=new Date}markTimeToFirstToken(e){this._timeToFirstToken=e}resolveWithCancelation(){this._logbook.addEntry({type:"ChatMLCancelation",debugName:this._debugName,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata})}},w5r=class extends x5r{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===U7i.ChatFetchResponseType.Success?this._logbook.addEntry({type:"ChatMLSuccess",debugName:this._debugName,usage:e.usage,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,timeToFirstToken:this._timeToFirstToken,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata,result:e,deltas:r}):this._logbook.addEntry({type:e.type===U7i.ChatFetchResponseType.Canceled?"ChatMLCancelation":"ChatMLFailure",debugName:this._debugName,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,timeToFirstToken:this._timeToFirstToken,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata,result:e})}};YL.PendingLoggedChatRequest=w5r});var k5r=I(L_e=>{"use strict";p();Object.defineProperty(L_e,"__esModule",{value:!0});L_e.NullSnippyService=L_e.ISnippyService=void 0;var NCc=an();L_e.ISnippyService=(0,NCc.createServiceIdentifier)("ISnippyService");var R5r=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};L_e.NullSnippyService=R5r});var N5r=I(B_e=>{"use strict";p();Object.defineProperty(B_e,"__esModule",{value:!0});B_e.MovedText=B_e.LinesDiff=void 0;var P5r=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};B_e.LinesDiff=P5r;var D5r=class t{static{a(this,"MovedText")}constructor(e,r){this.lineRangeMapping=e,this.changes=r}flip(){return new t(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}};B_e.MovedText=D5r});var wbt=I(BN=>{"use strict";p();Object.defineProperty(BN,"__esModule",{value:!0});BN.RangeMapping=BN.DetailedLineRangeMapping=BN.LineRangeMapping=void 0;BN.lineRangeMappingFromRangeMappings=OCc;BN.getLineRangeMapping=H7i;BN.lineRangeMappingFromChange=LCc;var MCc=Ml(),Q7i=pd(),xbt=Os(),US=vD(),LN=iv(),KL=uh(),j7i=rLe(),R3e=class t{static{a(this,"LineRangeMapping")}static inverse(e,r,n){let o=[],s=1,c=1;for(let u of e){let d=new t(new US.LineRange(s,u.original.startLineNumber),new US.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new US.LineRange(s,r+1),new US.LineRange(c,n+1));return l.modified.isEmpty||o.push(l),o}static clip(e,r,n){let o=[];for(let s of e){let c=s.original.intersect(r),l=s.modified.intersect(n);c&&!c.isEmpty&&l&&!l.isEmpty&&o.push(new t(c,l))}return o}constructor(e,r){this.original=e,this.modified=r}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new t(this.modified,this.original)}join(e){return new t(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),r=this.modified.toInclusiveRange();if(e&&r)return new OU(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new xbt.BugIndicatingError("not a valid diff");return new OU(new KL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new KL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new OU(new KL.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new KL.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(q7i(this.original.endLineNumberExclusive,e)&&q7i(this.modified.endLineNumberExclusive,r))return new OU(new KL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new KL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new OU(KL.Range.fromPositions(new LN.Position(this.original.startLineNumber,1),F_e(new LN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),KL.Range.fromPositions(new LN.Position(this.modified.startLineNumber,1),F_e(new LN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new OU(KL.Range.fromPositions(F_e(new LN.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),F_e(new LN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),KL.Range.fromPositions(F_e(new LN.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),F_e(new LN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new xbt.BugIndicatingError}};BN.LineRangeMapping=R3e;function F_e(t,e){if(t.lineNumber<1)return new LN.Position(1,1);if(t.lineNumber>e.length)return new LN.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new LN.Position(t.lineNumber,r.length+1):t}a(F_e,"normalizePosition");function q7i(t,e){return t>=1&&t<=e.length}a(q7i,"isValidLineNumber");var k3e=class t extends R3e{static{a(this,"DetailedLineRangeMapping")}static toTextEdit(e,r){let n=[];for(let o of e)for(let s of o.innerChanges??[]){let c=s.toTextEdit(r);n.push(c)}return new j7i.TextEdit(n)}static fromRangeMappings(e){let r=US.LineRange.join(e.map(o=>US.LineRange.fromRangeInclusive(o.originalRange))),n=US.LineRange.join(e.map(o=>US.LineRange.fromRangeInclusive(o.modifiedRange)));return new t(r,n,e)}constructor(e,r,n){super(e,r),this.innerChanges=n}flip(){return new t(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new t(this.original,this.modified,[this.toRangeMapping()])}};BN.DetailedLineRangeMapping=k3e;var OU=class t{static{a(this,"RangeMapping")}static fromEdit(e){let r=e.getNewRanges();return e.replacements.map((o,s)=>new t(o.range,r[s]))}static fromEditJoin(e){let r=e.getNewRanges(),n=e.replacements.map((o,s)=>new t(o.range,r[s]));return t.join(n)}static join(e){if(e.length===0)throw new xbt.BugIndicatingError("Cannot join an empty list of range mappings");let r=e[0];for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new t(this.modifiedRange,this.originalRange)}toTextEdit(e){let r=e.getValueOfRange(this.modifiedRange);return new j7i.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};BN.RangeMapping=OU;function OCc(t,e,r,n=!1){let o=[];for(let s of(0,MCc.groupAdjacentBy)(t.map(c=>H7i(c,e,r)),(c,l)=>c.original.intersectsOrTouches(l.original)||c.modified.intersectsOrTouches(l.modified))){let c=s[0],l=s[s.length-1];o.push(new k3e(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,Q7i.assertFn)(()=>!n&&o.length>0&&(o[0].modified.startLineNumber!==o[0].original.startLineNumber||r.length.lineCount-o[o.length-1].modified.endLineNumberExclusive!==e.length.lineCount-o[o.length-1].original.endLineNumberExclusive)?!1:(0,Q7i.checkAdjacentItems)(o,(s,c)=>c.original.startLineNumber-s.original.endLineNumberExclusive===c.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive=r.getLineLength(t.modifiedRange.startLineNumber)&&t.originalRange.startColumn-1>=e.getLineLength(t.originalRange.startLineNumber)&&t.originalRange.startLineNumber<=t.originalRange.endLineNumber+o&&t.modifiedRange.startLineNumber<=t.modifiedRange.endLineNumber+o&&(n=1);let s=new US.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new US.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new k3e(s,c,[t])}a(H7i,"getLineRangeMapping");function LCc(t){let e;t.originalEndLineNumber===0?e=new US.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new US.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new US.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new US.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new R3e(e,r)}a(LCc,"lineRangeMappingFromChange")});var Q_e=I(Ak=>{"use strict";p();Object.defineProperty(Ak,"__esModule",{value:!0});Ak.DateTimeout=Ak.InfiniteTimeout=Ak.OffsetPair=Ak.SequenceDiff=Ak.DiffAlgorithmResult=void 0;var BCc=Ml(),G7i=Os(),U_e=Id(),M5r=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new P3e(U_e.OffsetRange.ofLength(e.length),U_e.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new P3e(U_e.OffsetRange.ofLength(e.length),U_e.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};Ak.DiffAlgorithmResult=M5r;var P3e=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,BCc.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():Iie.zero,s?s.getStarts():new Iie(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new U_e.OffsetRange(e.offset1,r.offset1),new U_e.OffsetRange(e.offset2,r.offset2))}static assertSorted(e){let r;for(let n of e){if(r&&!(r.seq1Range.endExclusive<=n.seq1Range.start&&r.seq2Range.endExclusive<=n.seq2Range.start))throw new G7i.BugIndicatingError("Sequence diffs must be sorted");r=n}}constructor(e,r){this.seq1Range=e,this.seq2Range=r}swap(){return new t(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new t(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new t(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new t(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new t(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersectsOrTouches(e){return this.seq1Range.intersectsOrTouches(e.seq1Range)||this.seq2Range.intersectsOrTouches(e.seq2Range)}intersect(e){let r=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!r||!n))return new t(r,n)}getStarts(){return new Iie(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Iie(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};Ak.SequenceDiff=P3e;var Iie=class t{static{a(this,"OffsetPair")}static{this.zero=new t(0,0)}static{this.max=new t(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}constructor(e,r){this.offset1=e,this.offset2=r}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new t(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};Ak.OffsetPair=Iie;var O5r=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};Ak.InfiniteTimeout=O5r;var L5r=class{static{a(this,"DateTimeout")}constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new G7i.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime!0,this.valid=!0}};Ak.DateTimeout=L5r});var Rbt=I(xie=>{"use strict";p();Object.defineProperty(xie,"__esModule",{value:!0});xie.LineRangeFragment=xie.Array2D=void 0;xie.isSpace=FCc;var B5r=class{static{a(this,"Array2D")}constructor(e,r){this.width=e,this.height=r,this.array=[],this.array=new Array(e*r)}get(e,r){return this.array[e+r*this.width]}set(e,r,n){this.array[e+r*this.width]=n}};xie.Array2D=B5r;function FCc(t){return t===32||t===9}a(FCc,"isSpace");var F5r=class t{static{a(this,"LineRangeFragment")}static{this.chrKeys=new Map}static getKey(e){let r=this.chrKeys.get(e);return r===void 0&&(r=this.chrKeys.size,this.chrKeys.set(e,r)),r}constructor(e,r,n){this.range=e,this.lines=r,this.source=n,this.histogram=[];let o=0;for(let s=e.startLineNumber-1;s{"use strict";p();Object.defineProperty(kbt,"__esModule",{value:!0});kbt.DynamicProgrammingDiffing=void 0;var $7i=Id(),D3e=Q_e(),U5r=Rbt(),Q5r=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=D3e.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return D3e.DiffAlgorithmResult.trivial(e,r);let s=new U5r.Array2D(e.length,r.length),c=new U5r.Array2D(e.length,r.length),l=new U5r.Array2D(e.length,r.length);for(let A=0;A0&&y>0&&c.get(A-1,y-1)===3&&(v+=l.get(A-1,y-1)),v+=o?o(A,y):1):v=-1;let S=Math.max(_,E,v);if(S===v){let T=A>0&&y>0?l.get(A-1,y-1):0;l.set(A,y,T+1),c.set(A,y,3)}else S===_?(l.set(A,y,0),c.set(A,y,1)):S===E&&(l.set(A,y,0),c.set(A,y,2));s.set(A,y,S)}let u=[],d=e.length,f=r.length;function h(A,y){(A+1!==d||y+1!==f)&&u.push(new D3e.SequenceDiff(new $7i.OffsetRange(A+1,d),new $7i.OffsetRange(y+1,f))),d=A,f=y}a(h,"reportDecreasingAligningPositions");let m=e.length-1,g=r.length-1;for(;m>=0&&g>=0;)c.get(m,g)===3?(h(m,g),m--,g--):c.get(m,g)===1?m--:g--;return h(-1,-1),u.reverse(),new D3e.DiffAlgorithmResult(u,!1)}};kbt.DynamicProgrammingDiffing=Q5r});var G5r=I(Dbt=>{"use strict";p();Object.defineProperty(Dbt,"__esModule",{value:!0});Dbt.MyersDiffAlgorithm=void 0;var W7i=Id(),N3e=Q_e(),q5r=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=N3e.InfiniteTimeout.instance){if(e.length===0||r.length===0)return N3e.DiffAlgorithmResult.trivial(e,r);let o=e,s=r;function c(y,_){for(;yo.length||w>s.length)continue;let R=c(T,w);u.set(f,R);let x=T===v?d.get(f+1):d.get(f-1);if(d.set(f,R!==T?new Pbt(x,T,w,R-T):x),u.get(f)===o.length&&u.get(f)-f===s.length)break e}}let h=d.get(f),m=[],g=o.length,A=s.length;for(;;){let y=h?h.x+h.length:0,_=h?h.y+h.length:0;if((y!==g||_!==A)&&m.push(new N3e.SequenceDiff(new W7i.OffsetRange(y,g),new W7i.OffsetRange(_,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new N3e.DiffAlgorithmResult(m,!1)}};Dbt.MyersDiffAlgorithm=q5r;var Pbt=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},j5r=class{static{a(this,"FastInt32Array")}constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,r){if(e<0){if(e=-e-1,e>=this.negativeArr.length){let n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=r}else{if(e>=this.positiveArr.length){let n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=r}}},H5r=class{static{a(this,"FastArrayNegativeIndices")}constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,r){e<0?(e=-e-1,this.negativeArr[e]=r):this.positiveArr[e]=r}}});var W5r=I(Mbt=>{"use strict";p();Object.defineProperty(Mbt,"__esModule",{value:!0});Mbt.LinesSliceCharSequence=void 0;var $5r=dj(),Nbt=Id(),UCc=iv(),z7i=uh(),QCc=Rbt(),V5r=class{static{a(this,"LinesSliceCharSequence")}constructor(e,r,n){this.lines=e,this.range=r,this.considerWhitespaceChanges=n,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let o=this.range.startLineNumber;o<=this.range.endLineNumber;o++){let s=e[o-1],c=0;o===this.range.startLineNumber&&this.range.startColumn>1&&(c=this.range.startColumn-1,s=s.substring(c)),this.lineStartOffsets.push(c);let l=0;if(!n){let d=s.trimStart();l=s.length-d.length,s=d.trimEnd()}this.trimmedWsLengthsByLineIdx.push(l);let u=o===this.range.endLineNumber?Math.min(this.range.endColumn-1-c-l,s.length):s.length;for(let d=0;dString.fromCharCode(r)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){let r=J7i(e>0?this.elements[e-1]:-1),n=J7i(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new UCc.Position(this.range.startLineNumber+n,1+this.lineStartOffsets[n]+o+(o===0&&r==="left"?0:this.trimmedWsLengthsByLineIdx[n]))}translateRange(e){let r=this.translateOffset(e.start,"right"),n=this.translateOffset(e.endExclusive,"left");return n.isBefore(r)?z7i.Range.fromPositions(n,n):z7i.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!q_e(this.elements[e]))return;let r=e;for(;r>0&&q_e(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!q_e(this.elements[e]))return;let r=e;for(;r>0&&q_e(this.elements[r-1])&&!Y7i(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,$5r.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new Nbt.OffsetRange(r,n)}};Mbt.LinesSliceCharSequence=V5r;function q_e(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(q_e,"isWordChar");function Y7i(t){return t>=65&&t<=90}a(Y7i,"isUpperCase");var qCc={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function K7i(t){return qCc[t]}a(K7i,"getCategoryBoundaryScore");function J7i(t){return t===10?8:t===13?7:(0,QCc.isSpace)(t)?6:t>=97&&t<=122?0:t>=65&&t<=90?1:t>=48&&t<=57?2:t===-1?3:t===44||t===59?5:4}a(J7i,"getCategory")});var tQi=I(z5r=>{"use strict";p();Object.defineProperty(z5r,"__esModule",{value:!0});z5r.computeMovedLines=$Cc;var jCc=Q_e(),Obt=wbt(),JL=Ml(),M3e=dj(),HCc=b2(),QS=vD(),Z7i=W5r(),Lbt=Rbt(),GCc=G5r(),X7i=uh();function $Cc(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=WCc(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=zCc(u,n,o,e,r,s);return(0,JL.pushMany)(c,d),c=YCc(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` +`).length>=15&&VCc(h,g=>g.length>=2)>=2}),c=KCc(t,c),c}a($Cc,"computeMovedLines");function VCc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(VCc,"countWhere");function WCc(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new Lbt.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new Lbt.LineRangeFragment(u.modified,r,u))),l=new Set;for(let u of s){let d=-1,f;for(let h of c){let m=u.computeSimilarity(h);m>d&&(d=m,f=h)}if(d>.9&&f&&(c.delete(f),o.push(new Obt.LineRangeMapping(u.range,f.range)),l.add(u.source),l.add(f.source)),!n.isValid())return{moves:o,excludedChanges:l}}return{moves:o,excludedChanges:l}}a(WCc,"computeMovesFromSimpleDeletionsToSimpleInsertions");function zCc(t,e,r,n,o,s){let c=[],l=new HCc.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,JL.numberComparator));for(let m of t){let g=[];for(let A=m.modified.startLineNumber;A{for(let T of g)if(T.originalLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive&&T.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){T.originalLineRange=new QS.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new QS.LineRange(T.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),E.push(T);return}let S={modifiedLineRange:_,originalLineRange:v};u.push(S),E.push(S)}),g=E}if(!s.isValid())return[]}u.sort((0,JL.reverseOrder)((0,JL.compareBy)(m=>m.modifiedLineRange.length,JL.numberComparator)));let d=new QS.LineRangeSet,f=new QS.LineRangeSet;for(let m of u){let g=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,A=d.subtractFrom(m.modifiedLineRange),y=f.subtractFrom(m.originalLineRange).getWithDelta(g),_=A.getIntersection(y);for(let E of _.ranges){if(E.length<3)continue;let v=E,S=E.delta(-g);c.push(new Obt.LineRangeMapping(S,v)),d.addRange(v),f.addRange(S)}}c.sort((0,JL.compareBy)(m=>m.original.startLineNumber,JL.numberComparator));let h=new M3e.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,M3e.findLastMonotonous)(t,R=>R.modified.startLineNumber<=g.modified.startLineNumber),_=Math.max(g.original.startLineNumber-A.original.startLineNumber,g.modified.startLineNumber-y.modified.startLineNumber),E=h.findLastMonotonous(R=>R.original.startLineNumberR.modified.startLineNumbern.length||x>o.length||d.contains(x)||f.contains(R)||!eQi(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new QS.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new QS.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!eQi(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new QS.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new QS.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new Obt.LineRangeMapping(new QS.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new QS.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(zCc,"computeUnchangedMoves");function eQi(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new GCc.MyersDiffAlgorithm().compute(new Z7i.LinesSliceCharSequence([t],new X7i.Range(1,1,1,t.length),!1),new Z7i.LinesSliceCharSequence([e],new X7i.Range(1,1,1,e.length),!1),r),s=0,c=jCc.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,Lbt.isSpace)(t.charCodeAt(h))||s++});function l(f){let h=0;for(let m=0;me.length?t:e);return s/u>.6&&u>10}a(eQi,"areLinesSimilar");function YCc(t){if(t.length===0)return t;t.sort((0,JL.compareBy)(r=>r.original.startLineNumber,JL.numberComparator));let e=[t[0]];for(let r=1;r=0&&c>=0&&s+c<=2){e[e.length-1]=n.join(o);continue}e.push(o)}return e}a(YCc,"joinCloseConsecutiveMoves");function KCc(t,e){let r=new M3e.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(wie,"__esModule",{value:!0});wie.optimizeSequenceDiffs=ZCc;wie.removeShortMatches=ebc;wie.extendDiffsToEntireWordIfAppropriate=tbc;wie.removeVeryShortMatchingLinesBetweenDiffs=nbc;wie.removeVeryShortMatchingTextBetweenLongDiffs=ibc;var JCc=Ml(),ZL=Id(),XL=Q_e();function ZCc(t,e,r){let n=r;return n=rQi(t,e,n),n=rQi(t,e,n),n=XCc(t,e,n),n}a(ZCc,"optimizeSequenceDiffs");function rQi(t,e,r){if(r.length===0)return r;let n=[];n.push(r[0]);for(let s=1;s0&&(l=l.delta(d))}o.push(l)}return n.length>0&&o.push(n[n.length-1]),o}a(rQi,"joinSequenceDiffsByShifting");function XCc(t,e,r){if(!t.getBoundaryScore||!e.getBoundaryScore)return r;for(let n=0;n0?r[n-1]:void 0,s=r[n],c=n+1=n.start&&t.seq2Range.start-c>=o.start&&r.isStronglyEqual(t.seq2Range.start-c,t.seq2Range.endExclusive-c)&&c<100;)c++;c--;let l=0;for(;t.seq1Range.start+ld&&(d=A,u=f)}return t.delta(u)}a(nQi,"shiftDiffToBetterPosition");function ebc(t,e,r){let n=[];for(let o of r){let s=n[n.length-1];if(!s){n.push(o);continue}o.seq1Range.start-s.seq1Range.endExclusive<=2||o.seq2Range.start-s.seq2Range.endExclusive<=2?n[n.length-1]=new XL.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(ebc,"removeShortMatches");function tbc(t,e,r,n,o=!1){let s=XL.SequenceDiff.invert(r,t.length),c=[],l=new XL.OffsetPair(0,0);function u(f,h){if(f.offset10;){let v=s[0];if(!(v.seq1Range.intersects(A.seq1Range)||v.seq2Range.intersects(A.seq2Range)))break;let T=n(t,v.seq1Range.start),w=n(e,v.seq2Range.start),R=new XL.SequenceDiff(T,w),x=R.intersect(v);if(_+=x.seq1Range.length,E+=x.seq2Range.length,A=A.join(R),A.seq1Range.endExclusive>=v.seq1Range.endExclusive)s.shift();else break}(o&&_+E0;){let f=s.shift();f.seq1Range.isEmpty||(u(f.getStarts(),f),u(f.getEndExclusives().delta(-1),f))}return rbc(r,c)}a(tbc,"extendDiffsToEntireWordIfAppropriate");function rbc(t,e){let r=[];for(;t.length>0||e.length>0;){let n=t[0],o=e[0],s;n&&(!o||n.seq1Range.start0&&r[r.length-1].seq1Range.endExclusive>=s.seq1Range.start?r[r.length-1]=r[r.length-1].join(s):r.push(s)}return r}a(rbc,"mergeSequenceDiffs");function nbc(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let c=[n[0]];for(let l=1;l5||g.seq1Range.length+g.seq2Range.length>5)};a(f,"shouldJoinDiffs");let u=n[l],d=c[c.length-1];f(d,u)?(s=!0,c[c.length-1]=c[c.length-1].join(u)):c.push(u)}n=c}while(o++<10&&s);return n}a(nbc,"removeVeryShortMatchingLinesBetweenDiffs");function ibc(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let l=[n[0]];for(let u=1;u5||y.length>500)return!1;let E=t.getText(y).trim();if(E.length>20||E.split(/\r\n|\r|\n/).length>1)return!1;let v=t.countLinesIn(g.seq1Range),S=g.seq1Range.length,T=e.countLinesIn(g.seq2Range),w=g.seq2Range.length,R=t.countLinesIn(A.seq1Range),x=A.seq1Range.length,k=e.countLinesIn(A.seq2Range),D=A.seq2Range.length,N=130;function O(B){return Math.min(B,N)}return a(O,"cap"),Math.pow(Math.pow(O(v*40+S),1.5)+Math.pow(O(T*40+w),1.5),1.5)+Math.pow(Math.pow(O(R*40+x),1.5)+Math.pow(O(k*40+D),1.5),1.5)>(N**1.5)**1.5*1.3};a(h,"shouldJoinDiffs");let d=n[u],f=l[l.length-1];h(f,d)?(s=!0,l[l.length-1]=l[l.length-1].join(d)):l.push(d)}n=l}while(o++<10&&s);let c=[];return(0,JCc.forEachWithNeighbors)(n,(l,u,d)=>{let f=u;function h(E){return E.length>0&&E.trim().length<=3&&u.seq1Range.length+u.seq2Range.length>100}a(h,"shouldMarkAsChanged");let m=t.extendToFullLines(u.seq1Range),g=t.getText(new ZL.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new ZL.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=XL.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():XL.OffsetPair.zero,d?d.getStarts():XL.OffsetPair.max),_=f.intersect(y);c.length>0&&_.getStarts().equals(c[c.length-1].getEndExclusives())?c[c.length-1]=c[c.length-1].join(_):c.push(_)}),c}a(ibc,"removeVeryShortMatchingTextBetweenLongDiffs")});var sQi=I(Bbt=>{"use strict";p();Object.defineProperty(Bbt,"__esModule",{value:!0});Bbt.LineSequence=void 0;var Y5r=class{static{a(this,"LineSequence")}constructor(e,r){this.trimmedHash=e,this.lines=r}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){let r=e===0?0:oQi(this.lines[e-1]),n=e===this.lines.length?0:oQi(this.lines[e]);return 1e3-(r+n)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` +`)}isStronglyEqual(e,r){return this.lines[e]===this.lines[r]}};Bbt.LineSequence=Y5r;function oQi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(qbt,"__esModule",{value:!0});qbt.DefaultLinesDiffComputer=void 0;var obc=Ml(),aQi=pd(),Qbt=vD(),cQi=Id(),lQi=uh(),Fbt=dI(),Ubt=N5r(),kie=wbt(),eB=Q_e(),sbc=V7i(),abc=G5r(),cbc=tQi(),Rie=iQi(),uQi=sQi(),dQi=W5r(),K5r=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new sbc.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new abc.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,obc.equals)(e,r,(x,k)=>x===k))return new Ubt.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new Ubt.LinesDiff([new kie.DetailedLineRangeMapping(new Qbt.LineRange(1,e.length+1),new Qbt.LineRange(1,r.length+1),[new kie.RangeMapping(new lQi.Range(1,1,e.length,e[e.length-1].length+1),new lQi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?eB.InfiniteTimeout.instance:new eB.DateTimeout(n.maxComputationTimeMs),s=!n.ignoreTrimWhitespace,c=new Map;function l(x){let k=c.get(x);return k===void 0&&(k=c.size,c.set(x,k)),k}a(l,"getOrCreateHash");let u=e.map(x=>l(x.trim())),d=r.map(x=>l(x.trim())),f=new uQi.LineSequence(u,e),h=new uQi.LineSequence(d,r),m=f.length+h.length<1700?this.dynamicProgrammingDiffing.compute(f,h,o,(x,k)=>e[x]===r[k]?r[k].length===0?.1:1+Math.log(1+r[k].length):.99):this.myersDiffingAlgorithm.compute(f,h,o),g=m.diffs,A=m.hitTimeout;g=(0,Rie.optimizeSequenceDiffs)(f,h,g),g=(0,Rie.removeVeryShortMatchingLinesBetweenDiffs)(f,h,g);let y=[],_=a(x=>{if(s)for(let k=0;kx.seq1Range.start-E===x.seq2Range.start-v);let k=x.seq1Range.start-E;_(k),E=x.seq1Range.endExclusive,v=x.seq2Range.endExclusive;let D=this.refineDiff(e,r,x,o,s,n);D.hitTimeout&&(A=!0);for(let N of D.mappings)y.push(N)}_(e.length-E);let S=new Fbt.ArrayText(e),T=new Fbt.ArrayText(r),w=(0,kie.lineRangeMappingFromRangeMappings)(y,S,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,aQi.assertFn)(()=>{function x(D,N){if(D.lineNumber<1||D.lineNumber>N.length)return!1;let O=N[D.lineNumber-1];return!(D.column<1||D.column>O.length+1)}a(x,"validatePosition");function k(D,N){return!(D.startLineNumber<1||D.startLineNumber>N.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>N.length+1)}a(k,"validateRange");for(let D of w){if(!D.innerChanges)return!1;for(let N of D.innerChanges)if(!(x(N.modifiedRange.getStartPosition(),r)&&x(N.modifiedRange.getEndPosition(),r)&&x(N.originalRange.getStartPosition(),e)&&x(N.originalRange.getEndPosition(),e)))return!1;if(!k(D.modified,r)||!k(D.original,e))return!1}return!0}),new Ubt.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,cbc.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new eB.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,kie.lineRangeMappingFromRangeMappings)(m.mappings,new Fbt.ArrayText(r),new Fbt.ArrayText(n),!0);return new Ubt.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=lbc(n).toRangeMapping2(e,r),d=new dQi.LinesSliceCharSequence(e,u.originalRange,s),f=new dQi.LinesSliceCharSequence(r,u.modifiedRange,s),h=d.length+f.length<500?this.dynamicProgrammingDiffing.compute(d,f,o):this.myersDiffingAlgorithm.compute(d,f,o),m=!1,g=h.diffs;m&&eB.SequenceDiff.assertSorted(g),g=(0,Rie.optimizeSequenceDiffs)(d,f,g),m&&eB.SequenceDiff.assertSorted(g),g=(0,Rie.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,_)=>y.findWordContaining(_)),m&&eB.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,Rie.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,_)=>y.findSubWordContaining(_),!0),m&&eB.SequenceDiff.assertSorted(g)),g=(0,Rie.removeShortMatches)(d,f,g),m&&eB.SequenceDiff.assertSorted(g),g=(0,Rie.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&eB.SequenceDiff.assertSorted(g);let A=g.map(y=>new kie.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&kie.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};qbt.DefaultLinesDiffComputer=K5r;function lbc(t){return new kie.LineRangeMapping(new Qbt.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new Qbt.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(lbc,"toLineRangeMapping")});var J5r=I(iC=>{"use strict";p();Object.defineProperty(iC,"__esModule",{value:!0});iC.EditDataWithIndex=iC.maxImperfectAgreementLength=iC.maxAgreementOffset=void 0;iC.tryRebase=hbc;iC.checkEditConsistency=pQi;iC.tryRebaseStringEdits=gbc;var ubc=ON(),dbc=gv(),fE=W_(),j_e=Id(),fQi=dI(),fbc=jbt(),pbc=!1;iC.maxAgreementOffset=10;iC.maxImperfectAgreementLength=5;var Hbt=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};iC.EditDataWithIndex=Hbt;function hbc(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:iC.maxImperfectAgreementLength}){let f=Date.now();try{return mbc(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${dbc.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(hbc,"tryRebase");function mbc(t,e,r,n,o,s,c,l,u,d){if(!pQi(t,o,s,u,!0))return"inconsistentEdits";let f=o.removeCommonSuffixAndPrefix(t),h=c[0];if(e&&h&&!f.applyToOffsetRangeOrUndefined(e)?.containsRange(h))return"outsideEditWindow";if(n.lengthfE.AnnotatedStringEdit.create(_))),g=hQi(t,m,f,l,d);if(!g)return"rebaseFailed";let A=g.replacements.reduce((_,E)=>((_[E.data.index]||=[]).push(E),_),[]),y=[];for(let _=0;_R>0?s.substring(x[R-1].replaceRange.endExclusive,w.replaceRange.start)+w.newText:w.newText).join(""),T=fE.StringReplacement.replace(v,S);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:_})}return l==="strict"&&y.length>0&&new ubc.SingleEdits(r).apply(t)!==fE.StringEdit.create(y.map(_=>_.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(mbc,"_tryRebase");function pQi(t,e,r,n,o=pbc){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(pQi,"checkEditConsistency");function gbc(t,e,r,n,o={maxImperfectAgreementLength:iC.maxImperfectAgreementLength}){return hQi(t,e.mapData(s=>new fE.VoidEditData),r,n,o)?.toStringEdit()}a(gbc,"tryRebaseStringEdits");function hQi(t,e,r,n,o){let s=r.removeCommonSuffixAndPrefix(t),c=[],l=0,u=0,d=0;for(;uf.replaceRange.start){let g=t.substring(f.replaceRange.start,m.replaceRange.start),A=g+m.newText;A.endsWith(g)&&(m=new fE.AnnotatedStringReplacement(j_e.OffsetRange.fromTo(f.replaceRange.start,m.replaceRange.endExclusive-g.length),A.substring(0,A.length-g.length),m.data))}else if(u===e.replacements.length-1&&m.replaceRange.endExclusive=f.newText.length){let g=0,A=0,y=f,_;for(;y&&m.replaceRange.containsRange(y.replaceRange);){if(A=Ebc(t,m,y,_,A,n,o),A===-1)return;g+=y.newText.length-y.replaceRange.length,_=y,y=s.replacements[++l]}c.push(new fE.AnnotatedStringReplacement(new j_e.OffsetRange(m.replaceRange.start+d,m.replaceRange.endExclusive+d+g),m.newText,m.data)),u++,d+=g}else if(o.reverseAgreement&&h.replaceRange.equals(f.replaceRange)){let g=0,A;for(;uiC.maxAgreementOffset||S-g>0&&v.length>o.maxImperfectAgreementLength);if(S!==-1&&!T){g=S+v.length,A=y,u++;continue}let w=f.newText.substring(g);if(w.length>0&&v.startsWith(w)){let R=Math.max(0,w.length-E.length),x=y.newText.substring(R);x.length>0&&c.push(new fE.AnnotatedStringReplacement(j_e.OffsetRange.emptyAt(f.replaceRange.start+d+f.newText.length),x,y.data)),g=f.newText.length,A=y,u++;break}return}if(g0&&!f.newText.substring(g).startsWith(_))return}l++,d+=f.newText.length-f.replaceRange.length}else return;else if(h.replaceRange.start",'""',"''","``"]);function _bc(t){return ybc.has(t)}a(_bc,"isAutoClosePair");function Ebc(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uiC.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&_bc(l)&&Abc(l,e.newText.substring(o))?o:-1}a(Ebc,"agreementIndexOf");function vbc(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new fbc.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new fQi.StringText(t),f=new fQi.StringText(e);return u.changes.map(h=>(h.innerChanges||[]).map(m=>{let g=d.getTransformer().getOffsetRange(m.originalRange),A=f.getValueOfRange(m.modifiedRange);return new fE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(vbc,"computeDiff")});var gQi=I(Gbt=>{"use strict";p();Object.defineProperty(Gbt,"__esModule",{value:!0});Gbt.RejectionCollector=void 0;var Cbc=W4(),mQi=Po(),bbc=bD(),Z5r=class extends mQi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new t4r(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,bbc.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new X5r(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,Cbc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},c=>{for(let l of c.value.changes)s.handleEdit(l,c.value.value)})),o.add((0,mQi.toDisposable)(()=>{this._documentCaches.delete(n.id)}))}).recomputeInitiallyAndOnChange(this._store)}reject(e,r){let n=this._documentCaches.get(e);if(!n){this._logger.trace(`Rejecting, no document cache: ${r}`);return}let o=r.removeCommonSuffixAndPrefix(n.doc.value.get().value);this._logger.trace(`Rejecting: ${o}`),n.reject(o)}isRejected(e,r){let n=this._documentCaches.get(e);if(!n)return this._logger.trace(`Checking rejection, no document cache: ${r}`),!1;let o=r.removeCommonSuffixAndPrefix(n.doc.value.get().value),s=n.isRejected(o);return this._logger.trace(`Checking rejection, ${s?"rejected":"not rejected"}: ${o}`),s}clear(){this._garbageCollector.clear()}};Gbt.RejectionCollector=Z5r;var X5r=class{static{a(this,"DocumentRejectionTracker")}constructor(e,r,n){this.doc=e,this._garbageCollector=r,this._logger=n,this._rejectedEdits=new Set}handleEdit(e,r){for(let n of[...this._rejectedEdits])n.handleEdit(e,r)}reject(e){if(this.isRejected(e))return;let r=new e4r(e.toEdit(),()=>{this._logger.trace(`Evicting: ${e}`),this._rejectedEdits.delete(r)});this._rejectedEdits.add(r),this._garbageCollector.put(r)}isRejected(e){for(let r of this._rejectedEdits)if(r.isRejected(e))return!0;return!1}},e4r=class{static{a(this,"RejectedEdit")}constructor(e,r){this._edit=e,this._onDispose=r}handleEdit(e,r){let n=this._edit.tryRebase(e);n?this._edit=n.removeCommonSuffixAndPrefix(r.value):this.dispose()}isRejected(e){return this._edit.equals(e.toEdit())}dispose(){this._onDispose()}},t4r=class{static{a(this,"LRUGarbageCollector")}constructor(e){this._maxSize=e,this._disposables=[]}put(e){this._disposables.push(e),this._disposables.length>this._maxSize&&this._disposables.shift().dispose()}clear(){for(let e of this._disposables)e.dispose();this._disposables=[]}dispose(){this.clear()}}});var AQi=I(Vbt=>{"use strict";p();Object.defineProperty(Vbt,"__esModule",{value:!0});Vbt.RebaseFailureInfo=void 0;var Sbc=W_(),r4r=class{static{a(this,"RebaseFailureInfo")}constructor(e,r,n,o,s,c,l){this.originalDocument=e,this.editWindow=r,this.originalEdits=n,this.userEditSince=o,this.currentDocument=s,this.currentSelection=c,this.nesRebaseConfigs=l}toMarkdown(){let e=[];e.push("### Original Document"),e.push("```"),e.push(this.originalDocument),e.push("```"),e.push(""),e.push("### Suggested Edits");for(let r=0;r0&&(e.push(""),e.push(`### Cursor: ${this.currentSelection.map(r=>r.toString()).join(", ")}`)),e.push(""),e.push("### Document Intended After Suggested Edits"),e.push("```");try{let r=new Sbc.StringEdit(this.originalEdits.slice()).apply(this.originalDocument);e.push(r)}catch{e.push("")}return e.push("```"),e.push(""),e.push("### Copy-Pasteable Test"),e.push("```typescript"),e.push(this._generateTest()),e.push("```"),e.join(` +`)}_generateTest(){let e=[];e.push("test('rebase failure (auto-generated)', () => {"),e.push(` const originalDocument = ${$bt(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${$bt(o.newText)}),`);e.push(" ];"),e.push(" const userEditSince = StringEdit.create([");for(let o of this.userEditSince.replacements)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${$bt(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${$bt(this.currentDocument)};`),this.editWindow?e.push(` const editWindow = new OffsetRange(${this.editWindow.start}, ${this.editWindow.endExclusive});`):e.push(" const editWindow = undefined;"),e.push(` const currentSelection = [${this.currentSelection.map(o=>`new OffsetRange(${o.start}, ${o.endExclusive})`).join(", ")}];`);let r=[];return this.nesRebaseConfigs.absorbSubsequenceTyping&&r.push(`absorbSubsequenceTyping: ${this.nesRebaseConfigs.absorbSubsequenceTyping}`),this.nesRebaseConfigs.reverseAgreement&&r.push(`reverseAgreement: ${this.nesRebaseConfigs.reverseAgreement}`),r.push(`maxImperfectAgreementLength: ${this.nesRebaseConfigs.maxImperfectAgreementLength}`),e.push(` const nesConfigs = { ${r.join(", ")} };`),e.push(""),e.push(" const logger = new TestLogService();"),e.push(" expect(userEditSince.apply(originalDocument)).toBe(currentDocumentContent);"),e.push(" expect(tryRebase(originalDocument, editWindow, originalEdits, [], userEditSince, currentDocumentContent, currentSelection, 'strict', logger, nesConfigs)).toMatchInlineSnapshot();"),e.push("});"),e.join(` +`)}};Vbt.RebaseFailureInfo=r4r;function $bt(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a($bt,"toBacktickLiteral")});var _Qi=I(zbt=>{"use strict";p();Object.defineProperty(zbt,"__esModule",{value:!0});zbt.NextEditCache=void 0;var O3e=Hl(),Tbc=W4(),Ibc=evt(),yQi=Po(),xbc=o6(),Wbt=J5r(),wbc=AQi(),n4r=class extends yQi.Disposable{static{a(this,"NextEditCache")}constructor(e,r,n,o){super(),this.workspace=e,this._logService=r,this._configService=n,this._expService=o,this._documentCaches=new Map,this._sharedCache=new Ibc.LRUCache(50),(0,xbc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new i4r(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,Tbc.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(O3e.ConfigKey.Advanced.InlineEditsTriggerOnEditorChangeAfterSeconds,this._expService)!==void 0)for(let[d,f]of this._sharedCache.entries())f.docId!==s.id&&this._sharedCache.deleteKey(d)})),c.add((0,yQi.toDisposable)(()=>{this._documentCaches.delete(s.id)}))}).recomputeInitiallyAndOnChange(this._store)}setKthNextEdit(e,r,n,o,s,c,l,u,d){let f=this._documentCaches.get(e);if(f)return f.setKthNextEdit(r,n,o,c,l,s,u,d)}setNoNextEdit(e,r,n,o,s){let c=this._documentCaches.get(e);c&&c.setNoNextEdit(r,n,o,s)}_getNesRebaseConfigs(){let e=this._configService.getExperimentBasedConfig(O3e.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(O3e.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(O3e.ConfigKey.TeamInternal.InlineEditsReverseAgreement,this._expService),maxImperfectAgreementLength:typeof e=="number"?Math.max(0,e):e}}lookupNextEdit(e,r,n){let o=this._documentCaches.get(e);if(!o)return;let s=this._configService.getExperimentBasedConfig(O3e.ConfigKey.TeamInternal.InlineEditsCacheCursorDistanceCheck,this._expService)??!1;return o.lookupNextEdit(r,n,this._getNesRebaseConfigs(),s)}tryRebaseCacheEntry(e,r,n){let o=this._documentCaches.get(e.docId);return o?o.tryRebaseCacheEntry(e,r,n,this._getNesRebaseConfigs()):{edit:void 0}}rejectedNextEdit(e){this._sharedCache.getValues().filter(r=>r.source.headerRequestId===e).forEach(r=>r.rejected=!0)}isRejectedNextEdit(e,r,n){let o=this._documentCaches.get(e);return o?o.isRejectedNextEdit(r,n):!1}evictedCachedEdit(e){let r=this._documentCaches.get(e.docId);r&&r.evictedCachedEdit(e)}clear(){this._documentCaches.forEach(e=>e.clear()),this._sharedCache.clear()}};zbt.NextEditCache=n4r;var i4r=class{static{a(this,"DocumentEditCache")}constructor(e,r,n,o,s){this._nextEditCache=e,this.docId=r,this._doc=n,this._sharedCache=o,this._trackedCachedEdits=[],this._logger=s.createSubLogger(["NES","DocumentEditCache"])}handleEdit(e){let r=this._logger.createSubLogger("handleEdit");for(let n of this._trackedCachedEdits)n.userEditSince&&(n.userEditSince=n.userEditSince.compose(e),n.rebaseFailed=!1,(0,Wbt.checkEditConsistency)(n.documentBeforeEdit.value,n.userEditSince,this._doc.value.get().value,r)||(n.userEditSince=void 0))}evictedCachedEdit(e){let r=this._trackedCachedEdits.indexOf(e);r!==-1&&this._trackedCachedEdits.splice(r,1)}clear(){this._trackedCachedEdits.length=0}setKthNextEdit(e,r,n,o,s,c,l,u){let d=this._getKey(e.value),f={docId:this.docId,targetDocId:u.targetDocId,targetDocumentBeforeEdit:u.targetDocumentBeforeEdit,edit:n,edits:o,detailedEdits:[],userEditSince:s,subsequentN:c,patchIndex:u.patchIndex,patchIndices:u.patchIndices,modelTelemetry:u.modelTelemetry,source:l,documentBeforeEdit:e,editWindow:r,originalEditWindow:u.originalEditWindow,cacheTime:Date.now(),isFromCursorJump:u.isFromCursorJump,cursorOffsetAtCacheTime:u.cursorOffset};s&&((0,Wbt.checkEditConsistency)(f.documentBeforeEdit.value,s,this._doc.value.get().value,this._logger.createSubLogger("setKthNextEdit"))?this._trackedCachedEdits.unshift(f):f.userEditSince=void 0);let h=this._sharedCache.get(d);h&&this.evictedCachedEdit(h);let m=this._sharedCache.put(d,f);return m&&this._nextEditCache.evictedCachedEdit(m[1]),f}setNoNextEdit(e,r,n,o){let s=this._getKey(e.value),c={docId:this.docId,edit:void 0,edits:[],detailedEdits:[],modelTelemetry:o,source:n,documentBeforeEdit:e,editWindow:r,cacheTime:Date.now(),isFromCursorJump:!1},l=this._sharedCache.get(s);l&&this.evictedCachedEdit(l);let u=this._sharedCache.put(s,c);u&&this._nextEditCache.evictedCachedEdit(u[1])}lookupNextEdit(e,r,n,o=!1){let s=this._getKey(e.value),c=this._sharedCache.get(s);if(c){let l=c.editWindow,u=c.originalEditWindow,d=r[0],f=l?.containsRange(d),h=u?.containsRange(d);if(l&&!f&&!h)return;if(o&&!c.targetDocId&&c.edit&&(c.subsequentN===void 0||c.subsequentN===0)&&c.cursorOffsetAtCacheTime!==void 0&&d){let m=e.getTransformer(),g=m.getPosition(c.edit.replaceRange.start).lineNumber,A=m.getPosition(c.cursorOffsetAtCacheTime).lineNumber,y=m.getPosition(d.start).lineNumber;if(Math.abs(y-g)>Math.abs(A-g))return c.rejected=!0,c}return c}for(let l of this._trackedCachedEdits){let u=this.tryRebaseCacheEntry(l,e,r,n);if(u.edit)return u.edit}}tryRebaseCacheEntry(e,r,n,o){let s=this._logger.createSubLogger("tryRebaseCacheEntry");if(e.userEditSince&&!e.rebaseFailed){let c=e.edits||(e.edit?[e.edit]:[]),l=e.originalEditWindow?[e.editWindow,e.originalEditWindow]:[e.editWindow];for(let u of l){let d=(0,Wbt.tryRebase)(e.documentBeforeEdit.value,u,c,e.detailedEdits,e.userEditSince,r.value,n,"strict",s,o);if(d==="rebaseFailed")return e.rebaseFailed=!0,{edit:void 0,failureInfo:new wbc.RebaseFailureInfo(e.documentBeforeEdit.value,u,c,e.userEditSince,r.value,n,o)};if(d==="inconsistentEdits"||d==="error")return e.userEditSince=void 0,{edit:void 0};if(d==="outsideEditWindow")continue;if(d.length)return!e.rejected&&this.isRejectedNextEdit(r,d[0].rebasedEdit)&&(e.rejected=!0),{edit:{...e,...d[0],baseCacheEntry:e}};if(!c.length)return{edit:e}}}return{edit:void 0}}isRejectedNextEdit(e,r){let n=this._logger.createSubLogger("isRejectedNextEdit"),o=r.removeCommonSuffixAndPrefix(e.value);for(let s of this._trackedCachedEdits.filter(c=>c.rejected)){if(!s.userEditSince)continue;let c=s.edits||(s.edit?[s.edit]:[]);if(!c.length)continue;let l=(0,Wbt.tryRebase)(s.documentBeforeEdit.value,void 0,c,s.detailedEdits,s.userEditSince,e.value,[],"lenient",n);if(typeof l=="string")continue;if(l.some(d=>d.rebasedEdit.removeCommonSuffixAndPrefix(e.value).equals(o)))return n.trace("Found rejected edit that matches current edit"),!0}return!1}_getKey(e){return JSON.stringify([this.docId.uri,e])}}});var EQi=I(Ybt=>{"use strict";p();Object.defineProperty(Ybt,"__esModule",{value:!0});Ybt.NextEditResult=void 0;var o4r=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};Ybt.NextEditResult=o4r});var vQi=I(Kbt=>{"use strict";p();Object.defineProperty(Kbt,"__esModule",{value:!0});Kbt.SpeculativeRequestManager=void 0;var Rbc=Po(),s4r=class extends Rbc.Disposable{static{a(this,"SpeculativeRequestManager")}constructor(e){super(),this._logger=e,this._pending=null,this._scheduled=null}get pending(){return this._pending}setPending(e){this._pending&&this._pending.request!==e.request&&this._cancelPending("replaced"),this._pending=e}consumePending(){this._pending=null}schedule(e){this._scheduled=e}clearScheduled(){this._scheduled=null}consumeScheduled(e){if(this._scheduled?.headerRequestId!==e)return null;let r=this._scheduled;return this._scheduled=null,r}cancelAll(e){this._scheduled=null,this._cancelPending(e)}cancelIfMismatch(e,r,n){this._pending&&(this._pending.docId!==e||this._pending.postEditContent!==r)&&this._cancelPending(n)}onDocumentClosed(e){this._scheduled?.suggestion.result?.targetDocumentId===e&&(this._scheduled=null),this._pending?.docId===e&&this._cancelPending("documentClosed")}onActiveDocumentChanged(e,r){let n=this._pending;if(!n||n.docId!==e)return;if(r.length{"use strict";p();var kbc=MI&&MI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},L3e=MI&&MI.__param||function(t,e){return function(r,n){e(r,n,t)}},c4r;Object.defineProperty(MI,"__esModule",{value:!0});MI.NextEditFetchRequest=MI.NextEditProvider=MI.NesOutcome=void 0;var Pbc=require("path"),qS=Hl(),H_e=ON(),U3e=Ebt(),B3e=wy(),Dbc=Emt(),Bp=R_e(),Nbc=W4(),l4r=Np(),Mbc=N7i(),Obc=O_e(),Lbc=k5r(),Bbc=Rh(),F3e=gv(),pE=xT(),CQi=pd(),Jbt=pl(),Fbc=qXe(),f4r=Os(),Zbt=Po(),bQi=bD(),SQi=E5(),Ubc=CT(),wQi=Lg(),Qbc=P$(),Pie=W_(),qbc=iv(),u4r=Id(),TQi=dI(),jbc=J5r(),Hbc=gQi(),Gbc=_Qi(),Xbt=EQi(),$bc=vQi();function Vbc(t,e,r){if(!e)return t;let n=e.endExclusive,o=r.getTransformer(),s=o.getPosition(n),c=o.getOffset(s.with(void 0,1)),l=o.getOffset(s.with(void 0,o.getLineLength(s.lineNumber)+1)),u=o.getOffset(o.getPosition(t.start).delta(1)),d=o.getPosition(t.endExclusive).delta(-2),f=o.getOffset(d.column>1?d.with(void 0,o.getLineLength(d.lineNumber)+1):d);return new u4r.OffsetRange(Math.min(u,c),Math.max(f,l))}a(Vbc,"computeReducedWindow");function Wbc(t,e){let n=new U3e.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r +`)?new Pie.StringEdit(n.replacements.map(o=>new Pie.StringReplacement(o.replaceRange,o.newText.replace(/\n/g,`\r +`)))):n}a(Wbc,"convertLineEditToEdit");function a4r(t){return{modelName:t.modelName,modelConfig:t.modelConfig}}a(a4r,"getModelTelemetry");function IQi(t,e){return new Fbc.CachedFunction(n=>{let o=t.find(s=>s.nextEditDoc.id===n);if(!o){for(let s=e.length-1;s>=0;s--){let c=e[s];if(c.docId===n&&c.kind==="edit"){let l=c.edit.getEditedState();return{baseDocState:l,docContents:l,editsSoFar:Pie.StringEdit.empty,nextEdits:[],patchIndices:[],docId:n}}}throw new f4r.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:Pie.StringEdit.empty,nextEdits:[],patchIndices:[],docId:n}})}a(IQi,"createDocStateLookupMap");function xQi(t){return t.rebasedEditIndex!==void 0?t.patchIndices?.[t.rebasedEditIndex]:t.patchIndex}a(xQi,"getSourcePatchIndex");var Q3e;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(Q3e||(MI.NesOutcome=Q3e={}));var d4r=c4r=class extends Zbt.Disposable{static{a(this,"NextEditProvider")}get lastRejectionTime(){return this._lastRejectionTime}get lastTriggerTime(){return this._lastTriggerTime}get lastOutcome(){return this._lastOutcome}constructor(e,r,n,o,s,c,l,u,d,f){super(),this._workspace=e,this._statelessNextEditProvider=r,this._historyContextProvider=n,this._xtabHistoryTracker=o,this._debugRecorder=s,this._configService=c,this._snippyService=l,this._logService=u,this._expService=d,this._requestLogger=f,this.ID=this._statelessNextEditProvider.ID,this._rejectionCollector=this._register(new Hbc.RejectionCollector(this._workspace,this._logService)),this._pendingStatelessNextEditRequest=null,this._lastShownTime=0,this._lastShownSuggestionId=void 0,this._lastRejectionTime=0,this._lastTriggerTime=0,this._shouldExpandEditWindow=!1,this._logger=this._logService.createSubLogger(["NES","NextEditProvider"]),this._nextEditCache=new Gbc.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new $bc.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,bQi.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,bQi.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,Zbt.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService)||this._pendingStatelessNextEditRequest===null)return;let o=this._pendingStatelessNextEditRequest.getActiveDocument();o.id===e&&o.documentAfterEdits.value!==r.value&&this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel()}async getNextEdit(e,r,n,o,s){let c=Date.now();this._lastTriggerTime=c;let l=new SQi.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(l4r.LogTarget.fromCallback((h,m)=>{n.trace(`[${Math.floor(l.elapsed()).toString().padStart(4," ")}ms] ${m}`)})),d=this._shouldExpandEditWindow;n.setStatelessNextEditProviderId(this._statelessNextEditProvider.ID);let f;try{f=await this._getNextEditCanThrow(e,r,c,d,u,n,o,s)}catch(h){throw n.setError(h),s.setNextEditProviderError(F3e.ErrorUtils.toString(h)),h}finally{s.markEndTime()}return this._lastNextEditResult=f,f}async _getNextEditCanThrow(e,r,n,o,s,c,l,u){let d=s.createSubLogger("_getNextEdit");d.trace(`invoked with trigger id = ${r.changeHint===void 0?"undefined":`uuid = ${r.changeHint.data.uuid}, reason = ${r.changeHint.data.reason}`}`);let f=this._workspace.getDocument(e);if(!f)throw d.trace(`Document "${e.baseName}" not found`),new f4r.BugIndicatingError(`Document "${e.baseName}" not found`);let h=f.value.get(),m=f.selection.get(),g=this.determineNesConfigs(u,c),A=this._nextEditCache.lookupNextEdit(e,h,m);if(A?.rejected){d.trace("cached edit was previously rejected"),u.setStatus("previouslyRejectedCache"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected();let O=A.rebasedEdit??A.edit;return O&&this._rejectionCollector.reject(e,O),new Xbt.NextEditResult(c.requestId,A.source,void 0)}if(A&&A.targetDocId&&A.targetDocId!==e){let O=this._workspace.getDocument(A.targetDocId);O&&A.targetDocumentBeforeEdit&&O.value.get().value===A.targetDocumentBeforeEdit.value||(d.trace(`cross-file cached edit unusable (target ${O?"changed":"not open"}); treating as cache miss and refetching`),A=void 0)}let y,_,E,v,S=e,T=!1,w=!1,R=!1,x;if(A){d.trace("using cached edit");let O=A.rebasedEdit||A.edit;O&&(y={actualEdit:O,isFromCursorJump:A.isFromCursorJump}),T=!!A.rebasedEdit,w=A.subsequentN!==void 0&&A.subsequentN>0,R=A.source.isSpeculative,v=A.source,c.setIsCachedResult(A.source.log),S=A.targetDocId??S,A.targetDocId&&A.targetDocId!==e?_=this._workspace.getDocument(A.targetDocId).value.get():_=h,u.setHeaderRequestId(v.headerRequestId),u.setIsFromCache(),u.setCachedModelTelemetry(A.modelTelemetry),u.setSubsequentEditOrder(A.rebasedEditIndex??A.subsequentN),u.setSourcePatchIndex(xQi(A)),c.recordingBookmark=v.log.recordingBookmark,x=A.baseCacheEntry??A}else{d.trace(`fetching next edit with shouldExpandEditWindow=${o}`);let O=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new q3e(r.requestUuid,c,O,!1),u.setHeaderRequestId(v.headerRequestId);let B=f.value.get();d.trace("awaiting firstEdit promise");let q=await this.fetchNextEdit(v,f,g,o,d,u,l);d.trace("resolved firstEdit promise");let M=`First edit latency: ${Date.now()-this._lastTriggerTime} ms`;if(c.addLog(M),d.trace(M),q.isError())d.trace(`failed to fetch next edit ${q.err.toString()}`),u.setStatus(`noEdit:${q.err.kind}`),E=q.err;else if(S=q.val.docId??S,_=(S?this._workspace.getDocument(S):f).value.get(),S===f.id&&B.value!==_.value)d.trace("document changed while fetching next edit"),u.setStatus("docChanged"),c.setIsSkipped();else{let j=q.val.rebasedEdit||q.val.edit;j?(d.trace("fetch succeeded"),c.setResponseResults([j]),y={actualEdit:j,isFromCursorJump:q.val.isFromCursorJump},R=q.val.isFromSpeculativeRequest??!1,x=q.val.baseCacheEntry??q.val,u.setSourcePatchIndex(xQi(q.val))):(d.trace("empty edits"),u.setStatus("emptyEdits"))}}if(E instanceof Bp.NoNextEditReason.FetchFailure||E instanceof Bp.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${E.error}`),E.error;if(E instanceof Bp.NoNextEditReason.NoSuggestions)if(E.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new Xbt.NextEditResult(c.requestId,v,{jumpToPosition:E.nextCursorPosition,targetDocumentId:E.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else E instanceof Bp.NoNextEditReason.GotCancelled&&c.setIsSkipped();let k=new Xbt.NextEditResult(c.requestId,v,void 0);if(!y)return d.trace("had no edit"),k;if(l.isCancellationRequested)return d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),k;if(this._rejectionCollector.isRejected(S,y.actualEdit)||_&&this._nextEditCache.isRejectedNextEdit(S,_,y.actualEdit))return d.trace("edit was previously rejected"),u.setStatus("previouslyRejected"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected(),k;c.setResult(U3e.RootedLineEdit.fromEdit(new H_e.RootedEdit(h,new Pie.StringEdit([y.actualEdit])))),(0,CQi.assert)(_!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new Xbt.NextEditResult(c.requestId,v,{edit:y.actualEdit,isFromCursorJump:y.isFromCursorJump,documentBeforeEdits:_,targetDocumentId:S,isSubsequentEdit:w,cacheEntry:x});u.setHasNextEdit(!0);let N=this.computeMinimumResponseDelay({triggerTime:n,isRebasedCachedEdit:T,isSubsequentCachedEdit:w,isFromSpeculativeRequest:R,enforceCacheDelay:r.enforceCacheDelay},d);return N>0&&(await(0,Jbt.timeout)(N),l.isCancellationRequested)?(d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),k):(d.trace("returning next edit result"),D)}_maybeCacheCrossFileEditUnderActiveDoc(e,r,n,o,s,c,l,u,d,f){return e!==0||s===r?!1:(this._nextEditCache.setKthNextEdit(r,n,o,l,0,void 0,void 0,d,{isFromCursorJump:u.isFromCursorJump,modelTelemetry:f,originalEditWindow:u.originalWindow,patchIndex:u.patchIndex,targetDocId:s,targetDocumentBeforeEdit:c}),!0)}determineNesConfigs(e,r){let n={isAsyncCompletions:this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService)};return e.setNESConfigs({...n}),r.addCodeblockToLog(JSON.stringify(n,null," ")),n}_processDoc(e){let r=e.lastEdit.base.getLines(),n=e.lastEdits,o=U3e.RootedLineEdit.fromEdit(new H_e.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new Bp.StatelessNextEditDocument(e.docId,l,e.languageId,r,o,s,n,c);return{recentEdit:e.lastEdit,nextEditDoc:u,documentAfterEdits:u.documentAfterEdits}}async fetchNextEdit(e,r,n,o,s,c,l){let u=r.id,d=s.createSubLogger("fetchNextEdit"),f=this._historyContextProvider.getHistoryContext(u);if(!f)return pE.Result.error(new Bp.NoNextEditReason.Unexpected(new Error("DocumentMissingInHistoryContext")));let h=r.value.get(),m=r.selection.get(),g=e.log;g.setRecentEdit(f);let A=m.at(0),y=a(N=>!N.requestEditWindow||!A||N.requestEditWindow.containsCursor(A),"cursorInRequestEditWindow"),_=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value,E=!this._pendingStatelessNextEditRequest||y(this._pendingStatelessNextEditRequest),v=(_||n.isAsyncCompletions)&&E&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0,S=this._specManager.pending,T=S?.docId===u&&S?.postEditContent===h.value&&!S.request.cancellationTokenSource.token.isCancellationRequested&&y(S.request),w=T?S?.request:void 0,R=w??v;if(R){w?(d.trace(`reusing speculative pending request (opportunityId=${w.opportunityId}, headerRequestId=${w.headerRequestId})`),this._specManager.consumePending()):d.trace(`reusing in-flight pending request (opportunityId=${R.opportunityId}, headerRequestId=${R.headerRequestId})`);let N=w?T:_,O=w?"speculative":"async";if(N){let B=await this._joinNextEditRequest(R,O,c,g,l);return c.setStatelessNextEditTelemetry(B.telemetry),w?(await R.firstEdit.p).map(M=>({...M,isFromSpeculativeRequest:!0})):B.nextEdit.isError()?B.nextEdit:R.firstEdit.p}else{let B=await this._joinNextEditRequest(R,O,c,g,l),q=await R.firstEdit.p;if(q.isOk()&&q.val.edit){let U=this._nextEditCache.tryRebaseCacheEntry(q.val,h,m);if(U.edit)return c.setStatelessNextEditTelemetry(B.telemetry),pE.Result.ok(U.edit);this._logRebaseFailure(U.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(B.telemetry),pE.Result.error(new Bp.NoNextEditReason.GotCancelled("afterFailedRebase"));let L=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0;if(L){d.trace("reusing 2nd existing next edit request after rebase failed");let U=await this._joinNextEditRequest(L,"async",c,g,l);return c.setStatelessNextEditTelemetry(U.telemetry),U.nextEdit.isError()?U.nextEdit:L.firstEdit.p}d.trace("creating new next edit request after rebase failed")}}let x=await this._executeNewNextEditRequest(e,r,f,n,o,d,c,l),k=x.nextEditRequest,D=x.nextEditResult;return c.setStatelessNextEditTelemetry(D.telemetry),D.nextEdit.isError()?D.nextEdit:k.firstEdit.p}async _joinNextEditRequest(e,r,n,o,s){n.setHeaderRequestId(e.headerRequestId),n.setReusedRequest(r),n.setRequest(e),o.setRequestInput(e),o.setIsReusedInFlightResult(e.logContext);let c=this._hookupCancellation(e,s);try{return await e.result}finally{c.dispose()}}_logRebaseFailure(e,r){e&&r.setRebaseFailure(e)}_rebaseAndCacheStreamedEdit(e){let{statePerDoc:r,streamedEdit:n,ithEdit:o,activeDoc:s,userEditSince:c,modelTelemetry:l,source:u,logger:d}=e,f=r.get(n.targetDocument),h=new Qbc.LineEdit([n.edit]),g=Wbc(h,f.baseDocState).tryRebase(f.editsSoFar);if(g===void 0)return;f.editsSoFar=f.editsSoFar.compose(g);let A=f.docContents,y,_=!1;if(g.replacements.length===0||g.replacements.length>1)d.trace(`WARNING: ${o} has ${g.replacements.length} edits, but expected only 1`);else{let E=g.replacements[0];f.nextEdits.push(E),f.patchIndices.push(n.patchIndex),y=this._nextEditCache.setKthNextEdit(f.docId,A,o===0?n.window:void 0,E,o,o===0?f.nextEdits:void 0,o===0?c:void 0,u,{isFromCursorJump:n.isFromCursorJump,modelTelemetry:l,originalEditWindow:n.originalWindow,cursorOffset:f.docId===s.id?s.cursorOffset:void 0,patchIndex:n.patchIndex,patchIndices:o===0?f.patchIndices:void 0}),_=this._maybeCacheCrossFileEditUnderActiveDoc(o,s.id,s.contents,n.window,f.docId,A,E,n,u,l),d.trace(`populated cache for ${o}`)}return f.docContents=g.applyOnText(A),{lineEdit:h,rebasedEdit:g,docContentsBeforeEdit:A,cachedEdit:y,crossFileCached:_}}async _executeNewNextEditRequest(e,r,n,o,s,c,l,u){let d=r.id,f=c.createSubLogger("_executeNewNextEditRequest"),h=e.log;if(this._debugRecorder){let q=this._debugRecorder.createBookmark();h.recordingBookmark=q,l.setRequestBookmark(q)}let m=zbc(n.getDocumentAndIdx(d)),g=r.selection.get()[0],A=this._debugRecorder?.getRecentLog(),y=n.documents.map(q=>this._processDoc(q)),_=this._xtabHistoryTracker.getHistory(),E=new Jbt.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,S=new Bp.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(q=>q.nextEditDoc),m.idx,_,E,v,!1,h,h.recordingBookmark,A,e.providerRequestStartDateTime),T;this._pendingStatelessNextEditRequest&&(this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel(),this._pendingStatelessNextEditRequest=null,this._specManager.clearScheduled()),this._specManager.cancelIfMismatch(d,S.documentBeforeEdits.value,"superseded"),this._pendingStatelessNextEditRequest=S;let w=a(()=>{this._pendingStatelessNextEditRequest===S&&(this._pendingStatelessNextEditRequest=null)},"removeFromPending");l.setRequest(S),l.setStatus("requested"),h.setRequestInput(S);let R=this._hookupCancellation(S,u,o.isAsyncCompletions?(0,Nbc.autorunWithChanges)(this,{value:r.value},q=>{q.value.changes.forEach(M=>{S.intermediateUserEdit&&!M.isEmpty()&&(S.intermediateUserEdit=S.intermediateUserEdit.compose(M),(0,jbc.checkEditConsistency)(S.documentBeforeEdits.value,S.intermediateUserEdit,q.value.value.value,f)||(S.intermediateUserEdit=void 0))})}):void 0),x=IQi(y,_),k=this._statelessNextEditProvider.provideNextEdit(S,f,h,S.cancellationTokenSource.token),D=-1,N=!1,O=a((q,M)=>{++D;let L=f.createSubLogger("processEdit");L.trace(`processing edit #${D} (starts at 0)`),L.trace("resetting shouldExpandEditWindow to false due to receiving an edit"),this._shouldExpandEditWindow=!1;let U=this._rebaseAndCacheStreamedEdit({statePerDoc:x,streamedEdit:q,ithEdit:D,activeDoc:{id:d,contents:S.documentBeforeEdits,cursorOffset:g?.start},userEditSince:S.intermediateUserEdit,modelTelemetry:a4r(M),source:e,logger:L});if(U===void 0){L.trace(`edit ${D} is undefined after rebasing`),E.isSettled||E.complete(pE.Result.error(new Bp.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}let{lineEdit:j,docContentsBeforeEdit:Q,cachedEdit:Y}=U;return N=U.crossFileCached||N,E.isSettled||(L.trace("resolving firstEdit promise"),h.setResult(new U3e.RootedLineEdit(Q,j)),E.complete(Y?pE.Result.ok(Y):pE.Result.error(new Bp.NoNextEditReason.Unexpected(new Error("No cached edit"))))),Y},"processEdit"),B=a((q,M)=>{let L=f.createSubLogger("streamEnd");if(D===-1&&q instanceof Bp.NoNextEditReason.NoSuggestions&&(L.trace("resetting shouldExpandEditWindow to false due to NoSuggestions"),this._shouldExpandEditWindow=!1),x.get(d).nextEdits.length)L.trace(`${x.get(d).nextEdits.length} edits returned`);else if(L.trace(`no edit, reason: ${q.kind}`),q instanceof Bp.NoNextEditReason.NoSuggestions&&!N){let{documentBeforeEdits:W,window:V}=q,z=V?Vbc(V,g,W):void 0;this._nextEditCache.setNoNextEdit(d,W,z,e,a4r(M))}E.isSettled||E.complete(pE.Result.error(q));let j=x.get(d).nextEdits.length>0?pE.Result.ok(void 0):pE.Result.error(q),Q=new Bp.StatelessNextEditResult(j,M);S.setResult(Q),R.dispose(),w();let Y=this._specManager.consumeScheduled(S.headerRequestId);return Y&&this._triggerSpeculativeRequest(Y.suggestion),Q},"handleStreamEnd");try{let q=await k.next();if(q.done){let M=q.value.v;T=B(M,q.value.telemetryBuilder)}else{let M=q.value.v,L=q.value.telemetryBuilder;O(M,L),(async()=>{try{for(q=await k.next();!q.done;){let j=q.value.v;O(j,q.value.telemetryBuilder),this._specManager.consumeScheduled(S.headerRequestId),q=await k.next()}let U=q.value.v;B(U,q.value.telemetryBuilder)}catch(U){f.trace(`Error while streaming further edits: ${F3e.ErrorUtils.toString(U)}`);let j=new Bp.NoNextEditReason.Unexpected(F3e.ErrorUtils.fromUnknown(U));B(j,L)}})(),T=new Bp.StatelessNextEditResult(pE.Result.ok(void 0),L)}}catch(q){throw S.setResultError(q),q}return{nextEditRequest:S,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new Zbt.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new Jbt.TimeoutTimer);return o.add(r.onCancellationRequested(()=>{if(c(),!(e.liveDependentants>0)){if(!e.fetchIssued){e.cancellationTokenSource.cancel(),n?.dispose();return}l.setIfNotSet(()=>{e.liveDependentants>0||(e.cancellationTokenSource.cancel(),n?.dispose())},1e3)}})),o.add((0,Zbt.toDisposable)(()=>{c(),e.liveDependentants===0&&n?.dispose()})),e.liveDependentants++,o}computeMinimumResponseDelay({triggerTime:e,isRebasedCachedEdit:r,isSubsequentCachedEdit:n,isFromSpeculativeRequest:o,enforceCacheDelay:s},c){if(!s)return c.trace("[minimumDelay] no minimum delay enforced due to enforceCacheDelay being false"),0;let l=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestDelay,this._expService),h=l;r&&u!==void 0?h=u:n&&d!==void 0?h=d:o&&f!==void 0&&(h=f);let m=Date.now()-e,g=Math.max(0,h-m);return c.trace(`[minimumDelay] expected delay: ${h}ms, effective delay: ${g}. isRebasedCachedEdit: ${r} (rebasedCacheDelay: ${u}), isSubsequentCachedEdit: ${n} (subsequentCacheDelay: ${d}), isFromSpeculativeRequest: ${o} (speculativeRequestDelay: ${f})`),g}handleShown(e){if(this._lastShownTime=Date.now(),this._lastShownSuggestionId=e.requestId,this._lastOutcome=void 0,this._specManager.clearScheduled(),this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===B3e.SpeculativeRequestsEnablement.On){let n=this._pendingStatelessNextEditRequest;n&&n.headerRequestId===e.source.headerRequestId?this._specManager.schedule({suggestion:e,headerRequestId:n.headerRequestId}):this._triggerSpeculativeRequest(e)}}async _triggerSpeculativeRequest(e){let r=e.result;if(!r?.edit)return;let n=r.targetDocumentId;if(!n)return;let o=new Dbc.InlineEditRequestLogContext(n.uri,0,void 0),s=new SQi.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(l4r.LogTarget.fromCallback((T,w)=>{o.trace(`[${Math.floor(s.elapsed()).toString().padStart(4," ")}ms] ${w}`)})),l=r.edit.replace(r.documentBeforeEdits.value),u=r.edit.removeCommonSuffixPrefix(r.documentBeforeEdits.value),d=u.replaceRange.start+u.newText.length,f=new u4r.OffsetRange(d,d),h=[f],m=new H_e.RootedEdit(r.documentBeforeEdits,new Pie.StringEdit([r.edit])),g=new TQi.StringText(l),A=this._nextEditCache.lookupNextEdit(n,g,h),y=f;if(A)if(A.edit){c.trace("already have cached edit for post-edit state");return}else if(A.editWindow){c.trace("have cached no-suggestions entry for post-edit state, but it has an edit window. Checking if shifting selection based on cursor placement config can yield a cached edit");let T=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===B3e.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=c4r.shiftSelectionAfterEditWindow(g,A.editWindow),A=this._nextEditCache.lookupNextEdit(n,g,[y]),A?.edit){c.trace("already have cached edit for post-edit state (after shifting selection)");return}else c.trace("no cached edit even after shifting selection");else c.trace(`cursor placement config is ${T}, not shifting selection`)}else{c.trace("already have cached no-suggestions entry for post-edit state");return}if(this._pendingStatelessNextEditRequest?.documentBeforeEdits.value===l){c.trace("already have pending request for post-edit state");return}let _=this._specManager.pending;if(_?.docId===n&&_?.postEditContent===l){c.trace("already have speculative request for post-edit state");return}let E=this._workspace.getDocument(n);if(!E){c.trace("document not found for speculative request");return}let v=this._historyContextProvider.getHistoryContext(n);if(!v){c.trace("no history context for speculative request");return}let S=new q3e(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,wQi.generateUuid)()}`);c.trace(`triggering speculative request for post-edit state (opportunityId=${S.opportunityId}, headerRequestId=${S.headerRequestId})`);try{let T=await this._createSpeculativeRequest(S,E,y,v,l,m,r.edit,{triggeredBySpeculativeRequest:e.source.isSpeculative,isSubsequentEdit:e.result?.isSubsequentEdit??!1},c);if(T){let w=r.documentBeforeEdits.value,R=w.slice(0,u.replaceRange.start),x=w.slice(u.replaceRange.endExclusive),k=u.newText;this._specManager.setPending({request:T,docId:n,postEditContent:l,trajectoryPrefix:R,trajectorySuffix:x,trajectoryNewText:k})}}catch(T){c.trace(`speculative request failed: ${F3e.ErrorUtils.toString(T)}`)}}async _createSpeculativeRequest(e,r,n,o,s,c,l,{triggeredBySpeculativeRequest:u,isSubsequentEdit:d},f){let h=r.id,m=this._debugRecorder?.getRecentLog(),g=e.log;g.setStatelessNextEditProviderId(this._statelessNextEditProvider.ID);let A=f.createSubLogger("_createSpeculativeRequest"),y=o.getDocumentAndIdx(h);if(!y){A.trace("active doc not found in history context");return}let _=new TQi.StringText(s),E=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let O=this._workspace.getWorkspaceRoot(h),B=new Pie.StringEdit([l]),q=U3e.RootedLineEdit.fromEdit(new H_e.RootedEdit(r.value.get(),B)).removeCommonSuffixPrefixLines().edit,M=new Bp.StatelessNextEditDocument(h,O,N.languageId,r.value.get().getLines(),q,r.value.get(),H_e.Edits.single(B),n);return{recentEdit:new H_e.RootedEdit(r.value.get(),B),nextEditDoc:M,documentAfterEdits:_}}}),v=this._xtabHistoryTracker.getHistory(),S={kind:"edit",docId:h,edit:c};v.push(S);let T=new Jbt.DeferredPromise,w=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case B3e.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case B3e.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case B3e.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(qS.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,CQi.assertNever)(w)}let x=new Bp.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,_,E.map(N=>N.nextEditDoc),y.idx,v,T,R,!0,g,void 0,m,void 0);g.setRequestInput(x),A.trace("starting speculative provider call");let k=`NES | spec | ${(0,Pbc.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new Mbc.CapturingToken(k,void 0);return this._requestLogger.captureInvocation(D,async()=>{this._addLiveLogContextEntry(g,k);try{await this._runSpeculativeProviderCall(x,E,h,e,n.start,A)}catch(N){g.setError(N)}finally{g.markCompleted()}}),x}async _runSpeculativeProviderCall(e,r,n,o,s,c){let l=c.createSubLogger("_runSpeculativeProviderCall"),u=e.xtabEditHistory,d=IQi(r,u),f=o.log,h=this._statelessNextEditProvider.provideNextEdit(e,l,f,e.cancellationTokenSource.token),m=-1;try{let g=await h.next();g.done?(e.firstEdit.complete(pE.Result.error(g.value.v)),e.setResult(new Bp.StatelessNextEditResult(pE.Result.error(g.value.v),g.value.telemetryBuilder)),f.markAsNoSuggestions(),l.trace("speculative request completed with no edits")):(async()=>{for(;!g.done;){++m;let A=g.value.v,y=this._rebaseAndCacheStreamedEdit({statePerDoc:d,streamedEdit:A,ithEdit:m,activeDoc:{id:n,contents:e.documentBeforeEdits,cursorOffset:s},userEditSince:void 0,modelTelemetry:a4r(g.value.telemetryBuilder),source:o,logger:l});if(y===void 0){l.trace(`speculative edit ${m} rebasing failed`),g=await h.next();continue}let{rebasedEdit:_,cachedEdit:E}=y;E&&(e.firstEdit.isSettled||(e.firstEdit.complete(pE.Result.ok(E)),e.setResult(new Bp.StatelessNextEditResult(pE.Result.ok(void 0),g.value.telemetryBuilder)),f.setResponseResults([_.replacements[0]])),l.trace(`cached speculative edit ${m}`)),g=await h.next()}})().finally(()=>{e.firstEdit.isSettled||(e.firstEdit.complete(pE.Result.error(new Bp.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new Bp.StatelessNextEditResult(pE.Result.error(new Bp.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits"))),g.value.telemetryBuilder)),f.markAsNoSuggestions())}),l.trace(`speculative request completed with ${m+1} edits`)}catch(g){l.trace(`speculative provider call error: ${F3e.ErrorUtils.toString(g)}`)}}static shiftSelectionAfterEditWindow(e,r){let n=e.getTransformer(),o=n.getPosition(r.endExclusive-1),s=o.lineNumber+11e3&&r.result.edit&&(this._rejectionCollector.reject(e,r.result.edit),this._nextEditCache.rejectedNextEdit(r.source.headerRequestId)),this._lastRejectionTime=Date.now(),this._lastOutcome=Q3e.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=Q3e.Ignored,this._lastShownSuggestionId===r.requestId&&!(n!==void 0)&&(this._specManager.cancelAll("ignoredDismissed"),this._statelessNextEditProvider.handleIgnored?.())}async runSnippy(e,r){r.result===void 0||r.result.edit===void 0||this._snippyService.handlePostInsertion(e.toUri(),r.result.documentBeforeEdits,r.result.edit)}_addLiveLogContextEntry(e,r){this._requestLogger.addEntry({type:"MarkdownContentRequest",debugName:r??e.getDebugName(),icon:a(()=>e.getIcon(),"icon"),startTimeMs:e.time,markdownContent:a(()=>e.toLogDocument(),"markdownContent"),onDidChange:e.onDidChange,isVisible:a(()=>e.includeInLogTree,"isVisible")})}clearCache(){this._nextEditCache.clear(),this._rejectionCollector.clear(),this._specManager.cancelAll("cacheCleared")}};MI.NextEditProvider=d4r;MI.NextEditProvider=d4r=c4r=kbc([L3e(5,qS.IConfigurationService),L3e(6,Lbc.ISnippyService),L3e(7,l4r.ILogService),L3e(8,Bbc.IExperimentationService),L3e(9,Obc.IRequestLogger)],d4r);function zbc(t){if(!t)throw new f4r.BugIndicatingError("expected value to be defined, but it was not");return t}a(zbc,"assertDefined");var q3e=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,wQi.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};MI.NextEditFetchRequest=q3e});var kQi=I(j3e=>{"use strict";p();Object.defineProperty(j3e,"__esModule",{value:!0});j3e.parseGitRemotes=Ybc;j3e.toGitUri=Kbc;j3e.getUpstreamRemote=Jbc;var p4r=class t{static{a(this,"GitConfigParser")}static{this._lineSeparator=/\r?\n/}static{this._propertyRegex=/^\s*(\w+)\s*=\s*"?([^"]+)"?$/}static{this._sectionRegex=/^\s*\[\s*([^\]]+?)\s*(\"[^"]+\")*\]\s*$/}static parse(e){let r={sections:[]},n={name:"DEFAULT",properties:{}},o=a(s=>{s&&r.sections.push(s)},"addSection");for(let s of e.split(t._lineSeparator)){let c=s.match(t._sectionRegex);if(c?.length===3){o(n),n={name:c[1],subSectionName:c[2]?.replaceAll('"',""),properties:{}};continue}let l=s.match(t._propertyRegex);l?.length===3&&!Object.keys(n.properties).includes(l[1])&&(n.properties[l[1]]=l[2])}return o(n),r.sections}};function Ybc(t){let e=[];for(let r of p4r.parse(t).filter(n=>n.name==="remote"))r.subSectionName&&e.push({name:r.subSectionName,fetchUrl:r.properties.url,pushUrl:r.properties.pushurl??r.properties.url,isReadOnly:!1});return e}a(Ybc,"parseGitRemotes");function Kbc(t,e,r={}){let n={path:t.fsPath,ref:e};r.submoduleOf&&(n.submoduleOf=r.submoduleOf);let o=t.path;return r.replaceFileExtension?o=`${o}.git`:r.submoduleOf&&(o=`${o}.diff`),t.with({scheme:r.scheme??"git",path:o,query:JSON.stringify(n)})}a(Kbc,"toGitUri");function Jbc(t){let e=t.state.HEAD?.upstream?.remote;if(e)return t.state.remotes.find(r=>r.name===e)}a(Jbc,"getUpstreamRemote")});var UQi=I(Mh=>{"use strict";p();Object.defineProperty(Mh,"__esModule",{value:!0});Mh.GLOB_SPLIT=Mh.GLOBSTAR=void 0;Mh.getEmptyExpression=rSc;Mh.splitGlobAware=g4r;Mh.isEmptyPattern=uSc;Mh.match=mSc;Mh.parse=LQi;Mh.isRelativePattern=BQi;Mh.getBasenameTerms=gSc;Mh.getPathTerms=ASc;Mh.patternsEquals=ESc;var Zbc=Ml(),m4r=pl(),Xbc=uVt(),eSc=b2(),jV=$A(),tSc=pj(),H3e=ym();function rSc(){return Object.create(null)}a(rSc,"getEmptyExpression");Mh.GLOBSTAR="**";Mh.GLOB_SPLIT="/";var eSt="[/\\\\]",tSt="[^/\\\\]",nSc=/\//g;function PQi(t,e){switch(t){case 0:return"";case 1:return`${tSt}*?`;default:return`(?:${eSt}|${tSt}+${eSt}${e?`|${eSt}${tSt}+`:""})*?`}}a(PQi,"starsToRegExp");function g4r(t,e){if(!t)return[];let r=[],n=!1,o=!1,s="";for(let c of t){switch(c){case e:if(!n&&!o){r.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=c}return s&&r.push(s),r}a(g4r,"splitGlobAware");function OQi(t){if(!t)return"";let e="",r=g4r(t,Mh.GLOB_SPLIT);if(r.every(n=>n===Mh.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===Mh.GLOBSTAR){if(n)return;e+=PQi(2,s===r.length-1)}else{let c=!1,l="",u=!1,d="";for(let f of o){if(f!=="}"&&c){l+=f;continue}if(u&&(f!=="]"||!d)){let h;f==="-"?h=f:(f==="^"||f==="!")&&!d?h="^":f===Mh.GLOB_SPLIT?h="":h=(0,H3e.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${g4r(l,",").map(g=>OQi(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=tSt;continue;case"*":e+=PQi(1);continue;default:e+=(0,H3e.escapeRegExpCharacters)(f)}}su===d,endsWith:n?H3e.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,Xbc.isEqualOrParent)(u,d,e.ignoreCase??!tSc.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=DQi.get(s);if(c)return NQi(c,t,o);let l;return iSc.test(r)?c=dSc(r.substring(4),r,o):(l=oSc.exec(h4r(r,o)))?c=fSc(l[1],r,o):(e.trimForExclusions?aSc:sSc).test(r)?c=pSc(r,o):(l=cSc.exec(h4r(r,o)))?c=MQi(l[1].substring(1),r,!0,o):(l=lSc.exec(h4r(r,o)))?c=MQi(l[1],r,!1,o):c=hSc(r,o),DQi.set(s,c),NQi(c,t,o)}a(y4r,"parsePattern");function NQi(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,H3e.ltrim)(o.substring(e.base.length),jV.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(NQi,"wrapRelativePattern");function h4r(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(h4r,"trimForExclusions");function dSc(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(dSc,"trivia1");function fSc(t,e,r){let n=`/${t}`,o=`\\${t}`,s=a(function(l,u){return typeof l!="string"?null:u?r.equals(u,t)?e:null:r.equals(l,t)||r.endsWith(l,n)||r.endsWith(l,o)?e:null},"parsedPattern"),c=[t];return s.basenames=c,s.patterns=[e],s.allBasenames=c,s}a(fSc,"trivia2");function pSc(t,e){let r=FQi(t.slice(1,-1).split(",").map(l=>y4r(l,e)).filter(l=>l!==FN),t),n=r.length;if(!n)return FN;if(n===1)return r[0];let o=a(function(l,u){for(let d=0,f=r.length;d!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(pSc,"trivia3");function MQi(t,e,r,n){let o=jV.sep===jV.posix.sep,s=o?t:t.replace(nSc,jV.sep),c=jV.sep+s,l=jV.posix.sep+t,u;return r?u=a(function(d,f){return typeof d=="string"&&(n.equals(d,s)||n.endsWith(d,c)||!o&&(n.equals(d,t)||n.endsWith(d,l)))?e:null},"parsedPattern"):u=a(function(d,f){return typeof d=="string"&&(n.equals(d,s)||!o&&n.equals(d,t))?e:null},"parsedPattern"),u.allPaths=[(r?"*/":"./")+t],u}a(MQi,"trivia4and5");function hSc(t,e){try{let r=new RegExp(`^${OQi(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return FN}}a(hSc,"toRegExp");function mSc(t,e,r){return!t||typeof e!="string"?!1:LQi(t,r)(e)}a(mSc,"match");function LQi(t,e={}){if(!t)return A4r;if(typeof t=="string"||BQi(t)){let r=y4r(t,e);if(r===FN)return A4r;let n=a(function(o,s){return!!r(o,s)},"resultPattern");return r.allBasenames&&(n.allBasenames=r.allBasenames),r.allPaths&&(n.allPaths=r.allPaths),n}return ySc(t,e)}a(LQi,"parse");function BQi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(BQi,"isRelativePattern");function gSc(t){return t.allBasenames||[]}a(gSc,"getBasenameTerms");function ASc(t){return t.allPaths||[]}a(ASc,"getPathTerms");function ySc(t,e){let r=FQi(Object.getOwnPropertyNames(t).map(l=>_Sc(l,t[l],e)).filter(l=>l!==FN)),n=r.length;if(!n)return FN;if(!r.some(l=>!!l.requiresSiblings)){if(n===1)return r[0];let l=a(function(f,h){let m;for(let g=0,A=r.length;g{for(let g of m){let A=await g;if(typeof A=="string")return A}return null})():null},"resultExpression"),u=r.find(f=>!!f.allBasenames);u&&(l.allBasenames=u.allBasenames);let d=r.reduce((f,h)=>h.allPaths?f.concat(h.allPaths):f,[]);return d.length&&(l.allPaths=d),l}let o=a(function(l,u,d){let f,h;for(let m=0,g=r.length;m{for(let m of h){let g=await m;if(typeof g=="string")return g}return null})():null},"resultExpression"),s=r.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(ySc,"parsedExpression");function _Sc(t,e,r){if(e===!1)return FN;let n=y4r(t,r);if(n===FN)return FN;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let s=a((c,l,u,d)=>{if(!d||!n(c,l))return null;let f=o.replace("$(basename)",()=>u),h=d(f);return(0,m4r.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(_Sc,"parseExpressionPattern");function FQi(t,e){let r=t.filter(l=>!!l.basenames);if(r.length<2)return t;let n=r.reduce((l,u)=>{let d=u.basenames;return d?l.concat(d):l},[]),o;if(e){o=[];for(let l=0,u=n.length;l{let d=u.patterns;return d?l.concat(d):l},[]);let s=a(function(l,u){if(typeof l!="string")return null;if(!u){let f;for(f=l.length;f>0;f--){let h=l.charCodeAt(f-1);if(h===47||h===92)break}u=l.substring(f)}let d=n.indexOf(u);return d!==-1?o[d]:null},"aggregate");s.basenames=n,s.patterns=o,s.allBasenames=n;let c=t.filter(l=>!l.basenames);return c.push(s),c}a(FQi,"aggregateBasenameMatches");function ESc(t,e){return(0,Zbc.equals)(t,e,(r,n)=>typeof r=="string"&&typeof n=="string"?r===n:typeof r!="string"&&typeof n!="string"?r.base===n.base&&r.pattern===n.pattern:!1)}a(ESc,"patternsEquals")});var nSt=I(Wl=>{"use strict";p();var vSc=Wl&&Wl.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CSc=Wl&&Wl.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bSc=Wl&&Wl.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o(0,QQi.isEqual)(r.uri,t)||r.uri.path===t.path||E4r(t,r))}a(_4r,"findNotebook");function E4r(t,e){if(t.scheme===G3e.Schemas.vscodeNotebookCell||t.scheme===G3e.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,QQi.isEqual)(n.document.uri,t)||n.document.uri.fragment===t.fragment&&n.document.uri.path===t.path);if(r!==-1)return e.getCells()[r]}}a(E4r,"findCell");function SSc(t,e){if(t.scheme!==G3e.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=qQi(t,e);if(!o||!o.outputs.length)return;let s=(r.get("outputIndex")?parseInt(r.get("outputIndex")||"",10):void 0)||0;if(!(s>o.outputs.length-1))return[n,o,o.outputs[s]]}a(SSc,"getNotebookCellOutput");function qQi(t,e){let r=_4r(t,e)||e.find(o=>o.uri.path===t.path);if(!r)return[void 0,void 0];let n=E4r(t,r);return n===void 0?[r,void 0]:[r,n]}a(qQi,"getNotebookAndCellFromUri");function TSc(t){return t.scheme===G3e.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a(TSc,"isNotebookCellOrNotebookChatInput");function ISc(t){return t.scheme===G3e.Schemas.vscodeNotebookCell}a(ISc,"isNotebookCell");function xSc(t){return t.path.endsWith(".ipynb")}a(xSc,"isJupyterNotebookUri");function wSc(t){return t.notebookType==="jupyter-notebook"}a(wSc,"isJupyterNotebook");function RSc(t,e={}){return JSON.stringify({cells:t.getCells().map(r=>({uri_fragment:e.cell_uri_fragment?r.document.uri.fragment:void 0,cell_type:r.kind,source:r.document.getText().split(/\r?\n/)}))})}a(RSc,"serializeNotebookDocument");function kSc(t){try{let e=t.replace(/\n/g,""),n=/```(?:json)?(.+)/g.exec(e);if(n){let o=n[1],s=o.indexOf("```"),c=s===-1?o:o.substring(0,s);return JSON.parse(c)}}catch{}}a(kSc,"extractNotebookOutline");function jQi(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||GQi(e.include))}a(jQi,"isDocumentExcludePattern");function HQi(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a(HQi,"isFilenamePattern");function GQi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(GQi,"isRelativePattern");function PSc(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(PSc,"isNotebookEditorContribution");function DSc(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(DSc,"extractEditorAssociation");function $Qi(t,e){if(typeof e=="string"&&G_e.match(e.toLowerCase(),(0,$_e.basename)(t.fsPath).toLowerCase()))return!0;if(jQi(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(G_e.match(r,(0,$_e.basename)(t.fsPath).toLowerCase()))return!(n&&G_e.match(n,(0,$_e.basename)(t.fsPath).toLowerCase()))}return HQi(e)&&G_e.match(e.filenamePattern,(0,$_e.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&G_e.match(e.excludeFileNamePattern,(0,$_e.basename)(t.fsPath).toLowerCase())):!1}a($Qi,"notebookSelectorMatches");function VQi(t,e){let r=[];for(let n of e)n.filenamePattern&&G_e.match(n.filenamePattern.toLowerCase(),(0,$_e.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(VQi,"getNotebookEditorAssociations");function NSc(t,e,r,n){if(_4r(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>$Qi(t,l)));if(o.length===0)return!1;let s=VQi(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??rSt.default)===rSt.default)}a(NSc,"_hasSupportedNotebooks")});var ZQi=I(Gg=>{"use strict";p();var MSc=Gg&&Gg.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},OSc=Gg&&Gg.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Gg,"__esModule",{value:!0});Gg.TelemetrySender=Gg.NextEditProviderTelemetryBuilder=Gg.DiagnosticsTelemetryBuilder=Gg.LlmNESTelemetryBuilder=Gg.NES_GH_TELEMETRY_EVENT_NAME=void 0;var WQi=gk(),zQi=kQi(),LSc=W4(),JQi=bh(),BSc=nSt(),FSc=pl(),iSt=Po(),USc=eZ(),YQi=o6(),KQi=qg();Gg.NES_GH_TELEMETRY_EVENT_NAME="copilot-nes/provideInlineEdit";var oSt=class extends iSt.Disposable{static{a(this,"LlmNESTelemetryBuilder")}build(e){let r,n,o,s,c,l=!1,u,d,f;if(this._request){let g=this._request.getActiveDocument();r=this._request.documents.length,n=this._request.documents.reduce((y,_)=>y+_.recentEdits.edits.length,0),o=g.recentEdits.edits.length,s=g.languageId,c=g.documentAfterEditsLines.length,l=g.id.toUri().scheme===USc.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,BSc.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(KQi.Uri.parse(g.id.uri));if(y){let v=(0,zQi.getUpstreamRemote)(y);v?.fetchUrl&&(d=v.pushUrl||v.fetchUrl)}let _=new Set,E=[...new Set(this._request.documents.map(v=>A.getRepository(KQi.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of E){let S=v?(0,zQi.getUpstreamRemote)(v):void 0;S?.fetchUrl&&_.add(S.fetchUrl),S?.pushUrl&&_.add(S.pushUrl)}f=[..._]}}let h;if(e&&this.editCollectingInfo!==void 0){let g=this.editCollectingInfo.originalDoc.value,A;if(this._debugRecorder&&this._requestBookmark){let y=this._debugRecorder.getRecentLog(),_=JSON.stringify(y)?.length||0;A={entries:_>200*1024?void 0:y,entriesSize:_,requestTime:this._requestBookmark.timeMs}}h={text:g.length>200*1024?void 0:g,textLength:g.length,selection:this.editCollectingInfo.originalSelection.map(y=>({start:y.start,endExclusive:y.endExclusive})),edits:this.editCollectingInfo.edits.map(y=>y.edit.replacements.map(_=>({time:y.time.toISOString(),start:_.replaceRange.start,endExclusive:_.replaceRange.endExclusive,newText:_.newText}))).flat(),tags:[],recording:A}}let m=this._statelessNextEditTelemetry?.fetchStartedAt===void 0?void 0:this._statelessNextEditTelemetry.fetchStartedAt-this._startTime;return{providerId:this._providerId,headerRequestId:this._headerRequestId,nextEditProviderDuration:this._duration,isFromCache:this._isFromCache,reusedRequest:this._reusedRequest,subsequentEditOrder:this._subsequentEditOrder,sourcePatchIndex:this._sourcePatchIndex,documentsCount:r,editsCount:n,activeDocumentEditsCount:o,activeDocumentLanguageId:s,activeDocumentOriginalLineCount:c,fetchStartedAfterMs:m,hasNextEdit:this._hasNextEdit,wasPreviouslyRejected:this._wasPreviouslyRejected,isNotebook:l,notebookType:u,status:this._status,nextEditProviderError:this._nextEditProviderError,alternativeAction:h,...this._statelessNextEditTelemetry,modelName:this._statelessNextEditTelemetry?.modelName??this._cachedModelTelemetry?.modelName,modelConfig:this._statelessNextEditTelemetry?.modelConfig??this._cachedModelTelemetry?.modelConfig,activeDocumentRepository:d,repositoryUrls:f,nesConfigs:this._nesConfigs}}get originalSelectionLine(){return this.editCollectingInfo?.originalSelectionLine}setRequestBookmark(e){this._requestBookmark=e}constructor(e,r,n,o,s,c,l){super(),this._gitExtensionService=e,this._notebookService=r,this._workspaceService=n,this._providerId=o,this._doc=s,this._debugRecorder=c,this._requestBookmark=l,this._isFromCache=!1,this._hasNextEdit=!1,this._wasPreviouslyRejected=!1,this._status="new",this._startTime=Date.now(),this._doc&&(this.editCollectingInfo={originalDoc:this._doc.value.get(),originalSelection:this._doc.selection.get(),originalSelectionLine:this._doc.primarySelectionLine.get(),edits:[]},this._store.add((0,LSc.autorunWithChanges)(this,{value:this._doc.value},u=>{let d=new Date;u.value.changes.forEach(f=>{this.editCollectingInfo?.edits.push({time:d,edit:f})})})))}setNESConfigs(e){return this._nesConfigs=e,this}setHeaderRequestId(e){return this._headerRequestId=e,this}setIsFromCache(){return this._isFromCache=!0,this}setCachedModelTelemetry(e){return this._cachedModelTelemetry=e,this}setReusedRequest(e){return this._reusedRequest=e,this}setSubsequentEditOrder(e){return this._subsequentEditOrder=e,this}setSourcePatchIndex(e){return this._sourcePatchIndex=e,this}setRequest(e){return this._request=e,this}setStatelessNextEditTelemetry(e){return this._statelessNextEditTelemetry=e,this}setHasNextEdit(e){return this._hasNextEdit=e,this}setWasPreviouslyRejected(){return this._wasPreviouslyRejected=!0,this}markEndTime(){return this._duration=Date.now()-this._startTime,this}setStatus(e){return this._status=e,this}setNextEditProviderError(e){return this._nextEditProviderError=e,this}};Gg.LlmNESTelemetryBuilder=oSt;var sSt=class{static{a(this,"DiagnosticsTelemetryBuilder")}constructor(){this._droppedReasons=[]}build(){let e=this._droppedReasons.length>0?JSON.stringify(this._droppedReasons):void 0;return{diagnosticType:this._type,diagnosticDroppedReasons:e,diagnosticAlternativeImportsCount:this._diagnosticRunTelemetry?.alternativeImportsCount,diagnosticHasExistingSameFileImport:this._diagnosticRunTelemetry?.hasExistingSameFileImport,diagnosticIsLocalImport:this._diagnosticRunTelemetry?.isLocalImport,diagnosticDistanceToUnknownDiagnostic:this._diagnosticRunTelemetry?.distanceToUnknownDiagnostic,diagnosticDistanceToAlternativeDiagnostic:this._diagnosticRunTelemetry?.distanceToAlternativeDiagnostic,diagnosticHasAlternativeDiagnosticForSameRange:this._diagnosticRunTelemetry?.hasAlternativeDiagnosticForSameRange}}populate(e){this._droppedReasons.forEach(r=>e.addDroppedReason(r)),this._type&&e.setType(this._type),this._diagnosticRunTelemetry&&e.setDiagnosticRunTelemetry(this._diagnosticRunTelemetry)}setType(e){return this._type=e,this}addDroppedReason(e){return this._droppedReasons.push(e),this}setDiagnosticRunTelemetry(e){return this._diagnosticRunTelemetry=e,this}};Gg.DiagnosticsTelemetryBuilder=sSt;var v4r=class t extends iSt.Disposable{static{a(this,"NextEditProviderTelemetryBuilder")}static{this.providerIdToReqN=new Map}get isSent(){return this._isSent}markAsSent(){this._isSent=!0}build(e){let r=this._nesBuilder.build(e),n=this._diagnosticsBuilder.build();return{...r,...n,opportunityId:this._opportunityId||"",requestN:this._requestN,isShown:this._isShown,acceptance:this._acceptance,disposalReason:this._disposalReason,supersededByOpportunityId:this._supersededByOpportunityId,pickedNES:this._nesTypePicked,hadLlmNES:this._hadLlmNES,isMultilineEdit:this._isMultilineEdit,suggestionLineDistanceToCursor:this._suggestionLineDistanceToCursor,isEolDifferent:this._isEolDifferent,isActiveDocument:this._isActiveDocument,isNextEditorVisible:this._isNextEditorVisible,isNextEditorRangeVisible:this._isNextEditorRangeVisible,isNESForAnotherDoc:this._isNESForAnotherDoc,notebookId:this._notebookId,notebookCellLines:this._notebookCellLines,notebookCellMarkerCount:this._notebookCellMarkerCount,notebookCellMarkerIndex:this._notebookCellMarkerIndex,hadDiagnosticsNES:this._hadDiagnosticsNES,configIsDiagnosticsNESEnabled:this._configIsDiagnosticsNESEnabled,isNaturalLanguageDominated:this._isNaturalLanguageDominated,postProcessingOutcome:this._postProcessingOutcome,userTypingDisagreed:this._userTypingDisagreed}}get nesBuilder(){return this._nesBuilder}get diagnosticsBuilder(){return this._diagnosticsBuilder}constructor(e,r,n,o,s,c,l){super(),this.doc=s,this._isSent=!1,this._isShown=!1,this._acceptance="notAccepted",this._disposalReason=void 0,this._supersededByOpportunityId=void 0,this._userTypingDisagreed=void 0,this._notebookCellMarkerCount=0,this._notebookCellMarkerIndex=-1,this._isNESForAnotherDoc=!1,this._hadLlmNES=!1,this._hadDiagnosticsNES=!1,this._configIsDiagnosticsNESEnabled=!1,this._isNaturalLanguageDominated=!1;let u=t.providerIdToReqN.get(o)||0;this._requestN=++u,t.providerIdToReqN.set(o,u),this._nesBuilder=this._register(new oSt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new sSt}setOpportunityId(e){return this._opportunityId=e,this}setAsShown(){return this._isShown=!0,this}setAcceptance(e){return this._acceptance=e,this}setDisposalReason(e){return this._disposalReason=e,this}setSupersededBy(e){return this._supersededByOpportunityId=e,this}setUserTypingDisagreed(e){return this._userTypingDisagreed=e,this}setPickedNESType(e){return this._nesTypePicked=e,this}setIsActiveDocument(e){return this._isActiveDocument=e,this}setNotebookCellMarkerCount(e){return this._notebookCellMarkerCount=e,this}setIsMultilineEdit(e){return this._isMultilineEdit=e,this}setSuggestionLineDistanceToCursor(e){return this._suggestionLineDistanceToCursor=e,this}setIsEolDifferent(e){return this._isEolDifferent=e,this}setIsNextEditorVisible(e){return this._isNextEditorVisible=e,this}setIsNextEditorRangeVisible(e){return this._isNextEditorRangeVisible=e,this}setNotebookId(e){return this._notebookId=e,this}setNotebookCellLines(e){return this._notebookCellLines=e,this}setNotebookCellMarkerIndex(e){return this._notebookCellMarkerIndex=e,this}setIsNESForOtherEditor(e){return this._isNESForAnotherDoc=e,this}setHadLlmNES(e){return this._hadLlmNES=e,this}setHadDiagnosticsNES(e){return this._hadDiagnosticsNES=e,this}setStatus(e){return this._nesBuilder.setStatus(e),this}setConfigIsDiagnosticsNESEnabled(e){return this._configIsDiagnosticsNESEnabled=e,this}setIsNaturalLanguageDominated(e){return this._isNaturalLanguageDominated=e,this}setPostProcessingOutcome(e){let r=e.displayLocation?{label:e.displayLocation.label,range:e.displayLocation.range.toString()}:void 0;return this._postProcessingOutcome=JSON.stringify({suggestedEdit:e.edit.toString(),isInlineCompletion:e.isInlineCompletion,displayLocation:r}),this}};Gg.NextEditProviderTelemetryBuilder=v4r;var C4r=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new iSt.DisposableStore,this._disposalTracker=new iSt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new FSc.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,YQi.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,YQi.autorunHandleChanges)({owner:this,changeTracker:{createChangeSummary:a(()=>({removed:[]}),"createChangeSummary"),handleChange:a((u,d)=>(u.didChange(e.openDocuments)&&(d.removed=u.change.removed),!0),"handleChange")}},(u,d)=>{if(this._store.isDisposed)return;let f=e.openDocuments.read(u);for(let h of f)h.primarySelectionLine.read(u);if(l){l=!1;for(let h of f)this._selectionSnapshots.set(h.id.uri,h.primarySelectionLine.get());return}for(let h of d.removed)this._selectionSnapshots.delete(h.id.uri);if(!(Date.now()-this._lastEditTime<200))for(let h of f){let m=h.id.uri,g=h.primarySelectionLine.get();if(this._selectionSnapshots.get(m)!==g){this._selectionSnapshots.set(m,g),this._onUserJump(m,g);return}}}))}scheduleIdleTimer(){this._idleScheduler?.schedule()}acquire(){this._disposalTracker.acquire()}release(){this._disposalTracker.release()}forceDispose(){this._store.dispose()}},b4r=class{static{a(this,"TelemetrySender")}constructor(e,r){this._workspace=e,this._telemetryService=r,this._map=new Map}scheduleSendingEnhancedTelemetry(e,r){let n=this._map.get(e);n&&(n.builder!==r&&n.builder.dispose(),this._removeEntry(e,n));let o=setTimeout(()=>{this._enterIdleDetection(e,r)},120*1e3);this._map.set(e,{builder:r,timeout:o})}_enterIdleDetection(e,r){let n=this._workspace;if(!n){this._buildAndSendEnhancedTelemetry(e,r,{reason:"idle",details:{idleTimeoutMs:0}});return}this._idleDetector?this._idleDetector.acquire():this._idleDetector=new C4r(n,l=>this._sendAllPendingInIdlePhase({reason:"idle",details:{idleTimeoutMs:l}}),(l,u)=>this._sendAllPendingInIdlePhaseWithJump(l,u)),this._idleDetector.scheduleIdleTimer();let o=3e4,s=setTimeout(()=>{this._sendForEntry(e,{reason:"hard_cap",details:{hardCapTimeoutMs:o}})},o),c=this._map.get(e);c&&(c.hardCapTimeout=s)}_releaseIdleDetector(){this._idleDetector?.release(),this._idleDetector?.isDisposed&&(this._idleDetector=void 0)}_sendAllPendingInIdlePhase(e){let r=[];for(let[n,o]of this._map)o.hardCapTimeout!==void 0&&r.push(n);for(let n of r)this._sendForEntry(n,e)}_sendAllPendingInIdlePhaseWithJump(e,r){let n=[];for(let[o,s]of this._map)s.hardCapTimeout!==void 0&&n.push([o,s.builder]);for(let[o,s]of n){let c=s.doc?.id.uri,l=s.nesBuilder.originalSelectionLine,u=c!==void 0&&l!==void 0?{file:c,line:l}:void 0;this._sendForEntry(o,{reason:"user_jump",details:{from:u,to:{file:e,line:r}}})}}_sendForEntry(e,r){let n=this._map.get(e);if(!n)return;n.hardCapTimeout!==void 0&&(clearTimeout(n.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e);let o;try{o=n.builder.build(!0)}finally{n.builder.dispose()}this._doSendEnhancedTelemetry(o,r)}_removeEntry(e,r){clearTimeout(r.timeout),r.hardCapTimeout!==void 0&&(clearTimeout(r.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e)}_buildAndSendEnhancedTelemetry(e,r,n){let o;this._map.delete(e);try{o=r.build(!0)}finally{r.dispose()}this._doSendEnhancedTelemetry(o,n)}sendTelemetry(e,r){if(e){let o=this._map.get(e);o&&this._removeEntry(e,o)}let n=r.build(!0);r.isSent||(this._doSendTelemetry(n),r.markAsSent()),this._doSendEnhancedTelemetry(n,void 0)}sendTelemetryForBuilder(e){if(e.isSent)return;let r=e.build(!1);this._doSendTelemetry(r),e.markAsSent()}async _doSendTelemetry(e){let{opportunityId:r,headerRequestId:n,requestN:o,providerId:s,modelName:c,hadStatelessNextEditProviderCall:l,statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:f,reusedRequest:h,subsequentEditOrder:m,sourcePatchIndex:g,activeDocumentLanguageId:A,activeDocumentOriginalLineCount:y,nLinesOfCurrentFileInPrompt:_,wasPreviouslyRejected:E,isShown:v,isNotebook:S,notebookType:T,isNESForAnotherDoc:w,isActiveDocument:R,isEolDifferent:x,isMultilineEdit:k,suggestionLineDistanceToCursor:D,isNextEditorRangeVisible:N,isNextEditorVisible:O,acceptance:B,disposalReason:q,logProbThreshold:M,documentsCount:L,editsCount:U,activeDocumentEditsCount:j,promptLineCount:Q,promptCharCount:Y,hadLowLogProbSuggestion:W,nEditsSuggested:V,lineDistanceToMostRecentEdit:z,isCursorAtEndOfLine:ie,isInlineSuggestion:H,debounceTime:re,artificialDelay:le,hasNextEdit:Le,notebookCellMarkerCount:me,notebookCellMarkerIndex:Oe,notebookId:Te,notebookCellLines:te,nextEditLogprob:ee,supersededByOpportunityId:K,noNextEditReasonKind:he,noNextEditReasonMessage:X,fetchStartedAfterMs:de,response:Be,configIsDiagnosticsNESEnabled:ne,isNaturalLanguageDominated:ue,diagnosticType:Ne,diagnosticDroppedReasons:xe,diagnosticHasExistingSameFileImport:Fe,diagnosticIsLocalImport:tt,diagnosticAlternativeImportsCount:st,diagnosticDistanceToUnknownDiagnostic:vt,diagnosticDistanceToAlternativeDiagnostic:Pt,diagnosticHasAlternativeDiagnosticForSameRange:Ht,hadDiagnosticsNES:F,hadLlmNES:se,pickedNES:be,xtabAggressivenessLevel:Ue,xtabUserHappinessScore:Qe,userAggressivenessSetting:ge,modelConfig:Z}=e,ve,Ge,qe,je;if(Be!==void 0){let{response:J,ttft:ae,fetchResult:Ce,fetchTime:Re}=await Be;J.type===WQi.ChatFetchResponseType.Success&&(ve=J.usage),Ge=ae,qe=Ce,je=Re}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:A,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:B,disposalReason:q,supersededByOpportunityId:K,noNextEditReasonKind:he,noNextEditReasonMessage:X,fetchResult:qe,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:Ne,diagnosticDroppedReasons:xe,pickedNES:be,notebookType:T,notebookId:Te,notebookCellLines:te,nextCursorLineError:e.nextCursorPrediction?.nextCursorLineError,xtabAggressivenessLevel:Ue,userAggressivenessSetting:ge,modelConfig:Z,neighborSnippetIndicesInPrompt:e.neighborSnippetIndicesInPrompt},{requestN:o,hadStatelessNextEditProviderCall:this._boolToNum(l),statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:this._boolToNum(f),subsequentEditOrder:m,sourcePatchIndex:g,activeDocumentOriginalLineCount:y,activeDocumentNLinesInPrompt:_,wasPreviouslyRejected:this._boolToNum(E),isShown:this._boolToNum(v),isNotebook:this._boolToNum(S),isNESForAnotherDoc:this._boolToNum(w),isActiveDocument:this._boolToNum(R),isEolDifferent:this._boolToNum(x),isMultilineEdit:this._boolToNum(k),suggestionLineDistanceToCursor:D,isNextEditorRangeVisible:this._boolToNum(N),isNextEditorVisible:this._boolToNum(O),hasNotebookCellMarker:me>0?1:0,notebookCellMarkerCount:me,notebookCellMarkerIndex:Oe,logProbThreshold:M,documentsCount:L,editsCount:U,activeDocumentEditsCount:j,promptLineCount:Q,promptCharCount:Y,hadLowLogProbSuggestion:this._boolToNum(W),nEditsSuggested:V,lineDistanceToMostRecentEdit:z,isCursorAtEndOfLine:this._boolToNum(ie),isInlineSuggestion:this._boolToNum(H),debounceTime:re,artificialDelay:le,fetchStartedAfterMs:de,ttft:Ge,fetchTime:je,promptTokens:ve?.prompt_tokens,responseTokens:ve?.completion_tokens,cachedTokens:ve?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:ve?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:ve?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(Le),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:ee,hadDiagnosticsNES:this._boolToNum(F),hadLlmNES:this._boolToNum(se),configIsDiagnosticsNESEnabled:this._boolToNum(ne),isNaturalLanguageDominated:this._boolToNum(ue),diagnosticHasExistingSameFileImport:this._boolToNum(Fe),diagnosticIsLocalImport:this._boolToNum(tt),diagnosticAlternativeImportsCount:st,diagnosticDistanceToUnknownDiagnostic:vt,diagnosticDistanceToAlternativeDiagnostic:Pt,diagnosticHasAlternativeDiagnosticForSameRange:this._boolToNum(Ht),nextCursorLineDistance:e.nextCursorPrediction?.nextCursorLineDistance,xtabUserHappinessScore:Qe,nDiffsInPrompt:e.nDiffsInPrompt,promptSectionTokensSystemPrompt:e.promptSectionTokens?.systemPrompt,promptSectionTokensRecentlyViewed:e.promptSectionTokens?.recentlyViewed,promptSubsectionTokensRecentlyViewedFiles:e.promptSectionTokens?.recentlyViewedSubsections.recentlyViewedFiles,promptSubsectionTokensLanguageContext:e.promptSectionTokens?.recentlyViewedSubsections.languageContext,promptSubsectionTokensNeighborFiles:e.promptSectionTokens?.recentlyViewedSubsections.neighborFiles,promptSectionTokensCurrentFile:e.promptSectionTokens?.currentFile,promptSectionTokensLintErrors:e.promptSectionTokens?.lintErrors,promptSectionTokensEditHistory:e.promptSectionTokens?.editHistory,promptSectionTokensAreaAroundCodeToEdit:e.promptSectionTokens?.areaAroundCodeToEdit,promptSectionTokensCursorLocation:e.promptSectionTokens?.cursorLocation,promptSectionTokensRelatedInformation:e.promptSectionTokens?.relatedInformation,promptSectionTokensPostScript:e.promptSectionTokens?.postScript,userPromptOverheadTokens:e.promptSectionTokens?.overhead,userPromptTotalTokens:e.promptSectionTokens?.userPromptTotal,nNeighborSnippetsComputed:e.nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:e.nNeighborSnippetsInPrompt})}_sendTelemetryToBoth(e,r){this._telemetryService.sendMSFTTelemetryEvent("provideInlineEdit",e,r),this._telemetryService.sendGHTelemetryEvent(Gg.NES_GH_TELEMETRY_EVENT_NAME,e,r)}async _doSendEnhancedTelemetry(e,r){let{opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,status:l,modelName:u,prompt:d,response:f,alternativeAction:h,postProcessingOutcome:m,activeDocumentRepository:g,repositoryUrls:A,cursorJumpModelName:y,cursorJumpPrompt:_,cursorJumpResponse:E,lintErrors:v,terminalOutput:S,similarFilesContext:T,modelConfig:w,isFromCache:R}=e,x=f===void 0?f:await f,k=await T?.catch(()=>{}),D=x?.fetchResult;this._telemetryService.sendEnhancedGHTelemetryEvent(Gg.NES_GH_TELEMETRY_EVENT_NAME,(0,JQi.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==WQi.ChatFetchResponseType.Success?void 0:x.response.value,fetchResult:D,alternativeAction:h?JSON.stringify({...h,enhancedTelemetrySendingReason:r}):void 0,enhancedTelemetrySendingReason:!h&&r?JSON.stringify(r):void 0,postProcessingOutcome:m,activeDocumentRepository:g,repositories:JSON.stringify(A),cursorJumpModelName:y,cursorJumpPrompt:_,cursorJumpResponse:E,lintErrors:v,terminalOutput:S,similarFilesContext:k,modelConfig:w}),{isFromCache:this._boolToNum(R)})}_boolToNum(e){return e===void 0?void 0:e?1:0}dispose(){for(let e of this._map.values())clearTimeout(e.timeout),e.hardCapTimeout!==void 0&&clearTimeout(e.hardCapTimeout),e.builder.dispose();this._map.clear(),this._idleDetector&&(this._idleDetector.forceDispose(),this._idleDetector=void 0)}};Gg.TelemetrySender=b4r;Gg.TelemetrySender=b4r=MSc([OSc(1,JQi.ITelemetryService)],b4r)});var T4r=I(V_e=>{"use strict";p();Object.defineProperty(V_e,"__esModule",{value:!0});V_e.NullPowerService=V_e.IPowerService=void 0;var XQi=Fc(),QSc=Ks();V_e.IPowerService=(0,QSc.createDecorator)("IPowerService");var S4r=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=XQi.Event.None,this.onDidResume=XQi.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};V_e.NullPowerService=S4r});var LU=I(HV=>{"use strict";p();Object.defineProperty(HV,"__esModule",{value:!0});HV.FetchStreamRecorder=HV.FetchStreamSource=HV.IChatMLFetcher=void 0;var qSc=an(),jSc=pl();HV.IChatMLFetcher=(0,qSc.createServiceIdentifier)("IChatMLFetcher");var I4r=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new jSc.AsyncIterableSource,this._seenAnnotationTypes=new Set}pause(){this._paused??=[]}unpause(){let e=this._paused;if(e){this._paused=void 0;for(let r of e)r?this.update(r.text,r.delta):this.resolve()}}update(e,r){if(this._paused){this._paused.push({text:e,delta:r});return}r.codeVulnAnnotations&&(!((e.match(/(^|\n)```/g)?.length??0)%2===1)||e.match(/(^|\n)```\w*\s*$/))&&(r.codeVulnAnnotations=void 0),r.codeVulnAnnotations&&(r.codeVulnAnnotations=r.codeVulnAnnotations.filter(n=>!this._seenAnnotationTypes.has(n.details.type)),r.codeVulnAnnotations.forEach(n=>this._seenAnnotationTypes.add(n.details.type))),this._stream.emitOne({delta:r})}resolve(){if(this._paused){this._paused.push(void 0);return}this._stream.resolve()}reject(e){this._paused=void 0,this._stream.reject(e)}};HV.FetchStreamSource=I4r;var x4r=class{static{a(this,"FetchStreamRecorder")}get firstTokenEmittedTime(){return this._firstTokenEmittedTime}get outputChunkGapsMs(){return this._outputChunkGapsMs}constructor(e){this.deltas=[],this._outputChunkGapsMs=[],this.callback=async(r,n,o)=>{if(!!(o.text||o.beginToolCalls||typeof o.thinking?.text=="string"&&o.thinking?.text||o.thinking?.text?.length||o.copilotToolCalls||o.copilotToolCallStreamUpdates)){let l=Date.now();this._firstTokenEmittedTime===void 0?this._firstTokenEmittedTime=l:this._lastOutputChunkTime!==void 0&&this._outputChunkGapsMs.push(l-this._lastOutputChunkTime),this._lastOutputChunkTime=l}let c=e?await e(r,n,o):void 0;return this.deltas.push(o),c}}};HV.FetchStreamRecorder=x4r});var w4r=I(aSt=>{"use strict";p();Object.defineProperty(aSt,"__esModule",{value:!0});aSt.IChatQuotaService=void 0;var HSc=an();aSt.IChatQuotaService=(0,HSc.createServiceIdentifier)("IChatQuotaService")});var R4r=I(cSt=>{"use strict";p();Object.defineProperty(cSt,"__esModule",{value:!0});cSt.IConversationOptions=void 0;var GSc=an();cSt.IConversationOptions=(0,GSc.createServiceIdentifier)("ConversationOptions")});var $3e=I(W_e=>{"use strict";p();Object.defineProperty(W_e,"__esModule",{value:!0});W_e.getTextPart=VSc;W_e.toTextPart=eqi;W_e.toTextParts=WSc;W_e.roleToString=zSc;var Die=wo(),$Sc=pd();function VSc(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===Die.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===Die.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a(VSc,"getTextPart");function eqi(t){return{type:Die.Raw.ChatCompletionContentPartKind.Text,text:t}}a(eqi,"toTextPart");function WSc(t){return[eqi(t)]}a(WSc,"toTextParts");function zSc(t){switch(t){case Die.Raw.ChatRole.System:return"system";case Die.Raw.ChatRole.User:return"user";case Die.Raw.ChatRole.Assistant:return"assistant";case Die.Raw.ChatRole.Tool:return"tool";default:(0,$Sc.assertNever)(t,`unknown role (${t})`)}}a(zSc,"roleToString")});var P4r=I(z_e=>{"use strict";p();Object.defineProperty(z_e,"__esModule",{value:!0});z_e.InteractionService=z_e.IInteractionService=void 0;var YSc=an(),tqi=Lg();z_e.IInteractionService=(0,YSc.createServiceIdentifier)("IInteractionService");var k4r=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,tqi.generateUuid)()}startInteraction(){this._interactionId=(0,tqi.generateUuid)()}get interactionId(){return this._interactionId}};z_e.InteractionService=k4r});var N4r=I(lSt=>{"use strict";p();Object.defineProperty(lSt,"__esModule",{value:!0});lSt.SSEParser=void 0;var D4r=class{static{a(this,"SSEParser")}constructor(e){this.dataBuffer="",this.eventTypeBuffer="",this.buffer=[],this.endedOnCR=!1,this.onEventHandler=e,this.decoder=new TextDecoder("utf-8")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let r=0;for(this.endedOnCR&&e[0]===10&&r++,this.endedOnCR=!1;r{"use strict";p();Object.defineProperty(Yi,"__esModule",{value:!0});Yi.getModelCapabilityOverride=e1c;Yi.getModelId=tB;Yi.isHiddenModelA=t1c;Yi.isHiddenModelB=N4r;Yi.isHiddenModelE=lSt;Yi.isHiddenModelF=uSt;Yi.isHiddenFamilyH=dSt;Yi.isHiddenModelK=r1c;Yi.isGpt54=M4r;Yi.isGpt55=n1c;Yi.isGpt56=Y_e;Yi.isGpt53Codex=O4r;Yi.isKimiFamily=fSt;Yi.isVSCModelA=pSt;Yi.isVSCModelB=hSt;Yi.isVSCModelReplaceStringSet=V3e;Yi.isVSCModelC=i1c;Yi.isVSCModelD=o1c;Yi.isVSCModelE=s1c;Yi.isGpt52CodexFamily=L4r;Yi.isGpt52Family=B4r;Yi.modelPrefersInstructionsInUserMessage=a1c;Yi.modelPrefersInstructionsAfterHistory=c1c;Yi.modelSupportsApplyPatch=l1c;Yi.modelPrefersJsonNotebookRepresentation=u1c;Yi.modelSupportsReplaceString=d1c;Yi.modelSupportsMultiReplaceString=cqi;Yi.modelCanUseReplaceStringExclusively=f1c;Yi.modelShouldUseReplaceStringHealing=p1c;Yi.modelCanUseMcpResultImageURL=h1c;Yi.modelCanUseImageURL=m1c;Yi.modelSupportsPDFDocuments=g1c;Yi.modelSupportCacheBreakPoints=A1c;Yi.modelCanUseApplyPatchExclusively=y1c;Yi.modelNeedsStrongReplaceStringHint=_1c;Yi.modelSupportsSimplifiedApplyPatchInstructions=E1c;Yi.isAnthropicFamily=W3e;Yi.isGeminiFamily=F4r;Yi.isMinimaxFamily=mSt;Yi.isXAiFamily=U4r;Yi.isGpt5PlusFamily=gSt;Yi.isGptCodexFamily=v1c;Yi.isGpt5Family=C1c;Yi.isGptFamily=b1c;Yi.isGpt51Family=S1c;Yi.getVerbosityForModelSync=T1c;Yi.modelSupportsToolSearch=I1c;Yi.modelSupportsContextEditing=x1c;var Oh=EOr(),zSc=Hl(),YSc=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],sqi=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],eqi=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],tqi=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],rqi=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],nqi=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],iqi=[],oqi=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],KSc=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],JSc=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],ZSc=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],aqi="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",XSc=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"];function e1c(t,e){return e.getConfig(zSc.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(e1c,"getModelCapabilityOverride");function tB(t){return"id"in t?t.id:t.model}a(tB,"getModelId");function t1c(t){let e=(0,Oh.getCachedSha256Hash)(t.family);return YSc.includes(e)}a(t1c,"isHiddenModelA");function N4r(t){let e=(0,Oh.getCachedSha256Hash)(typeof t=="string"?t:t.family);return sqi.includes(e)}a(N4r,"isHiddenModelB");function lSt(t){let e=(0,Oh.getCachedSha256Hash)(t.family);return KSc.includes(e)}a(lSt,"isHiddenModelE");function uSt(t){let e=(0,Oh.getCachedSha256Hash)(t.family);return JSc.includes(e)}a(uSt,"isHiddenModelF");function dSt(t){let e=(0,Oh.getCachedSha256Hash)(t.family);return XSc.includes(e)}a(dSt,"isHiddenFamilyH");function r1c(t){return(0,Oh.getCachedSha256Hash)(t.family)===aqi}a(r1c,"isHiddenModelK");function M4r(t){let e=(0,Oh.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||ZSc.includes(e)}a(M4r,"isGpt54");function n1c(t){let e=(0,Oh.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||sqi.includes(e)}a(n1c,"isGpt55");function Y_e(t){let e=typeof t=="string"?t:t.family;return e==="gpt-5.6-sol"||e==="gpt-5.6-terra"||e==="gpt-5.6-luna"}a(Y_e,"isGpt56");function O4r(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(O4r,"isGpt53Codex");function fSt(t){let e=a(r=>{let n=r.toLowerCase();return n.includes("kimi-k2.6")||n.includes("kimi-k2.7-code")},"matches");return typeof t=="string"?e(t):e(t.family)||e(tB(t))}a(fSt,"isKimiFamily");function pSt(t){let e=(0,Oh.getCachedSha256Hash)(tB(t)),r=(0,Oh.getCachedSha256Hash)(t.family);return eqi.includes(e)||eqi.includes(r)}a(pSt,"isVSCModelA");function hSt(t){let e=(0,Oh.getCachedSha256Hash)(tB(t)),r=(0,Oh.getCachedSha256Hash)(t.family);return tqi.includes(e)||tqi.includes(r)}a(hSt,"isVSCModelB");function V3e(t){let e=(0,Oh.getCachedSha256Hash)(tB(t)),r=(0,Oh.getCachedSha256Hash)(t.family);return oqi.includes(e)||oqi.includes(r)}a(V3e,"isVSCModelReplaceStringSet");function i1c(t){let e=(0,Oh.getCachedSha256Hash)(tB(t)),r=(0,Oh.getCachedSha256Hash)(t.family);return rqi.includes(e)||rqi.includes(r)}a(i1c,"isVSCModelC");function o1c(t){let e=(0,Oh.getCachedSha256Hash)(tB(t)),r=(0,Oh.getCachedSha256Hash)(t.family);return nqi.includes(e)||nqi.includes(r)}a(o1c,"isVSCModelD");function s1c(t){let e=tB(t),r=(0,Oh.getCachedSha256Hash)(e),n=(0,Oh.getCachedSha256Hash)(t.family);return t.name.startsWith("vscModelE")||t.family.startsWith("vscModelE")||e.startsWith("vscModelE")||iqi.includes(r)||iqi.includes(n)}a(s1c,"isVSCModelE");function L4r(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(L4r,"isGpt52CodexFamily");function B4r(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a(B4r,"isGpt52Family");function a1c(t){return t.includes("claude-3.5-sonnet")}a(a1c,"modelPrefersInstructionsInUserMessage");function c1c(t){return t.includes("claude-3.5-sonnet")}a(c1c,"modelPrefersInstructionsAfterHistory");function l1c(t){return V3e(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||L4r(t.family)||O4r(t.family)||pSt(t)||hSt(t)||B4r(t.family)||M4r(t)||N4r(t)||Y_e(t)}a(l1c,"modelSupportsApplyPatch");function u1c(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||L4r(t.family)||O4r(t.family)||B4r(t.family)||M4r(t)||N4r(t)||Y_e(t)}a(u1c,"modelPrefersJsonNotebookRepresentation");function d1c(t){return F4r(t)||U4r(t)||cqi(t)||uSt(t)||mSt(t)||dSt(t)||fSt(t)}a(d1c,"modelSupportsReplaceString");function cqi(t){return W3e(t)||lSt(t)||V3e(t)||mSt(t)||dSt(t)||fSt(t)}a(cqi,"modelSupportsMultiReplaceString");function f1c(t){return W3e(t)||U4r(t)||lSt(t)||t.family.toLowerCase().includes("gemini-3")||V3e(t)||uSt(t)||mSt(t)||dSt(t)||fSt(t)}a(f1c,"modelCanUseReplaceStringExclusively");function p1c(t){return t.family.includes("gemini-2")}a(p1c,"modelShouldUseReplaceStringHealing");function h1c(t){return!W3e(t)&&!lSt(t)}a(h1c,"modelCanUseMcpResultImageURL");function m1c(t){return!0}a(m1c,"modelCanUseImageURL");function g1c(t){return W3e(t)||gSt(t)||Y_e(t)}a(g1c,"modelSupportsPDFDocuments");function A1c(t){return Y_e(t)}a(A1c,"modelSupportCacheBreakPoints");function y1c(t){return V3e(t)?!1:gSt(t)||pSt(t)||hSt(t)}a(y1c,"modelCanUseApplyPatchExclusively");function _1c(t){return F4r(t)||uSt(t)}a(_1c,"modelNeedsStrongReplaceStringHint");function E1c(t){return gSt(t)||pSt(t)||hSt(t)}a(E1c,"modelSupportsSimplifiedApplyPatchInstructions");function W3e(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(W3e,"isAnthropicFamily");function F4r(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,Oh.getCachedSha256Hash)(e)===aqi}a(F4r,"isGeminiFamily");function mSt(t){return t.family.toLowerCase().includes("minimax")}a(mSt,"isMinimaxFamily");function U4r(t){return t.family.startsWith("grok")}a(U4r,"isXAiFamily");function gSt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(gSt,"isGpt5PlusFamily");function v1c(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(v1c,"isGptCodexFamily");function C1c(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return e==="gpt-5"||e==="gpt-5-mini"||e==="gpt-5-codex"}a(C1c,"isGpt5Family");function b1c(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a(b1c,"isGptFamily");function S1c(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a(S1c,"isGpt51Family");function T1c(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(T1c,"getVerbosityForModelSync");function I1c(t){let e=typeof t=="string"?t:tB(t),r=typeof t=="string"?t:t.family,n=Y_e(t),o=a(s=>{let c=s.toLowerCase().replace(/\./g,"-");return c==="gpt-5-4"||c==="gpt-5-5"||n?!0:!c.startsWith("claude")||c.startsWith("claude-haiku")?!1:!(c.startsWith("claude-1")||c.startsWith("claude-2")||c.startsWith("claude-3")||c.startsWith("claude-instant")||c==="claude-sonnet-4"||c.startsWith("claude-sonnet-4-2")||c==="claude-opus-4"||c.startsWith("claude-opus-4-1")||c.startsWith("claude-opus-4-2"))},"matches");return o(e)||o(r)}a(I1c,"modelSupportsToolSearch");function x1c(t){let e=typeof t=="string"?t:tB(t),r=typeof t=="string"?t:t.family,n=a(l=>l.toLowerCase().replace(/\./g,"-"),"normalize"),o=n(e),s=n(r);if(o.includes("1m")||s.includes("1m"))return!1;let c=a(l=>l.startsWith("claude-fable-5")||l.startsWith("claude-haiku-4-5")||l.startsWith("claude-sonnet-4-6")||l.startsWith("claude-sonnet-4-5")||l.startsWith("claude-sonnet-4")||l.startsWith("claude-opus-4-8")||l.startsWith("claude-opus-4-7")||l.startsWith("claude-opus-4-6")||l.startsWith("claude-opus-4-5")||l.startsWith("claude-opus-4-1")||l.startsWith("claude-opus-4"),"matches");return c(o)||c(s)}a(x1c,"modelSupportsContextEditing")});var _St=I(yk=>{"use strict";p();Object.defineProperty(yk,"__esModule",{value:!0});yk.CUSTOM_TOOL_SEARCH_NAME=void 0;yk.modelSupportsInterleavedThinking=R1c;yk.modelSupportsMemory=k1c;yk.isAnthropicContextEditingEnabled=P1c;yk.modelSupportsExtendedCacheTtl=lqi;yk.isExtendedCacheTtlEnabled=D1c;yk.isExtendedCacheTtlMessagesEnabled=N1c;yk.buildContextManagement=uqi;yk.getContextManagementFromConfig=M1c;var ySt=Hl(),ASt=z3e(),w1c=gk();yk.CUSTOM_TOOL_SEARCH_NAME="tool_search";function R1c(t){let e=t.toLowerCase().replace(/\./g,"-");return e.startsWith("claude-sonnet-4-5")||e.startsWith("claude-sonnet-4")||e.startsWith("claude-haiku-4-5")||e.startsWith("claude-opus-4-5")}a(R1c,"modelSupportsInterleavedThinking");function k1c(t){let e=typeof t=="string"?t:(0,ASt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-fable-5")||s.startsWith("claude-haiku-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-sonnet-4")||s.startsWith("claude-opus-4-8")||s.startsWith("claude-opus-4-7")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4")},"matches");return n(e)||n(r)}a(k1c,"modelSupportsMemory");function P1c(t,e,r){return(typeof t=="string"?(0,ASt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,ASt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(ySt.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(P1c,"isAnthropicContextEditingEnabled");function lqi(t){let e=typeof t=="string"?t:(0,ASt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-fable-5")||s.startsWith("claude-opus-4-8")||s.startsWith("claude-opus-4-7")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-haiku-4-5")},"matches");return n(e)||n(r)}a(lqi,"modelSupportsExtendedCacheTtl");function D1c(t,e,r,n,o){return!lqi(t)||n!==w1c.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(ySt.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(D1c,"isExtendedCacheTtlEnabled");function N1c(t,e,r){return t?e.getExperimentBasedConfig(ySt.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(N1c,"isExtendedCacheTtlMessagesEnabled");function uqi(t,e){if(t==="off")return;let r=[];return(t==="clear-thinking"||t==="clear-both")&&e&&r.push({type:"clear_thinking_20251015",keep:{type:"thinking_turns",value:1}}),(t==="clear-tooluse"||t==="clear-both")&&r.push({type:"clear_tool_uses_20250919",trigger:{type:"input_tokens",value:1e5},keep:{type:"tool_uses",value:3}}),r.length>0?{edits:r}:void 0}a(uqi,"buildContextManagement");function M1c(t,e,r){let n=t.getExperimentBasedConfig(ySt.ConfigKey.AnthropicContextEditingMode,e);return uqi(n,r)}a(M1c,"getContextManagementFromConfig")});var Q4r=I(ESt=>{"use strict";p();Object.defineProperty(ESt,"__esModule",{value:!0});ESt.IToolDeferralService=void 0;var O1c=an();ESt.IToolDeferralService=(0,O1c.createServiceIdentifier)("IToolDeferralService")});var G4r=I(hE=>{"use strict";p();var L1c=hE&&hE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B1c=hE&&hE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),F1c=hE&&hE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;obSt(n,r),e)}a(q1c,"arrayHash");function j1c(t,e){return e=rB(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=H4r(n,r),bSt(t[n],r)),e)}a(j1c,"objectHash");var H1c=a(t=>{if(typeof t=="string"&&t.length<250){let r=new CSt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof j4r.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(K_e)},"hashAsync");hE.hashAsync=H1c;function q4r(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(q4r,"leftRotate");function K_e(t,e=32){return t instanceof ArrayBuffer?(0,j4r.encodeHex)(j4r.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(K_e,"toHexString");var CSt=class t{static{a(this,"StringSHA1")}static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let r=e.length;if(r===0)return;let n=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,c,l;for(s!==0?(c=s,l=-1,s=0):(c=e.charCodeAt(0),l=0);;){let u=c;if(vSt.isHighSurrogate(c))if(l+1>>6,e[r++]=128|(n&63)>>>0):n<65536?(e[r++]=224|(n&61440)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0):(e[r++]=240|(n&1835008)>>>18,e[r++]=128|(n&258048)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0),r>=64&&(this._step(),r-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),r}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),K_e(this._h0)+K_e(this._h1)+K_e(this._h2)+K_e(this._h3)+K_e(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=t._bigBlock32,r=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,r.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,q4r(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let n=this._h0,o=this._h1,s=this._h2,c=this._h3,l=this._h4,u,d,f;for(let h=0;h<80;h++)h<20?(u=o&s|~o&c,d=1518500249):h<40?(u=o^s^c,d=1859775393):h<60?(u=o&s|o&c|s&c,d=2400959708):(u=o^s^c,d=3395469782),f=q4r(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=q4r(o,30),o=n,n=f;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+s&4294967295,this._h3=this._h3+c&4294967295,this._h4=this._h4+l&4294967295}};hE.StringSHA1=CSt});var J_e=I(Y3e=>{"use strict";p();Object.defineProperty(Y3e,"__esModule",{value:!0});Y3e.TelemetryData=void 0;Y3e.eventPropertiesToSimpleObject=$1c;var G1c=Og(),$4r=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=["VSCode.ABExp.Features","abexp.assignmentcontext"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Date.now())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=Date.now())}extendWithEditorAgnosticFields(e){this.properties.editor_version=e.getEditorInfo().format(),this.properties.editor_plugin_version=e.getEditorPluginInfo().format(),this.properties.client_machineid=e.machineId,this.properties.client_sessionid=e.sessionId,this.properties.copilot_version=`copilot/${e.getVersion()}`,this.properties.common_extname=e.getEditorPluginInfo().name,this.properties.common_extversion=e.getEditorPluginInfo().version,this.properties.common_vscodeversion=e.getEditorInfo().format()}extendWithConfigProperties(e,r,n){let o=e.dumpConfig();o["copilot.build"]=r.getBuild(),o["copilot.buildType"]=r.getBuildType(),n.trackingId&&(o["copilot.trackingId"]=n.trackingId),n.organizationsList&&(o.organizations_list=n.organizationsList),n.enterpriseList&&(o.enterprise_list=n.enterpriseList),this.properties={...this.properties,...o}}extendWithRequestId(e){let r={completionId:e.completionId,created:e.created.toString(),headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetry=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromPropertiesHack(e,r){if(e)return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetry.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}updateTimeSinceIssuedAndDisplayed(){let e=Date.now()-this.issuedTime;if(this.measurements.timeSinceIssuedMs===void 0&&(this.measurements.timeSinceIssuedMs=e),this.measurements.timeSinceDisplayedMs===void 0&&this.displayedTime!==void 0){let r=Date.now()-this.displayedTime;this.measurements.timeSinceDisplayedMs=r}}makeReadyForSending(e,r,n){this.extendWithConfigProperties(e,r,n),this.extendWithEditorAgnosticFields(r),this.sanitizeKeys(),this.updateTimeSinceIssuedAndDisplayed();for(let o in this.properties)this.properties[o]===void 0&&delete this.properties[o];V1c(r,this.properties)}};Y3e.TelemetryData=$4r;function $1c(t){if(!t)return;let e={};for(let r in t){let n=t[r];n&&(n.value?e[r]=n.value:e[r]=n)}return e}a($1c,"eventPropertiesToSimpleObject");function V1c(t,e){e.unique_id=(0,G1c.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(V1c,"addRequiredProperties")});var dqi=I(V4r=>{"use strict";p();Object.defineProperty(V4r,"__esModule",{value:!0});V4r.extractThinkingDeltaFromChoice=Y1c;function W1c(t){if(!t)return"";if(t.cot_summary)return t.cot_summary;if(t.reasoning_text)return t.reasoning_text;if(t.reasoning_content)return t.reasoning_content;if(t.reasoning)return t.reasoning;if(t.thinking)return t.thinking}a(W1c,"getThinkingDeltaText");function z1c(t){if(t){if(t.cot_id)return t.cot_id;if(t.reasoning_opaque)return t.reasoning_opaque;if(t.signature)return t.signature}}a(z1c,"getThinkingDeltaId");function Y1c(t){let e=t.message||t.delta;if(!e)return;let r=z1c(e),n=W1c(e);if(e.reasoning_opaque)return{id:e.reasoning_opaque,text:n,encrypted:e.reasoning_opaque};if(r&&n)return{id:r,text:n};if(n)return{text:n};if(r)return{id:r}}a(Y1c,"extractThinkingDeltaFromChoice")});var ISt=I(Die=>{"use strict";p();Object.defineProperty(Die,"__esModule",{value:!0});Die.SSEProcessor=void 0;Die.splitChunk=pqi;Die.convertToAPIJsonData=Z1c;Die.sendCommunicationErrorTelemetry=Z_e;var SSt=Np(),fqi=J_e(),K1c=dqi(),TSt=PU(),zm=RU(),K3e=class t{static{a(this,"APIJsonDataStreaming")}constructor(e){this.model=e,this._text=[],this._newText=[]}get text(){return this._text}append(e){if(e.text){let r=t._removeCR(e.text);this._text.push(r),this._newText.push(r)}if(e.delta?.content){let r=t._removeCR(e.delta.content);this._text.push(r),this._newText.push(r)}if(e.delta?.function_call&&(e.delta.function_call.name||e.delta.function_call.arguments)){let r=t._removeCR(e.delta.function_call.arguments);this._text.push(r),this._newText.push(r)}}flush(){let e=this._newText.join("");return this._newText=[],e}static _removeCR(e){return e.replace(/\r$/g,"")}toJSON(){return{text:this._text,newText:this._newText}}},W4r=class{static{a(this,"StreamingToolCall")}constructor(){this.arguments=""}update(e){let r=!1;return e.id&&(this.id=e.id),e.function?.name&&(this.name=e.function.name),e.function?.arguments&&(this.arguments+=e.function.arguments,r=!0),r}},z4r=class{static{a(this,"StreamingToolCalls")}constructor(){this.toolCalls=[]}getToolCalls(){return this.toolCalls.map(e=>({name:e.name,arguments:e.arguments,id:e.id}))}hasToolCalls(){return this.toolCalls.length>0}update(e){let r=[];return e.delta?.tool_calls?.forEach(n=>{let o;n.id&&(o=this.toolCalls.find(c=>c.id===n.id)),o||(o=this.toolCalls.at(-1)),(!o||n.id&&o.id&&o.id!==n.id)&&(o=new W4r,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function pqi(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!==""),r]}a(pqi,"splitChunk");var Y4r=class t{static{a(this,"SSEProcessor")}constructor(e,r,n,o,s,c){this.logService=e,this.telemetryService=r,this.expectedNumChoices=n,this.response=o,this.body=s,this.cancellationToken=c,this.requestId=(0,TSt.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new z4r,this.functionCallName=void 0}static async create(e,r,n,o,s){let c=o.body.pipeThrough(new TextDecoderStream);return new t(e,r,n,o,c,s)}async*processSSE(e=async()=>{}){try{if(this.expectedNumChoices>1)for await(let r of this.processSSEInner(e))(0,zm.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,zm.isApiUsage)(o)?n=o:r=o;if(await this.maybeCancel("after receiving the completion, but maybe before we got the usage"))return;r&&(r.usage=n,yield r)}}finally{await this.cancel(),this.logService.info(`request done: requestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`)}}async*processSSEInner(e){let r="",n=!1,o=!0,s=!1;for await(let c of this.body){if(await this.maybeCancel("after awaiting body chunk"))return;let[l,u]=pqi(r+c.toString());r=u;for(let d of l){if(d.startsWith(":"))continue;let f=d.slice(5).trim();if(f==="[DONE]"){yield*this.finishSolutions();return}let h;try{h=JSON.parse(f)}catch{this.logService.error(`Error parsing JSON stream data for request id ${this.requestId.headerRequestId}:${d}`),Z_e(this.telemetryService,`Error parsing JSON stream data for request id ${this.requestId.headerRequestId}:`,d);continue}if(h.usage&&(h.copilot_usage&&typeof h.copilot_usage.total_nano_aiu=="number"&&(h.usage.copilot_usage=h.copilot_usage),yield h.usage),h.copilot_confirmation&&J1c(h.copilot_confirmation)&&await e("",0,{text:"",copilotConfirmation:h.copilot_confirmation}),!h.choices){!h.copilot_references&&!h.copilot_confirmation&&(h.error!==void 0?(this.logService.error(`Error in response for request id ${this.requestId.headerRequestId}:${h.error.message}`),Z_e(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new K3e(h.model||""),reason:zm.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),Z_e(this.telemetryService,`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`))),h.copilot_errors&&await e("",0,{text:"",copilotErrors:h.copilot_errors}),h.copilot_references&&await e("",0,{text:"",copilotReferences:h.copilot_references});continue}this.requestId.created===0&&(this.requestId=(0,TSt.getRequestId)(this.response.headers,h),this.requestId.created===0&&h.choices?.length&&(this.requestId.created=Math.floor(Date.now()/1e3)));for(let m=0;m(T?.vulnAnnotations&&(!Array.isArray(T.vulnAnnotations)||!T.vulnAnnotations.every(w=>(0,TSt.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every(TSt.isCodeCitationAnnotation))&&(T.ipCodeCitations=void 0),_=await e(y.text.join(""),g.index,{text:y.flush(),logprobs:g.logprobs,codeVulnAnnotations:T?.vulnAnnotations,ipCitations:T?.ipCodeCitations,copilotReferences:T?.references,copilotToolCalls:T?.toolCalls,copilotToolCallStreamUpdates:T?.toolCallStreamUpdates,_deprecatedCopilotFunctionCalls:T?.functionCalls,beginToolCalls:T?.beginToolCalls,copilotErrors:T?.errors,thinking:A??T?.thinking}),_!==void 0&&(n=!0),await this.maybeCancel("after awaiting finishedCb")),"emitSolution"),v=!0;if(g.delta?.tool_calls){if(!this.toolCalls.hasToolCalls()){let R=g.delta.tool_calls.at(0),x=R?.function?.name;if(x&&(y.text.length&&y.append({index:0,delta:{content:" "}}),await E({beginToolCalls:[{name:x,id:R?.id}]})))continue}let w=this.toolCalls.update(g);if(w.length&&await E({toolCallStreamUpdates:w}))continue}else if(g.delta?.copilot_annotations?.CodeVulnerability||g.delta?.copilot_annotations?.IPCodeCitations){if(await E()||!n&&(y.append(g),await E({vulnAnnotations:g.delta?.copilot_annotations?.CodeVulnerability,ipCodeCitations:g.delta?.copilot_annotations?.IPCodeCitations})))continue}else if(g.delta?.role==="function"){if(g.delta.content)try{let T=JSON.parse(g.delta.content);if(Array.isArray(T)&&await E({references:T}))continue}catch(T){this.logService.error(`Error parsing function references: ${JSON.stringify(T)}`)}}else if(g.delta?.function_call&&(g.delta.function_call.name||g.delta.function_call.arguments))o=!1,this.functionCallName??=g.delta.function_call.name,this.functionCalls[this.functionCallName]??=new K3e(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===zm.FinishedCompletionReason.FunctionCall||g.finish_reason===zm.FinishedCompletionReason.Stop)&&this.functionCallName){let T=this.functionCalls[this.functionCallName],w={name:this.functionCallName,arguments:T.flush()};this.completedFunctionCallIdxs.set(g.index,"function");try{if(await E({functionCalls:[w]}))continue}catch(R){this.logService.error(R)}if(this.functionCalls[this.functionCallName]=null,this.functionCallName=void 0,g.finish_reason===zm.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===zm.FinishedCompletionReason.ToolCalls||g.finish_reason===zm.FinishedCompletionReason.Stop)&&this.toolCalls.hasToolCalls()){v=!0;let T=this.toolCalls.getToolCalls();this.completedFunctionCallIdxs.set(g.index,"tool");let w=T.length>0?T[0].id:void 0;try{if(await E({toolCalls:T,thinking:w&&s?{metadata:{toolId:w}}:void 0}))continue}catch(R){this.logService.error(R)}}if(!(!v&&(y.append(g),await E())||!(g.finish_reason||_!==void 0))){if(yield{solution:y,finishOffset:_,reason:g.finish_reason??zm.FinishedCompletionReason.ClientTrimmed,filterReason:X1c(g),requestId:this.requestId,index:g.index},await this.maybeCancel("after yielding finished choice"))return;o&&(this.solutions[g.index]=null)}}}}for(let[c,l]of Object.entries(this.solutions)){let u=Number(c);if(l!==null&&(yield{solution:l,finishOffset:void 0,reason:zm.FinishedCompletionReason.ClientIterationDone,requestId:this.requestId,index:u},await this.maybeCancel("after yielding after iteration done")))return}if(r.length>0&&!n)try{let c=JSON.parse(r);c.error!==void 0&&(this.logService.error(c.error,`Error in response: ${c.error.message}`),Z_e(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),Z_e(this.telemetryService,`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`)}}async*finishSolutions(){for(let[e,r]of Object.entries(this.solutions)){let n=Number(e);if(r!==null){if(this.completedFunctionCallIdxs.has(n)){yield{solution:r,finishOffset:void 0,reason:this.completedFunctionCallIdxs.get(n)==="function"?zm.FinishedCompletionReason.FunctionCall:zm.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:zm.FinishedCompletionReason.ClientDone,requestId:this.requestId,index:n},await this.maybeCancel("after yielding on DONE"))return}}}async maybeCancel(e){return this.cancellationToken?.isCancellationRequested?(this.logService.debug("Cancelled: "+e),await this.cancel(),!0):!1}async cancel(){await this.response.body.destroy()}logChoice(e){let r={...e};delete r.index,delete r.content_filter_results,delete r.content_filter_offsets,this.logService.trace(`choice ${JSON.stringify(r)}`)}};Die.SSEProcessor=Y4r;function J1c(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(J1c,"isCopilotConfirmation");function Z1c(t){return{text:t.text.join(""),tokens:t.text}}a(Z1c,"convertToAPIJsonData");function X1c(t){if(t.finish_reason===zm.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return zm.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return zm.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return zm.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return zm.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return zm.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return zm.FilterReason.Prompt;if(t.content_filter_results){for(let e of Object.keys(t.content_filter_results))if(t.content_filter_results[e]?.filtered)return e}}}a(X1c,"choiceToFilterReason");function Z_e(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=fqi.TelemetryData.createAndMarkAsIssued({context:"fetch",level:SSt.LogLevel[SSt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=fqi.TelemetryData.createAndMarkAsIssued({context:"fetch",level:SSt.LogLevel[SSt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a(Z_e,"sendCommunicationErrorTelemetry")});var X3e=I(X_e=>{"use strict";p();Object.defineProperty(X_e,"__esModule",{value:!0});X_e.sendEngineMessagesLengthTelemetry=yqi;X_e.sendEngineMessagesTelemetry=_qi;X_e.sendResponsesApiCompactionTelemetry=dTc;X_e.prepareChatCompletionForReturn=fTc;var eTc=wo(),gqi=G4r(),wSt=b2(),Aqi=Og(),tTc=$3e(),J4r=bh(),Z3e=J_e(),rTc=RU(),nTc=ISt();function yqi(t,e,r,n,o){let s=n?"output":"input",c=r.properties.modelCallId;if(!c){o?.warn("[TELEMETRY] modelCallId not found in telemetryData, input/output messages cannot be linked");return}let l=e.map(f=>{let h={...f,content:typeof f.content=="string"?f.content.length:Array.isArray(f.content)?f.content.reduce((m,g)=>typeof g=="string"?m+g.length:g.type==="text"?m+(g.text?.length||0):m,0):0};return"tool_calls"in f&&f.tool_calls&&Array.isArray(f.tool_calls)&&(h.tool_calls=f.tool_calls.map(m=>({...m,function:m.function?{...m.function,arguments:typeof m.function.arguments=="string"?m.function.arguments.length:m.function.arguments}:m.function}))),h}),u={};for(let[f,h]of Object.entries(r.properties))if(f.startsWith("request.option.tools"))if(typeof h=="string")try{let m=JSON.parse(h);Array.isArray(m)?u[f]=m.length.toString():u[f]=h.length.toString()}catch{u[f]=h.length.toString()}else Array.isArray(h)?u[f]=h.length.toString():u[f]="0";else u[f]=h;let d=Z3e.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,J4r.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,J4r.multiplexProperties)(d.properties),d.measurements)}a(yqi,"sendEngineMessagesLengthTelemetry");var hqi=new wSt.LRUCache(1e3),mqi=new wSt.LRUCache(500),J3e=new wSt.LRUCache(1e3),xSt={headerRequestId:null},K4r=new wSt.LRUCache(100);function iTc(t){let e=J3e.get(t);if(e!==void 0){let r=e+1;return J3e.set(t,r),r}else return J3e.set(t,1),1}a(iTc,"updateHeaderRequestIdTracker");function oTc(t){let e=K4r.get(t);if(e!==void 0){let r=e+1;return K4r.set(t,r),r}else return K4r.set(t,1),1}a(oTc,"updateConversationTracker");function sTc(t,e,r){let n={};for(let[h,m]of Object.entries(e.properties))h.startsWith("request.option.")&&(n[h]=m);if(Object.keys(n).length===0)return;let o=e.properties.conversationId||e.properties.sessionId||"unknown",s=e.properties.headerRequestId||"unknown",c=(0,gqi.hash)(n).toString(),l=mqi.get(c);if(!l)l=(0,Aqi.generateUuid)(),mqi.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(eFe,"__esModule",{value:!0});eFe.CompactionDataContainer=void 0;eFe.rawPartAsCompactionData=hTc;var pTc=wo(),Eqi=g3e(),Z4r=class extends pTc.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:Eqi.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};eFe.CompactionDataContainer=Z4r;function hTc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Eqi.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(hTc,"rawPartAsCompactionData")});var bqi=I(tFe=>{"use strict";p();Object.defineProperty(tFe,"__esModule",{value:!0});tFe.PhaseDataContainer=void 0;tFe.rawPartAsPhaseData=gTc;var mTc=wo(),Cqi=g3e(),X4r=class extends mTc.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:Cqi.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};tFe.PhaseDataContainer=X4r;function gTc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Cqi.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(gTc,"rawPartAsPhaseData")});var Iqi=I(nB=>{"use strict";p();Object.defineProperty(nB,"__esModule",{value:!0});nB.StatefulMarkerContainer=void 0;nB.rawPartAsStatefulMarker=Tqi;nB.encodeStatefulMarker=ATc;nB.decodeStatefulMarker=yTc;nB.getAllStatefulMarkersAndIndicies=rLr;nB.getStatefulMarkerAndIndex=_Tc;nB.getIndexOfStatefulMarker=ETc;var eLr=wo(),Sqi=g3e(),tLr=class extends eLr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:Sqi.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};nB.StatefulMarkerContainer=tLr;function Tqi(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Sqi.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(Tqi,"rawPartAsStatefulMarker");function ATc(t,e){return new TextEncoder().encode(t+"\\"+e)}a(ATc,"encodeStatefulMarker");function yTc(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(yTc,"decodeStatefulMarker");function*rLr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===eLr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===eLr.Raw.ChatCompletionContentPartKind.Opaque){let o=Tqi(n);o&&(yield{statefulMarker:o,index:e})}}}}a(rLr,"getAllStatefulMarkersAndIndicies");function _Tc(t,e){for(let r of rLr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(_Tc,"getStatefulMarkerAndIndex");function ETc(t,e){for(let r of rLr(e))if(r.statefulMarker.marker===t)return r.index}a(ETc,"getIndexOfStatefulMarker")});var Rqi=I(BU=>{"use strict";p();var vTc=BU&&BU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CTc=BU&&BU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wqi=BU&&BU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(Yi,"__esModule",{value:!0});Yi.getModelCapabilityOverride=r1c;Yi.getModelId=tB;Yi.isHiddenModelA=n1c;Yi.isHiddenModelB=M4r;Yi.isHiddenModelE=uSt;Yi.isHiddenModelF=dSt;Yi.isHiddenFamilyH=fSt;Yi.isHiddenModelK=i1c;Yi.isGpt54=O4r;Yi.isGpt55=o1c;Yi.isGpt56=Y_e;Yi.isGpt53Codex=L4r;Yi.isKimiFamily=pSt;Yi.isVSCModelA=hSt;Yi.isVSCModelB=mSt;Yi.isVSCModelReplaceStringSet=V3e;Yi.isVSCModelC=s1c;Yi.isVSCModelD=a1c;Yi.isVSCModelE=c1c;Yi.isGpt52CodexFamily=B4r;Yi.isGpt52Family=F4r;Yi.modelPrefersInstructionsInUserMessage=l1c;Yi.modelPrefersInstructionsAfterHistory=u1c;Yi.modelSupportsApplyPatch=d1c;Yi.modelPrefersJsonNotebookRepresentation=f1c;Yi.modelSupportsReplaceString=p1c;Yi.modelSupportsMultiReplaceString=uqi;Yi.modelCanUseReplaceStringExclusively=h1c;Yi.modelShouldUseReplaceStringHealing=m1c;Yi.modelCanUseMcpResultImageURL=g1c;Yi.modelCanUseImageURL=A1c;Yi.modelSupportsPDFDocuments=y1c;Yi.modelSupportCacheBreakPoints=_1c;Yi.modelCanUseApplyPatchExclusively=E1c;Yi.modelNeedsStrongReplaceStringHint=v1c;Yi.modelSupportsSimplifiedApplyPatchInstructions=C1c;Yi.isAnthropicFamily=W3e;Yi.isGeminiFamily=U4r;Yi.isMinimaxFamily=gSt;Yi.isXAiFamily=Q4r;Yi.isGpt5PlusFamily=ASt;Yi.isGptCodexFamily=b1c;Yi.isGpt5Family=S1c;Yi.isGptFamily=T1c;Yi.isGpt51Family=I1c;Yi.getVerbosityForModelSync=x1c;Yi.modelSupportsToolSearch=w1c;Yi.modelSupportsContextEditing=R1c;var Oh=vOr(),KSc=Hl(),JSc=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],cqi=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],rqi=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],nqi=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],iqi=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],oqi=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],sqi=[],aqi=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],ZSc=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],XSc=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],e1c=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],lqi="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",t1c=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"];function r1c(t,e){return e.getConfig(KSc.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(r1c,"getModelCapabilityOverride");function tB(t){return"id"in t?t.id:t.model}a(tB,"getModelId");function n1c(t){let e=(0,Oh.getCachedSha256Hash)(t.family);return JSc.includes(e)}a(n1c,"isHiddenModelA");function M4r(t){let e=(0,Oh.getCachedSha256Hash)(typeof t=="string"?t:t.family);return cqi.includes(e)}a(M4r,"isHiddenModelB");function uSt(t){let e=(0,Oh.getCachedSha256Hash)(t.family);return ZSc.includes(e)}a(uSt,"isHiddenModelE");function dSt(t){let e=(0,Oh.getCachedSha256Hash)(t.family);return XSc.includes(e)}a(dSt,"isHiddenModelF");function fSt(t){let e=(0,Oh.getCachedSha256Hash)(t.family);return t1c.includes(e)}a(fSt,"isHiddenFamilyH");function i1c(t){return(0,Oh.getCachedSha256Hash)(t.family)===lqi}a(i1c,"isHiddenModelK");function O4r(t){let e=(0,Oh.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||e1c.includes(e)}a(O4r,"isGpt54");function o1c(t){let e=(0,Oh.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||cqi.includes(e)}a(o1c,"isGpt55");function Y_e(t){let e=typeof t=="string"?t:t.family;return e==="gpt-5.6-sol"||e==="gpt-5.6-terra"||e==="gpt-5.6-luna"}a(Y_e,"isGpt56");function L4r(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(L4r,"isGpt53Codex");function pSt(t){let e=a(r=>{let n=r.toLowerCase();return n.includes("kimi-k2.6")||n.includes("kimi-k2.7-code")},"matches");return typeof t=="string"?e(t):e(t.family)||e(tB(t))}a(pSt,"isKimiFamily");function hSt(t){let e=(0,Oh.getCachedSha256Hash)(tB(t)),r=(0,Oh.getCachedSha256Hash)(t.family);return rqi.includes(e)||rqi.includes(r)}a(hSt,"isVSCModelA");function mSt(t){let e=(0,Oh.getCachedSha256Hash)(tB(t)),r=(0,Oh.getCachedSha256Hash)(t.family);return nqi.includes(e)||nqi.includes(r)}a(mSt,"isVSCModelB");function V3e(t){let e=(0,Oh.getCachedSha256Hash)(tB(t)),r=(0,Oh.getCachedSha256Hash)(t.family);return aqi.includes(e)||aqi.includes(r)}a(V3e,"isVSCModelReplaceStringSet");function s1c(t){let e=(0,Oh.getCachedSha256Hash)(tB(t)),r=(0,Oh.getCachedSha256Hash)(t.family);return iqi.includes(e)||iqi.includes(r)}a(s1c,"isVSCModelC");function a1c(t){let e=(0,Oh.getCachedSha256Hash)(tB(t)),r=(0,Oh.getCachedSha256Hash)(t.family);return oqi.includes(e)||oqi.includes(r)}a(a1c,"isVSCModelD");function c1c(t){let e=tB(t),r=(0,Oh.getCachedSha256Hash)(e),n=(0,Oh.getCachedSha256Hash)(t.family);return t.name.startsWith("vscModelE")||t.family.startsWith("vscModelE")||e.startsWith("vscModelE")||sqi.includes(r)||sqi.includes(n)}a(c1c,"isVSCModelE");function B4r(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(B4r,"isGpt52CodexFamily");function F4r(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a(F4r,"isGpt52Family");function l1c(t){return t.includes("claude-3.5-sonnet")}a(l1c,"modelPrefersInstructionsInUserMessage");function u1c(t){return t.includes("claude-3.5-sonnet")}a(u1c,"modelPrefersInstructionsAfterHistory");function d1c(t){return V3e(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||B4r(t.family)||L4r(t.family)||hSt(t)||mSt(t)||F4r(t.family)||O4r(t)||M4r(t)||Y_e(t)}a(d1c,"modelSupportsApplyPatch");function f1c(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||B4r(t.family)||L4r(t.family)||F4r(t.family)||O4r(t)||M4r(t)||Y_e(t)}a(f1c,"modelPrefersJsonNotebookRepresentation");function p1c(t){return U4r(t)||Q4r(t)||uqi(t)||dSt(t)||gSt(t)||fSt(t)||pSt(t)}a(p1c,"modelSupportsReplaceString");function uqi(t){return W3e(t)||uSt(t)||V3e(t)||gSt(t)||fSt(t)||pSt(t)}a(uqi,"modelSupportsMultiReplaceString");function h1c(t){return W3e(t)||Q4r(t)||uSt(t)||t.family.toLowerCase().includes("gemini-3")||V3e(t)||dSt(t)||gSt(t)||fSt(t)||pSt(t)}a(h1c,"modelCanUseReplaceStringExclusively");function m1c(t){return t.family.includes("gemini-2")}a(m1c,"modelShouldUseReplaceStringHealing");function g1c(t){return!W3e(t)&&!uSt(t)}a(g1c,"modelCanUseMcpResultImageURL");function A1c(t){return!0}a(A1c,"modelCanUseImageURL");function y1c(t){return W3e(t)||ASt(t)||Y_e(t)}a(y1c,"modelSupportsPDFDocuments");function _1c(t){return Y_e(t)}a(_1c,"modelSupportCacheBreakPoints");function E1c(t){return V3e(t)?!1:ASt(t)||hSt(t)||mSt(t)}a(E1c,"modelCanUseApplyPatchExclusively");function v1c(t){return U4r(t)||dSt(t)}a(v1c,"modelNeedsStrongReplaceStringHint");function C1c(t){return ASt(t)||hSt(t)||mSt(t)}a(C1c,"modelSupportsSimplifiedApplyPatchInstructions");function W3e(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(W3e,"isAnthropicFamily");function U4r(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,Oh.getCachedSha256Hash)(e)===lqi}a(U4r,"isGeminiFamily");function gSt(t){return t.family.toLowerCase().includes("minimax")}a(gSt,"isMinimaxFamily");function Q4r(t){return t.family.startsWith("grok")}a(Q4r,"isXAiFamily");function ASt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(ASt,"isGpt5PlusFamily");function b1c(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(b1c,"isGptCodexFamily");function S1c(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return e==="gpt-5"||e==="gpt-5-mini"||e==="gpt-5-codex"}a(S1c,"isGpt5Family");function T1c(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a(T1c,"isGptFamily");function I1c(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a(I1c,"isGpt51Family");function x1c(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(x1c,"getVerbosityForModelSync");function w1c(t){let e=typeof t=="string"?t:tB(t),r=typeof t=="string"?t:t.family,n=Y_e(t),o=a(s=>{let c=s.toLowerCase().replace(/\./g,"-");return c==="gpt-5-4"||c==="gpt-5-5"||n?!0:!c.startsWith("claude")||c.startsWith("claude-haiku")?!1:!(c.startsWith("claude-1")||c.startsWith("claude-2")||c.startsWith("claude-3")||c.startsWith("claude-instant")||c==="claude-sonnet-4"||c.startsWith("claude-sonnet-4-2")||c==="claude-opus-4"||c.startsWith("claude-opus-4-1")||c.startsWith("claude-opus-4-2"))},"matches");return o(e)||o(r)}a(w1c,"modelSupportsToolSearch");function R1c(t){let e=typeof t=="string"?t:tB(t),r=typeof t=="string"?t:t.family,n=a(l=>l.toLowerCase().replace(/\./g,"-"),"normalize"),o=n(e),s=n(r);if(o.includes("1m")||s.includes("1m"))return!1;let c=a(l=>l.startsWith("claude-fable-5")||l.startsWith("claude-haiku-4-5")||l.startsWith("claude-sonnet-4-6")||l.startsWith("claude-sonnet-4-5")||l.startsWith("claude-sonnet-4")||l.startsWith("claude-opus-4-8")||l.startsWith("claude-opus-4-7")||l.startsWith("claude-opus-4-6")||l.startsWith("claude-opus-4-5")||l.startsWith("claude-opus-4-1")||l.startsWith("claude-opus-4"),"matches");return c(o)||c(s)}a(R1c,"modelSupportsContextEditing")});var ESt=I(yk=>{"use strict";p();Object.defineProperty(yk,"__esModule",{value:!0});yk.CUSTOM_TOOL_SEARCH_NAME=void 0;yk.modelSupportsInterleavedThinking=P1c;yk.modelSupportsMemory=D1c;yk.isAnthropicContextEditingEnabled=N1c;yk.modelSupportsExtendedCacheTtl=dqi;yk.isExtendedCacheTtlEnabled=M1c;yk.isExtendedCacheTtlMessagesEnabled=O1c;yk.buildContextManagement=fqi;yk.getContextManagementFromConfig=L1c;var _St=Hl(),ySt=z3e(),k1c=gk();yk.CUSTOM_TOOL_SEARCH_NAME="tool_search";function P1c(t){let e=t.toLowerCase().replace(/\./g,"-");return e.startsWith("claude-sonnet-4-5")||e.startsWith("claude-sonnet-4")||e.startsWith("claude-haiku-4-5")||e.startsWith("claude-opus-4-5")}a(P1c,"modelSupportsInterleavedThinking");function D1c(t){let e=typeof t=="string"?t:(0,ySt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-fable-5")||s.startsWith("claude-haiku-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-sonnet-4")||s.startsWith("claude-opus-4-8")||s.startsWith("claude-opus-4-7")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4")},"matches");return n(e)||n(r)}a(D1c,"modelSupportsMemory");function N1c(t,e,r){return(typeof t=="string"?(0,ySt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,ySt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(_St.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(N1c,"isAnthropicContextEditingEnabled");function dqi(t){let e=typeof t=="string"?t:(0,ySt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-fable-5")||s.startsWith("claude-opus-4-8")||s.startsWith("claude-opus-4-7")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-haiku-4-5")},"matches");return n(e)||n(r)}a(dqi,"modelSupportsExtendedCacheTtl");function M1c(t,e,r,n,o){return!dqi(t)||n!==k1c.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(_St.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(M1c,"isExtendedCacheTtlEnabled");function O1c(t,e,r){return t?e.getExperimentBasedConfig(_St.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(O1c,"isExtendedCacheTtlMessagesEnabled");function fqi(t,e){if(t==="off")return;let r=[];return(t==="clear-thinking"||t==="clear-both")&&e&&r.push({type:"clear_thinking_20251015",keep:{type:"thinking_turns",value:1}}),(t==="clear-tooluse"||t==="clear-both")&&r.push({type:"clear_tool_uses_20250919",trigger:{type:"input_tokens",value:1e5},keep:{type:"tool_uses",value:3}}),r.length>0?{edits:r}:void 0}a(fqi,"buildContextManagement");function L1c(t,e,r){let n=t.getExperimentBasedConfig(_St.ConfigKey.AnthropicContextEditingMode,e);return fqi(n,r)}a(L1c,"getContextManagementFromConfig")});var q4r=I(vSt=>{"use strict";p();Object.defineProperty(vSt,"__esModule",{value:!0});vSt.IToolDeferralService=void 0;var B1c=an();vSt.IToolDeferralService=(0,B1c.createServiceIdentifier)("IToolDeferralService")});var $4r=I(hE=>{"use strict";p();var F1c=hE&&hE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),U1c=hE&&hE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Q1c=hE&&hE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oSSt(n,r),e)}a(H1c,"arrayHash");function G1c(t,e){return e=rB(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=G4r(n,r),SSt(t[n],r)),e)}a(G1c,"objectHash");var $1c=a(t=>{if(typeof t=="string"&&t.length<250){let r=new bSt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof H4r.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(K_e)},"hashAsync");hE.hashAsync=$1c;function j4r(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(j4r,"leftRotate");function K_e(t,e=32){return t instanceof ArrayBuffer?(0,H4r.encodeHex)(H4r.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(K_e,"toHexString");var bSt=class t{static{a(this,"StringSHA1")}static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let r=e.length;if(r===0)return;let n=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,c,l;for(s!==0?(c=s,l=-1,s=0):(c=e.charCodeAt(0),l=0);;){let u=c;if(CSt.isHighSurrogate(c))if(l+1>>6,e[r++]=128|(n&63)>>>0):n<65536?(e[r++]=224|(n&61440)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0):(e[r++]=240|(n&1835008)>>>18,e[r++]=128|(n&258048)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0),r>=64&&(this._step(),r-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),r}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),K_e(this._h0)+K_e(this._h1)+K_e(this._h2)+K_e(this._h3)+K_e(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=t._bigBlock32,r=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,r.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,j4r(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let n=this._h0,o=this._h1,s=this._h2,c=this._h3,l=this._h4,u,d,f;for(let h=0;h<80;h++)h<20?(u=o&s|~o&c,d=1518500249):h<40?(u=o^s^c,d=1859775393):h<60?(u=o&s|o&c|s&c,d=2400959708):(u=o^s^c,d=3395469782),f=j4r(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=j4r(o,30),o=n,n=f;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+s&4294967295,this._h3=this._h3+c&4294967295,this._h4=this._h4+l&4294967295}};hE.StringSHA1=bSt});var J_e=I(Y3e=>{"use strict";p();Object.defineProperty(Y3e,"__esModule",{value:!0});Y3e.TelemetryData=void 0;Y3e.eventPropertiesToSimpleObject=W1c;var V1c=Lg(),V4r=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=["VSCode.ABExp.Features","abexp.assignmentcontext"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Date.now())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=Date.now())}extendWithEditorAgnosticFields(e){this.properties.editor_version=e.getEditorInfo().format(),this.properties.editor_plugin_version=e.getEditorPluginInfo().format(),this.properties.client_machineid=e.machineId,this.properties.client_sessionid=e.sessionId,this.properties.copilot_version=`copilot/${e.getVersion()}`,this.properties.common_extname=e.getEditorPluginInfo().name,this.properties.common_extversion=e.getEditorPluginInfo().version,this.properties.common_vscodeversion=e.getEditorInfo().format()}extendWithConfigProperties(e,r,n){let o=e.dumpConfig();o["copilot.build"]=r.getBuild(),o["copilot.buildType"]=r.getBuildType(),n.trackingId&&(o["copilot.trackingId"]=n.trackingId),n.organizationsList&&(o.organizations_list=n.organizationsList),n.enterpriseList&&(o.enterprise_list=n.enterpriseList),this.properties={...this.properties,...o}}extendWithRequestId(e){let r={completionId:e.completionId,created:e.created.toString(),headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetry=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromPropertiesHack(e,r){if(e)return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetry.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}updateTimeSinceIssuedAndDisplayed(){let e=Date.now()-this.issuedTime;if(this.measurements.timeSinceIssuedMs===void 0&&(this.measurements.timeSinceIssuedMs=e),this.measurements.timeSinceDisplayedMs===void 0&&this.displayedTime!==void 0){let r=Date.now()-this.displayedTime;this.measurements.timeSinceDisplayedMs=r}}makeReadyForSending(e,r,n){this.extendWithConfigProperties(e,r,n),this.extendWithEditorAgnosticFields(r),this.sanitizeKeys(),this.updateTimeSinceIssuedAndDisplayed();for(let o in this.properties)this.properties[o]===void 0&&delete this.properties[o];z1c(r,this.properties)}};Y3e.TelemetryData=V4r;function W1c(t){if(!t)return;let e={};for(let r in t){let n=t[r];n&&(n.value?e[r]=n.value:e[r]=n)}return e}a(W1c,"eventPropertiesToSimpleObject");function z1c(t,e){e.unique_id=(0,V1c.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(z1c,"addRequiredProperties")});var pqi=I(W4r=>{"use strict";p();Object.defineProperty(W4r,"__esModule",{value:!0});W4r.extractThinkingDeltaFromChoice=J1c;function Y1c(t){if(!t)return"";if(t.cot_summary)return t.cot_summary;if(t.reasoning_text)return t.reasoning_text;if(t.reasoning_content)return t.reasoning_content;if(t.reasoning)return t.reasoning;if(t.thinking)return t.thinking}a(Y1c,"getThinkingDeltaText");function K1c(t){if(t){if(t.cot_id)return t.cot_id;if(t.reasoning_opaque)return t.reasoning_opaque;if(t.signature)return t.signature}}a(K1c,"getThinkingDeltaId");function J1c(t){let e=t.message||t.delta;if(!e)return;let r=K1c(e),n=Y1c(e);if(e.reasoning_opaque)return{id:e.reasoning_opaque,text:n,encrypted:e.reasoning_opaque};if(r&&n)return{id:r,text:n};if(n)return{text:n};if(r)return{id:r}}a(J1c,"extractThinkingDeltaFromChoice")});var xSt=I(Nie=>{"use strict";p();Object.defineProperty(Nie,"__esModule",{value:!0});Nie.SSEProcessor=void 0;Nie.splitChunk=mqi;Nie.convertToAPIJsonData=eTc;Nie.sendCommunicationErrorTelemetry=Z_e;var TSt=Np(),hqi=J_e(),Z1c=pqi(),ISt=PU(),Ym=RU(),K3e=class t{static{a(this,"APIJsonDataStreaming")}constructor(e){this.model=e,this._text=[],this._newText=[]}get text(){return this._text}append(e){if(e.text){let r=t._removeCR(e.text);this._text.push(r),this._newText.push(r)}if(e.delta?.content){let r=t._removeCR(e.delta.content);this._text.push(r),this._newText.push(r)}if(e.delta?.function_call&&(e.delta.function_call.name||e.delta.function_call.arguments)){let r=t._removeCR(e.delta.function_call.arguments);this._text.push(r),this._newText.push(r)}}flush(){let e=this._newText.join("");return this._newText=[],e}static _removeCR(e){return e.replace(/\r$/g,"")}toJSON(){return{text:this._text,newText:this._newText}}},z4r=class{static{a(this,"StreamingToolCall")}constructor(){this.arguments=""}update(e){let r=!1;return e.id&&(this.id=e.id),e.function?.name&&(this.name=e.function.name),e.function?.arguments&&(this.arguments+=e.function.arguments,r=!0),r}},Y4r=class{static{a(this,"StreamingToolCalls")}constructor(){this.toolCalls=[]}getToolCalls(){return this.toolCalls.map(e=>({name:e.name,arguments:e.arguments,id:e.id}))}hasToolCalls(){return this.toolCalls.length>0}update(e){let r=[];return e.delta?.tool_calls?.forEach(n=>{let o;n.id&&(o=this.toolCalls.find(c=>c.id===n.id)),o||(o=this.toolCalls.at(-1)),(!o||n.id&&o.id&&o.id!==n.id)&&(o=new z4r,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function mqi(t){let e=t.split(` +`),r=e.pop();return[e.filter(n=>n!==""),r]}a(mqi,"splitChunk");var K4r=class t{static{a(this,"SSEProcessor")}constructor(e,r,n,o,s,c){this.logService=e,this.telemetryService=r,this.expectedNumChoices=n,this.response=o,this.body=s,this.cancellationToken=c,this.requestId=(0,ISt.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new Y4r,this.functionCallName=void 0}static async create(e,r,n,o,s){let c=o.body.pipeThrough(new TextDecoderStream);return new t(e,r,n,o,c,s)}async*processSSE(e=async()=>{}){try{if(this.expectedNumChoices>1)for await(let r of this.processSSEInner(e))(0,Ym.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,Ym.isApiUsage)(o)?n=o:r=o;if(await this.maybeCancel("after receiving the completion, but maybe before we got the usage"))return;r&&(r.usage=n,yield r)}}finally{await this.cancel(),this.logService.info(`request done: requestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`)}}async*processSSEInner(e){let r="",n=!1,o=!0,s=!1;for await(let c of this.body){if(await this.maybeCancel("after awaiting body chunk"))return;let[l,u]=mqi(r+c.toString());r=u;for(let d of l){if(d.startsWith(":"))continue;let f=d.slice(5).trim();if(f==="[DONE]"){yield*this.finishSolutions();return}let h;try{h=JSON.parse(f)}catch{this.logService.error(`Error parsing JSON stream data for request id ${this.requestId.headerRequestId}:${d}`),Z_e(this.telemetryService,`Error parsing JSON stream data for request id ${this.requestId.headerRequestId}:`,d);continue}if(h.usage&&(h.copilot_usage&&typeof h.copilot_usage.total_nano_aiu=="number"&&(h.usage.copilot_usage=h.copilot_usage),yield h.usage),h.copilot_confirmation&&X1c(h.copilot_confirmation)&&await e("",0,{text:"",copilotConfirmation:h.copilot_confirmation}),!h.choices){!h.copilot_references&&!h.copilot_confirmation&&(h.error!==void 0?(this.logService.error(`Error in response for request id ${this.requestId.headerRequestId}:${h.error.message}`),Z_e(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new K3e(h.model||""),reason:Ym.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),Z_e(this.telemetryService,`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`))),h.copilot_errors&&await e("",0,{text:"",copilotErrors:h.copilot_errors}),h.copilot_references&&await e("",0,{text:"",copilotReferences:h.copilot_references});continue}this.requestId.created===0&&(this.requestId=(0,ISt.getRequestId)(this.response.headers,h),this.requestId.created===0&&h.choices?.length&&(this.requestId.created=Math.floor(Date.now()/1e3)));for(let m=0;m(T?.vulnAnnotations&&(!Array.isArray(T.vulnAnnotations)||!T.vulnAnnotations.every(w=>(0,ISt.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every(ISt.isCodeCitationAnnotation))&&(T.ipCodeCitations=void 0),_=await e(y.text.join(""),g.index,{text:y.flush(),logprobs:g.logprobs,codeVulnAnnotations:T?.vulnAnnotations,ipCitations:T?.ipCodeCitations,copilotReferences:T?.references,copilotToolCalls:T?.toolCalls,copilotToolCallStreamUpdates:T?.toolCallStreamUpdates,_deprecatedCopilotFunctionCalls:T?.functionCalls,beginToolCalls:T?.beginToolCalls,copilotErrors:T?.errors,thinking:A??T?.thinking}),_!==void 0&&(n=!0),await this.maybeCancel("after awaiting finishedCb")),"emitSolution"),v=!0;if(g.delta?.tool_calls){if(!this.toolCalls.hasToolCalls()){let R=g.delta.tool_calls.at(0),x=R?.function?.name;if(x&&(y.text.length&&y.append({index:0,delta:{content:" "}}),await E({beginToolCalls:[{name:x,id:R?.id}]})))continue}let w=this.toolCalls.update(g);if(w.length&&await E({toolCallStreamUpdates:w}))continue}else if(g.delta?.copilot_annotations?.CodeVulnerability||g.delta?.copilot_annotations?.IPCodeCitations){if(await E()||!n&&(y.append(g),await E({vulnAnnotations:g.delta?.copilot_annotations?.CodeVulnerability,ipCodeCitations:g.delta?.copilot_annotations?.IPCodeCitations})))continue}else if(g.delta?.role==="function"){if(g.delta.content)try{let T=JSON.parse(g.delta.content);if(Array.isArray(T)&&await E({references:T}))continue}catch(T){this.logService.error(`Error parsing function references: ${JSON.stringify(T)}`)}}else if(g.delta?.function_call&&(g.delta.function_call.name||g.delta.function_call.arguments))o=!1,this.functionCallName??=g.delta.function_call.name,this.functionCalls[this.functionCallName]??=new K3e(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===Ym.FinishedCompletionReason.FunctionCall||g.finish_reason===Ym.FinishedCompletionReason.Stop)&&this.functionCallName){let T=this.functionCalls[this.functionCallName],w={name:this.functionCallName,arguments:T.flush()};this.completedFunctionCallIdxs.set(g.index,"function");try{if(await E({functionCalls:[w]}))continue}catch(R){this.logService.error(R)}if(this.functionCalls[this.functionCallName]=null,this.functionCallName=void 0,g.finish_reason===Ym.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===Ym.FinishedCompletionReason.ToolCalls||g.finish_reason===Ym.FinishedCompletionReason.Stop)&&this.toolCalls.hasToolCalls()){v=!0;let T=this.toolCalls.getToolCalls();this.completedFunctionCallIdxs.set(g.index,"tool");let w=T.length>0?T[0].id:void 0;try{if(await E({toolCalls:T,thinking:w&&s?{metadata:{toolId:w}}:void 0}))continue}catch(R){this.logService.error(R)}}if(!(!v&&(y.append(g),await E())||!(g.finish_reason||_!==void 0))){if(yield{solution:y,finishOffset:_,reason:g.finish_reason??Ym.FinishedCompletionReason.ClientTrimmed,filterReason:tTc(g),requestId:this.requestId,index:g.index},await this.maybeCancel("after yielding finished choice"))return;o&&(this.solutions[g.index]=null)}}}}for(let[c,l]of Object.entries(this.solutions)){let u=Number(c);if(l!==null&&(yield{solution:l,finishOffset:void 0,reason:Ym.FinishedCompletionReason.ClientIterationDone,requestId:this.requestId,index:u},await this.maybeCancel("after yielding after iteration done")))return}if(r.length>0&&!n)try{let c=JSON.parse(r);c.error!==void 0&&(this.logService.error(c.error,`Error in response: ${c.error.message}`),Z_e(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),Z_e(this.telemetryService,`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`)}}async*finishSolutions(){for(let[e,r]of Object.entries(this.solutions)){let n=Number(e);if(r!==null){if(this.completedFunctionCallIdxs.has(n)){yield{solution:r,finishOffset:void 0,reason:this.completedFunctionCallIdxs.get(n)==="function"?Ym.FinishedCompletionReason.FunctionCall:Ym.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:Ym.FinishedCompletionReason.ClientDone,requestId:this.requestId,index:n},await this.maybeCancel("after yielding on DONE"))return}}}async maybeCancel(e){return this.cancellationToken?.isCancellationRequested?(this.logService.debug("Cancelled: "+e),await this.cancel(),!0):!1}async cancel(){await this.response.body.destroy()}logChoice(e){let r={...e};delete r.index,delete r.content_filter_results,delete r.content_filter_offsets,this.logService.trace(`choice ${JSON.stringify(r)}`)}};Nie.SSEProcessor=K4r;function X1c(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(X1c,"isCopilotConfirmation");function eTc(t){return{text:t.text.join(""),tokens:t.text}}a(eTc,"convertToAPIJsonData");function tTc(t){if(t.finish_reason===Ym.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return Ym.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return Ym.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return Ym.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return Ym.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return Ym.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return Ym.FilterReason.Prompt;if(t.content_filter_results){for(let e of Object.keys(t.content_filter_results))if(t.content_filter_results[e]?.filtered)return e}}}a(tTc,"choiceToFilterReason");function Z_e(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=hqi.TelemetryData.createAndMarkAsIssued({context:"fetch",level:TSt.LogLevel[TSt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=hqi.TelemetryData.createAndMarkAsIssued({context:"fetch",level:TSt.LogLevel[TSt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a(Z_e,"sendCommunicationErrorTelemetry")});var X3e=I(X_e=>{"use strict";p();Object.defineProperty(X_e,"__esModule",{value:!0});X_e.sendEngineMessagesLengthTelemetry=Eqi;X_e.sendEngineMessagesTelemetry=vqi;X_e.sendResponsesApiCompactionTelemetry=pTc;X_e.prepareChatCompletionForReturn=hTc;var rTc=wo(),yqi=$4r(),RSt=b2(),_qi=Lg(),nTc=$3e(),Z4r=bh(),Z3e=J_e(),iTc=RU(),oTc=xSt();function Eqi(t,e,r,n,o){let s=n?"output":"input",c=r.properties.modelCallId;if(!c){o?.warn("[TELEMETRY] modelCallId not found in telemetryData, input/output messages cannot be linked");return}let l=e.map(f=>{let h={...f,content:typeof f.content=="string"?f.content.length:Array.isArray(f.content)?f.content.reduce((m,g)=>typeof g=="string"?m+g.length:g.type==="text"?m+(g.text?.length||0):m,0):0};return"tool_calls"in f&&f.tool_calls&&Array.isArray(f.tool_calls)&&(h.tool_calls=f.tool_calls.map(m=>({...m,function:m.function?{...m.function,arguments:typeof m.function.arguments=="string"?m.function.arguments.length:m.function.arguments}:m.function}))),h}),u={};for(let[f,h]of Object.entries(r.properties))if(f.startsWith("request.option.tools"))if(typeof h=="string")try{let m=JSON.parse(h);Array.isArray(m)?u[f]=m.length.toString():u[f]=h.length.toString()}catch{u[f]=h.length.toString()}else Array.isArray(h)?u[f]=h.length.toString():u[f]="0";else u[f]=h;let d=Z3e.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,Z4r.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,Z4r.multiplexProperties)(d.properties),d.measurements)}a(Eqi,"sendEngineMessagesLengthTelemetry");var gqi=new RSt.LRUCache(1e3),Aqi=new RSt.LRUCache(500),J3e=new RSt.LRUCache(1e3),wSt={headerRequestId:null},J4r=new RSt.LRUCache(100);function sTc(t){let e=J3e.get(t);if(e!==void 0){let r=e+1;return J3e.set(t,r),r}else return J3e.set(t,1),1}a(sTc,"updateHeaderRequestIdTracker");function aTc(t){let e=J4r.get(t);if(e!==void 0){let r=e+1;return J4r.set(t,r),r}else return J4r.set(t,1),1}a(aTc,"updateConversationTracker");function cTc(t,e,r){let n={};for(let[h,m]of Object.entries(e.properties))h.startsWith("request.option.")&&(n[h]=m);if(Object.keys(n).length===0)return;let o=e.properties.conversationId||e.properties.sessionId||"unknown",s=e.properties.headerRequestId||"unknown",c=(0,yqi.hash)(n).toString(),l=Aqi.get(c);if(!l)l=(0,_qi.generateUuid)(),Aqi.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(eFe,"__esModule",{value:!0});eFe.CompactionDataContainer=void 0;eFe.rawPartAsCompactionData=gTc;var mTc=wo(),Cqi=g3e(),X4r=class extends mTc.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:Cqi.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};eFe.CompactionDataContainer=X4r;function gTc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Cqi.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(gTc,"rawPartAsCompactionData")});var Tqi=I(tFe=>{"use strict";p();Object.defineProperty(tFe,"__esModule",{value:!0});tFe.PhaseDataContainer=void 0;tFe.rawPartAsPhaseData=yTc;var ATc=wo(),Sqi=g3e(),eLr=class extends ATc.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:Sqi.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};tFe.PhaseDataContainer=eLr;function yTc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Sqi.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(yTc,"rawPartAsPhaseData")});var wqi=I(nB=>{"use strict";p();Object.defineProperty(nB,"__esModule",{value:!0});nB.StatefulMarkerContainer=void 0;nB.rawPartAsStatefulMarker=xqi;nB.encodeStatefulMarker=_Tc;nB.decodeStatefulMarker=ETc;nB.getAllStatefulMarkersAndIndicies=nLr;nB.getStatefulMarkerAndIndex=vTc;nB.getIndexOfStatefulMarker=CTc;var tLr=wo(),Iqi=g3e(),rLr=class extends tLr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:Iqi.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};nB.StatefulMarkerContainer=rLr;function xqi(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Iqi.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(xqi,"rawPartAsStatefulMarker");function _Tc(t,e){return new TextEncoder().encode(t+"\\"+e)}a(_Tc,"encodeStatefulMarker");function ETc(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(ETc,"decodeStatefulMarker");function*nLr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===tLr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===tLr.Raw.ChatCompletionContentPartKind.Opaque){let o=xqi(n);o&&(yield{statefulMarker:o,index:e})}}}}a(nLr,"getAllStatefulMarkersAndIndicies");function vTc(t,e){for(let r of nLr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(vTc,"getStatefulMarkerAndIndex");function CTc(t,e){for(let r of nLr(e))if(r.statefulMarker.marker===t)return r.index}a(CTc,"getIndexOfStatefulMarker")});var Pqi=I(BU=>{"use strict";p();var bTc=BU&&BU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),STc=BU&&BU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kqi=BU&&BU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var TTc=oC&&oC.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ITc=oC&&oC.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(oC,"__esModule",{value:!0});oC.OpenAIResponsesProcessor=void 0;oC.getResponsesApiCompactionThreshold=Bqi;oC.createResponsesRequestBody=QTc;oC.getResponsesApiCompactionThresholdFromBody=qTc;oC.responseApiInputToRawMessagesForLogging=XTc;oC.processResponseFromChatEndpoint=cIc;oC.sendCompletionOutputTelemetry=Qqi;var to=wo(),dLr=Ml(),xTc=pl(),wTc=J$(),RTc=MF(),kTc=D4r(),iB=CT(),PTc=Og(),kqi=gk(),eEe=Hl(),DTc=Np(),FU=_St(),NTc=PU(),df=RU(),MTc=Q4r(),cLr=X3e(),OTc=UU(),LTc=Rh(),Pqi=z3e(),fLr=vqi(),BTc=bqi(),Dqi=Iqi(),FTc=HOr(),UTc=Rqi();function Bqi(t,e,r){if(t.getExperimentBasedConfig(eEe.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!df.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(Bqi,"getResponsesApiCompactionThreshold");function QTc(t,e,r,n){let o=t.get(eEe.IConfigurationService),s=t.get(LTc.IExperimentationService),c=(0,Pqi.getVerbosityForModelSync)(n),l=Bqi(o,s,n),u=jTc(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===FU.CUSTOM_TOOL_SEARCH_NAME),m=e.location===kqi.ChatLocation.Agent||e.location===kqi.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(MTc.IToolDeferralService):void 0,_=[];if(e.requestOptions?.tools)for(let N of e.requestOptions.tools)!N.function.name||N.function.name.length===0||N.function.name===FU.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(N.function.name)||_.push({...N.function,type:"function",strict:!1,parameters:N.function.parameters||{}});let E=[..._];A&&E.unshift({type:"tool_search",execution:"client",description:"Search for relevant tools by describing what you need. Returns tool definitions for tools matching your query.",parameters:{type:"object",properties:{query:{type:"string",description:"Natural language description of what tool capability you are looking for."}},required:["query"]}});let v=e.requestOptions?.tools?new Map(e.requestOptions.tools.map(N=>[N.function.name,N])):void 0,S=A?N=>!y.isNonDeferredTool(N):void 0,T=o.getExperimentBasedConfig(eEe.ConfigKey.ResponsesApiPromptCacheBreakpointEnabled,s),w={model:r,...HTc(r,e.messages,d,u,{toolsMap:v,shouldLoadToolFromToolSearch:S,modeChanged:f,supportsCacheBreakpoints:T&&(0,Pqi.modelSupportCacheBreakPoints)(n)}),stream:!0,tools:E.length>0?E:void 0,max_output_tokens:e.postOptions.max_tokens,tool_choice:typeof e.postOptions.tool_choice=="object"?{type:"function",name:e.postOptions.tool_choice.function.name}:e.postOptions.tool_choice,top_logprobs:e.postOptions.logprobs?3:void 0,store:!1,text:c?{verbosity:c}:void 0};l!==void 0&&(w.context_management=[{type:df.openAIContextManagementCompactionType,compact_threshold:l}]),w.truncation=o.getConfig(eEe.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let R=o.getConfig(eEe.ConfigKey.Advanced.ReasoningEffortOverride),x=n.supportsReasoningEffort?.length?R||e.modelCapabilities?.reasoningEffort||"medium":void 0,k=void 0;return(x||k)&&(w.reasoning={...x?{effort:x}:{},...k?{summary:k}:{}}),w.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(eEe.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(w.prompt_cache_key=`${e.conversationId}:${n.family}`),w}a(QTc,"createResponsesRequestBody");function qTc(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===df.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(qTc,"getResponsesApiCompactionThresholdFromBody");function jTc(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(OTc.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(jTc,"resolveWebSocketStatefulMarker");function HTc(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1,supportsCacheBreakpoints:u=!1}=o,d=$Tc(e),f=d!==void 0?GTc(e[d]):void 0,h,m;if(n)m=(0,Dqi.getIndexOfStatefulMarker)(n,e),m!==void 0&&(h=n);else if(!r){let E=(0,Dqi.getStatefulMarkerAndIndex)(t,e);E&&(h=E.statefulMarker,m=E.index)}l&&(h=void 0,m=void 0);let g=new Set,A=new Set;if(m!==void 0||d!==void 0){for(let E of e)if(E.role===to.Raw.ChatRole.Assistant&&E.toolCalls)for(let v of E.toolCalls)v.function.name===FU.CUSTOM_TOOL_SEARCH_NAME&&g.add(v.id);else if(E.role===to.Raw.ChatRole.Tool&&E.toolCallId&&g.has(E.toolCallId)&&s){let v=E.content.filter(S=>S.type===to.Raw.ChatCompletionContentPartKind.Text).map(S=>S.text).join("");for(let S of Nqi(v,s,c))A.add(S.name)}}m!==void 0?(e=e.slice(m+1),d!==void 0&&(d>m?e=e.slice(d-(m+1)):f&&(e=[f,...e]))):d!==void 0&&(e=e.slice(d));let _=[];for(let E of e){let v=_.length;switch(E.role){case to.Raw.ChatRole.Assistant:if(E.content.length){_.push(...ZTc(E.content)),_.push(...KTc(E.content));let S=E.content.map(VTc).filter(iB.isDefined);if(S.length){let T={role:"assistant",content:S,type:"message",phase:JTc(E.content)};_.push(T)}}if(E.toolCalls)for(let S of E.toolCalls)if(S.function.name===FU.CUSTOM_TOOL_SEARCH_NAME){g.add(S.id);let T={};try{T=JSON.parse(S.function.arguments||"{}")}catch{}_.push({type:"tool_search_call",execution:"client",call_id:S.id,status:"completed",arguments:T})}else{let T=A.has(S.function.name)?S.function.name:void 0;_.push({type:"function_call",name:S.function.name,arguments:S.function.arguments,call_id:S.id,...T?{namespace:T}:{}})}break;case to.Raw.ChatRole.Tool:if(E.toolCallId)if(g.has(E.toolCallId)){let S=E.content.filter(w=>w.type===to.Raw.ChatCompletionContentPartKind.Text).map(w=>w.text).join(""),T=s?Nqi(S,s,c):[];for(let w of T)A.add(w.name);_.push({type:"tool_search_output",execution:"client",call_id:E.toolCallId,status:"completed",tools:T})}else{let S=E.content.filter(R=>R.type===to.Raw.ChatCompletionContentPartKind.Text).map(R=>R.text).join(""),T=E.content.filter(R=>R.type===to.Raw.ChatCompletionContentPartKind.Image).map(R=>({type:"input_image",detail:R.imageUrl.detail||"auto",image_url:R.imageUrl.url})),w=E.content.filter(R=>R.type===to.Raw.ChatCompletionContentPartKind.Document).map(Fqi).filter(iB.isDefined);_.push({type:"function_call_output",call_id:E.toolCallId,output:S}),T.length&&_.push({type:"message",role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...T]}),w.length&&_.push({type:"message",role:"user",content:[{type:"input_text",text:"PDF associated with the above tool call:"},...w]})}break;case to.Raw.ChatRole.User:_.push({type:"message",role:"user",content:E.content.map(Mqi).filter(iB.isDefined)});break;case to.Raw.ChatRole.System:_.push({type:"message",role:"system",content:E.content.map(Mqi).filter(iB.isDefined)});break}if(u&&_.length>v&&WTc(E))for(let S=_.length-1;S>=v&&!zTc(_[S]);S--);}return{input:_,previous_response_id:h}}a(HTc,"rawMessagesToResponseAPI");function Nqi(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==FU.CUSTOM_TOOL_SEARCH_NAME&&e.has(o)&&r?.(o)===!0).map(o=>{let s=e.get(o);return{type:"function",name:s.function.name,description:s.function.description||"",defer_loading:!0,parameters:s.function.parameters||{type:"object",properties:{}},strict:!1}}):[]}a(Nqi,"buildToolSearchOutputTools");function GTc(t){if(t.role!==to.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===to.Raw.ChatCompletionContentPartKind.Opaque&&(0,fLr.rawPartAsCompactionData)(r));if(e.length)return{role:to.Raw.ChatRole.Assistant,content:e}}a(GTc,"createCompactionRoundTripMessage");function $Tc(t){for(let e=t.length-1;e>=0;e--){let r=t[e];for(let n of r.content)if(n.type===to.Raw.ChatCompletionContentPartKind.Opaque&&(0,fLr.rawPartAsCompactionData)(n))return e}}a($Tc,"getLatestCompactionMessageIndex");function Fqi(t){if(t.documentData.mediaType==="application/pdf")return{type:"input_file",filename:"document.pdf",file_data:`data:${t.documentData.mediaType};base64,${t.documentData.data}`}}a(Fqi,"rawDocumentToResponsesInputFile");function Mqi(t){switch(t.type){case to.Raw.ChatCompletionContentPartKind.Text:return{type:"input_text",text:t.text};case to.Raw.ChatCompletionContentPartKind.Image:return{type:"input_image",detail:t.imageUrl.detail||"auto",image_url:t.imageUrl.url};case to.Raw.ChatCompletionContentPartKind.Document:return Fqi(t);case to.Raw.ChatCompletionContentPartKind.Opaque:{let e=t.value;if(e.type==="input_text"||e.type==="input_image"||e.type==="input_file")return e}}}a(Mqi,"rawContentToResponsesContent");function VTc(t){switch(t.type){case to.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a(VTc,"rawContentToResponsesAssistantContent");var Oqi={mode:"explicit"};function WTc(t){return t.content.some(e=>e.type===to.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(WTc,"hasCacheBreakpoint");function zTc(t){let e=t.content;if(Array.isArray(e)){let n=e.at(-1);return n?(n.prompt_cache_breakpoint=Oqi,!0):!1}let r=t.type;return r==="function_call"||r==="function_call_output"||r==="tool_search_call"||r==="tool_search_output"?(t.prompt_cache_breakpoint=Oqi,!0):!1}a(zTc,"tryApplyPromptCacheBreakpoint");function YTc(t){return typeof t=="string"&&t.startsWith("rs")}a(YTc,"isResponsesReasoningId");function KTc(t){return(0,dLr.coalesce)(t.map(e=>{if(e.type===to.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,FTc.rawPartAsThinkingData)(e);if(r&&r.encrypted&&YTc(r.id))return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(KTc,"extractThinkingData");function JTc(t){for(let e of t)if(e.type===to.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,BTc.rawPartAsPhaseData)(e);if(r)return r}}a(JTc,"extractPhaseData");function ZTc(t){return(0,dLr.coalesce)(t.map(e=>{if(e.type===to.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,fLr.rawPartAsCompactionData)(e);if(r)return{type:df.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(ZTc,"extractCompactionData");function XTc(t){let e=[],r=[],n=a(()=>{r.length>0&&e.push({role:to.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)})},"flushPendingFunctionCalls");t.instructions&&e.push({role:to.Raw.ChatRole.System,content:[{type:to.Raw.ChatCompletionContentPartKind.Text,text:t.instructions}]});let o=typeof t.input=="string"?[{role:"user",content:t.input,type:"message"}]:t.input??[];for(let s of o)if("role"in s)switch(s.role){case"user":n(),e.push({role:to.Raw.ChatRole.User,content:sLr(s.content).map(RSt).filter(iB.isDefined)});break;case"system":case"developer":n(),e.push({role:to.Raw.ChatRole.System,content:sLr(s.content).map(RSt).filter(iB.isDefined)});break;case"assistant":n(),eIc(s)?e.push({role:to.Raw.ChatRole.Assistant,content:s.content.map(rIc).filter(iB.isDefined)}):tIc(s)&&e.push({role:to.Raw.ChatRole.Assistant,content:sLr(s.content).map(RSt).filter(iB.isDefined)});break}else if("type"in s)switch(s.type){case"function_call":r.push({id:s.call_id,type:"function",function:{name:s.name,arguments:s.arguments}});break;case"function_call_output":{n();let c=nIc(s.output);e.push({role:to.Raw.ChatRole.Tool,content:c,toolCallId:s.call_id});break}case"reasoning":n(),e.push({role:to.Raw.ChatRole.Assistant,content:[{type:to.Raw.ChatCompletionContentPartKind.Text,text:`Reasoning summary: ${s.summary.map(c=>c.text).join(` +`),e.info(`[responsesAPI] Dumping SSE stream to ${s}`),new sLr(s)}catch{return Rqi}}a(ITc,"createResponsesStreamDumper")});var DSt=I(oC=>{"use strict";p();var xTc=oC&&oC.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},wTc=oC&&oC.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(oC,"__esModule",{value:!0});oC.OpenAIResponsesProcessor=void 0;oC.getResponsesApiCompactionThreshold=Uqi;oC.createResponsesRequestBody=jTc;oC.getResponsesApiCompactionThresholdFromBody=HTc;oC.responseApiInputToRawMessagesForLogging=tIc;oC.processResponseFromChatEndpoint=uIc;oC.sendCompletionOutputTelemetry=jqi;var to=wo(),fLr=Ml(),RTc=pl(),kTc=Z$(),PTc=MF(),DTc=N4r(),iB=CT(),NTc=Lg(),Dqi=gk(),eEe=Hl(),MTc=Np(),FU=ESt(),OTc=PU(),df=RU(),LTc=q4r(),lLr=X3e(),BTc=UU(),FTc=Rh(),Nqi=z3e(),pLr=bqi(),UTc=Tqi(),Mqi=wqi(),QTc=GOr(),qTc=Pqi();function Uqi(t,e,r){if(t.getExperimentBasedConfig(eEe.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!df.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(Uqi,"getResponsesApiCompactionThreshold");function jTc(t,e,r,n){let o=t.get(eEe.IConfigurationService),s=t.get(FTc.IExperimentationService),c=(0,Nqi.getVerbosityForModelSync)(n),l=Uqi(o,s,n),u=GTc(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===FU.CUSTOM_TOOL_SEARCH_NAME),m=e.location===Dqi.ChatLocation.Agent||e.location===Dqi.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(LTc.IToolDeferralService):void 0,_=[];if(e.requestOptions?.tools)for(let N of e.requestOptions.tools)!N.function.name||N.function.name.length===0||N.function.name===FU.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(N.function.name)||_.push({...N.function,type:"function",strict:!1,parameters:N.function.parameters||{}});let E=[..._];A&&E.unshift({type:"tool_search",execution:"client",description:"Search for relevant tools by describing what you need. Returns tool definitions for tools matching your query.",parameters:{type:"object",properties:{query:{type:"string",description:"Natural language description of what tool capability you are looking for."}},required:["query"]}});let v=e.requestOptions?.tools?new Map(e.requestOptions.tools.map(N=>[N.function.name,N])):void 0,S=A?N=>!y.isNonDeferredTool(N):void 0,T=o.getExperimentBasedConfig(eEe.ConfigKey.ResponsesApiPromptCacheBreakpointEnabled,s),w={model:r,...$Tc(r,e.messages,d,u,{toolsMap:v,shouldLoadToolFromToolSearch:S,modeChanged:f,supportsCacheBreakpoints:T&&(0,Nqi.modelSupportCacheBreakPoints)(n)}),stream:!0,tools:E.length>0?E:void 0,max_output_tokens:e.postOptions.max_tokens,tool_choice:typeof e.postOptions.tool_choice=="object"?{type:"function",name:e.postOptions.tool_choice.function.name}:e.postOptions.tool_choice,top_logprobs:e.postOptions.logprobs?3:void 0,store:!1,text:c?{verbosity:c}:void 0};l!==void 0&&(w.context_management=[{type:df.openAIContextManagementCompactionType,compact_threshold:l}]),w.truncation=o.getConfig(eEe.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let R=o.getConfig(eEe.ConfigKey.Advanced.ReasoningEffortOverride),x=n.supportsReasoningEffort?.length?R||e.modelCapabilities?.reasoningEffort||"medium":void 0,k=void 0;return(x||k)&&(w.reasoning={...x?{effort:x}:{},...k?{summary:k}:{}}),w.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(eEe.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(w.prompt_cache_key=`${e.conversationId}:${n.family}`),w}a(jTc,"createResponsesRequestBody");function HTc(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===df.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(HTc,"getResponsesApiCompactionThresholdFromBody");function GTc(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(BTc.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(GTc,"resolveWebSocketStatefulMarker");function $Tc(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1,supportsCacheBreakpoints:u=!1}=o,d=WTc(e),f=d!==void 0?VTc(e[d]):void 0,h,m;if(n)m=(0,Mqi.getIndexOfStatefulMarker)(n,e),m!==void 0&&(h=n);else if(!r){let E=(0,Mqi.getStatefulMarkerAndIndex)(t,e);E&&(h=E.statefulMarker,m=E.index)}l&&(h=void 0,m=void 0);let g=new Set,A=new Set;if(m!==void 0||d!==void 0){for(let E of e)if(E.role===to.Raw.ChatRole.Assistant&&E.toolCalls)for(let v of E.toolCalls)v.function.name===FU.CUSTOM_TOOL_SEARCH_NAME&&g.add(v.id);else if(E.role===to.Raw.ChatRole.Tool&&E.toolCallId&&g.has(E.toolCallId)&&s){let v=E.content.filter(S=>S.type===to.Raw.ChatCompletionContentPartKind.Text).map(S=>S.text).join("");for(let S of Oqi(v,s,c))A.add(S.name)}}m!==void 0?(e=e.slice(m+1),d!==void 0&&(d>m?e=e.slice(d-(m+1)):f&&(e=[f,...e]))):d!==void 0&&(e=e.slice(d));let _=[];for(let E of e){let v=_.length;switch(E.role){case to.Raw.ChatRole.Assistant:if(E.content.length){_.push(...eIc(E.content)),_.push(...ZTc(E.content));let S=E.content.map(zTc).filter(iB.isDefined);if(S.length){let T={role:"assistant",content:S,type:"message",phase:XTc(E.content)};_.push(T)}}if(E.toolCalls)for(let S of E.toolCalls)if(S.function.name===FU.CUSTOM_TOOL_SEARCH_NAME){g.add(S.id);let T={};try{T=JSON.parse(S.function.arguments||"{}")}catch{}_.push({type:"tool_search_call",execution:"client",call_id:S.id,status:"completed",arguments:T})}else{let T=A.has(S.function.name)?S.function.name:void 0;_.push({type:"function_call",name:S.function.name,arguments:S.function.arguments,call_id:S.id,...T?{namespace:T}:{}})}break;case to.Raw.ChatRole.Tool:if(E.toolCallId)if(g.has(E.toolCallId)){let S=E.content.filter(w=>w.type===to.Raw.ChatCompletionContentPartKind.Text).map(w=>w.text).join(""),T=s?Oqi(S,s,c):[];for(let w of T)A.add(w.name);_.push({type:"tool_search_output",execution:"client",call_id:E.toolCallId,status:"completed",tools:T})}else{let S=E.content.filter(R=>R.type===to.Raw.ChatCompletionContentPartKind.Text).map(R=>R.text).join(""),T=E.content.filter(R=>R.type===to.Raw.ChatCompletionContentPartKind.Image).map(R=>({type:"input_image",detail:R.imageUrl.detail||"auto",image_url:R.imageUrl.url})),w=E.content.filter(R=>R.type===to.Raw.ChatCompletionContentPartKind.Document).map(Qqi).filter(iB.isDefined);_.push({type:"function_call_output",call_id:E.toolCallId,output:S}),T.length&&_.push({type:"message",role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...T]}),w.length&&_.push({type:"message",role:"user",content:[{type:"input_text",text:"PDF associated with the above tool call:"},...w]})}break;case to.Raw.ChatRole.User:_.push({type:"message",role:"user",content:E.content.map(Lqi).filter(iB.isDefined)});break;case to.Raw.ChatRole.System:_.push({type:"message",role:"system",content:E.content.map(Lqi).filter(iB.isDefined)});break}if(u&&_.length>v&&YTc(E))for(let S=_.length-1;S>=v&&!KTc(_[S]);S--);}return{input:_,previous_response_id:h}}a($Tc,"rawMessagesToResponseAPI");function Oqi(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==FU.CUSTOM_TOOL_SEARCH_NAME&&e.has(o)&&r?.(o)===!0).map(o=>{let s=e.get(o);return{type:"function",name:s.function.name,description:s.function.description||"",defer_loading:!0,parameters:s.function.parameters||{type:"object",properties:{}},strict:!1}}):[]}a(Oqi,"buildToolSearchOutputTools");function VTc(t){if(t.role!==to.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===to.Raw.ChatCompletionContentPartKind.Opaque&&(0,pLr.rawPartAsCompactionData)(r));if(e.length)return{role:to.Raw.ChatRole.Assistant,content:e}}a(VTc,"createCompactionRoundTripMessage");function WTc(t){for(let e=t.length-1;e>=0;e--){let r=t[e];for(let n of r.content)if(n.type===to.Raw.ChatCompletionContentPartKind.Opaque&&(0,pLr.rawPartAsCompactionData)(n))return e}}a(WTc,"getLatestCompactionMessageIndex");function Qqi(t){if(t.documentData.mediaType==="application/pdf")return{type:"input_file",filename:"document.pdf",file_data:`data:${t.documentData.mediaType};base64,${t.documentData.data}`}}a(Qqi,"rawDocumentToResponsesInputFile");function Lqi(t){switch(t.type){case to.Raw.ChatCompletionContentPartKind.Text:return{type:"input_text",text:t.text};case to.Raw.ChatCompletionContentPartKind.Image:return{type:"input_image",detail:t.imageUrl.detail||"auto",image_url:t.imageUrl.url};case to.Raw.ChatCompletionContentPartKind.Document:return Qqi(t);case to.Raw.ChatCompletionContentPartKind.Opaque:{let e=t.value;if(e.type==="input_text"||e.type==="input_image"||e.type==="input_file")return e}}}a(Lqi,"rawContentToResponsesContent");function zTc(t){switch(t.type){case to.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a(zTc,"rawContentToResponsesAssistantContent");var Bqi={mode:"explicit"};function YTc(t){return t.content.some(e=>e.type===to.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(YTc,"hasCacheBreakpoint");function KTc(t){let e=t.content;if(Array.isArray(e)){let n=e.at(-1);return n?(n.prompt_cache_breakpoint=Bqi,!0):!1}let r=t.type;return r==="function_call"||r==="function_call_output"||r==="tool_search_call"||r==="tool_search_output"?(t.prompt_cache_breakpoint=Bqi,!0):!1}a(KTc,"tryApplyPromptCacheBreakpoint");function JTc(t){return typeof t=="string"&&t.startsWith("rs")}a(JTc,"isResponsesReasoningId");function ZTc(t){return(0,fLr.coalesce)(t.map(e=>{if(e.type===to.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,QTc.rawPartAsThinkingData)(e);if(r&&r.encrypted&&JTc(r.id))return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(ZTc,"extractThinkingData");function XTc(t){for(let e of t)if(e.type===to.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,UTc.rawPartAsPhaseData)(e);if(r)return r}}a(XTc,"extractPhaseData");function eIc(t){return(0,fLr.coalesce)(t.map(e=>{if(e.type===to.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,pLr.rawPartAsCompactionData)(e);if(r)return{type:df.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(eIc,"extractCompactionData");function tIc(t){let e=[],r=[],n=a(()=>{r.length>0&&e.push({role:to.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)})},"flushPendingFunctionCalls");t.instructions&&e.push({role:to.Raw.ChatRole.System,content:[{type:to.Raw.ChatCompletionContentPartKind.Text,text:t.instructions}]});let o=typeof t.input=="string"?[{role:"user",content:t.input,type:"message"}]:t.input??[];for(let s of o)if("role"in s)switch(s.role){case"user":n(),e.push({role:to.Raw.ChatRole.User,content:aLr(s.content).map(kSt).filter(iB.isDefined)});break;case"system":case"developer":n(),e.push({role:to.Raw.ChatRole.System,content:aLr(s.content).map(kSt).filter(iB.isDefined)});break;case"assistant":n(),rIc(s)?e.push({role:to.Raw.ChatRole.Assistant,content:s.content.map(iIc).filter(iB.isDefined)}):nIc(s)&&e.push({role:to.Raw.ChatRole.Assistant,content:aLr(s.content).map(kSt).filter(iB.isDefined)});break}else if("type"in s)switch(s.type){case"function_call":r.push({id:s.call_id,type:"function",function:{name:s.name,arguments:s.arguments}});break;case"function_call_output":{n();let c=oIc(s.output);e.push({role:to.Raw.ChatRole.Tool,content:c,toolCallId:s.call_id});break}case"reasoning":n(),e.push({role:to.Raw.ChatRole.Assistant,content:[{type:to.Raw.ChatCompletionContentPartKind.Text,text:`Reasoning summary: ${s.summary.map(c=>c.text).join(` -`)}`}]});break;default:{let c=s;if(c.type==="tool_search_call")r.push({id:c.call_id,type:"function",function:{name:FU.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(c.arguments??{})}});else if(c.type==="tool_search_output"){n();let l=c.tools.map(u=>u.name);e.push({role:to.Raw.ChatRole.Tool,content:[{type:to.Raw.ChatCompletionContentPartKind.Text,text:JSON.stringify(l)}],toolCallId:c.call_id})}break}}return r.length>0&&e.push({role:to.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)}),e}a(XTc,"responseApiInputToRawMessagesForLogging");function eIc(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(eIc,"isResponseOutputMessage");function tIc(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(tIc,"isResponseInputItemMessage");function sLr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(sLr,"ensureContentArray");function RSt(t){switch(t.type){case"input_text":return{type:to.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"input_image":return{type:to.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:t.image_url||"",detail:t.detail==="auto"?void 0:t.detail??void 0}};case"input_file":return{type:to.Raw.ChatCompletionContentPartKind.Opaque,value:`[File Input - Filename: ${t.filename||"unknown"}]`}}}a(RSt,"responseContentToRawContent");function rIc(t){switch(t.type){case"output_text":return{type:to.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"refusal":return{type:to.Raw.ChatCompletionContentPartKind.Text,text:`[Refusal: ${t.refusal}]`}}}a(rIc,"responseOutputToRawContent");function nIc(t){return typeof t=="string"?[{type:to.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,dLr.coalesce)(t.map(RSt))}a(nIc,"responseFunctionOutputToRawContents");function lLr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===df.openAIContextManagementCompactionType}a(lLr,"isCompactionItem");function iIc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(iIc,"hasOutputItem");function oIc(t){return"response"in t&&Array.isArray(t.response.output)}a(oIc,"hasResponseOutput");function sIc(t){return t.output_index}a(sIc,"getOutputItemIndex");function uLr(t){return lLr(t)}a(uLr,"isCompactionOutputItem");function Uqi(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(uLr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&uLr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(Uqi,"getLatestCompactionOutput");function aIc(t,e){let r=Uqi(t,e);return r?t.filter((n,o)=>!uLr(n)||o===r.outputIndex):t}a(aIc,"keepLatestCompactionOutput");async function cIc(t,e,r,n,o,s,c,l){return new xTc.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,PTc.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,NTc.getRequestId)(n.headers),m=t.createInstance(kSt,c,e,d,f,h,l),g=(0,UTc.createResponsesStreamDumper)(d,r),A=new kTc.SSEParser(y=>{try{if(r.trace(`SSE: ${y.data}`),y.data==="[DONE]")return;let _=JSON.parse(y.data),E={type:y.type,..._};g.logEvent(E);let v=m.push(E,s);v&&(Qqi(e,r,v,c),u.emitOne(v))}catch(_){u.reject(_)}});for await(let y of n.body)A.feed(y)},async()=>{await n.body.destroy()})}a(cIc,"processResponseFromChatEndpoint");function Qqi(t,e,r,n){let o=(0,df.rawMessageToCAPI)(r.message),s=n;r.usage&&(s=n.extendedBy({},{promptTokens:r.usage.prompt_tokens,completionTokens:r.usage.completion_tokens,totalTokens:r.usage.total_tokens,...r.usage.prompt_tokens_details&&{cachedTokens:r.usage.prompt_tokens_details.cached_tokens},...r.usage.completion_tokens_details&&{reasoningTokens:r.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:r.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:r.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,cLr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(Qqi,"sendCompletionOutputTelemetry");function lIc(t){if(!t)return;let e=t.filter(c=>c.blocked),r=e.find(c=>c.source_type==="completion")??e[0];if(!r)return;let o=r.content_filter_raw?.find(c=>c.action==="BLOCK"&&c.result===!0)?.label?.toLowerCase()??"";if(o.includes("copyright"))return df.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return df.FilterReason.SelfHarm;if(o.includes("sexual"))return df.FilterReason.Sexual;if(o.includes("violence"))return df.FilterReason.Violence;if(o.includes("hate"))return df.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return df.FilterReason.Hate;if(s.self_harm?.filtered)return df.FilterReason.SelfHarm;if(s.sexual?.filtered)return df.FilterReason.Sexual;if(s.violence?.filtered)return df.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return df.FilterReason.Copyright;if(r.source_type==="prompt")return df.FilterReason.Prompt}a(lIc,"extractFilterReasonFromContentFilters");function aLr(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(aLr,"mapResponsesApiError");var kSt=class{static{a(this,"OpenAIResponsesProcessor")}constructor(e,r,n,o,s,c,l){this.telemetryData=e,this.telemetryService=r,this.requestId=n,this.ghRequestId=o,this.serverExperiments=s,this.compactionThreshold=c,this.logService=l,this.textAccumulator="",this.hasReceivedReasoningSummary=!1,this.sawCompactionMessage=!1,this.toolCallInfo=new Map}getCompactionItemsInChunk(e){let r=[];if(iIc(e)&&lLr(e.item)){let n=sIc(e);r.push({item:e.item,outputIndex:n})}if(oIc(e))for(let n=0;n{this.textAccumulator+=s.text,r(this.textAccumulator,0,s)},"onProgress"),o=this.getCompactionItemsInChunk(e);if(e.type!=="response.completed")for(let{item:s,outputIndex:c}of o)this.captureCompactionItem(s,c,n);switch(e.type){case"error":return n({text:"",copilotErrors:[{agent:"openai",code:e.code||"unknown",message:e.message,type:"error",identifier:e.param||void 0}]}),this.buildTerminalCompletion({output:[]},df.FinishedCompletionReason.ServerError,{error:aLr({code:e.code,message:e.message})});case"response.output_text.delta":{let s=e;this.lastTextDeltaOutputIndex!==void 0&&s.output_index!==this.lastTextDeltaOutputIndex&&n({text:` +`)}`}]});break;default:{let c=s;if(c.type==="tool_search_call")r.push({id:c.call_id,type:"function",function:{name:FU.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(c.arguments??{})}});else if(c.type==="tool_search_output"){n();let l=c.tools.map(u=>u.name);e.push({role:to.Raw.ChatRole.Tool,content:[{type:to.Raw.ChatCompletionContentPartKind.Text,text:JSON.stringify(l)}],toolCallId:c.call_id})}break}}return r.length>0&&e.push({role:to.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)}),e}a(tIc,"responseApiInputToRawMessagesForLogging");function rIc(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(rIc,"isResponseOutputMessage");function nIc(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(nIc,"isResponseInputItemMessage");function aLr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(aLr,"ensureContentArray");function kSt(t){switch(t.type){case"input_text":return{type:to.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"input_image":return{type:to.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:t.image_url||"",detail:t.detail==="auto"?void 0:t.detail??void 0}};case"input_file":return{type:to.Raw.ChatCompletionContentPartKind.Opaque,value:`[File Input - Filename: ${t.filename||"unknown"}]`}}}a(kSt,"responseContentToRawContent");function iIc(t){switch(t.type){case"output_text":return{type:to.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"refusal":return{type:to.Raw.ChatCompletionContentPartKind.Text,text:`[Refusal: ${t.refusal}]`}}}a(iIc,"responseOutputToRawContent");function oIc(t){return typeof t=="string"?[{type:to.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,fLr.coalesce)(t.map(kSt))}a(oIc,"responseFunctionOutputToRawContents");function uLr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===df.openAIContextManagementCompactionType}a(uLr,"isCompactionItem");function sIc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(sIc,"hasOutputItem");function aIc(t){return"response"in t&&Array.isArray(t.response.output)}a(aIc,"hasResponseOutput");function cIc(t){return t.output_index}a(cIc,"getOutputItemIndex");function dLr(t){return uLr(t)}a(dLr,"isCompactionOutputItem");function qqi(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(dLr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&dLr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(qqi,"getLatestCompactionOutput");function lIc(t,e){let r=qqi(t,e);return r?t.filter((n,o)=>!dLr(n)||o===r.outputIndex):t}a(lIc,"keepLatestCompactionOutput");async function uIc(t,e,r,n,o,s,c,l){return new RTc.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,NTc.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,OTc.getRequestId)(n.headers),m=t.createInstance(PSt,c,e,d,f,h,l),g=(0,qTc.createResponsesStreamDumper)(d,r),A=new DTc.SSEParser(y=>{try{if(r.trace(`SSE: ${y.data}`),y.data==="[DONE]")return;let _=JSON.parse(y.data),E={type:y.type,..._};g.logEvent(E);let v=m.push(E,s);v&&(jqi(e,r,v,c),u.emitOne(v))}catch(_){u.reject(_)}});for await(let y of n.body)A.feed(y)},async()=>{await n.body.destroy()})}a(uIc,"processResponseFromChatEndpoint");function jqi(t,e,r,n){let o=(0,df.rawMessageToCAPI)(r.message),s=n;r.usage&&(s=n.extendedBy({},{promptTokens:r.usage.prompt_tokens,completionTokens:r.usage.completion_tokens,totalTokens:r.usage.total_tokens,...r.usage.prompt_tokens_details&&{cachedTokens:r.usage.prompt_tokens_details.cached_tokens},...r.usage.completion_tokens_details&&{reasoningTokens:r.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:r.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:r.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,lLr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(jqi,"sendCompletionOutputTelemetry");function dIc(t){if(!t)return;let e=t.filter(c=>c.blocked),r=e.find(c=>c.source_type==="completion")??e[0];if(!r)return;let o=r.content_filter_raw?.find(c=>c.action==="BLOCK"&&c.result===!0)?.label?.toLowerCase()??"";if(o.includes("copyright"))return df.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return df.FilterReason.SelfHarm;if(o.includes("sexual"))return df.FilterReason.Sexual;if(o.includes("violence"))return df.FilterReason.Violence;if(o.includes("hate"))return df.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return df.FilterReason.Hate;if(s.self_harm?.filtered)return df.FilterReason.SelfHarm;if(s.sexual?.filtered)return df.FilterReason.Sexual;if(s.violence?.filtered)return df.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return df.FilterReason.Copyright;if(r.source_type==="prompt")return df.FilterReason.Prompt}a(dIc,"extractFilterReasonFromContentFilters");function cLr(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(cLr,"mapResponsesApiError");var PSt=class{static{a(this,"OpenAIResponsesProcessor")}constructor(e,r,n,o,s,c,l){this.telemetryData=e,this.telemetryService=r,this.requestId=n,this.ghRequestId=o,this.serverExperiments=s,this.compactionThreshold=c,this.logService=l,this.textAccumulator="",this.hasReceivedReasoningSummary=!1,this.sawCompactionMessage=!1,this.toolCallInfo=new Map}getCompactionItemsInChunk(e){let r=[];if(sIc(e)&&uLr(e.item)){let n=cIc(e);r.push({item:e.item,outputIndex:n})}if(aIc(e))for(let n=0;n{this.textAccumulator+=s.text,r(this.textAccumulator,0,s)},"onProgress"),o=this.getCompactionItemsInChunk(e);if(e.type!=="response.completed")for(let{item:s,outputIndex:c}of o)this.captureCompactionItem(s,c,n);switch(e.type){case"error":return n({text:"",copilotErrors:[{agent:"openai",code:e.code||"unknown",message:e.message,type:"error",identifier:e.param||void 0}]}),this.buildTerminalCompletion({output:[]},df.FinishedCompletionReason.ServerError,{error:cLr({code:e.code,message:e.message})});case"response.output_text.delta":{let s=e;this.lastTextDeltaOutputIndex!==void 0&&s.output_index!==this.lastTextDeltaOutputIndex&&n({text:` -`}),this.lastTextDeltaOutputIndex=s.output_index;let c=new RTc.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...Lqi(c,l),top_logprobs:l.top_logprobs?.map(u=>Lqi(c,u))||[]}))}})}case"response.output_item.added":if(e.item.type==="function_call")this.toolCallInfo.set(e.output_index,{name:e.item.name,callId:e.item.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:e.item.name,id:e.item.call_id}]});else if(e.item.type.toString()==="tool_search_call"){let s=e.item;s.execution==="client"&&s.call_id&&(this.toolCallInfo.set(e.output_index,{name:FU.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:FU.CUSTOM_TOOL_SEARCH_NAME,id:s.call_id}]}))}return;case"response.function_call_arguments.delta":{let s=this.toolCallInfo.get(e.output_index);s&&(s.arguments+=e.delta,n({text:"",copilotToolCallStreamUpdates:[{id:s.callId,name:s.name,arguments:s.arguments}]}));return}case"response.output_item.done":if(e.item.type==="function_call")this.toolCallInfo.delete(e.output_index),n({text:"",copilotToolCalls:[{id:e.item.call_id,name:e.item.name,arguments:e.item.arguments}],phase:e.item.phase});else if(e.item.type.toString()==="tool_search_call"){let s=e.item;s.execution==="client"&&s.call_id&&(this.toolCallInfo.delete(e.output_index),n({text:"",copilotToolCalls:[{id:s.call_id,name:FU.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(s.arguments??{})}]}))}else e.item.type==="reasoning"?n({text:"",thinking:e.item.encrypted_content?{id:e.item.id,text:this.hasReceivedReasoningSummary?void 0:e.item.summary.map(s=>s.text),encrypted:e.item.encrypted_content}:void 0}):e.item.type==="message"&&n({text:"",phase:e.item.phase});return;case"response.reasoning_summary_text.delta":return this.hasReceivedReasoningSummary=!0,n({text:"",thinking:{id:e.item_id,text:e.delta}});case"response.reasoning_summary_part.done":return this.hasReceivedReasoningSummary=!0,n({text:"",thinking:{id:e.item_id}});case"response.completed":{let s=e,c=aIc(s.response.output,this.latestCompactionOutputIndex),l=Uqi(c,this.latestCompactionOutputIndex),u=l?.item,d=this.latestCompactionItem;u&&(this.sawCompactionMessage=!0,this.latestCompactionOutputIndex=l.outputIndex);let f=u&&(!d||d.id!==u.id||d.encrypted_content!==u.encrypted_content);if(u&&(this.latestCompactionItem=u),this.compactionThreshold!==void 0&&this.sawCompactionMessage){let h=e.response.usage?.input_tokens??0,m=e.response.usage?.total_tokens??0;(0,cLr.sendResponsesApiCompactionTelemetry)(this.telemetryService,{outcome:"compaction_returned",headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,model:e.response.model},{compactThreshold:this.compactionThreshold,promptTokens:h,totalTokens:m}),this.logService.debug(`[responsesAPI_compaction] Compaction enabled. headerRequestId=${this.requestId}`)}else if(this.compactionThreshold!==void 0&&(e.response.usage?.input_tokens??0)>=this.compactionThreshold){let h=e.response.usage?.input_tokens??0,m=e.response.usage?.total_tokens??0;(0,cLr.sendResponsesApiCompactionTelemetry)(this.telemetryService,{outcome:"threshold_met_no_compaction",headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,model:e.response.model},{compactThreshold:this.compactionThreshold,promptTokens:h,totalTokens:m}),this.logService.debug(`[responsesAPI_compaction] Compaction enabled but context not compacted after threshold was met. headerRequestId=${this.requestId}, gitHubRequestId=${this.ghRequestId}, promptTokens=${h}, totalTokens=${m}`)}return n({text:"",statefulMarker:e.response.id,contextManagement:f?u:void 0}),{blockFinished:!0,choiceIndex:0,model:e.response.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.response.id,created:e.response.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:{prompt_tokens:e.response.usage?.input_tokens??0,completion_tokens:e.response.usage?.output_tokens??0,total_tokens:e.response.usage?.total_tokens??0,prompt_tokens_details:{cached_tokens:e.response.usage?.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.response.usage?.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0},copilot_usage:s.copilot_usage?.total_nano_aiu!==void 0?s.copilot_usage:void 0},finishReason:df.FinishedCompletionReason.Stop,message:{role:to.Raw.ChatRole.Assistant,content:c.map(h=>{if(h.type==="message")return{type:to.Raw.ChatCompletionContentPartKind.Text,text:h.content.map(m=>m.type==="output_text"?m.text:m.refusal).join("")};if(h.type==="image_generation_call"&&h.result)return{type:to.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:h.result}}}).filter(iB.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=df.FinishedCompletionReason.Length:c==="content_filter"?(l=df.FinishedCompletionReason.ContentFilter,u=lIc(s.content_filters)):l=df.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:aLr(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,df.FinishedCompletionReason.ServerError,{error:aLr(s.error)})}}}buildTerminalCompletion(e,r,n={}){let o=e.output??[];return{blockFinished:!0,choiceIndex:0,model:e.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.id,created:e.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:e.usage?{prompt_tokens:e.usage.input_tokens??0,completion_tokens:e.usage.output_tokens??0,total_tokens:e.usage.total_tokens??0,prompt_tokens_details:{cached_tokens:e.usage.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.usage.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}}:void 0,finishReason:r,filterReason:n.filterReason,error:n.error,message:{role:to.Raw.ChatRole.Assistant,content:o.map(s=>{if(s.type==="message")return{type:to.Raw.ChatCompletionContentPartKind.Text,text:s.content.map(c=>c.type==="output_text"?c.text:c.refusal).join("")};if(s.type==="image_generation_call"&&s.result)return{type:to.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:s.result}}}).filter(iB.isDefined)}}}};oC.OpenAIResponsesProcessor=kSt;oC.OpenAIResponsesProcessor=kSt=TTc([ITc(6,DTc.ILogService)],kSt);function Lqi(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,wTc.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(Lqi,"mapLogProp")});var qqi=I(DSt=>{"use strict";p();Object.defineProperty(DSt,"__esModule",{value:!0});DSt.ChatWebSocketTelemetrySender=void 0;var pLr=class{static{a(this,"ChatWebSocketTelemetrySender")}static sendConnectedTelemetry(e,r){e.sendTelemetryEvent("websocket.connected",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId},{connectDurationMs:r.connectDurationMs})}static sendConnectErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.connectError",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId,error:r.error,responseStatusText:r.responseStatusText,networkError:r.networkError},{connectDurationMs:r.connectDurationMs,responseStatusCode:r.responseStatusCode})}static sendCloseTelemetry(e,r){e.sendTelemetryEvent("websocket.close",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,closeReason:r.closeReason,closeEventReason:r.closeEventReason,closeEventWasClean:r.closeEventWasClean},{hadActiveRequest:r.hadActiveRequest?1:0,closeCode:r.closeCode,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.error",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,error:r.error},{hadActiveRequest:r.hadActiveRequest?1:0,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendCloseDuringSetupTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.closeDuringSetup",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId,closeReason:r.closeReason,closeEventReason:r.closeEventReason,closeEventWasClean:r.closeEventWasClean},{closeCode:r.closeCode,connectDurationMs:r.connectDurationMs})}static sendRequestSentTelemetry(e,r){e.sendTelemetryEvent("websocket.requestSent",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId},{hadActiveRequest:r.hadActiveRequest?1:0,statefulMarkerMatched:r.statefulMarkerMatched?1:0,previousResponseIdUnset:r.previousResponseIdUnset?1:0,hasCompactionData:r.hasCompactionData?1:0,summarizedAtRoundIdSet:r.summarizedAtRoundIdSet?1:0,summarizedAtRoundIdMatched:r.summarizedAtRoundIdMatched?1:0,modeChanged:r.modeChanged===void 0?-1:r.modeChanged?1:0,compactionThreshold:r.compactionThreshold,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,sentMessageCharacters:r.sentMessageCharacters,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendMessageParseErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.messageParseError",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,error:r.error},{hadActiveRequest:r.hadActiveRequest?1:0,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,receivedMessageCharacters:r.receivedMessageCharacters,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendRequestOutcomeTelemetry(e,r){e.sendTelemetryEvent("websocket.requestOutcome",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,requestOutcome:r.requestOutcome,closeReason:r.closeReason,serverErrorMessage:r.serverErrorMessage,serverErrorCode:r.serverErrorCode},{hadActiveRequest:r.hadActiveRequest?1:0,statefulMarkerMatched:r.statefulMarkerMatched?1:0,previousResponseIdUnset:r.previousResponseIdUnset?1:0,hasCompactionData:r.hasCompactionData?1:0,summarizedAtRoundIdSet:r.summarizedAtRoundIdSet?1:0,summarizedAtRoundIdMatched:r.summarizedAtRoundIdMatched?1:0,modeChanged:r.modeChanged===void 0?-1:r.modeChanged?1:0,compactionThreshold:r.compactionThreshold,promptTokenCount:r.promptTokenCount,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,requestSentMessageCount:r.requestSentMessageCount,requestReceivedMessageCount:r.requestReceivedMessageCount,requestSentCharacters:r.requestSentCharacters,requestReceivedCharacters:r.requestReceivedCharacters,connectionDurationMs:r.connectionDurationMs,requestDurationMs:r.requestDurationMs,closeCode:r.closeCode})}};DSt.ChatWebSocketTelemetrySender=pLr});var UU=I(jS=>{"use strict";p();var uIc=jS&&jS.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},NSt=jS&&jS.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jS,"__esModule",{value:!0});jS.ChatWebSocketManager=jS.NullChatWebSocketManager=jS.IChatWebSocketManager=void 0;jS.isCAPIWebSocketError=yLr;var dIc=an(),fIc=Os(),MSt=Fc(),jqi=Po(),Hqi=Hl(),pIc=lE(),tEe=Np(),hIc=bh(),mIc=Oy(),gIc=PSt(),HV=qqi();jS.IChatWebSocketManager=(0,dIc.createServiceIdentifier)("IChatWebSocketManager");var hLr=class{static{a(this,"NullChatWebSocketManager")}getOrCreateConnection(e,r,n){throw new Error("WebSocket not available")}hasActiveConnection(e){return!1}getStatefulMarker(e){}getSummarizedAtRoundId(e){}closeConnection(e){}closeAll(){}};jS.NullChatWebSocketManager=hLr;function yLr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(yLr,"isCAPIWebSocketError");var AIc={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function yIc(t){return AIc[t.type]}a(yIc,"getStreamTerminatingOutcome");var mLr=class extends jqi.Disposable{static{a(this,"ChatWebSocketManager")}constructor(e,r,n,o){super(),this._logService=e,this._capiClientService=r,this._telemetryService=n,this._configurationService=o,this._connections=new Map}getOrCreateConnection(e,r,n){let o=this._connections.get(e);if(o?.isOpen)return o;o&&(this._logService.debug(`[ChatWebSocketManager] Replacing closed connection for conversation ${e}`),o.dispose(),this._connections.delete(e));let s=new gLr(this._capiClientService,this._logService,this._telemetryService,this._configurationService,e,r,n);return this._logService.debug(`[ChatWebSocketManager] Creating new connection for conversation ${e}`),this._connections.set(e,s),s.onDidDispose(()=>{this._connections.get(e)===s&&this._connections.delete(e)}),s}hasActiveConnection(e){return!!this._connections.get(e)?.isOpen}getStatefulMarker(e){let r=this._connections.get(e);return r?.isOpen?r.statefulMarker:void 0}getSummarizedAtRoundId(e){let r=this._connections.get(e);return r?.isOpen?r.summarizedAtRoundId:void 0}closeConnection(e){let r=this._connections.get(e);r&&(r.hasActiveRequest?this._logService.warn(`[ChatWebSocketManager] Closing connection for conversation ${e} while turn ${r.turnId} still has an active request`):this._logService.debug(`[ChatWebSocketManager] Closing connection for conversation ${e}`),r.dispose(),this._connections.delete(e))}closeAll(){for(let e of this._connections.values())e.dispose();this._connections.clear()}dispose(){this.closeAll(),super.dispose()}};jS.ChatWebSocketManager=mLr;jS.ChatWebSocketManager=mLr=uIc([NSt(0,tEe.ILogService),NSt(1,pIc.ICAPIClientService),NSt(2,hIc.ITelemetryService),NSt(3,Hqi.IConfigurationService)],mLr);function OSt(t){switch(t){case 1e3:return"Normal Closure";case 1001:return"Going Away";case 1002:return"Protocol Error";case 1003:return"Unsupported Data";case 1005:return"No Status Received";case 1006:return"Abnormal Closure";case 1007:return"Invalid Payload";case 1008:return"Policy Violation";case 1009:return"Message Too Big";case 1010:return"Missing Extension";case 1011:return"Internal Error";case 1012:return"Service Restart";case 1013:return"Try Again Later";case 1014:return"Bad Gateway";case 1015:return"TLS Handshake Failed";default:return"Unknown"}}a(OSt,"wsCloseCodeToString");var gLr=class extends jqi.Disposable{static{a(this,"ChatWebSocketConnection")}constructor(e,r,n,o,s,c,l){super(),this._capiClientService=e,this._logService=r,this._telemetryService=n,this._configurationService=o,this._conversationId=s,this._headers=c,this._initiatingRequestId=l,this._state=2,this._onDidDispose=this._register(new MSt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new mIc.HeadersImpl({}),this._hadActiveRequest=!1}get isOpen(){return this._state===1&&!!this._ws}get hasActiveRequest(){return!!this._activeRequest}get turnId(){return this._turnId}get statefulMarker(){return this._statefulMarker}get summarizedAtRoundId(){return this._summarizedAtRoundId}get responseHeaders(){return this._responseHeaders}get responseStatusCode(){return this._responseStatusCode}get responseStatusText(){return this._responseStatusText}get gitHubRequestId(){return this._responseHeaders.get("x-github-request-id")||""}async connect(){if(this._state===1)return;this._state=0,this._connectStartTime=Date.now(),this._logService.debug(`[ChatWebSocketManager] Connecting WebSocket for conversation ${this._conversationId}`);let e=await this._capiClientService.createResponsesWebSocket({headers:this._headers});return new Promise((r,n)=>{let o=e.webSocket,s=a(()=>{u(),this._state=1,this._connectedTime=Date.now(),this._ws=o,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText,this._setupMessageHandlers(o);let d=this._connectedTime-(this._connectStartTime??this._connectedTime);this._logService.debug(`[ChatWebSocketManager] Connected for conversation ${this._conversationId}`),HV.ChatWebSocketTelemetrySender.sendConnectedTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,connectDurationMs:d}),r()},"onOpen"),c=a(d=>{u(),this._state=2,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText;let f=d.error?`${d.message}: ${(0,tEe.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,tEe.collectSingleLineErrorMessage)(h):void 0,g=Date.now()-(this._connectStartTime??Date.now());this._logService.error(`[ChatWebSocketManager] Connection error for conversation ${this._conversationId}: ${f}${m?` (cause: ${m})`:""}`),HV.ChatWebSocketTelemetrySender.sendConnectErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,error:f,connectDurationMs:g,responseStatusCode:this._responseStatusCode,responseStatusText:this._responseStatusText,networkError:m}),n(new Error(f))},"onError"),l=a(d=>{u(),this._state=2,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText;let f=Date.now()-(this._connectStartTime??Date.now()),h=OSt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),HV.ChatWebSocketTelemetrySender.sendCloseDuringSetupTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,closeCode:d.code,closeReason:h,closeEventReason:d.reason,closeEventWasClean:String(d.wasClean),connectDurationMs:f}),n(new Error("WebSocket closed during connection setup"))},"onClose"),u=a(()=>{o.removeEventListener("open",s),o.removeEventListener("error",c),o.removeEventListener("close",l)},"cleanup");o.addEventListener("open",s),o.addEventListener("error",c),o.addEventListener("close",l)})}_setupMessageHandlers(e){e.addEventListener("message",r=>{if(typeof r.data!="string")return;let n=r.data.length;this._totalReceivedMessageCount+=1,this._totalReceivedCharacters+=n;let o=Date.now()-(this._connectedTime??Date.now()),s;try{s=JSON.parse(r.data)}catch(c){let l=(0,tEe.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),HV.ChatWebSocketTelemetrySender.sendMessageParseErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,error:l,connectionDurationMs:o,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,receivedMessageCharacters:n,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters});return}!yLr(s)&&s.type==="response.completed"&&(this._statefulMarker=s.response.id,this._summarizedAtRoundId=this._activeRequest?.summarizedAtRoundId),this._activeRequest?.handleEvent(s)}),e.addEventListener("close",r=>{this._state=2;let n=Date.now()-(this._connectedTime??Date.now()),o=OSt(r.code);this._logService.debug(`[ChatWebSocketManager] Connection closed for conversation ${this._conversationId} turn ${this._turnId} (code: ${r.code} ${o}, reason: ${r.reason||""}, wasClean: ${r.wasClean})`),HV.ChatWebSocketTelemetrySender.sendCloseTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,closeCode:r.code,closeReason:o,closeEventReason:r.reason,closeEventWasClean:String(r.wasClean),connectionDurationMs:n,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters});let s=this._pendingErrorMessage;this._pendingErrorMessage=void 0,this._activeRequest?.handleConnectionClose(r.code,r.reason,s),this._activeRequest=void 0}),e.addEventListener("error",r=>{let n=r.error?`${r.message}: ${(0,tEe.collectSingleLineErrorMessage)(r.error)}`:r.message||"WebSocket error",o=Date.now()-(this._connectedTime??Date.now());this._logService.error(`[ChatWebSocketManager] Error for conversation ${this._conversationId} turn ${this._turnId}: ${n}`),HV.ChatWebSocketTelemetrySender.sendErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,error:n,connectionDurationMs:o,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._pendingErrorMessage??=n})}sendRequest(e,r,n){if(!this._ws||this._state!==1)throw new Error("WebSocket is not connected");let o=this._statefulMarker===e.previous_response_id,s=e.previous_response_id===void 0,c=e.input?.some(L=>L?.type==="compaction")??!1,l=r.summarizedAtRoundId!==void 0,u=r.summarizedAtRoundId===this._summarizedAtRoundId,d=(0,gIc.getResponsesApiCompactionThresholdFromBody)(e),f=this._statefulMarker?.slice(0,5).concat("...")??"",h=e.previous_response_id?.slice(0,5).concat("...")??"";o?this._logService.trace(`[ChatWebSocketManager] WebSocket stateful marker matches previous_response_id (${h}), summarizedAtRoundIdMatched: ${u}`):this._logService.debug(`[ChatWebSocketManager] WebSocket stateful marker (${f}) does not match previous_response_id (${h}), summarizedAtRoundIdMatched: ${u}`);let m=!!this._activeRequest;m?(this._logService.warn(`[ChatWebSocketManager] New request for conversation ${this._conversationId} turn ${r.turnId} while turn ${this._turnId} still has an active request`),this._activeRequest.handleSuperseded()):this._logService.debug(`[ChatWebSocketManager] New request for conversation ${this._conversationId} turn ${r.turnId} (previous turn: ${this._turnId})`);let g=this._turnId,A=r.turnId;this._previousTurnId=g,this._turnId=A,this._hadActiveRequest=m;let y=r.requestId,_=Date.now(),E=this._totalSentMessageCount,v=this._totalReceivedMessageCount,S=this._totalSentCharacters,T=this._totalReceivedCharacters,w=r.countTokens(),R=-1;w.then(L=>{R=L},()=>{R=-2});let x=new ALr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:L,closeCode:U,closeReason:j,serverErrorMessage:Q,serverErrorCode:Y})=>{this._activeRequest===x&&(this._activeRequest=void 0);let W=Date.now()-(this._connectedTime??Date.now()),V=Date.now()-_,z=this._totalSentMessageCount-E,ie=this._totalReceivedMessageCount-v,H=this._totalSentCharacters-S,re=this._totalReceivedCharacters-T;HV.ChatWebSocketTelemetrySender.sendRequestOutcomeTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,requestOutcome:L,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,promptTokenCount:R,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:W,requestDurationMs:V,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters,requestSentMessageCount:z,requestReceivedMessageCount:ie,requestSentCharacters:H,requestReceivedCharacters:re,closeCode:U,closeReason:j,serverErrorMessage:Q,serverErrorCode:Y})}),this._activeRequest=x;let k=n.onCancellationRequested(()=>{this._activeRequest===x&&(x.handleCancellation(),this._activeRequest=void 0)});x.done.finally(()=>k.dispose()).catch(()=>{});let{stream:D,...N}=e,O={type:"response.create",...N,initiator:r.userInitiated?"user":"agent"},B=JSON.stringify(O),q=B.length;this._totalSentMessageCount+=1,this._totalSentCharacters+=q;let M=Date.now()-(this._connectedTime??Date.now());return this._logService.debug(`[ChatWebSocketManager] Sending request for conversation ${this._conversationId} turn ${this._turnId} (totalSentMessageCount: ${this._totalSentMessageCount}, sentMessageCharacters: ${q})`),HV.ChatWebSocketTelemetrySender.sendRequestSentTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:M,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,sentMessageCharacters:q,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._ws.send(B),x}dispose(){this._activeRequest?.handleConnectionDisposed(),this._activeRequest=void 0,this._ws&&(this._ws.close(),this._ws=void 0),this._state=2,this._onDidDispose.fire(),super.dispose()}},ALr=class{static{a(this,"ChatWebSocketActiveRequest")}constructor(e,r,n,o,s){this.requestId=e,this.modelId=r,this.summarizedAtRoundId=n,this._configurationService=o,this._logService=s,this._onEvent=new MSt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new MSt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new MSt.Emitter,this.onError=this._onError.event,this._firstEventSettled=!1,this._settled=!1,this.done=new Promise((c,l)=>{this._resolve=c,this._reject=l}),this.firstEvent=new Promise((c,l)=>{this._resolveFirstEvent=c,this._rejectFirstEvent=l})}onDidSettle(e){this._onDidSettle=e}handleEvent(e){if(this._settled)return;let r=this._configurationService.getConfig(Hqi.ConfigKey.TeamInternal.DebugSimulateWebSocketResponse);if(r)try{e=JSON.parse(r),this._logService.info(`[ChatWebSocketManager] Simulating WebSocket response event: ${r}`)}catch(o){this._logService.error(`[ChatWebSocketManager] Failed to parse simulated WebSocket response: ${(0,tEe.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),yLr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=yIc(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${OSt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${OSt(e)}${r?`, reason: ${r}`:""})`);this._finalizeError("connection_closed",o,e,r)}handleSuperseded(){this._settled||this._finalizeError("superseded",new Error("Request superseded by new request"))}handleCancellation(){this._settled||this._finalizeError("canceled",new fIc.CancellationError)}handleConnectionDisposed(){this._settled||this._finalizeError("connection_disposed",new Error("Connection disposed"))}_finalizeSuccess(e){this._settled=!0,this._onDidSettle?.({outcome:e}),this._resolve(),this._dispose()}_finalizeCAPIError(e){let{code:r,message:n}=e.error;this._onCAPIError.fire(e),this._settled=!0,this._onDidSettle?.({outcome:"error_response",serverErrorMessage:n,serverErrorCode:r}),this._reject(new Error(`${n} (${r})`)),this._dispose()}_finalizeError(e,r,n,o,s,c){this._firstEventSettled||(this._firstEventSettled=!0,this._rejectFirstEvent(r)),this._onError.fire(r),this._settled=!0,this._onDidSettle?.({outcome:e,closeCode:n,closeReason:o,serverErrorMessage:s,serverErrorCode:c}),this._reject(r),this._dispose()}_dispose(){this._onEvent.dispose(),this._onCAPIError.dispose(),this._onError.dispose()}}});var ELr=I(oB=>{"use strict";p();Object.defineProperty(oB,"__esModule",{value:!0});oB.getImageDimensions=_Ic;oB.getImageDimensionsFromBytes=EIc;oB.getPngDimensions=Gqi;oB.getGifDimensions=$qi;oB.getJpegDimensions=Vqi;oB.getWebPDimensions=Kqi;oB.getMimeType=Xqi;oB.extractImageAttributes=bIc;function _Ic(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(Xqi(e)){case"image/png":return Gqi(e);case"image/gif":return $qi(e);case"image/jpeg":case"image/jpg":return Vqi(e);case"image/webp":return Kqi(e);default:throw new Error("Unsupported image format")}}a(_Ic,"getImageDimensions");function EIc(t,e){switch(vIc(e)){case"image/png":return Wqi(t);case"image/gif":return zqi(t);case"image/jpeg":case"image/jpg":return Yqi(t);case"image/webp":return Jqi(t);default:throw new Error("Unsupported image format")}}a(EIc,"getImageDimensionsFromBytes");function Gqi(t){return Wqi(LSt(t.slice(0,50)))}a(Gqi,"getPngDimensions");function $qi(t){return zqi(LSt(t.slice(0,50)))}a($qi,"getGifDimensions");function Vqi(t){return Yqi(LSt(t))}a(Vqi,"getJpegDimensions");function Wqi(t){if(!Zqi(t,0,[137,80,78,71]))throw new Error("Not a valid PNG image.");let e=new DataView(t.buffer,t.byteOffset+16,8);return{width:e.getUint32(0,!1),height:e.getUint32(4,!1)}}a(Wqi,"getPngDimensionsFromBytes");function zqi(t){if(!_Lr(t,0,"GIF8"))throw new Error("Not a valid GIF image.");let e=new DataView(t.buffer,t.byteOffset+6,4);return{width:e.getUint16(0,!0),height:e.getUint16(2,!0)}}a(zqi,"getGifDimensionsFromBytes");function Yqi(t){if(!Zqi(t,0,[255,216]))throw new Error("Not a valid JPEG image.");let e=t.length,r=2;for(;r+3=65472&&n<=65474){let s=new DataView(t.buffer,t.byteOffset+r+5,4);return{height:s.getUint16(0,!1),width:s.getUint16(2,!1)}}r+=2+o}throw new Error("JPEG dimensions not found")}a(Yqi,"getJpegDimensionsFromBytes");function Kqi(t){return Jqi(LSt(t))}a(Kqi,"getWebPDimensions");function Jqi(t){if(!_Lr(t,0,"RIFF")||!_Lr(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=CIc(t,12,4);if(e==="VP8 "){let r=(t[26]|t[27]<<8)&16383,n=(t[28]|t[29]<<8)&16383;return{width:r,height:n}}else if(e==="VP8L"){let r=(t[21]|t[22]<<8)&16383,n=(t[23]|t[24]<<8)&16383;return{width:r,height:n}}else if(e==="VP8X"){let r=((t[24]|t[25]<<8|t[26]<<16)&16777215)+1,n=((t[27]|t[28]<<8|t[29]<<16)&16777215)+1;return{width:r,height:n}}else throw new Error("Unsupported WebP format.")}a(Jqi,"getWebPDimensionsFromBytes");function vIc(t){return t?.toLowerCase().split(";")[0].trim()}a(vIc,"normalizeMimeType");function LSt(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(LSt,"base64ToBytes");function Zqi(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(BSt,"__esModule",{value:!0});BSt.TokenizerType=void 0;var eji;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(eji||(BSt.TokenizerType=eji={}))});var CLr=I(Mie=>{"use strict";p();Object.defineProperty(Mie,"__esModule",{value:!0});Mie.WorkerWithRpcProxy=Mie.RcpResponseHandler=void 0;Mie.createRpcProxy=tji;var SIc=require("worker_threads"),FSt=class{static{a(this,"RcpResponseHandler")}constructor(){this.nextId=1,this.handlers=new Map}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};Mie.RcpResponseHandler=FSt;function tji(t){let e={get:a((r,n)=>(typeof n=="string"&&!r[n]&&(r[n]=(...o)=>t(n,o)),r[n]),"get")};return new Proxy(Object.create(null),e)}a(tji,"createRpcProxy");var vLr=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new FSt,this.worker=new SIc.Worker(e,r),this.worker.on("message",async o=>{if("fn"in o)try{let s=await n?.[o.fn].apply(n,o.args);this.worker.postMessage({id:o.id,res:s})}catch(s){this.worker.postMessage({id:o.id,err:s})}else this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=tji((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}terminate(){this.worker.removeAllListeners(),this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};Mie.WorkerWithRpcProxy=vLr});var rji=I(_k=>{"use strict";p();Object.defineProperty(_k,"__esModule",{value:!0});_k.SlidingWindowAverage=_k.MovingAverage=_k.Counter=void 0;_k.clamp=IIc;_k.rot=xIc;_k.isPointWithinTriangle=wIc;_k.randomChance=RIc;var TIc=pd();function IIc(t,e,r){return Math.min(Math.max(t,e),r)}a(IIc,"clamp");function xIc(t,e){return(e+t%e)%e}a(xIc,"rot");var bLr=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};_k.Counter=bLr;var SLr=class{static{a(this,"MovingAverage")}constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}};_k.MovingAverage=SLr;var TLr=class{static{a(this,"SlidingWindowAverage")}constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){let r=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=r,this._sum+=e,this._n=0&&w>=0&&T+w<1}a(wIc,"isPointWithinTriangle");function RIc(t){return(0,TIc.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(QSt,"__esModule",{value:!0});QSt.TikTokenImpl=void 0;var ILr=GRr(),USt=rji(),kIc=E5(),PIc=zRr(),xLr=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new USt.MovingAverage,textLength:new USt.MovingAverage,callCount:0}}static get instance(){return this._instance||(this._instance=new t),this._instance}init(e,r,n){let o=this._values.length,s=n?PIc.parseTikTokenBinary:c=>c;return this._values.push((0,ILr.createTokenizer)(s(e),(0,ILr.getSpecialTokensByEncoder)(r),(0,ILr.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=kIc.StopWatch.create(!0),s=this._values[e].encode(r,n);return this._stats.callCount+=1,this._stats.encodeDuration.update(o.elapsed()),this._stats.textLength.update(r.length),s}destroy(e){this._values[e]=void 0}resetStats(){let e=this._stats,r={callCount:e.callCount,encodeDuration:e.encodeDuration.value,textLength:e.textLength.value};return this._stats.encodeDuration=new USt.MovingAverage,this._stats.textLength=new USt.MovingAverage,this._stats.callCount=0,r}};QSt.TikTokenImpl=xLr});var $V=I(Fp=>{"use strict";p();var sji=Fp&&Fp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},aji=Fp&&Fp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.TokenizerProvider=Fp.BaseTokensPerName=Fp.BaseTokensPerMessage=Fp.BaseTokensPerCompletion=Fp.ITokenizerProvider=void 0;Fp.calculateImageTokenCost=PLr;Fp.estimateDocumentTokenCost=lji;var GV=wo(),DIc=XEt(),NIc=ELr(),MIc=an(),iji=Nie(),OIc=CLr(),LIc=pd(),oji=MF(),wLr=Po(),qSt=$A(),cji=bh(),RLr=nji();Fp.ITokenizerProvider=(0,MIc.createServiceIdentifier)("ITokenizerProvider");Fp.BaseTokensPerCompletion=3;Fp.BaseTokensPerMessage=3;Fp.BaseTokensPerName=1;var kLr=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new oji.Lazy(()=>new jSt(e,(0,qSt.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new oji.Lazy(()=>new jSt(e,(0,qSt.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case iji.TokenizerType.CL100K:return this._cl100kTokenizer.value;case iji.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};Fp.TokenizerProvider=kLr;Fp.TokenizerProvider=kLr=sji([aji(1,cji.ITelemetryService)],kLr);var jSt=class extends wLr.Disposable{static{a(this,"BPETokenizer")}constructor(e,r,n,o){super(),this._useWorker=e,this._tokenFilePath=r,this._encoderName=n,this._telemetryService=o,this._cache=new DIc.LRUCache(5e3),this.baseTokensPerMessage=Fp.BaseTokensPerMessage,this.baseTokensPerName=Fp.BaseTokensPerName,this.mode=GV.OutputMode.Raw}async countMessagesTokens(e){let r=Fp.BaseTokensPerMessage;for(let n of e)r+=await this.countMessageTokens(n);return r}async tokenize(e){return(await this.ensureTokenizer()).encode(e)}async tokenLength(e){if(typeof e=="string")return this._textTokenLength(e);switch(e.type){case GV.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case GV.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case GV.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return PLr(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case GV.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case GV.Raw.ChatCompletionContentPartKind.Document:return lji(e.documentData.data);default:(0,LIc.assertNever)(e,`unknown content part (${JSON.stringify(e)})`)}}async _textTokenLength(e){if(!e)return 0;let r=this._cache.get(e);return r||(r=(await this.tokenize(e)).length,this._cache.put(e,r)),r}async countMessageTokens(e){return this.baseTokensPerMessage+await this.countMessageObjectTokens((0,GV.toMode)(GV.OutputMode.OpenAI,e))}async countToolTokens(e){let n=0;e.length&&(n+=16);let o=8;for(let s of e)n+=o,n+=await this.countObjectTokens({name:s.name,description:s.description,parameters:s.inputSchema});return Math.floor(n*1.1)}async countMessageObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))if(o){if(typeof o=="string")r+=await this.tokenLength(o);else if(o){let s=o;if(s.type==="text")r+=await this.tokenLength(s.text);else if(s.type==="image_url"&&s.image_url)if(s.image_url.url.startsWith("data:image/"))try{r+=PLr(s.image_url.url,s.image_url.detail)}catch{r+=await this.tokenLength(s.image_url.url)}else r+=await this.tokenLength(s.image_url.url);else{let c=await this.countMessageObjectTokens(o);n==="tool_calls"&&(c=Math.floor(c*1.5)),r+=c}}n==="name"&&o!==void 0&&(r+=this.baseTokensPerName)}return r}async countObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))o&&(r+=await this.tokenLength(n),typeof o=="string"?r+=await this.tokenLength(o):o&&(r+=await this.countMessageObjectTokens(o)));return r}ensureTokenizer(){return this._tokenizer??=this.doInitTokenizer(),this._tokenizer}async doInitTokenizer(){let e=(0,qSt.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,qSt.join)(__dirname,"tikTokenizerWorker.js"),n=new OIc.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,wLr.toDisposable)(()=>{n.terminate(),this._store.deleteAndLeak(s),this._tokenizer=void 0}),c;return{encode:a((l,u)=>{let d=n.proxy.encode(o,l,u);return clearTimeout(c),c=setTimeout(()=>s.dispose(),15e3),Math.random()<1/1e3&&n.proxy.resetStats().then(f=>{this._telemetryService.sendMSFTTelemetryEvent("tokenizer.stats",void 0,f)}),d},"encode")}}else{let r=RLr.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,wLr.toDisposable)(()=>{RLr.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>RLr.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};jSt=sji([aji(3,cji.ITelemetryService)],jSt);function PLr(t,e){let{width:r,height:n}=(0,NIc.getImageDimensions)(t);if(e==="low")return 85;if(r>2048||n>2048){let c=2048/Math.max(r,n);r=Math.round(r*c),n=Math.round(n*c)}let o=768/Math.min(r,n);return r=Math.round(r*o),n=Math.round(n*o),Math.ceil(r/512)*Math.ceil(n/512)*170+85}a(PLr,"calculateImageTokenCost");function lji(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(lji,"estimateDocumentTokenCost")});var VV=I(HSt=>{"use strict";p();Object.defineProperty(HSt,"__esModule",{value:!0});HSt.IDomainService=void 0;var BIc=an();HSt.IDomainService=(0,BIc.createServiceIdentifier)("IDomainService")});var GSt=I(sC=>{"use strict";p();Object.defineProperty(sC,"__esModule",{value:!0});sC.HeaderContributors=sC.IHeaderContributors=sC.userAgentLibraryHeader=void 0;sC.stringifyUrlOrRequestMetadata=VIc;sC.isCAPIRequestMetadata=NLr;sC.isCAPIEndpoint=WIc;sC.createCapiRequestBody=zIc;sC.canRetryOnceNetworkError=dji;sC.postRequest=YIc;sC.getRequest=KIc;var FIc=an(),UIc=Nie(),QIc=Os(),qIc=lE(),jIc=bh(),HIc=Oy(),GIc=RU();sC.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var $Ic=30*1e3;function VIc(t){return typeof t=="string"?t:JSON.stringify(t)}a(VIc,"stringifyUrlOrRequestMetadata");function NLr(t){return typeof t!="string"}a(NLr,"isCAPIRequestMetadata");function WIc(t){return NLr(t.urlOrRequestMetadata)}a(WIc,"isCAPIEndpoint");function zIc(t,e,r){let n={messages:(0,GIc.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a(zIc,"createCapiRequestBody");function uji(t,e){let r=t.get(HIc.IFetcherService),n=t.get(jIc.ITelemetryService),o=t.get(qIc.ICAPIClientService),{requestType:s,endpointOrUrl:c,secretKey:l,intent:u,requestId:d,body:f,additionalHeaders:h,cancelToken:m,useFetcher:g,canRetryOnce:A=!0,location:y}=e,_=typeof c=="string"||"type"in c?{modelMaxPromptTokens:0,urlOrRequestMetadata:c,family:"",tokenizer:UIc.TokenizerType.O200K,acquireTokenizer:a(()=>{throw new Error("Method not implemented.")},"acquireTokenizer"),name:"",version:""}:c,E=e.interactionTypeOverride??u,v={...l?{Authorization:`Bearer ${l}`}:{},"X-Request-Id":d,"OpenAI-Intent":u,"X-GitHub-Api-Version":"2026-01-09",...h,..._.getExtraHeaders?_.getExtraHeaders(y,e.interactionTypeOverride):{}};v["X-Interaction-Type"]=E,v["X-Agent-Task-Id"]=d,_.interceptBody&&_.interceptBody(f);let S=_.getEndpointFetchOptions?.(),T={callSite:`network-request-${u}`,method:s,headers:v,json:f,timeout:$Ic,useFetcher:g,suppressIntegrationId:S?.suppressIntegrationId};if(m){let w=r.makeAbortController();m.onCancellationRequested(()=>{n.sendGHTelemetryEvent("networking.cancelRequest",{headerRequestId:d}),w.abort()}),T.signal=w.signal}return NLr(_.urlOrRequestMetadata)?o.makeRequest(T,_.urlOrRequestMetadata):r.fetch(_.urlOrRequestMetadata,T).catch(R=>{if(A&&dji(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(_.urlOrRequestMetadata,T));throw r.isAbortError(R)?new QIc.CancellationError:R})}a(uji,"networkRequest");function dji(t){return["ECONNRESET","ETIMEDOUT","ERR_CONNECTION_RESET","ERR_NETWORK_CHANGED","ERR_HTTP2_INVALID_SESSION","ERR_HTTP2_STREAM_CANCEL","ERR_HTTP2_GOAWAY_SESSION","ERR_HTTP2_PROTOCOL_ERROR","ERR_FAILED"].includes(t?.code)}a(dji,"canRetryOnceNetworkError");function YIc(t,e){return uji(t,{...e,requestType:"POST"})}a(YIc,"postRequest");function KIc(t,e){return uji(t,{...e,requestType:"GET"})}a(KIc,"getRequest");sC.IHeaderContributors=(0,FIc.createServiceIdentifier)("headerContributors");var DLr=class{static{a(this,"HeaderContributors")}constructor(){this.contributors=[]}add(e){this.contributors.push(e)}remove(e){let r=this.contributors.indexOf(e);r!==-1&&this.contributors.splice(r,1)}contributeHeaders(e){for(let r of this.contributors)r.contributeHeaderValues(e)}size(){return this.contributors.length}};sC.HeaderContributors=DLr});var yji=I(hA=>{"use strict";p();var JIc=hA&&hA.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZIc=hA&&hA.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),XIc=hA&&hA.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=1e6){let e=t/1e6,r=Math.floor(e*10)/10;return r%1===0?`${r.toFixed(0)}M`:`${r.toFixed(1)}M`}else{if(t>9e5)return"1M";if(t>=1e3)return`${Math.round(t/1e3)}K`}return t.toString()}a(oxc,"formatTokenCount");function sxc(t){return $a.t("In: {0} \xB7 Out: {1} AICs/1M tokens",fji(t.default.inputPrice),fji(t.default.outputPrice))}a(sxc,"formatPricingLabel");var pji=1e6,MLr=1e9;function axc(t){if(!t)return;let e=t.batch_size??pji,r=pji/e,n=t.default;if(n&&n.input_price!==void 0&&n.output_price!==void 0){let o={inputPrice:n.input_price*r,outputPrice:n.output_price*r,cachePrice:n.cache_price!==void 0?n.cache_price*r:void 0,cacheWritePrice:n.cache_write_price!==void 0?n.cache_write_price*r:void 0,contextMax:n.context_max},s,c=t.long_context;if(c&&c.input_price!==void 0&&c.output_price!==void 0){let l={inputPrice:c.input_price*r,outputPrice:c.output_price*r,cachePrice:c.cache_price!==void 0?c.cache_price*r:void 0,cacheWritePrice:c.cache_write_price!==void 0?c.cache_write_price*r:void 0,contextMax:c.context_max};(l.inputPrice!==o.inputPrice||l.outputPrice!==o.outputPrice||l.cachePrice!==o.cachePrice||l.cacheWritePrice!==o.cacheWritePrice)&&(s=l)}return{default:o,longContext:s}}if(!(t.input_price===void 0||t.output_price===void 0))return{default:{inputPrice:t.input_price/MLr*r,outputPrice:t.output_price/MLr*r,cachePrice:t.cache_price!==void 0?t.cache_price/MLr*r:void 0,cacheWritePrice:void 0}}}a(axc,"normalizeTokenPrices")});var Nji=I(Fy=>{"use strict";p();var cxc=Fy&&Fy.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},_ji=Fy&&Fy.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Fy,"__esModule",{value:!0});Fy.AnthropicMessagesProcessor=void 0;Fy.buildToolInputSchema=Iji;Fy.createMessagesRequestBody=pxc;Fy.rawMessagesToMessagesAPI=xji;Fy.clearAllCacheControl=wji;Fy.addToolsAndSystemCacheControl=Rji;Fy.addMessagesApiCacheControl=kji;Fy.processResponseFromMessagesEndpoint=gxc;Fy.processNonStreamingResponseFromMessagesEndpoint=Dji;var UN=wo(),vji=pl(),lxc=D4r(),OLr=Og(),uxc=gk(),Eji=Hl(),Cji=Np(),rEe=_St(),bji=PU(),rFe=RU(),dxc=Q4r(),Sji=X3e(),fxc=Rh(),Tji=bh();function Iji(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(Iji,"buildToolInputSchema");function pxc(t,e,r,n){let o=t.get(Eji.IConfigurationService),s=t.get(fxc.IExperimentationService),c=t.get(dxc.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===rEe.CUSTOM_TOOL_SEARCH_NAME),u=[],d=[];if(e.requestOptions?.tools)for(let N of e.requestOptions.tools){if(!N.function.name||N.function.name.length===0)continue;let O=e.modelCapabilities?.enableToolSearch&&l&&!c.isNonDeferredTool(N.function.name),B={name:N.function.name,description:N.function.description||"",input_schema:Iji(N.function.parameters),...O?{defer_loading:!0}:{}};(O?d:u).push(B)}let f=[...u,...d],h=e.modelCapabilities?.reasoningEffort,m;if(e.modelCapabilities?.enableThinking){if(n.supportsAdaptiveThinking)m={type:"adaptive",display:"summarized"};else if(n.maxThinkingBudget&&n.minThinkingBudget){let O=e.postOptions.max_tokens??1024,B=n.minThinkingBudget??1024,q=16e30&&(!N||N.includes(q))&&(A=q)}}let y=e.modelCapabilities?.enableContextEditing&&(0,rEe.isAnthropicContextEditingEnabled)(n,o,s)?(0,rEe.getContextManagementFromConfig)(o,s,g):void 0,_=t.get(Cji.ILogService),E=t.get(Tji.ITelemetryService),v=f.length>0?new Set(f.map(N=>N.name)):void 0,S=xji(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,rEe.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,k=(0,rEe.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;wji(S),kji(S,k),Rji(f,S,R);let D=S.messages.at(-1);return D&&D.role==="assistant"&&(_.warn(`[messagesAPI] Trailing assistant message detected \u2014 appending synthetic user message to prevent prefill error. Total messages: ${S.messages.length}`),E.sendMSFTTelemetryEvent("messagesApi.trailingAssistantGuard",{model:r,location:uxc.ChatLocation.toString(e.location)},{messageCount:S.messages.length}),S.messages.push({role:"user",content:[{type:"text",text:"Please continue."}]})),{model:r,...S,stream:e.requestOptions?.stream??!0,tools:f.length>0?f:void 0,max_tokens:e.postOptions.max_tokens,thinking:m,...A?{output_config:{effort:A}}:{},...y?{context_management:y}:{}}}a(pxc,"createMessagesRequestBody");function xji(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case UN.Raw.ChatRole.System:{n.push(...$St(c.content).filter(l=>l.type==="text"));break}case UN.Raw.ChatRole.User:{let l=$St(c.content);l.length>0&&r.push({role:"user",content:l});break}case UN.Raw.ChatRole.Assistant:{let l=$St(c.content);if(c.toolCalls)for(let u of c.toolCalls){let d={};try{d=JSON.parse(u.function.arguments)}catch{}l.push({type:"tool_use",id:u.id,name:u.function.name,input:d}),o.set(u.id,u.function.name)}l.length>0&&r.push({role:"assistant",content:l});break}case UN.Raw.ChatRole.Tool:{if(c.toolCallId){let l=$St(c.content),u=!1;for(let g of l)nFe(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===rEe.CUSTOM_TOOL_SEARCH_NAME?hxc(l,e):void 0)??l.filter(g=>(g.type==="text"||g.type==="image"||g.type==="document")&&!(g.type==="text"&&g.text.trim()==="")),m={type:"tool_result",tool_use_id:c.toolCallId,content:h.length>0?h:void 0};u&&(m.cache_control={type:"ephemeral"}),r.push({role:"user",content:[m]})}break}}let s=[];for(let c of r){let l=s[s.length-1];if(l&&l.role===c.role){let u=Array.isArray(l.content)?l.content:[{type:"text",text:l.content}],d=Array.isArray(c.content)?c.content:[{type:"text",text:c.content}];l.content=[...u,...d]}else s.push(c)}return{messages:s,...n.length?{system:n}:{}}}a(xji,"rawMessagesToMessagesAPI");function hxc(t,e){if(t.length!==1||t[0].type!=="text")return;let r;try{r=JSON.parse(t[0].text)}catch{return}if(Array.isArray(r))return r.filter(n=>typeof n=="string"&&(!e||e.has(n))).map(n=>({type:"tool_reference",tool_name:n}))}a(hxc,"tryParseToolReferences");function $St(t){let e=[],r=!1;for(let n of t){switch(n.type){case UN.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case UN.Raw.ChatCompletionContentPartKind.Image:{let o=n.imageUrl.url,s=o.match(/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/);s?e.push({type:"image",source:{type:"base64",media_type:s[1],data:s[2]}}):o.startsWith("https://")&&e.push({type:"image",source:{type:"url",url:o}});break}case UN.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&nFe(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case UN.Raw.ChatCompletionContentPartKind.Document:{n.documentData.mediaType==="application/pdf"&&e.push({type:"document",source:{type:"base64",media_type:"application/pdf",data:n.documentData.data}});break}case UN.Raw.ChatCompletionContentPartKind.Opaque:{if(n.value&&typeof n.value=="object"&&"type"in n.value){let o=n.value;if(o.type==="thinking"&&o.thinking){let s=Array.isArray(o.thinking.text)?o.thinking.text.join(""):o.thinking.text;o.thinking.redacted&&o.thinking.encrypted?e.push({type:"redacted_thinking",data:o.thinking.encrypted}):o.thinking.encrypted&&e.push({type:"thinking",thinking:s||"",signature:o.thinking.encrypted})}}break}}if(r&&e.length>0){let o=e.at(-1);nFe(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a($St,"rawContentToAnthropicContent");function nFe(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(nFe,"contentBlockSupportsCacheControl");function wji(t){if(t.system)for(let e of t.system)delete e.cache_control;for(let e of t.messages)if(Array.isArray(e.content))for(let r of e.content)typeof r=="object"&&"cache_control"in r&&delete r.cache_control}a(wji,"clearAllCacheControl");function Rji(t,e,r){let n=r?{type:"ephemeral",ttl:r}:{type:"ephemeral"};for(let s=t.length-1;s>=0;s--)if(!t[s].defer_loading){t[s].cache_control=n;break}let o=e.system?.at(-1);o&&!o.cache_control&&(o.cache_control=n)}a(Rji,"addToolsAndSystemCacheControl");function kji(t,e){let r=t.messages,n=0;for(let o=r.length-1;o>=0&&n<2;o--){let s=r[o];Array.isArray(s.content)&&s.content.some(c=>typeof c=="object"&&nFe(c))&&(mxc(s,e),n++)}}a(kji,"addMessagesApiCacheControl");function mxc(t,e){if(Array.isArray(t.content))for(let r=t.content.length-1;r>=0;r--){let n=t.content[r];if(typeof n=="object"&&nFe(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(mxc,"markLastCacheableBlock");async function gxc(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new vji.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,OLr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,bji.getRequestId)(n.headers),h=t.createInstance(VSt,s,u,d,f),m=new lxc.SSEParser(g=>{try{r.trace(`[messagesAPI]SSE: ${g.data}`);let A=g.data?.trim();if(!A||A==="[DONE]")return;let y=JSON.parse(A),_=y.type??g.type;if(!_)return;let E=h.push({...y,type:_},o);if(E){r.info(`[messagesAPI] message ${E.choiceIndex} returned. finish reason: [${E.finishReason}]`);let v=s.extendedBy({completionChoiceFinishReason:E.finishReason,headerRequestId:E.requestId.headerRequestId});e.sendGHTelemetryEvent("completion.finishReason",v.properties,v.measurements);let S=(0,rFe.rawMessageToCAPI)(E.message),T=s;E.usage&&(T=s.extendedBy({},{promptTokens:E.usage.prompt_tokens,completionTokens:E.usage.completion_tokens,totalTokens:E.usage.total_tokens,...E.usage.prompt_tokens_details&&{cachedTokens:E.usage.prompt_tokens_details.cached_tokens},...E.usage.completion_tokens_details&&{reasoningTokens:E.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:E.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:E.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,Sji.sendEngineMessagesTelemetry)(e,[S],T,!0,r),l.emitOne(E)}}catch(A){l.reject(A)}});for await(let g of n.body)m.feed(g)},async()=>{await n.body.destroy()}):Dji(e,r,n,o,s)}a(gxc,"processResponseFromMessagesEndpoint");function Axc(t){switch(t){case"refusal":return rFe.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return rFe.FinishedCompletionReason.Length;default:return rFe.FinishedCompletionReason.Stop}}a(Axc,"mapStopReason");function Pji(t,e){let r=t.inputTokens+t.cacheCreationTokens+t.cacheReadTokens;return r0?{toolCalls:t.toolCalls.map(n=>({id:n.id,type:"function",function:{name:n.name,arguments:n.arguments}}))}:{}}}}a(Pji,"buildAnthropicCompletion");async function Dji(t,e,r,n,o){return new vji.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,bji.getRequestId)(r.headers),u=c||(0,OLr.generateUuid)(),d=r.headers.get("x-github-request-id")??"",f=await r.text(),h;try{h=JSON.parse(f)}catch(T){s.reject(new Error(`Failed to parse non-streaming Anthropic response: ${T instanceof Error?T.message:String(T)}`));return}if(h.type==="error"){s.reject(new Error(`Anthropic API error: ${h.error?.message??"Unknown error"}`));return}let m="",g=[];for(let T of h.content??[])switch(T.type){case"text":m+=T.text;break;case"tool_use":g.push({id:T.id,name:T.name,arguments:JSON.stringify(T.input)});break;case"thinking":case"redacted_thinking":break;default:{let w=T.type;e.warn(`[messagesAPI] non-streaming: unknown content_block type '${w}' for model ${h.model}`),t.sendMSFTTelemetryEvent("messagesApi.unknownContentBlock",{requestId:u,model:h.model,blockType:w});break}}let A={text:m,...g.length>0?{copilotToolCalls:g.map(T=>({id:T.id,name:T.name,arguments:T.arguments}))}:{}};await n(m,0,A),h.stop_reason==="refusal"&&(e.warn(`[messagesAPI] non-streaming: Refusal received for model ${h.model}`),t.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:u,model:h.model,category:"unknown"}));let y=h.usage,_=Pji({model:h.model,messageId:h.id,stopReason:h.stop_reason,textContent:m,toolCalls:g,inputTokens:y?.input_tokens??0,outputTokens:y?.output_tokens??0,cacheCreationTokens:y?.cache_creation_input_tokens??0,cacheCreation1hTokens:y?.cache_creation?.ephemeral_1h_input_tokens,cacheCreation5mTokens:y?.cache_creation?.ephemeral_5m_input_tokens,cacheReadTokens:y?.cache_read_input_tokens??0,thinkingTokens:y?.output_tokens_details?.thinking_tokens,requestId:u,ghRequestId:d,serverExperiments:l,telemetryData:o},e);e.info(`[messagesAPI] non-streaming message returned. finish reason: [${_.finishReason}]`);let E=o.extendedBy({completionChoiceFinishReason:_.finishReason,headerRequestId:_.requestId.headerRequestId});t.sendGHTelemetryEvent("completion.finishReason",E.properties,E.measurements);let v=(0,rFe.rawMessageToCAPI)(_.message),S=o;_.usage&&(S=o.extendedBy({},{promptTokens:_.usage.prompt_tokens,completionTokens:_.usage.completion_tokens,totalTokens:_.usage.total_tokens,..._.usage.prompt_tokens_details&&{cachedTokens:_.usage.prompt_tokens_details.cached_tokens},..._.usage.completion_tokens_details&&{reasoningTokens:_.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:_.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:_.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,Sji.sendEngineMessagesTelemetry)(t,[v],S,!0,e),s.emitOne(_)},async()=>{await r.body.destroy()})}a(Dji,"processNonStreamingResponseFromMessagesEndpoint");var VSt=class{static{a(this,"AnthropicMessagesProcessor")}constructor(e,r,n,o,s,c){this.telemetryData=e,this.requestId=r,this.ghRequestId=n,this.serverExperiments=o,this.logService=s,this.telemetryService=c,this.textAccumulator="",this.toolCallAccumulator=new Map,this.thinkingAccumulator=new Map,this.completedToolCalls=[],this.messageId="",this.model="",this.inputTokens=0,this.outputTokens=0,this.cacheCreationTokens=0,this.cacheReadTokens=0}extractIPCodeCitations(e){if(!e?.IPCodeCitations?.length)return[];let r=new Set,n=[];for(let o of e.IPCodeCitations){let s=o.citations;if(!s)continue;let{url:c,license:l,snippet:u}=s;typeof c!="string"||c.trim()===""||typeof l!="string"||l.trim()===""||typeof u!="string"||u.trim()===""||r.has(c)||(r.add(c),n.push({citations:{url:c,license:l,snippet:u}}))}return n.length>0&&this.logService.trace(`[messagesAPI] IP code citations found: ${n.length} unique citations`),n}push(e,r){let n=a(o=>{this.textAccumulator+=o.text,r(this.textAccumulator,0,o)},"onProgress");switch(e.type){case"message_start":e.message&&(this.messageId=e.message.id,this.model=e.message.model,this.inputTokens=e.message.usage.input_tokens??0,this.outputTokens=e.message.usage.output_tokens??0,this.cacheCreationTokens=e.message.usage.cache_creation_input_tokens??0,this.cacheCreation1hTokens=e.message.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.message.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.message.usage.cache_read_input_tokens??0,this.thinkingTokens=e.message.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens);return;case"content_block_start":if(e.content_block?.type==="tool_use"&&e.index!==void 0){let o=e.content_block.id||(0,OLr.generateUuid)();this.toolCallAccumulator.set(e.index,{id:o,name:e.content_block.name||"",arguments:""}),this.textAccumulator.length&&n({text:" "}),n({text:"",beginToolCalls:[{name:e.content_block.name||"",id:o}]})}else if(e.content_block?.type==="thinking"&&e.index!==void 0)this.thinkingAccumulator.set(e.index,{thinking:"",signature:""});else if(e.content_block?.type==="redacted_thinking"&&e.index!==void 0){let o=e.content_block.data;n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:o,redacted:!0}})}return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text){let o=this.extractIPCodeCitations(e.copilot_annotations);return o.length>0?n({text:e.delta.text,ipCitations:o}):n({text:e.delta.text})}else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);return o&&(o.thinking+=e.delta.thinking),n({text:"",thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json,n({text:"",copilotToolCallStreamUpdates:[{id:o.id,name:o.name,arguments:o.arguments}]}))}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),n({text:"",copilotToolCalls:[{id:o.id,name:o.name,arguments:o.arguments}]}),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&s.signature&&(n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":if(e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheCreation1hTokens=e.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens,this.thinkingTokens=e.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens),e.copilot_usage&&typeof e.copilot_usage.total_nano_aiu=="number"&&(this.copilotUsage=e.copilot_usage),e.context_management)return this.contextManagementResponse=e.context_management,n({text:"",contextManagement:e.context_management});e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.delta?.stop_details&&(this.stopDetails=e.delta.stop_details);return;case"message_stop":{if(this.contextManagementResponse){let o=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_input_tokens||0),0),s=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_tool_uses||0),0),c=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_thinking_turns||0),0);this.logService.trace(`[messagesAPI] Anthropic context editing applied: cleared ${o} tokens, ${s} tool uses.`),this.telemetryService.sendMSFTTelemetryEvent("contextEditingApplied",{requestId:this.requestId,interactionId:this.requestId,model:this.model},{clearedTokens:o,clearedToolUses:s,clearedThinkingTurns:c})}if(this.stopReason==="refusal"){let o=this.stopDetails?.category??"unknown";this.logService.warn(`[messagesAPI] Refusal received: category='${o}' for model ${this.model}`),this.telemetryService.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:this.requestId,model:this.model,category:o})}return Pji({model:this.model,messageId:this.messageId,stopReason:this.stopReason,textContent:this.textAccumulator,toolCalls:this.completedToolCalls,inputTokens:this.inputTokens,outputTokens:this.outputTokens,cacheCreationTokens:this.cacheCreationTokens,cacheCreation1hTokens:this.cacheCreation1hTokens,cacheCreation5mTokens:this.cacheCreation5mTokens,cacheReadTokens:this.cacheReadTokens,thinkingTokens:this.thinkingTokens,requestId:this.requestId,ghRequestId:this.ghRequestId,serverExperiments:this.serverExperiments,telemetryData:this.telemetryData,copilotUsage:this.copilotUsage},this.logService)}case"error":{let o=e.error?.message||"Unknown error";return n({text:"",copilotErrors:[{agent:"anthropic",code:"unknown",message:o,type:"error",identifier:void 0}]})}}}};Fy.AnthropicMessagesProcessor=VSt;Fy.AnthropicMessagesProcessor=VSt=cxc([_ji(4,Cji.ILogService),_ji(5,Tji.ITelemetryService)],VSt)});var Mji=I(QU=>{"use strict";p();var yxc=QU&&QU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_xc=QU&&QU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Exc=QU&&QU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=0;l--)if(t[l].role===Oie.Raw.ChatRole.User){r=l;break}r===-1&&t.length>0&&(r=t.length-1);let n=0;for(let l=Math.max(r,0);le)throw new Error(vxc.t("Too many images in request: {0} images provided, but the model supports a maximum of {1} images.",n,e));let s=e-n,c=new Map;for(let l=r-1;l>=0;l--)if(Array.isArray(t[l].content)){for(let u=t[l].content.length-1;u>=0;u--)if(t[l].content[u].type===Oie.Raw.ChatCompletionContentPartKind.Image){let d=`${l}:${u}`;s>0?(c.set(d,!0),s--):c.set(d,!1)}}return t.map((l,u)=>u>=r||!Array.isArray(l.content)||!l.content.some(d=>d.type===Oie.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==Oie.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:Oie.Raw.ChatCompletionContentPartKind.Text,text:Cxc})})}a(bxc,"filterHistoryImages")});var Bie=I(HS=>{"use strict";p();var Uji=HS&&HS.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Ym=HS&&HS.__param||function(t,e){return function(r,n){e(r,n,t)}},FLr;Object.defineProperty(HS,"__esModule",{value:!0});HS.RemoteAgentChatEndpoint=HS.ChatEndpoint=void 0;HS.defaultChatResponseProcessor=QLr;HS.defaultNonStreamChatResponseProcessor=zji;var LLr=(yie(),Wa(Aie)),Oji=wo(),Sxc=Nie(),Qji=pl(),Lji=$et(),Txc=Og(),qji=Ks(),Ixc=rE(),jji=LU(),xxc=gk(),wxc=$3e(),Lie=Hl(),Hji=Np(),Bji=_St(),Rxc=PU(),kxc=Oy(),Pxc=GSt(),Dxc=X3e(),Gji=UU(),Nxc=ISt(),$ji=Rh(),Mxc=bh(),Vji=$V(),Oxc=lE(),nEe=z3e(),Wji=VV(),iFe=zLe(),Lxc=yji(),Fji=Nji(),BLr=PSt(),Bxc=Mji();async function QLr(t,e,r,n,o,s,c){let u=(await Nxc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return Qji.AsyncIterableObject.map(u,f=>{let h=f.reason??"client-trimmed",m=s.extendedBy({completionChoiceFinishReason:h,headerRequestId:f.requestId.headerRequestId});return t.sendGHTelemetryEvent("completion.finishReason",m.properties,m.measurements),(0,Dxc.prepareChatCompletionForReturn)(t,e,f,s)})}a(QLr,"defaultChatResponseProcessor");async function zji(t,e,r){let n=await t.text(),o=JSON.parse(n),s=[];for(let c=0;c<(o?.choices?.length||0);c++){let l=o.choices[c],u={role:l.message.role,content:l.message.content,name:l.message.name,toolCalls:l.message.toolCalls??l.message.tool_calls},d=(0,wxc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,Txc.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,Rxc.getRequestId)(t.headers),g={blockFinished:!1,choiceIndex:c,model:o.model,filterReason:void 0,finishReason:l.finish_reason,message:u,usage:o.usage,tokens:[],requestId:{headerRequestId:f,gitHubRequestId:h,completionId:o.id,created:o.created,deploymentId:"",serverExperiments:m},telemetryData:r},A=[];for(let y of u.toolCalls??[])A.push({name:y.function?.name??"",arguments:y.function?.arguments??"",id:y.id??""});await e(d,c,{text:d,copilotToolCalls:A}),s.push(g)}return Qji.AsyncIterableObject.fromArray(s)}a(zji,"defaultNonStreamChatResponseProcessor");var WSt=FLr=class{static{a(this,"ChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d){this.modelMetadata=e,this._domainService=r,this._chatMLFetcher=n,this._tokenizerProvider=o,this._instantiationService=s,this._configurationService=c,this._expService=l,this._chatWebSocketService=u,this._maxTokens=e.capabilities.limits?.max_prompt_tokens??8192,this._maxOutputTokens=e.capabilities.limits?.max_output_tokens??4096,this.model=e.id,this.modelProvider=e.vendor,this.name=e.name,this.version=e.version;let f=(0,nEe.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer??Sxc.TokenizerType.O200K,this.showInModelPicker=e.model_picker_enabled,this.isPremium=e.billing?.is_premium,this.multiplier=e.billing?.multiplier,this.restrictedToSkus=e.billing?.restricted_to;let h=(0,Lxc.normalizeTokenPrices)(e.billing?.token_prices);this.tokenPricing=h?{default:{inputPrice:h.default.inputPrice,outputPrice:h.default.outputPrice,cacheReadTokenPrice:h.default.cachePrice,cacheWriteTokenPrice:h.default.cacheWritePrice,contextMax:h.default.contextMax},longContext:h.longContext?{inputPrice:h.longContext.inputPrice,outputPrice:h.longContext.outputPrice,cacheReadTokenPrice:h.longContext.cachePrice,cacheWriteTokenPrice:h.longContext.cacheWritePrice,contextMax:h.longContext.contextMax}:void 0}:void 0,this.priceCategory=e.model_picker_price_category,this.modelPickerCategory=e.model_picker_category,this.isFallback=e.is_chat_fallback,this.supportsToolCalls=!!e.capabilities.supports.tool_calls,this.supportsVision=!!e.capabilities.supports.vision,this.supportsPrediction=!!e.capabilities.supports.prediction,this.supportsAdaptiveThinking=e.capabilities.supports.adaptive_thinking,this.minThinkingBudget=e.capabilities.supports.min_thinking_budget,this.maxThinkingBudget=e.capabilities.supports.max_thinking_budget,this.supportsReasoningEffort=e.capabilities.supports.reasoning_effort,this.supportsToolSearch=e.capabilities.supports.tool_search??(0,nEe.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,nEe.modelSupportsContextEditing)(this),this._supportsStreaming=!!e.capabilities.supports.streaming,this.customModel=e.custom_model,this.maxPromptImages=e.capabilities.limits?.vision?.max_prompt_images,this.warningText=e.warning_text,this.promo=e.billing?.promo?{id:e.billing.promo.id,discountPercent:e.billing.promo.discount_percent,endsAt:e.billing.promo.ends_at,message:e.billing.promo.message}:void 0}getExtraHeaders(e,r){let n={...this.modelMetadata.requestHeaders};if(this.useMessagesApi){let o=this._configurationService.getConfig(Lie.ConfigKey.TeamInternal.ModelProviderPreference);o&&(n["X-Model-Provider-Preference"]=o)}return Object.assign(n,this.getAnthropicBetaHeader(e,r)),n}getAnthropicBetaHeader(e,r){if(!this.useMessagesApi)return{};let n=[];this.supportsAdaptiveThinking||n.push("interleaved-thinking-2025-05-14"),this.supportsToolSearch&&n.push("advanced-tool-use-2025-11-20"),(0,Bji.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,Bji.isExtendedCacheTtlEnabled)(this,this._configurationService,this._expService,e,o)&&n.push("extended-cache-ttl-2025-04-11"),n.length>0?{"anthropic-beta":n.join(",")}:{}}get modelMaxPromptTokens(){return this._maxTokens}get maxOutputTokens(){return this._maxOutputTokens}get urlOrRequestMetadata(){return this.modelMetadata.urlOrRequestMetadata??(this.useResponsesApi?{type:LLr.RequestType.ChatResponses}:this.useMessagesApi?{type:LLr.RequestType.ChatMessages}:{type:LLr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(iFe.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(iFe.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(iFe.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(iFe.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(Lie.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(iFe.ModelSupportedEndpoint.Messages))}get degradationReason(){return this.modelMetadata.warning_messages?.at(0)?.message}get apiType(){return this.useResponsesApi?"responses":this.useMessagesApi?"messages":"chatCompletions"}interceptBody(e){if(e&&!this.supportsToolCalls&&delete e.tools,e&&!this._supportsStreaming&&(e.stream=!1),e?.messages&&(this.family.startsWith("o1")||this.model==="o1"||this.model==="o1-mini")){let r=e.messages.map(n=>n.role===Oji.OpenAI.ChatRole.System?{role:Oji.OpenAI.ChatRole.User,content:n.content}:n);e.messages=r}}createRequestBody(e){let r=this.getImageLimit();if(r!==void 0&&(e={...e,messages:this.validateAndFilterImages(e.messages,r)}),this.useResponsesApi){let n=this._instantiationService.invokeFunction(BLr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(Fji.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,Pxc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,nEe.isAnthropicFamily)(this))return 20;if((0,nEe.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,Bxc.filterHistoryImages)(e,r)}getCompletionsCallback(){}customizeMessagesBody(e){return e}customizeResponsesBody(e){return e}customizeCapiBody(e,r){if(!!r.requestOptions?.tools?.length&&this.family.toLowerCase().includes("gemini-3")){let o=this._configurationService.getExperimentBasedConfig(Lie.ConfigKey.TeamInternal.GeminiFunctionCallingMode,this._expService);o&&typeof e.tool_choice!="object"&&(e.tool_choice=o)}return this.family.toLowerCase().includes("gemini-3")&&this._configurationService.getExperimentBasedConfig(Lie.ConfigKey.EnableGemini3LowReasoningEffort,this._expService)&&(e.reasoning_effort="low"),(0,nEe.isKimiFamily)(this)&&(e.temperature=1,e.top_p=.95),e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,BLr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,BLr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,Fji.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?QLr(e,r,n,o,s,c,l):zji(n,s,c)}acquireTokenizer(){return this._tokenizerProvider.acquireTokenizer(this)}async makeChatRequest2(e,r){let n=e.useWebSocket??!!(e.turnId&&e.conversationId&&this.useWebSocketResponsesApi&&this._configurationService.getExperimentBasedConfig(Lie.ConfigKey.TeamInternal.ResponsesApiWebSocketEnabled,this._expService)),o=e.ignoreStatefulMarker??!(n&&e.conversationId&&e.turnId&&this._chatWebSocketService.hasActiveConnection(e.conversationId)),s=await this._makeChatRequest2({...e,useWebSocket:n,ignoreStatefulMarker:o},r);return s.type===xxc.ChatFetchResponseType.InvalidStatefulMarker?this._makeChatRequest2({...e,useWebSocket:n,ignoreStatefulMarker:!0},r):s}async _makeChatRequest2(e,r){return this._chatMLFetcher.fetchOne({requestOptions:{},...e,endpoint:this},r)}async makeChatRequest(e,r,n,o,s,c,l,u,d){return this.makeChatRequest2({debugName:e,messages:r,finishedCb:n,location:s,source:c,requestOptions:l,userInitiatedRequest:u,telemetryProperties:d},o)}cloneWithTokenOverride(e){return this._instantiationService.createInstance(FLr,(0,Lji.mixin)((0,Lji.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};HS.ChatEndpoint=WSt;HS.ChatEndpoint=WSt=FLr=Uji([Ym(1,Wji.IDomainService),Ym(2,jji.IChatMLFetcher),Ym(3,Vji.ITokenizerProvider),Ym(4,qji.IInstantiationService),Ym(5,Lie.IConfigurationService),Ym(6,$ji.IExperimentationService),Ym(7,Gji.IChatWebSocketManager),Ym(8,Hji.ILogService)],WSt);var ULr=class extends WSt{static{a(this,"RemoteAgentChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A){super(e,n,u,d,f,h,m,g,A),this._requestMetadata=r}processResponseFromChatEndpoint(e,r,n,o,s,c,l,u){return QLr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};HS.RemoteAgentChatEndpoint=ULr;HS.RemoteAgentChatEndpoint=ULr=Uji([Ym(2,Wji.IDomainService),Ym(3,Oxc.ICAPIClientService),Ym(4,kxc.IFetcherService),Ym(5,Mxc.ITelemetryService),Ym(6,Ixc.IAuthenticationService),Ym(7,jji.IChatMLFetcher),Ym(8,Vji.ITokenizerProvider),Ym(9,qji.IInstantiationService),Ym(10,Lie.IConfigurationService),Ym(11,$ji.IExperimentationService),Ym(12,Gji.IChatWebSocketManager),Ym(13,Hji.ILogService)],ULr)});var Yji=I(LI=>{"use strict";p();var Fxc=LI&&LI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},OI=LI&&LI.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(LI,"__esModule",{value:!0});LI.CopilotUtilityChatEndpoint=LI.CopilotUtilitySmallChatEndpoint=LI.CopilotChatEndpoint=void 0;var Uxc=Ks(),Qxc=rE(),qxc=LU(),jxc=Hl(),Hxc=FD(),Gxc=Np(),$xc=Oy(),Vxc=UU(),Wxc=Rh(),zxc=bh(),Yxc=$V(),Kxc=lE(),Jxc=VV(),Zxc=Bie(),oFe=class extends Zxc.ChatEndpoint{static{a(this,"CopilotChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A){super(e,r,u,d,f,h,m,g,A)}getCompletionsCallback(){return(e,r)=>{r&&r.id&&(e.reasoning_opaque=r.id,e.reasoning_text=Array.isArray(r.text)?r.text.join(""):r.text)}}};LI.CopilotChatEndpoint=oFe;LI.CopilotChatEndpoint=oFe=Fxc([OI(1,Jxc.IDomainService),OI(2,Kxc.ICAPIClientService),OI(3,$xc.IFetcherService),OI(4,Hxc.IEnvService),OI(5,zxc.ITelemetryService),OI(6,Qxc.IAuthenticationService),OI(7,qxc.IChatMLFetcher),OI(8,Yxc.ITokenizerProvider),OI(9,Uxc.IInstantiationService),OI(10,jxc.IConfigurationService),OI(11,Wxc.IExperimentationService),OI(12,Vxc.IChatWebSocketManager),OI(13,Gxc.ILogService)],oFe);var qLr=class t{static{a(this,"CopilotUtilitySmallChatEndpoint")}static{this.capiFamily="gpt-4o-mini"}static async resolve(e,r){let n;try{n=await e.getChatModelFromCapiFamily(t.capiFamily)}catch{n=await e.getCopilotUtilityModel()}return r.createInstance(oFe,n)}};LI.CopilotUtilitySmallChatEndpoint=qLr;var jLr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(oFe,n)}};LI.CopilotUtilityChatEndpoint=jLr});var HLr=I(sB=>{"use strict";p();var Xxc=sB&&sB.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},BI=sB&&sB.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(sB,"__esModule",{value:!0});sB.AutoChatEndpoint=void 0;sB.isAutoModel=gwc;var ewc=Ks(),twc=rE(),rwc=LU(),nwc=Hl(),iwc=FD(),owc=Np(),swc=Oy(),awc=UU(),cwc=Rh(),lwc=bh(),uwc=$V(),dwc=lE(),fwc=VV(),pwc=Bie(),hwc=Yji(),sFe=class extends hwc.CopilotChatEndpoint{static{a(this,"AutoChatEndpoint")}static{this.pseudoModelId="auto"}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E){super(mwc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,_,E),this.discountRange=o}};sB.AutoChatEndpoint=sFe;sB.AutoChatEndpoint=sFe=Xxc([BI(4,fwc.IDomainService),BI(5,dwc.ICAPIClientService),BI(6,swc.IFetcherService),BI(7,iwc.IEnvService),BI(8,lwc.ITelemetryService),BI(9,twc.IAuthenticationService),BI(10,rwc.IChatMLFetcher),BI(11,uwc.ITokenizerProvider),BI(12,ewc.IInstantiationService),BI(13,nwc.IConfigurationService),BI(14,cwc.IExperimentationService),BI(15,awc.IChatWebSocketManager),BI(16,owc.ILogService)],sFe);function mwc(t,e,r){let n;t instanceof pwc.ChatEndpoint?n=t.modelMetadata:n={id:t.model,vendor:t.modelProvider,name:t.name,version:t.version,model_picker_enabled:t.showInModelPicker,is_chat_default:!0,is_chat_fallback:t.isFallback,capabilities:{type:"chat",family:t.family,tokenizer:t.tokenizer,limits:{max_prompt_tokens:t.modelMaxPromptTokens,max_output_tokens:t.maxOutputTokens},supports:{tool_calls:t.supportsToolCalls,vision:t.supportsVision,prediction:t.supportsPrediction,streaming:!0}},billing:t.isPremium!==void 0||t.multiplier!==void 0||t.restrictedToSkus!==void 0?{is_premium:t.isPremium??!1,multiplier:t.multiplier??0,restricted_to:t.restrictedToSkus}:void 0,custom_model:t.customModel};let o=t.multiplier!==void 0?Math.round(t.multiplier*(1-r)*100)/100:void 0;return{...n,warning_messages:void 0,model_picker_enabled:!0,info_messages:void 0,billing:{is_premium:n.billing?.is_premium,multiplier:o,restricted_to:n.billing?.restricted_to},requestHeaders:{...n.requestHeaders||{},"Copilot-Session-Token":e}}}a(mwc,"calculateAutoModelInfo");function gwc(t){return t&&(t.model===sFe.pseudoModelId||t instanceof sFe)?1:-1}a(gwc,"isAutoModel")});var $Lr=I(aFe=>{"use strict";p();Object.defineProperty(aFe,"__esModule",{value:!0});aFe.getImageTelemetryEventMeasurements=Awc;aFe.getImageTelemetryMeasurementsFromMessages=ywc;aFe.getImageTelemetryMeasurementsFromReferences=_wc;var eHi=ELr(),Kji="screenshot-focused-window";function tHi(){return{imageCount:0,totalImageBytes:0,maxImageBytes:0,maxImageWidth:0,maxImageHeight:0,maxImagePixels:0,totalImagePixels:0,imagePngCount:0,imageJpegCount:0,imageGifCount:0,imageWebpCount:0,imageUnknownMimeCount:0,imageClipboardCount:0,imageScreenshotCount:0,imageFileCount:0,imageUrlCount:0,imageUnknownSourceCount:0}}a(tHi,"createEmptyImageTelemetryMeasurements");function Awc(t){return t.imageCount>0?t:{}}a(Awc,"getImageTelemetryEventMeasurements");function ywc(t){let e=tHi();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=wwc(n,"imageUrl"),s=GLr(o,"url");if(!s)continue;let c=Ewc(s,GLr(o,"mediaType"));c&&rHi(e,c)}return e}a(ywc,"getImageTelemetryMeasurementsFromMessages");function _wc(t){let e=tHi();for(let r of t??[]){let n=iEe(r.value);if(!n)continue;let o=GLr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=Zji(n.data)??Zji(n.value);rHi(e,{mimeType:o,byteLength:s?.byteLength??Xji(n.data)??Xji(n.value),dimensions:bwc(s,o),source:Swc(r,n)})}return e}a(_wc,"getImageTelemetryMeasurementsFromReferences");function rHi(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),vwc(t,e.dimensions),nHi(e.mimeType)){case"png":t.imagePngCount++;break;case"jpeg":t.imageJpegCount++;break;case"gif":t.imageGifCount++;break;case"webp":t.imageWebpCount++;break;default:t.imageUnknownMimeCount++}switch(e.source){case"clipboard":t.imageClipboardCount++;break;case"screenshot":t.imageScreenshotCount++;break;case"file":t.imageFileCount++;break;case"url":t.imageUrlCount++;break;default:t.imageUnknownSourceCount++}}a(rHi,"addImageTelemetryInput");function Ewc(t,e){if(!t.startsWith("data:"))return t.startsWith("https://")?{mimeType:e,source:"url"}:void 0;let r=/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/.exec(t);if(r)return{mimeType:e??r[1],byteLength:Twc(r[2]),dimensions:Cwc(t),source:"unknown"}}a(Ewc,"getImageTelemetryInputFromUrl");function vwc(t,e){if(!e||!Jji(e.width)||!Jji(e.height))return;let r=e.width*e.height;!Number.isFinite(r)||r<=0||(t.maxImageWidth=Math.max(t.maxImageWidth,e.width),t.maxImageHeight=Math.max(t.maxImageHeight,e.height),t.maxImagePixels=Math.max(t.maxImagePixels,r),t.totalImagePixels+=r)}a(vwc,"addImageDimensions");function Jji(t){return Number.isFinite(t)&&t>0}a(Jji,"isValidDimension");function Cwc(t){try{return(0,eHi.getImageDimensions)(t)}catch{return}}a(Cwc,"getImageDimensionsFromDataUrl");function bwc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||nHi(r)==="unknown"))try{return(0,eHi.getImageDimensionsFromBytes)(t,r)}catch{return}}a(bwc,"getImageDimensionsFromBytes");function nHi(t){switch(t?.toLowerCase().split(";")[0].trim()){case"image/png":return"png";case"image/jpeg":case"image/jpg":return"jpeg";case"image/gif":return"gif";case"image/webp":return"webp";default:return"unknown"}}a(nHi,"normalizeMimeType");function Swc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===Kji||e.id===Kji?"screenshot":e.isURL===!1?"file":"unknown"}a(Swc,"getImageSourceFromReference");function Twc(t){let e=t.trim(),r=0;return e.endsWith("==")?r=2:e.endsWith("=")&&(r=1),Math.max(0,Math.floor(e.length*3/4)-r)}a(Twc,"getBase64ByteLength");function Zji(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=iEe(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(Iwc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(xwc))return new Uint8Array(o)}a(Zji,"getByteData");function Iwc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(Iwc,"isArrayIndexKey");function xwc(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(xwc,"isByteValue");function Xji(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=iEe(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(Xji,"getByteLength");function wwc(t,e){return iEe(iEe(t)?.[e])}a(wwc,"getObjectProperty");function GLr(t,e){let r=iEe(t)?.[e];return typeof r=="string"?r:void 0}a(GLr,"getStringProperty");function iEe(t){return typeof t=="object"&&t!==null?t:void 0}a(iEe,"asRecord")});var sHi=I(oEe=>{"use strict";p();Object.defineProperty(oEe,"__esModule",{value:!0});oEe.ChatFailKind=oEe.FetchResponseKind=void 0;var iHi;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(iHi||(oEe.FetchResponseKind=iHi={}));var oHi;(function(t){t.OffTopic="offTopic",t.TokenExpiredOrInvalid="tokenExpiredOrInvalid",t.ServerCanceled="serverCanceled",t.ClientNotSupported="clientNotSupported",t.RateLimited="rateLimited",t.QuotaExceeded="quotaExceeded",t.ExtensionBlocked="extensionBlocked",t.ServerError="serverError",t.ContentFilter="contentFilter",t.AgentUnauthorized="unauthorized",t.AgentFailedDependency="failedDependency",t.ValidationFailed="validationFailed",t.InvalidPreviousResponseId="invalidPreviousResponseId",t.NotFound="notFound",t.Unknown="unknown"})(oHi||(oEe.ChatFailKind=oHi={}))});var cFe=I(Gu=>{"use strict";p();Object.defineProperty(Gu,"__esModule",{value:!0});Gu.FILE_TOOL_NAMES=Gu.SHELL_TOOL_NAMES=Gu.TOOL_PARAM_COMMAND_MAX_LEN=Gu.GitHubCopilotAttr=Gu.CopilotCliSdkAttr=Gu.StdAttr=Gu.CopilotChatAttr=Gu.GenAiAttr=Gu.GenAiToolType=Gu.GenAiTokenType=Gu.GenAiProviderName=Gu.GenAiOperationName=void 0;Gu.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};Gu.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};Gu.GenAiTokenType={INPUT:"input",OUTPUT:"output"};Gu.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};Gu.GenAiAttr={OPERATION_NAME:"gen_ai.operation.name",PROVIDER_NAME:"gen_ai.provider.name",REQUEST_MODEL:"gen_ai.request.model",REQUEST_TEMPERATURE:"gen_ai.request.temperature",REQUEST_MAX_TOKENS:"gen_ai.request.max_tokens",REQUEST_TOP_P:"gen_ai.request.top_p",REQUEST_FREQUENCY_PENALTY:"gen_ai.request.frequency_penalty",REQUEST_PRESENCE_PENALTY:"gen_ai.request.presence_penalty",REQUEST_SEED:"gen_ai.request.seed",REQUEST_STOP_SEQUENCES:"gen_ai.request.stop_sequences",REQUEST_STREAM:"gen_ai.request.stream",RESPONSE_MODEL:"gen_ai.response.model",RESPONSE_ID:"gen_ai.response.id",RESPONSE_FINISH_REASONS:"gen_ai.response.finish_reasons",RESPONSE_TIME_TO_FIRST_CHUNK:"gen_ai.response.time_to_first_chunk",USAGE_INPUT_TOKENS:"gen_ai.usage.input_tokens",USAGE_OUTPUT_TOKENS:"gen_ai.usage.output_tokens",USAGE_CACHE_READ_INPUT_TOKENS:"gen_ai.usage.cache_read.input_tokens",USAGE_CACHE_CREATION_INPUT_TOKENS:"gen_ai.usage.cache_creation.input_tokens",USAGE_REASONING_TOKENS:"gen_ai.usage.reasoning_tokens",USAGE_REASONING_OUTPUT_TOKENS:"gen_ai.usage.reasoning.output_tokens",CONVERSATION_ID:"gen_ai.conversation.id",OUTPUT_TYPE:"gen_ai.output.type",TOKEN_TYPE:"gen_ai.token.type",AGENT_NAME:"gen_ai.agent.name",AGENT_ID:"gen_ai.agent.id",AGENT_VERSION:"gen_ai.agent.version",AGENT_DESCRIPTION:"gen_ai.agent.description",TOOL_NAME:"gen_ai.tool.name",TOOL_TYPE:"gen_ai.tool.type",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_DESCRIPTION:"gen_ai.tool.description",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",TOOL_DEFINITIONS:"gen_ai.tool.definitions"};Gu.CopilotChatAttr={LOCATION:"copilot_chat.location",INTENT:"copilot_chat.intent",TURN_INDEX:"copilot_chat.turn.index",TURN_COUNT:"copilot_chat.turn_count",TOOL_CALL_ROUND:"copilot_chat.tool_call_round",API_TYPE:"copilot_chat.api_type",FETCHER:"copilot_chat.fetcher",DEBUG_NAME:"copilot_chat.debug_name",ENDPOINT_TYPE:"copilot_chat.endpoint_type",MAX_PROMPT_TOKENS:"copilot_chat.request.max_prompt_tokens",TIME_TO_FIRST_TOKEN:"copilot_chat.time_to_first_token",SESSION_ID:"copilot_chat.session_id",SERVER_REQUEST_ID:"copilot_chat.server_request_id",CANCELED:"copilot_chat.canceled",REASONING_CONTENT:"copilot_chat.reasoning_content",USER_REQUEST:"copilot_chat.user_request",REQUEST_OPTIONS:"copilot_chat.request.options",REQUEST_SHAPE:"copilot_chat.request.shape",PROMPT_CONTEXT:"copilot_chat.prompt_context",PROMPT_INSTRUCTIONS:"copilot_chat.prompt_instructions",CHAT_SESSION_ID:"copilot_chat.chat_session_id",PARENT_CHAT_SESSION_ID:"copilot_chat.parent_chat_session_id",DEBUG_LOG_LABEL:"copilot_chat.debug_log_label",MARKDOWN_CONTENT:"copilot_chat.markdown_content",EDIT_SOURCE:"copilot_chat.edit.source",EDIT_OUTCOME:"copilot_chat.edit.outcome",LANGUAGE_ID:"copilot_chat.language_id",TIME_DELAY_MS:"copilot_chat.time_delay_ms",HAS_REMAINING_EDITS:"copilot_chat.has_remaining_edits",REPO_HEAD_BRANCH_NAME:"copilot_chat.repo.head_branch_name",REPO_HEAD_COMMIT_HASH:"copilot_chat.repo.head_commit_hash",REPO_REMOTE_URL:"copilot_chat.repo.remote_url",FILE_RELATIVE_PATH:"copilot_chat.file.relative_path",HOOK_TYPE:"copilot_chat.hook_type",HOOK_INPUT:"copilot_chat.hook_input",HOOK_OUTPUT:"copilot_chat.hook_output",HOOK_RESULT_KIND:"copilot_chat.hook_result_kind",MODE_NAME:"copilot_chat.mode_name",TOTAL_COST_USD:"copilot_chat.total_cost_usd",COPILOT_USAGE_NANO_AIU:"copilot_chat.copilot_usage_nano_aiu"};Gu.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};Gu.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};Gu.GitHubCopilotAttr={AGENT_TYPE:"github.copilot.agent.type",CLOUD_BACKEND_VERSION:"github.copilot.cloud.backend_version",GIT_REPOSITORY:"github.copilot.git.repository",GIT_BRANCH:"github.copilot.git.branch",GIT_COMMIT_SHA:"github.copilot.git.commit_sha",GITHUB_ORG:"github.copilot.github.org",HOOK_DECISION:"github.copilot.hook.decision",HOOK_DURATION_SECONDS:"github.copilot.hook.duration",HOOK_TOOL_NAMES:"github.copilot.hook.tool_names",MCP_SERVER_NAME_HASH:"github.copilot.mcp.server.name_hash",MCP_SERVER_NAME:"github.copilot.mcp.server.name",TOOL_PARAM_COMMAND:"github.copilot.tool.parameters.command",TOOL_PARAM_FILE_PATH:"github.copilot.tool.parameters.file_path",TOOL_PARAM_EDIT_TYPE:"github.copilot.tool.parameters.edit_type",TOOL_PARAM_SKILL_NAME:"github.copilot.tool.parameters.skill_name",TOOL_PARAM_MCP_SERVER_NAME_HASH:"github.copilot.tool.parameters.mcp_server_name_hash",TOOL_PARAM_MCP_SERVER_NAME:"github.copilot.tool.parameters.mcp_server_name",TOOL_PARAM_MCP_TOOL_NAME:"github.copilot.tool.parameters.mcp_tool_name"};Gu.TOOL_PARAM_COMMAND_MAX_LEN=256;Gu.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);Gu.FILE_TOOL_NAMES=new Set(["view","create","edit","str_replace","str_replace_editor","insert","readFile","createFile","replaceString","applyPatch","read_file","create_file","apply_patch","insert_edit_into_file","replace_string_in_file","multi_replace_string_in_file","edit_notebook_file","Read","Edit","MultiEdit","Write","NotebookEdit"])});var WLr=I(Ek=>{"use strict";p();Object.defineProperty(Ek,"__esModule",{value:!0});Ek.truncateForOTel=Rwc;Ek.toInputMessages=kwc;Ek.toOutputMessages=Pwc;Ek.toSystemInstructions=Dwc;Ek.extractTextFromContent=VLr;Ek.collectSystemTextsFromRequestBody=Nwc;Ek.normalizeProviderMessages=Mwc;Ek.toToolDefinitions=lHi;Ek.stringifyToolDefinitionsForOTel=qwc;Ek.stringifyToolsRawForTelemetry=jwc;function Rwc(t,e=0){if(e<=0||t.length<=e)return t;let r=`...[truncated, original ${t.length} chars]`;return e<=r.length?t.substring(0,e):t.substring(0,e-r.length)+r}a(Rwc,"truncateForOTel");function kwc(t){return t.map(e=>{let r=[];if(e.role==="tool"&&e.tool_call_id)return r.push({type:"tool_call_response",id:e.tool_call_id,response:e.content??""}),{role:e.role,parts:r};if(e.content&&r.push({type:"text",content:e.content}),e.tool_calls)for(let n of e.tool_calls){let o;try{o=JSON.parse(n.function.arguments)}catch{o=n.function.arguments}r.push({type:"tool_call",id:n.id,name:n.function.name,arguments:o})}return{role:e.role,parts:r}})}a(kwc,"toInputMessages");function Pwc(t){return t.map(e=>{let r=[],n=e.message;if(n?.content&&r.push({type:"text",content:n.content}),n?.tool_calls)for(let o of n.tool_calls){let s;try{s=JSON.parse(o.function.arguments)}catch{s=o.function.arguments}r.push({type:"tool_call",id:o.id,name:o.function.name,arguments:s})}return{role:n?.role??"assistant",parts:r,finish_reason:e.finish_reason}})}a(Pwc,"toOutputMessages");function Dwc(t){if(t===void 0)return;let r=(Array.isArray(t)?t:[t]).filter(n=>typeof n=="string"&&n.length>0).map(n=>({type:"text",content:n}));return r.length>0?r:void 0}a(Dwc,"toSystemInstructions");function VLr(t){return typeof t=="string"?t:Array.isArray(t)?t.map(e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"){let r=e;if(typeof r.text=="string")return r.text;if(typeof r.content=="string")return r.content}return""}).filter(e=>e.length>0).join(` -`):""}a(VLr,"extractTextFromContent");function Nwc(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=VLr(n.content);o&&e.push(o)}}if(e.length===0){let n=VLr(t.system??t.instructions);n&&e.push(n)}return e}a(Nwc,"collectSystemTextsFromRequestBody");function Mwc(t){return t.map(e=>{switch(e.type){case"function_call":return Owc(e);case"function_call_output":return Lwc(e);case"tool_search_output":return Bwc(e);case"reasoning":return Fwc(e)}let n=e.role,o=[],s=e.content;if(n==="tool"&&typeof e.tool_call_id=="string")return o.push({type:"tool_call_response",id:e.tool_call_id,response:s??""}),{role:n,parts:o};if(typeof s=="string"&&s.length>0)o.push({type:"text",content:s});else if(Array.isArray(s))for(let l of s){if(!l||typeof l!="object")continue;let u=l;switch(u.type){case"text":case"input_text":case"output_text":typeof u.text=="string"&&o.push({type:"text",content:u.text});break;case"tool_use":o.push({type:"tool_call",id:String(u.id??""),name:String(u.name??""),arguments:u.input});break;case"tool_result":o.push({type:"tool_call_response",id:String(u.tool_use_id??""),response:u.content??""});break;case"thinking":typeof u.thinking=="string"&&o.push({type:"reasoning",content:u.thinking});break;default:o.push({type:"text",content:JSON.stringify(u)});break}}let c=e.tool_calls;if(Array.isArray(c))for(let l of c){if(!l||typeof l!="object")continue;let u=l,d=u.function;if(d){let f;try{f=typeof d.arguments=="string"?JSON.parse(d.arguments):d.arguments}catch{f=d.arguments}o.push({type:"tool_call",id:String(u.id??""),name:String(d.name??""),arguments:f})}}return{role:n,parts:o}})}a(Mwc,"normalizeProviderMessages");function Owc(t){let e=t.arguments;if(typeof e=="string")try{e=JSON.parse(e)}catch{}return{role:"assistant",parts:[{type:"tool_call",id:String(t.call_id??t.id??""),name:String(t.name??""),arguments:e}]}}a(Owc,"normalizeResponsesFunctionCall");function Lwc(t){let e=t.output,r;return typeof e=="string"?r=e:Array.isArray(e)?r=e.map(n=>n&&typeof n=="object"&&typeof n.text=="string"?n.text:JSON.stringify(n)).join(""):r=e??"",{role:"tool",parts:[{type:"tool_call_response",id:String(t.call_id??t.id??""),response:r}]}}a(Lwc,"normalizeResponsesFunctionCallOutput");function Bwc(t){let e=Object.prototype.hasOwnProperty.call(t,"tools")&&t.tools!==void 0,r={type:"tool_search_output",id:String(t.call_id??t.id??""),status:typeof t.status=="string"?t.status:void 0};return e&&(r.tools=t.tools),{role:"tool_search",parts:[r]}}a(Bwc,"normalizeResponsesToolSearchOutput");function Fwc(t){let e=[],r=t.summary;if(Array.isArray(r))for(let n of r)n&&typeof n=="object"&&typeof n.text=="string"&&e.push({type:"reasoning",content:n.text});else typeof r=="string"&&e.push({type:"reasoning",content:r});return typeof t.encrypted_content=="string"&&e.push({type:"reasoning",content:t.encrypted_content}),{role:"assistant",parts:e}}a(Fwc,"normalizeResponsesReasoning");function lHi(t){if(!t||t.length===0)return;let e=[];for(let r of t){let n=r.function?.name??r.name;if(!n)continue;let o=r.function?.description??r.description,s=r.function?.parameters??r.parameters??r.input_schema??r.inputSchema;e.push({type:"function",name:n,description:o,parameters:s})}return e.length>0?e:void 0}a(lHi,"toToolDefinitions");var aHi=new WeakMap,cHi=new WeakMap,zSt,YSt;function Uwc(t){return zSt!==void 0&&zSt===t?zSt:(zSt=t,t)}a(Uwc,"internToolDefsString");function Qwc(t){return YSt!==void 0&&YSt===t?YSt:(YSt=t,t)}a(Qwc,"internToolsRawString");function qwc(t){if(!t||t.length===0)return;let e=aHi.get(t);if(e!==void 0)return e;let r=lHi(t);if(!r)return;let n=Uwc(JSON.stringify(r));return aHi.set(t,n),n}a(qwc,"stringifyToolDefinitionsForOTel");function jwc(t){if(!t)return;let e=cHi.get(t);if(e!==void 0)return e;let r=Qwc(JSON.stringify(t));return cHi.set(t,r),r}a(jwc,"stringifyToolsRawForTelemetry")});var zLr=I(KSt=>{"use strict";p();Object.defineProperty(KSt,"__esModule",{value:!0});KSt.resolveWorkspaceOTelMetadata=Hwc;KSt.workspaceMetadataToOTelAttributes=$wc;var uHi=x2(),dHi=xOr(),WV=cFe();function Hwc(t,e){let r=t.activeRepository?.get();return r?Gwc(r,e):{}}a(Hwc,"resolveWorkspaceOTelMetadata");function Gwc(t,e){let r,n=Array.from((0,dHi.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,dHi.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,uHi.isEqualOrParent)(e,t.rootUri)&&(o=(0,uHi.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(Gwc,"buildWorkspaceMetadata");function $wc(t){if(!t)return{};let e={};if(t.headBranchName&&(e[WV.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[WV.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[WV.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[WV.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[WV.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[WV.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=Vwc(t.remoteUrl);r&&(e[WV.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[WV.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a($wc,"workspaceMetadataToOTelAttributes");function Vwc(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a(Vwc,"extractGitHubOrg")});var fHi=I(vk=>{"use strict";p();Object.defineProperty(vk,"__esModule",{value:!0});vk.emitInferenceDetailsEvent=Wwc;vk.emitSessionStartEvent=zwc;vk.emitToolCallEvent=Ywc;vk.emitAgentTurnEvent=Kwc;vk.emitEditFeedbackEvent=Jwc;vk.emitEditHunkActionEvent=Zwc;vk.emitInlineDoneEvent=Xwc;vk.emitEditSurvivalEvent=eRc;vk.emitUserFeedbackEvent=tRc;vk.emitCloudSessionInvokeEvent=rRc;var Km=cFe(),sEe=WLr(),JSt=zLr();function Wwc(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[Km.GenAiAttr.OPERATION_NAME]:Km.GenAiOperationName.CHAT,[Km.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[Km.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[Km.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[Km.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[Km.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[Km.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[Km.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[Km.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[Km.StdAttr.ERROR_TYPE]=n.type),t.config.captureContent){let s=t.config.maxAttributeSizeChars;if(e.messages!==void 0){let c=Array.isArray(e.messages)?e.messages:void 0;o[Km.GenAiAttr.INPUT_MESSAGES]=(0,sEe.truncateForOTel)(JSON.stringify(c?(0,sEe.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,sEe.toSystemInstructions)(c);l!==void 0&&(o[Km.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,sEe.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,sEe.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[Km.GenAiAttr.TOOL_DEFINITIONS]=(0,sEe.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(Wwc,"emitInferenceDetailsEvent");function zwc(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[Km.GenAiAttr.REQUEST_MODEL]:r,[Km.GenAiAttr.AGENT_NAME]:n})}a(zwc,"emitSessionStartEvent");function Ywc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[Km.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[Km.StdAttr.ERROR_TYPE]:o}:{}})}a(Ywc,"emitToolCallEvent");function Kwc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[Km.GenAiAttr.USAGE_INPUT_TOKENS]:r,[Km.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a(Kwc,"emitAgentTurnEvent");function Jwc(t,e,r,n,o,s,c,l,u){t.emitLogRecord(`copilot_chat.edit.feedback: ${e}`,{"event.name":"copilot_chat.edit.feedback",outcome:e,language_id:r,participant:n,request_id:o,edit_surface:s,has_remaining_edits:c,is_notebook:l,...(0,JSt.workspaceMetadataToOTelAttributes)(u)})}a(Jwc,"emitEditFeedbackEvent");function Zwc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.edit.hunk.action: ${e}`,{"event.name":"copilot_chat.edit.hunk.action",outcome:e,language_id:r,request_id:n,line_count:o,lines_added:s,lines_removed:c,...(0,JSt.workspaceMetadataToOTelAttributes)(l)})}a(Zwc,"emitEditHunkActionEvent");function Xwc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.inline.done: ${e?"accepted":"rejected"}`,{"event.name":"copilot_chat.inline.done",accepted:e,language_id:r,edit_count:n,edit_line_count:o,reply_type:s,is_notebook:c,...(0,JSt.workspaceMetadataToOTelAttributes)(l)})}a(Xwc,"emitInlineDoneEvent");function eRc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.edit.survival: ${e}`,{"event.name":"copilot_chat.edit.survival",edit_source:e,survival_rate_four_gram:r,survival_rate_no_revert:n,time_delay_ms:o,did_branch_change:s,request_id:c,...(0,JSt.workspaceMetadataToOTelAttributes)(l)})}a(eRc,"emitEditSurvivalEvent");function tRc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.user.feedback: ${e}`,{"event.name":"copilot_chat.user.feedback",rating:e,participant:r,conversation_id:n,request_id:o})}a(tRc,"emitUserFeedbackEvent");function rRc(t,e,r,n){t.emitLogRecord(`copilot_chat.cloud.session.invoke: ${e}`,{"event.name":"copilot_chat.cloud.session.invoke",partner_agent:e,model:r,request_id:n})}a(rRc,"emitCloudSessionInvokeEvent")});var pHi=I(ZSt=>{"use strict";p();Object.defineProperty(ZSt,"__esModule",{value:!0});ZSt.GenAiMetrics=void 0;var Lo=cFe(),YLr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[Lo.GenAiAttr.OPERATION_NAME]:n.operationName,[Lo.GenAiAttr.PROVIDER_NAME]:n.providerName,[Lo.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Lo.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[Lo.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[Lo.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[Lo.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[Lo.GenAiAttr.OPERATION_NAME]:o.operationName,[Lo.GenAiAttr.PROVIDER_NAME]:o.providerName,[Lo.GenAiAttr.TOKEN_TYPE]:n,[Lo.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[Lo.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[Lo.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[Lo.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[Lo.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[Lo.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[Lo.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[Lo.GenAiAttr.REQUEST_MODEL]:r})}static recordTimeToFirstChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_to_first_chunk",r,{[Lo.GenAiAttr.OPERATION_NAME]:n.operationName,[Lo.GenAiAttr.PROVIDER_NAME]:n.providerName,[Lo.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Lo.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static recordTimePerOutputChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_per_output_chunk",r,{[Lo.GenAiAttr.OPERATION_NAME]:n.operationName,[Lo.GenAiAttr.PROVIDER_NAME]:n.providerName,[Lo.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Lo.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static incrementSessionCount(e){e.incrementCounter("copilot_chat.session.count")}static recordEditAcceptance(e,r,n,o){e.incrementCounter("copilot_chat.edit.acceptance.count",1,{[Lo.CopilotChatAttr.EDIT_SOURCE]:r,[Lo.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[Lo.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[Lo.CopilotChatAttr.EDIT_SOURCE]:r,[Lo.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[Lo.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[Lo.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[Lo.CopilotChatAttr.EDIT_SOURCE]:r,[Lo.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[Lo.CopilotChatAttr.EDIT_SOURCE]:r,[Lo.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[Lo.CopilotChatAttr.LANGUAGE_ID]:n}:{}})}static incrementUserActionCount(e,r){e.incrementCounter("copilot_chat.user.action.count",1,{action:r})}static incrementUserFeedbackCount(e,r){e.incrementCounter("copilot_chat.user.feedback.count",1,{rating:r})}static incrementAgentEditResponseCount(e,r){e.incrementCounter("copilot_chat.agent.edit_response.count",1,{outcome:r})}static incrementAgentSummarizationCount(e,r){e.incrementCounter("copilot_chat.agent.summarization.count",1,{outcome:r})}static incrementPullRequestCount(e){e.incrementCounter("copilot_chat.pull_request.count")}static incrementCloudSessionCount(e,r,n){e.incrementCounter("copilot_chat.cloud.session.count",1,{partner_agent:r,...n?{[Lo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n}:{}})}static incrementCloudPrReadyCount(e,r){e.incrementCounter("copilot_chat.cloud.pr_ready.count",1,r?{[Lo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:r}:void 0)}static recordCloudOperation(e,r,n,o,s){e.incrementCounter("copilot_chat.cloud.operation.count",1,{operation:r,[Lo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,success:o}),s!==void 0&&e.recordMetric("copilot_chat.cloud.operation.duration",s,{operation:r,[Lo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n})}static incrementCloudError(e,r,n,o){e.incrementCounter("copilot_chat.cloud.error.count",1,{operation:r,[Lo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,[Lo.StdAttr.ERROR_TYPE]:o})}};ZSt.GenAiMetrics=YLr});var JLr=I(XSt=>{"use strict";p();Object.defineProperty(XSt,"__esModule",{value:!0});XSt.NoopOTelService=void 0;var hHi=Fc(),mHi={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},KLr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=hHi.Event.None,this.onDidEmitSpanEvent=hHi.Event.None,this.config=e}startSpan(e,r){return mHi}startActiveSpan(e,r,n){return n(mHi)}getActiveTraceContext(){}storeTraceContext(e,r){}getStoredTraceContext(e){}runWithTraceContext(e,r){return r()}recordMetric(e,r,n){}incrementCounter(e,r,n){}emitLogRecord(e,r){}async flush(){}async shutdown(){}injectCompletedSpan(e){}};XSt.NoopOTelService=KLr});var ZLr=I(Fie=>{"use strict";p();Object.defineProperty(Fie,"__esModule",{value:!0});Fie.DEFAULT_OTLP_ENDPOINT=void 0;Fie.resolveOTelConfig=iRc;Fie.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function gHi(t){if(!t)return{};let e={};for(let r of t.split(",")){let n=r.indexOf("=");if(n>0){let o=r.substring(0,n).trim(),s=r.substring(n+1).trim();o&&(e[o]=s)}}return e}a(gHi,"parseResourceAttributes");function nRc(t,e){if(!t)return;let r=t.replace(/^["']|["']$/g,"");try{let n=new URL(r);return e==="grpc"?n.origin:n.href}catch{return}}a(nRc,"parseOtlpEndpoint");function iRc(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return AHi(t);let r=t.settingDbSpanExporter??!1,n=t.policyOtlpEndpoint!==void 0||t.policyExporterType!==void 0,o=t.policyOtlpEndpoint!==void 0?!0:void 0,s=t.policyEnabled??e1t(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??o??!!e.OTEL_EXPORTER_OTLP_ENDPOINT,c=t.policyEnabled===!1?!1:s||r,l=c&&s===!0;if(!c)return AHi(t);let u;t.policyEnabled===!0||t.policyEnabled===void 0&&t.policyOtlpEndpoint!==void 0?u="policy":e1t(e.COPILOT_OTEL_ENABLED)===!0?u="envVar":t.settingEnabled===!0?u="setting":e.OTEL_EXPORTER_OTLP_ENDPOINT?u="otlpEndpointEnvVar":u="dbSpanExporterOnly";let f=(t.policyExporterType==="otlp-grpc"?"grpc":t.policyExporterType==="otlp-http"?"http":e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL??(t.settingExporterType==="otlp-grpc"?"grpc":t.settingExporterType==="otlp-http"?"http":void 0))==="grpc"?"grpc":"http",h=t.policyProtocol??e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL??t.settingProtocol,m=f==="grpc"?"grpc":h==="http/protobuf"?"http/protobuf":"http/json",g=t.policyOtlpEndpoint??e.COPILOT_OTEL_ENDPOINT??e.OTEL_EXPORTER_OTLP_ENDPOINT??t.settingOtlpEndpoint??Fie.DEFAULT_OTLP_ENDPOINT,A=nRc(g,f)??Fie.DEFAULT_OTLP_ENDPOINT,y=t.policyOutfile!==void 0?t.policyOutfile||void 0:n?void 0:e.COPILOT_OTEL_FILE_EXPORTER_PATH??t.settingOutfile,_;t.policyExporterType?_=t.policyExporterType:n?_="otlp-http":y?_="file":t.settingExporterType?_=t.settingExporterType:_=f==="grpc"?"otlp-grpc":"otlp-http";let E=t.policyCaptureContent??e1t(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,v=oRc(e.COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS)??t.settingMaxAttributeSizeChars??0,S=new Set(["trace","debug","info","warn","error"]),T=e.COPILOT_OTEL_LOG_LEVEL,w=T&&S.has(T)?T:"info",R=e1t(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,x=(t.policyServiceName||void 0)??e.OTEL_SERVICE_NAME??(t.settingServiceName||void 0)??"copilot-chat",k={...t.settingResourceAttributes??{},...gHi(e.OTEL_RESOURCE_ATTRIBUTES),...t.policyResourceAttributes??{}},D={...t.settingHeaders??{},...gHi(e.OTEL_EXPORTER_OTLP_HEADERS),...t.policyHeaders??{}};return Object.freeze({enabled:!0,enabledExplicitly:l,enabledVia:u,exporterType:_,otlpEndpoint:A,otlpProtocol:m,captureContent:E,maxAttributeSizeChars:v<0?0:v,fileExporterPath:y,dbSpanExporter:r,logLevel:w,httpInstrumentation:R,serviceName:x,serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:k,headers:D})}a(iRc,"resolveOTelConfig");function AHi(t){return Object.freeze({enabled:!1,enabledExplicitly:!1,enabledVia:"disabled",exporterType:"otlp-http",otlpEndpoint:"",otlpProtocol:"http/json",captureContent:!1,maxAttributeSizeChars:0,dbSpanExporter:!1,logLevel:"info",httpInstrumentation:!1,serviceName:"copilot-chat",serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:{},headers:{}})}a(AHi,"createDisabledConfig");function e1t(t){if(t!==void 0)return t==="true"||t==="1"}a(e1t,"envBool");function oRc(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(oRc,"parseMaxAttributeSizeChars")});var r1t=I(t1t=>{"use strict";p();Object.defineProperty(t1t,"__esModule",{value:!0});t1t.IOTelService=void 0;var sRc=an();t1t.IOTelService=(0,sRc.createServiceIdentifier)("IOTelService")});var yHi=I(XLr=>{"use strict";p();Object.defineProperty(XLr,"__esModule",{value:!0});XLr.normalizeResponseModel=aRc;function aRc(t,e){if(!e)return;if(!t)return e;let r=a(s=>s.replace(/\./g,"-").toLowerCase(),"canonical"),n=r(t),o=r(e);return n===o||n.startsWith(o+"-")?t:e}a(aRc,"normalizeResponseModel")});var vHi=I(Hr=>{"use strict";p();Object.defineProperty(Hr,"__esModule",{value:!0});Hr.workspaceMetadataToOTelAttributes=Hr.resolveWorkspaceOTelMetadata=Hr.normalizeResponseModel=Hr.IOTelService=Hr.DEFAULT_OTLP_ENDPOINT=Hr.resolveOTelConfig=Hr.NoopOTelService=Hr.truncateForOTel=Hr.toToolDefinitions=Hr.toSystemInstructions=Hr.toOutputMessages=Hr.toInputMessages=Hr.stringifyToolsRawForTelemetry=Hr.stringifyToolDefinitionsForOTel=Hr.normalizeProviderMessages=Hr.extractTextFromContent=Hr.collectSystemTextsFromRequestBody=Hr.GenAiMetrics=Hr.emitUserFeedbackEvent=Hr.emitToolCallEvent=Hr.emitSessionStartEvent=Hr.emitInlineDoneEvent=Hr.emitInferenceDetailsEvent=Hr.emitEditSurvivalEvent=Hr.emitEditHunkActionEvent=Hr.emitEditFeedbackEvent=Hr.emitCloudSessionInvokeEvent=Hr.emitAgentTurnEvent=Hr.TOOL_PARAM_COMMAND_MAX_LEN=Hr.StdAttr=Hr.SHELL_TOOL_NAMES=Hr.GitHubCopilotAttr=Hr.GenAiToolType=Hr.GenAiTokenType=Hr.GenAiProviderName=Hr.GenAiOperationName=Hr.GenAiAttr=Hr.FILE_TOOL_NAMES=Hr.CopilotCliSdkAttr=Hr.CopilotChatAttr=void 0;var Ck=cFe();Object.defineProperty(Hr,"CopilotChatAttr",{enumerable:!0,get:a(function(){return Ck.CopilotChatAttr},"get")});Object.defineProperty(Hr,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return Ck.CopilotCliSdkAttr},"get")});Object.defineProperty(Hr,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return Ck.FILE_TOOL_NAMES},"get")});Object.defineProperty(Hr,"GenAiAttr",{enumerable:!0,get:a(function(){return Ck.GenAiAttr},"get")});Object.defineProperty(Hr,"GenAiOperationName",{enumerable:!0,get:a(function(){return Ck.GenAiOperationName},"get")});Object.defineProperty(Hr,"GenAiProviderName",{enumerable:!0,get:a(function(){return Ck.GenAiProviderName},"get")});Object.defineProperty(Hr,"GenAiTokenType",{enumerable:!0,get:a(function(){return Ck.GenAiTokenType},"get")});Object.defineProperty(Hr,"GenAiToolType",{enumerable:!0,get:a(function(){return Ck.GenAiToolType},"get")});Object.defineProperty(Hr,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return Ck.GitHubCopilotAttr},"get")});Object.defineProperty(Hr,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return Ck.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Hr,"StdAttr",{enumerable:!0,get:a(function(){return Ck.StdAttr},"get")});Object.defineProperty(Hr,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return Ck.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var aB=fHi();Object.defineProperty(Hr,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return aB.emitAgentTurnEvent},"get")});Object.defineProperty(Hr,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return aB.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Hr,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return aB.emitEditFeedbackEvent},"get")});Object.defineProperty(Hr,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return aB.emitEditHunkActionEvent},"get")});Object.defineProperty(Hr,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return aB.emitEditSurvivalEvent},"get")});Object.defineProperty(Hr,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return aB.emitInferenceDetailsEvent},"get")});Object.defineProperty(Hr,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return aB.emitInlineDoneEvent},"get")});Object.defineProperty(Hr,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return aB.emitSessionStartEvent},"get")});Object.defineProperty(Hr,"emitToolCallEvent",{enumerable:!0,get:a(function(){return aB.emitToolCallEvent},"get")});Object.defineProperty(Hr,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return aB.emitUserFeedbackEvent},"get")});var cRc=pHi();Object.defineProperty(Hr,"GenAiMetrics",{enumerable:!0,get:a(function(){return cRc.GenAiMetrics},"get")});var cB=WLr();Object.defineProperty(Hr,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return cB.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Hr,"extractTextFromContent",{enumerable:!0,get:a(function(){return cB.extractTextFromContent},"get")});Object.defineProperty(Hr,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return cB.normalizeProviderMessages},"get")});Object.defineProperty(Hr,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return cB.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Hr,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return cB.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Hr,"toInputMessages",{enumerable:!0,get:a(function(){return cB.toInputMessages},"get")});Object.defineProperty(Hr,"toOutputMessages",{enumerable:!0,get:a(function(){return cB.toOutputMessages},"get")});Object.defineProperty(Hr,"toSystemInstructions",{enumerable:!0,get:a(function(){return cB.toSystemInstructions},"get")});Object.defineProperty(Hr,"toToolDefinitions",{enumerable:!0,get:a(function(){return cB.toToolDefinitions},"get")});Object.defineProperty(Hr,"truncateForOTel",{enumerable:!0,get:a(function(){return cB.truncateForOTel},"get")});var lRc=JLr();Object.defineProperty(Hr,"NoopOTelService",{enumerable:!0,get:a(function(){return lRc.NoopOTelService},"get")});var _Hi=ZLr();Object.defineProperty(Hr,"resolveOTelConfig",{enumerable:!0,get:a(function(){return _Hi.resolveOTelConfig},"get")});Object.defineProperty(Hr,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return _Hi.DEFAULT_OTLP_ENDPOINT},"get")});var uRc=r1t();Object.defineProperty(Hr,"IOTelService",{enumerable:!0,get:a(function(){return uRc.IOTelService},"get")});var dRc=yHi();Object.defineProperty(Hr,"normalizeResponseModel",{enumerable:!0,get:a(function(){return dRc.normalizeResponseModel},"get")});var EHi=zLr();Object.defineProperty(Hr,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return EHi.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Hr,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return EHi.workspaceMetadataToOTelAttributes},"get")})});var rBr=I(zV=>{"use strict";p();Object.defineProperty(zV,"__esModule",{value:!0});zV.AbstractRequestLogger=void 0;zV.getCurrentCapturingToken=mRc;zV.storeCapturingTokenForCorrelation=gRc;zV.retrieveCapturingTokenByCorrelation=ARc;zV.runWithCapturingToken=yRc;var fRc=require("async_hooks"),pRc=O_e(),hRc=Po(),lFe=new fRc.AsyncLocalStorage,eBr=new Map;function mRc(){return lFe.getStore()}a(mRc,"getCurrentCapturingToken");function gRc(t){let e=lFe.getStore();e&&eBr.set(t,e)}a(gRc,"storeCapturingTokenForCorrelation");function ARc(t){let e=eBr.get(t);return e&&eBr.delete(t),e}a(ARc,"retrieveCapturingTokenByCorrelation");function yRc(t,e){return lFe.run(t,e)}a(yRc,"runWithCapturingToken");var tBr=class extends hRc.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return lFe.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new pRc.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return lFe.getStore()}};zV.AbstractRequestLogger=tBr});var CHi=I(nBr=>{"use strict";p();Object.defineProperty(nBr,"__esModule",{value:!0});nBr.isEncryptedThinkingDelta=_Rc;function _Rc(t){return t.encrypted!==void 0}a(_Rc,"isEncryptedThinkingDelta")});var SHi=I(n1t=>{"use strict";p();Object.defineProperty(n1t,"__esModule",{value:!0});n1t.calculateLineRepetitionStats=vRc;n1t.isRepetitive=CRc;var ERc=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60},{max_token_sequence_length:60,last_tokens_to_consider:120}];function vRc(t){if(t.length===0)return{numberOfRepetitions:0,mostRepeatedLine:"",totalLines:0};let e=new Map,r=t.split(` -`);for(let s of r){if(s=s.trim(),s.length===0)continue;let c=e.get(s)||0;e.set(s,c+1)}let n="",o=0;for(let[s,c]of e.entries())c>o&&(o=c,n=s);return{numberOfRepetitions:o,mostRepeatedLine:n,totalLines:r.length}}a(vRc,"calculateLineRepetitionStats");function CRc(t){let e=t.slice();return e.reverse(),bHi(e)||bHi(e.filter(r=>r.trim().length>0))}a(CRc,"isRepetitive");function bHi(t){let e=bRc(t);for(let r of ERc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(bRc,"kmp_prefix_function")});var iBr=I(lB=>{"use strict";p();var SRc=lB&&lB.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},YV=lB&&lB.__param||function(t,e){return function(r,n){e(r,n,t)}},bk;Object.defineProperty(lB,"__esModule",{value:!0});lB.OpenAIEndpoint=void 0;lB.isBYOKModel=LRc;var TRc=LU(),THi=gk(),IHi=Hl(),IRc=VV(),xRc=Bie(),wRc=Np(),RRc=PU(),kRc=GSt(),PRc=UU(),DRc=Rh(),NRc=$V(),MRc=Ks();function ORc(t){return t.type===THi.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===THi.ChatFetchResponseType.RateLimited?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:t.capiError?`Rate limit exceeded +`}),this.lastTextDeltaOutputIndex=s.output_index;let c=new PTc.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...Fqi(c,l),top_logprobs:l.top_logprobs?.map(u=>Fqi(c,u))||[]}))}})}case"response.output_item.added":if(e.item.type==="function_call")this.toolCallInfo.set(e.output_index,{name:e.item.name,callId:e.item.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:e.item.name,id:e.item.call_id}]});else if(e.item.type.toString()==="tool_search_call"){let s=e.item;s.execution==="client"&&s.call_id&&(this.toolCallInfo.set(e.output_index,{name:FU.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:FU.CUSTOM_TOOL_SEARCH_NAME,id:s.call_id}]}))}return;case"response.function_call_arguments.delta":{let s=this.toolCallInfo.get(e.output_index);s&&(s.arguments+=e.delta,n({text:"",copilotToolCallStreamUpdates:[{id:s.callId,name:s.name,arguments:s.arguments}]}));return}case"response.output_item.done":if(e.item.type==="function_call")this.toolCallInfo.delete(e.output_index),n({text:"",copilotToolCalls:[{id:e.item.call_id,name:e.item.name,arguments:e.item.arguments}],phase:e.item.phase});else if(e.item.type.toString()==="tool_search_call"){let s=e.item;s.execution==="client"&&s.call_id&&(this.toolCallInfo.delete(e.output_index),n({text:"",copilotToolCalls:[{id:s.call_id,name:FU.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(s.arguments??{})}]}))}else e.item.type==="reasoning"?n({text:"",thinking:e.item.encrypted_content?{id:e.item.id,text:this.hasReceivedReasoningSummary?void 0:e.item.summary.map(s=>s.text),encrypted:e.item.encrypted_content}:void 0}):e.item.type==="message"&&n({text:"",phase:e.item.phase});return;case"response.reasoning_summary_text.delta":return this.hasReceivedReasoningSummary=!0,n({text:"",thinking:{id:e.item_id,text:e.delta}});case"response.reasoning_summary_part.done":return this.hasReceivedReasoningSummary=!0,n({text:"",thinking:{id:e.item_id}});case"response.completed":{let s=e,c=lIc(s.response.output,this.latestCompactionOutputIndex),l=qqi(c,this.latestCompactionOutputIndex),u=l?.item,d=this.latestCompactionItem;u&&(this.sawCompactionMessage=!0,this.latestCompactionOutputIndex=l.outputIndex);let f=u&&(!d||d.id!==u.id||d.encrypted_content!==u.encrypted_content);if(u&&(this.latestCompactionItem=u),this.compactionThreshold!==void 0&&this.sawCompactionMessage){let h=e.response.usage?.input_tokens??0,m=e.response.usage?.total_tokens??0;(0,lLr.sendResponsesApiCompactionTelemetry)(this.telemetryService,{outcome:"compaction_returned",headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,model:e.response.model},{compactThreshold:this.compactionThreshold,promptTokens:h,totalTokens:m}),this.logService.debug(`[responsesAPI_compaction] Compaction enabled. headerRequestId=${this.requestId}`)}else if(this.compactionThreshold!==void 0&&(e.response.usage?.input_tokens??0)>=this.compactionThreshold){let h=e.response.usage?.input_tokens??0,m=e.response.usage?.total_tokens??0;(0,lLr.sendResponsesApiCompactionTelemetry)(this.telemetryService,{outcome:"threshold_met_no_compaction",headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,model:e.response.model},{compactThreshold:this.compactionThreshold,promptTokens:h,totalTokens:m}),this.logService.debug(`[responsesAPI_compaction] Compaction enabled but context not compacted after threshold was met. headerRequestId=${this.requestId}, gitHubRequestId=${this.ghRequestId}, promptTokens=${h}, totalTokens=${m}`)}return n({text:"",statefulMarker:e.response.id,contextManagement:f?u:void 0}),{blockFinished:!0,choiceIndex:0,model:e.response.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.response.id,created:e.response.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:{prompt_tokens:e.response.usage?.input_tokens??0,completion_tokens:e.response.usage?.output_tokens??0,total_tokens:e.response.usage?.total_tokens??0,prompt_tokens_details:{cached_tokens:e.response.usage?.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.response.usage?.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0},copilot_usage:s.copilot_usage?.total_nano_aiu!==void 0?s.copilot_usage:void 0},finishReason:df.FinishedCompletionReason.Stop,message:{role:to.Raw.ChatRole.Assistant,content:c.map(h=>{if(h.type==="message")return{type:to.Raw.ChatCompletionContentPartKind.Text,text:h.content.map(m=>m.type==="output_text"?m.text:m.refusal).join("")};if(h.type==="image_generation_call"&&h.result)return{type:to.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:h.result}}}).filter(iB.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=df.FinishedCompletionReason.Length:c==="content_filter"?(l=df.FinishedCompletionReason.ContentFilter,u=dIc(s.content_filters)):l=df.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:cLr(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,df.FinishedCompletionReason.ServerError,{error:cLr(s.error)})}}}buildTerminalCompletion(e,r,n={}){let o=e.output??[];return{blockFinished:!0,choiceIndex:0,model:e.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.id,created:e.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:e.usage?{prompt_tokens:e.usage.input_tokens??0,completion_tokens:e.usage.output_tokens??0,total_tokens:e.usage.total_tokens??0,prompt_tokens_details:{cached_tokens:e.usage.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.usage.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}}:void 0,finishReason:r,filterReason:n.filterReason,error:n.error,message:{role:to.Raw.ChatRole.Assistant,content:o.map(s=>{if(s.type==="message")return{type:to.Raw.ChatCompletionContentPartKind.Text,text:s.content.map(c=>c.type==="output_text"?c.text:c.refusal).join("")};if(s.type==="image_generation_call"&&s.result)return{type:to.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:s.result}}}).filter(iB.isDefined)}}}};oC.OpenAIResponsesProcessor=PSt;oC.OpenAIResponsesProcessor=PSt=xTc([wTc(6,MTc.ILogService)],PSt);function Fqi(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,kTc.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(Fqi,"mapLogProp")});var Hqi=I(NSt=>{"use strict";p();Object.defineProperty(NSt,"__esModule",{value:!0});NSt.ChatWebSocketTelemetrySender=void 0;var hLr=class{static{a(this,"ChatWebSocketTelemetrySender")}static sendConnectedTelemetry(e,r){e.sendTelemetryEvent("websocket.connected",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId},{connectDurationMs:r.connectDurationMs})}static sendConnectErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.connectError",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId,error:r.error,responseStatusText:r.responseStatusText,networkError:r.networkError},{connectDurationMs:r.connectDurationMs,responseStatusCode:r.responseStatusCode})}static sendCloseTelemetry(e,r){e.sendTelemetryEvent("websocket.close",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,closeReason:r.closeReason,closeEventReason:r.closeEventReason,closeEventWasClean:r.closeEventWasClean},{hadActiveRequest:r.hadActiveRequest?1:0,closeCode:r.closeCode,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.error",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,error:r.error},{hadActiveRequest:r.hadActiveRequest?1:0,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendCloseDuringSetupTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.closeDuringSetup",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId,closeReason:r.closeReason,closeEventReason:r.closeEventReason,closeEventWasClean:r.closeEventWasClean},{closeCode:r.closeCode,connectDurationMs:r.connectDurationMs})}static sendRequestSentTelemetry(e,r){e.sendTelemetryEvent("websocket.requestSent",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId},{hadActiveRequest:r.hadActiveRequest?1:0,statefulMarkerMatched:r.statefulMarkerMatched?1:0,previousResponseIdUnset:r.previousResponseIdUnset?1:0,hasCompactionData:r.hasCompactionData?1:0,summarizedAtRoundIdSet:r.summarizedAtRoundIdSet?1:0,summarizedAtRoundIdMatched:r.summarizedAtRoundIdMatched?1:0,modeChanged:r.modeChanged===void 0?-1:r.modeChanged?1:0,compactionThreshold:r.compactionThreshold,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,sentMessageCharacters:r.sentMessageCharacters,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendMessageParseErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.messageParseError",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,error:r.error},{hadActiveRequest:r.hadActiveRequest?1:0,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,receivedMessageCharacters:r.receivedMessageCharacters,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendRequestOutcomeTelemetry(e,r){e.sendTelemetryEvent("websocket.requestOutcome",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,requestOutcome:r.requestOutcome,closeReason:r.closeReason,serverErrorMessage:r.serverErrorMessage,serverErrorCode:r.serverErrorCode},{hadActiveRequest:r.hadActiveRequest?1:0,statefulMarkerMatched:r.statefulMarkerMatched?1:0,previousResponseIdUnset:r.previousResponseIdUnset?1:0,hasCompactionData:r.hasCompactionData?1:0,summarizedAtRoundIdSet:r.summarizedAtRoundIdSet?1:0,summarizedAtRoundIdMatched:r.summarizedAtRoundIdMatched?1:0,modeChanged:r.modeChanged===void 0?-1:r.modeChanged?1:0,compactionThreshold:r.compactionThreshold,promptTokenCount:r.promptTokenCount,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,requestSentMessageCount:r.requestSentMessageCount,requestReceivedMessageCount:r.requestReceivedMessageCount,requestSentCharacters:r.requestSentCharacters,requestReceivedCharacters:r.requestReceivedCharacters,connectionDurationMs:r.connectionDurationMs,requestDurationMs:r.requestDurationMs,closeCode:r.closeCode})}};NSt.ChatWebSocketTelemetrySender=hLr});var UU=I(jS=>{"use strict";p();var fIc=jS&&jS.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},MSt=jS&&jS.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jS,"__esModule",{value:!0});jS.ChatWebSocketManager=jS.NullChatWebSocketManager=jS.IChatWebSocketManager=void 0;jS.isCAPIWebSocketError=_Lr;var pIc=an(),hIc=Os(),OSt=Fc(),Gqi=Po(),$qi=Hl(),mIc=lE(),tEe=Np(),gIc=bh(),AIc=Oy(),yIc=DSt(),GV=Hqi();jS.IChatWebSocketManager=(0,pIc.createServiceIdentifier)("IChatWebSocketManager");var mLr=class{static{a(this,"NullChatWebSocketManager")}getOrCreateConnection(e,r,n){throw new Error("WebSocket not available")}hasActiveConnection(e){return!1}getStatefulMarker(e){}getSummarizedAtRoundId(e){}closeConnection(e){}closeAll(){}};jS.NullChatWebSocketManager=mLr;function _Lr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(_Lr,"isCAPIWebSocketError");var _Ic={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function EIc(t){return _Ic[t.type]}a(EIc,"getStreamTerminatingOutcome");var gLr=class extends Gqi.Disposable{static{a(this,"ChatWebSocketManager")}constructor(e,r,n,o){super(),this._logService=e,this._capiClientService=r,this._telemetryService=n,this._configurationService=o,this._connections=new Map}getOrCreateConnection(e,r,n){let o=this._connections.get(e);if(o?.isOpen)return o;o&&(this._logService.debug(`[ChatWebSocketManager] Replacing closed connection for conversation ${e}`),o.dispose(),this._connections.delete(e));let s=new ALr(this._capiClientService,this._logService,this._telemetryService,this._configurationService,e,r,n);return this._logService.debug(`[ChatWebSocketManager] Creating new connection for conversation ${e}`),this._connections.set(e,s),s.onDidDispose(()=>{this._connections.get(e)===s&&this._connections.delete(e)}),s}hasActiveConnection(e){return!!this._connections.get(e)?.isOpen}getStatefulMarker(e){let r=this._connections.get(e);return r?.isOpen?r.statefulMarker:void 0}getSummarizedAtRoundId(e){let r=this._connections.get(e);return r?.isOpen?r.summarizedAtRoundId:void 0}closeConnection(e){let r=this._connections.get(e);r&&(r.hasActiveRequest?this._logService.warn(`[ChatWebSocketManager] Closing connection for conversation ${e} while turn ${r.turnId} still has an active request`):this._logService.debug(`[ChatWebSocketManager] Closing connection for conversation ${e}`),r.dispose(),this._connections.delete(e))}closeAll(){for(let e of this._connections.values())e.dispose();this._connections.clear()}dispose(){this.closeAll(),super.dispose()}};jS.ChatWebSocketManager=gLr;jS.ChatWebSocketManager=gLr=fIc([MSt(0,tEe.ILogService),MSt(1,mIc.ICAPIClientService),MSt(2,gIc.ITelemetryService),MSt(3,$qi.IConfigurationService)],gLr);function LSt(t){switch(t){case 1e3:return"Normal Closure";case 1001:return"Going Away";case 1002:return"Protocol Error";case 1003:return"Unsupported Data";case 1005:return"No Status Received";case 1006:return"Abnormal Closure";case 1007:return"Invalid Payload";case 1008:return"Policy Violation";case 1009:return"Message Too Big";case 1010:return"Missing Extension";case 1011:return"Internal Error";case 1012:return"Service Restart";case 1013:return"Try Again Later";case 1014:return"Bad Gateway";case 1015:return"TLS Handshake Failed";default:return"Unknown"}}a(LSt,"wsCloseCodeToString");var ALr=class extends Gqi.Disposable{static{a(this,"ChatWebSocketConnection")}constructor(e,r,n,o,s,c,l){super(),this._capiClientService=e,this._logService=r,this._telemetryService=n,this._configurationService=o,this._conversationId=s,this._headers=c,this._initiatingRequestId=l,this._state=2,this._onDidDispose=this._register(new OSt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new AIc.HeadersImpl({}),this._hadActiveRequest=!1}get isOpen(){return this._state===1&&!!this._ws}get hasActiveRequest(){return!!this._activeRequest}get turnId(){return this._turnId}get statefulMarker(){return this._statefulMarker}get summarizedAtRoundId(){return this._summarizedAtRoundId}get responseHeaders(){return this._responseHeaders}get responseStatusCode(){return this._responseStatusCode}get responseStatusText(){return this._responseStatusText}get gitHubRequestId(){return this._responseHeaders.get("x-github-request-id")||""}async connect(){if(this._state===1)return;this._state=0,this._connectStartTime=Date.now(),this._logService.debug(`[ChatWebSocketManager] Connecting WebSocket for conversation ${this._conversationId}`);let e=await this._capiClientService.createResponsesWebSocket({headers:this._headers});return new Promise((r,n)=>{let o=e.webSocket,s=a(()=>{u(),this._state=1,this._connectedTime=Date.now(),this._ws=o,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText,this._setupMessageHandlers(o);let d=this._connectedTime-(this._connectStartTime??this._connectedTime);this._logService.debug(`[ChatWebSocketManager] Connected for conversation ${this._conversationId}`),GV.ChatWebSocketTelemetrySender.sendConnectedTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,connectDurationMs:d}),r()},"onOpen"),c=a(d=>{u(),this._state=2,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText;let f=d.error?`${d.message}: ${(0,tEe.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,tEe.collectSingleLineErrorMessage)(h):void 0,g=Date.now()-(this._connectStartTime??Date.now());this._logService.error(`[ChatWebSocketManager] Connection error for conversation ${this._conversationId}: ${f}${m?` (cause: ${m})`:""}`),GV.ChatWebSocketTelemetrySender.sendConnectErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,error:f,connectDurationMs:g,responseStatusCode:this._responseStatusCode,responseStatusText:this._responseStatusText,networkError:m}),n(new Error(f))},"onError"),l=a(d=>{u(),this._state=2,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText;let f=Date.now()-(this._connectStartTime??Date.now()),h=LSt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),GV.ChatWebSocketTelemetrySender.sendCloseDuringSetupTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,closeCode:d.code,closeReason:h,closeEventReason:d.reason,closeEventWasClean:String(d.wasClean),connectDurationMs:f}),n(new Error("WebSocket closed during connection setup"))},"onClose"),u=a(()=>{o.removeEventListener("open",s),o.removeEventListener("error",c),o.removeEventListener("close",l)},"cleanup");o.addEventListener("open",s),o.addEventListener("error",c),o.addEventListener("close",l)})}_setupMessageHandlers(e){e.addEventListener("message",r=>{if(typeof r.data!="string")return;let n=r.data.length;this._totalReceivedMessageCount+=1,this._totalReceivedCharacters+=n;let o=Date.now()-(this._connectedTime??Date.now()),s;try{s=JSON.parse(r.data)}catch(c){let l=(0,tEe.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),GV.ChatWebSocketTelemetrySender.sendMessageParseErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,error:l,connectionDurationMs:o,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,receivedMessageCharacters:n,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters});return}!_Lr(s)&&s.type==="response.completed"&&(this._statefulMarker=s.response.id,this._summarizedAtRoundId=this._activeRequest?.summarizedAtRoundId),this._activeRequest?.handleEvent(s)}),e.addEventListener("close",r=>{this._state=2;let n=Date.now()-(this._connectedTime??Date.now()),o=LSt(r.code);this._logService.debug(`[ChatWebSocketManager] Connection closed for conversation ${this._conversationId} turn ${this._turnId} (code: ${r.code} ${o}, reason: ${r.reason||""}, wasClean: ${r.wasClean})`),GV.ChatWebSocketTelemetrySender.sendCloseTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,closeCode:r.code,closeReason:o,closeEventReason:r.reason,closeEventWasClean:String(r.wasClean),connectionDurationMs:n,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters});let s=this._pendingErrorMessage;this._pendingErrorMessage=void 0,this._activeRequest?.handleConnectionClose(r.code,r.reason,s),this._activeRequest=void 0}),e.addEventListener("error",r=>{let n=r.error?`${r.message}: ${(0,tEe.collectSingleLineErrorMessage)(r.error)}`:r.message||"WebSocket error",o=Date.now()-(this._connectedTime??Date.now());this._logService.error(`[ChatWebSocketManager] Error for conversation ${this._conversationId} turn ${this._turnId}: ${n}`),GV.ChatWebSocketTelemetrySender.sendErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,error:n,connectionDurationMs:o,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._pendingErrorMessage??=n})}sendRequest(e,r,n){if(!this._ws||this._state!==1)throw new Error("WebSocket is not connected");let o=this._statefulMarker===e.previous_response_id,s=e.previous_response_id===void 0,c=e.input?.some(L=>L?.type==="compaction")??!1,l=r.summarizedAtRoundId!==void 0,u=r.summarizedAtRoundId===this._summarizedAtRoundId,d=(0,yIc.getResponsesApiCompactionThresholdFromBody)(e),f=this._statefulMarker?.slice(0,5).concat("...")??"",h=e.previous_response_id?.slice(0,5).concat("...")??"";o?this._logService.trace(`[ChatWebSocketManager] WebSocket stateful marker matches previous_response_id (${h}), summarizedAtRoundIdMatched: ${u}`):this._logService.debug(`[ChatWebSocketManager] WebSocket stateful marker (${f}) does not match previous_response_id (${h}), summarizedAtRoundIdMatched: ${u}`);let m=!!this._activeRequest;m?(this._logService.warn(`[ChatWebSocketManager] New request for conversation ${this._conversationId} turn ${r.turnId} while turn ${this._turnId} still has an active request`),this._activeRequest.handleSuperseded()):this._logService.debug(`[ChatWebSocketManager] New request for conversation ${this._conversationId} turn ${r.turnId} (previous turn: ${this._turnId})`);let g=this._turnId,A=r.turnId;this._previousTurnId=g,this._turnId=A,this._hadActiveRequest=m;let y=r.requestId,_=Date.now(),E=this._totalSentMessageCount,v=this._totalReceivedMessageCount,S=this._totalSentCharacters,T=this._totalReceivedCharacters,w=r.countTokens(),R=-1;w.then(L=>{R=L},()=>{R=-2});let x=new yLr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:L,closeCode:U,closeReason:j,serverErrorMessage:Q,serverErrorCode:Y})=>{this._activeRequest===x&&(this._activeRequest=void 0);let W=Date.now()-(this._connectedTime??Date.now()),V=Date.now()-_,z=this._totalSentMessageCount-E,ie=this._totalReceivedMessageCount-v,H=this._totalSentCharacters-S,re=this._totalReceivedCharacters-T;GV.ChatWebSocketTelemetrySender.sendRequestOutcomeTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,requestOutcome:L,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,promptTokenCount:R,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:W,requestDurationMs:V,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters,requestSentMessageCount:z,requestReceivedMessageCount:ie,requestSentCharacters:H,requestReceivedCharacters:re,closeCode:U,closeReason:j,serverErrorMessage:Q,serverErrorCode:Y})}),this._activeRequest=x;let k=n.onCancellationRequested(()=>{this._activeRequest===x&&(x.handleCancellation(),this._activeRequest=void 0)});x.done.finally(()=>k.dispose()).catch(()=>{});let{stream:D,...N}=e,O={type:"response.create",...N,initiator:r.userInitiated?"user":"agent"},B=JSON.stringify(O),q=B.length;this._totalSentMessageCount+=1,this._totalSentCharacters+=q;let M=Date.now()-(this._connectedTime??Date.now());return this._logService.debug(`[ChatWebSocketManager] Sending request for conversation ${this._conversationId} turn ${this._turnId} (totalSentMessageCount: ${this._totalSentMessageCount}, sentMessageCharacters: ${q})`),GV.ChatWebSocketTelemetrySender.sendRequestSentTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:M,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,sentMessageCharacters:q,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._ws.send(B),x}dispose(){this._activeRequest?.handleConnectionDisposed(),this._activeRequest=void 0,this._ws&&(this._ws.close(),this._ws=void 0),this._state=2,this._onDidDispose.fire(),super.dispose()}},yLr=class{static{a(this,"ChatWebSocketActiveRequest")}constructor(e,r,n,o,s){this.requestId=e,this.modelId=r,this.summarizedAtRoundId=n,this._configurationService=o,this._logService=s,this._onEvent=new OSt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new OSt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new OSt.Emitter,this.onError=this._onError.event,this._firstEventSettled=!1,this._settled=!1,this.done=new Promise((c,l)=>{this._resolve=c,this._reject=l}),this.firstEvent=new Promise((c,l)=>{this._resolveFirstEvent=c,this._rejectFirstEvent=l})}onDidSettle(e){this._onDidSettle=e}handleEvent(e){if(this._settled)return;let r=this._configurationService.getConfig($qi.ConfigKey.TeamInternal.DebugSimulateWebSocketResponse);if(r)try{e=JSON.parse(r),this._logService.info(`[ChatWebSocketManager] Simulating WebSocket response event: ${r}`)}catch(o){this._logService.error(`[ChatWebSocketManager] Failed to parse simulated WebSocket response: ${(0,tEe.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),_Lr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=EIc(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${LSt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${LSt(e)}${r?`, reason: ${r}`:""})`);this._finalizeError("connection_closed",o,e,r)}handleSuperseded(){this._settled||this._finalizeError("superseded",new Error("Request superseded by new request"))}handleCancellation(){this._settled||this._finalizeError("canceled",new hIc.CancellationError)}handleConnectionDisposed(){this._settled||this._finalizeError("connection_disposed",new Error("Connection disposed"))}_finalizeSuccess(e){this._settled=!0,this._onDidSettle?.({outcome:e}),this._resolve(),this._dispose()}_finalizeCAPIError(e){let{code:r,message:n}=e.error;this._onCAPIError.fire(e),this._settled=!0,this._onDidSettle?.({outcome:"error_response",serverErrorMessage:n,serverErrorCode:r}),this._reject(new Error(`${n} (${r})`)),this._dispose()}_finalizeError(e,r,n,o,s,c){this._firstEventSettled||(this._firstEventSettled=!0,this._rejectFirstEvent(r)),this._onError.fire(r),this._settled=!0,this._onDidSettle?.({outcome:e,closeCode:n,closeReason:o,serverErrorMessage:s,serverErrorCode:c}),this._reject(r),this._dispose()}_dispose(){this._onEvent.dispose(),this._onCAPIError.dispose(),this._onError.dispose()}}});var vLr=I(oB=>{"use strict";p();Object.defineProperty(oB,"__esModule",{value:!0});oB.getImageDimensions=vIc;oB.getImageDimensionsFromBytes=CIc;oB.getPngDimensions=Vqi;oB.getGifDimensions=Wqi;oB.getJpegDimensions=zqi;oB.getWebPDimensions=Zqi;oB.getMimeType=tji;oB.extractImageAttributes=TIc;function vIc(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(tji(e)){case"image/png":return Vqi(e);case"image/gif":return Wqi(e);case"image/jpeg":case"image/jpg":return zqi(e);case"image/webp":return Zqi(e);default:throw new Error("Unsupported image format")}}a(vIc,"getImageDimensions");function CIc(t,e){switch(bIc(e)){case"image/png":return Yqi(t);case"image/gif":return Kqi(t);case"image/jpeg":case"image/jpg":return Jqi(t);case"image/webp":return Xqi(t);default:throw new Error("Unsupported image format")}}a(CIc,"getImageDimensionsFromBytes");function Vqi(t){return Yqi(BSt(t.slice(0,50)))}a(Vqi,"getPngDimensions");function Wqi(t){return Kqi(BSt(t.slice(0,50)))}a(Wqi,"getGifDimensions");function zqi(t){return Jqi(BSt(t))}a(zqi,"getJpegDimensions");function Yqi(t){if(!eji(t,0,[137,80,78,71]))throw new Error("Not a valid PNG image.");let e=new DataView(t.buffer,t.byteOffset+16,8);return{width:e.getUint32(0,!1),height:e.getUint32(4,!1)}}a(Yqi,"getPngDimensionsFromBytes");function Kqi(t){if(!ELr(t,0,"GIF8"))throw new Error("Not a valid GIF image.");let e=new DataView(t.buffer,t.byteOffset+6,4);return{width:e.getUint16(0,!0),height:e.getUint16(2,!0)}}a(Kqi,"getGifDimensionsFromBytes");function Jqi(t){if(!eji(t,0,[255,216]))throw new Error("Not a valid JPEG image.");let e=t.length,r=2;for(;r+3=65472&&n<=65474){let s=new DataView(t.buffer,t.byteOffset+r+5,4);return{height:s.getUint16(0,!1),width:s.getUint16(2,!1)}}r+=2+o}throw new Error("JPEG dimensions not found")}a(Jqi,"getJpegDimensionsFromBytes");function Zqi(t){return Xqi(BSt(t))}a(Zqi,"getWebPDimensions");function Xqi(t){if(!ELr(t,0,"RIFF")||!ELr(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=SIc(t,12,4);if(e==="VP8 "){let r=(t[26]|t[27]<<8)&16383,n=(t[28]|t[29]<<8)&16383;return{width:r,height:n}}else if(e==="VP8L"){let r=(t[21]|t[22]<<8)&16383,n=(t[23]|t[24]<<8)&16383;return{width:r,height:n}}else if(e==="VP8X"){let r=((t[24]|t[25]<<8|t[26]<<16)&16777215)+1,n=((t[27]|t[28]<<8|t[29]<<16)&16777215)+1;return{width:r,height:n}}else throw new Error("Unsupported WebP format.")}a(Xqi,"getWebPDimensionsFromBytes");function bIc(t){return t?.toLowerCase().split(";")[0].trim()}a(bIc,"normalizeMimeType");function BSt(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(BSt,"base64ToBytes");function eji(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(FSt,"__esModule",{value:!0});FSt.TokenizerType=void 0;var rji;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(rji||(FSt.TokenizerType=rji={}))});var bLr=I(Oie=>{"use strict";p();Object.defineProperty(Oie,"__esModule",{value:!0});Oie.WorkerWithRpcProxy=Oie.RcpResponseHandler=void 0;Oie.createRpcProxy=nji;var IIc=require("worker_threads"),USt=class{static{a(this,"RcpResponseHandler")}constructor(){this.nextId=1,this.handlers=new Map}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};Oie.RcpResponseHandler=USt;function nji(t){let e={get:a((r,n)=>(typeof n=="string"&&!r[n]&&(r[n]=(...o)=>t(n,o)),r[n]),"get")};return new Proxy(Object.create(null),e)}a(nji,"createRpcProxy");var CLr=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new USt,this.worker=new IIc.Worker(e,r),this.worker.on("message",async o=>{if("fn"in o)try{let s=await n?.[o.fn].apply(n,o.args);this.worker.postMessage({id:o.id,res:s})}catch(s){this.worker.postMessage({id:o.id,err:s})}else this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=nji((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}terminate(){this.worker.removeAllListeners(),this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};Oie.WorkerWithRpcProxy=CLr});var iji=I(_k=>{"use strict";p();Object.defineProperty(_k,"__esModule",{value:!0});_k.SlidingWindowAverage=_k.MovingAverage=_k.Counter=void 0;_k.clamp=wIc;_k.rot=RIc;_k.isPointWithinTriangle=kIc;_k.randomChance=PIc;var xIc=pd();function wIc(t,e,r){return Math.min(Math.max(t,e),r)}a(wIc,"clamp");function RIc(t,e){return(e+t%e)%e}a(RIc,"rot");var SLr=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};_k.Counter=SLr;var TLr=class{static{a(this,"MovingAverage")}constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}};_k.MovingAverage=TLr;var ILr=class{static{a(this,"SlidingWindowAverage")}constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){let r=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=r,this._sum+=e,this._n=0&&w>=0&&T+w<1}a(kIc,"isPointWithinTriangle");function PIc(t){return(0,xIc.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(qSt,"__esModule",{value:!0});qSt.TikTokenImpl=void 0;var xLr=$Rr(),QSt=iji(),DIc=E5(),NIc=YRr(),wLr=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new QSt.MovingAverage,textLength:new QSt.MovingAverage,callCount:0}}static get instance(){return this._instance||(this._instance=new t),this._instance}init(e,r,n){let o=this._values.length,s=n?NIc.parseTikTokenBinary:c=>c;return this._values.push((0,xLr.createTokenizer)(s(e),(0,xLr.getSpecialTokensByEncoder)(r),(0,xLr.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=DIc.StopWatch.create(!0),s=this._values[e].encode(r,n);return this._stats.callCount+=1,this._stats.encodeDuration.update(o.elapsed()),this._stats.textLength.update(r.length),s}destroy(e){this._values[e]=void 0}resetStats(){let e=this._stats,r={callCount:e.callCount,encodeDuration:e.encodeDuration.value,textLength:e.textLength.value};return this._stats.encodeDuration=new QSt.MovingAverage,this._stats.textLength=new QSt.MovingAverage,this._stats.callCount=0,r}};qSt.TikTokenImpl=wLr});var VV=I(Fp=>{"use strict";p();var cji=Fp&&Fp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},lji=Fp&&Fp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.TokenizerProvider=Fp.BaseTokensPerName=Fp.BaseTokensPerMessage=Fp.BaseTokensPerCompletion=Fp.ITokenizerProvider=void 0;Fp.calculateImageTokenCost=DLr;Fp.estimateDocumentTokenCost=dji;var $V=wo(),MIc=evt(),OIc=vLr(),LIc=an(),sji=Mie(),BIc=bLr(),FIc=pd(),aji=MF(),RLr=Po(),jSt=$A(),uji=bh(),kLr=oji();Fp.ITokenizerProvider=(0,LIc.createServiceIdentifier)("ITokenizerProvider");Fp.BaseTokensPerCompletion=3;Fp.BaseTokensPerMessage=3;Fp.BaseTokensPerName=1;var PLr=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new aji.Lazy(()=>new HSt(e,(0,jSt.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new aji.Lazy(()=>new HSt(e,(0,jSt.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case sji.TokenizerType.CL100K:return this._cl100kTokenizer.value;case sji.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};Fp.TokenizerProvider=PLr;Fp.TokenizerProvider=PLr=cji([lji(1,uji.ITelemetryService)],PLr);var HSt=class extends RLr.Disposable{static{a(this,"BPETokenizer")}constructor(e,r,n,o){super(),this._useWorker=e,this._tokenFilePath=r,this._encoderName=n,this._telemetryService=o,this._cache=new MIc.LRUCache(5e3),this.baseTokensPerMessage=Fp.BaseTokensPerMessage,this.baseTokensPerName=Fp.BaseTokensPerName,this.mode=$V.OutputMode.Raw}async countMessagesTokens(e){let r=Fp.BaseTokensPerMessage;for(let n of e)r+=await this.countMessageTokens(n);return r}async tokenize(e){return(await this.ensureTokenizer()).encode(e)}async tokenLength(e){if(typeof e=="string")return this._textTokenLength(e);switch(e.type){case $V.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case $V.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case $V.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return DLr(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case $V.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case $V.Raw.ChatCompletionContentPartKind.Document:return dji(e.documentData.data);default:(0,FIc.assertNever)(e,`unknown content part (${JSON.stringify(e)})`)}}async _textTokenLength(e){if(!e)return 0;let r=this._cache.get(e);return r||(r=(await this.tokenize(e)).length,this._cache.put(e,r)),r}async countMessageTokens(e){return this.baseTokensPerMessage+await this.countMessageObjectTokens((0,$V.toMode)($V.OutputMode.OpenAI,e))}async countToolTokens(e){let n=0;e.length&&(n+=16);let o=8;for(let s of e)n+=o,n+=await this.countObjectTokens({name:s.name,description:s.description,parameters:s.inputSchema});return Math.floor(n*1.1)}async countMessageObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))if(o){if(typeof o=="string")r+=await this.tokenLength(o);else if(o){let s=o;if(s.type==="text")r+=await this.tokenLength(s.text);else if(s.type==="image_url"&&s.image_url)if(s.image_url.url.startsWith("data:image/"))try{r+=DLr(s.image_url.url,s.image_url.detail)}catch{r+=await this.tokenLength(s.image_url.url)}else r+=await this.tokenLength(s.image_url.url);else{let c=await this.countMessageObjectTokens(o);n==="tool_calls"&&(c=Math.floor(c*1.5)),r+=c}}n==="name"&&o!==void 0&&(r+=this.baseTokensPerName)}return r}async countObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))o&&(r+=await this.tokenLength(n),typeof o=="string"?r+=await this.tokenLength(o):o&&(r+=await this.countMessageObjectTokens(o)));return r}ensureTokenizer(){return this._tokenizer??=this.doInitTokenizer(),this._tokenizer}async doInitTokenizer(){let e=(0,jSt.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,jSt.join)(__dirname,"tikTokenizerWorker.js"),n=new BIc.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,RLr.toDisposable)(()=>{n.terminate(),this._store.deleteAndLeak(s),this._tokenizer=void 0}),c;return{encode:a((l,u)=>{let d=n.proxy.encode(o,l,u);return clearTimeout(c),c=setTimeout(()=>s.dispose(),15e3),Math.random()<1/1e3&&n.proxy.resetStats().then(f=>{this._telemetryService.sendMSFTTelemetryEvent("tokenizer.stats",void 0,f)}),d},"encode")}}else{let r=kLr.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,RLr.toDisposable)(()=>{kLr.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>kLr.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};HSt=cji([lji(3,uji.ITelemetryService)],HSt);function DLr(t,e){let{width:r,height:n}=(0,OIc.getImageDimensions)(t);if(e==="low")return 85;if(r>2048||n>2048){let c=2048/Math.max(r,n);r=Math.round(r*c),n=Math.round(n*c)}let o=768/Math.min(r,n);return r=Math.round(r*o),n=Math.round(n*o),Math.ceil(r/512)*Math.ceil(n/512)*170+85}a(DLr,"calculateImageTokenCost");function dji(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(dji,"estimateDocumentTokenCost")});var WV=I(GSt=>{"use strict";p();Object.defineProperty(GSt,"__esModule",{value:!0});GSt.IDomainService=void 0;var UIc=an();GSt.IDomainService=(0,UIc.createServiceIdentifier)("IDomainService")});var $St=I(sC=>{"use strict";p();Object.defineProperty(sC,"__esModule",{value:!0});sC.HeaderContributors=sC.IHeaderContributors=sC.userAgentLibraryHeader=void 0;sC.stringifyUrlOrRequestMetadata=zIc;sC.isCAPIRequestMetadata=MLr;sC.isCAPIEndpoint=YIc;sC.createCapiRequestBody=KIc;sC.canRetryOnceNetworkError=pji;sC.postRequest=JIc;sC.getRequest=ZIc;var QIc=an(),qIc=Mie(),jIc=Os(),HIc=lE(),GIc=bh(),$Ic=Oy(),VIc=RU();sC.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var WIc=30*1e3;function zIc(t){return typeof t=="string"?t:JSON.stringify(t)}a(zIc,"stringifyUrlOrRequestMetadata");function MLr(t){return typeof t!="string"}a(MLr,"isCAPIRequestMetadata");function YIc(t){return MLr(t.urlOrRequestMetadata)}a(YIc,"isCAPIEndpoint");function KIc(t,e,r){let n={messages:(0,VIc.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a(KIc,"createCapiRequestBody");function fji(t,e){let r=t.get($Ic.IFetcherService),n=t.get(GIc.ITelemetryService),o=t.get(HIc.ICAPIClientService),{requestType:s,endpointOrUrl:c,secretKey:l,intent:u,requestId:d,body:f,additionalHeaders:h,cancelToken:m,useFetcher:g,canRetryOnce:A=!0,location:y}=e,_=typeof c=="string"||"type"in c?{modelMaxPromptTokens:0,urlOrRequestMetadata:c,family:"",tokenizer:qIc.TokenizerType.O200K,acquireTokenizer:a(()=>{throw new Error("Method not implemented.")},"acquireTokenizer"),name:"",version:""}:c,E=e.interactionTypeOverride??u,v={...l?{Authorization:`Bearer ${l}`}:{},"X-Request-Id":d,"OpenAI-Intent":u,"X-GitHub-Api-Version":"2026-01-09",...h,..._.getExtraHeaders?_.getExtraHeaders(y,e.interactionTypeOverride):{}};v["X-Interaction-Type"]=E,v["X-Agent-Task-Id"]=d,_.interceptBody&&_.interceptBody(f);let S=_.getEndpointFetchOptions?.(),T={callSite:`network-request-${u}`,method:s,headers:v,json:f,timeout:WIc,useFetcher:g,suppressIntegrationId:S?.suppressIntegrationId};if(m){let w=r.makeAbortController();m.onCancellationRequested(()=>{n.sendGHTelemetryEvent("networking.cancelRequest",{headerRequestId:d}),w.abort()}),T.signal=w.signal}return MLr(_.urlOrRequestMetadata)?o.makeRequest(T,_.urlOrRequestMetadata):r.fetch(_.urlOrRequestMetadata,T).catch(R=>{if(A&&pji(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(_.urlOrRequestMetadata,T));throw r.isAbortError(R)?new jIc.CancellationError:R})}a(fji,"networkRequest");function pji(t){return["ECONNRESET","ETIMEDOUT","ERR_CONNECTION_RESET","ERR_NETWORK_CHANGED","ERR_HTTP2_INVALID_SESSION","ERR_HTTP2_STREAM_CANCEL","ERR_HTTP2_GOAWAY_SESSION","ERR_HTTP2_PROTOCOL_ERROR","ERR_FAILED"].includes(t?.code)}a(pji,"canRetryOnceNetworkError");function JIc(t,e){return fji(t,{...e,requestType:"POST"})}a(JIc,"postRequest");function ZIc(t,e){return fji(t,{...e,requestType:"GET"})}a(ZIc,"getRequest");sC.IHeaderContributors=(0,QIc.createServiceIdentifier)("headerContributors");var NLr=class{static{a(this,"HeaderContributors")}constructor(){this.contributors=[]}add(e){this.contributors.push(e)}remove(e){let r=this.contributors.indexOf(e);r!==-1&&this.contributors.splice(r,1)}contributeHeaders(e){for(let r of this.contributors)r.contributeHeaderValues(e)}size(){return this.contributors.length}};sC.HeaderContributors=NLr});var Eji=I(hA=>{"use strict";p();var XIc=hA&&hA.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),exc=hA&&hA.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),txc=hA&&hA.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=1e6){let e=t/1e6,r=Math.floor(e*10)/10;return r%1===0?`${r.toFixed(0)}M`:`${r.toFixed(1)}M`}else{if(t>9e5)return"1M";if(t>=1e3)return`${Math.round(t/1e3)}K`}return t.toString()}a(axc,"formatTokenCount");function cxc(t){return $a.t("In: {0} \xB7 Out: {1} AICs/1M tokens",hji(t.default.inputPrice),hji(t.default.outputPrice))}a(cxc,"formatPricingLabel");var mji=1e6,OLr=1e9;function lxc(t){if(!t)return;let e=t.batch_size??mji,r=mji/e,n=t.default;if(n&&n.input_price!==void 0&&n.output_price!==void 0){let o={inputPrice:n.input_price*r,outputPrice:n.output_price*r,cachePrice:n.cache_price!==void 0?n.cache_price*r:void 0,cacheWritePrice:n.cache_write_price!==void 0?n.cache_write_price*r:void 0,contextMax:n.context_max},s,c=t.long_context;if(c&&c.input_price!==void 0&&c.output_price!==void 0){let l={inputPrice:c.input_price*r,outputPrice:c.output_price*r,cachePrice:c.cache_price!==void 0?c.cache_price*r:void 0,cacheWritePrice:c.cache_write_price!==void 0?c.cache_write_price*r:void 0,contextMax:c.context_max};(l.inputPrice!==o.inputPrice||l.outputPrice!==o.outputPrice||l.cachePrice!==o.cachePrice||l.cacheWritePrice!==o.cacheWritePrice)&&(s=l)}return{default:o,longContext:s}}if(!(t.input_price===void 0||t.output_price===void 0))return{default:{inputPrice:t.input_price/OLr*r,outputPrice:t.output_price/OLr*r,cachePrice:t.cache_price!==void 0?t.cache_price/OLr*r:void 0,cacheWritePrice:void 0}}}a(lxc,"normalizeTokenPrices")});var Oji=I(Fy=>{"use strict";p();var uxc=Fy&&Fy.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},vji=Fy&&Fy.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Fy,"__esModule",{value:!0});Fy.AnthropicMessagesProcessor=void 0;Fy.buildToolInputSchema=wji;Fy.createMessagesRequestBody=mxc;Fy.rawMessagesToMessagesAPI=Rji;Fy.clearAllCacheControl=kji;Fy.addToolsAndSystemCacheControl=Pji;Fy.addMessagesApiCacheControl=Dji;Fy.processResponseFromMessagesEndpoint=yxc;Fy.processNonStreamingResponseFromMessagesEndpoint=Mji;var UN=wo(),bji=pl(),dxc=N4r(),LLr=Lg(),fxc=gk(),Cji=Hl(),Sji=Np(),rEe=ESt(),Tji=PU(),rFe=RU(),pxc=q4r(),Iji=X3e(),hxc=Rh(),xji=bh();function wji(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(wji,"buildToolInputSchema");function mxc(t,e,r,n){let o=t.get(Cji.IConfigurationService),s=t.get(hxc.IExperimentationService),c=t.get(pxc.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===rEe.CUSTOM_TOOL_SEARCH_NAME),u=[],d=[];if(e.requestOptions?.tools)for(let N of e.requestOptions.tools){if(!N.function.name||N.function.name.length===0)continue;let O=e.modelCapabilities?.enableToolSearch&&l&&!c.isNonDeferredTool(N.function.name),B={name:N.function.name,description:N.function.description||"",input_schema:wji(N.function.parameters),...O?{defer_loading:!0}:{}};(O?d:u).push(B)}let f=[...u,...d],h=e.modelCapabilities?.reasoningEffort,m;if(e.modelCapabilities?.enableThinking){if(n.supportsAdaptiveThinking)m={type:"adaptive",display:"summarized"};else if(n.maxThinkingBudget&&n.minThinkingBudget){let O=e.postOptions.max_tokens??1024,B=n.minThinkingBudget??1024,q=16e30&&(!N||N.includes(q))&&(A=q)}}let y=e.modelCapabilities?.enableContextEditing&&(0,rEe.isAnthropicContextEditingEnabled)(n,o,s)?(0,rEe.getContextManagementFromConfig)(o,s,g):void 0,_=t.get(Sji.ILogService),E=t.get(xji.ITelemetryService),v=f.length>0?new Set(f.map(N=>N.name)):void 0,S=Rji(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,rEe.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,k=(0,rEe.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;kji(S),Dji(S,k),Pji(f,S,R);let D=S.messages.at(-1);return D&&D.role==="assistant"&&(_.warn(`[messagesAPI] Trailing assistant message detected \u2014 appending synthetic user message to prevent prefill error. Total messages: ${S.messages.length}`),E.sendMSFTTelemetryEvent("messagesApi.trailingAssistantGuard",{model:r,location:fxc.ChatLocation.toString(e.location)},{messageCount:S.messages.length}),S.messages.push({role:"user",content:[{type:"text",text:"Please continue."}]})),{model:r,...S,stream:e.requestOptions?.stream??!0,tools:f.length>0?f:void 0,max_tokens:e.postOptions.max_tokens,thinking:m,...A?{output_config:{effort:A}}:{},...y?{context_management:y}:{}}}a(mxc,"createMessagesRequestBody");function Rji(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case UN.Raw.ChatRole.System:{n.push(...VSt(c.content).filter(l=>l.type==="text"));break}case UN.Raw.ChatRole.User:{let l=VSt(c.content);l.length>0&&r.push({role:"user",content:l});break}case UN.Raw.ChatRole.Assistant:{let l=VSt(c.content);if(c.toolCalls)for(let u of c.toolCalls){let d={};try{d=JSON.parse(u.function.arguments)}catch{}l.push({type:"tool_use",id:u.id,name:u.function.name,input:d}),o.set(u.id,u.function.name)}l.length>0&&r.push({role:"assistant",content:l});break}case UN.Raw.ChatRole.Tool:{if(c.toolCallId){let l=VSt(c.content),u=!1;for(let g of l)nFe(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===rEe.CUSTOM_TOOL_SEARCH_NAME?gxc(l,e):void 0)??l.filter(g=>(g.type==="text"||g.type==="image"||g.type==="document")&&!(g.type==="text"&&g.text.trim()==="")),m={type:"tool_result",tool_use_id:c.toolCallId,content:h.length>0?h:void 0};u&&(m.cache_control={type:"ephemeral"}),r.push({role:"user",content:[m]})}break}}let s=[];for(let c of r){let l=s[s.length-1];if(l&&l.role===c.role){let u=Array.isArray(l.content)?l.content:[{type:"text",text:l.content}],d=Array.isArray(c.content)?c.content:[{type:"text",text:c.content}];l.content=[...u,...d]}else s.push(c)}return{messages:s,...n.length?{system:n}:{}}}a(Rji,"rawMessagesToMessagesAPI");function gxc(t,e){if(t.length!==1||t[0].type!=="text")return;let r;try{r=JSON.parse(t[0].text)}catch{return}if(Array.isArray(r))return r.filter(n=>typeof n=="string"&&(!e||e.has(n))).map(n=>({type:"tool_reference",tool_name:n}))}a(gxc,"tryParseToolReferences");function VSt(t){let e=[],r=!1;for(let n of t){switch(n.type){case UN.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case UN.Raw.ChatCompletionContentPartKind.Image:{let o=n.imageUrl.url,s=o.match(/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/);s?e.push({type:"image",source:{type:"base64",media_type:s[1],data:s[2]}}):o.startsWith("https://")&&e.push({type:"image",source:{type:"url",url:o}});break}case UN.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&nFe(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case UN.Raw.ChatCompletionContentPartKind.Document:{n.documentData.mediaType==="application/pdf"&&e.push({type:"document",source:{type:"base64",media_type:"application/pdf",data:n.documentData.data}});break}case UN.Raw.ChatCompletionContentPartKind.Opaque:{if(n.value&&typeof n.value=="object"&&"type"in n.value){let o=n.value;if(o.type==="thinking"&&o.thinking){let s=Array.isArray(o.thinking.text)?o.thinking.text.join(""):o.thinking.text;o.thinking.redacted&&o.thinking.encrypted?e.push({type:"redacted_thinking",data:o.thinking.encrypted}):o.thinking.encrypted&&e.push({type:"thinking",thinking:s||"",signature:o.thinking.encrypted})}}break}}if(r&&e.length>0){let o=e.at(-1);nFe(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a(VSt,"rawContentToAnthropicContent");function nFe(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(nFe,"contentBlockSupportsCacheControl");function kji(t){if(t.system)for(let e of t.system)delete e.cache_control;for(let e of t.messages)if(Array.isArray(e.content))for(let r of e.content)typeof r=="object"&&"cache_control"in r&&delete r.cache_control}a(kji,"clearAllCacheControl");function Pji(t,e,r){let n=r?{type:"ephemeral",ttl:r}:{type:"ephemeral"};for(let s=t.length-1;s>=0;s--)if(!t[s].defer_loading){t[s].cache_control=n;break}let o=e.system?.at(-1);o&&!o.cache_control&&(o.cache_control=n)}a(Pji,"addToolsAndSystemCacheControl");function Dji(t,e){let r=t.messages,n=0;for(let o=r.length-1;o>=0&&n<2;o--){let s=r[o];Array.isArray(s.content)&&s.content.some(c=>typeof c=="object"&&nFe(c))&&(Axc(s,e),n++)}}a(Dji,"addMessagesApiCacheControl");function Axc(t,e){if(Array.isArray(t.content))for(let r=t.content.length-1;r>=0;r--){let n=t.content[r];if(typeof n=="object"&&nFe(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(Axc,"markLastCacheableBlock");async function yxc(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new bji.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,LLr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,Tji.getRequestId)(n.headers),h=t.createInstance(WSt,s,u,d,f),m=new dxc.SSEParser(g=>{try{r.trace(`[messagesAPI]SSE: ${g.data}`);let A=g.data?.trim();if(!A||A==="[DONE]")return;let y=JSON.parse(A),_=y.type??g.type;if(!_)return;let E=h.push({...y,type:_},o);if(E){r.info(`[messagesAPI] message ${E.choiceIndex} returned. finish reason: [${E.finishReason}]`);let v=s.extendedBy({completionChoiceFinishReason:E.finishReason,headerRequestId:E.requestId.headerRequestId});e.sendGHTelemetryEvent("completion.finishReason",v.properties,v.measurements);let S=(0,rFe.rawMessageToCAPI)(E.message),T=s;E.usage&&(T=s.extendedBy({},{promptTokens:E.usage.prompt_tokens,completionTokens:E.usage.completion_tokens,totalTokens:E.usage.total_tokens,...E.usage.prompt_tokens_details&&{cachedTokens:E.usage.prompt_tokens_details.cached_tokens},...E.usage.completion_tokens_details&&{reasoningTokens:E.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:E.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:E.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,Iji.sendEngineMessagesTelemetry)(e,[S],T,!0,r),l.emitOne(E)}}catch(A){l.reject(A)}});for await(let g of n.body)m.feed(g)},async()=>{await n.body.destroy()}):Mji(e,r,n,o,s)}a(yxc,"processResponseFromMessagesEndpoint");function _xc(t){switch(t){case"refusal":return rFe.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return rFe.FinishedCompletionReason.Length;default:return rFe.FinishedCompletionReason.Stop}}a(_xc,"mapStopReason");function Nji(t,e){let r=t.inputTokens+t.cacheCreationTokens+t.cacheReadTokens;return r0?{toolCalls:t.toolCalls.map(n=>({id:n.id,type:"function",function:{name:n.name,arguments:n.arguments}}))}:{}}}}a(Nji,"buildAnthropicCompletion");async function Mji(t,e,r,n,o){return new bji.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,Tji.getRequestId)(r.headers),u=c||(0,LLr.generateUuid)(),d=r.headers.get("x-github-request-id")??"",f=await r.text(),h;try{h=JSON.parse(f)}catch(T){s.reject(new Error(`Failed to parse non-streaming Anthropic response: ${T instanceof Error?T.message:String(T)}`));return}if(h.type==="error"){s.reject(new Error(`Anthropic API error: ${h.error?.message??"Unknown error"}`));return}let m="",g=[];for(let T of h.content??[])switch(T.type){case"text":m+=T.text;break;case"tool_use":g.push({id:T.id,name:T.name,arguments:JSON.stringify(T.input)});break;case"thinking":case"redacted_thinking":break;default:{let w=T.type;e.warn(`[messagesAPI] non-streaming: unknown content_block type '${w}' for model ${h.model}`),t.sendMSFTTelemetryEvent("messagesApi.unknownContentBlock",{requestId:u,model:h.model,blockType:w});break}}let A={text:m,...g.length>0?{copilotToolCalls:g.map(T=>({id:T.id,name:T.name,arguments:T.arguments}))}:{}};await n(m,0,A),h.stop_reason==="refusal"&&(e.warn(`[messagesAPI] non-streaming: Refusal received for model ${h.model}`),t.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:u,model:h.model,category:"unknown"}));let y=h.usage,_=Nji({model:h.model,messageId:h.id,stopReason:h.stop_reason,textContent:m,toolCalls:g,inputTokens:y?.input_tokens??0,outputTokens:y?.output_tokens??0,cacheCreationTokens:y?.cache_creation_input_tokens??0,cacheCreation1hTokens:y?.cache_creation?.ephemeral_1h_input_tokens,cacheCreation5mTokens:y?.cache_creation?.ephemeral_5m_input_tokens,cacheReadTokens:y?.cache_read_input_tokens??0,thinkingTokens:y?.output_tokens_details?.thinking_tokens,requestId:u,ghRequestId:d,serverExperiments:l,telemetryData:o},e);e.info(`[messagesAPI] non-streaming message returned. finish reason: [${_.finishReason}]`);let E=o.extendedBy({completionChoiceFinishReason:_.finishReason,headerRequestId:_.requestId.headerRequestId});t.sendGHTelemetryEvent("completion.finishReason",E.properties,E.measurements);let v=(0,rFe.rawMessageToCAPI)(_.message),S=o;_.usage&&(S=o.extendedBy({},{promptTokens:_.usage.prompt_tokens,completionTokens:_.usage.completion_tokens,totalTokens:_.usage.total_tokens,..._.usage.prompt_tokens_details&&{cachedTokens:_.usage.prompt_tokens_details.cached_tokens},..._.usage.completion_tokens_details&&{reasoningTokens:_.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:_.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:_.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,Iji.sendEngineMessagesTelemetry)(t,[v],S,!0,e),s.emitOne(_)},async()=>{await r.body.destroy()})}a(Mji,"processNonStreamingResponseFromMessagesEndpoint");var WSt=class{static{a(this,"AnthropicMessagesProcessor")}constructor(e,r,n,o,s,c){this.telemetryData=e,this.requestId=r,this.ghRequestId=n,this.serverExperiments=o,this.logService=s,this.telemetryService=c,this.textAccumulator="",this.toolCallAccumulator=new Map,this.thinkingAccumulator=new Map,this.completedToolCalls=[],this.messageId="",this.model="",this.inputTokens=0,this.outputTokens=0,this.cacheCreationTokens=0,this.cacheReadTokens=0}extractIPCodeCitations(e){if(!e?.IPCodeCitations?.length)return[];let r=new Set,n=[];for(let o of e.IPCodeCitations){let s=o.citations;if(!s)continue;let{url:c,license:l,snippet:u}=s;typeof c!="string"||c.trim()===""||typeof l!="string"||l.trim()===""||typeof u!="string"||u.trim()===""||r.has(c)||(r.add(c),n.push({citations:{url:c,license:l,snippet:u}}))}return n.length>0&&this.logService.trace(`[messagesAPI] IP code citations found: ${n.length} unique citations`),n}push(e,r){let n=a(o=>{this.textAccumulator+=o.text,r(this.textAccumulator,0,o)},"onProgress");switch(e.type){case"message_start":e.message&&(this.messageId=e.message.id,this.model=e.message.model,this.inputTokens=e.message.usage.input_tokens??0,this.outputTokens=e.message.usage.output_tokens??0,this.cacheCreationTokens=e.message.usage.cache_creation_input_tokens??0,this.cacheCreation1hTokens=e.message.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.message.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.message.usage.cache_read_input_tokens??0,this.thinkingTokens=e.message.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens);return;case"content_block_start":if(e.content_block?.type==="tool_use"&&e.index!==void 0){let o=e.content_block.id||(0,LLr.generateUuid)();this.toolCallAccumulator.set(e.index,{id:o,name:e.content_block.name||"",arguments:""}),this.textAccumulator.length&&n({text:" "}),n({text:"",beginToolCalls:[{name:e.content_block.name||"",id:o}]})}else if(e.content_block?.type==="thinking"&&e.index!==void 0)this.thinkingAccumulator.set(e.index,{thinking:"",signature:""});else if(e.content_block?.type==="redacted_thinking"&&e.index!==void 0){let o=e.content_block.data;n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:o,redacted:!0}})}return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text){let o=this.extractIPCodeCitations(e.copilot_annotations);return o.length>0?n({text:e.delta.text,ipCitations:o}):n({text:e.delta.text})}else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);return o&&(o.thinking+=e.delta.thinking),n({text:"",thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json,n({text:"",copilotToolCallStreamUpdates:[{id:o.id,name:o.name,arguments:o.arguments}]}))}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),n({text:"",copilotToolCalls:[{id:o.id,name:o.name,arguments:o.arguments}]}),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&s.signature&&(n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":if(e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheCreation1hTokens=e.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens,this.thinkingTokens=e.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens),e.copilot_usage&&typeof e.copilot_usage.total_nano_aiu=="number"&&(this.copilotUsage=e.copilot_usage),e.context_management)return this.contextManagementResponse=e.context_management,n({text:"",contextManagement:e.context_management});e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.delta?.stop_details&&(this.stopDetails=e.delta.stop_details);return;case"message_stop":{if(this.contextManagementResponse){let o=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_input_tokens||0),0),s=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_tool_uses||0),0),c=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_thinking_turns||0),0);this.logService.trace(`[messagesAPI] Anthropic context editing applied: cleared ${o} tokens, ${s} tool uses.`),this.telemetryService.sendMSFTTelemetryEvent("contextEditingApplied",{requestId:this.requestId,interactionId:this.requestId,model:this.model},{clearedTokens:o,clearedToolUses:s,clearedThinkingTurns:c})}if(this.stopReason==="refusal"){let o=this.stopDetails?.category??"unknown";this.logService.warn(`[messagesAPI] Refusal received: category='${o}' for model ${this.model}`),this.telemetryService.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:this.requestId,model:this.model,category:o})}return Nji({model:this.model,messageId:this.messageId,stopReason:this.stopReason,textContent:this.textAccumulator,toolCalls:this.completedToolCalls,inputTokens:this.inputTokens,outputTokens:this.outputTokens,cacheCreationTokens:this.cacheCreationTokens,cacheCreation1hTokens:this.cacheCreation1hTokens,cacheCreation5mTokens:this.cacheCreation5mTokens,cacheReadTokens:this.cacheReadTokens,thinkingTokens:this.thinkingTokens,requestId:this.requestId,ghRequestId:this.ghRequestId,serverExperiments:this.serverExperiments,telemetryData:this.telemetryData,copilotUsage:this.copilotUsage},this.logService)}case"error":{let o=e.error?.message||"Unknown error";return n({text:"",copilotErrors:[{agent:"anthropic",code:"unknown",message:o,type:"error",identifier:void 0}]})}}}};Fy.AnthropicMessagesProcessor=WSt;Fy.AnthropicMessagesProcessor=WSt=uxc([vji(4,Sji.ILogService),vji(5,xji.ITelemetryService)],WSt)});var Lji=I(QU=>{"use strict";p();var Exc=QU&&QU.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vxc=QU&&QU.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Cxc=QU&&QU.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=0;l--)if(t[l].role===Lie.Raw.ChatRole.User){r=l;break}r===-1&&t.length>0&&(r=t.length-1);let n=0;for(let l=Math.max(r,0);le)throw new Error(bxc.t("Too many images in request: {0} images provided, but the model supports a maximum of {1} images.",n,e));let s=e-n,c=new Map;for(let l=r-1;l>=0;l--)if(Array.isArray(t[l].content)){for(let u=t[l].content.length-1;u>=0;u--)if(t[l].content[u].type===Lie.Raw.ChatCompletionContentPartKind.Image){let d=`${l}:${u}`;s>0?(c.set(d,!0),s--):c.set(d,!1)}}return t.map((l,u)=>u>=r||!Array.isArray(l.content)||!l.content.some(d=>d.type===Lie.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==Lie.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:Lie.Raw.ChatCompletionContentPartKind.Text,text:Sxc})})}a(Txc,"filterHistoryImages")});var Fie=I(HS=>{"use strict";p();var qji=HS&&HS.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Km=HS&&HS.__param||function(t,e){return function(r,n){e(r,n,t)}},ULr;Object.defineProperty(HS,"__esModule",{value:!0});HS.RemoteAgentChatEndpoint=HS.ChatEndpoint=void 0;HS.defaultChatResponseProcessor=qLr;HS.defaultNonStreamChatResponseProcessor=Kji;var BLr=(_ie(),Wa(yie)),Bji=wo(),Ixc=Mie(),jji=pl(),Fji=$et(),xxc=Lg(),Hji=Ks(),wxc=rE(),Gji=LU(),Rxc=gk(),kxc=$3e(),Bie=Hl(),$ji=Np(),Uji=ESt(),Pxc=PU(),Dxc=Oy(),Nxc=$St(),Mxc=X3e(),Vji=UU(),Oxc=xSt(),Wji=Rh(),Lxc=bh(),zji=VV(),Bxc=lE(),nEe=z3e(),Yji=WV(),iFe=zLe(),Fxc=Eji(),Qji=Oji(),FLr=DSt(),Uxc=Lji();async function qLr(t,e,r,n,o,s,c){let u=(await Oxc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return jji.AsyncIterableObject.map(u,f=>{let h=f.reason??"client-trimmed",m=s.extendedBy({completionChoiceFinishReason:h,headerRequestId:f.requestId.headerRequestId});return t.sendGHTelemetryEvent("completion.finishReason",m.properties,m.measurements),(0,Mxc.prepareChatCompletionForReturn)(t,e,f,s)})}a(qLr,"defaultChatResponseProcessor");async function Kji(t,e,r){let n=await t.text(),o=JSON.parse(n),s=[];for(let c=0;c<(o?.choices?.length||0);c++){let l=o.choices[c],u={role:l.message.role,content:l.message.content,name:l.message.name,toolCalls:l.message.toolCalls??l.message.tool_calls},d=(0,kxc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,xxc.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,Pxc.getRequestId)(t.headers),g={blockFinished:!1,choiceIndex:c,model:o.model,filterReason:void 0,finishReason:l.finish_reason,message:u,usage:o.usage,tokens:[],requestId:{headerRequestId:f,gitHubRequestId:h,completionId:o.id,created:o.created,deploymentId:"",serverExperiments:m},telemetryData:r},A=[];for(let y of u.toolCalls??[])A.push({name:y.function?.name??"",arguments:y.function?.arguments??"",id:y.id??""});await e(d,c,{text:d,copilotToolCalls:A}),s.push(g)}return jji.AsyncIterableObject.fromArray(s)}a(Kji,"defaultNonStreamChatResponseProcessor");var zSt=ULr=class{static{a(this,"ChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d){this.modelMetadata=e,this._domainService=r,this._chatMLFetcher=n,this._tokenizerProvider=o,this._instantiationService=s,this._configurationService=c,this._expService=l,this._chatWebSocketService=u,this._maxTokens=e.capabilities.limits?.max_prompt_tokens??8192,this._maxOutputTokens=e.capabilities.limits?.max_output_tokens??4096,this.model=e.id,this.modelProvider=e.vendor,this.name=e.name,this.version=e.version;let f=(0,nEe.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer??Ixc.TokenizerType.O200K,this.showInModelPicker=e.model_picker_enabled,this.isPremium=e.billing?.is_premium,this.multiplier=e.billing?.multiplier,this.restrictedToSkus=e.billing?.restricted_to;let h=(0,Fxc.normalizeTokenPrices)(e.billing?.token_prices);this.tokenPricing=h?{default:{inputPrice:h.default.inputPrice,outputPrice:h.default.outputPrice,cacheReadTokenPrice:h.default.cachePrice,cacheWriteTokenPrice:h.default.cacheWritePrice,contextMax:h.default.contextMax},longContext:h.longContext?{inputPrice:h.longContext.inputPrice,outputPrice:h.longContext.outputPrice,cacheReadTokenPrice:h.longContext.cachePrice,cacheWriteTokenPrice:h.longContext.cacheWritePrice,contextMax:h.longContext.contextMax}:void 0}:void 0,this.priceCategory=e.model_picker_price_category,this.modelPickerCategory=e.model_picker_category,this.isFallback=e.is_chat_fallback,this.supportsToolCalls=!!e.capabilities.supports.tool_calls,this.supportsVision=!!e.capabilities.supports.vision,this.supportsPrediction=!!e.capabilities.supports.prediction,this.supportsAdaptiveThinking=e.capabilities.supports.adaptive_thinking,this.minThinkingBudget=e.capabilities.supports.min_thinking_budget,this.maxThinkingBudget=e.capabilities.supports.max_thinking_budget,this.supportsReasoningEffort=e.capabilities.supports.reasoning_effort,this.supportsToolSearch=e.capabilities.supports.tool_search??(0,nEe.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,nEe.modelSupportsContextEditing)(this),this._supportsStreaming=!!e.capabilities.supports.streaming,this.customModel=e.custom_model,this.maxPromptImages=e.capabilities.limits?.vision?.max_prompt_images,this.warningText=e.warning_text,this.promo=e.billing?.promo?{id:e.billing.promo.id,discountPercent:e.billing.promo.discount_percent,endsAt:e.billing.promo.ends_at,message:e.billing.promo.message}:void 0}getExtraHeaders(e,r){let n={...this.modelMetadata.requestHeaders};if(this.useMessagesApi){let o=this._configurationService.getConfig(Bie.ConfigKey.TeamInternal.ModelProviderPreference);o&&(n["X-Model-Provider-Preference"]=o)}return Object.assign(n,this.getAnthropicBetaHeader(e,r)),n}getAnthropicBetaHeader(e,r){if(!this.useMessagesApi)return{};let n=[];this.supportsAdaptiveThinking||n.push("interleaved-thinking-2025-05-14"),this.supportsToolSearch&&n.push("advanced-tool-use-2025-11-20"),(0,Uji.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,Uji.isExtendedCacheTtlEnabled)(this,this._configurationService,this._expService,e,o)&&n.push("extended-cache-ttl-2025-04-11"),n.length>0?{"anthropic-beta":n.join(",")}:{}}get modelMaxPromptTokens(){return this._maxTokens}get maxOutputTokens(){return this._maxOutputTokens}get urlOrRequestMetadata(){return this.modelMetadata.urlOrRequestMetadata??(this.useResponsesApi?{type:BLr.RequestType.ChatResponses}:this.useMessagesApi?{type:BLr.RequestType.ChatMessages}:{type:BLr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(iFe.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(iFe.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(iFe.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(iFe.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(Bie.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(iFe.ModelSupportedEndpoint.Messages))}get degradationReason(){return this.modelMetadata.warning_messages?.at(0)?.message}get apiType(){return this.useResponsesApi?"responses":this.useMessagesApi?"messages":"chatCompletions"}interceptBody(e){if(e&&!this.supportsToolCalls&&delete e.tools,e&&!this._supportsStreaming&&(e.stream=!1),e?.messages&&(this.family.startsWith("o1")||this.model==="o1"||this.model==="o1-mini")){let r=e.messages.map(n=>n.role===Bji.OpenAI.ChatRole.System?{role:Bji.OpenAI.ChatRole.User,content:n.content}:n);e.messages=r}}createRequestBody(e){let r=this.getImageLimit();if(r!==void 0&&(e={...e,messages:this.validateAndFilterImages(e.messages,r)}),this.useResponsesApi){let n=this._instantiationService.invokeFunction(FLr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(Qji.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,Nxc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,nEe.isAnthropicFamily)(this))return 20;if((0,nEe.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,Uxc.filterHistoryImages)(e,r)}getCompletionsCallback(){}customizeMessagesBody(e){return e}customizeResponsesBody(e){return e}customizeCapiBody(e,r){if(!!r.requestOptions?.tools?.length&&this.family.toLowerCase().includes("gemini-3")){let o=this._configurationService.getExperimentBasedConfig(Bie.ConfigKey.TeamInternal.GeminiFunctionCallingMode,this._expService);o&&typeof e.tool_choice!="object"&&(e.tool_choice=o)}return this.family.toLowerCase().includes("gemini-3")&&this._configurationService.getExperimentBasedConfig(Bie.ConfigKey.EnableGemini3LowReasoningEffort,this._expService)&&(e.reasoning_effort="low"),(0,nEe.isKimiFamily)(this)&&(e.temperature=1,e.top_p=.95),e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,FLr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,FLr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,Qji.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?qLr(e,r,n,o,s,c,l):Kji(n,s,c)}acquireTokenizer(){return this._tokenizerProvider.acquireTokenizer(this)}async makeChatRequest2(e,r){let n=e.useWebSocket??!!(e.turnId&&e.conversationId&&this.useWebSocketResponsesApi&&this._configurationService.getExperimentBasedConfig(Bie.ConfigKey.TeamInternal.ResponsesApiWebSocketEnabled,this._expService)),o=e.ignoreStatefulMarker??!(n&&e.conversationId&&e.turnId&&this._chatWebSocketService.hasActiveConnection(e.conversationId)),s=await this._makeChatRequest2({...e,useWebSocket:n,ignoreStatefulMarker:o},r);return s.type===Rxc.ChatFetchResponseType.InvalidStatefulMarker?this._makeChatRequest2({...e,useWebSocket:n,ignoreStatefulMarker:!0},r):s}async _makeChatRequest2(e,r){return this._chatMLFetcher.fetchOne({requestOptions:{},...e,endpoint:this},r)}async makeChatRequest(e,r,n,o,s,c,l,u,d){return this.makeChatRequest2({debugName:e,messages:r,finishedCb:n,location:s,source:c,requestOptions:l,userInitiatedRequest:u,telemetryProperties:d},o)}cloneWithTokenOverride(e){return this._instantiationService.createInstance(ULr,(0,Fji.mixin)((0,Fji.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};HS.ChatEndpoint=zSt;HS.ChatEndpoint=zSt=ULr=qji([Km(1,Yji.IDomainService),Km(2,Gji.IChatMLFetcher),Km(3,zji.ITokenizerProvider),Km(4,Hji.IInstantiationService),Km(5,Bie.IConfigurationService),Km(6,Wji.IExperimentationService),Km(7,Vji.IChatWebSocketManager),Km(8,$ji.ILogService)],zSt);var QLr=class extends zSt{static{a(this,"RemoteAgentChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A){super(e,n,u,d,f,h,m,g,A),this._requestMetadata=r}processResponseFromChatEndpoint(e,r,n,o,s,c,l,u){return qLr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};HS.RemoteAgentChatEndpoint=QLr;HS.RemoteAgentChatEndpoint=QLr=qji([Km(2,Yji.IDomainService),Km(3,Bxc.ICAPIClientService),Km(4,Dxc.IFetcherService),Km(5,Lxc.ITelemetryService),Km(6,wxc.IAuthenticationService),Km(7,Gji.IChatMLFetcher),Km(8,zji.ITokenizerProvider),Km(9,Hji.IInstantiationService),Km(10,Bie.IConfigurationService),Km(11,Wji.IExperimentationService),Km(12,Vji.IChatWebSocketManager),Km(13,$ji.ILogService)],QLr)});var Jji=I(LI=>{"use strict";p();var Qxc=LI&&LI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},OI=LI&&LI.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(LI,"__esModule",{value:!0});LI.CopilotUtilityChatEndpoint=LI.CopilotUtilitySmallChatEndpoint=LI.CopilotChatEndpoint=void 0;var qxc=Ks(),jxc=rE(),Hxc=LU(),Gxc=Hl(),$xc=FD(),Vxc=Np(),Wxc=Oy(),zxc=UU(),Yxc=Rh(),Kxc=bh(),Jxc=VV(),Zxc=lE(),Xxc=WV(),ewc=Fie(),oFe=class extends ewc.ChatEndpoint{static{a(this,"CopilotChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A){super(e,r,u,d,f,h,m,g,A)}getCompletionsCallback(){return(e,r)=>{r&&r.id&&(e.reasoning_opaque=r.id,e.reasoning_text=Array.isArray(r.text)?r.text.join(""):r.text)}}};LI.CopilotChatEndpoint=oFe;LI.CopilotChatEndpoint=oFe=Qxc([OI(1,Xxc.IDomainService),OI(2,Zxc.ICAPIClientService),OI(3,Wxc.IFetcherService),OI(4,$xc.IEnvService),OI(5,Kxc.ITelemetryService),OI(6,jxc.IAuthenticationService),OI(7,Hxc.IChatMLFetcher),OI(8,Jxc.ITokenizerProvider),OI(9,qxc.IInstantiationService),OI(10,Gxc.IConfigurationService),OI(11,Yxc.IExperimentationService),OI(12,zxc.IChatWebSocketManager),OI(13,Vxc.ILogService)],oFe);var jLr=class t{static{a(this,"CopilotUtilitySmallChatEndpoint")}static{this.capiFamily="gpt-4o-mini"}static async resolve(e,r){let n;try{n=await e.getChatModelFromCapiFamily(t.capiFamily)}catch{n=await e.getCopilotUtilityModel()}return r.createInstance(oFe,n)}};LI.CopilotUtilitySmallChatEndpoint=jLr;var HLr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(oFe,n)}};LI.CopilotUtilityChatEndpoint=HLr});var GLr=I(sB=>{"use strict";p();var twc=sB&&sB.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},BI=sB&&sB.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(sB,"__esModule",{value:!0});sB.AutoChatEndpoint=void 0;sB.isAutoModel=ywc;var rwc=Ks(),nwc=rE(),iwc=LU(),owc=Hl(),swc=FD(),awc=Np(),cwc=Oy(),lwc=UU(),uwc=Rh(),dwc=bh(),fwc=VV(),pwc=lE(),hwc=WV(),mwc=Fie(),gwc=Jji(),sFe=class extends gwc.CopilotChatEndpoint{static{a(this,"AutoChatEndpoint")}static{this.pseudoModelId="auto"}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E){super(Awc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,_,E),this.discountRange=o}};sB.AutoChatEndpoint=sFe;sB.AutoChatEndpoint=sFe=twc([BI(4,hwc.IDomainService),BI(5,pwc.ICAPIClientService),BI(6,cwc.IFetcherService),BI(7,swc.IEnvService),BI(8,dwc.ITelemetryService),BI(9,nwc.IAuthenticationService),BI(10,iwc.IChatMLFetcher),BI(11,fwc.ITokenizerProvider),BI(12,rwc.IInstantiationService),BI(13,owc.IConfigurationService),BI(14,uwc.IExperimentationService),BI(15,lwc.IChatWebSocketManager),BI(16,awc.ILogService)],sFe);function Awc(t,e,r){let n;t instanceof mwc.ChatEndpoint?n=t.modelMetadata:n={id:t.model,vendor:t.modelProvider,name:t.name,version:t.version,model_picker_enabled:t.showInModelPicker,is_chat_default:!0,is_chat_fallback:t.isFallback,capabilities:{type:"chat",family:t.family,tokenizer:t.tokenizer,limits:{max_prompt_tokens:t.modelMaxPromptTokens,max_output_tokens:t.maxOutputTokens},supports:{tool_calls:t.supportsToolCalls,vision:t.supportsVision,prediction:t.supportsPrediction,streaming:!0}},billing:t.isPremium!==void 0||t.multiplier!==void 0||t.restrictedToSkus!==void 0?{is_premium:t.isPremium??!1,multiplier:t.multiplier??0,restricted_to:t.restrictedToSkus}:void 0,custom_model:t.customModel};let o=t.multiplier!==void 0?Math.round(t.multiplier*(1-r)*100)/100:void 0;return{...n,warning_messages:void 0,model_picker_enabled:!0,info_messages:void 0,billing:{is_premium:n.billing?.is_premium,multiplier:o,restricted_to:n.billing?.restricted_to},requestHeaders:{...n.requestHeaders||{},"Copilot-Session-Token":e}}}a(Awc,"calculateAutoModelInfo");function ywc(t){return t&&(t.model===sFe.pseudoModelId||t instanceof sFe)?1:-1}a(ywc,"isAutoModel")});var VLr=I(aFe=>{"use strict";p();Object.defineProperty(aFe,"__esModule",{value:!0});aFe.getImageTelemetryEventMeasurements=_wc;aFe.getImageTelemetryMeasurementsFromMessages=Ewc;aFe.getImageTelemetryMeasurementsFromReferences=vwc;var rHi=vLr(),Zji="screenshot-focused-window";function nHi(){return{imageCount:0,totalImageBytes:0,maxImageBytes:0,maxImageWidth:0,maxImageHeight:0,maxImagePixels:0,totalImagePixels:0,imagePngCount:0,imageJpegCount:0,imageGifCount:0,imageWebpCount:0,imageUnknownMimeCount:0,imageClipboardCount:0,imageScreenshotCount:0,imageFileCount:0,imageUrlCount:0,imageUnknownSourceCount:0}}a(nHi,"createEmptyImageTelemetryMeasurements");function _wc(t){return t.imageCount>0?t:{}}a(_wc,"getImageTelemetryEventMeasurements");function Ewc(t){let e=nHi();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=kwc(n,"imageUrl"),s=$Lr(o,"url");if(!s)continue;let c=Cwc(s,$Lr(o,"mediaType"));c&&iHi(e,c)}return e}a(Ewc,"getImageTelemetryMeasurementsFromMessages");function vwc(t){let e=nHi();for(let r of t??[]){let n=iEe(r.value);if(!n)continue;let o=$Lr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=eHi(n.data)??eHi(n.value);iHi(e,{mimeType:o,byteLength:s?.byteLength??tHi(n.data)??tHi(n.value),dimensions:Twc(s,o),source:Iwc(r,n)})}return e}a(vwc,"getImageTelemetryMeasurementsFromReferences");function iHi(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),bwc(t,e.dimensions),oHi(e.mimeType)){case"png":t.imagePngCount++;break;case"jpeg":t.imageJpegCount++;break;case"gif":t.imageGifCount++;break;case"webp":t.imageWebpCount++;break;default:t.imageUnknownMimeCount++}switch(e.source){case"clipboard":t.imageClipboardCount++;break;case"screenshot":t.imageScreenshotCount++;break;case"file":t.imageFileCount++;break;case"url":t.imageUrlCount++;break;default:t.imageUnknownSourceCount++}}a(iHi,"addImageTelemetryInput");function Cwc(t,e){if(!t.startsWith("data:"))return t.startsWith("https://")?{mimeType:e,source:"url"}:void 0;let r=/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/.exec(t);if(r)return{mimeType:e??r[1],byteLength:xwc(r[2]),dimensions:Swc(t),source:"unknown"}}a(Cwc,"getImageTelemetryInputFromUrl");function bwc(t,e){if(!e||!Xji(e.width)||!Xji(e.height))return;let r=e.width*e.height;!Number.isFinite(r)||r<=0||(t.maxImageWidth=Math.max(t.maxImageWidth,e.width),t.maxImageHeight=Math.max(t.maxImageHeight,e.height),t.maxImagePixels=Math.max(t.maxImagePixels,r),t.totalImagePixels+=r)}a(bwc,"addImageDimensions");function Xji(t){return Number.isFinite(t)&&t>0}a(Xji,"isValidDimension");function Swc(t){try{return(0,rHi.getImageDimensions)(t)}catch{return}}a(Swc,"getImageDimensionsFromDataUrl");function Twc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||oHi(r)==="unknown"))try{return(0,rHi.getImageDimensionsFromBytes)(t,r)}catch{return}}a(Twc,"getImageDimensionsFromBytes");function oHi(t){switch(t?.toLowerCase().split(";")[0].trim()){case"image/png":return"png";case"image/jpeg":case"image/jpg":return"jpeg";case"image/gif":return"gif";case"image/webp":return"webp";default:return"unknown"}}a(oHi,"normalizeMimeType");function Iwc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===Zji||e.id===Zji?"screenshot":e.isURL===!1?"file":"unknown"}a(Iwc,"getImageSourceFromReference");function xwc(t){let e=t.trim(),r=0;return e.endsWith("==")?r=2:e.endsWith("=")&&(r=1),Math.max(0,Math.floor(e.length*3/4)-r)}a(xwc,"getBase64ByteLength");function eHi(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=iEe(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(wwc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(Rwc))return new Uint8Array(o)}a(eHi,"getByteData");function wwc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(wwc,"isArrayIndexKey");function Rwc(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(Rwc,"isByteValue");function tHi(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=iEe(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(tHi,"getByteLength");function kwc(t,e){return iEe(iEe(t)?.[e])}a(kwc,"getObjectProperty");function $Lr(t,e){let r=iEe(t)?.[e];return typeof r=="string"?r:void 0}a($Lr,"getStringProperty");function iEe(t){return typeof t=="object"&&t!==null?t:void 0}a(iEe,"asRecord")});var cHi=I(oEe=>{"use strict";p();Object.defineProperty(oEe,"__esModule",{value:!0});oEe.ChatFailKind=oEe.FetchResponseKind=void 0;var sHi;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(sHi||(oEe.FetchResponseKind=sHi={}));var aHi;(function(t){t.OffTopic="offTopic",t.TokenExpiredOrInvalid="tokenExpiredOrInvalid",t.ServerCanceled="serverCanceled",t.ClientNotSupported="clientNotSupported",t.RateLimited="rateLimited",t.QuotaExceeded="quotaExceeded",t.ExtensionBlocked="extensionBlocked",t.ServerError="serverError",t.ContentFilter="contentFilter",t.AgentUnauthorized="unauthorized",t.AgentFailedDependency="failedDependency",t.ValidationFailed="validationFailed",t.InvalidPreviousResponseId="invalidPreviousResponseId",t.NotFound="notFound",t.Unknown="unknown"})(aHi||(oEe.ChatFailKind=aHi={}))});var cFe=I(Gu=>{"use strict";p();Object.defineProperty(Gu,"__esModule",{value:!0});Gu.FILE_TOOL_NAMES=Gu.SHELL_TOOL_NAMES=Gu.TOOL_PARAM_COMMAND_MAX_LEN=Gu.GitHubCopilotAttr=Gu.CopilotCliSdkAttr=Gu.StdAttr=Gu.CopilotChatAttr=Gu.GenAiAttr=Gu.GenAiToolType=Gu.GenAiTokenType=Gu.GenAiProviderName=Gu.GenAiOperationName=void 0;Gu.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};Gu.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};Gu.GenAiTokenType={INPUT:"input",OUTPUT:"output"};Gu.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};Gu.GenAiAttr={OPERATION_NAME:"gen_ai.operation.name",PROVIDER_NAME:"gen_ai.provider.name",REQUEST_MODEL:"gen_ai.request.model",REQUEST_TEMPERATURE:"gen_ai.request.temperature",REQUEST_MAX_TOKENS:"gen_ai.request.max_tokens",REQUEST_TOP_P:"gen_ai.request.top_p",REQUEST_FREQUENCY_PENALTY:"gen_ai.request.frequency_penalty",REQUEST_PRESENCE_PENALTY:"gen_ai.request.presence_penalty",REQUEST_SEED:"gen_ai.request.seed",REQUEST_STOP_SEQUENCES:"gen_ai.request.stop_sequences",REQUEST_STREAM:"gen_ai.request.stream",RESPONSE_MODEL:"gen_ai.response.model",RESPONSE_ID:"gen_ai.response.id",RESPONSE_FINISH_REASONS:"gen_ai.response.finish_reasons",RESPONSE_TIME_TO_FIRST_CHUNK:"gen_ai.response.time_to_first_chunk",USAGE_INPUT_TOKENS:"gen_ai.usage.input_tokens",USAGE_OUTPUT_TOKENS:"gen_ai.usage.output_tokens",USAGE_CACHE_READ_INPUT_TOKENS:"gen_ai.usage.cache_read.input_tokens",USAGE_CACHE_CREATION_INPUT_TOKENS:"gen_ai.usage.cache_creation.input_tokens",USAGE_REASONING_TOKENS:"gen_ai.usage.reasoning_tokens",USAGE_REASONING_OUTPUT_TOKENS:"gen_ai.usage.reasoning.output_tokens",CONVERSATION_ID:"gen_ai.conversation.id",OUTPUT_TYPE:"gen_ai.output.type",TOKEN_TYPE:"gen_ai.token.type",AGENT_NAME:"gen_ai.agent.name",AGENT_ID:"gen_ai.agent.id",AGENT_VERSION:"gen_ai.agent.version",AGENT_DESCRIPTION:"gen_ai.agent.description",TOOL_NAME:"gen_ai.tool.name",TOOL_TYPE:"gen_ai.tool.type",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_DESCRIPTION:"gen_ai.tool.description",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",TOOL_DEFINITIONS:"gen_ai.tool.definitions"};Gu.CopilotChatAttr={LOCATION:"copilot_chat.location",INTENT:"copilot_chat.intent",TURN_INDEX:"copilot_chat.turn.index",TURN_COUNT:"copilot_chat.turn_count",TOOL_CALL_ROUND:"copilot_chat.tool_call_round",API_TYPE:"copilot_chat.api_type",FETCHER:"copilot_chat.fetcher",DEBUG_NAME:"copilot_chat.debug_name",ENDPOINT_TYPE:"copilot_chat.endpoint_type",MAX_PROMPT_TOKENS:"copilot_chat.request.max_prompt_tokens",TIME_TO_FIRST_TOKEN:"copilot_chat.time_to_first_token",SESSION_ID:"copilot_chat.session_id",SERVER_REQUEST_ID:"copilot_chat.server_request_id",CANCELED:"copilot_chat.canceled",REASONING_CONTENT:"copilot_chat.reasoning_content",USER_REQUEST:"copilot_chat.user_request",REQUEST_OPTIONS:"copilot_chat.request.options",REQUEST_SHAPE:"copilot_chat.request.shape",PROMPT_CONTEXT:"copilot_chat.prompt_context",PROMPT_INSTRUCTIONS:"copilot_chat.prompt_instructions",CHAT_SESSION_ID:"copilot_chat.chat_session_id",PARENT_CHAT_SESSION_ID:"copilot_chat.parent_chat_session_id",DEBUG_LOG_LABEL:"copilot_chat.debug_log_label",MARKDOWN_CONTENT:"copilot_chat.markdown_content",EDIT_SOURCE:"copilot_chat.edit.source",EDIT_OUTCOME:"copilot_chat.edit.outcome",LANGUAGE_ID:"copilot_chat.language_id",TIME_DELAY_MS:"copilot_chat.time_delay_ms",HAS_REMAINING_EDITS:"copilot_chat.has_remaining_edits",REPO_HEAD_BRANCH_NAME:"copilot_chat.repo.head_branch_name",REPO_HEAD_COMMIT_HASH:"copilot_chat.repo.head_commit_hash",REPO_REMOTE_URL:"copilot_chat.repo.remote_url",FILE_RELATIVE_PATH:"copilot_chat.file.relative_path",HOOK_TYPE:"copilot_chat.hook_type",HOOK_INPUT:"copilot_chat.hook_input",HOOK_OUTPUT:"copilot_chat.hook_output",HOOK_RESULT_KIND:"copilot_chat.hook_result_kind",MODE_NAME:"copilot_chat.mode_name",TOTAL_COST_USD:"copilot_chat.total_cost_usd",COPILOT_USAGE_NANO_AIU:"copilot_chat.copilot_usage_nano_aiu"};Gu.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};Gu.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};Gu.GitHubCopilotAttr={AGENT_TYPE:"github.copilot.agent.type",CLOUD_BACKEND_VERSION:"github.copilot.cloud.backend_version",GIT_REPOSITORY:"github.copilot.git.repository",GIT_BRANCH:"github.copilot.git.branch",GIT_COMMIT_SHA:"github.copilot.git.commit_sha",GITHUB_ORG:"github.copilot.github.org",HOOK_DECISION:"github.copilot.hook.decision",HOOK_DURATION_SECONDS:"github.copilot.hook.duration",HOOK_TOOL_NAMES:"github.copilot.hook.tool_names",MCP_SERVER_NAME_HASH:"github.copilot.mcp.server.name_hash",MCP_SERVER_NAME:"github.copilot.mcp.server.name",TOOL_PARAM_COMMAND:"github.copilot.tool.parameters.command",TOOL_PARAM_FILE_PATH:"github.copilot.tool.parameters.file_path",TOOL_PARAM_EDIT_TYPE:"github.copilot.tool.parameters.edit_type",TOOL_PARAM_SKILL_NAME:"github.copilot.tool.parameters.skill_name",TOOL_PARAM_MCP_SERVER_NAME_HASH:"github.copilot.tool.parameters.mcp_server_name_hash",TOOL_PARAM_MCP_SERVER_NAME:"github.copilot.tool.parameters.mcp_server_name",TOOL_PARAM_MCP_TOOL_NAME:"github.copilot.tool.parameters.mcp_tool_name"};Gu.TOOL_PARAM_COMMAND_MAX_LEN=256;Gu.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);Gu.FILE_TOOL_NAMES=new Set(["view","create","edit","str_replace","str_replace_editor","insert","readFile","createFile","replaceString","applyPatch","read_file","create_file","apply_patch","insert_edit_into_file","replace_string_in_file","multi_replace_string_in_file","edit_notebook_file","Read","Edit","MultiEdit","Write","NotebookEdit"])});var zLr=I(Ek=>{"use strict";p();Object.defineProperty(Ek,"__esModule",{value:!0});Ek.truncateForOTel=Pwc;Ek.toInputMessages=Dwc;Ek.toOutputMessages=Nwc;Ek.toSystemInstructions=Mwc;Ek.extractTextFromContent=WLr;Ek.collectSystemTextsFromRequestBody=Owc;Ek.normalizeProviderMessages=Lwc;Ek.toToolDefinitions=dHi;Ek.stringifyToolDefinitionsForOTel=Hwc;Ek.stringifyToolsRawForTelemetry=Gwc;function Pwc(t,e=0){if(e<=0||t.length<=e)return t;let r=`...[truncated, original ${t.length} chars]`;return e<=r.length?t.substring(0,e):t.substring(0,e-r.length)+r}a(Pwc,"truncateForOTel");function Dwc(t){return t.map(e=>{let r=[];if(e.role==="tool"&&e.tool_call_id)return r.push({type:"tool_call_response",id:e.tool_call_id,response:e.content??""}),{role:e.role,parts:r};if(e.content&&r.push({type:"text",content:e.content}),e.tool_calls)for(let n of e.tool_calls){let o;try{o=JSON.parse(n.function.arguments)}catch{o=n.function.arguments}r.push({type:"tool_call",id:n.id,name:n.function.name,arguments:o})}return{role:e.role,parts:r}})}a(Dwc,"toInputMessages");function Nwc(t){return t.map(e=>{let r=[],n=e.message;if(n?.content&&r.push({type:"text",content:n.content}),n?.tool_calls)for(let o of n.tool_calls){let s;try{s=JSON.parse(o.function.arguments)}catch{s=o.function.arguments}r.push({type:"tool_call",id:o.id,name:o.function.name,arguments:s})}return{role:n?.role??"assistant",parts:r,finish_reason:e.finish_reason}})}a(Nwc,"toOutputMessages");function Mwc(t){if(t===void 0)return;let r=(Array.isArray(t)?t:[t]).filter(n=>typeof n=="string"&&n.length>0).map(n=>({type:"text",content:n}));return r.length>0?r:void 0}a(Mwc,"toSystemInstructions");function WLr(t){return typeof t=="string"?t:Array.isArray(t)?t.map(e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"){let r=e;if(typeof r.text=="string")return r.text;if(typeof r.content=="string")return r.content}return""}).filter(e=>e.length>0).join(` +`):""}a(WLr,"extractTextFromContent");function Owc(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=WLr(n.content);o&&e.push(o)}}if(e.length===0){let n=WLr(t.system??t.instructions);n&&e.push(n)}return e}a(Owc,"collectSystemTextsFromRequestBody");function Lwc(t){return t.map(e=>{switch(e.type){case"function_call":return Bwc(e);case"function_call_output":return Fwc(e);case"tool_search_output":return Uwc(e);case"reasoning":return Qwc(e)}let n=e.role,o=[],s=e.content;if(n==="tool"&&typeof e.tool_call_id=="string")return o.push({type:"tool_call_response",id:e.tool_call_id,response:s??""}),{role:n,parts:o};if(typeof s=="string"&&s.length>0)o.push({type:"text",content:s});else if(Array.isArray(s))for(let l of s){if(!l||typeof l!="object")continue;let u=l;switch(u.type){case"text":case"input_text":case"output_text":typeof u.text=="string"&&o.push({type:"text",content:u.text});break;case"tool_use":o.push({type:"tool_call",id:String(u.id??""),name:String(u.name??""),arguments:u.input});break;case"tool_result":o.push({type:"tool_call_response",id:String(u.tool_use_id??""),response:u.content??""});break;case"thinking":typeof u.thinking=="string"&&o.push({type:"reasoning",content:u.thinking});break;default:o.push({type:"text",content:JSON.stringify(u)});break}}let c=e.tool_calls;if(Array.isArray(c))for(let l of c){if(!l||typeof l!="object")continue;let u=l,d=u.function;if(d){let f;try{f=typeof d.arguments=="string"?JSON.parse(d.arguments):d.arguments}catch{f=d.arguments}o.push({type:"tool_call",id:String(u.id??""),name:String(d.name??""),arguments:f})}}return{role:n,parts:o}})}a(Lwc,"normalizeProviderMessages");function Bwc(t){let e=t.arguments;if(typeof e=="string")try{e=JSON.parse(e)}catch{}return{role:"assistant",parts:[{type:"tool_call",id:String(t.call_id??t.id??""),name:String(t.name??""),arguments:e}]}}a(Bwc,"normalizeResponsesFunctionCall");function Fwc(t){let e=t.output,r;return typeof e=="string"?r=e:Array.isArray(e)?r=e.map(n=>n&&typeof n=="object"&&typeof n.text=="string"?n.text:JSON.stringify(n)).join(""):r=e??"",{role:"tool",parts:[{type:"tool_call_response",id:String(t.call_id??t.id??""),response:r}]}}a(Fwc,"normalizeResponsesFunctionCallOutput");function Uwc(t){let e=Object.prototype.hasOwnProperty.call(t,"tools")&&t.tools!==void 0,r={type:"tool_search_output",id:String(t.call_id??t.id??""),status:typeof t.status=="string"?t.status:void 0};return e&&(r.tools=t.tools),{role:"tool_search",parts:[r]}}a(Uwc,"normalizeResponsesToolSearchOutput");function Qwc(t){let e=[],r=t.summary;if(Array.isArray(r))for(let n of r)n&&typeof n=="object"&&typeof n.text=="string"&&e.push({type:"reasoning",content:n.text});else typeof r=="string"&&e.push({type:"reasoning",content:r});return typeof t.encrypted_content=="string"&&e.push({type:"reasoning",content:t.encrypted_content}),{role:"assistant",parts:e}}a(Qwc,"normalizeResponsesReasoning");function dHi(t){if(!t||t.length===0)return;let e=[];for(let r of t){let n=r.function?.name??r.name;if(!n)continue;let o=r.function?.description??r.description,s=r.function?.parameters??r.parameters??r.input_schema??r.inputSchema;e.push({type:"function",name:n,description:o,parameters:s})}return e.length>0?e:void 0}a(dHi,"toToolDefinitions");var lHi=new WeakMap,uHi=new WeakMap,YSt,KSt;function qwc(t){return YSt!==void 0&&YSt===t?YSt:(YSt=t,t)}a(qwc,"internToolDefsString");function jwc(t){return KSt!==void 0&&KSt===t?KSt:(KSt=t,t)}a(jwc,"internToolsRawString");function Hwc(t){if(!t||t.length===0)return;let e=lHi.get(t);if(e!==void 0)return e;let r=dHi(t);if(!r)return;let n=qwc(JSON.stringify(r));return lHi.set(t,n),n}a(Hwc,"stringifyToolDefinitionsForOTel");function Gwc(t){if(!t)return;let e=uHi.get(t);if(e!==void 0)return e;let r=jwc(JSON.stringify(t));return uHi.set(t,r),r}a(Gwc,"stringifyToolsRawForTelemetry")});var YLr=I(JSt=>{"use strict";p();Object.defineProperty(JSt,"__esModule",{value:!0});JSt.resolveWorkspaceOTelMetadata=$wc;JSt.workspaceMetadataToOTelAttributes=Wwc;var fHi=x2(),pHi=wOr(),zV=cFe();function $wc(t,e){let r=t.activeRepository?.get();return r?Vwc(r,e):{}}a($wc,"resolveWorkspaceOTelMetadata");function Vwc(t,e){let r,n=Array.from((0,pHi.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,pHi.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,fHi.isEqualOrParent)(e,t.rootUri)&&(o=(0,fHi.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(Vwc,"buildWorkspaceMetadata");function Wwc(t){if(!t)return{};let e={};if(t.headBranchName&&(e[zV.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[zV.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[zV.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[zV.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[zV.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[zV.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=zwc(t.remoteUrl);r&&(e[zV.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[zV.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a(Wwc,"workspaceMetadataToOTelAttributes");function zwc(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a(zwc,"extractGitHubOrg")});var hHi=I(vk=>{"use strict";p();Object.defineProperty(vk,"__esModule",{value:!0});vk.emitInferenceDetailsEvent=Ywc;vk.emitSessionStartEvent=Kwc;vk.emitToolCallEvent=Jwc;vk.emitAgentTurnEvent=Zwc;vk.emitEditFeedbackEvent=Xwc;vk.emitEditHunkActionEvent=eRc;vk.emitInlineDoneEvent=tRc;vk.emitEditSurvivalEvent=rRc;vk.emitUserFeedbackEvent=nRc;vk.emitCloudSessionInvokeEvent=iRc;var Jm=cFe(),sEe=zLr(),ZSt=YLr();function Ywc(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[Jm.GenAiAttr.OPERATION_NAME]:Jm.GenAiOperationName.CHAT,[Jm.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[Jm.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[Jm.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[Jm.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[Jm.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[Jm.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[Jm.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[Jm.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[Jm.StdAttr.ERROR_TYPE]=n.type),t.config.captureContent){let s=t.config.maxAttributeSizeChars;if(e.messages!==void 0){let c=Array.isArray(e.messages)?e.messages:void 0;o[Jm.GenAiAttr.INPUT_MESSAGES]=(0,sEe.truncateForOTel)(JSON.stringify(c?(0,sEe.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,sEe.toSystemInstructions)(c);l!==void 0&&(o[Jm.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,sEe.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,sEe.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[Jm.GenAiAttr.TOOL_DEFINITIONS]=(0,sEe.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(Ywc,"emitInferenceDetailsEvent");function Kwc(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[Jm.GenAiAttr.REQUEST_MODEL]:r,[Jm.GenAiAttr.AGENT_NAME]:n})}a(Kwc,"emitSessionStartEvent");function Jwc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[Jm.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[Jm.StdAttr.ERROR_TYPE]:o}:{}})}a(Jwc,"emitToolCallEvent");function Zwc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[Jm.GenAiAttr.USAGE_INPUT_TOKENS]:r,[Jm.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a(Zwc,"emitAgentTurnEvent");function Xwc(t,e,r,n,o,s,c,l,u){t.emitLogRecord(`copilot_chat.edit.feedback: ${e}`,{"event.name":"copilot_chat.edit.feedback",outcome:e,language_id:r,participant:n,request_id:o,edit_surface:s,has_remaining_edits:c,is_notebook:l,...(0,ZSt.workspaceMetadataToOTelAttributes)(u)})}a(Xwc,"emitEditFeedbackEvent");function eRc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.edit.hunk.action: ${e}`,{"event.name":"copilot_chat.edit.hunk.action",outcome:e,language_id:r,request_id:n,line_count:o,lines_added:s,lines_removed:c,...(0,ZSt.workspaceMetadataToOTelAttributes)(l)})}a(eRc,"emitEditHunkActionEvent");function tRc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.inline.done: ${e?"accepted":"rejected"}`,{"event.name":"copilot_chat.inline.done",accepted:e,language_id:r,edit_count:n,edit_line_count:o,reply_type:s,is_notebook:c,...(0,ZSt.workspaceMetadataToOTelAttributes)(l)})}a(tRc,"emitInlineDoneEvent");function rRc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.edit.survival: ${e}`,{"event.name":"copilot_chat.edit.survival",edit_source:e,survival_rate_four_gram:r,survival_rate_no_revert:n,time_delay_ms:o,did_branch_change:s,request_id:c,...(0,ZSt.workspaceMetadataToOTelAttributes)(l)})}a(rRc,"emitEditSurvivalEvent");function nRc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.user.feedback: ${e}`,{"event.name":"copilot_chat.user.feedback",rating:e,participant:r,conversation_id:n,request_id:o})}a(nRc,"emitUserFeedbackEvent");function iRc(t,e,r,n){t.emitLogRecord(`copilot_chat.cloud.session.invoke: ${e}`,{"event.name":"copilot_chat.cloud.session.invoke",partner_agent:e,model:r,request_id:n})}a(iRc,"emitCloudSessionInvokeEvent")});var mHi=I(XSt=>{"use strict";p();Object.defineProperty(XSt,"__esModule",{value:!0});XSt.GenAiMetrics=void 0;var Lo=cFe(),KLr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[Lo.GenAiAttr.OPERATION_NAME]:n.operationName,[Lo.GenAiAttr.PROVIDER_NAME]:n.providerName,[Lo.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Lo.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[Lo.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[Lo.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[Lo.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[Lo.GenAiAttr.OPERATION_NAME]:o.operationName,[Lo.GenAiAttr.PROVIDER_NAME]:o.providerName,[Lo.GenAiAttr.TOKEN_TYPE]:n,[Lo.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[Lo.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[Lo.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[Lo.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[Lo.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[Lo.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[Lo.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[Lo.GenAiAttr.REQUEST_MODEL]:r})}static recordTimeToFirstChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_to_first_chunk",r,{[Lo.GenAiAttr.OPERATION_NAME]:n.operationName,[Lo.GenAiAttr.PROVIDER_NAME]:n.providerName,[Lo.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Lo.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static recordTimePerOutputChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_per_output_chunk",r,{[Lo.GenAiAttr.OPERATION_NAME]:n.operationName,[Lo.GenAiAttr.PROVIDER_NAME]:n.providerName,[Lo.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Lo.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static incrementSessionCount(e){e.incrementCounter("copilot_chat.session.count")}static recordEditAcceptance(e,r,n,o){e.incrementCounter("copilot_chat.edit.acceptance.count",1,{[Lo.CopilotChatAttr.EDIT_SOURCE]:r,[Lo.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[Lo.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[Lo.CopilotChatAttr.EDIT_SOURCE]:r,[Lo.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[Lo.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[Lo.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[Lo.CopilotChatAttr.EDIT_SOURCE]:r,[Lo.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[Lo.CopilotChatAttr.EDIT_SOURCE]:r,[Lo.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[Lo.CopilotChatAttr.LANGUAGE_ID]:n}:{}})}static incrementUserActionCount(e,r){e.incrementCounter("copilot_chat.user.action.count",1,{action:r})}static incrementUserFeedbackCount(e,r){e.incrementCounter("copilot_chat.user.feedback.count",1,{rating:r})}static incrementAgentEditResponseCount(e,r){e.incrementCounter("copilot_chat.agent.edit_response.count",1,{outcome:r})}static incrementAgentSummarizationCount(e,r){e.incrementCounter("copilot_chat.agent.summarization.count",1,{outcome:r})}static incrementPullRequestCount(e){e.incrementCounter("copilot_chat.pull_request.count")}static incrementCloudSessionCount(e,r,n){e.incrementCounter("copilot_chat.cloud.session.count",1,{partner_agent:r,...n?{[Lo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n}:{}})}static incrementCloudPrReadyCount(e,r){e.incrementCounter("copilot_chat.cloud.pr_ready.count",1,r?{[Lo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:r}:void 0)}static recordCloudOperation(e,r,n,o,s){e.incrementCounter("copilot_chat.cloud.operation.count",1,{operation:r,[Lo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,success:o}),s!==void 0&&e.recordMetric("copilot_chat.cloud.operation.duration",s,{operation:r,[Lo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n})}static incrementCloudError(e,r,n,o){e.incrementCounter("copilot_chat.cloud.error.count",1,{operation:r,[Lo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,[Lo.StdAttr.ERROR_TYPE]:o})}};XSt.GenAiMetrics=KLr});var ZLr=I(e1t=>{"use strict";p();Object.defineProperty(e1t,"__esModule",{value:!0});e1t.NoopOTelService=void 0;var gHi=Fc(),AHi={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},JLr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=gHi.Event.None,this.onDidEmitSpanEvent=gHi.Event.None,this.config=e}startSpan(e,r){return AHi}startActiveSpan(e,r,n){return n(AHi)}getActiveTraceContext(){}storeTraceContext(e,r){}getStoredTraceContext(e){}runWithTraceContext(e,r){return r()}recordMetric(e,r,n){}incrementCounter(e,r,n){}emitLogRecord(e,r){}async flush(){}async shutdown(){}injectCompletedSpan(e){}};e1t.NoopOTelService=JLr});var XLr=I(Uie=>{"use strict";p();Object.defineProperty(Uie,"__esModule",{value:!0});Uie.DEFAULT_OTLP_ENDPOINT=void 0;Uie.resolveOTelConfig=sRc;Uie.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function yHi(t){if(!t)return{};let e={};for(let r of t.split(",")){let n=r.indexOf("=");if(n>0){let o=r.substring(0,n).trim(),s=r.substring(n+1).trim();o&&(e[o]=s)}}return e}a(yHi,"parseResourceAttributes");function oRc(t,e){if(!t)return;let r=t.replace(/^["']|["']$/g,"");try{let n=new URL(r);return e==="grpc"?n.origin:n.href}catch{return}}a(oRc,"parseOtlpEndpoint");function sRc(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return _Hi(t);let r=t.settingDbSpanExporter??!1,n=t.policyOtlpEndpoint!==void 0||t.policyExporterType!==void 0,o=t.policyOtlpEndpoint!==void 0?!0:void 0,s=t.policyEnabled??t1t(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??o??!!e.OTEL_EXPORTER_OTLP_ENDPOINT,c=t.policyEnabled===!1?!1:s||r,l=c&&s===!0;if(!c)return _Hi(t);let u;t.policyEnabled===!0||t.policyEnabled===void 0&&t.policyOtlpEndpoint!==void 0?u="policy":t1t(e.COPILOT_OTEL_ENABLED)===!0?u="envVar":t.settingEnabled===!0?u="setting":e.OTEL_EXPORTER_OTLP_ENDPOINT?u="otlpEndpointEnvVar":u="dbSpanExporterOnly";let f=(t.policyExporterType==="otlp-grpc"?"grpc":t.policyExporterType==="otlp-http"?"http":e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL??(t.settingExporterType==="otlp-grpc"?"grpc":t.settingExporterType==="otlp-http"?"http":void 0))==="grpc"?"grpc":"http",h=t.policyProtocol??e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL??t.settingProtocol,m=f==="grpc"?"grpc":h==="http/protobuf"?"http/protobuf":"http/json",g=t.policyOtlpEndpoint??e.COPILOT_OTEL_ENDPOINT??e.OTEL_EXPORTER_OTLP_ENDPOINT??t.settingOtlpEndpoint??Uie.DEFAULT_OTLP_ENDPOINT,A=oRc(g,f)??Uie.DEFAULT_OTLP_ENDPOINT,y=t.policyOutfile!==void 0?t.policyOutfile||void 0:n?void 0:e.COPILOT_OTEL_FILE_EXPORTER_PATH??t.settingOutfile,_;t.policyExporterType?_=t.policyExporterType:n?_="otlp-http":y?_="file":t.settingExporterType?_=t.settingExporterType:_=f==="grpc"?"otlp-grpc":"otlp-http";let E=t.policyCaptureContent??t1t(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,v=aRc(e.COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS)??t.settingMaxAttributeSizeChars??0,S=new Set(["trace","debug","info","warn","error"]),T=e.COPILOT_OTEL_LOG_LEVEL,w=T&&S.has(T)?T:"info",R=t1t(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,x=(t.policyServiceName||void 0)??e.OTEL_SERVICE_NAME??(t.settingServiceName||void 0)??"copilot-chat",k={...t.settingResourceAttributes??{},...yHi(e.OTEL_RESOURCE_ATTRIBUTES),...t.policyResourceAttributes??{}},D={...t.settingHeaders??{},...yHi(e.OTEL_EXPORTER_OTLP_HEADERS),...t.policyHeaders??{}};return Object.freeze({enabled:!0,enabledExplicitly:l,enabledVia:u,exporterType:_,otlpEndpoint:A,otlpProtocol:m,captureContent:E,maxAttributeSizeChars:v<0?0:v,fileExporterPath:y,dbSpanExporter:r,logLevel:w,httpInstrumentation:R,serviceName:x,serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:k,headers:D})}a(sRc,"resolveOTelConfig");function _Hi(t){return Object.freeze({enabled:!1,enabledExplicitly:!1,enabledVia:"disabled",exporterType:"otlp-http",otlpEndpoint:"",otlpProtocol:"http/json",captureContent:!1,maxAttributeSizeChars:0,dbSpanExporter:!1,logLevel:"info",httpInstrumentation:!1,serviceName:"copilot-chat",serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:{},headers:{}})}a(_Hi,"createDisabledConfig");function t1t(t){if(t!==void 0)return t==="true"||t==="1"}a(t1t,"envBool");function aRc(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(aRc,"parseMaxAttributeSizeChars")});var n1t=I(r1t=>{"use strict";p();Object.defineProperty(r1t,"__esModule",{value:!0});r1t.IOTelService=void 0;var cRc=an();r1t.IOTelService=(0,cRc.createServiceIdentifier)("IOTelService")});var EHi=I(eBr=>{"use strict";p();Object.defineProperty(eBr,"__esModule",{value:!0});eBr.normalizeResponseModel=lRc;function lRc(t,e){if(!e)return;if(!t)return e;let r=a(s=>s.replace(/\./g,"-").toLowerCase(),"canonical"),n=r(t),o=r(e);return n===o||n.startsWith(o+"-")?t:e}a(lRc,"normalizeResponseModel")});var bHi=I(Hr=>{"use strict";p();Object.defineProperty(Hr,"__esModule",{value:!0});Hr.workspaceMetadataToOTelAttributes=Hr.resolveWorkspaceOTelMetadata=Hr.normalizeResponseModel=Hr.IOTelService=Hr.DEFAULT_OTLP_ENDPOINT=Hr.resolveOTelConfig=Hr.NoopOTelService=Hr.truncateForOTel=Hr.toToolDefinitions=Hr.toSystemInstructions=Hr.toOutputMessages=Hr.toInputMessages=Hr.stringifyToolsRawForTelemetry=Hr.stringifyToolDefinitionsForOTel=Hr.normalizeProviderMessages=Hr.extractTextFromContent=Hr.collectSystemTextsFromRequestBody=Hr.GenAiMetrics=Hr.emitUserFeedbackEvent=Hr.emitToolCallEvent=Hr.emitSessionStartEvent=Hr.emitInlineDoneEvent=Hr.emitInferenceDetailsEvent=Hr.emitEditSurvivalEvent=Hr.emitEditHunkActionEvent=Hr.emitEditFeedbackEvent=Hr.emitCloudSessionInvokeEvent=Hr.emitAgentTurnEvent=Hr.TOOL_PARAM_COMMAND_MAX_LEN=Hr.StdAttr=Hr.SHELL_TOOL_NAMES=Hr.GitHubCopilotAttr=Hr.GenAiToolType=Hr.GenAiTokenType=Hr.GenAiProviderName=Hr.GenAiOperationName=Hr.GenAiAttr=Hr.FILE_TOOL_NAMES=Hr.CopilotCliSdkAttr=Hr.CopilotChatAttr=void 0;var Ck=cFe();Object.defineProperty(Hr,"CopilotChatAttr",{enumerable:!0,get:a(function(){return Ck.CopilotChatAttr},"get")});Object.defineProperty(Hr,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return Ck.CopilotCliSdkAttr},"get")});Object.defineProperty(Hr,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return Ck.FILE_TOOL_NAMES},"get")});Object.defineProperty(Hr,"GenAiAttr",{enumerable:!0,get:a(function(){return Ck.GenAiAttr},"get")});Object.defineProperty(Hr,"GenAiOperationName",{enumerable:!0,get:a(function(){return Ck.GenAiOperationName},"get")});Object.defineProperty(Hr,"GenAiProviderName",{enumerable:!0,get:a(function(){return Ck.GenAiProviderName},"get")});Object.defineProperty(Hr,"GenAiTokenType",{enumerable:!0,get:a(function(){return Ck.GenAiTokenType},"get")});Object.defineProperty(Hr,"GenAiToolType",{enumerable:!0,get:a(function(){return Ck.GenAiToolType},"get")});Object.defineProperty(Hr,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return Ck.GitHubCopilotAttr},"get")});Object.defineProperty(Hr,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return Ck.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Hr,"StdAttr",{enumerable:!0,get:a(function(){return Ck.StdAttr},"get")});Object.defineProperty(Hr,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return Ck.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var aB=hHi();Object.defineProperty(Hr,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return aB.emitAgentTurnEvent},"get")});Object.defineProperty(Hr,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return aB.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Hr,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return aB.emitEditFeedbackEvent},"get")});Object.defineProperty(Hr,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return aB.emitEditHunkActionEvent},"get")});Object.defineProperty(Hr,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return aB.emitEditSurvivalEvent},"get")});Object.defineProperty(Hr,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return aB.emitInferenceDetailsEvent},"get")});Object.defineProperty(Hr,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return aB.emitInlineDoneEvent},"get")});Object.defineProperty(Hr,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return aB.emitSessionStartEvent},"get")});Object.defineProperty(Hr,"emitToolCallEvent",{enumerable:!0,get:a(function(){return aB.emitToolCallEvent},"get")});Object.defineProperty(Hr,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return aB.emitUserFeedbackEvent},"get")});var uRc=mHi();Object.defineProperty(Hr,"GenAiMetrics",{enumerable:!0,get:a(function(){return uRc.GenAiMetrics},"get")});var cB=zLr();Object.defineProperty(Hr,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return cB.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Hr,"extractTextFromContent",{enumerable:!0,get:a(function(){return cB.extractTextFromContent},"get")});Object.defineProperty(Hr,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return cB.normalizeProviderMessages},"get")});Object.defineProperty(Hr,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return cB.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Hr,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return cB.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Hr,"toInputMessages",{enumerable:!0,get:a(function(){return cB.toInputMessages},"get")});Object.defineProperty(Hr,"toOutputMessages",{enumerable:!0,get:a(function(){return cB.toOutputMessages},"get")});Object.defineProperty(Hr,"toSystemInstructions",{enumerable:!0,get:a(function(){return cB.toSystemInstructions},"get")});Object.defineProperty(Hr,"toToolDefinitions",{enumerable:!0,get:a(function(){return cB.toToolDefinitions},"get")});Object.defineProperty(Hr,"truncateForOTel",{enumerable:!0,get:a(function(){return cB.truncateForOTel},"get")});var dRc=ZLr();Object.defineProperty(Hr,"NoopOTelService",{enumerable:!0,get:a(function(){return dRc.NoopOTelService},"get")});var vHi=XLr();Object.defineProperty(Hr,"resolveOTelConfig",{enumerable:!0,get:a(function(){return vHi.resolveOTelConfig},"get")});Object.defineProperty(Hr,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return vHi.DEFAULT_OTLP_ENDPOINT},"get")});var fRc=n1t();Object.defineProperty(Hr,"IOTelService",{enumerable:!0,get:a(function(){return fRc.IOTelService},"get")});var pRc=EHi();Object.defineProperty(Hr,"normalizeResponseModel",{enumerable:!0,get:a(function(){return pRc.normalizeResponseModel},"get")});var CHi=YLr();Object.defineProperty(Hr,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return CHi.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Hr,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return CHi.workspaceMetadataToOTelAttributes},"get")})});var nBr=I(YV=>{"use strict";p();Object.defineProperty(YV,"__esModule",{value:!0});YV.AbstractRequestLogger=void 0;YV.getCurrentCapturingToken=ARc;YV.storeCapturingTokenForCorrelation=yRc;YV.retrieveCapturingTokenByCorrelation=_Rc;YV.runWithCapturingToken=ERc;var hRc=require("async_hooks"),mRc=O_e(),gRc=Po(),lFe=new hRc.AsyncLocalStorage,tBr=new Map;function ARc(){return lFe.getStore()}a(ARc,"getCurrentCapturingToken");function yRc(t){let e=lFe.getStore();e&&tBr.set(t,e)}a(yRc,"storeCapturingTokenForCorrelation");function _Rc(t){let e=tBr.get(t);return e&&tBr.delete(t),e}a(_Rc,"retrieveCapturingTokenByCorrelation");function ERc(t,e){return lFe.run(t,e)}a(ERc,"runWithCapturingToken");var rBr=class extends gRc.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return lFe.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new mRc.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return lFe.getStore()}};YV.AbstractRequestLogger=rBr});var SHi=I(iBr=>{"use strict";p();Object.defineProperty(iBr,"__esModule",{value:!0});iBr.isEncryptedThinkingDelta=vRc;function vRc(t){return t.encrypted!==void 0}a(vRc,"isEncryptedThinkingDelta")});var IHi=I(i1t=>{"use strict";p();Object.defineProperty(i1t,"__esModule",{value:!0});i1t.calculateLineRepetitionStats=bRc;i1t.isRepetitive=SRc;var CRc=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60},{max_token_sequence_length:60,last_tokens_to_consider:120}];function bRc(t){if(t.length===0)return{numberOfRepetitions:0,mostRepeatedLine:"",totalLines:0};let e=new Map,r=t.split(` +`);for(let s of r){if(s=s.trim(),s.length===0)continue;let c=e.get(s)||0;e.set(s,c+1)}let n="",o=0;for(let[s,c]of e.entries())c>o&&(o=c,n=s);return{numberOfRepetitions:o,mostRepeatedLine:n,totalLines:r.length}}a(bRc,"calculateLineRepetitionStats");function SRc(t){let e=t.slice();return e.reverse(),THi(e)||THi(e.filter(r=>r.trim().length>0))}a(SRc,"isRepetitive");function THi(t){let e=TRc(t);for(let r of CRc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(TRc,"kmp_prefix_function")});var oBr=I(lB=>{"use strict";p();var IRc=lB&&lB.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},KV=lB&&lB.__param||function(t,e){return function(r,n){e(r,n,t)}},bk;Object.defineProperty(lB,"__esModule",{value:!0});lB.OpenAIEndpoint=void 0;lB.isBYOKModel=FRc;var xRc=LU(),xHi=gk(),wHi=Hl(),wRc=WV(),RRc=Fie(),kRc=Np(),PRc=PU(),DRc=$St(),NRc=UU(),MRc=Rh(),ORc=VV(),LRc=Ks();function BRc(t){return t.type===xHi.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===xHi.ChatFetchResponseType.RateLimited?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:t.capiError?`Rate limit exceeded -`+JSON.stringify(t.capiError):"Rate limit exceeded",rateLimitKey:"",retryAfter:void 0,isAuto:!1,capiError:t.capiError}:t}a(ORc,"hydrateBYOKErrorMessages");function LRc(t){return t?t instanceof i1t||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(LRc,"isBYOKModel");var i1t=class extends xRc.ChatEndpoint{static{a(this,"OpenAIEndpoint")}static{bk=this}static{this._reservedHeaders=new Set(["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","date","dnt","expect","host","keep-alive","origin","permissions-policy","referer","te","trailer","transfer-encoding","upgrade","user-agent","via","forwarded","x-forwarded-for","x-forwarded-host","x-forwarded-proto","api-key","authorization","content-type","openai-intent","x-github-api-version","x-initiator","x-interaction-id","x-interaction-type","x-onbehalf-extension-id","x-request-id","x-vscode-user-agent-library-version"])}static{this._validHeaderNamePattern=/^[!#$%&'*+\-.0-9A-Z^_`a-z|~]+$/}static{this._maxHeaderNameLength=256}static{this._maxHeaderValueLength=8192}static{this._maxCustomHeaderCount=20}constructor(e,r,n,o,s,c,l,u,d,f,h){super(e,o,s,c,l,u,d,f,h),this._apiKey=r,this._modelUrl=n,this.instantiationService=l,this.logService=h,this.ownsAuthorization=!0,this._customHeaders=this._sanitizeCustomHeaders(e.requestHeaders)}_isReservedHeader(e){return bk._reservedHeaders.has(e)}_sanitizeCustomHeaders(e){if(!e)return{};let r=Object.entries(e);r.length>bk._maxCustomHeaderCount&&this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has ${r.length} custom headers, exceeding limit of ${bk._maxCustomHeaderCount}. Only first ${bk._maxCustomHeaderCount} will be processed.`);let n={},o=0;for(let[s,c]of r){if(o>=bk._maxCustomHeaderCount)break;let l=s.trim();if(!l){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has empty header name, skipping.`);continue}if(l.length>bk._maxHeaderNameLength){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has header name exceeding ${bk._maxHeaderNameLength} characters, skipping.`);continue}if(!bk._validHeaderNamePattern.test(l)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has invalid header name format: '${l}', Skipping.`);continue}let u=l.toLowerCase();if(this._isReservedHeader(u)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to override reserved header '${l}', skipping.`);continue}if(u.startsWith("proxy-")||u.startsWith("sec-")){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to set forbidden header pattern '${l}', skipping.`);continue}if(u==="x-http-method"||u==="x-http-method-override"||u==="x-method-override"){let f=["connect","trace","track"],h=String(c).toLowerCase().trim();if(f.includes(h)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to set forbidden method '${h}' in header '${l}', skipping.`);continue}}let d=this._sanitizeHeaderValue(c);if(d===void 0){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has invalid value for header '${l}': '${c}', skipping.`);continue}n[l]=d,o++}return n}_sanitizeHeaderValue(e){if(typeof e!="string")return;let r=e.trim();if(!(r.length>bk._maxHeaderValueLength)&&!/[\x00-\x1F\x7F]/.test(r)&&!/[\u200B-\u200D\u202A-\u202E\uFEFF]/.test(r))return r}createRequestBody(e){if(this.useResponsesApi){let r=!!this.modelMetadata.zeroDataRetentionEnabled;e.ignoreStatefulMarker=e.ignoreStatefulMarker||r;let n=super.createRequestBody(e);return n.store=!r,n.n=void 0,n.stream_options=void 0,this.modelMetadata.capabilities.supports.thinking||(n.reasoning=void 0,n.include=void 0),n.previous_response_id&&(!n.previous_response_id.startsWith("resp_")||r)&&(n.previous_response_id=void 0),this._applyReasoningEffort(n,e),this._applyConfiguredModelOptions(n,e)}else if(this.useMessagesApi){let r=super.createRequestBody(e);return this._applyReasoningEffort(r,e),this._applyConfiguredModelOptions(r,e)}else{let r=!!this.modelMetadata.capabilities.supports.thinking,n=a((s,c)=>{if(c&&c.id){s.cot_id=c.id;let l=Array.isArray(c.text)?c.text.join(""):c.text;s.cot_summary=l,r&&(s.reasoning_content=l,s.reasoning=l)}},"callback"),o=(0,kRc.createCapiRequestBody)(e,this.model,n);return this._applyReasoningEffort(o,e),this._applyConfiguredModelOptions(o,e)}}_applyConfiguredModelOptions(e,r){let n=this.modelMetadata.modelOptions;if(!n)return e;for(let o of["temperature","top_p"]){let s=r.requestOptions?.[o];if(s!==void 0){e[o]=s;continue}let c=n[o];c===null?delete e[o]:c!==void 0&&(e[o]=c)}return e}_applyReasoningEffort(e,r){let n=this.supportsReasoningEffort;if(!n?.length)return;let o=this.modelMetadata.reasoningEffortFormat??(this.useResponsesApi?"responses":this.useMessagesApi?"messages":"chat-completions"),c=this._configurationService.getConfig(IHi.ConfigKey.Advanced.ReasoningEffortOverride)||r.modelCapabilities?.reasoningEffort||e.reasoning?.effort||e.reasoning_effort||e.output_config?.effort,l=c&&n.includes(c)?c:void 0;if(e.reasoning){let{effort:u,...d}=e.reasoning;e.reasoning=Object.keys(d).length>0?d:void 0}if(e.reasoning_effort=void 0,e.output_config){let{effort:u,...d}=e.output_config;e.output_config=Object.keys(d).length>0?d:void 0}l&&(o==="responses"?e.reasoning={...e.reasoning,effort:l}:o==="messages"?e.output_config={...e.output_config,effort:l}:e.reasoning_effort=l)}interceptBody(e){super.interceptBody(e),e?.tools?.length===0&&delete e.tools,e?.tools&&(e.tools=e.tools.map(r=>((0,RRc.isOpenAiFunctionTool)(r)&&r.function.parameters===void 0&&(r.function.parameters={type:"object",properties:{}}),r))),e&&(this.modelMetadata.capabilities.supports.thinking&&(delete e.temperature,!this.useMessagesApi&&!this.useResponsesApi&&(e.max_completion_tokens=e.max_tokens,delete e.max_tokens)),this.useMessagesApi||delete e.max_tokens,!this.useResponsesApi&&!this.useMessagesApi&&e.stream&&(e.stream_options={include_usage:!0}))}get urlOrRequestMetadata(){return this._modelUrl}getExtraHeaders(){let e={"Content-Type":"application/json"};this._modelUrl.includes("openai.azure")?e["api-key"]=this._apiKey:e.Authorization=`Bearer ${this._apiKey}`;for(let[r,n]of Object.entries(this._customHeaders))e[r]=n;return e}cloneWithTokenOverride(e){let r={...this.modelMetadata,maxInputTokens:e};return this.instantiationService.createInstance(bk,r,this._apiKey,this._modelUrl)}async makeChatRequest2(e,r){let n={...e,ignoreStatefulMarker:e.ignoreStatefulMarker??!1},o=await super.makeChatRequest2(n,r);return ORc(o)}};lB.OpenAIEndpoint=i1t;lB.OpenAIEndpoint=i1t=bk=SRc([YV(3,IRc.IDomainService),YV(4,TRc.IChatMLFetcher),YV(5,NRc.ITokenizerProvider),YV(6,MRc.IInstantiationService),YV(7,IHi.IConfigurationService),YV(8,DRc.IExperimentationService),YV(9,PRc.IChatWebSocketManager),YV(10,wRc.ILogService)],i1t)});var xHi=I(QN=>{"use strict";p();Object.defineProperty(QN,"__esModule",{value:!0});QN.EXTENSION_ID=QN.agentsToCommands=QN.GITHUB_PLATFORM_AGENT=void 0;QN.getAgentForIntent=FRc;var BRc=gk();QN.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";QN.agentsToCommands={editAgent:{explain:"explain",edit:"edit",review:"review",tests:"tests",fix:"fix",new:"new",newNotebook:"newNotebook",semanticSearch:"semanticSearch",setupTests:"setupTests",compact:"editAgent"},vscode:{search:"search"},terminal:{explain:"terminalExplain"},editor:{doc:"doc",fix:"fix",explain:"explain",review:"review",tests:"tests",edit:"edit",generate:"generate"}};function FRc(t,e){if(Object.keys(QN.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(QN.agentsToCommands))if(!(e===BRc.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(FRc,"getAgentForIntent");QN.EXTENSION_ID="GitHub.copilot-chat"});var kHi=I(o1t=>{"use strict";p();Object.defineProperty(o1t,"__esModule",{value:!0});o1t.ChatMLFetcherTelemetrySender=void 0;var wHi=HLr(),oBr=$Lr(),RHi=iBr();function URc(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(URc,"getTurnFromBaseTelemetry");function sBr(t,e,r,n,o){t.sendTelemetryEvent(e,{github:!0,microsoft:!0},r,n),o.imageCount>0&&t.sendEnhancedGHTelemetryEvent(e,r,n)}a(sBr,"sendResponseTelemetryEvent");var aBr=class{static{a(this,"ChatMLFetcherTelemetrySender")}static sendSuccessTelemetry(e,{chatCompletion:r,baseTelemetry:n,userInitiatedRequest:o,interactionType:s,chatEndpointInfo:c,requestBody:l,maxResponseTokens:u,promptTokenCount:d,timeToFirstToken:f,timeToFirstTokenEmitted:h,hasImageMessages:m,imageTelemetryMeasurements:g,transport:A,fetcher:y,bytesReceived:_,suspendEventSeen:E,resumeEventSeen:v,modelCallId:S}){sBr(e,"response.success",{reason:r.finishReason,filterReason:r.filterReason,source:n?.properties.messageSource??"unknown",initiatorType:o?"user":"agent",requestKind:s,conversationId:n?.properties.conversationId,model:c?.model,modelInvoked:r.model,apiType:c?.apiType,requestId:r.requestId.headerRequestId,gitHubRequestId:r.requestId.gitHubRequestId,associatedRequestId:n?.properties.associatedRequestId,parentRequestId:n?.properties.parentRequestId,reasoningEffort:l.reasoning?.effort??l.output_config?.effort,reasoningSummary:l.reasoning?.summary,modelCallId:S,...n?.properties.subType?{subType:n.properties.subType}:{},...n?.properties.parentModelCallId?{parentModelCallId:n.properties.parentModelCallId}:{},...n?.properties.iterationNumber?{iterationNumber:n.properties.iterationNumber}:{},...y?{fetcher:y}:{},transport:A,...n?.properties.retryAfterError?{retryAfterError:n.properties.retryAfterError}:{},...n?.properties.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.properties.retryAfterErrorGitHubRequestId}:{},...n?.properties.connectivityTestError?{connectivityTestError:n.properties.connectivityTestError}:{},...n?.properties.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.properties.connectivityTestErrorGitHubRequestId}:{},...n?.properties.retryAfterFilterCategory?{retryAfterFilterCategory:n.properties.retryAfterFilterCategory}:{}},{turn:URc(n),totalTokenMax:c?.modelMaxPromptTokens??-1,tokenCountMax:u,promptTokenCount:r.usage?.prompt_tokens,promptCacheTokenCount:r.usage?.prompt_tokens_details?.cached_tokens,promptCacheCreation1hTokenCount:r.usage?.prompt_tokens_details?.anthropic_cache_creation?.ephemeral_1h_input_tokens,promptCacheCreation5mTokenCount:r.usage?.prompt_tokens_details?.anthropic_cache_creation?.ephemeral_5m_input_tokens,clientPromptTokenCount:d,tokenCount:r.usage?.total_tokens,reasoningTokens:r.usage?.completion_tokens_details?.reasoning_tokens,acceptedPredictionTokens:r.usage?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:r.usage?.completion_tokens_details?.rejected_prediction_tokens,completionTokens:r.usage?.completion_tokens,timeToFirstToken:f,timeToFirstTokenEmitted:h,timeToComplete:Date.now()-n.issuedTime,issuedTime:n.issuedTime,isVisionRequest:m?1:-1,...(0,oBr.getImageTelemetryEventMeasurements)(g),isBYOK:(0,RHi.isBYOKModel)(c),isAuto:(0,wHi.isAutoModel)(c),bytesReceived:_,suspendEventSeen:E?1:0,resumeEventSeen:v?1:0},g)}static sendCancellationTelemetry(e,{source:r,requestId:n,model:o,apiType:s,transport:c,interactionType:l,conversationId:u,associatedRequestId:d,parentRequestId:f,retryAfterError:h,retryAfterErrorGitHubRequestId:m,connectivityTestError:g,connectivityTestErrorGitHubRequestId:A,retryAfterFilterCategory:y,fetcher:_,suspendEventSeen:E,resumeEventSeen:v},{totalTokenMax:S,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:k,isVisionRequest:D,isBYOK:N,isAuto:O,bytesReceived:B,issuedTime:q,imageTelemetryMeasurements:M}){sBr(e,"response.cancelled",{apiType:s,source:r,requestId:n,model:o,requestKind:l,conversationId:u,associatedRequestId:d,parentRequestId:f,..._?{fetcher:_}:{},transport:c,...h?{retryAfterError:h}:{},...m?{retryAfterErrorGitHubRequestId:m}:{},...g?{connectivityTestError:g}:{},...A?{connectivityTestErrorGitHubRequestId:A}:{},...y?{retryAfterFilterCategory:y}:{}},{totalTokenMax:S,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:k,timeToComplete:k,issuedTime:q,isVisionRequest:D,...(0,oBr.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:O,bytesReceived:B,suspendEventSeen:E?1:0,resumeEventSeen:v?1:0},M)}static sendResponseErrorTelemetry(e,{processed:r,telemetryProperties:n,chatEndpointInfo:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:d,imageTelemetryMeasurements:f,transport:h,interactionType:m,fetcher:g,bytesReceived:A,issuedTime:y,wasRetried:_,suspendEventSeen:E,resumeEventSeen:v}){sBr(e,"response.error",{type:r.type,reason:r.reasonDetail||r.reason,source:n?.messageSource??"unknown",requestKind:m,requestId:r.requestId,gitHubRequestId:r.serverRequestId,model:o.model,apiType:o.apiType,conversationId:n?.conversationId,reasoningEffort:s.reasoning?.effort??s.output_config?.effort,reasoningSummary:s.reasoning?.summary,...g?{fetcher:g}:{},transport:h,associatedRequestId:n?.associatedRequestId,parentRequestId:n?.parentRequestId,...n?.retryAfterError?{retryAfterError:n.retryAfterError}:{},...n?.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.retryAfterErrorGitHubRequestId}:{},...n?.connectivityTestError?{connectivityTestError:n.connectivityTestError}:{},...n?.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.connectivityTestErrorGitHubRequestId}:{},...n?.retryAfterFilterCategory?{retryAfterFilterCategory:n.retryAfterFilterCategory}:{}},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:c,tokenCountMax:l,timeToFirstToken:u,timeToComplete:Date.now()-y,issuedTime:y,isVisionRequest:d?1:-1,...(0,oBr.getImageTelemetryEventMeasurements)(f),isBYOK:(0,RHi.isBYOKModel)(o),isAuto:(0,wHi.isAutoModel)(o),wasRetried:_?1:0,bytesReceived:A,suspendEventSeen:E?1:0,resumeEventSeen:v?1:0},f)}};o1t.ChatMLFetcherTelemetrySender=aBr});var FHi=I(UI=>{"use strict";p();var QRc=UI&&UI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},aC=UI&&UI.__param||function(t,e){return function(r,n){e(r,n,t)}},fBr;Object.defineProperty(UI,"__esModule",{value:!0});UI.ChatMLFetcherImpl=UI.AbstractChatMLFetcher=void 0;UI.createTelemetryData=BHi;UI.locationToIntent=l1t;var qRc=wo(),jRc=rE(),HRc=LU(),GRc=x4r(),Jn=gk(),$Rc=w4r(),uFe=$3e(),VRc=k4r(),KV=Hl(),WRc=lE(),s1t=HLr(),dFe=PSt(),zRc=$Lr(),pBr=Np(),cBr=PU(),YRc=Oy(),a1t=GSt(),FI=RU(),PHi=X3e(),LHi=UU(),DHi=ISt(),yn=sHi(),cn=vHi(),KRc=r1t(),JRc=O_e(),lBr=rBr(),ZRc=Rh(),hBr=bh(),cEe=J_e(),XRc=CHi(),c1t=SHi(),ekc=gv(),NHi=pl(),MHi=Os(),tkc=Fc(),rkc=Po(),nkc=ym(),uBr=Og(),ikc=Ks(),OHi=iBr(),okc=xHi(),skc=S4r(),aEe=kHi(),u1t=class extends rkc.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new tkc.Emitter),this.onDidMakeChatMLRequest=this._onDidMakeChatMLRequest.event}preparePostOptions(e){return{temperature:this.options.temperature,top_p:this.options.topP,stream:!0,...e}}async fetchOne(e,r){let n=await this.fetchMany({...e,requestOptions:{...e.requestOptions,n:1}},r);return n.type===Jn.ChatFetchResponseType.Success?{...n,value:n.value[0]}:n}};UI.AbstractChatMLFetcher=u1t;var mBr=class extends u1t{static{a(this,"ChatMLFetcherImpl")}static{fBr=this}static{this._maxConsecutiveWebSocketFallbacks=3}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y){super(d),this._fetcherService=e,this._telemetryService=r,this._requestLogger=n,this._logService=o,this._authenticationService=s,this._interactionService=c,this._chatQuotaService=l,this._capiClientService=u,this._configurationService=f,this._experimentationService=h,this._powerService=m,this._instantiationService=g,this._webSocketManager=A,this._otelService=y,this.connectivityCheckDelays=[1e3,1e4,1e4],this._consecutiveWebSocketRetryFallbacks=0}async fetchMany(e,r){let{debugName:n,endpoint:o,finishedCb:s,location:c,messages:l,requestOptions:u,source:d,telemetryProperties:f,userInitiatedRequest:h,interactionTypeOverride:m,conversationId:g,turnId:A,topLevelTurnId:y,useWebSocket:_,ignoreStatefulMarker:E}=e,v=m??l1t(c);_&&this._consecutiveWebSocketRetryFallbacks>=fBr._maxConsecutiveWebSocketFallbacks&&(this._logService.debug(`[ChatWebSocketManager] Disabling WebSocket for request due to ${this._consecutiveWebSocketRetryFallbacks} consecutive WebSocket failures with successful HTTP fallback.`),_=!1,E=!0),f||(f={}),f.messageSource||(f.messageSource=n);let S=_?"websocket":"http",T=f.requestId??f.messageId??(0,uBr.generateUuid)(),w=o.maxOutputTokens;u?.prediction||(u={max_tokens:w,...u}),u.prediction?.content||delete u.prediction;let R=this.preparePostOptions(u),x=o.createRequestBody({...e,ignoreStatefulMarker:E,requestId:T,postOptions:R}),k=(0,zRc.getImageTelemetryMeasurementsFromMessages)(l),D=cEe.TelemetryData.createAndMarkAsIssued({...f,...g?{conversationId:g}:{},headerRequestId:T,baseModel:o.model,uiKind:Jn.ChatLocation.toString(c)}),N=this._requestLogger.logChatRequest(n,o,{messages:e.messages,model:o.model,ourRequestId:T,location:e.location,body:x,ignoreStatefulMarker:E,isConversationRequest:e.isConversationRequest,customMetadata:e.customMetadata}),O=-1,B=new HRc.FetchStreamRecorder(s),q=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),L,U,j,Q,Y,W,V,z;try{let ie,H=akc(e.messages,R,o,this._configurationService,this._experimentationService);if(!H.isValid)ie={type:yn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:yn.ChatFailKind.ValidationFailed,reason:H.reason};else{let me,Oe=a(()=>me??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),Te;try{Te=await this._authenticationService.getCopilotToken()}catch{}L=Te?.username??this._authenticationService.copilotToken?.username;let te=await this._fetchAndStreamChat(o,x,D,B.callback,u.secretKey,Te,e.location,T,R.n,r,Oe,h,_,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(ie=te.result,U=te.fetcher,j=te.bytesReceived,Q=te.statusCode,Y=te.suspendEventSeen,W=te.resumeEventSeen,V=te.modelCallId,z=te.otelSpan,z?.setAttribute(cn.GenAiAttr.AGENT_NAME,n),z){let he=(x.messages??x.input)?.filter(ne=>ne.role==="user"),X=he?.[he.length-1];if(X?.content){let ne=typeof X.content=="string"?X.content:JSON.stringify(X.content);z.setAttribute(cn.CopilotChatAttr.USER_REQUEST,(0,cn.truncateForOTel)(ne,this._otelService.config.maxAttributeSizeChars))}let de=(0,cn.collectSystemTextsFromRequestBody)(x),Be=(0,cn.toSystemInstructions)(de);Be&&z.setAttribute(cn.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,cn.truncateForOTel)(JSON.stringify(Be),this._otelService.config.maxAttributeSizeChars))}if(z){let K=x.messages??x.input;if(K){let Be=K.filter(ne=>ne.role!=="system");z.setAttribute(cn.GenAiAttr.INPUT_MESSAGES,(0,cn.truncateForOTel)(JSON.stringify((0,cn.normalizeProviderMessages)(Be)),this._otelService.config.maxAttributeSizeChars))}let he=(0,cn.stringifyToolDefinitionsForOTel)(x.tools);he&&z.setAttribute(cn.GenAiAttr.TOOL_DEFINITIONS,(0,cn.truncateForOTel)(he,this._otelService.config.maxAttributeSizeChars));let X=ckc(x);X&&z.setAttribute(cn.CopilotChatAttr.REQUEST_OPTIONS,(0,cn.truncateForOTel)(JSON.stringify(X),this._otelService.config.maxAttributeSizeChars));let de=lkc(x);de&&z.setAttribute(cn.CopilotChatAttr.REQUEST_SHAPE,(0,cn.truncateForOTel)(JSON.stringify(de),this._otelService.config.maxAttributeSizeChars))}O=await Oe();let ee=d?.extensionId??okc.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:ee},tokenCount:O})}let re=Date.now()-D.issuedTime;N?.markTimeToFirstToken(re);let le,Le;switch(ie.type){case yn.FetchResponseKind.Success:{let me=await this.processSuccessfulResponse(ie,l,k,x,T,w,O,re,B,D,o,h,v,S,U,j,Y,W,V);if(me.type===Jn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){B.callback("",0,{text:"",retryReason:me.category});let Oe=me.value[0];if(Oe){let Te=me.category===FI.FilterReason.Copyright?`The previous response (copied below) was filtered due to being too similar to existing public code. Please suggest something similar in function that does not match public code. Here's the previous response: ${Oe} +`+JSON.stringify(t.capiError):"Rate limit exceeded",rateLimitKey:"",retryAfter:void 0,isAuto:!1,capiError:t.capiError}:t}a(BRc,"hydrateBYOKErrorMessages");function FRc(t){return t?t instanceof o1t||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(FRc,"isBYOKModel");var o1t=class extends RRc.ChatEndpoint{static{a(this,"OpenAIEndpoint")}static{bk=this}static{this._reservedHeaders=new Set(["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","date","dnt","expect","host","keep-alive","origin","permissions-policy","referer","te","trailer","transfer-encoding","upgrade","user-agent","via","forwarded","x-forwarded-for","x-forwarded-host","x-forwarded-proto","api-key","authorization","content-type","openai-intent","x-github-api-version","x-initiator","x-interaction-id","x-interaction-type","x-onbehalf-extension-id","x-request-id","x-vscode-user-agent-library-version"])}static{this._validHeaderNamePattern=/^[!#$%&'*+\-.0-9A-Z^_`a-z|~]+$/}static{this._maxHeaderNameLength=256}static{this._maxHeaderValueLength=8192}static{this._maxCustomHeaderCount=20}constructor(e,r,n,o,s,c,l,u,d,f,h){super(e,o,s,c,l,u,d,f,h),this._apiKey=r,this._modelUrl=n,this.instantiationService=l,this.logService=h,this.ownsAuthorization=!0,this._customHeaders=this._sanitizeCustomHeaders(e.requestHeaders)}_isReservedHeader(e){return bk._reservedHeaders.has(e)}_sanitizeCustomHeaders(e){if(!e)return{};let r=Object.entries(e);r.length>bk._maxCustomHeaderCount&&this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has ${r.length} custom headers, exceeding limit of ${bk._maxCustomHeaderCount}. Only first ${bk._maxCustomHeaderCount} will be processed.`);let n={},o=0;for(let[s,c]of r){if(o>=bk._maxCustomHeaderCount)break;let l=s.trim();if(!l){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has empty header name, skipping.`);continue}if(l.length>bk._maxHeaderNameLength){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has header name exceeding ${bk._maxHeaderNameLength} characters, skipping.`);continue}if(!bk._validHeaderNamePattern.test(l)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has invalid header name format: '${l}', Skipping.`);continue}let u=l.toLowerCase();if(this._isReservedHeader(u)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to override reserved header '${l}', skipping.`);continue}if(u.startsWith("proxy-")||u.startsWith("sec-")){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to set forbidden header pattern '${l}', skipping.`);continue}if(u==="x-http-method"||u==="x-http-method-override"||u==="x-method-override"){let f=["connect","trace","track"],h=String(c).toLowerCase().trim();if(f.includes(h)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to set forbidden method '${h}' in header '${l}', skipping.`);continue}}let d=this._sanitizeHeaderValue(c);if(d===void 0){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has invalid value for header '${l}': '${c}', skipping.`);continue}n[l]=d,o++}return n}_sanitizeHeaderValue(e){if(typeof e!="string")return;let r=e.trim();if(!(r.length>bk._maxHeaderValueLength)&&!/[\x00-\x1F\x7F]/.test(r)&&!/[\u200B-\u200D\u202A-\u202E\uFEFF]/.test(r))return r}createRequestBody(e){if(this.useResponsesApi){let r=!!this.modelMetadata.zeroDataRetentionEnabled;e.ignoreStatefulMarker=e.ignoreStatefulMarker||r;let n=super.createRequestBody(e);return n.store=!r,n.n=void 0,n.stream_options=void 0,this.modelMetadata.capabilities.supports.thinking||(n.reasoning=void 0,n.include=void 0),n.previous_response_id&&(!n.previous_response_id.startsWith("resp_")||r)&&(n.previous_response_id=void 0),this._applyReasoningEffort(n,e),this._applyConfiguredModelOptions(n,e)}else if(this.useMessagesApi){let r=super.createRequestBody(e);return this._applyReasoningEffort(r,e),this._applyConfiguredModelOptions(r,e)}else{let r=!!this.modelMetadata.capabilities.supports.thinking,n=a((s,c)=>{if(c&&c.id){s.cot_id=c.id;let l=Array.isArray(c.text)?c.text.join(""):c.text;s.cot_summary=l,r&&(s.reasoning_content=l,s.reasoning=l)}},"callback"),o=(0,DRc.createCapiRequestBody)(e,this.model,n);return this._applyReasoningEffort(o,e),this._applyConfiguredModelOptions(o,e)}}_applyConfiguredModelOptions(e,r){let n=this.modelMetadata.modelOptions;if(!n)return e;for(let o of["temperature","top_p"]){let s=r.requestOptions?.[o];if(s!==void 0){e[o]=s;continue}let c=n[o];c===null?delete e[o]:c!==void 0&&(e[o]=c)}return e}_applyReasoningEffort(e,r){let n=this.supportsReasoningEffort;if(!n?.length)return;let o=this.modelMetadata.reasoningEffortFormat??(this.useResponsesApi?"responses":this.useMessagesApi?"messages":"chat-completions"),c=this._configurationService.getConfig(wHi.ConfigKey.Advanced.ReasoningEffortOverride)||r.modelCapabilities?.reasoningEffort||e.reasoning?.effort||e.reasoning_effort||e.output_config?.effort,l=c&&n.includes(c)?c:void 0;if(e.reasoning){let{effort:u,...d}=e.reasoning;e.reasoning=Object.keys(d).length>0?d:void 0}if(e.reasoning_effort=void 0,e.output_config){let{effort:u,...d}=e.output_config;e.output_config=Object.keys(d).length>0?d:void 0}l&&(o==="responses"?e.reasoning={...e.reasoning,effort:l}:o==="messages"?e.output_config={...e.output_config,effort:l}:e.reasoning_effort=l)}interceptBody(e){super.interceptBody(e),e?.tools?.length===0&&delete e.tools,e?.tools&&(e.tools=e.tools.map(r=>((0,PRc.isOpenAiFunctionTool)(r)&&r.function.parameters===void 0&&(r.function.parameters={type:"object",properties:{}}),r))),e&&(this.modelMetadata.capabilities.supports.thinking&&(delete e.temperature,!this.useMessagesApi&&!this.useResponsesApi&&(e.max_completion_tokens=e.max_tokens,delete e.max_tokens)),this.useMessagesApi||delete e.max_tokens,!this.useResponsesApi&&!this.useMessagesApi&&e.stream&&(e.stream_options={include_usage:!0}))}get urlOrRequestMetadata(){return this._modelUrl}getExtraHeaders(){let e={"Content-Type":"application/json"};this._modelUrl.includes("openai.azure")?e["api-key"]=this._apiKey:e.Authorization=`Bearer ${this._apiKey}`;for(let[r,n]of Object.entries(this._customHeaders))e[r]=n;return e}cloneWithTokenOverride(e){let r={...this.modelMetadata,maxInputTokens:e};return this.instantiationService.createInstance(bk,r,this._apiKey,this._modelUrl)}async makeChatRequest2(e,r){let n={...e,ignoreStatefulMarker:e.ignoreStatefulMarker??!1},o=await super.makeChatRequest2(n,r);return BRc(o)}};lB.OpenAIEndpoint=o1t;lB.OpenAIEndpoint=o1t=bk=IRc([KV(3,wRc.IDomainService),KV(4,xRc.IChatMLFetcher),KV(5,ORc.ITokenizerProvider),KV(6,LRc.IInstantiationService),KV(7,wHi.IConfigurationService),KV(8,MRc.IExperimentationService),KV(9,NRc.IChatWebSocketManager),KV(10,kRc.ILogService)],o1t)});var RHi=I(QN=>{"use strict";p();Object.defineProperty(QN,"__esModule",{value:!0});QN.EXTENSION_ID=QN.agentsToCommands=QN.GITHUB_PLATFORM_AGENT=void 0;QN.getAgentForIntent=QRc;var URc=gk();QN.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";QN.agentsToCommands={editAgent:{explain:"explain",edit:"edit",review:"review",tests:"tests",fix:"fix",new:"new",newNotebook:"newNotebook",semanticSearch:"semanticSearch",setupTests:"setupTests",compact:"editAgent"},vscode:{search:"search"},terminal:{explain:"terminalExplain"},editor:{doc:"doc",fix:"fix",explain:"explain",review:"review",tests:"tests",edit:"edit",generate:"generate"}};function QRc(t,e){if(Object.keys(QN.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(QN.agentsToCommands))if(!(e===URc.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(QRc,"getAgentForIntent");QN.EXTENSION_ID="GitHub.copilot-chat"});var DHi=I(s1t=>{"use strict";p();Object.defineProperty(s1t,"__esModule",{value:!0});s1t.ChatMLFetcherTelemetrySender=void 0;var kHi=GLr(),sBr=VLr(),PHi=oBr();function qRc(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(qRc,"getTurnFromBaseTelemetry");function aBr(t,e,r,n,o){t.sendTelemetryEvent(e,{github:!0,microsoft:!0},r,n),o.imageCount>0&&t.sendEnhancedGHTelemetryEvent(e,r,n)}a(aBr,"sendResponseTelemetryEvent");var cBr=class{static{a(this,"ChatMLFetcherTelemetrySender")}static sendSuccessTelemetry(e,{chatCompletion:r,baseTelemetry:n,userInitiatedRequest:o,interactionType:s,chatEndpointInfo:c,requestBody:l,maxResponseTokens:u,promptTokenCount:d,timeToFirstToken:f,timeToFirstTokenEmitted:h,hasImageMessages:m,imageTelemetryMeasurements:g,transport:A,fetcher:y,bytesReceived:_,suspendEventSeen:E,resumeEventSeen:v,modelCallId:S}){aBr(e,"response.success",{reason:r.finishReason,filterReason:r.filterReason,source:n?.properties.messageSource??"unknown",initiatorType:o?"user":"agent",requestKind:s,conversationId:n?.properties.conversationId,model:c?.model,modelInvoked:r.model,apiType:c?.apiType,requestId:r.requestId.headerRequestId,gitHubRequestId:r.requestId.gitHubRequestId,associatedRequestId:n?.properties.associatedRequestId,parentRequestId:n?.properties.parentRequestId,reasoningEffort:l.reasoning?.effort??l.output_config?.effort,reasoningSummary:l.reasoning?.summary,modelCallId:S,...n?.properties.subType?{subType:n.properties.subType}:{},...n?.properties.parentModelCallId?{parentModelCallId:n.properties.parentModelCallId}:{},...n?.properties.iterationNumber?{iterationNumber:n.properties.iterationNumber}:{},...y?{fetcher:y}:{},transport:A,...n?.properties.retryAfterError?{retryAfterError:n.properties.retryAfterError}:{},...n?.properties.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.properties.retryAfterErrorGitHubRequestId}:{},...n?.properties.connectivityTestError?{connectivityTestError:n.properties.connectivityTestError}:{},...n?.properties.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.properties.connectivityTestErrorGitHubRequestId}:{},...n?.properties.retryAfterFilterCategory?{retryAfterFilterCategory:n.properties.retryAfterFilterCategory}:{}},{turn:qRc(n),totalTokenMax:c?.modelMaxPromptTokens??-1,tokenCountMax:u,promptTokenCount:r.usage?.prompt_tokens,promptCacheTokenCount:r.usage?.prompt_tokens_details?.cached_tokens,promptCacheCreation1hTokenCount:r.usage?.prompt_tokens_details?.anthropic_cache_creation?.ephemeral_1h_input_tokens,promptCacheCreation5mTokenCount:r.usage?.prompt_tokens_details?.anthropic_cache_creation?.ephemeral_5m_input_tokens,clientPromptTokenCount:d,tokenCount:r.usage?.total_tokens,reasoningTokens:r.usage?.completion_tokens_details?.reasoning_tokens,acceptedPredictionTokens:r.usage?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:r.usage?.completion_tokens_details?.rejected_prediction_tokens,completionTokens:r.usage?.completion_tokens,timeToFirstToken:f,timeToFirstTokenEmitted:h,timeToComplete:Date.now()-n.issuedTime,issuedTime:n.issuedTime,isVisionRequest:m?1:-1,...(0,sBr.getImageTelemetryEventMeasurements)(g),isBYOK:(0,PHi.isBYOKModel)(c),isAuto:(0,kHi.isAutoModel)(c),bytesReceived:_,suspendEventSeen:E?1:0,resumeEventSeen:v?1:0},g)}static sendCancellationTelemetry(e,{source:r,requestId:n,model:o,apiType:s,transport:c,interactionType:l,conversationId:u,associatedRequestId:d,parentRequestId:f,retryAfterError:h,retryAfterErrorGitHubRequestId:m,connectivityTestError:g,connectivityTestErrorGitHubRequestId:A,retryAfterFilterCategory:y,fetcher:_,suspendEventSeen:E,resumeEventSeen:v},{totalTokenMax:S,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:k,isVisionRequest:D,isBYOK:N,isAuto:O,bytesReceived:B,issuedTime:q,imageTelemetryMeasurements:M}){aBr(e,"response.cancelled",{apiType:s,source:r,requestId:n,model:o,requestKind:l,conversationId:u,associatedRequestId:d,parentRequestId:f,..._?{fetcher:_}:{},transport:c,...h?{retryAfterError:h}:{},...m?{retryAfterErrorGitHubRequestId:m}:{},...g?{connectivityTestError:g}:{},...A?{connectivityTestErrorGitHubRequestId:A}:{},...y?{retryAfterFilterCategory:y}:{}},{totalTokenMax:S,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:k,timeToComplete:k,issuedTime:q,isVisionRequest:D,...(0,sBr.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:O,bytesReceived:B,suspendEventSeen:E?1:0,resumeEventSeen:v?1:0},M)}static sendResponseErrorTelemetry(e,{processed:r,telemetryProperties:n,chatEndpointInfo:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:d,imageTelemetryMeasurements:f,transport:h,interactionType:m,fetcher:g,bytesReceived:A,issuedTime:y,wasRetried:_,suspendEventSeen:E,resumeEventSeen:v}){aBr(e,"response.error",{type:r.type,reason:r.reasonDetail||r.reason,source:n?.messageSource??"unknown",requestKind:m,requestId:r.requestId,gitHubRequestId:r.serverRequestId,model:o.model,apiType:o.apiType,conversationId:n?.conversationId,reasoningEffort:s.reasoning?.effort??s.output_config?.effort,reasoningSummary:s.reasoning?.summary,...g?{fetcher:g}:{},transport:h,associatedRequestId:n?.associatedRequestId,parentRequestId:n?.parentRequestId,...n?.retryAfterError?{retryAfterError:n.retryAfterError}:{},...n?.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.retryAfterErrorGitHubRequestId}:{},...n?.connectivityTestError?{connectivityTestError:n.connectivityTestError}:{},...n?.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.connectivityTestErrorGitHubRequestId}:{},...n?.retryAfterFilterCategory?{retryAfterFilterCategory:n.retryAfterFilterCategory}:{}},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:c,tokenCountMax:l,timeToFirstToken:u,timeToComplete:Date.now()-y,issuedTime:y,isVisionRequest:d?1:-1,...(0,sBr.getImageTelemetryEventMeasurements)(f),isBYOK:(0,PHi.isBYOKModel)(o),isAuto:(0,kHi.isAutoModel)(o),wasRetried:_?1:0,bytesReceived:A,suspendEventSeen:E?1:0,resumeEventSeen:v?1:0},f)}};s1t.ChatMLFetcherTelemetrySender=cBr});var QHi=I(UI=>{"use strict";p();var jRc=UI&&UI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},aC=UI&&UI.__param||function(t,e){return function(r,n){e(r,n,t)}},pBr;Object.defineProperty(UI,"__esModule",{value:!0});UI.ChatMLFetcherImpl=UI.AbstractChatMLFetcher=void 0;UI.createTelemetryData=UHi;UI.locationToIntent=u1t;var HRc=wo(),GRc=rE(),$Rc=LU(),VRc=w4r(),Jn=gk(),WRc=R4r(),uFe=$3e(),zRc=P4r(),JV=Hl(),YRc=lE(),a1t=GLr(),dFe=DSt(),KRc=VLr(),hBr=Np(),lBr=PU(),JRc=Oy(),c1t=$St(),FI=RU(),NHi=X3e(),FHi=UU(),MHi=xSt(),yn=cHi(),cn=bHi(),ZRc=n1t(),XRc=O_e(),uBr=nBr(),ekc=Rh(),mBr=bh(),cEe=J_e(),tkc=SHi(),l1t=IHi(),rkc=gv(),OHi=pl(),LHi=Os(),nkc=Fc(),ikc=Po(),okc=ym(),dBr=Lg(),skc=Ks(),BHi=oBr(),akc=RHi(),ckc=T4r(),aEe=DHi(),d1t=class extends ikc.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new nkc.Emitter),this.onDidMakeChatMLRequest=this._onDidMakeChatMLRequest.event}preparePostOptions(e){return{temperature:this.options.temperature,top_p:this.options.topP,stream:!0,...e}}async fetchOne(e,r){let n=await this.fetchMany({...e,requestOptions:{...e.requestOptions,n:1}},r);return n.type===Jn.ChatFetchResponseType.Success?{...n,value:n.value[0]}:n}};UI.AbstractChatMLFetcher=d1t;var gBr=class extends d1t{static{a(this,"ChatMLFetcherImpl")}static{pBr=this}static{this._maxConsecutiveWebSocketFallbacks=3}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y){super(d),this._fetcherService=e,this._telemetryService=r,this._requestLogger=n,this._logService=o,this._authenticationService=s,this._interactionService=c,this._chatQuotaService=l,this._capiClientService=u,this._configurationService=f,this._experimentationService=h,this._powerService=m,this._instantiationService=g,this._webSocketManager=A,this._otelService=y,this.connectivityCheckDelays=[1e3,1e4,1e4],this._consecutiveWebSocketRetryFallbacks=0}async fetchMany(e,r){let{debugName:n,endpoint:o,finishedCb:s,location:c,messages:l,requestOptions:u,source:d,telemetryProperties:f,userInitiatedRequest:h,interactionTypeOverride:m,conversationId:g,turnId:A,topLevelTurnId:y,useWebSocket:_,ignoreStatefulMarker:E}=e,v=m??u1t(c);_&&this._consecutiveWebSocketRetryFallbacks>=pBr._maxConsecutiveWebSocketFallbacks&&(this._logService.debug(`[ChatWebSocketManager] Disabling WebSocket for request due to ${this._consecutiveWebSocketRetryFallbacks} consecutive WebSocket failures with successful HTTP fallback.`),_=!1,E=!0),f||(f={}),f.messageSource||(f.messageSource=n);let S=_?"websocket":"http",T=f.requestId??f.messageId??(0,dBr.generateUuid)(),w=o.maxOutputTokens;u?.prediction||(u={max_tokens:w,...u}),u.prediction?.content||delete u.prediction;let R=this.preparePostOptions(u),x=o.createRequestBody({...e,ignoreStatefulMarker:E,requestId:T,postOptions:R}),k=(0,KRc.getImageTelemetryMeasurementsFromMessages)(l),D=cEe.TelemetryData.createAndMarkAsIssued({...f,...g?{conversationId:g}:{},headerRequestId:T,baseModel:o.model,uiKind:Jn.ChatLocation.toString(c)}),N=this._requestLogger.logChatRequest(n,o,{messages:e.messages,model:o.model,ourRequestId:T,location:e.location,body:x,ignoreStatefulMarker:E,isConversationRequest:e.isConversationRequest,customMetadata:e.customMetadata}),O=-1,B=new $Rc.FetchStreamRecorder(s),q=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),L,U,j,Q,Y,W,V,z;try{let ie,H=lkc(e.messages,R,o,this._configurationService,this._experimentationService);if(!H.isValid)ie={type:yn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:yn.ChatFailKind.ValidationFailed,reason:H.reason};else{let me,Oe=a(()=>me??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),Te;try{Te=await this._authenticationService.getCopilotToken()}catch{}L=Te?.username??this._authenticationService.copilotToken?.username;let te=await this._fetchAndStreamChat(o,x,D,B.callback,u.secretKey,Te,e.location,T,R.n,r,Oe,h,_,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(ie=te.result,U=te.fetcher,j=te.bytesReceived,Q=te.statusCode,Y=te.suspendEventSeen,W=te.resumeEventSeen,V=te.modelCallId,z=te.otelSpan,z?.setAttribute(cn.GenAiAttr.AGENT_NAME,n),z){let he=(x.messages??x.input)?.filter(ne=>ne.role==="user"),X=he?.[he.length-1];if(X?.content){let ne=typeof X.content=="string"?X.content:JSON.stringify(X.content);z.setAttribute(cn.CopilotChatAttr.USER_REQUEST,(0,cn.truncateForOTel)(ne,this._otelService.config.maxAttributeSizeChars))}let de=(0,cn.collectSystemTextsFromRequestBody)(x),Be=(0,cn.toSystemInstructions)(de);Be&&z.setAttribute(cn.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,cn.truncateForOTel)(JSON.stringify(Be),this._otelService.config.maxAttributeSizeChars))}if(z){let K=x.messages??x.input;if(K){let Be=K.filter(ne=>ne.role!=="system");z.setAttribute(cn.GenAiAttr.INPUT_MESSAGES,(0,cn.truncateForOTel)(JSON.stringify((0,cn.normalizeProviderMessages)(Be)),this._otelService.config.maxAttributeSizeChars))}let he=(0,cn.stringifyToolDefinitionsForOTel)(x.tools);he&&z.setAttribute(cn.GenAiAttr.TOOL_DEFINITIONS,(0,cn.truncateForOTel)(he,this._otelService.config.maxAttributeSizeChars));let X=ukc(x);X&&z.setAttribute(cn.CopilotChatAttr.REQUEST_OPTIONS,(0,cn.truncateForOTel)(JSON.stringify(X),this._otelService.config.maxAttributeSizeChars));let de=dkc(x);de&&z.setAttribute(cn.CopilotChatAttr.REQUEST_SHAPE,(0,cn.truncateForOTel)(JSON.stringify(de),this._otelService.config.maxAttributeSizeChars))}O=await Oe();let ee=d?.extensionId??akc.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:ee},tokenCount:O})}let re=Date.now()-D.issuedTime;N?.markTimeToFirstToken(re);let le,Le;switch(ie.type){case yn.FetchResponseKind.Success:{let me=await this.processSuccessfulResponse(ie,l,k,x,T,w,O,re,B,D,o,h,v,S,U,j,Y,W,V);if(me.type===Jn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){B.callback("",0,{text:"",retryReason:me.category});let Oe=me.value[0];if(Oe){let Te=me.category===FI.FilterReason.Copyright?`The previous response (copied below) was filtered due to being too similar to existing public code. Please suggest something similar in function that does not match public code. Here's the previous response: ${Oe} `:`The previous response (copied below) was filtered due to triggering our content safety filters, which looks for hateful, self-harm, sexual, or violent content. Please suggest something similar in content that does not trigger these filters. Here's the previous response: ${Oe} -`,te=[...l,{role:qRc.Raw.ChatRole.User,content:(0,uFe.toTextParts)(Te)}],ee=await this.fetchMany({...e,debugName:"retry-"+n,messages:te,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:me.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:q},r);if(N?.resolve(ee,B.deltas),ee.type===Jn.ChatFetchResponseType.Success)return ee}}return{type:Jn.ChatFetchResponseType.Filtered,category:me.category,reason:"Response got filtered.",requestId:me.requestId,serverRequestId:me.serverRequestId}}if(N?.resolve(me,B.deltas),B.firstTokenEmittedTime!==void 0&&(Le=B.firstTokenEmittedTime-D.issuedTime),me.type===Jn.ChatFetchResponseType.Success&&me.usage){typeof me.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(me.usage.copilot_usage.total_nano_aiu,y??A),le=(0,cn.normalizeResponseModel)(o.model,me.resolvedModel);let Oe={operationName:cn.GenAiOperationName.CHAT,providerName:cn.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le};me.usage.prompt_tokens&&cn.GenAiMetrics.recordTokenUsage(this._otelService,me.usage.prompt_tokens,"input",Oe),me.usage.completion_tokens&&cn.GenAiMetrics.recordTokenUsage(this._otelService,me.usage.completion_tokens,"output",Oe),z?.setAttributes({[cn.GenAiAttr.USAGE_INPUT_TOKENS]:me.usage.prompt_tokens??0,[cn.GenAiAttr.USAGE_OUTPUT_TOKENS]:me.usage.completion_tokens??0,[cn.GenAiAttr.RESPONSE_MODEL]:le??o.model,[cn.GenAiAttr.RESPONSE_ID]:me.requestId,[cn.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...me.usage.prompt_tokens_details?.cached_tokens!==void 0?{[cn.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:me.usage.prompt_tokens_details.cached_tokens}:{},...me.usage.prompt_tokens_details?.cache_creation_input_tokens!==void 0?{[cn.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:me.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[cn.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:re,[cn.GenAiAttr.REQUEST_STREAM]:!0,...Le!==void 0&&Le>0?{[cn.GenAiAttr.RESPONSE_TIME_TO_FIRST_CHUNK]:Le/1e3}:{},...me.serverRequestId?{[cn.CopilotChatAttr.SERVER_REQUEST_ID]:me.serverRequestId}:{},...me.usage.completion_tokens_details?.reasoning_tokens?{[cn.GenAiAttr.USAGE_REASONING_TOKENS]:me.usage.completion_tokens_details.reasoning_tokens,[cn.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:me.usage.completion_tokens_details.reasoning_tokens}:{},...typeof me.usage.copilot_usage?.total_nano_aiu=="number"?{[cn.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:me.usage.copilot_usage.total_nano_aiu}:{}})}if(z&&me.type===Jn.ChatFetchResponseType.Success){let Oe=B.deltas.map(K=>K.text).join(""),Te=B.deltas.filter(K=>K.copilotToolCalls?.length).flatMap(K=>K.copilotToolCalls.map(he=>({type:"tool_call",id:he.id,name:he.name,arguments:he.arguments}))),te=[];if(Oe&&te.push({type:"text",content:Oe}),te.push(...Te),te.length>0&&z.setAttribute(cn.GenAiAttr.OUTPUT_MESSAGES,(0,cn.truncateForOTel)(JSON.stringify([{role:"assistant",parts:te}]),this._otelService.config.maxAttributeSizeChars)),B.deltas.some(K=>K.thinking)){let he=B.deltas.filter(X=>X.thinking&&!(0,XRc.isEncryptedThinkingDelta)(X.thinking)&&X.thinking.text).map(X=>{let de=X.thinking;return"encrypted"in de?"":Array.isArray(de.text)?de.text.join(""):de.text??""}).join("");z.setAttribute(cn.CopilotChatAttr.REASONING_CONTENT,(0,cn.truncateForOTel)(he||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}(0,cn.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},me.type===Jn.ChatFetchResponseType.Success?{id:me.requestId,model:(0,cn.normalizeResponseModel)(o.model,me.resolvedModel),finishReasons:["stop"],inputTokens:me.usage?.prompt_tokens,outputTokens:me.usage?.completion_tokens}:void 0),z?.end(),z=void 0,re>0&&cn.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,re/1e3),Le!==void 0&&Le>0&&cn.GenAiMetrics.recordTimeToFirstChunk(this._otelService,Le/1e3,{operationName:cn.GenAiOperationName.CHAT,providerName:cn.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});for(let Oe of B.outputChunkGapsMs)cn.GenAiMetrics.recordTimePerOutputChunk(this._otelService,Oe/1e3,{operationName:cn.GenAiOperationName.CHAT,providerName:cn.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});return _&&me.type===Jn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),me}case yn.FetchResponseKind.Canceled:return aEe.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:S,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:U,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:O,tokenCountMax:w,timeToFirstToken:re,timeToFirstTokenEmitted:D&&B.firstTokenEmittedTime?B.firstTokenEmittedTime-D.issuedTime:-1,timeToCancelled:Date.now()-D.issuedTime,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,OHi.isBYOKModel)(o),isAuto:(0,s1t.isAutoModel)(o),bytesReceived:j,issuedTime:D.issuedTime,imageTelemetryMeasurements:k}),N?.resolveWithCancelation(),z?.setAttributes({[cn.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[cn.CopilotChatAttr.CANCELED]:!0}),z?.end(),z=void 0,this.processCanceledResponse(ie,T,B,f);case yn.FetchResponseKind.Failed:{let me=this.processFailedResponse(ie,T,(0,s1t.isAutoModel)(o)===1),Te=this._configurationService.getExperimentBasedConfig(KV.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(K=>parseInt(K.trim(),10)),te=q&&Q!==void 0&&Te.includes(Q),ee=q&&_&&(ie.failKind===yn.ChatFailKind.ServerError||ie.failKind===yn.ChatFailKind.Unknown);if(te||ee){let{retryResult:K}=await this._retryAfterError({opts:e,processed:me,telemetryProperties:f,requestBody:x,tokenCount:O,maxResponseTokens:w,timeToError:re,transport:S,actualFetcher:U,bytesReceived:j,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:k,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:L,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(K)return K}return aEe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:me,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:O,maxResponseTokens:w,timeToFirstToken:re,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:k,transport:S,interactionType:v,fetcher:U,bytesReceived:j,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,resumeEventSeen:W}),N?.resolve(me),me}}}catch(ie){z&&(z.setStatus(2,ie instanceof Error?ie.message:String(ie)),z.setAttribute(cn.StdAttr.ERROR_TYPE,ie instanceof Error?ie.constructor.name:"Error"),z.setAttribute(cn.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),z.recordException(ie),z.end());let H=Date.now()-D.issuedTime;ie.fetcherId&&(U=ie.fetcherId),ie.suspendEventSeen&&(Y=!0),ie.resumeEventSeen&&(W=!0);let re=this.processError(ie,T,ie.gitHubRequestId,L,(0,s1t.isAutoModel)(o)===1),le=q&&re.type===Jn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(KV.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),Le=q&&_&&(re.type===Jn.ChatFetchResponseType.NetworkError||re.type===Jn.ChatFetchResponseType.Failed);if(le||Le){let{retryResult:me,connectivityTestError:Oe,connectivityTestErrorGitHubRequestId:Te}=await this._retryAfterError({opts:e,processed:re,telemetryProperties:f,requestBody:x,tokenCount:O,maxResponseTokens:w,timeToError:H,transport:S,actualFetcher:U,bytesReceived:ie.bytesReceived,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:k,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:L,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(me)return me;f={...f,connectivityTestError:Oe,connectivityTestErrorGitHubRequestId:Te}}return re.type===Jn.ChatFetchResponseType.Canceled?aEe.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:S,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:U,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:O,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:H,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,OHi.isBYOKModel)(o),isAuto:(0,s1t.isAutoModel)(o),bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:k}):aEe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:re,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:O,maxResponseTokens:w,timeToFirstToken:H,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:k,transport:S,interactionType:v,fetcher:U,bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,resumeEventSeen:W}),N?.resolve(re),re}}async _checkNetworkConnectivity(e){let r=this.connectivityCheckDelays,n,o;for(let s of r){this._logService.info(`Waiting ${s}ms before pinging CAPI to check network connectivity...`),await new Promise(c=>setTimeout(c,s));try{let c=this._capiClientService.dotcomAPIURL!=="https://api.github.com",l=this._capiClientService.capiPingURL,u=await this._getAuthHeaders(c,l),d=await this._fetcherService.fetch(l,{headers:u,useFetcher:e,callSite:"capi-ping"});if(d.status>=200&&d.status<300)return this._logService.info("CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:n,connectivityTestErrorGitHubRequestId:o};n=`Status ${d.status}: ${d.statusText}`,o=d.headers.get("x-github-request-id")??"",this._logService.info(`CAPI ping returned status ${d.status}, retrying ping...`)}catch(c){n=(0,pBr.collectSingleLineErrorMessage)(c,!0),o=void 0,this._logService.info(`CAPI ping failed with error, retrying ping: ${n}`)}}return{retryRequest:!1,connectivityTestError:n,connectivityTestErrorGitHubRequestId:o}}async _getAuthHeaders(e,r){let n={};if(e){let o="";if(r===this._capiClientService.dotcomAPIURL)o=this._authenticationService.anyGitHubSession?.accessToken||"";else try{o=(await this._authenticationService.getCopilotToken()).token}catch{o=""}n.Authorization=`Bearer ${o}`}return n}async _retryAfterError(e){let{opts:r,processed:n,telemetryProperties:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToError:u,transport:d,actualFetcher:f,bytesReceived:h,baseTelemetry:m,streamRecorder:g,imageTelemetryMeasurements:A,retryReason:y,debugNamePrefix:_,pendingLoggedChatRequest:E,token:v,usernameToScrub:S,suspendEventSeen:T,resumeEventSeen:w,interactionType:R}=e,x=["darwin","linux"].includes(process.platform)&&n.reason.indexOf("net::ERR_NETWORK_CHANGED")!==-1,k=this._configurationService.getExperimentBasedConfig(KV.ConfigKey.TeamInternal.FallbackNodeFetchOnNetworkProcessCrash,this._experimentationService),D=n.type===Jn.ChatFetchResponseType.NetworkError&&n.isNetworkProcessCrash===!0&&k,N=x||D?"node-fetch":r.useFetcher;this._logService.info(`Retrying chat request with ${N||"default"} fetcher after: ${n.reasonDetail||n.reason}`);let O=await this._checkNetworkConnectivity(N),B=O.connectivityTestError?this.scrubErrorDetail(O.connectivityTestError,S):void 0,q=O.connectivityTestErrorGitHubRequestId;if(!O.retryRequest)return this._logService.info("Not retrying chat request as network connectivity could not be re-established."),{connectivityTestError:B,connectivityTestErrorGitHubRequestId:q};aEe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:n,telemetryProperties:o,chatEndpointInfo:r.endpoint,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:this.filterImageMessages(r.messages),imageTelemetryMeasurements:A,transport:d,interactionType:R,fetcher:f,bytesReceived:h,issuedTime:m.issuedTime,wasRetried:!0,suspendEventSeen:T,resumeEventSeen:w}),g.callback("",0,{text:"",retryReason:y});let M=await this.fetchMany({...r,useWebSocket:!1,ignoreStatefulMarker:r.useWebSocket||r.ignoreStatefulMarker,debugName:_+r.debugName,userInitiatedRequest:!1,telemetryProperties:{...o,retryAfterError:n.reasonDetail||n.reason,retryAfterErrorGitHubRequestId:n.serverRequestId,connectivityTestError:B,connectivityTestErrorGitHubRequestId:q},enableRetryOnError:!1,useFetcher:N},v);return E?.resolve(M,g.deltas),r.useWebSocket&&M.type===Jn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks++,this._logService.info(`[ChatWebSocketManager] WebSocket request failed with successful HTTP fallback (${this._consecutiveWebSocketRetryFallbacks} consecutive).`),r.conversationId&&this._webSocketManager.closeConnection(r.conversationId)),{retryResult:M,connectivityTestError:B,connectivityTestErrorGitHubRequestId:q}}async _fetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S,T,w){let x=this._configurationService.getExperimentBasedConfig(KV.ConfigKey.TeamInternal.ChatRequestPowerSaveBlocker,this._experimentationService)&&l!==Jn.ChatLocation.Other?this._powerService.acquirePowerSaveBlocker():void 0,k=!1,D=!1,N=this._powerService.onDidSuspend(()=>{k=!0,this._logService.info(`System suspended during streaming request ${u} (${Jn.ChatLocation.toString(l)})`)}),O=this._powerService.onDidResume(()=>{D=!0,this._logService.info(`System resumed during streaming request ${u} (${Jn.ChatLocation.toString(l)})`)});try{return{...await this._doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S,T,w),suspendEventSeen:k||void 0,resumeEventSeen:D||void 0}}catch(B){throw k&&(B.suspendEventSeen=!0),D&&(B.resumeEventSeen=!0),B}finally{N.dispose(),O.dispose(),x?.dispose()}}async _doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S,T,w){if(f.isCancellationRequested)return{result:{type:yn.FetchResponseKind.Canceled,reason:"before fetch request"}};let R=typeof e.urlOrRequestMetadata=="string"?(()=>{try{return new URL(e.urlOrRequestMetadata).hostname}catch{return}})():void 0,x=(0,lBr.getCurrentCapturingToken)()?.chatSessionId,k=(0,lBr.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,lBr.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[cn.GenAiAttr.OPERATION_NAME]:cn.GenAiOperationName.CHAT,[cn.GenAiAttr.PROVIDER_NAME]:cn.GenAiProviderName.GITHUB,[cn.GenAiAttr.REQUEST_MODEL]:e.model,...y??x?{[cn.GenAiAttr.CONVERSATION_ID]:y??x}:{},[cn.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[cn.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[cn.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[cn.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[cn.StdAttr.SERVER_ADDRESS]:R}:{},...y??x?{[cn.CopilotChatAttr.SESSION_ID]:y??x}:{},...x?{[cn.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...k?{[cn.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:k}:{},...D?{[cn.CopilotChatAttr.DEBUG_LOG_LABEL]:D}:{}}}),O=Date.now();try{if(this._logService.debug(`modelMaxPromptTokens ${e.modelMaxPromptTokens}`),this._logService.debug(`modelMaxResponseTokens ${r.max_tokens??2048}`),this._logService.debug(`chat model ${e.model}`),e.ownsAuthorization||(s??=c?.token),!s&&!e.ownsAuthorization){let q=(0,a1t.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${q} due to missing key`),(0,DHi.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${q} due to missing key`),{result:{type:yn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:yn.ChatFailKind.TokenExpiredOrInvalid,reason:"key is missing"}}}return g&&A&&y?{...await this._doFetchViaWebSocket(e,r,n,o,s,l,u,A,y,f,h,m,_,S,T,w),otelSpan:N}:{...await this._doFetchViaHttp(e,r,n,o,s,l,u,d,f,m,_,E,v,S),otelSpan:N}}catch(B){throw N.setStatus(2,B instanceof Error?B.message:String(B)),N.setAttribute(cn.StdAttr.ERROR_TYPE,B instanceof Error?B.constructor.name:"Error"),N.recordException(B),B}finally{let B=(Date.now()-O)/1e3;cn.GenAiMetrics.recordOperationDuration(this._otelService,B,{operationName:cn.GenAiOperationName.CHAT,providerName:cn.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_){let E=l1t(c),v=A??E,S={...s?{Authorization:`Bearer ${s}`}:{},"X-Request-Id":l,"OpenAI-Intent":E,"X-GitHub-Api-Version":"2025-05-01","X-Interaction-Id":this._interactionService.interactionId,...e.getExtraHeaders?e.getExtraHeaders(c,A):{}};S["X-Interaction-Type"]=v,S["X-Agent-Task-Id"]=l,r.messages?.some(M=>Array.isArray(M.content)?M.content.some(L=>"image_url"in L):!1)&&e.supportsVision&&(S["Copilot-Vision-Request"]="true");let T=this._webSocketManager.getOrCreateConnection(d,S,l);try{await T.connect()}catch(M){throw M.gitHubRequestId=T.gitHubRequestId,M}let w=(0,uBr.generateUuid)(),R=cEe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Jn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,cBr.getRequestId)(T.responseHeaders);x.headerRequestId=l,R.extendWithRequestId(x),x.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",x.serverExperiments);for(let[M,L]of Object.entries(r))if(!(M==="messages"||M==="input")){if(M==="tools"){R.properties[`request.option.${M}`]=(0,cn.stringifyToolsRawForTelemetry)(L)??"undefined";continue}R.properties[`request.option.${M}`]=JSON.stringify(L)??"undefined"}this._telemetryService.sendGHTelemetryEvent("request.sent",R.properties,R.measurements),r.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,hBr.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,cn.stringifyToolsRawForTelemetry)(r.tools)}),R.measurements);let k=Date.now(),D=T.sendRequest(r,{userInitiated:!!m,turnId:u,requestId:l,model:e.model,countTokens:h,tokenCountMax:e.maxOutputTokens,modelMaxPromptTokens:e.modelMaxPromptTokens,summarizedAtRoundId:y,modeChanged:_},f),N=n.extendedBy({modelCallId:w}),O=this._instantiationService.createInstance(dFe.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,dFe.getResponsesApiCompactionThresholdFromBody)(r)),B=new NHi.AsyncIterableObject(async M=>{try{await new Promise((U,j)=>{D.onEvent(Q=>{let Y=O.push(Q,o);if(Y&&((0,dFe.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,Y,N),M.emitOne(Y)),Q.type==="response.completed"){let W=Q.copilot_quota_snapshots;W&&typeof W=="object"&&this._chatQuotaService.processQuotaSnapshots(W)}}),D.onCAPIError(Q=>{let Y=new Error(`${Q.error.message} (${Q.error.code})`);Y.gitHubRequestId=x.gitHubRequestId,Y.capiWebSocketError=Q,j(Y)}),D.onError(Q=>{if(Q.gitHubRequestId=x.gitHubRequestId,(0,MHi.isCancellationError)(Q)){j(Q);return}let Y=R.extendedBy({error:Q.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",Y.properties,Y.measurements);let W=Date.now()-k;R.measurements.totalTimeMs=W,R.properties.error=Q.message,this._logService.debug(`request.error: [websocket], took ${W} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),j(Q)}),D.done.then(U,j)});let L=Date.now()-k;R.measurements.totalTimeMs=L,this._logService.debug(`request.response: [websocket], took ${L} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",R.properties,R.measurements)}finally{let L=r.messages;if((!L||L.length===0)&&r.input)try{let U=(0,dFe.responseApiInputToRawMessagesForLogging)(r);L=(0,FI.rawMessageToCAPI)(U)}catch(U){this._logService.error("Failed to convert Response API input to messages for telemetry:",U),L=[]}(0,PHi.sendEngineMessagesTelemetry)(this._telemetryService,L??[],R,!1,this._logService)}}),q=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:yn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,LHi.isCAPIWebSocketError)(q)){let M=Date.now()-k;return R.measurements.totalTimeMs=M,R.properties.error=`${q.error.message} (${q.error.code})`,this._logService.debug(`request.error: [websocket capi error], took ${M} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),{result:await this._handleWebSocketCAPIError(q,x)}}return this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),{result:{type:yn.FetchResponseKind.Success,chatCompletions:B},modelCallId:w}}async _doFetchViaHttp(e,r,n,o,s,c,l,u,d,f,h,m,g,A){let y=(0,uBr.generateUuid)(),_=await this._fetchWithInstrumentation(e,l,r,s,c,d,f,{...h,modelCallId:y},m,g,A);if(d.isCancellationRequested){try{await _.body.destroy()}catch(T){this._logService.error(T,"Error destroying stream"),this._telemetryService.sendGHTelemetryException(T,"Error destroying stream")}return{result:{type:yn.FetchResponseKind.Canceled,reason:"after fetch request"},fetcher:_.fetcher,bytesReceived:_.bytesReceived}}if(_.status===200&&this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),_.status!==200){let T=BHi(e,c,l);return this._logService.info("Request ID for failed request: "+l),{result:await this._handleError(T,_,l),fetcher:_.fetcher,bytesReceived:_.bytesReceived,statusCode:_.status}}let E=n.extendedBy({modelCallId:y}),v,S=_.headers.get("x-github-request-id")??"";try{let T=await e.processResponseFromChatEndpoint(this._telemetryService,this._logService,_,u??1,o,E,d,c);v=new NHi.AsyncIterableObject(async w=>{try{for await(let R of T)w.emitOne(R)}catch(R){throw R.fetcherId=_.fetcher,R.gitHubRequestId=S,R.bytesReceived=_.bytesReceived,R}})}catch(T){throw T.fetcherId=_.fetcher,T.gitHubRequestId=S,T.bytesReceived=_.bytesReceived,T}return _.headers.get("Copilot-Edits-Session")&&(this._authenticationService.speculativeDecodingEndpointToken=_.headers.get("Copilot-Edits-Session")??void 0),this._chatQuotaService.processQuotaHeaders(_.headers),{result:{type:yn.FetchResponseKind.Success,chatCompletions:v},fetcher:_.fetcher,bytesReceived:_.bytesReceived,modelCallId:y}}async _fetchWithInstrumentation(e,r,n,o,s,c,l,u,d,f,h){let m={"X-Interaction-Id":this._interactionService.interactionId,"X-Initiator":l?"user":"agent"};n.messages?.some(_=>Array.isArray(_.content)?_.content.some(E=>"image_url"in E):!1)&&e.supportsVision&&(m["Copilot-Vision-Request"]="true");let g=cEe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Jn.ChatLocation.toString(s),transport:"http",...u},{maxTokenWindow:e.modelMaxPromptTokens});for(let[_,E]of Object.entries(n))if(!(_==="messages"||_==="input")){if(_==="tools"){g.properties[`request.option.${_}`]=(0,cn.stringifyToolsRawForTelemetry)(E)??"undefined";continue}g.properties[`request.option.${_}`]=JSON.stringify(E)??"undefined"}g.properties.headerRequestId=r,this._telemetryService.sendGHTelemetryEvent("request.sent",g.properties,g.measurements),n.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,hBr.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,cn.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=l1t(s);return this._instantiationService.invokeFunction(a1t.postRequest,{endpointOrUrl:e,secretKey:o,intent:y,requestId:r,body:n,additionalHeaders:m,cancelToken:c,useFetcher:d,canRetryOnce:f,location:s,interactionTypeOverride:h}).then(_=>{let E=_.headers.get("apim-request-id");E&&this._logService.debug(`APIM request id: ${E}`);let v=_.headers.get("x-github-request-id");v&&this._logService.debug(`GH request id: ${v}`);let S=(0,cBr.getRequestId)(_.headers);S.headerRequestId=S.headerRequestId||r,g.extendWithRequestId(S),S.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",S.serverExperiments);let T=Date.now()-A;return g.measurements.totalTimeMs=T,this._logService.debug(`request.response: [${(0,a1t.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}], took ${T} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",g.properties,g.measurements),_}).catch(_=>{if(this._fetcherService.isAbortError(_))throw _;let E=g.extendedBy({error:"Network exception"});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",E.properties,E.measurements),g.properties.code=String(_.code??""),g.properties.errno=String(_.errno??""),g.properties.message=String(_.message??""),g.properties.type=String(_.type??"");let v=Date.now()-A;throw g.measurements.totalTimeMs=v,this._logService.debug(`request.response: [${(0,a1t.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}] took ${v} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",g.properties,g.measurements),_}).finally(()=>{let _=n.messages;if((!_||_.length===0)&&n.input)try{let E=(0,dFe.responseApiInputToRawMessagesForLogging)(n);_=(0,FI.rawMessageToCAPI)(E)}catch(E){this._logService.error("Failed to convert Response API input to messages for telemetry:",E),_=[]}(0,PHi.sendEngineMessagesTelemetry)(this._telemetryService,_??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,cBr.getRequestId)(r.headers);n=o.headerRequestId||n,o.headerRequestId=n,this._chatQuotaService.processQuotaHeaders(r.headers),e.properties.error=`Response status was ${r.status}`,e.properties.status=String(r.status),this._telemetryService.sendGHTelemetryEvent("request.shownWarning",e.properties,e.measurements);let s=await r.text(),c;try{c=JSON.parse(s),c=c?.error??c}catch{}let l=`Server error: ${r.status}`,u=`${l} ${s}`;if(this._logService.error(u),400<=r.status&&r.status<500){if(r.status===400&&s.includes("off_topic"))return{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.OffTopic,reason:"filtered as off_topic by intent classifier: message was not programming related"};if(r.status===401&&s.includes("authorize_url")&&c?.authorize_url)return{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.InvalidPreviousResponseId,reason:c.message||"Invalid previous response ID",data:c};if(r.status===401||r.status===403)return this._authenticationService.resetCopilotToken(r.status),{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.TokenExpiredOrInvalid,reason:c?.message||`token expired or invalid: ${r.status}`};if(r.status===402){this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(r.status),await this._authenticationService.getCopilotToken());let d=r.headers.get("retry-after"),h=a(m=>{if(!m)return;let g=new Date(m);if(!isNaN(g.getDate()))return g;let A=parseInt(m,10);if(!isNaN(A))return new Date(Date.now()+A*1e3)},"convertToDate")(d);return{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.QuotaExceeded,reason:c?.message??"Free tier quota exceeded",data:{capiError:c,retryAfter:h}}}if(r.status===404){let d;return c?d=JSON.stringify(c):d=s,{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service +`,te=[...l,{role:HRc.Raw.ChatRole.User,content:(0,uFe.toTextParts)(Te)}],ee=await this.fetchMany({...e,debugName:"retry-"+n,messages:te,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:me.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:q},r);if(N?.resolve(ee,B.deltas),ee.type===Jn.ChatFetchResponseType.Success)return ee}}return{type:Jn.ChatFetchResponseType.Filtered,category:me.category,reason:"Response got filtered.",requestId:me.requestId,serverRequestId:me.serverRequestId}}if(N?.resolve(me,B.deltas),B.firstTokenEmittedTime!==void 0&&(Le=B.firstTokenEmittedTime-D.issuedTime),me.type===Jn.ChatFetchResponseType.Success&&me.usage){typeof me.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(me.usage.copilot_usage.total_nano_aiu,y??A),le=(0,cn.normalizeResponseModel)(o.model,me.resolvedModel);let Oe={operationName:cn.GenAiOperationName.CHAT,providerName:cn.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le};me.usage.prompt_tokens&&cn.GenAiMetrics.recordTokenUsage(this._otelService,me.usage.prompt_tokens,"input",Oe),me.usage.completion_tokens&&cn.GenAiMetrics.recordTokenUsage(this._otelService,me.usage.completion_tokens,"output",Oe),z?.setAttributes({[cn.GenAiAttr.USAGE_INPUT_TOKENS]:me.usage.prompt_tokens??0,[cn.GenAiAttr.USAGE_OUTPUT_TOKENS]:me.usage.completion_tokens??0,[cn.GenAiAttr.RESPONSE_MODEL]:le??o.model,[cn.GenAiAttr.RESPONSE_ID]:me.requestId,[cn.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...me.usage.prompt_tokens_details?.cached_tokens!==void 0?{[cn.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:me.usage.prompt_tokens_details.cached_tokens}:{},...me.usage.prompt_tokens_details?.cache_creation_input_tokens!==void 0?{[cn.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:me.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[cn.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:re,[cn.GenAiAttr.REQUEST_STREAM]:!0,...Le!==void 0&&Le>0?{[cn.GenAiAttr.RESPONSE_TIME_TO_FIRST_CHUNK]:Le/1e3}:{},...me.serverRequestId?{[cn.CopilotChatAttr.SERVER_REQUEST_ID]:me.serverRequestId}:{},...me.usage.completion_tokens_details?.reasoning_tokens?{[cn.GenAiAttr.USAGE_REASONING_TOKENS]:me.usage.completion_tokens_details.reasoning_tokens,[cn.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:me.usage.completion_tokens_details.reasoning_tokens}:{},...typeof me.usage.copilot_usage?.total_nano_aiu=="number"?{[cn.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:me.usage.copilot_usage.total_nano_aiu}:{}})}if(z&&me.type===Jn.ChatFetchResponseType.Success){let Oe=B.deltas.map(K=>K.text).join(""),Te=B.deltas.filter(K=>K.copilotToolCalls?.length).flatMap(K=>K.copilotToolCalls.map(he=>({type:"tool_call",id:he.id,name:he.name,arguments:he.arguments}))),te=[];if(Oe&&te.push({type:"text",content:Oe}),te.push(...Te),te.length>0&&z.setAttribute(cn.GenAiAttr.OUTPUT_MESSAGES,(0,cn.truncateForOTel)(JSON.stringify([{role:"assistant",parts:te}]),this._otelService.config.maxAttributeSizeChars)),B.deltas.some(K=>K.thinking)){let he=B.deltas.filter(X=>X.thinking&&!(0,tkc.isEncryptedThinkingDelta)(X.thinking)&&X.thinking.text).map(X=>{let de=X.thinking;return"encrypted"in de?"":Array.isArray(de.text)?de.text.join(""):de.text??""}).join("");z.setAttribute(cn.CopilotChatAttr.REASONING_CONTENT,(0,cn.truncateForOTel)(he||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}(0,cn.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},me.type===Jn.ChatFetchResponseType.Success?{id:me.requestId,model:(0,cn.normalizeResponseModel)(o.model,me.resolvedModel),finishReasons:["stop"],inputTokens:me.usage?.prompt_tokens,outputTokens:me.usage?.completion_tokens}:void 0),z?.end(),z=void 0,re>0&&cn.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,re/1e3),Le!==void 0&&Le>0&&cn.GenAiMetrics.recordTimeToFirstChunk(this._otelService,Le/1e3,{operationName:cn.GenAiOperationName.CHAT,providerName:cn.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});for(let Oe of B.outputChunkGapsMs)cn.GenAiMetrics.recordTimePerOutputChunk(this._otelService,Oe/1e3,{operationName:cn.GenAiOperationName.CHAT,providerName:cn.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});return _&&me.type===Jn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),me}case yn.FetchResponseKind.Canceled:return aEe.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:S,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:U,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:O,tokenCountMax:w,timeToFirstToken:re,timeToFirstTokenEmitted:D&&B.firstTokenEmittedTime?B.firstTokenEmittedTime-D.issuedTime:-1,timeToCancelled:Date.now()-D.issuedTime,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,BHi.isBYOKModel)(o),isAuto:(0,a1t.isAutoModel)(o),bytesReceived:j,issuedTime:D.issuedTime,imageTelemetryMeasurements:k}),N?.resolveWithCancelation(),z?.setAttributes({[cn.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[cn.CopilotChatAttr.CANCELED]:!0}),z?.end(),z=void 0,this.processCanceledResponse(ie,T,B,f);case yn.FetchResponseKind.Failed:{let me=this.processFailedResponse(ie,T,(0,a1t.isAutoModel)(o)===1),Te=this._configurationService.getExperimentBasedConfig(JV.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(K=>parseInt(K.trim(),10)),te=q&&Q!==void 0&&Te.includes(Q),ee=q&&_&&(ie.failKind===yn.ChatFailKind.ServerError||ie.failKind===yn.ChatFailKind.Unknown);if(te||ee){let{retryResult:K}=await this._retryAfterError({opts:e,processed:me,telemetryProperties:f,requestBody:x,tokenCount:O,maxResponseTokens:w,timeToError:re,transport:S,actualFetcher:U,bytesReceived:j,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:k,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:L,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(K)return K}return aEe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:me,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:O,maxResponseTokens:w,timeToFirstToken:re,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:k,transport:S,interactionType:v,fetcher:U,bytesReceived:j,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,resumeEventSeen:W}),N?.resolve(me),me}}}catch(ie){z&&(z.setStatus(2,ie instanceof Error?ie.message:String(ie)),z.setAttribute(cn.StdAttr.ERROR_TYPE,ie instanceof Error?ie.constructor.name:"Error"),z.setAttribute(cn.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),z.recordException(ie),z.end());let H=Date.now()-D.issuedTime;ie.fetcherId&&(U=ie.fetcherId),ie.suspendEventSeen&&(Y=!0),ie.resumeEventSeen&&(W=!0);let re=this.processError(ie,T,ie.gitHubRequestId,L,(0,a1t.isAutoModel)(o)===1),le=q&&re.type===Jn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(JV.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),Le=q&&_&&(re.type===Jn.ChatFetchResponseType.NetworkError||re.type===Jn.ChatFetchResponseType.Failed);if(le||Le){let{retryResult:me,connectivityTestError:Oe,connectivityTestErrorGitHubRequestId:Te}=await this._retryAfterError({opts:e,processed:re,telemetryProperties:f,requestBody:x,tokenCount:O,maxResponseTokens:w,timeToError:H,transport:S,actualFetcher:U,bytesReceived:ie.bytesReceived,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:k,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:L,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(me)return me;f={...f,connectivityTestError:Oe,connectivityTestErrorGitHubRequestId:Te}}return re.type===Jn.ChatFetchResponseType.Canceled?aEe.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:S,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:U,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:O,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:H,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,BHi.isBYOKModel)(o),isAuto:(0,a1t.isAutoModel)(o),bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:k}):aEe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:re,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:O,maxResponseTokens:w,timeToFirstToken:H,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:k,transport:S,interactionType:v,fetcher:U,bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,resumeEventSeen:W}),N?.resolve(re),re}}async _checkNetworkConnectivity(e){let r=this.connectivityCheckDelays,n,o;for(let s of r){this._logService.info(`Waiting ${s}ms before pinging CAPI to check network connectivity...`),await new Promise(c=>setTimeout(c,s));try{let c=this._capiClientService.dotcomAPIURL!=="https://api.github.com",l=this._capiClientService.capiPingURL,u=await this._getAuthHeaders(c,l),d=await this._fetcherService.fetch(l,{headers:u,useFetcher:e,callSite:"capi-ping"});if(d.status>=200&&d.status<300)return this._logService.info("CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:n,connectivityTestErrorGitHubRequestId:o};n=`Status ${d.status}: ${d.statusText}`,o=d.headers.get("x-github-request-id")??"",this._logService.info(`CAPI ping returned status ${d.status}, retrying ping...`)}catch(c){n=(0,hBr.collectSingleLineErrorMessage)(c,!0),o=void 0,this._logService.info(`CAPI ping failed with error, retrying ping: ${n}`)}}return{retryRequest:!1,connectivityTestError:n,connectivityTestErrorGitHubRequestId:o}}async _getAuthHeaders(e,r){let n={};if(e){let o="";if(r===this._capiClientService.dotcomAPIURL)o=this._authenticationService.anyGitHubSession?.accessToken||"";else try{o=(await this._authenticationService.getCopilotToken()).token}catch{o=""}n.Authorization=`Bearer ${o}`}return n}async _retryAfterError(e){let{opts:r,processed:n,telemetryProperties:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToError:u,transport:d,actualFetcher:f,bytesReceived:h,baseTelemetry:m,streamRecorder:g,imageTelemetryMeasurements:A,retryReason:y,debugNamePrefix:_,pendingLoggedChatRequest:E,token:v,usernameToScrub:S,suspendEventSeen:T,resumeEventSeen:w,interactionType:R}=e,x=["darwin","linux"].includes(process.platform)&&n.reason.indexOf("net::ERR_NETWORK_CHANGED")!==-1,k=this._configurationService.getExperimentBasedConfig(JV.ConfigKey.TeamInternal.FallbackNodeFetchOnNetworkProcessCrash,this._experimentationService),D=n.type===Jn.ChatFetchResponseType.NetworkError&&n.isNetworkProcessCrash===!0&&k,N=x||D?"node-fetch":r.useFetcher;this._logService.info(`Retrying chat request with ${N||"default"} fetcher after: ${n.reasonDetail||n.reason}`);let O=await this._checkNetworkConnectivity(N),B=O.connectivityTestError?this.scrubErrorDetail(O.connectivityTestError,S):void 0,q=O.connectivityTestErrorGitHubRequestId;if(!O.retryRequest)return this._logService.info("Not retrying chat request as network connectivity could not be re-established."),{connectivityTestError:B,connectivityTestErrorGitHubRequestId:q};aEe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:n,telemetryProperties:o,chatEndpointInfo:r.endpoint,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:this.filterImageMessages(r.messages),imageTelemetryMeasurements:A,transport:d,interactionType:R,fetcher:f,bytesReceived:h,issuedTime:m.issuedTime,wasRetried:!0,suspendEventSeen:T,resumeEventSeen:w}),g.callback("",0,{text:"",retryReason:y});let M=await this.fetchMany({...r,useWebSocket:!1,ignoreStatefulMarker:r.useWebSocket||r.ignoreStatefulMarker,debugName:_+r.debugName,userInitiatedRequest:!1,telemetryProperties:{...o,retryAfterError:n.reasonDetail||n.reason,retryAfterErrorGitHubRequestId:n.serverRequestId,connectivityTestError:B,connectivityTestErrorGitHubRequestId:q},enableRetryOnError:!1,useFetcher:N},v);return E?.resolve(M,g.deltas),r.useWebSocket&&M.type===Jn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks++,this._logService.info(`[ChatWebSocketManager] WebSocket request failed with successful HTTP fallback (${this._consecutiveWebSocketRetryFallbacks} consecutive).`),r.conversationId&&this._webSocketManager.closeConnection(r.conversationId)),{retryResult:M,connectivityTestError:B,connectivityTestErrorGitHubRequestId:q}}async _fetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S,T,w){let x=this._configurationService.getExperimentBasedConfig(JV.ConfigKey.TeamInternal.ChatRequestPowerSaveBlocker,this._experimentationService)&&l!==Jn.ChatLocation.Other?this._powerService.acquirePowerSaveBlocker():void 0,k=!1,D=!1,N=this._powerService.onDidSuspend(()=>{k=!0,this._logService.info(`System suspended during streaming request ${u} (${Jn.ChatLocation.toString(l)})`)}),O=this._powerService.onDidResume(()=>{D=!0,this._logService.info(`System resumed during streaming request ${u} (${Jn.ChatLocation.toString(l)})`)});try{return{...await this._doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S,T,w),suspendEventSeen:k||void 0,resumeEventSeen:D||void 0}}catch(B){throw k&&(B.suspendEventSeen=!0),D&&(B.resumeEventSeen=!0),B}finally{N.dispose(),O.dispose(),x?.dispose()}}async _doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S,T,w){if(f.isCancellationRequested)return{result:{type:yn.FetchResponseKind.Canceled,reason:"before fetch request"}};let R=typeof e.urlOrRequestMetadata=="string"?(()=>{try{return new URL(e.urlOrRequestMetadata).hostname}catch{return}})():void 0,x=(0,uBr.getCurrentCapturingToken)()?.chatSessionId,k=(0,uBr.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,uBr.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[cn.GenAiAttr.OPERATION_NAME]:cn.GenAiOperationName.CHAT,[cn.GenAiAttr.PROVIDER_NAME]:cn.GenAiProviderName.GITHUB,[cn.GenAiAttr.REQUEST_MODEL]:e.model,...y??x?{[cn.GenAiAttr.CONVERSATION_ID]:y??x}:{},[cn.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[cn.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[cn.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[cn.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[cn.StdAttr.SERVER_ADDRESS]:R}:{},...y??x?{[cn.CopilotChatAttr.SESSION_ID]:y??x}:{},...x?{[cn.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...k?{[cn.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:k}:{},...D?{[cn.CopilotChatAttr.DEBUG_LOG_LABEL]:D}:{}}}),O=Date.now();try{if(this._logService.debug(`modelMaxPromptTokens ${e.modelMaxPromptTokens}`),this._logService.debug(`modelMaxResponseTokens ${r.max_tokens??2048}`),this._logService.debug(`chat model ${e.model}`),e.ownsAuthorization||(s??=c?.token),!s&&!e.ownsAuthorization){let q=(0,c1t.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${q} due to missing key`),(0,MHi.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${q} due to missing key`),{result:{type:yn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:yn.ChatFailKind.TokenExpiredOrInvalid,reason:"key is missing"}}}return g&&A&&y?{...await this._doFetchViaWebSocket(e,r,n,o,s,l,u,A,y,f,h,m,_,S,T,w),otelSpan:N}:{...await this._doFetchViaHttp(e,r,n,o,s,l,u,d,f,m,_,E,v,S),otelSpan:N}}catch(B){throw N.setStatus(2,B instanceof Error?B.message:String(B)),N.setAttribute(cn.StdAttr.ERROR_TYPE,B instanceof Error?B.constructor.name:"Error"),N.recordException(B),B}finally{let B=(Date.now()-O)/1e3;cn.GenAiMetrics.recordOperationDuration(this._otelService,B,{operationName:cn.GenAiOperationName.CHAT,providerName:cn.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_){let E=u1t(c),v=A??E,S={...s?{Authorization:`Bearer ${s}`}:{},"X-Request-Id":l,"OpenAI-Intent":E,"X-GitHub-Api-Version":"2025-05-01","X-Interaction-Id":this._interactionService.interactionId,...e.getExtraHeaders?e.getExtraHeaders(c,A):{}};S["X-Interaction-Type"]=v,S["X-Agent-Task-Id"]=l,r.messages?.some(M=>Array.isArray(M.content)?M.content.some(L=>"image_url"in L):!1)&&e.supportsVision&&(S["Copilot-Vision-Request"]="true");let T=this._webSocketManager.getOrCreateConnection(d,S,l);try{await T.connect()}catch(M){throw M.gitHubRequestId=T.gitHubRequestId,M}let w=(0,dBr.generateUuid)(),R=cEe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Jn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,lBr.getRequestId)(T.responseHeaders);x.headerRequestId=l,R.extendWithRequestId(x),x.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",x.serverExperiments);for(let[M,L]of Object.entries(r))if(!(M==="messages"||M==="input")){if(M==="tools"){R.properties[`request.option.${M}`]=(0,cn.stringifyToolsRawForTelemetry)(L)??"undefined";continue}R.properties[`request.option.${M}`]=JSON.stringify(L)??"undefined"}this._telemetryService.sendGHTelemetryEvent("request.sent",R.properties,R.measurements),r.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,mBr.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,cn.stringifyToolsRawForTelemetry)(r.tools)}),R.measurements);let k=Date.now(),D=T.sendRequest(r,{userInitiated:!!m,turnId:u,requestId:l,model:e.model,countTokens:h,tokenCountMax:e.maxOutputTokens,modelMaxPromptTokens:e.modelMaxPromptTokens,summarizedAtRoundId:y,modeChanged:_},f),N=n.extendedBy({modelCallId:w}),O=this._instantiationService.createInstance(dFe.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,dFe.getResponsesApiCompactionThresholdFromBody)(r)),B=new OHi.AsyncIterableObject(async M=>{try{await new Promise((U,j)=>{D.onEvent(Q=>{let Y=O.push(Q,o);if(Y&&((0,dFe.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,Y,N),M.emitOne(Y)),Q.type==="response.completed"){let W=Q.copilot_quota_snapshots;W&&typeof W=="object"&&this._chatQuotaService.processQuotaSnapshots(W)}}),D.onCAPIError(Q=>{let Y=new Error(`${Q.error.message} (${Q.error.code})`);Y.gitHubRequestId=x.gitHubRequestId,Y.capiWebSocketError=Q,j(Y)}),D.onError(Q=>{if(Q.gitHubRequestId=x.gitHubRequestId,(0,LHi.isCancellationError)(Q)){j(Q);return}let Y=R.extendedBy({error:Q.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",Y.properties,Y.measurements);let W=Date.now()-k;R.measurements.totalTimeMs=W,R.properties.error=Q.message,this._logService.debug(`request.error: [websocket], took ${W} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),j(Q)}),D.done.then(U,j)});let L=Date.now()-k;R.measurements.totalTimeMs=L,this._logService.debug(`request.response: [websocket], took ${L} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",R.properties,R.measurements)}finally{let L=r.messages;if((!L||L.length===0)&&r.input)try{let U=(0,dFe.responseApiInputToRawMessagesForLogging)(r);L=(0,FI.rawMessageToCAPI)(U)}catch(U){this._logService.error("Failed to convert Response API input to messages for telemetry:",U),L=[]}(0,NHi.sendEngineMessagesTelemetry)(this._telemetryService,L??[],R,!1,this._logService)}}),q=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:yn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,FHi.isCAPIWebSocketError)(q)){let M=Date.now()-k;return R.measurements.totalTimeMs=M,R.properties.error=`${q.error.message} (${q.error.code})`,this._logService.debug(`request.error: [websocket capi error], took ${M} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),{result:await this._handleWebSocketCAPIError(q,x)}}return this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),{result:{type:yn.FetchResponseKind.Success,chatCompletions:B},modelCallId:w}}async _doFetchViaHttp(e,r,n,o,s,c,l,u,d,f,h,m,g,A){let y=(0,dBr.generateUuid)(),_=await this._fetchWithInstrumentation(e,l,r,s,c,d,f,{...h,modelCallId:y},m,g,A);if(d.isCancellationRequested){try{await _.body.destroy()}catch(T){this._logService.error(T,"Error destroying stream"),this._telemetryService.sendGHTelemetryException(T,"Error destroying stream")}return{result:{type:yn.FetchResponseKind.Canceled,reason:"after fetch request"},fetcher:_.fetcher,bytesReceived:_.bytesReceived}}if(_.status===200&&this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),_.status!==200){let T=UHi(e,c,l);return this._logService.info("Request ID for failed request: "+l),{result:await this._handleError(T,_,l),fetcher:_.fetcher,bytesReceived:_.bytesReceived,statusCode:_.status}}let E=n.extendedBy({modelCallId:y}),v,S=_.headers.get("x-github-request-id")??"";try{let T=await e.processResponseFromChatEndpoint(this._telemetryService,this._logService,_,u??1,o,E,d,c);v=new OHi.AsyncIterableObject(async w=>{try{for await(let R of T)w.emitOne(R)}catch(R){throw R.fetcherId=_.fetcher,R.gitHubRequestId=S,R.bytesReceived=_.bytesReceived,R}})}catch(T){throw T.fetcherId=_.fetcher,T.gitHubRequestId=S,T.bytesReceived=_.bytesReceived,T}return _.headers.get("Copilot-Edits-Session")&&(this._authenticationService.speculativeDecodingEndpointToken=_.headers.get("Copilot-Edits-Session")??void 0),this._chatQuotaService.processQuotaHeaders(_.headers),{result:{type:yn.FetchResponseKind.Success,chatCompletions:v},fetcher:_.fetcher,bytesReceived:_.bytesReceived,modelCallId:y}}async _fetchWithInstrumentation(e,r,n,o,s,c,l,u,d,f,h){let m={"X-Interaction-Id":this._interactionService.interactionId,"X-Initiator":l?"user":"agent"};n.messages?.some(_=>Array.isArray(_.content)?_.content.some(E=>"image_url"in E):!1)&&e.supportsVision&&(m["Copilot-Vision-Request"]="true");let g=cEe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Jn.ChatLocation.toString(s),transport:"http",...u},{maxTokenWindow:e.modelMaxPromptTokens});for(let[_,E]of Object.entries(n))if(!(_==="messages"||_==="input")){if(_==="tools"){g.properties[`request.option.${_}`]=(0,cn.stringifyToolsRawForTelemetry)(E)??"undefined";continue}g.properties[`request.option.${_}`]=JSON.stringify(E)??"undefined"}g.properties.headerRequestId=r,this._telemetryService.sendGHTelemetryEvent("request.sent",g.properties,g.measurements),n.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,mBr.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,cn.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=u1t(s);return this._instantiationService.invokeFunction(c1t.postRequest,{endpointOrUrl:e,secretKey:o,intent:y,requestId:r,body:n,additionalHeaders:m,cancelToken:c,useFetcher:d,canRetryOnce:f,location:s,interactionTypeOverride:h}).then(_=>{let E=_.headers.get("apim-request-id");E&&this._logService.debug(`APIM request id: ${E}`);let v=_.headers.get("x-github-request-id");v&&this._logService.debug(`GH request id: ${v}`);let S=(0,lBr.getRequestId)(_.headers);S.headerRequestId=S.headerRequestId||r,g.extendWithRequestId(S),S.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",S.serverExperiments);let T=Date.now()-A;return g.measurements.totalTimeMs=T,this._logService.debug(`request.response: [${(0,c1t.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}], took ${T} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",g.properties,g.measurements),_}).catch(_=>{if(this._fetcherService.isAbortError(_))throw _;let E=g.extendedBy({error:"Network exception"});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",E.properties,E.measurements),g.properties.code=String(_.code??""),g.properties.errno=String(_.errno??""),g.properties.message=String(_.message??""),g.properties.type=String(_.type??"");let v=Date.now()-A;throw g.measurements.totalTimeMs=v,this._logService.debug(`request.response: [${(0,c1t.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}] took ${v} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",g.properties,g.measurements),_}).finally(()=>{let _=n.messages;if((!_||_.length===0)&&n.input)try{let E=(0,dFe.responseApiInputToRawMessagesForLogging)(n);_=(0,FI.rawMessageToCAPI)(E)}catch(E){this._logService.error("Failed to convert Response API input to messages for telemetry:",E),_=[]}(0,NHi.sendEngineMessagesTelemetry)(this._telemetryService,_??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,lBr.getRequestId)(r.headers);n=o.headerRequestId||n,o.headerRequestId=n,this._chatQuotaService.processQuotaHeaders(r.headers),e.properties.error=`Response status was ${r.status}`,e.properties.status=String(r.status),this._telemetryService.sendGHTelemetryEvent("request.shownWarning",e.properties,e.measurements);let s=await r.text(),c;try{c=JSON.parse(s),c=c?.error??c}catch{}let l=`Server error: ${r.status}`,u=`${l} ${s}`;if(this._logService.error(u),400<=r.status&&r.status<500){if(r.status===400&&s.includes("off_topic"))return{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.OffTopic,reason:"filtered as off_topic by intent classifier: message was not programming related"};if(r.status===401&&s.includes("authorize_url")&&c?.authorize_url)return{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.InvalidPreviousResponseId,reason:c.message||"Invalid previous response ID",data:c};if(r.status===401||r.status===403)return this._authenticationService.resetCopilotToken(r.status),{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.TokenExpiredOrInvalid,reason:c?.message||`token expired or invalid: ${r.status}`};if(r.status===402){this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(r.status),await this._authenticationService.getCopilotToken());let d=r.headers.get("retry-after"),h=a(m=>{if(!m)return;let g=new Date(m);if(!isNaN(g.getDate()))return g;let A=parseInt(m,10);if(!isNaN(A))return new Date(Date.now()+A*1e3)},"convertToDate")(d);return{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.QuotaExceeded,reason:c?.message??"Free tier quota exceeded",data:{capiError:c,retryAfter:h}}}if(r.status===404){let d;return c?d=JSON.stringify(c):d=s,{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service -`+s};if(r.status===424)return{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.AgentFailedDependency,reason:s};if(r.status===429){let d=s;return d=c?.message??c?.code,s.includes("extension_blocked")&&c?.code==="extension_blocked"&&c?.type==="rate_limit_error"?{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.RateLimited,reason:d,data:{retryAfter:r.headers.get("retry-after"),rateLimitKey:r.headers.get("x-ratelimit-exceeded"),capiError:c}}}if(r.status===466)return this._logService.info(s),{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,DHi.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.Unknown,reason:`Request Failed: ${r.status} ${s}`}}async processSuccessfulResponse(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S){let T=[];for await(let k of e.chatCompletions)aEe.ChatMLFetcherTelemetrySender.sendSuccessTelemetry(this._telemetryService,{chatCompletion:k,baseTelemetry:f,userInitiatedRequest:m,interactionType:g,chatEndpointInfo:h,requestBody:o,maxResponseTokens:c,promptTokenCount:l,timeToFirstToken:u,timeToFirstTokenEmitted:f&&d.firstTokenEmittedTime?d.firstTokenEmittedTime-f.issuedTime:-1,hasImageMessages:this.filterImageMessages(r),imageTelemetryMeasurements:n,transport:A,fetcher:y,bytesReceived:_,suspendEventSeen:E,resumeEventSeen:v,modelCallId:S}),this.isRepetitive(k,f?.properties)||T.push(k);let w=new Set([FI.FinishedCompletionReason.Stop,FI.FinishedCompletionReason.ClientTrimmed,FI.FinishedCompletionReason.FunctionCall,FI.FinishedCompletionReason.ToolCalls]),R=T.filter(k=>w.has(k.finishReason));if(R.length>=1)return{type:Jn.ChatFetchResponseType.Success,resolvedModel:R[0].model,usage:R.length===1?R[0].usage:void 0,value:R.map(k=>(0,uFe.getTextPart)(k.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:S};let x=T.at(0);switch(x?.finishReason){case FI.FinishedCompletionReason.ContentFilter:return{type:Jn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??FI.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(k=>(0,uFe.getTextPart)(k.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case FI.FinishedCompletionReason.Length:return{type:Jn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,uFe.getTextPart)(x.message.content)};case FI.FinishedCompletionReason.ServerError:return{type:Jn.ChatFetchResponseType.Failed,reason:"Server error. Stream terminated",requestId:s,serverRequestId:x.requestId.headerRequestId,streamError:x.error}}return{type:Jn.ChatFetchResponseType.Unknown,reason:Jn.RESPONSE_CONTAINED_NO_CHOICES,requestId:s,serverRequestId:x?.requestId.headerRequestId}}filterImageMessages(e){return e?.some(r=>Array.isArray(r.content)?r.content.some(n=>"imageUrl"in n):!1)}isRepetitive(e,r){let n=(0,c1t.calculateLineRepetitionStats)((0,uFe.getTextPart)(e.message.content)),o=(0,c1t.isRepetitive)(e.tokens);if(o){let s=cEe.TelemetryData.createAndMarkAsIssued();s.extendWithRequestId(e.requestId);let c=s.extendedBy(r);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",c.properties,c.measurements)}return n.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:e.requestId.headerRequestId,finishReason:e.finishReason},{numberOfRepetitions:n.numberOfRepetitions,lengthOfLine:n.mostRepeatedLine.length,totalLines:n.totalLines}),o}checkRepetitionInDeltas(e,r,n){let o=e.filter(u=>u.text?.length>0).map(u=>u.text).join("");if(!o||o.trim().length===0)return;let s=o.split(/\s+/).filter(u=>u.length>0),c=(0,c1t.calculateLineRepetitionStats)(o);if((0,c1t.isRepetitive)(s)){let d=cEe.TelemetryData.createAndMarkAsIssued().extendedBy(n);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",d.properties,d.measurements)}c.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:r,finishReason:"canceled"},{numberOfRepetitions:c.numberOfRepetitions,lengthOfLine:c.mostRepeatedLine.length,totalLines:c.totalLines})}processCanceledResponse(e,r,n,o){return n&&n.deltas.length>0&&this.checkRepetitionInDeltas(n.deltas,r,o),{type:Jn.ChatFetchResponseType.Canceled,reason:e.reason,requestId:r,serverRequestId:void 0}}processFailedResponse(e,r,n){let o=e.modelRequestId?.gitHubRequestId,s=e.reason;if(e.failKind===yn.ChatFailKind.RateLimited)return{type:Jn.ChatFetchResponseType.RateLimited,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,rateLimitKey:e.data?.rateLimitKey||"",isAuto:n,capiError:e.data?.capiError};if(e.failKind===yn.ChatFailKind.QuotaExceeded)return{type:Jn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===yn.ChatFailKind.OffTopic)return{type:Jn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===yn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===yn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:Jn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===yn.ChatFailKind.ServerError)return{type:Jn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===yn.ChatFailKind.ContentFilter)return{type:Jn.ChatFetchResponseType.PromptFiltered,reason:s,category:FI.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===yn.ChatFailKind.AgentUnauthorized)return{type:Jn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===yn.ChatFailKind.AgentFailedDependency)return{type:Jn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===yn.ChatFailKind.ExtensionBlocked){let c=typeof e.data?.retryAfter=="number"?e.data.retryAfter:300;return{type:Jn.ChatFetchResponseType.ExtensionBlocked,reason:s,requestId:r,retryAfter:c,learnMoreLink:e.data?.learnMoreLink??"",serverRequestId:o}}return e.failKind===yn.ChatFailKind.NotFound?{type:Jn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===yn.ChatFailKind.InvalidPreviousResponseId?{type:Jn.ChatFetchResponseType.InvalidStatefulMarker,reason:s,requestId:r,serverRequestId:o}:{type:Jn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o}}processError(e,r,n,o,s){let c=e?.capiWebSocketError;if(c)return this._handleWebSocketError(c,r,n,s);let l=this._fetcherService;if(l.isAbortError(e))return{type:Jn.ChatFetchResponseType.Canceled,reason:"network request aborted",requestId:r,serverRequestId:n};if((0,MHi.isCancellationError)(e))return{type:Jn.ChatFetchResponseType.Canceled,reason:"Got a cancellation error",requestId:r,serverRequestId:n};if(e&&(e instanceof Error&&e.message==="Premature close"||typeof e=="object"&&e.code==="ERR_STREAM_PREMATURE_CLOSE"))return{type:Jn.ChatFetchResponseType.Canceled,reason:"Stream closed prematurely",requestId:r,serverRequestId:n};this._logService.error(ekc.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,pBr.collectSingleLineErrorMessage)(e,!0),f=this.scrubErrorDetail(d,o);if(l.isInternetDisconnectedError(e))return{type:Jn.ChatFetchResponseType.NetworkError,reason:"It appears you're not connected to the internet, please check your network connection and try again.",reasonDetail:f,requestId:r,serverRequestId:n};if(l.isFetcherError(e)){let h=l.isNetworkProcessCrashedError(e);return{type:Jn.ChatFetchResponseType.NetworkError,reason:u,reasonDetail:f,requestId:r,serverRequestId:n,...h?{isNetworkProcessCrash:!0}:{}}}else return{type:Jn.ChatFetchResponseType.Failed,reason:"Error on conversation request. Check the log for more details.",reasonDetail:f,requestId:r,serverRequestId:n}}async _handleWebSocketCAPIError(e,r){let{code:n,message:o}=e.error,s={code:n,message:o},c=n.split(":")[0];return this._logService.error(`WebSocket CAPI error: ${o} (${n})`),c==="rate_limited"||c==="user_model_rate_limited"||c==="user_global_rate_limited"||c==="integration_rate_limited"||c==="model_overloaded"||c==="agent_mode_limit_exceeded"?{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.RateLimited,reason:o,data:{capiError:s}}:c==="quota_exceeded"||c==="free_quota_exceeded"||c==="overage_limit_reached"||c==="billing_not_configured"||c==="additional_spend_limit_reached"?(this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(402),await this._authenticationService.getCopilotToken()),{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o||"WebSocket server error"}`}}_handleWebSocketError(e,r,n,o){let{code:s,message:c}=e.error,l={code:s,message:c},u=s.split(":")[0];return u==="rate_limited"||u==="user_model_rate_limited"||u==="user_global_rate_limited"||u==="integration_rate_limited"||u==="model_overloaded"||u==="agent_mode_limit_exceeded"?{type:Jn.ChatFetchResponseType.RateLimited,reason:c,requestId:r,serverRequestId:n,retryAfter:void 0,rateLimitKey:"",isAuto:o,capiError:l}:u==="quota_exceeded"||u==="free_quota_exceeded"||u==="overage_limit_reached"||u==="billing_not_configured"||u==="additional_spend_limit_reached"?{type:Jn.ChatFetchResponseType.QuotaExceeded,reason:c,requestId:r,serverRequestId:n,capiError:l,retryAfter:void 0}:s==="content_filter"?{type:Jn.ChatFetchResponseType.PromptFiltered,reason:c,category:FI.FilterReason.Prompt,requestId:r,serverRequestId:n}:s==="not_found"?{type:Jn.ChatFetchResponseType.NotFound,reason:c,requestId:r,serverRequestId:n}:s==="bad_request"?{type:Jn.ChatFetchResponseType.BadRequest,reason:c,requestId:r,serverRequestId:n}:{type:Jn.ChatFetchResponseType.Failed,reason:`Request Failed: ${s} ${c||"WebSocket server error"}`,requestId:r,serverRequestId:n}}scrubErrorDetail(e,r){if(r){let n=new RegExp((0,nkc.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};UI.ChatMLFetcherImpl=mBr;UI.ChatMLFetcherImpl=mBr=fBr=QRc([aC(0,YRc.IFetcherService),aC(1,hBr.ITelemetryService),aC(2,JRc.IRequestLogger),aC(3,pBr.ILogService),aC(4,jRc.IAuthenticationService),aC(5,VRc.IInteractionService),aC(6,GRc.IChatQuotaService),aC(7,WRc.ICAPIClientService),aC(8,$Rc.IConversationOptions),aC(9,KV.IConfigurationService),aC(10,ZRc.IExperimentationService),aC(11,skc.IPowerService),aC(12,ikc.IInstantiationService),aC(13,LHi.IChatWebSocketManager),aC(14,KRc.IOTelService)],mBr);function akc(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:dBr("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:dBr("Invalid response token parameter")};let s=/^[a-zA-Z0-9_-]+$/;return e?.functions?.some(c=>!c.name.match(s))||e?.function_call?.name&&!e.function_call.name.match(s)?{isValid:!1,reason:dBr("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>KV.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${KV.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-KV.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(akc,"isValidChatPayload");function dBr(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(dBr,"asUnexpected");function BHi(t,e,r){return cEe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Jn.ChatLocation.toString(e),headerRequestId:r})}a(BHi,"createTelemetryData");function l1t(t){switch(t){case Jn.ChatLocation.Panel:return"conversation-panel";case Jn.ChatLocation.Editor:return"conversation-inline";case Jn.ChatLocation.EditingSession:return"conversation-edits";case Jn.ChatLocation.Notebook:return"conversation-notebook";case Jn.ChatLocation.Terminal:return"conversation-terminal";case Jn.ChatLocation.Other:return"conversation-other";case Jn.ChatLocation.Agent:return"conversation-agent";case Jn.ChatLocation.ResponsesProxy:return"responses-proxy";case Jn.ChatLocation.MessagesProxy:return"messages-proxy"}}a(l1t,"locationToIntent");function ckc(t){let e={};for(let r of["tool_choice","reasoning","reasoning_effort","thinking","thinking_budget","output_config","response_format","text","truncation","context_management","frequency_penalty","presence_penalty","top_logprobs","logit_bias","store","stream","stream_options","prediction","seed","parallel_tool_calls","service_tier","metadata","verbosity","snippy","state","intent","intent_threshold","include"]){let n=t[r];n!==void 0&&(e[r]=n)}return Object.keys(e).length>0?e:void 0}a(ckc,"pickCacheRelevantRequestOptions");function lkc(t){let e={};return Array.isArray(t.input)?(e.api="responses",e.inputItemCount=t.input.length,e.inputItemTypes=t.input.map(r=>{if(r&&typeof r=="object"){let n=r.type;if(typeof n=="string")return n}return"unknown"})):Array.isArray(t.messages)&&(e.api="messages",e.messageCount=t.messages.length),typeof t.previous_response_id=="string"&&(e.hasPreviousResponseId=!0),Object.keys(e).length>0?e:void 0}a(lkc,"pickRequestShapeMetadata")});var ABr=I(lEe=>{"use strict";p();Object.defineProperty(lEe,"__esModule",{value:!0});lEe.NullSimilarFilesContextService=lEe.ISimilarFilesContextService=void 0;var ukc=an();lEe.ISimilarFilesContextService=(0,ukc.createServiceIdentifier)("ISimilarFilesContextService");var gBr=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};lEe.NullSimilarFilesContextService=gBr});var yBr=I(d1t=>{"use strict";p();Object.defineProperty(d1t,"__esModule",{value:!0});d1t.IDiffService=void 0;var dkc=an();d1t.IDiffService=(0,dkc.createServiceIdentifier)("IDiffService")});var UHi=I(_Br=>{"use strict";p();Object.defineProperty(_Br,"__esModule",{value:!0});_Br.createProxyXtabEndpoint=mkc;var fkc=(yie(),Wa(Aie)),pkc=Nie(),hkc=Bie();function mkc(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:fkc.RequestType.ProxyChatCompletions},name:"xtab-proxy",vendor:"xtab",model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"unknown",capabilities:{type:"chat",family:"xtab-proxy",tokenizer:pkc.TokenizerType.O200K,limits:{max_prompt_tokens:12285,max_output_tokens:4096},supports:{streaming:!0,parallel_tool_calls:!1,tool_calls:!1,vision:!1,prediction:!0}}};return t.createInstance(hkc.ChatEndpoint,r)}a(mkc,"createProxyXtabEndpoint")});var Uie=I(f1t=>{"use strict";p();Object.defineProperty(f1t,"__esModule",{value:!0});f1t.DocumentId=void 0;var gkc=qXe(),QHi=$A(),Akc=hd(),EBr=class t{static{a(this,"DocumentId")}static{this._cache=new gkc.CachedFunction({getCacheKey:JSON.stringify},e=>new t(e.uri))}static create(e){return t._cache.get({uri:e})}constructor(e){this.uri=e,this._uri=Akc.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,QHi.basename)(this.uri)}get extension(){return(0,QHi.extname)(this.uri)}toUri(){return this._uri}};f1t.DocumentId=EBr});var vBr=I(p1t=>{"use strict";p();Object.defineProperty(p1t,"__esModule",{value:!0});p1t.NextCursorLinePrediction=void 0;var qHi;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(qHi||(p1t.NextCursorLinePrediction=qHi={}))});var h1t=I(JV=>{"use strict";p();Object.defineProperty(JV,"__esModule",{value:!0});JV.NullUndesiredModelsManager=JV.IUndesiredModelsManager=JV.IInlineEditsModelService=void 0;var jHi=an(),ykc=Fc();JV.IInlineEditsModelService=(0,jHi.createServiceIdentifier)("IInlineEditsModelService");JV.IUndesiredModelsManager=(0,jHi.createServiceIdentifier)("IUndesiredModelsManager");var CBr=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=ykc.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};JV.NullUndesiredModelsManager=CBr});var HHi=I(qU=>{"use strict";p();Object.defineProperty(qU,"__esModule",{value:!0});qU.IgnoreWhitespaceOnlyChanges=qU.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;qU.editWouldDeleteWhatWasJustInserted=_kc;qU.editIsDeletion=TBr;qU.editWouldDeleteWhatWasJustInserted2=Ekc;var bBr=class t{static{a(this,"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges")}static filterEdit(e,r){return r.filter(o=>!t._isWhitespaceOnlyChange(o,e.documentAfterEditsLines))}static _isWhitespaceOnlyChange(e,r){let n=e.lineRange.toOffsetRange().slice(r),o=e.newLines,s=o.length===0;if(s&&n.every(c=>c.trim()==="")||!s&&o.every(c=>c.trim()===""))return!0;if(n.length!==o.length)return!1;for(let c=0;c!t._isFormattingOnlyChange(e.documentAfterEditsLines,n))}static _isFormattingOnlyChange(e,r){let n=r.lineRange.toOffsetRange().slice(e).join("").replace(/\s/g,""),o=r.newLines.join("").replace(/\s/g,"");return n===o}};qU.IgnoreWhitespaceOnlyChanges=SBr;function _kc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!TBr(r))return!1;for(let n=t.recentEdits.edits.length-1;n>=0;n--){let o=t.recentEdits.edits[n],s=r.tryRebase(o);if(!s)return!0;r=s}return!1}a(_kc,"editWouldDeleteWhatWasJustInserted");function TBr(t){let e=t.replacements.reduce((n,o)=>n+o.replaceRange.length,0);return t.replacements.reduce((n,o)=>n+o.newText.length,0)===0&&e>0}a(TBr,"editIsDeletion");function Ekc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!TBr(r))return!1;let n=t.documentAfterEdits.value;for(let o=t.recentEdits.edits.length-1;o>=0;o--){let c=t.recentEdits.edits[o].inverse(n);if(c.equals(r))return!0;n=c.apply(n)}return!1}a(Ekc,"editWouldDeleteWhatWasJustInserted2")});var xBr=I(uEe=>{"use strict";p();Object.defineProperty(uEe,"__esModule",{value:!0});uEe.NulSimulationTestContext=uEe.ISimulationTestContext=void 0;var vkc=an();uEe.ISimulationTestContext=(0,vkc.createServiceIdentifier)("ISimulationTestContext");var IBr=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};uEe.NulSimulationTestContext=IBr});var g1t=I(m1t=>{"use strict";p();Object.defineProperty(m1t,"__esModule",{value:!0});m1t.BaseAlternativeNotebookContentProvider=void 0;var wBr=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};m1t.BaseAlternativeNotebookContentProvider=wBr});var kBr=I(qN=>{"use strict";p();Object.defineProperty(qN,"__esModule",{value:!0});qN.DEFAULT_WORD_REGEXP=qN.USUAL_WORD_SEPARATORS=void 0;qN.ensureValidWordDefinition=GHi;qN.setDefaultGetWordAtTextConfig=Ikc;qN.getWordAtText=$Hi;var Ckc=E$t(),bkc=Po(),Skc=Ade();qN.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Tkc(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of qN.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(Tkc,"createWordRegExp");qN.DEFAULT_WORD_REGEXP=Tkc();function GHi(t){let e=qN.DEFAULT_WORD_REGEXP;if(t&&t instanceof RegExp)if(t.global)e=t;else{let r="g";t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.unicode&&(r+="u"),e=new RegExp(t.source,r)}return e.lastIndex=0,e}a(GHi,"ensureValidWordDefinition");var RBr=new Skc.LinkedList;RBr.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Ikc(t){let e=RBr.unshift(t);return(0,bkc.toDisposable)(e)}a(Ikc,"setDefaultGetWordAtTextConfig");function $Hi(t,e,r,n,o){if(e=GHi(e),o||(o=Ckc.Iterable.first(RBr)),r.length>o.maxLen){let d=t-o.maxLen/2;return d<0?d=0:n+=d,r=r.substring(d,t+o.maxLen/2),$Hi(t,e,r,n,o)}let s=Date.now(),c=t-1-n,l=-1,u=null;for(let d=1;!(Date.now()-s>=o.timeBudget);d++){let f=c-o.windowSize*d;e.lastIndex=Math.max(0,f);let h=xkc(e,r,c,l);if(!h&&u||(u=h,f<=0))break;l=f}if(u){let d={word:u[0],startColumn:n+1+u.index,endColumn:n+1+u.index+u[0].length};return e.lastIndex=0,d}return null}a($Hi,"getWordAtText");function xkc(t,e,r,n){let o;for(;o=t.exec(e);){let s=o.index||0;if(s<=r&&t.lastIndex>=r)return o;if(n>0&&s>n)return null}return null}a(xkc,"_findRegexMatchEnclosingPosition")});var VHi=I(A1t=>{"use strict";p();Object.defineProperty(A1t,"__esModule",{value:!0});A1t.toUint8=wkc;A1t.toUint32=Rkc;function wkc(t){return t<0?0:t>255?255:t|0}a(wkc,"toUint8");function Rkc(t){return t<0?0:t>4294967295?4294967295:t|0}a(Rkc,"toUint32")});var WHi=I(ZV=>{"use strict";p();Object.defineProperty(ZV,"__esModule",{value:!0});ZV.PrefixSumIndexOfResult=ZV.ConstantTimePrefixSumComputer=ZV.PrefixSumComputer=void 0;var kkc=Ml(),dEe=VHi(),PBr=class{static{a(this,"PrefixSumComputer")}constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}getCount(){return this.values.length}insertValues(e,r){e=(0,dEe.toUint32)(e);let n=this.values,o=this.prefixSum,s=r.length;return s===0?!1:(this.values=new Uint32Array(n.length+s),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+s),this.values.set(r,e),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,r){return e=(0,dEe.toUint32)(e),r=(0,dEe.toUint32)(r),this.values[e]===r?!1:(this.values[e]=r,e-1=n.length)return!1;let s=n.length-e;return r>=s&&(r=s),r===0?!1:(this.values=new Uint32Array(n.length-r),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+r),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=(0,dEe.toUint32)(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let r=this.prefixSumValidIndex[0]+1;r===0&&(this.prefixSum[0]=this.values[0],r++),e>=this.values.length&&(e=this.values.length-1);for(let n=r;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let r=0,n=this.values.length-1,o=0,s=0,c=0;for(;r<=n;)if(o=r+(n-r)/2|0,s=this.prefixSum[o],c=s-this.values[o],e=s)r=o+1;else break;return new fEe(o,e-c)}};ZV.PrefixSumComputer=PBr;var DBr=class{static{a(this,"ConstantTimePrefixSumComputer")}constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();let r=this._indexBySum[e];if(r===void 0){let o=Math.max(0,this._values.length-1),s=o>0?this._prefixSum[o-1]:0;return new fEe(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new fEe(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,kkc.arrayInsert)(this._values,e,r),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,r=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=o+n;for(let s=0;s0?this._prefixSum[this._values.length-1]:0,this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,r){this._values[e]!==r&&(this._values[e]=r,this._invalidate(e))}};ZV.ConstantTimePrefixSumComputer=DBr;var fEe=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};ZV.PrefixSumIndexOfResult=fEe});var MBr=I(y1t=>{"use strict";p();Object.defineProperty(y1t,"__esModule",{value:!0});y1t.PositionOffsetTransformer=void 0;var zHi=ym(),YHi=W_(),Pkc=Td(),Dkc=WHi(),Qie=Qg(),NBr=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,zHi.splitLines)(e),this._eol=e.charAt(this._lines[0].length)==="\r"?`\r +`+s};if(r.status===424)return{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.AgentFailedDependency,reason:s};if(r.status===429){let d=s;return d=c?.message??c?.code,s.includes("extension_blocked")&&c?.code==="extension_blocked"&&c?.type==="rate_limit_error"?{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.RateLimited,reason:d,data:{retryAfter:r.headers.get("retry-after"),rateLimitKey:r.headers.get("x-ratelimit-exceeded"),capiError:c}}}if(r.status===466)return this._logService.info(s),{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,MHi.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:yn.FetchResponseKind.Failed,modelRequestId:o,failKind:yn.ChatFailKind.Unknown,reason:`Request Failed: ${r.status} ${s}`}}async processSuccessfulResponse(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S){let T=[];for await(let k of e.chatCompletions)aEe.ChatMLFetcherTelemetrySender.sendSuccessTelemetry(this._telemetryService,{chatCompletion:k,baseTelemetry:f,userInitiatedRequest:m,interactionType:g,chatEndpointInfo:h,requestBody:o,maxResponseTokens:c,promptTokenCount:l,timeToFirstToken:u,timeToFirstTokenEmitted:f&&d.firstTokenEmittedTime?d.firstTokenEmittedTime-f.issuedTime:-1,hasImageMessages:this.filterImageMessages(r),imageTelemetryMeasurements:n,transport:A,fetcher:y,bytesReceived:_,suspendEventSeen:E,resumeEventSeen:v,modelCallId:S}),this.isRepetitive(k,f?.properties)||T.push(k);let w=new Set([FI.FinishedCompletionReason.Stop,FI.FinishedCompletionReason.ClientTrimmed,FI.FinishedCompletionReason.FunctionCall,FI.FinishedCompletionReason.ToolCalls]),R=T.filter(k=>w.has(k.finishReason));if(R.length>=1)return{type:Jn.ChatFetchResponseType.Success,resolvedModel:R[0].model,usage:R.length===1?R[0].usage:void 0,value:R.map(k=>(0,uFe.getTextPart)(k.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:S};let x=T.at(0);switch(x?.finishReason){case FI.FinishedCompletionReason.ContentFilter:return{type:Jn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??FI.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(k=>(0,uFe.getTextPart)(k.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case FI.FinishedCompletionReason.Length:return{type:Jn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,uFe.getTextPart)(x.message.content)};case FI.FinishedCompletionReason.ServerError:return{type:Jn.ChatFetchResponseType.Failed,reason:"Server error. Stream terminated",requestId:s,serverRequestId:x.requestId.headerRequestId,streamError:x.error}}return{type:Jn.ChatFetchResponseType.Unknown,reason:Jn.RESPONSE_CONTAINED_NO_CHOICES,requestId:s,serverRequestId:x?.requestId.headerRequestId}}filterImageMessages(e){return e?.some(r=>Array.isArray(r.content)?r.content.some(n=>"imageUrl"in n):!1)}isRepetitive(e,r){let n=(0,l1t.calculateLineRepetitionStats)((0,uFe.getTextPart)(e.message.content)),o=(0,l1t.isRepetitive)(e.tokens);if(o){let s=cEe.TelemetryData.createAndMarkAsIssued();s.extendWithRequestId(e.requestId);let c=s.extendedBy(r);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",c.properties,c.measurements)}return n.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:e.requestId.headerRequestId,finishReason:e.finishReason},{numberOfRepetitions:n.numberOfRepetitions,lengthOfLine:n.mostRepeatedLine.length,totalLines:n.totalLines}),o}checkRepetitionInDeltas(e,r,n){let o=e.filter(u=>u.text?.length>0).map(u=>u.text).join("");if(!o||o.trim().length===0)return;let s=o.split(/\s+/).filter(u=>u.length>0),c=(0,l1t.calculateLineRepetitionStats)(o);if((0,l1t.isRepetitive)(s)){let d=cEe.TelemetryData.createAndMarkAsIssued().extendedBy(n);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",d.properties,d.measurements)}c.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:r,finishReason:"canceled"},{numberOfRepetitions:c.numberOfRepetitions,lengthOfLine:c.mostRepeatedLine.length,totalLines:c.totalLines})}processCanceledResponse(e,r,n,o){return n&&n.deltas.length>0&&this.checkRepetitionInDeltas(n.deltas,r,o),{type:Jn.ChatFetchResponseType.Canceled,reason:e.reason,requestId:r,serverRequestId:void 0}}processFailedResponse(e,r,n){let o=e.modelRequestId?.gitHubRequestId,s=e.reason;if(e.failKind===yn.ChatFailKind.RateLimited)return{type:Jn.ChatFetchResponseType.RateLimited,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,rateLimitKey:e.data?.rateLimitKey||"",isAuto:n,capiError:e.data?.capiError};if(e.failKind===yn.ChatFailKind.QuotaExceeded)return{type:Jn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===yn.ChatFailKind.OffTopic)return{type:Jn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===yn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===yn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:Jn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===yn.ChatFailKind.ServerError)return{type:Jn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===yn.ChatFailKind.ContentFilter)return{type:Jn.ChatFetchResponseType.PromptFiltered,reason:s,category:FI.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===yn.ChatFailKind.AgentUnauthorized)return{type:Jn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===yn.ChatFailKind.AgentFailedDependency)return{type:Jn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===yn.ChatFailKind.ExtensionBlocked){let c=typeof e.data?.retryAfter=="number"?e.data.retryAfter:300;return{type:Jn.ChatFetchResponseType.ExtensionBlocked,reason:s,requestId:r,retryAfter:c,learnMoreLink:e.data?.learnMoreLink??"",serverRequestId:o}}return e.failKind===yn.ChatFailKind.NotFound?{type:Jn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===yn.ChatFailKind.InvalidPreviousResponseId?{type:Jn.ChatFetchResponseType.InvalidStatefulMarker,reason:s,requestId:r,serverRequestId:o}:{type:Jn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o}}processError(e,r,n,o,s){let c=e?.capiWebSocketError;if(c)return this._handleWebSocketError(c,r,n,s);let l=this._fetcherService;if(l.isAbortError(e))return{type:Jn.ChatFetchResponseType.Canceled,reason:"network request aborted",requestId:r,serverRequestId:n};if((0,LHi.isCancellationError)(e))return{type:Jn.ChatFetchResponseType.Canceled,reason:"Got a cancellation error",requestId:r,serverRequestId:n};if(e&&(e instanceof Error&&e.message==="Premature close"||typeof e=="object"&&e.code==="ERR_STREAM_PREMATURE_CLOSE"))return{type:Jn.ChatFetchResponseType.Canceled,reason:"Stream closed prematurely",requestId:r,serverRequestId:n};this._logService.error(rkc.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,hBr.collectSingleLineErrorMessage)(e,!0),f=this.scrubErrorDetail(d,o);if(l.isInternetDisconnectedError(e))return{type:Jn.ChatFetchResponseType.NetworkError,reason:"It appears you're not connected to the internet, please check your network connection and try again.",reasonDetail:f,requestId:r,serverRequestId:n};if(l.isFetcherError(e)){let h=l.isNetworkProcessCrashedError(e);return{type:Jn.ChatFetchResponseType.NetworkError,reason:u,reasonDetail:f,requestId:r,serverRequestId:n,...h?{isNetworkProcessCrash:!0}:{}}}else return{type:Jn.ChatFetchResponseType.Failed,reason:"Error on conversation request. Check the log for more details.",reasonDetail:f,requestId:r,serverRequestId:n}}async _handleWebSocketCAPIError(e,r){let{code:n,message:o}=e.error,s={code:n,message:o},c=n.split(":")[0];return this._logService.error(`WebSocket CAPI error: ${o} (${n})`),c==="rate_limited"||c==="user_model_rate_limited"||c==="user_global_rate_limited"||c==="integration_rate_limited"||c==="model_overloaded"||c==="agent_mode_limit_exceeded"?{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.RateLimited,reason:o,data:{capiError:s}}:c==="quota_exceeded"||c==="free_quota_exceeded"||c==="overage_limit_reached"||c==="billing_not_configured"||c==="additional_spend_limit_reached"?(this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(402),await this._authenticationService.getCopilotToken()),{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:yn.FetchResponseKind.Failed,modelRequestId:r,failKind:yn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o||"WebSocket server error"}`}}_handleWebSocketError(e,r,n,o){let{code:s,message:c}=e.error,l={code:s,message:c},u=s.split(":")[0];return u==="rate_limited"||u==="user_model_rate_limited"||u==="user_global_rate_limited"||u==="integration_rate_limited"||u==="model_overloaded"||u==="agent_mode_limit_exceeded"?{type:Jn.ChatFetchResponseType.RateLimited,reason:c,requestId:r,serverRequestId:n,retryAfter:void 0,rateLimitKey:"",isAuto:o,capiError:l}:u==="quota_exceeded"||u==="free_quota_exceeded"||u==="overage_limit_reached"||u==="billing_not_configured"||u==="additional_spend_limit_reached"?{type:Jn.ChatFetchResponseType.QuotaExceeded,reason:c,requestId:r,serverRequestId:n,capiError:l,retryAfter:void 0}:s==="content_filter"?{type:Jn.ChatFetchResponseType.PromptFiltered,reason:c,category:FI.FilterReason.Prompt,requestId:r,serverRequestId:n}:s==="not_found"?{type:Jn.ChatFetchResponseType.NotFound,reason:c,requestId:r,serverRequestId:n}:s==="bad_request"?{type:Jn.ChatFetchResponseType.BadRequest,reason:c,requestId:r,serverRequestId:n}:{type:Jn.ChatFetchResponseType.Failed,reason:`Request Failed: ${s} ${c||"WebSocket server error"}`,requestId:r,serverRequestId:n}}scrubErrorDetail(e,r){if(r){let n=new RegExp((0,okc.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};UI.ChatMLFetcherImpl=gBr;UI.ChatMLFetcherImpl=gBr=pBr=jRc([aC(0,JRc.IFetcherService),aC(1,mBr.ITelemetryService),aC(2,XRc.IRequestLogger),aC(3,hBr.ILogService),aC(4,GRc.IAuthenticationService),aC(5,zRc.IInteractionService),aC(6,VRc.IChatQuotaService),aC(7,YRc.ICAPIClientService),aC(8,WRc.IConversationOptions),aC(9,JV.IConfigurationService),aC(10,ekc.IExperimentationService),aC(11,ckc.IPowerService),aC(12,skc.IInstantiationService),aC(13,FHi.IChatWebSocketManager),aC(14,ZRc.IOTelService)],gBr);function lkc(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:fBr("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:fBr("Invalid response token parameter")};let s=/^[a-zA-Z0-9_-]+$/;return e?.functions?.some(c=>!c.name.match(s))||e?.function_call?.name&&!e.function_call.name.match(s)?{isValid:!1,reason:fBr("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>JV.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${JV.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-JV.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(lkc,"isValidChatPayload");function fBr(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(fBr,"asUnexpected");function UHi(t,e,r){return cEe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Jn.ChatLocation.toString(e),headerRequestId:r})}a(UHi,"createTelemetryData");function u1t(t){switch(t){case Jn.ChatLocation.Panel:return"conversation-panel";case Jn.ChatLocation.Editor:return"conversation-inline";case Jn.ChatLocation.EditingSession:return"conversation-edits";case Jn.ChatLocation.Notebook:return"conversation-notebook";case Jn.ChatLocation.Terminal:return"conversation-terminal";case Jn.ChatLocation.Other:return"conversation-other";case Jn.ChatLocation.Agent:return"conversation-agent";case Jn.ChatLocation.ResponsesProxy:return"responses-proxy";case Jn.ChatLocation.MessagesProxy:return"messages-proxy"}}a(u1t,"locationToIntent");function ukc(t){let e={};for(let r of["tool_choice","reasoning","reasoning_effort","thinking","thinking_budget","output_config","response_format","text","truncation","context_management","frequency_penalty","presence_penalty","top_logprobs","logit_bias","store","stream","stream_options","prediction","seed","parallel_tool_calls","service_tier","metadata","verbosity","snippy","state","intent","intent_threshold","include"]){let n=t[r];n!==void 0&&(e[r]=n)}return Object.keys(e).length>0?e:void 0}a(ukc,"pickCacheRelevantRequestOptions");function dkc(t){let e={};return Array.isArray(t.input)?(e.api="responses",e.inputItemCount=t.input.length,e.inputItemTypes=t.input.map(r=>{if(r&&typeof r=="object"){let n=r.type;if(typeof n=="string")return n}return"unknown"})):Array.isArray(t.messages)&&(e.api="messages",e.messageCount=t.messages.length),typeof t.previous_response_id=="string"&&(e.hasPreviousResponseId=!0),Object.keys(e).length>0?e:void 0}a(dkc,"pickRequestShapeMetadata")});var yBr=I(lEe=>{"use strict";p();Object.defineProperty(lEe,"__esModule",{value:!0});lEe.NullSimilarFilesContextService=lEe.ISimilarFilesContextService=void 0;var fkc=an();lEe.ISimilarFilesContextService=(0,fkc.createServiceIdentifier)("ISimilarFilesContextService");var ABr=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};lEe.NullSimilarFilesContextService=ABr});var _Br=I(f1t=>{"use strict";p();Object.defineProperty(f1t,"__esModule",{value:!0});f1t.IDiffService=void 0;var pkc=an();f1t.IDiffService=(0,pkc.createServiceIdentifier)("IDiffService")});var qHi=I(EBr=>{"use strict";p();Object.defineProperty(EBr,"__esModule",{value:!0});EBr.createProxyXtabEndpoint=Akc;var hkc=(_ie(),Wa(yie)),mkc=Mie(),gkc=Fie();function Akc(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:hkc.RequestType.ProxyChatCompletions},name:"xtab-proxy",vendor:"xtab",model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"unknown",capabilities:{type:"chat",family:"xtab-proxy",tokenizer:mkc.TokenizerType.O200K,limits:{max_prompt_tokens:12285,max_output_tokens:4096},supports:{streaming:!0,parallel_tool_calls:!1,tool_calls:!1,vision:!1,prediction:!0}}};return t.createInstance(gkc.ChatEndpoint,r)}a(Akc,"createProxyXtabEndpoint")});var Qie=I(p1t=>{"use strict";p();Object.defineProperty(p1t,"__esModule",{value:!0});p1t.DocumentId=void 0;var ykc=qXe(),jHi=$A(),_kc=hd(),vBr=class t{static{a(this,"DocumentId")}static{this._cache=new ykc.CachedFunction({getCacheKey:JSON.stringify},e=>new t(e.uri))}static create(e){return t._cache.get({uri:e})}constructor(e){this.uri=e,this._uri=_kc.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,jHi.basename)(this.uri)}get extension(){return(0,jHi.extname)(this.uri)}toUri(){return this._uri}};p1t.DocumentId=vBr});var CBr=I(h1t=>{"use strict";p();Object.defineProperty(h1t,"__esModule",{value:!0});h1t.NextCursorLinePrediction=void 0;var HHi;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(HHi||(h1t.NextCursorLinePrediction=HHi={}))});var m1t=I(ZV=>{"use strict";p();Object.defineProperty(ZV,"__esModule",{value:!0});ZV.NullUndesiredModelsManager=ZV.IUndesiredModelsManager=ZV.IInlineEditsModelService=void 0;var GHi=an(),Ekc=Fc();ZV.IInlineEditsModelService=(0,GHi.createServiceIdentifier)("IInlineEditsModelService");ZV.IUndesiredModelsManager=(0,GHi.createServiceIdentifier)("IUndesiredModelsManager");var bBr=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=Ekc.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};ZV.NullUndesiredModelsManager=bBr});var $Hi=I(qU=>{"use strict";p();Object.defineProperty(qU,"__esModule",{value:!0});qU.IgnoreWhitespaceOnlyChanges=qU.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;qU.editWouldDeleteWhatWasJustInserted=vkc;qU.editIsDeletion=IBr;qU.editWouldDeleteWhatWasJustInserted2=Ckc;var SBr=class t{static{a(this,"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges")}static filterEdit(e,r){return r.filter(o=>!t._isWhitespaceOnlyChange(o,e.documentAfterEditsLines))}static _isWhitespaceOnlyChange(e,r){let n=e.lineRange.toOffsetRange().slice(r),o=e.newLines,s=o.length===0;if(s&&n.every(c=>c.trim()==="")||!s&&o.every(c=>c.trim()===""))return!0;if(n.length!==o.length)return!1;for(let c=0;c!t._isFormattingOnlyChange(e.documentAfterEditsLines,n))}static _isFormattingOnlyChange(e,r){let n=r.lineRange.toOffsetRange().slice(e).join("").replace(/\s/g,""),o=r.newLines.join("").replace(/\s/g,"");return n===o}};qU.IgnoreWhitespaceOnlyChanges=TBr;function vkc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!IBr(r))return!1;for(let n=t.recentEdits.edits.length-1;n>=0;n--){let o=t.recentEdits.edits[n],s=r.tryRebase(o);if(!s)return!0;r=s}return!1}a(vkc,"editWouldDeleteWhatWasJustInserted");function IBr(t){let e=t.replacements.reduce((n,o)=>n+o.replaceRange.length,0);return t.replacements.reduce((n,o)=>n+o.newText.length,0)===0&&e>0}a(IBr,"editIsDeletion");function Ckc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!IBr(r))return!1;let n=t.documentAfterEdits.value;for(let o=t.recentEdits.edits.length-1;o>=0;o--){let c=t.recentEdits.edits[o].inverse(n);if(c.equals(r))return!0;n=c.apply(n)}return!1}a(Ckc,"editWouldDeleteWhatWasJustInserted2")});var wBr=I(uEe=>{"use strict";p();Object.defineProperty(uEe,"__esModule",{value:!0});uEe.NulSimulationTestContext=uEe.ISimulationTestContext=void 0;var bkc=an();uEe.ISimulationTestContext=(0,bkc.createServiceIdentifier)("ISimulationTestContext");var xBr=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};uEe.NulSimulationTestContext=xBr});var A1t=I(g1t=>{"use strict";p();Object.defineProperty(g1t,"__esModule",{value:!0});g1t.BaseAlternativeNotebookContentProvider=void 0;var RBr=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};g1t.BaseAlternativeNotebookContentProvider=RBr});var PBr=I(qN=>{"use strict";p();Object.defineProperty(qN,"__esModule",{value:!0});qN.DEFAULT_WORD_REGEXP=qN.USUAL_WORD_SEPARATORS=void 0;qN.ensureValidWordDefinition=VHi;qN.setDefaultGetWordAtTextConfig=wkc;qN.getWordAtText=WHi;var Skc=v$t(),Tkc=Po(),Ikc=yde();qN.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function xkc(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of qN.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(xkc,"createWordRegExp");qN.DEFAULT_WORD_REGEXP=xkc();function VHi(t){let e=qN.DEFAULT_WORD_REGEXP;if(t&&t instanceof RegExp)if(t.global)e=t;else{let r="g";t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.unicode&&(r+="u"),e=new RegExp(t.source,r)}return e.lastIndex=0,e}a(VHi,"ensureValidWordDefinition");var kBr=new Ikc.LinkedList;kBr.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function wkc(t){let e=kBr.unshift(t);return(0,Tkc.toDisposable)(e)}a(wkc,"setDefaultGetWordAtTextConfig");function WHi(t,e,r,n,o){if(e=VHi(e),o||(o=Skc.Iterable.first(kBr)),r.length>o.maxLen){let d=t-o.maxLen/2;return d<0?d=0:n+=d,r=r.substring(d,t+o.maxLen/2),WHi(t,e,r,n,o)}let s=Date.now(),c=t-1-n,l=-1,u=null;for(let d=1;!(Date.now()-s>=o.timeBudget);d++){let f=c-o.windowSize*d;e.lastIndex=Math.max(0,f);let h=Rkc(e,r,c,l);if(!h&&u||(u=h,f<=0))break;l=f}if(u){let d={word:u[0],startColumn:n+1+u.index,endColumn:n+1+u.index+u[0].length};return e.lastIndex=0,d}return null}a(WHi,"getWordAtText");function Rkc(t,e,r,n){let o;for(;o=t.exec(e);){let s=o.index||0;if(s<=r&&t.lastIndex>=r)return o;if(n>0&&s>n)return null}return null}a(Rkc,"_findRegexMatchEnclosingPosition")});var zHi=I(y1t=>{"use strict";p();Object.defineProperty(y1t,"__esModule",{value:!0});y1t.toUint8=kkc;y1t.toUint32=Pkc;function kkc(t){return t<0?0:t>255?255:t|0}a(kkc,"toUint8");function Pkc(t){return t<0?0:t>4294967295?4294967295:t|0}a(Pkc,"toUint32")});var YHi=I(XV=>{"use strict";p();Object.defineProperty(XV,"__esModule",{value:!0});XV.PrefixSumIndexOfResult=XV.ConstantTimePrefixSumComputer=XV.PrefixSumComputer=void 0;var Dkc=Ml(),dEe=zHi(),DBr=class{static{a(this,"PrefixSumComputer")}constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}getCount(){return this.values.length}insertValues(e,r){e=(0,dEe.toUint32)(e);let n=this.values,o=this.prefixSum,s=r.length;return s===0?!1:(this.values=new Uint32Array(n.length+s),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+s),this.values.set(r,e),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,r){return e=(0,dEe.toUint32)(e),r=(0,dEe.toUint32)(r),this.values[e]===r?!1:(this.values[e]=r,e-1=n.length)return!1;let s=n.length-e;return r>=s&&(r=s),r===0?!1:(this.values=new Uint32Array(n.length-r),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+r),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=(0,dEe.toUint32)(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let r=this.prefixSumValidIndex[0]+1;r===0&&(this.prefixSum[0]=this.values[0],r++),e>=this.values.length&&(e=this.values.length-1);for(let n=r;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let r=0,n=this.values.length-1,o=0,s=0,c=0;for(;r<=n;)if(o=r+(n-r)/2|0,s=this.prefixSum[o],c=s-this.values[o],e=s)r=o+1;else break;return new fEe(o,e-c)}};XV.PrefixSumComputer=DBr;var NBr=class{static{a(this,"ConstantTimePrefixSumComputer")}constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();let r=this._indexBySum[e];if(r===void 0){let o=Math.max(0,this._values.length-1),s=o>0?this._prefixSum[o-1]:0;return new fEe(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new fEe(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,Dkc.arrayInsert)(this._values,e,r),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,r=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=o+n;for(let s=0;s0?this._prefixSum[this._values.length-1]:0,this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,r){this._values[e]!==r&&(this._values[e]=r,this._invalidate(e))}};XV.ConstantTimePrefixSumComputer=NBr;var fEe=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};XV.PrefixSumIndexOfResult=fEe});var OBr=I(_1t=>{"use strict";p();Object.defineProperty(_1t,"__esModule",{value:!0});_1t.PositionOffsetTransformer=void 0;var KHi=ym(),JHi=W_(),Nkc=Id(),Mkc=YHi(),qie=qg(),MBr=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,KHi.splitLines)(e),this._eol=e.charAt(this._lines[0].length)==="\r"?`\r `:` -`;let r=new Uint32Array(this._lines.length);for(let n=0;n=0;n--){let o=r[n],s=this.toRange(o.replaceRange);this._acceptDeleteRange(s),this._acceptInsertText(s.start,o.newText)}}_acceptDeleteRange(e){if(e.start.line===e.end.line){if(e.start.character===e.end.character)return;this._setLineText(e.start.line,this._lines[e.start.line].substring(0,e.start.character)+this._lines[e.start.line].substring(e.end.character));return}this._setLineText(e.start.line,this._lines[e.start.line].substring(0,e.start.character)+this._lines[e.end.line].substring(e.end.character)),this._lines.splice(e.start.line+1,e.end.line-e.start.line),this._lineStarts.removeValues(e.start.line+1,e.end.line-e.start.line)}_acceptInsertText(e,r){if(r.length===0)return;let n=(0,zHi.splitLines)(r);if(n.length===1){this._setLineText(e.line,this._lines[e.line].substring(0,e.character)+n[0]+this._lines[e.line].substring(e.character));return}n[n.length-1]+=this._lines[e.line].substring(e.character),this._setLineText(e.line,this._lines[e.line].substring(0,e.character)+n[0]);let o=new Uint32Array(n.length-1);for(let s=1;snew Qie.TextEdit(this.validateRange(n.range),n.newText));return new YHi.StringEdit(r.map(n=>new YHi.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new Qie.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof Qie.Position))throw new Error("Invalid argument");if(this._lines.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this._lines.length)r=this._lines.length-1,n=this._lines[r].length,o=!0;else{let s=this._lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new Qie.Position(r,n):e}validateRange(e){return new Qie.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};y1t.PositionOffsetTransformer=NBr});var LBr=I(qie=>{"use strict";p();Object.defineProperty(qie,"__esModule",{value:!0});qie.SnapshotDocumentLine=qie.TextDocumentSnapshot=void 0;qie.isTextDocumentSnapshotJSON=Mkc;var _1t=CT(),JHi=hd(),KHi=kBr(),pEe=Qg(),Nkc=MBr();function Mkc(t){return!t||typeof t!="object"?!1:(0,JHi.isUriComponents)(t.uri)&&(0,_1t.isString)(t._text)&&(0,_1t.isString)(t.languageId)&&(0,_1t.isNumber)(t.version)&&(0,_1t.isNumber)(t.eol)}a(Mkc,"isTextDocumentSnapshotJSON");var OBr=class t{static{a(this,"TextDocumentSnapshot")}static create(e){return new t(e,e.uri,e.getText(),e.languageId,e.eol,e.version)}static fromNewText(e,r){return new t(r instanceof t?r.document:r,r.uri,e,r.languageId,r.eol,r.version+1)}static fromJSON(e,r){return new t(e,JHi.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new Nkc.PositionOffsetTransformer(this._text)),this._transformer}get fileName(){return this.uri.fsPath}get isUntitled(){return this.uri.scheme==="untitled"}get lineCount(){return this.lines.length}get lines(){return this._lines||(this._lines=this._text.split(/\r\n|\r|\n/g)),this._lines}constructor(e,r,n,o,s,c){this._transformer=null,this._lines=null,this.document=e,this.uri=r,this._text=n,this.languageId=o,this.eol=s,this.version=c}lineAt(e){let r;if(e instanceof pEe.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new E1t(r,this.lines[r],r===this.lines.length-1)}offsetAt(e){return this.version===this.document.version?this.document.offsetAt(e):(e=this.validatePosition(e),this.transformer.getOffset(e))}positionAt(e){return this.version===this.document.version?this.document.positionAt(e):(e=Math.floor(e),e=Math.max(0,e),this.transformer.getPosition(e))}getText(e){return e?this._getTextInRange(e):this._text}_getTextInRange(e){if(this.version===this.document.version)return this.document.getText(e);let r=this.validateRange(e);if(r.isEmpty)return"";let n=this.transformer.toOffsetRange(r);return this._text.substring(n.start,n.endExclusive)}getWordRangeAtPosition(e){let r=this.validatePosition(e),n=(0,KHi.getWordAtText)(r.character+1,KHi.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new pEe.Range(r.line,n.startColumn-1,r.line,n.endColumn-1)}validateRange(e){let r=this.validatePosition(e.start),n=this.validatePosition(e.end);return r===e.start&&n===e.end?e:new pEe.Range(r.line,r.character,n.line,n.character)}validatePosition(e){if(this._text.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this.lines.length)r=this.lines.length-1,n=this.lines[r].length,o=!0;else{let s=this.lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new pEe.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};qie.TextDocumentSnapshot=OBr;var E1t=class{static{a(this,"SnapshotDocumentLine")}constructor(e,r,n){this._line=e,this._text=r,this._isLastLine=n}get lineNumber(){return this._line}get text(){return this._text}get range(){return new pEe.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new pEe.Range(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}};qie.SnapshotDocumentLine=E1t});var b1t=I(C1t=>{"use strict";p();Object.defineProperty(C1t,"__esModule",{value:!0});C1t.AlternativeNotebookDocument=void 0;var ZHi=kBr(),v1t=Qg(),Okc=MBr(),Lkc=LBr(),BBr=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new Okc.PositionOffsetTransformer(this._text)),this._transformer}getText(e){return e?this._getTextInRange(e):this._text}_getTextInRange(e){let r=this.validateRange(e);if(r.isEmpty)return"";let n=this.transformer.toOffsetRange(r);return this._text.substring(n.start,n.endExclusive)}constructor(e,r){this._text=e,this.notebook=r,this._transformer=null,this._lines=null}positionToOffset(e){return e=this.validatePosition(e),this.transformer.getOffset(e)}getWordRangeAtPosition(e){let r=this.validatePosition(e),n=(0,ZHi.getWordAtText)(r.character+1,ZHi.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new v1t.Range(r.line,n.startColumn-1,r.line,n.endColumn-1)}get lines(){return this._lines||(this._lines=this._text.split(/\r\n|\r|\n/g)),this._lines}get lineCount(){return this.lines.length}lineAt(e){let r;if(e instanceof v1t.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new Lkc.SnapshotDocumentLine(r,this.lines[r],r===this.lines.length-1)}offsetAt(e){return this.transformer.getOffset(e)}positionAt(e){return e=Math.floor(e),e=Math.max(0,e),this.transformer.getPosition(e)}validateRange(e){let r=this.validatePosition(e.start),n=this.validatePosition(e.end);return r===e.start&&n===e.end?e:new v1t.Range(r.line,r.character,n.line,n.character)}validatePosition(e){if(this._text.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this.lines.length)r=this.lines.length-1,n=this.lines[r].length,o=!0;else{let s=this.lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new v1t.Position(r,n):e}};C1t.AlternativeNotebookDocument=BBr});var S1t=I(hEe=>{"use strict";p();Object.defineProperty(hEe,"__esModule",{value:!0});hEe.isUri=Fkc;hEe.isLocation=FBr;hEe.toLocation=Ukc;hEe.isSymbolInformation=Qkc;var fFe=Qg(),Bkc=hd();function Fkc(t){return Bkc.URI.isUri(t)}a(Fkc,"isUri");function FBr(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(FBr,"isLocation");function Ukc(t){if(FBr(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new fFe.Location(t.uri,new fFe.Range(new fFe.Position(e.line,e.character),new fFe.Position(r.line,r.character)))}else if(FBr(t)&&t.range instanceof fFe.Range)return t}a(Ukc,"toLocation");function Qkc(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(Qkc,"isSymbolInformation")});var mFe=I(Uy=>{"use strict";p();Object.defineProperty(Uy,"__esModule",{value:!0});Uy.CellIdPatternRe=Uy.EOL=Uy.LineOfText=void 0;Uy.summarize=jkc;Uy.notebookCellToCellData=Hkc;Uy.getCellIdMap=Gkc;Uy.normalizeCellId=$kc;Uy.getNotebookId=Vkc;Uy.getCellId=qBr;Uy.getDefaultLanguage=zkc;Uy.requestHasNotebookRefs=Kkc;Uy.parseAndCleanStack=Jkc;var XHi=S1t(),nGi=G4r(),qkc=ym(),eGi=hd(),QBr=Qg(),UBr=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};Uy.LineOfText=UBr;Uy.EOL=` -`;function jkc(t){let e=t.kind===QBr.NotebookCellKind.Code?"code":"markdown",r=qBr(t),n=Wkc(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(jkc,"summarize");function Hkc(t){let e=new QBr.NotebookCellData(t.kind,t.document.getText(),t.document.languageId);return e.metadata=t.metadata,e.executionSummary=t.executionSummary,t.outputs.length&&(e.outputs=[...t.outputs]),e}a(Hkc,"notebookCellToCellData");function Gkc(t){let e=new Map;return t.getCells().forEach(r=>{e.set(qBr(r),r)}),e}a(Gkc,"getCellIdMap");var tGi=new WeakMap,hFe=8,pFe="#VSC-";Uy.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${hFe}})\\b`,"gi");function $kc(t){return t.startsWith(pFe)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===hFe+3?`${pFe}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===hFe+7?`${pFe}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===hFe?`${pFe}${t}`:t}a($kc,"normalizeCellId");var rGi=new WeakMap;function Vkc(t){let e=rGi.get(t);if(e)return e;let r=new nGi.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),rGi.set(t,e),e}a(Vkc,"getNotebookId");function qBr(t){let e=tGi.get(t);if(e)return e;let r=new nGi.StringSHA1;return r.update(t.document.uri.toString()),e=`${pFe}${r.digest().substring(0,hFe)}`,tGi.set(t,e),e}a(qBr,"getCellId");function Wkc(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(Wkc,"getCellCode");function zkc(t){let e=t.getCells().find(r=>r.kind===QBr.NotebookCellKind.Code);if(e)return e.document.languageId;if(t.notebookType==="jupyter-notebook")return t.metadata?.language_info?.name||t.metadata?.kernelspec?.language||"python"}a(zkc,"getDefaultLanguage");var Ykc=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function Kkc(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&Ykc.some(o=>n.includes(o))?!0:t.references.some(o=>(0,XHi.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,eGi.isUriComponents)(o.value)?e.hasSupportedNotebooks(eGi.URI.revive(o.value)):(0,XHi.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(Kkc,"requestHasNotebookRefs");function Jkc(t){try{let e=JSON.parse(t);return(0,qkc.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(Jkc,"parseAndCleanStack")});var sGi=I(gFe=>{"use strict";p();Object.defineProperty(gFe,"__esModule",{value:!0});gFe.AlternativeJsonNotebookContentProvider=void 0;gFe.isJsonContent=rPc;var Zkc=(cpr(),Wa(FZn)),Xkc=pl(),iGi=hd(),jN=Qg(),ePc=g1t(),tPc=b1t(),mEe=mFe(),oGi=4;function rPc(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(rPc,"isJsonContent");var T1t=class extends tPc.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,mEe.getCellId)(e),o=this.getText(),s=" ",c=`"id": "${n}",`,l=o.indexOf('"source": [',o.indexOf(c)),u=this.positionAt(l).line+1,d=e.document.getText(new jN.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new jN.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},jBr=class extends ePc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeJsonNotebookContentProvider")}constructor(){super("json")}stripCellMarkers(e){return e}parseAlternateContent(e,r,n){return this.parseAlternateContentImpl(e,r,n)}getAlternativeDocumentFromText(e,r){return new T1t(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==jN.NotebookCellKind.Markup:!0).map(c=>{let l=(0,mEe.summarize)(c),u=nPc(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,oGi);return new T1t(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,mEe.summarize)(c);l.source.length&&l.source[0].trim().length?l.source=[l.source[0],s]:l.source.length&&l.source.some(d=>d.trim().length)?l.source=[s,l.source.filter(d=>d.trim().length)[0],s]:l.source=[s];let u=JSON.stringify(l,void 0,oGi).split(/\r?\n/).map(d=>` ${d}`);o.push(...u),o.push(",")}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.push(" ]"),o.push("}"),o.join(mEe.EOL)}parseAlternateContentImpl(e,r,n){return new Xkc.AsyncIterableObject(async o=>{let s=iGi.URI.isUri(e)?new Map:(0,mEe.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:jN.NotebookCellKind.Code,source:[]},f=iGi.URI.isUri(e)?"python":(0,mEe.getDefaultLanguage)(e),h=a(g=>{d.language=d.language||f,d.id&&s.get(d.id)?.document.languageId===d.language?c.has(d.id)?d.id="":c.add(d.id):d.id="";let A=s.get(d.id);d.uri=A?.document.uri,d.kind=A?.kind||(d.language==="markdown"?jN.NotebookCellKind.Markup:jN.NotebookCellKind.Code),o.emitOne({index:d.index,type:"start",kind:d.kind,language:d.language,uri:d.uri,id:d.id}),d.source.forEach(y=>o.emitOne({index:d.index,type:"line",line:y})),o.emitOne({index:d.index,type:"end"})},"emitCell"),m=0;for await(let g of r){if(n.isCancellationRequested)break;let A=g.value;l+=A,(0,Zkc.visit)(l,{onObjectEnd(y,_,E,v){m=y},onLiteralValue:a((y,_,E,v,S,T)=>{if(u>=_)return;let w=T();if(w.length<2||w.shift()!=="cells")return;let R=w.shift();if(typeof R!="number")return;let x=w.shift();if(u=_,d.index!==-1&&d.index!==R&&(h(_),d.startOffset=_,d.id=void 0,d.kind=jN.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?jN.NotebookCellKind.Code:jN.NotebookCellKind.Markup,d.kind===jN.NotebookCellKind.Markup&&(d.language="markdown");else if(x==="id")d.id=y;else if(x==="metadata"&&w[0]==="id")d.id=y;else if(x==="metadata"&&w[0]==="language")d.language=y,d.language==="markdown"&&(d.kind=jN.NotebookCellKind.Markup);else if(x==="source"&&w.length&&typeof w[0]=="number"){w[0]===0&&(d.startOffset=_);let k=typeof y=="string"?y:`${y||""}`;k.endsWith(` -`)&&(k=k.substr(0,k.length-1)),d.source.push(k)}},"onLiteralValue")})}d.index!==-1&&h(m)})}};gFe.AlternativeJsonNotebookContentProvider=jBr;function nPc(t){if(t.lineCount===0)return[];if(t.lineCount===1)return[t.lineAt(0).text];let e=t.lineCount;return new Array(e).fill("").map((r,n)=>t.lineAt(n).text)}a(nPc,"getCellCode")});var GBr=I(XV=>{"use strict";p();Object.defineProperty(XV,"__esModule",{value:!0});XV.wellKnownLanguages=void 0;XV.getLanguage=aGi;XV.getLanguageForResource=sPc;var iPc=x2(),oPc=Object.freeze({abap:{lineComment:{start:"'"},markdownLanguageIds:["abap","sap-abap"]},bat:{lineComment:{start:"REM"},alternativeLineComments:[{start:"::"}],aliases:["Batch","bat"],extensions:[".bat",".cmd"]},bibtex:{lineComment:{start:"%"},aliases:["BibTeX","bibtex"],extensions:[".bib"]},blade:{lineComment:{start:"#"}},c:{lineComment:{start:"//"},aliases:["C","c"],extensions:[".c",".i"],markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";"},aliases:["Clojure","clojure"],extensions:[".clj",".cljs",".cljc",".cljx",".clojure",".edn"],markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//"},aliases:["CoffeeScript","coffeescript","coffee"],extensions:[".coffee",".cson",".iced"],markdownLanguageIds:["coffeescript","coffee","cson","iced"],blockComment:["###","###"]},cpp:{lineComment:{start:"//"},aliases:["C++","Cpp","cpp"],extensions:[".cpp",".cc",".cxx",".c++",".hpp",".hh",".hxx",".h++",".h",".ii",".ino",".inl",".ipp",".ixx",".tpp",".txx",".hpp.in",".h.in"],markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"],blockComment:["/*","*/"]},csharp:{lineComment:{start:"//"},aliases:["C#","csharp"],extensions:[".cs",".csx",".cake"],markdownLanguageIds:["csharp","cs"],blockComment:["/*","*/"]},css:{lineComment:{start:"/*",end:"*/"},aliases:["CSS","css"],extensions:[".css"],blockComment:["/*","*/"]},dart:{lineComment:{start:"//"},aliases:["Dart"],extensions:[".dart"],blockComment:["/*","*/"]},dockerfile:{lineComment:{start:"#"},aliases:["Docker","Dockerfile","Containerfile"],extensions:[".dockerfile",".containerfile"],markdownLanguageIds:["dockerfile","docker"]},elixir:{lineComment:{start:"#"}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%"},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//"},aliases:["F#","FSharp","fsharp"],extensions:[".fs",".fsi",".fsx",".fsscript"],markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"],blockComment:["(*","*)"]},go:{lineComment:{start:"//"},aliases:["Go"],extensions:[".go"],markdownLanguageIds:["go","golang"],blockComment:["/*","*/"]},groovy:{lineComment:{start:"//"},aliases:["Groovy","groovy"],extensions:[".groovy",".gvy",".gradle",".jenkinsfile",".nf"],blockComment:["/*","*/"]},haml:{lineComment:{start:"-#"}},handlebars:{lineComment:{start:"{{!",end:"}}"},extensions:[".hbs",".handlebars"],markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"],blockComment:["{{!--","--}}"]},haskell:{lineComment:{start:"--"},markdownLanguageIds:["haskell","hs"]},html:{lineComment:{start:""},aliases:["HTML","htm","html","xhtml"],extensions:[".html",".htm",".shtml",".xhtml",".xht",".mdoc",".jsp",".asp",".aspx",".jshtm",".volt",".ejs",".rhtml"],markdownLanguageIds:["html","xhtml"],blockComment:[""]},ini:{lineComment:{start:";"},blockComment:[";"," "]},java:{lineComment:{start:"//"},extensions:[".java",".class"],markdownLanguageIds:["java","jsp"],blockComment:["/*","*/"]},javascript:{lineComment:{start:"//"},aliases:["JavaScript","javascript","js"],extensions:[".js",".es6",".mjs",".cjs",".pac"],markdownLanguageIds:["javascript","js"],blockComment:["/*","*/"]},javascriptreact:{lineComment:{start:"//"},aliases:["JavaScript JSX","JavaScript React","jsx"],extensions:[".jsx"],markdownLanguageIds:["jsx"]},json:{extensions:[".json"],lineComment:{start:"//"},blockComment:["/*","*/"]},jsonc:{lineComment:{start:"//"}},jsx:{lineComment:{start:"//"},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#"},aliases:["Julia","julia"],extensions:[".jl"],markdownLanguageIds:["julia","jl"],blockComment:["#=","=#"]},kotlin:{lineComment:{start:"//"},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%"},aliases:["LaTeX","latex"],extensions:[".tex",".ltx",".ctx"],markdownLanguageIds:["tex"]},less:{lineComment:{start:"//"},aliases:["Less","less"],extensions:[".less"],blockComment:["/*","*/"]},lua:{lineComment:{start:"--"},aliases:["Lua","lua"],extensions:[".lua"],markdownLanguageIds:["lua","pluto"],blockComment:["--[[","]]"]},makefile:{lineComment:{start:"#"},aliases:["Makefile","makefile"],extensions:[".mak",".mk"],markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:""},alternativeLineComments:[{start:"[]: #"}],aliases:["Markdown","markdown"],extensions:[".md",".mkd",".mdwn",".mdown",".markdown",".markdn",".mdtxt",".mdtext",".workbook"],markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//"},aliases:["Objective-C"],extensions:[".m"],markdownLanguageIds:["objectivec","mm","objc","obj-c"],blockComment:["/*","*/"]},"objective-cpp":{lineComment:{start:"//"},aliases:["Objective-C++"],extensions:[".mm"],markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#"},aliases:["Perl","perl"],extensions:[".pl",".pm",".pod",".t",".PL",".psgi"],markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//"},aliases:["PHP","php"],extensions:[".php",".php4",".php5",".phtml",".ctp"],blockComment:["/*","*/"]},powershell:{lineComment:{start:"#"},aliases:["PowerShell","powershell","ps","ps1"],extensions:[".ps1",".psm1",".psd1",".pssc",".psrc"],markdownLanguageIds:["powershell","ps","ps1"],blockComment:["<#","#>"]},pug:{lineComment:{start:"//"}},python:{lineComment:{start:"#"},aliases:["Python","py"],extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi",".pyi",".ipy",".pyt"],markdownLanguageIds:["python","py","gyp"],blockComment:['"""','"""']},ql:{lineComment:{start:"//"}},r:{lineComment:{start:"#"},aliases:["R","r"],extensions:[".r",".rhistory",".rprofile",".rt"]},razor:{lineComment:{start:""},aliases:["Razor","razor"],extensions:[".cshtml",".razor"],markdownLanguageIds:["cshtml","razor","razor-cshtml"],blockComment:[""]},ruby:{lineComment:{start:"#"},aliases:["Ruby","rb"],extensions:[".rb",".rbx",".rjs",".gemspec",".rake",".ru",".erb",".podspec",".rbi"],markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"],blockComment:["=begin","=end"]},rust:{lineComment:{start:"//"},aliases:["Rust","rust"],extensions:[".rs"],markdownLanguageIds:["rust","rs"],blockComment:["/*","*/"]},sass:{lineComment:{start:"//"}},scala:{lineComment:{start:"//"}},scss:{lineComment:{start:"//"},aliases:["SCSS","scss"],extensions:[".scss"],blockComment:["/*","*/"]},shellscript:{lineComment:{start:"#"},aliases:["Shell Script","shellscript","bash","fish","sh","zsh","ksh","csh"],extensions:[".sh",".bash",".bashrc",".bash_aliases",".bash_profile",".bash_login",".ebuild",".profile",".bash_logout",".xprofile",".xsession",".xsessionrc",".Xsession",".zsh",".zshrc",".zprofile",".zlogin",".zlogout",".zshenv",".zsh-theme",".fish",".ksh",".csh",".cshrc",".tcshrc",".yashrc",".yash_profile"],markdownLanguageIds:["bash","sh","zsh"]},slim:{lineComment:{start:"/"}},solidity:{lineComment:{start:"//"},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--"},aliases:["SQL"],extensions:[".sql",".dsql"],blockComment:["/*","*/"]},stylus:{lineComment:{start:"//"}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//"},aliases:["Swift","swift"],extensions:[".swift"],blockComment:["/*","*/"]},terraform:{lineComment:{start:"#"}},tex:{lineComment:{start:"%"},aliases:["TeX","tex"],extensions:[".sty",".cls",".bbx",".cbx"]},typescript:{lineComment:{start:"//"},aliases:["TypeScript","ts","typescript"],extensions:[".ts",".cts",".mts"],markdownLanguageIds:["typescript","ts"],blockComment:["/*","*/"]},typescriptreact:{lineComment:{start:"//"},aliases:["TypeScript JSX","TypeScript React","tsx"],extensions:[".tsx"],markdownLanguageIds:["tsx"],blockComment:["/*","*/"]},vb:{lineComment:{start:"'"},aliases:["Visual Basic","vb"],extensions:[".vb",".brs",".vbs",".bas",".vba"],markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//"}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//"},extensions:[".vue"]},xml:{lineComment:{start:""},aliases:["XML","xml"],extensions:[".xml",".xsd",".ascx",".atom",".axml",".axaml",".bpmn",".cpt",".csl",".csproj",".csproj.user",".dita",".ditamap",".dtd",".ent",".mod",".dtml",".fsproj",".fxml",".iml",".isml",".jmx",".launch",".menu",".mxml",".nuspec",".opml",".owl",".proj",".props",".pt",".publishsettings",".pubxml",".pubxml.user",".rbxlx",".rbxmx",".rdf",".rng",".rss",".shproj",".storyboard",".svg",".targets",".tld",".tmx",".vbproj",".vbproj.user",".vcxproj",".vcxproj.filters",".wsdl",".wxi",".wxl",".wxs",".xaml",".xbl",".xib",".xlf",".xliff",".xpdl",".xul",".xoml"],blockComment:[""]},xsl:{lineComment:{start:""},aliases:["XSL","xsl"],extensions:[".xsl",".xslt"]},yaml:{lineComment:{start:"#"},markdownLanguageIds:["yaml","yml"]}});XV.wellKnownLanguages=new Map(Object.entries(oPc).map(([t,e])=>[t,{languageId:t,...e}]));function aGi(t){return HBr(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(aGi,"getLanguage");function HBr(t){return XV.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a(HBr,"_getLanguage");function sPc(t){let e=(0,iPc.extname)(t).toLowerCase();for(let r of XV.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return aGi("plaintext")}a(sPc,"getLanguageForResource")});var uGi=I(eW=>{"use strict";p();Object.defineProperty(eW,"__esModule",{value:!0});eW.AlternativeTextNotebookContentProvider=void 0;eW.generateCellTextMarker=WBr;eW.lineMightHaveCellMarker=zBr;eW.getBlockComment=AEe;eW.getLineCommentStart=yEe;var VBr=GBr(),aPc=S1t(),cPc=dj(),gEe=Qg(),lPc=g1t(),uPc=b1t(),Jm=mFe();function WBr(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(WBr,"generateCellTextMarker");function zBr(t){return t.toLowerCase().includes("vscode.cell")}a(zBr,"lineMightHaveCellMarker");var I1t=class extends uPc.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,Jm.summarize)(e),o=yEe(this.notebook),s=WBr(n,o),c=e.document.eol===gEe.EndOfLine.LF?1:2,l=AEe(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===gEe.NotebookCellKind.Markup?l[0].length+c:0,h=u.indexOf(s)+s.length+c+f+d;return this.positionAt(h)}toCellPosition(e){let r=this.offsetAt(e),n=(0,cPc.findLast)(this.cellOffsetMap,s=>s.sourceOffset<=r);if(!n)return;let o=n.cell.document.positionAt(r-n.sourceOffset);return{cell:n.cell,position:o}}},$Br=class extends lPc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(Jm.EOL);return r.length&&zBr(r[0])?(r.shift(),r.join(Jm.EOL)):e}getSummaryOfStructure(e,r,n){let o=AEe(e),s=yEe(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,Jm.summarize)(u);d.source.length&&d.source[0].trim().length?d.source=[d.source[0],c]:d.source.length&&d.source.some(f=>f.trim().length)?d.source=[c,d.source.filter(f=>f.trim().length)[0],c]:d.source=[c],l.push(cGi(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(Jm.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,aPc.isUri)(e),s=o?(0,Jm.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=yEe(o?e:void 0),m=AEe(o?e:void 0),g=o?(0,VBr.getLanguage)((0,Jm.getDefaultLanguage)(e)).languageId:void 0,A=new Set;for await(let y of r){if(n.isCancellationRequested)break;let _=y.value,E=_.startsWith(`${h}%% [`)&&_.trimEnd().endsWith("]"),v=_.startsWith(`${h}%% vscode.cell`),S=v||E?lGi(_,g):void 0;if((v||E)&&S?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:gEe.NotebookCellKind.Code,emitted:!1,type:"start"};T.index=f+=1,T.emitted=!1,S.id&&s.get(S.id)?.document.languageId===S.language?A.has(S.id)?S.id="":A.add(S.id):S.id="";let w=s.get(S.id);T.id=S.id,T.language=S.language,T.uri=w?.document.uri,T.kind=w?.kind||(T.language==="markdown"?gEe.NotebookCellKind.Markup:gEe.NotebookCellKind.Code),c=T.language==="markdown",l=!1,d&&(yield{index:f-1,type:"end"}),d=!0,yield T;continue}d&&(c?l?_===m[1]?(l=!1,u=!0):yield{index:f,line:_,type:"line"}:_===m[0]?l=!0:yield{index:f,line:_,type:"line"}:yield{index:f,line:_,type:"line"})}d&&(yield{index:f,type:"end"})}getAlternativeDocumentFromText(e,r){let n=AEe(r),o=yEe(r),s=(0,Jm.getCellIdMap)(r),c=[],l=e.split(Jm.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(_=>_.cell===y));if(A){let y=u,_=Jm.EOL.length,E=g.language==="markdown",v=y+f.length+_+(E?n[0].length+_:0);c.push({offset:y,sourceOffset:v,cell:A})}}}u+=f.length+Jm.EOL.length}return new I1t(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==gEe.NotebookCellKind.Markup:!0).map(d=>(0,Jm.summarize)(d)),o=AEe(e),s=yEe(e),c=n.map(d=>({...cGi(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(Jm.EOL),u=c.map(d=>{let f=l.indexOf(d.content),h=f+d.prefix.length;return{offset:f,sourceOffset:h,cell:e.cellAt(d.cell.index)}});return new I1t(l,u,e)}};eW.AlternativeTextNotebookContentProvider=$Br;function cGi(t,e,r){let n=WBr(t,e),o=t.source.join(Jm.EOL),s=t.language==="markdown"?`${n}${Jm.EOL}${r[0]}${Jm.EOL}`:`${n}${Jm.EOL}`;return{content:t.language==="markdown"?`${s}${o}${Jm.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(cGi,"generateAlternativeCellTextContent");function AEe(t){return t?(0,VBr.getLanguage)((0,Jm.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a(AEe,"getBlockComment");function yEe(t){return t&&(0,VBr.getLanguage)((0,Jm.getDefaultLanguage)(t)).lineComment.start||"#"}a(yEe,"getLineCommentStart");function lGi(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:zBr(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(lGi,"extractCellParts")});var pGi=I(_Fe=>{"use strict";p();Object.defineProperty(_Fe,"__esModule",{value:!0});_Fe.AlternativeXmlNotebookContentProvider=void 0;_Fe.isXmlContent=fGi;var dPc=GBr(),fPc=S1t(),pPc=dj(),AFe=Qg(),hPc=g1t(),mPc=b1t(),mE=mFe(),yFe="`}a(YBr,"generateCellMarker");function fGi(t){return t.includes(yFe)||t.includes(tW)||t.includes(x1t)}a(fGi,"isXmlContent");var w1t=class extends mPc.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,mE.summarize)(e),o=YBr(n),s=e.document.eol===AFe.EndOfLine.LF?1:2,c=this.getText(),l=e.document.offsetAt(r),u=c.indexOf(o)+o.length+s+l;return this.positionAt(u)}toCellPosition(e){let r=this.offsetAt(e),n=(0,pPc.findLast)(this.cellOffsetMap,s=>s.offset<=r);if(!n)return;let o=n.cell.document.positionAt(r-n.offset);return{cell:n.cell,position:o}}},KBr=class extends hPc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(mE.EOL);return r.length&&(r[0].startsWith(yFe)||r[0].startsWith(x1t))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(tW)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(tW))),r.join(mE.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,mE.summarize)(c);o.push(YBr(l)),l.source.length&&l.source[0].trim().length?(o.push(l.source[0]),o.push(s)):l.source.length&&l.source.some(u=>u.trim().length)?l.source=[s,l.source.filter(u=>u.trim().length)[0],s]:o.push(s),o.push(tW)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(mE.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,fPc.isUri)(e),s=o?(0,mE.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,dPc.getLanguage)((0,mE.getDefaultLanguage)(e)).languageId:void 0;for await(let m of r){if(n.isCancellationRequested)break;let g=m.value;if((g.startsWith(yFe)||g.startsWith(x1t))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(tW)),yield f,yield{type:"end",index:f.index}),d=!1,f=void 0,c+=1,l=!1;let A={type:"start",index:c,uri:void 0,language:void 0,kind:AFe.NotebookCellKind.Code},y=dGi(g,h);y.id&&s.get(y.id)?.document.languageId===y.language?u.has(y.id)?y.id="":u.add(y.id):y.id="";let _=s.get(y.id)?.document.languageId===y.language?s.get(y.id):void 0;A.id=y.id,A.language=y.language,A.uri=_?.document.uri,A.kind=_?.kind||(A.language==="markdown"?AFe.NotebookCellKind.Markup:AFe.NotebookCellKind.Code),yield A}else g.startsWith(tW)?(d&&f&&(yield f),l=!0,d=!1,f=void 0,yield{type:"end",index:c}):c>=0&&(d&&f&&(yield f,f=void 0),d=g.endsWith(tW),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,mE.getCellIdMap)(r),o=[],s=e.split(mE.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=mE.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+mE.EOL.length}return new w1t(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==AFe.NotebookCellKind.Markup:!0).map(l=>(0,mE.summarize)(l)).map(l=>{let d=`${YBr(l)}${mE.EOL}`;return{content:`${d}${l.source.join(mE.EOL)}${mE.EOL}${tW}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(mE.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new w1t(s,c,e)}};_Fe.AlternativeXmlNotebookContentProvider=KBr;function dGi(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(fGi(t)&&typeof e=="string")return{id:r?r[1].trim():"",language:e};throw new Error(`Invalid cell part in ${t}`)}return{id:r?r[1].trim():"",language:n[1].trim()}}a(dGi,"extractCellParts")});var yGi=I(GS=>{"use strict";p();var APc=GS&&GS.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},hGi=GS&&GS.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(GS,"__esModule",{value:!0});GS.AlternativeNotebookContentService=GS.IAlternativeNotebookContentService=void 0;GS.getAlternativeNotebookDocumentProvider=ZBr;GS.inferAlternativeNotebookContentFormat=SPc;GS.getAltNotebookRange=TPc;var yPc=rSt(),_Pc=an(),EPc=Qg(),mGi=Hl(),vPc=z3e(),CPc=Rh(),gGi=sGi(),bPc=uGi(),AGi=pGi();function ZBr(t){switch(t){case"xml":return new AGi.AlternativeXmlNotebookContentProvider;case"text":return new bPc.AlternativeTextNotebookContentProvider;case"json":return new gGi.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(ZBr,"getAlternativeNotebookDocumentProvider");function SPc(t){return(0,AGi.isXmlContent)(t)?"xml":(0,gGi.isJsonContent)(t)?"json":"text"}a(SPc,"inferAlternativeNotebookContentFormat");GS.IAlternativeNotebookContentService=(0,_Pc.createServiceIdentifier)("IAlternativeNotebookContentService");var JBr=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,vPc.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig(mGi.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return ZBr(e)}};GS.AlternativeNotebookContentService=JBr;GS.AlternativeNotebookContentService=JBr=APc([hGi(0,mGi.IConfigurationService),hGi(1,CPc.IExperimentationService)],JBr);function TPc(t,e,r,n){let o=(0,yPc.findCell)(e,r);if(!o)return;let s=ZBr(n).getAlternativeDocument(r);return new EPc.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(TPc,"getAltNotebookRange")});var EGi=I(EFe=>{"use strict";p();Object.defineProperty(EFe,"__esModule",{value:!0});EFe.NotebookDocumentSnapshot=void 0;EFe.isNotebookDocumentSnapshotJSON=wPc;var R1t=CT(),IPc=hd(),XBr=Qg(),_Gi=yGi(),xPc=mFe();function wPc(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,IPc.isUriComponents)(t.uri)&&(0,R1t.isString)(t._text)&&(0,R1t.isString)(t.languageId)&&(0,R1t.isNumber)(t.version)&&(0,R1t.isString)(t.alternativeFormat)}a(wPc,"isNotebookDocumentSnapshotJSON");var e3r=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,_Gi.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,_Gi.getAlternativeNotebookDocumentProvider)(r.alternativeFormat).getAlternativeDocumentFromText(e,r.document);return new t(r.document,r.uri,r.version,r.alternativeFormat,n)}static fromJSON(e,r){return t.create(e,r.alternativeFormat)}constructor(e,r,n,o,s){this.alternativeFormat=o,this._alternativeDocument=s,this.type="notebook",this.document=e,this.uri=r,this.version=n,this.languageId=o==="text"?(0,xPc.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new XBr.Selection(0,0,this.lineCount,0)}getWholeRange(){return new XBr.Range(0,0,this.lineCount,0)}get lines(){return this._alternativeDocument.lines}get lineCount(){return this._alternativeDocument.lineCount}lineAt(e){let r;if(e instanceof XBr.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return this._alternativeDocument.lineAt(r)}offsetAt(e){return this._alternativeDocument.offsetAt(e)}positionAt(e){return this._alternativeDocument.positionAt(e)}validateRange(e){return this._alternativeDocument.validateRange(e)}validatePosition(e){return this._alternativeDocument.validatePosition(e)}toJSON(){return{type:"notebook",uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,_text:this._alternativeDocument.getText(),alternativeFormat:this.alternativeFormat}}};EFe.NotebookDocumentSnapshot=e3r});var r3r=I(cC=>{"use strict";p();var RPc=cC&&cC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kPc=cC&&cC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PPc=cC&&cC.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o"u"&&(r=this.getWorkspaceFolders().length>1);let c=(0,vGi.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return FPc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,DPc.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return BPc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>vGi.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};cC.AbstractWorkspaceService=k1t;function UPc(t,e){let r=t.getWorkspaceFolder(e);return r?OPc.posix.relative(r.path,e.path):e.path}a(UPc,"getWorkspaceFileDisplayPath");var t3r=class extends k1t{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new MPc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new rW.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new rW.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new rW.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new rW.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new rW.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new rW.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new rW.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new rW.Emitter),this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event,this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event,this.onDidOpenNotebookDocument=this.didOpenNotebookDocumentEmitter.event,this.onDidCloseNotebookDocument=this.didCloseNotebookDocumentEmitter.event,this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event,this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event,this.onDidChangeNotebookDocument=this.didChangeNotebookDocumentEmitter.event,this.onDidChangeTextEditorSelection=this.didChangeTextEditorSelectionEmitter.event,this._textDocuments=[],this._notebookDocuments=[],this.workspaceFolder=e,this._textDocuments=r,this._notebookDocuments=n}get textDocuments(){return this._textDocuments}showTextDocument(e){return Promise.resolve()}async openTextDocument(e){let r=this.textDocuments.find(n=>n.uri.toString()===e.toString());if(r)return r;throw new Error(`Unknown document: ${e}`)}async openNotebookDocument(e,r){if(typeof e=="string")throw new Error("Not implemented");{let n=this.notebookDocuments.find(o=>o.uri.toString()===e.toString());if(n)return n;throw new Error(`Unknown notebook: ${e}`)}}get notebookDocuments(){return this._notebookDocuments}getWorkspaceFolders(){return this.workspaceFolder}getWorkspaceFolderName(e){return"default"}ensureWorkspaceIsFullyLoaded(){return Promise.resolve()}showWorkspaceFolderPicker(){return Promise.resolve(void 0)}applyEdit(){return Promise.resolve(!0)}dispose(){this.disposables.dispose()}isResourceTrusted(e){return Promise.resolve(!0)}requestResourceTrust(e){return Promise.resolve(!0)}requestWorkspaceTrust(e){return Promise.resolve(!0)}};cC.NullWorkspaceService=t3r});var s3r=I(jie=>{"use strict";p();Object.defineProperty(jie,"__esModule",{value:!0});jie.BatchedProcessor=jie.TaskQueue=void 0;jie.raceFilter=QPc;var n3r=pl(),CGi=Os(),i3r=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new n3r.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new n3r.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),r.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new CGi.BugIndicatingError;this._runningTask=e.task;try{let r=await e.task();e.deferred.complete(r)}catch(r){e.deferred.error(r)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let r of e)r.setUndefinedWhenCleared?r.deferred.complete(void 0):r.deferred.error(new CGi.CancellationError)}};jie.TaskQueue=i3r;var o3r=class{static{a(this,"BatchedProcessor")}constructor(e,r){this._fn=e,this._waitingTimeMs=r,this._queue=[],this._timeout=null}request(e){this._timeout===null&&(this._timeout=setTimeout(()=>this._flush(),this._waitingTimeMs));let r=new n3r.DeferredPromise;return this._queue.push({arg:e,promise:r}),r.p}async _flush(){let e=this._queue;this._queue=[],this._timeout=null;let r=e.map(o=>o.arg),n;try{n=await this._fn(r)}catch(o){for(let s of e)s.promise.error(o);return}for(let[o,s]of n.entries())e[o].promise.complete(s)}};jie.BatchedProcessor=o3r;function QPc(t,e){return new Promise((r,n)=>{if(t.length===0){r(void 0);return}let o=!1,s=t.length;for(let c of t)c.then(l=>{s--,o||(e(l)?(o=!0,r(l)):s===0&&r(void 0))}).catch(n)})}a(QPc,"raceFilter")});var a3r=I(_Ee=>{"use strict";p();Object.defineProperty(_Ee,"__esModule",{value:!0});_Ee.AsyncIterUtilsExt=_Ee.AsyncIterUtils=void 0;var bGi;(function(t){async function*e(d,f){for await(let h of d)yield f(h)}a(e,"map"),t.map=e;async function*r(d,f,h){let m=d[Symbol.asyncIterator](),g;for(;!(g=await m.next()).done;)yield f(g.value);return h(g.value)}a(r,"mapWithReturn"),t.mapWithReturn=r;async function*n(d,f){for await(let h of d)f(h)&&(yield h)}a(n,"filter"),t.filter=n;async function o(d){let f=[];for await(let h of d)f.push(h);return f}a(o,"toArray"),t.toArray=o;async function*s(d){for(let f of d)yield f}a(s,"fromArray"),t.fromArray=s;async function*c(d,f){for(let h of d)yield h;return f}a(c,"fromArrayWithReturn"),t.fromArrayWithReturn=c;async function l(d){let f=d[Symbol.asyncIterator](),h=[],m;for(;!(m=await f.next()).done;)h.push(m.value);return[h,m.value]}a(l,"toArrayWithReturn"),t.toArrayWithReturn=l;async function u(d){let f=d[Symbol.asyncIterator](),h;do h=await f.next();while(!h.done);return h.value}a(u,"drainUntilReturn"),t.drainUntilReturn=u})(bGi||(_Ee.AsyncIterUtils=bGi={}));var SGi;(function(t){async function*e(r){let n=null;for await(let o of r){n??="",n+=o;let s=n.split(/\r?\n/);n=s.pop()??"",yield*s}n!==null&&(yield n)}a(e,"splitLines"),t.splitLines=e})(SGi||(_Ee.AsyncIterUtilsExt=SGi={}))});var l3r=I(c3r=>{"use strict";p();Object.defineProperty(c3r,"__esModule",{value:!0});c3r.backwardCompatSetting=qPc;function qPc(t,e){return e(t)}a(qPc,"backwardCompatSetting")});var IGi=I(QI=>{"use strict";p();Object.defineProperty(QI,"__esModule",{value:!0});QI.LineWithTokens=QI.Token=void 0;QI.getOrDeduceSelectionFromLastEdit=HPc;QI.clipTokensToRange=TGi;QI.clipTokensToRangeAndAdjustOffsets=$Pc;QI.removeTokensInRangeAndAdjustOffsets=VPc;QI.getTokensFromLogProbs=WPc;QI.getTokensFromLinesWithTokens=zPc;QI.mergeOffsetRangesAtDistance=YPc;var jPc=Os(),EEe=Td();function HPc(t){let e=new EEe.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):GPc(t)}a(HPc,"getOrDeduceSelectionFromLastEdit");function GPc(t){let e=t.recentEdits.edits.at(-1);if(e===void 0)return null;let r=e.replacements.at(-1);if(r===void 0)return null;let n=r.replaceRange,s=r.newText.length-n.length,c=n.endExclusive+s;return t.documentAfterEdits.getTransformer().getRange(new EEe.OffsetRange(c,c))}a(GPc,"deduceSelectionFromLastEdit");var P1t=class t{static{a(this,"Token")}get id(){return this.text+"_"+this.range.toString()}constructor(e,r,n){this.text=e,this.value=r,this.range=new EEe.OffsetRange(n,n+e.length)}equals(e){return this.range.equals(e.range)&&this.text===e.text}deltaOffset(e){return new t(this.text,this.value,this.range.start+e)}};QI.Token=P1t;function TGi(t,e){return t.filter(r=>e.intersects(r.range))}a(TGi,"clipTokensToRange");function $Pc(t,e){return TGi(t,e).map(r=>r.deltaOffset(-e.start))}a($Pc,"clipTokensToRangeAndAdjustOffsets");function VPc(t,e){let r=[];for(let n of t)e.containsRange(n.range)||(n.range.start>e.start&&(n=n.deltaOffset(-e.length)),r.push(n));return r}a(VPc,"removeTokensInRangeAndAdjustOffsets");function WPc(t,e){let r=e;return t.content.map(n=>{let o=new P1t(n.token,n.logprob,r);return r+=o.range.length,o})}a(WPc,"getTokensFromLogProbs");var u3r=class t{static{a(this,"LineWithTokens")}static stringEquals(e,r){return e._text===r._text}static fromText(e,r){r=r??[];let n=[];for(;;){let o=e.indexOf(`\r +`;let r=new Uint32Array(this._lines.length);for(let n=0;n=0;n--){let o=r[n],s=this.toRange(o.replaceRange);this._acceptDeleteRange(s),this._acceptInsertText(s.start,o.newText)}}_acceptDeleteRange(e){if(e.start.line===e.end.line){if(e.start.character===e.end.character)return;this._setLineText(e.start.line,this._lines[e.start.line].substring(0,e.start.character)+this._lines[e.start.line].substring(e.end.character));return}this._setLineText(e.start.line,this._lines[e.start.line].substring(0,e.start.character)+this._lines[e.end.line].substring(e.end.character)),this._lines.splice(e.start.line+1,e.end.line-e.start.line),this._lineStarts.removeValues(e.start.line+1,e.end.line-e.start.line)}_acceptInsertText(e,r){if(r.length===0)return;let n=(0,KHi.splitLines)(r);if(n.length===1){this._setLineText(e.line,this._lines[e.line].substring(0,e.character)+n[0]+this._lines[e.line].substring(e.character));return}n[n.length-1]+=this._lines[e.line].substring(e.character),this._setLineText(e.line,this._lines[e.line].substring(0,e.character)+n[0]);let o=new Uint32Array(n.length-1);for(let s=1;snew qie.TextEdit(this.validateRange(n.range),n.newText));return new JHi.StringEdit(r.map(n=>new JHi.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new qie.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof qie.Position))throw new Error("Invalid argument");if(this._lines.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this._lines.length)r=this._lines.length-1,n=this._lines[r].length,o=!0;else{let s=this._lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new qie.Position(r,n):e}validateRange(e){return new qie.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};_1t.PositionOffsetTransformer=MBr});var BBr=I(jie=>{"use strict";p();Object.defineProperty(jie,"__esModule",{value:!0});jie.SnapshotDocumentLine=jie.TextDocumentSnapshot=void 0;jie.isTextDocumentSnapshotJSON=Lkc;var E1t=CT(),XHi=hd(),ZHi=PBr(),pEe=qg(),Okc=OBr();function Lkc(t){return!t||typeof t!="object"?!1:(0,XHi.isUriComponents)(t.uri)&&(0,E1t.isString)(t._text)&&(0,E1t.isString)(t.languageId)&&(0,E1t.isNumber)(t.version)&&(0,E1t.isNumber)(t.eol)}a(Lkc,"isTextDocumentSnapshotJSON");var LBr=class t{static{a(this,"TextDocumentSnapshot")}static create(e){return new t(e,e.uri,e.getText(),e.languageId,e.eol,e.version)}static fromNewText(e,r){return new t(r instanceof t?r.document:r,r.uri,e,r.languageId,r.eol,r.version+1)}static fromJSON(e,r){return new t(e,XHi.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new Okc.PositionOffsetTransformer(this._text)),this._transformer}get fileName(){return this.uri.fsPath}get isUntitled(){return this.uri.scheme==="untitled"}get lineCount(){return this.lines.length}get lines(){return this._lines||(this._lines=this._text.split(/\r\n|\r|\n/g)),this._lines}constructor(e,r,n,o,s,c){this._transformer=null,this._lines=null,this.document=e,this.uri=r,this._text=n,this.languageId=o,this.eol=s,this.version=c}lineAt(e){let r;if(e instanceof pEe.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new v1t(r,this.lines[r],r===this.lines.length-1)}offsetAt(e){return this.version===this.document.version?this.document.offsetAt(e):(e=this.validatePosition(e),this.transformer.getOffset(e))}positionAt(e){return this.version===this.document.version?this.document.positionAt(e):(e=Math.floor(e),e=Math.max(0,e),this.transformer.getPosition(e))}getText(e){return e?this._getTextInRange(e):this._text}_getTextInRange(e){if(this.version===this.document.version)return this.document.getText(e);let r=this.validateRange(e);if(r.isEmpty)return"";let n=this.transformer.toOffsetRange(r);return this._text.substring(n.start,n.endExclusive)}getWordRangeAtPosition(e){let r=this.validatePosition(e),n=(0,ZHi.getWordAtText)(r.character+1,ZHi.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new pEe.Range(r.line,n.startColumn-1,r.line,n.endColumn-1)}validateRange(e){let r=this.validatePosition(e.start),n=this.validatePosition(e.end);return r===e.start&&n===e.end?e:new pEe.Range(r.line,r.character,n.line,n.character)}validatePosition(e){if(this._text.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this.lines.length)r=this.lines.length-1,n=this.lines[r].length,o=!0;else{let s=this.lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new pEe.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};jie.TextDocumentSnapshot=LBr;var v1t=class{static{a(this,"SnapshotDocumentLine")}constructor(e,r,n){this._line=e,this._text=r,this._isLastLine=n}get lineNumber(){return this._line}get text(){return this._text}get range(){return new pEe.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new pEe.Range(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}};jie.SnapshotDocumentLine=v1t});var S1t=I(b1t=>{"use strict";p();Object.defineProperty(b1t,"__esModule",{value:!0});b1t.AlternativeNotebookDocument=void 0;var eGi=PBr(),C1t=qg(),Bkc=OBr(),Fkc=BBr(),FBr=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new Bkc.PositionOffsetTransformer(this._text)),this._transformer}getText(e){return e?this._getTextInRange(e):this._text}_getTextInRange(e){let r=this.validateRange(e);if(r.isEmpty)return"";let n=this.transformer.toOffsetRange(r);return this._text.substring(n.start,n.endExclusive)}constructor(e,r){this._text=e,this.notebook=r,this._transformer=null,this._lines=null}positionToOffset(e){return e=this.validatePosition(e),this.transformer.getOffset(e)}getWordRangeAtPosition(e){let r=this.validatePosition(e),n=(0,eGi.getWordAtText)(r.character+1,eGi.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new C1t.Range(r.line,n.startColumn-1,r.line,n.endColumn-1)}get lines(){return this._lines||(this._lines=this._text.split(/\r\n|\r|\n/g)),this._lines}get lineCount(){return this.lines.length}lineAt(e){let r;if(e instanceof C1t.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new Fkc.SnapshotDocumentLine(r,this.lines[r],r===this.lines.length-1)}offsetAt(e){return this.transformer.getOffset(e)}positionAt(e){return e=Math.floor(e),e=Math.max(0,e),this.transformer.getPosition(e)}validateRange(e){let r=this.validatePosition(e.start),n=this.validatePosition(e.end);return r===e.start&&n===e.end?e:new C1t.Range(r.line,r.character,n.line,n.character)}validatePosition(e){if(this._text.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this.lines.length)r=this.lines.length-1,n=this.lines[r].length,o=!0;else{let s=this.lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new C1t.Position(r,n):e}};b1t.AlternativeNotebookDocument=FBr});var T1t=I(hEe=>{"use strict";p();Object.defineProperty(hEe,"__esModule",{value:!0});hEe.isUri=Qkc;hEe.isLocation=UBr;hEe.toLocation=qkc;hEe.isSymbolInformation=jkc;var fFe=qg(),Ukc=hd();function Qkc(t){return Ukc.URI.isUri(t)}a(Qkc,"isUri");function UBr(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(UBr,"isLocation");function qkc(t){if(UBr(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new fFe.Location(t.uri,new fFe.Range(new fFe.Position(e.line,e.character),new fFe.Position(r.line,r.character)))}else if(UBr(t)&&t.range instanceof fFe.Range)return t}a(qkc,"toLocation");function jkc(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(jkc,"isSymbolInformation")});var mFe=I(Uy=>{"use strict";p();Object.defineProperty(Uy,"__esModule",{value:!0});Uy.CellIdPatternRe=Uy.EOL=Uy.LineOfText=void 0;Uy.summarize=Gkc;Uy.notebookCellToCellData=$kc;Uy.getCellIdMap=Vkc;Uy.normalizeCellId=Wkc;Uy.getNotebookId=zkc;Uy.getCellId=jBr;Uy.getDefaultLanguage=Kkc;Uy.requestHasNotebookRefs=Zkc;Uy.parseAndCleanStack=Xkc;var tGi=T1t(),oGi=$4r(),Hkc=ym(),rGi=hd(),qBr=qg(),QBr=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};Uy.LineOfText=QBr;Uy.EOL=` +`;function Gkc(t){let e=t.kind===qBr.NotebookCellKind.Code?"code":"markdown",r=jBr(t),n=Ykc(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(Gkc,"summarize");function $kc(t){let e=new qBr.NotebookCellData(t.kind,t.document.getText(),t.document.languageId);return e.metadata=t.metadata,e.executionSummary=t.executionSummary,t.outputs.length&&(e.outputs=[...t.outputs]),e}a($kc,"notebookCellToCellData");function Vkc(t){let e=new Map;return t.getCells().forEach(r=>{e.set(jBr(r),r)}),e}a(Vkc,"getCellIdMap");var nGi=new WeakMap,hFe=8,pFe="#VSC-";Uy.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${hFe}})\\b`,"gi");function Wkc(t){return t.startsWith(pFe)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===hFe+3?`${pFe}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===hFe+7?`${pFe}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===hFe?`${pFe}${t}`:t}a(Wkc,"normalizeCellId");var iGi=new WeakMap;function zkc(t){let e=iGi.get(t);if(e)return e;let r=new oGi.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),iGi.set(t,e),e}a(zkc,"getNotebookId");function jBr(t){let e=nGi.get(t);if(e)return e;let r=new oGi.StringSHA1;return r.update(t.document.uri.toString()),e=`${pFe}${r.digest().substring(0,hFe)}`,nGi.set(t,e),e}a(jBr,"getCellId");function Ykc(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(Ykc,"getCellCode");function Kkc(t){let e=t.getCells().find(r=>r.kind===qBr.NotebookCellKind.Code);if(e)return e.document.languageId;if(t.notebookType==="jupyter-notebook")return t.metadata?.language_info?.name||t.metadata?.kernelspec?.language||"python"}a(Kkc,"getDefaultLanguage");var Jkc=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function Zkc(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&Jkc.some(o=>n.includes(o))?!0:t.references.some(o=>(0,tGi.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,rGi.isUriComponents)(o.value)?e.hasSupportedNotebooks(rGi.URI.revive(o.value)):(0,tGi.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(Zkc,"requestHasNotebookRefs");function Xkc(t){try{let e=JSON.parse(t);return(0,Hkc.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(Xkc,"parseAndCleanStack")});var cGi=I(gFe=>{"use strict";p();Object.defineProperty(gFe,"__esModule",{value:!0});gFe.AlternativeJsonNotebookContentProvider=void 0;gFe.isJsonContent=iPc;var ePc=(lpr(),Wa(QZn)),tPc=pl(),sGi=hd(),jN=qg(),rPc=A1t(),nPc=S1t(),mEe=mFe(),aGi=4;function iPc(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(iPc,"isJsonContent");var I1t=class extends nPc.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,mEe.getCellId)(e),o=this.getText(),s=" ",c=`"id": "${n}",`,l=o.indexOf('"source": [',o.indexOf(c)),u=this.positionAt(l).line+1,d=e.document.getText(new jN.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new jN.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},HBr=class extends rPc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeJsonNotebookContentProvider")}constructor(){super("json")}stripCellMarkers(e){return e}parseAlternateContent(e,r,n){return this.parseAlternateContentImpl(e,r,n)}getAlternativeDocumentFromText(e,r){return new I1t(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==jN.NotebookCellKind.Markup:!0).map(c=>{let l=(0,mEe.summarize)(c),u=oPc(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,aGi);return new I1t(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,mEe.summarize)(c);l.source.length&&l.source[0].trim().length?l.source=[l.source[0],s]:l.source.length&&l.source.some(d=>d.trim().length)?l.source=[s,l.source.filter(d=>d.trim().length)[0],s]:l.source=[s];let u=JSON.stringify(l,void 0,aGi).split(/\r?\n/).map(d=>` ${d}`);o.push(...u),o.push(",")}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.push(" ]"),o.push("}"),o.join(mEe.EOL)}parseAlternateContentImpl(e,r,n){return new tPc.AsyncIterableObject(async o=>{let s=sGi.URI.isUri(e)?new Map:(0,mEe.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:jN.NotebookCellKind.Code,source:[]},f=sGi.URI.isUri(e)?"python":(0,mEe.getDefaultLanguage)(e),h=a(g=>{d.language=d.language||f,d.id&&s.get(d.id)?.document.languageId===d.language?c.has(d.id)?d.id="":c.add(d.id):d.id="";let A=s.get(d.id);d.uri=A?.document.uri,d.kind=A?.kind||(d.language==="markdown"?jN.NotebookCellKind.Markup:jN.NotebookCellKind.Code),o.emitOne({index:d.index,type:"start",kind:d.kind,language:d.language,uri:d.uri,id:d.id}),d.source.forEach(y=>o.emitOne({index:d.index,type:"line",line:y})),o.emitOne({index:d.index,type:"end"})},"emitCell"),m=0;for await(let g of r){if(n.isCancellationRequested)break;let A=g.value;l+=A,(0,ePc.visit)(l,{onObjectEnd(y,_,E,v){m=y},onLiteralValue:a((y,_,E,v,S,T)=>{if(u>=_)return;let w=T();if(w.length<2||w.shift()!=="cells")return;let R=w.shift();if(typeof R!="number")return;let x=w.shift();if(u=_,d.index!==-1&&d.index!==R&&(h(_),d.startOffset=_,d.id=void 0,d.kind=jN.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?jN.NotebookCellKind.Code:jN.NotebookCellKind.Markup,d.kind===jN.NotebookCellKind.Markup&&(d.language="markdown");else if(x==="id")d.id=y;else if(x==="metadata"&&w[0]==="id")d.id=y;else if(x==="metadata"&&w[0]==="language")d.language=y,d.language==="markdown"&&(d.kind=jN.NotebookCellKind.Markup);else if(x==="source"&&w.length&&typeof w[0]=="number"){w[0]===0&&(d.startOffset=_);let k=typeof y=="string"?y:`${y||""}`;k.endsWith(` +`)&&(k=k.substr(0,k.length-1)),d.source.push(k)}},"onLiteralValue")})}d.index!==-1&&h(m)})}};gFe.AlternativeJsonNotebookContentProvider=HBr;function oPc(t){if(t.lineCount===0)return[];if(t.lineCount===1)return[t.lineAt(0).text];let e=t.lineCount;return new Array(e).fill("").map((r,n)=>t.lineAt(n).text)}a(oPc,"getCellCode")});var $Br=I(eW=>{"use strict";p();Object.defineProperty(eW,"__esModule",{value:!0});eW.wellKnownLanguages=void 0;eW.getLanguage=lGi;eW.getLanguageForResource=cPc;var sPc=x2(),aPc=Object.freeze({abap:{lineComment:{start:"'"},markdownLanguageIds:["abap","sap-abap"]},bat:{lineComment:{start:"REM"},alternativeLineComments:[{start:"::"}],aliases:["Batch","bat"],extensions:[".bat",".cmd"]},bibtex:{lineComment:{start:"%"},aliases:["BibTeX","bibtex"],extensions:[".bib"]},blade:{lineComment:{start:"#"}},c:{lineComment:{start:"//"},aliases:["C","c"],extensions:[".c",".i"],markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";"},aliases:["Clojure","clojure"],extensions:[".clj",".cljs",".cljc",".cljx",".clojure",".edn"],markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//"},aliases:["CoffeeScript","coffeescript","coffee"],extensions:[".coffee",".cson",".iced"],markdownLanguageIds:["coffeescript","coffee","cson","iced"],blockComment:["###","###"]},cpp:{lineComment:{start:"//"},aliases:["C++","Cpp","cpp"],extensions:[".cpp",".cc",".cxx",".c++",".hpp",".hh",".hxx",".h++",".h",".ii",".ino",".inl",".ipp",".ixx",".tpp",".txx",".hpp.in",".h.in"],markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"],blockComment:["/*","*/"]},csharp:{lineComment:{start:"//"},aliases:["C#","csharp"],extensions:[".cs",".csx",".cake"],markdownLanguageIds:["csharp","cs"],blockComment:["/*","*/"]},css:{lineComment:{start:"/*",end:"*/"},aliases:["CSS","css"],extensions:[".css"],blockComment:["/*","*/"]},dart:{lineComment:{start:"//"},aliases:["Dart"],extensions:[".dart"],blockComment:["/*","*/"]},dockerfile:{lineComment:{start:"#"},aliases:["Docker","Dockerfile","Containerfile"],extensions:[".dockerfile",".containerfile"],markdownLanguageIds:["dockerfile","docker"]},elixir:{lineComment:{start:"#"}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%"},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//"},aliases:["F#","FSharp","fsharp"],extensions:[".fs",".fsi",".fsx",".fsscript"],markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"],blockComment:["(*","*)"]},go:{lineComment:{start:"//"},aliases:["Go"],extensions:[".go"],markdownLanguageIds:["go","golang"],blockComment:["/*","*/"]},groovy:{lineComment:{start:"//"},aliases:["Groovy","groovy"],extensions:[".groovy",".gvy",".gradle",".jenkinsfile",".nf"],blockComment:["/*","*/"]},haml:{lineComment:{start:"-#"}},handlebars:{lineComment:{start:"{{!",end:"}}"},extensions:[".hbs",".handlebars"],markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"],blockComment:["{{!--","--}}"]},haskell:{lineComment:{start:"--"},markdownLanguageIds:["haskell","hs"]},html:{lineComment:{start:""},aliases:["HTML","htm","html","xhtml"],extensions:[".html",".htm",".shtml",".xhtml",".xht",".mdoc",".jsp",".asp",".aspx",".jshtm",".volt",".ejs",".rhtml"],markdownLanguageIds:["html","xhtml"],blockComment:[""]},ini:{lineComment:{start:";"},blockComment:[";"," "]},java:{lineComment:{start:"//"},extensions:[".java",".class"],markdownLanguageIds:["java","jsp"],blockComment:["/*","*/"]},javascript:{lineComment:{start:"//"},aliases:["JavaScript","javascript","js"],extensions:[".js",".es6",".mjs",".cjs",".pac"],markdownLanguageIds:["javascript","js"],blockComment:["/*","*/"]},javascriptreact:{lineComment:{start:"//"},aliases:["JavaScript JSX","JavaScript React","jsx"],extensions:[".jsx"],markdownLanguageIds:["jsx"]},json:{extensions:[".json"],lineComment:{start:"//"},blockComment:["/*","*/"]},jsonc:{lineComment:{start:"//"}},jsx:{lineComment:{start:"//"},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#"},aliases:["Julia","julia"],extensions:[".jl"],markdownLanguageIds:["julia","jl"],blockComment:["#=","=#"]},kotlin:{lineComment:{start:"//"},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%"},aliases:["LaTeX","latex"],extensions:[".tex",".ltx",".ctx"],markdownLanguageIds:["tex"]},less:{lineComment:{start:"//"},aliases:["Less","less"],extensions:[".less"],blockComment:["/*","*/"]},lua:{lineComment:{start:"--"},aliases:["Lua","lua"],extensions:[".lua"],markdownLanguageIds:["lua","pluto"],blockComment:["--[[","]]"]},makefile:{lineComment:{start:"#"},aliases:["Makefile","makefile"],extensions:[".mak",".mk"],markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:""},alternativeLineComments:[{start:"[]: #"}],aliases:["Markdown","markdown"],extensions:[".md",".mkd",".mdwn",".mdown",".markdown",".markdn",".mdtxt",".mdtext",".workbook"],markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//"},aliases:["Objective-C"],extensions:[".m"],markdownLanguageIds:["objectivec","mm","objc","obj-c"],blockComment:["/*","*/"]},"objective-cpp":{lineComment:{start:"//"},aliases:["Objective-C++"],extensions:[".mm"],markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#"},aliases:["Perl","perl"],extensions:[".pl",".pm",".pod",".t",".PL",".psgi"],markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//"},aliases:["PHP","php"],extensions:[".php",".php4",".php5",".phtml",".ctp"],blockComment:["/*","*/"]},powershell:{lineComment:{start:"#"},aliases:["PowerShell","powershell","ps","ps1"],extensions:[".ps1",".psm1",".psd1",".pssc",".psrc"],markdownLanguageIds:["powershell","ps","ps1"],blockComment:["<#","#>"]},pug:{lineComment:{start:"//"}},python:{lineComment:{start:"#"},aliases:["Python","py"],extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi",".pyi",".ipy",".pyt"],markdownLanguageIds:["python","py","gyp"],blockComment:['"""','"""']},ql:{lineComment:{start:"//"}},r:{lineComment:{start:"#"},aliases:["R","r"],extensions:[".r",".rhistory",".rprofile",".rt"]},razor:{lineComment:{start:""},aliases:["Razor","razor"],extensions:[".cshtml",".razor"],markdownLanguageIds:["cshtml","razor","razor-cshtml"],blockComment:[""]},ruby:{lineComment:{start:"#"},aliases:["Ruby","rb"],extensions:[".rb",".rbx",".rjs",".gemspec",".rake",".ru",".erb",".podspec",".rbi"],markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"],blockComment:["=begin","=end"]},rust:{lineComment:{start:"//"},aliases:["Rust","rust"],extensions:[".rs"],markdownLanguageIds:["rust","rs"],blockComment:["/*","*/"]},sass:{lineComment:{start:"//"}},scala:{lineComment:{start:"//"}},scss:{lineComment:{start:"//"},aliases:["SCSS","scss"],extensions:[".scss"],blockComment:["/*","*/"]},shellscript:{lineComment:{start:"#"},aliases:["Shell Script","shellscript","bash","fish","sh","zsh","ksh","csh"],extensions:[".sh",".bash",".bashrc",".bash_aliases",".bash_profile",".bash_login",".ebuild",".profile",".bash_logout",".xprofile",".xsession",".xsessionrc",".Xsession",".zsh",".zshrc",".zprofile",".zlogin",".zlogout",".zshenv",".zsh-theme",".fish",".ksh",".csh",".cshrc",".tcshrc",".yashrc",".yash_profile"],markdownLanguageIds:["bash","sh","zsh"]},slim:{lineComment:{start:"/"}},solidity:{lineComment:{start:"//"},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--"},aliases:["SQL"],extensions:[".sql",".dsql"],blockComment:["/*","*/"]},stylus:{lineComment:{start:"//"}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//"},aliases:["Swift","swift"],extensions:[".swift"],blockComment:["/*","*/"]},terraform:{lineComment:{start:"#"}},tex:{lineComment:{start:"%"},aliases:["TeX","tex"],extensions:[".sty",".cls",".bbx",".cbx"]},typescript:{lineComment:{start:"//"},aliases:["TypeScript","ts","typescript"],extensions:[".ts",".cts",".mts"],markdownLanguageIds:["typescript","ts"],blockComment:["/*","*/"]},typescriptreact:{lineComment:{start:"//"},aliases:["TypeScript JSX","TypeScript React","tsx"],extensions:[".tsx"],markdownLanguageIds:["tsx"],blockComment:["/*","*/"]},vb:{lineComment:{start:"'"},aliases:["Visual Basic","vb"],extensions:[".vb",".brs",".vbs",".bas",".vba"],markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//"}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//"},extensions:[".vue"]},xml:{lineComment:{start:""},aliases:["XML","xml"],extensions:[".xml",".xsd",".ascx",".atom",".axml",".axaml",".bpmn",".cpt",".csl",".csproj",".csproj.user",".dita",".ditamap",".dtd",".ent",".mod",".dtml",".fsproj",".fxml",".iml",".isml",".jmx",".launch",".menu",".mxml",".nuspec",".opml",".owl",".proj",".props",".pt",".publishsettings",".pubxml",".pubxml.user",".rbxlx",".rbxmx",".rdf",".rng",".rss",".shproj",".storyboard",".svg",".targets",".tld",".tmx",".vbproj",".vbproj.user",".vcxproj",".vcxproj.filters",".wsdl",".wxi",".wxl",".wxs",".xaml",".xbl",".xib",".xlf",".xliff",".xpdl",".xul",".xoml"],blockComment:[""]},xsl:{lineComment:{start:""},aliases:["XSL","xsl"],extensions:[".xsl",".xslt"]},yaml:{lineComment:{start:"#"},markdownLanguageIds:["yaml","yml"]}});eW.wellKnownLanguages=new Map(Object.entries(aPc).map(([t,e])=>[t,{languageId:t,...e}]));function lGi(t){return GBr(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(lGi,"getLanguage");function GBr(t){return eW.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a(GBr,"_getLanguage");function cPc(t){let e=(0,sPc.extname)(t).toLowerCase();for(let r of eW.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return lGi("plaintext")}a(cPc,"getLanguageForResource")});var fGi=I(tW=>{"use strict";p();Object.defineProperty(tW,"__esModule",{value:!0});tW.AlternativeTextNotebookContentProvider=void 0;tW.generateCellTextMarker=zBr;tW.lineMightHaveCellMarker=YBr;tW.getBlockComment=AEe;tW.getLineCommentStart=yEe;var WBr=$Br(),lPc=T1t(),uPc=dj(),gEe=qg(),dPc=A1t(),fPc=S1t(),Zm=mFe();function zBr(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(zBr,"generateCellTextMarker");function YBr(t){return t.toLowerCase().includes("vscode.cell")}a(YBr,"lineMightHaveCellMarker");var x1t=class extends fPc.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,Zm.summarize)(e),o=yEe(this.notebook),s=zBr(n,o),c=e.document.eol===gEe.EndOfLine.LF?1:2,l=AEe(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===gEe.NotebookCellKind.Markup?l[0].length+c:0,h=u.indexOf(s)+s.length+c+f+d;return this.positionAt(h)}toCellPosition(e){let r=this.offsetAt(e),n=(0,uPc.findLast)(this.cellOffsetMap,s=>s.sourceOffset<=r);if(!n)return;let o=n.cell.document.positionAt(r-n.sourceOffset);return{cell:n.cell,position:o}}},VBr=class extends dPc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(Zm.EOL);return r.length&&YBr(r[0])?(r.shift(),r.join(Zm.EOL)):e}getSummaryOfStructure(e,r,n){let o=AEe(e),s=yEe(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,Zm.summarize)(u);d.source.length&&d.source[0].trim().length?d.source=[d.source[0],c]:d.source.length&&d.source.some(f=>f.trim().length)?d.source=[c,d.source.filter(f=>f.trim().length)[0],c]:d.source=[c],l.push(uGi(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(Zm.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,lPc.isUri)(e),s=o?(0,Zm.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=yEe(o?e:void 0),m=AEe(o?e:void 0),g=o?(0,WBr.getLanguage)((0,Zm.getDefaultLanguage)(e)).languageId:void 0,A=new Set;for await(let y of r){if(n.isCancellationRequested)break;let _=y.value,E=_.startsWith(`${h}%% [`)&&_.trimEnd().endsWith("]"),v=_.startsWith(`${h}%% vscode.cell`),S=v||E?dGi(_,g):void 0;if((v||E)&&S?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:gEe.NotebookCellKind.Code,emitted:!1,type:"start"};T.index=f+=1,T.emitted=!1,S.id&&s.get(S.id)?.document.languageId===S.language?A.has(S.id)?S.id="":A.add(S.id):S.id="";let w=s.get(S.id);T.id=S.id,T.language=S.language,T.uri=w?.document.uri,T.kind=w?.kind||(T.language==="markdown"?gEe.NotebookCellKind.Markup:gEe.NotebookCellKind.Code),c=T.language==="markdown",l=!1,d&&(yield{index:f-1,type:"end"}),d=!0,yield T;continue}d&&(c?l?_===m[1]?(l=!1,u=!0):yield{index:f,line:_,type:"line"}:_===m[0]?l=!0:yield{index:f,line:_,type:"line"}:yield{index:f,line:_,type:"line"})}d&&(yield{index:f,type:"end"})}getAlternativeDocumentFromText(e,r){let n=AEe(r),o=yEe(r),s=(0,Zm.getCellIdMap)(r),c=[],l=e.split(Zm.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(_=>_.cell===y));if(A){let y=u,_=Zm.EOL.length,E=g.language==="markdown",v=y+f.length+_+(E?n[0].length+_:0);c.push({offset:y,sourceOffset:v,cell:A})}}}u+=f.length+Zm.EOL.length}return new x1t(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==gEe.NotebookCellKind.Markup:!0).map(d=>(0,Zm.summarize)(d)),o=AEe(e),s=yEe(e),c=n.map(d=>({...uGi(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(Zm.EOL),u=c.map(d=>{let f=l.indexOf(d.content),h=f+d.prefix.length;return{offset:f,sourceOffset:h,cell:e.cellAt(d.cell.index)}});return new x1t(l,u,e)}};tW.AlternativeTextNotebookContentProvider=VBr;function uGi(t,e,r){let n=zBr(t,e),o=t.source.join(Zm.EOL),s=t.language==="markdown"?`${n}${Zm.EOL}${r[0]}${Zm.EOL}`:`${n}${Zm.EOL}`;return{content:t.language==="markdown"?`${s}${o}${Zm.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(uGi,"generateAlternativeCellTextContent");function AEe(t){return t?(0,WBr.getLanguage)((0,Zm.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a(AEe,"getBlockComment");function yEe(t){return t&&(0,WBr.getLanguage)((0,Zm.getDefaultLanguage)(t)).lineComment.start||"#"}a(yEe,"getLineCommentStart");function dGi(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:YBr(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(dGi,"extractCellParts")});var mGi=I(_Fe=>{"use strict";p();Object.defineProperty(_Fe,"__esModule",{value:!0});_Fe.AlternativeXmlNotebookContentProvider=void 0;_Fe.isXmlContent=hGi;var pPc=$Br(),hPc=T1t(),mPc=dj(),AFe=qg(),gPc=A1t(),APc=S1t(),mE=mFe(),yFe="`}a(KBr,"generateCellMarker");function hGi(t){return t.includes(yFe)||t.includes(rW)||t.includes(w1t)}a(hGi,"isXmlContent");var R1t=class extends APc.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,mE.summarize)(e),o=KBr(n),s=e.document.eol===AFe.EndOfLine.LF?1:2,c=this.getText(),l=e.document.offsetAt(r),u=c.indexOf(o)+o.length+s+l;return this.positionAt(u)}toCellPosition(e){let r=this.offsetAt(e),n=(0,mPc.findLast)(this.cellOffsetMap,s=>s.offset<=r);if(!n)return;let o=n.cell.document.positionAt(r-n.offset);return{cell:n.cell,position:o}}},JBr=class extends gPc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(mE.EOL);return r.length&&(r[0].startsWith(yFe)||r[0].startsWith(w1t))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(rW)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(rW))),r.join(mE.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,mE.summarize)(c);o.push(KBr(l)),l.source.length&&l.source[0].trim().length?(o.push(l.source[0]),o.push(s)):l.source.length&&l.source.some(u=>u.trim().length)?l.source=[s,l.source.filter(u=>u.trim().length)[0],s]:o.push(s),o.push(rW)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(mE.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,hPc.isUri)(e),s=o?(0,mE.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,pPc.getLanguage)((0,mE.getDefaultLanguage)(e)).languageId:void 0;for await(let m of r){if(n.isCancellationRequested)break;let g=m.value;if((g.startsWith(yFe)||g.startsWith(w1t))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(rW)),yield f,yield{type:"end",index:f.index}),d=!1,f=void 0,c+=1,l=!1;let A={type:"start",index:c,uri:void 0,language:void 0,kind:AFe.NotebookCellKind.Code},y=pGi(g,h);y.id&&s.get(y.id)?.document.languageId===y.language?u.has(y.id)?y.id="":u.add(y.id):y.id="";let _=s.get(y.id)?.document.languageId===y.language?s.get(y.id):void 0;A.id=y.id,A.language=y.language,A.uri=_?.document.uri,A.kind=_?.kind||(A.language==="markdown"?AFe.NotebookCellKind.Markup:AFe.NotebookCellKind.Code),yield A}else g.startsWith(rW)?(d&&f&&(yield f),l=!0,d=!1,f=void 0,yield{type:"end",index:c}):c>=0&&(d&&f&&(yield f,f=void 0),d=g.endsWith(rW),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,mE.getCellIdMap)(r),o=[],s=e.split(mE.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=mE.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+mE.EOL.length}return new R1t(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==AFe.NotebookCellKind.Markup:!0).map(l=>(0,mE.summarize)(l)).map(l=>{let d=`${KBr(l)}${mE.EOL}`;return{content:`${d}${l.source.join(mE.EOL)}${mE.EOL}${rW}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(mE.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new R1t(s,c,e)}};_Fe.AlternativeXmlNotebookContentProvider=JBr;function pGi(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(hGi(t)&&typeof e=="string")return{id:r?r[1].trim():"",language:e};throw new Error(`Invalid cell part in ${t}`)}return{id:r?r[1].trim():"",language:n[1].trim()}}a(pGi,"extractCellParts")});var EGi=I(GS=>{"use strict";p();var _Pc=GS&&GS.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},gGi=GS&&GS.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(GS,"__esModule",{value:!0});GS.AlternativeNotebookContentService=GS.IAlternativeNotebookContentService=void 0;GS.getAlternativeNotebookDocumentProvider=XBr;GS.inferAlternativeNotebookContentFormat=IPc;GS.getAltNotebookRange=xPc;var EPc=nSt(),vPc=an(),CPc=qg(),AGi=Hl(),bPc=z3e(),SPc=Rh(),yGi=cGi(),TPc=fGi(),_Gi=mGi();function XBr(t){switch(t){case"xml":return new _Gi.AlternativeXmlNotebookContentProvider;case"text":return new TPc.AlternativeTextNotebookContentProvider;case"json":return new yGi.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(XBr,"getAlternativeNotebookDocumentProvider");function IPc(t){return(0,_Gi.isXmlContent)(t)?"xml":(0,yGi.isJsonContent)(t)?"json":"text"}a(IPc,"inferAlternativeNotebookContentFormat");GS.IAlternativeNotebookContentService=(0,vPc.createServiceIdentifier)("IAlternativeNotebookContentService");var ZBr=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,bPc.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig(AGi.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return XBr(e)}};GS.AlternativeNotebookContentService=ZBr;GS.AlternativeNotebookContentService=ZBr=_Pc([gGi(0,AGi.IConfigurationService),gGi(1,SPc.IExperimentationService)],ZBr);function xPc(t,e,r,n){let o=(0,EPc.findCell)(e,r);if(!o)return;let s=XBr(n).getAlternativeDocument(r);return new CPc.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(xPc,"getAltNotebookRange")});var CGi=I(EFe=>{"use strict";p();Object.defineProperty(EFe,"__esModule",{value:!0});EFe.NotebookDocumentSnapshot=void 0;EFe.isNotebookDocumentSnapshotJSON=kPc;var k1t=CT(),wPc=hd(),e3r=qg(),vGi=EGi(),RPc=mFe();function kPc(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,wPc.isUriComponents)(t.uri)&&(0,k1t.isString)(t._text)&&(0,k1t.isString)(t.languageId)&&(0,k1t.isNumber)(t.version)&&(0,k1t.isString)(t.alternativeFormat)}a(kPc,"isNotebookDocumentSnapshotJSON");var t3r=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,vGi.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,vGi.getAlternativeNotebookDocumentProvider)(r.alternativeFormat).getAlternativeDocumentFromText(e,r.document);return new t(r.document,r.uri,r.version,r.alternativeFormat,n)}static fromJSON(e,r){return t.create(e,r.alternativeFormat)}constructor(e,r,n,o,s){this.alternativeFormat=o,this._alternativeDocument=s,this.type="notebook",this.document=e,this.uri=r,this.version=n,this.languageId=o==="text"?(0,RPc.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new e3r.Selection(0,0,this.lineCount,0)}getWholeRange(){return new e3r.Range(0,0,this.lineCount,0)}get lines(){return this._alternativeDocument.lines}get lineCount(){return this._alternativeDocument.lineCount}lineAt(e){let r;if(e instanceof e3r.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return this._alternativeDocument.lineAt(r)}offsetAt(e){return this._alternativeDocument.offsetAt(e)}positionAt(e){return this._alternativeDocument.positionAt(e)}validateRange(e){return this._alternativeDocument.validateRange(e)}validatePosition(e){return this._alternativeDocument.validatePosition(e)}toJSON(){return{type:"notebook",uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,_text:this._alternativeDocument.getText(),alternativeFormat:this.alternativeFormat}}};EFe.NotebookDocumentSnapshot=t3r});var n3r=I(cC=>{"use strict";p();var PPc=cC&&cC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DPc=cC&&cC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),NPc=cC&&cC.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o"u"&&(r=this.getWorkspaceFolders().length>1);let c=(0,bGi.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return QPc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,MPc.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return UPc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>bGi.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};cC.AbstractWorkspaceService=P1t;function qPc(t,e){let r=t.getWorkspaceFolder(e);return r?BPc.posix.relative(r.path,e.path):e.path}a(qPc,"getWorkspaceFileDisplayPath");var r3r=class extends P1t{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new LPc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new nW.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new nW.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new nW.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new nW.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new nW.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new nW.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new nW.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new nW.Emitter),this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event,this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event,this.onDidOpenNotebookDocument=this.didOpenNotebookDocumentEmitter.event,this.onDidCloseNotebookDocument=this.didCloseNotebookDocumentEmitter.event,this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event,this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event,this.onDidChangeNotebookDocument=this.didChangeNotebookDocumentEmitter.event,this.onDidChangeTextEditorSelection=this.didChangeTextEditorSelectionEmitter.event,this._textDocuments=[],this._notebookDocuments=[],this.workspaceFolder=e,this._textDocuments=r,this._notebookDocuments=n}get textDocuments(){return this._textDocuments}showTextDocument(e){return Promise.resolve()}async openTextDocument(e){let r=this.textDocuments.find(n=>n.uri.toString()===e.toString());if(r)return r;throw new Error(`Unknown document: ${e}`)}async openNotebookDocument(e,r){if(typeof e=="string")throw new Error("Not implemented");{let n=this.notebookDocuments.find(o=>o.uri.toString()===e.toString());if(n)return n;throw new Error(`Unknown notebook: ${e}`)}}get notebookDocuments(){return this._notebookDocuments}getWorkspaceFolders(){return this.workspaceFolder}getWorkspaceFolderName(e){return"default"}ensureWorkspaceIsFullyLoaded(){return Promise.resolve()}showWorkspaceFolderPicker(){return Promise.resolve(void 0)}applyEdit(){return Promise.resolve(!0)}dispose(){this.disposables.dispose()}isResourceTrusted(e){return Promise.resolve(!0)}requestResourceTrust(e){return Promise.resolve(!0)}requestWorkspaceTrust(e){return Promise.resolve(!0)}};cC.NullWorkspaceService=r3r});var a3r=I(Hie=>{"use strict";p();Object.defineProperty(Hie,"__esModule",{value:!0});Hie.BatchedProcessor=Hie.TaskQueue=void 0;Hie.raceFilter=jPc;var i3r=pl(),SGi=Os(),o3r=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new i3r.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new i3r.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),r.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new SGi.BugIndicatingError;this._runningTask=e.task;try{let r=await e.task();e.deferred.complete(r)}catch(r){e.deferred.error(r)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let r of e)r.setUndefinedWhenCleared?r.deferred.complete(void 0):r.deferred.error(new SGi.CancellationError)}};Hie.TaskQueue=o3r;var s3r=class{static{a(this,"BatchedProcessor")}constructor(e,r){this._fn=e,this._waitingTimeMs=r,this._queue=[],this._timeout=null}request(e){this._timeout===null&&(this._timeout=setTimeout(()=>this._flush(),this._waitingTimeMs));let r=new i3r.DeferredPromise;return this._queue.push({arg:e,promise:r}),r.p}async _flush(){let e=this._queue;this._queue=[],this._timeout=null;let r=e.map(o=>o.arg),n;try{n=await this._fn(r)}catch(o){for(let s of e)s.promise.error(o);return}for(let[o,s]of n.entries())e[o].promise.complete(s)}};Hie.BatchedProcessor=s3r;function jPc(t,e){return new Promise((r,n)=>{if(t.length===0){r(void 0);return}let o=!1,s=t.length;for(let c of t)c.then(l=>{s--,o||(e(l)?(o=!0,r(l)):s===0&&r(void 0))}).catch(n)})}a(jPc,"raceFilter")});var c3r=I(_Ee=>{"use strict";p();Object.defineProperty(_Ee,"__esModule",{value:!0});_Ee.AsyncIterUtilsExt=_Ee.AsyncIterUtils=void 0;var TGi;(function(t){async function*e(d,f){for await(let h of d)yield f(h)}a(e,"map"),t.map=e;async function*r(d,f,h){let m=d[Symbol.asyncIterator](),g;for(;!(g=await m.next()).done;)yield f(g.value);return h(g.value)}a(r,"mapWithReturn"),t.mapWithReturn=r;async function*n(d,f){for await(let h of d)f(h)&&(yield h)}a(n,"filter"),t.filter=n;async function o(d){let f=[];for await(let h of d)f.push(h);return f}a(o,"toArray"),t.toArray=o;async function*s(d){for(let f of d)yield f}a(s,"fromArray"),t.fromArray=s;async function*c(d,f){for(let h of d)yield h;return f}a(c,"fromArrayWithReturn"),t.fromArrayWithReturn=c;async function l(d){let f=d[Symbol.asyncIterator](),h=[],m;for(;!(m=await f.next()).done;)h.push(m.value);return[h,m.value]}a(l,"toArrayWithReturn"),t.toArrayWithReturn=l;async function u(d){let f=d[Symbol.asyncIterator](),h;do h=await f.next();while(!h.done);return h.value}a(u,"drainUntilReturn"),t.drainUntilReturn=u})(TGi||(_Ee.AsyncIterUtils=TGi={}));var IGi;(function(t){async function*e(r){let n=null;for await(let o of r){n??="",n+=o;let s=n.split(/\r?\n/);n=s.pop()??"",yield*s}n!==null&&(yield n)}a(e,"splitLines"),t.splitLines=e})(IGi||(_Ee.AsyncIterUtilsExt=IGi={}))});var u3r=I(l3r=>{"use strict";p();Object.defineProperty(l3r,"__esModule",{value:!0});l3r.backwardCompatSetting=HPc;function HPc(t,e){return e(t)}a(HPc,"backwardCompatSetting")});var wGi=I(QI=>{"use strict";p();Object.defineProperty(QI,"__esModule",{value:!0});QI.LineWithTokens=QI.Token=void 0;QI.getOrDeduceSelectionFromLastEdit=$Pc;QI.clipTokensToRange=xGi;QI.clipTokensToRangeAndAdjustOffsets=WPc;QI.removeTokensInRangeAndAdjustOffsets=zPc;QI.getTokensFromLogProbs=YPc;QI.getTokensFromLinesWithTokens=KPc;QI.mergeOffsetRangesAtDistance=JPc;var GPc=Os(),EEe=Id();function $Pc(t){let e=new EEe.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):VPc(t)}a($Pc,"getOrDeduceSelectionFromLastEdit");function VPc(t){let e=t.recentEdits.edits.at(-1);if(e===void 0)return null;let r=e.replacements.at(-1);if(r===void 0)return null;let n=r.replaceRange,s=r.newText.length-n.length,c=n.endExclusive+s;return t.documentAfterEdits.getTransformer().getRange(new EEe.OffsetRange(c,c))}a(VPc,"deduceSelectionFromLastEdit");var D1t=class t{static{a(this,"Token")}get id(){return this.text+"_"+this.range.toString()}constructor(e,r,n){this.text=e,this.value=r,this.range=new EEe.OffsetRange(n,n+e.length)}equals(e){return this.range.equals(e.range)&&this.text===e.text}deltaOffset(e){return new t(this.text,this.value,this.range.start+e)}};QI.Token=D1t;function xGi(t,e){return t.filter(r=>e.intersects(r.range))}a(xGi,"clipTokensToRange");function WPc(t,e){return xGi(t,e).map(r=>r.deltaOffset(-e.start))}a(WPc,"clipTokensToRangeAndAdjustOffsets");function zPc(t,e){let r=[];for(let n of t)e.containsRange(n.range)||(n.range.start>e.start&&(n=n.deltaOffset(-e.length)),r.push(n));return r}a(zPc,"removeTokensInRangeAndAdjustOffsets");function YPc(t,e){let r=e;return t.content.map(n=>{let o=new D1t(n.token,n.logprob,r);return r+=o.range.length,o})}a(YPc,"getTokensFromLogProbs");var d3r=class t{static{a(this,"LineWithTokens")}static stringEquals(e,r){return e._text===r._text}static fromText(e,r){r=r??[];let n=[];for(;;){let o=e.indexOf(`\r `),s=e.indexOf(` `),c=o===-1?s:s===-1?o:Math.min(o,s),l=o!==-1?`\r `:s===-1?void 0:` `;if(l===void 0){n.push(new t(e,r,` -`));break}let u=c+l.length,d=e.substring(0,c),f=r.filter(h=>h.range.start0);n.push(new t(d,f,l)),e=e.substring(u),r=r.map(h=>h.deltaOffset(-u)).filter(h=>h.range.endExclusive>0)}return n}get text(){return this._text}get tokens(){return this._tokens}get length(){return this._text.length}get lengthWithEOL(){return this._text.length+this._eol.length}get eol(){return this._eol}constructor(e,r,n){this._text=e,this._tokens=r,this._eol=n}trim(){return this.trimStart().trimEnd()}trimStart(){let e=this._text.trimStart(),r=this._text.length-e.length,n=this._tokens.map(o=>o.deltaOffset(-r)).filter(o=>o.range.endExclusive>0);return new t(e,n,this._eol)}trimEnd(){let e=this._text.trimEnd(),r=this._tokens.filter(n=>n.range.starts.deltaOffset(-e)).filter(s=>s.range.endExclusive>0&&s.range.startr.equals(e.tokens[n]))}dropTokens(e){return new t(this._text,this._tokens.filter(r=>!e.some(n=>r.equals(n))),this._eol)}findTokens(e){return this._tokens.filter(e)}};QI.LineWithTokens=u3r;function zPc(t){let e=0,r=[];for(let s of t){let c=s.text+s.eol;r.push(...s.tokens.map(l=>l.deltaOffset(e))),e+=c.length}let n=[],o=new Set;for(let s of r)o.has(s.id)||(o.add(s.id),n.push(s));return n}a(zPc,"getTokensFromLinesWithTokens");function YPc(t,e){if(e<0)throw new jPc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new EEe.OffsetRange(o.start-e,o.endExclusive+e)),n=new EEe.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new EEe.OffsetRange(o.start+e,o.endExclusive-e))}a(YPc,"mergeOffsetRangesAtDistance")});var xGi=I(D1t=>{"use strict";p();Object.defineProperty(D1t,"__esModule",{value:!0});D1t.DelaySession=void 0;var d3r=class{static{a(this,"DelaySession")}constructor(e,r,n=Date.now()){this.baseDebounceTime=e,this.expectedTotalTime=r,this.providerInvocationTime=n,this.extraDebounce=0}setExtraDebounce(e){this.extraDebounce=e}setBaseDebounceTime(e){this.baseDebounceTime=e}setExpectedTotalTime(e){this.expectedTotalTime=e}getDebounceTime(){let r=(this.expectedTotalTime===void 0?this.baseDebounceTime:Math.min(this.baseDebounceTime,this.expectedTotalTime))+this.extraDebounce,n=Date.now()-this.providerInvocationTime;return Math.max(0,r-n)}getArtificialDelay(){if(this.expectedTotalTime===void 0)return 0;let e=Date.now()-this.providerInvocationTime;return Math.max(0,this.expectedTotalTime-e)}};D1t.DelaySession=d3r});var PGi=I(Up=>{"use strict";p();var KPc=Up&&Up.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},N1t=Up&&Up.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Up,"__esModule",{value:!0});Up.UserInteractionMonitor=Up.MAX_INTERACTIONS_STORED=Up.MAX_INTERACTIONS_CONSIDERED=Up.ActionKind=void 0;Up.getWindowWithIgnoredLimit=RGi;Up.getUserHappinessScore=kGi;var vEe=Hl(),Hie=wy(),JPc=Np(),ZPc=Rh(),XPc=bh(),wGi=gv(),e2c=xGi(),qI;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(qI||(Up.ActionKind=qI={}));Up.MAX_INTERACTIONS_CONSIDERED=10;Up.MAX_INTERACTIONS_STORED=30;function RGi(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-Up.MAX_INTERACTIONS_CONSIDERED);let s=[],c=0,l=0;for(let u=t.length-1;u>=0&&s.length=o&&(f=!0),n&&l>=o&&(f=!0),f)continue;c++,l++}else c=0;s.push(d)}return s.reverse(),s}a(RGi,"getWindowWithIgnoredLimit");function kGi(t,e){if(t.length===0)return .5;let r=RGi(t,e);if(r.length===0)return .5;let n=0,o=0,s=0;for(let u=0;u0?n/o:.5,l=s/Up.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(kGi,"getUserHappinessScore");var f3r=class{static{a(this,"UserInteractionMonitor")}constructor(e,r,n,o){this._configurationService=e,this._experimentationService=r,this._logService=n,this._telemetryService=o,this._recentUserActionsForAggressiveness=[],this._recentUserActionsForTiming=[],this._lastActionWasAcceptance=!1}handleAcceptance(){this._recordUserAction(qI.Accepted)}handleRejection(){this._recordUserAction(qI.Rejected)}handleIgnored(){this._recordUserAction(qI.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===qI.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-Up.MAX_INTERACTIONS_STORED),e!==qI.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-Up.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(vEe.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(vEe.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new e2c.DelaySession(r,o,e)}_getExpectedTotalTime(e){let l=Date.now(),u=1;for(let f of this._recentUserActionsForTiming){let h=l-f.time;if(h>6e5)continue;let m=Math.exp(-h/6e5),g=f.kind===qI.Rejected?1.5:.8;u*=1+(g-1)*m}let d=e*u;return d=Math.min(3e3,Math.max(50,d)),d}getAggressivenessLevel(){let e=this._configurationService.getExperimentBasedConfig(vEe.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=Hie.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(vEe.ConfigKey.TeamInternal.InlineEditsXtabAggressivenessLevel,this._experimentationService);if(n!==void 0)return{aggressivenessLevel:n,userHappinessScore:void 0};let o,s=this._getUserHappinessScoreConfiguration(),c=this._getUserHappinessScore(s);return c>=s.highThreshold?o=Hie.AggressivenessLevel.High:c>=s.mediumThreshold?o=Hie.AggressivenessLevel.Medium:o=Hie.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=vEe.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return Hie.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,Hie.parseUserHappinessScoreConfigurationString)(r)}catch(n){return this._logService.error(n,"Failed to parse user happiness score configuration, using default config"),this._telemetryService.sendMSFTTelemetryEvent("incorrectNesAdaptiveAggressivenessConfig",{configName:e.id,errorMessage:wGi.ErrorUtils.toString(wGi.ErrorUtils.fromUnknown(n)),configValue:r}),Hie.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return kGi(this._recentUserActionsForAggressiveness,e)}};Up.UserInteractionMonitor=f3r;Up.UserInteractionMonitor=f3r=KPc([N1t(0,vEe.IConfigurationService),N1t(1,ZPc.IExperimentationService),N1t(2,JPc.ILogService),N1t(3,XPc.ITelemetryService)],f3r)});var DGi=I(p3r=>{"use strict";p();Object.defineProperty(p3r,"__esModule",{value:!0});p3r.isImportStatement=t2c;function t2c(t,e){switch(e){case"java":return!!t.match(/^\s*import\s/);case"typescript":case"typescriptreact":case"javascript":case"javascriptreact":return!!t.match(/^\s*import[\s{*]|^\s*[var|const|let].*=\s*require\(/);case"php":return!!t.match(/^\s*use/);case"rust":return!!t.match(/^\s*use\s+[\w:{}, ]+\s*(as\s+\w+)?;/);case"python":return!!t.match(/^\s*from\s+[\w.]+\s+import\s+[\w, *]+$/)||!!t.match(/^\s*import\s+[\w, ]+$/);default:return!1}}a(t2c,"isImportStatement")});var OGi=I(M1t=>{"use strict";p();Object.defineProperty(M1t,"__esModule",{value:!0});M1t.IgnoreImportChangesAspect=void 0;var NGi=Eyt(),r2c=Ml(),MGi=DGi(),h3r=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,MGi.isImportStatement)(o,r))||n2c(e,n).some(o=>(0,MGi.isImportStatement)(o,r))}static filterEdit(e,r,n=NGi.ImportChanges.None){if(n===NGi.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};M1t.IgnoreImportChangesAspect=h3r;function n2c(t,e){return(0,r2c.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(n2c,"getOldLines")});var g3r=I(O1t=>{"use strict";p();Object.defineProperty(O1t,"__esModule",{value:!0});O1t.FetchStreamError=void 0;var m3r=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};O1t.FetchStreamError=m3r});var LGi=I(L1t=>{"use strict";p();Object.defineProperty(L1t,"__esModule",{value:!0});L1t.DiagnosticData=void 0;var i2c=x2(),A3r=class{static{a(this,"DiagnosticData")}constructor(e,r,n,o,s,c){this.documentUri=e,this.message=r,this.severity=n,this.range=o,this.code=s,this.source=c}toString(){return`${this.severity.toUpperCase()}: ${this.message} (${this.range})`}equals(e){return(0,i2c.isEqual)(this.documentUri,e.documentUri)&&this.message===e.message&&this.severity===e.severity&&this.range.equals(e.range)&&this.code===e.code&&this.source===e.source}};L1t.DiagnosticData=A3r});var nW=I(CEe=>{"use strict";p();Object.defineProperty(CEe,"__esModule",{value:!0});CEe.ResponseTags=CEe.PromptTags=void 0;var BGi;(function(t){t.CURSOR="<|cursor|>";function e(n){return{start:`<|${n}|>`,end:`<|/${n}|>`}}a(e,"createTag"),t.EDIT_WINDOW=e("code_to_edit"),t.AREA_AROUND=e("area_around_code_to_edit"),t.CURRENT_FILE=e("current_file_content"),t.CURSOR_LOCATION=e("cursor_location"),t.EDIT_HISTORY=e("edit_diff_history"),t.RECENT_FILES=e("recently_viewed_code_snippets"),t.RECENT_FILE=e("recently_viewed_code_snippet");function r(n){return e(n)}a(r,"createLintTag"),t.createLintTag=r})(BGi||(CEe.PromptTags=BGi={}));var FGi;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(FGi||(CEe.ResponseTags=FGi={}))});var C3r=I(jU=>{"use strict";p();var o2c=jU&&jU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},s2c=jU&&jU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jU,"__esModule",{value:!0});jU.LintErrors=void 0;var a2c=LGi(),Sk=wy(),c2c=CV(),l2c=Os(),y3r=x2(),u2c=uh(),QGi=Td(),d2c=Qg(),f2c=nW(),E3r=class{static{a(this,"LintErrors")}constructor(e,r,n,o){this._documentId=e,this._document=r,this._langDiagService=n,this._xtabHistory=o}_diagnostics(e){let r=e?[[e,this._langDiagService.getDiagnostics(e)]]:this._langDiagService.getAllDiagnostics(),n=this._documentId.toUri();return r.map(o=>{let[s,c]=o;return c.map(l=>{let u=new u2c.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,y3r.isEqual)(n,s)?F1t.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new v3r(s,l.message,l.severity===d2c.DiagnosticSeverity.Error?"error":"warning",d,u,this._document.transformer.getOffsetRange(u),l.code&&typeof l.code!="number"&&typeof l.code!="string"?l.code.value:l.code,l.source)})}).flat()}_getRelevantDiagnostics(e,r){let n=this._diagnostics(r);return n=g2c(n,e.maxLineDistance),n=UGi(n),n=_3r(n,e.warnings),n.slice(0,e.maxLints)}getFormattedLintErrors(e){let r=this._getRelevantDiagnostics(e,this._documentId.toUri()),n;if(e.nRecentFiles>0&&this._xtabHistory){let l=this._collectRecentFileUris(e.nRecentFiles),u=this._getRecentFileDiagnostics(l,e);n=[...r,...u].slice(0,e.maxLints)}else n=r;this._previousFormttedDiagnostics=n;let o=this._documentId.toUri(),s=n.map(l=>{let d=(0,y3r.isEqual)(l.documentUri,o)?e:{...e,showCode:Sk.LintOptionShowCode.NO};return B1t(l,this._document.lines,d)}).join(` -`),c=f2c.PromptTags.createLintTag(e.tagName);return`${c.start} +`));break}let u=c+l.length,d=e.substring(0,c),f=r.filter(h=>h.range.start0);n.push(new t(d,f,l)),e=e.substring(u),r=r.map(h=>h.deltaOffset(-u)).filter(h=>h.range.endExclusive>0)}return n}get text(){return this._text}get tokens(){return this._tokens}get length(){return this._text.length}get lengthWithEOL(){return this._text.length+this._eol.length}get eol(){return this._eol}constructor(e,r,n){this._text=e,this._tokens=r,this._eol=n}trim(){return this.trimStart().trimEnd()}trimStart(){let e=this._text.trimStart(),r=this._text.length-e.length,n=this._tokens.map(o=>o.deltaOffset(-r)).filter(o=>o.range.endExclusive>0);return new t(e,n,this._eol)}trimEnd(){let e=this._text.trimEnd(),r=this._tokens.filter(n=>n.range.starts.deltaOffset(-e)).filter(s=>s.range.endExclusive>0&&s.range.startr.equals(e.tokens[n]))}dropTokens(e){return new t(this._text,this._tokens.filter(r=>!e.some(n=>r.equals(n))),this._eol)}findTokens(e){return this._tokens.filter(e)}};QI.LineWithTokens=d3r;function KPc(t){let e=0,r=[];for(let s of t){let c=s.text+s.eol;r.push(...s.tokens.map(l=>l.deltaOffset(e))),e+=c.length}let n=[],o=new Set;for(let s of r)o.has(s.id)||(o.add(s.id),n.push(s));return n}a(KPc,"getTokensFromLinesWithTokens");function JPc(t,e){if(e<0)throw new GPc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new EEe.OffsetRange(o.start-e,o.endExclusive+e)),n=new EEe.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new EEe.OffsetRange(o.start+e,o.endExclusive-e))}a(JPc,"mergeOffsetRangesAtDistance")});var RGi=I(N1t=>{"use strict";p();Object.defineProperty(N1t,"__esModule",{value:!0});N1t.DelaySession=void 0;var f3r=class{static{a(this,"DelaySession")}constructor(e,r,n=Date.now()){this.baseDebounceTime=e,this.expectedTotalTime=r,this.providerInvocationTime=n,this.extraDebounce=0}setExtraDebounce(e){this.extraDebounce=e}setBaseDebounceTime(e){this.baseDebounceTime=e}setExpectedTotalTime(e){this.expectedTotalTime=e}getDebounceTime(){let r=(this.expectedTotalTime===void 0?this.baseDebounceTime:Math.min(this.baseDebounceTime,this.expectedTotalTime))+this.extraDebounce,n=Date.now()-this.providerInvocationTime;return Math.max(0,r-n)}getArtificialDelay(){if(this.expectedTotalTime===void 0)return 0;let e=Date.now()-this.providerInvocationTime;return Math.max(0,this.expectedTotalTime-e)}};N1t.DelaySession=f3r});var NGi=I(Up=>{"use strict";p();var ZPc=Up&&Up.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},M1t=Up&&Up.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Up,"__esModule",{value:!0});Up.UserInteractionMonitor=Up.MAX_INTERACTIONS_STORED=Up.MAX_INTERACTIONS_CONSIDERED=Up.ActionKind=void 0;Up.getWindowWithIgnoredLimit=PGi;Up.getUserHappinessScore=DGi;var vEe=Hl(),Gie=wy(),XPc=Np(),e2c=Rh(),t2c=bh(),kGi=gv(),r2c=RGi(),qI;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(qI||(Up.ActionKind=qI={}));Up.MAX_INTERACTIONS_CONSIDERED=10;Up.MAX_INTERACTIONS_STORED=30;function PGi(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-Up.MAX_INTERACTIONS_CONSIDERED);let s=[],c=0,l=0;for(let u=t.length-1;u>=0&&s.length=o&&(f=!0),n&&l>=o&&(f=!0),f)continue;c++,l++}else c=0;s.push(d)}return s.reverse(),s}a(PGi,"getWindowWithIgnoredLimit");function DGi(t,e){if(t.length===0)return .5;let r=PGi(t,e);if(r.length===0)return .5;let n=0,o=0,s=0;for(let u=0;u0?n/o:.5,l=s/Up.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(DGi,"getUserHappinessScore");var p3r=class{static{a(this,"UserInteractionMonitor")}constructor(e,r,n,o){this._configurationService=e,this._experimentationService=r,this._logService=n,this._telemetryService=o,this._recentUserActionsForAggressiveness=[],this._recentUserActionsForTiming=[],this._lastActionWasAcceptance=!1}handleAcceptance(){this._recordUserAction(qI.Accepted)}handleRejection(){this._recordUserAction(qI.Rejected)}handleIgnored(){this._recordUserAction(qI.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===qI.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-Up.MAX_INTERACTIONS_STORED),e!==qI.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-Up.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(vEe.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(vEe.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new r2c.DelaySession(r,o,e)}_getExpectedTotalTime(e){let l=Date.now(),u=1;for(let f of this._recentUserActionsForTiming){let h=l-f.time;if(h>6e5)continue;let m=Math.exp(-h/6e5),g=f.kind===qI.Rejected?1.5:.8;u*=1+(g-1)*m}let d=e*u;return d=Math.min(3e3,Math.max(50,d)),d}getAggressivenessLevel(){let e=this._configurationService.getExperimentBasedConfig(vEe.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=Gie.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(vEe.ConfigKey.TeamInternal.InlineEditsXtabAggressivenessLevel,this._experimentationService);if(n!==void 0)return{aggressivenessLevel:n,userHappinessScore:void 0};let o,s=this._getUserHappinessScoreConfiguration(),c=this._getUserHappinessScore(s);return c>=s.highThreshold?o=Gie.AggressivenessLevel.High:c>=s.mediumThreshold?o=Gie.AggressivenessLevel.Medium:o=Gie.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=vEe.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return Gie.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,Gie.parseUserHappinessScoreConfigurationString)(r)}catch(n){return this._logService.error(n,"Failed to parse user happiness score configuration, using default config"),this._telemetryService.sendMSFTTelemetryEvent("incorrectNesAdaptiveAggressivenessConfig",{configName:e.id,errorMessage:kGi.ErrorUtils.toString(kGi.ErrorUtils.fromUnknown(n)),configValue:r}),Gie.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return DGi(this._recentUserActionsForAggressiveness,e)}};Up.UserInteractionMonitor=p3r;Up.UserInteractionMonitor=p3r=ZPc([M1t(0,vEe.IConfigurationService),M1t(1,e2c.IExperimentationService),M1t(2,XPc.ILogService),M1t(3,t2c.ITelemetryService)],p3r)});var MGi=I(h3r=>{"use strict";p();Object.defineProperty(h3r,"__esModule",{value:!0});h3r.isImportStatement=n2c;function n2c(t,e){switch(e){case"java":return!!t.match(/^\s*import\s/);case"typescript":case"typescriptreact":case"javascript":case"javascriptreact":return!!t.match(/^\s*import[\s{*]|^\s*[var|const|let].*=\s*require\(/);case"php":return!!t.match(/^\s*use/);case"rust":return!!t.match(/^\s*use\s+[\w:{}, ]+\s*(as\s+\w+)?;/);case"python":return!!t.match(/^\s*from\s+[\w.]+\s+import\s+[\w, *]+$/)||!!t.match(/^\s*import\s+[\w, ]+$/);default:return!1}}a(n2c,"isImportStatement")});var BGi=I(O1t=>{"use strict";p();Object.defineProperty(O1t,"__esModule",{value:!0});O1t.IgnoreImportChangesAspect=void 0;var OGi=vyt(),i2c=Ml(),LGi=MGi(),m3r=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,LGi.isImportStatement)(o,r))||o2c(e,n).some(o=>(0,LGi.isImportStatement)(o,r))}static filterEdit(e,r,n=OGi.ImportChanges.None){if(n===OGi.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};O1t.IgnoreImportChangesAspect=m3r;function o2c(t,e){return(0,i2c.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(o2c,"getOldLines")});var A3r=I(L1t=>{"use strict";p();Object.defineProperty(L1t,"__esModule",{value:!0});L1t.FetchStreamError=void 0;var g3r=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};L1t.FetchStreamError=g3r});var FGi=I(B1t=>{"use strict";p();Object.defineProperty(B1t,"__esModule",{value:!0});B1t.DiagnosticData=void 0;var s2c=x2(),y3r=class{static{a(this,"DiagnosticData")}constructor(e,r,n,o,s,c){this.documentUri=e,this.message=r,this.severity=n,this.range=o,this.code=s,this.source=c}toString(){return`${this.severity.toUpperCase()}: ${this.message} (${this.range})`}equals(e){return(0,s2c.isEqual)(this.documentUri,e.documentUri)&&this.message===e.message&&this.severity===e.severity&&this.range.equals(e.range)&&this.code===e.code&&this.source===e.source}};B1t.DiagnosticData=y3r});var iW=I(CEe=>{"use strict";p();Object.defineProperty(CEe,"__esModule",{value:!0});CEe.ResponseTags=CEe.PromptTags=void 0;var UGi;(function(t){t.CURSOR="<|cursor|>";function e(n){return{start:`<|${n}|>`,end:`<|/${n}|>`}}a(e,"createTag"),t.EDIT_WINDOW=e("code_to_edit"),t.AREA_AROUND=e("area_around_code_to_edit"),t.CURRENT_FILE=e("current_file_content"),t.CURSOR_LOCATION=e("cursor_location"),t.EDIT_HISTORY=e("edit_diff_history"),t.RECENT_FILES=e("recently_viewed_code_snippets"),t.RECENT_FILE=e("recently_viewed_code_snippet");function r(n){return e(n)}a(r,"createLintTag"),t.createLintTag=r})(UGi||(CEe.PromptTags=UGi={}));var QGi;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(QGi||(CEe.ResponseTags=QGi={}))});var b3r=I(jU=>{"use strict";p();var a2c=jU&&jU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},c2c=jU&&jU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jU,"__esModule",{value:!0});jU.LintErrors=void 0;var l2c=FGi(),Sk=wy(),u2c=bV(),d2c=Os(),_3r=x2(),f2c=uh(),jGi=Id(),p2c=qg(),h2c=iW(),v3r=class{static{a(this,"LintErrors")}constructor(e,r,n,o){this._documentId=e,this._document=r,this._langDiagService=n,this._xtabHistory=o}_diagnostics(e){let r=e?[[e,this._langDiagService.getDiagnostics(e)]]:this._langDiagService.getAllDiagnostics(),n=this._documentId.toUri();return r.map(o=>{let[s,c]=o;return c.map(l=>{let u=new f2c.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,_3r.isEqual)(n,s)?U1t.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new C3r(s,l.message,l.severity===p2c.DiagnosticSeverity.Error?"error":"warning",d,u,this._document.transformer.getOffsetRange(u),l.code&&typeof l.code!="number"&&typeof l.code!="string"?l.code.value:l.code,l.source)})}).flat()}_getRelevantDiagnostics(e,r){let n=this._diagnostics(r);return n=y2c(n,e.maxLineDistance),n=qGi(n),n=E3r(n,e.warnings),n.slice(0,e.maxLints)}getFormattedLintErrors(e){let r=this._getRelevantDiagnostics(e,this._documentId.toUri()),n;if(e.nRecentFiles>0&&this._xtabHistory){let l=this._collectRecentFileUris(e.nRecentFiles),u=this._getRecentFileDiagnostics(l,e);n=[...r,...u].slice(0,e.maxLints)}else n=r;this._previousFormttedDiagnostics=n;let o=this._documentId.toUri(),s=n.map(l=>{let d=(0,_3r.isEqual)(l.documentUri,o)?e:{...e,showCode:Sk.LintOptionShowCode.NO};return F1t(l,this._document.lines,d)}).join(` +`),c=h2c.PromptTags.createLintTag(e.tagName);return`${c.start} ${s} -${c.end}`}_collectRecentFileUris(e){if(!this._xtabHistory)return[];let r=[],n=new Set,o=this._documentId;for(let s=this._xtabHistory.length-1;s>=0;--s){let c=this._xtabHistory[s];if(!(c.docId===o||n.has(c.docId))&&(r.push(c.docId.toUri()),n.add(c.docId),r.length>=e))break}return r}_getRecentFileDiagnostics(e,r){let n=[];for(let o of e){let s=this._diagnostics(o);s=_3r(s,r.warnings),s=s.slice().sort((c,l)=>c.documentRange.startLineNumber-l.documentRange.startLineNumber),n.push(...s)}return n}lineNumberInPreviousFormattedPrompt(e,r){if(!this._previousFormttedDiagnostics)throw new l2c.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,y3r.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===Sk.LintOptionShowCode.NO)continue;if(qGi(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:Sk.LintOptionWarning.YES,showCode:Sk.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=_3r(r,Sk.LintOptionWarning.YES),r=UGi(r),r=r.slice(0,20);let n=r.map(o=>({uri:o.documentUri.toString(),line:o.documentRange.startLineNumber,column:o.documentRange.startColumn,endLine:o.documentRange.endLineNumber,endColumn:o.documentRange.endColumn,severity:o.severity,message:o.message,code:o.code,source:o.source,lineDistance:o.distance?.lineDistance,formatted:B1t(o,this._document.lines,e),formattedCode:B1t(o,this._document.lines,{...e,showCode:Sk.LintOptionShowCode.YES}),formattedCodeWithSurrounding:B1t(o,this._document.lines,{...e,showCode:Sk.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};jU.LintErrors=E3r;jU.LintErrors=E3r=o2c([s2c(2,c2c.ILanguageDiagnosticsService)],E3r);function B1t(t,e,r){let n=p2c(t,t.documentRange);if(r.showCode===Sk.LintOptionShowCode.NO)return n;let o=h2c(t.documentRange,r,e);return n+` +${c.end}`}_collectRecentFileUris(e){if(!this._xtabHistory)return[];let r=[],n=new Set,o=this._documentId;for(let s=this._xtabHistory.length-1;s>=0;--s){let c=this._xtabHistory[s];if(!(c.docId===o||n.has(c.docId))&&(r.push(c.docId.toUri()),n.add(c.docId),r.length>=e))break}return r}_getRecentFileDiagnostics(e,r){let n=[];for(let o of e){let s=this._diagnostics(o);s=E3r(s,r.warnings),s=s.slice().sort((c,l)=>c.documentRange.startLineNumber-l.documentRange.startLineNumber),n.push(...s)}return n}lineNumberInPreviousFormattedPrompt(e,r){if(!this._previousFormttedDiagnostics)throw new d2c.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,_3r.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===Sk.LintOptionShowCode.NO)continue;if(HGi(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:Sk.LintOptionWarning.YES,showCode:Sk.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=E3r(r,Sk.LintOptionWarning.YES),r=qGi(r),r=r.slice(0,20);let n=r.map(o=>({uri:o.documentUri.toString(),line:o.documentRange.startLineNumber,column:o.documentRange.startColumn,endLine:o.documentRange.endLineNumber,endColumn:o.documentRange.endColumn,severity:o.severity,message:o.message,code:o.code,source:o.source,lineDistance:o.distance?.lineDistance,formatted:F1t(o,this._document.lines,e),formattedCode:F1t(o,this._document.lines,{...e,showCode:Sk.LintOptionShowCode.YES}),formattedCodeWithSurrounding:F1t(o,this._document.lines,{...e,showCode:Sk.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};jU.LintErrors=v3r;jU.LintErrors=v3r=a2c([c2c(2,u2c.ILanguageDiagnosticsService)],v3r);function F1t(t,e,r){let n=m2c(t,t.documentRange);if(r.showCode===Sk.LintOptionShowCode.NO)return n;let o=g2c(t.documentRange,r,e);return n+` `+o.join(` -`)}a(B1t,"formatSingleDiagnostic");function p2c(t,e){let r="";t.code&&(r=` ${t.source?t.source.toUpperCase():""}${t.code}`);let n=e.getStartPosition();return`${n.lineNumber-1}:${n.column-1} - ${t.severity}${r}: ${t.message}`}a(p2c,"formatDiagnosticMessage");function h2c(t,e,r){let o=qGi(t,e).intersect(new QGi.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(g2c,"filterDiagnosticsByDistance");function UGi(t){return t.slice().sort((e,r)=>e.distance===void 0&&r.distance===void 0?0:e.distance===void 0?1:r.distance===void 0?-1:F1t.compareFn(e.distance,r.distance))}a(UGi,"sortDiagnosticsByDistance");function _3r(t,e){switch(e){case Sk.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case Sk.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case Sk.LintOptionWarning.YES_IF_NO_ERRORS:{let r=t.filter(n=>n.severity==="error");return r.length>0?r:t.filter(n=>n.severity==="error"||n.severity==="warning")}}}a(_3r,"filterDiagnosticsBySeverity");var F1t=class t{static{a(this,"CursorDistance")}static compareFn(e,r){return e.lineDistance!==r.lineDistance?e.lineDistance-r.lineDistance:e.columnDistance-r.columnDistance}static fromPositions(e,r){return new t(Math.abs(e.lineNumber-r.lineNumber),Math.abs(e.column-r.column))}constructor(e,r){this.lineDistance=e,this.columnDistance=r}},v3r=class extends a2c.DiagnosticData{static{a(this,"DiagnosticDataWithDistance")}constructor(e,r,n,o,s,c,l,u){super(e,r,n,c,l,u),this.distance=o,this.documentRange=s}}});var bEe=I(U1t=>{"use strict";p();Object.defineProperty(U1t,"__esModule",{value:!0});U1t.toUniquePath=y2c;U1t.countTokensForLines=_2c;var A2c=XJ();function y2c(t,e){let r=t.path,n=e===void 0?void 0:e.endsWith("/")?e:e+"/",o=n!==void 0&&r.startsWith(n)?r.substring(n.length):r;return t.toUri().scheme===A2c.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(y2c,"toUniquePath");function _2c(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(_2c,"countTokensForLines")});var jGi=I(b3r=>{"use strict";p();Object.defineProperty(b3r,"__esModule",{value:!0});b3r.getEditDiffHistory=C2c;var E2c=ON(),iW=Ml(),v2c=bEe();function C2c(t,e,r,n,{onlyForDocsInPrompt:o,maxTokens:s,nEntries:c,useRelativePaths:l}){let u=l?t.workspaceRoot?.path:void 0,d=e.slice().reverse(),f=s,h=0,m=[];for(let y of d){if(m.length>=c)break;if(y.kind==="visibleRanges"||o&&!r.has(y.docId))continue;let _=b2c(y,u);if(_===null)continue;let E=n(_);if(f-=E,f<0)break;h+=E,m.push(_)}let g=m.reverse(),A=g.join(` +`)}a(F1t,"formatSingleDiagnostic");function m2c(t,e){let r="";t.code&&(r=` ${t.source?t.source.toUpperCase():""}${t.code}`);let n=e.getStartPosition();return`${n.lineNumber-1}:${n.column-1} - ${t.severity}${r}: ${t.message}`}a(m2c,"formatDiagnosticMessage");function g2c(t,e,r){let o=HGi(t,e).intersect(new jGi.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(y2c,"filterDiagnosticsByDistance");function qGi(t){return t.slice().sort((e,r)=>e.distance===void 0&&r.distance===void 0?0:e.distance===void 0?1:r.distance===void 0?-1:U1t.compareFn(e.distance,r.distance))}a(qGi,"sortDiagnosticsByDistance");function E3r(t,e){switch(e){case Sk.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case Sk.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case Sk.LintOptionWarning.YES_IF_NO_ERRORS:{let r=t.filter(n=>n.severity==="error");return r.length>0?r:t.filter(n=>n.severity==="error"||n.severity==="warning")}}}a(E3r,"filterDiagnosticsBySeverity");var U1t=class t{static{a(this,"CursorDistance")}static compareFn(e,r){return e.lineDistance!==r.lineDistance?e.lineDistance-r.lineDistance:e.columnDistance-r.columnDistance}static fromPositions(e,r){return new t(Math.abs(e.lineNumber-r.lineNumber),Math.abs(e.column-r.column))}constructor(e,r){this.lineDistance=e,this.columnDistance=r}},C3r=class extends l2c.DiagnosticData{static{a(this,"DiagnosticDataWithDistance")}constructor(e,r,n,o,s,c,l,u){super(e,r,n,c,l,u),this.distance=o,this.documentRange=s}}});var bEe=I(Q1t=>{"use strict";p();Object.defineProperty(Q1t,"__esModule",{value:!0});Q1t.toUniquePath=E2c;Q1t.countTokensForLines=v2c;var _2c=eZ();function E2c(t,e){let r=t.path,n=e===void 0?void 0:e.endsWith("/")?e:e+"/",o=n!==void 0&&r.startsWith(n)?r.substring(n.length):r;return t.toUri().scheme===_2c.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(E2c,"toUniquePath");function v2c(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(v2c,"countTokensForLines")});var GGi=I(S3r=>{"use strict";p();Object.defineProperty(S3r,"__esModule",{value:!0});S3r.getEditDiffHistory=S2c;var C2c=ON(),oW=Ml(),b2c=bEe();function S2c(t,e,r,n,{onlyForDocsInPrompt:o,maxTokens:s,nEntries:c,useRelativePaths:l}){let u=l?t.workspaceRoot?.path:void 0,d=e.slice().reverse(),f=s,h=0,m=[];for(let y of d){if(m.length>=c)break;if(y.kind==="visibleRanges"||o&&!r.has(y.docId))continue;let _=T2c(y,u);if(_===null)continue;let E=n(_);if(f-=E,f<0)break;h+=E,m.push(_)}let g=m.reverse(),A=g.join(` `);return g.length>0&&(A+=` -`),{promptPiece:A,nDiffs:m.length,totalTokens:h}}a(C2c,"getEditDiffHistory");function b2c(t,e){let r=[],n=E2c.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,iW.groupAdjacentBy)(n.replacements,(d,f)=>d.lineRange.endLineNumberExclusive>=f.lineRange.startLineNumber)){let d=[],f=[],h=u[0].lineRange.startLineNumber;for(let g of u){if(hg.trim().length===0)&&f.every(g=>g.trim().length===0)||d.length===f.length&&d.every((g,A)=>g===f[A]))continue;let m=u[0].lineRange.startLineNumber-1;r.push(`@@ -${m},${d.length} +${m},${f.length} @@`),(0,iW.pushMany)(r,d.map(g=>`-${g}`)),(0,iW.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,v2c.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,iW.pushMany)(c,r),c.join(` -`)}a(b2c,"generateDocDiff")});var S3r=I(oW=>{"use strict";p();Object.defineProperty(oW,"__esModule",{value:!0});oW.count=S2c;oW.findInsertionIndexInSortedArray=T2c;oW.max=I2c;oW.filterMap=x2c;oW.min=w2c;oW.batchArrayElements=R2c;function S2c(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(S2c,"count");function T2c(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(T2c,"findInsertionIndexInSortedArray");function I2c(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(I2c,"max");function x2c(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a(x2c,"filterMap");function w2c(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var k2c=gE&&gE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),P2c=gE&&gE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),D2c=gE&&gE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oR3r(_.entries)):d=$Gi(e,t.id,c,l).map(_=>WGi(_));let{snippets:f,docsInPrompt:h}=XGi(d,n,o),m=[];r&&zGi(r,m,o.languageContext.maxTokens,n);let g=[],A;return o.neighborFiles.enabled&&s&&s.length>0&&(A=YGi(s,g,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:[...f,...m,...g].join(` +`),{promptPiece:A,nDiffs:m.length,totalTokens:h}}a(S2c,"getEditDiffHistory");function T2c(t,e){let r=[],n=C2c.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,oW.groupAdjacentBy)(n.replacements,(d,f)=>d.lineRange.endLineNumberExclusive>=f.lineRange.startLineNumber)){let d=[],f=[],h=u[0].lineRange.startLineNumber;for(let g of u){if(hg.trim().length===0)&&f.every(g=>g.trim().length===0)||d.length===f.length&&d.every((g,A)=>g===f[A]))continue;let m=u[0].lineRange.startLineNumber-1;r.push(`@@ -${m},${d.length} +${m},${f.length} @@`),(0,oW.pushMany)(r,d.map(g=>`-${g}`)),(0,oW.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,b2c.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,oW.pushMany)(c,r),c.join(` +`)}a(T2c,"generateDocDiff")});var T3r=I(sW=>{"use strict";p();Object.defineProperty(sW,"__esModule",{value:!0});sW.count=I2c;sW.findInsertionIndexInSortedArray=x2c;sW.max=w2c;sW.filterMap=R2c;sW.min=k2c;sW.batchArrayElements=P2c;function I2c(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(I2c,"count");function x2c(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(x2c,"findInsertionIndexInSortedArray");function w2c(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(w2c,"max");function R2c(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a(R2c,"filterMap");function k2c(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var D2c=gE&&gE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N2c=gE&&gE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),M2c=gE&&gE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ok3r(_.entries)):d=WGi(e,t.id,c,l).map(_=>YGi(_));let{snippets:f,docsInPrompt:h}=t$i(d,n,o),m=[];r&&KGi(r,m,o.languageContext.maxTokens,n);let g=[],A;return o.neighborFiles.enabled&&s&&s.length>0&&(A=JGi(s,g,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:[...f,...m,...g].join(` `),documents:h,neighborSnippetsResult:A,subsections:{recentlyViewedFiles:f.join(` @@ -1189,10 +1189,10 @@ ${c.end}`}_collectRecentFileUris(e){if(!this._xtabHistory)return[];let r=[],n=ne `),neighborFiles:g.join(` -`)}}}a(F2c,"getRecentCodeSnippets");function U2c(t,e,r){switch(e){case Q1t.IncludeLineNumbersOption.WithSpaceAfter:return t.map((n,o)=>`${r+o}| ${n}`);case Q1t.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case Q1t.IncludeLineNumbersOption.None:return t;default:(0,M2c.assertNever)(e)}}a(U2c,"formatLinesWithLineNumbers");function q1t(t,e,r){let n=(0,x3r.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=U2c(e,r.includeLineNumbers,r.startLineOffset).join(` -`);return[HGi.PromptTags.RECENT_FILE.start,o,c,HGi.PromptTags.RECENT_FILE.end].join(` -`)}a(q1t,"formatCodeSnippet");function $Gi(t,e,r,n){let o=[],s=new Set;for(let c=t.length-1;c>=0;--c){let l=t[c];if(!(!r&&l.kind==="visibleRanges")&&!(l.docId===e||s.has(l.docId))&&(o.push(l),s.add(l.docId),o.length>=n))break}return o}a($Gi,"collectRecentDocuments");function VGi(t,e,r,n){let o=[],s=new Map;for(let c=t.length-1;c>=0;--c){let l=t[c];if(!r&&l.kind==="visibleRanges"||l.docId===e)continue;let u=s.get(l.docId);if(u)u.push(l);else{if(o.length>=n)continue;o.push(l.docId),s.set(l.docId,[l])}}return o.map(c=>({docId:c,entries:s.get(c)}))}a(VGi,"collectRecentDocumentsGrouped");function Q2c(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===I3r.RecentFileClippingStrategy.Proportional?VGi(e,t.id,n,o).map(u=>R3r(u.entries)):$Gi(e,t.id,n,o).map(l=>WGi(l))}a(Q2c,"prepareRecentCodeSnippets");function w3r(t,e,r){if(t.length<=1)return t;let n=[t[0]],o=e(t[0].start),s=e(Math.max(t[0].start,t[0].endExclusive-1));for(let c=1;cr)break;n.push(l),o=f,s=h}return n}a(w3r,"selectFocalRangesWithinSpanCap");function WGi(t){if(t.kind==="edit"){let e=t.edit.edit.applyOnText(t.edit.base);return{id:t.docId,content:e,focalRanges:t.edit.edit.getNewRanges(),editEntryCount:1}}return{id:t.docId,content:t.documentContent,focalRanges:t.visibleRanges}}a(WGi,"historyEntryToCodeSnippet");function R3r(t){let e=t[0],r=e.kind==="edit"?e.edit.edit.applyOnText(e.edit.base):e.documentContent,n=[];for(let s of t)s.kind==="edit"&&n.push(s);let o=[];for(let s=0;s=0;l--)c=c.map(u=>n[l].edit.edit.applyToOffsetRange(u));o.push(...c)}return{id:e.docId,content:r,focalRanges:o.length>0?o:void 0,editEntryCount:Math.max(n.length,1)}}a(R3r,"historyEntriesToCodeSnippet");function zGi(t,e,r,n){let o=r;for(let s of t.items){if(s.onTimeout)continue;let c=s.context;if(c.kind===N2c.ContextKind.Snippet){let l=c.value,u=r-n(l);if(u<0)break;let d=T3r.DocumentId.create(c.uri.toString());e.push(q1t(d,l.split(/\r?\n/),{truncated:!1,includeLineNumbers:Q1t.IncludeLineNumbersOption.None,startLineOffset:0})),r=u}}return o-r}a(zGi,"appendLanguageContextSnippets");function YGi(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=T3r.DocumentId.create(f.uri);if(r.has(h))continue;let m=n-o(f.snippet);m<0||(l.push({snippet:f,originalIndex:d}),r.add(h),n=m)}for(let d=l.length-1;d>=0;d--){let f=l[d].snippet;e.push(q1t(T3r.DocumentId.create(f.uri),f.snippet.split(/\r?\n/),{truncated:!1,includeLineNumbers:s,startLineOffset:f.lineRange.startLine}))}let u=l.map(d=>d.originalIndex).sort((d,f)=>d-f);return{nComputed:t.length,nIncluded:l.length,includedIndices:u,tokensConsumed:c-n}}a(YGi,"appendNeighborFileSnippets");function KGi(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,x3r.countTokensForLines)(d,o);if(f<0)break;u.push(...d),l=f}if(u.length>0){let d=u.length!==r;c.docsInPrompt.add(t.id),c.snippets.push(q1t(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(KGi,"clipFullDocument");function JGi(t,e,r,n){let o=t.getTransformer(),s=r*3,c=w3r(e,y=>o.getPosition(y).lineNumber,s);if(c.length===0)return;let l=Math.min(...c.map(y=>y.start)),u=Math.max(...c.map(y=>y.endExclusive-1)),d=o.getPosition(l).lineNumber,f=o.getPosition(u).lineNumber,h=t.getLines(),m=Math.floor((d-1)/r),g=Math.floor((f-1)/r),A=0;for(let y=m;y<=g;y++){let _=y*r,E=Math.min(_+r,h.length);A+=(0,x3r.countTokensForLines)(h.slice(_,E),n)}return A}a(JGi,"computeFocalPageCost");function ZGi(t,e,r,n,o,s,c,l){if(n<=0)return;let u=t.content.getTransformer(),d=e*3,f=w3r(t.focalRanges,T=>u.getPosition(T).lineNumber,d);if(f.length===0)return n;let h=Math.min(...f.map(T=>T.start)),m=Math.max(...f.map(T=>T.endExclusive-1)),g=u.getPosition(h),A=u.getPosition(m),{firstPageIdx:y,lastPageIdxIncl:_,budgetLeft:E}=(0,B2c.expandRangeToPageRange)(t.content.getLines(),new L2c.OffsetRange(g.lineNumber-1,A.lineNumber),e,n,o,!1,c);if(E===n||E<0)return;let v=y*e,S=t.content.getLines().slice(v,(_+1)*e);return l.docsInPrompt.add(t.id),l.snippets.push(q1t(t.id,S,{truncated:S.length_.focalRanges!==void 0&&_.focalRanges.length>0?JGi(_.content,_.focalRanges,n,e)??0:0),d=t.length,f=u.reduce((_,E)=>_+E,0);for(;d>0&&f>s;)d--,f-=u[d];if(d===0)return{snippets:[],docsInPrompt:new Set,tokensConsumed:0};let h=s-f,m=t.slice(0,d).map(_=>_.editEntryCount??1),g=m.reduce((_,E)=>_+E,0),A=m.map(_=>Math.floor(h*(_/g))),y=0;for(let _=0;_0)y=ZGi(E,n,v.length,S,e,c,l,o)??S;else{let T=(0,GGi.batchArrayElements)(v,n);y=KGi(E,T,v.length,S,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-y}}a(j2c,"buildCodeSnippetsWithProportionalBudget")});var j1t=I(Pd=>{"use strict";p();var H2c=Pd&&Pd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),G2c=Pd&&Pd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$2c=Pd&&Pd.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o`${r+o}| ${n}`);case q1t.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case q1t.IncludeLineNumbersOption.None:return t;default:(0,L2c.assertNever)(e)}}a(q2c,"formatLinesWithLineNumbers");function j1t(t,e,r){let n=(0,w3r.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=q2c(e,r.includeLineNumbers,r.startLineOffset).join(` +`);return[$Gi.PromptTags.RECENT_FILE.start,o,c,$Gi.PromptTags.RECENT_FILE.end].join(` +`)}a(j1t,"formatCodeSnippet");function WGi(t,e,r,n){let o=[],s=new Set;for(let c=t.length-1;c>=0;--c){let l=t[c];if(!(!r&&l.kind==="visibleRanges")&&!(l.docId===e||s.has(l.docId))&&(o.push(l),s.add(l.docId),o.length>=n))break}return o}a(WGi,"collectRecentDocuments");function zGi(t,e,r,n){let o=[],s=new Map;for(let c=t.length-1;c>=0;--c){let l=t[c];if(!r&&l.kind==="visibleRanges"||l.docId===e)continue;let u=s.get(l.docId);if(u)u.push(l);else{if(o.length>=n)continue;o.push(l.docId),s.set(l.docId,[l])}}return o.map(c=>({docId:c,entries:s.get(c)}))}a(zGi,"collectRecentDocumentsGrouped");function j2c(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===x3r.RecentFileClippingStrategy.Proportional?zGi(e,t.id,n,o).map(u=>k3r(u.entries)):WGi(e,t.id,n,o).map(l=>YGi(l))}a(j2c,"prepareRecentCodeSnippets");function R3r(t,e,r){if(t.length<=1)return t;let n=[t[0]],o=e(t[0].start),s=e(Math.max(t[0].start,t[0].endExclusive-1));for(let c=1;cr)break;n.push(l),o=f,s=h}return n}a(R3r,"selectFocalRangesWithinSpanCap");function YGi(t){if(t.kind==="edit"){let e=t.edit.edit.applyOnText(t.edit.base);return{id:t.docId,content:e,focalRanges:t.edit.edit.getNewRanges(),editEntryCount:1}}return{id:t.docId,content:t.documentContent,focalRanges:t.visibleRanges}}a(YGi,"historyEntryToCodeSnippet");function k3r(t){let e=t[0],r=e.kind==="edit"?e.edit.edit.applyOnText(e.edit.base):e.documentContent,n=[];for(let s of t)s.kind==="edit"&&n.push(s);let o=[];for(let s=0;s=0;l--)c=c.map(u=>n[l].edit.edit.applyToOffsetRange(u));o.push(...c)}return{id:e.docId,content:r,focalRanges:o.length>0?o:void 0,editEntryCount:Math.max(n.length,1)}}a(k3r,"historyEntriesToCodeSnippet");function KGi(t,e,r,n){let o=r;for(let s of t.items){if(s.onTimeout)continue;let c=s.context;if(c.kind===O2c.ContextKind.Snippet){let l=c.value,u=r-n(l);if(u<0)break;let d=I3r.DocumentId.create(c.uri.toString());e.push(j1t(d,l.split(/\r?\n/),{truncated:!1,includeLineNumbers:q1t.IncludeLineNumbersOption.None,startLineOffset:0})),r=u}}return o-r}a(KGi,"appendLanguageContextSnippets");function JGi(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=I3r.DocumentId.create(f.uri);if(r.has(h))continue;let m=n-o(f.snippet);m<0||(l.push({snippet:f,originalIndex:d}),r.add(h),n=m)}for(let d=l.length-1;d>=0;d--){let f=l[d].snippet;e.push(j1t(I3r.DocumentId.create(f.uri),f.snippet.split(/\r?\n/),{truncated:!1,includeLineNumbers:s,startLineOffset:f.lineRange.startLine}))}let u=l.map(d=>d.originalIndex).sort((d,f)=>d-f);return{nComputed:t.length,nIncluded:l.length,includedIndices:u,tokensConsumed:c-n}}a(JGi,"appendNeighborFileSnippets");function ZGi(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,w3r.countTokensForLines)(d,o);if(f<0)break;u.push(...d),l=f}if(u.length>0){let d=u.length!==r;c.docsInPrompt.add(t.id),c.snippets.push(j1t(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(ZGi,"clipFullDocument");function XGi(t,e,r,n){let o=t.getTransformer(),s=r*3,c=R3r(e,y=>o.getPosition(y).lineNumber,s);if(c.length===0)return;let l=Math.min(...c.map(y=>y.start)),u=Math.max(...c.map(y=>y.endExclusive-1)),d=o.getPosition(l).lineNumber,f=o.getPosition(u).lineNumber,h=t.getLines(),m=Math.floor((d-1)/r),g=Math.floor((f-1)/r),A=0;for(let y=m;y<=g;y++){let _=y*r,E=Math.min(_+r,h.length);A+=(0,w3r.countTokensForLines)(h.slice(_,E),n)}return A}a(XGi,"computeFocalPageCost");function e$i(t,e,r,n,o,s,c,l){if(n<=0)return;let u=t.content.getTransformer(),d=e*3,f=R3r(t.focalRanges,T=>u.getPosition(T).lineNumber,d);if(f.length===0)return n;let h=Math.min(...f.map(T=>T.start)),m=Math.max(...f.map(T=>T.endExclusive-1)),g=u.getPosition(h),A=u.getPosition(m),{firstPageIdx:y,lastPageIdxIncl:_,budgetLeft:E}=(0,U2c.expandRangeToPageRange)(t.content.getLines(),new F2c.OffsetRange(g.lineNumber-1,A.lineNumber),e,n,o,!1,c);if(E===n||E<0)return;let v=y*e,S=t.content.getLines().slice(v,(_+1)*e);return l.docsInPrompt.add(t.id),l.snippets.push(j1t(t.id,S,{truncated:S.length_.focalRanges!==void 0&&_.focalRanges.length>0?XGi(_.content,_.focalRanges,n,e)??0:0),d=t.length,f=u.reduce((_,E)=>_+E,0);for(;d>0&&f>s;)d--,f-=u[d];if(d===0)return{snippets:[],docsInPrompt:new Set,tokensConsumed:0};let h=s-f,m=t.slice(0,d).map(_=>_.editEntryCount??1),g=m.reduce((_,E)=>_+E,0),A=m.map(_=>Math.floor(h*(_/g))),y=0;for(let _=0;_0)y=e$i(E,n,v.length,S,e,c,l,o)??S;else{let T=(0,VGi.batchArrayElements)(v,n);y=ZGi(E,T,v.length,S,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-y}}a(G2c,"buildCodeSnippetsWithProportionalBudget")});var H1t=I(Dd=>{"use strict";p();var $2c=Dd&&Dd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),V2c=Dd&&Dd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),W2c=Dd&&Dd.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;of.add(x)),T=R.tokensConsumed;break}case"languageContext":{r&&(T=(0,vFe.appendLanguageContextSnippets)(r,u,S,n));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,vFe.appendNeighborFileSnippets)(s,d,f,S,n,o.recentlyViewedDocuments.includeLineNumbers),T=h.tokensConsumed);break}case"diffHistory":{let w={...o.diffHistory,maxTokens:S},R=(0,i$i.getEditDiffHistory)(t,e,f,n,w);m=R.promptPiece,g=R.nDiffs,T=R.totalTokens;break}default:(0,CFe.assertNever)(E)}(0,CFe.softAssert)(T>=0&&T<=S,`globalBudget part '${E}' reported tokensConsumed=${T} outside [0, ${S}]`),y=Math.max(0,S-T)}return{codeSnippets:[...l,...u,...d].join(` +${o}`;break}let L=d.promptingStrategy!==zl.PromptingStrategy.Nes41Miniv3&&d.promptingStrategy!==zl.PromptingStrategy.Codexv21NesUnified&&d.promptingStrategy!==zl.PromptingStrategy.PatchBased01&&d.promptingStrategy!==zl.PromptingStrategy.PatchBased02&&d.promptingStrategy!==zl.PromptingStrategy.PatchBased02WithRecentLineNumbers&&d.promptingStrategy!==zl.PromptingStrategy.PatchBased02WithoutRecentLineNumbers?J2c(O):O,Q=(Z2c(S,L,d.languageContext.traitPosition)+w).trim(),Y=u(x),W=u(k),V=u(R),z=u(D),ie=u(q),H=u(B),re=u(S),le=u(w),Le=u(Q),me=Y+W+V+z+ie+H+re+le,Oe={recentlyViewed:Y,currentFile:W,lintErrors:V,editHistory:z,areaAroundCodeToEdit:ie,cursorLocation:H,relatedInformation:re,postScript:le,overhead:Le-me,userPromptTotal:Le,systemPrompt:0,recentlyViewedSubsections:{recentlyViewedFiles:u(A.recentlyViewedFiles),languageContext:u(A.languageContext),neighborFiles:u(A.neighborFiles)}};return{prompt:Q,nDiffsInPrompt:v,neighborSnippetsResult:_,sectionTokens:Oe}}a(K2c,"getUserPrompt");function a$i(t,e,r,n,o,s,c){zl.GlobalBudgetOptions.validate(c);let l=[],u=[],d=[],f=new Set;f.add(t.id);let h,m="",g=0,A=(0,vFe.prepareRecentCodeSnippets)(t,e,o),y=0;for(let E of c.order){let v=c.shares[E]??0,S=Math.max(0,Math.floor(y+c.totalTokens*v)),T=0;switch(E){case"recentlyViewedDocuments":{let w={...o,recentlyViewedDocuments:{...o.recentlyViewedDocuments,maxTokens:S}},R=(0,vFe.buildCodeSnippetsUsingPagedClipping)(A,n,w);l.push(...R.snippets),R.docsInPrompt.forEach(x=>f.add(x)),T=R.tokensConsumed;break}case"languageContext":{r&&(T=(0,vFe.appendLanguageContextSnippets)(r,u,S,n));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,vFe.appendNeighborFileSnippets)(s,d,f,S,n,o.recentlyViewedDocuments.includeLineNumbers),T=h.tokensConsumed);break}case"diffHistory":{let w={...o.diffHistory,maxTokens:S},R=(0,s$i.getEditDiffHistory)(t,e,f,n,w);m=R.promptPiece,g=R.nDiffs,T=R.totalTokens;break}default:(0,CFe.assertNever)(E)}(0,CFe.softAssert)(T>=0&&T<=S,`globalBudget part '${E}' reported tokensConsumed=${T} outside [0, ${S}]`),y=Math.max(0,S-T)}return{codeSnippets:[...l,...u,...d].join(` `),documents:f,neighborSnippetsResult:h,editDiffHistory:m,nDiffsInPrompt:g,subsections:{recentlyViewedFiles:l.join(` @@ -1218,22 +1218,22 @@ ${o}`;break}let L=d.promptingStrategy!==zl.PromptingStrategy.Nes41Miniv3&&d.prom `),neighborFiles:d.join(` -`)},finalSurplus:y}}a(o$i,"runGlobalBudgetCascade");function Y2c(t){return`\`\`\` +`)},finalSurplus:y}}a(a$i,"runGlobalBudgetCascade");function J2c(t){return`\`\`\` ${t} -\`\`\``}a(Y2c,"wrapInBackticks");function K2c(t,e,r){return r==="before"?r$i(t,e,2):r$i(e,t,2)}a(K2c,"addRelatedInformation");function r$i(t,e,r){let n=0;for(let s=t.length-1;s>=0&&t[s]===` +\`\`\``}a(J2c,"wrapInBackticks");function Z2c(t,e,r){return r==="before"?i$i(t,e,2):i$i(e,t,2)}a(Z2c,"addRelatedInformation");function i$i(t,e,r){let n=0;for(let s=t.length-1;s>=0&&t[s]===` `;s--)n++;for(let s=0;s, , or . If you are making an edit, start with and then provide the rewritten code window followed by . If you are inserting new code, start with and then provide only the new code that will be inserted at the cursor position followed by . If no changes are necessary, reply only with . Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;break;case zl.PromptingStrategy.Nes41Miniv3:o=`The developer was working on a section of code within the tags <|code_to_edit|> in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`<|cursor|>\`, please continue the developer's work. Update the <|code_to_edit|> section by predicting and completing the changes they would have made next. Start your response with or . If you are making an edit, start with and then provide the rewritten code window followed by . If no changes are necessary, reply only with . Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;break;case zl.PromptingStrategy.Xtab275EditIntentShort:case zl.PromptingStrategy.Xtab275EditIntent:case zl.PromptingStrategy.Xtab275:o=n;break;case zl.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case zl.PromptingStrategy.Xtab275Aggressiveness:o=`${n} +`.repeat(o)+e).trim()}a(i$i,"appendWithNewLineIfNeeded");function X2c(t,e,r){let n=`The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${Lh.PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Provide the revised code that was between the \`${Lh.PromptTags.EDIT_WINDOW.start}\` and \`${Lh.PromptTags.EDIT_WINDOW.end}\` tags, but do not include the tags themselves. Avoid undoing or reverting the developer's last change unless there are obvious typos or errors. Don't include the line numbers or the form #| in your response. Do not skip any lines. Do not be lazy.`,o;switch(t){case zl.PromptingStrategy.PatchBased01:case zl.PromptingStrategy.Codexv21NesUnified:break;case zl.PromptingStrategy.PatchBased02:case zl.PromptingStrategy.PatchBased02WithRecentLineNumbers:case zl.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:o="The developer was working on a section of code within the `current_file_content` - carefully note their `cursor_location` marked with `<|cursor|>`. Using the given `recently_viewed_code_snippets`, `current_file_content`, `edit_diff_history`, and `cursor_location`, please continue the developer's work. Output a modified diff format with a sequence of intuitive next changes, where each patch must start with `:`. Order changes by priority and flow; for instance, edits adjacent to the user's cursor should always be prioritized, followed by lines near the cursor, followed by lines farther away. If there are no good edit candidates, output the empty string \"\". Avoid undoing or reverting the developer's last change unless there are obvious typos or errors. Adhere meticulously to the diff format.";break;case zl.PromptingStrategy.UnifiedModel:o=`The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${Lh.PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Start your response with , , or . If you are making an edit, start with and then provide the rewritten code window followed by . If you are inserting new code, start with and then provide only the new code that will be inserted at the cursor position followed by . If no changes are necessary, reply only with . Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;break;case zl.PromptingStrategy.Nes41Miniv3:o=`The developer was working on a section of code within the tags <|code_to_edit|> in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`<|cursor|>\`, please continue the developer's work. Update the <|code_to_edit|> section by predicting and completing the changes they would have made next. Start your response with or . If you are making an edit, start with and then provide the rewritten code window followed by . If no changes are necessary, reply only with . Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;break;case zl.PromptingStrategy.Xtab275EditIntentShort:case zl.PromptingStrategy.Xtab275EditIntent:case zl.PromptingStrategy.Xtab275:o=n;break;case zl.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case zl.PromptingStrategy.Xtab275Aggressiveness:o=`${n} <|aggressive|>${r}<|/aggressive|>`;break;case zl.PromptingStrategy.Xtab275AggressivenessHighLow:o=r===zl.AggressivenessLevel.Medium?n:`${n} <|aggressive|>${r}<|/aggressive|>`;break;case zl.PromptingStrategy.PatchBased:o='Output a modified diff style format with the changes you want. Each change patch must start with `:` and then include some non empty "anchor lines" preceded by `-` and the new lines meant to replace them preceded by `+`. Put your changes in the order that makes the most sense, for example edits inside the code_to_edit region and near the user\'s <|cursor|> should always be prioritized. Output "" if you don\'t have a good edit candidate.';break;case zl.PromptingStrategy.SimplifiedSystemPrompt:case zl.PromptingStrategy.CopilotNesXtab:case void 0:o=`The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${Lh.PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Provide the revised code that was between the \`${Lh.PromptTags.EDIT_WINDOW.start}\` and \`${Lh.PromptTags.EDIT_WINDOW.end}\` tags with the following format, but do not include the tags themselves. \`\`\` // Your revised code goes here \`\`\``;break;default:(0,CFe.assertNever)(t)}return o===void 0?"":` -${o}`}a(J2c,"getPostScript");function Z2c(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===V2c.ContextKind.Trait).map(n=>n.context);if(e.length===0)return"";let r=[];for(let n of e)r.push(`${n.name}: ${n.value}`);return`Consider this related information: +${o}`}a(X2c,"getPostScript");function eDc(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===z2c.ContextKind.Trait).map(n=>n.context);if(e.length===0)return"";let r=[];for(let n of e)r.push(`${n.name}: ${n.value}`);return`Consider this related information: ${r.join(` -`)}`}a(Z2c,"getRelatedInformation");function X2c(t,e,r){if(!t.length)return[0,0];let n=r*4,o=0,s=e?t.length-1:0;for(;o=t.length)break;return e?[s+1,t.length]:[0,s]}a(X2c,"truncateCode");Pd.N_LINES_ABOVE=2;Pd.N_LINES_BELOW=5;Pd.N_LINES_AS_CONTEXT=15;function s$i(t,e,r,n,o,s,c){let l=Math.ceil(t.length/r);function u(g){let A=g*r,y=Math.min(A+r,t.length),_=t.slice(A,y);return(0,N3r.countTokensForLines)(_,o)}a(u,"computeTokensForPage");let d=Math.floor(e.start/r),f=Math.floor((e.endExclusive-1)/r),h=n-(0,W2c.range)(d,f+1).reduce((g,A)=>g+u(A),0);if(h<0)return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:h};let m=h;if(s){m=h;for(let g=d-1;g>=0&&m>0;--g){let A=u(g),y=m-A;if(y<0)break;d=g,m=y}for(let g=f+1;g0;++g){let A=u(g),y=m-A;if(y<0)break;f=g,m=y}}else{let g=Math.floor(h/2);m=g;for(let y=d-1;y>=0&&m>0;--y){let _=u(y),E=m-_;if(E<0)break;d=y,m=E}m=g+(c?m:0);for(let y=f+1;y0;++y){let _=u(y),E=m-_;if(E<0)break;f=y,m=E}}return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:m}}a(s$i,"expandRangeToPageRange");function a$i(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,N3r.countTokensForLines)(s,r);if(c<0)return P3r.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=s$i(t,e,n,c,r,o.prioritizeAboveCursor,o.useLeftoverBudgetFromAbove),d=l*n,f=(u+1)*n;return P3r.Result.ok(new n$i.OffsetRange(d,f))}a(a$i,"clipPreservingRange");var H1t=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};Pd.ClippedDocument=H1t;function c$i(t,e,r,n,o,s){let c=a$i(t,r,n,o,s);if(c.isError())return c;let l=c.val,u=[...t.slice(l.start,r.start),...e,...t.slice(r.endExclusive,l.endExclusive)],d=new n$i.OffsetRange(l.start,l.start+u.length);return P3r.Result.ok(new H1t(u,d))}a(c$i,"createTaggedCurrentFileContentUsingPagedClipping");function k3r(t,e){switch(e){case SEe.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case SEe.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case SEe.IncludeLineNumbersOption.None:return[...t];default:(0,CFe.assertNever)(e)}}a(k3r,"addLineNumbers");function eDc(t,e,r,n,o,s){let c=t$i.StringEdit.single(t$i.StringReplacement.insert(t.cursorOffset,Lh.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=k3r(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[Lh.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),Lh.PromptTags.EDIT_WINDOW.start,...u,Lh.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),Lh.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=k3r(f,s.includeLineNumbers.currentFileContent),m=k3r(t.lines,s.includeLineNumbers.currentFileContent),g;if(n.currentFile.includeTags&&s.includeLineNumbers.currentFileContent===s.includeLineNumbers.areaAroundCodeToEdit)g=d;else{let y=h.slice(e.start,e.endExclusive);g=[...h.slice(r.start,e.start),...y,...h.slice(e.endExclusive,r.endExclusive)]}return c$i(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` -`)}))}a(eDc,"constructTaggedFile")});var l$i=I(Tk=>{"use strict";p();Object.defineProperty(Tk,"__esModule",{value:!0});Tk.xtab275SystemPrompt=Tk.simplifiedPrompt=Tk.nes41Miniv3SystemPrompt=Tk.unifiedModelSystemPrompt=Tk.systemPromptTemplate=void 0;var sW=nW();Tk.systemPromptTemplate=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the ${sW.PromptTags.EDIT_WINDOW.start} and ${sW.PromptTags.EDIT_WINDOW.end} tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +`)}`}a(eDc,"getRelatedInformation");function tDc(t,e,r){if(!t.length)return[0,0];let n=r*4,o=0,s=e?t.length-1:0;for(;o=t.length)break;return e?[s+1,t.length]:[0,s]}a(tDc,"truncateCode");Dd.N_LINES_ABOVE=2;Dd.N_LINES_BELOW=5;Dd.N_LINES_AS_CONTEXT=15;function c$i(t,e,r,n,o,s,c){let l=Math.ceil(t.length/r);function u(g){let A=g*r,y=Math.min(A+r,t.length),_=t.slice(A,y);return(0,M3r.countTokensForLines)(_,o)}a(u,"computeTokensForPage");let d=Math.floor(e.start/r),f=Math.floor((e.endExclusive-1)/r),h=n-(0,Y2c.range)(d,f+1).reduce((g,A)=>g+u(A),0);if(h<0)return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:h};let m=h;if(s){m=h;for(let g=d-1;g>=0&&m>0;--g){let A=u(g),y=m-A;if(y<0)break;d=g,m=y}for(let g=f+1;g0;++g){let A=u(g),y=m-A;if(y<0)break;f=g,m=y}}else{let g=Math.floor(h/2);m=g;for(let y=d-1;y>=0&&m>0;--y){let _=u(y),E=m-_;if(E<0)break;d=y,m=E}m=g+(c?m:0);for(let y=f+1;y0;++y){let _=u(y),E=m-_;if(E<0)break;f=y,m=E}}return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:m}}a(c$i,"expandRangeToPageRange");function l$i(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,M3r.countTokensForLines)(s,r);if(c<0)return D3r.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=c$i(t,e,n,c,r,o.prioritizeAboveCursor,o.useLeftoverBudgetFromAbove),d=l*n,f=(u+1)*n;return D3r.Result.ok(new o$i.OffsetRange(d,f))}a(l$i,"clipPreservingRange");var G1t=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};Dd.ClippedDocument=G1t;function u$i(t,e,r,n,o,s){let c=l$i(t,r,n,o,s);if(c.isError())return c;let l=c.val,u=[...t.slice(l.start,r.start),...e,...t.slice(r.endExclusive,l.endExclusive)],d=new o$i.OffsetRange(l.start,l.start+u.length);return D3r.Result.ok(new G1t(u,d))}a(u$i,"createTaggedCurrentFileContentUsingPagedClipping");function P3r(t,e){switch(e){case SEe.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case SEe.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case SEe.IncludeLineNumbersOption.None:return[...t];default:(0,CFe.assertNever)(e)}}a(P3r,"addLineNumbers");function rDc(t,e,r,n,o,s){let c=n$i.StringEdit.single(n$i.StringReplacement.insert(t.cursorOffset,Lh.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=P3r(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[Lh.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),Lh.PromptTags.EDIT_WINDOW.start,...u,Lh.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),Lh.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=P3r(f,s.includeLineNumbers.currentFileContent),m=P3r(t.lines,s.includeLineNumbers.currentFileContent),g;if(n.currentFile.includeTags&&s.includeLineNumbers.currentFileContent===s.includeLineNumbers.areaAroundCodeToEdit)g=d;else{let y=h.slice(e.start,e.endExclusive);g=[...h.slice(r.start,e.start),...y,...h.slice(e.endExclusive,r.endExclusive)]}return u$i(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` +`)}))}a(rDc,"constructTaggedFile")});var d$i=I(Tk=>{"use strict";p();Object.defineProperty(Tk,"__esModule",{value:!0});Tk.xtab275SystemPrompt=Tk.simplifiedPrompt=Tk.nes41Miniv3SystemPrompt=Tk.unifiedModelSystemPrompt=Tk.systemPromptTemplate=void 0;var aW=iW();Tk.systemPromptTemplate=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the ${aW.PromptTags.EDIT_WINDOW.start} and ${aW.PromptTags.EDIT_WINDOW.end} tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. You have access to the following information to help you make informed suggestions: @@ -1241,9 +1241,9 @@ You have access to the following information to help you make informed suggestio - current_file_content: The content of the file the developer is currently working on, providing the broader context of the code. Line numbers in the form #| are included to help you understand the edit diff history. - edit_diff_history: A record of changes made to the code, helping you understand the evolution of the code and the developer's intentions. These changes are listed from oldest to latest. It's possible a lot of old edit diff history is entirely irrelevant to the developer's change. - area_around_code_to_edit: The context showing the code surrounding the section to be edited. -- cursor position marked as ${sW.PromptTags.CURSOR}: Indicates where the developer's cursor is currently located, which can be crucial for understanding what part of the code they are focusing on. +- cursor position marked as ${aW.PromptTags.CURSOR}: Indicates where the developer's cursor is currently located, which can be crucial for understanding what part of the code they are focusing on. -Your task is to predict and complete the changes the developer would have made next in the ${sW.PromptTags.EDIT_WINDOW.start} section. The developer may have stopped in the middle of typing. Your goal is to keep the developer on the path that you think they're following. Some examples include further implementing a class, method, or variable, or improving the quality of the code. Make sure the developer doesn't get distracted and ensure your suggestion is relevant. Consider what changes need to be made next, if any. If you think changes should be made, ask yourself if this is truly what needs to happen. If you are confident about it, then proceed with the changes. +Your task is to predict and complete the changes the developer would have made next in the ${aW.PromptTags.EDIT_WINDOW.start} section. The developer may have stopped in the middle of typing. Your goal is to keep the developer on the path that you think they're following. Some examples include further implementing a class, method, or variable, or improving the quality of the code. Make sure the developer doesn't get distracted and ensure your suggestion is relevant. Consider what changes need to be made next, if any. If you think changes should be made, ask yourself if this is truly what needs to happen. If you are confident about it, then proceed with the changes. # Steps @@ -1254,9 +1254,9 @@ Your task is to predict and complete the changes the developer would have made n # Output Format -- Provide only the revised code within the tags. If no changes are necessary, simply return the original code from within the ${sW.PromptTags.EDIT_WINDOW.start} and ${sW.PromptTags.EDIT_WINDOW.end} tags. +- Provide only the revised code within the tags. If no changes are necessary, simply return the original code from within the ${aW.PromptTags.EDIT_WINDOW.start} and ${aW.PromptTags.EDIT_WINDOW.end} tags. - There are line numbers in the form #| in the code displayed to you above, but these are just for your reference. Please do not include the numbers of the form #| in your response. -- Ensure that you do not output duplicate code that exists outside of these tags. The output should be the revised code that was between these tags and should not include the ${sW.PromptTags.EDIT_WINDOW.start} or ${sW.PromptTags.EDIT_WINDOW.end} tags. +- Ensure that you do not output duplicate code that exists outside of these tags. The output should be the revised code that was between these tags and should not include the ${aW.PromptTags.EDIT_WINDOW.start} or ${aW.PromptTags.EDIT_WINDOW.end} tags. \`\`\` // Your revised code goes here @@ -1323,18 +1323,18 @@ Your task is to predict and complete the changes the developer would have made n # Notes - Apologize with "Sorry, I can't assist with that." for requests that may breach Microsoft content guidelines. -- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;Tk.simplifiedPrompt="Predict next code edit based on the context given by the user.";Tk.xtab275SystemPrompt=`Predict the next code edit based on user context, following Microsoft content policies and avoiding copyright violations. If a request may breach guidelines, reply: "Sorry, I can't assist with that."`});var $1t=I(aW=>{"use strict";p();Object.defineProperty(aW,"__esModule",{value:!0});aW.NullTerminalService=aW.ITerminalService=void 0;aW.isTerminalService=nDc;aW.isNullTerminalService=iDc;var tDc=an(),G1t=Fc(),rDc=Po();aW.ITerminalService=(0,tDc.createServiceIdentifier)("ITerminalService");var M3r=class t extends rDc.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new G1t.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new G1t.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new G1t.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new G1t.Emitter),this.onDidCloseTerminal=this._onDidCloseTerminal.event}static{this.Instance=new t}get terminalBuffer(){return""}get terminalLastCommand(){}get terminalSelection(){return""}get terminalShellType(){return""}async getCwdForSession(e){return Promise.resolve(void 0)}async getCopilotTerminals(e){return Promise.resolve([])}getTerminalsWithSessionInfo(){throw new Error("Method not implemented.")}getToolTerminalForSession(e){throw new Error("Method not implemented.")}async associateTerminalWithSession(e,r,n){Promise.resolve()}createTerminal(e,r,n){return{}}get terminals(){return[]}getBufferForTerminal(e,r){return""}getBufferWithPid(e,r){return Promise.resolve("")}getLastCommandForTerminal(e){}contributePath(e,r,n,o){}removePathContribution(e){}};aW.NullTerminalService=M3r;function nDc(t){return t&&typeof t.createTerminal=="function"}a(nDc,"isTerminalService");function iDc(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(iDc,"isNullTerminalService")});var u$i=I(HU=>{"use strict";p();var oDc=HU&&HU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},sDc=HU&&HU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(HU,"__esModule",{value:!0});HU.TerminalMonitor=void 0;var aDc=$1t(),cDc=Po(),bFe=2e3,O3r=class extends cDc.Disposable{static{a(this,"TerminalMonitor")}constructor(e){super(),this._terminalService=e,this._register(this._terminalService.onDidEndTerminalShellExecution(r=>{this._recordTerminalActivity(r)})),this._register(this._terminalService.onDidCloseTerminal(r=>{this._lastActivity?.terminal===r&&(this._lastActivity=void 0)}))}_recordTerminalActivity(e){let r=e.execution;this._lastActivity={terminal:e.terminal,terminalName:e.terminal.name,commandLine:r.commandLine?.value,cwd:lDc(r.cwd),exitCode:e.exitCode,timestamp:Date.now()}}getData(){let e=Date.now(),r=this._terminalService.terminals.length;if(!this._lastActivity)return JSON.stringify({terminalCount:r});let n=this._terminalService.getBufferForTerminal(this._lastActivity.terminal,bFe*2),o=e-this._lastActivity.timestamp,s={terminalName:this._lastActivity.terminalName,commandLine:this._lastActivity.commandLine,cwd:this._lastActivity.cwd,exitCode:this._lastActivity.exitCode,msAgo:o,buffer:n.length<=bFe?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,bFe/2),contentEnd:n.slice(-bFe/2),length:n.length,truncatedChars:n.length-bFe},terminalCount:r};return JSON.stringify(s)}};HU.TerminalMonitor=O3r;HU.TerminalMonitor=O3r=oDc([sDc(0,aDc.ITerminalService)],O3r);function lDc(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(lDc,"formatCwd")});var d$i=I(V1t=>{"use strict";p();Object.defineProperty(V1t,"__esModule",{value:!0});V1t.CurrentDocument=void 0;var uDc=Os(),L3r=class{static{a(this,"CurrentDocument")}constructor(e,r){this.content=e,this.cursorPosition=r,this.lines=e.getLines(),this.transformer=e.getTransformer(),this.cursorOffset=this.transformer.getOffset(r),this.cursorLineOffset=this.cursorPosition.lineNumber-1}lineWithCursor(){let e=this.lines.at(this.cursorLineOffset);if(e===void 0)throw new uDc.BugIndicatingError(`CurrentDocument#lineWithCursor: cursor is out of bounds: cursor: ${this.cursorLineOffset}, doc line count: ${this.lines.length}`);return e}textAfterCursor(){return this.lineWithCursor().substring(this.cursorPosition.column-1)}isCursorAtEndOfLine(){return this.textAfterCursor().match(/^\s*$/)!==null}};V1t.CurrentDocument=L3r});var m$i=I(W1t=>{"use strict";p();Object.defineProperty(W1t,"__esModule",{value:!0});W1t.getCurrentLine=fDc;W1t.isModelLineCompatible=pDc;var f$i=iv(),dDc=Abt();function fDc(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new f$i.Position(o,1)),l=0;for(let A of r.replacements)if(A.replaceRange.endExclusive<=c)l+=A.newText.length-A.replaceRange.length;else{if(A.replaceRange.start=o.startOffset&&n.endOffset<=o.endOffset?mDc(n,o,e,r):!1}a(pDc,"isModelLineCompatible");var hDc=new Set(["()","[]","{}","<>",'""',"''","``"]);function mDc(t,e,r,n){return t.replaced.length>0?r===n?!0:t.startOffset===e.startOffset&&t.endOffset===e.endOffset&&t.replaced===e.replaced&&t.inserted.length>0&&h$i(t.inserted,e.inserted):h$i(t.inserted,e.inserted)}a(mDc,"isUserEditCompatibleWithModelEdit");function h$i(t,e){return e.startsWith(t)?!0:hDc.has(t)?gDc(t,e):!1}a(h$i,"isUserTypingCompatibleWithModelText");function gDc(t,e){let r=0;for(let n=0;n{"use strict";p();var ADc=HN&&HN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yDc=HN&&HN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_Dc=HN&&HN.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o ${r}`);let d=(async function*(){let f=await o.next();for(;!f.done;)yield f.value,f=await o.next()})();return{editIntent:r,remainingLinesStream:d,parseError:n}}n=`unknownIntentValue:${c}`,e.warn(`Edit intent parse error: ${n} (using Xtab275EditIntentShort prompting strategy). Defaulting to High (always show). First line was: "${c.substring(0,100)}..."`);let u=(async function*(){yield s.value;let d=await o.next();for(;!d.done;)yield d.value,d=await o.next()})();return{editIntent:r,remainingLinesStream:u,parseError:n}}a(vDc,"parseEditIntentFromStreamShortName");async function CDc(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=z1t.EditIntent.High,s,c=t[Symbol.asyncIterator](),l=await c.next();if(l.done){s="emptyResponse",e.warn("Empty response stream, no edit_intent tag found");let m=(async function*(){})();return{editIntent:o,remainingLinesStream:m,parseError:s}}let u=l.value,d=u.indexOf(r),f=u.indexOf(n);if(d!==-1&&f!==-1&&f>d){let m=u.substring(d+r.length,f).trim().toLowerCase();["no_edit","low","medium","high"].includes(m)||(s=`unknownIntentValue:${m}`,e.warn(`Unknown edit_intent value: "${m}", defaulting to High`)),o=z1t.EditIntent.fromString(m),e.trace(`Parsed edit_intent from first line: "${m}" -> ${o}`);let A=u.substring(f+n.length),y=(async function*(){A.trim()!==""&&(yield A);let _=await c.next();for(;!_.done;)yield _.value,_=await c.next()})();return{editIntent:o,remainingLinesStream:y,parseError:s}}d!==-1&&f===-1?s="malformedTag:startWithoutEnd":d===-1&&f!==-1?s="malformedTag:endWithoutStart":s="noTagFound",e.warn(`Edit intent parse error: ${s} (using Xtab275EditIntent prompting strategy). Defaulting to High (always show). First line was: "${u.substring(0,100)}..."`);let h=(async function*(){yield u;let m=await c.next();for(;!m.done;)yield m.value,m=await c.next()})();return{editIntent:o,remainingLinesStream:h,parseError:s}}a(CDc,"parseEditIntentFromStreamTags")});var K1t=I(TEe=>{"use strict";p();Object.defineProperty(TEe,"__esModule",{value:!0});TEe.linesWithBackticksRemoved=SDc;TEe.constructMessages=TDc;TEe.charCount=IDc;TEe.findMergeConflictMarkersRange=xDc;var F3r=wo(),g$i=$3e(),bDc=Td();async function*SDc(t){let e=-1,r;for await(let n of t)if(++e,r&&(yield r,r=void 0),n.match(/^```[a-z]*$/)){if(e===0)continue;r=n}else yield n}a(SDc,"linesWithBackticksRemoved");function TDc({systemMsg:t,userMsg:e}){return[{role:F3r.Raw.ChatRole.System,content:(0,g$i.toTextParts)(t)},{role:F3r.Raw.ChatRole.User,content:(0,g$i.toTextParts)(e)}]}a(TDc,"constructMessages");function IDc(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===F3r.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(IDc,"charCount");function xDc(t,e,r){for(let n=e.start;n>>>>>>"))return new bDc.OffsetRange(n,o+1)}}a(xDc,"findMergeConflictMarkersRange")});var _$i=I(cW=>{"use strict";p();Object.defineProperty(cW,"__esModule",{value:!0});cW.ResponseParseResult=void 0;cW.handleEditWindowOnly=kDc;cW.handleCodeBlock=PDc;cW.handleEditWindowWithEditIntent=DDc;cW.handleUnifiedWithXml=NDc;var SFe=R_e(),A$i=k$(),y$i=vD(),IEe=nW(),wDc=B3r(),RDc=K1t(),uB;(function(t){class e{static{a(this,"EditWindowLines")}constructor(s,c){this.lines=s,this.editIntentMetadata=c}}t.EditWindowLines=e;class r{static{a(this,"Done")}constructor(s){this.reason=s}}t.Done=r;class n{static{a(this,"DirectEdits")}constructor(s){this.stream=s}}t.DirectEdits=n})(uB||(cW.ResponseParseResult=uB={}));function kDc(t){return new uB.EditWindowLines(t)}a(kDc,"handleEditWindowOnly");function PDc(t){return new uB.EditWindowLines((0,RDc.linesWithBackticksRemoved)(t))}a(PDc,"handleCodeBlock");async function DDc(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,wDc.parseEditIntentFromStream)(t,e,r);return new uB.EditWindowLines(o,{intent:n,parseError:s})}a(DDc,"handleEditWindowWithEditIntent");async function NDc(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new uB.Done(new SFe.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===IEe.ResponseTags.NO_CHANGE.start)return new uB.Done(new SFe.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===IEe.ResponseTags.INSERT.start)return new uB.DirectEdits(MDc(o,e,r));if(c===IEe.ResponseTags.EDIT.start){let l=ODc(o);return new uB.EditWindowLines(l)}return new uB.Done(new SFe.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(NDc,"handleUnifiedWithXml");async function*MDc(t,e,r){let{editWindowLines:n,editWindowLineRange:o,cursorLineInEditWindowOffset:s,cursorColumnZeroBased:c,editWindow:l,originalEditWindow:u,targetDocument:d,isFromCursorJump:f}=e,h=await t.next();if(h.done||h.value.includes(IEe.ResponseTags.INSERT.end))return new SFe.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new A$i.LineReplacement(new y$i.LineRange(o.start+s+1,o.start+s+2),[m.slice(0,c)+h.value+m.slice(c)]),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d};let A=[],y=await t.next();for(;!y.done&&!y.value.includes(IEe.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let _=o.start+s+2;return yield{edit:new A$i.LineReplacement(new y$i.LineRange(_,_),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new SFe.NoNextEditReason.NoSuggestions(r,l)}a(MDc,"generateInsertEdits");async function*ODc(t){let e=await t.next();for(;!e.done;){if(e.value.includes(IEe.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(ODc,"generateEditLines")});var E$i=I(GU=>{"use strict";p();var LDc=GU&&GU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Ik=GU&&GU.__param||function(t,e){return function(r,n){e(r,n,t)}},J1t;Object.defineProperty(GU,"__esModule",{value:!0});GU.XtabEndpoint=void 0;var BDc=rE(),FDc=LU(),U3r=Hl(),UDc=lE(),QDc=VV(),qDc=Bie(),jDc=Np(),HDc=Oy(),GDc=UU(),$Dc=Rh(),VDc=bh(),WDc=$V(),zDc=Nie(),YDc=Ks(),Q3r=class extends qDc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{J1t=this}static{this.chatModelInfo={id:"xtab-4o-mini-finetuned",name:"xtab-4o-mini-finetuned",vendor:"xtab",model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"unknown",capabilities:{type:"chat",family:"xtab-4o-mini-finetuned",tokenizer:zDc.TokenizerType.O200K,limits:{max_prompt_tokens:12285,max_output_tokens:4096},supports:{streaming:!0,parallel_tool_calls:!1,tool_calls:!1,vision:!1,prediction:!0}}}}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y){let _=n?{...J1t.chatModelInfo,id:n}:J1t.chatModelInfo;super(_,s,f,h,m,o,g,A,y),this._url=e,this._apiKey=r,this._configService=o}get urlOrRequestMetadata(){return this._configService.getConfig(U3r.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig(U3r.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey)||this._apiKey;if(!e){let r=`Missing API key for custom URL (${this.urlOrRequestMetadata}). Provide the API key using vscode setting \`github.copilot.chat.advanced.inlineEdits.xtabProvider.apiKey\` or, if in simulations using \`--nes-api-key\` or \`--config-file\``;throw console.error(r),new Error(r)}return{Authorization:`Bearer ${e}`,"api-key":e}}};GU.XtabEndpoint=Q3r;GU.XtabEndpoint=Q3r=J1t=LDc([Ik(3,U3r.IConfigurationService),Ik(4,QDc.IDomainService),Ik(5,HDc.IFetcherService),Ik(6,UDc.ICAPIClientService),Ik(7,VDc.ITelemetryService),Ik(8,BDc.IAuthenticationService),Ik(9,FDc.IChatMLFetcher),Ik(10,WDc.ITokenizerProvider),Ik(11,YDc.IInstantiationService),Ik(12,$Dc.IExperimentationService),Ik(13,GDc.IChatWebSocketManager),Ik(14,jDc.ILogService)],Q3r)});var Z1t=I(xEe=>{"use strict";p();Object.defineProperty(xEe,"__esModule",{value:!0});xEe.NullProxyModelsService=xEe.IProxyModelsService=void 0;var KDc=an(),JDc=Fc();xEe.IProxyModelsService=(0,KDc.createServiceIdentifier)("IProxyModelsService");var q3r=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=JDc.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};xEe.NullProxyModelsService=q3r});var v$i=I(mA=>{"use strict";p();var ZDc=mA&&mA.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XDc=mA&&mA.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),eNc=mA&&mA.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},tNc=mA&&mA.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;otypeof g=="boolean"?g?eTt.IncludeLineNumbersOption.WithSpaceAfter:eTt.IncludeLineNumbersOption.None:g),f=new H3r.PromptPieces(e.currentDocument,e.editWindowLinesRange,e.areaAroundEditWindowLinesRange,e.activeDoc,e.xtabHistory,s.lines,c,e.langCtx,e.aggressivenessLevel,u,this.computeTokens,{...e.opts,includePostScript:!1,lintOptions:l,recentlyViewedDocuments:{...e.opts.recentlyViewedDocuments,includeLineNumbers:d}}),{prompt:h}=(0,H3r.getUserPrompt)(f),m=(0,hNc.constructMessages)({systemMsg:r,userMsg:h});return jI.Result.ok({messages:m,keptRange:s.keptRange})}async predictNextCursorPosition(e,r,n){let o=r.tracer.createSubLogger("predictNextCursorPosition"),s=this.buildCursorPredictionPrompt(e);if(s.isError())return o.trace(`Failed to construct tagged file: ${s.err.message}`),jI.Result.fromString(s.err.message);let{messages:c,keptRange:l}=s.val;r.telemetry.setCursorJumpPrompt(c),r.logContext.setCursorJumpPrompt(c,l);let u=this.determineModelName();r.telemetry.setCursorJumpModelName(u);let d=await this.resolveEndpoint(u,o);if(!d)return jI.Result.fromString("endpointNotResolved");let{endpoint:f,usesResponsesApi:h}=d,m=this.configService.getConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),g=this.configService.getExperimentBasedConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionMaxResponseTokens,this.expService),A={max_tokens:h?Math.max(g,2048):g};m&&(A={...A,secretKey:m});let y=await f.makeChatRequest2({messages:c,debugName:"nes.nextCursorPosition",finishedCb:void 0,location:j3r.ChatLocation.Other,requestOptions:A},n);if(y.type!==j3r.ChatFetchResponseType.Success)return y.type===j3r.ChatFetchResponseType.NotFound&&(o.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),jI.Result.fromString(`fetchError:${y.type}`);try{r.telemetry.setCursorJumpResponse(y.value);let _=y.value.trim();return this.parseResponse(_,l)}catch(_){return o.trace(`Failed to parse predicted line number from response '${y.value}': ${_}`),jI.Result.fromString(`failedToParseLine:"${y.value}". Error ${lNc.ErrorUtils.fromUnknown(_).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUseEndpointProvider)){let c=(await this.endpointProvider.getAllChatEndpoints()).find(u=>u.model===e||u.family===e);if(!c){r.trace(`Could not find endpoint for model '${e}' via endpoint provider`);return}let l=c.apiType==="responses";return{endpoint:c,usesResponsesApi:l}}let o=this.configService.getConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(iNc.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:rNc.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:uNc.TokenizerType.CL100K,limits:void 0,supports:{parallel_tool_calls:!1,tool_calls:!1,streaming:!0,vision:!1,prediction:!1,thinking:!1}}}),usesResponsesApi:!1}}determineModelName(){return this.configService.getExperimentBasedConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??mNc}determineLintOptions(){let e=this.configService.getConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...tTt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,tTt.parseLintOptionString)(r,tTt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):tTt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=gNc(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return jI.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?jI.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?jI.Result.fromString("crossFileEmptyFilePath"):jI.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?jI.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(gNc,"stripThinkTags")});var w$i=I(TFe=>{"use strict";p();Object.defineProperty(TFe,"__esModule",{value:!0});TFe.XtabPatchResponseHandler=void 0;TFe.tryRemoveDuplicateAdditions=x$i;var C$i=Uie(),Gie=wy(),ANc=Qyt(),b$i=R_e(),yNc=gv(),_Nc=Ml(),ENc=$A(),S$i=hd(),V3r=k$(),vNc=qbt(),T$i=vD(),CNc=g3r(),bNc=bEe(),SNc=nW(),rTt=class t{static{a(this,"Patch")}constructor(e,r,n){this.filePath=e,this.lineNumZeroBased=r,this.patchIndex=n,this.removedLines=[],this.addedLines=[],this.isProgressiveRevealEarlyEdit=!1}static ofLine(e,r){let n=e.match(/^(.+):(\d+)$/);if(!n)return null;let[,o,s]=n;return new t(o,parseInt(s,10),r)}static progressiveRevealParts(e){let r=new t(e.filePath,e.lineNumZeroBased,e.patchIndex);r.removedLines=[e.removedLines[0]],r.addedLines=[...e.addedLines],r.isProgressiveRevealEarlyEdit=!0;let n=new t(e.filePath,e.lineNumZeroBased+1,e.patchIndex);return n.removedLines=e.removedLines.slice(1),{early:r,continuation:n}}addLine(e){let r=e.slice(1);return e.startsWith("-")?(this.removedLines.push(r),!0):e.startsWith("+")?(this.addedLines.push(r),!0):!1}toString(){return[`${this.filePath}:${this.lineNumZeroBased}`,...this.removedLines.map(e=>`-${e}`),...this.addedLines.map(e=>`+${e}`)].join(` -`)}};function $3r(t){return t.trim().length>1}a($3r,"isMeaningfulLine");function x$i(t,e){let r=t.newLines;if(r.length===0)return;let n=t.lineRange.endLineNumberExclusive,o=e.lineRange.endLineNumberExclusive-1,s=Math.min(o+1,n+r.length),c=[];for(let l=n;l=1;l--){let u=r.slice(-l);if((0,_Nc.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&$3r(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&$3r(c[0])&&$3r(c[1])){let l=c[0],u=c[1];for(let d=1;dnew V3r.LineReplacement(new T$i.LineRange(m+g.original.startLineNumber-1,m+g.original.endLineNumberExclusive-1),f.slice(g.modified.startLineNumber-1,g.modified.endLineNumberExclusive-1)))}a(r,"splitReplacement"),t.splitReplacement=r;async function*n(u,d,f,h,m,g,A=Gie.DuplicateAdditionsMode.Off,y=!1,_=!1,E=!1){let v=g.createSubLogger(["XtabCustomDiffPatchResponseHandler","handleResponse"]),S=(0,bNc.toUniquePath)(f,h?.path);try{let T=!1,w=y?d.cursorLineOffset:void 0,R=y?S:void 0,x=xNc(y,E,A);for await(let k of l(u,w,R,x)){if(T)continue;let D=k.filePath===S,N=D?f:s(k.filePath,h);if(!N){v.error(`Could not resolve target document for edit: ${k.toString()}`);continue}let O=o(k);if(wNc(k,D,A)){let q=TNc(k,O,d.content,A,v);switch(q.kind){case"skip":continue;case"skipAndStop":T=!0;continue;case"emit":O=q.lineReplacement;break}}let B=_?r(O,k.removedLines):[O];for(let q of B)yield{edit:q,isFromCursorJump:!1,targetDocument:N,window:m,patchIndex:k.patchIndex}}}catch(T){if(T instanceof CNc.FetchStreamError)return T.reason;let w=yNc.ErrorUtils.fromUnknown(T);return new b$i.NoNextEditReason.Unexpected(w)}return new b$i.NoNextEditReason.NoSuggestions(d.content,m,void 0)}a(n,"handleResponse"),t.handleResponse=n;function o(u){return new V3r.LineReplacement(new T$i.LineRange(u.lineNumZeroBased+1,u.lineNumZeroBased+1+u.removedLines.length),u.addedLines)}a(o,"resolveEdit");function s(u,d){if((0,ENc.isAbsolute)(u))return C$i.DocumentId.create(S$i.URI.file(u).toString());if(d)return C$i.DocumentId.create(S$i.URI.joinPath(d,u).toString())}a(s,"resolveTargetDocument");function c(u,d,f,h){return u.lineNumZeroBased!==d||u.filePath!==f||!(h?u.removedLines.length>=1:u.removedLines.length===1)||u.addedLines.length<1||!ANc.ResponseProcessor.isAdditiveEdit(u.removedLines[0],u.addedLines[0])?!1:!RNc(u)}a(c,"isGhostTextPatch"),t.isGhostTextPatch=c;async function*l(u,d,f,h=!1){let m=null,g=!0,A=!1,y=0,_=a(E=>{let v=rTt.ofLine(E,y);return v!==null&&y++,v},"parseNextPatchHeader");for await(let E of u){if(E.trim()===SNc.ResponseTags.NO_EDIT)break;if(m===null){m=_(E);continue}if(m.addLine(E)){if(g&&!A&&d!==void 0&&f!==void 0&&m.addedLines.length===1&&m.removedLines.length>=1){if(c(m,d,f,h)){let{early:v,continuation:S}=rTt.progressiveRevealParts(m);yield v,m=S}A=!0}continue}(m.removedLines.length>0||m.addedLines.length>0)&&(yield m),m=_(E),g=!1}m&&(m.removedLines.length>0||m.addedLines.length>0)&&(yield m)}a(l,"extractEdits"),t.extractEdits=l})(I$i||(TFe.XtabPatchResponseHandler=I$i={}))});var V$i=I(Qp=>{"use strict";p();var kNc=Qp&&Qp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),PNc=Qp&&Qp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),DNc=Qp&&Qp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},NNc=Qp&&Qp.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oMath.floor(e.length/4)}constructor(e,r,n,o,s,c,l,u,d,f,h,m){this.modelService=e,this.simulationCtx=r,this.instaService=n,this.workspaceService=o,this.diffService=s,this.configService=c,this.expService=l,this.langCtxService=u,this.langDiagService=d,this.ignoreService=f,this.similarFilesContextService=h,this._telemetryService=m,this.ID=$N.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(iMc.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(lMc.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(fMc.XtabNextCursorPredictor,$N.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new zo.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new zo.NoNextEditReason.ActiveDocumentHasNoEdits;return new zo.WithStatelessProviderTelemetry(h,s.build(wk.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,dW.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new zo.WithStatelessProviderTelemetry(d.value,s.build(wk.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof zo.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new zo.WithStatelessProviderTelemetry(f,s.build(wk.Result.error(f)))}catch(c){let l=uW.ErrorUtils.fromUnknown(c),u=new zo.NoNextEditReason.Unexpected(l);return new zo.WithStatelessProviderTelemetry(u,s.build(wk.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,nMc.getOrDeduceSelectionFromLastEdit)(e.getActiveDocument()),r,n,o,s)}async gatherContextAndClipCurrentFile(e,r,n,o,s,c,l,u,d){if(e!==void 0){let f=await l();if(c.isCancellationRequested)return wk.Result.error(new zo.NoNextEditReason.GotCancelled("afterLanguageContextAwait"));let h=await u();if(c.isCancellationRequested)return wk.Result.error(new zo.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait"));let m=(0,$U.runGlobalBudgetCascade)(r,n.xtabEditHistory,f,$N.computeTokens,o,h,e),g=Bo.GlobalBudgetOptions.currentFileBudget(e),A=d(g+m.finalSurplus);if(A.isError())return wk.Result.error(new zo.NoNextEditReason.PromptTooLarge("currentFile"));let{clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:_}=A.val;return s.setNLinesOfCurrentFileInPrompt(y.lines.length),wk.Result.ok({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:_,precomputedCascade:m,langCtx:f,neighborSnippets:h})}else{let f=d(void 0);if(f.isError())return wk.Result.error(new zo.NoNextEditReason.PromptTooLarge("currentFile"));let{clippedTaggedCurrentDoc:h,areaAroundCodeToEdit:m}=f.val;s.setNLinesOfCurrentFileInPrompt(h.lines.length);let g=await l();if(c.isCancellationRequested)return wk.Result.error(new zo.NoNextEditReason.GotCancelled("afterLanguageContextAwait"));let A=await u();return c.isCancellationRequested?wk.Result.error(new zo.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait")):wk.Result.ok({clippedTaggedCurrentDoc:h,areaAroundCodeToEdit:m,precomputedCascade:void 0,langCtx:g,neighborSnippets:A})}}async*doGetNextEditWithSelection(e,r,n,o,s,c,l){let u=o.tracer.createSubLogger(["XtabProvider","doGetNextEditWithSelection"]),{logContext:d,telemetry:f}=o,h=e.getActiveDocument();if(r===null)return new zo.NoNextEditReason.Uncategorized(new Error("NoSelection"));let{promptOptions:m,modelServiceConfig:g}=this.determineModelConfiguration(h);f.setModelConfig(JSON.stringify(g));let A=this.getEndpointWithLogging(m.modelName,d,f),y=new W3r.Position(r.endLineNumber,r.endColumn),_=new uMc.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,_,m,f,n,u);let E=j$i(_),v=this.computeEditWindowLinesRange(_,e,u,f),S=Math.max(0,_.cursorLineOffset-v.start),T=_.transformer.getLineLength(v.endExclusive),w=_.transformer.getOffsetRange(new sTt.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new zo.RequestEditWindowWithCursorJump(w,l):new zo.RequestEditWindow(w);let R=_.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,Q$i.countTokensForLines)(R,$N.computeTokens)>x)return new zo.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(Be=>Be.includes(L$i.PromptTags.CURSOR)),N=m.globalBudget;N!==void 0&&Bo.GlobalBudgetOptions.validate(N);let O=a(Be=>{let ne=Be!==void 0?{...m,currentFile:{...m.currentFile,maxTokens:Be}}:m;return(0,$U.constructTaggedFile)(_,v,E,ne,$N.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:Bo.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}})},"clipCurrentFileToBudget"),{aggressivenessLevel:B,userHappinessScore:q}=this.userInteractionMonitor.getAggressivenessLevel(),M=this.configService.getExperimentBasedConfig(li.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(M),f.setXtabAggressivenessLevel(B),q!==void 0&&f.setXtabUserHappinessScore(q);let L=a(()=>this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s),"gatherLanguageContext"),U=a(()=>m.neighborFiles.enabled?(0,lW.raceCancellation)((0,lW.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,_.cursorOffset),n.getDebounceTime()),s):Promise.resolve(void 0),"gatherNeighborSnippets"),j=await this.gatherContextAndClipCurrentFile(N,h,e,m,f,s,L,U,O);if(j.isError())return j.err;let{clippedTaggedCurrentDoc:Q,areaAroundCodeToEdit:Y,precomputedCascade:W,langCtx:V,neighborSnippets:z}=j.val,ie=new aMc.LintErrors(h.id,_,this.langDiagService,e.xtabEditHistory),H=new $U.PromptPieces(_,v,E,h,e.xtabEditHistory,Q.lines,Y,V,B,ie,$N.computeTokens,m,z,W),{prompt:re,nDiffsInPrompt:le,neighborSnippetsResult:Le,sectionTokens:me}=(0,$U.getUserPrompt)(H);f.setNDiffsInPrompt(le),Le&&(f.setNNeighborSnippetsComputed(Le.nComputed),f.setNNeighborSnippetsInPrompt(Le.nIncluded),f.setNeighborSnippetIndicesInPrompt(Le.includedIndices));let Oe=Bo.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),Te=this.getPredictedOutput(h,_.cursorLineOffset,R,S,Oe),te=H$i(m.promptingStrategy),ee=(0,z3r.constructMessages)({systemMsg:te,userMsg:re});d.setPrompt(ee),f.setPrompt(ee);let K={...me,systemPrompt:$N.computeTokens(te)};f.setPromptSectionTokens(K),d.setPromptSectionTokens(K);let he=3e4*4;if((0,z3r.charCount)(ee)>he)return new zo.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new zo.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let Be=ie.getData();f.setLintErrors(Be),d.setDiagnosticsData(Be);let ne=this.terminalMonitor.getData();f.setTerminalOutput(ne),d.setTerminalData(ne)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,_.cursorOffset)),e.fetchIssued=!0;let de={endpoint:A,modelServiceConfig:g,messages:ee,clippedTaggedCurrentDoc:Q,editWindowInfo:{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:S,editWindowLineRange:v},promptPieces:H,prediction:Te,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,de,{shouldRemoveCursorTagFromResponse:D,responseFormat:Oe},{aggressivenessLevel:B,userHappinessScore:q},c,n,{tracer:u,logContext:d,telemetry:f},s)}_configureDebounceTimings(e,r,n,o,s,c){let l=r.isCursorAtEndOfLine();o.setIsCursorAtLineEnd(l);let u=(0,sMc.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsExtraDebounceInlineSuggestion,this.expService);u&&d>0?(c.trace("Debouncing for inline suggestion position"),s.setExtraDebounce(d)):l?(c.trace("Debouncing for cursor at end of line"),s.setExtraDebounce(this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,lC.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(li.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[lC.AggressivenessSetting.Low]:{minResponseConfigKey:li.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[lC.AggressivenessSetting.Medium]:{minResponseConfigKey:li.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[lC.AggressivenessSetting.High]:{debounceConfigKey:li.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[lC.AggressivenessSetting.Default]:void 0}[n];if(s){if(s.debounceConfigKey){let c=this.configService.getExperimentBasedConfig(s.debounceConfigKey,this.expService);e.setBaseDebounceTime(c),r.trace(`Aggressiveness ${n}: debounce set to ${c}ms`)}if(s.minResponseConfigKey){if(this.userInteractionMonitor.wasLastActionAcceptance){r.trace(`Aggressiveness ${n}: skipping min response time (last action was acceptance)`);return}let c=this.configService.getExperimentBasedConfig(s.minResponseConfigKey,this.expService);e.setExpectedTotalTime(c),r.trace(`Aggressiveness ${n}: min response time set to ${c}ms`)}}}getAndProcessLanguageContext(e,r,n,o,s,c,l){let u=this.configService.getConfig(li.ConfigKey.TeamInternal.InlineEditsLogContextRecorderEnabled);if(!s.languageContext.enabled&&!u)return Promise.resolve(void 0);let d=this.getLanguageContext(e,r,n,o,c,l);return u&&d.then(f=>{f&&c.logContext.setLanguageContext(f)}),s.languageContext.enabled?d:Promise.resolve(void 0)}async getLanguageContext(e,r,n,o,s,c){try{let l=this.workspaceService.textDocuments.find(v=>v.uri.toString()===n.id.uri);if(l===void 0||this.langCtxService.getContextProviders(l,U$i.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new rMc.Position(o.lineNumber-1,o.column-1),h={opportunityId:e.opportunityId,completionId:e.headerRequestId,documentContext:{uri:l.uri.toString(),languageId:l.languageId,version:l.version,offset:l.offsetAt(f),position:f},activeExperiments:new Map,timeBudget:d,timeoutEnd:Date.now()+d,source:"nes"},m=a(async v=>{let S=[v.uri,...v.additionalUris??[]];return!!await(0,zNc.raceFilter)(S.map(w=>this.ignoreService.isCopilotIgnored(w)),w=>w)},"isSnippetIgnored"),g=[],A=a(async()=>{let v=this.langCtxService.getContextItems(l,h,c);for await(let S of v)S.kind===k$i.ContextKind.Snippet&&await m(S)||g.push({context:S,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,lW.raceCancellation)((0,lW.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let _=Date.now(),E=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of E)v.kind===k$i.ContextKind.Snippet&&await m(v)||g.push({context:v,timeStamp:_,onTimeout:!0});return{start:y,end:_,items:g}}catch(l){s.logContext.setError(uW.ErrorUtils.fromUnknown(l)),s.tracer.trace(`Failed to fetch language context: ${l}`);return}}async*streamEditsWithFiltering(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEditsWithFiltering"),f={...l,tracer:d},h=this.streamEdits(e,r,n,o,s,c,f,u),m=0,g=await h.next();for(;!g.done;){let A=g.value.edit,[y,_]=this.filterEdit(e.getActiveDocument(),[A],r.modelServiceConfig.allowImportChanges??QNc.ImportChanges.None);y.length===0?d.trace(`Filtered out an edit: ${A.toString()} using ${_.join(", ")} filter(s)`):(d.trace(`Yielding an edit: ${A.toString()}`),yield g.value,m++),g=await h.next()}return m===0&&g.value instanceof zo.NoNextEditReason.NoSuggestions?yield*this.doGetNextEditsWithCursorJump(e,r,c,l,u,s):g.value}async*streamEdits(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEdits"),f=new KNc.CancellationTokenSource(u),h=f.token;try{return yield*this._streamEditsImpl(e,r,n,o,s,c,{...l,tracer:d},u,f,h)}finally{f.dispose()}}async _performFetch(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=f,A=this.configService.getExperimentBasedConfig(li.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new MNc.FetchStreamSource,_=new JNc.StopWatch,E="",v,S=new lW.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:$N.ID,messages:r,finishedCb:a(async(k,D,N)=>{S.isSettled||S.complete(),v===void 0&&k!==""&&(v=_.elapsed(),m.addLog(`TTFT ${v} ms`)),y.update(k,N),E=k,m.setResponse(E)},"finishedCb"),location:Vf.ChatLocation.Other,source:void 0,requestOptions:{temperature:0,stream:!0,prediction:n},userInitiatedRequest:void 0,telemetryProperties:{requestId:o},useFetcher:A,customMetadata:{aggressivenessLevel:s.aggressivenessLevel,userHappinessScore:s.userHappinessScore}},d);g.setResponse(T.then(k=>({response:k,ttft:v}))),m.setFullResponse(T.then(k=>k.type===Vf.ChatFetchResponseType.Success?k.value:void 0)),T.then(k=>{k.type!==Vf.ChatFetchResponseType.Success?y.reject(new O$i.FetchStreamError(Z3r(k))):y.resolve()}).catch(k=>{m.setError(uW.ErrorUtils.fromUnknown(k)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(uW.ErrorUtils.fromUnknown(k))}).finally(()=>{m.setFetchEndTime(),S.isSettled||S.complete(),m.setResponse(E)});let w=await Promise.race([S.p,T]);if(w&&w.type!==Vf.ChatFetchResponseType.Success)return w.type===Vf.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,fW.ModelNotFound.INSTANCE):w.type===Vf.ChatFetchResponseType.Unknown&&w.reason===Vf.RESPONSE_CONTAINED_NO_CHOICES?new fW.FetchFailure(new zo.NoNextEditReason.NoSuggestions(u,l)):new fW.FetchFailure(Z3r(w));let R=P$i.AsyncIterUtilsExt.splitLines(P$i.AsyncIterUtils.map(y.stream,k=>k.delta.text)),x=(async function*(){let k=0;for await(let D of R){let N=`Line ${k++} emitted with latency ${_.elapsed()} ms`;h.trace(N),yield c?D.replaceAll(L$i.PromptTags.CURSOR,""):D}})();return new fW.Lines(x,()=>E,_)}async*_streamEditsImpl(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=l,{endpoint:A,messages:y,clippedTaggedCurrentDoc:_,editWindowInfo:E,promptPieces:v,prediction:S,originalEditWindow:T}=r,{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:x,editWindowLineRange:k}=E,D=e.getActiveDocument().id,N=await this._performFetch(A,y,S,e.headerRequestId,o,n.shouldRemoveCursorTagFromResponse,w,e.documentBeforeEdits,f,l);if(N instanceof fW.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof fW.FetchFailure)return N.reason;let{linesStream:O,getResponseSoFar:B,fetchRequestStopWatch:q}=N,M=s instanceof dW.Retrying&&s.reason==="cursorJump",L;try{switch(n.responseFormat){case Bo.ResponseFormat.EditWindowOnly:{L=(0,$ie.handleEditWindowOnly)(O);break}case Bo.ResponseFormat.CodeBlock:{L=(0,$ie.handleCodeBlock)(O);break}case Bo.ResponseFormat.EditWindowWithEditIntent:case Bo.ResponseFormat.EditWindowWithEditIntentShort:{let ie=n.responseFormat===Bo.ResponseFormat.EditWindowWithEditIntentShort?F$i.EditIntentParseMode.ShortName:F$i.EditIntentParseMode.Tags;L=await(0,$ie.handleEditWindowWithEditIntent)(O,h,ie);break}case Bo.ResponseFormat.CustomDiffPatch:{let ie=e.getActiveDocument(),H=v.currentDocument,le=H.lines[_.keptRange.endExclusive-1].length,Le=H.transformer.getOffsetRange(new sTt.Range(_.keptRange.start+1,1,_.keptRange.endExclusive,le+1)),me=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService),Oe=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchFastYieldLineWithCursor,this.expService),Te=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchFastYieldLineWithCursorMultiLine,this.expService),te=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabSplitPatchOnDiff,this.expService);L=new $ie.ResponseParseResult.DirectEdits(pMc.XtabPatchResponseHandler.handleResponse(O,H,ie.id,ie.workspaceRoot,Le,h,me,Oe,te,Te));break}case Bo.ResponseFormat.UnifiedWithXml:{L=await(0,$ie.handleUnifiedWithXml)(O,{editWindowLines:R,editWindowLineRange:k,cursorLineInEditWindowOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,Vie.assertNever)(n.responseFormat)}if(L instanceof $ie.ResponseParseResult.Done)return L.reason;if(L instanceof $ie.ResponseParseResult.DirectEdits)return yield*L.stream;if(L.editIntentMetadata){let{intent:ie,parseError:H}=L.editIntentMetadata;if(g.setEditIntent(ie),H&&g.setEditIntentParseError(H),!Bo.EditIntent.shouldShowEdit(ie,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${ie}" with aggressiveness "${v.aggressivenessLevel}"`),new zo.NoNextEditReason.FilteredOut(`editIntent:${ie} aggressivenessLevel:${v.aggressivenessLevel}`)}let U=L.lines,j={emitFastCursorLineChange:R$i.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${q.elapsed()} ms`);let Q=(0,YNc.backwardCompatSetting)(this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),ie=>{switch(ie){case!1:case void 0:return lC.EarlyDivergenceCancellationMode.Off;case!0:return lC.EarlyDivergenceCancellationMode.Cursor;case lC.EarlyDivergenceCancellationMode.Off:case lC.EarlyDivergenceCancellationMode.Cursor:case lC.EarlyDivergenceCancellationMode.EditWindow:return ie;default:return lC.EarlyDivergenceCancellationMode.Off}}),Y=!1,W=Q===lC.EarlyDivergenceCancellationMode.Off?U:gMc(U,x,e,k,R,d,l,ie=>{Y=ie},Q),V=0,z=!1;for await(let ie of R$i.ResponseProcessor.diff(R,W,x,j)){if(Y)break;h.trace(`ResponseProcessor streamed edit #${V} with latency ${q.elapsed()} ms`);let H=[];if(ie.lineRange.startLineNumber===ie.lineRange.endLineNumberExclusive||ie.newLines.length===0||ie.lineRange.endLineNumberExclusive-ie.lineRange.startLineNumber===1&&ie.newLines.length===1){let re=new oTt.LineReplacement(new M$i.LineRange(ie.lineRange.startLineNumber+k.start,ie.lineRange.endLineNumberExclusive+k.start),ie.newLines);H.push(re)}else{let re=R.slice(ie.lineRange.startLineNumber-1,ie.lineRange.endLineNumberExclusive-1).join(` +- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;Tk.simplifiedPrompt="Predict next code edit based on the context given by the user.";Tk.xtab275SystemPrompt=`Predict the next code edit based on user context, following Microsoft content policies and avoiding copyright violations. If a request may breach guidelines, reply: "Sorry, I can't assist with that."`});var V1t=I(cW=>{"use strict";p();Object.defineProperty(cW,"__esModule",{value:!0});cW.NullTerminalService=cW.ITerminalService=void 0;cW.isTerminalService=oDc;cW.isNullTerminalService=sDc;var nDc=an(),$1t=Fc(),iDc=Po();cW.ITerminalService=(0,nDc.createServiceIdentifier)("ITerminalService");var O3r=class t extends iDc.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new $1t.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new $1t.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new $1t.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new $1t.Emitter),this.onDidCloseTerminal=this._onDidCloseTerminal.event}static{this.Instance=new t}get terminalBuffer(){return""}get terminalLastCommand(){}get terminalSelection(){return""}get terminalShellType(){return""}async getCwdForSession(e){return Promise.resolve(void 0)}async getCopilotTerminals(e){return Promise.resolve([])}getTerminalsWithSessionInfo(){throw new Error("Method not implemented.")}getToolTerminalForSession(e){throw new Error("Method not implemented.")}async associateTerminalWithSession(e,r,n){Promise.resolve()}createTerminal(e,r,n){return{}}get terminals(){return[]}getBufferForTerminal(e,r){return""}getBufferWithPid(e,r){return Promise.resolve("")}getLastCommandForTerminal(e){}contributePath(e,r,n,o){}removePathContribution(e){}};cW.NullTerminalService=O3r;function oDc(t){return t&&typeof t.createTerminal=="function"}a(oDc,"isTerminalService");function sDc(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(sDc,"isNullTerminalService")});var f$i=I(HU=>{"use strict";p();var aDc=HU&&HU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},cDc=HU&&HU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(HU,"__esModule",{value:!0});HU.TerminalMonitor=void 0;var lDc=V1t(),uDc=Po(),bFe=2e3,L3r=class extends uDc.Disposable{static{a(this,"TerminalMonitor")}constructor(e){super(),this._terminalService=e,this._register(this._terminalService.onDidEndTerminalShellExecution(r=>{this._recordTerminalActivity(r)})),this._register(this._terminalService.onDidCloseTerminal(r=>{this._lastActivity?.terminal===r&&(this._lastActivity=void 0)}))}_recordTerminalActivity(e){let r=e.execution;this._lastActivity={terminal:e.terminal,terminalName:e.terminal.name,commandLine:r.commandLine?.value,cwd:dDc(r.cwd),exitCode:e.exitCode,timestamp:Date.now()}}getData(){let e=Date.now(),r=this._terminalService.terminals.length;if(!this._lastActivity)return JSON.stringify({terminalCount:r});let n=this._terminalService.getBufferForTerminal(this._lastActivity.terminal,bFe*2),o=e-this._lastActivity.timestamp,s={terminalName:this._lastActivity.terminalName,commandLine:this._lastActivity.commandLine,cwd:this._lastActivity.cwd,exitCode:this._lastActivity.exitCode,msAgo:o,buffer:n.length<=bFe?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,bFe/2),contentEnd:n.slice(-bFe/2),length:n.length,truncatedChars:n.length-bFe},terminalCount:r};return JSON.stringify(s)}};HU.TerminalMonitor=L3r;HU.TerminalMonitor=L3r=aDc([cDc(0,lDc.ITerminalService)],L3r);function dDc(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(dDc,"formatCwd")});var p$i=I(W1t=>{"use strict";p();Object.defineProperty(W1t,"__esModule",{value:!0});W1t.CurrentDocument=void 0;var fDc=Os(),B3r=class{static{a(this,"CurrentDocument")}constructor(e,r){this.content=e,this.cursorPosition=r,this.lines=e.getLines(),this.transformer=e.getTransformer(),this.cursorOffset=this.transformer.getOffset(r),this.cursorLineOffset=this.cursorPosition.lineNumber-1}lineWithCursor(){let e=this.lines.at(this.cursorLineOffset);if(e===void 0)throw new fDc.BugIndicatingError(`CurrentDocument#lineWithCursor: cursor is out of bounds: cursor: ${this.cursorLineOffset}, doc line count: ${this.lines.length}`);return e}textAfterCursor(){return this.lineWithCursor().substring(this.cursorPosition.column-1)}isCursorAtEndOfLine(){return this.textAfterCursor().match(/^\s*$/)!==null}};W1t.CurrentDocument=B3r});var A$i=I(z1t=>{"use strict";p();Object.defineProperty(z1t,"__esModule",{value:!0});z1t.getCurrentLine=hDc;z1t.isModelLineCompatible=mDc;var h$i=iv(),pDc=ybt();function hDc(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new h$i.Position(o,1)),l=0;for(let A of r.replacements)if(A.replaceRange.endExclusive<=c)l+=A.newText.length-A.replaceRange.length;else{if(A.replaceRange.start=o.startOffset&&n.endOffset<=o.endOffset?ADc(n,o,e,r):!1}a(mDc,"isModelLineCompatible");var gDc=new Set(["()","[]","{}","<>",'""',"''","``"]);function ADc(t,e,r,n){return t.replaced.length>0?r===n?!0:t.startOffset===e.startOffset&&t.endOffset===e.endOffset&&t.replaced===e.replaced&&t.inserted.length>0&&g$i(t.inserted,e.inserted):g$i(t.inserted,e.inserted)}a(ADc,"isUserEditCompatibleWithModelEdit");function g$i(t,e){return e.startsWith(t)?!0:gDc.has(t)?yDc(t,e):!1}a(g$i,"isUserTypingCompatibleWithModelText");function yDc(t,e){let r=0;for(let n=0;n{"use strict";p();var _Dc=HN&&HN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EDc=HN&&HN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vDc=HN&&HN.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o ${r}`);let d=(async function*(){let f=await o.next();for(;!f.done;)yield f.value,f=await o.next()})();return{editIntent:r,remainingLinesStream:d,parseError:n}}n=`unknownIntentValue:${c}`,e.warn(`Edit intent parse error: ${n} (using Xtab275EditIntentShort prompting strategy). Defaulting to High (always show). First line was: "${c.substring(0,100)}..."`);let u=(async function*(){yield s.value;let d=await o.next();for(;!d.done;)yield d.value,d=await o.next()})();return{editIntent:r,remainingLinesStream:u,parseError:n}}a(bDc,"parseEditIntentFromStreamShortName");async function SDc(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=Y1t.EditIntent.High,s,c=t[Symbol.asyncIterator](),l=await c.next();if(l.done){s="emptyResponse",e.warn("Empty response stream, no edit_intent tag found");let m=(async function*(){})();return{editIntent:o,remainingLinesStream:m,parseError:s}}let u=l.value,d=u.indexOf(r),f=u.indexOf(n);if(d!==-1&&f!==-1&&f>d){let m=u.substring(d+r.length,f).trim().toLowerCase();["no_edit","low","medium","high"].includes(m)||(s=`unknownIntentValue:${m}`,e.warn(`Unknown edit_intent value: "${m}", defaulting to High`)),o=Y1t.EditIntent.fromString(m),e.trace(`Parsed edit_intent from first line: "${m}" -> ${o}`);let A=u.substring(f+n.length),y=(async function*(){A.trim()!==""&&(yield A);let _=await c.next();for(;!_.done;)yield _.value,_=await c.next()})();return{editIntent:o,remainingLinesStream:y,parseError:s}}d!==-1&&f===-1?s="malformedTag:startWithoutEnd":d===-1&&f!==-1?s="malformedTag:endWithoutStart":s="noTagFound",e.warn(`Edit intent parse error: ${s} (using Xtab275EditIntent prompting strategy). Defaulting to High (always show). First line was: "${u.substring(0,100)}..."`);let h=(async function*(){yield u;let m=await c.next();for(;!m.done;)yield m.value,m=await c.next()})();return{editIntent:o,remainingLinesStream:h,parseError:s}}a(SDc,"parseEditIntentFromStreamTags")});var J1t=I(TEe=>{"use strict";p();Object.defineProperty(TEe,"__esModule",{value:!0});TEe.linesWithBackticksRemoved=IDc;TEe.constructMessages=xDc;TEe.charCount=wDc;TEe.findMergeConflictMarkersRange=RDc;var U3r=wo(),y$i=$3e(),TDc=Id();async function*IDc(t){let e=-1,r;for await(let n of t)if(++e,r&&(yield r,r=void 0),n.match(/^```[a-z]*$/)){if(e===0)continue;r=n}else yield n}a(IDc,"linesWithBackticksRemoved");function xDc({systemMsg:t,userMsg:e}){return[{role:U3r.Raw.ChatRole.System,content:(0,y$i.toTextParts)(t)},{role:U3r.Raw.ChatRole.User,content:(0,y$i.toTextParts)(e)}]}a(xDc,"constructMessages");function wDc(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===U3r.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(wDc,"charCount");function RDc(t,e,r){for(let n=e.start;n>>>>>>"))return new TDc.OffsetRange(n,o+1)}}a(RDc,"findMergeConflictMarkersRange")});var v$i=I(lW=>{"use strict";p();Object.defineProperty(lW,"__esModule",{value:!0});lW.ResponseParseResult=void 0;lW.handleEditWindowOnly=DDc;lW.handleCodeBlock=NDc;lW.handleEditWindowWithEditIntent=MDc;lW.handleUnifiedWithXml=ODc;var SFe=R_e(),_$i=P$(),E$i=vD(),IEe=iW(),kDc=F3r(),PDc=J1t(),uB;(function(t){class e{static{a(this,"EditWindowLines")}constructor(s,c){this.lines=s,this.editIntentMetadata=c}}t.EditWindowLines=e;class r{static{a(this,"Done")}constructor(s){this.reason=s}}t.Done=r;class n{static{a(this,"DirectEdits")}constructor(s){this.stream=s}}t.DirectEdits=n})(uB||(lW.ResponseParseResult=uB={}));function DDc(t){return new uB.EditWindowLines(t)}a(DDc,"handleEditWindowOnly");function NDc(t){return new uB.EditWindowLines((0,PDc.linesWithBackticksRemoved)(t))}a(NDc,"handleCodeBlock");async function MDc(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,kDc.parseEditIntentFromStream)(t,e,r);return new uB.EditWindowLines(o,{intent:n,parseError:s})}a(MDc,"handleEditWindowWithEditIntent");async function ODc(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new uB.Done(new SFe.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===IEe.ResponseTags.NO_CHANGE.start)return new uB.Done(new SFe.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===IEe.ResponseTags.INSERT.start)return new uB.DirectEdits(LDc(o,e,r));if(c===IEe.ResponseTags.EDIT.start){let l=BDc(o);return new uB.EditWindowLines(l)}return new uB.Done(new SFe.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(ODc,"handleUnifiedWithXml");async function*LDc(t,e,r){let{editWindowLines:n,editWindowLineRange:o,cursorLineInEditWindowOffset:s,cursorColumnZeroBased:c,editWindow:l,originalEditWindow:u,targetDocument:d,isFromCursorJump:f}=e,h=await t.next();if(h.done||h.value.includes(IEe.ResponseTags.INSERT.end))return new SFe.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new _$i.LineReplacement(new E$i.LineRange(o.start+s+1,o.start+s+2),[m.slice(0,c)+h.value+m.slice(c)]),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d};let A=[],y=await t.next();for(;!y.done&&!y.value.includes(IEe.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let _=o.start+s+2;return yield{edit:new _$i.LineReplacement(new E$i.LineRange(_,_),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new SFe.NoNextEditReason.NoSuggestions(r,l)}a(LDc,"generateInsertEdits");async function*BDc(t){let e=await t.next();for(;!e.done;){if(e.value.includes(IEe.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(BDc,"generateEditLines")});var C$i=I(GU=>{"use strict";p();var FDc=GU&&GU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Ik=GU&&GU.__param||function(t,e){return function(r,n){e(r,n,t)}},Z1t;Object.defineProperty(GU,"__esModule",{value:!0});GU.XtabEndpoint=void 0;var UDc=rE(),QDc=LU(),Q3r=Hl(),qDc=lE(),jDc=WV(),HDc=Fie(),GDc=Np(),$Dc=Oy(),VDc=UU(),WDc=Rh(),zDc=bh(),YDc=VV(),KDc=Mie(),JDc=Ks(),q3r=class extends HDc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{Z1t=this}static{this.chatModelInfo={id:"xtab-4o-mini-finetuned",name:"xtab-4o-mini-finetuned",vendor:"xtab",model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"unknown",capabilities:{type:"chat",family:"xtab-4o-mini-finetuned",tokenizer:KDc.TokenizerType.O200K,limits:{max_prompt_tokens:12285,max_output_tokens:4096},supports:{streaming:!0,parallel_tool_calls:!1,tool_calls:!1,vision:!1,prediction:!0}}}}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y){let _=n?{...Z1t.chatModelInfo,id:n}:Z1t.chatModelInfo;super(_,s,f,h,m,o,g,A,y),this._url=e,this._apiKey=r,this._configService=o}get urlOrRequestMetadata(){return this._configService.getConfig(Q3r.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig(Q3r.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey)||this._apiKey;if(!e){let r=`Missing API key for custom URL (${this.urlOrRequestMetadata}). Provide the API key using vscode setting \`github.copilot.chat.advanced.inlineEdits.xtabProvider.apiKey\` or, if in simulations using \`--nes-api-key\` or \`--config-file\``;throw console.error(r),new Error(r)}return{Authorization:`Bearer ${e}`,"api-key":e}}};GU.XtabEndpoint=q3r;GU.XtabEndpoint=q3r=Z1t=FDc([Ik(3,Q3r.IConfigurationService),Ik(4,jDc.IDomainService),Ik(5,$Dc.IFetcherService),Ik(6,qDc.ICAPIClientService),Ik(7,zDc.ITelemetryService),Ik(8,UDc.IAuthenticationService),Ik(9,QDc.IChatMLFetcher),Ik(10,YDc.ITokenizerProvider),Ik(11,JDc.IInstantiationService),Ik(12,WDc.IExperimentationService),Ik(13,VDc.IChatWebSocketManager),Ik(14,GDc.ILogService)],q3r)});var X1t=I(xEe=>{"use strict";p();Object.defineProperty(xEe,"__esModule",{value:!0});xEe.NullProxyModelsService=xEe.IProxyModelsService=void 0;var ZDc=an(),XDc=Fc();xEe.IProxyModelsService=(0,ZDc.createServiceIdentifier)("IProxyModelsService");var j3r=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=XDc.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};xEe.NullProxyModelsService=j3r});var b$i=I(mA=>{"use strict";p();var eNc=mA&&mA.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tNc=mA&&mA.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),rNc=mA&&mA.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},nNc=mA&&mA.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;otypeof g=="boolean"?g?tTt.IncludeLineNumbersOption.WithSpaceAfter:tTt.IncludeLineNumbersOption.None:g),f=new G3r.PromptPieces(e.currentDocument,e.editWindowLinesRange,e.areaAroundEditWindowLinesRange,e.activeDoc,e.xtabHistory,s.lines,c,e.langCtx,e.aggressivenessLevel,u,this.computeTokens,{...e.opts,includePostScript:!1,lintOptions:l,recentlyViewedDocuments:{...e.opts.recentlyViewedDocuments,includeLineNumbers:d}}),{prompt:h}=(0,G3r.getUserPrompt)(f),m=(0,gNc.constructMessages)({systemMsg:r,userMsg:h});return jI.Result.ok({messages:m,keptRange:s.keptRange})}async predictNextCursorPosition(e,r,n){let o=r.tracer.createSubLogger("predictNextCursorPosition"),s=this.buildCursorPredictionPrompt(e);if(s.isError())return o.trace(`Failed to construct tagged file: ${s.err.message}`),jI.Result.fromString(s.err.message);let{messages:c,keptRange:l}=s.val;r.telemetry.setCursorJumpPrompt(c),r.logContext.setCursorJumpPrompt(c,l);let u=this.determineModelName();r.telemetry.setCursorJumpModelName(u);let d=await this.resolveEndpoint(u,o);if(!d)return jI.Result.fromString("endpointNotResolved");let{endpoint:f,usesResponsesApi:h}=d,m=this.configService.getConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),g=this.configService.getExperimentBasedConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionMaxResponseTokens,this.expService),A={max_tokens:h?Math.max(g,2048):g};m&&(A={...A,secretKey:m});let y=await f.makeChatRequest2({messages:c,debugName:"nes.nextCursorPosition",finishedCb:void 0,location:H3r.ChatLocation.Other,requestOptions:A},n);if(y.type!==H3r.ChatFetchResponseType.Success)return y.type===H3r.ChatFetchResponseType.NotFound&&(o.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),jI.Result.fromString(`fetchError:${y.type}`);try{r.telemetry.setCursorJumpResponse(y.value);let _=y.value.trim();return this.parseResponse(_,l)}catch(_){return o.trace(`Failed to parse predicted line number from response '${y.value}': ${_}`),jI.Result.fromString(`failedToParseLine:"${y.value}". Error ${dNc.ErrorUtils.fromUnknown(_).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUseEndpointProvider)){let c=(await this.endpointProvider.getAllChatEndpoints()).find(u=>u.model===e||u.family===e);if(!c){r.trace(`Could not find endpoint for model '${e}' via endpoint provider`);return}let l=c.apiType==="responses";return{endpoint:c,usesResponsesApi:l}}let o=this.configService.getConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(sNc.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:iNc.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:fNc.TokenizerType.CL100K,limits:void 0,supports:{parallel_tool_calls:!1,tool_calls:!1,streaming:!0,vision:!1,prediction:!1,thinking:!1}}}),usesResponsesApi:!1}}determineModelName(){return this.configService.getExperimentBasedConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??ANc}determineLintOptions(){let e=this.configService.getConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...rTt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(GN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,rTt.parseLintOptionString)(r,rTt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):rTt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=yNc(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return jI.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?jI.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?jI.Result.fromString("crossFileEmptyFilePath"):jI.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?jI.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(yNc,"stripThinkTags")});var k$i=I(TFe=>{"use strict";p();Object.defineProperty(TFe,"__esModule",{value:!0});TFe.XtabPatchResponseHandler=void 0;TFe.tryRemoveDuplicateAdditions=R$i;var S$i=Qie(),$ie=wy(),_Nc=qyt(),T$i=R_e(),ENc=gv(),vNc=Ml(),CNc=$A(),I$i=hd(),W3r=P$(),bNc=jbt(),x$i=vD(),SNc=A3r(),TNc=bEe(),INc=iW(),nTt=class t{static{a(this,"Patch")}constructor(e,r,n){this.filePath=e,this.lineNumZeroBased=r,this.patchIndex=n,this.removedLines=[],this.addedLines=[],this.isProgressiveRevealEarlyEdit=!1}static ofLine(e,r){let n=e.match(/^(.+):(\d+)$/);if(!n)return null;let[,o,s]=n;return new t(o,parseInt(s,10),r)}static progressiveRevealParts(e){let r=new t(e.filePath,e.lineNumZeroBased,e.patchIndex);r.removedLines=[e.removedLines[0]],r.addedLines=[...e.addedLines],r.isProgressiveRevealEarlyEdit=!0;let n=new t(e.filePath,e.lineNumZeroBased+1,e.patchIndex);return n.removedLines=e.removedLines.slice(1),{early:r,continuation:n}}addLine(e){let r=e.slice(1);return e.startsWith("-")?(this.removedLines.push(r),!0):e.startsWith("+")?(this.addedLines.push(r),!0):!1}toString(){return[`${this.filePath}:${this.lineNumZeroBased}`,...this.removedLines.map(e=>`-${e}`),...this.addedLines.map(e=>`+${e}`)].join(` +`)}};function V3r(t){return t.trim().length>1}a(V3r,"isMeaningfulLine");function R$i(t,e){let r=t.newLines;if(r.length===0)return;let n=t.lineRange.endLineNumberExclusive,o=e.lineRange.endLineNumberExclusive-1,s=Math.min(o+1,n+r.length),c=[];for(let l=n;l=1;l--){let u=r.slice(-l);if((0,vNc.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&V3r(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&V3r(c[0])&&V3r(c[1])){let l=c[0],u=c[1];for(let d=1;dnew W3r.LineReplacement(new x$i.LineRange(m+g.original.startLineNumber-1,m+g.original.endLineNumberExclusive-1),f.slice(g.modified.startLineNumber-1,g.modified.endLineNumberExclusive-1)))}a(r,"splitReplacement"),t.splitReplacement=r;async function*n(u,d,f,h,m,g,A=$ie.DuplicateAdditionsMode.Off,y=!1,_=!1,E=!1){let v=g.createSubLogger(["XtabCustomDiffPatchResponseHandler","handleResponse"]),S=(0,TNc.toUniquePath)(f,h?.path);try{let T=!1,w=y?d.cursorLineOffset:void 0,R=y?S:void 0,x=RNc(y,E,A);for await(let k of l(u,w,R,x)){if(T)continue;let D=k.filePath===S,N=D?f:s(k.filePath,h);if(!N){v.error(`Could not resolve target document for edit: ${k.toString()}`);continue}let O=o(k);if(kNc(k,D,A)){let q=xNc(k,O,d.content,A,v);switch(q.kind){case"skip":continue;case"skipAndStop":T=!0;continue;case"emit":O=q.lineReplacement;break}}let B=_?r(O,k.removedLines):[O];for(let q of B)yield{edit:q,isFromCursorJump:!1,targetDocument:N,window:m,patchIndex:k.patchIndex}}}catch(T){if(T instanceof SNc.FetchStreamError)return T.reason;let w=ENc.ErrorUtils.fromUnknown(T);return new T$i.NoNextEditReason.Unexpected(w)}return new T$i.NoNextEditReason.NoSuggestions(d.content,m,void 0)}a(n,"handleResponse"),t.handleResponse=n;function o(u){return new W3r.LineReplacement(new x$i.LineRange(u.lineNumZeroBased+1,u.lineNumZeroBased+1+u.removedLines.length),u.addedLines)}a(o,"resolveEdit");function s(u,d){if((0,CNc.isAbsolute)(u))return S$i.DocumentId.create(I$i.URI.file(u).toString());if(d)return S$i.DocumentId.create(I$i.URI.joinPath(d,u).toString())}a(s,"resolveTargetDocument");function c(u,d,f,h){return u.lineNumZeroBased!==d||u.filePath!==f||!(h?u.removedLines.length>=1:u.removedLines.length===1)||u.addedLines.length<1||!_Nc.ResponseProcessor.isAdditiveEdit(u.removedLines[0],u.addedLines[0])?!1:!PNc(u)}a(c,"isGhostTextPatch"),t.isGhostTextPatch=c;async function*l(u,d,f,h=!1){let m=null,g=!0,A=!1,y=0,_=a(E=>{let v=nTt.ofLine(E,y);return v!==null&&y++,v},"parseNextPatchHeader");for await(let E of u){if(E.trim()===INc.ResponseTags.NO_EDIT)break;if(m===null){m=_(E);continue}if(m.addLine(E)){if(g&&!A&&d!==void 0&&f!==void 0&&m.addedLines.length===1&&m.removedLines.length>=1){if(c(m,d,f,h)){let{early:v,continuation:S}=nTt.progressiveRevealParts(m);yield v,m=S}A=!0}continue}(m.removedLines.length>0||m.addedLines.length>0)&&(yield m),m=_(E),g=!1}m&&(m.removedLines.length>0||m.addedLines.length>0)&&(yield m)}a(l,"extractEdits"),t.extractEdits=l})(w$i||(TFe.XtabPatchResponseHandler=w$i={}))});var z$i=I(Qp=>{"use strict";p();var DNc=Qp&&Qp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NNc=Qp&&Qp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),MNc=Qp&&Qp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ONc=Qp&&Qp.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oMath.floor(e.length/4)}constructor(e,r,n,o,s,c,l,u,d,f,h,m){this.modelService=e,this.simulationCtx=r,this.instaService=n,this.workspaceService=o,this.diffService=s,this.configService=c,this.expService=l,this.langCtxService=u,this.langDiagService=d,this.ignoreService=f,this.similarFilesContextService=h,this._telemetryService=m,this.ID=$N.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(sMc.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(dMc.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(hMc.XtabNextCursorPredictor,$N.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new zo.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new zo.NoNextEditReason.ActiveDocumentHasNoEdits;return new zo.WithStatelessProviderTelemetry(h,s.build(wk.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,fW.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new zo.WithStatelessProviderTelemetry(d.value,s.build(wk.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof zo.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new zo.WithStatelessProviderTelemetry(f,s.build(wk.Result.error(f)))}catch(c){let l=dW.ErrorUtils.fromUnknown(c),u=new zo.NoNextEditReason.Unexpected(l);return new zo.WithStatelessProviderTelemetry(u,s.build(wk.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,oMc.getOrDeduceSelectionFromLastEdit)(e.getActiveDocument()),r,n,o,s)}async gatherContextAndClipCurrentFile(e,r,n,o,s,c,l,u,d){if(e!==void 0){let f=await l();if(c.isCancellationRequested)return wk.Result.error(new zo.NoNextEditReason.GotCancelled("afterLanguageContextAwait"));let h=await u();if(c.isCancellationRequested)return wk.Result.error(new zo.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait"));let m=(0,$U.runGlobalBudgetCascade)(r,n.xtabEditHistory,f,$N.computeTokens,o,h,e),g=Bo.GlobalBudgetOptions.currentFileBudget(e),A=d(g+m.finalSurplus);if(A.isError())return wk.Result.error(new zo.NoNextEditReason.PromptTooLarge("currentFile"));let{clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:_}=A.val;return s.setNLinesOfCurrentFileInPrompt(y.lines.length),wk.Result.ok({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:_,precomputedCascade:m,langCtx:f,neighborSnippets:h})}else{let f=d(void 0);if(f.isError())return wk.Result.error(new zo.NoNextEditReason.PromptTooLarge("currentFile"));let{clippedTaggedCurrentDoc:h,areaAroundCodeToEdit:m}=f.val;s.setNLinesOfCurrentFileInPrompt(h.lines.length);let g=await l();if(c.isCancellationRequested)return wk.Result.error(new zo.NoNextEditReason.GotCancelled("afterLanguageContextAwait"));let A=await u();return c.isCancellationRequested?wk.Result.error(new zo.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait")):wk.Result.ok({clippedTaggedCurrentDoc:h,areaAroundCodeToEdit:m,precomputedCascade:void 0,langCtx:g,neighborSnippets:A})}}async*doGetNextEditWithSelection(e,r,n,o,s,c,l){let u=o.tracer.createSubLogger(["XtabProvider","doGetNextEditWithSelection"]),{logContext:d,telemetry:f}=o,h=e.getActiveDocument();if(r===null)return new zo.NoNextEditReason.Uncategorized(new Error("NoSelection"));let{promptOptions:m,modelServiceConfig:g}=this.determineModelConfiguration(h);f.setModelConfig(JSON.stringify(g));let A=this.getEndpointWithLogging(m.modelName,d,f),y=new z3r.Position(r.endLineNumber,r.endColumn),_=new fMc.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,_,m,f,n,u);let E=G$i(_),v=this.computeEditWindowLinesRange(_,e,u,f),S=Math.max(0,_.cursorLineOffset-v.start),T=_.transformer.getLineLength(v.endExclusive),w=_.transformer.getOffsetRange(new aTt.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new zo.RequestEditWindowWithCursorJump(w,l):new zo.RequestEditWindow(w);let R=_.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,j$i.countTokensForLines)(R,$N.computeTokens)>x)return new zo.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(Be=>Be.includes(F$i.PromptTags.CURSOR)),N=m.globalBudget;N!==void 0&&Bo.GlobalBudgetOptions.validate(N);let O=a(Be=>{let ne=Be!==void 0?{...m,currentFile:{...m.currentFile,maxTokens:Be}}:m;return(0,$U.constructTaggedFile)(_,v,E,ne,$N.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:Bo.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}})},"clipCurrentFileToBudget"),{aggressivenessLevel:B,userHappinessScore:q}=this.userInteractionMonitor.getAggressivenessLevel(),M=this.configService.getExperimentBasedConfig(li.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(M),f.setXtabAggressivenessLevel(B),q!==void 0&&f.setXtabUserHappinessScore(q);let L=a(()=>this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s),"gatherLanguageContext"),U=a(()=>m.neighborFiles.enabled?(0,uW.raceCancellation)((0,uW.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,_.cursorOffset),n.getDebounceTime()),s):Promise.resolve(void 0),"gatherNeighborSnippets"),j=await this.gatherContextAndClipCurrentFile(N,h,e,m,f,s,L,U,O);if(j.isError())return j.err;let{clippedTaggedCurrentDoc:Q,areaAroundCodeToEdit:Y,precomputedCascade:W,langCtx:V,neighborSnippets:z}=j.val,ie=new lMc.LintErrors(h.id,_,this.langDiagService,e.xtabEditHistory),H=new $U.PromptPieces(_,v,E,h,e.xtabEditHistory,Q.lines,Y,V,B,ie,$N.computeTokens,m,z,W),{prompt:re,nDiffsInPrompt:le,neighborSnippetsResult:Le,sectionTokens:me}=(0,$U.getUserPrompt)(H);f.setNDiffsInPrompt(le),Le&&(f.setNNeighborSnippetsComputed(Le.nComputed),f.setNNeighborSnippetsInPrompt(Le.nIncluded),f.setNeighborSnippetIndicesInPrompt(Le.includedIndices));let Oe=Bo.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),Te=this.getPredictedOutput(h,_.cursorLineOffset,R,S,Oe),te=$$i(m.promptingStrategy),ee=(0,Y3r.constructMessages)({systemMsg:te,userMsg:re});d.setPrompt(ee),f.setPrompt(ee);let K={...me,systemPrompt:$N.computeTokens(te)};f.setPromptSectionTokens(K),d.setPromptSectionTokens(K);let he=3e4*4;if((0,Y3r.charCount)(ee)>he)return new zo.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new zo.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let Be=ie.getData();f.setLintErrors(Be),d.setDiagnosticsData(Be);let ne=this.terminalMonitor.getData();f.setTerminalOutput(ne),d.setTerminalData(ne)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,_.cursorOffset)),e.fetchIssued=!0;let de={endpoint:A,modelServiceConfig:g,messages:ee,clippedTaggedCurrentDoc:Q,editWindowInfo:{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:S,editWindowLineRange:v},promptPieces:H,prediction:Te,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,de,{shouldRemoveCursorTagFromResponse:D,responseFormat:Oe},{aggressivenessLevel:B,userHappinessScore:q},c,n,{tracer:u,logContext:d,telemetry:f},s)}_configureDebounceTimings(e,r,n,o,s,c){let l=r.isCursorAtEndOfLine();o.setIsCursorAtLineEnd(l);let u=(0,cMc.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsExtraDebounceInlineSuggestion,this.expService);u&&d>0?(c.trace("Debouncing for inline suggestion position"),s.setExtraDebounce(d)):l?(c.trace("Debouncing for cursor at end of line"),s.setExtraDebounce(this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,lC.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(li.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[lC.AggressivenessSetting.Low]:{minResponseConfigKey:li.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[lC.AggressivenessSetting.Medium]:{minResponseConfigKey:li.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[lC.AggressivenessSetting.High]:{debounceConfigKey:li.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[lC.AggressivenessSetting.Default]:void 0}[n];if(s){if(s.debounceConfigKey){let c=this.configService.getExperimentBasedConfig(s.debounceConfigKey,this.expService);e.setBaseDebounceTime(c),r.trace(`Aggressiveness ${n}: debounce set to ${c}ms`)}if(s.minResponseConfigKey){if(this.userInteractionMonitor.wasLastActionAcceptance){r.trace(`Aggressiveness ${n}: skipping min response time (last action was acceptance)`);return}let c=this.configService.getExperimentBasedConfig(s.minResponseConfigKey,this.expService);e.setExpectedTotalTime(c),r.trace(`Aggressiveness ${n}: min response time set to ${c}ms`)}}}getAndProcessLanguageContext(e,r,n,o,s,c,l){let u=this.configService.getConfig(li.ConfigKey.TeamInternal.InlineEditsLogContextRecorderEnabled);if(!s.languageContext.enabled&&!u)return Promise.resolve(void 0);let d=this.getLanguageContext(e,r,n,o,c,l);return u&&d.then(f=>{f&&c.logContext.setLanguageContext(f)}),s.languageContext.enabled?d:Promise.resolve(void 0)}async getLanguageContext(e,r,n,o,s,c){try{let l=this.workspaceService.textDocuments.find(v=>v.uri.toString()===n.id.uri);if(l===void 0||this.langCtxService.getContextProviders(l,q$i.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new iMc.Position(o.lineNumber-1,o.column-1),h={opportunityId:e.opportunityId,completionId:e.headerRequestId,documentContext:{uri:l.uri.toString(),languageId:l.languageId,version:l.version,offset:l.offsetAt(f),position:f},activeExperiments:new Map,timeBudget:d,timeoutEnd:Date.now()+d,source:"nes"},m=a(async v=>{let S=[v.uri,...v.additionalUris??[]];return!!await(0,KNc.raceFilter)(S.map(w=>this.ignoreService.isCopilotIgnored(w)),w=>w)},"isSnippetIgnored"),g=[],A=a(async()=>{let v=this.langCtxService.getContextItems(l,h,c);for await(let S of v)S.kind===D$i.ContextKind.Snippet&&await m(S)||g.push({context:S,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,uW.raceCancellation)((0,uW.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let _=Date.now(),E=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of E)v.kind===D$i.ContextKind.Snippet&&await m(v)||g.push({context:v,timeStamp:_,onTimeout:!0});return{start:y,end:_,items:g}}catch(l){s.logContext.setError(dW.ErrorUtils.fromUnknown(l)),s.tracer.trace(`Failed to fetch language context: ${l}`);return}}async*streamEditsWithFiltering(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEditsWithFiltering"),f={...l,tracer:d},h=this.streamEdits(e,r,n,o,s,c,f,u),m=0,g=await h.next();for(;!g.done;){let A=g.value.edit,[y,_]=this.filterEdit(e.getActiveDocument(),[A],r.modelServiceConfig.allowImportChanges??jNc.ImportChanges.None);y.length===0?d.trace(`Filtered out an edit: ${A.toString()} using ${_.join(", ")} filter(s)`):(d.trace(`Yielding an edit: ${A.toString()}`),yield g.value,m++),g=await h.next()}return m===0&&g.value instanceof zo.NoNextEditReason.NoSuggestions?yield*this.doGetNextEditsWithCursorJump(e,r,c,l,u,s):g.value}async*streamEdits(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEdits"),f=new ZNc.CancellationTokenSource(u),h=f.token;try{return yield*this._streamEditsImpl(e,r,n,o,s,c,{...l,tracer:d},u,f,h)}finally{f.dispose()}}async _performFetch(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=f,A=this.configService.getExperimentBasedConfig(li.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new LNc.FetchStreamSource,_=new XNc.StopWatch,E="",v,S=new uW.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:$N.ID,messages:r,finishedCb:a(async(k,D,N)=>{S.isSettled||S.complete(),v===void 0&&k!==""&&(v=_.elapsed(),m.addLog(`TTFT ${v} ms`)),y.update(k,N),E=k,m.setResponse(E)},"finishedCb"),location:Vf.ChatLocation.Other,source:void 0,requestOptions:{temperature:0,stream:!0,prediction:n},userInitiatedRequest:void 0,telemetryProperties:{requestId:o},useFetcher:A,customMetadata:{aggressivenessLevel:s.aggressivenessLevel,userHappinessScore:s.userHappinessScore}},d);g.setResponse(T.then(k=>({response:k,ttft:v}))),m.setFullResponse(T.then(k=>k.type===Vf.ChatFetchResponseType.Success?k.value:void 0)),T.then(k=>{k.type!==Vf.ChatFetchResponseType.Success?y.reject(new B$i.FetchStreamError(X3r(k))):y.resolve()}).catch(k=>{m.setError(dW.ErrorUtils.fromUnknown(k)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(dW.ErrorUtils.fromUnknown(k))}).finally(()=>{m.setFetchEndTime(),S.isSettled||S.complete(),m.setResponse(E)});let w=await Promise.race([S.p,T]);if(w&&w.type!==Vf.ChatFetchResponseType.Success)return w.type===Vf.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,pW.ModelNotFound.INSTANCE):w.type===Vf.ChatFetchResponseType.Unknown&&w.reason===Vf.RESPONSE_CONTAINED_NO_CHOICES?new pW.FetchFailure(new zo.NoNextEditReason.NoSuggestions(u,l)):new pW.FetchFailure(X3r(w));let R=N$i.AsyncIterUtilsExt.splitLines(N$i.AsyncIterUtils.map(y.stream,k=>k.delta.text)),x=(async function*(){let k=0;for await(let D of R){let N=`Line ${k++} emitted with latency ${_.elapsed()} ms`;h.trace(N),yield c?D.replaceAll(F$i.PromptTags.CURSOR,""):D}})();return new pW.Lines(x,()=>E,_)}async*_streamEditsImpl(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=l,{endpoint:A,messages:y,clippedTaggedCurrentDoc:_,editWindowInfo:E,promptPieces:v,prediction:S,originalEditWindow:T}=r,{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:x,editWindowLineRange:k}=E,D=e.getActiveDocument().id,N=await this._performFetch(A,y,S,e.headerRequestId,o,n.shouldRemoveCursorTagFromResponse,w,e.documentBeforeEdits,f,l);if(N instanceof pW.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof pW.FetchFailure)return N.reason;let{linesStream:O,getResponseSoFar:B,fetchRequestStopWatch:q}=N,M=s instanceof fW.Retrying&&s.reason==="cursorJump",L;try{switch(n.responseFormat){case Bo.ResponseFormat.EditWindowOnly:{L=(0,Vie.handleEditWindowOnly)(O);break}case Bo.ResponseFormat.CodeBlock:{L=(0,Vie.handleCodeBlock)(O);break}case Bo.ResponseFormat.EditWindowWithEditIntent:case Bo.ResponseFormat.EditWindowWithEditIntentShort:{let ie=n.responseFormat===Bo.ResponseFormat.EditWindowWithEditIntentShort?Q$i.EditIntentParseMode.ShortName:Q$i.EditIntentParseMode.Tags;L=await(0,Vie.handleEditWindowWithEditIntent)(O,h,ie);break}case Bo.ResponseFormat.CustomDiffPatch:{let ie=e.getActiveDocument(),H=v.currentDocument,le=H.lines[_.keptRange.endExclusive-1].length,Le=H.transformer.getOffsetRange(new aTt.Range(_.keptRange.start+1,1,_.keptRange.endExclusive,le+1)),me=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService),Oe=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchFastYieldLineWithCursor,this.expService),Te=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchFastYieldLineWithCursorMultiLine,this.expService),te=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabSplitPatchOnDiff,this.expService);L=new Vie.ResponseParseResult.DirectEdits(mMc.XtabPatchResponseHandler.handleResponse(O,H,ie.id,ie.workspaceRoot,Le,h,me,Oe,te,Te));break}case Bo.ResponseFormat.UnifiedWithXml:{L=await(0,Vie.handleUnifiedWithXml)(O,{editWindowLines:R,editWindowLineRange:k,cursorLineInEditWindowOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,Wie.assertNever)(n.responseFormat)}if(L instanceof Vie.ResponseParseResult.Done)return L.reason;if(L instanceof Vie.ResponseParseResult.DirectEdits)return yield*L.stream;if(L.editIntentMetadata){let{intent:ie,parseError:H}=L.editIntentMetadata;if(g.setEditIntent(ie),H&&g.setEditIntentParseError(H),!Bo.EditIntent.shouldShowEdit(ie,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${ie}" with aggressiveness "${v.aggressivenessLevel}"`),new zo.NoNextEditReason.FilteredOut(`editIntent:${ie} aggressivenessLevel:${v.aggressivenessLevel}`)}let U=L.lines,j={emitFastCursorLineChange:P$i.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${q.elapsed()} ms`);let Q=(0,JNc.backwardCompatSetting)(this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),ie=>{switch(ie){case!1:case void 0:return lC.EarlyDivergenceCancellationMode.Off;case!0:return lC.EarlyDivergenceCancellationMode.Cursor;case lC.EarlyDivergenceCancellationMode.Off:case lC.EarlyDivergenceCancellationMode.Cursor:case lC.EarlyDivergenceCancellationMode.EditWindow:return ie;default:return lC.EarlyDivergenceCancellationMode.Off}}),Y=!1,W=Q===lC.EarlyDivergenceCancellationMode.Off?U:yMc(U,x,e,k,R,d,l,ie=>{Y=ie},Q),V=0,z=!1;for await(let ie of P$i.ResponseProcessor.diff(R,W,x,j)){if(Y)break;h.trace(`ResponseProcessor streamed edit #${V} with latency ${q.elapsed()} ms`);let H=[];if(ie.lineRange.startLineNumber===ie.lineRange.endLineNumberExclusive||ie.newLines.length===0||ie.lineRange.endLineNumberExclusive-ie.lineRange.startLineNumber===1&&ie.newLines.length===1){let re=new sTt.LineReplacement(new L$i.LineRange(ie.lineRange.startLineNumber+k.start,ie.lineRange.endLineNumberExclusive+k.start),ie.newLines);H.push(re)}else{let re=R.slice(ie.lineRange.startLineNumber-1,ie.lineRange.endLineNumberExclusive-1).join(` `),le=await this.diffService.computeDiff(re,ie.newLines.join(` -`),{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1});h.trace(`Ran diff for #${V} with latency ${q.elapsed()} ms`);let Le=k.start+ie.lineRange.startLineNumber;for(let me of le.changes){let Oe=new oTt.LineReplacement(new M$i.LineRange(Le+me.original.startLineNumber-1,Le+me.original.endLineNumberExclusive-1),ie.newLines.slice(me.modified.startLineNumber-1,me.modified.endLineNumberExclusive-1));H.push(Oe)}}m.setResponse(B());for(let re of H){if(h.trace(`extracting edit #${V}: ${re.toString()}`),!z){z=!0;let le=this.determineArtificialDelayMs(c,h,g);if(le&&(await(0,lW.timeout)(le),h.trace(`Artificial delay of ${le} ms completed`),u.isCancellationRequested))return new zo.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:re,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},V++}}return Y?new zo.NoNextEditReason.GotCancelled(Q===lC.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new zo.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(U){return U instanceof O$i.FetchStreamError?U.reason:(m.setError(U),new zo.NoNextEditReason.Unexpected(uW.ErrorUtils.fromUnknown(U)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new zo.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof dW.Retrying)return m;if(Y3r(e))return l.trace("Skipping cursor prediction: user typed during request"),new zo.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,o,s);if(s.isCancellationRequested)return new zo.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(Y3r(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new zo.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetchUserTyped");if(A.isError())return l.trace(`Predicted next cursor line error: ${A.err.message}`),u.setNextCursorLineError(A.err.message),m;let y=A.val;if(y.kind==="differentFile")return yield*this.handleCrossFilePrediction(y,g,e,r,n,o,s);let _=y.lineNumber,E=_-h.currentDocument.cursorLineOffset;if(u.setNextCursorLineDistance(E),u.setNextCursorIsCrossFile(!1),l.trace(`Predicted next cursor line: ${_}`),_>=h.currentDocument.lines.length)return l.trace("Predicted next cursor line error: exceedsDocumentLines"),u.setNextCursorLineError("exceedsDocumentLines"),m;if(h.editWindowLinesRange.contains(_))return l.trace("Predicted next cursor line error: withinEditWindow"),u.setNextCursorLineError("withinEditWindow"),m;let v=_+1,S=h.activeDoc.documentAfterEditsLines.at(_),T=$N.getNextCursorColumn(S);switch(g){case nTt.NextCursorLinePrediction.Jump:{let w=new W3r.Position(v,T);return new zo.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case nTt.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new sTt.Range(v,T,v,T),n,o,s,new dW.Retrying("cursorJump"),d);default:(0,Vie.assertNever)(g)}}async*handleCrossFilePrediction(e,r,n,o,s,c,l){let{tracer:u,telemetry:d}=c,{editWindowInfo:{editWindow:f},promptPieces:h}=o,m=h.activeDoc.workspaceRoot;if(!m&&!(0,D$i.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new zo.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,D$i.isAbsolute)(e.filePath)?N$i.URI.file(e.filePath):N$i.URI.joinPath(m,e.filePath),A=FNc.DocumentId.create(g.toString()),y=e.lineNumber+1,_=new W3r.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case nTt.NextCursorLinePrediction.Jump:return new zo.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,_,A);case nTt.NextCursorLinePrediction.OnlyWithEdit:{let E;try{E=await this.workspaceService.openTextDocument(g)}catch(R){return u.trace(`Failed to open target file for cross-file edit: ${uW.ErrorUtils.fromUnknown(R).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new zo.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,_,A)}if(l.isCancellationRequested)return new zo.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(Y3r(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new zo.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new XNc.StringText(E.getText()),S=v.getLines();if(e.lineNumber>=S.length)return u.trace("Predicted cross-file cursor jump error: exceedsDocumentLines"),d.setNextCursorLineError("crossFile:exceedsDocumentLines"),new zo.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let T=new zo.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,qNc.LanguageId.create(E.languageId),S,oTt.LineEdit.empty,v,new UNc.Edits(ZNc.StringEdit,[])),w=new zo.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[T],0,n.xtabEditHistory,new lW.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(w,new sTt.Range(y,1,y,1),s,c,l,new dW.Retrying("cursorJump"),f)}default:(0,Vie.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderUseVaryingLinesAbove,this.expService)){l=0;for(let g=0;g<8;++g){let A=c-g;if(A<0)break;if(s[A].trim()!==""){l=g;break}}}else l=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??$U.N_LINES_ABOVE;let u;if(r.expandedEditWindowNLines!==void 0)n.trace(`Using expanded nLinesBelow: ${r.expandedEditWindowNLines}`),u=r.expandedEditWindowNLines;else{let m=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${$U.N_LINES_BELOW}`),u=$U.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new K3r.OffsetRange(d,f),g=(0,z3r.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabOnlyMergeConflictLines,this.expService);o.setMergeConflictExpanded(A?"only":"normal"),A?(n.trace(`Expanding edit window to include ONLY merge conflict markers: ${g.toString()}`),d=g.start,f=g.endExclusive):(n.trace(`Expanding edit window to include merge conflict markers: ${g.toString()}; edit window range [${d}, ${f})`),f=Math.max(f,g.endExclusive))}}return new K3r.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...Bo.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:X3r(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove,this.expService)},languageContext:G$i(e.languageId,{enabled:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(li.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(li.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(li.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.getGlobalBudget()},n=this.modelService.selectedModelConfiguration(),o=Bo.applyStrategyConfig(n);return{promptOptions:X3r(r,o),modelServiceConfig:o}}getGlobalBudget(){let e=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudget,this.expService);if(!e)return;let r=Bo.GlobalBudgetOptions.fromConfigString(e);if(r.isError()){this._telemetryService.sendMSFTTelemetryEvent("incorrectNesGlobalBudgetConfig",{errorMessage:r.err,configValue:e});return}return r.val}getEndpointWithLogging(e,r,n){let o=this.getEndpoint(e);return r.setEndpointInfo(typeof o.urlOrRequestMetadata=="string"?o.urlOrRequestMetadata:JSON.stringify(o.urlOrRequestMetadata.type),o.model),n.setModelName(o.model),o}getEndpoint(e){let r=this.configService.getConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance(dMc.XtabEndpoint,r,n,e):(0,LNc.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n,o,s){if(!this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService))return;let l=s===Bo.ResponseFormat.CustomDiffPatch?this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchModelPredictionKind,this.expService):Bo.PatchModelPrediction.FilePath;return{type:"content",content:$$i(e,r,n,o,s,l)}}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof dW.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,lW.timeout)(c,s)}catch{}}determineArtificialDelayMs(e,r,n){if(this.simulationCtx.isInSimulationTests)return;let o=e.getArtificialDelay();if(!(o<=0))return r.trace(`Enforcing artificial delay of ${o} ms`),n.setArtificialDelay(o),o}filterEdit(e,r,n){let o=[l=>({filterName:"IgnoreImportChangesAspect",filteredEdits:oMc.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:iTt.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(li.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:iTt.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=iTt.editWouldDeleteWhatWasJustInserted;break;case"v2":l=iTt.editWouldDeleteWhatWasJustInserted2;break;default:(0,Vie.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new oTt.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsFilterOutEditsWithSubstrings,this.expService);if(c){let l=c.split(",").map(u=>u.trim()).filter(u=>u.length>0);o.push(u=>({filterName:"FilterOutEditsWithSubstrings",filteredEdits:q$i(u,l)}))}return o.reduce(([l,u],d)=>{let f=d(l);return f.filteredEdits.length===l.length?[l,u]:[f.filteredEdits,[...u,f.filterName]]},[r,[]])}static getNextCursorColumn(e){return(e?.match(/^(\s*)/)?.at(1)?.length??0)+1}};Qp.XtabProvider=J3r;Qp.XtabProvider=J3r=$N=DNc([xk(0,jNc.IInlineEditsModelService),xk(1,GNc.ISimulationTestContext),xk(2,tMc.IInstantiationService),xk(3,WNc.IWorkspaceService),xk(4,ONc.IDiffService),xk(5,li.IConfigurationService),xk(6,$Nc.IExperimentationService),xk(7,U$i.ILanguageContextProviderService),xk(8,HNc.ILanguageDiagnosticsService),xk(9,BNc.IIgnoreService),xk(10,cMc.ISimilarFilesContextService),xk(11,VNc.ITelemetryService)],J3r);function q$i(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(q$i,"filterOutEditsWithSubstrings");function j$i(t){let e=t.cursorLineOffset,r=Math.max(0,e-$U.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+$U.N_LINES_AS_CONTEXT+1);return new K3r.OffsetRange(r,n)}a(j$i,"computeAreaAroundEditWindowLinesRange");function Z3r(t){switch(t.type){case Vf.ChatFetchResponseType.Canceled:return new zo.NoNextEditReason.GotCancelled("afterFetchCall");case Vf.ChatFetchResponseType.OffTopic:case Vf.ChatFetchResponseType.Filtered:case Vf.ChatFetchResponseType.PromptFiltered:case Vf.ChatFetchResponseType.Length:case Vf.ChatFetchResponseType.RateLimited:case Vf.ChatFetchResponseType.QuotaExceeded:case Vf.ChatFetchResponseType.ExtensionBlocked:case Vf.ChatFetchResponseType.AgentUnauthorized:case Vf.ChatFetchResponseType.AgentFailedDependency:case Vf.ChatFetchResponseType.InvalidStatefulMarker:return new zo.NoNextEditReason.Uncategorized(uW.ErrorUtils.fromUnknown(t));case Vf.ChatFetchResponseType.BadRequest:case Vf.ChatFetchResponseType.NotFound:case Vf.ChatFetchResponseType.Failed:case Vf.ChatFetchResponseType.NetworkError:case Vf.ChatFetchResponseType.Unknown:return new zo.NoNextEditReason.FetchFailure(uW.ErrorUtils.fromUnknown(t))}}a(Z3r,"mapChatFetcherErrorToNoNextEditReason");function X3r(t,e){return{...t,modelName:e.modelName,promptingStrategy:e.promptingStrategy,includePostScript:e.includePostScript??t.includePostScript,currentFile:{...t.currentFile,...e.currentFile,includeTags:e.includeTagsInCurrentFile},recentlyViewedDocuments:{...t.recentlyViewedDocuments,...e.recentlyViewedDocuments},lintOptions:e.lintOptions?mMc(t.lintOptions,e.lintOptions):t.lintOptions}}a(X3r,"overrideModelConfig");var hMc={...Bo.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function mMc(t,e){return{...t??hMc,...e}}a(mMc,"mergeLintOptions");function H$i(t){switch(t){case Bo.PromptingStrategy.UnifiedModel:return IFe.unifiedModelSystemPrompt;case Bo.PromptingStrategy.Codexv21NesUnified:case Bo.PromptingStrategy.SimplifiedSystemPrompt:return IFe.simplifiedPrompt;case Bo.PromptingStrategy.PatchBased:case Bo.PromptingStrategy.PatchBased01:case Bo.PromptingStrategy.PatchBased02:case Bo.PromptingStrategy.PatchBased02WithRecentLineNumbers:case Bo.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case Bo.PromptingStrategy.Xtab275:case Bo.PromptingStrategy.XtabAggressiveness:case Bo.PromptingStrategy.Xtab275Aggressiveness:case Bo.PromptingStrategy.Xtab275AggressivenessHighLow:case Bo.PromptingStrategy.Xtab275EditIntent:case Bo.PromptingStrategy.Xtab275EditIntentShort:return IFe.xtab275SystemPrompt;case Bo.PromptingStrategy.Nes41Miniv3:return IFe.nes41Miniv3SystemPrompt;case Bo.PromptingStrategy.CopilotNesXtab:case void 0:return IFe.systemPromptTemplate;default:(0,Vie.assertNever)(t)}}a(H$i,"pickSystemPrompt");function G$i(t,{enabled:e,enabledLanguages:r,maxTokens:n,enableAllContextProviders:o,traitPosition:s}){return t in r?{enabled:r[t],maxTokens:n,traitPosition:s}:o?{enabled:!0,maxTokens:n,traitPosition:s}:{enabled:e,maxTokens:n,traitPosition:s}}a(G$i,"determineLanguageContextOptions");function $$i(t,e,r,n,o,s){if(o===Bo.ResponseFormat.UnifiedWithXml)return["",...r,""].join(` +`),{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1});h.trace(`Ran diff for #${V} with latency ${q.elapsed()} ms`);let Le=k.start+ie.lineRange.startLineNumber;for(let me of le.changes){let Oe=new sTt.LineReplacement(new L$i.LineRange(Le+me.original.startLineNumber-1,Le+me.original.endLineNumberExclusive-1),ie.newLines.slice(me.modified.startLineNumber-1,me.modified.endLineNumberExclusive-1));H.push(Oe)}}m.setResponse(B());for(let re of H){if(h.trace(`extracting edit #${V}: ${re.toString()}`),!z){z=!0;let le=this.determineArtificialDelayMs(c,h,g);if(le&&(await(0,uW.timeout)(le),h.trace(`Artificial delay of ${le} ms completed`),u.isCancellationRequested))return new zo.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:re,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},V++}}return Y?new zo.NoNextEditReason.GotCancelled(Q===lC.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new zo.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(U){return U instanceof B$i.FetchStreamError?U.reason:(m.setError(U),new zo.NoNextEditReason.Unexpected(dW.ErrorUtils.fromUnknown(U)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new zo.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof fW.Retrying)return m;if(K3r(e))return l.trace("Skipping cursor prediction: user typed during request"),new zo.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,o,s);if(s.isCancellationRequested)return new zo.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(K3r(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new zo.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetchUserTyped");if(A.isError())return l.trace(`Predicted next cursor line error: ${A.err.message}`),u.setNextCursorLineError(A.err.message),m;let y=A.val;if(y.kind==="differentFile")return yield*this.handleCrossFilePrediction(y,g,e,r,n,o,s);let _=y.lineNumber,E=_-h.currentDocument.cursorLineOffset;if(u.setNextCursorLineDistance(E),u.setNextCursorIsCrossFile(!1),l.trace(`Predicted next cursor line: ${_}`),_>=h.currentDocument.lines.length)return l.trace("Predicted next cursor line error: exceedsDocumentLines"),u.setNextCursorLineError("exceedsDocumentLines"),m;if(h.editWindowLinesRange.contains(_))return l.trace("Predicted next cursor line error: withinEditWindow"),u.setNextCursorLineError("withinEditWindow"),m;let v=_+1,S=h.activeDoc.documentAfterEditsLines.at(_),T=$N.getNextCursorColumn(S);switch(g){case iTt.NextCursorLinePrediction.Jump:{let w=new z3r.Position(v,T);return new zo.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case iTt.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new aTt.Range(v,T,v,T),n,o,s,new fW.Retrying("cursorJump"),d);default:(0,Wie.assertNever)(g)}}async*handleCrossFilePrediction(e,r,n,o,s,c,l){let{tracer:u,telemetry:d}=c,{editWindowInfo:{editWindow:f},promptPieces:h}=o,m=h.activeDoc.workspaceRoot;if(!m&&!(0,M$i.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new zo.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,M$i.isAbsolute)(e.filePath)?O$i.URI.file(e.filePath):O$i.URI.joinPath(m,e.filePath),A=QNc.DocumentId.create(g.toString()),y=e.lineNumber+1,_=new z3r.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case iTt.NextCursorLinePrediction.Jump:return new zo.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,_,A);case iTt.NextCursorLinePrediction.OnlyWithEdit:{let E;try{E=await this.workspaceService.openTextDocument(g)}catch(R){return u.trace(`Failed to open target file for cross-file edit: ${dW.ErrorUtils.fromUnknown(R).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new zo.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,_,A)}if(l.isCancellationRequested)return new zo.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(K3r(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new zo.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new tMc.StringText(E.getText()),S=v.getLines();if(e.lineNumber>=S.length)return u.trace("Predicted cross-file cursor jump error: exceedsDocumentLines"),d.setNextCursorLineError("crossFile:exceedsDocumentLines"),new zo.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let T=new zo.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,HNc.LanguageId.create(E.languageId),S,sTt.LineEdit.empty,v,new qNc.Edits(eMc.StringEdit,[])),w=new zo.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[T],0,n.xtabEditHistory,new uW.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(w,new aTt.Range(y,1,y,1),s,c,l,new fW.Retrying("cursorJump"),f)}default:(0,Wie.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderUseVaryingLinesAbove,this.expService)){l=0;for(let g=0;g<8;++g){let A=c-g;if(A<0)break;if(s[A].trim()!==""){l=g;break}}}else l=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??$U.N_LINES_ABOVE;let u;if(r.expandedEditWindowNLines!==void 0)n.trace(`Using expanded nLinesBelow: ${r.expandedEditWindowNLines}`),u=r.expandedEditWindowNLines;else{let m=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${$U.N_LINES_BELOW}`),u=$U.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new J3r.OffsetRange(d,f),g=(0,Y3r.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabOnlyMergeConflictLines,this.expService);o.setMergeConflictExpanded(A?"only":"normal"),A?(n.trace(`Expanding edit window to include ONLY merge conflict markers: ${g.toString()}`),d=g.start,f=g.endExclusive):(n.trace(`Expanding edit window to include merge conflict markers: ${g.toString()}; edit window range [${d}, ${f})`),f=Math.max(f,g.endExclusive))}}return new J3r.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...Bo.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:eFr(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove,this.expService)},languageContext:V$i(e.languageId,{enabled:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(li.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(li.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(li.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.getGlobalBudget()},n=this.modelService.selectedModelConfiguration(),o=Bo.applyStrategyConfig(n);return{promptOptions:eFr(r,o),modelServiceConfig:o}}getGlobalBudget(){let e=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudget,this.expService);if(!e)return;let r=Bo.GlobalBudgetOptions.fromConfigString(e);if(r.isError()){this._telemetryService.sendMSFTTelemetryEvent("incorrectNesGlobalBudgetConfig",{errorMessage:r.err,configValue:e});return}return r.val}getEndpointWithLogging(e,r,n){let o=this.getEndpoint(e);return r.setEndpointInfo(typeof o.urlOrRequestMetadata=="string"?o.urlOrRequestMetadata:JSON.stringify(o.urlOrRequestMetadata.type),o.model),n.setModelName(o.model),o}getEndpoint(e){let r=this.configService.getConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance(pMc.XtabEndpoint,r,n,e):(0,FNc.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n,o,s){if(!this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService))return;let l=s===Bo.ResponseFormat.CustomDiffPatch?this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchModelPredictionKind,this.expService):Bo.PatchModelPrediction.FilePath;return{type:"content",content:W$i(e,r,n,o,s,l)}}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof fW.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,uW.timeout)(c,s)}catch{}}determineArtificialDelayMs(e,r,n){if(this.simulationCtx.isInSimulationTests)return;let o=e.getArtificialDelay();if(!(o<=0))return r.trace(`Enforcing artificial delay of ${o} ms`),n.setArtificialDelay(o),o}filterEdit(e,r,n){let o=[l=>({filterName:"IgnoreImportChangesAspect",filteredEdits:aMc.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:oTt.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(li.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:oTt.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=oTt.editWouldDeleteWhatWasJustInserted;break;case"v2":l=oTt.editWouldDeleteWhatWasJustInserted2;break;default:(0,Wie.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new sTt.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(li.ConfigKey.TeamInternal.InlineEditsFilterOutEditsWithSubstrings,this.expService);if(c){let l=c.split(",").map(u=>u.trim()).filter(u=>u.length>0);o.push(u=>({filterName:"FilterOutEditsWithSubstrings",filteredEdits:H$i(u,l)}))}return o.reduce(([l,u],d)=>{let f=d(l);return f.filteredEdits.length===l.length?[l,u]:[f.filteredEdits,[...u,f.filterName]]},[r,[]])}static getNextCursorColumn(e){return(e?.match(/^(\s*)/)?.at(1)?.length??0)+1}};Qp.XtabProvider=Z3r;Qp.XtabProvider=Z3r=$N=MNc([xk(0,GNc.IInlineEditsModelService),xk(1,VNc.ISimulationTestContext),xk(2,nMc.IInstantiationService),xk(3,YNc.IWorkspaceService),xk(4,BNc.IDiffService),xk(5,li.IConfigurationService),xk(6,WNc.IExperimentationService),xk(7,q$i.ILanguageContextProviderService),xk(8,$Nc.ILanguageDiagnosticsService),xk(9,UNc.IIgnoreService),xk(10,uMc.ISimilarFilesContextService),xk(11,zNc.ITelemetryService)],Z3r);function H$i(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(H$i,"filterOutEditsWithSubstrings");function G$i(t){let e=t.cursorLineOffset,r=Math.max(0,e-$U.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+$U.N_LINES_AS_CONTEXT+1);return new J3r.OffsetRange(r,n)}a(G$i,"computeAreaAroundEditWindowLinesRange");function X3r(t){switch(t.type){case Vf.ChatFetchResponseType.Canceled:return new zo.NoNextEditReason.GotCancelled("afterFetchCall");case Vf.ChatFetchResponseType.OffTopic:case Vf.ChatFetchResponseType.Filtered:case Vf.ChatFetchResponseType.PromptFiltered:case Vf.ChatFetchResponseType.Length:case Vf.ChatFetchResponseType.RateLimited:case Vf.ChatFetchResponseType.QuotaExceeded:case Vf.ChatFetchResponseType.ExtensionBlocked:case Vf.ChatFetchResponseType.AgentUnauthorized:case Vf.ChatFetchResponseType.AgentFailedDependency:case Vf.ChatFetchResponseType.InvalidStatefulMarker:return new zo.NoNextEditReason.Uncategorized(dW.ErrorUtils.fromUnknown(t));case Vf.ChatFetchResponseType.BadRequest:case Vf.ChatFetchResponseType.NotFound:case Vf.ChatFetchResponseType.Failed:case Vf.ChatFetchResponseType.NetworkError:case Vf.ChatFetchResponseType.Unknown:return new zo.NoNextEditReason.FetchFailure(dW.ErrorUtils.fromUnknown(t))}}a(X3r,"mapChatFetcherErrorToNoNextEditReason");function eFr(t,e){return{...t,modelName:e.modelName,promptingStrategy:e.promptingStrategy,includePostScript:e.includePostScript??t.includePostScript,currentFile:{...t.currentFile,...e.currentFile,includeTags:e.includeTagsInCurrentFile},recentlyViewedDocuments:{...t.recentlyViewedDocuments,...e.recentlyViewedDocuments},lintOptions:e.lintOptions?AMc(t.lintOptions,e.lintOptions):t.lintOptions}}a(eFr,"overrideModelConfig");var gMc={...Bo.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function AMc(t,e){return{...t??gMc,...e}}a(AMc,"mergeLintOptions");function $$i(t){switch(t){case Bo.PromptingStrategy.UnifiedModel:return IFe.unifiedModelSystemPrompt;case Bo.PromptingStrategy.Codexv21NesUnified:case Bo.PromptingStrategy.SimplifiedSystemPrompt:return IFe.simplifiedPrompt;case Bo.PromptingStrategy.PatchBased:case Bo.PromptingStrategy.PatchBased01:case Bo.PromptingStrategy.PatchBased02:case Bo.PromptingStrategy.PatchBased02WithRecentLineNumbers:case Bo.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case Bo.PromptingStrategy.Xtab275:case Bo.PromptingStrategy.XtabAggressiveness:case Bo.PromptingStrategy.Xtab275Aggressiveness:case Bo.PromptingStrategy.Xtab275AggressivenessHighLow:case Bo.PromptingStrategy.Xtab275EditIntent:case Bo.PromptingStrategy.Xtab275EditIntentShort:return IFe.xtab275SystemPrompt;case Bo.PromptingStrategy.Nes41Miniv3:return IFe.nes41Miniv3SystemPrompt;case Bo.PromptingStrategy.CopilotNesXtab:case void 0:return IFe.systemPromptTemplate;default:(0,Wie.assertNever)(t)}}a($$i,"pickSystemPrompt");function V$i(t,{enabled:e,enabledLanguages:r,maxTokens:n,enableAllContextProviders:o,traitPosition:s}){return t in r?{enabled:r[t],maxTokens:n,traitPosition:s}:o?{enabled:!0,maxTokens:n,traitPosition:s}:{enabled:e,maxTokens:n,traitPosition:s}}a(V$i,"determineLanguageContextOptions");function W$i(t,e,r,n,o,s){if(o===Bo.ResponseFormat.UnifiedWithXml)return["",...r,""].join(` `);if(o===Bo.ResponseFormat.EditWindowOnly)return r.join(` `);if(o===Bo.ResponseFormat.EditWindowWithEditIntent)return["<|edit_intent|>high<|/edit_intent|>",...r].join(` `);if(o===Bo.ResponseFormat.EditWindowWithEditIntentShort)return["H",...r].join(` `);if(o===Bo.ResponseFormat.CodeBlock)return["```",...r,"```"].join(` -`);if(o===Bo.ResponseFormat.CustomDiffPatch){let c=t.workspaceRoot?.path,l=(0,Q$i.toUniquePath)(t.id,c);if(s===Bo.PatchModelPrediction.FilePath)return`${l}:`;let u=r[n];if(u===void 0)return`${l}:`;let d=`${l}:${e}`;switch(s){case Bo.PatchModelPrediction.CurrentLine:return[d,`-${u}`].join(` +`);if(o===Bo.ResponseFormat.CustomDiffPatch){let c=t.workspaceRoot?.path,l=(0,j$i.toUniquePath)(t.id,c);if(s===Bo.PatchModelPrediction.FilePath)return`${l}:`;let u=r[n];if(u===void 0)return`${l}:`;let d=`${l}:${e}`;switch(s){case Bo.PatchModelPrediction.CurrentLine:return[d,`-${u}`].join(` `);case Bo.PatchModelPrediction.CurrentLineReplaced:return[d,`-${u}`,"+"].join(` `);case Bo.PatchModelPrediction.CurrentLineCompleted:return[d,`-${u}`,`+${u}`].join(` -`);default:(0,Vie.assertNever)(s)}}else(0,Vie.assertNever)(o)}a($$i,"getPredictionContents");async function*gMc(t,e,r,n,o,s,{tracer:c},l,u){let d=r.intermediateUserEdit;if(!d||d.isEmpty()){yield*t;return}let f=r.documentBeforeEdits.getTransformer(),h=d.apply(f.text),m=new eMc.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(_=>{if(_>=o.length)return!1;switch(u){case lC.EarlyDivergenceCancellationMode.Cursor:return _===e;case lC.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let _ of t){if(A(y)){let E=n.start+y,v=(0,B$i.getCurrentLine)(f,E,d,g);if(v!==void 0){let S=o[y];if(v!==S&&!(0,B$i.isModelLineCompatible)(S,v,_)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${_}" current="${v}"`),s.cancel();return}}}yield _,y++}}a(gMc,"linesWithIntermediateEditDivergenceCheck")});var W$i=I(dB=>{"use strict";p();var AMc=dB&&dB.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},aTt=dB&&dB.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(dB,"__esModule",{value:!0});dB.StaticGitHubAuthenticationService=void 0;dB.setCopilotToken=CMc;var yMc=Hl(),_Mc=Np(),cTt=rE(),EMc=aLe(),vMc=zG(),lTt=class extends cTt.BaseAuthenticationService{static{a(this,"StaticGitHubAuthenticationService")}constructor(e,r,n,o,s){super(r,n,o,s),this.tokenProvider=e;let c=this;this._anyGitHubSession=e?{get id(){return c.tokenProvider()},get accessToken(){return c.tokenProvider()},scopes:cTt.GITHUB_SCOPE_USER_EMAIL,account:{id:"user",label:"User"}}:void 0,this._permissiveGitHubSession=e?{get id(){return c.tokenProvider()},get accessToken(){return c.tokenProvider()},scopes:cTt.GITHUB_SCOPE_ALIGNED,account:{id:"user",label:"User"}}:void 0}get hasCopilotTokenSource(){return!0}async getGitHubSession(e,r){if(e==="permissive"){if(this.isMinimalMode){if(r.createIfNone||r.forceNewSession)throw new cTt.MinimalModeError;return}return this._permissiveGitHubSession}else return this._anyGitHubSession}async getCopilotToken(e){return await super.getCopilotToken(e)}setCopilotToken(e){this._tokenStore.copilotToken=e,this.fireCopilotTokenChange("setCopilotToken")}getAnyAdoSession(e){return Promise.resolve(void 0)}getAdoAccessTokenBase64(e){return Promise.resolve(void 0)}};dB.StaticGitHubAuthenticationService=lTt;dB.StaticGitHubAuthenticationService=lTt=AMc([aTt(1,_Mc.ILogService),aTt(2,vMc.ICopilotTokenStore),aTt(3,EMc.ICopilotTokenManager),aTt(4,yMc.IConfigurationService)],lTt);function CMc(t,e){if(!(t instanceof lTt))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(CMc,"setCopilotToken")});var Z$i=I(uC=>{"use strict";p();Object.defineProperty(uC,"__esModule",{value:!0});uC.GraphQLErrorType=void 0;uC.getErrorCode=K$i;uC.derivePullRequestState=bMc;uC.makeGitHubAPIRequest=J$i;uC.makeGitHubGraphQLRequest=REe;uC.makeSearchGraphQLRequest=SMc;uC.getPullRequestFromGlobalId=TMc;uC.addPullRequestCommentGraphQLRequest=IMc;uC.closePullRequest=xMc;uC.makeGitHubAPIRequestWithPagination=wMc;uC.getAssignableActorsWithSuggestedActors=RMc;uC.getAssignableActorsWithAssignableUsers=kMc;function z$i(t){return typeof t=="object"&&t!==null}a(z$i,"isObject");var Y$i;(function(t){t.Unprocessable="UNPROCESSABLE"})(Y$i||(uC.GraphQLErrorType=Y$i={}));function K$i(t){if(!z$i(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(z$i(e)&&e.statusCode!==void 0)return String(e.statusCode);let r=t.graphQLErrors;if(Array.isArray(r)&&r.length>0){let n=r[0];if(n){if(n.extensions?.code!==void 0)return String(n.extensions.code);if(n.type!==void 0)return String(n.type)}}if(t.code!==void 0)return String(t.code);if(typeof t.name=="string"&&t.name)return t.name}a(K$i,"getErrorCode");function bMc(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(bMc,"derivePullRequestState");async function J$i(t,e,r,n,o,s,c,l){let{body:u,version:d,type:f="json",userAgent:h,accept:m,additionalHeaders:g,returnStatusCodeOnError:A=!1,silent404:y=!1,callSite:_="github-api-rest"}=l??{},E={Accept:m??"application/vnd.github+json",...g};c&&(E.Authorization=`Bearer ${c}`),d&&(E["X-GitHub-Api-Version"]=d),h&&(E["User-Agent"]=h);let v=await t.fetch(`${n}/${o}`,{method:s,headers:E,body:u?JSON.stringify(u):void 0,callSite:_});if(!v.ok)return y&&v.status===404||e.error(`[GitHubAPI] ${s} ${n}/${o} - Status: ${v?.status}`),A?{status:v.status}:void 0;try{let S=f==="json"?await v.json():await v.text(),T=Number(v.headers.get("x-ratelimit-remaining")),w=`[RateLimit] REST rate limit remaining: ${T}, ${o}`;return T<1e3?(e.warn(w),r.sendMSFTTelemetryEvent("githubAPI.approachingRateLimit",{rateLimit:T.toString()})):e.debug(w),S}catch{return}}a(J$i,"makeGitHubAPIRequest");async function REe(t,e,r,n,o,s,c,l="github-api-graphql"){let u={Accept:"application/vnd.github+json","Content-Type":"application/json"};s&&(u.Authorization=`Bearer ${s}`);let d=JSON.stringify({query:o,variables:c}),f=await t.fetch(`${n}/graphql`,{method:"POST",headers:u,body:d,callSite:l});if(!f.ok){e.debug(`[GitHubAPI] GraphQL request to ${n}/graphql failed with status ${f.status}`);return}try{let h=await f.json(),m=Number(f.headers.get("x-ratelimit-remaining")),g=`[RateLimit] GraphQL rate limit remaining: ${m}, query: ${o}`;return m<1e3?(e.warn(g),r.sendMSFTTelemetryEvent("githubAPI.approachingRateLimit",{rateLimit:m.toString()})):e.debug(g),h}catch{return}}a(REe,"makeGitHubGraphQLRequest");async function SMc(t,e,r,n,o,s,c=20){let l=` +`);default:(0,Wie.assertNever)(s)}}else(0,Wie.assertNever)(o)}a(W$i,"getPredictionContents");async function*yMc(t,e,r,n,o,s,{tracer:c},l,u){let d=r.intermediateUserEdit;if(!d||d.isEmpty()){yield*t;return}let f=r.documentBeforeEdits.getTransformer(),h=d.apply(f.text),m=new rMc.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(_=>{if(_>=o.length)return!1;switch(u){case lC.EarlyDivergenceCancellationMode.Cursor:return _===e;case lC.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let _ of t){if(A(y)){let E=n.start+y,v=(0,U$i.getCurrentLine)(f,E,d,g);if(v!==void 0){let S=o[y];if(v!==S&&!(0,U$i.isModelLineCompatible)(S,v,_)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${_}" current="${v}"`),s.cancel();return}}}yield _,y++}}a(yMc,"linesWithIntermediateEditDivergenceCheck")});var Y$i=I(dB=>{"use strict";p();var _Mc=dB&&dB.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},cTt=dB&&dB.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(dB,"__esModule",{value:!0});dB.StaticGitHubAuthenticationService=void 0;dB.setCopilotToken=SMc;var EMc=Hl(),vMc=Np(),lTt=rE(),CMc=aLe(),bMc=YG(),uTt=class extends lTt.BaseAuthenticationService{static{a(this,"StaticGitHubAuthenticationService")}constructor(e,r,n,o,s){super(r,n,o,s),this.tokenProvider=e;let c=this;this._anyGitHubSession=e?{get id(){return c.tokenProvider()},get accessToken(){return c.tokenProvider()},scopes:lTt.GITHUB_SCOPE_USER_EMAIL,account:{id:"user",label:"User"}}:void 0,this._permissiveGitHubSession=e?{get id(){return c.tokenProvider()},get accessToken(){return c.tokenProvider()},scopes:lTt.GITHUB_SCOPE_ALIGNED,account:{id:"user",label:"User"}}:void 0}get hasCopilotTokenSource(){return!0}async getGitHubSession(e,r){if(e==="permissive"){if(this.isMinimalMode){if(r.createIfNone||r.forceNewSession)throw new lTt.MinimalModeError;return}return this._permissiveGitHubSession}else return this._anyGitHubSession}async getCopilotToken(e){return await super.getCopilotToken(e)}setCopilotToken(e){this._tokenStore.copilotToken=e,this.fireCopilotTokenChange("setCopilotToken")}getAnyAdoSession(e){return Promise.resolve(void 0)}getAdoAccessTokenBase64(e){return Promise.resolve(void 0)}};dB.StaticGitHubAuthenticationService=uTt;dB.StaticGitHubAuthenticationService=uTt=_Mc([cTt(1,vMc.ILogService),cTt(2,bMc.ICopilotTokenStore),cTt(3,CMc.ICopilotTokenManager),cTt(4,EMc.IConfigurationService)],uTt);function SMc(t,e){if(!(t instanceof uTt))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(SMc,"setCopilotToken")});var eVi=I(uC=>{"use strict";p();Object.defineProperty(uC,"__esModule",{value:!0});uC.GraphQLErrorType=void 0;uC.getErrorCode=Z$i;uC.derivePullRequestState=TMc;uC.makeGitHubAPIRequest=X$i;uC.makeGitHubGraphQLRequest=REe;uC.makeSearchGraphQLRequest=IMc;uC.getPullRequestFromGlobalId=xMc;uC.addPullRequestCommentGraphQLRequest=wMc;uC.closePullRequest=RMc;uC.makeGitHubAPIRequestWithPagination=kMc;uC.getAssignableActorsWithSuggestedActors=PMc;uC.getAssignableActorsWithAssignableUsers=DMc;function K$i(t){return typeof t=="object"&&t!==null}a(K$i,"isObject");var J$i;(function(t){t.Unprocessable="UNPROCESSABLE"})(J$i||(uC.GraphQLErrorType=J$i={}));function Z$i(t){if(!K$i(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(K$i(e)&&e.statusCode!==void 0)return String(e.statusCode);let r=t.graphQLErrors;if(Array.isArray(r)&&r.length>0){let n=r[0];if(n){if(n.extensions?.code!==void 0)return String(n.extensions.code);if(n.type!==void 0)return String(n.type)}}if(t.code!==void 0)return String(t.code);if(typeof t.name=="string"&&t.name)return t.name}a(Z$i,"getErrorCode");function TMc(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(TMc,"derivePullRequestState");async function X$i(t,e,r,n,o,s,c,l){let{body:u,version:d,type:f="json",userAgent:h,accept:m,additionalHeaders:g,returnStatusCodeOnError:A=!1,silent404:y=!1,callSite:_="github-api-rest"}=l??{},E={Accept:m??"application/vnd.github+json",...g};c&&(E.Authorization=`Bearer ${c}`),d&&(E["X-GitHub-Api-Version"]=d),h&&(E["User-Agent"]=h);let v=await t.fetch(`${n}/${o}`,{method:s,headers:E,body:u?JSON.stringify(u):void 0,callSite:_});if(!v.ok)return y&&v.status===404||e.error(`[GitHubAPI] ${s} ${n}/${o} - Status: ${v?.status}`),A?{status:v.status}:void 0;try{let S=f==="json"?await v.json():await v.text(),T=Number(v.headers.get("x-ratelimit-remaining")),w=`[RateLimit] REST rate limit remaining: ${T}, ${o}`;return T<1e3?(e.warn(w),r.sendMSFTTelemetryEvent("githubAPI.approachingRateLimit",{rateLimit:T.toString()})):e.debug(w),S}catch{return}}a(X$i,"makeGitHubAPIRequest");async function REe(t,e,r,n,o,s,c,l="github-api-graphql"){let u={Accept:"application/vnd.github+json","Content-Type":"application/json"};s&&(u.Authorization=`Bearer ${s}`);let d=JSON.stringify({query:o,variables:c}),f=await t.fetch(`${n}/graphql`,{method:"POST",headers:u,body:d,callSite:l});if(!f.ok){e.debug(`[GitHubAPI] GraphQL request to ${n}/graphql failed with status ${f.status}`);return}try{let h=await f.json(),m=Number(f.headers.get("x-ratelimit-remaining")),g=`[RateLimit] GraphQL rate limit remaining: ${m}, query: ${o}`;return m<1e3?(e.warn(g),r.sendMSFTTelemetryEvent("githubAPI.approachingRateLimit",{rateLimit:m.toString()})):e.debug(g),h}catch{return}}a(REe,"makeGitHubGraphQLRequest");async function IMc(t,e,r,n,o,s,c=20){let l=` query FetchCopilotAgentPullRequests($searchQuery: String!, $first: Int!, $after: String) { search(query: $searchQuery, type: ISSUE, first: $first, after: $after) { nodes { @@ -1376,7 +1376,7 @@ Your task is to predict and complete the changes the developer would have made n issueCount } } - `;e.debug(`[FolderRepositoryManager+0] Fetch pull request category ${s}`);let d=await REe(t,e,r,n,l,o,{searchQuery:s,first:c},"github-graphql-search-prs"),f=d?.data?.search?.nodes??[];return e.debug(`[GitHubAPI] FetchCopilotAgentPullRequests: host=${n}, searchQuery=${s}, resultCount=${f.length}, errors=${JSON.stringify(d?.errors)}`),f}a(SMc,"makeSearchGraphQLRequest");async function TMc(t,e,r,n,o,s){let c=` + `;e.debug(`[FolderRepositoryManager+0] Fetch pull request category ${s}`);let d=await REe(t,e,r,n,l,o,{searchQuery:s,first:c},"github-graphql-search-prs"),f=d?.data?.search?.nodes??[];return e.debug(`[GitHubAPI] FetchCopilotAgentPullRequests: host=${n}, searchQuery=${s}, resultCount=${f.length}, errors=${JSON.stringify(d?.errors)}`),f}a(IMc,"makeSearchGraphQLRequest");async function xMc(t,e,r,n,o,s){let c=` query GetPullRequestGlobal($globalId: ID!) { node(id: $globalId) { ... on PullRequest { @@ -1411,7 +1411,7 @@ Your task is to predict and complete the changes the developer would have made n } } } - `;e.debug(`[GitHubAPI] Fetch pull request by global ID ${s}`);let u=await REe(t,e,r,n,c,o,{globalId:s},"github-graphql-get-pr-by-id"),d=u?.data?.node;if(e.debug(`[GitHubAPI] GetPullRequestGlobal: host=${n}, globalId=${s}, found=${!!d}, prNumber=${d?.number}, errors=${JSON.stringify(u?.errors)}`),!d){let f={requestFailed:String(u===void 0)},h=K$i(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(TMc,"getPullRequestFromGlobalId");async function IMc(t,e,r,n,o,s,c){let l=` + `;e.debug(`[GitHubAPI] Fetch pull request by global ID ${s}`);let u=await REe(t,e,r,n,c,o,{globalId:s},"github-graphql-get-pr-by-id"),d=u?.data?.node;if(e.debug(`[GitHubAPI] GetPullRequestGlobal: host=${n}, globalId=${s}, found=${!!d}, prNumber=${d?.number}, errors=${JSON.stringify(u?.errors)}`),!d){let f={requestFailed:String(u===void 0)},h=Z$i(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(xMc,"getPullRequestFromGlobalId");async function wMc(t,e,r,n,o,s,c){let l=` mutation AddPullRequestComment($pullRequestId: ID!, $body: String!) { addComment(input: {subjectId: $pullRequestId, body: $body}) { commentEdge { @@ -1427,7 +1427,7 @@ Your task is to predict and complete the changes the developer would have made n } } } - `;return e.debug(`[GitHubAPI] Adding comment to pull request ${s}`),(await REe(t,e,r,n,l,o,{pullRequestId:s,body:c},"github-graphql-add-pr-comment"))?.data?.addComment?.commentEdge?.node||null}a(IMc,"addPullRequestCommentGraphQLRequest");async function xMc(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await J$i(t,e,r,n,`repos/${s}/${c}/pulls/${l}`,"POST",o,{body:{state:"closed"},version:"2022-11-28",callSite:"github-rest-close-pr"}),d=u?.state==="closed";return d?e.debug(`[GitHubAPI] Successfully closed pull request ${s}/${c}#${l}`):e.error(`[GitHubAPI] Failed to close pull request ${s}/${c}#${l}. Its state is ${u?.state}`),d}a(xMc,"closePullRequest");async function wMc(t,e,r,n,o,s){let c=!1,l=[],u=20,d=1;do{let f=await t.fetch(`${r}/${n}?page_size=${u}&page_number=${d}&resource_state=draft,open&repo_nwo=${o}`,{headers:{Authorization:`Bearer ${s}`,Accept:"application/json"},callSite:"github-api-sessions"});if(!f.ok)return e.error(`[GitHubAPI] Failed to fetch sessions: ${f.status} ${f.statusText}`),l;let h=await f.json();l.push(...h.sessions),c=h.sessions.length===u,d++}while(c);return l}a(wMc,"makeGitHubAPIRequestWithPagination");async function RMc(t,e,r,n,o,s,c){let l=` + `;return e.debug(`[GitHubAPI] Adding comment to pull request ${s}`),(await REe(t,e,r,n,l,o,{pullRequestId:s,body:c},"github-graphql-add-pr-comment"))?.data?.addComment?.commentEdge?.node||null}a(wMc,"addPullRequestCommentGraphQLRequest");async function RMc(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await X$i(t,e,r,n,`repos/${s}/${c}/pulls/${l}`,"POST",o,{body:{state:"closed"},version:"2022-11-28",callSite:"github-rest-close-pr"}),d=u?.state==="closed";return d?e.debug(`[GitHubAPI] Successfully closed pull request ${s}/${c}#${l}`):e.error(`[GitHubAPI] Failed to close pull request ${s}/${c}#${l}. Its state is ${u?.state}`),d}a(RMc,"closePullRequest");async function kMc(t,e,r,n,o,s){let c=!1,l=[],u=20,d=1;do{let f=await t.fetch(`${r}/${n}?page_size=${u}&page_number=${d}&resource_state=draft,open&repo_nwo=${o}`,{headers:{Authorization:`Bearer ${s}`,Accept:"application/json"},callSite:"github-api-sessions"});if(!f.ok)return e.error(`[GitHubAPI] Failed to fetch sessions: ${f.status} ${f.statusText}`),l;let h=await f.json();l.push(...h.sessions),c=h.sessions.length===u,d++}while(c);return l}a(kMc,"makeGitHubAPIRequestWithPagination");async function PMc(t,e,r,n,o,s,c){let l=` query GetSuggestedActors($owner: String!, $name: String!, $first: Int!, $after: String) { repository(owner: $owner, name: $name) { suggestedActors( @@ -1448,7 +1448,7 @@ Your task is to predict and complete the changes the developer would have made n } } } - `,u=[],d=null,f=!0;for(;f;){let m=await REe(t,e,r,n,l,o,{owner:s,name:c,first:100,after:d},"github-graphql-suggested-actors");if(!m?.data?.repository?.suggestedActors)break;let g=m.data.repository.suggestedActors;u.push(...g.nodes),f=g.pageInfo.hasNextPage,d=g.pageInfo.endCursor}return u}a(RMc,"getAssignableActorsWithSuggestedActors");async function kMc(t,e,r,n,o,s,c){let l=` + `,u=[],d=null,f=!0;for(;f;){let m=await REe(t,e,r,n,l,o,{owner:s,name:c,first:100,after:d},"github-graphql-suggested-actors");if(!m?.data?.repository?.suggestedActors)break;let g=m.data.repository.suggestedActors;u.push(...g.nodes),f=g.pageInfo.hasNextPage,d=g.pageInfo.endCursor}return u}a(PMc,"getAssignableActorsWithSuggestedActors");async function DMc(t,e,r,n,o,s,c){let l=` query GetAssignableUsers($owner: String!, $name: String!, $first: Int!, $after: String) { repository(owner: $owner, name: $name) { assignableUsers(first: $first, after: $after) { @@ -1465,27 +1465,27 @@ Your task is to predict and complete the changes the developer would have made n } } } - `,u=[],d=null,f=!0;for(;f;){let m=await REe(t,e,r,n,l,o,{owner:s,name:c,first:100,after:d},"github-graphql-assignable-users");if(!m?.data?.repository?.assignableUsers)break;let g=m.data.repository.assignableUsers;u.push(...g.nodes),f=g.pageInfo.hasNextPage,d=g.pageInfo.endCursor}return u}a(kMc,"getAssignableActorsWithAssignableUsers")});var tVi=I(Rk=>{"use strict";p();Object.defineProperty(Rk,"__esModule",{value:!0});Rk.BaseOctoKitService=Rk.PermissiveAuthRequiredError=Rk.VSCodeTeamId=Rk.IOctoKitService=Rk.IGithubRepositoryService=void 0;var eVi=an(),X$i=J$(),VN=Z$i();Rk.IGithubRepositoryService=(0,eVi.createServiceIdentifier)("IGithubRepositoryService");Rk.IOctoKitService=(0,eVi.createServiceIdentifier)("IOctoKitService");Rk.VSCodeTeamId=1682102;var eFr=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};Rk.PermissiveAuthRequiredError=eFr;var tFr=class t{static{a(this,"BaseOctoKitService")}static{this._outageStatusCacheTTL=300*1e3}static{this._userReposScopeCacheTTL=300*1e3}constructor(e,r,n,o){this._capiClientService=e,this._fetcherService=r,this._logService=n,this._telemetryService=o}async getCurrentAuthedUserWithToken(e){return this._makeGHAPIRequest("user","GET",e,void 0,void 0,"github-rest-get-user")}async getGitHubOutageStatus(){let e=Date.now();if(this._cachedOutageStatus&&e-this._cachedOutageStatus.timestampl.headRefName===n)}async addPullRequestCommentWithToken(e,r,n){return(0,VN.addPullRequestCommentGraphQLRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,n,e,r)}async createPullRequestWithToken(e,r,n,o,s,c,l,u){let d=await this._makeGHAPIRequest(`repos/${e}/${r}/pulls`,"POST",u,{title:n,body:o,head:s,base:c,draft:l});if(!d?.html_url||typeof d.number!="number")throw new Error(`Failed to create pull request for ${e}/${r}`);return{url:d.html_url,number:d.number}}async getPullRequestFromSessionWithToken(e,r){return(0,VN.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,VN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repos/${e}/${r}/pulls/${n}/files`,"GET",o,{version:"2022-11-28",callSite:"github-rest-get-pr-files"})||[]}async compareCommitsWithToken(e,r,n,o,s){let c=`repos/${e}/${r}/compare/${n}...${o}`,l=await(0,VN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,c,"GET",s,{version:"2022-11-28",callSite:"github-rest-compare-commits"});if(!l)return;let u=l,d=u.merge_base_commit?.sha??u.base_commit?.sha??n,f=u.commits?.[u.commits.length-1]?.sha??o;return{baseSha:d,headSha:f,files:u.files??[]}}async getRepositoryByIdWithToken(e,r){let n=await(0,VN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repositories/${e}`,"GET",r,{version:"2022-11-28",callSite:"github-rest-get-repository-by-id"});if(!n)return;let o=n;if(o.owner?.login&&o.name)return{owner:o.owner.login,name:o.name};if(o.full_name){let[s,c]=o.full_name.split("/");if(s&&c)return{owner:s,name:c}}}async closePullRequestWithToken(e,r,n,o){return(0,VN.closePullRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,o,e,r,n)}async getFileContentWithToken(e,r,n,o,s){let c=`repos/${e}/${r}/contents/${o}?ref=${encodeURIComponent(n)}`,l=await(0,VN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,c,"GET",s,{callSite:"github-rest-get-file-content"});if(!l||Array.isArray(l))throw new Error("Unable to fetch file content");let u=l;if(u.content&&u.encoding==="base64")return(0,X$i.decodeBase64)(u.content.replace(/\n/g,"")).toString();if(u.sha){let d=await this.getBlobContentWithToken(e,r,u.sha,s);if(d)return d}return this._logService.error(`Failed to get file content for ${e}/${r}/${o} at ref ${n}`),""}async getUserOrganizationsWithToken(e,r=100){let n=await this._makeGHAPIRequest(`user/orgs?per_page=${r}`,"GET",e,void 0,void 0,"github-rest-get-user-orgs");return!n||!Array.isArray(n)?[]:n.map(o=>o.login)}async isUserMemberOfOrgWithToken(e,r){try{let n=await this._makeGHAPIRequest(`user/memberships/orgs/${encodeURIComponent(e)}`,"GET",r,void 0,void 0,"github-rest-check-org-membership");return n&&(n.state==="active"||n.state==="pending")}catch{return!1}}async getOrganizationRepositoriesWithToken(e,r,n=100){let o=await this._makeGHAPIRequest(`orgs/${e}/repos?per_page=${n}&sort=updated`,"GET",r,void 0,{silent404:!0},"github-rest-get-org-repos");return!o||!Array.isArray(o)||o.length===0?[]:o.map(s=>s.name)}async getUserRepositoriesWithToken(e,r){let n=r?.trim();if(n)return this.searchUserRepositoriesWithToken(e,n);let o=await this._makeGHAPIRequest("user/repos?per_page=100&sort=updated&affiliation=owner,collaborator,organization_member","GET",e,void 0,void 0,"github-rest-get-user-repos");return!o||!Array.isArray(o)?[]:o.filter(s=>s.permissions?.push).map(s=>({owner:s.owner.login,name:s.name}))}async searchUserRepositoriesWithToken(e,r){let n=await this._getUserReposSearchScope(e);if(!n)return[];let o=encodeURIComponent(`${r} in:name fork:true ${n}`),s=await this._makeGHAPIRequest(`search/repositories?q=${o}&sort=updated&per_page=100`,"GET",e,void 0,void 0,"github-rest-search-repos");return!s||!Array.isArray(s.items)?[]:s.items.filter(c=>c.permissions?.push).map(c=>({owner:c.owner.login,name:c.name}))}async _getUserReposSearchScope(e){let r=Date.now();if(this._cachedUserReposScope&&this._cachedUserReposScope.token===e&&r-this._cachedUserReposScope.timestamp{"use strict";p();Object.defineProperty(uTt,"__esModule",{value:!0});uTt.NullBaseOctoKitService=void 0;var PMc=tVi(),rFr=class extends PMc.BaseOctoKitService{static{a(this,"NullBaseOctoKitService")}async getGitHubOutageStatus(){return 0}async getCurrentAuthedUser(){}async getCurrentAuthedUserWithToken(e){return{id:0,avatar_url:"",login:"NullUser",name:"Null User"}}async _makeGHAPIRequest(e,r,n,o,s,c){}};uTt.NullBaseOctoKitService=rFr});var sVi=I(Yl=>{"use strict";p();var ATt=Yl&&Yl.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},$u=Yl&&Yl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Yl,"__esModule",{value:!0});Yl.CopilotTokenManagerFromGitHubToken=Yl.CopilotTokenManagerFromDeviceId=Yl.RefreshableCopilotTokenManager=Yl.StaticExtendedTokenInfoCopilotTokenManager=Yl.FixedCopilotTokenManager=Yl.BaseCopilotTokenManager=Yl.tokenErrorString=void 0;Yl.createStaticGitHubTokenProvider=NMc;Yl.getOrCreateTestingCopilotTokenManager=MMc;var nFr=(yie(),Wa(Aie)),DMc=Fc(),nVi=Po(),dTt=umt(),oVi=Hl(),yTt=lE(),_Tt=VV(),PEe=FD(),ETt=rVi(),vTt=Np(),wFe=Oy(),CTt=bh(),iVi=J_e(),VU=Yyt(),fTt=aLe();Yl.tokenErrorString='Tests: either GITHUB_PAT, GITHUB_OAUTH_TOKEN, or GITHUB_OAUTH_TOKEN+VSCODE_COPILOT_CHAT_TOKEN must be set unless running from an IS_SCENARIO_AUTOMATION environment. Run "npm run get_token" to get credentials.';function NMc(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!(PEe.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Yl.tokenErrorString)}}a(NMc,"createStaticGitHubTokenProvider");function MMc(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new dTt.SyncDescriptor(hTt,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new dTt.SyncDescriptor(gTt,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new dTt.SyncDescriptor(pTt,[process.env.GITHUB_PAT]);if(PEe.isScenarioAutomation)return new dTt.SyncDescriptor(mTt,[t]);throw new Error(Yl.tokenErrorString)}a(MMc,"getOrCreateTestingCopilotTokenManager");var kEe=class extends nVi.Disposable{static{a(this,"BaseCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(),this._baseOctokitservice=e,this._logService=r,this._telemetryService=n,this._domainService=o,this._capiClientService=s,this._fetcherService=c,this._envService=l,this._isDisposed=!1,this._copilotTokenRefreshEmitter=this._register(new DMc.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,nVi.toDisposable)(()=>this._isDisposed=!0))}get copilotToken(){return this._copilotToken}set copilotToken(e){e!==this._copilotToken&&(this._copilotToken=e,this._copilotTokenRefreshEmitter.fire())}resetCopilotToken(e){e!==void 0&&this._telemetryService.sendGHTelemetryEvent("auth.reset_token_"+e),this._logService.debug(`Resetting copilot token on HTTP error ${e||"unknown"}`),this.copilotToken=void 0}async authFromGitHubToken(e,r){return this.doAuthFromGitHubTokenOrDevDeviceId({githubToken:e,ghUsername:r})}async authFromDevDeviceId(e){return this.doAuthFromGitHubTokenOrDevDeviceId({devDeviceId:e})}async doAuthFromGitHubTokenOrDevDeviceId(e){this._telemetryService.sendGHTelemetryEvent("auth.new_login");let r,n,o;try{"githubToken"in e?(o=e.ghUsername,[r,n]=await Promise.all([this.fetchCopilotTokenFromGitHubToken(e.githubToken),this.fetchCopilotUserInfo(e.githubToken)])):r=await this.fetchCopilotTokenFromDevDeviceId(e.devDeviceId)}catch(f){return this._logService.warn("Failed to get copilot token due to fetch throwing: "+(f.message||String(f))),{kind:"failure",reason:"RequestFailed",message:f.message||String(f)}}if(!r.ok){this._logService.warn(`Failed to get copilot token due to status ${r.status} ${r.statusText}`);let f=iVi.TelemetryData.createAndMarkAsIssued({status:r.status.toString(),status_text:r.statusText});if(this._telemetryService.sendGHTelemetryErrorEvent("auth.invalid_token",f.properties,f.measurements),r.status===401)return this._logService.warn("Failed to get copilot token due to 401 status"),this._telemetryService.sendGHTelemetryErrorEvent("auth.unknown_401"),{kind:"failure",reason:"HTTP401"}}if(r.kind==="error-envelope")return this._logService.warn(`Failed to get copilot token due to: ${r.body.error_details.message}`),this._telemetryService.sendGHTelemetryErrorEvent("auth.request_read_failed"),{kind:"failure",reason:"NotAuthorized",...r.body.error_details};if(r.kind==="error")return r.body.message?.startsWith("API rate limit exceeded")?(this._logService.warn("Failed to get copilot token due to exceeding API rate limit"),this._telemetryService.sendGHTelemetryErrorEvent("auth.rate_limited"),{kind:"failure",reason:"RateLimited"}):(this._logService.warn(`Failed to get copilot token due to: ${r.body.message}`),{kind:"failure",reason:"NotAuthorized"});if(r.kind==="parse-failed")return this._logService.warn(`Failed to get copilot token due to: ${r.parseError}`),this._telemetryService.sendGHTelemetryErrorEvent("auth.request_read_failed"),{kind:"failure",reason:"ParseFailed",message:r.parseError};let s=r.body,c=s.expires_at;s.expires_at=(0,fTt.nowSeconds)()+s.refresh_in+60;let l=o??"unknown",u={...s,copilot_plan:n?.copilot_plan??s.sku??"",quota_snapshots:n?.quota_snapshots,quota_reset_date:n?.quota_reset_date,codex_agent_enabled:n?.codex_agent_enabled,token_based_billing:n?.token_based_billing,organization_login_list:n?.organization_login_list??[],username:l,isVscodeTeamMember:(0,VU.containsVSCodeOrg)(s.organization_list??[])},d=iVi.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,fTt.nowSeconds)()});return this._telemetryService.sendGHTelemetryEvent("auth.new_token",d.properties,d.measurements),{kind:"success",...u}}async fetchCopilotTokenFromGitHubToken(e){let r={callSite:"copilot-token-github",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},n=await this._capiClientService.makeRequest(r,{type:nFr.RequestType.CopilotToken});return this.parseTokenResponse(n)}async fetchCopilotTokenFromDevDeviceId(e){let r={callSite:"copilot-token-device",headers:{"X-GitHub-Api-Version":"2025-04-01","Editor-Device-Id":`${e}`},retryFallbacks:!0,expectJSON:!0},n=await this._capiClientService.makeRequest(r,{type:nFr.RequestType.CopilotNLToken});return this.parseTokenResponse(n)}async parseTokenResponse(e){let r={ok:e.ok,status:e.status,statusText:e.statusText},n;try{n=await(0,wFe.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,VU.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,VU.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,VU.isStandardErrorEnvelope)(n)?{...r,body:n,kind:"error"}:(this.sendTokenValidationTelemetry(o),{...r,body:void 0,kind:"parse-failed",parseError:"Response is not valid: "+JSON.stringify(n)})}sendTokenValidationTelemetry(e){e.strategy!=="strict"&&this._telemetryService.sendMSFTTelemetryEvent("copilotTokenFetching.validation",{strategy:e.strategy,strictError:e.strictError,fallbackError:e.fallbackError})}async fetchCopilotUserInfo(e){let r={callSite:"copilot-token-user-info",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0};return await(await this._capiClientService.makeRequest(r,{type:nFr.RequestType.CopilotUserInfo})).json()}};Yl.BaseCopilotTokenManager=kEe;var pTt=class extends kEe{static{a(this,"FixedCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new ETt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l),this._completionsToken=e,this.copilotToken=(0,VU.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,VU.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new VU.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Yl.FixedCopilotTokenManager=pTt;Yl.FixedCopilotTokenManager=pTt=ATt([$u(1,vTt.ILogService),$u(2,CTt.ITelemetryService),$u(3,yTt.ICAPIClientService),$u(4,_Tt.IDomainService),$u(5,wFe.IFetcherService),$u(6,PEe.IEnvService)],pTt);var hTt=class extends kEe{static{a(this,"StaticExtendedTokenInfoCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new ETt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l);let u=Buffer.from(e,"base64").toString("utf8");this._initialToken=JSON.parse(u)}async getCopilotToken(){return this.copilotToken||(this.copilotToken={...this._initialToken}),new VU.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Yl.StaticExtendedTokenInfoCopilotTokenManager=hTt;Yl.StaticExtendedTokenInfoCopilotTokenManager=hTt=ATt([$u(1,vTt.ILogService),$u(2,CTt.ITelemetryService),$u(3,yTt.ICAPIClientService),$u(4,_Tt.IDomainService),$u(5,wFe.IFetcherService),$u(6,PEe.IEnvService)],hTt);var xFe=class extends kEe{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,fTt.nowSeconds)()+300||e){let r=await this.authenticateAndGetToken();if(r.kind==="failure")throw Error(`Failed to get copilot token: ${r.reason.toString()} ${r.message??""}`);this.copilotToken={...r}}return new VU.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,fTt.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Yl.RefreshableCopilotTokenManager=xFe;var mTt=class extends xFe{static{a(this,"CopilotTokenManagerFromDeviceId")}constructor(e,r,n,o,s,c,l,u){super(new ETt.NullBaseOctoKitService(s,c,r,n),r,n,o,s,c,l),this.deviceId=e,this.configurationService=u}async authenticateAndGetToken(){return this.authFromDevDeviceId(this.deviceId)}};Yl.CopilotTokenManagerFromDeviceId=mTt;Yl.CopilotTokenManagerFromDeviceId=mTt=ATt([$u(1,vTt.ILogService),$u(2,CTt.ITelemetryService),$u(3,_Tt.IDomainService),$u(4,yTt.ICAPIClientService),$u(5,wFe.IFetcherService),$u(6,PEe.IEnvService),$u(7,oVi.IConfigurationService)],mTt);var gTt=class extends xFe{static{a(this,"CopilotTokenManagerFromGitHubToken")}constructor(e,r,n,o,s,c,l,u,d){super(new ETt.NullBaseOctoKitService(c,l,n,o),n,o,s,c,l,u),this.githubToken=e,this.githubUsername=r,this.configurationService=d}async authenticateAndGetToken(){return this.authFromGitHubToken(this.githubToken,this.githubUsername)}};Yl.CopilotTokenManagerFromGitHubToken=gTt;Yl.CopilotTokenManagerFromGitHubToken=gTt=ATt([$u(2,vTt.ILogService),$u(3,CTt.ITelemetryService),$u(4,_Tt.IDomainService),$u(5,yTt.ICAPIClientService),$u(6,wFe.IFetcherService),$u(7,PEe.IEnvService),$u(8,oVi.IConfigurationService)],gTt)});var aVi=I(WU=>{"use strict";p();var OMc=WU&&WU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},iFr=WU&&WU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(WU,"__esModule",{value:!0});WU.ChatQuotaService=void 0;var LMc=(yie(),Wa(Aie)),BMc=Fc(),FMc=Po(),UMc=rE(),QMc=lE(),qMc=Np(),oFr=class extends FMc.Disposable{static{a(this,"ChatQuotaService")}constructor(e,r,n){super(),this._authService=e,this._logService=r,this._capiClientService=n,this._turnCredits=new Map,this._onDidChange=this._register(new BMc.Emitter),this.onDidChange=this._onDidChange.event,this._rateLimitInfo={session:void 0,weekly:void 0},this._register(this._authService.onDidCopilotTokenChange(()=>{this._processUserInfoQuotaSnapshot(this._authService.copilotToken?.quotaInfo)}))}get quotaInfo(){return this._quotaInfo}get rateLimitInfo(){return this._rateLimitInfo}get quotaExhausted(){return!this._quotaInfo||this._quotaInfo.additionalUsageEnabled?!1:this._quotaInfo.unlimited?!this._quotaInfo.hasQuota:this._quotaInfo.percentRemaining<=0}get additionalUsageEnabled(){return this._quotaInfo?this._quotaInfo.additionalUsageEnabled:!1}getCreditsForTurn(e){return this._turnCredits.get(e)}setLastCopilotUsage(e,r){let n=e/1e9;n>=0&&this._turnCredits.set(r,(this._turnCredits.get(r)??0)+n)}resetTurnCredits(e){this._turnCredits.delete(e)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(e){let r=this._authService.copilotToken?.isFreeUser?e.get("x-quota-snapshot-chat"):e.get("x-quota-snapshot-premium_models")||e.get("x-quota-snapshot-premium_interactions");if(!r)return;let n=this._processHeaderValue(r);if(!n)return;this._quotaInfo=n,this._logService.trace(`[ChatQuota] processQuotaHeaders: ${JSON.stringify(n)}`);let o=e.get("x-usage-ratelimit-session"),s=e.get("x-usage-ratelimit-weekly");this._rateLimitInfo.session=o?this._processHeaderValue(o):void 0,this._rateLimitInfo.weekly=s?this._processHeaderValue(s):void 0,this._onDidChange.fire()}processQuotaSnapshots(e){let r=this._authService.copilotToken?.isFreeUser?e.chat:e.premium_models??e.premium_interactions;if(r)try{let n=parseInt(r.entitlement,10),o=r.reset_date?new Date(r.reset_date):(()=>{let s=new Date;return s.setMonth(s.getMonth()+1),s})();this._quotaInfo={quota:n,unlimited:n===-1,hasQuota:r.has_quota??!0,percentRemaining:r.percent_remaining,additionalUsageUsed:r.overage_count,additionalUsageEnabled:r.overage_permitted,resetDate:o},this._logService.trace(`[ChatQuota] processQuotaSnapshots: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}catch(n){console.error("Failed to process quota snapshots",n)}}async refreshQuota(){let e=this._authService.anyGitHubSession?.accessToken;if(e)try{let r={callSite:"copilot-quota-refresh",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},o=await(await this._capiClientService.makeRequest(r,{type:LMc.RequestType.CopilotUserInfo})).json();this._processUserInfoQuotaSnapshot(o),this._logService.trace("[ChatQuota] refreshQuota: fetched up-to-date quota data")}catch(r){this._logService.trace(`[ChatQuota] refreshQuota: failed to fetch quota data: ${r}`)}}_processHeaderValue(e){try{let r=new URLSearchParams(e),n=parseInt(r.get("ent")||"0",10),o=parseFloat(r.get("ov")||"0.0"),s=r.get("ovPerm")==="true",c=parseFloat(r.get("rem")||"0.0"),l=r.get("rst"),u;return l?u=new Date(l):(u=new Date,u.setMonth(u.getMonth()+1)),{quota:n,unlimited:n===-1,hasQuota:!0,percentRemaining:c,additionalUsageUsed:o,additionalUsageEnabled:s,resetDate:u}}catch(r){console.error("Failed to parse quota header",r);return}}_processUserInfoQuotaSnapshot(e){if(!e||!e.quota_snapshots||!e.quota_reset_date)return;let r=this._authService.copilotToken?.isFreeUser?e.quota_snapshots.chat:e.quota_snapshots.premium_interactions;this._quotaInfo={unlimited:r.unlimited,hasQuota:r.has_quota??!0,additionalUsageEnabled:r.overage_permitted,additionalUsageUsed:r.overage_count,quota:r.entitlement,resetDate:new Date(e.quota_reset_date),percentRemaining:r.percent_remaining},this._logService.trace(`[ChatQuota] processUserInfoQuotaSnapshot: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}};WU.ChatQuotaService=oFr;WU.ChatQuotaService=oFr=OMc([iFr(0,UMc.IAuthenticationService),iFr(1,qMc.ILogService),iFr(2,QMc.ICAPIClientService)],oFr)});var lVi=I(bTt=>{"use strict";p();Object.defineProperty(bTt,"__esModule",{value:!0});bTt.DefaultsOnlyConfigurationService=void 0;var cVi=Hl(),sFr=class extends cVi.AbstractConfigurationService{static{a(this,"DefaultsOnlyConfigurationService")}getConfig(e){return this.getDefaultValue(e)}inspectConfig(e,r){return{defaultValue:this.getDefaultValue(e)}}setConfig(e,r,n){return Promise.resolve()}getNonExtensionConfig(e){}getExperimentBasedConfig(e,r,n){if(e.experimentName){let c=r.getTreatmentVariable(e.experimentName);if(c!==void 0)return c}let o=r.getTreatmentVariable(`copilotchat.config.${e.id}`);if(o!==void 0)return o;let s=r.getTreatmentVariable(`config.${e.fullyQualifiedId}`);if(s!==void 0)return s;if(e.fullyQualifiedOldId){let c=r.getTreatmentVariable(`copilotchat.config.${e.oldId}`);if(c!==void 0)return c;let l=r.getTreatmentVariable(`config.${e.fullyQualifiedOldId}`);if(l!==void 0)return l}return this.getDefaultValue(e)}updateExperimentBasedConfiguration(e){e.length!==0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a((r,n)=>{if(e.some(s=>s.startsWith(`config.${r}`)))return!0;let o=cVi.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};bTt.DefaultsOnlyConfigurationService=sFr});var dVi=I(STt=>{"use strict";p();Object.defineProperty(STt,"__esModule",{value:!0});STt.computeDiff=HMc;STt.computeDiffSync=uVi;var jMc=qbt();async function HMc(t,e,r){return uVi(t,e,r)}a(HMc,"computeDiff");function uVi(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new jMc.DefaultLinesDiffComputer().computeDiff(n,o,r),l=c.changes.length>0?!1:t===e;function u(d){return d.map(f=>[f.original.startLineNumber,f.original.endLineNumberExclusive,f.modified.startLineNumber,f.modified.endLineNumberExclusive,f.innerChanges?.map(h=>[h.originalRange.startLineNumber,h.originalRange.startColumn,h.originalRange.endLineNumber,h.originalRange.endColumn,h.modifiedRange.startLineNumber,h.modifiedRange.startColumn,h.modifiedRange.endLineNumber,h.modifiedRange.endColumn])])}return a(u,"getLineChanges"),{identical:l,quitEarly:c.hitTimeout,changes:u(c.changes),moves:c.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}a(uVi,"computeDiffSync")});var mVi=I(WN=>{"use strict";p();var GMc=WN&&WN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Mc=WN&&WN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hVi=WN&&WN.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{let r=JMc([fVi.join(__dirname,"diffWorker.js"),fVi.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new VMc.WorkerWithRpcProxy(r,{name:"Diff worker"})})}dispose(){this._worker.rawValue?.terminate()}async computeDiff(e,r,n){let o=this._useWorker?await this._worker.value.proxy.computeDiff(e,r,n):await KMc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:lFr(o.changes),moves:o.moves.map(c=>new YMc.MovedText(new aFr.LineRangeMapping(new TTt.LineRange(c[0],c[1]),new TTt.LineRange(c[2],c[3])),lFr(c[4])))}}};WN.DiffServiceImpl=cFr;function lFr(t){return t.map(e=>new aFr.DetailedLineRangeMapping(new TTt.LineRange(e[0],e[1]),new TTt.LineRange(e[2],e[3]),e[4]?.map(r=>new aFr.RangeMapping(new pVi.Range(r[0],r[1],r[2],r[3]),new pVi.Range(r[4],r[5],r[6],r[7])))))}a(lFr,"toLineRangeMappings");function JMc(t){for(let e of t)if((0,zMc.existsSync)(e))return e}a(JMc,"firstExistingPath")});var AVi=I(zU=>{"use strict";p();var ZMc=zU&&zU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},gVi=zU&&zU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(zU,"__esModule",{value:!0});zU.CAPIClientImpl=void 0;var XMc=FD(),eOc=Oy(),tOc=lE(),uFr=class extends tOc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};zU.CAPIClientImpl=uFr;zU.CAPIClientImpl=uFr=ZMc([gVi(0,eOc.IFetcherService),gVi(1,XMc.IEnvService)],uFr)});var _Vi=I(YU=>{"use strict";p();var rOc=YU&&YU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},dFr=YU&&YU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(YU,"__esModule",{value:!0});YU.DomainService=void 0;var nOc=Fc(),iOc=Po(),oOc=zG(),DEe=Hl(),sOc=lE(),yVi="github-enterprise.uri",fFr=class extends iOc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new nOc.Emitter),this.onDidChangeDomains=this._onDidChangeDomains.event,this._register(this._configurationService.onDidChangeConfiguration(o=>this._onDidConfigChangeHandler(o))),this._processCopilotToken(this._tokenStore.copilotToken),this._register(this._tokenStore.onDidStoreUpdate(()=>this._processCopilotToken(this._tokenStore.copilotToken)))}_onDidConfigChangeHandler(e){(e.affectsConfiguration(`${DEe.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(yVi))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(DEe.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(DEe.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(DEe.ConfigKey.Shared.AuthProvider)===DEe.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(yVi):void 0,s={endpoints:{api:r||e?.endpoints?.api,proxy:n||e?.endpoints?.proxy,telemetry:e?.endpoints?.telemetry,"origin-tracker":e?.endpoints?.["origin-tracker"]},sku:e?.sku||"unknown"},c=this._capiClientService.updateDomains(s,o);(c.capiUrlChanged||c.proxyUrlChanged||c.telemetryUrlChanged||c.dotcomUrlChanged)&&this._onDidChangeDomains.fire({capiUrlChanged:c.capiUrlChanged,telemetryUrlChanged:c.telemetryUrlChanged,proxyUrlChanged:c.proxyUrlChanged,dotcomUrlChanged:c.dotcomUrlChanged})}_processCopilotToken(e){this._processCAPIModuleChange(e)}};YU.DomainService=fFr;YU.DomainService=fFr=rOc([dFr(0,DEe.IConfigurationService),dFr(1,oOc.ICopilotTokenStore),dFr(2,sOc.ICAPIClientService)],fFr)});var EVi=I(NEe=>{"use strict";p();Object.defineProperty(NEe,"__esModule",{value:!0});NEe.NullNativeEnvService=NEe.NullEnvService=void 0;var aOc=Fc(),cOc=hd(),ITt=FD(),lOc=K4e(),xTt=class t extends ITt.AbstractEnvService{static{a(this,"NullEnvService")}constructor(){super(...arguments),this.language="en"}static{this.Instance=new t}get extensionId(){return"test-extension-id"}get vscodeVersion(){return"test-version"}get isActive(){return!0}get onDidChangeWindowState(){return aOc.Event.None}get sessionId(){return"test-session"}get machineId(){return"test-machine"}get devDeviceId(){return"test-dev-device"}get remoteName(){}get uiKind(){return"desktop"}get uriScheme(){return"code-null"}get appRoot(){return""}get shell(){return"zsh"}get OS(){return ITt.OperatingSystem.Linux}getEditorInfo(){return new ITt.NameAndVersion("simulation-tests-editor",lOc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new ITt.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};NEe.NullEnvService=xTt;var pFr=class extends xTt{static{a(this,"NullNativeEnvService")}get userHome(){return cOc.URI.file("/home/testuser")}};NEe.NullNativeEnvService=pFr});var hFr=I(wTt=>{"use strict";p();Object.defineProperty(wTt,"__esModule",{value:!0});wTt.IGitExtensionService=void 0;var uOc=an();wTt.IGitExtensionService=(0,uOc.createServiceIdentifier)("IGitExtensionService")});var vVi=I(RTt=>{"use strict";p();Object.defineProperty(RTt,"__esModule",{value:!0});RTt.NullGitExtensionService=void 0;var dOc=Fc(),mFr=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=dOc.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};RTt.NullGitExtensionService=mFr});var CVi=I(KU=>{"use strict";p();var fOc=KU&&KU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},pOc=KU&&KU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(KU,"__esModule",{value:!0});KU.ObservableGit=void 0;var hOc=Po(),pW=bD(),mOc=hFr(),gFr=class extends hOc.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,pW.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,pW.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,pW.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,pW.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,pW.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,pW.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,pW.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,pW.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};KU.ObservableGit=gFr;KU.ObservableGit=gFr=fOc([pOc(0,mOc.IGitExtensionService)],gFr)});var PTt=I(Kl=>{"use strict";p();Object.defineProperty(Kl,"__esModule",{value:!0});Kl.lengthZero=void 0;Kl.lengthDiff=yOc;Kl.lengthIsZero=_Oc;Kl.toLength=Wie;Kl.lengthToObj=EOc;Kl.lengthGetLineCount=vOc;Kl.lengthGetColumnCountIfZeroLineCount=COc;Kl.lengthAdd=SVi;Kl.sumLengths=bOc;Kl.lengthEquals=SOc;Kl.lengthDiffNonNegative=TOc;Kl.lengthLessThan=IOc;Kl.lengthLessThanEqual=xOc;Kl.lengthGreaterThanEqual=wOc;Kl.lengthToPosition=ROc;Kl.positionToLength=kOc;Kl.lengthsToRange=POc;Kl.lengthOfRange=DOc;Kl.lengthCompare=NOc;Kl.lengthOfString=MOc;Kl.lengthOfStringObj=OOc;Kl.lengthHash=LOc;Kl.lengthMax=BOc;var bVi=ym(),gOc=iv(),AOc=uh(),kTt=Vge();function yOc(t,e,r,n){return t!==r?Wie(r-t,n):Wie(0,n-e)}a(yOc,"lengthDiff");Kl.lengthZero=0;function _Oc(t){return t===0}a(_Oc,"lengthIsZero");var AE=2**26;function Wie(t,e){return t*AE+e}a(Wie,"toLength");function EOc(t){let e=t,r=Math.floor(e/AE),n=e-r*AE;return new kTt.TextLength(r,n)}a(EOc,"lengthToObj");function vOc(t){return Math.floor(t/AE)}a(vOc,"lengthGetLineCount");function COc(t){return t}a(COc,"lengthGetColumnCountIfZeroLineCount");function SVi(t,e){let r=t+e;return e>=AE&&(r=r-t%AE),r}a(SVi,"lengthAdd");function bOc(t,e){return t.reduce((r,n)=>SVi(r,e(n)),Kl.lengthZero)}a(bOc,"sumLengths");function SOc(t,e){return t===e}a(SOc,"lengthEquals");function TOc(t,e){let r=t,n=e;if(n-r<=0)return Kl.lengthZero;let s=Math.floor(r/AE),c=Math.floor(n/AE),l=n-c*AE;if(s===c){let u=r-s*AE;return Wie(0,l-u)}else return Wie(c-s,l)}a(TOc,"lengthDiffNonNegative");function IOc(t,e){return t=e}a(wOc,"lengthGreaterThanEqual");function ROc(t){let e=t,r=Math.floor(e/AE),n=e-r*AE;return new gOc.Position(r+1,n+1)}a(ROc,"lengthToPosition");function kOc(t){return Wie(t.lineNumber-1,t.column-1)}a(kOc,"positionToLength");function POc(t,e){let r=t,n=Math.floor(r/AE),o=r-n*AE,s=e,c=Math.floor(s/AE),l=s-c*AE;return new AOc.Range(n+1,o+1,c+1,l+1)}a(POc,"lengthsToRange");function DOc(t){return t.startLineNumber===t.endLineNumber?new kTt.TextLength(0,t.endColumn-t.startColumn):new kTt.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(DOc,"lengthOfRange");function NOc(t,e){return t-e}a(NOc,"lengthCompare");function MOc(t){let e=(0,bVi.splitLines)(t);return Wie(e.length-1,e[e.length-1].length)}a(MOc,"lengthOfString");function OOc(t){let e=(0,bVi.splitLines)(t);return new kTt.TextLength(e.length-1,e[e.length-1].length)}a(OOc,"lengthOfStringObj");function LOc(t){return t}a(LOc,"lengthHash");function BOc(t,e){return t>e?t:e}a(BOc,"lengthMax")});var _Fr=I(DTt=>{"use strict";p();Object.defineProperty(DTt,"__esModule",{value:!0});DTt.TextEditInfo=void 0;var AFr=PTt(),yFr=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,AFr.lengthToObj)(this.startOffset)}...${(0,AFr.lengthToObj)(this.endOffset)}) -> ${(0,AFr.lengthToObj)(this.newLength)}`}};DTt.TextEditInfo=yFr});var IVi=I(EFr=>{"use strict";p();Object.defineProperty(EFr,"__esModule",{value:!0});EFr.combineTextEditInfos=QOc;var FOc=Ml(),Gg=PTt(),UOc=_Fr();function QOc(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new FOc.ArrayQueue(TVi(t)),n=TVi(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=r.dequeue();function s(d){if(d===void 0){let h=r.takeWhile(m=>!0)||[];return o&&h.unshift(o),h}let f=[];for(;o&&!(0,Gg.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,Gg.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,Gg.lengthIsZero)(d)||f.push(new RFe(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,Gg.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new UOc.TextEditInfo(m.startOffset,f,(0,Gg.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=Gg.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,Gg.sumLengths)(f,g=>g.lengthBefore),m=(0,Gg.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,Gg.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(QOc,"combineTextEditInfos");var RFe=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,Gg.lengthDiffNonNegative)(e,this.lengthAfter);return(0,Gg.lengthEquals)(r,Gg.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,Gg.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,Gg.lengthToObj)(this.lengthBefore)} -> ${(0,Gg.lengthToObj)(this.lengthAfter)}`}};function TVi(t){let e=[],r=Gg.lengthZero;for(let n of t){let o=(0,Gg.lengthDiffNonNegative)(r,n.startOffset);(0,Gg.lengthIsZero)(o)||e.push(new RFe(!1,o,o));let s=(0,Gg.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new RFe(!0,s,n.newLength)),r=n.endOffset}return e}a(TVi,"toLengthMapping")});var wVi=I(MEe=>{"use strict";p();Object.defineProperty(MEe,"__esModule",{value:!0});MEe.SingleTextEditLength=MEe.TextLengthEdit=void 0;var qOc=uh(),xVi=Vge(),jOc=IVi(),kFe=PTt(),HOc=_Fr(),vFr=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new PFe(n.range,xVi.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,kFe.lengthToObj)(n.newLength);return new PFe((0,kFe.lengthsToRange)(n.startOffset,n.endOffset),new xVi.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new HOc.TextEditInfo((0,kFe.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,kFe.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,kFe.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,jOc.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return qOc.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};MEe.TextLengthEdit=vFr;var PFe=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};MEe.SingleTextEditLength=PFe});var RVi=I(OEe=>{"use strict";p();Object.defineProperty(OEe,"__esModule",{value:!0});OEe.DocumentHistory=OEe.HistoryContext=void 0;var GOc=pd(),$Oc=ON(),CFr=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,GOc.assert)(e.length>0)}getMostRecentDocument(){return this.documents.at(-1)}getDocument(e){return this.documents.find(r=>r.docId===e)}getDocumentAndIdx(e){let r=this.documents.findIndex(n=>n.docId===e);if(r!==-1)return{doc:this.documents[r],idx:r}}};OEe.HistoryContext=CFr;var bFr=class{static{a(this,"DocumentHistory")}constructor(e,r,n,o,s){this.docId=e,this.languageId=r,this.base=n,this.lastEdits=o,this.lastSelection=s,this.lastEdit=new $Oc.RootedEdit(this.base,this.lastEdits.compose())}};OEe.DocumentHistory=bFr});var OVi=I(LEe=>{"use strict";p();Object.defineProperty(LEe,"__esModule",{value:!0});LEe.NesHistoryContextProvider=void 0;LEe.sum=NFe;LEe.editExtends=MVi;var kVi=Po(),PVi=bD(),VOc=CT(),DFe=W_(),WOc=rLe(),zOc=dI(),NTt=ON(),YOc=_bt(),DVi=wVi(),KOc=W4(),MFe=e5e(),NVi=RVi(),SFr=class extends kVi.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new IFr(50),this._register((0,PVi.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,MFe.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,PVi.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new TFr(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,KOc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},l=>{l.languageId.changes.length>0&&(c.languageId=l.languageId.value);let u=this._isAwaitingGitCheckoutCooldown();for(let d of l.value.changes)this._lastDocuments.push(c),c.handleEdit(d,u);l.selection.changes.length>0&&(c.handleSelection(l.selection.value.at(0)),this._lastDocuments.push(c))})),o.add((0,kVi.toDisposable)(()=>{let l=this._documentState.get(n.id);l&&this._lastDocuments.remove(l),this._documentState.delete(n.id)}))},n=>n.id).recomputeInitiallyAndOnChange(this._store)}getHistoryContext(e){let r=this._documentState.get(e);if(!r||!this._lastDocuments.has(r))return;let n=[],o=!1,s=5;for(let c of this._lastDocuments.getItemsReversed()){let l=c.getRecentEdit(s);if(l!==void 0&&(l.editCount===0&&o||(c.docId===e&&(o=!0),n.push(l.history),s-=l.editCount,s<=0)))break}if(n.reverse(),!!n.some(c=>c.docId===e))return new NVi.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,MFe.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};LEe.NesHistoryContextProvider=SFr;var TFr=class t{static{a(this,"DocumentState")}static{this.MAX_EDITED_LINES_PER_EDIT=10}static{this.MAX_EDITED_CHARS_PER_EDIT=5e3}constructor(e,r,n,o){this.docId=e,this.languageId=n,this._edits=[],this._isUserDocument=!1,this._baseValue=new zOc.StringText(r),this._currentValue=this._baseValue,this.handleSelection(o)}getSelection(){return this._selection}handleSelection(e){e&&(this._isUserDocument=!0),this._selection=e}handleEdit(e,r){if(e.isEmpty())return;this._currentValue=e.applyOnText(this._currentValue);let n=WOc.TextEdit.fromStringEdit(e,this._currentValue),o=DVi.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return NFe(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&MVi(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,MFe.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,MFe.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new NTt.Edits(DFe.StringEdit,this._edits.map(o=>o.edit));return{history:new NVi.DocumentHistory(this.docId,this.languageId,this._baseValue,n,this._selection),editCount:r}}applyAllEdits(){this._baseValue=this._currentValue,this._edits=[]}_applyStaleEdits(e){let r=this._currentValue,n=DFe.StringEdit.empty,o=DVi.TextLengthEdit.empty,s,c=0,l=DFe.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,MFe.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,VOc.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=NFe(u.textLengthEdit.edits,S=>S.range.endLineNumber-S.range.startLineNumber+S.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||NFe(u.edit.replacements,S=>S.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||NFe(u.edit.replacements,S=>S.replaceRange.length)>t.MAX_EDITED_CHARS_PER_EDIT)break;if(s===this._edits.length-1)l=u.edit;else{let S=DFe.StringEdit.trySwap(u.edit,l);if(S)l=S.e1;else{if(h>=2)break;l=u.edit.compose(l)}}r=u.edit.inverse(r.value).applyOnText(r);let y=u.edit.compose(n),_=NTt.RootedEdit.toLineEdit(new NTt.RootedEdit(r,y)),v=new YOc.RootedLineEdit(r,_).removeCommonSuffixPrefixLines().edit.replacements.length;if(v>e)break;c=v,n=y,o=d}for(let u=0;u<=s;u++){let d=this._edits[u];this._baseValue=d.edit.applyOnText(this._baseValue)}return this._edits=this._edits.slice(s+1),{editCount:c}}toString(){return new NTt.Edits(DFe.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function NFe(t,e){let r=0;for(let n of t)r+=e(n);return r}a(NFe,"sum");function MVi(t,e){let r=e.getNewRanges();return t.replacements.every(n=>JOc(n.replaceRange,r))}a(MVi,"editExtends");function JOc(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(JOc,"doesTouch");var IFr=class{static{a(this,"FifoSet")}constructor(e){this.maxSize=e,this._arr=[]}push(e){let r=this._arr.indexOf(e);r!==-1?this._arr.splice(r,1):this._arr.length>=this.maxSize&&this._arr.shift(),this._arr.push(e)}remove(e){let r=this._arr.indexOf(e);r!==-1&&this._arr.splice(r,1)}getItemsReversed(){let e=[...this._arr];return e.reverse(),e}has(e){return this._arr.indexOf(e)!==-1}}});var FVi=I(zN=>{"use strict";p();var ZOc=zN&&zN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},LVi=zN&&zN.__param||function(t,e){return function(r,n){e(r,n,t)}},wFr;Object.defineProperty(zN,"__esModule",{value:!0});zN.NesXtabHistoryTracker=zN.XtabEditMergeStrategy=void 0;var RFr=pd(),XOc=Po(),e5c=Ade(),t5c=bD(),r5c=o6(),OTt=Hl(),n5c=Rh(),MTt=ON(),JU=TTr(),i5c=W4(),xFr=e5e(),kFr;(function(t){t.sameStartLine={kind:JU.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:JU.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:JU.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case JU.DiffHistoryMergeStrategy.Proximity:return e(s);case JU.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case JU.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,RFr.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(kFr||(zN.XtabEditMergeStrategy=kFr={}));function BVi(t,e,r){if(t.isEmpty()||e.isEmpty())return!1;for(let n of t.replacements)if(!e.replacements.some(s=>n.lineRange.distanceToRange(s.lineRange)<=r))return!1;return!0}a(BVi,"areLineEditsWithinProximity");var PFr=class extends XOc.Disposable{static{a(this,"NesXtabHistoryTracker")}static{wFr=this}static{this.MAX_HISTORY_SIZE=50}constructor(e,r,n,o){super(),this._configurationService=n,this._expService=o,this.idToEntry=new Map,this.history=new e5c.LinkedList,this.maxHistorySize=r??wFr.MAX_HISTORY_SIZE,this.mergeStrategy=(0,r5c.derived)(s=>kFr.fromConfig(this._configurationService.getExperimentBasedConfigObservable(OTt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(OTt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(OTt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,t5c.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,i5c.autorunWithChanges)(this,{rootedEdits:s.value,visibleRanges:s.visibleRanges},l=>{l.rootedEdits.changes.length>0&&l.rootedEdits.previous!==void 0?this.handleEdits(s,l.rootedEdits):this.handleVisibleRangesChange(s,l.visibleRanges)}))},s=>s.id).recomputeInitiallyAndOnChange(this._store)}getHistory(){return[...this.history]}handleVisibleRangesChange(e,r){if(r.value.length===0)return;let n=this.idToEntry.get(e.id);if(n!==void 0){if(n.entry.kind==="edit")return;n.removeFromHistory()}let o={docId:e.id,kind:"visibleRanges",visibleRanges:r.value,documentContent:e.value.get()},s=this.history.push(o);this.idToEntry.set(e.id,{entry:o,removeFromHistory:s,lastEditTimestamp:(0,xFr.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case JU.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case JU.DiffHistoryMergeStrategy.Proximity:return BVi(r,e,o.lineGap);case JU.DiffHistoryMergeStrategy.Hybrid:return(0,xFr.now)()-n<=o.splitAfterMs&&BVi(r,e,o.lineGap)}}handleEdits(e,r){(0,RFr.assert)(r.previous!==void 0,"Document has previous version"),(0,RFr.assert)(r.changes.length===1,`Expected 1 edit change but got ${r.changes.length}`);let n=r.changes[0];if(n.replacements.length===0)return;let o=this.idToEntry.get(e.id),s=r.previous,c=new MTt.RootedEdit(s,n);if(o===void 0){this.pushToHistory(e.id,c);return}if(o.entry.kind==="visibleRanges"){o.removeFromHistory(),this.pushToHistory(e.id,c);return}let l=o.entry.edit,u=MTt.RootedEdit.toLineEdit(l),d=MTt.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new MTt.RootedEdit(l.base,f);this.pushToHistory(e.id,h)}else this.pushToHistory(e.id,c)}pushToHistory(e,r){let n={docId:e,kind:"edit",edit:r},o=this.history.push(n);this.idToEntry.set(e,{entry:n,removeFromHistory:o,lastEditTimestamp:(0,xFr.now)()}),this.compactHistory()}compactHistory(){if(this.history.size>this.maxHistorySize){let e=this.history.shift();if(e!==void 0){let r=this.idToEntry.get(e.docId);r!==void 0&&e===r.entry&&this.idToEntry.delete(e.docId)}}}};zN.NesXtabHistoryTracker=PFr;zN.NesXtabHistoryTracker=PFr=wFr=ZOc([LVi(2,OTt.IConfigurationService),LVi(3,n5c.IExperimentationService)],PFr)});var UVi=I(LTt=>{"use strict";p();Object.defineProperty(LTt,"__esModule",{value:!0});LTt.IVSCodeExtensionContext=void 0;var o5c=an();LTt.IVSCodeExtensionContext=(0,o5c.createServiceIdentifier)("IVSCodeExtensionContext")});var WVi=I(KN=>{"use strict";p();var HVi=KN&&KN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},hW=KN&&KN.__param||function(t,e){return function(r,n){e(r,n,t)}},LFe;Object.defineProperty(KN,"__esModule",{value:!0});KN.UndesiredModels=KN.InlineEditsModelService=void 0;var s5c=S3r(),GVi=s3r(),QVi=gv(),a5c=Ml(),qVi=pd(),$Vi=Fc(),VVi=Po(),BEe=bD(),c5c=zG(),YN=Hl(),l5c=UVi(),u5c=Np(),d5c=Z1t(),f5c=Rh(),p5c=bh(),OFe=wy(),h5c=h1t(),NFr=class extends VVi.Disposable{static{a(this,"InlineEditsModelService")}static{LFe=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:OFe.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:OFe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:OFe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}constructor(e,r,n,o,s,c,l){super(),this._tokenStore=e,this._proxyModelsService=r,this._undesiredModelsManager=n,this._configService=o,this._expService=s,this._telemetryService=c,this._logService=l,this._copilotTokenObs=(0,BEe.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,BEe.observableFromEvent)(this,this._proxyModelsService.onModelListUpdated,()=>this._proxyModelsService.nesModels),this._preferredModelNameObs=this._configService.getExperimentBasedConfigObservable(YN.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService),this._localModelConfigObs=this._configService.getConfigObservable(YN.ConfigKey.Advanced.InlineEditsXtabProviderModelConfiguration),this._expBasedModelConfigObs=this._configService.getExperimentBasedConfigObservable(YN.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString,this._expService),this._defaultModelConfigObs=this._configService.getExperimentBasedConfigObservable(YN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString,this._expService),this._useSlashModelsObs=this._configService.getExperimentBasedConfigObservable(YN.ConfigKey.TeamInternal.InlineEditsUseSlashModels,this._expService),this._undesiredModelsObs=(0,BEe.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new GVi.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,BEe.derived)(d=>(u.trace("computing models"),this.aggregateModels({copilotToken:this._copilotTokenObs.read(d),fetchedNesModels:this._fetchedModelsObs.read(d),localModelConfig:this._localModelConfigObs.read(d),modelConfigString:this._expBasedModelConfigObs.read(d),defaultModelConfigString:this._defaultModelConfigObs.read(d),useSlashModels:this._useSlashModelsObs.read(d)}))).recomputeInitiallyAndOnChange(this._store),this._currentModelObs=(0,BEe.derived)(d=>{u.trace("computing current model");let f=this._undesiredModelsObs.read(d);return this._pickModel({preferredModelName:this._preferredModelNameObs.read(d),models:this._modelsObs.read(d),undesiredModelsManager:f})}).recomputeInitiallyAndOnChange(this._store),this._modelInfoObs=(0,BEe.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=$Vi.Event.fromObservableLight(this._modelInfoObs)}get modelInfo(){let e=this._modelsObs.get().map(n=>({id:n.modelName,name:n.modelName})),r=this._currentModelObs.get();return{models:e,currentModelId:r.modelName}}setCurrentModelId(e){return this._setModelQueue.schedule(()=>this._setCurrentModelIdCore(e))}async _setCurrentModelIdCore(e){if(this._configService.getExperimentBasedConfig(YN.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService)===e)return;let o=this._currentModelObs.get(),s=this._modelsObs.get(),c=s.find(u=>u.modelName===e);if(c===void 0){this._logService.error(`New preferred model id ${e} not found in model list.`);return}o.source==="expConfig"&&await this._undesiredModelsManager.addUndesiredModelId(o.modelName),this._undesiredModelsManager.isUndesiredModelId(e)&&await this._undesiredModelsManager.removeUndesiredModelId(e);let l=this._pickModel({preferredModelName:"none",models:s,undesiredModelsManager:this._undesiredModelsManager});c.source==="expConfig"||e===l.modelName&&!s.some(u=>u.source==="expConfig")?(this._logger.trace(`New preferred model id ${e} is the same as the default model, resetting user setting.`),await this._configService.setConfig(YN.ConfigKey.Advanced.InlineEditsPreferredModel,"none")):(this._logger.trace(`New preferred model id ${e} is different from the default model, updating user setting to ${e}.`),await this._configService.setConfig(YN.ConfigKey.Advanced.InlineEditsPreferredModel,e))}aggregateModels({copilotToken:e,fetchedNesModels:r,localModelConfig:n,modelConfigString:o,defaultModelConfigString:s,useSlashModels:c}){let l=this._logger.createSubLogger("aggregateModels"),u=[];if(n&&(u.some(d=>d.modelName===n.modelName)?l.trace("Local model configuration already exists in the model list, skipping."):(l.trace(`Adding local model configuration: ${n.modelName}`),u.push({...n,source:"localConfig"}))),o){l.trace("Parsing modelConfigurationString...");let d=this.parseModelConfigString(o,YN.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString);d&&!u.some(f=>f.modelName===d.modelName)?(l.trace(`Adding model from modelConfigurationString: ${d.modelName}`),u.push({...d,source:"expConfig"})):l.trace("No valid model found in modelConfigurationString.")}if(c&&r&&r.length>0){l.trace(`Processing ${r.length} fetched models...`);let d=(0,s5c.filterMap)(r,f=>{if((0,OFe.isPromptingStrategy)(f.capabilities.promptStrategy)){if(u.some(h=>h.modelName===f.name)){l.trace(`Fetched model ${f.name} already exists in the model list, skipping.`);return}return{modelName:f.name,promptingStrategy:f.capabilities.promptStrategy,includeTagsInCurrentFile:!1,source:"fetched",lintOptions:void 0}}});l.trace(`Adding ${d.length} fetched models after filtering.`),(0,a5c.pushMany)(u,d)}else{l.trace(`adding built-in default model: useSlashModels ${c}, fetchedNesModels ${r?.length??"undefined"}`);let d=this.determineDefaultModel(e,s);d&&(u.some(f=>f.modelName===d.modelName)?l.trace("Default model configuration already exists in the model list, skipping."):(l.trace(`Adding default model configuration: ${d.modelName}`),u.push(d)))}return u}selectedModelConfiguration(){return DFr(this._currentModelObs.get())}defaultModelConfiguration(){let e=this._modelsObs.get();if(e&&e.length>0){let r=e.filter(n=>!this.isConfiguredModel(n));if(r.length>0)return DFr(r[0])}return DFr(this.determineDefaultModel(this._copilotTokenObs.get(),this._defaultModelConfigObs.get()))}isConfiguredModel(e){switch(e.source){case"localConfig":case"expConfig":case"expDefaultConfig":return!0;case"fetched":case"hardCodedDefault":return!1;default:(0,qVi.assertNever)(e.source)}}determineDefaultModel(e,r){if(r){let n=this.parseModelConfigString(r,YN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString);if(n)return{...n,source:"expDefaultConfig"}}return e?.isFcv1()?LFe.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?LFe.COPILOT_NES_CALLISTO:LFe.COPILOT_NES_OCT}_pickModel({preferredModelName:e,models:r,undesiredModelsManager:n}){let o=r.find(l=>l.source==="expConfig");if(o)if(n.isUndesiredModelId(o.modelName))this._logger.trace(`Exp-configured model ${o.modelName} is marked as undesired by the user. Skipping.`);else return o;if(e!=="none"){let l=r.find(u=>u.modelName===e);if(l)return l}(0,qVi.softAssert)(r.length>0,"InlineEdits model list should have at least one model");let c=r.at(0);return c||this.determineDefaultModel(this._copilotTokenObs.get(),this._defaultModelConfigObs.get())}parseModelConfigString(e,r){let n;try{let o=JSON.parse(e),s=OFe.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=QVi.ErrorUtils.toString(QVi.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};KN.InlineEditsModelService=NFr;KN.InlineEditsModelService=NFr=LFe=HVi([hW(0,c5c.ICopilotTokenStore),hW(1,d5c.IProxyModelsService),hW(2,h5c.IUndesiredModelsManager),hW(3,YN.IConfigurationService),hW(4,f5c.IExperimentationService),hW(5,p5c.ITelemetryService),hW(6,u5c.ILogService)],NFr);function DFr(t){let{source:e,...r}=t;return r}a(DFr,"toModelConfiguration");var jVi;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends VVi.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new $Vi.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new GVi.TaskQueue}isUndesiredModelId(o){return this._getModels().includes(o)}addUndesiredModelId(o){return this._queue.schedule(async()=>{let s=this._getModels();s.includes(o)||(s.push(o),await this._setModels(s),this._onDidChange.fire())})}removeUndesiredModelId(o){return this._queue.schedule(async()=>{let s=this._getModels(),c=s.indexOf(o);c!==-1&&(s.splice(c,1),await this._setModels(s),this._onDidChange.fire())})}_getModels(){return this._vscodeExtensionContext.globalState.get(e)??[]}_setModels(o){return new Promise((s,c)=>{this._vscodeExtensionContext.globalState.update(e,o).then(s,c)})}};r=HVi([hW(0,l5c.IVSCodeExtensionContext)],r),t.Manager=r})(jVi||(KN.UndesiredModels=jVi={}))});var zVi=I(BTt=>{"use strict";p();Object.defineProperty(BTt,"__esModule",{value:!0});BTt.NullLanguageContextProviderService=void 0;var m5c=Po(),MFr=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return m5c.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};BTt.NullLanguageContextProviderService=MFr});var YVi=I(FTt=>{"use strict";p();Object.defineProperty(FTt,"__esModule",{value:!0});FTt.TestLanguageDiagnosticsService=void 0;var g5c=Fc(),A5c=b2(),y5c=CV(),OFr=class extends y5c.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new A5c.ResourceMap,this._onDidChangeDiagnostics=new g5c.Emitter,this.onDidChangeDiagnostics=this._onDidChangeDiagnostics.event}setDiagnostics(e,r){this.diagnosticsMap.set(e,r),this._onDidChangeDiagnostics.fire({uris:[e]})}getDiagnostics(e){return this.diagnosticsMap.get(e)||[]}getAllDiagnostics(){return Array.from(this.diagnosticsMap.entries())}};FTt.TestLanguageDiagnosticsService=OFr});var KVi=I(QTt=>{"use strict";p();Object.defineProperty(QTt,"__esModule",{value:!0});QTt.ResponseStream=void 0;var _5c=gv(),UTt=xT(),E5c=pl(),v5c=CT(),LFr=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new E5c.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return UTt.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return UTt.Result.error(l)}}),this.stream=C5c(r,s)}async destroy(){await this.fetcherResponse.body.destroy()}static aggregateCompletionsStream(e){let r="",n=null,o=null,s;for(let d of e){let f=d.choices[0];r+=f.text??"",f.logprobs&&(o===null?o={tokens:[...f.logprobs.tokens],token_logprobs:[...f.logprobs.token_logprobs],text_offset:[...f.logprobs.text_offset],top_logprobs:[...f.logprobs.top_logprobs]}:(o.tokens.push(...f.logprobs.tokens),o.token_logprobs.push(...f.logprobs.token_logprobs),o.text_offset.push(...f.logprobs.text_offset),o.top_logprobs.push(...f.logprobs.top_logprobs))),d.usage&&(s===void 0?s={completion_tokens:d.usage.completion_tokens,prompt_tokens:d.usage.prompt_tokens,total_tokens:d.usage.total_tokens,completion_tokens_details:{audio_tokens:d.usage.completion_tokens_details.audio_tokens,reasoning_tokens:d.usage.completion_tokens_details.reasoning_tokens},prompt_tokens_details:{audio_tokens:d.usage.prompt_tokens_details.audio_tokens,reasoning_tokens:d.usage.prompt_tokens_details.reasoning_tokens}}:(s.completion_tokens+=d.usage.completion_tokens,s.prompt_tokens+=d.usage.prompt_tokens,s.total_tokens+=d.usage.total_tokens,s.completion_tokens_details.audio_tokens+=d.usage.completion_tokens_details.audio_tokens,s.completion_tokens_details.reasoning_tokens+=d.usage.completion_tokens_details.reasoning_tokens,s.prompt_tokens_details.audio_tokens+=d.usage.prompt_tokens_details.audio_tokens,s.prompt_tokens_details.reasoning_tokens+=d.usage.prompt_tokens_details.reasoning_tokens)),f.finish_reason&&((0,v5c.assertType)(n===null,"cannot already have finishReason if just seeing choice.finish_reason"),n=f.finish_reason)}if(e.length===0)throw new Error("Response is empty!");let c=e[0];return{choices:[{index:0,finish_reason:n,logprobs:o,text:r}],system_fingerprint:c.system_fingerprint,object:c.object,usage:s}}};QTt.ResponseStream=LFr;async function*C5c(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=_5c.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?UTt.Result.error(n):UTt.Result.ok(r))}}a(C5c,"streamWithAggregation")});var JVi=I(BFr=>{"use strict";p();Object.defineProperty(BFr,"__esModule",{value:!0});BFr.jsonlStreamToCompletions=b5c;async function*b5c(t){for await(let e of t)if(e.trim()!=="data: [DONE]"&&e.startsWith("data: ")){let r=JSON.parse(e.substring(6));if(r.error)throw new Error(r.error.message);yield r}}a(b5c,"jsonlStreamToCompletions")});var XVi=I(ZU=>{"use strict";p();var S5c=ZU&&ZU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},FFr=ZU&&ZU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ZU,"__esModule",{value:!0});ZU.CompletionsFetchService=void 0;var T5c=a3r(),ZVi=gv(),zie=xT(),I5c=G_r(),x5c=rE(),w5c=PU(),R5c=Oy(),k5c=O_e(),mW=nbt(),P5c=KVi(),D5c=JVi(),UFr=class{static{a(this,"CompletionsFetchService")}constructor(e,r,n){this.authService=e,this.fetcherService=r,this.requestLogger=n}disconnectAll(){return this.fetcherService.disconnectAll()}async fetch(e,r,n,o,s,c){let l=Date.now();if(s.isCancellationRequested){let f=zie.Result.error(new mW.Completions.RequestCancelled);return this._logCompletionsRequest(e,n,o,l,f),f}let u={requestId:o,headers:this.getHeaders(o,r,c),body:JSON.stringify({...n,stream:!0})},d=await this._fetchFromUrl(e,u,s);if(d.isError())return this._logCompletionsRequest(e,n,o,l,d),d;if(d.val.status===200){let f=T5c.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,D5c.jsonlStreamToCompletions)(f),m=new P5c.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=zie.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new mW.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>M5c(d.val.body).catch(()=>"")),h=zie.Result.error(f);return this._logCompletionsRequest(e,n,o,l,h),h}}async _fetchFromUrl(e,r,n){let o=this.fetcherService.makeAbortController(),s=n.onCancellationRequested(()=>{o.abort()});try{let c={headers:r.headers,body:r.body,signal:o.signal,method:"POST",callSite:"nes-completions"},l=await this.fetcherService.fetch(e,c);if(l.status===200&&this.authService.copilotToken?.isFreeUser&&this.authService.copilotToken?.isChatQuotaExceeded&&this.authService.resetCopilotToken(),l.status!==200)return l.status===402&&(this.authService.copilotToken?.isCompletionsQuotaExceeded||(this.authService.resetCopilotToken(l.status),await this.authService.getCopilotToken())),zie.Result.error(new mW.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=N5c(u,s);return zie.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,w5c.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return zie.Result.error(new mW.Completions.RequestCancelled);let l=ZVi.ErrorUtils.fromUnknown(c);return zie.Result.error(new mW.Completions.Unexpected(l))}}_logCompletionsRequest(e,r,n,o,s){if(s.isOk())s.val.response.then(l=>{let u=l.isOk()?"success":"failed";this._emitCompletionsLogEntry(e,r,n,o,u,l)});else{let c=s.err;c instanceof mW.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof mW.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof mW.Completions.Unexpected&&this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,c.error.message)}}_emitCompletionsLogEntry(e,r,n,o,s,c,l){let u=Date.now()-o,d=[];if(d.push("> \u{1F6A8} Note: This log may contain personal information such as the contents of your files. Please review the contents carefully before sharing."),d.push("# completions"),d.push(""),d.push("- [Metadata](#metadata)"),d.push("- [Prompt](#prompt)"),r.suffix&&d.push("- [Suffix](#suffix)"),d.push("- [Response](#response)"),d.push(""),d.push("## Metadata"),d.push("
"),d.push(`url              : ${e}`),d.push(`requestId        : ${n}`),d.push(`model            : ${r.model??"(default)"}`),d.push(`maxTokens        : ${r.max_tokens}`),d.push(`temperature      : ${r.temperature}`),d.push(`top_p            : ${r.top_p}`),d.push(`n                : ${r.n}`),d.push(`duration         : ${u}ms`),d.push("
"),d.push(""),d.push("## Prompt"),d.push("~~~"),d.push(r.prompt),d.push("~~~"),r.suffix&&(d.push(""),d.push("## Suffix"),d.push("~~~"),d.push(r.suffix),d.push("~~~")),d.push(""),d.push("## Response"),s==="cancelled")d.push("## CANCELED");else if(s==="failed")d.push(`## FAILED: ${l}`);else if(c)if(c.isOk()){let h=c.val,m=h.choices[0]?.text??"",g=h.choices[0]?.finish_reason??"unknown";d.push("~~~"),d.push(m||""),d.push("~~~"),d.push(""),d.push("
"),d.push(`finishReason     : ${g}`),h.usage&&(d.push(`promptTokens     : ${h.usage.prompt_tokens}`),d.push(`completionTokens : ${h.usage.completion_tokens}`),d.push(`totalTokens      : ${h.usage.total_tokens}`)),d.push("
")}else d.push(`## FAILED: stream error - ${c.err.message}`);let f=s==="success"?void 0:I5c.Codicon.error;this.requestLogger.addEntry({type:"MarkdownContentRequest",debugName:"Completions Request",startTimeMs:o,icon:f,markdownContent:d.join(` -`)})}getHeaders(e,r,n={}){return{"Content-Type":"application/json","x-policy-id":"nil",Authorization:"Bearer "+r,"X-Request-Id":e,"X-GitHub-Api-Version":"2025-04-01",...n}}};ZU.CompletionsFetchService=UFr;ZU.CompletionsFetchService=UFr=S5c([FFr(0,x5c.IAuthenticationService),FFr(1,R5c.IFetcherService),FFr(2,k5c.IRequestLogger)],UFr);async function*N5c(t,e){try{for await(let r of t)yield r}catch(r){throw ZVi.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(N5c,"streamWithCleanup");async function M5c(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(M5c,"collectAsyncIterableToString")});var tWi=I(qTt=>{"use strict";p();Object.defineProperty(qTt,"__esModule",{value:!0});qTt.WireTypes=void 0;var gW=I$(),eWi;(function(t){let e;(function(o){function s(c){return!!c&&typeof c=="object"&&typeof c.promptStrategy=="string"}a(s,"is"),o.is=s,o.validator=(0,gW.vObj)({promptStrategy:(0,gW.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,gW.vObj)({serviceType:(0,gW.vString)(),name:(0,gW.vString)(),provider:(0,gW.vString)(),capabilities:e.validator});function s(c){return!!c&&typeof c=="object"&&typeof c.serviceType=="string"&&typeof c.name=="string"&&typeof c.provider=="string"&&e.is(c.capabilities)}a(s,"is"),o.is=s})(r=t.Model||(t.Model={}));let n;(function(o){o.validator=(0,gW.vObj)({models:(0,gW.vArray)(r.validator)});function s(c){return!!c&&typeof c=="object"&&Array.isArray(c.models)&&c.models.every(r.is)}a(s,"is"),o.is=s})(n=t.ModelList||(t.ModelList={}))})(eWi||(qTt.WireTypes=eWi={}))});var iWi=I(XU=>{"use strict";p();var O5c=XU&&XU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},BFe=XU&&XU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(XU,"__esModule",{value:!0});XU.ProxyModelsService=void 0;var L5c=require("util"),QFr=gv(),B5c=S2(),F5c=Fc(),U5c=Po(),rWi=bD(),Q5c=zG(),q5c=lE(),nWi=FD(),j5c=tWi(),H5c=Np(),G5c=Oy(),qFr=class extends U5c.Disposable{static{a(this,"ProxyModelsService")}constructor(e,r,n,o,s){super(),this._tokenStore=e,this._capiClient=r,this._fetchService=n,this._logService=o,this._envService=s,this._onModelListUpdated=this._register(new F5c.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let c=(0,rWi.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,rWi.autorun)(l=>{let u=c.read(l),d=new B5c.CancellationTokenSource;this._fetchLatestModels(u,d.token).then(f=>{f!==void 0&&(d.token.isCancellationRequested||(0,L5c.isDeepStrictEqual)(this._models,f)||(this._models=f,this._onModelListUpdated.fire()))}).catch(f=>{let h=QFr.ErrorUtils.fromUnknown(f);this._logService.error(h,"Failed to fetch models in autorun")}),l.store.add({dispose:a(()=>d.dispose(!0),"dispose")})}))}get models(){return this._models}get nesModels(){return this._models?.models.filter(e=>e.serviceType==="NESChat")}get cursorJumpModels(){return this._models?.models.filter(e=>e.serviceType==="CursorJumpChat")}get instantApplyModels(){return this._models?.models.filter(e=>e.serviceType==="InstantApplyChat")}async _fetchLatestModels(e,r){if(!e)return;let n=`${this._capiClient.proxyBaseURL}/models`,o=this._fetchService.makeAbortController(),s=r.onCancellationRequested(()=>o.abort()),c;try{c=await this._fetchService.fetch(n,{headers:{Authorization:`Bearer ${e.token}`,...(0,nWi.getEditorVersionHeaders)(this._envService)},method:"GET",timeout:1e4,callSite:"proxy-models",signal:o.signal})}catch(l){let u=QFr.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to fetch model list");return}finally{s.dispose()}if(!c.ok){this._logService.error(`Failed to fetch model list: ${c.status} ${c.statusText}`);return}try{let l=await c.json(),u=j5c.WireTypes.ModelList.validator.validate(l);if(u.error)throw new Error(`Invalid /models response data: ${u.error.message}`);return u.content}catch(l){let u=QFr.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};XU.ProxyModelsService=qFr;XU.ProxyModelsService=qFr=O5c([BFe(0,Q5c.ICopilotTokenStore),BFe(1,q5c.ICAPIClientService),BFe(2,G5c.IFetcherService),BFe(3,H5c.ILogService),BFe(4,nWi.IEnvService)],qFr)});var oWi=I(jTt=>{"use strict";p();Object.defineProperty(jTt,"__esModule",{value:!0});jTt.NullRequestLogger=void 0;var $5c=rBr(),V5c=Fc(),jFr=class extends $5c.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=V5c.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};jTt.NullRequestLogger=jFr});var WTt=I(fu=>{"use strict";p();var JFr=fu&&fu.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},JN=fu&&fu.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(fu,"__esModule",{value:!0});fu.SimpleExperimentationService=fu.LogLevel=fu.TokenizerName=fu.ILanguageContextProviderService=fu.IIgnoreService=fu.IExperimentationService=fu.IEndpointProvider=fu.ICAPIClientService=fu.IAuthenticationService=void 0;fu.createNESProvider=U4c;fu.createInlineCompletionsProvider=q4c;var W5c=Qfi(),sWi=Are(),aWi=ODi(),cWi=uye(),z5c=Kyt(),lWi=SRr(),Y5c=TRr(),dC=eE(),uWi=PRr(),K5c=RLi(),J5c=xy(),dWi=Ckr(),Z5c=eV(),fWi=wkr(),pWi=cBe(),hWi=zkr(),mWi=Kkr(),gWi=mOr(),GFr=$Et(),X5c=d7i(),e4c=f7i(),FFe=Gl(),t4c=C_e(),r4c=wRr(),AWi=zOr(),yWi=tkr(),_Wi=ebt(),EWi=YNr(),vWi=Fvt(),UFe=Bvt(),CWi=yV(),bWi=Jvt(),n4c=g7i(),i4c=zvt(),SWi=VTr(),TWi=RS(),IWi=cLe(),xWi=Kne(),FWi=Rne();Object.defineProperty(fu,"TokenizerName",{enumerable:!0,get:a(function(){return FWi.TokenizerName},"get")});var o4c=k7i(),s4c=xQi(),$Fr=KQi(),wWi=S4r(),a4c=FHi(),RWi=ABr(),c4c=V$i(),ZFr=rE();Object.defineProperty(fu,"IAuthenticationService",{enumerable:!0,get:a(function(){return ZFr.IAuthenticationService},"get")});var l4c=aLe(),kWi=zG(),u4c=W$i(),d4c=sVi(),f4c=LU(),p4c=x4r(),h4c=aVi(),m4c=w4r(),PWi=k4r(),fB=Hl(),g4c=lVi(),A4c=yBr(),y4c=mVi(),XFr=lE();Object.defineProperty(fu,"ICAPIClientService",{enumerable:!0,get:a(function(){return XFr.ICAPIClientService},"get")});var _4c=VV(),e8r=zLe();Object.defineProperty(fu,"IEndpointProvider",{enumerable:!0,get:a(function(){return e8r.IEndpointProvider},"get")});var UWi=AVi(),E4c=_Vi(),e9=FD(),v4c=EVi(),C4c=hFr(),QWi=vVi(),QFe=Pne();Object.defineProperty(fu,"IIgnoreService",{enumerable:!0,get:a(function(){return QFe.IIgnoreService},"get")});var b4c=Uie(),S4c=_mt(),HFr=h1t(),T4c=CVi(),I4c=OVi(),x4c=FVi(),w4c=WVi(),t8r=Mvt();Object.defineProperty(fu,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return t8r.ILanguageContextProviderService},"get")});var qWi=zVi(),jWi=CV(),HWi=YVi(),ZN=Np(),R4c=nbt(),k4c=XVi(),r8r=Oy(),DWi=UU(),P4c=JLr(),D4c=ZLr(),N4c=r1t(),M4c=Z1t(),O4c=iWi(),GWi=O_e(),$Wi=oWi(),NWi=xBr(),MWi=R5r(),jFe=Rh();Object.defineProperty(fu,"IExperimentationService",{enumerable:!0,get:a(function(){return jFe.IExperimentationService},"get")});var VWi=bh(),OWi=J_e(),L4c=fTr(),LWi=$1t(),BWi=$V(),VFr=r3r(),WWi=an(),B4c=S2(),qFe=Fc(),VTt=Po(),F4c=Og(),bi=umt(),zWi=Ks(),Yie;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(Yie||(fu.LogLevel=Yie={}));function U4c(t){return Q4c(t).createInstance(WFr,t)}a(U4c,"createNESProvider");var WFr=class extends VTt.Disposable{static{a(this,"NESProvider")}constructor(e,r,n,o,s){super(),this._options=e,this._expService=n,this._configurationService=o,this._workspaceService=s;let c=r.createInstance(c4c.XtabProvider),l=r.createInstance(T4c.ObservableGit),u=new I4c.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig(fB.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new x4c.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new o4c.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(s4c.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance($Fr.TelemetrySender,this._options.workspace))}getId(){return this._nextEditProvider.ID}handleShown(e){e.telemetryBuilder.setAsShown(),this._nextEditProvider.handleShown(e.internalResult)}handleAcceptance(e){e.telemetryBuilder.setAcceptance("accepted"),e.telemetryBuilder.setStatus("accepted"),this._nextEditProvider.handleAcceptance(e.docId,e.internalResult),this.handleEndOfLifetime(e)}handleRejection(e){e.telemetryBuilder.setAcceptance("rejected"),e.telemetryBuilder.setStatus("rejected"),this._nextEditProvider.handleRejection(e.docId,e.internalResult),this.handleEndOfLifetime(e)}handleIgnored(e,r){r&&e.telemetryBuilder.setSupersededBy(r.requestUuid),this._nextEditProvider.handleIgnored(e.docId,e.internalResult,r?.internalResult),this.handleEndOfLifetime(e)}handleEndOfLifetime(e){try{this._telemetrySender.sendTelemetryForBuilder(e.telemetryBuilder)}finally{e.telemetryBuilder.dispose()}}async getNextEdit(e,r){let n=b4c.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,F4c.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new S4c.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new $Fr.NextEditProviderTelemetryBuilder(new QWi.NullGitExtensionService,void 0,this._workspaceService,this._nextEditProvider.ID,c,this._debugRecorder,s.recordingBookmark);l.setOpportunityId(o.requestUuid);try{let u=await this._nextEditProvider.getNextEdit(n,o,s,r,l.nesBuilder);return{result:u.result?.edit?{newText:u.result.edit.newText,range:u.result.edit.replaceRange,...u.result.targetDocumentId?{targetDocumentUri:u.result.targetDocumentId.uri}:{}}:void 0,docId:n,requestUuid:o.requestUuid,internalResult:u,telemetryBuilder:l}}catch(u){try{this._telemetrySender.sendTelemetryForBuilder(l)}finally{l.dispose()}throw u}}updateTreatmentVariables(e){this._expService instanceof Kie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=fB.globalConfigRegistry.configs.get(`${fB.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};WFr=JFr([JN(1,zWi.IInstantiationService),JN(2,jFe.IExperimentationService),JN(3,fB.IConfigurationService),JN(4,VFr.IWorkspaceService)],WFr);function Q4c(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o,editorInfo:s,editorPluginInfo:c}=t,l=new WWi.InstantiationServiceBuilder;l.define(fB.IConfigurationService,new bi.SyncDescriptor(HTt,[t.configOverrides??new Map])),l.define(jFe.IExperimentationService,new bi.SyncDescriptor(Kie,[t.waitForTreatmentVariables])),l.define(NWi.ISimulationTestContext,new bi.SyncDescriptor(NWi.NulSimulationTestContext)),l.define(VFr.IWorkspaceService,new bi.SyncDescriptor(VFr.NullWorkspaceService)),l.define(A4c.IDiffService,new bi.SyncDescriptor(y4c.DiffServiceImpl,[!1])),l.define(ZN.ILogService,new bi.SyncDescriptor(ZN.LogServiceImpl,[[o||new ZN.ConsoleLog(void 0,ZN.LogLevel.Trace)]])),l.define(C4c.IGitExtensionService,new bi.SyncDescriptor(QWi.NullGitExtensionService)),l.define(t8r.ILanguageContextProviderService,new bi.SyncDescriptor(qWi.NullLanguageContextProviderService)),l.define(jWi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new bi.SyncDescriptor(HWi.TestLanguageDiagnosticsService)),l.define(QFe.IIgnoreService,new bi.SyncDescriptor(QFe.NullIgnoreService)),l.define(MWi.ISnippyService,new bi.SyncDescriptor(MWi.NullSnippyService)),l.define(_4c.IDomainService,new bi.SyncDescriptor(E4c.DomainService)),l.define(XFr.ICAPIClientService,new bi.SyncDescriptor(UWi.CAPIClientImpl)),l.define(kWi.ICopilotTokenStore,new bi.SyncDescriptor(kWi.CopilotTokenStore)),l.define(e9.IEnvService,new class extends v4c.NullEnvService{getEditorInfo(){return new e9.NameAndVersion(s.name,s.version)}getEditorPluginInfo(){return new e9.NameAndVersion(c.name,c.version)}}),l.define(r8r.IFetcherService,new bi.SyncDescriptor(GTt,[e])),l.define(VWi.ITelemetryService,new bi.SyncDescriptor($Tt,[n])),l.define(ZFr.IAuthenticationService,new bi.SyncDescriptor(u4c.StaticGitHubAuthenticationService,[(0,d4c.createStaticGitHubTokenProvider)()])),l.define(l4c.ICopilotTokenManager,r),l.define(wWi.IPowerService,new bi.SyncDescriptor(wWi.NullPowerService)),l.define(f4c.IChatMLFetcher,new bi.SyncDescriptor(a4c.ChatMLFetcherImpl)),l.define(DWi.IChatWebSocketManager,new bi.SyncDescriptor(DWi.NullChatWebSocketManager)),l.define(N4c.IOTelService,new P4c.NoopOTelService((0,D4c.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),l.define(p4c.IChatQuotaService,new bi.SyncDescriptor(h4c.ChatQuotaService)),l.define(PWi.IInteractionService,new bi.SyncDescriptor(PWi.InteractionService)),l.define(GWi.IRequestLogger,new bi.SyncDescriptor($Wi.NullRequestLogger)),l.define(BWi.ITokenizerProvider,t.tokenizerProvider??new bi.SyncDescriptor(BWi.TokenizerProvider,[!1])),l.define(m4c.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),l.define(M4c.IProxyModelsService,new bi.SyncDescriptor(O4c.ProxyModelsService)),l.define(HFr.IInlineEditsModelService,new bi.SyncDescriptor(w4c.InlineEditsModelService)),l.define(HFr.IUndesiredModelsManager,t.undesiredModelsManager||new bi.SyncDescriptor(HFr.NullUndesiredModelsManager)),l.define(LWi.ITerminalService,t.terminalService||new bi.SyncDescriptor(LWi.NullTerminalService)),l.define(RWi.ISimilarFilesContextService,new bi.SyncDescriptor(RWi.NullSimilarFilesContextService)),l.define(e8r.IEndpointProvider,new zFr);let u=new dC.InMemoryConfigProvider(new dC.DefaultsOnlyConfigProvider);return t.configOverrides&&u.setOverrides(t.configOverrides),l.define(dC.ICompletionsConfigProvider,u),l.seal()}a(Q4c,"setupServices");var HTt=class extends g4c.DefaultsOnlyConfigurationService{static{a(this,"OverridableConfigurationService")}constructor(e){super(),this._overrides=e}async setConfig(e,r,n){if(this._overrides.get(e.id)===r)return;r===void 0?this._overrides.delete(e.id):this._overrides.set(e.id,r);let s=e.fullyQualifiedId;this._onDidChangeConfiguration.fire({affectsConfiguration:a(c=>s===c||s.startsWith(c+".")||c.startsWith(s+"."),"affectsConfiguration")})}getConfig(e){if(this._overrides.has(e.id)){let r=this._overrides.get(e.id);if(e.validator){let n=e.validator.validate(r);return n.error?super.getConfig(e):n.content}return r}return super.getConfig(e)}getExperimentBasedConfig(e,r){if(this._overrides.has(e.id)){let n=this._overrides.get(e.id);if(e.validator){let o=e.validator.validate(n);return o.error?super.getExperimentBasedConfig(e,r):o.content}return n}return super.getExperimentBasedConfig(e,r)}inspectConfig(e){if(this._overrides.has(e.id)){let r=this._overrides.get(e.id);if(e.validator){let n=e.validator.validate(r);return n.error?super.inspectConfig(e):{defaultValue:n.content}}return{defaultValue:r}}return super.inspectConfig(e)}},zFr=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=qFe.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},Kie=class extends VTt.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new qFe.Emitter),this.onDidTreatmentsChange=this._onDidTreatmentsChange.event,e){let n;this.waitFor=new Promise(o=>{n=o}),this.resolveWaitFor=n}else this.waitFor=Promise.resolve(),this.resolveWaitFor=()=>{}}async hasTreatments(){return this.waitFor}getTreatmentVariable(e){return this.variables[e]}async setCompletionsFilters(e){}updateTreatmentVariables(e){let r=[];for(let[n,o]of Object.entries(e))this.variables[n]!==o&&(this.variables[n]=o,r.push(n));for(let n of Object.keys(this.variables))Object.hasOwn(e,n)||(delete this.variables[n],r.push(n));r.length>0&&(this._onDidTreatmentsChange.fire({affectedTreatmentVariables:r}),this._configurationService.updateExperimentBasedConfiguration(r)),this.resolveWaitFor()}};fu.SimpleExperimentationService=Kie;fu.SimpleExperimentationService=Kie=JFr([JN(1,fB.IConfigurationService)],Kie);var GTt=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=qFe.Event.None,this.onDidCompleteFetch=qFe.Event.None}fetchWithPagination(e,r){return this._fetcher.fetchWithPagination(e,r)}getUserAgentLibrary(){return this._fetcher.getUserAgentLibrary()}fetch(e,r){return this._fetcher.fetch(e,r)}createWebSocket(e,r){return{webSocket:new WebSocket(e,r),responseHeaders:new r8r.HeadersImpl({}),responseStatusCode:void 0,responseStatusText:void 0,networkError:void 0}}disconnectAll(){return this._fetcher.disconnectAll()}makeAbortController(){return this._fetcher.makeAbortController()}isAbortError(e){return this._fetcher.isAbortError(e)}isInternetDisconnectedError(e){return this._fetcher.isInternetDisconnectedError(e)}isFetcherError(e){return this._fetcher.isFetcherError(e)}isNetworkProcessCrashedError(e){return this._fetcher.isNetworkProcessCrashedError(e)}getUserMessageForFetcherError(e){return this._fetcher.getUserMessageForFetcherError(e)}},$Tt=class{static{a(this,"SimpleTelemetryService")}constructor(e){this._telemetrySender=e}dispose(){}sendInternalMSFTTelemetryEvent(e,r,n){}sendMSFTTelemetryEvent(e,r,n){}sendMSFTTelemetryErrorEvent(e,r,n){}sendGHTelemetryEvent(e,r,n){this._telemetrySender.sendTelemetryEvent(e,(0,OWi.eventPropertiesToSimpleObject)(r),n)}sendGHTelemetryErrorEvent(e,r,n){}sendGHTelemetryException(e,r){}sendTelemetryEvent(e,r,n,o){}sendTelemetryErrorEvent(e,r,n,o){}setSharedProperty(e,r){}setAdditionalExpAssignments(e){}postEvent(e,r){}sendEnhancedGHTelemetryEvent(e,r,n){this._telemetrySender.sendEnhancedTelemetryEvent&&this._telemetrySender.sendEnhancedTelemetryEvent(e,(0,OWi.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function q4c(t){return t.tokenizerProvider&&(0,FWi.setExternalTokenizerProvider)(t.tokenizerProvider),j4c(t).createInstance(YFr)}a(q4c,"createInlineCompletionsProvider");var YFr=class extends VTt.Disposable{static{a(this,"InlineCompletionsProvider")}constructor(e,r,n,o,s,c){super(),this._insta=e,this._expService=r,this._speculativeRequestCache=n,this._logService=o,this._configurationService=s,this._completionsConfigProvider=c,this._register(e),this.ghostText=this._insta.createInstance(X5c.GhostText)}updateTreatmentVariables(e){this._expService instanceof Kie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=fB.globalConfigRegistry.configs.get(`${fB.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}this._completionsConfigProvider instanceof dC.InMemoryConfigProvider&&this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(e))}async getInlineCompletions(e,r,n,o){let s=new $Fr.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??B4c.CancellationToken.None,o,new W5c.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};YFr=JFr([JN(0,zWi.IInstantiationService),JN(1,jFe.IExperimentationService),JN(2,GFr.ICompletionsSpeculativeRequestCache),JN(3,ZN.ILogService),JN(4,fB.IConfigurationService),JN(5,dC.ICompletionsConfigProvider)],YFr);var KFr=class{static{a(this,"UnwrappingTelemetrySender")}constructor(e){this.sender=e}sendTelemetryEvent(e,r,n){this.sender.sendTelemetryEvent(this.normalizeEventName(e),r,n)}sendEnhancedTelemetryEvent(e,r,n){this.sender.sendEnhancedTelemetryEvent&&this.sender.sendEnhancedTelemetryEvent(this.normalizeEventName(e),r,n)}normalizeEventName(e){let r=(0,L4c.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function j4c(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new ZN.ConsoleLog(void 0,ZN.LogLevel.Trace),f=new WWi.InstantiationServiceBuilder;f.define(FFe.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case FFe.LogLevel.DEBUG:return Yie.Debug;case FFe.LogLevel.INFO:return Yie.Info;case FFe.LogLevel.WARN:return Yie.Warning;case FFe.LogLevel.ERROR:return Yie.Error;default:return Yie.Info}}}),f.define(ZFr.IAuthenticationService,r),f.define(ZN.ILogService,new bi.SyncDescriptor(ZN.LogServiceImpl,[[d||new ZN.ConsoleLog(void 0,ZN.LogLevel.Trace)]])),f.define(QFe.IIgnoreService,t.ignoreService||new QFe.NullIgnoreService),f.define(VWi.ITelemetryService,new bi.SyncDescriptor($Tt,[new KFr(c)])),f.define(fB.IConfigurationService,new bi.SyncDescriptor(HTt,[t.configOverrides??new Map])),f.define(jFe.IExperimentationService,new bi.SyncDescriptor(Kie,[t.waitForTreatmentVariables])),f.define(e8r.IEndpointProvider,t.endpointProvider),f.define(XFr.ICAPIClientService,t.capiClientService||new bi.SyncDescriptor(UWi.CAPIClientImpl)),f.define(r8r.IFetcherService,new bi.SyncDescriptor(GTt,[e])),f.define(sWi.ICompletionsTelemetryService,new bi.SyncDescriptor(sWi.CompletionsTelemetryServiceBridge)),f.define(xWi.ICompletionsRuntimeModeService,xWi.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(pWi.ICompletionsCacheService,new pWi.CompletionsCache);let h=new dC.InMemoryConfigProvider(new dC.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define(dC.ICompletionsConfigProvider,h),f.define(gWi.ICompletionsLastGhostText,new gWi.LastGhostText),f.define(mWi.ICompletionsCurrentGhostText,new mWi.CurrentGhostText),f.define(GFr.ICompletionsSpeculativeRequestCache,new GFr.SpeculativeRequestCache),f.define(r4c.ICompletionsNotificationSender,new class{async showWarningMessage(m,...g){return await t.notificationSender.showWarningMessage(m,...g)}}),f.define(dC.ICompletionsEditorAndPluginInfo,new class{getEditorInfo(){return t.editorInfo}getEditorPluginInfo(){return t.editorPluginInfo}getRelatedPluginInfo(){return t.relatedPluginInfo}}),f.define(aWi.ICompletionsExtensionStatus,new aWi.CopilotExtensionStatus),f.define(J5c.ICompletionsFeaturesService,new bi.SyncDescriptor(K5c.Features)),f.define(Y5c.ICompletionsObservableWorkspace,new class{get openDocuments(){return s.openDocuments}getWorkspaceRoot(m){return s.getWorkspaceRoot(m)}getFirstOpenDocument(){return s.getFirstOpenDocument()}getDocument(m){return s.getDocument(m)}}),f.define(_Wi.ICompletionsStatusReporter,new class extends _Wi.StatusReporter{didChange(m){n.didChange(m)}}),f.define(cWi.ICompletionsCopilotTokenManager,new bi.SyncDescriptor(cWi.CopilotTokenManagerImpl,[!1])),f.define(TWi.ICompletionsTextDocumentManagerService,new bi.SyncDescriptor(class extends TWi.TextDocumentManager{constructor(){super(...arguments),this.onDidChangeTextDocument=o.onDidChangeTextDocument,this.onDidOpenTextDocument=o.onDidOpenTextDocument,this.onDidCloseTextDocument=o.onDidCloseTextDocument,this.onDidFocusTextDocument=o.onDidFocusTextDocument,this.onDidChangeWorkspaceFolders=o.onDidChangeWorkspaceFolders}getTextDocumentsUnsafe(){return o.getTextDocumentsUnsafe()}findNotebook(m){return o.findNotebook(m)}getWorkspaceFolders(){return o.getWorkspaceFolders()}})),f.define(dWi.ICompletionsFileReaderService,new bi.SyncDescriptor(dWi.FileReader)),f.define(hWi.ICompletionsBlockModeConfig,new bi.SyncDescriptor(hWi.ConfigBlockModeConfig)),f.define(SWi.ICompletionsTelemetryUserConfigService,new bi.SyncDescriptor(SWi.TelemetryUserConfig)),f.define(bWi.ICompletionsRecentEditsProviderService,new bi.SyncDescriptor(bWi.FullRecentEditsProvider,[void 0])),f.define(lWi.ICompletionsNotifierService,new bi.SyncDescriptor(lWi.CompletionNotifier)),f.define(AWi.ICompletionsOpenAIFetcherService,new bi.SyncDescriptor(AWi.LiveOpenAIFetcher)),f.define(R4c.ICompletionsFetchService,new bi.SyncDescriptor(k4c.CompletionsFetchService)),f.define(yWi.ICompletionsModelManagerService,new bi.SyncDescriptor(yWi.AvailableModelsManager,[!0])),f.define(fWi.ICompletionsAsyncManagerService,new bi.SyncDescriptor(fWi.AsyncCompletionManager)),f.define(vWi.ICompletionsContextProviderBridgeService,new bi.SyncDescriptor(vWi.ContextProviderBridge)),f.define(uWi.ICompletionsUserErrorNotifierService,new bi.SyncDescriptor(uWi.UserErrorNotifier)),f.define(i4c.ICompletionsRelatedFilesProviderService,new bi.SyncDescriptor(n4c.CompositeRelatedFilesProvider)),f.define(Z5c.ICompletionsFileSystemService,new e4c.LocalFileSystem),f.define(UFe.ICompletionsContextProviderRegistryService,new bi.SyncDescriptor(UFe.CachedContextProviderRegistry,[UFe.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(IWi.ICompletionsPromiseQueueService,new IWi.PromiseQueue),f.define(z5c.ICompletionsCitationManager,new class{register(){return VTt.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define(CWi.ICompletionsContextProviderService,new CWi.ContextProviderStatistics),f.define(EWi.ICompletionsPromptFactoryService,new bi.SyncDescriptor(EWi.CompletionsPromptFactory)),f.define(t4c.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(UFe.ICompletionsDefaultContextProviders,new UFe.DefaultContextProvidersContainer),f.define(e9.IEnvService,new class{constructor(){this.language=void 0,this.sessionId=u.sessionId,this.machineId=u.machineId,this.devDeviceId=u.machineId,this.vscodeVersion=t.editorInfo.version,this.isActive=!0,this.onDidChangeWindowState=qFe.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?e9.OperatingSystem.Macintosh:process.platform==="win32"?e9.OperatingSystem.Windows:e9.OperatingSystem.Linux,this.uriScheme="",this.extensionId=t.editorPluginInfo.name,this.appRoot=t.editorInfo.root??"",this.shell=""}isProduction(){return dC.BuildInfo.isProduction()}isPreRelease(){return dC.BuildInfo.isPreRelease()}isSimulation(){return t.isRunningInTest===!0}getBuildType(){return dC.BuildInfo.getBuildType()===dC.BuildType.DEV?"dev":"prod"}getVersion(){return dC.BuildInfo.getVersion()}getBuild(){return dC.BuildInfo.getBuild()}getName(){return t.editorInfo.name}getEditorInfo(){return new e9.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new e9.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(t8r.ILanguageContextProviderService,t.languageContextProvider??new qWi.NullLanguageContextProviderService),f.define(jWi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new bi.SyncDescriptor(HWi.TestLanguageDiagnosticsService)),f.define(GWi.IRequestLogger,new bi.SyncDescriptor($Wi.NullRequestLogger)),f.seal()}a(j4c,"setupCompletionServices")});function qt(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r}function Ie(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var WS=Se(()=>{p();a(qt,"__classPrivateFieldSet");a(Ie,"__classPrivateFieldGet")});var JEe,yIt=Se(()=>{p();JEe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return JEe=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))},"uuid4")});function s9(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var ZFe,ZEe=Se(()=>{p();a(s9,"isAbortError");ZFe=a(t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)},"castToError")});var mr,Fh,qy,_W,XEe,eve,tve,rve,nve,ive,ove,sve,ave,Wf=Se(()=>{p();ZEe();mr=class extends Error{static{a(this,"AnthropicError")}},Fh=class t extends mr{static{a(this,"APIError")}constructor(e,r,n,o,s){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("request-id"),this.error=r,this.type=s??null}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new _W({message:n,cause:ZFe(r)});let s=r,c=s?.error?.type;return e===400?new eve(e,s,n,o,c):e===401?new tve(e,s,n,o,c):e===403?new rve(e,s,n,o,c):e===404?new nve(e,s,n,o,c):e===409?new ive(e,s,n,o,c):e===422?new ove(e,s,n,o,c):e===429?new sve(e,s,n,o,c):e>=500?new ave(e,s,n,o,c):new t(e,s,n,o,c)}},qy=class extends Fh{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},_W=class extends Fh{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},XEe=class extends _W{static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},eve=class extends Fh{static{a(this,"BadRequestError")}},tve=class extends Fh{static{a(this,"AuthenticationError")}},rve=class extends Fh{static{a(this,"PermissionDeniedError")}},nve=class extends Fh{static{a(this,"NotFoundError")}},ive=class extends Fh{static{a(this,"ConflictError")}},ove=class extends Fh{static{a(this,"UnprocessableEntityError")}},sve=class extends Fh{static{a(this,"RateLimitError")}},ave=class extends Fh{static{a(this,"InternalServerError")}}});function _It(t){return typeof t!="object"?{}:t??{}}function Y8r(t){if(!t)return!0;for(let e in t)return!1;return!0}function RYi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var aFc,wYi,yE,z8r,kYi,EIt,hB=Se(()=>{p();Wf();aFc=/^[a-z][a-z0-9+.-]*:/i,wYi=a(t=>aFc.test(t),"isAbsoluteURL"),yE=a(t=>(yE=Array.isArray,yE(t)),"isArray"),z8r=yE;a(_It,"maybeObj");a(Y8r,"isEmptyObj");a(RYi,"hasOwn");kYi=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new mr(`${t} must be an integer`);if(e<0)throw new mr(`${t} must be a positive integer`);return e},"validatePositiveInteger"),EIt=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var nM,cve=Se(()=>{p();nM=a((t,e)=>new Promise(r=>{if(e?.aborted)return r();let n=a(()=>{clearTimeout(o),r()},"onAbort"),o=setTimeout(()=>{e?.removeEventListener("abort",n),r()},t);e?.addEventListener("abort",n,{once:!0})}),"sleep")});var kk,XFe=Se(()=>{p();kk="0.98.0"});function cFc(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function uFc(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,s=n[2]||0,c=n[3]||0;return{browser:e,version:`${o}.${s}.${c}`}}}return null}var MYi,lFc,PYi,DYi,NYi,e8e,vIt=Se(()=>{p();XFe();MYi=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a(cFc,"getDetectedPlatform");lFc=a(()=>{let t=cFc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kk,"X-Stainless-OS":DYi(Deno.build.os),"X-Stainless-Arch":PYi(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kk,"X-Stainless-OS":DYi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":PYi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=uFc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(uFc,"getBrowserInfo");PYi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),DYi=a(t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),"normalizePlatform"),e8e=a(()=>NYi??(NYi=lFc()),"getPlatformHeaders")});function OYi(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function K8r(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function CIt(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return K8r({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function t8e(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function LYi(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}var lve=Se(()=>{p();a(OYi,"getDefaultFetch");a(K8r,"makeReadableStream");a(CIt,"ReadableStreamFrom");a(t8e,"ReadableStreamToAsyncIterable");a(LYi,"CancelReadableStream")});var BYi,FYi=Se(()=>{p();BYi=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var J8r,Z8r,X8r,UYi,e6r=Se(()=>{p();J8r="RFC3986",Z8r=a(t=>String(t),"default_formatter"),X8r={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:Z8r},UYi="RFC1738"});function qYi(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function r6r(t,e){if(yE(t)){let r=[];for(let n=0;n{p();e6r();hB();bIt=a((t,e)=>(bIt=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),bIt(t,e)),"has"),mB=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),t6r=1024,QYi=a((t,e,r,n,o)=>{if(t.length===0)return t;let s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});let c="";for(let l=0;l=t6r?s.slice(l,l+t6r):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===UYi&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=mB[h];continue}if(h<2048){d[d.length]=mB[192|h>>6]+mB[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=mB[224|h>>12]+mB[128|h>>6&63]+mB[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=mB[240|h>>18]+mB[128|h>>12&63]+mB[128|h>>6&63]+mB[128|h&63]}c+=d.join("")}return c},"encode");a(qYi,"is_buffer");a(r6r,"maybe_map")});function pFc(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function VYi(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E){let v=t,S=E,T=0,w=!1;for(;(S=S.get(n6r))!==void 0&&!w;){let N=S.get(t);if(T+=1,typeof N<"u"){if(N===T)throw new RangeError("Cyclic object value");w=!0}typeof S.get(n6r)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&yE(v)&&(v=r6r(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,$g.encoder,_,"key",g):e;v=""}if(pFc(v)||qYi(v)){if(u){let N=y?e:u(e,$g.encoder,_,"key",g);return[A?.(N)+"="+A?.(u(v,$g.encoder,_,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&yE(v))y&&u&&(v=r6r(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if(yE(d))x=d;else{let N=Object.keys(v);x=f?N.sort(f):N}let k=l?String(e).replace(/\./g,"%2E"):String(e),D=n&&yE(v)&&v.length===1?k+"[]":k;if(o&&yE(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:$g.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:$g.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:$g.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:$g.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?$g.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:$g.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:$g.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:$g.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:$g.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:$g.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:$g.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:$g.strictNullHandling}}function WYi(t,e={}){let r=t,n=hFc(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):yE(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=GYi[n.arrayFormat],u=l==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);let d=new WeakMap;for(let m=0;m0?h+f:""}var GYi,$Yi,HYi,$g,n6r,zYi=Se(()=>{p();jYi();e6r();hB();GYi={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},$Yi=a(function(t,e){Array.prototype.push.apply(t,yE(e)?e:[e])},"push_to_array"),$g={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:QYi,encodeValuesOnly:!1,format:J8r,formatter:Z8r,indices:!1,serializeDate(t){return(HYi??(HYi=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(pFc,"is_non_nullish_primitive");n6r={};a(VYi,"inner_stringify");a(hFc,"normalize_stringify_options");a(WYi,"stringify")});function YYi(t){return WYi(t,{arrayFormat:"brackets"})}var i6r=Se(()=>{p();zYi();a(YYi,"stringifyQuery")});function TIt(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new ol(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new ol(`Refusing to send credential over non-https token endpoint "${t}"`)}async function IIt(t,e){let r=await AFc(t),n;try{n=JSON.parse(r)}catch{throw new ol(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,zS(r),e)}if(!n.access_token)throw new ol(`Token endpoint response missing access_token: ${JSON.stringify(zS(n))}`,t.status,zS(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new ol(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,zS(n),e);return n}function zS(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=o6r?t:t.slice(0,o6r)+`... <${t.length-o6r} more chars>`}return JSON.stringify(zS(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))gFc.has(r)&&(e[r]=n);return e}return null}async function xIt(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new ol(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new ol(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function wIt(t,e){let r=await import("node:fs"),o=(await import("node:path")).dirname(t);await r.promises.mkdir(o,{recursive:!0,mode:448});let s=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let c=await r.promises.open(s,"w",384);try{await c.writeFile(JSON.stringify(e,null,2)),await c.sync()}finally{await c.close()}await r.promises.rename(s,t)}catch(c){throw await r.promises.unlink(s).catch(()=>{}),c}try{let c=await r.promises.open(o,"r");try{await c.sync()}finally{await c.close()}}catch{}}async function AFc(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:s,value:c}=await e.read();if(s)break;if(n+c.length>KYi){let l=KYi-n;l>0&&r.push(c.subarray(0,l)),await e.cancel();break}r.push(c),n+=c.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((c,l)=>c+l.length,0));let s=0;for(let c of r)o.set(c,s),s+=c.length}return new TextDecoder("utf-8").decode(o)}var JYi,ZYi,SIt,ioe,XYi,eKi,uve,tKi,KYi,o6r,gFc,ol,dve=Se(()=>{p();Wf();JYi="urn:ietf:params:oauth:grant-type:jwt-bearer",ZYi="refresh_token",SIt="/v1/oauth/token",ioe="oauth-2025-04-20",XYi="oidc-federation-2026-04-01",eKi=120,uve=30,tKi=5,KYi=1<<20;a(TIt,"requireSecureTokenEndpoint");a(IIt,"parseTokenResponse");o6r=2e3,gFc=new Set(["error","error_description","error_uri"]);a(zS,"redactSensitive");a(xIt,"checkCredentialsFileSafety");a(wIt,"writeCredentialsFileAtomic");a(AFc,"readLimitedText");ol=class extends mr{static{a(this,"WorkloadIdentityError")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}}});function iM(){return Math.floor(Date.now()/1e3)}var r8e=Se(()=>{p();a(iM,"nowAsSeconds")});var RIt,rKi=Se(()=>{p();dve();r8e();RIt=class{static{a(this,"TokenCache")}constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-iM();return n>eKi?r.token:n>uve?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||iM()-this.lastAdvisoryError{this.lastAdvisoryError=iM(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}}});var wa,n8e=Se(()=>{p();wa=a(t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0},"readEnv")});function oKi(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function fve(t){let e;return(nKi??(e=new globalThis.TextEncoder,nKi=e.encode.bind(e)))(t)}function s6r(t){let e;return(iKi??(e=new globalThis.TextDecoder,iKi=e.decode.bind(e)))(t)}var nKi,iKi,kIt=Se(()=>{p();a(oKi,"concatBytes");a(fve,"encodeUTF8");a(s6r,"decodeUTF8")});var sKi=Se(()=>{p();Wf();kIt()});function i8e(){}function PIt(t,e,r){return!e||DIt[t]>DIt[r]?i8e:e[t].bind(e)}function xl(t){let e=t.logger,r=t.logLevel??"off";if(!e)return yFc;let n=aKi.get(e);if(n&&n[0]===r)return n[1];let o={error:PIt("error",e,r),warn:PIt("warn",e,r),info:PIt("info",e,r),debug:PIt("debug",e,r)};return aKi.set(e,[r,o]),o}var DIt,a6r,yFc,aKi,a9,c9=Se(()=>{p();hB();DIt={off:0,error:200,warn:300,info:400,debug:500},a6r=a((t,e,r)=>{if(t){if(RYi(DIt,t))return t;xl(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(DIt))}`)}},"parseLogLevel");a(i8e,"noop");a(PIt,"makeLogFn");yFc={error:i8e,warn:i8e,info:i8e,debug:i8e},aKi=new WeakMap;a(xl,"loggerFor");a9=a(t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t),"formatRequestDetails")});var c6r=Se(()=>{p();hB();sKi();n8e();c9();yIt();cve();i6r()});function cKi(t){if(!t)throw new Error("profile name is empty");if(t==="."||t==="..")throw new Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw new Error(`profile name "${t}" must not contain path separators`);if(!_Fc.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var NIt,_Fc,lKi,uKi,l6r,EFc,dKi,u6r=Se(()=>{p();vIt();c6r();NIt="1.0",_Fc=/^[A-Za-z0-9_.-]+$/;a(cKi,"validateProfileName");lKi=a(async t=>{var e,r;let n=await l6r();if(n===null)return null;let o=t??await dKi();if(o===null)return null;cKi(o);let s=await import("node:fs"),l=(await import("node:path")).join(n,"configs",`${o}.json`),u;try{u=await s.promises.readFile(l,"utf-8")}catch(h){if(h?.code!=="ENOENT")throw new Error(`failed to read config file ${l}: ${h}`);u=null}if(u===null){let h=wa("ANTHROPIC_ORGANIZATION_ID"),m=wa("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=wa("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:wa("ANTHROPIC_WORKSPACE_ID"),base_url:wa("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:wa("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:wa("ANTHROPIC_SCOPE")}}}:null}let d;try{d=JSON.parse(u)}catch(h){throw new Error(`failed to parse config file ${l}: ${h}`)}if(!d.authentication)throw new Error(`config file ${l} is missing "authentication"`);let f=d.authentication.type;if(f!=="oidc_federation"&&f!=="user_oauth")throw new Error(`authentication.type "${f}" is not a known authentication type`);if(d.organization_id??(d.organization_id=wa("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=wa("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=wa("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=wa("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=wa("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=wa("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=wa("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),uKi=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await l6r();if(!r)return null;let n=e??await dKi();return n?(cKi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),l6r=a(async()=>{if(!EFc())return null;let t=await import("node:path"),e=wa("ANTHROPIC_CONFIG_DIR");if(e)return e;if(e8e()["X-Stainless-OS"]==="Windows"){let s=wa("APPDATA");if(s)return t.join(s,"Anthropic");let c=wa("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=wa("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=wa("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),EFc=a(()=>{let t=e8e()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),dKi=a(async()=>{let t=await l6r();if(!t)return null;let e=wa("ANTHROPIC_PROFILE");if(e)return e;let r=await import("node:fs"),o=(await import("node:path")).join(t,"active_config");try{return(await r.promises.readFile(o,"utf-8")).trim()||"default"}catch(s){if(s?.code!=="ENOENT")throw new Error(`failed to read ${o}: ${s}`);return"default"}},"getActiveProfileName")});function d6r(t){if(!t)throw new mr("Identity token file path is empty");return async()=>{let e=await import("node:fs"),r;try{r=await e.promises.readFile(t,"utf-8")}catch(o){throw new mr(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new mr(`Identity token file at ${t} is empty`);return n}}function fKi(t){if(!t)throw new mr("Identity token value is empty");return()=>t}var pKi=Se(()=>{p();Wf();a(d6r,"identityTokenFromFile");a(fKi,"identityTokenFromValue")});function hKi(t){return async()=>{TIt(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new ol(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:JYi,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${SIt}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${ioe},${XYi}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${kk} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new ol(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=zS(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new ol(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await IIt(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new ol(`Token endpoint response missing required fields: ${JSON.stringify(zS(c))}`,o.status,zS(c),s);return{token:c.access_token,expiresAt:iM()+l}}}var mKi=Se(()=>{p();dve();r8e();XFe();a(hKi,"oidcFederationProvider")});function gKi(t){return async e=>{let r=await import("node:fs");await xIt(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(_){throw new ol(`Credentials file not found at ${t.credentialsPath}: ${_}`)}let o;try{o=JSON.parse(n)}catch(_){throw new ol(`Credentials file at ${t.credentialsPath} is not valid JSON: ${_}`)}let s=o.access_token;if(!s)throw new ol(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||iM()"");throw new ol(`User OAuth refresh failed (HTTP ${f.status}): ${zS(_)}`,f.status,zS(_),h)}let m=await IIt(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new ol(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(zS(m))}`,f.status,zS(m),h);let A=iM()+g,y=m.refresh_token||l;return await wIt(t.credentialsPath,{...o,version:NIt,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var AKi=Se(()=>{p();u6r();dve();r8e();XFe();a(gKi,"userOAuthProvider")});function f6r(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=vFc(t,r,n,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:o,extraHeaders:s,baseURL:t.base_url||void 0}}async function yKi(t,e){let r=await lKi(e);if(!r)return null;let{config:n,fromFile:o}=r,s=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await uKi(n,e)??void 0}};return f6r(s,t)}function vFc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=CFc(o);if(!s)throw new ol("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new ol("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new ol("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=hKi({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:t.organization_id,serviceAccountId:o.service_account_id,workspaceId:t.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});return e?bFc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new ol("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return gKi({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new ol(`authentication.type "${o}" is not a known authentication type`)}}}function CFc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new ol(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new ol('identity_token.source "file" requires a non-empty path');return d6r(t.identity_token.path)}let e=wa("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return d6r(e);let r=wa("ANTHROPIC_IDENTITY_TOKEN");return r?fKi(r):null}function bFc(t,e,r,n){return async o=>{let s=await import("node:fs");await xIt(e,n);let c;try{let u=await s.promises.readFile(e,"utf-8");c=JSON.parse(u);let d=c?.access_token;if(d&&!o?.forceRefresh){let f=c?.expires_at;if(f==null||iM(){p();n8e();u6r();dve();r8e();pKi();mKi();AKi();a(f6r,"resolveCredentialsFromConfig");a(yKi,"defaultCredentials");a(vFc,"buildProvider");a(CFc,"resolveIdentityTokenProvider");a(bFc,"cachedExchangeProvider")});function SFc(t,e){for(let o=e??0;o{p();WS();kIt();l9=class{static{a(this,"LineDecoder")}constructor(){$I.set(this,void 0),VI.set(this,void 0),qt(this,$I,new Uint8Array,"f"),qt(this,VI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?fve(e):e;qt(this,$I,oKi([Ie(this,$I,"f"),r]),"f");let n=[],o;for(;(o=SFc(Ie(this,$I,"f"),Ie(this,VI,"f")))!=null;){if(o.carriage&&Ie(this,VI,"f")==null){qt(this,VI,o.index,"f");continue}if(Ie(this,VI,"f")!=null&&(o.index!==Ie(this,VI,"f")+1||o.carriage)){n.push(s6r(Ie(this,$I,"f").subarray(0,Ie(this,VI,"f")-1))),qt(this,$I,Ie(this,$I,"f").subarray(Ie(this,VI,"f")),"f"),qt(this,VI,null,"f");continue}let s=Ie(this,VI,"f")!==null?o.preceding-1:o.preceding,c=s6r(Ie(this,$I,"f").subarray(0,s));n.push(c),qt(this,$I,Ie(this,$I,"f").subarray(o.index),"f"),qt(this,VI,null,"f")}return n}flush(){return Ie(this,$I,"f").length?this.decode(` + `,u=[],d=null,f=!0;for(;f;){let m=await REe(t,e,r,n,l,o,{owner:s,name:c,first:100,after:d},"github-graphql-assignable-users");if(!m?.data?.repository?.assignableUsers)break;let g=m.data.repository.assignableUsers;u.push(...g.nodes),f=g.pageInfo.hasNextPage,d=g.pageInfo.endCursor}return u}a(DMc,"getAssignableActorsWithAssignableUsers")});var nVi=I(Rk=>{"use strict";p();Object.defineProperty(Rk,"__esModule",{value:!0});Rk.BaseOctoKitService=Rk.PermissiveAuthRequiredError=Rk.VSCodeTeamId=Rk.IOctoKitService=Rk.IGithubRepositoryService=void 0;var rVi=an(),tVi=Z$(),VN=eVi();Rk.IGithubRepositoryService=(0,rVi.createServiceIdentifier)("IGithubRepositoryService");Rk.IOctoKitService=(0,rVi.createServiceIdentifier)("IOctoKitService");Rk.VSCodeTeamId=1682102;var tFr=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};Rk.PermissiveAuthRequiredError=tFr;var rFr=class t{static{a(this,"BaseOctoKitService")}static{this._outageStatusCacheTTL=300*1e3}static{this._userReposScopeCacheTTL=300*1e3}constructor(e,r,n,o){this._capiClientService=e,this._fetcherService=r,this._logService=n,this._telemetryService=o}async getCurrentAuthedUserWithToken(e){return this._makeGHAPIRequest("user","GET",e,void 0,void 0,"github-rest-get-user")}async getGitHubOutageStatus(){let e=Date.now();if(this._cachedOutageStatus&&e-this._cachedOutageStatus.timestampl.headRefName===n)}async addPullRequestCommentWithToken(e,r,n){return(0,VN.addPullRequestCommentGraphQLRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,n,e,r)}async createPullRequestWithToken(e,r,n,o,s,c,l,u){let d=await this._makeGHAPIRequest(`repos/${e}/${r}/pulls`,"POST",u,{title:n,body:o,head:s,base:c,draft:l});if(!d?.html_url||typeof d.number!="number")throw new Error(`Failed to create pull request for ${e}/${r}`);return{url:d.html_url,number:d.number}}async getPullRequestFromSessionWithToken(e,r){return(0,VN.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,VN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repos/${e}/${r}/pulls/${n}/files`,"GET",o,{version:"2022-11-28",callSite:"github-rest-get-pr-files"})||[]}async compareCommitsWithToken(e,r,n,o,s){let c=`repos/${e}/${r}/compare/${n}...${o}`,l=await(0,VN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,c,"GET",s,{version:"2022-11-28",callSite:"github-rest-compare-commits"});if(!l)return;let u=l,d=u.merge_base_commit?.sha??u.base_commit?.sha??n,f=u.commits?.[u.commits.length-1]?.sha??o;return{baseSha:d,headSha:f,files:u.files??[]}}async getRepositoryByIdWithToken(e,r){let n=await(0,VN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repositories/${e}`,"GET",r,{version:"2022-11-28",callSite:"github-rest-get-repository-by-id"});if(!n)return;let o=n;if(o.owner?.login&&o.name)return{owner:o.owner.login,name:o.name};if(o.full_name){let[s,c]=o.full_name.split("/");if(s&&c)return{owner:s,name:c}}}async closePullRequestWithToken(e,r,n,o){return(0,VN.closePullRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,o,e,r,n)}async getFileContentWithToken(e,r,n,o,s){let c=`repos/${e}/${r}/contents/${o}?ref=${encodeURIComponent(n)}`,l=await(0,VN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,c,"GET",s,{callSite:"github-rest-get-file-content"});if(!l||Array.isArray(l))throw new Error("Unable to fetch file content");let u=l;if(u.content&&u.encoding==="base64")return(0,tVi.decodeBase64)(u.content.replace(/\n/g,"")).toString();if(u.sha){let d=await this.getBlobContentWithToken(e,r,u.sha,s);if(d)return d}return this._logService.error(`Failed to get file content for ${e}/${r}/${o} at ref ${n}`),""}async getUserOrganizationsWithToken(e,r=100){let n=await this._makeGHAPIRequest(`user/orgs?per_page=${r}`,"GET",e,void 0,void 0,"github-rest-get-user-orgs");return!n||!Array.isArray(n)?[]:n.map(o=>o.login)}async isUserMemberOfOrgWithToken(e,r){try{let n=await this._makeGHAPIRequest(`user/memberships/orgs/${encodeURIComponent(e)}`,"GET",r,void 0,void 0,"github-rest-check-org-membership");return n&&(n.state==="active"||n.state==="pending")}catch{return!1}}async getOrganizationRepositoriesWithToken(e,r,n=100){let o=await this._makeGHAPIRequest(`orgs/${e}/repos?per_page=${n}&sort=updated`,"GET",r,void 0,{silent404:!0},"github-rest-get-org-repos");return!o||!Array.isArray(o)||o.length===0?[]:o.map(s=>s.name)}async getUserRepositoriesWithToken(e,r){let n=r?.trim();if(n)return this.searchUserRepositoriesWithToken(e,n);let o=await this._makeGHAPIRequest("user/repos?per_page=100&sort=updated&affiliation=owner,collaborator,organization_member","GET",e,void 0,void 0,"github-rest-get-user-repos");return!o||!Array.isArray(o)?[]:o.filter(s=>s.permissions?.push).map(s=>({owner:s.owner.login,name:s.name}))}async searchUserRepositoriesWithToken(e,r){let n=await this._getUserReposSearchScope(e);if(!n)return[];let o=encodeURIComponent(`${r} in:name fork:true ${n}`),s=await this._makeGHAPIRequest(`search/repositories?q=${o}&sort=updated&per_page=100`,"GET",e,void 0,void 0,"github-rest-search-repos");return!s||!Array.isArray(s.items)?[]:s.items.filter(c=>c.permissions?.push).map(c=>({owner:c.owner.login,name:c.name}))}async _getUserReposSearchScope(e){let r=Date.now();if(this._cachedUserReposScope&&this._cachedUserReposScope.token===e&&r-this._cachedUserReposScope.timestamp{"use strict";p();Object.defineProperty(dTt,"__esModule",{value:!0});dTt.NullBaseOctoKitService=void 0;var NMc=nVi(),nFr=class extends NMc.BaseOctoKitService{static{a(this,"NullBaseOctoKitService")}async getGitHubOutageStatus(){return 0}async getCurrentAuthedUser(){}async getCurrentAuthedUserWithToken(e){return{id:0,avatar_url:"",login:"NullUser",name:"Null User"}}async _makeGHAPIRequest(e,r,n,o,s,c){}};dTt.NullBaseOctoKitService=nFr});var cVi=I(Yl=>{"use strict";p();var yTt=Yl&&Yl.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},$u=Yl&&Yl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Yl,"__esModule",{value:!0});Yl.CopilotTokenManagerFromGitHubToken=Yl.CopilotTokenManagerFromDeviceId=Yl.RefreshableCopilotTokenManager=Yl.StaticExtendedTokenInfoCopilotTokenManager=Yl.FixedCopilotTokenManager=Yl.BaseCopilotTokenManager=Yl.tokenErrorString=void 0;Yl.createStaticGitHubTokenProvider=OMc;Yl.getOrCreateTestingCopilotTokenManager=LMc;var iFr=(_ie(),Wa(yie)),MMc=Fc(),oVi=Po(),fTt=dmt(),aVi=Hl(),_Tt=lE(),ETt=WV(),PEe=FD(),vTt=iVi(),CTt=Np(),wFe=Oy(),bTt=bh(),sVi=J_e(),VU=Kyt(),pTt=aLe();Yl.tokenErrorString='Tests: either GITHUB_PAT, GITHUB_OAUTH_TOKEN, or GITHUB_OAUTH_TOKEN+VSCODE_COPILOT_CHAT_TOKEN must be set unless running from an IS_SCENARIO_AUTOMATION environment. Run "npm run get_token" to get credentials.';function OMc(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!(PEe.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Yl.tokenErrorString)}}a(OMc,"createStaticGitHubTokenProvider");function LMc(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new fTt.SyncDescriptor(mTt,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new fTt.SyncDescriptor(ATt,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new fTt.SyncDescriptor(hTt,[process.env.GITHUB_PAT]);if(PEe.isScenarioAutomation)return new fTt.SyncDescriptor(gTt,[t]);throw new Error(Yl.tokenErrorString)}a(LMc,"getOrCreateTestingCopilotTokenManager");var kEe=class extends oVi.Disposable{static{a(this,"BaseCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(),this._baseOctokitservice=e,this._logService=r,this._telemetryService=n,this._domainService=o,this._capiClientService=s,this._fetcherService=c,this._envService=l,this._isDisposed=!1,this._copilotTokenRefreshEmitter=this._register(new MMc.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,oVi.toDisposable)(()=>this._isDisposed=!0))}get copilotToken(){return this._copilotToken}set copilotToken(e){e!==this._copilotToken&&(this._copilotToken=e,this._copilotTokenRefreshEmitter.fire())}resetCopilotToken(e){e!==void 0&&this._telemetryService.sendGHTelemetryEvent("auth.reset_token_"+e),this._logService.debug(`Resetting copilot token on HTTP error ${e||"unknown"}`),this.copilotToken=void 0}async authFromGitHubToken(e,r){return this.doAuthFromGitHubTokenOrDevDeviceId({githubToken:e,ghUsername:r})}async authFromDevDeviceId(e){return this.doAuthFromGitHubTokenOrDevDeviceId({devDeviceId:e})}async doAuthFromGitHubTokenOrDevDeviceId(e){this._telemetryService.sendGHTelemetryEvent("auth.new_login");let r,n,o;try{"githubToken"in e?(o=e.ghUsername,[r,n]=await Promise.all([this.fetchCopilotTokenFromGitHubToken(e.githubToken),this.fetchCopilotUserInfo(e.githubToken)])):r=await this.fetchCopilotTokenFromDevDeviceId(e.devDeviceId)}catch(f){return this._logService.warn("Failed to get copilot token due to fetch throwing: "+(f.message||String(f))),{kind:"failure",reason:"RequestFailed",message:f.message||String(f)}}if(!r.ok){this._logService.warn(`Failed to get copilot token due to status ${r.status} ${r.statusText}`);let f=sVi.TelemetryData.createAndMarkAsIssued({status:r.status.toString(),status_text:r.statusText});if(this._telemetryService.sendGHTelemetryErrorEvent("auth.invalid_token",f.properties,f.measurements),r.status===401)return this._logService.warn("Failed to get copilot token due to 401 status"),this._telemetryService.sendGHTelemetryErrorEvent("auth.unknown_401"),{kind:"failure",reason:"HTTP401"}}if(r.kind==="error-envelope")return this._logService.warn(`Failed to get copilot token due to: ${r.body.error_details.message}`),this._telemetryService.sendGHTelemetryErrorEvent("auth.request_read_failed"),{kind:"failure",reason:"NotAuthorized",...r.body.error_details};if(r.kind==="error")return r.body.message?.startsWith("API rate limit exceeded")?(this._logService.warn("Failed to get copilot token due to exceeding API rate limit"),this._telemetryService.sendGHTelemetryErrorEvent("auth.rate_limited"),{kind:"failure",reason:"RateLimited"}):(this._logService.warn(`Failed to get copilot token due to: ${r.body.message}`),{kind:"failure",reason:"NotAuthorized"});if(r.kind==="parse-failed")return this._logService.warn(`Failed to get copilot token due to: ${r.parseError}`),this._telemetryService.sendGHTelemetryErrorEvent("auth.request_read_failed"),{kind:"failure",reason:"ParseFailed",message:r.parseError};let s=r.body,c=s.expires_at;s.expires_at=(0,pTt.nowSeconds)()+s.refresh_in+60;let l=o??"unknown",u={...s,copilot_plan:n?.copilot_plan??s.sku??"",quota_snapshots:n?.quota_snapshots,quota_reset_date:n?.quota_reset_date,codex_agent_enabled:n?.codex_agent_enabled,token_based_billing:n?.token_based_billing,organization_login_list:n?.organization_login_list??[],username:l,isVscodeTeamMember:(0,VU.containsVSCodeOrg)(s.organization_list??[])},d=sVi.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,pTt.nowSeconds)()});return this._telemetryService.sendGHTelemetryEvent("auth.new_token",d.properties,d.measurements),{kind:"success",...u}}async fetchCopilotTokenFromGitHubToken(e){let r={callSite:"copilot-token-github",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},n=await this._capiClientService.makeRequest(r,{type:iFr.RequestType.CopilotToken});return this.parseTokenResponse(n)}async fetchCopilotTokenFromDevDeviceId(e){let r={callSite:"copilot-token-device",headers:{"X-GitHub-Api-Version":"2025-04-01","Editor-Device-Id":`${e}`},retryFallbacks:!0,expectJSON:!0},n=await this._capiClientService.makeRequest(r,{type:iFr.RequestType.CopilotNLToken});return this.parseTokenResponse(n)}async parseTokenResponse(e){let r={ok:e.ok,status:e.status,statusText:e.statusText},n;try{n=await(0,wFe.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,VU.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,VU.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,VU.isStandardErrorEnvelope)(n)?{...r,body:n,kind:"error"}:(this.sendTokenValidationTelemetry(o),{...r,body:void 0,kind:"parse-failed",parseError:"Response is not valid: "+JSON.stringify(n)})}sendTokenValidationTelemetry(e){e.strategy!=="strict"&&this._telemetryService.sendMSFTTelemetryEvent("copilotTokenFetching.validation",{strategy:e.strategy,strictError:e.strictError,fallbackError:e.fallbackError})}async fetchCopilotUserInfo(e){let r={callSite:"copilot-token-user-info",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0};return await(await this._capiClientService.makeRequest(r,{type:iFr.RequestType.CopilotUserInfo})).json()}};Yl.BaseCopilotTokenManager=kEe;var hTt=class extends kEe{static{a(this,"FixedCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new vTt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l),this._completionsToken=e,this.copilotToken=(0,VU.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,VU.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new VU.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Yl.FixedCopilotTokenManager=hTt;Yl.FixedCopilotTokenManager=hTt=yTt([$u(1,CTt.ILogService),$u(2,bTt.ITelemetryService),$u(3,_Tt.ICAPIClientService),$u(4,ETt.IDomainService),$u(5,wFe.IFetcherService),$u(6,PEe.IEnvService)],hTt);var mTt=class extends kEe{static{a(this,"StaticExtendedTokenInfoCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new vTt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l);let u=Buffer.from(e,"base64").toString("utf8");this._initialToken=JSON.parse(u)}async getCopilotToken(){return this.copilotToken||(this.copilotToken={...this._initialToken}),new VU.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Yl.StaticExtendedTokenInfoCopilotTokenManager=mTt;Yl.StaticExtendedTokenInfoCopilotTokenManager=mTt=yTt([$u(1,CTt.ILogService),$u(2,bTt.ITelemetryService),$u(3,_Tt.ICAPIClientService),$u(4,ETt.IDomainService),$u(5,wFe.IFetcherService),$u(6,PEe.IEnvService)],mTt);var xFe=class extends kEe{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,pTt.nowSeconds)()+300||e){let r=await this.authenticateAndGetToken();if(r.kind==="failure")throw Error(`Failed to get copilot token: ${r.reason.toString()} ${r.message??""}`);this.copilotToken={...r}}return new VU.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,pTt.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Yl.RefreshableCopilotTokenManager=xFe;var gTt=class extends xFe{static{a(this,"CopilotTokenManagerFromDeviceId")}constructor(e,r,n,o,s,c,l,u){super(new vTt.NullBaseOctoKitService(s,c,r,n),r,n,o,s,c,l),this.deviceId=e,this.configurationService=u}async authenticateAndGetToken(){return this.authFromDevDeviceId(this.deviceId)}};Yl.CopilotTokenManagerFromDeviceId=gTt;Yl.CopilotTokenManagerFromDeviceId=gTt=yTt([$u(1,CTt.ILogService),$u(2,bTt.ITelemetryService),$u(3,ETt.IDomainService),$u(4,_Tt.ICAPIClientService),$u(5,wFe.IFetcherService),$u(6,PEe.IEnvService),$u(7,aVi.IConfigurationService)],gTt);var ATt=class extends xFe{static{a(this,"CopilotTokenManagerFromGitHubToken")}constructor(e,r,n,o,s,c,l,u,d){super(new vTt.NullBaseOctoKitService(c,l,n,o),n,o,s,c,l,u),this.githubToken=e,this.githubUsername=r,this.configurationService=d}async authenticateAndGetToken(){return this.authFromGitHubToken(this.githubToken,this.githubUsername)}};Yl.CopilotTokenManagerFromGitHubToken=ATt;Yl.CopilotTokenManagerFromGitHubToken=ATt=yTt([$u(2,CTt.ILogService),$u(3,bTt.ITelemetryService),$u(4,ETt.IDomainService),$u(5,_Tt.ICAPIClientService),$u(6,wFe.IFetcherService),$u(7,PEe.IEnvService),$u(8,aVi.IConfigurationService)],ATt)});var lVi=I(WU=>{"use strict";p();var BMc=WU&&WU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},oFr=WU&&WU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(WU,"__esModule",{value:!0});WU.ChatQuotaService=void 0;var FMc=(_ie(),Wa(yie)),UMc=Fc(),QMc=Po(),qMc=rE(),jMc=lE(),HMc=Np(),sFr=class extends QMc.Disposable{static{a(this,"ChatQuotaService")}constructor(e,r,n){super(),this._authService=e,this._logService=r,this._capiClientService=n,this._turnCredits=new Map,this._onDidChange=this._register(new UMc.Emitter),this.onDidChange=this._onDidChange.event,this._rateLimitInfo={session:void 0,weekly:void 0},this._register(this._authService.onDidCopilotTokenChange(()=>{this._processUserInfoQuotaSnapshot(this._authService.copilotToken?.quotaInfo)}))}get quotaInfo(){return this._quotaInfo}get rateLimitInfo(){return this._rateLimitInfo}get quotaExhausted(){return!this._quotaInfo||this._quotaInfo.additionalUsageEnabled?!1:this._quotaInfo.unlimited?!this._quotaInfo.hasQuota:this._quotaInfo.percentRemaining<=0}get additionalUsageEnabled(){return this._quotaInfo?this._quotaInfo.additionalUsageEnabled:!1}getCreditsForTurn(e){return this._turnCredits.get(e)}setLastCopilotUsage(e,r){let n=e/1e9;n>=0&&this._turnCredits.set(r,(this._turnCredits.get(r)??0)+n)}resetTurnCredits(e){this._turnCredits.delete(e)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(e){let r=this._authService.copilotToken?.isFreeUser?e.get("x-quota-snapshot-chat"):e.get("x-quota-snapshot-premium_models")||e.get("x-quota-snapshot-premium_interactions");if(!r)return;let n=this._processHeaderValue(r);if(!n)return;this._quotaInfo=n,this._logService.trace(`[ChatQuota] processQuotaHeaders: ${JSON.stringify(n)}`);let o=e.get("x-usage-ratelimit-session"),s=e.get("x-usage-ratelimit-weekly");this._rateLimitInfo.session=o?this._processHeaderValue(o):void 0,this._rateLimitInfo.weekly=s?this._processHeaderValue(s):void 0,this._onDidChange.fire()}processQuotaSnapshots(e){let r=this._authService.copilotToken?.isFreeUser?e.chat:e.premium_models??e.premium_interactions;if(r)try{let n=parseInt(r.entitlement,10),o=r.reset_date?new Date(r.reset_date):(()=>{let s=new Date;return s.setMonth(s.getMonth()+1),s})();this._quotaInfo={quota:n,unlimited:n===-1,hasQuota:r.has_quota??!0,percentRemaining:r.percent_remaining,additionalUsageUsed:r.overage_count,additionalUsageEnabled:r.overage_permitted,resetDate:o},this._logService.trace(`[ChatQuota] processQuotaSnapshots: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}catch(n){console.error("Failed to process quota snapshots",n)}}async refreshQuota(){let e=this._authService.anyGitHubSession?.accessToken;if(e)try{let r={callSite:"copilot-quota-refresh",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},o=await(await this._capiClientService.makeRequest(r,{type:FMc.RequestType.CopilotUserInfo})).json();this._processUserInfoQuotaSnapshot(o),this._logService.trace("[ChatQuota] refreshQuota: fetched up-to-date quota data")}catch(r){this._logService.trace(`[ChatQuota] refreshQuota: failed to fetch quota data: ${r}`)}}_processHeaderValue(e){try{let r=new URLSearchParams(e),n=parseInt(r.get("ent")||"0",10),o=parseFloat(r.get("ov")||"0.0"),s=r.get("ovPerm")==="true",c=parseFloat(r.get("rem")||"0.0"),l=r.get("rst"),u;return l?u=new Date(l):(u=new Date,u.setMonth(u.getMonth()+1)),{quota:n,unlimited:n===-1,hasQuota:!0,percentRemaining:c,additionalUsageUsed:o,additionalUsageEnabled:s,resetDate:u}}catch(r){console.error("Failed to parse quota header",r);return}}_processUserInfoQuotaSnapshot(e){if(!e||!e.quota_snapshots||!e.quota_reset_date)return;let r=this._authService.copilotToken?.isFreeUser?e.quota_snapshots.chat:e.quota_snapshots.premium_interactions;this._quotaInfo={unlimited:r.unlimited,hasQuota:r.has_quota??!0,additionalUsageEnabled:r.overage_permitted,additionalUsageUsed:r.overage_count,quota:r.entitlement,resetDate:new Date(e.quota_reset_date),percentRemaining:r.percent_remaining},this._logService.trace(`[ChatQuota] processUserInfoQuotaSnapshot: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}};WU.ChatQuotaService=sFr;WU.ChatQuotaService=sFr=BMc([oFr(0,qMc.IAuthenticationService),oFr(1,HMc.ILogService),oFr(2,jMc.ICAPIClientService)],sFr)});var dVi=I(STt=>{"use strict";p();Object.defineProperty(STt,"__esModule",{value:!0});STt.DefaultsOnlyConfigurationService=void 0;var uVi=Hl(),aFr=class extends uVi.AbstractConfigurationService{static{a(this,"DefaultsOnlyConfigurationService")}getConfig(e){return this.getDefaultValue(e)}inspectConfig(e,r){return{defaultValue:this.getDefaultValue(e)}}setConfig(e,r,n){return Promise.resolve()}getNonExtensionConfig(e){}getExperimentBasedConfig(e,r,n){if(e.experimentName){let c=r.getTreatmentVariable(e.experimentName);if(c!==void 0)return c}let o=r.getTreatmentVariable(`copilotchat.config.${e.id}`);if(o!==void 0)return o;let s=r.getTreatmentVariable(`config.${e.fullyQualifiedId}`);if(s!==void 0)return s;if(e.fullyQualifiedOldId){let c=r.getTreatmentVariable(`copilotchat.config.${e.oldId}`);if(c!==void 0)return c;let l=r.getTreatmentVariable(`config.${e.fullyQualifiedOldId}`);if(l!==void 0)return l}return this.getDefaultValue(e)}updateExperimentBasedConfiguration(e){e.length!==0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a((r,n)=>{if(e.some(s=>s.startsWith(`config.${r}`)))return!0;let o=uVi.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};STt.DefaultsOnlyConfigurationService=aFr});var pVi=I(TTt=>{"use strict";p();Object.defineProperty(TTt,"__esModule",{value:!0});TTt.computeDiff=$Mc;TTt.computeDiffSync=fVi;var GMc=jbt();async function $Mc(t,e,r){return fVi(t,e,r)}a($Mc,"computeDiff");function fVi(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new GMc.DefaultLinesDiffComputer().computeDiff(n,o,r),l=c.changes.length>0?!1:t===e;function u(d){return d.map(f=>[f.original.startLineNumber,f.original.endLineNumberExclusive,f.modified.startLineNumber,f.modified.endLineNumberExclusive,f.innerChanges?.map(h=>[h.originalRange.startLineNumber,h.originalRange.startColumn,h.originalRange.endLineNumber,h.originalRange.endColumn,h.modifiedRange.startLineNumber,h.modifiedRange.startColumn,h.modifiedRange.endLineNumber,h.modifiedRange.endColumn])])}return a(u,"getLineChanges"),{identical:l,quitEarly:c.hitTimeout,changes:u(c.changes),moves:c.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}a(fVi,"computeDiffSync")});var AVi=I(WN=>{"use strict";p();var VMc=WN&&WN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WMc=WN&&WN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gVi=WN&&WN.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{let r=XMc([hVi.join(__dirname,"diffWorker.js"),hVi.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new zMc.WorkerWithRpcProxy(r,{name:"Diff worker"})})}dispose(){this._worker.rawValue?.terminate()}async computeDiff(e,r,n){let o=this._useWorker?await this._worker.value.proxy.computeDiff(e,r,n):await ZMc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:uFr(o.changes),moves:o.moves.map(c=>new JMc.MovedText(new cFr.LineRangeMapping(new ITt.LineRange(c[0],c[1]),new ITt.LineRange(c[2],c[3])),uFr(c[4])))}}};WN.DiffServiceImpl=lFr;function uFr(t){return t.map(e=>new cFr.DetailedLineRangeMapping(new ITt.LineRange(e[0],e[1]),new ITt.LineRange(e[2],e[3]),e[4]?.map(r=>new cFr.RangeMapping(new mVi.Range(r[0],r[1],r[2],r[3]),new mVi.Range(r[4],r[5],r[6],r[7])))))}a(uFr,"toLineRangeMappings");function XMc(t){for(let e of t)if((0,KMc.existsSync)(e))return e}a(XMc,"firstExistingPath")});var _Vi=I(zU=>{"use strict";p();var eOc=zU&&zU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},yVi=zU&&zU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(zU,"__esModule",{value:!0});zU.CAPIClientImpl=void 0;var tOc=FD(),rOc=Oy(),nOc=lE(),dFr=class extends nOc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};zU.CAPIClientImpl=dFr;zU.CAPIClientImpl=dFr=eOc([yVi(0,rOc.IFetcherService),yVi(1,tOc.IEnvService)],dFr)});var vVi=I(YU=>{"use strict";p();var iOc=YU&&YU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},fFr=YU&&YU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(YU,"__esModule",{value:!0});YU.DomainService=void 0;var oOc=Fc(),sOc=Po(),aOc=YG(),DEe=Hl(),cOc=lE(),EVi="github-enterprise.uri",pFr=class extends sOc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new oOc.Emitter),this.onDidChangeDomains=this._onDidChangeDomains.event,this._register(this._configurationService.onDidChangeConfiguration(o=>this._onDidConfigChangeHandler(o))),this._processCopilotToken(this._tokenStore.copilotToken),this._register(this._tokenStore.onDidStoreUpdate(()=>this._processCopilotToken(this._tokenStore.copilotToken)))}_onDidConfigChangeHandler(e){(e.affectsConfiguration(`${DEe.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(EVi))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(DEe.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(DEe.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(DEe.ConfigKey.Shared.AuthProvider)===DEe.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(EVi):void 0,s={endpoints:{api:r||e?.endpoints?.api,proxy:n||e?.endpoints?.proxy,telemetry:e?.endpoints?.telemetry,"origin-tracker":e?.endpoints?.["origin-tracker"]},sku:e?.sku||"unknown"},c=this._capiClientService.updateDomains(s,o);(c.capiUrlChanged||c.proxyUrlChanged||c.telemetryUrlChanged||c.dotcomUrlChanged)&&this._onDidChangeDomains.fire({capiUrlChanged:c.capiUrlChanged,telemetryUrlChanged:c.telemetryUrlChanged,proxyUrlChanged:c.proxyUrlChanged,dotcomUrlChanged:c.dotcomUrlChanged})}_processCopilotToken(e){this._processCAPIModuleChange(e)}};YU.DomainService=pFr;YU.DomainService=pFr=iOc([fFr(0,DEe.IConfigurationService),fFr(1,aOc.ICopilotTokenStore),fFr(2,cOc.ICAPIClientService)],pFr)});var CVi=I(NEe=>{"use strict";p();Object.defineProperty(NEe,"__esModule",{value:!0});NEe.NullNativeEnvService=NEe.NullEnvService=void 0;var lOc=Fc(),uOc=hd(),xTt=FD(),dOc=K4e(),wTt=class t extends xTt.AbstractEnvService{static{a(this,"NullEnvService")}constructor(){super(...arguments),this.language="en"}static{this.Instance=new t}get extensionId(){return"test-extension-id"}get vscodeVersion(){return"test-version"}get isActive(){return!0}get onDidChangeWindowState(){return lOc.Event.None}get sessionId(){return"test-session"}get machineId(){return"test-machine"}get devDeviceId(){return"test-dev-device"}get remoteName(){}get uiKind(){return"desktop"}get uriScheme(){return"code-null"}get appRoot(){return""}get shell(){return"zsh"}get OS(){return xTt.OperatingSystem.Linux}getEditorInfo(){return new xTt.NameAndVersion("simulation-tests-editor",dOc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new xTt.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};NEe.NullEnvService=wTt;var hFr=class extends wTt{static{a(this,"NullNativeEnvService")}get userHome(){return uOc.URI.file("/home/testuser")}};NEe.NullNativeEnvService=hFr});var mFr=I(RTt=>{"use strict";p();Object.defineProperty(RTt,"__esModule",{value:!0});RTt.IGitExtensionService=void 0;var fOc=an();RTt.IGitExtensionService=(0,fOc.createServiceIdentifier)("IGitExtensionService")});var bVi=I(kTt=>{"use strict";p();Object.defineProperty(kTt,"__esModule",{value:!0});kTt.NullGitExtensionService=void 0;var pOc=Fc(),gFr=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=pOc.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};kTt.NullGitExtensionService=gFr});var SVi=I(KU=>{"use strict";p();var hOc=KU&&KU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},mOc=KU&&KU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(KU,"__esModule",{value:!0});KU.ObservableGit=void 0;var gOc=Po(),hW=bD(),AOc=mFr(),AFr=class extends gOc.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,hW.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,hW.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,hW.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,hW.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,hW.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,hW.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,hW.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,hW.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};KU.ObservableGit=AFr;KU.ObservableGit=AFr=hOc([mOc(0,AOc.IGitExtensionService)],AFr)});var DTt=I(Kl=>{"use strict";p();Object.defineProperty(Kl,"__esModule",{value:!0});Kl.lengthZero=void 0;Kl.lengthDiff=EOc;Kl.lengthIsZero=vOc;Kl.toLength=zie;Kl.lengthToObj=COc;Kl.lengthGetLineCount=bOc;Kl.lengthGetColumnCountIfZeroLineCount=SOc;Kl.lengthAdd=IVi;Kl.sumLengths=TOc;Kl.lengthEquals=IOc;Kl.lengthDiffNonNegative=xOc;Kl.lengthLessThan=wOc;Kl.lengthLessThanEqual=ROc;Kl.lengthGreaterThanEqual=kOc;Kl.lengthToPosition=POc;Kl.positionToLength=DOc;Kl.lengthsToRange=NOc;Kl.lengthOfRange=MOc;Kl.lengthCompare=OOc;Kl.lengthOfString=LOc;Kl.lengthOfStringObj=BOc;Kl.lengthHash=FOc;Kl.lengthMax=UOc;var TVi=ym(),yOc=iv(),_Oc=uh(),PTt=Vge();function EOc(t,e,r,n){return t!==r?zie(r-t,n):zie(0,n-e)}a(EOc,"lengthDiff");Kl.lengthZero=0;function vOc(t){return t===0}a(vOc,"lengthIsZero");var AE=2**26;function zie(t,e){return t*AE+e}a(zie,"toLength");function COc(t){let e=t,r=Math.floor(e/AE),n=e-r*AE;return new PTt.TextLength(r,n)}a(COc,"lengthToObj");function bOc(t){return Math.floor(t/AE)}a(bOc,"lengthGetLineCount");function SOc(t){return t}a(SOc,"lengthGetColumnCountIfZeroLineCount");function IVi(t,e){let r=t+e;return e>=AE&&(r=r-t%AE),r}a(IVi,"lengthAdd");function TOc(t,e){return t.reduce((r,n)=>IVi(r,e(n)),Kl.lengthZero)}a(TOc,"sumLengths");function IOc(t,e){return t===e}a(IOc,"lengthEquals");function xOc(t,e){let r=t,n=e;if(n-r<=0)return Kl.lengthZero;let s=Math.floor(r/AE),c=Math.floor(n/AE),l=n-c*AE;if(s===c){let u=r-s*AE;return zie(0,l-u)}else return zie(c-s,l)}a(xOc,"lengthDiffNonNegative");function wOc(t,e){return t=e}a(kOc,"lengthGreaterThanEqual");function POc(t){let e=t,r=Math.floor(e/AE),n=e-r*AE;return new yOc.Position(r+1,n+1)}a(POc,"lengthToPosition");function DOc(t){return zie(t.lineNumber-1,t.column-1)}a(DOc,"positionToLength");function NOc(t,e){let r=t,n=Math.floor(r/AE),o=r-n*AE,s=e,c=Math.floor(s/AE),l=s-c*AE;return new _Oc.Range(n+1,o+1,c+1,l+1)}a(NOc,"lengthsToRange");function MOc(t){return t.startLineNumber===t.endLineNumber?new PTt.TextLength(0,t.endColumn-t.startColumn):new PTt.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(MOc,"lengthOfRange");function OOc(t,e){return t-e}a(OOc,"lengthCompare");function LOc(t){let e=(0,TVi.splitLines)(t);return zie(e.length-1,e[e.length-1].length)}a(LOc,"lengthOfString");function BOc(t){let e=(0,TVi.splitLines)(t);return new PTt.TextLength(e.length-1,e[e.length-1].length)}a(BOc,"lengthOfStringObj");function FOc(t){return t}a(FOc,"lengthHash");function UOc(t,e){return t>e?t:e}a(UOc,"lengthMax")});var EFr=I(NTt=>{"use strict";p();Object.defineProperty(NTt,"__esModule",{value:!0});NTt.TextEditInfo=void 0;var yFr=DTt(),_Fr=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,yFr.lengthToObj)(this.startOffset)}...${(0,yFr.lengthToObj)(this.endOffset)}) -> ${(0,yFr.lengthToObj)(this.newLength)}`}};NTt.TextEditInfo=_Fr});var wVi=I(vFr=>{"use strict";p();Object.defineProperty(vFr,"__esModule",{value:!0});vFr.combineTextEditInfos=jOc;var QOc=Ml(),$g=DTt(),qOc=EFr();function jOc(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new QOc.ArrayQueue(xVi(t)),n=xVi(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=r.dequeue();function s(d){if(d===void 0){let h=r.takeWhile(m=>!0)||[];return o&&h.unshift(o),h}let f=[];for(;o&&!(0,$g.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,$g.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,$g.lengthIsZero)(d)||f.push(new RFe(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,$g.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new qOc.TextEditInfo(m.startOffset,f,(0,$g.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=$g.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,$g.sumLengths)(f,g=>g.lengthBefore),m=(0,$g.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,$g.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(jOc,"combineTextEditInfos");var RFe=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,$g.lengthDiffNonNegative)(e,this.lengthAfter);return(0,$g.lengthEquals)(r,$g.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,$g.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,$g.lengthToObj)(this.lengthBefore)} -> ${(0,$g.lengthToObj)(this.lengthAfter)}`}};function xVi(t){let e=[],r=$g.lengthZero;for(let n of t){let o=(0,$g.lengthDiffNonNegative)(r,n.startOffset);(0,$g.lengthIsZero)(o)||e.push(new RFe(!1,o,o));let s=(0,$g.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new RFe(!0,s,n.newLength)),r=n.endOffset}return e}a(xVi,"toLengthMapping")});var kVi=I(MEe=>{"use strict";p();Object.defineProperty(MEe,"__esModule",{value:!0});MEe.SingleTextEditLength=MEe.TextLengthEdit=void 0;var HOc=uh(),RVi=Vge(),GOc=wVi(),kFe=DTt(),$Oc=EFr(),CFr=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new PFe(n.range,RVi.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,kFe.lengthToObj)(n.newLength);return new PFe((0,kFe.lengthsToRange)(n.startOffset,n.endOffset),new RVi.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new $Oc.TextEditInfo((0,kFe.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,kFe.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,kFe.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,GOc.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return HOc.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};MEe.TextLengthEdit=CFr;var PFe=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};MEe.SingleTextEditLength=PFe});var PVi=I(OEe=>{"use strict";p();Object.defineProperty(OEe,"__esModule",{value:!0});OEe.DocumentHistory=OEe.HistoryContext=void 0;var VOc=pd(),WOc=ON(),bFr=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,VOc.assert)(e.length>0)}getMostRecentDocument(){return this.documents.at(-1)}getDocument(e){return this.documents.find(r=>r.docId===e)}getDocumentAndIdx(e){let r=this.documents.findIndex(n=>n.docId===e);if(r!==-1)return{doc:this.documents[r],idx:r}}};OEe.HistoryContext=bFr;var SFr=class{static{a(this,"DocumentHistory")}constructor(e,r,n,o,s){this.docId=e,this.languageId=r,this.base=n,this.lastEdits=o,this.lastSelection=s,this.lastEdit=new WOc.RootedEdit(this.base,this.lastEdits.compose())}};OEe.DocumentHistory=SFr});var BVi=I(LEe=>{"use strict";p();Object.defineProperty(LEe,"__esModule",{value:!0});LEe.NesHistoryContextProvider=void 0;LEe.sum=NFe;LEe.editExtends=LVi;var DVi=Po(),NVi=bD(),zOc=CT(),DFe=W_(),YOc=rLe(),KOc=dI(),MTt=ON(),JOc=Ebt(),MVi=kVi(),ZOc=W4(),MFe=e5e(),OVi=PVi(),TFr=class extends DVi.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new xFr(50),this._register((0,NVi.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,MFe.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,NVi.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new IFr(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,ZOc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},l=>{l.languageId.changes.length>0&&(c.languageId=l.languageId.value);let u=this._isAwaitingGitCheckoutCooldown();for(let d of l.value.changes)this._lastDocuments.push(c),c.handleEdit(d,u);l.selection.changes.length>0&&(c.handleSelection(l.selection.value.at(0)),this._lastDocuments.push(c))})),o.add((0,DVi.toDisposable)(()=>{let l=this._documentState.get(n.id);l&&this._lastDocuments.remove(l),this._documentState.delete(n.id)}))},n=>n.id).recomputeInitiallyAndOnChange(this._store)}getHistoryContext(e){let r=this._documentState.get(e);if(!r||!this._lastDocuments.has(r))return;let n=[],o=!1,s=5;for(let c of this._lastDocuments.getItemsReversed()){let l=c.getRecentEdit(s);if(l!==void 0&&(l.editCount===0&&o||(c.docId===e&&(o=!0),n.push(l.history),s-=l.editCount,s<=0)))break}if(n.reverse(),!!n.some(c=>c.docId===e))return new OVi.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,MFe.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};LEe.NesHistoryContextProvider=TFr;var IFr=class t{static{a(this,"DocumentState")}static{this.MAX_EDITED_LINES_PER_EDIT=10}static{this.MAX_EDITED_CHARS_PER_EDIT=5e3}constructor(e,r,n,o){this.docId=e,this.languageId=n,this._edits=[],this._isUserDocument=!1,this._baseValue=new KOc.StringText(r),this._currentValue=this._baseValue,this.handleSelection(o)}getSelection(){return this._selection}handleSelection(e){e&&(this._isUserDocument=!0),this._selection=e}handleEdit(e,r){if(e.isEmpty())return;this._currentValue=e.applyOnText(this._currentValue);let n=YOc.TextEdit.fromStringEdit(e,this._currentValue),o=MVi.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return NFe(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&LVi(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,MFe.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,MFe.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new MTt.Edits(DFe.StringEdit,this._edits.map(o=>o.edit));return{history:new OVi.DocumentHistory(this.docId,this.languageId,this._baseValue,n,this._selection),editCount:r}}applyAllEdits(){this._baseValue=this._currentValue,this._edits=[]}_applyStaleEdits(e){let r=this._currentValue,n=DFe.StringEdit.empty,o=MVi.TextLengthEdit.empty,s,c=0,l=DFe.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,MFe.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,zOc.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=NFe(u.textLengthEdit.edits,S=>S.range.endLineNumber-S.range.startLineNumber+S.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||NFe(u.edit.replacements,S=>S.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||NFe(u.edit.replacements,S=>S.replaceRange.length)>t.MAX_EDITED_CHARS_PER_EDIT)break;if(s===this._edits.length-1)l=u.edit;else{let S=DFe.StringEdit.trySwap(u.edit,l);if(S)l=S.e1;else{if(h>=2)break;l=u.edit.compose(l)}}r=u.edit.inverse(r.value).applyOnText(r);let y=u.edit.compose(n),_=MTt.RootedEdit.toLineEdit(new MTt.RootedEdit(r,y)),v=new JOc.RootedLineEdit(r,_).removeCommonSuffixPrefixLines().edit.replacements.length;if(v>e)break;c=v,n=y,o=d}for(let u=0;u<=s;u++){let d=this._edits[u];this._baseValue=d.edit.applyOnText(this._baseValue)}return this._edits=this._edits.slice(s+1),{editCount:c}}toString(){return new MTt.Edits(DFe.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function NFe(t,e){let r=0;for(let n of t)r+=e(n);return r}a(NFe,"sum");function LVi(t,e){let r=e.getNewRanges();return t.replacements.every(n=>XOc(n.replaceRange,r))}a(LVi,"editExtends");function XOc(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(XOc,"doesTouch");var xFr=class{static{a(this,"FifoSet")}constructor(e){this.maxSize=e,this._arr=[]}push(e){let r=this._arr.indexOf(e);r!==-1?this._arr.splice(r,1):this._arr.length>=this.maxSize&&this._arr.shift(),this._arr.push(e)}remove(e){let r=this._arr.indexOf(e);r!==-1&&this._arr.splice(r,1)}getItemsReversed(){let e=[...this._arr];return e.reverse(),e}has(e){return this._arr.indexOf(e)!==-1}}});var QVi=I(zN=>{"use strict";p();var e5c=zN&&zN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},FVi=zN&&zN.__param||function(t,e){return function(r,n){e(r,n,t)}},RFr;Object.defineProperty(zN,"__esModule",{value:!0});zN.NesXtabHistoryTracker=zN.XtabEditMergeStrategy=void 0;var kFr=pd(),t5c=Po(),r5c=yde(),n5c=bD(),i5c=o6(),LTt=Hl(),o5c=Rh(),OTt=ON(),JU=ITr(),s5c=W4(),wFr=e5e(),PFr;(function(t){t.sameStartLine={kind:JU.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:JU.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:JU.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case JU.DiffHistoryMergeStrategy.Proximity:return e(s);case JU.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case JU.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,kFr.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(PFr||(zN.XtabEditMergeStrategy=PFr={}));function UVi(t,e,r){if(t.isEmpty()||e.isEmpty())return!1;for(let n of t.replacements)if(!e.replacements.some(s=>n.lineRange.distanceToRange(s.lineRange)<=r))return!1;return!0}a(UVi,"areLineEditsWithinProximity");var DFr=class extends t5c.Disposable{static{a(this,"NesXtabHistoryTracker")}static{RFr=this}static{this.MAX_HISTORY_SIZE=50}constructor(e,r,n,o){super(),this._configurationService=n,this._expService=o,this.idToEntry=new Map,this.history=new r5c.LinkedList,this.maxHistorySize=r??RFr.MAX_HISTORY_SIZE,this.mergeStrategy=(0,i5c.derived)(s=>PFr.fromConfig(this._configurationService.getExperimentBasedConfigObservable(LTt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(LTt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(LTt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,n5c.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,s5c.autorunWithChanges)(this,{rootedEdits:s.value,visibleRanges:s.visibleRanges},l=>{l.rootedEdits.changes.length>0&&l.rootedEdits.previous!==void 0?this.handleEdits(s,l.rootedEdits):this.handleVisibleRangesChange(s,l.visibleRanges)}))},s=>s.id).recomputeInitiallyAndOnChange(this._store)}getHistory(){return[...this.history]}handleVisibleRangesChange(e,r){if(r.value.length===0)return;let n=this.idToEntry.get(e.id);if(n!==void 0){if(n.entry.kind==="edit")return;n.removeFromHistory()}let o={docId:e.id,kind:"visibleRanges",visibleRanges:r.value,documentContent:e.value.get()},s=this.history.push(o);this.idToEntry.set(e.id,{entry:o,removeFromHistory:s,lastEditTimestamp:(0,wFr.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case JU.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case JU.DiffHistoryMergeStrategy.Proximity:return UVi(r,e,o.lineGap);case JU.DiffHistoryMergeStrategy.Hybrid:return(0,wFr.now)()-n<=o.splitAfterMs&&UVi(r,e,o.lineGap)}}handleEdits(e,r){(0,kFr.assert)(r.previous!==void 0,"Document has previous version"),(0,kFr.assert)(r.changes.length===1,`Expected 1 edit change but got ${r.changes.length}`);let n=r.changes[0];if(n.replacements.length===0)return;let o=this.idToEntry.get(e.id),s=r.previous,c=new OTt.RootedEdit(s,n);if(o===void 0){this.pushToHistory(e.id,c);return}if(o.entry.kind==="visibleRanges"){o.removeFromHistory(),this.pushToHistory(e.id,c);return}let l=o.entry.edit,u=OTt.RootedEdit.toLineEdit(l),d=OTt.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new OTt.RootedEdit(l.base,f);this.pushToHistory(e.id,h)}else this.pushToHistory(e.id,c)}pushToHistory(e,r){let n={docId:e,kind:"edit",edit:r},o=this.history.push(n);this.idToEntry.set(e,{entry:n,removeFromHistory:o,lastEditTimestamp:(0,wFr.now)()}),this.compactHistory()}compactHistory(){if(this.history.size>this.maxHistorySize){let e=this.history.shift();if(e!==void 0){let r=this.idToEntry.get(e.docId);r!==void 0&&e===r.entry&&this.idToEntry.delete(e.docId)}}}};zN.NesXtabHistoryTracker=DFr;zN.NesXtabHistoryTracker=DFr=RFr=e5c([FVi(2,LTt.IConfigurationService),FVi(3,o5c.IExperimentationService)],DFr)});var qVi=I(BTt=>{"use strict";p();Object.defineProperty(BTt,"__esModule",{value:!0});BTt.IVSCodeExtensionContext=void 0;var a5c=an();BTt.IVSCodeExtensionContext=(0,a5c.createServiceIdentifier)("IVSCodeExtensionContext")});var YVi=I(KN=>{"use strict";p();var $Vi=KN&&KN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},mW=KN&&KN.__param||function(t,e){return function(r,n){e(r,n,t)}},LFe;Object.defineProperty(KN,"__esModule",{value:!0});KN.UndesiredModels=KN.InlineEditsModelService=void 0;var c5c=T3r(),VVi=a3r(),jVi=gv(),l5c=Ml(),HVi=pd(),WVi=Fc(),zVi=Po(),BEe=bD(),u5c=YG(),YN=Hl(),d5c=qVi(),f5c=Np(),p5c=X1t(),h5c=Rh(),m5c=bh(),OFe=wy(),g5c=m1t(),MFr=class extends zVi.Disposable{static{a(this,"InlineEditsModelService")}static{LFe=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:OFe.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:OFe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:OFe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}constructor(e,r,n,o,s,c,l){super(),this._tokenStore=e,this._proxyModelsService=r,this._undesiredModelsManager=n,this._configService=o,this._expService=s,this._telemetryService=c,this._logService=l,this._copilotTokenObs=(0,BEe.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,BEe.observableFromEvent)(this,this._proxyModelsService.onModelListUpdated,()=>this._proxyModelsService.nesModels),this._preferredModelNameObs=this._configService.getExperimentBasedConfigObservable(YN.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService),this._localModelConfigObs=this._configService.getConfigObservable(YN.ConfigKey.Advanced.InlineEditsXtabProviderModelConfiguration),this._expBasedModelConfigObs=this._configService.getExperimentBasedConfigObservable(YN.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString,this._expService),this._defaultModelConfigObs=this._configService.getExperimentBasedConfigObservable(YN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString,this._expService),this._useSlashModelsObs=this._configService.getExperimentBasedConfigObservable(YN.ConfigKey.TeamInternal.InlineEditsUseSlashModels,this._expService),this._undesiredModelsObs=(0,BEe.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new VVi.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,BEe.derived)(d=>(u.trace("computing models"),this.aggregateModels({copilotToken:this._copilotTokenObs.read(d),fetchedNesModels:this._fetchedModelsObs.read(d),localModelConfig:this._localModelConfigObs.read(d),modelConfigString:this._expBasedModelConfigObs.read(d),defaultModelConfigString:this._defaultModelConfigObs.read(d),useSlashModels:this._useSlashModelsObs.read(d)}))).recomputeInitiallyAndOnChange(this._store),this._currentModelObs=(0,BEe.derived)(d=>{u.trace("computing current model");let f=this._undesiredModelsObs.read(d);return this._pickModel({preferredModelName:this._preferredModelNameObs.read(d),models:this._modelsObs.read(d),undesiredModelsManager:f})}).recomputeInitiallyAndOnChange(this._store),this._modelInfoObs=(0,BEe.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=WVi.Event.fromObservableLight(this._modelInfoObs)}get modelInfo(){let e=this._modelsObs.get().map(n=>({id:n.modelName,name:n.modelName})),r=this._currentModelObs.get();return{models:e,currentModelId:r.modelName}}setCurrentModelId(e){return this._setModelQueue.schedule(()=>this._setCurrentModelIdCore(e))}async _setCurrentModelIdCore(e){if(this._configService.getExperimentBasedConfig(YN.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService)===e)return;let o=this._currentModelObs.get(),s=this._modelsObs.get(),c=s.find(u=>u.modelName===e);if(c===void 0){this._logService.error(`New preferred model id ${e} not found in model list.`);return}o.source==="expConfig"&&await this._undesiredModelsManager.addUndesiredModelId(o.modelName),this._undesiredModelsManager.isUndesiredModelId(e)&&await this._undesiredModelsManager.removeUndesiredModelId(e);let l=this._pickModel({preferredModelName:"none",models:s,undesiredModelsManager:this._undesiredModelsManager});c.source==="expConfig"||e===l.modelName&&!s.some(u=>u.source==="expConfig")?(this._logger.trace(`New preferred model id ${e} is the same as the default model, resetting user setting.`),await this._configService.setConfig(YN.ConfigKey.Advanced.InlineEditsPreferredModel,"none")):(this._logger.trace(`New preferred model id ${e} is different from the default model, updating user setting to ${e}.`),await this._configService.setConfig(YN.ConfigKey.Advanced.InlineEditsPreferredModel,e))}aggregateModels({copilotToken:e,fetchedNesModels:r,localModelConfig:n,modelConfigString:o,defaultModelConfigString:s,useSlashModels:c}){let l=this._logger.createSubLogger("aggregateModels"),u=[];if(n&&(u.some(d=>d.modelName===n.modelName)?l.trace("Local model configuration already exists in the model list, skipping."):(l.trace(`Adding local model configuration: ${n.modelName}`),u.push({...n,source:"localConfig"}))),o){l.trace("Parsing modelConfigurationString...");let d=this.parseModelConfigString(o,YN.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString);d&&!u.some(f=>f.modelName===d.modelName)?(l.trace(`Adding model from modelConfigurationString: ${d.modelName}`),u.push({...d,source:"expConfig"})):l.trace("No valid model found in modelConfigurationString.")}if(c&&r&&r.length>0){l.trace(`Processing ${r.length} fetched models...`);let d=(0,c5c.filterMap)(r,f=>{if((0,OFe.isPromptingStrategy)(f.capabilities.promptStrategy)){if(u.some(h=>h.modelName===f.name)){l.trace(`Fetched model ${f.name} already exists in the model list, skipping.`);return}return{modelName:f.name,promptingStrategy:f.capabilities.promptStrategy,includeTagsInCurrentFile:!1,source:"fetched",lintOptions:void 0}}});l.trace(`Adding ${d.length} fetched models after filtering.`),(0,l5c.pushMany)(u,d)}else{l.trace(`adding built-in default model: useSlashModels ${c}, fetchedNesModels ${r?.length??"undefined"}`);let d=this.determineDefaultModel(e,s);d&&(u.some(f=>f.modelName===d.modelName)?l.trace("Default model configuration already exists in the model list, skipping."):(l.trace(`Adding default model configuration: ${d.modelName}`),u.push(d)))}return u}selectedModelConfiguration(){return NFr(this._currentModelObs.get())}defaultModelConfiguration(){let e=this._modelsObs.get();if(e&&e.length>0){let r=e.filter(n=>!this.isConfiguredModel(n));if(r.length>0)return NFr(r[0])}return NFr(this.determineDefaultModel(this._copilotTokenObs.get(),this._defaultModelConfigObs.get()))}isConfiguredModel(e){switch(e.source){case"localConfig":case"expConfig":case"expDefaultConfig":return!0;case"fetched":case"hardCodedDefault":return!1;default:(0,HVi.assertNever)(e.source)}}determineDefaultModel(e,r){if(r){let n=this.parseModelConfigString(r,YN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString);if(n)return{...n,source:"expDefaultConfig"}}return e?.isFcv1()?LFe.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?LFe.COPILOT_NES_CALLISTO:LFe.COPILOT_NES_OCT}_pickModel({preferredModelName:e,models:r,undesiredModelsManager:n}){let o=r.find(l=>l.source==="expConfig");if(o)if(n.isUndesiredModelId(o.modelName))this._logger.trace(`Exp-configured model ${o.modelName} is marked as undesired by the user. Skipping.`);else return o;if(e!=="none"){let l=r.find(u=>u.modelName===e);if(l)return l}(0,HVi.softAssert)(r.length>0,"InlineEdits model list should have at least one model");let c=r.at(0);return c||this.determineDefaultModel(this._copilotTokenObs.get(),this._defaultModelConfigObs.get())}parseModelConfigString(e,r){let n;try{let o=JSON.parse(e),s=OFe.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=jVi.ErrorUtils.toString(jVi.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};KN.InlineEditsModelService=MFr;KN.InlineEditsModelService=MFr=LFe=$Vi([mW(0,u5c.ICopilotTokenStore),mW(1,p5c.IProxyModelsService),mW(2,g5c.IUndesiredModelsManager),mW(3,YN.IConfigurationService),mW(4,h5c.IExperimentationService),mW(5,m5c.ITelemetryService),mW(6,f5c.ILogService)],MFr);function NFr(t){let{source:e,...r}=t;return r}a(NFr,"toModelConfiguration");var GVi;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends zVi.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new WVi.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new VVi.TaskQueue}isUndesiredModelId(o){return this._getModels().includes(o)}addUndesiredModelId(o){return this._queue.schedule(async()=>{let s=this._getModels();s.includes(o)||(s.push(o),await this._setModels(s),this._onDidChange.fire())})}removeUndesiredModelId(o){return this._queue.schedule(async()=>{let s=this._getModels(),c=s.indexOf(o);c!==-1&&(s.splice(c,1),await this._setModels(s),this._onDidChange.fire())})}_getModels(){return this._vscodeExtensionContext.globalState.get(e)??[]}_setModels(o){return new Promise((s,c)=>{this._vscodeExtensionContext.globalState.update(e,o).then(s,c)})}};r=$Vi([mW(0,d5c.IVSCodeExtensionContext)],r),t.Manager=r})(GVi||(KN.UndesiredModels=GVi={}))});var KVi=I(FTt=>{"use strict";p();Object.defineProperty(FTt,"__esModule",{value:!0});FTt.NullLanguageContextProviderService=void 0;var A5c=Po(),OFr=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return A5c.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};FTt.NullLanguageContextProviderService=OFr});var JVi=I(UTt=>{"use strict";p();Object.defineProperty(UTt,"__esModule",{value:!0});UTt.TestLanguageDiagnosticsService=void 0;var y5c=Fc(),_5c=b2(),E5c=bV(),LFr=class extends E5c.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new _5c.ResourceMap,this._onDidChangeDiagnostics=new y5c.Emitter,this.onDidChangeDiagnostics=this._onDidChangeDiagnostics.event}setDiagnostics(e,r){this.diagnosticsMap.set(e,r),this._onDidChangeDiagnostics.fire({uris:[e]})}getDiagnostics(e){return this.diagnosticsMap.get(e)||[]}getAllDiagnostics(){return Array.from(this.diagnosticsMap.entries())}};UTt.TestLanguageDiagnosticsService=LFr});var ZVi=I(qTt=>{"use strict";p();Object.defineProperty(qTt,"__esModule",{value:!0});qTt.ResponseStream=void 0;var v5c=gv(),QTt=xT(),C5c=pl(),b5c=CT(),BFr=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new C5c.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return QTt.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return QTt.Result.error(l)}}),this.stream=S5c(r,s)}async destroy(){await this.fetcherResponse.body.destroy()}static aggregateCompletionsStream(e){let r="",n=null,o=null,s;for(let d of e){let f=d.choices[0];r+=f.text??"",f.logprobs&&(o===null?o={tokens:[...f.logprobs.tokens],token_logprobs:[...f.logprobs.token_logprobs],text_offset:[...f.logprobs.text_offset],top_logprobs:[...f.logprobs.top_logprobs]}:(o.tokens.push(...f.logprobs.tokens),o.token_logprobs.push(...f.logprobs.token_logprobs),o.text_offset.push(...f.logprobs.text_offset),o.top_logprobs.push(...f.logprobs.top_logprobs))),d.usage&&(s===void 0?s={completion_tokens:d.usage.completion_tokens,prompt_tokens:d.usage.prompt_tokens,total_tokens:d.usage.total_tokens,completion_tokens_details:{audio_tokens:d.usage.completion_tokens_details.audio_tokens,reasoning_tokens:d.usage.completion_tokens_details.reasoning_tokens},prompt_tokens_details:{audio_tokens:d.usage.prompt_tokens_details.audio_tokens,reasoning_tokens:d.usage.prompt_tokens_details.reasoning_tokens}}:(s.completion_tokens+=d.usage.completion_tokens,s.prompt_tokens+=d.usage.prompt_tokens,s.total_tokens+=d.usage.total_tokens,s.completion_tokens_details.audio_tokens+=d.usage.completion_tokens_details.audio_tokens,s.completion_tokens_details.reasoning_tokens+=d.usage.completion_tokens_details.reasoning_tokens,s.prompt_tokens_details.audio_tokens+=d.usage.prompt_tokens_details.audio_tokens,s.prompt_tokens_details.reasoning_tokens+=d.usage.prompt_tokens_details.reasoning_tokens)),f.finish_reason&&((0,b5c.assertType)(n===null,"cannot already have finishReason if just seeing choice.finish_reason"),n=f.finish_reason)}if(e.length===0)throw new Error("Response is empty!");let c=e[0];return{choices:[{index:0,finish_reason:n,logprobs:o,text:r}],system_fingerprint:c.system_fingerprint,object:c.object,usage:s}}};qTt.ResponseStream=BFr;async function*S5c(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=v5c.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?QTt.Result.error(n):QTt.Result.ok(r))}}a(S5c,"streamWithAggregation")});var XVi=I(FFr=>{"use strict";p();Object.defineProperty(FFr,"__esModule",{value:!0});FFr.jsonlStreamToCompletions=T5c;async function*T5c(t){for await(let e of t)if(e.trim()!=="data: [DONE]"&&e.startsWith("data: ")){let r=JSON.parse(e.substring(6));if(r.error)throw new Error(r.error.message);yield r}}a(T5c,"jsonlStreamToCompletions")});var tWi=I(ZU=>{"use strict";p();var I5c=ZU&&ZU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},UFr=ZU&&ZU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ZU,"__esModule",{value:!0});ZU.CompletionsFetchService=void 0;var x5c=c3r(),eWi=gv(),Yie=xT(),w5c=$_r(),R5c=rE(),k5c=PU(),P5c=Oy(),D5c=O_e(),gW=ibt(),N5c=ZVi(),M5c=XVi(),QFr=class{static{a(this,"CompletionsFetchService")}constructor(e,r,n){this.authService=e,this.fetcherService=r,this.requestLogger=n}disconnectAll(){return this.fetcherService.disconnectAll()}async fetch(e,r,n,o,s,c){let l=Date.now();if(s.isCancellationRequested){let f=Yie.Result.error(new gW.Completions.RequestCancelled);return this._logCompletionsRequest(e,n,o,l,f),f}let u={requestId:o,headers:this.getHeaders(o,r,c),body:JSON.stringify({...n,stream:!0})},d=await this._fetchFromUrl(e,u,s);if(d.isError())return this._logCompletionsRequest(e,n,o,l,d),d;if(d.val.status===200){let f=x5c.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,M5c.jsonlStreamToCompletions)(f),m=new N5c.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=Yie.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new gW.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>L5c(d.val.body).catch(()=>"")),h=Yie.Result.error(f);return this._logCompletionsRequest(e,n,o,l,h),h}}async _fetchFromUrl(e,r,n){let o=this.fetcherService.makeAbortController(),s=n.onCancellationRequested(()=>{o.abort()});try{let c={headers:r.headers,body:r.body,signal:o.signal,method:"POST",callSite:"nes-completions"},l=await this.fetcherService.fetch(e,c);if(l.status===200&&this.authService.copilotToken?.isFreeUser&&this.authService.copilotToken?.isChatQuotaExceeded&&this.authService.resetCopilotToken(),l.status!==200)return l.status===402&&(this.authService.copilotToken?.isCompletionsQuotaExceeded||(this.authService.resetCopilotToken(l.status),await this.authService.getCopilotToken())),Yie.Result.error(new gW.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=O5c(u,s);return Yie.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,k5c.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return Yie.Result.error(new gW.Completions.RequestCancelled);let l=eWi.ErrorUtils.fromUnknown(c);return Yie.Result.error(new gW.Completions.Unexpected(l))}}_logCompletionsRequest(e,r,n,o,s){if(s.isOk())s.val.response.then(l=>{let u=l.isOk()?"success":"failed";this._emitCompletionsLogEntry(e,r,n,o,u,l)});else{let c=s.err;c instanceof gW.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof gW.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof gW.Completions.Unexpected&&this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,c.error.message)}}_emitCompletionsLogEntry(e,r,n,o,s,c,l){let u=Date.now()-o,d=[];if(d.push("> \u{1F6A8} Note: This log may contain personal information such as the contents of your files. Please review the contents carefully before sharing."),d.push("# completions"),d.push(""),d.push("- [Metadata](#metadata)"),d.push("- [Prompt](#prompt)"),r.suffix&&d.push("- [Suffix](#suffix)"),d.push("- [Response](#response)"),d.push(""),d.push("## Metadata"),d.push("
"),d.push(`url              : ${e}`),d.push(`requestId        : ${n}`),d.push(`model            : ${r.model??"(default)"}`),d.push(`maxTokens        : ${r.max_tokens}`),d.push(`temperature      : ${r.temperature}`),d.push(`top_p            : ${r.top_p}`),d.push(`n                : ${r.n}`),d.push(`duration         : ${u}ms`),d.push("
"),d.push(""),d.push("## Prompt"),d.push("~~~"),d.push(r.prompt),d.push("~~~"),r.suffix&&(d.push(""),d.push("## Suffix"),d.push("~~~"),d.push(r.suffix),d.push("~~~")),d.push(""),d.push("## Response"),s==="cancelled")d.push("## CANCELED");else if(s==="failed")d.push(`## FAILED: ${l}`);else if(c)if(c.isOk()){let h=c.val,m=h.choices[0]?.text??"",g=h.choices[0]?.finish_reason??"unknown";d.push("~~~"),d.push(m||""),d.push("~~~"),d.push(""),d.push("
"),d.push(`finishReason     : ${g}`),h.usage&&(d.push(`promptTokens     : ${h.usage.prompt_tokens}`),d.push(`completionTokens : ${h.usage.completion_tokens}`),d.push(`totalTokens      : ${h.usage.total_tokens}`)),d.push("
")}else d.push(`## FAILED: stream error - ${c.err.message}`);let f=s==="success"?void 0:w5c.Codicon.error;this.requestLogger.addEntry({type:"MarkdownContentRequest",debugName:"Completions Request",startTimeMs:o,icon:f,markdownContent:d.join(` +`)})}getHeaders(e,r,n={}){return{"Content-Type":"application/json","x-policy-id":"nil",Authorization:"Bearer "+r,"X-Request-Id":e,"X-GitHub-Api-Version":"2025-04-01",...n}}};ZU.CompletionsFetchService=QFr;ZU.CompletionsFetchService=QFr=I5c([UFr(0,R5c.IAuthenticationService),UFr(1,P5c.IFetcherService),UFr(2,D5c.IRequestLogger)],QFr);async function*O5c(t,e){try{for await(let r of t)yield r}catch(r){throw eWi.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(O5c,"streamWithCleanup");async function L5c(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(L5c,"collectAsyncIterableToString")});var nWi=I(jTt=>{"use strict";p();Object.defineProperty(jTt,"__esModule",{value:!0});jTt.WireTypes=void 0;var AW=x$(),rWi;(function(t){let e;(function(o){function s(c){return!!c&&typeof c=="object"&&typeof c.promptStrategy=="string"}a(s,"is"),o.is=s,o.validator=(0,AW.vObj)({promptStrategy:(0,AW.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,AW.vObj)({serviceType:(0,AW.vString)(),name:(0,AW.vString)(),provider:(0,AW.vString)(),capabilities:e.validator});function s(c){return!!c&&typeof c=="object"&&typeof c.serviceType=="string"&&typeof c.name=="string"&&typeof c.provider=="string"&&e.is(c.capabilities)}a(s,"is"),o.is=s})(r=t.Model||(t.Model={}));let n;(function(o){o.validator=(0,AW.vObj)({models:(0,AW.vArray)(r.validator)});function s(c){return!!c&&typeof c=="object"&&Array.isArray(c.models)&&c.models.every(r.is)}a(s,"is"),o.is=s})(n=t.ModelList||(t.ModelList={}))})(rWi||(jTt.WireTypes=rWi={}))});var sWi=I(XU=>{"use strict";p();var B5c=XU&&XU.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},BFe=XU&&XU.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(XU,"__esModule",{value:!0});XU.ProxyModelsService=void 0;var F5c=require("util"),qFr=gv(),U5c=S2(),Q5c=Fc(),q5c=Po(),iWi=bD(),j5c=YG(),H5c=lE(),oWi=FD(),G5c=nWi(),$5c=Np(),V5c=Oy(),jFr=class extends q5c.Disposable{static{a(this,"ProxyModelsService")}constructor(e,r,n,o,s){super(),this._tokenStore=e,this._capiClient=r,this._fetchService=n,this._logService=o,this._envService=s,this._onModelListUpdated=this._register(new Q5c.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let c=(0,iWi.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,iWi.autorun)(l=>{let u=c.read(l),d=new U5c.CancellationTokenSource;this._fetchLatestModels(u,d.token).then(f=>{f!==void 0&&(d.token.isCancellationRequested||(0,F5c.isDeepStrictEqual)(this._models,f)||(this._models=f,this._onModelListUpdated.fire()))}).catch(f=>{let h=qFr.ErrorUtils.fromUnknown(f);this._logService.error(h,"Failed to fetch models in autorun")}),l.store.add({dispose:a(()=>d.dispose(!0),"dispose")})}))}get models(){return this._models}get nesModels(){return this._models?.models.filter(e=>e.serviceType==="NESChat")}get cursorJumpModels(){return this._models?.models.filter(e=>e.serviceType==="CursorJumpChat")}get instantApplyModels(){return this._models?.models.filter(e=>e.serviceType==="InstantApplyChat")}async _fetchLatestModels(e,r){if(!e)return;let n=`${this._capiClient.proxyBaseURL}/models`,o=this._fetchService.makeAbortController(),s=r.onCancellationRequested(()=>o.abort()),c;try{c=await this._fetchService.fetch(n,{headers:{Authorization:`Bearer ${e.token}`,...(0,oWi.getEditorVersionHeaders)(this._envService)},method:"GET",timeout:1e4,callSite:"proxy-models",signal:o.signal})}catch(l){let u=qFr.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to fetch model list");return}finally{s.dispose()}if(!c.ok){this._logService.error(`Failed to fetch model list: ${c.status} ${c.statusText}`);return}try{let l=await c.json(),u=G5c.WireTypes.ModelList.validator.validate(l);if(u.error)throw new Error(`Invalid /models response data: ${u.error.message}`);return u.content}catch(l){let u=qFr.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};XU.ProxyModelsService=jFr;XU.ProxyModelsService=jFr=B5c([BFe(0,j5c.ICopilotTokenStore),BFe(1,H5c.ICAPIClientService),BFe(2,V5c.IFetcherService),BFe(3,$5c.ILogService),BFe(4,oWi.IEnvService)],jFr)});var aWi=I(HTt=>{"use strict";p();Object.defineProperty(HTt,"__esModule",{value:!0});HTt.NullRequestLogger=void 0;var W5c=nBr(),z5c=Fc(),HFr=class extends W5c.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=z5c.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};HTt.NullRequestLogger=HFr});var zTt=I(fu=>{"use strict";p();var ZFr=fu&&fu.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},JN=fu&&fu.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(fu,"__esModule",{value:!0});fu.SimpleExperimentationService=fu.LogLevel=fu.TokenizerName=fu.ILanguageContextProviderService=fu.IIgnoreService=fu.IExperimentationService=fu.IEndpointProvider=fu.ICAPIClientService=fu.IAuthenticationService=void 0;fu.createNESProvider=q4c;fu.createInlineCompletionsProvider=H4c;var Y5c=jfi(),cWi=yre(),lWi=BDi(),uWi=uye(),K5c=Jyt(),dWi=TRr(),J5c=IRr(),dC=eE(),fWi=DRr(),Z5c=PLi(),X5c=xy(),pWi=bkr(),e4c=tV(),hWi=Rkr(),mWi=cBe(),gWi=Ykr(),AWi=Jkr(),yWi=gOr(),$Fr=VEt(),t4c=p7i(),r4c=h7i(),FFe=Gl(),n4c=C_e(),i4c=RRr(),_Wi=YOr(),EWi=rkr(),vWi=tbt(),CWi=KNr(),bWi=Uvt(),UFe=Fvt(),SWi=_V(),TWi=Zvt(),o4c=y7i(),s4c=Yvt(),IWi=WTr(),xWi=RS(),wWi=cLe(),RWi=Jne(),QWi=kne();Object.defineProperty(fu,"TokenizerName",{enumerable:!0,get:a(function(){return QWi.TokenizerName},"get")});var a4c=D7i(),c4c=RQi(),VFr=ZQi(),kWi=T4r(),l4c=QHi(),PWi=yBr(),u4c=z$i(),XFr=rE();Object.defineProperty(fu,"IAuthenticationService",{enumerable:!0,get:a(function(){return XFr.IAuthenticationService},"get")});var d4c=aLe(),DWi=YG(),f4c=Y$i(),p4c=cVi(),h4c=LU(),m4c=w4r(),g4c=lVi(),A4c=R4r(),NWi=P4r(),fB=Hl(),y4c=dVi(),_4c=_Br(),E4c=AVi(),e8r=lE();Object.defineProperty(fu,"ICAPIClientService",{enumerable:!0,get:a(function(){return e8r.ICAPIClientService},"get")});var v4c=WV(),t8r=zLe();Object.defineProperty(fu,"IEndpointProvider",{enumerable:!0,get:a(function(){return t8r.IEndpointProvider},"get")});var qWi=_Vi(),C4c=vVi(),e9=FD(),b4c=CVi(),S4c=mFr(),jWi=bVi(),QFe=Dne();Object.defineProperty(fu,"IIgnoreService",{enumerable:!0,get:a(function(){return QFe.IIgnoreService},"get")});var T4c=Qie(),I4c=Emt(),GFr=m1t(),x4c=SVi(),w4c=BVi(),R4c=QVi(),k4c=YVi(),r8r=Ovt();Object.defineProperty(fu,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return r8r.ILanguageContextProviderService},"get")});var HWi=KVi(),GWi=bV(),$Wi=JVi(),ZN=Np(),P4c=ibt(),D4c=tWi(),n8r=Oy(),MWi=UU(),N4c=ZLr(),M4c=XLr(),O4c=n1t(),L4c=X1t(),B4c=sWi(),VWi=O_e(),WWi=aWi(),OWi=wBr(),LWi=k5r(),jFe=Rh();Object.defineProperty(fu,"IExperimentationService",{enumerable:!0,get:a(function(){return jFe.IExperimentationService},"get")});var zWi=bh(),BWi=J_e(),F4c=pTr(),FWi=V1t(),UWi=VV(),WFr=n3r(),YWi=an(),U4c=S2(),qFe=Fc(),WTt=Po(),Q4c=Lg(),bi=dmt(),KWi=Ks(),Kie;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(Kie||(fu.LogLevel=Kie={}));function q4c(t){return j4c(t).createInstance(zFr,t)}a(q4c,"createNESProvider");var zFr=class extends WTt.Disposable{static{a(this,"NESProvider")}constructor(e,r,n,o,s){super(),this._options=e,this._expService=n,this._configurationService=o,this._workspaceService=s;let c=r.createInstance(u4c.XtabProvider),l=r.createInstance(x4c.ObservableGit),u=new w4c.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig(fB.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new R4c.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new a4c.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(c4c.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance(VFr.TelemetrySender,this._options.workspace))}getId(){return this._nextEditProvider.ID}handleShown(e){e.telemetryBuilder.setAsShown(),this._nextEditProvider.handleShown(e.internalResult)}handleAcceptance(e){e.telemetryBuilder.setAcceptance("accepted"),e.telemetryBuilder.setStatus("accepted"),this._nextEditProvider.handleAcceptance(e.docId,e.internalResult),this.handleEndOfLifetime(e)}handleRejection(e){e.telemetryBuilder.setAcceptance("rejected"),e.telemetryBuilder.setStatus("rejected"),this._nextEditProvider.handleRejection(e.docId,e.internalResult),this.handleEndOfLifetime(e)}handleIgnored(e,r){r&&e.telemetryBuilder.setSupersededBy(r.requestUuid),this._nextEditProvider.handleIgnored(e.docId,e.internalResult,r?.internalResult),this.handleEndOfLifetime(e)}handleEndOfLifetime(e){try{this._telemetrySender.sendTelemetryForBuilder(e.telemetryBuilder)}finally{e.telemetryBuilder.dispose()}}async getNextEdit(e,r){let n=T4c.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,Q4c.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new I4c.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new VFr.NextEditProviderTelemetryBuilder(new jWi.NullGitExtensionService,void 0,this._workspaceService,this._nextEditProvider.ID,c,this._debugRecorder,s.recordingBookmark);l.setOpportunityId(o.requestUuid);try{let u=await this._nextEditProvider.getNextEdit(n,o,s,r,l.nesBuilder);return{result:u.result?.edit?{newText:u.result.edit.newText,range:u.result.edit.replaceRange,...u.result.targetDocumentId?{targetDocumentUri:u.result.targetDocumentId.uri}:{}}:void 0,docId:n,requestUuid:o.requestUuid,internalResult:u,telemetryBuilder:l}}catch(u){try{this._telemetrySender.sendTelemetryForBuilder(l)}finally{l.dispose()}throw u}}updateTreatmentVariables(e){this._expService instanceof Jie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=fB.globalConfigRegistry.configs.get(`${fB.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};zFr=ZFr([JN(1,KWi.IInstantiationService),JN(2,jFe.IExperimentationService),JN(3,fB.IConfigurationService),JN(4,WFr.IWorkspaceService)],zFr);function j4c(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o,editorInfo:s,editorPluginInfo:c}=t,l=new YWi.InstantiationServiceBuilder;l.define(fB.IConfigurationService,new bi.SyncDescriptor(GTt,[t.configOverrides??new Map])),l.define(jFe.IExperimentationService,new bi.SyncDescriptor(Jie,[t.waitForTreatmentVariables])),l.define(OWi.ISimulationTestContext,new bi.SyncDescriptor(OWi.NulSimulationTestContext)),l.define(WFr.IWorkspaceService,new bi.SyncDescriptor(WFr.NullWorkspaceService)),l.define(_4c.IDiffService,new bi.SyncDescriptor(E4c.DiffServiceImpl,[!1])),l.define(ZN.ILogService,new bi.SyncDescriptor(ZN.LogServiceImpl,[[o||new ZN.ConsoleLog(void 0,ZN.LogLevel.Trace)]])),l.define(S4c.IGitExtensionService,new bi.SyncDescriptor(jWi.NullGitExtensionService)),l.define(r8r.ILanguageContextProviderService,new bi.SyncDescriptor(HWi.NullLanguageContextProviderService)),l.define(GWi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new bi.SyncDescriptor($Wi.TestLanguageDiagnosticsService)),l.define(QFe.IIgnoreService,new bi.SyncDescriptor(QFe.NullIgnoreService)),l.define(LWi.ISnippyService,new bi.SyncDescriptor(LWi.NullSnippyService)),l.define(v4c.IDomainService,new bi.SyncDescriptor(C4c.DomainService)),l.define(e8r.ICAPIClientService,new bi.SyncDescriptor(qWi.CAPIClientImpl)),l.define(DWi.ICopilotTokenStore,new bi.SyncDescriptor(DWi.CopilotTokenStore)),l.define(e9.IEnvService,new class extends b4c.NullEnvService{getEditorInfo(){return new e9.NameAndVersion(s.name,s.version)}getEditorPluginInfo(){return new e9.NameAndVersion(c.name,c.version)}}),l.define(n8r.IFetcherService,new bi.SyncDescriptor($Tt,[e])),l.define(zWi.ITelemetryService,new bi.SyncDescriptor(VTt,[n])),l.define(XFr.IAuthenticationService,new bi.SyncDescriptor(f4c.StaticGitHubAuthenticationService,[(0,p4c.createStaticGitHubTokenProvider)()])),l.define(d4c.ICopilotTokenManager,r),l.define(kWi.IPowerService,new bi.SyncDescriptor(kWi.NullPowerService)),l.define(h4c.IChatMLFetcher,new bi.SyncDescriptor(l4c.ChatMLFetcherImpl)),l.define(MWi.IChatWebSocketManager,new bi.SyncDescriptor(MWi.NullChatWebSocketManager)),l.define(O4c.IOTelService,new N4c.NoopOTelService((0,M4c.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),l.define(m4c.IChatQuotaService,new bi.SyncDescriptor(g4c.ChatQuotaService)),l.define(NWi.IInteractionService,new bi.SyncDescriptor(NWi.InteractionService)),l.define(VWi.IRequestLogger,new bi.SyncDescriptor(WWi.NullRequestLogger)),l.define(UWi.ITokenizerProvider,t.tokenizerProvider??new bi.SyncDescriptor(UWi.TokenizerProvider,[!1])),l.define(A4c.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),l.define(L4c.IProxyModelsService,new bi.SyncDescriptor(B4c.ProxyModelsService)),l.define(GFr.IInlineEditsModelService,new bi.SyncDescriptor(k4c.InlineEditsModelService)),l.define(GFr.IUndesiredModelsManager,t.undesiredModelsManager||new bi.SyncDescriptor(GFr.NullUndesiredModelsManager)),l.define(FWi.ITerminalService,t.terminalService||new bi.SyncDescriptor(FWi.NullTerminalService)),l.define(PWi.ISimilarFilesContextService,new bi.SyncDescriptor(PWi.NullSimilarFilesContextService)),l.define(t8r.IEndpointProvider,new YFr);let u=new dC.InMemoryConfigProvider(new dC.DefaultsOnlyConfigProvider);return t.configOverrides&&u.setOverrides(t.configOverrides),l.define(dC.ICompletionsConfigProvider,u),l.seal()}a(j4c,"setupServices");var GTt=class extends y4c.DefaultsOnlyConfigurationService{static{a(this,"OverridableConfigurationService")}constructor(e){super(),this._overrides=e}async setConfig(e,r,n){if(this._overrides.get(e.id)===r)return;r===void 0?this._overrides.delete(e.id):this._overrides.set(e.id,r);let s=e.fullyQualifiedId;this._onDidChangeConfiguration.fire({affectsConfiguration:a(c=>s===c||s.startsWith(c+".")||c.startsWith(s+"."),"affectsConfiguration")})}getConfig(e){if(this._overrides.has(e.id)){let r=this._overrides.get(e.id);if(e.validator){let n=e.validator.validate(r);return n.error?super.getConfig(e):n.content}return r}return super.getConfig(e)}getExperimentBasedConfig(e,r){if(this._overrides.has(e.id)){let n=this._overrides.get(e.id);if(e.validator){let o=e.validator.validate(n);return o.error?super.getExperimentBasedConfig(e,r):o.content}return n}return super.getExperimentBasedConfig(e,r)}inspectConfig(e){if(this._overrides.has(e.id)){let r=this._overrides.get(e.id);if(e.validator){let n=e.validator.validate(r);return n.error?super.inspectConfig(e):{defaultValue:n.content}}return{defaultValue:r}}return super.inspectConfig(e)}},YFr=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=qFe.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},Jie=class extends WTt.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new qFe.Emitter),this.onDidTreatmentsChange=this._onDidTreatmentsChange.event,e){let n;this.waitFor=new Promise(o=>{n=o}),this.resolveWaitFor=n}else this.waitFor=Promise.resolve(),this.resolveWaitFor=()=>{}}async hasTreatments(){return this.waitFor}getTreatmentVariable(e){return this.variables[e]}async setCompletionsFilters(e){}updateTreatmentVariables(e){let r=[];for(let[n,o]of Object.entries(e))this.variables[n]!==o&&(this.variables[n]=o,r.push(n));for(let n of Object.keys(this.variables))Object.hasOwn(e,n)||(delete this.variables[n],r.push(n));r.length>0&&(this._onDidTreatmentsChange.fire({affectedTreatmentVariables:r}),this._configurationService.updateExperimentBasedConfiguration(r)),this.resolveWaitFor()}};fu.SimpleExperimentationService=Jie;fu.SimpleExperimentationService=Jie=ZFr([JN(1,fB.IConfigurationService)],Jie);var $Tt=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=qFe.Event.None,this.onDidCompleteFetch=qFe.Event.None}fetchWithPagination(e,r){return this._fetcher.fetchWithPagination(e,r)}getUserAgentLibrary(){return this._fetcher.getUserAgentLibrary()}fetch(e,r){return this._fetcher.fetch(e,r)}createWebSocket(e,r){return{webSocket:new WebSocket(e,r),responseHeaders:new n8r.HeadersImpl({}),responseStatusCode:void 0,responseStatusText:void 0,networkError:void 0}}disconnectAll(){return this._fetcher.disconnectAll()}makeAbortController(){return this._fetcher.makeAbortController()}isAbortError(e){return this._fetcher.isAbortError(e)}isInternetDisconnectedError(e){return this._fetcher.isInternetDisconnectedError(e)}isFetcherError(e){return this._fetcher.isFetcherError(e)}isNetworkProcessCrashedError(e){return this._fetcher.isNetworkProcessCrashedError(e)}getUserMessageForFetcherError(e){return this._fetcher.getUserMessageForFetcherError(e)}},VTt=class{static{a(this,"SimpleTelemetryService")}constructor(e){this._telemetrySender=e}dispose(){}sendInternalMSFTTelemetryEvent(e,r,n){}sendMSFTTelemetryEvent(e,r,n){}sendMSFTTelemetryErrorEvent(e,r,n){}sendGHTelemetryEvent(e,r,n){this._telemetrySender.sendTelemetryEvent(e,(0,BWi.eventPropertiesToSimpleObject)(r),n)}sendGHTelemetryErrorEvent(e,r,n){}sendGHTelemetryException(e,r){}sendTelemetryEvent(e,r,n,o){}sendTelemetryErrorEvent(e,r,n,o){}setSharedProperty(e,r){}setAdditionalExpAssignments(e){}postEvent(e,r){}sendEnhancedGHTelemetryEvent(e,r,n){this._telemetrySender.sendEnhancedTelemetryEvent&&this._telemetrySender.sendEnhancedTelemetryEvent(e,(0,BWi.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function H4c(t){return t.tokenizerProvider&&(0,QWi.setExternalTokenizerProvider)(t.tokenizerProvider),G4c(t).createInstance(KFr)}a(H4c,"createInlineCompletionsProvider");var KFr=class extends WTt.Disposable{static{a(this,"InlineCompletionsProvider")}constructor(e,r,n,o,s,c){super(),this._insta=e,this._expService=r,this._speculativeRequestCache=n,this._logService=o,this._configurationService=s,this._completionsConfigProvider=c,this._register(e),this.ghostText=this._insta.createInstance(t4c.GhostText)}updateTreatmentVariables(e){this._expService instanceof Jie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=fB.globalConfigRegistry.configs.get(`${fB.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}this._completionsConfigProvider instanceof dC.InMemoryConfigProvider&&this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(e))}async getInlineCompletions(e,r,n,o){let s=new VFr.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??U4c.CancellationToken.None,o,new Y5c.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};KFr=ZFr([JN(0,KWi.IInstantiationService),JN(1,jFe.IExperimentationService),JN(2,$Fr.ICompletionsSpeculativeRequestCache),JN(3,ZN.ILogService),JN(4,fB.IConfigurationService),JN(5,dC.ICompletionsConfigProvider)],KFr);var JFr=class{static{a(this,"UnwrappingTelemetrySender")}constructor(e){this.sender=e}sendTelemetryEvent(e,r,n){this.sender.sendTelemetryEvent(this.normalizeEventName(e),r,n)}sendEnhancedTelemetryEvent(e,r,n){this.sender.sendEnhancedTelemetryEvent&&this.sender.sendEnhancedTelemetryEvent(this.normalizeEventName(e),r,n)}normalizeEventName(e){let r=(0,F4c.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function G4c(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new ZN.ConsoleLog(void 0,ZN.LogLevel.Trace),f=new YWi.InstantiationServiceBuilder;f.define(FFe.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case FFe.LogLevel.DEBUG:return Kie.Debug;case FFe.LogLevel.INFO:return Kie.Info;case FFe.LogLevel.WARN:return Kie.Warning;case FFe.LogLevel.ERROR:return Kie.Error;default:return Kie.Info}}}),f.define(XFr.IAuthenticationService,r),f.define(ZN.ILogService,new bi.SyncDescriptor(ZN.LogServiceImpl,[[d||new ZN.ConsoleLog(void 0,ZN.LogLevel.Trace)]])),f.define(QFe.IIgnoreService,t.ignoreService||new QFe.NullIgnoreService),f.define(zWi.ITelemetryService,new bi.SyncDescriptor(VTt,[new JFr(c)])),f.define(fB.IConfigurationService,new bi.SyncDescriptor(GTt,[t.configOverrides??new Map])),f.define(jFe.IExperimentationService,new bi.SyncDescriptor(Jie,[t.waitForTreatmentVariables])),f.define(t8r.IEndpointProvider,t.endpointProvider),f.define(e8r.ICAPIClientService,t.capiClientService||new bi.SyncDescriptor(qWi.CAPIClientImpl)),f.define(n8r.IFetcherService,new bi.SyncDescriptor($Tt,[e])),f.define(cWi.ICompletionsTelemetryService,new bi.SyncDescriptor(cWi.CompletionsTelemetryServiceBridge)),f.define(RWi.ICompletionsRuntimeModeService,RWi.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(mWi.ICompletionsCacheService,new mWi.CompletionsCache);let h=new dC.InMemoryConfigProvider(new dC.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define(dC.ICompletionsConfigProvider,h),f.define(yWi.ICompletionsLastGhostText,new yWi.LastGhostText),f.define(AWi.ICompletionsCurrentGhostText,new AWi.CurrentGhostText),f.define($Fr.ICompletionsSpeculativeRequestCache,new $Fr.SpeculativeRequestCache),f.define(i4c.ICompletionsNotificationSender,new class{async showWarningMessage(m,...g){return await t.notificationSender.showWarningMessage(m,...g)}}),f.define(dC.ICompletionsEditorAndPluginInfo,new class{getEditorInfo(){return t.editorInfo}getEditorPluginInfo(){return t.editorPluginInfo}getRelatedPluginInfo(){return t.relatedPluginInfo}}),f.define(lWi.ICompletionsExtensionStatus,new lWi.CopilotExtensionStatus),f.define(X5c.ICompletionsFeaturesService,new bi.SyncDescriptor(Z5c.Features)),f.define(J5c.ICompletionsObservableWorkspace,new class{get openDocuments(){return s.openDocuments}getWorkspaceRoot(m){return s.getWorkspaceRoot(m)}getFirstOpenDocument(){return s.getFirstOpenDocument()}getDocument(m){return s.getDocument(m)}}),f.define(vWi.ICompletionsStatusReporter,new class extends vWi.StatusReporter{didChange(m){n.didChange(m)}}),f.define(uWi.ICompletionsCopilotTokenManager,new bi.SyncDescriptor(uWi.CopilotTokenManagerImpl,[!1])),f.define(xWi.ICompletionsTextDocumentManagerService,new bi.SyncDescriptor(class extends xWi.TextDocumentManager{constructor(){super(...arguments),this.onDidChangeTextDocument=o.onDidChangeTextDocument,this.onDidOpenTextDocument=o.onDidOpenTextDocument,this.onDidCloseTextDocument=o.onDidCloseTextDocument,this.onDidFocusTextDocument=o.onDidFocusTextDocument,this.onDidChangeWorkspaceFolders=o.onDidChangeWorkspaceFolders}getTextDocumentsUnsafe(){return o.getTextDocumentsUnsafe()}findNotebook(m){return o.findNotebook(m)}getWorkspaceFolders(){return o.getWorkspaceFolders()}})),f.define(pWi.ICompletionsFileReaderService,new bi.SyncDescriptor(pWi.FileReader)),f.define(gWi.ICompletionsBlockModeConfig,new bi.SyncDescriptor(gWi.ConfigBlockModeConfig)),f.define(IWi.ICompletionsTelemetryUserConfigService,new bi.SyncDescriptor(IWi.TelemetryUserConfig)),f.define(TWi.ICompletionsRecentEditsProviderService,new bi.SyncDescriptor(TWi.FullRecentEditsProvider,[void 0])),f.define(dWi.ICompletionsNotifierService,new bi.SyncDescriptor(dWi.CompletionNotifier)),f.define(_Wi.ICompletionsOpenAIFetcherService,new bi.SyncDescriptor(_Wi.LiveOpenAIFetcher)),f.define(P4c.ICompletionsFetchService,new bi.SyncDescriptor(D4c.CompletionsFetchService)),f.define(EWi.ICompletionsModelManagerService,new bi.SyncDescriptor(EWi.AvailableModelsManager,[!0])),f.define(hWi.ICompletionsAsyncManagerService,new bi.SyncDescriptor(hWi.AsyncCompletionManager)),f.define(bWi.ICompletionsContextProviderBridgeService,new bi.SyncDescriptor(bWi.ContextProviderBridge)),f.define(fWi.ICompletionsUserErrorNotifierService,new bi.SyncDescriptor(fWi.UserErrorNotifier)),f.define(s4c.ICompletionsRelatedFilesProviderService,new bi.SyncDescriptor(o4c.CompositeRelatedFilesProvider)),f.define(e4c.ICompletionsFileSystemService,new r4c.LocalFileSystem),f.define(UFe.ICompletionsContextProviderRegistryService,new bi.SyncDescriptor(UFe.CachedContextProviderRegistry,[UFe.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(wWi.ICompletionsPromiseQueueService,new wWi.PromiseQueue),f.define(K5c.ICompletionsCitationManager,new class{register(){return WTt.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define(SWi.ICompletionsContextProviderService,new SWi.ContextProviderStatistics),f.define(CWi.ICompletionsPromptFactoryService,new bi.SyncDescriptor(CWi.CompletionsPromptFactory)),f.define(n4c.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(UFe.ICompletionsDefaultContextProviders,new UFe.DefaultContextProvidersContainer),f.define(e9.IEnvService,new class{constructor(){this.language=void 0,this.sessionId=u.sessionId,this.machineId=u.machineId,this.devDeviceId=u.machineId,this.vscodeVersion=t.editorInfo.version,this.isActive=!0,this.onDidChangeWindowState=qFe.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?e9.OperatingSystem.Macintosh:process.platform==="win32"?e9.OperatingSystem.Windows:e9.OperatingSystem.Linux,this.uriScheme="",this.extensionId=t.editorPluginInfo.name,this.appRoot=t.editorInfo.root??"",this.shell=""}isProduction(){return dC.BuildInfo.isProduction()}isPreRelease(){return dC.BuildInfo.isPreRelease()}isSimulation(){return t.isRunningInTest===!0}getBuildType(){return dC.BuildInfo.getBuildType()===dC.BuildType.DEV?"dev":"prod"}getVersion(){return dC.BuildInfo.getVersion()}getBuild(){return dC.BuildInfo.getBuild()}getName(){return t.editorInfo.name}getEditorInfo(){return new e9.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new e9.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(r8r.ILanguageContextProviderService,t.languageContextProvider??new HWi.NullLanguageContextProviderService),f.define(GWi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new bi.SyncDescriptor($Wi.TestLanguageDiagnosticsService)),f.define(VWi.IRequestLogger,new bi.SyncDescriptor(WWi.NullRequestLogger)),f.seal()}a(G4c,"setupCompletionServices")});function qt(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r}function Ie(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var WS=Se(()=>{p();a(qt,"__classPrivateFieldSet");a(Ie,"__classPrivateFieldGet")});var JEe,_It=Se(()=>{p();JEe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return JEe=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))},"uuid4")});function s9(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var ZFe,ZEe=Se(()=>{p();a(s9,"isAbortError");ZFe=a(t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)},"castToError")});var mr,Fh,qy,EW,XEe,eve,tve,rve,nve,ive,ove,sve,ave,Wf=Se(()=>{p();ZEe();mr=class extends Error{static{a(this,"AnthropicError")}},Fh=class t extends mr{static{a(this,"APIError")}constructor(e,r,n,o,s){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("request-id"),this.error=r,this.type=s??null}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new EW({message:n,cause:ZFe(r)});let s=r,c=s?.error?.type;return e===400?new eve(e,s,n,o,c):e===401?new tve(e,s,n,o,c):e===403?new rve(e,s,n,o,c):e===404?new nve(e,s,n,o,c):e===409?new ive(e,s,n,o,c):e===422?new ove(e,s,n,o,c):e===429?new sve(e,s,n,o,c):e>=500?new ave(e,s,n,o,c):new t(e,s,n,o,c)}},qy=class extends Fh{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},EW=class extends Fh{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},XEe=class extends EW{static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},eve=class extends Fh{static{a(this,"BadRequestError")}},tve=class extends Fh{static{a(this,"AuthenticationError")}},rve=class extends Fh{static{a(this,"PermissionDeniedError")}},nve=class extends Fh{static{a(this,"NotFoundError")}},ive=class extends Fh{static{a(this,"ConflictError")}},ove=class extends Fh{static{a(this,"UnprocessableEntityError")}},sve=class extends Fh{static{a(this,"RateLimitError")}},ave=class extends Fh{static{a(this,"InternalServerError")}}});function EIt(t){return typeof t!="object"?{}:t??{}}function K8r(t){if(!t)return!0;for(let e in t)return!1;return!0}function PYi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var lFc,kYi,yE,Y8r,DYi,vIt,hB=Se(()=>{p();Wf();lFc=/^[a-z][a-z0-9+.-]*:/i,kYi=a(t=>lFc.test(t),"isAbsoluteURL"),yE=a(t=>(yE=Array.isArray,yE(t)),"isArray"),Y8r=yE;a(EIt,"maybeObj");a(K8r,"isEmptyObj");a(PYi,"hasOwn");DYi=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new mr(`${t} must be an integer`);if(e<0)throw new mr(`${t} must be a positive integer`);return e},"validatePositiveInteger"),vIt=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var nM,cve=Se(()=>{p();nM=a((t,e)=>new Promise(r=>{if(e?.aborted)return r();let n=a(()=>{clearTimeout(o),r()},"onAbort"),o=setTimeout(()=>{e?.removeEventListener("abort",n),r()},t);e?.addEventListener("abort",n,{once:!0})}),"sleep")});var kk,XFe=Se(()=>{p();kk="0.98.0"});function uFc(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function fFc(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,s=n[2]||0,c=n[3]||0;return{browser:e,version:`${o}.${s}.${c}`}}}return null}var LYi,dFc,NYi,MYi,OYi,e8e,CIt=Se(()=>{p();XFe();LYi=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a(uFc,"getDetectedPlatform");dFc=a(()=>{let t=uFc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kk,"X-Stainless-OS":MYi(Deno.build.os),"X-Stainless-Arch":NYi(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kk,"X-Stainless-OS":MYi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":NYi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=fFc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(fFc,"getBrowserInfo");NYi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),MYi=a(t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),"normalizePlatform"),e8e=a(()=>OYi??(OYi=dFc()),"getPlatformHeaders")});function BYi(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function J8r(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function bIt(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return J8r({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function t8e(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function FYi(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}var lve=Se(()=>{p();a(BYi,"getDefaultFetch");a(J8r,"makeReadableStream");a(bIt,"ReadableStreamFrom");a(t8e,"ReadableStreamToAsyncIterable");a(FYi,"CancelReadableStream")});var UYi,QYi=Se(()=>{p();UYi=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var Z8r,X8r,e6r,qYi,t6r=Se(()=>{p();Z8r="RFC3986",X8r=a(t=>String(t),"default_formatter"),e6r={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:X8r},qYi="RFC1738"});function HYi(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function n6r(t,e){if(yE(t)){let r=[];for(let n=0;n{p();t6r();hB();SIt=a((t,e)=>(SIt=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),SIt(t,e)),"has"),mB=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),r6r=1024,jYi=a((t,e,r,n,o)=>{if(t.length===0)return t;let s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});let c="";for(let l=0;l=r6r?s.slice(l,l+r6r):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===qYi&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=mB[h];continue}if(h<2048){d[d.length]=mB[192|h>>6]+mB[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=mB[224|h>>12]+mB[128|h>>6&63]+mB[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=mB[240|h>>18]+mB[128|h>>12&63]+mB[128|h>>6&63]+mB[128|h&63]}c+=d.join("")}return c},"encode");a(HYi,"is_buffer");a(n6r,"maybe_map")});function mFc(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function zYi(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E){let v=t,S=E,T=0,w=!1;for(;(S=S.get(i6r))!==void 0&&!w;){let N=S.get(t);if(T+=1,typeof N<"u"){if(N===T)throw new RangeError("Cyclic object value");w=!0}typeof S.get(i6r)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&yE(v)&&(v=n6r(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,Vg.encoder,_,"key",g):e;v=""}if(mFc(v)||HYi(v)){if(u){let N=y?e:u(e,Vg.encoder,_,"key",g);return[A?.(N)+"="+A?.(u(v,Vg.encoder,_,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&yE(v))y&&u&&(v=n6r(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if(yE(d))x=d;else{let N=Object.keys(v);x=f?N.sort(f):N}let k=l?String(e).replace(/\./g,"%2E"):String(e),D=n&&yE(v)&&v.length===1?k+"[]":k;if(o&&yE(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:Vg.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Vg.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Vg.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Vg.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Vg.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Vg.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Vg.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Vg.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Vg.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Vg.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Vg.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Vg.strictNullHandling}}function YYi(t,e={}){let r=t,n=gFc(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):yE(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=VYi[n.arrayFormat],u=l==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);let d=new WeakMap;for(let m=0;m0?h+f:""}var VYi,WYi,$Yi,Vg,i6r,KYi=Se(()=>{p();GYi();t6r();hB();VYi={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},WYi=a(function(t,e){Array.prototype.push.apply(t,yE(e)?e:[e])},"push_to_array"),Vg={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:jYi,encodeValuesOnly:!1,format:Z8r,formatter:X8r,indices:!1,serializeDate(t){return($Yi??($Yi=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(mFc,"is_non_nullish_primitive");i6r={};a(zYi,"inner_stringify");a(gFc,"normalize_stringify_options");a(YYi,"stringify")});function JYi(t){return YYi(t,{arrayFormat:"brackets"})}var o6r=Se(()=>{p();KYi();a(JYi,"stringifyQuery")});function IIt(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new ol(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new ol(`Refusing to send credential over non-https token endpoint "${t}"`)}async function xIt(t,e){let r=await _Fc(t),n;try{n=JSON.parse(r)}catch{throw new ol(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,zS(r),e)}if(!n.access_token)throw new ol(`Token endpoint response missing access_token: ${JSON.stringify(zS(n))}`,t.status,zS(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new ol(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,zS(n),e);return n}function zS(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=s6r?t:t.slice(0,s6r)+`... <${t.length-s6r} more chars>`}return JSON.stringify(zS(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))yFc.has(r)&&(e[r]=n);return e}return null}async function wIt(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new ol(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new ol(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function RIt(t,e){let r=await import("node:fs"),o=(await import("node:path")).dirname(t);await r.promises.mkdir(o,{recursive:!0,mode:448});let s=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let c=await r.promises.open(s,"w",384);try{await c.writeFile(JSON.stringify(e,null,2)),await c.sync()}finally{await c.close()}await r.promises.rename(s,t)}catch(c){throw await r.promises.unlink(s).catch(()=>{}),c}try{let c=await r.promises.open(o,"r");try{await c.sync()}finally{await c.close()}}catch{}}async function _Fc(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:s,value:c}=await e.read();if(s)break;if(n+c.length>ZYi){let l=ZYi-n;l>0&&r.push(c.subarray(0,l)),await e.cancel();break}r.push(c),n+=c.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((c,l)=>c+l.length,0));let s=0;for(let c of r)o.set(c,s),s+=c.length}return new TextDecoder("utf-8").decode(o)}var XYi,eKi,TIt,ooe,tKi,rKi,uve,nKi,ZYi,s6r,yFc,ol,dve=Se(()=>{p();Wf();XYi="urn:ietf:params:oauth:grant-type:jwt-bearer",eKi="refresh_token",TIt="/v1/oauth/token",ooe="oauth-2025-04-20",tKi="oidc-federation-2026-04-01",rKi=120,uve=30,nKi=5,ZYi=1<<20;a(IIt,"requireSecureTokenEndpoint");a(xIt,"parseTokenResponse");s6r=2e3,yFc=new Set(["error","error_description","error_uri"]);a(zS,"redactSensitive");a(wIt,"checkCredentialsFileSafety");a(RIt,"writeCredentialsFileAtomic");a(_Fc,"readLimitedText");ol=class extends mr{static{a(this,"WorkloadIdentityError")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}}});function iM(){return Math.floor(Date.now()/1e3)}var r8e=Se(()=>{p();a(iM,"nowAsSeconds")});var kIt,iKi=Se(()=>{p();dve();r8e();kIt=class{static{a(this,"TokenCache")}constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-iM();return n>rKi?r.token:n>uve?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||iM()-this.lastAdvisoryError{this.lastAdvisoryError=iM(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}}});var wa,n8e=Se(()=>{p();wa=a(t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0},"readEnv")});function aKi(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function fve(t){let e;return(oKi??(e=new globalThis.TextEncoder,oKi=e.encode.bind(e)))(t)}function a6r(t){let e;return(sKi??(e=new globalThis.TextDecoder,sKi=e.decode.bind(e)))(t)}var oKi,sKi,PIt=Se(()=>{p();a(aKi,"concatBytes");a(fve,"encodeUTF8");a(a6r,"decodeUTF8")});var cKi=Se(()=>{p();Wf();PIt()});function i8e(){}function DIt(t,e,r){return!e||NIt[t]>NIt[r]?i8e:e[t].bind(e)}function xl(t){let e=t.logger,r=t.logLevel??"off";if(!e)return EFc;let n=lKi.get(e);if(n&&n[0]===r)return n[1];let o={error:DIt("error",e,r),warn:DIt("warn",e,r),info:DIt("info",e,r),debug:DIt("debug",e,r)};return lKi.set(e,[r,o]),o}var NIt,c6r,EFc,lKi,a9,c9=Se(()=>{p();hB();NIt={off:0,error:200,warn:300,info:400,debug:500},c6r=a((t,e,r)=>{if(t){if(PYi(NIt,t))return t;xl(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(NIt))}`)}},"parseLogLevel");a(i8e,"noop");a(DIt,"makeLogFn");EFc={error:i8e,warn:i8e,info:i8e,debug:i8e},lKi=new WeakMap;a(xl,"loggerFor");a9=a(t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t),"formatRequestDetails")});var l6r=Se(()=>{p();hB();cKi();n8e();c9();_It();cve();o6r()});function uKi(t){if(!t)throw new Error("profile name is empty");if(t==="."||t==="..")throw new Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw new Error(`profile name "${t}" must not contain path separators`);if(!vFc.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var MIt,vFc,dKi,fKi,u6r,CFc,pKi,d6r=Se(()=>{p();CIt();l6r();MIt="1.0",vFc=/^[A-Za-z0-9_.-]+$/;a(uKi,"validateProfileName");dKi=a(async t=>{var e,r;let n=await u6r();if(n===null)return null;let o=t??await pKi();if(o===null)return null;uKi(o);let s=await import("node:fs"),l=(await import("node:path")).join(n,"configs",`${o}.json`),u;try{u=await s.promises.readFile(l,"utf-8")}catch(h){if(h?.code!=="ENOENT")throw new Error(`failed to read config file ${l}: ${h}`);u=null}if(u===null){let h=wa("ANTHROPIC_ORGANIZATION_ID"),m=wa("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=wa("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:wa("ANTHROPIC_WORKSPACE_ID"),base_url:wa("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:wa("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:wa("ANTHROPIC_SCOPE")}}}:null}let d;try{d=JSON.parse(u)}catch(h){throw new Error(`failed to parse config file ${l}: ${h}`)}if(!d.authentication)throw new Error(`config file ${l} is missing "authentication"`);let f=d.authentication.type;if(f!=="oidc_federation"&&f!=="user_oauth")throw new Error(`authentication.type "${f}" is not a known authentication type`);if(d.organization_id??(d.organization_id=wa("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=wa("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=wa("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=wa("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=wa("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=wa("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=wa("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),fKi=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await u6r();if(!r)return null;let n=e??await pKi();return n?(uKi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),u6r=a(async()=>{if(!CFc())return null;let t=await import("node:path"),e=wa("ANTHROPIC_CONFIG_DIR");if(e)return e;if(e8e()["X-Stainless-OS"]==="Windows"){let s=wa("APPDATA");if(s)return t.join(s,"Anthropic");let c=wa("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=wa("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=wa("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),CFc=a(()=>{let t=e8e()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),pKi=a(async()=>{let t=await u6r();if(!t)return null;let e=wa("ANTHROPIC_PROFILE");if(e)return e;let r=await import("node:fs"),o=(await import("node:path")).join(t,"active_config");try{return(await r.promises.readFile(o,"utf-8")).trim()||"default"}catch(s){if(s?.code!=="ENOENT")throw new Error(`failed to read ${o}: ${s}`);return"default"}},"getActiveProfileName")});function f6r(t){if(!t)throw new mr("Identity token file path is empty");return async()=>{let e=await import("node:fs"),r;try{r=await e.promises.readFile(t,"utf-8")}catch(o){throw new mr(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new mr(`Identity token file at ${t} is empty`);return n}}function hKi(t){if(!t)throw new mr("Identity token value is empty");return()=>t}var mKi=Se(()=>{p();Wf();a(f6r,"identityTokenFromFile");a(hKi,"identityTokenFromValue")});function gKi(t){return async()=>{IIt(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new ol(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:XYi,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${TIt}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${ooe},${tKi}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${kk} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new ol(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=zS(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new ol(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await xIt(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new ol(`Token endpoint response missing required fields: ${JSON.stringify(zS(c))}`,o.status,zS(c),s);return{token:c.access_token,expiresAt:iM()+l}}}var AKi=Se(()=>{p();dve();r8e();XFe();a(gKi,"oidcFederationProvider")});function yKi(t){return async e=>{let r=await import("node:fs");await wIt(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(_){throw new ol(`Credentials file not found at ${t.credentialsPath}: ${_}`)}let o;try{o=JSON.parse(n)}catch(_){throw new ol(`Credentials file at ${t.credentialsPath} is not valid JSON: ${_}`)}let s=o.access_token;if(!s)throw new ol(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||iM()"");throw new ol(`User OAuth refresh failed (HTTP ${f.status}): ${zS(_)}`,f.status,zS(_),h)}let m=await xIt(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new ol(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(zS(m))}`,f.status,zS(m),h);let A=iM()+g,y=m.refresh_token||l;return await RIt(t.credentialsPath,{...o,version:MIt,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var _Ki=Se(()=>{p();d6r();dve();r8e();XFe();a(yKi,"userOAuthProvider")});function p6r(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=bFc(t,r,n,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:o,extraHeaders:s,baseURL:t.base_url||void 0}}async function EKi(t,e){let r=await dKi(e);if(!r)return null;let{config:n,fromFile:o}=r,s=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await fKi(n,e)??void 0}};return p6r(s,t)}function bFc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=SFc(o);if(!s)throw new ol("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new ol("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new ol("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=gKi({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:t.organization_id,serviceAccountId:o.service_account_id,workspaceId:t.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});return e?TFc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new ol("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return yKi({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new ol(`authentication.type "${o}" is not a known authentication type`)}}}function SFc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new ol(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new ol('identity_token.source "file" requires a non-empty path');return f6r(t.identity_token.path)}let e=wa("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return f6r(e);let r=wa("ANTHROPIC_IDENTITY_TOKEN");return r?hKi(r):null}function TFc(t,e,r,n){return async o=>{let s=await import("node:fs");await wIt(e,n);let c;try{let u=await s.promises.readFile(e,"utf-8");c=JSON.parse(u);let d=c?.access_token;if(d&&!o?.forceRefresh){let f=c?.expires_at;if(f==null||iM(){p();n8e();d6r();dve();r8e();mKi();AKi();_Ki();a(p6r,"resolveCredentialsFromConfig");a(EKi,"defaultCredentials");a(bFc,"buildProvider");a(SFc,"resolveIdentityTokenProvider");a(TFc,"cachedExchangeProvider")});function IFc(t,e){for(let o=e??0;o{p();WS();PIt();l9=class{static{a(this,"LineDecoder")}constructor(){$I.set(this,void 0),VI.set(this,void 0),qt(this,$I,new Uint8Array,"f"),qt(this,VI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?fve(e):e;qt(this,$I,aKi([Ie(this,$I,"f"),r]),"f");let n=[],o;for(;(o=IFc(Ie(this,$I,"f"),Ie(this,VI,"f")))!=null;){if(o.carriage&&Ie(this,VI,"f")==null){qt(this,VI,o.index,"f");continue}if(Ie(this,VI,"f")!=null&&(o.index!==Ie(this,VI,"f")+1||o.carriage)){n.push(a6r(Ie(this,$I,"f").subarray(0,Ie(this,VI,"f")-1))),qt(this,$I,Ie(this,$I,"f").subarray(Ie(this,VI,"f")),"f"),qt(this,VI,null,"f");continue}let s=Ie(this,VI,"f")!==null?o.preceding-1:o.preceding,c=a6r(Ie(this,$I,"f").subarray(0,s));n.push(c),qt(this,$I,Ie(this,$I,"f").subarray(o.index),"f"),qt(this,VI,null,"f")}return n}flush(){return Ie(this,$I,"f").length?this.decode(` `):[]}};$I=new WeakMap,VI=new WeakMap;l9.NEWLINE_CHARS=new Set([` -`,"\r"]);l9.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(SFc,"findNewlineIndex");a(EKi,"findDoubleNewlineIndex")});async function*TFc(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new mr("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new mr("Attempted to iterate over a response with no body");let r=new h6r,n=new l9,o=t8e(t.body);for await(let s of IFc(o))for(let c of n.decode(s)){let l=r.decode(c);l&&(yield l)}for(let s of n.flush()){let c=r.decode(s);c&&(yield c)}}async function*IFc(t){let e=new Uint8Array;for await(let r of t){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?fve(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=EKi(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function xFc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var o8e,gB,h6r,m6r=Se(()=>{p();WS();Wf();lve();p6r();lve();ZEe();hB();kIt();c9();Wf();gB=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,o8e.set(this,void 0),this.controller=r,qt(this,o8e,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?xl(n):console;async function*c(){if(o)throw new mr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of TFc(e,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop"||u.event==="message"||u.event==="user.message"||u.event==="user.interrupt"||u.event==="user.tool_confirmation"||u.event==="user.custom_tool_result"||u.event==="user.tool_result"||u.event==="agent.message"||u.event==="agent.thinking"||u.event==="agent.tool_use"||u.event==="agent.tool_result"||u.event==="agent.mcp_tool_use"||u.event==="agent.mcp_tool_result"||u.event==="agent.custom_tool_use"||u.event==="agent.thread_context_compacted"||u.event==="session.status_running"||u.event==="session.status_idle"||u.event==="session.status_rescheduled"||u.event==="session.status_terminated"||u.event==="session.error"||u.event==="session.deleted"||u.event==="session.updated"||u.event==="span.model_request_start"||u.event==="span.model_request_end"||u.event==="span.outcome_evaluation_start"||u.event==="span.outcome_evaluation_ongoing"||u.event==="span.outcome_evaluation_end"||u.event==="user.define_outcome"||u.event==="agent.thread_message_received"||u.event==="agent.thread_message_sent"||u.event==="agent.session_thread_message_received"||u.event==="agent.session_thread_message_sent"||u.event==="session.thread_created"||u.event==="session.thread_status_created"||u.event==="session.thread_status_running"||u.event==="session.thread_status_idle"||u.event==="session.thread_status_rescheduled"||u.event==="session.thread_status_terminated")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error"){let d=EIt(u.data)??u.data,f=d?.error?.type;throw new Fh(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(s9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*s(){let l=new l9,u=t8e(e);for await(let d of u)for(let f of l.decode(d))yield f;for(let d of l.flush())yield d}a(s,"iterLines");async function*c(){if(o)throw new mr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of s())l||u&&(yield JSON.parse(u));l=!0}catch(u){if(s9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(o8e=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=a(s=>({next:a(()=>{if(s.length===0){let c=n.next();e.push(c),r.push(c)}return s.shift()},"next")}),"teeIterator");return[new t(()=>o(e),this.controller,Ie(this,o8e,"f")),new t(()=>o(r),this.controller,Ie(this,o8e,"f"))]}toReadableStream(){let e=this,r;return K8r({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:s}=await r.next();if(s)return n.close();let c=fve(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(TFc,"_iterSSEMessages");a(IFc,"iterSSEChunks");h6r=class{static{a(this,"SSEDecoder")}constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=xFc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(xFc,"partition")});async function MIt(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return xl(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):gB.fromSSEResponse(r,e.controller);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let u=r.headers.get("content-type")?.split(";")[0]?.trim();if(u?.includes("application/json")||u?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let m=await r.json();return g6r(m,r)}return await r.text()})();return xl(t).debug(`[${n}] response parsed`,a9({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function g6r(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}var A6r=Se(()=>{p();m6r();c9();a(MIt,"defaultParseResponse");a(g6r,"addRequestID")});var s8e,ooe,OIt=Se(()=>{p();WS();A6r();ooe=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=MIt){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,s8e.set(this,void 0),qt(this,s8e,e,"f")}_thenUnwrap(e){return new t(Ie(this,s8e,"f"),this.responsePromise,async(r,n)=>g6r(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(Ie(this,s8e,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};s8e=new WeakMap});var LIt,BIt,a8e,Pk,Ra,Dd=Se(()=>{p();WS();Wf();A6r();OIt();hB();BIt=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){LIt.set(this,void 0),qt(this,LIt,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new mr("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await Ie(this,LIt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(LIt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},a8e=class extends ooe{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await MIt(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},Pk=class extends BIt{static{a(this,"Page")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{..._It(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{..._It(this.options.query),after_id:e}}:null}},Ra=class extends BIt{static{a(this,"PageCursor")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{..._It(this.options.query),page:e}}:null}}});function soe(t,e,r){return _6r(),new File(t,e??"unknown_file",r)}function c8e(t,e){let r=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?r.split(/[\\/]/).pop()||void 0:r}function RFc(t){let e=typeof t=="function"?t:t.fetch,r=vKi.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return vKi.set(e,n),n}var _6r,E6r,pve,vKi,kFc,PFc,y6r,hve=Se(()=>{p();lve();_6r=a(()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},"checkFileSupport");a(soe,"makeFile");a(c8e,"getName");E6r=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),pve=a(async(t,e,r=!0)=>({...t,body:await kFc(t.body,e,r)}),"multipartFormRequestOptions"),vKi=new WeakMap;a(RFc,"supportsFormData");kFc=a(async(t,e,r=!0)=>{if(!await RFc(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([o,s])=>y6r(n,o,s,r))),n},"createForm"),PFc=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),y6r=a(async(t,e,r,n)=>{if(r!==void 0){if(r==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response){let o={},s=r.headers.get("Content-Type");s&&(o={type:s}),t.append(e,soe([await r.blob()],c8e(r,n),o))}else if(E6r(r))t.append(e,soe([await new Response(CIt(r)).blob()],c8e(r,n)));else if(PFc(r))t.append(e,soe([r],c8e(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>y6r(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>y6r(t,`${e}[${o}]`,s,n)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},"addFormValue")});async function FIt(t,e,r){if(_6r(),t=await t,e||(e=c8e(t,!0)),DFc(t))return t instanceof File&&e==null&&r==null?t:soe([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(NFc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),soe(await v6r(o),e,r)}let n=await v6r(t);if(!r?.type){let o=n.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(r={...r,type:o})}return soe(n,e,r)}async function v6r(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(CKi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(E6r(t))for await(let r of t)e.push(...await v6r(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${MFc(t)}`)}return e}function MFc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var CKi,DFc,NFc,bKi=Se(()=>{p();hve();hve();CKi=a(t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function","isBlobLike"),DFc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&CKi(t),"isFileLike"),NFc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(FIt,"toFile");a(v6r,"getBytes");a(MFc,"propsForError")});var C6r=Se(()=>{p();bKi()});var SKi=Se(()=>{p()});var _i,Jl=Se(()=>{p();_i=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*LFc(t){if(!t)return;if(TKi in t){let{values:n,nulls:o}=t;yield*n.entries();for(let s of o)yield[s,null];return}let e=!1,r;t instanceof Headers?r=t.entries():z8r(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw new TypeError("expected header name to be a string");let s=z8r(n[1])?n[1]:[n[1]],c=!1;for(let l of s)l!==void 0&&(e&&!c&&(c=!0,yield[o,null]),yield[o,l])}}var TKi,Et,Dc=Se(()=>{p();hB();TKi=Symbol.for("brand.privateNullableHeaders");a(LFc,"iterateHeaders");Et=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of LFc(n)){let l=s.toLowerCase();o.has(l)||(e.delete(s),o.add(l)),c===null?(e.delete(s),r.add(l)):(e.append(s,c),r.delete(l))}}return{[TKi]:!0,values:e,nulls:r}},"buildHeaders")});function UIt(t){return typeof t=="object"&&t!==null&&l8e in t}function b6r(t,e){let r=new Set;if(t)for(let n of t)UIt(n)&&r.add(n[l8e]);if(e){for(let n of e)if(UIt(n)&&r.add(n[l8e]),Array.isArray(n.content))for(let o of n.content)UIt(o)&&r.add(o[l8e])}return Array.from(r)}function QIt(t,e){let r=b6r(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function IKi(t){return UIt(t)?{"x-stainless-helper":t[l8e]}:{}}var l8e,u8e=Se(()=>{p();l8e=Symbol("anthropic.sdk.stainlessHelper");a(UIt,"wasCreatedByStainlessHelper");a(b6r,"collectStainlessHelpers");a(QIt,"stainlessHelperHeader");a(IKi,"stainlessHelperHeaderFromFile")});function wKi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var xKi,BFc,cr,zf=Se(()=>{p();Wf();a(wKi,"encodeURIPath");xKi=Object.freeze(Object.create(null)),BFc=a((t=wKi)=>a(function(r,...n){if(r.length===1)return r[0];let o=!1,s=[],c=r.reduce((f,h,m)=>{/[?#]/.test(h)&&(o=!0);let g=n[m],A=(o?encodeURIComponent:t)(""+g);return m!==n.length&&(g==null||typeof g=="object"&&g.toString===Object.getPrototypeOf(Object.getPrototypeOf(g.hasOwnProperty??xKi)??xKi)?.toString)&&(A=g+"",s.push({start:f.length+h.length,length:A.length,error:`Value of type ${Object.prototype.toString.call(g).slice(8,-1)} is not a valid path parameter`})),f+h+(m===n.length?"":A)},""),l=c.split(/[?#]/,1)[0],u=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,d;for(;(d=u.exec(l))!==null;)s.push({start:d.index,length:d[0].length,error:`Value "${d[0]}" can't be safely passed as a path parameter`});if(s.sort((f,h)=>f.start-h.start),s.length>0){let f=0,h=s.reduce((m,g)=>{let A=" ".repeat(g.start-f),y="^".repeat(g.length);return f=g.start+g.length,m+A+y},"");throw new mr(`Path parameters result in path with invalid segments: +`,"\r"]);l9.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(IFc,"findNewlineIndex");a(CKi,"findDoubleNewlineIndex")});async function*xFc(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new mr("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new mr("Attempted to iterate over a response with no body");let r=new m6r,n=new l9,o=t8e(t.body);for await(let s of wFc(o))for(let c of n.decode(s)){let l=r.decode(c);l&&(yield l)}for(let s of n.flush()){let c=r.decode(s);c&&(yield c)}}async function*wFc(t){let e=new Uint8Array;for await(let r of t){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?fve(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=CKi(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function RFc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var o8e,gB,m6r,g6r=Se(()=>{p();WS();Wf();lve();h6r();lve();ZEe();hB();PIt();c9();Wf();gB=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,o8e.set(this,void 0),this.controller=r,qt(this,o8e,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?xl(n):console;async function*c(){if(o)throw new mr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of xFc(e,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop"||u.event==="message"||u.event==="user.message"||u.event==="user.interrupt"||u.event==="user.tool_confirmation"||u.event==="user.custom_tool_result"||u.event==="user.tool_result"||u.event==="agent.message"||u.event==="agent.thinking"||u.event==="agent.tool_use"||u.event==="agent.tool_result"||u.event==="agent.mcp_tool_use"||u.event==="agent.mcp_tool_result"||u.event==="agent.custom_tool_use"||u.event==="agent.thread_context_compacted"||u.event==="session.status_running"||u.event==="session.status_idle"||u.event==="session.status_rescheduled"||u.event==="session.status_terminated"||u.event==="session.error"||u.event==="session.deleted"||u.event==="session.updated"||u.event==="span.model_request_start"||u.event==="span.model_request_end"||u.event==="span.outcome_evaluation_start"||u.event==="span.outcome_evaluation_ongoing"||u.event==="span.outcome_evaluation_end"||u.event==="user.define_outcome"||u.event==="agent.thread_message_received"||u.event==="agent.thread_message_sent"||u.event==="agent.session_thread_message_received"||u.event==="agent.session_thread_message_sent"||u.event==="session.thread_created"||u.event==="session.thread_status_created"||u.event==="session.thread_status_running"||u.event==="session.thread_status_idle"||u.event==="session.thread_status_rescheduled"||u.event==="session.thread_status_terminated")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error"){let d=vIt(u.data)??u.data,f=d?.error?.type;throw new Fh(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(s9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*s(){let l=new l9,u=t8e(e);for await(let d of u)for(let f of l.decode(d))yield f;for(let d of l.flush())yield d}a(s,"iterLines");async function*c(){if(o)throw new mr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of s())l||u&&(yield JSON.parse(u));l=!0}catch(u){if(s9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(o8e=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=a(s=>({next:a(()=>{if(s.length===0){let c=n.next();e.push(c),r.push(c)}return s.shift()},"next")}),"teeIterator");return[new t(()=>o(e),this.controller,Ie(this,o8e,"f")),new t(()=>o(r),this.controller,Ie(this,o8e,"f"))]}toReadableStream(){let e=this,r;return J8r({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:s}=await r.next();if(s)return n.close();let c=fve(JSON.stringify(o)+` +`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(xFc,"_iterSSEMessages");a(wFc,"iterSSEChunks");m6r=class{static{a(this,"SSEDecoder")}constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=RFc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(RFc,"partition")});async function OIt(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return xl(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):gB.fromSSEResponse(r,e.controller);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let u=r.headers.get("content-type")?.split(";")[0]?.trim();if(u?.includes("application/json")||u?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let m=await r.json();return A6r(m,r)}return await r.text()})();return xl(t).debug(`[${n}] response parsed`,a9({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function A6r(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}var y6r=Se(()=>{p();g6r();c9();a(OIt,"defaultParseResponse");a(A6r,"addRequestID")});var s8e,soe,LIt=Se(()=>{p();WS();y6r();soe=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=OIt){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,s8e.set(this,void 0),qt(this,s8e,e,"f")}_thenUnwrap(e){return new t(Ie(this,s8e,"f"),this.responsePromise,async(r,n)=>A6r(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(Ie(this,s8e,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};s8e=new WeakMap});var BIt,FIt,a8e,Pk,Ra,Nd=Se(()=>{p();WS();Wf();y6r();LIt();hB();FIt=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){BIt.set(this,void 0),qt(this,BIt,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new mr("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await Ie(this,BIt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(BIt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},a8e=class extends soe{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await OIt(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},Pk=class extends FIt{static{a(this,"Page")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...EIt(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...EIt(this.options.query),after_id:e}}:null}},Ra=class extends FIt{static{a(this,"PageCursor")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...EIt(this.options.query),page:e}}:null}}});function aoe(t,e,r){return E6r(),new File(t,e??"unknown_file",r)}function c8e(t,e){let r=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?r.split(/[\\/]/).pop()||void 0:r}function PFc(t){let e=typeof t=="function"?t:t.fetch,r=bKi.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return bKi.set(e,n),n}var E6r,v6r,pve,bKi,DFc,NFc,_6r,hve=Se(()=>{p();lve();E6r=a(()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},"checkFileSupport");a(aoe,"makeFile");a(c8e,"getName");v6r=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),pve=a(async(t,e,r=!0)=>({...t,body:await DFc(t.body,e,r)}),"multipartFormRequestOptions"),bKi=new WeakMap;a(PFc,"supportsFormData");DFc=a(async(t,e,r=!0)=>{if(!await PFc(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([o,s])=>_6r(n,o,s,r))),n},"createForm"),NFc=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),_6r=a(async(t,e,r,n)=>{if(r!==void 0){if(r==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response){let o={},s=r.headers.get("Content-Type");s&&(o={type:s}),t.append(e,aoe([await r.blob()],c8e(r,n),o))}else if(v6r(r))t.append(e,aoe([await new Response(bIt(r)).blob()],c8e(r,n)));else if(NFc(r))t.append(e,aoe([r],c8e(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>_6r(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>_6r(t,`${e}[${o}]`,s,n)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},"addFormValue")});async function UIt(t,e,r){if(E6r(),t=await t,e||(e=c8e(t,!0)),MFc(t))return t instanceof File&&e==null&&r==null?t:aoe([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(OFc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),aoe(await C6r(o),e,r)}let n=await C6r(t);if(!r?.type){let o=n.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(r={...r,type:o})}return aoe(n,e,r)}async function C6r(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(SKi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(v6r(t))for await(let r of t)e.push(...await C6r(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${LFc(t)}`)}return e}function LFc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var SKi,MFc,OFc,TKi=Se(()=>{p();hve();hve();SKi=a(t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function","isBlobLike"),MFc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&SKi(t),"isFileLike"),OFc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(UIt,"toFile");a(C6r,"getBytes");a(LFc,"propsForError")});var b6r=Se(()=>{p();TKi()});var IKi=Se(()=>{p()});var _i,Jl=Se(()=>{p();_i=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*FFc(t){if(!t)return;if(xKi in t){let{values:n,nulls:o}=t;yield*n.entries();for(let s of o)yield[s,null];return}let e=!1,r;t instanceof Headers?r=t.entries():Y8r(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw new TypeError("expected header name to be a string");let s=Y8r(n[1])?n[1]:[n[1]],c=!1;for(let l of s)l!==void 0&&(e&&!c&&(c=!0,yield[o,null]),yield[o,l])}}var xKi,Et,Dc=Se(()=>{p();hB();xKi=Symbol.for("brand.privateNullableHeaders");a(FFc,"iterateHeaders");Et=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of FFc(n)){let l=s.toLowerCase();o.has(l)||(e.delete(s),o.add(l)),c===null?(e.delete(s),r.add(l)):(e.append(s,c),r.delete(l))}}return{[xKi]:!0,values:e,nulls:r}},"buildHeaders")});function QIt(t){return typeof t=="object"&&t!==null&&l8e in t}function S6r(t,e){let r=new Set;if(t)for(let n of t)QIt(n)&&r.add(n[l8e]);if(e){for(let n of e)if(QIt(n)&&r.add(n[l8e]),Array.isArray(n.content))for(let o of n.content)QIt(o)&&r.add(o[l8e])}return Array.from(r)}function qIt(t,e){let r=S6r(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function wKi(t){return QIt(t)?{"x-stainless-helper":t[l8e]}:{}}var l8e,u8e=Se(()=>{p();l8e=Symbol("anthropic.sdk.stainlessHelper");a(QIt,"wasCreatedByStainlessHelper");a(S6r,"collectStainlessHelpers");a(qIt,"stainlessHelperHeader");a(wKi,"stainlessHelperHeaderFromFile")});function kKi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var RKi,UFc,cr,zf=Se(()=>{p();Wf();a(kKi,"encodeURIPath");RKi=Object.freeze(Object.create(null)),UFc=a((t=kKi)=>a(function(r,...n){if(r.length===1)return r[0];let o=!1,s=[],c=r.reduce((f,h,m)=>{/[?#]/.test(h)&&(o=!0);let g=n[m],A=(o?encodeURIComponent:t)(""+g);return m!==n.length&&(g==null||typeof g=="object"&&g.toString===Object.getPrototypeOf(Object.getPrototypeOf(g.hasOwnProperty??RKi)??RKi)?.toString)&&(A=g+"",s.push({start:f.length+h.length,length:A.length,error:`Value of type ${Object.prototype.toString.call(g).slice(8,-1)} is not a valid path parameter`})),f+h+(m===n.length?"":A)},""),l=c.split(/[?#]/,1)[0],u=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,d;for(;(d=u.exec(l))!==null;)s.push({start:d.index,length:d[0].length,error:`Value "${d[0]}" can't be safely passed as a path parameter`});if(s.sort((f,h)=>f.start-h.start),s.length>0){let f=0,h=s.reduce((m,g)=>{let A=" ".repeat(g.start-f),y="^".repeat(g.length);return f=g.start+g.length,m+A+y},"");throw new mr(`Path parameters result in path with invalid segments: ${s.map(m=>m.error).join(` `)} ${c} -${h}`)}return c},"path"),"createPathTagFunction"),cr=BFc(wKi)});var mve,S6r=Se(()=>{p();Jl();Dd();Dc();u8e();hve();zf();mve=class extends _i{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",Pk,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/files/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/files/${e}/content?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/files/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...o}=e;return this._client.post("/v1/files?beta=true",pve({body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},IKi(o.file),r?.headers])},this._client))}}});var gve,T6r=Se(()=>{p();Jl();Dd();Dc();zf();gve=class extends _i{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/models/${e}?beta=true`,{...n,headers:Et([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models?beta=true",Pk,{query:o,...r,headers:Et([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var Ave,I6r=Se(()=>{p();Jl();Dd();Dc();zf();Ave=class extends _i{static{a(this,"UserProfiles")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/user_profiles?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/user_profiles/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var kKi=I(qIt=>{"use strict";p();Object.defineProperty(qIt,"__esModule",{value:!0});qIt.timingSafeEqual=void 0;function RKi(t,e=""){if(!t)throw new Error(e)}a(RKi,"assert");function qFc(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),RKi(t instanceof DataView),RKi(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var jFc=WI&&WI.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(WI,"__esModule",{value:!0});var Zm=256,x6r=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return a(t,"Coder"),t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var r="",n=0;n>>18&63),r+=this._encodeByte(o>>>12&63),r+=this._encodeByte(o>>>6&63),r+=this._encodeByte(o>>>0&63)}var s=e.length-n;if(s>0){var o=e[n]<<16|(s===2?e[n+1]<<8:0);r+=this._encodeByte(o>>>18&63),r+=this._encodeByte(o>>>12&63),s===2?r+=this._encodeByte(o>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(e),n=e.length-r,o=new Uint8Array(this.maxDecodedLength(n)),s=0,c=0,l=0,u=0,d=0,f=0,h=0;c>>4,o[s++]=d<<4|f>>>2,o[s++]=f<<6|h,l|=u&Zm,l|=d&Zm,l|=f&Zm,l|=h&Zm;if(c>>4,l|=u&Zm,l|=d&Zm),c>>2,l|=f&Zm),c>>8&6,r+=51-e>>>8&-75,r+=61-e>>>8&-15,r+=62-e>>>8&3,String.fromCharCode(r)},t.prototype._decodeChar=function(e){var r=Zm;return r+=(42-e&e-44)>>>8&-Zm+e-43+62,r+=(46-e&e-48)>>>8&-Zm+e-47+63,r+=(47-e&e-58)>>>8&-Zm+e-48+52,r+=(64-e&e-91)>>>8&-Zm+e-65+0,r+=(96-e&e-123)>>>8&-Zm+e-97+26,r},t.prototype._getPaddingLength=function(e){var r=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)r++;if(e.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},t})();WI.Coder=x6r;var d8e=new x6r;function HFc(t){return d8e.encode(t)}a(HFc,"encode");WI.encode=HFc;function GFc(t){return d8e.decode(t)}a(GFc,"decode");WI.decode=GFc;var PKi=(function(t){jFc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"URLSafeCoder"),e.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},e.prototype._decodeChar=function(r){var n=Zm;return n+=(44-r&r-46)>>>8&-Zm+r-45+62,n+=(94-r&r-96)>>>8&-Zm+r-95+63,n+=(47-r&r-58)>>>8&-Zm+r-48+52,n+=(64-r&r-91)>>>8&-Zm+r-65+0,n+=(96-r&r-123)>>>8&-Zm+r-97+26,n},e})(x6r);WI.URLSafeCoder=PKi;var DKi=new PKi;function $Fc(t){return DKi.encode(t)}a($Fc,"encodeURLSafe");WI.encodeURLSafe=$Fc;function VFc(t){return DKi.decode(t)}a(VFc,"decodeURLSafe");WI.decodeURLSafe=VFc;WI.encodedLength=function(t){return d8e.encodedLength(t)};WI.maxDecodedLength=function(t){return d8e.maxDecodedLength(t)};WI.decodedLength=function(t){return d8e.decodedLength(t)}});var OKi=I((MKi,jIt)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof jIt=="object"&&typeof jIt.exports=="object"?jIt.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(MKi,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(h,m,g,A,y){for(var _,E,v,S,T,w,R,x,k,D,N,O,B;y>=64;){for(_=m[0],E=m[1],v=m[2],S=m[3],T=m[4],w=m[5],R=m[6],x=m[7],D=0;D<16;D++)N=A+D*4,h[D]=(g[N]&255)<<24|(g[N+1]&255)<<16|(g[N+2]&255)<<8|g[N+3]&255;for(D=16;D<64;D++)k=h[D-2],O=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,k=h[D-15],B=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>3,h[D]=(O+h[D-7]|0)+(B+h[D-16]|0);for(D=0;D<64;D++)O=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&w^~T&R)|0)+(x+(e[D]+h[D]|0)|0)|0,B=((_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10))+(_&E^_&v^E&v)|0,x=R,R=w,w=T,T=S+O|0,S=v,v=E,E=_,_=O+B|0;m[0]+=_,m[1]+=E,m[2]+=v,m[3]+=S,m[4]+=T,m[5]+=w,m[6]+=R,m[7]+=x,A+=64,y-=64}return A}a(r,"hashBlocks");var n=(function(){function h(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return a(h,"Hash"),h.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},h.prototype.clean=function(){for(var m=0;m0){for(;this.bufferLength<64&&g>0;)this.buffer[this.bufferLength++]=m[A++],g--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(g>=64&&(A=r(this.temp,this.state,m,A,g),g%=64);g>0;)this.buffer[this.bufferLength++]=m[A++],g--;return this},h.prototype.finish=function(m){if(!this.finished){var g=this.bytesHashed,A=this.bufferLength,y=g/536870912|0,_=g<<3,E=g%64<56?64:128;this.buffer[A]=128;for(var v=A+1;v>>24&255,this.buffer[E-7]=y>>>16&255,this.buffer[E-6]=y>>>8&255,this.buffer[E-5]=y>>>0&255,this.buffer[E-4]=_>>>24&255,this.buffer[E-3]=_>>>16&255,this.buffer[E-2]=_>>>8&255,this.buffer[E-1]=_>>>0&255,r(this.temp,this.state,this.buffer,0,E),this.finished=!0}for(var v=0;v<8;v++)m[v*4+0]=this.state[v]>>>24&255,m[v*4+1]=this.state[v]>>>16&255,m[v*4+2]=this.state[v]>>>8&255,m[v*4+3]=this.state[v]>>>0&255;return this},h.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},h.prototype._saveState=function(m){for(var g=0;gthis.blockSize)new n().update(m).finish(g).clean();else for(var A=0;A1&&m.update(h),g&&m.update(g),m.update(A),m.finish(h),A[0]++}a(l,"fillBuffer");var u=new Uint8Array(t.digestLength);function d(h,m,g,A){m===void 0&&(m=u),A===void 0&&(A=32);for(var y=new Uint8Array([1]),_=c(m,h),E=new o(_),v=new Uint8Array(E.digestLength),S=v.length,T=new Uint8Array(A),w=0;w>>24&255,E[1]=R>>>16&255,E[2]=R>>>8&255,E[3]=R>>>0&255,y.reset(),y.update(m),y.update(E),y.finish(S);for(var x=0;x<_;x++)v[x]=S[x];for(var x=2;x<=g;x++){y.reset(),y.update(S).finish(S);for(var k=0;k<_;k++)v[k]^=S[k]}for(var x=0;x<_&&w*_+x{"use strict";p();Object.defineProperty(yve,"__esModule",{value:!0});yve.Webhook=yve.WebhookVerificationError=void 0;var WFc=kKi(),LKi=NKi(),zFc=OKi(),BKi=300,w6r=class t extends Error{static{a(this,"ExtendableError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},EW=class t extends w6r{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};yve.WebhookVerificationError=EW;var HIt=class t{static{a(this,"Webhook")}constructor(e,r){if(!e)throw new Error("Secret can't be empty.");if(r?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,n=>n.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=LKi.decode(e)}}verify(e,r){let n={};for(let m of Object.keys(r))n[m.toLowerCase()]=r[m];let o=n["webhook-id"],s=n["webhook-signature"],c=n["webhook-timestamp"];if(!s||!o||!c)throw new EW("Missing required headers");let l=this.verifyTimestamp(c),d=this.sign(o,l,e).split(",")[1],f=s.split(" "),h=new globalThis.TextEncoder;for(let m of f){let[g,A]=m.split(",");if(g==="v1"&&(0,WFc.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new EW("No matching signature found")}sign(e,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let o=new TextEncoder,s=Math.floor(r.getTime()/1e3),c=o.encode(`${e}.${s}.${n}`);return`v1,${LKi.encode(zFc.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new EW("Invalid Signature Headers");if(r-n>BKi)throw new EW("Message timestamp too old");if(n>r+BKi)throw new EW("Message timestamp too new");return new Date(n*1e3)}};yve.Webhook=HIt;HIt.prefix="whsec_"});var UKi,_ve,R6r=Se(()=>{p();Jl();UKi=fe(FKi(),1),_ve=class extends _i{static{a(this,"Webhooks")}unwrap(e,{headers:r,key:n}){if(r!==void 0){let o=n===void 0?this._client.webhookKey:n;if(o===null)throw new Error("Webhook key must not be null in order to unwrap");new UKi.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var Eve,k6r=Se(()=>{p();Jl();Dd();Dc();zf();Eve=class extends _i{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/agents/${e}/versions?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var aoe,P6r=Se(()=>{p();Jl();k6r();k6r();Dd();Dc();zf();aoe=class extends _i{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new Eve(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(cr`/v1/agents/${e}?beta=true`,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/agents/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/agents?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/agents/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};aoe.Versions=Eve});function coe(t,e){if(!t)return()=>{};if(t.aborted)return e.abort(),()=>{};let r=a(()=>e.abort(),"onAbort");return t.addEventListener("abort",r),()=>t.removeEventListener("abort",r)}var GIt=Se(()=>{p();a(coe,"linkAbort")});function vW(t,e){return t instanceof Fh&&t.status===e}function QKi(t){return t instanceof Fh&&typeof t.status=="number"&&t.status>=400&&t.status<500}function CW(t){return QKi(t)&&!vW(t,408)&&!vW(t,409)&&!vW(t,429)}function qKi(t,e,r){return Math.min(e*2**t,r)}function D6r(t,e){return t+Math.random()*(e-t)}function jKi(t){return t*(1-Math.random()*.25)}var f8e=Se(()=>{p();Wf();a(vW,"isStatus");a(QKi,"is4xx");a(CW,"isFatal4xx");a(qKi,"backoff");a(D6r,"jitter");a(jKi,"applyJitter")});function $It(t,{authToken:e,helper:r}){if(!e)throw new mr(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(e)}`);let n=t,o=n._options.defaultHeaders,s=n._authState?.extraHeaders,c=s?Object.fromEntries(Object.entries(s).filter(([u])=>{let d=u.toLowerCase();return d!=="authorization"&&d!=="x-api-key"})):void 0,l=Et([c,o,{"x-stainless-helper":r}]);return t.withOptions({apiKey:null,authToken:e,baseURL:t.baseURL,credentials:void 0,defaultHeaders:l})}var N6r=Se(()=>{p();Wf();Dc();a($It,"copyClientForHelper")});function t8c(t){return qKi(t,XFc,e8c)}function r8c(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${JEe()}`:JEe()}var vve,VIt,Dk,WIt,zIt,YIt,p8e,h8e,Cve,ZFc,XFc,e8c,bW,KIt=Se(()=>{p();WS();Wf();c9();cve();yIt();GIt();Dc();f8e();N6r();f8e();ZFc=999,XFc=1e3,e8c=6e4,bW=class{static{a(this,"WorkPoller")}constructor(e){vve.set(this,void 0),VIt.set(this,!1),Dk.set(this,void 0),WIt.set(this,void 0),zIt.set(this,void 0),YIt.set(this,void 0),p8e.set(this,void 0),h8e.set(this,void 0),Cve.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??r8c(),qt(this,vve,$It(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),qt(this,zIt,e.autoStop??!0,"f"),qt(this,YIt,e.drain??!1,"f"),qt(this,p8e,e.blockMs===void 0?ZFc:e.blockMs,"f"),qt(this,h8e,e.reclaimOlderThanMs??null,"f"),qt(this,Cve,e.requestOptions,"f"),qt(this,Dk,new AbortController,"f"),qt(this,WIt,coe(e.signal,Ie(this,Dk,"f")),"f")}get signal(){return Ie(this,Dk,"f").signal}abort(){Ie(this,Dk,"f").abort()}async*[(vve=new WeakMap,VIt=new WeakMap,Dk=new WeakMap,WIt=new WeakMap,zIt=new WeakMap,YIt=new WeakMap,p8e=new WeakMap,h8e=new WeakMap,Cve=new WeakMap,Symbol.asyncIterator)](){if(Ie(this,VIt,"f"))throw new mr("Cannot iterate over a consumed WorkPoller");qt(this,VIt,!0,"f");let e=xl(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!Ie(this,Dk,"f").signal.aborted;){let n;try{n=await Ie(this,vve,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...Ie(this,p8e,"f")!==null?{block_ms:Ie(this,p8e,"f")}:{},...Ie(this,h8e,"f")!==null?{reclaim_older_than_ms:Ie(this,h8e,"f")}:{}},{headers:Et([Ie(this,Cve,"f")?.headers]),signal:Ie(this,Dk,"f").signal})}catch(o){if(Ie(this,Dk,"f").signal.aborted)return;if(CW(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=jKi(t8c(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await nM(s,Ie(this,Dk,"f").signal);continue}if(r=0,n==null){if(Ie(this,YIt,"f"))return;await nM(D6r(1e3,3e3),Ie(this,Dk,"f").signal);continue}e.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:n.id,work_type:n.data.type});try{await Ie(this,vve,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:Et([Ie(this,Cve,"f")?.headers]),signal:Ie(this,Dk,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(Ie(this,zIt,"f"))try{await Ie(this,vve,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:Et([Ie(this,Cve,"f")?.headers])})}catch(o){vW(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{Ie(this,WIt,"f").call(this)}}};a(t8c,"backoff");a(r8c,"defaultWorkerId")});var bve,SW,Sve,JIt,HKi=Se(()=>{p();WS();JIt=class{static{a(this,"AsyncQueue")}constructor(){bve.set(this,[]),SW.set(this,[]),Sve.set(this,!1)}push(e){if(Ie(this,Sve,"f"))return!1;let r=Ie(this,SW,"f").shift();return r?r({done:!1,value:e}):Ie(this,bve,"f").push(e),!0}close(){if(!Ie(this,Sve,"f"))for(qt(this,Sve,!0,"f");Ie(this,SW,"f").length>0;)Ie(this,SW,"f").shift()({done:!0,value:void 0})}next(e){return Ie(this,bve,"f").length>0?Promise.resolve({done:!1,value:Ie(this,bve,"f").shift()}):Ie(this,Sve,"f")||e?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(r=>{let n=a(s=>{e?.removeEventListener("abort",o),r(s)},"waiter"),o=a(()=>{let s=Ie(this,SW,"f").indexOf(n);s>=0&&Ie(this,SW,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");Ie(this,SW,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return Ie(this,bve,"f").shift()}};bve=new WeakMap,SW=new WeakMap,Sve=new WeakMap});var Co,loe=Se(()=>{p();Co=class extends Error{static{a(this,"ToolError")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}}});function M6r(t){return"name"in t?t.name:t.mcp_server_name}function n8c(t){return t instanceof Co?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function GKi(t,e,r){try{let n=t.parse?t.parse(e):e;return{content:await t.run(n,r),isError:!1}}catch(n){return{content:n8c(n),isError:!0}}}var $Ki=Se(()=>{p();loe();a(M6r,"toolName");a(n8c,"toolErrorContent");a(GKi,"runRunnableTool")});function ZKi(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function l8c(t,e,r){return t.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:t.id,is_error:e,content:r}:{type:"user.tool_result",tool_use_id:t.id,is_error:e,content:r}}function u8c(t){if(typeof t=="string")return[{type:"text",text:t||"(no output)"}];let e=t.map(r=>r.type==="text"?{type:"text",text:r.text||"(no output)"}:r.type==="image"||r.type==="document"?r:r.type==="search_result"?{type:"search_result",source:r.source,title:r.title,content:r.content.map(n=>({type:"text",text:n.text})),citations:{enabled:r.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(r)});return e.length>0?e:[{type:"text",text:"(no output)"}]}var Vg,ZIt,jy,XIt,g8e,txt,_E,Tve,AB,uoe,u9,A8e,Ive,ext,XKi,VKi,WKi,zKi,O6r,m8e,L6r,YKi,eJi,i8c,KKi,o8c,s8c,a8c,JKi,c8c,TW,rxt=Se(()=>{p();WS();Wf();c9();cve();f8e();GIt();HKi();Dc();$Ki();i8c="SessionToolRunner",KKi=500,o8c=1e4,s8c=12e4,a8c=3e4,JKi=3,c8c=6e4;a(ZKi,"isEndTurnIdle");TW=class{static{a(this,"SessionToolRunner")}constructor(e,r){Vg.add(this),ZIt.set(this,!1),jy.set(this,void 0),XIt.set(this,void 0),g8e.set(this,void 0),txt.set(this,void 0),_E.set(this,void 0),Tve.set(this,new Set),AB.set(this,new Set),uoe.set(this,new JIt),u9.set(this,0),A8e.set(this,null),Ive.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??c8c,qt(this,_E,xl(r.client),"f"),qt(this,txt,new Map(r.tools.map(n=>[M6r(n),n])),"f"),qt(this,jy,new AbortController,"f"),qt(this,XIt,coe(r.signal,Ie(this,jy,"f")),"f"),qt(this,g8e,r.requestOptions,"f")}get signal(){return Ie(this,jy,"f").signal}abort(){Ie(this,jy,"f").abort()}async*[(ZIt=new WeakMap,jy=new WeakMap,XIt=new WeakMap,g8e=new WeakMap,txt=new WeakMap,_E=new WeakMap,Tve=new WeakMap,AB=new WeakMap,uoe=new WeakMap,u9=new WeakMap,A8e=new WeakMap,Ive=new WeakMap,Vg=new WeakSet,Symbol.asyncIterator)](){if(Ie(this,ZIt,"f"))throw new mr("Cannot iterate over a consumed SessionToolRunner");qt(this,ZIt,!0,"f"),Ie(this,_E,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=Ie(this,Vg,"m",XKi).call(this).catch(r=>{Ie(this,jy,"f").signal.aborted||Ie(this,_E,"f").error("stream loop failed",{error:String(r)}),Ie(this,jy,"f").abort()});try{for(;;){let n=await Ie(this,uoe,"f").next(Ie(this,jy,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=Ie(this,uoe,"f").tryShift())!==void 0;)yield r}finally{Ie(this,jy,"f").abort(),Ie(this,Vg,"m",m8e).call(this),await e;try{await Ie(this,Vg,"m",eJi).call(this)}catch(r){Ie(this,_E,"f").warn("drain failed",{error:String(r)})}Ie(this,uoe,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){Ie(this,_E,"f").warn("tool.close failed",{tool:M6r(r),error:String(n)})}Ie(this,XIt,"f").call(this)}}};ext=a(function(){return{...Ie(this,g8e,"f"),headers:Et([{"x-stainless-helper":i8c},Ie(this,g8e,"f")?.headers]),signal:Ie(this,jy,"f").signal}},"_SessionToolRunner_requestOptions"),XKi=a(async function(){let e=Ie(this,jy,"f"),r=KKi;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},Ie(this,Vg,"m",ext).call(this));await Ie(this,Vg,"m",VKi).call(this);for await(let o of n)if(r=KKi,await Ie(this,Vg,"m",zKi).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),CW(n))throw Ie(this,_E,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;Ie(this,_E,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await nM(r,e.signal),r=Math.min(r*2,o8c)}},"_SessionToolRunner_streamLoop"),VKi=a(async function(){let e=Ie(this,jy,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},Ie(this,Vg,"m",ext).call(this)))Ie(this,Vg,"m",WKi).call(this,s,r),n=ZKi(s)}catch(s){e.signal.throwIfAborted(),Ie(this,_E,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)Ie(this,Tve,"f").delete(c.id);return}let o=r.filter(s=>!Ie(this,AB,"f").has(s.id));n&&o.length===0?Ie(this,Vg,"m",O6r).call(this):Ie(this,Vg,"m",m8e).call(this);for(let s of o)await Ie(this,Vg,"m",L6r).call(this,s)},"_SessionToolRunner_reconcile"),WKi=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(Ie(this,Tve,"f").add(e.id),Ie(this,AB,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?Ie(this,AB,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&Ie(this,AB,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),zKi=a(async function(e){switch(ZKi(e)?Ie(this,Vg,"m",O6r).call(this):Ie(this,Vg,"m",m8e).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return Ie(this,Tve,"f").has(e.id)||(Ie(this,Tve,"f").add(e.id),await Ie(this,Vg,"m",L6r).call(this,e)),!1;case"user.tool_result":return Ie(this,AB,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return Ie(this,AB,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return Ie(this,_E,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),Ie(this,jy,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),O6r=a(function(){Ie(this,Vg,"m",m8e).call(this),!(this.maxIdleMs<=0)&&qt(this,Ive,setTimeout(()=>{Ie(this,_E,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),Ie(this,jy,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),m8e=a(function(){Ie(this,Ive,"f")!==void 0&&(clearTimeout(Ie(this,Ive,"f")),qt(this,Ive,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),L6r=a(async function(e){var r,n;if(!Ie(this,AB,"f").has(e.id)){Ie(this,_E,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),qt(this,u9,(r=Ie(this,u9,"f"),r++,r),"f");try{let o=Ie(this,txt,"f").get(e.name);if(!o){Ie(this,_E,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Ie(this,uoe,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=coe(Ie(this,jy,"f").signal,l),d=setTimeout(()=>l.abort(),s8c);try{let m=await GKi(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=l8c(e,c,u8c(s)),h=await Ie(this,Vg,"m",YKi).call(this,f,e.id);Ie(this,uoe,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{qt(this,u9,(n=Ie(this,u9,"f"),n--,n),"f"),Ie(this,u9,"f")===0&&Ie(this,A8e,"f")?.call(this)}}},"_SessionToolRunner_execute"),YKi=a(async function(e,r){let n=Ie(this,jy,"f"),o;for(let s=0;sqt(this,A8e,e,"f")),nM(a8c)]),qt(this,A8e,null,"f"),Ie(this,u9,"f")>0&&Ie(this,_E,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(l8c,"buildResultEvent");a(u8c,"toSessionContent")});var tJi=Se(()=>{p();c6r()});function doe(t){if(t.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${t.name}" must be an object, but got ${t.inputSchema.type}`);return{type:"custom",name:t.name,input_schema:t.inputSchema,description:t.description,run:t.run,parse:a(e=>e,"parse"),...t.close?{close:t.close}:{}}}var rJi=Se(()=>{p();B6r();tJi();a(doe,"betaTool")});function xve(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var F6r=Se(()=>{p();a(xve,"promiseWithResolvers")});async function f8c(t){try{return await zI.realpath(t)}catch{return t}}async function p8c(t){let e=[],r=t;for(;;){let n;try{n=await zI.realpath(r)}catch{let o=!1;try{o=(await zI.lstat(r)).isSymbolicLink()}catch{}if(o){r=Wg.resolve(Wg.dirname(r),await zI.readlink(r));continue}let s=Wg.dirname(r);if(s===r)return t;e.push(Wg.basename(r)),r=s;continue}return e.length?Wg.join(n,...e.reverse()):n}}async function iJi(t,e,r){let n=r?.allowOutside??!1;if(Wg.isAbsolute(e)){if(!n)throw new Co(`absolute path ${JSON.stringify(e)} not permitted`);return Wg.resolve(e)}let o=await f8c(Wg.resolve(t)),s=Wg.resolve(o,e);if(n)return s;let c=await p8c(s),l=o.endsWith(Wg.sep)?o:o+Wg.sep;if(c!==o&&!c.startsWith(l))throw new Co(`path ${JSON.stringify(e)} escapes workdir`);return c}async function U6r(t,e){let r=Wg.dirname(t),n=Wg.join(r,`.tmp-${process.pid}-${(0,nJi.randomUUID)()}`),o;try{o=await zI.open(n,"wx",d8c),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await zI.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await zI.unlink(n).catch(()=>{}),s}}function _8e(t,e){switch(t?.code){case"ENOENT":return`${e}: no such file or directory`;case"EACCES":case"EPERM":return`${e}: permission denied`;case"ENOTDIR":return`${e}: not a directory`;case"EISDIR":return`${e}: is a directory`;case"ELOOP":return`${e}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${e}: file name too long`;case"ENOSPC":return`${e}: no space left on device`;case"EMFILE":case"ENFILE":return`${e}: too many open files`;default:return`${e}: ${t instanceof Error?t.message:String(t)}`}}var zI,Wg,nJi,y8e,d8c,Q6r=Se(()=>{p();zI=fe(require("node:fs/promises"),1),Wg=fe(require("node:path"),1),nJi=require("node:crypto");loe();y8e=493,d8c=420;a(f8c,"realpathOrSelf");a(p8c,"canonicalize");a(iJi,"confineToRoot");a(U6r,"atomicWriteFile");a(_8e,"fsErrorMessage")});async function uJi(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=xl(e),o=await e.beta.sessions.retrieve(r),s=Hy.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await j6r(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=Hy.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=Hy.resolve(s,f);if(h!==s&&!h.startsWith(s+Hy.sep)){n.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:d.name});continue}let m=await e.beta.skills.versions.download(u,{skill_id:l.skill_id});await YS.rm(h,{recursive:!0,force:!0}),await YS.mkdir(h,{recursive:!0,mode:y8e}),c.push(h),await H6r(m,h),n.info("downloaded skill",{component:"agent-tool-context",skill_id:l.skill_id,version:u,dest:h})}catch(u){n.warn("failed to download skill",{component:"agent-tool-context",skill_id:l.skill_id,error:String(u)})}return async()=>{for(let l of c)await YS.rm(l,{recursive:!0,force:!0}).catch(u=>{n.warn("failed to clean up skill",{component:"agent-tool-context",dest:l,error:String(u)})})}}async function j6r(t,e,r){if(/^\d+$/.test(r))return r;let n;for await(let o of t.beta.skills.versions.list(e))/^\d+$/.test(o.version)&&(n===void 0||BigInt(o.version)>BigInt(n))&&(n=o.version);if(n===void 0)throw new mr(`skill ${JSON.stringify(e)} has no concrete version to resolve ${JSON.stringify(r)} against`);return n}function m8c(t){for(let e of t.split(` -`)){let r=e.trim();if(r&&(Hy.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new mr(`refusing to extract unsafe archive member: ${r}`)}}function g8c(t){for(let e of t.split(` -`)){let r=e.trimStart()[0];if(r==="l"||r==="h"||r==="b"||r==="c"||r==="p"||r==="s")throw new mr("refusing to extract archive with symlink/hardlink/device member")}}async function q6r(t,e){try{let{stdout:r}=await h8c(t,e);return r}catch(r){throw r!=null&&typeof r=="object"&&r.code==="ENOENT"?new mr(`skill extraction requires the \`${t}\` command, but it was not found on PATH`):r}}function A8c(t){let e,r=!1;for(let n of t.split(` -`)){let o=n.trim().split("/").filter(c=>c!==""&&c!==".");if(o.length===0)continue;let s=o[0];if(e===void 0)e=s;else if(s!==e)return"";o.length>1&&(r=!0)}return e!==void 0&&r?e:""}async function H6r(t,e){let r=Hy.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new mr("skill download response had no body");await(0,lJi.pipeline)(cJi.Readable.fromWeb(t.body),oJi.createWriteStream(r));let n=Hy.join(Hy.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await y8c(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await q6r(c,s?["-Z1",r]:["-tf",r]);m8c(l),g8c(await q6r(c,s?["-Z",r]:["-tvf",r]));let u=A8c(l);await YS.mkdir(n,{recursive:!0,mode:y8e}),await q6r(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?Hy.join(n,u):n;for(let f of await YS.readdir(d))await YS.rename(Hy.join(d,f),Hy.join(e,f))}finally{await YS.rm(r,{force:!0}),await YS.rm(n,{recursive:!0,force:!0})}}async function y8c(t,e){let r=await YS.open(t,"r");try{let n=Buffer.alloc(e),{bytesRead:o}=await r.read(n,0,e,0);return n.subarray(0,o)}finally{await r.close()}}var YS,oJi,Hy,sJi,aJi,cJi,lJi,h8c,dJi=Se(()=>{p();YS=fe(require("node:fs/promises"),1),oJi=fe(require("node:fs"),1),Hy=fe(require("node:path"),1),sJi=require("node:child_process"),aJi=require("node:util"),cJi=require("node:stream"),lJi=require("node:stream/promises");Wf();c9();Q6r();h8c=(0,aJi.promisify)(sJi.execFile);a(uJi,"setupSkills");a(j6r,"resolveSkillVersion");a(m8c,"assertSafeMemberNames");a(g8c,"assertNoSpecialMembers");a(q6r,"runArchiveTool");a(A8c,"archiveTopDir");a(H6r,"extractSkillArchive");a(y8c,"readHead")});var SJi={};Ti(SJi,{BashSession:()=>ixt,betaAgentToolset20260401:()=>b8c,betaBashTool:()=>yJi,betaEditTool:()=>vJi,betaGlobTool:()=>CJi,betaGrepTool:()=>bJi,betaReadTool:()=>_Ji,betaWriteTool:()=>EJi,extractSkillArchive:()=>H6r,resolvePath:()=>wve,resolveSkillVersion:()=>j6r,setupSkills:()=>uJi});function b8c(t){return[yJi(t),_Ji(t),EJi(t),vJi(t),CJi(t),bJi(t)]}function wve(t,e){return iJi(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function S8c(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function yJi(t){let e,r=Promise.resolve();return doe({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:a(async({command:n,restart:o,timeout_ms:s},c)=>{let l=r,u=xve();r=u.promise;try{await l}catch{}try{if(o&&(e?.close(),e=void 0),!n){if(o)return"bash session restarted";throw new Co("bash: command is required")}e??(e=new ixt(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??AJi,signal:c?.signal});if(f!==0)throw new Co(d||`exit ${f}`);return d}catch(d){throw d instanceof Co?d:(e.close(),e=void 0,new Co(`bash: ${d instanceof Error?d.message:String(d)}`))}}finally{u.resolve()}},"run"),close:a(()=>{e?.close(),e=void 0},"close")})}function _Ji(t){return doe({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:a(async({file_path:e,view_range:r})=>{if(!e)throw new Co("read: file_path is required");let n=await wve(t,e),o;try{let f=await EE.stat(n);if(!f.isFile())throw new Co(`read: ${e} is not a regular file`);if(f.size>$6r)throw new Co(`read: ${e} is ${f.size} bytes, exceeds ${$6r}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await EE.readFile(n,"utf8")}catch(f){throw f instanceof Co?f:new Co(`read: ${_8e(f,e)}`)}if(!r)return o;if(r.length!==2)throw new Co("read: view_range must be [start_line, end_line]");let[s,c]=r,l=o.split(` +${h}`)}return c},"path"),"createPathTagFunction"),cr=UFc(kKi)});var mve,T6r=Se(()=>{p();Jl();Nd();Dc();u8e();hve();zf();mve=class extends _i{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",Pk,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/files/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/files/${e}/content?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/files/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...o}=e;return this._client.post("/v1/files?beta=true",pve({body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},wKi(o.file),r?.headers])},this._client))}}});var gve,I6r=Se(()=>{p();Jl();Nd();Dc();zf();gve=class extends _i{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/models/${e}?beta=true`,{...n,headers:Et([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models?beta=true",Pk,{query:o,...r,headers:Et([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var Ave,x6r=Se(()=>{p();Jl();Nd();Dc();zf();Ave=class extends _i{static{a(this,"UserProfiles")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/user_profiles?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/user_profiles/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var DKi=I(jIt=>{"use strict";p();Object.defineProperty(jIt,"__esModule",{value:!0});jIt.timingSafeEqual=void 0;function PKi(t,e=""){if(!t)throw new Error(e)}a(PKi,"assert");function HFc(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),PKi(t instanceof DataView),PKi(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var GFc=WI&&WI.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(WI,"__esModule",{value:!0});var Xm=256,w6r=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return a(t,"Coder"),t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var r="",n=0;n>>18&63),r+=this._encodeByte(o>>>12&63),r+=this._encodeByte(o>>>6&63),r+=this._encodeByte(o>>>0&63)}var s=e.length-n;if(s>0){var o=e[n]<<16|(s===2?e[n+1]<<8:0);r+=this._encodeByte(o>>>18&63),r+=this._encodeByte(o>>>12&63),s===2?r+=this._encodeByte(o>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(e),n=e.length-r,o=new Uint8Array(this.maxDecodedLength(n)),s=0,c=0,l=0,u=0,d=0,f=0,h=0;c>>4,o[s++]=d<<4|f>>>2,o[s++]=f<<6|h,l|=u&Xm,l|=d&Xm,l|=f&Xm,l|=h&Xm;if(c>>4,l|=u&Xm,l|=d&Xm),c>>2,l|=f&Xm),c>>8&6,r+=51-e>>>8&-75,r+=61-e>>>8&-15,r+=62-e>>>8&3,String.fromCharCode(r)},t.prototype._decodeChar=function(e){var r=Xm;return r+=(42-e&e-44)>>>8&-Xm+e-43+62,r+=(46-e&e-48)>>>8&-Xm+e-47+63,r+=(47-e&e-58)>>>8&-Xm+e-48+52,r+=(64-e&e-91)>>>8&-Xm+e-65+0,r+=(96-e&e-123)>>>8&-Xm+e-97+26,r},t.prototype._getPaddingLength=function(e){var r=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)r++;if(e.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},t})();WI.Coder=w6r;var d8e=new w6r;function $Fc(t){return d8e.encode(t)}a($Fc,"encode");WI.encode=$Fc;function VFc(t){return d8e.decode(t)}a(VFc,"decode");WI.decode=VFc;var NKi=(function(t){GFc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"URLSafeCoder"),e.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},e.prototype._decodeChar=function(r){var n=Xm;return n+=(44-r&r-46)>>>8&-Xm+r-45+62,n+=(94-r&r-96)>>>8&-Xm+r-95+63,n+=(47-r&r-58)>>>8&-Xm+r-48+52,n+=(64-r&r-91)>>>8&-Xm+r-65+0,n+=(96-r&r-123)>>>8&-Xm+r-97+26,n},e})(w6r);WI.URLSafeCoder=NKi;var MKi=new NKi;function WFc(t){return MKi.encode(t)}a(WFc,"encodeURLSafe");WI.encodeURLSafe=WFc;function zFc(t){return MKi.decode(t)}a(zFc,"decodeURLSafe");WI.decodeURLSafe=zFc;WI.encodedLength=function(t){return d8e.encodedLength(t)};WI.maxDecodedLength=function(t){return d8e.maxDecodedLength(t)};WI.decodedLength=function(t){return d8e.decodedLength(t)}});var BKi=I((LKi,HIt)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof HIt=="object"&&typeof HIt.exports=="object"?HIt.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(LKi,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(h,m,g,A,y){for(var _,E,v,S,T,w,R,x,k,D,N,O,B;y>=64;){for(_=m[0],E=m[1],v=m[2],S=m[3],T=m[4],w=m[5],R=m[6],x=m[7],D=0;D<16;D++)N=A+D*4,h[D]=(g[N]&255)<<24|(g[N+1]&255)<<16|(g[N+2]&255)<<8|g[N+3]&255;for(D=16;D<64;D++)k=h[D-2],O=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,k=h[D-15],B=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>3,h[D]=(O+h[D-7]|0)+(B+h[D-16]|0);for(D=0;D<64;D++)O=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&w^~T&R)|0)+(x+(e[D]+h[D]|0)|0)|0,B=((_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10))+(_&E^_&v^E&v)|0,x=R,R=w,w=T,T=S+O|0,S=v,v=E,E=_,_=O+B|0;m[0]+=_,m[1]+=E,m[2]+=v,m[3]+=S,m[4]+=T,m[5]+=w,m[6]+=R,m[7]+=x,A+=64,y-=64}return A}a(r,"hashBlocks");var n=(function(){function h(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return a(h,"Hash"),h.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},h.prototype.clean=function(){for(var m=0;m0){for(;this.bufferLength<64&&g>0;)this.buffer[this.bufferLength++]=m[A++],g--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(g>=64&&(A=r(this.temp,this.state,m,A,g),g%=64);g>0;)this.buffer[this.bufferLength++]=m[A++],g--;return this},h.prototype.finish=function(m){if(!this.finished){var g=this.bytesHashed,A=this.bufferLength,y=g/536870912|0,_=g<<3,E=g%64<56?64:128;this.buffer[A]=128;for(var v=A+1;v>>24&255,this.buffer[E-7]=y>>>16&255,this.buffer[E-6]=y>>>8&255,this.buffer[E-5]=y>>>0&255,this.buffer[E-4]=_>>>24&255,this.buffer[E-3]=_>>>16&255,this.buffer[E-2]=_>>>8&255,this.buffer[E-1]=_>>>0&255,r(this.temp,this.state,this.buffer,0,E),this.finished=!0}for(var v=0;v<8;v++)m[v*4+0]=this.state[v]>>>24&255,m[v*4+1]=this.state[v]>>>16&255,m[v*4+2]=this.state[v]>>>8&255,m[v*4+3]=this.state[v]>>>0&255;return this},h.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},h.prototype._saveState=function(m){for(var g=0;gthis.blockSize)new n().update(m).finish(g).clean();else for(var A=0;A1&&m.update(h),g&&m.update(g),m.update(A),m.finish(h),A[0]++}a(l,"fillBuffer");var u=new Uint8Array(t.digestLength);function d(h,m,g,A){m===void 0&&(m=u),A===void 0&&(A=32);for(var y=new Uint8Array([1]),_=c(m,h),E=new o(_),v=new Uint8Array(E.digestLength),S=v.length,T=new Uint8Array(A),w=0;w>>24&255,E[1]=R>>>16&255,E[2]=R>>>8&255,E[3]=R>>>0&255,y.reset(),y.update(m),y.update(E),y.finish(S);for(var x=0;x<_;x++)v[x]=S[x];for(var x=2;x<=g;x++){y.reset(),y.update(S).finish(S);for(var k=0;k<_;k++)v[k]^=S[k]}for(var x=0;x<_&&w*_+x{"use strict";p();Object.defineProperty(yve,"__esModule",{value:!0});yve.Webhook=yve.WebhookVerificationError=void 0;var YFc=DKi(),FKi=OKi(),KFc=BKi(),UKi=300,R6r=class t extends Error{static{a(this,"ExtendableError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},vW=class t extends R6r{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};yve.WebhookVerificationError=vW;var GIt=class t{static{a(this,"Webhook")}constructor(e,r){if(!e)throw new Error("Secret can't be empty.");if(r?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,n=>n.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=FKi.decode(e)}}verify(e,r){let n={};for(let m of Object.keys(r))n[m.toLowerCase()]=r[m];let o=n["webhook-id"],s=n["webhook-signature"],c=n["webhook-timestamp"];if(!s||!o||!c)throw new vW("Missing required headers");let l=this.verifyTimestamp(c),d=this.sign(o,l,e).split(",")[1],f=s.split(" "),h=new globalThis.TextEncoder;for(let m of f){let[g,A]=m.split(",");if(g==="v1"&&(0,YFc.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new vW("No matching signature found")}sign(e,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let o=new TextEncoder,s=Math.floor(r.getTime()/1e3),c=o.encode(`${e}.${s}.${n}`);return`v1,${FKi.encode(KFc.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new vW("Invalid Signature Headers");if(r-n>UKi)throw new vW("Message timestamp too old");if(n>r+UKi)throw new vW("Message timestamp too new");return new Date(n*1e3)}};yve.Webhook=GIt;GIt.prefix="whsec_"});var qKi,_ve,k6r=Se(()=>{p();Jl();qKi=fe(QKi(),1),_ve=class extends _i{static{a(this,"Webhooks")}unwrap(e,{headers:r,key:n}){if(r!==void 0){let o=n===void 0?this._client.webhookKey:n;if(o===null)throw new Error("Webhook key must not be null in order to unwrap");new qKi.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var Eve,P6r=Se(()=>{p();Jl();Nd();Dc();zf();Eve=class extends _i{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/agents/${e}/versions?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var coe,D6r=Se(()=>{p();Jl();P6r();P6r();Nd();Dc();zf();coe=class extends _i{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new Eve(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(cr`/v1/agents/${e}?beta=true`,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/agents/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/agents?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/agents/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};coe.Versions=Eve});function loe(t,e){if(!t)return()=>{};if(t.aborted)return e.abort(),()=>{};let r=a(()=>e.abort(),"onAbort");return t.addEventListener("abort",r),()=>t.removeEventListener("abort",r)}var $It=Se(()=>{p();a(loe,"linkAbort")});function CW(t,e){return t instanceof Fh&&t.status===e}function jKi(t){return t instanceof Fh&&typeof t.status=="number"&&t.status>=400&&t.status<500}function bW(t){return jKi(t)&&!CW(t,408)&&!CW(t,409)&&!CW(t,429)}function HKi(t,e,r){return Math.min(e*2**t,r)}function N6r(t,e){return t+Math.random()*(e-t)}function GKi(t){return t*(1-Math.random()*.25)}var f8e=Se(()=>{p();Wf();a(CW,"isStatus");a(jKi,"is4xx");a(bW,"isFatal4xx");a(HKi,"backoff");a(N6r,"jitter");a(GKi,"applyJitter")});function VIt(t,{authToken:e,helper:r}){if(!e)throw new mr(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(e)}`);let n=t,o=n._options.defaultHeaders,s=n._authState?.extraHeaders,c=s?Object.fromEntries(Object.entries(s).filter(([u])=>{let d=u.toLowerCase();return d!=="authorization"&&d!=="x-api-key"})):void 0,l=Et([c,o,{"x-stainless-helper":r}]);return t.withOptions({apiKey:null,authToken:e,baseURL:t.baseURL,credentials:void 0,defaultHeaders:l})}var M6r=Se(()=>{p();Wf();Dc();a(VIt,"copyClientForHelper")});function n8c(t){return HKi(t,t8c,r8c)}function i8c(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${JEe()}`:JEe()}var vve,WIt,Dk,zIt,YIt,KIt,p8e,h8e,Cve,e8c,t8c,r8c,SW,JIt=Se(()=>{p();WS();Wf();c9();cve();_It();$It();Dc();f8e();M6r();f8e();e8c=999,t8c=1e3,r8c=6e4,SW=class{static{a(this,"WorkPoller")}constructor(e){vve.set(this,void 0),WIt.set(this,!1),Dk.set(this,void 0),zIt.set(this,void 0),YIt.set(this,void 0),KIt.set(this,void 0),p8e.set(this,void 0),h8e.set(this,void 0),Cve.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??i8c(),qt(this,vve,VIt(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),qt(this,YIt,e.autoStop??!0,"f"),qt(this,KIt,e.drain??!1,"f"),qt(this,p8e,e.blockMs===void 0?e8c:e.blockMs,"f"),qt(this,h8e,e.reclaimOlderThanMs??null,"f"),qt(this,Cve,e.requestOptions,"f"),qt(this,Dk,new AbortController,"f"),qt(this,zIt,loe(e.signal,Ie(this,Dk,"f")),"f")}get signal(){return Ie(this,Dk,"f").signal}abort(){Ie(this,Dk,"f").abort()}async*[(vve=new WeakMap,WIt=new WeakMap,Dk=new WeakMap,zIt=new WeakMap,YIt=new WeakMap,KIt=new WeakMap,p8e=new WeakMap,h8e=new WeakMap,Cve=new WeakMap,Symbol.asyncIterator)](){if(Ie(this,WIt,"f"))throw new mr("Cannot iterate over a consumed WorkPoller");qt(this,WIt,!0,"f");let e=xl(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!Ie(this,Dk,"f").signal.aborted;){let n;try{n=await Ie(this,vve,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...Ie(this,p8e,"f")!==null?{block_ms:Ie(this,p8e,"f")}:{},...Ie(this,h8e,"f")!==null?{reclaim_older_than_ms:Ie(this,h8e,"f")}:{}},{headers:Et([Ie(this,Cve,"f")?.headers]),signal:Ie(this,Dk,"f").signal})}catch(o){if(Ie(this,Dk,"f").signal.aborted)return;if(bW(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=GKi(n8c(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await nM(s,Ie(this,Dk,"f").signal);continue}if(r=0,n==null){if(Ie(this,KIt,"f"))return;await nM(N6r(1e3,3e3),Ie(this,Dk,"f").signal);continue}e.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:n.id,work_type:n.data.type});try{await Ie(this,vve,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:Et([Ie(this,Cve,"f")?.headers]),signal:Ie(this,Dk,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(Ie(this,YIt,"f"))try{await Ie(this,vve,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:Et([Ie(this,Cve,"f")?.headers])})}catch(o){CW(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{Ie(this,zIt,"f").call(this)}}};a(n8c,"backoff");a(i8c,"defaultWorkerId")});var bve,TW,Sve,ZIt,$Ki=Se(()=>{p();WS();ZIt=class{static{a(this,"AsyncQueue")}constructor(){bve.set(this,[]),TW.set(this,[]),Sve.set(this,!1)}push(e){if(Ie(this,Sve,"f"))return!1;let r=Ie(this,TW,"f").shift();return r?r({done:!1,value:e}):Ie(this,bve,"f").push(e),!0}close(){if(!Ie(this,Sve,"f"))for(qt(this,Sve,!0,"f");Ie(this,TW,"f").length>0;)Ie(this,TW,"f").shift()({done:!0,value:void 0})}next(e){return Ie(this,bve,"f").length>0?Promise.resolve({done:!1,value:Ie(this,bve,"f").shift()}):Ie(this,Sve,"f")||e?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(r=>{let n=a(s=>{e?.removeEventListener("abort",o),r(s)},"waiter"),o=a(()=>{let s=Ie(this,TW,"f").indexOf(n);s>=0&&Ie(this,TW,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");Ie(this,TW,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return Ie(this,bve,"f").shift()}};bve=new WeakMap,TW=new WeakMap,Sve=new WeakMap});var Co,uoe=Se(()=>{p();Co=class extends Error{static{a(this,"ToolError")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}}});function O6r(t){return"name"in t?t.name:t.mcp_server_name}function o8c(t){return t instanceof Co?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function VKi(t,e,r){try{let n=t.parse?t.parse(e):e;return{content:await t.run(n,r),isError:!1}}catch(n){return{content:o8c(n),isError:!0}}}var WKi=Se(()=>{p();uoe();a(O6r,"toolName");a(o8c,"toolErrorContent");a(VKi,"runRunnableTool")});function eJi(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function d8c(t,e,r){return t.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:t.id,is_error:e,content:r}:{type:"user.tool_result",tool_use_id:t.id,is_error:e,content:r}}function f8c(t){if(typeof t=="string")return[{type:"text",text:t||"(no output)"}];let e=t.map(r=>r.type==="text"?{type:"text",text:r.text||"(no output)"}:r.type==="image"||r.type==="document"?r:r.type==="search_result"?{type:"search_result",source:r.source,title:r.title,content:r.content.map(n=>({type:"text",text:n.text})),citations:{enabled:r.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(r)});return e.length>0?e:[{type:"text",text:"(no output)"}]}var Wg,XIt,jy,ext,g8e,rxt,_E,Tve,AB,doe,u9,A8e,Ive,txt,tJi,zKi,YKi,KKi,L6r,m8e,B6r,JKi,rJi,s8c,ZKi,a8c,c8c,l8c,XKi,u8c,IW,nxt=Se(()=>{p();WS();Wf();c9();cve();f8e();$It();$Ki();Dc();WKi();s8c="SessionToolRunner",ZKi=500,a8c=1e4,c8c=12e4,l8c=3e4,XKi=3,u8c=6e4;a(eJi,"isEndTurnIdle");IW=class{static{a(this,"SessionToolRunner")}constructor(e,r){Wg.add(this),XIt.set(this,!1),jy.set(this,void 0),ext.set(this,void 0),g8e.set(this,void 0),rxt.set(this,void 0),_E.set(this,void 0),Tve.set(this,new Set),AB.set(this,new Set),doe.set(this,new ZIt),u9.set(this,0),A8e.set(this,null),Ive.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??u8c,qt(this,_E,xl(r.client),"f"),qt(this,rxt,new Map(r.tools.map(n=>[O6r(n),n])),"f"),qt(this,jy,new AbortController,"f"),qt(this,ext,loe(r.signal,Ie(this,jy,"f")),"f"),qt(this,g8e,r.requestOptions,"f")}get signal(){return Ie(this,jy,"f").signal}abort(){Ie(this,jy,"f").abort()}async*[(XIt=new WeakMap,jy=new WeakMap,ext=new WeakMap,g8e=new WeakMap,rxt=new WeakMap,_E=new WeakMap,Tve=new WeakMap,AB=new WeakMap,doe=new WeakMap,u9=new WeakMap,A8e=new WeakMap,Ive=new WeakMap,Wg=new WeakSet,Symbol.asyncIterator)](){if(Ie(this,XIt,"f"))throw new mr("Cannot iterate over a consumed SessionToolRunner");qt(this,XIt,!0,"f"),Ie(this,_E,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=Ie(this,Wg,"m",tJi).call(this).catch(r=>{Ie(this,jy,"f").signal.aborted||Ie(this,_E,"f").error("stream loop failed",{error:String(r)}),Ie(this,jy,"f").abort()});try{for(;;){let n=await Ie(this,doe,"f").next(Ie(this,jy,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=Ie(this,doe,"f").tryShift())!==void 0;)yield r}finally{Ie(this,jy,"f").abort(),Ie(this,Wg,"m",m8e).call(this),await e;try{await Ie(this,Wg,"m",rJi).call(this)}catch(r){Ie(this,_E,"f").warn("drain failed",{error:String(r)})}Ie(this,doe,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){Ie(this,_E,"f").warn("tool.close failed",{tool:O6r(r),error:String(n)})}Ie(this,ext,"f").call(this)}}};txt=a(function(){return{...Ie(this,g8e,"f"),headers:Et([{"x-stainless-helper":s8c},Ie(this,g8e,"f")?.headers]),signal:Ie(this,jy,"f").signal}},"_SessionToolRunner_requestOptions"),tJi=a(async function(){let e=Ie(this,jy,"f"),r=ZKi;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},Ie(this,Wg,"m",txt).call(this));await Ie(this,Wg,"m",zKi).call(this);for await(let o of n)if(r=ZKi,await Ie(this,Wg,"m",KKi).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),bW(n))throw Ie(this,_E,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;Ie(this,_E,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await nM(r,e.signal),r=Math.min(r*2,a8c)}},"_SessionToolRunner_streamLoop"),zKi=a(async function(){let e=Ie(this,jy,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},Ie(this,Wg,"m",txt).call(this)))Ie(this,Wg,"m",YKi).call(this,s,r),n=eJi(s)}catch(s){e.signal.throwIfAborted(),Ie(this,_E,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)Ie(this,Tve,"f").delete(c.id);return}let o=r.filter(s=>!Ie(this,AB,"f").has(s.id));n&&o.length===0?Ie(this,Wg,"m",L6r).call(this):Ie(this,Wg,"m",m8e).call(this);for(let s of o)await Ie(this,Wg,"m",B6r).call(this,s)},"_SessionToolRunner_reconcile"),YKi=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(Ie(this,Tve,"f").add(e.id),Ie(this,AB,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?Ie(this,AB,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&Ie(this,AB,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),KKi=a(async function(e){switch(eJi(e)?Ie(this,Wg,"m",L6r).call(this):Ie(this,Wg,"m",m8e).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return Ie(this,Tve,"f").has(e.id)||(Ie(this,Tve,"f").add(e.id),await Ie(this,Wg,"m",B6r).call(this,e)),!1;case"user.tool_result":return Ie(this,AB,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return Ie(this,AB,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return Ie(this,_E,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),Ie(this,jy,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),L6r=a(function(){Ie(this,Wg,"m",m8e).call(this),!(this.maxIdleMs<=0)&&qt(this,Ive,setTimeout(()=>{Ie(this,_E,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),Ie(this,jy,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),m8e=a(function(){Ie(this,Ive,"f")!==void 0&&(clearTimeout(Ie(this,Ive,"f")),qt(this,Ive,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),B6r=a(async function(e){var r,n;if(!Ie(this,AB,"f").has(e.id)){Ie(this,_E,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),qt(this,u9,(r=Ie(this,u9,"f"),r++,r),"f");try{let o=Ie(this,rxt,"f").get(e.name);if(!o){Ie(this,_E,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Ie(this,doe,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=loe(Ie(this,jy,"f").signal,l),d=setTimeout(()=>l.abort(),c8c);try{let m=await VKi(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=d8c(e,c,f8c(s)),h=await Ie(this,Wg,"m",JKi).call(this,f,e.id);Ie(this,doe,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{qt(this,u9,(n=Ie(this,u9,"f"),n--,n),"f"),Ie(this,u9,"f")===0&&Ie(this,A8e,"f")?.call(this)}}},"_SessionToolRunner_execute"),JKi=a(async function(e,r){let n=Ie(this,jy,"f"),o;for(let s=0;sqt(this,A8e,e,"f")),nM(l8c)]),qt(this,A8e,null,"f"),Ie(this,u9,"f")>0&&Ie(this,_E,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(d8c,"buildResultEvent");a(f8c,"toSessionContent")});var nJi=Se(()=>{p();l6r()});function foe(t){if(t.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${t.name}" must be an object, but got ${t.inputSchema.type}`);return{type:"custom",name:t.name,input_schema:t.inputSchema,description:t.description,run:t.run,parse:a(e=>e,"parse"),...t.close?{close:t.close}:{}}}var iJi=Se(()=>{p();F6r();nJi();a(foe,"betaTool")});function xve(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var U6r=Se(()=>{p();a(xve,"promiseWithResolvers")});async function h8c(t){try{return await zI.realpath(t)}catch{return t}}async function m8c(t){let e=[],r=t;for(;;){let n;try{n=await zI.realpath(r)}catch{let o=!1;try{o=(await zI.lstat(r)).isSymbolicLink()}catch{}if(o){r=zg.resolve(zg.dirname(r),await zI.readlink(r));continue}let s=zg.dirname(r);if(s===r)return t;e.push(zg.basename(r)),r=s;continue}return e.length?zg.join(n,...e.reverse()):n}}async function sJi(t,e,r){let n=r?.allowOutside??!1;if(zg.isAbsolute(e)){if(!n)throw new Co(`absolute path ${JSON.stringify(e)} not permitted`);return zg.resolve(e)}let o=await h8c(zg.resolve(t)),s=zg.resolve(o,e);if(n)return s;let c=await m8c(s),l=o.endsWith(zg.sep)?o:o+zg.sep;if(c!==o&&!c.startsWith(l))throw new Co(`path ${JSON.stringify(e)} escapes workdir`);return c}async function Q6r(t,e){let r=zg.dirname(t),n=zg.join(r,`.tmp-${process.pid}-${(0,oJi.randomUUID)()}`),o;try{o=await zI.open(n,"wx",p8c),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await zI.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await zI.unlink(n).catch(()=>{}),s}}function _8e(t,e){switch(t?.code){case"ENOENT":return`${e}: no such file or directory`;case"EACCES":case"EPERM":return`${e}: permission denied`;case"ENOTDIR":return`${e}: not a directory`;case"EISDIR":return`${e}: is a directory`;case"ELOOP":return`${e}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${e}: file name too long`;case"ENOSPC":return`${e}: no space left on device`;case"EMFILE":case"ENFILE":return`${e}: too many open files`;default:return`${e}: ${t instanceof Error?t.message:String(t)}`}}var zI,zg,oJi,y8e,p8c,q6r=Se(()=>{p();zI=fe(require("node:fs/promises"),1),zg=fe(require("node:path"),1),oJi=require("node:crypto");uoe();y8e=493,p8c=420;a(h8c,"realpathOrSelf");a(m8c,"canonicalize");a(sJi,"confineToRoot");a(Q6r,"atomicWriteFile");a(_8e,"fsErrorMessage")});async function fJi(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=xl(e),o=await e.beta.sessions.retrieve(r),s=Hy.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await H6r(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=Hy.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=Hy.resolve(s,f);if(h!==s&&!h.startsWith(s+Hy.sep)){n.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:d.name});continue}let m=await e.beta.skills.versions.download(u,{skill_id:l.skill_id});await YS.rm(h,{recursive:!0,force:!0}),await YS.mkdir(h,{recursive:!0,mode:y8e}),c.push(h),await G6r(m,h),n.info("downloaded skill",{component:"agent-tool-context",skill_id:l.skill_id,version:u,dest:h})}catch(u){n.warn("failed to download skill",{component:"agent-tool-context",skill_id:l.skill_id,error:String(u)})}return async()=>{for(let l of c)await YS.rm(l,{recursive:!0,force:!0}).catch(u=>{n.warn("failed to clean up skill",{component:"agent-tool-context",dest:l,error:String(u)})})}}async function H6r(t,e,r){if(/^\d+$/.test(r))return r;let n;for await(let o of t.beta.skills.versions.list(e))/^\d+$/.test(o.version)&&(n===void 0||BigInt(o.version)>BigInt(n))&&(n=o.version);if(n===void 0)throw new mr(`skill ${JSON.stringify(e)} has no concrete version to resolve ${JSON.stringify(r)} against`);return n}function A8c(t){for(let e of t.split(` +`)){let r=e.trim();if(r&&(Hy.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new mr(`refusing to extract unsafe archive member: ${r}`)}}function y8c(t){for(let e of t.split(` +`)){let r=e.trimStart()[0];if(r==="l"||r==="h"||r==="b"||r==="c"||r==="p"||r==="s")throw new mr("refusing to extract archive with symlink/hardlink/device member")}}async function j6r(t,e){try{let{stdout:r}=await g8c(t,e);return r}catch(r){throw r!=null&&typeof r=="object"&&r.code==="ENOENT"?new mr(`skill extraction requires the \`${t}\` command, but it was not found on PATH`):r}}function _8c(t){let e,r=!1;for(let n of t.split(` +`)){let o=n.trim().split("/").filter(c=>c!==""&&c!==".");if(o.length===0)continue;let s=o[0];if(e===void 0)e=s;else if(s!==e)return"";o.length>1&&(r=!0)}return e!==void 0&&r?e:""}async function G6r(t,e){let r=Hy.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new mr("skill download response had no body");await(0,dJi.pipeline)(uJi.Readable.fromWeb(t.body),aJi.createWriteStream(r));let n=Hy.join(Hy.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await E8c(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await j6r(c,s?["-Z1",r]:["-tf",r]);A8c(l),y8c(await j6r(c,s?["-Z",r]:["-tvf",r]));let u=_8c(l);await YS.mkdir(n,{recursive:!0,mode:y8e}),await j6r(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?Hy.join(n,u):n;for(let f of await YS.readdir(d))await YS.rename(Hy.join(d,f),Hy.join(e,f))}finally{await YS.rm(r,{force:!0}),await YS.rm(n,{recursive:!0,force:!0})}}async function E8c(t,e){let r=await YS.open(t,"r");try{let n=Buffer.alloc(e),{bytesRead:o}=await r.read(n,0,e,0);return n.subarray(0,o)}finally{await r.close()}}var YS,aJi,Hy,cJi,lJi,uJi,dJi,g8c,pJi=Se(()=>{p();YS=fe(require("node:fs/promises"),1),aJi=fe(require("node:fs"),1),Hy=fe(require("node:path"),1),cJi=require("node:child_process"),lJi=require("node:util"),uJi=require("node:stream"),dJi=require("node:stream/promises");Wf();c9();q6r();g8c=(0,lJi.promisify)(cJi.execFile);a(fJi,"setupSkills");a(H6r,"resolveSkillVersion");a(A8c,"assertSafeMemberNames");a(y8c,"assertNoSpecialMembers");a(j6r,"runArchiveTool");a(_8c,"archiveTopDir");a(G6r,"extractSkillArchive");a(E8c,"readHead")});var IJi={};Ti(IJi,{BashSession:()=>oxt,betaAgentToolset20260401:()=>T8c,betaBashTool:()=>EJi,betaEditTool:()=>bJi,betaGlobTool:()=>SJi,betaGrepTool:()=>TJi,betaReadTool:()=>vJi,betaWriteTool:()=>CJi,extractSkillArchive:()=>G6r,resolvePath:()=>wve,resolveSkillVersion:()=>H6r,setupSkills:()=>fJi});function T8c(t){return[EJi(t),vJi(t),CJi(t),bJi(t),SJi(t),TJi(t)]}function wve(t,e){return sJi(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function I8c(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function EJi(t){let e,r=Promise.resolve();return foe({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:a(async({command:n,restart:o,timeout_ms:s},c)=>{let l=r,u=xve();r=u.promise;try{await l}catch{}try{if(o&&(e?.close(),e=void 0),!n){if(o)return"bash session restarted";throw new Co("bash: command is required")}e??(e=new oxt(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??_Ji,signal:c?.signal});if(f!==0)throw new Co(d||`exit ${f}`);return d}catch(d){throw d instanceof Co?d:(e.close(),e=void 0,new Co(`bash: ${d instanceof Error?d.message:String(d)}`))}}finally{u.resolve()}},"run"),close:a(()=>{e?.close(),e=void 0},"close")})}function vJi(t){return foe({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:a(async({file_path:e,view_range:r})=>{if(!e)throw new Co("read: file_path is required");let n=await wve(t,e),o;try{let f=await EE.stat(n);if(!f.isFile())throw new Co(`read: ${e} is not a regular file`);if(f.size>V6r)throw new Co(`read: ${e} is ${f.size} bytes, exceeds ${V6r}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await EE.readFile(n,"utf8")}catch(f){throw f instanceof Co?f:new Co(`read: ${_8e(f,e)}`)}if(!r)return o;if(r.length!==2)throw new Co("read: view_range must be [start_line, end_line]");let[s,c]=r,l=o.split(` `),u=Math.max(0,s-1),d=c>0?c:l.length;return l.slice(u,d).join(` -`)},"run")})}function EJi(t){return doe({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:a(async({file_path:e,content:r})=>{if(!e)throw new Co("write: file_path is required");let n=await wve(t,e);try{await EE.mkdir(Yf.dirname(n),{recursive:!0,mode:y8e}),await U6r(n,r??"")}catch(o){throw new Co(`write: ${_8e(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function vJi(t){return doe({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:a(async({file_path:e,old_string:r,new_string:n,replace_all:o})=>{if(!e)throw new Co("edit: file_path is required");if(!r)throw new Co("edit: old_string is required");let s=await wve(t,e),c;try{let d=await EE.stat(s);if(!d.isFile())throw new Co(`edit: ${e} is not a regular file`);if(d.size>pJi)throw new Co(`edit: ${e} is ${d.size} bytes, exceeds ${pJi}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await EE.readFile(s,"utf8")}catch(d){throw d instanceof Co?d:new Co(`edit: ${_8e(d,e)}`)}let l=c.split(r).length-1;if(l===0)throw new Co(`edit: old_string not found in ${e}`);let u;if(o)u=c.split(r).join(n);else{if(l>1)throw new Co(`edit: old_string appears ${l} times in ${e} (must be unique)`);u=c.replace(r,()=>n)}try{await U6r(s,u)}catch(d){throw new Co(`edit: write: ${_8e(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function CJi(t){return doe({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:a(async({pattern:e,path:r})=>{if(!e)throw new Co("glob: pattern is required");let n=Yf.resolve(t.workdir),o=e;if(Yf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new Co("glob: absolute pattern not permitted");n=Yf.parse(e).root,o=Yf.relative(n,e)}else r&&(n=await wve(t,r));if(!t.unrestrictedPaths&&o.split(/[\\/]/).includes(".."))throw new Co('glob: ".." is not permitted in the pattern');let s=[];try{for await(let c of C8c(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=Yf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!x8c(n,l))continue;let u=0;try{u=(await EE.stat(l)).mtimeMs}catch{}s.push({path:l,mtime:u})}}catch(c){throw new Co(`glob: ${c instanceof Error?c.message:String(c)}`)}return s.length===0?"no matches":(s.sort((c,l)=>l.mtime-c.mtime),s.slice(0,E8c).map(c=>c.path).join(` -`))},"run")})}function bJi(t){return doe({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:a(async({pattern:e,path:r},n)=>{if(!e)throw new Co("grep: pattern is required");let o=Yf.resolve(t.workdir);r&&(o=await wve(t,r));let s=await P8c();return s?T8c(s,e,o,n?.signal):I8c(e,o,n?.signal)},"run")})}function T8c(t,e,r,n){return new Promise((o,s)=>{let c=V6r.spawn(t,["-n","--no-heading","-e",e,"--",r],{...n?{signal:n}:{}}),l="",u="",d=!1;c.stdout.on("data",f=>{d||(l+=f,l.length>v8e&&(d=!0,l=l.slice(0,v8e),c.kill("SIGKILL")))}),c.stderr.on("data",f=>u+=f),c.on("close",f=>{if(n?.aborted)return s(new Co("grep: aborted"));if(d)return o(l+` -[output truncated at ${v8e} bytes]`);if(f===0)return o(l);if(f===1)return o("no matches");s(new Co(`grep: rg failed: ${u||`exit ${f}`}`))}),c.on("error",f=>{if(n?.aborted)return s(new Co("grep: aborted"));s(new Co(`grep: rg failed: ${f.message}`))})})}async function I8c(t,e,r){let n;try{n=new RegExp(t)}catch(u){throw new Co(`grep: invalid regex: ${u instanceof Error?u.message:String(u)}`)}let o=[],s=v8e,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${v8e} bytes]`),!1):(o.push(u),!0)),"push");if((await EE.stat(e).catch(()=>null))?.isFile()?await hJi(e,n,c):await k8c(e,"",u=>hJi(Yf.join(e,u),n,c),r),r?.aborted)throw new Co("grep: aborted");return o.length===0?"no matches":o.join(` -`)}async function hJi(t,e,r){let n=oxt.createReadStream(t,{encoding:"utf8"}),o=gJi.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>_8c)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function x8c(t,e){let r=Yf.relative(t,e);return r===""||!r.startsWith(".."+Yf.sep)&&r!==".."&&!Yf.isAbsolute(r)}async function k8c(t,e,r,n){let o=R8c;async function s(c,l){if(l>w8c)return!0;if(n?.aborted)return!1;let u;try{u=await EE.readdir(Yf.join(t,c),{withFileTypes:!0})}catch{return!0}for(let d of u){if(d.name===".git"||d.name==="node_modules")continue;if(o--<=0||n?.aborted)return!1;let f=c?Yf.join(c,d.name):d.name;if(d.isDirectory()){if(!await s(f,l+1))return!1}else if(d.isFile()&&await r(f)===!1)return!1}return!0}a(s,"inner"),await s(e,0)}async function P8c(){let t=(process.env.PATH??"").split(Yf.delimiter);for(let e of t){let r=Yf.join(e,"rg");try{return await EE.access(r,oxt.constants.X_OK),r}catch{}}return null}var EE,oxt,Yf,V6r,mJi,gJi,nxt,pC,KS,E8e,foe,Nk,G6r,fJi,AJi,$6r,pJi,v8e,_8c,E8c,v8c,C8c,ixt,w8c,R8c,TJi=Se(()=>{p();WS();EE=fe(require("node:fs/promises"),1),oxt=fe(require("node:fs"),1),Yf=fe(require("node:path"),1),V6r=fe(require("node:child_process"),1),mJi=fe(require("node:crypto"),1),gJi=fe(require("node:readline"),1);Wf();loe();rJi();F6r();Q6r();dJi();fJi=100*1024,AJi=12e4,$6r=256*1024,pJi=$6r,v8e=100*1024,_8c=2e3,E8c=200,v8c=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,C8c=EE.glob;a(b8c,"betaAgentToolset20260401");a(wve,"resolvePath");a(S8c,"scrubbedShellEnv");ixt=class{static{a(this,"BashSession")}constructor(e,r=S8c()){nxt.add(this),pC.set(this,void 0),KS.set(this,""),E8e.set(this,!1),foe.set(this,!1),Nk.set(this,null),qt(this,pC,V6r.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),Ie(this,pC,"f").stdout.setEncoding("utf8"),Ie(this,pC,"f").stderr.setEncoding("utf8"),Ie(this,pC,"f").stdout.on("data",n=>Ie(this,nxt,"m",G6r).call(this,n)),Ie(this,pC,"f").stderr.on("data",n=>Ie(this,nxt,"m",G6r).call(this,n)),Ie(this,pC,"f").once("close",()=>{qt(this,foe,!0,"f");let n=Ie(this,Nk,"f");qt(this,Nk,null,"f"),n?.resolve()})}get closed(){return Ie(this,foe,"f")}async exec(e,r={}){if(Ie(this,foe,"f"))throw new mr("bash session terminated");let n=r.timeoutMs??AJi,o=r.signal;if(o?.aborted)throw new mr("bash command aborted");qt(this,KS,"","f"),qt(this,E8e,!1,"f");let s=`__ANT_CMD_${mJi.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} +`)},"run")})}function CJi(t){return foe({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:a(async({file_path:e,content:r})=>{if(!e)throw new Co("write: file_path is required");let n=await wve(t,e);try{await EE.mkdir(Yf.dirname(n),{recursive:!0,mode:y8e}),await Q6r(n,r??"")}catch(o){throw new Co(`write: ${_8e(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function bJi(t){return foe({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:a(async({file_path:e,old_string:r,new_string:n,replace_all:o})=>{if(!e)throw new Co("edit: file_path is required");if(!r)throw new Co("edit: old_string is required");let s=await wve(t,e),c;try{let d=await EE.stat(s);if(!d.isFile())throw new Co(`edit: ${e} is not a regular file`);if(d.size>mJi)throw new Co(`edit: ${e} is ${d.size} bytes, exceeds ${mJi}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await EE.readFile(s,"utf8")}catch(d){throw d instanceof Co?d:new Co(`edit: ${_8e(d,e)}`)}let l=c.split(r).length-1;if(l===0)throw new Co(`edit: old_string not found in ${e}`);let u;if(o)u=c.split(r).join(n);else{if(l>1)throw new Co(`edit: old_string appears ${l} times in ${e} (must be unique)`);u=c.replace(r,()=>n)}try{await Q6r(s,u)}catch(d){throw new Co(`edit: write: ${_8e(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function SJi(t){return foe({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:a(async({pattern:e,path:r})=>{if(!e)throw new Co("glob: pattern is required");let n=Yf.resolve(t.workdir),o=e;if(Yf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new Co("glob: absolute pattern not permitted");n=Yf.parse(e).root,o=Yf.relative(n,e)}else r&&(n=await wve(t,r));if(!t.unrestrictedPaths&&o.split(/[\\/]/).includes(".."))throw new Co('glob: ".." is not permitted in the pattern');let s=[];try{for await(let c of S8c(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=Yf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!R8c(n,l))continue;let u=0;try{u=(await EE.stat(l)).mtimeMs}catch{}s.push({path:l,mtime:u})}}catch(c){throw new Co(`glob: ${c instanceof Error?c.message:String(c)}`)}return s.length===0?"no matches":(s.sort((c,l)=>l.mtime-c.mtime),s.slice(0,C8c).map(c=>c.path).join(` +`))},"run")})}function TJi(t){return foe({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:a(async({pattern:e,path:r},n)=>{if(!e)throw new Co("grep: pattern is required");let o=Yf.resolve(t.workdir);r&&(o=await wve(t,r));let s=await N8c();return s?x8c(s,e,o,n?.signal):w8c(e,o,n?.signal)},"run")})}function x8c(t,e,r,n){return new Promise((o,s)=>{let c=W6r.spawn(t,["-n","--no-heading","-e",e,"--",r],{...n?{signal:n}:{}}),l="",u="",d=!1;c.stdout.on("data",f=>{d||(l+=f,l.length>v8e&&(d=!0,l=l.slice(0,v8e),c.kill("SIGKILL")))}),c.stderr.on("data",f=>u+=f),c.on("close",f=>{if(n?.aborted)return s(new Co("grep: aborted"));if(d)return o(l+` +[output truncated at ${v8e} bytes]`);if(f===0)return o(l);if(f===1)return o("no matches");s(new Co(`grep: rg failed: ${u||`exit ${f}`}`))}),c.on("error",f=>{if(n?.aborted)return s(new Co("grep: aborted"));s(new Co(`grep: rg failed: ${f.message}`))})})}async function w8c(t,e,r){let n;try{n=new RegExp(t)}catch(u){throw new Co(`grep: invalid regex: ${u instanceof Error?u.message:String(u)}`)}let o=[],s=v8e,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${v8e} bytes]`),!1):(o.push(u),!0)),"push");if((await EE.stat(e).catch(()=>null))?.isFile()?await gJi(e,n,c):await D8c(e,"",u=>gJi(Yf.join(e,u),n,c),r),r?.aborted)throw new Co("grep: aborted");return o.length===0?"no matches":o.join(` +`)}async function gJi(t,e,r){let n=sxt.createReadStream(t,{encoding:"utf8"}),o=yJi.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>v8c)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function R8c(t,e){let r=Yf.relative(t,e);return r===""||!r.startsWith(".."+Yf.sep)&&r!==".."&&!Yf.isAbsolute(r)}async function D8c(t,e,r,n){let o=P8c;async function s(c,l){if(l>k8c)return!0;if(n?.aborted)return!1;let u;try{u=await EE.readdir(Yf.join(t,c),{withFileTypes:!0})}catch{return!0}for(let d of u){if(d.name===".git"||d.name==="node_modules")continue;if(o--<=0||n?.aborted)return!1;let f=c?Yf.join(c,d.name):d.name;if(d.isDirectory()){if(!await s(f,l+1))return!1}else if(d.isFile()&&await r(f)===!1)return!1}return!0}a(s,"inner"),await s(e,0)}async function N8c(){let t=(process.env.PATH??"").split(Yf.delimiter);for(let e of t){let r=Yf.join(e,"rg");try{return await EE.access(r,sxt.constants.X_OK),r}catch{}}return null}var EE,sxt,Yf,W6r,AJi,yJi,ixt,pC,KS,E8e,poe,Nk,$6r,hJi,_Ji,V6r,mJi,v8e,v8c,C8c,b8c,S8c,oxt,k8c,P8c,xJi=Se(()=>{p();WS();EE=fe(require("node:fs/promises"),1),sxt=fe(require("node:fs"),1),Yf=fe(require("node:path"),1),W6r=fe(require("node:child_process"),1),AJi=fe(require("node:crypto"),1),yJi=fe(require("node:readline"),1);Wf();uoe();iJi();U6r();q6r();pJi();hJi=100*1024,_Ji=12e4,V6r=256*1024,mJi=V6r,v8e=100*1024,v8c=2e3,C8c=200,b8c=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,S8c=EE.glob;a(T8c,"betaAgentToolset20260401");a(wve,"resolvePath");a(I8c,"scrubbedShellEnv");oxt=class{static{a(this,"BashSession")}constructor(e,r=I8c()){ixt.add(this),pC.set(this,void 0),KS.set(this,""),E8e.set(this,!1),poe.set(this,!1),Nk.set(this,null),qt(this,pC,W6r.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),Ie(this,pC,"f").stdout.setEncoding("utf8"),Ie(this,pC,"f").stderr.setEncoding("utf8"),Ie(this,pC,"f").stdout.on("data",n=>Ie(this,ixt,"m",$6r).call(this,n)),Ie(this,pC,"f").stderr.on("data",n=>Ie(this,ixt,"m",$6r).call(this,n)),Ie(this,pC,"f").once("close",()=>{qt(this,poe,!0,"f");let n=Ie(this,Nk,"f");qt(this,Nk,null,"f"),n?.resolve()})}get closed(){return Ie(this,poe,"f")}async exec(e,r={}){if(Ie(this,poe,"f"))throw new mr("bash session terminated");let n=r.timeoutMs??_Ji,o=r.signal;if(o?.aborted)throw new mr("bash command aborted");qt(this,KS,"","f"),qt(this,E8e,!1,"f");let s=`__ANT_CMD_${AJi.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} } &1; printf '\\n${c}%d\\n' $? -`;if(Ie(this,pC,"f").stdin.write(l),Ie(this,KS,"f").indexOf(s)<0){let{promise:g,resolve:A}=xve();qt(this,Nk,{sentinel:s,resolve:A},"f");let y,_;try{await Promise.race([g,new Promise((E,v)=>{y=setTimeout(()=>v(new mr(`bash command timed out after ${n}ms`)),n)}),new Promise((E,v)=>{o&&(_=a(()=>v(new mr("bash command aborted")),"onAbort"),o.addEventListener("abort",_,{once:!0}))})])}finally{y&&clearTimeout(y),_&&o&&o.removeEventListener("abort",_),qt(this,Nk,null,"f")}}let u=Ie(this,KS,"f").indexOf(s);if(u<0)throw new mr("bash session terminated");let f=Ie(this,KS,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=Ie(this,KS,"f").slice(0,u).replace(v8c,"").replace(/\n+$/,"");return Ie(this,E8e,"f")&&(m=`[output truncated] -${m}`),{output:m,exitCode:h}}close(){if(Ie(this,foe,"f"))return;qt(this,foe,!0,"f");let e=Ie(this,Nk,"f");qt(this,Nk,null,"f"),e?.resolve(),Ie(this,pC,"f").stdout.destroy(),Ie(this,pC,"f").stderr.destroy(),Ie(this,pC,"f").stdin.destroy();try{process.kill(-Ie(this,pC,"f").pid,"SIGKILL")}catch{Ie(this,pC,"f").kill("SIGKILL")}Ie(this,pC,"f").unref()}};pC=new WeakMap,KS=new WeakMap,E8e=new WeakMap,foe=new WeakMap,Nk=new WeakMap,nxt=new WeakSet,G6r=a(function(e){if(qt(this,KS,Ie(this,KS,"f")+e,"f"),Ie(this,KS,"f").length>fJi&&(qt(this,KS,Ie(this,KS,"f").slice(Ie(this,KS,"f").length-fJi),"f"),qt(this,E8e,!0,"f")),Ie(this,Nk,"f")&&Ie(this,KS,"f").indexOf(Ie(this,Nk,"f").sentinel)>=0){let r=Ie(this,Nk,"f");qt(this,Nk,null,"f"),r.resolve()}},"_BashSession_append");a(yJi,"betaBashTool");a(_Ji,"betaReadTool");a(EJi,"betaWriteTool");a(vJi,"betaEditTool");a(CJi,"betaGlobTool");a(bJi,"betaGrepTool");a(T8c,"runRipgrep");a(I8c,"runWalkGrep");a(hJi,"grepFile");a(x8c,"isWithin");w8c=40,R8c=5e4;a(k8c,"walk");a(P8c,"findRg")});async function N8c(t,e,r,n){try{await t.beta.environments.work.stop(e.id,{environment_id:e.environment_id,force:!0},{...n,headers:Et([n?.headers])})}catch(o){vW(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function M8c(t,e,r,n,o){let s=IJi,c=D8c,l=a(async()=>{try{let u=await t.beta.environments.work.heartbeat(e.id,{environment_id:e.environment_id,expected_last_heartbeat:c},{...o,headers:Et([o?.headers]),signal:r.signal});c=u.last_heartbeat,u.ttl_seconds>0&&(s=Math.max(1e3,Math.min(u.ttl_seconds*1e3/2,IJi))),(u.state==="stopping"||u.state==="stopped")&&(n.info("heartbeat signals shutdown",{work_id:e.id,state:u.state}),r.abort()),u.lease_extended||(n.warn("lease not extended, shutting down",{work_id:e.id}),r.abort())}catch(u){if(r.signal.throwIfAborted(),CW(u))throw n.error("permanent heartbeat failure",{work_id:e.id,error:String(u)}),r.abort(),u;n.warn("transient heartbeat failure",{work_id:e.id,error:String(u)})}},"beat");for(await l();!r.signal.aborted;)await nM(s,r.signal),r.signal.throwIfAborted(),await l()}var sxt,C8e,W6r,IJi,D8c,Rve,z6r=Se(()=>{p();WS();Wf();c9();n8e();cve();f8e();GIt();Dc();rxt();KIt();N6r();IJi=3e4,D8c="NO_HEARTBEAT",Rve=class{static{a(this,"EnvironmentWorker")}constructor(e){sxt.add(this),C8e.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.tools=e.tools,this.workdir=e.workdir??process.cwd(),this.unrestrictedPaths=e.unrestrictedPaths,this.maxIdleMs=e.maxIdleMs,this.workerId=e.workerId,this.requestOptions=e.requestOptions,qt(this,C8e,e.signal,"f")}async run(e){let{environmentId:r,environmentKey:n}=this;if(r===void 0||n===void 0)throw new mr("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let o=e??Ie(this,C8e,"f"),s=new bW({client:this.client,environmentId:r,environmentKey:n,...this.workerId!==void 0?{workerId:this.workerId}:{},...o?{signal:o}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let c of s)await Ie(this,sxt,"m",W6r).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??wa("ANTHROPIC_WORK_ID"),n=e?.environmentId??wa("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??wa("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??wa("ANTHROPIC_ENVIRONMENT_KEY");if(!r)throw new mr("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!n)throw new mr("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!o)throw new mr("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s)throw new mr("handleItem: environmentKey is required \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let c={id:r,environment_id:n,data:{type:"session",id:o}};await Ie(this,sxt,"m",W6r).call(this,c,s,e?.signal??Ie(this,C8e,"f"))}};C8e=new WeakMap,sxt=new WeakSet,W6r=a(async function(e,r,n){let o=xl(this.client),s=$It(this.client,{authToken:r,helper:"environments-worker"}),c=e.data.id,l={workdir:this.workdir,client:this.client,sessionId:c,...this.unrestrictedPaths!==void 0?{unrestrictedPaths:this.unrestrictedPaths}:{}},u=await Promise.resolve().then(()=>(TJi(),SJi)),d=a(async()=>{},"cleanupSkills");try{d=await u.setupSkills(l)}catch(A){o.warn("skill setup failed",{session_id:c,work_id:e.id,error:String(A)})}let f=typeof this.tools=="function"?this.tools(l):this.tools??u.betaAgentToolset20260401(l),h=new AbortController,m=coe(n,h),g=M8c(s,e,h,o,this.requestOptions).catch(A=>{h.signal.aborted||o.error("heartbeat loop failed",{work_id:e.id,error:String(A)}),h.abort()});try{let A=new TW(c,{client:s,tools:f,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:h.signal});for await(let y of A);}finally{h.abort(),m(),await g,await d().catch(A=>{o.warn("skill cleanup failed",{session_id:c,work_id:e.id,error:String(A)})}),await N8c(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(N8c,"forceStop");a(M8c,"heartbeatLoop")});var IW,Y6r=Se(()=>{p();Jl();Dd();Dc();zf();KIt();z6r();KIt();z6r();IW=class extends _i{static{a(this,"Work")}retrieve(e,r,n){let{environment_id:o,betas:s}=r;return this._client.get(cr`/v1/environments/${o}/work/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{environment_id:o,betas:s,...c}=r;return this._client.post(cr`/v1/environments/${o}/work/${e}?beta=true`,{body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/environments/${e}/work?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}ack(e,r,n){let{environment_id:o,betas:s}=r;return this._client.post(cr`/v1/environments/${o}/work/${e}/ack?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}heartbeat(e,r,n){let{environment_id:o,desired_ttl_seconds:s,expected_last_heartbeat:c,betas:l}=r;return this._client.post(cr`/v1/environments/${o}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:c},...n,headers:Et([{"anthropic-beta":[...l??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poll(e,r={},n){let{betas:o,"Anthropic-Worker-ID":s,...c}=r??{};return this._client.get(cr`/v1/environments/${e}/work/poll?beta=true`,{query:c,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"Anthropic-Worker-ID":s}:void 0},n?.headers])})}stats(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/environments/${e}/work/stats?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stop(e,r,n){let{environment_id:o,betas:s,...c}=r;return this._client.post(cr`/v1/environments/${o}/work/${e}/stop?beta=true`,{body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poller(e){return new bW({...e,client:this._client})}worker(e){return new Rve({...e,client:this._client})}};IW.WorkPoller=bW;IW.EnvironmentWorker=Rve});var poe,K6r=Se(()=>{p();Jl();Y6r();Y6r();Dd();Dc();zf();poe=class extends _i{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new IW(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/environments/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/environments/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/environments?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/environments/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/environments/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};poe.Work=IW});var kve,J6r=Se(()=>{p();Jl();Dd();Dc();zf();kve=class extends _i{static{a(this,"Memories")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(cr`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(cr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:o,view:s,betas:c,...l}=r;return this._client.post(cr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:Et([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/memory_stores/${e}/memories?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:o,expected_content_sha256:s,betas:c}=r;return this._client.delete(cr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:Et([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Pve,Z6r=Se(()=>{p();Jl();Dd();Dc();zf();Pve=class extends _i{static{a(this,"MemoryVersions")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(cr`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/memory_stores/${e}/memory_versions?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:o,betas:s}=r;return this._client.post(cr`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var xW,X6r=Se(()=>{p();Jl();J6r();J6r();Z6r();Z6r();Dd();Dc();zf();xW=class extends _i{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new kve(this._client),this.memoryVersions=new Pve(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/memory_stores/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/memory_stores/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};xW.Memories=kve;xW.MemoryVersions=Pve});var Dve=Se(()=>{p();Wf()});var Nve,eUr=Se(()=>{p();Wf();lve();p6r();Nve=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new l9;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new mr("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new mr("Attempted to iterate over a response with no body");return new t(t8e(e.body),r)}}});var Mve,tUr=Se(()=>{p();Jl();Dd();Dc();eUr();Dve();zf();Mve=class extends _i{static{a(this,"Batches")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/messages/batches/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",Pk,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/messages/batches/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let o=await this.retrieve(e);if(!o.results_url)throw new mr(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);let{betas:s}=r??{};return this._client.get(o.results_url,{...n,headers:Et([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>Nve.fromResponse(l.response,l.controller))}}});var axt,rUr=Se(()=>{p();axt={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function xJi(t){return t?.output_format??t?.output_config?.format}function nUr(t,e,r){let n=xJi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null}:iUr(t,e,r)}function iUr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=q8c(e,s.text);n===null&&(n=c);let l=Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function q8c(t,e){let r=xJi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new mr(`Failed to parse structured output: ${n}`)}}var oUr=Se(()=>{p();Wf();a(xJi,"getOutputFormat");a(nUr,"maybeParseBetaMessage");a(iUr,"parseBetaMessage");a(q8c,"parseBetaOutputFormat")});var j8c,Ove,H8c,G8c,cxt,sUr=Se(()=>{p();j8c=a(t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),Ove(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),Ove(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),Ove(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),Ove(t);break;case"delimiter":return t=t.slice(0,t.length-1),Ove(t);break}return t},"strip"),H8c=a(t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},"unstrip"),G8c=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),cxt=a(t=>JSON.parse(G8c(H8c(Ove(j8c(t))))),"partialParse")});var aUr=Se(()=>{p();m6r()});function PJi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var Mk,wW,Lve,b8e,lxt,S8e,T8e,uxt,I8e,d9,x8e,dxt,fxt,hoe,pxt,hxt,w8e,cUr,wJi,mxt,lUr,uUr,dUr,RJi,kJi,gxt,DJi=Se(()=>{p();WS();sUr();Dve();ZEe();aUr();oUr();kJi="__json_buf";a(PJi,"tracksToolInput");gxt=class t{static{a(this,"BetaMessageStream")}constructor(e,r){Mk.add(this),this.messages=[],this.receivedMessages=[],wW.set(this,void 0),Lve.set(this,null),this.controller=new AbortController,b8e.set(this,void 0),lxt.set(this,()=>{}),S8e.set(this,()=>{}),T8e.set(this,void 0),uxt.set(this,()=>{}),I8e.set(this,()=>{}),d9.set(this,{}),x8e.set(this,!1),dxt.set(this,!1),fxt.set(this,!1),hoe.set(this,!1),pxt.set(this,void 0),hxt.set(this,void 0),w8e.set(this,void 0),mxt.set(this,n=>{if(qt(this,dxt,!0,"f"),s9(n)&&(n=new qy),n instanceof qy)return qt(this,fxt,!0,"f"),this._emit("abort",n);if(n instanceof mr)return this._emit("error",n);if(n instanceof Error){let o=new mr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new mr(String(n)))}),qt(this,b8e,new Promise((n,o)=>{qt(this,lxt,n,"f"),qt(this,S8e,o,"f")}),"f"),qt(this,T8e,new Promise((n,o)=>{qt(this,uxt,n,"f"),qt(this,I8e,o,"f")}),"f"),Ie(this,b8e,"f").catch(()=>{}),Ie(this,T8e,"f").catch(()=>{}),qt(this,Lve,e,"f"),qt(this,w8e,r?.logger??console,"f")}get response(){return Ie(this,pxt,"f")}get request_id(){return Ie(this,hxt,"f")}async withResponse(){qt(this,hoe,!0,"f");let e=await Ie(this,b8e,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return qt(s,Lve,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},Ie(this,mxt,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{Ie(this,Mk,"m",lUr).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)Ie(this,Mk,"m",uUr).call(this,u);if(l.controller.signal?.aborted)throw new qy;Ie(this,Mk,"m",dUr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,pxt,e,"f"),qt(this,hxt,e?.headers.get("request-id"),"f"),Ie(this,lxt,"f").call(this,e),this._emit("connect"))}get ended(){return Ie(this,x8e,"f")}get errored(){return Ie(this,dxt,"f")}get aborted(){return Ie(this,fxt,"f")}abort(){this.controller.abort()}on(e,r){return(Ie(this,d9,"f")[e]||(Ie(this,d9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=Ie(this,d9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(Ie(this,d9,"f")[e]||(Ie(this,d9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,hoe,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,hoe,!0,"f"),await Ie(this,T8e,"f")}get currentMessage(){return Ie(this,wW,"f")}async finalMessage(){return await this.done(),Ie(this,Mk,"m",cUr).call(this)}async finalText(){return await this.done(),Ie(this,Mk,"m",wJi).call(this)}_emit(e,...r){if(Ie(this,x8e,"f"))return;e==="end"&&(qt(this,x8e,!0,"f"),Ie(this,uxt,"f").call(this));let n=Ie(this,d9,"f")[e];if(n&&(Ie(this,d9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!Ie(this,hoe,"f")&&!n?.length&&Promise.reject(o),Ie(this,S8e,"f").call(this,o),Ie(this,I8e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!Ie(this,hoe,"f")&&!n?.length&&Promise.reject(o),Ie(this,S8e,"f").call(this,o),Ie(this,I8e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",Ie(this,Mk,"m",cUr).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{Ie(this,Mk,"m",lUr).call(this),this._connected(null);let s=gB.fromReadableStream(e,this.controller);for await(let c of s)Ie(this,Mk,"m",uUr).call(this,c);if(s.controller.signal?.aborted)throw new qy;Ie(this,Mk,"m",dUr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(wW=new WeakMap,Lve=new WeakMap,b8e=new WeakMap,lxt=new WeakMap,S8e=new WeakMap,T8e=new WeakMap,uxt=new WeakMap,I8e=new WeakMap,d9=new WeakMap,x8e=new WeakMap,dxt=new WeakMap,fxt=new WeakMap,hoe=new WeakMap,pxt=new WeakMap,hxt=new WeakMap,w8e=new WeakMap,mxt=new WeakMap,Mk=new WeakSet,cUr=a(function(){if(this.receivedMessages.length===0)throw new mr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_BetaMessageStream_getFinalMessage"),wJi=a(function(){if(this.receivedMessages.length===0)throw new mr("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new mr("stream ended without producing a content block with type=text");return r.join(" ")},"_BetaMessageStream_getFinalText"),lUr=a(function(){this.ended||qt(this,wW,void 0,"f")},"_BetaMessageStream_beginRequest"),uUr=a(function(r){if(this.ended)return;let n=Ie(this,Mk,"m",RJi).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let o=n.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{PJi(o)&&o.input&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}case"compaction_delta":{o.type==="compaction"&&o.content&&this._emit("compaction",o.content);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage(nUr(n,Ie(this,Lve,"f"),{logger:Ie(this,w8e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,wW,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),dUr=a(function(){if(this.ended)throw new mr("stream has ended, this shouldn't happen");let r=Ie(this,wW,"f");if(!r)throw new mr("request ended without sending any chunks");return qt(this,wW,void 0,"f"),nUr(r,Ie(this,Lve,"f"),{logger:Ie(this,w8e,"f")})},"_BetaMessageStream_endRequest"),RJi=a(function(r){let n=Ie(this,wW,"f");if(r.type==="message_start"){if(n)throw new mr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new mr(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.container=r.delta.container,n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,n.context_management=r.context_management,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),r.usage.iterations!=null&&(n.usage.iterations=r.usage.iterations),n;case"content_block_start":return n.content.push(r.content_block),n;case"content_block_delta":{let o=n.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(n.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(n.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&PJi(o)){let s=o[kJi]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,kJi,{value:s,enumerable:!1,writable:!0}),s)try{c.input=cxt(s)}catch(l){let u=new mr(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${l}. JSON: ${s}`);Ie(this,mxt,"f").call(this,u)}n.content[r.index]=c}break}case"thinking_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,signature:r.delta.signature});break}case"compaction_delta":{o?.type==="compaction"&&(n.content[r.index]={...o,content:(o.content||"")+r.delta.content});break}default:r.delta}return n}case"content_block_stop":return n}},"_BetaMessageStream_accumulateMessage"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((s,c)=>r.push({resolve:s,reject:c})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new gB(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var NJi,MJi=Se(()=>{p();NJi=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: +`;if(Ie(this,pC,"f").stdin.write(l),Ie(this,KS,"f").indexOf(s)<0){let{promise:g,resolve:A}=xve();qt(this,Nk,{sentinel:s,resolve:A},"f");let y,_;try{await Promise.race([g,new Promise((E,v)=>{y=setTimeout(()=>v(new mr(`bash command timed out after ${n}ms`)),n)}),new Promise((E,v)=>{o&&(_=a(()=>v(new mr("bash command aborted")),"onAbort"),o.addEventListener("abort",_,{once:!0}))})])}finally{y&&clearTimeout(y),_&&o&&o.removeEventListener("abort",_),qt(this,Nk,null,"f")}}let u=Ie(this,KS,"f").indexOf(s);if(u<0)throw new mr("bash session terminated");let f=Ie(this,KS,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=Ie(this,KS,"f").slice(0,u).replace(b8c,"").replace(/\n+$/,"");return Ie(this,E8e,"f")&&(m=`[output truncated] +${m}`),{output:m,exitCode:h}}close(){if(Ie(this,poe,"f"))return;qt(this,poe,!0,"f");let e=Ie(this,Nk,"f");qt(this,Nk,null,"f"),e?.resolve(),Ie(this,pC,"f").stdout.destroy(),Ie(this,pC,"f").stderr.destroy(),Ie(this,pC,"f").stdin.destroy();try{process.kill(-Ie(this,pC,"f").pid,"SIGKILL")}catch{Ie(this,pC,"f").kill("SIGKILL")}Ie(this,pC,"f").unref()}};pC=new WeakMap,KS=new WeakMap,E8e=new WeakMap,poe=new WeakMap,Nk=new WeakMap,ixt=new WeakSet,$6r=a(function(e){if(qt(this,KS,Ie(this,KS,"f")+e,"f"),Ie(this,KS,"f").length>hJi&&(qt(this,KS,Ie(this,KS,"f").slice(Ie(this,KS,"f").length-hJi),"f"),qt(this,E8e,!0,"f")),Ie(this,Nk,"f")&&Ie(this,KS,"f").indexOf(Ie(this,Nk,"f").sentinel)>=0){let r=Ie(this,Nk,"f");qt(this,Nk,null,"f"),r.resolve()}},"_BashSession_append");a(EJi,"betaBashTool");a(vJi,"betaReadTool");a(CJi,"betaWriteTool");a(bJi,"betaEditTool");a(SJi,"betaGlobTool");a(TJi,"betaGrepTool");a(x8c,"runRipgrep");a(w8c,"runWalkGrep");a(gJi,"grepFile");a(R8c,"isWithin");k8c=40,P8c=5e4;a(D8c,"walk");a(N8c,"findRg")});async function O8c(t,e,r,n){try{await t.beta.environments.work.stop(e.id,{environment_id:e.environment_id,force:!0},{...n,headers:Et([n?.headers])})}catch(o){CW(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function L8c(t,e,r,n,o){let s=wJi,c=M8c,l=a(async()=>{try{let u=await t.beta.environments.work.heartbeat(e.id,{environment_id:e.environment_id,expected_last_heartbeat:c},{...o,headers:Et([o?.headers]),signal:r.signal});c=u.last_heartbeat,u.ttl_seconds>0&&(s=Math.max(1e3,Math.min(u.ttl_seconds*1e3/2,wJi))),(u.state==="stopping"||u.state==="stopped")&&(n.info("heartbeat signals shutdown",{work_id:e.id,state:u.state}),r.abort()),u.lease_extended||(n.warn("lease not extended, shutting down",{work_id:e.id}),r.abort())}catch(u){if(r.signal.throwIfAborted(),bW(u))throw n.error("permanent heartbeat failure",{work_id:e.id,error:String(u)}),r.abort(),u;n.warn("transient heartbeat failure",{work_id:e.id,error:String(u)})}},"beat");for(await l();!r.signal.aborted;)await nM(s,r.signal),r.signal.throwIfAborted(),await l()}var axt,C8e,z6r,wJi,M8c,Rve,Y6r=Se(()=>{p();WS();Wf();c9();n8e();cve();f8e();$It();Dc();nxt();JIt();M6r();wJi=3e4,M8c="NO_HEARTBEAT",Rve=class{static{a(this,"EnvironmentWorker")}constructor(e){axt.add(this),C8e.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.tools=e.tools,this.workdir=e.workdir??process.cwd(),this.unrestrictedPaths=e.unrestrictedPaths,this.maxIdleMs=e.maxIdleMs,this.workerId=e.workerId,this.requestOptions=e.requestOptions,qt(this,C8e,e.signal,"f")}async run(e){let{environmentId:r,environmentKey:n}=this;if(r===void 0||n===void 0)throw new mr("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let o=e??Ie(this,C8e,"f"),s=new SW({client:this.client,environmentId:r,environmentKey:n,...this.workerId!==void 0?{workerId:this.workerId}:{},...o?{signal:o}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let c of s)await Ie(this,axt,"m",z6r).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??wa("ANTHROPIC_WORK_ID"),n=e?.environmentId??wa("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??wa("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??wa("ANTHROPIC_ENVIRONMENT_KEY");if(!r)throw new mr("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!n)throw new mr("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!o)throw new mr("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s)throw new mr("handleItem: environmentKey is required \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let c={id:r,environment_id:n,data:{type:"session",id:o}};await Ie(this,axt,"m",z6r).call(this,c,s,e?.signal??Ie(this,C8e,"f"))}};C8e=new WeakMap,axt=new WeakSet,z6r=a(async function(e,r,n){let o=xl(this.client),s=VIt(this.client,{authToken:r,helper:"environments-worker"}),c=e.data.id,l={workdir:this.workdir,client:this.client,sessionId:c,...this.unrestrictedPaths!==void 0?{unrestrictedPaths:this.unrestrictedPaths}:{}},u=await Promise.resolve().then(()=>(xJi(),IJi)),d=a(async()=>{},"cleanupSkills");try{d=await u.setupSkills(l)}catch(A){o.warn("skill setup failed",{session_id:c,work_id:e.id,error:String(A)})}let f=typeof this.tools=="function"?this.tools(l):this.tools??u.betaAgentToolset20260401(l),h=new AbortController,m=loe(n,h),g=L8c(s,e,h,o,this.requestOptions).catch(A=>{h.signal.aborted||o.error("heartbeat loop failed",{work_id:e.id,error:String(A)}),h.abort()});try{let A=new IW(c,{client:s,tools:f,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:h.signal});for await(let y of A);}finally{h.abort(),m(),await g,await d().catch(A=>{o.warn("skill cleanup failed",{session_id:c,work_id:e.id,error:String(A)})}),await O8c(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(O8c,"forceStop");a(L8c,"heartbeatLoop")});var xW,K6r=Se(()=>{p();Jl();Nd();Dc();zf();JIt();Y6r();JIt();Y6r();xW=class extends _i{static{a(this,"Work")}retrieve(e,r,n){let{environment_id:o,betas:s}=r;return this._client.get(cr`/v1/environments/${o}/work/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{environment_id:o,betas:s,...c}=r;return this._client.post(cr`/v1/environments/${o}/work/${e}?beta=true`,{body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/environments/${e}/work?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}ack(e,r,n){let{environment_id:o,betas:s}=r;return this._client.post(cr`/v1/environments/${o}/work/${e}/ack?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}heartbeat(e,r,n){let{environment_id:o,desired_ttl_seconds:s,expected_last_heartbeat:c,betas:l}=r;return this._client.post(cr`/v1/environments/${o}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:c},...n,headers:Et([{"anthropic-beta":[...l??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poll(e,r={},n){let{betas:o,"Anthropic-Worker-ID":s,...c}=r??{};return this._client.get(cr`/v1/environments/${e}/work/poll?beta=true`,{query:c,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"Anthropic-Worker-ID":s}:void 0},n?.headers])})}stats(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/environments/${e}/work/stats?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stop(e,r,n){let{environment_id:o,betas:s,...c}=r;return this._client.post(cr`/v1/environments/${o}/work/${e}/stop?beta=true`,{body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poller(e){return new SW({...e,client:this._client})}worker(e){return new Rve({...e,client:this._client})}};xW.WorkPoller=SW;xW.EnvironmentWorker=Rve});var hoe,J6r=Se(()=>{p();Jl();K6r();K6r();Nd();Dc();zf();hoe=class extends _i{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new xW(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/environments/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/environments/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/environments?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/environments/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/environments/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};hoe.Work=xW});var kve,Z6r=Se(()=>{p();Jl();Nd();Dc();zf();kve=class extends _i{static{a(this,"Memories")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(cr`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(cr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:o,view:s,betas:c,...l}=r;return this._client.post(cr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:Et([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/memory_stores/${e}/memories?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:o,expected_content_sha256:s,betas:c}=r;return this._client.delete(cr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:Et([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Pve,X6r=Se(()=>{p();Jl();Nd();Dc();zf();Pve=class extends _i{static{a(this,"MemoryVersions")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(cr`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/memory_stores/${e}/memory_versions?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:o,betas:s}=r;return this._client.post(cr`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var wW,eUr=Se(()=>{p();Jl();Z6r();Z6r();X6r();X6r();Nd();Dc();zf();wW=class extends _i{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new kve(this._client),this.memoryVersions=new Pve(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/memory_stores/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/memory_stores/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};wW.Memories=kve;wW.MemoryVersions=Pve});var Dve=Se(()=>{p();Wf()});var Nve,tUr=Se(()=>{p();Wf();lve();h6r();Nve=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new l9;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new mr("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new mr("Attempted to iterate over a response with no body");return new t(t8e(e.body),r)}}});var Mve,rUr=Se(()=>{p();Jl();Nd();Dc();tUr();Dve();zf();Mve=class extends _i{static{a(this,"Batches")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/messages/batches/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",Pk,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/messages/batches/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let o=await this.retrieve(e);if(!o.results_url)throw new mr(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);let{betas:s}=r??{};return this._client.get(o.results_url,{...n,headers:Et([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>Nve.fromResponse(l.response,l.controller))}}});var cxt,nUr=Se(()=>{p();cxt={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function RJi(t){return t?.output_format??t?.output_config?.format}function iUr(t,e,r){let n=RJi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null}:oUr(t,e,r)}function oUr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=H8c(e,s.text);n===null&&(n=c);let l=Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function H8c(t,e){let r=RJi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new mr(`Failed to parse structured output: ${n}`)}}var sUr=Se(()=>{p();Wf();a(RJi,"getOutputFormat");a(iUr,"maybeParseBetaMessage");a(oUr,"parseBetaMessage");a(H8c,"parseBetaOutputFormat")});var G8c,Ove,$8c,V8c,lxt,aUr=Se(()=>{p();G8c=a(t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),Ove(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),Ove(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),Ove(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),Ove(t);break;case"delimiter":return t=t.slice(0,t.length-1),Ove(t);break}return t},"strip"),$8c=a(t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},"unstrip"),V8c=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),lxt=a(t=>JSON.parse(V8c($8c(Ove(G8c(t))))),"partialParse")});var cUr=Se(()=>{p();g6r()});function NJi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var Mk,RW,Lve,b8e,uxt,S8e,T8e,dxt,I8e,d9,x8e,fxt,pxt,moe,hxt,mxt,w8e,lUr,kJi,gxt,uUr,dUr,fUr,PJi,DJi,Axt,MJi=Se(()=>{p();WS();aUr();Dve();ZEe();cUr();sUr();DJi="__json_buf";a(NJi,"tracksToolInput");Axt=class t{static{a(this,"BetaMessageStream")}constructor(e,r){Mk.add(this),this.messages=[],this.receivedMessages=[],RW.set(this,void 0),Lve.set(this,null),this.controller=new AbortController,b8e.set(this,void 0),uxt.set(this,()=>{}),S8e.set(this,()=>{}),T8e.set(this,void 0),dxt.set(this,()=>{}),I8e.set(this,()=>{}),d9.set(this,{}),x8e.set(this,!1),fxt.set(this,!1),pxt.set(this,!1),moe.set(this,!1),hxt.set(this,void 0),mxt.set(this,void 0),w8e.set(this,void 0),gxt.set(this,n=>{if(qt(this,fxt,!0,"f"),s9(n)&&(n=new qy),n instanceof qy)return qt(this,pxt,!0,"f"),this._emit("abort",n);if(n instanceof mr)return this._emit("error",n);if(n instanceof Error){let o=new mr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new mr(String(n)))}),qt(this,b8e,new Promise((n,o)=>{qt(this,uxt,n,"f"),qt(this,S8e,o,"f")}),"f"),qt(this,T8e,new Promise((n,o)=>{qt(this,dxt,n,"f"),qt(this,I8e,o,"f")}),"f"),Ie(this,b8e,"f").catch(()=>{}),Ie(this,T8e,"f").catch(()=>{}),qt(this,Lve,e,"f"),qt(this,w8e,r?.logger??console,"f")}get response(){return Ie(this,hxt,"f")}get request_id(){return Ie(this,mxt,"f")}async withResponse(){qt(this,moe,!0,"f");let e=await Ie(this,b8e,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return qt(s,Lve,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},Ie(this,gxt,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{Ie(this,Mk,"m",uUr).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)Ie(this,Mk,"m",dUr).call(this,u);if(l.controller.signal?.aborted)throw new qy;Ie(this,Mk,"m",fUr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,hxt,e,"f"),qt(this,mxt,e?.headers.get("request-id"),"f"),Ie(this,uxt,"f").call(this,e),this._emit("connect"))}get ended(){return Ie(this,x8e,"f")}get errored(){return Ie(this,fxt,"f")}get aborted(){return Ie(this,pxt,"f")}abort(){this.controller.abort()}on(e,r){return(Ie(this,d9,"f")[e]||(Ie(this,d9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=Ie(this,d9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(Ie(this,d9,"f")[e]||(Ie(this,d9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,moe,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,moe,!0,"f"),await Ie(this,T8e,"f")}get currentMessage(){return Ie(this,RW,"f")}async finalMessage(){return await this.done(),Ie(this,Mk,"m",lUr).call(this)}async finalText(){return await this.done(),Ie(this,Mk,"m",kJi).call(this)}_emit(e,...r){if(Ie(this,x8e,"f"))return;e==="end"&&(qt(this,x8e,!0,"f"),Ie(this,dxt,"f").call(this));let n=Ie(this,d9,"f")[e];if(n&&(Ie(this,d9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!Ie(this,moe,"f")&&!n?.length&&Promise.reject(o),Ie(this,S8e,"f").call(this,o),Ie(this,I8e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!Ie(this,moe,"f")&&!n?.length&&Promise.reject(o),Ie(this,S8e,"f").call(this,o),Ie(this,I8e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",Ie(this,Mk,"m",lUr).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{Ie(this,Mk,"m",uUr).call(this),this._connected(null);let s=gB.fromReadableStream(e,this.controller);for await(let c of s)Ie(this,Mk,"m",dUr).call(this,c);if(s.controller.signal?.aborted)throw new qy;Ie(this,Mk,"m",fUr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(RW=new WeakMap,Lve=new WeakMap,b8e=new WeakMap,uxt=new WeakMap,S8e=new WeakMap,T8e=new WeakMap,dxt=new WeakMap,I8e=new WeakMap,d9=new WeakMap,x8e=new WeakMap,fxt=new WeakMap,pxt=new WeakMap,moe=new WeakMap,hxt=new WeakMap,mxt=new WeakMap,w8e=new WeakMap,gxt=new WeakMap,Mk=new WeakSet,lUr=a(function(){if(this.receivedMessages.length===0)throw new mr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_BetaMessageStream_getFinalMessage"),kJi=a(function(){if(this.receivedMessages.length===0)throw new mr("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new mr("stream ended without producing a content block with type=text");return r.join(" ")},"_BetaMessageStream_getFinalText"),uUr=a(function(){this.ended||qt(this,RW,void 0,"f")},"_BetaMessageStream_beginRequest"),dUr=a(function(r){if(this.ended)return;let n=Ie(this,Mk,"m",PJi).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let o=n.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{NJi(o)&&o.input&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}case"compaction_delta":{o.type==="compaction"&&o.content&&this._emit("compaction",o.content);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage(iUr(n,Ie(this,Lve,"f"),{logger:Ie(this,w8e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,RW,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),fUr=a(function(){if(this.ended)throw new mr("stream has ended, this shouldn't happen");let r=Ie(this,RW,"f");if(!r)throw new mr("request ended without sending any chunks");return qt(this,RW,void 0,"f"),iUr(r,Ie(this,Lve,"f"),{logger:Ie(this,w8e,"f")})},"_BetaMessageStream_endRequest"),PJi=a(function(r){let n=Ie(this,RW,"f");if(r.type==="message_start"){if(n)throw new mr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new mr(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.container=r.delta.container,n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,n.context_management=r.context_management,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),r.usage.iterations!=null&&(n.usage.iterations=r.usage.iterations),n;case"content_block_start":return n.content.push(r.content_block),n;case"content_block_delta":{let o=n.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(n.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(n.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&NJi(o)){let s=o[DJi]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,DJi,{value:s,enumerable:!1,writable:!0}),s)try{c.input=lxt(s)}catch(l){let u=new mr(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${l}. JSON: ${s}`);Ie(this,gxt,"f").call(this,u)}n.content[r.index]=c}break}case"thinking_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,signature:r.delta.signature});break}case"compaction_delta":{o?.type==="compaction"&&(n.content[r.index]={...o,content:(o.content||"")+r.delta.content});break}default:r.delta}return n}case"content_block_stop":return n}},"_BetaMessageStream_accumulateMessage"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((s,c)=>r.push({resolve:s,reject:c})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new gB(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var OJi,LJi=Se(()=>{p();OJi=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: 1. Task Overview The user's core request and success criteria Any clarifications or constraints they specified @@ -1507,65 +1507,65 @@ User preferences or style requirements Domain-specific details that aren't obvious Any promises made to the user Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. -Wrap your summary in tags.`});async function V8c(t,e=t.messages.at(-1),r){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let n=e.content.filter(s=>s.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async s=>{let c=t.tools.find(l=>("name"in l?l.name:l.mcp_server_name)===s.name);if(!c||!("run"in c))return{type:"tool_result",tool_use_id:s.id,content:`Error: Tool '${s.name}' not found`,is_error:!0};try{let l=s.input;"parse"in c&&c.parse&&(l=c.parse(l));let u=await c.run(l,{toolUse:s,toolUseBlock:s,signal:r?.signal});return{type:"tool_result",tool_use_id:s.id,content:u}}catch(l){return{type:"tool_result",tool_use_id:s.id,content:l instanceof Co?l.content:`Error: ${l instanceof Error?l.message:String(l)}`,is_error:!0}}}))}}var R8e,Bve,moe,zg,JS,YI,f9,RW,k8e,OJi,fUr,Fve,pUr=Se(()=>{p();WS();loe();Wf();Dc();F6r();MJi();u8e();Fve=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){R8e.add(this),this.client=e,Bve.set(this,!1),moe.set(this,!1),zg.set(this,void 0),JS.set(this,void 0),YI.set(this,void 0),f9.set(this,void 0),RW.set(this,void 0),k8e.set(this,0),qt(this,zg,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...b6r(r.tools,r.messages)].join(", ");qt(this,JS,{...n,headers:Et([{"x-stainless-helper":s},n?.headers])},"f"),qt(this,RW,xve(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(Bve=new WeakMap,moe=new WeakMap,zg=new WeakMap,JS=new WeakMap,YI=new WeakMap,f9=new WeakMap,RW=new WeakMap,k8e=new WeakMap,R8e=new WeakSet,OJi=a(async function(){let r=Ie(this,zg,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(Ie(this,YI,"f")!==void 0)try{let d=await Ie(this,YI,"f");n=d.usage.input_tokens+(d.usage.cache_creation_input_tokens??0)+(d.usage.cache_read_input_tokens??0)+d.usage.output_tokens}catch{return!1}let o=r.contextTokenThreshold??1e5;if(nh.type!=="tool_use");f.length===0?l.pop():d.content=f}}let u=await this.client.beta.messages.create({model:s,messages:[...l,{role:"user",content:[{type:"text",text:c}]}],max_tokens:Ie(this,zg,"f").params.max_tokens},{signal:Ie(this,JS,"f").signal,headers:Et([Ie(this,JS,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new mr("Expected text response for compaction");return Ie(this,zg,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(Ie(this,Bve,"f"))throw new mr("Cannot iterate over a consumed stream");qt(this,Bve,!0,"f"),qt(this,moe,!0,"f"),qt(this,f9,void 0,"f");try{for(;;){let r;try{if(Ie(this,zg,"f").params.max_iterations&&Ie(this,k8e,"f")>=Ie(this,zg,"f").params.max_iterations)break;qt(this,moe,!1,"f"),qt(this,f9,void 0,"f"),qt(this,k8e,(e=Ie(this,k8e,"f"),e++,e),"f"),qt(this,YI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=Ie(this,zg,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},Ie(this,JS,"f")),qt(this,YI,r.finalMessage(),"f"),Ie(this,YI,"f").catch(()=>{}),yield r):(qt(this,YI,this.client.beta.messages.create({...s,stream:!1},Ie(this,JS,"f")),"f"),yield Ie(this,YI,"f")),!await Ie(this,R8e,"m",OJi).call(this)){if(!Ie(this,moe,"f")){let{role:u,content:d}=await Ie(this,YI,"f");Ie(this,zg,"f").params.messages.push({role:u,content:d})}let l=await Ie(this,R8e,"m",fUr).call(this,Ie(this,zg,"f").params.messages.at(-1));if(l)Ie(this,zg,"f").params.messages.push(l);else if(!Ie(this,moe,"f"))break}}finally{r&&r.abort()}}if(!Ie(this,YI,"f"))throw new mr("ToolRunner concluded without a message from the server");Ie(this,RW,"f").resolve(await Ie(this,YI,"f"))}catch(r){throw qt(this,Bve,!1,"f"),Ie(this,RW,"f").promise.catch(()=>{}),Ie(this,RW,"f").reject(r),qt(this,RW,xve(),"f"),r}}setMessagesParams(e){typeof e=="function"?Ie(this,zg,"f").params=e(Ie(this,zg,"f").params):Ie(this,zg,"f").params=e,qt(this,moe,!0,"f"),qt(this,f9,void 0,"f")}setRequestOptions(e){typeof e=="function"?qt(this,JS,e(Ie(this,JS,"f")),"f"):qt(this,JS,{...Ie(this,JS,"f"),...e},"f")}async generateToolResponse(e=Ie(this,JS,"f").signal){let r=await Ie(this,YI,"f")??this.params.messages.at(-1);return r?Ie(this,R8e,"m",fUr).call(this,r,e):null}done(){return Ie(this,RW,"f").promise}async runUntilDone(){if(!Ie(this,Bve,"f"))for await(let e of this);return this.done()}get params(){return Ie(this,zg,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};fUr=a(async function(e,r=Ie(this,JS,"f").signal){return Ie(this,f9,"f")!==void 0?Ie(this,f9,"f"):(qt(this,f9,V8c(Ie(this,zg,"f").params,e,{...Ie(this,JS,"f"),signal:r}),"f"),Ie(this,f9,"f"))},"_BetaToolRunner_generateToolResponse");a(V8c,"generateToolResponse")});function BJi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new mr("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...r}=t;return{...r,output_config:{...t.output_config,format:e}}}var LJi,W8c,p9,hUr=Se(()=>{p();Dve();tUr();Jl();rUr();Dc();u8e();oUr();DJi();pUr();loe();tUr();pUr();loe();LJi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},W8c=["claude-mythos-preview","claude-opus-4-6"],p9=class extends _i{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new Mve(this._client)}create(e,r){let n=BJi(e),{betas:o,...s}=n;s.model in LJi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${LJi[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),W8c.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=this._client._options.timeout;if(!s.stream&&c==null){let u=axt[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=QIt(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:Et([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:Et([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>iUr(n,e,{logger:this._client.logger??console}))}stream(e,r){return gxt.createMessage(this,e,r)}countTokens(e,r){let n=BJi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:Et([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new Fve(this._client,e,r)}};a(BJi,"transformOutputFormat");p9.Batches=Mve;p9.BetaToolRunner=Fve;p9.ToolError=Co});var goe,mUr=Se(()=>{p();Jl();Dd();Dc();zf();rxt();rxt();goe=class extends _i{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/sessions/${e}/events?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}toolRunner(e,r){return new TW(e,{...r,client:this._client})}};goe.SessionToolRunner=TW});var Uve,gUr=Se(()=>{p();Jl();Dd();Dc();zf();Uve=class extends _i{static{a(this,"Resources")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(cr`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.post(cr`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/sessions/${e}/resources?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{session_id:o,betas:s}=r;return this._client.delete(cr`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Qve,AUr=Se(()=>{p();Jl();Dd();Dc();zf();Qve=class extends _i{static{a(this,"Events")}list(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.getAPIList(cr`/v1/sessions/${o}/threads/${e}/events?beta=true`,Ra,{query:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(cr`/v1/sessions/${o}/threads/${e}/stream?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}}});var Aoe,yUr=Se(()=>{p();Jl();AUr();AUr();Dd();Dc();zf();Aoe=class extends _i{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new Qve(this._client)}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(cr`/v1/sessions/${o}/threads/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/sessions/${e}/threads?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{session_id:o,betas:s}=r;return this._client.post(cr`/v1/sessions/${o}/threads/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Aoe.Events=Qve});var h9,_Ur=Se(()=>{p();Jl();mUr();mUr();gUr();gUr();yUr();yUr();Dd();Dc();zf();h9=class extends _i{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new goe(this._client),this.resources=new Uve(this._client),this.threads=new Aoe(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/sessions/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/sessions/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/sessions/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};h9.Events=goe;h9.Resources=Uve;h9.Threads=Aoe});var qve,EUr=Se(()=>{p();Jl();Dd();Dc();hve();zf();qve=class extends _i{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(cr`/v1/skills/${e}/versions?beta=true`,pve({body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(cr`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/skills/${e}/versions?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,r,n){let{skill_id:o,betas:s}=r;return this._client.delete(cr`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}download(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(cr`/v1/skills/${o}/versions/${e}/content?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var yoe,vUr=Se(()=>{p();Jl();EUr();EUr();Dd();Dc();hve();zf();yoe=class extends _i{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new qve(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",pve({body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/skills/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/skills?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/skills/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};yoe.Versions=qve});var jve,CUr=Se(()=>{p();Jl();Dd();Dc();zf();jve=class extends _i{static{a(this,"Credentials")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{vault_id:o,betas:s}=r;return this._client.get(cr`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{vault_id:o,betas:s,...c}=r;return this._client.post(cr`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/vaults/${e}/credentials?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{vault_id:o,betas:s}=r;return this._client.delete(cr`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(cr`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}mcpOAuthValidate(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(cr`/v1/vaults/${o}/credentials/${e}/mcp_oauth_validate?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var _oe,bUr=Se(()=>{p();Jl();CUr();CUr();Dd();Dc();zf();_oe=class extends _i{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new jve(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/vaults/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/vaults/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/vaults/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};_oe.Credentials=jve});var gA,SUr=Se(()=>{p();Jl();S6r();S6r();T6r();T6r();I6r();I6r();R6r();R6r();P6r();P6r();K6r();K6r();X6r();X6r();hUr();hUr();_Ur();_Ur();vUr();vUr();bUr();bUr();gA=class extends _i{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new gve(this._client),this.messages=new p9(this._client),this.agents=new aoe(this._client),this.environments=new poe(this._client),this.sessions=new h9(this._client),this.vaults=new _oe(this._client),this.memoryStores=new xW(this._client),this.files=new mve(this._client),this.skills=new yoe(this._client),this.webhooks=new _ve(this._client),this.userProfiles=new Ave(this._client)}};gA.Models=gve;gA.Messages=p9;gA.Agents=aoe;gA.Environments=poe;gA.Sessions=h9;gA.Vaults=_oe;gA.MemoryStores=xW;gA.Files=mve;gA.Skills=yoe;gA.Webhooks=_ve;gA.UserProfiles=Ave});var Eoe,TUr=Se(()=>{p();Jl();Dc();Eoe=class extends _i{static{a(this,"Completions")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...r,headers:Et([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}}});function FJi(t){return t?.output_config?.format}function IUr(t,e,r){let n=FJi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>o.type==="text"?Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1}):o),parsed_output:null}:xUr(t,e,r)}function xUr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=i6c(e,s.text);return n===null&&(n=c),Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function i6c(t,e){let r=FJi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new mr(`Failed to parse structured output: ${n}`)}}var wUr=Se(()=>{p();Wf();a(FJi,"getOutputFormat");a(IUr,"maybeParseMessage");a(xUr,"parseMessage");a(i6c,"parseOutputFormat")});function jJi(t){return t.type==="tool_use"||t.type==="server_tool_use"}var Ok,kW,Hve,P8e,Axt,D8e,N8e,yxt,M8e,m9,O8e,_xt,Ext,voe,vxt,Cxt,L8e,RUr,UJi,kUr,PUr,DUr,NUr,QJi,qJi,bxt,HJi=Se(()=>{p();WS();ZEe();Dve();aUr();sUr();wUr();qJi="__json_buf";a(jJi,"tracksToolInput");bxt=class t{static{a(this,"MessageStream")}constructor(e,r){Ok.add(this),this.messages=[],this.receivedMessages=[],kW.set(this,void 0),Hve.set(this,null),this.controller=new AbortController,P8e.set(this,void 0),Axt.set(this,()=>{}),D8e.set(this,()=>{}),N8e.set(this,void 0),yxt.set(this,()=>{}),M8e.set(this,()=>{}),m9.set(this,{}),O8e.set(this,!1),_xt.set(this,!1),Ext.set(this,!1),voe.set(this,!1),vxt.set(this,void 0),Cxt.set(this,void 0),L8e.set(this,void 0),kUr.set(this,n=>{if(qt(this,_xt,!0,"f"),s9(n)&&(n=new qy),n instanceof qy)return qt(this,Ext,!0,"f"),this._emit("abort",n);if(n instanceof mr)return this._emit("error",n);if(n instanceof Error){let o=new mr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new mr(String(n)))}),qt(this,P8e,new Promise((n,o)=>{qt(this,Axt,n,"f"),qt(this,D8e,o,"f")}),"f"),qt(this,N8e,new Promise((n,o)=>{qt(this,yxt,n,"f"),qt(this,M8e,o,"f")}),"f"),Ie(this,P8e,"f").catch(()=>{}),Ie(this,N8e,"f").catch(()=>{}),qt(this,Hve,e,"f"),qt(this,L8e,r?.logger??console,"f")}get response(){return Ie(this,vxt,"f")}get request_id(){return Ie(this,Cxt,"f")}async withResponse(){qt(this,voe,!0,"f");let e=await Ie(this,P8e,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return qt(s,Hve,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},Ie(this,kUr,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{Ie(this,Ok,"m",PUr).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)Ie(this,Ok,"m",DUr).call(this,u);if(l.controller.signal?.aborted)throw new qy;Ie(this,Ok,"m",NUr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,vxt,e,"f"),qt(this,Cxt,e?.headers.get("request-id"),"f"),Ie(this,Axt,"f").call(this,e),this._emit("connect"))}get ended(){return Ie(this,O8e,"f")}get errored(){return Ie(this,_xt,"f")}get aborted(){return Ie(this,Ext,"f")}abort(){this.controller.abort()}on(e,r){return(Ie(this,m9,"f")[e]||(Ie(this,m9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=Ie(this,m9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(Ie(this,m9,"f")[e]||(Ie(this,m9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,voe,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,voe,!0,"f"),await Ie(this,N8e,"f")}get currentMessage(){return Ie(this,kW,"f")}async finalMessage(){return await this.done(),Ie(this,Ok,"m",RUr).call(this)}async finalText(){return await this.done(),Ie(this,Ok,"m",UJi).call(this)}_emit(e,...r){if(Ie(this,O8e,"f"))return;e==="end"&&(qt(this,O8e,!0,"f"),Ie(this,yxt,"f").call(this));let n=Ie(this,m9,"f")[e];if(n&&(Ie(this,m9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!Ie(this,voe,"f")&&!n?.length&&Promise.reject(o),Ie(this,D8e,"f").call(this,o),Ie(this,M8e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!Ie(this,voe,"f")&&!n?.length&&Promise.reject(o),Ie(this,D8e,"f").call(this,o),Ie(this,M8e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",Ie(this,Ok,"m",RUr).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{Ie(this,Ok,"m",PUr).call(this),this._connected(null);let s=gB.fromReadableStream(e,this.controller);for await(let c of s)Ie(this,Ok,"m",DUr).call(this,c);if(s.controller.signal?.aborted)throw new qy;Ie(this,Ok,"m",NUr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(kW=new WeakMap,Hve=new WeakMap,P8e=new WeakMap,Axt=new WeakMap,D8e=new WeakMap,N8e=new WeakMap,yxt=new WeakMap,M8e=new WeakMap,m9=new WeakMap,O8e=new WeakMap,_xt=new WeakMap,Ext=new WeakMap,voe=new WeakMap,vxt=new WeakMap,Cxt=new WeakMap,L8e=new WeakMap,kUr=new WeakMap,Ok=new WeakSet,RUr=a(function(){if(this.receivedMessages.length===0)throw new mr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_MessageStream_getFinalMessage"),UJi=a(function(){if(this.receivedMessages.length===0)throw new mr("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new mr("stream ended without producing a content block with type=text");return r.join(" ")},"_MessageStream_getFinalText"),PUr=a(function(){this.ended||qt(this,kW,void 0,"f")},"_MessageStream_beginRequest"),DUr=a(function(r){if(this.ended)return;let n=Ie(this,Ok,"m",QJi).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let o=n.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{jJi(o)&&o.input&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage(IUr(n,Ie(this,Hve,"f"),{logger:Ie(this,L8e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,kW,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),NUr=a(function(){if(this.ended)throw new mr("stream has ended, this shouldn't happen");let r=Ie(this,kW,"f");if(!r)throw new mr("request ended without sending any chunks");return qt(this,kW,void 0,"f"),IUr(r,Ie(this,Hve,"f"),{logger:Ie(this,L8e,"f")})},"_MessageStream_endRequest"),QJi=a(function(r){let n=Ie(this,kW,"f");if(r.type==="message_start"){if(n)throw new mr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new mr(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),n;case"content_block_start":return n.content.push({...r.content_block}),n;case"content_block_delta":{let o=n.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(n.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(n.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&jJi(o)){let s=o[qJi]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,qJi,{value:s,enumerable:!1,writable:!0}),s&&(c.input=cxt(s)),n.content[r.index]=c}break}case"thinking_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,signature:r.delta.signature});break}default:r.delta}return n}case"content_block_stop":return n}},"_MessageStream_accumulateMessage"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((s,c)=>r.push({resolve:s,reject:c})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new gB(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var Gve,MUr=Se(()=>{p();Jl();Dd();Dc();eUr();Dve();zf();Gve=class extends _i{static{a(this,"Batches")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(cr`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",Pk,{query:e,...r})}delete(e,r){return this._client.delete(cr`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(cr`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new mr(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:Et([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>Nve.fromResponse(s.response,s.controller))}}});var PW,GJi,s6c,OUr=Se(()=>{p();Jl();Dc();u8e();HJi();wUr();MUr();MUr();rUr();PW=class extends _i{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new Gve(this._client)}create(e,r){e.model in GJi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${GJi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),s6c.includes(e.model)&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let s=axt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=QIt(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:Et([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>xUr(n,e,{logger:this._client.logger??console}))}stream(e,r){return bxt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},GJi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},s6c=["claude-mythos-preview","claude-opus-4-6"];PW.Batches=Gve});var Coe,LUr=Se(()=>{p();Jl();Dd();Dc();zf();Coe=class extends _i{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/models/${e}`,{...n,headers:Et([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models",Pk,{query:o,...r,headers:Et([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var $Ji=Se(()=>{p();SKi();SUr();TUr();OUr();LUr()});var BUr,FUr,Sxt,VJi,WJi,zJi,Kf,yB,UUr=Se(()=>{p();WS();yIt();hB();cve();ZEe();vIt();lve();FYi();i6r();XFe();Wf();dve();rKi();_Ki();Dd();C6r();$Ji();OIt();TUr();LUr();SUr();OUr();vIt();Dc();n8e();c9();hB();WJi="\\n\\nHuman:",zJi="\\n\\nAssistant:",Kf=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=wa("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=wa("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(BUr.add(this),this._requestAuthFlags=new WeakMap,Sxt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:wa("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:wa("ANTHROPIC_AUTH_TOKEN")??null),s.profile!=null&&(s.credentials!=null||s.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let c={apiKey:r,authToken:n,webhookKey:o,...s,baseURL:e||"https://api.anthropic.com"};if(!c.dangerouslyAllowBrowser&&MYi())throw new mr(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`});async function z8c(t,e=t.messages.at(-1),r){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let n=e.content.filter(s=>s.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async s=>{let c=t.tools.find(l=>("name"in l?l.name:l.mcp_server_name)===s.name);if(!c||!("run"in c))return{type:"tool_result",tool_use_id:s.id,content:`Error: Tool '${s.name}' not found`,is_error:!0};try{let l=s.input;"parse"in c&&c.parse&&(l=c.parse(l));let u=await c.run(l,{toolUse:s,toolUseBlock:s,signal:r?.signal});return{type:"tool_result",tool_use_id:s.id,content:u}}catch(l){return{type:"tool_result",tool_use_id:s.id,content:l instanceof Co?l.content:`Error: ${l instanceof Error?l.message:String(l)}`,is_error:!0}}}))}}var R8e,Bve,goe,Yg,JS,YI,f9,kW,k8e,BJi,pUr,Fve,hUr=Se(()=>{p();WS();uoe();Wf();Dc();U6r();LJi();u8e();Fve=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){R8e.add(this),this.client=e,Bve.set(this,!1),goe.set(this,!1),Yg.set(this,void 0),JS.set(this,void 0),YI.set(this,void 0),f9.set(this,void 0),kW.set(this,void 0),k8e.set(this,0),qt(this,Yg,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...S6r(r.tools,r.messages)].join(", ");qt(this,JS,{...n,headers:Et([{"x-stainless-helper":s},n?.headers])},"f"),qt(this,kW,xve(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(Bve=new WeakMap,goe=new WeakMap,Yg=new WeakMap,JS=new WeakMap,YI=new WeakMap,f9=new WeakMap,kW=new WeakMap,k8e=new WeakMap,R8e=new WeakSet,BJi=a(async function(){let r=Ie(this,Yg,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(Ie(this,YI,"f")!==void 0)try{let d=await Ie(this,YI,"f");n=d.usage.input_tokens+(d.usage.cache_creation_input_tokens??0)+(d.usage.cache_read_input_tokens??0)+d.usage.output_tokens}catch{return!1}let o=r.contextTokenThreshold??1e5;if(nh.type!=="tool_use");f.length===0?l.pop():d.content=f}}let u=await this.client.beta.messages.create({model:s,messages:[...l,{role:"user",content:[{type:"text",text:c}]}],max_tokens:Ie(this,Yg,"f").params.max_tokens},{signal:Ie(this,JS,"f").signal,headers:Et([Ie(this,JS,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new mr("Expected text response for compaction");return Ie(this,Yg,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(Ie(this,Bve,"f"))throw new mr("Cannot iterate over a consumed stream");qt(this,Bve,!0,"f"),qt(this,goe,!0,"f"),qt(this,f9,void 0,"f");try{for(;;){let r;try{if(Ie(this,Yg,"f").params.max_iterations&&Ie(this,k8e,"f")>=Ie(this,Yg,"f").params.max_iterations)break;qt(this,goe,!1,"f"),qt(this,f9,void 0,"f"),qt(this,k8e,(e=Ie(this,k8e,"f"),e++,e),"f"),qt(this,YI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=Ie(this,Yg,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},Ie(this,JS,"f")),qt(this,YI,r.finalMessage(),"f"),Ie(this,YI,"f").catch(()=>{}),yield r):(qt(this,YI,this.client.beta.messages.create({...s,stream:!1},Ie(this,JS,"f")),"f"),yield Ie(this,YI,"f")),!await Ie(this,R8e,"m",BJi).call(this)){if(!Ie(this,goe,"f")){let{role:u,content:d}=await Ie(this,YI,"f");Ie(this,Yg,"f").params.messages.push({role:u,content:d})}let l=await Ie(this,R8e,"m",pUr).call(this,Ie(this,Yg,"f").params.messages.at(-1));if(l)Ie(this,Yg,"f").params.messages.push(l);else if(!Ie(this,goe,"f"))break}}finally{r&&r.abort()}}if(!Ie(this,YI,"f"))throw new mr("ToolRunner concluded without a message from the server");Ie(this,kW,"f").resolve(await Ie(this,YI,"f"))}catch(r){throw qt(this,Bve,!1,"f"),Ie(this,kW,"f").promise.catch(()=>{}),Ie(this,kW,"f").reject(r),qt(this,kW,xve(),"f"),r}}setMessagesParams(e){typeof e=="function"?Ie(this,Yg,"f").params=e(Ie(this,Yg,"f").params):Ie(this,Yg,"f").params=e,qt(this,goe,!0,"f"),qt(this,f9,void 0,"f")}setRequestOptions(e){typeof e=="function"?qt(this,JS,e(Ie(this,JS,"f")),"f"):qt(this,JS,{...Ie(this,JS,"f"),...e},"f")}async generateToolResponse(e=Ie(this,JS,"f").signal){let r=await Ie(this,YI,"f")??this.params.messages.at(-1);return r?Ie(this,R8e,"m",pUr).call(this,r,e):null}done(){return Ie(this,kW,"f").promise}async runUntilDone(){if(!Ie(this,Bve,"f"))for await(let e of this);return this.done()}get params(){return Ie(this,Yg,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};pUr=a(async function(e,r=Ie(this,JS,"f").signal){return Ie(this,f9,"f")!==void 0?Ie(this,f9,"f"):(qt(this,f9,z8c(Ie(this,Yg,"f").params,e,{...Ie(this,JS,"f"),signal:r}),"f"),Ie(this,f9,"f"))},"_BetaToolRunner_generateToolResponse");a(z8c,"generateToolResponse")});function UJi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new mr("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...r}=t;return{...r,output_config:{...t.output_config,format:e}}}var FJi,Y8c,p9,mUr=Se(()=>{p();Dve();rUr();Jl();nUr();Dc();u8e();sUr();MJi();hUr();uoe();rUr();hUr();uoe();FJi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},Y8c=["claude-mythos-preview","claude-opus-4-6"],p9=class extends _i{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new Mve(this._client)}create(e,r){let n=UJi(e),{betas:o,...s}=n;s.model in FJi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${FJi[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),Y8c.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=this._client._options.timeout;if(!s.stream&&c==null){let u=cxt[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=qIt(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:Et([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:Et([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>oUr(n,e,{logger:this._client.logger??console}))}stream(e,r){return Axt.createMessage(this,e,r)}countTokens(e,r){let n=UJi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:Et([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new Fve(this._client,e,r)}};a(UJi,"transformOutputFormat");p9.Batches=Mve;p9.BetaToolRunner=Fve;p9.ToolError=Co});var Aoe,gUr=Se(()=>{p();Jl();Nd();Dc();zf();nxt();nxt();Aoe=class extends _i{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/sessions/${e}/events?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}toolRunner(e,r){return new IW(e,{...r,client:this._client})}};Aoe.SessionToolRunner=IW});var Uve,AUr=Se(()=>{p();Jl();Nd();Dc();zf();Uve=class extends _i{static{a(this,"Resources")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(cr`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.post(cr`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/sessions/${e}/resources?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{session_id:o,betas:s}=r;return this._client.delete(cr`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Qve,yUr=Se(()=>{p();Jl();Nd();Dc();zf();Qve=class extends _i{static{a(this,"Events")}list(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.getAPIList(cr`/v1/sessions/${o}/threads/${e}/events?beta=true`,Ra,{query:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(cr`/v1/sessions/${o}/threads/${e}/stream?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}}});var yoe,_Ur=Se(()=>{p();Jl();yUr();yUr();Nd();Dc();zf();yoe=class extends _i{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new Qve(this._client)}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(cr`/v1/sessions/${o}/threads/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/sessions/${e}/threads?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{session_id:o,betas:s}=r;return this._client.post(cr`/v1/sessions/${o}/threads/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};yoe.Events=Qve});var h9,EUr=Se(()=>{p();Jl();gUr();gUr();AUr();AUr();_Ur();_Ur();Nd();Dc();zf();h9=class extends _i{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new Aoe(this._client),this.resources=new Uve(this._client),this.threads=new yoe(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/sessions/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/sessions/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/sessions/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};h9.Events=Aoe;h9.Resources=Uve;h9.Threads=yoe});var qve,vUr=Se(()=>{p();Jl();Nd();Dc();hve();zf();qve=class extends _i{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(cr`/v1/skills/${e}/versions?beta=true`,pve({body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(cr`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/skills/${e}/versions?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,r,n){let{skill_id:o,betas:s}=r;return this._client.delete(cr`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}download(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(cr`/v1/skills/${o}/versions/${e}/content?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var _oe,CUr=Se(()=>{p();Jl();vUr();vUr();Nd();Dc();hve();zf();_oe=class extends _i{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new qve(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",pve({body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/skills/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/skills?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/skills/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};_oe.Versions=qve});var jve,bUr=Se(()=>{p();Jl();Nd();Dc();zf();jve=class extends _i{static{a(this,"Credentials")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{vault_id:o,betas:s}=r;return this._client.get(cr`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{vault_id:o,betas:s,...c}=r;return this._client.post(cr`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(cr`/v1/vaults/${e}/credentials?beta=true`,Ra,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{vault_id:o,betas:s}=r;return this._client.delete(cr`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(cr`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}mcpOAuthValidate(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(cr`/v1/vaults/${o}/credentials/${e}/mcp_oauth_validate?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Eoe,SUr=Se(()=>{p();Jl();bUr();bUr();Nd();Dc();zf();Eoe=class extends _i{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new jve(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/vaults/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(cr`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",Ra,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(cr`/v1/vaults/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(cr`/v1/vaults/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Eoe.Credentials=jve});var gA,TUr=Se(()=>{p();Jl();T6r();T6r();I6r();I6r();x6r();x6r();k6r();k6r();D6r();D6r();J6r();J6r();eUr();eUr();mUr();mUr();EUr();EUr();CUr();CUr();SUr();SUr();gA=class extends _i{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new gve(this._client),this.messages=new p9(this._client),this.agents=new coe(this._client),this.environments=new hoe(this._client),this.sessions=new h9(this._client),this.vaults=new Eoe(this._client),this.memoryStores=new wW(this._client),this.files=new mve(this._client),this.skills=new _oe(this._client),this.webhooks=new _ve(this._client),this.userProfiles=new Ave(this._client)}};gA.Models=gve;gA.Messages=p9;gA.Agents=coe;gA.Environments=hoe;gA.Sessions=h9;gA.Vaults=Eoe;gA.MemoryStores=wW;gA.Files=mve;gA.Skills=_oe;gA.Webhooks=_ve;gA.UserProfiles=Ave});var voe,IUr=Se(()=>{p();Jl();Dc();voe=class extends _i{static{a(this,"Completions")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...r,headers:Et([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}}});function QJi(t){return t?.output_config?.format}function xUr(t,e,r){let n=QJi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>o.type==="text"?Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1}):o),parsed_output:null}:wUr(t,e,r)}function wUr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=s6c(e,s.text);return n===null&&(n=c),Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function s6c(t,e){let r=QJi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new mr(`Failed to parse structured output: ${n}`)}}var RUr=Se(()=>{p();Wf();a(QJi,"getOutputFormat");a(xUr,"maybeParseMessage");a(wUr,"parseMessage");a(s6c,"parseOutputFormat")});function GJi(t){return t.type==="tool_use"||t.type==="server_tool_use"}var Ok,PW,Hve,P8e,yxt,D8e,N8e,_xt,M8e,m9,O8e,Ext,vxt,Coe,Cxt,bxt,L8e,kUr,qJi,PUr,DUr,NUr,MUr,jJi,HJi,Sxt,$Ji=Se(()=>{p();WS();ZEe();Dve();cUr();aUr();RUr();HJi="__json_buf";a(GJi,"tracksToolInput");Sxt=class t{static{a(this,"MessageStream")}constructor(e,r){Ok.add(this),this.messages=[],this.receivedMessages=[],PW.set(this,void 0),Hve.set(this,null),this.controller=new AbortController,P8e.set(this,void 0),yxt.set(this,()=>{}),D8e.set(this,()=>{}),N8e.set(this,void 0),_xt.set(this,()=>{}),M8e.set(this,()=>{}),m9.set(this,{}),O8e.set(this,!1),Ext.set(this,!1),vxt.set(this,!1),Coe.set(this,!1),Cxt.set(this,void 0),bxt.set(this,void 0),L8e.set(this,void 0),PUr.set(this,n=>{if(qt(this,Ext,!0,"f"),s9(n)&&(n=new qy),n instanceof qy)return qt(this,vxt,!0,"f"),this._emit("abort",n);if(n instanceof mr)return this._emit("error",n);if(n instanceof Error){let o=new mr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new mr(String(n)))}),qt(this,P8e,new Promise((n,o)=>{qt(this,yxt,n,"f"),qt(this,D8e,o,"f")}),"f"),qt(this,N8e,new Promise((n,o)=>{qt(this,_xt,n,"f"),qt(this,M8e,o,"f")}),"f"),Ie(this,P8e,"f").catch(()=>{}),Ie(this,N8e,"f").catch(()=>{}),qt(this,Hve,e,"f"),qt(this,L8e,r?.logger??console,"f")}get response(){return Ie(this,Cxt,"f")}get request_id(){return Ie(this,bxt,"f")}async withResponse(){qt(this,Coe,!0,"f");let e=await Ie(this,P8e,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return qt(s,Hve,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},Ie(this,PUr,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{Ie(this,Ok,"m",DUr).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)Ie(this,Ok,"m",NUr).call(this,u);if(l.controller.signal?.aborted)throw new qy;Ie(this,Ok,"m",MUr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,Cxt,e,"f"),qt(this,bxt,e?.headers.get("request-id"),"f"),Ie(this,yxt,"f").call(this,e),this._emit("connect"))}get ended(){return Ie(this,O8e,"f")}get errored(){return Ie(this,Ext,"f")}get aborted(){return Ie(this,vxt,"f")}abort(){this.controller.abort()}on(e,r){return(Ie(this,m9,"f")[e]||(Ie(this,m9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=Ie(this,m9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(Ie(this,m9,"f")[e]||(Ie(this,m9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,Coe,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,Coe,!0,"f"),await Ie(this,N8e,"f")}get currentMessage(){return Ie(this,PW,"f")}async finalMessage(){return await this.done(),Ie(this,Ok,"m",kUr).call(this)}async finalText(){return await this.done(),Ie(this,Ok,"m",qJi).call(this)}_emit(e,...r){if(Ie(this,O8e,"f"))return;e==="end"&&(qt(this,O8e,!0,"f"),Ie(this,_xt,"f").call(this));let n=Ie(this,m9,"f")[e];if(n&&(Ie(this,m9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!Ie(this,Coe,"f")&&!n?.length&&Promise.reject(o),Ie(this,D8e,"f").call(this,o),Ie(this,M8e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!Ie(this,Coe,"f")&&!n?.length&&Promise.reject(o),Ie(this,D8e,"f").call(this,o),Ie(this,M8e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",Ie(this,Ok,"m",kUr).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{Ie(this,Ok,"m",DUr).call(this),this._connected(null);let s=gB.fromReadableStream(e,this.controller);for await(let c of s)Ie(this,Ok,"m",NUr).call(this,c);if(s.controller.signal?.aborted)throw new qy;Ie(this,Ok,"m",MUr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(PW=new WeakMap,Hve=new WeakMap,P8e=new WeakMap,yxt=new WeakMap,D8e=new WeakMap,N8e=new WeakMap,_xt=new WeakMap,M8e=new WeakMap,m9=new WeakMap,O8e=new WeakMap,Ext=new WeakMap,vxt=new WeakMap,Coe=new WeakMap,Cxt=new WeakMap,bxt=new WeakMap,L8e=new WeakMap,PUr=new WeakMap,Ok=new WeakSet,kUr=a(function(){if(this.receivedMessages.length===0)throw new mr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_MessageStream_getFinalMessage"),qJi=a(function(){if(this.receivedMessages.length===0)throw new mr("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new mr("stream ended without producing a content block with type=text");return r.join(" ")},"_MessageStream_getFinalText"),DUr=a(function(){this.ended||qt(this,PW,void 0,"f")},"_MessageStream_beginRequest"),NUr=a(function(r){if(this.ended)return;let n=Ie(this,Ok,"m",jJi).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let o=n.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{GJi(o)&&o.input&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage(xUr(n,Ie(this,Hve,"f"),{logger:Ie(this,L8e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,PW,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),MUr=a(function(){if(this.ended)throw new mr("stream has ended, this shouldn't happen");let r=Ie(this,PW,"f");if(!r)throw new mr("request ended without sending any chunks");return qt(this,PW,void 0,"f"),xUr(r,Ie(this,Hve,"f"),{logger:Ie(this,L8e,"f")})},"_MessageStream_endRequest"),jJi=a(function(r){let n=Ie(this,PW,"f");if(r.type==="message_start"){if(n)throw new mr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new mr(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),n;case"content_block_start":return n.content.push({...r.content_block}),n;case"content_block_delta":{let o=n.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(n.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(n.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&GJi(o)){let s=o[HJi]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,HJi,{value:s,enumerable:!1,writable:!0}),s&&(c.input=lxt(s)),n.content[r.index]=c}break}case"thinking_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,signature:r.delta.signature});break}default:r.delta}return n}case"content_block_stop":return n}},"_MessageStream_accumulateMessage"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((s,c)=>r.push({resolve:s,reject:c})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new gB(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var Gve,OUr=Se(()=>{p();Jl();Nd();Dc();tUr();Dve();zf();Gve=class extends _i{static{a(this,"Batches")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(cr`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",Pk,{query:e,...r})}delete(e,r){return this._client.delete(cr`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(cr`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new mr(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:Et([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>Nve.fromResponse(s.response,s.controller))}}});var DW,VJi,c6c,LUr=Se(()=>{p();Jl();Dc();u8e();$Ji();RUr();OUr();OUr();nUr();DW=class extends _i{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new Gve(this._client)}create(e,r){e.model in VJi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${VJi[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),c6c.includes(e.model)&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let s=cxt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=qIt(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:Et([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>wUr(n,e,{logger:this._client.logger??console}))}stream(e,r){return Sxt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},VJi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},c6c=["claude-mythos-preview","claude-opus-4-6"];DW.Batches=Gve});var boe,BUr=Se(()=>{p();Jl();Nd();Dc();zf();boe=class extends _i{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(cr`/v1/models/${e}`,{...n,headers:Et([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models",Pk,{query:o,...r,headers:Et([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var WJi=Se(()=>{p();IKi();TUr();IUr();LUr();BUr()});var FUr,UUr,Txt,zJi,YJi,KJi,Kf,yB,QUr=Se(()=>{p();WS();_It();hB();cve();ZEe();CIt();lve();QYi();o6r();XFe();Wf();dve();iKi();vKi();Nd();b6r();WJi();LIt();IUr();BUr();TUr();LUr();CIt();Dc();n8e();c9();hB();YJi="\\n\\nHuman:",KJi="\\n\\nAssistant:",Kf=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=wa("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=wa("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(FUr.add(this),this._requestAuthFlags=new WeakMap,Txt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:wa("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:wa("ANTHROPIC_AUTH_TOKEN")??null),s.profile!=null&&(s.credentials!=null||s.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let c={apiKey:r,authToken:n,webhookKey:o,...s,baseURL:e||"https://api.anthropic.com"};if(!c.dangerouslyAllowBrowser&&LYi())throw new mr(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); -`);this.baseURL=c.baseURL,this._baseURLIsExplicit=s.__baseURLIsExplicit??!!e,this.timeout=c.timeout??FUr.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=a6r(c.logLevel,"ClientOptions.logLevel",this)??a6r(wa("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??OYi(),qt(this,Sxt,BYi,"f");let u=wa("ANTHROPIC_CUSTOM_HEADERS");if(u){let f={};for(let h of u.split(` -`)){let m=h.indexOf(":");m>=0&&(f[h.substring(0,m).trim()]=h.substring(m+1).trim())}c.defaultHeaders={...f,...c.defaultHeaders}}let d=s.__auth;if(delete c.__auth,delete c.__baseURLIsExplicit,this._options=c,this.apiKey=typeof r=="string"?r:null,this.authToken=n,this.webhookKey=o,d)this._authState=d,!this._baseURLIsExplicit&&d.baseURL&&(this.baseURL=d.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let f=c.credentials??null;if(f)this._authState.provider=f,this._authState.tokenCache=this._makeTokenCache(f);else if(c.config!=null){let h=f6r(c.config,this._credentialResolverOptions());this._authState.provider=h.provider,this._authState.tokenCache=this._makeTokenCache(h.provider),this._authState.extraHeaders=h.extraHeaders,this._applyCredentialBaseURL(h.baseURL)}else c.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(c.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,this._baseURLIsExplicit||(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{xl(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{xl(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new RIt(e,r=>{xl(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await yKi(this._credentialResolverOptions(),e);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(e!=null)throw new mr(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!r.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let r=this._requestAuthFlags.get(e);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,r)),r}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,Et([{Authorization:`Bearer ${r}`}])}return Et([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return Et([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return Et([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return YYi(e)}getUserAgent(){return`${this.constructor.name}/JS ${kk}`}defaultIdempotencyKey(){return`stainless-node-retry-${JEe()}`}makeStatusError(e,r,n,o){return Fh.generate(e,r,n,o)}buildURL(e,r,n){let o=!Ie(this,BUr,"m",VJi).call(this)&&n||this.baseURL,s=wYi(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!Y8r(c)||!Y8r(l))&&(r={...l,...c,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new mr("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(e){}async prepareRequest(e,{url:r,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let o=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[c,l]of Object.entries(this._authState.extraHeaders))o.has(c)||o.set(c,l);o.get("anthropic-beta")?.split(",").map(c=>c.trim())?.includes(ioe)||o.append("anthropic-beta",ioe),e.headers=o}}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new ooe(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(xl(this).debug(`[${d}] sending request`,a9({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new qy;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(ZFe),A=Date.now();if(g instanceof globalThis.Error){let E=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new qy;let v=s9(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return xl(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${E}`),xl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${E})`,a9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw xl(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),xl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,a9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new XEe:new _W({cause:g})}let y=[...g.headers.entries()].filter(([E])=>E==="request-id").map(([E,v])=>", "+E+": "+JSON.stringify(v)).join(""),_=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let E=await this.shouldRetry(g,o);if(r&&E){let x=`retrying, ${r} attempts remaining`;return await LYi(g.body),xl(this).info(`${_} - ${x}`),xl(this).debug(`[${d}] response error (${x})`,a9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=E?"error; no more retries left":"error; not retryable";xl(this).info(`${_} - ${v}`);let S=await g.text().catch(x=>ZFe(x).message),T=EIt(S),w=T?void 0:S;throw xl(this).debug(`[${d}] response error (${v})`,a9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return xl(this).info(_),xl(this).debug(`[${d}] response start`,a9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),{response:g,options:o,controller:m,requestLogID:d,retryOfRequestLogID:n,startTime:h}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(o=>({method:"get",path:e,...o})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new a8e(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:s,method:c,...l}=r||{},u=this._makeAbort(o);s&&s.addEventListener("abort",u,{once:!0});let d=setTimeout(u,n),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,h={signal:o.signal,...f?{duplex:"half"}:{},method:"GET",...l};c&&(h.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(d)}}async shouldRetry(e,r){let n=this._authFlags(r);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=e.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let s,c=o?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(s=u)}let l=o?.get("retry-after");if(l&&!s){let u=parseFloat(l);Number.isNaN(u)?s=Date.parse(l)-Date.now():s=u*1e3}if(s===void 0){let u=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,u)}return await nM(s),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let s=r-e,c=Math.min(.5*Math.pow(2,s),8),l=1-Math.random()*.25;return c*l*1e3}calculateNonstreamingTimeout(e,r){if(36e5*e/128e3>6e5||r!=null&&e>r)throw new mr("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:s,query:c,defaultBaseURL:l}=n;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let u=this.buildURL(s,c,l);"timeout"in n&&kYi("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:d,body:f}=this.buildBody({options:n}),h=await this.buildHeaders({options:e,method:o,bodyHeaders:d,retryCount:r});return{req:{method:o,headers:h,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"},...f&&{body:f},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let s={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let c=Et([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...e8e(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(c),c.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=Et([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:CIt(e)}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:Ie(this,Sxt,"f").call(this,{body:e,headers:n})}};FUr=Kf,Sxt=new WeakMap,BUr=new WeakSet,VJi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");Kf.Anthropic=FUr;Kf.HUMAN_PROMPT=WJi;Kf.AI_PROMPT=zJi;Kf.DEFAULT_TIMEOUT=6e5;Kf.AnthropicError=mr;Kf.APIError=Fh;Kf.APIConnectionError=_W;Kf.APIConnectionTimeoutError=XEe;Kf.APIUserAbortError=qy;Kf.NotFoundError=nve;Kf.ConflictError=ive;Kf.RateLimitError=sve;Kf.BadRequestError=eve;Kf.AuthenticationError=tve;Kf.InternalServerError=ave;Kf.PermissionDeniedError=rve;Kf.UnprocessableEntityError=ove;Kf.toFile=FIt;yB=class extends Kf{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new Eoe(this),this.messages=new PW(this),this.models=new Coe(this),this.beta=new gA(this)}};yB.Completions=Eoe;yB.Messages=PW;yB.Models=Coe;yB.Beta=gA});var B6r=Se(()=>{p();UUr();C6r();OIt();UUr();Dd();Wf()});var T9r=I((KYh,sto)=>{p();var e6e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Zqc=typeof AbortController=="function",mwt=Zqc?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new nto}abort(){this.signal.dispatchEvent("abort")}},Xqc=typeof AbortSignal=="function",ejc=typeof mwt.AbortSignal=="function",nto=Xqc?AbortSignal:ejc?mwt.AbortController:class{static{a(this,"AbortSignal")}constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(e){if(e==="abort"){this.aborted=!0;let r={type:e,target:this};this.onabort(r),this._listeners.forEach(n=>n(r),this)}}onabort(){}addEventListener(e,r){e==="abort"&&this._listeners.push(r)}removeEventListener(e,r){e==="abort"&&(this._listeners=this._listeners.filter(n=>n!==r))}},b9r=new Set,E9r=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;gwt(r)&&S9r(r,`${t} option`,`options.${e}`,cCe)},"deprecatedOption"),v9r=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(gwt(r)){let{prototype:n}=cCe,{get:o}=Object.getOwnPropertyDescriptor(n,t);S9r(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),tjc=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(gwt(r)){let{prototype:n}=cCe,{get:o}=Object.getOwnPropertyDescriptor(n,t);S9r(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),ito=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),gwt=a(t=>!b9r.has(t),"shouldWarn"),S9r=a((t,e,r,n)=>{b9r.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;ito(o,"DeprecationWarning",t,n)},"warn"),xoe=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),oto=a(t=>xoe(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?aCe:null:null,"getUintArray"),aCe=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},C9r=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=oto(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},cCe=class t{static{a(this,"LRUCache")}constructor(e={}){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,sizeCalculation:A,fetchMethod:y,fetchContext:_,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:v}=e,{length:S,maxAge:T,stale:w}=e instanceof t?{}:e;if(r!==0&&!xoe(r))throw new TypeError("max option must be a nonnegative integer");let R=r?oto(r):Array;if(!R)throw new Error("invalid max value: "+r);if(this.max=r,this.maxSize=g,this.sizeCalculation=A||S,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=y||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=_,!this.fetchMethod&&_!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(r).fill(null),this.valList=new Array(r).fill(null),this.next=new R(r),this.prev=new R(r),this.head=0,this.tail=0,this.free=new C9r(r),this.initialFill=1,this.size=0,typeof d=="function"&&(this.dispose=d),typeof f=="function"?(this.disposeAfter=f,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!E,this.maxSize!==0){if(!xoe(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!w,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=xoe(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!xoe(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let x="LRU_CACHE_UNBOUNDED";gwt(x)&&(b9r.add(x),ito("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&E9r("stale","allowStale"),T&&E9r("maxAge","ttl"),S&&E9r("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new aCe(this.max),this.starts=new aCe(this.max),this.setItemTTL=(n,o,s=e6e.now())=>{if(this.starts[n]=o!==0?s:0,this.ttls[n]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.isStale(n)&&this.delete(this.keyList[n])},o+1);c.unref&&c.unref()}},this.updateItemAge=n=>{this.starts[n]=this.ttls[n]!==0?e6e.now():0};let e=0,r=a(()=>{let n=e6e.now();if(this.ttlResolution>0){e=n;let o=setTimeout(()=>e=0,this.ttlResolution);o.unref&&o.unref()}return n},"getNow");this.getRemainingTTL=n=>{let o=this.keyMap.get(n);return o===void 0?0:this.ttls[o]===0||this.starts[o]===0?1/0:this.starts[o]+this.ttls[o]-(e||r())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(e||r())-this.starts[n]>this.ttls[n]}updateItemAge(e){}setItemTTL(e,r,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new aCe(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!xoe(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!xoe(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer)");return n},this.addItemSize=(e,r)=>{this.sizes[e]=r;let n=this.maxSize-this.sizes[e];for(;this.calculatedSize>n;)this.evict(!0);this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,r){}requireSize(e,r,n,o){if(n||o)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.tail;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.head));)r=this.prev[r]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.head;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.tail));)r=this.next[r]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())yield[this.keyList[e],this.valList[e]]}*rentries(){for(let e of this.rindexes())yield[this.keyList[e],this.valList[e]]}*keys(){for(let e of this.indexes())yield this.keyList[e]}*rkeys(){for(let e of this.rindexes())yield this.keyList[e]}*values(){for(let e of this.indexes())yield this.valList[e]}*rvalues(){for(let e of this.rindexes())yield this.valList[e]}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of this.indexes())if(e(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],r)}forEach(e,r=this){for(let n of this.indexes())e.call(r,this.valList[n],this.keyList[n],this)}rforEach(e,r=this){for(let n of this.rindexes())e.call(r,this.valList[n],this.keyList[n],this)}get prune(){return v9r("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let r of this.rindexes({allowStale:!0}))this.isStale(r)&&(this.delete(this.keyList[r]),e=!0);return e}dump(){let e=[];for(let r of this.indexes({allowStale:!0})){let n=this.keyList[r],o=this.valList[r],c={value:this.isBackgroundFetch(o)?o.__staleWhileFetching:o};if(this.ttls){c.ttl=this.ttls[r];let l=e6e.now()-this.starts[r];c.start=Math.floor(Date.now()-l)}this.sizes&&(c.size=this.sizes[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=e6e.now()-o}this.set(r,n.value,n)}}dispose(e,r,n){}set(e,r,{ttl:n=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL}={}){if(c=this.requireSize(e,r,c,l),this.maxSize&&c>this.maxSize)return this;let d=this.size===0?void 0:this.keyMap.get(e);if(d===void 0)d=this.newIndex(),this.keyList[d]=e,this.valList[d]=r,this.keyMap.set(e,d),this.next[this.tail]=d,this.prev[d]=this.tail,this.tail=d,this.size++,this.addItemSize(d,c),u=!1;else{let f=this.valList[d];r!==f&&(this.isBackgroundFetch(f)?f.__abortController.abort():s||(this.dispose(f,e,"set"),this.disposeAfter&&this.disposed.push([f,e,"set"])),this.removeItemSize(d),this.valList[d]=r,this.addItemSize(d,c)),this.moveToTail(d)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(d,n,o),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let r=this.head,n=this.keyList[r],o=this.valList[r];return this.isBackgroundFetch(o)?o.__abortController.abort():(this.dispose(o,n,"evict"),this.disposeAfter&&this.disposed.push([o,n,"evict"])),this.removeItemSize(r),e&&(this.keyList[r]=null,this.valList[r]=null,this.free.push(r)),this.head=this.next[r],this.keyMap.delete(n),this.size--,r}has(e,{updateAgeOnHas:r=this.updateAgeOnHas}={}){let n=this.keyMap.get(e);return n!==void 0&&!this.isStale(n)?(r&&this.updateItemAge(n),!0):!1}peek(e,{allowStale:r=this.allowStale}={}){let n=this.keyMap.get(e);if(n!==void 0&&(r||!this.isStale(n))){let o=this.valList[n];return this.isBackgroundFetch(o)?o.__staleWhileFetching:o}}backgroundFetch(e,r,n,o){let s=r===void 0?void 0:this.valList[r];if(this.isBackgroundFetch(s))return s;let c=new mwt,l={signal:c.signal,options:n,context:o},u=a(m=>(c.signal.aborted||this.set(e,m,l.options),m),"cb"),d=a(m=>{if(this.valList[r]===h&&(!n.noDeleteOnFetchRejection||h.__staleWhileFetching===void 0?this.delete(e):this.valList[r]=h.__staleWhileFetching),h.__returned===h)throw m},"eb"),f=a(m=>m(this.fetchMethod(e,s,l)),"pcall"),h=new Promise(f).then(u,d);return h.__abortController=c,h.__staleWhileFetching=s,h.__returned=null,r===void 0?(this.set(e,h,l.options),r=this.keyMap.get(e)):this.valList[r]=h,h}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,fetchContext:h=this.fetchContext,forceRefresh:m=!1}={}){if(!this.fetchMethod)return this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o});let g={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f},A=this.keyMap.get(e);if(A===void 0){let y=this.backgroundFetch(e,A,g,h);return y.__returned=y}else{let y=this.valList[A];if(this.isBackgroundFetch(y))return r&&y.__staleWhileFetching!==void 0?y.__staleWhileFetching:y.__returned=y;if(!m&&!this.isStale(A))return this.moveToTail(A),n&&this.updateItemAge(A),y;let _=this.backgroundFetch(e,A,g,h);return r&&_.__staleWhileFetching!==void 0?_.__staleWhileFetching:_.__returned=_}}get(e,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet}={}){let s=this.keyMap.get(e);if(s!==void 0){let c=this.valList[s],l=this.isBackgroundFetch(c);return this.isStale(s)?l?r?c.__staleWhileFetching:void 0:(o||this.delete(e),r?c:void 0):l?void 0:(this.moveToTail(s),n&&this.updateItemAge(s),c)}}connect(e,r){this.prev[r]=e,this.next[e]=r}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return v9r("del","delete"),this.delete}delete(e){let r=!1;if(this.size!==0){let n=this.keyMap.get(e);if(n!==void 0)if(r=!0,this.size===1)this.clear();else{this.removeItemSize(n);let o=this.valList[n];this.isBackgroundFetch(o)?o.__abortController.abort():(this.dispose(o,e,"delete"),this.disposeAfter&&this.disposed.push([o,e,"delete"])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return r}clear(){for(let e of this.rindexes({allowStale:!0})){let r=this.valList[e];if(this.isBackgroundFetch(r))r.__abortController.abort();else{let n=this.keyList[e];this.dispose(r,n,"delete"),this.disposeAfter&&this.disposed.push([r,n,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return v9r("reset","clear"),this.clear}get length(){return tjc("length","size"),this.size}static get AbortController(){return mwt}static get AbortSignal(){return nto}};sto.exports=cCe});var w9r=I((XYh,ato)=>{"use strict";p();var t6e=class extends Error{static{a(this,"FetchBaseError")}constructor(e,r,n){super(e),this.type=r,this._name=n}get name(){return this._name}get[Symbol.toStringTag](){return this._name}},I9r=class extends t6e{static{a(this,"FetchError")}constructor(e,r,n){super(e,r,"FetchError"),n&&(this.code=n.code,this.errno=n.errno,this.erroredSysCall=n.syscall)}},x9r=class extends t6e{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};ato.exports={FetchBaseError:t6e,FetchError:I9r,AbortError:x9r}});var y9=I((rKh,lto)=>{"use strict";p();var{constants:{MAX_LENGTH:rjc}}=require("buffer"),{pipeline:Awt,PassThrough:njc}=require("stream"),{promisify:ijc}=require("util"),{createGunzip:ojc,createInflate:sjc,createBrotliDecompress:ajc,constants:{Z_SYNC_FLUSH:cto}}=require("zlib"),cjc=YP()("helix-fetch:utils"),ljc=ijc(Awt),ujc=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),djc=a((t,e,r,n)=>{if(!ujc(t,e))return r;let o=a(s=>{s&&(cjc(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return Awt(r,ojc({flush:cto,finishFlush:cto}),o);case"deflate":case"x-deflate":return Awt(r,sjc(),o);case"br":return Awt(r,ajc(),o);default:return r}},"decodeStream"),fjc=a(t=>{if(!t||typeof t!="object"||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},"isPlainObject"),ywt=a((t,e)=>{if(Buffer.isBuffer(t))return t.length;switch(typeof t){case"string":return t.length*2;case"boolean":return 4;case"number":return 8;case"symbol":return Symbol.keyFor(t)?Symbol.keyFor(t).length*2:(t.toString().length-8)*2;case"object":return Array.isArray(t)?pjc(t,e):hjc(t,e);default:return 0}},"calcSize"),pjc=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:ywt(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),hjc=a((t,e)=>{if(t==null)return 0;e.add(t);let r=0,n=[];for(let o in t)n.push(o);return n.push(...Object.getOwnPropertySymbols(t)),n.forEach(o=>{if(r+=ywt(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=ywt(t[o],e)}),r},"calcObjectSize"),mjc=a(t=>ywt(t,new WeakSet),"sizeof"),gjc=a(async t=>{let e=new njc,r=0,n=[];return e.on("data",o=>{if(r+o.length>rjc)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await ljc(t,e),Buffer.concat(n,r)},"streamToBuffer");lto.exports={decodeStream:djc,isPlainObject:fjc,sizeof:mjc,streamToBuffer:gjc}});var Ewt=I((oKh,pto)=>{"use strict";p();var{PassThrough:uto,Readable:_9}=require("stream"),{types:{isAnyArrayBuffer:fto}}=require("util"),{FetchError:Ajc,FetchBaseError:yjc}=w9r(),{streamToBuffer:_jc}=y9(),Ejc=Buffer.alloc(0),Fk=Symbol("Body internals"),vjc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),dto=a(async t=>{if(t[Fk].disturbed)throw new TypeError("Already read");if(t[Fk].error)throw new TypeError(`Stream had error: ${t[Fk].error.message}`);t[Fk].disturbed=!0;let{stream:e}=t[Fk];return e===null?Ejc:_jc(e)},"consume"),_wt=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=_9.from(e.toString()):e instanceof _9?r=e:Buffer.isBuffer(e)?r=_9.from(e):fto(e)?r=_9.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=_9.from(e):r=_9.from(String(e)),this[Fk]={stream:r,disturbed:!1,error:null},e instanceof _9&&r.on("error",n=>{let o=n instanceof yjc?n:new Ajc(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[Fk].error=o})}get body(){return this[Fk].stream}get bodyUsed(){return this[Fk].disturbed}async buffer(){return dto(this)}async arrayBuffer(){return vjc(await this.buffer())}async text(){return(await dto(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(_wt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var Cjc=a(t=>{if(t[Fk].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[Fk],r=e;if(e instanceof _9){r=new uto;let n=new uto;e.pipe(r),e.pipe(n),t[Fk].stream=n}return r},"cloneStream"),bjc=a(t=>t===null?null:typeof t=="string"?"text/plain; charset=utf-8":t instanceof URLSearchParams?"application/x-www-form-urlencoded; charset=utf-8":Buffer.isBuffer(t)||fto(t)||t instanceof _9?null:"text/plain; charset=utf-8","guessContentType");pto.exports={Body:_wt,cloneStream:Cjc,guessContentType:bjc}});var lCe=I((cKh,Ato)=>{"use strict";p();var{validateHeaderName:hto,validateHeaderValue:mto}=require("http"),{isPlainObject:Sjc}=y9(),E9=Symbol("Headers internals"),r6e=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof hto=="function")hto(e);else if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let r=new TypeError(`Header name must be a valid HTTP token [${e}]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),r}return e.toLowerCase()},"normalizeName"),gto=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof mto=="function")mto(e,r);else if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(r)){let n=new TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(n,"code",{value:"ERR_INVALID_CHAR"}),n}return r},"normalizeValue"),vwt=class t{static{a(this,"Headers")}constructor(e={}){if(this[E9]={map:new Map},e instanceof t)e.forEach((r,n)=>{this.append(n,r)});else if(Array.isArray(e))e.forEach(([r,n])=>{this.append(r,n)});else if(Sjc(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[E9].map.set(r6e(e),gto(r,e))}has(e){return this[E9].map.has(r6e(e))}get(e){let r=this[E9].map.get(r6e(e));return r===void 0?null:r}append(e,r){let n=r6e(e),o=gto(r,e),s=this[E9].map.get(n);this[E9].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[E9].map.delete(r6e(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[E9].map.keys()).sort()}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return this.constructor.name}plain(){return Object.fromEntries(this[E9].map)}};Object.defineProperties(vwt.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));Ato.exports={Headers:vwt}});var R9r=I((dKh,yto)=>{"use strict";p();var{EventEmitter:Tjc}=require("events"),dM=Symbol("AbortSignal internals"),uCe=class{static{a(this,"AbortSignal")}constructor(){this[dM]={eventEmitter:new Tjc,onabort:null,aborted:!1}}get aborted(){return this[dM].aborted}get onabort(){return this[dM].onabort}set onabort(e){this[dM].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,r){this[dM].eventEmitter.removeListener(e,r)}addEventListener(e,r){this[dM].eventEmitter.on(e,r)}dispatchEvent(e){let r={type:e,target:this},n=`on${e}`;typeof this[dM][n]=="function"&&this[n](r),this[dM].eventEmitter.emit(e,r)}fire(){this[dM].aborted=!0,this.dispatchEvent("abort")}};Object.defineProperties(uCe.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var bwt=class extends uCe{static{a(this,"TimeoutSignal")}constructor(e){if(!Number.isInteger(e))throw new TypeError(`Expected an integer, got ${typeof e}`);super(),this[dM].timerId=setTimeout(()=>{this.fire()},e)}clear(){clearTimeout(this[dM].timerId)}};Object.defineProperties(bwt.prototype,{clear:{enumerable:!0}});var Cwt=Symbol("AbortController internals"),Swt=class{static{a(this,"AbortController")}constructor(){this[Cwt]={signal:new uCe}}get signal(){return this[Cwt].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[Cwt].signal.aborted||this[Cwt].signal.fire()}};Object.defineProperties(Swt.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});yto.exports={AbortController:Swt,AbortSignal:uCe,TimeoutSignal:bwt}});var n6e=I((hKh,vto)=>{"use strict";p();var{randomBytes:Ijc}=require("crypto"),{Readable:xjc}=require("stream"),P9r=a(t=>typeof t=="object"&&["arrayBuffer","stream","text","slice","constructor"].map(e=>typeof t[e]).filter(e=>e!=="function").length===0&&typeof t.type=="string"&&typeof t.size=="number"&&/^(Blob|File)$/.test(t[Symbol.toStringTag]),"isBlob"),wjc=a(t=>t!=null&&typeof t=="object"&&["append","delete","get","getAll","has","set","keys","values","entries","constructor"].map(e=>typeof t[e]).filter(e=>e!=="function").length===0&&t[Symbol.toStringTag]==="FormData","isFormData"),_to=a(t=>`--${t}--\r +`);this.baseURL=c.baseURL,this._baseURLIsExplicit=s.__baseURLIsExplicit??!!e,this.timeout=c.timeout??UUr.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=c6r(c.logLevel,"ClientOptions.logLevel",this)??c6r(wa("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??BYi(),qt(this,Txt,UYi,"f");let u=wa("ANTHROPIC_CUSTOM_HEADERS");if(u){let f={};for(let h of u.split(` +`)){let m=h.indexOf(":");m>=0&&(f[h.substring(0,m).trim()]=h.substring(m+1).trim())}c.defaultHeaders={...f,...c.defaultHeaders}}let d=s.__auth;if(delete c.__auth,delete c.__baseURLIsExplicit,this._options=c,this.apiKey=typeof r=="string"?r:null,this.authToken=n,this.webhookKey=o,d)this._authState=d,!this._baseURLIsExplicit&&d.baseURL&&(this.baseURL=d.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let f=c.credentials??null;if(f)this._authState.provider=f,this._authState.tokenCache=this._makeTokenCache(f);else if(c.config!=null){let h=p6r(c.config,this._credentialResolverOptions());this._authState.provider=h.provider,this._authState.tokenCache=this._makeTokenCache(h.provider),this._authState.extraHeaders=h.extraHeaders,this._applyCredentialBaseURL(h.baseURL)}else c.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(c.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,this._baseURLIsExplicit||(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{xl(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{xl(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new kIt(e,r=>{xl(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await EKi(this._credentialResolverOptions(),e);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(e!=null)throw new mr(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!r.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let r=this._requestAuthFlags.get(e);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,r)),r}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,Et([{Authorization:`Bearer ${r}`}])}return Et([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return Et([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return Et([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return JYi(e)}getUserAgent(){return`${this.constructor.name}/JS ${kk}`}defaultIdempotencyKey(){return`stainless-node-retry-${JEe()}`}makeStatusError(e,r,n,o){return Fh.generate(e,r,n,o)}buildURL(e,r,n){let o=!Ie(this,FUr,"m",zJi).call(this)&&n||this.baseURL,s=kYi(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!K8r(c)||!K8r(l))&&(r={...l,...c,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new mr("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(e){}async prepareRequest(e,{url:r,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let o=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[c,l]of Object.entries(this._authState.extraHeaders))o.has(c)||o.set(c,l);o.get("anthropic-beta")?.split(",").map(c=>c.trim())?.includes(ooe)||o.append("anthropic-beta",ooe),e.headers=o}}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new soe(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(xl(this).debug(`[${d}] sending request`,a9({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new qy;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(ZFe),A=Date.now();if(g instanceof globalThis.Error){let E=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new qy;let v=s9(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return xl(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${E}`),xl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${E})`,a9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw xl(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),xl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,a9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new XEe:new EW({cause:g})}let y=[...g.headers.entries()].filter(([E])=>E==="request-id").map(([E,v])=>", "+E+": "+JSON.stringify(v)).join(""),_=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let E=await this.shouldRetry(g,o);if(r&&E){let x=`retrying, ${r} attempts remaining`;return await FYi(g.body),xl(this).info(`${_} - ${x}`),xl(this).debug(`[${d}] response error (${x})`,a9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=E?"error; no more retries left":"error; not retryable";xl(this).info(`${_} - ${v}`);let S=await g.text().catch(x=>ZFe(x).message),T=vIt(S),w=T?void 0:S;throw xl(this).debug(`[${d}] response error (${v})`,a9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return xl(this).info(_),xl(this).debug(`[${d}] response start`,a9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),{response:g,options:o,controller:m,requestLogID:d,retryOfRequestLogID:n,startTime:h}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(o=>({method:"get",path:e,...o})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new a8e(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:s,method:c,...l}=r||{},u=this._makeAbort(o);s&&s.addEventListener("abort",u,{once:!0});let d=setTimeout(u,n),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,h={signal:o.signal,...f?{duplex:"half"}:{},method:"GET",...l};c&&(h.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(d)}}async shouldRetry(e,r){let n=this._authFlags(r);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=e.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let s,c=o?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(s=u)}let l=o?.get("retry-after");if(l&&!s){let u=parseFloat(l);Number.isNaN(u)?s=Date.parse(l)-Date.now():s=u*1e3}if(s===void 0){let u=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,u)}return await nM(s),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let s=r-e,c=Math.min(.5*Math.pow(2,s),8),l=1-Math.random()*.25;return c*l*1e3}calculateNonstreamingTimeout(e,r){if(36e5*e/128e3>6e5||r!=null&&e>r)throw new mr("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:s,query:c,defaultBaseURL:l}=n;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let u=this.buildURL(s,c,l);"timeout"in n&&DYi("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:d,body:f}=this.buildBody({options:n}),h=await this.buildHeaders({options:e,method:o,bodyHeaders:d,retryCount:r});return{req:{method:o,headers:h,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"},...f&&{body:f},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let s={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let c=Et([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...e8e(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(c),c.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=Et([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:bIt(e)}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:Ie(this,Txt,"f").call(this,{body:e,headers:n})}};UUr=Kf,Txt=new WeakMap,FUr=new WeakSet,zJi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");Kf.Anthropic=UUr;Kf.HUMAN_PROMPT=YJi;Kf.AI_PROMPT=KJi;Kf.DEFAULT_TIMEOUT=6e5;Kf.AnthropicError=mr;Kf.APIError=Fh;Kf.APIConnectionError=EW;Kf.APIConnectionTimeoutError=XEe;Kf.APIUserAbortError=qy;Kf.NotFoundError=nve;Kf.ConflictError=ive;Kf.RateLimitError=sve;Kf.BadRequestError=eve;Kf.AuthenticationError=tve;Kf.InternalServerError=ave;Kf.PermissionDeniedError=rve;Kf.UnprocessableEntityError=ove;Kf.toFile=UIt;yB=class extends Kf{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new voe(this),this.messages=new DW(this),this.models=new boe(this),this.beta=new gA(this)}};yB.Completions=voe;yB.Messages=DW;yB.Models=boe;yB.Beta=gA});var F6r=Se(()=>{p();QUr();b6r();LIt();QUr();Nd();Wf()});var I9r=I((eKh,cto)=>{p();var e6e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ejc=typeof AbortController=="function",gwt=ejc?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new oto}abort(){this.signal.dispatchEvent("abort")}},tjc=typeof AbortSignal=="function",rjc=typeof gwt.AbortSignal=="function",oto=tjc?AbortSignal:rjc?gwt.AbortController:class{static{a(this,"AbortSignal")}constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(e){if(e==="abort"){this.aborted=!0;let r={type:e,target:this};this.onabort(r),this._listeners.forEach(n=>n(r),this)}}onabort(){}addEventListener(e,r){e==="abort"&&this._listeners.push(r)}removeEventListener(e,r){e==="abort"&&(this._listeners=this._listeners.filter(n=>n!==r))}},S9r=new Set,v9r=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;Awt(r)&&T9r(r,`${t} option`,`options.${e}`,cCe)},"deprecatedOption"),C9r=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(Awt(r)){let{prototype:n}=cCe,{get:o}=Object.getOwnPropertyDescriptor(n,t);T9r(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),njc=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(Awt(r)){let{prototype:n}=cCe,{get:o}=Object.getOwnPropertyDescriptor(n,t);T9r(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),sto=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),Awt=a(t=>!S9r.has(t),"shouldWarn"),T9r=a((t,e,r,n)=>{S9r.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;sto(o,"DeprecationWarning",t,n)},"warn"),woe=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),ato=a(t=>woe(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?aCe:null:null,"getUintArray"),aCe=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},b9r=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=ato(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},cCe=class t{static{a(this,"LRUCache")}constructor(e={}){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,sizeCalculation:A,fetchMethod:y,fetchContext:_,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:v}=e,{length:S,maxAge:T,stale:w}=e instanceof t?{}:e;if(r!==0&&!woe(r))throw new TypeError("max option must be a nonnegative integer");let R=r?ato(r):Array;if(!R)throw new Error("invalid max value: "+r);if(this.max=r,this.maxSize=g,this.sizeCalculation=A||S,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=y||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=_,!this.fetchMethod&&_!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(r).fill(null),this.valList=new Array(r).fill(null),this.next=new R(r),this.prev=new R(r),this.head=0,this.tail=0,this.free=new b9r(r),this.initialFill=1,this.size=0,typeof d=="function"&&(this.dispose=d),typeof f=="function"?(this.disposeAfter=f,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!E,this.maxSize!==0){if(!woe(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!w,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=woe(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!woe(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let x="LRU_CACHE_UNBOUNDED";Awt(x)&&(S9r.add(x),sto("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&v9r("stale","allowStale"),T&&v9r("maxAge","ttl"),S&&v9r("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new aCe(this.max),this.starts=new aCe(this.max),this.setItemTTL=(n,o,s=e6e.now())=>{if(this.starts[n]=o!==0?s:0,this.ttls[n]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.isStale(n)&&this.delete(this.keyList[n])},o+1);c.unref&&c.unref()}},this.updateItemAge=n=>{this.starts[n]=this.ttls[n]!==0?e6e.now():0};let e=0,r=a(()=>{let n=e6e.now();if(this.ttlResolution>0){e=n;let o=setTimeout(()=>e=0,this.ttlResolution);o.unref&&o.unref()}return n},"getNow");this.getRemainingTTL=n=>{let o=this.keyMap.get(n);return o===void 0?0:this.ttls[o]===0||this.starts[o]===0?1/0:this.starts[o]+this.ttls[o]-(e||r())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(e||r())-this.starts[n]>this.ttls[n]}updateItemAge(e){}setItemTTL(e,r,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new aCe(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!woe(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!woe(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer)");return n},this.addItemSize=(e,r)=>{this.sizes[e]=r;let n=this.maxSize-this.sizes[e];for(;this.calculatedSize>n;)this.evict(!0);this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,r){}requireSize(e,r,n,o){if(n||o)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.tail;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.head));)r=this.prev[r]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.head;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.tail));)r=this.next[r]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())yield[this.keyList[e],this.valList[e]]}*rentries(){for(let e of this.rindexes())yield[this.keyList[e],this.valList[e]]}*keys(){for(let e of this.indexes())yield this.keyList[e]}*rkeys(){for(let e of this.rindexes())yield this.keyList[e]}*values(){for(let e of this.indexes())yield this.valList[e]}*rvalues(){for(let e of this.rindexes())yield this.valList[e]}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of this.indexes())if(e(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],r)}forEach(e,r=this){for(let n of this.indexes())e.call(r,this.valList[n],this.keyList[n],this)}rforEach(e,r=this){for(let n of this.rindexes())e.call(r,this.valList[n],this.keyList[n],this)}get prune(){return C9r("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let r of this.rindexes({allowStale:!0}))this.isStale(r)&&(this.delete(this.keyList[r]),e=!0);return e}dump(){let e=[];for(let r of this.indexes({allowStale:!0})){let n=this.keyList[r],o=this.valList[r],c={value:this.isBackgroundFetch(o)?o.__staleWhileFetching:o};if(this.ttls){c.ttl=this.ttls[r];let l=e6e.now()-this.starts[r];c.start=Math.floor(Date.now()-l)}this.sizes&&(c.size=this.sizes[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=e6e.now()-o}this.set(r,n.value,n)}}dispose(e,r,n){}set(e,r,{ttl:n=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL}={}){if(c=this.requireSize(e,r,c,l),this.maxSize&&c>this.maxSize)return this;let d=this.size===0?void 0:this.keyMap.get(e);if(d===void 0)d=this.newIndex(),this.keyList[d]=e,this.valList[d]=r,this.keyMap.set(e,d),this.next[this.tail]=d,this.prev[d]=this.tail,this.tail=d,this.size++,this.addItemSize(d,c),u=!1;else{let f=this.valList[d];r!==f&&(this.isBackgroundFetch(f)?f.__abortController.abort():s||(this.dispose(f,e,"set"),this.disposeAfter&&this.disposed.push([f,e,"set"])),this.removeItemSize(d),this.valList[d]=r,this.addItemSize(d,c)),this.moveToTail(d)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(d,n,o),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let r=this.head,n=this.keyList[r],o=this.valList[r];return this.isBackgroundFetch(o)?o.__abortController.abort():(this.dispose(o,n,"evict"),this.disposeAfter&&this.disposed.push([o,n,"evict"])),this.removeItemSize(r),e&&(this.keyList[r]=null,this.valList[r]=null,this.free.push(r)),this.head=this.next[r],this.keyMap.delete(n),this.size--,r}has(e,{updateAgeOnHas:r=this.updateAgeOnHas}={}){let n=this.keyMap.get(e);return n!==void 0&&!this.isStale(n)?(r&&this.updateItemAge(n),!0):!1}peek(e,{allowStale:r=this.allowStale}={}){let n=this.keyMap.get(e);if(n!==void 0&&(r||!this.isStale(n))){let o=this.valList[n];return this.isBackgroundFetch(o)?o.__staleWhileFetching:o}}backgroundFetch(e,r,n,o){let s=r===void 0?void 0:this.valList[r];if(this.isBackgroundFetch(s))return s;let c=new gwt,l={signal:c.signal,options:n,context:o},u=a(m=>(c.signal.aborted||this.set(e,m,l.options),m),"cb"),d=a(m=>{if(this.valList[r]===h&&(!n.noDeleteOnFetchRejection||h.__staleWhileFetching===void 0?this.delete(e):this.valList[r]=h.__staleWhileFetching),h.__returned===h)throw m},"eb"),f=a(m=>m(this.fetchMethod(e,s,l)),"pcall"),h=new Promise(f).then(u,d);return h.__abortController=c,h.__staleWhileFetching=s,h.__returned=null,r===void 0?(this.set(e,h,l.options),r=this.keyMap.get(e)):this.valList[r]=h,h}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,fetchContext:h=this.fetchContext,forceRefresh:m=!1}={}){if(!this.fetchMethod)return this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o});let g={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f},A=this.keyMap.get(e);if(A===void 0){let y=this.backgroundFetch(e,A,g,h);return y.__returned=y}else{let y=this.valList[A];if(this.isBackgroundFetch(y))return r&&y.__staleWhileFetching!==void 0?y.__staleWhileFetching:y.__returned=y;if(!m&&!this.isStale(A))return this.moveToTail(A),n&&this.updateItemAge(A),y;let _=this.backgroundFetch(e,A,g,h);return r&&_.__staleWhileFetching!==void 0?_.__staleWhileFetching:_.__returned=_}}get(e,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet}={}){let s=this.keyMap.get(e);if(s!==void 0){let c=this.valList[s],l=this.isBackgroundFetch(c);return this.isStale(s)?l?r?c.__staleWhileFetching:void 0:(o||this.delete(e),r?c:void 0):l?void 0:(this.moveToTail(s),n&&this.updateItemAge(s),c)}}connect(e,r){this.prev[r]=e,this.next[e]=r}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return C9r("del","delete"),this.delete}delete(e){let r=!1;if(this.size!==0){let n=this.keyMap.get(e);if(n!==void 0)if(r=!0,this.size===1)this.clear();else{this.removeItemSize(n);let o=this.valList[n];this.isBackgroundFetch(o)?o.__abortController.abort():(this.dispose(o,e,"delete"),this.disposeAfter&&this.disposed.push([o,e,"delete"])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return r}clear(){for(let e of this.rindexes({allowStale:!0})){let r=this.valList[e];if(this.isBackgroundFetch(r))r.__abortController.abort();else{let n=this.keyList[e];this.dispose(r,n,"delete"),this.disposeAfter&&this.disposed.push([r,n,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return C9r("reset","clear"),this.clear}get length(){return njc("length","size"),this.size}static get AbortController(){return gwt}static get AbortSignal(){return oto}};cto.exports=cCe});var R9r=I((nKh,lto)=>{"use strict";p();var t6e=class extends Error{static{a(this,"FetchBaseError")}constructor(e,r,n){super(e),this.type=r,this._name=n}get name(){return this._name}get[Symbol.toStringTag](){return this._name}},x9r=class extends t6e{static{a(this,"FetchError")}constructor(e,r,n){super(e,r,"FetchError"),n&&(this.code=n.code,this.errno=n.errno,this.erroredSysCall=n.syscall)}},w9r=class extends t6e{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};lto.exports={FetchBaseError:t6e,FetchError:x9r,AbortError:w9r}});var y9=I((sKh,dto)=>{"use strict";p();var{constants:{MAX_LENGTH:ijc}}=require("buffer"),{pipeline:ywt,PassThrough:ojc}=require("stream"),{promisify:sjc}=require("util"),{createGunzip:ajc,createInflate:cjc,createBrotliDecompress:ljc,constants:{Z_SYNC_FLUSH:uto}}=require("zlib"),ujc=YP()("helix-fetch:utils"),djc=sjc(ywt),fjc=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),pjc=a((t,e,r,n)=>{if(!fjc(t,e))return r;let o=a(s=>{s&&(ujc(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return ywt(r,ajc({flush:uto,finishFlush:uto}),o);case"deflate":case"x-deflate":return ywt(r,cjc(),o);case"br":return ywt(r,ljc(),o);default:return r}},"decodeStream"),hjc=a(t=>{if(!t||typeof t!="object"||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},"isPlainObject"),_wt=a((t,e)=>{if(Buffer.isBuffer(t))return t.length;switch(typeof t){case"string":return t.length*2;case"boolean":return 4;case"number":return 8;case"symbol":return Symbol.keyFor(t)?Symbol.keyFor(t).length*2:(t.toString().length-8)*2;case"object":return Array.isArray(t)?mjc(t,e):gjc(t,e);default:return 0}},"calcSize"),mjc=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:_wt(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),gjc=a((t,e)=>{if(t==null)return 0;e.add(t);let r=0,n=[];for(let o in t)n.push(o);return n.push(...Object.getOwnPropertySymbols(t)),n.forEach(o=>{if(r+=_wt(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=_wt(t[o],e)}),r},"calcObjectSize"),Ajc=a(t=>_wt(t,new WeakSet),"sizeof"),yjc=a(async t=>{let e=new ojc,r=0,n=[];return e.on("data",o=>{if(r+o.length>ijc)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await djc(t,e),Buffer.concat(n,r)},"streamToBuffer");dto.exports={decodeStream:pjc,isPlainObject:hjc,sizeof:Ajc,streamToBuffer:yjc}});var vwt=I((lKh,mto)=>{"use strict";p();var{PassThrough:fto,Readable:_9}=require("stream"),{types:{isAnyArrayBuffer:hto}}=require("util"),{FetchError:_jc,FetchBaseError:Ejc}=R9r(),{streamToBuffer:vjc}=y9(),Cjc=Buffer.alloc(0),Fk=Symbol("Body internals"),bjc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),pto=a(async t=>{if(t[Fk].disturbed)throw new TypeError("Already read");if(t[Fk].error)throw new TypeError(`Stream had error: ${t[Fk].error.message}`);t[Fk].disturbed=!0;let{stream:e}=t[Fk];return e===null?Cjc:vjc(e)},"consume"),Ewt=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=_9.from(e.toString()):e instanceof _9?r=e:Buffer.isBuffer(e)?r=_9.from(e):hto(e)?r=_9.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=_9.from(e):r=_9.from(String(e)),this[Fk]={stream:r,disturbed:!1,error:null},e instanceof _9&&r.on("error",n=>{let o=n instanceof Ejc?n:new _jc(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[Fk].error=o})}get body(){return this[Fk].stream}get bodyUsed(){return this[Fk].disturbed}async buffer(){return pto(this)}async arrayBuffer(){return bjc(await this.buffer())}async text(){return(await pto(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(Ewt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var Sjc=a(t=>{if(t[Fk].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[Fk],r=e;if(e instanceof _9){r=new fto;let n=new fto;e.pipe(r),e.pipe(n),t[Fk].stream=n}return r},"cloneStream"),Tjc=a(t=>t===null?null:typeof t=="string"?"text/plain; charset=utf-8":t instanceof URLSearchParams?"application/x-www-form-urlencoded; charset=utf-8":Buffer.isBuffer(t)||hto(t)||t instanceof _9?null:"text/plain; charset=utf-8","guessContentType");mto.exports={Body:Ewt,cloneStream:Sjc,guessContentType:Tjc}});var lCe=I((fKh,_to)=>{"use strict";p();var{validateHeaderName:gto,validateHeaderValue:Ato}=require("http"),{isPlainObject:Ijc}=y9(),E9=Symbol("Headers internals"),r6e=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof gto=="function")gto(e);else if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let r=new TypeError(`Header name must be a valid HTTP token [${e}]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),r}return e.toLowerCase()},"normalizeName"),yto=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof Ato=="function")Ato(e,r);else if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(r)){let n=new TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(n,"code",{value:"ERR_INVALID_CHAR"}),n}return r},"normalizeValue"),Cwt=class t{static{a(this,"Headers")}constructor(e={}){if(this[E9]={map:new Map},e instanceof t)e.forEach((r,n)=>{this.append(n,r)});else if(Array.isArray(e))e.forEach(([r,n])=>{this.append(r,n)});else if(Ijc(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[E9].map.set(r6e(e),yto(r,e))}has(e){return this[E9].map.has(r6e(e))}get(e){let r=this[E9].map.get(r6e(e));return r===void 0?null:r}append(e,r){let n=r6e(e),o=yto(r,e),s=this[E9].map.get(n);this[E9].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[E9].map.delete(r6e(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[E9].map.keys()).sort()}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return this.constructor.name}plain(){return Object.fromEntries(this[E9].map)}};Object.defineProperties(Cwt.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));_to.exports={Headers:Cwt}});var k9r=I((mKh,Eto)=>{"use strict";p();var{EventEmitter:xjc}=require("events"),dM=Symbol("AbortSignal internals"),uCe=class{static{a(this,"AbortSignal")}constructor(){this[dM]={eventEmitter:new xjc,onabort:null,aborted:!1}}get aborted(){return this[dM].aborted}get onabort(){return this[dM].onabort}set onabort(e){this[dM].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,r){this[dM].eventEmitter.removeListener(e,r)}addEventListener(e,r){this[dM].eventEmitter.on(e,r)}dispatchEvent(e){let r={type:e,target:this},n=`on${e}`;typeof this[dM][n]=="function"&&this[n](r),this[dM].eventEmitter.emit(e,r)}fire(){this[dM].aborted=!0,this.dispatchEvent("abort")}};Object.defineProperties(uCe.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var Swt=class extends uCe{static{a(this,"TimeoutSignal")}constructor(e){if(!Number.isInteger(e))throw new TypeError(`Expected an integer, got ${typeof e}`);super(),this[dM].timerId=setTimeout(()=>{this.fire()},e)}clear(){clearTimeout(this[dM].timerId)}};Object.defineProperties(Swt.prototype,{clear:{enumerable:!0}});var bwt=Symbol("AbortController internals"),Twt=class{static{a(this,"AbortController")}constructor(){this[bwt]={signal:new uCe}}get signal(){return this[bwt].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[bwt].signal.aborted||this[bwt].signal.fire()}};Object.defineProperties(Twt.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});Eto.exports={AbortController:Twt,AbortSignal:uCe,TimeoutSignal:Swt}});var n6e=I((yKh,bto)=>{"use strict";p();var{randomBytes:wjc}=require("crypto"),{Readable:Rjc}=require("stream"),D9r=a(t=>typeof t=="object"&&["arrayBuffer","stream","text","slice","constructor"].map(e=>typeof t[e]).filter(e=>e!=="function").length===0&&typeof t.type=="string"&&typeof t.size=="number"&&/^(Blob|File)$/.test(t[Symbol.toStringTag]),"isBlob"),kjc=a(t=>t!=null&&typeof t=="object"&&["append","delete","get","getAll","has","set","keys","values","entries","constructor"].map(e=>typeof t[e]).filter(e=>e!=="function").length===0&&t[Symbol.toStringTag]==="FormData","isFormData"),vto=a(t=>`--${t}--\r \r -`,"getFooter"),Eto=a((t,e,r)=>{let n="";return n+=`--${t}\r -`,n+=`Content-Disposition: form-data; name="${e}"`,P9r(r)&&(n+=`; filename="${r.name}"\r +`,"getFooter"),Cto=a((t,e,r)=>{let n="";return n+=`--${t}\r +`,n+=`Content-Disposition: form-data; name="${e}"`,D9r(r)&&(n+=`; filename="${r.name}"\r `,n+=`Content-Type: ${r.type||"application/octet-stream"}`),`${n}\r \r -`},"getHeader");async function*Rjc(t,e){for(let[r,n]of t)yield Eto(e,r,n),P9r(n)?yield*n.stream():yield n,yield`\r -`;yield _to(e)}a(Rjc,"formDataIterator");var kjc=a((t,e)=>{let r=0;for(let[n,o]of t)r+=Buffer.byteLength(Eto(e,n,o)),r+=P9r(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r -`);return r+=Buffer.byteLength(_to(e)),r},"getFormDataLength"),k9r=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=Ijc(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=kjc(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return xjc.from(Rjc(this.fd,this.boundary))}};vto.exports={isFormData:wjc,FormDataSerializer:k9r}});var bto=I((yKh,Cto)=>{"use strict";p();var{AbortSignal:AKh}=R9r(),{Body:Pjc,cloneStream:Djc,guessContentType:Njc}=Ewt(),{Headers:Mjc}=lCe(),{isPlainObject:Ojc}=y9(),{isFormData:Ljc,FormDataSerializer:Bjc}=n6e(),Fjc=20,BW=Symbol("Request internals"),Twt=class t extends Pjc{static{a(this,"Request")}constructor(e,r={}){let n=e instanceof t?e:null,o=n?new URL(n.url):new URL(e),s=r.method||n&&n.method||"GET";if(s=s.toUpperCase(),(r.body!=null||n&&n.body!==null)&&["GET","HEAD"].includes(s))throw new TypeError("Request with GET/HEAD method cannot have body");let c=r.body||(n&&n.body?Djc(n):null),l=new Mjc(r.headers||n&&n.headers||{});if(Ljc(c)&&!l.has("content-type")){let h=new Bjc(c);c=h.stream(),l.set("content-type",h.contentType()),!l.has("transfer-encoding")&&!l.has("content-length")&&l.set("content-length",h.length())}if(!l.has("content-type"))if(Ojc(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=Njc(c);h&&l.set("content-type",h)}super(c);let u=n?n.signal:null;"signal"in r&&(u=r.signal);let d=r.redirect||n&&n.redirect||"follow";if(!["follow","error","manual"].includes(d))throw new TypeError(`'${d}' is not a valid redirect option`);let f=r.cache||n&&n.cache||"default";if(!["default","no-store","reload","no-cache","force-cache","only-if-cached"].includes(f))throw new TypeError(`'${f}' is not a valid cache option`);this[BW]={init:{...r},method:s,redirect:d,cache:f,headers:l,parsedURL:o,signal:u},r.follow===void 0?!n||n.follow===void 0?this.follow=Fjc:this.follow=n.follow:this.follow=r.follow,this.counter=r.counter||n&&n.counter||0,r.compress===void 0?!n||n.compress===void 0?this.compress=!0:this.compress=n.compress:this.compress=r.compress,r.decode===void 0?!n||n.decode===void 0?this.decode=!0:this.decode=n.decode:this.decode=r.decode}get method(){return this[BW].method}get url(){return this[BW].parsedURL.toString()}get headers(){return this[BW].headers}get redirect(){return this[BW].redirect}get cache(){return this[BW].cache}get signal(){return this[BW].signal}clone(){return new t(this)}get init(){return this[BW].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(Twt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});Cto.exports={Request:Twt}});var D9r=I((vKh,Sto)=>{"use strict";p();var{Body:Ujc,cloneStream:Qjc,guessContentType:qjc}=Ewt(),{Headers:jjc}=lCe(),{isPlainObject:Hjc}=y9(),{isFormData:Gjc,FormDataSerializer:$jc}=n6e(),fM=Symbol("Response internals"),Iwt=class t extends Ujc{static{a(this,"Response")}constructor(e=null,r={}){let n=new jjc(r.headers),o=e;if(Gjc(o)&&!n.has("content-type")){let s=new $jc(o);o=s.stream(),n.set("content-type",s.contentType()),!n.has("transfer-encoding")&&!n.has("content-length")&&n.set("content-length",s.length())}if(o!==null&&!n.has("content-type"))if(Hjc(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=qjc(o);s&&n.set("content-type",s)}super(o),this[fM]={url:r.url,status:r.status||200,statusText:r.statusText||"",headers:n,httpVersion:r.httpVersion,decoded:r.decoded,counter:r.counter}}get url(){return this[fM].url||""}get status(){return this[fM].status}get statusText(){return this[fM].statusText}get ok(){return this[fM].status>=200&&this[fM].status<300}get redirected(){return this[fM].counter>0}get headers(){return this[fM].headers}get httpVersion(){return this[fM].httpVersion}get decoded(){return this[fM].decoded}static redirect(e,r=302){if(![301,302,303,307,308].includes(r))throw new RangeError("Invalid status code");return new t(null,{headers:{location:new URL(e).toString()},status:r})}clone(){if(this.bodyUsed)throw new TypeError("Cannot clone: already read");return new t(Qjc(this),{...this[fM]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(Iwt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});Sto.exports={Response:Iwt}});var Ito=I((TKh,Tto)=>{"use strict";p();var Vjc=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),Wjc=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),zjc=new Set([500,502,503,504]),Yjc={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},Kjc={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function woe(t){let e=parseInt(t,10);return isFinite(e)?e:0}a(woe,"toNumberOrZero");function Jjc(t){return t?zjc.has(t.status):!0}a(Jjc,"isErrorResponse");function N9r(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let n of r){let[o,s]=n.split(/=/,2);e[o.trim()]=s===void 0?!0:s.trim().replace(/^"|"$/g,"")}return e}a(N9r,"parseCacheControl");function Zjc(t){let e=[];for(let r in t){let n=t[r];e.push(n===!0?r:r+"="+n)}if(e.length)return e.join(", ")}a(Zjc,"formatCacheControl");Tto.exports=class{static{a(this,"CachePolicy")}constructor(e,r,{shared:n,cacheHeuristic:o,immutableMinTimeToLive:s,ignoreCargoCult:c,_fromObject:l}={}){if(l){this._fromObject(l);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._cacheHeuristic=o!==void 0?o:.1,this._immutableMinTtl=s!==void 0?s:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=N9r(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=N9r(e.headers["cache-control"]),c&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":Zjc(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&Wjc.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||Vjc.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=N9r(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)||r["max-age"]&&this.age()>r["max-age"]||r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]||this.stale()&&!(r["max-stale"]&&!this._rescc["must-revalidate"]&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of r)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let n in e)Yjc[n]||(r[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let o of n)delete r[o]}if(r.warning){let n=r.warning.split(/,/).filter(o=>!/^\s*1[0-9][0-9]/.test(o));n.length?r.warning=n.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return woe(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return woe(this._rescc["s-maxage"])}if(this._rescc["max-age"])return woe(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||nn)return Math.max(e,(r-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+woe(this._rescc["stale-if-error"]),n=e+woe(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+woe(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+woe(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let o=r["if-none-match"].split(/,/).filter(s=>!/^\s*W\//.test(s));o.length?r["if-none-match"]=o.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&Jjc(r))return{modified:!1,matches:!1,policy:this};if(!r||!r.headers)throw Error("Response headers missing");let n=!1;if(r.status!==void 0&&r.status!=304?n=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(n=!0),!n)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let o={};for(let c in this._resHeaders)o[c]=c in r.headers&&!Kjc[c]?r.headers[c]:this._resHeaders[c];let s=Object.assign({},r,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var kto=I((wKh,Rto)=>{"use strict";p();var Xjc=Ito(),{Headers:eHc}=lCe(),xto=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),wto=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),M9r=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new Xjc(xto(e),wto(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(xto(e))}responseHeaders(e){return new eHc(this.policy.responseHeaders(wto(e)))}timeToLive(){return this.policy.timeToLive()}};Rto.exports=M9r});var Nto=I((PKh,Dto)=>{"use strict";p();var{Readable:tHc}=require("stream"),{Headers:Pto}=lCe(),{Response:rHc}=D9r(),FW=Symbol("CacheableResponse internals"),nHc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),O9r=class t extends rHc{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new Pto(r.headers);this[FW]={headers:n,bufferedBody:e}}get headers(){return this[FW].headers}set headers(e){if(e instanceof Pto)this[FW].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return tHc.from(this[FW].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[FW].bufferedBody}async arrayBuffer(){return nHc(this[FW].bufferedBody)}async text(){return this[FW].bufferedBody.toString()}async json(){return JSON.parse(await this.text())}clone(){let{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l}=this;return new t(this[FW].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},iHc=a(async t=>{let e=await t.buffer(),{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u}=t;return new O9r(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");Dto.exports={cacheableResponse:iHc}});var xwt=I((MKh,Mto)=>{"use strict";p();var L9r=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};Mto.exports={RequestAbortedError:L9r}});var Uto=I((BKh,Fto)=>{"use strict";p();var Lto=require("http"),Bto=require("https"),{Readable:oHc}=require("stream"),v9=YP()("helix-fetch:h1"),{RequestAbortedError:Oto}=xwt(),{decodeStream:sHc}=y9(),aHc=a((t,e)=>{let{h1:r,options:{h1:n,rejectUnauthorized:o}}=t;return e==="https:"?r.httpsAgent?r.httpsAgent:n||typeof o=="boolean"?(r.httpsAgent=new Bto.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new Lto.Agent(n),r.httpAgent):void 0},"getAgent"),cHc=a(t=>{t.h1={}},"setupContext"),lHc=a(async({h1:t})=>{t.httpAgent&&(v9("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(v9("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),uHc=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?sHc(n,u,t,r):t;return{statusCode:n,statusText:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u,readable:d,decoded:!!(e&&d!==t)}},"createResponse"),dHc=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?Bto:Lto,o=aHc(t,e.protocol),s={...r,agent:o},{socket:c,body:l}=s;return c&&(delete s.socket,c.assigned||(c.assigned=!0,o?s.agent=new Proxy(o,{get:a((u,d)=>d==="createConnection"&&!c.inUse?(f,h)=>{v9(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{v9(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{v9(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(v9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new Oto),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new Oto);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(v9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u(uHc(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(v9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(v9(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof oHc?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");Fto.exports={request:dHc,setupContext:cHc,resetContext:lHc}});var Hto=I((QKh,jto)=>{"use strict";p();var{connect:fHc,constants:pHc}=require("http2"),{Readable:hHc}=require("stream"),Nd=YP()("helix-fetch:h2"),{RequestAbortedError:Qto}=xwt(),{decodeStream:mHc}=y9(),{NGHTTP2_CANCEL:i6e}=pHc,gHc=300*1e3,AHc=5e3,yHc=a(t=>{t.h2={sessionCache:{}}},"setupContext"),_Hc=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),Nd(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),qto=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?mHc(s,t,e,n):e;return{statusCode:s,statusText:"",httpVersion:"2.0",httpVersionMajor:2,httpVersionMinor:0,headers:o,readable:c,decoded:!!(r&&c!==e)}},"createResponse"),EHc=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=AHc}}}=t,d=o[":path"],f=`${e}${d}`;Nd(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(i6e)},"rejectPush")),n.on("push",(h,m)=>{Nd(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{Nd(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(i6e)}),l&&l(f,o,qto(h,n,r))}),n.on("aborted",()=>{Nd(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{Nd(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{Nd(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),vHc=a(async(t,e,r)=>{let{origin:n,pathname:o,search:s,hash:c}=e,l=`${o}${s}${c}`,{options:{h2:u={}},h2:{sessionCache:d}}=t,{idleSessionTimeout:f=gHc,pushPromiseHandler:h,pushHandler:m}=u,g={...r},{method:A,headers:y,socket:_,body:E,decode:v}=g;return _&&delete g.socket,y.host&&(y[":authority"]=y.host,delete y.host),new Promise((S,T)=>{let w=d[n];if(!w||w.closed||w.destroyed){let N=!(t.options.rejectUnauthorized===!1||u.rejectUnauthorized===!1),O={...u,rejectUnauthorized:N};_&&!_.inUse&&(O.createConnection=()=>(Nd(`reusing socket #${_.id} (${_.servername})`),_.inUse=!0,_)),w=fHc(n,{...O,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{Nd(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{Nd(`session ${n} established`),Nd(`caching session ${n}`),d[n]=w}),w.on("localSettings",q=>{Nd(`session ${n} localSettings: ${JSON.stringify(q)}`)}),w.on("remoteSettings",q=>{Nd(`session ${n} remoteSettings: ${JSON.stringify(q)}`)}),w.once("close",()=>{Nd(`session ${n} closed`),d[n]===w&&(Nd(`discarding cached session ${n}`),delete d[n])}),w.once("error",q=>{Nd(`session ${n} encountered error: ${q}`),d[n]===w&&(Nd(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(q,M,L)=>{Nd(`session ${n} encountered frameError: type: ${q}, code: ${M}, id: ${L}`)}),w.once("goaway",(q,M,L)=>{Nd(`session ${n} received GOAWAY frame: errorCode: ${q}, lastStreamID: ${M}, opaqueData: ${L?L.toString():void 0}`)}),w.on("stream",(q,M,L)=>{EHc(t,n,v,q,M,L)})}else _&&_.id!==w.socket.id&&!_.inUse&&(Nd(`discarding redundant socket used for ALPN: #${_.id} ${_.servername}`),_.destroy());Nd(`${A} ${e.host}${l}`);let R,{signal:x}=g,k=a(()=>{x.removeEventListener("abort",k),T(new Qto),R&&R.close(i6e)},"onAbortSignal");if(x){if(x.aborted){T(new Qto);return}x.addEventListener("abort",k)}let D=a(N=>{Nd(`session ${n} encountered error during ${g.method} ${e.href}: ${N}`),T(N)},"onSessionError");w.once("error",D),R=w.request({":method":A,":path":l,...y}),R.once("response",N=>{w.off("error",D),x&&x.removeEventListener("abort",k),S(qto(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",k),R.rstCode!==i6e&&(Nd(`${g.method} ${e.href} failed with: ${N.message}`),R.close(i6e),T(N))}),R.once("frameError",(N,O,B)=>{w.off("error",D),Nd(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${O}, id: ${B}`)}),R.on("push",(N,O)=>{Nd(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${O}`)}),E instanceof hHc?E.pipe(R):(E&&R.write(E),R.end())})},"request");jto.exports={request:vHc,setupContext:yHc,resetContext:_Hc}});var $to=I((HKh,Gto)=>{"use strict";p();var{EventEmitter:CHc}=require("events"),bHc=a(()=>{let t={},e=new CHc;return e.setMaxListeners(0),{acquire:a(r=>new Promise(n=>{if(!t[r]){t[r]=!0,n();return}let o=a(s=>{t[r]||(t[r]=!0,e.removeListener(r,o),n(s))},"tryAcquire");e.on(r,o)}),"acquire"),release:a((r,n)=>{Reflect.deleteProperty(t,r),setImmediate(()=>e.emit(r,n))},"release")}},"lock");Gto.exports=bHc});var Vto=I((VKh,SHc)=>{SHc.exports={name:"@adobe/helix-fetch",version:"3.1.1",description:"Light-weight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2",main:"src/index.js",scripts:{test:"nyc mocha",lint:"./node_modules/.bin/eslint .","semantic-release":"semantic-release"},mocha:{timeout:"5000",recursive:"true",reporter:"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},engines:{node:">=12.0"},types:"src/index.d.ts",exports:{import:"./src/index.mjs",require:"./src/index.js"},repository:{type:"git",url:"https://github.com/adobe/helix-fetch"},author:"",license:"Apache-2.0",bugs:{url:"https://github.com/adobe/helix-fetch/issues"},homepage:"https://github.com/adobe/helix-fetch#readme",keywords:["fetch","whatwg","Fetch API","http","https","http2","h2","promise","async","request","RFC 7234","7234","caching","cache"],dependencies:{debug:"4.3.4","http-cache-semantics":"^4.1.1","lru-cache":"7.13.1"},devDependencies:{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1",chai:"4.3.6","chai-as-promised":"7.1.1","chai-bytes":"0.1.2","chai-iterator":"3.0.2",eslint:"8.21.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.26.0","formdata-node":"4.3.3","lint-staged":"13.0.3",mocha:"10.0.0","mocha-multi-reporters":"1.5.1",nock:"13.2.9",nyc:"15.1.0","parse-cache-control":"1.0.1",pem:"1.14.6",proxy:"^1.0.2","semantic-release":"19.0.3",sinon:"14.0.0","stream-buffers":"3.0.2",tunnel:"^0.0.6"},"lint-staged":{"*.js":"eslint"},config:{commitizen:{path:"node_modules/cz-conventional-changelog"},ghooks:{"pre-commit":"npx lint-staged"}}}});var Jto=I((WKh,Kto)=>{"use strict";p();var{Readable:THc}=require("stream"),IHc=require("tls"),{types:{isAnyArrayBuffer:xHc}}=require("util"),wHc=T9r(),B9r=YP()("helix-fetch:core"),{RequestAbortedError:wwt}=xwt(),F9r=Uto(),Rwt=Hto(),RHc=$to(),{isPlainObject:kHc}=y9(),{isFormData:PHc,FormDataSerializer:DHc}=n6e(),{version:NHc}=Vto(),U9r="h2",Q9r="h2c",q9r="http/1.0",Roe="http/1.1",MHc=100,OHc=3600*1e3,LHc=[U9r,Roe,q9r],BHc=`helix-fetch/${NHc}`,FHc={method:"GET",compress:!0,decode:!0},Wto=0,zto=RHc(),Yto=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new wwt;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new wwt);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof wwt||(B9r(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=IHc.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),Wto+=1,s.id=Wto,s.secureConnecting=!1,B9r(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),UHc=a(async(t,e)=>{let r=await zto.acquire(t.origin);try{return r||(r=await Yto(t,e)),r}finally{zto.release(t.origin,r)}},"connect"),QHc=a(async(t,e,r)=>{let n=`${e.protocol}//${e.host}`,o=t.alpnCache.get(n);if(o)return{protocol:o};switch(e.protocol){case"http:":return o=Roe,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=Q9r,t.alpnCache.set(n,o),{protocol:o};case"https:":break;default:throw new TypeError(`unsupported protocol: ${e.protocol}`)}let{options:{rejectUnauthorized:s,h1:c={},h2:l={}}}=t,u=!(s===!1||c.rejectUnauthorized===!1||l.rejectUnauthorized===!1),d={servername:e.hostname,ALPNProtocols:t.alpnProtocols,signal:r,rejectUnauthorized:u};t.options.ca&&(d.ca=t.options.ca);let f=await UHc(e,d);return o=f.alpnProtocol,o||(o=Roe),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),qHc=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),jHc=a(async(t,e,r,n)=>{let o=e.protocol==="https:",s;e.port?s=e.port:o?s=443:s=80;let c={...r,host:e.host,hostname:e.hostname,port:s},l=await t(c);if(o){let d={...c,ALPNProtocols:n};d.socket=l,d.servername=c.host;let f=await Yto(e,d);return{protocol:f.alpnProtocol||Roe,socket:f}}return{protocol:l.alpnProtocol||Roe,socket:l}},"getProtocolAndSocketFromFactory"),HHc=a(async(t,e,r)=>{let n=new URL(e),o={...FHc,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=qHc(o.headers||{}),o.headers.host===void 0&&(o.headers.host=n.host),t.userAgent&&o.headers["user-agent"]===void 0&&(o.headers["user-agent"]=t.userAgent);let s;if(o.body instanceof URLSearchParams)s="application/x-www-form-urlencoded; charset=utf-8",o.body=o.body.toString();else if(PHc(o.body)){let d=new DHc(o.body);s=d.contentType(),o.body=d.stream(),o.headers["transfer-encoding"]===void 0&&o.headers["content-length"]===void 0&&(o.headers["content-length"]=String(d.length()))}else typeof o.body=="string"||o.body instanceof String?s="text/plain; charset=utf-8":kHc(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):xHc(o.body)&&(o.body=Buffer.from(o.body));o.headers["content-type"]===void 0&&s!==void 0&&(o.headers["content-type"]=s),o.body!=null&&(o.body instanceof THc||(!(typeof o.body=="string"||o.body instanceof String)&&!Buffer.isBuffer(o.body)&&(o.body=String(o.body)),o.headers["transfer-encoding"]===void 0&&o.headers["content-length"]===void 0&&(o.headers["content-length"]=String(Buffer.isBuffer(o.body)?o.body.length:Buffer.byteLength(o.body,"utf-8"))))),o.headers.accept===void 0&&(o.headers.accept="*/*"),o.body==null&&["POST","PUT"].includes(o.method)&&(o.headers["content-length"]="0"),o.compress&&o.headers["accept-encoding"]===void 0&&(o.headers["accept-encoding"]="gzip,deflate,br");let{signal:c}=o,{protocol:l,socket:u=null}=t.socketFactory?await jHc(t.socketFactory,n,o,t.alpnProtocols):await QHc(t,n,c);switch(B9r(`${n.host} -> ${l}`),l){case U9r:try{return await Rwt.request(t,n,u?{...o,socket:u}:o)}catch(d){let{code:f,message:h}=d;throw f==="ERR_HTTP2_ERROR"&&h==="Protocol error"&&t.alpnCache.delete(`${n.protocol}//${n.host}`),d}case Q9r:return Rwt.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case q9r:case Roe:return F9r.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),GHc=a(async t=>(t.alpnCache.clear(),Promise.all([F9r.resetContext(t),Rwt.resetContext(t)])),"resetContext"),$Hc=a(t=>{let{options:{alpnProtocols:e=LHc,alpnCacheTTL:r=OHc,alpnCacheSize:n=MHc,userAgent:o=BHc,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new wHc({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,F9r.setupContext(t),Rwt.setupContext(t)},"setupContext");Kto.exports={request:HHc,setupContext:$Hc,resetContext:GHc,RequestAbortedError:wwt,ALPN_HTTP2:U9r,ALPN_HTTP2C:Q9r,ALPN_HTTP1_1:Roe,ALPN_HTTP1_0:q9r}});var Xto=I((KKh,Zto)=>{"use strict";p();var VHc=YP()("helix-fetch:core"),{request:WHc,setupContext:zHc,resetContext:YHc,RequestAbortedError:KHc,ALPN_HTTP2:JHc,ALPN_HTTP2C:ZHc,ALPN_HTTP1_1:XHc,ALPN_HTTP1_0:eGc}=Jto(),j9r=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},zHc(this)}api(){return{request:a(async(e,r)=>this.request(e,r),"request"),context:a((e={})=>new t(e).api(),"context"),setCA:a(e=>this.setCA(e),"setCA"),reset:a(async()=>this.reset(),"reset"),RequestAbortedError:KHc,ALPN_HTTP2:JHc,ALPN_HTTP2C:ZHc,ALPN_HTTP1_1:XHc,ALPN_HTTP1_0:eGc}}async request(e,r){return WHc(this,e,r)}setCA(e){this.options.ca=e}async reset(){return VHc("resetting context"),YHc(this)}};Zto.exports=new j9r().api()});var iro=I((XKh,nro)=>{"use strict";p();var{EventEmitter:tGc}=require("events"),{Readable:o6e}=require("stream"),H9r=YP()("helix-fetch"),rGc=T9r(),{Body:nGc}=Ewt(),{Headers:W9r}=lCe(),{Request:koe}=bto(),{Response:$9r}=D9r(),{FetchBaseError:iGc,FetchError:s6e,AbortError:kwt}=w9r(),{AbortController:oGc,AbortSignal:sGc,TimeoutSignal:aGc}=R9r(),cGc=kto(),{cacheableResponse:lGc}=Nto(),{sizeof:uGc}=y9(),{isFormData:dGc}=n6e(),{context:fGc,RequestAbortedError:pGc}=Xto(),ero=["GET","HEAD"],hGc=500,mGc=100*1024*1024,G9r="push",tro=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof koe&&typeof r>"u"?e:new koe(e,r),{method:s,body:c,signal:l,compress:u,decode:d,follow:f,redirect:h,init:{body:m}}=o,g;if(l&&l.aborted){let w=new kwt("The operation was aborted.");throw o.init.body instanceof o6e&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof o6e)&&!dGc(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof o6e&&m.destroy(w),w instanceof TypeError?w:w instanceof pGc?new kwt("The operation was aborted."):new s6e(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new kwt("The operation was aborted.");o.init.body instanceof o6e&&o.init.body.destroy(w),g.readable.emit("error",w)},"abortHandler");l&&l.addEventListener("abort",A);let{statusCode:y,statusText:_,httpVersion:E,headers:v,readable:S,decoded:T}=g;if([301,302,303,307,308].includes(y)){let{location:w}=v,R=w==null?null:new URL(w,o.url);switch(o.redirect){case"manual":break;case"error":throw l&&l.removeEventListener("abort",A),new s6e(`uri requested responds with a redirect, redirect mode is set to 'error': ${o.url}`,"no-redirect");case"follow":{if(R===null)break;if(o.counter>=o.follow)throw l&&l.removeEventListener("abort",A),new s6e(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new W9r(o.headers),follow:o.follow,compress:o.compress,decode:o.decode,counter:o.counter+1,method:o.method,body:o.body,signal:o.signal};if(y!==303&&o.body&&o.init.body instanceof o6e)throw l&&l.removeEventListener("abort",A),new s6e("Cannot follow redirect with body being a readable stream","unsupported-redirect");return(y===303||(y===301||y===302)&&o.method==="POST")&&(x.method="GET",x.body=void 0,x.headers.delete("content-length")),l&&l.removeEventListener("abort",A),tro(t,new koe(R,x))}default:}}return l&&(S.once("end",()=>{l.removeEventListener("abort",A)}),S.once("error",()=>{l.removeEventListener("abort",A)})),new $9r(S,{url:o.url,status:y,statusText:_,headers:v,httpVersion:E,decoded:T,counter:o.counter})},"fetch"),rro=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!ero.includes(e.method))return r;let n=new cGc(e,r,{shared:!1});if(n.storable()){let o=await lGc(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),gGc=a(async(t,e,r)=>{let n=new koe(e,r);if(t.options.maxCacheSize!==0&&ero.includes(n.method)&&!["no-store","reload"].includes(n.cache)){let{policy:c,response:l}=t.cache.get(n.url)||{};if(c&&c.satisfiesWithoutRevalidation(n)){l.headers=new W9r(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await tro(t,n);return n.cache!=="no-store"?rro(t,n,s):s},"cachingFetch"),AGc=a((t,e={})=>{let r=new URL(t);if(typeof e!="object"||Array.isArray(e))throw new TypeError("qs: object expected");return Object.entries(e).forEach(([n,o])=>{Array.isArray(o)?o.forEach(s=>r.searchParams.append(n,s)):r.searchParams.append(n,o)}),r.href},"createUrl"),yGc=a(t=>new aGc(t),"timeoutSignal"),V9r=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:mGc,o=hGc;n===0&&(n=1,o=1);let s=a(({response:l},u)=>uGc(l),"sizeCalculation");this.cache=new rGc({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new tGc,this.options.h2=this.options.h2||{},typeof this.options.h2.enablePush>"u"&&(this.options.h2.enablePush=!0);let{enablePush:c}=this.options.h2;c&&(this.options.h2.pushPromiseHandler=(l,u,d)=>{let f={...u};Object.keys(f).filter(h=>h.startsWith(":")).forEach(h=>delete f[h]),this.pushPromiseHandler(l,f,d)},this.options.h2.pushHandler=(l,u,d)=>{let f={...u};Object.keys(f).filter(E=>E.startsWith(":")).forEach(E=>delete f[E]);let{statusCode:h,statusText:m,httpVersion:g,headers:A,readable:y,decoded:_}=d;this.pushHandler(l,f,new $9r(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:_}))}),this.context=fGc(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:nGc,Headers:W9r,Request:koe,Response:$9r,AbortController:oGc,AbortSignal:sGc,FetchBaseError:iGc,FetchError:s6e,AbortError:kwt,context:a((e={})=>new t(e).api(),"context"),setCA:a(e=>this.setCA(e),"setCA"),noCache:a((e={})=>new t({...e,maxCacheSize:0}).api(),"noCache"),h1:a((e={})=>new t({...e,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),"h1"),keepAlive:a((e={})=>new t({...e,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),"keepAlive"),h1NoCache:a((e={})=>new t({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),"h1NoCache"),keepAliveNoCache:a((e={})=>new t({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),"keepAliveNoCache"),reset:a(async()=>this.context.reset(),"reset"),onPush:a(e=>this.onPush(e),"onPush"),offPush:a(e=>this.offPush(e),"offPush"),createUrl:AGc,timeoutSignal:yGc,clearCache:a(()=>this.clearCache(),"clearCache"),cacheStats:a(()=>this.cacheStats(),"cacheStats"),ALPN_HTTP2:this.context.ALPN_HTTP2,ALPN_HTTP2C:this.context.ALPN_HTTP2C,ALPN_HTTP1_1:this.context.ALPN_HTTP1_1,ALPN_HTTP1_0:this.context.ALPN_HTTP1_0}}async fetch(e,r){return gGc(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on(G9r,e)}offPush(e){return this.eventEmitter.off(G9r,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){H9r(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new koe(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(H9r(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){H9r(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await rro(this,new koe(e,{headers:r}),n);this.eventEmitter.emit(G9r,e,o)}};nro.exports=new V9r().api()});var sro=I((rJh,oro)=>{"use strict";p();oro.exports=iro()});var wro=I((oem,xro)=>{"use strict";p();function Iro(t,e,r){let n=e[r];if(t==null&&n.required===!1)return;if(t==null)throw new TypeError(`Required parameter \`${n.name}\` missing`);let o=typeof t;if(n.type&&o!==n.type){if(n.required===!1&&e.slice(r).some(s=>s.type===o))return!1;throw new TypeError(`Invalid type for parameter \`${n.name}\`, expected \`${n.type}\` but found \`${typeof t}\``)}return!0}a(Iro,"validateParameter");function $Gc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a($Gc,"hasOwnProperty");function VGc(t,e){return function(){let r=Array.prototype.slice.call(arguments),n=[];for(let s=0,c=0;s{n.push((l,u)=>{if(l)return c(l);s(u)}),t.apply(this,n)});t.apply(this,n)}}a(VGc,"defineOperation");xro.exports={defineOperation:VGc,validateParameter:Iro}});var X9r=I((cem,Pro)=>{"use strict";p();var gCe=F9e()("kerberos"),mCe=gCe.KerberosClient,Rro=gCe.KerberosServer,QW=wro().defineOperation,WGc=1,zGc=2,YGc=4,KGc=8,JGc=16,ZGc=32,XGc=64,e$c=128,t$c=256,kro=0,r$c=9,n$c=6;mCe.prototype.step=QW(mCe.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);mCe.prototype.wrap=QW(mCe.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);mCe.prototype.unwrap=QW(mCe.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);Rro.prototype.step=QW(Rro.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var i$c=QW(gCe.checkPassword,[{name:"username",type:"string"},{name:"password",type:"string"},{name:"service",type:"string"},{name:"defaultRealm",type:"string",required:!1},{name:"callback",type:"function",required:!1}]),o$c=QW(gCe.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),s$c=QW(gCe.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:kro}},{name:"callback",type:"function",required:!1}]),a$c=QW(gCe.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);Pro.exports={initializeClient:s$c,initializeServer:a$c,principalDetails:o$c,checkPassword:i$c,GSS_C_DELEG_FLAG:WGc,GSS_C_MUTUAL_FLAG:zGc,GSS_C_REPLAY_FLAG:YGc,GSS_C_SEQUENCE_FLAG:KGc,GSS_C_CONF_FLAG:JGc,GSS_C_INTEG_FLAG:ZGc,GSS_C_ANON_FLAG:XGc,GSS_C_PROT_READY_FLAG:e$c,GSS_C_TRANS_FLAG:t$c,GSS_C_NO_OID:kro,GSS_MECH_OID_KRB5:r$c,GSS_MECH_OID_SPNEGO:n$c}});var Dro=I((uem,c$c)=>{c$c.exports={name:"kerberos",version:"2.2.0",description:"Kerberos library for Node.js",main:"lib/index.js",files:["lib","src","binding.gyp","HISTORY.md","README.md"],repository:{type:"git",url:"https://github.com/mongodb-js/kerberos.git"},keywords:["kerberos","security","authentication"],author:{name:"The MongoDB NodeJS Team",email:"dbx-node@mongodb.com"},bugs:{url:"https://jira.mongodb.org/projects/NODE/issues/"},dependencies:{bindings:"^1.5.0","node-addon-api":"^6.1.0","prebuild-install":"^7.1.2"},devDependencies:{"@types/node":"^22.2.0",chai:"^4.4.1","chai-string":"^1.5.0",chalk:"^4.1.2","clang-format":"^1.8.0","dmd-clear":"^0.1.2",eslint:"^9.9.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","jsdoc-to-markdown":"^8.0.3",mocha:"^10.7.3",mongodb:"^6.8.0","node-gyp":"^10.1.0",prebuild:"^13.0.0",prettier:"^3.3.3",request:"^2.88.2"},overrides:{prebuild:{"node-gyp":"$node-gyp"}},scripts:{install:"prebuild-install --runtime napi || node-gyp rebuild","format-cxx":"clang-format -i 'src/**/*'","format-js":"ESLINT_USE_FLAT_CONFIG=false eslint lib test --fix","check:lint":"ESLINT_USE_FLAT_CONFIG=false eslint lib test",precommit:"check-clang-format",docs:"jsdoc2md --template etc/README.hbs --plugin dmd-clear --files lib/kerberos.js > README.md",test:"mocha test",prebuild:"prebuild --runtime napi --strip --verbose --all"},engines:{node:">=12.9.0"},binary:{napi_versions:[4]},license:"Apache-2.0",readmeFilename:"README.md"}});var Mro=I((dem,Nro)=>{"use strict";p();var l$c=require("dns"),u$c=X9r(),e7r=class{static{a(this,"MongoAuthProcess")}constructor(e,r,n,o){o=o||{},this.host=e,this.port=r,this.serviceName=n||o.gssapiServiceName||"mongodb",this.canonicalizeHostName=typeof o.gssapiCanonicalizeHostName=="boolean"?o.gssapiCanonicalizeHostName:!1,this._transition=d$c(this),this.retries=10}init(e,r,n){let o=this;this.username=e,this.password=r;function s(c,l,u){if(!c)return u();l$c.resolveCname(l,(d,f)=>{if(d)return u(d);Array.isArray(f)&&f.length>0&&(o.host=f[0]),u()})}a(s,"performGssapiCanonicalizeHostName"),s(this.canonicalizeHostName,this.host,c=>{if(c)return n(c);let l={};r!=null&&Object.assign(l,{user:e,password:r});let u=process.platform==="win32"?`${this.serviceName}/${this.host}`:`${this.serviceName}@${this.host}`;u$c.initializeClient(u,l,(d,f)=>{if(d)return n(d,null);o.client=f,n(null,f)})})}transition(e,r){if(this._transition==null)return r(new Error("Transition finished"));this._transition(e,r)}};function d$c(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=f$c(t),r(null,o)})}}a(d$c,"firstTransition");function f$c(t){return(e,r)=>{t.client.step(e,(n,o)=>{if(n&&t.retries===0)return r(n);if(n)return t.retries=t.retries-1,t.transition(e,r);t._transition=p$c(t),r(null,o||"")})}}a(f$c,"secondTransition");function p$c(t){return(e,r)=>{t.client.unwrap(e,(n,o)=>{if(n)return r(n,!1);t.client.wrap(o,{user:t.username},(s,c)=>{if(s)return r(s,!1);t._transition=h$c(t),r(null,c)})})}}a(p$c,"thirdTransition");function h$c(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(h$c,"fourthTransition");Nro.exports={MongoAuthProcess:e7r}});var Lro=I((hem,l6e)=>{"use strict";p();var Oro=X9r();l6e.exports=Oro;l6e.exports.Kerberos=Oro;l6e.exports.version=Dro().version;l6e.exports.processes={MongoAuthProcess:Mro().MongoAuthProcess}});var lpo={};Ti(lpo,{AbortError:()=>e1,DirectConnectError:()=>Gk,DirectConnectTransport:()=>nqr,EXIT_REASONS:()=>YWc,HOOK_EVENTS:()=>iPt,InMemorySessionStore:()=>iQr,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>KWc,createSdkMcpServer:()=>wcl,deleteSession:()=>wfl,filterEscalatingDefaultMode:()=>pfl,foldSessionSummary:()=>rso,forkSession:()=>Rfl,getSessionInfo:()=>Tfl,getSessionMessages:()=>bfl,getSubagentMessages:()=>Nfl,importSessionToStore:()=>kfl,listSessions:()=>Sfl,listSubagents:()=>Dfl,parseDirectConnectUrl:()=>Pcl,query:()=>vfl,renameSession:()=>Ifl,resolveSettings:()=>mfl,startup:()=>Cfl,tagSession:()=>xfl,tool:()=>xcl});function hVc(t){return this[t]}function yVc(t,e){this[t]=AVc.bind(null,e)}function nQr(t=WWc){let e=new AbortController;return(0,Joo.setMaxListeners)(t,e.signal),e}function Zoo(t,e,r){return new Promise((n,o)=>{if(e?.aborted){r?.throwOnAbort||r?.abortError?o(r.abortError?.()??Error("aborted")):n();return}let s=setTimeout((l,u,d)=>{l?.removeEventListener("abort",u),d()},t,e,c,n);function c(){clearTimeout(s),r?.throwOnAbort||r?.abortError?o(r.abortError?.()??Error("aborted")):n()}a(c,"G"),e?.addEventListener("abort",c,{once:!0}),r?.unref&&s.unref()})}function zWc(t,e){t(Error(e))}function qoe(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(zWc,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function xqr(t,e){if(t.type!=="user"||t.isMeta===!0||t.isCompactSummary===!0)return;let r=t.message;if(!r)return;let n=r.content,o=[];if(typeof n=="string")o.push(n);else if(Array.isArray(n)){for(let s of n)if(!(!s||typeof s!="object")){if(s.type==="tool_result")return;s.type==="text"&&typeof s.text=="string"&&o.push(s.text)}}for(let s of o){let c=s.replaceAll(` -`," ").trim();if(!c)continue;let l=ZWc.exec(c);if(l){e.commandFallback||(e.commandFallback=l[1]);continue}let u=/([\s\S]*?)<\/bash-input>/.exec(c);if(u)return`! ${u[1].trim()}`;if(!JWc.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function rso(t,e,r,n){let o=n?.mtime??t?.mtime??0,s=t!==void 0?{sessionId:t.sessionId,mtime:o,data:{...t.data}}:{sessionId:e.sessionId,mtime:o,data:{}},c=s.data;for(let l of r){let u=rzc(l.timestamp);if(c.isSidechain===void 0&&(c.isSidechain=l.isSidechain===!0),c.createdAt===void 0&&u!==void 0&&(c.createdAt=u),c.cwd===void 0){let d=l.cwd;typeof d=="string"&&d&&(c.cwd=d)}nzc(c,l);for(let[d,f]of Object.entries(XWc)){let h=l[d];typeof h=="string"&&(c[f]=h)}if(l.type==="tag"){let d=l.tag;typeof d=="string"&&d?c.tag=d:delete c.tag}}return s}function ezc(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=GW(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=GW(r.customTitle)||GW(r.aiTitle)||void 0,s=o||GW(r.lastPrompt)||GW(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:GW(r.gitBranch)||void 0,cwd:GW(r.cwd)||e||void 0,tag:GW(r.tag)||void 0,createdAt:tzc(r.createdAt)}:null}function GW(t){return typeof t=="string"?t:void 0}function tzc(t){return typeof t=="number"?t:void 0}function rzc(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function nzc(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=xqr(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function nso(){return process.versions.bun!==void 0}function bE(t){if(!t)return!1;if(typeof t=="boolean")return t;let e=String(t).toLowerCase().trim();return["1","true","yes","on"].includes(e)}function vUe(){let t=new Set;return{subscribe(e){return t.add(e),()=>{t.delete(e)}},emit(...e){let r;for(let n of t)try{n(...e)}catch(o){(r??=[]).push(o)}if(r)throw r.length===1?r[0]:AggregateError(r,"Signal listener(s) threw")},clear(){t.clear()}}}function uzc(t){var e=czc.call(t,f6e),r=t[f6e];try{t[f6e]=void 0;var n=!0}catch{}var o=lzc.call(t);return n&&(e?t[f6e]=r:delete t[f6e]),o}function hzc(t){return pzc.call(t)}function yzc(t){return t==null?t===void 0?Azc:gzc:bno&&bno in Object(t)?dzc(t):mzc(t)}function _zc(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Szc(t){if(!N9(t))return!1;var e=CUe(t);return e==vzc||e==Czc||e==Ezc||e==bzc}function Izc(t){return!!Sno&&Sno in t}function kzc(t){if(t!=null){try{return Rzc.call(t)}catch{}try{return t+""}catch{}}return""}function Uzc(t){if(!N9(t)||xzc(t))return!1;var e=wqr(t)?Fzc:Nzc;return e.test(Pzc(t))}function qzc(t,e){return t?.[e]}function Hzc(t,e){var r=jzc(t,e);return Qzc(r)?r:void 0}function $zc(){this.__data__=V6e?V6e(null):{},this.size=0}function Wzc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Zzc(t){var e=this.__data__;if(V6e){var r=e[t];return r===Yzc?void 0:r}return Jzc.call(e,t)?e[t]:void 0}function rYc(t){var e=this.__data__;return V6e?e[t]!==void 0:tYc.call(e,t)}function oYc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=V6e&&e===void 0?iYc:e,this}function fbe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function _Yc(t,e){var r=this.__data__,n=sPt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function pbe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,s=n[2]||0,c=n[3]||0;return{browser:e,version:`${o}.${s}.${c}`}}}return null}function $Yc(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function dso(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function fso(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return dso({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function Nqr(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function VYc(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}function zYc(t){return Object.entries(t).filter(([e,r])=>typeof r<"u").map(([e,r])=>{if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return`${encodeURIComponent(e)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(e)}=`;throw new Ni(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function hso(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new mu(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new mu(`Refusing to send credential over non-https token endpoint "${t}"`)}async function mso(t,e){let r=await tKc(t),n;try{n=JSON.parse(r)}catch{throw new mu(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,$k(r),e)}if(!n.access_token)throw new mu(`Token endpoint response missing access_token: ${JSON.stringify($k(n))}`,t.status,$k(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new mu(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,$k(n),e);return n}function $k(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=T7r?t:t.slice(0,T7r)+`... <${t.length-T7r} more chars>`}return JSON.stringify($k(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))eKc.has(r)&&(e[r]=n);return e}return null}async function gso(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new mu(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new mu(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function Aso(t,e){let r=await import("node:fs"),n=(await import("node:path")).dirname(t);await r.promises.mkdir(n,{recursive:!0,mode:448});let o=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(e,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,t)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(n,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function tKc(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:s,value:c}=await e.read();if(s)break;if(n+c.length>Pno){let l=Pno-n;l>0&&r.push(c.subarray(0,l)),await e.cancel();break}r.push(c),n+=c.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((c,l)=>c+l.length,0));let s=0;for(let c of r)o.set(c,s),s+=c.length}return new TextDecoder("utf-8").decode(o)}function joe(){return Math.floor(Date.now()/1e3)}function rKc(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function Oqr(t){let e;return(Dno??(e=new globalThis.TextEncoder,Dno=e.encode.bind(e)))(t)}function Mno(t){let e;return(Nno??(e=new globalThis.TextDecoder,Nno=e.decode.bind(e)))(t)}function N6e(){}function sRt(t,e,r){return!e||jRt[t]>jRt[r]?N6e:e[t].bind(e)}function AA(t){let e=t.logger,r=t.logLevel??"off";if(!e)return nKc;let n=Lno.get(e);if(n&&n[0]===r)return n[1];let o={error:sRt("error",e,r),warn:sRt("warn",e,r),info:sRt("info",e,r),debug:sRt("debug",e,r)};return Lno.set(e,[r,o]),o}function _so(t){if(!t)throw Error("profile name is empty");if(t==="."||t==="..")throw Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw Error(`profile name "${t}" must not contain path separators`);if(!iKc.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function Bno(t){if(!t)throw new Ni("Identity token file path is empty");return async()=>{let e=await import("node:fs"),r;try{r=await e.promises.readFile(t,"utf-8")}catch(o){throw new Ni(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new Ni(`Identity token file at ${t} is empty`);return n}}function cKc(t){if(!t)throw new Ni("Identity token value is empty");return()=>t}function lKc(t){return async()=>{hso(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new mu(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:YYc,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${pso}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${qRt},${JYc}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${ZW} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new mu(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=$k(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new mu(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await mso(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new mu(`Token endpoint response missing required fields: ${JSON.stringify($k(c))}`,o.status,$k(c),s);return{token:c.access_token,expiresAt:joe()+l}}}function uKc(t){return async e=>{let r=await import("node:fs");await gso(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(_){throw new mu(`Credentials file not found at ${t.credentialsPath}: ${_}`)}let o;try{o=JSON.parse(n)}catch(_){throw new mu(`Credentials file at ${t.credentialsPath} is not valid JSON: ${_}`)}let s=o.access_token;if(!s)throw new mu(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||joe()"");throw new mu(`User OAuth refresh failed (HTTP ${f.status}): ${$k(_)}`,f.status,$k(_),h)}let m=await mso(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new mu(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify($k(m))}`,f.status,$k(m),h);let A=joe()+g,y=m.refresh_token||l;return await Aso(t.credentialsPath,{...o,version:yso,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function vso(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=fKc(t,r,n,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:o,extraHeaders:s,baseURL:t.base_url||void 0}}async function dKc(t,e){let r=await oKc(e);if(!r)return null;let{config:n,fromFile:o}=r,s=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await sKc(n,e)??void 0}};return vso(s,t)}function fKc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=pKc(o);if(!s)throw new mu("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new mu("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new mu("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=lKc({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:t.organization_id,serviceAccountId:o.service_account_id,workspaceId:t.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});return e?hKc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new mu("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return uKc({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new mu(`authentication.type "${o}" is not a known authentication type`)}}}function pKc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new mu(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new mu('identity_token.source "file" requires a non-empty path');return Bno(t.identity_token.path)}let e=pu("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return Bno(e);let r=pu("ANTHROPIC_IDENTITY_TOKEN");return r?cKc(r):null}function hKc(t,e,r,n){return async o=>{let s=await import("node:fs");await gso(e,n);let c;try{let u=await s.promises.readFile(e,"utf-8");c=JSON.parse(u);let d=c?.access_token;if(d&&!o?.forceRefresh){let f=c?.expires_at;if(f==null||joe()0&&(yield e)}function _Kc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function Cso(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return AA(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):zoe.fromSSEResponse(r,e.controller);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let l=r.headers.get("content-type")?.split(";")[0]?.trim();if(l?.includes("application/json")||l?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let u=await r.json();return bso(u,r)}return await r.text()})();return AA(t).debug(`[${n}] response parsed`,Uoe({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function bso(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}function BCe(t,e,r){return Sso(),new File(t,e??"unknown_file",r)}function IRt(t,e){let r=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?r.split(/[\\/]/).pop()||void 0:r}function EKc(t){let e=typeof t=="function"?t:t.fetch,r=Fno.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return Fno.set(e,n),n}async function TKc(t,e,r){if(Sso(),t=await t,e||(e=IRt(t,!0)),bKc(t))return t instanceof File&&e==null&&r==null?t:BCe([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(SKc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),BCe(await fQr(o),e,r)}let n=await fQr(t);if(!r?.type){let o=n.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(r={...r,type:o})}return BCe(n,e,r)}async function fQr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(Iso(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(Tso(t))for await(let r of t)e.push(...await fQr(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${IKc(t)}`)}return e}function IKc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*xKc(t){if(!t)return;if(xso in t){let{values:n,nulls:o}=t;yield*n.entries();for(let s of o)yield[s,null];return}let e=!1,r;t instanceof Headers?r=t.entries():Ino(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw TypeError("expected header name to be a string");let s=Ino(n[1])?n[1]:[n[1]],c=!1;for(let l of s)l!==void 0&&(e&&!c&&(c=!0,yield[o,null]),yield[o,l])}}function wso(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function xRt(t){return typeof t=="object"&&t!==null&&j6e in t}function Rso(t,e){let r=new Set;if(t)for(let n of t)xRt(n)&&r.add(n[j6e]);if(e){for(let n of e)if(xRt(n)&&r.add(n[j6e]),Array.isArray(n.content))for(let o of n.content)xRt(o)&&r.add(o[j6e])}return Array.from(r)}function kso(t,e){let r=Rso(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function RKc(t){return xRt(t)?{"x-stainless-helper":t[j6e]}:{}}function Dso(t){return t?.output_format??t?.output_config?.format}function Qno(t,e,r){let n=Dso(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null}:Nso(t,e,r)}function Nso(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=kKc(e,s.text);n===null&&(n=c);let l=Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function kKc(t,e){let r=Dso(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ni(`Failed to parse structured output: ${n}`)}}function Gno(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function Vno(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function LKc(t,e=t.messages.at(-1),r){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let n=e.content.filter(o=>o.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async o=>{let s=t.tools.find(c=>("name"in c?c.name:c.mcp_server_name)===o.name);if(!s||!("run"in s))return{type:"tool_result",tool_use_id:o.id,content:`Error: Tool '${o.name}' not found`,is_error:!0};try{let c=o.input;"parse"in s&&s.parse&&(c=s.parse(c));let l=await s.run(c,{toolUseBlock:o,signal:r?.signal});return{type:"tool_result",tool_use_id:o.id,content:l}}catch(c){return{type:"tool_result",tool_use_id:o.id,content:c instanceof ekt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function zno(t){if(!t.output_format)return t;if(t.output_config?.format)throw new Ni("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...r}=t;return{...r,output_config:{...t.output_config,format:e}}}function Oso(t){return t?.output_config?.format}function Yno(t,e,r){let n=Oso(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>o.type==="text"?Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1}):o),parsed_output:null}:Lso(t,e,r)}function Lso(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=FKc(e,s.text);return n===null&&(n=c),Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function FKc(t,e){let r=Oso(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ni(`Failed to parse structured output: ${n}`)}}function Xno(t){return t.type==="tool_use"||t.type==="server_tool_use"}function bUe(t){return t instanceof Error?t:Error(String(t))}function RRt(t){return t instanceof Error?t.message:String(t)}function ix(t){if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code}function SUe(t){return ix(t)==="ENOENT"}function Fso(t){return ix(t)==="EISDIR"}function jKc(t){let e=ix(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function $Kc(t,e,r){let n=`${t}.tmp.${(0,qso.randomBytes)(4).toString("hex")}`;try{await(0,SB.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,SB.rename)(n,t)}catch(o){let s=ix(o);if(s!==void 0&&HKc.has(s)){try{await(0,SB.copyFile)(n,t)}catch(c){throw GKc.has(ix(c)??"")&&await(0,SB.unlink)(t).catch(()=>{}),c}await(0,SB.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,SB.unlink)(n).catch(()=>{}),o}}function lkt(){return VKc.getStore()??new yQr}function jso(){if(xCe)return xCe;if(!bE(process.env.DEBUG_CLAUDE_AGENT_SDK))return Hoe=null,xCe=Promise.resolve(),xCe;let t=(0,AQr.join)(mbe(),"debug");return Hoe=(0,AQr.join)(t,`sdk-${(0,Uso.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${Hoe} -`),xCe=lkt().mkdir(t).catch(()=>{}),xCe}function WKc(){return jso(),Hoe??null}function jk(t){if(Hoe===null)return;let e=`${new Date().toISOString()} ${t} -`;jso().then(()=>{Hoe&&lkt().append(Hoe,e).catch(()=>{})})}function zKc(){this.__data__=new aPt,this.size=0}function KKc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function ZKc(t){return this.__data__.get(t)}function eJc(t){return this.__data__.has(t)}function nJc(t,e){var r=this.__data__;if(r instanceof aPt){var n=r.__data__;if(!sso||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=kJc}function rZc(t){return Abe(t)&&qqr(t.length)&&!!Md[CUe(t)]}function iZc(t){return function(e){return t(e)}}function dZc(t,e){var r=iz(t),n=!r&&Z6e(t),o=!r&&!n&&Qqr(t),s=!r&&!n&&!o&&Wso(t),c=r||n||o||s,l=c?hJc(t.length,String):[],u=l.length;for(var d in t)(e||uZc.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||lPt(d,u)))&&l.push(d);return l}function hZc(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||pZc;return t===r}function mZc(t,e){return function(r){return t(e(r))}}function AZc(t){return t!=null&&qqr(t.length)&&!wqr(t)}function yZc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function CZc(t){if(!N9(t))return _Zc(t);var e=zso(t),r=[];for(var n in t)n=="constructor"&&(e||!vZc.call(t,n))||r.push(n);return r}function SZc(t){return jqr(t)?fZc(t,!0):bZc(t)}function IZc(t,e){if(e)return t.slice();var r=t.length,n=aio?aio(r):new t.constructor(r);return t.copy(n),n}function xZc(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r{let y=u;u=null,y&&f(y.join(""))})}return a(g,"N"),{write(A){if(o){f(A);return}s.push(A),c+=A.length,m(),(s.length>=r||c>=n)&&g()},flush:h,dispose(){h()}}}function FXc(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function QXc(t){return UXc.register(t)}function jXc(t){let e=[],r=t.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])e.push("mcp"),e.push(r[1].toLowerCase());else{let s=t.match(/^([^:[]+):/);s&&s[1]&&e.push(s[1].trim().toLowerCase())}let n=t.match(/^\[([^\]]+)]/);n&&n[1]&&e.push(n[1].trim().toLowerCase()),t.toLowerCase().includes("1p event:")&&e.push("1p");let o=t.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(o&&o[1]){let s=o[1].trim().toLowerCase();s.length<30&&!s.includes(" ")&&e.push(s)}return Array.from(new Set(e))}function HXc(t,e){return e?t.length===0?!1:e.isExclusive?!t.some(r=>e.exclude.includes(r)):t.some(r=>e.include.includes(r)):!0}function GXc(t,e){if(!e)return!0;let r=jXc(t);return HXc(r,e)}function $Xc(t){return/^[\\/]{2}/.test(t)}function VXc(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function fio(t){try{return VXc(nao.realpathSync.native(t))}catch{return null}}function WXc(t,e){let r=(0,TB.resolve)(e).toLowerCase(),n=(0,TB.resolve)(t).toLowerCase();if((0,TB.dirname)(n)===r||n.startsWith(r+TB.sep))return!0;let o=fio(e)?.toLowerCase();if(o==null)return!1;let s=fio((0,TB.dirname)((0,TB.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+TB.sep)}function iao(t,e){if($Xc(e))return{resolvedPath:e,isSymlink:!1,isCanonical:!1};try{let r=t.lstatSync(e);if(r.isFIFO()||r.isSocket()||r.isCharacterDevice()||r.isBlockDevice())return{resolvedPath:e,isSymlink:!1,isCanonical:!1};let n=t.realpathSync(e);return{resolvedPath:n,isSymlink:n!==e,isCanonical:!0}}catch{return{resolvedPath:e,isSymlink:!1,isCanonical:!1}}}function ox(){return YXc}function KXc(t,e){t.destroyed||t.write(e)}function JXc(t){KXc(process.stderr,t)}function ZXc(t){return t.charAt(0).toUpperCase()+t.slice(1)}function XXc(t,e,r=e+"s"){return t===1?e:r}function eel(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function iel(t){return nel.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function oel(t){mio??=iel(!0);for(let e of mio)t=t.replace(e.re,(r,n)=>{if(typeof n!="string")return"[REDACTED]";let o=n.length>=2&&(n[0]==='"'||n[0]==="'")&&n.at(-1)===n[0]?n[0]:"",s=r.lastIndexOf(n);return`${r.slice(0,s)}${o}[REDACTED]${o}${r.slice(s+n.length)}`});return t}function dPt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function lel(t){if(!bQr()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=cel();return GXc(t,e)}async function aao(t,e,r=del){if(w6e<0?w6e=await(0,IE.stat)(t).then(n=>n.size).catch(()=>0):w6e+=e,!(w6e<=r||B7r)){B7r=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,IE.rename)(t,n)}catch(o){SUe(o)||(await(0,IE.unlink)(n).catch(()=>{}),await(0,IE.rename)(t,n).catch(()=>(0,IE.unlink)(t).catch(()=>{})))}w6e=0}finally{B7r=!1}}}function cao(t){return SQr=(0,tse.join)(t,`${rao()}.txt`),SQr}async function fel(t,e,r,n){t&&await(0,IE.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,IE.appendFile)(r,n)}catch(s){if(!Fso(s))throw s;o=cao(r),await(0,IE.appendFile)(o,n)}await aao(o,Buffer.byteLength(n)).catch(TQr),uao()}function TQr(){}function pel(){if(!vRt){let t=null;vRt=BXc({writeFn:a(e=>{let r=lao(),n=(0,tse.dirname)(r),o=t!==n;if(t=n,bQr()){if(o)try{ox().mkdirSync(n)}catch{}let s=r;try{ox().appendFileSync(r,e)}catch(c){if(!Fso(c))throw c;s=cao(r),ox().appendFileSync(s,e)}aao(s,Buffer.byteLength(e)).catch(TQr),uao();return}L7r=L7r.then(fel.bind(null,o,n,r,e)).catch(TQr)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:bQr()}),QXc(async()=>{vRt?.dispose(),await L7r})}return vRt}function hu(t,{level:e}={level:"debug"}){if(CQr[e]t.endsWith(e))}function bel(t,e){return(0,eso.existsSync)(t)?e?`Claude Code native binary at ${t} exists but failed to launch.`:`Claude Code executable at ${t} exists but failed to launch.`:e?`Claude Code native binary not found at ${t}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${t}. Is options.pathToClaudeCodeExecutable set?`}function Sel(){if(process.platform!=="linux")return!1;let t=typeof process.report?.getReport=="function"?process.report.getReport():null;return t!=null&&t.header?.glibcVersionRuntime===void 0}function Tel(t,e=process.platform,r=process.arch,n=dao.existsSync,o=Sel()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${wCe}-linux-${r}-android`]:e==="linux"?o?[`${wCe}-linux-${r}-musl`,`${wCe}-linux-${r}`]:[`${wCe}-linux-${r}`,`${wCe}-linux-${r}-musl`]:[`${wCe}-${e}-${r}`]).map(l=>`${l}/claude${s}`);for(let l of c)try{let u=t(l);if(n(u))return u}catch{}return null}function Iel(){return{eventQueue:[],sink:null}}function zqr(t,e){let r=xel;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function fao(t){zqr("tengu_feature_ok",{feature_name:t})}function pao(t,e,r){zqr("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function wel(t,e,r){zqr("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function I9(t,e,r){try{let n=await e();return fao(t),n}catch(n){throw pao(t,r?.(n)??"error"),n}}function kel(t){let e=t,r="",n=0,o=10;for(;e!==r&&n=o)throw Error(`Unicode sanitization reached maximum iterations (${o}) for input: ${t.slice(0,100)}`);return e}function G6e(t){if(typeof t=="string")return kel(t);if(Array.isArray(t))return t.map(G6e);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[G6e(r)]=G6e(n);return e}return t}function Pel(){return process.platform==="win32"}function Nel(t){let e=F7r.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,_ao.join)(r,"System32","where.exe");try{let o=(0,yao.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:Del,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!WXc(c,s))return F7r.set(t,c),c;return null}catch(o){return Mel(o)&&F7r.set(t,null),null}}function Mel(t){if(t===null||typeof t!="object")return!1;let e="status"in t?t.status:void 0,r="signal"in t?t.signal:void 0,n="code"in t?t.code:void 0;return e===1&&!r&&!n}function Oel(t){return!Pel()||t.includes("/")||t.includes("\\")?t:Nel(t)}async function TUe(t){let e=Oel("git");if(e===null)return[];try{let{stdout:r}=await Lel(e,["worktree","list","--porcelain"],{cwd:t,timeout:5e3});return r?r.split(` -`).filter(n=>n.startsWith("worktree ")).map(n=>n.slice(9).normalize("NFC")):[]}catch{return[]}}function Bel(t){let e=0;for(let r=0;ro&&(n=Eao(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function PQr(t,e){let r=(0,mao.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` -`)||await(0,kQr.once)(r,"drain");r.end(),await(0,kQr.once)(r,"finish")}catch(n){throw r.destroy(),n}}function vao(t){let e=0,r={commandFallback:""};for(;e=0?t.slice(e,n):t.slice(e);if(e=n>=0?n+1:t.length,!(!o.includes('"type":"user"')&&!o.includes('"type": "user"'))&&!o.includes('"tool_result"')&&!(o.includes('"isMeta":true')||o.includes('"isMeta": true'))&&!(o.includes('"isCompactSummary":true')||o.includes('"isCompactSummary": true')))try{let s=JSON.parse(o),c=xqr(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function Uel(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=xqr(r,e);if(n!==void 0)return n}return e.commandFallback}async function Cao(t){try{let e=await(0,AM.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe(k9),o=await e.read(n,0,k9,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-k9),l=s;if(c>0){let u=await e.read(n,0,k9,c);l=n.toString("utf8",0,u.bytesRead)}return{mtime:r.mtime.getTime(),size:r.size,head:s,tail:l}}finally{await e.close()}}catch{return null}}function Qel(t){return Math.abs(Bel(t)).toString(36)}function IUe(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=X6e?e:`${e.slice(0,X6e)}-${Qel(t)}`}function lz(){return(0,VCe.join)(mbe(),"projects")}function qel(t){return(0,VCe.join)(lz(),IUe(t))}async function xUe(t){try{return(await(0,AM.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function mM(t){let e=qel(t),r=[];try{await(0,AM.readdir)(e),r.push(e)}catch{}let n=IUe(t);if(n.length<=X6e)return r;let o=n.slice(0,X6e)+"-",s=lz();try{for(let c of await(0,AM.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,VCe.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function fPt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,VCe.join)(c,r);try{let d=await(0,AM.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await xUe(e);for(let u of await mM(c)){let d=await n(u,c);if(d)return d}let l;try{l=await TUe(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await mM(u)){let f=await n(d,u);if(f)return f}return}let o=lz(),s;try{s=await(0,AM.readdir)(o)}catch{return}for(let c of s){let l=await n((0,VCe.join)(o,c),void 0);if(l)return l}}function $el(){return Gel??=Buffer.from('"compact_boundary"')}function bao(t){try{let e=JSON.parse(t);return e.type!=="system"||e.subtype!=="compact_boundary"?null:{hasPreservedSegment:!!(e.compactMetadata?.preservedSegment||e.compactMetadata?.preservedMessages)}}catch{return null}}function Goe(t,e,r,n){let o=n-r;if(!(o<=0)){if(t.len+o>t.buf.length){let s=Buffer.allocUnsafe(Math.min(Math.max(t.buf.length*2,t.len+o),t.cap));t.buf.copy(s,0,0,t.len),t.buf=s}e.copy(t.buf,t.len,r,n),t.len+=o}}function mkt(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function Yel(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(eUe);if(o===-1||o>=r)return 0;let s=o+1;if(mkt(n,gkt,0,t.carryLen))t.straddleSnapCarryLen=t.carryLen,t.straddleSnapTailEnd=s,t.lastSnapSrc=null;else{if(t.carryLen=s&&nt.lastSnapBuf.length)&&(t.lastSnapBuf=Buffer.allocUnsafe(t.lastSnapLen)),e.copy(t.lastSnapBuf,0,n,o),t.lastSnapSrc=t.lastSnapBuf):t.straddleSnapCarryLen>0&&(t.lastSnapLen=t.straddleSnapCarryLen+t.straddleSnapTailEnd,(t.lastSnapBuf===void 0||t.lastSnapLen>t.lastSnapBuf.length)&&(t.lastSnapBuf=Buffer.allocUnsafe(t.lastSnapLen)),t.carryBuf.copy(t.lastSnapBuf,0,0,t.straddleSnapCarryLen),r.copy(t.lastSnapBuf,t.straddleSnapCarryLen,0,t.straddleSnapTailEnd),t.lastSnapSrc=t.lastSnapBuf)}function Zel(t,e,r){t.carryLen=e.length-r,t.carryLen>0&&((t.carryBuf===void 0||t.carryLen>t.carryBuf.length)&&(t.carryBuf=Buffer.allocUnsafe(t.carryLen)),e.copy(t.carryBuf,0,r,e.length))}function Xel(t){if(t.carryLen>0){let e=t.carryBuf;mkt(e,gkt,0,t.carryLen)?(t.lastSnapSrc=e,t.lastSnapLen=t.carryLen):Goe(t.out,e,0,t.carryLen)}t.lastSnapSrc&&(t.out.len>0&&t.out.buf[t.out.len-1]!==eUe&&Goe(t.out,Wel,0,1),Goe(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function etl(t,e){let r=$el(),n=jel,o={out:{buf:Buffer.allocUnsafe(Math.min(e,8388608)),len:0,cap:e+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},s=Buffer.allocUnsafe(n),c=await(0,AM.open)(t,"r");try{let l=0;for(;l0){let m=o.carryLen+(u-d);f=Buffer.allocUnsafe(m),o.carryBuf.copy(f,0,0,o.carryLen),s.copy(f,o.carryLen,d,u)}else f=s.subarray(d,u);let h=Kel(o,f,r);Jel(o,f,s,h.lastSnapStart,h.lastSnapEnd),Zel(o,f,h.trailStart),o.bufFileOff+=h.trailStart}Xel(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function ttl(t,e){try{return e>Hel&&!bE(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await etl(t,e)).postBoundaryBuf:await(0,hao.readFile)(t)}catch{return null}}function rtl(t){let e=[];try{let o=pf(e,mf`parseTranscriptEntries(${t.length} bytes)`,0),s=[],c=10,l=t.length,u=0;for(;u=d)continue;let h=t.toString("utf-8",f,d);try{let m=gel(h),g=m.type;(g==="user"||g==="assistant"||g==="progress"||g==="system"||g==="attachment")&&typeof m.uuid=="string"&&s.push(m)}catch{}}return s}catch(o){var r=o,n=1}finally{hf(e,r,n)}}function ntl(t){let e=new Map;for(let m of t)e.set(m.uuid,m);for(let m of e.values()){if(m.type!=="system"||m.subtype!=="compact_boundary")continue;let g=m.compactMetadata?.preservedMessages,A=m.compactMetadata?.preservedSegment;if(g){if(g.uuids.length===0||g.uuids.some(v=>!e.has(v)))continue;let y=g.anchorUuid;for(let v of g.uuids){let S=e.get(v);e.set(v,{...S,parentUuid:y}),y=v}let _=g.uuids[0],E=g.uuids.at(-1);for(let[v,S]of e)S.parentUuid===g.anchorUuid&&v!==_&&e.set(v,{...S,parentUuid:E})}else if(A){let y=e.get(A.headUuid);y&&e.set(A.headUuid,{...y,parentUuid:A.anchorUuid});for(let[_,E]of e)E.parentUuid===A.anchorUuid&&_!==A.headUuid&&e.set(_,{...E,parentUuid:A.tailUuid})}}let r=new Map;for(let m=0;m!n.has(m.uuid)),s=[];for(let m of o){let g=m,A=new Set;for(;g&&!A.has(g.uuid);){if(A.add(g.uuid),g.type==="user"||g.type==="assistant"){s.push(g);break}g=g.parentUuid?e.get(g.parentUuid):void 0}}if(s.length===0)return[];let c=s.filter(m=>!m.isSidechain&&!m.teamName&&!m.isMeta),l=a(m=>m.reduce((g,A)=>(r.get(A.uuid)??-1)>(r.get(g.uuid)??-1)?A:g),"U"),u=c.length>0?l(c):l(s),d=[],f=new Set,h=e.get(u.uuid);for(;h&&!f.has(h.uuid);)f.add(h.uuid),d.push(h),h=h.parentUuid?e.get(h.parentUuid):void 0;return d.reverse(),otl(e,d,f)}function Q7r(t){if(t.type!=="assistant")return;let e=t.message;if(typeof e!="object"||e===null)return;let r=e.id;return typeof r=="string"?r:void 0}function itl(t){if(t.type!=="user"||!t.parentUuid)return!1;let e=t.message;if(typeof e!="object"||e===null)return!1;let r=e.content;return Array.isArray(r)?r.some(n=>typeof n=="object"&&n!==null&&n.type==="tool_result"):!1}function otl(t,e,r){let n=e.filter(h=>h.type==="assistant");if(n.length===0)return e;let o=new Map;for(let h of n){let m=Q7r(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=Q7r(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(itl(h)){let g=h.parentUuid,A=c.get(g);A?A.push(h):c.set(g,[h])}}let l=new Set,u=new Map,d=0;for(let h of n){let m=Q7r(h);if(!m||l.has(m))continue;l.add(m);let g=s.get(m)??[h],A=g.filter(S=>!r.has(S.uuid)),y=[];for(let S of g){let T=c.get(S.uuid);if(T)for(let w of T)r.has(w.uuid)||y.push(w)}if(A.length===0&&y.length===0)continue;let _=a((S,T)=>(S.timestamp??"").localeCompare(T.timestamp??""),"D");A.sort(_),y.sort(_);let E=o.get(m),v=[...A,...y];for(let S of v)r.add(S.uuid);d+=v.length,u.set(E.uuid,v)}if(d===0)return e;let f=[];for(let h of e){f.push(h);let m=u.get(h.uuid);m&&f.push(...m)}return f}function stl(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function Sao(t,e){return{type:t.type,uuid:t.uuid,session_id:t.sessionId,message:t.message,parent_tool_use_id:e??null,timestamp:t.timestamp}}function Tao(t,e){let r=e?.offset??0;return e?.limit!==void 0&&e.limit>0?t.slice(r,r+e.limit):r>0?t.slice(r):t}function atl(t,e){let r=[];for(let n of t){if(typeof n!="object"||n===null)continue;let o=n,s=o.type;(s==="user"||s==="assistant"||s==="progress"||s==="system"||s==="attachment")&&typeof o.uuid=="string"&&r.push(o)}return Iao(r,e)}function Iao(t,e){let r=ntl(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>stl(s,n)).map(s=>Sao(s));return Tao(o,e)}async function ctl(t,e){if(!Uh(t))return[];let r=await fPt(t,e?.dir);if(!r)return[];let n=await ttl(r.filePath,r.fileSize);return n?Iao(rtl(n),e):[]}function pPt(t,e,r){let{head:n,tail:o,mtime:s,size:c}=e,l=n.indexOf(` -`),u=l>=0?n.slice(0,l):n;if(u.includes('"isSidechain":true')||u.includes('"isSidechain": true'))return null;let d=Hk(o,"customTitle")||Hk(n,"customTitle")||Hk(o,"aiTitle")||Hk(n,"aiTitle")||void 0,f=vao(n)||void 0,h=U7r(n,"timestamp"),m;if(h){let v=Date.parse(h);Number.isNaN(v)||(m=v)}let g=d||Hk(o,"lastPrompt")||Hk(o,"summary")||f;if(!g)return null;let A=Hk(o,"gitBranch")||U7r(n,"gitBranch")||void 0,y=U7r(n,"cwd")||r||void 0,_=o.split(` -`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),E=_&&Hk(_,"tag")||void 0;return{sessionId:t,summary:g,lastModified:s,fileSize:c,customTitle:d,firstPrompt:f,gitBranch:A,cwd:y,tag:E,createdAt:m}}async function F6e(t,e,r){let n;try{n=await(0,ybe.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=Uh(o.slice(0,-6));if(!s)return null;let c=(0,_be.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,ybe.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function xao(t){let e=await Cao(t.filePath);if(!e)return null;let r=pPt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function utl(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function dtl(t,e,r){t.sort(utl);let n=[],o=e&&e>0?e:1/0,s=0,c=new Set;for(let l=0;ls.lastModified)&&r.set(o.sessionId,o)}let n=[...r.values()];return n.sort((o,s)=>s.lastModified!==o.lastModified?s.lastModified-o.lastModified:s.sessionIdo.sessionId?1:0),n}async function ptl(t,e,r){let n=await xUe(t),o;if(e)try{o=await TUe(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await mM(n))h.push(...await F6e(m,r,n));return h}let s=lz(),c=process.platform==="win32",l=o.map(h=>{let m=IUe(h);return{path:h,prefix:c?m.toLowerCase():m}});l.sort((h,m)=>m.prefix.length-h.prefix.length);let u;try{u=await(0,ybe.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await mM(n))h.push(...await F6e(m,r,n));return h}let d=[],f=new Set;for(let h of await mM(n)){let m=(0,_be.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await F6e(h,r,n))}for(let h of u){if(!h.isDirectory())continue;let m=c?h.name.toLowerCase():h.name;if(!f.has(m)){for(let{path:g,prefix:A}of l)if(m===A||A.length>=X6e&&m.startsWith(A+"-")){f.add(m),d.push(...await F6e((0,_be.join)(s,h.name),r,g));break}}}return d}async function htl(t){let e=lz(),r;try{r=await(0,ybe.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>F6e((0,_be.join)(e,n.name),t)))).flat()}async function mtl(t){let{dir:e,limit:r,offset:n,includeWorktrees:o}=t??{},s=n??0,c=r!==void 0&&r>0||s>0,l=e?await ptl(e,o??!0,c):await htl(c);return c?dtl(l,r,s):ftl(l)}async function gtl(t,e={}){let r=Uh(t);if(!r)return;let n=await fPt(r,e.dir);if(!n)return;let o=await Cao(n.filePath);if(o)return pPt(r,o,n.projectPath)??void 0}async function Atl(t,e,r={}){if(!Uh(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=Xm({type:"custom-title",customTitle:e.trim(),sessionId:t})+` -`;await wao(t,n,r)}async function ytl(t,e,r={}){if(!Uh(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=G6e(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=Xm({type:"tag",tag:e??"",sessionId:t})+` -`;await wao(t,n,r)}async function _tl(t,e={}){if(!Uh(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await Etl(e)){let n=(0,$oe.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,IB.stat)(n))}catch(s){let c=ix(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,IB.rm)(n,{force:!0}),await(0,IB.rm)((0,$oe.join)(r,t),{recursive:!0,force:!0});return}}throw Error(e.dir?`Session ${t} not found in project directory for ${e.dir}`:`Session ${t} not found in any project directory`)}async function Etl(t){if(t.dir){let r=await xUe(t.dir),n=await mM(r),o;try{o=await TUe(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await mM(s));return n}let e=lz();try{return(await(0,IB.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,$oe.join)(e,r.name))}catch{return[]}}async function wao(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await xUe(r.dir);for(let u of await mM(c))if(await q7r((0,$oe.join)(u,n),e))return;let l;try{l=await TUe(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await mM(u))if(await q7r((0,$oe.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=lz(),s;try{s=await(0,IB.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await q7r((0,$oe.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function q7r(t,e){let r;try{r=await(0,IB.open)(t,DQr.constants.O_WRONLY|DQr.constants.O_APPEND)}catch(n){let o=ix(n);if(o==="ENOENT"||o==="ENOTDIR")return!1;throw n}try{let{size:n}=await r.stat();if(n===0)return!1;let o=process.platform==="win32"?n:void 0;return await r.write(e,o,"utf8"),!0}finally{await r.close()}}async function vtl(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await lkt().readBytes((0,Akt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await xUe(e);for(let u of await mM(c)){let d=await n(u);if(d)return d}let l;try{l=await TUe(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await mM(u)){let f=await n(d);if(f)return f}return null}let o=lz(),s;try{s=await lkt().list(o)}catch{return null}for(let c of s){let l=await n((0,Akt.join)(o,c));if(l)return l}return null}function btl(t,e){let r=[],n=[],o=10,s=t.length,c=0;for(;c=l)continue;let d=t.toString("utf-8",u,l);try{Rao(CM(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function Stl(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||Rao(o,e,r,n);return{transcript:r,contentReplacements:n}}function Rao(t,e,r,n){Ctl.has(t.type)&&typeof t.uuid=="string"?r.push(t):t.type==="content-replacement"&&t.sessionId===e&&Array.isArray(t.replacements)&&n.push(...t.replacements)}async function Ttl(t,e={}){if(!Uh(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!Uh(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await vtl(t,e.dir);if(!r)throw Error(e.dir?`Session ${t} not found in project directory for ${e.dir}`:`Session ${t} not found`);let{entries:n,forkedSessionId:o}=Itl(r.buf,t,e);return await PQr((0,Akt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function Itl(t,e,r){let n=btl(t,e);return kao(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,k9)),c=t.toString("utf-8",Math.max(0,o-k9));return Hk(c,"customTitle")||Hk(s,"customTitle")||Hk(c,"aiTitle")||Hk(s,"aiTitle")||vao(s)})}function xtl(t,e,r){let n=Stl(t,e);return kao(n,e,r,()=>wtl(t))}function wtl(t){let e,r;for(let n of t){if(typeof n!="object"||n===null)continue;let o=n;typeof o.customTitle=="string"&&o.customTitle&&(e=o.customTitle),typeof o.aiTitle=="string"&&o.aiTitle&&(r=o.aiTitle)}return e||r||Uel(t)||void 0}function kao(t,e,r,n){let o=t.transcript.filter(m=>!m.isSidechain);if(o.length===0)throw Error(`Session ${e} has no messages to fork`);if(r.upToMessageId){let m=o.findIndex(g=>g.uuid===r.upToMessageId);if(m===-1)throw Error(`Message ${r.upToMessageId} not found in session ${e}`);o=o.slice(0,m+1)}let s=new Map;for(let m of o)s.set(m.uuid,(0,U6e.randomUUID)());let c=o.filter(m=>m.type!=="progress");if(c.length===0)throw Error(`Session ${e} has no messages to fork`);let l=new Map;for(let m of o)l.set(m.uuid,m);let u=(0,U6e.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,U6e.randomUUID)(),timestamp:d});let h=r.title?.trim();return h||(h=`${n()||"Forked session"} (fork)`),f.push({type:"custom-title",sessionId:u,customTitle:h,uuid:(0,U6e.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function Pao(t,e){let r=await fPt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,ykt.join)(n,"subagents")}async function Dao(t){let e=[];async function r(n){let o;try{o=await(0,tUe.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o)if(s.isFile()&&s.name.startsWith("agent-")&&s.name.endsWith(".jsonl")){let c=s.name.slice(6,-6);e.push({agentId:c,filePath:(0,ykt.join)(n,s.name)})}else s.isDirectory()&&await r((0,ykt.join)(n,s.name))}return a(r,"J"),await r(t),e}function Rtl(t){let e=[],r=10,n=t.length,o=0;for(;o=s)continue;let l=t.toString("utf-8",c,s);try{let u=CM(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function ktl(t){if(t.length===0)return[];let e=new Map;for(let c of t)e.set(c.uuid,c);let r=t.findLast(c=>c.type==="user"||c.type==="assistant");if(!r)return[];let n=[],o=new Set,s=r;for(;s&&!o.has(s.uuid);)o.add(s.uuid),n.push(s),s=s.parentUuid?e.get(s.parentUuid):void 0;return n.reverse(),n}async function Ptl(t,e){if(!Uh(t))return[];let r=await Pao(t,e?.dir);return r?(await Dao(r)).map(n=>n.agentId):[]}async function Dtl(t,e,r){if(!Uh(t))return[];if(!e)return[];let n=await Pao(t,r?.dir);if(!n)return[];let o=(await Dao(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,tUe.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=CM(await(0,tUe.readFile)(l,"utf-8")).toolUseId}catch{}return Nao(s,r,c)}function Nao(t,e,r){if(t.length===0)return[];let n=Rtl(t),o=ktl(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>Sao(s,r));return Tao(o,e)}function Lao(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function Bao(t){return[...new Set(t)]}function Ntl(){return"prod"}function Utl(){let t=process.env.CLAUDE_LOCAL_OAUTH_API_BASE?.replace(/\/$/,"")??"http://localhost:8000",e=process.env.CLAUDE_LOCAL_OAUTH_APPS_BASE?.replace(/\/$/,"")??"http://localhost:4000",r=process.env.CLAUDE_LOCAL_OAUTH_CONSOLE_BASE?.replace(/\/$/,"")??"http://localhost:3000";return{BASE_API_URL:t,CONSOLE_AUTHORIZE_URL:`${r}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${e}/oauth/authorize`,CLAUDE_AI_ORIGIN:e,TOKEN_URL:`${t}/v1/oauth/token`,API_KEY_URL:`${t}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${t}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${r}/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`${r}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${r}/oauth/code/callback`,CLIENT_ID:"22422756-60c9-4084-8eb7-27705fd5cf9a",OAUTH_FILE_SUFFIX:"-local-oauth",MCP_PROXY_URL:"http://localhost:8205",MCP_PROXY_PATH:"/v1/toolbox/shttp/mcp/{server_id}"}}function qtl(){let t=(()=>{switch(Ntl()){case"local":return Utl();case"staging":return Ftl??yio;case"prod":return yio}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!Qtl.includes(n))throw Error("CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.");t={...t,BASE_API_URL:n,CONSOLE_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_ORIGIN:n,TOKEN_URL:`${n}/v1/oauth/token`,API_KEY_URL:`${n}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${n}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${n}/oauth/code/callback`,OAUTH_FILE_SUFFIX:"-custom-oauth"}}let r=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;return r&&(t={...t,CLIENT_ID:r}),t}function Htl(t=""){let e=process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR,r=e!==void 0?!e:!process.env.CLAUDE_CONFIG_DIR,n=e!==void 0?e.normalize("NFC"):mbe(),o=r?"":`-${(0,Mao.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${qtl().OAUTH_FILE_SUFFIX}${t}${o}`}function $tl(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,Oao.userInfo)().username}catch{t="claude-code-user"}return Gtl.test(t)?t:"claude-code-user"}function NQr(){return Wtl}function hn(t,e){let r=NQr(),n=MQr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===rUe?void 0:rUe].filter(o=>!!o)});t.common.issues.push(n)}function ns(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:a((s,c)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??c.defaultError}:typeof c.data>"u"?{message:l??n??c.defaultError}:s.code!=="invalid_type"?{message:c.defaultError}:{message:l??r??c.defaultError}},"errorMap"),description:o}}function Qao(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function url(t){return new RegExp(`^${Qao(t)}$`)}function drl(t){let e=`${Uao}T${Qao(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function frl(t,e){return!!((e==="v4"||!e)&&nrl.test(t)||(e==="v6"||!e)&&orl.test(t))}function prl(t,e){if(!Xtl.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function hrl(t,e){return!!((e==="v4"||!e)&&irl.test(t)||(e==="v6"||!e)&&srl.test(t))}function mrl(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}function DCe(t){if(t instanceof sx){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=zk.create(DCe(n))}return new sx({...t._def,shape:a(()=>e,"shape")})}else return t instanceof sz?new sz({...t._def,type:DCe(t.element)}):t instanceof zk?zk.create(DCe(t.unwrap())):t instanceof O9?O9.create(DCe(t.unwrap())):t instanceof M9?M9.create(t.items.map(e=>DCe(e))):t}function LQr(t,e){let r=KW(t),n=KW(e);if(t===e)return{valid:!0,data:t};if(r===Dn.object&&n===Dn.object){let o=bc.objectKeys(e),s=bc.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=LQr(t[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(r===Dn.array&&n===Dn.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;sr?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}function _C(t){return t&&Object.assign(Ckt,t),Ckt}function Arl(t){return t}function yrl(t){return t}function _rl(t){}function Erl(t){throw Error()}function vrl(t){}function Jqr(t){let e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,n])=>e.indexOf(+r)===-1).map(([r,n])=>n)}function Kr(t,e="|"){return t.map(r=>gs(r)).join(e)}function $ao(t,e){return typeof e=="bigint"?e.toString():e}function hPt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function rse(t){return t==null}function mPt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Vao(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}function sl(t,e,r){Object.defineProperty(t,e,{get(){{let n=r();return t[e]=n,n}throw Error("cached value already set")},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function Zqr(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Crl(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function brl(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;se,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}function xrl(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function gs(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Yao(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function wrl(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return bM(t,{...t._zod.def,shape:r,checks:[]})}function Rrl(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return bM(t,{...t._zod.def,shape:r,checks:[]})}function krl(t,e){if(!hUe(e))throw Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return Zqr(this,"shape",n),n},checks:[]};return bM(t,r)}function Prl(t,e){return bM(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return Zqr(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function Drl(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return bM(e,{...e._zod.def,shape:o,checks:[]})}function Nrl(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return bM(e,{...e._zod.def,shape:o,checks:[]})}function FCe(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function q6e(t){return typeof t=="string"?t:t?.message}function _M(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=q6e(t.inst?._zod.def?.error?.(t))??q6e(e?.error?.(t))??q6e(r.customError?.(t))??q6e(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function gPt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function APt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Zao(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function Mrl(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function tjr(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}function rjr(t,e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>o({issues:l}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;u{var l,u;for(let d of s.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>o({issues:f},d.path));else if(d.code==="invalid_key")o({issues:d.issues},d.path);else if(d.code==="invalid_element")o({issues:d.issues},d.path);else{let f=[...c,...d.path];if(f.length===0){n.errors.push(r(d));continue}let h=n,m=0;for(;mn.path.length-o.path.length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${tco(n.path)}`);return e.join(` -`)}function fco(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function Cco(t){return typeof t.precision=="number"?t.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":t.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${t.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function bco(t){return new RegExp(`^${Cco(t)}$`)}function Sco(t){let e=Cco({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Eco}T(?:${n})$`)}function bio(t,e,r){t.issues.length&&e.issues.push(...Vk(r,t.issues))}function djr(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function Elo(t){if(!cjr.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return djr(r)}function blo(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}function Sio(t,e,r){t.issues.length&&e.issues.push(...Vk(r,t.issues)),e.value[r]=t.value}function CRt(t,e,r){t.issues.length&&e.issues.push(...Vk(r,t.issues)),e.value[r]=t.value}function Tio(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...Vk(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function Iio(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>_M(s,n,_C())))}),e}function QQr(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(hUe(t)&&hUe(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let c=QQr(t[s],e[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n_M(l,c,_C()))})),e.issues.length&&(bkt.has(typeof n)?r.issues.push(...Vk(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>_M(l,c,_C()))})),r.value.set(t.value,e.value)}function Rio(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function kio(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function Pio(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function Dio(t,e,r){return FCe(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function Nio(t){return t.value=Object.freeze(t.value),t}function Mio(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(Zao(o))}}function Vrl(){return{localeError:$rl()}}function zrl(){return{localeError:Wrl()}}function Oio(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}function Krl(){return{localeError:Yrl()}}function Zrl(){return{localeError:Jrl()}}function enl(){return{localeError:Xrl()}}function rnl(){return{localeError:tnl()}}function ruo(){return{localeError:inl()}}function anl(){return{localeError:snl()}}function lnl(){return{localeError:cnl()}}function dnl(){return{localeError:unl()}}function pnl(){return{localeError:fnl()}}function mnl(){return{localeError:hnl()}}function Anl(){return{localeError:gnl()}}function _nl(){return{localeError:ynl()}}function vnl(){return{localeError:Enl()}}function bnl(){return{localeError:Cnl()}}function Tnl(){return{localeError:Snl()}}function xnl(){return{localeError:Inl()}}function Rnl(){return{localeError:wnl()}}function Pnl(){return{localeError:knl()}}function Nnl(){return{localeError:Dnl()}}function Onl(){return{localeError:Mnl()}}function Bnl(){return{localeError:Lnl()}}function Unl(){return{localeError:Fnl()}}function qnl(){return{localeError:Qnl()}}function Hnl(){return{localeError:jnl()}}function $nl(){return{localeError:Gnl()}}function Wnl(){return{localeError:Vnl()}}function Lio(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}function Ynl(){return{localeError:znl()}}function Jnl(){return{localeError:Knl()}}function Xnl(){return{localeError:Znl()}}function til(){return{localeError:eil()}}function nil(){return{localeError:ril()}}function sil(){return{localeError:oil()}}function cil(){return{localeError:ail()}}function uil(){return{localeError:lil()}}function fil(){return{localeError:dil()}}function hil(){return{localeError:pil()}}function gil(){return{localeError:mil()}}function vjr(){return new mUe}function ouo(t,e){return new t({type:"string",...Pr(e)})}function suo(t,e){return new t({type:"string",coerce:!0,...Pr(e)})}function Cjr(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Pr(e)})}function wkt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Pr(e)})}function bjr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Pr(e)})}function Sjr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Pr(e)})}function Tjr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Pr(e)})}function Ijr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Pr(e)})}function xjr(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Pr(e)})}function wjr(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Pr(e)})}function Rjr(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Pr(e)})}function kjr(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Pr(e)})}function Pjr(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Pr(e)})}function Djr(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Pr(e)})}function Njr(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Pr(e)})}function Mjr(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Pr(e)})}function Ojr(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Pr(e)})}function Ljr(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Pr(e)})}function Bjr(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Pr(e)})}function Fjr(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Pr(e)})}function Ujr(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Pr(e)})}function Qjr(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Pr(e)})}function qjr(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Pr(e)})}function jjr(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Pr(e)})}function cuo(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Pr(e)})}function luo(t,e){return new t({type:"string",format:"date",check:"string_format",...Pr(e)})}function uuo(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Pr(e)})}function duo(t,e){return new t({type:"string",format:"duration",check:"string_format",...Pr(e)})}function fuo(t,e){return new t({type:"number",checks:[],...Pr(e)})}function puo(t,e){return new t({type:"number",coerce:!0,checks:[],...Pr(e)})}function huo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Pr(e)})}function muo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Pr(e)})}function guo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Pr(e)})}function Auo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Pr(e)})}function yuo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Pr(e)})}function _uo(t,e){return new t({type:"boolean",...Pr(e)})}function Euo(t,e){return new t({type:"boolean",coerce:!0,...Pr(e)})}function vuo(t,e){return new t({type:"bigint",...Pr(e)})}function Cuo(t,e){return new t({type:"bigint",coerce:!0,...Pr(e)})}function buo(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Pr(e)})}function Suo(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Pr(e)})}function Tuo(t,e){return new t({type:"symbol",...Pr(e)})}function Iuo(t,e){return new t({type:"undefined",...Pr(e)})}function xuo(t,e){return new t({type:"null",...Pr(e)})}function wuo(t){return new t({type:"any"})}function Rkt(t){return new t({type:"unknown"})}function Ruo(t,e){return new t({type:"never",...Pr(e)})}function kuo(t,e){return new t({type:"void",...Pr(e)})}function Puo(t,e){return new t({type:"date",...Pr(e)})}function Duo(t,e){return new t({type:"date",coerce:!0,...Pr(e)})}function Nuo(t,e){return new t({type:"nan",...Pr(e)})}function Zoe(t,e){return new ljr({check:"less_than",...Pr(e),value:t,inclusive:!1})}function gM(t,e){return new ljr({check:"less_than",...Pr(e),value:t,inclusive:!0})}function Xoe(t,e){return new ujr({check:"greater_than",...Pr(e),value:t,inclusive:!1})}function rx(t,e){return new ujr({check:"greater_than",...Pr(e),value:t,inclusive:!0})}function Muo(t){return Xoe(0,t)}function Ouo(t){return Zoe(0,t)}function Luo(t){return gM(0,t)}function Buo(t){return rx(0,t)}function gUe(t,e){return new Oco({check:"multiple_of",...Pr(e),value:t})}function vPt(t,e){return new Fco({check:"max_size",...Pr(e),maximum:t})}function AUe(t,e){return new Uco({check:"min_size",...Pr(e),minimum:t})}function Hjr(t,e){return new Qco({check:"size_equals",...Pr(e),size:t})}function CPt(t,e){return new qco({check:"max_length",...Pr(e),maximum:t})}function abe(t,e){return new jco({check:"min_length",...Pr(e),minimum:t})}function bPt(t,e){return new Hco({check:"length_equals",...Pr(e),length:t})}function Gjr(t,e){return new Gco({check:"string_format",format:"regex",...Pr(e),pattern:t})}function $jr(t){return new $co({check:"string_format",format:"lowercase",...Pr(t)})}function Vjr(t){return new Vco({check:"string_format",format:"uppercase",...Pr(t)})}function Wjr(t,e){return new Wco({check:"string_format",format:"includes",...Pr(e),includes:t})}function zjr(t,e){return new zco({check:"string_format",format:"starts_with",...Pr(e),prefix:t})}function Yjr(t,e){return new Yco({check:"string_format",format:"ends_with",...Pr(e),suffix:t})}function Fuo(t,e,r){return new Kco({check:"property",property:t,schema:e,...Pr(r)})}function Kjr(t,e){return new Jco({check:"mime_type",mime:t,...Pr(e)})}function ise(t){return new Zco({check:"overwrite",tx:t})}function Jjr(t){return ise(e=>e.normalize(t))}function Zjr(){return ise(t=>t.trim())}function Xjr(){return ise(t=>t.toLowerCase())}function eHr(){return ise(t=>t.toUpperCase())}function tHr(t,e,r){return new t({type:"array",element:e,...Pr(r)})}function Ail(t,e,r){return new t({type:"union",options:e,...Pr(r)})}function yil(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Pr(n)})}function _il(t,e,r){return new t({type:"intersection",left:e,right:r})}function Uuo(t,e,r,n){let o=r instanceof So;return new t({type:"tuple",items:e,rest:o?r:null,...Pr(o?n:r)})}function Eil(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Pr(n)})}function vil(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Pr(n)})}function Cil(t,e,r){return new t({type:"set",valueType:e,...Pr(r)})}function bil(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...Pr(r)})}function Sil(t,e,r){return new t({type:"enum",entries:e,...Pr(r)})}function Til(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Pr(r)})}function Quo(t,e){return new t({type:"file",...Pr(e)})}function Iil(t,e){return new t({type:"transform",transform:e})}function xil(t,e){return new t({type:"optional",innerType:e})}function wil(t,e){return new t({type:"nullable",innerType:e})}function Ril(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function kil(t,e,r){return new t({type:"nonoptional",innerType:e,...Pr(r)})}function Pil(t,e){return new t({type:"success",innerType:e})}function Dil(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function Nil(t,e,r){return new t({type:"pipe",in:e,out:r})}function Mil(t,e){return new t({type:"readonly",innerType:e})}function Oil(t,e,r){return new t({type:"template_literal",parts:e,...Pr(r)})}function Lil(t,e){return new t({type:"lazy",getter:e})}function Bil(t,e){return new t({type:"promise",innerType:e})}function quo(t,e,r){let n=Pr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function juo(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Pr(r)})}function Huo(t,e){let r=Pr(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let s=new Set(n),c=new Set(o),l=t.Pipe??_jr,u=t.Boolean??pjr,d=t.String??kUe,f=new(t.Transform??yjr)({type:"transform",transform:a((m,g)=>{let A=m;return r.case!=="sensitive"&&(A=A.toLowerCase()),s.has(A)?!0:c.has(A)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:g.value,inst:f}),{})},"transform"),error:r.error}),h=new l({type:"pipe",in:new d({type:"string",error:r.error}),out:f,error:r.error});return new l({type:"pipe",in:h,out:new u({type:"boolean",error:r.error}),error:r.error})}function Guo(t,e,r,n={}){let o=Pr(n),s={...Pr(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:c=>r.test(c),...o};return r instanceof RegExp&&(s.pattern=r),new t(s)}function $uo(t){return new kkt({type:"function",input:Array.isArray(t?.input)?Uuo(EPt,t?.input):t?.input??tHr(mjr,Rkt(xkt)),output:t?.output??Rkt(xkt)})}function rHr(t,e){if(t instanceof mUe){let n=new yUe(e),o={};for(let l of t._idmap.entries()){let[u,d]=l;n.process(d)}let s={},c={registry:t,uri:e?.uri||(l=>l),defs:o};for(let l of t._idmap.entries()){let[u,d]=l;s[u]=n.emit(d,{...e,external:c})}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o}}return{schemas:s}}let r=new yUe(e);return r.process(t),r.emit(t,e)}function Kg(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Kg(n.element,r);case"object":{for(let o in n.shape)if(Kg(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(Kg(o,r))return!0;return!1}case"intersection":return Kg(n.left,r)||Kg(n.right,r);case"tuple":{for(let o of n.items)if(Kg(o,r))return!0;return!!(n.rest&&Kg(n.rest,r))}case"record":return Kg(n.keyType,r)||Kg(n.valueType,r);case"map":return Kg(n.keyType,r)||Kg(n.valueType,r);case"set":return Kg(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Kg(n.innerType,r);case"lazy":return Kg(n.getter(),r);case"default":return Kg(n.innerType,r);case"prefault":return Kg(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Kg(n.in,r)||Kg(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function Bio(t,e){let r={type:"object",get shape(){return Xs.assignProp(this,"shape",{...t}),this.shape},...Xs.normalizeParams(e)};return new Qil(r)}function wB(t){return!!t._zod}function MCe(t){let e=Object.values(t);if(e.length===0)return Bio({});let r=e.every(wB),n=e.every(o=>!wB(o));if(r)return Bio(t);if(n)return grl(t);throw Error("Mixed Zod versions detected in object shape.")}function $6e(t,e){return wB(t)?yPt(t,e):t.safeParse(e)}async function H7r(t,e){return wB(t)?await _Pt(t,e):await t.safeParseAsync(e)}function PUe(t){if(!t)return;let e;if(wB(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function R6e(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(o=>typeof o=="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse=="function")))return MCe(t)}}if(wB(t)){let e=t._zod?.def;if(e&&(e.type==="object"||e.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function G7r(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function qil(t){return t.description}function jil(t){if(wB(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function Vuo(t){if(wB(t)){let n=t._zod?.def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}}let e=t._def;if(e){if(e.value!==void 0)return e.value;if(Array.isArray(e.values)&&e.values.length>0)return e.values[0]}let r=t.value;if(r!==void 0)return r}function Wuo(t){return cuo(iHr,t)}function zuo(t){return luo(oHr,t)}function Yuo(t){return uuo(sHr,t)}function Kuo(t){return duo(aHr,t)}function xt(t){return ouo(SPt,t)}function Gil(t){return Cjr(lHr,t)}function $il(t){return wkt(Pkt,t)}function Vil(t){return bjr(D9,t)}function Wil(t){return Sjr(D9,t)}function zil(t){return Tjr(D9,t)}function Yil(t){return Ijr(D9,t)}function Kil(t){return xjr(uHr,t)}function Jil(t){return wjr(dHr,t)}function Zil(t){return Rjr(fHr,t)}function Xil(t){return kjr(pHr,t)}function eol(t){return Pjr(hHr,t)}function tol(t){return Djr(mHr,t)}function rol(t){return Njr(gHr,t)}function nol(t){return Mjr(AHr,t)}function iol(t){return Ojr(yHr,t)}function ool(t){return Ljr(_Hr,t)}function sol(t){return Bjr(EHr,t)}function aol(t){return Fjr(vHr,t)}function col(t){return Ujr(CHr,t)}function lol(t){return Qjr(bHr,t)}function uol(t){return qjr(SHr,t)}function dol(t){return jjr(THr,t)}function fol(t,e,r={}){return Guo(rdo,t,e,r)}function Gc(t){return fuo(TPt,t)}function qQr(t){return huo(Ebe,t)}function pol(t){return muo(Ebe,t)}function hol(t){return guo(Ebe,t)}function mol(t){return Auo(Ebe,t)}function gol(t){return yuo(Ebe,t)}function Jg(t){return _uo(IPt,t)}function Aol(t){return vuo(xPt,t)}function yol(t){return buo(IHr,t)}function _ol(t){return Suo(IHr,t)}function Eol(t){return Tuo(ndo,t)}function vol(t){return Iuo(ido,t)}function xHr(t){return xuo(odo,t)}function Col(){return wuo(sdo)}function Af(){return Rkt(ado)}function wPt(t){return Ruo(cdo,t)}function bol(t){return kuo(ldo,t)}function Sol(t){return Puo(wHr,t)}function ka(t,e){return tHr(udo,t,e)}function Tol(t){let e=t._zod.def.shape;return ni(Object.keys(e))}function In(t,e){let r={type:"object",get shape(){return Xs.assignProp(this,"shape",{...t}),this.shape},...Xs.normalizeParams(e)};return new RPt(r)}function Iol(t,e){return new RPt({type:"object",get shape(){return Xs.assignProp(this,"shape",{...t}),this.shape},catchall:wPt(),...Xs.normalizeParams(e)})}function gC(t,e){return new RPt({type:"object",get shape(){return Xs.assignProp(this,"shape",{...t}),this.shape},catchall:Af(),...Xs.normalizeParams(e)})}function Au(t,e){return new RHr({type:"union",options:t,...Xs.normalizeParams(e)})}function kHr(t,e,r){return new ddo({type:"union",options:e,discriminator:t,...Xs.normalizeParams(r)})}function kPt(t,e){return new fdo({type:"intersection",left:t,right:e})}function xol(t,e,r){let n=e instanceof So,o=n?r:e;return new pdo({type:"tuple",items:t,rest:n?e:null,...Xs.normalizeParams(o)})}function gu(t,e,r){return new PHr({type:"record",keyType:t,valueType:e,...Xs.normalizeParams(r)})}function wol(t,e,r){return new PHr({type:"record",keyType:Au([t,wPt()]),valueType:e,...Xs.normalizeParams(r)})}function Rol(t,e,r){return new hdo({type:"map",keyType:t,valueType:e,...Xs.normalizeParams(r)})}function kol(t,e){return new mdo({type:"set",valueType:t,...Xs.normalizeParams(e)})}function i1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new _Ue({type:"enum",entries:r,...Xs.normalizeParams(e)})}function Pol(t,e){return new _Ue({type:"enum",entries:t,...Xs.normalizeParams(e)})}function ni(t,e){return new gdo({type:"literal",values:Array.isArray(t)?t:[t],...Xs.normalizeParams(e)})}function Dol(t){return Quo(Ado,t)}function NHr(t){return new DHr({type:"transform",transform:t})}function Od(t){return new MHr({type:"optional",innerType:t})}function Dkt(t){return new ydo({type:"nullable",innerType:t})}function Nol(t){return Od(Dkt(t))}function Edo(t,e){return new _do({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Cdo(t,e){return new vdo({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function bdo(t,e){return new OHr({type:"nonoptional",innerType:t,...Xs.normalizeParams(e)})}function Mol(t){return new Sdo({type:"success",innerType:t})}function Ido(t,e){return new Tdo({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Ool(t){return Nuo(xdo,t)}function Nkt(t,e){return new LHr({type:"pipe",in:t,out:e})}function Rdo(t){return new wdo({type:"readonly",innerType:t})}function Lol(t,e){return new kdo({type:"template_literal",parts:t,...Xs.normalizeParams(e)})}function Ddo(t){return new Pdo({type:"lazy",getter:t})}function Bol(t){return new Ndo({type:"promise",innerType:t})}function Mdo(t,e){let r=new Qh({check:"custom",...Xs.normalizeParams(e)});return r._zod.check=t,r}function Odo(t,e){return quo(PPt,t??(()=>!0),e)}function Ldo(t,e={}){return juo(PPt,t,e)}function Bdo(t,e){let r=Mdo(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Xs.issue(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(Xs.issue(s))}},t(n.value,n)),e);return r}function Fol(t,e={error:`Input not instance of ${t.name}`}){let r=new PPt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...Xs.normalizeParams(e)});return r._zod.bag.Class=t,r}function Qol(t){let e=Ddo(()=>Au([xt(t),Gc(),Jg(),xHr(),ka(e),gu(xt(),e)]));return e}function BHr(t,e){return Nkt(NHr(t),e)}function jol(t){_C({customError:t})}function Hol(){return _C().customError}function Gol(t){return suo(SPt,t)}function $ol(t){return puo(TPt,t)}function Vol(t){return Euo(IPt,t)}function Wol(t){return Cuo(xPt,t)}function zol(t){return Duo(wHr,t)}function bal(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function Sal(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function Foe(t){return t==="completed"||t==="failed"||t==="cancelled"}function rfo(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function wl(t,e,r,n,o){t[e]=r,rfo(t,e,n,o)}function n1(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?nfo(e,t.currentPath):e.join("/")}}function Dal(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==wr.ZodAny&&(r.items=Hc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&wl(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&wl(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(wl(r,"minItems",t.exactLength.value,t.exactLength.message,e),wl(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function Nal(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?wl(r,"minimum",n.value,n.message,e):wl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),wl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?wl(r,"maximum",n.value,n.message,e):wl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),wl(r,"maximum",n.value,n.message,e));break;case"multipleOf":wl(r,"multipleOf",n.value,n.message,e);break}return r}function Mal(){return{type:"boolean"}}function ifo(t,e){return Hc(t.type._def,e)}function ofo(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>ofo(t,e,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Lal(t,e)}}function Bal(t,e){return{...Hc(t.innerType._def,e),default:t.defaultValue()}}function Fal(t,e){return e.effectStrategy==="input"?Hc(t.schema._def,e):n1(e)}function Ual(t){return{type:"string",enum:Array.from(t.values)}}function qal(t,e){let r=[Hc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Hc(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(s=>{if(Qal(s))o.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let c=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:l,...u}=s;c=u}else n=void 0;o.push(c)}}),o.length?{allOf:o,...n}:void 0}function jal(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}function sfo(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":wl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":wl(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":hM(r,"email",n.message,e);break;case"format:idn-email":hM(r,"idn-email",n.message,e);break;case"pattern:zod":mC(r,pM.email,n.message,e);break}break;case"url":hM(r,"uri",n.message,e);break;case"uuid":hM(r,"uuid",n.message,e);break;case"regex":mC(r,n.regex,n.message,e);break;case"cuid":mC(r,pM.cuid,n.message,e);break;case"cuid2":mC(r,pM.cuid2,n.message,e);break;case"startsWith":mC(r,RegExp(`^${V7r(n.value,e)}`),n.message,e);break;case"endsWith":mC(r,RegExp(`${V7r(n.value,e)}$`),n.message,e);break;case"datetime":hM(r,"date-time",n.message,e);break;case"date":hM(r,"date",n.message,e);break;case"time":hM(r,"time",n.message,e);break;case"duration":hM(r,"duration",n.message,e);break;case"length":wl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),wl(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{mC(r,RegExp(V7r(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&hM(r,"ipv4",n.message,e),n.version!=="v4"&&hM(r,"ipv6",n.message,e);break}case"base64url":mC(r,pM.base64url,n.message,e);break;case"jwt":mC(r,pM.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&mC(r,pM.ipv4Cidr,n.message,e),n.version!=="v4"&&mC(r,pM.ipv6Cidr,n.message,e);break}case"emoji":mC(r,pM.emoji(),n.message,e);break;case"ulid":{mC(r,pM.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{hM(r,"binary",n.message,e);break}case"contentEncoding:base64":{wl(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{mC(r,pM.base64,n.message,e);break}}break}case"nanoid":mC(r,pM.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function V7r(t,e){return e.patternStrategy==="escape"?Gal(t):t}function Gal(t){let e="";for(let r=0;ro.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):wl(t,"format",e,r,n)}function mC(t,e,r,n){t.pattern||t.allOf?.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:Qio(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):wl(t,"pattern",Qio(e,n),r,n)}function Qio(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,o="",s=!1,c=!1,l=!1;for(let u=0;u{let r=0;for(let[n,o]of t)r+=Buffer.byteLength(Cto(e,n,o)),r+=D9r(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r +`);return r+=Buffer.byteLength(vto(e)),r},"getFormDataLength"),P9r=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=wjc(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=Djc(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return Rjc.from(Pjc(this.fd,this.boundary))}};bto.exports={isFormData:kjc,FormDataSerializer:P9r}});var Tto=I((CKh,Sto)=>{"use strict";p();var{AbortSignal:vKh}=k9r(),{Body:Njc,cloneStream:Mjc,guessContentType:Ojc}=vwt(),{Headers:Ljc}=lCe(),{isPlainObject:Bjc}=y9(),{isFormData:Fjc,FormDataSerializer:Ujc}=n6e(),Qjc=20,FW=Symbol("Request internals"),Iwt=class t extends Njc{static{a(this,"Request")}constructor(e,r={}){let n=e instanceof t?e:null,o=n?new URL(n.url):new URL(e),s=r.method||n&&n.method||"GET";if(s=s.toUpperCase(),(r.body!=null||n&&n.body!==null)&&["GET","HEAD"].includes(s))throw new TypeError("Request with GET/HEAD method cannot have body");let c=r.body||(n&&n.body?Mjc(n):null),l=new Ljc(r.headers||n&&n.headers||{});if(Fjc(c)&&!l.has("content-type")){let h=new Ujc(c);c=h.stream(),l.set("content-type",h.contentType()),!l.has("transfer-encoding")&&!l.has("content-length")&&l.set("content-length",h.length())}if(!l.has("content-type"))if(Bjc(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=Ojc(c);h&&l.set("content-type",h)}super(c);let u=n?n.signal:null;"signal"in r&&(u=r.signal);let d=r.redirect||n&&n.redirect||"follow";if(!["follow","error","manual"].includes(d))throw new TypeError(`'${d}' is not a valid redirect option`);let f=r.cache||n&&n.cache||"default";if(!["default","no-store","reload","no-cache","force-cache","only-if-cached"].includes(f))throw new TypeError(`'${f}' is not a valid cache option`);this[FW]={init:{...r},method:s,redirect:d,cache:f,headers:l,parsedURL:o,signal:u},r.follow===void 0?!n||n.follow===void 0?this.follow=Qjc:this.follow=n.follow:this.follow=r.follow,this.counter=r.counter||n&&n.counter||0,r.compress===void 0?!n||n.compress===void 0?this.compress=!0:this.compress=n.compress:this.compress=r.compress,r.decode===void 0?!n||n.decode===void 0?this.decode=!0:this.decode=n.decode:this.decode=r.decode}get method(){return this[FW].method}get url(){return this[FW].parsedURL.toString()}get headers(){return this[FW].headers}get redirect(){return this[FW].redirect}get cache(){return this[FW].cache}get signal(){return this[FW].signal}clone(){return new t(this)}get init(){return this[FW].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(Iwt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});Sto.exports={Request:Iwt}});var N9r=I((TKh,Ito)=>{"use strict";p();var{Body:qjc,cloneStream:jjc,guessContentType:Hjc}=vwt(),{Headers:Gjc}=lCe(),{isPlainObject:$jc}=y9(),{isFormData:Vjc,FormDataSerializer:Wjc}=n6e(),fM=Symbol("Response internals"),xwt=class t extends qjc{static{a(this,"Response")}constructor(e=null,r={}){let n=new Gjc(r.headers),o=e;if(Vjc(o)&&!n.has("content-type")){let s=new Wjc(o);o=s.stream(),n.set("content-type",s.contentType()),!n.has("transfer-encoding")&&!n.has("content-length")&&n.set("content-length",s.length())}if(o!==null&&!n.has("content-type"))if($jc(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=Hjc(o);s&&n.set("content-type",s)}super(o),this[fM]={url:r.url,status:r.status||200,statusText:r.statusText||"",headers:n,httpVersion:r.httpVersion,decoded:r.decoded,counter:r.counter}}get url(){return this[fM].url||""}get status(){return this[fM].status}get statusText(){return this[fM].statusText}get ok(){return this[fM].status>=200&&this[fM].status<300}get redirected(){return this[fM].counter>0}get headers(){return this[fM].headers}get httpVersion(){return this[fM].httpVersion}get decoded(){return this[fM].decoded}static redirect(e,r=302){if(![301,302,303,307,308].includes(r))throw new RangeError("Invalid status code");return new t(null,{headers:{location:new URL(e).toString()},status:r})}clone(){if(this.bodyUsed)throw new TypeError("Cannot clone: already read");return new t(jjc(this),{...this[fM]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(xwt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});Ito.exports={Response:xwt}});var wto=I((RKh,xto)=>{"use strict";p();var zjc=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),Yjc=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),Kjc=new Set([500,502,503,504]),Jjc={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},Zjc={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function Roe(t){let e=parseInt(t,10);return isFinite(e)?e:0}a(Roe,"toNumberOrZero");function Xjc(t){return t?Kjc.has(t.status):!0}a(Xjc,"isErrorResponse");function M9r(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let n of r){let[o,s]=n.split(/=/,2);e[o.trim()]=s===void 0?!0:s.trim().replace(/^"|"$/g,"")}return e}a(M9r,"parseCacheControl");function eHc(t){let e=[];for(let r in t){let n=t[r];e.push(n===!0?r:r+"="+n)}if(e.length)return e.join(", ")}a(eHc,"formatCacheControl");xto.exports=class{static{a(this,"CachePolicy")}constructor(e,r,{shared:n,cacheHeuristic:o,immutableMinTimeToLive:s,ignoreCargoCult:c,_fromObject:l}={}){if(l){this._fromObject(l);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._cacheHeuristic=o!==void 0?o:.1,this._immutableMinTtl=s!==void 0?s:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=M9r(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=M9r(e.headers["cache-control"]),c&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":eHc(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&Yjc.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||zjc.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=M9r(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)||r["max-age"]&&this.age()>r["max-age"]||r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]||this.stale()&&!(r["max-stale"]&&!this._rescc["must-revalidate"]&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of r)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let n in e)Jjc[n]||(r[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let o of n)delete r[o]}if(r.warning){let n=r.warning.split(/,/).filter(o=>!/^\s*1[0-9][0-9]/.test(o));n.length?r.warning=n.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return Roe(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return Roe(this._rescc["s-maxage"])}if(this._rescc["max-age"])return Roe(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||nn)return Math.max(e,(r-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+Roe(this._rescc["stale-if-error"]),n=e+Roe(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+Roe(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+Roe(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let o=r["if-none-match"].split(/,/).filter(s=>!/^\s*W\//.test(s));o.length?r["if-none-match"]=o.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&Xjc(r))return{modified:!1,matches:!1,policy:this};if(!r||!r.headers)throw Error("Response headers missing");let n=!1;if(r.status!==void 0&&r.status!=304?n=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(n=!0),!n)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let o={};for(let c in this._resHeaders)o[c]=c in r.headers&&!Zjc[c]?r.headers[c]:this._resHeaders[c];let s=Object.assign({},r,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var Dto=I((DKh,Pto)=>{"use strict";p();var tHc=wto(),{Headers:rHc}=lCe(),Rto=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),kto=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),O9r=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new tHc(Rto(e),kto(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(Rto(e))}responseHeaders(e){return new rHc(this.policy.responseHeaders(kto(e)))}timeToLive(){return this.policy.timeToLive()}};Pto.exports=O9r});var Oto=I((OKh,Mto)=>{"use strict";p();var{Readable:nHc}=require("stream"),{Headers:Nto}=lCe(),{Response:iHc}=N9r(),UW=Symbol("CacheableResponse internals"),oHc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),L9r=class t extends iHc{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new Nto(r.headers);this[UW]={headers:n,bufferedBody:e}}get headers(){return this[UW].headers}set headers(e){if(e instanceof Nto)this[UW].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return nHc.from(this[UW].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[UW].bufferedBody}async arrayBuffer(){return oHc(this[UW].bufferedBody)}async text(){return this[UW].bufferedBody.toString()}async json(){return JSON.parse(await this.text())}clone(){let{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l}=this;return new t(this[UW].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},sHc=a(async t=>{let e=await t.buffer(),{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u}=t;return new L9r(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");Mto.exports={cacheableResponse:sHc}});var wwt=I((FKh,Lto)=>{"use strict";p();var B9r=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};Lto.exports={RequestAbortedError:B9r}});var qto=I((qKh,Qto)=>{"use strict";p();var Fto=require("http"),Uto=require("https"),{Readable:aHc}=require("stream"),v9=YP()("helix-fetch:h1"),{RequestAbortedError:Bto}=wwt(),{decodeStream:cHc}=y9(),lHc=a((t,e)=>{let{h1:r,options:{h1:n,rejectUnauthorized:o}}=t;return e==="https:"?r.httpsAgent?r.httpsAgent:n||typeof o=="boolean"?(r.httpsAgent=new Uto.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new Fto.Agent(n),r.httpAgent):void 0},"getAgent"),uHc=a(t=>{t.h1={}},"setupContext"),dHc=a(async({h1:t})=>{t.httpAgent&&(v9("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(v9("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),fHc=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?cHc(n,u,t,r):t;return{statusCode:n,statusText:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u,readable:d,decoded:!!(e&&d!==t)}},"createResponse"),pHc=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?Uto:Fto,o=lHc(t,e.protocol),s={...r,agent:o},{socket:c,body:l}=s;return c&&(delete s.socket,c.assigned||(c.assigned=!0,o?s.agent=new Proxy(o,{get:a((u,d)=>d==="createConnection"&&!c.inUse?(f,h)=>{v9(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{v9(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{v9(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(v9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new Bto),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new Bto);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(v9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u(fHc(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(v9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(v9(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof aHc?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");Qto.exports={request:pHc,setupContext:uHc,resetContext:dHc}});var $to=I((GKh,Gto)=>{"use strict";p();var{connect:hHc,constants:mHc}=require("http2"),{Readable:gHc}=require("stream"),Md=YP()("helix-fetch:h2"),{RequestAbortedError:jto}=wwt(),{decodeStream:AHc}=y9(),{NGHTTP2_CANCEL:i6e}=mHc,yHc=300*1e3,_Hc=5e3,EHc=a(t=>{t.h2={sessionCache:{}}},"setupContext"),vHc=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),Md(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),Hto=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?AHc(s,t,e,n):e;return{statusCode:s,statusText:"",httpVersion:"2.0",httpVersionMajor:2,httpVersionMinor:0,headers:o,readable:c,decoded:!!(r&&c!==e)}},"createResponse"),CHc=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=_Hc}}}=t,d=o[":path"],f=`${e}${d}`;Md(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(i6e)},"rejectPush")),n.on("push",(h,m)=>{Md(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{Md(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(i6e)}),l&&l(f,o,Hto(h,n,r))}),n.on("aborted",()=>{Md(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{Md(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{Md(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),bHc=a(async(t,e,r)=>{let{origin:n,pathname:o,search:s,hash:c}=e,l=`${o}${s}${c}`,{options:{h2:u={}},h2:{sessionCache:d}}=t,{idleSessionTimeout:f=yHc,pushPromiseHandler:h,pushHandler:m}=u,g={...r},{method:A,headers:y,socket:_,body:E,decode:v}=g;return _&&delete g.socket,y.host&&(y[":authority"]=y.host,delete y.host),new Promise((S,T)=>{let w=d[n];if(!w||w.closed||w.destroyed){let N=!(t.options.rejectUnauthorized===!1||u.rejectUnauthorized===!1),O={...u,rejectUnauthorized:N};_&&!_.inUse&&(O.createConnection=()=>(Md(`reusing socket #${_.id} (${_.servername})`),_.inUse=!0,_)),w=hHc(n,{...O,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{Md(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{Md(`session ${n} established`),Md(`caching session ${n}`),d[n]=w}),w.on("localSettings",q=>{Md(`session ${n} localSettings: ${JSON.stringify(q)}`)}),w.on("remoteSettings",q=>{Md(`session ${n} remoteSettings: ${JSON.stringify(q)}`)}),w.once("close",()=>{Md(`session ${n} closed`),d[n]===w&&(Md(`discarding cached session ${n}`),delete d[n])}),w.once("error",q=>{Md(`session ${n} encountered error: ${q}`),d[n]===w&&(Md(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(q,M,L)=>{Md(`session ${n} encountered frameError: type: ${q}, code: ${M}, id: ${L}`)}),w.once("goaway",(q,M,L)=>{Md(`session ${n} received GOAWAY frame: errorCode: ${q}, lastStreamID: ${M}, opaqueData: ${L?L.toString():void 0}`)}),w.on("stream",(q,M,L)=>{CHc(t,n,v,q,M,L)})}else _&&_.id!==w.socket.id&&!_.inUse&&(Md(`discarding redundant socket used for ALPN: #${_.id} ${_.servername}`),_.destroy());Md(`${A} ${e.host}${l}`);let R,{signal:x}=g,k=a(()=>{x.removeEventListener("abort",k),T(new jto),R&&R.close(i6e)},"onAbortSignal");if(x){if(x.aborted){T(new jto);return}x.addEventListener("abort",k)}let D=a(N=>{Md(`session ${n} encountered error during ${g.method} ${e.href}: ${N}`),T(N)},"onSessionError");w.once("error",D),R=w.request({":method":A,":path":l,...y}),R.once("response",N=>{w.off("error",D),x&&x.removeEventListener("abort",k),S(Hto(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",k),R.rstCode!==i6e&&(Md(`${g.method} ${e.href} failed with: ${N.message}`),R.close(i6e),T(N))}),R.once("frameError",(N,O,B)=>{w.off("error",D),Md(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${O}, id: ${B}`)}),R.on("push",(N,O)=>{Md(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${O}`)}),E instanceof gHc?E.pipe(R):(E&&R.write(E),R.end())})},"request");Gto.exports={request:bHc,setupContext:EHc,resetContext:vHc}});var Wto=I((WKh,Vto)=>{"use strict";p();var{EventEmitter:SHc}=require("events"),THc=a(()=>{let t={},e=new SHc;return e.setMaxListeners(0),{acquire:a(r=>new Promise(n=>{if(!t[r]){t[r]=!0,n();return}let o=a(s=>{t[r]||(t[r]=!0,e.removeListener(r,o),n(s))},"tryAcquire");e.on(r,o)}),"acquire"),release:a((r,n)=>{Reflect.deleteProperty(t,r),setImmediate(()=>e.emit(r,n))},"release")}},"lock");Vto.exports=THc});var zto=I((KKh,IHc)=>{IHc.exports={name:"@adobe/helix-fetch",version:"3.1.1",description:"Light-weight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2",main:"src/index.js",scripts:{test:"nyc mocha",lint:"./node_modules/.bin/eslint .","semantic-release":"semantic-release"},mocha:{timeout:"5000",recursive:"true",reporter:"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},engines:{node:">=12.0"},types:"src/index.d.ts",exports:{import:"./src/index.mjs",require:"./src/index.js"},repository:{type:"git",url:"https://github.com/adobe/helix-fetch"},author:"",license:"Apache-2.0",bugs:{url:"https://github.com/adobe/helix-fetch/issues"},homepage:"https://github.com/adobe/helix-fetch#readme",keywords:["fetch","whatwg","Fetch API","http","https","http2","h2","promise","async","request","RFC 7234","7234","caching","cache"],dependencies:{debug:"4.3.4","http-cache-semantics":"^4.1.1","lru-cache":"7.13.1"},devDependencies:{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1",chai:"4.3.6","chai-as-promised":"7.1.1","chai-bytes":"0.1.2","chai-iterator":"3.0.2",eslint:"8.21.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.26.0","formdata-node":"4.3.3","lint-staged":"13.0.3",mocha:"10.0.0","mocha-multi-reporters":"1.5.1",nock:"13.2.9",nyc:"15.1.0","parse-cache-control":"1.0.1",pem:"1.14.6",proxy:"^1.0.2","semantic-release":"19.0.3",sinon:"14.0.0","stream-buffers":"3.0.2",tunnel:"^0.0.6"},"lint-staged":{"*.js":"eslint"},config:{commitizen:{path:"node_modules/cz-conventional-changelog"},ghooks:{"pre-commit":"npx lint-staged"}}}});var Xto=I((JKh,Zto)=>{"use strict";p();var{Readable:xHc}=require("stream"),wHc=require("tls"),{types:{isAnyArrayBuffer:RHc}}=require("util"),kHc=I9r(),F9r=YP()("helix-fetch:core"),{RequestAbortedError:Rwt}=wwt(),U9r=qto(),kwt=$to(),PHc=Wto(),{isPlainObject:DHc}=y9(),{isFormData:NHc,FormDataSerializer:MHc}=n6e(),{version:OHc}=zto(),Q9r="h2",q9r="h2c",j9r="http/1.0",koe="http/1.1",LHc=100,BHc=3600*1e3,FHc=[Q9r,koe,j9r],UHc=`helix-fetch/${OHc}`,QHc={method:"GET",compress:!0,decode:!0},Yto=0,Kto=PHc(),Jto=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new Rwt;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new Rwt);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof Rwt||(F9r(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=wHc.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),Yto+=1,s.id=Yto,s.secureConnecting=!1,F9r(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),qHc=a(async(t,e)=>{let r=await Kto.acquire(t.origin);try{return r||(r=await Jto(t,e)),r}finally{Kto.release(t.origin,r)}},"connect"),jHc=a(async(t,e,r)=>{let n=`${e.protocol}//${e.host}`,o=t.alpnCache.get(n);if(o)return{protocol:o};switch(e.protocol){case"http:":return o=koe,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=q9r,t.alpnCache.set(n,o),{protocol:o};case"https:":break;default:throw new TypeError(`unsupported protocol: ${e.protocol}`)}let{options:{rejectUnauthorized:s,h1:c={},h2:l={}}}=t,u=!(s===!1||c.rejectUnauthorized===!1||l.rejectUnauthorized===!1),d={servername:e.hostname,ALPNProtocols:t.alpnProtocols,signal:r,rejectUnauthorized:u};t.options.ca&&(d.ca=t.options.ca);let f=await qHc(e,d);return o=f.alpnProtocol,o||(o=koe),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),HHc=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),GHc=a(async(t,e,r,n)=>{let o=e.protocol==="https:",s;e.port?s=e.port:o?s=443:s=80;let c={...r,host:e.host,hostname:e.hostname,port:s},l=await t(c);if(o){let d={...c,ALPNProtocols:n};d.socket=l,d.servername=c.host;let f=await Jto(e,d);return{protocol:f.alpnProtocol||koe,socket:f}}return{protocol:l.alpnProtocol||koe,socket:l}},"getProtocolAndSocketFromFactory"),$Hc=a(async(t,e,r)=>{let n=new URL(e),o={...QHc,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=HHc(o.headers||{}),o.headers.host===void 0&&(o.headers.host=n.host),t.userAgent&&o.headers["user-agent"]===void 0&&(o.headers["user-agent"]=t.userAgent);let s;if(o.body instanceof URLSearchParams)s="application/x-www-form-urlencoded; charset=utf-8",o.body=o.body.toString();else if(NHc(o.body)){let d=new MHc(o.body);s=d.contentType(),o.body=d.stream(),o.headers["transfer-encoding"]===void 0&&o.headers["content-length"]===void 0&&(o.headers["content-length"]=String(d.length()))}else typeof o.body=="string"||o.body instanceof String?s="text/plain; charset=utf-8":DHc(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):RHc(o.body)&&(o.body=Buffer.from(o.body));o.headers["content-type"]===void 0&&s!==void 0&&(o.headers["content-type"]=s),o.body!=null&&(o.body instanceof xHc||(!(typeof o.body=="string"||o.body instanceof String)&&!Buffer.isBuffer(o.body)&&(o.body=String(o.body)),o.headers["transfer-encoding"]===void 0&&o.headers["content-length"]===void 0&&(o.headers["content-length"]=String(Buffer.isBuffer(o.body)?o.body.length:Buffer.byteLength(o.body,"utf-8"))))),o.headers.accept===void 0&&(o.headers.accept="*/*"),o.body==null&&["POST","PUT"].includes(o.method)&&(o.headers["content-length"]="0"),o.compress&&o.headers["accept-encoding"]===void 0&&(o.headers["accept-encoding"]="gzip,deflate,br");let{signal:c}=o,{protocol:l,socket:u=null}=t.socketFactory?await GHc(t.socketFactory,n,o,t.alpnProtocols):await jHc(t,n,c);switch(F9r(`${n.host} -> ${l}`),l){case Q9r:try{return await kwt.request(t,n,u?{...o,socket:u}:o)}catch(d){let{code:f,message:h}=d;throw f==="ERR_HTTP2_ERROR"&&h==="Protocol error"&&t.alpnCache.delete(`${n.protocol}//${n.host}`),d}case q9r:return kwt.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case j9r:case koe:return U9r.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),VHc=a(async t=>(t.alpnCache.clear(),Promise.all([U9r.resetContext(t),kwt.resetContext(t)])),"resetContext"),WHc=a(t=>{let{options:{alpnProtocols:e=FHc,alpnCacheTTL:r=BHc,alpnCacheSize:n=LHc,userAgent:o=UHc,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new kHc({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,U9r.setupContext(t),kwt.setupContext(t)},"setupContext");Zto.exports={request:$Hc,setupContext:WHc,resetContext:VHc,RequestAbortedError:Rwt,ALPN_HTTP2:Q9r,ALPN_HTTP2C:q9r,ALPN_HTTP1_1:koe,ALPN_HTTP1_0:j9r}});var tro=I((eJh,ero)=>{"use strict";p();var zHc=YP()("helix-fetch:core"),{request:YHc,setupContext:KHc,resetContext:JHc,RequestAbortedError:ZHc,ALPN_HTTP2:XHc,ALPN_HTTP2C:eGc,ALPN_HTTP1_1:tGc,ALPN_HTTP1_0:rGc}=Xto(),H9r=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},KHc(this)}api(){return{request:a(async(e,r)=>this.request(e,r),"request"),context:a((e={})=>new t(e).api(),"context"),setCA:a(e=>this.setCA(e),"setCA"),reset:a(async()=>this.reset(),"reset"),RequestAbortedError:ZHc,ALPN_HTTP2:XHc,ALPN_HTTP2C:eGc,ALPN_HTTP1_1:tGc,ALPN_HTTP1_0:rGc}}async request(e,r){return YHc(this,e,r)}setCA(e){this.options.ca=e}async reset(){return zHc("resetting context"),JHc(this)}};ero.exports=new H9r().api()});var sro=I((nJh,oro)=>{"use strict";p();var{EventEmitter:nGc}=require("events"),{Readable:o6e}=require("stream"),G9r=YP()("helix-fetch"),iGc=I9r(),{Body:oGc}=vwt(),{Headers:z9r}=lCe(),{Request:Poe}=Tto(),{Response:V9r}=N9r(),{FetchBaseError:sGc,FetchError:s6e,AbortError:Pwt}=R9r(),{AbortController:aGc,AbortSignal:cGc,TimeoutSignal:lGc}=k9r(),uGc=Dto(),{cacheableResponse:dGc}=Oto(),{sizeof:fGc}=y9(),{isFormData:pGc}=n6e(),{context:hGc,RequestAbortedError:mGc}=tro(),rro=["GET","HEAD"],gGc=500,AGc=100*1024*1024,$9r="push",nro=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof Poe&&typeof r>"u"?e:new Poe(e,r),{method:s,body:c,signal:l,compress:u,decode:d,follow:f,redirect:h,init:{body:m}}=o,g;if(l&&l.aborted){let w=new Pwt("The operation was aborted.");throw o.init.body instanceof o6e&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof o6e)&&!pGc(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof o6e&&m.destroy(w),w instanceof TypeError?w:w instanceof mGc?new Pwt("The operation was aborted."):new s6e(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new Pwt("The operation was aborted.");o.init.body instanceof o6e&&o.init.body.destroy(w),g.readable.emit("error",w)},"abortHandler");l&&l.addEventListener("abort",A);let{statusCode:y,statusText:_,httpVersion:E,headers:v,readable:S,decoded:T}=g;if([301,302,303,307,308].includes(y)){let{location:w}=v,R=w==null?null:new URL(w,o.url);switch(o.redirect){case"manual":break;case"error":throw l&&l.removeEventListener("abort",A),new s6e(`uri requested responds with a redirect, redirect mode is set to 'error': ${o.url}`,"no-redirect");case"follow":{if(R===null)break;if(o.counter>=o.follow)throw l&&l.removeEventListener("abort",A),new s6e(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new z9r(o.headers),follow:o.follow,compress:o.compress,decode:o.decode,counter:o.counter+1,method:o.method,body:o.body,signal:o.signal};if(y!==303&&o.body&&o.init.body instanceof o6e)throw l&&l.removeEventListener("abort",A),new s6e("Cannot follow redirect with body being a readable stream","unsupported-redirect");return(y===303||(y===301||y===302)&&o.method==="POST")&&(x.method="GET",x.body=void 0,x.headers.delete("content-length")),l&&l.removeEventListener("abort",A),nro(t,new Poe(R,x))}default:}}return l&&(S.once("end",()=>{l.removeEventListener("abort",A)}),S.once("error",()=>{l.removeEventListener("abort",A)})),new V9r(S,{url:o.url,status:y,statusText:_,headers:v,httpVersion:E,decoded:T,counter:o.counter})},"fetch"),iro=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!rro.includes(e.method))return r;let n=new uGc(e,r,{shared:!1});if(n.storable()){let o=await dGc(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),yGc=a(async(t,e,r)=>{let n=new Poe(e,r);if(t.options.maxCacheSize!==0&&rro.includes(n.method)&&!["no-store","reload"].includes(n.cache)){let{policy:c,response:l}=t.cache.get(n.url)||{};if(c&&c.satisfiesWithoutRevalidation(n)){l.headers=new z9r(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await nro(t,n);return n.cache!=="no-store"?iro(t,n,s):s},"cachingFetch"),_Gc=a((t,e={})=>{let r=new URL(t);if(typeof e!="object"||Array.isArray(e))throw new TypeError("qs: object expected");return Object.entries(e).forEach(([n,o])=>{Array.isArray(o)?o.forEach(s=>r.searchParams.append(n,s)):r.searchParams.append(n,o)}),r.href},"createUrl"),EGc=a(t=>new lGc(t),"timeoutSignal"),W9r=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:AGc,o=gGc;n===0&&(n=1,o=1);let s=a(({response:l},u)=>fGc(l),"sizeCalculation");this.cache=new iGc({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new nGc,this.options.h2=this.options.h2||{},typeof this.options.h2.enablePush>"u"&&(this.options.h2.enablePush=!0);let{enablePush:c}=this.options.h2;c&&(this.options.h2.pushPromiseHandler=(l,u,d)=>{let f={...u};Object.keys(f).filter(h=>h.startsWith(":")).forEach(h=>delete f[h]),this.pushPromiseHandler(l,f,d)},this.options.h2.pushHandler=(l,u,d)=>{let f={...u};Object.keys(f).filter(E=>E.startsWith(":")).forEach(E=>delete f[E]);let{statusCode:h,statusText:m,httpVersion:g,headers:A,readable:y,decoded:_}=d;this.pushHandler(l,f,new V9r(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:_}))}),this.context=hGc(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:oGc,Headers:z9r,Request:Poe,Response:V9r,AbortController:aGc,AbortSignal:cGc,FetchBaseError:sGc,FetchError:s6e,AbortError:Pwt,context:a((e={})=>new t(e).api(),"context"),setCA:a(e=>this.setCA(e),"setCA"),noCache:a((e={})=>new t({...e,maxCacheSize:0}).api(),"noCache"),h1:a((e={})=>new t({...e,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),"h1"),keepAlive:a((e={})=>new t({...e,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),"keepAlive"),h1NoCache:a((e={})=>new t({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),"h1NoCache"),keepAliveNoCache:a((e={})=>new t({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),"keepAliveNoCache"),reset:a(async()=>this.context.reset(),"reset"),onPush:a(e=>this.onPush(e),"onPush"),offPush:a(e=>this.offPush(e),"offPush"),createUrl:_Gc,timeoutSignal:EGc,clearCache:a(()=>this.clearCache(),"clearCache"),cacheStats:a(()=>this.cacheStats(),"cacheStats"),ALPN_HTTP2:this.context.ALPN_HTTP2,ALPN_HTTP2C:this.context.ALPN_HTTP2C,ALPN_HTTP1_1:this.context.ALPN_HTTP1_1,ALPN_HTTP1_0:this.context.ALPN_HTTP1_0}}async fetch(e,r){return yGc(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on($9r,e)}offPush(e){return this.eventEmitter.off($9r,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){G9r(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new Poe(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(G9r(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){G9r(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await iro(this,new Poe(e,{headers:r}),n);this.eventEmitter.emit($9r,e,o)}};oro.exports=new W9r().api()});var cro=I((sJh,aro)=>{"use strict";p();aro.exports=sro()});var kro=I((lem,Rro)=>{"use strict";p();function wro(t,e,r){let n=e[r];if(t==null&&n.required===!1)return;if(t==null)throw new TypeError(`Required parameter \`${n.name}\` missing`);let o=typeof t;if(n.type&&o!==n.type){if(n.required===!1&&e.slice(r).some(s=>s.type===o))return!1;throw new TypeError(`Invalid type for parameter \`${n.name}\`, expected \`${n.type}\` but found \`${typeof t}\``)}return!0}a(wro,"validateParameter");function WGc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(WGc,"hasOwnProperty");function zGc(t,e){return function(){let r=Array.prototype.slice.call(arguments),n=[];for(let s=0,c=0;s{n.push((l,u)=>{if(l)return c(l);s(u)}),t.apply(this,n)});t.apply(this,n)}}a(zGc,"defineOperation");Rro.exports={defineOperation:zGc,validateParameter:wro}});var e7r=I((fem,Nro)=>{"use strict";p();var gCe=F9e()("kerberos"),mCe=gCe.KerberosClient,Pro=gCe.KerberosServer,qW=kro().defineOperation,YGc=1,KGc=2,JGc=4,ZGc=8,XGc=16,e$c=32,t$c=64,r$c=128,n$c=256,Dro=0,i$c=9,o$c=6;mCe.prototype.step=qW(mCe.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);mCe.prototype.wrap=qW(mCe.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);mCe.prototype.unwrap=qW(mCe.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);Pro.prototype.step=qW(Pro.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var s$c=qW(gCe.checkPassword,[{name:"username",type:"string"},{name:"password",type:"string"},{name:"service",type:"string"},{name:"defaultRealm",type:"string",required:!1},{name:"callback",type:"function",required:!1}]),a$c=qW(gCe.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),c$c=qW(gCe.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:Dro}},{name:"callback",type:"function",required:!1}]),l$c=qW(gCe.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);Nro.exports={initializeClient:c$c,initializeServer:l$c,principalDetails:a$c,checkPassword:s$c,GSS_C_DELEG_FLAG:YGc,GSS_C_MUTUAL_FLAG:KGc,GSS_C_REPLAY_FLAG:JGc,GSS_C_SEQUENCE_FLAG:ZGc,GSS_C_CONF_FLAG:XGc,GSS_C_INTEG_FLAG:e$c,GSS_C_ANON_FLAG:t$c,GSS_C_PROT_READY_FLAG:r$c,GSS_C_TRANS_FLAG:n$c,GSS_C_NO_OID:Dro,GSS_MECH_OID_KRB5:i$c,GSS_MECH_OID_SPNEGO:o$c}});var Mro=I((hem,u$c)=>{u$c.exports={name:"kerberos",version:"2.2.0",description:"Kerberos library for Node.js",main:"lib/index.js",files:["lib","src","binding.gyp","HISTORY.md","README.md"],repository:{type:"git",url:"https://github.com/mongodb-js/kerberos.git"},keywords:["kerberos","security","authentication"],author:{name:"The MongoDB NodeJS Team",email:"dbx-node@mongodb.com"},bugs:{url:"https://jira.mongodb.org/projects/NODE/issues/"},dependencies:{bindings:"^1.5.0","node-addon-api":"^6.1.0","prebuild-install":"^7.1.2"},devDependencies:{"@types/node":"^22.2.0",chai:"^4.4.1","chai-string":"^1.5.0",chalk:"^4.1.2","clang-format":"^1.8.0","dmd-clear":"^0.1.2",eslint:"^9.9.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","jsdoc-to-markdown":"^8.0.3",mocha:"^10.7.3",mongodb:"^6.8.0","node-gyp":"^10.1.0",prebuild:"^13.0.0",prettier:"^3.3.3",request:"^2.88.2"},overrides:{prebuild:{"node-gyp":"$node-gyp"}},scripts:{install:"prebuild-install --runtime napi || node-gyp rebuild","format-cxx":"clang-format -i 'src/**/*'","format-js":"ESLINT_USE_FLAT_CONFIG=false eslint lib test --fix","check:lint":"ESLINT_USE_FLAT_CONFIG=false eslint lib test",precommit:"check-clang-format",docs:"jsdoc2md --template etc/README.hbs --plugin dmd-clear --files lib/kerberos.js > README.md",test:"mocha test",prebuild:"prebuild --runtime napi --strip --verbose --all"},engines:{node:">=12.9.0"},binary:{napi_versions:[4]},license:"Apache-2.0",readmeFilename:"README.md"}});var Lro=I((mem,Oro)=>{"use strict";p();var d$c=require("dns"),f$c=e7r(),t7r=class{static{a(this,"MongoAuthProcess")}constructor(e,r,n,o){o=o||{},this.host=e,this.port=r,this.serviceName=n||o.gssapiServiceName||"mongodb",this.canonicalizeHostName=typeof o.gssapiCanonicalizeHostName=="boolean"?o.gssapiCanonicalizeHostName:!1,this._transition=p$c(this),this.retries=10}init(e,r,n){let o=this;this.username=e,this.password=r;function s(c,l,u){if(!c)return u();d$c.resolveCname(l,(d,f)=>{if(d)return u(d);Array.isArray(f)&&f.length>0&&(o.host=f[0]),u()})}a(s,"performGssapiCanonicalizeHostName"),s(this.canonicalizeHostName,this.host,c=>{if(c)return n(c);let l={};r!=null&&Object.assign(l,{user:e,password:r});let u=process.platform==="win32"?`${this.serviceName}/${this.host}`:`${this.serviceName}@${this.host}`;f$c.initializeClient(u,l,(d,f)=>{if(d)return n(d,null);o.client=f,n(null,f)})})}transition(e,r){if(this._transition==null)return r(new Error("Transition finished"));this._transition(e,r)}};function p$c(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=h$c(t),r(null,o)})}}a(p$c,"firstTransition");function h$c(t){return(e,r)=>{t.client.step(e,(n,o)=>{if(n&&t.retries===0)return r(n);if(n)return t.retries=t.retries-1,t.transition(e,r);t._transition=m$c(t),r(null,o||"")})}}a(h$c,"secondTransition");function m$c(t){return(e,r)=>{t.client.unwrap(e,(n,o)=>{if(n)return r(n,!1);t.client.wrap(o,{user:t.username},(s,c)=>{if(s)return r(s,!1);t._transition=g$c(t),r(null,c)})})}}a(m$c,"thirdTransition");function g$c(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(g$c,"fourthTransition");Oro.exports={MongoAuthProcess:t7r}});var Fro=I((yem,l6e)=>{"use strict";p();var Bro=e7r();l6e.exports=Bro;l6e.exports.Kerberos=Bro;l6e.exports.version=Mro().version;l6e.exports.processes={MongoAuthProcess:Lro().MongoAuthProcess}});var dpo={};Ti(dpo,{AbortError:()=>e1,DirectConnectError:()=>Gk,DirectConnectTransport:()=>iqr,EXIT_REASONS:()=>JWc,HOOK_EVENTS:()=>oPt,InMemorySessionStore:()=>oQr,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>ZWc,createSdkMcpServer:()=>kcl,deleteSession:()=>kfl,filterEscalatingDefaultMode:()=>mfl,foldSessionSummary:()=>iso,forkSession:()=>Pfl,getSessionInfo:()=>xfl,getSessionMessages:()=>Tfl,getSubagentMessages:()=>Ofl,importSessionToStore:()=>Dfl,listSessions:()=>Ifl,listSubagents:()=>Mfl,parseDirectConnectUrl:()=>Ncl,query:()=>bfl,renameSession:()=>wfl,resolveSettings:()=>Afl,startup:()=>Sfl,tagSession:()=>Rfl,tool:()=>Rcl});function gVc(t){return this[t]}function EVc(t,e){this[t]=_Vc.bind(null,e)}function iQr(t=YWc){let e=new AbortController;return(0,Xoo.setMaxListeners)(t,e.signal),e}function eso(t,e,r){return new Promise((n,o)=>{if(e?.aborted){r?.throwOnAbort||r?.abortError?o(r.abortError?.()??Error("aborted")):n();return}let s=setTimeout((l,u,d)=>{l?.removeEventListener("abort",u),d()},t,e,c,n);function c(){clearTimeout(s),r?.throwOnAbort||r?.abortError?o(r.abortError?.()??Error("aborted")):n()}a(c,"G"),e?.addEventListener("abort",c,{once:!0}),r?.unref&&s.unref()})}function KWc(t,e){t(Error(e))}function joe(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(KWc,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function wqr(t,e){if(t.type!=="user"||t.isMeta===!0||t.isCompactSummary===!0)return;let r=t.message;if(!r)return;let n=r.content,o=[];if(typeof n=="string")o.push(n);else if(Array.isArray(n)){for(let s of n)if(!(!s||typeof s!="object")){if(s.type==="tool_result")return;s.type==="text"&&typeof s.text=="string"&&o.push(s.text)}}for(let s of o){let c=s.replaceAll(` +`," ").trim();if(!c)continue;let l=ezc.exec(c);if(l){e.commandFallback||(e.commandFallback=l[1]);continue}let u=/([\s\S]*?)<\/bash-input>/.exec(c);if(u)return`! ${u[1].trim()}`;if(!XWc.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function iso(t,e,r,n){let o=n?.mtime??t?.mtime??0,s=t!==void 0?{sessionId:t.sessionId,mtime:o,data:{...t.data}}:{sessionId:e.sessionId,mtime:o,data:{}},c=s.data;for(let l of r){let u=izc(l.timestamp);if(c.isSidechain===void 0&&(c.isSidechain=l.isSidechain===!0),c.createdAt===void 0&&u!==void 0&&(c.createdAt=u),c.cwd===void 0){let d=l.cwd;typeof d=="string"&&d&&(c.cwd=d)}ozc(c,l);for(let[d,f]of Object.entries(tzc)){let h=l[d];typeof h=="string"&&(c[f]=h)}if(l.type==="tag"){let d=l.tag;typeof d=="string"&&d?c.tag=d:delete c.tag}}return s}function rzc(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=$W(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=$W(r.customTitle)||$W(r.aiTitle)||void 0,s=o||$W(r.lastPrompt)||$W(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:$W(r.gitBranch)||void 0,cwd:$W(r.cwd)||e||void 0,tag:$W(r.tag)||void 0,createdAt:nzc(r.createdAt)}:null}function $W(t){return typeof t=="string"?t:void 0}function nzc(t){return typeof t=="number"?t:void 0}function izc(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function ozc(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=wqr(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function oso(){return process.versions.bun!==void 0}function bE(t){if(!t)return!1;if(typeof t=="boolean")return t;let e=String(t).toLowerCase().trim();return["1","true","yes","on"].includes(e)}function vUe(){let t=new Set;return{subscribe(e){return t.add(e),()=>{t.delete(e)}},emit(...e){let r;for(let n of t)try{n(...e)}catch(o){(r??=[]).push(o)}if(r)throw r.length===1?r[0]:AggregateError(r,"Signal listener(s) threw")},clear(){t.clear()}}}function fzc(t){var e=uzc.call(t,f6e),r=t[f6e];try{t[f6e]=void 0;var n=!0}catch{}var o=dzc.call(t);return n&&(e?t[f6e]=r:delete t[f6e]),o}function gzc(t){return mzc.call(t)}function Ezc(t){return t==null?t===void 0?_zc:yzc:Tno&&Tno in Object(t)?pzc(t):Azc(t)}function vzc(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Izc(t){if(!N9(t))return!1;var e=CUe(t);return e==bzc||e==Szc||e==Czc||e==Tzc}function wzc(t){return!!Ino&&Ino in t}function Dzc(t){if(t!=null){try{return Pzc.call(t)}catch{}try{return t+""}catch{}}return""}function qzc(t){if(!N9(t)||Rzc(t))return!1;var e=Rqr(t)?Qzc:Ozc;return e.test(Nzc(t))}function Hzc(t,e){return t?.[e]}function $zc(t,e){var r=Gzc(t,e);return jzc(r)?r:void 0}function Wzc(){this.__data__=V6e?V6e(null):{},this.size=0}function Yzc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function eYc(t){var e=this.__data__;if(V6e){var r=e[t];return r===Jzc?void 0:r}return Xzc.call(e,t)?e[t]:void 0}function iYc(t){var e=this.__data__;return V6e?e[t]!==void 0:nYc.call(e,t)}function aYc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=V6e&&e===void 0?sYc:e,this}function fbe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function vYc(t,e){var r=this.__data__,n=aPt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function pbe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,s=n[2]||0,c=n[3]||0;return{browser:e,version:`${o}.${s}.${c}`}}}return null}function WYc(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function pso(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function hso(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return pso({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function Mqr(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function zYc(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}function KYc(t){return Object.entries(t).filter(([e,r])=>typeof r<"u").map(([e,r])=>{if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return`${encodeURIComponent(e)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(e)}=`;throw new Ni(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function gso(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new mu(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new mu(`Refusing to send credential over non-https token endpoint "${t}"`)}async function Aso(t,e){let r=await nKc(t),n;try{n=JSON.parse(r)}catch{throw new mu(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,$k(r),e)}if(!n.access_token)throw new mu(`Token endpoint response missing access_token: ${JSON.stringify($k(n))}`,t.status,$k(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new mu(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,$k(n),e);return n}function $k(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=I7r?t:t.slice(0,I7r)+`... <${t.length-I7r} more chars>`}return JSON.stringify($k(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))rKc.has(r)&&(e[r]=n);return e}return null}async function yso(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new mu(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new mu(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function _so(t,e){let r=await import("node:fs"),n=(await import("node:path")).dirname(t);await r.promises.mkdir(n,{recursive:!0,mode:448});let o=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(e,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,t)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(n,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function nKc(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:s,value:c}=await e.read();if(s)break;if(n+c.length>Nno){let l=Nno-n;l>0&&r.push(c.subarray(0,l)),await e.cancel();break}r.push(c),n+=c.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((c,l)=>c+l.length,0));let s=0;for(let c of r)o.set(c,s),s+=c.length}return new TextDecoder("utf-8").decode(o)}function Hoe(){return Math.floor(Date.now()/1e3)}function iKc(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function Lqr(t){let e;return(Mno??(e=new globalThis.TextEncoder,Mno=e.encode.bind(e)))(t)}function Lno(t){let e;return(Ono??(e=new globalThis.TextDecoder,Ono=e.decode.bind(e)))(t)}function N6e(){}function aRt(t,e,r){return!e||HRt[t]>HRt[r]?N6e:e[t].bind(e)}function AA(t){let e=t.logger,r=t.logLevel??"off";if(!e)return oKc;let n=Fno.get(e);if(n&&n[0]===r)return n[1];let o={error:aRt("error",e,r),warn:aRt("warn",e,r),info:aRt("info",e,r),debug:aRt("debug",e,r)};return Fno.set(e,[r,o]),o}function vso(t){if(!t)throw Error("profile name is empty");if(t==="."||t==="..")throw Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw Error(`profile name "${t}" must not contain path separators`);if(!sKc.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function Uno(t){if(!t)throw new Ni("Identity token file path is empty");return async()=>{let e=await import("node:fs"),r;try{r=await e.promises.readFile(t,"utf-8")}catch(o){throw new Ni(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new Ni(`Identity token file at ${t} is empty`);return n}}function uKc(t){if(!t)throw new Ni("Identity token value is empty");return()=>t}function dKc(t){return async()=>{gso(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new mu(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:JYc,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${mso}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${jRt},${XYc}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${XW} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new mu(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=$k(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new mu(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await Aso(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new mu(`Token endpoint response missing required fields: ${JSON.stringify($k(c))}`,o.status,$k(c),s);return{token:c.access_token,expiresAt:Hoe()+l}}}function fKc(t){return async e=>{let r=await import("node:fs");await yso(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(_){throw new mu(`Credentials file not found at ${t.credentialsPath}: ${_}`)}let o;try{o=JSON.parse(n)}catch(_){throw new mu(`Credentials file at ${t.credentialsPath} is not valid JSON: ${_}`)}let s=o.access_token;if(!s)throw new mu(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||Hoe()"");throw new mu(`User OAuth refresh failed (HTTP ${f.status}): ${$k(_)}`,f.status,$k(_),h)}let m=await Aso(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new mu(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify($k(m))}`,f.status,$k(m),h);let A=Hoe()+g,y=m.refresh_token||l;return await _so(t.credentialsPath,{...o,version:Eso,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function bso(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=hKc(t,r,n,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:o,extraHeaders:s,baseURL:t.base_url||void 0}}async function pKc(t,e){let r=await aKc(e);if(!r)return null;let{config:n,fromFile:o}=r,s=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await cKc(n,e)??void 0}};return bso(s,t)}function hKc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=mKc(o);if(!s)throw new mu("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new mu("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new mu("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=dKc({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:t.organization_id,serviceAccountId:o.service_account_id,workspaceId:t.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});return e?gKc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new mu("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return fKc({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new mu(`authentication.type "${o}" is not a known authentication type`)}}}function mKc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new mu(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new mu('identity_token.source "file" requires a non-empty path');return Uno(t.identity_token.path)}let e=pu("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return Uno(e);let r=pu("ANTHROPIC_IDENTITY_TOKEN");return r?uKc(r):null}function gKc(t,e,r,n){return async o=>{let s=await import("node:fs");await yso(e,n);let c;try{let u=await s.promises.readFile(e,"utf-8");c=JSON.parse(u);let d=c?.access_token;if(d&&!o?.forceRefresh){let f=c?.expires_at;if(f==null||Hoe()0&&(yield e)}function vKc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function Sso(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return AA(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):Yoe.fromSSEResponse(r,e.controller);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let l=r.headers.get("content-type")?.split(";")[0]?.trim();if(l?.includes("application/json")||l?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let u=await r.json();return Tso(u,r)}return await r.text()})();return AA(t).debug(`[${n}] response parsed`,Qoe({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function Tso(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}function BCe(t,e,r){return Iso(),new File(t,e??"unknown_file",r)}function xRt(t,e){let r=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?r.split(/[\\/]/).pop()||void 0:r}function CKc(t){let e=typeof t=="function"?t:t.fetch,r=Qno.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return Qno.set(e,n),n}async function xKc(t,e,r){if(Iso(),t=await t,e||(e=xRt(t,!0)),TKc(t))return t instanceof File&&e==null&&r==null?t:BCe([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(IKc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),BCe(await pQr(o),e,r)}let n=await pQr(t);if(!r?.type){let o=n.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(r={...r,type:o})}return BCe(n,e,r)}async function pQr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(wso(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(xso(t))for await(let r of t)e.push(...await pQr(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${wKc(t)}`)}return e}function wKc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*RKc(t){if(!t)return;if(Rso in t){let{values:n,nulls:o}=t;yield*n.entries();for(let s of o)yield[s,null];return}let e=!1,r;t instanceof Headers?r=t.entries():wno(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw TypeError("expected header name to be a string");let s=wno(n[1])?n[1]:[n[1]],c=!1;for(let l of s)l!==void 0&&(e&&!c&&(c=!0,yield[o,null]),yield[o,l])}}function kso(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function wRt(t){return typeof t=="object"&&t!==null&&j6e in t}function Pso(t,e){let r=new Set;if(t)for(let n of t)wRt(n)&&r.add(n[j6e]);if(e){for(let n of e)if(wRt(n)&&r.add(n[j6e]),Array.isArray(n.content))for(let o of n.content)wRt(o)&&r.add(o[j6e])}return Array.from(r)}function Dso(t,e){let r=Pso(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function PKc(t){return wRt(t)?{"x-stainless-helper":t[j6e]}:{}}function Mso(t){return t?.output_format??t?.output_config?.format}function jno(t,e,r){let n=Mso(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null}:Oso(t,e,r)}function Oso(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=DKc(e,s.text);n===null&&(n=c);let l=Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function DKc(t,e){let r=Mso(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ni(`Failed to parse structured output: ${n}`)}}function Vno(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function zno(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function FKc(t,e=t.messages.at(-1),r){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let n=e.content.filter(o=>o.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async o=>{let s=t.tools.find(c=>("name"in c?c.name:c.mcp_server_name)===o.name);if(!s||!("run"in s))return{type:"tool_result",tool_use_id:o.id,content:`Error: Tool '${o.name}' not found`,is_error:!0};try{let c=o.input;"parse"in s&&s.parse&&(c=s.parse(c));let l=await s.run(c,{toolUseBlock:o,signal:r?.signal});return{type:"tool_result",tool_use_id:o.id,content:l}}catch(c){return{type:"tool_result",tool_use_id:o.id,content:c instanceof tkt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function Kno(t){if(!t.output_format)return t;if(t.output_config?.format)throw new Ni("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...r}=t;return{...r,output_config:{...t.output_config,format:e}}}function Bso(t){return t?.output_config?.format}function Jno(t,e,r){let n=Bso(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>o.type==="text"?Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1}):o),parsed_output:null}:Fso(t,e,r)}function Fso(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=QKc(e,s.text);return n===null&&(n=c),Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function QKc(t,e){let r=Bso(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ni(`Failed to parse structured output: ${n}`)}}function tio(t){return t.type==="tool_use"||t.type==="server_tool_use"}function bUe(t){return t instanceof Error?t:Error(String(t))}function kRt(t){return t instanceof Error?t.message:String(t)}function ix(t){if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code}function SUe(t){return ix(t)==="ENOENT"}function Qso(t){return ix(t)==="EISDIR"}function GKc(t){let e=ix(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function WKc(t,e,r){let n=`${t}.tmp.${(0,Hso.randomBytes)(4).toString("hex")}`;try{await(0,SB.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,SB.rename)(n,t)}catch(o){let s=ix(o);if(s!==void 0&&$Kc.has(s)){try{await(0,SB.copyFile)(n,t)}catch(c){throw VKc.has(ix(c)??"")&&await(0,SB.unlink)(t).catch(()=>{}),c}await(0,SB.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,SB.unlink)(n).catch(()=>{}),o}}function ukt(){return zKc.getStore()??new _Qr}function Gso(){if(xCe)return xCe;if(!bE(process.env.DEBUG_CLAUDE_AGENT_SDK))return Goe=null,xCe=Promise.resolve(),xCe;let t=(0,yQr.join)(mbe(),"debug");return Goe=(0,yQr.join)(t,`sdk-${(0,qso.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${Goe} +`),xCe=ukt().mkdir(t).catch(()=>{}),xCe}function YKc(){return Gso(),Goe??null}function jk(t){if(Goe===null)return;let e=`${new Date().toISOString()} ${t} +`;Gso().then(()=>{Goe&&ukt().append(Goe,e).catch(()=>{})})}function KKc(){this.__data__=new cPt,this.size=0}function ZKc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function eJc(t){return this.__data__.get(t)}function rJc(t){return this.__data__.has(t)}function oJc(t,e){var r=this.__data__;if(r instanceof cPt){var n=r.__data__;if(!cso||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=DJc}function iZc(t){return Abe(t)&&jqr(t.length)&&!!Od[CUe(t)]}function sZc(t){return function(e){return t(e)}}function pZc(t,e){var r=oz(t),n=!r&&Z6e(t),o=!r&&!n&&qqr(t),s=!r&&!n&&!o&&Yso(t),c=r||n||o||s,l=c?gJc(t.length,String):[],u=l.length;for(var d in t)(e||fZc.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||uPt(d,u)))&&l.push(d);return l}function gZc(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||mZc;return t===r}function AZc(t,e){return function(r){return t(e(r))}}function _Zc(t){return t!=null&&jqr(t.length)&&!Rqr(t)}function EZc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function SZc(t){if(!N9(t))return vZc(t);var e=Kso(t),r=[];for(var n in t)n=="constructor"&&(e||!bZc.call(t,n))||r.push(n);return r}function IZc(t){return Hqr(t)?hZc(t,!0):TZc(t)}function wZc(t,e){if(e)return t.slice();var r=t.length,n=lio?lio(r):new t.constructor(r);return t.copy(n),n}function RZc(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r{let y=u;u=null,y&&f(y.join(""))})}return a(g,"N"),{write(A){if(o){f(A);return}s.push(A),c+=A.length,m(),(s.length>=r||c>=n)&&g()},flush:h,dispose(){h()}}}function QXc(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function jXc(t){return qXc.register(t)}function GXc(t){let e=[],r=t.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])e.push("mcp"),e.push(r[1].toLowerCase());else{let s=t.match(/^([^:[]+):/);s&&s[1]&&e.push(s[1].trim().toLowerCase())}let n=t.match(/^\[([^\]]+)]/);n&&n[1]&&e.push(n[1].trim().toLowerCase()),t.toLowerCase().includes("1p event:")&&e.push("1p");let o=t.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(o&&o[1]){let s=o[1].trim().toLowerCase();s.length<30&&!s.includes(" ")&&e.push(s)}return Array.from(new Set(e))}function $Xc(t,e){return e?t.length===0?!1:e.isExclusive?!t.some(r=>e.exclude.includes(r)):t.some(r=>e.include.includes(r)):!0}function VXc(t,e){if(!e)return!0;let r=GXc(t);return $Xc(r,e)}function WXc(t){return/^[\\/]{2}/.test(t)}function zXc(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function hio(t){try{return zXc(oao.realpathSync.native(t))}catch{return null}}function YXc(t,e){let r=(0,TB.resolve)(e).toLowerCase(),n=(0,TB.resolve)(t).toLowerCase();if((0,TB.dirname)(n)===r||n.startsWith(r+TB.sep))return!0;let o=hio(e)?.toLowerCase();if(o==null)return!1;let s=hio((0,TB.dirname)((0,TB.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+TB.sep)}function sao(t,e){if(WXc(e))return{resolvedPath:e,isSymlink:!1,isCanonical:!1};try{let r=t.lstatSync(e);if(r.isFIFO()||r.isSocket()||r.isCharacterDevice()||r.isBlockDevice())return{resolvedPath:e,isSymlink:!1,isCanonical:!1};let n=t.realpathSync(e);return{resolvedPath:n,isSymlink:n!==e,isCanonical:!0}}catch{return{resolvedPath:e,isSymlink:!1,isCanonical:!1}}}function ox(){return JXc}function ZXc(t,e){t.destroyed||t.write(e)}function XXc(t){ZXc(process.stderr,t)}function eel(t){return t.charAt(0).toUpperCase()+t.slice(1)}function tel(t,e,r=e+"s"){return t===1?e:r}function rel(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function sel(t){return oel.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function ael(t){Aio??=sel(!0);for(let e of Aio)t=t.replace(e.re,(r,n)=>{if(typeof n!="string")return"[REDACTED]";let o=n.length>=2&&(n[0]==='"'||n[0]==="'")&&n.at(-1)===n[0]?n[0]:"",s=r.lastIndexOf(n);return`${r.slice(0,s)}${o}[REDACTED]${o}${r.slice(s+n.length)}`});return t}function fPt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function del(t){if(!SQr()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=uel();return VXc(t,e)}async function lao(t,e,r=pel){if(w6e<0?w6e=await(0,IE.stat)(t).then(n=>n.size).catch(()=>0):w6e+=e,!(w6e<=r||F7r)){F7r=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,IE.rename)(t,n)}catch(o){SUe(o)||(await(0,IE.unlink)(n).catch(()=>{}),await(0,IE.rename)(t,n).catch(()=>(0,IE.unlink)(t).catch(()=>{})))}w6e=0}finally{F7r=!1}}}function uao(t){return TQr=(0,rse.join)(t,`${iao()}.txt`),TQr}async function hel(t,e,r,n){t&&await(0,IE.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,IE.appendFile)(r,n)}catch(s){if(!Qso(s))throw s;o=uao(r),await(0,IE.appendFile)(o,n)}await lao(o,Buffer.byteLength(n)).catch(IQr),fao()}function IQr(){}function mel(){if(!CRt){let t=null;CRt=UXc({writeFn:a(e=>{let r=dao(),n=(0,rse.dirname)(r),o=t!==n;if(t=n,SQr()){if(o)try{ox().mkdirSync(n)}catch{}let s=r;try{ox().appendFileSync(r,e)}catch(c){if(!Qso(c))throw c;s=uao(r),ox().appendFileSync(s,e)}lao(s,Buffer.byteLength(e)).catch(IQr),fao();return}B7r=B7r.then(hel.bind(null,o,n,r,e)).catch(IQr)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:SQr()}),jXc(async()=>{CRt?.dispose(),await B7r})}return CRt}function hu(t,{level:e}={level:"debug"}){if(bQr[e]t.endsWith(e))}function Tel(t,e){return(0,rso.existsSync)(t)?e?`Claude Code native binary at ${t} exists but failed to launch.`:`Claude Code executable at ${t} exists but failed to launch.`:e?`Claude Code native binary not found at ${t}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${t}. Is options.pathToClaudeCodeExecutable set?`}function Iel(){if(process.platform!=="linux")return!1;let t=typeof process.report?.getReport=="function"?process.report.getReport():null;return t!=null&&t.header?.glibcVersionRuntime===void 0}function xel(t,e=process.platform,r=process.arch,n=pao.existsSync,o=Iel()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${wCe}-linux-${r}-android`]:e==="linux"?o?[`${wCe}-linux-${r}-musl`,`${wCe}-linux-${r}`]:[`${wCe}-linux-${r}`,`${wCe}-linux-${r}-musl`]:[`${wCe}-${e}-${r}`]).map(l=>`${l}/claude${s}`);for(let l of c)try{let u=t(l);if(n(u))return u}catch{}return null}function wel(){return{eventQueue:[],sink:null}}function Yqr(t,e){let r=Rel;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function hao(t){Yqr("tengu_feature_ok",{feature_name:t})}function mao(t,e,r){Yqr("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function kel(t,e,r){Yqr("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function I9(t,e,r){try{let n=await e();return hao(t),n}catch(n){throw mao(t,r?.(n)??"error"),n}}function Del(t){let e=t,r="",n=0,o=10;for(;e!==r&&n=o)throw Error(`Unicode sanitization reached maximum iterations (${o}) for input: ${t.slice(0,100)}`);return e}function G6e(t){if(typeof t=="string")return Del(t);if(Array.isArray(t))return t.map(G6e);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[G6e(r)]=G6e(n);return e}return t}function Nel(){return process.platform==="win32"}function Oel(t){let e=U7r.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,vao.join)(r,"System32","where.exe");try{let o=(0,Eao.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:Mel,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!YXc(c,s))return U7r.set(t,c),c;return null}catch(o){return Lel(o)&&U7r.set(t,null),null}}function Lel(t){if(t===null||typeof t!="object")return!1;let e="status"in t?t.status:void 0,r="signal"in t?t.signal:void 0,n="code"in t?t.code:void 0;return e===1&&!r&&!n}function Bel(t){return!Nel()||t.includes("/")||t.includes("\\")?t:Oel(t)}async function TUe(t){let e=Bel("git");if(e===null)return[];try{let{stdout:r}=await Fel(e,["worktree","list","--porcelain"],{cwd:t,timeout:5e3});return r?r.split(` +`).filter(n=>n.startsWith("worktree ")).map(n=>n.slice(9).normalize("NFC")):[]}catch{return[]}}function Uel(t){let e=0;for(let r=0;ro&&(n=Cao(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function DQr(t,e){let r=(0,Aao.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` +`)||await(0,PQr.once)(r,"drain");r.end(),await(0,PQr.once)(r,"finish")}catch(n){throw r.destroy(),n}}function bao(t){let e=0,r={commandFallback:""};for(;e=0?t.slice(e,n):t.slice(e);if(e=n>=0?n+1:t.length,!(!o.includes('"type":"user"')&&!o.includes('"type": "user"'))&&!o.includes('"tool_result"')&&!(o.includes('"isMeta":true')||o.includes('"isMeta": true'))&&!(o.includes('"isCompactSummary":true')||o.includes('"isCompactSummary": true')))try{let s=JSON.parse(o),c=wqr(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function qel(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=wqr(r,e);if(n!==void 0)return n}return e.commandFallback}async function Sao(t){try{let e=await(0,AM.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe(k9),o=await e.read(n,0,k9,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-k9),l=s;if(c>0){let u=await e.read(n,0,k9,c);l=n.toString("utf8",0,u.bytesRead)}return{mtime:r.mtime.getTime(),size:r.size,head:s,tail:l}}finally{await e.close()}}catch{return null}}function jel(t){return Math.abs(Uel(t)).toString(36)}function IUe(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=X6e?e:`${e.slice(0,X6e)}-${jel(t)}`}function uz(){return(0,VCe.join)(mbe(),"projects")}function Hel(t){return(0,VCe.join)(uz(),IUe(t))}async function xUe(t){try{return(await(0,AM.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function mM(t){let e=Hel(t),r=[];try{await(0,AM.readdir)(e),r.push(e)}catch{}let n=IUe(t);if(n.length<=X6e)return r;let o=n.slice(0,X6e)+"-",s=uz();try{for(let c of await(0,AM.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,VCe.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function pPt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,VCe.join)(c,r);try{let d=await(0,AM.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await xUe(e);for(let u of await mM(c)){let d=await n(u,c);if(d)return d}let l;try{l=await TUe(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await mM(u)){let f=await n(d,u);if(f)return f}return}let o=uz(),s;try{s=await(0,AM.readdir)(o)}catch{return}for(let c of s){let l=await n((0,VCe.join)(o,c),void 0);if(l)return l}}function Wel(){return Vel??=Buffer.from('"compact_boundary"')}function Tao(t){try{let e=JSON.parse(t);return e.type!=="system"||e.subtype!=="compact_boundary"?null:{hasPreservedSegment:!!(e.compactMetadata?.preservedSegment||e.compactMetadata?.preservedMessages)}}catch{return null}}function $oe(t,e,r,n){let o=n-r;if(!(o<=0)){if(t.len+o>t.buf.length){let s=Buffer.allocUnsafe(Math.min(Math.max(t.buf.length*2,t.len+o),t.cap));t.buf.copy(s,0,0,t.len),t.buf=s}e.copy(t.buf,t.len,r,n),t.len+=o}}function gkt(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function Jel(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(eUe);if(o===-1||o>=r)return 0;let s=o+1;if(gkt(n,Akt,0,t.carryLen))t.straddleSnapCarryLen=t.carryLen,t.straddleSnapTailEnd=s,t.lastSnapSrc=null;else{if(t.carryLen=s&&nt.lastSnapBuf.length)&&(t.lastSnapBuf=Buffer.allocUnsafe(t.lastSnapLen)),e.copy(t.lastSnapBuf,0,n,o),t.lastSnapSrc=t.lastSnapBuf):t.straddleSnapCarryLen>0&&(t.lastSnapLen=t.straddleSnapCarryLen+t.straddleSnapTailEnd,(t.lastSnapBuf===void 0||t.lastSnapLen>t.lastSnapBuf.length)&&(t.lastSnapBuf=Buffer.allocUnsafe(t.lastSnapLen)),t.carryBuf.copy(t.lastSnapBuf,0,0,t.straddleSnapCarryLen),r.copy(t.lastSnapBuf,t.straddleSnapCarryLen,0,t.straddleSnapTailEnd),t.lastSnapSrc=t.lastSnapBuf)}function etl(t,e,r){t.carryLen=e.length-r,t.carryLen>0&&((t.carryBuf===void 0||t.carryLen>t.carryBuf.length)&&(t.carryBuf=Buffer.allocUnsafe(t.carryLen)),e.copy(t.carryBuf,0,r,e.length))}function ttl(t){if(t.carryLen>0){let e=t.carryBuf;gkt(e,Akt,0,t.carryLen)?(t.lastSnapSrc=e,t.lastSnapLen=t.carryLen):$oe(t.out,e,0,t.carryLen)}t.lastSnapSrc&&(t.out.len>0&&t.out.buf[t.out.len-1]!==eUe&&$oe(t.out,Yel,0,1),$oe(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function rtl(t,e){let r=Wel(),n=Gel,o={out:{buf:Buffer.allocUnsafe(Math.min(e,8388608)),len:0,cap:e+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},s=Buffer.allocUnsafe(n),c=await(0,AM.open)(t,"r");try{let l=0;for(;l0){let m=o.carryLen+(u-d);f=Buffer.allocUnsafe(m),o.carryBuf.copy(f,0,0,o.carryLen),s.copy(f,o.carryLen,d,u)}else f=s.subarray(d,u);let h=Zel(o,f,r);Xel(o,f,s,h.lastSnapStart,h.lastSnapEnd),etl(o,f,h.trailStart),o.bufFileOff+=h.trailStart}ttl(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function ntl(t,e){try{return e>$el&&!bE(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await rtl(t,e)).postBoundaryBuf:await(0,gao.readFile)(t)}catch{return null}}function itl(t){let e=[];try{let o=pf(e,mf`parseTranscriptEntries(${t.length} bytes)`,0),s=[],c=10,l=t.length,u=0;for(;u=d)continue;let h=t.toString("utf-8",f,d);try{let m=yel(h),g=m.type;(g==="user"||g==="assistant"||g==="progress"||g==="system"||g==="attachment")&&typeof m.uuid=="string"&&s.push(m)}catch{}}return s}catch(o){var r=o,n=1}finally{hf(e,r,n)}}function otl(t){let e=new Map;for(let m of t)e.set(m.uuid,m);for(let m of e.values()){if(m.type!=="system"||m.subtype!=="compact_boundary")continue;let g=m.compactMetadata?.preservedMessages,A=m.compactMetadata?.preservedSegment;if(g){if(g.uuids.length===0||g.uuids.some(v=>!e.has(v)))continue;let y=g.anchorUuid;for(let v of g.uuids){let S=e.get(v);e.set(v,{...S,parentUuid:y}),y=v}let _=g.uuids[0],E=g.uuids.at(-1);for(let[v,S]of e)S.parentUuid===g.anchorUuid&&v!==_&&e.set(v,{...S,parentUuid:E})}else if(A){let y=e.get(A.headUuid);y&&e.set(A.headUuid,{...y,parentUuid:A.anchorUuid});for(let[_,E]of e)E.parentUuid===A.anchorUuid&&_!==A.headUuid&&e.set(_,{...E,parentUuid:A.tailUuid})}}let r=new Map;for(let m=0;m!n.has(m.uuid)),s=[];for(let m of o){let g=m,A=new Set;for(;g&&!A.has(g.uuid);){if(A.add(g.uuid),g.type==="user"||g.type==="assistant"){s.push(g);break}g=g.parentUuid?e.get(g.parentUuid):void 0}}if(s.length===0)return[];let c=s.filter(m=>!m.isSidechain&&!m.teamName&&!m.isMeta),l=a(m=>m.reduce((g,A)=>(r.get(A.uuid)??-1)>(r.get(g.uuid)??-1)?A:g),"U"),u=c.length>0?l(c):l(s),d=[],f=new Set,h=e.get(u.uuid);for(;h&&!f.has(h.uuid);)f.add(h.uuid),d.push(h),h=h.parentUuid?e.get(h.parentUuid):void 0;return d.reverse(),atl(e,d,f)}function q7r(t){if(t.type!=="assistant")return;let e=t.message;if(typeof e!="object"||e===null)return;let r=e.id;return typeof r=="string"?r:void 0}function stl(t){if(t.type!=="user"||!t.parentUuid)return!1;let e=t.message;if(typeof e!="object"||e===null)return!1;let r=e.content;return Array.isArray(r)?r.some(n=>typeof n=="object"&&n!==null&&n.type==="tool_result"):!1}function atl(t,e,r){let n=e.filter(h=>h.type==="assistant");if(n.length===0)return e;let o=new Map;for(let h of n){let m=q7r(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=q7r(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(stl(h)){let g=h.parentUuid,A=c.get(g);A?A.push(h):c.set(g,[h])}}let l=new Set,u=new Map,d=0;for(let h of n){let m=q7r(h);if(!m||l.has(m))continue;l.add(m);let g=s.get(m)??[h],A=g.filter(S=>!r.has(S.uuid)),y=[];for(let S of g){let T=c.get(S.uuid);if(T)for(let w of T)r.has(w.uuid)||y.push(w)}if(A.length===0&&y.length===0)continue;let _=a((S,T)=>(S.timestamp??"").localeCompare(T.timestamp??""),"D");A.sort(_),y.sort(_);let E=o.get(m),v=[...A,...y];for(let S of v)r.add(S.uuid);d+=v.length,u.set(E.uuid,v)}if(d===0)return e;let f=[];for(let h of e){f.push(h);let m=u.get(h.uuid);m&&f.push(...m)}return f}function ctl(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function Iao(t,e){return{type:t.type,uuid:t.uuid,session_id:t.sessionId,message:t.message,parent_tool_use_id:e??null,timestamp:t.timestamp}}function xao(t,e){let r=e?.offset??0;return e?.limit!==void 0&&e.limit>0?t.slice(r,r+e.limit):r>0?t.slice(r):t}function ltl(t,e){let r=[];for(let n of t){if(typeof n!="object"||n===null)continue;let o=n,s=o.type;(s==="user"||s==="assistant"||s==="progress"||s==="system"||s==="attachment")&&typeof o.uuid=="string"&&r.push(o)}return wao(r,e)}function wao(t,e){let r=otl(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>ctl(s,n)).map(s=>Iao(s));return xao(o,e)}async function utl(t,e){if(!Uh(t))return[];let r=await pPt(t,e?.dir);if(!r)return[];let n=await ntl(r.filePath,r.fileSize);return n?wao(itl(n),e):[]}function hPt(t,e,r){let{head:n,tail:o,mtime:s,size:c}=e,l=n.indexOf(` +`),u=l>=0?n.slice(0,l):n;if(u.includes('"isSidechain":true')||u.includes('"isSidechain": true'))return null;let d=Hk(o,"customTitle")||Hk(n,"customTitle")||Hk(o,"aiTitle")||Hk(n,"aiTitle")||void 0,f=bao(n)||void 0,h=Q7r(n,"timestamp"),m;if(h){let v=Date.parse(h);Number.isNaN(v)||(m=v)}let g=d||Hk(o,"lastPrompt")||Hk(o,"summary")||f;if(!g)return null;let A=Hk(o,"gitBranch")||Q7r(n,"gitBranch")||void 0,y=Q7r(n,"cwd")||r||void 0,_=o.split(` +`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),E=_&&Hk(_,"tag")||void 0;return{sessionId:t,summary:g,lastModified:s,fileSize:c,customTitle:d,firstPrompt:f,gitBranch:A,cwd:y,tag:E,createdAt:m}}async function F6e(t,e,r){let n;try{n=await(0,ybe.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=Uh(o.slice(0,-6));if(!s)return null;let c=(0,_be.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,ybe.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function Rao(t){let e=await Sao(t.filePath);if(!e)return null;let r=hPt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function ftl(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function ptl(t,e,r){t.sort(ftl);let n=[],o=e&&e>0?e:1/0,s=0,c=new Set;for(let l=0;ls.lastModified)&&r.set(o.sessionId,o)}let n=[...r.values()];return n.sort((o,s)=>s.lastModified!==o.lastModified?s.lastModified-o.lastModified:s.sessionIdo.sessionId?1:0),n}async function mtl(t,e,r){let n=await xUe(t),o;if(e)try{o=await TUe(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await mM(n))h.push(...await F6e(m,r,n));return h}let s=uz(),c=process.platform==="win32",l=o.map(h=>{let m=IUe(h);return{path:h,prefix:c?m.toLowerCase():m}});l.sort((h,m)=>m.prefix.length-h.prefix.length);let u;try{u=await(0,ybe.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await mM(n))h.push(...await F6e(m,r,n));return h}let d=[],f=new Set;for(let h of await mM(n)){let m=(0,_be.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await F6e(h,r,n))}for(let h of u){if(!h.isDirectory())continue;let m=c?h.name.toLowerCase():h.name;if(!f.has(m)){for(let{path:g,prefix:A}of l)if(m===A||A.length>=X6e&&m.startsWith(A+"-")){f.add(m),d.push(...await F6e((0,_be.join)(s,h.name),r,g));break}}}return d}async function gtl(t){let e=uz(),r;try{r=await(0,ybe.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>F6e((0,_be.join)(e,n.name),t)))).flat()}async function Atl(t){let{dir:e,limit:r,offset:n,includeWorktrees:o}=t??{},s=n??0,c=r!==void 0&&r>0||s>0,l=e?await mtl(e,o??!0,c):await gtl(c);return c?ptl(l,r,s):htl(l)}async function ytl(t,e={}){let r=Uh(t);if(!r)return;let n=await pPt(r,e.dir);if(!n)return;let o=await Sao(n.filePath);if(o)return hPt(r,o,n.projectPath)??void 0}async function _tl(t,e,r={}){if(!Uh(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=eg({type:"custom-title",customTitle:e.trim(),sessionId:t})+` +`;await kao(t,n,r)}async function Etl(t,e,r={}){if(!Uh(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=G6e(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=eg({type:"tag",tag:e??"",sessionId:t})+` +`;await kao(t,n,r)}async function vtl(t,e={}){if(!Uh(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await Ctl(e)){let n=(0,Voe.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,IB.stat)(n))}catch(s){let c=ix(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,IB.rm)(n,{force:!0}),await(0,IB.rm)((0,Voe.join)(r,t),{recursive:!0,force:!0});return}}throw Error(e.dir?`Session ${t} not found in project directory for ${e.dir}`:`Session ${t} not found in any project directory`)}async function Ctl(t){if(t.dir){let r=await xUe(t.dir),n=await mM(r),o;try{o=await TUe(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await mM(s));return n}let e=uz();try{return(await(0,IB.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,Voe.join)(e,r.name))}catch{return[]}}async function kao(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await xUe(r.dir);for(let u of await mM(c))if(await j7r((0,Voe.join)(u,n),e))return;let l;try{l=await TUe(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await mM(u))if(await j7r((0,Voe.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=uz(),s;try{s=await(0,IB.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await j7r((0,Voe.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function j7r(t,e){let r;try{r=await(0,IB.open)(t,NQr.constants.O_WRONLY|NQr.constants.O_APPEND)}catch(n){let o=ix(n);if(o==="ENOENT"||o==="ENOTDIR")return!1;throw n}try{let{size:n}=await r.stat();if(n===0)return!1;let o=process.platform==="win32"?n:void 0;return await r.write(e,o,"utf8"),!0}finally{await r.close()}}async function btl(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await ukt().readBytes((0,ykt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await xUe(e);for(let u of await mM(c)){let d=await n(u);if(d)return d}let l;try{l=await TUe(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await mM(u)){let f=await n(d);if(f)return f}return null}let o=uz(),s;try{s=await ukt().list(o)}catch{return null}for(let c of s){let l=await n((0,ykt.join)(o,c));if(l)return l}return null}function Ttl(t,e){let r=[],n=[],o=10,s=t.length,c=0;for(;c=l)continue;let d=t.toString("utf-8",u,l);try{Pao(CM(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function Itl(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||Pao(o,e,r,n);return{transcript:r,contentReplacements:n}}function Pao(t,e,r,n){Stl.has(t.type)&&typeof t.uuid=="string"?r.push(t):t.type==="content-replacement"&&t.sessionId===e&&Array.isArray(t.replacements)&&n.push(...t.replacements)}async function xtl(t,e={}){if(!Uh(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!Uh(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await btl(t,e.dir);if(!r)throw Error(e.dir?`Session ${t} not found in project directory for ${e.dir}`:`Session ${t} not found`);let{entries:n,forkedSessionId:o}=wtl(r.buf,t,e);return await DQr((0,ykt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function wtl(t,e,r){let n=Ttl(t,e);return Dao(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,k9)),c=t.toString("utf-8",Math.max(0,o-k9));return Hk(c,"customTitle")||Hk(s,"customTitle")||Hk(c,"aiTitle")||Hk(s,"aiTitle")||bao(s)})}function Rtl(t,e,r){let n=Itl(t,e);return Dao(n,e,r,()=>ktl(t))}function ktl(t){let e,r;for(let n of t){if(typeof n!="object"||n===null)continue;let o=n;typeof o.customTitle=="string"&&o.customTitle&&(e=o.customTitle),typeof o.aiTitle=="string"&&o.aiTitle&&(r=o.aiTitle)}return e||r||qel(t)||void 0}function Dao(t,e,r,n){let o=t.transcript.filter(m=>!m.isSidechain);if(o.length===0)throw Error(`Session ${e} has no messages to fork`);if(r.upToMessageId){let m=o.findIndex(g=>g.uuid===r.upToMessageId);if(m===-1)throw Error(`Message ${r.upToMessageId} not found in session ${e}`);o=o.slice(0,m+1)}let s=new Map;for(let m of o)s.set(m.uuid,(0,U6e.randomUUID)());let c=o.filter(m=>m.type!=="progress");if(c.length===0)throw Error(`Session ${e} has no messages to fork`);let l=new Map;for(let m of o)l.set(m.uuid,m);let u=(0,U6e.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,U6e.randomUUID)(),timestamp:d});let h=r.title?.trim();return h||(h=`${n()||"Forked session"} (fork)`),f.push({type:"custom-title",sessionId:u,customTitle:h,uuid:(0,U6e.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function Nao(t,e){let r=await pPt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,_kt.join)(n,"subagents")}async function Mao(t){let e=[];async function r(n){let o;try{o=await(0,tUe.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o)if(s.isFile()&&s.name.startsWith("agent-")&&s.name.endsWith(".jsonl")){let c=s.name.slice(6,-6);e.push({agentId:c,filePath:(0,_kt.join)(n,s.name)})}else s.isDirectory()&&await r((0,_kt.join)(n,s.name))}return a(r,"J"),await r(t),e}function Ptl(t){let e=[],r=10,n=t.length,o=0;for(;o=s)continue;let l=t.toString("utf-8",c,s);try{let u=CM(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function Dtl(t){if(t.length===0)return[];let e=new Map;for(let c of t)e.set(c.uuid,c);let r=t.findLast(c=>c.type==="user"||c.type==="assistant");if(!r)return[];let n=[],o=new Set,s=r;for(;s&&!o.has(s.uuid);)o.add(s.uuid),n.push(s),s=s.parentUuid?e.get(s.parentUuid):void 0;return n.reverse(),n}async function Ntl(t,e){if(!Uh(t))return[];let r=await Nao(t,e?.dir);return r?(await Mao(r)).map(n=>n.agentId):[]}async function Mtl(t,e,r){if(!Uh(t))return[];if(!e)return[];let n=await Nao(t,r?.dir);if(!n)return[];let o=(await Mao(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,tUe.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=CM(await(0,tUe.readFile)(l,"utf-8")).toolUseId}catch{}return Oao(s,r,c)}function Oao(t,e,r){if(t.length===0)return[];let n=Ptl(t),o=Dtl(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>Iao(s,r));return xao(o,e)}function Fao(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function Uao(t){return[...new Set(t)]}function Otl(){return"prod"}function qtl(){let t=process.env.CLAUDE_LOCAL_OAUTH_API_BASE?.replace(/\/$/,"")??"http://localhost:8000",e=process.env.CLAUDE_LOCAL_OAUTH_APPS_BASE?.replace(/\/$/,"")??"http://localhost:4000",r=process.env.CLAUDE_LOCAL_OAUTH_CONSOLE_BASE?.replace(/\/$/,"")??"http://localhost:3000";return{BASE_API_URL:t,CONSOLE_AUTHORIZE_URL:`${r}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${e}/oauth/authorize`,CLAUDE_AI_ORIGIN:e,TOKEN_URL:`${t}/v1/oauth/token`,API_KEY_URL:`${t}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${t}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${r}/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`${r}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${r}/oauth/code/callback`,CLIENT_ID:"22422756-60c9-4084-8eb7-27705fd5cf9a",OAUTH_FILE_SUFFIX:"-local-oauth",MCP_PROXY_URL:"http://localhost:8205",MCP_PROXY_PATH:"/v1/toolbox/shttp/mcp/{server_id}"}}function Htl(){let t=(()=>{switch(Otl()){case"local":return qtl();case"staging":return Qtl??Eio;case"prod":return Eio}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!jtl.includes(n))throw Error("CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.");t={...t,BASE_API_URL:n,CONSOLE_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_ORIGIN:n,TOKEN_URL:`${n}/v1/oauth/token`,API_KEY_URL:`${n}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${n}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${n}/oauth/code/callback`,OAUTH_FILE_SUFFIX:"-custom-oauth"}}let r=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;return r&&(t={...t,CLIENT_ID:r}),t}function $tl(t=""){let e=process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR,r=e!==void 0?!e:!process.env.CLAUDE_CONFIG_DIR,n=e!==void 0?e.normalize("NFC"):mbe(),o=r?"":`-${(0,Lao.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${Htl().OAUTH_FILE_SUFFIX}${t}${o}`}function Wtl(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,Bao.userInfo)().username}catch{t="claude-code-user"}return Vtl.test(t)?t:"claude-code-user"}function MQr(){return Ytl}function hn(t,e){let r=MQr(),n=OQr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===rUe?void 0:rUe].filter(o=>!!o)});t.common.issues.push(n)}function ns(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:a((s,c)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??c.defaultError}:typeof c.data>"u"?{message:l??n??c.defaultError}:s.code!=="invalid_type"?{message:c.defaultError}:{message:l??r??c.defaultError}},"errorMap"),description:o}}function jao(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function frl(t){return new RegExp(`^${jao(t)}$`)}function prl(t){let e=`${qao}T${jao(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function hrl(t,e){return!!((e==="v4"||!e)&&orl.test(t)||(e==="v6"||!e)&&arl.test(t))}function mrl(t,e){if(!trl.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function grl(t,e){return!!((e==="v4"||!e)&&srl.test(t)||(e==="v6"||!e)&&crl.test(t))}function Arl(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}function DCe(t){if(t instanceof sx){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=zk.create(DCe(n))}return new sx({...t._def,shape:a(()=>e,"shape")})}else return t instanceof az?new az({...t._def,type:DCe(t.element)}):t instanceof zk?zk.create(DCe(t.unwrap())):t instanceof O9?O9.create(DCe(t.unwrap())):t instanceof M9?M9.create(t.items.map(e=>DCe(e))):t}function BQr(t,e){let r=JW(t),n=JW(e);if(t===e)return{valid:!0,data:t};if(r===Dn.object&&n===Dn.object){let o=bc.objectKeys(e),s=bc.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=BQr(t[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(r===Dn.array&&n===Dn.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;sr?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}function _C(t){return t&&Object.assign(bkt,t),bkt}function _rl(t){return t}function Erl(t){return t}function vrl(t){}function Crl(t){throw Error()}function brl(t){}function Zqr(t){let e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,n])=>e.indexOf(+r)===-1).map(([r,n])=>n)}function Kr(t,e="|"){return t.map(r=>gs(r)).join(e)}function Wao(t,e){return typeof e=="bigint"?e.toString():e}function mPt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function nse(t){return t==null}function gPt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function zao(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}function sl(t,e,r){Object.defineProperty(t,e,{get(){{let n=r();return t[e]=n,n}throw Error("cached value already set")},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function Xqr(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Srl(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function Trl(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;se,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}function Rrl(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function gs(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Jao(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function krl(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return bM(t,{...t._zod.def,shape:r,checks:[]})}function Prl(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return bM(t,{...t._zod.def,shape:r,checks:[]})}function Drl(t,e){if(!hUe(e))throw Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return Xqr(this,"shape",n),n},checks:[]};return bM(t,r)}function Nrl(t,e){return bM(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return Xqr(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function Mrl(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return bM(e,{...e._zod.def,shape:o,checks:[]})}function Orl(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return bM(e,{...e._zod.def,shape:o,checks:[]})}function FCe(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function q6e(t){return typeof t=="string"?t:t?.message}function _M(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=q6e(t.inst?._zod.def?.error?.(t))??q6e(e?.error?.(t))??q6e(r.customError?.(t))??q6e(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function APt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function yPt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function eco(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function Lrl(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function rjr(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}function njr(t,e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>o({issues:l}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;u{var l,u;for(let d of s.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>o({issues:f},d.path));else if(d.code==="invalid_key")o({issues:d.issues},d.path);else if(d.code==="invalid_element")o({issues:d.issues},d.path);else{let f=[...c,...d.path];if(f.length===0){n.errors.push(r(d));continue}let h=n,m=0;for(;mn.path.length-o.path.length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${nco(n.path)}`);return e.join(` +`)}function hco(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function Sco(t){return typeof t.precision=="number"?t.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":t.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${t.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Tco(t){return new RegExp(`^${Sco(t)}$`)}function Ico(t){let e=Sco({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Cco}T(?:${n})$`)}function Tio(t,e,r){t.issues.length&&e.issues.push(...Vk(r,t.issues))}function fjr(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function Clo(t){if(!ljr.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return fjr(r)}function Tlo(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}function Iio(t,e,r){t.issues.length&&e.issues.push(...Vk(r,t.issues)),e.value[r]=t.value}function bRt(t,e,r){t.issues.length&&e.issues.push(...Vk(r,t.issues)),e.value[r]=t.value}function xio(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...Vk(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function wio(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>_M(s,n,_C())))}),e}function qQr(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(hUe(t)&&hUe(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let c=qQr(t[s],e[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n_M(l,c,_C()))})),e.issues.length&&(Skt.has(typeof n)?r.issues.push(...Vk(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>_M(l,c,_C()))})),r.value.set(t.value,e.value)}function Pio(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function Dio(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function Nio(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function Mio(t,e,r){return FCe(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function Oio(t){return t.value=Object.freeze(t.value),t}function Lio(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(eco(o))}}function zrl(){return{localeError:Wrl()}}function Krl(){return{localeError:Yrl()}}function Bio(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}function Zrl(){return{localeError:Jrl()}}function enl(){return{localeError:Xrl()}}function rnl(){return{localeError:tnl()}}function inl(){return{localeError:nnl()}}function iuo(){return{localeError:snl()}}function lnl(){return{localeError:cnl()}}function dnl(){return{localeError:unl()}}function pnl(){return{localeError:fnl()}}function mnl(){return{localeError:hnl()}}function Anl(){return{localeError:gnl()}}function _nl(){return{localeError:ynl()}}function vnl(){return{localeError:Enl()}}function bnl(){return{localeError:Cnl()}}function Tnl(){return{localeError:Snl()}}function xnl(){return{localeError:Inl()}}function Rnl(){return{localeError:wnl()}}function Pnl(){return{localeError:knl()}}function Nnl(){return{localeError:Dnl()}}function Onl(){return{localeError:Mnl()}}function Bnl(){return{localeError:Lnl()}}function Unl(){return{localeError:Fnl()}}function qnl(){return{localeError:Qnl()}}function Hnl(){return{localeError:jnl()}}function $nl(){return{localeError:Gnl()}}function Wnl(){return{localeError:Vnl()}}function Ynl(){return{localeError:znl()}}function Fio(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}function Jnl(){return{localeError:Knl()}}function Xnl(){return{localeError:Znl()}}function til(){return{localeError:eil()}}function nil(){return{localeError:ril()}}function oil(){return{localeError:iil()}}function cil(){return{localeError:ail()}}function uil(){return{localeError:lil()}}function fil(){return{localeError:dil()}}function hil(){return{localeError:pil()}}function gil(){return{localeError:mil()}}function yil(){return{localeError:Ail()}}function Cjr(){return new mUe}function auo(t,e){return new t({type:"string",...Pr(e)})}function cuo(t,e){return new t({type:"string",coerce:!0,...Pr(e)})}function bjr(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Pr(e)})}function Rkt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Pr(e)})}function Sjr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Pr(e)})}function Tjr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Pr(e)})}function Ijr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Pr(e)})}function xjr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Pr(e)})}function wjr(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Pr(e)})}function Rjr(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Pr(e)})}function kjr(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Pr(e)})}function Pjr(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Pr(e)})}function Djr(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Pr(e)})}function Njr(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Pr(e)})}function Mjr(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Pr(e)})}function Ojr(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Pr(e)})}function Ljr(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Pr(e)})}function Bjr(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Pr(e)})}function Fjr(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Pr(e)})}function Ujr(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Pr(e)})}function Qjr(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Pr(e)})}function qjr(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Pr(e)})}function jjr(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Pr(e)})}function Hjr(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Pr(e)})}function uuo(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Pr(e)})}function duo(t,e){return new t({type:"string",format:"date",check:"string_format",...Pr(e)})}function fuo(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Pr(e)})}function puo(t,e){return new t({type:"string",format:"duration",check:"string_format",...Pr(e)})}function huo(t,e){return new t({type:"number",checks:[],...Pr(e)})}function muo(t,e){return new t({type:"number",coerce:!0,checks:[],...Pr(e)})}function guo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Pr(e)})}function Auo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Pr(e)})}function yuo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Pr(e)})}function _uo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Pr(e)})}function Euo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Pr(e)})}function vuo(t,e){return new t({type:"boolean",...Pr(e)})}function Cuo(t,e){return new t({type:"boolean",coerce:!0,...Pr(e)})}function buo(t,e){return new t({type:"bigint",...Pr(e)})}function Suo(t,e){return new t({type:"bigint",coerce:!0,...Pr(e)})}function Tuo(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Pr(e)})}function Iuo(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Pr(e)})}function xuo(t,e){return new t({type:"symbol",...Pr(e)})}function wuo(t,e){return new t({type:"undefined",...Pr(e)})}function Ruo(t,e){return new t({type:"null",...Pr(e)})}function kuo(t){return new t({type:"any"})}function kkt(t){return new t({type:"unknown"})}function Puo(t,e){return new t({type:"never",...Pr(e)})}function Duo(t,e){return new t({type:"void",...Pr(e)})}function Nuo(t,e){return new t({type:"date",...Pr(e)})}function Muo(t,e){return new t({type:"date",coerce:!0,...Pr(e)})}function Ouo(t,e){return new t({type:"nan",...Pr(e)})}function Xoe(t,e){return new ujr({check:"less_than",...Pr(e),value:t,inclusive:!1})}function gM(t,e){return new ujr({check:"less_than",...Pr(e),value:t,inclusive:!0})}function ese(t,e){return new djr({check:"greater_than",...Pr(e),value:t,inclusive:!1})}function rx(t,e){return new djr({check:"greater_than",...Pr(e),value:t,inclusive:!0})}function Luo(t){return ese(0,t)}function Buo(t){return Xoe(0,t)}function Fuo(t){return gM(0,t)}function Uuo(t){return rx(0,t)}function gUe(t,e){return new Bco({check:"multiple_of",...Pr(e),value:t})}function CPt(t,e){return new Qco({check:"max_size",...Pr(e),maximum:t})}function AUe(t,e){return new qco({check:"min_size",...Pr(e),minimum:t})}function Gjr(t,e){return new jco({check:"size_equals",...Pr(e),size:t})}function bPt(t,e){return new Hco({check:"max_length",...Pr(e),maximum:t})}function abe(t,e){return new Gco({check:"min_length",...Pr(e),minimum:t})}function SPt(t,e){return new $co({check:"length_equals",...Pr(e),length:t})}function $jr(t,e){return new Vco({check:"string_format",format:"regex",...Pr(e),pattern:t})}function Vjr(t){return new Wco({check:"string_format",format:"lowercase",...Pr(t)})}function Wjr(t){return new zco({check:"string_format",format:"uppercase",...Pr(t)})}function zjr(t,e){return new Yco({check:"string_format",format:"includes",...Pr(e),includes:t})}function Yjr(t,e){return new Kco({check:"string_format",format:"starts_with",...Pr(e),prefix:t})}function Kjr(t,e){return new Jco({check:"string_format",format:"ends_with",...Pr(e),suffix:t})}function Quo(t,e,r){return new Zco({check:"property",property:t,schema:e,...Pr(r)})}function Jjr(t,e){return new Xco({check:"mime_type",mime:t,...Pr(e)})}function ose(t){return new elo({check:"overwrite",tx:t})}function Zjr(t){return ose(e=>e.normalize(t))}function Xjr(){return ose(t=>t.trim())}function eHr(){return ose(t=>t.toLowerCase())}function tHr(){return ose(t=>t.toUpperCase())}function rHr(t,e,r){return new t({type:"array",element:e,...Pr(r)})}function _il(t,e,r){return new t({type:"union",options:e,...Pr(r)})}function Eil(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Pr(n)})}function vil(t,e,r){return new t({type:"intersection",left:e,right:r})}function quo(t,e,r,n){let o=r instanceof So;return new t({type:"tuple",items:e,rest:o?r:null,...Pr(o?n:r)})}function Cil(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Pr(n)})}function bil(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Pr(n)})}function Sil(t,e,r){return new t({type:"set",valueType:e,...Pr(r)})}function Til(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...Pr(r)})}function Iil(t,e,r){return new t({type:"enum",entries:e,...Pr(r)})}function xil(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Pr(r)})}function juo(t,e){return new t({type:"file",...Pr(e)})}function wil(t,e){return new t({type:"transform",transform:e})}function Ril(t,e){return new t({type:"optional",innerType:e})}function kil(t,e){return new t({type:"nullable",innerType:e})}function Pil(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function Dil(t,e,r){return new t({type:"nonoptional",innerType:e,...Pr(r)})}function Nil(t,e){return new t({type:"success",innerType:e})}function Mil(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function Oil(t,e,r){return new t({type:"pipe",in:e,out:r})}function Lil(t,e){return new t({type:"readonly",innerType:e})}function Bil(t,e,r){return new t({type:"template_literal",parts:e,...Pr(r)})}function Fil(t,e){return new t({type:"lazy",getter:e})}function Uil(t,e){return new t({type:"promise",innerType:e})}function Huo(t,e,r){let n=Pr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function Guo(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Pr(r)})}function $uo(t,e){let r=Pr(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let s=new Set(n),c=new Set(o),l=t.Pipe??Ejr,u=t.Boolean??hjr,d=t.String??kUe,f=new(t.Transform??_jr)({type:"transform",transform:a((m,g)=>{let A=m;return r.case!=="sensitive"&&(A=A.toLowerCase()),s.has(A)?!0:c.has(A)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:g.value,inst:f}),{})},"transform"),error:r.error}),h=new l({type:"pipe",in:new d({type:"string",error:r.error}),out:f,error:r.error});return new l({type:"pipe",in:h,out:new u({type:"boolean",error:r.error}),error:r.error})}function Vuo(t,e,r,n={}){let o=Pr(n),s={...Pr(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:c=>r.test(c),...o};return r instanceof RegExp&&(s.pattern=r),new t(s)}function Wuo(t){return new Pkt({type:"function",input:Array.isArray(t?.input)?quo(vPt,t?.input):t?.input??rHr(gjr,kkt(wkt)),output:t?.output??kkt(wkt)})}function nHr(t,e){if(t instanceof mUe){let n=new yUe(e),o={};for(let l of t._idmap.entries()){let[u,d]=l;n.process(d)}let s={},c={registry:t,uri:e?.uri||(l=>l),defs:o};for(let l of t._idmap.entries()){let[u,d]=l;s[u]=n.emit(d,{...e,external:c})}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o}}return{schemas:s}}let r=new yUe(e);return r.process(t),r.emit(t,e)}function Jg(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Jg(n.element,r);case"object":{for(let o in n.shape)if(Jg(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(Jg(o,r))return!0;return!1}case"intersection":return Jg(n.left,r)||Jg(n.right,r);case"tuple":{for(let o of n.items)if(Jg(o,r))return!0;return!!(n.rest&&Jg(n.rest,r))}case"record":return Jg(n.keyType,r)||Jg(n.valueType,r);case"map":return Jg(n.keyType,r)||Jg(n.valueType,r);case"set":return Jg(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Jg(n.innerType,r);case"lazy":return Jg(n.getter(),r);case"default":return Jg(n.innerType,r);case"prefault":return Jg(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Jg(n.in,r)||Jg(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function Uio(t,e){let r={type:"object",get shape(){return Xs.assignProp(this,"shape",{...t}),this.shape},...Xs.normalizeParams(e)};return new jil(r)}function wB(t){return!!t._zod}function MCe(t){let e=Object.values(t);if(e.length===0)return Uio({});let r=e.every(wB),n=e.every(o=>!wB(o));if(r)return Uio(t);if(n)return yrl(t);throw Error("Mixed Zod versions detected in object shape.")}function $6e(t,e){return wB(t)?_Pt(t,e):t.safeParse(e)}async function G7r(t,e){return wB(t)?await EPt(t,e):await t.safeParseAsync(e)}function PUe(t){if(!t)return;let e;if(wB(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function R6e(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(o=>typeof o=="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse=="function")))return MCe(t)}}if(wB(t)){let e=t._zod?.def;if(e&&(e.type==="object"||e.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function $7r(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function Hil(t){return t.description}function Gil(t){if(wB(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function zuo(t){if(wB(t)){let n=t._zod?.def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}}let e=t._def;if(e){if(e.value!==void 0)return e.value;if(Array.isArray(e.values)&&e.values.length>0)return e.values[0]}let r=t.value;if(r!==void 0)return r}function Yuo(t){return uuo(oHr,t)}function Kuo(t){return duo(sHr,t)}function Juo(t){return fuo(aHr,t)}function Zuo(t){return puo(cHr,t)}function xt(t){return auo(TPt,t)}function Vil(t){return bjr(uHr,t)}function Wil(t){return Rkt(Dkt,t)}function zil(t){return Sjr(D9,t)}function Yil(t){return Tjr(D9,t)}function Kil(t){return Ijr(D9,t)}function Jil(t){return xjr(D9,t)}function Zil(t){return wjr(dHr,t)}function Xil(t){return Rjr(fHr,t)}function eol(t){return kjr(pHr,t)}function tol(t){return Pjr(hHr,t)}function rol(t){return Djr(mHr,t)}function nol(t){return Njr(gHr,t)}function iol(t){return Mjr(AHr,t)}function ool(t){return Ojr(yHr,t)}function sol(t){return Ljr(_Hr,t)}function aol(t){return Bjr(EHr,t)}function col(t){return Fjr(vHr,t)}function lol(t){return Ujr(CHr,t)}function uol(t){return Qjr(bHr,t)}function dol(t){return qjr(SHr,t)}function fol(t){return jjr(THr,t)}function pol(t){return Hjr(IHr,t)}function hol(t,e,r={}){return Vuo(ido,t,e,r)}function Gc(t){return huo(IPt,t)}function jQr(t){return guo(Ebe,t)}function mol(t){return Auo(Ebe,t)}function gol(t){return yuo(Ebe,t)}function Aol(t){return _uo(Ebe,t)}function yol(t){return Euo(Ebe,t)}function Zg(t){return vuo(xPt,t)}function _ol(t){return buo(wPt,t)}function Eol(t){return Tuo(xHr,t)}function vol(t){return Iuo(xHr,t)}function Col(t){return xuo(odo,t)}function bol(t){return wuo(sdo,t)}function wHr(t){return Ruo(ado,t)}function Sol(){return kuo(cdo)}function Af(){return kkt(ldo)}function RPt(t){return Puo(udo,t)}function Tol(t){return Duo(ddo,t)}function Iol(t){return Nuo(RHr,t)}function ka(t,e){return rHr(fdo,t,e)}function xol(t){let e=t._zod.def.shape;return ni(Object.keys(e))}function In(t,e){let r={type:"object",get shape(){return Xs.assignProp(this,"shape",{...t}),this.shape},...Xs.normalizeParams(e)};return new kPt(r)}function wol(t,e){return new kPt({type:"object",get shape(){return Xs.assignProp(this,"shape",{...t}),this.shape},catchall:RPt(),...Xs.normalizeParams(e)})}function gC(t,e){return new kPt({type:"object",get shape(){return Xs.assignProp(this,"shape",{...t}),this.shape},catchall:Af(),...Xs.normalizeParams(e)})}function Au(t,e){return new kHr({type:"union",options:t,...Xs.normalizeParams(e)})}function PHr(t,e,r){return new pdo({type:"union",options:e,discriminator:t,...Xs.normalizeParams(r)})}function PPt(t,e){return new hdo({type:"intersection",left:t,right:e})}function Rol(t,e,r){let n=e instanceof So,o=n?r:e;return new mdo({type:"tuple",items:t,rest:n?e:null,...Xs.normalizeParams(o)})}function gu(t,e,r){return new DHr({type:"record",keyType:t,valueType:e,...Xs.normalizeParams(r)})}function kol(t,e,r){return new DHr({type:"record",keyType:Au([t,RPt()]),valueType:e,...Xs.normalizeParams(r)})}function Pol(t,e,r){return new gdo({type:"map",keyType:t,valueType:e,...Xs.normalizeParams(r)})}function Dol(t,e){return new Ado({type:"set",valueType:t,...Xs.normalizeParams(e)})}function i1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new _Ue({type:"enum",entries:r,...Xs.normalizeParams(e)})}function Nol(t,e){return new _Ue({type:"enum",entries:t,...Xs.normalizeParams(e)})}function ni(t,e){return new ydo({type:"literal",values:Array.isArray(t)?t:[t],...Xs.normalizeParams(e)})}function Mol(t){return juo(_do,t)}function MHr(t){return new NHr({type:"transform",transform:t})}function Ld(t){return new OHr({type:"optional",innerType:t})}function Nkt(t){return new Edo({type:"nullable",innerType:t})}function Ool(t){return Ld(Nkt(t))}function Cdo(t,e){return new vdo({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Sdo(t,e){return new bdo({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Tdo(t,e){return new LHr({type:"nonoptional",innerType:t,...Xs.normalizeParams(e)})}function Lol(t){return new Ido({type:"success",innerType:t})}function wdo(t,e){return new xdo({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Bol(t){return Ouo(Rdo,t)}function Mkt(t,e){return new BHr({type:"pipe",in:t,out:e})}function Pdo(t){return new kdo({type:"readonly",innerType:t})}function Fol(t,e){return new Ddo({type:"template_literal",parts:t,...Xs.normalizeParams(e)})}function Mdo(t){return new Ndo({type:"lazy",getter:t})}function Uol(t){return new Odo({type:"promise",innerType:t})}function Ldo(t,e){let r=new Qh({check:"custom",...Xs.normalizeParams(e)});return r._zod.check=t,r}function Bdo(t,e){return Huo(DPt,t??(()=>!0),e)}function Fdo(t,e={}){return Guo(DPt,t,e)}function Udo(t,e){let r=Ldo(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Xs.issue(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(Xs.issue(s))}},t(n.value,n)),e);return r}function Qol(t,e={error:`Input not instance of ${t.name}`}){let r=new DPt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...Xs.normalizeParams(e)});return r._zod.bag.Class=t,r}function jol(t){let e=Mdo(()=>Au([xt(t),Gc(),Zg(),wHr(),ka(e),gu(xt(),e)]));return e}function FHr(t,e){return Mkt(MHr(t),e)}function Gol(t){_C({customError:t})}function $ol(){return _C().customError}function Vol(t){return cuo(TPt,t)}function Wol(t){return muo(IPt,t)}function zol(t){return Cuo(xPt,t)}function Yol(t){return Suo(wPt,t)}function Kol(t){return Muo(RHr,t)}function Tal(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function Ial(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function Uoe(t){return t==="completed"||t==="failed"||t==="cancelled"}function ifo(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function wl(t,e,r,n,o){t[e]=r,ifo(t,e,n,o)}function n1(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?ofo(e,t.currentPath):e.join("/")}}function Mal(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==wr.ZodAny&&(r.items=Hc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&wl(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&wl(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(wl(r,"minItems",t.exactLength.value,t.exactLength.message,e),wl(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function Oal(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?wl(r,"minimum",n.value,n.message,e):wl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),wl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?wl(r,"maximum",n.value,n.message,e):wl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),wl(r,"maximum",n.value,n.message,e));break;case"multipleOf":wl(r,"multipleOf",n.value,n.message,e);break}return r}function Lal(){return{type:"boolean"}}function sfo(t,e){return Hc(t.type._def,e)}function afo(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>afo(t,e,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Fal(t,e)}}function Ual(t,e){return{...Hc(t.innerType._def,e),default:t.defaultValue()}}function Qal(t,e){return e.effectStrategy==="input"?Hc(t.schema._def,e):n1(e)}function qal(t){return{type:"string",enum:Array.from(t.values)}}function Hal(t,e){let r=[Hc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Hc(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(s=>{if(jal(s))o.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let c=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:l,...u}=s;c=u}else n=void 0;o.push(c)}}),o.length?{allOf:o,...n}:void 0}function Gal(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}function cfo(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":wl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":wl(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":hM(r,"email",n.message,e);break;case"format:idn-email":hM(r,"idn-email",n.message,e);break;case"pattern:zod":mC(r,pM.email,n.message,e);break}break;case"url":hM(r,"uri",n.message,e);break;case"uuid":hM(r,"uuid",n.message,e);break;case"regex":mC(r,n.regex,n.message,e);break;case"cuid":mC(r,pM.cuid,n.message,e);break;case"cuid2":mC(r,pM.cuid2,n.message,e);break;case"startsWith":mC(r,RegExp(`^${W7r(n.value,e)}`),n.message,e);break;case"endsWith":mC(r,RegExp(`${W7r(n.value,e)}$`),n.message,e);break;case"datetime":hM(r,"date-time",n.message,e);break;case"date":hM(r,"date",n.message,e);break;case"time":hM(r,"time",n.message,e);break;case"duration":hM(r,"duration",n.message,e);break;case"length":wl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),wl(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{mC(r,RegExp(W7r(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&hM(r,"ipv4",n.message,e),n.version!=="v4"&&hM(r,"ipv6",n.message,e);break}case"base64url":mC(r,pM.base64url,n.message,e);break;case"jwt":mC(r,pM.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&mC(r,pM.ipv4Cidr,n.message,e),n.version!=="v4"&&mC(r,pM.ipv6Cidr,n.message,e);break}case"emoji":mC(r,pM.emoji(),n.message,e);break;case"ulid":{mC(r,pM.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{hM(r,"binary",n.message,e);break}case"contentEncoding:base64":{wl(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{mC(r,pM.base64,n.message,e);break}}break}case"nanoid":mC(r,pM.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function W7r(t,e){return e.patternStrategy==="escape"?Val(t):t}function Val(t){let e="";for(let r=0;ro.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):wl(t,"format",e,r,n)}function mC(t,e,r,n){t.pattern||t.allOf?.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:jio(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):wl(t,"pattern",jio(e,n),r,n)}function jio(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,o="",s=!1,c=!1,l=!1;for(let u=0;u({...n,[o]:Hc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??n1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Hc(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===wr.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=sfo(t.keyType._def,e);return{...r,propertyNames:o}}else{if(t.keyType?._def.typeName===wr.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===wr.ZodBranded&&t.keyType._def.type._def.typeName===wr.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...o}=ifo(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function $al(t,e){if(e.mapStrategy==="record")return afo(t,e);let r=Hc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||n1(e),n=Hc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||n1(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function Val(t){let e=t.values,r=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),n=Array.from(new Set(r.map(o=>typeof o)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:r}}function Wal(t){return t.target==="openAi"?void 0:{not:n1({...t,currentPath:[...t.currentPath,"not"]})}}function zal(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function Yal(t,e){if(e.target==="openApi3")return qio(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Ukt&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=Ukt[s._def.typeName];return c&&!o.includes(c)?[...o,c]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,s)=>{let c=typeof s._def.value;switch(c){case"string":case"number":case"boolean":return[...o,c];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];default:return o}},[]);if(n.length===r.length){let o=n.filter((s,c,l)=>l.indexOf(s)===c);return{type:o.length>1?o:o[0],enum:r.reduce((s,c)=>s.includes(c._def.value)?s:[...s,c._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(s=>!n.includes(s))],[])};return qio(t,e)}function Kal(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Ukt[t.innerType._def.typeName],nullable:!0}:{type:[Ukt[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Hc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Hc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function Jal(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",rfo(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?wl(r,"minimum",n.value,n.message,e):wl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),wl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?wl(r,"maximum",n.value,n.message,e):wl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),wl(r,"maximum",n.value,n.message,e));break;case"multipleOf":wl(r,"multipleOf",n.value,n.message,e);break}return r}function Zal(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},o=[],s=t.shape();for(let l in s){let u=s[l];if(u===void 0||u._def===void 0)continue;let d=ecl(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Hc(u._def,{...e,currentPath:[...e.currentPath,"properties",l],propertyPath:[...e.currentPath,"properties",l]});f!==void 0&&(n.properties[l]=f,!d&&o.push(l))}o.length&&(n.required=o);let c=Xal(t,e);return c!==void 0&&(n.additionalProperties=c),n}function Xal(t,e){if(t.catchall._def.typeName!=="ZodNever")return Hc(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function ecl(t){try{return t.isOptional()}catch{return!0}}function ncl(t,e){return Hc(t.type._def,e)}function icl(t,e){let r={type:"array",uniqueItems:!0,items:Hc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&wl(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&wl(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function ocl(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Hc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Hc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Hc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function scl(t){return{not:n1(t)}}function acl(t){return n1(t)}function Hc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==Ral)return l}if(n&&!r){let l=ucl(n,e);if(l!==void 0)return l}let o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);let s=lcl(t,t.typeName,e),c=typeof s=="function"?Hc(s(),e):s;if(c&&dcl(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function pcl(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function jio(t,e){return wB(t)?rHr(t,{target:pcl(e?.target),io:e?.pipeStrategy??"input"}):fcl(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function Hio(t){let e=PUe(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=Vuo(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function Gio(t,e){let r=$6e(t,e);if(!r.success)throw r.error;return r.data}function $io(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function mcl(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let c=r[o];$io(c)&&$io(s)?r[o]={...c,...s}:r[o]=s}return r}function ycl(){let t=new gcl.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Acl.default(t),t}function _cl(t,e,r){if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function Ecl(t,e,r){if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}function Vio(t){return!!t&&typeof t=="object"&&cfo in t}function vcl(t){return t[cfo]?.complete}function bcl(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!Ccl.test(t)){let r=t.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,o,s)=>s.indexOf(n)===o);return e.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function Scl(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function zio(t){let e=bcl(t);return Scl(t,e.warnings),e.isValid}function lfo(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function ufo(t){return"_def"in t||"_zod"in t||lfo(t)}function rqr(t){return typeof t!="object"||t===null||ufo(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(lfo)}function Yio(t){if(t){if(rqr(t))return MCe(t);if(!ufo(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function Icl(t){let e=PUe(t);return e?Object.entries(e).map(([r,n])=>{let o=qil(n),s=jil(n);return{name:r,description:o,required:!s}}):[]}function zW(t){let e=PUe(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=Vuo(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function Kio(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function xcl(t,e,r,n,o){let s={};return o?.searchHint&&(s["anthropic/searchHint"]=o.searchHint),o?.alwaysLoad&&(s["anthropic/alwaysLoad"]=!0),{name:t,description:e,inputSchema:r,handler:n,annotations:o?.annotations,_meta:Object.keys(s).length>0?s:void 0}}function wcl(t){let e=new tqr({name:t.name,version:t.version??"1.0.0"},{capabilities:{tools:t.tools?{}:void 0},instructions:t.instructions});return t.tools&&t.tools.forEach(r=>{for(let n of Object.values(r.inputSchema)){if(!Rcl(n))continue;let o=n.description;o&&!P9.has(n)&&P9.add(n,{description:o})}e.registerTool(r.name,{description:r.description,inputSchema:r.inputSchema,annotations:r.annotations,_meta:t.alwaysLoad?{"anthropic/alwaysLoad":!0,...r._meta}:r._meta},r.handler)}),{type:"sdk",name:t.name,instance:e}}function Rcl(t){return typeof t=="object"&&t!==null&&"_zod"in t}function Dr(t){let e;return()=>e??=t()}function Pcl(t){if(t.startsWith("cc://")){let n=t.slice(5),o=new URL(`http://${n}`),s=o.pathname.slice(1)||void 0;return{serverUrl:`http://${o.host}`,authToken:s}}if(t.startsWith("cc+unix://"))throw new Gk("Unix socket connect (cc+unix://) is not supported by the SDK transport");let e=/^https?:\/\//i.test(t)?t:`http://${t}`,r=new URL(e);return{serverUrl:`${r.protocol}//${r.host}`,authToken:void 0}}async function Dcl(t){let e={"content-type":"application/json"};t.authToken&&(e.authorization=`Bearer ${t.authToken}`);let r={};t.cwd&&(r.cwd=t.cwd),t.sessionKey&&(r.session_key=t.sessionKey),t.permissionMode&&(r.permission_mode=t.permissionMode);let n;try{n=await fetch(`${t.serverUrl}/sessions`,{method:"POST",headers:e,body:Xm(r)})}catch(s){throw new Gk(`Failed to connect to server at ${t.serverUrl}: ${s instanceof Error?s.message:String(s)}`,"session_create_failed")}if(!n.ok){let s=await n.text().catch(()=>"");throw new Gk(`Failed to create session: ${n.status} ${n.statusText}${s?` \u2014 ${s}`:""}`,"session_create_failed")}let o=kcl().safeParse(await n.json());if(!o.success)throw new Gk(`Invalid session response: ${o.error.message}`,"session_create_invalid_response");return{sessionId:o.data.session_id,wsUrl:o.data.ws_url,workDir:o.data.work_dir}}async function Zio(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function iqr(t,e,r){let n=Ncl();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=ox(),c=Xm(o)+` -`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,ffo.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function Ncl(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function Mcl(t){let{buffer:e,bytesRead:r}=ox().readSync(t,{length:4096});return r===0?"utf8":r>=2&&e[0]===255&&e[1]===254?"utf16le":(r>=3&&e[0]===239&&e[1]===187&&e[2]===191,"utf8")}function Ocl(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function Lcl(t){let e=ox(),{resolvedPath:r,isSymlink:n}=iao(e,t);n&&hu(`Reading through symlink: ${t} -> ${r}`);let o=Mcl(r),s=e.readFileSync(r,{encoding:o}),c=Ocl(s.slice(0,4096));return{content:s.replaceAll(`\r +]`;continue}o+=n[u],n[u]==="\\"?s=!0:c&&n[u]==="]"?c=!1:!c&&n[u]==="["&&(c=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return o}function lfo(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===wr.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((n,o)=>({...n,[o]:Hc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??n1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Hc(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===wr.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=cfo(t.keyType._def,e);return{...r,propertyNames:o}}else{if(t.keyType?._def.typeName===wr.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===wr.ZodBranded&&t.keyType._def.type._def.typeName===wr.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...o}=sfo(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function Wal(t,e){if(e.mapStrategy==="record")return lfo(t,e);let r=Hc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||n1(e),n=Hc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||n1(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function zal(t){let e=t.values,r=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),n=Array.from(new Set(r.map(o=>typeof o)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:r}}function Yal(t){return t.target==="openAi"?void 0:{not:n1({...t,currentPath:[...t.currentPath,"not"]})}}function Kal(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function Jal(t,e){if(e.target==="openApi3")return Hio(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Qkt&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=Qkt[s._def.typeName];return c&&!o.includes(c)?[...o,c]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,s)=>{let c=typeof s._def.value;switch(c){case"string":case"number":case"boolean":return[...o,c];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];default:return o}},[]);if(n.length===r.length){let o=n.filter((s,c,l)=>l.indexOf(s)===c);return{type:o.length>1?o:o[0],enum:r.reduce((s,c)=>s.includes(c._def.value)?s:[...s,c._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(s=>!n.includes(s))],[])};return Hio(t,e)}function Zal(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Qkt[t.innerType._def.typeName],nullable:!0}:{type:[Qkt[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Hc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Hc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function Xal(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",ifo(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?wl(r,"minimum",n.value,n.message,e):wl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),wl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?wl(r,"maximum",n.value,n.message,e):wl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),wl(r,"maximum",n.value,n.message,e));break;case"multipleOf":wl(r,"multipleOf",n.value,n.message,e);break}return r}function ecl(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},o=[],s=t.shape();for(let l in s){let u=s[l];if(u===void 0||u._def===void 0)continue;let d=rcl(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Hc(u._def,{...e,currentPath:[...e.currentPath,"properties",l],propertyPath:[...e.currentPath,"properties",l]});f!==void 0&&(n.properties[l]=f,!d&&o.push(l))}o.length&&(n.required=o);let c=tcl(t,e);return c!==void 0&&(n.additionalProperties=c),n}function tcl(t,e){if(t.catchall._def.typeName!=="ZodNever")return Hc(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function rcl(t){try{return t.isOptional()}catch{return!0}}function ocl(t,e){return Hc(t.type._def,e)}function scl(t,e){let r={type:"array",uniqueItems:!0,items:Hc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&wl(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&wl(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function acl(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Hc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Hc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Hc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function ccl(t){return{not:n1(t)}}function lcl(t){return n1(t)}function Hc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==Pal)return l}if(n&&!r){let l=fcl(n,e);if(l!==void 0)return l}let o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);let s=dcl(t,t.typeName,e),c=typeof s=="function"?Hc(s(),e):s;if(c&&pcl(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function mcl(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function Gio(t,e){return wB(t)?nHr(t,{target:mcl(e?.target),io:e?.pipeStrategy??"input"}):hcl(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function $io(t){let e=PUe(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=zuo(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function Vio(t,e){let r=$6e(t,e);if(!r.success)throw r.error;return r.data}function Wio(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Acl(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let c=r[o];Wio(c)&&Wio(s)?r[o]={...c,...s}:r[o]=s}return r}function Ecl(){let t=new ycl.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return _cl.default(t),t}function vcl(t,e,r){if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function Ccl(t,e,r){if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}function zio(t){return!!t&&typeof t=="object"&&ufo in t}function bcl(t){return t[ufo]?.complete}function Tcl(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!Scl.test(t)){let r=t.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,o,s)=>s.indexOf(n)===o);return e.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function Icl(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function Kio(t){let e=Tcl(t);return Icl(t,e.warnings),e.isValid}function dfo(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function ffo(t){return"_def"in t||"_zod"in t||dfo(t)}function nqr(t){return typeof t!="object"||t===null||ffo(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(dfo)}function Jio(t){if(t){if(nqr(t))return MCe(t);if(!ffo(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function wcl(t){let e=PUe(t);return e?Object.entries(e).map(([r,n])=>{let o=Hil(n),s=Gil(n);return{name:r,description:o,required:!s}}):[]}function YW(t){let e=PUe(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=zuo(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function Zio(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function Rcl(t,e,r,n,o){let s={};return o?.searchHint&&(s["anthropic/searchHint"]=o.searchHint),o?.alwaysLoad&&(s["anthropic/alwaysLoad"]=!0),{name:t,description:e,inputSchema:r,handler:n,annotations:o?.annotations,_meta:Object.keys(s).length>0?s:void 0}}function kcl(t){let e=new rqr({name:t.name,version:t.version??"1.0.0"},{capabilities:{tools:t.tools?{}:void 0},instructions:t.instructions});return t.tools&&t.tools.forEach(r=>{for(let n of Object.values(r.inputSchema)){if(!Pcl(n))continue;let o=n.description;o&&!P9.has(n)&&P9.add(n,{description:o})}e.registerTool(r.name,{description:r.description,inputSchema:r.inputSchema,annotations:r.annotations,_meta:t.alwaysLoad?{"anthropic/alwaysLoad":!0,...r._meta}:r._meta},r.handler)}),{type:"sdk",name:t.name,instance:e}}function Pcl(t){return typeof t=="object"&&t!==null&&"_zod"in t}function Dr(t){let e;return()=>e??=t()}function Ncl(t){if(t.startsWith("cc://")){let n=t.slice(5),o=new URL(`http://${n}`),s=o.pathname.slice(1)||void 0;return{serverUrl:`http://${o.host}`,authToken:s}}if(t.startsWith("cc+unix://"))throw new Gk("Unix socket connect (cc+unix://) is not supported by the SDK transport");let e=/^https?:\/\//i.test(t)?t:`http://${t}`,r=new URL(e);return{serverUrl:`${r.protocol}//${r.host}`,authToken:void 0}}async function Mcl(t){let e={"content-type":"application/json"};t.authToken&&(e.authorization=`Bearer ${t.authToken}`);let r={};t.cwd&&(r.cwd=t.cwd),t.sessionKey&&(r.session_key=t.sessionKey),t.permissionMode&&(r.permission_mode=t.permissionMode);let n;try{n=await fetch(`${t.serverUrl}/sessions`,{method:"POST",headers:e,body:eg(r)})}catch(s){throw new Gk(`Failed to connect to server at ${t.serverUrl}: ${s instanceof Error?s.message:String(s)}`,"session_create_failed")}if(!n.ok){let s=await n.text().catch(()=>"");throw new Gk(`Failed to create session: ${n.status} ${n.statusText}${s?` \u2014 ${s}`:""}`,"session_create_failed")}let o=Dcl().safeParse(await n.json());if(!o.success)throw new Gk(`Invalid session response: ${o.error.message}`,"session_create_invalid_response");return{sessionId:o.data.session_id,wsUrl:o.data.ws_url,workDir:o.data.work_dir}}async function eoo(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function oqr(t,e,r){let n=Ocl();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=ox(),c=eg(o)+` +`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,hfo.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function Ocl(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function Lcl(t){let{buffer:e,bytesRead:r}=ox().readSync(t,{length:4096});return r===0?"utf8":r>=2&&e[0]===255&&e[1]===254?"utf16le":(r>=3&&e[0]===239&&e[1]===187&&e[2]===191,"utf8")}function Bcl(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function Fcl(t){let e=ox(),{resolvedPath:r,isSymlink:n}=sao(e,t);n&&hu(`Reading through symlink: ${t} -> ${r}`);let o=Lcl(r),s=e.readFileSync(r,{encoding:o}),c=Bcl(s.slice(0,4096));return{content:s.replaceAll(`\r `,` -`),encoding:o,lineEndings:c}}function OPt(t){return Lcl(t).content}function pfo(t){return t.startsWith("\uFEFF")?t.slice(1):t}function Qcl(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),Qkt.default.platform==="darwin"?Bcl(t):Qkt.default.platform==="win32"?Fcl(t):Ucl(t)}function qcl(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||bE(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function jcl(){return qcl()==="essential-traffic"}function Gcl(t){W7r.length>=Hcl&&W7r.shift(),W7r.push(t)}function hfo(t){let e=bUe(t);try{if(bE(process.env.CLAUDE_CODE_USE_BEDROCK)||bE(process.env.CLAUDE_CODE_USE_VERTEX)||bE(process.env.CLAUDE_CODE_USE_FOUNDRY)||bE(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||bE(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||jcl())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(Gcl(r),ioo===null){$cl.push({type:"error",error:e});return}ioo.logError(e)}catch{}}function Wcl(t,e,r=100){let n=new aqr({max:r}),o=a((...s)=>{let c=e(...s),l=n.get(c);if(l!==void 0)return l;let u=t(...s);return n.set(c,u),u},"X");return o.cache={clear:a(()=>n.clear(),"clear"),size:a(()=>n.size,"size"),delete:a(s=>n.delete(s),"delete"),get:a(s=>n.peek(s),"get"),has:a(s=>n.has(s),"has")},o}function yfo(t,e){try{return{ok:!0,value:JSON.parse(pfo(t))}}catch(r){return e&&hfo(r),{ok:!1}}}function sll(){let t=G.object({type:G.literal("command").describe("Shell command hook type"),command:G.string().describe("Shell command to execute"),args:G.array(G.string()).optional().describe("Argument list for exec form. When present, `command` is resolved as an executable and spawned directly with these arguments \u2014 no shell. Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:P6e(),shell:G.enum(oll).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:G.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:G.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:G.string().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:G.string().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".')}),e=G.object({type:G.literal("prompt").describe("LLM prompt hook type"),prompt:G.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:P6e(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:G.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-4-6"). If not specified, uses the default small fast model.'),continueOnBlock:G.boolean().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),r=G.object({type:G.literal("mcp_tool").describe("MCP tool hook type"),server:G.string().describe("Name of an already-configured MCP server to invoke"),tool:G.string().describe("Name of the tool on that server to call"),input:G.record(G.string(),G.unknown()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:P6e(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),n=G.object({type:G.literal("http").describe("HTTP hook type"),url:G.string().url().describe("URL to POST the hook input JSON to"),if:P6e(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:G.record(G.string(),G.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:G.array(G.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),o=G.object({type:G.literal("agent").describe("Agentic verifier hook type"),prompt:G.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:P6e(),timeout:G.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:G.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.'),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:t,PromptHookSchema:e,HttpHookSchema:n,AgentHookSchema:o,McpToolHookSchema:r}}function vll(t){return Cfo.has(t.toLowerCase())?!1:Ell.test(t)?!0:_ll.test(t)}function Gll(t){let e=jll();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=Hll().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(hu(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(hu(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function Pfo(){return tul.filter(t=>FPt[t].buildGate())}function rul(t){let e={};for(let r of t)e={...e,...FPt[r].shape()};return e}function nul(t){let e={};for(let r of t)e={...e,...FPt[r].permissionsShape?.()};return e}function iul(t){let e=[];for(let r of t)e.push(...FPt[r].permissionModes?.()??[]);return e}function oul(t){let e=t.split("__"),[r,n,...o]=e;if(r!=="mcp"||!n)return null;let s=o.length>0?o.join("__"):void 0;return{serverName:n,toolName:s}}function kCe(t){return Object.hasOwn(uoo,t)?uoo[t]:t}function sul(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function aul(t){let e=cul(t,"(");if(e===-1)return{toolName:kCe(t)};let r=lul(t,")");if(r===-1||r<=e)return{toolName:kCe(t)};if(r!==t.length-1)return{toolName:kCe(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:kCe(t)};if(o===""||o==="*")return{toolName:kCe(n)};let s=sul(o);return{toolName:kCe(n),ruleContent:s}}function cul(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function lul(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]===e){let n=0,o=r-1;for(;o>=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function uul(t){return Gkt.filePatternTools.includes(t)}function dul(t){return Gkt.bashPrefixTools.includes(t)}function ful(t){return Object.hasOwn(Gkt.customValidation,t)?Gkt.customValidation[t]:void 0}function Nfo(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function Y7r(t,e){let r=0;for(let n=0;n0?{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${n.toolName}" without parentheses, or use "mcp__${o.serverName}__*" for all tools`,examples:[`mcp__${o.serverName}`,`mcp__${o.serverName}__*`,o.toolName&&o.toolName!=="*"?`mcp__${o.serverName}__${o.toolName}`:void 0].filter(Boolean)}:{valid:!0};if(!n.toolName||n.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(!n.toolName.includes("_")&&n.toolName[0]!==n.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${ZXc(String(n.toolName))}"`};let s=ful(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(dul(n.toolName)&&n.ruleContent!==void 0){let c=n.ruleContent;if(c.includes(":*")&&!c.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(c===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]}}if(uul(n.toolName)&&n.ruleContent!==void 0){let c=n.ruleContent;if(c.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${n.toolName}(*.ts) - matches .ts files`,`${n.toolName}(src/**) - matches all files in src`,`${n.toolName}(**/*.test.ts) - matches test files`]};if(c.includes("*")&&!c.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!c.includes("**"))return{valid:!1,error:"Wildcard placement might be incorrect",suggestion:"Wildcards are typically used at path boundaries",examples:[`${n.toolName}(*.js) - all .js files`,`${n.toolName}(src/*) - all files directly in src`,`${n.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}function Ofo(t){return G.object({allow:G.array(K7r()).optional().describe("List of permission rules for allowed operations"),deny:G.array(K7r()).optional().describe("List of permission rules for denied operations"),ask:G.array(K7r()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum([...cGr,...iul(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...nul(t),additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function Aul(t){return G.object({$schema:G.literal(eul).optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:G.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:G.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:G.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:G.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:G.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),policyHelper:gul().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...bE(process.env.CLAUDE_CODE_ENABLE_XAA)&&{xaaIdp:G.object({issuer:G.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:G.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:G.number().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")},fileSuggestion:G.object({type:G.literal("command"),command:G.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:G.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:G.object({enabled:G.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:G.number().int().positive().optional().describe("Minutes of continuous use before the reminder fires (default 120). Re-fires every interval until you take a break."),breakThresholdMinutes:G.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 15)"),message:G.string().optional().describe("Custom reminder text. Leave unset for a rotating set of friendly nudges.")}).optional().describe("@internal Opt-in break reminder. When enabled, shows a dismissible nudge after sustained continuous use. Never blocks \u2014 just a friendly heads-up."),quietHours:G.object({enabled:G.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:G.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "22:00")').optional().describe('Start of the quiet-hours window, 24-hour local time "HH:MM".'),end:G.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "07:00")').optional().describe('End of the quiet-hours window, 24-hour local time "HH:MM". May be earlier than start for an overnight range.')}).optional().describe("@internal Opt-in quiet hours. When enabled, shows a single soft nudge per session while inside the configured local-time window. Never blocks."),cleanupPeriodDays:G.number().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),skillListingMaxDescChars:G.number().int().positive().optional().describe("Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost."),skillListingBudgetFraction:G.number().gt(0).lte(1).optional().describe("Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost."),wslInheritsWindowsSettings:G.boolean().optional().describe("When set to true in either admin-only Windows source \u2014 the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json \u2014 WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect."),env:hul().optional().describe("Environment variables to set for Claude Code sessions"),attribution:G.object({commit:G.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:G.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:G.boolean().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),includeGitInstructions:G.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:Ofo(t).optional().describe("Tool usage permissions configuration"),model:G.string().optional().describe("Override the default model used by Claude Code"),availableModels:G.array(G.string()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),modelOverrides:G.record(G.string(),G.string()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),enableAllProjectMcpServers:G.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:G.array(G.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:G.array(G.string()).optional().describe("List of rejected MCP servers from .mcp.json"),skillOverrides:G.record(G.string(),G.enum(["on","name-only","user-invocable-only","off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),allowedMcpServers:G.array(Lfo()).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:G.array(Bfo()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:jkt().optional().describe("Custom commands to run before/after tool executions"),worktree:G.object({symlinkDirectories:G.array(G.string()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:G.array(G.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). Dramatically faster in large monorepos \u2014 only the listed paths are written to disk."),baseRef:G.enum(["fresh","head"]).optional().describe("Which ref new worktrees branch from. 'fresh' (default) branches from origin/ for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation."),bgIsolation:G.enum(["worktree","none"]).optional().catch(void 0).describe("Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly.")}).optional().describe("Git worktree configuration for --worktree flag."),disableAllHooks:G.boolean().optional().describe("Disable all hooks and statusLine execution"),disableAgentView:G.boolean().optional().describe("Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1."),disableRemoteControl:G.boolean().optional().describe("Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings."),disableWorkflows:G.boolean().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),enableWorkflows:G.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowKeywordTriggerEnabled:G.boolean().optional().describe('Enable the "workflow"/"workflows" keyword trigger that opts a prompt into the Workflow tool. Set to false to type the word without triggering a workflow. Default: true.'),disableSkillShellExecution:G.boolean().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:G.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),allowManagedHooksOnly:G.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:G.array(G.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:G.array(G.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:G.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),allowManagedMcpServersOnly:G.boolean().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),allowAllClaudeAiMcps:G.boolean().optional().describe("When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only."),strictPluginOnlyCustomization:G.preprocess(e=>Array.isArray(e)?e.filter(r=>doo.includes(r)):e,G.union([G.boolean(),G.array(G.enum(doo))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. Composes with strictKnownMarketplaces for end-to-end admin control \u2014 plugins gated by marketplace allowlist, everything else blocked here.'),statusLine:G.object({type:G.literal("command"),command:G.string(),padding:G.number().optional(),refreshInterval:G.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:G.boolean().optional().describe("Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.")}).optional().describe("Custom status line display configuration"),prUrlTemplate:G.string().optional().describe('URL template for PR links in the footer badge and inline messages. Placeholders: {host} {owner} {repo} {number} {url}. Example: "https://reviews.example.com/{owner}/{repo}/pull/{number}"'),subagentStatusLine:G.object({type:G.literal("command"),command:G.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:G.record(G.string(),G.union([G.array(G.string()),G.boolean(),G.undefined()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json \u2014 setting false in ~/.claude/settings.json is overridden by the project.'),extraKnownMarketplaces:G.record(G.string(),mul()).check(e=>{for(let[r,n]of Object.entries(e.value))n.source.source==="settings"&&n.source.name!==r&&e.issues.push({code:"custom",input:n.source.name,path:[r,"source","name"],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${r}" but source.name "${n.source.name}")`})}).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),strictKnownMarketplaces:G.array(Hkt()).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only \u2014 it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),blockedMarketplaces:G.array(Hkt()).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),pluginSuggestionMarketplaces:G.array(G.string()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips), in addition to the official marketplace. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored."),forceLoginMethod:G.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),parentSettingsBehavior:G.enum(["first-wins","merge"]).optional().describe(`Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" (default): parent is dropped \u2014 admin tiers are the only policy source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).`),forceLoginOrgUUID:G.union([G.string(),G.array(G.string())]).optional().describe("Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization."),forceRemoteSettingsRefresh:G.boolean().optional().describe("When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails"),otelHeadersHelper:G.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:G.string().optional().describe("Controls the output style for assistant responses"),viewMode:G.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:G.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:G.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:Jcl().optional(),feedbackSurveyRate:G.number().min(0).max(1).optional().describe("Probability (0\u20131) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),spinnerTipsEnabled:G.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:G.object({mode:G.enum(["append","replace"]),verbs:G.array(G.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:G.object({excludeDefault:G.boolean().optional(),tips:G.array(G.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:G.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:G.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:G.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:G.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),ultracode:G.boolean().optional().catch(void 0).describe("Enable ultracode for the session: xhigh effort plus standing dynamic-workflow orchestration. Session-scoped \u2014 typically provided via --settings or the apply_flag_settings control request; interactive toggles never persist it. Requires workflows to be enabled and an xhigh-capable model."),autoCompactWindow:G.number().int().min(1e5).max(1e6).optional().catch(void 0).describe("Auto-compact window size"),advisorModel:G.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:G.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:G.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:G.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),awaySummaryEnabled:G.boolean().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:G.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),agent:G.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:G.array(G.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:G.record(G.string(),G.object({mcpServers:G.record(G.string(),G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")})).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:G.object({defaultEnvironmentId:G.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:G.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:G.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:G.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:G.enum(["default","fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),voice:G.object({enabled:G.boolean().optional(),mode:G.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:G.boolean().optional().describe("Submit the prompt when hold-to-talk is released (hold mode only)")}).optional().describe("Voice mode settings (hold-to-talk / tap-to-toggle dictation)"),channelsEnabled:G.boolean().optional().describe("Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:G.array(G.object({marketplace:G.string(),plugin:G.string()})).optional().describe("Managed-org allowlist of channel plugins. When set, replaces the default Anthropic allowlist \u2014 admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:G.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),doneMeansMerged:G.boolean().optional().describe("@internal When true, Claude keeps working until the PR is ready for you to merge, a cron/Monitor is armed to resume later, or it hands you a self-contained next step."),autoMemoryEnabled:G.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:G.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects//memory/."),autoDreamEnabled:G.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:G.boolean().optional().describe("Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install."),skipDangerousModePermissionPrompt:G.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:G.boolean().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow."),disableAutoMode:G.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:G.array(G.object({id:G.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:G.string().describe("Display name for the SSH connection"),sshHost:G.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:G.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:G.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:G.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:G.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:G.array(G.string()).optional().describe('Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:G.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").'),theme:G.union([G.enum(rll),G.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:G.enum(Xcl).optional().catch(void 0).describe("Key binding mode for the prompt input"),verbose:G.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:G.enum(Zcl).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:G.boolean().optional().describe("Automatically compact conversation when context fills"),autoScrollEnabled:G.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),fileCheckpointingEnabled:G.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:G.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:G.boolean().optional().describe("Stamp each assistant message with its arrival time"),terminalProgressBarEnabled:G.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:G.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:G.enum(ell).optional().catch(void 0).describe("How spawned teammates execute (tmux, in-process, auto)"),remoteControlAtStartup:G.boolean().optional().describe("Start Remote Control bridge automatically each session"),isolatePeerMachines:G.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:G.enum(["transient","ask"]).optional().describe("When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently"),autoUploadSessions:G.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:G.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:G.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...rul(t)}).passthrough()}function Eul(t){let e=yul.find(n=>n.matches(t));if(!e)return null;let r={...e.tip};return t.code==="invalid_value"&&t.enumValues&&!r.suggestion&&(r.suggestion=`Valid values: ${t.enumValues.map(n=>`"${n}"`).join(", ")}`),!r.docLink&&t.path&&(r.docLink=_ul[eel(t.path,".")]),r}function foo(t){return t.code==="invalid_type"}function poo(t){return t.code==="invalid_value"}function vul(t){return t.code==="unrecognized_keys"}function hoo(t){return t.code==="too_small"}function QCe(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function moo(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function UUe(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(poo(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(foo(r)){l=r.expected;let h=moo(r.message);u=h??QCe(r.input),d=h??QCe(r.input)}else hoo(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=Eul({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(poo(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(foo(r)){let h=moo(r.message)??QCe(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(vul(r)){let h=r.keys.join(", ");o=`Unrecognized ${XXc(r.keys.length,"field")}: ${h}`}else hoo(r)&&(o=`Number must be greater than or equal to ${r.minimum}`,s=String(r.minimum));return{file:e,path:n,message:o,expected:s,invalidValue:d,suggestion:f?.suggestion,docLink:f?.docLink}})}function Cul(t,e){if(!t||typeof t!="object")return[];let r=t;if(!r.permissions||typeof r.permissions!="object")return[];let n=r.permissions,o=[];for(let s of["allow","deny","ask"]){let c=n[s];Array.isArray(c)&&(n[s]=c.filter(l=>{if(typeof l!="string")return o.push({file:e,path:`permissions.${s}`,message:`Non-string value in ${s} array was removed`,severity:"warning",invalidValue:l}),!1;let u=Mfo(l);if(!u.valid){let d=`Invalid permission rule "${l}" was skipped: ${u.error}`;return u.suggestion&&(d+=`. ${u.suggestion}`),o.push({file:e,path:`permissions.${s}`,message:d,severity:"warning",invalidValue:l}),!1}return!0}))}return o}function Sul(t,e){if(!t||typeof t!="object")return[];let r=t;if(!("hooks"in r))return[];if(r.hooks===null||typeof r.hooks!="object"||Array.isArray(r.hooks)){let s=QCe(r.hooks);return delete r.hooks,[{file:e,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${s}. This field was ignored.`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"}]}let n=r.hooks,o=[];for(let s of Object.keys(n)){if(!bul.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${iPt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=QCe(n[s]);delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Hook event "${s}" must be an array of matchers; received ${c}. This entry was ignored.`,severity:"warning",invalidValue:c,docLink:"https://code.claude.com/docs/en/hooks"})}}return o.length>0&&Object.keys(n).length===0&&delete r.hooks,o}function Iul(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of Tul){if(!(o in r))continue;if(!Array.isArray(r[o])){let u=r[o];delete r[o],n.push({file:e,path:o,message:`"${o}" must be an array; received ${QCe(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,Qfo.execFile)(t,e,{encoding:"utf-8",timeout:Rul},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function Dul(){return(async()=>{if(process.platform==="darwin"){let t=kul(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,qfo.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await D6e(xul,[...wul,r]);return{stdout:o,label:n,ok:s===0&&!!o}}))).find(r=>r.ok);return{plistStdouts:e?[{stdout:e.stdout,label:e.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let t=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`,[e,r]=await Promise.all([D6e(t,["query",fqr,"/v",LCe]),D6e(t,["query",pqr,"/v",LCe])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(Ufo()){let[t,e]=await Promise.all([D6e(Aoo,["query",fqr,"/v",LCe]),D6e(Aoo,["query",pqr,"/v",LCe])]);return{plistStdouts:null,hklmStdout:t.code===0?t.stdout:null,hkcuStdout:e.code===0?e.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function Nul(){return Pul}function Mul(){Vkt||(Vkt=(async()=>{let t=Date.now(),e=Nul()??Dul(),{mdm:r,hkcu:n,wslInherits:o}=Uul(await e);jfo=r,Hfo=n,Gfo=o;let s=Date.now()-t;if(hu(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){hu(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{iqr("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function Oul(){Vkt||Mul(),await Vkt}function Lul(){return jfo??JW}function Bul(){return Hfo??JW}function Ful(){return Gfo}function J7r(t,e){let r=oz(LPt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=Sbe(r,e),o=bbe().safeParse(r);if(!o.success){let s=UUe(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function yoo(t,e="Settings"){let r=t.split(/\r?\n/),n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`^\\s+${n}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let s of r){let c=s.match(o);if(c&&c[1])return c[1].trimEnd()}return null}function Uul(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=J7r(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:JW,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=yoo(t.hklmStdout);c&&(r=J7r(c,`Registry: ${fqr}\\${LCe}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:JW,o=Ufo(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||qul(),!s))return{mdm:n,hkcu:JW,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:JW,wslInherits:s}}if(Qul(s))return{mdm:n,hkcu:JW,wslInherits:s};if(t.hkcuStdout){let c=yoo(t.hkcuStdout);if(c){let l=J7r(c,`Registry: ${pqr}\\${LCe}`);if(!o||l.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:u,...d}=l.settings;return{mdm:n,hkcu:{settings:d,errors:l.errors},wslInherits:s}}if(l.errors.length>0)return{mdm:n,hkcu:{settings:{},errors:l.errors},wslInherits:s}}}return{mdm:n,hkcu:JW,wslInherits:s}}function Qul(t){return t&&Eoo($kt)?!0:Eoo(EUe())}function _oo(t){let e=oz(LPt(OPt(t),!1));if(!e||typeof e!="object")return!1;Sbe(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function qul(){function t(e){try{let r=LPt(OPt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,Voe.join)($kt,"managed-settings.json")))return!0;try{let e=(0,Voe.join)($kt,"managed-settings.d");for(let r of ox().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,Voe.join)(e,r.name)))return!0}catch{}return!1}function Eoo(t){try{if(_oo((0,Voe.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,Voe.join)(t,"managed-settings.d"),r=ox().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(_oo((0,Voe.join)(e,n.name)))return!0}catch{}}catch{}return!1}function jul(t,e,r){(r!==void 0&&!oPt(t[e],r)||r===void 0&&!(e in t))&&Uqr(t,e,r)}function Hul(t){return function(e,r,n){for(var o=-1,s=Object(e),c=n(e),l=c.length;l--;){var u=c[t?l:++o];if(r(s[u],u,s)===!1)break}return e}}function Wul(t){return Abe(t)&&jqr(t)}function edl(t){if(!Abe(t)||CUe(t)!=Yul)return!1;var e=Zso(t);if(e===null)return!0;var r=Zul.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&$fo.call(r)==Xul}function rdl(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function ndl(t){return fJc(t,Yso(t))}function odl(t,e,r,n,o,s,c){var l=mqr(t,r),u=mqr(e,r),d=c.get(u);if(d){hqr(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=iz(u),g=!m&&Qqr(u),A=!m&&!g&&Wso(u);f=u,m||g||A?iz(l)?f=l:zul(l)?f=wZc(l):g?(h=!1,f=Jso(u,!0)):A?(h=!1,f=LZc(u,!0)):f=[]:tdl(u)||Z6e(u)?(f=l,Z6e(l)?f=idl(l):(!N9(l)||wqr(l))&&(f=QZc(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),hqr(t,r,f)}function Vfo(t,e,r,n,o){t!==e&&Vul(e,function(s,c){if(o||(o=new oJc),N9(s))sdl(t,e,c,r,Vfo,n,o);else{var l=n?n(mqr(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),hqr(t,c,l)}},Yso)}function cdl(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function udl(t,e,r){return e=voo(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=voo(n.length-e,0),c=Array(s);++o0){if(++e>=mdl)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function vdl(t,e){return zfo(Wfo(t,e,eao),t+"")}function bdl(t,e,r){if(!N9(r))return!1;var n=typeof e;return(n=="number"?jqr(r)&&lPt(e,r.length):n=="string"&&e in r)?oPt(r[e],t):!1}function Tdl(t){return Cdl(function(e,r){var n=-1,o=r.length,s=o>1?r[o-1]:void 0,c=o>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(o--,s):void 0,c&&Sdl(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?Yfo(l,e-1,r,n,o):kZc(o,l):n||(o[o.length]=l)}return o}function Bdl(t){var e=t==null?0:t.length;return e?Ldl(t,1):[]}function Udl(t){return zfo(Wfo(t,void 0,Fdl),t+"")}function Gdl(){return void 0??(0,Kfo.join)(mbe(),jdl)}function $dl(){try{let t=OPt(Gdl()),e=CM(pfo(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function Vdl(){if(!void 0&&Hdl!==!0)return null;if(X7r)return X7r;let t=$dl();return t?(X7r=t,Wqr(),t):null}function uGr(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),Xll.filter(r=>e.has(r))}function Wdl(){return(0,Vy.join)(EUe(),"managed-settings.json")}function Jfo(t){if(BPt()==="wsl"&&t.wslInherits?.()){let e=eQr($kt);if(e.settings)return e;let r=eQr(EUe());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return eQr(EUe())}function eQr(t){let e=[],r={},n=!1,{settings:o,errors:s}=Wkt((0,Vy.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=ez(r,o,tz),n=!0);let c=(0,Vy.join)(t,"managed-settings.d");try{let d=ox().readdirSync(c).filter(f=>(f.isFile()||f.isSymbolicLink())&&f.name.endsWith(".json")&&!f.name.startsWith(".")).map(f=>f.name).sort();for(let f of d){let{settings:h,errors:m}=Wkt((0,Vy.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=ez(r,h,tz),n=!0)}}catch(d){let f=ix(d);f!=="ENOENT"&&f!=="ENOTDIR"&&hu(`managed-settings.d read failed: ${d}`,{level:"error"})}let{wslInheritsWindowsSettings:l,...u}=r;return{settings:n&&Object.keys(u).length>0?r:null,errors:e}}function zdl(t,e){SUe(t)?hu(`Broken symlink or missing file encountered for settings.json at path: ${e}`):hu(`settings file read failed at ${e}: ${t}`,{level:"error"})}function Wkt(t,e){let r=bXc(t);if(r)return{settings:r.settings?oz(r.settings):null,errors:r.errors};let n=Ydl(t,e);return SXc(t,n),{settings:n.settings?oz(n.settings):null,errors:n.errors}}function Zfo(t){if(!t.mdm)return{settings:null,errors:[]};let e=t.mdm();return{settings:Object.keys(e.settings).length>0?e.settings:null,errors:e.errors}}function Xfo(t){let e=t?.remote?t.remote():Vdl();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=oz(e),n=Sbe(r,"remote managed settings"),o=bbe().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...UUe(o.error,"remote managed settings")]}}function epo(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=oz(e),n=Sbe(r,"parent managed settings"),o=bbe().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...UUe(o.error,"parent managed settings")]}}function tpo(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=oz(e),n=Sbe(r,"SDK inline settings"),o=bbe().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...UUe(o.error,"SDK inline settings")]}}function Ydl(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=iao(ox(),t);r=OPt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=oz(LPt(r,!1)),o=Sbe(n,t),s=bbe().safeParse(n);if(!s.success){let c=UUe(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return zdl(r,t),{settings:null,errors:[]}}}function boo(t,e){switch(t){case"userSettings":return(0,Vy.resolve)(mbe());case"policySettings":case"projectSettings":case"localSettings":return(0,Vy.resolve)(e.cwd);case"flagSettings":return e.flagPath?(0,Vy.dirname)((0,Vy.resolve)(e.flagPath)):(0,Vy.resolve)(e.cwd)}}function Kdl(t){return t.coworkPlugins||bE(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function zkt(t,e){switch(t){case"userSettings":return(0,Vy.join)(boo(t,e),Kdl(e));case"projectSettings":case"localSettings":return(0,Vy.join)(boo(t,e),Jdl(t));case"policySettings":return Wdl();case"flagSettings":return e.flagPath}}function Jdl(t){switch(t){case"projectSettings":return(0,Vy.join)(".claude","settings.json");case"localSettings":return(0,Vy.join)(".claude","settings.local.json")}}function rpo(t,e){let r=EXc(t);if(r!==void 0)return r;let n=rfl(t,e);return vXc(t,n),n}function Zdl(t){return!t||t.parentSettingsBehavior==="merge"}function Xdl(t,e){let r={};t.allowManagedHooksOnly===!0&&(r.allowManagedHooksOnly=!0),t.allowManagedMcpServersOnly===!0&&(r.allowManagedMcpServersOnly=!0),t.allowManagedPermissionRulesOnly===!0&&(r.allowManagedPermissionRulesOnly=!0);let n=t.strictPluginOnlyCustomization;if((n===!0||Array.isArray(n)&&n.length>0)&&(r.strictPluginOnlyCustomization=n),t.deniedMcpServers&&(r.deniedMcpServers=t.deniedMcpServers),e.forceLoginOrgUUID===void 0&&t.forceLoginOrgUUID&&(r.forceLoginOrgUUID=t.forceLoginOrgUUID),e.allowedMcpServers===void 0&&t.allowedMcpServers&&(r.allowedMcpServers=t.allowedMcpServers),t.permissions){let o=Z7r(t.permissions,["deny","ask"]);if(t.permissions.disableBypassPermissionsMode==="disable"&&(o.disableBypassPermissionsMode="disable"),e.allowManagedPermissionRulesOnly!==!0){let{allow:s,additionalDirectories:c}=t.permissions;s&&e.sandbox?.network?.allowManagedDomainsOnly!==!0&&(o.allow=s),c&&(o.additionalDirectories=c)}Object.keys(o).length>0&&(r.permissions=o)}if(t.sandbox){let{network:o,filesystem:s}=t.sandbox,c={};if(t.sandbox.enabled===!0&&(c.enabled=!0),t.sandbox.failIfUnavailable===!0&&(c.failIfUnavailable=!0),t.sandbox.allowUnsandboxedCommands===!1&&(c.allowUnsandboxedCommands=!1),t.sandbox.autoAllowBashIfSandboxed===!1&&(c.autoAllowBashIfSandboxed=!1),o){let l=Z7r(o,["deniedDomains"]);o.allowManagedDomainsOnly===!0&&(l.allowManagedDomainsOnly=!0),e.sandbox?.network?.allowManagedDomainsOnly!==!0&&o.allowedDomains&&(l.allowedDomains=o.allowedDomains),Object.keys(l).length>0&&(c.network=l)}if(s){let l=Z7r(s,["denyRead","denyWrite"]);s.allowManagedReadPathsOnly===!0&&(l.allowManagedReadPathsOnly=!0),e.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&s.allowRead&&(l.allowRead=s.allowRead),Object.keys(l).length>0&&(c.filesystem=l)}Object.keys(c).length>0&&(r.sandbox=c)}return r}function efl(t){if(t.helper?.())return"helper";if(Xfo(t).settings)return"remote";if(Zfo(t).settings)return BPt()==="macos"?"plist":"hklm";if((t.file?.()??Jfo(t)).settings)return"file";if(epo(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function tfl(t){let e=[],{settings:r,errors:n}=Xfo(t);e.push(...n);let{settings:o,errors:s}=Zfo(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??Jfo(t);e.push(...l);let{settings:u,errors:d}=epo(t);e.push(...d);let f=[r,o,c].filter(A=>A!==null),h=f[0]??null,m={allowManagedPermissionRulesOnly:f.some(A=>A.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:f.find(A=>A.forceLoginOrgUUID!==void 0)?.forceLoginOrgUUID,allowedMcpServers:f.find(A=>A.allowedMcpServers!==void 0)?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:f.some(A=>A.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:f.some(A=>A.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},g=u&&Zdl(h)?Xdl(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function npo(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=tfl(t);if(!r&&!n){let s=t.hkcu?.();return s&&Object.keys(s.settings).length>0?{settings:s.settings,errors:[...o,...s.errors]}:{settings:null,errors:[...o,...s?.errors??[]]}}return{settings:ez({},n??{},r??{},tz),errors:o}}function rfl(t,e){if(t==="policySettings")return npo(e).settings;let r=zkt(t,e),{settings:n}=r?Wkt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=tpo(e);if(o)return ez(n||{},o,tz)}return n}function nfl(t,e){return Bao([...t,...e])}function tz(t,e){if(Array.isArray(t)&&Array.isArray(e))return nfl(t,e)}function ifl(t){if(tQr)return{settings:{},errors:[]};let e=Date.now();iqr("info","settings_load_started"),tQr=!0;try{let r=IXc(),n={};r&&(n=ez(n,r,tz));let o=[],s=new Set,c=new Set;for(let l of uGr(t)){if(l==="policySettings"){let{settings:d,errors:f}=npo(t);d&&(n=ez(n,d,tz));for(let h of f){let m=`${h.file}:${h.path}:${h.message}`;s.has(m)||(s.add(m),o.push(h))}continue}let u=zkt(l,t);if(u){let d=(0,Vy.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=Wkt(u,l==="flagSettings"?t.flagExpectedContent:void 0);for(let m of h){let g=`${m.file}:${m.path}:${m.message}`;s.has(g)||(s.add(g),o.push(m))}f&&(n=ez(n,f,tz))}}if(l==="flagSettings"){let{settings:d,errors:f}=tpo(t);for(let h of f){let m=`${h.file}:${h.path}:${h.message}`;s.has(m)||(s.add(m),o.push(h))}d&&(n=ez(n,d,tz))}}return iqr("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{tQr=!1}}function ofl(t){let e=yXc();if(e!==null)return e;let r=ifl(t);return _Xc(r),r}function sfl(t){let{settings:e}=ofl(t);return e||{}}function afl(t){Wqr();let e=[];for(let r of uGr(t)){let n=rpo(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:sfl(t),sources:e}}function cfl(t,e){let r=uGr(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(rpo(o,e)?.[t]!==void 0)return o}return null}function pfl(t){let e=t.effective.permissions?.defaultMode;if(!e||!dfl.has(e))return t.effective;for(let r=t.sources.length-1;r>=0;r--){let n=t.sources[r];if(n.settings.permissions?.defaultMode!==void 0){if(ffl.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function hfl(t={}){await Oul();let e={cwd:(0,dfo.resolve)(t.cwd??ox().cwd()),allowedSources:(t.settingSources??ufl).map(r=>lfl[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:Lul,hkcu:Bul,wslInherits:Ful,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=afl(e),o=efl(e)??void 0,s=n.map(({source:l,settings:u})=>({source:Soo[l],settings:u,path:l==="policySettings"?void 0:zkt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=cfl(l,e);u&&(c[l]={source:Soo[u],path:u==="policySettings"?void 0:zkt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{Wqr()}}async function mfl(t){return hfl(t)}async function gfl(t,e){try{await(0,SE.copyFile)(t,e)}catch(r){if(!SUe(r))throw r}}async function Afl(t,e){if(!t)return;let r=t;try{let n=CM(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=Xm(n))}catch{}await(0,SE.writeFile)(e,r,{mode:384})}function yfl(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=Htl(jtl);return new Promise(e=>{(0,Woo.execFile)("security",["find-generic-password","-a",$tl(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function ipo(t,e,r,n,o=6e4){if(!Uh(e))return;let s=Zk(r),c=await qoe(t.load({projectKey:s,sessionId:e}),o,`SessionStore.load() timed out after ${o}ms for session ${e}`);if(!c||c.length===0)return;let l=(0,Cc.join)((0,qCe.tmpdir)(),`claude-resume-${(0,rPt.randomUUID)()}`);try{let u=(0,Cc.join)(l,"projects",s);await(0,SE.mkdir)(u,{recursive:!0});let d=(0,Cc.join)(u,`${e}.jsonl`);await PQr(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,Cc.join)((0,qCe.homedir)(),".claude"),m;try{m=await(0,SE.readFile)((0,Cc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!SUe(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await yfl()??m),await Afl(m,(0,Cc.join)(l,".credentials.json")),await gfl((0,Cc.join)(f??(0,qCe.homedir)(),".claude.json"),(0,Cc.join)(l,".claude.json")),t.listSubkeys){let g=(0,Cc.join)(u,e),A=await qoe(t.listSubkeys({projectKey:s,sessionId:e}),o,`SessionStore.listSubkeys() timed out after ${o}ms for session ${e}`);for(let y of A){let _=(0,Cc.resolve)(g,y+".jsonl");if(!y||(0,Cc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!_.startsWith(g+Cc.sep)){hu(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let E=await qoe(t.load({projectKey:s,sessionId:e,subpath:y}),o,`SessionStore.load() timed out after ${o}ms for session ${e} subpath ${y}`);if(!E||E.length===0)continue;let v=[],S=[];for(let T of E)yqr(T)?v.push(T):S.push(T);if(S.length>0&&(await(0,SE.mkdir)((0,Cc.dirname)(_),{recursive:!0}),await PQr(_,S)),v.length>0){let T=v.at(-1),w=(0,Cc.resolve)(g,y+".meta.json");await(0,SE.mkdir)((0,Cc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,SE.writeFile)(w,Xm(x),{mode:384})}}}return l}catch(u){throw await Ykt(l),u}}function gqr(t,e,r,n){let{systemPrompt:o,settings:s,managedSettings:c,settingSources:l,sandbox:u,...d}=t??{},f,h,m;o===void 0?f="":typeof o=="string"||Array.isArray(o)?f=o:o.type==="preset"&&(h=o.append,m=o.excludeDynamicSections),process.env.CLAUDE_AGENT_SDK_VERSION="0.3.159";let{abortController:g=nQr(),additionalDirectories:A=[],agent:y,agents:_,allowedTools:E=[],betas:v,canUseTool:S,continue:T,cwd:w,debug:R,debugFile:x,disallowedTools:k=[],tools:D,env:N,executable:O=nso()?"bun":"node",executableArgs:B=[],extraArgs:q={},fallbackModel:M,enableFileCheckpointing:L,toolConfig:U,forkSession:j,hooks:Q,includeHookEvents:Y,includePartialMessages:W,forwardSubagentText:V,onElicitation:z,persistSession:ie,sessionStore:H,sessionStoreFlush:re,thinking:le,effort:Le,maxThinkingTokens:me,maxTurns:Oe,maxBudgetUsd:Te,taskBudget:te,mcpServers:ee,model:K,outputFormat:he,permissionMode:X="default",allowDangerouslySkipPermissions:de=!1,permissionPromptToolName:Be,plugins:ne,getOAuthToken:ue,getHostAuthToken:Ne,workload:xe,resume:Fe,resumeSessionAt:tt,sessionId:st,skills:vt,stderr:Pt,strictMcpConfig:Ht}=d;if(H&&ie===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(H&&T&&!Fe&&!H.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(H&&L)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");H&&d.spawnClaudeCodeProcess&&hu("sessionStore with custom spawnClaudeCodeProcess: ensure the subprocess CLAUDE_CONFIG_DIR matches the parent (same path, same separators) or transcript_mirror frames will be dropped.",{level:"warn"});let F=d.pathToClaudeCodeExecutable;if(!F){let je=(0,Koo.fileURLToPath)(importMetaUrlShim),J=(0,zoo.createRequire)(je),ae=Tel(Ce=>J.resolve(Ce));if(!ae)throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`);F=ae}let se=he?.type==="json_schema"?he.schema:void 0,be=N?{...N}:{...process.env};be.CLAUDE_CODE_ENTRYPOINT||(be.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),be.CLAUDE_AGENT_SDK_VERSION||(be.CLAUDE_AGENT_SDK_VERSION="0.3.159"),L&&(be.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true"),ue&&(be.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ne&&(be.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),U?.askUserQuestion?.previewFormat&&(be.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=U.askUserQuestion.previewFormat);let Ue={};if(Aio.propagation.inject(Aio.context.active(),Ue),"traceparent"in Ue)for(let je of["TRACEPARENT","TRACESTATE"])je in(N??{})||delete be[je];for(let[je,J]of Object.entries(Ue)){let ae=je.toUpperCase();ae in(N??{})||(be[ae]=J)}let Qe={},ge=new Map;if(ee)for(let[je,J]of Object.entries(ee))J.type==="sdk"&&J.instance?ge.set(je,J.instance):Qe[je]=J;let Z;if(le)switch(le.type){case"adaptive":Z={type:"adaptive",display:le.display};break;case"enabled":Z={type:"enabled",budgetTokens:le.budgetTokens,display:le.display};break;case"disabled":Z={type:"disabled"};break}else me!==void 0&&(Z=me===0?{type:"disabled"}:{type:"enabled",budgetTokens:me});r&&(be.CLAUDE_CONFIG_DIR=r,process.platform==="win32"&&(be.CLAUDE_SECURESTORAGE_CONFIG_DIR=N?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??N?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??""));let ve=new IQr({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:O,executableArgs:B,extraArgs:xe?{...q,workload:xe}:q,pathToClaudeCodeExecutable:F,env:be,forkSession:j,stderr:Pt,thinkingConfig:Z,effort:Le,maxTurns:Oe,maxBudgetUsd:Te,taskBudget:te,model:K,fallbackModel:M,jsonSchema:se,permissionMode:X,allowDangerouslySkipPermissions:de,permissionPromptToolName:Be,continueConversation:H?void 0:T,resume:Fe,resumeSessionAt:tt,sessionId:st,settings:typeof s=="object"?Xm(s):s,managedSettings:c?Xm(c):void 0,settingSources:l,skills:vt,allowedTools:E,disallowedTools:k,tools:D,mcpServers:Qe,strictMcpConfig:Ht,canUseTool:!!S,hooks:!!Q,includeHookEvents:Y,includePartialMessages:W,persistSession:ie,sessionMirror:!!H,plugins:ne,sandbox:u,spawnClaudeCodeProcess:d.spawnClaudeCodeProcess,deferSpawn:n}),Ge={systemPrompt:f,appendSystemPrompt:h,planModeInstructions:d.planModeInstructions,appendSubagentSystemPrompt:d.appendSubagentSystemPrompt,toolAliases:d.toolAliases,excludeDynamicSections:m,agents:_,title:d.title,skills:vt,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:V},qe=new wQr(ve,e,S,Q,g,ge,se,Ge,z,ue,Ne);if(H){let je=a(()=>(0,Cc.join)(be.CLAUDE_CONFIG_DIR??(0,Cc.join)((0,qCe.homedir)(),".claude"),"projects"),"S6"),J=re==="eager",ae=new RQr(async(Ce,Re)=>{let $e=woo(Ce,je());$e?await H.append($e,Re):hu(`[SessionStore] dropping mirror frame: filePath ${Ce} is not under ${je()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(Ce,Re)=>{let $e=woo(Ce,je());$e&&qe.reportMirrorError($e,Re.message)},J?0:Yqr,J?0:Kqr);qe.setTranscriptMirrorBatcher(ae)}return{queryInstance:qe,transport:ve,abortController:g,processEnv:be}}function Aqr(t,e,r,n){typeof r=="string"?e.write(Xm({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:r}]},parent_tool_use_id:null})+` -`):t.streamInput(r).catch(o=>n.abort(o))}async function Ykt(t){for(let e=0;;e++)try{return await(0,SE.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!_fl.has(ix(r)??""))return;await Zoo((e+1)*100)}}function Efl(t,e){t.waitForExit().catch(()=>{}).finally(()=>Ykt(e))}function vfl({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=gqr({...e},typeof t=="string",void 0,!0),d=(0,Cc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await qoe(f.listSessions(Zk(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return ipo(f,m,d,e.env,e.loadTimeoutMs)})().then(g=>{if(g){c.updateResume(m);let A={CLAUDE_CONFIG_DIR:g};if(process.platform==="win32"){let y=e.env?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??e.env?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??"";A.CLAUDE_SECURESTORAGE_CONFIG_DIR=y,u.CLAUDE_SECURESTORAGE_CONFIG_DIR=y}c.updateEnv(A),u.CLAUDE_CONFIG_DIR=g,s.addCleanupCallback(()=>Efl(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=bUe(g);c.spawnAbort(A),s.setError(A)}),Aqr(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=gqr(e,typeof t=="string");return Aqr(r,n,t,o),r}async function Cfl({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,Cc.resolve)(t.cwd??".");if(!n){if(!t.sessionStore.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");let u=t.loadTimeoutMs??6e4;n=(await qoe(t.sessionStore.listSessions(Zk(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await ipo(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=gqr(r&&n&&n!==t?.resume?{...t,resume:n}:t,!1,r);o=u.queryInstance;let{transport:d,abortController:f}=u;s=d;let h=u.queryInstance;if(r){let g=r;h.addCleanupCallback(()=>{c=d.waitForExit().catch(()=>{}).then(()=>Ykt(g))})}await qoe(h.initializationResult(),e,`Subprocess initialization did not complete within ${e}ms \u2014 check authentication and network connectivity`);let m=!1;return{query(g){if(m)throw Error("WarmQuery.query() can only be called once");m=!0;try{Aqr(h,d,g,f)}catch(A){throw h.close(),A}return typeof g=="string"&&h.setIsSingleUserTurn(!0),h},close:l,async[Symbol.asyncDispose](){m=!0,h.close(),await c}}}catch(l){if(o?.close(),r&&!c){let u=s;c=(u?u.waitForExit().catch(()=>{}):Promise.resolve()).then(()=>Ykt(r))}throw await c,l}}async function bfl(t,e){return e?.sessionStore?Lfl(e.sessionStore,t,e):ctl(t,e)}async function Sfl(t){return t?.sessionStore?Mfl(t.sessionStore,t):mtl(t)}async function Tfl(t,e){return e?.sessionStore?Bfl(e.sessionStore,t,e):gtl(t,e)}async function Ifl(t,e,r){return r?.sessionStore?Ffl(r.sessionStore,t,e,r.dir):Atl(t,e,r)}async function xfl(t,e,r){return r?.sessionStore?Ufl(r.sessionStore,t,e,r.dir):ytl(t,e,r)}async function wfl(t,e){if(!Uh(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=Zk(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return _tl(t,e)}async function Rfl(t,e){return e?.sessionStore?Qfl(e.sessionStore,t,e):Ttl(t,e)}async function kfl(t,e,r){if(!Uh(t))throw Error(`Invalid sessionId: ${t}`);let n=await fPt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=Zk(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:Yqr;if(await Too(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,Cc.join)(c,"subagents");for(let u of await Pfl(l)){let d=(0,Cc.relative)(c,u).split(Cc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await Too(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=CM(await(0,SE.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!SUe(m))throw m}}}async function Too(t,e,r,n){let o=(0,Yoo.createInterface)({input:(0,nPt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push(CM(l)),c+=l.length,(s.length>=n||c>=Kqr)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function Pfl(t){let e=[];async function r(n){let o;try{o=await(0,SE.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,Cc.join)(n,s.name);s.isDirectory()?await r(c):s.isFile()&&s.name.endsWith(".jsonl")&&e.push(c)}}return a(r,"J"),await r(t),e}async function Dfl(t,e){return e?.sessionStore?qfl(e.sessionStore,t,e.dir):Ptl(t,e)}async function Nfl(t,e,r){return r?.sessionStore?jfl(r.sessionStore,t,e,r):Dtl(t,e,r)}function opo(t){let e=(0,Cc.resolve)(t??"."),r;try{r=(0,nPt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function Zk(t){return IUe(opo(t))}function spo(t){return t.map(e=>Xm(e)).join(` +`),encoding:o,lineEndings:c}}function LPt(t){return Fcl(t).content}function mfo(t){return t.startsWith("\uFEFF")?t.slice(1):t}function jcl(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),qkt.default.platform==="darwin"?Ucl(t):qkt.default.platform==="win32"?Qcl(t):qcl(t)}function Hcl(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||bE(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function Gcl(){return Hcl()==="essential-traffic"}function Vcl(t){z7r.length>=$cl&&z7r.shift(),z7r.push(t)}function gfo(t){let e=bUe(t);try{if(bE(process.env.CLAUDE_CODE_USE_BEDROCK)||bE(process.env.CLAUDE_CODE_USE_VERTEX)||bE(process.env.CLAUDE_CODE_USE_FOUNDRY)||bE(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||bE(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||Gcl())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(Vcl(r),soo===null){Wcl.push({type:"error",error:e});return}soo.logError(e)}catch{}}function Ycl(t,e,r=100){let n=new cqr({max:r}),o=a((...s)=>{let c=e(...s),l=n.get(c);if(l!==void 0)return l;let u=t(...s);return n.set(c,u),u},"X");return o.cache={clear:a(()=>n.clear(),"clear"),size:a(()=>n.size,"size"),delete:a(s=>n.delete(s),"delete"),get:a(s=>n.peek(s),"get"),has:a(s=>n.has(s),"has")},o}function Efo(t,e){try{return{ok:!0,value:JSON.parse(mfo(t))}}catch(r){return e&&gfo(r),{ok:!1}}}function cll(){let t=G.object({type:G.literal("command").describe("Shell command hook type"),command:G.string().describe("Shell command to execute"),args:G.array(G.string()).optional().describe("Argument list for exec form. When present, `command` is resolved as an executable and spawned directly with these arguments \u2014 no shell. Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:P6e(),shell:G.enum(all).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:G.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:G.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:G.string().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:G.string().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".')}),e=G.object({type:G.literal("prompt").describe("LLM prompt hook type"),prompt:G.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:P6e(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:G.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-4-6"). If not specified, uses the default small fast model.'),continueOnBlock:G.boolean().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),r=G.object({type:G.literal("mcp_tool").describe("MCP tool hook type"),server:G.string().describe("Name of an already-configured MCP server to invoke"),tool:G.string().describe("Name of the tool on that server to call"),input:G.record(G.string(),G.unknown()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:P6e(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),n=G.object({type:G.literal("http").describe("HTTP hook type"),url:G.string().url().describe("URL to POST the hook input JSON to"),if:P6e(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:G.record(G.string(),G.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:G.array(G.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),o=G.object({type:G.literal("agent").describe("Agentic verifier hook type"),prompt:G.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:P6e(),timeout:G.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:G.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.'),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:t,PromptHookSchema:e,HttpHookSchema:n,AgentHookSchema:o,McpToolHookSchema:r}}function bll(t){return Sfo.has(t.toLowerCase())?!1:Cll.test(t)?!0:vll.test(t)}function Vll(t){let e=Gll();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=$ll().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(hu(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(hu(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function Nfo(){return nul.filter(t=>UPt[t].buildGate())}function iul(t){let e={};for(let r of t)e={...e,...UPt[r].shape()};return e}function oul(t){let e={};for(let r of t)e={...e,...UPt[r].permissionsShape?.()};return e}function sul(t){let e=[];for(let r of t)e.push(...UPt[r].permissionModes?.()??[]);return e}function aul(t){let e=t.split("__"),[r,n,...o]=e;if(r!=="mcp"||!n)return null;let s=o.length>0?o.join("__"):void 0;return{serverName:n,toolName:s}}function kCe(t){return Object.hasOwn(foo,t)?foo[t]:t}function cul(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function lul(t){let e=uul(t,"(");if(e===-1)return{toolName:kCe(t)};let r=dul(t,")");if(r===-1||r<=e)return{toolName:kCe(t)};if(r!==t.length-1)return{toolName:kCe(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:kCe(t)};if(o===""||o==="*")return{toolName:kCe(n)};let s=cul(o);return{toolName:kCe(n),ruleContent:s}}function uul(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function dul(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]===e){let n=0,o=r-1;for(;o>=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function ful(t){return $kt.filePatternTools.includes(t)}function pul(t){return $kt.bashPrefixTools.includes(t)}function hul(t){return Object.hasOwn($kt.customValidation,t)?$kt.customValidation[t]:void 0}function Ofo(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function K7r(t,e){let r=0;for(let n=0;n0?{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${n.toolName}" without parentheses, or use "mcp__${o.serverName}__*" for all tools`,examples:[`mcp__${o.serverName}`,`mcp__${o.serverName}__*`,o.toolName&&o.toolName!=="*"?`mcp__${o.serverName}__${o.toolName}`:void 0].filter(Boolean)}:{valid:!0};if(!n.toolName||n.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(!n.toolName.includes("_")&&n.toolName[0]!==n.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${eel(String(n.toolName))}"`};let s=hul(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(pul(n.toolName)&&n.ruleContent!==void 0){let c=n.ruleContent;if(c.includes(":*")&&!c.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(c===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]}}if(ful(n.toolName)&&n.ruleContent!==void 0){let c=n.ruleContent;if(c.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${n.toolName}(*.ts) - matches .ts files`,`${n.toolName}(src/**) - matches all files in src`,`${n.toolName}(**/*.test.ts) - matches test files`]};if(c.includes("*")&&!c.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!c.includes("**"))return{valid:!1,error:"Wildcard placement might be incorrect",suggestion:"Wildcards are typically used at path boundaries",examples:[`${n.toolName}(*.js) - all .js files`,`${n.toolName}(src/*) - all files directly in src`,`${n.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}function Bfo(t){return G.object({allow:G.array(J7r()).optional().describe("List of permission rules for allowed operations"),deny:G.array(J7r()).optional().describe("List of permission rules for denied operations"),ask:G.array(J7r()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum([...lGr,...sul(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...oul(t),additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function _ul(t){return G.object({$schema:G.literal(rul).optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:G.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:G.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:G.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:G.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:G.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),policyHelper:yul().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...bE(process.env.CLAUDE_CODE_ENABLE_XAA)&&{xaaIdp:G.object({issuer:G.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:G.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:G.number().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")},fileSuggestion:G.object({type:G.literal("command"),command:G.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:G.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:G.object({enabled:G.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:G.number().int().positive().optional().describe("Minutes of continuous use before the reminder fires (default 120). Re-fires every interval until you take a break."),breakThresholdMinutes:G.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 15)"),message:G.string().optional().describe("Custom reminder text. Leave unset for a rotating set of friendly nudges.")}).optional().describe("@internal Opt-in break reminder. When enabled, shows a dismissible nudge after sustained continuous use. Never blocks \u2014 just a friendly heads-up."),quietHours:G.object({enabled:G.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:G.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "22:00")').optional().describe('Start of the quiet-hours window, 24-hour local time "HH:MM".'),end:G.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "07:00")').optional().describe('End of the quiet-hours window, 24-hour local time "HH:MM". May be earlier than start for an overnight range.')}).optional().describe("@internal Opt-in quiet hours. When enabled, shows a single soft nudge per session while inside the configured local-time window. Never blocks."),cleanupPeriodDays:G.number().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),skillListingMaxDescChars:G.number().int().positive().optional().describe("Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost."),skillListingBudgetFraction:G.number().gt(0).lte(1).optional().describe("Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost."),wslInheritsWindowsSettings:G.boolean().optional().describe("When set to true in either admin-only Windows source \u2014 the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json \u2014 WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect."),env:gul().optional().describe("Environment variables to set for Claude Code sessions"),attribution:G.object({commit:G.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:G.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:G.boolean().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),includeGitInstructions:G.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:Bfo(t).optional().describe("Tool usage permissions configuration"),model:G.string().optional().describe("Override the default model used by Claude Code"),availableModels:G.array(G.string()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),modelOverrides:G.record(G.string(),G.string()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),enableAllProjectMcpServers:G.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:G.array(G.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:G.array(G.string()).optional().describe("List of rejected MCP servers from .mcp.json"),skillOverrides:G.record(G.string(),G.enum(["on","name-only","user-invocable-only","off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),allowedMcpServers:G.array(Ffo()).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:G.array(Ufo()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:Hkt().optional().describe("Custom commands to run before/after tool executions"),worktree:G.object({symlinkDirectories:G.array(G.string()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:G.array(G.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). Dramatically faster in large monorepos \u2014 only the listed paths are written to disk."),baseRef:G.enum(["fresh","head"]).optional().describe("Which ref new worktrees branch from. 'fresh' (default) branches from origin/ for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation."),bgIsolation:G.enum(["worktree","none"]).optional().catch(void 0).describe("Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly.")}).optional().describe("Git worktree configuration for --worktree flag."),disableAllHooks:G.boolean().optional().describe("Disable all hooks and statusLine execution"),disableAgentView:G.boolean().optional().describe("Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1."),disableRemoteControl:G.boolean().optional().describe("Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings."),disableWorkflows:G.boolean().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),enableWorkflows:G.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowKeywordTriggerEnabled:G.boolean().optional().describe('Enable the "workflow"/"workflows" keyword trigger that opts a prompt into the Workflow tool. Set to false to type the word without triggering a workflow. Default: true.'),disableSkillShellExecution:G.boolean().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:G.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),allowManagedHooksOnly:G.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:G.array(G.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:G.array(G.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:G.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),allowManagedMcpServersOnly:G.boolean().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),allowAllClaudeAiMcps:G.boolean().optional().describe("When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only."),strictPluginOnlyCustomization:G.preprocess(e=>Array.isArray(e)?e.filter(r=>poo.includes(r)):e,G.union([G.boolean(),G.array(G.enum(poo))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. Composes with strictKnownMarketplaces for end-to-end admin control \u2014 plugins gated by marketplace allowlist, everything else blocked here.'),statusLine:G.object({type:G.literal("command"),command:G.string(),padding:G.number().optional(),refreshInterval:G.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:G.boolean().optional().describe("Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.")}).optional().describe("Custom status line display configuration"),prUrlTemplate:G.string().optional().describe('URL template for PR links in the footer badge and inline messages. Placeholders: {host} {owner} {repo} {number} {url}. Example: "https://reviews.example.com/{owner}/{repo}/pull/{number}"'),subagentStatusLine:G.object({type:G.literal("command"),command:G.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:G.record(G.string(),G.union([G.array(G.string()),G.boolean(),G.undefined()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json \u2014 setting false in ~/.claude/settings.json is overridden by the project.'),extraKnownMarketplaces:G.record(G.string(),Aul()).check(e=>{for(let[r,n]of Object.entries(e.value))n.source.source==="settings"&&n.source.name!==r&&e.issues.push({code:"custom",input:n.source.name,path:[r,"source","name"],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${r}" but source.name "${n.source.name}")`})}).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),strictKnownMarketplaces:G.array(Gkt()).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only \u2014 it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),blockedMarketplaces:G.array(Gkt()).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),pluginSuggestionMarketplaces:G.array(G.string()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips), in addition to the official marketplace. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored."),forceLoginMethod:G.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),parentSettingsBehavior:G.enum(["first-wins","merge"]).optional().describe(`Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" (default): parent is dropped \u2014 admin tiers are the only policy source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).`),forceLoginOrgUUID:G.union([G.string(),G.array(G.string())]).optional().describe("Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization."),forceRemoteSettingsRefresh:G.boolean().optional().describe("When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails"),otelHeadersHelper:G.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:G.string().optional().describe("Controls the output style for assistant responses"),viewMode:G.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:G.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:G.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:Xcl().optional(),feedbackSurveyRate:G.number().min(0).max(1).optional().describe("Probability (0\u20131) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),spinnerTipsEnabled:G.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:G.object({mode:G.enum(["append","replace"]),verbs:G.array(G.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:G.object({excludeDefault:G.boolean().optional(),tips:G.array(G.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:G.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:G.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:G.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:G.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),ultracode:G.boolean().optional().catch(void 0).describe("Enable ultracode for the session: xhigh effort plus standing dynamic-workflow orchestration. Session-scoped \u2014 typically provided via --settings or the apply_flag_settings control request; interactive toggles never persist it. Requires workflows to be enabled and an xhigh-capable model."),autoCompactWindow:G.number().int().min(1e5).max(1e6).optional().catch(void 0).describe("Auto-compact window size"),advisorModel:G.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:G.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:G.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:G.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),awaySummaryEnabled:G.boolean().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:G.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),agent:G.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:G.array(G.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:G.record(G.string(),G.object({mcpServers:G.record(G.string(),G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")})).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:G.object({defaultEnvironmentId:G.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:G.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:G.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:G.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:G.enum(["default","fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),voice:G.object({enabled:G.boolean().optional(),mode:G.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:G.boolean().optional().describe("Submit the prompt when hold-to-talk is released (hold mode only)")}).optional().describe("Voice mode settings (hold-to-talk / tap-to-toggle dictation)"),channelsEnabled:G.boolean().optional().describe("Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:G.array(G.object({marketplace:G.string(),plugin:G.string()})).optional().describe("Managed-org allowlist of channel plugins. When set, replaces the default Anthropic allowlist \u2014 admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:G.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),doneMeansMerged:G.boolean().optional().describe("@internal When true, Claude keeps working until the PR is ready for you to merge, a cron/Monitor is armed to resume later, or it hands you a self-contained next step."),autoMemoryEnabled:G.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:G.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects//memory/."),autoDreamEnabled:G.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:G.boolean().optional().describe("Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install."),skipDangerousModePermissionPrompt:G.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:G.boolean().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow."),disableAutoMode:G.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:G.array(G.object({id:G.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:G.string().describe("Display name for the SSH connection"),sshHost:G.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:G.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:G.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:G.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:G.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:G.array(G.string()).optional().describe('Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:G.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").'),theme:G.union([G.enum(ill),G.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:G.enum(tll).optional().catch(void 0).describe("Key binding mode for the prompt input"),verbose:G.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:G.enum(ell).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:G.boolean().optional().describe("Automatically compact conversation when context fills"),autoScrollEnabled:G.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),fileCheckpointingEnabled:G.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:G.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:G.boolean().optional().describe("Stamp each assistant message with its arrival time"),terminalProgressBarEnabled:G.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:G.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:G.enum(rll).optional().catch(void 0).describe("How spawned teammates execute (tmux, in-process, auto)"),remoteControlAtStartup:G.boolean().optional().describe("Start Remote Control bridge automatically each session"),isolatePeerMachines:G.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:G.enum(["transient","ask"]).optional().describe("When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently"),autoUploadSessions:G.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:G.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:G.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...iul(t)}).passthrough()}function Cul(t){let e=Eul.find(n=>n.matches(t));if(!e)return null;let r={...e.tip};return t.code==="invalid_value"&&t.enumValues&&!r.suggestion&&(r.suggestion=`Valid values: ${t.enumValues.map(n=>`"${n}"`).join(", ")}`),!r.docLink&&t.path&&(r.docLink=vul[rel(t.path,".")]),r}function hoo(t){return t.code==="invalid_type"}function moo(t){return t.code==="invalid_value"}function bul(t){return t.code==="unrecognized_keys"}function goo(t){return t.code==="too_small"}function QCe(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function Aoo(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function UUe(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(moo(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(hoo(r)){l=r.expected;let h=Aoo(r.message);u=h??QCe(r.input),d=h??QCe(r.input)}else goo(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=Cul({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(moo(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(hoo(r)){let h=Aoo(r.message)??QCe(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(bul(r)){let h=r.keys.join(", ");o=`Unrecognized ${tel(r.keys.length,"field")}: ${h}`}else goo(r)&&(o=`Number must be greater than or equal to ${r.minimum}`,s=String(r.minimum));return{file:e,path:n,message:o,expected:s,invalidValue:d,suggestion:f?.suggestion,docLink:f?.docLink}})}function Sul(t,e){if(!t||typeof t!="object")return[];let r=t;if(!r.permissions||typeof r.permissions!="object")return[];let n=r.permissions,o=[];for(let s of["allow","deny","ask"]){let c=n[s];Array.isArray(c)&&(n[s]=c.filter(l=>{if(typeof l!="string")return o.push({file:e,path:`permissions.${s}`,message:`Non-string value in ${s} array was removed`,severity:"warning",invalidValue:l}),!1;let u=Lfo(l);if(!u.valid){let d=`Invalid permission rule "${l}" was skipped: ${u.error}`;return u.suggestion&&(d+=`. ${u.suggestion}`),o.push({file:e,path:`permissions.${s}`,message:d,severity:"warning",invalidValue:l}),!1}return!0}))}return o}function Iul(t,e){if(!t||typeof t!="object")return[];let r=t;if(!("hooks"in r))return[];if(r.hooks===null||typeof r.hooks!="object"||Array.isArray(r.hooks)){let s=QCe(r.hooks);return delete r.hooks,[{file:e,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${s}. This field was ignored.`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"}]}let n=r.hooks,o=[];for(let s of Object.keys(n)){if(!Tul.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${oPt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=QCe(n[s]);delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Hook event "${s}" must be an array of matchers; received ${c}. This entry was ignored.`,severity:"warning",invalidValue:c,docLink:"https://code.claude.com/docs/en/hooks"})}}return o.length>0&&Object.keys(n).length===0&&delete r.hooks,o}function wul(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of xul){if(!(o in r))continue;if(!Array.isArray(r[o])){let u=r[o];delete r[o],n.push({file:e,path:o,message:`"${o}" must be an array; received ${QCe(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,jfo.execFile)(t,e,{encoding:"utf-8",timeout:Pul},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function Mul(){return(async()=>{if(process.platform==="darwin"){let t=Dul(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,Hfo.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await D6e(Rul,[...kul,r]);return{stdout:o,label:n,ok:s===0&&!!o}}))).find(r=>r.ok);return{plistStdouts:e?[{stdout:e.stdout,label:e.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let t=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`,[e,r]=await Promise.all([D6e(t,["query",pqr,"/v",LCe]),D6e(t,["query",hqr,"/v",LCe])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(qfo()){let[t,e]=await Promise.all([D6e(_oo,["query",pqr,"/v",LCe]),D6e(_oo,["query",hqr,"/v",LCe])]);return{plistStdouts:null,hklmStdout:t.code===0?t.stdout:null,hkcuStdout:e.code===0?e.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function Oul(){return Nul}function Lul(){Wkt||(Wkt=(async()=>{let t=Date.now(),e=Oul()??Mul(),{mdm:r,hkcu:n,wslInherits:o}=qul(await e);Gfo=r,$fo=n,Vfo=o;let s=Date.now()-t;if(hu(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){hu(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{oqr("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function Bul(){Wkt||Lul(),await Wkt}function Ful(){return Gfo??ZW}function Uul(){return $fo??ZW}function Qul(){return Vfo}function Z7r(t,e){let r=sz(BPt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=Sbe(r,e),o=bbe().safeParse(r);if(!o.success){let s=UUe(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function Eoo(t,e="Settings"){let r=t.split(/\r?\n/),n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`^\\s+${n}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let s of r){let c=s.match(o);if(c&&c[1])return c[1].trimEnd()}return null}function qul(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=Z7r(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:ZW,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=Eoo(t.hklmStdout);c&&(r=Z7r(c,`Registry: ${pqr}\\${LCe}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:ZW,o=qfo(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||Hul(),!s))return{mdm:n,hkcu:ZW,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:ZW,wslInherits:s}}if(jul(s))return{mdm:n,hkcu:ZW,wslInherits:s};if(t.hkcuStdout){let c=Eoo(t.hkcuStdout);if(c){let l=Z7r(c,`Registry: ${hqr}\\${LCe}`);if(!o||l.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:u,...d}=l.settings;return{mdm:n,hkcu:{settings:d,errors:l.errors},wslInherits:s}}if(l.errors.length>0)return{mdm:n,hkcu:{settings:{},errors:l.errors},wslInherits:s}}}return{mdm:n,hkcu:ZW,wslInherits:s}}function jul(t){return t&&Coo(Vkt)?!0:Coo(EUe())}function voo(t){let e=sz(BPt(LPt(t),!1));if(!e||typeof e!="object")return!1;Sbe(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function Hul(){function t(e){try{let r=BPt(LPt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,Woe.join)(Vkt,"managed-settings.json")))return!0;try{let e=(0,Woe.join)(Vkt,"managed-settings.d");for(let r of ox().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,Woe.join)(e,r.name)))return!0}catch{}return!1}function Coo(t){try{if(voo((0,Woe.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,Woe.join)(t,"managed-settings.d"),r=ox().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(voo((0,Woe.join)(e,n.name)))return!0}catch{}}catch{}return!1}function Gul(t,e,r){(r!==void 0&&!sPt(t[e],r)||r===void 0&&!(e in t))&&Qqr(t,e,r)}function $ul(t){return function(e,r,n){for(var o=-1,s=Object(e),c=n(e),l=c.length;l--;){var u=c[t?l:++o];if(r(s[u],u,s)===!1)break}return e}}function Yul(t){return Abe(t)&&Hqr(t)}function rdl(t){if(!Abe(t)||CUe(t)!=Jul)return!1;var e=eao(t);if(e===null)return!0;var r=edl.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Wfo.call(r)==tdl}function idl(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function odl(t){return hJc(t,Jso(t))}function adl(t,e,r,n,o,s,c){var l=gqr(t,r),u=gqr(e,r),d=c.get(u);if(d){mqr(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=oz(u),g=!m&&qqr(u),A=!m&&!g&&Yso(u);f=u,m||g||A?oz(l)?f=l:Kul(l)?f=kZc(l):g?(h=!1,f=Xso(u,!0)):A?(h=!1,f=FZc(u,!0)):f=[]:ndl(u)||Z6e(u)?(f=l,Z6e(l)?f=sdl(l):(!N9(l)||Rqr(l))&&(f=jZc(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),mqr(t,r,f)}function zfo(t,e,r,n,o){t!==e&&zul(e,function(s,c){if(o||(o=new aJc),N9(s))cdl(t,e,c,r,zfo,n,o);else{var l=n?n(gqr(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),mqr(t,c,l)}},Jso)}function udl(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function fdl(t,e,r){return e=boo(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=boo(n.length-e,0),c=Array(s);++o0){if(++e>=Adl)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function bdl(t,e){return Kfo(Yfo(t,e,rao),t+"")}function Tdl(t,e,r){if(!N9(r))return!1;var n=typeof e;return(n=="number"?Hqr(r)&&uPt(e,r.length):n=="string"&&e in r)?sPt(r[e],t):!1}function xdl(t){return Sdl(function(e,r){var n=-1,o=r.length,s=o>1?r[o-1]:void 0,c=o>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(o--,s):void 0,c&&Idl(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?Jfo(l,e-1,r,n,o):DZc(o,l):n||(o[o.length]=l)}return o}function Udl(t){var e=t==null?0:t.length;return e?Fdl(t,1):[]}function qdl(t){return Kfo(Yfo(t,void 0,Qdl),t+"")}function Vdl(){return void 0??(0,Zfo.join)(mbe(),Gdl)}function Wdl(){try{let t=LPt(Vdl()),e=CM(mfo(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function zdl(){if(!void 0&&$dl!==!0)return null;if(eQr)return eQr;let t=Wdl();return t?(eQr=t,zqr(),t):null}function dGr(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),tul.filter(r=>e.has(r))}function Ydl(){return(0,Vy.join)(EUe(),"managed-settings.json")}function Xfo(t){if(FPt()==="wsl"&&t.wslInherits?.()){let e=tQr(Vkt);if(e.settings)return e;let r=tQr(EUe());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return tQr(EUe())}function tQr(t){let e=[],r={},n=!1,{settings:o,errors:s}=zkt((0,Vy.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=tz(r,o,rz),n=!0);let c=(0,Vy.join)(t,"managed-settings.d");try{let d=ox().readdirSync(c).filter(f=>(f.isFile()||f.isSymbolicLink())&&f.name.endsWith(".json")&&!f.name.startsWith(".")).map(f=>f.name).sort();for(let f of d){let{settings:h,errors:m}=zkt((0,Vy.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=tz(r,h,rz),n=!0)}}catch(d){let f=ix(d);f!=="ENOENT"&&f!=="ENOTDIR"&&hu(`managed-settings.d read failed: ${d}`,{level:"error"})}let{wslInheritsWindowsSettings:l,...u}=r;return{settings:n&&Object.keys(u).length>0?r:null,errors:e}}function Kdl(t,e){SUe(t)?hu(`Broken symlink or missing file encountered for settings.json at path: ${e}`):hu(`settings file read failed at ${e}: ${t}`,{level:"error"})}function zkt(t,e){let r=TXc(t);if(r)return{settings:r.settings?sz(r.settings):null,errors:r.errors};let n=Jdl(t,e);return IXc(t,n),{settings:n.settings?sz(n.settings):null,errors:n.errors}}function epo(t){if(!t.mdm)return{settings:null,errors:[]};let e=t.mdm();return{settings:Object.keys(e.settings).length>0?e.settings:null,errors:e.errors}}function tpo(t){let e=t?.remote?t.remote():zdl();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=sz(e),n=Sbe(r,"remote managed settings"),o=bbe().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...UUe(o.error,"remote managed settings")]}}function rpo(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=sz(e),n=Sbe(r,"parent managed settings"),o=bbe().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...UUe(o.error,"parent managed settings")]}}function npo(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=sz(e),n=Sbe(r,"SDK inline settings"),o=bbe().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...UUe(o.error,"SDK inline settings")]}}function Jdl(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=sao(ox(),t);r=LPt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=sz(BPt(r,!1)),o=Sbe(n,t),s=bbe().safeParse(n);if(!s.success){let c=UUe(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return Kdl(r,t),{settings:null,errors:[]}}}function Too(t,e){switch(t){case"userSettings":return(0,Vy.resolve)(mbe());case"policySettings":case"projectSettings":case"localSettings":return(0,Vy.resolve)(e.cwd);case"flagSettings":return e.flagPath?(0,Vy.dirname)((0,Vy.resolve)(e.flagPath)):(0,Vy.resolve)(e.cwd)}}function Zdl(t){return t.coworkPlugins||bE(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function Ykt(t,e){switch(t){case"userSettings":return(0,Vy.join)(Too(t,e),Zdl(e));case"projectSettings":case"localSettings":return(0,Vy.join)(Too(t,e),Xdl(t));case"policySettings":return Ydl();case"flagSettings":return e.flagPath}}function Xdl(t){switch(t){case"projectSettings":return(0,Vy.join)(".claude","settings.json");case"localSettings":return(0,Vy.join)(".claude","settings.local.json")}}function ipo(t,e){let r=CXc(t);if(r!==void 0)return r;let n=ifl(t,e);return bXc(t,n),n}function efl(t){return!t||t.parentSettingsBehavior==="merge"}function tfl(t,e){let r={};t.allowManagedHooksOnly===!0&&(r.allowManagedHooksOnly=!0),t.allowManagedMcpServersOnly===!0&&(r.allowManagedMcpServersOnly=!0),t.allowManagedPermissionRulesOnly===!0&&(r.allowManagedPermissionRulesOnly=!0);let n=t.strictPluginOnlyCustomization;if((n===!0||Array.isArray(n)&&n.length>0)&&(r.strictPluginOnlyCustomization=n),t.deniedMcpServers&&(r.deniedMcpServers=t.deniedMcpServers),e.forceLoginOrgUUID===void 0&&t.forceLoginOrgUUID&&(r.forceLoginOrgUUID=t.forceLoginOrgUUID),e.allowedMcpServers===void 0&&t.allowedMcpServers&&(r.allowedMcpServers=t.allowedMcpServers),t.permissions){let o=X7r(t.permissions,["deny","ask"]);if(t.permissions.disableBypassPermissionsMode==="disable"&&(o.disableBypassPermissionsMode="disable"),e.allowManagedPermissionRulesOnly!==!0){let{allow:s,additionalDirectories:c}=t.permissions;s&&e.sandbox?.network?.allowManagedDomainsOnly!==!0&&(o.allow=s),c&&(o.additionalDirectories=c)}Object.keys(o).length>0&&(r.permissions=o)}if(t.sandbox){let{network:o,filesystem:s}=t.sandbox,c={};if(t.sandbox.enabled===!0&&(c.enabled=!0),t.sandbox.failIfUnavailable===!0&&(c.failIfUnavailable=!0),t.sandbox.allowUnsandboxedCommands===!1&&(c.allowUnsandboxedCommands=!1),t.sandbox.autoAllowBashIfSandboxed===!1&&(c.autoAllowBashIfSandboxed=!1),o){let l=X7r(o,["deniedDomains"]);o.allowManagedDomainsOnly===!0&&(l.allowManagedDomainsOnly=!0),e.sandbox?.network?.allowManagedDomainsOnly!==!0&&o.allowedDomains&&(l.allowedDomains=o.allowedDomains),Object.keys(l).length>0&&(c.network=l)}if(s){let l=X7r(s,["denyRead","denyWrite"]);s.allowManagedReadPathsOnly===!0&&(l.allowManagedReadPathsOnly=!0),e.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&s.allowRead&&(l.allowRead=s.allowRead),Object.keys(l).length>0&&(c.filesystem=l)}Object.keys(c).length>0&&(r.sandbox=c)}return r}function rfl(t){if(t.helper?.())return"helper";if(tpo(t).settings)return"remote";if(epo(t).settings)return FPt()==="macos"?"plist":"hklm";if((t.file?.()??Xfo(t)).settings)return"file";if(rpo(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function nfl(t){let e=[],{settings:r,errors:n}=tpo(t);e.push(...n);let{settings:o,errors:s}=epo(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??Xfo(t);e.push(...l);let{settings:u,errors:d}=rpo(t);e.push(...d);let f=[r,o,c].filter(A=>A!==null),h=f[0]??null,m={allowManagedPermissionRulesOnly:f.some(A=>A.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:f.find(A=>A.forceLoginOrgUUID!==void 0)?.forceLoginOrgUUID,allowedMcpServers:f.find(A=>A.allowedMcpServers!==void 0)?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:f.some(A=>A.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:f.some(A=>A.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},g=u&&efl(h)?tfl(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function opo(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=nfl(t);if(!r&&!n){let s=t.hkcu?.();return s&&Object.keys(s.settings).length>0?{settings:s.settings,errors:[...o,...s.errors]}:{settings:null,errors:[...o,...s?.errors??[]]}}return{settings:tz({},n??{},r??{},rz),errors:o}}function ifl(t,e){if(t==="policySettings")return opo(e).settings;let r=Ykt(t,e),{settings:n}=r?zkt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=npo(e);if(o)return tz(n||{},o,rz)}return n}function ofl(t,e){return Uao([...t,...e])}function rz(t,e){if(Array.isArray(t)&&Array.isArray(e))return ofl(t,e)}function sfl(t){if(rQr)return{settings:{},errors:[]};let e=Date.now();oqr("info","settings_load_started"),rQr=!0;try{let r=wXc(),n={};r&&(n=tz(n,r,rz));let o=[],s=new Set,c=new Set;for(let l of dGr(t)){if(l==="policySettings"){let{settings:d,errors:f}=opo(t);d&&(n=tz(n,d,rz));for(let h of f){let m=`${h.file}:${h.path}:${h.message}`;s.has(m)||(s.add(m),o.push(h))}continue}let u=Ykt(l,t);if(u){let d=(0,Vy.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=zkt(u,l==="flagSettings"?t.flagExpectedContent:void 0);for(let m of h){let g=`${m.file}:${m.path}:${m.message}`;s.has(g)||(s.add(g),o.push(m))}f&&(n=tz(n,f,rz))}}if(l==="flagSettings"){let{settings:d,errors:f}=npo(t);for(let h of f){let m=`${h.file}:${h.path}:${h.message}`;s.has(m)||(s.add(m),o.push(h))}d&&(n=tz(n,d,rz))}}return oqr("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{rQr=!1}}function afl(t){let e=EXc();if(e!==null)return e;let r=sfl(t);return vXc(r),r}function cfl(t){let{settings:e}=afl(t);return e||{}}function lfl(t){zqr();let e=[];for(let r of dGr(t)){let n=ipo(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:cfl(t),sources:e}}function ufl(t,e){let r=dGr(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(ipo(o,e)?.[t]!==void 0)return o}return null}function mfl(t){let e=t.effective.permissions?.defaultMode;if(!e||!pfl.has(e))return t.effective;for(let r=t.sources.length-1;r>=0;r--){let n=t.sources[r];if(n.settings.permissions?.defaultMode!==void 0){if(hfl.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function gfl(t={}){await Bul();let e={cwd:(0,pfo.resolve)(t.cwd??ox().cwd()),allowedSources:(t.settingSources??ffl).map(r=>dfl[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:Ful,hkcu:Uul,wslInherits:Qul,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=lfl(e),o=rfl(e)??void 0,s=n.map(({source:l,settings:u})=>({source:Ioo[l],settings:u,path:l==="policySettings"?void 0:Ykt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=ufl(l,e);u&&(c[l]={source:Ioo[u],path:u==="policySettings"?void 0:Ykt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{zqr()}}async function Afl(t){return gfl(t)}async function yfl(t,e){try{await(0,SE.copyFile)(t,e)}catch(r){if(!SUe(r))throw r}}async function _fl(t,e){if(!t)return;let r=t;try{let n=CM(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=eg(n))}catch{}await(0,SE.writeFile)(e,r,{mode:384})}function Efl(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=$tl(Gtl);return new Promise(e=>{(0,Yoo.execFile)("security",["find-generic-password","-a",Wtl(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function spo(t,e,r,n,o=6e4){if(!Uh(e))return;let s=Zk(r),c=await joe(t.load({projectKey:s,sessionId:e}),o,`SessionStore.load() timed out after ${o}ms for session ${e}`);if(!c||c.length===0)return;let l=(0,Cc.join)((0,qCe.tmpdir)(),`claude-resume-${(0,nPt.randomUUID)()}`);try{let u=(0,Cc.join)(l,"projects",s);await(0,SE.mkdir)(u,{recursive:!0});let d=(0,Cc.join)(u,`${e}.jsonl`);await DQr(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,Cc.join)((0,qCe.homedir)(),".claude"),m;try{m=await(0,SE.readFile)((0,Cc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!SUe(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await Efl()??m),await _fl(m,(0,Cc.join)(l,".credentials.json")),await yfl((0,Cc.join)(f??(0,qCe.homedir)(),".claude.json"),(0,Cc.join)(l,".claude.json")),t.listSubkeys){let g=(0,Cc.join)(u,e),A=await joe(t.listSubkeys({projectKey:s,sessionId:e}),o,`SessionStore.listSubkeys() timed out after ${o}ms for session ${e}`);for(let y of A){let _=(0,Cc.resolve)(g,y+".jsonl");if(!y||(0,Cc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!_.startsWith(g+Cc.sep)){hu(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let E=await joe(t.load({projectKey:s,sessionId:e,subpath:y}),o,`SessionStore.load() timed out after ${o}ms for session ${e} subpath ${y}`);if(!E||E.length===0)continue;let v=[],S=[];for(let T of E)_qr(T)?v.push(T):S.push(T);if(S.length>0&&(await(0,SE.mkdir)((0,Cc.dirname)(_),{recursive:!0}),await DQr(_,S)),v.length>0){let T=v.at(-1),w=(0,Cc.resolve)(g,y+".meta.json");await(0,SE.mkdir)((0,Cc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,SE.writeFile)(w,eg(x),{mode:384})}}}return l}catch(u){throw await Kkt(l),u}}function Aqr(t,e,r,n){let{systemPrompt:o,settings:s,managedSettings:c,settingSources:l,sandbox:u,...d}=t??{},f,h,m;o===void 0?f="":typeof o=="string"||Array.isArray(o)?f=o:o.type==="preset"&&(h=o.append,m=o.excludeDynamicSections),process.env.CLAUDE_AGENT_SDK_VERSION="0.3.159";let{abortController:g=iQr(),additionalDirectories:A=[],agent:y,agents:_,allowedTools:E=[],betas:v,canUseTool:S,continue:T,cwd:w,debug:R,debugFile:x,disallowedTools:k=[],tools:D,env:N,executable:O=oso()?"bun":"node",executableArgs:B=[],extraArgs:q={},fallbackModel:M,enableFileCheckpointing:L,toolConfig:U,forkSession:j,hooks:Q,includeHookEvents:Y,includePartialMessages:W,forwardSubagentText:V,onElicitation:z,persistSession:ie,sessionStore:H,sessionStoreFlush:re,thinking:le,effort:Le,maxThinkingTokens:me,maxTurns:Oe,maxBudgetUsd:Te,taskBudget:te,mcpServers:ee,model:K,outputFormat:he,permissionMode:X="default",allowDangerouslySkipPermissions:de=!1,permissionPromptToolName:Be,plugins:ne,getOAuthToken:ue,getHostAuthToken:Ne,workload:xe,resume:Fe,resumeSessionAt:tt,sessionId:st,skills:vt,stderr:Pt,strictMcpConfig:Ht}=d;if(H&&ie===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(H&&T&&!Fe&&!H.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(H&&L)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");H&&d.spawnClaudeCodeProcess&&hu("sessionStore with custom spawnClaudeCodeProcess: ensure the subprocess CLAUDE_CONFIG_DIR matches the parent (same path, same separators) or transcript_mirror frames will be dropped.",{level:"warn"});let F=d.pathToClaudeCodeExecutable;if(!F){let je=(0,Zoo.fileURLToPath)(importMetaUrlShim),J=(0,Koo.createRequire)(je),ae=xel(Ce=>J.resolve(Ce));if(!ae)throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`);F=ae}let se=he?.type==="json_schema"?he.schema:void 0,be=N?{...N}:{...process.env};be.CLAUDE_CODE_ENTRYPOINT||(be.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),be.CLAUDE_AGENT_SDK_VERSION||(be.CLAUDE_AGENT_SDK_VERSION="0.3.159"),L&&(be.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true"),ue&&(be.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ne&&(be.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),U?.askUserQuestion?.previewFormat&&(be.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=U.askUserQuestion.previewFormat);let Ue={};if(_io.propagation.inject(_io.context.active(),Ue),"traceparent"in Ue)for(let je of["TRACEPARENT","TRACESTATE"])je in(N??{})||delete be[je];for(let[je,J]of Object.entries(Ue)){let ae=je.toUpperCase();ae in(N??{})||(be[ae]=J)}let Qe={},ge=new Map;if(ee)for(let[je,J]of Object.entries(ee))J.type==="sdk"&&J.instance?ge.set(je,J.instance):Qe[je]=J;let Z;if(le)switch(le.type){case"adaptive":Z={type:"adaptive",display:le.display};break;case"enabled":Z={type:"enabled",budgetTokens:le.budgetTokens,display:le.display};break;case"disabled":Z={type:"disabled"};break}else me!==void 0&&(Z=me===0?{type:"disabled"}:{type:"enabled",budgetTokens:me});r&&(be.CLAUDE_CONFIG_DIR=r,process.platform==="win32"&&(be.CLAUDE_SECURESTORAGE_CONFIG_DIR=N?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??N?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??""));let ve=new xQr({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:O,executableArgs:B,extraArgs:xe?{...q,workload:xe}:q,pathToClaudeCodeExecutable:F,env:be,forkSession:j,stderr:Pt,thinkingConfig:Z,effort:Le,maxTurns:Oe,maxBudgetUsd:Te,taskBudget:te,model:K,fallbackModel:M,jsonSchema:se,permissionMode:X,allowDangerouslySkipPermissions:de,permissionPromptToolName:Be,continueConversation:H?void 0:T,resume:Fe,resumeSessionAt:tt,sessionId:st,settings:typeof s=="object"?eg(s):s,managedSettings:c?eg(c):void 0,settingSources:l,skills:vt,allowedTools:E,disallowedTools:k,tools:D,mcpServers:Qe,strictMcpConfig:Ht,canUseTool:!!S,hooks:!!Q,includeHookEvents:Y,includePartialMessages:W,persistSession:ie,sessionMirror:!!H,plugins:ne,sandbox:u,spawnClaudeCodeProcess:d.spawnClaudeCodeProcess,deferSpawn:n}),Ge={systemPrompt:f,appendSystemPrompt:h,planModeInstructions:d.planModeInstructions,appendSubagentSystemPrompt:d.appendSubagentSystemPrompt,toolAliases:d.toolAliases,excludeDynamicSections:m,agents:_,title:d.title,skills:vt,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:V},qe=new RQr(ve,e,S,Q,g,ge,se,Ge,z,ue,Ne);if(H){let je=a(()=>(0,Cc.join)(be.CLAUDE_CONFIG_DIR??(0,Cc.join)((0,qCe.homedir)(),".claude"),"projects"),"S6"),J=re==="eager",ae=new kQr(async(Ce,Re)=>{let $e=koo(Ce,je());$e?await H.append($e,Re):hu(`[SessionStore] dropping mirror frame: filePath ${Ce} is not under ${je()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(Ce,Re)=>{let $e=koo(Ce,je());$e&&qe.reportMirrorError($e,Re.message)},J?0:Kqr,J?0:Jqr);qe.setTranscriptMirrorBatcher(ae)}return{queryInstance:qe,transport:ve,abortController:g,processEnv:be}}function yqr(t,e,r,n){typeof r=="string"?e.write(eg({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:r}]},parent_tool_use_id:null})+` +`):t.streamInput(r).catch(o=>n.abort(o))}async function Kkt(t){for(let e=0;;e++)try{return await(0,SE.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!vfl.has(ix(r)??""))return;await eso((e+1)*100)}}function Cfl(t,e){t.waitForExit().catch(()=>{}).finally(()=>Kkt(e))}function bfl({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=Aqr({...e},typeof t=="string",void 0,!0),d=(0,Cc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await joe(f.listSessions(Zk(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return spo(f,m,d,e.env,e.loadTimeoutMs)})().then(g=>{if(g){c.updateResume(m);let A={CLAUDE_CONFIG_DIR:g};if(process.platform==="win32"){let y=e.env?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??e.env?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??"";A.CLAUDE_SECURESTORAGE_CONFIG_DIR=y,u.CLAUDE_SECURESTORAGE_CONFIG_DIR=y}c.updateEnv(A),u.CLAUDE_CONFIG_DIR=g,s.addCleanupCallback(()=>Cfl(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=bUe(g);c.spawnAbort(A),s.setError(A)}),yqr(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=Aqr(e,typeof t=="string");return yqr(r,n,t,o),r}async function Sfl({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,Cc.resolve)(t.cwd??".");if(!n){if(!t.sessionStore.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");let u=t.loadTimeoutMs??6e4;n=(await joe(t.sessionStore.listSessions(Zk(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await spo(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=Aqr(r&&n&&n!==t?.resume?{...t,resume:n}:t,!1,r);o=u.queryInstance;let{transport:d,abortController:f}=u;s=d;let h=u.queryInstance;if(r){let g=r;h.addCleanupCallback(()=>{c=d.waitForExit().catch(()=>{}).then(()=>Kkt(g))})}await joe(h.initializationResult(),e,`Subprocess initialization did not complete within ${e}ms \u2014 check authentication and network connectivity`);let m=!1;return{query(g){if(m)throw Error("WarmQuery.query() can only be called once");m=!0;try{yqr(h,d,g,f)}catch(A){throw h.close(),A}return typeof g=="string"&&h.setIsSingleUserTurn(!0),h},close:l,async[Symbol.asyncDispose](){m=!0,h.close(),await c}}}catch(l){if(o?.close(),r&&!c){let u=s;c=(u?u.waitForExit().catch(()=>{}):Promise.resolve()).then(()=>Kkt(r))}throw await c,l}}async function Tfl(t,e){return e?.sessionStore?Ffl(e.sessionStore,t,e):utl(t,e)}async function Ifl(t){return t?.sessionStore?Lfl(t.sessionStore,t):Atl(t)}async function xfl(t,e){return e?.sessionStore?Ufl(e.sessionStore,t,e):ytl(t,e)}async function wfl(t,e,r){return r?.sessionStore?Qfl(r.sessionStore,t,e,r.dir):_tl(t,e,r)}async function Rfl(t,e,r){return r?.sessionStore?qfl(r.sessionStore,t,e,r.dir):Etl(t,e,r)}async function kfl(t,e){if(!Uh(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=Zk(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return vtl(t,e)}async function Pfl(t,e){return e?.sessionStore?jfl(e.sessionStore,t,e):xtl(t,e)}async function Dfl(t,e,r){if(!Uh(t))throw Error(`Invalid sessionId: ${t}`);let n=await pPt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=Zk(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:Kqr;if(await xoo(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,Cc.join)(c,"subagents");for(let u of await Nfl(l)){let d=(0,Cc.relative)(c,u).split(Cc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await xoo(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=CM(await(0,SE.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!SUe(m))throw m}}}async function xoo(t,e,r,n){let o=(0,Joo.createInterface)({input:(0,iPt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push(CM(l)),c+=l.length,(s.length>=n||c>=Jqr)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function Nfl(t){let e=[];async function r(n){let o;try{o=await(0,SE.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,Cc.join)(n,s.name);s.isDirectory()?await r(c):s.isFile()&&s.name.endsWith(".jsonl")&&e.push(c)}}return a(r,"J"),await r(t),e}async function Mfl(t,e){return e?.sessionStore?Hfl(e.sessionStore,t,e.dir):Ntl(t,e)}async function Ofl(t,e,r){return r?.sessionStore?Gfl(r.sessionStore,t,e,r):Mtl(t,e,r)}function apo(t){let e=(0,Cc.resolve)(t??"."),r;try{r=(0,iPt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function Zk(t){return IUe(apo(t))}function cpo(t){return t.map(e=>eg(e)).join(` `)+` -`}function Ioo(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function yqr(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function Mfl(t,e){let r=opo(e.dir),n=IUe(r),o=e.offset??0,s=e.limit;if(t.listSessionSummaries){let u=await t.listSessionSummaries(n),d=t.listSessions?new Map((await t.listSessions(n)).map(g=>[g.sessionId,g])):void 0,f=[];for(let g of u){let A=d?.get(g.sessionId);if(d&&!A)continue;let y=A!==void 0&&g.mtimeA.sessionId));for(let[A,y]of d)g.has(A)||f.push({sessionId:A,mtime:y.mtime})}else hu("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=Ioo(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await xoo(t,m,e.dir,r),A=new Map(g.map(y=>[y.sessionId,y]));for(let y of h)y.info===void 0&&(y.info=A.get(y.sessionId)??null)}return h.flatMap(g=>g.info?[g.info]:[])}if(!t.listSessions)throw Error("sessionStore.listSessions is not implemented -- cannot list sessions. Provide a store with a listSessions() method.");let c=(await t.listSessions(n)).slice().sort((u,d)=>d.mtime-u.mtime),l=Ioo(c,s,o);return xoo(t,l,e.dir,r)}async function xoo(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await cpo(t,o.sessionId,r);if(!s)return null;let c=pPt(o.sessionId,apo(s,o.mtime),n);return c?{...c,lastModified:o.mtime}:null}))).flatMap((o,s)=>{let c=e[s];return o.status==="fulfilled"?o.value?[o.value]:[]:[{sessionId:c.sessionId,summary:"",lastModified:c.mtime}]})}function apo(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,k9).toString("utf-8"),s=n>k9?r.subarray(n-k9).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function Ofl(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` -`)+1);try{let n=CM(r);if(typeof n=="object"&&n!==null&&"timestamp"in n&&typeof n.timestamp=="string"){let o=Date.parse(n.timestamp);if(!Number.isNaN(o))return o}}catch{}return Date.now()}async function cpo(t,e,r){let n=Zk(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:spo(o)}async function Lfl(t,e,r){if(!Uh(e))return[];let n=Zk(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:atl(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function Bfl(t,e,r){if(!Uh(e))return;let n=await cpo(t,e,r.dir);if(!n)return;let o=apo(n,Ofl(n));return pPt(e,o)??void 0}async function Ffl(t,e,r,n){if(!Uh(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=Zk(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,rPt.randomUUID)(),timestamp:new Date().toISOString()}])}async function Ufl(t,e,r,n){if(!Uh(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=G6e(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=Zk(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,rPt.randomUUID)(),timestamp:new Date().toISOString()}])}async function Qfl(t,e,r){if(!Uh(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!Uh(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=Zk(r.dir),o=await t.load({projectKey:n,sessionId:e});if(!o||o.length===0)throw Error(`Session ${e} not found`);let{entries:s,forkedSessionId:c}=xtl(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function qfl(t,e,r){if(!Uh(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=Zk(r),o=await t.listSubkeys({projectKey:n,sessionId:e}),s=new Set;for(let c of o){if(!c.startsWith("subagents/"))continue;let l=c.split("/").at(-1);l.startsWith("agent-")&&s.add(l.slice(6))}return[...s]}async function jfl(t,e,r,n){if(!Uh(e))return[];if(!r)return[];let o=Zk(n.dir),s=`subagents/agent-${r}`;if(t.listSubkeys){let f=await t.listSubkeys({projectKey:o,sessionId:e}),h=`agent-${r}`,m=f.find(g=>g.startsWith("subagents/")&&g.split("/").at(-1)===h);if(!m)return[];s=m}let c=await t.load({projectKey:o,sessionId:e,subpath:s});if(!c||c.length===0)return[];let l=c.findLast(yqr),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!yqr(f));return d.length===0?[]:Nao(Buffer.from(spo(d)),{limit:n.limit,offset:n.offset},u)}function woo(t,e){let r=(0,Cc.relative)(e,t),n=r.split(Cc.sep);if(n[0]===".."||(0,Cc.isAbsolute)(r)||n.length<2)return null;let o=n[0],s=n[1];if(n.length===2&&s.endsWith(".jsonl"))return{projectKey:o,sessionId:s.replace(/\.jsonl$/,"")};if(n.length>=4){let c=n.slice(2),l=c.length-1;return c[l]=c.at(-1).replace(/\.jsonl$/,""),{projectKey:o,sessionId:s,subpath:c.join("/")}}return null}var Roo,Woo,rPt,nPt,SE,zoo,qCe,Cc,Yoo,Koo,Joo,Xoo,eso,tso,aso,cso,Uso,AQr,Qso,yA,qso,SB,EQr,tao,dkt,IE,tse,bo,Xg,nao,TB,dao,hao,kQr,mao,AM,VCe,gao,Aao,yao,_ao,ybe,_be,DQr,IB,$oe,U6e,Akt,tUe,ykt,Mao,Oao,dfo,Voe,ffo,gf,oGr,Qkt,_fo,Efo,aGr,cqr,Ffo,Qfo,qfo,Vy,Kfo,uVc,dVc,rQr,fVc,pVc,mVc,gVc,_qr,jt,AVc,RB,_Vc,EVc,vVc,pf,hf,CVc,bVc,SVc,koo,TVc,lbe,IVc,Eqr,xVc,ube,wVc,RVc,Poo,Kkt,kVc,Doo,PVc,Noo,DVc,Jkt,Moo,vqr,Cqr,Ooo,bqr,Loo,Boo,NVc,Foo,MVc,OVc,LVc,BVc,FVc,UVc,QVc,qVc,jVc,HVc,GVc,$Vc,VVc,WVc,zVc,YVc,KVc,JVc,kRt,Cno,Fs,Sc,cz,Zkt,ZVc,Uoo,Qoo,PRt,XVc,vM,eWc,tWc,qoo,rWc,Xkt,ePt,Sqr,tPt,Tqr,nWc,joo,iWc,oWc,sWc,aWc,cWc,lWc,uWc,dWc,fWc,pWc,hWc,mWc,gWc,AWc,yWc,Iqr,_Wc,EWc,vWc,CWc,Hoo,Goo,bWc,SWc,TWc,IWc,xWc,$oo,wWc,RWc,kWc,PWc,DWc,NWc,MWc,OWc,LWc,BWc,FWc,UWc,QWc,qWc,jWc,HWc,Voo,GWc,$Wc,VWc,WWc,iPt,YWc,KWc,JWc,ZWc,XWc,iQr,e1,izc,iso,ozc,szc,dbe,azc,nz,oso,czc,lzc,f6e,dzc,fzc,pzc,mzc,gzc,Azc,bno,CUe,N9,Ezc,vzc,Czc,bzc,wqr,Tzc,S7r,Sno,xzc,wzc,Rzc,Pzc,Dzc,Nzc,Mzc,Ozc,Lzc,Bzc,Fzc,Qzc,jzc,Rqr,Gzc,V6e,Vzc,zzc,Yzc,Kzc,Jzc,Xzc,eYc,tYc,nYc,iYc,sYc,Tno,cYc,oPt,sPt,dYc,fYc,hYc,gYc,yYc,EYc,aPt,vYc,sso,bYc,TYc,cPt,wYc,kYc,DYc,MYc,kqr,OYc,Wy,mbe,Afm,lso,oQr,Ni,AC,nx,jCe,DRt,NRt,MRt,ORt,LRt,BRt,FRt,URt,QRt,LYc,BYc,sQr,Ino,UYc,uso,QYc,ZW,qYc,HYc,wno,Rno,kno,Dqr,WYc,YYc,KYc,pso,qRt,JYc,ZYc,Mqr,XYc,Pno,T7r,eKc,mu,cQr,pu,Dno,Nno,jRt,Ono,nKc,Lno,Uoe,yso,iKc,oKc,sKc,Lqr,aKc,Eso,ex,tx,Woe,p6e,zoe,lQr,M6e,HRt,aRt,GRt,uQr,Yoe,TE,Sso,Tso,Bqr,Fno,vKc,CKc,dQr,Iso,bKc,SKc,Ld,xso,_r,Uno,wKc,Yn,$Rt,j6e,VRt,WRt,zRt,YRt,z6e,KRt,JRt,HCe,ZRt,XRt,Pso,PKc,PCe,DKc,NKc,Mso,Qk,$W,SCe,h6e,cRt,m6e,g6e,lRt,A6e,S9,y6e,uRt,dRt,Ooe,fRt,pRt,_6e,I7r,qno,hRt,x7r,w7r,R7r,jno,Hno,pQr,ekt,MKc,OKc,E6e,TCe,Loe,Yg,XS,XI,R9,VW,v6e,$no,hQr,tkt,Wno,BKc,Koe,rkt,nkt,GCe,ikt,Y6e,okt,K6e,t1,skt,qk,WW,ICe,C6e,mRt,b6e,S6e,gRt,T6e,T9,I6e,ARt,yRt,Boe,_Rt,ERt,x6e,k7r,Kno,P7r,D7r,N7r,M7r,Jno,Zno,mQr,akt,J6e,eio,UKc,ckt,gQr,Fqr,wRt,Bso,QKc,qKc,Hp,$Ce,HKc,GKc,yQr,VKc,Hoe,xCe,YKc,JKc,XKc,tJc,rJc,iJc,oJc,sJc,ukt,Uqr,cJc,lJc,Hso,fJc,hJc,Abe,gJc,tio,Gso,yJc,_Jc,EJc,Z6e,vJc,iz,O6e,bJc,$so,rio,SJc,nio,TJc,IJc,Qqr,xJc,wJc,lPt,kJc,qqr,DJc,NJc,MJc,OJc,LJc,BJc,FJc,UJc,QJc,qJc,jJc,HJc,GJc,$Jc,VJc,WJc,zJc,YJc,KJc,JJc,ZJc,XJc,eZc,tZc,Md,nZc,oZc,L6e,Vso,H6e,sZc,O7r,aZc,_Qr,iio,cZc,Wso,lZc,uZc,fZc,pZc,zso,gZc,jqr,_Zc,EZc,vZc,bZc,Yso,B6e,Kso,oio,TZc,sio,aio,Jso,wZc,kZc,PZc,Zso,DZc,cio,MZc,LZc,lio,BZc,FZc,QZc,qZc,Hqr,HZc,GZc,VZc,WZc,YZc,KZc,JZc,ZZc,XZc,tXc,rXc,uio,dio,nXc,oXc,uPt,aXc,Gqr,uXc,fXc,hXc,gXc,eao,$qr,fkt,CXc,Vqr,TXc,wXc,kXc,PXc,DXc,yfm,NXc,_fm,MXc,Efm,OXc,vfm,LXc,Cfm,vQr,UXc,qXc,zXc,YXc,bfm,Sfm,tel,pio,hio,rel,nel,mio,CQr,sel,ael,bQr,cel,oao,sao,uel,del,vRt,L7r,w6e,B7r,SQr,uao,Tfm,hel,mf,CM,_el,pkt,gio,IQr,wCe,hkt,xel,xQr,wQr,Yqr,Kqr,Rel,RQr,Aio,F7r,Del,Lel,k9,Fel,X6e,jel,Hel,Gel,gkt,Vel,eUe,Wel,zel,ltl,Ctl,Mtl,Fao,Otl,Ltl,Btl,xfm,yio,Ftl,Qtl,jtl,Gtl,bc,_io,Dn,KW,yr,Wk,Vtl,rUe,Wtl,MQr,yC,io,Q6e,r1,Eio,vio,WCe,_kt,ei,Yk,Cio,Us,ztl,Ytl,Ktl,Jtl,Ztl,Xtl,erl,trl,rrl,j7r,nrl,irl,orl,srl,arl,crl,Uao,lrl,zCe,nUe,iUe,oUe,sUe,aUe,YCe,KCe,cUe,rz,xB,lUe,sz,sx,JCe,x9,OQr,ZCe,M9,BQr,uUe,dUe,FQr,XCe,ebe,tbe,rbe,Joe,yM,zk,O9,nbe,ibe,fUe,Ekt,vkt,obe,wfm,wr,Rfm,kfm,Pfm,Dfm,Nfm,Mfm,Ofm,Lfm,Bfm,Ffm,Ufm,Qfm,qfm,jfm,grl,Hfm,Gfm,$fm,Vfm,Wfm,zfm,Yfm,Kfm,Jfm,Zfm,Xfm,epm,tpm,rpm,npm,ipm,opm,spm,apm,jao,Hao,Gao,az,Ckt,Xs,Xqr,Wao,Irl,bkt,zao,Kao,Jao,UQr,Xao,ejr,wUe,njr,Skt,ijr,Tkt,ojr,yPt,sjr,_Pt,ajr,nco,ico,oco,sco,aco,cco,lco,Orl,uco,sbe,Lrl,Brl,Frl,dco,Url,Qrl,qrl,jrl,Hrl,pco,hco,mco,gco,Aco,cjr,yco,Grl,_co,Eco,vco,Tco,Ico,xco,wco,Rco,kco,Pco,Dco,Nco,Qh,Mco,ljr,ujr,Oco,Lco,Bco,Fco,Uco,Qco,qco,jco,Hco,RUe,Gco,$co,Vco,Wco,zco,Yco,Kco,Jco,Zco,Ikt,Xco,So,kUe,Wu,elo,tlo,rlo,nlo,ilo,olo,slo,alo,clo,llo,ulo,dlo,flo,plo,hlo,mlo,glo,Alo,ylo,_lo,vlo,Clo,Slo,Tlo,fjr,Ilo,pjr,hjr,xlo,wlo,Rlo,klo,Plo,xkt,Dlo,Nlo,Mlo,mjr,gjr,Ajr,Olo,Llo,EPt,Blo,Flo,Ulo,Qlo,qlo,jlo,yjr,Hlo,Glo,$lo,Vlo,Wlo,zlo,Ylo,Klo,_jr,Jlo,Zlo,Xlo,euo,tuo,Ejr,$rl,Wrl,Yrl,Jrl,Xrl,tnl,nnl,inl,onl,snl,cnl,unl,fnl,hnl,gnl,ynl,Enl,Cnl,Snl,Inl,wnl,knl,Dnl,Mnl,Lnl,Fnl,Qnl,jnl,Gnl,Vnl,znl,Knl,Znl,eil,ril,iil,oil,ail,lil,dil,pil,mil,nuo,iuo,mUe,P9,auo,kkt,yUe,Fil,Uil,Qil,G,nHr,iHr,oHr,sHr,aHr,Juo,Hil,DUe,Zuo,Xuo,edo,tdo,Qs,cHr,SPt,Bd,lHr,Pkt,D9,uHr,dHr,fHr,pHr,hHr,mHr,gHr,AHr,yHr,_Hr,EHr,vHr,CHr,bHr,SHr,THr,rdo,TPt,Ebe,IPt,xPt,IHr,ndo,ido,odo,sdo,ado,cdo,ldo,wHr,udo,RPt,RHr,ddo,fdo,pdo,PHr,hdo,mdo,_Ue,gdo,Ado,DHr,MHr,ydo,_do,vdo,OHr,Sdo,Tdo,xdo,LHr,wdo,kdo,Pdo,Ndo,PPt,Uol,qol,Fdo,Yol,Udo,Qdo,Kol,Qoe,DPt,Zg,qdo,jdo,cpm,Jol,Zol,FHr,ax,NUe,Xol,zy,Kk,Jk,Yy,NPt,Hdo,Fio,Gdo,esl,UHr,SRt,Qi,QHr,tsl,lpm,upm,qHr,rsl,jHr,nsl,MUe,cbe,$do,isl,osl,ssl,asl,csl,lsl,Vdo,usl,dsl,Wdo,HHr,fsl,psl,GHr,hsl,OUe,LUe,msl,BUe,MPt,gsl,Mkt,$Hr,VHr,WHr,dpm,zHr,YHr,KHr,Asl,zdo,Ydo,JHr,Kdo,FUe,vbe,Jdo,ysl,jQr,_sl,HQr,Esl,ZHr,vsl,GQr,Csl,bsl,Ssl,Tsl,Isl,xsl,wsl,Rsl,ksl,Psl,$Qr,Dsl,Nsl,VQr,XHr,eGr,tGr,Msl,Osl,Lsl,rGr,Bsl,Fsl,Usl,Qsl,qsl,Zdo,WQr,jsl,nGr,fpm,Hsl,Okt,Gsl,ppm,Lkt,$sl,Xdo,Vsl,Wsl,zsl,Ysl,Ksl,Jsl,Zsl,Bkt,Xsl,eal,tal,iGr,efo,ral,nal,ial,oal,sal,aal,cal,lal,ual,dal,fal,pal,hal,mal,gal,Aal,yal,_al,Fkt,Eal,val,Cal,zQr,Tal,Ial,xal,tfo,wal,hpm,mpm,gpm,Apm,ypm,_pm,mi,YQr,Ral,Uio,kal,Pal,nfo,Oal,Lal,Qal,$7r,pM,Hal,Ukt,qio,tcl,rcl,ccl,lcl,ucl,dcl,fcl,hcl,KQr,gcl,Acl,JQr,ZQr,XQr,cfo,Wio,Ccl,eqr,tqr,Tcl,k6e,Jio,kcl,Gk,nqr,Xio,Epm,vpm,eoo,too,roo,noo,XW,sGr,OCe,Bcl,Fcl,Ucl,Cpm,Hcl,W7r,$cl,ioo,bpm,RCe,mfo,oqr,gfo,qkt,ooo,Vcl,YW,Afo,UCe,sqr,aqr,zcl,soo,LPt,BPt,Tpm,Ipm,xpm,EUe,wpm,Ycl,Kcl,Jcl,Zcl,Xcl,ell,tll,rll,Rpm,cGr,nll,ill,kpm,Ppm,oll,P6e,all,cll,jkt,Dpm,Npm,Cbe,uz,lll,ull,vfo,dll,fll,pll,hll,mll,gll,All,yll,lqr,Mpm,Cfo,_ll,Ell,EM,ese,aoo,uqr,dqr,bfo,lGr,Cll,Opm,bll,Sll,Tll,Ill,xll,Sfo,Tfo,wll,coo,Rll,kll,Ifo,Pll,Dll,loo,Nll,Mll,xfo,Oll,wfo,Lll,Bll,Fll,Hkt,z7r,Rfo,Ull,Qll,qll,jll,Hll,Lpm,kfo,$ll,Vll,Wll,zll,Yll,Kll,Jll,Bpm,Zll,Fpm,Xll,eul,tul,TRt,FPt,uoo,Dfo,Upm,Qpm,Gkt,K7r,hul,qpm,mul,Lfo,Bfo,gul,doo,bbe,w9,yul,_ul,jpm,bul,Tul,goo,fqr,pqr,LCe,xul,wul,Rul,Aoo,$kt,Pul,JW,jfo,Hfo,Gfo,Vkt,hqr,Gul,$ul,Vul,zul,Yul,Kul,Jul,$fo,Zul,Xul,tdl,mqr,idl,sdl,adl,ldl,voo,Wfo,fdl,pdl,hdl,mdl,gdl,Adl,_dl,Edl,zfo,Cdl,Sdl,Idl,xdl,ez,Rdl,Pdl,Ndl,Coo,Odl,Ldl,Fdl,Qdl,qdl,Z7r,jdl,X7r,Hdl,tQr,lfl,Soo,ufl,dfl,ffl,_fl,upo=Se(()=>{p();Roo=require("node:module"),Woo=require("child_process"),rPt=require("crypto"),nPt=require("fs"),SE=require("fs/promises"),zoo=require("module"),qCe=require("os"),Cc=require("path"),Yoo=require("readline"),Koo=require("url"),Joo=require("events"),Xoo=require("child_process"),eso=require("fs"),tso=require("readline"),aso=require("os"),cso=require("path"),Uso=require("crypto"),AQr=require("path"),Qso=require("async_hooks"),yA=require("fs/promises"),qso=require("crypto"),SB=require("fs/promises"),EQr=require("fs"),tao=require("process"),dkt=require("crypto"),IE=require("fs/promises"),tse=require("path"),bo=fe(require("fs"),1),Xg=require("fs/promises"),nao=require("fs"),TB=require("path"),dao=require("fs"),hao=require("fs/promises"),kQr=require("events"),mao=require("fs"),AM=require("fs/promises"),VCe=require("path"),gao=require("child_process"),Aao=require("util"),yao=require("child_process"),_ao=require("path"),ybe=require("fs/promises"),_be=require("path"),DQr=require("fs"),IB=require("fs/promises"),$oe=require("path"),U6e=require("crypto"),Akt=require("path"),tUe=require("fs/promises"),ykt=require("path"),Mao=require("crypto"),Oao=require("os"),dfo=require("path"),Voe=require("path"),ffo=require("path"),gf=fe(require("node:path"),1),oGr=fe(require("node:os"),1),Qkt=fe(require("node:process"),1),_fo=require("path"),Efo=require("fs/promises"),aGr=require("os"),cqr=require("path"),Ffo=require("os"),Qfo=require("child_process"),qfo=require("fs"),Vy=require("path"),Kfo=require("path"),uVc=Object.create,{getPrototypeOf:dVc,defineProperty:rQr,getOwnPropertyNames:fVc}=Object,pVc=Object.prototype.hasOwnProperty;a(hVc,"a_");_qr=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?mVc??=new WeakMap:gVc??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?uVc(dVc(t)):{};let c=e||!t||!t.__esModule?rQr(r,"default",{value:t,enumerable:!0}):r;for(let l of fVc(t))pVc.call(c,l)||rQr(c,l,{get:hVc.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),jt=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),AVc=a(t=>t,"$k");a(yVc,"Qk");RB=a((t,e)=>{for(var r in e)rQr(t,r,{get:e[r],enumerable:!0,configurable:!0,set:yVc.bind(e,r)})},"M4"),_Vc=(0,Roo.createRequire)(importMetaUrlShim),EVc=Symbol.dispose||Symbol.for("Symbol.dispose"),vVc=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),pf=a((t,e,r)=>{if(e!=null){if(typeof e!="object"&&typeof e!="function")throw TypeError('Object expected to be assigned to "using" declaration');var n;if(r&&(n=e[vVc]),n===void 0&&(n=e[EVc]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),hf=a((t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=a(c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),"X"),s=a(c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e},"W");return s()},"M$"),CVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),bVc=jt(t=>{var e=t&&t.__createBinding||(Object.create?function(n,o,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:a(function(){return o[s]},"get")})}:function(n,o,s,c){c===void 0&&(c=s),n[c]=o[s]}),r=t&&t.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(CVc(),t)}),SVc=jt(t=>{var e=t&&t.__createBinding||(Object.create?function(n,o,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:a(function(){return o[s]},"get")})}:function(n,o,s,c){c===void 0&&(c=s),n[c]=o[s]}),r=t&&t.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(bVc(),t)}),koo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),TVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=koo(),r=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function n(o){let s=new Set([o]),c=new Set,l=o.match(r);if(!l)return()=>!1;let u={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};if(u.prerelease!=null)return function(h){return h===o};function d(h){return c.add(h),!1}a(d,"W");function f(h){return s.add(h),!0}return a(f,"G"),function(h){if(s.has(h))return!0;if(c.has(h))return!1;let m=h.match(r);if(!m)return d(h);let g={major:+m[1],minor:+m[2],patch:+m[3],prerelease:m[4]};return g.prerelease!=null||u.major!==g.major?d(h):u.major===0?u.minor===g.minor&&u.patch<=g.patch?f(h):d(h):u.minor<=g.minor?f(h):d(h)}}a(n,"b2"),t._makeCompatibilityCheck=n,t.isCompatible=n(e.VERSION)}),lbe=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=SVc(),r=koo(),n=TVc(),o=r.VERSION.split(".")[0],s=Symbol.for(`opentelemetry.js.api.${o}`),c=e._globalThis;function l(f,h,m,g=!1){var A;let y=c[s]=(A=c[s])!==null&&A!==void 0?A:{version:r.VERSION};if(!g&&y[f]){let _=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${f}`);return m.error(_.stack||_.message),!1}if(y.version!==r.VERSION){let _=Error(`@opentelemetry/api: Registration of version v${y.version} for ${f} does not match previously registered API v${r.VERSION}`);return m.error(_.stack||_.message),!1}return y[f]=h,m.debug(`@opentelemetry/api: Registered a global for ${f} v${r.VERSION}.`),!0}a(l,"ex"),t.registerGlobal=l;function u(f){var h,m;let g=(h=c[s])===null||h===void 0?void 0:h.version;if(!(!g||!(0,n.isCompatible)(g)))return(m=c[s])===null||m===void 0?void 0:m[f]}a(u,"$y"),t.getGlobal=u;function d(f,h){h.debug(`@opentelemetry/api: Unregistering a global for ${f} v${r.VERSION}.`);let m=c[s];m&&delete m[f]}a(d,"Qy"),t.unregisterGlobal=d}),IVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=lbe();class r{static{a(this,"T2")}constructor(s){this._namespace=s.namespace||"DiagComponentLogger"}debug(...s){return n("debug",this._namespace,s)}error(...s){return n("error",this._namespace,s)}info(...s){return n("info",this._namespace,s)}warn(...s){return n("warn",this._namespace,s)}verbose(...s){return n("verbose",this._namespace,s)}}t.DiagComponentLogger=r;function n(o,s,c){let l=(0,e.getGlobal)("diag");if(l)return c.unshift(s),l[o](...c)}a(n,"lQ")}),Eqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagLogLevel=void 0;var e;(function(r){r[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"})(e=t.DiagLogLevel||(t.DiagLogLevel={}))}),xVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=Eqr();function r(n,o){ne.DiagLogLevel.ALL&&(n=e.DiagLogLevel.ALL),o=o||{};function s(c,l){let u=o[c];return typeof u=="function"&&n>=l?u.bind(o):function(){}}return a(s,"J"),{error:s("error",e.DiagLogLevel.ERROR),warn:s("warn",e.DiagLogLevel.WARN),info:s("info",e.DiagLogLevel.INFO),debug:s("debug",e.DiagLogLevel.DEBUG),verbose:s("verbose",e.DiagLogLevel.VERBOSE)}}a(r,"Gy"),t.createLogLevelDiagLogger=r}),ube=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=IVc(),r=xVc(),n=Eqr(),o=lbe(),s="diag";class c{static{a(this,"kU")}constructor(){function u(h){return function(...m){let g=(0,o.getGlobal)("diag");if(g)return g[h](...m)}}a(u,"$");let d=this,f=a((h,m={logLevel:n.DiagLogLevel.INFO})=>{var g,A,y;if(h===d){let v=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return d.error((g=v.stack)!==null&&g!==void 0?g:v.message),!1}typeof m=="number"&&(m={logLevel:m});let _=(0,o.getGlobal)("diag"),E=(0,r.createLogLevelDiagLogger)((A=m.logLevel)!==null&&A!==void 0?A:n.DiagLogLevel.INFO,h);if(_&&!m.suppressOverrideMessage){let v=(y=Error().stack)!==null&&y!==void 0?y:"";_.warn(`Current logger will be overwritten from ${v}`),E.warn(`Current logger will overwrite one already registered from ${v}`)}return(0,o.registerGlobal)("diag",E,d,!0)},"J");d.setLogger=f,d.disable=()=>{(0,o.unregisterGlobal)(s,d)},d.createComponentLogger=h=>new e.DiagComponentLogger(h),d.verbose=u("verbose"),d.debug=u("debug"),d.info=u("info"),d.warn=u("warn"),d.error=u("error")}static instance(){return this._instance||(this._instance=new c),this._instance}}t.DiagAPI=c}),wVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaggageImpl=void 0;class e{static{a(this,"P8")}constructor(n){this._entries=n?new Map(n):new Map}getEntry(n){let o=this._entries.get(n);if(o)return Object.assign({},o)}getAllEntries(){return Array.from(this._entries.entries()).map(([n,o])=>[n,o])}setEntry(n,o){let s=new e(this._entries);return s._entries.set(n,o),s}removeEntry(n){let o=new e(this._entries);return o._entries.delete(n),o}removeEntries(...n){let o=new e(this._entries);for(let s of n)o._entries.delete(s);return o}clear(){return new e}}t.BaggageImpl=e}),RVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),Poo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=ube(),r=wVc(),n=RVc(),o=e.DiagAPI.instance();function s(l={}){return new r.BaggageImpl(new Map(Object.entries(l)))}a(s,"Ny"),t.createBaggage=s;function c(l){return typeof l!="string"&&(o.error(`Cannot create baggage metadata from unknown type: ${typeof l}`),l=""),{__TYPE__:n.baggageEntryMetadataSymbol,toString(){return l}}}a(c,"wy"),t.baggageEntryMetadataFromString=c}),Kkt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ROOT_CONTEXT=t.createContextKey=void 0;function e(n){return Symbol.for(n)}a(e,"Dy"),t.createContextKey=e;class r{static{a(this,"DX")}constructor(o){let s=this;s._currentContext=o?new Map(o):new Map,s.getValue=c=>s._currentContext.get(c),s.setValue=(c,l)=>{let u=new r(s._currentContext);return u._currentContext.set(c,l),u},s.deleteValue=c=>{let l=new r(s._currentContext);return l._currentContext.delete(c),l}}}t.ROOT_CONTEXT=new r}),kVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagConsoleLogger=void 0;var e=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class r{static{a(this,"QD")}constructor(){function o(s){return function(...c){if(console){let l=console[s];if(typeof l!="function"&&(l=console.log),typeof l=="function")return l.apply(console,c)}}}a(o,"$");for(let s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_GAUGE_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopGaugeMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class e{static{a(this,"CU")}constructor(){}createGauge(g,A){return t.NOOP_GAUGE_METRIC}createHistogram(g,A){return t.NOOP_HISTOGRAM_METRIC}createCounter(g,A){return t.NOOP_COUNTER_METRIC}createUpDownCounter(g,A){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(g,A){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(g,A){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(g,A){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(g,A){}removeBatchObservableCallback(g){}}t.NoopMeter=e;class r{static{a(this,"E8")}}t.NoopMetric=r;class n extends r{static{a(this,"TU")}add(g,A){}}t.NoopCounterMetric=n;class o extends r{static{a(this,"xU")}add(g,A){}}t.NoopUpDownCounterMetric=o;class s extends r{static{a(this,"yU")}record(g,A){}}t.NoopGaugeMetric=s;class c extends r{static{a(this,"fU")}record(g,A){}}t.NoopHistogramMetric=c;class l{static{a(this,"pQ")}addCallback(g){}removeCallback(g){}}t.NoopObservableMetric=l;class u extends l{static{a(this,"gU")}}t.NoopObservableCounterMetric=u;class d extends l{static{a(this,"hU")}}t.NoopObservableGaugeMetric=d;class f extends l{static{a(this,"uU")}}t.NoopObservableUpDownCounterMetric=f,t.NOOP_METER=new e,t.NOOP_COUNTER_METRIC=new n,t.NOOP_GAUGE_METRIC=new s,t.NOOP_HISTOGRAM_METRIC=new c,t.NOOP_UP_DOWN_COUNTER_METRIC=new o,t.NOOP_OBSERVABLE_COUNTER_METRIC=new u,t.NOOP_OBSERVABLE_GAUGE_METRIC=new d,t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new f;function h(){return t.NOOP_METER}a(h,"Zy"),t.createNoopMeter=h}),PVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueType=void 0;var e;(function(r){r[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"})(e=t.ValueType||(t.ValueType={}))}),Noo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTextMapSetter=t.defaultTextMapGetter=void 0,t.defaultTextMapGetter={get(e,r){if(e!=null)return e[r]},keys(e){return e==null?[]:Object.keys(e)}},t.defaultTextMapSetter={set(e,r,n){e!=null&&(e[r]=n)}}}),DVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=Kkt();class r{static{a(this,"ZD")}active(){return e.ROOT_CONTEXT}with(o,s,c,...l){return s.call(c,...l)}bind(o,s){return s}enable(){return this}disable(){return this}}t.NoopContextManager=r}),Jkt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=DVc(),r=lbe(),n=ube(),o="context",s=new e.NoopContextManager;class c{static{a(this,"iU")}constructor(){}static getInstance(){return this._instance||(this._instance=new c),this._instance}setGlobalContextManager(u){return(0,r.registerGlobal)(o,u,n.DiagAPI.instance())}active(){return this._getContextManager().active()}with(u,d,f,...h){return this._getContextManager().with(u,d,f,...h)}bind(u,d){return this._getContextManager().bind(u,d)}_getContextManager(){return(0,r.getGlobal)(o)||s}disable(){this._getContextManager().disable(),(0,r.unregisterGlobal)(o,n.DiagAPI.instance())}}t.ContextAPI=c}),Moo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFlags=void 0;var e;(function(r){r[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"})(e=t.TraceFlags||(t.TraceFlags={}))}),vqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=Moo();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),Cqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=vqr();class r{static{a(this,"SD")}constructor(o=e.INVALID_SPAN_CONTEXT){this._spanContext=o}spanContext(){return this._spanContext}setAttribute(o,s){return this}setAttributes(o){return this}addEvent(o,s){return this}addLink(o){return this}addLinks(o){return this}setStatus(o){return this}updateName(o){return this}end(o){}isRecording(){return!1}recordException(o,s){}}t.NonRecordingSpan=r}),Ooo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=Kkt(),r=Cqr(),n=Jkt(),o=(0,e.createContextKey)("OpenTelemetry Context Key SPAN");function s(h){return h.getValue(o)||void 0}a(s,"tU"),t.getSpan=s;function c(){return s(n.ContextAPI.getInstance().active())}a(c,"my"),t.getActiveSpan=c;function l(h,m){return h.setValue(o,m)}a(l,"TD"),t.setSpan=l;function u(h){return h.deleteValue(o)}a(u,"ly"),t.deleteSpan=u;function d(h,m){return l(h,new r.NonRecordingSpan(m))}a(d,"cy"),t.setSpanContext=d;function f(h){var m;return(m=s(h))===null||m===void 0?void 0:m.spanContext()}a(f,"py"),t.getSpanContext=f}),bqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=vqr(),r=Cqr(),n=/^([0-9a-f]{32})$/i,o=/^[0-9a-f]{16}$/i;function s(d){return n.test(d)&&d!==e.INVALID_TRACEID}a(s,"gD"),t.isValidTraceId=s;function c(d){return o.test(d)&&d!==e.INVALID_SPANID}a(c,"hD"),t.isValidSpanId=c;function l(d){return s(d.traceId)&&c(d.spanId)}a(l,"ey"),t.isSpanContextValid=l;function u(d){return new r.NonRecordingSpan(d)}a(u,"$f"),t.wrapSpanContext=u}),Loo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=Jkt(),r=Ooo(),n=Cqr(),o=bqr(),s=e.ContextAPI.getInstance();class c{static{a(this,"cD")}startSpan(d,f,h=s.active()){if(f?.root)return new n.NonRecordingSpan;let m=h&&(0,r.getSpanContext)(h);return l(m)&&(0,o.isSpanContextValid)(m)?new n.NonRecordingSpan(m):new n.NonRecordingSpan}startActiveSpan(d,f,h,m){let g,A,y;if(arguments.length<2)return;arguments.length===2?y=f:arguments.length===3?(g=f,y=h):(g=f,A=h,y=m);let _=A??s.active(),E=this.startSpan(d,g,_),v=(0,r.setSpan)(_,E);return s.with(v,y,void 0,E)}}t.NoopTracer=c;function l(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}a(l,"Gf")}),Boo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=Loo(),r=new e.NoopTracer;class n{static{a(this,"iD")}constructor(s,c,l,u){this._provider=s,this.name=c,this.version=l,this.options=u}startSpan(s,c,l){return this._getTracer().startSpan(s,c,l)}startActiveSpan(s,c,l,u){let d=this._getTracer();return Reflect.apply(d.startActiveSpan,d,arguments)}_getTracer(){if(this._delegate)return this._delegate;let s=this._provider.getDelegateTracer(this.name,this.version,this.options);return s?(this._delegate=s,this._delegate):r}}t.ProxyTracer=n}),NVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=Loo();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),Foo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=Boo(),r=NVc(),n=new r.NoopTracerProvider;class o{static{a(this,"eD")}getTracer(c,l,u){var d;return(d=this.getDelegateTracer(c,l,u))!==null&&d!==void 0?d:new e.ProxyTracer(this,c,l,u)}getDelegate(){var c;return(c=this._delegate)!==null&&c!==void 0?c:n}setDelegate(c){this._delegate=c}getDelegateTracer(c,l,u){var d;return(d=this._delegate)===null||d===void 0?void 0:d.getTracer(c,l,u)}}t.ProxyTracerProvider=o}),MVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SamplingDecision=void 0;var e;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(e=t.SamplingDecision||(t.SamplingDecision={}))}),OVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanKind=void 0;var e;(function(r){r[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"})(e=t.SpanKind||(t.SpanKind={}))}),LVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanStatusCode=void 0;var e;(function(r){r[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"})(e=t.SpanStatusCode||(t.SpanStatusCode={}))}),BVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateValue=t.validateKey=void 0;var e="[_0-9a-z-*/]",r=`[a-z]${e}{0,255}`,n=`[a-z0-9]${e}{0,240}@[a-z]${e}{0,13}`,o=new RegExp(`^(?:${r}|${n})$`),s=/^[ -~]{0,255}[!-~]$/,c=/,|=/;function l(d){return o.test(d)}a(l,"Lf"),t.validateKey=l;function u(d){return s.test(d)&&!c.test(d)}a(u,"jf"),t.validateValue=u}),FVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=BVc(),r=32,n=512,o=",",s="=";class c{static{a(this,"UH")}constructor(u){this._internalState=new Map,u&&this._parse(u)}set(u,d){let f=this._clone();return f._internalState.has(u)&&f._internalState.delete(u),f._internalState.set(u,d),f}unset(u){let d=this._clone();return d._internalState.delete(u),d}get(u){return this._internalState.get(u)}serialize(){return this._keys().reduce((u,d)=>(u.push(d+s+this.get(d)),u),[]).join(o)}_parse(u){u.length>n||(this._internalState=u.split(o).reverse().reduce((d,f)=>{let h=f.trim(),m=h.indexOf(s);if(m!==-1){let g=h.slice(0,m),A=h.slice(m+1,f.length);(0,e.validateKey)(g)&&(0,e.validateValue)(A)&&d.set(g,A)}return d},new Map),this._internalState.size>r&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,r))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let u=new c;return u._internalState=new Map(this._internalState),u}}t.TraceStateImpl=c}),UVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=FVc();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),QVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=Jkt();t.context=e.ContextAPI.getInstance()}),qVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=ube();t.diag=e.DiagAPI.instance()}),jVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=Doo();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),HVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=jVc(),r=lbe(),n=ube(),o="metrics";class s{static{a(this,"VH")}constructor(){}static getInstance(){return this._instance||(this._instance=new s),this._instance}setGlobalMeterProvider(l){return(0,r.registerGlobal)(o,l,n.DiagAPI.instance())}getMeterProvider(){return(0,r.getGlobal)(o)||e.NOOP_METER_PROVIDER}getMeter(l,u,d){return this.getMeterProvider().getMeter(l,u,d)}disable(){(0,r.unregisterGlobal)(o,n.DiagAPI.instance())}}t.MetricsAPI=s}),GVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=HVc();t.metrics=e.MetricsAPI.getInstance()}),$Vc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTextMapPropagator=void 0;class e{static{a(this,"fF")}inject(n,o){}extract(n,o){return n}fields(){return[]}}t.NoopTextMapPropagator=e}),VVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=Jkt(),r=Kkt(),n=(0,r.createContextKey)("OpenTelemetry Baggage Key");function o(u){return u.getValue(n)||void 0}a(o,"mF"),t.getBaggage=o;function s(){return o(e.ContextAPI.getInstance().active())}a(s,"xf"),t.getActiveBaggage=s;function c(u,d){return u.setValue(n,d)}a(c,"yf"),t.setBaggage=c;function l(u){return u.deleteValue(n)}a(l,"ff"),t.deleteBaggage=l}),WVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=lbe(),r=$Vc(),n=Noo(),o=VVc(),s=Poo(),c=ube(),l="propagation",u=new r.NoopTextMapPropagator;class d{static{a(this,"wH")}constructor(){this.createBaggage=s.createBaggage,this.getBaggage=o.getBaggage,this.getActiveBaggage=o.getActiveBaggage,this.setBaggage=o.setBaggage,this.deleteBaggage=o.deleteBaggage}static getInstance(){return this._instance||(this._instance=new d),this._instance}setGlobalPropagator(h){return(0,e.registerGlobal)(l,h,c.DiagAPI.instance())}inject(h,m,g=n.defaultTextMapSetter){return this._getGlobalPropagator().inject(h,m,g)}extract(h,m,g=n.defaultTextMapGetter){return this._getGlobalPropagator().extract(h,m,g)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,e.unregisterGlobal)(l,c.DiagAPI.instance())}_getGlobalPropagator(){return(0,e.getGlobal)(l)||u}}t.PropagationAPI=d}),zVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=WVc();t.propagation=e.PropagationAPI.getInstance()}),YVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=lbe(),r=Foo(),n=bqr(),o=Ooo(),s=ube(),c="trace";class l{static{a(this,"FH")}constructor(){this._proxyTracerProvider=new r.ProxyTracerProvider,this.wrapSpanContext=n.wrapSpanContext,this.isSpanContextValid=n.isSpanContextValid,this.deleteSpan=o.deleteSpan,this.getSpan=o.getSpan,this.getActiveSpan=o.getActiveSpan,this.getSpanContext=o.getSpanContext,this.setSpan=o.setSpan,this.setSpanContext=o.setSpanContext}static getInstance(){return this._instance||(this._instance=new l),this._instance}setGlobalTracerProvider(d){let f=(0,e.registerGlobal)(c,this._proxyTracerProvider,s.DiagAPI.instance());return f&&this._proxyTracerProvider.setDelegate(d),f}getTracerProvider(){return(0,e.getGlobal)(c)||this._proxyTracerProvider}getTracer(d,f){return this.getTracerProvider().getTracer(d,f)}disable(){(0,e.unregisterGlobal)(c,s.DiagAPI.instance()),this._proxyTracerProvider=new r.ProxyTracerProvider}}t.TraceAPI=l}),KVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=YVc();t.trace=e.TraceAPI.getInstance()}),JVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=t.propagation=t.metrics=t.diag=t.context=t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=t.isValidSpanId=t.isValidTraceId=t.isSpanContextValid=t.createTraceState=t.TraceFlags=t.SpanStatusCode=t.SpanKind=t.SamplingDecision=t.ProxyTracerProvider=t.ProxyTracer=t.defaultTextMapSetter=t.defaultTextMapGetter=t.ValueType=t.createNoopMeter=t.DiagLogLevel=t.DiagConsoleLogger=t.ROOT_CONTEXT=t.createContextKey=t.baggageEntryMetadataFromString=void 0;var e=Poo();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=Kkt();Object.defineProperty(t,"createContextKey",{enumerable:!0,get:a(function(){return r.createContextKey},"get")}),Object.defineProperty(t,"ROOT_CONTEXT",{enumerable:!0,get:a(function(){return r.ROOT_CONTEXT},"get")});var n=kVc();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=Eqr();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=Doo();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=PVc();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=Noo();Object.defineProperty(t,"defaultTextMapGetter",{enumerable:!0,get:a(function(){return l.defaultTextMapGetter},"get")}),Object.defineProperty(t,"defaultTextMapSetter",{enumerable:!0,get:a(function(){return l.defaultTextMapSetter},"get")});var u=Boo();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=Foo();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=MVc();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=OVc();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=LVc();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=Moo();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=UVc();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=bqr();Object.defineProperty(t,"isSpanContextValid",{enumerable:!0,get:a(function(){return y.isSpanContextValid},"get")}),Object.defineProperty(t,"isValidTraceId",{enumerable:!0,get:a(function(){return y.isValidTraceId},"get")}),Object.defineProperty(t,"isValidSpanId",{enumerable:!0,get:a(function(){return y.isValidSpanId},"get")});var _=vqr();Object.defineProperty(t,"INVALID_SPANID",{enumerable:!0,get:a(function(){return _.INVALID_SPANID},"get")}),Object.defineProperty(t,"INVALID_TRACEID",{enumerable:!0,get:a(function(){return _.INVALID_TRACEID},"get")}),Object.defineProperty(t,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:a(function(){return _.INVALID_SPAN_CONTEXT},"get")});var E=QVc();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return E.context},"get")});var v=qVc();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var S=GVc();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return S.metrics},"get")});var T=zVc();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=KVc();Object.defineProperty(t,"trace",{enumerable:!0,get:a(function(){return w.trace},"get")}),t.default={context:E.context,diag:v.diag,metrics:S.metrics,propagation:T.propagation,trace:w.trace}}),kRt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{static{a(this,"BW")}}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{static{a(this,"K9")}constructor(v){if(super(),!t.IDENTIFIER.test(v))throw Error("CodeGen: name must be a valid identifier");this.str=v}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{static{a(this,"B4")}constructor(v){super(),this._items=typeof v=="string"?[v]:v}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let v=this._items[0];return v===""||v==='""'}get str(){var v;return(v=this._str)!==null&&v!==void 0?v:this._str=this._items.reduce((S,T)=>`${S}${T}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((S,T)=>(T instanceof r&&(S[T.str]=(S[T.str]||0)+1),S),{})}}t._Code=n,t.nil=new n("");function o(E,...v){let S=[E[0]],T=0;for(;T{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;var e=kRt();class r extends Error{static{a(this,"Dj")}constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(t.UsedValueState=n={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class o{static{a(this,"KB")}constructor({prefixes:d,parent:f}={}){this._names={},this._prefixes=d,this._parent=f}toName(d){return d instanceof e.Name?d:this.name(d)}name(d){return new e.Name(this._newName(d))}_newName(d){let f=this._names[d]||this._nameGroup(d);return`${d}${f.index++}`}_nameGroup(d){var f,h;if(!((h=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||h===void 0)&&h.has(d)||this._prefixes&&!this._prefixes.has(d))throw Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}t.Scope=o;class s extends e.Name{static{a(this,"qB")}constructor(d,f){super(f),this.prefix=d}setValue(d,{property:f,itemIndex:h}){this.value=d,this.scopePath=e._`.${new e.Name(f)}[${h}]`}}t.ValueScopeName=s;var c=e._`\n`;class l extends o{static{a(this,"Fj")}constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?c:e.nil}}get(){return this._scope}name(d){return new s(d,this._newName(d))}value(d,f){var h;if(f.ref===void 0)throw Error("CodeGen: ref must be passed in value");let m=this.toName(d),{prefix:g}=m,A=(h=f.key)!==null&&h!==void 0?h:f.ref,y=this._values[g];if(y){let v=y.get(A);if(v)return v}else y=this._values[g]=new Map;y.set(A,m);let _=this._scope[g]||(this._scope[g]=[]),E=_.length;return _[E]=f.ref,m.setValue(f,{property:g,itemIndex:E}),m}getValue(d,f){let h=this._values[d];if(h)return h.get(f)}scopeRefs(d,f=this._values){return this._reduceValues(f,h=>{if(h.scopePath===void 0)throw Error(`CodeGen: name "${h}" has no value`);return e._`${d}${h.scopePath}`})}scopeCode(d=this._values,f,h){return this._reduceValues(d,m=>{if(m.value===void 0)throw Error(`CodeGen: name "${m}" has no value`);return m.value.code},f,h)}_reduceValues(d,f,h={},m){let g=e.nil;for(let A in d){let y=d[A];if(!y)continue;let _=h[A]=h[A]||new Map;y.forEach(E=>{if(_.has(E))return;_.set(E,n.Started);let v=f(E);if(v){let S=this.opts.es5?t.varKinds.var:t.varKinds.const;g=e._`${g}${S} ${E} = ${v};${this.opts._n}`}else if(v=m?.(E))g=e._`${g}${v}${this.opts._n}`;else throw new r(E);_.set(E,n.Completed)})}return g}}t.ValueScope=l}),Fs=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;var e=kRt(),r=Cno(),n=kRt();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return n._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return n.str},"get")}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:a(function(){return n.strConcat},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return n.nil},"get")}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:a(function(){return n.getProperty},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return n.stringify},"get")}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:a(function(){return n.regexpCode},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return n.Name},"get")});var o=Cno();Object.defineProperty(t,"Scope",{enumerable:!0,get:a(function(){return o.Scope},"get")}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:a(function(){return o.ValueScope},"get")}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:a(function(){return o.ValueScopeName},"get")}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:a(function(){return o.varKinds},"get")}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{static{a(this,"y1")}optimizeNodes(){return this}optimizeNames(H,re){return this}}class c extends s{static{a(this,"Lj")}constructor(H,re,le){super(),this.varKind=H,this.name=re,this.rhs=le}render({es5:H,_n:re}){let le=H?r.varKinds.var:this.varKind,Le=this.rhs===void 0?"":` = ${this.rhs}`;return`${le} ${this.name}${Le};`+re}optimizeNames(H,re){if(H[this.name.str])return this.rhs&&(this.rhs=M(this.rhs,H,re)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class l extends s{static{a(this,"NB")}constructor(H,re,le){super(),this.lhs=H,this.rhs=re,this.sideEffects=le}render({_n:H}){return`${this.lhs} = ${this.rhs};`+H}optimizeNames(H,re){if(!(this.lhs instanceof e.Name&&!H[this.lhs.str]&&!this.sideEffects))return this.rhs=M(this.rhs,H,re),this}get names(){let H=this.lhs instanceof e.Name?{}:{...this.lhs.names};return q(H,this.rhs)}}class u extends l{static{a(this,"jj")}constructor(H,re,le,Le){super(H,le,Le),this.op=re}render({_n:H}){return`${this.lhs} ${this.op}= ${this.rhs};`+H}}class d extends s{static{a(this,"Aj")}constructor(H){super(),this.label=H,this.names={}}render({_n:H}){return`${this.label}:`+H}}class f extends s{static{a(this,"Ij")}constructor(H){super(),this.label=H,this.names={}}render({_n:H}){return`break${this.label?` ${this.label}`:""};`+H}}class h extends s{static{a(this,"Rj")}constructor(H){super(),this.error=H}render({_n:H}){return`throw ${this.error};`+H}get names(){return this.error.names}}class m extends s{static{a(this,"Pj")}constructor(H){super(),this.code=H}render({_n:H}){return`${this.code};`+H}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(H,re){return this.code=M(this.code,H,re),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class g extends s{static{a(this,"LW")}constructor(H=[]){super(),this.nodes=H}render(H){return this.nodes.reduce((re,le)=>re+le.render(H),"")}optimizeNodes(){let{nodes:H}=this,re=H.length;for(;re--;){let le=H[re].optimizeNodes();Array.isArray(le)?H.splice(re,1,...le):le?H[re]=le:H.splice(re,1)}return H.length>0?this:void 0}optimizeNames(H,re){let{nodes:le}=this,Le=le.length;for(;Le--;){let me=le[Le];me.optimizeNames(H,re)||(L(H,me.names),le.splice(Le,1))}return le.length>0?this:void 0}get names(){return this.nodes.reduce((H,re)=>B(H,re.names),{})}}class A extends g{static{a(this,"f1")}render(H){return"{"+H._n+super.render(H)+"}"+H._n}}class y extends g{static{a(this,"Ej")}}class _ extends A{static{a(this,"RJ")}}_.kind="else";class E extends A{static{a(this,"e4")}constructor(H,re){super(re),this.condition=H}render(H){let re=`if(${this.condition})`+super.render(H);return this.else&&(re+="else "+this.else.render(H)),re}optimizeNodes(){super.optimizeNodes();let H=this.condition;if(H===!0)return this.nodes;let re=this.else;if(re){let le=re.optimizeNodes();re=this.else=Array.isArray(le)?new _(le):le}if(re)return H===!1?re instanceof E?re:re.nodes:this.nodes.length?this:new E(U(H),re instanceof E?[re]:re.nodes);if(!(H===!1||!this.nodes.length))return this}optimizeNames(H,re){var le;if(this.else=(le=this.else)===null||le===void 0?void 0:le.optimizeNames(H,re),!!(super.optimizeNames(H,re)||this.else))return this.condition=M(this.condition,H,re),this}get names(){let H=super.names;return q(H,this.condition),this.else&&B(H,this.else.names),H}}E.kind="if";class v extends A{static{a(this,"q9")}}v.kind="for";class S extends v{static{a(this,"bj")}constructor(H){super(),this.iteration=H}render(H){return`for(${this.iteration})`+super.render(H)}optimizeNames(H,re){if(super.optimizeNames(H,re))return this.iteration=M(this.iteration,H,re),this}get names(){return B(super.names,this.iteration.names)}}class T extends v{static{a(this,"_j")}constructor(H,re,le,Le){super(),this.varKind=H,this.name=re,this.from=le,this.to=Le}render(H){let re=H.es5?r.varKinds.var:this.varKind,{name:le,from:Le,to:me}=this;return`for(${re} ${le}=${Le}; ${le}<${me}; ${le}++)`+super.render(H)}get names(){let H=q(super.names,this.from);return q(H,this.to)}}class w extends v{static{a(this,"BB")}constructor(H,re,le,Le){super(),this.loop=H,this.varKind=re,this.name=le,this.iterable=Le}render(H){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(H)}optimizeNames(H,re){if(super.optimizeNames(H,re))return this.iterable=M(this.iterable,H,re),this}get names(){return B(super.names,this.iterable.names)}}class R extends A{static{a(this,"wW")}constructor(H,re,le){super(),this.name=H,this.args=re,this.async=le}render(H){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(H)}}R.kind="func";class x extends g{static{a(this,"OW")}render(H){return"return "+super.render(H)}}x.kind="return";class k extends A{static{a(this,"kj")}render(H){let re="try"+super.render(H);return this.catch&&(re+=this.catch.render(H)),this.finally&&(re+=this.finally.render(H)),re}optimizeNodes(){var H,re;return super.optimizeNodes(),(H=this.catch)===null||H===void 0||H.optimizeNodes(),(re=this.finally)===null||re===void 0||re.optimizeNodes(),this}optimizeNames(H,re){var le,Le;return super.optimizeNames(H,re),(le=this.catch)===null||le===void 0||le.optimizeNames(H,re),(Le=this.finally)===null||Le===void 0||Le.optimizeNames(H,re),this}get names(){let H=super.names;return this.catch&&B(H,this.catch.names),this.finally&&B(H,this.finally.names),H}}class D extends A{static{a(this,"DW")}constructor(H){super(),this.error=H}render(H){return`catch(${this.error})`+super.render(H)}}D.kind="catch";class N extends A{static{a(this,"FW")}render(H){return"finally"+super.render(H)}}N.kind="finally";class O{static{a(this,"Sj")}constructor(H,re={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...re,_n:re.lines?` -`:""},this._extScope=H,this._scope=new r.Scope({parent:H}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(H){return this._scope.name(H)}scopeName(H){return this._extScope.name(H)}scopeValue(H,re){let le=this._extScope.value(H,re);return(this._values[le.prefix]||(this._values[le.prefix]=new Set)).add(le),le}getScopeValue(H,re){return this._extScope.getValue(H,re)}scopeRefs(H){return this._extScope.scopeRefs(H,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(H,re,le,Le){let me=this._scope.toName(re);return le!==void 0&&Le&&(this._constants[me.str]=le),this._leafNode(new c(H,me,le)),me}const(H,re,le){return this._def(r.varKinds.const,H,re,le)}let(H,re,le){return this._def(r.varKinds.let,H,re,le)}var(H,re,le){return this._def(r.varKinds.var,H,re,le)}assign(H,re,le){return this._leafNode(new l(H,re,le))}add(H,re){return this._leafNode(new u(H,t.operators.ADD,re))}code(H){return typeof H=="function"?H():H!==e.nil&&this._leafNode(new m(H)),this}object(...H){let re=["{"];for(let[le,Le]of H)re.length>1&&re.push(","),re.push(le),(le!==Le||this.opts.es5)&&(re.push(":"),(0,e.addCodeArg)(re,Le));return re.push("}"),new e._Code(re)}if(H,re,le){if(this._blockNode(new E(H)),re&&le)this.code(re).else().code(le).endIf();else if(re)this.code(re).endIf();else if(le)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(H){return this._elseNode(new E(H))}else(){return this._elseNode(new _)}endIf(){return this._endBlockNode(E,_)}_for(H,re){return this._blockNode(H),re&&this.code(re).endFor(),this}for(H,re){return this._for(new S(H),re)}forRange(H,re,le,Le,me=this.opts.es5?r.varKinds.var:r.varKinds.let){let Oe=this._scope.toName(H);return this._for(new T(me,Oe,re,le),()=>Le(Oe))}forOf(H,re,le,Le=r.varKinds.const){let me=this._scope.toName(H);if(this.opts.es5){let Oe=re instanceof e.Name?re:this.var("_arr",re);return this.forRange("_i",0,e._`${Oe}.length`,Te=>{this.var(me,e._`${Oe}[${Te}]`),le(me)})}return this._for(new w("of",Le,me,re),()=>le(me))}forIn(H,re,le,Le=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(H,e._`Object.keys(${re})`,le);let me=this._scope.toName(H);return this._for(new w("in",Le,me,re),()=>le(me))}endFor(){return this._endBlockNode(v)}label(H){return this._leafNode(new d(H))}break(H){return this._leafNode(new f(H))}return(H){let re=new x;if(this._blockNode(re),this.code(H),re.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(H,re,le){if(!re&&!le)throw Error('CodeGen: "try" without "catch" and "finally"');let Le=new k;if(this._blockNode(Le),this.code(H),re){let me=this.name("e");this._currNode=Le.catch=new D(me),re(me)}return le&&(this._currNode=Le.finally=new N,this.code(le)),this._endBlockNode(D,N)}throw(H){return this._leafNode(new h(H))}block(H,re){return this._blockStarts.push(this._nodes.length),H&&this.code(H).endBlock(re),this}endBlock(H){let re=this._blockStarts.pop();if(re===void 0)throw Error("CodeGen: not in self-balancing block");let le=this._nodes.length-re;if(le<0||H!==void 0&&le!==H)throw Error(`CodeGen: wrong number of nodes: ${le} vs ${H} expected`);return this._nodes.length=re,this}func(H,re=e.nil,le,Le){return this._blockNode(new R(H,re,le)),Le&&this.code(Le).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize(H=1){for(;H-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(H){return this._currNode.nodes.push(H),this}_blockNode(H){this._currNode.nodes.push(H),this._nodes.push(H)}_endBlockNode(H,re){let le=this._currNode;if(le instanceof H||re&&le instanceof re)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${re?`${H.kind}/${re.kind}`:H.kind}"`)}_elseNode(H){let re=this._currNode;if(!(re instanceof E))throw Error('CodeGen: "else" without "if"');return this._currNode=re.else=H,this}get _root(){return this._nodes[0]}get _currNode(){let H=this._nodes;return H[H.length-1]}set _currNode(H){let re=this._nodes;re[re.length-1]=H}}t.CodeGen=O;function B(ie,H){for(let re in H)ie[re]=(ie[re]||0)+(H[re]||0);return ie}a(B,"v0");function q(ie,H){return H instanceof e._CodeOrName?B(ie,H.names):ie}a(q,"ZW");function M(ie,H,re){if(ie instanceof e.Name)return le(ie);if(!Le(ie))return ie;return new e._Code(ie._items.reduce((me,Oe)=>(Oe instanceof e.Name&&(Oe=le(Oe)),Oe instanceof e._Code?me.push(...Oe._items):me.push(Oe),me),[]));function le(me){let Oe=re[me.str];return Oe===void 0||H[me.str]!==1?me:(delete H[me.str],Oe)}function Le(me){return me instanceof e._Code&&me._items.some(Oe=>Oe instanceof e.Name&&H[Oe.str]===1&&re[Oe.str]!==void 0)}}a(M,"V9");function L(ie,H){for(let re in H)ie[re]=(ie[re]||0)-(H[re]||0)}a(L,"dp");function U(ie){return typeof ie=="boolean"||typeof ie=="number"||ie===null?!ie:e._`!${z(ie)}`}a(U,"vj"),t.not=U;var j=V(t.operators.AND);function Q(...ie){return ie.reduce(j)}a(Q,"np"),t.and=Q;var Y=V(t.operators.OR);function W(...ie){return ie.reduce(Y)}a(W,"op"),t.or=W;function V(ie){return(H,re)=>H===e.nil?re:re===e.nil?H:e._`${z(H)} ${ie} ${z(re)}`}a(V,"Cj");function z(ie){return ie instanceof e.Name?ie:e._`(${ie})`}a(z,"zB")}),Sc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;var e=Fs(),r=kRt();function n(R){let x={};for(let k of R)x[k]=!0;return x}a(n,"$d"),t.toHash=n;function o(R,x){return typeof x=="boolean"?x:Object.keys(x).length===0?!0:(s(R,x),!c(x,R.self.RULES.all))}a(o,"Qd"),t.alwaysValidSchema=o;function s(R,x=R.schema){let{opts:k,self:D}=R;if(!k.strictSchema||typeof x=="boolean")return;let N=D.RULES.keywords;for(let O in x)N[O]||w(R,`unknown keyword: "${O}"`)}a(s,"fj"),t.checkUnknownRules=s;function c(R,x){if(typeof R=="boolean")return!R;for(let k in R)if(x[k])return!0;return!1}a(c,"gj"),t.schemaHasRules=c;function l(R,x){if(typeof R=="boolean")return!R;for(let k in R)if(k!=="$ref"&&x.all[k])return!0;return!1}a(l,"Jd"),t.schemaHasRulesButRef=l;function u({topSchemaRef:R,schemaPath:x},k,D,N){if(!N){if(typeof k=="number"||typeof k=="boolean")return k;if(typeof k=="string")return e._`${k}`}return e._`${R}${x}${(0,e.getProperty)(D)}`}a(u,"Xd"),t.schemaRefOrVal=u;function d(R){return m(decodeURIComponent(R))}a(d,"Yd"),t.unescapeFragment=d;function f(R){return encodeURIComponent(h(R))}a(f,"Wd"),t.escapeFragment=f;function h(R){return typeof R=="number"?`${R}`:R.replace(/~/g,"~0").replace(/\//g,"~1")}a(h,"OB"),t.escapeJsonPointer=h;function m(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}a(m,"hj"),t.unescapeJsonPointer=m;function g(R,x){if(Array.isArray(R))for(let k of R)x(k);else x(R)}a(g,"Gd"),t.eachItem=g;function A({mergeNames:R,mergeToName:x,mergeValues:k,resultToName:D}){return(N,O,B,q)=>{let M=B===void 0?O:B instanceof e.Name?(O instanceof e.Name?R(N,O,B):x(N,O,B),B):O instanceof e.Name?(x(N,B,O),O):k(O,B);return q===e.Name&&!(M instanceof e.Name)?D(N,M):M}}a(A,"xj"),t.mergeEvaluated={props:A({mergeNames:a((R,x,k)=>R.if(e._`${k} !== true && ${x} !== undefined`,()=>{R.if(e._`${x} === true`,()=>R.assign(k,!0),()=>R.assign(k,e._`${k} || {}`).code(e._`Object.assign(${k}, ${x})`))}),"mergeNames"),mergeToName:a((R,x,k)=>R.if(e._`${k} !== true`,()=>{x===!0?R.assign(k,!0):(R.assign(k,e._`${k} || {}`),_(R,k,x))}),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:{...R,...x},"mergeValues"),resultToName:y}),items:A({mergeNames:a((R,x,k)=>R.if(e._`${k} !== true && ${x} !== undefined`,()=>R.assign(k,e._`${x} === true ? true : ${k} > ${x} ? ${k} : ${x}`)),"mergeNames"),mergeToName:a((R,x,k)=>R.if(e._`${k} !== true`,()=>R.assign(k,x===!0?!0:e._`${k} > ${x} ? ${k} : ${x}`)),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:Math.max(R,x),"mergeValues"),resultToName:a((R,x)=>R.var("items",x),"resultToName")})};function y(R,x){if(x===!0)return R.var("props",!0);let k=R.var("props",e._`{}`);return x!==void 0&&_(R,k,x),k}a(y,"uj"),t.evaluatedPropsToName=y;function _(R,x,k){Object.keys(k).forEach(D=>R.assign(e._`${x}${(0,e.getProperty)(D)}`,!0))}a(_,"DB"),t.setEvaluated=_;var E={};function v(R,x){return R.scopeValue("func",{ref:x,code:E[x.code]||(E[x.code]=new r._Code(x.code))})}a(v,"Ud"),t.useFunc=v;var S;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(S||(t.Type=S={}));function T(R,x,k){if(R instanceof e.Name){let D=x===S.Num;return k?D?e._`"[" + ${R} + "]"`:e._`"['" + ${R} + "']"`:D?e._`"/" + ${R}`:e._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return k?(0,e.getProperty)(R).toString():"/"+h(R)}a(T,"Hd"),t.getErrorPath=T;function w(R,x,k=R.opts.strictSchema){if(k){if(x=`strict mode: ${x}`,k===!0)throw Error(x);R.self.logger.warn(x)}}a(w,"mj"),t.checkStrictMode=w}),cz=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};t.default=r}),Zkt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Fs(),r=Sc(),n=cz();t.keywordError={message:a(({keyword:_})=>e.str`must pass "${_}" keyword validation`,"message")},t.keyword$DataError={message:a(({keyword:_,schemaType:E})=>E?e.str`"${_}" keyword must be ${E} ($data)`:e.str`"${_}" keyword is invalid ($data)`,"message")};function o(_,E=t.keywordError,v,S){let{it:T}=_,{gen:w,compositeRule:R,allErrors:x}=T,k=h(_,E,v);S??(R||x)?u(w,k):d(T,e._`[${k}]`)}a(o,"bd"),t.reportError=o;function s(_,E=t.keywordError,v){let{it:S}=_,{gen:T,compositeRule:w,allErrors:R}=S,x=h(_,E,v);u(T,x),!(w||R)&&d(S,n.default.vErrors)}a(s,"_d"),t.reportExtraError=s;function c(_,E){_.assign(n.default.errors,E),_.if(e._`${n.default.vErrors} !== null`,()=>_.if(E,()=>_.assign(e._`${n.default.vErrors}.length`,E),()=>_.assign(n.default.vErrors,null)))}a(c,"kd"),t.resetErrorsCount=c;function l({gen:_,keyword:E,schemaValue:v,data:S,errsCount:T,it:w}){if(T===void 0)throw Error("ajv implementation error");let R=_.name("err");_.forRange("i",T,n.default.errors,x=>{_.const(R,e._`${n.default.vErrors}[${x}]`),_.if(e._`${R}.instancePath === undefined`,()=>_.assign(e._`${R}.instancePath`,(0,e.strConcat)(n.default.instancePath,w.errorPath))),_.assign(e._`${R}.schemaPath`,e.str`${w.errSchemaPath}/${E}`),w.opts.verbose&&(_.assign(e._`${R}.schema`,v),_.assign(e._`${R}.data`,S))})}a(l,"Sd"),t.extendErrors=l;function u(_,E){let v=_.const("err",E);_.if(e._`${n.default.vErrors} === null`,()=>_.assign(n.default.vErrors,e._`[${v}]`),e._`${n.default.vErrors}.push(${v})`),_.code(e._`${n.default.errors}++`)}a(u,"dj");function d(_,E){let{gen:v,validateName:S,schemaEnv:T}=_;T.$async?v.throw(e._`new ${_.ValidationError}(${E})`):(v.assign(e._`${S}.errors`,E),v.return(!1))}a(d,"ij");var f={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function h(_,E,v){let{createErrors:S}=_.it;return S===!1?e._`{}`:m(_,E,v)}a(h,"nj");function m(_,E,v={}){let{gen:S,it:T}=_,w=[g(T,v),A(_,v)];return y(_,E,w),S.object(...w)}a(m,"vd");function g({errorPath:_},{instancePath:E}){let v=E?e.str`${_}${(0,r.getErrorPath)(E,r.Type.Str)}`:_;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,v)]}a(g,"Cd");function A({keyword:_,it:{errSchemaPath:E}},{schemaPath:v,parentSchema:S}){let T=S?E:e.str`${E}/${_}`;return v&&(T=e.str`${T}${(0,r.getErrorPath)(v,r.Type.Str)}`),[f.schemaPath,T]}a(A,"Td");function y(_,{params:E,message:v},S){let{keyword:T,data:w,schemaValue:R,it:x}=_,{opts:k,propertyName:D,topSchemaRef:N,schemaPath:O}=x;S.push([f.keyword,T],[f.params,typeof E=="function"?E(_):E||e._`{}`]),k.messages&&S.push([f.message,typeof v=="function"?v(_):v]),k.verbose&&S.push([f.schema,R],[f.parentSchema,e._`${N}${O}`],[n.default.data,w]),D&&S.push([f.propertyName,D])}a(y,"xd")}),ZVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=Zkt(),r=Fs(),n=cz(),o={message:"boolean schema is false"};function s(u){let{gen:d,schema:f,validateName:h}=u;f===!1?l(u,!1):typeof f=="object"&&f.$async===!0?d.return(n.default.data):(d.assign(r._`${h}.errors`,null),d.return(!0))}a(s,"pd"),t.topBoolOrEmptySchema=s;function c(u,d){let{gen:f,schema:h}=u;h===!1?(f.var(d,!1),l(u)):f.var(d,!0)}a(c,"dd"),t.boolOrEmptySchema=c;function l(u,d){let{gen:f,data:h}=u,m={gen:f,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(m,o,void 0,d)}a(l,"tj")}),Uoo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;var e=["string","number","integer","boolean","null","object","array"],r=new Set(e);function n(s){return typeof s=="string"&&r.has(s)}a(n,"od"),t.isJSONType=n;function o(){let s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}a(o,"td"),t.getRules=o}),Qoo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function e({schema:o,self:s},c){let l=s.RULES.types[c];return l&&l!==!0&&r(o,l)}a(e,"sd"),t.schemaHasRulesForType=e;function r(o,s){return s.rules.some(c=>n(o,c))}a(r,"JA"),t.shouldUseGroup=r;function n(o,s){var c;return o[s.keyword]!==void 0||((c=s.definition.implements)===null||c===void 0?void 0:c.some(l=>o[l]!==void 0))}a(n,"XA"),t.shouldUseRule=n}),PRt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;var e=Uoo(),r=Qoo(),n=Zkt(),o=Fs(),s=Sc(),c;(function(S){S[S.Correct=0]="Correct",S[S.Wrong=1]="Wrong"})(c||(t.DataType=c={}));function l(S){let T=u(S.type);if(T.includes("null")){if(S.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!T.length&&S.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');S.nullable===!0&&T.push("null")}return T}a(l,"Yi"),t.getSchemaTypes=l;function u(S){let T=Array.isArray(S)?S:S?[S]:[];if(T.every(e.isJSONType))return T;throw Error("type must be JSONType or JSONType[]: "+T.join(","))}a(u,"UA"),t.getJSONTypes=u;function d(S,T){let{gen:w,data:R,opts:x}=S,k=h(T,x.coerceTypes),D=T.length>0&&!(k.length===0&&T.length===1&&(0,r.schemaHasRulesForType)(S,T[0]));if(D){let N=y(T,R,x.strictNumbers,c.Wrong);w.if(N,()=>{k.length?m(S,T,k):E(S)})}return D}a(d,"Wi"),t.coerceAndCheckDataType=d;var f=new Set(["string","number","integer","boolean","null"]);function h(S,T){return T?S.filter(w=>f.has(w)||T==="array"&&w==="array"):[]}a(h,"Gi");function m(S,T,w){let{gen:R,data:x,opts:k}=S,D=R.let("dataType",o._`typeof ${x}`),N=R.let("coerced",o._`undefined`);k.coerceTypes==="array"&&R.if(o._`${D} == 'object' && Array.isArray(${x}) && ${x}.length == 1`,()=>R.assign(x,o._`${x}[0]`).assign(D,o._`typeof ${x}`).if(y(T,x,k.strictNumbers),()=>R.assign(N,x))),R.if(o._`${N} !== undefined`);for(let B of w)(f.has(B)||B==="array"&&k.coerceTypes==="array")&&O(B);R.else(),E(S),R.endIf(),R.if(o._`${N} !== undefined`,()=>{R.assign(x,N),g(S,N)});function O(B){switch(B){case"string":R.elseIf(o._`${D} == "number" || ${D} == "boolean"`).assign(N,o._`"" + ${x}`).elseIf(o._`${x} === null`).assign(N,o._`""`);return;case"number":R.elseIf(o._`${D} == "boolean" || ${x} === null +`}function woo(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function _qr(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function Lfl(t,e){let r=apo(e.dir),n=IUe(r),o=e.offset??0,s=e.limit;if(t.listSessionSummaries){let u=await t.listSessionSummaries(n),d=t.listSessions?new Map((await t.listSessions(n)).map(g=>[g.sessionId,g])):void 0,f=[];for(let g of u){let A=d?.get(g.sessionId);if(d&&!A)continue;let y=A!==void 0&&g.mtimeA.sessionId));for(let[A,y]of d)g.has(A)||f.push({sessionId:A,mtime:y.mtime})}else hu("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=woo(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await Roo(t,m,e.dir,r),A=new Map(g.map(y=>[y.sessionId,y]));for(let y of h)y.info===void 0&&(y.info=A.get(y.sessionId)??null)}return h.flatMap(g=>g.info?[g.info]:[])}if(!t.listSessions)throw Error("sessionStore.listSessions is not implemented -- cannot list sessions. Provide a store with a listSessions() method.");let c=(await t.listSessions(n)).slice().sort((u,d)=>d.mtime-u.mtime),l=woo(c,s,o);return Roo(t,l,e.dir,r)}async function Roo(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await upo(t,o.sessionId,r);if(!s)return null;let c=hPt(o.sessionId,lpo(s,o.mtime),n);return c?{...c,lastModified:o.mtime}:null}))).flatMap((o,s)=>{let c=e[s];return o.status==="fulfilled"?o.value?[o.value]:[]:[{sessionId:c.sessionId,summary:"",lastModified:c.mtime}]})}function lpo(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,k9).toString("utf-8"),s=n>k9?r.subarray(n-k9).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function Bfl(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` +`)+1);try{let n=CM(r);if(typeof n=="object"&&n!==null&&"timestamp"in n&&typeof n.timestamp=="string"){let o=Date.parse(n.timestamp);if(!Number.isNaN(o))return o}}catch{}return Date.now()}async function upo(t,e,r){let n=Zk(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:cpo(o)}async function Ffl(t,e,r){if(!Uh(e))return[];let n=Zk(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:ltl(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function Ufl(t,e,r){if(!Uh(e))return;let n=await upo(t,e,r.dir);if(!n)return;let o=lpo(n,Bfl(n));return hPt(e,o)??void 0}async function Qfl(t,e,r,n){if(!Uh(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=Zk(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,nPt.randomUUID)(),timestamp:new Date().toISOString()}])}async function qfl(t,e,r,n){if(!Uh(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=G6e(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=Zk(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,nPt.randomUUID)(),timestamp:new Date().toISOString()}])}async function jfl(t,e,r){if(!Uh(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!Uh(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=Zk(r.dir),o=await t.load({projectKey:n,sessionId:e});if(!o||o.length===0)throw Error(`Session ${e} not found`);let{entries:s,forkedSessionId:c}=Rtl(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function Hfl(t,e,r){if(!Uh(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=Zk(r),o=await t.listSubkeys({projectKey:n,sessionId:e}),s=new Set;for(let c of o){if(!c.startsWith("subagents/"))continue;let l=c.split("/").at(-1);l.startsWith("agent-")&&s.add(l.slice(6))}return[...s]}async function Gfl(t,e,r,n){if(!Uh(e))return[];if(!r)return[];let o=Zk(n.dir),s=`subagents/agent-${r}`;if(t.listSubkeys){let f=await t.listSubkeys({projectKey:o,sessionId:e}),h=`agent-${r}`,m=f.find(g=>g.startsWith("subagents/")&&g.split("/").at(-1)===h);if(!m)return[];s=m}let c=await t.load({projectKey:o,sessionId:e,subpath:s});if(!c||c.length===0)return[];let l=c.findLast(_qr),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!_qr(f));return d.length===0?[]:Oao(Buffer.from(cpo(d)),{limit:n.limit,offset:n.offset},u)}function koo(t,e){let r=(0,Cc.relative)(e,t),n=r.split(Cc.sep);if(n[0]===".."||(0,Cc.isAbsolute)(r)||n.length<2)return null;let o=n[0],s=n[1];if(n.length===2&&s.endsWith(".jsonl"))return{projectKey:o,sessionId:s.replace(/\.jsonl$/,"")};if(n.length>=4){let c=n.slice(2),l=c.length-1;return c[l]=c.at(-1).replace(/\.jsonl$/,""),{projectKey:o,sessionId:s,subpath:c.join("/")}}return null}var Poo,Yoo,nPt,iPt,SE,Koo,qCe,Cc,Joo,Zoo,Xoo,tso,rso,nso,lso,uso,qso,yQr,jso,yA,Hso,SB,vQr,nao,fkt,IE,rse,bo,e0,oao,TB,pao,gao,PQr,Aao,AM,VCe,yao,_ao,Eao,vao,ybe,_be,NQr,IB,Voe,U6e,ykt,tUe,_kt,Lao,Bao,pfo,Woe,hfo,gf,sGr,qkt,vfo,Cfo,cGr,lqr,Qfo,jfo,Hfo,Vy,Zfo,fVc,pVc,nQr,hVc,mVc,AVc,yVc,Eqr,jt,_Vc,RB,vVc,CVc,bVc,pf,hf,SVc,TVc,IVc,Doo,xVc,lbe,wVc,vqr,RVc,ube,kVc,PVc,Noo,Jkt,DVc,Moo,NVc,Ooo,MVc,Zkt,Loo,Cqr,bqr,Boo,Sqr,Foo,Uoo,OVc,Qoo,LVc,BVc,FVc,UVc,QVc,qVc,jVc,HVc,GVc,$Vc,VVc,WVc,zVc,YVc,KVc,JVc,ZVc,XVc,PRt,Sno,Fs,Sc,lz,Xkt,eWc,qoo,joo,DRt,tWc,vM,rWc,nWc,Hoo,iWc,ePt,tPt,Tqr,rPt,Iqr,oWc,Goo,sWc,aWc,cWc,lWc,uWc,dWc,fWc,pWc,hWc,mWc,gWc,AWc,yWc,_Wc,EWc,xqr,vWc,CWc,bWc,SWc,$oo,Voo,TWc,IWc,xWc,wWc,RWc,Woo,kWc,PWc,DWc,NWc,MWc,OWc,LWc,BWc,FWc,UWc,QWc,qWc,jWc,HWc,GWc,$Wc,zoo,VWc,WWc,zWc,YWc,oPt,JWc,ZWc,XWc,ezc,tzc,oQr,e1,szc,sso,azc,czc,dbe,lzc,iz,aso,uzc,dzc,f6e,pzc,hzc,mzc,Azc,yzc,_zc,Tno,CUe,N9,Czc,bzc,Szc,Tzc,Rqr,xzc,T7r,Ino,Rzc,kzc,Pzc,Nzc,Mzc,Ozc,Lzc,Bzc,Fzc,Uzc,Qzc,jzc,Gzc,kqr,Vzc,V6e,zzc,Kzc,Jzc,Zzc,Xzc,tYc,rYc,nYc,oYc,sYc,cYc,xno,uYc,sPt,aPt,pYc,hYc,gYc,yYc,EYc,CYc,cPt,bYc,cso,TYc,xYc,lPt,kYc,DYc,MYc,LYc,Pqr,BYc,Wy,mbe,vfm,dso,sQr,Ni,AC,nx,jCe,NRt,MRt,ORt,LRt,BRt,FRt,URt,QRt,qRt,FYc,UYc,aQr,wno,qYc,fso,jYc,XW,HYc,$Yc,kno,Pno,Dno,Nqr,YYc,JYc,ZYc,mso,jRt,XYc,eKc,Oqr,tKc,Nno,I7r,rKc,mu,lQr,pu,Mno,Ono,HRt,Bno,oKc,Fno,Qoe,Eso,sKc,aKc,cKc,Bqr,lKc,Cso,ex,tx,zoe,p6e,Yoe,uQr,M6e,GRt,cRt,$Rt,dQr,Koe,TE,Iso,xso,Fqr,Qno,bKc,SKc,fQr,wso,TKc,IKc,Bd,Rso,_r,qno,kKc,Yn,VRt,j6e,WRt,zRt,YRt,KRt,z6e,JRt,ZRt,HCe,XRt,ekt,Nso,NKc,PCe,MKc,OKc,Lso,Qk,VW,SCe,h6e,lRt,m6e,g6e,uRt,A6e,S9,y6e,dRt,fRt,Loe,pRt,hRt,_6e,x7r,Hno,mRt,w7r,R7r,k7r,Gno,$no,hQr,tkt,LKc,BKc,E6e,TCe,Boe,Kg,XS,XI,R9,WW,v6e,Wno,mQr,rkt,Yno,UKc,Joe,nkt,ikt,GCe,okt,Y6e,skt,K6e,t1,akt,qk,zW,ICe,C6e,gRt,b6e,S6e,ARt,T6e,T9,I6e,yRt,_Rt,Foe,ERt,vRt,x6e,P7r,Zno,D7r,N7r,M7r,O7r,Xno,eio,gQr,ckt,J6e,rio,qKc,lkt,AQr,Uqr,RRt,Uso,jKc,HKc,Hp,$Ce,$Kc,VKc,_Qr,zKc,Goe,xCe,JKc,XKc,tJc,nJc,iJc,sJc,aJc,cJc,dkt,Qqr,uJc,dJc,$so,hJc,gJc,Abe,yJc,nio,Vso,EJc,vJc,CJc,Z6e,bJc,oz,O6e,TJc,Wso,iio,IJc,oio,xJc,wJc,qqr,RJc,kJc,uPt,DJc,jqr,MJc,OJc,LJc,BJc,FJc,UJc,QJc,qJc,jJc,HJc,GJc,$Jc,VJc,WJc,zJc,YJc,KJc,JJc,ZJc,XJc,eZc,tZc,rZc,nZc,Od,oZc,aZc,L6e,zso,H6e,cZc,L7r,lZc,EQr,sio,uZc,Yso,dZc,fZc,hZc,mZc,Kso,yZc,Hqr,vZc,CZc,bZc,TZc,Jso,B6e,Zso,aio,xZc,cio,lio,Xso,kZc,DZc,NZc,eao,MZc,uio,LZc,FZc,dio,UZc,QZc,jZc,HZc,Gqr,$Zc,VZc,zZc,YZc,JZc,ZZc,XZc,eXc,tXc,nXc,iXc,fio,pio,oXc,aXc,dPt,lXc,$qr,fXc,hXc,gXc,yXc,rao,Vqr,pkt,SXc,Wqr,xXc,kXc,DXc,NXc,MXc,Cfm,OXc,bfm,LXc,Sfm,BXc,Tfm,FXc,Ifm,CQr,qXc,HXc,KXc,JXc,xfm,wfm,nel,mio,gio,iel,oel,Aio,bQr,cel,lel,SQr,uel,aao,cao,fel,pel,CRt,B7r,w6e,F7r,TQr,fao,Rfm,gel,mf,CM,vel,hkt,yio,xQr,wCe,mkt,Rel,wQr,RQr,Kqr,Jqr,Pel,kQr,_io,U7r,Mel,Fel,k9,Qel,X6e,Gel,$el,Vel,Akt,zel,eUe,Yel,Kel,dtl,Stl,Ltl,Qao,Btl,Ftl,Utl,Pfm,Eio,Qtl,jtl,Gtl,Vtl,bc,vio,Dn,JW,yr,Wk,ztl,rUe,Ytl,OQr,yC,io,Q6e,r1,Cio,bio,WCe,Ekt,ei,Yk,Sio,Us,Ktl,Jtl,Ztl,Xtl,erl,trl,rrl,nrl,irl,H7r,orl,srl,arl,crl,lrl,url,qao,drl,zCe,nUe,iUe,oUe,sUe,aUe,YCe,KCe,cUe,nz,xB,lUe,az,sx,JCe,x9,LQr,ZCe,M9,FQr,uUe,dUe,UQr,XCe,ebe,tbe,rbe,Zoe,yM,zk,O9,nbe,ibe,fUe,vkt,Ckt,obe,Dfm,wr,Nfm,Mfm,Ofm,Lfm,Bfm,Ffm,Ufm,Qfm,qfm,jfm,Hfm,Gfm,$fm,Vfm,yrl,Wfm,zfm,Yfm,Kfm,Jfm,Zfm,Xfm,epm,tpm,rpm,npm,ipm,opm,spm,apm,cpm,lpm,upm,dpm,Gao,$ao,Vao,cz,bkt,Xs,ejr,Yao,wrl,Skt,Kao,Zao,Xao,QQr,tco,tjr,wUe,ijr,Tkt,ojr,Ikt,sjr,_Pt,ajr,EPt,cjr,oco,sco,aco,cco,lco,uco,dco,Brl,fco,sbe,Frl,Url,Qrl,pco,qrl,jrl,Hrl,Grl,$rl,mco,gco,Aco,yco,_co,ljr,Eco,Vrl,vco,Cco,bco,xco,wco,Rco,kco,Pco,Dco,Nco,Mco,Oco,Qh,Lco,ujr,djr,Bco,Fco,Uco,Qco,qco,jco,Hco,Gco,$co,RUe,Vco,Wco,zco,Yco,Kco,Jco,Zco,Xco,elo,xkt,tlo,So,kUe,Wu,rlo,nlo,ilo,olo,slo,alo,clo,llo,ulo,dlo,flo,plo,hlo,mlo,glo,Alo,ylo,_lo,Elo,vlo,blo,Slo,Ilo,xlo,pjr,wlo,hjr,mjr,Rlo,klo,Plo,Dlo,Nlo,wkt,Mlo,Olo,Llo,gjr,Ajr,yjr,Blo,Flo,vPt,Ulo,Qlo,qlo,jlo,Hlo,Glo,_jr,$lo,Vlo,Wlo,zlo,Ylo,Klo,Jlo,Zlo,Ejr,Xlo,euo,tuo,ruo,nuo,vjr,Wrl,Yrl,Jrl,Xrl,tnl,nnl,onl,snl,anl,cnl,unl,fnl,hnl,gnl,ynl,Enl,Cnl,Snl,Inl,wnl,knl,Dnl,Mnl,Lnl,Fnl,Qnl,jnl,Gnl,Vnl,znl,Knl,Znl,eil,ril,iil,sil,ail,lil,dil,pil,mil,Ail,ouo,suo,mUe,P9,luo,Pkt,yUe,Qil,qil,jil,G,iHr,oHr,sHr,aHr,cHr,Xuo,$il,DUe,edo,tdo,rdo,ndo,Qs,lHr,TPt,Fd,uHr,Dkt,D9,dHr,fHr,pHr,hHr,mHr,gHr,AHr,yHr,_Hr,EHr,vHr,CHr,bHr,SHr,THr,IHr,ido,IPt,Ebe,xPt,wPt,xHr,odo,sdo,ado,cdo,ldo,udo,ddo,RHr,fdo,kPt,kHr,pdo,hdo,mdo,DHr,gdo,Ado,_Ue,ydo,_do,NHr,OHr,Edo,vdo,bdo,LHr,Ido,xdo,Rdo,BHr,kdo,Ddo,Ndo,Odo,DPt,qol,Hol,Qdo,Jol,qdo,jdo,Zol,qoe,NPt,Xg,Hdo,Gdo,fpm,Xol,esl,UHr,ax,NUe,tsl,zy,Kk,Jk,Yy,MPt,$do,Qio,Vdo,rsl,QHr,TRt,Qi,qHr,nsl,ppm,hpm,jHr,isl,HHr,osl,MUe,cbe,Wdo,ssl,asl,csl,lsl,usl,dsl,zdo,fsl,psl,Ydo,GHr,hsl,msl,$Hr,gsl,OUe,LUe,Asl,BUe,OPt,ysl,Okt,VHr,WHr,zHr,mpm,YHr,KHr,JHr,_sl,Kdo,Jdo,ZHr,Zdo,FUe,vbe,Xdo,Esl,HQr,vsl,GQr,Csl,XHr,bsl,$Qr,Ssl,Tsl,Isl,xsl,wsl,Rsl,ksl,Psl,Dsl,Nsl,VQr,Msl,Osl,WQr,eGr,tGr,rGr,Lsl,Bsl,Fsl,nGr,Usl,Qsl,qsl,jsl,Hsl,efo,zQr,Gsl,iGr,gpm,$sl,Lkt,Vsl,Apm,Bkt,Wsl,tfo,zsl,Ysl,Ksl,Jsl,Zsl,Xsl,eal,Fkt,tal,ral,nal,oGr,rfo,ial,oal,sal,aal,cal,lal,ual,dal,fal,pal,hal,mal,gal,Aal,yal,_al,Eal,val,Ukt,Cal,bal,Sal,YQr,xal,wal,Ral,nfo,kal,ypm,_pm,Epm,vpm,Cpm,bpm,mi,KQr,Pal,qio,Dal,Nal,ofo,Bal,Fal,jal,V7r,pM,$al,Qkt,Hio,ncl,icl,ucl,dcl,fcl,pcl,hcl,gcl,JQr,ycl,_cl,ZQr,XQr,eqr,ufo,Yio,Scl,tqr,rqr,xcl,k6e,Xio,Dcl,Gk,iqr,too,Spm,Tpm,roo,noo,ioo,ooo,ez,aGr,OCe,Ucl,Qcl,qcl,Ipm,$cl,z7r,Wcl,soo,xpm,RCe,Afo,sqr,yfo,jkt,aoo,zcl,KW,_fo,UCe,aqr,cqr,Kcl,coo,BPt,FPt,Rpm,kpm,Ppm,EUe,Dpm,Jcl,Zcl,Xcl,ell,tll,rll,nll,ill,Npm,lGr,oll,sll,Mpm,Opm,all,P6e,lll,ull,Hkt,Lpm,Bpm,Cbe,dz,dll,fll,bfo,pll,hll,mll,gll,All,yll,_ll,Ell,uqr,Fpm,Sfo,vll,Cll,EM,tse,loo,dqr,fqr,Tfo,uGr,Sll,Upm,Tll,Ill,xll,wll,Rll,Ifo,xfo,kll,uoo,Pll,Dll,wfo,Nll,Mll,doo,Oll,Lll,Rfo,Bll,kfo,Fll,Ull,Qll,Gkt,Y7r,Pfo,qll,jll,Hll,Gll,$ll,Qpm,Dfo,Wll,zll,Yll,Kll,Jll,Zll,Xll,qpm,eul,jpm,tul,rul,nul,IRt,UPt,foo,Mfo,Hpm,Gpm,$kt,J7r,gul,$pm,Aul,Ffo,Ufo,yul,poo,bbe,w9,Eul,vul,Vpm,Tul,xul,yoo,pqr,hqr,LCe,Rul,kul,Pul,_oo,Vkt,Nul,ZW,Gfo,$fo,Vfo,Wkt,mqr,Vul,Wul,zul,Kul,Jul,Zul,Xul,Wfo,edl,tdl,ndl,gqr,sdl,cdl,ldl,ddl,boo,Yfo,hdl,mdl,gdl,Adl,ydl,_dl,vdl,Cdl,Kfo,Sdl,Idl,wdl,Rdl,tz,Pdl,Ndl,Odl,Soo,Bdl,Fdl,Qdl,jdl,Hdl,X7r,Gdl,eQr,$dl,rQr,dfl,Ioo,ffl,pfl,hfl,vfl,fpo=Se(()=>{p();Poo=require("node:module"),Yoo=require("child_process"),nPt=require("crypto"),iPt=require("fs"),SE=require("fs/promises"),Koo=require("module"),qCe=require("os"),Cc=require("path"),Joo=require("readline"),Zoo=require("url"),Xoo=require("events"),tso=require("child_process"),rso=require("fs"),nso=require("readline"),lso=require("os"),uso=require("path"),qso=require("crypto"),yQr=require("path"),jso=require("async_hooks"),yA=require("fs/promises"),Hso=require("crypto"),SB=require("fs/promises"),vQr=require("fs"),nao=require("process"),fkt=require("crypto"),IE=require("fs/promises"),rse=require("path"),bo=fe(require("fs"),1),e0=require("fs/promises"),oao=require("fs"),TB=require("path"),pao=require("fs"),gao=require("fs/promises"),PQr=require("events"),Aao=require("fs"),AM=require("fs/promises"),VCe=require("path"),yao=require("child_process"),_ao=require("util"),Eao=require("child_process"),vao=require("path"),ybe=require("fs/promises"),_be=require("path"),NQr=require("fs"),IB=require("fs/promises"),Voe=require("path"),U6e=require("crypto"),ykt=require("path"),tUe=require("fs/promises"),_kt=require("path"),Lao=require("crypto"),Bao=require("os"),pfo=require("path"),Woe=require("path"),hfo=require("path"),gf=fe(require("node:path"),1),sGr=fe(require("node:os"),1),qkt=fe(require("node:process"),1),vfo=require("path"),Cfo=require("fs/promises"),cGr=require("os"),lqr=require("path"),Qfo=require("os"),jfo=require("child_process"),Hfo=require("fs"),Vy=require("path"),Zfo=require("path"),fVc=Object.create,{getPrototypeOf:pVc,defineProperty:nQr,getOwnPropertyNames:hVc}=Object,mVc=Object.prototype.hasOwnProperty;a(gVc,"a_");Eqr=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?AVc??=new WeakMap:yVc??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?fVc(pVc(t)):{};let c=e||!t||!t.__esModule?nQr(r,"default",{value:t,enumerable:!0}):r;for(let l of hVc(t))mVc.call(c,l)||nQr(c,l,{get:gVc.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),jt=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),_Vc=a(t=>t,"$k");a(EVc,"Qk");RB=a((t,e)=>{for(var r in e)nQr(t,r,{get:e[r],enumerable:!0,configurable:!0,set:EVc.bind(e,r)})},"M4"),vVc=(0,Poo.createRequire)(importMetaUrlShim),CVc=Symbol.dispose||Symbol.for("Symbol.dispose"),bVc=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),pf=a((t,e,r)=>{if(e!=null){if(typeof e!="object"&&typeof e!="function")throw TypeError('Object expected to be assigned to "using" declaration');var n;if(r&&(n=e[bVc]),n===void 0&&(n=e[CVc]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),hf=a((t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=a(c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),"X"),s=a(c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e},"W");return s()},"M$"),SVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),TVc=jt(t=>{var e=t&&t.__createBinding||(Object.create?function(n,o,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:a(function(){return o[s]},"get")})}:function(n,o,s,c){c===void 0&&(c=s),n[c]=o[s]}),r=t&&t.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(SVc(),t)}),IVc=jt(t=>{var e=t&&t.__createBinding||(Object.create?function(n,o,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:a(function(){return o[s]},"get")})}:function(n,o,s,c){c===void 0&&(c=s),n[c]=o[s]}),r=t&&t.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(TVc(),t)}),Doo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),xVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=Doo(),r=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function n(o){let s=new Set([o]),c=new Set,l=o.match(r);if(!l)return()=>!1;let u={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};if(u.prerelease!=null)return function(h){return h===o};function d(h){return c.add(h),!1}a(d,"W");function f(h){return s.add(h),!0}return a(f,"G"),function(h){if(s.has(h))return!0;if(c.has(h))return!1;let m=h.match(r);if(!m)return d(h);let g={major:+m[1],minor:+m[2],patch:+m[3],prerelease:m[4]};return g.prerelease!=null||u.major!==g.major?d(h):u.major===0?u.minor===g.minor&&u.patch<=g.patch?f(h):d(h):u.minor<=g.minor?f(h):d(h)}}a(n,"b2"),t._makeCompatibilityCheck=n,t.isCompatible=n(e.VERSION)}),lbe=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=IVc(),r=Doo(),n=xVc(),o=r.VERSION.split(".")[0],s=Symbol.for(`opentelemetry.js.api.${o}`),c=e._globalThis;function l(f,h,m,g=!1){var A;let y=c[s]=(A=c[s])!==null&&A!==void 0?A:{version:r.VERSION};if(!g&&y[f]){let _=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${f}`);return m.error(_.stack||_.message),!1}if(y.version!==r.VERSION){let _=Error(`@opentelemetry/api: Registration of version v${y.version} for ${f} does not match previously registered API v${r.VERSION}`);return m.error(_.stack||_.message),!1}return y[f]=h,m.debug(`@opentelemetry/api: Registered a global for ${f} v${r.VERSION}.`),!0}a(l,"ex"),t.registerGlobal=l;function u(f){var h,m;let g=(h=c[s])===null||h===void 0?void 0:h.version;if(!(!g||!(0,n.isCompatible)(g)))return(m=c[s])===null||m===void 0?void 0:m[f]}a(u,"$y"),t.getGlobal=u;function d(f,h){h.debug(`@opentelemetry/api: Unregistering a global for ${f} v${r.VERSION}.`);let m=c[s];m&&delete m[f]}a(d,"Qy"),t.unregisterGlobal=d}),wVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=lbe();class r{static{a(this,"T2")}constructor(s){this._namespace=s.namespace||"DiagComponentLogger"}debug(...s){return n("debug",this._namespace,s)}error(...s){return n("error",this._namespace,s)}info(...s){return n("info",this._namespace,s)}warn(...s){return n("warn",this._namespace,s)}verbose(...s){return n("verbose",this._namespace,s)}}t.DiagComponentLogger=r;function n(o,s,c){let l=(0,e.getGlobal)("diag");if(l)return c.unshift(s),l[o](...c)}a(n,"lQ")}),vqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagLogLevel=void 0;var e;(function(r){r[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"})(e=t.DiagLogLevel||(t.DiagLogLevel={}))}),RVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=vqr();function r(n,o){ne.DiagLogLevel.ALL&&(n=e.DiagLogLevel.ALL),o=o||{};function s(c,l){let u=o[c];return typeof u=="function"&&n>=l?u.bind(o):function(){}}return a(s,"J"),{error:s("error",e.DiagLogLevel.ERROR),warn:s("warn",e.DiagLogLevel.WARN),info:s("info",e.DiagLogLevel.INFO),debug:s("debug",e.DiagLogLevel.DEBUG),verbose:s("verbose",e.DiagLogLevel.VERBOSE)}}a(r,"Gy"),t.createLogLevelDiagLogger=r}),ube=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=wVc(),r=RVc(),n=vqr(),o=lbe(),s="diag";class c{static{a(this,"kU")}constructor(){function u(h){return function(...m){let g=(0,o.getGlobal)("diag");if(g)return g[h](...m)}}a(u,"$");let d=this,f=a((h,m={logLevel:n.DiagLogLevel.INFO})=>{var g,A,y;if(h===d){let v=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return d.error((g=v.stack)!==null&&g!==void 0?g:v.message),!1}typeof m=="number"&&(m={logLevel:m});let _=(0,o.getGlobal)("diag"),E=(0,r.createLogLevelDiagLogger)((A=m.logLevel)!==null&&A!==void 0?A:n.DiagLogLevel.INFO,h);if(_&&!m.suppressOverrideMessage){let v=(y=Error().stack)!==null&&y!==void 0?y:"";_.warn(`Current logger will be overwritten from ${v}`),E.warn(`Current logger will overwrite one already registered from ${v}`)}return(0,o.registerGlobal)("diag",E,d,!0)},"J");d.setLogger=f,d.disable=()=>{(0,o.unregisterGlobal)(s,d)},d.createComponentLogger=h=>new e.DiagComponentLogger(h),d.verbose=u("verbose"),d.debug=u("debug"),d.info=u("info"),d.warn=u("warn"),d.error=u("error")}static instance(){return this._instance||(this._instance=new c),this._instance}}t.DiagAPI=c}),kVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaggageImpl=void 0;class e{static{a(this,"P8")}constructor(n){this._entries=n?new Map(n):new Map}getEntry(n){let o=this._entries.get(n);if(o)return Object.assign({},o)}getAllEntries(){return Array.from(this._entries.entries()).map(([n,o])=>[n,o])}setEntry(n,o){let s=new e(this._entries);return s._entries.set(n,o),s}removeEntry(n){let o=new e(this._entries);return o._entries.delete(n),o}removeEntries(...n){let o=new e(this._entries);for(let s of n)o._entries.delete(s);return o}clear(){return new e}}t.BaggageImpl=e}),PVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),Noo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=ube(),r=kVc(),n=PVc(),o=e.DiagAPI.instance();function s(l={}){return new r.BaggageImpl(new Map(Object.entries(l)))}a(s,"Ny"),t.createBaggage=s;function c(l){return typeof l!="string"&&(o.error(`Cannot create baggage metadata from unknown type: ${typeof l}`),l=""),{__TYPE__:n.baggageEntryMetadataSymbol,toString(){return l}}}a(c,"wy"),t.baggageEntryMetadataFromString=c}),Jkt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ROOT_CONTEXT=t.createContextKey=void 0;function e(n){return Symbol.for(n)}a(e,"Dy"),t.createContextKey=e;class r{static{a(this,"DX")}constructor(o){let s=this;s._currentContext=o?new Map(o):new Map,s.getValue=c=>s._currentContext.get(c),s.setValue=(c,l)=>{let u=new r(s._currentContext);return u._currentContext.set(c,l),u},s.deleteValue=c=>{let l=new r(s._currentContext);return l._currentContext.delete(c),l}}}t.ROOT_CONTEXT=new r}),DVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagConsoleLogger=void 0;var e=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class r{static{a(this,"QD")}constructor(){function o(s){return function(...c){if(console){let l=console[s];if(typeof l!="function"&&(l=console.log),typeof l=="function")return l.apply(console,c)}}}a(o,"$");for(let s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_GAUGE_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopGaugeMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class e{static{a(this,"CU")}constructor(){}createGauge(g,A){return t.NOOP_GAUGE_METRIC}createHistogram(g,A){return t.NOOP_HISTOGRAM_METRIC}createCounter(g,A){return t.NOOP_COUNTER_METRIC}createUpDownCounter(g,A){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(g,A){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(g,A){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(g,A){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(g,A){}removeBatchObservableCallback(g){}}t.NoopMeter=e;class r{static{a(this,"E8")}}t.NoopMetric=r;class n extends r{static{a(this,"TU")}add(g,A){}}t.NoopCounterMetric=n;class o extends r{static{a(this,"xU")}add(g,A){}}t.NoopUpDownCounterMetric=o;class s extends r{static{a(this,"yU")}record(g,A){}}t.NoopGaugeMetric=s;class c extends r{static{a(this,"fU")}record(g,A){}}t.NoopHistogramMetric=c;class l{static{a(this,"pQ")}addCallback(g){}removeCallback(g){}}t.NoopObservableMetric=l;class u extends l{static{a(this,"gU")}}t.NoopObservableCounterMetric=u;class d extends l{static{a(this,"hU")}}t.NoopObservableGaugeMetric=d;class f extends l{static{a(this,"uU")}}t.NoopObservableUpDownCounterMetric=f,t.NOOP_METER=new e,t.NOOP_COUNTER_METRIC=new n,t.NOOP_GAUGE_METRIC=new s,t.NOOP_HISTOGRAM_METRIC=new c,t.NOOP_UP_DOWN_COUNTER_METRIC=new o,t.NOOP_OBSERVABLE_COUNTER_METRIC=new u,t.NOOP_OBSERVABLE_GAUGE_METRIC=new d,t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new f;function h(){return t.NOOP_METER}a(h,"Zy"),t.createNoopMeter=h}),NVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueType=void 0;var e;(function(r){r[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"})(e=t.ValueType||(t.ValueType={}))}),Ooo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTextMapSetter=t.defaultTextMapGetter=void 0,t.defaultTextMapGetter={get(e,r){if(e!=null)return e[r]},keys(e){return e==null?[]:Object.keys(e)}},t.defaultTextMapSetter={set(e,r,n){e!=null&&(e[r]=n)}}}),MVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=Jkt();class r{static{a(this,"ZD")}active(){return e.ROOT_CONTEXT}with(o,s,c,...l){return s.call(c,...l)}bind(o,s){return s}enable(){return this}disable(){return this}}t.NoopContextManager=r}),Zkt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=MVc(),r=lbe(),n=ube(),o="context",s=new e.NoopContextManager;class c{static{a(this,"iU")}constructor(){}static getInstance(){return this._instance||(this._instance=new c),this._instance}setGlobalContextManager(u){return(0,r.registerGlobal)(o,u,n.DiagAPI.instance())}active(){return this._getContextManager().active()}with(u,d,f,...h){return this._getContextManager().with(u,d,f,...h)}bind(u,d){return this._getContextManager().bind(u,d)}_getContextManager(){return(0,r.getGlobal)(o)||s}disable(){this._getContextManager().disable(),(0,r.unregisterGlobal)(o,n.DiagAPI.instance())}}t.ContextAPI=c}),Loo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFlags=void 0;var e;(function(r){r[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"})(e=t.TraceFlags||(t.TraceFlags={}))}),Cqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=Loo();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),bqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=Cqr();class r{static{a(this,"SD")}constructor(o=e.INVALID_SPAN_CONTEXT){this._spanContext=o}spanContext(){return this._spanContext}setAttribute(o,s){return this}setAttributes(o){return this}addEvent(o,s){return this}addLink(o){return this}addLinks(o){return this}setStatus(o){return this}updateName(o){return this}end(o){}isRecording(){return!1}recordException(o,s){}}t.NonRecordingSpan=r}),Boo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=Jkt(),r=bqr(),n=Zkt(),o=(0,e.createContextKey)("OpenTelemetry Context Key SPAN");function s(h){return h.getValue(o)||void 0}a(s,"tU"),t.getSpan=s;function c(){return s(n.ContextAPI.getInstance().active())}a(c,"my"),t.getActiveSpan=c;function l(h,m){return h.setValue(o,m)}a(l,"TD"),t.setSpan=l;function u(h){return h.deleteValue(o)}a(u,"ly"),t.deleteSpan=u;function d(h,m){return l(h,new r.NonRecordingSpan(m))}a(d,"cy"),t.setSpanContext=d;function f(h){var m;return(m=s(h))===null||m===void 0?void 0:m.spanContext()}a(f,"py"),t.getSpanContext=f}),Sqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=Cqr(),r=bqr(),n=/^([0-9a-f]{32})$/i,o=/^[0-9a-f]{16}$/i;function s(d){return n.test(d)&&d!==e.INVALID_TRACEID}a(s,"gD"),t.isValidTraceId=s;function c(d){return o.test(d)&&d!==e.INVALID_SPANID}a(c,"hD"),t.isValidSpanId=c;function l(d){return s(d.traceId)&&c(d.spanId)}a(l,"ey"),t.isSpanContextValid=l;function u(d){return new r.NonRecordingSpan(d)}a(u,"$f"),t.wrapSpanContext=u}),Foo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=Zkt(),r=Boo(),n=bqr(),o=Sqr(),s=e.ContextAPI.getInstance();class c{static{a(this,"cD")}startSpan(d,f,h=s.active()){if(f?.root)return new n.NonRecordingSpan;let m=h&&(0,r.getSpanContext)(h);return l(m)&&(0,o.isSpanContextValid)(m)?new n.NonRecordingSpan(m):new n.NonRecordingSpan}startActiveSpan(d,f,h,m){let g,A,y;if(arguments.length<2)return;arguments.length===2?y=f:arguments.length===3?(g=f,y=h):(g=f,A=h,y=m);let _=A??s.active(),E=this.startSpan(d,g,_),v=(0,r.setSpan)(_,E);return s.with(v,y,void 0,E)}}t.NoopTracer=c;function l(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}a(l,"Gf")}),Uoo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=Foo(),r=new e.NoopTracer;class n{static{a(this,"iD")}constructor(s,c,l,u){this._provider=s,this.name=c,this.version=l,this.options=u}startSpan(s,c,l){return this._getTracer().startSpan(s,c,l)}startActiveSpan(s,c,l,u){let d=this._getTracer();return Reflect.apply(d.startActiveSpan,d,arguments)}_getTracer(){if(this._delegate)return this._delegate;let s=this._provider.getDelegateTracer(this.name,this.version,this.options);return s?(this._delegate=s,this._delegate):r}}t.ProxyTracer=n}),OVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=Foo();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),Qoo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=Uoo(),r=OVc(),n=new r.NoopTracerProvider;class o{static{a(this,"eD")}getTracer(c,l,u){var d;return(d=this.getDelegateTracer(c,l,u))!==null&&d!==void 0?d:new e.ProxyTracer(this,c,l,u)}getDelegate(){var c;return(c=this._delegate)!==null&&c!==void 0?c:n}setDelegate(c){this._delegate=c}getDelegateTracer(c,l,u){var d;return(d=this._delegate)===null||d===void 0?void 0:d.getTracer(c,l,u)}}t.ProxyTracerProvider=o}),LVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SamplingDecision=void 0;var e;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(e=t.SamplingDecision||(t.SamplingDecision={}))}),BVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanKind=void 0;var e;(function(r){r[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"})(e=t.SpanKind||(t.SpanKind={}))}),FVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanStatusCode=void 0;var e;(function(r){r[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"})(e=t.SpanStatusCode||(t.SpanStatusCode={}))}),UVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateValue=t.validateKey=void 0;var e="[_0-9a-z-*/]",r=`[a-z]${e}{0,255}`,n=`[a-z0-9]${e}{0,240}@[a-z]${e}{0,13}`,o=new RegExp(`^(?:${r}|${n})$`),s=/^[ -~]{0,255}[!-~]$/,c=/,|=/;function l(d){return o.test(d)}a(l,"Lf"),t.validateKey=l;function u(d){return s.test(d)&&!c.test(d)}a(u,"jf"),t.validateValue=u}),QVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=UVc(),r=32,n=512,o=",",s="=";class c{static{a(this,"UH")}constructor(u){this._internalState=new Map,u&&this._parse(u)}set(u,d){let f=this._clone();return f._internalState.has(u)&&f._internalState.delete(u),f._internalState.set(u,d),f}unset(u){let d=this._clone();return d._internalState.delete(u),d}get(u){return this._internalState.get(u)}serialize(){return this._keys().reduce((u,d)=>(u.push(d+s+this.get(d)),u),[]).join(o)}_parse(u){u.length>n||(this._internalState=u.split(o).reverse().reduce((d,f)=>{let h=f.trim(),m=h.indexOf(s);if(m!==-1){let g=h.slice(0,m),A=h.slice(m+1,f.length);(0,e.validateKey)(g)&&(0,e.validateValue)(A)&&d.set(g,A)}return d},new Map),this._internalState.size>r&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,r))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let u=new c;return u._internalState=new Map(this._internalState),u}}t.TraceStateImpl=c}),qVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=QVc();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),jVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=Zkt();t.context=e.ContextAPI.getInstance()}),HVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=ube();t.diag=e.DiagAPI.instance()}),GVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=Moo();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),$Vc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=GVc(),r=lbe(),n=ube(),o="metrics";class s{static{a(this,"VH")}constructor(){}static getInstance(){return this._instance||(this._instance=new s),this._instance}setGlobalMeterProvider(l){return(0,r.registerGlobal)(o,l,n.DiagAPI.instance())}getMeterProvider(){return(0,r.getGlobal)(o)||e.NOOP_METER_PROVIDER}getMeter(l,u,d){return this.getMeterProvider().getMeter(l,u,d)}disable(){(0,r.unregisterGlobal)(o,n.DiagAPI.instance())}}t.MetricsAPI=s}),VVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=$Vc();t.metrics=e.MetricsAPI.getInstance()}),WVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTextMapPropagator=void 0;class e{static{a(this,"fF")}inject(n,o){}extract(n,o){return n}fields(){return[]}}t.NoopTextMapPropagator=e}),zVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=Zkt(),r=Jkt(),n=(0,r.createContextKey)("OpenTelemetry Baggage Key");function o(u){return u.getValue(n)||void 0}a(o,"mF"),t.getBaggage=o;function s(){return o(e.ContextAPI.getInstance().active())}a(s,"xf"),t.getActiveBaggage=s;function c(u,d){return u.setValue(n,d)}a(c,"yf"),t.setBaggage=c;function l(u){return u.deleteValue(n)}a(l,"ff"),t.deleteBaggage=l}),YVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=lbe(),r=WVc(),n=Ooo(),o=zVc(),s=Noo(),c=ube(),l="propagation",u=new r.NoopTextMapPropagator;class d{static{a(this,"wH")}constructor(){this.createBaggage=s.createBaggage,this.getBaggage=o.getBaggage,this.getActiveBaggage=o.getActiveBaggage,this.setBaggage=o.setBaggage,this.deleteBaggage=o.deleteBaggage}static getInstance(){return this._instance||(this._instance=new d),this._instance}setGlobalPropagator(h){return(0,e.registerGlobal)(l,h,c.DiagAPI.instance())}inject(h,m,g=n.defaultTextMapSetter){return this._getGlobalPropagator().inject(h,m,g)}extract(h,m,g=n.defaultTextMapGetter){return this._getGlobalPropagator().extract(h,m,g)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,e.unregisterGlobal)(l,c.DiagAPI.instance())}_getGlobalPropagator(){return(0,e.getGlobal)(l)||u}}t.PropagationAPI=d}),KVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=YVc();t.propagation=e.PropagationAPI.getInstance()}),JVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=lbe(),r=Qoo(),n=Sqr(),o=Boo(),s=ube(),c="trace";class l{static{a(this,"FH")}constructor(){this._proxyTracerProvider=new r.ProxyTracerProvider,this.wrapSpanContext=n.wrapSpanContext,this.isSpanContextValid=n.isSpanContextValid,this.deleteSpan=o.deleteSpan,this.getSpan=o.getSpan,this.getActiveSpan=o.getActiveSpan,this.getSpanContext=o.getSpanContext,this.setSpan=o.setSpan,this.setSpanContext=o.setSpanContext}static getInstance(){return this._instance||(this._instance=new l),this._instance}setGlobalTracerProvider(d){let f=(0,e.registerGlobal)(c,this._proxyTracerProvider,s.DiagAPI.instance());return f&&this._proxyTracerProvider.setDelegate(d),f}getTracerProvider(){return(0,e.getGlobal)(c)||this._proxyTracerProvider}getTracer(d,f){return this.getTracerProvider().getTracer(d,f)}disable(){(0,e.unregisterGlobal)(c,s.DiagAPI.instance()),this._proxyTracerProvider=new r.ProxyTracerProvider}}t.TraceAPI=l}),ZVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=JVc();t.trace=e.TraceAPI.getInstance()}),XVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=t.propagation=t.metrics=t.diag=t.context=t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=t.isValidSpanId=t.isValidTraceId=t.isSpanContextValid=t.createTraceState=t.TraceFlags=t.SpanStatusCode=t.SpanKind=t.SamplingDecision=t.ProxyTracerProvider=t.ProxyTracer=t.defaultTextMapSetter=t.defaultTextMapGetter=t.ValueType=t.createNoopMeter=t.DiagLogLevel=t.DiagConsoleLogger=t.ROOT_CONTEXT=t.createContextKey=t.baggageEntryMetadataFromString=void 0;var e=Noo();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=Jkt();Object.defineProperty(t,"createContextKey",{enumerable:!0,get:a(function(){return r.createContextKey},"get")}),Object.defineProperty(t,"ROOT_CONTEXT",{enumerable:!0,get:a(function(){return r.ROOT_CONTEXT},"get")});var n=DVc();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=vqr();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=Moo();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=NVc();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=Ooo();Object.defineProperty(t,"defaultTextMapGetter",{enumerable:!0,get:a(function(){return l.defaultTextMapGetter},"get")}),Object.defineProperty(t,"defaultTextMapSetter",{enumerable:!0,get:a(function(){return l.defaultTextMapSetter},"get")});var u=Uoo();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=Qoo();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=LVc();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=BVc();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=FVc();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=Loo();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=qVc();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=Sqr();Object.defineProperty(t,"isSpanContextValid",{enumerable:!0,get:a(function(){return y.isSpanContextValid},"get")}),Object.defineProperty(t,"isValidTraceId",{enumerable:!0,get:a(function(){return y.isValidTraceId},"get")}),Object.defineProperty(t,"isValidSpanId",{enumerable:!0,get:a(function(){return y.isValidSpanId},"get")});var _=Cqr();Object.defineProperty(t,"INVALID_SPANID",{enumerable:!0,get:a(function(){return _.INVALID_SPANID},"get")}),Object.defineProperty(t,"INVALID_TRACEID",{enumerable:!0,get:a(function(){return _.INVALID_TRACEID},"get")}),Object.defineProperty(t,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:a(function(){return _.INVALID_SPAN_CONTEXT},"get")});var E=jVc();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return E.context},"get")});var v=HVc();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var S=VVc();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return S.metrics},"get")});var T=KVc();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=ZVc();Object.defineProperty(t,"trace",{enumerable:!0,get:a(function(){return w.trace},"get")}),t.default={context:E.context,diag:v.diag,metrics:S.metrics,propagation:T.propagation,trace:w.trace}}),PRt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{static{a(this,"BW")}}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{static{a(this,"K9")}constructor(v){if(super(),!t.IDENTIFIER.test(v))throw Error("CodeGen: name must be a valid identifier");this.str=v}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{static{a(this,"B4")}constructor(v){super(),this._items=typeof v=="string"?[v]:v}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let v=this._items[0];return v===""||v==='""'}get str(){var v;return(v=this._str)!==null&&v!==void 0?v:this._str=this._items.reduce((S,T)=>`${S}${T}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((S,T)=>(T instanceof r&&(S[T.str]=(S[T.str]||0)+1),S),{})}}t._Code=n,t.nil=new n("");function o(E,...v){let S=[E[0]],T=0;for(;T{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;var e=PRt();class r extends Error{static{a(this,"Dj")}constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(t.UsedValueState=n={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class o{static{a(this,"KB")}constructor({prefixes:d,parent:f}={}){this._names={},this._prefixes=d,this._parent=f}toName(d){return d instanceof e.Name?d:this.name(d)}name(d){return new e.Name(this._newName(d))}_newName(d){let f=this._names[d]||this._nameGroup(d);return`${d}${f.index++}`}_nameGroup(d){var f,h;if(!((h=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||h===void 0)&&h.has(d)||this._prefixes&&!this._prefixes.has(d))throw Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}t.Scope=o;class s extends e.Name{static{a(this,"qB")}constructor(d,f){super(f),this.prefix=d}setValue(d,{property:f,itemIndex:h}){this.value=d,this.scopePath=e._`.${new e.Name(f)}[${h}]`}}t.ValueScopeName=s;var c=e._`\n`;class l extends o{static{a(this,"Fj")}constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?c:e.nil}}get(){return this._scope}name(d){return new s(d,this._newName(d))}value(d,f){var h;if(f.ref===void 0)throw Error("CodeGen: ref must be passed in value");let m=this.toName(d),{prefix:g}=m,A=(h=f.key)!==null&&h!==void 0?h:f.ref,y=this._values[g];if(y){let v=y.get(A);if(v)return v}else y=this._values[g]=new Map;y.set(A,m);let _=this._scope[g]||(this._scope[g]=[]),E=_.length;return _[E]=f.ref,m.setValue(f,{property:g,itemIndex:E}),m}getValue(d,f){let h=this._values[d];if(h)return h.get(f)}scopeRefs(d,f=this._values){return this._reduceValues(f,h=>{if(h.scopePath===void 0)throw Error(`CodeGen: name "${h}" has no value`);return e._`${d}${h.scopePath}`})}scopeCode(d=this._values,f,h){return this._reduceValues(d,m=>{if(m.value===void 0)throw Error(`CodeGen: name "${m}" has no value`);return m.value.code},f,h)}_reduceValues(d,f,h={},m){let g=e.nil;for(let A in d){let y=d[A];if(!y)continue;let _=h[A]=h[A]||new Map;y.forEach(E=>{if(_.has(E))return;_.set(E,n.Started);let v=f(E);if(v){let S=this.opts.es5?t.varKinds.var:t.varKinds.const;g=e._`${g}${S} ${E} = ${v};${this.opts._n}`}else if(v=m?.(E))g=e._`${g}${v}${this.opts._n}`;else throw new r(E);_.set(E,n.Completed)})}return g}}t.ValueScope=l}),Fs=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;var e=PRt(),r=Sno(),n=PRt();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return n._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return n.str},"get")}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:a(function(){return n.strConcat},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return n.nil},"get")}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:a(function(){return n.getProperty},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return n.stringify},"get")}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:a(function(){return n.regexpCode},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return n.Name},"get")});var o=Sno();Object.defineProperty(t,"Scope",{enumerable:!0,get:a(function(){return o.Scope},"get")}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:a(function(){return o.ValueScope},"get")}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:a(function(){return o.ValueScopeName},"get")}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:a(function(){return o.varKinds},"get")}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{static{a(this,"y1")}optimizeNodes(){return this}optimizeNames(H,re){return this}}class c extends s{static{a(this,"Lj")}constructor(H,re,le){super(),this.varKind=H,this.name=re,this.rhs=le}render({es5:H,_n:re}){let le=H?r.varKinds.var:this.varKind,Le=this.rhs===void 0?"":` = ${this.rhs}`;return`${le} ${this.name}${Le};`+re}optimizeNames(H,re){if(H[this.name.str])return this.rhs&&(this.rhs=M(this.rhs,H,re)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class l extends s{static{a(this,"NB")}constructor(H,re,le){super(),this.lhs=H,this.rhs=re,this.sideEffects=le}render({_n:H}){return`${this.lhs} = ${this.rhs};`+H}optimizeNames(H,re){if(!(this.lhs instanceof e.Name&&!H[this.lhs.str]&&!this.sideEffects))return this.rhs=M(this.rhs,H,re),this}get names(){let H=this.lhs instanceof e.Name?{}:{...this.lhs.names};return q(H,this.rhs)}}class u extends l{static{a(this,"jj")}constructor(H,re,le,Le){super(H,le,Le),this.op=re}render({_n:H}){return`${this.lhs} ${this.op}= ${this.rhs};`+H}}class d extends s{static{a(this,"Aj")}constructor(H){super(),this.label=H,this.names={}}render({_n:H}){return`${this.label}:`+H}}class f extends s{static{a(this,"Ij")}constructor(H){super(),this.label=H,this.names={}}render({_n:H}){return`break${this.label?` ${this.label}`:""};`+H}}class h extends s{static{a(this,"Rj")}constructor(H){super(),this.error=H}render({_n:H}){return`throw ${this.error};`+H}get names(){return this.error.names}}class m extends s{static{a(this,"Pj")}constructor(H){super(),this.code=H}render({_n:H}){return`${this.code};`+H}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(H,re){return this.code=M(this.code,H,re),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class g extends s{static{a(this,"LW")}constructor(H=[]){super(),this.nodes=H}render(H){return this.nodes.reduce((re,le)=>re+le.render(H),"")}optimizeNodes(){let{nodes:H}=this,re=H.length;for(;re--;){let le=H[re].optimizeNodes();Array.isArray(le)?H.splice(re,1,...le):le?H[re]=le:H.splice(re,1)}return H.length>0?this:void 0}optimizeNames(H,re){let{nodes:le}=this,Le=le.length;for(;Le--;){let me=le[Le];me.optimizeNames(H,re)||(L(H,me.names),le.splice(Le,1))}return le.length>0?this:void 0}get names(){return this.nodes.reduce((H,re)=>B(H,re.names),{})}}class A extends g{static{a(this,"f1")}render(H){return"{"+H._n+super.render(H)+"}"+H._n}}class y extends g{static{a(this,"Ej")}}class _ extends A{static{a(this,"RJ")}}_.kind="else";class E extends A{static{a(this,"e4")}constructor(H,re){super(re),this.condition=H}render(H){let re=`if(${this.condition})`+super.render(H);return this.else&&(re+="else "+this.else.render(H)),re}optimizeNodes(){super.optimizeNodes();let H=this.condition;if(H===!0)return this.nodes;let re=this.else;if(re){let le=re.optimizeNodes();re=this.else=Array.isArray(le)?new _(le):le}if(re)return H===!1?re instanceof E?re:re.nodes:this.nodes.length?this:new E(U(H),re instanceof E?[re]:re.nodes);if(!(H===!1||!this.nodes.length))return this}optimizeNames(H,re){var le;if(this.else=(le=this.else)===null||le===void 0?void 0:le.optimizeNames(H,re),!!(super.optimizeNames(H,re)||this.else))return this.condition=M(this.condition,H,re),this}get names(){let H=super.names;return q(H,this.condition),this.else&&B(H,this.else.names),H}}E.kind="if";class v extends A{static{a(this,"q9")}}v.kind="for";class S extends v{static{a(this,"bj")}constructor(H){super(),this.iteration=H}render(H){return`for(${this.iteration})`+super.render(H)}optimizeNames(H,re){if(super.optimizeNames(H,re))return this.iteration=M(this.iteration,H,re),this}get names(){return B(super.names,this.iteration.names)}}class T extends v{static{a(this,"_j")}constructor(H,re,le,Le){super(),this.varKind=H,this.name=re,this.from=le,this.to=Le}render(H){let re=H.es5?r.varKinds.var:this.varKind,{name:le,from:Le,to:me}=this;return`for(${re} ${le}=${Le}; ${le}<${me}; ${le}++)`+super.render(H)}get names(){let H=q(super.names,this.from);return q(H,this.to)}}class w extends v{static{a(this,"BB")}constructor(H,re,le,Le){super(),this.loop=H,this.varKind=re,this.name=le,this.iterable=Le}render(H){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(H)}optimizeNames(H,re){if(super.optimizeNames(H,re))return this.iterable=M(this.iterable,H,re),this}get names(){return B(super.names,this.iterable.names)}}class R extends A{static{a(this,"wW")}constructor(H,re,le){super(),this.name=H,this.args=re,this.async=le}render(H){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(H)}}R.kind="func";class x extends g{static{a(this,"OW")}render(H){return"return "+super.render(H)}}x.kind="return";class k extends A{static{a(this,"kj")}render(H){let re="try"+super.render(H);return this.catch&&(re+=this.catch.render(H)),this.finally&&(re+=this.finally.render(H)),re}optimizeNodes(){var H,re;return super.optimizeNodes(),(H=this.catch)===null||H===void 0||H.optimizeNodes(),(re=this.finally)===null||re===void 0||re.optimizeNodes(),this}optimizeNames(H,re){var le,Le;return super.optimizeNames(H,re),(le=this.catch)===null||le===void 0||le.optimizeNames(H,re),(Le=this.finally)===null||Le===void 0||Le.optimizeNames(H,re),this}get names(){let H=super.names;return this.catch&&B(H,this.catch.names),this.finally&&B(H,this.finally.names),H}}class D extends A{static{a(this,"DW")}constructor(H){super(),this.error=H}render(H){return`catch(${this.error})`+super.render(H)}}D.kind="catch";class N extends A{static{a(this,"FW")}render(H){return"finally"+super.render(H)}}N.kind="finally";class O{static{a(this,"Sj")}constructor(H,re={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...re,_n:re.lines?` +`:""},this._extScope=H,this._scope=new r.Scope({parent:H}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(H){return this._scope.name(H)}scopeName(H){return this._extScope.name(H)}scopeValue(H,re){let le=this._extScope.value(H,re);return(this._values[le.prefix]||(this._values[le.prefix]=new Set)).add(le),le}getScopeValue(H,re){return this._extScope.getValue(H,re)}scopeRefs(H){return this._extScope.scopeRefs(H,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(H,re,le,Le){let me=this._scope.toName(re);return le!==void 0&&Le&&(this._constants[me.str]=le),this._leafNode(new c(H,me,le)),me}const(H,re,le){return this._def(r.varKinds.const,H,re,le)}let(H,re,le){return this._def(r.varKinds.let,H,re,le)}var(H,re,le){return this._def(r.varKinds.var,H,re,le)}assign(H,re,le){return this._leafNode(new l(H,re,le))}add(H,re){return this._leafNode(new u(H,t.operators.ADD,re))}code(H){return typeof H=="function"?H():H!==e.nil&&this._leafNode(new m(H)),this}object(...H){let re=["{"];for(let[le,Le]of H)re.length>1&&re.push(","),re.push(le),(le!==Le||this.opts.es5)&&(re.push(":"),(0,e.addCodeArg)(re,Le));return re.push("}"),new e._Code(re)}if(H,re,le){if(this._blockNode(new E(H)),re&&le)this.code(re).else().code(le).endIf();else if(re)this.code(re).endIf();else if(le)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(H){return this._elseNode(new E(H))}else(){return this._elseNode(new _)}endIf(){return this._endBlockNode(E,_)}_for(H,re){return this._blockNode(H),re&&this.code(re).endFor(),this}for(H,re){return this._for(new S(H),re)}forRange(H,re,le,Le,me=this.opts.es5?r.varKinds.var:r.varKinds.let){let Oe=this._scope.toName(H);return this._for(new T(me,Oe,re,le),()=>Le(Oe))}forOf(H,re,le,Le=r.varKinds.const){let me=this._scope.toName(H);if(this.opts.es5){let Oe=re instanceof e.Name?re:this.var("_arr",re);return this.forRange("_i",0,e._`${Oe}.length`,Te=>{this.var(me,e._`${Oe}[${Te}]`),le(me)})}return this._for(new w("of",Le,me,re),()=>le(me))}forIn(H,re,le,Le=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(H,e._`Object.keys(${re})`,le);let me=this._scope.toName(H);return this._for(new w("in",Le,me,re),()=>le(me))}endFor(){return this._endBlockNode(v)}label(H){return this._leafNode(new d(H))}break(H){return this._leafNode(new f(H))}return(H){let re=new x;if(this._blockNode(re),this.code(H),re.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(H,re,le){if(!re&&!le)throw Error('CodeGen: "try" without "catch" and "finally"');let Le=new k;if(this._blockNode(Le),this.code(H),re){let me=this.name("e");this._currNode=Le.catch=new D(me),re(me)}return le&&(this._currNode=Le.finally=new N,this.code(le)),this._endBlockNode(D,N)}throw(H){return this._leafNode(new h(H))}block(H,re){return this._blockStarts.push(this._nodes.length),H&&this.code(H).endBlock(re),this}endBlock(H){let re=this._blockStarts.pop();if(re===void 0)throw Error("CodeGen: not in self-balancing block");let le=this._nodes.length-re;if(le<0||H!==void 0&&le!==H)throw Error(`CodeGen: wrong number of nodes: ${le} vs ${H} expected`);return this._nodes.length=re,this}func(H,re=e.nil,le,Le){return this._blockNode(new R(H,re,le)),Le&&this.code(Le).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize(H=1){for(;H-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(H){return this._currNode.nodes.push(H),this}_blockNode(H){this._currNode.nodes.push(H),this._nodes.push(H)}_endBlockNode(H,re){let le=this._currNode;if(le instanceof H||re&&le instanceof re)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${re?`${H.kind}/${re.kind}`:H.kind}"`)}_elseNode(H){let re=this._currNode;if(!(re instanceof E))throw Error('CodeGen: "else" without "if"');return this._currNode=re.else=H,this}get _root(){return this._nodes[0]}get _currNode(){let H=this._nodes;return H[H.length-1]}set _currNode(H){let re=this._nodes;re[re.length-1]=H}}t.CodeGen=O;function B(ie,H){for(let re in H)ie[re]=(ie[re]||0)+(H[re]||0);return ie}a(B,"v0");function q(ie,H){return H instanceof e._CodeOrName?B(ie,H.names):ie}a(q,"ZW");function M(ie,H,re){if(ie instanceof e.Name)return le(ie);if(!Le(ie))return ie;return new e._Code(ie._items.reduce((me,Oe)=>(Oe instanceof e.Name&&(Oe=le(Oe)),Oe instanceof e._Code?me.push(...Oe._items):me.push(Oe),me),[]));function le(me){let Oe=re[me.str];return Oe===void 0||H[me.str]!==1?me:(delete H[me.str],Oe)}function Le(me){return me instanceof e._Code&&me._items.some(Oe=>Oe instanceof e.Name&&H[Oe.str]===1&&re[Oe.str]!==void 0)}}a(M,"V9");function L(ie,H){for(let re in H)ie[re]=(ie[re]||0)-(H[re]||0)}a(L,"dp");function U(ie){return typeof ie=="boolean"||typeof ie=="number"||ie===null?!ie:e._`!${z(ie)}`}a(U,"vj"),t.not=U;var j=V(t.operators.AND);function Q(...ie){return ie.reduce(j)}a(Q,"np"),t.and=Q;var Y=V(t.operators.OR);function W(...ie){return ie.reduce(Y)}a(W,"op"),t.or=W;function V(ie){return(H,re)=>H===e.nil?re:re===e.nil?H:e._`${z(H)} ${ie} ${z(re)}`}a(V,"Cj");function z(ie){return ie instanceof e.Name?ie:e._`(${ie})`}a(z,"zB")}),Sc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;var e=Fs(),r=PRt();function n(R){let x={};for(let k of R)x[k]=!0;return x}a(n,"$d"),t.toHash=n;function o(R,x){return typeof x=="boolean"?x:Object.keys(x).length===0?!0:(s(R,x),!c(x,R.self.RULES.all))}a(o,"Qd"),t.alwaysValidSchema=o;function s(R,x=R.schema){let{opts:k,self:D}=R;if(!k.strictSchema||typeof x=="boolean")return;let N=D.RULES.keywords;for(let O in x)N[O]||w(R,`unknown keyword: "${O}"`)}a(s,"fj"),t.checkUnknownRules=s;function c(R,x){if(typeof R=="boolean")return!R;for(let k in R)if(x[k])return!0;return!1}a(c,"gj"),t.schemaHasRules=c;function l(R,x){if(typeof R=="boolean")return!R;for(let k in R)if(k!=="$ref"&&x.all[k])return!0;return!1}a(l,"Jd"),t.schemaHasRulesButRef=l;function u({topSchemaRef:R,schemaPath:x},k,D,N){if(!N){if(typeof k=="number"||typeof k=="boolean")return k;if(typeof k=="string")return e._`${k}`}return e._`${R}${x}${(0,e.getProperty)(D)}`}a(u,"Xd"),t.schemaRefOrVal=u;function d(R){return m(decodeURIComponent(R))}a(d,"Yd"),t.unescapeFragment=d;function f(R){return encodeURIComponent(h(R))}a(f,"Wd"),t.escapeFragment=f;function h(R){return typeof R=="number"?`${R}`:R.replace(/~/g,"~0").replace(/\//g,"~1")}a(h,"OB"),t.escapeJsonPointer=h;function m(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}a(m,"hj"),t.unescapeJsonPointer=m;function g(R,x){if(Array.isArray(R))for(let k of R)x(k);else x(R)}a(g,"Gd"),t.eachItem=g;function A({mergeNames:R,mergeToName:x,mergeValues:k,resultToName:D}){return(N,O,B,q)=>{let M=B===void 0?O:B instanceof e.Name?(O instanceof e.Name?R(N,O,B):x(N,O,B),B):O instanceof e.Name?(x(N,B,O),O):k(O,B);return q===e.Name&&!(M instanceof e.Name)?D(N,M):M}}a(A,"xj"),t.mergeEvaluated={props:A({mergeNames:a((R,x,k)=>R.if(e._`${k} !== true && ${x} !== undefined`,()=>{R.if(e._`${x} === true`,()=>R.assign(k,!0),()=>R.assign(k,e._`${k} || {}`).code(e._`Object.assign(${k}, ${x})`))}),"mergeNames"),mergeToName:a((R,x,k)=>R.if(e._`${k} !== true`,()=>{x===!0?R.assign(k,!0):(R.assign(k,e._`${k} || {}`),_(R,k,x))}),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:{...R,...x},"mergeValues"),resultToName:y}),items:A({mergeNames:a((R,x,k)=>R.if(e._`${k} !== true && ${x} !== undefined`,()=>R.assign(k,e._`${x} === true ? true : ${k} > ${x} ? ${k} : ${x}`)),"mergeNames"),mergeToName:a((R,x,k)=>R.if(e._`${k} !== true`,()=>R.assign(k,x===!0?!0:e._`${k} > ${x} ? ${k} : ${x}`)),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:Math.max(R,x),"mergeValues"),resultToName:a((R,x)=>R.var("items",x),"resultToName")})};function y(R,x){if(x===!0)return R.var("props",!0);let k=R.var("props",e._`{}`);return x!==void 0&&_(R,k,x),k}a(y,"uj"),t.evaluatedPropsToName=y;function _(R,x,k){Object.keys(k).forEach(D=>R.assign(e._`${x}${(0,e.getProperty)(D)}`,!0))}a(_,"DB"),t.setEvaluated=_;var E={};function v(R,x){return R.scopeValue("func",{ref:x,code:E[x.code]||(E[x.code]=new r._Code(x.code))})}a(v,"Ud"),t.useFunc=v;var S;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(S||(t.Type=S={}));function T(R,x,k){if(R instanceof e.Name){let D=x===S.Num;return k?D?e._`"[" + ${R} + "]"`:e._`"['" + ${R} + "']"`:D?e._`"/" + ${R}`:e._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return k?(0,e.getProperty)(R).toString():"/"+h(R)}a(T,"Hd"),t.getErrorPath=T;function w(R,x,k=R.opts.strictSchema){if(k){if(x=`strict mode: ${x}`,k===!0)throw Error(x);R.self.logger.warn(x)}}a(w,"mj"),t.checkStrictMode=w}),lz=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};t.default=r}),Xkt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Fs(),r=Sc(),n=lz();t.keywordError={message:a(({keyword:_})=>e.str`must pass "${_}" keyword validation`,"message")},t.keyword$DataError={message:a(({keyword:_,schemaType:E})=>E?e.str`"${_}" keyword must be ${E} ($data)`:e.str`"${_}" keyword is invalid ($data)`,"message")};function o(_,E=t.keywordError,v,S){let{it:T}=_,{gen:w,compositeRule:R,allErrors:x}=T,k=h(_,E,v);S??(R||x)?u(w,k):d(T,e._`[${k}]`)}a(o,"bd"),t.reportError=o;function s(_,E=t.keywordError,v){let{it:S}=_,{gen:T,compositeRule:w,allErrors:R}=S,x=h(_,E,v);u(T,x),!(w||R)&&d(S,n.default.vErrors)}a(s,"_d"),t.reportExtraError=s;function c(_,E){_.assign(n.default.errors,E),_.if(e._`${n.default.vErrors} !== null`,()=>_.if(E,()=>_.assign(e._`${n.default.vErrors}.length`,E),()=>_.assign(n.default.vErrors,null)))}a(c,"kd"),t.resetErrorsCount=c;function l({gen:_,keyword:E,schemaValue:v,data:S,errsCount:T,it:w}){if(T===void 0)throw Error("ajv implementation error");let R=_.name("err");_.forRange("i",T,n.default.errors,x=>{_.const(R,e._`${n.default.vErrors}[${x}]`),_.if(e._`${R}.instancePath === undefined`,()=>_.assign(e._`${R}.instancePath`,(0,e.strConcat)(n.default.instancePath,w.errorPath))),_.assign(e._`${R}.schemaPath`,e.str`${w.errSchemaPath}/${E}`),w.opts.verbose&&(_.assign(e._`${R}.schema`,v),_.assign(e._`${R}.data`,S))})}a(l,"Sd"),t.extendErrors=l;function u(_,E){let v=_.const("err",E);_.if(e._`${n.default.vErrors} === null`,()=>_.assign(n.default.vErrors,e._`[${v}]`),e._`${n.default.vErrors}.push(${v})`),_.code(e._`${n.default.errors}++`)}a(u,"dj");function d(_,E){let{gen:v,validateName:S,schemaEnv:T}=_;T.$async?v.throw(e._`new ${_.ValidationError}(${E})`):(v.assign(e._`${S}.errors`,E),v.return(!1))}a(d,"ij");var f={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function h(_,E,v){let{createErrors:S}=_.it;return S===!1?e._`{}`:m(_,E,v)}a(h,"nj");function m(_,E,v={}){let{gen:S,it:T}=_,w=[g(T,v),A(_,v)];return y(_,E,w),S.object(...w)}a(m,"vd");function g({errorPath:_},{instancePath:E}){let v=E?e.str`${_}${(0,r.getErrorPath)(E,r.Type.Str)}`:_;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,v)]}a(g,"Cd");function A({keyword:_,it:{errSchemaPath:E}},{schemaPath:v,parentSchema:S}){let T=S?E:e.str`${E}/${_}`;return v&&(T=e.str`${T}${(0,r.getErrorPath)(v,r.Type.Str)}`),[f.schemaPath,T]}a(A,"Td");function y(_,{params:E,message:v},S){let{keyword:T,data:w,schemaValue:R,it:x}=_,{opts:k,propertyName:D,topSchemaRef:N,schemaPath:O}=x;S.push([f.keyword,T],[f.params,typeof E=="function"?E(_):E||e._`{}`]),k.messages&&S.push([f.message,typeof v=="function"?v(_):v]),k.verbose&&S.push([f.schema,R],[f.parentSchema,e._`${N}${O}`],[n.default.data,w]),D&&S.push([f.propertyName,D])}a(y,"xd")}),eWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=Xkt(),r=Fs(),n=lz(),o={message:"boolean schema is false"};function s(u){let{gen:d,schema:f,validateName:h}=u;f===!1?l(u,!1):typeof f=="object"&&f.$async===!0?d.return(n.default.data):(d.assign(r._`${h}.errors`,null),d.return(!0))}a(s,"pd"),t.topBoolOrEmptySchema=s;function c(u,d){let{gen:f,schema:h}=u;h===!1?(f.var(d,!1),l(u)):f.var(d,!0)}a(c,"dd"),t.boolOrEmptySchema=c;function l(u,d){let{gen:f,data:h}=u,m={gen:f,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(m,o,void 0,d)}a(l,"tj")}),qoo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;var e=["string","number","integer","boolean","null","object","array"],r=new Set(e);function n(s){return typeof s=="string"&&r.has(s)}a(n,"od"),t.isJSONType=n;function o(){let s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}a(o,"td"),t.getRules=o}),joo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function e({schema:o,self:s},c){let l=s.RULES.types[c];return l&&l!==!0&&r(o,l)}a(e,"sd"),t.schemaHasRulesForType=e;function r(o,s){return s.rules.some(c=>n(o,c))}a(r,"JA"),t.shouldUseGroup=r;function n(o,s){var c;return o[s.keyword]!==void 0||((c=s.definition.implements)===null||c===void 0?void 0:c.some(l=>o[l]!==void 0))}a(n,"XA"),t.shouldUseRule=n}),DRt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;var e=qoo(),r=joo(),n=Xkt(),o=Fs(),s=Sc(),c;(function(S){S[S.Correct=0]="Correct",S[S.Wrong=1]="Wrong"})(c||(t.DataType=c={}));function l(S){let T=u(S.type);if(T.includes("null")){if(S.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!T.length&&S.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');S.nullable===!0&&T.push("null")}return T}a(l,"Yi"),t.getSchemaTypes=l;function u(S){let T=Array.isArray(S)?S:S?[S]:[];if(T.every(e.isJSONType))return T;throw Error("type must be JSONType or JSONType[]: "+T.join(","))}a(u,"UA"),t.getJSONTypes=u;function d(S,T){let{gen:w,data:R,opts:x}=S,k=h(T,x.coerceTypes),D=T.length>0&&!(k.length===0&&T.length===1&&(0,r.schemaHasRulesForType)(S,T[0]));if(D){let N=y(T,R,x.strictNumbers,c.Wrong);w.if(N,()=>{k.length?m(S,T,k):E(S)})}return D}a(d,"Wi"),t.coerceAndCheckDataType=d;var f=new Set(["string","number","integer","boolean","null"]);function h(S,T){return T?S.filter(w=>f.has(w)||T==="array"&&w==="array"):[]}a(h,"Gi");function m(S,T,w){let{gen:R,data:x,opts:k}=S,D=R.let("dataType",o._`typeof ${x}`),N=R.let("coerced",o._`undefined`);k.coerceTypes==="array"&&R.if(o._`${D} == 'object' && Array.isArray(${x}) && ${x}.length == 1`,()=>R.assign(x,o._`${x}[0]`).assign(D,o._`typeof ${x}`).if(y(T,x,k.strictNumbers),()=>R.assign(N,x))),R.if(o._`${N} !== undefined`);for(let B of w)(f.has(B)||B==="array"&&k.coerceTypes==="array")&&O(B);R.else(),E(S),R.endIf(),R.if(o._`${N} !== undefined`,()=>{R.assign(x,N),g(S,N)});function O(B){switch(B){case"string":R.elseIf(o._`${D} == "number" || ${D} == "boolean"`).assign(N,o._`"" + ${x}`).elseIf(o._`${x} === null`).assign(N,o._`""`);return;case"number":R.elseIf(o._`${D} == "boolean" || ${x} === null || (${D} == "string" && ${x} && ${x} == +${x})`).assign(N,o._`+${x}`);return;case"integer":R.elseIf(o._`${D} === "boolean" || ${x} === null || (${D} === "string" && ${x} && ${x} == +${x} && !(${x} % 1))`).assign(N,o._`+${x}`);return;case"boolean":R.elseIf(o._`${x} === "false" || ${x} === 0 || ${x} === null`).assign(N,!1).elseIf(o._`${x} === "true" || ${x} === 1`).assign(N,!0);return;case"null":R.elseIf(o._`${x} === "" || ${x} === 0 || ${x} === false`),R.assign(N,null);return;case"array":R.elseIf(o._`${D} === "string" || ${D} === "number" - || ${D} === "boolean" || ${x} === null`).assign(N,o._`[${x}]`)}}a(O,"H")}a(m,"Ui");function g({gen:S,parentData:T,parentDataProperty:w},R){S.if(o._`${T} !== undefined`,()=>S.assign(o._`${T}[${w}]`,R))}a(g,"Hi");function A(S,T,w,R=c.Correct){let x=R===c.Correct?o.operators.EQ:o.operators.NEQ,k;switch(S){case"null":return o._`${T} ${x} null`;case"array":k=o._`Array.isArray(${T})`;break;case"object":k=o._`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":k=D(o._`!(${T} % 1) && !isNaN(${T})`);break;case"number":k=D();break;default:return o._`typeof ${T} ${x} ${S}`}return R===c.Correct?k:(0,o.not)(k);function D(N=o.nil){return(0,o.and)(o._`typeof ${T} == "number"`,N,w?o._`isFinite(${T})`:o.nil)}}a(A,"LB"),t.checkDataType=A;function y(S,T,w,R){if(S.length===1)return A(S[0],T,w,R);let x,k=(0,s.toHash)(S);if(k.array&&k.object){let D=o._`typeof ${T} != "object"`;x=k.null?D:o._`!${T} || ${D}`,delete k.null,delete k.array,delete k.object}else x=o.nil;k.number&&delete k.integer;for(let D in k)x=(0,o.and)(x,A(D,T,w,R));return x}a(y,"jB"),t.checkDataTypes=y;var _={message:a(({schema:S})=>`must be ${S}`,"message"),params:a(({schema:S,schemaValue:T})=>typeof S=="string"?o._`{type: ${S}}`:o._`{type: ${T}}`,"params")};function E(S){let T=v(S);(0,n.reportError)(T,_)}a(E,"AB"),t.reportTypeError=E;function v(S){let{gen:T,data:w,schema:R}=S,x=(0,s.schemaRefOrVal)(S,R,"type");return{gen:T,keyword:"type",data:w,schema:R.type,schemaCode:x,schemaValue:x,parentSchema:R,params:{},it:S}}a(v,"qi")}),XVc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=Fs(),r=Sc();function n(s,c){let{properties:l,items:u}=s.schema;if(c==="object"&&l)for(let d in l)o(s,d,l[d].default);else c==="array"&&Array.isArray(u)&&u.forEach((d,f)=>o(s,f,d.default))}a(n,"Fi"),t.assignDefaults=n;function o(s,c,l){let{gen:u,compositeRule:d,data:f,opts:h}=s;if(l===void 0)return;let m=e._`${f}${(0,e.getProperty)(c)}`;if(d){(0,r.checkStrictMode)(s,`default is ignored for: ${m}`);return}let g=e._`${m} === undefined`;h.useDefaults==="empty"&&(g=e._`${g} || ${m} === null || ${m} === ""`),u.if(g,e._`${m} = ${(0,e.stringify)(l)}`)}a(o,"VA")}),vM=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;var e=Fs(),r=Sc(),n=cz(),o=Sc();function s(S,T){let{gen:w,data:R,it:x}=S;w.if(h(w,R,T,x.opts.ownProperties),()=>{S.setParams({missingProperty:e._`${T}`},!0),S.error()})}a(s,"Mi"),t.checkReportMissingProp=s;function c({gen:S,data:T,it:{opts:w}},R,x){return(0,e.or)(...R.map(k=>(0,e.and)(h(S,T,k,w.ownProperties),e._`${x} = ${k}`)))}a(c,"Li"),t.checkMissingProp=c;function l(S,T){S.setParams({missingProperty:T},!0),S.error()}a(l,"ji"),t.reportMissingProp=l;function u(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}a(u,"wA"),t.hasPropFunc=u;function d(S,T,w){return e._`${u(S)}.call(${T}, ${w})`}a(d,"RB"),t.isOwnProperty=d;function f(S,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} !== undefined`;return R?e._`${x} && ${d(S,T,w)}`:x}a(f,"Ai"),t.propertyInData=f;function h(S,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} === undefined`;return R?(0,e.or)(x,(0,e.not)(d(S,T,w))):x}a(h,"PB"),t.noPropertyInData=h;function m(S){return S?Object.keys(S).filter(T=>T!=="__proto__"):[]}a(m,"OA"),t.allSchemaProperties=m;function g(S,T){return m(T).filter(w=>!(0,r.alwaysValidSchema)(S,T[w]))}a(g,"Ii"),t.schemaProperties=g;function A({schemaCode:S,data:T,it:{gen:w,topSchemaRef:R,schemaPath:x,errorPath:k},it:D},N,O,B){let q=B?e._`${S}, ${T}, ${R}${x}`:T,M=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,k)],[n.default.parentData,D.parentData],[n.default.parentDataProperty,D.parentDataProperty],[n.default.rootData,n.default.rootData]];D.opts.dynamicRef&&M.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);let L=e._`${q}, ${w.object(...M)}`;return O!==e.nil?e._`${N}.call(${O}, ${L})`:e._`${N}(${L})`}a(A,"Ri"),t.callValidateCode=A;var y=e._`new RegExp`;function _({gen:S,it:{opts:T}},w){let R=T.unicodeRegExp?"u":"",{regExp:x}=T.code,k=x(w,R);return S.scopeValue("pattern",{key:k.toString(),ref:k,code:e._`${x.code==="new RegExp"?y:(0,o.useFunc)(S,x)}(${w}, ${R})`})}a(_,"Ei"),t.usePattern=_;function E(S){let{gen:T,data:w,keyword:R,it:x}=S,k=T.name("valid");if(x.allErrors){let N=T.let("valid",!0);return D(()=>T.assign(N,!1)),N}return T.var(k,!0),D(()=>T.break()),k;function D(N){let O=T.const("len",e._`${w}.length`);T.forRange("i",0,O,B=>{S.subschema({keyword:R,dataProp:B,dataPropType:r.Type.Num},k),T.if((0,e.not)(k),N)})}}a(E,"bi"),t.validateArray=E;function v(S){let{gen:T,schema:w,keyword:R,it:x}=S;if(!Array.isArray(w))throw Error("ajv implementation error");if(w.some(N=>(0,r.alwaysValidSchema)(x,N))&&!x.opts.unevaluated)return;let k=T.let("valid",!1),D=T.name("_valid");T.block(()=>w.forEach((N,O)=>{let B=S.subschema({keyword:R,schemaProp:O,compositeRule:!0},D);T.assign(k,e._`${k} || ${D}`),!S.mergeValidEvaluated(B,D)&&T.if((0,e.not)(k))})),S.result(k,()=>S.reset(),()=>S.error(!0))}a(v,"_i"),t.validateUnion=v}),eWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=Fs(),r=cz(),n=vM(),o=Zkt();function s(g,A){let{gen:y,keyword:_,schema:E,parentSchema:v,it:S}=g,T=A.macro.call(S.self,E,v,S),w=f(y,_,T);S.opts.validateSchema!==!1&&S.self.validateSchema(T,!0);let R=y.name("valid");g.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${S.errSchemaPath}/${_}`,topSchemaRef:w,compositeRule:!0},R),g.pass(R,()=>g.error(!0))}a(s,"pi"),t.macroKeywordCode=s;function c(g,A){var y;let{gen:_,keyword:E,schema:v,parentSchema:S,$data:T,it:w}=g;d(w,A);let R=!T&&A.compile?A.compile.call(w.self,v,S,w):A.validate,x=f(_,E,R),k=_.let("valid");g.block$data(k,D),g.ok((y=A.valid)!==null&&y!==void 0?y:k);function D(){if(A.errors===!1)B(),A.modifying&&l(g),q(()=>g.error());else{let M=A.async?N():O();A.modifying&&l(g),q(()=>u(g,M))}}a(D,"z");function N(){let M=_.let("ruleErrs",null);return _.try(()=>B(e._`await `),L=>_.assign(k,!1).if(e._`${L} instanceof ${w.ValidationError}`,()=>_.assign(M,e._`${L}.errors`),()=>_.throw(L))),M}a(N,"N");function O(){let M=e._`${x}.errors`;return _.assign(M,null),B(e.nil),M}a(O,"w");function B(M=A.async?e._`await `:e.nil){let L=w.opts.passContext?r.default.this:r.default.self,U=!("compile"in A&&!T||A.schema===!1);_.assign(k,e._`${M}${(0,n.callValidateCode)(g,x,L,U)}`,A.modifying)}a(B,"O");function q(M){var L;_.if((0,e.not)((L=A.valid)!==null&&L!==void 0?L:k),M)}a(q,"D")}a(c,"di"),t.funcKeywordCode=c;function l(g){let{gen:A,data:y,it:_}=g;A.if(_.parentData,()=>A.assign(y,e._`${_.parentData}[${_.parentDataProperty}]`))}a(l,"ZA");function u(g,A){let{gen:y}=g;y.if(e._`Array.isArray(${A})`,()=>{y.assign(r.default.vErrors,e._`${r.default.vErrors} === null ? ${A} : ${r.default.vErrors}.concat(${A})`).assign(r.default.errors,e._`${r.default.vErrors}.length`),(0,o.extendErrors)(g)},()=>g.error())}a(u,"ii");function d({schemaEnv:g},A){if(A.async&&!g.$async)throw Error("async keyword in sync schema")}a(d,"ni");function f(g,A,y){if(y===void 0)throw Error(`keyword "${A}" failed to compile`);return g.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}a(f,"MA");function h(g,A,y=!1){return!A.length||A.some(_=>_==="array"?Array.isArray(g):_==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==_||y&&typeof g>"u")}a(h,"ri"),t.validSchemaType=h;function m({schema:g,opts:A,self:y,errSchemaPath:_},E,v){if(Array.isArray(E.keyword)?!E.keyword.includes(v):E.keyword!==v)throw Error("ajv implementation error");let S=E.dependencies;if(S?.some(T=>!Object.prototype.hasOwnProperty.call(g,T)))throw Error(`parent schema must have dependencies of ${v}: ${S.join(",")}`);if(E.validateSchema&&!E.validateSchema(g[v])){let T=`keyword "${v}" value is invalid at path "${_}": `+y.errorsText(E.validateSchema.errors);if(A.validateSchema==="log")y.logger.error(T);else throw Error(T)}}a(m,"oi"),t.validateKeywordUsage=m}),tWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=Fs(),r=Sc();function n(c,{keyword:l,schemaProp:u,schema:d,schemaPath:f,errSchemaPath:h,topSchemaRef:m}){if(l!==void 0&&d!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){let g=c.schema[l];return u===void 0?{schema:g,schemaPath:e._`${c.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${c.errSchemaPath}/${l}`}:{schema:g[u],schemaPath:e._`${c.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(u)}`,errSchemaPath:`${c.errSchemaPath}/${l}/${(0,r.escapeFragment)(u)}`}}if(d!==void 0){if(f===void 0||h===void 0||m===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:f,topSchemaRef:m,errSchemaPath:h}}throw Error('either "keyword" or "schema" must be passed')}a(n,"ei"),t.getSubschema=n;function o(c,l,{dataProp:u,dataPropType:d,data:f,dataTypes:h,propertyName:m}){if(f!==void 0&&u!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:g}=l;if(u!==void 0){let{errorPath:y,dataPathArr:_,opts:E}=l,v=g.let("data",e._`${l.data}${(0,e.getProperty)(u)}`,!0);A(v),c.errorPath=e.str`${y}${(0,r.getErrorPath)(u,d,E.jsPropertySyntax)}`,c.parentDataProperty=e._`${u}`,c.dataPathArr=[..._,c.parentDataProperty]}if(f!==void 0){let y=f instanceof e.Name?f:g.let("data",f,!0);A(y),m!==void 0&&(c.propertyName=m)}h&&(c.dataTypes=h);function A(y){c.data=y,c.dataLevel=l.dataLevel+1,c.dataTypes=[],l.definedProperties=new Set,c.parentData=l.data,c.dataNames=[...l.dataNames,y]}a(A,"H")}a(o,"$n"),t.extendSubschemaData=o;function s(c,{jtdDiscriminator:l,jtdMetadata:u,compositeRule:d,createErrors:f,allErrors:h}){d!==void 0&&(c.compositeRule=d),f!==void 0&&(c.createErrors=f),h!==void 0&&(c.allErrors=h),c.jtdDiscriminator=l,c.jtdMetadata=u}a(s,"Qn"),t.extendSubschemaMode=s}),qoo=jt((t,e)=>{e.exports=a(function r(n,o){if(n===o)return!0;if(n&&o&&typeof n=="object"&&typeof o=="object"){if(n.constructor!==o.constructor)return!1;var s,c,l;if(Array.isArray(n)){if(s=n.length,s!=o.length)return!1;for(c=s;c--!==0;)if(!r(n[c],o[c]))return!1;return!0}if(n.constructor===RegExp)return n.source===o.source&&n.flags===o.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===o.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===o.toString();if(l=Object.keys(n),s=l.length,s!==Object.keys(o).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(o,l[c]))return!1;for(c=s;c--!==0;){var u=l[c];if(!r(n[u],o[u]))return!1}return!0}return n!==n&&o!==o},"$")}),rWc=jt((t,e)=>{var r=e.exports=function(s,c,l){typeof c=="function"&&(l=c,c={}),l=c.cb||l;var u=typeof l=="function"?l:l.pre||function(){},d=l.post||function(){};n(c,u,d,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function n(s,c,l,u,d,f,h,m,g,A){if(u&&typeof u=="object"&&!Array.isArray(u)){c(u,d,f,h,m,g,A);for(var y in u){var _=u[y];if(Array.isArray(_)){if(y in r.arrayKeywords)for(var E=0;E<_.length;E++)n(s,c,l,_[E],d+"/"+y+"/"+E,f,d,y,u,E)}else if(y in r.propsKeywords){if(_&&typeof _=="object")for(var v in _)n(s,c,l,_[v],d+"/"+y+"/"+o(v),f,d,y,u,v)}else(y in r.keywords||s.allKeys&&!(y in r.skipKeywords))&&n(s,c,l,_,d+"/"+y,f,d,y,u)}l(u,d,f,h,m,g,A)}}a(n,"IW");function o(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}a(o,"Yn")}),Xkt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;var e=Sc(),r=qoo(),n=rWc(),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(_,E=!0){return typeof _=="boolean"?!0:E===!0?!l(_):E?u(_)<=E:!1}a(s,"Kn"),t.inlineRef=s;var c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(_){for(let E in _){if(c.has(E))return!0;let v=_[E];if(Array.isArray(v)&&v.some(l)||typeof v=="object"&&l(v))return!0}return!1}a(l,"bB");function u(_){let E=0;for(let v in _){if(v==="$ref")return 1/0;if(E++,!o.has(v)&&(typeof _[v]=="object"&&(0,e.eachItem)(_[v],S=>E+=u(S)),E===1/0))return 1/0}return E}a(u,"SA");function d(_,E="",v){v!==!1&&(E=m(E));let S=_.parse(E);return f(_,S)}a(d,"vA"),t.getFullPath=d;function f(_,E){return _.serialize(E).split("#")[0]+"#"}a(f,"CA"),t._getFullPath=f;var h=/#\/?$/;function m(_){return _?_.replace(h,""):""}a(m,"N9"),t.normalizeId=m;function g(_,E,v){return v=m(v),_.resolve(E,v)}a(g,"Bn"),t.resolveUrl=g;var A=/^[a-z_][-a-z0-9._]*$/i;function y(_,E){if(typeof _=="boolean")return{};let{schemaId:v,uriResolver:S}=this.opts,T=m(_[v]||E),w={"":T},R=d(S,T,!1),x={},k=new Set;return n(_,{allKeys:!0},(O,B,q,M)=>{if(M===void 0)return;let L=R+B,U=w[M];typeof O[v]=="string"&&(U=j.call(this,O[v])),Q.call(this,O.$anchor),Q.call(this,O.$dynamicAnchor),w[B]=U;function j(Y){let W=this.opts.uriResolver.resolve;if(Y=m(U?W(U,Y):Y),k.has(Y))throw N(Y);k.add(Y);let V=this.refs[Y];return typeof V=="string"&&(V=this.refs[V]),typeof V=="object"?D(O,V.schema,Y):Y!==m(L)&&(Y[0]==="#"?(D(O,x[Y],Y),x[Y]=O):this.refs[Y]=L),Y}a(j,"M");function Q(Y){if(typeof Y=="string"){if(!A.test(Y))throw Error(`invalid anchor "${Y}"`);j.call(this,`#${Y}`)}}a(Q,"j")}),x;function D(O,B,q){if(B!==void 0&&!r(O,B))throw N(q)}function N(O){return Error(`reference "${O}" resolves to more than one schema`)}}a(y,"Nn"),t.getSchemaRefs=y}),ePt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=ZVc(),r=PRt(),n=Qoo(),o=PRt(),s=XVc(),c=eWc(),l=tWc(),u=Fs(),d=cz(),f=Xkt(),h=Sc(),m=Zkt();function g(ee){if(R(ee)&&(k(ee),w(ee))){E(ee);return}A(ee,()=>(0,e.topBoolOrEmptySchema)(ee))}a(g,"jn"),t.validateFunctionCode=g;function A({gen:ee,validateName:K,schema:he,schemaEnv:X,opts:de},Be){de.code.es5?ee.func(K,u._`${d.default.data}, ${d.default.valCxt}`,X.$async,()=>{ee.code(u._`"use strict"; ${S(he,de)}`),_(ee,de),ee.code(Be)}):ee.func(K,u._`${d.default.data}, ${y(de)}`,X.$async,()=>ee.code(S(he,de)).code(Be))}a(A,"mA");function y(ee){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${ee.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}a(y,"An");function _(ee,K){ee.if(d.default.valCxt,()=>{ee.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),ee.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),ee.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),ee.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),K.dynamicRef&&ee.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{ee.var(d.default.instancePath,u._`""`),ee.var(d.default.parentData,u._`undefined`),ee.var(d.default.parentDataProperty,u._`undefined`),ee.var(d.default.rootData,d.default.data),K.dynamicRef&&ee.var(d.default.dynamicAnchors,u._`{}`)})}a(_,"In");function E(ee){let{schema:K,opts:he,gen:X}=ee;A(ee,()=>{he.$comment&&K.$comment&&M(ee),O(ee),X.let(d.default.vErrors,null),X.let(d.default.errors,0),he.unevaluated&&v(ee),D(ee),L(ee)})}a(E,"Rn");function v(ee){let{gen:K,validateName:he}=ee;ee.evaluated=K.const("evaluated",u._`${he}.evaluated`),K.if(u._`${ee.evaluated}.dynamicProps`,()=>K.assign(u._`${ee.evaluated}.props`,u._`undefined`)),K.if(u._`${ee.evaluated}.dynamicItems`,()=>K.assign(u._`${ee.evaluated}.items`,u._`undefined`))}a(v,"Pn");function S(ee,K){let he=typeof ee=="object"&&ee[K.schemaId];return he&&(K.code.source||K.code.process)?u._`/*# sourceURL=${he} */`:u.nil}a(S,"fA");function T(ee,K){if(R(ee)&&(k(ee),w(ee))){x(ee,K);return}(0,e.boolOrEmptySchema)(ee,K)}a(T,"En");function w({schema:ee,self:K}){if(typeof ee=="boolean")return!ee;for(let he in ee)if(K.RULES.all[he])return!0;return!1}a(w,"lA");function R(ee){return typeof ee.schema!="boolean"}a(R,"cA");function x(ee,K){let{schema:he,gen:X,opts:de}=ee;de.$comment&&he.$comment&&M(ee),B(ee),q(ee);let Be=X.const("_errs",d.default.errors);D(ee,Be),X.var(K,u._`${Be} === ${d.default.errors}`)}a(x,"bn");function k(ee){(0,h.checkUnknownRules)(ee),N(ee)}a(k,"pA");function D(ee,K){if(ee.opts.jtd)return j(ee,[],!1,K);let he=(0,r.getSchemaTypes)(ee.schema),X=(0,r.coerceAndCheckDataType)(ee,he);j(ee,he,!X,K)}a(D,"dA");function N(ee){let{schema:K,errSchemaPath:he,opts:X,self:de}=ee;K.$ref&&X.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(K,de.RULES)&&de.logger.warn(`$ref: keywords ignored in schema at path "${he}"`)}a(N,"_n");function O(ee){let{schema:K,opts:he}=ee;K.default!==void 0&&he.useDefaults&&he.strictSchema&&(0,h.checkStrictMode)(ee,"default is ignored in the schema root")}a(O,"kn");function B(ee){let K=ee.schema[ee.opts.schemaId];K&&(ee.baseId=(0,f.resolveUrl)(ee.opts.uriResolver,ee.baseId,K))}a(B,"Sn");function q(ee){if(ee.schema.$async&&!ee.schemaEnv.$async)throw Error("async schema in sync schema")}a(q,"vn");function M({gen:ee,schemaEnv:K,schema:he,errSchemaPath:X,opts:de}){let Be=he.$comment;if(de.$comment===!0)ee.code(u._`${d.default.self}.logger.log(${Be})`);else if(typeof de.$comment=="function"){let ne=u.str`${X}/$comment`,ue=ee.scopeValue("root",{ref:K.root});ee.code(u._`${d.default.self}.opts.$comment(${Be}, ${ne}, ${ue}.schema)`)}}a(M,"iA");function L(ee){let{gen:K,schemaEnv:he,validateName:X,ValidationError:de,opts:Be}=ee;he.$async?K.if(u._`${d.default.errors} === 0`,()=>K.return(d.default.data),()=>K.throw(u._`new ${de}(${d.default.vErrors})`)):(K.assign(u._`${X}.errors`,d.default.vErrors),Be.unevaluated&&U(ee),K.return(u._`${d.default.errors} === 0`))}a(L,"Cn");function U({gen:ee,evaluated:K,props:he,items:X}){he instanceof u.Name&&ee.assign(u._`${K}.props`,he),X instanceof u.Name&&ee.assign(u._`${K}.items`,X)}a(U,"Tn");function j(ee,K,he,X){let{gen:de,schema:Be,data:ne,allErrors:ue,opts:Ne,self:xe}=ee,{RULES:Fe}=xe;if(Be.$ref&&(Ne.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(Be,Fe))){de.block(()=>me(ee,"$ref",Fe.all.$ref.definition));return}Ne.jtd||Y(ee,K),de.block(()=>{for(let st of Fe.rules)tt(st);tt(Fe.post)});function tt(st){(0,n.shouldUseGroup)(Be,st)&&(st.type?(de.if((0,o.checkDataType)(st.type,ne,Ne.strictNumbers)),Q(ee,st),K.length===1&&K[0]===st.type&&he&&(de.else(),(0,o.reportTypeError)(ee)),de.endIf()):Q(ee,st),ue||de.if(u._`${d.default.errors} === ${X||0}`))}a(tt,"B")}a(j,"gA");function Q(ee,K){let{gen:he,schema:X,opts:{useDefaults:de}}=ee;de&&(0,s.assignDefaults)(ee,K.type),he.block(()=>{for(let Be of K.rules)(0,n.shouldUseRule)(X,Be)&&me(ee,Be.keyword,Be.definition,K.type)})}a(Q,"hA");function Y(ee,K){ee.schemaEnv.meta||!ee.opts.strictTypes||(W(ee,K),!ee.opts.allowUnionTypes&&V(ee,K),z(ee,ee.dataTypes))}a(Y,"xn");function W(ee,K){if(K.length){if(!ee.dataTypes.length){ee.dataTypes=K;return}K.forEach(he=>{H(ee.dataTypes,he)||le(ee,`type "${he}" not allowed by context "${ee.dataTypes.join(",")}"`)}),re(ee,K)}}a(W,"yn");function V(ee,K){K.length>1&&!(K.length===2&&K.includes("null"))&&le(ee,"use allowUnionTypes to allow union type keyword")}a(V,"fn");function z(ee,K){let he=ee.self.RULES.all;for(let X in he){let de=he[X];if(typeof de=="object"&&(0,n.shouldUseRule)(ee.schema,de)){let{type:Be}=de.definition;Be.length&&!Be.some(ne=>ie(K,ne))&&le(ee,`missing type "${Be.join(",")}" for keyword "${X}"`)}}}a(z,"gn");function ie(ee,K){return ee.includes(K)||K==="number"&&ee.includes("integer")}a(ie,"hn");function H(ee,K){return ee.includes(K)||K==="integer"&&ee.includes("number")}a(H,"nA");function re(ee,K){let he=[];for(let X of ee.dataTypes)H(K,X)?he.push(X):K.includes("integer")&&X==="number"&&he.push("integer");ee.dataTypes=he}a(re,"un");function le(ee,K){let he=ee.schemaEnv.baseId+ee.errSchemaPath;K+=` at "${he}" (strictTypes)`,(0,h.checkStrictMode)(ee,K,ee.opts.strictTypes)}a(le,"SB");class Le{static{a(this,"vB")}constructor(K,he,X){if((0,c.validateKeywordUsage)(K,he,X),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=X,this.data=K.data,this.schema=K.schema[X],this.$data=he.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(K,this.schema,X,this.$data),this.schemaType=he.schemaType,this.parentSchema=K.schema,this.params={},this.it=K,this.def=he,this.$data)this.schemaCode=K.gen.const("vSchema",te(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,he.schemaType,he.allowUndefined))throw Error(`${X} value must be ${JSON.stringify(he.schemaType)}`);("code"in he?he.trackErrors:he.errors!==!1)&&(this.errsCount=K.gen.const("_errs",d.default.errors))}result(K,he,X){this.failResult((0,u.not)(K),he,X)}failResult(K,he,X){this.gen.if(K),X?X():this.error(),he?(this.gen.else(),he(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(K,he){this.failResult((0,u.not)(K),void 0,he)}fail(K){if(K===void 0){this.error(),!this.allErrors&&this.gen.if(!1);return}this.gen.if(K),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(K){if(!this.$data)return this.fail(K);let{schemaCode:he}=this;this.fail(u._`${he} !== undefined && (${(0,u.or)(this.invalid$data(),K)})`)}error(K,he,X){if(he){this.setParams(he),this._error(K,X),this.setParams({});return}this._error(K,X)}_error(K,he){(K?m.reportExtraError:m.reportError)(this,this.def.error,he)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(K){this.allErrors||this.gen.if(K)}setParams(K,he){he?Object.assign(this.params,K):this.params=K}block$data(K,he,X=u.nil){this.gen.block(()=>{this.check$data(K,X),he()})}check$data(K=u.nil,he=u.nil){if(!this.$data)return;let{gen:X,schemaCode:de,schemaType:Be,def:ne}=this;X.if((0,u.or)(u._`${de} === undefined`,he)),K!==u.nil&&X.assign(K,!0),(Be.length||ne.validateSchema)&&(X.elseIf(this.invalid$data()),this.$dataError(),K!==u.nil&&X.assign(K,!1)),X.else()}invalid$data(){let{gen:K,schemaCode:he,schemaType:X,def:de,it:Be}=this;return(0,u.or)(ne(),ue());function ne(){if(X.length){if(!(he instanceof u.Name))throw Error("ajv implementation error");let Ne=Array.isArray(X)?X:[X];return u._`${(0,o.checkDataTypes)(Ne,he,Be.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function ue(){if(de.validateSchema){let Ne=K.scopeValue("validate$data",{ref:de.validateSchema});return u._`!${Ne}(${he})`}return u.nil}}subschema(K,he){let X=(0,l.getSubschema)(this.it,K);(0,l.extendSubschemaData)(X,this.it,K),(0,l.extendSubschemaMode)(X,K);let de={...this.it,...X,items:void 0,props:void 0};return T(de,he),de}mergeEvaluated(K,he){let{it:X,gen:de}=this;X.opts.unevaluated&&(X.props!==!0&&K.props!==void 0&&(X.props=h.mergeEvaluated.props(de,K.props,X.props,he)),X.items!==!0&&K.items!==void 0&&(X.items=h.mergeEvaluated.items(de,K.items,X.items,he)))}mergeValidEvaluated(K,he){let{it:X,gen:de}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return de.if(he,()=>this.mergeEvaluated(K,u.Name)),!0}}t.KeywordCxt=Le;function me(ee,K,he,X){let de=new Le(ee,he,K);"code"in he?he.code(de,X):de.$data&&he.validate?(0,c.funcKeywordCode)(de,he):"macro"in he?(0,c.macroKeywordCode)(de,he):(he.compile||he.validate)&&(0,c.funcKeywordCode)(de,he)}a(me,"rA");var Oe=/^\/(?:[^~]|~0|~1)*$/,Te=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function te(ee,{dataLevel:K,dataNames:he,dataPathArr:X}){let de,Be;if(ee==="")return d.default.rootData;if(ee[0]==="/"){if(!Oe.test(ee))throw Error(`Invalid JSON-pointer: ${ee}`);de=ee,Be=d.default.rootData}else{let xe=Te.exec(ee);if(!xe)throw Error(`Invalid JSON-pointer: ${ee}`);let Fe=+xe[1];if(de=xe[2],de==="#"){if(Fe>=K)throw Error(Ne("property/index",Fe));return X[K-Fe]}if(Fe>K)throw Error(Ne("data",Fe));if(Be=he[K-Fe],!de)return Be}let ne=Be,ue=de.split("/");for(let xe of ue)xe&&(Be=u._`${Be}${(0,u.getProperty)((0,h.unescapeJsonPointer)(xe))}`,ne=u._`${ne} && ${Be}`);return ne;function Ne(xe,Fe){return`Cannot access ${xe} ${Fe} levels up, current level is ${K}`}}a(te,"oA"),t.getData=te}),Sqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});class e extends Error{static{a(this,"sA")}constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}t.default=e}),tPt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Xkt();class r extends Error{static{a(this,"$I")}constructor(o,s,c,l){super(l||`can't resolve reference ${c} from id ${s}`),this.missingRef=(0,e.resolveUrl)(o,s,c),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(o,this.missingRef))}}t.default=r}),Tqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=Fs(),r=Sqr(),n=cz(),o=Xkt(),s=Sc(),c=ePt();class l{static{a(this,"CJ")}constructor(v){var S;this.refs={},this.dynamicAnchors={};let T;typeof v.schema=="object"&&(T=v.schema),this.schema=v.schema,this.schemaId=v.schemaId,this.root=v.root||this,this.baseId=(S=v.baseId)!==null&&S!==void 0?S:(0,o.normalizeId)(T?.[v.schemaId||"$id"]),this.schemaPath=v.schemaPath,this.localRefs=v.localRefs,this.meta=v.meta,this.$async=T?.$async,this.refs={}}}t.SchemaEnv=l;function u(E){let v=h.call(this,E);if(v)return v;let S=(0,o.getFullPath)(this.opts.uriResolver,E.root.baseId),{es5:T,lines:w}=this.opts.code,{ownProperties:R}=this.opts,x=new e.CodeGen(this.scope,{es5:T,lines:w,ownProperties:R}),k;E.$async&&(k=x.scopeValue("Error",{ref:r.default,code:e._`require("ajv/dist/runtime/validation_error").default`}));let D=x.scopeName("validate");E.validateName=D;let N={gen:x,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:x.scopeValue("schema",this.opts.code.source===!0?{ref:E.schema,code:(0,e.stringify)(E.schema)}:{ref:E.schema}),validateName:D,ValidationError:k,schema:E.schema,schemaEnv:E,rootId:S,baseId:E.baseId||S,schemaPath:e.nil,errSchemaPath:E.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this},O;try{this._compilations.add(E),(0,c.validateFunctionCode)(N),x.optimize(this.opts.code.optimize);let B=x.toString();O=`${x.scopeRefs(n.default.scope)}return ${B}`,this.opts.code.process&&(O=this.opts.code.process(O,E));let q=Function(`${n.default.self}`,`${n.default.scope}`,O)(this,this.scope.get());if(this.scope.value(D,{ref:q}),q.errors=null,q.schema=E.schema,q.schemaEnv=E,E.$async&&(q.$async=!0),this.opts.code.source===!0&&(q.source={validateName:D,validateCode:B,scopeValues:x._values}),this.opts.unevaluated){let{props:M,items:L}=N;q.evaluated={props:M instanceof e.Name?void 0:M,items:L instanceof e.Name?void 0:L,dynamicProps:M instanceof e.Name,dynamicItems:L instanceof e.Name},q.source&&(q.source.evaluated=(0,e.stringify)(q.evaluated))}return E.validate=q,E}catch(B){throw delete E.validate,delete E.validateName,O&&this.logger.error("Error compiling schema, function code:",O),B}finally{this._compilations.delete(E)}}a(u,"xB"),t.compileSchema=u;function d(E,v,S){var T;S=(0,o.resolveUrl)(this.opts.uriResolver,v,S);let w=E.refs[S];if(w)return w;let R=g.call(this,E,S);if(R===void 0){let x=(T=E.localRefs)===null||T===void 0?void 0:T[S],{schemaId:k}=this.opts;x&&(R=new l({schema:x,schemaId:k,root:E,baseId:v}))}if(R!==void 0)return E.refs[S]=f.call(this,R)}a(d,"tn"),t.resolveRef=d;function f(E){return(0,o.inlineRef)(E.schema,this.opts.inlineRefs)?E.schema:E.validate?E:u.call(this,E)}a(f,"an");function h(E){for(let v of this._compilations)if(m(v,E))return v}a(h,"XI"),t.getCompilingSchema=h;function m(E,v){return E.schema===v.schema&&E.root===v.root&&E.baseId===v.baseId}a(m,"sn");function g(E,v){let S;for(;typeof(S=this.refs[v])=="string";)v=S;return S||this.schemas[v]||A.call(this,E,v)}a(g,"en");function A(E,v){let S=this.opts.uriResolver.parse(v),T=(0,o._getFullPath)(this.opts.uriResolver,S),w=(0,o.getFullPath)(this.opts.uriResolver,E.baseId,void 0);if(Object.keys(E.schema).length>0&&T===w)return _.call(this,S,E);let R=(0,o.normalizeId)(T),x=this.refs[R]||this.schemas[R];if(typeof x=="string"){let k=A.call(this,E,x);return typeof k?.schema!="object"?void 0:_.call(this,S,k)}if(typeof x?.schema=="object"){if(x.validate||u.call(this,x),R===(0,o.normalizeId)(v)){let{schema:k}=x,{schemaId:D}=this.opts,N=k[D];return N&&(w=(0,o.resolveUrl)(this.opts.uriResolver,w,N)),new l({schema:k,schemaId:D,root:E,baseId:w})}return _.call(this,S,x)}}a(A,"EW"),t.resolveSchema=A;var y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _(E,{baseId:v,schema:S,root:T}){var w;if(((w=E.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let k of E.fragment.slice(1).split("/")){if(typeof S=="boolean")return;let D=S[(0,s.unescapeFragment)(k)];if(D===void 0)return;S=D;let N=typeof S=="object"&&S[this.opts.schemaId];!y.has(k)&&N&&(v=(0,o.resolveUrl)(this.opts.uriResolver,v,N))}let R;if(typeof S!="boolean"&&S.$ref&&!(0,s.schemaHasRulesButRef)(S,this.RULES)){let k=(0,o.resolveUrl)(this.opts.uriResolver,v,S.$ref);R=A.call(this,T,k)}let{schemaId:x}=this.opts;if(R=R||new l({schema:S,schemaId:x,root:T,baseId:v}),R.schema!==R.root.schema)return R}a(_,"TB")}),nWc=jt((t,e)=>{e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),joo=jt((t,e)=>{var r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),n=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),o=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),c=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function l(x){let k="",D=0,N=0;for(N=0;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";k+=x[N];break}for(N+=1;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";k+=x[N]}return k}a(l,"fB");var u=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function d(x){return x.length=0,!0}a(d,"UI");function f(x,k,D){if(x.length){let N=l(x);if(N!=="")k.push(N);else return D.error=!0,!1;x.length=0}return!0}a(f,"Kr");function h(x){let k=0,D={error:!1,address:"",zone:""},N=[],O=[],B=!1,q=!1,M=f;for(let L=0;L7){D.error=!0;break}L>0&&x[L-1]===":"&&(B=!0),N.push(":");continue}else if(U==="%"){if(!M(O,N,D))break;M=d}else{O.push(U);continue}}return O.length&&(M===d?D.zone=O.join(""):q?N.push(O.join("")):N.push(l(O))),D.address=N.join(""),D}a(h,"qr");function m(x){if(g(x,":")<2)return{host:x,isIPV6:!1};let k=h(x);if(k.error)return{host:x,isIPV6:!1};{let{address:D,address:N}=k;return k.zone&&(D+="%"+k.zone,N+="%25"+k.zone),{host:D,isIPV6:!0,escapedHost:N}}}a(m,"qI");function g(x,k){let D=0;for(let N=0;Ny[N])}a(v,"VI");function S(x,k=!1){if(x.indexOf("%")===-1)return x;let D="";for(let N=0;N{var{isUUID:r}=joo(),n=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,o=["http","https","ws","wss","urn","urn:uuid"];function s(x){return o.indexOf(x)!==-1}a(s,"Ar");function c(x){return x.secure===!0?!0:x.secure===!1?!1:x.scheme?x.scheme.length===3&&(x.scheme[0]==="w"||x.scheme[0]==="W")&&(x.scheme[1]==="s"||x.scheme[1]==="S")&&(x.scheme[2]==="s"||x.scheme[2]==="S"):!1}a(c,"hB");function l(x){return x.host||(x.error=x.error||"HTTP URIs must have a host."),x}a(l,"zI");function u(x){let k=String(x.scheme).toLowerCase()==="https";return(x.port===(k?443:80)||x.port==="")&&(x.port=void 0),x.path||(x.path="/"),x}a(u,"NI");function d(x){return x.secure=c(x),x.resourceName=(x.path||"/")+(x.query?"?"+x.query:""),x.path=void 0,x.query=void 0,x}a(d,"Ir");function f(x){if((x.port===(c(x)?443:80)||x.port==="")&&(x.port=void 0),typeof x.secure=="boolean"&&(x.scheme=x.secure?"wss":"ws",x.secure=void 0),x.resourceName){let[k,D]=x.resourceName.split("?");x.path=k&&k!=="/"?k:void 0,x.query=D,x.resourceName=void 0}return x.fragment=void 0,x}a(f,"Rr");function h(x,k){if(!x.path)return x.error="URN can not be parsed",x;let D=x.path.match(n);if(D){let N=k.scheme||x.scheme||"urn";x.nid=D[1].toLowerCase(),x.nss=D[2];let O=`${N}:${k.nid||x.nid}`,B=R(O);x.path=void 0,B&&(x=B.parse(x,k))}else x.error=x.error||"URN can not be parsed.";return x}a(h,"Pr");function m(x,k){if(x.nid===void 0)throw Error("URN without nid cannot be serialized");let D=k.scheme||x.scheme||"urn",N=x.nid.toLowerCase(),O=`${D}:${k.nid||N}`,B=R(O);B&&(x=B.serialize(x,k));let q=x,M=x.nss;return q.path=`${N||k.nid}:${M}`,k.skipEscape=!0,q}a(m,"Er");function g(x,k){let D=x;return D.uuid=D.nss,D.nss=void 0,!k.tolerant&&(!D.uuid||!r(D.uuid))&&(D.error=D.error||"UUID is not valid."),D}a(g,"br");function A(x){let k=x;return k.nss=(x.uuid||"").toLowerCase(),k}a(A,"_r");var y={scheme:"http",domainHost:!0,parse:l,serialize:u},_={scheme:"https",domainHost:y.domainHost,parse:l,serialize:u},E={scheme:"ws",domainHost:!0,parse:d,serialize:f},v={scheme:"wss",domainHost:E.domainHost,parse:E.parse,serialize:E.serialize},S={scheme:"urn",parse:h,serialize:m,skipNormalize:!0},T={scheme:"urn:uuid",parse:g,serialize:A,skipNormalize:!0},w={http:y,https:_,ws:E,wss:v,urn:S,"urn:uuid":T};Object.setPrototypeOf(w,null);function R(x){return x&&(w[x]||w[x.toLowerCase()])||void 0}a(R,"uB"),e.exports={wsIsSecure:c,SCHEMES:w,isValidSchemeName:s,getSchemeHandler:R}}),oWc=jt((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=joo(),{SCHEMES:h,getSchemeHandler:m}=iWc();function g(N,O){return typeof N=="string"?N=R(N,O):typeof N=="object"&&(N=w(E(N,O),O)),N}a(g,"cr");function A(N,O,B){let q=B?Object.assign({scheme:"null"},B):{scheme:"null"},M=y(w(N,q),w(O,q),q,!0);return q.skipEscape=!0,E(M,q)}a(A,"pr");function y(N,O,B,q){let M={};return q||(N=w(E(N,B),B),O=w(E(O,B),B)),B=B||{},!B.tolerant&&O.scheme?(M.scheme=O.scheme,M.userinfo=O.userinfo,M.host=O.host,M.port=O.port,M.path=n(O.path||""),M.query=O.query):(O.userinfo!==void 0||O.host!==void 0||O.port!==void 0?(M.userinfo=O.userinfo,M.host=O.host,M.port=O.port,M.path=n(O.path||""),M.query=O.query):(O.path?(O.path[0]==="/"?M.path=n(O.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?M.path="/"+O.path:N.path?M.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+O.path:M.path=O.path,M.path=n(M.path)),M.query=O.query):(M.path=N.path,O.query!==void 0?M.query=O.query:M.query=N.query),M.userinfo=N.userinfo,M.host=N.host,M.port=N.port),M.scheme=N.scheme),M.fragment=O.fragment,M}a(y,"MI");function _(N,O,B){let q=k(N,B),M=k(O,B);return q!==void 0&&M!==void 0&&q.toLowerCase()===M.toLowerCase()}a(_,"dr");function E(N,O){let B={host:N.host,scheme:N.scheme,userinfo:N.userinfo,port:N.port,path:N.path,query:N.query,nid:N.nid,nss:N.nss,uuid:N.uuid,fragment:N.fragment,reference:N.reference,resourceName:N.resourceName,secure:N.secure,error:""},q=Object.assign({},O),M=[],L=m(q.scheme||B.scheme);L&&L.serialize&&L.serialize(B,q),B.path!==void 0&&(q.skipEscape?B.path=s(B.path):(B.path=l(B.path),B.scheme!==void 0&&(B.path=B.path.split("%3A").join(":")))),q.reference!=="suffix"&&B.scheme&&M.push(B.scheme,":");let U=o(B);if(U!==void 0&&(q.reference!=="suffix"&&M.push("//"),M.push(U),B.path&&B.path[0]!=="/"&&M.push("/")),B.path!==void 0){let j=B.path;!q.absolutePath&&(!L||!L.absolutePath)&&(j=n(j)),U===void 0&&j[0]==="/"&&j[1]==="/"&&(j="/%2F"+j.slice(2)),M.push(j)}return B.query!==void 0&&M.push("?",B.query),B.fragment!==void 0&&M.push("#",B.fragment),M.join("")}a(E,"y0");var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function S(N,O){if(O[2]!==void 0&&N.path&&N.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof N.port=="number"&&(N.port<0||N.port>65535))return"URI port is malformed."}a(S,"nr");function T(N,O){let B=Object.assign({},O),q={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},M=!1,L=!1;B.reference==="suffix"&&(B.scheme?N=B.scheme+":"+N:N="//"+N);let U=N.match(v);if(U){q.scheme=U[1],q.userinfo=U[3],q.host=U[4],q.port=parseInt(U[5],10),q.path=U[6]||"",q.query=U[7],q.fragment=U[8],isNaN(q.port)&&(q.port=U[5]);let j=S(q,U);if(j!==void 0&&(q.error=q.error||j,M=!0),q.host)if(d(q.host)===!1){let Y=r(q.host);q.host=Y.host.toLowerCase(),L=Y.isIPV6}else L=!0;q.scheme===void 0&&q.userinfo===void 0&&q.host===void 0&&q.port===void 0&&q.query===void 0&&!q.path?q.reference="same-document":q.scheme===void 0?q.reference="relative":q.fragment===void 0?q.reference="absolute":q.reference="uri",B.reference&&B.reference!=="suffix"&&B.reference!==q.reference&&(q.error=q.error||"URI is not a "+B.reference+" reference.");let Q=m(B.scheme||q.scheme);if(!B.unicodeSupport&&(!Q||!Q.unicodeSupport)&&q.host&&(B.domainHost||Q&&Q.domainHost)&&L===!1&&f(q.host))try{q.host=URL.domainToASCII(q.host.toLowerCase())}catch(Y){q.error=q.error||"Host's domain name can not be converted to ASCII: "+Y}if((!Q||Q&&!Q.skipNormalize)&&(N.indexOf("%")!==-1&&(q.scheme!==void 0&&(q.scheme=unescape(q.scheme)),q.host!==void 0&&(q.host=u(unescape(q.host),L))),q.path&&(q.path=c(q.path)),q.fragment))try{q.fragment=encodeURI(decodeURIComponent(q.fragment))}catch{q.error=q.error||"URI malformed"}Q&&Q.parse&&Q.parse(q,B)}else q.error=q.error||"URI can not be parsed.";return{parsed:q,malformedAuthorityOrPort:M}}a(T,"LI");function w(N,O){return T(N,O).parsed}a(w,"w9");function R(N,O){return x(N,O).normalized}a(R,"rr");function x(N,O){let{parsed:B,malformedAuthorityOrPort:q}=T(N,O);return{normalized:q?N:E(B,O),malformedAuthorityOrPort:q}}a(x,"jI");function k(N,O){if(typeof N=="string"){let{normalized:B,malformedAuthorityOrPort:q}=x(N,O);return q?void 0:B}if(typeof N=="object")return E(N,O)}a(k,"FI");var D={SCHEMES:h,normalize:g,resolve:A,resolveComponent:y,equal:_,serialize:E,parse:w};e.exports=D,e.exports.default=D,e.exports.fastUri=D}),sWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=oWc();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),aWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=ePt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=Fs();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return r._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return r.str},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return r.stringify},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return r.nil},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return r.Name},"get")}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:a(function(){return r.CodeGen},"get")});var n=Sqr(),o=tPt(),s=Uoo(),c=Tqr(),l=Fs(),u=Xkt(),d=PRt(),f=Sc(),h=nWc(),m=sWc(),g=a((W,V)=>new RegExp(W,V),"vI");g.code="new RegExp";var A=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),_={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},E={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function S(W){var V,z,ie,H,re,le,Le,me,Oe,Te,te,ee,K,he,X,de,Be,ne,ue,Ne,xe,Fe,tt,st,vt;let Pt=W.strict,Ht=(V=W.code)===null||V===void 0?void 0:V.optimize,F=Ht===!0||Ht===void 0?1:Ht||0,se=(ie=(z=W.code)===null||z===void 0?void 0:z.regExp)!==null&&ie!==void 0?ie:g,be=(H=W.uriResolver)!==null&&H!==void 0?H:m.default;return{strictSchema:(le=(re=W.strictSchema)!==null&&re!==void 0?re:Pt)!==null&&le!==void 0?le:!0,strictNumbers:(me=(Le=W.strictNumbers)!==null&&Le!==void 0?Le:Pt)!==null&&me!==void 0?me:!0,strictTypes:(Te=(Oe=W.strictTypes)!==null&&Oe!==void 0?Oe:Pt)!==null&&Te!==void 0?Te:"log",strictTuples:(ee=(te=W.strictTuples)!==null&&te!==void 0?te:Pt)!==null&&ee!==void 0?ee:"log",strictRequired:(he=(K=W.strictRequired)!==null&&K!==void 0?K:Pt)!==null&&he!==void 0?he:!1,code:W.code?{...W.code,optimize:F,regExp:se}:{optimize:F,regExp:se},loopRequired:(X=W.loopRequired)!==null&&X!==void 0?X:v,loopEnum:(de=W.loopEnum)!==null&&de!==void 0?de:v,meta:(Be=W.meta)!==null&&Be!==void 0?Be:!0,messages:(ne=W.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(ue=W.inlineRefs)!==null&&ue!==void 0?ue:!0,schemaId:(Ne=W.schemaId)!==null&&Ne!==void 0?Ne:"$id",addUsedSchema:(xe=W.addUsedSchema)!==null&&xe!==void 0?xe:!0,validateSchema:(Fe=W.validateSchema)!==null&&Fe!==void 0?Fe:!0,validateFormats:(tt=W.validateFormats)!==null&&tt!==void 0?tt:!0,unicodeRegExp:(st=W.unicodeRegExp)!==null&&st!==void 0?st:!0,int32range:(vt=W.int32range)!==null&&vt!==void 0?vt:!0,uriResolver:be}}a(S,"Wo");class T{static{a(this,"CW")}constructor(V={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,V=this.opts={...V,...S(V)};let{es5:z,lines:ie}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:z,lines:ie}),this.logger=B(V.logger);let H=V.validateFormats;V.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,_,V,"NOT SUPPORTED"),w.call(this,E,V,"DEPRECATED","warn"),this._metaOpts=N.call(this),V.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),V.keywords&&D.call(this,V.keywords),typeof V.meta=="object"&&this.addMetaSchema(V.meta),x.call(this),V.validateFormats=H}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:V,meta:z,schemaId:ie}=this.opts,H=h;ie==="id"&&(H={...h},H.id=H.$id,delete H.$id),z&&V&&this.addMetaSchema(H,H[ie],!1)}defaultMeta(){let{meta:V,schemaId:z}=this.opts;return this.opts.defaultMeta=typeof V=="object"?V[z]||V:void 0}validate(V,z){let ie;if(typeof V=="string"){if(ie=this.getSchema(V),!ie)throw Error(`no schema with key or ref "${V}"`)}else ie=this.compile(V);let H=ie(z);return"$async"in ie||(this.errors=ie.errors),H}compile(V,z){let ie=this._addSchema(V,z);return ie.validate||this._compileSchemaEnv(ie)}compileAsync(V,z){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:ie}=this.opts;return H.call(this,V,z);async function H(Te,te){await re.call(this,Te.$schema);let ee=this._addSchema(Te,te);return ee.validate||le.call(this,ee)}async function re(Te){Te&&!this.getSchema(Te)&&await H.call(this,{$ref:Te},!0)}async function le(Te){try{return this._compileSchemaEnv(Te)}catch(te){if(!(te instanceof o.default))throw te;return Le.call(this,te),await me.call(this,te.missingSchema),le.call(this,Te)}}function Le({missingSchema:Te,missingRef:te}){if(this.refs[Te])throw Error(`AnySchema ${Te} is loaded but ${te} cannot be resolved`)}async function me(Te){let te=await Oe.call(this,Te);this.refs[Te]||await re.call(this,te.$schema),this.refs[Te]||this.addSchema(te,Te,z)}async function Oe(Te){let te=this._loading[Te];if(te)return te;try{return await(this._loading[Te]=ie(Te))}finally{delete this._loading[Te]}}}addSchema(V,z,ie,H=this.opts.validateSchema){if(Array.isArray(V)){for(let le of V)this.addSchema(le,void 0,ie,H);return this}let re;if(typeof V=="object"){let{schemaId:le}=this.opts;if(re=V[le],re!==void 0&&typeof re!="string")throw Error(`schema ${le} must be string`)}return z=(0,u.normalizeId)(z||re),this._checkUnique(z),this.schemas[z]=this._addSchema(V,ie,z,H,!0),this}addMetaSchema(V,z,ie=this.opts.validateSchema){return this.addSchema(V,z,!0,ie),this}validateSchema(V,z){if(typeof V=="boolean")return!0;let ie;if(ie=V.$schema,ie!==void 0&&typeof ie!="string")throw Error("$schema must be a string");if(ie=ie||this.opts.defaultMeta||this.defaultMeta(),!ie)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let H=this.validate(ie,V);if(!H&&z){let re="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(re);else throw Error(re)}return H}getSchema(V){let z;for(;typeof(z=R.call(this,V))=="string";)V=z;if(z===void 0){let{schemaId:ie}=this.opts,H=new c.SchemaEnv({schema:{},schemaId:ie});if(z=c.resolveSchema.call(this,H,V),!z)return;this.refs[V]=z}return z.validate||this._compileSchemaEnv(z)}removeSchema(V){if(V instanceof RegExp)return this._removeAllSchemas(this.schemas,V),this._removeAllSchemas(this.refs,V),this;switch(typeof V){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let z=R.call(this,V);return typeof z=="object"&&this._cache.delete(z.schema),delete this.schemas[V],delete this.refs[V],this}case"object":{let z=V;this._cache.delete(z);let ie=V[this.opts.schemaId];return ie&&(ie=(0,u.normalizeId)(ie),delete this.schemas[ie],delete this.refs[ie]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(V){for(let z of V)this.addKeyword(z);return this}addKeyword(V,z){let ie;if(typeof V=="string")ie=V,typeof z=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),z.keyword=ie);else if(typeof V=="object"&&z===void 0){if(z=V,ie=z.keyword,Array.isArray(ie)&&!ie.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(M.call(this,ie,z),!z)return(0,f.eachItem)(ie,re=>L.call(this,re)),this;j.call(this,z);let H={...z,type:(0,d.getJSONTypes)(z.type),schemaType:(0,d.getJSONTypes)(z.schemaType)};return(0,f.eachItem)(ie,H.type.length===0?re=>L.call(this,re,H):re=>H.type.forEach(le=>L.call(this,re,H,le))),this}getKeyword(V){let z=this.RULES.all[V];return typeof z=="object"?z.definition:!!z}removeKeyword(V){let{RULES:z}=this;delete z.keywords[V],delete z.all[V];for(let ie of z.rules){let H=ie.rules.findIndex(re=>re.keyword===V);H>=0&&ie.rules.splice(H,1)}return this}addFormat(V,z){return typeof z=="string"&&(z=new RegExp(z)),this.formats[V]=z,this}errorsText(V=this.errors,{separator:z=", ",dataVar:ie="data"}={}){return!V||V.length===0?"No errors":V.map(H=>`${ie}${H.instancePath} ${H.message}`).reduce((H,re)=>H+z+re)}$dataMetaSchema(V,z){let ie=this.RULES.all;V=JSON.parse(JSON.stringify(V));for(let H of z){let re=H.split("/").slice(1),le=V;for(let Le of re)le=le[Le];for(let Le in ie){let me=ie[Le];if(typeof me!="object")continue;let{$data:Oe}=me.definition,Te=le[Le];Oe&&Te&&(le[Le]=Y(Te))}}return V}_removeAllSchemas(V,z){for(let ie in V){let H=V[ie];(!z||z.test(ie))&&(typeof H=="string"?delete V[ie]:H&&!H.meta&&(this._cache.delete(H.schema),delete V[ie]))}}_addSchema(V,z,ie,H=this.opts.validateSchema,re=this.opts.addUsedSchema){let le,{schemaId:Le}=this.opts;if(typeof V=="object")le=V[Le];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof V!="boolean")throw Error("schema must be object or boolean")}let me=this._cache.get(V);if(me!==void 0)return me;ie=(0,u.normalizeId)(le||ie);let Oe=u.getSchemaRefs.call(this,V,ie);return me=new c.SchemaEnv({schema:V,schemaId:Le,meta:z,baseId:ie,localRefs:Oe}),this._cache.set(me.schema,me),re&&!ie.startsWith("#")&&(ie&&this._checkUnique(ie),this.refs[ie]=me),H&&this.validateSchema(V,!0),me}_checkUnique(V){if(this.schemas[V]||this.refs[V])throw Error(`schema with key or id "${V}" already exists`)}_compileSchemaEnv(V){if(V.meta?this._compileMetaSchema(V):c.compileSchema.call(this,V),!V.validate)throw Error("ajv implementation error");return V.validate}_compileMetaSchema(V){let z=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,V)}finally{this.opts=z}}}T.ValidationError=n.default,T.MissingRefError=o.default,t.default=T;function w(W,V,z,ie="error"){for(let H in W){let re=H;re in V&&this.logger[ie](`${z}: option ${H}. ${W[re]}`)}}a(w,"_I");function R(W){return W=(0,u.normalizeId)(W),this.schemas[W]||this.refs[W]}a(R,"kI");function x(){let W=this.opts.schemas;if(W)if(Array.isArray(W))this.addSchema(W);else for(let V in W)this.addSchema(W[V],V)}a(x,"Go");function k(){for(let W in this.opts.formats){let V=this.opts.formats[W];V&&this.addFormat(W,V)}}a(k,"Uo");function D(W){if(Array.isArray(W)){this.addVocabulary(W);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let V in W){let z=W[V];z.keyword||(z.keyword=V),this.addKeyword(z)}}a(D,"Ho");function N(){let W={...this.opts};for(let V of A)delete W[V];return W}a(N,"Ko");var O={log(){},warn(){},error(){}};function B(W){if(W===!1)return O;if(W===void 0)return console;if(W.log&&W.warn&&W.error)return W;throw Error("logger must implement log, warn and error methods")}a(B,"Vo");var q=/^[a-z_$][a-z0-9_$:-]*$/i;function M(W,V){let{RULES:z}=this;if((0,f.eachItem)(W,ie=>{if(z.keywords[ie])throw Error(`Keyword ${ie} is already defined`);if(!q.test(ie))throw Error(`Keyword ${ie} has invalid name`)}),!!V&&V.$data&&!("code"in V||"validate"in V))throw Error('$data keyword must have "code" or "validate" function')}a(M,"zo");function L(W,V,z){var ie;let H=V?.post;if(z&&H)throw Error('keyword with "post" flag cannot have "type"');let{RULES:re}=this,le=H?re.post:re.rules.find(({type:me})=>me===z);if(le||(le={type:z,rules:[]},re.rules.push(le)),re.keywords[W]=!0,!V)return;let Le={keyword:W,definition:{...V,type:(0,d.getJSONTypes)(V.type),schemaType:(0,d.getJSONTypes)(V.schemaType)}};V.before?U.call(this,le,Le,V.before):le.rules.push(Le),re.all[W]=Le,(ie=V.implements)===null||ie===void 0||ie.forEach(me=>this.addKeyword(me))}a(L,"lB");function U(W,V,z){let ie=W.rules.findIndex(H=>H.keyword===z);ie>=0?W.rules.splice(ie,0,V):(W.rules.push(V),this.logger.warn(`rule ${z} is not defined`))}a(U,"No");function j(W){let{metaSchema:V}=W;V!==void 0&&(W.$data&&this.opts.$data&&(V=Y(V)),W.validateSchema=this.compile(V,!0))}a(j,"wo");var Q={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Y(W){return{anyOf:[W,Q]}}a(Y,"CI")}),cWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=e}),lWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=tPt(),r=vM(),n=Fs(),o=cz(),s=Tqr(),c=Sc(),l={keyword:"$ref",schemaType:"string",code(f){let{gen:h,schema:m,it:g}=f,{baseId:A,schemaEnv:y,validateName:_,opts:E,self:v}=g,{root:S}=y;if((m==="#"||m==="#/")&&A===S.baseId)return w();let T=s.resolveRef.call(v,S,A,m);if(T===void 0)throw new e.default(g.opts.uriResolver,A,m);if(T instanceof s.SchemaEnv)return R(T);return x(T);function w(){if(y===S)return d(f,_,y,y.$async);let k=h.scopeValue("root",{ref:S});return d(f,n._`${k}.validate`,S,S.$async)}function R(k){let D=u(f,k);d(f,D,k,k.$async)}function x(k){let D=h.scopeValue("schema",E.code.source===!0?{ref:k,code:(0,n.stringify)(k)}:{ref:k}),N=h.name("valid"),O=f.subschema({schema:k,dataTypes:[],schemaPath:n.nil,topSchemaRef:D,errSchemaPath:m},N);f.mergeEvaluated(O),f.ok(N)}}};function u(f,h){let{gen:m}=f;return h.validate?m.scopeValue("validate",{ref:h.validate}):n._`${m.scopeValue("wrapper",{ref:h})}.validate`}a(u,"hI"),t.getValidate=u;function d(f,h,m,g){let{gen:A,it:y}=f,{allErrors:_,schemaEnv:E,opts:v}=y,S=v.passContext?o.default.this:n.nil;g?T():w();function T(){if(!E.$async)throw Error("async schema referenced by sync schema");let k=A.let("valid");A.try(()=>{A.code(n._`await ${(0,r.callValidateCode)(f,h,S)}`),x(h),!_&&A.assign(k,!0)},D=>{A.if(n._`!(${D} instanceof ${y.ValidationError})`,()=>A.throw(D)),R(D),!_&&A.assign(k,!1)}),f.ok(k)}a(T,"V");function w(){f.result((0,r.callValidateCode)(f,h,S),()=>x(h),()=>R(h))}a(w,"B");function R(k){let D=n._`${k}.errors`;A.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${D} : ${o.default.vErrors}.concat(${D})`),A.assign(o.default.errors,n._`${o.default.vErrors}.length`)}a(R,"z");function x(k){var D;if(!y.opts.unevaluated)return;let N=(D=m?.validate)===null||D===void 0?void 0:D.evaluated;if(y.props!==!0)if(N&&!N.dynamicProps)N.props!==void 0&&(y.props=c.mergeEvaluated.props(A,N.props,y.props));else{let O=A.var("props",n._`${k}.evaluated.props`);y.props=c.mergeEvaluated.props(A,O,y.props,n.Name)}if(y.items!==!0)if(N&&!N.dynamicItems)N.items!==void 0&&(y.items=c.mergeEvaluated.items(A,N.items,y.items));else{let O=A.var("items",n._`${k}.evaluated.items`);y.items=c.mergeEvaluated.items(A,O,y.items,n.Name)}}a(x,"N")}a(d,"xW"),t.callRef=d,t.default=l}),uWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=cWc(),r=lWc(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),dWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=e.operators,n={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},o={message:a(({keyword:c,schemaCode:l})=>e.str`must be ${n[c].okStr} ${l}`,"message"),params:a(({keyword:c,schemaCode:l})=>e._`{comparison: ${n[c].okStr}, limit: ${l}}`,"params")},s={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:o,code(c){let{keyword:l,data:u,schemaCode:d}=c;c.fail$data(e._`${u} ${n[l].fail} ${d} || isNaN(${u})`)}};t.default=s}),fWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r={message:a(({schemaCode:o})=>e.str`must be multiple of ${o}`,"message"),params:a(({schemaCode:o})=>e._`{multipleOf: ${o}}`,"params")},n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:r,code(o){let{gen:s,data:c,schemaCode:l,it:u}=o,d=u.opts.multipleOfPrecision,f=s.let("res"),h=d?e._`Math.abs(Math.round(${f}) - ${f}) > 1e-${d}`:e._`${f} !== parseInt(${f})`;o.fail$data(e._`(${l} === 0 || (${f} = ${c}/${l}, ${h}))`)}};t.default=n}),pWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});function e(r){let n=r.length,o=0,s=0,c;for(;s=55296&&c<=56319&&s{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n=pWc(),o={message({keyword:c,schemaCode:l}){let u=c==="maxLength"?"more":"fewer";return e.str`must NOT have ${u} than ${l} characters`},params:a(({schemaCode:c})=>e._`{limit: ${c}}`,"params")},s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:o,code(c){let{keyword:l,data:u,schemaCode:d,it:f}=c,h=l==="maxLength"?e.operators.GT:e.operators.LT,m=f.opts.unicode===!1?e._`${u}.length`:e._`${(0,r.useFunc)(c.gen,n.default)}(${u})`;c.fail$data(e._`${m} ${h} ${d}`)}};t.default=s}),mWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=vM(),r=Sc(),n=Fs(),o={message:a(({schemaCode:c})=>n.str`must match pattern "${c}"`,"message"),params:a(({schemaCode:c})=>n._`{pattern: ${c}}`,"params")},s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schema:f,schemaCode:h,it:m}=c,g=m.opts.unicodeRegExp?"u":"";if(d){let{regExp:A}=m.opts.code,y=A.code==="new RegExp"?n._`new RegExp`:(0,r.useFunc)(l,A),_=l.let("valid");l.try(()=>l.assign(_,n._`${y}(${h}, ${g}).test(${u})`),()=>l.assign(_,!1)),c.fail$data(n._`!${_}`)}else{let A=(0,e.usePattern)(c,f);c.fail$data(n._`!${A}.test(${u})`)}}};t.default=s}),gWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r={message({keyword:o,schemaCode:s}){let c=o==="maxProperties"?"more":"fewer";return e.str`must NOT have ${c} than ${s} properties`},params:a(({schemaCode:o})=>e._`{limit: ${o}}`,"params")},n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:r,code(o){let{keyword:s,data:c,schemaCode:l}=o,u=s==="maxProperties"?e.operators.GT:e.operators.LT;o.fail$data(e._`Object.keys(${c}).length ${u} ${l}`)}};t.default=n}),AWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=vM(),r=Fs(),n=Sc(),o={message:a(({params:{missingProperty:c}})=>r.str`must have required property '${c}'`,"message"),params:a(({params:{missingProperty:c}})=>r._`{missingProperty: ${c}}`,"params")},s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:o,code(c){let{gen:l,schema:u,schemaCode:d,data:f,$data:h,it:m}=c,{opts:g}=m;if(!h&&u.length===0)return;let A=u.length>=g.loopRequired;if(m.allErrors?y():_(),g.strictRequired){let S=c.parentSchema.properties,{definedProperties:T}=c.it;for(let w of u)if(S?.[w]===void 0&&!T.has(w)){let R=m.schemaEnv.baseId+m.errSchemaPath,x=`required property "${w}" is not defined at "${R}" (strictRequired)`;(0,n.checkStrictMode)(m,x,m.opts.strictRequired)}}function y(){if(A||h)c.block$data(r.nil,E);else for(let S of u)(0,e.checkReportMissingProp)(c,S)}a(y,"q");function _(){let S=l.let("missing");if(A||h){let T=l.let("valid",!0);c.block$data(T,()=>v(S,T)),c.ok(T)}else l.if((0,e.checkMissingProp)(c,u,S)),(0,e.reportMissingProp)(c,S),l.else()}a(_,"V");function E(){l.forOf("prop",d,S=>{c.setParams({missingProperty:S}),l.if((0,e.noPropertyInData)(l,f,S,g.ownProperties),()=>c.error())})}a(E,"B");function v(S,T){c.setParams({missingProperty:S}),l.forOf(S,d,()=>{l.assign(T,(0,e.propertyInData)(l,f,S,g.ownProperties)),l.if((0,r.not)(T),()=>{c.error(),l.break()})},r.nil)}a(v,"z")}};t.default=s}),yWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r={message({keyword:o,schemaCode:s}){let c=o==="maxItems"?"more":"fewer";return e.str`must NOT have ${c} than ${s} items`},params:a(({schemaCode:o})=>e._`{limit: ${o}}`,"params")},n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:r,code(o){let{keyword:s,data:c,schemaCode:l}=o,u=s==="maxItems"?e.operators.GT:e.operators.LT;o.fail$data(e._`${c}.length ${u} ${l}`)}};t.default=n}),Iqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=qoo();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),_Wc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=PRt(),r=Fs(),n=Sc(),o=Iqr(),s={message:a(({params:{i:l,j:u}})=>r.str`must NOT have duplicate items (items ## ${u} and ${l} are identical)`,"message"),params:a(({params:{i:l,j:u}})=>r._`{i: ${l}, j: ${u}}`,"params")},c={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:s,code(l){let{gen:u,data:d,$data:f,schema:h,parentSchema:m,schemaCode:g,it:A}=l;if(!f&&!h)return;let y=u.let("valid"),_=m.items?(0,e.getSchemaTypes)(m.items):[];l.block$data(y,E,r._`${g} === false`),l.ok(y);function E(){let w=u.let("i",r._`${d}.length`),R=u.let("j");l.setParams({i:w,j:R}),u.assign(y,!0),u.if(r._`${w} > 1`,()=>(v()?S:T)(w,R))}a(E,"V");function v(){return _.length>0&&!_.some(w=>w==="object"||w==="array")}a(v,"B");function S(w,R){let x=u.name("item"),k=(0,e.checkDataTypes)(_,x,A.opts.strictNumbers,e.DataType.Wrong),D=u.const("indices",r._`{}`);u.for(r._`;${w}--;`,()=>{u.let(x,r._`${d}[${w}]`),u.if(k,r._`continue`),_.length>1&&u.if(r._`typeof ${x} == "string"`,r._`${x} += "_"`),u.if(r._`typeof ${D}[${x}] == "number"`,()=>{u.assign(R,r._`${D}[${x}]`),l.error(),u.assign(y,!1).break()}).code(r._`${D}[${x}] = ${w}`)})}a(S,"z");function T(w,R){let x=(0,n.useFunc)(u,o.default),k=u.name("outer");u.label(k).for(r._`;${w}--;`,()=>u.for(r._`${R} = ${w}; ${R}--;`,()=>u.if(r._`${x}(${d}[${w}], ${d}[${R}])`,()=>{l.error(),u.assign(y,!1).break(k)})))}a(T,"N")}};t.default=c}),EWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n=Iqr(),o={message:"must be equal to constant",params:a(({schemaCode:c})=>e._`{allowedValue: ${c}}`,"params")},s={keyword:"const",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schemaCode:f,schema:h}=c;d||h&&typeof h=="object"?c.fail$data(e._`!${(0,r.useFunc)(l,n.default)}(${u}, ${f})`):c.fail(e._`${h} !== ${u}`)}};t.default=s}),vWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n=Iqr(),o={message:"must be equal to one of the allowed values",params:a(({schemaCode:c})=>e._`{allowedValues: ${c}}`,"params")},s={keyword:"enum",schemaType:"array",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schema:f,schemaCode:h,it:m}=c;if(!d&&f.length===0)throw Error("enum must have non-empty array");let g=f.length>=m.opts.loopEnum,A,y=a(()=>A??(A=(0,r.useFunc)(l,n.default)),"q"),_;if(g||d)_=l.let("valid"),c.block$data(_,E);else{if(!Array.isArray(f))throw Error("ajv implementation error");let S=l.const("vSchema",h);_=(0,e.or)(...f.map((T,w)=>v(S,w)))}c.pass(_);function E(){l.assign(_,!1),l.forOf("v",h,S=>l.if(e._`${y()}(${u}, ${S})`,()=>l.assign(_,!0).break()))}a(E,"B");function v(S,T){let w=f[T];return typeof w=="object"&&w!==null?e._`${y()}(${u}, ${S}[${T}])`:e._`${u} === ${w}`}a(v,"z")}};t.default=s}),CWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=dWc(),r=fWc(),n=hWc(),o=mWc(),s=gWc(),c=AWc(),l=yWc(),u=_Wc(),d=EWc(),f=vWc(),h=[e.default,r.default,n.default,o.default,s.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,f.default];t.default=h}),Hoo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=Fs(),r=Sc(),n={message:a(({params:{len:c}})=>e.str`must NOT have more than ${c} items`,"message"),params:a(({params:{len:c}})=>e._`{limit: ${c}}`,"params")},o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n,code(c){let{parentSchema:l,it:u}=c,{items:d}=l;if(!Array.isArray(d)){(0,r.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(c,d)}};function s(c,l){let{gen:u,schema:d,data:f,keyword:h,it:m}=c;m.items=!0;let g=u.const("len",e._`${f}.length`);if(d===!1)c.setParams({len:l.length}),c.pass(e._`${g} <= ${l.length}`);else if(typeof d=="object"&&!(0,r.alwaysValidSchema)(m,d)){let y=u.var("valid",e._`${g} <= ${l.length}`);u.if((0,e.not)(y),()=>A(y)),c.ok(y)}function A(y){u.forRange("i",l.length,g,_=>{c.subschema({keyword:h,dataProp:_,dataPropType:r.Type.Num},y),!m.allErrors&&u.if((0,e.not)(y),()=>u.break())})}a(A,"H")}a(s,"FR"),t.validateAdditionalItems=s,t.default=o}),Goo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=Fs(),r=Sc(),n=vM(),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(c){let{schema:l,it:u}=c;if(Array.isArray(l))return s(c,"additionalItems",l);u.items=!0,!(0,r.alwaysValidSchema)(u,l)&&c.ok((0,n.validateArray)(c))}};function s(c,l,u=c.schema){let{gen:d,parentSchema:f,data:h,keyword:m,it:g}=c;_(f),g.opts.unevaluated&&u.length&&g.items!==!0&&(g.items=r.mergeEvaluated.items(d,u.length,g.items));let A=d.name("valid"),y=d.const("len",e._`${h}.length`);u.forEach((E,v)=>{(0,r.alwaysValidSchema)(g,E)||(d.if(e._`${y} > ${v}`,()=>c.subschema({keyword:m,schemaProp:v,dataProp:v},A)),c.ok(A))});function _(E){let{opts:v,errSchemaPath:S}=g,T=u.length,w=T===E.minItems&&(T===E.maxItems||E[l]===!1);if(v.strictTuples&&!w){let R=`"${m}" is ${T}-tuple, but minItems or maxItems/${l} are not specified or different at path "${S}"`;(0,r.checkStrictMode)(g,R,v.strictTuples)}}a(_,"V")}a(s,"jR"),t.validateTuple=s,t.default=o}),bWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Goo(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),SWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n=vM(),o=Hoo(),s={message:a(({params:{len:l}})=>e.str`must NOT have more than ${l} items`,"message"),params:a(({params:{len:l}})=>e._`{limit: ${l}}`,"params")},c={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:s,code(l){let{schema:u,parentSchema:d,it:f}=l,{prefixItems:h}=d;f.items=!0,!(0,r.alwaysValidSchema)(f,u)&&(h?(0,o.validateAdditionalItems)(l,h):l.ok((0,n.validateArray)(l)))}};t.default=c}),TWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n={message:a(({params:{min:s,max:c}})=>c===void 0?e.str`must contain at least ${s} valid item(s)`:e.str`must contain at least ${s} and no more than ${c} valid item(s)`,"message"),params:a(({params:{min:s,max:c}})=>c===void 0?e._`{minContains: ${s}}`:e._`{minContains: ${s}, maxContains: ${c}}`,"params")},o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:n,code(s){let{gen:c,schema:l,parentSchema:u,data:d,it:f}=s,h,m,{minContains:g,maxContains:A}=u;f.opts.next?(h=g===void 0?1:g,m=A):h=1;let y=c.const("len",e._`${d}.length`);if(s.setParams({min:h,max:m}),m===void 0&&h===0){(0,r.checkStrictMode)(f,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&h>m){(0,r.checkStrictMode)(f,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,r.alwaysValidSchema)(f,l)){let T=e._`${y} >= ${h}`;m!==void 0&&(T=e._`${T} && ${y} <= ${m}`),s.pass(T);return}f.items=!0;let _=c.name("valid");m===void 0&&h===1?v(_,()=>c.if(_,()=>c.break())):h===0?(c.let(_,!0),m!==void 0&&c.if(e._`${d}.length > 0`,E)):(c.let(_,!1),E()),s.result(_,()=>s.reset());function E(){let T=c.name("_valid"),w=c.let("count",0);v(T,()=>c.if(T,()=>S(w)))}a(E,"z");function v(T,w){c.forRange("i",0,y,R=>{s.subschema({keyword:"contains",dataProp:R,dataPropType:r.Type.Num,compositeRule:!0},T),w()})}a(v,"N");function S(T){c.code(e._`${T}++`),m===void 0?c.if(e._`${T} >= ${h}`,()=>c.assign(_,!0).break()):(c.if(e._`${T} > ${m}`,()=>c.assign(_,!1).break()),h===1?c.assign(_,!0):c.if(e._`${T} >= ${h}`,()=>c.assign(_,!0)))}a(S,"w")}};t.default=o}),IWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=Fs(),r=Sc(),n=vM();t.error={message:a(({params:{property:u,depsCount:d,deps:f}})=>{let h=d===1?"property":"properties";return e.str`must have ${h} ${f} when property ${u} is present`},"message"),params:a(({params:{property:u,depsCount:d,deps:f,missingProperty:h}})=>e._`{property: ${u}, + || ${D} === "boolean" || ${x} === null`).assign(N,o._`[${x}]`)}}a(O,"H")}a(m,"Ui");function g({gen:S,parentData:T,parentDataProperty:w},R){S.if(o._`${T} !== undefined`,()=>S.assign(o._`${T}[${w}]`,R))}a(g,"Hi");function A(S,T,w,R=c.Correct){let x=R===c.Correct?o.operators.EQ:o.operators.NEQ,k;switch(S){case"null":return o._`${T} ${x} null`;case"array":k=o._`Array.isArray(${T})`;break;case"object":k=o._`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":k=D(o._`!(${T} % 1) && !isNaN(${T})`);break;case"number":k=D();break;default:return o._`typeof ${T} ${x} ${S}`}return R===c.Correct?k:(0,o.not)(k);function D(N=o.nil){return(0,o.and)(o._`typeof ${T} == "number"`,N,w?o._`isFinite(${T})`:o.nil)}}a(A,"LB"),t.checkDataType=A;function y(S,T,w,R){if(S.length===1)return A(S[0],T,w,R);let x,k=(0,s.toHash)(S);if(k.array&&k.object){let D=o._`typeof ${T} != "object"`;x=k.null?D:o._`!${T} || ${D}`,delete k.null,delete k.array,delete k.object}else x=o.nil;k.number&&delete k.integer;for(let D in k)x=(0,o.and)(x,A(D,T,w,R));return x}a(y,"jB"),t.checkDataTypes=y;var _={message:a(({schema:S})=>`must be ${S}`,"message"),params:a(({schema:S,schemaValue:T})=>typeof S=="string"?o._`{type: ${S}}`:o._`{type: ${T}}`,"params")};function E(S){let T=v(S);(0,n.reportError)(T,_)}a(E,"AB"),t.reportTypeError=E;function v(S){let{gen:T,data:w,schema:R}=S,x=(0,s.schemaRefOrVal)(S,R,"type");return{gen:T,keyword:"type",data:w,schema:R.type,schemaCode:x,schemaValue:x,parentSchema:R,params:{},it:S}}a(v,"qi")}),tWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=Fs(),r=Sc();function n(s,c){let{properties:l,items:u}=s.schema;if(c==="object"&&l)for(let d in l)o(s,d,l[d].default);else c==="array"&&Array.isArray(u)&&u.forEach((d,f)=>o(s,f,d.default))}a(n,"Fi"),t.assignDefaults=n;function o(s,c,l){let{gen:u,compositeRule:d,data:f,opts:h}=s;if(l===void 0)return;let m=e._`${f}${(0,e.getProperty)(c)}`;if(d){(0,r.checkStrictMode)(s,`default is ignored for: ${m}`);return}let g=e._`${m} === undefined`;h.useDefaults==="empty"&&(g=e._`${g} || ${m} === null || ${m} === ""`),u.if(g,e._`${m} = ${(0,e.stringify)(l)}`)}a(o,"VA")}),vM=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;var e=Fs(),r=Sc(),n=lz(),o=Sc();function s(S,T){let{gen:w,data:R,it:x}=S;w.if(h(w,R,T,x.opts.ownProperties),()=>{S.setParams({missingProperty:e._`${T}`},!0),S.error()})}a(s,"Mi"),t.checkReportMissingProp=s;function c({gen:S,data:T,it:{opts:w}},R,x){return(0,e.or)(...R.map(k=>(0,e.and)(h(S,T,k,w.ownProperties),e._`${x} = ${k}`)))}a(c,"Li"),t.checkMissingProp=c;function l(S,T){S.setParams({missingProperty:T},!0),S.error()}a(l,"ji"),t.reportMissingProp=l;function u(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}a(u,"wA"),t.hasPropFunc=u;function d(S,T,w){return e._`${u(S)}.call(${T}, ${w})`}a(d,"RB"),t.isOwnProperty=d;function f(S,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} !== undefined`;return R?e._`${x} && ${d(S,T,w)}`:x}a(f,"Ai"),t.propertyInData=f;function h(S,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} === undefined`;return R?(0,e.or)(x,(0,e.not)(d(S,T,w))):x}a(h,"PB"),t.noPropertyInData=h;function m(S){return S?Object.keys(S).filter(T=>T!=="__proto__"):[]}a(m,"OA"),t.allSchemaProperties=m;function g(S,T){return m(T).filter(w=>!(0,r.alwaysValidSchema)(S,T[w]))}a(g,"Ii"),t.schemaProperties=g;function A({schemaCode:S,data:T,it:{gen:w,topSchemaRef:R,schemaPath:x,errorPath:k},it:D},N,O,B){let q=B?e._`${S}, ${T}, ${R}${x}`:T,M=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,k)],[n.default.parentData,D.parentData],[n.default.parentDataProperty,D.parentDataProperty],[n.default.rootData,n.default.rootData]];D.opts.dynamicRef&&M.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);let L=e._`${q}, ${w.object(...M)}`;return O!==e.nil?e._`${N}.call(${O}, ${L})`:e._`${N}(${L})`}a(A,"Ri"),t.callValidateCode=A;var y=e._`new RegExp`;function _({gen:S,it:{opts:T}},w){let R=T.unicodeRegExp?"u":"",{regExp:x}=T.code,k=x(w,R);return S.scopeValue("pattern",{key:k.toString(),ref:k,code:e._`${x.code==="new RegExp"?y:(0,o.useFunc)(S,x)}(${w}, ${R})`})}a(_,"Ei"),t.usePattern=_;function E(S){let{gen:T,data:w,keyword:R,it:x}=S,k=T.name("valid");if(x.allErrors){let N=T.let("valid",!0);return D(()=>T.assign(N,!1)),N}return T.var(k,!0),D(()=>T.break()),k;function D(N){let O=T.const("len",e._`${w}.length`);T.forRange("i",0,O,B=>{S.subschema({keyword:R,dataProp:B,dataPropType:r.Type.Num},k),T.if((0,e.not)(k),N)})}}a(E,"bi"),t.validateArray=E;function v(S){let{gen:T,schema:w,keyword:R,it:x}=S;if(!Array.isArray(w))throw Error("ajv implementation error");if(w.some(N=>(0,r.alwaysValidSchema)(x,N))&&!x.opts.unevaluated)return;let k=T.let("valid",!1),D=T.name("_valid");T.block(()=>w.forEach((N,O)=>{let B=S.subschema({keyword:R,schemaProp:O,compositeRule:!0},D);T.assign(k,e._`${k} || ${D}`),!S.mergeValidEvaluated(B,D)&&T.if((0,e.not)(k))})),S.result(k,()=>S.reset(),()=>S.error(!0))}a(v,"_i"),t.validateUnion=v}),rWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=Fs(),r=lz(),n=vM(),o=Xkt();function s(g,A){let{gen:y,keyword:_,schema:E,parentSchema:v,it:S}=g,T=A.macro.call(S.self,E,v,S),w=f(y,_,T);S.opts.validateSchema!==!1&&S.self.validateSchema(T,!0);let R=y.name("valid");g.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${S.errSchemaPath}/${_}`,topSchemaRef:w,compositeRule:!0},R),g.pass(R,()=>g.error(!0))}a(s,"pi"),t.macroKeywordCode=s;function c(g,A){var y;let{gen:_,keyword:E,schema:v,parentSchema:S,$data:T,it:w}=g;d(w,A);let R=!T&&A.compile?A.compile.call(w.self,v,S,w):A.validate,x=f(_,E,R),k=_.let("valid");g.block$data(k,D),g.ok((y=A.valid)!==null&&y!==void 0?y:k);function D(){if(A.errors===!1)B(),A.modifying&&l(g),q(()=>g.error());else{let M=A.async?N():O();A.modifying&&l(g),q(()=>u(g,M))}}a(D,"z");function N(){let M=_.let("ruleErrs",null);return _.try(()=>B(e._`await `),L=>_.assign(k,!1).if(e._`${L} instanceof ${w.ValidationError}`,()=>_.assign(M,e._`${L}.errors`),()=>_.throw(L))),M}a(N,"N");function O(){let M=e._`${x}.errors`;return _.assign(M,null),B(e.nil),M}a(O,"w");function B(M=A.async?e._`await `:e.nil){let L=w.opts.passContext?r.default.this:r.default.self,U=!("compile"in A&&!T||A.schema===!1);_.assign(k,e._`${M}${(0,n.callValidateCode)(g,x,L,U)}`,A.modifying)}a(B,"O");function q(M){var L;_.if((0,e.not)((L=A.valid)!==null&&L!==void 0?L:k),M)}a(q,"D")}a(c,"di"),t.funcKeywordCode=c;function l(g){let{gen:A,data:y,it:_}=g;A.if(_.parentData,()=>A.assign(y,e._`${_.parentData}[${_.parentDataProperty}]`))}a(l,"ZA");function u(g,A){let{gen:y}=g;y.if(e._`Array.isArray(${A})`,()=>{y.assign(r.default.vErrors,e._`${r.default.vErrors} === null ? ${A} : ${r.default.vErrors}.concat(${A})`).assign(r.default.errors,e._`${r.default.vErrors}.length`),(0,o.extendErrors)(g)},()=>g.error())}a(u,"ii");function d({schemaEnv:g},A){if(A.async&&!g.$async)throw Error("async keyword in sync schema")}a(d,"ni");function f(g,A,y){if(y===void 0)throw Error(`keyword "${A}" failed to compile`);return g.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}a(f,"MA");function h(g,A,y=!1){return!A.length||A.some(_=>_==="array"?Array.isArray(g):_==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==_||y&&typeof g>"u")}a(h,"ri"),t.validSchemaType=h;function m({schema:g,opts:A,self:y,errSchemaPath:_},E,v){if(Array.isArray(E.keyword)?!E.keyword.includes(v):E.keyword!==v)throw Error("ajv implementation error");let S=E.dependencies;if(S?.some(T=>!Object.prototype.hasOwnProperty.call(g,T)))throw Error(`parent schema must have dependencies of ${v}: ${S.join(",")}`);if(E.validateSchema&&!E.validateSchema(g[v])){let T=`keyword "${v}" value is invalid at path "${_}": `+y.errorsText(E.validateSchema.errors);if(A.validateSchema==="log")y.logger.error(T);else throw Error(T)}}a(m,"oi"),t.validateKeywordUsage=m}),nWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=Fs(),r=Sc();function n(c,{keyword:l,schemaProp:u,schema:d,schemaPath:f,errSchemaPath:h,topSchemaRef:m}){if(l!==void 0&&d!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){let g=c.schema[l];return u===void 0?{schema:g,schemaPath:e._`${c.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${c.errSchemaPath}/${l}`}:{schema:g[u],schemaPath:e._`${c.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(u)}`,errSchemaPath:`${c.errSchemaPath}/${l}/${(0,r.escapeFragment)(u)}`}}if(d!==void 0){if(f===void 0||h===void 0||m===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:f,topSchemaRef:m,errSchemaPath:h}}throw Error('either "keyword" or "schema" must be passed')}a(n,"ei"),t.getSubschema=n;function o(c,l,{dataProp:u,dataPropType:d,data:f,dataTypes:h,propertyName:m}){if(f!==void 0&&u!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:g}=l;if(u!==void 0){let{errorPath:y,dataPathArr:_,opts:E}=l,v=g.let("data",e._`${l.data}${(0,e.getProperty)(u)}`,!0);A(v),c.errorPath=e.str`${y}${(0,r.getErrorPath)(u,d,E.jsPropertySyntax)}`,c.parentDataProperty=e._`${u}`,c.dataPathArr=[..._,c.parentDataProperty]}if(f!==void 0){let y=f instanceof e.Name?f:g.let("data",f,!0);A(y),m!==void 0&&(c.propertyName=m)}h&&(c.dataTypes=h);function A(y){c.data=y,c.dataLevel=l.dataLevel+1,c.dataTypes=[],l.definedProperties=new Set,c.parentData=l.data,c.dataNames=[...l.dataNames,y]}a(A,"H")}a(o,"$n"),t.extendSubschemaData=o;function s(c,{jtdDiscriminator:l,jtdMetadata:u,compositeRule:d,createErrors:f,allErrors:h}){d!==void 0&&(c.compositeRule=d),f!==void 0&&(c.createErrors=f),h!==void 0&&(c.allErrors=h),c.jtdDiscriminator=l,c.jtdMetadata=u}a(s,"Qn"),t.extendSubschemaMode=s}),Hoo=jt((t,e)=>{e.exports=a(function r(n,o){if(n===o)return!0;if(n&&o&&typeof n=="object"&&typeof o=="object"){if(n.constructor!==o.constructor)return!1;var s,c,l;if(Array.isArray(n)){if(s=n.length,s!=o.length)return!1;for(c=s;c--!==0;)if(!r(n[c],o[c]))return!1;return!0}if(n.constructor===RegExp)return n.source===o.source&&n.flags===o.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===o.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===o.toString();if(l=Object.keys(n),s=l.length,s!==Object.keys(o).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(o,l[c]))return!1;for(c=s;c--!==0;){var u=l[c];if(!r(n[u],o[u]))return!1}return!0}return n!==n&&o!==o},"$")}),iWc=jt((t,e)=>{var r=e.exports=function(s,c,l){typeof c=="function"&&(l=c,c={}),l=c.cb||l;var u=typeof l=="function"?l:l.pre||function(){},d=l.post||function(){};n(c,u,d,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function n(s,c,l,u,d,f,h,m,g,A){if(u&&typeof u=="object"&&!Array.isArray(u)){c(u,d,f,h,m,g,A);for(var y in u){var _=u[y];if(Array.isArray(_)){if(y in r.arrayKeywords)for(var E=0;E<_.length;E++)n(s,c,l,_[E],d+"/"+y+"/"+E,f,d,y,u,E)}else if(y in r.propsKeywords){if(_&&typeof _=="object")for(var v in _)n(s,c,l,_[v],d+"/"+y+"/"+o(v),f,d,y,u,v)}else(y in r.keywords||s.allKeys&&!(y in r.skipKeywords))&&n(s,c,l,_,d+"/"+y,f,d,y,u)}l(u,d,f,h,m,g,A)}}a(n,"IW");function o(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}a(o,"Yn")}),ePt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;var e=Sc(),r=Hoo(),n=iWc(),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(_,E=!0){return typeof _=="boolean"?!0:E===!0?!l(_):E?u(_)<=E:!1}a(s,"Kn"),t.inlineRef=s;var c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(_){for(let E in _){if(c.has(E))return!0;let v=_[E];if(Array.isArray(v)&&v.some(l)||typeof v=="object"&&l(v))return!0}return!1}a(l,"bB");function u(_){let E=0;for(let v in _){if(v==="$ref")return 1/0;if(E++,!o.has(v)&&(typeof _[v]=="object"&&(0,e.eachItem)(_[v],S=>E+=u(S)),E===1/0))return 1/0}return E}a(u,"SA");function d(_,E="",v){v!==!1&&(E=m(E));let S=_.parse(E);return f(_,S)}a(d,"vA"),t.getFullPath=d;function f(_,E){return _.serialize(E).split("#")[0]+"#"}a(f,"CA"),t._getFullPath=f;var h=/#\/?$/;function m(_){return _?_.replace(h,""):""}a(m,"N9"),t.normalizeId=m;function g(_,E,v){return v=m(v),_.resolve(E,v)}a(g,"Bn"),t.resolveUrl=g;var A=/^[a-z_][-a-z0-9._]*$/i;function y(_,E){if(typeof _=="boolean")return{};let{schemaId:v,uriResolver:S}=this.opts,T=m(_[v]||E),w={"":T},R=d(S,T,!1),x={},k=new Set;return n(_,{allKeys:!0},(O,B,q,M)=>{if(M===void 0)return;let L=R+B,U=w[M];typeof O[v]=="string"&&(U=j.call(this,O[v])),Q.call(this,O.$anchor),Q.call(this,O.$dynamicAnchor),w[B]=U;function j(Y){let W=this.opts.uriResolver.resolve;if(Y=m(U?W(U,Y):Y),k.has(Y))throw N(Y);k.add(Y);let V=this.refs[Y];return typeof V=="string"&&(V=this.refs[V]),typeof V=="object"?D(O,V.schema,Y):Y!==m(L)&&(Y[0]==="#"?(D(O,x[Y],Y),x[Y]=O):this.refs[Y]=L),Y}a(j,"M");function Q(Y){if(typeof Y=="string"){if(!A.test(Y))throw Error(`invalid anchor "${Y}"`);j.call(this,`#${Y}`)}}a(Q,"j")}),x;function D(O,B,q){if(B!==void 0&&!r(O,B))throw N(q)}function N(O){return Error(`reference "${O}" resolves to more than one schema`)}}a(y,"Nn"),t.getSchemaRefs=y}),tPt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=eWc(),r=DRt(),n=joo(),o=DRt(),s=tWc(),c=rWc(),l=nWc(),u=Fs(),d=lz(),f=ePt(),h=Sc(),m=Xkt();function g(ee){if(R(ee)&&(k(ee),w(ee))){E(ee);return}A(ee,()=>(0,e.topBoolOrEmptySchema)(ee))}a(g,"jn"),t.validateFunctionCode=g;function A({gen:ee,validateName:K,schema:he,schemaEnv:X,opts:de},Be){de.code.es5?ee.func(K,u._`${d.default.data}, ${d.default.valCxt}`,X.$async,()=>{ee.code(u._`"use strict"; ${S(he,de)}`),_(ee,de),ee.code(Be)}):ee.func(K,u._`${d.default.data}, ${y(de)}`,X.$async,()=>ee.code(S(he,de)).code(Be))}a(A,"mA");function y(ee){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${ee.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}a(y,"An");function _(ee,K){ee.if(d.default.valCxt,()=>{ee.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),ee.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),ee.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),ee.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),K.dynamicRef&&ee.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{ee.var(d.default.instancePath,u._`""`),ee.var(d.default.parentData,u._`undefined`),ee.var(d.default.parentDataProperty,u._`undefined`),ee.var(d.default.rootData,d.default.data),K.dynamicRef&&ee.var(d.default.dynamicAnchors,u._`{}`)})}a(_,"In");function E(ee){let{schema:K,opts:he,gen:X}=ee;A(ee,()=>{he.$comment&&K.$comment&&M(ee),O(ee),X.let(d.default.vErrors,null),X.let(d.default.errors,0),he.unevaluated&&v(ee),D(ee),L(ee)})}a(E,"Rn");function v(ee){let{gen:K,validateName:he}=ee;ee.evaluated=K.const("evaluated",u._`${he}.evaluated`),K.if(u._`${ee.evaluated}.dynamicProps`,()=>K.assign(u._`${ee.evaluated}.props`,u._`undefined`)),K.if(u._`${ee.evaluated}.dynamicItems`,()=>K.assign(u._`${ee.evaluated}.items`,u._`undefined`))}a(v,"Pn");function S(ee,K){let he=typeof ee=="object"&&ee[K.schemaId];return he&&(K.code.source||K.code.process)?u._`/*# sourceURL=${he} */`:u.nil}a(S,"fA");function T(ee,K){if(R(ee)&&(k(ee),w(ee))){x(ee,K);return}(0,e.boolOrEmptySchema)(ee,K)}a(T,"En");function w({schema:ee,self:K}){if(typeof ee=="boolean")return!ee;for(let he in ee)if(K.RULES.all[he])return!0;return!1}a(w,"lA");function R(ee){return typeof ee.schema!="boolean"}a(R,"cA");function x(ee,K){let{schema:he,gen:X,opts:de}=ee;de.$comment&&he.$comment&&M(ee),B(ee),q(ee);let Be=X.const("_errs",d.default.errors);D(ee,Be),X.var(K,u._`${Be} === ${d.default.errors}`)}a(x,"bn");function k(ee){(0,h.checkUnknownRules)(ee),N(ee)}a(k,"pA");function D(ee,K){if(ee.opts.jtd)return j(ee,[],!1,K);let he=(0,r.getSchemaTypes)(ee.schema),X=(0,r.coerceAndCheckDataType)(ee,he);j(ee,he,!X,K)}a(D,"dA");function N(ee){let{schema:K,errSchemaPath:he,opts:X,self:de}=ee;K.$ref&&X.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(K,de.RULES)&&de.logger.warn(`$ref: keywords ignored in schema at path "${he}"`)}a(N,"_n");function O(ee){let{schema:K,opts:he}=ee;K.default!==void 0&&he.useDefaults&&he.strictSchema&&(0,h.checkStrictMode)(ee,"default is ignored in the schema root")}a(O,"kn");function B(ee){let K=ee.schema[ee.opts.schemaId];K&&(ee.baseId=(0,f.resolveUrl)(ee.opts.uriResolver,ee.baseId,K))}a(B,"Sn");function q(ee){if(ee.schema.$async&&!ee.schemaEnv.$async)throw Error("async schema in sync schema")}a(q,"vn");function M({gen:ee,schemaEnv:K,schema:he,errSchemaPath:X,opts:de}){let Be=he.$comment;if(de.$comment===!0)ee.code(u._`${d.default.self}.logger.log(${Be})`);else if(typeof de.$comment=="function"){let ne=u.str`${X}/$comment`,ue=ee.scopeValue("root",{ref:K.root});ee.code(u._`${d.default.self}.opts.$comment(${Be}, ${ne}, ${ue}.schema)`)}}a(M,"iA");function L(ee){let{gen:K,schemaEnv:he,validateName:X,ValidationError:de,opts:Be}=ee;he.$async?K.if(u._`${d.default.errors} === 0`,()=>K.return(d.default.data),()=>K.throw(u._`new ${de}(${d.default.vErrors})`)):(K.assign(u._`${X}.errors`,d.default.vErrors),Be.unevaluated&&U(ee),K.return(u._`${d.default.errors} === 0`))}a(L,"Cn");function U({gen:ee,evaluated:K,props:he,items:X}){he instanceof u.Name&&ee.assign(u._`${K}.props`,he),X instanceof u.Name&&ee.assign(u._`${K}.items`,X)}a(U,"Tn");function j(ee,K,he,X){let{gen:de,schema:Be,data:ne,allErrors:ue,opts:Ne,self:xe}=ee,{RULES:Fe}=xe;if(Be.$ref&&(Ne.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(Be,Fe))){de.block(()=>me(ee,"$ref",Fe.all.$ref.definition));return}Ne.jtd||Y(ee,K),de.block(()=>{for(let st of Fe.rules)tt(st);tt(Fe.post)});function tt(st){(0,n.shouldUseGroup)(Be,st)&&(st.type?(de.if((0,o.checkDataType)(st.type,ne,Ne.strictNumbers)),Q(ee,st),K.length===1&&K[0]===st.type&&he&&(de.else(),(0,o.reportTypeError)(ee)),de.endIf()):Q(ee,st),ue||de.if(u._`${d.default.errors} === ${X||0}`))}a(tt,"B")}a(j,"gA");function Q(ee,K){let{gen:he,schema:X,opts:{useDefaults:de}}=ee;de&&(0,s.assignDefaults)(ee,K.type),he.block(()=>{for(let Be of K.rules)(0,n.shouldUseRule)(X,Be)&&me(ee,Be.keyword,Be.definition,K.type)})}a(Q,"hA");function Y(ee,K){ee.schemaEnv.meta||!ee.opts.strictTypes||(W(ee,K),!ee.opts.allowUnionTypes&&V(ee,K),z(ee,ee.dataTypes))}a(Y,"xn");function W(ee,K){if(K.length){if(!ee.dataTypes.length){ee.dataTypes=K;return}K.forEach(he=>{H(ee.dataTypes,he)||le(ee,`type "${he}" not allowed by context "${ee.dataTypes.join(",")}"`)}),re(ee,K)}}a(W,"yn");function V(ee,K){K.length>1&&!(K.length===2&&K.includes("null"))&&le(ee,"use allowUnionTypes to allow union type keyword")}a(V,"fn");function z(ee,K){let he=ee.self.RULES.all;for(let X in he){let de=he[X];if(typeof de=="object"&&(0,n.shouldUseRule)(ee.schema,de)){let{type:Be}=de.definition;Be.length&&!Be.some(ne=>ie(K,ne))&&le(ee,`missing type "${Be.join(",")}" for keyword "${X}"`)}}}a(z,"gn");function ie(ee,K){return ee.includes(K)||K==="number"&&ee.includes("integer")}a(ie,"hn");function H(ee,K){return ee.includes(K)||K==="integer"&&ee.includes("number")}a(H,"nA");function re(ee,K){let he=[];for(let X of ee.dataTypes)H(K,X)?he.push(X):K.includes("integer")&&X==="number"&&he.push("integer");ee.dataTypes=he}a(re,"un");function le(ee,K){let he=ee.schemaEnv.baseId+ee.errSchemaPath;K+=` at "${he}" (strictTypes)`,(0,h.checkStrictMode)(ee,K,ee.opts.strictTypes)}a(le,"SB");class Le{static{a(this,"vB")}constructor(K,he,X){if((0,c.validateKeywordUsage)(K,he,X),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=X,this.data=K.data,this.schema=K.schema[X],this.$data=he.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(K,this.schema,X,this.$data),this.schemaType=he.schemaType,this.parentSchema=K.schema,this.params={},this.it=K,this.def=he,this.$data)this.schemaCode=K.gen.const("vSchema",te(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,he.schemaType,he.allowUndefined))throw Error(`${X} value must be ${JSON.stringify(he.schemaType)}`);("code"in he?he.trackErrors:he.errors!==!1)&&(this.errsCount=K.gen.const("_errs",d.default.errors))}result(K,he,X){this.failResult((0,u.not)(K),he,X)}failResult(K,he,X){this.gen.if(K),X?X():this.error(),he?(this.gen.else(),he(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(K,he){this.failResult((0,u.not)(K),void 0,he)}fail(K){if(K===void 0){this.error(),!this.allErrors&&this.gen.if(!1);return}this.gen.if(K),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(K){if(!this.$data)return this.fail(K);let{schemaCode:he}=this;this.fail(u._`${he} !== undefined && (${(0,u.or)(this.invalid$data(),K)})`)}error(K,he,X){if(he){this.setParams(he),this._error(K,X),this.setParams({});return}this._error(K,X)}_error(K,he){(K?m.reportExtraError:m.reportError)(this,this.def.error,he)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(K){this.allErrors||this.gen.if(K)}setParams(K,he){he?Object.assign(this.params,K):this.params=K}block$data(K,he,X=u.nil){this.gen.block(()=>{this.check$data(K,X),he()})}check$data(K=u.nil,he=u.nil){if(!this.$data)return;let{gen:X,schemaCode:de,schemaType:Be,def:ne}=this;X.if((0,u.or)(u._`${de} === undefined`,he)),K!==u.nil&&X.assign(K,!0),(Be.length||ne.validateSchema)&&(X.elseIf(this.invalid$data()),this.$dataError(),K!==u.nil&&X.assign(K,!1)),X.else()}invalid$data(){let{gen:K,schemaCode:he,schemaType:X,def:de,it:Be}=this;return(0,u.or)(ne(),ue());function ne(){if(X.length){if(!(he instanceof u.Name))throw Error("ajv implementation error");let Ne=Array.isArray(X)?X:[X];return u._`${(0,o.checkDataTypes)(Ne,he,Be.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function ue(){if(de.validateSchema){let Ne=K.scopeValue("validate$data",{ref:de.validateSchema});return u._`!${Ne}(${he})`}return u.nil}}subschema(K,he){let X=(0,l.getSubschema)(this.it,K);(0,l.extendSubschemaData)(X,this.it,K),(0,l.extendSubschemaMode)(X,K);let de={...this.it,...X,items:void 0,props:void 0};return T(de,he),de}mergeEvaluated(K,he){let{it:X,gen:de}=this;X.opts.unevaluated&&(X.props!==!0&&K.props!==void 0&&(X.props=h.mergeEvaluated.props(de,K.props,X.props,he)),X.items!==!0&&K.items!==void 0&&(X.items=h.mergeEvaluated.items(de,K.items,X.items,he)))}mergeValidEvaluated(K,he){let{it:X,gen:de}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return de.if(he,()=>this.mergeEvaluated(K,u.Name)),!0}}t.KeywordCxt=Le;function me(ee,K,he,X){let de=new Le(ee,he,K);"code"in he?he.code(de,X):de.$data&&he.validate?(0,c.funcKeywordCode)(de,he):"macro"in he?(0,c.macroKeywordCode)(de,he):(he.compile||he.validate)&&(0,c.funcKeywordCode)(de,he)}a(me,"rA");var Oe=/^\/(?:[^~]|~0|~1)*$/,Te=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function te(ee,{dataLevel:K,dataNames:he,dataPathArr:X}){let de,Be;if(ee==="")return d.default.rootData;if(ee[0]==="/"){if(!Oe.test(ee))throw Error(`Invalid JSON-pointer: ${ee}`);de=ee,Be=d.default.rootData}else{let xe=Te.exec(ee);if(!xe)throw Error(`Invalid JSON-pointer: ${ee}`);let Fe=+xe[1];if(de=xe[2],de==="#"){if(Fe>=K)throw Error(Ne("property/index",Fe));return X[K-Fe]}if(Fe>K)throw Error(Ne("data",Fe));if(Be=he[K-Fe],!de)return Be}let ne=Be,ue=de.split("/");for(let xe of ue)xe&&(Be=u._`${Be}${(0,u.getProperty)((0,h.unescapeJsonPointer)(xe))}`,ne=u._`${ne} && ${Be}`);return ne;function Ne(xe,Fe){return`Cannot access ${xe} ${Fe} levels up, current level is ${K}`}}a(te,"oA"),t.getData=te}),Tqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});class e extends Error{static{a(this,"sA")}constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}t.default=e}),rPt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ePt();class r extends Error{static{a(this,"$I")}constructor(o,s,c,l){super(l||`can't resolve reference ${c} from id ${s}`),this.missingRef=(0,e.resolveUrl)(o,s,c),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(o,this.missingRef))}}t.default=r}),Iqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=Fs(),r=Tqr(),n=lz(),o=ePt(),s=Sc(),c=tPt();class l{static{a(this,"CJ")}constructor(v){var S;this.refs={},this.dynamicAnchors={};let T;typeof v.schema=="object"&&(T=v.schema),this.schema=v.schema,this.schemaId=v.schemaId,this.root=v.root||this,this.baseId=(S=v.baseId)!==null&&S!==void 0?S:(0,o.normalizeId)(T?.[v.schemaId||"$id"]),this.schemaPath=v.schemaPath,this.localRefs=v.localRefs,this.meta=v.meta,this.$async=T?.$async,this.refs={}}}t.SchemaEnv=l;function u(E){let v=h.call(this,E);if(v)return v;let S=(0,o.getFullPath)(this.opts.uriResolver,E.root.baseId),{es5:T,lines:w}=this.opts.code,{ownProperties:R}=this.opts,x=new e.CodeGen(this.scope,{es5:T,lines:w,ownProperties:R}),k;E.$async&&(k=x.scopeValue("Error",{ref:r.default,code:e._`require("ajv/dist/runtime/validation_error").default`}));let D=x.scopeName("validate");E.validateName=D;let N={gen:x,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:x.scopeValue("schema",this.opts.code.source===!0?{ref:E.schema,code:(0,e.stringify)(E.schema)}:{ref:E.schema}),validateName:D,ValidationError:k,schema:E.schema,schemaEnv:E,rootId:S,baseId:E.baseId||S,schemaPath:e.nil,errSchemaPath:E.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this},O;try{this._compilations.add(E),(0,c.validateFunctionCode)(N),x.optimize(this.opts.code.optimize);let B=x.toString();O=`${x.scopeRefs(n.default.scope)}return ${B}`,this.opts.code.process&&(O=this.opts.code.process(O,E));let q=Function(`${n.default.self}`,`${n.default.scope}`,O)(this,this.scope.get());if(this.scope.value(D,{ref:q}),q.errors=null,q.schema=E.schema,q.schemaEnv=E,E.$async&&(q.$async=!0),this.opts.code.source===!0&&(q.source={validateName:D,validateCode:B,scopeValues:x._values}),this.opts.unevaluated){let{props:M,items:L}=N;q.evaluated={props:M instanceof e.Name?void 0:M,items:L instanceof e.Name?void 0:L,dynamicProps:M instanceof e.Name,dynamicItems:L instanceof e.Name},q.source&&(q.source.evaluated=(0,e.stringify)(q.evaluated))}return E.validate=q,E}catch(B){throw delete E.validate,delete E.validateName,O&&this.logger.error("Error compiling schema, function code:",O),B}finally{this._compilations.delete(E)}}a(u,"xB"),t.compileSchema=u;function d(E,v,S){var T;S=(0,o.resolveUrl)(this.opts.uriResolver,v,S);let w=E.refs[S];if(w)return w;let R=g.call(this,E,S);if(R===void 0){let x=(T=E.localRefs)===null||T===void 0?void 0:T[S],{schemaId:k}=this.opts;x&&(R=new l({schema:x,schemaId:k,root:E,baseId:v}))}if(R!==void 0)return E.refs[S]=f.call(this,R)}a(d,"tn"),t.resolveRef=d;function f(E){return(0,o.inlineRef)(E.schema,this.opts.inlineRefs)?E.schema:E.validate?E:u.call(this,E)}a(f,"an");function h(E){for(let v of this._compilations)if(m(v,E))return v}a(h,"XI"),t.getCompilingSchema=h;function m(E,v){return E.schema===v.schema&&E.root===v.root&&E.baseId===v.baseId}a(m,"sn");function g(E,v){let S;for(;typeof(S=this.refs[v])=="string";)v=S;return S||this.schemas[v]||A.call(this,E,v)}a(g,"en");function A(E,v){let S=this.opts.uriResolver.parse(v),T=(0,o._getFullPath)(this.opts.uriResolver,S),w=(0,o.getFullPath)(this.opts.uriResolver,E.baseId,void 0);if(Object.keys(E.schema).length>0&&T===w)return _.call(this,S,E);let R=(0,o.normalizeId)(T),x=this.refs[R]||this.schemas[R];if(typeof x=="string"){let k=A.call(this,E,x);return typeof k?.schema!="object"?void 0:_.call(this,S,k)}if(typeof x?.schema=="object"){if(x.validate||u.call(this,x),R===(0,o.normalizeId)(v)){let{schema:k}=x,{schemaId:D}=this.opts,N=k[D];return N&&(w=(0,o.resolveUrl)(this.opts.uriResolver,w,N)),new l({schema:k,schemaId:D,root:E,baseId:w})}return _.call(this,S,x)}}a(A,"EW"),t.resolveSchema=A;var y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _(E,{baseId:v,schema:S,root:T}){var w;if(((w=E.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let k of E.fragment.slice(1).split("/")){if(typeof S=="boolean")return;let D=S[(0,s.unescapeFragment)(k)];if(D===void 0)return;S=D;let N=typeof S=="object"&&S[this.opts.schemaId];!y.has(k)&&N&&(v=(0,o.resolveUrl)(this.opts.uriResolver,v,N))}let R;if(typeof S!="boolean"&&S.$ref&&!(0,s.schemaHasRulesButRef)(S,this.RULES)){let k=(0,o.resolveUrl)(this.opts.uriResolver,v,S.$ref);R=A.call(this,T,k)}let{schemaId:x}=this.opts;if(R=R||new l({schema:S,schemaId:x,root:T,baseId:v}),R.schema!==R.root.schema)return R}a(_,"TB")}),oWc=jt((t,e)=>{e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),Goo=jt((t,e)=>{var r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),n=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),o=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),c=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function l(x){let k="",D=0,N=0;for(N=0;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";k+=x[N];break}for(N+=1;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";k+=x[N]}return k}a(l,"fB");var u=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function d(x){return x.length=0,!0}a(d,"UI");function f(x,k,D){if(x.length){let N=l(x);if(N!=="")k.push(N);else return D.error=!0,!1;x.length=0}return!0}a(f,"Kr");function h(x){let k=0,D={error:!1,address:"",zone:""},N=[],O=[],B=!1,q=!1,M=f;for(let L=0;L7){D.error=!0;break}L>0&&x[L-1]===":"&&(B=!0),N.push(":");continue}else if(U==="%"){if(!M(O,N,D))break;M=d}else{O.push(U);continue}}return O.length&&(M===d?D.zone=O.join(""):q?N.push(O.join("")):N.push(l(O))),D.address=N.join(""),D}a(h,"qr");function m(x){if(g(x,":")<2)return{host:x,isIPV6:!1};let k=h(x);if(k.error)return{host:x,isIPV6:!1};{let{address:D,address:N}=k;return k.zone&&(D+="%"+k.zone,N+="%25"+k.zone),{host:D,isIPV6:!0,escapedHost:N}}}a(m,"qI");function g(x,k){let D=0;for(let N=0;Ny[N])}a(v,"VI");function S(x,k=!1){if(x.indexOf("%")===-1)return x;let D="";for(let N=0;N{var{isUUID:r}=Goo(),n=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,o=["http","https","ws","wss","urn","urn:uuid"];function s(x){return o.indexOf(x)!==-1}a(s,"Ar");function c(x){return x.secure===!0?!0:x.secure===!1?!1:x.scheme?x.scheme.length===3&&(x.scheme[0]==="w"||x.scheme[0]==="W")&&(x.scheme[1]==="s"||x.scheme[1]==="S")&&(x.scheme[2]==="s"||x.scheme[2]==="S"):!1}a(c,"hB");function l(x){return x.host||(x.error=x.error||"HTTP URIs must have a host."),x}a(l,"zI");function u(x){let k=String(x.scheme).toLowerCase()==="https";return(x.port===(k?443:80)||x.port==="")&&(x.port=void 0),x.path||(x.path="/"),x}a(u,"NI");function d(x){return x.secure=c(x),x.resourceName=(x.path||"/")+(x.query?"?"+x.query:""),x.path=void 0,x.query=void 0,x}a(d,"Ir");function f(x){if((x.port===(c(x)?443:80)||x.port==="")&&(x.port=void 0),typeof x.secure=="boolean"&&(x.scheme=x.secure?"wss":"ws",x.secure=void 0),x.resourceName){let[k,D]=x.resourceName.split("?");x.path=k&&k!=="/"?k:void 0,x.query=D,x.resourceName=void 0}return x.fragment=void 0,x}a(f,"Rr");function h(x,k){if(!x.path)return x.error="URN can not be parsed",x;let D=x.path.match(n);if(D){let N=k.scheme||x.scheme||"urn";x.nid=D[1].toLowerCase(),x.nss=D[2];let O=`${N}:${k.nid||x.nid}`,B=R(O);x.path=void 0,B&&(x=B.parse(x,k))}else x.error=x.error||"URN can not be parsed.";return x}a(h,"Pr");function m(x,k){if(x.nid===void 0)throw Error("URN without nid cannot be serialized");let D=k.scheme||x.scheme||"urn",N=x.nid.toLowerCase(),O=`${D}:${k.nid||N}`,B=R(O);B&&(x=B.serialize(x,k));let q=x,M=x.nss;return q.path=`${N||k.nid}:${M}`,k.skipEscape=!0,q}a(m,"Er");function g(x,k){let D=x;return D.uuid=D.nss,D.nss=void 0,!k.tolerant&&(!D.uuid||!r(D.uuid))&&(D.error=D.error||"UUID is not valid."),D}a(g,"br");function A(x){let k=x;return k.nss=(x.uuid||"").toLowerCase(),k}a(A,"_r");var y={scheme:"http",domainHost:!0,parse:l,serialize:u},_={scheme:"https",domainHost:y.domainHost,parse:l,serialize:u},E={scheme:"ws",domainHost:!0,parse:d,serialize:f},v={scheme:"wss",domainHost:E.domainHost,parse:E.parse,serialize:E.serialize},S={scheme:"urn",parse:h,serialize:m,skipNormalize:!0},T={scheme:"urn:uuid",parse:g,serialize:A,skipNormalize:!0},w={http:y,https:_,ws:E,wss:v,urn:S,"urn:uuid":T};Object.setPrototypeOf(w,null);function R(x){return x&&(w[x]||w[x.toLowerCase()])||void 0}a(R,"uB"),e.exports={wsIsSecure:c,SCHEMES:w,isValidSchemeName:s,getSchemeHandler:R}}),aWc=jt((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=Goo(),{SCHEMES:h,getSchemeHandler:m}=sWc();function g(N,O){return typeof N=="string"?N=R(N,O):typeof N=="object"&&(N=w(E(N,O),O)),N}a(g,"cr");function A(N,O,B){let q=B?Object.assign({scheme:"null"},B):{scheme:"null"},M=y(w(N,q),w(O,q),q,!0);return q.skipEscape=!0,E(M,q)}a(A,"pr");function y(N,O,B,q){let M={};return q||(N=w(E(N,B),B),O=w(E(O,B),B)),B=B||{},!B.tolerant&&O.scheme?(M.scheme=O.scheme,M.userinfo=O.userinfo,M.host=O.host,M.port=O.port,M.path=n(O.path||""),M.query=O.query):(O.userinfo!==void 0||O.host!==void 0||O.port!==void 0?(M.userinfo=O.userinfo,M.host=O.host,M.port=O.port,M.path=n(O.path||""),M.query=O.query):(O.path?(O.path[0]==="/"?M.path=n(O.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?M.path="/"+O.path:N.path?M.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+O.path:M.path=O.path,M.path=n(M.path)),M.query=O.query):(M.path=N.path,O.query!==void 0?M.query=O.query:M.query=N.query),M.userinfo=N.userinfo,M.host=N.host,M.port=N.port),M.scheme=N.scheme),M.fragment=O.fragment,M}a(y,"MI");function _(N,O,B){let q=k(N,B),M=k(O,B);return q!==void 0&&M!==void 0&&q.toLowerCase()===M.toLowerCase()}a(_,"dr");function E(N,O){let B={host:N.host,scheme:N.scheme,userinfo:N.userinfo,port:N.port,path:N.path,query:N.query,nid:N.nid,nss:N.nss,uuid:N.uuid,fragment:N.fragment,reference:N.reference,resourceName:N.resourceName,secure:N.secure,error:""},q=Object.assign({},O),M=[],L=m(q.scheme||B.scheme);L&&L.serialize&&L.serialize(B,q),B.path!==void 0&&(q.skipEscape?B.path=s(B.path):(B.path=l(B.path),B.scheme!==void 0&&(B.path=B.path.split("%3A").join(":")))),q.reference!=="suffix"&&B.scheme&&M.push(B.scheme,":");let U=o(B);if(U!==void 0&&(q.reference!=="suffix"&&M.push("//"),M.push(U),B.path&&B.path[0]!=="/"&&M.push("/")),B.path!==void 0){let j=B.path;!q.absolutePath&&(!L||!L.absolutePath)&&(j=n(j)),U===void 0&&j[0]==="/"&&j[1]==="/"&&(j="/%2F"+j.slice(2)),M.push(j)}return B.query!==void 0&&M.push("?",B.query),B.fragment!==void 0&&M.push("#",B.fragment),M.join("")}a(E,"y0");var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function S(N,O){if(O[2]!==void 0&&N.path&&N.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof N.port=="number"&&(N.port<0||N.port>65535))return"URI port is malformed."}a(S,"nr");function T(N,O){let B=Object.assign({},O),q={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},M=!1,L=!1;B.reference==="suffix"&&(B.scheme?N=B.scheme+":"+N:N="//"+N);let U=N.match(v);if(U){q.scheme=U[1],q.userinfo=U[3],q.host=U[4],q.port=parseInt(U[5],10),q.path=U[6]||"",q.query=U[7],q.fragment=U[8],isNaN(q.port)&&(q.port=U[5]);let j=S(q,U);if(j!==void 0&&(q.error=q.error||j,M=!0),q.host)if(d(q.host)===!1){let Y=r(q.host);q.host=Y.host.toLowerCase(),L=Y.isIPV6}else L=!0;q.scheme===void 0&&q.userinfo===void 0&&q.host===void 0&&q.port===void 0&&q.query===void 0&&!q.path?q.reference="same-document":q.scheme===void 0?q.reference="relative":q.fragment===void 0?q.reference="absolute":q.reference="uri",B.reference&&B.reference!=="suffix"&&B.reference!==q.reference&&(q.error=q.error||"URI is not a "+B.reference+" reference.");let Q=m(B.scheme||q.scheme);if(!B.unicodeSupport&&(!Q||!Q.unicodeSupport)&&q.host&&(B.domainHost||Q&&Q.domainHost)&&L===!1&&f(q.host))try{q.host=URL.domainToASCII(q.host.toLowerCase())}catch(Y){q.error=q.error||"Host's domain name can not be converted to ASCII: "+Y}if((!Q||Q&&!Q.skipNormalize)&&(N.indexOf("%")!==-1&&(q.scheme!==void 0&&(q.scheme=unescape(q.scheme)),q.host!==void 0&&(q.host=u(unescape(q.host),L))),q.path&&(q.path=c(q.path)),q.fragment))try{q.fragment=encodeURI(decodeURIComponent(q.fragment))}catch{q.error=q.error||"URI malformed"}Q&&Q.parse&&Q.parse(q,B)}else q.error=q.error||"URI can not be parsed.";return{parsed:q,malformedAuthorityOrPort:M}}a(T,"LI");function w(N,O){return T(N,O).parsed}a(w,"w9");function R(N,O){return x(N,O).normalized}a(R,"rr");function x(N,O){let{parsed:B,malformedAuthorityOrPort:q}=T(N,O);return{normalized:q?N:E(B,O),malformedAuthorityOrPort:q}}a(x,"jI");function k(N,O){if(typeof N=="string"){let{normalized:B,malformedAuthorityOrPort:q}=x(N,O);return q?void 0:B}if(typeof N=="object")return E(N,O)}a(k,"FI");var D={SCHEMES:h,normalize:g,resolve:A,resolveComponent:y,equal:_,serialize:E,parse:w};e.exports=D,e.exports.default=D,e.exports.fastUri=D}),cWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=aWc();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),lWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=tPt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=Fs();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return r._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return r.str},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return r.stringify},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return r.nil},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return r.Name},"get")}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:a(function(){return r.CodeGen},"get")});var n=Tqr(),o=rPt(),s=qoo(),c=Iqr(),l=Fs(),u=ePt(),d=DRt(),f=Sc(),h=oWc(),m=cWc(),g=a((W,V)=>new RegExp(W,V),"vI");g.code="new RegExp";var A=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),_={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},E={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function S(W){var V,z,ie,H,re,le,Le,me,Oe,Te,te,ee,K,he,X,de,Be,ne,ue,Ne,xe,Fe,tt,st,vt;let Pt=W.strict,Ht=(V=W.code)===null||V===void 0?void 0:V.optimize,F=Ht===!0||Ht===void 0?1:Ht||0,se=(ie=(z=W.code)===null||z===void 0?void 0:z.regExp)!==null&&ie!==void 0?ie:g,be=(H=W.uriResolver)!==null&&H!==void 0?H:m.default;return{strictSchema:(le=(re=W.strictSchema)!==null&&re!==void 0?re:Pt)!==null&&le!==void 0?le:!0,strictNumbers:(me=(Le=W.strictNumbers)!==null&&Le!==void 0?Le:Pt)!==null&&me!==void 0?me:!0,strictTypes:(Te=(Oe=W.strictTypes)!==null&&Oe!==void 0?Oe:Pt)!==null&&Te!==void 0?Te:"log",strictTuples:(ee=(te=W.strictTuples)!==null&&te!==void 0?te:Pt)!==null&&ee!==void 0?ee:"log",strictRequired:(he=(K=W.strictRequired)!==null&&K!==void 0?K:Pt)!==null&&he!==void 0?he:!1,code:W.code?{...W.code,optimize:F,regExp:se}:{optimize:F,regExp:se},loopRequired:(X=W.loopRequired)!==null&&X!==void 0?X:v,loopEnum:(de=W.loopEnum)!==null&&de!==void 0?de:v,meta:(Be=W.meta)!==null&&Be!==void 0?Be:!0,messages:(ne=W.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(ue=W.inlineRefs)!==null&&ue!==void 0?ue:!0,schemaId:(Ne=W.schemaId)!==null&&Ne!==void 0?Ne:"$id",addUsedSchema:(xe=W.addUsedSchema)!==null&&xe!==void 0?xe:!0,validateSchema:(Fe=W.validateSchema)!==null&&Fe!==void 0?Fe:!0,validateFormats:(tt=W.validateFormats)!==null&&tt!==void 0?tt:!0,unicodeRegExp:(st=W.unicodeRegExp)!==null&&st!==void 0?st:!0,int32range:(vt=W.int32range)!==null&&vt!==void 0?vt:!0,uriResolver:be}}a(S,"Wo");class T{static{a(this,"CW")}constructor(V={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,V=this.opts={...V,...S(V)};let{es5:z,lines:ie}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:z,lines:ie}),this.logger=B(V.logger);let H=V.validateFormats;V.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,_,V,"NOT SUPPORTED"),w.call(this,E,V,"DEPRECATED","warn"),this._metaOpts=N.call(this),V.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),V.keywords&&D.call(this,V.keywords),typeof V.meta=="object"&&this.addMetaSchema(V.meta),x.call(this),V.validateFormats=H}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:V,meta:z,schemaId:ie}=this.opts,H=h;ie==="id"&&(H={...h},H.id=H.$id,delete H.$id),z&&V&&this.addMetaSchema(H,H[ie],!1)}defaultMeta(){let{meta:V,schemaId:z}=this.opts;return this.opts.defaultMeta=typeof V=="object"?V[z]||V:void 0}validate(V,z){let ie;if(typeof V=="string"){if(ie=this.getSchema(V),!ie)throw Error(`no schema with key or ref "${V}"`)}else ie=this.compile(V);let H=ie(z);return"$async"in ie||(this.errors=ie.errors),H}compile(V,z){let ie=this._addSchema(V,z);return ie.validate||this._compileSchemaEnv(ie)}compileAsync(V,z){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:ie}=this.opts;return H.call(this,V,z);async function H(Te,te){await re.call(this,Te.$schema);let ee=this._addSchema(Te,te);return ee.validate||le.call(this,ee)}async function re(Te){Te&&!this.getSchema(Te)&&await H.call(this,{$ref:Te},!0)}async function le(Te){try{return this._compileSchemaEnv(Te)}catch(te){if(!(te instanceof o.default))throw te;return Le.call(this,te),await me.call(this,te.missingSchema),le.call(this,Te)}}function Le({missingSchema:Te,missingRef:te}){if(this.refs[Te])throw Error(`AnySchema ${Te} is loaded but ${te} cannot be resolved`)}async function me(Te){let te=await Oe.call(this,Te);this.refs[Te]||await re.call(this,te.$schema),this.refs[Te]||this.addSchema(te,Te,z)}async function Oe(Te){let te=this._loading[Te];if(te)return te;try{return await(this._loading[Te]=ie(Te))}finally{delete this._loading[Te]}}}addSchema(V,z,ie,H=this.opts.validateSchema){if(Array.isArray(V)){for(let le of V)this.addSchema(le,void 0,ie,H);return this}let re;if(typeof V=="object"){let{schemaId:le}=this.opts;if(re=V[le],re!==void 0&&typeof re!="string")throw Error(`schema ${le} must be string`)}return z=(0,u.normalizeId)(z||re),this._checkUnique(z),this.schemas[z]=this._addSchema(V,ie,z,H,!0),this}addMetaSchema(V,z,ie=this.opts.validateSchema){return this.addSchema(V,z,!0,ie),this}validateSchema(V,z){if(typeof V=="boolean")return!0;let ie;if(ie=V.$schema,ie!==void 0&&typeof ie!="string")throw Error("$schema must be a string");if(ie=ie||this.opts.defaultMeta||this.defaultMeta(),!ie)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let H=this.validate(ie,V);if(!H&&z){let re="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(re);else throw Error(re)}return H}getSchema(V){let z;for(;typeof(z=R.call(this,V))=="string";)V=z;if(z===void 0){let{schemaId:ie}=this.opts,H=new c.SchemaEnv({schema:{},schemaId:ie});if(z=c.resolveSchema.call(this,H,V),!z)return;this.refs[V]=z}return z.validate||this._compileSchemaEnv(z)}removeSchema(V){if(V instanceof RegExp)return this._removeAllSchemas(this.schemas,V),this._removeAllSchemas(this.refs,V),this;switch(typeof V){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let z=R.call(this,V);return typeof z=="object"&&this._cache.delete(z.schema),delete this.schemas[V],delete this.refs[V],this}case"object":{let z=V;this._cache.delete(z);let ie=V[this.opts.schemaId];return ie&&(ie=(0,u.normalizeId)(ie),delete this.schemas[ie],delete this.refs[ie]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(V){for(let z of V)this.addKeyword(z);return this}addKeyword(V,z){let ie;if(typeof V=="string")ie=V,typeof z=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),z.keyword=ie);else if(typeof V=="object"&&z===void 0){if(z=V,ie=z.keyword,Array.isArray(ie)&&!ie.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(M.call(this,ie,z),!z)return(0,f.eachItem)(ie,re=>L.call(this,re)),this;j.call(this,z);let H={...z,type:(0,d.getJSONTypes)(z.type),schemaType:(0,d.getJSONTypes)(z.schemaType)};return(0,f.eachItem)(ie,H.type.length===0?re=>L.call(this,re,H):re=>H.type.forEach(le=>L.call(this,re,H,le))),this}getKeyword(V){let z=this.RULES.all[V];return typeof z=="object"?z.definition:!!z}removeKeyword(V){let{RULES:z}=this;delete z.keywords[V],delete z.all[V];for(let ie of z.rules){let H=ie.rules.findIndex(re=>re.keyword===V);H>=0&&ie.rules.splice(H,1)}return this}addFormat(V,z){return typeof z=="string"&&(z=new RegExp(z)),this.formats[V]=z,this}errorsText(V=this.errors,{separator:z=", ",dataVar:ie="data"}={}){return!V||V.length===0?"No errors":V.map(H=>`${ie}${H.instancePath} ${H.message}`).reduce((H,re)=>H+z+re)}$dataMetaSchema(V,z){let ie=this.RULES.all;V=JSON.parse(JSON.stringify(V));for(let H of z){let re=H.split("/").slice(1),le=V;for(let Le of re)le=le[Le];for(let Le in ie){let me=ie[Le];if(typeof me!="object")continue;let{$data:Oe}=me.definition,Te=le[Le];Oe&&Te&&(le[Le]=Y(Te))}}return V}_removeAllSchemas(V,z){for(let ie in V){let H=V[ie];(!z||z.test(ie))&&(typeof H=="string"?delete V[ie]:H&&!H.meta&&(this._cache.delete(H.schema),delete V[ie]))}}_addSchema(V,z,ie,H=this.opts.validateSchema,re=this.opts.addUsedSchema){let le,{schemaId:Le}=this.opts;if(typeof V=="object")le=V[Le];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof V!="boolean")throw Error("schema must be object or boolean")}let me=this._cache.get(V);if(me!==void 0)return me;ie=(0,u.normalizeId)(le||ie);let Oe=u.getSchemaRefs.call(this,V,ie);return me=new c.SchemaEnv({schema:V,schemaId:Le,meta:z,baseId:ie,localRefs:Oe}),this._cache.set(me.schema,me),re&&!ie.startsWith("#")&&(ie&&this._checkUnique(ie),this.refs[ie]=me),H&&this.validateSchema(V,!0),me}_checkUnique(V){if(this.schemas[V]||this.refs[V])throw Error(`schema with key or id "${V}" already exists`)}_compileSchemaEnv(V){if(V.meta?this._compileMetaSchema(V):c.compileSchema.call(this,V),!V.validate)throw Error("ajv implementation error");return V.validate}_compileMetaSchema(V){let z=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,V)}finally{this.opts=z}}}T.ValidationError=n.default,T.MissingRefError=o.default,t.default=T;function w(W,V,z,ie="error"){for(let H in W){let re=H;re in V&&this.logger[ie](`${z}: option ${H}. ${W[re]}`)}}a(w,"_I");function R(W){return W=(0,u.normalizeId)(W),this.schemas[W]||this.refs[W]}a(R,"kI");function x(){let W=this.opts.schemas;if(W)if(Array.isArray(W))this.addSchema(W);else for(let V in W)this.addSchema(W[V],V)}a(x,"Go");function k(){for(let W in this.opts.formats){let V=this.opts.formats[W];V&&this.addFormat(W,V)}}a(k,"Uo");function D(W){if(Array.isArray(W)){this.addVocabulary(W);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let V in W){let z=W[V];z.keyword||(z.keyword=V),this.addKeyword(z)}}a(D,"Ho");function N(){let W={...this.opts};for(let V of A)delete W[V];return W}a(N,"Ko");var O={log(){},warn(){},error(){}};function B(W){if(W===!1)return O;if(W===void 0)return console;if(W.log&&W.warn&&W.error)return W;throw Error("logger must implement log, warn and error methods")}a(B,"Vo");var q=/^[a-z_$][a-z0-9_$:-]*$/i;function M(W,V){let{RULES:z}=this;if((0,f.eachItem)(W,ie=>{if(z.keywords[ie])throw Error(`Keyword ${ie} is already defined`);if(!q.test(ie))throw Error(`Keyword ${ie} has invalid name`)}),!!V&&V.$data&&!("code"in V||"validate"in V))throw Error('$data keyword must have "code" or "validate" function')}a(M,"zo");function L(W,V,z){var ie;let H=V?.post;if(z&&H)throw Error('keyword with "post" flag cannot have "type"');let{RULES:re}=this,le=H?re.post:re.rules.find(({type:me})=>me===z);if(le||(le={type:z,rules:[]},re.rules.push(le)),re.keywords[W]=!0,!V)return;let Le={keyword:W,definition:{...V,type:(0,d.getJSONTypes)(V.type),schemaType:(0,d.getJSONTypes)(V.schemaType)}};V.before?U.call(this,le,Le,V.before):le.rules.push(Le),re.all[W]=Le,(ie=V.implements)===null||ie===void 0||ie.forEach(me=>this.addKeyword(me))}a(L,"lB");function U(W,V,z){let ie=W.rules.findIndex(H=>H.keyword===z);ie>=0?W.rules.splice(ie,0,V):(W.rules.push(V),this.logger.warn(`rule ${z} is not defined`))}a(U,"No");function j(W){let{metaSchema:V}=W;V!==void 0&&(W.$data&&this.opts.$data&&(V=Y(V)),W.validateSchema=this.compile(V,!0))}a(j,"wo");var Q={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Y(W){return{anyOf:[W,Q]}}a(Y,"CI")}),uWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=e}),dWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=rPt(),r=vM(),n=Fs(),o=lz(),s=Iqr(),c=Sc(),l={keyword:"$ref",schemaType:"string",code(f){let{gen:h,schema:m,it:g}=f,{baseId:A,schemaEnv:y,validateName:_,opts:E,self:v}=g,{root:S}=y;if((m==="#"||m==="#/")&&A===S.baseId)return w();let T=s.resolveRef.call(v,S,A,m);if(T===void 0)throw new e.default(g.opts.uriResolver,A,m);if(T instanceof s.SchemaEnv)return R(T);return x(T);function w(){if(y===S)return d(f,_,y,y.$async);let k=h.scopeValue("root",{ref:S});return d(f,n._`${k}.validate`,S,S.$async)}function R(k){let D=u(f,k);d(f,D,k,k.$async)}function x(k){let D=h.scopeValue("schema",E.code.source===!0?{ref:k,code:(0,n.stringify)(k)}:{ref:k}),N=h.name("valid"),O=f.subschema({schema:k,dataTypes:[],schemaPath:n.nil,topSchemaRef:D,errSchemaPath:m},N);f.mergeEvaluated(O),f.ok(N)}}};function u(f,h){let{gen:m}=f;return h.validate?m.scopeValue("validate",{ref:h.validate}):n._`${m.scopeValue("wrapper",{ref:h})}.validate`}a(u,"hI"),t.getValidate=u;function d(f,h,m,g){let{gen:A,it:y}=f,{allErrors:_,schemaEnv:E,opts:v}=y,S=v.passContext?o.default.this:n.nil;g?T():w();function T(){if(!E.$async)throw Error("async schema referenced by sync schema");let k=A.let("valid");A.try(()=>{A.code(n._`await ${(0,r.callValidateCode)(f,h,S)}`),x(h),!_&&A.assign(k,!0)},D=>{A.if(n._`!(${D} instanceof ${y.ValidationError})`,()=>A.throw(D)),R(D),!_&&A.assign(k,!1)}),f.ok(k)}a(T,"V");function w(){f.result((0,r.callValidateCode)(f,h,S),()=>x(h),()=>R(h))}a(w,"B");function R(k){let D=n._`${k}.errors`;A.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${D} : ${o.default.vErrors}.concat(${D})`),A.assign(o.default.errors,n._`${o.default.vErrors}.length`)}a(R,"z");function x(k){var D;if(!y.opts.unevaluated)return;let N=(D=m?.validate)===null||D===void 0?void 0:D.evaluated;if(y.props!==!0)if(N&&!N.dynamicProps)N.props!==void 0&&(y.props=c.mergeEvaluated.props(A,N.props,y.props));else{let O=A.var("props",n._`${k}.evaluated.props`);y.props=c.mergeEvaluated.props(A,O,y.props,n.Name)}if(y.items!==!0)if(N&&!N.dynamicItems)N.items!==void 0&&(y.items=c.mergeEvaluated.items(A,N.items,y.items));else{let O=A.var("items",n._`${k}.evaluated.items`);y.items=c.mergeEvaluated.items(A,O,y.items,n.Name)}}a(x,"N")}a(d,"xW"),t.callRef=d,t.default=l}),fWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uWc(),r=dWc(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),pWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=e.operators,n={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},o={message:a(({keyword:c,schemaCode:l})=>e.str`must be ${n[c].okStr} ${l}`,"message"),params:a(({keyword:c,schemaCode:l})=>e._`{comparison: ${n[c].okStr}, limit: ${l}}`,"params")},s={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:o,code(c){let{keyword:l,data:u,schemaCode:d}=c;c.fail$data(e._`${u} ${n[l].fail} ${d} || isNaN(${u})`)}};t.default=s}),hWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r={message:a(({schemaCode:o})=>e.str`must be multiple of ${o}`,"message"),params:a(({schemaCode:o})=>e._`{multipleOf: ${o}}`,"params")},n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:r,code(o){let{gen:s,data:c,schemaCode:l,it:u}=o,d=u.opts.multipleOfPrecision,f=s.let("res"),h=d?e._`Math.abs(Math.round(${f}) - ${f}) > 1e-${d}`:e._`${f} !== parseInt(${f})`;o.fail$data(e._`(${l} === 0 || (${f} = ${c}/${l}, ${h}))`)}};t.default=n}),mWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});function e(r){let n=r.length,o=0,s=0,c;for(;s=55296&&c<=56319&&s{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n=mWc(),o={message({keyword:c,schemaCode:l}){let u=c==="maxLength"?"more":"fewer";return e.str`must NOT have ${u} than ${l} characters`},params:a(({schemaCode:c})=>e._`{limit: ${c}}`,"params")},s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:o,code(c){let{keyword:l,data:u,schemaCode:d,it:f}=c,h=l==="maxLength"?e.operators.GT:e.operators.LT,m=f.opts.unicode===!1?e._`${u}.length`:e._`${(0,r.useFunc)(c.gen,n.default)}(${u})`;c.fail$data(e._`${m} ${h} ${d}`)}};t.default=s}),AWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=vM(),r=Sc(),n=Fs(),o={message:a(({schemaCode:c})=>n.str`must match pattern "${c}"`,"message"),params:a(({schemaCode:c})=>n._`{pattern: ${c}}`,"params")},s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schema:f,schemaCode:h,it:m}=c,g=m.opts.unicodeRegExp?"u":"";if(d){let{regExp:A}=m.opts.code,y=A.code==="new RegExp"?n._`new RegExp`:(0,r.useFunc)(l,A),_=l.let("valid");l.try(()=>l.assign(_,n._`${y}(${h}, ${g}).test(${u})`),()=>l.assign(_,!1)),c.fail$data(n._`!${_}`)}else{let A=(0,e.usePattern)(c,f);c.fail$data(n._`!${A}.test(${u})`)}}};t.default=s}),yWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r={message({keyword:o,schemaCode:s}){let c=o==="maxProperties"?"more":"fewer";return e.str`must NOT have ${c} than ${s} properties`},params:a(({schemaCode:o})=>e._`{limit: ${o}}`,"params")},n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:r,code(o){let{keyword:s,data:c,schemaCode:l}=o,u=s==="maxProperties"?e.operators.GT:e.operators.LT;o.fail$data(e._`Object.keys(${c}).length ${u} ${l}`)}};t.default=n}),_Wc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=vM(),r=Fs(),n=Sc(),o={message:a(({params:{missingProperty:c}})=>r.str`must have required property '${c}'`,"message"),params:a(({params:{missingProperty:c}})=>r._`{missingProperty: ${c}}`,"params")},s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:o,code(c){let{gen:l,schema:u,schemaCode:d,data:f,$data:h,it:m}=c,{opts:g}=m;if(!h&&u.length===0)return;let A=u.length>=g.loopRequired;if(m.allErrors?y():_(),g.strictRequired){let S=c.parentSchema.properties,{definedProperties:T}=c.it;for(let w of u)if(S?.[w]===void 0&&!T.has(w)){let R=m.schemaEnv.baseId+m.errSchemaPath,x=`required property "${w}" is not defined at "${R}" (strictRequired)`;(0,n.checkStrictMode)(m,x,m.opts.strictRequired)}}function y(){if(A||h)c.block$data(r.nil,E);else for(let S of u)(0,e.checkReportMissingProp)(c,S)}a(y,"q");function _(){let S=l.let("missing");if(A||h){let T=l.let("valid",!0);c.block$data(T,()=>v(S,T)),c.ok(T)}else l.if((0,e.checkMissingProp)(c,u,S)),(0,e.reportMissingProp)(c,S),l.else()}a(_,"V");function E(){l.forOf("prop",d,S=>{c.setParams({missingProperty:S}),l.if((0,e.noPropertyInData)(l,f,S,g.ownProperties),()=>c.error())})}a(E,"B");function v(S,T){c.setParams({missingProperty:S}),l.forOf(S,d,()=>{l.assign(T,(0,e.propertyInData)(l,f,S,g.ownProperties)),l.if((0,r.not)(T),()=>{c.error(),l.break()})},r.nil)}a(v,"z")}};t.default=s}),EWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r={message({keyword:o,schemaCode:s}){let c=o==="maxItems"?"more":"fewer";return e.str`must NOT have ${c} than ${s} items`},params:a(({schemaCode:o})=>e._`{limit: ${o}}`,"params")},n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:r,code(o){let{keyword:s,data:c,schemaCode:l}=o,u=s==="maxItems"?e.operators.GT:e.operators.LT;o.fail$data(e._`${c}.length ${u} ${l}`)}};t.default=n}),xqr=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Hoo();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),vWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=DRt(),r=Fs(),n=Sc(),o=xqr(),s={message:a(({params:{i:l,j:u}})=>r.str`must NOT have duplicate items (items ## ${u} and ${l} are identical)`,"message"),params:a(({params:{i:l,j:u}})=>r._`{i: ${l}, j: ${u}}`,"params")},c={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:s,code(l){let{gen:u,data:d,$data:f,schema:h,parentSchema:m,schemaCode:g,it:A}=l;if(!f&&!h)return;let y=u.let("valid"),_=m.items?(0,e.getSchemaTypes)(m.items):[];l.block$data(y,E,r._`${g} === false`),l.ok(y);function E(){let w=u.let("i",r._`${d}.length`),R=u.let("j");l.setParams({i:w,j:R}),u.assign(y,!0),u.if(r._`${w} > 1`,()=>(v()?S:T)(w,R))}a(E,"V");function v(){return _.length>0&&!_.some(w=>w==="object"||w==="array")}a(v,"B");function S(w,R){let x=u.name("item"),k=(0,e.checkDataTypes)(_,x,A.opts.strictNumbers,e.DataType.Wrong),D=u.const("indices",r._`{}`);u.for(r._`;${w}--;`,()=>{u.let(x,r._`${d}[${w}]`),u.if(k,r._`continue`),_.length>1&&u.if(r._`typeof ${x} == "string"`,r._`${x} += "_"`),u.if(r._`typeof ${D}[${x}] == "number"`,()=>{u.assign(R,r._`${D}[${x}]`),l.error(),u.assign(y,!1).break()}).code(r._`${D}[${x}] = ${w}`)})}a(S,"z");function T(w,R){let x=(0,n.useFunc)(u,o.default),k=u.name("outer");u.label(k).for(r._`;${w}--;`,()=>u.for(r._`${R} = ${w}; ${R}--;`,()=>u.if(r._`${x}(${d}[${w}], ${d}[${R}])`,()=>{l.error(),u.assign(y,!1).break(k)})))}a(T,"N")}};t.default=c}),CWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n=xqr(),o={message:"must be equal to constant",params:a(({schemaCode:c})=>e._`{allowedValue: ${c}}`,"params")},s={keyword:"const",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schemaCode:f,schema:h}=c;d||h&&typeof h=="object"?c.fail$data(e._`!${(0,r.useFunc)(l,n.default)}(${u}, ${f})`):c.fail(e._`${h} !== ${u}`)}};t.default=s}),bWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n=xqr(),o={message:"must be equal to one of the allowed values",params:a(({schemaCode:c})=>e._`{allowedValues: ${c}}`,"params")},s={keyword:"enum",schemaType:"array",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schema:f,schemaCode:h,it:m}=c;if(!d&&f.length===0)throw Error("enum must have non-empty array");let g=f.length>=m.opts.loopEnum,A,y=a(()=>A??(A=(0,r.useFunc)(l,n.default)),"q"),_;if(g||d)_=l.let("valid"),c.block$data(_,E);else{if(!Array.isArray(f))throw Error("ajv implementation error");let S=l.const("vSchema",h);_=(0,e.or)(...f.map((T,w)=>v(S,w)))}c.pass(_);function E(){l.assign(_,!1),l.forOf("v",h,S=>l.if(e._`${y()}(${u}, ${S})`,()=>l.assign(_,!0).break()))}a(E,"B");function v(S,T){let w=f[T];return typeof w=="object"&&w!==null?e._`${y()}(${u}, ${S}[${T}])`:e._`${u} === ${w}`}a(v,"z")}};t.default=s}),SWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pWc(),r=hWc(),n=gWc(),o=AWc(),s=yWc(),c=_Wc(),l=EWc(),u=vWc(),d=CWc(),f=bWc(),h=[e.default,r.default,n.default,o.default,s.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,f.default];t.default=h}),$oo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=Fs(),r=Sc(),n={message:a(({params:{len:c}})=>e.str`must NOT have more than ${c} items`,"message"),params:a(({params:{len:c}})=>e._`{limit: ${c}}`,"params")},o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n,code(c){let{parentSchema:l,it:u}=c,{items:d}=l;if(!Array.isArray(d)){(0,r.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(c,d)}};function s(c,l){let{gen:u,schema:d,data:f,keyword:h,it:m}=c;m.items=!0;let g=u.const("len",e._`${f}.length`);if(d===!1)c.setParams({len:l.length}),c.pass(e._`${g} <= ${l.length}`);else if(typeof d=="object"&&!(0,r.alwaysValidSchema)(m,d)){let y=u.var("valid",e._`${g} <= ${l.length}`);u.if((0,e.not)(y),()=>A(y)),c.ok(y)}function A(y){u.forRange("i",l.length,g,_=>{c.subschema({keyword:h,dataProp:_,dataPropType:r.Type.Num},y),!m.allErrors&&u.if((0,e.not)(y),()=>u.break())})}a(A,"H")}a(s,"FR"),t.validateAdditionalItems=s,t.default=o}),Voo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=Fs(),r=Sc(),n=vM(),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(c){let{schema:l,it:u}=c;if(Array.isArray(l))return s(c,"additionalItems",l);u.items=!0,!(0,r.alwaysValidSchema)(u,l)&&c.ok((0,n.validateArray)(c))}};function s(c,l,u=c.schema){let{gen:d,parentSchema:f,data:h,keyword:m,it:g}=c;_(f),g.opts.unevaluated&&u.length&&g.items!==!0&&(g.items=r.mergeEvaluated.items(d,u.length,g.items));let A=d.name("valid"),y=d.const("len",e._`${h}.length`);u.forEach((E,v)=>{(0,r.alwaysValidSchema)(g,E)||(d.if(e._`${y} > ${v}`,()=>c.subschema({keyword:m,schemaProp:v,dataProp:v},A)),c.ok(A))});function _(E){let{opts:v,errSchemaPath:S}=g,T=u.length,w=T===E.minItems&&(T===E.maxItems||E[l]===!1);if(v.strictTuples&&!w){let R=`"${m}" is ${T}-tuple, but minItems or maxItems/${l} are not specified or different at path "${S}"`;(0,r.checkStrictMode)(g,R,v.strictTuples)}}a(_,"V")}a(s,"jR"),t.validateTuple=s,t.default=o}),TWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Voo(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),IWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n=vM(),o=$oo(),s={message:a(({params:{len:l}})=>e.str`must NOT have more than ${l} items`,"message"),params:a(({params:{len:l}})=>e._`{limit: ${l}}`,"params")},c={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:s,code(l){let{schema:u,parentSchema:d,it:f}=l,{prefixItems:h}=d;f.items=!0,!(0,r.alwaysValidSchema)(f,u)&&(h?(0,o.validateAdditionalItems)(l,h):l.ok((0,n.validateArray)(l)))}};t.default=c}),xWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n={message:a(({params:{min:s,max:c}})=>c===void 0?e.str`must contain at least ${s} valid item(s)`:e.str`must contain at least ${s} and no more than ${c} valid item(s)`,"message"),params:a(({params:{min:s,max:c}})=>c===void 0?e._`{minContains: ${s}}`:e._`{minContains: ${s}, maxContains: ${c}}`,"params")},o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:n,code(s){let{gen:c,schema:l,parentSchema:u,data:d,it:f}=s,h,m,{minContains:g,maxContains:A}=u;f.opts.next?(h=g===void 0?1:g,m=A):h=1;let y=c.const("len",e._`${d}.length`);if(s.setParams({min:h,max:m}),m===void 0&&h===0){(0,r.checkStrictMode)(f,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&h>m){(0,r.checkStrictMode)(f,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,r.alwaysValidSchema)(f,l)){let T=e._`${y} >= ${h}`;m!==void 0&&(T=e._`${T} && ${y} <= ${m}`),s.pass(T);return}f.items=!0;let _=c.name("valid");m===void 0&&h===1?v(_,()=>c.if(_,()=>c.break())):h===0?(c.let(_,!0),m!==void 0&&c.if(e._`${d}.length > 0`,E)):(c.let(_,!1),E()),s.result(_,()=>s.reset());function E(){let T=c.name("_valid"),w=c.let("count",0);v(T,()=>c.if(T,()=>S(w)))}a(E,"z");function v(T,w){c.forRange("i",0,y,R=>{s.subschema({keyword:"contains",dataProp:R,dataPropType:r.Type.Num,compositeRule:!0},T),w()})}a(v,"N");function S(T){c.code(e._`${T}++`),m===void 0?c.if(e._`${T} >= ${h}`,()=>c.assign(_,!0).break()):(c.if(e._`${T} > ${m}`,()=>c.assign(_,!1).break()),h===1?c.assign(_,!0):c.if(e._`${T} >= ${h}`,()=>c.assign(_,!0)))}a(S,"w")}};t.default=o}),wWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=Fs(),r=Sc(),n=vM();t.error={message:a(({params:{property:u,depsCount:d,deps:f}})=>{let h=d===1?"property":"properties";return e.str`must have ${h} ${f} when property ${u} is present`},"message"),params:a(({params:{property:u,depsCount:d,deps:f,missingProperty:h}})=>e._`{property: ${u}, missingProperty: ${h}, depsCount: ${d}, - deps: ${f}}`,"params")};var o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(u){let[d,f]=s(u);c(u,d),l(u,f)}};function s({schema:u}){let d={},f={};for(let h in u){if(h==="__proto__")continue;let m=Array.isArray(u[h])?d:f;m[h]=u[h]}return[d,f]}a(s,"at");function c(u,d=u.schema){let{gen:f,data:h,it:m}=u;if(Object.keys(d).length===0)return;let g=f.let("missing");for(let A in d){let y=d[A];if(y.length===0)continue;let _=(0,n.propertyInData)(f,h,A,m.opts.ownProperties);u.setParams({property:A,depsCount:y.length,deps:y.join(", ")}),m.allErrors?f.if(_,()=>{for(let E of y)(0,n.checkReportMissingProp)(u,E)}):(f.if(e._`${_} && (${(0,n.checkMissingProp)(u,y,g)})`),(0,n.reportMissingProp)(u,g),f.else())}}a(c,"vR"),t.validatePropertyDeps=c;function l(u,d=u.schema){let{gen:f,data:h,keyword:m,it:g}=u,A=f.name("valid");for(let y in d)(0,r.alwaysValidSchema)(g,d[y])||(f.if((0,n.propertyInData)(f,h,y,g.opts.ownProperties),()=>{let _=u.subschema({keyword:m,schemaProp:y},A);u.mergeValidEvaluated(_,A)},()=>f.var(A,!0)),u.ok(A))}a(l,"CR"),t.validateSchemaDeps=l,t.default=o}),xWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n={message:"property name must be valid",params:a(({params:s})=>e._`{propertyName: ${s.propertyName}}`,"params")},o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:n,code(s){let{gen:c,schema:l,data:u,it:d}=s;if((0,r.alwaysValidSchema)(d,l))return;let f=c.name("valid");c.forIn("key",u,h=>{s.setParams({propertyName:h}),s.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},f),c.if((0,e.not)(f),()=>{s.error(!0),!d.allErrors&&c.break()})}),s.ok(f)}};t.default=o}),$oo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=vM(),r=Fs(),n=cz(),o=Sc(),s={message:"must NOT have additional properties",params:a(({params:l})=>r._`{additionalProperty: ${l.additionalProperty}}`,"params")},c={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:s,code(l){let{gen:u,schema:d,parentSchema:f,data:h,errsCount:m,it:g}=l;if(!m)throw Error("ajv implementation error");let{allErrors:A,opts:y}=g;if(g.props=!0,y.removeAdditional!=="all"&&(0,o.alwaysValidSchema)(g,d))return;let _=(0,e.allSchemaProperties)(f.properties),E=(0,e.allSchemaProperties)(f.patternProperties);v(),l.ok(r._`${m} === ${n.default.errors}`);function v(){u.forIn("key",h,x=>{!_.length&&!E.length?w(x):u.if(S(x),()=>w(x))})}a(v,"B");function S(x){let k;if(_.length>8){let D=(0,o.schemaRefOrVal)(g,f.properties,"properties");k=(0,e.isOwnProperty)(u,D,x)}else _.length?k=(0,r.or)(..._.map(D=>r._`${x} === ${D}`)):k=r.nil;return E.length&&(k=(0,r.or)(k,...E.map(D=>r._`${(0,e.usePattern)(l,D)}.test(${x})`))),(0,r.not)(k)}a(S,"z");function T(x){u.code(r._`delete ${h}[${x}]`)}a(T,"N");function w(x){if(y.removeAdditional==="all"||y.removeAdditional&&d===!1){T(x);return}if(d===!1){l.setParams({additionalProperty:x}),l.error(),!A&&u.break();return}if(typeof d=="object"&&!(0,o.alwaysValidSchema)(g,d)){let k=u.name("valid");y.removeAdditional==="failing"?(R(x,k,!1),u.if((0,r.not)(k),()=>{l.reset(),T(x)})):(R(x,k),!A&&u.if((0,r.not)(k),()=>u.break()))}}a(w,"w");function R(x,k,D){let N={keyword:"additionalProperties",dataProp:x,dataPropType:o.Type.Str};D===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(N,k)}a(R,"O")}};t.default=c}),wWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ePt(),r=vM(),n=Sc(),o=$oo(),s={keyword:"properties",type:"object",schemaType:"object",code(c){let{gen:l,schema:u,parentSchema:d,data:f,it:h}=c;h.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&o.default.code(new e.KeywordCxt(h,o.default,"additionalProperties"));let m=(0,r.allSchemaProperties)(u);for(let E of m)h.definedProperties.add(E);h.opts.unevaluated&&m.length&&h.props!==!0&&(h.props=n.mergeEvaluated.props(l,(0,n.toHash)(m),h.props));let g=m.filter(E=>!(0,n.alwaysValidSchema)(h,u[E]));if(g.length===0)return;let A=l.name("valid");for(let E of g)y(E)?_(E):(l.if((0,r.propertyInData)(l,f,E,h.opts.ownProperties)),_(E),!h.allErrors&&l.else().var(A,!0),l.endIf()),c.it.definedProperties.add(E),c.ok(A);function y(E){return h.opts.useDefaults&&!h.compositeRule&&u[E].default!==void 0}a(y,"q");function _(E){c.subschema({keyword:"properties",schemaProp:E,dataProp:E},A)}a(_,"V")}};t.default=s}),RWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=vM(),r=Fs(),n=Sc(),o=Sc(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(c){let{gen:l,schema:u,data:d,parentSchema:f,it:h}=c,{opts:m}=h,g=(0,e.allSchemaProperties)(u),A=g.filter(w=>(0,n.alwaysValidSchema)(h,u[w]));if(g.length===0||A.length===g.length&&(!h.opts.unevaluated||h.props===!0))return;let y=m.strictSchema&&!m.allowMatchingProperties&&f.properties,_=l.name("valid");h.props!==!0&&!(h.props instanceof r.Name)&&(h.props=(0,o.evaluatedPropsToName)(l,h.props));let{props:E}=h;v();function v(){for(let w of g)y&&S(w),h.allErrors?T(w):(l.var(_,!0),T(w),l.if(_))}a(v,"z");function S(w){for(let R in y)new RegExp(w).test(R)&&(0,n.checkStrictMode)(h,`property ${R} matches pattern ${w} (use allowMatchingProperties)`)}a(S,"N");function T(w){l.forIn("key",d,R=>{l.if(r._`${(0,e.usePattern)(c,w)}.test(${R})`,()=>{let x=A.includes(w);x||c.subschema({keyword:"patternProperties",schemaProp:w,dataProp:R,dataPropType:o.Type.Str},_),h.opts.unevaluated&&E!==!0?l.assign(r._`${E}[${R}]`,!0):!x&&!h.allErrors&&l.if((0,r.not)(_),()=>l.break())})})}a(T,"w")}};t.default=s}),kWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Sc(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){let{gen:o,schema:s,it:c}=n;if((0,e.alwaysValidSchema)(c,s)){n.fail();return}let l=o.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),n.failResult(l,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};t.default=r}),PWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=vM(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),DWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n={message:"must match exactly one schema in oneOf",params:a(({params:s})=>e._`{passingSchemas: ${s.passing}}`,"params")},o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:n,code(s){let{gen:c,schema:l,parentSchema:u,it:d}=s;if(!Array.isArray(l))throw Error("ajv implementation error");if(d.opts.discriminator&&u.discriminator)return;let f=l,h=c.let("valid",!1),m=c.let("passing",null),g=c.name("_valid");s.setParams({passing:m}),c.block(A),s.result(h,()=>s.reset(),()=>s.error(!0));function A(){f.forEach((y,_)=>{let E;(0,r.alwaysValidSchema)(d,y)?c.var(g,!0):E=s.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},g),_>0&&c.if(e._`${g} && ${h}`).assign(h,!1).assign(m,e._`[${m}, ${_}]`).else(),c.if(g,()=>{c.assign(h,!0),c.assign(m,_),E&&s.mergeEvaluated(E,e.Name)})})}a(A,"q")}};t.default=o}),NWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Sc(),r={keyword:"allOf",schemaType:"array",code(n){let{gen:o,schema:s,it:c}=n;if(!Array.isArray(s))throw Error("ajv implementation error");let l=o.name("valid");s.forEach((u,d)=>{if((0,e.alwaysValidSchema)(c,u))return;let f=n.subschema({keyword:"allOf",schemaProp:d},l);n.ok(l),n.mergeEvaluated(f)})}};t.default=r}),MWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n={message:a(({params:c})=>e.str`must match "${c.ifClause}" schema`,"message"),params:a(({params:c})=>e._`{failingKeyword: ${c.ifClause}}`,"params")},o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:n,code(c){let{gen:l,parentSchema:u,it:d}=c;u.then===void 0&&u.else===void 0&&(0,r.checkStrictMode)(d,'"if" without "then" and "else" is ignored');let f=s(d,"then"),h=s(d,"else");if(!f&&!h)return;let m=l.let("valid",!0),g=l.name("_valid");if(A(),c.reset(),f&&h){let _=l.let("ifClause");c.setParams({ifClause:_}),l.if(g,y("then",_),y("else",_))}else f?l.if(g,y("then")):l.if((0,e.not)(g),y("else"));c.pass(m,()=>c.error(!0));function A(){let _=c.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);c.mergeEvaluated(_)}a(A,"H");function y(_,E){return()=>{let v=c.subschema({keyword:_},g);l.assign(m,g),c.mergeValidEvaluated(v,m),E?l.assign(E,e._`${_}`):c.setParams({ifClause:_})}}a(y,"q")}};function s(c,l){let u=c.schema[l];return u!==void 0&&!(0,r.alwaysValidSchema)(c,u)}a(s,"WP"),t.default=o}),OWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Sc(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:o,it:s}){o.if===void 0&&(0,e.checkStrictMode)(s,`"${n}" without "if" is ignored`)}};t.default=r}),LWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Hoo(),r=bWc(),n=Goo(),o=SWc(),s=TWc(),c=IWc(),l=xWc(),u=$oo(),d=wWc(),f=RWc(),h=kWc(),m=PWc(),g=DWc(),A=NWc(),y=MWc(),_=OWc();function E(v=!1){let S=[h.default,m.default,g.default,A.default,y.default,_.default,l.default,u.default,c.default,d.default,f.default];return v?S.push(r.default,o.default):S.push(e.default,n.default),S.push(s.default),S}a(E,"ra"),t.default=E}),BWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r={message:a(({schemaCode:o})=>e.str`must match format "${o}"`,"message"),params:a(({schemaCode:o})=>e._`{format: ${o}}`,"params")},n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:r,code(o,s){let{gen:c,data:l,$data:u,schema:d,schemaCode:f,it:h}=o,{opts:m,errSchemaPath:g,schemaEnv:A,self:y}=h;if(!m.validateFormats)return;u?_():E();function _(){let v=c.scopeValue("formats",{ref:y.formats,code:m.code.formats}),S=c.const("fDef",e._`${v}[${f}]`),T=c.let("fType"),w=c.let("format");c.if(e._`typeof ${S} == "object" && !(${S} instanceof RegExp)`,()=>c.assign(T,e._`${S}.type || "string"`).assign(w,e._`${S}.validate`),()=>c.assign(T,e._`"string"`).assign(w,S)),o.fail$data((0,e.or)(R(),x()));function R(){return m.strictSchema===!1?e.nil:e._`${f} && !${w}`}a(R,"j");function x(){let k=A.$async?e._`(${S}.async ? await ${w}(${l}) : ${w}(${l}))`:e._`${w}(${l})`,D=e._`(typeof ${w} == "function" ? ${k} : ${w}.test(${l}))`;return e._`${w} && ${w} !== true && ${T} === ${s} && !${D}`}a(x,"A")}a(_,"z");function E(){let v=y.formats[d];if(!v){R();return}if(v===!0)return;let[S,T,w]=x(v);S===s&&o.pass(k());function R(){if(m.strictSchema===!1){y.logger.warn(D());return}throw Error(D());function D(){return`unknown format "${d}" ignored in schema at path "${g}"`}}a(R,"j");function x(D){let N=D instanceof RegExp?(0,e.regexpCode)(D):m.code.formats?e._`${m.code.formats}${(0,e.getProperty)(d)}`:void 0,O=c.scopeValue("formats",{key:d,ref:D,code:N});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,e._`${O}.validate`]:["string",D,O]}a(x,"A");function k(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!A.$async)throw Error("async format in sync schema");return e._`await ${w}(${l})`}return typeof T=="function"?e._`${w}(${l})`:e._`${w}.test(${l})`}a(k,"S")}a(E,"N")}};t.default=n}),FWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=BWc(),r=[e.default];t.default=r}),UWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),QWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uWc(),r=CWc(),n=LWc(),o=FWc(),s=UWc(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),qWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0;var e;(function(r){r.Tag="tag",r.Mapping="mapping"})(e||(t.DiscrError=e={}))}),jWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=qWc(),n=Tqr(),o=tPt(),s=Sc(),c={message:a(({params:{discrError:u,tagName:d}})=>u===r.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,"message"),params:a(({params:{discrError:u,tag:d,tagName:f}})=>e._`{error: ${u}, tag: ${f}, tagValue: ${d}}`,"params")},l={keyword:"discriminator",type:"object",schemaType:"object",error:c,code(u){let{gen:d,data:f,schema:h,parentSchema:m,it:g}=u,{oneOf:A}=m;if(!g.opts.discriminator)throw Error("discriminator: requires discriminator option");let y=h.propertyName;if(typeof y!="string")throw Error("discriminator: requires propertyName");if(h.mapping)throw Error("discriminator: mapping is not supported");if(!A)throw Error("discriminator: requires oneOf keyword");let _=d.let("valid",!1),E=d.const("tag",e._`${f}${(0,e.getProperty)(y)}`);d.if(e._`typeof ${E} == "string"`,()=>v(),()=>u.error(!1,{discrError:r.DiscrError.Tag,tag:E,tagName:y})),u.ok(_);function v(){let w=T();d.if(!1);for(let R in w)d.elseIf(e._`${E} === ${R}`),d.assign(_,S(w[R]));d.else(),u.error(!1,{discrError:r.DiscrError.Mapping,tag:E,tagName:y}),d.endIf()}a(v,"V");function S(w){let R=d.name("valid"),x=u.subschema({keyword:"oneOf",schemaProp:w},R);return u.mergeEvaluated(x,e.Name),R}a(S,"B");function T(){var w;let R={},x=D(m),k=!0;for(let B=0;B{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),Voo=jt((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;var r=aWc(),n=QWc(),o=jWc(),s=HWc(),c=["/properties"],l="http://json-schema.org/draft-07/schema";class u extends r.default{static{a(this,"pJ")}_addVocabularies(){super._addVocabularies(),n.default.forEach(A=>this.addVocabulary(A)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let A=this.opts.$data?this.$dataMetaSchema(s,c):s;this.addMetaSchema(A,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var d=ePt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=Fs();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return f._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return f.str},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return f.stringify},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return f.nil},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return f.Name},"get")}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:a(function(){return f.CodeGen},"get")});var h=Sqr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=tPt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),GWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(O,B){return{validate:O,compare:B}}a(e,"b4"),t.fullFormats={date:e(s,c),time:e(u(!0),d),"date-time":e(m(!0),g),"iso-time":e(u(),f),"iso-date-time":e(m(),A),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:E,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:N,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:S,int32:{type:"number",validate:R},int64:{type:"number",validate:x},float:{type:"number",validate:k},double:{type:"number",validate:k},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,c),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,A),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(O){return O%4===0&&(O%100!==0||O%400===0)}a(r,"Is");var n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(O){let B=n.exec(O);if(!B)return!1;let q=+B[1],M=+B[2],L=+B[3];return M>=1&&M<=12&&L>=1&&L<=(M===2&&r(q)?29:o[M])}a(s,"xP");function c(O,B){if(O&&B)return O>B?1:O23||W>59||O&&!j)return!1;if(M<=23&&L<=59&&U<60)return!0;let V=L-W*Q,z=M-Y*Q-(V<0?1:0);return(z===23||z===-1)&&(V===59||V===-1)&&U<61}}a(u,"Jz");function d(O,B){if(!(O&&B))return;let q=new Date("2020-01-01T"+O).valueOf(),M=new Date("2020-01-01T"+B).valueOf();if(q&&M)return q-M}a(d,"Wz");function f(O,B){if(!(O&&B))return;let q=l.exec(O),M=l.exec(B);if(q&&M)return O=q[1]+q[2]+q[3],B=M[1]+M[2]+M[3],O>B?1:O=T}a(R,"Cs");function x(O){return Number.isInteger(O)}a(x,"Ts");function k(){return!0}a(k,"TP");var D=/[^\\]\\Z/;function N(O){if(D.test(O))return!1;try{return new RegExp(O),!0}catch{return!1}}a(N,"ys")}),$Wc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=Voo(),r=Fs(),n=r.operators,o={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},s={message:a(({keyword:l,schemaCode:u})=>r.str`should be ${o[l].okStr} ${u}`,"message"),params:a(({keyword:l,schemaCode:u})=>r._`{comparison: ${o[l].okStr}, limit: ${u}}`,"params")};t.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:s,code(l){let{gen:u,data:d,schemaCode:f,keyword:h,it:m}=l,{opts:g,self:A}=m;if(!g.validateFormats)return;let y=new e.KeywordCxt(m,A.RULES.all.format.definition,"format");y.$data?_():E();function _(){let S=u.scopeValue("formats",{ref:A.formats,code:g.code.formats}),T=u.const("fmt",r._`${S}[${y.schemaCode}]`);l.fail$data((0,r.or)(r._`typeof ${T} != "object"`,r._`${T} instanceof RegExp`,r._`typeof ${T}.compare != "function"`,v(T)))}a(_,"q");function E(){let S=y.schema,T=A.formats[S];if(!T||T===!0)return;if(typeof T!="object"||T instanceof RegExp||typeof T.compare!="function")throw Error(`"${h}": format "${S}" does not define "compare" function`);let w=u.scopeValue("formats",{key:S,ref:T,code:g.code.formats?r._`${g.code.formats}${(0,r.getProperty)(S)}`:void 0});l.fail$data(v(w))}a(E,"V");function v(S){return r._`${S}.compare(${d}, ${f}) ${o[h].fail} 0`}a(v,"B")},dependencies:["format"]};var c=a(l=>(l.addKeyword(t.formatLimitDefinition),l),"us");t.default=c}),VWc=jt((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=GWc(),n=$Wc(),o=Fs(),s=new o.Name("fullFormats"),c=new o.Name("fastFormats"),l=a((d,f={keywords:!0})=>{if(Array.isArray(f))return u(d,f,r.fullFormats,s),d;let[h,m]=f.mode==="fast"?[r.fastFormats,c]:[r.fullFormats,s],g=f.formats||r.formatNames;return u(d,g,h,m),f.keywords&&(0,n.default)(d),d},"Kz");l.get=(d,f="full")=>{let h=(f==="fast"?r.fastFormats:r.fullFormats)[d];if(!h)throw Error(`Unknown format "${d}"`);return h};function u(d,f,h,m){var g,A;(g=(A=d.opts.code).formats)!==null&&g!==void 0||(A.formats=o._`require("ajv-formats/dist/formats").${m}`);for(let y of f)d.addFormat(y,h[y])}a(u,"dP"),e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l}),WWc=50;a(nQr,"g9");a(Zoo,"K5");a(zWc,"Uk");a(qoe,"v4");iPt=["PreToolUse","PostToolUse","PostToolUseFailure","PostToolBatch","Notification","UserPromptSubmit","UserPromptExpansion","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged","MessageDisplay"],YWc=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],KWc="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",JWc=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,ZWc=/(.*?)<\/command-name>/;a(xqr,"h9");XWc={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(rso,"q5");a(ezc,"JN");a(GW,"G1");a(tzc,"zk");a(rzc,"Nk");a(nzc,"wk");iQr=class{static{a(this,"FG")}store=new Map;mtimes=new Map;summaries=new Map;lastMtime=0;keyToString(e){let r=[e.projectKey,e.sessionId];return e.subpath&&r.push(e.subpath),r.join("/")}async append(e,r){let n=this.keyToString(e),o=this.store.get(n)??[];o.push(...r),this.store.set(n,o);let s=Math.max(Date.now(),this.lastMtime+1);if(this.lastMtime=s,this.mtimes.set(n,s),e.subpath===void 0){let c=`${e.projectKey}/${e.sessionId}`,l=rso(this.summaries.get(c),e,r,{mtime:s});this.summaries.set(c,l)}}async load(e){let r=this.keyToString(e);return this.store.get(r)??null}async listSessions(e){let r=[],n=e+"/";for(let[o]of this.store)if(o.startsWith(n)){let s=o.slice(n.length);s.includes("/")||r.push({sessionId:s,mtime:this.mtimes.get(o)??0})}return r}async listSessionSummaries(e){let r=[],n=e+"/";for(let[o,s]of this.summaries)o.startsWith(n)&&r.push(s);return r}async delete(e){let r=this.keyToString(e);if(this.store.delete(r),this.mtimes.delete(r),e.subpath===void 0){this.summaries.delete(`${e.projectKey}/${e.sessionId}`);let n=`${e.projectKey}/${e.sessionId}/`;for(let o of this.store.keys())o.startsWith(n)&&(this.store.delete(o),this.mtimes.delete(o))}}async listSubkeys(e){let r=`${e.projectKey}/${e.sessionId}/`,n=[];for(let o of this.store.keys())o.startsWith(r)&&n.push(o.slice(r.length));return n}getEntries(e){return this.store.get(this.keyToString(e))??[]}get size(){let e=0;for(let r of this.store.keys()){let n=r.indexOf("/");n!==-1&&!r.slice(n+1).includes("/")&&e++}return e}clear(){this.store.clear(),this.mtimes.clear(),this.summaries.clear()}},e1=class extends Error{static{a(this,"W6")}};a(nso,"V5");a(bE,"R$");a(vUe,"U1");izc=typeof global=="object"&&global&&global.Object===Object&&global,iso=izc,ozc=typeof self=="object"&&self&&self.Object===Object&&self,szc=iso||ozc||Function("return this")(),dbe=szc,azc=dbe.Symbol,nz=azc,oso=Object.prototype,czc=oso.hasOwnProperty,lzc=oso.toString,f6e=nz?nz.toStringTag:void 0;a(uzc,"Ak");dzc=uzc,fzc=Object.prototype,pzc=fzc.toString;a(hzc,"Pk");mzc=hzc,gzc="[object Null]",Azc="[object Undefined]",bno=nz?nz.toStringTag:void 0;a(yzc,"_k");CUe=yzc;a(_zc,"kk");N9=_zc,Ezc="[object AsyncFunction]",vzc="[object Function]",Czc="[object GeneratorFunction]",bzc="[object Proxy]";a(Szc,"xk");wqr=Szc,Tzc=dbe["__core-js_shared__"],S7r=Tzc,Sno=(function(){var t=/[^.]+$/.exec(S7r&&S7r.keys&&S7r.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(Izc,"fk");xzc=Izc,wzc=Function.prototype,Rzc=wzc.toString;a(kzc,"uk");Pzc=kzc,Dzc=/[\\^$.*+?()[\]{}|]/g,Nzc=/^\[object .+?Constructor\]$/,Mzc=Function.prototype,Ozc=Object.prototype,Lzc=Mzc.toString,Bzc=Ozc.hasOwnProperty,Fzc=RegExp("^"+Lzc.call(Bzc).replace(Dzc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(Uzc,"rk");Qzc=Uzc;a(qzc,"ok");jzc=qzc;a(Hzc,"tk");Rqr=Hzc,Gzc=Rqr(Object,"create"),V6e=Gzc;a($zc,"sk");Vzc=$zc;a(Wzc,"ek");zzc=Wzc,Yzc="__lodash_hash_undefined__",Kzc=Object.prototype,Jzc=Kzc.hasOwnProperty;a(Zzc,"XS");Xzc=Zzc,eYc=Object.prototype,tYc=eYc.hasOwnProperty;a(rYc,"GS");nYc=rYc,iYc="__lodash_hash_undefined__";a(oYc,"HS");sYc=oYc;a(fbe,"a0");fbe.prototype.clear=Vzc;fbe.prototype.delete=zzc;fbe.prototype.get=Xzc;fbe.prototype.has=nYc;fbe.prototype.set=sYc;Tno=fbe;a(aYc,"KS");cYc=aYc;a(lYc,"qS");oPt=lYc;a(uYc,"VS");sPt=uYc,dYc=Array.prototype,fYc=dYc.splice;a(pYc,"NS");hYc=pYc;a(mYc,"wS");gYc=mYc;a(AYc,"OS");yYc=AYc;a(_Yc,"DS");EYc=_Yc;a(pbe,"s0");pbe.prototype.clear=cYc;pbe.prototype.delete=hYc;pbe.prototype.get=gYc;pbe.prototype.has=yYc;pbe.prototype.set=EYc;aPt=pbe,vYc=Rqr(dbe,"Map"),sso=vYc;a(CYc,"ZS");bYc=CYc;a(SYc,"MS");TYc=SYc;a(IYc,"LS");cPt=IYc;a(xYc,"jS");wYc=xYc;a(RYc,"AS");kYc=RYc;a(PYc,"IS");DYc=PYc;a(NYc,"RS");MYc=NYc;a(hbe,"e0");hbe.prototype.clear=bYc;hbe.prototype.delete=wYc;hbe.prototype.get=kYc;hbe.prototype.has=DYc;hbe.prototype.set=MYc;kqr=hbe,OYc="Expected a function";a(Pqr,"MG");Pqr.Cache=kqr;Wy=Pqr,mbe=Wy(()=>(process.env.CLAUDE_CONFIG_DIR??(0,cso.join)((0,aso.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),Afm=Wy(()=>bE(process.env.CLAUDE_CODE_SUPERVISED));a(vn,"y");a(gt,"Z");lso=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return lso=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))},"LG");a(W6e,"T4");oQr=a(t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return Error(JSON.stringify(t))}catch{}}return Error(t)},"l9"),Ni=class extends Error{static{a(this,"g")}},AC=class t extends Ni{static{a(this,"n$")}constructor(e,r,n,o,s){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("request-id"),this.error=r,this.type=s??null}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new jCe({message:n,cause:oQr(r)});let s=r,c=s?.error?.type;return e===400?new NRt(e,s,n,o,c):e===401?new MRt(e,s,n,o,c):e===403?new ORt(e,s,n,o,c):e===404?new LRt(e,s,n,o,c):e===409?new BRt(e,s,n,o,c):e===422?new FRt(e,s,n,o,c):e===429?new URt(e,s,n,o,c):e>=500?new QRt(e,s,n,o,c):new t(e,s,n,o,c)}},nx=class extends AC{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},jCe=class extends AC{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},DRt=class extends jCe{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},NRt=class extends AC{static{a(this,"p9")}},MRt=class extends AC{static{a(this,"d9")}},ORt=class extends AC{static{a(this,"i9")}},LRt=class extends AC{static{a(this,"n9")}},BRt=class extends AC{static{a(this,"r9")}},FRt=class extends AC{static{a(this,"o9")}},URt=class extends AC{static{a(this,"t9")}},QRt=class extends AC{static{a(this,"a9")}},LYc=/^[a-z][a-z0-9+.-]*:/i,BYc=a(t=>LYc.test(t),"bN"),sQr=a(t=>(sQr=Array.isArray,sQr(t)),"jG"),Ino=sQr;a(aQr,"w5");a(xno,"IG");a(FYc,"_N");UYc=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Ni(`${t} must be an integer`);if(e<0)throw new Ni(`${t} must be a positive integer`);return e},"kN"),uso=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),QYc=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),ZW="0.94.0",qYc=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(jYc,"SS");HYc=a(()=>{let t=jYc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ZW,"X-Stainless-OS":Rno(Deno.build.os),"X-Stainless-Arch":wno(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ZW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ZW,"X-Stainless-OS":Rno(globalThis.process.platform??"unknown"),"X-Stainless-Arch":wno(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=GYc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ZW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ZW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(GYc,"CS");wno=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),Rno=a(t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),"CN"),Dqr=a(()=>kno??(kno=HYc()),"s9");a($Yc,"yN");a(dso,"RG");a(fso,"D5");a(Nqr,"e9");a(VYc,"fN");WYc=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(zYc,"hN");YYc="urn:ietf:params:oauth:grant-type:jwt-bearer",KYc="refresh_token",pso="/v1/oauth/token",qRt="oauth-2025-04-20",JYc="oidc-federation-2026-04-01",ZYc=120,Mqr=30,XYc=5,Pno=1048576;a(hso,"Z5");a(mso,"M5");T7r=2e3,eKc=new Set(["error","error_description","error_uri"]);a($k,"Z6");a(gso,"L5");a(Aso,"j5");a(tKc,"fS");mu=class extends Ni{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(joe,"Y4");cQr=class{static{a(this,"EG")}constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-joe();return n>ZYc?r.token:n>Mqr?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||joe()-this.lastAdvisoryError{this.lastAdvisoryError=joe(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}},pu=a(t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0},"w$");a(rKc,"rN");a(Oqr,"Q8");a(Mno,"bG");jRt={off:0,error:200,warn:300,info:400,debug:500},Ono=a((t,e,r)=>{if(t){if(FYc(jRt,t))return t;AA(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(jRt))}`)}},"_G");a(N6e,"$Q");a(sRt,"A5");nKc={error:N6e,warn:N6e,info:N6e,debug:N6e},Lno=new WeakMap;a(AA,"m$");Uoe=a(t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="x-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t),"x4"),yso="1.0",iKc=/^[A-Za-z0-9_.-]+$/;a(_so,"tN");oKc=a(async t=>{var e,r;let n=await Lqr();if(n===null)return null;let o=t??await Eso();if(o===null)return null;_so(o);let s=await import("node:fs"),c=(await import("node:path")).join(n,"configs",`${o}.json`),l;try{l=await s.promises.readFile(c,"utf-8")}catch(f){if(f?.code!=="ENOENT")throw Error(`failed to read config file ${c}: ${f}`);l=null}if(l===null){let f=pu("ANTHROPIC_ORGANIZATION_ID"),h=pu("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=pu("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:pu("ANTHROPIC_WORKSPACE_ID"),base_url:pu("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:pu("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:pu("ANTHROPIC_SCOPE")}}}:null}let u;try{u=JSON.parse(l)}catch(f){throw Error(`failed to parse config file ${c}: ${f}`)}if(!u.authentication)throw Error(`config file ${c} is missing "authentication"`);let d=u.authentication.type;if(d!=="oidc_federation"&&d!=="user_oauth")throw Error(`authentication.type "${d}" is not a known authentication type`);if(u.organization_id??(u.organization_id=pu("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=pu("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=pu("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=pu("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=pu("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=pu("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=pu("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),sKc=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await Lqr();if(!r)return null;let n=e??await Eso();return n?(_so(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),Lqr=a(async()=>{if(!aKc())return null;let t=await import("node:path"),e=pu("ANTHROPIC_CONFIG_DIR");if(e)return e;if(Dqr()["X-Stainless-OS"]==="Windows"){let o=pu("APPDATA");if(o)return t.join(o,"Anthropic");let s=pu("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=pu("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=pu("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),aKc=a(()=>{let t=Dqr()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),Eso=a(async()=>{let t=await Lqr();if(!t)return null;let e=pu("ANTHROPIC_PROFILE");if(e)return e;let r=await import("node:fs"),n=(await import("node:path")).join(t,"active_config");try{return(await r.promises.readFile(n,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw Error(`failed to read ${n}: ${o}`);return"default"}},"eN");a(Bno,"SG");a(cKc,"$w");a(lKc,"Qw");a(uKc,"Jw");a(vso,"vG");a(dKc,"Xw");a(fKc,"mS");a(pKc,"lS");a(hKc,"cS");Woe=class{static{a(this,"B1")}constructor(){ex.set(this,void 0),tx.set(this,void 0),vn(this,ex,new Uint8Array,"f"),vn(this,tx,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Oqr(e):e;vn(this,ex,rKc([gt(this,ex,"f"),r]),"f");let n=[],o;for(;(o=mKc(gt(this,ex,"f"),gt(this,tx,"f")))!=null;){if(o.carriage&>(this,tx,"f")==null){vn(this,tx,o.index,"f");continue}if(gt(this,tx,"f")!=null&&(o.index!==gt(this,tx,"f")+1||o.carriage)){n.push(Mno(gt(this,ex,"f").subarray(0,gt(this,tx,"f")-1))),vn(this,ex,gt(this,ex,"f").subarray(gt(this,tx,"f")),"f"),vn(this,tx,null,"f");continue}let s=gt(this,tx,"f")!==null?o.preceding-1:o.preceding,c=Mno(gt(this,ex,"f").subarray(0,s));n.push(c),vn(this,ex,gt(this,ex,"f").subarray(o.index),"f"),vn(this,tx,null,"f")}return n}flush(){return gt(this,ex,"f").length?this.decode(` -`):[]}};ex=new WeakMap,tx=new WeakMap;Woe.NEWLINE_CHARS=new Set([` -`,"\r"]);Woe.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(mKc,"pS");a(gKc,"Yw");zoe=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,p6e.set(this,void 0),this.controller=r,vn(this,p6e,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?AA(n):console;async function*c(){if(o)throw new Ni("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of AKc(e,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop"||u.event==="message"||u.event==="user.message"||u.event==="user.interrupt"||u.event==="user.tool_confirmation"||u.event==="user.custom_tool_result"||u.event==="agent.message"||u.event==="agent.thinking"||u.event==="agent.tool_use"||u.event==="agent.tool_result"||u.event==="agent.mcp_tool_use"||u.event==="agent.mcp_tool_result"||u.event==="agent.custom_tool_use"||u.event==="agent.thread_context_compacted"||u.event==="session.status_running"||u.event==="session.status_idle"||u.event==="session.status_rescheduled"||u.event==="session.status_terminated"||u.event==="session.error"||u.event==="session.deleted"||u.event==="span.model_request_start"||u.event==="span.model_request_end")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error"){let d=uso(u.data)??u.data,f=d?.error?.type;throw new AC(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(W6e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*s(){let l=new Woe,u=Nqr(e);for await(let d of u)for(let f of l.decode(d))yield f;for(let d of l.flush())yield d}a(s,"X");async function*c(){if(o)throw new Ni("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of s())l||u&&(yield JSON.parse(u));l=!0}catch(u){if(W6e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(p6e=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=a(s=>({next:a(()=>{if(s.length===0){let c=n.next();e.push(c),r.push(c)}return s.shift()},"next")}),"Y");return[new t(()=>o(e),this.controller,gt(this,p6e,"f")),new t(()=>o(r),this.controller,gt(this,p6e,"f"))]}toReadableStream(){let e=this,r;return dso({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:s}=await r.next();if(s)return n.close();let c=Oqr(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(AKc,"dS");a(yKc,"iS");lQr=class{static{a(this,"Ww")}constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=_Kc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(_Kc,"nS");a(Cso,"P5");a(bso,"CG");HRt=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=Cso){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,M6e.set(this,void 0),vn(this,M6e,e,"f")}_thenUnwrap(e){return new t(gt(this,M6e,"f"),this.responsePromise,async(r,n)=>bso(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(gt(this,M6e,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};M6e=new WeakMap;GRt=class{static{a(this,"TG")}constructor(e,r,n,o){aRt.set(this,void 0),vn(this,aRt,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new Ni("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await gt(this,aRt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(aRt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},uQr=class extends HRt{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await Cso(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},Yoe=class extends GRt{static{a(this,"W4")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...aQr(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...aQr(this.options.query),after_id:e}}:null}},TE=class extends GRt{static{a(this,"D$")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...aQr(this.options.query),page:e}}:null}},Sso=a(()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},"yG");a(BCe,"J0");a(IRt,"XQ");Tso=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),Bqr=a(async(t,e,r=!0)=>({...t,body:await vKc(t.body,e,r)}),"J8"),Fno=new WeakMap;a(EKc,"oS");vKc=a(async(t,e,r=!0)=>{if(!await EKc(e))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([o,s])=>dQr(n,o,s,r))),n},"tS"),CKc=a(t=>t instanceof Blob&&"name"in t,"aS"),dQr=a(async(t,e,r,n)=>{if(r!==void 0){if(r==null)throw TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response){let o={},s=r.headers.get("Content-Type");s&&(o={type:s}),t.append(e,BCe([await r.blob()],IRt(r,n),o))}else if(Tso(r))t.append(e,BCe([await new Response(fso(r)).blob()],IRt(r,n)));else if(CKc(r))t.append(e,BCe([r],IRt(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>dQr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>dQr(t,`${e}[${o}]`,s,n)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},"xG"),Iso=a(t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function","Uw"),bKc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&Iso(t),"sS"),SKc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(TKc,"_5");a(fQr,"gG");a(IKc,"$v");Ld=class{static{a(this,"t")}constructor(e){this._client=e}},xso=Symbol.for("brand.privateNullableHeaders");a(xKc,"Jv");_r=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of xKc(n)){let l=s.toLowerCase();o.has(l)||(e.delete(s),o.add(l)),c===null?(e.delete(s),r.add(l)):(e.append(s,c),r.delete(l))}}return{[xso]:!0,values:e,nulls:r}},"R");a(wso,"qw");Uno=Object.freeze(Object.create(null)),wKc=a((t=wso)=>function(e,...r){if(e.length===1)return e[0];let n=!1,o=[],s=e.reduce((d,f,h)=>{/[?#]/.test(f)&&(n=!0);let m=r[h],g=(n?encodeURIComponent:t)(""+m);return h!==r.length&&(m==null||typeof m=="object"&&m.toString===Object.getPrototypeOf(Object.getPrototypeOf(m.hasOwnProperty??Uno)??Uno)?.toString)&&(g=m+"",o.push({start:d.length+f.length,length:g.length,error:`Value of type ${Object.prototype.toString.call(m).slice(8,-1)} is not a valid path parameter`})),d+f+(h===r.length?"":g)},""),c=s.split(/[?#]/,1)[0],l=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,u;for(;(u=l.exec(c))!==null;)o.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(o.sort((d,f)=>d.start-f.start),o.length>0){let d=0,f=o.reduce((h,m)=>{let g=" ".repeat(m.start-d),A="^".repeat(m.length);return d=m.start+m.length,h+g+A},"");throw new Ni(`Path parameters result in path with invalid segments: + deps: ${f}}`,"params")};var o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(u){let[d,f]=s(u);c(u,d),l(u,f)}};function s({schema:u}){let d={},f={};for(let h in u){if(h==="__proto__")continue;let m=Array.isArray(u[h])?d:f;m[h]=u[h]}return[d,f]}a(s,"at");function c(u,d=u.schema){let{gen:f,data:h,it:m}=u;if(Object.keys(d).length===0)return;let g=f.let("missing");for(let A in d){let y=d[A];if(y.length===0)continue;let _=(0,n.propertyInData)(f,h,A,m.opts.ownProperties);u.setParams({property:A,depsCount:y.length,deps:y.join(", ")}),m.allErrors?f.if(_,()=>{for(let E of y)(0,n.checkReportMissingProp)(u,E)}):(f.if(e._`${_} && (${(0,n.checkMissingProp)(u,y,g)})`),(0,n.reportMissingProp)(u,g),f.else())}}a(c,"vR"),t.validatePropertyDeps=c;function l(u,d=u.schema){let{gen:f,data:h,keyword:m,it:g}=u,A=f.name("valid");for(let y in d)(0,r.alwaysValidSchema)(g,d[y])||(f.if((0,n.propertyInData)(f,h,y,g.opts.ownProperties),()=>{let _=u.subschema({keyword:m,schemaProp:y},A);u.mergeValidEvaluated(_,A)},()=>f.var(A,!0)),u.ok(A))}a(l,"CR"),t.validateSchemaDeps=l,t.default=o}),RWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n={message:"property name must be valid",params:a(({params:s})=>e._`{propertyName: ${s.propertyName}}`,"params")},o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:n,code(s){let{gen:c,schema:l,data:u,it:d}=s;if((0,r.alwaysValidSchema)(d,l))return;let f=c.name("valid");c.forIn("key",u,h=>{s.setParams({propertyName:h}),s.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},f),c.if((0,e.not)(f),()=>{s.error(!0),!d.allErrors&&c.break()})}),s.ok(f)}};t.default=o}),Woo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=vM(),r=Fs(),n=lz(),o=Sc(),s={message:"must NOT have additional properties",params:a(({params:l})=>r._`{additionalProperty: ${l.additionalProperty}}`,"params")},c={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:s,code(l){let{gen:u,schema:d,parentSchema:f,data:h,errsCount:m,it:g}=l;if(!m)throw Error("ajv implementation error");let{allErrors:A,opts:y}=g;if(g.props=!0,y.removeAdditional!=="all"&&(0,o.alwaysValidSchema)(g,d))return;let _=(0,e.allSchemaProperties)(f.properties),E=(0,e.allSchemaProperties)(f.patternProperties);v(),l.ok(r._`${m} === ${n.default.errors}`);function v(){u.forIn("key",h,x=>{!_.length&&!E.length?w(x):u.if(S(x),()=>w(x))})}a(v,"B");function S(x){let k;if(_.length>8){let D=(0,o.schemaRefOrVal)(g,f.properties,"properties");k=(0,e.isOwnProperty)(u,D,x)}else _.length?k=(0,r.or)(..._.map(D=>r._`${x} === ${D}`)):k=r.nil;return E.length&&(k=(0,r.or)(k,...E.map(D=>r._`${(0,e.usePattern)(l,D)}.test(${x})`))),(0,r.not)(k)}a(S,"z");function T(x){u.code(r._`delete ${h}[${x}]`)}a(T,"N");function w(x){if(y.removeAdditional==="all"||y.removeAdditional&&d===!1){T(x);return}if(d===!1){l.setParams({additionalProperty:x}),l.error(),!A&&u.break();return}if(typeof d=="object"&&!(0,o.alwaysValidSchema)(g,d)){let k=u.name("valid");y.removeAdditional==="failing"?(R(x,k,!1),u.if((0,r.not)(k),()=>{l.reset(),T(x)})):(R(x,k),!A&&u.if((0,r.not)(k),()=>u.break()))}}a(w,"w");function R(x,k,D){let N={keyword:"additionalProperties",dataProp:x,dataPropType:o.Type.Str};D===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(N,k)}a(R,"O")}};t.default=c}),kWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=tPt(),r=vM(),n=Sc(),o=Woo(),s={keyword:"properties",type:"object",schemaType:"object",code(c){let{gen:l,schema:u,parentSchema:d,data:f,it:h}=c;h.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&o.default.code(new e.KeywordCxt(h,o.default,"additionalProperties"));let m=(0,r.allSchemaProperties)(u);for(let E of m)h.definedProperties.add(E);h.opts.unevaluated&&m.length&&h.props!==!0&&(h.props=n.mergeEvaluated.props(l,(0,n.toHash)(m),h.props));let g=m.filter(E=>!(0,n.alwaysValidSchema)(h,u[E]));if(g.length===0)return;let A=l.name("valid");for(let E of g)y(E)?_(E):(l.if((0,r.propertyInData)(l,f,E,h.opts.ownProperties)),_(E),!h.allErrors&&l.else().var(A,!0),l.endIf()),c.it.definedProperties.add(E),c.ok(A);function y(E){return h.opts.useDefaults&&!h.compositeRule&&u[E].default!==void 0}a(y,"q");function _(E){c.subschema({keyword:"properties",schemaProp:E,dataProp:E},A)}a(_,"V")}};t.default=s}),PWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=vM(),r=Fs(),n=Sc(),o=Sc(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(c){let{gen:l,schema:u,data:d,parentSchema:f,it:h}=c,{opts:m}=h,g=(0,e.allSchemaProperties)(u),A=g.filter(w=>(0,n.alwaysValidSchema)(h,u[w]));if(g.length===0||A.length===g.length&&(!h.opts.unevaluated||h.props===!0))return;let y=m.strictSchema&&!m.allowMatchingProperties&&f.properties,_=l.name("valid");h.props!==!0&&!(h.props instanceof r.Name)&&(h.props=(0,o.evaluatedPropsToName)(l,h.props));let{props:E}=h;v();function v(){for(let w of g)y&&S(w),h.allErrors?T(w):(l.var(_,!0),T(w),l.if(_))}a(v,"z");function S(w){for(let R in y)new RegExp(w).test(R)&&(0,n.checkStrictMode)(h,`property ${R} matches pattern ${w} (use allowMatchingProperties)`)}a(S,"N");function T(w){l.forIn("key",d,R=>{l.if(r._`${(0,e.usePattern)(c,w)}.test(${R})`,()=>{let x=A.includes(w);x||c.subschema({keyword:"patternProperties",schemaProp:w,dataProp:R,dataPropType:o.Type.Str},_),h.opts.unevaluated&&E!==!0?l.assign(r._`${E}[${R}]`,!0):!x&&!h.allErrors&&l.if((0,r.not)(_),()=>l.break())})})}a(T,"w")}};t.default=s}),DWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Sc(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){let{gen:o,schema:s,it:c}=n;if((0,e.alwaysValidSchema)(c,s)){n.fail();return}let l=o.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),n.failResult(l,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};t.default=r}),NWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=vM(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),MWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n={message:"must match exactly one schema in oneOf",params:a(({params:s})=>e._`{passingSchemas: ${s.passing}}`,"params")},o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:n,code(s){let{gen:c,schema:l,parentSchema:u,it:d}=s;if(!Array.isArray(l))throw Error("ajv implementation error");if(d.opts.discriminator&&u.discriminator)return;let f=l,h=c.let("valid",!1),m=c.let("passing",null),g=c.name("_valid");s.setParams({passing:m}),c.block(A),s.result(h,()=>s.reset(),()=>s.error(!0));function A(){f.forEach((y,_)=>{let E;(0,r.alwaysValidSchema)(d,y)?c.var(g,!0):E=s.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},g),_>0&&c.if(e._`${g} && ${h}`).assign(h,!1).assign(m,e._`[${m}, ${_}]`).else(),c.if(g,()=>{c.assign(h,!0),c.assign(m,_),E&&s.mergeEvaluated(E,e.Name)})})}a(A,"q")}};t.default=o}),OWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Sc(),r={keyword:"allOf",schemaType:"array",code(n){let{gen:o,schema:s,it:c}=n;if(!Array.isArray(s))throw Error("ajv implementation error");let l=o.name("valid");s.forEach((u,d)=>{if((0,e.alwaysValidSchema)(c,u))return;let f=n.subschema({keyword:"allOf",schemaProp:d},l);n.ok(l),n.mergeEvaluated(f)})}};t.default=r}),LWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=Sc(),n={message:a(({params:c})=>e.str`must match "${c.ifClause}" schema`,"message"),params:a(({params:c})=>e._`{failingKeyword: ${c.ifClause}}`,"params")},o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:n,code(c){let{gen:l,parentSchema:u,it:d}=c;u.then===void 0&&u.else===void 0&&(0,r.checkStrictMode)(d,'"if" without "then" and "else" is ignored');let f=s(d,"then"),h=s(d,"else");if(!f&&!h)return;let m=l.let("valid",!0),g=l.name("_valid");if(A(),c.reset(),f&&h){let _=l.let("ifClause");c.setParams({ifClause:_}),l.if(g,y("then",_),y("else",_))}else f?l.if(g,y("then")):l.if((0,e.not)(g),y("else"));c.pass(m,()=>c.error(!0));function A(){let _=c.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);c.mergeEvaluated(_)}a(A,"H");function y(_,E){return()=>{let v=c.subschema({keyword:_},g);l.assign(m,g),c.mergeValidEvaluated(v,m),E?l.assign(E,e._`${_}`):c.setParams({ifClause:_})}}a(y,"q")}};function s(c,l){let u=c.schema[l];return u!==void 0&&!(0,r.alwaysValidSchema)(c,u)}a(s,"WP"),t.default=o}),BWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Sc(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:o,it:s}){o.if===void 0&&(0,e.checkStrictMode)(s,`"${n}" without "if" is ignored`)}};t.default=r}),FWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=$oo(),r=TWc(),n=Voo(),o=IWc(),s=xWc(),c=wWc(),l=RWc(),u=Woo(),d=kWc(),f=PWc(),h=DWc(),m=NWc(),g=MWc(),A=OWc(),y=LWc(),_=BWc();function E(v=!1){let S=[h.default,m.default,g.default,A.default,y.default,_.default,l.default,u.default,c.default,d.default,f.default];return v?S.push(r.default,o.default):S.push(e.default,n.default),S.push(s.default),S}a(E,"ra"),t.default=E}),UWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r={message:a(({schemaCode:o})=>e.str`must match format "${o}"`,"message"),params:a(({schemaCode:o})=>e._`{format: ${o}}`,"params")},n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:r,code(o,s){let{gen:c,data:l,$data:u,schema:d,schemaCode:f,it:h}=o,{opts:m,errSchemaPath:g,schemaEnv:A,self:y}=h;if(!m.validateFormats)return;u?_():E();function _(){let v=c.scopeValue("formats",{ref:y.formats,code:m.code.formats}),S=c.const("fDef",e._`${v}[${f}]`),T=c.let("fType"),w=c.let("format");c.if(e._`typeof ${S} == "object" && !(${S} instanceof RegExp)`,()=>c.assign(T,e._`${S}.type || "string"`).assign(w,e._`${S}.validate`),()=>c.assign(T,e._`"string"`).assign(w,S)),o.fail$data((0,e.or)(R(),x()));function R(){return m.strictSchema===!1?e.nil:e._`${f} && !${w}`}a(R,"j");function x(){let k=A.$async?e._`(${S}.async ? await ${w}(${l}) : ${w}(${l}))`:e._`${w}(${l})`,D=e._`(typeof ${w} == "function" ? ${k} : ${w}.test(${l}))`;return e._`${w} && ${w} !== true && ${T} === ${s} && !${D}`}a(x,"A")}a(_,"z");function E(){let v=y.formats[d];if(!v){R();return}if(v===!0)return;let[S,T,w]=x(v);S===s&&o.pass(k());function R(){if(m.strictSchema===!1){y.logger.warn(D());return}throw Error(D());function D(){return`unknown format "${d}" ignored in schema at path "${g}"`}}a(R,"j");function x(D){let N=D instanceof RegExp?(0,e.regexpCode)(D):m.code.formats?e._`${m.code.formats}${(0,e.getProperty)(d)}`:void 0,O=c.scopeValue("formats",{key:d,ref:D,code:N});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,e._`${O}.validate`]:["string",D,O]}a(x,"A");function k(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!A.$async)throw Error("async format in sync schema");return e._`await ${w}(${l})`}return typeof T=="function"?e._`${w}(${l})`:e._`${w}.test(${l})`}a(k,"S")}a(E,"N")}};t.default=n}),QWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=UWc(),r=[e.default];t.default=r}),qWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),jWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=fWc(),r=SWc(),n=FWc(),o=QWc(),s=qWc(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),HWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0;var e;(function(r){r.Tag="tag",r.Mapping="mapping"})(e||(t.DiscrError=e={}))}),GWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fs(),r=HWc(),n=Iqr(),o=rPt(),s=Sc(),c={message:a(({params:{discrError:u,tagName:d}})=>u===r.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,"message"),params:a(({params:{discrError:u,tag:d,tagName:f}})=>e._`{error: ${u}, tag: ${f}, tagValue: ${d}}`,"params")},l={keyword:"discriminator",type:"object",schemaType:"object",error:c,code(u){let{gen:d,data:f,schema:h,parentSchema:m,it:g}=u,{oneOf:A}=m;if(!g.opts.discriminator)throw Error("discriminator: requires discriminator option");let y=h.propertyName;if(typeof y!="string")throw Error("discriminator: requires propertyName");if(h.mapping)throw Error("discriminator: mapping is not supported");if(!A)throw Error("discriminator: requires oneOf keyword");let _=d.let("valid",!1),E=d.const("tag",e._`${f}${(0,e.getProperty)(y)}`);d.if(e._`typeof ${E} == "string"`,()=>v(),()=>u.error(!1,{discrError:r.DiscrError.Tag,tag:E,tagName:y})),u.ok(_);function v(){let w=T();d.if(!1);for(let R in w)d.elseIf(e._`${E} === ${R}`),d.assign(_,S(w[R]));d.else(),u.error(!1,{discrError:r.DiscrError.Mapping,tag:E,tagName:y}),d.endIf()}a(v,"V");function S(w){let R=d.name("valid"),x=u.subschema({keyword:"oneOf",schemaProp:w},R);return u.mergeEvaluated(x,e.Name),R}a(S,"B");function T(){var w;let R={},x=D(m),k=!0;for(let B=0;B{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),zoo=jt((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;var r=lWc(),n=jWc(),o=GWc(),s=$Wc(),c=["/properties"],l="http://json-schema.org/draft-07/schema";class u extends r.default{static{a(this,"pJ")}_addVocabularies(){super._addVocabularies(),n.default.forEach(A=>this.addVocabulary(A)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let A=this.opts.$data?this.$dataMetaSchema(s,c):s;this.addMetaSchema(A,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var d=tPt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=Fs();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return f._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return f.str},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return f.stringify},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return f.nil},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return f.Name},"get")}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:a(function(){return f.CodeGen},"get")});var h=Tqr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=rPt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),VWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(O,B){return{validate:O,compare:B}}a(e,"b4"),t.fullFormats={date:e(s,c),time:e(u(!0),d),"date-time":e(m(!0),g),"iso-time":e(u(),f),"iso-date-time":e(m(),A),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:E,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:N,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:S,int32:{type:"number",validate:R},int64:{type:"number",validate:x},float:{type:"number",validate:k},double:{type:"number",validate:k},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,c),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,A),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(O){return O%4===0&&(O%100!==0||O%400===0)}a(r,"Is");var n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(O){let B=n.exec(O);if(!B)return!1;let q=+B[1],M=+B[2],L=+B[3];return M>=1&&M<=12&&L>=1&&L<=(M===2&&r(q)?29:o[M])}a(s,"xP");function c(O,B){if(O&&B)return O>B?1:O23||W>59||O&&!j)return!1;if(M<=23&&L<=59&&U<60)return!0;let V=L-W*Q,z=M-Y*Q-(V<0?1:0);return(z===23||z===-1)&&(V===59||V===-1)&&U<61}}a(u,"Jz");function d(O,B){if(!(O&&B))return;let q=new Date("2020-01-01T"+O).valueOf(),M=new Date("2020-01-01T"+B).valueOf();if(q&&M)return q-M}a(d,"Wz");function f(O,B){if(!(O&&B))return;let q=l.exec(O),M=l.exec(B);if(q&&M)return O=q[1]+q[2]+q[3],B=M[1]+M[2]+M[3],O>B?1:O=T}a(R,"Cs");function x(O){return Number.isInteger(O)}a(x,"Ts");function k(){return!0}a(k,"TP");var D=/[^\\]\\Z/;function N(O){if(D.test(O))return!1;try{return new RegExp(O),!0}catch{return!1}}a(N,"ys")}),WWc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=zoo(),r=Fs(),n=r.operators,o={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},s={message:a(({keyword:l,schemaCode:u})=>r.str`should be ${o[l].okStr} ${u}`,"message"),params:a(({keyword:l,schemaCode:u})=>r._`{comparison: ${o[l].okStr}, limit: ${u}}`,"params")};t.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:s,code(l){let{gen:u,data:d,schemaCode:f,keyword:h,it:m}=l,{opts:g,self:A}=m;if(!g.validateFormats)return;let y=new e.KeywordCxt(m,A.RULES.all.format.definition,"format");y.$data?_():E();function _(){let S=u.scopeValue("formats",{ref:A.formats,code:g.code.formats}),T=u.const("fmt",r._`${S}[${y.schemaCode}]`);l.fail$data((0,r.or)(r._`typeof ${T} != "object"`,r._`${T} instanceof RegExp`,r._`typeof ${T}.compare != "function"`,v(T)))}a(_,"q");function E(){let S=y.schema,T=A.formats[S];if(!T||T===!0)return;if(typeof T!="object"||T instanceof RegExp||typeof T.compare!="function")throw Error(`"${h}": format "${S}" does not define "compare" function`);let w=u.scopeValue("formats",{key:S,ref:T,code:g.code.formats?r._`${g.code.formats}${(0,r.getProperty)(S)}`:void 0});l.fail$data(v(w))}a(E,"V");function v(S){return r._`${S}.compare(${d}, ${f}) ${o[h].fail} 0`}a(v,"B")},dependencies:["format"]};var c=a(l=>(l.addKeyword(t.formatLimitDefinition),l),"us");t.default=c}),zWc=jt((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=VWc(),n=WWc(),o=Fs(),s=new o.Name("fullFormats"),c=new o.Name("fastFormats"),l=a((d,f={keywords:!0})=>{if(Array.isArray(f))return u(d,f,r.fullFormats,s),d;let[h,m]=f.mode==="fast"?[r.fastFormats,c]:[r.fullFormats,s],g=f.formats||r.formatNames;return u(d,g,h,m),f.keywords&&(0,n.default)(d),d},"Kz");l.get=(d,f="full")=>{let h=(f==="fast"?r.fastFormats:r.fullFormats)[d];if(!h)throw Error(`Unknown format "${d}"`);return h};function u(d,f,h,m){var g,A;(g=(A=d.opts.code).formats)!==null&&g!==void 0||(A.formats=o._`require("ajv-formats/dist/formats").${m}`);for(let y of f)d.addFormat(y,h[y])}a(u,"dP"),e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l}),YWc=50;a(iQr,"g9");a(eso,"K5");a(KWc,"Uk");a(joe,"v4");oPt=["PreToolUse","PostToolUse","PostToolUseFailure","PostToolBatch","Notification","UserPromptSubmit","UserPromptExpansion","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged","MessageDisplay"],JWc=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],ZWc="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",XWc=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,ezc=/(.*?)<\/command-name>/;a(wqr,"h9");tzc={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(iso,"q5");a(rzc,"JN");a($W,"G1");a(nzc,"zk");a(izc,"Nk");a(ozc,"wk");oQr=class{static{a(this,"FG")}store=new Map;mtimes=new Map;summaries=new Map;lastMtime=0;keyToString(e){let r=[e.projectKey,e.sessionId];return e.subpath&&r.push(e.subpath),r.join("/")}async append(e,r){let n=this.keyToString(e),o=this.store.get(n)??[];o.push(...r),this.store.set(n,o);let s=Math.max(Date.now(),this.lastMtime+1);if(this.lastMtime=s,this.mtimes.set(n,s),e.subpath===void 0){let c=`${e.projectKey}/${e.sessionId}`,l=iso(this.summaries.get(c),e,r,{mtime:s});this.summaries.set(c,l)}}async load(e){let r=this.keyToString(e);return this.store.get(r)??null}async listSessions(e){let r=[],n=e+"/";for(let[o]of this.store)if(o.startsWith(n)){let s=o.slice(n.length);s.includes("/")||r.push({sessionId:s,mtime:this.mtimes.get(o)??0})}return r}async listSessionSummaries(e){let r=[],n=e+"/";for(let[o,s]of this.summaries)o.startsWith(n)&&r.push(s);return r}async delete(e){let r=this.keyToString(e);if(this.store.delete(r),this.mtimes.delete(r),e.subpath===void 0){this.summaries.delete(`${e.projectKey}/${e.sessionId}`);let n=`${e.projectKey}/${e.sessionId}/`;for(let o of this.store.keys())o.startsWith(n)&&(this.store.delete(o),this.mtimes.delete(o))}}async listSubkeys(e){let r=`${e.projectKey}/${e.sessionId}/`,n=[];for(let o of this.store.keys())o.startsWith(r)&&n.push(o.slice(r.length));return n}getEntries(e){return this.store.get(this.keyToString(e))??[]}get size(){let e=0;for(let r of this.store.keys()){let n=r.indexOf("/");n!==-1&&!r.slice(n+1).includes("/")&&e++}return e}clear(){this.store.clear(),this.mtimes.clear(),this.summaries.clear()}},e1=class extends Error{static{a(this,"W6")}};a(oso,"V5");a(bE,"R$");a(vUe,"U1");szc=typeof global=="object"&&global&&global.Object===Object&&global,sso=szc,azc=typeof self=="object"&&self&&self.Object===Object&&self,czc=sso||azc||Function("return this")(),dbe=czc,lzc=dbe.Symbol,iz=lzc,aso=Object.prototype,uzc=aso.hasOwnProperty,dzc=aso.toString,f6e=iz?iz.toStringTag:void 0;a(fzc,"Ak");pzc=fzc,hzc=Object.prototype,mzc=hzc.toString;a(gzc,"Pk");Azc=gzc,yzc="[object Null]",_zc="[object Undefined]",Tno=iz?iz.toStringTag:void 0;a(Ezc,"_k");CUe=Ezc;a(vzc,"kk");N9=vzc,Czc="[object AsyncFunction]",bzc="[object Function]",Szc="[object GeneratorFunction]",Tzc="[object Proxy]";a(Izc,"xk");Rqr=Izc,xzc=dbe["__core-js_shared__"],T7r=xzc,Ino=(function(){var t=/[^.]+$/.exec(T7r&&T7r.keys&&T7r.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(wzc,"fk");Rzc=wzc,kzc=Function.prototype,Pzc=kzc.toString;a(Dzc,"uk");Nzc=Dzc,Mzc=/[\\^$.*+?()[\]{}|]/g,Ozc=/^\[object .+?Constructor\]$/,Lzc=Function.prototype,Bzc=Object.prototype,Fzc=Lzc.toString,Uzc=Bzc.hasOwnProperty,Qzc=RegExp("^"+Fzc.call(Uzc).replace(Mzc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(qzc,"rk");jzc=qzc;a(Hzc,"ok");Gzc=Hzc;a($zc,"tk");kqr=$zc,Vzc=kqr(Object,"create"),V6e=Vzc;a(Wzc,"sk");zzc=Wzc;a(Yzc,"ek");Kzc=Yzc,Jzc="__lodash_hash_undefined__",Zzc=Object.prototype,Xzc=Zzc.hasOwnProperty;a(eYc,"XS");tYc=eYc,rYc=Object.prototype,nYc=rYc.hasOwnProperty;a(iYc,"GS");oYc=iYc,sYc="__lodash_hash_undefined__";a(aYc,"HS");cYc=aYc;a(fbe,"a0");fbe.prototype.clear=zzc;fbe.prototype.delete=Kzc;fbe.prototype.get=tYc;fbe.prototype.has=oYc;fbe.prototype.set=cYc;xno=fbe;a(lYc,"KS");uYc=lYc;a(dYc,"qS");sPt=dYc;a(fYc,"VS");aPt=fYc,pYc=Array.prototype,hYc=pYc.splice;a(mYc,"NS");gYc=mYc;a(AYc,"wS");yYc=AYc;a(_Yc,"OS");EYc=_Yc;a(vYc,"DS");CYc=vYc;a(pbe,"s0");pbe.prototype.clear=uYc;pbe.prototype.delete=gYc;pbe.prototype.get=yYc;pbe.prototype.has=EYc;pbe.prototype.set=CYc;cPt=pbe,bYc=kqr(dbe,"Map"),cso=bYc;a(SYc,"ZS");TYc=SYc;a(IYc,"MS");xYc=IYc;a(wYc,"LS");lPt=wYc;a(RYc,"jS");kYc=RYc;a(PYc,"AS");DYc=PYc;a(NYc,"IS");MYc=NYc;a(OYc,"RS");LYc=OYc;a(hbe,"e0");hbe.prototype.clear=TYc;hbe.prototype.delete=kYc;hbe.prototype.get=DYc;hbe.prototype.has=MYc;hbe.prototype.set=LYc;Pqr=hbe,BYc="Expected a function";a(Dqr,"MG");Dqr.Cache=Pqr;Wy=Dqr,mbe=Wy(()=>(process.env.CLAUDE_CONFIG_DIR??(0,uso.join)((0,lso.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),vfm=Wy(()=>bE(process.env.CLAUDE_CODE_SUPERVISED));a(vn,"y");a(gt,"Z");dso=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return dso=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))},"LG");a(W6e,"T4");sQr=a(t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return Error(JSON.stringify(t))}catch{}}return Error(t)},"l9"),Ni=class extends Error{static{a(this,"g")}},AC=class t extends Ni{static{a(this,"n$")}constructor(e,r,n,o,s){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("request-id"),this.error=r,this.type=s??null}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new jCe({message:n,cause:sQr(r)});let s=r,c=s?.error?.type;return e===400?new MRt(e,s,n,o,c):e===401?new ORt(e,s,n,o,c):e===403?new LRt(e,s,n,o,c):e===404?new BRt(e,s,n,o,c):e===409?new FRt(e,s,n,o,c):e===422?new URt(e,s,n,o,c):e===429?new QRt(e,s,n,o,c):e>=500?new qRt(e,s,n,o,c):new t(e,s,n,o,c)}},nx=class extends AC{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},jCe=class extends AC{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},NRt=class extends jCe{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},MRt=class extends AC{static{a(this,"p9")}},ORt=class extends AC{static{a(this,"d9")}},LRt=class extends AC{static{a(this,"i9")}},BRt=class extends AC{static{a(this,"n9")}},FRt=class extends AC{static{a(this,"r9")}},URt=class extends AC{static{a(this,"o9")}},QRt=class extends AC{static{a(this,"t9")}},qRt=class extends AC{static{a(this,"a9")}},FYc=/^[a-z][a-z0-9+.-]*:/i,UYc=a(t=>FYc.test(t),"bN"),aQr=a(t=>(aQr=Array.isArray,aQr(t)),"jG"),wno=aQr;a(cQr,"w5");a(Rno,"IG");a(QYc,"_N");qYc=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Ni(`${t} must be an integer`);if(e<0)throw new Ni(`${t} must be a positive integer`);return e},"kN"),fso=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),jYc=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),XW="0.94.0",HYc=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(GYc,"SS");$Yc=a(()=>{let t=GYc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":XW,"X-Stainless-OS":Pno(Deno.build.os),"X-Stainless-Arch":kno(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":XW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":XW,"X-Stainless-OS":Pno(globalThis.process.platform??"unknown"),"X-Stainless-Arch":kno(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=VYc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":XW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":XW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(VYc,"CS");kno=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),Pno=a(t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),"CN"),Nqr=a(()=>Dno??(Dno=$Yc()),"s9");a(WYc,"yN");a(pso,"RG");a(hso,"D5");a(Mqr,"e9");a(zYc,"fN");YYc=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(KYc,"hN");JYc="urn:ietf:params:oauth:grant-type:jwt-bearer",ZYc="refresh_token",mso="/v1/oauth/token",jRt="oauth-2025-04-20",XYc="oidc-federation-2026-04-01",eKc=120,Oqr=30,tKc=5,Nno=1048576;a(gso,"Z5");a(Aso,"M5");I7r=2e3,rKc=new Set(["error","error_description","error_uri"]);a($k,"Z6");a(yso,"L5");a(_so,"j5");a(nKc,"fS");mu=class extends Ni{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(Hoe,"Y4");lQr=class{static{a(this,"EG")}constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-Hoe();return n>eKc?r.token:n>Oqr?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||Hoe()-this.lastAdvisoryError{this.lastAdvisoryError=Hoe(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}},pu=a(t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0},"w$");a(iKc,"rN");a(Lqr,"Q8");a(Lno,"bG");HRt={off:0,error:200,warn:300,info:400,debug:500},Bno=a((t,e,r)=>{if(t){if(QYc(HRt,t))return t;AA(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(HRt))}`)}},"_G");a(N6e,"$Q");a(aRt,"A5");oKc={error:N6e,warn:N6e,info:N6e,debug:N6e},Fno=new WeakMap;a(AA,"m$");Qoe=a(t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="x-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t),"x4"),Eso="1.0",sKc=/^[A-Za-z0-9_.-]+$/;a(vso,"tN");aKc=a(async t=>{var e,r;let n=await Bqr();if(n===null)return null;let o=t??await Cso();if(o===null)return null;vso(o);let s=await import("node:fs"),c=(await import("node:path")).join(n,"configs",`${o}.json`),l;try{l=await s.promises.readFile(c,"utf-8")}catch(f){if(f?.code!=="ENOENT")throw Error(`failed to read config file ${c}: ${f}`);l=null}if(l===null){let f=pu("ANTHROPIC_ORGANIZATION_ID"),h=pu("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=pu("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:pu("ANTHROPIC_WORKSPACE_ID"),base_url:pu("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:pu("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:pu("ANTHROPIC_SCOPE")}}}:null}let u;try{u=JSON.parse(l)}catch(f){throw Error(`failed to parse config file ${c}: ${f}`)}if(!u.authentication)throw Error(`config file ${c} is missing "authentication"`);let d=u.authentication.type;if(d!=="oidc_federation"&&d!=="user_oauth")throw Error(`authentication.type "${d}" is not a known authentication type`);if(u.organization_id??(u.organization_id=pu("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=pu("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=pu("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=pu("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=pu("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=pu("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=pu("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),cKc=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await Bqr();if(!r)return null;let n=e??await Cso();return n?(vso(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),Bqr=a(async()=>{if(!lKc())return null;let t=await import("node:path"),e=pu("ANTHROPIC_CONFIG_DIR");if(e)return e;if(Nqr()["X-Stainless-OS"]==="Windows"){let o=pu("APPDATA");if(o)return t.join(o,"Anthropic");let s=pu("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=pu("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=pu("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),lKc=a(()=>{let t=Nqr()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),Cso=a(async()=>{let t=await Bqr();if(!t)return null;let e=pu("ANTHROPIC_PROFILE");if(e)return e;let r=await import("node:fs"),n=(await import("node:path")).join(t,"active_config");try{return(await r.promises.readFile(n,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw Error(`failed to read ${n}: ${o}`);return"default"}},"eN");a(Uno,"SG");a(uKc,"$w");a(dKc,"Qw");a(fKc,"Jw");a(bso,"vG");a(pKc,"Xw");a(hKc,"mS");a(mKc,"lS");a(gKc,"cS");zoe=class{static{a(this,"B1")}constructor(){ex.set(this,void 0),tx.set(this,void 0),vn(this,ex,new Uint8Array,"f"),vn(this,tx,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Lqr(e):e;vn(this,ex,iKc([gt(this,ex,"f"),r]),"f");let n=[],o;for(;(o=AKc(gt(this,ex,"f"),gt(this,tx,"f")))!=null;){if(o.carriage&>(this,tx,"f")==null){vn(this,tx,o.index,"f");continue}if(gt(this,tx,"f")!=null&&(o.index!==gt(this,tx,"f")+1||o.carriage)){n.push(Lno(gt(this,ex,"f").subarray(0,gt(this,tx,"f")-1))),vn(this,ex,gt(this,ex,"f").subarray(gt(this,tx,"f")),"f"),vn(this,tx,null,"f");continue}let s=gt(this,tx,"f")!==null?o.preceding-1:o.preceding,c=Lno(gt(this,ex,"f").subarray(0,s));n.push(c),vn(this,ex,gt(this,ex,"f").subarray(o.index),"f"),vn(this,tx,null,"f")}return n}flush(){return gt(this,ex,"f").length?this.decode(` +`):[]}};ex=new WeakMap,tx=new WeakMap;zoe.NEWLINE_CHARS=new Set([` +`,"\r"]);zoe.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(AKc,"pS");a(yKc,"Yw");Yoe=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,p6e.set(this,void 0),this.controller=r,vn(this,p6e,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?AA(n):console;async function*c(){if(o)throw new Ni("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of _Kc(e,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop"||u.event==="message"||u.event==="user.message"||u.event==="user.interrupt"||u.event==="user.tool_confirmation"||u.event==="user.custom_tool_result"||u.event==="agent.message"||u.event==="agent.thinking"||u.event==="agent.tool_use"||u.event==="agent.tool_result"||u.event==="agent.mcp_tool_use"||u.event==="agent.mcp_tool_result"||u.event==="agent.custom_tool_use"||u.event==="agent.thread_context_compacted"||u.event==="session.status_running"||u.event==="session.status_idle"||u.event==="session.status_rescheduled"||u.event==="session.status_terminated"||u.event==="session.error"||u.event==="session.deleted"||u.event==="span.model_request_start"||u.event==="span.model_request_end")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error"){let d=fso(u.data)??u.data,f=d?.error?.type;throw new AC(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(W6e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*s(){let l=new zoe,u=Mqr(e);for await(let d of u)for(let f of l.decode(d))yield f;for(let d of l.flush())yield d}a(s,"X");async function*c(){if(o)throw new Ni("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of s())l||u&&(yield JSON.parse(u));l=!0}catch(u){if(W6e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(p6e=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=a(s=>({next:a(()=>{if(s.length===0){let c=n.next();e.push(c),r.push(c)}return s.shift()},"next")}),"Y");return[new t(()=>o(e),this.controller,gt(this,p6e,"f")),new t(()=>o(r),this.controller,gt(this,p6e,"f"))]}toReadableStream(){let e=this,r;return pso({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:s}=await r.next();if(s)return n.close();let c=Lqr(JSON.stringify(o)+` +`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(_Kc,"dS");a(EKc,"iS");uQr=class{static{a(this,"Ww")}constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=vKc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(vKc,"nS");a(Sso,"P5");a(Tso,"CG");GRt=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=Sso){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,M6e.set(this,void 0),vn(this,M6e,e,"f")}_thenUnwrap(e){return new t(gt(this,M6e,"f"),this.responsePromise,async(r,n)=>Tso(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(gt(this,M6e,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};M6e=new WeakMap;$Rt=class{static{a(this,"TG")}constructor(e,r,n,o){cRt.set(this,void 0),vn(this,cRt,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new Ni("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await gt(this,cRt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(cRt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},dQr=class extends GRt{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await Sso(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},Koe=class extends $Rt{static{a(this,"W4")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...cQr(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...cQr(this.options.query),after_id:e}}:null}},TE=class extends $Rt{static{a(this,"D$")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...cQr(this.options.query),page:e}}:null}},Iso=a(()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},"yG");a(BCe,"J0");a(xRt,"XQ");xso=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),Fqr=a(async(t,e,r=!0)=>({...t,body:await bKc(t.body,e,r)}),"J8"),Qno=new WeakMap;a(CKc,"oS");bKc=a(async(t,e,r=!0)=>{if(!await CKc(e))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([o,s])=>fQr(n,o,s,r))),n},"tS"),SKc=a(t=>t instanceof Blob&&"name"in t,"aS"),fQr=a(async(t,e,r,n)=>{if(r!==void 0){if(r==null)throw TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response){let o={},s=r.headers.get("Content-Type");s&&(o={type:s}),t.append(e,BCe([await r.blob()],xRt(r,n),o))}else if(xso(r))t.append(e,BCe([await new Response(hso(r)).blob()],xRt(r,n)));else if(SKc(r))t.append(e,BCe([r],xRt(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>fQr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>fQr(t,`${e}[${o}]`,s,n)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},"xG"),wso=a(t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function","Uw"),TKc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&wso(t),"sS"),IKc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(xKc,"_5");a(pQr,"gG");a(wKc,"$v");Bd=class{static{a(this,"t")}constructor(e){this._client=e}},Rso=Symbol.for("brand.privateNullableHeaders");a(RKc,"Jv");_r=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of RKc(n)){let l=s.toLowerCase();o.has(l)||(e.delete(s),o.add(l)),c===null?(e.delete(s),r.add(l)):(e.append(s,c),r.delete(l))}}return{[Rso]:!0,values:e,nulls:r}},"R");a(kso,"qw");qno=Object.freeze(Object.create(null)),kKc=a((t=kso)=>function(e,...r){if(e.length===1)return e[0];let n=!1,o=[],s=e.reduce((d,f,h)=>{/[?#]/.test(f)&&(n=!0);let m=r[h],g=(n?encodeURIComponent:t)(""+m);return h!==r.length&&(m==null||typeof m=="object"&&m.toString===Object.getPrototypeOf(Object.getPrototypeOf(m.hasOwnProperty??qno)??qno)?.toString)&&(g=m+"",o.push({start:d.length+f.length,length:g.length,error:`Value of type ${Object.prototype.toString.call(m).slice(8,-1)} is not a valid path parameter`})),d+f+(h===r.length?"":g)},""),c=s.split(/[?#]/,1)[0],l=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,u;for(;(u=l.exec(c))!==null;)o.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(o.sort((d,f)=>d.start-f.start),o.length>0){let d=0,f=o.reduce((h,m)=>{let g=" ".repeat(m.start-d),A="^".repeat(m.length);return d=m.start+m.length,h+g+A},"");throw new Ni(`Path parameters result in path with invalid segments: ${o.map(h=>h.error).join(` `)} ${s} -${f}`)}return s},"Xv"),Yn=wKc(wso),$Rt=class extends Ld{static{a(this,"YQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/environments/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/environments/${e}?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/environments?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/environments/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/environments/${e}/archive?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},j6e=Symbol("anthropic.sdk.stainlessHelper");a(xRt,"k5");a(Rso,"hG");a(kso,"S5");a(RKc,"Vw");VRt=class extends Ld{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",Yoe,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/files/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/files/${e}/content?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/files/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...o}=e;return this._client.post("/v1/files?beta=true",Bqr({body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},RKc(o.file),r?.headers])},this._client))}},WRt=class extends Ld{static{a(this,"UQ")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/models/${e}?beta=true`,{...n,headers:_r([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models?beta=true",Yoe,{query:o,...r,headers:_r([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},zRt=class extends Ld{static{a(this,"HQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/user_profiles?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/user_profiles/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}},YRt=class extends Ld{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/agents/${e}/versions?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},z6e=class extends Ld{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new YRt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(Yn`/v1/agents/${e}?beta=true`,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/agents/${e}?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/agents?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/agents/${e}/archive?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};z6e.Versions=YRt;KRt=class extends Ld{static{a(this,"qQ")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(Yn`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(Yn`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:o,view:s,betas:c,...l}=r;return this._client.post(Yn`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:_r([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/memory_stores/${e}/memories?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:o,expected_content_sha256:s,betas:c}=r;return this._client.delete(Yn`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:_r([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},JRt=class extends Ld{static{a(this,"VQ")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(Yn`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/memory_stores/${e}/memory_versions?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:o,betas:s}=r;return this._client.post(Yn`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},HCe=class extends Ld{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new KRt(this._client),this.memoryVersions=new JRt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/memory_stores/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/memory_stores/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};HCe.Memories=KRt;HCe.MemoryVersions=JRt;ZRt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new Woe;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Ni("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Ni("Attempted to iterate over a response with no body");return new t(Nqr(e.body),r)}},XRt=class extends Ld{static{a(this,"BQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/messages/batches/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",Yoe,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/messages/batches/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let o=await this.retrieve(e);if(!o.results_url)throw new Ni(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);let{betas:s}=r??{};return this._client.get(o.results_url,{...n,headers:_r([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>ZRt.fromResponse(l.response,l.controller))}},Pso={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};a(Dso,"Bw");a(Qno,"uG");a(Nso,"mG");a(kKc,"Nv");PKc=a(t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),PCe(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),PCe(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),PCe(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),PCe(t);break;case"delimiter":return t=t.slice(0,t.length-1),PCe(t)}return t},"W8"),DKc=a(t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},"Ov"),NKc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),Mso=a(t=>JSON.parse(NKc(DKc(PCe(PKc(t))))),"C5"),Hno="__json_buf";a(Gno,"Ow");pQr=class t{static{a(this,"ZQ")}constructor(e,r){Qk.add(this),this.messages=[],this.receivedMessages=[],$W.set(this,void 0),SCe.set(this,null),this.controller=new AbortController,h6e.set(this,void 0),cRt.set(this,()=>{}),m6e.set(this,()=>{}),g6e.set(this,void 0),lRt.set(this,()=>{}),A6e.set(this,()=>{}),S9.set(this,{}),y6e.set(this,!1),uRt.set(this,!1),dRt.set(this,!1),Ooe.set(this,!1),fRt.set(this,void 0),pRt.set(this,void 0),_6e.set(this,void 0),hRt.set(this,n=>{if(vn(this,uRt,!0,"f"),W6e(n)&&(n=new nx),n instanceof nx)return vn(this,dRt,!0,"f"),this._emit("abort",n);if(n instanceof Ni)return this._emit("error",n);if(n instanceof Error){let o=new Ni(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ni(String(n)))}),vn(this,h6e,new Promise((n,o)=>{vn(this,cRt,n,"f"),vn(this,m6e,o,"f")}),"f"),vn(this,g6e,new Promise((n,o)=>{vn(this,lRt,n,"f"),vn(this,A6e,o,"f")}),"f"),gt(this,h6e,"f").catch(()=>{}),gt(this,g6e,"f").catch(()=>{}),vn(this,SCe,e,"f"),vn(this,_6e,r?.logger??console,"f")}get response(){return gt(this,fRt,"f")}get request_id(){return gt(this,pRt,"f")}async withResponse(){vn(this,Ooe,!0,"f");let e=await gt(this,h6e,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return vn(s,SCe,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},gt(this,hRt,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{gt(this,Qk,"m",x7r).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)gt(this,Qk,"m",w7r).call(this,u);if(l.controller.signal?.aborted)throw new nx;gt(this,Qk,"m",R7r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(vn(this,fRt,e,"f"),vn(this,pRt,e?.headers.get("request-id"),"f"),gt(this,cRt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,y6e,"f")}get errored(){return gt(this,uRt,"f")}get aborted(){return gt(this,dRt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,S9,"f")[e]||(gt(this,S9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,S9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(gt(this,S9,"f")[e]||(gt(this,S9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{vn(this,Ooe,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){vn(this,Ooe,!0,"f"),await gt(this,g6e,"f")}get currentMessage(){return gt(this,$W,"f")}async finalMessage(){return await this.done(),gt(this,Qk,"m",I7r).call(this)}async finalText(){return await this.done(),gt(this,Qk,"m",qno).call(this)}_emit(e,...r){if(gt(this,y6e,"f"))return;e==="end"&&(vn(this,y6e,!0,"f"),gt(this,lRt,"f").call(this));let n=gt(this,S9,"f")[e];if(n&&(gt(this,S9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Ooe,"f")&&!n?.length&&Promise.reject(o),gt(this,m6e,"f").call(this,o),gt(this,A6e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Ooe,"f")&&!n?.length&&Promise.reject(o),gt(this,m6e,"f").call(this,o),gt(this,A6e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,Qk,"m",I7r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{gt(this,Qk,"m",x7r).call(this),this._connected(null);let s=zoe.fromReadableStream(e,this.controller);for await(let c of s)gt(this,Qk,"m",w7r).call(this,c);if(s.controller.signal?.aborted)throw new nx;gt(this,Qk,"m",R7r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[($W=new WeakMap,SCe=new WeakMap,h6e=new WeakMap,cRt=new WeakMap,m6e=new WeakMap,g6e=new WeakMap,lRt=new WeakMap,A6e=new WeakMap,S9=new WeakMap,y6e=new WeakMap,uRt=new WeakMap,dRt=new WeakMap,Ooe=new WeakMap,fRt=new WeakMap,pRt=new WeakMap,_6e=new WeakMap,hRt=new WeakMap,Qk=new WeakSet,I7r=a(function(){if(this.receivedMessages.length===0)throw new Ni("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),qno=a(function(){if(this.receivedMessages.length===0)throw new Ni("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(e.length===0)throw new Ni("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),x7r=a(function(){this.ended||vn(this,$W,void 0,"f")},"cG"),w7r=a(function(e){if(this.ended)return;let r=gt(this,Qk,"m",jno).call(this,e);switch(this._emit("streamEvent",e,r),e.type){case"content_block_delta":{let n=r.content.at(-1);switch(e.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",e.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",e.delta.citation,n.citations??[]);break}case"input_json_delta":{Gno(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",e.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}case"compaction_delta":{n.type==="compaction"&&n.content&&this._emit("compaction",n.content);break}default:e.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(Qno(r,gt(this,SCe,"f"),{logger:gt(this,_6e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{vn(this,$W,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),R7r=a(function(){if(this.ended)throw new Ni("stream has ended, this shouldn't happen");let e=gt(this,$W,"f");if(!e)throw new Ni("request ended without sending any chunks");return vn(this,$W,void 0,"f"),Qno(e,gt(this,SCe,"f"),{logger:gt(this,_6e,"f")})},"dG"),jno=a(function(e){let r=gt(this,$W,"f");if(e.type==="message_start"){if(r)throw new Ni(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ni(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":return r;case"message_delta":return r.container=e.delta.container,r.stop_reason=e.delta.stop_reason,r.stop_sequence=e.delta.stop_sequence,r.usage.output_tokens=e.usage.output_tokens,r.context_management=e.context_management,e.usage.input_tokens!=null&&(r.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(r.usage.server_tool_use=e.usage.server_tool_use),e.usage.iterations!=null&&(r.usage.iterations=e.usage.iterations),r;case"content_block_start":return r.content.push(e.content_block),r;case"content_block_delta":{let n=r.content.at(e.index);switch(e.delta.type){case"text_delta":{n?.type==="text"&&(r.content[e.index]={...n,text:(n.text||"")+e.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break}case"input_json_delta":{if(n&&Gno(n)){let o=n[Hno]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,Hno,{value:o,enumerable:!1,writable:!0}),o)try{s.input=Mso(o)}catch(c){let l=new Ni(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);gt(this,hRt,"f").call(this,l)}r.content[e.index]=s}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,signature:e.delta.signature});break}case"compaction_delta":{n?.type==="compaction"&&(r.content[e.index]={...n,content:(n.content||"")+e.delta.content});break}default:e.delta}return r}case"content_block_stop":return r}},"Nw"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new zoe(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},ekt=class extends Error{static{a(this,"U8")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}},MKc=1e5,OKc=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: +${f}`)}return s},"Xv"),Yn=kKc(kso),VRt=class extends Bd{static{a(this,"YQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/environments/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/environments/${e}?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/environments?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/environments/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/environments/${e}/archive?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},j6e=Symbol("anthropic.sdk.stainlessHelper");a(wRt,"k5");a(Pso,"hG");a(Dso,"S5");a(PKc,"Vw");WRt=class extends Bd{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",Koe,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/files/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/files/${e}/content?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/files/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...o}=e;return this._client.post("/v1/files?beta=true",Fqr({body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},PKc(o.file),r?.headers])},this._client))}},zRt=class extends Bd{static{a(this,"UQ")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/models/${e}?beta=true`,{...n,headers:_r([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models?beta=true",Koe,{query:o,...r,headers:_r([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},YRt=class extends Bd{static{a(this,"HQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/user_profiles?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/user_profiles/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}},KRt=class extends Bd{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/agents/${e}/versions?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},z6e=class extends Bd{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new KRt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(Yn`/v1/agents/${e}?beta=true`,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/agents/${e}?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/agents?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/agents/${e}/archive?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};z6e.Versions=KRt;JRt=class extends Bd{static{a(this,"qQ")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(Yn`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(Yn`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:o,view:s,betas:c,...l}=r;return this._client.post(Yn`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:_r([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/memory_stores/${e}/memories?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:o,expected_content_sha256:s,betas:c}=r;return this._client.delete(Yn`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:_r([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},ZRt=class extends Bd{static{a(this,"VQ")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(Yn`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/memory_stores/${e}/memory_versions?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:o,betas:s}=r;return this._client.post(Yn`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},HCe=class extends Bd{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new JRt(this._client),this.memoryVersions=new ZRt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/memory_stores/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/memory_stores/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};HCe.Memories=JRt;HCe.MemoryVersions=ZRt;XRt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new zoe;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Ni("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Ni("Attempted to iterate over a response with no body");return new t(Mqr(e.body),r)}},ekt=class extends Bd{static{a(this,"BQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/messages/batches/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",Koe,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/messages/batches/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let o=await this.retrieve(e);if(!o.results_url)throw new Ni(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);let{betas:s}=r??{};return this._client.get(o.results_url,{...n,headers:_r([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>XRt.fromResponse(l.response,l.controller))}},Nso={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};a(Mso,"Bw");a(jno,"uG");a(Oso,"mG");a(DKc,"Nv");NKc=a(t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),PCe(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),PCe(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),PCe(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),PCe(t);break;case"delimiter":return t=t.slice(0,t.length-1),PCe(t)}return t},"W8"),MKc=a(t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},"Ov"),OKc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),Lso=a(t=>JSON.parse(OKc(MKc(PCe(NKc(t))))),"C5"),$no="__json_buf";a(Vno,"Ow");hQr=class t{static{a(this,"ZQ")}constructor(e,r){Qk.add(this),this.messages=[],this.receivedMessages=[],VW.set(this,void 0),SCe.set(this,null),this.controller=new AbortController,h6e.set(this,void 0),lRt.set(this,()=>{}),m6e.set(this,()=>{}),g6e.set(this,void 0),uRt.set(this,()=>{}),A6e.set(this,()=>{}),S9.set(this,{}),y6e.set(this,!1),dRt.set(this,!1),fRt.set(this,!1),Loe.set(this,!1),pRt.set(this,void 0),hRt.set(this,void 0),_6e.set(this,void 0),mRt.set(this,n=>{if(vn(this,dRt,!0,"f"),W6e(n)&&(n=new nx),n instanceof nx)return vn(this,fRt,!0,"f"),this._emit("abort",n);if(n instanceof Ni)return this._emit("error",n);if(n instanceof Error){let o=new Ni(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ni(String(n)))}),vn(this,h6e,new Promise((n,o)=>{vn(this,lRt,n,"f"),vn(this,m6e,o,"f")}),"f"),vn(this,g6e,new Promise((n,o)=>{vn(this,uRt,n,"f"),vn(this,A6e,o,"f")}),"f"),gt(this,h6e,"f").catch(()=>{}),gt(this,g6e,"f").catch(()=>{}),vn(this,SCe,e,"f"),vn(this,_6e,r?.logger??console,"f")}get response(){return gt(this,pRt,"f")}get request_id(){return gt(this,hRt,"f")}async withResponse(){vn(this,Loe,!0,"f");let e=await gt(this,h6e,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return vn(s,SCe,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},gt(this,mRt,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{gt(this,Qk,"m",w7r).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)gt(this,Qk,"m",R7r).call(this,u);if(l.controller.signal?.aborted)throw new nx;gt(this,Qk,"m",k7r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(vn(this,pRt,e,"f"),vn(this,hRt,e?.headers.get("request-id"),"f"),gt(this,lRt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,y6e,"f")}get errored(){return gt(this,dRt,"f")}get aborted(){return gt(this,fRt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,S9,"f")[e]||(gt(this,S9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,S9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(gt(this,S9,"f")[e]||(gt(this,S9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{vn(this,Loe,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){vn(this,Loe,!0,"f"),await gt(this,g6e,"f")}get currentMessage(){return gt(this,VW,"f")}async finalMessage(){return await this.done(),gt(this,Qk,"m",x7r).call(this)}async finalText(){return await this.done(),gt(this,Qk,"m",Hno).call(this)}_emit(e,...r){if(gt(this,y6e,"f"))return;e==="end"&&(vn(this,y6e,!0,"f"),gt(this,uRt,"f").call(this));let n=gt(this,S9,"f")[e];if(n&&(gt(this,S9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Loe,"f")&&!n?.length&&Promise.reject(o),gt(this,m6e,"f").call(this,o),gt(this,A6e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Loe,"f")&&!n?.length&&Promise.reject(o),gt(this,m6e,"f").call(this,o),gt(this,A6e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,Qk,"m",x7r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{gt(this,Qk,"m",w7r).call(this),this._connected(null);let s=Yoe.fromReadableStream(e,this.controller);for await(let c of s)gt(this,Qk,"m",R7r).call(this,c);if(s.controller.signal?.aborted)throw new nx;gt(this,Qk,"m",k7r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(VW=new WeakMap,SCe=new WeakMap,h6e=new WeakMap,lRt=new WeakMap,m6e=new WeakMap,g6e=new WeakMap,uRt=new WeakMap,A6e=new WeakMap,S9=new WeakMap,y6e=new WeakMap,dRt=new WeakMap,fRt=new WeakMap,Loe=new WeakMap,pRt=new WeakMap,hRt=new WeakMap,_6e=new WeakMap,mRt=new WeakMap,Qk=new WeakSet,x7r=a(function(){if(this.receivedMessages.length===0)throw new Ni("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),Hno=a(function(){if(this.receivedMessages.length===0)throw new Ni("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(e.length===0)throw new Ni("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),w7r=a(function(){this.ended||vn(this,VW,void 0,"f")},"cG"),R7r=a(function(e){if(this.ended)return;let r=gt(this,Qk,"m",Gno).call(this,e);switch(this._emit("streamEvent",e,r),e.type){case"content_block_delta":{let n=r.content.at(-1);switch(e.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",e.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",e.delta.citation,n.citations??[]);break}case"input_json_delta":{Vno(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",e.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}case"compaction_delta":{n.type==="compaction"&&n.content&&this._emit("compaction",n.content);break}default:e.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(jno(r,gt(this,SCe,"f"),{logger:gt(this,_6e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{vn(this,VW,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),k7r=a(function(){if(this.ended)throw new Ni("stream has ended, this shouldn't happen");let e=gt(this,VW,"f");if(!e)throw new Ni("request ended without sending any chunks");return vn(this,VW,void 0,"f"),jno(e,gt(this,SCe,"f"),{logger:gt(this,_6e,"f")})},"dG"),Gno=a(function(e){let r=gt(this,VW,"f");if(e.type==="message_start"){if(r)throw new Ni(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ni(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":return r;case"message_delta":return r.container=e.delta.container,r.stop_reason=e.delta.stop_reason,r.stop_sequence=e.delta.stop_sequence,r.usage.output_tokens=e.usage.output_tokens,r.context_management=e.context_management,e.usage.input_tokens!=null&&(r.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(r.usage.server_tool_use=e.usage.server_tool_use),e.usage.iterations!=null&&(r.usage.iterations=e.usage.iterations),r;case"content_block_start":return r.content.push(e.content_block),r;case"content_block_delta":{let n=r.content.at(e.index);switch(e.delta.type){case"text_delta":{n?.type==="text"&&(r.content[e.index]={...n,text:(n.text||"")+e.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break}case"input_json_delta":{if(n&&Vno(n)){let o=n[$no]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,$no,{value:o,enumerable:!1,writable:!0}),o)try{s.input=Lso(o)}catch(c){let l=new Ni(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);gt(this,mRt,"f").call(this,l)}r.content[e.index]=s}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,signature:e.delta.signature});break}case"compaction_delta":{n?.type==="compaction"&&(r.content[e.index]={...n,content:(n.content||"")+e.delta.content});break}default:e.delta}return r}case"content_block_stop":return r}},"Nw"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new Yoe(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},tkt=class extends Error{static{a(this,"U8")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}},LKc=1e5,BKc=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: 1. Task Overview The user's core request and success criteria Any clarifications or constraints they specified @@ -1587,24 +1587,24 @@ User preferences or style requirements Domain-specific details that aren't obvious Any promises made to the user Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. -Wrap your summary in tags.`;a(Vno,"Lw");tkt=class{static{a(this,"jQ")}constructor(e,r,n){E6e.add(this),this.client=e,TCe.set(this,!1),Loe.set(this,!1),Yg.set(this,void 0),XS.set(this,void 0),XI.set(this,void 0),R9.set(this,void 0),VW.set(this,void 0),v6e.set(this,0),vn(this,Yg,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...Rso(r.tools,r.messages)].join(", ");vn(this,XS,{...n,headers:_r([{"x-stainless-helper":o},n?.headers])},"f"),vn(this,VW,Vno(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(TCe=new WeakMap,Loe=new WeakMap,Yg=new WeakMap,XS=new WeakMap,XI=new WeakMap,R9=new WeakMap,VW=new WeakMap,v6e=new WeakMap,E6e=new WeakSet,$no=a(async function(){let e=gt(this,Yg,"f").params.compactionControl;if(!e||!e.enabled)return!1;let r=0;if(gt(this,XI,"f")!==void 0)try{let u=await gt(this,XI,"f");r=u.usage.input_tokens+(u.usage.cache_creation_input_tokens??0)+(u.usage.cache_read_input_tokens??0)+u.usage.output_tokens}catch{return!1}let n=e.contextTokenThreshold??MKc;if(rf.type!=="tool_use");d.length===0?c.pop():u.content=d}}let l=await this.client.beta.messages.create({model:o,messages:[...c,{role:"user",content:[{type:"text",text:s}]}],max_tokens:gt(this,Yg,"f").params.max_tokens},{signal:gt(this,XS,"f").signal,headers:_r([gt(this,XS,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new Ni("Expected text response for compaction");return gt(this,Yg,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(gt(this,TCe,"f"))throw new Ni("Cannot iterate over a consumed stream");vn(this,TCe,!0,"f"),vn(this,Loe,!0,"f"),vn(this,R9,void 0,"f");try{for(;;){let r;try{if(gt(this,Yg,"f").params.max_iterations&>(this,v6e,"f")>=gt(this,Yg,"f").params.max_iterations)break;vn(this,Loe,!1,"f"),vn(this,R9,void 0,"f"),vn(this,v6e,(e=gt(this,v6e,"f"),e++,e),"f"),vn(this,XI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=gt(this,Yg,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},gt(this,XS,"f")),vn(this,XI,r.finalMessage(),"f"),gt(this,XI,"f").catch(()=>{}),yield r):(vn(this,XI,this.client.beta.messages.create({...s,stream:!1},gt(this,XS,"f")),"f"),yield gt(this,XI,"f")),!await gt(this,E6e,"m",$no).call(this)){if(!gt(this,Loe,"f")){let{role:l,content:u}=await gt(this,XI,"f");gt(this,Yg,"f").params.messages.push({role:l,content:u})}let c=await gt(this,E6e,"m",hQr).call(this,gt(this,Yg,"f").params.messages.at(-1));if(c)gt(this,Yg,"f").params.messages.push(c);else if(!gt(this,Loe,"f"))break}}finally{r&&r.abort()}}if(!gt(this,XI,"f"))throw new Ni("ToolRunner concluded without a message from the server");gt(this,VW,"f").resolve(await gt(this,XI,"f"))}catch(r){throw vn(this,TCe,!1,"f"),gt(this,VW,"f").promise.catch(()=>{}),gt(this,VW,"f").reject(r),vn(this,VW,Vno(),"f"),r}}setMessagesParams(e){typeof e=="function"?gt(this,Yg,"f").params=e(gt(this,Yg,"f").params):gt(this,Yg,"f").params=e,vn(this,Loe,!0,"f"),vn(this,R9,void 0,"f")}setRequestOptions(e){typeof e=="function"?vn(this,XS,e(gt(this,XS,"f")),"f"):vn(this,XS,{...gt(this,XS,"f"),...e},"f")}async generateToolResponse(e=gt(this,XS,"f").signal){let r=await gt(this,XI,"f")??this.params.messages.at(-1);return r?gt(this,E6e,"m",hQr).call(this,r,e):null}done(){return gt(this,VW,"f").promise}async runUntilDone(){if(!gt(this,TCe,"f"))for await(let e of this);return this.done()}get params(){return gt(this,Yg,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};hQr=a(async function(t,e=gt(this,XS,"f").signal){return gt(this,R9,"f")!==void 0?gt(this,R9,"f"):(vn(this,R9,LKc(gt(this,Yg,"f").params,t,{...gt(this,XS,"f"),signal:e}),"f"),gt(this,R9,"f"))},"iG");a(LKc,"Fv");Wno={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},BKc=["claude-mythos-preview","claude-opus-4-6"],Koe=class extends Ld{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new XRt(this._client)}create(e,r){let n=zno(e),{betas:o,...s}=n;s.model in Wno&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${Wno[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),BKc.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=this._client._options.timeout;if(!s.stream&&c==null){let u=Pso[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=kso(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:_r([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:_r([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>Nso(n,e,{logger:this._client.logger??console}))}stream(e,r){return pQr.createMessage(this,e,r)}countTokens(e,r){let n=zno(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:_r([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new tkt(this._client,e,r)}};a(zno,"Aw");Koe.Batches=XRt;Koe.BetaToolRunner=tkt;Koe.ToolError=ekt;rkt=class extends Ld{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/sessions/${e}/events?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}},nkt=class extends Ld{static{a(this,"IQ")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(Yn`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.post(Yn`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/sessions/${e}/resources?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{session_id:o,betas:s}=r;return this._client.delete(Yn`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},GCe=class extends Ld{static{a(this,"G0")}constructor(){super(...arguments),this.events=new rkt(this._client),this.resources=new nkt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/sessions/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/sessions/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/sessions/${e}/archive?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};GCe.Events=rkt;GCe.Resources=nkt;ikt=class extends Ld{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(Yn`/v1/skills/${e}/versions?beta=true`,Bqr({body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(Yn`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/skills/${e}/versions?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,r,n){let{skill_id:o,betas:s}=r;return this._client.delete(Yn`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}},Y6e=class extends Ld{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new ikt(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",Bqr({body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/skills/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/skills?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/skills/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};Y6e.Versions=ikt;okt=class extends Ld{static{a(this,"PQ")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{vault_id:o,betas:s}=r;return this._client.get(Yn`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{vault_id:o,betas:s,...c}=r;return this._client.post(Yn`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/vaults/${e}/credentials?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{vault_id:o,betas:s}=r;return this._client.delete(Yn`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(Yn`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},K6e=class extends Ld{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new okt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/vaults/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/vaults/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/vaults/${e}/archive?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};K6e.Credentials=okt;t1=class extends Ld{static{a(this,"G6")}constructor(){super(...arguments),this.models=new WRt(this._client),this.messages=new Koe(this._client),this.agents=new z6e(this._client),this.environments=new $Rt(this._client),this.sessions=new GCe(this._client),this.vaults=new K6e(this._client),this.memoryStores=new HCe(this._client),this.files=new VRt(this._client),this.skills=new Y6e(this._client),this.userProfiles=new zRt(this._client)}};t1.Models=WRt;t1.Messages=Koe;t1.Agents=z6e;t1.Environments=$Rt;t1.Sessions=GCe;t1.Vaults=K6e;t1.MemoryStores=HCe;t1.Files=VRt;t1.Skills=Y6e;t1.UserProfiles=zRt;skt=class extends Ld{static{a(this,"V8")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...r,headers:_r([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}};a(Oso,"Iw");a(Yno,"nG");a(Lso,"rG");a(FKc,"bv");Zno="__json_buf";a(Xno,"bw");mQr=class t{static{a(this,"CQ")}constructor(e,r){qk.add(this),this.messages=[],this.receivedMessages=[],WW.set(this,void 0),ICe.set(this,null),this.controller=new AbortController,C6e.set(this,void 0),mRt.set(this,()=>{}),b6e.set(this,()=>{}),S6e.set(this,void 0),gRt.set(this,()=>{}),T6e.set(this,()=>{}),T9.set(this,{}),I6e.set(this,!1),ARt.set(this,!1),yRt.set(this,!1),Boe.set(this,!1),_Rt.set(this,void 0),ERt.set(this,void 0),x6e.set(this,void 0),P7r.set(this,n=>{if(vn(this,ARt,!0,"f"),W6e(n)&&(n=new nx),n instanceof nx)return vn(this,yRt,!0,"f"),this._emit("abort",n);if(n instanceof Ni)return this._emit("error",n);if(n instanceof Error){let o=new Ni(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ni(String(n)))}),vn(this,C6e,new Promise((n,o)=>{vn(this,mRt,n,"f"),vn(this,b6e,o,"f")}),"f"),vn(this,S6e,new Promise((n,o)=>{vn(this,gRt,n,"f"),vn(this,T6e,o,"f")}),"f"),gt(this,C6e,"f").catch(()=>{}),gt(this,S6e,"f").catch(()=>{}),vn(this,ICe,e,"f"),vn(this,x6e,r?.logger??console,"f")}get response(){return gt(this,_Rt,"f")}get request_id(){return gt(this,ERt,"f")}async withResponse(){vn(this,Boe,!0,"f");let e=await gt(this,C6e,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return vn(s,ICe,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},gt(this,P7r,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{gt(this,qk,"m",D7r).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)gt(this,qk,"m",N7r).call(this,u);if(l.controller.signal?.aborted)throw new nx;gt(this,qk,"m",M7r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(vn(this,_Rt,e,"f"),vn(this,ERt,e?.headers.get("request-id"),"f"),gt(this,mRt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,I6e,"f")}get errored(){return gt(this,ARt,"f")}get aborted(){return gt(this,yRt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,T9,"f")[e]||(gt(this,T9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,T9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(gt(this,T9,"f")[e]||(gt(this,T9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{vn(this,Boe,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){vn(this,Boe,!0,"f"),await gt(this,S6e,"f")}get currentMessage(){return gt(this,WW,"f")}async finalMessage(){return await this.done(),gt(this,qk,"m",k7r).call(this)}async finalText(){return await this.done(),gt(this,qk,"m",Kno).call(this)}_emit(e,...r){if(gt(this,I6e,"f"))return;e==="end"&&(vn(this,I6e,!0,"f"),gt(this,gRt,"f").call(this));let n=gt(this,T9,"f")[e];if(n&&(gt(this,T9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Boe,"f")&&!n?.length&&Promise.reject(o),gt(this,b6e,"f").call(this,o),gt(this,T6e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Boe,"f")&&!n?.length&&Promise.reject(o),gt(this,b6e,"f").call(this,o),gt(this,T6e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,qk,"m",k7r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{gt(this,qk,"m",D7r).call(this),this._connected(null);let s=zoe.fromReadableStream(e,this.controller);for await(let c of s)gt(this,qk,"m",N7r).call(this,c);if(s.controller.signal?.aborted)throw new nx;gt(this,qk,"m",M7r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(WW=new WeakMap,ICe=new WeakMap,C6e=new WeakMap,mRt=new WeakMap,b6e=new WeakMap,S6e=new WeakMap,gRt=new WeakMap,T6e=new WeakMap,T9=new WeakMap,I6e=new WeakMap,ARt=new WeakMap,yRt=new WeakMap,Boe=new WeakMap,_Rt=new WeakMap,ERt=new WeakMap,x6e=new WeakMap,P7r=new WeakMap,qk=new WeakSet,k7r=a(function(){if(this.receivedMessages.length===0)throw new Ni("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),Kno=a(function(){if(this.receivedMessages.length===0)throw new Ni("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(e.length===0)throw new Ni("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),D7r=a(function(){this.ended||vn(this,WW,void 0,"f")},"aG"),N7r=a(function(e){if(this.ended)return;let r=gt(this,qk,"m",Jno).call(this,e);switch(this._emit("streamEvent",e,r),e.type){case"content_block_delta":{let n=r.content.at(-1);switch(e.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",e.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",e.delta.citation,n.citations??[]);break}case"input_json_delta":{Xno(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",e.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}default:e.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(Yno(r,gt(this,ICe,"f"),{logger:gt(this,x6e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{vn(this,WW,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),M7r=a(function(){if(this.ended)throw new Ni("stream has ended, this shouldn't happen");let e=gt(this,WW,"f");if(!e)throw new Ni("request ended without sending any chunks");return vn(this,WW,void 0,"f"),Yno(e,gt(this,ICe,"f"),{logger:gt(this,x6e,"f")})},"eG"),Jno=a(function(e){let r=gt(this,WW,"f");if(e.type==="message_start"){if(r)throw new Ni(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ni(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":return r;case"message_delta":return r.stop_reason=e.delta.stop_reason,r.stop_sequence=e.delta.stop_sequence,r.usage.output_tokens=e.usage.output_tokens,e.usage.input_tokens!=null&&(r.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(r.usage.server_tool_use=e.usage.server_tool_use),r;case"content_block_start":return r.content.push({...e.content_block}),r;case"content_block_delta":{let n=r.content.at(e.index);switch(e.delta.type){case"text_delta":{n?.type==="text"&&(r.content[e.index]={...n,text:(n.text||"")+e.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break}case"input_json_delta":{if(n&&Xno(n)){let o=n[Zno]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,Zno,{value:o,enumerable:!1,writable:!0}),o&&(s.input=Mso(o)),r.content[e.index]=s}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,signature:e.delta.signature});break}default:e.delta}return r}case"content_block_stop":return r}},"Pw"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new zoe(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},akt=class extends Ld{static{a(this,"TQ")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(Yn`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",Yoe,{query:e,...r})}delete(e,r){return this._client.delete(Yn`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(Yn`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new Ni(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:_r([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>ZRt.fromResponse(s.response,s.controller))}},J6e=class extends Ld{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new akt(this._client)}create(e,r){e.model in eio&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${eio[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),UKc.includes(e.model)&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let s=Pso[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=kso(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:_r([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>Lso(n,e,{logger:this._client.logger??console}))}stream(e,r){return mQr.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},eio={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},UKc=["claude-mythos-preview","claude-opus-4-6"];J6e.Batches=akt;ckt=class extends Ld{static{a(this,"z8")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/models/${e}`,{...n,headers:_r([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models",Yoe,{query:o,...r,headers:_r([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},QKc="\\n\\nHuman:",qKc="\\n\\nAssistant:",Hp=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=pu("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(gQr.add(this),this._requestAuthFlags=new WeakMap,wRt.set(this,void 0),r===void 0&&(r=o.profile!=null?null:pu("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:pu("ANTHROPIC_AUTH_TOKEN")??null),o.profile!=null&&(o.credentials!=null||o.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let s={apiKey:r,authToken:n,...o,baseURL:e||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&qYc())throw new Ni(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`;a(zno,"Lw");rkt=class{static{a(this,"jQ")}constructor(e,r,n){E6e.add(this),this.client=e,TCe.set(this,!1),Boe.set(this,!1),Kg.set(this,void 0),XS.set(this,void 0),XI.set(this,void 0),R9.set(this,void 0),WW.set(this,void 0),v6e.set(this,0),vn(this,Kg,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...Pso(r.tools,r.messages)].join(", ");vn(this,XS,{...n,headers:_r([{"x-stainless-helper":o},n?.headers])},"f"),vn(this,WW,zno(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(TCe=new WeakMap,Boe=new WeakMap,Kg=new WeakMap,XS=new WeakMap,XI=new WeakMap,R9=new WeakMap,WW=new WeakMap,v6e=new WeakMap,E6e=new WeakSet,Wno=a(async function(){let e=gt(this,Kg,"f").params.compactionControl;if(!e||!e.enabled)return!1;let r=0;if(gt(this,XI,"f")!==void 0)try{let u=await gt(this,XI,"f");r=u.usage.input_tokens+(u.usage.cache_creation_input_tokens??0)+(u.usage.cache_read_input_tokens??0)+u.usage.output_tokens}catch{return!1}let n=e.contextTokenThreshold??LKc;if(rf.type!=="tool_use");d.length===0?c.pop():u.content=d}}let l=await this.client.beta.messages.create({model:o,messages:[...c,{role:"user",content:[{type:"text",text:s}]}],max_tokens:gt(this,Kg,"f").params.max_tokens},{signal:gt(this,XS,"f").signal,headers:_r([gt(this,XS,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new Ni("Expected text response for compaction");return gt(this,Kg,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(gt(this,TCe,"f"))throw new Ni("Cannot iterate over a consumed stream");vn(this,TCe,!0,"f"),vn(this,Boe,!0,"f"),vn(this,R9,void 0,"f");try{for(;;){let r;try{if(gt(this,Kg,"f").params.max_iterations&>(this,v6e,"f")>=gt(this,Kg,"f").params.max_iterations)break;vn(this,Boe,!1,"f"),vn(this,R9,void 0,"f"),vn(this,v6e,(e=gt(this,v6e,"f"),e++,e),"f"),vn(this,XI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=gt(this,Kg,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},gt(this,XS,"f")),vn(this,XI,r.finalMessage(),"f"),gt(this,XI,"f").catch(()=>{}),yield r):(vn(this,XI,this.client.beta.messages.create({...s,stream:!1},gt(this,XS,"f")),"f"),yield gt(this,XI,"f")),!await gt(this,E6e,"m",Wno).call(this)){if(!gt(this,Boe,"f")){let{role:l,content:u}=await gt(this,XI,"f");gt(this,Kg,"f").params.messages.push({role:l,content:u})}let c=await gt(this,E6e,"m",mQr).call(this,gt(this,Kg,"f").params.messages.at(-1));if(c)gt(this,Kg,"f").params.messages.push(c);else if(!gt(this,Boe,"f"))break}}finally{r&&r.abort()}}if(!gt(this,XI,"f"))throw new Ni("ToolRunner concluded without a message from the server");gt(this,WW,"f").resolve(await gt(this,XI,"f"))}catch(r){throw vn(this,TCe,!1,"f"),gt(this,WW,"f").promise.catch(()=>{}),gt(this,WW,"f").reject(r),vn(this,WW,zno(),"f"),r}}setMessagesParams(e){typeof e=="function"?gt(this,Kg,"f").params=e(gt(this,Kg,"f").params):gt(this,Kg,"f").params=e,vn(this,Boe,!0,"f"),vn(this,R9,void 0,"f")}setRequestOptions(e){typeof e=="function"?vn(this,XS,e(gt(this,XS,"f")),"f"):vn(this,XS,{...gt(this,XS,"f"),...e},"f")}async generateToolResponse(e=gt(this,XS,"f").signal){let r=await gt(this,XI,"f")??this.params.messages.at(-1);return r?gt(this,E6e,"m",mQr).call(this,r,e):null}done(){return gt(this,WW,"f").promise}async runUntilDone(){if(!gt(this,TCe,"f"))for await(let e of this);return this.done()}get params(){return gt(this,Kg,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};mQr=a(async function(t,e=gt(this,XS,"f").signal){return gt(this,R9,"f")!==void 0?gt(this,R9,"f"):(vn(this,R9,FKc(gt(this,Kg,"f").params,t,{...gt(this,XS,"f"),signal:e}),"f"),gt(this,R9,"f"))},"iG");a(FKc,"Fv");Yno={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},UKc=["claude-mythos-preview","claude-opus-4-6"],Joe=class extends Bd{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new ekt(this._client)}create(e,r){let n=Kno(e),{betas:o,...s}=n;s.model in Yno&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${Yno[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),UKc.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=this._client._options.timeout;if(!s.stream&&c==null){let u=Nso[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=Dso(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:_r([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:_r([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>Oso(n,e,{logger:this._client.logger??console}))}stream(e,r){return hQr.createMessage(this,e,r)}countTokens(e,r){let n=Kno(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:_r([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new rkt(this._client,e,r)}};a(Kno,"Aw");Joe.Batches=ekt;Joe.BetaToolRunner=rkt;Joe.ToolError=tkt;nkt=class extends Bd{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/sessions/${e}/events?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}},ikt=class extends Bd{static{a(this,"IQ")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(Yn`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.post(Yn`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/sessions/${e}/resources?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{session_id:o,betas:s}=r;return this._client.delete(Yn`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},GCe=class extends Bd{static{a(this,"G0")}constructor(){super(...arguments),this.events=new nkt(this._client),this.resources=new ikt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/sessions/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/sessions/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/sessions/${e}/archive?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};GCe.Events=nkt;GCe.Resources=ikt;okt=class extends Bd{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(Yn`/v1/skills/${e}/versions?beta=true`,Fqr({body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(Yn`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/skills/${e}/versions?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,r,n){let{skill_id:o,betas:s}=r;return this._client.delete(Yn`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}},Y6e=class extends Bd{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new okt(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",Fqr({body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/skills/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/skills?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/skills/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};Y6e.Versions=okt;skt=class extends Bd{static{a(this,"PQ")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{vault_id:o,betas:s}=r;return this._client.get(Yn`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{vault_id:o,betas:s,...c}=r;return this._client.post(Yn`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Yn`/v1/vaults/${e}/credentials?beta=true`,TE,{query:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{vault_id:o,betas:s}=r;return this._client.delete(Yn`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(Yn`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:_r([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},K6e=class extends Bd{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new skt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/vaults/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Yn`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",TE,{query:o,...r,headers:_r([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Yn`/v1/vaults/${e}?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Yn`/v1/vaults/${e}/archive?beta=true`,{...n,headers:_r([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};K6e.Credentials=skt;t1=class extends Bd{static{a(this,"G6")}constructor(){super(...arguments),this.models=new zRt(this._client),this.messages=new Joe(this._client),this.agents=new z6e(this._client),this.environments=new VRt(this._client),this.sessions=new GCe(this._client),this.vaults=new K6e(this._client),this.memoryStores=new HCe(this._client),this.files=new WRt(this._client),this.skills=new Y6e(this._client),this.userProfiles=new YRt(this._client)}};t1.Models=zRt;t1.Messages=Joe;t1.Agents=z6e;t1.Environments=VRt;t1.Sessions=GCe;t1.Vaults=K6e;t1.MemoryStores=HCe;t1.Files=WRt;t1.Skills=Y6e;t1.UserProfiles=YRt;akt=class extends Bd{static{a(this,"V8")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...r,headers:_r([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}};a(Bso,"Iw");a(Jno,"nG");a(Fso,"rG");a(QKc,"bv");eio="__json_buf";a(tio,"bw");gQr=class t{static{a(this,"CQ")}constructor(e,r){qk.add(this),this.messages=[],this.receivedMessages=[],zW.set(this,void 0),ICe.set(this,null),this.controller=new AbortController,C6e.set(this,void 0),gRt.set(this,()=>{}),b6e.set(this,()=>{}),S6e.set(this,void 0),ARt.set(this,()=>{}),T6e.set(this,()=>{}),T9.set(this,{}),I6e.set(this,!1),yRt.set(this,!1),_Rt.set(this,!1),Foe.set(this,!1),ERt.set(this,void 0),vRt.set(this,void 0),x6e.set(this,void 0),D7r.set(this,n=>{if(vn(this,yRt,!0,"f"),W6e(n)&&(n=new nx),n instanceof nx)return vn(this,_Rt,!0,"f"),this._emit("abort",n);if(n instanceof Ni)return this._emit("error",n);if(n instanceof Error){let o=new Ni(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ni(String(n)))}),vn(this,C6e,new Promise((n,o)=>{vn(this,gRt,n,"f"),vn(this,b6e,o,"f")}),"f"),vn(this,S6e,new Promise((n,o)=>{vn(this,ARt,n,"f"),vn(this,T6e,o,"f")}),"f"),gt(this,C6e,"f").catch(()=>{}),gt(this,S6e,"f").catch(()=>{}),vn(this,ICe,e,"f"),vn(this,x6e,r?.logger??console,"f")}get response(){return gt(this,ERt,"f")}get request_id(){return gt(this,vRt,"f")}async withResponse(){vn(this,Foe,!0,"f");let e=await gt(this,C6e,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return vn(s,ICe,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},gt(this,D7r,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{gt(this,qk,"m",N7r).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)gt(this,qk,"m",M7r).call(this,u);if(l.controller.signal?.aborted)throw new nx;gt(this,qk,"m",O7r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(vn(this,ERt,e,"f"),vn(this,vRt,e?.headers.get("request-id"),"f"),gt(this,gRt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,I6e,"f")}get errored(){return gt(this,yRt,"f")}get aborted(){return gt(this,_Rt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,T9,"f")[e]||(gt(this,T9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,T9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(gt(this,T9,"f")[e]||(gt(this,T9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{vn(this,Foe,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){vn(this,Foe,!0,"f"),await gt(this,S6e,"f")}get currentMessage(){return gt(this,zW,"f")}async finalMessage(){return await this.done(),gt(this,qk,"m",P7r).call(this)}async finalText(){return await this.done(),gt(this,qk,"m",Zno).call(this)}_emit(e,...r){if(gt(this,I6e,"f"))return;e==="end"&&(vn(this,I6e,!0,"f"),gt(this,ARt,"f").call(this));let n=gt(this,T9,"f")[e];if(n&&(gt(this,T9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Foe,"f")&&!n?.length&&Promise.reject(o),gt(this,b6e,"f").call(this,o),gt(this,T6e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Foe,"f")&&!n?.length&&Promise.reject(o),gt(this,b6e,"f").call(this,o),gt(this,T6e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,qk,"m",P7r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{gt(this,qk,"m",N7r).call(this),this._connected(null);let s=Yoe.fromReadableStream(e,this.controller);for await(let c of s)gt(this,qk,"m",M7r).call(this,c);if(s.controller.signal?.aborted)throw new nx;gt(this,qk,"m",O7r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(zW=new WeakMap,ICe=new WeakMap,C6e=new WeakMap,gRt=new WeakMap,b6e=new WeakMap,S6e=new WeakMap,ARt=new WeakMap,T6e=new WeakMap,T9=new WeakMap,I6e=new WeakMap,yRt=new WeakMap,_Rt=new WeakMap,Foe=new WeakMap,ERt=new WeakMap,vRt=new WeakMap,x6e=new WeakMap,D7r=new WeakMap,qk=new WeakSet,P7r=a(function(){if(this.receivedMessages.length===0)throw new Ni("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),Zno=a(function(){if(this.receivedMessages.length===0)throw new Ni("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(e.length===0)throw new Ni("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),N7r=a(function(){this.ended||vn(this,zW,void 0,"f")},"aG"),M7r=a(function(e){if(this.ended)return;let r=gt(this,qk,"m",Xno).call(this,e);switch(this._emit("streamEvent",e,r),e.type){case"content_block_delta":{let n=r.content.at(-1);switch(e.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",e.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",e.delta.citation,n.citations??[]);break}case"input_json_delta":{tio(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",e.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}default:e.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(Jno(r,gt(this,ICe,"f"),{logger:gt(this,x6e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{vn(this,zW,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),O7r=a(function(){if(this.ended)throw new Ni("stream has ended, this shouldn't happen");let e=gt(this,zW,"f");if(!e)throw new Ni("request ended without sending any chunks");return vn(this,zW,void 0,"f"),Jno(e,gt(this,ICe,"f"),{logger:gt(this,x6e,"f")})},"eG"),Xno=a(function(e){let r=gt(this,zW,"f");if(e.type==="message_start"){if(r)throw new Ni(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ni(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":return r;case"message_delta":return r.stop_reason=e.delta.stop_reason,r.stop_sequence=e.delta.stop_sequence,r.usage.output_tokens=e.usage.output_tokens,e.usage.input_tokens!=null&&(r.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(r.usage.server_tool_use=e.usage.server_tool_use),r;case"content_block_start":return r.content.push({...e.content_block}),r;case"content_block_delta":{let n=r.content.at(e.index);switch(e.delta.type){case"text_delta":{n?.type==="text"&&(r.content[e.index]={...n,text:(n.text||"")+e.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break}case"input_json_delta":{if(n&&tio(n)){let o=n[eio]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,eio,{value:o,enumerable:!1,writable:!0}),o&&(s.input=Lso(o)),r.content[e.index]=s}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,signature:e.delta.signature});break}default:e.delta}return r}case"content_block_stop":return r}},"Pw"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new Yoe(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},ckt=class extends Bd{static{a(this,"TQ")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(Yn`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",Koe,{query:e,...r})}delete(e,r){return this._client.delete(Yn`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(Yn`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new Ni(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:_r([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>XRt.fromResponse(s.response,s.controller))}},J6e=class extends Bd{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new ckt(this._client)}create(e,r){e.model in rio&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${rio[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),qKc.includes(e.model)&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let s=Nso[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=Dso(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:_r([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>Fso(n,e,{logger:this._client.logger??console}))}stream(e,r){return gQr.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},rio={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},qKc=["claude-mythos-preview","claude-opus-4-6"];J6e.Batches=ckt;lkt=class extends Bd{static{a(this,"z8")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Yn`/v1/models/${e}`,{...n,headers:_r([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models",Koe,{query:o,...r,headers:_r([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},jKc="\\n\\nHuman:",HKc="\\n\\nAssistant:",Hp=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=pu("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(AQr.add(this),this._requestAuthFlags=new WeakMap,RRt.set(this,void 0),r===void 0&&(r=o.profile!=null?null:pu("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:pu("ANTHROPIC_AUTH_TOKEN")??null),o.profile!=null&&(o.credentials!=null||o.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let s={apiKey:r,authToken:n,...o,baseURL:e||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&HYc())throw new Ni(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); -`);this.baseURL=s.baseURL,this._baseURLIsExplicit=o.__baseURLIsExplicit??!!e,this.timeout=s.timeout??Fqr.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=Ono(s.logLevel,"ClientOptions.logLevel",this)??Ono(pu("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??$Yc(),vn(this,wRt,WYc,"f");let l=pu("ANTHROPIC_CUSTOM_HEADERS");if(l){let d={};for(let f of l.split(` -`)){let h=f.indexOf(":");h>=0&&(d[f.substring(0,h).trim()]=f.substring(h+1).trim())}s.defaultHeaders={...d,...s.defaultHeaders}}let u=o.__auth;if(delete s.__auth,delete s.__baseURLIsExplicit,this._options=s,this.apiKey=typeof r=="string"?r:null,this.authToken=n,u)this._authState=u,!this._baseURLIsExplicit&&u.baseURL&&(this.baseURL=u.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let d=s.credentials??null;if(d)this._authState.provider=d,this._authState.tokenCache=this._makeTokenCache(d);else if(s.config!=null){let f=vso(s.config,this._credentialResolverOptions());this._authState.provider=f.provider,this._authState.tokenCache=this._makeTokenCache(f.provider),this._authState.extraHeaders=f.extraHeaders,this._applyCredentialBaseURL(f.baseURL)}else s.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(s.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,!this._baseURLIsExplicit&&(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{AA(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{AA(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new cQr(e,r=>{AA(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await dKc(this._credentialResolverOptions(),e);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(e!=null)throw new Ni(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!r.has("authorization"))throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let r=this._requestAuthFlags.get(e);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,r)),r}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,_r([{Authorization:`Bearer ${r}`}])}return _r([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return _r([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return _r([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return zYc(e)}getUserAgent(){return`${this.constructor.name}/JS ${ZW}`}defaultIdempotencyKey(){return`stainless-node-retry-${lso()}`}makeStatusError(e,r,n,o){return AC.generate(e,r,n,o)}buildURL(e,r,n){let o=!gt(this,gQr,"m",Bso).call(this)&&n||this.baseURL,s=BYc(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!xno(c)||!xno(l))&&(r={...l,...c,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new Ni("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 6e5}async prepareOptions(e){}async prepareRequest(e,{url:r,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let o=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[s,c]of Object.entries(this._authState.extraHeaders))o.has(s)||o.set(s,c);o.get("anthropic-beta")?.split(",").map(s=>s.trim())?.includes(qRt)||o.append("anthropic-beta",qRt),e.headers=o}}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new HRt(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(AA(this).debug(`[${d}] sending request`,Uoe({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new nx;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(oQr),A=Date.now();if(g instanceof globalThis.Error){let E=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new nx;let v=W6e(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return AA(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${E}`),AA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${E})`,Uoe({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw AA(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),AA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,Uoe({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new DRt:new jCe({cause:g})}let y=[...g.headers.entries()].filter(([E])=>E==="request-id").map(([E,v])=>", "+E+": "+JSON.stringify(v)).join(""),_=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let E=await this.shouldRetry(g,o);if(r&&E){let R=`retrying, ${r} attempts remaining`;return await VYc(g.body),AA(this).info(`${_} - ${R}`),AA(this).debug(`[${d}] response error (${R})`,Uoe({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=E?"error; no more retries left":"error; not retryable";AA(this).info(`${_} - ${v}`);let S=await g.text().catch(R=>oQr(R).message),T=uso(S),w=T?void 0:S;throw AA(this).debug(`[${d}] response error (${v})`,Uoe({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return AA(this).info(_),AA(this).debug(`[${d}] response start`,Uoe({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),{response:g,options:o,controller:m,requestLogID:d,retryOfRequestLogID:n,startTime:h}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(o=>({method:"get",path:e,...o})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new uQr(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:s,method:c,...l}=r||{},u=this._makeAbort(o);s&&s.addEventListener("abort",u,{once:!0});let d=setTimeout(u,n),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,h={signal:o.signal,...f?{duplex:"half"}:{},method:"GET",...l};c&&(h.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(d)}}async shouldRetry(e,r){let n=this._authFlags(r);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=e.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let s,c=o?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(s=u)}let l=o?.get("retry-after");if(l&&!s){let u=parseFloat(l);Number.isNaN(u)?s=Date.parse(l)-Date.now():s=u*1e3}if(s===void 0){let u=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,u)}return await QYc(s),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let n=r-e,o=Math.min(.5*Math.pow(2,n),8),s=1-Math.random()*.25;return o*s*1e3}calculateNonstreamingTimeout(e,r){if(36e5*e/128e3>6e5||r!=null&&e>r)throw new Ni("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:s,query:c,defaultBaseURL:l}=n;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let u=this.buildURL(s,c,l);"timeout"in n&&UYc("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:d,body:f}=this.buildBody({options:n}),h=await this.buildHeaders({options:e,method:o,bodyHeaders:d,retryCount:r});return{req:{method:o,headers:h,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"},...f&&{body:f},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let s={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let c=_r([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...Dqr(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(c),c.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=_r([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:fso(e)}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:gt(this,wRt,"f").call(this,{body:e,headers:n})}};Fqr=Hp,wRt=new WeakMap,gQr=new WeakSet,Bso=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");Hp.Anthropic=Fqr;Hp.HUMAN_PROMPT=QKc;Hp.AI_PROMPT=qKc;Hp.DEFAULT_TIMEOUT=6e5;Hp.AnthropicError=Ni;Hp.APIError=AC;Hp.APIConnectionError=jCe;Hp.APIConnectionTimeoutError=DRt;Hp.APIUserAbortError=nx;Hp.NotFoundError=LRt;Hp.ConflictError=BRt;Hp.RateLimitError=URt;Hp.BadRequestError=NRt;Hp.AuthenticationError=MRt;Hp.InternalServerError=QRt;Hp.PermissionDeniedError=ORt;Hp.UnprocessableEntityError=FRt;Hp.toFile=TKc;$Ce=class extends Hp{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new skt(this),this.messages=new J6e(this),this.models=new ckt(this),this.beta=new t1(this)}};$Ce.Completions=skt;$Ce.Messages=J6e;$Ce.Models=ckt;$Ce.Beta=t1;a(bUe,"j4");a(RRt,"N8");a(ix,"o$");a(SUe,"D1");a(Fso,"JU");a(jKc,"Tw");HKc=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),GKc=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a($Kc,"xw");yQr=class{static{a(this,"gw")}read(e){return(0,yA.readFile)(e,"utf8")}readBytes(e){return(0,yA.readFile)(e)}write(e,r,n){return(0,yA.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,yA.mkdir)(e,{recursive:!0})}catch(r){if(ix(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return $Kc(e,r,n)}delete(e){return(0,yA.unlink)(e)}list(e){return(0,yA.readdir)(e)}append(e,r,n){return(0,yA.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,yA.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,yA.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,yA.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,yA.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},VKc=new Qso.AsyncLocalStorage;a(lkt,"w8");xCe=null;a(jso,"uw");a(WKc,"mw");a(jk,"L6");a(zKc,"dv");YKc=zKc;a(KKc,"iv");JKc=KKc;a(ZKc,"nv");XKc=ZKc;a(eJc,"rv");tJc=eJc,rJc=200;a(nJc,"tv");iJc=nJc;a(gbe,"D8");gbe.prototype.clear=YKc;gbe.prototype.delete=JKc;gbe.prototype.get=XKc;gbe.prototype.has=tJc;gbe.prototype.set=iJc;oJc=gbe,sJc=(function(){try{var t=Rqr(Object,"defineProperty");return t({},"",{}),t}catch{}})(),ukt=sJc;a(aJc,"sv");Uqr=aJc,cJc=Object.prototype,lJc=cJc.hasOwnProperty;a(uJc,"QC");Hso=uJc;a(dJc,"JC");fJc=dJc;a(pJc,"XC");hJc=pJc;a(mJc,"YC");Abe=mJc,gJc="[object Arguments]";a(AJc,"GC");tio=AJc,Gso=Object.prototype,yJc=Gso.hasOwnProperty,_Jc=Gso.propertyIsEnumerable,EJc=tio((function(){return arguments})())?tio:function(t){return Abe(t)&&yJc.call(t,"callee")&&!_Jc.call(t,"callee")},Z6e=EJc,vJc=Array.isArray,iz=vJc,O6e={};RB(O6e,{default:a(()=>Qqr,"default")});a(CJc,"VC");bJc=CJc,$so=typeof O6e=="object"&&O6e&&!O6e.nodeType&&O6e,rio=$so&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,SJc=rio&&rio.exports===$so,nio=SJc?dbe.Buffer:void 0,TJc=nio?nio.isBuffer:void 0,IJc=TJc||bJc,Qqr=IJc,xJc=9007199254740991,wJc=/^(?:0|[1-9]\d*)$/;a(RJc,"DC");lPt=RJc,kJc=9007199254740991;a(PJc,"ZC");qqr=PJc,DJc="[object Arguments]",NJc="[object Array]",MJc="[object Boolean]",OJc="[object Date]",LJc="[object Error]",BJc="[object Function]",FJc="[object Map]",UJc="[object Number]",QJc="[object Object]",qJc="[object RegExp]",jJc="[object Set]",HJc="[object String]",GJc="[object WeakMap]",$Jc="[object ArrayBuffer]",VJc="[object DataView]",WJc="[object Float32Array]",zJc="[object Float64Array]",YJc="[object Int8Array]",KJc="[object Int16Array]",JJc="[object Int32Array]",ZJc="[object Uint8Array]",XJc="[object Uint8ClampedArray]",eZc="[object Uint16Array]",tZc="[object Uint32Array]",Md={};Md[WJc]=Md[zJc]=Md[YJc]=Md[KJc]=Md[JJc]=Md[ZJc]=Md[XJc]=Md[eZc]=Md[tZc]=!0;Md[DJc]=Md[NJc]=Md[$Jc]=Md[MJc]=Md[VJc]=Md[OJc]=Md[LJc]=Md[BJc]=Md[FJc]=Md[UJc]=Md[QJc]=Md[qJc]=Md[jJc]=Md[HJc]=Md[GJc]=!1;a(rZc,"pC");nZc=rZc;a(iZc,"dC");oZc=iZc,L6e={};RB(L6e,{default:a(()=>_Qr,"default")});Vso=typeof L6e=="object"&&L6e&&!L6e.nodeType&&L6e,H6e=Vso&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,sZc=H6e&&H6e.exports===Vso,O7r=sZc&&iso.process,aZc=(function(){try{var t=H6e&&H6e.require&&H6e.require("util").types;return t||O7r&&O7r.binding&&O7r.binding("util")}catch{}})(),_Qr=aZc,iio=_Qr&&_Qr.isTypedArray,cZc=iio?oZc(iio):nZc,Wso=cZc,lZc=Object.prototype,uZc=lZc.hasOwnProperty;a(dZc,"aC");fZc=dZc,pZc=Object.prototype;a(hZc,"eC");zso=hZc;a(mZc,"$T");gZc=mZc;a(AZc,"QT");jqr=AZc;a(yZc,"JT");_Zc=yZc,EZc=Object.prototype,vZc=EZc.hasOwnProperty;a(CZc,"WT");bZc=CZc;a(SZc,"GT");Yso=SZc,B6e={};RB(B6e,{default:a(()=>Jso,"default")});Kso=typeof B6e=="object"&&B6e&&!B6e.nodeType&&B6e,oio=Kso&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,TZc=oio&&oio.exports===Kso,sio=TZc?dbe.Buffer:void 0,aio=sio?sio.allocUnsafe:void 0;a(IZc,"HT");Jso=IZc;a(xZc,"KT");wZc=xZc;a(RZc,"qT");kZc=RZc,PZc=gZc(Object.getPrototypeOf,Object),Zso=PZc,DZc=dbe.Uint8Array,cio=DZc;a(NZc,"zT");MZc=NZc;a(OZc,"NT");LZc=OZc,lio=Object.create,BZc=(function(){function t(){}return a(t,"$"),function(e){if(!N9(e))return{};if(lio)return lio(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),FZc=BZc;a(UZc,"OT");QZc=UZc,qZc="[object Symbol]";a(jZc,"FT");Hqr=jZc,HZc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,GZc=/^\w*$/;a($Zc,"LT");VZc=$Zc,WZc=500;a(zZc,"AT");YZc=zZc,KZc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,JZc=/\\(\\)?/g,ZZc=YZc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(KZc,function(r,n,o,s){e.push(o?s.replace(JZc,"$1"):n||r)}),e}),XZc=ZZc;a(eXc,"ET");tXc=eXc,rXc=1/0,uio=nz?nz.prototype:void 0,dio=uio?uio.toString:void 0;a(Xso,"PO");nXc=Xso;a(iXc,"_T");oXc=iXc;a(sXc,"kT");uPt=sXc,aXc=1/0;a(cXc,"vT");Gqr=cXc;a(lXc,"CT");uXc=lXc;a(dXc,"TT");fXc=dXc;a(pXc,"xT");hXc=pXc;a(mXc,"yT");gXc=mXc;a(AXc,"fT");eao=AXc,$qr=null;a(yXc,"CO");a(_Xc,"TO");fkt=new Map;a(EXc,"xO");a(vXc,"yO");Vqr=new Map;a(bXc,"fO");a(SXc,"gO");a(Wqr,"V0");a(IXc,"hO");a(xXc,"uO");wXc={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(RXc,"lT");kXc=RXc(),PXc=a(()=>{},"pT");a(rao,"VU");DXc=vUe(),yfm=DXc.subscribe,NXc=vUe(),_fm=NXc.subscribe,MXc=vUe(),Efm=MXc.subscribe,OXc=vUe(),vfm=OXc.subscribe,LXc=vUe(),Cfm=LXc.subscribe;a(BXc,"lO");a(FXc,"tT");vQr=class{static{a(this,"cO")}#e=new Set;register(e){let r=FXc(e);this.#e.add(r);let n=a(()=>{this.#e.delete(r)},"J");return Object.assign(n,{[Symbol.dispose]:n})}async drain(){let e=Array.from(this.#e);this.#e.clear(),await Promise.all(e.map(async r=>r()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#e.size}},UXc=new vQr;a(QXc,"pO");qXc=Wy(t=>{if(!t||t.trim()==="")return null;let e=t.split(",").map(s=>s.trim()).filter(Boolean);if(e.length===0)return null;let r=e.some(s=>s.startsWith("!")),n=e.some(s=>!s.startsWith("!"));if(r&&n)return null;let o=e.map(s=>s.replace(/^!/,"").toLowerCase());return{include:r?[]:o,exclude:r?o:[],isExclusive:r}});a(jXc,"sT");a(HXc,"eT");a(GXc,"iO");a($Xc,"tO");a(VXc,"Qx");a(fio,"oO");a(WXc,"aO");a(iao,"HX");zXc={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=pf(e,mf`fs.existsSync(${t})`,0);return bo.existsSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},async stat(t){return(0,Xg.stat)(t)},async readdir(t){return(0,Xg.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,Xg.unlink)(t)},async rmdir(t){return(0,Xg.rmdir)(t)},async rm(t,e){return(0,Xg.rm)(t,e)},async mkdir(t,e){try{await(0,Xg.mkdir)(t,{recursive:!0,...e})}catch(r){if(ix(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,Xg.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,Xg.rename)(t,e)},statSync(t){let e=[];try{let o=pf(e,mf`fs.statSync(${t})`,0);return bo.statSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},lstatSync(t){let e=[];try{let o=pf(e,mf`fs.lstatSync(${t})`,0);return bo.lstatSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},readFileSync(t,e){let r=[];try{let s=pf(r,mf`fs.readFileSync(${t})`,0);return bo.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{hf(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=pf(e,mf`fs.readFileBytesSync(${t})`,0);return bo.readFileSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},readSync(t,e){let r=[];try{let s=pf(r,mf`fs.readSync(${t}, ${e.length} bytes)`,0),c;try{c=bo.openSync(t,"r");let l=Buffer.alloc(e.length),u=bo.readSync(c,l,0,e.length,0);return{buffer:l,bytesRead:u}}finally{c&&bo.closeSync(c)}}catch(s){var n=s,o=1}finally{hf(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=pf(n,mf`fs.appendFileSync(${t}, ${e.length} chars)`,0);if(r?.mode!==void 0)try{let l=bo.openSync(t,"ax",r.mode);try{bo.appendFileSync(l,e)}finally{bo.closeSync(l)}return}catch(l){if(ix(l)!=="EEXIST")throw l}bo.appendFileSync(t,e)}catch(c){var o=c,s=1}finally{hf(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=pf(r,mf`fs.copyFileSync(${t} → ${e})`,0);bo.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{hf(r,n,o)}},unlinkSync(t){let e=[];try{let o=pf(e,mf`fs.unlinkSync(${t})`,0);bo.unlinkSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},renameSync(t,e){let r=[];try{let s=pf(r,mf`fs.renameSync(${t} → ${e})`,0);bo.renameSync(t,e)}catch(s){var n=s,o=1}finally{hf(r,n,o)}},linkSync(t,e){let r=[];try{let s=pf(r,mf`fs.linkSync(${t} → ${e})`,0);bo.linkSync(t,e)}catch(s){var n=s,o=1}finally{hf(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=pf(n,mf`fs.symlinkSync(${t} → ${e})`,0);bo.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{hf(n,o,s)}},readlinkSync(t){let e=[];try{let o=pf(e,mf`fs.readlinkSync(${t})`,0);return bo.readlinkSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},realpathSync(t){let e=[];try{let o=pf(e,mf`fs.realpathSync(${t})`,0);return bo.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{hf(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=pf(r,mf`fs.mkdirSync(${t})`,0),c={recursive:!0};e?.mode!==void 0&&(c.mode=e.mode);try{bo.mkdirSync(t,c)}catch(l){if(ix(l)!=="EEXIST")throw l}}catch(s){var n=s,o=1}finally{hf(r,n,o)}},readdirSync(t){let e=[];try{let o=pf(e,mf`fs.readdirSync(${t})`,0);return bo.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{hf(e,r,n)}},readdirStringSync(t){let e=[];try{let o=pf(e,mf`fs.readdirStringSync(${t})`,0);return bo.readdirSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=pf(e,mf`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{hf(e,r,n)}},rmdirSync(t){let e=[];try{let o=pf(e,mf`fs.rmdirSync(${t})`,0);bo.rmdirSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},rmSync(t,e){let r=[];try{let s=pf(r,mf`fs.rmSync(${t})`,0);bo.rmSync(t,e)}catch(s){var n=s,o=1}finally{hf(r,n,o)}},createWriteStream(t){return bo.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,Xg.readFile)(t);let r=await(0,Xg.open)(t,"r");try{let{size:n}=await r.stat(),o=Math.min(n,e),s=Buffer.allocUnsafe(o),c=0;for(;c=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,confidence:"high"},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-api-key",source:`\\b(${rel}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"openai-api-key",source:`\\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}",confidence:"high"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}",confidence:"high"},{id:"gitlab-pat",source:"glpat-[\\w-]{20}",confidence:"high"},{id:"gitlab-deploy-token",source:"gldt-[0-9a-zA-Z_\\-]{20}",confidence:"high"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",confidence:"high"},{id:"slack-user-token",source:"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",confidence:"high"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i",confidence:"high"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}",confidence:"high"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",confidence:"high"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}",confidence:"high"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",confidence:"high"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}",confidence:"high"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}",confidence:"high"},{id:"private-key",source:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?-----END[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----",flags:"i",confidence:"high"}],mio=null;a(iel,"Ox");a(oel,"W2");CQr={verbose:0,debug:1,info:2,warn:3,error:4},sel=Wy(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(CQr,t)?t:"debug"}),ael=!1;a(dPt,"qX");bQr=Wy(()=>{let t=dPt();return ael||bE(process.env.DEBUG)||bE(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||oao()||t.some(e=>e.startsWith("--debug="))||sao()!==null}),cel=Wy(()=>{let t=dPt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return qXc(e)}),oao=Wy(()=>{let t=dPt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),sao=Wy(()=>{let t=dPt();for(let e=0;e{try{let t=lao(),e=(0,tse.dirname)(t),r=(0,tse.join)(e,"latest");await(0,IE.unlink)(r).catch(()=>{}),await(0,IE.symlink)(t,r)}catch{}}),Tfm=(()=>{let t=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(t!==void 0){let e=Number(t);if(!Number.isNaN(e)&&e>=0)return e}return 1/0})(),hel={[Symbol.dispose](){}};a(mel,"_x");mf=mel;a(Xm,"B$");CM=a((t,e)=>{let r=[];try{let s=pf(r,mf`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{hf(r,n,o)}},"d$");a(gel,"w2");a(oz,"A4");a(Ael,"kx");a(yel,"O2");_el=2e3,pkt=new Set,gio=!1;a(Eel,"xx");a(vel,"yx");IQr=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=nQr();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||nQr(),e.deferSpawn?(this.spawnPromise=new Promise((r,n)=>{this.spawnResolve=r,this.spawnReject=n}),this.spawnPromise.catch(()=>{})):this.initialize()}spawn(){try{this.initialize()}catch(r){throw this.spawnAbort(bUe(r)),r}let e=this.pendingWrites;this.pendingWrites=[],this.spawnResolve&&(this.spawnResolve(),this.spawnResolve=void 0,this.spawnReject=void 0);for(let r of e)this.write(r);this.pendingEndInput&&(this.pendingEndInput=!1,this.processStdin?.end())}spawnAbort(e){this.spawnReject&&(this.spawnReject(e),this.spawnReject=void 0,this.spawnResolve=void 0,this.pendingWrites=[])}updateEnv(e){this.options.env?Object.assign(this.options.env,e):this.options.env={...e}}updateResume(e){this.options.resume=e}getDefaultExecutable(){return nso()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=bE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,Xoo.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(bE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();jk(f),this.options.stderr&&this.options.stderr(f)}),{stdin:u.stdin,stdout:u.stdout,get killed(){return u.killed},get exitCode(){return u.exitCode},kill:u.kill.bind(u),on:u.on.bind(u),once:u.once.bind(u),off:u.off.bind(u)}}initialize(){try{let{additionalDirectories:e=[],agent:r,betas:n,cwd:o,executable:s=this.getDefaultExecutable(),executableArgs:c=[],extraArgs:l={},pathToClaudeCodeExecutable:u,env:d={...process.env},thinkingConfig:f,maxTurns:h,maxBudgetUsd:m,taskBudget:g,model:A,fallbackModel:y,jsonSchema:_,permissionMode:E,allowDangerouslySkipPermissions:v,permissionPromptToolName:S,continueConversation:T,resume:w,settingSources:R,skills:x,disallowedTools:k=[],tools:D,mcpServers:N,strictMcpConfig:O,canUseTool:B,includePartialMessages:q,plugins:M,sandbox:L}=this.options,{allowedTools:U=[]}=this.options;if(x!==void 0){let H=x==="all"?["Skill"]:x.map(le=>`Skill(${le})`),re=new Set(U);U=[...U,...H.filter(le=>!re.has(le))]}let j=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(f){switch(f.type){case"enabled":f.budgetTokens===void 0?j.push("--thinking","adaptive"):j.push("--max-thinking-tokens",f.budgetTokens.toString());break;case"disabled":j.push("--thinking","disabled");break;case"adaptive":j.push("--thinking","adaptive");break}f.type!=="disabled"&&f.display&&j.push("--thinking-display",f.display)}if(this.options.effort&&j.push("--effort",this.options.effort),h&&j.push("--max-turns",h.toString()),m!==void 0&&j.push("--max-budget-usd",m.toString()),g&&j.push("--task-budget",g.total.toString()),A&&j.push("--model",A),r&&j.push("--agent",r),n&&n.length>0&&j.push("--betas",n.join(",")),_&&j.push("--json-schema",Xm(_)),this.options.debugFile?j.push("--debug-file",this.options.debugFile):this.options.debug&&j.push("--debug"),!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let H=WKc();H&&j.push("--debug-file",H)}if(B){if(S)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");j.push("--permission-prompt-tool","stdio")}else S&&j.push("--permission-prompt-tool",S);if(T&&j.push("--continue"),w&&j.push("--resume",w),this.options.assistant&&j.push("--assistant"),this.options.channels&&this.options.channels.length>0&&j.push("--channels",...this.options.channels),U.length>0&&j.push("--allowedTools",U.join(",")),k.length>0&&j.push("--disallowedTools",k.join(",")),D!==void 0&&(Array.isArray(D)?D.length===0?j.push("--tools",""):j.push("--tools",D.join(",")):j.push("--tools","default")),N&&Object.keys(N).length>0&&j.push("--mcp-config",Xm({mcpServers:N})),R!==void 0&&j.push(`--setting-sources=${R.join(",")}`),O&&j.push("--strict-mcp-config"),E&&j.push("--permission-mode",E),v&&j.push("--allow-dangerously-skip-permissions"),y){if(A&&y===A)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");j.push("--fallback-model",y)}this.options.includeHookEvents&&j.push("--include-hook-events"),q&&j.push("--include-partial-messages"),this.options.sessionMirror&&j.push("--session-mirror");for(let H of e)j.push("--add-dir",H);if(M&&M.length>0)for(let H of M)if(H.type==="local")j.push("--plugin-dir",H.path);else throw Error(`Unsupported plugin type: ${H.type}`);this.options.forkSession&&j.push("--fork-session"),this.options.resumeSessionAt&&j.push("--resume-session-at",this.options.resumeSessionAt),this.options.sessionId&&j.push("--session-id",this.options.sessionId),this.options.persistSession===!1&&j.push("--no-session-persistence"),this.options.managedSettings&&j.push("--managed-settings",this.options.managedSettings);let Q={...l??{}};this.options.settings&&(Q.settings=this.options.settings);let Y=yel(Q,L);for(let[H,re]of Object.entries(Y))re===null?j.push(`--${H}`):j.push(`--${H}`,re);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,bE(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let W=Cel(u),V=W?u:s,z=W?[...c,...j]:[...c,u,...j],ie={command:V,args:z,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(jk(`Spawning Claude Code (custom): ${V} ${z.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(ie)):(jk(`Spawning Claude Code: ${V} ${z.join(" ")}`),this.process=this.spawnLocalProcess(ie)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,vel(this.process),this.abortHandler=()=>this.close(),this.abortController.signal.addEventListener("abort",this.abortHandler),this.abortController.signal.aborted&&this.close(),this.process.on("error",H=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new e1("Claude Code process aborted by user");else if(jKc(H)){let re=bel(u,W);this.exitError=ReferenceError(re),jk(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${H.message}`),jk(this.exitError.message)}),this.process.on("exit",(H,re)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new e1("Claude Code process aborted by user");else{let le=this.getProcessExitError(H,re);le&&(this.exitError=le,jk(le.message))}}),this.ready=!this.abortController.signal.aborted}catch(e){throw this.ready=!1,e}}getProcessExitError(e,r){if(e!==0&&e!==null)return Error(`Claude Code process exited with code ${e}`);if(r)return Error(`Claude Code process terminated by signal ${r}`)}write(e){if(this.abortController.signal.aborted)throw new e1("Operation aborted");if(this.spawnResolve){this.pendingWrites.push(e);return}if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){jk("[ProcessTransport] Dropping write to ended stdin stream");return}if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);jk(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||jk("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${RRt(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new e1("Claude Code process aborted by user"):Error("Query closed before spawn")),this.processStdin&&(this.processStdin.end(),this.processStdin=void 0),this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0);for(let{handler:n}of this.exitListeners)this.process?.off("exit",n);this.exitListeners=[];let e=a(()=>{this.abortController.signal.aborted&&this.forwardedAbort.abort(this.abortController.signal.reason)},"$"),r=this.process;r&&!r.killed&&r.exitCode===null?(setTimeout((n,o)=>{if(n.exitCode!==null){o();return}if(process.platform==="win32"){setTimeout((s,c)=>{s.exitCode===null&&s.kill("SIGKILL"),c()},5e3,n,o).unref();return}n.kill("SIGTERM"),setTimeout(s=>{s.exitCode===null&&s.kill("SIGKILL")},5e3,n).unref(),o()},_el,r,e).unref(),r.once("exit",()=>pkt.delete(r))):r&&(pkt.delete(r),e()),this.ready=!1}isReady(){return this.ready}async*readMessages(){if(this.spawnPromise&&(await this.spawnPromise,this.spawnPromise=void 0),!this.processStdout)throw Error("ProcessTransport output stream not available");if(this.exitError)throw this.exitError;let e=(0,tso.createInterface)({input:this.processStdout}),r=this.process?(()=>{let n=this.process,o=a(()=>e.close(),"Y");return n.on("error",o),()=>n.off("error",o)})():void 0;this.exitError&&e.close();try{for await(let n of e)if(n.trim()){let o;try{o=CM(n)}catch{jk(`Non-JSON stdout: ${n}`);continue}yield o}if(this.exitError)throw this.exitError;await this.waitForExit()}catch(n){throw n}finally{r?.(),e.close()}}endInput(){if(this.spawnResolve){this.pendingEndInput=!0;return}this.processStdin&&this.processStdin.end()}getInputStream(){return this.processStdin}onExit(e){if(!this.process)return()=>{};let r=a((n,o)=>{let s=this.getProcessExitError(n,o);e(s)},"Q");return this.process.on("exit",r),this.exitListeners.push({callback:e,handler:r}),()=>{this.process&&this.process.off("exit",r);let n=this.exitListeners.findIndex(o=>o.handler===r);n!==-1&&this.exitListeners.splice(n,1)}}async waitForExit(){if(!this.process){if(this.exitError)throw this.exitError;return}if(this.process.exitCode!==null||this.process.killed||this.exitError){if(this.exitError)throw this.exitError;return}return new Promise((e,r)=>{let n=a((s,c)=>{if(this.abortController.signal.aborted){r(new e1("Operation aborted"));return}let l=this.getProcessExitError(s,c);l?r(l):e()},"J");this.process.once("exit",n);let o=a(s=>{this.process.off("exit",n),r(s)},"Y");this.process.once("error",o),this.process.once("exit",()=>{this.process.off("error",o)})})}};a(Cel,"fx");a(bel,"gx");wCe="@anthropic-ai/claude-agent-sdk";a(Sel,"ux");a(Tel,"F2");hkt=class{static{a(this,"hQ")}returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(e){this.returned=e}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){return this.queue.length>0?Promise.resolve({done:!1,value:this.queue.shift()}):this.isDone?Promise.resolve({done:!0,value:void 0}):this.hasError?Promise.reject(this.hasError):new Promise((e,r)=>{this.readResolve=e,this.readReject=r})}enqueue(e){if(this.readResolve){let r=this.readResolve;this.readResolve=void 0,this.readReject=void 0,r({done:!1,value:e})}else this.queue.push(e)}done(){if(this.isDone=!0,this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!0,value:void 0})}}error(e){if(this.hasError=e,this.readReject){let r=this.readReject;this.readResolve=void 0,this.readReject=void 0,r(e)}}return(){return this.isDone=!0,this.returned&&this.returned(),Promise.resolve({done:!0,value:void 0})}};a(Iel,"mx");xel=Iel();a(zqr,"BX");a(fao,"AU");a(pao,"IU");a(wel,"Z2");a(I9,"I4");xQr=class{static{a(this,"RU")}sendMcpMessage;isClosed=!1;constructor(e){this.sendMcpMessage=e}onclose;onerror;onmessage;async start(){}async send(e){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(e)}async close(){this.isClosed||(this.isClosed=!0,this.onclose?.())}},wQr=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new hkt;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;transcriptMirrorBatcher;cleanupCallbacks=[];cleanupPromise;setIsSingleUserTurn(e){this.isSingleUserTurn=e}setTranscriptMirrorBatcher(e){this.transcriptMirrorBatcher=e}reportMirrorError(e,r){let n={type:"system",subtype:"mirror_error",error:r,key:e,uuid:(0,dkt.randomUUID)(),session_id:e.sessionId};this.inputStream.enqueue(n)}addCleanupCallback(e){this.cleanupPerformed?e():this.cleanupCallbacks.push(e)}isClosed(){return this.cleanupPerformed}hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0||this.getOAuthToken!==void 0||this.getHostAuthToken!==void 0}constructor(e,r,n,o,s,c=new Map,l,u,d,f,h){this.transport=e,this.isSingleUserTurn=r,this.canUseTool=n,this.hooks=o,this.abortController=s,this.jsonSchema=l,this.initConfig=u,this.onElicitation=d,this.getOAuthToken=f,this.getHostAuthToken=h;for(let[m,g]of c)this.connectSdkMcpServer(m,g);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(e){this.inputStream.error(e)}async stopTask(e){await this.request({subtype:"stop_task",task_id:e})}async backgroundTasks(e){return(await this.request({subtype:"background_tasks",tool_use_id:e})).response.backgrounded??!0}close(){this.cleanup()}cleanup(e){return this.cleanupPromise?this.cleanupPromise:(this.cleanupPerformed=!0,this.cleanupPromise=this.performCleanup(e),this.cleanupPromise)}async performCleanup(e){for(let r of this.cleanupCallbacks)try{r()}catch{}if(this.cleanupCallbacks=[],this.transcriptMirrorBatcher)try{await this.transcriptMirrorBatcher.flush()}catch{}try{for(let n of this.cancelControllers.values())n.abort();this.cancelControllers.clear(),this.transport.close();let r=e??Error("Query closed before response received");for(let{reject:n}of this.pendingControlResponses.values())n(r);this.pendingControlResponses.clear();for(let{reject:n}of this.pendingMcpResponses.values())n(r);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let n of this.sdkMcpTransports.values())n.close().catch(()=>{});this.sdkMcpTransports.clear(),e?this.inputStream.error(e):this.inputStream.done()}catch{}}next(...[e]){return this.sdkMessages.next(e)}async return(e){return await this.cleanup(),this.sdkMessages.return(e)}async throw(e){return await this.cleanup(),this.sdkMessages.throw(e)}[Symbol.asyncIterator](){return this.sdkMessages}async[Symbol.asyncDispose](){await this.cleanup()}async readMessages(){try{for await(let e of this.transport.readMessages()){if(e.type==="control_response"){let r=this.pendingControlResponses.get(e.response.request_id);r&&r.handler(e.response);continue}else if(e.type==="control_request"){this.handleControlRequest(e);continue}else if(e.type==="control_cancel_request"){this.handleControlCancelRequest(e);continue}else{if(e.type==="keep_alive")continue;if(e.type==="transcript_mirror"){this.transcriptMirrorBatcher?.enqueue(e.filePath,e.entries);continue}}if(e.type==="system"&&(e.subtype==="post_turn_summary"||e.subtype==="task_summary")){this.inputStream.enqueue(e);continue}e.type==="result"?(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.lastErrorResultText=e.is_error?e.subtype==="success"?e.result:e.errors.join("; "):void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.isSingleUserTurn&&(hu("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput())):e.type==="system"&&e.subtype==="session_state_changed"||(this.lastErrorResultText=void 0),this.inputStream.enqueue(e)}this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.inputStream.done(),this.cleanup()}catch(e){if(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.lastErrorResultText!==void 0&&!(e instanceof e1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);hu(`[Query.readMessages] Replacing exit error with result text. Original: ${RRt(e)}`),this.inputStream.error(r),this.cleanup(r);return}this.inputStream.error(e),this.cleanup(e)}}async handleControlRequest(e){let r=new AbortController;this.cancelControllers.set(e.request_id,r);try{let n=await this.processControlRequest(e,r.signal);if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"success",request_id:e.request_id,response:n}};await Promise.resolve(this.transport.write(Xm(o)+` -`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:RRt(n)}};try{await Promise.resolve(this.transport.write(Xm(o)+` -`))}catch(s){hu(`[Query.handleControlRequest] Error-response write failed: ${RRt(s)}`,{level:"error"})}}finally{this.cancelControllers.delete(e.request_id)}}handleControlCancelRequest(e){let r=this.cancelControllers.get(e.request_id);r&&(r.abort(),this.cancelControllers.delete(e.request_id))}async processControlRequest(e,r){if(e.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(e.request.tool_name,e.request.input,{signal:r,suggestions:e.request.permission_suggestions,blockedPath:e.request.blocked_path,decisionReason:e.request.decision_reason,title:e.request.title,displayName:e.request.display_name,description:e.request.description,toolUseID:e.request.tool_use_id,agentID:e.request.agent_id}),toolUseID:e.request.tool_use_id}}else{if(e.request.subtype==="hook_callback")return await this.handleHookCallbacks(e.request.callback_id,e.request.input,e.request.tool_use_id,r);if(e.request.subtype==="mcp_message"){let n=e.request,o=this.sdkMcpTransports.get(n.server_name);if(!o)throw Error(`SDK MCP server not found: ${n.server_name}`);return"method"in n.message&&"id"in n.message&&n.message.id!==null?{mcp_response:await this.handleMcpControlRequest(n.server_name,n,o)}:(o.onmessage&&o.onmessage(n.message),{mcp_response:{jsonrpc:"2.0",result:{},id:0}})}else if(e.request.subtype==="elicitation"){let n=e.request;return this.onElicitation?await this.onElicitation({serverName:n.mcp_server_name,message:n.message,mode:n.mode,url:n.url,elicitationId:n.elicitation_id,requestedSchema:n.requested_schema,title:n.title,displayName:n.display_name,description:n.description},{signal:r}):{action:"decline"}}else if(e.request.subtype==="oauth_token_refresh"){if(!this.getOAuthToken)throw Error("getOAuthToken callback is not provided.");return{accessToken:await this.getOAuthToken({signal:r})??null}}else if(e.request.subtype==="host_auth_token_refresh"){if(!this.getHostAuthToken)throw Error("getHostAuthToken callback is not provided.");return{authToken:await this.getHostAuthToken({signal:r})??null}}}throw Error("Unsupported control request subtype: "+e.request.subtype)}async*readSdkMessages(){try{for await(let e of this.inputStream)yield e}finally{await this.cleanup()}}async initialize(){let e;if(this.hooks){e={};for(let[o,s]of Object.entries(this.hooks))s.length>0&&(e[o]=s.map(c=>{let l=[];for(let u of c.hooks){let d=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(d,u),l.push(d)}return{matcher:c.matcher,hookCallbackIds:l,timeout:c.timeout}}))}let r=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,n={subtype:"initialize",hooks:e,sdkMcpServers:r,jsonSchema:this.jsonSchema,systemPrompt:typeof this.initConfig?.systemPrompt=="string"?[this.initConfig.systemPrompt]:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,planModeInstructions:this.initConfig?.planModeInstructions,appendSubagentSystemPrompt:this.initConfig?.appendSubagentSystemPrompt,toolAliases:this.initConfig?.toolAliases,excludeDynamicSections:this.initConfig?.excludeDynamicSections,agents:this.initConfig?.agents,title:this.initConfig?.title,skills:Array.isArray(this.initConfig?.skills)?this.initConfig.skills:void 0,webSearchIsolationExemptMcpServers:this.initConfig?.webSearchIsolationExemptMcpServers,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries,forwardSubagentText:this.initConfig?.forwardSubagentText};return(await this.request(n)).response}async interrupt(){return I9("sdk_interrupt",async()=>{await this.request({subtype:"interrupt"})})}async setPermissionMode(e){await this.request({subtype:"set_permission_mode",mode:e})}async setModel(e){await this.request({subtype:"set_model",model:e})}async setMaxThinkingTokens(e){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:e})}async applyFlagSettings(e){return I9("sdk_apply_flag_settings",async()=>{await this.request({subtype:"apply_flag_settings",settings:e})})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async rewindFiles(e,r){return I9("sdk_rewind_files",async()=>(await this.request({subtype:"rewind_files",user_message_id:e,dry_run:r?.dryRun})).response)}async cancelAsyncMessage(e){return(await this.request({subtype:"cancel_async_message",message_uuid:e})).response.cancelled}async seedReadState(e,r){await this.request({subtype:"seed_read_state",path:e,mtime:r})}async enableRemoteControl(e,r){return(await this.request({subtype:"remote_control",enabled:e,...r!==void 0&&{name:r}})).response}async submitFeedback(e,r){return(await this.request({subtype:"submit_feedback",description:e,surface:r?.surface})).response}async generateSessionTitle(e,r){return I9("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return I9("sdk_side_question",async()=>{let r=(await this.request({subtype:"side_question",question:e})).response;return r.response===null?null:{response:r.response,synthetic:r.synthetic??!1}})}async launchUltrareview(e,r){return(await this.request({subtype:"ultrareview_launch",args:e,confirm:r?.confirm??!1})).response}async messageRated(e){await this.request({subtype:"message_rated",messageUuid:e.messageUuid,sentiment:e.sentiment,surface:e.surface,cleared:e.cleared??!1})}processPendingPermissionRequests(e){for(let r of e)r.request.subtype==="can_use_tool"&&this.handleControlRequest(r).catch(()=>{})}request(e){let r=Math.random().toString(36).substring(2,15),n={request_id:r,type:"control_request",request:e};return new Promise((o,s)=>{this.pendingControlResponses.set(r,{handler:a(c=>{this.pendingControlResponses.delete(r),c.subtype==="success"?o(c):(s(Error(c.error)),c.pending_permission_requests&&this.processPendingPermissionRequests(c.pending_permission_requests))},"handler"),reject:s}),Promise.resolve(this.transport.write(Xm(n)+` -`)).catch(c=>{this.pendingControlResponses.delete(r),s(c)})})}initializationResult(){return this.initialization}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(e){await this.request({subtype:"mcp_reconnect",serverName:e})}async toggleMcpServer(e,r){return I9("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return I9("sdk_mcp_enable_channel",async()=>{await this.request({subtype:"channel_enable",serverName:e})})}async mcpAuthenticate(e,r){return(await this.request({subtype:"mcp_authenticate",serverName:e,redirectUri:r})).response}async mcpClearAuth(e){return(await this.request({subtype:"mcp_clear_auth",serverName:e})).response}async mcpSubmitOAuthCallbackUrl(e,r){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:e,callbackUrl:r})).response}async claudeAuthenticate(e){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:e})).response}async claudeOAuthCallback(e,r){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:e,state:r})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(){return(await this.request({subtype:"get_context_usage"})).response}async readFile(e,r){try{return(await this.request({subtype:"read_file",path:e,max_bytes:r?.maxBytes,encoding:r?.encoding})).response}catch{return null}}async reloadPlugins(){return I9("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return I9("sdk_mcp_set_servers",async()=>{let r={},n={};for(let[l,u]of Object.entries(e))u.type==="sdk"&&"instance"in u?r[l]=u.instance:n[l]=u;let o=new Set(this.sdkMcpServerInstances.keys()),s=new Set(Object.keys(r));for(let l of o)s.has(l)||await this.disconnectSdkMcpServer(l);for(let[l,u]of Object.entries(r))o.has(l)||this.connectSdkMcpServer(l,u);let c={};for(let l of Object.keys(r))c[l]={type:"sdk",name:l};return(await this.request({subtype:"mcp_set_servers",servers:{...n,...c}})).response})}async accountInfo(){return(await this.initialization).account}async streamInput(e){hu("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,hu(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(Xm(n)+` -`))}hu(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(hu("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),hu("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof e1))throw r}}waitForFirstResult(){return this.firstResultReceived?(hu("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve()):new Promise(e=>{if(this.abortController?.signal.aborted){e();return}this.abortController?.signal.addEventListener("abort",()=>e(),{once:!0}),this.firstResultReceivedResolve=e})}handleHookCallbacks(e,r,n,o){let s=this.hookCallbacks.get(e);if(!s)throw Error(`No hook callback found for ID: ${e}`);return s(r,n,{signal:o})}connectSdkMcpServer(e,r){let n=new xQr(o=>this.sendMcpServerMessageToCli(e,o));this.sdkMcpTransports.set(e,n),this.sdkMcpServerInstances.set(e,r),r.connect(n).catch(o=>{this.sdkMcpTransports.get(e)===n&&this.sdkMcpTransports.delete(e),this.sdkMcpServerInstances.get(e)===r&&this.sdkMcpServerInstances.delete(e),hu(`[Query.connectSdkMcpServer] Failed to connect MCP server '${e}': ${o}`,{level:"error"})})}async disconnectSdkMcpServer(e){let r=this.sdkMcpTransports.get(e);r&&(await r.close(),this.sdkMcpTransports.delete(e)),this.sdkMcpServerInstances.delete(e)}sendMcpServerMessageToCli(e,r){if("id"in r&&r.id!==null&&r.id!==void 0){let o=`${e}:${r.id}`,s=this.pendingMcpResponses.get(o);if(s){s.resolve(r),this.pendingMcpResponses.delete(o);return}}let n={type:"control_request",request_id:(0,dkt.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write(Xm(n)+` -`)).catch(o=>{hu(`[Query.sendMcpServerMessageToCli] Transport write failed: ${o}`,{level:"error"})})}handleMcpControlRequest(e,r,n){let o="id"in r.message?r.message.id:null,s=`${e}:${o}`;return new Promise((c,l)=>{let u=a(()=>{this.pendingMcpResponses.delete(s)},"U"),d=a(h=>{u(),c(h)},"H"),f=a(h=>{u(),l(h)},"q");if(this.pendingMcpResponses.set(s,{resolve:d,reject:f}),n.onmessage)n.onmessage(r.message);else{u(),l(Error("No message handler registered"));return}})}},Yqr=500,Kqr=1048576,Rel=[200,800],RQr=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=Yqr,s=Kqr,c=Rel){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=Xm(r).length;this.pending.push({filePath:e,entries:r,bytes:n}),this.pendingEntries+=r.length,this.pendingBytes+=n,(this.pendingEntries>this.maxPendingEntries||this.pendingBytes>this.maxPendingBytes)&&(this.flushPromise=this.drain(),this.flushPromise.catch(()=>{}))}async flush(){let e=this.drain();this.flushPromise=e,await e,this.flushPromise===e&&(this.flushPromise=null)}async drain(){let e=this.flushPromise,r=this.pending.splice(0);this.pendingEntries=0,this.pendingBytes=0,e&&await e,r.length!==0&&await this.doFlush(r)}async doFlush(e){let r=new Map;for(let o of e){let s=r.get(o.filePath);s?s.push(...o.entries):r.set(o.filePath,o.entries.slice())}let n=this.backoffMs.length+1;for(let[o,s]of r){let c=`SessionStore.append() timed out after ${this.sendTimeoutMs}ms for ${o}`,l,u=1;for(;u<=n;u++)try{await qoe(this.send(o,s),this.sendTimeoutMs,c),l=void 0;break}catch(d){if(l=bUe(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await Zoo(f)}if(l){hu(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){hu(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},Aio=_qr(JVc(),1);a(kel,"Ug");a(G6e,"O0");a(Pel,"qg");F7r=new Map,Del=5e3;a(Nel,"Bg");a(Mel,"zg");a(Oel,"OZ");Lel=(0,Aao.promisify)(gao.execFile);a(TUe,"m4");a(Bel,"jH");k9=65536,Fel=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(Uh,"L$");a(Eao,"ZZ");a(U7r,"IX");a(Hk,"A6");a(PQr,"rQ");a(vao,"RX");a(Uel,"MZ");a(Cao,"PX");X6e=200;a(Qel,"Lg");a(IUe,"F0");a(lz,"U4");a(qel,"jg");a(xUe,"M1");a(mM,"j6");a(fPt,"L1");jel=1048576,Hel=5242880;a($el,"Rg");a(bao,"jZ");a(Goe,"D0");a(mkt,"jX");gkt=Buffer.from('{"type":"attribution-snapshot"'),Vel=Buffer.from('{"type":"system"'),eUe=10,Wel=Buffer.from([eUe]),zel=256;a(Yel,"_g");a(Kel,"kg");a(Jel,"Sg");a(Zel,"vg");a(Xel,"Cg");a(etl,"AZ");a(ttl,"xg");a(rtl,"yg");a(ntl,"fg");a(Q7r,"IH");a(itl,"gg");a(otl,"hg");a(stl,"ug");a(Sao,"RH");a(Tao,"PH");a(atl,"IZ");a(Iao,"RZ");a(ctl,"PZ");a(pPt,"k8");a(F6e,"oQ");a(xao,"EZ");ltl=32;a(utl,"pg");a(dtl,"dg");a(ftl,"ig");a(ptl,"ng");a(htl,"rg");a(mtl,"bZ");a(gtl,"_Z");a(Atl,"CZ");a(ytl,"TZ");a(_tl,"xZ");a(Etl,"ag");a(wao,"yZ");a(q7r,"_H");a(vtl,"sg");Ctl=new Set(["user","assistant","attachment","system","progress"]);a(btl,"$h");a(Stl,"Qh");a(Rao,"fZ");a(Ttl,"gZ");a(Itl,"Jh");a(xtl,"hZ");a(wtl,"Xh");a(kao,"uZ");a(Pao,"lZ");a(Dao,"cZ");a(Rtl,"Wh");a(ktl,"Gh");a(Ptl,"pZ");a(Dtl,"dZ");a(Nao,"vH");a(Lao,"CH");a(Bao,"bX");a(Ntl,"Uh");Mtl="user:inference",Fao="user:profile",Otl="org:create_api_key",Ltl=[Otl,Fao],Btl=[Fao,Mtl,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],xfm=Bao([...Ltl,...Btl]),yio={BASE_API_URL:"https://api.anthropic.com",CONSOLE_AUTHORIZE_URL:"https://platform.claude.com/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"https://claude.com/cai/oauth/authorize",CLAUDE_AI_ORIGIN:"https://claude.ai",TOKEN_URL:"https://platform.claude.com/v1/oauth/token",API_KEY_URL:"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",ROLES_URL:"https://api.anthropic.com/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"https://platform.claude.com/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://platform.claude.com/oauth/code/callback",CLIENT_ID:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",OAUTH_FILE_SUFFIX:"",MCP_PROXY_URL:"https://mcp-proxy.anthropic.com",MCP_PROXY_PATH:"/v1/mcp/{server_id}"},Ftl=void 0;a(Utl,"zh");Qtl=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(qtl,"rZ");jtl="-credentials";a(Htl,"tZ");Gtl=/^[a-zA-Z0-9._-]+$/;a($tl,"aZ");(function(t){t.assertEqual=o=>{};function e(o){}a(e,"Q"),t.assertIs=e;function r(o){throw Error()}a(r,"J"),t.assertNever=r,t.arrayToEnum=o=>{let s={};for(let c of o)s[c]=c;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),c={};for(let l of s)c[l]=o[l];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let c in o)Object.prototype.hasOwnProperty.call(o,c)&&s.push(c);return s},t.find=(o,s)=>{for(let c of o)if(s(c))return c},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}a(n,"Y"),t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(bc||(bc={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(_io||(_io={}));Dn=bc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),KW=a(t=>{switch(typeof t){case"undefined":return Dn.undefined;case"string":return Dn.string;case"number":return Number.isNaN(t)?Dn.nan:Dn.number;case"boolean":return Dn.boolean;case"function":return Dn.function;case"bigint":return Dn.bigint;case"symbol":return Dn.symbol;case"object":return Array.isArray(t)?Dn.array:t===null?Dn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Dn.promise:typeof Map<"u"&&t instanceof Map?Dn.map:typeof Set<"u"&&t instanceof Set?Dn.set:typeof Date<"u"&&t instanceof Date?Dn.date:Dn.object;default:return Dn.unknown}},"l4"),yr=bc.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Wk=class t extends Error{static{a(this,"f6")}get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;ur.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];r[s]=r[s]||[],r[s].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Wk.create=t=>new Wk(t);Vtl=a((t,e)=>{let r;switch(t.code){case yr.invalid_type:t.received===Dn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case yr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,bc.jsonStringifyReplacer)}`;break;case yr.unrecognized_keys:r=`Unrecognized key(s) in object: ${bc.joinValues(t.keys,", ")}`;break;case yr.invalid_union:r="Invalid input";break;case yr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${bc.joinValues(t.options)}`;break;case yr.invalid_enum_value:r=`Invalid enum value. Expected ${bc.joinValues(t.options)}, received '${t.received}'`;break;case yr.invalid_arguments:r="Invalid function arguments";break;case yr.invalid_return_type:r="Invalid function return type";break;case yr.invalid_date:r="Invalid date";break;case yr.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:bc.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case yr.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case yr.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case yr.custom:r="Invalid input";break;case yr.invalid_intersection_types:r="Intersection results could not be merged";break;case yr.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case yr.not_finite:r="Number must be finite";break;default:r=e.defaultError,bc.assertNever(t)}return{message:r}},"Fh"),rUe=Vtl,Wtl=rUe;a(NQr,"tQ");MQr=a(t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],c={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let l="",u=n.filter(d=>!!d).slice().reverse();for(let d of u)l=d(c,{data:e,defaultError:l}).message;return{...o,path:s,message:l}},"_X");a(hn,"f");yC=class t{static{a(this,"U6")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return io;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let s=await o.key,c=await o.value;n.push({key:s,value:c})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:c}=o;if(s.status==="aborted"||c.status==="aborted")return io;s.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(n[s.value]=c.value)}return{status:e.value,value:n}}},io=Object.freeze({status:"aborted"}),Q6e=a(t=>({status:"dirty",value:t}),"v8"),r1=a(t=>({status:"valid",value:t}),"z6"),Eio=a(t=>t.status==="aborted","TH"),vio=a(t=>t.status==="dirty","xH"),WCe=a(t=>t.status==="valid","Z0"),_kt=a(t=>typeof Promise<"u"&&t instanceof Promise,"aQ");(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ei||(ei={}));Yk=class{static{a(this,"H4")}constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Cio=a((t,e)=>{if(WCe(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Wk(t.common.issues);return this._error=r,this._error}}},"eZ");a(ns,"e");Us=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return KW(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:KW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new yC,ctx:{common:e.parent.common,data:e.data,parsedType:KW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(_kt(r))throw Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:KW(e)},o=this._parseSync({data:e,path:n.path,parent:n});return Cio(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:KW(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return WCe(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>WCe(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:KW(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(_kt(o)?o:Promise.resolve(o));return Cio(n,s)}refine(e,r){let n=a(o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r,"J");return this._refinement((o,s)=>{let c=e(o),l=a(()=>s.addIssue({code:yr.custom,...n(o)}),"G");return typeof Promise<"u"&&c instanceof Promise?c.then(u=>u?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new yM({schema:this,typeName:wr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a(r=>this["~validate"](r),"validate")}}optional(){return zk.create(this,this._def)}nullable(){return O9.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sz.create(this)}promise(){return Joe.create(this,this._def)}or(e){return JCe.create([this,e],this._def)}and(e){return ZCe.create(this,e,this._def)}transform(e){return new yM({...ns(this._def),schema:this,typeName:wr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new nbe({...ns(this._def),innerType:this,defaultValue:r,typeName:wr.ZodDefault})}brand(){return new Ekt({typeName:wr.ZodBranded,type:this,...ns(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new ibe({...ns(this._def),innerType:this,catchValue:r,typeName:wr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return vkt.create(this,e)}readonly(){return obe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ztl=/^c[^\s-]{8,}$/i,Ytl=/^[0-9a-z]+$/,Ktl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Jtl=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ztl=/^[a-z0-9_-]{21}$/i,Xtl=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,erl=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,trl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rrl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",nrl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,irl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,orl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,srl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,arl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,crl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Uao="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",lrl=new RegExp(`^${Uao}$`);a(Qao,"QM");a(url,"yh");a(drl,"fh");a(frl,"gh");a(prl,"hh");a(hrl,"uh");zCe=class t extends Us{static{a(this,"p4")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Dn.string){let o=this._getOrReturnCtx(e);return hn(o,{code:yr.invalid_type,expected:Dn.string,received:o.parsedType}),io}let r=new yC,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),hn(n,{code:yr.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,c=e.data.lengthe.test(o),{validation:r,code:yr.invalid_string,...ei.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ei.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ei.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ei.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ei.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ei.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ei.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ei.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ei.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ei.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ei.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ei.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ei.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ei.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...ei.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ei.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ei.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ei.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ei.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ei.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ei.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ei.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ei.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ei.errToObj(r)})}nonempty(e){return this.min(1,ei.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew zCe({checks:[],typeName:wr.ZodString,coerce:t?.coerce??!1,...ns(t)});a(mrl,"mh");nUe=class t extends Us{static{a(this,"T8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Dn.number){let o=this._getOrReturnCtx(e);return hn(o,{code:yr.invalid_type,expected:Dn.number,received:o.parsedType}),io}let r,n=new yC;for(let o of this._def.checks)o.kind==="int"?bc.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),hn(r,{code:yr.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),hn(r,{code:yr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?mrl(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),hn(r,{code:yr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),hn(r,{code:yr.not_finite,message:o.message}),n.dirty()):bc.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ei.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ei.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ei.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ei.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ei.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ei.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ei.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ei.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ei.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ei.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ei.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ei.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ei.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ei.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuee.kind==="int"||e.kind==="multipleOf"&&bc.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.valuenew nUe({checks:[],typeName:wr.ZodNumber,coerce:t?.coerce||!1,...ns(t)});iUe=class t extends Us{static{a(this,"x8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Dn.bigint)return this._getInvalidInput(e);let r,n=new yC;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),hn(r,{code:yr.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),hn(r,{code:yr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):bc.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.bigint,received:r.parsedType}),io}gte(e,r){return this.setLimit("min",e,!0,ei.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ei.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ei.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ei.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ei.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ei.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ei.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ei.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ei.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ei.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew iUe({checks:[],typeName:wr.ZodBigInt,coerce:t?.coerce??!1,...ns(t)});oUe=class extends Us{static{a(this,"kX")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Dn.boolean){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.boolean,received:r.parsedType}),io}return r1(e.data)}};oUe.create=t=>new oUe({typeName:wr.ZodBoolean,coerce:t?.coerce||!1,...ns(t)});sUe=class t extends Us{static{a(this,"eQ")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Dn.date){let o=this._getOrReturnCtx(e);return hn(o,{code:yr.invalid_type,expected:Dn.date,received:o.parsedType}),io}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return hn(o,{code:yr.invalid_date}),io}let r=new yC,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),hn(n,{code:yr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):bc.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ei.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ei.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew sUe({checks:[],coerce:t?.coerce||!1,typeName:wr.ZodDate,...ns(t)});aUe=class extends Us{static{a(this,"SX")}_parse(e){if(this._getType(e)!==Dn.symbol){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.symbol,received:r.parsedType}),io}return r1(e.data)}};aUe.create=t=>new aUe({typeName:wr.ZodSymbol,...ns(t)});YCe=class extends Us{static{a(this,"$7")}_parse(e){if(this._getType(e)!==Dn.undefined){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.undefined,received:r.parsedType}),io}return r1(e.data)}};YCe.create=t=>new YCe({typeName:wr.ZodUndefined,...ns(t)});KCe=class extends Us{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==Dn.null){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.null,received:r.parsedType}),io}return r1(e.data)}};KCe.create=t=>new KCe({typeName:wr.ZodNull,...ns(t)});cUe=class extends Us{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return r1(e.data)}};cUe.create=t=>new cUe({typeName:wr.ZodAny,...ns(t)});rz=class extends Us{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return r1(e.data)}};rz.create=t=>new rz({typeName:wr.ZodUnknown,...ns(t)});xB=class extends Us{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.never,received:r.parsedType}),io}};xB.create=t=>new xB({typeName:wr.ZodNever,...ns(t)});lUe=class extends Us{static{a(this,"CX")}_parse(e){if(this._getType(e)!==Dn.undefined){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.void,received:r.parsedType}),io}return r1(e.data)}};lUe.create=t=>new lUe({typeName:wr.ZodVoid,...ns(t)});sz=class t extends Us{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==Dn.array)return hn(r,{code:yr.invalid_type,expected:Dn.array,received:r.parsedType}),io;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(hn(r,{code:yr.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>o.type._parseAsync(new Yk(r,c,r.path,l)))).then(c=>yC.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new Yk(r,c,r.path,l)));return yC.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:ei.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:ei.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:ei.toString(r)}})}nonempty(e){return this.min(1,e)}};sz.create=(t,e)=>new sz({type:t,minLength:null,maxLength:null,exactLength:null,typeName:wr.ZodArray,...ns(e)});a(DCe,"C8");sx=class t extends Us{static{a(this,"g$")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=bc.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==Dn.object){let u=this._getOrReturnCtx(e);return hn(u,{code:yr.invalid_type,expected:Dn.object,received:u.parsedType}),io}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof xB&&this._def.unknownKeys==="strip"))for(let u in n.data)s.includes(u)||c.push(u);let l=[];for(let u of s){let d=o[u],f=n.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Yk(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof xB){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")c.length>0&&(hn(n,{code:yr.unrecognized_keys,keys:c}),r.dirty());else if(u!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of c){let f=n.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Yk(n,f,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of l){let f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>yC.mergeObjectSync(r,u)):yC.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ei.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:a((r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:ei.errToObj(e).message??o}:{message:o}},"errorMap")}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:a(()=>({...this._def.shape(),...e}),"shape")})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:a(()=>({...this._def.shape(),...e._def.shape()}),"shape"),typeName:wr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of bc.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}omit(e){let r={};for(let n of bc.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return DCe(this)}partial(e){let r={};for(let n of bc.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new t({...this._def,shape:a(()=>r,"shape")})}required(e){let r={};for(let n of bc.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof zk;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return qao(bc.objectKeys(this.shape))}};sx.create=(t,e)=>new sx({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:xB.create(),typeName:wr.ZodObject,...ns(e)});sx.strictCreate=(t,e)=>new sx({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:xB.create(),typeName:wr.ZodObject,...ns(e)});sx.lazycreate=(t,e)=>new sx({shape:t,unknownKeys:"strip",catchall:xB.create(),typeName:wr.ZodObject,...ns(e)});JCe=class extends Us{static{a(this,"J7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new Wk(l.ctx.common.issues));return hn(r,{code:yr.invalid_union,unionErrors:c}),io}if(a(o,"Y"),r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(o);{let s,c=[];for(let u of n){let d={...r,common:{...r.common,issues:[]},parent:null},f=u._parseSync({data:r.data,path:r.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(u=>new Wk(u));return hn(r,{code:yr.invalid_union,unionErrors:l}),io}}get options(){return this._def.options}};JCe.create=(t,e)=>new JCe({options:t,typeName:wr.ZodUnion,...ns(e)});x9=a(t=>t instanceof XCe?x9(t.schema):t instanceof yM?x9(t.innerType()):t instanceof ebe?[t.value]:t instanceof tbe?t.options:t instanceof rbe?bc.objectValues(t.enum):t instanceof nbe?x9(t._def.innerType):t instanceof YCe?[void 0]:t instanceof KCe?[null]:t instanceof zk?[void 0,...x9(t.unwrap())]:t instanceof O9?[null,...x9(t.unwrap())]:t instanceof Ekt||t instanceof obe?x9(t.unwrap()):t instanceof ibe?x9(t._def.innerType):[],"c4"),OQr=class t extends Us{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Dn.object)return hn(r,{code:yr.invalid_type,expected:Dn.object,received:r.parsedType}),io;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(hn(r,{code:yr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),io)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let c=x9(s.shape[e]);if(!c.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let l of c){if(o.has(l))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);o.set(l,s)}}return new t({typeName:wr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...ns(n)})}};a(LQr,"fH");ZCe=class extends Us{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(Eio(s)||Eio(c))return io;let l=LQr(s.value,c.value);return l.valid?((vio(s)||vio(c))&&r.dirty(),{status:r.value,value:l.data}):(hn(n,{code:yr.invalid_intersection_types}),io)},"Y");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>o(s,c)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ZCe.create=(t,e,r)=>new ZCe({left:t,right:e,typeName:wr.ZodIntersection,...ns(r)});M9=class t extends Us{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Dn.array)return hn(n,{code:yr.invalid_type,expected:Dn.array,received:n.parsedType}),io;if(n.data.lengththis._def.items.length&&(hn(n,{code:yr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new Yk(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>yC.mergeArray(r,s)):yC.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};M9.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new M9({items:t,typeName:wr.ZodTuple,rest:null,...ns(e)})};BQr=class t extends Us{static{a(this,"TX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Dn.object)return hn(n,{code:yr.invalid_type,expected:Dn.object,received:n.parsedType}),io;let o=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)o.push({key:s._parse(new Yk(n,l,n.path,l)),value:c._parse(new Yk(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?yC.mergeObjectAsync(r,o):yC.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Us?new t({keyType:e,valueType:r,typeName:wr.ZodRecord,...ns(n)}):new t({keyType:zCe.create(),valueType:e,typeName:wr.ZodRecord,...ns(r)})}},uUe=class extends Us{static{a(this,"xX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Dn.map)return hn(n,{code:yr.invalid_type,expected:Dn.map,received:n.parsedType}),io;let o=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,u],d)=>({key:o._parse(new Yk(n,l,n.path,[d,"key"])),value:s._parse(new Yk(n,u,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of c){let d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return io;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let u of c){let{key:d,value:f}=u;if(d.status==="aborted"||f.status==="aborted")return io;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}}}};uUe.create=(t,e,r)=>new uUe({valueType:e,keyType:t,typeName:wr.ZodMap,...ns(r)});dUe=class t extends Us{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Dn.set)return hn(n,{code:yr.invalid_type,expected:Dn.set,received:n.parsedType}),io;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(hn(n,{code:yr.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function c(u){let d=new Set;for(let f of u){if(f.status==="aborted")return io;f.status==="dirty"&&r.dirty(),d.add(f.value)}return{status:r.value,value:d}}a(c,"W");let l=[...n.data.values()].map((u,d)=>s._parse(new Yk(n,u,n.path,d)));return n.common.async?Promise.all(l).then(u=>c(u)):c(l)}min(e,r){return new t({...this._def,minSize:{value:e,message:ei.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:ei.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};dUe.create=(t,e)=>new dUe({valueType:t,minSize:null,maxSize:null,typeName:wr.ZodSet,...ns(e)});FQr=class t extends Us{static{a(this,"sQ")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Dn.function)return hn(r,{code:yr.invalid_type,expected:Dn.function,received:r.parsedType}),io;function n(l,u){return MQr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,NQr(),rUe].filter(d=>!!d),issueData:{code:yr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return MQr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,NQr(),rUe].filter(d=>!!d),issueData:{code:yr.invalid_return_type,returnTypeError:u}})}a(o,"Y");let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof Joe){let l=this;return r1(async function(...u){let d=new Wk([]),f=await l._def.args.parseAsync(u,s).catch(m=>{throw d.addIssue(n(u,m)),d}),h=await Reflect.apply(c,this,f);return await l._def.returns._def.type.parseAsync(h,s).catch(m=>{throw d.addIssue(o(h,m)),d})})}else{let l=this;return r1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new Wk([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new Wk([o(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:M9.create(e).rest(rz.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||M9.create([]).rest(rz.create()),returns:r||rz.create(),typeName:wr.ZodFunction,...ns(n)})}},XCe=class extends Us{static{a(this,"Y7")}get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};XCe.create=(t,e)=>new XCe({getter:t,typeName:wr.ZodLazy,...ns(e)});ebe=class extends Us{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return hn(r,{received:r.data,code:yr.invalid_literal,expected:this._def.value}),io}return{status:"valid",value:e.data}}get value(){return this._def.value}};ebe.create=(t,e)=>new ebe({value:t,typeName:wr.ZodLiteral,...ns(e)});a(qao,"JM");tbe=class t extends Us{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return hn(r,{expected:bc.joinValues(n),received:r.parsedType,code:yr.invalid_type}),io}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return hn(r,{received:r.data,code:yr.invalid_enum_value,options:n}),io}return r1(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};tbe.create=qao;rbe=class extends Us{static{a(this,"G7")}_parse(e){let r=bc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Dn.string&&n.parsedType!==Dn.number){let o=bc.objectValues(r);return hn(n,{expected:bc.joinValues(o),received:n.parsedType,code:yr.invalid_type}),io}if(this._cache||(this._cache=new Set(bc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=bc.objectValues(r);return hn(n,{received:n.data,code:yr.invalid_enum_value,options:o}),io}return r1(e.data)}get enum(){return this._def.values}};rbe.create=(t,e)=>new rbe({values:t,typeName:wr.ZodNativeEnum,...ns(e)});Joe=class extends Us{static{a(this,"f8")}unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Dn.promise&&r.common.async===!1)return hn(r,{code:yr.invalid_type,expected:Dn.promise,received:r.parsedType}),io;let n=r.parsedType===Dn.promise?r.data:Promise.resolve(r.data);return r1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Joe.create=(t,e)=>new Joe({type:t,typeName:wr.ZodPromise,...ns(e)});yM=class extends Us{static{a(this,"P4")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===wr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:a(c=>{hn(n,c),c.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let c=o.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async l=>{if(r.value==="aborted")return io;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?io:u.status==="dirty"||r.value==="dirty"?Q6e(u.value):u});{if(r.value==="aborted")return io;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?io:l.status==="dirty"||r.value==="dirty"?Q6e(l.value):l}}if(o.type==="refinement"){let c=a(l=>{let u=o.refinement(l,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"W");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?io:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?io:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(o.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!WCe(c))return io;let l=o.transform(c.value,s);if(l instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>WCe(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):io);bc.assertNever(o)}};yM.create=(t,e,r)=>new yM({schema:t,typeName:wr.ZodEffects,effect:e,...ns(r)});yM.createWithPreprocess=(t,e,r)=>new yM({schema:e,effect:{type:"preprocess",transform:t},typeName:wr.ZodEffects,...ns(r)});zk=class extends Us{static{a(this,"o6")}_parse(e){return this._getType(e)===Dn.undefined?r1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};zk.create=(t,e)=>new zk({innerType:t,typeName:wr.ZodOptional,...ns(e)});O9=class extends Us{static{a(this,"A1")}_parse(e){return this._getType(e)===Dn.null?r1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};O9.create=(t,e)=>new O9({innerType:t,typeName:wr.ZodNullable,...ns(e)});nbe=class extends Us{static{a(this,"U7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===Dn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};nbe.create=(t,e)=>new nbe({innerType:t,typeName:wr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ns(e)});ibe=class extends Us{static{a(this,"H7")}_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return _kt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Wk(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Wk(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ibe.create=(t,e)=>new ibe({innerType:t,typeName:wr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ns(e)});fUe=class extends Us{static{a(this,"yX")}_parse(e){if(this._getType(e)!==Dn.nan){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.nan,received:r.parsedType}),io}return{status:"valid",value:e.data}}};fUe.create=t=>new fUe({typeName:wr.ZodNaN,...ns(t)});Ekt=class extends Us{static{a(this,"hH")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},vkt=class t extends Us{static{a(this,"fX")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?io:o.status==="dirty"?(r.dirty(),Q6e(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?io:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:wr.ZodPipeline})}},obe=class extends Us{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(WCe(o)&&(o.value=Object.freeze(o.value)),o),"J");return _kt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};obe.create=(t,e)=>new obe({innerType:t,typeName:wr.ZodReadonly,...ns(e)});wfm={object:sx.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(wr||(wr={}));Rfm=zCe.create,kfm=nUe.create,Pfm=fUe.create,Dfm=iUe.create,Nfm=oUe.create,Mfm=sUe.create,Ofm=aUe.create,Lfm=YCe.create,Bfm=KCe.create,Ffm=cUe.create,Ufm=rz.create,Qfm=xB.create,qfm=lUe.create,jfm=sz.create,grl=sx.create,Hfm=sx.strictCreate,Gfm=JCe.create,$fm=OQr.create,Vfm=ZCe.create,Wfm=M9.create,zfm=BQr.create,Yfm=uUe.create,Kfm=dUe.create,Jfm=FQr.create,Zfm=XCe.create,Xfm=ebe.create,epm=tbe.create,tpm=rbe.create,rpm=Joe.create,npm=yM.create,ipm=zk.create,opm=O9.create,spm=yM.createWithPreprocess,apm=vkt.create,jao={};RB(jao,{version:a(()=>Xco,"version"),util:a(()=>Xs,"util"),treeifyError:a(()=>eco,"treeifyError"),toJSONSchema:a(()=>rHr,"toJSONSchema"),toDotPath:a(()=>tco,"toDotPath"),safeParseAsync:a(()=>_Pt,"safeParseAsync"),safeParse:a(()=>yPt,"safeParse"),registry:a(()=>vjr,"registry"),regexes:a(()=>ajr,"regexes"),prettifyError:a(()=>rco,"prettifyError"),parseAsync:a(()=>Tkt,"parseAsync"),parse:a(()=>Skt,"parse"),locales:a(()=>Ejr,"locales"),isValidJWT:a(()=>blo,"isValidJWT"),isValidBase64URL:a(()=>Elo,"isValidBase64URL"),isValidBase64:a(()=>djr,"isValidBase64"),globalRegistry:a(()=>P9,"globalRegistry"),globalConfig:a(()=>Ckt,"globalConfig"),function:a(()=>$uo,"function"),formatError:a(()=>rjr,"formatError"),flattenError:a(()=>tjr,"flattenError"),config:a(()=>_C,"config"),clone:a(()=>bM,"clone"),_xid:a(()=>Njr,"_xid"),_void:a(()=>kuo,"_void"),_uuidv7:a(()=>Ijr,"_uuidv7"),_uuidv6:a(()=>Tjr,"_uuidv6"),_uuidv4:a(()=>Sjr,"_uuidv4"),_uuid:a(()=>bjr,"_uuid"),_url:a(()=>xjr,"_url"),_uppercase:a(()=>Vjr,"_uppercase"),_unknown:a(()=>Rkt,"_unknown"),_union:a(()=>Ail,"_union"),_undefined:a(()=>Iuo,"_undefined"),_ulid:a(()=>Djr,"_ulid"),_uint64:a(()=>Suo,"_uint64"),_uint32:a(()=>yuo,"_uint32"),_tuple:a(()=>Uuo,"_tuple"),_trim:a(()=>Zjr,"_trim"),_transform:a(()=>Iil,"_transform"),_toUpperCase:a(()=>eHr,"_toUpperCase"),_toLowerCase:a(()=>Xjr,"_toLowerCase"),_templateLiteral:a(()=>Oil,"_templateLiteral"),_symbol:a(()=>Tuo,"_symbol"),_success:a(()=>Pil,"_success"),_stringbool:a(()=>Huo,"_stringbool"),_stringFormat:a(()=>Guo,"_stringFormat"),_string:a(()=>ouo,"_string"),_startsWith:a(()=>zjr,"_startsWith"),_size:a(()=>Hjr,"_size"),_set:a(()=>Cil,"_set"),_safeParseAsync:a(()=>sjr,"_safeParseAsync"),_safeParse:a(()=>ojr,"_safeParse"),_regex:a(()=>Gjr,"_regex"),_refine:a(()=>juo,"_refine"),_record:a(()=>Eil,"_record"),_readonly:a(()=>Mil,"_readonly"),_property:a(()=>Fuo,"_property"),_promise:a(()=>Bil,"_promise"),_positive:a(()=>Muo,"_positive"),_pipe:a(()=>Nil,"_pipe"),_parseAsync:a(()=>ijr,"_parseAsync"),_parse:a(()=>njr,"_parse"),_overwrite:a(()=>ise,"_overwrite"),_optional:a(()=>xil,"_optional"),_number:a(()=>fuo,"_number"),_nullable:a(()=>wil,"_nullable"),_null:a(()=>xuo,"_null"),_normalize:a(()=>Jjr,"_normalize"),_nonpositive:a(()=>Luo,"_nonpositive"),_nonoptional:a(()=>kil,"_nonoptional"),_nonnegative:a(()=>Buo,"_nonnegative"),_never:a(()=>Ruo,"_never"),_negative:a(()=>Ouo,"_negative"),_nativeEnum:a(()=>Sil,"_nativeEnum"),_nanoid:a(()=>Rjr,"_nanoid"),_nan:a(()=>Nuo,"_nan"),_multipleOf:a(()=>gUe,"_multipleOf"),_minSize:a(()=>AUe,"_minSize"),_minLength:a(()=>abe,"_minLength"),_min:a(()=>rx,"_min"),_mime:a(()=>Kjr,"_mime"),_maxSize:a(()=>vPt,"_maxSize"),_maxLength:a(()=>CPt,"_maxLength"),_max:a(()=>gM,"_max"),_map:a(()=>vil,"_map"),_lte:a(()=>gM,"_lte"),_lt:a(()=>Zoe,"_lt"),_lowercase:a(()=>$jr,"_lowercase"),_literal:a(()=>Til,"_literal"),_length:a(()=>bPt,"_length"),_lazy:a(()=>Lil,"_lazy"),_ksuid:a(()=>Mjr,"_ksuid"),_jwt:a(()=>jjr,"_jwt"),_isoTime:a(()=>uuo,"_isoTime"),_isoDuration:a(()=>duo,"_isoDuration"),_isoDateTime:a(()=>cuo,"_isoDateTime"),_isoDate:a(()=>luo,"_isoDate"),_ipv6:a(()=>Ljr,"_ipv6"),_ipv4:a(()=>Ojr,"_ipv4"),_intersection:a(()=>_il,"_intersection"),_int64:a(()=>buo,"_int64"),_int32:a(()=>Auo,"_int32"),_int:a(()=>huo,"_int"),_includes:a(()=>Wjr,"_includes"),_guid:a(()=>wkt,"_guid"),_gte:a(()=>rx,"_gte"),_gt:a(()=>Xoe,"_gt"),_float64:a(()=>guo,"_float64"),_float32:a(()=>muo,"_float32"),_file:a(()=>Quo,"_file"),_enum:a(()=>bil,"_enum"),_endsWith:a(()=>Yjr,"_endsWith"),_emoji:a(()=>wjr,"_emoji"),_email:a(()=>Cjr,"_email"),_e164:a(()=>qjr,"_e164"),_discriminatedUnion:a(()=>yil,"_discriminatedUnion"),_default:a(()=>Ril,"_default"),_date:a(()=>Puo,"_date"),_custom:a(()=>quo,"_custom"),_cuid2:a(()=>Pjr,"_cuid2"),_cuid:a(()=>kjr,"_cuid"),_coercedString:a(()=>suo,"_coercedString"),_coercedNumber:a(()=>puo,"_coercedNumber"),_coercedDate:a(()=>Duo,"_coercedDate"),_coercedBoolean:a(()=>Euo,"_coercedBoolean"),_coercedBigint:a(()=>Cuo,"_coercedBigint"),_cidrv6:a(()=>Fjr,"_cidrv6"),_cidrv4:a(()=>Bjr,"_cidrv4"),_catch:a(()=>Dil,"_catch"),_boolean:a(()=>_uo,"_boolean"),_bigint:a(()=>vuo,"_bigint"),_base64url:a(()=>Qjr,"_base64url"),_base64:a(()=>Ujr,"_base64"),_array:a(()=>tHr,"_array"),_any:a(()=>wuo,"_any"),TimePrecision:a(()=>auo,"TimePrecision"),NEVER:a(()=>Hao,"NEVER"),JSONSchemaGenerator:a(()=>yUe,"JSONSchemaGenerator"),JSONSchema:a(()=>Fil,"JSONSchema"),Doc:a(()=>Ikt,"Doc"),$output:a(()=>nuo,"$output"),$input:a(()=>iuo,"$input"),$constructor:a(()=>pt,"$constructor"),$brand:a(()=>Gao,"$brand"),$ZodXID:a(()=>llo,"$ZodXID"),$ZodVoid:a(()=>Nlo,"$ZodVoid"),$ZodUnknown:a(()=>xkt,"$ZodUnknown"),$ZodUnion:a(()=>Ajr,"$ZodUnion"),$ZodUndefined:a(()=>Rlo,"$ZodUndefined"),$ZodUUID:a(()=>tlo,"$ZodUUID"),$ZodURL:a(()=>nlo,"$ZodURL"),$ZodULID:a(()=>clo,"$ZodULID"),$ZodType:a(()=>So,"$ZodType"),$ZodTuple:a(()=>EPt,"$ZodTuple"),$ZodTransform:a(()=>yjr,"$ZodTransform"),$ZodTemplateLiteral:a(()=>Zlo,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>wlo,"$ZodSymbol"),$ZodSuccess:a(()=>zlo,"$ZodSuccess"),$ZodStringFormat:a(()=>Wu,"$ZodStringFormat"),$ZodString:a(()=>kUe,"$ZodString"),$ZodSet:a(()=>Ulo,"$ZodSet"),$ZodRegistry:a(()=>mUe,"$ZodRegistry"),$ZodRecord:a(()=>Blo,"$ZodRecord"),$ZodRealError:a(()=>wUe,"$ZodRealError"),$ZodReadonly:a(()=>Jlo,"$ZodReadonly"),$ZodPromise:a(()=>Xlo,"$ZodPromise"),$ZodPrefault:a(()=>Vlo,"$ZodPrefault"),$ZodPipe:a(()=>_jr,"$ZodPipe"),$ZodOptional:a(()=>Hlo,"$ZodOptional"),$ZodObject:a(()=>gjr,"$ZodObject"),$ZodNumberFormat:a(()=>Ilo,"$ZodNumberFormat"),$ZodNumber:a(()=>fjr,"$ZodNumber"),$ZodNullable:a(()=>Glo,"$ZodNullable"),$ZodNull:a(()=>klo,"$ZodNull"),$ZodNonOptional:a(()=>Wlo,"$ZodNonOptional"),$ZodNever:a(()=>Dlo,"$ZodNever"),$ZodNanoID:a(()=>olo,"$ZodNanoID"),$ZodNaN:a(()=>Klo,"$ZodNaN"),$ZodMap:a(()=>Flo,"$ZodMap"),$ZodLiteral:a(()=>qlo,"$ZodLiteral"),$ZodLazy:a(()=>euo,"$ZodLazy"),$ZodKSUID:a(()=>ulo,"$ZodKSUID"),$ZodJWT:a(()=>Slo,"$ZodJWT"),$ZodIntersection:a(()=>Llo,"$ZodIntersection"),$ZodISOTime:a(()=>plo,"$ZodISOTime"),$ZodISODuration:a(()=>hlo,"$ZodISODuration"),$ZodISODateTime:a(()=>dlo,"$ZodISODateTime"),$ZodISODate:a(()=>flo,"$ZodISODate"),$ZodIPv6:a(()=>glo,"$ZodIPv6"),$ZodIPv4:a(()=>mlo,"$ZodIPv4"),$ZodGUID:a(()=>elo,"$ZodGUID"),$ZodFunction:a(()=>kkt,"$ZodFunction"),$ZodFile:a(()=>jlo,"$ZodFile"),$ZodError:a(()=>ejr,"$ZodError"),$ZodEnum:a(()=>Qlo,"$ZodEnum"),$ZodEmoji:a(()=>ilo,"$ZodEmoji"),$ZodEmail:a(()=>rlo,"$ZodEmail"),$ZodE164:a(()=>Clo,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>Olo,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>$lo,"$ZodDefault"),$ZodDate:a(()=>Mlo,"$ZodDate"),$ZodCustomStringFormat:a(()=>Tlo,"$ZodCustomStringFormat"),$ZodCustom:a(()=>tuo,"$ZodCustom"),$ZodCheckUpperCase:a(()=>Vco,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>RUe,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>zco,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>Qco,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>Gco,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>Kco,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>Zco,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>Lco,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>Oco,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>Uco,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>jco,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>Jco,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>Fco,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>qco,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>$co,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>ljr,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>Hco,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>Wco,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>ujr,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>Yco,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>Bco,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>Qh,"$ZodCheck"),$ZodCatch:a(()=>Ylo,"$ZodCatch"),$ZodCUID2:a(()=>alo,"$ZodCUID2"),$ZodCUID:a(()=>slo,"$ZodCUID"),$ZodCIDRv6:a(()=>ylo,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>Alo,"$ZodCIDRv4"),$ZodBoolean:a(()=>pjr,"$ZodBoolean"),$ZodBigIntFormat:a(()=>xlo,"$ZodBigIntFormat"),$ZodBigInt:a(()=>hjr,"$ZodBigInt"),$ZodBase64URL:a(()=>vlo,"$ZodBase64URL"),$ZodBase64:a(()=>_lo,"$ZodBase64"),$ZodAsyncError:a(()=>az,"$ZodAsyncError"),$ZodArray:a(()=>mjr,"$ZodArray"),$ZodAny:a(()=>Plo,"$ZodAny")});Hao=Object.freeze({status:"aborted"});a(pt,"F");Gao=Symbol("zod_brand"),az=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ckt={};a(_C,"c$");Xs={};RB(Xs,{unwrapMessage:a(()=>q6e,"unwrapMessage"),stringifyPrimitive:a(()=>gs,"stringifyPrimitive"),required:a(()=>Nrl,"required"),randomString:a(()=>Srl,"randomString"),propertyKeyTypes:a(()=>bkt,"propertyKeyTypes"),promiseAllObject:a(()=>brl,"promiseAllObject"),primitiveTypes:a(()=>zao,"primitiveTypes"),prefixIssues:a(()=>Vk,"prefixIssues"),pick:a(()=>wrl,"pick"),partial:a(()=>Drl,"partial"),optionalKeys:a(()=>Yao,"optionalKeys"),omit:a(()=>Rrl,"omit"),numKeys:a(()=>Trl,"numKeys"),nullish:a(()=>rse,"nullish"),normalizeParams:a(()=>Pr,"normalizeParams"),merge:a(()=>Prl,"merge"),jsonStringifyReplacer:a(()=>$ao,"jsonStringifyReplacer"),joinValues:a(()=>Kr,"joinValues"),issue:a(()=>Zao,"issue"),isPlainObject:a(()=>hUe,"isPlainObject"),isObject:a(()=>pUe,"isObject"),getSizableOrigin:a(()=>gPt,"getSizableOrigin"),getParsedType:a(()=>Irl,"getParsedType"),getLengthableOrigin:a(()=>APt,"getLengthableOrigin"),getEnumValues:a(()=>Jqr,"getEnumValues"),getElementAtPath:a(()=>Crl,"getElementAtPath"),floatSafeRemainder:a(()=>Vao,"floatSafeRemainder"),finalizeIssue:a(()=>_M,"finalizeIssue"),extend:a(()=>krl,"extend"),escapeRegex:a(()=>nse,"escapeRegex"),esc:a(()=>NCe,"esc"),defineLazy:a(()=>sl,"defineLazy"),createTransparentProxy:a(()=>xrl,"createTransparentProxy"),clone:a(()=>bM,"clone"),cleanRegex:a(()=>mPt,"cleanRegex"),cleanEnum:a(()=>Mrl,"cleanEnum"),captureStackTrace:a(()=>Xqr,"captureStackTrace"),cached:a(()=>hPt,"cached"),assignProp:a(()=>Zqr,"assignProp"),assertNotEqual:a(()=>yrl,"assertNotEqual"),assertNever:a(()=>Erl,"assertNever"),assertIs:a(()=>_rl,"assertIs"),assertEqual:a(()=>Arl,"assertEqual"),assert:a(()=>vrl,"assert"),allowsEval:a(()=>Wao,"allowsEval"),aborted:a(()=>FCe,"aborted"),NUMBER_FORMAT_RANGES:a(()=>Kao,"NUMBER_FORMAT_RANGES"),Class:a(()=>UQr,"Class"),BIGINT_FORMAT_RANGES:a(()=>Jao,"BIGINT_FORMAT_RANGES")});a(Arl,"lh");a(yrl,"ch");a(_rl,"ph");a(Erl,"dh");a(vrl,"ih");a(Jqr,"B7");a(Kr,"P");a($ao,"mH");a(hPt,"z7");a(rse,"I1");a(mPt,"N7");a(Vao,"lH");a(sl,"N$");a(Zqr,"cH");a(Crl,"nh");a(brl,"rh");a(Srl,"oh");a(NCe,"j0");Xqr=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(pUe,"g8");Wao=hPt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(hUe,"h8");a(Trl,"th");Irl=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw Error(`Unknown data type: ${e}`)}},"ah"),bkt=new Set(["string","number","symbol"]),zao=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(nse,"r4");a(bM,"H6");a(Pr,"k");a(xrl,"sh");a(gs,"x");a(Yao,"iH");Kao={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Jao={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(wrl,"eh");a(Rrl,"$u");a(krl,"Qu");a(Prl,"Ju");a(Drl,"Xu");a(Nrl,"Yu");a(FCe,"A0");a(Vk,"I6");a(q6e,"V7");a(_M,"g6");a(gPt,"O7");a(APt,"D7");a(Zao,"oH");a(Mrl,"Wu");UQr=class{static{a(this,"YM")}constructor(...e){}},Xao=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,$ao,2)},enumerable:!0})},"WM"),ejr=pt("$ZodError",Xao),wUe=pt("$ZodError",Xao,{Parent:Error});a(tjr,"m8");a(rjr,"l8");a(eco,"mX");a(tco,"GM");a(rco,"lX");njr=a(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new az;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>_M(u,s,_C())));throw Xqr(l,o?.callee),l}return c.value},"cX"),Skt=njr(wUe),ijr=a(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>_M(u,s,_C())));throw Xqr(l,o?.callee),l}return c.value},"pX"),Tkt=ijr(wUe),ojr=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new az;return s.issues.length?{success:!1,error:new(t??ejr)(s.issues.map(c=>_M(c,o,_C())))}:{success:!0,data:s.value}},"dX"),yPt=ojr(wUe),sjr=a(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>_M(c,o,_C())))}:{success:!0,data:s.value}},"iX"),_Pt=sjr(wUe),ajr={};RB(ajr,{xid:a(()=>sco,"xid"),uuid7:a(()=>Frl,"uuid7"),uuid6:a(()=>Brl,"uuid6"),uuid4:a(()=>Lrl,"uuid4"),uuid:a(()=>sbe,"uuid"),uppercase:a(()=>Nco,"uppercase"),unicodeEmail:a(()=>qrl,"unicodeEmail"),undefined:a(()=>Pco,"undefined"),ulid:a(()=>oco,"ulid"),time:a(()=>bco,"time"),string:a(()=>Tco,"string"),rfc5322Email:a(()=>Qrl,"rfc5322Email"),number:a(()=>wco,"number"),null:a(()=>kco,"null"),nanoid:a(()=>cco,"nanoid"),lowercase:a(()=>Dco,"lowercase"),ksuid:a(()=>aco,"ksuid"),ipv6:a(()=>hco,"ipv6"),ipv4:a(()=>pco,"ipv4"),integer:a(()=>xco,"integer"),html5Email:a(()=>Url,"html5Email"),hostname:a(()=>yco,"hostname"),guid:a(()=>uco,"guid"),extendedDuration:a(()=>Orl,"extendedDuration"),emoji:a(()=>fco,"emoji"),email:a(()=>dco,"email"),e164:a(()=>_co,"e164"),duration:a(()=>lco,"duration"),domain:a(()=>Grl,"domain"),datetime:a(()=>Sco,"datetime"),date:a(()=>vco,"date"),cuid2:a(()=>ico,"cuid2"),cuid:a(()=>nco,"cuid"),cidrv6:a(()=>gco,"cidrv6"),cidrv4:a(()=>mco,"cidrv4"),browserEmail:a(()=>jrl,"browserEmail"),boolean:a(()=>Rco,"boolean"),bigint:a(()=>Ico,"bigint"),base64url:a(()=>cjr,"base64url"),base64:a(()=>Aco,"base64"),_emoji:a(()=>Hrl,"_emoji")});nco=/^[cC][^\s-]{8,}$/,ico=/^[0-9a-z]+$/,oco=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,sco=/^[0-9a-vA-V]{20}$/,aco=/^[A-Za-z0-9]{27}$/,cco=/^[a-zA-Z0-9_-]{21}$/,lco=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Orl=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,uco=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,sbe=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,"P0"),Lrl=sbe(4),Brl=sbe(6),Frl=sbe(7),dco=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Url=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Qrl=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,qrl=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,jrl=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Hrl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(fco,"WK");pco=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,hco=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,mco=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,gco=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Aco=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,cjr=/^[A-Za-z0-9_-]*$/,yco=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Grl=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,_co=/^\+(?:[0-9]){6,14}[0-9]$/,Eco="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",vco=new RegExp(`^${Eco}$`);a(Cco,"HM");a(bco,"NK");a(Sco,"wK");Tco=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),Ico=/^\d+n?$/,xco=/^\d+$/,wco=/^-?\d+(?:\.\d+)?/i,Rco=/true|false/i,kco=/null/i,Pco=/undefined/i,Dco=/^[^A-Z]*$/,Nco=/^[^a-z]*$/,Qh=pt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Mco={number:"number",bigint:"bigint",object:"date"},ljr=pt("$ZodCheckLessThan",(t,e)=>{Qh.init(t,e);let r=Mco[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{Qh.init(t,e);let r=Mco[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Oco=pt("$ZodCheckMultipleOf",(t,e)=>{Qh.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Vao(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Lco=pt("$ZodCheckNumberFormat",(t,e)=>{Qh.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=Kao[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=o,l.maximum=s,r&&(l.pattern=xco)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}ls&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inst:t})}}),Bco=pt("$ZodCheckBigIntFormat",(t,e)=>{Qh.init(t,e);let[r,n]=Jao[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=r,s.maximum=n}),t._zod.check=o=>{let s=o.value;sn&&o.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inst:t})}}),Fco=pt("$ZodCheckMaxSize",(t,e)=>{Qh.init(t,e),t._zod.when=r=>{let n=r.value;return!rse(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;n.size<=e.maximum||r.issues.push({origin:gPt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),Uco=pt("$ZodCheckMinSize",(t,e)=>{Qh.init(t,e),t._zod.when=r=>{let n=r.value;return!rse(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let n=r.value;n.size>=e.minimum||r.issues.push({origin:gPt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),Qco=pt("$ZodCheckSizeEquals",(t,e)=>{Qh.init(t,e),t._zod.when=r=>{let n=r.value;return!rse(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=r=>{let n=r.value,o=n.size;if(o===e.size)return;let s=o>e.size;r.issues.push({origin:gPt(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),qco=pt("$ZodCheckMaxLength",(t,e)=>{Qh.init(t,e),t._zod.when=r=>{let n=r.value;return!rse(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;if(n.length<=e.maximum)return;let o=APt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),jco=pt("$ZodCheckMinLength",(t,e)=>{Qh.init(t,e),t._zod.when=r=>{let n=r.value;return!rse(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let n=r.value;if(n.length>=e.minimum)return;let o=APt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Hco=pt("$ZodCheckLengthEquals",(t,e)=>{Qh.init(t,e),t._zod.when=r=>{let n=r.value;return!rse(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=r=>{let n=r.value,o=n.length;if(o===e.length)return;let s=APt(n),c=o>e.length;r.issues.push({origin:s,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),RUe=pt("$ZodCheckStringFormat",(t,e)=>{var r,n;Qh.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),Gco=pt("$ZodCheckRegex",(t,e)=>{RUe.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),$co=pt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Dco),RUe.init(t,e)}),Vco=pt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Nco),RUe.init(t,e)}),Wco=pt("$ZodCheckIncludes",(t,e)=>{Qh.init(t,e);let r=nse(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),zco=pt("$ZodCheckStartsWith",(t,e)=>{Qh.init(t,e);let r=new RegExp(`^${nse(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),Yco=pt("$ZodCheckEndsWith",(t,e)=>{Qh.init(t,e);let r=new RegExp(`.*${nse(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});a(bio,"KM");Kco=pt("$ZodCheckProperty",(t,e)=>{Qh.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>bio(o,r,e.property));bio(n,r,e.property)}}),Jco=pt("$ZodCheckMimeType",(t,e)=>{Qh.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t})}}),Zco=pt("$ZodCheckOverwrite",(t,e)=>{Qh.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),Ikt=class{static{a(this,"tX")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(` +`);this.baseURL=s.baseURL,this._baseURLIsExplicit=o.__baseURLIsExplicit??!!e,this.timeout=s.timeout??Uqr.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=Bno(s.logLevel,"ClientOptions.logLevel",this)??Bno(pu("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??WYc(),vn(this,RRt,YYc,"f");let l=pu("ANTHROPIC_CUSTOM_HEADERS");if(l){let d={};for(let f of l.split(` +`)){let h=f.indexOf(":");h>=0&&(d[f.substring(0,h).trim()]=f.substring(h+1).trim())}s.defaultHeaders={...d,...s.defaultHeaders}}let u=o.__auth;if(delete s.__auth,delete s.__baseURLIsExplicit,this._options=s,this.apiKey=typeof r=="string"?r:null,this.authToken=n,u)this._authState=u,!this._baseURLIsExplicit&&u.baseURL&&(this.baseURL=u.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let d=s.credentials??null;if(d)this._authState.provider=d,this._authState.tokenCache=this._makeTokenCache(d);else if(s.config!=null){let f=bso(s.config,this._credentialResolverOptions());this._authState.provider=f.provider,this._authState.tokenCache=this._makeTokenCache(f.provider),this._authState.extraHeaders=f.extraHeaders,this._applyCredentialBaseURL(f.baseURL)}else s.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(s.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,!this._baseURLIsExplicit&&(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{AA(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{AA(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new lQr(e,r=>{AA(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await pKc(this._credentialResolverOptions(),e);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(e!=null)throw new Ni(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!r.has("authorization"))throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let r=this._requestAuthFlags.get(e);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,r)),r}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,_r([{Authorization:`Bearer ${r}`}])}return _r([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return _r([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return _r([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return KYc(e)}getUserAgent(){return`${this.constructor.name}/JS ${XW}`}defaultIdempotencyKey(){return`stainless-node-retry-${dso()}`}makeStatusError(e,r,n,o){return AC.generate(e,r,n,o)}buildURL(e,r,n){let o=!gt(this,AQr,"m",Uso).call(this)&&n||this.baseURL,s=UYc(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!Rno(c)||!Rno(l))&&(r={...l,...c,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new Ni("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 6e5}async prepareOptions(e){}async prepareRequest(e,{url:r,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let o=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[s,c]of Object.entries(this._authState.extraHeaders))o.has(s)||o.set(s,c);o.get("anthropic-beta")?.split(",").map(s=>s.trim())?.includes(jRt)||o.append("anthropic-beta",jRt),e.headers=o}}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new GRt(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(AA(this).debug(`[${d}] sending request`,Qoe({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new nx;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(sQr),A=Date.now();if(g instanceof globalThis.Error){let E=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new nx;let v=W6e(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return AA(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${E}`),AA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${E})`,Qoe({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw AA(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),AA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,Qoe({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new NRt:new jCe({cause:g})}let y=[...g.headers.entries()].filter(([E])=>E==="request-id").map(([E,v])=>", "+E+": "+JSON.stringify(v)).join(""),_=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let E=await this.shouldRetry(g,o);if(r&&E){let R=`retrying, ${r} attempts remaining`;return await zYc(g.body),AA(this).info(`${_} - ${R}`),AA(this).debug(`[${d}] response error (${R})`,Qoe({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=E?"error; no more retries left":"error; not retryable";AA(this).info(`${_} - ${v}`);let S=await g.text().catch(R=>sQr(R).message),T=fso(S),w=T?void 0:S;throw AA(this).debug(`[${d}] response error (${v})`,Qoe({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return AA(this).info(_),AA(this).debug(`[${d}] response start`,Qoe({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),{response:g,options:o,controller:m,requestLogID:d,retryOfRequestLogID:n,startTime:h}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(o=>({method:"get",path:e,...o})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new dQr(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:s,method:c,...l}=r||{},u=this._makeAbort(o);s&&s.addEventListener("abort",u,{once:!0});let d=setTimeout(u,n),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,h={signal:o.signal,...f?{duplex:"half"}:{},method:"GET",...l};c&&(h.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(d)}}async shouldRetry(e,r){let n=this._authFlags(r);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=e.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let s,c=o?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(s=u)}let l=o?.get("retry-after");if(l&&!s){let u=parseFloat(l);Number.isNaN(u)?s=Date.parse(l)-Date.now():s=u*1e3}if(s===void 0){let u=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,u)}return await jYc(s),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let n=r-e,o=Math.min(.5*Math.pow(2,n),8),s=1-Math.random()*.25;return o*s*1e3}calculateNonstreamingTimeout(e,r){if(36e5*e/128e3>6e5||r!=null&&e>r)throw new Ni("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:s,query:c,defaultBaseURL:l}=n;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let u=this.buildURL(s,c,l);"timeout"in n&&qYc("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:d,body:f}=this.buildBody({options:n}),h=await this.buildHeaders({options:e,method:o,bodyHeaders:d,retryCount:r});return{req:{method:o,headers:h,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"},...f&&{body:f},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let s={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let c=_r([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...Nqr(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(c),c.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=_r([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:hso(e)}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:gt(this,RRt,"f").call(this,{body:e,headers:n})}};Uqr=Hp,RRt=new WeakMap,AQr=new WeakSet,Uso=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");Hp.Anthropic=Uqr;Hp.HUMAN_PROMPT=jKc;Hp.AI_PROMPT=HKc;Hp.DEFAULT_TIMEOUT=6e5;Hp.AnthropicError=Ni;Hp.APIError=AC;Hp.APIConnectionError=jCe;Hp.APIConnectionTimeoutError=NRt;Hp.APIUserAbortError=nx;Hp.NotFoundError=BRt;Hp.ConflictError=FRt;Hp.RateLimitError=QRt;Hp.BadRequestError=MRt;Hp.AuthenticationError=ORt;Hp.InternalServerError=qRt;Hp.PermissionDeniedError=LRt;Hp.UnprocessableEntityError=URt;Hp.toFile=xKc;$Ce=class extends Hp{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new akt(this),this.messages=new J6e(this),this.models=new lkt(this),this.beta=new t1(this)}};$Ce.Completions=akt;$Ce.Messages=J6e;$Ce.Models=lkt;$Ce.Beta=t1;a(bUe,"j4");a(kRt,"N8");a(ix,"o$");a(SUe,"D1");a(Qso,"JU");a(GKc,"Tw");$Kc=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),VKc=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a(WKc,"xw");_Qr=class{static{a(this,"gw")}read(e){return(0,yA.readFile)(e,"utf8")}readBytes(e){return(0,yA.readFile)(e)}write(e,r,n){return(0,yA.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,yA.mkdir)(e,{recursive:!0})}catch(r){if(ix(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return WKc(e,r,n)}delete(e){return(0,yA.unlink)(e)}list(e){return(0,yA.readdir)(e)}append(e,r,n){return(0,yA.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,yA.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,yA.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,yA.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,yA.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},zKc=new jso.AsyncLocalStorage;a(ukt,"w8");xCe=null;a(Gso,"uw");a(YKc,"mw");a(jk,"L6");a(KKc,"dv");JKc=KKc;a(ZKc,"iv");XKc=ZKc;a(eJc,"nv");tJc=eJc;a(rJc,"rv");nJc=rJc,iJc=200;a(oJc,"tv");sJc=oJc;a(gbe,"D8");gbe.prototype.clear=JKc;gbe.prototype.delete=XKc;gbe.prototype.get=tJc;gbe.prototype.has=nJc;gbe.prototype.set=sJc;aJc=gbe,cJc=(function(){try{var t=kqr(Object,"defineProperty");return t({},"",{}),t}catch{}})(),dkt=cJc;a(lJc,"sv");Qqr=lJc,uJc=Object.prototype,dJc=uJc.hasOwnProperty;a(fJc,"QC");$so=fJc;a(pJc,"JC");hJc=pJc;a(mJc,"XC");gJc=mJc;a(AJc,"YC");Abe=AJc,yJc="[object Arguments]";a(_Jc,"GC");nio=_Jc,Vso=Object.prototype,EJc=Vso.hasOwnProperty,vJc=Vso.propertyIsEnumerable,CJc=nio((function(){return arguments})())?nio:function(t){return Abe(t)&&EJc.call(t,"callee")&&!vJc.call(t,"callee")},Z6e=CJc,bJc=Array.isArray,oz=bJc,O6e={};RB(O6e,{default:a(()=>qqr,"default")});a(SJc,"VC");TJc=SJc,Wso=typeof O6e=="object"&&O6e&&!O6e.nodeType&&O6e,iio=Wso&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,IJc=iio&&iio.exports===Wso,oio=IJc?dbe.Buffer:void 0,xJc=oio?oio.isBuffer:void 0,wJc=xJc||TJc,qqr=wJc,RJc=9007199254740991,kJc=/^(?:0|[1-9]\d*)$/;a(PJc,"DC");uPt=PJc,DJc=9007199254740991;a(NJc,"ZC");jqr=NJc,MJc="[object Arguments]",OJc="[object Array]",LJc="[object Boolean]",BJc="[object Date]",FJc="[object Error]",UJc="[object Function]",QJc="[object Map]",qJc="[object Number]",jJc="[object Object]",HJc="[object RegExp]",GJc="[object Set]",$Jc="[object String]",VJc="[object WeakMap]",WJc="[object ArrayBuffer]",zJc="[object DataView]",YJc="[object Float32Array]",KJc="[object Float64Array]",JJc="[object Int8Array]",ZJc="[object Int16Array]",XJc="[object Int32Array]",eZc="[object Uint8Array]",tZc="[object Uint8ClampedArray]",rZc="[object Uint16Array]",nZc="[object Uint32Array]",Od={};Od[YJc]=Od[KJc]=Od[JJc]=Od[ZJc]=Od[XJc]=Od[eZc]=Od[tZc]=Od[rZc]=Od[nZc]=!0;Od[MJc]=Od[OJc]=Od[WJc]=Od[LJc]=Od[zJc]=Od[BJc]=Od[FJc]=Od[UJc]=Od[QJc]=Od[qJc]=Od[jJc]=Od[HJc]=Od[GJc]=Od[$Jc]=Od[VJc]=!1;a(iZc,"pC");oZc=iZc;a(sZc,"dC");aZc=sZc,L6e={};RB(L6e,{default:a(()=>EQr,"default")});zso=typeof L6e=="object"&&L6e&&!L6e.nodeType&&L6e,H6e=zso&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,cZc=H6e&&H6e.exports===zso,L7r=cZc&&sso.process,lZc=(function(){try{var t=H6e&&H6e.require&&H6e.require("util").types;return t||L7r&&L7r.binding&&L7r.binding("util")}catch{}})(),EQr=lZc,sio=EQr&&EQr.isTypedArray,uZc=sio?aZc(sio):oZc,Yso=uZc,dZc=Object.prototype,fZc=dZc.hasOwnProperty;a(pZc,"aC");hZc=pZc,mZc=Object.prototype;a(gZc,"eC");Kso=gZc;a(AZc,"$T");yZc=AZc;a(_Zc,"QT");Hqr=_Zc;a(EZc,"JT");vZc=EZc,CZc=Object.prototype,bZc=CZc.hasOwnProperty;a(SZc,"WT");TZc=SZc;a(IZc,"GT");Jso=IZc,B6e={};RB(B6e,{default:a(()=>Xso,"default")});Zso=typeof B6e=="object"&&B6e&&!B6e.nodeType&&B6e,aio=Zso&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,xZc=aio&&aio.exports===Zso,cio=xZc?dbe.Buffer:void 0,lio=cio?cio.allocUnsafe:void 0;a(wZc,"HT");Xso=wZc;a(RZc,"KT");kZc=RZc;a(PZc,"qT");DZc=PZc,NZc=yZc(Object.getPrototypeOf,Object),eao=NZc,MZc=dbe.Uint8Array,uio=MZc;a(OZc,"zT");LZc=OZc;a(BZc,"NT");FZc=BZc,dio=Object.create,UZc=(function(){function t(){}return a(t,"$"),function(e){if(!N9(e))return{};if(dio)return dio(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),QZc=UZc;a(qZc,"OT");jZc=qZc,HZc="[object Symbol]";a(GZc,"FT");Gqr=GZc,$Zc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,VZc=/^\w*$/;a(WZc,"LT");zZc=WZc,YZc=500;a(KZc,"AT");JZc=KZc,ZZc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,XZc=/\\(\\)?/g,eXc=JZc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(ZZc,function(r,n,o,s){e.push(o?s.replace(XZc,"$1"):n||r)}),e}),tXc=eXc;a(rXc,"ET");nXc=rXc,iXc=1/0,fio=iz?iz.prototype:void 0,pio=fio?fio.toString:void 0;a(tao,"PO");oXc=tao;a(sXc,"_T");aXc=sXc;a(cXc,"kT");dPt=cXc,lXc=1/0;a(uXc,"vT");$qr=uXc;a(dXc,"CT");fXc=dXc;a(pXc,"TT");hXc=pXc;a(mXc,"xT");gXc=mXc;a(AXc,"yT");yXc=AXc;a(_Xc,"fT");rao=_Xc,Vqr=null;a(EXc,"CO");a(vXc,"TO");pkt=new Map;a(CXc,"xO");a(bXc,"yO");Wqr=new Map;a(TXc,"fO");a(IXc,"gO");a(zqr,"V0");a(wXc,"hO");a(RXc,"uO");kXc={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(PXc,"lT");DXc=PXc(),NXc=a(()=>{},"pT");a(iao,"VU");MXc=vUe(),Cfm=MXc.subscribe,OXc=vUe(),bfm=OXc.subscribe,LXc=vUe(),Sfm=LXc.subscribe,BXc=vUe(),Tfm=BXc.subscribe,FXc=vUe(),Ifm=FXc.subscribe;a(UXc,"lO");a(QXc,"tT");CQr=class{static{a(this,"cO")}#e=new Set;register(e){let r=QXc(e);this.#e.add(r);let n=a(()=>{this.#e.delete(r)},"J");return Object.assign(n,{[Symbol.dispose]:n})}async drain(){let e=Array.from(this.#e);this.#e.clear(),await Promise.all(e.map(async r=>r()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#e.size}},qXc=new CQr;a(jXc,"pO");HXc=Wy(t=>{if(!t||t.trim()==="")return null;let e=t.split(",").map(s=>s.trim()).filter(Boolean);if(e.length===0)return null;let r=e.some(s=>s.startsWith("!")),n=e.some(s=>!s.startsWith("!"));if(r&&n)return null;let o=e.map(s=>s.replace(/^!/,"").toLowerCase());return{include:r?[]:o,exclude:r?o:[],isExclusive:r}});a(GXc,"sT");a($Xc,"eT");a(VXc,"iO");a(WXc,"tO");a(zXc,"Qx");a(hio,"oO");a(YXc,"aO");a(sao,"HX");KXc={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=pf(e,mf`fs.existsSync(${t})`,0);return bo.existsSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},async stat(t){return(0,e0.stat)(t)},async readdir(t){return(0,e0.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,e0.unlink)(t)},async rmdir(t){return(0,e0.rmdir)(t)},async rm(t,e){return(0,e0.rm)(t,e)},async mkdir(t,e){try{await(0,e0.mkdir)(t,{recursive:!0,...e})}catch(r){if(ix(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,e0.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,e0.rename)(t,e)},statSync(t){let e=[];try{let o=pf(e,mf`fs.statSync(${t})`,0);return bo.statSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},lstatSync(t){let e=[];try{let o=pf(e,mf`fs.lstatSync(${t})`,0);return bo.lstatSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},readFileSync(t,e){let r=[];try{let s=pf(r,mf`fs.readFileSync(${t})`,0);return bo.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{hf(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=pf(e,mf`fs.readFileBytesSync(${t})`,0);return bo.readFileSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},readSync(t,e){let r=[];try{let s=pf(r,mf`fs.readSync(${t}, ${e.length} bytes)`,0),c;try{c=bo.openSync(t,"r");let l=Buffer.alloc(e.length),u=bo.readSync(c,l,0,e.length,0);return{buffer:l,bytesRead:u}}finally{c&&bo.closeSync(c)}}catch(s){var n=s,o=1}finally{hf(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=pf(n,mf`fs.appendFileSync(${t}, ${e.length} chars)`,0);if(r?.mode!==void 0)try{let l=bo.openSync(t,"ax",r.mode);try{bo.appendFileSync(l,e)}finally{bo.closeSync(l)}return}catch(l){if(ix(l)!=="EEXIST")throw l}bo.appendFileSync(t,e)}catch(c){var o=c,s=1}finally{hf(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=pf(r,mf`fs.copyFileSync(${t} → ${e})`,0);bo.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{hf(r,n,o)}},unlinkSync(t){let e=[];try{let o=pf(e,mf`fs.unlinkSync(${t})`,0);bo.unlinkSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},renameSync(t,e){let r=[];try{let s=pf(r,mf`fs.renameSync(${t} → ${e})`,0);bo.renameSync(t,e)}catch(s){var n=s,o=1}finally{hf(r,n,o)}},linkSync(t,e){let r=[];try{let s=pf(r,mf`fs.linkSync(${t} → ${e})`,0);bo.linkSync(t,e)}catch(s){var n=s,o=1}finally{hf(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=pf(n,mf`fs.symlinkSync(${t} → ${e})`,0);bo.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{hf(n,o,s)}},readlinkSync(t){let e=[];try{let o=pf(e,mf`fs.readlinkSync(${t})`,0);return bo.readlinkSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},realpathSync(t){let e=[];try{let o=pf(e,mf`fs.realpathSync(${t})`,0);return bo.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{hf(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=pf(r,mf`fs.mkdirSync(${t})`,0),c={recursive:!0};e?.mode!==void 0&&(c.mode=e.mode);try{bo.mkdirSync(t,c)}catch(l){if(ix(l)!=="EEXIST")throw l}}catch(s){var n=s,o=1}finally{hf(r,n,o)}},readdirSync(t){let e=[];try{let o=pf(e,mf`fs.readdirSync(${t})`,0);return bo.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{hf(e,r,n)}},readdirStringSync(t){let e=[];try{let o=pf(e,mf`fs.readdirStringSync(${t})`,0);return bo.readdirSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=pf(e,mf`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{hf(e,r,n)}},rmdirSync(t){let e=[];try{let o=pf(e,mf`fs.rmdirSync(${t})`,0);bo.rmdirSync(t)}catch(o){var r=o,n=1}finally{hf(e,r,n)}},rmSync(t,e){let r=[];try{let s=pf(r,mf`fs.rmSync(${t})`,0);bo.rmSync(t,e)}catch(s){var n=s,o=1}finally{hf(r,n,o)}},createWriteStream(t){return bo.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,e0.readFile)(t);let r=await(0,e0.open)(t,"r");try{let{size:n}=await r.stat(),o=Math.min(n,e),s=Buffer.allocUnsafe(o),c=0;for(;c=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,confidence:"high"},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-api-key",source:`\\b(${iel}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"openai-api-key",source:`\\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}",confidence:"high"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}",confidence:"high"},{id:"gitlab-pat",source:"glpat-[\\w-]{20}",confidence:"high"},{id:"gitlab-deploy-token",source:"gldt-[0-9a-zA-Z_\\-]{20}",confidence:"high"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",confidence:"high"},{id:"slack-user-token",source:"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",confidence:"high"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i",confidence:"high"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}",confidence:"high"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",confidence:"high"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}",confidence:"high"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",confidence:"high"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}",confidence:"high"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}",confidence:"high"},{id:"private-key",source:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?-----END[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----",flags:"i",confidence:"high"}],Aio=null;a(sel,"Ox");a(ael,"W2");bQr={verbose:0,debug:1,info:2,warn:3,error:4},cel=Wy(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(bQr,t)?t:"debug"}),lel=!1;a(fPt,"qX");SQr=Wy(()=>{let t=fPt();return lel||bE(process.env.DEBUG)||bE(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||aao()||t.some(e=>e.startsWith("--debug="))||cao()!==null}),uel=Wy(()=>{let t=fPt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return HXc(e)}),aao=Wy(()=>{let t=fPt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),cao=Wy(()=>{let t=fPt();for(let e=0;e{try{let t=dao(),e=(0,rse.dirname)(t),r=(0,rse.join)(e,"latest");await(0,IE.unlink)(r).catch(()=>{}),await(0,IE.symlink)(t,r)}catch{}}),Rfm=(()=>{let t=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(t!==void 0){let e=Number(t);if(!Number.isNaN(e)&&e>=0)return e}return 1/0})(),gel={[Symbol.dispose](){}};a(Ael,"_x");mf=Ael;a(eg,"B$");CM=a((t,e)=>{let r=[];try{let s=pf(r,mf`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{hf(r,n,o)}},"d$");a(yel,"w2");a(sz,"A4");a(_el,"kx");a(Eel,"O2");vel=2e3,hkt=new Set,yio=!1;a(Cel,"xx");a(bel,"yx");xQr=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=iQr();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||iQr(),e.deferSpawn?(this.spawnPromise=new Promise((r,n)=>{this.spawnResolve=r,this.spawnReject=n}),this.spawnPromise.catch(()=>{})):this.initialize()}spawn(){try{this.initialize()}catch(r){throw this.spawnAbort(bUe(r)),r}let e=this.pendingWrites;this.pendingWrites=[],this.spawnResolve&&(this.spawnResolve(),this.spawnResolve=void 0,this.spawnReject=void 0);for(let r of e)this.write(r);this.pendingEndInput&&(this.pendingEndInput=!1,this.processStdin?.end())}spawnAbort(e){this.spawnReject&&(this.spawnReject(e),this.spawnReject=void 0,this.spawnResolve=void 0,this.pendingWrites=[])}updateEnv(e){this.options.env?Object.assign(this.options.env,e):this.options.env={...e}}updateResume(e){this.options.resume=e}getDefaultExecutable(){return oso()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=bE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,tso.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(bE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();jk(f),this.options.stderr&&this.options.stderr(f)}),{stdin:u.stdin,stdout:u.stdout,get killed(){return u.killed},get exitCode(){return u.exitCode},kill:u.kill.bind(u),on:u.on.bind(u),once:u.once.bind(u),off:u.off.bind(u)}}initialize(){try{let{additionalDirectories:e=[],agent:r,betas:n,cwd:o,executable:s=this.getDefaultExecutable(),executableArgs:c=[],extraArgs:l={},pathToClaudeCodeExecutable:u,env:d={...process.env},thinkingConfig:f,maxTurns:h,maxBudgetUsd:m,taskBudget:g,model:A,fallbackModel:y,jsonSchema:_,permissionMode:E,allowDangerouslySkipPermissions:v,permissionPromptToolName:S,continueConversation:T,resume:w,settingSources:R,skills:x,disallowedTools:k=[],tools:D,mcpServers:N,strictMcpConfig:O,canUseTool:B,includePartialMessages:q,plugins:M,sandbox:L}=this.options,{allowedTools:U=[]}=this.options;if(x!==void 0){let H=x==="all"?["Skill"]:x.map(le=>`Skill(${le})`),re=new Set(U);U=[...U,...H.filter(le=>!re.has(le))]}let j=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(f){switch(f.type){case"enabled":f.budgetTokens===void 0?j.push("--thinking","adaptive"):j.push("--max-thinking-tokens",f.budgetTokens.toString());break;case"disabled":j.push("--thinking","disabled");break;case"adaptive":j.push("--thinking","adaptive");break}f.type!=="disabled"&&f.display&&j.push("--thinking-display",f.display)}if(this.options.effort&&j.push("--effort",this.options.effort),h&&j.push("--max-turns",h.toString()),m!==void 0&&j.push("--max-budget-usd",m.toString()),g&&j.push("--task-budget",g.total.toString()),A&&j.push("--model",A),r&&j.push("--agent",r),n&&n.length>0&&j.push("--betas",n.join(",")),_&&j.push("--json-schema",eg(_)),this.options.debugFile?j.push("--debug-file",this.options.debugFile):this.options.debug&&j.push("--debug"),!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let H=YKc();H&&j.push("--debug-file",H)}if(B){if(S)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");j.push("--permission-prompt-tool","stdio")}else S&&j.push("--permission-prompt-tool",S);if(T&&j.push("--continue"),w&&j.push("--resume",w),this.options.assistant&&j.push("--assistant"),this.options.channels&&this.options.channels.length>0&&j.push("--channels",...this.options.channels),U.length>0&&j.push("--allowedTools",U.join(",")),k.length>0&&j.push("--disallowedTools",k.join(",")),D!==void 0&&(Array.isArray(D)?D.length===0?j.push("--tools",""):j.push("--tools",D.join(",")):j.push("--tools","default")),N&&Object.keys(N).length>0&&j.push("--mcp-config",eg({mcpServers:N})),R!==void 0&&j.push(`--setting-sources=${R.join(",")}`),O&&j.push("--strict-mcp-config"),E&&j.push("--permission-mode",E),v&&j.push("--allow-dangerously-skip-permissions"),y){if(A&&y===A)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");j.push("--fallback-model",y)}this.options.includeHookEvents&&j.push("--include-hook-events"),q&&j.push("--include-partial-messages"),this.options.sessionMirror&&j.push("--session-mirror");for(let H of e)j.push("--add-dir",H);if(M&&M.length>0)for(let H of M)if(H.type==="local")j.push("--plugin-dir",H.path);else throw Error(`Unsupported plugin type: ${H.type}`);this.options.forkSession&&j.push("--fork-session"),this.options.resumeSessionAt&&j.push("--resume-session-at",this.options.resumeSessionAt),this.options.sessionId&&j.push("--session-id",this.options.sessionId),this.options.persistSession===!1&&j.push("--no-session-persistence"),this.options.managedSettings&&j.push("--managed-settings",this.options.managedSettings);let Q={...l??{}};this.options.settings&&(Q.settings=this.options.settings);let Y=Eel(Q,L);for(let[H,re]of Object.entries(Y))re===null?j.push(`--${H}`):j.push(`--${H}`,re);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,bE(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let W=Sel(u),V=W?u:s,z=W?[...c,...j]:[...c,u,...j],ie={command:V,args:z,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(jk(`Spawning Claude Code (custom): ${V} ${z.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(ie)):(jk(`Spawning Claude Code: ${V} ${z.join(" ")}`),this.process=this.spawnLocalProcess(ie)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,bel(this.process),this.abortHandler=()=>this.close(),this.abortController.signal.addEventListener("abort",this.abortHandler),this.abortController.signal.aborted&&this.close(),this.process.on("error",H=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new e1("Claude Code process aborted by user");else if(GKc(H)){let re=Tel(u,W);this.exitError=ReferenceError(re),jk(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${H.message}`),jk(this.exitError.message)}),this.process.on("exit",(H,re)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new e1("Claude Code process aborted by user");else{let le=this.getProcessExitError(H,re);le&&(this.exitError=le,jk(le.message))}}),this.ready=!this.abortController.signal.aborted}catch(e){throw this.ready=!1,e}}getProcessExitError(e,r){if(e!==0&&e!==null)return Error(`Claude Code process exited with code ${e}`);if(r)return Error(`Claude Code process terminated by signal ${r}`)}write(e){if(this.abortController.signal.aborted)throw new e1("Operation aborted");if(this.spawnResolve){this.pendingWrites.push(e);return}if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){jk("[ProcessTransport] Dropping write to ended stdin stream");return}if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);jk(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||jk("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${kRt(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new e1("Claude Code process aborted by user"):Error("Query closed before spawn")),this.processStdin&&(this.processStdin.end(),this.processStdin=void 0),this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0);for(let{handler:n}of this.exitListeners)this.process?.off("exit",n);this.exitListeners=[];let e=a(()=>{this.abortController.signal.aborted&&this.forwardedAbort.abort(this.abortController.signal.reason)},"$"),r=this.process;r&&!r.killed&&r.exitCode===null?(setTimeout((n,o)=>{if(n.exitCode!==null){o();return}if(process.platform==="win32"){setTimeout((s,c)=>{s.exitCode===null&&s.kill("SIGKILL"),c()},5e3,n,o).unref();return}n.kill("SIGTERM"),setTimeout(s=>{s.exitCode===null&&s.kill("SIGKILL")},5e3,n).unref(),o()},vel,r,e).unref(),r.once("exit",()=>hkt.delete(r))):r&&(hkt.delete(r),e()),this.ready=!1}isReady(){return this.ready}async*readMessages(){if(this.spawnPromise&&(await this.spawnPromise,this.spawnPromise=void 0),!this.processStdout)throw Error("ProcessTransport output stream not available");if(this.exitError)throw this.exitError;let e=(0,nso.createInterface)({input:this.processStdout}),r=this.process?(()=>{let n=this.process,o=a(()=>e.close(),"Y");return n.on("error",o),()=>n.off("error",o)})():void 0;this.exitError&&e.close();try{for await(let n of e)if(n.trim()){let o;try{o=CM(n)}catch{jk(`Non-JSON stdout: ${n}`);continue}yield o}if(this.exitError)throw this.exitError;await this.waitForExit()}catch(n){throw n}finally{r?.(),e.close()}}endInput(){if(this.spawnResolve){this.pendingEndInput=!0;return}this.processStdin&&this.processStdin.end()}getInputStream(){return this.processStdin}onExit(e){if(!this.process)return()=>{};let r=a((n,o)=>{let s=this.getProcessExitError(n,o);e(s)},"Q");return this.process.on("exit",r),this.exitListeners.push({callback:e,handler:r}),()=>{this.process&&this.process.off("exit",r);let n=this.exitListeners.findIndex(o=>o.handler===r);n!==-1&&this.exitListeners.splice(n,1)}}async waitForExit(){if(!this.process){if(this.exitError)throw this.exitError;return}if(this.process.exitCode!==null||this.process.killed||this.exitError){if(this.exitError)throw this.exitError;return}return new Promise((e,r)=>{let n=a((s,c)=>{if(this.abortController.signal.aborted){r(new e1("Operation aborted"));return}let l=this.getProcessExitError(s,c);l?r(l):e()},"J");this.process.once("exit",n);let o=a(s=>{this.process.off("exit",n),r(s)},"Y");this.process.once("error",o),this.process.once("exit",()=>{this.process.off("error",o)})})}};a(Sel,"fx");a(Tel,"gx");wCe="@anthropic-ai/claude-agent-sdk";a(Iel,"ux");a(xel,"F2");mkt=class{static{a(this,"hQ")}returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(e){this.returned=e}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){return this.queue.length>0?Promise.resolve({done:!1,value:this.queue.shift()}):this.isDone?Promise.resolve({done:!0,value:void 0}):this.hasError?Promise.reject(this.hasError):new Promise((e,r)=>{this.readResolve=e,this.readReject=r})}enqueue(e){if(this.readResolve){let r=this.readResolve;this.readResolve=void 0,this.readReject=void 0,r({done:!1,value:e})}else this.queue.push(e)}done(){if(this.isDone=!0,this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!0,value:void 0})}}error(e){if(this.hasError=e,this.readReject){let r=this.readReject;this.readResolve=void 0,this.readReject=void 0,r(e)}}return(){return this.isDone=!0,this.returned&&this.returned(),Promise.resolve({done:!0,value:void 0})}};a(wel,"mx");Rel=wel();a(Yqr,"BX");a(hao,"AU");a(mao,"IU");a(kel,"Z2");a(I9,"I4");wQr=class{static{a(this,"RU")}sendMcpMessage;isClosed=!1;constructor(e){this.sendMcpMessage=e}onclose;onerror;onmessage;async start(){}async send(e){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(e)}async close(){this.isClosed||(this.isClosed=!0,this.onclose?.())}},RQr=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new mkt;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;transcriptMirrorBatcher;cleanupCallbacks=[];cleanupPromise;setIsSingleUserTurn(e){this.isSingleUserTurn=e}setTranscriptMirrorBatcher(e){this.transcriptMirrorBatcher=e}reportMirrorError(e,r){let n={type:"system",subtype:"mirror_error",error:r,key:e,uuid:(0,fkt.randomUUID)(),session_id:e.sessionId};this.inputStream.enqueue(n)}addCleanupCallback(e){this.cleanupPerformed?e():this.cleanupCallbacks.push(e)}isClosed(){return this.cleanupPerformed}hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0||this.getOAuthToken!==void 0||this.getHostAuthToken!==void 0}constructor(e,r,n,o,s,c=new Map,l,u,d,f,h){this.transport=e,this.isSingleUserTurn=r,this.canUseTool=n,this.hooks=o,this.abortController=s,this.jsonSchema=l,this.initConfig=u,this.onElicitation=d,this.getOAuthToken=f,this.getHostAuthToken=h;for(let[m,g]of c)this.connectSdkMcpServer(m,g);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(e){this.inputStream.error(e)}async stopTask(e){await this.request({subtype:"stop_task",task_id:e})}async backgroundTasks(e){return(await this.request({subtype:"background_tasks",tool_use_id:e})).response.backgrounded??!0}close(){this.cleanup()}cleanup(e){return this.cleanupPromise?this.cleanupPromise:(this.cleanupPerformed=!0,this.cleanupPromise=this.performCleanup(e),this.cleanupPromise)}async performCleanup(e){for(let r of this.cleanupCallbacks)try{r()}catch{}if(this.cleanupCallbacks=[],this.transcriptMirrorBatcher)try{await this.transcriptMirrorBatcher.flush()}catch{}try{for(let n of this.cancelControllers.values())n.abort();this.cancelControllers.clear(),this.transport.close();let r=e??Error("Query closed before response received");for(let{reject:n}of this.pendingControlResponses.values())n(r);this.pendingControlResponses.clear();for(let{reject:n}of this.pendingMcpResponses.values())n(r);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let n of this.sdkMcpTransports.values())n.close().catch(()=>{});this.sdkMcpTransports.clear(),e?this.inputStream.error(e):this.inputStream.done()}catch{}}next(...[e]){return this.sdkMessages.next(e)}async return(e){return await this.cleanup(),this.sdkMessages.return(e)}async throw(e){return await this.cleanup(),this.sdkMessages.throw(e)}[Symbol.asyncIterator](){return this.sdkMessages}async[Symbol.asyncDispose](){await this.cleanup()}async readMessages(){try{for await(let e of this.transport.readMessages()){if(e.type==="control_response"){let r=this.pendingControlResponses.get(e.response.request_id);r&&r.handler(e.response);continue}else if(e.type==="control_request"){this.handleControlRequest(e);continue}else if(e.type==="control_cancel_request"){this.handleControlCancelRequest(e);continue}else{if(e.type==="keep_alive")continue;if(e.type==="transcript_mirror"){this.transcriptMirrorBatcher?.enqueue(e.filePath,e.entries);continue}}if(e.type==="system"&&(e.subtype==="post_turn_summary"||e.subtype==="task_summary")){this.inputStream.enqueue(e);continue}e.type==="result"?(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.lastErrorResultText=e.is_error?e.subtype==="success"?e.result:e.errors.join("; "):void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.isSingleUserTurn&&(hu("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput())):e.type==="system"&&e.subtype==="session_state_changed"||(this.lastErrorResultText=void 0),this.inputStream.enqueue(e)}this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.inputStream.done(),this.cleanup()}catch(e){if(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.lastErrorResultText!==void 0&&!(e instanceof e1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);hu(`[Query.readMessages] Replacing exit error with result text. Original: ${kRt(e)}`),this.inputStream.error(r),this.cleanup(r);return}this.inputStream.error(e),this.cleanup(e)}}async handleControlRequest(e){let r=new AbortController;this.cancelControllers.set(e.request_id,r);try{let n=await this.processControlRequest(e,r.signal);if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"success",request_id:e.request_id,response:n}};await Promise.resolve(this.transport.write(eg(o)+` +`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:kRt(n)}};try{await Promise.resolve(this.transport.write(eg(o)+` +`))}catch(s){hu(`[Query.handleControlRequest] Error-response write failed: ${kRt(s)}`,{level:"error"})}}finally{this.cancelControllers.delete(e.request_id)}}handleControlCancelRequest(e){let r=this.cancelControllers.get(e.request_id);r&&(r.abort(),this.cancelControllers.delete(e.request_id))}async processControlRequest(e,r){if(e.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(e.request.tool_name,e.request.input,{signal:r,suggestions:e.request.permission_suggestions,blockedPath:e.request.blocked_path,decisionReason:e.request.decision_reason,title:e.request.title,displayName:e.request.display_name,description:e.request.description,toolUseID:e.request.tool_use_id,agentID:e.request.agent_id}),toolUseID:e.request.tool_use_id}}else{if(e.request.subtype==="hook_callback")return await this.handleHookCallbacks(e.request.callback_id,e.request.input,e.request.tool_use_id,r);if(e.request.subtype==="mcp_message"){let n=e.request,o=this.sdkMcpTransports.get(n.server_name);if(!o)throw Error(`SDK MCP server not found: ${n.server_name}`);return"method"in n.message&&"id"in n.message&&n.message.id!==null?{mcp_response:await this.handleMcpControlRequest(n.server_name,n,o)}:(o.onmessage&&o.onmessage(n.message),{mcp_response:{jsonrpc:"2.0",result:{},id:0}})}else if(e.request.subtype==="elicitation"){let n=e.request;return this.onElicitation?await this.onElicitation({serverName:n.mcp_server_name,message:n.message,mode:n.mode,url:n.url,elicitationId:n.elicitation_id,requestedSchema:n.requested_schema,title:n.title,displayName:n.display_name,description:n.description},{signal:r}):{action:"decline"}}else if(e.request.subtype==="oauth_token_refresh"){if(!this.getOAuthToken)throw Error("getOAuthToken callback is not provided.");return{accessToken:await this.getOAuthToken({signal:r})??null}}else if(e.request.subtype==="host_auth_token_refresh"){if(!this.getHostAuthToken)throw Error("getHostAuthToken callback is not provided.");return{authToken:await this.getHostAuthToken({signal:r})??null}}}throw Error("Unsupported control request subtype: "+e.request.subtype)}async*readSdkMessages(){try{for await(let e of this.inputStream)yield e}finally{await this.cleanup()}}async initialize(){let e;if(this.hooks){e={};for(let[o,s]of Object.entries(this.hooks))s.length>0&&(e[o]=s.map(c=>{let l=[];for(let u of c.hooks){let d=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(d,u),l.push(d)}return{matcher:c.matcher,hookCallbackIds:l,timeout:c.timeout}}))}let r=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,n={subtype:"initialize",hooks:e,sdkMcpServers:r,jsonSchema:this.jsonSchema,systemPrompt:typeof this.initConfig?.systemPrompt=="string"?[this.initConfig.systemPrompt]:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,planModeInstructions:this.initConfig?.planModeInstructions,appendSubagentSystemPrompt:this.initConfig?.appendSubagentSystemPrompt,toolAliases:this.initConfig?.toolAliases,excludeDynamicSections:this.initConfig?.excludeDynamicSections,agents:this.initConfig?.agents,title:this.initConfig?.title,skills:Array.isArray(this.initConfig?.skills)?this.initConfig.skills:void 0,webSearchIsolationExemptMcpServers:this.initConfig?.webSearchIsolationExemptMcpServers,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries,forwardSubagentText:this.initConfig?.forwardSubagentText};return(await this.request(n)).response}async interrupt(){return I9("sdk_interrupt",async()=>{await this.request({subtype:"interrupt"})})}async setPermissionMode(e){await this.request({subtype:"set_permission_mode",mode:e})}async setModel(e){await this.request({subtype:"set_model",model:e})}async setMaxThinkingTokens(e){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:e})}async applyFlagSettings(e){return I9("sdk_apply_flag_settings",async()=>{await this.request({subtype:"apply_flag_settings",settings:e})})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async rewindFiles(e,r){return I9("sdk_rewind_files",async()=>(await this.request({subtype:"rewind_files",user_message_id:e,dry_run:r?.dryRun})).response)}async cancelAsyncMessage(e){return(await this.request({subtype:"cancel_async_message",message_uuid:e})).response.cancelled}async seedReadState(e,r){await this.request({subtype:"seed_read_state",path:e,mtime:r})}async enableRemoteControl(e,r){return(await this.request({subtype:"remote_control",enabled:e,...r!==void 0&&{name:r}})).response}async submitFeedback(e,r){return(await this.request({subtype:"submit_feedback",description:e,surface:r?.surface})).response}async generateSessionTitle(e,r){return I9("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return I9("sdk_side_question",async()=>{let r=(await this.request({subtype:"side_question",question:e})).response;return r.response===null?null:{response:r.response,synthetic:r.synthetic??!1}})}async launchUltrareview(e,r){return(await this.request({subtype:"ultrareview_launch",args:e,confirm:r?.confirm??!1})).response}async messageRated(e){await this.request({subtype:"message_rated",messageUuid:e.messageUuid,sentiment:e.sentiment,surface:e.surface,cleared:e.cleared??!1})}processPendingPermissionRequests(e){for(let r of e)r.request.subtype==="can_use_tool"&&this.handleControlRequest(r).catch(()=>{})}request(e){let r=Math.random().toString(36).substring(2,15),n={request_id:r,type:"control_request",request:e};return new Promise((o,s)=>{this.pendingControlResponses.set(r,{handler:a(c=>{this.pendingControlResponses.delete(r),c.subtype==="success"?o(c):(s(Error(c.error)),c.pending_permission_requests&&this.processPendingPermissionRequests(c.pending_permission_requests))},"handler"),reject:s}),Promise.resolve(this.transport.write(eg(n)+` +`)).catch(c=>{this.pendingControlResponses.delete(r),s(c)})})}initializationResult(){return this.initialization}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(e){await this.request({subtype:"mcp_reconnect",serverName:e})}async toggleMcpServer(e,r){return I9("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return I9("sdk_mcp_enable_channel",async()=>{await this.request({subtype:"channel_enable",serverName:e})})}async mcpAuthenticate(e,r){return(await this.request({subtype:"mcp_authenticate",serverName:e,redirectUri:r})).response}async mcpClearAuth(e){return(await this.request({subtype:"mcp_clear_auth",serverName:e})).response}async mcpSubmitOAuthCallbackUrl(e,r){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:e,callbackUrl:r})).response}async claudeAuthenticate(e){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:e})).response}async claudeOAuthCallback(e,r){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:e,state:r})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(){return(await this.request({subtype:"get_context_usage"})).response}async readFile(e,r){try{return(await this.request({subtype:"read_file",path:e,max_bytes:r?.maxBytes,encoding:r?.encoding})).response}catch{return null}}async reloadPlugins(){return I9("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return I9("sdk_mcp_set_servers",async()=>{let r={},n={};for(let[l,u]of Object.entries(e))u.type==="sdk"&&"instance"in u?r[l]=u.instance:n[l]=u;let o=new Set(this.sdkMcpServerInstances.keys()),s=new Set(Object.keys(r));for(let l of o)s.has(l)||await this.disconnectSdkMcpServer(l);for(let[l,u]of Object.entries(r))o.has(l)||this.connectSdkMcpServer(l,u);let c={};for(let l of Object.keys(r))c[l]={type:"sdk",name:l};return(await this.request({subtype:"mcp_set_servers",servers:{...n,...c}})).response})}async accountInfo(){return(await this.initialization).account}async streamInput(e){hu("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,hu(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(eg(n)+` +`))}hu(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(hu("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),hu("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof e1))throw r}}waitForFirstResult(){return this.firstResultReceived?(hu("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve()):new Promise(e=>{if(this.abortController?.signal.aborted){e();return}this.abortController?.signal.addEventListener("abort",()=>e(),{once:!0}),this.firstResultReceivedResolve=e})}handleHookCallbacks(e,r,n,o){let s=this.hookCallbacks.get(e);if(!s)throw Error(`No hook callback found for ID: ${e}`);return s(r,n,{signal:o})}connectSdkMcpServer(e,r){let n=new wQr(o=>this.sendMcpServerMessageToCli(e,o));this.sdkMcpTransports.set(e,n),this.sdkMcpServerInstances.set(e,r),r.connect(n).catch(o=>{this.sdkMcpTransports.get(e)===n&&this.sdkMcpTransports.delete(e),this.sdkMcpServerInstances.get(e)===r&&this.sdkMcpServerInstances.delete(e),hu(`[Query.connectSdkMcpServer] Failed to connect MCP server '${e}': ${o}`,{level:"error"})})}async disconnectSdkMcpServer(e){let r=this.sdkMcpTransports.get(e);r&&(await r.close(),this.sdkMcpTransports.delete(e)),this.sdkMcpServerInstances.delete(e)}sendMcpServerMessageToCli(e,r){if("id"in r&&r.id!==null&&r.id!==void 0){let o=`${e}:${r.id}`,s=this.pendingMcpResponses.get(o);if(s){s.resolve(r),this.pendingMcpResponses.delete(o);return}}let n={type:"control_request",request_id:(0,fkt.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write(eg(n)+` +`)).catch(o=>{hu(`[Query.sendMcpServerMessageToCli] Transport write failed: ${o}`,{level:"error"})})}handleMcpControlRequest(e,r,n){let o="id"in r.message?r.message.id:null,s=`${e}:${o}`;return new Promise((c,l)=>{let u=a(()=>{this.pendingMcpResponses.delete(s)},"U"),d=a(h=>{u(),c(h)},"H"),f=a(h=>{u(),l(h)},"q");if(this.pendingMcpResponses.set(s,{resolve:d,reject:f}),n.onmessage)n.onmessage(r.message);else{u(),l(Error("No message handler registered"));return}})}},Kqr=500,Jqr=1048576,Pel=[200,800],kQr=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=Kqr,s=Jqr,c=Pel){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=eg(r).length;this.pending.push({filePath:e,entries:r,bytes:n}),this.pendingEntries+=r.length,this.pendingBytes+=n,(this.pendingEntries>this.maxPendingEntries||this.pendingBytes>this.maxPendingBytes)&&(this.flushPromise=this.drain(),this.flushPromise.catch(()=>{}))}async flush(){let e=this.drain();this.flushPromise=e,await e,this.flushPromise===e&&(this.flushPromise=null)}async drain(){let e=this.flushPromise,r=this.pending.splice(0);this.pendingEntries=0,this.pendingBytes=0,e&&await e,r.length!==0&&await this.doFlush(r)}async doFlush(e){let r=new Map;for(let o of e){let s=r.get(o.filePath);s?s.push(...o.entries):r.set(o.filePath,o.entries.slice())}let n=this.backoffMs.length+1;for(let[o,s]of r){let c=`SessionStore.append() timed out after ${this.sendTimeoutMs}ms for ${o}`,l,u=1;for(;u<=n;u++)try{await joe(this.send(o,s),this.sendTimeoutMs,c),l=void 0;break}catch(d){if(l=bUe(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await eso(f)}if(l){hu(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){hu(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},_io=Eqr(XVc(),1);a(Del,"Ug");a(G6e,"O0");a(Nel,"qg");U7r=new Map,Mel=5e3;a(Oel,"Bg");a(Lel,"zg");a(Bel,"OZ");Fel=(0,_ao.promisify)(yao.execFile);a(TUe,"m4");a(Uel,"jH");k9=65536,Qel=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(Uh,"L$");a(Cao,"ZZ");a(Q7r,"IX");a(Hk,"A6");a(DQr,"rQ");a(bao,"RX");a(qel,"MZ");a(Sao,"PX");X6e=200;a(jel,"Lg");a(IUe,"F0");a(uz,"U4");a(Hel,"jg");a(xUe,"M1");a(mM,"j6");a(pPt,"L1");Gel=1048576,$el=5242880;a(Wel,"Rg");a(Tao,"jZ");a($oe,"D0");a(gkt,"jX");Akt=Buffer.from('{"type":"attribution-snapshot"'),zel=Buffer.from('{"type":"system"'),eUe=10,Yel=Buffer.from([eUe]),Kel=256;a(Jel,"_g");a(Zel,"kg");a(Xel,"Sg");a(etl,"vg");a(ttl,"Cg");a(rtl,"AZ");a(ntl,"xg");a(itl,"yg");a(otl,"fg");a(q7r,"IH");a(stl,"gg");a(atl,"hg");a(ctl,"ug");a(Iao,"RH");a(xao,"PH");a(ltl,"IZ");a(wao,"RZ");a(utl,"PZ");a(hPt,"k8");a(F6e,"oQ");a(Rao,"EZ");dtl=32;a(ftl,"pg");a(ptl,"dg");a(htl,"ig");a(mtl,"ng");a(gtl,"rg");a(Atl,"bZ");a(ytl,"_Z");a(_tl,"CZ");a(Etl,"TZ");a(vtl,"xZ");a(Ctl,"ag");a(kao,"yZ");a(j7r,"_H");a(btl,"sg");Stl=new Set(["user","assistant","attachment","system","progress"]);a(Ttl,"$h");a(Itl,"Qh");a(Pao,"fZ");a(xtl,"gZ");a(wtl,"Jh");a(Rtl,"hZ");a(ktl,"Xh");a(Dao,"uZ");a(Nao,"lZ");a(Mao,"cZ");a(Ptl,"Wh");a(Dtl,"Gh");a(Ntl,"pZ");a(Mtl,"dZ");a(Oao,"vH");a(Fao,"CH");a(Uao,"bX");a(Otl,"Uh");Ltl="user:inference",Qao="user:profile",Btl="org:create_api_key",Ftl=[Btl,Qao],Utl=[Qao,Ltl,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],Pfm=Uao([...Ftl,...Utl]),Eio={BASE_API_URL:"https://api.anthropic.com",CONSOLE_AUTHORIZE_URL:"https://platform.claude.com/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"https://claude.com/cai/oauth/authorize",CLAUDE_AI_ORIGIN:"https://claude.ai",TOKEN_URL:"https://platform.claude.com/v1/oauth/token",API_KEY_URL:"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",ROLES_URL:"https://api.anthropic.com/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"https://platform.claude.com/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://platform.claude.com/oauth/code/callback",CLIENT_ID:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",OAUTH_FILE_SUFFIX:"",MCP_PROXY_URL:"https://mcp-proxy.anthropic.com",MCP_PROXY_PATH:"/v1/mcp/{server_id}"},Qtl=void 0;a(qtl,"zh");jtl=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(Htl,"rZ");Gtl="-credentials";a($tl,"tZ");Vtl=/^[a-zA-Z0-9._-]+$/;a(Wtl,"aZ");(function(t){t.assertEqual=o=>{};function e(o){}a(e,"Q"),t.assertIs=e;function r(o){throw Error()}a(r,"J"),t.assertNever=r,t.arrayToEnum=o=>{let s={};for(let c of o)s[c]=c;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),c={};for(let l of s)c[l]=o[l];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let c in o)Object.prototype.hasOwnProperty.call(o,c)&&s.push(c);return s},t.find=(o,s)=>{for(let c of o)if(s(c))return c},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}a(n,"Y"),t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(bc||(bc={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(vio||(vio={}));Dn=bc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),JW=a(t=>{switch(typeof t){case"undefined":return Dn.undefined;case"string":return Dn.string;case"number":return Number.isNaN(t)?Dn.nan:Dn.number;case"boolean":return Dn.boolean;case"function":return Dn.function;case"bigint":return Dn.bigint;case"symbol":return Dn.symbol;case"object":return Array.isArray(t)?Dn.array:t===null?Dn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Dn.promise:typeof Map<"u"&&t instanceof Map?Dn.map:typeof Set<"u"&&t instanceof Set?Dn.set:typeof Date<"u"&&t instanceof Date?Dn.date:Dn.object;default:return Dn.unknown}},"l4"),yr=bc.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Wk=class t extends Error{static{a(this,"f6")}get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;ur.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];r[s]=r[s]||[],r[s].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Wk.create=t=>new Wk(t);ztl=a((t,e)=>{let r;switch(t.code){case yr.invalid_type:t.received===Dn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case yr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,bc.jsonStringifyReplacer)}`;break;case yr.unrecognized_keys:r=`Unrecognized key(s) in object: ${bc.joinValues(t.keys,", ")}`;break;case yr.invalid_union:r="Invalid input";break;case yr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${bc.joinValues(t.options)}`;break;case yr.invalid_enum_value:r=`Invalid enum value. Expected ${bc.joinValues(t.options)}, received '${t.received}'`;break;case yr.invalid_arguments:r="Invalid function arguments";break;case yr.invalid_return_type:r="Invalid function return type";break;case yr.invalid_date:r="Invalid date";break;case yr.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:bc.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case yr.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case yr.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case yr.custom:r="Invalid input";break;case yr.invalid_intersection_types:r="Intersection results could not be merged";break;case yr.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case yr.not_finite:r="Number must be finite";break;default:r=e.defaultError,bc.assertNever(t)}return{message:r}},"Fh"),rUe=ztl,Ytl=rUe;a(MQr,"tQ");OQr=a(t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],c={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let l="",u=n.filter(d=>!!d).slice().reverse();for(let d of u)l=d(c,{data:e,defaultError:l}).message;return{...o,path:s,message:l}},"_X");a(hn,"f");yC=class t{static{a(this,"U6")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return io;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let s=await o.key,c=await o.value;n.push({key:s,value:c})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:c}=o;if(s.status==="aborted"||c.status==="aborted")return io;s.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(n[s.value]=c.value)}return{status:e.value,value:n}}},io=Object.freeze({status:"aborted"}),Q6e=a(t=>({status:"dirty",value:t}),"v8"),r1=a(t=>({status:"valid",value:t}),"z6"),Cio=a(t=>t.status==="aborted","TH"),bio=a(t=>t.status==="dirty","xH"),WCe=a(t=>t.status==="valid","Z0"),Ekt=a(t=>typeof Promise<"u"&&t instanceof Promise,"aQ");(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ei||(ei={}));Yk=class{static{a(this,"H4")}constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Sio=a((t,e)=>{if(WCe(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Wk(t.common.issues);return this._error=r,this._error}}},"eZ");a(ns,"e");Us=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return JW(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:JW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new yC,ctx:{common:e.parent.common,data:e.data,parsedType:JW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ekt(r))throw Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:JW(e)},o=this._parseSync({data:e,path:n.path,parent:n});return Sio(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:JW(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return WCe(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>WCe(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:JW(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(Ekt(o)?o:Promise.resolve(o));return Sio(n,s)}refine(e,r){let n=a(o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r,"J");return this._refinement((o,s)=>{let c=e(o),l=a(()=>s.addIssue({code:yr.custom,...n(o)}),"G");return typeof Promise<"u"&&c instanceof Promise?c.then(u=>u?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new yM({schema:this,typeName:wr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a(r=>this["~validate"](r),"validate")}}optional(){return zk.create(this,this._def)}nullable(){return O9.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return az.create(this)}promise(){return Zoe.create(this,this._def)}or(e){return JCe.create([this,e],this._def)}and(e){return ZCe.create(this,e,this._def)}transform(e){return new yM({...ns(this._def),schema:this,typeName:wr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new nbe({...ns(this._def),innerType:this,defaultValue:r,typeName:wr.ZodDefault})}brand(){return new vkt({typeName:wr.ZodBranded,type:this,...ns(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new ibe({...ns(this._def),innerType:this,catchValue:r,typeName:wr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Ckt.create(this,e)}readonly(){return obe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ktl=/^c[^\s-]{8,}$/i,Jtl=/^[0-9a-z]+$/,Ztl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xtl=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,erl=/^[a-z0-9_-]{21}$/i,trl=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rrl=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,nrl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,irl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",orl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,srl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,arl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,crl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lrl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,url=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qao="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",drl=new RegExp(`^${qao}$`);a(jao,"QM");a(frl,"yh");a(prl,"fh");a(hrl,"gh");a(mrl,"hh");a(grl,"uh");zCe=class t extends Us{static{a(this,"p4")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Dn.string){let o=this._getOrReturnCtx(e);return hn(o,{code:yr.invalid_type,expected:Dn.string,received:o.parsedType}),io}let r=new yC,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),hn(n,{code:yr.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,c=e.data.lengthe.test(o),{validation:r,code:yr.invalid_string,...ei.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ei.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ei.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ei.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ei.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ei.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ei.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ei.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ei.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ei.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ei.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ei.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ei.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ei.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...ei.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ei.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ei.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ei.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ei.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ei.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ei.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ei.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ei.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ei.errToObj(r)})}nonempty(e){return this.min(1,ei.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew zCe({checks:[],typeName:wr.ZodString,coerce:t?.coerce??!1,...ns(t)});a(Arl,"mh");nUe=class t extends Us{static{a(this,"T8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Dn.number){let o=this._getOrReturnCtx(e);return hn(o,{code:yr.invalid_type,expected:Dn.number,received:o.parsedType}),io}let r,n=new yC;for(let o of this._def.checks)o.kind==="int"?bc.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),hn(r,{code:yr.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),hn(r,{code:yr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?Arl(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),hn(r,{code:yr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),hn(r,{code:yr.not_finite,message:o.message}),n.dirty()):bc.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ei.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ei.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ei.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ei.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ei.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ei.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ei.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ei.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ei.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ei.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ei.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ei.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ei.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ei.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuee.kind==="int"||e.kind==="multipleOf"&&bc.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.valuenew nUe({checks:[],typeName:wr.ZodNumber,coerce:t?.coerce||!1,...ns(t)});iUe=class t extends Us{static{a(this,"x8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Dn.bigint)return this._getInvalidInput(e);let r,n=new yC;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),hn(r,{code:yr.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),hn(r,{code:yr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):bc.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.bigint,received:r.parsedType}),io}gte(e,r){return this.setLimit("min",e,!0,ei.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ei.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ei.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ei.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ei.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ei.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ei.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ei.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ei.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ei.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew iUe({checks:[],typeName:wr.ZodBigInt,coerce:t?.coerce??!1,...ns(t)});oUe=class extends Us{static{a(this,"kX")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Dn.boolean){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.boolean,received:r.parsedType}),io}return r1(e.data)}};oUe.create=t=>new oUe({typeName:wr.ZodBoolean,coerce:t?.coerce||!1,...ns(t)});sUe=class t extends Us{static{a(this,"eQ")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Dn.date){let o=this._getOrReturnCtx(e);return hn(o,{code:yr.invalid_type,expected:Dn.date,received:o.parsedType}),io}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return hn(o,{code:yr.invalid_date}),io}let r=new yC,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),hn(n,{code:yr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):bc.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ei.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ei.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew sUe({checks:[],coerce:t?.coerce||!1,typeName:wr.ZodDate,...ns(t)});aUe=class extends Us{static{a(this,"SX")}_parse(e){if(this._getType(e)!==Dn.symbol){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.symbol,received:r.parsedType}),io}return r1(e.data)}};aUe.create=t=>new aUe({typeName:wr.ZodSymbol,...ns(t)});YCe=class extends Us{static{a(this,"$7")}_parse(e){if(this._getType(e)!==Dn.undefined){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.undefined,received:r.parsedType}),io}return r1(e.data)}};YCe.create=t=>new YCe({typeName:wr.ZodUndefined,...ns(t)});KCe=class extends Us{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==Dn.null){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.null,received:r.parsedType}),io}return r1(e.data)}};KCe.create=t=>new KCe({typeName:wr.ZodNull,...ns(t)});cUe=class extends Us{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return r1(e.data)}};cUe.create=t=>new cUe({typeName:wr.ZodAny,...ns(t)});nz=class extends Us{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return r1(e.data)}};nz.create=t=>new nz({typeName:wr.ZodUnknown,...ns(t)});xB=class extends Us{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.never,received:r.parsedType}),io}};xB.create=t=>new xB({typeName:wr.ZodNever,...ns(t)});lUe=class extends Us{static{a(this,"CX")}_parse(e){if(this._getType(e)!==Dn.undefined){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.void,received:r.parsedType}),io}return r1(e.data)}};lUe.create=t=>new lUe({typeName:wr.ZodVoid,...ns(t)});az=class t extends Us{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==Dn.array)return hn(r,{code:yr.invalid_type,expected:Dn.array,received:r.parsedType}),io;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(hn(r,{code:yr.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>o.type._parseAsync(new Yk(r,c,r.path,l)))).then(c=>yC.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new Yk(r,c,r.path,l)));return yC.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:ei.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:ei.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:ei.toString(r)}})}nonempty(e){return this.min(1,e)}};az.create=(t,e)=>new az({type:t,minLength:null,maxLength:null,exactLength:null,typeName:wr.ZodArray,...ns(e)});a(DCe,"C8");sx=class t extends Us{static{a(this,"g$")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=bc.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==Dn.object){let u=this._getOrReturnCtx(e);return hn(u,{code:yr.invalid_type,expected:Dn.object,received:u.parsedType}),io}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof xB&&this._def.unknownKeys==="strip"))for(let u in n.data)s.includes(u)||c.push(u);let l=[];for(let u of s){let d=o[u],f=n.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Yk(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof xB){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")c.length>0&&(hn(n,{code:yr.unrecognized_keys,keys:c}),r.dirty());else if(u!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of c){let f=n.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Yk(n,f,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of l){let f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>yC.mergeObjectSync(r,u)):yC.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ei.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:a((r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:ei.errToObj(e).message??o}:{message:o}},"errorMap")}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:a(()=>({...this._def.shape(),...e}),"shape")})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:a(()=>({...this._def.shape(),...e._def.shape()}),"shape"),typeName:wr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of bc.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}omit(e){let r={};for(let n of bc.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return DCe(this)}partial(e){let r={};for(let n of bc.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new t({...this._def,shape:a(()=>r,"shape")})}required(e){let r={};for(let n of bc.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof zk;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return Hao(bc.objectKeys(this.shape))}};sx.create=(t,e)=>new sx({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:xB.create(),typeName:wr.ZodObject,...ns(e)});sx.strictCreate=(t,e)=>new sx({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:xB.create(),typeName:wr.ZodObject,...ns(e)});sx.lazycreate=(t,e)=>new sx({shape:t,unknownKeys:"strip",catchall:xB.create(),typeName:wr.ZodObject,...ns(e)});JCe=class extends Us{static{a(this,"J7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new Wk(l.ctx.common.issues));return hn(r,{code:yr.invalid_union,unionErrors:c}),io}if(a(o,"Y"),r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(o);{let s,c=[];for(let u of n){let d={...r,common:{...r.common,issues:[]},parent:null},f=u._parseSync({data:r.data,path:r.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(u=>new Wk(u));return hn(r,{code:yr.invalid_union,unionErrors:l}),io}}get options(){return this._def.options}};JCe.create=(t,e)=>new JCe({options:t,typeName:wr.ZodUnion,...ns(e)});x9=a(t=>t instanceof XCe?x9(t.schema):t instanceof yM?x9(t.innerType()):t instanceof ebe?[t.value]:t instanceof tbe?t.options:t instanceof rbe?bc.objectValues(t.enum):t instanceof nbe?x9(t._def.innerType):t instanceof YCe?[void 0]:t instanceof KCe?[null]:t instanceof zk?[void 0,...x9(t.unwrap())]:t instanceof O9?[null,...x9(t.unwrap())]:t instanceof vkt||t instanceof obe?x9(t.unwrap()):t instanceof ibe?x9(t._def.innerType):[],"c4"),LQr=class t extends Us{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Dn.object)return hn(r,{code:yr.invalid_type,expected:Dn.object,received:r.parsedType}),io;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(hn(r,{code:yr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),io)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let c=x9(s.shape[e]);if(!c.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let l of c){if(o.has(l))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);o.set(l,s)}}return new t({typeName:wr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...ns(n)})}};a(BQr,"fH");ZCe=class extends Us{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(Cio(s)||Cio(c))return io;let l=BQr(s.value,c.value);return l.valid?((bio(s)||bio(c))&&r.dirty(),{status:r.value,value:l.data}):(hn(n,{code:yr.invalid_intersection_types}),io)},"Y");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>o(s,c)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ZCe.create=(t,e,r)=>new ZCe({left:t,right:e,typeName:wr.ZodIntersection,...ns(r)});M9=class t extends Us{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Dn.array)return hn(n,{code:yr.invalid_type,expected:Dn.array,received:n.parsedType}),io;if(n.data.lengththis._def.items.length&&(hn(n,{code:yr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new Yk(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>yC.mergeArray(r,s)):yC.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};M9.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new M9({items:t,typeName:wr.ZodTuple,rest:null,...ns(e)})};FQr=class t extends Us{static{a(this,"TX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Dn.object)return hn(n,{code:yr.invalid_type,expected:Dn.object,received:n.parsedType}),io;let o=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)o.push({key:s._parse(new Yk(n,l,n.path,l)),value:c._parse(new Yk(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?yC.mergeObjectAsync(r,o):yC.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Us?new t({keyType:e,valueType:r,typeName:wr.ZodRecord,...ns(n)}):new t({keyType:zCe.create(),valueType:e,typeName:wr.ZodRecord,...ns(r)})}},uUe=class extends Us{static{a(this,"xX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Dn.map)return hn(n,{code:yr.invalid_type,expected:Dn.map,received:n.parsedType}),io;let o=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,u],d)=>({key:o._parse(new Yk(n,l,n.path,[d,"key"])),value:s._parse(new Yk(n,u,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of c){let d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return io;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let u of c){let{key:d,value:f}=u;if(d.status==="aborted"||f.status==="aborted")return io;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}}}};uUe.create=(t,e,r)=>new uUe({valueType:e,keyType:t,typeName:wr.ZodMap,...ns(r)});dUe=class t extends Us{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Dn.set)return hn(n,{code:yr.invalid_type,expected:Dn.set,received:n.parsedType}),io;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(hn(n,{code:yr.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function c(u){let d=new Set;for(let f of u){if(f.status==="aborted")return io;f.status==="dirty"&&r.dirty(),d.add(f.value)}return{status:r.value,value:d}}a(c,"W");let l=[...n.data.values()].map((u,d)=>s._parse(new Yk(n,u,n.path,d)));return n.common.async?Promise.all(l).then(u=>c(u)):c(l)}min(e,r){return new t({...this._def,minSize:{value:e,message:ei.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:ei.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};dUe.create=(t,e)=>new dUe({valueType:t,minSize:null,maxSize:null,typeName:wr.ZodSet,...ns(e)});UQr=class t extends Us{static{a(this,"sQ")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Dn.function)return hn(r,{code:yr.invalid_type,expected:Dn.function,received:r.parsedType}),io;function n(l,u){return OQr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,MQr(),rUe].filter(d=>!!d),issueData:{code:yr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return OQr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,MQr(),rUe].filter(d=>!!d),issueData:{code:yr.invalid_return_type,returnTypeError:u}})}a(o,"Y");let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof Zoe){let l=this;return r1(async function(...u){let d=new Wk([]),f=await l._def.args.parseAsync(u,s).catch(m=>{throw d.addIssue(n(u,m)),d}),h=await Reflect.apply(c,this,f);return await l._def.returns._def.type.parseAsync(h,s).catch(m=>{throw d.addIssue(o(h,m)),d})})}else{let l=this;return r1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new Wk([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new Wk([o(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:M9.create(e).rest(nz.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||M9.create([]).rest(nz.create()),returns:r||nz.create(),typeName:wr.ZodFunction,...ns(n)})}},XCe=class extends Us{static{a(this,"Y7")}get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};XCe.create=(t,e)=>new XCe({getter:t,typeName:wr.ZodLazy,...ns(e)});ebe=class extends Us{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return hn(r,{received:r.data,code:yr.invalid_literal,expected:this._def.value}),io}return{status:"valid",value:e.data}}get value(){return this._def.value}};ebe.create=(t,e)=>new ebe({value:t,typeName:wr.ZodLiteral,...ns(e)});a(Hao,"JM");tbe=class t extends Us{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return hn(r,{expected:bc.joinValues(n),received:r.parsedType,code:yr.invalid_type}),io}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return hn(r,{received:r.data,code:yr.invalid_enum_value,options:n}),io}return r1(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};tbe.create=Hao;rbe=class extends Us{static{a(this,"G7")}_parse(e){let r=bc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Dn.string&&n.parsedType!==Dn.number){let o=bc.objectValues(r);return hn(n,{expected:bc.joinValues(o),received:n.parsedType,code:yr.invalid_type}),io}if(this._cache||(this._cache=new Set(bc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=bc.objectValues(r);return hn(n,{received:n.data,code:yr.invalid_enum_value,options:o}),io}return r1(e.data)}get enum(){return this._def.values}};rbe.create=(t,e)=>new rbe({values:t,typeName:wr.ZodNativeEnum,...ns(e)});Zoe=class extends Us{static{a(this,"f8")}unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Dn.promise&&r.common.async===!1)return hn(r,{code:yr.invalid_type,expected:Dn.promise,received:r.parsedType}),io;let n=r.parsedType===Dn.promise?r.data:Promise.resolve(r.data);return r1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Zoe.create=(t,e)=>new Zoe({type:t,typeName:wr.ZodPromise,...ns(e)});yM=class extends Us{static{a(this,"P4")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===wr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:a(c=>{hn(n,c),c.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let c=o.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async l=>{if(r.value==="aborted")return io;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?io:u.status==="dirty"||r.value==="dirty"?Q6e(u.value):u});{if(r.value==="aborted")return io;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?io:l.status==="dirty"||r.value==="dirty"?Q6e(l.value):l}}if(o.type==="refinement"){let c=a(l=>{let u=o.refinement(l,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"W");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?io:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?io:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(o.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!WCe(c))return io;let l=o.transform(c.value,s);if(l instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>WCe(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):io);bc.assertNever(o)}};yM.create=(t,e,r)=>new yM({schema:t,typeName:wr.ZodEffects,effect:e,...ns(r)});yM.createWithPreprocess=(t,e,r)=>new yM({schema:e,effect:{type:"preprocess",transform:t},typeName:wr.ZodEffects,...ns(r)});zk=class extends Us{static{a(this,"o6")}_parse(e){return this._getType(e)===Dn.undefined?r1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};zk.create=(t,e)=>new zk({innerType:t,typeName:wr.ZodOptional,...ns(e)});O9=class extends Us{static{a(this,"A1")}_parse(e){return this._getType(e)===Dn.null?r1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};O9.create=(t,e)=>new O9({innerType:t,typeName:wr.ZodNullable,...ns(e)});nbe=class extends Us{static{a(this,"U7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===Dn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};nbe.create=(t,e)=>new nbe({innerType:t,typeName:wr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ns(e)});ibe=class extends Us{static{a(this,"H7")}_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ekt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Wk(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Wk(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ibe.create=(t,e)=>new ibe({innerType:t,typeName:wr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ns(e)});fUe=class extends Us{static{a(this,"yX")}_parse(e){if(this._getType(e)!==Dn.nan){let r=this._getOrReturnCtx(e);return hn(r,{code:yr.invalid_type,expected:Dn.nan,received:r.parsedType}),io}return{status:"valid",value:e.data}}};fUe.create=t=>new fUe({typeName:wr.ZodNaN,...ns(t)});vkt=class extends Us{static{a(this,"hH")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Ckt=class t extends Us{static{a(this,"fX")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?io:o.status==="dirty"?(r.dirty(),Q6e(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?io:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:wr.ZodPipeline})}},obe=class extends Us{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(WCe(o)&&(o.value=Object.freeze(o.value)),o),"J");return Ekt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};obe.create=(t,e)=>new obe({innerType:t,typeName:wr.ZodReadonly,...ns(e)});Dfm={object:sx.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(wr||(wr={}));Nfm=zCe.create,Mfm=nUe.create,Ofm=fUe.create,Lfm=iUe.create,Bfm=oUe.create,Ffm=sUe.create,Ufm=aUe.create,Qfm=YCe.create,qfm=KCe.create,jfm=cUe.create,Hfm=nz.create,Gfm=xB.create,$fm=lUe.create,Vfm=az.create,yrl=sx.create,Wfm=sx.strictCreate,zfm=JCe.create,Yfm=LQr.create,Kfm=ZCe.create,Jfm=M9.create,Zfm=FQr.create,Xfm=uUe.create,epm=dUe.create,tpm=UQr.create,rpm=XCe.create,npm=ebe.create,ipm=tbe.create,opm=rbe.create,spm=Zoe.create,apm=yM.create,cpm=zk.create,lpm=O9.create,upm=yM.createWithPreprocess,dpm=Ckt.create,Gao={};RB(Gao,{version:a(()=>tlo,"version"),util:a(()=>Xs,"util"),treeifyError:a(()=>rco,"treeifyError"),toJSONSchema:a(()=>nHr,"toJSONSchema"),toDotPath:a(()=>nco,"toDotPath"),safeParseAsync:a(()=>EPt,"safeParseAsync"),safeParse:a(()=>_Pt,"safeParse"),registry:a(()=>Cjr,"registry"),regexes:a(()=>cjr,"regexes"),prettifyError:a(()=>ico,"prettifyError"),parseAsync:a(()=>Ikt,"parseAsync"),parse:a(()=>Tkt,"parse"),locales:a(()=>vjr,"locales"),isValidJWT:a(()=>Tlo,"isValidJWT"),isValidBase64URL:a(()=>Clo,"isValidBase64URL"),isValidBase64:a(()=>fjr,"isValidBase64"),globalRegistry:a(()=>P9,"globalRegistry"),globalConfig:a(()=>bkt,"globalConfig"),function:a(()=>Wuo,"function"),formatError:a(()=>njr,"formatError"),flattenError:a(()=>rjr,"flattenError"),config:a(()=>_C,"config"),clone:a(()=>bM,"clone"),_xid:a(()=>Mjr,"_xid"),_void:a(()=>Duo,"_void"),_uuidv7:a(()=>xjr,"_uuidv7"),_uuidv6:a(()=>Ijr,"_uuidv6"),_uuidv4:a(()=>Tjr,"_uuidv4"),_uuid:a(()=>Sjr,"_uuid"),_url:a(()=>wjr,"_url"),_uppercase:a(()=>Wjr,"_uppercase"),_unknown:a(()=>kkt,"_unknown"),_union:a(()=>_il,"_union"),_undefined:a(()=>wuo,"_undefined"),_ulid:a(()=>Njr,"_ulid"),_uint64:a(()=>Iuo,"_uint64"),_uint32:a(()=>Euo,"_uint32"),_tuple:a(()=>quo,"_tuple"),_trim:a(()=>Xjr,"_trim"),_transform:a(()=>wil,"_transform"),_toUpperCase:a(()=>tHr,"_toUpperCase"),_toLowerCase:a(()=>eHr,"_toLowerCase"),_templateLiteral:a(()=>Bil,"_templateLiteral"),_symbol:a(()=>xuo,"_symbol"),_success:a(()=>Nil,"_success"),_stringbool:a(()=>$uo,"_stringbool"),_stringFormat:a(()=>Vuo,"_stringFormat"),_string:a(()=>auo,"_string"),_startsWith:a(()=>Yjr,"_startsWith"),_size:a(()=>Gjr,"_size"),_set:a(()=>Sil,"_set"),_safeParseAsync:a(()=>ajr,"_safeParseAsync"),_safeParse:a(()=>sjr,"_safeParse"),_regex:a(()=>$jr,"_regex"),_refine:a(()=>Guo,"_refine"),_record:a(()=>Cil,"_record"),_readonly:a(()=>Lil,"_readonly"),_property:a(()=>Quo,"_property"),_promise:a(()=>Uil,"_promise"),_positive:a(()=>Luo,"_positive"),_pipe:a(()=>Oil,"_pipe"),_parseAsync:a(()=>ojr,"_parseAsync"),_parse:a(()=>ijr,"_parse"),_overwrite:a(()=>ose,"_overwrite"),_optional:a(()=>Ril,"_optional"),_number:a(()=>huo,"_number"),_nullable:a(()=>kil,"_nullable"),_null:a(()=>Ruo,"_null"),_normalize:a(()=>Zjr,"_normalize"),_nonpositive:a(()=>Fuo,"_nonpositive"),_nonoptional:a(()=>Dil,"_nonoptional"),_nonnegative:a(()=>Uuo,"_nonnegative"),_never:a(()=>Puo,"_never"),_negative:a(()=>Buo,"_negative"),_nativeEnum:a(()=>Iil,"_nativeEnum"),_nanoid:a(()=>kjr,"_nanoid"),_nan:a(()=>Ouo,"_nan"),_multipleOf:a(()=>gUe,"_multipleOf"),_minSize:a(()=>AUe,"_minSize"),_minLength:a(()=>abe,"_minLength"),_min:a(()=>rx,"_min"),_mime:a(()=>Jjr,"_mime"),_maxSize:a(()=>CPt,"_maxSize"),_maxLength:a(()=>bPt,"_maxLength"),_max:a(()=>gM,"_max"),_map:a(()=>bil,"_map"),_lte:a(()=>gM,"_lte"),_lt:a(()=>Xoe,"_lt"),_lowercase:a(()=>Vjr,"_lowercase"),_literal:a(()=>xil,"_literal"),_length:a(()=>SPt,"_length"),_lazy:a(()=>Fil,"_lazy"),_ksuid:a(()=>Ojr,"_ksuid"),_jwt:a(()=>Hjr,"_jwt"),_isoTime:a(()=>fuo,"_isoTime"),_isoDuration:a(()=>puo,"_isoDuration"),_isoDateTime:a(()=>uuo,"_isoDateTime"),_isoDate:a(()=>duo,"_isoDate"),_ipv6:a(()=>Bjr,"_ipv6"),_ipv4:a(()=>Ljr,"_ipv4"),_intersection:a(()=>vil,"_intersection"),_int64:a(()=>Tuo,"_int64"),_int32:a(()=>_uo,"_int32"),_int:a(()=>guo,"_int"),_includes:a(()=>zjr,"_includes"),_guid:a(()=>Rkt,"_guid"),_gte:a(()=>rx,"_gte"),_gt:a(()=>ese,"_gt"),_float64:a(()=>yuo,"_float64"),_float32:a(()=>Auo,"_float32"),_file:a(()=>juo,"_file"),_enum:a(()=>Til,"_enum"),_endsWith:a(()=>Kjr,"_endsWith"),_emoji:a(()=>Rjr,"_emoji"),_email:a(()=>bjr,"_email"),_e164:a(()=>jjr,"_e164"),_discriminatedUnion:a(()=>Eil,"_discriminatedUnion"),_default:a(()=>Pil,"_default"),_date:a(()=>Nuo,"_date"),_custom:a(()=>Huo,"_custom"),_cuid2:a(()=>Djr,"_cuid2"),_cuid:a(()=>Pjr,"_cuid"),_coercedString:a(()=>cuo,"_coercedString"),_coercedNumber:a(()=>muo,"_coercedNumber"),_coercedDate:a(()=>Muo,"_coercedDate"),_coercedBoolean:a(()=>Cuo,"_coercedBoolean"),_coercedBigint:a(()=>Suo,"_coercedBigint"),_cidrv6:a(()=>Ujr,"_cidrv6"),_cidrv4:a(()=>Fjr,"_cidrv4"),_catch:a(()=>Mil,"_catch"),_boolean:a(()=>vuo,"_boolean"),_bigint:a(()=>buo,"_bigint"),_base64url:a(()=>qjr,"_base64url"),_base64:a(()=>Qjr,"_base64"),_array:a(()=>rHr,"_array"),_any:a(()=>kuo,"_any"),TimePrecision:a(()=>luo,"TimePrecision"),NEVER:a(()=>$ao,"NEVER"),JSONSchemaGenerator:a(()=>yUe,"JSONSchemaGenerator"),JSONSchema:a(()=>Qil,"JSONSchema"),Doc:a(()=>xkt,"Doc"),$output:a(()=>ouo,"$output"),$input:a(()=>suo,"$input"),$constructor:a(()=>pt,"$constructor"),$brand:a(()=>Vao,"$brand"),$ZodXID:a(()=>dlo,"$ZodXID"),$ZodVoid:a(()=>Olo,"$ZodVoid"),$ZodUnknown:a(()=>wkt,"$ZodUnknown"),$ZodUnion:a(()=>yjr,"$ZodUnion"),$ZodUndefined:a(()=>Plo,"$ZodUndefined"),$ZodUUID:a(()=>nlo,"$ZodUUID"),$ZodURL:a(()=>olo,"$ZodURL"),$ZodULID:a(()=>ulo,"$ZodULID"),$ZodType:a(()=>So,"$ZodType"),$ZodTuple:a(()=>vPt,"$ZodTuple"),$ZodTransform:a(()=>_jr,"$ZodTransform"),$ZodTemplateLiteral:a(()=>euo,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>klo,"$ZodSymbol"),$ZodSuccess:a(()=>Klo,"$ZodSuccess"),$ZodStringFormat:a(()=>Wu,"$ZodStringFormat"),$ZodString:a(()=>kUe,"$ZodString"),$ZodSet:a(()=>qlo,"$ZodSet"),$ZodRegistry:a(()=>mUe,"$ZodRegistry"),$ZodRecord:a(()=>Ulo,"$ZodRecord"),$ZodRealError:a(()=>wUe,"$ZodRealError"),$ZodReadonly:a(()=>Xlo,"$ZodReadonly"),$ZodPromise:a(()=>tuo,"$ZodPromise"),$ZodPrefault:a(()=>zlo,"$ZodPrefault"),$ZodPipe:a(()=>Ejr,"$ZodPipe"),$ZodOptional:a(()=>$lo,"$ZodOptional"),$ZodObject:a(()=>Ajr,"$ZodObject"),$ZodNumberFormat:a(()=>wlo,"$ZodNumberFormat"),$ZodNumber:a(()=>pjr,"$ZodNumber"),$ZodNullable:a(()=>Vlo,"$ZodNullable"),$ZodNull:a(()=>Dlo,"$ZodNull"),$ZodNonOptional:a(()=>Ylo,"$ZodNonOptional"),$ZodNever:a(()=>Mlo,"$ZodNever"),$ZodNanoID:a(()=>alo,"$ZodNanoID"),$ZodNaN:a(()=>Zlo,"$ZodNaN"),$ZodMap:a(()=>Qlo,"$ZodMap"),$ZodLiteral:a(()=>Hlo,"$ZodLiteral"),$ZodLazy:a(()=>ruo,"$ZodLazy"),$ZodKSUID:a(()=>flo,"$ZodKSUID"),$ZodJWT:a(()=>Ilo,"$ZodJWT"),$ZodIntersection:a(()=>Flo,"$ZodIntersection"),$ZodISOTime:a(()=>mlo,"$ZodISOTime"),$ZodISODuration:a(()=>glo,"$ZodISODuration"),$ZodISODateTime:a(()=>plo,"$ZodISODateTime"),$ZodISODate:a(()=>hlo,"$ZodISODate"),$ZodIPv6:a(()=>ylo,"$ZodIPv6"),$ZodIPv4:a(()=>Alo,"$ZodIPv4"),$ZodGUID:a(()=>rlo,"$ZodGUID"),$ZodFunction:a(()=>Pkt,"$ZodFunction"),$ZodFile:a(()=>Glo,"$ZodFile"),$ZodError:a(()=>tjr,"$ZodError"),$ZodEnum:a(()=>jlo,"$ZodEnum"),$ZodEmoji:a(()=>slo,"$ZodEmoji"),$ZodEmail:a(()=>ilo,"$ZodEmail"),$ZodE164:a(()=>Slo,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>Blo,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>Wlo,"$ZodDefault"),$ZodDate:a(()=>Llo,"$ZodDate"),$ZodCustomStringFormat:a(()=>xlo,"$ZodCustomStringFormat"),$ZodCustom:a(()=>nuo,"$ZodCustom"),$ZodCheckUpperCase:a(()=>zco,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>RUe,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>Kco,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>jco,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>Vco,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>Zco,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>elo,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>Fco,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>Bco,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>qco,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>Gco,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>Xco,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>Qco,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>Hco,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>Wco,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>ujr,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>$co,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>Yco,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>djr,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>Jco,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>Uco,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>Qh,"$ZodCheck"),$ZodCatch:a(()=>Jlo,"$ZodCatch"),$ZodCUID2:a(()=>llo,"$ZodCUID2"),$ZodCUID:a(()=>clo,"$ZodCUID"),$ZodCIDRv6:a(()=>Elo,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>_lo,"$ZodCIDRv4"),$ZodBoolean:a(()=>hjr,"$ZodBoolean"),$ZodBigIntFormat:a(()=>Rlo,"$ZodBigIntFormat"),$ZodBigInt:a(()=>mjr,"$ZodBigInt"),$ZodBase64URL:a(()=>blo,"$ZodBase64URL"),$ZodBase64:a(()=>vlo,"$ZodBase64"),$ZodAsyncError:a(()=>cz,"$ZodAsyncError"),$ZodArray:a(()=>gjr,"$ZodArray"),$ZodAny:a(()=>Nlo,"$ZodAny")});$ao=Object.freeze({status:"aborted"});a(pt,"F");Vao=Symbol("zod_brand"),cz=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},bkt={};a(_C,"c$");Xs={};RB(Xs,{unwrapMessage:a(()=>q6e,"unwrapMessage"),stringifyPrimitive:a(()=>gs,"stringifyPrimitive"),required:a(()=>Orl,"required"),randomString:a(()=>Irl,"randomString"),propertyKeyTypes:a(()=>Skt,"propertyKeyTypes"),promiseAllObject:a(()=>Trl,"promiseAllObject"),primitiveTypes:a(()=>Kao,"primitiveTypes"),prefixIssues:a(()=>Vk,"prefixIssues"),pick:a(()=>krl,"pick"),partial:a(()=>Mrl,"partial"),optionalKeys:a(()=>Jao,"optionalKeys"),omit:a(()=>Prl,"omit"),numKeys:a(()=>xrl,"numKeys"),nullish:a(()=>nse,"nullish"),normalizeParams:a(()=>Pr,"normalizeParams"),merge:a(()=>Nrl,"merge"),jsonStringifyReplacer:a(()=>Wao,"jsonStringifyReplacer"),joinValues:a(()=>Kr,"joinValues"),issue:a(()=>eco,"issue"),isPlainObject:a(()=>hUe,"isPlainObject"),isObject:a(()=>pUe,"isObject"),getSizableOrigin:a(()=>APt,"getSizableOrigin"),getParsedType:a(()=>wrl,"getParsedType"),getLengthableOrigin:a(()=>yPt,"getLengthableOrigin"),getEnumValues:a(()=>Zqr,"getEnumValues"),getElementAtPath:a(()=>Srl,"getElementAtPath"),floatSafeRemainder:a(()=>zao,"floatSafeRemainder"),finalizeIssue:a(()=>_M,"finalizeIssue"),extend:a(()=>Drl,"extend"),escapeRegex:a(()=>ise,"escapeRegex"),esc:a(()=>NCe,"esc"),defineLazy:a(()=>sl,"defineLazy"),createTransparentProxy:a(()=>Rrl,"createTransparentProxy"),clone:a(()=>bM,"clone"),cleanRegex:a(()=>gPt,"cleanRegex"),cleanEnum:a(()=>Lrl,"cleanEnum"),captureStackTrace:a(()=>ejr,"captureStackTrace"),cached:a(()=>mPt,"cached"),assignProp:a(()=>Xqr,"assignProp"),assertNotEqual:a(()=>Erl,"assertNotEqual"),assertNever:a(()=>Crl,"assertNever"),assertIs:a(()=>vrl,"assertIs"),assertEqual:a(()=>_rl,"assertEqual"),assert:a(()=>brl,"assert"),allowsEval:a(()=>Yao,"allowsEval"),aborted:a(()=>FCe,"aborted"),NUMBER_FORMAT_RANGES:a(()=>Zao,"NUMBER_FORMAT_RANGES"),Class:a(()=>QQr,"Class"),BIGINT_FORMAT_RANGES:a(()=>Xao,"BIGINT_FORMAT_RANGES")});a(_rl,"lh");a(Erl,"ch");a(vrl,"ph");a(Crl,"dh");a(brl,"ih");a(Zqr,"B7");a(Kr,"P");a(Wao,"mH");a(mPt,"z7");a(nse,"I1");a(gPt,"N7");a(zao,"lH");a(sl,"N$");a(Xqr,"cH");a(Srl,"nh");a(Trl,"rh");a(Irl,"oh");a(NCe,"j0");ejr=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(pUe,"g8");Yao=mPt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(hUe,"h8");a(xrl,"th");wrl=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw Error(`Unknown data type: ${e}`)}},"ah"),Skt=new Set(["string","number","symbol"]),Kao=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(ise,"r4");a(bM,"H6");a(Pr,"k");a(Rrl,"sh");a(gs,"x");a(Jao,"iH");Zao={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Xao={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(krl,"eh");a(Prl,"$u");a(Drl,"Qu");a(Nrl,"Ju");a(Mrl,"Xu");a(Orl,"Yu");a(FCe,"A0");a(Vk,"I6");a(q6e,"V7");a(_M,"g6");a(APt,"O7");a(yPt,"D7");a(eco,"oH");a(Lrl,"Wu");QQr=class{static{a(this,"YM")}constructor(...e){}},tco=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,Wao,2)},enumerable:!0})},"WM"),tjr=pt("$ZodError",tco),wUe=pt("$ZodError",tco,{Parent:Error});a(rjr,"m8");a(njr,"l8");a(rco,"mX");a(nco,"GM");a(ico,"lX");ijr=a(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new cz;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>_M(u,s,_C())));throw ejr(l,o?.callee),l}return c.value},"cX"),Tkt=ijr(wUe),ojr=a(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>_M(u,s,_C())));throw ejr(l,o?.callee),l}return c.value},"pX"),Ikt=ojr(wUe),sjr=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new cz;return s.issues.length?{success:!1,error:new(t??tjr)(s.issues.map(c=>_M(c,o,_C())))}:{success:!0,data:s.value}},"dX"),_Pt=sjr(wUe),ajr=a(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>_M(c,o,_C())))}:{success:!0,data:s.value}},"iX"),EPt=ajr(wUe),cjr={};RB(cjr,{xid:a(()=>cco,"xid"),uuid7:a(()=>Qrl,"uuid7"),uuid6:a(()=>Url,"uuid6"),uuid4:a(()=>Frl,"uuid4"),uuid:a(()=>sbe,"uuid"),uppercase:a(()=>Oco,"uppercase"),unicodeEmail:a(()=>Hrl,"unicodeEmail"),undefined:a(()=>Nco,"undefined"),ulid:a(()=>aco,"ulid"),time:a(()=>Tco,"time"),string:a(()=>xco,"string"),rfc5322Email:a(()=>jrl,"rfc5322Email"),number:a(()=>kco,"number"),null:a(()=>Dco,"null"),nanoid:a(()=>uco,"nanoid"),lowercase:a(()=>Mco,"lowercase"),ksuid:a(()=>lco,"ksuid"),ipv6:a(()=>gco,"ipv6"),ipv4:a(()=>mco,"ipv4"),integer:a(()=>Rco,"integer"),html5Email:a(()=>qrl,"html5Email"),hostname:a(()=>Eco,"hostname"),guid:a(()=>fco,"guid"),extendedDuration:a(()=>Brl,"extendedDuration"),emoji:a(()=>hco,"emoji"),email:a(()=>pco,"email"),e164:a(()=>vco,"e164"),duration:a(()=>dco,"duration"),domain:a(()=>Vrl,"domain"),datetime:a(()=>Ico,"datetime"),date:a(()=>bco,"date"),cuid2:a(()=>sco,"cuid2"),cuid:a(()=>oco,"cuid"),cidrv6:a(()=>yco,"cidrv6"),cidrv4:a(()=>Aco,"cidrv4"),browserEmail:a(()=>Grl,"browserEmail"),boolean:a(()=>Pco,"boolean"),bigint:a(()=>wco,"bigint"),base64url:a(()=>ljr,"base64url"),base64:a(()=>_co,"base64"),_emoji:a(()=>$rl,"_emoji")});oco=/^[cC][^\s-]{8,}$/,sco=/^[0-9a-z]+$/,aco=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,cco=/^[0-9a-vA-V]{20}$/,lco=/^[A-Za-z0-9]{27}$/,uco=/^[a-zA-Z0-9_-]{21}$/,dco=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Brl=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fco=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,sbe=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,"P0"),Frl=sbe(4),Url=sbe(6),Qrl=sbe(7),pco=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qrl=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,jrl=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Hrl=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Grl=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,$rl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(hco,"WK");mco=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gco=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Aco=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,yco=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_co=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ljr=/^[A-Za-z0-9_-]*$/,Eco=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Vrl=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,vco=/^\+(?:[0-9]){6,14}[0-9]$/,Cco="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",bco=new RegExp(`^${Cco}$`);a(Sco,"HM");a(Tco,"NK");a(Ico,"wK");xco=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),wco=/^\d+n?$/,Rco=/^\d+$/,kco=/^-?\d+(?:\.\d+)?/i,Pco=/true|false/i,Dco=/null/i,Nco=/undefined/i,Mco=/^[^A-Z]*$/,Oco=/^[^a-z]*$/,Qh=pt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Lco={number:"number",bigint:"bigint",object:"date"},ujr=pt("$ZodCheckLessThan",(t,e)=>{Qh.init(t,e);let r=Lco[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{Qh.init(t,e);let r=Lco[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Bco=pt("$ZodCheckMultipleOf",(t,e)=>{Qh.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):zao(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Fco=pt("$ZodCheckNumberFormat",(t,e)=>{Qh.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=Zao[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=o,l.maximum=s,r&&(l.pattern=Rco)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}ls&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inst:t})}}),Uco=pt("$ZodCheckBigIntFormat",(t,e)=>{Qh.init(t,e);let[r,n]=Xao[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=r,s.maximum=n}),t._zod.check=o=>{let s=o.value;sn&&o.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inst:t})}}),Qco=pt("$ZodCheckMaxSize",(t,e)=>{Qh.init(t,e),t._zod.when=r=>{let n=r.value;return!nse(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;n.size<=e.maximum||r.issues.push({origin:APt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),qco=pt("$ZodCheckMinSize",(t,e)=>{Qh.init(t,e),t._zod.when=r=>{let n=r.value;return!nse(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let n=r.value;n.size>=e.minimum||r.issues.push({origin:APt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),jco=pt("$ZodCheckSizeEquals",(t,e)=>{Qh.init(t,e),t._zod.when=r=>{let n=r.value;return!nse(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=r=>{let n=r.value,o=n.size;if(o===e.size)return;let s=o>e.size;r.issues.push({origin:APt(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Hco=pt("$ZodCheckMaxLength",(t,e)=>{Qh.init(t,e),t._zod.when=r=>{let n=r.value;return!nse(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;if(n.length<=e.maximum)return;let o=yPt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Gco=pt("$ZodCheckMinLength",(t,e)=>{Qh.init(t,e),t._zod.when=r=>{let n=r.value;return!nse(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let n=r.value;if(n.length>=e.minimum)return;let o=yPt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),$co=pt("$ZodCheckLengthEquals",(t,e)=>{Qh.init(t,e),t._zod.when=r=>{let n=r.value;return!nse(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=r=>{let n=r.value,o=n.length;if(o===e.length)return;let s=yPt(n),c=o>e.length;r.issues.push({origin:s,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),RUe=pt("$ZodCheckStringFormat",(t,e)=>{var r,n;Qh.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),Vco=pt("$ZodCheckRegex",(t,e)=>{RUe.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Wco=pt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Mco),RUe.init(t,e)}),zco=pt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Oco),RUe.init(t,e)}),Yco=pt("$ZodCheckIncludes",(t,e)=>{Qh.init(t,e);let r=ise(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),Kco=pt("$ZodCheckStartsWith",(t,e)=>{Qh.init(t,e);let r=new RegExp(`^${ise(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),Jco=pt("$ZodCheckEndsWith",(t,e)=>{Qh.init(t,e);let r=new RegExp(`.*${ise(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});a(Tio,"KM");Zco=pt("$ZodCheckProperty",(t,e)=>{Qh.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>Tio(o,r,e.property));Tio(n,r,e.property)}}),Xco=pt("$ZodCheckMimeType",(t,e)=>{Qh.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t})}}),elo=pt("$ZodCheckOverwrite",(t,e)=>{Qh.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),xkt=class{static{a(this,"tX")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(` `).filter(s=>s),n=Math.min(...r.map(s=>s.length-s.trimStart().length)),o=r.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,n.join(` -`))}},Xco={major:4,minor:0,patch:0},So=pt("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Xco;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((s,c,l)=>{let u=FCe(s),d;for(let f of c){if(f._zod.when){if(!f._zod.when(s))continue}else if(u)continue;let h=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new az;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=FCe(s,h)))});else{if(s.issues.length===h)continue;u||(u=FCe(s,h))}}return d?d.then(()=>s):s},"X");t._zod.run=(s,c)=>{let l=t._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new az;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=yPt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return _Pt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),kUe=pt("$ZodString",(t,e)=>{So.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Tco(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Wu=pt("$ZodStringFormat",(t,e)=>{RUe.init(t,e),kUe.init(t,e)}),elo=pt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=uco),Wu.init(t,e)}),tlo=pt("$ZodUUID",(t,e)=>{if(e.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=sbe(r))}else e.pattern??(e.pattern=sbe());Wu.init(t,e)}),rlo=pt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=dco),Wu.init(t,e)}),nlo=pt("$ZodURL",(t,e)=>{Wu.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;e.hostname&&(e.hostname.lastIndex=0,!e.hostname.test(o.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:yco.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,!e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),ilo=pt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=fco()),Wu.init(t,e)}),olo=pt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=cco),Wu.init(t,e)}),slo=pt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=nco),Wu.init(t,e)}),alo=pt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=ico),Wu.init(t,e)}),clo=pt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=oco),Wu.init(t,e)}),llo=pt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=sco),Wu.init(t,e)}),ulo=pt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=aco),Wu.init(t,e)}),dlo=pt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Sco(e)),Wu.init(t,e)}),flo=pt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=vco),Wu.init(t,e)}),plo=pt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=bco(e)),Wu.init(t,e)}),hlo=pt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=lco),Wu.init(t,e)}),mlo=pt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=pco),Wu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),glo=pt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=hco),Wu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),Alo=pt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=mco),Wu.init(t,e)}),ylo=pt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=gco),Wu.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw Error();let s=Number(o);if(`${s}`!==o||s<0||s>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});a(djr,"oK");_lo=pt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Aco),Wu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{djr(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(Elo,"AM");vlo=pt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=cjr),Wu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{Elo(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Clo=pt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=_co),Wu.init(t,e)});a(blo,"IM");Slo=pt("$ZodJWT",(t,e)=>{Wu.init(t,e),t._zod.check=r=>{blo(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Tlo=pt("$ZodCustomStringFormat",(t,e)=>{Wu.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),fjr=pt("$ZodNumber",(t,e)=>{So.init(t,e),t._zod.pattern=t._zod.bag.pattern??wco,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),Ilo=pt("$ZodNumber",(t,e)=>{Lco.init(t,e),fjr.init(t,e)}),pjr=pt("$ZodBoolean",(t,e)=>{So.init(t,e),t._zod.pattern=Rco,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),hjr=pt("$ZodBigInt",(t,e)=>{So.init(t,e),t._zod.pattern=Ico,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),xlo=pt("$ZodBigInt",(t,e)=>{Bco.init(t,e),hjr.init(t,e)}),wlo=pt("$ZodSymbol",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),Rlo=pt("$ZodUndefined",(t,e)=>{So.init(t,e),t._zod.pattern=Pco,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),klo=pt("$ZodNull",(t,e)=>{So.init(t,e),t._zod.pattern=kco,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),Plo=pt("$ZodAny",(t,e)=>{So.init(t,e),t._zod.parse=r=>r}),xkt=pt("$ZodUnknown",(t,e)=>{So.init(t,e),t._zod.parse=r=>r}),Dlo=pt("$ZodNever",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),Nlo=pt("$ZodVoid",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),Mlo=pt("$ZodDate",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});a(Sio,"BM");mjr=pt("$ZodArray",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let c=0;cSio(d,r,c))):Sio(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(CRt,"aX");a(Tio,"zM");gjr=pt("$ZodObject",(t,e)=>{So.init(t,e);let r=hPt(()=>{let f=Object.keys(e.shape);for(let m of f)if(!(e.shape[m]instanceof So))throw Error(`Invalid element at key "${m}": expected a Zod schema`);let h=Yao(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});sl(t._zod,"propValues",()=>{let f=e.shape,h={};for(let m in f){let g=f[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(let A of g.values)h[m].add(A)}}return h});let n=a(f=>{let h=new Ikt(["shape","payload","ctx"]),m=r.value,g=a(E=>{let v=NCe(E);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`},"w");h.write("const input = payload.value;");let A=Object.create(null),y=0;for(let E of m.keys)A[E]=`key_${y++}`;h.write("const newResult = {}");for(let E of m.keys)if(m.optionalKeys.has(E)){let v=A[E];h.write(`const ${v} = ${g(E)};`);let S=NCe(E);h.write(` +`))}},tlo={major:4,minor:0,patch:0},So=pt("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=tlo;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((s,c,l)=>{let u=FCe(s),d;for(let f of c){if(f._zod.when){if(!f._zod.when(s))continue}else if(u)continue;let h=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new cz;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=FCe(s,h)))});else{if(s.issues.length===h)continue;u||(u=FCe(s,h))}}return d?d.then(()=>s):s},"X");t._zod.run=(s,c)=>{let l=t._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new cz;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=_Pt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return EPt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),kUe=pt("$ZodString",(t,e)=>{So.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??xco(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Wu=pt("$ZodStringFormat",(t,e)=>{RUe.init(t,e),kUe.init(t,e)}),rlo=pt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=fco),Wu.init(t,e)}),nlo=pt("$ZodUUID",(t,e)=>{if(e.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=sbe(r))}else e.pattern??(e.pattern=sbe());Wu.init(t,e)}),ilo=pt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=pco),Wu.init(t,e)}),olo=pt("$ZodURL",(t,e)=>{Wu.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;e.hostname&&(e.hostname.lastIndex=0,!e.hostname.test(o.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Eco.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,!e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),slo=pt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=hco()),Wu.init(t,e)}),alo=pt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=uco),Wu.init(t,e)}),clo=pt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=oco),Wu.init(t,e)}),llo=pt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=sco),Wu.init(t,e)}),ulo=pt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=aco),Wu.init(t,e)}),dlo=pt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=cco),Wu.init(t,e)}),flo=pt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=lco),Wu.init(t,e)}),plo=pt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Ico(e)),Wu.init(t,e)}),hlo=pt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=bco),Wu.init(t,e)}),mlo=pt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Tco(e)),Wu.init(t,e)}),glo=pt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=dco),Wu.init(t,e)}),Alo=pt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=mco),Wu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),ylo=pt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=gco),Wu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),_lo=pt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Aco),Wu.init(t,e)}),Elo=pt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=yco),Wu.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw Error();let s=Number(o);if(`${s}`!==o||s<0||s>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});a(fjr,"oK");vlo=pt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=_co),Wu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{fjr(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(Clo,"AM");blo=pt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=ljr),Wu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{Clo(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Slo=pt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=vco),Wu.init(t,e)});a(Tlo,"IM");Ilo=pt("$ZodJWT",(t,e)=>{Wu.init(t,e),t._zod.check=r=>{Tlo(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),xlo=pt("$ZodCustomStringFormat",(t,e)=>{Wu.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),pjr=pt("$ZodNumber",(t,e)=>{So.init(t,e),t._zod.pattern=t._zod.bag.pattern??kco,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),wlo=pt("$ZodNumber",(t,e)=>{Fco.init(t,e),pjr.init(t,e)}),hjr=pt("$ZodBoolean",(t,e)=>{So.init(t,e),t._zod.pattern=Pco,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),mjr=pt("$ZodBigInt",(t,e)=>{So.init(t,e),t._zod.pattern=wco,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),Rlo=pt("$ZodBigInt",(t,e)=>{Uco.init(t,e),mjr.init(t,e)}),klo=pt("$ZodSymbol",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),Plo=pt("$ZodUndefined",(t,e)=>{So.init(t,e),t._zod.pattern=Nco,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),Dlo=pt("$ZodNull",(t,e)=>{So.init(t,e),t._zod.pattern=Dco,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),Nlo=pt("$ZodAny",(t,e)=>{So.init(t,e),t._zod.parse=r=>r}),wkt=pt("$ZodUnknown",(t,e)=>{So.init(t,e),t._zod.parse=r=>r}),Mlo=pt("$ZodNever",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),Olo=pt("$ZodVoid",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),Llo=pt("$ZodDate",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});a(Iio,"BM");gjr=pt("$ZodArray",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let c=0;cIio(d,r,c))):Iio(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(bRt,"aX");a(xio,"zM");Ajr=pt("$ZodObject",(t,e)=>{So.init(t,e);let r=mPt(()=>{let f=Object.keys(e.shape);for(let m of f)if(!(e.shape[m]instanceof So))throw Error(`Invalid element at key "${m}": expected a Zod schema`);let h=Jao(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});sl(t._zod,"propValues",()=>{let f=e.shape,h={};for(let m in f){let g=f[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(let A of g.values)h[m].add(A)}}return h});let n=a(f=>{let h=new xkt(["shape","payload","ctx"]),m=r.value,g=a(E=>{let v=NCe(E);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`},"w");h.write("const input = payload.value;");let A=Object.create(null),y=0;for(let E of m.keys)A[E]=`key_${y++}`;h.write("const newResult = {}");for(let E of m.keys)if(m.optionalKeys.has(E)){let v=A[E];h.write(`const ${v} = ${g(E)};`);let S=NCe(E);h.write(` if (${v}.issues.length) { if (input[${S}] === undefined) { if (${S} in input) { @@ -1627,19 +1627,19 @@ new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); if (${v}.issues.length) payload.issues = payload.issues.concat(${v}.issues.map(iss => ({ ...iss, path: iss.path ? [${NCe(E)}, ...iss.path] : [${NCe(E)}] - })));`),h.write(`newResult[${NCe(E)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let _=h.compile();return(E,v)=>_(f,E,v)},"Y"),o,s=pUe,c=!Ckt.jitless,l=c&&Wao.value,u=e.catchall,d;t._zod.parse=(f,h)=>{d??(d=r.value);let m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),f;let g=[];if(c&&l&&h?.async===!1&&h.jitless!==!0)o||(o=n(e.shape)),f=o(f,h);else{f.value={};let v=d.shape;for(let S of d.keys){let T=v[S],w=T._zod.run({value:m[S],issues:[]},h),R=T._zod.optin==="optional"&&T._zod.optout==="optional";w instanceof Promise?g.push(w.then(x=>R?Tio(x,f,S,m):CRt(x,f,S))):R?Tio(w,f,S,m):CRt(w,f,S)}}if(!u)return g.length?Promise.all(g).then(()=>f):f;let A=[],y=d.keySet,_=u._zod,E=_.def.type;for(let v of Object.keys(m)){if(y.has(v))continue;if(E==="never"){A.push(v);continue}let S=_.run({value:m[v],issues:[]},h);S instanceof Promise?g.push(S.then(T=>CRt(T,f,v))):CRt(S,f,v)}return A.length&&f.issues.push({code:"unrecognized_keys",keys:A,input:m,inst:t}),g.length?Promise.all(g).then(()=>f):f}});a(Iio,"NM");Ajr=pt("$ZodUnion",(t,e)=>{So.init(t,e),sl(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),sl(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),sl(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),sl(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>mPt(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=!1,s=[];for(let c of e.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)s.push(l),o=!0;else{if(l.issues.length===0)return l;s.push(l)}}return o?Promise.all(s).then(c=>Iio(c,r,t,n)):Iio(s,r,t,n)}}),Olo=pt("$ZodDiscriminatedUnion",(t,e)=>{Ajr.init(t,e);let r=t._zod.parse;sl(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=hPt(()=>{let o=e.options,s=new Map;for(let c of o){let l=c._zod.propValues[e.discriminator];if(!l||l.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let u of l){if(s.has(u))throw Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,c)}}return s});t._zod.parse=(o,s)=>{let c=o.value;if(!pUe(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),o;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:c,path:[e.discriminator],inst:t}),o)}}),Llo=pt("$ZodIntersection",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),c=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([l,u])=>xio(r,l,u)):xio(r,s,c)}});a(QQr,"pK");a(xio,"wM");EPt=pt("$ZodTuple",(t,e)=>{So.init(t,e);let r=e.items,n=r.length-[...r].reverse().findIndex(o=>o._zod.optin!=="optional");t._zod.parse=(o,s)=>{let c=o.value;if(!Array.isArray(c))return o.issues.push({input:c,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let l=[];if(!e.rest){let d=c.length>r.length,f=c.length=c.length&&u>=n)continue;let f=d._zod.run({value:c[u],issues:[]},s);f instanceof Promise?l.push(f.then(h=>bRt(h,o,u))):bRt(f,o,u)}if(e.rest){let d=c.slice(r.length);for(let f of d){u++;let h=e.rest._zod.run({value:f,issues:[]},s);h instanceof Promise?l.push(h.then(m=>bRt(m,o,u))):bRt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(bRt,"sX");Blo=pt("$ZodRecord",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!hUe(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[];if(e.keyType._zod.values){let c=e.keyType._zod.values;r.value={};for(let u of c)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let d=e.valueType._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&r.issues.push(...Vk(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...Vk(u,d.issues)),r.value[u]=d.value)}let l;for(let u in o)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let l=e.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(d=>_M(d,n,_C())),input:c,path:[c],inst:t}),r.value[l.value]=l.value;continue}let u=e.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...Vk(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...Vk(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),Flo=pt("$ZodMap",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let s=[];r.value=new Map;for(let[c,l]of o){let u=e.keyType._zod.run({value:c,issues:[]},n),d=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise||d instanceof Promise?s.push(Promise.all([u,d]).then(([f,h])=>{wio(f,h,r,c,o,t,n)})):wio(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(wio,"OM");Ulo=pt("$ZodSet",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let c of o){let l=e.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(u=>Rio(u,r))):Rio(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(Rio,"DM");Qlo=pt("$ZodEnum",(t,e)=>{So.init(t,e);let r=Jqr(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>bkt.has(typeof n)).map(n=>typeof n=="string"?nse(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),qlo=pt("$ZodLiteral",(t,e)=>{So.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?nse(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),jlo=pt("$ZodFile",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),yjr=pt("$ZodTransform",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new az;return r.value=o,r}}),Hlo=pt("$ZodOptional",(t,e)=>{So.init(t,e),t._zod.optin="optional",t._zod.optout="optional",sl(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),sl(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${mPt(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),Glo=pt("$ZodNullable",(t,e)=>{So.init(t,e),sl(t._zod,"optin",()=>e.innerType._zod.optin),sl(t._zod,"optout",()=>e.innerType._zod.optout),sl(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${mPt(r.source)}|null)$`):void 0}),sl(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),$lo=pt("$ZodDefault",(t,e)=>{So.init(t,e),t._zod.optin="optional",sl(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>kio(s,e)):kio(o,e)}});a(kio,"FM");Vlo=pt("$ZodPrefault",(t,e)=>{So.init(t,e),t._zod.optin="optional",sl(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),Wlo=pt("$ZodNonOptional",(t,e)=>{So.init(t,e),sl(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Pio(s,t)):Pio(o,t)}});a(Pio,"ZM");zlo=pt("$ZodSuccess",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),Ylo=pt("$ZodCatch",(t,e)=>{So.init(t,e),t._zod.optin="optional",sl(t._zod,"optout",()=>e.innerType._zod.optout),sl(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>_M(c,n,_C()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>_M(s,n,_C()))},input:r.value}),r.issues=[]),r)}}),Klo=pt("$ZodNaN",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),_jr=pt("$ZodPipe",(t,e)=>{So.init(t,e),sl(t._zod,"values",()=>e.in._zod.values),sl(t._zod,"optin",()=>e.in._zod.optin),sl(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Dio(s,e,n)):Dio(o,e,n)}});a(Dio,"MM");Jlo=pt("$ZodReadonly",(t,e)=>{So.init(t,e),sl(t._zod,"propValues",()=>e.innerType._zod.propValues),sl(t._zod,"values",()=>e.innerType._zod.values),sl(t._zod,"optin",()=>e.innerType._zod.optin),sl(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(Nio):Nio(o)}});a(Nio,"LM");Zlo=pt("$ZodTemplateLiteral",(t,e)=>{So.init(t,e);let r=[];for(let n of e.parts)if(n instanceof So){if(!n._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw Error(`Invalid template literal part: ${n._zod.traits}`);let s=o.startsWith("^")?1:0,c=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(s,c))}else if(n===null||zao.has(typeof n))r.push(nse(`${n}`));else throw Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"template_literal",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),n)}),Xlo=pt("$ZodPromise",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),euo=pt("$ZodLazy",(t,e)=>{So.init(t,e),sl(t._zod,"innerType",()=>e.getter()),sl(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),sl(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),sl(t._zod,"optin",()=>t._zod.innerType._zod.optin),sl(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),tuo=pt("$ZodCustom",(t,e)=>{Qh.init(t,e),So.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>Mio(s,r,n,t));Mio(o,r,n,t)}});a(Mio,"jM");Ejr={};RB(Ejr,{zhTW:a(()=>gil,"zhTW"),zhCN:a(()=>hil,"zhCN"),vi:a(()=>fil,"vi"),ur:a(()=>uil,"ur"),ua:a(()=>cil,"ua"),tr:a(()=>sil,"tr"),th:a(()=>nil,"th"),ta:a(()=>til,"ta"),sv:a(()=>Xnl,"sv"),sl:a(()=>Jnl,"sl"),ru:a(()=>Ynl,"ru"),pt:a(()=>Wnl,"pt"),ps:a(()=>Hnl,"ps"),pl:a(()=>$nl,"pl"),ota:a(()=>qnl,"ota"),no:a(()=>Unl,"no"),nl:a(()=>Bnl,"nl"),ms:a(()=>Onl,"ms"),mk:a(()=>Nnl,"mk"),ko:a(()=>Pnl,"ko"),kh:a(()=>Rnl,"kh"),ja:a(()=>xnl,"ja"),it:a(()=>Tnl,"it"),id:a(()=>bnl,"id"),hu:a(()=>vnl,"hu"),he:a(()=>_nl,"he"),frCA:a(()=>Anl,"frCA"),fr:a(()=>mnl,"fr"),fi:a(()=>pnl,"fi"),fa:a(()=>dnl,"fa"),es:a(()=>lnl,"es"),eo:a(()=>anl,"eo"),en:a(()=>ruo,"en"),de:a(()=>rnl,"de"),cs:a(()=>enl,"cs"),ca:a(()=>Zrl,"ca"),be:a(()=>Krl,"be"),az:a(()=>zrl,"az"),ar:a(()=>Vrl,"ar")});$rl=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return o=>{switch(o.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${gs(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${n[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${Kr(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"Du");a(Vrl,"tK");Wrl=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${gs(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"Fu");a(zrl,"aK");a(Oio,"PM");Yrl=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0456\u045E";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${gs(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=Oio(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=Oio(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"Zu");a(Krl,"sK");Jrl=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${gs(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Kr(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"Mu");a(Zrl,"eK");Xrl=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return o=>{switch(o.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o.expected}, obdr\u017Eeno ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${gs(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${n[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${Kr(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"Lu");a(enl,"$q");tnl=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return o=>{switch(o.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${gs(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"ju");a(rnl,"Qq");nnl=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"Au"),inl=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${nnl(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${gs(n.values[0])}`:`Invalid option: expected one of ${Kr(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Kr(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"Iu");a(ruo,"A7");onl=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"Ru"),snl=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${onl(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${gs(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Kr(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${Kr(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},"Pu");a(anl,"Jq");cnl=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return s},"J"),n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${gs(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Demasiado peque\xF1o: se esperaba que ${o.origin} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${o.origin} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o.origin}`;default:return"Entrada inv\xE1lida"}}},"Eu");a(lnl,"Xq");unl=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0622\u0631\u0627\u06CC\u0647";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return o=>{switch(o.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(o.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${gs(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${Kr(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"bu");a(dnl,"Yq");fnl=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return o=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${gs(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${n[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Kr(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"_u");a(pnl,"Wq");hnl=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : ${o.expected} attendu, ${r(o.input)} re\xE7u`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${gs(o.values[0])} attendu`:`Option invalide : une valeur parmi ${Kr(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${o.origin??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o.origin??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${o.origin} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${o.origin} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Kr(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"ku");a(mnl,"Gq");gnl=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${o.expected}, re\xE7u ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${gs(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Kr(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"Su");a(Anl,"Uq");ynl=a(()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return o=>{switch(o.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${o.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${gs(o.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()} ${c.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${s.prefix}"`:s.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${s.suffix}"`:s.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${s.includes}"`:s.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${s.pattern}`:`${n[s.format]??o.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${o.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${o.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${o.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"vu");a(_nl,"Hq");Enl=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(o))return"t\xF6mb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return o=>{switch(o.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o.expected}, a kapott \xE9rt\xE9k ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${gs(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"Cu");a(vnl,"Kq");Cnl=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${gs(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${n[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"Tu");a(bnl,"qq");Snl=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input non valido: atteso ${gs(o.values[0])}`:`Opzione non valida: atteso uno tra ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"xu");a(Tnl,"Vq");Inl=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(o))return"\u914D\u5217";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(o.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${gs(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Kr(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${Kr(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"yu");a(xnl,"Bq");wnl=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(o))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(o===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return o=>{switch(o.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${gs(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Kr(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"fu");a(Rnl,"zq");knl=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return o=>{switch(o.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(o.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${gs(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Kr(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${Kr(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"gu");a(Pnl,"Nq");Dnl=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(o))return"\u043D\u0438\u0437\u0430";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return o=>{switch(o.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${gs(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"hu");a(Nnl,"wq");Mnl=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${gs(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${n[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Kr(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"uu");a(Onl,"Oq");Lnl=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return o=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${gs(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} bevat`:`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} bevat`:`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"mu");a(Bnl,"Dq");Fnl=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${gs(o.values[0])}`:`Ugyldig valg: forventet en av ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${n[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"lu");a(Unl,"Fq");Qnl=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return o=>{switch(o.code){case"invalid_type":return`F\xE2sit giren: umulan ${o.expected}, al\u0131nan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${gs(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"cu");a(qnl,"Zq");jnl=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0627\u0631\u06D0";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return o=>{switch(o.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(o.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${gs(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Kr(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"pu");a(Hnl,"Mq");Gnl=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return o=>{switch(o.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${gs(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"du");a($nl,"Lq");Vnl=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${gs(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${n[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"iu");a(Wnl,"jq");a(Lio,"EM");znl=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${gs(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=Lio(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=Lio(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"nu");a(Ynl,"Aq");Knl=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return o=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${gs(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${n[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"ru");a(Jnl,"Iq");Znl=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"antal";case"object":{if(Array.isArray(o))return"lista";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return o=>{switch(o.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${o.expected}, fick ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${gs(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${n[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"ou");a(Xnl,"Rq");eil=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(o))return"\u0B85\u0BA3\u0BBF";if(o===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${gs(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Kr(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"tu");a(til,"Pq");ril=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(o))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(o===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return o=>{switch(o.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${gs(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"au");a(nil,"Eq");iil=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"su"),oil=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${iil(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${gs(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Kr(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${Kr(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"eu");a(sil,"bq");ail=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${gs(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"$m");a(cil,"_q");lil=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(o))return"\u0622\u0631\u06D2";if(o===null)return"\u0646\u0644";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return o=>{switch(o.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(o.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${gs(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Kr(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${Kr(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"Qm");a(uil,"kq");dil=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(o))return"m\u1EA3ng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return o=>{switch(o.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${gs(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${n[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Kr(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"Jm");a(fil,"Sq");pil=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(o))return"\u6570\u7EC4";if(o===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${gs(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${n[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Kr(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"Xm");a(hil,"vq");mil=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o.expected}\uFF0C\u4F46\u6536\u5230 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${gs(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${Kr(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"Ym");a(gil,"Cq");nuo=Symbol("ZodOutput"),iuo=Symbol("ZodInput"),mUe=class{static{a(this,"I7")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};a(vjr,"R7");P9=vjr();a(ouo,"aY");a(suo,"Tq");a(Cjr,"P7");a(wkt,"o8");a(bjr,"E7");a(Sjr,"b7");a(Tjr,"_7");a(Ijr,"k7");a(xjr,"S7");a(wjr,"v7");a(Rjr,"C7");a(kjr,"T7");a(Pjr,"x7");a(Djr,"y7");a(Njr,"f7");a(Mjr,"g7");a(Ojr,"h7");a(Ljr,"u7");a(Bjr,"m7");a(Fjr,"l7");a(Ujr,"c7");a(Qjr,"p7");a(qjr,"d7");a(jjr,"i7");auo={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(cuo,"xq");a(luo,"yq");a(uuo,"fq");a(duo,"gq");a(fuo,"eY");a(puo,"hq");a(huo,"$3");a(muo,"Q3");a(guo,"J3");a(Auo,"X3");a(yuo,"Y3");a(_uo,"W3");a(Euo,"uq");a(vuo,"G3");a(Cuo,"mq");a(buo,"U3");a(Suo,"H3");a(Tuo,"K3");a(Iuo,"q3");a(xuo,"V3");a(wuo,"B3");a(Rkt,"b0");a(Ruo,"z3");a(kuo,"N3");a(Puo,"w3");a(Duo,"lq");a(Nuo,"O3");a(Zoe,"o4");a(gM,"t6");a(Xoe,"t4");a(rx,"P6");a(Muo,"cq");a(Ouo,"pq");a(Luo,"dq");a(Buo,"iq");a(gUe,"_0");a(vPt,"t8");a(AUe,"k0");a(Hjr,"n7");a(CPt,"a8");a(abe,"k1");a(bPt,"s8");a(Gjr,"r7");a($jr,"o7");a(Vjr,"t7");a(Wjr,"a7");a(zjr,"s7");a(Yjr,"e7");a(Fuo,"nq");a(Kjr,"$J");a(ise,"a4");a(Jjr,"QJ");a(Zjr,"JJ");a(Xjr,"XJ");a(eHr,"YJ");a(tHr,"WJ");a(Ail,"Wm");a(yil,"Gm");a(_il,"Um");a(Uuo,"rq");a(Eil,"Hm");a(vil,"Km");a(Cil,"qm");a(bil,"Vm");a(Sil,"Bm");a(Til,"zm");a(Quo,"D3");a(Iil,"Nm");a(xil,"wm");a(wil,"Om");a(Ril,"Dm");a(kil,"Fm");a(Pil,"Zm");a(Dil,"Mm");a(Nil,"Lm");a(Mil,"jm");a(Oil,"Am");a(Lil,"Im");a(Bil,"Rm");a(quo,"F3");a(juo,"Z3");a(Huo,"M3");a(Guo,"L3");kkt=class{static{a(this,"oq")}constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw Error("implement() must be called with a function");let r=a((...n)=>{let o=this._def.input?Skt(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw Error("Invalid arguments schema: not an array or tuple schema.");let s=e(...o);return this._def.output?Skt(this._def.output,s,void 0,{callee:r}):s},"Q");return r}implementAsync(e){if(typeof e!="function")throw Error("implement() must be called with a function");let r=a(async(...n)=>{let o=this._def.input?await Tkt(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw Error("Invalid arguments schema: not an array or tuple schema.");let s=await e(...o);return this._def.output?Tkt(this._def.output,s,void 0,{callee:r}):s},"Q");return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new EPt({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){return new this.constructor({type:"function",input:this._def.input,output:e})}};a($uo,"j3");yUe=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??P9,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;let l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,l);let u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path},h=e._zod.parent;if(h)l.ref=h,this.process(h,f),this.seen.get(h).isParent=!0;else{let m=l.schema;switch(o.type){case"string":{let g=m;g.type="string";let{minimum:A,maximum:y,format:_,patterns:E,contentEncoding:v}=e._zod.bag;if(typeof A=="number"&&(g.minLength=A),typeof y=="number"&&(g.maxLength=y),_&&(g.format=s[_]??_,g.format===""&&delete g.format),v&&(g.contentEncoding=v),E&&E.size>0){let S=[...E];S.length===1?g.pattern=S[0].source:S.length>1&&(l.schema.allOf=[...S.map(T=>({...this.target==="draft-7"?{type:"string"}:{},pattern:T.source}))])}break}case"number":{let g=m,{minimum:A,maximum:y,format:_,multipleOf:E,exclusiveMaximum:v,exclusiveMinimum:S}=e._zod.bag;typeof _=="string"&&_.includes("int")?g.type="integer":g.type="number",typeof S=="number"&&(g.exclusiveMinimum=S),typeof A=="number"&&(g.minimum=A,typeof S=="number"&&(S>=A?delete g.minimum:delete g.exclusiveMinimum)),typeof v=="number"&&(g.exclusiveMaximum=v),typeof y=="number"&&(g.maximum=y,typeof v=="number"&&(v<=y?delete g.maximum:delete g.exclusiveMaximum)),typeof E=="number"&&(g.multipleOf=E);break}case"boolean":{let g=m;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{m.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let g=m,{minimum:A,maximum:y}=e._zod.bag;typeof A=="number"&&(g.minItems=A),typeof y=="number"&&(g.maxItems=y),g.type="array",g.items=this.process(o.element,{...f,path:[...f.path,"items"]});break}case"object":{let g=m;g.type="object",g.properties={};let A=o.shape;for(let E in A)g.properties[E]=this.process(A[E],{...f,path:[...f.path,"properties",E]});let y=new Set(Object.keys(A)),_=new Set([...y].filter(E=>{let v=o.shape[E]._zod;return this.io==="input"?v.optin===void 0:v.optout===void 0}));_.size>0&&(g.required=Array.from(_)),o.catchall?._zod.def.type==="never"?g.additionalProperties=!1:o.catchall?o.catchall&&(g.additionalProperties=this.process(o.catchall,{...f,path:[...f.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{let g=m;g.anyOf=o.options.map((A,y)=>this.process(A,{...f,path:[...f.path,"anyOf",y]}));break}case"intersection":{let g=m,A=this.process(o.left,{...f,path:[...f.path,"allOf",0]}),y=this.process(o.right,{...f,path:[...f.path,"allOf",1]}),_=a(v=>"allOf"in v&&Object.keys(v).length===1,"D"),E=[..._(A)?A.allOf:[A],..._(y)?y.allOf:[y]];g.allOf=E;break}case"tuple":{let g=m;g.type="array";let A=o.items.map((E,v)=>this.process(E,{...f,path:[...f.path,"prefixItems",v]}));if(this.target==="draft-2020-12"?g.prefixItems=A:g.items=A,o.rest){let E=this.process(o.rest,{...f,path:[...f.path,"items"]});this.target==="draft-2020-12"?g.items=E:g.additionalItems=E}o.rest&&(g.items=this.process(o.rest,{...f,path:[...f.path,"items"]}));let{minimum:y,maximum:_}=e._zod.bag;typeof y=="number"&&(g.minItems=y),typeof _=="number"&&(g.maxItems=_);break}case"record":{let g=m;g.type="object",g.propertyNames=this.process(o.keyType,{...f,path:[...f.path,"propertyNames"]}),g.additionalProperties=this.process(o.valueType,{...f,path:[...f.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let g=m,A=Jqr(o.entries);A.every(y=>typeof y=="number")&&(g.type="number"),A.every(y=>typeof y=="string")&&(g.type="string"),g.enum=A;break}case"literal":{let g=m,A=[];for(let y of o.values)if(y===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof y=="bigint"){if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");A.push(Number(y))}else A.push(y);if(A.length!==0)if(A.length===1){let y=A[0];g.type=y===null?"null":typeof y,g.const=y}else A.every(y=>typeof y=="number")&&(g.type="number"),A.every(y=>typeof y=="string")&&(g.type="string"),A.every(y=>typeof y=="boolean")&&(g.type="string"),A.every(y=>y===null)&&(g.type="null"),g.enum=A;break}case"file":{let g=m,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:y,maximum:_,mime:E}=e._zod.bag;y!==void 0&&(A.minLength=y),_!==void 0&&(A.maxLength=_),E?E.length===1?(A.contentMediaType=E[0],Object.assign(g,A)):g.anyOf=E.map(v=>({...A,contentMediaType:v})):Object.assign(g,A);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let g=this.process(o.innerType,f);m.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,f),l.ref=o.innerType;break}case"success":{let g=m;g.type="boolean";break}case"default":{this.process(o.innerType,f),l.ref=o.innerType,m.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,f),l.ref=o.innerType,this.io==="input"&&(m._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,f),l.ref=o.innerType;let g;try{g=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}m.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let g=m,A=e._zod.pattern;if(!A)throw Error("Pattern not found in template literal");g.type="string",g.pattern=A.source;break}case"pipe":{let g=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(g,f),l.ref=g;break}case"readonly":{this.process(o.innerType,f),l.ref=o.innerType,m.readOnly=!0;break}case"promise":{this.process(o.innerType,f),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,f),l.ref=o.innerType;break}case"lazy":{let g=e._zod.innerType;this.process(g,f),l.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let d=this.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),this.io==="input"&&Kg(e)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let s=a(f=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let A=n.external.registry.get(f[0])?.id;if(A)return{ref:n.external.uri(A)};let y=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=y,{defId:y,ref:`${n.external.uri("__shared")}#/${h}/${y}`}}if(f[1]===o)return{ref:"#"};let m=`#/${h}/`,g=f[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:m+g}},"X"),c=a(f=>{if(f[1].schema.$ref)return;let h=f[1],{ref:m,defId:g}=s(f);h.def={...h.schema},g&&(h.defId=g);let A=h.schema;for(let y in A)delete A[y];A.$ref=m},"W");for(let f of this.seen.entries()){let h=f[1];if(e===f[0]){c(f);continue}if(n.external){let m=n.external.registry.get(f[0])?.id;if(e!==f[0]&&m){c(f);continue}}if(this.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){if(n.cycles==="throw")throw Error(`Cycle detected: #/${h.cycle?.join("/")}/ + })));`),h.write(`newResult[${NCe(E)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let _=h.compile();return(E,v)=>_(f,E,v)},"Y"),o,s=pUe,c=!bkt.jitless,l=c&&Yao.value,u=e.catchall,d;t._zod.parse=(f,h)=>{d??(d=r.value);let m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),f;let g=[];if(c&&l&&h?.async===!1&&h.jitless!==!0)o||(o=n(e.shape)),f=o(f,h);else{f.value={};let v=d.shape;for(let S of d.keys){let T=v[S],w=T._zod.run({value:m[S],issues:[]},h),R=T._zod.optin==="optional"&&T._zod.optout==="optional";w instanceof Promise?g.push(w.then(x=>R?xio(x,f,S,m):bRt(x,f,S))):R?xio(w,f,S,m):bRt(w,f,S)}}if(!u)return g.length?Promise.all(g).then(()=>f):f;let A=[],y=d.keySet,_=u._zod,E=_.def.type;for(let v of Object.keys(m)){if(y.has(v))continue;if(E==="never"){A.push(v);continue}let S=_.run({value:m[v],issues:[]},h);S instanceof Promise?g.push(S.then(T=>bRt(T,f,v))):bRt(S,f,v)}return A.length&&f.issues.push({code:"unrecognized_keys",keys:A,input:m,inst:t}),g.length?Promise.all(g).then(()=>f):f}});a(wio,"NM");yjr=pt("$ZodUnion",(t,e)=>{So.init(t,e),sl(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),sl(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),sl(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),sl(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>gPt(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=!1,s=[];for(let c of e.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)s.push(l),o=!0;else{if(l.issues.length===0)return l;s.push(l)}}return o?Promise.all(s).then(c=>wio(c,r,t,n)):wio(s,r,t,n)}}),Blo=pt("$ZodDiscriminatedUnion",(t,e)=>{yjr.init(t,e);let r=t._zod.parse;sl(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=mPt(()=>{let o=e.options,s=new Map;for(let c of o){let l=c._zod.propValues[e.discriminator];if(!l||l.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let u of l){if(s.has(u))throw Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,c)}}return s});t._zod.parse=(o,s)=>{let c=o.value;if(!pUe(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),o;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:c,path:[e.discriminator],inst:t}),o)}}),Flo=pt("$ZodIntersection",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),c=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([l,u])=>Rio(r,l,u)):Rio(r,s,c)}});a(qQr,"pK");a(Rio,"wM");vPt=pt("$ZodTuple",(t,e)=>{So.init(t,e);let r=e.items,n=r.length-[...r].reverse().findIndex(o=>o._zod.optin!=="optional");t._zod.parse=(o,s)=>{let c=o.value;if(!Array.isArray(c))return o.issues.push({input:c,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let l=[];if(!e.rest){let d=c.length>r.length,f=c.length=c.length&&u>=n)continue;let f=d._zod.run({value:c[u],issues:[]},s);f instanceof Promise?l.push(f.then(h=>SRt(h,o,u))):SRt(f,o,u)}if(e.rest){let d=c.slice(r.length);for(let f of d){u++;let h=e.rest._zod.run({value:f,issues:[]},s);h instanceof Promise?l.push(h.then(m=>SRt(m,o,u))):SRt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(SRt,"sX");Ulo=pt("$ZodRecord",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!hUe(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[];if(e.keyType._zod.values){let c=e.keyType._zod.values;r.value={};for(let u of c)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let d=e.valueType._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&r.issues.push(...Vk(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...Vk(u,d.issues)),r.value[u]=d.value)}let l;for(let u in o)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let l=e.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(d=>_M(d,n,_C())),input:c,path:[c],inst:t}),r.value[l.value]=l.value;continue}let u=e.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...Vk(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...Vk(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),Qlo=pt("$ZodMap",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let s=[];r.value=new Map;for(let[c,l]of o){let u=e.keyType._zod.run({value:c,issues:[]},n),d=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise||d instanceof Promise?s.push(Promise.all([u,d]).then(([f,h])=>{kio(f,h,r,c,o,t,n)})):kio(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(kio,"OM");qlo=pt("$ZodSet",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let c of o){let l=e.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(u=>Pio(u,r))):Pio(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(Pio,"DM");jlo=pt("$ZodEnum",(t,e)=>{So.init(t,e);let r=Zqr(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>Skt.has(typeof n)).map(n=>typeof n=="string"?ise(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),Hlo=pt("$ZodLiteral",(t,e)=>{So.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?ise(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),Glo=pt("$ZodFile",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),_jr=pt("$ZodTransform",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new cz;return r.value=o,r}}),$lo=pt("$ZodOptional",(t,e)=>{So.init(t,e),t._zod.optin="optional",t._zod.optout="optional",sl(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),sl(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${gPt(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),Vlo=pt("$ZodNullable",(t,e)=>{So.init(t,e),sl(t._zod,"optin",()=>e.innerType._zod.optin),sl(t._zod,"optout",()=>e.innerType._zod.optout),sl(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${gPt(r.source)}|null)$`):void 0}),sl(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),Wlo=pt("$ZodDefault",(t,e)=>{So.init(t,e),t._zod.optin="optional",sl(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Dio(s,e)):Dio(o,e)}});a(Dio,"FM");zlo=pt("$ZodPrefault",(t,e)=>{So.init(t,e),t._zod.optin="optional",sl(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),Ylo=pt("$ZodNonOptional",(t,e)=>{So.init(t,e),sl(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Nio(s,t)):Nio(o,t)}});a(Nio,"ZM");Klo=pt("$ZodSuccess",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),Jlo=pt("$ZodCatch",(t,e)=>{So.init(t,e),t._zod.optin="optional",sl(t._zod,"optout",()=>e.innerType._zod.optout),sl(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>_M(c,n,_C()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>_M(s,n,_C()))},input:r.value}),r.issues=[]),r)}}),Zlo=pt("$ZodNaN",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),Ejr=pt("$ZodPipe",(t,e)=>{So.init(t,e),sl(t._zod,"values",()=>e.in._zod.values),sl(t._zod,"optin",()=>e.in._zod.optin),sl(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Mio(s,e,n)):Mio(o,e,n)}});a(Mio,"MM");Xlo=pt("$ZodReadonly",(t,e)=>{So.init(t,e),sl(t._zod,"propValues",()=>e.innerType._zod.propValues),sl(t._zod,"values",()=>e.innerType._zod.values),sl(t._zod,"optin",()=>e.innerType._zod.optin),sl(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(Oio):Oio(o)}});a(Oio,"LM");euo=pt("$ZodTemplateLiteral",(t,e)=>{So.init(t,e);let r=[];for(let n of e.parts)if(n instanceof So){if(!n._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw Error(`Invalid template literal part: ${n._zod.traits}`);let s=o.startsWith("^")?1:0,c=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(s,c))}else if(n===null||Kao.has(typeof n))r.push(ise(`${n}`));else throw Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"template_literal",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),n)}),tuo=pt("$ZodPromise",(t,e)=>{So.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),ruo=pt("$ZodLazy",(t,e)=>{So.init(t,e),sl(t._zod,"innerType",()=>e.getter()),sl(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),sl(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),sl(t._zod,"optin",()=>t._zod.innerType._zod.optin),sl(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),nuo=pt("$ZodCustom",(t,e)=>{Qh.init(t,e),So.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>Lio(s,r,n,t));Lio(o,r,n,t)}});a(Lio,"jM");vjr={};RB(vjr,{zhTW:a(()=>yil,"zhTW"),zhCN:a(()=>gil,"zhCN"),vi:a(()=>hil,"vi"),ur:a(()=>fil,"ur"),ua:a(()=>uil,"ua"),tr:a(()=>cil,"tr"),th:a(()=>oil,"th"),ta:a(()=>nil,"ta"),sv:a(()=>til,"sv"),sl:a(()=>Xnl,"sl"),ru:a(()=>Jnl,"ru"),pt:a(()=>Ynl,"pt"),ps:a(()=>$nl,"ps"),pl:a(()=>Wnl,"pl"),ota:a(()=>Hnl,"ota"),no:a(()=>qnl,"no"),nl:a(()=>Unl,"nl"),ms:a(()=>Bnl,"ms"),mk:a(()=>Onl,"mk"),ko:a(()=>Nnl,"ko"),kh:a(()=>Pnl,"kh"),ja:a(()=>Rnl,"ja"),it:a(()=>xnl,"it"),id:a(()=>Tnl,"id"),hu:a(()=>bnl,"hu"),he:a(()=>vnl,"he"),frCA:a(()=>_nl,"frCA"),fr:a(()=>Anl,"fr"),fi:a(()=>mnl,"fi"),fa:a(()=>pnl,"fa"),es:a(()=>dnl,"es"),eo:a(()=>lnl,"eo"),en:a(()=>iuo,"en"),de:a(()=>inl,"de"),cs:a(()=>rnl,"cs"),ca:a(()=>enl,"ca"),be:a(()=>Zrl,"be"),az:a(()=>Krl,"az"),ar:a(()=>zrl,"ar")});Wrl=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return o=>{switch(o.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${gs(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${n[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${Kr(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"Du");a(zrl,"tK");Yrl=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${gs(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"Fu");a(Krl,"aK");a(Bio,"PM");Jrl=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0456\u045E";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${gs(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=Bio(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=Bio(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"Zu");a(Zrl,"sK");Xrl=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${gs(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Kr(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"Mu");a(enl,"eK");tnl=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return o=>{switch(o.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o.expected}, obdr\u017Eeno ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${gs(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${n[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${Kr(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"Lu");a(rnl,"$q");nnl=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return o=>{switch(o.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${gs(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"ju");a(inl,"Qq");onl=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"Au"),snl=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${onl(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${gs(n.values[0])}`:`Invalid option: expected one of ${Kr(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Kr(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"Iu");a(iuo,"A7");anl=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"Ru"),cnl=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${anl(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${gs(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Kr(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${Kr(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},"Pu");a(lnl,"Jq");unl=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return s},"J"),n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${gs(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Demasiado peque\xF1o: se esperaba que ${o.origin} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${o.origin} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o.origin}`;default:return"Entrada inv\xE1lida"}}},"Eu");a(dnl,"Xq");fnl=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0622\u0631\u0627\u06CC\u0647";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return o=>{switch(o.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(o.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${gs(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${Kr(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"bu");a(pnl,"Yq");hnl=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return o=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${gs(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${n[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Kr(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"_u");a(mnl,"Wq");gnl=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : ${o.expected} attendu, ${r(o.input)} re\xE7u`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${gs(o.values[0])} attendu`:`Option invalide : une valeur parmi ${Kr(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${o.origin??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o.origin??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${o.origin} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${o.origin} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Kr(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"ku");a(Anl,"Gq");ynl=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${o.expected}, re\xE7u ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${gs(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Kr(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"Su");a(_nl,"Uq");Enl=a(()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return o=>{switch(o.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${o.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${gs(o.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()} ${c.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${s.prefix}"`:s.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${s.suffix}"`:s.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${s.includes}"`:s.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${s.pattern}`:`${n[s.format]??o.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${o.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${o.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${o.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"vu");a(vnl,"Hq");Cnl=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(o))return"t\xF6mb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return o=>{switch(o.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o.expected}, a kapott \xE9rt\xE9k ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${gs(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"Cu");a(bnl,"Kq");Snl=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${gs(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${n[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"Tu");a(Tnl,"qq");Inl=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input non valido: atteso ${gs(o.values[0])}`:`Opzione non valida: atteso uno tra ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"xu");a(xnl,"Vq");wnl=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(o))return"\u914D\u5217";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(o.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${gs(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Kr(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${Kr(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"yu");a(Rnl,"Bq");knl=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(o))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(o===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return o=>{switch(o.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${gs(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Kr(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"fu");a(Pnl,"zq");Dnl=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return o=>{switch(o.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(o.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${gs(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Kr(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${Kr(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"gu");a(Nnl,"Nq");Mnl=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(o))return"\u043D\u0438\u0437\u0430";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return o=>{switch(o.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${gs(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"hu");a(Onl,"wq");Lnl=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${gs(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${n[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Kr(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"uu");a(Bnl,"Oq");Fnl=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return o=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${gs(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} bevat`:`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} bevat`:`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"mu");a(Unl,"Dq");Qnl=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${gs(o.values[0])}`:`Ugyldig valg: forventet en av ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${n[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"lu");a(qnl,"Fq");jnl=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return o=>{switch(o.code){case"invalid_type":return`F\xE2sit giren: umulan ${o.expected}, al\u0131nan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${gs(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"cu");a(Hnl,"Zq");Gnl=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0627\u0631\u06D0";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return o=>{switch(o.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(o.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${gs(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Kr(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"pu");a($nl,"Mq");Vnl=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return o=>{switch(o.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${gs(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"du");a(Wnl,"Lq");znl=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${gs(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${n[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"iu");a(Ynl,"jq");a(Fio,"EM");Knl=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${gs(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=Fio(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=Fio(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"nu");a(Jnl,"Aq");Znl=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return o=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${gs(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${n[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"ru");a(Xnl,"Iq");eil=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"antal";case"object":{if(Array.isArray(o))return"lista";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return o=>{switch(o.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${o.expected}, fick ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${gs(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${n[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${Kr(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"ou");a(til,"Rq");ril=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(o))return"\u0B85\u0BA3\u0BBF";if(o===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${gs(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Kr(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"tu");a(nil,"Pq");iil=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(o))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(o===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return o=>{switch(o.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${gs(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"au");a(oil,"Eq");sil=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"su"),ail=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${sil(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${gs(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Kr(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${Kr(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"eu");a(cil,"bq");lil=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${gs(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${Kr(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"$m");a(uil,"_q");dil=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(o))return"\u0622\u0631\u06D2";if(o===null)return"\u0646\u0644";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return o=>{switch(o.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(o.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${gs(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Kr(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${Kr(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"Qm");a(fil,"kq");pil=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(o))return"m\u1EA3ng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return o=>{switch(o.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${gs(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${n[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Kr(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"Jm");a(hil,"Sq");mil=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(o))return"\u6570\u7EC4";if(o===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${gs(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${n[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Kr(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"Xm");a(gil,"vq");Ail=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o.expected}\uFF0C\u4F46\u6536\u5230 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${gs(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Kr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${Kr(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"Ym");a(yil,"Cq");ouo=Symbol("ZodOutput"),suo=Symbol("ZodInput"),mUe=class{static{a(this,"I7")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};a(Cjr,"R7");P9=Cjr();a(auo,"aY");a(cuo,"Tq");a(bjr,"P7");a(Rkt,"o8");a(Sjr,"E7");a(Tjr,"b7");a(Ijr,"_7");a(xjr,"k7");a(wjr,"S7");a(Rjr,"v7");a(kjr,"C7");a(Pjr,"T7");a(Djr,"x7");a(Njr,"y7");a(Mjr,"f7");a(Ojr,"g7");a(Ljr,"h7");a(Bjr,"u7");a(Fjr,"m7");a(Ujr,"l7");a(Qjr,"c7");a(qjr,"p7");a(jjr,"d7");a(Hjr,"i7");luo={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(uuo,"xq");a(duo,"yq");a(fuo,"fq");a(puo,"gq");a(huo,"eY");a(muo,"hq");a(guo,"$3");a(Auo,"Q3");a(yuo,"J3");a(_uo,"X3");a(Euo,"Y3");a(vuo,"W3");a(Cuo,"uq");a(buo,"G3");a(Suo,"mq");a(Tuo,"U3");a(Iuo,"H3");a(xuo,"K3");a(wuo,"q3");a(Ruo,"V3");a(kuo,"B3");a(kkt,"b0");a(Puo,"z3");a(Duo,"N3");a(Nuo,"w3");a(Muo,"lq");a(Ouo,"O3");a(Xoe,"o4");a(gM,"t6");a(ese,"t4");a(rx,"P6");a(Luo,"cq");a(Buo,"pq");a(Fuo,"dq");a(Uuo,"iq");a(gUe,"_0");a(CPt,"t8");a(AUe,"k0");a(Gjr,"n7");a(bPt,"a8");a(abe,"k1");a(SPt,"s8");a($jr,"r7");a(Vjr,"o7");a(Wjr,"t7");a(zjr,"a7");a(Yjr,"s7");a(Kjr,"e7");a(Quo,"nq");a(Jjr,"$J");a(ose,"a4");a(Zjr,"QJ");a(Xjr,"JJ");a(eHr,"XJ");a(tHr,"YJ");a(rHr,"WJ");a(_il,"Wm");a(Eil,"Gm");a(vil,"Um");a(quo,"rq");a(Cil,"Hm");a(bil,"Km");a(Sil,"qm");a(Til,"Vm");a(Iil,"Bm");a(xil,"zm");a(juo,"D3");a(wil,"Nm");a(Ril,"wm");a(kil,"Om");a(Pil,"Dm");a(Dil,"Fm");a(Nil,"Zm");a(Mil,"Mm");a(Oil,"Lm");a(Lil,"jm");a(Bil,"Am");a(Fil,"Im");a(Uil,"Rm");a(Huo,"F3");a(Guo,"Z3");a($uo,"M3");a(Vuo,"L3");Pkt=class{static{a(this,"oq")}constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw Error("implement() must be called with a function");let r=a((...n)=>{let o=this._def.input?Tkt(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw Error("Invalid arguments schema: not an array or tuple schema.");let s=e(...o);return this._def.output?Tkt(this._def.output,s,void 0,{callee:r}):s},"Q");return r}implementAsync(e){if(typeof e!="function")throw Error("implement() must be called with a function");let r=a(async(...n)=>{let o=this._def.input?await Ikt(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw Error("Invalid arguments schema: not an array or tuple schema.");let s=await e(...o);return this._def.output?Ikt(this._def.output,s,void 0,{callee:r}):s},"Q");return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new vPt({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){return new this.constructor({type:"function",input:this._def.input,output:e})}};a(Wuo,"j3");yUe=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??P9,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;let l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,l);let u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path},h=e._zod.parent;if(h)l.ref=h,this.process(h,f),this.seen.get(h).isParent=!0;else{let m=l.schema;switch(o.type){case"string":{let g=m;g.type="string";let{minimum:A,maximum:y,format:_,patterns:E,contentEncoding:v}=e._zod.bag;if(typeof A=="number"&&(g.minLength=A),typeof y=="number"&&(g.maxLength=y),_&&(g.format=s[_]??_,g.format===""&&delete g.format),v&&(g.contentEncoding=v),E&&E.size>0){let S=[...E];S.length===1?g.pattern=S[0].source:S.length>1&&(l.schema.allOf=[...S.map(T=>({...this.target==="draft-7"?{type:"string"}:{},pattern:T.source}))])}break}case"number":{let g=m,{minimum:A,maximum:y,format:_,multipleOf:E,exclusiveMaximum:v,exclusiveMinimum:S}=e._zod.bag;typeof _=="string"&&_.includes("int")?g.type="integer":g.type="number",typeof S=="number"&&(g.exclusiveMinimum=S),typeof A=="number"&&(g.minimum=A,typeof S=="number"&&(S>=A?delete g.minimum:delete g.exclusiveMinimum)),typeof v=="number"&&(g.exclusiveMaximum=v),typeof y=="number"&&(g.maximum=y,typeof v=="number"&&(v<=y?delete g.maximum:delete g.exclusiveMaximum)),typeof E=="number"&&(g.multipleOf=E);break}case"boolean":{let g=m;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{m.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let g=m,{minimum:A,maximum:y}=e._zod.bag;typeof A=="number"&&(g.minItems=A),typeof y=="number"&&(g.maxItems=y),g.type="array",g.items=this.process(o.element,{...f,path:[...f.path,"items"]});break}case"object":{let g=m;g.type="object",g.properties={};let A=o.shape;for(let E in A)g.properties[E]=this.process(A[E],{...f,path:[...f.path,"properties",E]});let y=new Set(Object.keys(A)),_=new Set([...y].filter(E=>{let v=o.shape[E]._zod;return this.io==="input"?v.optin===void 0:v.optout===void 0}));_.size>0&&(g.required=Array.from(_)),o.catchall?._zod.def.type==="never"?g.additionalProperties=!1:o.catchall?o.catchall&&(g.additionalProperties=this.process(o.catchall,{...f,path:[...f.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{let g=m;g.anyOf=o.options.map((A,y)=>this.process(A,{...f,path:[...f.path,"anyOf",y]}));break}case"intersection":{let g=m,A=this.process(o.left,{...f,path:[...f.path,"allOf",0]}),y=this.process(o.right,{...f,path:[...f.path,"allOf",1]}),_=a(v=>"allOf"in v&&Object.keys(v).length===1,"D"),E=[..._(A)?A.allOf:[A],..._(y)?y.allOf:[y]];g.allOf=E;break}case"tuple":{let g=m;g.type="array";let A=o.items.map((E,v)=>this.process(E,{...f,path:[...f.path,"prefixItems",v]}));if(this.target==="draft-2020-12"?g.prefixItems=A:g.items=A,o.rest){let E=this.process(o.rest,{...f,path:[...f.path,"items"]});this.target==="draft-2020-12"?g.items=E:g.additionalItems=E}o.rest&&(g.items=this.process(o.rest,{...f,path:[...f.path,"items"]}));let{minimum:y,maximum:_}=e._zod.bag;typeof y=="number"&&(g.minItems=y),typeof _=="number"&&(g.maxItems=_);break}case"record":{let g=m;g.type="object",g.propertyNames=this.process(o.keyType,{...f,path:[...f.path,"propertyNames"]}),g.additionalProperties=this.process(o.valueType,{...f,path:[...f.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let g=m,A=Zqr(o.entries);A.every(y=>typeof y=="number")&&(g.type="number"),A.every(y=>typeof y=="string")&&(g.type="string"),g.enum=A;break}case"literal":{let g=m,A=[];for(let y of o.values)if(y===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof y=="bigint"){if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");A.push(Number(y))}else A.push(y);if(A.length!==0)if(A.length===1){let y=A[0];g.type=y===null?"null":typeof y,g.const=y}else A.every(y=>typeof y=="number")&&(g.type="number"),A.every(y=>typeof y=="string")&&(g.type="string"),A.every(y=>typeof y=="boolean")&&(g.type="string"),A.every(y=>y===null)&&(g.type="null"),g.enum=A;break}case"file":{let g=m,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:y,maximum:_,mime:E}=e._zod.bag;y!==void 0&&(A.minLength=y),_!==void 0&&(A.maxLength=_),E?E.length===1?(A.contentMediaType=E[0],Object.assign(g,A)):g.anyOf=E.map(v=>({...A,contentMediaType:v})):Object.assign(g,A);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let g=this.process(o.innerType,f);m.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,f),l.ref=o.innerType;break}case"success":{let g=m;g.type="boolean";break}case"default":{this.process(o.innerType,f),l.ref=o.innerType,m.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,f),l.ref=o.innerType,this.io==="input"&&(m._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,f),l.ref=o.innerType;let g;try{g=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}m.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let g=m,A=e._zod.pattern;if(!A)throw Error("Pattern not found in template literal");g.type="string",g.pattern=A.source;break}case"pipe":{let g=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(g,f),l.ref=g;break}case"readonly":{this.process(o.innerType,f),l.ref=o.innerType,m.readOnly=!0;break}case"promise":{this.process(o.innerType,f),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,f),l.ref=o.innerType;break}case"lazy":{let g=e._zod.innerType;this.process(g,f),l.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let d=this.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),this.io==="input"&&Jg(e)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let s=a(f=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let A=n.external.registry.get(f[0])?.id;if(A)return{ref:n.external.uri(A)};let y=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=y,{defId:y,ref:`${n.external.uri("__shared")}#/${h}/${y}`}}if(f[1]===o)return{ref:"#"};let m=`#/${h}/`,g=f[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:m+g}},"X"),c=a(f=>{if(f[1].schema.$ref)return;let h=f[1],{ref:m,defId:g}=s(f);h.def={...h.schema},g&&(h.defId=g);let A=h.schema;for(let y in A)delete A[y];A.$ref=m},"W");for(let f of this.seen.entries()){let h=f[1];if(e===f[0]){c(f);continue}if(n.external){let m=n.external.registry.get(f[0])?.id;if(e!==f[0]&&m){c(f);continue}}if(this.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){if(n.cycles==="throw")throw Error(`Cycle detected: #/${h.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);n.cycles==="ref"&&c(f);continue}if(h.count>1&&n.reused==="ref"){c(f);continue}}let l=a((f,h)=>{let m=this.seen.get(f),g=m.def??m.schema,A={...g};if(m.ref===null)return;let y=m.ref;if(m.ref=null,y){l(y,h);let _=this.seen.get(y).schema;_.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(_)):(Object.assign(g,_),Object.assign(g,A))}m.isParent||this.override({zodSchema:f,jsonSchema:g,path:m.path??[]})},"G");for(let f of[...this.seen.entries()].reverse())l(f[0],{target:this.target});let u={};this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),Object.assign(u,o.def);let d=n.external?.defs??{};for(let f of this.seen.entries()){let h=f[1];h.def&&h.defId&&(d[h.defId]=h.def)}!n.external&&Object.keys(d).length>0&&(this.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{return JSON.parse(JSON.stringify(u))}catch{throw Error("Error converting schema to JSON.")}}};a(rHr,"e8");a(Kg,"t$");Fil={},Uil=pt("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");So.init(t,e),t.def=e,t.parse=(r,n)=>Skt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>yPt(t,r,n),t.parseAsync=async(r,n)=>Tkt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>_Pt(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>bM(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),Qil=pt("ZodMiniObject",(t,e)=>{gjr.init(t,e),Uil.init(t,e),Xs.defineLazy(t,"shape",()=>e.shape)});a(Bio,"tq");a(wB,"a6");a(MCe,"S0");a($6e,"S1");a(H7r,"I3");a(PUe,"v1");a(R6e,"$9");a(G7r,"R3");a(qil,"_M");a(jil,"kM");a(Vuo,"P3");G={};RB(G,{xid:a(()=>rol,"xid"),void:a(()=>bol,"void"),uuidv7:a(()=>Yil,"uuidv7"),uuidv6:a(()=>zil,"uuidv6"),uuidv4:a(()=>Wil,"uuidv4"),uuid:a(()=>Vil,"uuid"),url:a(()=>Kil,"url"),uppercase:a(()=>Vjr,"uppercase"),unknown:a(()=>Af,"unknown"),union:a(()=>Au,"union"),undefined:a(()=>vol,"undefined"),ulid:a(()=>tol,"ulid"),uint64:a(()=>_ol,"uint64"),uint32:a(()=>gol,"uint32"),tuple:a(()=>xol,"tuple"),trim:a(()=>Zjr,"trim"),treeifyError:a(()=>eco,"treeifyError"),transform:a(()=>NHr,"transform"),toUpperCase:a(()=>eHr,"toUpperCase"),toLowerCase:a(()=>Xjr,"toLowerCase"),toJSONSchema:a(()=>rHr,"toJSONSchema"),templateLiteral:a(()=>Lol,"templateLiteral"),symbol:a(()=>Eol,"symbol"),superRefine:a(()=>Bdo,"superRefine"),success:a(()=>Mol,"success"),stringbool:a(()=>Uol,"stringbool"),stringFormat:a(()=>fol,"stringFormat"),string:a(()=>xt,"string"),strictObject:a(()=>Iol,"strictObject"),startsWith:a(()=>zjr,"startsWith"),size:a(()=>Hjr,"size"),setErrorMap:a(()=>jol,"setErrorMap"),set:a(()=>kol,"set"),safeParseAsync:a(()=>tdo,"safeParseAsync"),safeParse:a(()=>edo,"safeParse"),registry:a(()=>vjr,"registry"),regexes:a(()=>ajr,"regexes"),regex:a(()=>Gjr,"regex"),refine:a(()=>Ldo,"refine"),record:a(()=>gu,"record"),readonly:a(()=>Rdo,"readonly"),property:a(()=>Fuo,"property"),promise:a(()=>Bol,"promise"),prettifyError:a(()=>rco,"prettifyError"),preprocess:a(()=>BHr,"preprocess"),prefault:a(()=>Cdo,"prefault"),positive:a(()=>Muo,"positive"),pipe:a(()=>Nkt,"pipe"),partialRecord:a(()=>wol,"partialRecord"),parseAsync:a(()=>Xuo,"parseAsync"),parse:a(()=>Zuo,"parse"),overwrite:a(()=>ise,"overwrite"),optional:a(()=>Od,"optional"),object:a(()=>In,"object"),number:a(()=>Gc,"number"),nullish:a(()=>Nol,"nullish"),nullable:a(()=>Dkt,"nullable"),null:a(()=>xHr,"null"),normalize:a(()=>Jjr,"normalize"),nonpositive:a(()=>Luo,"nonpositive"),nonoptional:a(()=>bdo,"nonoptional"),nonnegative:a(()=>Buo,"nonnegative"),never:a(()=>wPt,"never"),negative:a(()=>Ouo,"negative"),nativeEnum:a(()=>Pol,"nativeEnum"),nanoid:a(()=>Zil,"nanoid"),nan:a(()=>Ool,"nan"),multipleOf:a(()=>gUe,"multipleOf"),minSize:a(()=>AUe,"minSize"),minLength:a(()=>abe,"minLength"),mime:a(()=>Kjr,"mime"),maxSize:a(()=>vPt,"maxSize"),maxLength:a(()=>CPt,"maxLength"),map:a(()=>Rol,"map"),lte:a(()=>gM,"lte"),lt:a(()=>Zoe,"lt"),lowercase:a(()=>$jr,"lowercase"),looseObject:a(()=>gC,"looseObject"),locales:a(()=>Ejr,"locales"),literal:a(()=>ni,"literal"),length:a(()=>bPt,"length"),lazy:a(()=>Ddo,"lazy"),ksuid:a(()=>nol,"ksuid"),keyof:a(()=>Tol,"keyof"),jwt:a(()=>dol,"jwt"),json:a(()=>Qol,"json"),iso:a(()=>nHr,"iso"),ipv6:a(()=>ool,"ipv6"),ipv4:a(()=>iol,"ipv4"),intersection:a(()=>kPt,"intersection"),int64:a(()=>yol,"int64"),int32:a(()=>mol,"int32"),int:a(()=>qQr,"int"),instanceof:a(()=>Fol,"instanceof"),includes:a(()=>Wjr,"includes"),guid:a(()=>$il,"guid"),gte:a(()=>rx,"gte"),gt:a(()=>Xoe,"gt"),globalRegistry:a(()=>P9,"globalRegistry"),getErrorMap:a(()=>Hol,"getErrorMap"),function:a(()=>$uo,"function"),formatError:a(()=>rjr,"formatError"),float64:a(()=>hol,"float64"),float32:a(()=>pol,"float32"),flattenError:a(()=>tjr,"flattenError"),file:a(()=>Dol,"file"),enum:a(()=>i1,"enum"),endsWith:a(()=>Yjr,"endsWith"),emoji:a(()=>Jil,"emoji"),email:a(()=>Gil,"email"),e164:a(()=>uol,"e164"),discriminatedUnion:a(()=>kHr,"discriminatedUnion"),date:a(()=>Sol,"date"),custom:a(()=>Odo,"custom"),cuid2:a(()=>eol,"cuid2"),cuid:a(()=>Xil,"cuid"),core:a(()=>jao,"core"),config:a(()=>_C,"config"),coerce:a(()=>Fdo,"coerce"),clone:a(()=>bM,"clone"),cidrv6:a(()=>aol,"cidrv6"),cidrv4:a(()=>sol,"cidrv4"),check:a(()=>Mdo,"check"),catch:a(()=>Ido,"catch"),boolean:a(()=>Jg,"boolean"),bigint:a(()=>Aol,"bigint"),base64url:a(()=>lol,"base64url"),base64:a(()=>col,"base64"),array:a(()=>ka,"array"),any:a(()=>Col,"any"),_default:a(()=>Edo,"_default"),_ZodString:a(()=>cHr,"_ZodString"),ZodXID:a(()=>gHr,"ZodXID"),ZodVoid:a(()=>ldo,"ZodVoid"),ZodUnknown:a(()=>ado,"ZodUnknown"),ZodUnion:a(()=>RHr,"ZodUnion"),ZodUndefined:a(()=>ido,"ZodUndefined"),ZodUUID:a(()=>D9,"ZodUUID"),ZodURL:a(()=>uHr,"ZodURL"),ZodULID:a(()=>mHr,"ZodULID"),ZodType:a(()=>Qs,"ZodType"),ZodTuple:a(()=>pdo,"ZodTuple"),ZodTransform:a(()=>DHr,"ZodTransform"),ZodTemplateLiteral:a(()=>kdo,"ZodTemplateLiteral"),ZodSymbol:a(()=>ndo,"ZodSymbol"),ZodSuccess:a(()=>Sdo,"ZodSuccess"),ZodStringFormat:a(()=>Bd,"ZodStringFormat"),ZodString:a(()=>SPt,"ZodString"),ZodSet:a(()=>mdo,"ZodSet"),ZodRecord:a(()=>PHr,"ZodRecord"),ZodRealError:a(()=>DUe,"ZodRealError"),ZodReadonly:a(()=>wdo,"ZodReadonly"),ZodPromise:a(()=>Ndo,"ZodPromise"),ZodPrefault:a(()=>vdo,"ZodPrefault"),ZodPipe:a(()=>LHr,"ZodPipe"),ZodOptional:a(()=>MHr,"ZodOptional"),ZodObject:a(()=>RPt,"ZodObject"),ZodNumberFormat:a(()=>Ebe,"ZodNumberFormat"),ZodNumber:a(()=>TPt,"ZodNumber"),ZodNullable:a(()=>ydo,"ZodNullable"),ZodNull:a(()=>odo,"ZodNull"),ZodNonOptional:a(()=>OHr,"ZodNonOptional"),ZodNever:a(()=>cdo,"ZodNever"),ZodNanoID:a(()=>fHr,"ZodNanoID"),ZodNaN:a(()=>xdo,"ZodNaN"),ZodMap:a(()=>hdo,"ZodMap"),ZodLiteral:a(()=>gdo,"ZodLiteral"),ZodLazy:a(()=>Pdo,"ZodLazy"),ZodKSUID:a(()=>AHr,"ZodKSUID"),ZodJWT:a(()=>THr,"ZodJWT"),ZodIssueCode:a(()=>qol,"ZodIssueCode"),ZodIntersection:a(()=>fdo,"ZodIntersection"),ZodISOTime:a(()=>sHr,"ZodISOTime"),ZodISODuration:a(()=>aHr,"ZodISODuration"),ZodISODateTime:a(()=>iHr,"ZodISODateTime"),ZodISODate:a(()=>oHr,"ZodISODate"),ZodIPv6:a(()=>_Hr,"ZodIPv6"),ZodIPv4:a(()=>yHr,"ZodIPv4"),ZodGUID:a(()=>Pkt,"ZodGUID"),ZodFile:a(()=>Ado,"ZodFile"),ZodError:a(()=>Hil,"ZodError"),ZodEnum:a(()=>_Ue,"ZodEnum"),ZodEmoji:a(()=>dHr,"ZodEmoji"),ZodEmail:a(()=>lHr,"ZodEmail"),ZodE164:a(()=>SHr,"ZodE164"),ZodDiscriminatedUnion:a(()=>ddo,"ZodDiscriminatedUnion"),ZodDefault:a(()=>_do,"ZodDefault"),ZodDate:a(()=>wHr,"ZodDate"),ZodCustomStringFormat:a(()=>rdo,"ZodCustomStringFormat"),ZodCustom:a(()=>PPt,"ZodCustom"),ZodCatch:a(()=>Tdo,"ZodCatch"),ZodCUID2:a(()=>hHr,"ZodCUID2"),ZodCUID:a(()=>pHr,"ZodCUID"),ZodCIDRv6:a(()=>vHr,"ZodCIDRv6"),ZodCIDRv4:a(()=>EHr,"ZodCIDRv4"),ZodBoolean:a(()=>IPt,"ZodBoolean"),ZodBigIntFormat:a(()=>IHr,"ZodBigIntFormat"),ZodBigInt:a(()=>xPt,"ZodBigInt"),ZodBase64URL:a(()=>bHr,"ZodBase64URL"),ZodBase64:a(()=>CHr,"ZodBase64"),ZodArray:a(()=>udo,"ZodArray"),ZodAny:a(()=>sdo,"ZodAny"),TimePrecision:a(()=>auo,"TimePrecision"),NEVER:a(()=>Hao,"NEVER"),$output:a(()=>nuo,"$output"),$input:a(()=>iuo,"$input"),$brand:a(()=>Gao,"$brand")});nHr={};RB(nHr,{time:a(()=>Yuo,"time"),duration:a(()=>Kuo,"duration"),datetime:a(()=>Wuo,"datetime"),date:a(()=>zuo,"date"),ZodISOTime:a(()=>sHr,"ZodISOTime"),ZodISODuration:a(()=>aHr,"ZodISODuration"),ZodISODateTime:a(()=>iHr,"ZodISODateTime"),ZodISODate:a(()=>oHr,"ZodISODate")});iHr=pt("ZodISODateTime",(t,e)=>{dlo.init(t,e),Bd.init(t,e)});a(Wuo,"aq");oHr=pt("ZodISODate",(t,e)=>{flo.init(t,e),Bd.init(t,e)});a(zuo,"sq");sHr=pt("ZodISOTime",(t,e)=>{plo.init(t,e),Bd.init(t,e)});a(Yuo,"eq");aHr=pt("ZodISODuration",(t,e)=>{hlo.init(t,e),Bd.init(t,e)});a(Kuo,"$V");Juo=a((t,e)=>{ejr.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>rjr(t,r),"value")},flatten:{value:a(r=>tjr(t,r),"value")},addIssue:{value:a(r=>t.issues.push(r),"value")},addIssues:{value:a(r=>t.issues.push(...r),"value")},isEmpty:{get(){return t.issues.length===0}}})},"vM"),Hil=pt("ZodError",Juo),DUe=pt("ZodError",Juo,{Parent:Error}),Zuo=njr(DUe),Xuo=ijr(DUe),edo=ojr(DUe),tdo=sjr(DUe),Qs=pt("ZodType",(t,e)=>(So.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>bM(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>Zuo(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>edo(t,r,n),t.parseAsync=async(r,n)=>Xuo(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>tdo(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Ldo(r,n)),t.superRefine=r=>t.check(Bdo(r)),t.overwrite=r=>t.check(ise(r)),t.optional=()=>Od(t),t.nullable=()=>Dkt(t),t.nullish=()=>Od(Dkt(t)),t.nonoptional=r=>bdo(t,r),t.array=()=>ka(t),t.or=r=>Au([t,r]),t.and=r=>kPt(t,r),t.transform=r=>Nkt(t,NHr(r)),t.default=r=>Edo(t,r),t.prefault=r=>Cdo(t,r),t.catch=r=>Ido(t,r),t.pipe=r=>Nkt(t,r),t.readonly=()=>Rdo(t),t.describe=r=>{let n=t.clone();return P9.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return P9.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return P9.get(t);let n=t.clone();return P9.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),cHr=pt("_ZodString",(t,e)=>{kUe.init(t,e),Qs.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(Gjr(...n)),t.includes=(...n)=>t.check(Wjr(...n)),t.startsWith=(...n)=>t.check(zjr(...n)),t.endsWith=(...n)=>t.check(Yjr(...n)),t.min=(...n)=>t.check(abe(...n)),t.max=(...n)=>t.check(CPt(...n)),t.length=(...n)=>t.check(bPt(...n)),t.nonempty=(...n)=>t.check(abe(1,...n)),t.lowercase=n=>t.check($jr(n)),t.uppercase=n=>t.check(Vjr(n)),t.trim=()=>t.check(Zjr()),t.normalize=(...n)=>t.check(Jjr(...n)),t.toLowerCase=()=>t.check(Xjr()),t.toUpperCase=()=>t.check(eHr())}),SPt=pt("ZodString",(t,e)=>{kUe.init(t,e),cHr.init(t,e),t.email=r=>t.check(Cjr(lHr,r)),t.url=r=>t.check(xjr(uHr,r)),t.jwt=r=>t.check(jjr(THr,r)),t.emoji=r=>t.check(wjr(dHr,r)),t.guid=r=>t.check(wkt(Pkt,r)),t.uuid=r=>t.check(bjr(D9,r)),t.uuidv4=r=>t.check(Sjr(D9,r)),t.uuidv6=r=>t.check(Tjr(D9,r)),t.uuidv7=r=>t.check(Ijr(D9,r)),t.nanoid=r=>t.check(Rjr(fHr,r)),t.guid=r=>t.check(wkt(Pkt,r)),t.cuid=r=>t.check(kjr(pHr,r)),t.cuid2=r=>t.check(Pjr(hHr,r)),t.ulid=r=>t.check(Djr(mHr,r)),t.base64=r=>t.check(Ujr(CHr,r)),t.base64url=r=>t.check(Qjr(bHr,r)),t.xid=r=>t.check(Njr(gHr,r)),t.ksuid=r=>t.check(Mjr(AHr,r)),t.ipv4=r=>t.check(Ojr(yHr,r)),t.ipv6=r=>t.check(Ljr(_Hr,r)),t.cidrv4=r=>t.check(Bjr(EHr,r)),t.cidrv6=r=>t.check(Fjr(vHr,r)),t.e164=r=>t.check(qjr(SHr,r)),t.datetime=r=>t.check(Wuo(r)),t.date=r=>t.check(zuo(r)),t.time=r=>t.check(Yuo(r)),t.duration=r=>t.check(Kuo(r))});a(xt,"L");Bd=pt("ZodStringFormat",(t,e)=>{Wu.init(t,e),cHr.init(t,e)}),lHr=pt("ZodEmail",(t,e)=>{rlo.init(t,e),Bd.init(t,e)});a(Gil,"Cm");Pkt=pt("ZodGUID",(t,e)=>{elo.init(t,e),Bd.init(t,e)});a($il,"Tm");D9=pt("ZodUUID",(t,e)=>{tlo.init(t,e),Bd.init(t,e)});a(Vil,"xm");a(Wil,"ym");a(zil,"fm");a(Yil,"gm");uHr=pt("ZodURL",(t,e)=>{nlo.init(t,e),Bd.init(t,e)});a(Kil,"hm");dHr=pt("ZodEmoji",(t,e)=>{ilo.init(t,e),Bd.init(t,e)});a(Jil,"um");fHr=pt("ZodNanoID",(t,e)=>{olo.init(t,e),Bd.init(t,e)});a(Zil,"mm");pHr=pt("ZodCUID",(t,e)=>{slo.init(t,e),Bd.init(t,e)});a(Xil,"lm");hHr=pt("ZodCUID2",(t,e)=>{alo.init(t,e),Bd.init(t,e)});a(eol,"cm");mHr=pt("ZodULID",(t,e)=>{clo.init(t,e),Bd.init(t,e)});a(tol,"pm");gHr=pt("ZodXID",(t,e)=>{llo.init(t,e),Bd.init(t,e)});a(rol,"dm");AHr=pt("ZodKSUID",(t,e)=>{ulo.init(t,e),Bd.init(t,e)});a(nol,"im");yHr=pt("ZodIPv4",(t,e)=>{mlo.init(t,e),Bd.init(t,e)});a(iol,"nm");_Hr=pt("ZodIPv6",(t,e)=>{glo.init(t,e),Bd.init(t,e)});a(ool,"rm");EHr=pt("ZodCIDRv4",(t,e)=>{Alo.init(t,e),Bd.init(t,e)});a(sol,"om");vHr=pt("ZodCIDRv6",(t,e)=>{ylo.init(t,e),Bd.init(t,e)});a(aol,"tm");CHr=pt("ZodBase64",(t,e)=>{_lo.init(t,e),Bd.init(t,e)});a(col,"am");bHr=pt("ZodBase64URL",(t,e)=>{vlo.init(t,e),Bd.init(t,e)});a(lol,"sm");SHr=pt("ZodE164",(t,e)=>{Clo.init(t,e),Bd.init(t,e)});a(uol,"em");THr=pt("ZodJWT",(t,e)=>{Slo.init(t,e),Bd.init(t,e)});a(dol,"$l");rdo=pt("ZodCustomStringFormat",(t,e)=>{Tlo.init(t,e),Bd.init(t,e)});a(fol,"Ql");TPt=pt("ZodNumber",(t,e)=>{fjr.init(t,e),Qs.init(t,e),t.gt=(n,o)=>t.check(Xoe(n,o)),t.gte=(n,o)=>t.check(rx(n,o)),t.min=(n,o)=>t.check(rx(n,o)),t.lt=(n,o)=>t.check(Zoe(n,o)),t.lte=(n,o)=>t.check(gM(n,o)),t.max=(n,o)=>t.check(gM(n,o)),t.int=n=>t.check(qQr(n)),t.safe=n=>t.check(qQr(n)),t.positive=n=>t.check(Xoe(0,n)),t.nonnegative=n=>t.check(rx(0,n)),t.negative=n=>t.check(Zoe(0,n)),t.nonpositive=n=>t.check(gM(0,n)),t.multipleOf=(n,o)=>t.check(gUe(n,o)),t.step=(n,o)=>t.check(gUe(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});a(Gc,"z$");Ebe=pt("ZodNumberFormat",(t,e)=>{Ilo.init(t,e),TPt.init(t,e)});a(qQr,"WV");a(pol,"Jl");a(hol,"Xl");a(mol,"Yl");a(gol,"Wl");IPt=pt("ZodBoolean",(t,e)=>{pjr.init(t,e),Qs.init(t,e)});a(Jg,"i$");xPt=pt("ZodBigInt",(t,e)=>{hjr.init(t,e),Qs.init(t,e),t.gte=(n,o)=>t.check(rx(n,o)),t.min=(n,o)=>t.check(rx(n,o)),t.gt=(n,o)=>t.check(Xoe(n,o)),t.gte=(n,o)=>t.check(rx(n,o)),t.min=(n,o)=>t.check(rx(n,o)),t.lt=(n,o)=>t.check(Zoe(n,o)),t.lte=(n,o)=>t.check(gM(n,o)),t.max=(n,o)=>t.check(gM(n,o)),t.positive=n=>t.check(Xoe(BigInt(0),n)),t.negative=n=>t.check(Zoe(BigInt(0),n)),t.nonpositive=n=>t.check(gM(BigInt(0),n)),t.nonnegative=n=>t.check(rx(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(gUe(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(Aol,"Gl");IHr=pt("ZodBigIntFormat",(t,e)=>{xlo.init(t,e),xPt.init(t,e)});a(yol,"Ul");a(_ol,"Hl");ndo=pt("ZodSymbol",(t,e)=>{wlo.init(t,e),Qs.init(t,e)});a(Eol,"Kl");ido=pt("ZodUndefined",(t,e)=>{Rlo.init(t,e),Qs.init(t,e)});a(vol,"ql");odo=pt("ZodNull",(t,e)=>{klo.init(t,e),Qs.init(t,e)});a(xHr,"T3");sdo=pt("ZodAny",(t,e)=>{Plo.init(t,e),Qs.init(t,e)});a(Col,"Vl");ado=pt("ZodUnknown",(t,e)=>{xkt.init(t,e),Qs.init(t,e)});a(Af,"S$");cdo=pt("ZodNever",(t,e)=>{Dlo.init(t,e),Qs.init(t,e)});a(wPt,"x3");ldo=pt("ZodVoid",(t,e)=>{Nlo.init(t,e),Qs.init(t,e)});a(bol,"Bl");wHr=pt("ZodDate",(t,e)=>{Mlo.init(t,e),Qs.init(t,e),t.min=(n,o)=>t.check(rx(n,o)),t.max=(n,o)=>t.check(gM(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});a(Sol,"zl");udo=pt("ZodArray",(t,e)=>{mjr.init(t,e),Qs.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(abe(r,n)),t.nonempty=r=>t.check(abe(1,r)),t.max=(r,n)=>t.check(CPt(r,n)),t.length=(r,n)=>t.check(bPt(r,n)),t.unwrap=()=>t.element});a(ka,"W$");a(Tol,"Nl");RPt=pt("ZodObject",(t,e)=>{gjr.init(t,e),Qs.init(t,e),Xs.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>i1(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Af()}),t.loose=()=>t.clone({...t._zod.def,catchall:Af()}),t.strict=()=>t.clone({...t._zod.def,catchall:wPt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Xs.extend(t,r),t.merge=r=>Xs.merge(t,r),t.pick=r=>Xs.pick(t,r),t.omit=r=>Xs.omit(t,r),t.partial=(...r)=>Xs.partial(MHr,t,r[0]),t.required=(...r)=>Xs.required(OHr,t,r[0])});a(In,"h");a(Iol,"wl");a(gC,"K6");RHr=pt("ZodUnion",(t,e)=>{Ajr.init(t,e),Qs.init(t,e),t.options=e.options});a(Au,"A$");ddo=pt("ZodDiscriminatedUnion",(t,e)=>{RHr.init(t,e),Olo.init(t,e)});a(kHr,"g3");fdo=pt("ZodIntersection",(t,e)=>{Llo.init(t,e),Qs.init(t,e)});a(kPt,"VJ");pdo=pt("ZodTuple",(t,e)=>{EPt.init(t,e),Qs.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a(xol,"Ol");PHr=pt("ZodRecord",(t,e)=>{Blo.init(t,e),Qs.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(gu,"I$");a(wol,"Dl");hdo=pt("ZodMap",(t,e)=>{Flo.init(t,e),Qs.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(Rol,"Fl");mdo=pt("ZodSet",(t,e)=>{Ulo.init(t,e),Qs.init(t,e),t.min=(...r)=>t.check(AUe(...r)),t.nonempty=r=>t.check(AUe(1,r)),t.max=(...r)=>t.check(vPt(...r)),t.size=(...r)=>t.check(Hjr(...r))});a(kol,"Zl");_Ue=pt("ZodEnum",(t,e)=>{Qlo.init(t,e),Qs.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let c of n)if(r.has(c))s[c]=e.entries[c];else throw Error(`Key ${c} not found in enum`);return new _Ue({...e,checks:[],...Xs.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let c of n)if(r.has(c))delete s[c];else throw Error(`Key ${c} not found in enum`);return new _Ue({...e,checks:[],...Xs.normalizeParams(o),entries:s})}});a(i1,"N6");a(Pol,"Ml");gdo=pt("ZodLiteral",(t,e)=>{qlo.init(t,e),Qs.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});a(ni,"l");Ado=pt("ZodFile",(t,e)=>{jlo.init(t,e),Qs.init(t,e),t.min=(r,n)=>t.check(AUe(r,n)),t.max=(r,n)=>t.check(vPt(r,n)),t.mime=(r,n)=>t.check(Kjr(Array.isArray(r)?r:[r],n))});a(Dol,"Ll");DHr=pt("ZodTransform",(t,e)=>{yjr.init(t,e),Qs.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Xs.issue(s,r.value,e));else{let c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=t),c.continue??(c.continue=!0),r.issues.push(Xs.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});a(NHr,"bV");MHr=pt("ZodOptional",(t,e)=>{Hlo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Od,"_$");ydo=pt("ZodNullable",(t,e)=>{Glo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Dkt,"v3");a(Nol,"jl");_do=pt("ZodDefault",(t,e)=>{$lo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(Edo,"aM");vdo=pt("ZodPrefault",(t,e)=>{Vlo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Cdo,"eM");OHr=pt("ZodNonOptional",(t,e)=>{Wlo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(bdo,"$L");Sdo=pt("ZodSuccess",(t,e)=>{zlo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Mol,"Al");Tdo=pt("ZodCatch",(t,e)=>{Ylo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(Ido,"XL");xdo=pt("ZodNaN",(t,e)=>{Klo.init(t,e),Qs.init(t,e)});a(Ool,"Il");LHr=pt("ZodPipe",(t,e)=>{_jr.init(t,e),Qs.init(t,e),t.in=e.in,t.out=e.out});a(Nkt,"C3");wdo=pt("ZodReadonly",(t,e)=>{Jlo.init(t,e),Qs.init(t,e)});a(Rdo,"GL");kdo=pt("ZodTemplateLiteral",(t,e)=>{Zlo.init(t,e),Qs.init(t,e)});a(Lol,"Rl");Pdo=pt("ZodLazy",(t,e)=>{euo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(Ddo,"KL");Ndo=pt("ZodPromise",(t,e)=>{Xlo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Bol,"Pl");PPt=pt("ZodCustom",(t,e)=>{tuo.init(t,e),Qs.init(t,e)});a(Mdo,"VL");a(Odo,"vV");a(Ldo,"BL");a(Bdo,"zL");a(Fol,"El");Uol=a((...t)=>Huo({Pipe:LHr,Boolean:IPt,String:SPt,Transform:DHr},...t),"bl");a(Qol,"_l");a(BHr,"u3");qol={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};a(jol,"Sl");a(Hol,"vl");Fdo={};RB(Fdo,{string:a(()=>Gol,"string"),number:a(()=>$ol,"number"),date:a(()=>zol,"date"),boolean:a(()=>Vol,"boolean"),bigint:a(()=>Wol,"bigint")});a(Gol,"Cl");a($ol,"Tl");a(Vol,"xl");a(Wol,"yl");a(zol,"fl");_C(ruo());Yol=G,Udo=Yol,Qdo="2025-11-25",Kol=[Qdo,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Qoe="io.modelcontextprotocol/related-task",DPt="2.0",Zg=Odo(t=>t!==null&&(typeof t=="object"||typeof t=="function")),qdo=Au([xt(),Gc().int()]),jdo=xt(),cpm=gC({ttl:Gc().optional(),pollInterval:Gc().optional()}),Jol=In({ttl:Gc().optional()}),Zol=In({taskId:xt()}),FHr=gC({progressToken:qdo.optional(),[Qoe]:Zol.optional()}),ax=In({_meta:FHr.optional()}),NUe=ax.extend({task:Jol.optional()}),Xol=a(t=>NUe.safeParse(t).success,"FL"),zy=In({method:xt(),params:ax.loose().optional()}),Kk=In({_meta:FHr.optional()}),Jk=In({method:xt(),params:Kk.loose().optional()}),Yy=gC({_meta:FHr.optional()}),NPt=Au([xt(),Gc().int()]),Hdo=In({jsonrpc:ni(DPt),id:NPt,...zy.shape}).strict(),Fio=a(t=>Hdo.safeParse(t).success,"fV"),Gdo=In({jsonrpc:ni(DPt),...Jk.shape}).strict(),esl=a(t=>Gdo.safeParse(t).success,"LL"),UHr=In({jsonrpc:ni(DPt),id:NPt,result:Yy}).strict(),SRt=a(t=>UHr.safeParse(t).success,"zJ");(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Qi||(Qi={}));QHr=In({jsonrpc:ni(DPt),id:NPt.optional(),error:In({code:Gc().int(),message:xt(),data:Af().optional()})}).strict(),tsl=a(t=>QHr.safeParse(t).success,"jL"),lpm=Au([Hdo,Gdo,UHr,QHr]),upm=Au([UHr,QHr]),qHr=Yy.strict(),rsl=Kk.extend({requestId:NPt.optional(),reason:xt().optional()}),jHr=Jk.extend({method:ni("notifications/cancelled"),params:rsl}),nsl=In({src:xt(),mimeType:xt().optional(),sizes:ka(xt()).optional(),theme:i1(["light","dark"]).optional()}),MUe=In({icons:ka(nsl).optional()}),cbe=In({name:xt(),title:xt().optional()}),$do=cbe.extend({...cbe.shape,...MUe.shape,version:xt(),websiteUrl:xt().optional(),description:xt().optional()}),isl=kPt(In({applyDefaults:Jg().optional()}),gu(xt(),Af())),osl=BHr(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,kPt(In({form:isl.optional(),url:Zg.optional()}),gu(xt(),Af()).optional())),ssl=gC({list:Zg.optional(),cancel:Zg.optional(),requests:gC({sampling:gC({createMessage:Zg.optional()}).optional(),elicitation:gC({create:Zg.optional()}).optional()}).optional()}),asl=gC({list:Zg.optional(),cancel:Zg.optional(),requests:gC({tools:gC({call:Zg.optional()}).optional()}).optional()}),csl=In({experimental:gu(xt(),Zg).optional(),sampling:In({context:Zg.optional(),tools:Zg.optional()}).optional(),elicitation:osl.optional(),roots:In({listChanged:Jg().optional()}).optional(),tasks:ssl.optional(),extensions:gu(xt(),Zg).optional()}),lsl=ax.extend({protocolVersion:xt(),capabilities:csl,clientInfo:$do}),Vdo=zy.extend({method:ni("initialize"),params:lsl}),usl=In({experimental:gu(xt(),Zg).optional(),logging:Zg.optional(),completions:Zg.optional(),prompts:In({listChanged:Jg().optional()}).optional(),resources:In({subscribe:Jg().optional(),listChanged:Jg().optional()}).optional(),tools:In({listChanged:Jg().optional()}).optional(),tasks:asl.optional(),extensions:gu(xt(),Zg).optional()}),dsl=Yy.extend({protocolVersion:xt(),capabilities:usl,serverInfo:$do,instructions:xt().optional()}),Wdo=Jk.extend({method:ni("notifications/initialized"),params:Kk.optional()}),HHr=zy.extend({method:ni("ping"),params:ax.optional()}),fsl=In({progress:Gc(),total:Od(Gc()),message:Od(xt())}),psl=In({...Kk.shape,...fsl.shape,progressToken:qdo}),GHr=Jk.extend({method:ni("notifications/progress"),params:psl}),hsl=ax.extend({cursor:jdo.optional()}),OUe=zy.extend({params:hsl.optional()}),LUe=Yy.extend({nextCursor:jdo.optional()}),msl=i1(["working","input_required","completed","failed","cancelled"]),BUe=In({taskId:xt(),status:msl,ttl:Au([Gc(),xHr()]),createdAt:xt(),lastUpdatedAt:xt(),pollInterval:Od(Gc()),statusMessage:Od(xt())}),MPt=Yy.extend({task:BUe}),gsl=Kk.merge(BUe),Mkt=Jk.extend({method:ni("notifications/tasks/status"),params:gsl}),$Hr=zy.extend({method:ni("tasks/get"),params:ax.extend({taskId:xt()})}),VHr=Yy.merge(BUe),WHr=zy.extend({method:ni("tasks/result"),params:ax.extend({taskId:xt()})}),dpm=Yy.loose(),zHr=OUe.extend({method:ni("tasks/list")}),YHr=LUe.extend({tasks:ka(BUe)}),KHr=zy.extend({method:ni("tasks/cancel"),params:ax.extend({taskId:xt()})}),Asl=Yy.merge(BUe),zdo=In({uri:xt(),mimeType:Od(xt()),_meta:gu(xt(),Af()).optional()}),Ydo=zdo.extend({text:xt()}),JHr=xt().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Kdo=zdo.extend({blob:JHr}),FUe=i1(["user","assistant"]),vbe=In({audience:ka(FUe).optional(),priority:Gc().min(0).max(1).optional(),lastModified:nHr.datetime({offset:!0}).optional()}),Jdo=In({...cbe.shape,...MUe.shape,uri:xt(),description:Od(xt()),mimeType:Od(xt()),size:Od(Gc()),annotations:vbe.optional(),_meta:Od(gC({}))}),ysl=In({...cbe.shape,...MUe.shape,uriTemplate:xt(),description:Od(xt()),mimeType:Od(xt()),annotations:vbe.optional(),_meta:Od(gC({}))}),jQr=OUe.extend({method:ni("resources/list")}),_sl=LUe.extend({resources:ka(Jdo)}),HQr=OUe.extend({method:ni("resources/templates/list")}),Esl=LUe.extend({resourceTemplates:ka(ysl)}),ZHr=ax.extend({uri:xt()}),vsl=ZHr,GQr=zy.extend({method:ni("resources/read"),params:vsl}),Csl=Yy.extend({contents:ka(Au([Ydo,Kdo]))}),bsl=Jk.extend({method:ni("notifications/resources/list_changed"),params:Kk.optional()}),Ssl=ZHr,Tsl=zy.extend({method:ni("resources/subscribe"),params:Ssl}),Isl=ZHr,xsl=zy.extend({method:ni("resources/unsubscribe"),params:Isl}),wsl=Kk.extend({uri:xt()}),Rsl=Jk.extend({method:ni("notifications/resources/updated"),params:wsl}),ksl=In({name:xt(),description:Od(xt()),required:Od(Jg())}),Psl=In({...cbe.shape,...MUe.shape,description:Od(xt()),arguments:Od(ka(ksl)),_meta:Od(gC({}))}),$Qr=OUe.extend({method:ni("prompts/list")}),Dsl=LUe.extend({prompts:ka(Psl)}),Nsl=ax.extend({name:xt(),arguments:gu(xt(),xt()).optional()}),VQr=zy.extend({method:ni("prompts/get"),params:Nsl}),XHr=In({type:ni("text"),text:xt(),annotations:vbe.optional(),_meta:gu(xt(),Af()).optional()}),eGr=In({type:ni("image"),data:JHr,mimeType:xt(),annotations:vbe.optional(),_meta:gu(xt(),Af()).optional()}),tGr=In({type:ni("audio"),data:JHr,mimeType:xt(),annotations:vbe.optional(),_meta:gu(xt(),Af()).optional()}),Msl=In({type:ni("tool_use"),name:xt(),id:xt(),input:gu(xt(),Af()),_meta:gu(xt(),Af()).optional()}),Osl=In({type:ni("resource"),resource:Au([Ydo,Kdo]),annotations:vbe.optional(),_meta:gu(xt(),Af()).optional()}),Lsl=Jdo.extend({type:ni("resource_link")}),rGr=Au([XHr,eGr,tGr,Lsl,Osl]),Bsl=In({role:FUe,content:rGr}),Fsl=Yy.extend({description:xt().optional(),messages:ka(Bsl)}),Usl=Jk.extend({method:ni("notifications/prompts/list_changed"),params:Kk.optional()}),Qsl=In({title:xt().optional(),readOnlyHint:Jg().optional(),destructiveHint:Jg().optional(),idempotentHint:Jg().optional(),openWorldHint:Jg().optional()}),qsl=In({taskSupport:i1(["required","optional","forbidden"]).optional()}),Zdo=In({...cbe.shape,...MUe.shape,description:xt().optional(),inputSchema:In({type:ni("object"),properties:gu(xt(),Zg).optional(),required:ka(xt()).optional()}).catchall(Af()),outputSchema:In({type:ni("object"),properties:gu(xt(),Zg).optional(),required:ka(xt()).optional()}).catchall(Af()).optional(),annotations:Qsl.optional(),execution:qsl.optional(),_meta:gu(xt(),Af()).optional()}),WQr=OUe.extend({method:ni("tools/list")}),jsl=LUe.extend({tools:ka(Zdo)}),nGr=Yy.extend({content:ka(rGr).default([]),structuredContent:gu(xt(),Af()).optional(),isError:Jg().optional()}),fpm=nGr.or(Yy.extend({toolResult:Af()})),Hsl=NUe.extend({name:xt(),arguments:gu(xt(),Af()).optional()}),Okt=zy.extend({method:ni("tools/call"),params:Hsl}),Gsl=Jk.extend({method:ni("notifications/tools/list_changed"),params:Kk.optional()}),ppm=In({autoRefresh:Jg().default(!0),debounceMs:Gc().int().nonnegative().default(300)}),Lkt=i1(["debug","info","notice","warning","error","critical","alert","emergency"]),$sl=ax.extend({level:Lkt}),Xdo=zy.extend({method:ni("logging/setLevel"),params:$sl}),Vsl=Kk.extend({level:Lkt,logger:xt().optional(),data:Af()}),Wsl=Jk.extend({method:ni("notifications/message"),params:Vsl}),zsl=In({name:xt().optional()}),Ysl=In({hints:ka(zsl).optional(),costPriority:Gc().min(0).max(1).optional(),speedPriority:Gc().min(0).max(1).optional(),intelligencePriority:Gc().min(0).max(1).optional()}),Ksl=In({mode:i1(["auto","required","none"]).optional()}),Jsl=In({type:ni("tool_result"),toolUseId:xt().describe("The unique identifier for the corresponding tool call."),content:ka(rGr).default([]),structuredContent:In({}).loose().optional(),isError:Jg().optional(),_meta:gu(xt(),Af()).optional()}),Zsl=kHr("type",[XHr,eGr,tGr]),Bkt=kHr("type",[XHr,eGr,tGr,Msl,Jsl]),Xsl=In({role:FUe,content:Au([Bkt,ka(Bkt)]),_meta:gu(xt(),Af()).optional()}),eal=NUe.extend({messages:ka(Xsl),modelPreferences:Ysl.optional(),systemPrompt:xt().optional(),includeContext:i1(["none","thisServer","allServers"]).optional(),temperature:Gc().optional(),maxTokens:Gc().int(),stopSequences:ka(xt()).optional(),metadata:Zg.optional(),tools:ka(Zdo).optional(),toolChoice:Ksl.optional()}),tal=zy.extend({method:ni("sampling/createMessage"),params:eal}),iGr=Yy.extend({model:xt(),stopReason:Od(i1(["endTurn","stopSequence","maxTokens"]).or(xt())),role:FUe,content:Zsl}),efo=Yy.extend({model:xt(),stopReason:Od(i1(["endTurn","stopSequence","maxTokens","toolUse"]).or(xt())),role:FUe,content:Au([Bkt,ka(Bkt)])}),ral=In({type:ni("boolean"),title:xt().optional(),description:xt().optional(),default:Jg().optional()}),nal=In({type:ni("string"),title:xt().optional(),description:xt().optional(),minLength:Gc().optional(),maxLength:Gc().optional(),format:i1(["email","uri","date","date-time"]).optional(),default:xt().optional()}),ial=In({type:i1(["number","integer"]),title:xt().optional(),description:xt().optional(),minimum:Gc().optional(),maximum:Gc().optional(),default:Gc().optional()}),oal=In({type:ni("string"),title:xt().optional(),description:xt().optional(),enum:ka(xt()),default:xt().optional()}),sal=In({type:ni("string"),title:xt().optional(),description:xt().optional(),oneOf:ka(In({const:xt(),title:xt()})),default:xt().optional()}),aal=In({type:ni("string"),title:xt().optional(),description:xt().optional(),enum:ka(xt()),enumNames:ka(xt()).optional(),default:xt().optional()}),cal=Au([oal,sal]),lal=In({type:ni("array"),title:xt().optional(),description:xt().optional(),minItems:Gc().optional(),maxItems:Gc().optional(),items:In({type:ni("string"),enum:ka(xt())}),default:ka(xt()).optional()}),ual=In({type:ni("array"),title:xt().optional(),description:xt().optional(),minItems:Gc().optional(),maxItems:Gc().optional(),items:In({anyOf:ka(In({const:xt(),title:xt()}))}),default:ka(xt()).optional()}),dal=Au([lal,ual]),fal=Au([aal,cal,dal]),pal=Au([fal,ral,nal,ial]),hal=NUe.extend({mode:ni("form").optional(),message:xt(),requestedSchema:In({type:ni("object"),properties:gu(xt(),pal),required:ka(xt()).optional()})}),mal=NUe.extend({mode:ni("url"),message:xt(),elicitationId:xt(),url:xt().url()}),gal=Au([hal,mal]),Aal=zy.extend({method:ni("elicitation/create"),params:gal}),yal=Kk.extend({elicitationId:xt()}),_al=Jk.extend({method:ni("notifications/elicitation/complete"),params:yal}),Fkt=Yy.extend({action:i1(["accept","decline","cancel"]),content:BHr(t=>t===null?void 0:t,gu(xt(),Au([xt(),Gc(),Jg(),ka(xt())])).optional())}),Eal=In({type:ni("ref/resource"),uri:xt()}),val=In({type:ni("ref/prompt"),name:xt()}),Cal=ax.extend({ref:Au([val,Eal]),argument:In({name:xt(),value:xt()}),context:In({arguments:gu(xt(),xt()).optional()}).optional()}),zQr=zy.extend({method:ni("completion/complete"),params:Cal});a(bal,"kL");a(Sal,"SL");Tal=Yy.extend({completion:gC({values:ka(xt()).max(100),total:Od(Gc().int()),hasMore:Od(Jg())})}),Ial=In({uri:xt().startsWith("file://"),name:xt().optional(),_meta:gu(xt(),Af()).optional()}),xal=zy.extend({method:ni("roots/list"),params:ax.optional()}),tfo=Yy.extend({roots:ka(Ial)}),wal=Jk.extend({method:ni("notifications/roots/list_changed"),params:Kk.optional()}),hpm=Au([HHr,Vdo,zQr,Xdo,VQr,$Qr,jQr,HQr,GQr,Tsl,xsl,Okt,WQr,$Hr,WHr,zHr,KHr]),mpm=Au([jHr,GHr,Wdo,wal,Mkt]),gpm=Au([qHr,iGr,efo,Fkt,tfo,VHr,YHr,MPt]),Apm=Au([HHr,tal,Aal,xal,$Hr,WHr,zHr,KHr]),ypm=Au([jHr,GHr,Wsl,Rsl,bsl,Gsl,Usl,Mkt,_al]),_pm=Au([qHr,dsl,Tal,Fsl,Dsl,_sl,Esl,Csl,nGr,jsl,VHr,YHr,MPt]),mi=class t extends Error{static{a(this,"c")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===Qi.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new YQr(o.elicitations,r)}return new t(e,r,n)}},YQr=class extends mi{static{a(this,"vL")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Qi.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};a(Foe,"T1");Ral=Symbol("Let zodToJsonSchema decide on which parser to use"),Uio={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},kal=a(t=>typeof t=="string"?{...Uio,name:t}:{...Uio,...t},"xL"),Pal=a(t=>{let e=kal(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}},"yL");a(rfo,"aV");a(wl,"H$");nfo=a((t,e)=>{let r=0;for(;rHc(t.innerType._def,e),"uL");a(ofo,"sV");Lal=a((t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":wl(r,"minimum",n.value,n.message,e);break;case"max":wl(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(Bal,"mL");a(Fal,"lL");a(Ual,"cL");Qal=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(qal,"pL");a(jal,"dL");$7r=void 0,pM={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:a(()=>($7r===void 0&&($7r=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),$7r),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};a(sfo,"qW");a(V7r,"$B");Hal=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(Gal,"Np");a(hM,"V4");a(mC,"w6");a(Qio,"iL");a(afo,"VW");a($al,"nL");a(Val,"rL");a(Wal,"oL");a(zal,"tL");Ukt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(Yal,"sL");qio=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Hc(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0},"aL");a(Kal,"eL");a(Jal,"$j");a(Zal,"Qj");a(Xal,"wp");a(ecl,"Op");tcl=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Hc(t.innerType._def,e);let r=Hc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:n1(e)},r]}:n1(e)},"Jj"),rcl=a((t,e)=>{if(e.pipeStrategy==="input")return Hc(t.in._def,e);if(e.pipeStrategy==="output")return Hc(t.out._def,e);let r=Hc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Hc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a(ncl,"Yj");a(icl,"Wj");a(ocl,"Gj");a(scl,"Uj");a(acl,"Hj");ccl=a((t,e)=>Hc(t.innerType._def,e),"Kj"),lcl=a((t,e,r)=>{switch(e){case wr.ZodString:return sfo(t,r);case wr.ZodNumber:return Jal(t,r);case wr.ZodObject:return Zal(t,r);case wr.ZodBigInt:return Nal(t,r);case wr.ZodBoolean:return Mal();case wr.ZodDate:return ofo(t,r);case wr.ZodUndefined:return scl(r);case wr.ZodNull:return zal(r);case wr.ZodArray:return Dal(t,r);case wr.ZodUnion:case wr.ZodDiscriminatedUnion:return Yal(t,r);case wr.ZodIntersection:return qal(t,r);case wr.ZodTuple:return ocl(t,r);case wr.ZodRecord:return afo(t,r);case wr.ZodLiteral:return jal(t,r);case wr.ZodEnum:return Ual(t);case wr.ZodNativeEnum:return Val(t);case wr.ZodNullable:return Kal(t,r);case wr.ZodOptional:return tcl(t,r);case wr.ZodMap:return $al(t,r);case wr.ZodSet:return icl(t,r);case wr.ZodLazy:return()=>t.getter()._def;case wr.ZodPromise:return ncl(t,r);case wr.ZodNaN:case wr.ZodNever:return Wal(r);case wr.ZodEffects:return Fal(t,r);case wr.ZodAny:return n1(r);case wr.ZodUnknown:return acl(r);case wr.ZodDefault:return Bal(t,r);case wr.ZodBranded:return ifo(t,r);case wr.ZodReadonly:return ccl(t,r);case wr.ZodCatch:return Oal(t,r);case wr.ZodPipeline:return rcl(t,r);case wr.ZodFunction:case wr.ZodVoid:case wr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Hc,"r");ucl=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:nfo(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),n1(e)):e.$refStrategy==="seen"?n1(e):void 0}},"Dp"),dcl=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),fcl=a((t,e)=>{let r=Pal(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Hc(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0)??n1(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=Hc(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??n1(r),c=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;c!==void 0&&(s.title=c),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let l=o===void 0?n?{...s,[r.definitionPath]:n}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:s}};return r.target==="jsonSchema7"?l.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(l.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in l||"oneOf"in l||"allOf"in l||"type"in l&&Array.isArray(l.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),l},"QB");a(pcl,"Zp");a(jio,"JB");a(Hio,"XB");a(Gio,"YB");hcl=6e4,KQr=class{static{a(this,"WB")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(jHr,r=>{this._oncancel(r)}),this.setNotificationHandler(GHr,r=>{this._onprogress(r)}),this.setRequestHandler(HHr,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler($Hr,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new mi(Qi.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(WHr,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new mi(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new mi(Qi.InvalidParams,`Task not found: ${s}`);if(!Foe(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Foe(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[Qoe]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(zHr,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new mi(Qi.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(KHr,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new mi(Qi.InvalidParams,`Task not found: ${r.params.taskId}`);if(Foe(o.status))throw new mi(Qi.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new mi(Qi.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof mi?o:new mi(Qi.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),mi.fromError(Qi.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,c)=>{o?.(s,c),SRt(s)||tsl(s)?this._onresponse(s):Fio(s)?this._onrequest(s,c):esl(s)?this._onnotification(s):this._onerror(Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=mi.fromError(Qi.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[Qoe]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Qi.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let l=Xol(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,d={signal:c.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:a(async f=>{if(c.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},"sendNotification"),sendRequest:a(async(f,h,m)=>{if(c.signal.aborted)throw new mi(Qi.ConnectionClosed,"Request was cancelled");let g={...m,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let A=g.relatedTask?.taskId??s;return A&&u&&await u.updateTaskStatus(A,"input_required"),await this.request(f,h,g)},"sendRequest"),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:l?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,d)).then(async f=>{if(c.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(c.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:Qi.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===c&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let c=this._responseHandlers.get(o),l=this._timeoutInfo.get(o);if(l&&c&&l.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),c(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),SRt(e))n(e);else{let c=new mi(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(SRt(e)&&e.result&&typeof e.result=="object"){let c=e.result;if(c.task&&typeof c.task=="object"){let l=c.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,r))}}if(s||this._progressHandlers.delete(r),SRt(e))o(e);else{let c=mi.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof mi?c:new mi(Qi.InternalError,String(c))}}return}let s;try{let c=await this.request(e,MPt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new mi(Qi.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Foe(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new mi(Qi.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new mi(Qi.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=l.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),n?.signal?.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof mi?c:new mi(Qi.InternalError,String(c))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c,task:l,relatedTask:u}=n??{};return new Promise((d,f)=>{let h=a(v=>{f(v)},"V");if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),l&&this.assertTaskCapability(e.method)}catch(v){h(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),l&&(g.params={...g.params,task:l}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[Qoe]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(Error(`Failed to send cancellation: ${T}`)));let S=v instanceof mi?v:new mi(Qi.RequestTimeout,String(v));f(S)},"N");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let S=$6e(r,v.result);S.success?d(S.data):f(S.error)}catch(S){f(S)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??hcl,_=a(()=>A(mi.fromError(Qi.RequestTimeout,"Request timed out",{timeout:y})),"O");this._setupTimeout(m,y,n?.maxTotalTimeout,_,n?.resetTimeoutOnProgress??!1);let E=u?.taskId;if(E){let v=a(S=>{let T=this._responseHandlers.get(m);T?T(S):this._onerror(Error(`Response handler missing for side-channeled request ${m}`))},"M");this._requestResolvers.set(m,v),this._enqueueTaskMessage(E,{type:"request",message:g,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(m),f(S)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(v=>{this._cleanupTimeout(m),f(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},VHr,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},YHr,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},Asl,r)}async notification(e,r){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Qoe]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Qoe]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[Qoe]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=Hio(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=Gio(e,o);return Promise.resolve(r(c,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=Hio(e);this._notificationHandlers.set(n,o=>{let s=Gio(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&Fio(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new mi(Qi.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new mi(Qi.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new mi(Qi.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw Error("No task store configured");return{createTask:a(async o=>{if(!e)throw Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},"createTask"),getTask:a(async o=>{let s=await n.getTask(o,r);if(!s)throw new mi(Qi.InvalidParams,"Failed to retrieve task: Task not found");return s},"getTask"),storeTaskResult:a(async(o,s,c)=>{await n.storeTaskResult(o,s,c,r);let l=await n.getTask(o,r);if(l){let u=Mkt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Foe(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new mi(Qi.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Foe(l.status))throw new mi(Qi.InvalidParams,`Cannot update task "${o}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,c,r);let u=await n.getTask(o,r);if(u){let d=Mkt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Foe(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a($io,"Vj");a(mcl,"Bj");gcl=_qr(Voo(),1),Acl=_qr(VWc(),1);a(ycl,"ps");JQr=class{static{a(this,"qz")}constructor(e){this._ajv=e??ycl()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}},ZQr=class{static{a(this,"Vz")}constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],s=Array.isArray(o.content)?o.content:[o.content],c=s.some(f=>f.type==="tool_result"),l=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=l?Array.isArray(l.content)?l.content:[l.content]:[],d=u.some(f=>f.type==="tool_use");if(c){if(s.some(f=>f.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!d)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(d){let f=new Set(u.filter(m=>m.type==="tool_use").map(m=>m.id)),h=new Set(s.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(f.size!==h.size||![...f].every(m=>h.has(m)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},iGr,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),o=e.mode??"form";switch(o){case"url":{if(!n?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let s=o==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},Fkt,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};a(_cl,"tP");a(Ecl,"aP");XQr=class extends KQr{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Lkt.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)this._oninitialize(n)),this.setNotificationHandler(Wdo,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Xdo,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=Lkt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new ZQr(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=mcl(this._capabilities,e)}setRequestHandler(e,r){let n=PUe(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(wB(n)){let s=n;o=s._zod?.def?.value??s.value}else{let s=n;o=s._def?.value??s.value}if(typeof o!="string")throw Error("Schema method literal must be a string");if(o==="tools/call"){let s=a(async(c,l)=>{let u=$6e(Okt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new mi(Qi.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=$6e(MPt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new mi(Qi.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=$6e(nGr,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new mi(Qi.InvalidParams,`Invalid tools/call result: ${m}`)}return h.data},"G");return super.setRequestHandler(e,s)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){Ecl(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&_cl(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Kol.includes(r)?r:Qdo,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},qHr)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(d=>d.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],u=l.some(d=>d.type==="tool_use");if(s){if(o.some(d=>d.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!u)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(l.filter(h=>h.type==="tool_use").map(h=>h.id)),f=new Set(o.filter(h=>h.type==="tool_result").map(h=>h.toolUseId));if(d.size!==f.size||![...d].every(h=>f.has(h)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},efo,r):this.request({method:"sampling/createMessage",params:e},iGr,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let n=e;return this.request({method:"elicitation/create",params:n},Fkt,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:n},Fkt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new mi(Qi.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof mi?s:new mi(Qi.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},tfo,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}},cfo=Symbol.for("mcp.completable");a(Vio,"zz");a(vcl,"$E");(function(t){t.Completable="McpCompletable"})(Wio||(Wio={}));Ccl=/^[A-Za-z0-9._-]{1,128}$/;a(bcl,"is");a(Scl,"ns");a(zio,"Nz");eqr=class{static{a(this,"wz")}constructor(e){this._mcpServer=e}registerToolTask(e,r,n){let o={taskSupport:"required",...r.execution};if(o.taskSupport==="forbidden")throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,o,r._meta,n)}},tqr=class{static{a(this,"Dz")}constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new XQr(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new eqr(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(zW(WQr)),this.server.assertCanSetRequestHandler(zW(Okt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(WQr,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let n={name:e,title:r.title,description:r.description,inputSchema:(()=>{let o=R6e(r.inputSchema);return o?jio(o,{strictUnions:!0,pipeStrategy:"input"}):Tcl})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=R6e(r.outputSchema);o&&(n.outputSchema=jio(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Okt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new mi(Qi.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new mi(Qi.InvalidParams,`Tool ${e.params.name} disabled`);let o=!!e.params.task,s=n.execution?.taskSupport,c="createTask"in n.handler;if((s==="required"||s==="optional")&&!c)throw new mi(Qi.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new mi(Qi.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(s==="optional"&&!o&&c)return await this.handleAutomaticTaskPolling(n,e,r);let l=await this.validateToolInput(n,e.params.arguments,e.params.name),u=await this.executeToolHandler(n,l,r);return o||await this.validateToolOutput(n,u,e.params.name),u}catch(n){if(n instanceof mi&&n.code===Qi.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,n){if(!e.inputSchema)return;let o=R6e(e.inputSchema)??e.inputSchema,s=await H7r(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=G7r(c);throw new mi(Qi.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${l}`)}return s.data}async validateToolOutput(e,r,n){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new mi(Qi.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=R6e(e.outputSchema),s=await H7r(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=G7r(c);throw new mi(Qi.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${l}`)}}async executeToolHandler(e,r,n){let o=e.handler;if("createTask"in o){if(!n.taskStore)throw Error("No task store provided.");let s={...n,taskStore:n.taskStore};return e.inputSchema?await Promise.resolve(o.createTask(r,s)):await Promise.resolve(o.createTask(s))}return e.inputSchema?await Promise.resolve(o(r,n)):await Promise.resolve(o(n))}async handleAutomaticTaskPolling(e,r,n){if(!n.taskStore)throw Error("No task store provided for task-capable tool.");let o=await this.validateToolInput(e,r.params.arguments,r.params.name),s=e.handler,c={...n,taskStore:n.taskStore},l=o?await Promise.resolve(s.createTask(o,c)):await Promise.resolve(s.createTask(c)),u=l.task.taskId,d=l.task,f=d.pollInterval??5e3;for(;d.status!=="completed"&&d.status!=="failed"&&d.status!=="cancelled";){await new Promise(m=>setTimeout(m,f));let h=await n.taskStore.getTask(u);if(!h)throw new mi(Qi.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(zW(zQr)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(zQr,async e=>{switch(e.params.ref.type){case"ref/prompt":return bal(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Sal(e),this.handleResourceCompletion(e,e.params.ref);default:throw new mi(Qi.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new mi(Qi.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new mi(Qi.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return k6e;let o=PUe(n.argsSchema)?.[e.params.argument.name];if(!Vio(o))return k6e;let s=vcl(o);if(!s)return k6e;let c=await s(e.params.argument.value,e.params.context);return Kio(c)}async handleResourceCompletion(e,r){let n=Object.values(this._registeredResourceTemplates).find(c=>c.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return k6e;throw new mi(Qi.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return k6e;let s=await o(e.params.argument.value,e.params.context);return Kio(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(zW(jQr)),this.server.assertCanSetRequestHandler(zW(HQr)),this.server.assertCanSetRequestHandler(zW(GQr)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(jQr,async(e,r)=>{let n=Object.entries(this._registeredResources).filter(([s,c])=>c.enabled).map(([s,c])=>({uri:s,name:c.name,...c.metadata})),o=[];for(let s of Object.values(this._registeredResourceTemplates)){if(!s.resourceTemplate.listCallback)continue;let c=await s.resourceTemplate.listCallback(r);for(let l of c.resources)o.push({...s.metadata,...l})}return{resources:[...n,...o]}}),this.server.setRequestHandler(HQr,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(GQr,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new mi(Qi.InvalidParams,`Resource ${n} disabled`);return o.readCallback(n,r)}for(let s of Object.values(this._registeredResourceTemplates)){let c=s.resourceTemplate.uriTemplate.match(n.toString());if(c)return s.readCallback(n,c,r)}throw new mi(Qi.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(zW($Qr)),this.server.assertCanSetRequestHandler(zW(VQr)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler($Qr,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?Icl(r.argsSchema):void 0}))})),this.server.setRequestHandler(VQr,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new mi(Qi.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new mi(Qi.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=R6e(n.argsSchema),s=await H7r(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=G7r(u);throw new mi(Qi.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${d}`)}let c=s.data,l=n.callback;return await Promise.resolve(l(c,r))}else{let o=n.callback;return await Promise.resolve(o(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...n){let o;typeof n[0]=="object"&&(o=n.shift());let s=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw Error(`Resource ${r} is already registered`);let c=this._createRegisteredResource(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let c=this._createRegisteredResourceTemplate(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}}registerResource(e,r,n,o){if(typeof r=="string"){if(this._registeredResources[r])throw Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}_createRegisteredResource(e,r,n,o,s){let c={name:e,title:r,metadata:o,readCallback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({uri:null}),"remove"),update:a(l=>{typeof l.uri<"u"&&l.uri!==n&&(delete this._registeredResources[n],l.uri&&(this._registeredResources[l.uri]=c)),typeof l.name<"u"&&(c.name=l.name),typeof l.title<"u"&&(c.title=l.title),typeof l.metadata<"u"&&(c.metadata=l.metadata),typeof l.callback<"u"&&(c.readCallback=l.callback),typeof l.enabled<"u"&&(c.enabled=l.enabled),this.sendResourceListChanged()},"update")};return this._registeredResources[n]=c,c}_createRegisteredResourceTemplate(e,r,n,o,s){let c={resourceTemplate:n,title:r,metadata:o,readCallback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({name:null}),"remove"),update:a(u=>{typeof u.name<"u"&&u.name!==e&&(delete this._registeredResourceTemplates[e],u.name&&(this._registeredResourceTemplates[u.name]=c)),typeof u.title<"u"&&(c.title=u.title),typeof u.template<"u"&&(c.resourceTemplate=u.template),typeof u.metadata<"u"&&(c.metadata=u.metadata),typeof u.callback<"u"&&(c.readCallback=u.callback),typeof u.enabled<"u"&&(c.enabled=u.enabled),this.sendResourceListChanged()},"update")};this._registeredResourceTemplates[e]=c;let l=n.uriTemplate.variableNames;return Array.isArray(l)&&l.some(u=>!!n.completeCallback(u))&&this.setCompletionRequestHandler(),c}_createRegisteredPrompt(e,r,n,o,s){let c={title:r,description:n,argsSchema:o===void 0?void 0:MCe(o),callback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({name:null}),"remove"),update:a(l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredPrompts[e],l.name&&(this._registeredPrompts[l.name]=c)),typeof l.title<"u"&&(c.title=l.title),typeof l.description<"u"&&(c.description=l.description),typeof l.argsSchema<"u"&&(c.argsSchema=MCe(l.argsSchema)),typeof l.callback<"u"&&(c.callback=l.callback),typeof l.enabled<"u"&&(c.enabled=l.enabled),this.sendPromptListChanged()},"update")};return this._registeredPrompts[e]=c,o&&Object.values(o).some(l=>{let u=l instanceof zk?l._def?.innerType:l;return Vio(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){zio(e);let f={title:r,description:n,inputSchema:Yio(o),outputSchema:Yio(s),annotations:c,execution:l,_meta:u,handler:d,enabled:!0,disable:a(()=>f.update({enabled:!1}),"disable"),enable:a(()=>f.update({enabled:!0}),"enable"),remove:a(()=>f.update({name:null}),"remove"),update:a(h=>{typeof h.name<"u"&&h.name!==e&&(typeof h.name=="string"&&zio(h.name),delete this._registeredTools[e],h.name&&(this._registeredTools[h.name]=f)),typeof h.title<"u"&&(f.title=h.title),typeof h.description<"u"&&(f.description=h.description),typeof h.paramsSchema<"u"&&(f.inputSchema=MCe(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=MCe(h.outputSchema)),typeof h.callback<"u"&&(f.handler=h.callback),typeof h.annotations<"u"&&(f.annotations=h.annotations),typeof h._meta<"u"&&(f._meta=h._meta),typeof h.enabled<"u"&&(f.enabled=h.enabled),this.sendToolListChanged()},"update")};return this._registeredTools[e]=f,this.setToolRequestHandlers(),this.sendToolListChanged(),f}tool(e,...r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let n,o,s,c;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let u=r[0];if(rqr(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!rqr(r[0])&&(c=r.shift());else if(typeof u=="object"&&u!==null){if(Object.values(u).some(d=>typeof d=="object"&&d!==null))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);c=r.shift()}}let l=r[0];return this._createRegisteredTool(e,void 0,n,o,s,c,{taskSupport:"forbidden"},void 0,l)}registerTool(e,r,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:o,description:s,inputSchema:c,outputSchema:l,annotations:u,_meta:d}=r;return this._createRegisteredTool(e,o,s,c,l,u,{taskSupport:"forbidden"},d,n)}prompt(e,...r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let o;r.length>1&&(o=r.shift());let s=r[0],c=this._createRegisteredPrompt(e,void 0,n,o,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}registerPrompt(e,r,n){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:o,description:s,argsSchema:c}=r,l=this._createRegisteredPrompt(e,o,s,c,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),l}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},Tcl={type:"object",properties:{}};a(lfo,"XE");a(ufo,"YE");a(rqr,"Oz");a(Yio,"QE");a(Icl,"os");a(zW,"l1");a(Kio,"JE");k6e={completion:{values:[],hasMore:!1}};a(xcl,"ts");a(wcl,"as");a(Rcl,"ss");a(Dr,"b");Jio=15e3,kcl=Dr(()=>G.object({session_id:G.string(),ws_url:G.string(),work_dir:G.string().optional(),session_key:G.string().optional()})),Gk=class extends Error{static{a(this,"F4")}code;constructor(e,r){super(e),this.name="DirectConnectError",this.code=r}},nqr=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new hkt;readyPromise;readyResolve;readyReject;abortHandler;partialChunks=[];telemetryEmitted=!1;constructor(e){this.options=e,this.abortController=e.abortController??new AbortController,this.readyPromise=new Promise((r,n)=>{this.readyResolve=r,this.readyReject=n}),this.readyPromise.catch(()=>{}),this.initialize()}get ready(){return this.readyPromise}getSessionId(){return this.sessionId}getWorkDir(){return this.workDir}async initialize(){if(this.abortController.signal.aborted){this.failInit(new e1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new e1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await Dcl(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=bUe(s);if(!(c instanceof e1)){let l=c instanceof Gk&&c.code?c.code:"session_create_failed";this.emitTelemetry("bad",l)}this.failInit(c);return}if(this.closed){this.options.deleteSessionOnClose&&this.sessionId&&Zio(this.options.serverUrl,this.sessionId,this.options.authToken);return}let r={};this.options.authToken&&(r.authorization=`Bearer ${this.options.authToken}`);let n=new WebSocket(e,{headers:r});this.ws=n;let o=setTimeout((s,c)=>{if(!s.readyState){c.close();let l=new Gk(`WebSocket connection timeout after ${Jio}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},Jio,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,jk(`[DirectConnectTransport] Connected to ${this.options.serverUrl}, session=${this.sessionId}`),this.readyResolve?.(),this.emitTelemetry("ok")}),n.addEventListener("message",s=>{let c=typeof s.data=="string"?s.data:"";if(c.indexOf(` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);n.cycles==="ref"&&c(f);continue}if(h.count>1&&n.reused==="ref"){c(f);continue}}let l=a((f,h)=>{let m=this.seen.get(f),g=m.def??m.schema,A={...g};if(m.ref===null)return;let y=m.ref;if(m.ref=null,y){l(y,h);let _=this.seen.get(y).schema;_.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(_)):(Object.assign(g,_),Object.assign(g,A))}m.isParent||this.override({zodSchema:f,jsonSchema:g,path:m.path??[]})},"G");for(let f of[...this.seen.entries()].reverse())l(f[0],{target:this.target});let u={};this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),Object.assign(u,o.def);let d=n.external?.defs??{};for(let f of this.seen.entries()){let h=f[1];h.def&&h.defId&&(d[h.defId]=h.def)}!n.external&&Object.keys(d).length>0&&(this.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{return JSON.parse(JSON.stringify(u))}catch{throw Error("Error converting schema to JSON.")}}};a(nHr,"e8");a(Jg,"t$");Qil={},qil=pt("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");So.init(t,e),t.def=e,t.parse=(r,n)=>Tkt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>_Pt(t,r,n),t.parseAsync=async(r,n)=>Ikt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>EPt(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>bM(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),jil=pt("ZodMiniObject",(t,e)=>{Ajr.init(t,e),qil.init(t,e),Xs.defineLazy(t,"shape",()=>e.shape)});a(Uio,"tq");a(wB,"a6");a(MCe,"S0");a($6e,"S1");a(G7r,"I3");a(PUe,"v1");a(R6e,"$9");a($7r,"R3");a(Hil,"_M");a(Gil,"kM");a(zuo,"P3");G={};RB(G,{xid:a(()=>iol,"xid"),void:a(()=>Tol,"void"),uuidv7:a(()=>Jil,"uuidv7"),uuidv6:a(()=>Kil,"uuidv6"),uuidv4:a(()=>Yil,"uuidv4"),uuid:a(()=>zil,"uuid"),url:a(()=>Zil,"url"),uppercase:a(()=>Wjr,"uppercase"),unknown:a(()=>Af,"unknown"),union:a(()=>Au,"union"),undefined:a(()=>bol,"undefined"),ulid:a(()=>nol,"ulid"),uint64:a(()=>vol,"uint64"),uint32:a(()=>yol,"uint32"),tuple:a(()=>Rol,"tuple"),trim:a(()=>Xjr,"trim"),treeifyError:a(()=>rco,"treeifyError"),transform:a(()=>MHr,"transform"),toUpperCase:a(()=>tHr,"toUpperCase"),toLowerCase:a(()=>eHr,"toLowerCase"),toJSONSchema:a(()=>nHr,"toJSONSchema"),templateLiteral:a(()=>Fol,"templateLiteral"),symbol:a(()=>Col,"symbol"),superRefine:a(()=>Udo,"superRefine"),success:a(()=>Lol,"success"),stringbool:a(()=>qol,"stringbool"),stringFormat:a(()=>hol,"stringFormat"),string:a(()=>xt,"string"),strictObject:a(()=>wol,"strictObject"),startsWith:a(()=>Yjr,"startsWith"),size:a(()=>Gjr,"size"),setErrorMap:a(()=>Gol,"setErrorMap"),set:a(()=>Dol,"set"),safeParseAsync:a(()=>ndo,"safeParseAsync"),safeParse:a(()=>rdo,"safeParse"),registry:a(()=>Cjr,"registry"),regexes:a(()=>cjr,"regexes"),regex:a(()=>$jr,"regex"),refine:a(()=>Fdo,"refine"),record:a(()=>gu,"record"),readonly:a(()=>Pdo,"readonly"),property:a(()=>Quo,"property"),promise:a(()=>Uol,"promise"),prettifyError:a(()=>ico,"prettifyError"),preprocess:a(()=>FHr,"preprocess"),prefault:a(()=>Sdo,"prefault"),positive:a(()=>Luo,"positive"),pipe:a(()=>Mkt,"pipe"),partialRecord:a(()=>kol,"partialRecord"),parseAsync:a(()=>tdo,"parseAsync"),parse:a(()=>edo,"parse"),overwrite:a(()=>ose,"overwrite"),optional:a(()=>Ld,"optional"),object:a(()=>In,"object"),number:a(()=>Gc,"number"),nullish:a(()=>Ool,"nullish"),nullable:a(()=>Nkt,"nullable"),null:a(()=>wHr,"null"),normalize:a(()=>Zjr,"normalize"),nonpositive:a(()=>Fuo,"nonpositive"),nonoptional:a(()=>Tdo,"nonoptional"),nonnegative:a(()=>Uuo,"nonnegative"),never:a(()=>RPt,"never"),negative:a(()=>Buo,"negative"),nativeEnum:a(()=>Nol,"nativeEnum"),nanoid:a(()=>eol,"nanoid"),nan:a(()=>Bol,"nan"),multipleOf:a(()=>gUe,"multipleOf"),minSize:a(()=>AUe,"minSize"),minLength:a(()=>abe,"minLength"),mime:a(()=>Jjr,"mime"),maxSize:a(()=>CPt,"maxSize"),maxLength:a(()=>bPt,"maxLength"),map:a(()=>Pol,"map"),lte:a(()=>gM,"lte"),lt:a(()=>Xoe,"lt"),lowercase:a(()=>Vjr,"lowercase"),looseObject:a(()=>gC,"looseObject"),locales:a(()=>vjr,"locales"),literal:a(()=>ni,"literal"),length:a(()=>SPt,"length"),lazy:a(()=>Mdo,"lazy"),ksuid:a(()=>ool,"ksuid"),keyof:a(()=>xol,"keyof"),jwt:a(()=>pol,"jwt"),json:a(()=>jol,"json"),iso:a(()=>iHr,"iso"),ipv6:a(()=>aol,"ipv6"),ipv4:a(()=>sol,"ipv4"),intersection:a(()=>PPt,"intersection"),int64:a(()=>Eol,"int64"),int32:a(()=>Aol,"int32"),int:a(()=>jQr,"int"),instanceof:a(()=>Qol,"instanceof"),includes:a(()=>zjr,"includes"),guid:a(()=>Wil,"guid"),gte:a(()=>rx,"gte"),gt:a(()=>ese,"gt"),globalRegistry:a(()=>P9,"globalRegistry"),getErrorMap:a(()=>$ol,"getErrorMap"),function:a(()=>Wuo,"function"),formatError:a(()=>njr,"formatError"),float64:a(()=>gol,"float64"),float32:a(()=>mol,"float32"),flattenError:a(()=>rjr,"flattenError"),file:a(()=>Mol,"file"),enum:a(()=>i1,"enum"),endsWith:a(()=>Kjr,"endsWith"),emoji:a(()=>Xil,"emoji"),email:a(()=>Vil,"email"),e164:a(()=>fol,"e164"),discriminatedUnion:a(()=>PHr,"discriminatedUnion"),date:a(()=>Iol,"date"),custom:a(()=>Bdo,"custom"),cuid2:a(()=>rol,"cuid2"),cuid:a(()=>tol,"cuid"),core:a(()=>Gao,"core"),config:a(()=>_C,"config"),coerce:a(()=>Qdo,"coerce"),clone:a(()=>bM,"clone"),cidrv6:a(()=>lol,"cidrv6"),cidrv4:a(()=>col,"cidrv4"),check:a(()=>Ldo,"check"),catch:a(()=>wdo,"catch"),boolean:a(()=>Zg,"boolean"),bigint:a(()=>_ol,"bigint"),base64url:a(()=>dol,"base64url"),base64:a(()=>uol,"base64"),array:a(()=>ka,"array"),any:a(()=>Sol,"any"),_default:a(()=>Cdo,"_default"),_ZodString:a(()=>lHr,"_ZodString"),ZodXID:a(()=>AHr,"ZodXID"),ZodVoid:a(()=>ddo,"ZodVoid"),ZodUnknown:a(()=>ldo,"ZodUnknown"),ZodUnion:a(()=>kHr,"ZodUnion"),ZodUndefined:a(()=>sdo,"ZodUndefined"),ZodUUID:a(()=>D9,"ZodUUID"),ZodURL:a(()=>dHr,"ZodURL"),ZodULID:a(()=>gHr,"ZodULID"),ZodType:a(()=>Qs,"ZodType"),ZodTuple:a(()=>mdo,"ZodTuple"),ZodTransform:a(()=>NHr,"ZodTransform"),ZodTemplateLiteral:a(()=>Ddo,"ZodTemplateLiteral"),ZodSymbol:a(()=>odo,"ZodSymbol"),ZodSuccess:a(()=>Ido,"ZodSuccess"),ZodStringFormat:a(()=>Fd,"ZodStringFormat"),ZodString:a(()=>TPt,"ZodString"),ZodSet:a(()=>Ado,"ZodSet"),ZodRecord:a(()=>DHr,"ZodRecord"),ZodRealError:a(()=>DUe,"ZodRealError"),ZodReadonly:a(()=>kdo,"ZodReadonly"),ZodPromise:a(()=>Odo,"ZodPromise"),ZodPrefault:a(()=>bdo,"ZodPrefault"),ZodPipe:a(()=>BHr,"ZodPipe"),ZodOptional:a(()=>OHr,"ZodOptional"),ZodObject:a(()=>kPt,"ZodObject"),ZodNumberFormat:a(()=>Ebe,"ZodNumberFormat"),ZodNumber:a(()=>IPt,"ZodNumber"),ZodNullable:a(()=>Edo,"ZodNullable"),ZodNull:a(()=>ado,"ZodNull"),ZodNonOptional:a(()=>LHr,"ZodNonOptional"),ZodNever:a(()=>udo,"ZodNever"),ZodNanoID:a(()=>pHr,"ZodNanoID"),ZodNaN:a(()=>Rdo,"ZodNaN"),ZodMap:a(()=>gdo,"ZodMap"),ZodLiteral:a(()=>ydo,"ZodLiteral"),ZodLazy:a(()=>Ndo,"ZodLazy"),ZodKSUID:a(()=>yHr,"ZodKSUID"),ZodJWT:a(()=>IHr,"ZodJWT"),ZodIssueCode:a(()=>Hol,"ZodIssueCode"),ZodIntersection:a(()=>hdo,"ZodIntersection"),ZodISOTime:a(()=>aHr,"ZodISOTime"),ZodISODuration:a(()=>cHr,"ZodISODuration"),ZodISODateTime:a(()=>oHr,"ZodISODateTime"),ZodISODate:a(()=>sHr,"ZodISODate"),ZodIPv6:a(()=>EHr,"ZodIPv6"),ZodIPv4:a(()=>_Hr,"ZodIPv4"),ZodGUID:a(()=>Dkt,"ZodGUID"),ZodFile:a(()=>_do,"ZodFile"),ZodError:a(()=>$il,"ZodError"),ZodEnum:a(()=>_Ue,"ZodEnum"),ZodEmoji:a(()=>fHr,"ZodEmoji"),ZodEmail:a(()=>uHr,"ZodEmail"),ZodE164:a(()=>THr,"ZodE164"),ZodDiscriminatedUnion:a(()=>pdo,"ZodDiscriminatedUnion"),ZodDefault:a(()=>vdo,"ZodDefault"),ZodDate:a(()=>RHr,"ZodDate"),ZodCustomStringFormat:a(()=>ido,"ZodCustomStringFormat"),ZodCustom:a(()=>DPt,"ZodCustom"),ZodCatch:a(()=>xdo,"ZodCatch"),ZodCUID2:a(()=>mHr,"ZodCUID2"),ZodCUID:a(()=>hHr,"ZodCUID"),ZodCIDRv6:a(()=>CHr,"ZodCIDRv6"),ZodCIDRv4:a(()=>vHr,"ZodCIDRv4"),ZodBoolean:a(()=>xPt,"ZodBoolean"),ZodBigIntFormat:a(()=>xHr,"ZodBigIntFormat"),ZodBigInt:a(()=>wPt,"ZodBigInt"),ZodBase64URL:a(()=>SHr,"ZodBase64URL"),ZodBase64:a(()=>bHr,"ZodBase64"),ZodArray:a(()=>fdo,"ZodArray"),ZodAny:a(()=>cdo,"ZodAny"),TimePrecision:a(()=>luo,"TimePrecision"),NEVER:a(()=>$ao,"NEVER"),$output:a(()=>ouo,"$output"),$input:a(()=>suo,"$input"),$brand:a(()=>Vao,"$brand")});iHr={};RB(iHr,{time:a(()=>Juo,"time"),duration:a(()=>Zuo,"duration"),datetime:a(()=>Yuo,"datetime"),date:a(()=>Kuo,"date"),ZodISOTime:a(()=>aHr,"ZodISOTime"),ZodISODuration:a(()=>cHr,"ZodISODuration"),ZodISODateTime:a(()=>oHr,"ZodISODateTime"),ZodISODate:a(()=>sHr,"ZodISODate")});oHr=pt("ZodISODateTime",(t,e)=>{plo.init(t,e),Fd.init(t,e)});a(Yuo,"aq");sHr=pt("ZodISODate",(t,e)=>{hlo.init(t,e),Fd.init(t,e)});a(Kuo,"sq");aHr=pt("ZodISOTime",(t,e)=>{mlo.init(t,e),Fd.init(t,e)});a(Juo,"eq");cHr=pt("ZodISODuration",(t,e)=>{glo.init(t,e),Fd.init(t,e)});a(Zuo,"$V");Xuo=a((t,e)=>{tjr.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>njr(t,r),"value")},flatten:{value:a(r=>rjr(t,r),"value")},addIssue:{value:a(r=>t.issues.push(r),"value")},addIssues:{value:a(r=>t.issues.push(...r),"value")},isEmpty:{get(){return t.issues.length===0}}})},"vM"),$il=pt("ZodError",Xuo),DUe=pt("ZodError",Xuo,{Parent:Error}),edo=ijr(DUe),tdo=ojr(DUe),rdo=sjr(DUe),ndo=ajr(DUe),Qs=pt("ZodType",(t,e)=>(So.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>bM(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>edo(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>rdo(t,r,n),t.parseAsync=async(r,n)=>tdo(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>ndo(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Fdo(r,n)),t.superRefine=r=>t.check(Udo(r)),t.overwrite=r=>t.check(ose(r)),t.optional=()=>Ld(t),t.nullable=()=>Nkt(t),t.nullish=()=>Ld(Nkt(t)),t.nonoptional=r=>Tdo(t,r),t.array=()=>ka(t),t.or=r=>Au([t,r]),t.and=r=>PPt(t,r),t.transform=r=>Mkt(t,MHr(r)),t.default=r=>Cdo(t,r),t.prefault=r=>Sdo(t,r),t.catch=r=>wdo(t,r),t.pipe=r=>Mkt(t,r),t.readonly=()=>Pdo(t),t.describe=r=>{let n=t.clone();return P9.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return P9.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return P9.get(t);let n=t.clone();return P9.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),lHr=pt("_ZodString",(t,e)=>{kUe.init(t,e),Qs.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check($jr(...n)),t.includes=(...n)=>t.check(zjr(...n)),t.startsWith=(...n)=>t.check(Yjr(...n)),t.endsWith=(...n)=>t.check(Kjr(...n)),t.min=(...n)=>t.check(abe(...n)),t.max=(...n)=>t.check(bPt(...n)),t.length=(...n)=>t.check(SPt(...n)),t.nonempty=(...n)=>t.check(abe(1,...n)),t.lowercase=n=>t.check(Vjr(n)),t.uppercase=n=>t.check(Wjr(n)),t.trim=()=>t.check(Xjr()),t.normalize=(...n)=>t.check(Zjr(...n)),t.toLowerCase=()=>t.check(eHr()),t.toUpperCase=()=>t.check(tHr())}),TPt=pt("ZodString",(t,e)=>{kUe.init(t,e),lHr.init(t,e),t.email=r=>t.check(bjr(uHr,r)),t.url=r=>t.check(wjr(dHr,r)),t.jwt=r=>t.check(Hjr(IHr,r)),t.emoji=r=>t.check(Rjr(fHr,r)),t.guid=r=>t.check(Rkt(Dkt,r)),t.uuid=r=>t.check(Sjr(D9,r)),t.uuidv4=r=>t.check(Tjr(D9,r)),t.uuidv6=r=>t.check(Ijr(D9,r)),t.uuidv7=r=>t.check(xjr(D9,r)),t.nanoid=r=>t.check(kjr(pHr,r)),t.guid=r=>t.check(Rkt(Dkt,r)),t.cuid=r=>t.check(Pjr(hHr,r)),t.cuid2=r=>t.check(Djr(mHr,r)),t.ulid=r=>t.check(Njr(gHr,r)),t.base64=r=>t.check(Qjr(bHr,r)),t.base64url=r=>t.check(qjr(SHr,r)),t.xid=r=>t.check(Mjr(AHr,r)),t.ksuid=r=>t.check(Ojr(yHr,r)),t.ipv4=r=>t.check(Ljr(_Hr,r)),t.ipv6=r=>t.check(Bjr(EHr,r)),t.cidrv4=r=>t.check(Fjr(vHr,r)),t.cidrv6=r=>t.check(Ujr(CHr,r)),t.e164=r=>t.check(jjr(THr,r)),t.datetime=r=>t.check(Yuo(r)),t.date=r=>t.check(Kuo(r)),t.time=r=>t.check(Juo(r)),t.duration=r=>t.check(Zuo(r))});a(xt,"L");Fd=pt("ZodStringFormat",(t,e)=>{Wu.init(t,e),lHr.init(t,e)}),uHr=pt("ZodEmail",(t,e)=>{ilo.init(t,e),Fd.init(t,e)});a(Vil,"Cm");Dkt=pt("ZodGUID",(t,e)=>{rlo.init(t,e),Fd.init(t,e)});a(Wil,"Tm");D9=pt("ZodUUID",(t,e)=>{nlo.init(t,e),Fd.init(t,e)});a(zil,"xm");a(Yil,"ym");a(Kil,"fm");a(Jil,"gm");dHr=pt("ZodURL",(t,e)=>{olo.init(t,e),Fd.init(t,e)});a(Zil,"hm");fHr=pt("ZodEmoji",(t,e)=>{slo.init(t,e),Fd.init(t,e)});a(Xil,"um");pHr=pt("ZodNanoID",(t,e)=>{alo.init(t,e),Fd.init(t,e)});a(eol,"mm");hHr=pt("ZodCUID",(t,e)=>{clo.init(t,e),Fd.init(t,e)});a(tol,"lm");mHr=pt("ZodCUID2",(t,e)=>{llo.init(t,e),Fd.init(t,e)});a(rol,"cm");gHr=pt("ZodULID",(t,e)=>{ulo.init(t,e),Fd.init(t,e)});a(nol,"pm");AHr=pt("ZodXID",(t,e)=>{dlo.init(t,e),Fd.init(t,e)});a(iol,"dm");yHr=pt("ZodKSUID",(t,e)=>{flo.init(t,e),Fd.init(t,e)});a(ool,"im");_Hr=pt("ZodIPv4",(t,e)=>{Alo.init(t,e),Fd.init(t,e)});a(sol,"nm");EHr=pt("ZodIPv6",(t,e)=>{ylo.init(t,e),Fd.init(t,e)});a(aol,"rm");vHr=pt("ZodCIDRv4",(t,e)=>{_lo.init(t,e),Fd.init(t,e)});a(col,"om");CHr=pt("ZodCIDRv6",(t,e)=>{Elo.init(t,e),Fd.init(t,e)});a(lol,"tm");bHr=pt("ZodBase64",(t,e)=>{vlo.init(t,e),Fd.init(t,e)});a(uol,"am");SHr=pt("ZodBase64URL",(t,e)=>{blo.init(t,e),Fd.init(t,e)});a(dol,"sm");THr=pt("ZodE164",(t,e)=>{Slo.init(t,e),Fd.init(t,e)});a(fol,"em");IHr=pt("ZodJWT",(t,e)=>{Ilo.init(t,e),Fd.init(t,e)});a(pol,"$l");ido=pt("ZodCustomStringFormat",(t,e)=>{xlo.init(t,e),Fd.init(t,e)});a(hol,"Ql");IPt=pt("ZodNumber",(t,e)=>{pjr.init(t,e),Qs.init(t,e),t.gt=(n,o)=>t.check(ese(n,o)),t.gte=(n,o)=>t.check(rx(n,o)),t.min=(n,o)=>t.check(rx(n,o)),t.lt=(n,o)=>t.check(Xoe(n,o)),t.lte=(n,o)=>t.check(gM(n,o)),t.max=(n,o)=>t.check(gM(n,o)),t.int=n=>t.check(jQr(n)),t.safe=n=>t.check(jQr(n)),t.positive=n=>t.check(ese(0,n)),t.nonnegative=n=>t.check(rx(0,n)),t.negative=n=>t.check(Xoe(0,n)),t.nonpositive=n=>t.check(gM(0,n)),t.multipleOf=(n,o)=>t.check(gUe(n,o)),t.step=(n,o)=>t.check(gUe(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});a(Gc,"z$");Ebe=pt("ZodNumberFormat",(t,e)=>{wlo.init(t,e),IPt.init(t,e)});a(jQr,"WV");a(mol,"Jl");a(gol,"Xl");a(Aol,"Yl");a(yol,"Wl");xPt=pt("ZodBoolean",(t,e)=>{hjr.init(t,e),Qs.init(t,e)});a(Zg,"i$");wPt=pt("ZodBigInt",(t,e)=>{mjr.init(t,e),Qs.init(t,e),t.gte=(n,o)=>t.check(rx(n,o)),t.min=(n,o)=>t.check(rx(n,o)),t.gt=(n,o)=>t.check(ese(n,o)),t.gte=(n,o)=>t.check(rx(n,o)),t.min=(n,o)=>t.check(rx(n,o)),t.lt=(n,o)=>t.check(Xoe(n,o)),t.lte=(n,o)=>t.check(gM(n,o)),t.max=(n,o)=>t.check(gM(n,o)),t.positive=n=>t.check(ese(BigInt(0),n)),t.negative=n=>t.check(Xoe(BigInt(0),n)),t.nonpositive=n=>t.check(gM(BigInt(0),n)),t.nonnegative=n=>t.check(rx(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(gUe(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(_ol,"Gl");xHr=pt("ZodBigIntFormat",(t,e)=>{Rlo.init(t,e),wPt.init(t,e)});a(Eol,"Ul");a(vol,"Hl");odo=pt("ZodSymbol",(t,e)=>{klo.init(t,e),Qs.init(t,e)});a(Col,"Kl");sdo=pt("ZodUndefined",(t,e)=>{Plo.init(t,e),Qs.init(t,e)});a(bol,"ql");ado=pt("ZodNull",(t,e)=>{Dlo.init(t,e),Qs.init(t,e)});a(wHr,"T3");cdo=pt("ZodAny",(t,e)=>{Nlo.init(t,e),Qs.init(t,e)});a(Sol,"Vl");ldo=pt("ZodUnknown",(t,e)=>{wkt.init(t,e),Qs.init(t,e)});a(Af,"S$");udo=pt("ZodNever",(t,e)=>{Mlo.init(t,e),Qs.init(t,e)});a(RPt,"x3");ddo=pt("ZodVoid",(t,e)=>{Olo.init(t,e),Qs.init(t,e)});a(Tol,"Bl");RHr=pt("ZodDate",(t,e)=>{Llo.init(t,e),Qs.init(t,e),t.min=(n,o)=>t.check(rx(n,o)),t.max=(n,o)=>t.check(gM(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});a(Iol,"zl");fdo=pt("ZodArray",(t,e)=>{gjr.init(t,e),Qs.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(abe(r,n)),t.nonempty=r=>t.check(abe(1,r)),t.max=(r,n)=>t.check(bPt(r,n)),t.length=(r,n)=>t.check(SPt(r,n)),t.unwrap=()=>t.element});a(ka,"W$");a(xol,"Nl");kPt=pt("ZodObject",(t,e)=>{Ajr.init(t,e),Qs.init(t,e),Xs.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>i1(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Af()}),t.loose=()=>t.clone({...t._zod.def,catchall:Af()}),t.strict=()=>t.clone({...t._zod.def,catchall:RPt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Xs.extend(t,r),t.merge=r=>Xs.merge(t,r),t.pick=r=>Xs.pick(t,r),t.omit=r=>Xs.omit(t,r),t.partial=(...r)=>Xs.partial(OHr,t,r[0]),t.required=(...r)=>Xs.required(LHr,t,r[0])});a(In,"h");a(wol,"wl");a(gC,"K6");kHr=pt("ZodUnion",(t,e)=>{yjr.init(t,e),Qs.init(t,e),t.options=e.options});a(Au,"A$");pdo=pt("ZodDiscriminatedUnion",(t,e)=>{kHr.init(t,e),Blo.init(t,e)});a(PHr,"g3");hdo=pt("ZodIntersection",(t,e)=>{Flo.init(t,e),Qs.init(t,e)});a(PPt,"VJ");mdo=pt("ZodTuple",(t,e)=>{vPt.init(t,e),Qs.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a(Rol,"Ol");DHr=pt("ZodRecord",(t,e)=>{Ulo.init(t,e),Qs.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(gu,"I$");a(kol,"Dl");gdo=pt("ZodMap",(t,e)=>{Qlo.init(t,e),Qs.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(Pol,"Fl");Ado=pt("ZodSet",(t,e)=>{qlo.init(t,e),Qs.init(t,e),t.min=(...r)=>t.check(AUe(...r)),t.nonempty=r=>t.check(AUe(1,r)),t.max=(...r)=>t.check(CPt(...r)),t.size=(...r)=>t.check(Gjr(...r))});a(Dol,"Zl");_Ue=pt("ZodEnum",(t,e)=>{jlo.init(t,e),Qs.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let c of n)if(r.has(c))s[c]=e.entries[c];else throw Error(`Key ${c} not found in enum`);return new _Ue({...e,checks:[],...Xs.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let c of n)if(r.has(c))delete s[c];else throw Error(`Key ${c} not found in enum`);return new _Ue({...e,checks:[],...Xs.normalizeParams(o),entries:s})}});a(i1,"N6");a(Nol,"Ml");ydo=pt("ZodLiteral",(t,e)=>{Hlo.init(t,e),Qs.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});a(ni,"l");_do=pt("ZodFile",(t,e)=>{Glo.init(t,e),Qs.init(t,e),t.min=(r,n)=>t.check(AUe(r,n)),t.max=(r,n)=>t.check(CPt(r,n)),t.mime=(r,n)=>t.check(Jjr(Array.isArray(r)?r:[r],n))});a(Mol,"Ll");NHr=pt("ZodTransform",(t,e)=>{_jr.init(t,e),Qs.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Xs.issue(s,r.value,e));else{let c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=t),c.continue??(c.continue=!0),r.issues.push(Xs.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});a(MHr,"bV");OHr=pt("ZodOptional",(t,e)=>{$lo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Ld,"_$");Edo=pt("ZodNullable",(t,e)=>{Vlo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Nkt,"v3");a(Ool,"jl");vdo=pt("ZodDefault",(t,e)=>{Wlo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(Cdo,"aM");bdo=pt("ZodPrefault",(t,e)=>{zlo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Sdo,"eM");LHr=pt("ZodNonOptional",(t,e)=>{Ylo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Tdo,"$L");Ido=pt("ZodSuccess",(t,e)=>{Klo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Lol,"Al");xdo=pt("ZodCatch",(t,e)=>{Jlo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(wdo,"XL");Rdo=pt("ZodNaN",(t,e)=>{Zlo.init(t,e),Qs.init(t,e)});a(Bol,"Il");BHr=pt("ZodPipe",(t,e)=>{Ejr.init(t,e),Qs.init(t,e),t.in=e.in,t.out=e.out});a(Mkt,"C3");kdo=pt("ZodReadonly",(t,e)=>{Xlo.init(t,e),Qs.init(t,e)});a(Pdo,"GL");Ddo=pt("ZodTemplateLiteral",(t,e)=>{euo.init(t,e),Qs.init(t,e)});a(Fol,"Rl");Ndo=pt("ZodLazy",(t,e)=>{ruo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(Mdo,"KL");Odo=pt("ZodPromise",(t,e)=>{tuo.init(t,e),Qs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Uol,"Pl");DPt=pt("ZodCustom",(t,e)=>{nuo.init(t,e),Qs.init(t,e)});a(Ldo,"VL");a(Bdo,"vV");a(Fdo,"BL");a(Udo,"zL");a(Qol,"El");qol=a((...t)=>$uo({Pipe:BHr,Boolean:xPt,String:TPt,Transform:NHr},...t),"bl");a(jol,"_l");a(FHr,"u3");Hol={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};a(Gol,"Sl");a($ol,"vl");Qdo={};RB(Qdo,{string:a(()=>Vol,"string"),number:a(()=>Wol,"number"),date:a(()=>Kol,"date"),boolean:a(()=>zol,"boolean"),bigint:a(()=>Yol,"bigint")});a(Vol,"Cl");a(Wol,"Tl");a(zol,"xl");a(Yol,"yl");a(Kol,"fl");_C(iuo());Jol=G,qdo=Jol,jdo="2025-11-25",Zol=[jdo,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],qoe="io.modelcontextprotocol/related-task",NPt="2.0",Xg=Bdo(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Hdo=Au([xt(),Gc().int()]),Gdo=xt(),fpm=gC({ttl:Gc().optional(),pollInterval:Gc().optional()}),Xol=In({ttl:Gc().optional()}),esl=In({taskId:xt()}),UHr=gC({progressToken:Hdo.optional(),[qoe]:esl.optional()}),ax=In({_meta:UHr.optional()}),NUe=ax.extend({task:Xol.optional()}),tsl=a(t=>NUe.safeParse(t).success,"FL"),zy=In({method:xt(),params:ax.loose().optional()}),Kk=In({_meta:UHr.optional()}),Jk=In({method:xt(),params:Kk.loose().optional()}),Yy=gC({_meta:UHr.optional()}),MPt=Au([xt(),Gc().int()]),$do=In({jsonrpc:ni(NPt),id:MPt,...zy.shape}).strict(),Qio=a(t=>$do.safeParse(t).success,"fV"),Vdo=In({jsonrpc:ni(NPt),...Jk.shape}).strict(),rsl=a(t=>Vdo.safeParse(t).success,"LL"),QHr=In({jsonrpc:ni(NPt),id:MPt,result:Yy}).strict(),TRt=a(t=>QHr.safeParse(t).success,"zJ");(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Qi||(Qi={}));qHr=In({jsonrpc:ni(NPt),id:MPt.optional(),error:In({code:Gc().int(),message:xt(),data:Af().optional()})}).strict(),nsl=a(t=>qHr.safeParse(t).success,"jL"),ppm=Au([$do,Vdo,QHr,qHr]),hpm=Au([QHr,qHr]),jHr=Yy.strict(),isl=Kk.extend({requestId:MPt.optional(),reason:xt().optional()}),HHr=Jk.extend({method:ni("notifications/cancelled"),params:isl}),osl=In({src:xt(),mimeType:xt().optional(),sizes:ka(xt()).optional(),theme:i1(["light","dark"]).optional()}),MUe=In({icons:ka(osl).optional()}),cbe=In({name:xt(),title:xt().optional()}),Wdo=cbe.extend({...cbe.shape,...MUe.shape,version:xt(),websiteUrl:xt().optional(),description:xt().optional()}),ssl=PPt(In({applyDefaults:Zg().optional()}),gu(xt(),Af())),asl=FHr(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,PPt(In({form:ssl.optional(),url:Xg.optional()}),gu(xt(),Af()).optional())),csl=gC({list:Xg.optional(),cancel:Xg.optional(),requests:gC({sampling:gC({createMessage:Xg.optional()}).optional(),elicitation:gC({create:Xg.optional()}).optional()}).optional()}),lsl=gC({list:Xg.optional(),cancel:Xg.optional(),requests:gC({tools:gC({call:Xg.optional()}).optional()}).optional()}),usl=In({experimental:gu(xt(),Xg).optional(),sampling:In({context:Xg.optional(),tools:Xg.optional()}).optional(),elicitation:asl.optional(),roots:In({listChanged:Zg().optional()}).optional(),tasks:csl.optional(),extensions:gu(xt(),Xg).optional()}),dsl=ax.extend({protocolVersion:xt(),capabilities:usl,clientInfo:Wdo}),zdo=zy.extend({method:ni("initialize"),params:dsl}),fsl=In({experimental:gu(xt(),Xg).optional(),logging:Xg.optional(),completions:Xg.optional(),prompts:In({listChanged:Zg().optional()}).optional(),resources:In({subscribe:Zg().optional(),listChanged:Zg().optional()}).optional(),tools:In({listChanged:Zg().optional()}).optional(),tasks:lsl.optional(),extensions:gu(xt(),Xg).optional()}),psl=Yy.extend({protocolVersion:xt(),capabilities:fsl,serverInfo:Wdo,instructions:xt().optional()}),Ydo=Jk.extend({method:ni("notifications/initialized"),params:Kk.optional()}),GHr=zy.extend({method:ni("ping"),params:ax.optional()}),hsl=In({progress:Gc(),total:Ld(Gc()),message:Ld(xt())}),msl=In({...Kk.shape,...hsl.shape,progressToken:Hdo}),$Hr=Jk.extend({method:ni("notifications/progress"),params:msl}),gsl=ax.extend({cursor:Gdo.optional()}),OUe=zy.extend({params:gsl.optional()}),LUe=Yy.extend({nextCursor:Gdo.optional()}),Asl=i1(["working","input_required","completed","failed","cancelled"]),BUe=In({taskId:xt(),status:Asl,ttl:Au([Gc(),wHr()]),createdAt:xt(),lastUpdatedAt:xt(),pollInterval:Ld(Gc()),statusMessage:Ld(xt())}),OPt=Yy.extend({task:BUe}),ysl=Kk.merge(BUe),Okt=Jk.extend({method:ni("notifications/tasks/status"),params:ysl}),VHr=zy.extend({method:ni("tasks/get"),params:ax.extend({taskId:xt()})}),WHr=Yy.merge(BUe),zHr=zy.extend({method:ni("tasks/result"),params:ax.extend({taskId:xt()})}),mpm=Yy.loose(),YHr=OUe.extend({method:ni("tasks/list")}),KHr=LUe.extend({tasks:ka(BUe)}),JHr=zy.extend({method:ni("tasks/cancel"),params:ax.extend({taskId:xt()})}),_sl=Yy.merge(BUe),Kdo=In({uri:xt(),mimeType:Ld(xt()),_meta:gu(xt(),Af()).optional()}),Jdo=Kdo.extend({text:xt()}),ZHr=xt().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Zdo=Kdo.extend({blob:ZHr}),FUe=i1(["user","assistant"]),vbe=In({audience:ka(FUe).optional(),priority:Gc().min(0).max(1).optional(),lastModified:iHr.datetime({offset:!0}).optional()}),Xdo=In({...cbe.shape,...MUe.shape,uri:xt(),description:Ld(xt()),mimeType:Ld(xt()),size:Ld(Gc()),annotations:vbe.optional(),_meta:Ld(gC({}))}),Esl=In({...cbe.shape,...MUe.shape,uriTemplate:xt(),description:Ld(xt()),mimeType:Ld(xt()),annotations:vbe.optional(),_meta:Ld(gC({}))}),HQr=OUe.extend({method:ni("resources/list")}),vsl=LUe.extend({resources:ka(Xdo)}),GQr=OUe.extend({method:ni("resources/templates/list")}),Csl=LUe.extend({resourceTemplates:ka(Esl)}),XHr=ax.extend({uri:xt()}),bsl=XHr,$Qr=zy.extend({method:ni("resources/read"),params:bsl}),Ssl=Yy.extend({contents:ka(Au([Jdo,Zdo]))}),Tsl=Jk.extend({method:ni("notifications/resources/list_changed"),params:Kk.optional()}),Isl=XHr,xsl=zy.extend({method:ni("resources/subscribe"),params:Isl}),wsl=XHr,Rsl=zy.extend({method:ni("resources/unsubscribe"),params:wsl}),ksl=Kk.extend({uri:xt()}),Psl=Jk.extend({method:ni("notifications/resources/updated"),params:ksl}),Dsl=In({name:xt(),description:Ld(xt()),required:Ld(Zg())}),Nsl=In({...cbe.shape,...MUe.shape,description:Ld(xt()),arguments:Ld(ka(Dsl)),_meta:Ld(gC({}))}),VQr=OUe.extend({method:ni("prompts/list")}),Msl=LUe.extend({prompts:ka(Nsl)}),Osl=ax.extend({name:xt(),arguments:gu(xt(),xt()).optional()}),WQr=zy.extend({method:ni("prompts/get"),params:Osl}),eGr=In({type:ni("text"),text:xt(),annotations:vbe.optional(),_meta:gu(xt(),Af()).optional()}),tGr=In({type:ni("image"),data:ZHr,mimeType:xt(),annotations:vbe.optional(),_meta:gu(xt(),Af()).optional()}),rGr=In({type:ni("audio"),data:ZHr,mimeType:xt(),annotations:vbe.optional(),_meta:gu(xt(),Af()).optional()}),Lsl=In({type:ni("tool_use"),name:xt(),id:xt(),input:gu(xt(),Af()),_meta:gu(xt(),Af()).optional()}),Bsl=In({type:ni("resource"),resource:Au([Jdo,Zdo]),annotations:vbe.optional(),_meta:gu(xt(),Af()).optional()}),Fsl=Xdo.extend({type:ni("resource_link")}),nGr=Au([eGr,tGr,rGr,Fsl,Bsl]),Usl=In({role:FUe,content:nGr}),Qsl=Yy.extend({description:xt().optional(),messages:ka(Usl)}),qsl=Jk.extend({method:ni("notifications/prompts/list_changed"),params:Kk.optional()}),jsl=In({title:xt().optional(),readOnlyHint:Zg().optional(),destructiveHint:Zg().optional(),idempotentHint:Zg().optional(),openWorldHint:Zg().optional()}),Hsl=In({taskSupport:i1(["required","optional","forbidden"]).optional()}),efo=In({...cbe.shape,...MUe.shape,description:xt().optional(),inputSchema:In({type:ni("object"),properties:gu(xt(),Xg).optional(),required:ka(xt()).optional()}).catchall(Af()),outputSchema:In({type:ni("object"),properties:gu(xt(),Xg).optional(),required:ka(xt()).optional()}).catchall(Af()).optional(),annotations:jsl.optional(),execution:Hsl.optional(),_meta:gu(xt(),Af()).optional()}),zQr=OUe.extend({method:ni("tools/list")}),Gsl=LUe.extend({tools:ka(efo)}),iGr=Yy.extend({content:ka(nGr).default([]),structuredContent:gu(xt(),Af()).optional(),isError:Zg().optional()}),gpm=iGr.or(Yy.extend({toolResult:Af()})),$sl=NUe.extend({name:xt(),arguments:gu(xt(),Af()).optional()}),Lkt=zy.extend({method:ni("tools/call"),params:$sl}),Vsl=Jk.extend({method:ni("notifications/tools/list_changed"),params:Kk.optional()}),Apm=In({autoRefresh:Zg().default(!0),debounceMs:Gc().int().nonnegative().default(300)}),Bkt=i1(["debug","info","notice","warning","error","critical","alert","emergency"]),Wsl=ax.extend({level:Bkt}),tfo=zy.extend({method:ni("logging/setLevel"),params:Wsl}),zsl=Kk.extend({level:Bkt,logger:xt().optional(),data:Af()}),Ysl=Jk.extend({method:ni("notifications/message"),params:zsl}),Ksl=In({name:xt().optional()}),Jsl=In({hints:ka(Ksl).optional(),costPriority:Gc().min(0).max(1).optional(),speedPriority:Gc().min(0).max(1).optional(),intelligencePriority:Gc().min(0).max(1).optional()}),Zsl=In({mode:i1(["auto","required","none"]).optional()}),Xsl=In({type:ni("tool_result"),toolUseId:xt().describe("The unique identifier for the corresponding tool call."),content:ka(nGr).default([]),structuredContent:In({}).loose().optional(),isError:Zg().optional(),_meta:gu(xt(),Af()).optional()}),eal=PHr("type",[eGr,tGr,rGr]),Fkt=PHr("type",[eGr,tGr,rGr,Lsl,Xsl]),tal=In({role:FUe,content:Au([Fkt,ka(Fkt)]),_meta:gu(xt(),Af()).optional()}),ral=NUe.extend({messages:ka(tal),modelPreferences:Jsl.optional(),systemPrompt:xt().optional(),includeContext:i1(["none","thisServer","allServers"]).optional(),temperature:Gc().optional(),maxTokens:Gc().int(),stopSequences:ka(xt()).optional(),metadata:Xg.optional(),tools:ka(efo).optional(),toolChoice:Zsl.optional()}),nal=zy.extend({method:ni("sampling/createMessage"),params:ral}),oGr=Yy.extend({model:xt(),stopReason:Ld(i1(["endTurn","stopSequence","maxTokens"]).or(xt())),role:FUe,content:eal}),rfo=Yy.extend({model:xt(),stopReason:Ld(i1(["endTurn","stopSequence","maxTokens","toolUse"]).or(xt())),role:FUe,content:Au([Fkt,ka(Fkt)])}),ial=In({type:ni("boolean"),title:xt().optional(),description:xt().optional(),default:Zg().optional()}),oal=In({type:ni("string"),title:xt().optional(),description:xt().optional(),minLength:Gc().optional(),maxLength:Gc().optional(),format:i1(["email","uri","date","date-time"]).optional(),default:xt().optional()}),sal=In({type:i1(["number","integer"]),title:xt().optional(),description:xt().optional(),minimum:Gc().optional(),maximum:Gc().optional(),default:Gc().optional()}),aal=In({type:ni("string"),title:xt().optional(),description:xt().optional(),enum:ka(xt()),default:xt().optional()}),cal=In({type:ni("string"),title:xt().optional(),description:xt().optional(),oneOf:ka(In({const:xt(),title:xt()})),default:xt().optional()}),lal=In({type:ni("string"),title:xt().optional(),description:xt().optional(),enum:ka(xt()),enumNames:ka(xt()).optional(),default:xt().optional()}),ual=Au([aal,cal]),dal=In({type:ni("array"),title:xt().optional(),description:xt().optional(),minItems:Gc().optional(),maxItems:Gc().optional(),items:In({type:ni("string"),enum:ka(xt())}),default:ka(xt()).optional()}),fal=In({type:ni("array"),title:xt().optional(),description:xt().optional(),minItems:Gc().optional(),maxItems:Gc().optional(),items:In({anyOf:ka(In({const:xt(),title:xt()}))}),default:ka(xt()).optional()}),pal=Au([dal,fal]),hal=Au([lal,ual,pal]),mal=Au([hal,ial,oal,sal]),gal=NUe.extend({mode:ni("form").optional(),message:xt(),requestedSchema:In({type:ni("object"),properties:gu(xt(),mal),required:ka(xt()).optional()})}),Aal=NUe.extend({mode:ni("url"),message:xt(),elicitationId:xt(),url:xt().url()}),yal=Au([gal,Aal]),_al=zy.extend({method:ni("elicitation/create"),params:yal}),Eal=Kk.extend({elicitationId:xt()}),val=Jk.extend({method:ni("notifications/elicitation/complete"),params:Eal}),Ukt=Yy.extend({action:i1(["accept","decline","cancel"]),content:FHr(t=>t===null?void 0:t,gu(xt(),Au([xt(),Gc(),Zg(),ka(xt())])).optional())}),Cal=In({type:ni("ref/resource"),uri:xt()}),bal=In({type:ni("ref/prompt"),name:xt()}),Sal=ax.extend({ref:Au([bal,Cal]),argument:In({name:xt(),value:xt()}),context:In({arguments:gu(xt(),xt()).optional()}).optional()}),YQr=zy.extend({method:ni("completion/complete"),params:Sal});a(Tal,"kL");a(Ial,"SL");xal=Yy.extend({completion:gC({values:ka(xt()).max(100),total:Ld(Gc().int()),hasMore:Ld(Zg())})}),wal=In({uri:xt().startsWith("file://"),name:xt().optional(),_meta:gu(xt(),Af()).optional()}),Ral=zy.extend({method:ni("roots/list"),params:ax.optional()}),nfo=Yy.extend({roots:ka(wal)}),kal=Jk.extend({method:ni("notifications/roots/list_changed"),params:Kk.optional()}),ypm=Au([GHr,zdo,YQr,tfo,WQr,VQr,HQr,GQr,$Qr,xsl,Rsl,Lkt,zQr,VHr,zHr,YHr,JHr]),_pm=Au([HHr,$Hr,Ydo,kal,Okt]),Epm=Au([jHr,oGr,rfo,Ukt,nfo,WHr,KHr,OPt]),vpm=Au([GHr,nal,_al,Ral,VHr,zHr,YHr,JHr]),Cpm=Au([HHr,$Hr,Ysl,Psl,Tsl,Vsl,qsl,Okt,val]),bpm=Au([jHr,psl,xal,Qsl,Msl,vsl,Csl,Ssl,iGr,Gsl,WHr,KHr,OPt]),mi=class t extends Error{static{a(this,"c")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===Qi.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new KQr(o.elicitations,r)}return new t(e,r,n)}},KQr=class extends mi{static{a(this,"vL")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Qi.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};a(Uoe,"T1");Pal=Symbol("Let zodToJsonSchema decide on which parser to use"),qio={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Dal=a(t=>typeof t=="string"?{...qio,name:t}:{...qio,...t},"xL"),Nal=a(t=>{let e=Dal(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}},"yL");a(ifo,"aV");a(wl,"H$");ofo=a((t,e)=>{let r=0;for(;rHc(t.innerType._def,e),"uL");a(afo,"sV");Fal=a((t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":wl(r,"minimum",n.value,n.message,e);break;case"max":wl(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(Ual,"mL");a(Qal,"lL");a(qal,"cL");jal=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(Hal,"pL");a(Gal,"dL");V7r=void 0,pM={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:a(()=>(V7r===void 0&&(V7r=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),V7r),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};a(cfo,"qW");a(W7r,"$B");$al=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(Val,"Np");a(hM,"V4");a(mC,"w6");a(jio,"iL");a(lfo,"VW");a(Wal,"nL");a(zal,"rL");a(Yal,"oL");a(Kal,"tL");Qkt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(Jal,"sL");Hio=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Hc(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0},"aL");a(Zal,"eL");a(Xal,"$j");a(ecl,"Qj");a(tcl,"wp");a(rcl,"Op");ncl=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Hc(t.innerType._def,e);let r=Hc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:n1(e)},r]}:n1(e)},"Jj"),icl=a((t,e)=>{if(e.pipeStrategy==="input")return Hc(t.in._def,e);if(e.pipeStrategy==="output")return Hc(t.out._def,e);let r=Hc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Hc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a(ocl,"Yj");a(scl,"Wj");a(acl,"Gj");a(ccl,"Uj");a(lcl,"Hj");ucl=a((t,e)=>Hc(t.innerType._def,e),"Kj"),dcl=a((t,e,r)=>{switch(e){case wr.ZodString:return cfo(t,r);case wr.ZodNumber:return Xal(t,r);case wr.ZodObject:return ecl(t,r);case wr.ZodBigInt:return Oal(t,r);case wr.ZodBoolean:return Lal();case wr.ZodDate:return afo(t,r);case wr.ZodUndefined:return ccl(r);case wr.ZodNull:return Kal(r);case wr.ZodArray:return Mal(t,r);case wr.ZodUnion:case wr.ZodDiscriminatedUnion:return Jal(t,r);case wr.ZodIntersection:return Hal(t,r);case wr.ZodTuple:return acl(t,r);case wr.ZodRecord:return lfo(t,r);case wr.ZodLiteral:return Gal(t,r);case wr.ZodEnum:return qal(t);case wr.ZodNativeEnum:return zal(t);case wr.ZodNullable:return Zal(t,r);case wr.ZodOptional:return ncl(t,r);case wr.ZodMap:return Wal(t,r);case wr.ZodSet:return scl(t,r);case wr.ZodLazy:return()=>t.getter()._def;case wr.ZodPromise:return ocl(t,r);case wr.ZodNaN:case wr.ZodNever:return Yal(r);case wr.ZodEffects:return Qal(t,r);case wr.ZodAny:return n1(r);case wr.ZodUnknown:return lcl(r);case wr.ZodDefault:return Ual(t,r);case wr.ZodBranded:return sfo(t,r);case wr.ZodReadonly:return ucl(t,r);case wr.ZodCatch:return Bal(t,r);case wr.ZodPipeline:return icl(t,r);case wr.ZodFunction:case wr.ZodVoid:case wr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Hc,"r");fcl=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:ofo(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),n1(e)):e.$refStrategy==="seen"?n1(e):void 0}},"Dp"),pcl=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),hcl=a((t,e)=>{let r=Nal(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Hc(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0)??n1(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=Hc(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??n1(r),c=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;c!==void 0&&(s.title=c),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let l=o===void 0?n?{...s,[r.definitionPath]:n}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:s}};return r.target==="jsonSchema7"?l.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(l.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in l||"oneOf"in l||"allOf"in l||"type"in l&&Array.isArray(l.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),l},"QB");a(mcl,"Zp");a(Gio,"JB");a($io,"XB");a(Vio,"YB");gcl=6e4,JQr=class{static{a(this,"WB")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(HHr,r=>{this._oncancel(r)}),this.setNotificationHandler($Hr,r=>{this._onprogress(r)}),this.setRequestHandler(GHr,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(VHr,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new mi(Qi.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(zHr,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new mi(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new mi(Qi.InvalidParams,`Task not found: ${s}`);if(!Uoe(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Uoe(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[qoe]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(YHr,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new mi(Qi.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(JHr,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new mi(Qi.InvalidParams,`Task not found: ${r.params.taskId}`);if(Uoe(o.status))throw new mi(Qi.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new mi(Qi.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof mi?o:new mi(Qi.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),mi.fromError(Qi.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,c)=>{o?.(s,c),TRt(s)||nsl(s)?this._onresponse(s):Qio(s)?this._onrequest(s,c):rsl(s)?this._onnotification(s):this._onerror(Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=mi.fromError(Qi.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[qoe]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Qi.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let l=tsl(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,d={signal:c.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:a(async f=>{if(c.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},"sendNotification"),sendRequest:a(async(f,h,m)=>{if(c.signal.aborted)throw new mi(Qi.ConnectionClosed,"Request was cancelled");let g={...m,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let A=g.relatedTask?.taskId??s;return A&&u&&await u.updateTaskStatus(A,"input_required"),await this.request(f,h,g)},"sendRequest"),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:l?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,d)).then(async f=>{if(c.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(c.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:Qi.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===c&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let c=this._responseHandlers.get(o),l=this._timeoutInfo.get(o);if(l&&c&&l.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),c(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),TRt(e))n(e);else{let c=new mi(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(TRt(e)&&e.result&&typeof e.result=="object"){let c=e.result;if(c.task&&typeof c.task=="object"){let l=c.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,r))}}if(s||this._progressHandlers.delete(r),TRt(e))o(e);else{let c=mi.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof mi?c:new mi(Qi.InternalError,String(c))}}return}let s;try{let c=await this.request(e,OPt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new mi(Qi.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Uoe(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new mi(Qi.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new mi(Qi.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=l.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),n?.signal?.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof mi?c:new mi(Qi.InternalError,String(c))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c,task:l,relatedTask:u}=n??{};return new Promise((d,f)=>{let h=a(v=>{f(v)},"V");if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),l&&this.assertTaskCapability(e.method)}catch(v){h(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),l&&(g.params={...g.params,task:l}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[qoe]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(Error(`Failed to send cancellation: ${T}`)));let S=v instanceof mi?v:new mi(Qi.RequestTimeout,String(v));f(S)},"N");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let S=$6e(r,v.result);S.success?d(S.data):f(S.error)}catch(S){f(S)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??gcl,_=a(()=>A(mi.fromError(Qi.RequestTimeout,"Request timed out",{timeout:y})),"O");this._setupTimeout(m,y,n?.maxTotalTimeout,_,n?.resetTimeoutOnProgress??!1);let E=u?.taskId;if(E){let v=a(S=>{let T=this._responseHandlers.get(m);T?T(S):this._onerror(Error(`Response handler missing for side-channeled request ${m}`))},"M");this._requestResolvers.set(m,v),this._enqueueTaskMessage(E,{type:"request",message:g,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(m),f(S)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(v=>{this._cleanupTimeout(m),f(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},WHr,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},KHr,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},_sl,r)}async notification(e,r){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[qoe]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[qoe]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[qoe]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=$io(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=Vio(e,o);return Promise.resolve(r(c,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=$io(e);this._notificationHandlers.set(n,o=>{let s=Vio(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&Qio(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new mi(Qi.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new mi(Qi.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new mi(Qi.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw Error("No task store configured");return{createTask:a(async o=>{if(!e)throw Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},"createTask"),getTask:a(async o=>{let s=await n.getTask(o,r);if(!s)throw new mi(Qi.InvalidParams,"Failed to retrieve task: Task not found");return s},"getTask"),storeTaskResult:a(async(o,s,c)=>{await n.storeTaskResult(o,s,c,r);let l=await n.getTask(o,r);if(l){let u=Okt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Uoe(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new mi(Qi.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Uoe(l.status))throw new mi(Qi.InvalidParams,`Cannot update task "${o}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,c,r);let u=await n.getTask(o,r);if(u){let d=Okt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Uoe(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a(Wio,"Vj");a(Acl,"Bj");ycl=Eqr(zoo(),1),_cl=Eqr(zWc(),1);a(Ecl,"ps");ZQr=class{static{a(this,"qz")}constructor(e){this._ajv=e??Ecl()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}},XQr=class{static{a(this,"Vz")}constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],s=Array.isArray(o.content)?o.content:[o.content],c=s.some(f=>f.type==="tool_result"),l=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=l?Array.isArray(l.content)?l.content:[l.content]:[],d=u.some(f=>f.type==="tool_use");if(c){if(s.some(f=>f.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!d)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(d){let f=new Set(u.filter(m=>m.type==="tool_use").map(m=>m.id)),h=new Set(s.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(f.size!==h.size||![...f].every(m=>h.has(m)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},oGr,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),o=e.mode??"form";switch(o){case"url":{if(!n?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let s=o==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},Ukt,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};a(vcl,"tP");a(Ccl,"aP");eqr=class extends JQr{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Bkt.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)this._oninitialize(n)),this.setNotificationHandler(Ydo,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(tfo,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=Bkt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new XQr(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=Acl(this._capabilities,e)}setRequestHandler(e,r){let n=PUe(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(wB(n)){let s=n;o=s._zod?.def?.value??s.value}else{let s=n;o=s._def?.value??s.value}if(typeof o!="string")throw Error("Schema method literal must be a string");if(o==="tools/call"){let s=a(async(c,l)=>{let u=$6e(Lkt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new mi(Qi.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=$6e(OPt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new mi(Qi.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=$6e(iGr,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new mi(Qi.InvalidParams,`Invalid tools/call result: ${m}`)}return h.data},"G");return super.setRequestHandler(e,s)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){Ccl(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&vcl(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Zol.includes(r)?r:jdo,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},jHr)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(d=>d.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],u=l.some(d=>d.type==="tool_use");if(s){if(o.some(d=>d.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!u)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(l.filter(h=>h.type==="tool_use").map(h=>h.id)),f=new Set(o.filter(h=>h.type==="tool_result").map(h=>h.toolUseId));if(d.size!==f.size||![...d].every(h=>f.has(h)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},rfo,r):this.request({method:"sampling/createMessage",params:e},oGr,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let n=e;return this.request({method:"elicitation/create",params:n},Ukt,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:n},Ukt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new mi(Qi.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof mi?s:new mi(Qi.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},nfo,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}},ufo=Symbol.for("mcp.completable");a(zio,"zz");a(bcl,"$E");(function(t){t.Completable="McpCompletable"})(Yio||(Yio={}));Scl=/^[A-Za-z0-9._-]{1,128}$/;a(Tcl,"is");a(Icl,"ns");a(Kio,"Nz");tqr=class{static{a(this,"wz")}constructor(e){this._mcpServer=e}registerToolTask(e,r,n){let o={taskSupport:"required",...r.execution};if(o.taskSupport==="forbidden")throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,o,r._meta,n)}},rqr=class{static{a(this,"Dz")}constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new eqr(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new tqr(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(YW(zQr)),this.server.assertCanSetRequestHandler(YW(Lkt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(zQr,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let n={name:e,title:r.title,description:r.description,inputSchema:(()=>{let o=R6e(r.inputSchema);return o?Gio(o,{strictUnions:!0,pipeStrategy:"input"}):xcl})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=R6e(r.outputSchema);o&&(n.outputSchema=Gio(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Lkt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new mi(Qi.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new mi(Qi.InvalidParams,`Tool ${e.params.name} disabled`);let o=!!e.params.task,s=n.execution?.taskSupport,c="createTask"in n.handler;if((s==="required"||s==="optional")&&!c)throw new mi(Qi.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new mi(Qi.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(s==="optional"&&!o&&c)return await this.handleAutomaticTaskPolling(n,e,r);let l=await this.validateToolInput(n,e.params.arguments,e.params.name),u=await this.executeToolHandler(n,l,r);return o||await this.validateToolOutput(n,u,e.params.name),u}catch(n){if(n instanceof mi&&n.code===Qi.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,n){if(!e.inputSchema)return;let o=R6e(e.inputSchema)??e.inputSchema,s=await G7r(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=$7r(c);throw new mi(Qi.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${l}`)}return s.data}async validateToolOutput(e,r,n){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new mi(Qi.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=R6e(e.outputSchema),s=await G7r(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=$7r(c);throw new mi(Qi.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${l}`)}}async executeToolHandler(e,r,n){let o=e.handler;if("createTask"in o){if(!n.taskStore)throw Error("No task store provided.");let s={...n,taskStore:n.taskStore};return e.inputSchema?await Promise.resolve(o.createTask(r,s)):await Promise.resolve(o.createTask(s))}return e.inputSchema?await Promise.resolve(o(r,n)):await Promise.resolve(o(n))}async handleAutomaticTaskPolling(e,r,n){if(!n.taskStore)throw Error("No task store provided for task-capable tool.");let o=await this.validateToolInput(e,r.params.arguments,r.params.name),s=e.handler,c={...n,taskStore:n.taskStore},l=o?await Promise.resolve(s.createTask(o,c)):await Promise.resolve(s.createTask(c)),u=l.task.taskId,d=l.task,f=d.pollInterval??5e3;for(;d.status!=="completed"&&d.status!=="failed"&&d.status!=="cancelled";){await new Promise(m=>setTimeout(m,f));let h=await n.taskStore.getTask(u);if(!h)throw new mi(Qi.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(YW(YQr)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(YQr,async e=>{switch(e.params.ref.type){case"ref/prompt":return Tal(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Ial(e),this.handleResourceCompletion(e,e.params.ref);default:throw new mi(Qi.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new mi(Qi.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new mi(Qi.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return k6e;let o=PUe(n.argsSchema)?.[e.params.argument.name];if(!zio(o))return k6e;let s=bcl(o);if(!s)return k6e;let c=await s(e.params.argument.value,e.params.context);return Zio(c)}async handleResourceCompletion(e,r){let n=Object.values(this._registeredResourceTemplates).find(c=>c.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return k6e;throw new mi(Qi.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return k6e;let s=await o(e.params.argument.value,e.params.context);return Zio(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(YW(HQr)),this.server.assertCanSetRequestHandler(YW(GQr)),this.server.assertCanSetRequestHandler(YW($Qr)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(HQr,async(e,r)=>{let n=Object.entries(this._registeredResources).filter(([s,c])=>c.enabled).map(([s,c])=>({uri:s,name:c.name,...c.metadata})),o=[];for(let s of Object.values(this._registeredResourceTemplates)){if(!s.resourceTemplate.listCallback)continue;let c=await s.resourceTemplate.listCallback(r);for(let l of c.resources)o.push({...s.metadata,...l})}return{resources:[...n,...o]}}),this.server.setRequestHandler(GQr,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler($Qr,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new mi(Qi.InvalidParams,`Resource ${n} disabled`);return o.readCallback(n,r)}for(let s of Object.values(this._registeredResourceTemplates)){let c=s.resourceTemplate.uriTemplate.match(n.toString());if(c)return s.readCallback(n,c,r)}throw new mi(Qi.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(YW(VQr)),this.server.assertCanSetRequestHandler(YW(WQr)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(VQr,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?wcl(r.argsSchema):void 0}))})),this.server.setRequestHandler(WQr,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new mi(Qi.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new mi(Qi.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=R6e(n.argsSchema),s=await G7r(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=$7r(u);throw new mi(Qi.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${d}`)}let c=s.data,l=n.callback;return await Promise.resolve(l(c,r))}else{let o=n.callback;return await Promise.resolve(o(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...n){let o;typeof n[0]=="object"&&(o=n.shift());let s=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw Error(`Resource ${r} is already registered`);let c=this._createRegisteredResource(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let c=this._createRegisteredResourceTemplate(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}}registerResource(e,r,n,o){if(typeof r=="string"){if(this._registeredResources[r])throw Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}_createRegisteredResource(e,r,n,o,s){let c={name:e,title:r,metadata:o,readCallback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({uri:null}),"remove"),update:a(l=>{typeof l.uri<"u"&&l.uri!==n&&(delete this._registeredResources[n],l.uri&&(this._registeredResources[l.uri]=c)),typeof l.name<"u"&&(c.name=l.name),typeof l.title<"u"&&(c.title=l.title),typeof l.metadata<"u"&&(c.metadata=l.metadata),typeof l.callback<"u"&&(c.readCallback=l.callback),typeof l.enabled<"u"&&(c.enabled=l.enabled),this.sendResourceListChanged()},"update")};return this._registeredResources[n]=c,c}_createRegisteredResourceTemplate(e,r,n,o,s){let c={resourceTemplate:n,title:r,metadata:o,readCallback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({name:null}),"remove"),update:a(u=>{typeof u.name<"u"&&u.name!==e&&(delete this._registeredResourceTemplates[e],u.name&&(this._registeredResourceTemplates[u.name]=c)),typeof u.title<"u"&&(c.title=u.title),typeof u.template<"u"&&(c.resourceTemplate=u.template),typeof u.metadata<"u"&&(c.metadata=u.metadata),typeof u.callback<"u"&&(c.readCallback=u.callback),typeof u.enabled<"u"&&(c.enabled=u.enabled),this.sendResourceListChanged()},"update")};this._registeredResourceTemplates[e]=c;let l=n.uriTemplate.variableNames;return Array.isArray(l)&&l.some(u=>!!n.completeCallback(u))&&this.setCompletionRequestHandler(),c}_createRegisteredPrompt(e,r,n,o,s){let c={title:r,description:n,argsSchema:o===void 0?void 0:MCe(o),callback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({name:null}),"remove"),update:a(l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredPrompts[e],l.name&&(this._registeredPrompts[l.name]=c)),typeof l.title<"u"&&(c.title=l.title),typeof l.description<"u"&&(c.description=l.description),typeof l.argsSchema<"u"&&(c.argsSchema=MCe(l.argsSchema)),typeof l.callback<"u"&&(c.callback=l.callback),typeof l.enabled<"u"&&(c.enabled=l.enabled),this.sendPromptListChanged()},"update")};return this._registeredPrompts[e]=c,o&&Object.values(o).some(l=>{let u=l instanceof zk?l._def?.innerType:l;return zio(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){Kio(e);let f={title:r,description:n,inputSchema:Jio(o),outputSchema:Jio(s),annotations:c,execution:l,_meta:u,handler:d,enabled:!0,disable:a(()=>f.update({enabled:!1}),"disable"),enable:a(()=>f.update({enabled:!0}),"enable"),remove:a(()=>f.update({name:null}),"remove"),update:a(h=>{typeof h.name<"u"&&h.name!==e&&(typeof h.name=="string"&&Kio(h.name),delete this._registeredTools[e],h.name&&(this._registeredTools[h.name]=f)),typeof h.title<"u"&&(f.title=h.title),typeof h.description<"u"&&(f.description=h.description),typeof h.paramsSchema<"u"&&(f.inputSchema=MCe(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=MCe(h.outputSchema)),typeof h.callback<"u"&&(f.handler=h.callback),typeof h.annotations<"u"&&(f.annotations=h.annotations),typeof h._meta<"u"&&(f._meta=h._meta),typeof h.enabled<"u"&&(f.enabled=h.enabled),this.sendToolListChanged()},"update")};return this._registeredTools[e]=f,this.setToolRequestHandlers(),this.sendToolListChanged(),f}tool(e,...r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let n,o,s,c;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let u=r[0];if(nqr(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!nqr(r[0])&&(c=r.shift());else if(typeof u=="object"&&u!==null){if(Object.values(u).some(d=>typeof d=="object"&&d!==null))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);c=r.shift()}}let l=r[0];return this._createRegisteredTool(e,void 0,n,o,s,c,{taskSupport:"forbidden"},void 0,l)}registerTool(e,r,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:o,description:s,inputSchema:c,outputSchema:l,annotations:u,_meta:d}=r;return this._createRegisteredTool(e,o,s,c,l,u,{taskSupport:"forbidden"},d,n)}prompt(e,...r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let o;r.length>1&&(o=r.shift());let s=r[0],c=this._createRegisteredPrompt(e,void 0,n,o,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}registerPrompt(e,r,n){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:o,description:s,argsSchema:c}=r,l=this._createRegisteredPrompt(e,o,s,c,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),l}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},xcl={type:"object",properties:{}};a(dfo,"XE");a(ffo,"YE");a(nqr,"Oz");a(Jio,"QE");a(wcl,"os");a(YW,"l1");a(Zio,"JE");k6e={completion:{values:[],hasMore:!1}};a(Rcl,"ts");a(kcl,"as");a(Pcl,"ss");a(Dr,"b");Xio=15e3,Dcl=Dr(()=>G.object({session_id:G.string(),ws_url:G.string(),work_dir:G.string().optional(),session_key:G.string().optional()})),Gk=class extends Error{static{a(this,"F4")}code;constructor(e,r){super(e),this.name="DirectConnectError",this.code=r}},iqr=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new mkt;readyPromise;readyResolve;readyReject;abortHandler;partialChunks=[];telemetryEmitted=!1;constructor(e){this.options=e,this.abortController=e.abortController??new AbortController,this.readyPromise=new Promise((r,n)=>{this.readyResolve=r,this.readyReject=n}),this.readyPromise.catch(()=>{}),this.initialize()}get ready(){return this.readyPromise}getSessionId(){return this.sessionId}getWorkDir(){return this.workDir}async initialize(){if(this.abortController.signal.aborted){this.failInit(new e1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new e1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await Mcl(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=bUe(s);if(!(c instanceof e1)){let l=c instanceof Gk&&c.code?c.code:"session_create_failed";this.emitTelemetry("bad",l)}this.failInit(c);return}if(this.closed){this.options.deleteSessionOnClose&&this.sessionId&&eoo(this.options.serverUrl,this.sessionId,this.options.authToken);return}let r={};this.options.authToken&&(r.authorization=`Bearer ${this.options.authToken}`);let n=new WebSocket(e,{headers:r});this.ws=n;let o=setTimeout((s,c)=>{if(!s.readyState){c.close();let l=new Gk(`WebSocket connection timeout after ${Xio}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},Xio,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,jk(`[DirectConnectTransport] Connected to ${this.options.serverUrl}, session=${this.sessionId}`),this.readyResolve?.(),this.emitTelemetry("ok")}),n.addEventListener("message",s=>{let c=typeof s.data=="string"?s.data:"";if(c.indexOf(` `)===-1){c&&this.partialChunks.push(c);return}let l=this.partialChunks.join("")+c;this.partialChunks.length=0;let u=l.split(` -`),d=u.pop()??"";d&&this.partialChunks.push(d);for(let f of u){if(!f)continue;let h;try{h=CM(f)}catch(m){jk(`DirectConnect: dropped malformed JSON line (${f.length} bytes): ${m}`);continue}this.messages.enqueue(h)}}),n.addEventListener("error",()=>{clearTimeout(o);let s=new Gk("WebSocket connection error");this.exitError=s,this.readyReject?.(s),this.messages.done(),!this.readyState&&this.emitTelemetry("bad","ws_error")}),n.addEventListener("close",s=>{let c=this.readyState;this.readyState=!1,this.closed=!0;let l=s.code!==1e3&&s.code!==1001;l&&!this.exitError&&(this.exitError=new Gk(`WebSocket closed abnormally: ${s.code} ${s.reason}`)),this.messages.done(),c&&l&&!this.abortController.signal.aborted&&this.emitTelemetry("sad","ws_closed_abnormally")})}emitTelemetry(e,r){this.telemetryEmitted||(this.telemetryEmitted=!0,e==="ok"?fao("transport_direct_connect"):e==="bad"?pao("transport_direct_connect",r??"unknown"):wel("transport_direct_connect",r??"unknown"))}failInit(e){this.exitError=e,this.closed=!0,this.readyReject?.(e),this.messages.done()}async write(e){if(this.abortController.signal.aborted)throw new e1("Operation aborted");if(this.readyState||await this.readyPromise,!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Gk("Transport is not ready for writing");this.ws.send(e)}isReady(){return this.readyState&&this.ws?.readyState===WebSocket.OPEN}endInput(){}[Symbol.dispose](){this.close()}close(){this.closed||(this.closed=!0,this.readyState=!1,this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0),this.abortController.signal.aborted||this.abortController.abort(),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.close(1e3,"Normal closure"),this.messages.done(),this.options.deleteSessionOnClose&&this.sessionId&&Zio(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(Pcl,"$e");a(Dcl,"Qe");a(Zio,"GE");a(iqr,"nJ");a(Ncl,"Xe");a(Mcl,"Ye");a(Ocl,"We");a(Lcl,"Ge");a(OPt,"h0");(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(Xio||(Xio={}));Epm=Array(20).fill(0).map((t,e)=>" ".repeat(e)),vpm={" ":{"\n":Array(200).fill(0).map((t,e)=>` +`),d=u.pop()??"";d&&this.partialChunks.push(d);for(let f of u){if(!f)continue;let h;try{h=CM(f)}catch(m){jk(`DirectConnect: dropped malformed JSON line (${f.length} bytes): ${m}`);continue}this.messages.enqueue(h)}}),n.addEventListener("error",()=>{clearTimeout(o);let s=new Gk("WebSocket connection error");this.exitError=s,this.readyReject?.(s),this.messages.done(),!this.readyState&&this.emitTelemetry("bad","ws_error")}),n.addEventListener("close",s=>{let c=this.readyState;this.readyState=!1,this.closed=!0;let l=s.code!==1e3&&s.code!==1001;l&&!this.exitError&&(this.exitError=new Gk(`WebSocket closed abnormally: ${s.code} ${s.reason}`)),this.messages.done(),c&&l&&!this.abortController.signal.aborted&&this.emitTelemetry("sad","ws_closed_abnormally")})}emitTelemetry(e,r){this.telemetryEmitted||(this.telemetryEmitted=!0,e==="ok"?hao("transport_direct_connect"):e==="bad"?mao("transport_direct_connect",r??"unknown"):kel("transport_direct_connect",r??"unknown"))}failInit(e){this.exitError=e,this.closed=!0,this.readyReject?.(e),this.messages.done()}async write(e){if(this.abortController.signal.aborted)throw new e1("Operation aborted");if(this.readyState||await this.readyPromise,!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Gk("Transport is not ready for writing");this.ws.send(e)}isReady(){return this.readyState&&this.ws?.readyState===WebSocket.OPEN}endInput(){}[Symbol.dispose](){this.close()}close(){this.closed||(this.closed=!0,this.readyState=!1,this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0),this.abortController.signal.aborted||this.abortController.abort(),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.close(1e3,"Normal closure"),this.messages.done(),this.options.deleteSessionOnClose&&this.sessionId&&eoo(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(Ncl,"$e");a(Mcl,"Qe");a(eoo,"GE");a(oqr,"nJ");a(Ocl,"Xe");a(Lcl,"Ye");a(Bcl,"We");a(Fcl,"Ge");a(LPt,"h0");(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(too||(too={}));Spm=Array(20).fill(0).map((t,e)=>" ".repeat(e)),Tpm={" ":{"\n":Array(200).fill(0).map((t,e)=>` `+" ".repeat(e)),"\r":Array(200).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":Array(200).fill(0).map((t,e)=>`\r `+" ".repeat(e))}," ":{"\n":Array(200).fill(0).map((t,e)=>` `+" ".repeat(e)),"\r":Array(200).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":Array(200).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}};(function(t){t.DEFAULT={allowTrailingComma:!1}})(eoo||(eoo={}));(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(too||(too={}));(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(roo||(roo={}));(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(noo||(noo={}));a(pfo,"rW");XW=oGr.default.homedir(),sGr=oGr.default.tmpdir(),{env:OCe}=Qkt.default,Bcl=a(t=>{let e=gf.default.join(XW,"Library");return{data:gf.default.join(e,"Application Support",t),config:gf.default.join(e,"Preferences",t),cache:gf.default.join(e,"Caches",t),log:gf.default.join(e,"Logs",t),temp:gf.default.join(sGr,t)}},"Oe"),Fcl=a(t=>{let e=OCe.APPDATA||gf.default.join(XW,"AppData","Roaming"),r=OCe.LOCALAPPDATA||gf.default.join(XW,"AppData","Local");return{data:gf.default.join(r,t,"Data"),config:gf.default.join(e,t,"Config"),cache:gf.default.join(r,t,"Cache"),log:gf.default.join(r,t,"Log"),temp:gf.default.join(sGr,t)}},"De"),Ucl=a(t=>{let e=gf.default.basename(XW);return{data:gf.default.join(OCe.XDG_DATA_HOME||gf.default.join(XW,".local","share"),t),config:gf.default.join(OCe.XDG_CONFIG_HOME||gf.default.join(XW,".config"),t),cache:gf.default.join(OCe.XDG_CACHE_HOME||gf.default.join(XW,".cache"),t),log:gf.default.join(OCe.XDG_STATE_HOME||gf.default.join(XW,".local","state"),t),temp:gf.default.join(sGr,e,t)}},"Fe");a(Qcl,"Mz");Cpm=Qcl("claude-cli");a(qcl,"Ze");a(jcl,"wE");Hcl=100,W7r=[];a(Gcl,"Le");$cl=[],ioo=null,bpm=Wy(()=>process.argv.includes("--hard-fail"));a(hfo,"oW");RCe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,mfo=new Set,oqr=typeof process=="object"&&process?process:{},gfo=a((t,e,r,n)=>{typeof oqr.emitWarning=="function"?oqr.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),qkt=globalThis.AbortController,ooo=globalThis.AbortSignal;if(typeof qkt>"u"){ooo=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},qkt=class{static{a(this,"tW")}constructor(){e()}signal=new ooo;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let n of this.signal._onabort)n(r);this.signal.onabort?.(r)}}};let t=oqr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,gfo("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"Q")}Vcl=a(t=>!mfo.has(t),"Ae"),YW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),Afo=a(t=>YW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?UCe:null:null,"ME"),UCe=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},sqr=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=Afo(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},aqr=class t{static{a(this,"aW")}#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#c;#u;#l;#p;#g;#A;#h;#v;#m;#b;#T;#_;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#_,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#l,next:e.#p,prev:e.#g,get head(){return e.#A},get tail(){return e.#h},free:e.#v,isBackgroundFetch:a(r=>e.#f(r),"isBackgroundFetch"),backgroundFetch:a((r,n,o,s)=>e.#U(r,n,o,s),"backgroundFetch"),moveToTail:a(r=>e.#O(r),"moveToTail"),indexes:a(r=>e.#I(r),"indexes"),rindexes:a(r=>e.#x(r),"rindexes"),isStale:a(r=>e.#E(r),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:_,memoMethod:E,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!YW(r))throw TypeError("max option must be a nonnegative integer");let x=r?Afo(r):Array;if(!x)throw Error("invalid max value: "+r);if(this.#e=r,this.#t=g,this.maxEntrySize=A||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw TypeError("memoMethod must be a function if defined");if(this.#o=E,_!==void 0&&typeof _!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#i=_,this.#S=!!_,this.#c=new Map,this.#u=Array(r).fill(void 0),this.#l=Array(r).fill(void 0),this.#p=new x(r),this.#g=new x(r),this.#A=0,this.#h=0,this.#v=sqr.create(r),this.#s=0,this.#a=0,typeof d=="function"&&(this.#r=d),typeof f=="function"?(this.#n=f,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#C=!!this.#r,this.#y=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!YW(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!YW(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=YW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!YW(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError("At least one of max, maxSize, or ttl is required");!this.ttlAutopurge&&!this.#e&&!this.#t&&Vcl("LRU_CACHE_UNBOUNDED")&&(mfo.add("LRU_CACHE_UNBOUNDED"),gfo("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",t))}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new UCe(this.#e),r=new UCe(this.#e);this.#_=e,this.#T=r,this.#L=(s,c,l=RCe.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#E(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?RCe.now():0},this.#d=(s,c)=>{if(e[c]){let l=e[c],u=r[c];if(!l||!u)return;s.ttl=l,s.start=u,s.now=n||o();let d=s.now-u;s.remainingTTL=l-d}};let n=0,o=a(()=>{let s=RCe.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"Y");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#E=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#E");#d=a(()=>{},"#R");#L=a(()=>{},"#y");#E=a(()=>!1,"#N");#D(){let e=new UCe(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#B=(r,n,o,s)=>{if(this.#f(n))return 0;if(!YW(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!YW(o))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#P=a(e=>{},"#b");#N=a((e,r,n)=>{},"#v");#B=a((e,r,n,o)=>{if(n||o)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#f");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#E(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#E(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#E(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#_&&this.#T){let c=this.#_[r],l=this.#T[r];if(c&&l){let u=c-(RCe.now()-l);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let e=[];for(let r of this.#I({allowStale:!0})){let n=this.#u[r],o=this.#l[r],s=this.#f(o)?o.__staleWhileFetching:o;if(s===void 0||n===void 0)continue;let c={value:s};if(this.#_&&this.#T){c.ttl=this.#_[r];let l=RCe.now()-this.#T[r];c.start=Math.floor(Date.now()-l)}this.#b&&(c.size=this.#b[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=RCe.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#B(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#v.length!==0?this.#v.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#C&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#C&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#P(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#_&&this.#k(),this.#_&&(d||this.#L(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(Error("evicted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#P(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#v.push(r)),this.#s===1?(this.#A=this.#h=0,this.#v.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#E(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#E(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new qkt,{signal:l}=n;l?.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let u={signal:c.signal,options:n,context:o},d=a((y,_=!1)=>{let{aborted:E}=c.signal,v=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(E&&!_?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),E&&!v&&!_)return h(c.signal.reason);let S=g;return this.#l[r]===g&&(y===void 0?S.__staleWhileFetching?this.#l[r]=S.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,u.options))),y},"H"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),h(y)),"q"),h=a(y=>{let{aborted:_}=c.signal,E=_&&n.allowStaleOnFetchAbort,v=E||n.allowStaleOnFetchRejection,S=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!S||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):E||(this.#l[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},"V"),m=a((y,_)=>{let E=this.#i?.(e,s,u);E&&E instanceof Promise&&E.then(v=>y(v===void 0?void 0:v),_),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(v=>d(v,!0),"w")))})},"B");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,f),A=Object.assign(g,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,A,{...u.options,status:void 0}),r=this.#c.get(e)):this.#l[r]=A,A}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof qkt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:_=!1,status:E,signal:v}=r;if(!this.#S)return E&&(E.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:E});let S={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:E,signal:v},T=this.#c.get(e);if(T===void 0){E&&(E.fetch="miss");let w=this.#U(e,T,S,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let D=n&&w.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",D&&(E.returnedStale=!0)),D?w.__staleWhileFetching:w.__returned=w}let R=this.#E(T);if(!_&&!R)return E&&(E.fetch="hit"),this.#O(T),o&&this.#R(T),E&&this.#d(E,T),w;let x=this.#U(e,T,S,y),k=x.__staleWhileFetching!==void 0&&n;return E&&(E.fetch=R?"stale":"refresh",k&&R&&(E.returnedStale=!0)),k?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#E(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#P(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#v.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(Error("deleted"));else{let o=this.#u[r];this.#C&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#_&&this.#T&&(this.#_.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#v.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};a(Wcl,"LE");zcl=8192;a(yfo,"AE");soo=Wcl(yfo,t=>t,50),LPt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>zcl?yfo(t,e):soo(t,e);return r.ok?r.value:null},{cache:soo.cache}),BPt=Wy(()=>{try{if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";if(process.platform==="linux"){if(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP)return"wsl";try{let t=ox().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){hu(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return hfo(t),"unknown"}}),Tpm=Wy(()=>{if(process.platform==="linux")try{let t=ox().readFileSync("/proc/version",{encoding:"utf8"}),e=t.match(/WSL(\d+)/i);return e&&e[1]?e[1]:t.toLowerCase().includes("microsoft")?"1":void 0}catch(t){hu(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),Ipm=Wy(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,aGr.release)()};try{let e=await(0,Efo.readFile)("/etc/os-release","utf8");for(let r of e.split(` -`)){let n=r.match(/^(ID|VERSION_ID)=(.*)$/);if(n&&n[1]&&n[2]){let o=n[2].replace(/^"|"$/g,"");n[1]==="ID"?t.linuxDistroId=o:t.linuxDistroVersion=o}}}catch{}return t}),xpm=Wy(()=>{if(process.platform!=="darwin")return;let t=(0,aGr.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),EUe=Wy(function(){switch(BPt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),wpm=Wy(function(){return(0,_fo.join)(EUe(),"managed-settings.d")}),Ycl=Dr(()=>G.object({allowedDomains:G.array(G.string()).optional(),deniedDomains:G.array(G.string()).optional().describe("Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly."),allowManagedDomainsOnly:G.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:G.array(G.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:G.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:G.boolean().optional(),allowMachLookup:G.array(G.string().refine(t=>!(t.endsWith("*")?t.slice(0,-1):t).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.'),httpProxyPort:G.number().optional(),socksProxyPort:G.number().optional(),tlsTerminate:G.object({caCertPath:G.string().min(1).optional(),caKeyPath:G.string().min(1).optional()}).optional().describe("[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session.")}).optional()),Kcl=Dr(()=>G.object({allowWrite:G.array(G.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:G.array(G.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:G.array(G.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:G.array(G.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:G.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used.")}).optional()),Jcl=Dr(()=>G.object({enabled:G.boolean().optional(),failIfUnavailable:G.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:G.boolean().optional(),allowUnsandboxedCommands:G.boolean().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:Ycl(),filesystem:Kcl(),ignoreViolations:G.record(G.string(),G.array(G.string())).optional(),enableWeakerNestedSandbox:G.boolean().optional(),enableWeakerNetworkIsolation:G.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** \u2014 opens a potential data exfiltration vector through the trustd service. Default: false"),excludedCommands:G.array(G.string()).optional(),ripgrep:G.object({command:G.string(),args:G.array(G.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support"),bwrapPath:G.preprocess(t=>typeof t=="string"&&(0,cqr.isAbsolute)(t)?t:void 0,G.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings."),socatPath:G.preprocess(t=>typeof t=="string"&&(0,cqr.isAbsolute)(t)?t:void 0,G.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough()),Zcl=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],Xcl=["normal","vim"],ell=["auto","tmux","in-process"],tll=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],rll=["auto",...tll],Rpm=BPt()==="macos"?"\u23FA":"\u25CF",cGr=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],nll=[...cGr,"bubble"],ill=nll,kpm=Dr(()=>Udo.enum(ill)),Ppm=Dr(()=>Udo.enum(cGr)),oll=["bash","powershell"],P6e=Dr(()=>G.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));a(sll,"Se");all=Dr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=sll();return G.discriminatedUnion("type",[t,e,r,n,o])}),cll=Dr(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(all()).describe("List of hooks to execute when the matcher matches")})),jkt=Dr(()=>G.partialRecord(G.enum(iPt),G.array(cll()))),Dpm=Dr(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),Npm=Dr(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),Cbe=Dr(()=>G.literal("comms").optional().catch(void 0)),uz=Dr(()=>G.number().int().positive()),lll=Dr(()=>G.object({type:G.literal("stdio").optional(),command:G.string().min(1,"Command cannot be empty"),args:G.array(G.string()).default([]),env:G.record(G.string(),G.string()).optional(),timeout:uz().optional(),alwaysLoad:G.boolean().optional(),role:Cbe()})),ull=Dr(()=>G.boolean()),vfo=Dr(()=>G.object({clientId:G.string().optional(),callbackPort:G.number().int().positive().optional(),authServerMetadataUrl:G.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:G.string().min(1).optional(),xaa:ull().optional()})),dll=Dr(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:vfo().optional(),timeout:uz().optional(),alwaysLoad:G.boolean().optional(),role:Cbe()})),fll=Dr(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional(),timeout:uz().optional(),alwaysLoad:G.boolean().optional(),role:Cbe()})),pll=Dr(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional(),timeout:uz().optional(),alwaysLoad:G.boolean().optional(),role:Cbe()})),hll=Dr(()=>G.object({type:G.enum(["http","streamable-http"]).transform(()=>"http"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:vfo().optional(),timeout:uz().optional(),alwaysLoad:G.boolean().optional(),role:Cbe()})),mll=Dr(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),timeout:uz().optional(),alwaysLoad:G.boolean().optional(),role:Cbe()})),gll=Dr(()=>G.object({type:G.literal("sdk"),name:G.string(),timeout:uz().optional(),alwaysLoad:G.boolean().optional()})),All=Dr(()=>G.enum(["allow","ask","blocked"])),yll=Dr(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string(),timeout:uz().optional(),alwaysLoad:G.boolean().optional(),toolPermissions:G.record(G.string(),All()).optional()})),lqr=Dr(()=>G.union([lll(),dll(),fll(),pll(),hll(),mll(),gll(),yll()])),Mpm=Dr(()=>G.object({mcpServers:G.record(G.string(),lqr())})),Cfo=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","anthropic-agent-skills","life-sciences","knowledge-work-plugins","claude-for-legal","claude-for-financial-services","financial-services-plugins"]),_ll=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,Ell=/[^\u0020-\u007E]/;a(vll,"pe");EM=Dr(()=>G.string().startsWith("./")),ese=Dr(()=>EM().endsWith(".json")),aoo=Dr(()=>G.union([EM().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),G.string().url().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),uqr=Dr(()=>EM().endsWith(".md")),dqr=Dr(()=>G.union([uqr(),EM()])),bfo=Dr(()=>G.string().min(1,"Marketplace must have a name").refine(t=>!t.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine(t=>!t.includes("/")&&!t.includes("\\")&&!t.includes("..")&&t!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine(t=>!vll(t),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).refine(t=>t.toLowerCase()!=="inline",{message:'Marketplace name "inline" is reserved for --plugin-dir session plugins'}).refine(t=>t.toLowerCase()!=="builtin",{message:'Marketplace name "builtin" is reserved for built-in plugins'}).refine(t=>t.toLowerCase()!=="skills-dir",{message:'Marketplace name "skills-dir" is reserved for plugins auto-loaded from .claude/skills/'})),lGr=Dr(()=>G.object({name:G.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:G.string().optional().describe("Contact email for support or feedback"),url:G.string().optional().describe("Website, GitHub profile, or organization URL")})),Cll=Dr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:G.string().optional().describe('Human-readable name shown in UI (e.g., "GitHub Utils"). Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing; not used for namespacing or lookup.'),version:G.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:G.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:lGr().optional().describe("Information about the plugin creator or maintainer"),homepage:G.string().url().optional().describe("Plugin homepage or documentation URL"),repository:G.string().optional().describe("Source code repository URL"),license:G.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:G.array(G.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:G.boolean().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:G.array(Vll()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),Opm=Dr(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>jkt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),bll=Dr(()=>G.object({hooks:G.union([ese().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>jkt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([ese().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>jkt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),Sll=Dr(()=>G.object({source:dqr().optional().describe("Path to command markdown file, relative to plugin root"),content:G.string().optional().describe("Inline markdown content for the command"),description:G.string().optional().describe("Command description override"),argumentHint:G.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:G.string().optional().describe("Default model for this command"),allowedTools:G.array(G.string()).optional().describe("Tools allowed when command runs")}).refine(t=>t.source&&!t.content||!t.source&&t.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),Tll=Dr(()=>G.object({commands:G.union([dqr().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(dqr().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of command file or skill directory paths. When set, the commands/ directory is not auto-loaded."),G.record(G.string(),Sll()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" \u2192 "/plugin:about")')])})),Ill=Dr(()=>G.object({agents:G.union([uqr().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(uqr().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of agent file paths. When set, the agents/ directory is not auto-loaded.")])})),xll=Dr(()=>G.object({skills:G.union([EM().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),G.array(EM().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory.")).describe("List of skill directory paths, loaded in addition to the skills/ directory.")])})),Sfo=Dr(()=>G.object({outputStyles:G.union([EM().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(EM().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of output-style directory or file paths. When set, the output-styles/ directory is not auto-loaded.")])})),Tfo=Dr(()=>G.object({themes:G.union([EM().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(EM().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of theme directory or file paths. When set, the themes/ directory is not auto-loaded.")])})),wll=Dr(()=>G.object({})),coo=Dr(()=>G.string().min(1)),Rll=Dr(()=>G.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),kll=Dr(()=>G.object({mcpServers:G.union([ese().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),aoo().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),lqr()).describe("MCP server configurations keyed by server name"),G.array(G.union([ese().describe("Path to MCP servers configuration file"),aoo().describe("Path or URL to MCPB file"),G.record(G.string(),lqr()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),Ifo=Dr(()=>G.object({type:G.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:G.string().describe("Human-readable label shown in the config dialog"),description:G.string().describe("Help text shown beneath the field in the config dialog"),required:G.boolean().optional().describe("If true, validation fails when this field is empty"),default:G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]).optional().describe("Default value used when the user provides nothing"),multiple:G.boolean().optional().describe("For string type: allow an array of strings"),sensitive:G.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:G.number().optional().describe("Minimum value (number type only)"),max:G.number().optional().describe("Maximum value (number type only)")}).strict()),Pll=Dr(()=>G.object({userConfig:G.record(G.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) \u2014 they become CLAUDE_PLUGIN_OPTION_ env vars in hooks"),Ifo()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage. Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Keep sensitive value counts small.")})),Dll=Dr(()=>G.object({channels:G.array(G.object({server:G.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:G.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:G.record(G.string(),Ifo()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),loo=Dr(()=>G.strictObject({command:G.string().min(1).refine(t=>!(t.includes(" ")&&!t.startsWith("/")),{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:G.array(coo()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(Rll(),coo()).refine(t=>Object.keys(t).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:G.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:G.record(G.string(),G.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:G.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:G.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:G.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:G.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:G.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:G.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:G.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")})),Nll=Dr(()=>G.strictObject({name:G.string().min(1).describe("Identifier for this monitor, unique within the plugin. Used to dedupe so re-arming (plugin reload, repeat skill invoke) does not spawn duplicates."),command:G.string().min(1).describe('Shell command to run as a persistent background monitor. Each stdout line is delivered to the model as a event; the process runs for the session lifetime. ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}, ${CLAUDE_PROJECT_DIR}, ${user_config.*}, and ${ENV_VAR} are substituted. Runs in the session cwd \u2014 prefix with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs its own directory.'),description:G.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:G.union([G.literal("always"),G.string().startsWith("on-skill-invoke:").refine(t=>t.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:" arms the first time that skill is dispatched (via Skill tool or slash command).')})),Mll=Dr(()=>G.array(Nll()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),xfo=Dr(()=>G.object({monitors:G.union([ese().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),Mll()]).describe("Background watch scripts the host arms as persistent Monitor tasks (unsandboxed, same trust tier as hooks) so plugins need not instruct the model to arm them. When omitted, monitors/monitors.json at the plugin root is loaded if present.")})),Oll=Dr(()=>G.object({lspServers:G.union([ese().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),loo()).describe("LSP server configurations keyed by server name"),G.array(G.union([ese().describe("Path to LSP configuration file"),G.record(G.string(),loo()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),wfo=Dr(()=>G.string().refine(t=>!t.includes("..")&&!t.includes("//"),"Package name cannot contain path traversal patterns").refine(t=>{let e=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,r=/^[a-z0-9][a-z0-9-._]*$/;return e.test(t)||r.test(t)},"Invalid npm package name format")),Lll=Dr(()=>G.object({settings:G.record(G.string(),G.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),Bll=Dr(()=>G.object({experimental:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,G.object({...Tfo().partial().shape,...xfo().partial().shape,...Sfo().partial().shape,evals:G.union([G.string(),G.array(G.string())]).optional().describe("Path(s) to evaluation query files for `claude plugin eval`. Defaults to `evals/`.")}).optional().describe("Components whose manifest shape may change without a deprecation cycle. Move a key out of here once it is promoted to stable."))})),Fll=Dr(()=>G.object({...Cll().shape,...bll().partial().shape,...Tll().partial().shape,...Ill().partial().shape,...xll().partial().shape,...Sfo().partial().shape,...Tfo().partial().shape,...wll().shape,...Dll().partial().shape,...kll().partial().shape,...Oll().partial().shape,...xfo().partial().shape,...Lll().partial().shape,...Pll().partial().shape,...Bll().partial().shape})),Hkt=Dr(()=>G.discriminatedUnion("source",[G.object({source:G.literal("url"),url:G.string().url().describe("Direct URL to marketplace.json file"),headers:G.record(G.string(),G.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:G.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),G.object({source:G.literal("git"),url:G.string().describe("Full git repository URL"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:G.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),G.object({source:G.literal("npm"),package:wfo().describe("NPM package containing marketplace.json")}),G.object({source:G.literal("file"),path:G.string().describe("Local file path to marketplace.json")}),G.object({source:G.literal("directory"),path:G.string().describe("Local directory containing .claude-plugin/marketplace.json")}),G.object({source:G.literal("skills-dir")}).describe("Policy-list sentinel for the ~/.claude/skills/ auto-load (@skills-dir plugins). In strictKnownMarketplaces: opt the scan back IN (by default any allowlist blocks it). In blockedMarketplaces: turn the scan OFF without otherwise restricting marketplaces. Only meaningful in those two managed-settings lists (areLocalPluginDirsAllowedByPolicy); known_marketplaces.json / marketplace add etc. ignore it."),G.object({source:G.literal("hostPattern"),hostPattern:G.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),G.object({source:G.literal("pathPattern"),pathPattern:G.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),G.object({source:G.literal("settings"),name:bfo().refine(t=>!Cfo.has(t.toLowerCase()),{message:"Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection \u2014 validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:G.array(Ull()).describe("Plugin entries declared inline in settings.json"),owner:lGr().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),z7r=Dr(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),Rfo=Dr(()=>G.union([EM().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),G.object({source:G.literal("npm"),package:wfo().or(G.string().refine(t=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(t)||!t.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:G.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:G.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),G.object({source:G.literal("url"),url:G.string().describe("Full git repository URL (https:// or git@)"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:z7r().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:z7r().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("git-subdir"),url:G.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:G.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:z7r().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded."),G.object({source:G.literal("unsupported")}).describe('Placeholder for source types this Claude Code version does not recognize. Never authored by hand \u2014 PluginMarketplaceSchema rewrites unparseable sources to this so the entry remains in marketplace.plugins (detectDelistedPlugins must not see it as removed). Install attempts fail at cachePlugin with a clear "update Claude Code" message.')])),Ull=Dr(()=>G.object({name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:Rfo().describe("Where to fetch the plugin from. Must be a remote source \u2014 relative paths have no marketplace repository to resolve against."),description:G.string().optional(),version:G.string().optional(),strict:G.boolean().optional()}).refine(t=>typeof t.source!="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine(t=>typeof t.source=="string"||t.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url)."})),Qll=Dr(()=>G.object({cli:G.array(G.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) \u2014 exact match against commands run this session.'),hosts:G.array(G.string().max(128)).max(20).optional().describe('Hostnames (e.g. ["api.stripe.com"]) \u2014 exact, case-insensitive match against hostnames seen in https?:// URLs in bash commands run this session. Bare hostname only: lowercase, no scheme, no port, no path.'),filesRead:G.array(G.string().max(256)).max(10).optional().describe('Glob patterns (e.g. ["**/*.tf"]) \u2014 the plugin is relevant when a file Claude has read this session matches any pattern. Matched against read-file paths, forward-slash normalized, case-insensitive.'),manifestDeps:G.array(G.object({file:G.string().max(256),pattern:G.string().max(256)})).max(10).optional().describe("Dependency declared in a package manifest. Each {file, pattern} is a pair of RegExp sources: `file` matches the manifest filename (package.json, go.mod, requirements.txt, \u2026); `pattern` matches the dependency declaration inside that file. Evaluated against files read this session."),cwd:G.array(G.string().max(256)).max(10).optional().describe(`Glob patterns (e.g. ["Engine/Source/Runtime/Renderer/**"]) \u2014 the plugin is relevant when the session's working directory is at or under a directory matching the pattern. Matched against the cwd both relative to the enclosing git repo root and as an absolute path, forward-slash normalized, case-insensitive. A bare directory (no glob characters) means "cwd is at or under this directory". Known at session start, so this signal can surface a suggestion before the first turn.`)})),qll=Dr(()=>G.object({topic:G.string().max(64).optional().describe('What the user is working with when this plugin is relevant \u2014 fills "Working with {topic}?". Often the product name (e.g. "Stripe"); use a domain (e.g. "design") when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen-segment capitalized.'),signals:Qll().optional().describe("Matchers that determine when the plugin is relevant.")})),jll=Dr(()=>Fll().partial().extend({name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:Rfo().describe("Where to fetch the plugin from"),category:G.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:G.array(G.string()).optional().describe("Tags for searchability and discovery"),strict:G.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest."),relevance:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,qll().optional()).describe(`Declares when this plugin is relevant to the user's work. Consumed by the spinner tip ("Working with {topic}?"), session-start auto-suggest, and marketplace browse ranking.`)})),Hll=Dr(()=>G.object({name:G.string().min(1).refine(t=>!t.includes(" "))}));a(Gll,"z$$");Lpm=Dr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:bfo(),version:G.string().optional().describe("Marketplace manifest version"),description:G.string().optional().describe("Human-readable description of this marketplace"),owner:lGr().describe("Marketplace maintainer or curator information"),plugins:G.array(G.unknown()).transform(Gll).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:G.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:G.object({pluginRoot:G.string().optional().describe("Base path for relative plugin sources"),version:G.string().optional().describe("Marketplace version"),description:G.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:G.array(G.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies \u2014 no transitive trust.")})),kfo=Dr(()=>G.string().regex(/^[A-Za-z0-9][-A-Za-z0-9._]*@[A-Za-z0-9][-A-Za-z0-9._]*$/,"Plugin ID must be in format: plugin@marketplace")),$ll=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,Vll=Dr(()=>G.union([G.string().regex($ll,"Dependency must be a plugin name, optionally qualified with @marketplace").transform(t=>t.replace(/@\^[^@]*$/,"")),G.object({name:G.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:G.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform(t=>t.marketplace?`${t.name}@${t.marketplace}`:t.name)])),Wll=Dr(()=>G.object({version:G.string().describe("Currently installed version"),installedAt:G.string().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),installPath:G.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:G.string().optional().describe("Tag-derived semver this install resolved to (when fetched via a version constraint). Used by verifyAndDemote in preference to manifest.version, since the upstream may have forgotten to bump plugin.json."),auto:G.boolean().optional().describe("True when this plugin was pulled in as a dependency rather than installed explicitly. Auto-installed plugins are eligible for removal by the orphan sweep when nothing depends on them. Absent = manual (preserves pre-flag installs).")})),zll=Dr(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(kfo(),Wll()).describe("Map of plugin IDs to their installation metadata")})),Yll=Dr(()=>G.enum(["managed","user","project","local"])),Kll=Dr(()=>G.object({scope:Yll().describe("Installation scope"),projectPath:G.string().optional().describe("Project path (required for project/local scopes)"),installPath:G.string().describe("Absolute path to the versioned plugin directory"),version:G.string().optional().describe("Currently installed version"),installedAt:G.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:G.string().optional().describe("Tag-derived semver this install resolved to"),auto:G.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep.")})),Jll=Dr(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(kfo(),G.array(Kll())).describe("Map of plugin IDs to arrays of installation entries")})),Bpm=Dr(()=>G.union([zll(),Jll()])),Zll=Dr(()=>G.object({source:Hkt().describe("Where to fetch the marketplace from"),installLocation:G.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:G.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Fpm=Dr(()=>G.record(G.string(),Zll())),Xll=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],eul="https://json.schemastore.org/claude-code-settings.json",tul=["autoMode","deepLink","voice","assistant","briefView"],TRt={},FPt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>TRt,"shape"),permissionsShape:a(()=>TRt,"permissionsShape"),permissionModes:a(()=>[],"permissionModes")},deepLink:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({disableDeepLinkRegistration:G.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")}),"shape")},voice:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>TRt,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>TRt,"shape")},briefView:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({defaultView:G.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")}),"shape")}};a(Pfo,"Ez");a(rul,"tE");a(nul,"aE");a(iul,"sE");a(oul,"eE");uoo={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(kCe,"E9");Dfo="workspace",Upm=`mcp__${Dfo}__bash`,Qpm=`mcp__${Dfo}__web_fetch`;a(sul,"A$$");a(aul,"Jb");a(cul,"I$$");a(lul,"R$$");Gkt={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit"],bashPrefixTools:["Bash"],customValidation:{WebSearch:a(t=>t.includes("*")||t.includes("?")?{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]}:{valid:!0},"WebSearch"),WebFetch:a(t=>t.includes("://")||t.startsWith("http")?{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]}:t.startsWith("domain:")?{valid:!0}:{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]},"WebFetch")}};a(uul,"Xb");a(dul,"Yb");a(ful,"Wb");a(Nfo,"Gb");a(Y7r,"bz");a(pul,"P$$");a(Mfo,"_z");K7r=Dr(()=>G.string().superRefine((t,e)=>{let r=Mfo(t);if(!r.valid){let n=r.error;r.suggestion&&(n+=`. ${r.suggestion}`),r.examples&&r.examples.length>0&&(n+=`. Examples: ${r.examples.join(", ")}`),e.addIssue({code:G.ZodIssueCode.custom,message:n,params:{received:t}})}})),hul=Dr(()=>G.record(G.string(),G.coerce.string()));a(Ofo,"Hb");qpm=Dr(()=>Ofo(Pfo())),mul=Dr(()=>G.object({source:Hkt().describe("Where to fetch the marketplace from"),installLocation:G.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Lfo=Dr(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine(t=>Lao([t.serverName!==void 0,t.serverCommand!==void 0,t.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),Bfo=Dr(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine(t=>Lao([t.serverName!==void 0,t.serverCommand!==void 0,t.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),gul=Dr(()=>G.object({path:G.string().describe("Absolute path to the helper executable"),timeoutMs:G.number().int().min(1e3).optional(),refreshIntervalMs:G.union([G.literal(0),G.number().int().min(6e4)]).optional()})),doo=["skills","agents","hooks","mcp"];a(Aul,"Kb");bbe=Dr(()=>Aul(Pfo())),w9="https://code.claude.com/docs/en",yul=[{matches:a(t=>t.path==="permissions.defaultMode"&&t.code==="invalid_value","matches"),tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${w9}/iam#permission-modes`}},{matches:a(t=>t.path==="apiKeyHelper"&&t.code==="invalid_type","matches"),tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:a(t=>t.path==="cleanupPeriodDays"&&t.code==="too_small","matches"),tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:a(t=>t.path.startsWith("env.")&&t.code==="invalid_type","matches"),tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${w9}/settings#environment-variables`}},{matches:a(t=>(t.path==="permissions.allow"||t.path==="permissions.deny")&&t.code==="invalid_type"&&t.expected==="array","matches"),tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:a(t=>t.path.startsWith("hooks.")&&t.code==="invalid_key","matches"),tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${w9}/hooks`}},{matches:a(t=>/\.hooks\.\d+\.command$/.test(t.path)&&t.code==="invalid_type"&&t.received==="undefined","matches"),tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${w9}/hooks#exec-form-and-shell-form`}},{matches:a(t=>t.path.includes("hooks")&&t.code==="invalid_type","matches"),tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:a(t=>t.code==="invalid_type"&&t.expected==="boolean","matches"),tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:a(t=>t.code==="unrecognized_keys","matches"),tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${w9}/settings`}},{matches:a(t=>t.code==="invalid_value"&&t.enumValues!==void 0,"matches"),tip:{suggestion:void 0}},{matches:a(t=>t.code==="invalid_type"&&t.expected==="object"&&t.received===null&&t.path==="","matches"),tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:a(t=>t.path==="permissions.additionalDirectories"&&t.code==="invalid_type","matches"),tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${w9}/iam#working-directories`}}],_ul={permissions:`${w9}/iam#configuring-permissions`,env:`${w9}/settings#environment-variables`,hooks:`${w9}/hooks`};a(Eul,"qb");jpm=Dr(()=>bbe().strict());a(foo,"Vb");a(poo,"Bb");a(vul,"v$$");a(hoo,"zb");a(QCe,"b9");a(moo,"Nb");a(UUe,"d0");a(Cul,"C$$");bul=new Set(iPt);a(Sul,"x$$");Tul=[{key:"allowedMcpServers",schema:Lfo},{key:"deniedMcpServers",schema:Bfo}];a(Iul,"f$$");a(Sbe,"i1");goo="com.anthropic.claudecode",fqr="HKLM\\SOFTWARE\\Policies\\ClaudeCode",pqr="HKCU\\SOFTWARE\\Policies\\ClaudeCode",LCe="Settings",xul="/usr/bin/plutil",wul=["-convert","json","-o","-","--"],Rul=5e3,Aoo="/mnt/c/Windows/System32/reg.exe",$kt="/mnt/c/Program Files/ClaudeCode";a(Ufo,"XG");a(kul,"Zb");Pul=null;a(D6e,"$5");a(Dul,"Mb");a(Nul,"Lb");JW=Object.freeze({settings:{},errors:[]}),jfo=null,Hfo=null,Gfo=!1,Vkt=null;a(Mul,"l$$");a(Oul,"bb");a(Lul,"_b");a(Bul,"kb");a(Ful,"Sb");a(J7r,"Cz");a(yoo,"jb");a(Uul,"c$$");a(Qul,"p$$");a(_oo,"Ab");a(qul,"d$$");a(Eoo,"Ib");a(jul,"i$$");hqr=jul;a(Hul,"n$$");Gul=Hul,$ul=Gul(),Vul=$ul;a(Wul,"o$$");zul=Wul,Yul="[object Object]",Kul=Function.prototype,Jul=Object.prototype,$fo=Kul.toString,Zul=Jul.hasOwnProperty,Xul=$fo.call(Object);a(edl,"Q6$");tdl=edl;a(rdl,"J6$");mqr=rdl;a(ndl,"X6$");idl=ndl;a(odl,"Y6$");sdl=odl;a(Vfo,"hb");adl=Vfo;a(cdl,"W6$");ldl=cdl,voo=Math.max;a(udl,"G6$");Wfo=udl;a(ddl,"U6$");fdl=ddl,pdl=ukt?function(t,e){return ukt(t,"toString",{configurable:!0,enumerable:!1,value:fdl(e),writable:!0})}:eao,hdl=pdl,mdl=800,gdl=16,Adl=Date.now;a(ydl,"B6$");_dl=ydl,Edl=_dl(hdl),zfo=Edl;a(vdl,"N6$");Cdl=vdl;a(bdl,"w6$");Sdl=bdl;a(Tdl,"O6$");Idl=Tdl,xdl=Idl(function(t,e,r,n){adl(t,e,r,n)}),ez=xdl;a(wdl,"F6$");Rdl=wdl;a(kdl,"Z6$");Pdl=kdl;a(Ddl,"M6$");Ndl=Ddl,Coo=nz?nz.isConcatSpreadable:void 0;a(Mdl,"L6$");Odl=Mdl;a(Yfo,"$_");Ldl=Yfo;a(Bdl,"j6$");Fdl=Bdl;a(Udl,"A6$");Qdl=Udl,qdl=Qdl(function(t,e){return t==null?{}:Ndl(t,e)}),Z7r=qdl,jdl="remote-settings.json",X7r=null;a(Gdl,"b6$");a($dl,"_6$");a(Vdl,"W_");a(uGr,"fz");a(Wdl,"S6$");a(Jfo,"U_");a(eQr,"xz");a(zdl,"v6$");a(Wkt,"HG");a(Zfo,"H_");a(Xfo,"K_");a(epo,"q_");a(tpo,"V_");a(Ydl,"C6$");a(boo,"G_");a(Kdl,"T6$");a(zkt,"Y5");a(Jdl,"x6$");a(rpo,"B_");a(Zdl,"y6$");a(Xdl,"f6$");a(efl,"z_");a(tfl,"g6$");a(npo,"N_");a(rfl,"h6$");a(nfl,"u6$");a(tz,"o1");tQr=!1;a(ifl,"m6$");a(ofl,"l6$");a(sfl,"c6$");a(afl,"w_");a(cfl,"O_");lfl={user:"userSettings",project:"projectSettings",local:"localSettings"},Soo={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},ufl=["user","project","local"],dfl=new Set(["bypassPermissions","auto","acceptEdits"]),ffl=new Set(["project"]);a(pfl,"o6$");a(hfl,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(mfl,"LA$");a(gfl,"G4$");a(Afl,"U4$");a(yfl,"H4$");a(ipo,"b_");a(gqr,"uz");a(Aqr,"mz");_fl=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(Ykt,"KG");a(Efl,"q4$");a(vfl,"jA$");a(Cfl,"AA$");a(bfl,"IA$");a(Sfl,"RA$");a(Tfl,"PA$");a(Ifl,"EA$");a(xfl,"bA$");a(wfl,"_A$");a(Rfl,"kA$");a(kfl,"SA$");a(Too,"M_");a(Pfl,"V4$");a(Dfl,"vA$");a(Nfl,"CA$");a(opo,"__");a(Zk,"J4");a(spo,"k_");a(Ioo,"L_");a(yqr,"lz");a(Mfl,"B4$");a(xoo,"j_");a(apo,"S_");a(Ofl,"z4$");a(cpo,"v_");a(Lfl,"N4$");a(Bfl,"w4$");a(Ffl,"O4$");a(Ufl,"D4$");a(Qfl,"F4$");a(qfl,"Z4$");a(jfl,"M4$");a(woo,"A_")});var Mho=I((QGr,Nho)=>{p();QGr.createWatcher=F9e()("vscode-policy-watcher");if(require.main===Nho){let t=process.platform;QGr.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var ymo=I(zGr=>{p();var Amo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");zGr.encode=function(t){if(0<=t&&t{p();var _mo=ymo(),YGr=5,Emo=1<>1;return e?-r:r}a(zhl,"fromVLQSigned");KGr.encode=a(function(e){var r="",n,o=Whl(e);do n=o&vmo,o>>>=YGr,o>0&&(n|=Cmo),r+=_mo.encode(n);while(o>0);return r},"base64VLQ_encode");KGr.decode=a(function(e,r,n){var o=e.length,s=0,c=0,l,u;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(u=_mo.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&Cmo),u&=vmo,s=s+(u<{p();function Yhl(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}a(Yhl,"getArg");kE.getArg=Yhl;var bmo=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Khl=/^data:.+\,.+$/;function A9e(t){var e=t.match(bmo);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(A9e,"urlParse");kE.urlParse=A9e;function Qbe(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}a(Qbe,"urlGenerate");kE.urlGenerate=Qbe;function ZGr(t){var e=t,r=A9e(t);if(r){if(!r.path)return t;e=r.path}for(var n=kE.isAbsolute(e),o=e.split(/\/+/),s,c=0,l=o.length-1;l>=0;l--)s=o[l],s==="."?o.splice(l,1):s===".."?c++:c>0&&(s===""?(o.splice(l+1,c),c=0):(o.splice(l,2),c--));return e=o.join("/"),e===""&&(e=n?"/":"."),r?(r.path=e,Qbe(r)):e}a(ZGr,"normalize");kE.normalize=ZGr;function Smo(t,e){t===""&&(t="."),e===""&&(e=".");var r=A9e(e),n=A9e(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Qbe(r);if(r||e.match(Khl))return e;if(n&&!n.host&&!n.path)return n.host=e,Qbe(n);var o=e.charAt(0)==="/"?e:ZGr(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,Qbe(n)):o}a(Smo,"join");kE.join=Smo;kE.isAbsolute=function(t){return t.charAt(0)==="/"||bmo.test(t)};function Jhl(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}a(Jhl,"relative");kE.relative=Jhl;var Tmo=(function(){var t=Object.create(null);return!("__proto__"in t)})();function Imo(t){return t}a(Imo,"identity");function Zhl(t){return xmo(t)?"$"+t:t}a(Zhl,"toSetString");kE.toSetString=Tmo?Imo:Zhl;function Xhl(t){return xmo(t)?t.slice(1):t}a(Xhl,"fromSetString");kE.fromSetString=Tmo?Imo:Xhl;function xmo(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}a(xmo,"isProtoString");function eml(t,e,r){var n=qbe(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:qbe(t.name,e.name)}a(eml,"compareByOriginalPositions");kE.compareByOriginalPositions=eml;function tml(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=qbe(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:qbe(t.name,e.name)}a(tml,"compareByGeneratedPositionsDeflated");kE.compareByGeneratedPositionsDeflated=tml;function qbe(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(qbe,"strcmp");function rml(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=qbe(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:qbe(t.name,e.name)}a(rml,"compareByGeneratedPositionsInflated");kE.compareByGeneratedPositionsInflated=rml;function nml(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(nml,"parseSourceMapInput");kE.parseSourceMapInput=nml;function iml(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=A9e(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}e=Smo(Qbe(n),e)}return ZGr(e)}a(iml,"computeSourceURL");kE.computeSourceURL=iml});var t$r=I(wmo=>{p();var XGr=jbe(),e$r=Object.prototype.hasOwnProperty,lse=typeof Map<"u";function U9(){this._array=[],this._set=lse?new Map:Object.create(null)}a(U9,"ArraySet");U9.fromArray=a(function(e,r){for(var n=new U9,o=0,s=e.length;o=0)return r}else{var n=XGr.toSetString(e);if(e$r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");U9.prototype.at=a(function(e){if(e>=0&&e{p();var Rmo=jbe();function oml(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Rmo.compareByGeneratedPositionsInflated(t,e)<=0}a(oml,"generatedPositionAfter");function lDt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(lDt,"MappingList");lDt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");lDt.prototype.add=a(function(e){oml(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");lDt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Rmo.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");kmo.MappingList=lDt});var r$r=I(Dmo=>{p();var y9e=JGr(),eg=jbe(),uDt=t$r().ArraySet,sml=Pmo().MappingList;function nP(t){t||(t={}),this._file=eg.getArg(t,"file",null),this._sourceRoot=eg.getArg(t,"sourceRoot",null),this._skipValidation=eg.getArg(t,"skipValidation",!1),this._sources=new uDt,this._names=new uDt,this._mappings=new sml,this._sourcesContents=null}a(nP,"SourceMapGenerator");nP.prototype._version=3;nP.fromSourceMap=a(function(e){var r=e.sourceRoot,n=new nP({file:e.file,sourceRoot:r});return e.eachMapping(function(o){var s={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(s.source=o.source,r!=null&&(s.source=eg.relative(r,s.source)),s.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(s.name=o.name)),n.addMapping(s)}),e.sources.forEach(function(o){var s=o;r!==null&&(s=eg.relative(r,o)),n._sources.has(s)||n._sources.add(s);var c=e.sourceContentFor(o);c!=null&&n.setSourceContent(o,c)}),n},"SourceMapGenerator_fromSourceMap");nP.prototype.addMapping=a(function(e){var r=eg.getArg(e,"generated"),n=eg.getArg(e,"original",null),o=eg.getArg(e,"source",null),s=eg.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,o,s),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:s})},"SourceMapGenerator_addMapping");nP.prototype.setSourceContent=a(function(e,r){var n=e;this._sourceRoot!=null&&(n=eg.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[eg.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[eg.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");nP.prototype.applySourceMap=a(function(e,r,n){var o=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var s=this._sourceRoot;s!=null&&(o=eg.relative(s,o));var c=new uDt,l=new uDt;this._mappings.unsortedForEach(function(u){if(u.source===o&&u.originalLine!=null){var d=e.originalPositionFor({line:u.originalLine,column:u.originalColumn});d.source!=null&&(u.source=d.source,n!=null&&(u.source=eg.join(n,u.source)),s!=null&&(u.source=eg.relative(s,u.source)),u.originalLine=d.line,u.originalColumn=d.column,d.name!=null&&(u.name=d.name))}var f=u.source;f!=null&&!c.has(f)&&c.add(f);var h=u.name;h!=null&&!l.has(h)&&l.add(h)},this),this._sources=c,this._names=l,e.sources.forEach(function(u){var d=e.sourceContentFor(u);d!=null&&(n!=null&&(u=eg.join(n,u)),s!=null&&(u=eg.relative(s,u)),this.setSourceContent(u,d))},this)},"SourceMapGenerator_applySourceMap");nP.prototype._validateMapping=a(function(e,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!o)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:o}))}},"SourceMapGenerator_validateMapping");nP.prototype._serializeMappings=a(function(){for(var e=0,r=1,n=0,o=0,s=0,c=0,l="",u,d,f,h,m=this._mappings.toArray(),g=0,A=m.length;g0){if(!eg.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=y9e.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=y9e.encode(h-c),c=h,u+=y9e.encode(d.originalLine-1-o),o=d.originalLine-1,u+=y9e.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=y9e.encode(f-s),s=f)),l+=u}return l},"SourceMapGenerator_serializeMappings");nP.prototype._generateSourcesContent=a(function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=eg.relative(r,n));var o=eg.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)},"SourceMapGenerator_generateSourcesContent");nP.prototype.toJSON=a(function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},"SourceMapGenerator_toJSON");nP.prototype.toString=a(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");Dmo.SourceMapGenerator=nP});var Nmo=I(use=>{p();use.GREATEST_LOWER_BOUND=1;use.LEAST_UPPER_BOUND=2;function n$r(t,e,r,n,o,s){var c=Math.floor((e-t)/2)+t,l=o(r,n[c],!0);return l===0?c:l>0?e-c>1?n$r(c,e,r,n,o,s):s==use.LEAST_UPPER_BOUND?e1?n$r(t,c,r,n,o,s):s==use.LEAST_UPPER_BOUND?c:t<0?-1:t}a(n$r,"recursiveSearch");use.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=n$r(-1,r.length,e,r,n,o||use.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(r[s],r[s-1],!0)===0;)--s;return s},"search")});var Omo=I(Mmo=>{p();function i$r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a(i$r,"swap");function aml(t,e){return Math.round(t+Math.random()*(e-t))}a(aml,"randomIntInRange");function o$r(t,e,r,n){if(r{p();var Vn=jbe(),s$r=Nmo(),Hbe=t$r().ArraySet,cml=JGr(),_9e=Omo().quickSort;function Fd(t,e){var r=t;return typeof t=="string"&&(r=Vn.parseSourceMapInput(t)),r.sections!=null?new RM(r,e):new Ky(r,e)}a(Fd,"SourceMapConsumer");Fd.fromSourceMap=function(t,e){return Ky.fromSourceMap(t,e)};Fd.prototype._version=3;Fd.prototype.__generatedMappings=null;Object.defineProperty(Fd.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Fd.prototype.__originalMappings=null;Object.defineProperty(Fd.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Fd.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Fd.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Fd.GENERATED_ORDER=1;Fd.ORIGINAL_ORDER=2;Fd.GREATEST_LOWER_BOUND=1;Fd.LEAST_UPPER_BOUND=2;Fd.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||Fd.GENERATED_ORDER,c;switch(s){case Fd.GENERATED_ORDER:c=this._generatedMappings;break;case Fd.ORIGINAL_ORDER:c=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;c.map(function(u){var d=u.source===null?null:this._sources.at(u.source);return d=Vn.computeSourceURL(l,d,this._sourceMapURL),{source:d,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(e,o)},"SourceMapConsumer_eachMapping");Fd.prototype.allGeneratedPositionsFor=a(function(e){var r=Vn.getArg(e,"line"),n={source:Vn.getArg(e,"source"),originalLine:r,originalColumn:Vn.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Vn.compareByOriginalPositions,s$r.LEAST_UPPER_BOUND);if(s>=0){var c=this._originalMappings[s];if(e.column===void 0)for(var l=c.originalLine;c&&c.originalLine===l;)o.push({line:Vn.getArg(c,"generatedLine",null),column:Vn.getArg(c,"generatedColumn",null),lastColumn:Vn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:Vn.getArg(c,"generatedLine",null),column:Vn.getArg(c,"generatedColumn",null),lastColumn:Vn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");dDt.SourceMapConsumer=Fd;function Ky(t,e){var r=t;typeof t=="string"&&(r=Vn.parseSourceMapInput(t));var n=Vn.getArg(r,"version"),o=Vn.getArg(r,"sources"),s=Vn.getArg(r,"names",[]),c=Vn.getArg(r,"sourceRoot",null),l=Vn.getArg(r,"sourcesContent",null),u=Vn.getArg(r,"mappings"),d=Vn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=Vn.normalize(c)),o=o.map(String).map(Vn.normalize).map(function(f){return c&&Vn.isAbsolute(c)&&Vn.isAbsolute(f)?Vn.relative(c,f):f}),this._names=Hbe.fromArray(s.map(String),!0),this._sources=Hbe.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return Vn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(Ky,"BasicSourceMapConsumer");Ky.prototype=Object.create(Fd.prototype);Ky.prototype.consumer=Fd;Ky.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Vn.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r1&&(y.source=l+E[1],l+=E[1],y.originalLine=s+E[2],s=y.originalLine,y.originalLine+=1,y.originalColumn=c+E[3],c=y.originalColumn,E.length>4&&(y.name=u+E[4],u+=E[4])),A.push(y),typeof y.originalLine=="number"&&g.push(y)}_9e(A,Vn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,_9e(g,Vn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");Ky.prototype._findMapping=a(function(e,r,n,o,s,c){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return s$r.search(e,r,s,c)},"SourceMapConsumer_findMapping");Ky.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=Vn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=Vn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=Vn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:Vn.getArg(o,"originalLine",null),column:Vn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");Ky.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");Ky.prototype.sourceContentFor=a(function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=Vn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=Vn.urlParse(this.sourceRoot))){var c=o.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(c))return this.sourcesContent[this._sources.indexOf(c)];if((!s.path||s.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(r)return null;throw new Error('"'+o+'" is not in the SourceMap.')},"SourceMapConsumer_sourceContentFor");Ky.prototype.generatedPositionFor=a(function(e){var r=Vn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:Vn.getArg(e,"line"),originalColumn:Vn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Vn.compareByOriginalPositions,Vn.getArg(e,"bias",Fd.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:Vn.getArg(s,"generatedLine",null),column:Vn.getArg(s,"generatedColumn",null),lastColumn:Vn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");dDt.BasicSourceMapConsumer=Ky;function RM(t,e){var r=t;typeof t=="string"&&(r=Vn.parseSourceMapInput(t));var n=Vn.getArg(r,"version"),o=Vn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Hbe,this._names=new Hbe;var s={line:-1,column:0};this._sections=o.map(function(c){if(c.url)throw new Error("Support for url field in sections not implemented.");var l=Vn.getArg(c,"offset"),u=Vn.getArg(l,"line"),d=Vn.getArg(l,"column");if(u{p();var lml=r$r().SourceMapGenerator,fDt=jbe(),uml=/(\r?\n)/,dml=10,Gbe="$$$isSourceNode$$$";function ux(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=o??null,this[Gbe]=!0,n!=null&&this.add(n)}a(ux,"SourceNode");ux.fromStringWithSourceMap=a(function(e,r,n){var o=new ux,s=e.split(uml),c=0,l=a(function(){var m=A(),g=A()||"";return m+g;function A(){return c=0;r--)this.prepend(e[r]);else if(e[Gbe]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this},"SourceNode_prepend");ux.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();pDt.SourceMapGenerator=r$r().SourceMapGenerator;pDt.SourceMapConsumer=Bmo().SourceMapConsumer;pDt.SourceNode=Umo().SourceNode});var jmo=I((bkm,qmo)=>{p();var fml=Object.prototype.toString,a$r=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function pml(t){return fml.call(t).slice(8,-1)==="ArrayBuffer"}a(pml,"isArrayBuffer");function hml(t,e,r){e>>>=0;var n=t.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(r===void 0)r=n;else if(r>>>=0,r>n)throw new RangeError("'length' is out of bounds");return a$r?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(hml,"fromArrayBuffer");function mml(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return a$r?Buffer.from(t,e):new Buffer(t,e)}a(mml,"fromString");function gml(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return pml(t)?hml(t,e,r):typeof t=="string"?mml(t,e):a$r?Buffer.from(t):new Buffer(t)}a(gml,"bufferFrom");qmo.exports=gml});var Kmo=I((fse,d$r)=>{p();var Aml=Qmo().SourceMapConsumer,c$r=require("path"),NB;try{NB=require("fs"),(!NB.existsSync||!NB.readFileSync)&&(NB=null)}catch{}var yml=jmo();function Hmo(t,e){return t.require(e)}a(Hmo,"dynamicRequire");var Gmo=!1,$mo=!1,l$r=!1,E9e="auto",dse={},v9e={},_ml=/^data:application\/json[^,]+base64,/,Az=[],yz=[];function f$r(){return E9e==="browser"?!0:E9e==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(f$r,"isInBrowser");function Eml(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a(Eml,"hasGlobalProcessEventEmitter");function vml(){return typeof process=="object"&&process!==null?process.version:""}a(vml,"globalProcessVersion");function Cml(){if(typeof process=="object"&&process!==null)return process.stderr}a(Cml,"globalProcessStderr");function bml(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(bml,"globalProcessExit");function hDt(t){return function(e){for(var r=0;r";var r=this.getLineNumber();if(r!=null){e+=":"+r;var n=this.getColumnNumber();n&&(e+=":"+n)}}var o="",s=this.getFunctionName(),c=!0,l=this.isConstructor(),u=!(this.isToplevel()||l);if(u){var d=this.getTypeName();d==="[object Object]"&&(d="null");var f=this.getMethodName();s?(d&&s.indexOf(d)!=0&&(o+=d+"."),o+=s,f&&s.indexOf("."+f)!=s.length-f.length-1&&(o+=" [as "+f+"]")):o+=d+"."+(f||"")}else l?o+="new "+(s||""):s?o+=s:(o+=e,c=!1);return c&&(o+=" ("+e+")"),o}a(Tml,"CallSiteToString");function Vmo(t){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(function(r){e[r]=/^(?:is|get)/.test(r)?function(){return t[r].call(t)}:t[r]}),e.toString=Tml,e}a(Vmo,"cloneCallSite");function zmo(t,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),t.isNative())return e.curPosition=null,t;var r=t.getFileName()||t.getScriptNameOrSourceURL();if(r){var n=t.getLineNumber(),o=t.getColumnNumber()-1,s=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,c=s.test(vml())?0:62;n===1&&o>c&&!f$r()&&!t.isEval()&&(o-=c);var l=m$r({source:r,line:n,column:o});e.curPosition=l,t=Vmo(t);var u=t.getFunctionName;return t.getFunctionName=function(){return e.nextPosition==null?u():e.nextPosition.name||u()},t.getFileName=function(){return l.source},t.getLineNumber=function(){return l.line},t.getColumnNumber=function(){return l.column+1},t.getScriptNameOrSourceURL=function(){return l.source},t}var d=t.isEval()&&t.getEvalOrigin();return d&&(d=Wmo(d),t=Vmo(t),t.getEvalOrigin=function(){return d}),t}a(zmo,"wrapCallSite");function Iml(t,e){l$r&&(dse={},v9e={});for(var r=t.name||"Error",n=t.message||"",o=r+": "+n,s={nextPosition:null,curPosition:null},c=[],l=e.length-1;l>=0;l--)c.push(` - at `+zmo(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(Iml,"prepareStackTrace");function Ymo(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=dse[r];if(!s&&NB&&NB.existsSync(r))try{s=NB.readFileSync(r,"utf8")}catch{s=""}if(s){var c=s.split(/(?:\r\n|\r|\n)/)[n-1];if(c)return r+":"+n+` +`+" ".repeat(e))}};(function(t){t.DEFAULT={allowTrailingComma:!1}})(roo||(roo={}));(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(noo||(noo={}));(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(ioo||(ioo={}));(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(ooo||(ooo={}));a(mfo,"rW");ez=sGr.default.homedir(),aGr=sGr.default.tmpdir(),{env:OCe}=qkt.default,Ucl=a(t=>{let e=gf.default.join(ez,"Library");return{data:gf.default.join(e,"Application Support",t),config:gf.default.join(e,"Preferences",t),cache:gf.default.join(e,"Caches",t),log:gf.default.join(e,"Logs",t),temp:gf.default.join(aGr,t)}},"Oe"),Qcl=a(t=>{let e=OCe.APPDATA||gf.default.join(ez,"AppData","Roaming"),r=OCe.LOCALAPPDATA||gf.default.join(ez,"AppData","Local");return{data:gf.default.join(r,t,"Data"),config:gf.default.join(e,t,"Config"),cache:gf.default.join(r,t,"Cache"),log:gf.default.join(r,t,"Log"),temp:gf.default.join(aGr,t)}},"De"),qcl=a(t=>{let e=gf.default.basename(ez);return{data:gf.default.join(OCe.XDG_DATA_HOME||gf.default.join(ez,".local","share"),t),config:gf.default.join(OCe.XDG_CONFIG_HOME||gf.default.join(ez,".config"),t),cache:gf.default.join(OCe.XDG_CACHE_HOME||gf.default.join(ez,".cache"),t),log:gf.default.join(OCe.XDG_STATE_HOME||gf.default.join(ez,".local","state"),t),temp:gf.default.join(aGr,e,t)}},"Fe");a(jcl,"Mz");Ipm=jcl("claude-cli");a(Hcl,"Ze");a(Gcl,"wE");$cl=100,z7r=[];a(Vcl,"Le");Wcl=[],soo=null,xpm=Wy(()=>process.argv.includes("--hard-fail"));a(gfo,"oW");RCe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Afo=new Set,sqr=typeof process=="object"&&process?process:{},yfo=a((t,e,r,n)=>{typeof sqr.emitWarning=="function"?sqr.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),jkt=globalThis.AbortController,aoo=globalThis.AbortSignal;if(typeof jkt>"u"){aoo=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},jkt=class{static{a(this,"tW")}constructor(){e()}signal=new aoo;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let n of this.signal._onabort)n(r);this.signal.onabort?.(r)}}};let t=sqr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,yfo("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"Q")}zcl=a(t=>!Afo.has(t),"Ae"),KW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),_fo=a(t=>KW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?UCe:null:null,"ME"),UCe=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},aqr=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=_fo(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},cqr=class t{static{a(this,"aW")}#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#c;#u;#l;#p;#g;#A;#h;#v;#m;#b;#T;#_;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#_,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#l,next:e.#p,prev:e.#g,get head(){return e.#A},get tail(){return e.#h},free:e.#v,isBackgroundFetch:a(r=>e.#f(r),"isBackgroundFetch"),backgroundFetch:a((r,n,o,s)=>e.#U(r,n,o,s),"backgroundFetch"),moveToTail:a(r=>e.#O(r),"moveToTail"),indexes:a(r=>e.#I(r),"indexes"),rindexes:a(r=>e.#x(r),"rindexes"),isStale:a(r=>e.#E(r),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:_,memoMethod:E,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!KW(r))throw TypeError("max option must be a nonnegative integer");let x=r?_fo(r):Array;if(!x)throw Error("invalid max value: "+r);if(this.#e=r,this.#t=g,this.maxEntrySize=A||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw TypeError("memoMethod must be a function if defined");if(this.#o=E,_!==void 0&&typeof _!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#i=_,this.#S=!!_,this.#c=new Map,this.#u=Array(r).fill(void 0),this.#l=Array(r).fill(void 0),this.#p=new x(r),this.#g=new x(r),this.#A=0,this.#h=0,this.#v=aqr.create(r),this.#s=0,this.#a=0,typeof d=="function"&&(this.#r=d),typeof f=="function"?(this.#n=f,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#C=!!this.#r,this.#y=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!KW(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!KW(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=KW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!KW(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError("At least one of max, maxSize, or ttl is required");!this.ttlAutopurge&&!this.#e&&!this.#t&&zcl("LRU_CACHE_UNBOUNDED")&&(Afo.add("LRU_CACHE_UNBOUNDED"),yfo("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",t))}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new UCe(this.#e),r=new UCe(this.#e);this.#_=e,this.#T=r,this.#L=(s,c,l=RCe.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#E(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?RCe.now():0},this.#d=(s,c)=>{if(e[c]){let l=e[c],u=r[c];if(!l||!u)return;s.ttl=l,s.start=u,s.now=n||o();let d=s.now-u;s.remainingTTL=l-d}};let n=0,o=a(()=>{let s=RCe.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"Y");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#E=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#E");#d=a(()=>{},"#R");#L=a(()=>{},"#y");#E=a(()=>!1,"#N");#D(){let e=new UCe(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#B=(r,n,o,s)=>{if(this.#f(n))return 0;if(!KW(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!KW(o))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#P=a(e=>{},"#b");#N=a((e,r,n)=>{},"#v");#B=a((e,r,n,o)=>{if(n||o)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#f");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#E(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#E(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#E(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#_&&this.#T){let c=this.#_[r],l=this.#T[r];if(c&&l){let u=c-(RCe.now()-l);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let e=[];for(let r of this.#I({allowStale:!0})){let n=this.#u[r],o=this.#l[r],s=this.#f(o)?o.__staleWhileFetching:o;if(s===void 0||n===void 0)continue;let c={value:s};if(this.#_&&this.#T){c.ttl=this.#_[r];let l=RCe.now()-this.#T[r];c.start=Math.floor(Date.now()-l)}this.#b&&(c.size=this.#b[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=RCe.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#B(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#v.length!==0?this.#v.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#C&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#C&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#P(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#_&&this.#k(),this.#_&&(d||this.#L(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(Error("evicted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#P(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#v.push(r)),this.#s===1?(this.#A=this.#h=0,this.#v.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#E(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#E(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new jkt,{signal:l}=n;l?.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let u={signal:c.signal,options:n,context:o},d=a((y,_=!1)=>{let{aborted:E}=c.signal,v=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(E&&!_?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),E&&!v&&!_)return h(c.signal.reason);let S=g;return this.#l[r]===g&&(y===void 0?S.__staleWhileFetching?this.#l[r]=S.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,u.options))),y},"H"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),h(y)),"q"),h=a(y=>{let{aborted:_}=c.signal,E=_&&n.allowStaleOnFetchAbort,v=E||n.allowStaleOnFetchRejection,S=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!S||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):E||(this.#l[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},"V"),m=a((y,_)=>{let E=this.#i?.(e,s,u);E&&E instanceof Promise&&E.then(v=>y(v===void 0?void 0:v),_),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(v=>d(v,!0),"w")))})},"B");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,f),A=Object.assign(g,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,A,{...u.options,status:void 0}),r=this.#c.get(e)):this.#l[r]=A,A}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof jkt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:_=!1,status:E,signal:v}=r;if(!this.#S)return E&&(E.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:E});let S={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:E,signal:v},T=this.#c.get(e);if(T===void 0){E&&(E.fetch="miss");let w=this.#U(e,T,S,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let D=n&&w.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",D&&(E.returnedStale=!0)),D?w.__staleWhileFetching:w.__returned=w}let R=this.#E(T);if(!_&&!R)return E&&(E.fetch="hit"),this.#O(T),o&&this.#R(T),E&&this.#d(E,T),w;let x=this.#U(e,T,S,y),k=x.__staleWhileFetching!==void 0&&n;return E&&(E.fetch=R?"stale":"refresh",k&&R&&(E.returnedStale=!0)),k?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#E(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#P(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#v.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(Error("deleted"));else{let o=this.#u[r];this.#C&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#_&&this.#T&&(this.#_.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#v.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};a(Ycl,"LE");Kcl=8192;a(Efo,"AE");coo=Ycl(Efo,t=>t,50),BPt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>Kcl?Efo(t,e):coo(t,e);return r.ok?r.value:null},{cache:coo.cache}),FPt=Wy(()=>{try{if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";if(process.platform==="linux"){if(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP)return"wsl";try{let t=ox().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){hu(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return gfo(t),"unknown"}}),Rpm=Wy(()=>{if(process.platform==="linux")try{let t=ox().readFileSync("/proc/version",{encoding:"utf8"}),e=t.match(/WSL(\d+)/i);return e&&e[1]?e[1]:t.toLowerCase().includes("microsoft")?"1":void 0}catch(t){hu(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),kpm=Wy(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,cGr.release)()};try{let e=await(0,Cfo.readFile)("/etc/os-release","utf8");for(let r of e.split(` +`)){let n=r.match(/^(ID|VERSION_ID)=(.*)$/);if(n&&n[1]&&n[2]){let o=n[2].replace(/^"|"$/g,"");n[1]==="ID"?t.linuxDistroId=o:t.linuxDistroVersion=o}}}catch{}return t}),Ppm=Wy(()=>{if(process.platform!=="darwin")return;let t=(0,cGr.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),EUe=Wy(function(){switch(FPt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),Dpm=Wy(function(){return(0,vfo.join)(EUe(),"managed-settings.d")}),Jcl=Dr(()=>G.object({allowedDomains:G.array(G.string()).optional(),deniedDomains:G.array(G.string()).optional().describe("Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly."),allowManagedDomainsOnly:G.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:G.array(G.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:G.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:G.boolean().optional(),allowMachLookup:G.array(G.string().refine(t=>!(t.endsWith("*")?t.slice(0,-1):t).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.'),httpProxyPort:G.number().optional(),socksProxyPort:G.number().optional(),tlsTerminate:G.object({caCertPath:G.string().min(1).optional(),caKeyPath:G.string().min(1).optional()}).optional().describe("[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session.")}).optional()),Zcl=Dr(()=>G.object({allowWrite:G.array(G.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:G.array(G.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:G.array(G.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:G.array(G.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:G.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used.")}).optional()),Xcl=Dr(()=>G.object({enabled:G.boolean().optional(),failIfUnavailable:G.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:G.boolean().optional(),allowUnsandboxedCommands:G.boolean().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:Jcl(),filesystem:Zcl(),ignoreViolations:G.record(G.string(),G.array(G.string())).optional(),enableWeakerNestedSandbox:G.boolean().optional(),enableWeakerNetworkIsolation:G.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** \u2014 opens a potential data exfiltration vector through the trustd service. Default: false"),excludedCommands:G.array(G.string()).optional(),ripgrep:G.object({command:G.string(),args:G.array(G.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support"),bwrapPath:G.preprocess(t=>typeof t=="string"&&(0,lqr.isAbsolute)(t)?t:void 0,G.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings."),socatPath:G.preprocess(t=>typeof t=="string"&&(0,lqr.isAbsolute)(t)?t:void 0,G.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough()),ell=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],tll=["normal","vim"],rll=["auto","tmux","in-process"],nll=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],ill=["auto",...nll],Npm=FPt()==="macos"?"\u23FA":"\u25CF",lGr=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],oll=[...lGr,"bubble"],sll=oll,Mpm=Dr(()=>qdo.enum(sll)),Opm=Dr(()=>qdo.enum(lGr)),all=["bash","powershell"],P6e=Dr(()=>G.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));a(cll,"Se");lll=Dr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=cll();return G.discriminatedUnion("type",[t,e,r,n,o])}),ull=Dr(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(lll()).describe("List of hooks to execute when the matcher matches")})),Hkt=Dr(()=>G.partialRecord(G.enum(oPt),G.array(ull()))),Lpm=Dr(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),Bpm=Dr(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),Cbe=Dr(()=>G.literal("comms").optional().catch(void 0)),dz=Dr(()=>G.number().int().positive()),dll=Dr(()=>G.object({type:G.literal("stdio").optional(),command:G.string().min(1,"Command cannot be empty"),args:G.array(G.string()).default([]),env:G.record(G.string(),G.string()).optional(),timeout:dz().optional(),alwaysLoad:G.boolean().optional(),role:Cbe()})),fll=Dr(()=>G.boolean()),bfo=Dr(()=>G.object({clientId:G.string().optional(),callbackPort:G.number().int().positive().optional(),authServerMetadataUrl:G.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:G.string().min(1).optional(),xaa:fll().optional()})),pll=Dr(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:bfo().optional(),timeout:dz().optional(),alwaysLoad:G.boolean().optional(),role:Cbe()})),hll=Dr(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional(),timeout:dz().optional(),alwaysLoad:G.boolean().optional(),role:Cbe()})),mll=Dr(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional(),timeout:dz().optional(),alwaysLoad:G.boolean().optional(),role:Cbe()})),gll=Dr(()=>G.object({type:G.enum(["http","streamable-http"]).transform(()=>"http"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:bfo().optional(),timeout:dz().optional(),alwaysLoad:G.boolean().optional(),role:Cbe()})),All=Dr(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),timeout:dz().optional(),alwaysLoad:G.boolean().optional(),role:Cbe()})),yll=Dr(()=>G.object({type:G.literal("sdk"),name:G.string(),timeout:dz().optional(),alwaysLoad:G.boolean().optional()})),_ll=Dr(()=>G.enum(["allow","ask","blocked"])),Ell=Dr(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string(),timeout:dz().optional(),alwaysLoad:G.boolean().optional(),toolPermissions:G.record(G.string(),_ll()).optional()})),uqr=Dr(()=>G.union([dll(),pll(),hll(),mll(),gll(),All(),yll(),Ell()])),Fpm=Dr(()=>G.object({mcpServers:G.record(G.string(),uqr())})),Sfo=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","anthropic-agent-skills","life-sciences","knowledge-work-plugins","claude-for-legal","claude-for-financial-services","financial-services-plugins"]),vll=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,Cll=/[^\u0020-\u007E]/;a(bll,"pe");EM=Dr(()=>G.string().startsWith("./")),tse=Dr(()=>EM().endsWith(".json")),loo=Dr(()=>G.union([EM().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),G.string().url().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),dqr=Dr(()=>EM().endsWith(".md")),fqr=Dr(()=>G.union([dqr(),EM()])),Tfo=Dr(()=>G.string().min(1,"Marketplace must have a name").refine(t=>!t.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine(t=>!t.includes("/")&&!t.includes("\\")&&!t.includes("..")&&t!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine(t=>!bll(t),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).refine(t=>t.toLowerCase()!=="inline",{message:'Marketplace name "inline" is reserved for --plugin-dir session plugins'}).refine(t=>t.toLowerCase()!=="builtin",{message:'Marketplace name "builtin" is reserved for built-in plugins'}).refine(t=>t.toLowerCase()!=="skills-dir",{message:'Marketplace name "skills-dir" is reserved for plugins auto-loaded from .claude/skills/'})),uGr=Dr(()=>G.object({name:G.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:G.string().optional().describe("Contact email for support or feedback"),url:G.string().optional().describe("Website, GitHub profile, or organization URL")})),Sll=Dr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:G.string().optional().describe('Human-readable name shown in UI (e.g., "GitHub Utils"). Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing; not used for namespacing or lookup.'),version:G.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:G.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:uGr().optional().describe("Information about the plugin creator or maintainer"),homepage:G.string().url().optional().describe("Plugin homepage or documentation URL"),repository:G.string().optional().describe("Source code repository URL"),license:G.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:G.array(G.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:G.boolean().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:G.array(zll()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),Upm=Dr(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>Hkt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),Tll=Dr(()=>G.object({hooks:G.union([tse().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>Hkt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([tse().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>Hkt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),Ill=Dr(()=>G.object({source:fqr().optional().describe("Path to command markdown file, relative to plugin root"),content:G.string().optional().describe("Inline markdown content for the command"),description:G.string().optional().describe("Command description override"),argumentHint:G.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:G.string().optional().describe("Default model for this command"),allowedTools:G.array(G.string()).optional().describe("Tools allowed when command runs")}).refine(t=>t.source&&!t.content||!t.source&&t.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),xll=Dr(()=>G.object({commands:G.union([fqr().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(fqr().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of command file or skill directory paths. When set, the commands/ directory is not auto-loaded."),G.record(G.string(),Ill()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" \u2192 "/plugin:about")')])})),wll=Dr(()=>G.object({agents:G.union([dqr().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(dqr().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of agent file paths. When set, the agents/ directory is not auto-loaded.")])})),Rll=Dr(()=>G.object({skills:G.union([EM().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),G.array(EM().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory.")).describe("List of skill directory paths, loaded in addition to the skills/ directory.")])})),Ifo=Dr(()=>G.object({outputStyles:G.union([EM().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(EM().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of output-style directory or file paths. When set, the output-styles/ directory is not auto-loaded.")])})),xfo=Dr(()=>G.object({themes:G.union([EM().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(EM().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of theme directory or file paths. When set, the themes/ directory is not auto-loaded.")])})),kll=Dr(()=>G.object({})),uoo=Dr(()=>G.string().min(1)),Pll=Dr(()=>G.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),Dll=Dr(()=>G.object({mcpServers:G.union([tse().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),loo().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),uqr()).describe("MCP server configurations keyed by server name"),G.array(G.union([tse().describe("Path to MCP servers configuration file"),loo().describe("Path or URL to MCPB file"),G.record(G.string(),uqr()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),wfo=Dr(()=>G.object({type:G.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:G.string().describe("Human-readable label shown in the config dialog"),description:G.string().describe("Help text shown beneath the field in the config dialog"),required:G.boolean().optional().describe("If true, validation fails when this field is empty"),default:G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]).optional().describe("Default value used when the user provides nothing"),multiple:G.boolean().optional().describe("For string type: allow an array of strings"),sensitive:G.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:G.number().optional().describe("Minimum value (number type only)"),max:G.number().optional().describe("Maximum value (number type only)")}).strict()),Nll=Dr(()=>G.object({userConfig:G.record(G.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) \u2014 they become CLAUDE_PLUGIN_OPTION_ env vars in hooks"),wfo()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage. Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Keep sensitive value counts small.")})),Mll=Dr(()=>G.object({channels:G.array(G.object({server:G.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:G.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:G.record(G.string(),wfo()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),doo=Dr(()=>G.strictObject({command:G.string().min(1).refine(t=>!(t.includes(" ")&&!t.startsWith("/")),{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:G.array(uoo()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(Pll(),uoo()).refine(t=>Object.keys(t).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:G.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:G.record(G.string(),G.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:G.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:G.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:G.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:G.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:G.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:G.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:G.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")})),Oll=Dr(()=>G.strictObject({name:G.string().min(1).describe("Identifier for this monitor, unique within the plugin. Used to dedupe so re-arming (plugin reload, repeat skill invoke) does not spawn duplicates."),command:G.string().min(1).describe('Shell command to run as a persistent background monitor. Each stdout line is delivered to the model as a event; the process runs for the session lifetime. ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}, ${CLAUDE_PROJECT_DIR}, ${user_config.*}, and ${ENV_VAR} are substituted. Runs in the session cwd \u2014 prefix with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs its own directory.'),description:G.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:G.union([G.literal("always"),G.string().startsWith("on-skill-invoke:").refine(t=>t.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:" arms the first time that skill is dispatched (via Skill tool or slash command).')})),Lll=Dr(()=>G.array(Oll()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),Rfo=Dr(()=>G.object({monitors:G.union([tse().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),Lll()]).describe("Background watch scripts the host arms as persistent Monitor tasks (unsandboxed, same trust tier as hooks) so plugins need not instruct the model to arm them. When omitted, monitors/monitors.json at the plugin root is loaded if present.")})),Bll=Dr(()=>G.object({lspServers:G.union([tse().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),doo()).describe("LSP server configurations keyed by server name"),G.array(G.union([tse().describe("Path to LSP configuration file"),G.record(G.string(),doo()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),kfo=Dr(()=>G.string().refine(t=>!t.includes("..")&&!t.includes("//"),"Package name cannot contain path traversal patterns").refine(t=>{let e=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,r=/^[a-z0-9][a-z0-9-._]*$/;return e.test(t)||r.test(t)},"Invalid npm package name format")),Fll=Dr(()=>G.object({settings:G.record(G.string(),G.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),Ull=Dr(()=>G.object({experimental:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,G.object({...xfo().partial().shape,...Rfo().partial().shape,...Ifo().partial().shape,evals:G.union([G.string(),G.array(G.string())]).optional().describe("Path(s) to evaluation query files for `claude plugin eval`. Defaults to `evals/`.")}).optional().describe("Components whose manifest shape may change without a deprecation cycle. Move a key out of here once it is promoted to stable."))})),Qll=Dr(()=>G.object({...Sll().shape,...Tll().partial().shape,...xll().partial().shape,...wll().partial().shape,...Rll().partial().shape,...Ifo().partial().shape,...xfo().partial().shape,...kll().shape,...Mll().partial().shape,...Dll().partial().shape,...Bll().partial().shape,...Rfo().partial().shape,...Fll().partial().shape,...Nll().partial().shape,...Ull().partial().shape})),Gkt=Dr(()=>G.discriminatedUnion("source",[G.object({source:G.literal("url"),url:G.string().url().describe("Direct URL to marketplace.json file"),headers:G.record(G.string(),G.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:G.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),G.object({source:G.literal("git"),url:G.string().describe("Full git repository URL"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:G.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),G.object({source:G.literal("npm"),package:kfo().describe("NPM package containing marketplace.json")}),G.object({source:G.literal("file"),path:G.string().describe("Local file path to marketplace.json")}),G.object({source:G.literal("directory"),path:G.string().describe("Local directory containing .claude-plugin/marketplace.json")}),G.object({source:G.literal("skills-dir")}).describe("Policy-list sentinel for the ~/.claude/skills/ auto-load (@skills-dir plugins). In strictKnownMarketplaces: opt the scan back IN (by default any allowlist blocks it). In blockedMarketplaces: turn the scan OFF without otherwise restricting marketplaces. Only meaningful in those two managed-settings lists (areLocalPluginDirsAllowedByPolicy); known_marketplaces.json / marketplace add etc. ignore it."),G.object({source:G.literal("hostPattern"),hostPattern:G.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),G.object({source:G.literal("pathPattern"),pathPattern:G.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),G.object({source:G.literal("settings"),name:Tfo().refine(t=>!Sfo.has(t.toLowerCase()),{message:"Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection \u2014 validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:G.array(qll()).describe("Plugin entries declared inline in settings.json"),owner:uGr().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),Y7r=Dr(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),Pfo=Dr(()=>G.union([EM().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),G.object({source:G.literal("npm"),package:kfo().or(G.string().refine(t=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(t)||!t.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:G.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:G.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),G.object({source:G.literal("url"),url:G.string().describe("Full git repository URL (https:// or git@)"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Y7r().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Y7r().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("git-subdir"),url:G.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:G.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Y7r().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded."),G.object({source:G.literal("unsupported")}).describe('Placeholder for source types this Claude Code version does not recognize. Never authored by hand \u2014 PluginMarketplaceSchema rewrites unparseable sources to this so the entry remains in marketplace.plugins (detectDelistedPlugins must not see it as removed). Install attempts fail at cachePlugin with a clear "update Claude Code" message.')])),qll=Dr(()=>G.object({name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:Pfo().describe("Where to fetch the plugin from. Must be a remote source \u2014 relative paths have no marketplace repository to resolve against."),description:G.string().optional(),version:G.string().optional(),strict:G.boolean().optional()}).refine(t=>typeof t.source!="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine(t=>typeof t.source=="string"||t.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url)."})),jll=Dr(()=>G.object({cli:G.array(G.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) \u2014 exact match against commands run this session.'),hosts:G.array(G.string().max(128)).max(20).optional().describe('Hostnames (e.g. ["api.stripe.com"]) \u2014 exact, case-insensitive match against hostnames seen in https?:// URLs in bash commands run this session. Bare hostname only: lowercase, no scheme, no port, no path.'),filesRead:G.array(G.string().max(256)).max(10).optional().describe('Glob patterns (e.g. ["**/*.tf"]) \u2014 the plugin is relevant when a file Claude has read this session matches any pattern. Matched against read-file paths, forward-slash normalized, case-insensitive.'),manifestDeps:G.array(G.object({file:G.string().max(256),pattern:G.string().max(256)})).max(10).optional().describe("Dependency declared in a package manifest. Each {file, pattern} is a pair of RegExp sources: `file` matches the manifest filename (package.json, go.mod, requirements.txt, \u2026); `pattern` matches the dependency declaration inside that file. Evaluated against files read this session."),cwd:G.array(G.string().max(256)).max(10).optional().describe(`Glob patterns (e.g. ["Engine/Source/Runtime/Renderer/**"]) \u2014 the plugin is relevant when the session's working directory is at or under a directory matching the pattern. Matched against the cwd both relative to the enclosing git repo root and as an absolute path, forward-slash normalized, case-insensitive. A bare directory (no glob characters) means "cwd is at or under this directory". Known at session start, so this signal can surface a suggestion before the first turn.`)})),Hll=Dr(()=>G.object({topic:G.string().max(64).optional().describe('What the user is working with when this plugin is relevant \u2014 fills "Working with {topic}?". Often the product name (e.g. "Stripe"); use a domain (e.g. "design") when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen-segment capitalized.'),signals:jll().optional().describe("Matchers that determine when the plugin is relevant.")})),Gll=Dr(()=>Qll().partial().extend({name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:Pfo().describe("Where to fetch the plugin from"),category:G.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:G.array(G.string()).optional().describe("Tags for searchability and discovery"),strict:G.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest."),relevance:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,Hll().optional()).describe(`Declares when this plugin is relevant to the user's work. Consumed by the spinner tip ("Working with {topic}?"), session-start auto-suggest, and marketplace browse ranking.`)})),$ll=Dr(()=>G.object({name:G.string().min(1).refine(t=>!t.includes(" "))}));a(Vll,"z$$");Qpm=Dr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Tfo(),version:G.string().optional().describe("Marketplace manifest version"),description:G.string().optional().describe("Human-readable description of this marketplace"),owner:uGr().describe("Marketplace maintainer or curator information"),plugins:G.array(G.unknown()).transform(Vll).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:G.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:G.object({pluginRoot:G.string().optional().describe("Base path for relative plugin sources"),version:G.string().optional().describe("Marketplace version"),description:G.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:G.array(G.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies \u2014 no transitive trust.")})),Dfo=Dr(()=>G.string().regex(/^[A-Za-z0-9][-A-Za-z0-9._]*@[A-Za-z0-9][-A-Za-z0-9._]*$/,"Plugin ID must be in format: plugin@marketplace")),Wll=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,zll=Dr(()=>G.union([G.string().regex(Wll,"Dependency must be a plugin name, optionally qualified with @marketplace").transform(t=>t.replace(/@\^[^@]*$/,"")),G.object({name:G.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:G.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform(t=>t.marketplace?`${t.name}@${t.marketplace}`:t.name)])),Yll=Dr(()=>G.object({version:G.string().describe("Currently installed version"),installedAt:G.string().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),installPath:G.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:G.string().optional().describe("Tag-derived semver this install resolved to (when fetched via a version constraint). Used by verifyAndDemote in preference to manifest.version, since the upstream may have forgotten to bump plugin.json."),auto:G.boolean().optional().describe("True when this plugin was pulled in as a dependency rather than installed explicitly. Auto-installed plugins are eligible for removal by the orphan sweep when nothing depends on them. Absent = manual (preserves pre-flag installs).")})),Kll=Dr(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(Dfo(),Yll()).describe("Map of plugin IDs to their installation metadata")})),Jll=Dr(()=>G.enum(["managed","user","project","local"])),Zll=Dr(()=>G.object({scope:Jll().describe("Installation scope"),projectPath:G.string().optional().describe("Project path (required for project/local scopes)"),installPath:G.string().describe("Absolute path to the versioned plugin directory"),version:G.string().optional().describe("Currently installed version"),installedAt:G.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:G.string().optional().describe("Tag-derived semver this install resolved to"),auto:G.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep.")})),Xll=Dr(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(Dfo(),G.array(Zll())).describe("Map of plugin IDs to arrays of installation entries")})),qpm=Dr(()=>G.union([Kll(),Xll()])),eul=Dr(()=>G.object({source:Gkt().describe("Where to fetch the marketplace from"),installLocation:G.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:G.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),jpm=Dr(()=>G.record(G.string(),eul())),tul=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],rul="https://json.schemastore.org/claude-code-settings.json",nul=["autoMode","deepLink","voice","assistant","briefView"],IRt={},UPt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>IRt,"shape"),permissionsShape:a(()=>IRt,"permissionsShape"),permissionModes:a(()=>[],"permissionModes")},deepLink:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({disableDeepLinkRegistration:G.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")}),"shape")},voice:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>IRt,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>IRt,"shape")},briefView:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({defaultView:G.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")}),"shape")}};a(Nfo,"Ez");a(iul,"tE");a(oul,"aE");a(sul,"sE");a(aul,"eE");foo={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(kCe,"E9");Mfo="workspace",Hpm=`mcp__${Mfo}__bash`,Gpm=`mcp__${Mfo}__web_fetch`;a(cul,"A$$");a(lul,"Jb");a(uul,"I$$");a(dul,"R$$");$kt={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit"],bashPrefixTools:["Bash"],customValidation:{WebSearch:a(t=>t.includes("*")||t.includes("?")?{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]}:{valid:!0},"WebSearch"),WebFetch:a(t=>t.includes("://")||t.startsWith("http")?{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]}:t.startsWith("domain:")?{valid:!0}:{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]},"WebFetch")}};a(ful,"Xb");a(pul,"Yb");a(hul,"Wb");a(Ofo,"Gb");a(K7r,"bz");a(mul,"P$$");a(Lfo,"_z");J7r=Dr(()=>G.string().superRefine((t,e)=>{let r=Lfo(t);if(!r.valid){let n=r.error;r.suggestion&&(n+=`. ${r.suggestion}`),r.examples&&r.examples.length>0&&(n+=`. Examples: ${r.examples.join(", ")}`),e.addIssue({code:G.ZodIssueCode.custom,message:n,params:{received:t}})}})),gul=Dr(()=>G.record(G.string(),G.coerce.string()));a(Bfo,"Hb");$pm=Dr(()=>Bfo(Nfo())),Aul=Dr(()=>G.object({source:Gkt().describe("Where to fetch the marketplace from"),installLocation:G.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Ffo=Dr(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine(t=>Fao([t.serverName!==void 0,t.serverCommand!==void 0,t.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),Ufo=Dr(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine(t=>Fao([t.serverName!==void 0,t.serverCommand!==void 0,t.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),yul=Dr(()=>G.object({path:G.string().describe("Absolute path to the helper executable"),timeoutMs:G.number().int().min(1e3).optional(),refreshIntervalMs:G.union([G.literal(0),G.number().int().min(6e4)]).optional()})),poo=["skills","agents","hooks","mcp"];a(_ul,"Kb");bbe=Dr(()=>_ul(Nfo())),w9="https://code.claude.com/docs/en",Eul=[{matches:a(t=>t.path==="permissions.defaultMode"&&t.code==="invalid_value","matches"),tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${w9}/iam#permission-modes`}},{matches:a(t=>t.path==="apiKeyHelper"&&t.code==="invalid_type","matches"),tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:a(t=>t.path==="cleanupPeriodDays"&&t.code==="too_small","matches"),tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:a(t=>t.path.startsWith("env.")&&t.code==="invalid_type","matches"),tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${w9}/settings#environment-variables`}},{matches:a(t=>(t.path==="permissions.allow"||t.path==="permissions.deny")&&t.code==="invalid_type"&&t.expected==="array","matches"),tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:a(t=>t.path.startsWith("hooks.")&&t.code==="invalid_key","matches"),tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${w9}/hooks`}},{matches:a(t=>/\.hooks\.\d+\.command$/.test(t.path)&&t.code==="invalid_type"&&t.received==="undefined","matches"),tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${w9}/hooks#exec-form-and-shell-form`}},{matches:a(t=>t.path.includes("hooks")&&t.code==="invalid_type","matches"),tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:a(t=>t.code==="invalid_type"&&t.expected==="boolean","matches"),tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:a(t=>t.code==="unrecognized_keys","matches"),tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${w9}/settings`}},{matches:a(t=>t.code==="invalid_value"&&t.enumValues!==void 0,"matches"),tip:{suggestion:void 0}},{matches:a(t=>t.code==="invalid_type"&&t.expected==="object"&&t.received===null&&t.path==="","matches"),tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:a(t=>t.path==="permissions.additionalDirectories"&&t.code==="invalid_type","matches"),tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${w9}/iam#working-directories`}}],vul={permissions:`${w9}/iam#configuring-permissions`,env:`${w9}/settings#environment-variables`,hooks:`${w9}/hooks`};a(Cul,"qb");Vpm=Dr(()=>bbe().strict());a(hoo,"Vb");a(moo,"Bb");a(bul,"v$$");a(goo,"zb");a(QCe,"b9");a(Aoo,"Nb");a(UUe,"d0");a(Sul,"C$$");Tul=new Set(oPt);a(Iul,"x$$");xul=[{key:"allowedMcpServers",schema:Ffo},{key:"deniedMcpServers",schema:Ufo}];a(wul,"f$$");a(Sbe,"i1");yoo="com.anthropic.claudecode",pqr="HKLM\\SOFTWARE\\Policies\\ClaudeCode",hqr="HKCU\\SOFTWARE\\Policies\\ClaudeCode",LCe="Settings",Rul="/usr/bin/plutil",kul=["-convert","json","-o","-","--"],Pul=5e3,_oo="/mnt/c/Windows/System32/reg.exe",Vkt="/mnt/c/Program Files/ClaudeCode";a(qfo,"XG");a(Dul,"Zb");Nul=null;a(D6e,"$5");a(Mul,"Mb");a(Oul,"Lb");ZW=Object.freeze({settings:{},errors:[]}),Gfo=null,$fo=null,Vfo=!1,Wkt=null;a(Lul,"l$$");a(Bul,"bb");a(Ful,"_b");a(Uul,"kb");a(Qul,"Sb");a(Z7r,"Cz");a(Eoo,"jb");a(qul,"c$$");a(jul,"p$$");a(voo,"Ab");a(Hul,"d$$");a(Coo,"Ib");a(Gul,"i$$");mqr=Gul;a($ul,"n$$");Vul=$ul,Wul=Vul(),zul=Wul;a(Yul,"o$$");Kul=Yul,Jul="[object Object]",Zul=Function.prototype,Xul=Object.prototype,Wfo=Zul.toString,edl=Xul.hasOwnProperty,tdl=Wfo.call(Object);a(rdl,"Q6$");ndl=rdl;a(idl,"J6$");gqr=idl;a(odl,"X6$");sdl=odl;a(adl,"Y6$");cdl=adl;a(zfo,"hb");ldl=zfo;a(udl,"W6$");ddl=udl,boo=Math.max;a(fdl,"G6$");Yfo=fdl;a(pdl,"U6$");hdl=pdl,mdl=dkt?function(t,e){return dkt(t,"toString",{configurable:!0,enumerable:!1,value:hdl(e),writable:!0})}:rao,gdl=mdl,Adl=800,ydl=16,_dl=Date.now;a(Edl,"B6$");vdl=Edl,Cdl=vdl(gdl),Kfo=Cdl;a(bdl,"N6$");Sdl=bdl;a(Tdl,"w6$");Idl=Tdl;a(xdl,"O6$");wdl=xdl,Rdl=wdl(function(t,e,r,n){ldl(t,e,r,n)}),tz=Rdl;a(kdl,"F6$");Pdl=kdl;a(Ddl,"Z6$");Ndl=Ddl;a(Mdl,"M6$");Odl=Mdl,Soo=iz?iz.isConcatSpreadable:void 0;a(Ldl,"L6$");Bdl=Ldl;a(Jfo,"$_");Fdl=Jfo;a(Udl,"j6$");Qdl=Udl;a(qdl,"A6$");jdl=qdl,Hdl=jdl(function(t,e){return t==null?{}:Odl(t,e)}),X7r=Hdl,Gdl="remote-settings.json",eQr=null;a(Vdl,"b6$");a(Wdl,"_6$");a(zdl,"W_");a(dGr,"fz");a(Ydl,"S6$");a(Xfo,"U_");a(tQr,"xz");a(Kdl,"v6$");a(zkt,"HG");a(epo,"H_");a(tpo,"K_");a(rpo,"q_");a(npo,"V_");a(Jdl,"C6$");a(Too,"G_");a(Zdl,"T6$");a(Ykt,"Y5");a(Xdl,"x6$");a(ipo,"B_");a(efl,"y6$");a(tfl,"f6$");a(rfl,"z_");a(nfl,"g6$");a(opo,"N_");a(ifl,"h6$");a(ofl,"u6$");a(rz,"o1");rQr=!1;a(sfl,"m6$");a(afl,"l6$");a(cfl,"c6$");a(lfl,"w_");a(ufl,"O_");dfl={user:"userSettings",project:"projectSettings",local:"localSettings"},Ioo={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},ffl=["user","project","local"],pfl=new Set(["bypassPermissions","auto","acceptEdits"]),hfl=new Set(["project"]);a(mfl,"o6$");a(gfl,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(Afl,"LA$");a(yfl,"G4$");a(_fl,"U4$");a(Efl,"H4$");a(spo,"b_");a(Aqr,"uz");a(yqr,"mz");vfl=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(Kkt,"KG");a(Cfl,"q4$");a(bfl,"jA$");a(Sfl,"AA$");a(Tfl,"IA$");a(Ifl,"RA$");a(xfl,"PA$");a(wfl,"EA$");a(Rfl,"bA$");a(kfl,"_A$");a(Pfl,"kA$");a(Dfl,"SA$");a(xoo,"M_");a(Nfl,"V4$");a(Mfl,"vA$");a(Ofl,"CA$");a(apo,"__");a(Zk,"J4");a(cpo,"k_");a(woo,"L_");a(_qr,"lz");a(Lfl,"B4$");a(Roo,"j_");a(lpo,"S_");a(Bfl,"z4$");a(upo,"v_");a(Ffl,"N4$");a(Ufl,"w4$");a(Qfl,"O4$");a(qfl,"D4$");a(jfl,"F4$");a(Hfl,"Z4$");a(Gfl,"M4$");a(koo,"A_")});var Lho=I((qGr,Oho)=>{p();qGr.createWatcher=F9e()("vscode-policy-watcher");if(require.main===Oho){let t=process.platform;qGr.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var Emo=I(YGr=>{p();var _mo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");YGr.encode=function(t){if(0<=t&&t<_mo.length)return _mo[t];throw new TypeError("Must be between 0 and 63: "+t)};YGr.decode=function(t){var e=65,r=90,n=97,o=122,s=48,c=57,l=43,u=47,d=26,f=52;return e<=t&&t<=r?t-e:n<=t&&t<=o?t-n+d:s<=t&&t<=c?t-s+f:t==l?62:t==u?63:-1}});var ZGr=I(JGr=>{p();var vmo=Emo(),KGr=5,Cmo=1<>1;return e?-r:r}a(Khl,"fromVLQSigned");JGr.encode=a(function(e){var r="",n,o=Yhl(e);do n=o&bmo,o>>>=KGr,o>0&&(n|=Smo),r+=vmo.encode(n);while(o>0);return r},"base64VLQ_encode");JGr.decode=a(function(e,r,n){var o=e.length,s=0,c=0,l,u;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(u=vmo.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&Smo),u&=bmo,s=s+(u<{p();function Jhl(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}a(Jhl,"getArg");kE.getArg=Jhl;var Tmo=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Zhl=/^data:.+\,.+$/;function A9e(t){var e=t.match(Tmo);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(A9e,"urlParse");kE.urlParse=A9e;function Qbe(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}a(Qbe,"urlGenerate");kE.urlGenerate=Qbe;function XGr(t){var e=t,r=A9e(t);if(r){if(!r.path)return t;e=r.path}for(var n=kE.isAbsolute(e),o=e.split(/\/+/),s,c=0,l=o.length-1;l>=0;l--)s=o[l],s==="."?o.splice(l,1):s===".."?c++:c>0&&(s===""?(o.splice(l+1,c),c=0):(o.splice(l,2),c--));return e=o.join("/"),e===""&&(e=n?"/":"."),r?(r.path=e,Qbe(r)):e}a(XGr,"normalize");kE.normalize=XGr;function Imo(t,e){t===""&&(t="."),e===""&&(e=".");var r=A9e(e),n=A9e(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Qbe(r);if(r||e.match(Zhl))return e;if(n&&!n.host&&!n.path)return n.host=e,Qbe(n);var o=e.charAt(0)==="/"?e:XGr(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,Qbe(n)):o}a(Imo,"join");kE.join=Imo;kE.isAbsolute=function(t){return t.charAt(0)==="/"||Tmo.test(t)};function Xhl(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}a(Xhl,"relative");kE.relative=Xhl;var xmo=(function(){var t=Object.create(null);return!("__proto__"in t)})();function wmo(t){return t}a(wmo,"identity");function eml(t){return Rmo(t)?"$"+t:t}a(eml,"toSetString");kE.toSetString=xmo?wmo:eml;function tml(t){return Rmo(t)?t.slice(1):t}a(tml,"fromSetString");kE.fromSetString=xmo?wmo:tml;function Rmo(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}a(Rmo,"isProtoString");function rml(t,e,r){var n=qbe(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:qbe(t.name,e.name)}a(rml,"compareByOriginalPositions");kE.compareByOriginalPositions=rml;function nml(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=qbe(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:qbe(t.name,e.name)}a(nml,"compareByGeneratedPositionsDeflated");kE.compareByGeneratedPositionsDeflated=nml;function qbe(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(qbe,"strcmp");function iml(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=qbe(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:qbe(t.name,e.name)}a(iml,"compareByGeneratedPositionsInflated");kE.compareByGeneratedPositionsInflated=iml;function oml(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(oml,"parseSourceMapInput");kE.parseSourceMapInput=oml;function sml(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=A9e(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}e=Imo(Qbe(n),e)}return XGr(e)}a(sml,"computeSourceURL");kE.computeSourceURL=sml});var r$r=I(kmo=>{p();var e$r=jbe(),t$r=Object.prototype.hasOwnProperty,use=typeof Map<"u";function U9(){this._array=[],this._set=use?new Map:Object.create(null)}a(U9,"ArraySet");U9.fromArray=a(function(e,r){for(var n=new U9,o=0,s=e.length;o=0)return r}else{var n=e$r.toSetString(e);if(t$r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");U9.prototype.at=a(function(e){if(e>=0&&e{p();var Pmo=jbe();function aml(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Pmo.compareByGeneratedPositionsInflated(t,e)<=0}a(aml,"generatedPositionAfter");function uDt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(uDt,"MappingList");uDt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");uDt.prototype.add=a(function(e){aml(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");uDt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Pmo.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");Dmo.MappingList=uDt});var n$r=I(Mmo=>{p();var y9e=ZGr(),tg=jbe(),dDt=r$r().ArraySet,cml=Nmo().MappingList;function nP(t){t||(t={}),this._file=tg.getArg(t,"file",null),this._sourceRoot=tg.getArg(t,"sourceRoot",null),this._skipValidation=tg.getArg(t,"skipValidation",!1),this._sources=new dDt,this._names=new dDt,this._mappings=new cml,this._sourcesContents=null}a(nP,"SourceMapGenerator");nP.prototype._version=3;nP.fromSourceMap=a(function(e){var r=e.sourceRoot,n=new nP({file:e.file,sourceRoot:r});return e.eachMapping(function(o){var s={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(s.source=o.source,r!=null&&(s.source=tg.relative(r,s.source)),s.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(s.name=o.name)),n.addMapping(s)}),e.sources.forEach(function(o){var s=o;r!==null&&(s=tg.relative(r,o)),n._sources.has(s)||n._sources.add(s);var c=e.sourceContentFor(o);c!=null&&n.setSourceContent(o,c)}),n},"SourceMapGenerator_fromSourceMap");nP.prototype.addMapping=a(function(e){var r=tg.getArg(e,"generated"),n=tg.getArg(e,"original",null),o=tg.getArg(e,"source",null),s=tg.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,o,s),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:s})},"SourceMapGenerator_addMapping");nP.prototype.setSourceContent=a(function(e,r){var n=e;this._sourceRoot!=null&&(n=tg.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[tg.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[tg.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");nP.prototype.applySourceMap=a(function(e,r,n){var o=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var s=this._sourceRoot;s!=null&&(o=tg.relative(s,o));var c=new dDt,l=new dDt;this._mappings.unsortedForEach(function(u){if(u.source===o&&u.originalLine!=null){var d=e.originalPositionFor({line:u.originalLine,column:u.originalColumn});d.source!=null&&(u.source=d.source,n!=null&&(u.source=tg.join(n,u.source)),s!=null&&(u.source=tg.relative(s,u.source)),u.originalLine=d.line,u.originalColumn=d.column,d.name!=null&&(u.name=d.name))}var f=u.source;f!=null&&!c.has(f)&&c.add(f);var h=u.name;h!=null&&!l.has(h)&&l.add(h)},this),this._sources=c,this._names=l,e.sources.forEach(function(u){var d=e.sourceContentFor(u);d!=null&&(n!=null&&(u=tg.join(n,u)),s!=null&&(u=tg.relative(s,u)),this.setSourceContent(u,d))},this)},"SourceMapGenerator_applySourceMap");nP.prototype._validateMapping=a(function(e,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!o)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:o}))}},"SourceMapGenerator_validateMapping");nP.prototype._serializeMappings=a(function(){for(var e=0,r=1,n=0,o=0,s=0,c=0,l="",u,d,f,h,m=this._mappings.toArray(),g=0,A=m.length;g0){if(!tg.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=y9e.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=y9e.encode(h-c),c=h,u+=y9e.encode(d.originalLine-1-o),o=d.originalLine-1,u+=y9e.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=y9e.encode(f-s),s=f)),l+=u}return l},"SourceMapGenerator_serializeMappings");nP.prototype._generateSourcesContent=a(function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=tg.relative(r,n));var o=tg.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)},"SourceMapGenerator_generateSourcesContent");nP.prototype.toJSON=a(function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},"SourceMapGenerator_toJSON");nP.prototype.toString=a(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");Mmo.SourceMapGenerator=nP});var Omo=I(dse=>{p();dse.GREATEST_LOWER_BOUND=1;dse.LEAST_UPPER_BOUND=2;function i$r(t,e,r,n,o,s){var c=Math.floor((e-t)/2)+t,l=o(r,n[c],!0);return l===0?c:l>0?e-c>1?i$r(c,e,r,n,o,s):s==dse.LEAST_UPPER_BOUND?e1?i$r(t,c,r,n,o,s):s==dse.LEAST_UPPER_BOUND?c:t<0?-1:t}a(i$r,"recursiveSearch");dse.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=i$r(-1,r.length,e,r,n,o||dse.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(r[s],r[s-1],!0)===0;)--s;return s},"search")});var Bmo=I(Lmo=>{p();function o$r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a(o$r,"swap");function lml(t,e){return Math.round(t+Math.random()*(e-t))}a(lml,"randomIntInRange");function s$r(t,e,r,n){if(r{p();var Vn=jbe(),a$r=Omo(),Hbe=r$r().ArraySet,uml=ZGr(),_9e=Bmo().quickSort;function Ud(t,e){var r=t;return typeof t=="string"&&(r=Vn.parseSourceMapInput(t)),r.sections!=null?new RM(r,e):new Ky(r,e)}a(Ud,"SourceMapConsumer");Ud.fromSourceMap=function(t,e){return Ky.fromSourceMap(t,e)};Ud.prototype._version=3;Ud.prototype.__generatedMappings=null;Object.defineProperty(Ud.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Ud.prototype.__originalMappings=null;Object.defineProperty(Ud.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Ud.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Ud.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Ud.GENERATED_ORDER=1;Ud.ORIGINAL_ORDER=2;Ud.GREATEST_LOWER_BOUND=1;Ud.LEAST_UPPER_BOUND=2;Ud.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||Ud.GENERATED_ORDER,c;switch(s){case Ud.GENERATED_ORDER:c=this._generatedMappings;break;case Ud.ORIGINAL_ORDER:c=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;c.map(function(u){var d=u.source===null?null:this._sources.at(u.source);return d=Vn.computeSourceURL(l,d,this._sourceMapURL),{source:d,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(e,o)},"SourceMapConsumer_eachMapping");Ud.prototype.allGeneratedPositionsFor=a(function(e){var r=Vn.getArg(e,"line"),n={source:Vn.getArg(e,"source"),originalLine:r,originalColumn:Vn.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Vn.compareByOriginalPositions,a$r.LEAST_UPPER_BOUND);if(s>=0){var c=this._originalMappings[s];if(e.column===void 0)for(var l=c.originalLine;c&&c.originalLine===l;)o.push({line:Vn.getArg(c,"generatedLine",null),column:Vn.getArg(c,"generatedColumn",null),lastColumn:Vn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:Vn.getArg(c,"generatedLine",null),column:Vn.getArg(c,"generatedColumn",null),lastColumn:Vn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");fDt.SourceMapConsumer=Ud;function Ky(t,e){var r=t;typeof t=="string"&&(r=Vn.parseSourceMapInput(t));var n=Vn.getArg(r,"version"),o=Vn.getArg(r,"sources"),s=Vn.getArg(r,"names",[]),c=Vn.getArg(r,"sourceRoot",null),l=Vn.getArg(r,"sourcesContent",null),u=Vn.getArg(r,"mappings"),d=Vn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=Vn.normalize(c)),o=o.map(String).map(Vn.normalize).map(function(f){return c&&Vn.isAbsolute(c)&&Vn.isAbsolute(f)?Vn.relative(c,f):f}),this._names=Hbe.fromArray(s.map(String),!0),this._sources=Hbe.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return Vn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(Ky,"BasicSourceMapConsumer");Ky.prototype=Object.create(Ud.prototype);Ky.prototype.consumer=Ud;Ky.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Vn.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r1&&(y.source=l+E[1],l+=E[1],y.originalLine=s+E[2],s=y.originalLine,y.originalLine+=1,y.originalColumn=c+E[3],c=y.originalColumn,E.length>4&&(y.name=u+E[4],u+=E[4])),A.push(y),typeof y.originalLine=="number"&&g.push(y)}_9e(A,Vn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,_9e(g,Vn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");Ky.prototype._findMapping=a(function(e,r,n,o,s,c){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return a$r.search(e,r,s,c)},"SourceMapConsumer_findMapping");Ky.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=Vn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=Vn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=Vn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:Vn.getArg(o,"originalLine",null),column:Vn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");Ky.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");Ky.prototype.sourceContentFor=a(function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=Vn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=Vn.urlParse(this.sourceRoot))){var c=o.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(c))return this.sourcesContent[this._sources.indexOf(c)];if((!s.path||s.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(r)return null;throw new Error('"'+o+'" is not in the SourceMap.')},"SourceMapConsumer_sourceContentFor");Ky.prototype.generatedPositionFor=a(function(e){var r=Vn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:Vn.getArg(e,"line"),originalColumn:Vn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Vn.compareByOriginalPositions,Vn.getArg(e,"bias",Ud.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:Vn.getArg(s,"generatedLine",null),column:Vn.getArg(s,"generatedColumn",null),lastColumn:Vn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");fDt.BasicSourceMapConsumer=Ky;function RM(t,e){var r=t;typeof t=="string"&&(r=Vn.parseSourceMapInput(t));var n=Vn.getArg(r,"version"),o=Vn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Hbe,this._names=new Hbe;var s={line:-1,column:0};this._sections=o.map(function(c){if(c.url)throw new Error("Support for url field in sections not implemented.");var l=Vn.getArg(c,"offset"),u=Vn.getArg(l,"line"),d=Vn.getArg(l,"column");if(u{p();var dml=n$r().SourceMapGenerator,pDt=jbe(),fml=/(\r?\n)/,pml=10,Gbe="$$$isSourceNode$$$";function ux(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=o??null,this[Gbe]=!0,n!=null&&this.add(n)}a(ux,"SourceNode");ux.fromStringWithSourceMap=a(function(e,r,n){var o=new ux,s=e.split(fml),c=0,l=a(function(){var m=A(),g=A()||"";return m+g;function A(){return c=0;r--)this.prepend(e[r]);else if(e[Gbe]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this},"SourceNode_prepend");ux.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();hDt.SourceMapGenerator=n$r().SourceMapGenerator;hDt.SourceMapConsumer=Umo().SourceMapConsumer;hDt.SourceNode=qmo().SourceNode});var Gmo=I((xkm,Hmo)=>{p();var hml=Object.prototype.toString,c$r=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function mml(t){return hml.call(t).slice(8,-1)==="ArrayBuffer"}a(mml,"isArrayBuffer");function gml(t,e,r){e>>>=0;var n=t.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(r===void 0)r=n;else if(r>>>=0,r>n)throw new RangeError("'length' is out of bounds");return c$r?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(gml,"fromArrayBuffer");function Aml(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return c$r?Buffer.from(t,e):new Buffer(t,e)}a(Aml,"fromString");function yml(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return mml(t)?gml(t,e,r):typeof t=="string"?Aml(t,e):c$r?Buffer.from(t):new Buffer(t)}a(yml,"bufferFrom");Hmo.exports=yml});var Zmo=I((pse,f$r)=>{p();var _ml=jmo().SourceMapConsumer,l$r=require("path"),NB;try{NB=require("fs"),(!NB.existsSync||!NB.readFileSync)&&(NB=null)}catch{}var Eml=Gmo();function $mo(t,e){return t.require(e)}a($mo,"dynamicRequire");var Vmo=!1,Wmo=!1,u$r=!1,E9e="auto",fse={},v9e={},vml=/^data:application\/json[^,]+base64,/,yz=[],_z=[];function p$r(){return E9e==="browser"?!0:E9e==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(p$r,"isInBrowser");function Cml(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a(Cml,"hasGlobalProcessEventEmitter");function bml(){return typeof process=="object"&&process!==null?process.version:""}a(bml,"globalProcessVersion");function Sml(){if(typeof process=="object"&&process!==null)return process.stderr}a(Sml,"globalProcessStderr");function Tml(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(Tml,"globalProcessExit");function mDt(t){return function(e){for(var r=0;r";var r=this.getLineNumber();if(r!=null){e+=":"+r;var n=this.getColumnNumber();n&&(e+=":"+n)}}var o="",s=this.getFunctionName(),c=!0,l=this.isConstructor(),u=!(this.isToplevel()||l);if(u){var d=this.getTypeName();d==="[object Object]"&&(d="null");var f=this.getMethodName();s?(d&&s.indexOf(d)!=0&&(o+=d+"."),o+=s,f&&s.indexOf("."+f)!=s.length-f.length-1&&(o+=" [as "+f+"]")):o+=d+"."+(f||"")}else l?o+="new "+(s||""):s?o+=s:(o+=e,c=!1);return c&&(o+=" ("+e+")"),o}a(xml,"CallSiteToString");function zmo(t){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(function(r){e[r]=/^(?:is|get)/.test(r)?function(){return t[r].call(t)}:t[r]}),e.toString=xml,e}a(zmo,"cloneCallSite");function Kmo(t,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),t.isNative())return e.curPosition=null,t;var r=t.getFileName()||t.getScriptNameOrSourceURL();if(r){var n=t.getLineNumber(),o=t.getColumnNumber()-1,s=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,c=s.test(bml())?0:62;n===1&&o>c&&!p$r()&&!t.isEval()&&(o-=c);var l=g$r({source:r,line:n,column:o});e.curPosition=l,t=zmo(t);var u=t.getFunctionName;return t.getFunctionName=function(){return e.nextPosition==null?u():e.nextPosition.name||u()},t.getFileName=function(){return l.source},t.getLineNumber=function(){return l.line},t.getColumnNumber=function(){return l.column+1},t.getScriptNameOrSourceURL=function(){return l.source},t}var d=t.isEval()&&t.getEvalOrigin();return d&&(d=Ymo(d),t=zmo(t),t.getEvalOrigin=function(){return d}),t}a(Kmo,"wrapCallSite");function wml(t,e){u$r&&(fse={},v9e={});for(var r=t.name||"Error",n=t.message||"",o=r+": "+n,s={nextPosition:null,curPosition:null},c=[],l=e.length-1;l>=0;l--)c.push(` + at `+Kmo(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(wml,"prepareStackTrace");function Jmo(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=fse[r];if(!s&&NB&&NB.existsSync(r))try{s=NB.readFileSync(r,"utf8")}catch{s=""}if(s){var c=s.split(/(?:\r\n|\r|\n)/)[n-1];if(c)return r+":"+n+` `+c+` -`+new Array(o).join(" ")+"^"}}return null}a(Ymo,"getErrorSource");function xml(t){var e=Ymo(t),r=Cml();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),bml(1)}a(xml,"printErrorAndExit");function wml(){var t=process.emit;process.emit=function(e){if(e==="uncaughtException"){var r=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(r&&!n)return xml(arguments[1])}return t.apply(this,arguments)}}a(wml,"shimEmitUncaughtException");var Rml=Az.slice(0),kml=yz.slice(0);fse.wrapCallSite=zmo;fse.getErrorSource=Ymo;fse.mapSourcePosition=m$r;fse.retrieveSourceMap=h$r;fse.install=function(t){if(t=t||{},t.environment&&(E9e=t.environment,["node","browser","auto"].indexOf(E9e)===-1))throw new Error("environment "+E9e+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(Az.length=0),Az.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(yz.length=0),yz.unshift(t.retrieveSourceMap)),t.hookRequire&&!f$r()){var e=Hmo(d$r,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return dse[c]=s,v9e[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(l$r||(l$r="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),Gmo||(Gmo=!0,Error.prepareStackTrace=Iml),!$mo){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=Hmo(d$r,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Eml()&&($mo=!0,wml())}};fse.resetRetrieveHandlers=function(){Az.length=0,yz.length=0,Az=Rml.slice(0),yz=kml.slice(0),h$r=hDt(yz),p$r=hDt(Az)}});var Jmo=I(()=>{p();Kmo().install()});var Nml={};Ti(Nml,{getTokenizer:()=>Ms,getTokenizerAsync:()=>ZQ,main:()=>Xmo});module.exports=Wa(Nml);p();p();p();var E$r="auth.db",ogo=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],sgo=` +`+new Array(o).join(" ")+"^"}}return null}a(Jmo,"getErrorSource");function Rml(t){var e=Jmo(t),r=Sml();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),Tml(1)}a(Rml,"printErrorAndExit");function kml(){var t=process.emit;process.emit=function(e){if(e==="uncaughtException"){var r=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(r&&!n)return Rml(arguments[1])}return t.apply(this,arguments)}}a(kml,"shimEmitUncaughtException");var Pml=yz.slice(0),Dml=_z.slice(0);pse.wrapCallSite=Kmo;pse.getErrorSource=Jmo;pse.mapSourcePosition=g$r;pse.retrieveSourceMap=m$r;pse.install=function(t){if(t=t||{},t.environment&&(E9e=t.environment,["node","browser","auto"].indexOf(E9e)===-1))throw new Error("environment "+E9e+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(yz.length=0),yz.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(_z.length=0),_z.unshift(t.retrieveSourceMap)),t.hookRequire&&!p$r()){var e=$mo(f$r,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return fse[c]=s,v9e[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(u$r||(u$r="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),Vmo||(Vmo=!0,Error.prepareStackTrace=wml),!Wmo){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=$mo(f$r,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Cml()&&(Wmo=!0,kml())}};pse.resetRetrieveHandlers=function(){yz.length=0,_z.length=0,yz=Pml.slice(0),_z=Dml.slice(0),m$r=mDt(_z),h$r=mDt(yz)}});var Xmo=I(()=>{p();Zmo().install()});var Oml={};Ti(Oml,{getTokenizer:()=>Ms,getTokenizerAsync:()=>ZQ,main:()=>tgo});module.exports=Wa(Oml);p();p();p();var v$r="auth.db",ago=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],cgo=` CREATE TABLE IF NOT EXISTS oauth_tokens ( token_id INTEGER PRIMARY KEY AUTOINCREMENT, auth_authority TEXT NOT NULL, @@ -1654,83 +1654,83 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. last_used_at INTEGER NOT NULL, UNIQUE(auth_authority, oauth_client_id, user_login) ) -`,ago=` +`,lgo=` CREATE TABLE IF NOT EXISTS active_sessions ( editor_id TEXT PRIMARY KEY, token_id INTEGER NOT NULL REFERENCES oauth_tokens(token_id) ON DELETE CASCADE, activated_at INTEGER NOT NULL ) -`,cgo=` +`,ugo=` CREATE TABLE IF NOT EXISTS editor_signout ( editor_id TEXT PRIMARY KEY, signed_out_at INTEGER NOT NULL ) -`,lgo=` +`,dgo=` CREATE TABLE IF NOT EXISTS metadata ( key TEXT PRIMARY KEY, value TEXT NOT NULL ) -`,ugo=[sgo,ago,cgo,lgo];function ADt(t){for(let e of ogo)t.exec(e);return dgo(t),t}a(ADt,"applyPragmas");function dgo(t){let r=t.prepare("PRAGMA journal_mode").get()?.journal_mode;(typeof r=="string"?r.toLowerCase():void 0)!=="wal"&&t.exec("PRAGMA journal_mode = WAL")}a(dgo,"ensureWalMode");function yDt(t){for(let e of ugo)t.exec(e);return t}a(yDt,"applySchema");function _z(t,e){t.exec("BEGIN IMMEDIATE");try{let r=e();return t.exec("COMMIT"),r}catch(r){try{t.exec("ROLLBACK")}catch{}throw r}}a(_z,"runInWriteTx");p();p();p();var _Dt="github.copilot",v$r="github-enterprise";p();var qs=a((t,e)=>({editorId:t,displayName:e}),"id"),fgo=qs("unknown","Unknown"),C$r=qs("eclipse","Eclipse"),b$r=qs("xcode","Xcode"),Q9=qs("vim","Vim/Neovim"),S$r=qs("helix","Helix"),pgo={"copilot-eclipse":C$r,Copilot4Eclipse:C$r,"copilot-xcode":b$r,"Copilot for Xcode":b$r,"copilot-vs":qs("visual-studio","Visual Studio"),"copilot.vim":Q9,"copilot.lua":Q9,"Github Copilot LSP for Neovim":Q9,"coc-github-copilot":Q9,"nvim-lspconfig":Q9,"copilot-lsp-client-neovim":Q9,"neovim-copilot-lsp":Q9,"sidekick.nvim":Q9,"helix-copilot":S$r,"copilot-helix":S$r,"copilot-sublime":qs("sublime-text","Sublime Text"),"zed-copilot":qs("zed","Zed"),RStudio:qs("rstudio","RStudio"),"obsidian-copilot":qs("obsidian","Obsidian"),marimo:qs("marimo","marimo"),"Qt Creator Copilot plugin":qs("qt-creator","Qt Creator"),"godot-copilot":qs("godot","Godot"),"kakoune-lsp":qs("kakoune","Kakoune"),"typora-copilot":qs("typora","Typora"),"Copilot for Nova":qs("nova","Nova")},hgo={IU:qs("intellij","IntelliJ IDEA"),IC:qs("intellij","IntelliJ IDEA"),IE:qs("intellij","IntelliJ IDEA"),PY:qs("pycharm","PyCharm"),PC:qs("pycharm","PyCharm"),PE:qs("pycharm","PyCharm"),WS:qs("webstorm","WebStorm"),PS:qs("phpstorm","PhpStorm"),RD:qs("rider","Rider"),RM:qs("rubymine","RubyMine"),CL:qs("clion","CLion"),GO:qs("goland","GoLand"),RR:qs("rustrover","RustRover"),DB:qs("datagrip","DataGrip"),DS:qs("dataspell","DataSpell"),AI:qs("android-studio","Android Studio"),QA:qs("aqua","Aqua"),MPS:qs("mps","MPS"),JBC:qs("jetbrains-client","JetBrains Client"),GW:qs("jetbrains-gateway","JetBrains Gateway")},T$r="JetBrains-",mgo=qs("jetbrains","JetBrains IDE");function I$r(t){let e=t.plugin.name?.trim();if(!e)return fgo;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(T$r)){let n=hgo[r.slice(T$r.length)];if(n)return n}return mgo}return pgo[e]??qs(e,e)}a(I$r,"resolveEditorIdentity");p();p();p();p();var C9e=class{constructor(e){this.userInfo=e}static{a(this,"CopilotUserInfoWrapper")}get sku(){return this.userInfo?.access_type_sku}get isFreeUser(){return this.sku==="free_limited_copilot"}get isIndividualUser(){return this.copilotPlan==="free"||this.copilotPlan==="individual"||this.copilotPlan==="individual_pro"||this.copilotPlan==="individual_max"}get isTBBEnabled(){return this.userInfo?.token_based_billing===!0}get copilotPlan(){if(this.isFreeUser)return"free";let e=this.userInfo?.copilot_plan;switch(e){case"individual":case"individual_pro":case"individual_max":case"business":case"enterprise":return e;default:return"individual"}}get canUpgradePlan(){return this.userInfo?.can_upgrade_plan===!0}get quotaInfo(){return{quota_snapshots:this.userInfo?.quota_snapshots,quota_reset_date:this.userInfo?.quota_reset_date}}get cliEnabled(){return this.userInfo?.cli_enabled}get raw(){return this.userInfo}};p();function EDt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(EDt,"findKnownOrg");function x$r(t){let e=t.organization_list??[];return EDt(e)??""}a(x$r,"getUserKind");p();var Jf=class{static{a(this,"LogTarget")}},MB=class{static{a(this,"TelemetryLogSender")}},pe=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(Jf).logIt(e,r,this.category,...n)}debug(e,...r){this.log(e,4,...r)}info(e,...r){this.log(e,3,...r)}warn(e,...r){this.log(e,2,...r)}error(e,...r){this.log(e,1,...r)}exception(e,r,n){if(r instanceof Error&&r.name==="Canceled"&&r.message==="Canceled")return;let o=n;n.startsWith(".")&&(o=n.substring(1),n=`${this.category}${n}`),e.get(MB).sendException(e,r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e,1,`${o}:`,s)}},Br=new pe("default");p();p();p();p();async function JAo(){let{getDeviceId:t}=await Promise.resolve().then(()=>fe(ozr()));return t()}a(JAo,"loadDeviceId");var fx=class{constructor(e=JAo){this.resolvedId="";this.deviceIdPromise=(async()=>e())().catch(()=>"").then(r=>this.resolvedId=r)}static{a(this,"DevDeviceIdManager")}async getId(){return this.deviceIdPromise}getIdSync(){return this.resolvedId}};p();p();p();var sP=class{static{a(this,"InlineCompletionsUnification")}},ZAo={codeUnification:!1,modelUnification:!1,expAssignments:[]},yse=class extends sP{constructor(){super(...arguments);this.inlineCompletionsUnificationState=ZAo;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};var px=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return q9e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(sP).inlineCompletionsUnificationState.expAssignments.filter(c=>!this.assignmentContext.includes(c)),s=[this.assignmentContext,...o].filter(Boolean).join(";");r.properties["VSCode.ABExp.Features"]=this.features,r.properties["abexp.assignmentcontext"]=s}};p();var LE="X-Copilot-RelatedPluginVersion-",_se=(z=>(z.Market="X-MSEdge-Market",z.CorpNet="X-FD-Corpnet",z.Build="X-VSCode-Build",z.ApplicationVersion="X-VSCode-AppVersion",z.TargetPopulation="X-VSCode-TargetPopulation",z.ClientId="X-MSEdge-ClientId",z.DevDeviceId="X-VSCode-DevDeviceId",z.ExtensionName="X-VSCode-ExtensionName",z.ExtensionVersion="X-VSCode-ExtensionVersion",z.ExtensionRelease="X-VSCode-ExtensionRelease",z.CompletionsInChatExtensionVersion="X-VSCode-CompletionsInChatExtensionVersion",z.Language="X-VSCode-Language",z.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",z.CopilotEngine="X-Copilot-Engine",z.CopilotOverrideEngine="X-Copilot-OverrideEngine",z.CopilotRepository="X-Copilot-Repository",z.CopilotFileType="X-Copilot-FileType",z.CopilotUserKind="X-Copilot-UserKind",z.CopilotDogfood="X-Copilot-Dogfood",z.CopilotOrgs="X-Copilot-Orgs",z.CopilotTrackingId="X-Copilot-CopilotTrackingId",z.CopilotClientVersion="X-Copilot-ClientVersion",z.CopilotSku="X-GitHub-Copilot-SKU",z.CopilotIsFcv1="X-GitHub-Copilot-IsFcv1",z.CopilotIsSn="X-GitHub-Copilot-IsSn",z.CopilotRelatedPluginVersionCppTools=LE+"msvscodecpptools",z.CopilotRelatedPluginVersionCMakeTools=LE+"msvscodecmaketools",z.CopilotRelatedPluginVersionMakefileTools=LE+"msvscodemakefiletools",z.CopilotRelatedPluginVersionCSharpDevKit=LE+"msdotnettoolscsdevkit",z.CopilotRelatedPluginVersionPython=LE+"mspythonpython",z.CopilotRelatedPluginVersionPylance=LE+"mspythonvscodepylance",z.CopilotRelatedPluginVersionJavaPack=LE+"vscjavavscodejavapack",z.CopilotRelatedPluginVersionJavaManager=LE+"vscjavavscodejavadependency",z.CopilotRelatedPluginVersionTypescript=LE+"vscodetypescriptlanguagefeatures",z.CopilotRelatedPluginVersionTypescriptNext=LE+"msvscodevscodetypescriptnext",z.CopilotRelatedPluginVersionCSharp=LE+"msdotnettoolscsharp",z.CopilotRelatedPluginVersionGithubCopilotChat=LE+"githubcopilotchat",z.CopilotRelatedPluginVersionGithubCopilot=LE+"githubcopilot",z))(_se||{});var XAo={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},QB=class t{constructor(e){this.filters=e;for(let[r,n]of Object.entries(this.filters))n===""&&delete this.filters[r]}static{a(this,"FilterSettings")}extends(e){for(let[r,n]of Object.entries(e.filters))if(this.filters[r]!==n)return!1;return!0}addToTelemetry(e){for(let[r,n]of Object.entries(this.filters)){let o=XAo[r];o!==void 0&&(e.properties[o]=n)}}stringify(){let e=Object.keys(this.filters);return e.sort(),e.map(r=>`${r}:${this.filters[r]}`).join(";")}toHeaders(){return{...this.filters}}withChange(e,r){return new t({...this.filters,[e]:r})}};p();p();p();function ws(t,e){let r=n0(t,e,"event.CopilotToken");return t.get(Qt).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(ws,"onCopilotToken");function $Dt(t){let e=t.getTokenValue("tid"),r=t.organization_list,n=t.enterprise_list,o=t.getTokenValue("sku");if(!e)return;let s={copilot_trackingId:e};return r&&(s.organizations_list=r.toString()),n&&(s.enterprise_list=n.toString()),o&&(s.sku=o),s}a($Dt,"propertiesFromCopilotToken");var Gp=class{constructor(e){this.#e={};this.optedIn=!1;ws(e,r=>this.updateFromToken(r))}static{a(this,"TelemetryUserConfig")}#e;getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=$Dt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1")}};var I7e=fe(Y9()),x7e=fe(require("os"));var eyo=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function tyo(t){let e={type:t.name,value:t.message},r=t.stack?.replace(/^.*?:\d+\n.*\n *\^?\n\n/,"");if(r?.startsWith(t.toString()+` -`)){e.stacktrace=[];for(let n of r.slice(t.toString().length+1).split(/\n/).reverse()){let o=n.match(eyo),s={filename:"",function:""};o&&(s.function=o[2]?.trim()?.replace(/^[^.]{1,2}(\.|$)/,"_$1")??s.function,s.filename=(o[4]?.trim()??s.filename).replace(/^\.\/dist\//,"/github-copilot/dist/"),o[5]&&o[5]!==":0"&&(s.lineno=o[5].slice(1)),o[6]&&o[5]!==":0"&&(s.colno=o[6].slice(1)),s.in_app=!/[[<:]|(?:^|\/)node_modules\//.test(s.filename)),e.stacktrace.push(s)}}return e}a(tyo,"buildExceptionDetail");function zDt(t,e){let r=t.get(Ir),n=r.getEditorInfo(),o=t.get(Gp),s={"#editor":n.devName??n.name,"#editor_version":o1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":o1(r.getEditorPluginInfo()),"#session_id":t.get(za).sessionId,"#machine_id":t.get(za).machineId,"#architecture":x7e.arch(),"#os_platform":x7e.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(zDt,"buildContext");function pYr(t,e,r){let n=t.get(As),o=t.get(Ir).getEditorInfo(),s=typeof process<"u"?process.versions.node:"web",c={app:"copilot-client",rollup_id:"auto",platform:"node",release:n.getBuildType()!=="dev"?`copilot-client@${n.getVersion()}`:void 0,deployed_to:n.getBuildType(),catalog_service:o.name==="vscode"?"CopilotCompletionsVSCode":"CopilotLanguageServer",transaction:r,context:zDt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=tyo(d);c.exception_detail.unshift(h),l.unshift([d,h]),u+=1,d=d.cause}let f=[];for(let[h,m]of l)if(m.stacktrace&&m.stacktrace.length>0){f.push(`${m.type}: ${h.code??""}`);let g=[...m.stacktrace].reverse();for(let y of g)if(y.filename?.startsWith("/github-copilot/"))return c;let A=!1;for(let y of g)if(y.in_app){A=!0,f.push(`${y.filename?.replace(/^\.\//,"")}:${y.lineno}:${y.colno}`);break}A||f.push(r),f.push(`${g[0].filename?.replace(/^\.\//,"")}`)}else return c;return c.exception_detail.length>0&&(c.rollup_id=(0,I7e.SHA256)(I7e.enc.Utf16.parse(f.join(` -`))).toString()),c}a(pYr,"buildPayload");p();var w7e=class{static{a(this,"FailingTelemetryReporter")}sendTelemetryEvent(e,r,n){throw new Error("Telemetry disabled")}sendTelemetryErrorEvent(e,r,n,o){throw new Error("Telemetry disabled")}dispose(){return Promise.resolve()}hackOptOutListener(){}};p();p();var mYr=fe(Y9());var Sn=class{constructor(e=10){this.valueMap=new Map;if(e<1)throw new Error("Size limit must be at least 1");this.sizeLimit=e}static{a(this,"LRUCacheMap")}set(e,r){if(this.has(e))this.valueMap.delete(e);else if(this.valueMap.size>=this.sizeLimit){let n=this.valueMap.keys().next().value;this.delete(n)}return this.valueMap.set(e,r),this}get(e){if(this.valueMap.has(e)){let r=this.valueMap.get(e);return this.valueMap.delete(e),this.valueMap.set(e,r),r}}delete(e){return this.valueMap.delete(e)}clear(){this.valueMap.clear()}get size(){return this.valueMap.size}keys(){return new Map(this.valueMap).keys()}values(){return new Map(this.valueMap).values()}entries(){return new Map(this.valueMap).entries()}[Symbol.iterator](){return this.entries()}has(e){return this.valueMap.has(e)}forEach(e,r){new Map(this.valueMap).forEach(e,r)}get[Symbol.toStringTag](){return"LRUCacheMap"}peek(e){return this.valueMap.get(e)}},aP=class extends Sn{constructor(r,n=120*1e3){super(r);this.defaultTtl=n;this.expiration=new Map}static{a(this,"LRUExpirationCacheMap")}has(r){let n=!1,o=this.expiration.get(r);return o!==void 0&&(o>performance.now()&&(n=super.has(r)),n||this.delete(r)),n}get(r){let n=this.expiration.get(r);if(n!==void 0){if(n>performance.now())return super.get(r);this.delete(r)}}peek(r){let n=this.expiration.get(r);if(n!==void 0){if(n>performance.now())return super.peek(r);this.delete(r)}}set(r,n,o=this.defaultTtl){if(o<=0)throw new Error("TTL must be greater than 0");let s=super.set(r,n);return this.expiration.set(r,performance.now()+o),s}clear(){super.clear(),this.expiration.clear()}delete(r){return this.expiration.delete(r),super.delete(r)}get[Symbol.toStringTag](){return"LRUExpirationCacheMap"}},R7e=class extends Sn{static{a(this,"LRUDisposableCacheMap")}delete(e){let r=this.peek(e);return r&&r.dispose(),super.delete(e)}clear(){for(let e of this.values())e.dispose();super.clear()}uncache(e){let r=this.peek(e);return super.delete(e),r}dispose(){this.clear()}};var gYr=7*86400*1e3,PM=class{constructor(e=5){this.perWeek=e;this.cache=new Sn(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-gYr);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(AYr(t.replace(/\\/g,"/")),"gi"):new RegExp(AYr(t),"gi"));function nyo(t,e){if(!t||!t.includes("/")&&!t.includes("\\"))return t;let r=t,n=[];for(let l of e)for(;;){let u=l.exec(t);if(!u)break;n.push([u.index,l.lastIndex])}let o=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,s=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g,c=0;for(r="";;){let l=s.exec(t);if(!l)break;let u=n.some(([d,f])=>l.index",c=s.lastIndex)}return c`;return t}a(iyo,"removePropertiesWithPossibleUserInfo");function oyo(t){return t.replace(/([\s|(]|file:\/\/)(\/[^\s]+)/g,"$1[redacted]").replace(/([\s|(]|file:\/\/)([a-zA-Z]:[(\\|/){1,2}][^\s]+)/gi,"$1[redacted]").replace(/([\s|(]|file:\/\/)(\\[^\s]+)/gi,"$1[redacted]")}a(oyo,"redactPaths");function _Yr(t,e=ryo){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=iyo(s);if(c!==s){r[n]=c;continue}s=nyo(s,e);for(let l of e)s=s.replace(l,"");s=oyo(s),r[n]=s}return r}a(_Yr,"sanitizeTelemetryProperties");function K9(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(K9,"filterTelemetryProperties");p();var hx=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:vYr(r,n),verboseLogging:ayo(r,n),testMode:e,simulation:syo(n)})}};function s1(t){return t.get(hx).flags.testMode}a(s1,"isRunningInTest");function sSe(t){return s1(t)}a(sSe,"shouldFailForDebugPurposes");function aSe(t){return t.get(hx).flags.debug}a(aSe,"isDebugEnabled");function EYr(t){return t.get(hx).flags.verboseLogging}a(EYr,"isVerboseLoggingEnabled");function vYr(t,e){return t.includes("--debug")||KDt(e,"DEBUG")}a(vYr,"determineDebugFlag");function syo(t){return KDt(t,"SIMULATION")}a(syo,"determineSimulationFlag");function P7e(t){return t.get(hx).flags.simulation}a(P7e,"isRunningInSimulation");function ayo(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||KDt(e,"VERBOSE")||vYr(t,e)}a(ayo,"determineVerboseLoggingEnabled");function KDt(t,e){for(let r of["GH_COPILOT_","GITHUB_COPILOT_"]){let n=t[`${r}${e}`];if(n)return n==="1"||n?.toLowerCase()==="true"}return!1}a(KDt,"determineEnvFlagEnabled");p();var Ud=class{constructor(){this.promises=new Set}static{a(this,"PromiseQueue")}register(e){this.promises.add(e),e.finally(()=>this.promises.delete(e))}async flush(){await Promise.allSettled(this.promises)}};p();var SYr=require("os"),TYr=fe(require("path"));function cSe(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(cSe,"redactPaths");var cyo=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),lyo=[/^[\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}.]+ is not a function[ \w]*$/u,/^Cannot read properties of undefined \(reading '[\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}]+'\)$/u];function ZDt(t){if(cyo.has(t))return t;for(let e of lyo)if(e.test(t))return t;return cSe(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(ZDt,"redactMessage");function Ese(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Ese,"escapeForRegExp");var uyo=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+Ese((0,SYr.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function JDt(t){return t.replace(uyo,"~")}a(JDt,"redactHomeDir");var IYr="[\\\\/]?([^:)]*)(?=:\\d)",CYr=new RegExp(Ese(TYr.sep),"g"),bYr=new RegExp(Ese(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+IYr,"gi");function XDt(t,e,r=!1,n=[]){let o=new Error(e(t));o.name=t.name,typeof t.syscall=="string"&&(o.syscall=t.syscall),typeof t.code=="string"&&(o.code=t.code),typeof t.errno=="number"&&(o.errno=t.errno),o.stack=void 0;let s=t.stack?.replace(/^.*?:\d+\n.*\n *\^?\n\n/,""),c;for(let l of[t.toString(),`${t.name}: ${t.message}`])if(s?.startsWith(l+` -`)){c=s.slice(l.length+1).split(/\n/);break}if(c){o.stack=o.toString();for(let l of c)if(bYr.test(l))o.stack+=` -${cSe(l.replace(bYr,(u,d)=>"./"+d.replace(CYr,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` -${cSe(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(Ese(f.replace(/[\\/]$/,""))+IYr,"gi");if(h.test(l)){o.stack+=` -${cSe(l.replace(h,(m,g)=>d+g.replace(CYr,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` -${JDt(l)}`:o.stack+=` - at [redacted]:0:0`}}else r&&s&&(o.stack=JDt(s));return t.cause instanceof Error&&(o.cause=XDt(t.cause,e,r,n)),o}a(XDt,"cloneError");function xYr(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(xYr,"errorMessageWithoutPath");function wYr(t,e){return XDt(t,a(function(n){return JDt(xYr(n))},"prepareMessage"),!0,e)}a(wYr,"prepareErrorForRestrictedTelemetry");function RYr(t,e,r=!1){return XDt(t,a(function(o){if(r)return ZDt(xYr(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=cSe(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(RYr,"redactError");p();p();var Zy={};Ti(Zy,{HasPropertyKey:()=>D7e,IsArray:()=>$p,IsAsyncIterator:()=>eNt,IsBigInt:()=>lSe,IsBoolean:()=>jB,IsDate:()=>bz,IsFunction:()=>tNt,IsIterator:()=>rNt,IsNull:()=>nNt,IsNumber:()=>a1,IsObject:()=>al,IsRegExp:()=>uSe,IsString:()=>Zl,IsSymbol:()=>iNt,IsUint8Array:()=>HB,IsUndefined:()=>Vp});p();function D7e(t,e){return e in t}a(D7e,"HasPropertyKey");function eNt(t){return al(t)&&!$p(t)&&!HB(t)&&Symbol.asyncIterator in t}a(eNt,"IsAsyncIterator");function $p(t){return Array.isArray(t)}a($p,"IsArray");function lSe(t){return typeof t=="bigint"}a(lSe,"IsBigInt");function jB(t){return typeof t=="boolean"}a(jB,"IsBoolean");function bz(t){return t instanceof globalThis.Date}a(bz,"IsDate");function tNt(t){return typeof t=="function"}a(tNt,"IsFunction");function rNt(t){return al(t)&&!$p(t)&&!HB(t)&&Symbol.iterator in t}a(rNt,"IsIterator");function nNt(t){return t===null}a(nNt,"IsNull");function a1(t){return typeof t=="number"}a(a1,"IsNumber");function al(t){return typeof t=="object"&&t!==null}a(al,"IsObject");function uSe(t){return t instanceof globalThis.RegExp}a(uSe,"IsRegExp");function Zl(t){return typeof t=="string"}a(Zl,"IsString");function iNt(t){return typeof t=="symbol"}a(iNt,"IsSymbol");function HB(t){return t instanceof globalThis.Uint8Array}a(HB,"IsUint8Array");function Vp(t){return t===void 0}a(Vp,"IsUndefined");function dyo(t){return t.map(e=>N7e(e))}a(dyo,"ArrayType");function fyo(t){return new Date(t.getTime())}a(fyo,"DateType");function pyo(t){return new Uint8Array(t)}a(pyo,"Uint8ArrayType");function hyo(t){return new RegExp(t.source,t.flags)}a(hyo,"RegExpType");function myo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=N7e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=N7e(t[r]);return e}a(myo,"ObjectType");function N7e(t){return $p(t)?dyo(t):bz(t)?fyo(t):HB(t)?pyo(t):uSe(t)?hyo(t):al(t)?myo(t):t}a(N7e,"Visit");function zu(t){return N7e(t)}a(zu,"Clone");function vse(t,e){return e===void 0?zu(t):zu({...e,...t})}a(vse,"CloneType");p();p();p();function M7e(t){return To(t)&&globalThis.Symbol.asyncIterator in t}a(M7e,"IsAsyncIterator");function O7e(t){return To(t)&&globalThis.Symbol.iterator in t}a(O7e,"IsIterator");function oNt(t){return To(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(oNt,"IsStandardObject");function L7e(t){return t instanceof globalThis.Promise}a(L7e,"IsPromise");function BE(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(BE,"IsDate");function kYr(t){return t instanceof globalThis.Map}a(kYr,"IsMap");function PYr(t){return t instanceof globalThis.Set}a(PYr,"IsSet");function mx(t){return globalThis.ArrayBuffer.isView(t)}a(mx,"IsTypedArray");function Cse(t){return t instanceof globalThis.Uint8Array}a(Cse,"IsUint8Array");function Hi(t,e){return e in t}a(Hi,"HasPropertyKey");function To(t){return t!==null&&typeof t=="object"}a(To,"IsObject");function Mi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(Mi,"IsArray");function Yu(t){return t===void 0}a(Yu,"IsUndefined");function GB(t){return t===null}a(GB,"IsNull");function DM(t){return typeof t=="boolean"}a(DM,"IsBoolean");function ui(t){return typeof t=="number"}a(ui,"IsNumber");function B7e(t){return globalThis.Number.isInteger(t)}a(B7e,"IsInteger");function TA(t){return typeof t=="bigint"}a(TA,"IsBigInt");function pa(t){return typeof t=="string"}a(pa,"IsString");function J9(t){return typeof t=="function"}a(J9,"IsFunction");function $B(t){return typeof t=="symbol"}a($B,"IsSymbol");function c1(t){return TA(t)||DM(t)||GB(t)||ui(t)||pa(t)||$B(t)||Yu(t)}a(c1,"IsValueType");var yu;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(c,l){return t.ExactOptionalPropertyTypes?l in c:c[l]!==void 0}a(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function r(c){let l=To(c);return t.AllowArrayObject?l:l&&!Mi(c)}a(r,"IsObjectLike"),t.IsObjectLike=r;function n(c){return r(c)&&!(c instanceof Date)&&!(c instanceof Uint8Array)}a(n,"IsRecordLike"),t.IsRecordLike=n;function o(c){return t.AllowNaN?ui(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=Yu(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(yu||(yu={}));p();function gyo(t){return globalThis.Object.freeze(t).map(e=>dSe(e))}a(gyo,"ImmutableArray");function Ayo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=dSe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=dSe(t[r]);return globalThis.Object.freeze(e)}a(Ayo,"ImmutableObject");function dSe(t){return $p(t)?gyo(t):bz(t)?t:HB(t)?t:uSe(t)?t:al(t)?Ayo(t):t}a(dSe,"Immutable");function wt(t,e){let r=e!==void 0?{...e,...t}:t;switch(yu.InstanceMode){case"freeze":return dSe(r);case"clone":return zu(r);default:return r}}a(wt,"CreateType");p();var Gi=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};p();p();p();var Qd=Symbol.for("TypeBox.Transform"),cP=Symbol.for("TypeBox.Readonly"),IA=Symbol.for("TypeBox.Optional"),gx=Symbol.for("TypeBox.Hint"),St=Symbol.for("TypeBox.Kind");function bse(t){return al(t)&&t[cP]==="Readonly"}a(bse,"IsReadonly");function bC(t){return al(t)&&t[IA]==="Optional"}a(bC,"IsOptional");function sNt(t){return ha(t,"Any")}a(sNt,"IsAny");function aNt(t){return ha(t,"Argument")}a(aNt,"IsArgument");function lP(t){return ha(t,"Array")}a(lP,"IsArray");function Sz(t){return ha(t,"AsyncIterator")}a(Sz,"IsAsyncIterator");function Tz(t){return ha(t,"BigInt")}a(Tz,"IsBigInt");function VB(t){return ha(t,"Boolean")}a(VB,"IsBoolean");function uP(t){return ha(t,"Computed")}a(uP,"IsComputed");function dP(t){return ha(t,"Constructor")}a(dP,"IsConstructor");function yyo(t){return ha(t,"Date")}a(yyo,"IsDate");function fP(t){return ha(t,"Function")}a(fP,"IsFunction");function pP(t){return ha(t,"Integer")}a(pP,"IsInteger");function _f(t){return ha(t,"Intersect")}a(_f,"IsIntersect");function Iz(t){return ha(t,"Iterator")}a(Iz,"IsIterator");function ha(t,e){return al(t)&&St in t&&t[St]===e}a(ha,"IsKindOf");function F7e(t){return jB(t)||a1(t)||Zl(t)}a(F7e,"IsLiteralValue");function l1(t){return ha(t,"Literal")}a(l1,"IsLiteral");function u1(t){return ha(t,"MappedKey")}a(u1,"IsMappedKey");function Ku(t){return ha(t,"MappedResult")}a(Ku,"IsMappedResult");function Z9(t){return ha(t,"Never")}a(Z9,"IsNever");function _yo(t){return ha(t,"Not")}a(_yo,"IsNot");function fSe(t){return ha(t,"Null")}a(fSe,"IsNull");function hP(t){return ha(t,"Number")}a(hP,"IsNumber");function Wp(t){return ha(t,"Object")}a(Wp,"IsObject");function xz(t){return ha(t,"Promise")}a(xz,"IsPromise");function wz(t){return ha(t,"Record")}a(wz,"IsRecord");function Zf(t){return ha(t,"Ref")}a(Zf,"IsRef");function cNt(t){return ha(t,"RegExp")}a(cNt,"IsRegExp");function WB(t){return ha(t,"String")}a(WB,"IsString");function pSe(t){return ha(t,"Symbol")}a(pSe,"IsSymbol");function d1(t){return ha(t,"TemplateLiteral")}a(d1,"IsTemplateLiteral");function Eyo(t){return ha(t,"This")}a(Eyo,"IsThis");function uc(t){return al(t)&&Qd in t}a(uc,"IsTransform");function f1(t){return ha(t,"Tuple")}a(f1,"IsTuple");function zB(t){return ha(t,"Undefined")}a(zB,"IsUndefined");function Pa(t){return ha(t,"Union")}a(Pa,"IsUnion");function vyo(t){return ha(t,"Uint8Array")}a(vyo,"IsUint8Array");function Cyo(t){return ha(t,"Unknown")}a(Cyo,"IsUnknown");function byo(t){return ha(t,"Unsafe")}a(byo,"IsUnsafe");function Syo(t){return ha(t,"Void")}a(Syo,"IsVoid");function X9(t){return al(t)&&St in t&&Zl(t[St])}a(X9,"IsKind");function qd(t){return sNt(t)||aNt(t)||lP(t)||VB(t)||Tz(t)||Sz(t)||uP(t)||dP(t)||yyo(t)||fP(t)||pP(t)||_f(t)||Iz(t)||l1(t)||u1(t)||Ku(t)||Z9(t)||_yo(t)||fSe(t)||hP(t)||Wp(t)||xz(t)||wz(t)||Zf(t)||cNt(t)||WB(t)||pSe(t)||d1(t)||Eyo(t)||f1(t)||zB(t)||Pa(t)||vyo(t)||Cyo(t)||byo(t)||Syo(t)||X9(t)}a(qd,"IsSchema");var it={};Ti(it,{IsAny:()=>OYr,IsArgument:()=>LYr,IsArray:()=>BYr,IsAsyncIterator:()=>FYr,IsBigInt:()=>UYr,IsBoolean:()=>QYr,IsComputed:()=>qYr,IsConstructor:()=>jYr,IsDate:()=>HYr,IsFunction:()=>GYr,IsImport:()=>kyo,IsInteger:()=>$Yr,IsIntersect:()=>VYr,IsIterator:()=>WYr,IsKind:()=>_Kr,IsKindOf:()=>js,IsLiteral:()=>mSe,IsLiteralBoolean:()=>Pyo,IsLiteralNumber:()=>YYr,IsLiteralString:()=>zYr,IsLiteralValue:()=>KYr,IsMappedKey:()=>JYr,IsMappedResult:()=>ZYr,IsNever:()=>XYr,IsNot:()=>eKr,IsNull:()=>tKr,IsNumber:()=>rKr,IsObject:()=>nKr,IsOptional:()=>Ryo,IsPromise:()=>iKr,IsProperties:()=>U7e,IsReadonly:()=>wyo,IsRecord:()=>oKr,IsRecursive:()=>Dyo,IsRef:()=>sKr,IsRegExp:()=>aKr,IsSchema:()=>Ju,IsString:()=>cKr,IsSymbol:()=>lKr,IsTemplateLiteral:()=>uKr,IsThis:()=>dKr,IsTransform:()=>fKr,IsTuple:()=>pKr,IsUint8Array:()=>mKr,IsUndefined:()=>hKr,IsUnion:()=>fNt,IsUnionLiteral:()=>Nyo,IsUnknown:()=>gKr,IsUnsafe:()=>AKr,IsVoid:()=>yKr,TypeGuardUnknownTypeError:()=>lNt});p();var lNt=class extends Gi{static{a(this,"TypeGuardUnknownTypeError")}},Tyo=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function DYr(t){try{return new RegExp(t),!0}catch{return!1}}a(DYr,"IsPattern");function uNt(t){if(!Zl(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(uNt,"IsControlCharacterFree");function NYr(t){return dNt(t)||Ju(t)}a(NYr,"IsAdditionalProperties");function hSe(t){return Vp(t)||lSe(t)}a(hSe,"IsOptionalBigInt");function Xl(t){return Vp(t)||a1(t)}a(Xl,"IsOptionalNumber");function dNt(t){return Vp(t)||jB(t)}a(dNt,"IsOptionalBoolean");function cl(t){return Vp(t)||Zl(t)}a(cl,"IsOptionalString");function Iyo(t){return Vp(t)||Zl(t)&&uNt(t)&&DYr(t)}a(Iyo,"IsOptionalPattern");function xyo(t){return Vp(t)||Zl(t)&&uNt(t)}a(xyo,"IsOptionalFormat");function MYr(t){return Vp(t)||Ju(t)}a(MYr,"IsOptionalSchema");function wyo(t){return al(t)&&t[cP]==="Readonly"}a(wyo,"IsReadonly");function Ryo(t){return al(t)&&t[IA]==="Optional"}a(Ryo,"IsOptional");function OYr(t){return js(t,"Any")&&cl(t.$id)}a(OYr,"IsAny");function LYr(t){return js(t,"Argument")&&a1(t.index)}a(LYr,"IsArgument");function BYr(t){return js(t,"Array")&&t.type==="array"&&cl(t.$id)&&Ju(t.items)&&Xl(t.minItems)&&Xl(t.maxItems)&&dNt(t.uniqueItems)&&MYr(t.contains)&&Xl(t.minContains)&&Xl(t.maxContains)}a(BYr,"IsArray");function FYr(t){return js(t,"AsyncIterator")&&t.type==="AsyncIterator"&&cl(t.$id)&&Ju(t.items)}a(FYr,"IsAsyncIterator");function UYr(t){return js(t,"BigInt")&&t.type==="bigint"&&cl(t.$id)&&hSe(t.exclusiveMaximum)&&hSe(t.exclusiveMinimum)&&hSe(t.maximum)&&hSe(t.minimum)&&hSe(t.multipleOf)}a(UYr,"IsBigInt");function QYr(t){return js(t,"Boolean")&&t.type==="boolean"&&cl(t.$id)}a(QYr,"IsBoolean");function qYr(t){return js(t,"Computed")&&Zl(t.target)&&$p(t.parameters)&&t.parameters.every(e=>Ju(e))}a(qYr,"IsComputed");function jYr(t){return js(t,"Constructor")&&t.type==="Constructor"&&cl(t.$id)&&$p(t.parameters)&&t.parameters.every(e=>Ju(e))&&Ju(t.returns)}a(jYr,"IsConstructor");function HYr(t){return js(t,"Date")&&t.type==="Date"&&cl(t.$id)&&Xl(t.exclusiveMaximumTimestamp)&&Xl(t.exclusiveMinimumTimestamp)&&Xl(t.maximumTimestamp)&&Xl(t.minimumTimestamp)&&Xl(t.multipleOfTimestamp)}a(HYr,"IsDate");function GYr(t){return js(t,"Function")&&t.type==="Function"&&cl(t.$id)&&$p(t.parameters)&&t.parameters.every(e=>Ju(e))&&Ju(t.returns)}a(GYr,"IsFunction");function kyo(t){return js(t,"Import")&&D7e(t,"$defs")&&al(t.$defs)&&U7e(t.$defs)&&D7e(t,"$ref")&&Zl(t.$ref)&&t.$ref in t.$defs}a(kyo,"IsImport");function $Yr(t){return js(t,"Integer")&&t.type==="integer"&&cl(t.$id)&&Xl(t.exclusiveMaximum)&&Xl(t.exclusiveMinimum)&&Xl(t.maximum)&&Xl(t.minimum)&&Xl(t.multipleOf)}a($Yr,"IsInteger");function U7e(t){return al(t)&&Object.entries(t).every(([e,r])=>uNt(e)&&Ju(r))}a(U7e,"IsProperties");function VYr(t){return js(t,"Intersect")&&!(Zl(t.type)&&t.type!=="object")&&$p(t.allOf)&&t.allOf.every(e=>Ju(e)&&!fKr(e))&&cl(t.type)&&(dNt(t.unevaluatedProperties)||MYr(t.unevaluatedProperties))&&cl(t.$id)}a(VYr,"IsIntersect");function WYr(t){return js(t,"Iterator")&&t.type==="Iterator"&&cl(t.$id)&&Ju(t.items)}a(WYr,"IsIterator");function js(t,e){return al(t)&&St in t&&t[St]===e}a(js,"IsKindOf");function zYr(t){return mSe(t)&&Zl(t.const)}a(zYr,"IsLiteralString");function YYr(t){return mSe(t)&&a1(t.const)}a(YYr,"IsLiteralNumber");function Pyo(t){return mSe(t)&&jB(t.const)}a(Pyo,"IsLiteralBoolean");function mSe(t){return js(t,"Literal")&&cl(t.$id)&&KYr(t.const)}a(mSe,"IsLiteral");function KYr(t){return jB(t)||a1(t)||Zl(t)}a(KYr,"IsLiteralValue");function JYr(t){return js(t,"MappedKey")&&$p(t.keys)&&t.keys.every(e=>a1(e)||Zl(e))}a(JYr,"IsMappedKey");function ZYr(t){return js(t,"MappedResult")&&U7e(t.properties)}a(ZYr,"IsMappedResult");function XYr(t){return js(t,"Never")&&al(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(XYr,"IsNever");function eKr(t){return js(t,"Not")&&Ju(t.not)}a(eKr,"IsNot");function tKr(t){return js(t,"Null")&&t.type==="null"&&cl(t.$id)}a(tKr,"IsNull");function rKr(t){return js(t,"Number")&&t.type==="number"&&cl(t.$id)&&Xl(t.exclusiveMaximum)&&Xl(t.exclusiveMinimum)&&Xl(t.maximum)&&Xl(t.minimum)&&Xl(t.multipleOf)}a(rKr,"IsNumber");function nKr(t){return js(t,"Object")&&t.type==="object"&&cl(t.$id)&&U7e(t.properties)&&NYr(t.additionalProperties)&&Xl(t.minProperties)&&Xl(t.maxProperties)}a(nKr,"IsObject");function iKr(t){return js(t,"Promise")&&t.type==="Promise"&&cl(t.$id)&&Ju(t.item)}a(iKr,"IsPromise");function oKr(t){return js(t,"Record")&&t.type==="object"&&cl(t.$id)&&NYr(t.additionalProperties)&&al(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&DYr(r[0])&&al(e.patternProperties)&&Ju(e.patternProperties[r[0]])})(t)}a(oKr,"IsRecord");function Dyo(t){return al(t)&&gx in t&&t[gx]==="Recursive"}a(Dyo,"IsRecursive");function sKr(t){return js(t,"Ref")&&cl(t.$id)&&Zl(t.$ref)}a(sKr,"IsRef");function aKr(t){return js(t,"RegExp")&&cl(t.$id)&&Zl(t.source)&&Zl(t.flags)&&Xl(t.maxLength)&&Xl(t.minLength)}a(aKr,"IsRegExp");function cKr(t){return js(t,"String")&&t.type==="string"&&cl(t.$id)&&Xl(t.minLength)&&Xl(t.maxLength)&&Iyo(t.pattern)&&xyo(t.format)}a(cKr,"IsString");function lKr(t){return js(t,"Symbol")&&t.type==="symbol"&&cl(t.$id)}a(lKr,"IsSymbol");function uKr(t){return js(t,"TemplateLiteral")&&t.type==="string"&&Zl(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(uKr,"IsTemplateLiteral");function dKr(t){return js(t,"This")&&cl(t.$id)&&Zl(t.$ref)}a(dKr,"IsThis");function fKr(t){return al(t)&&Qd in t}a(fKr,"IsTransform");function pKr(t){return js(t,"Tuple")&&t.type==="array"&&cl(t.$id)&&a1(t.minItems)&&a1(t.maxItems)&&t.minItems===t.maxItems&&(Vp(t.items)&&Vp(t.additionalItems)&&t.minItems===0||$p(t.items)&&t.items.every(e=>Ju(e)))}a(pKr,"IsTuple");function hKr(t){return js(t,"Undefined")&&t.type==="undefined"&&cl(t.$id)}a(hKr,"IsUndefined");function Nyo(t){return fNt(t)&&t.anyOf.every(e=>zYr(e)||YYr(e))}a(Nyo,"IsUnionLiteral");function fNt(t){return js(t,"Union")&&cl(t.$id)&&al(t)&&$p(t.anyOf)&&t.anyOf.every(e=>Ju(e))}a(fNt,"IsUnion");function mKr(t){return js(t,"Uint8Array")&&t.type==="Uint8Array"&&cl(t.$id)&&Xl(t.minByteLength)&&Xl(t.maxByteLength)}a(mKr,"IsUint8Array");function gKr(t){return js(t,"Unknown")&&cl(t.$id)}a(gKr,"IsUnknown");function AKr(t){return js(t,"Unsafe")}a(AKr,"IsUnsafe");function yKr(t){return js(t,"Void")&&t.type==="void"&&cl(t.$id)}a(yKr,"IsVoid");function _Kr(t){return al(t)&&St in t&&Zl(t[St])&&!Tyo.includes(t[St])}a(_Kr,"IsKind");function Ju(t){return al(t)&&(OYr(t)||LYr(t)||BYr(t)||QYr(t)||UYr(t)||FYr(t)||qYr(t)||jYr(t)||HYr(t)||GYr(t)||$Yr(t)||VYr(t)||WYr(t)||mSe(t)||JYr(t)||ZYr(t)||XYr(t)||eKr(t)||tKr(t)||rKr(t)||nKr(t)||iKr(t)||oKr(t)||sKr(t)||aKr(t)||cKr(t)||lKr(t)||uKr(t)||dKr(t)||pKr(t)||hKr(t)||fNt(t)||mKr(t)||gKr(t)||AKr(t)||yKr(t)||_Kr(t))}a(Ju,"IsSchema");p();var pNt="(true|false)",gSe="(0|[1-9][0-9]*)",hNt="(.*)",Myo="(?!.*)",Bvl=`^${pNt}$`,e7=`^${gSe}$`,t7=`^${hNt}$`,EKr=`^${Myo}$`;p();var mP={};Ti(mP,{Clear:()=>Lyo,Delete:()=>Byo,Entries:()=>Oyo,Get:()=>Qyo,Has:()=>Fyo,Set:()=>Uyo});p();var Sse=new Map;function Oyo(){return new Map(Sse)}a(Oyo,"Entries");function Lyo(){return Sse.clear()}a(Lyo,"Clear");function Byo(t){return Sse.delete(t)}a(Byo,"Delete");function Fyo(t){return Sse.has(t)}a(Fyo,"Has");function Uyo(t,e){Sse.set(t,e)}a(Uyo,"Set");function Qyo(t){return Sse.get(t)}a(Qyo,"Get");var FE={};Ti(FE,{Clear:()=>jyo,Delete:()=>Hyo,Entries:()=>qyo,Get:()=>Vyo,Has:()=>Gyo,Set:()=>$yo});p();var Tse=new Map;function qyo(){return new Map(Tse)}a(qyo,"Entries");function jyo(){return Tse.clear()}a(jyo,"Clear");function Hyo(t){return Tse.delete(t)}a(Hyo,"Delete");function Gyo(t){return Tse.has(t)}a(Gyo,"Has");function $yo(t,e){Tse.set(t,e)}a($yo,"Set");function Vyo(t){return Tse.get(t)}a(Vyo,"Get");p();function vKr(t,e){return t.includes(e)}a(vKr,"SetIncludes");function CKr(t){return[...new Set(t)]}a(CKr,"SetDistinct");function Wyo(t,e){return t.filter(r=>e.includes(r))}a(Wyo,"SetIntersect");function zyo(t,e){return t.reduce((r,n)=>Wyo(r,n),e)}a(zyo,"SetIntersectManyResolve");function bKr(t){return t.length===1?t[0]:t.length>1?zyo(t.slice(1),t[0]):[]}a(bKr,"SetIntersectMany");function SKr(t){let e=[];for(let r of t)e.push(...r);return e}a(SKr,"SetUnionMany");p();function r7(t){return wt({[St]:"Any"},t)}a(r7,"Any");p();function Ise(t,e){return wt({[St]:"Array",type:"array",items:t},e)}a(Ise,"Array");p();function TKr(t){return wt({[St]:"Argument",index:t})}a(TKr,"Argument");p();function xse(t,e){return wt({[St]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(xse,"AsyncIterator");p();p();function _u(t,e,r){return wt({[St]:"Computed",target:t,parameters:e},r)}a(_u,"Computed");p();p();function Yyo(t,e){let{[e]:r,...n}=t;return n}a(Yyo,"DiscardKey");function Ef(t,e){return e.reduce((r,n)=>Yyo(r,n),t)}a(Ef,"Discard");p();function is(t){return wt({[St]:"Never",not:{}},t)}a(is,"Never");p();p();function Ya(t){return wt({[St]:"MappedResult",properties:t})}a(Ya,"MappedResult");p();p();function wse(t,e,r){return wt({[St]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(wse,"Constructor");p();function NM(t,e,r){return wt({[St]:"Function",type:"Function",parameters:t,returns:e},r)}a(NM,"Function");p();p();p();p();function ASe(t,e){return wt({[St]:"Union",anyOf:t},e)}a(ASe,"UnionCreate");function Kyo(t){return t.some(e=>bC(e))}a(Kyo,"IsUnionOptional");function IKr(t){return t.map(e=>bC(e)?Jyo(e):e)}a(IKr,"RemoveOptionalFromRest");function Jyo(t){return Ef(t,[IA])}a(Jyo,"RemoveOptionalFromType");function Zyo(t,e){return Kyo(t)?Xy(ASe(IKr(t),e)):ASe(IKr(t),e)}a(Zyo,"ResolveUnion");function MM(t,e){return t.length===1?wt(t[0],e):t.length===0?is(e):Zyo(t,e)}a(MM,"UnionEvaluated");p();function dc(t,e){return t.length===0?is(e):t.length===1?wt(t[0],e):ASe(t,e)}a(dc,"Union");p();p();p();var Q7e=class extends Gi{static{a(this,"TemplateLiteralParserError")}};function Xyo(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(Xyo,"Unescape");function mNt(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(mNt,"IsNonEscaped");function KB(t,e){return mNt(t,e,"(")}a(KB,"IsOpenParen");function ySe(t,e){return mNt(t,e,")")}a(ySe,"IsCloseParen");function xKr(t,e){return mNt(t,e,"|")}a(xKr,"IsSeparator");function e_o(t){if(!(KB(t,0)&&ySe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Rse(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Rse(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(i_o,"Or");function o_o(t){function e(o,s){if(!KB(o,s))throw new Q7e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Rse(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(o_o,"And");function Rse(t){return e_o(t)?Rse(t_o(t)):r_o(t)?i_o(t):n_o(t)?o_o(t):{type:"const",const:Xyo(t)}}a(Rse,"TemplateLiteralParse");function kse(t){return Rse(t.slice(1,t.length-1))}a(kse,"TemplateLiteralParseExact");var gNt=class extends Gi{static{a(this,"TemplateLiteralFiniteError")}};function s_o(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}a(s_o,"IsNumberExpression");function a_o(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}a(a_o,"IsBooleanExpression");function c_o(t){return t.type==="const"&&t.const===".*"}a(c_o,"IsStringExpression");function Rz(t){return s_o(t)||c_o(t)?!1:a_o(t)?!0:t.type==="and"?t.expr.every(e=>Rz(e)):t.type==="or"?t.expr.every(e=>Rz(e)):t.type==="const"?!0:(()=>{throw new gNt("Unknown expression type")})()}a(Rz,"IsTemplateLiteralExpressionFinite");function q7e(t){let e=kse(t.pattern);return Rz(e)}a(q7e,"IsTemplateLiteralFinite");p();var ANt=class extends Gi{static{a(this,"TemplateLiteralGenerateError")}};function*wKr(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of wKr(t.slice(1)))yield`${e}${r}`}a(wKr,"GenerateReduce");function*l_o(t){return yield*wKr(t.expr.map(e=>[..._Se(e)]))}a(l_o,"GenerateAnd");function*u_o(t){for(let e of t.expr)yield*_Se(e)}a(u_o,"GenerateOr");function*d_o(t){return yield t.const}a(d_o,"GenerateConst");function*_Se(t){return t.type==="and"?yield*l_o(t):t.type==="or"?yield*u_o(t):t.type==="const"?yield*d_o(t):(()=>{throw new ANt("Unknown expression")})()}a(_Se,"TemplateLiteralExpressionGenerate");function Pse(t){let e=kse(t.pattern);return Rz(e)?[..._Se(e)]:[]}a(Pse,"TemplateLiteralGenerate");p();p();function ma(t,e){return wt({[St]:"Literal",const:t,type:typeof t},e)}a(ma,"Literal");p();function j7e(t){return wt({[St]:"Boolean",type:"boolean"},t)}a(j7e,"Boolean");p();function Dse(t){return wt({[St]:"BigInt",type:"bigint"},t)}a(Dse,"BigInt");p();function Ax(t){return wt({[St]:"Number",type:"number"},t)}a(Ax,"Number");p();function UE(t){return wt({[St]:"String",type:"string"},t)}a(UE,"String");function*f_o(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield j7e():e==="number"?yield Ax():e==="bigint"?yield Dse():e==="string"?yield UE():yield(()=>{let r=e.split("|").map(n=>ma(n.trim()));return r.length===0?is():r.length===1?r[0]:MM(r)})()}a(f_o,"FromUnion");function*p_o(t){if(t[1]!=="{"){let e=ma("$"),r=yNt(t.slice(1));return yield*[e,...r]}for(let e=2;ekKr(r,e)).join("|")})`:hP(t)?`${e}${gSe}`:pP(t)?`${e}${gSe}`:Tz(t)?`${e}${gSe}`:WB(t)?`${e}${hNt}`:l1(t)?`${e}${h_o(t.const.toString())}`:VB(t)?`${e}${pNt}`:(()=>{throw new _Nt(`Unexpected Kind '${t[St]}'`)})()}a(kKr,"Visit");function ENt(t){return`^${t.map(e=>kKr(e,"")).join("")}$`}a(ENt,"TemplateLiteralPattern");p();function kz(t){let r=Pse(t).map(n=>ma(n));return MM(r)}a(kz,"TemplateLiteralToUnion");p();function H7e(t,e){let r=Zl(t)?ENt(RKr(t)):ENt(t);return wt({[St]:"TemplateLiteral",type:"string",pattern:r},e)}a(H7e,"TemplateLiteral");function m_o(t){return Pse(t).map(r=>r.toString())}a(m_o,"FromTemplateLiteral");function g_o(t){let e=[];for(let r of t)e.push(...SC(r));return e}a(g_o,"FromUnion");function A_o(t){return[t.toString()]}a(A_o,"FromLiteral");function SC(t){return[...new Set(d1(t)?m_o(t):Pa(t)?g_o(t.anyOf):l1(t)?A_o(t.const):hP(t)?["[number]"]:pP(t)?["[number]"]:[])]}a(SC,"IndexPropertyKeys");p();function y_o(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=n7(t,SC(e[o]),r);return n}a(y_o,"FromProperties");function __o(t,e,r){return y_o(t,e.properties,r)}a(__o,"FromMappedResult");function PKr(t,e,r){let n=__o(t,e,r);return Ya(n)}a(PKr,"IndexFromMappedResult");function NKr(t,e){return t.map(r=>MKr(r,e))}a(NKr,"FromRest");function E_o(t){return t.filter(e=>!Z9(e))}a(E_o,"FromIntersectRest");function v_o(t,e){return G7e(E_o(NKr(t,e)))}a(v_o,"FromIntersect");function C_o(t){return t.some(e=>Z9(e))?[]:t}a(C_o,"FromUnionRest");function b_o(t,e){return MM(C_o(NKr(t,e)))}a(b_o,"FromUnion");function S_o(t,e){return e in t?t[e]:e==="[number]"?MM(t):is()}a(S_o,"FromTuple");function T_o(t,e){return e==="[number]"?t:is()}a(T_o,"FromArray");function I_o(t,e){return e in t?t[e]:is()}a(I_o,"FromProperty");function MKr(t,e){return _f(t)?v_o(t.allOf,e):Pa(t)?b_o(t.anyOf,e):f1(t)?S_o(t.items??[],e):lP(t)?T_o(t.items,e):Wp(t)?I_o(t.properties,e):is()}a(MKr,"IndexFromPropertyKey");function ESe(t,e){return e.map(r=>MKr(t,r))}a(ESe,"IndexFromPropertyKeys");function DKr(t,e){return MM(ESe(t,e))}a(DKr,"FromSchema");function n7(t,e,r){if(Zf(t)||Zf(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!qd(t)||!qd(e))throw new Gi(n);return _u("Index",[t,e])}return Ku(e)?PKr(t,e,r):u1(e)?OKr(t,e,r):wt(qd(e)?DKr(t,SC(e)):DKr(t,e),r)}a(n7,"Index");function x_o(t,e,r){return{[e]:n7(t,[e],zu(r))}}a(x_o,"MappedIndexPropertyKey");function w_o(t,e,r){return e.reduce((n,o)=>({...n,...x_o(t,o,r)}),{})}a(w_o,"MappedIndexPropertyKeys");function R_o(t,e,r){return w_o(t,e.keys,r)}a(R_o,"MappedIndexProperties");function OKr(t,e,r){let n=R_o(t,e,r);return Ya(n)}a(OKr,"IndexFromMappedKey");p();function Nse(t,e){return wt({[St]:"Iterator",type:"Iterator",items:t},e)}a(Nse,"Iterator");p();function k_o(t){return globalThis.Object.keys(t).filter(e=>!bC(t[e]))}a(k_o,"RequiredArray");function P_o(t,e){let r=k_o(t),n=r.length>0?{[St]:"Object",type:"object",required:r,properties:t}:{[St]:"Object",type:"object",properties:t};return wt(n,e)}a(P_o,"_Object_");var fc=P_o;p();function $7e(t,e){return wt({[St]:"Promise",type:"Promise",item:t},e)}a($7e,"Promise");p();p();function D_o(t){return wt(Ef(t,[cP]))}a(D_o,"RemoveReadonly");function N_o(t){return wt({...t,[cP]:"Readonly"})}a(N_o,"AddReadonly");function M_o(t,e){return e===!1?D_o(t):N_o(t)}a(M_o,"ReadonlyWithFlag");function TC(t,e){let r=e??!0;return Ku(t)?LKr(t,r):M_o(t,r)}a(TC,"Readonly");function O_o(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=TC(t[n],e);return r}a(O_o,"FromProperties");function L_o(t,e){return O_o(t.properties,e)}a(L_o,"FromMappedResult");function LKr(t,e){let r=L_o(t,e);return Ya(r)}a(LKr,"ReadonlyFromMappedResult");p();function yx(t,e){return wt(t.length>0?{[St]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[St]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(yx,"Tuple");function BKr(t,e){return t in e?_x(t,e[t]):Ya(e)}a(BKr,"FromMappedResult");function B_o(t){return{[t]:ma(t)}}a(B_o,"MappedKeyToKnownMappedResultProperties");function F_o(t){let e={};for(let r of t)e[r]=ma(r);return e}a(F_o,"MappedKeyToUnknownMappedResultProperties");function U_o(t,e){return vKr(e,t)?B_o(t):F_o(e)}a(U_o,"MappedKeyToMappedResultProperties");function Q_o(t,e){let r=U_o(t,e);return BKr(t,r)}a(Q_o,"FromMappedKey");function vSe(t,e){return e.map(r=>_x(t,r))}a(vSe,"FromRest");function q_o(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=_x(t,e[n]);return r}a(q_o,"FromProperties");function _x(t,e){let r={...e};return bC(e)?Xy(_x(t,Ef(e,[IA]))):bse(e)?TC(_x(t,Ef(e,[cP]))):Ku(e)?BKr(t,e.properties):u1(e)?Q_o(t,e.keys):dP(e)?wse(vSe(t,e.parameters),_x(t,e.returns),r):fP(e)?NM(vSe(t,e.parameters),_x(t,e.returns),r):Sz(e)?xse(_x(t,e.items),r):Iz(e)?Nse(_x(t,e.items),r):_f(e)?e_(vSe(t,e.allOf),r):Pa(e)?dc(vSe(t,e.anyOf),r):f1(e)?yx(vSe(t,e.items??[]),r):Wp(e)?fc(q_o(t,e.properties),r):lP(e)?Ise(_x(t,e.items),r):xz(e)?$7e(_x(t,e.item),r):e}a(_x,"FromSchemaType");function j_o(t,e){let r={};for(let n of t)r[n]=_x(n,e);return r}a(j_o,"MappedFunctionReturnType");function FKr(t,e,r){let n=qd(t)?SC(t):t,o=e({[St]:"MappedKey",keys:n}),s=j_o(n,o);return fc(s,r)}a(FKr,"Mapped");p();function H_o(t){return wt(Ef(t,[IA]))}a(H_o,"RemoveOptional");function G_o(t){return wt({...t,[IA]:"Optional"})}a(G_o,"AddOptional");function $_o(t,e){return e===!1?H_o(t):G_o(t)}a($_o,"OptionalWithFlag");function Xy(t,e){let r=e??!0;return Ku(t)?UKr(t,r):$_o(t,r)}a(Xy,"Optional");function V_o(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Xy(t[n],e);return r}a(V_o,"FromProperties");function W_o(t,e){return V_o(t.properties,e)}a(W_o,"FromMappedResult");function UKr(t,e){let r=W_o(t,e);return Ya(r)}a(UKr,"OptionalFromMappedResult");p();function CSe(t,e={}){let r=t.every(o=>Wp(o)),n=qd(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return wt(e.unevaluatedProperties===!1||qd(e.unevaluatedProperties)||r?{...n,[St]:"Intersect",type:"object",allOf:t}:{...n,[St]:"Intersect",allOf:t},e)}a(CSe,"IntersectCreate");function z_o(t){return t.every(e=>bC(e))}a(z_o,"IsIntersectOptional");function Y_o(t){return Ef(t,[IA])}a(Y_o,"RemoveOptionalFromType");function QKr(t){return t.map(e=>bC(e)?Y_o(e):e)}a(QKr,"RemoveOptionalFromRest");function K_o(t,e){return z_o(t)?Xy(CSe(QKr(t),e)):CSe(QKr(t),e)}a(K_o,"ResolveIntersect");function G7e(t,e={}){if(t.length===1)return wt(t[0],e);if(t.length===0)return is(e);if(t.some(r=>uc(r)))throw new Error("Cannot intersect transform types");return K_o(t,e)}a(G7e,"IntersectEvaluated");p();function e_(t,e){if(t.length===1)return wt(t[0],e);if(t.length===0)return is(e);if(t.some(r=>uc(r)))throw new Error("Cannot intersect transform types");return CSe(t,e)}a(e_,"Intersect");p();function Ex(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new Gi("Ref: $ref must be a string");return wt({[St]:"Ref",$ref:e},r)}a(Ex,"Ref");function J_o(t,e){return _u("Awaited",[_u(t,e)])}a(J_o,"FromComputed");function Z_o(t){return _u("Awaited",[Ex(t)])}a(Z_o,"FromRef");function X_o(t){return e_(qKr(t))}a(X_o,"FromIntersect");function eEo(t){return dc(qKr(t))}a(eEo,"FromUnion");function tEo(t){return Mse(t)}a(tEo,"FromPromise");function qKr(t){return t.map(e=>Mse(e))}a(qKr,"FromRest");function Mse(t,e){return wt(uP(t)?J_o(t.target,t.parameters):_f(t)?X_o(t.allOf):Pa(t)?eEo(t.anyOf):xz(t)?tEo(t.item):Zf(t)?Z_o(t.$ref):t,e)}a(Mse,"Awaited");p();p();p();p();function jKr(t){let e=[];for(let r of t)e.push(IC(r));return e}a(jKr,"FromRest");function rEo(t){let e=jKr(t);return SKr(e)}a(rEo,"FromIntersect");function nEo(t){let e=jKr(t);return bKr(e)}a(nEo,"FromUnion");function iEo(t){return t.map((e,r)=>r.toString())}a(iEo,"FromTuple");function oEo(t){return["[number]"]}a(oEo,"FromArray");function sEo(t){return globalThis.Object.getOwnPropertyNames(t)}a(sEo,"FromProperties");function aEo(t){return vNt?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(aEo,"FromPatternProperties");function IC(t){return _f(t)?rEo(t.allOf):Pa(t)?nEo(t.anyOf):f1(t)?iEo(t.items??[]):lP(t)?oEo(t.items):Wp(t)?sEo(t.properties):wz(t)?aEo(t.patternProperties):[]}a(IC,"KeyOfPropertyKeys");var vNt=!1;function JB(t){vNt=!0;let e=IC(t);return vNt=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(JB,"KeyOfPattern");function cEo(t,e){return _u("KeyOf",[_u(t,e)])}a(cEo,"FromComputed");function lEo(t){return _u("KeyOf",[Ex(t)])}a(lEo,"FromRef");function uEo(t,e){let r=IC(t),n=dEo(r),o=MM(n);return wt(o,e)}a(uEo,"KeyOfFromType");function dEo(t){return t.map(e=>e==="[number]"?Ax():ma(e))}a(dEo,"KeyOfPropertyKeysToRest");function Ose(t,e){return uP(t)?cEo(t.target,t.parameters):Zf(t)?lEo(t.$ref):Ku(t)?HKr(t,e):uEo(t,e)}a(Ose,"KeyOf");function fEo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Ose(t[n],zu(e));return r}a(fEo,"FromProperties");function pEo(t,e){return fEo(t.properties,e)}a(pEo,"FromMappedResult");function HKr(t,e){let r=pEo(t,e);return Ya(r)}a(HKr,"KeyOfFromMappedResult");p();function V7e(t){let e=IC(t),r=ESe(t,e);return e.map((n,o)=>[e[o],r[o]])}a(V7e,"KeyOfPropertyEntries");function hEo(t){let e=[];for(let r of t)e.push(...IC(r));return CKr(e)}a(hEo,"CompositeKeys");function mEo(t){return t.filter(e=>!Z9(e))}a(mEo,"FilterNever");function gEo(t,e){let r=[];for(let n of t)r.push(...ESe(n,[e]));return mEo(r)}a(gEo,"CompositeProperty");function AEo(t,e){let r={};for(let n of e)r[n]=G7e(gEo(t,n));return r}a(AEo,"CompositeProperties");function GKr(t,e){let r=hEo(t),n=AEo(t,r);return fc(n,e)}a(GKr,"Composite");p();p();function W7e(t){return wt({[St]:"Date",type:"Date"},t)}a(W7e,"Date");p();function z7e(t){return wt({[St]:"Null",type:"null"},t)}a(z7e,"Null");p();function Y7e(t){return wt({[St]:"Symbol",type:"symbol"},t)}a(Y7e,"Symbol");p();function K7e(t){return wt({[St]:"Undefined",type:"undefined"},t)}a(K7e,"Undefined");p();function J7e(t){return wt({[St]:"Uint8Array",type:"Uint8Array"},t)}a(J7e,"Uint8Array");p();function gP(t){return wt({[St]:"Unknown"},t)}a(gP,"Unknown");function yEo(t){return t.map(e=>CNt(e,!1))}a(yEo,"FromArray");function _Eo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=TC(CNt(t[r],!1));return e}a(_Eo,"FromProperties");function Z7e(t,e){return e===!0?t:TC(t)}a(Z7e,"ConditionalReadonly");function CNt(t,e){return eNt(t)?Z7e(r7(),e):rNt(t)?Z7e(r7(),e):$p(t)?TC(yx(yEo(t))):HB(t)?J7e():bz(t)?W7e():al(t)?Z7e(fc(_Eo(t)),e):tNt(t)?Z7e(NM([],gP()),e):Vp(t)?K7e():nNt(t)?z7e():iNt(t)?Y7e():lSe(t)?Dse():a1(t)?ma(t):jB(t)?ma(t):Zl(t)?ma(t):fc({})}a(CNt,"FromValue");function $Kr(t,e){return wt(CNt(t,!0),e)}a($Kr,"Const");p();function VKr(t,e){return dP(t)?yx(t.parameters,e):is(e)}a(VKr,"ConstructorParameters");p();function WKr(t,e){if(Vp(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>ma(s));return dc(o,{...e,[gx]:"Enum"})}a(WKr,"Enum");p();p();p();var SNt=class extends Gi{static{a(this,"ExtendsResolverError")}},Rt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Rt||(Rt={}));function vx(t){return t===Rt.False?t:Rt.True}a(vx,"IntoBooleanResult");function Lse(t){throw new SNt(t)}a(Lse,"Throw");function jh(t){return it.IsNever(t)||it.IsIntersect(t)||it.IsUnion(t)||it.IsUnknown(t)||it.IsAny(t)}a(jh,"IsStructuralRight");function Hh(t,e){return it.IsNever(e)?eJr(t,e):it.IsIntersect(e)?X7e(t,e):it.IsUnion(e)?wNt(t,e):it.IsUnknown(e)?iJr(t,e):it.IsAny(e)?xNt(t,e):Lse("StructuralRight")}a(Hh,"StructuralRight");function xNt(t,e){return Rt.True}a(xNt,"FromAnyRight");function EEo(t,e){return it.IsIntersect(e)?X7e(t,e):it.IsUnion(e)&&e.anyOf.some(r=>it.IsAny(r)||it.IsUnknown(r))?Rt.True:it.IsUnion(e)?Rt.Union:it.IsUnknown(e)||it.IsAny(e)?Rt.True:Rt.Union}a(EEo,"FromAny");function vEo(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)?Rt.True:Rt.False}a(vEo,"FromArrayRight");function CEo(t,e){return it.IsObject(e)&&eQe(e)?Rt.True:jh(e)?Hh(t,e):it.IsArray(e)?vx(ll(t.items,e.items)):Rt.False}a(CEo,"FromArray");function bEo(t,e){return jh(e)?Hh(t,e):it.IsAsyncIterator(e)?vx(ll(t.items,e.items)):Rt.False}a(bEo,"FromAsyncIterator");function SEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsBigInt(e)?Rt.True:Rt.False}a(SEo,"FromBigInt");function ZKr(t,e){return it.IsLiteralBoolean(t)||it.IsBoolean(t)?Rt.True:Rt.False}a(ZKr,"FromBooleanRight");function TEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsBoolean(e)?Rt.True:Rt.False}a(TEo,"FromBoolean");function IEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsConstructor(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>vx(ll(e.parameters[n],r))===Rt.True)?vx(ll(t.returns,e.returns)):Rt.False:Rt.False}a(IEo,"FromConstructor");function xEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsDate(e)?Rt.True:Rt.False}a(xEo,"FromDate");function wEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsFunction(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>vx(ll(e.parameters[n],r))===Rt.True)?vx(ll(t.returns,e.returns)):Rt.False:Rt.False}a(wEo,"FromFunction");function XKr(t,e){return it.IsLiteral(t)&&Zy.IsNumber(t.const)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(XKr,"FromIntegerRight");function REo(t,e){return it.IsInteger(e)||it.IsNumber(e)?Rt.True:jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):Rt.False}a(REo,"FromInteger");function X7e(t,e){return e.allOf.every(r=>ll(t,r)===Rt.True)?Rt.True:Rt.False}a(X7e,"FromIntersectRight");function kEo(t,e){return t.allOf.some(r=>ll(r,e)===Rt.True)?Rt.True:Rt.False}a(kEo,"FromIntersect");function PEo(t,e){return jh(e)?Hh(t,e):it.IsIterator(e)?vx(ll(t.items,e.items)):Rt.False}a(PEo,"FromIterator");function DEo(t,e){return it.IsLiteral(e)&&e.const===t.const?Rt.True:jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsString(e)?nJr(t,e):it.IsNumber(e)?tJr(t,e):it.IsInteger(e)?XKr(t,e):it.IsBoolean(e)?ZKr(t,e):Rt.False}a(DEo,"FromLiteral");function eJr(t,e){return Rt.False}a(eJr,"FromNeverRight");function NEo(t,e){return Rt.True}a(NEo,"FromNever");function zKr(t){let[e,r]=[t,0];for(;it.IsNot(e);)e=e.not,r+=1;return r%2===0?e:gP()}a(zKr,"UnwrapTNot");function MEo(t,e){return it.IsNot(t)?ll(zKr(t),e):it.IsNot(e)?ll(t,zKr(e)):Lse("Invalid fallthrough for Not")}a(MEo,"FromNot");function OEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsNull(e)?Rt.True:Rt.False}a(OEo,"FromNull");function tJr(t,e){return it.IsLiteralNumber(t)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(tJr,"FromNumberRight");function LEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsInteger(e)||it.IsNumber(e)?Rt.True:Rt.False}a(LEo,"FromNumber");function xC(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(xC,"IsObjectPropertyCount");function YKr(t){return eQe(t)}a(YKr,"IsObjectStringLike");function KKr(t){return xC(t,0)||xC(t,1)&&"description"in t.properties&&it.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(it.IsString(t.properties.description.anyOf[0])&&it.IsUndefined(t.properties.description.anyOf[1])||it.IsString(t.properties.description.anyOf[1])&&it.IsUndefined(t.properties.description.anyOf[0]))}a(KKr,"IsObjectSymbolLike");function bNt(t){return xC(t,0)}a(bNt,"IsObjectNumberLike");function JKr(t){return xC(t,0)}a(JKr,"IsObjectBooleanLike");function BEo(t){return xC(t,0)}a(BEo,"IsObjectBigIntLike");function FEo(t){return xC(t,0)}a(FEo,"IsObjectDateLike");function UEo(t){return eQe(t)}a(UEo,"IsObjectUint8ArrayLike");function QEo(t){let e=Ax();return xC(t,0)||xC(t,1)&&"length"in t.properties&&vx(ll(t.properties.length,e))===Rt.True}a(QEo,"IsObjectFunctionLike");function qEo(t){return xC(t,0)}a(qEo,"IsObjectConstructorLike");function eQe(t){let e=Ax();return xC(t,0)||xC(t,1)&&"length"in t.properties&&vx(ll(t.properties.length,e))===Rt.True}a(eQe,"IsObjectArrayLike");function jEo(t){let e=NM([r7()],r7());return xC(t,0)||xC(t,1)&&"then"in t.properties&&vx(ll(t.properties.then,e))===Rt.True}a(jEo,"IsObjectPromiseLike");function rJr(t,e){return ll(t,e)===Rt.False||it.IsOptional(t)&&!it.IsOptional(e)?Rt.False:Rt.True}a(rJr,"Property");function t_(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)||it.IsLiteralString(t)&&YKr(e)||it.IsLiteralNumber(t)&&bNt(e)||it.IsLiteralBoolean(t)&&JKr(e)||it.IsSymbol(t)&&KKr(e)||it.IsBigInt(t)&&BEo(e)||it.IsString(t)&&YKr(e)||it.IsSymbol(t)&&KKr(e)||it.IsNumber(t)&&bNt(e)||it.IsInteger(t)&&bNt(e)||it.IsBoolean(t)&&JKr(e)||it.IsUint8Array(t)&&UEo(e)||it.IsDate(t)&&FEo(e)||it.IsConstructor(t)&&qEo(e)||it.IsFunction(t)&&QEo(e)?Rt.True:it.IsRecord(t)&&it.IsString(TNt(t))?e[gx]==="Record"?Rt.True:Rt.False:it.IsRecord(t)&&it.IsNumber(TNt(t))&&xC(e,0)?Rt.True:Rt.False}a(t_,"FromObjectRight");function HEo(t,e){return jh(e)?Hh(t,e):it.IsRecord(e)?Cx(t,e):it.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!it.IsOptional(e.properties[r]))return Rt.False;if(it.IsOptional(e.properties[r]))return Rt.True;if(rJr(t.properties[r],e.properties[r])===Rt.False)return Rt.False}return Rt.True})():Rt.False}a(HEo,"FromObject");function GEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)&&jEo(e)?Rt.True:it.IsPromise(e)?vx(ll(t.item,e.item)):Rt.False}a(GEo,"FromPromise");function TNt(t){return e7 in t.patternProperties?Ax():t7 in t.patternProperties?UE():Lse("Unknown record key pattern")}a(TNt,"RecordKey");function INt(t){return e7 in t.patternProperties?t.patternProperties[e7]:t7 in t.patternProperties?t.patternProperties[t7]:Lse("Unable to get record value schema")}a(INt,"RecordValue");function Cx(t,e){let[r,n]=[TNt(e),INt(e)];return it.IsLiteralString(t)&&it.IsNumber(r)&&vx(ll(t,n))===Rt.True?Rt.True:it.IsUint8Array(t)&&it.IsNumber(r)||it.IsString(t)&&it.IsNumber(r)||it.IsArray(t)&&it.IsNumber(r)?ll(t,n):it.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(rJr(n,t.properties[o])===Rt.False)return Rt.False;return Rt.True})():Rt.False}a(Cx,"FromRecordRight");function $Eo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?ll(INt(t),INt(e)):Rt.False}a($Eo,"FromRecord");function VEo(t,e){let r=it.IsRegExp(t)?UE():t,n=it.IsRegExp(e)?UE():e;return ll(r,n)}a(VEo,"FromRegExp");function nJr(t,e){return it.IsLiteral(t)&&Zy.IsString(t.const)||it.IsString(t)?Rt.True:Rt.False}a(nJr,"FromStringRight");function WEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsString(e)?Rt.True:Rt.False}a(WEo,"FromString");function zEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsSymbol(e)?Rt.True:Rt.False}a(zEo,"FromSymbol");function YEo(t,e){return it.IsTemplateLiteral(t)?ll(kz(t),e):it.IsTemplateLiteral(e)?ll(t,kz(e)):Lse("Invalid fallthrough for TemplateLiteral")}a(YEo,"FromTemplateLiteral");function KEo(t,e){return it.IsArray(e)&&t.items!==void 0&&t.items.every(r=>ll(r,e.items)===Rt.True)}a(KEo,"IsArrayOfTuple");function JEo(t,e){return it.IsNever(t)?Rt.True:it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:Rt.False}a(JEo,"FromTupleRight");function ZEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)&&eQe(e)||it.IsArray(e)&&KEo(t,e)?Rt.True:it.IsTuple(e)?Zy.IsUndefined(t.items)&&!Zy.IsUndefined(e.items)||!Zy.IsUndefined(t.items)&&Zy.IsUndefined(e.items)?Rt.False:Zy.IsUndefined(t.items)&&!Zy.IsUndefined(e.items)||t.items.every((r,n)=>ll(r,e.items[n])===Rt.True)?Rt.True:Rt.False:Rt.False}a(ZEo,"FromTuple");function XEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsUint8Array(e)?Rt.True:Rt.False}a(XEo,"FromUint8Array");function evo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsVoid(e)?nvo(t,e):it.IsUndefined(e)?Rt.True:Rt.False}a(evo,"FromUndefined");function wNt(t,e){return e.anyOf.some(r=>ll(t,r)===Rt.True)?Rt.True:Rt.False}a(wNt,"FromUnionRight");function tvo(t,e){return t.anyOf.every(r=>ll(r,e)===Rt.True)?Rt.True:Rt.False}a(tvo,"FromUnion");function iJr(t,e){return Rt.True}a(iJr,"FromUnknownRight");function rvo(t,e){return it.IsNever(e)?eJr(t,e):it.IsIntersect(e)?X7e(t,e):it.IsUnion(e)?wNt(t,e):it.IsAny(e)?xNt(t,e):it.IsString(e)?nJr(t,e):it.IsNumber(e)?tJr(t,e):it.IsInteger(e)?XKr(t,e):it.IsBoolean(e)?ZKr(t,e):it.IsArray(e)?vEo(t,e):it.IsTuple(e)?JEo(t,e):it.IsObject(e)?t_(t,e):it.IsUnknown(e)?Rt.True:Rt.False}a(rvo,"FromUnknown");function nvo(t,e){return it.IsUndefined(t)||it.IsUndefined(t)?Rt.True:Rt.False}a(nvo,"FromVoidRight");function ivo(t,e){return it.IsIntersect(e)?X7e(t,e):it.IsUnion(e)?wNt(t,e):it.IsUnknown(e)?iJr(t,e):it.IsAny(e)?xNt(t,e):it.IsObject(e)?t_(t,e):it.IsVoid(e)?Rt.True:Rt.False}a(ivo,"FromVoid");function ll(t,e){return it.IsTemplateLiteral(t)||it.IsTemplateLiteral(e)?YEo(t,e):it.IsRegExp(t)||it.IsRegExp(e)?VEo(t,e):it.IsNot(t)||it.IsNot(e)?MEo(t,e):it.IsAny(t)?EEo(t,e):it.IsArray(t)?CEo(t,e):it.IsBigInt(t)?SEo(t,e):it.IsBoolean(t)?TEo(t,e):it.IsAsyncIterator(t)?bEo(t,e):it.IsConstructor(t)?IEo(t,e):it.IsDate(t)?xEo(t,e):it.IsFunction(t)?wEo(t,e):it.IsInteger(t)?REo(t,e):it.IsIntersect(t)?kEo(t,e):it.IsIterator(t)?PEo(t,e):it.IsLiteral(t)?DEo(t,e):it.IsNever(t)?NEo(t,e):it.IsNull(t)?OEo(t,e):it.IsNumber(t)?LEo(t,e):it.IsObject(t)?HEo(t,e):it.IsRecord(t)?$Eo(t,e):it.IsString(t)?WEo(t,e):it.IsSymbol(t)?zEo(t,e):it.IsTuple(t)?ZEo(t,e):it.IsPromise(t)?GEo(t,e):it.IsUint8Array(t)?XEo(t,e):it.IsUndefined(t)?evo(t,e):it.IsUnion(t)?tvo(t,e):it.IsUnknown(t)?rvo(t,e):it.IsVoid(t)?ivo(t,e):Lse(`Unknown left type operand '${t[St]}'`)}a(ll,"Visit");function i7(t,e){return ll(t,e)}a(i7,"ExtendsCheck");p();p();p();function ovo(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=Bse(t[c],e,r,n,zu(o));return s}a(ovo,"FromProperties");function svo(t,e,r,n,o){return ovo(t.properties,e,r,n,o)}a(svo,"FromMappedResult");function oJr(t,e,r,n,o){let s=svo(t,e,r,n,o);return Ya(s)}a(oJr,"ExtendsFromMappedResult");function avo(t,e,r,n){let o=i7(t,e);return o===Rt.Union?dc([r,n]):o===Rt.True?r:n}a(avo,"ExtendsResolve");function Bse(t,e,r,n,o){return Ku(t)?oJr(t,e,r,n,o):u1(t)?wt(sJr(t,e,r,n,o)):wt(avo(t,e,r,n),o)}a(Bse,"Extends");function cvo(t,e,r,n,o){return{[t]:Bse(ma(t),e,r,n,zu(o))}}a(cvo,"FromPropertyKey");function lvo(t,e,r,n,o){return t.reduce((s,c)=>({...s,...cvo(c,e,r,n,o)}),{})}a(lvo,"FromPropertyKeys");function uvo(t,e,r,n,o){return lvo(t.keys,e,r,n,o)}a(uvo,"FromMappedKey");function sJr(t,e,r,n,o){let s=uvo(t,e,r,n,o);return Ya(s)}a(sJr,"ExtendsFromMappedKey");p();function dvo(t){return t.allOf.every(e=>ZB(e))}a(dvo,"Intersect");function fvo(t){return t.anyOf.some(e=>ZB(e))}a(fvo,"Union");function pvo(t){return!ZB(t.not)}a(pvo,"Not");function ZB(t){return t[St]==="Intersect"?dvo(t):t[St]==="Union"?fvo(t):t[St]==="Not"?pvo(t):t[St]==="Undefined"}a(ZB,"ExtendsUndefinedCheck");p();function aJr(t,e){return Fse(kz(t),e)}a(aJr,"ExcludeFromTemplateLiteral");function hvo(t,e){let r=t.filter(n=>i7(n,e)===Rt.False);return r.length===1?r[0]:dc(r)}a(hvo,"ExcludeRest");function Fse(t,e,r={}){return d1(t)?wt(aJr(t,e),r):Ku(t)?wt(cJr(t,e),r):wt(Pa(t)?hvo(t.anyOf,e):i7(t,e)!==Rt.False?is():t,r)}a(Fse,"Exclude");function mvo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Fse(t[n],e);return r}a(mvo,"FromProperties");function gvo(t,e){return mvo(t.properties,e)}a(gvo,"FromMappedResult");function cJr(t,e){let r=gvo(t,e);return Ya(r)}a(cJr,"ExcludeFromMappedResult");p();p();p();function lJr(t,e){return Use(kz(t),e)}a(lJr,"ExtractFromTemplateLiteral");function Avo(t,e){let r=t.filter(n=>i7(n,e)!==Rt.False);return r.length===1?r[0]:dc(r)}a(Avo,"ExtractRest");function Use(t,e,r){return d1(t)?wt(lJr(t,e),r):Ku(t)?wt(uJr(t,e),r):wt(Pa(t)?Avo(t.anyOf,e):i7(t,e)!==Rt.False?t:is(),r)}a(Use,"Extract");function yvo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Use(t[n],e);return r}a(yvo,"FromProperties");function _vo(t,e){return yvo(t.properties,e)}a(_vo,"FromMappedResult");function uJr(t,e){let r=_vo(t,e);return Ya(r)}a(uJr,"ExtractFromMappedResult");p();function dJr(t,e){return dP(t)?wt(t.returns,e):is(e)}a(dJr,"InstanceType");p();p();function tQe(t){return TC(Xy(t))}a(tQe,"ReadonlyOptional");p();function Pz(t,e,r){return wt({[St]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(Pz,"RecordCreateFromPattern");function RNt(t,e,r){let n={};for(let o of t)n[o]=e;return fc(n,{...r,[gx]:"Record"})}a(RNt,"RecordCreateFromKeys");function Evo(t,e,r){return q7e(t)?RNt(SC(t),e,r):Pz(t.pattern,e,r)}a(Evo,"FromTemplateLiteralKey");function vvo(t,e,r){return RNt(SC(dc(t)),e,r)}a(vvo,"FromUnionKey");function Cvo(t,e,r){return RNt([t.toString()],e,r)}a(Cvo,"FromLiteralKey");function bvo(t,e,r){return Pz(t.source,e,r)}a(bvo,"FromRegExpKey");function Svo(t,e,r){let n=Vp(t.pattern)?t7:t.pattern;return Pz(n,e,r)}a(Svo,"FromStringKey");function Tvo(t,e,r){return Pz(t7,e,r)}a(Tvo,"FromAnyKey");function Ivo(t,e,r){return Pz(EKr,e,r)}a(Ivo,"FromNeverKey");function xvo(t,e,r){return fc({true:e,false:e},r)}a(xvo,"FromBooleanKey");function wvo(t,e,r){return Pz(e7,e,r)}a(wvo,"FromIntegerKey");function Rvo(t,e,r){return Pz(e7,e,r)}a(Rvo,"FromNumberKey");function rQe(t,e,r={}){return Pa(t)?vvo(t.anyOf,e,r):d1(t)?Evo(t,e,r):l1(t)?Cvo(t.const,e,r):VB(t)?xvo(t,e,r):pP(t)?wvo(t,e,r):hP(t)?Rvo(t,e,r):cNt(t)?bvo(t,e,r):WB(t)?Svo(t,e,r):sNt(t)?Tvo(t,e,r):Z9(t)?Ivo(t,e,r):is(r)}a(rQe,"Record");function nQe(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(nQe,"RecordPattern");function fJr(t){let e=nQe(t);return e===t7?UE():e===e7?Ax():UE({pattern:e})}a(fJr,"RecordKey");function iQe(t){return t.patternProperties[nQe(t)]}a(iQe,"RecordValue");function kvo(t,e){return e.parameters=bSe(t,e.parameters),e.returns=AP(t,e.returns),e}a(kvo,"FromConstructor");function Pvo(t,e){return e.parameters=bSe(t,e.parameters),e.returns=AP(t,e.returns),e}a(Pvo,"FromFunction");function Dvo(t,e){return e.allOf=bSe(t,e.allOf),e}a(Dvo,"FromIntersect");function Nvo(t,e){return e.anyOf=bSe(t,e.anyOf),e}a(Nvo,"FromUnion");function Mvo(t,e){return Vp(e.items)||(e.items=bSe(t,e.items)),e}a(Mvo,"FromTuple");function Ovo(t,e){return e.items=AP(t,e.items),e}a(Ovo,"FromArray");function Lvo(t,e){return e.items=AP(t,e.items),e}a(Lvo,"FromAsyncIterator");function Bvo(t,e){return e.items=AP(t,e.items),e}a(Bvo,"FromIterator");function Fvo(t,e){return e.item=AP(t,e.item),e}a(Fvo,"FromPromise");function Uvo(t,e){let r=Hvo(t,e.properties);return{...e,...fc(r)}}a(Uvo,"FromObject");function Qvo(t,e){let r=AP(t,fJr(e)),n=AP(t,iQe(e)),o=rQe(r,n);return{...e,...o}}a(Qvo,"FromRecord");function qvo(t,e){return e.index in t?t[e.index]:gP()}a(qvo,"FromArgument");function jvo(t,e){let r=bse(e),n=bC(e),o=AP(t,e);return r&&n?tQe(o):r&&!n?TC(o):!r&&n?Xy(o):o}a(jvo,"FromProperty");function Hvo(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:jvo(t,e[n])}),{})}a(Hvo,"FromProperties");function bSe(t,e){return e.map(r=>AP(t,r))}a(bSe,"FromTypes");function AP(t,e){return dP(e)?kvo(t,e):fP(e)?Pvo(t,e):_f(e)?Dvo(t,e):Pa(e)?Nvo(t,e):f1(e)?Mvo(t,e):lP(e)?Ovo(t,e):Sz(e)?Lvo(t,e):Iz(e)?Bvo(t,e):xz(e)?Fvo(t,e):Wp(e)?Uvo(t,e):wz(e)?Qvo(t,e):aNt(e)?qvo(t,e):e}a(AP,"FromType");function pJr(t,e){return AP(e,vse(t))}a(pJr,"Instantiate");p();function hJr(t){return wt({[St]:"Integer",type:"integer"},t)}a(hJr,"Integer");p();p();p();function Gvo(t,e,r){return{[t]:yP(ma(t),e,zu(r))}}a(Gvo,"MappedIntrinsicPropertyKey");function $vo(t,e,r){return t.reduce((o,s)=>({...o,...Gvo(s,e,r)}),{})}a($vo,"MappedIntrinsicPropertyKeys");function Vvo(t,e,r){return $vo(t.keys,e,r)}a(Vvo,"MappedIntrinsicProperties");function mJr(t,e,r){let n=Vvo(t,e,r);return Ya(n)}a(mJr,"IntrinsicFromMappedKey");function Wvo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(Wvo,"ApplyUncapitalize");function zvo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(zvo,"ApplyCapitalize");function Yvo(t){return t.toUpperCase()}a(Yvo,"ApplyUppercase");function Kvo(t){return t.toLowerCase()}a(Kvo,"ApplyLowercase");function Jvo(t,e,r){let n=kse(t.pattern);if(!Rz(n))return{...t,pattern:gJr(t.pattern,e)};let c=[..._Se(n)].map(d=>ma(d)),l=AJr(c,e),u=dc(l);return H7e([u],r)}a(Jvo,"FromTemplateLiteral");function gJr(t,e){return typeof t=="string"?e==="Uncapitalize"?Wvo(t):e==="Capitalize"?zvo(t):e==="Uppercase"?Yvo(t):e==="Lowercase"?Kvo(t):t:t.toString()}a(gJr,"FromLiteralValue");function AJr(t,e){return t.map(r=>yP(r,e))}a(AJr,"FromRest");function yP(t,e,r={}){return u1(t)?mJr(t,e,r):d1(t)?Jvo(t,e,r):Pa(t)?dc(AJr(t.anyOf,e),r):l1(t)?ma(gJr(t.const,e),r):wt(t,r)}a(yP,"Intrinsic");function yJr(t,e={}){return yP(t,"Capitalize",e)}a(yJr,"Capitalize");p();function _Jr(t,e={}){return yP(t,"Lowercase",e)}a(_Jr,"Lowercase");p();function EJr(t,e={}){return yP(t,"Uncapitalize",e)}a(EJr,"Uncapitalize");p();function vJr(t,e={}){return yP(t,"Uppercase",e)}a(vJr,"Uppercase");p();p();p();p();p();function Zvo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=o7(t[o],e,zu(r));return n}a(Zvo,"FromProperties");function Xvo(t,e,r){return Zvo(t.properties,e,r)}a(Xvo,"FromMappedResult");function CJr(t,e,r){let n=Xvo(t,e,r);return Ya(n)}a(CJr,"OmitFromMappedResult");function eCo(t,e){return t.map(r=>kNt(r,e))}a(eCo,"FromIntersect");function tCo(t,e){return t.map(r=>kNt(r,e))}a(tCo,"FromUnion");function rCo(t,e){let{[e]:r,...n}=t;return n}a(rCo,"FromProperty");function nCo(t,e){return e.reduce((r,n)=>rCo(r,n),t)}a(nCo,"FromProperties");function iCo(t,e,r){let n=Ef(t,[Qd,"$id","required","properties"]),o=nCo(r,e);return fc(o,n)}a(iCo,"FromObject");function oCo(t){let e=t.reduce((r,n)=>F7e(n)?[...r,ma(n)]:r,[]);return dc(e)}a(oCo,"UnionFromPropertyKeys");function kNt(t,e){return _f(t)?e_(eCo(t.allOf,e)):Pa(t)?dc(tCo(t.anyOf,e)):Wp(t)?iCo(t,e,t.properties):fc({})}a(kNt,"OmitResolve");function o7(t,e,r){let n=$p(e)?oCo(e):e,o=qd(e)?SC(e):e,s=Zf(t),c=Zf(e);return Ku(t)?CJr(t,o,r):u1(e)?bJr(t,e,r):s&&c?_u("Omit",[t,n],r):!s&&c?_u("Omit",[t,n],r):s&&!c?_u("Omit",[t,n],r):wt({...kNt(t,o),...r})}a(o7,"Omit");function sCo(t,e,r){return{[e]:o7(t,[e],zu(r))}}a(sCo,"FromPropertyKey");function aCo(t,e,r){return e.reduce((n,o)=>({...n,...sCo(t,o,r)}),{})}a(aCo,"FromPropertyKeys");function cCo(t,e,r){return aCo(t,e.keys,r)}a(cCo,"FromMappedKey");function bJr(t,e,r){let n=cCo(t,e,r);return Ya(n)}a(bJr,"OmitFromMappedKey");p();p();p();function lCo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=s7(t[o],e,zu(r));return n}a(lCo,"FromProperties");function uCo(t,e,r){return lCo(t.properties,e,r)}a(uCo,"FromMappedResult");function SJr(t,e,r){let n=uCo(t,e,r);return Ya(n)}a(SJr,"PickFromMappedResult");function dCo(t,e){return t.map(r=>PNt(r,e))}a(dCo,"FromIntersect");function fCo(t,e){return t.map(r=>PNt(r,e))}a(fCo,"FromUnion");function pCo(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(pCo,"FromProperties");function hCo(t,e,r){let n=Ef(t,[Qd,"$id","required","properties"]),o=pCo(r,e);return fc(o,n)}a(hCo,"FromObject");function mCo(t){let e=t.reduce((r,n)=>F7e(n)?[...r,ma(n)]:r,[]);return dc(e)}a(mCo,"UnionFromPropertyKeys");function PNt(t,e){return _f(t)?e_(dCo(t.allOf,e)):Pa(t)?dc(fCo(t.anyOf,e)):Wp(t)?hCo(t,e,t.properties):fc({})}a(PNt,"PickResolve");function s7(t,e,r){let n=$p(e)?mCo(e):e,o=qd(e)?SC(e):e,s=Zf(t),c=Zf(e);return Ku(t)?SJr(t,o,r):u1(e)?TJr(t,e,r):s&&c?_u("Pick",[t,n],r):!s&&c?_u("Pick",[t,n],r):s&&!c?_u("Pick",[t,n],r):wt({...PNt(t,o),...r})}a(s7,"Pick");function gCo(t,e,r){return{[e]:s7(t,[e],zu(r))}}a(gCo,"FromPropertyKey");function ACo(t,e,r){return e.reduce((n,o)=>({...n,...gCo(t,o,r)}),{})}a(ACo,"FromPropertyKeys");function yCo(t,e,r){return ACo(t,e.keys,r)}a(yCo,"FromMappedKey");function TJr(t,e,r){let n=yCo(t,e,r);return Ya(n)}a(TJr,"PickFromMappedKey");p();p();function _Co(t,e){return _u("Partial",[_u(t,e)])}a(_Co,"FromComputed");function ECo(t){return _u("Partial",[Ex(t)])}a(ECo,"FromRef");function vCo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=Xy(t[r]);return e}a(vCo,"FromProperties");function CCo(t,e){let r=Ef(t,[Qd,"$id","required","properties"]),n=vCo(e);return fc(n,r)}a(CCo,"FromObject");function IJr(t){return t.map(e=>xJr(e))}a(IJr,"FromRest");function xJr(t){return uP(t)?_Co(t.target,t.parameters):Zf(t)?ECo(t.$ref):_f(t)?e_(IJr(t.allOf)):Pa(t)?dc(IJr(t.anyOf)):Wp(t)?CCo(t,t.properties):Tz(t)||VB(t)||pP(t)||l1(t)||fSe(t)||hP(t)||WB(t)||pSe(t)||zB(t)?t:fc({})}a(xJr,"PartialResolve");function Qse(t,e){return Ku(t)?wJr(t,e):wt({...xJr(t),...e})}a(Qse,"Partial");function bCo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Qse(t[n],zu(e));return r}a(bCo,"FromProperties");function SCo(t,e){return bCo(t.properties,e)}a(SCo,"FromMappedResult");function wJr(t,e){let r=SCo(t,e);return Ya(r)}a(wJr,"PartialFromMappedResult");p();p();function TCo(t,e){return _u("Required",[_u(t,e)])}a(TCo,"FromComputed");function ICo(t){return _u("Required",[Ex(t)])}a(ICo,"FromRef");function xCo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=Ef(t[r],[IA]);return e}a(xCo,"FromProperties");function wCo(t,e){let r=Ef(t,[Qd,"$id","required","properties"]),n=xCo(e);return fc(n,r)}a(wCo,"FromObject");function RJr(t){return t.map(e=>kJr(e))}a(RJr,"FromRest");function kJr(t){return uP(t)?TCo(t.target,t.parameters):Zf(t)?ICo(t.$ref):_f(t)?e_(RJr(t.allOf)):Pa(t)?dc(RJr(t.anyOf)):Wp(t)?wCo(t,t.properties):Tz(t)||VB(t)||pP(t)||l1(t)||fSe(t)||hP(t)||WB(t)||pSe(t)||zB(t)?t:fc({})}a(kJr,"RequiredResolve");function qse(t,e){return Ku(t)?PJr(t,e):wt({...kJr(t),...e})}a(qse,"Required");function RCo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=qse(t[n],e);return r}a(RCo,"FromProperties");function kCo(t,e){return RCo(t.properties,e)}a(kCo,"FromMappedResult");function PJr(t,e){let r=kCo(t,e);return Ya(r)}a(PJr,"RequiredFromMappedResult");function PCo(t,e){return e.map(r=>Zf(r)?DNt(t,r.$ref):p1(t,r))}a(PCo,"DereferenceParameters");function DNt(t,e){return e in t?Zf(t[e])?DNt(t,t[e].$ref):p1(t,t[e]):is()}a(DNt,"Dereference");function DCo(t){return Mse(t[0])}a(DCo,"FromAwaited");function NCo(t){return n7(t[0],t[1])}a(NCo,"FromIndex");function MCo(t){return Ose(t[0])}a(MCo,"FromKeyOf");function OCo(t){return Qse(t[0])}a(OCo,"FromPartial");function LCo(t){return o7(t[0],t[1])}a(LCo,"FromOmit");function BCo(t){return s7(t[0],t[1])}a(BCo,"FromPick");function FCo(t){return qse(t[0])}a(FCo,"FromRequired");function UCo(t,e,r){let n=PCo(t,r);return e==="Awaited"?DCo(n):e==="Index"?NCo(n):e==="KeyOf"?MCo(n):e==="Partial"?OCo(n):e==="Omit"?LCo(n):e==="Pick"?BCo(n):e==="Required"?FCo(n):is()}a(UCo,"FromComputed");function QCo(t,e){return Ise(p1(t,e))}a(QCo,"FromArray");function qCo(t,e){return xse(p1(t,e))}a(qCo,"FromAsyncIterator");function jCo(t,e,r){return wse(SSe(t,e),p1(t,r))}a(jCo,"FromConstructor");function HCo(t,e,r){return NM(SSe(t,e),p1(t,r))}a(HCo,"FromFunction");function GCo(t,e){return e_(SSe(t,e))}a(GCo,"FromIntersect");function $Co(t,e){return Nse(p1(t,e))}a($Co,"FromIterator");function VCo(t,e){return fc(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:p1(t,e[n])}),{}))}a(VCo,"FromObject");function WCo(t,e){let[r,n]=[p1(t,iQe(e)),nQe(e)],o=vse(e);return o.patternProperties[n]=r,o}a(WCo,"FromRecord");function zCo(t,e){return Zf(e)?{...DNt(t,e.$ref),[Qd]:e[Qd]}:e}a(zCo,"FromTransform");function YCo(t,e){return yx(SSe(t,e))}a(YCo,"FromTuple");function KCo(t,e){return dc(SSe(t,e))}a(KCo,"FromUnion");function SSe(t,e){return e.map(r=>p1(t,r))}a(SSe,"FromTypes");function p1(t,e){return bC(e)?wt(p1(t,Ef(e,[IA])),e):bse(e)?wt(p1(t,Ef(e,[cP])),e):uc(e)?wt(zCo(t,e),e):lP(e)?wt(QCo(t,e.items),e):Sz(e)?wt(qCo(t,e.items),e):uP(e)?wt(UCo(t,e.target,e.parameters)):dP(e)?wt(jCo(t,e.parameters,e.returns),e):fP(e)?wt(HCo(t,e.parameters,e.returns),e):_f(e)?wt(GCo(t,e.allOf),e):Iz(e)?wt($Co(t,e.items),e):Wp(e)?wt(VCo(t,e.properties),e):wz(e)?wt(WCo(t,e)):f1(e)?wt(YCo(t,e.items||[]),e):Pa(e)?wt(KCo(t,e.anyOf),e):e}a(p1,"FromType");function JCo(t,e){return e in t?p1(t,t[e]):is()}a(JCo,"ComputeType");function DJr(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:JCo(t,r)}),{})}a(DJr,"ComputeModuleProperties");var NNt=class{static{a(this,"TModule")}constructor(e){let r=DJr(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:wt(this.$defs[e],r)};return wt({[St]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};function NJr(t){return new NNt(t)}a(NJr,"Module");p();function MJr(t,e){return wt({[St]:"Not",not:t},e)}a(MJr,"Not");p();function OJr(t,e){return fP(t)?yx(t.parameters,e):is()}a(OJr,"Parameters");p();var ZCo=0;function LJr(t,e={}){Vp(e.$id)&&(e.$id=`T${ZCo++}`);let r=vse(t({[St]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,wt({[gx]:"Recursive",...r},e)}a(LJr,"Recursive");p();function BJr(t,e){let r=Zl(t)?new globalThis.RegExp(t):t;return wt({[St]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(BJr,"RegExp");p();function XCo(t){return _f(t)?t.allOf:Pa(t)?t.anyOf:f1(t)?t.items??[]:[]}a(XCo,"RestResolve");function FJr(t){return XCo(t)}a(FJr,"Rest");p();function UJr(t,e){return fP(t)?wt(t.returns,e):is(e)}a(UJr,"ReturnType");p();var MNt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new ONt(this.schema,e)}},ONt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[Qd].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[Qd].Decode(c)),"Decode")};return{...r,[Qd]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[Qd]:n}}Encode(e){return uc(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function QJr(t){return new MNt(t)}a(QJr,"Transform");p();function qJr(t={}){return wt({[St]:t[St]??"Unsafe"},t)}a(qJr,"Unsafe");p();function jJr(t){return wt({[St]:"Void",type:"void"},t)}a(jJr,"Void");p();var LNt={};Ti(LNt,{Any:()=>r7,Argument:()=>TKr,Array:()=>Ise,AsyncIterator:()=>xse,Awaited:()=>Mse,BigInt:()=>Dse,Boolean:()=>j7e,Capitalize:()=>yJr,Composite:()=>GKr,Const:()=>$Kr,Constructor:()=>wse,ConstructorParameters:()=>VKr,Date:()=>W7e,Enum:()=>WKr,Exclude:()=>Fse,Extends:()=>Bse,Extract:()=>Use,Function:()=>NM,Index:()=>n7,InstanceType:()=>dJr,Instantiate:()=>pJr,Integer:()=>hJr,Intersect:()=>e_,Iterator:()=>Nse,KeyOf:()=>Ose,Literal:()=>ma,Lowercase:()=>_Jr,Mapped:()=>FKr,Module:()=>NJr,Never:()=>is,Not:()=>MJr,Null:()=>z7e,Number:()=>Ax,Object:()=>fc,Omit:()=>o7,Optional:()=>Xy,Parameters:()=>OJr,Partial:()=>Qse,Pick:()=>s7,Promise:()=>$7e,Readonly:()=>TC,ReadonlyOptional:()=>tQe,Record:()=>rQe,Recursive:()=>LJr,Ref:()=>Ex,RegExp:()=>BJr,Required:()=>qse,Rest:()=>FJr,ReturnType:()=>UJr,String:()=>UE,Symbol:()=>Y7e,TemplateLiteral:()=>H7e,Transform:()=>QJr,Tuple:()=>yx,Uint8Array:()=>J7e,Uncapitalize:()=>EJr,Undefined:()=>K7e,Union:()=>dc,Unknown:()=>gP,Unsafe:()=>qJr,Uppercase:()=>vJr,Void:()=>jJr});p();var b=LNt;p();p();function HJr(...t){return new globalThis.Function(...t)}a(HJr,"Evaluate");p();function ebo(t){switch(t.errorType){case bt.ArrayContains:return"Expected array to contain at least one matching value";case bt.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case bt.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case bt.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case bt.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case bt.ArrayUniqueItems:return"Expected array elements to be unique";case bt.Array:return"Expected array";case bt.AsyncIterator:return"Expected AsyncIterator";case bt.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case bt.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case bt.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case bt.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case bt.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case bt.BigInt:return"Expected bigint";case bt.Boolean:return"Expected boolean";case bt.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case bt.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case bt.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case bt.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case bt.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case bt.Date:return"Expected Date";case bt.Function:return"Expected function";case bt.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case bt.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case bt.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case bt.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case bt.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case bt.Integer:return"Expected integer";case bt.IntersectUnevaluatedProperties:return"Unexpected property";case bt.Intersect:return"Expected all values to match";case bt.Iterator:return"Expected Iterator";case bt.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case bt.Never:return"Never";case bt.Not:return"Value should not match";case bt.Null:return"Expected null";case bt.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case bt.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case bt.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case bt.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case bt.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case bt.Number:return"Expected number";case bt.Object:return"Expected object";case bt.ObjectAdditionalProperties:return"Unexpected property";case bt.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case bt.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case bt.ObjectRequiredProperty:return"Expected required property";case bt.Promise:return"Expected Promise";case bt.RegExp:return"Expected string to match regular expression";case bt.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case bt.StringFormat:return`Expected string to match '${t.schema.format}' format`;case bt.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case bt.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case bt.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case bt.String:return"Expected string";case bt.Symbol:return"Expected symbol";case bt.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case bt.Tuple:return"Expected tuple";case bt.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case bt.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case bt.Uint8Array:return"Expected Uint8Array";case bt.Undefined:return"Expected undefined";case bt.Union:return"Expected union value";case bt.Void:return"Expected void";case bt.Kind:return`Expected kind '${t.schema[St]}'`;default:return"Unknown error type"}}a(ebo,"DefaultErrorFunction");var tbo=ebo;function GJr(){return tbo}a(GJr,"GetErrorFunction");p();var BNt=class extends Gi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function rbo(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new BNt(t);return Da(r,e)}a(rbo,"Resolve");function i0(t,e){return!pa(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(i0,"Pushref");function Da(t,e){return t[St]==="This"||t[St]==="Ref"?rbo(t,e):t}a(Da,"Deref");p();var FNt=class extends Gi{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}},h1;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(h1||(h1={}));var jse=BigInt("14695981039346656037"),[nbo,ibo]=[BigInt("1099511628211"),BigInt("18446744073709551616")],obo=Array.from({length:256}).map((t,e)=>BigInt(e)),$Jr=new Float64Array(1),VJr=new DataView($Jr.buffer),WJr=new Uint8Array($Jr.buffer);function*sbo(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let r=0;r>8*(e-1-r)&255}a(sbo,"NumberToBytes");function abo(t){r_(h1.Array);for(let e of t)Hse(e)}a(abo,"ArrayType");function cbo(t){r_(h1.Boolean),r_(t?1:0)}a(cbo,"BooleanType");function lbo(t){r_(h1.BigInt),VJr.setBigInt64(0,t);for(let e of WJr)r_(e)}a(lbo,"BigIntType");function ubo(t){r_(h1.Date),Hse(t.getTime())}a(ubo,"DateType");function dbo(t){r_(h1.Null)}a(dbo,"NullType");function fbo(t){r_(h1.Number),VJr.setFloat64(0,t);for(let e of WJr)r_(e)}a(fbo,"NumberType");function pbo(t){r_(h1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())Hse(e),Hse(t[e])}a(pbo,"ObjectType");function hbo(t){r_(h1.String);for(let e=0;e=t.minItems)||ea(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!o0(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=a7(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(ea(t.contains)||ui(t.minContains)||ui(t.maxContains)))return!0;let n=ea(t.contains)?t.contains:is(),o=r.reduce((s,c)=>o0(n,e,c)?s+1:s,0);return!(o===0||ui(t.minContains)&&ot.maxContains)}a(vbo,"FromArray");function Cbo(t,e,r){return M7e(r)}a(Cbo,"FromAsyncIterator");function bbo(t,e,r){return!(!TA(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(bbo,"FromBigInt");function Sbo(t,e,r){return DM(r)}a(Sbo,"FromBoolean");function Tbo(t,e,r){return o0(t.returns,e,r.prototype)}a(Tbo,"FromConstructor");function Ibo(t,e,r){return!(!BE(r)||ea(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||ea(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||ea(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||ea(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(Ibo,"FromDate");function xbo(t,e,r){return J9(r)}a(xbo,"FromFunction");function wbo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return o0(o,[...e,...n],r)}a(wbo,"FromImport");function Rbo(t,e,r){return!(!B7e(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.multipleOf)&&r%t.multipleOf!==0)}a(Rbo,"FromInteger");function kbo(t,e,r){let n=t.allOf.every(o=>o0(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(JB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(qd(t.unevaluatedProperties)){let o=new RegExp(JB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||o0(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(kbo,"FromIntersect");function Pbo(t,e,r){return O7e(r)}a(Pbo,"FromIterator");function Dbo(t,e,r){return r===t.const}a(Dbo,"FromLiteral");function Nbo(t,e,r){return!1}a(Nbo,"FromNever");function Mbo(t,e,r){return!o0(t.not,e,r)}a(Mbo,"FromNot");function Obo(t,e,r){return GB(r)}a(Obo,"FromNull");function Lbo(t,e,r){return!(!yu.IsNumberLike(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.multipleOf)&&r%t.multipleOf!==0)}a(Lbo,"FromNumber");function Bbo(t,e,r){if(!yu.IsObjectLike(r)||ea(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ea(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!o0(s,e,r[o])||(ZB(s)||ybo(s))&&!(o in r))return!1}else if(yu.IsExactOptionalProperty(r,o)&&!o0(s,e,r[o]))return!1}if(t.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return t.required&&t.required.length===n.length&&o.length===n.length?!0:o.every(s=>n.includes(s))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||o0(t.additionalProperties,e,r[s])):!0}a(Bbo,"FromObject");function Fbo(t,e,r){return L7e(r)}a(Fbo,"FromPromise");function Ubo(t,e,r){if(!yu.IsRecordLike(r)||ea(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ea(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?o0(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:o0(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(Ubo,"FromRecord");function Qbo(t,e,r){return o0(Da(t,e),e,r)}a(Qbo,"FromRef");function qbo(t,e,r){let n=new RegExp(t.source,t.flags);return ea(t.minLength)&&!(r.length>=t.minLength)||ea(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(qbo,"FromRegExp");function jbo(t,e,r){return!pa(r)||ea(t.minLength)&&!(r.length>=t.minLength)||ea(t.maxLength)&&!(r.length<=t.maxLength)||ea(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:ea(t.format)?mP.Has(t.format)?mP.Get(t.format)(r):!1:!0}a(jbo,"FromString");function Hbo(t,e,r){return $B(r)}a(Hbo,"FromSymbol");function Gbo(t,e,r){return pa(r)&&new RegExp(t.pattern).test(r)}a(Gbo,"FromTemplateLiteral");function $bo(t,e,r){return o0(Da(t,e),e,r)}a($bo,"FromThis");function Vbo(t,e,r){if(!Mi(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;no0(n,e,r))}a(zbo,"FromUnion");function Ybo(t,e,r){return!(!Cse(r)||ea(t.maxByteLength)&&!(r.length<=t.maxByteLength)||ea(t.minByteLength)&&!(r.length>=t.minByteLength))}a(Ybo,"FromUint8Array");function Kbo(t,e,r){return!0}a(Kbo,"FromUnknown");function Jbo(t,e,r){return yu.IsVoidLike(r)}a(Jbo,"FromVoid");function Zbo(t,e,r){return FE.Has(t[St])?FE.Get(t[St])(t,r):!1}a(Zbo,"FromKind");function o0(t,e,r){let n=ea(t.$id)?i0(t,e):e,o=t;switch(o[St]){case"Any":return _bo(o,n,r);case"Argument":return Ebo(o,n,r);case"Array":return vbo(o,n,r);case"AsyncIterator":return Cbo(o,n,r);case"BigInt":return bbo(o,n,r);case"Boolean":return Sbo(o,n,r);case"Constructor":return Tbo(o,n,r);case"Date":return Ibo(o,n,r);case"Function":return xbo(o,n,r);case"Import":return wbo(o,n,r);case"Integer":return Rbo(o,n,r);case"Intersect":return kbo(o,n,r);case"Iterator":return Pbo(o,n,r);case"Literal":return Dbo(o,n,r);case"Never":return Nbo(o,n,r);case"Not":return Mbo(o,n,r);case"Null":return Obo(o,n,r);case"Number":return Lbo(o,n,r);case"Object":return Bbo(o,n,r);case"Promise":return Fbo(o,n,r);case"Record":return Ubo(o,n,r);case"Ref":return Qbo(o,n,r);case"RegExp":return qbo(o,n,r);case"String":return jbo(o,n,r);case"Symbol":return Hbo(o,n,r);case"TemplateLiteral":return Gbo(o,n,r);case"This":return $bo(o,n,r);case"Tuple":return Vbo(o,n,r);case"Undefined":return Wbo(o,n,r);case"Union":return zbo(o,n,r);case"Uint8Array":return Ybo(o,n,r);case"Unknown":return Kbo(o,n,r);case"Void":return Jbo(o,n,r);default:if(!FE.Has(o[St]))throw new UNt(o);return Zbo(o,n,r)}}a(o0,"Visit");function os(...t){return t.length===3?o0(t[0],t[1],t[2]):o0(t[0],[],t[1])}a(os,"Check");var bt;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(bt||(bt={}));var QNt=class extends Gi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function XB(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(XB,"EscapeKey");function ta(t){return t!==void 0}a(ta,"IsDefined");var c7=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};function ln(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:GJr()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(ln,"Create");function*Xbo(t,e,r,n){}a(Xbo,"FromAny");function*eSo(t,e,r,n){}a(eSo,"FromArgument");function*tSo(t,e,r,n){if(!Mi(n))return yield ln(bt.Array,t,r,n);ta(t.minItems)&&!(n.length>=t.minItems)&&(yield ln(bt.ArrayMinItems,t,r,n)),ta(t.maxItems)&&!(n.length<=t.maxItems)&&(yield ln(bt.ArrayMaxItems,t,r,n));for(let c=0;cs0(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield ln(bt.ArrayContains,t,r,n)),ui(t.minContains)&&st.maxContains&&(yield ln(bt.ArrayMaxContains,t,r,n))}a(tSo,"FromArray");function*rSo(t,e,r,n){M7e(n)||(yield ln(bt.AsyncIterator,t,r,n))}a(rSo,"FromAsyncIterator");function*nSo(t,e,r,n){if(!TA(n))return yield ln(bt.BigInt,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield ln(bt.BigIntExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield ln(bt.BigIntMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield ln(bt.BigIntMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield ln(bt.BigIntMultipleOf,t,r,n))}a(nSo,"FromBigInt");function*iSo(t,e,r,n){DM(n)||(yield ln(bt.Boolean,t,r,n))}a(iSo,"FromBoolean");function*oSo(t,e,r,n){yield*s0(t.returns,e,r,n.prototype)}a(oSo,"FromConstructor");function*sSo(t,e,r,n){if(!BE(n))return yield ln(bt.Date,t,r,n);ta(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield ln(bt.DateExclusiveMinimumTimestamp,t,r,n)),ta(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield ln(bt.DateMaximumTimestamp,t,r,n)),ta(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield ln(bt.DateMinimumTimestamp,t,r,n)),ta(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield ln(bt.DateMultipleOfTimestamp,t,r,n))}a(sSo,"FromDate");function*aSo(t,e,r,n){J9(n)||(yield ln(bt.Function,t,r,n))}a(aSo,"FromFunction");function*cSo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*s0(s,[...e,...o],r,n)}a(cSo,"FromImport");function*lSo(t,e,r,n){if(!B7e(n))return yield ln(bt.Integer,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield ln(bt.IntegerExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield ln(bt.IntegerMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield ln(bt.IntegerMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==0&&(yield ln(bt.IntegerMultipleOf,t,r,n))}a(lSo,"FromInteger");function*uSo(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of s0(s,e,r,n))o=!0,yield c;if(o)return yield ln(bt.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(JB(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield ln(bt.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(JB(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=s0(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(uSo,"FromIntersect");function*dSo(t,e,r,n){O7e(n)||(yield ln(bt.Iterator,t,r,n))}a(dSo,"FromIterator");function*fSo(t,e,r,n){n!==t.const&&(yield ln(bt.Literal,t,r,n))}a(fSo,"FromLiteral");function*pSo(t,e,r,n){yield ln(bt.Never,t,r,n)}a(pSo,"FromNever");function*hSo(t,e,r,n){s0(t.not,e,r,n).next().done===!0&&(yield ln(bt.Not,t,r,n))}a(hSo,"FromNot");function*mSo(t,e,r,n){GB(n)||(yield ln(bt.Null,t,r,n))}a(mSo,"FromNull");function*gSo(t,e,r,n){if(!yu.IsNumberLike(n))return yield ln(bt.Number,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield ln(bt.NumberExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield ln(bt.NumberMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield ln(bt.NumberMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==0&&(yield ln(bt.NumberMultipleOf,t,r,n))}a(gSo,"FromNumber");function*ASo(t,e,r,n){if(!yu.IsObjectLike(n))return yield ln(bt.Object,t,r,n);ta(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield ln(bt.ObjectMinProperties,t,r,n)),ta(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield ln(bt.ObjectMaxProperties,t,r,n));let o=Array.isArray(t.required)?t.required:[],s=Object.getOwnPropertyNames(t.properties),c=Object.getOwnPropertyNames(n);for(let l of o)c.includes(l)||(yield ln(bt.ObjectRequiredProperty,t.properties[l],`${r}/${XB(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield ln(bt.ObjectAdditionalProperties,t,`${r}/${XB(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*s0(t.additionalProperties,e,`${r}/${XB(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*s0(u,e,`${r}/${XB(l)}`,n[l]),ZB(t)&&!(l in n)&&(yield ln(bt.ObjectRequiredProperty,u,`${r}/${XB(l)}`,void 0))):yu.IsExactOptionalProperty(n,l)&&(yield*s0(u,e,`${r}/${XB(l)}`,n[l]))}}a(ASo,"FromObject");function*ySo(t,e,r,n){L7e(n)||(yield ln(bt.Promise,t,r,n))}a(ySo,"FromPromise");function*_So(t,e,r,n){if(!yu.IsRecordLike(n))return yield ln(bt.Object,t,r,n);ta(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield ln(bt.ObjectMinProperties,t,r,n)),ta(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield ln(bt.ObjectMaxProperties,t,r,n));let[o,s]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let[l,u]of Object.entries(n))c.test(l)&&(yield*s0(s,e,`${r}/${XB(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*s0(t.additionalProperties,e,`${r}/${XB(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield ln(bt.ObjectAdditionalProperties,t,`${r}/${XB(l)}`,u)}}a(_So,"FromRecord");function*ESo(t,e,r,n){yield*s0(Da(t,e),e,r,n)}a(ESo,"FromRef");function*vSo(t,e,r,n){if(!pa(n))return yield ln(bt.String,t,r,n);if(ta(t.minLength)&&!(n.length>=t.minLength)&&(yield ln(bt.StringMinLength,t,r,n)),ta(t.maxLength)&&!(n.length<=t.maxLength)&&(yield ln(bt.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield ln(bt.RegExp,t,r,n)}a(vSo,"FromRegExp");function*CSo(t,e,r,n){if(!pa(n))return yield ln(bt.String,t,r,n);ta(t.minLength)&&!(n.length>=t.minLength)&&(yield ln(bt.StringMinLength,t,r,n)),ta(t.maxLength)&&!(n.length<=t.maxLength)&&(yield ln(bt.StringMaxLength,t,r,n)),pa(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield ln(bt.StringPattern,t,r,n))),pa(t.format)&&(mP.Has(t.format)?mP.Get(t.format)(n)||(yield ln(bt.StringFormat,t,r,n)):yield ln(bt.StringFormatUnknown,t,r,n))}a(CSo,"FromString");function*bSo(t,e,r,n){$B(n)||(yield ln(bt.Symbol,t,r,n))}a(bSo,"FromSymbol");function*SSo(t,e,r,n){if(!pa(n))return yield ln(bt.String,t,r,n);new RegExp(t.pattern).test(n)||(yield ln(bt.StringPattern,t,r,n))}a(SSo,"FromTemplateLiteral");function*TSo(t,e,r,n){yield*s0(Da(t,e),e,r,n)}a(TSo,"FromThis");function*ISo(t,e,r,n){if(!Mi(n))return yield ln(bt.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield ln(bt.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield ln(bt.TupleLength,t,r,n);if(t.items)for(let o=0;onew c7(s0(s,e,r,n)));yield ln(bt.Union,t,r,n,o)}a(wSo,"FromUnion");function*RSo(t,e,r,n){if(!Cse(n))return yield ln(bt.Uint8Array,t,r,n);ta(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield ln(bt.Uint8ArrayMaxByteLength,t,r,n)),ta(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield ln(bt.Uint8ArrayMinByteLength,t,r,n))}a(RSo,"FromUint8Array");function*kSo(t,e,r,n){}a(kSo,"FromUnknown");function*PSo(t,e,r,n){yu.IsVoidLike(n)||(yield ln(bt.Void,t,r,n))}a(PSo,"FromVoid");function*DSo(t,e,r,n){FE.Get(t[St])(t,n)||(yield ln(bt.Kind,t,r,n))}a(DSo,"FromKind");function*s0(t,e,r,n){let o=ta(t.$id)?[...e,t]:e,s=t;switch(s[St]){case"Any":return yield*Xbo(s,o,r,n);case"Argument":return yield*eSo(s,o,r,n);case"Array":return yield*tSo(s,o,r,n);case"AsyncIterator":return yield*rSo(s,o,r,n);case"BigInt":return yield*nSo(s,o,r,n);case"Boolean":return yield*iSo(s,o,r,n);case"Constructor":return yield*oSo(s,o,r,n);case"Date":return yield*sSo(s,o,r,n);case"Function":return yield*aSo(s,o,r,n);case"Import":return yield*cSo(s,o,r,n);case"Integer":return yield*lSo(s,o,r,n);case"Intersect":return yield*uSo(s,o,r,n);case"Iterator":return yield*dSo(s,o,r,n);case"Literal":return yield*fSo(s,o,r,n);case"Never":return yield*pSo(s,o,r,n);case"Not":return yield*hSo(s,o,r,n);case"Null":return yield*mSo(s,o,r,n);case"Number":return yield*gSo(s,o,r,n);case"Object":return yield*ASo(s,o,r,n);case"Promise":return yield*ySo(s,o,r,n);case"Record":return yield*_So(s,o,r,n);case"Ref":return yield*ESo(s,o,r,n);case"RegExp":return yield*vSo(s,o,r,n);case"String":return yield*CSo(s,o,r,n);case"Symbol":return yield*bSo(s,o,r,n);case"TemplateLiteral":return yield*SSo(s,o,r,n);case"This":return yield*TSo(s,o,r,n);case"Tuple":return yield*ISo(s,o,r,n);case"Undefined":return yield*xSo(s,o,r,n);case"Union":return yield*wSo(s,o,r,n);case"Uint8Array":return yield*RSo(s,o,r,n);case"Unknown":return yield*kSo(s,o,r,n);case"Void":return yield*PSo(s,o,r,n);default:if(!FE.Has(s[St]))throw new QNt(t);return yield*DSo(s,o,r,n)}}a(s0,"Visit");function OM(...t){let e=t.length===3?s0(t[0],t[1],"",t[2]):s0(t[0],[],"",t[1]);return new c7(e)}a(OM,"Errors");p();p();var Gse=class extends Gi{static{a(this,"TransformDecodeCheckError")}constructor(e,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=r,this.error=n}},qNt=class extends Gi{static{a(this,"TransformDecodeError")}constructor(e,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=e,this.path=r,this.value=n,this.error=o}};function jd(t,e,r){try{return uc(t)?t[Qd].Decode(r):r}catch(n){throw new qNt(t,e,r,n)}}a(jd,"Default");function NSo(t,e,r,n){return Mi(n)?jd(t,r,n.map((o,s)=>_P(t.items,e,`${r}/${s}`,o))):jd(t,r,n)}a(NSo,"FromArray");function MSo(t,e,r,n){if(!To(n)||c1(n))return jd(t,r,n);let o=V7e(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=_P(h,e,`${r}/${f}`,c[f]));if(!uc(t.unevaluatedProperties))return jd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=jd(u,`${r}/${f}`,d[f]));return jd(t,r,d)}a(MSo,"FromIntersect");function OSo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=_P(s,[...e,...o],r,n);return jd(t,r,c)}a(OSo,"FromImport");function LSo(t,e,r,n){return jd(t,r,_P(t.not,e,r,n))}a(LSo,"FromNot");function BSo(t,e,r,n){if(!To(n))return jd(t,r,n);let o=IC(t),s={...n};for(let d of o)Hi(s,d)&&(Yu(s[d])&&(!zB(t.properties[d])||yu.IsExactOptionalProperty(s,d))||(s[d]=_P(t.properties[d],e,`${r}/${d}`,s[d])));if(!qd(t.additionalProperties))return jd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=jd(l,`${r}/${d}`,u[d]));return jd(t,r,u)}a(BSo,"FromObject");function FSo(t,e,r,n){if(!To(n))return jd(t,r,n);let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=new RegExp(o),c={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(c[f]=_P(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!qd(t.additionalProperties))return jd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=jd(u,`${r}/${f}`,d[f]));return jd(t,r,d)}a(FSo,"FromRecord");function USo(t,e,r,n){let o=Da(t,e);return jd(t,r,_P(o,e,r,n))}a(USo,"FromRef");function QSo(t,e,r,n){let o=Da(t,e);return jd(t,r,_P(o,e,r,n))}a(QSo,"FromThis");function qSo(t,e,r,n){return Mi(n)&&Mi(t.items)?jd(t,r,t.items.map((o,s)=>_P(o,e,`${r}/${s}`,n[s]))):jd(t,r,n)}a(qSo,"FromTuple");function jSo(t,e,r,n){for(let o of t.anyOf){if(!os(o,e,n))continue;let s=_P(o,e,r,n);return jd(t,r,s)}return jd(t,r,n)}a(jSo,"FromUnion");function _P(t,e,r,n){let o=i0(t,e),s=t;switch(t[St]){case"Array":return NSo(s,o,r,n);case"Import":return OSo(s,o,r,n);case"Intersect":return MSo(s,o,r,n);case"Not":return LSo(s,o,r,n);case"Object":return BSo(s,o,r,n);case"Record":return FSo(s,o,r,n);case"Ref":return USo(s,o,r,n);case"Symbol":return jd(s,r,n);case"This":return QSo(s,o,r,n);case"Tuple":return qSo(s,o,r,n);case"Union":return jSo(s,o,r,n);default:return jd(s,r,n)}}a(_P,"Visit");function $se(t,e,r){return _P(t,e,"",r)}a($se,"TransformDecode");p();var Vse=class extends Gi{static{a(this,"TransformEncodeCheckError")}constructor(e,r,n){super("The encoded value does not match the expected schema"),this.schema=e,this.value=r,this.error=n}},jNt=class extends Gi{static{a(this,"TransformEncodeError")}constructor(e,r,n,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=e,this.path=r,this.value=n,this.error=o}};function xA(t,e,r){try{return uc(t)?t[Qd].Encode(r):r}catch(n){throw new jNt(t,e,r,n)}}a(xA,"Default");function HSo(t,e,r,n){let o=xA(t,r,n);return Mi(o)?o.map((s,c)=>EP(t.items,e,`${r}/${c}`,s)):o}a(HSo,"FromArray");function GSo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=xA(t,r,n);return EP(s,[...e,...o],r,c)}a(GSo,"FromImport");function $So(t,e,r,n){let o=xA(t,r,n);if(!To(n)||c1(n))return o;let s=V7e(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=EP(m,e,`${r}/${h}`,l[h]));if(!uc(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=xA(d,`${r}/${h}`,f[h]));return f}a($So,"FromIntersect");function VSo(t,e,r,n){return xA(t.not,r,xA(t,r,n))}a(VSo,"FromNot");function WSo(t,e,r,n){let o=xA(t,r,n);if(!To(o))return o;let s=IC(t),c={...o};for(let f of s)Hi(c,f)&&(Yu(c[f])&&(!zB(t.properties[f])||yu.IsExactOptionalProperty(c,f))||(c[f]=EP(t.properties[f],e,`${r}/${f}`,c[f])));if(!qd(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=xA(u,`${r}/${f}`,d[f]));return d}a(WSo,"FromObject");function zSo(t,e,r,n){let o=xA(t,r,n);if(!To(n))return o;let s=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(s),l={...o};for(let h of Object.getOwnPropertyNames(n))c.test(h)&&(l[h]=EP(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!qd(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=xA(d,`${r}/${h}`,f[h]));return f}a(zSo,"FromRecord");function YSo(t,e,r,n){let o=Da(t,e),s=EP(o,e,r,n);return xA(t,r,s)}a(YSo,"FromRef");function KSo(t,e,r,n){let o=Da(t,e),s=EP(o,e,r,n);return xA(t,r,s)}a(KSo,"FromThis");function JSo(t,e,r,n){let o=xA(t,r,n);return Mi(t.items)?t.items.map((s,c)=>EP(s,e,`${r}/${c}`,o[c])):[]}a(JSo,"FromTuple");function ZSo(t,e,r,n){for(let o of t.anyOf){if(!os(o,e,n))continue;let s=EP(o,e,r,n);return xA(t,r,s)}for(let o of t.anyOf){let s=EP(o,e,r,n);if(os(t,e,s))return xA(t,r,s)}return xA(t,r,n)}a(ZSo,"FromUnion");function EP(t,e,r,n){let o=i0(t,e),s=t;switch(t[St]){case"Array":return HSo(s,o,r,n);case"Import":return GSo(s,o,r,n);case"Intersect":return $So(s,o,r,n);case"Not":return VSo(s,o,r,n);case"Object":return WSo(s,o,r,n);case"Record":return zSo(s,o,r,n);case"Ref":return YSo(s,o,r,n);case"This":return KSo(s,o,r,n);case"Tuple":return JSo(s,o,r,n);case"Union":return ZSo(s,o,r,n);default:return xA(s,r,n)}}a(EP,"Visit");function Wse(t,e,r){return EP(t,e,"",r)}a(Wse,"TransformEncode");p();function XSo(t,e){return uc(t)||rg(t.items,e)}a(XSo,"FromArray");function e1o(t,e){return uc(t)||rg(t.items,e)}a(e1o,"FromAsyncIterator");function t1o(t,e){return uc(t)||rg(t.returns,e)||t.parameters.some(r=>rg(r,e))}a(t1o,"FromConstructor");function r1o(t,e){return uc(t)||rg(t.returns,e)||t.parameters.some(r=>rg(r,e))}a(r1o,"FromFunction");function n1o(t,e){return uc(t)||uc(t.unevaluatedProperties)||t.allOf.some(r=>rg(r,e))}a(n1o,"FromIntersect");function i1o(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return uc(t)||rg(n,[...r,...e])}a(i1o,"FromImport");function o1o(t,e){return uc(t)||rg(t.items,e)}a(o1o,"FromIterator");function s1o(t,e){return uc(t)||rg(t.not,e)}a(s1o,"FromNot");function a1o(t,e){return uc(t)||Object.values(t.properties).some(r=>rg(r,e))||qd(t.additionalProperties)&&rg(t.additionalProperties,e)}a(a1o,"FromObject");function c1o(t,e){return uc(t)||rg(t.item,e)}a(c1o,"FromPromise");function l1o(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return uc(t)||rg(n,e)||qd(t.additionalProperties)&&uc(t.additionalProperties)}a(l1o,"FromRecord");function u1o(t,e){return uc(t)?!0:rg(Da(t,e),e)}a(u1o,"FromRef");function d1o(t,e){return uc(t)?!0:rg(Da(t,e),e)}a(d1o,"FromThis");function f1o(t,e){return uc(t)||!Yu(t.items)&&t.items.some(r=>rg(r,e))}a(f1o,"FromTuple");function p1o(t,e){return uc(t)||t.anyOf.some(r=>rg(r,e))}a(p1o,"FromUnion");function rg(t,e){let r=i0(t,e),n=t;if(t.$id&&HNt.has(t.$id))return!1;switch(t.$id&&HNt.add(t.$id),t[St]){case"Array":return XSo(n,r);case"AsyncIterator":return e1o(n,r);case"Constructor":return t1o(n,r);case"Function":return r1o(n,r);case"Import":return i1o(n,r);case"Intersect":return n1o(n,r);case"Iterator":return o1o(n,r);case"Not":return s1o(n,r);case"Object":return a1o(n,r);case"Promise":return c1o(n,r);case"Record":return l1o(n,r);case"Ref":return u1o(n,r);case"This":return d1o(n,r);case"Tuple":return f1o(n,r);case"Union":return p1o(n,r);default:return uc(t)}}a(rg,"Visit");var HNt=new Set;function e3(t,e){return HNt.clear(),rg(t,e)}a(e3,"HasTransform");var GNt=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=e3(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return OM(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new Gse(this.schema,e,this.Errors(e).First());return this.hasTransform?$se(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?Wse(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new Vse(this.schema,e,this.Errors(e).First());return r}},oQe;(function(t){function e(s){return s===36}a(e,"DollarSign"),t.DollarSign=e;function r(s){return s===95}a(r,"IsUnderscore"),t.IsUnderscore=r;function n(s){return s>=65&&s<=90||s>=97&&s<=122}a(n,"IsAlpha"),t.IsAlpha=n;function o(s){return s>=48&&s<=57}a(o,"IsNumeric"),t.IsNumeric=o})(oQe||(oQe={}));var $Nt;(function(t){function e(r){let n=[];for(let o=0;o= ${te.minItems}`);let de=z(te.items,ee,"value");if(yield`((array) => { for(const ${he} of array) if(!(${de})) { return false }; return true; })(${K})`,Ju(te.contains)||ui(te.minContains)||ui(te.maxContains)){let Be=Ju(te.contains)?te.contains:is(),ne=z(Be,ee,"value"),ue=ui(te.minContains)?[`(count >= ${te.minContains})`]:[],Ne=ui(te.maxContains)?[`(count <= ${te.maxContains})`]:[],xe=`const count = value.reduce((${X}, ${he}) => ${ne} ? acc + 1 : acc, 0)`,Fe=["(count > 0)",...ue,...Ne].join(" && ");yield`((${he}) => { ${xe}; return ${Fe}})(${K})`}te.uniqueItems===!0&&(yield`((${he}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${K})`)}a(o,"FromArray");function*s(te,ee,K){yield`(typeof value === 'object' && Symbol.asyncIterator in ${K})`}a(s,"FromAsyncIterator");function*c(te,ee,K){yield`(typeof ${K} === 'bigint')`,TA(te.exclusiveMaximum)&&(yield`${K} < BigInt(${te.exclusiveMaximum})`),TA(te.exclusiveMinimum)&&(yield`${K} > BigInt(${te.exclusiveMinimum})`),TA(te.maximum)&&(yield`${K} <= BigInt(${te.maximum})`),TA(te.minimum)&&(yield`${K} >= BigInt(${te.minimum})`),TA(te.multipleOf)&&(yield`(${K} % BigInt(${te.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(te,ee,K){yield`(typeof ${K} === 'boolean')`}a(l,"FromBoolean");function*u(te,ee,K){yield*W(te.returns,ee,`${K}.prototype`)}a(u,"FromConstructor");function*d(te,ee,K){yield`(${K} instanceof Date) && Number.isFinite(${K}.getTime())`,ui(te.exclusiveMaximumTimestamp)&&(yield`${K}.getTime() < ${te.exclusiveMaximumTimestamp}`),ui(te.exclusiveMinimumTimestamp)&&(yield`${K}.getTime() > ${te.exclusiveMinimumTimestamp}`),ui(te.maximumTimestamp)&&(yield`${K}.getTime() <= ${te.maximumTimestamp}`),ui(te.minimumTimestamp)&&(yield`${K}.getTime() >= ${te.minimumTimestamp}`),ui(te.multipleOfTimestamp)&&(yield`(${K}.getTime() % ${te.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(te,ee,K){yield`(typeof ${K} === 'function')`}a(f,"FromFunction");function*h(te,ee,K){let he=globalThis.Object.getOwnPropertyNames(te.$defs).reduce((X,de)=>[...X,te.$defs[de]],[]);yield*W(Ex(te.$ref),[...ee,...he],K)}a(h,"FromImport");function*m(te,ee,K){yield`Number.isInteger(${K})`,ui(te.exclusiveMaximum)&&(yield`${K} < ${te.exclusiveMaximum}`),ui(te.exclusiveMinimum)&&(yield`${K} > ${te.exclusiveMinimum}`),ui(te.maximum)&&(yield`${K} <= ${te.maximum}`),ui(te.minimum)&&(yield`${K} >= ${te.minimum}`),ui(te.multipleOf)&&(yield`(${K} % ${te.multipleOf}) === 0`)}a(m,"FromInteger");function*g(te,ee,K){let he=te.allOf.map(X=>z(X,ee,K)).join(" && ");if(te.unevaluatedProperties===!1){let X=H(`${new RegExp(JB(te))};`),de=`Object.getOwnPropertyNames(${K}).every(key => ${X}.test(key))`;yield`(${he} && ${de})`}else if(Ju(te.unevaluatedProperties)){let X=H(`${new RegExp(JB(te))};`),de=`Object.getOwnPropertyNames(${K}).every(key => ${X}.test(key) || ${z(te.unevaluatedProperties,ee,`${K}[key]`)})`;yield`(${he} && ${de})`}else yield`(${he})`}a(g,"FromIntersect");function*A(te,ee,K){yield`(typeof value === 'object' && Symbol.iterator in ${K})`}a(A,"FromIterator");function*y(te,ee,K){if(typeof te.const=="number"||typeof te.const=="boolean")yield`(${K} === ${te.const})`;else if(typeof te.const=="string")yield`(${K} === ${l7(te.const)})`;else throw Error("Invalid Literal Value")}a(y,"FromLiteral");function*_(te,ee,K){yield"false"}a(_,"FromNever");function*E(te,ee,K){yield`(!${z(te.not,ee,K)})`}a(E,"FromNot");function*v(te,ee,K){yield`(${K} === null)`}a(v,"FromNull");function*S(te,ee,K){yield Dz.IsNumberLike(K),ui(te.exclusiveMaximum)&&(yield`${K} < ${te.exclusiveMaximum}`),ui(te.exclusiveMinimum)&&(yield`${K} > ${te.exclusiveMinimum}`),ui(te.maximum)&&(yield`${K} <= ${te.maximum}`),ui(te.minimum)&&(yield`${K} >= ${te.minimum}`),ui(te.multipleOf)&&(yield`(${K} % ${te.multipleOf}) === 0`)}a(S,"FromNumber");function*T(te,ee,K){yield Dz.IsObjectLike(K),ui(te.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${te.minProperties}`),ui(te.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${te.maxProperties}`);let he=Object.getOwnPropertyNames(te.properties);for(let X of he){let de=zJr(K,X),Be=te.properties[X];if(te.required&&te.required.includes(X))yield*W(Be,ee,de),(ZB(Be)||e(Be))&&(yield`(${l7(X)} in ${K})`);else{let ne=z(Be,ee,de);yield Dz.IsExactOptionalProperty(K,X,ne)}}if(te.additionalProperties===!1)if(te.required&&te.required.length===he.length)yield`Object.getOwnPropertyNames(${K}).length === ${he.length}`;else{let X=`[${he.map(de=>`${l7(de)}`).join(", ")}]`;yield`Object.getOwnPropertyNames(${K}).every(key => ${X}.includes(key))`}if(typeof te.additionalProperties=="object"){let X=z(te.additionalProperties,ee,`${K}[key]`),de=`[${he.map(Be=>`${l7(Be)}`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${K}).every(key => ${de}.includes(key) || ${X}))`}}a(T,"FromObject");function*w(te,ee,K){yield`${K} instanceof Promise`}a(w,"FromPromise");function*R(te,ee,K){yield Dz.IsRecordLike(K),ui(te.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${te.minProperties}`),ui(te.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${te.maxProperties}`);let[he,X]=Object.entries(te.patternProperties)[0],de=H(`${new RegExp(he)}`),Be=z(X,ee,"value"),ne=Ju(te.additionalProperties)?z(te.additionalProperties,ee,K):te.additionalProperties===!1?"false":"true",ue=`(${de}.test(key) ? ${Be} : ${ne})`;yield`(Object.entries(${K}).every(([key, value]) => ${ue}))`}a(R,"FromRecord");function*x(te,ee,K){let he=Da(te,ee);if(V.functions.has(te.$ref))return yield`${ie(te.$ref)}(${K})`;yield*W(he,ee,K)}a(x,"FromRef");function*k(te,ee,K){let he=H(`${new RegExp(te.source,te.flags)};`);yield`(typeof ${K} === 'string')`,ui(te.maxLength)&&(yield`${K}.length <= ${te.maxLength}`),ui(te.minLength)&&(yield`${K}.length >= ${te.minLength}`),yield`${he}.test(${K})`}a(k,"FromRegExp");function*D(te,ee,K){yield`(typeof ${K} === 'string')`,ui(te.maxLength)&&(yield`${K}.length <= ${te.maxLength}`),ui(te.minLength)&&(yield`${K}.length >= ${te.minLength}`),te.pattern!==void 0&&(yield`${H(`${new RegExp(te.pattern)};`)}.test(${K})`),te.format!==void 0&&(yield`format(${l7(te.format)}, ${K})`)}a(D,"FromString");function*N(te,ee,K){yield`(typeof ${K} === 'symbol')`}a(N,"FromSymbol");function*O(te,ee,K){yield`(typeof ${K} === 'string')`,yield`${H(`${new RegExp(te.pattern)};`)}.test(${K})`}a(O,"FromTemplateLiteral");function*B(te,ee,K){yield`${ie(te.$ref)}(${K})`}a(B,"FromThis");function*q(te,ee,K){if(yield`Array.isArray(${K})`,te.items===void 0)return yield`${K}.length === 0`;yield`(${K}.length === ${te.maxItems})`;for(let he=0;hez(X,ee,K)).join(" || ")})`}a(L,"FromUnion");function*U(te,ee,K){yield`${K} instanceof Uint8Array`,ui(te.maxByteLength)&&(yield`(${K}.length <= ${te.maxByteLength})`),ui(te.minByteLength)&&(yield`(${K}.length >= ${te.minByteLength})`)}a(U,"FromUint8Array");function*j(te,ee,K){yield"true"}a(j,"FromUnknown");function*Q(te,ee,K){yield Dz.IsVoidLike(K)}a(Q,"FromVoid");function*Y(te,ee,K){let he=V.instances.size;V.instances.set(he,te),yield`kind(${l7(te[St])}, ${he}, ${K})`}a(Y,"FromKind");function*W(te,ee,K,he=!0){let X=pa(te.$id)?[...ee,te]:ee,de=te;if(he&&pa(te.$id)){let Be=ie(te.$id);if(V.functions.has(Be))return yield`${Be}(${K})`;{V.functions.set(Be,"");let ne=re(Be,te,ee,"value",!1);return V.functions.set(Be,ne),yield`${Be}(${K})`}}switch(de[St]){case"Any":return yield*r(de,X,K);case"Argument":return yield*n(de,X,K);case"Array":return yield*o(de,X,K);case"AsyncIterator":return yield*s(de,X,K);case"BigInt":return yield*c(de,X,K);case"Boolean":return yield*l(de,X,K);case"Constructor":return yield*u(de,X,K);case"Date":return yield*d(de,X,K);case"Function":return yield*f(de,X,K);case"Import":return yield*h(de,X,K);case"Integer":return yield*m(de,X,K);case"Intersect":return yield*g(de,X,K);case"Iterator":return yield*A(de,X,K);case"Literal":return yield*y(de,X,K);case"Never":return yield*_(de,X,K);case"Not":return yield*E(de,X,K);case"Null":return yield*v(de,X,K);case"Number":return yield*S(de,X,K);case"Object":return yield*T(de,X,K);case"Promise":return yield*w(de,X,K);case"Record":return yield*R(de,X,K);case"Ref":return yield*x(de,X,K);case"RegExp":return yield*k(de,X,K);case"String":return yield*D(de,X,K);case"Symbol":return yield*N(de,X,K);case"TemplateLiteral":return yield*O(de,X,K);case"This":return yield*B(de,X,K);case"Tuple":return yield*q(de,X,K);case"Undefined":return yield*M(de,X,K);case"Union":return yield*L(de,X,K);case"Uint8Array":return yield*U(de,X,K);case"Unknown":return yield*j(de,X,K);case"Void":return yield*Q(de,X,K);default:if(!FE.Has(de[St]))throw new VNt(te);return yield*Y(de,X,K)}}a(W,"Visit");let V={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function z(te,ee,K,he=!0){return`(${[...W(te,ee,K,he)].join(" && ")})`}a(z,"CreateExpression");function ie(te){return`check_${$Nt.Encode(te)}`}a(ie,"CreateFunctionName");function H(te){let ee=`local_${V.variables.size}`;return V.variables.set(ee,`const ${ee} = ${te}`),ee}a(H,"CreateVariable");function re(te,ee,K,he,X=!0){let[de,Be]=[` +`,fgo=[cgo,lgo,ugo,dgo];function yDt(t){for(let e of ago)t.exec(e);return pgo(t),t}a(yDt,"applyPragmas");function pgo(t){let r=t.prepare("PRAGMA journal_mode").get()?.journal_mode;(typeof r=="string"?r.toLowerCase():void 0)!=="wal"&&t.exec("PRAGMA journal_mode = WAL")}a(pgo,"ensureWalMode");function _Dt(t){for(let e of fgo)t.exec(e);return t}a(_Dt,"applySchema");function Ez(t,e){t.exec("BEGIN IMMEDIATE");try{let r=e();return t.exec("COMMIT"),r}catch(r){try{t.exec("ROLLBACK")}catch{}throw r}}a(Ez,"runInWriteTx");p();p();p();var EDt="github.copilot",C$r="github-enterprise";p();var qs=a((t,e)=>({editorId:t,displayName:e}),"id"),hgo=qs("unknown","Unknown"),b$r=qs("eclipse","Eclipse"),S$r=qs("xcode","Xcode"),Q9=qs("vim","Vim/Neovim"),T$r=qs("helix","Helix"),mgo={"copilot-eclipse":b$r,Copilot4Eclipse:b$r,"copilot-xcode":S$r,"Copilot for Xcode":S$r,"copilot-vs":qs("visual-studio","Visual Studio"),"copilot.vim":Q9,"copilot.lua":Q9,"Github Copilot LSP for Neovim":Q9,"coc-github-copilot":Q9,"nvim-lspconfig":Q9,"copilot-lsp-client-neovim":Q9,"neovim-copilot-lsp":Q9,"sidekick.nvim":Q9,"helix-copilot":T$r,"copilot-helix":T$r,"copilot-sublime":qs("sublime-text","Sublime Text"),"zed-copilot":qs("zed","Zed"),RStudio:qs("rstudio","RStudio"),"obsidian-copilot":qs("obsidian","Obsidian"),marimo:qs("marimo","marimo"),"Qt Creator Copilot plugin":qs("qt-creator","Qt Creator"),"godot-copilot":qs("godot","Godot"),"kakoune-lsp":qs("kakoune","Kakoune"),"typora-copilot":qs("typora","Typora"),"Copilot for Nova":qs("nova","Nova")},ggo={IU:qs("intellij","IntelliJ IDEA"),IC:qs("intellij","IntelliJ IDEA"),IE:qs("intellij","IntelliJ IDEA"),PY:qs("pycharm","PyCharm"),PC:qs("pycharm","PyCharm"),PE:qs("pycharm","PyCharm"),WS:qs("webstorm","WebStorm"),PS:qs("phpstorm","PhpStorm"),RD:qs("rider","Rider"),RM:qs("rubymine","RubyMine"),CL:qs("clion","CLion"),GO:qs("goland","GoLand"),RR:qs("rustrover","RustRover"),DB:qs("datagrip","DataGrip"),DS:qs("dataspell","DataSpell"),AI:qs("android-studio","Android Studio"),QA:qs("aqua","Aqua"),MPS:qs("mps","MPS"),JBC:qs("jetbrains-client","JetBrains Client"),GW:qs("jetbrains-gateway","JetBrains Gateway")},I$r="JetBrains-",Ago=qs("jetbrains","JetBrains IDE");function x$r(t){let e=t.plugin.name?.trim();if(!e)return hgo;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(I$r)){let n=ggo[r.slice(I$r.length)];if(n)return n}return Ago}return mgo[e]??qs(e,e)}a(x$r,"resolveEditorIdentity");p();p();p();p();var C9e=class{constructor(e){this.userInfo=e}static{a(this,"CopilotUserInfoWrapper")}get sku(){return this.userInfo?.access_type_sku}get isFreeUser(){return this.sku==="free_limited_copilot"}get isIndividualUser(){return this.copilotPlan==="free"||this.copilotPlan==="individual"||this.copilotPlan==="individual_pro"||this.copilotPlan==="individual_max"}get isTBBEnabled(){return this.userInfo?.token_based_billing===!0}get copilotPlan(){if(this.isFreeUser)return"free";let e=this.userInfo?.copilot_plan;switch(e){case"individual":case"individual_pro":case"individual_max":case"business":case"enterprise":return e;default:return"individual"}}get canUpgradePlan(){return this.userInfo?.can_upgrade_plan===!0}get quotaInfo(){return{quota_snapshots:this.userInfo?.quota_snapshots,quota_reset_date:this.userInfo?.quota_reset_date}}get cliEnabled(){return this.userInfo?.cli_enabled}get raw(){return this.userInfo}};p();function vDt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(vDt,"findKnownOrg");function w$r(t){let e=t.organization_list??[];return vDt(e)??""}a(w$r,"getUserKind");p();var Jf=class{static{a(this,"LogTarget")}},MB=class{static{a(this,"TelemetryLogSender")}},pe=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(Jf).logIt(e,r,this.category,...n)}debug(e,...r){this.log(e,4,...r)}info(e,...r){this.log(e,3,...r)}warn(e,...r){this.log(e,2,...r)}error(e,...r){this.log(e,1,...r)}exception(e,r,n){if(r instanceof Error&&r.name==="Canceled"&&r.message==="Canceled")return;let o=n;n.startsWith(".")&&(o=n.substring(1),n=`${this.category}${n}`),e.get(MB).sendException(e,r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e,1,`${o}:`,s)}},Fr=new pe("default");p();p();p();p();async function XAo(){let{getDeviceId:t}=await Promise.resolve().then(()=>fe(szr()));return t()}a(XAo,"loadDeviceId");var fx=class{constructor(e=XAo){this.resolvedId="";this.deviceIdPromise=(async()=>e())().catch(()=>"").then(r=>this.resolvedId=r)}static{a(this,"DevDeviceIdManager")}async getId(){return this.deviceIdPromise}getIdSync(){return this.resolvedId}};p();p();p();var sP=class{static{a(this,"InlineCompletionsUnification")}},eyo={codeUnification:!1,modelUnification:!1,expAssignments:[]},_se=class extends sP{constructor(){super(...arguments);this.inlineCompletionsUnificationState=eyo;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};var px=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return q9e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(sP).inlineCompletionsUnificationState.expAssignments.filter(c=>!this.assignmentContext.includes(c)),s=[this.assignmentContext,...o].filter(Boolean).join(";");r.properties["VSCode.ABExp.Features"]=this.features,r.properties["abexp.assignmentcontext"]=s}};p();var LE="X-Copilot-RelatedPluginVersion-",Ese=(z=>(z.Market="X-MSEdge-Market",z.CorpNet="X-FD-Corpnet",z.Build="X-VSCode-Build",z.ApplicationVersion="X-VSCode-AppVersion",z.TargetPopulation="X-VSCode-TargetPopulation",z.ClientId="X-MSEdge-ClientId",z.DevDeviceId="X-VSCode-DevDeviceId",z.ExtensionName="X-VSCode-ExtensionName",z.ExtensionVersion="X-VSCode-ExtensionVersion",z.ExtensionRelease="X-VSCode-ExtensionRelease",z.CompletionsInChatExtensionVersion="X-VSCode-CompletionsInChatExtensionVersion",z.Language="X-VSCode-Language",z.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",z.CopilotEngine="X-Copilot-Engine",z.CopilotOverrideEngine="X-Copilot-OverrideEngine",z.CopilotRepository="X-Copilot-Repository",z.CopilotFileType="X-Copilot-FileType",z.CopilotUserKind="X-Copilot-UserKind",z.CopilotDogfood="X-Copilot-Dogfood",z.CopilotOrgs="X-Copilot-Orgs",z.CopilotTrackingId="X-Copilot-CopilotTrackingId",z.CopilotClientVersion="X-Copilot-ClientVersion",z.CopilotSku="X-GitHub-Copilot-SKU",z.CopilotIsFcv1="X-GitHub-Copilot-IsFcv1",z.CopilotIsSn="X-GitHub-Copilot-IsSn",z.CopilotRelatedPluginVersionCppTools=LE+"msvscodecpptools",z.CopilotRelatedPluginVersionCMakeTools=LE+"msvscodecmaketools",z.CopilotRelatedPluginVersionMakefileTools=LE+"msvscodemakefiletools",z.CopilotRelatedPluginVersionCSharpDevKit=LE+"msdotnettoolscsdevkit",z.CopilotRelatedPluginVersionPython=LE+"mspythonpython",z.CopilotRelatedPluginVersionPylance=LE+"mspythonvscodepylance",z.CopilotRelatedPluginVersionJavaPack=LE+"vscjavavscodejavapack",z.CopilotRelatedPluginVersionJavaManager=LE+"vscjavavscodejavadependency",z.CopilotRelatedPluginVersionTypescript=LE+"vscodetypescriptlanguagefeatures",z.CopilotRelatedPluginVersionTypescriptNext=LE+"msvscodevscodetypescriptnext",z.CopilotRelatedPluginVersionCSharp=LE+"msdotnettoolscsharp",z.CopilotRelatedPluginVersionGithubCopilotChat=LE+"githubcopilotchat",z.CopilotRelatedPluginVersionGithubCopilot=LE+"githubcopilot",z))(Ese||{});var tyo={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},QB=class t{constructor(e){this.filters=e;for(let[r,n]of Object.entries(this.filters))n===""&&delete this.filters[r]}static{a(this,"FilterSettings")}extends(e){for(let[r,n]of Object.entries(e.filters))if(this.filters[r]!==n)return!1;return!0}addToTelemetry(e){for(let[r,n]of Object.entries(this.filters)){let o=tyo[r];o!==void 0&&(e.properties[o]=n)}}stringify(){let e=Object.keys(this.filters);return e.sort(),e.map(r=>`${r}:${this.filters[r]}`).join(";")}toHeaders(){return{...this.filters}}withChange(e,r){return new t({...this.filters,[e]:r})}};p();p();p();function ws(t,e){let r=i0(t,e,"event.CopilotToken");return t.get(Qt).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(ws,"onCopilotToken");function VDt(t){let e=t.getTokenValue("tid"),r=t.organization_list,n=t.enterprise_list,o=t.getTokenValue("sku");if(!e)return;let s={copilot_trackingId:e};return r&&(s.organizations_list=r.toString()),n&&(s.enterprise_list=n.toString()),o&&(s.sku=o),s}a(VDt,"propertiesFromCopilotToken");var Gp=class{constructor(e){this.#e={};this.optedIn=!1;ws(e,r=>this.updateFromToken(r))}static{a(this,"TelemetryUserConfig")}#e;getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=VDt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1")}};var I7e=fe(Y9()),x7e=fe(require("os"));var ryo=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function nyo(t){let e={type:t.name,value:t.message},r=t.stack?.replace(/^.*?:\d+\n.*\n *\^?\n\n/,"");if(r?.startsWith(t.toString()+` +`)){e.stacktrace=[];for(let n of r.slice(t.toString().length+1).split(/\n/).reverse()){let o=n.match(ryo),s={filename:"",function:""};o&&(s.function=o[2]?.trim()?.replace(/^[^.]{1,2}(\.|$)/,"_$1")??s.function,s.filename=(o[4]?.trim()??s.filename).replace(/^\.\/dist\//,"/github-copilot/dist/"),o[5]&&o[5]!==":0"&&(s.lineno=o[5].slice(1)),o[6]&&o[5]!==":0"&&(s.colno=o[6].slice(1)),s.in_app=!/[[<:]|(?:^|\/)node_modules\//.test(s.filename)),e.stacktrace.push(s)}}return e}a(nyo,"buildExceptionDetail");function YDt(t,e){let r=t.get(Ir),n=r.getEditorInfo(),o=t.get(Gp),s={"#editor":n.devName??n.name,"#editor_version":o1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":o1(r.getEditorPluginInfo()),"#session_id":t.get(za).sessionId,"#machine_id":t.get(za).machineId,"#architecture":x7e.arch(),"#os_platform":x7e.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(YDt,"buildContext");function hYr(t,e,r){let n=t.get(As),o=t.get(Ir).getEditorInfo(),s=typeof process<"u"?process.versions.node:"web",c={app:"copilot-client",rollup_id:"auto",platform:"node",release:n.getBuildType()!=="dev"?`copilot-client@${n.getVersion()}`:void 0,deployed_to:n.getBuildType(),catalog_service:o.name==="vscode"?"CopilotCompletionsVSCode":"CopilotLanguageServer",transaction:r,context:YDt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=nyo(d);c.exception_detail.unshift(h),l.unshift([d,h]),u+=1,d=d.cause}let f=[];for(let[h,m]of l)if(m.stacktrace&&m.stacktrace.length>0){f.push(`${m.type}: ${h.code??""}`);let g=[...m.stacktrace].reverse();for(let y of g)if(y.filename?.startsWith("/github-copilot/"))return c;let A=!1;for(let y of g)if(y.in_app){A=!0,f.push(`${y.filename?.replace(/^\.\//,"")}:${y.lineno}:${y.colno}`);break}A||f.push(r),f.push(`${g[0].filename?.replace(/^\.\//,"")}`)}else return c;return c.exception_detail.length>0&&(c.rollup_id=(0,I7e.SHA256)(I7e.enc.Utf16.parse(f.join(` +`))).toString()),c}a(hYr,"buildPayload");p();var w7e=class{static{a(this,"FailingTelemetryReporter")}sendTelemetryEvent(e,r,n){throw new Error("Telemetry disabled")}sendTelemetryErrorEvent(e,r,n,o){throw new Error("Telemetry disabled")}dispose(){return Promise.resolve()}hackOptOutListener(){}};p();p();var gYr=fe(Y9());var Sn=class{constructor(e=10){this.valueMap=new Map;if(e<1)throw new Error("Size limit must be at least 1");this.sizeLimit=e}static{a(this,"LRUCacheMap")}set(e,r){if(this.has(e))this.valueMap.delete(e);else if(this.valueMap.size>=this.sizeLimit){let n=this.valueMap.keys().next().value;this.delete(n)}return this.valueMap.set(e,r),this}get(e){if(this.valueMap.has(e)){let r=this.valueMap.get(e);return this.valueMap.delete(e),this.valueMap.set(e,r),r}}delete(e){return this.valueMap.delete(e)}clear(){this.valueMap.clear()}get size(){return this.valueMap.size}keys(){return new Map(this.valueMap).keys()}values(){return new Map(this.valueMap).values()}entries(){return new Map(this.valueMap).entries()}[Symbol.iterator](){return this.entries()}has(e){return this.valueMap.has(e)}forEach(e,r){new Map(this.valueMap).forEach(e,r)}get[Symbol.toStringTag](){return"LRUCacheMap"}peek(e){return this.valueMap.get(e)}},aP=class extends Sn{constructor(r,n=120*1e3){super(r);this.defaultTtl=n;this.expiration=new Map}static{a(this,"LRUExpirationCacheMap")}has(r){let n=!1,o=this.expiration.get(r);return o!==void 0&&(o>performance.now()&&(n=super.has(r)),n||this.delete(r)),n}get(r){let n=this.expiration.get(r);if(n!==void 0){if(n>performance.now())return super.get(r);this.delete(r)}}peek(r){let n=this.expiration.get(r);if(n!==void 0){if(n>performance.now())return super.peek(r);this.delete(r)}}set(r,n,o=this.defaultTtl){if(o<=0)throw new Error("TTL must be greater than 0");let s=super.set(r,n);return this.expiration.set(r,performance.now()+o),s}clear(){super.clear(),this.expiration.clear()}delete(r){return this.expiration.delete(r),super.delete(r)}get[Symbol.toStringTag](){return"LRUExpirationCacheMap"}},R7e=class extends Sn{static{a(this,"LRUDisposableCacheMap")}delete(e){let r=this.peek(e);return r&&r.dispose(),super.delete(e)}clear(){for(let e of this.values())e.dispose();super.clear()}uncache(e){let r=this.peek(e);return super.delete(e),r}dispose(){this.clear()}};var AYr=7*86400*1e3,PM=class{constructor(e=5){this.perWeek=e;this.cache=new Sn(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-AYr);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(yYr(t.replace(/\\/g,"/")),"gi"):new RegExp(yYr(t),"gi"));function oyo(t,e){if(!t||!t.includes("/")&&!t.includes("\\"))return t;let r=t,n=[];for(let l of e)for(;;){let u=l.exec(t);if(!u)break;n.push([u.index,l.lastIndex])}let o=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,s=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g,c=0;for(r="";;){let l=s.exec(t);if(!l)break;let u=n.some(([d,f])=>l.index",c=s.lastIndex)}return c`;return t}a(syo,"removePropertiesWithPossibleUserInfo");function ayo(t){return t.replace(/([\s|(]|file:\/\/)(\/[^\s]+)/g,"$1[redacted]").replace(/([\s|(]|file:\/\/)([a-zA-Z]:[(\\|/){1,2}][^\s]+)/gi,"$1[redacted]").replace(/([\s|(]|file:\/\/)(\\[^\s]+)/gi,"$1[redacted]")}a(ayo,"redactPaths");function EYr(t,e=iyo){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=syo(s);if(c!==s){r[n]=c;continue}s=oyo(s,e);for(let l of e)s=s.replace(l,"");s=ayo(s),r[n]=s}return r}a(EYr,"sanitizeTelemetryProperties");function K9(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(K9,"filterTelemetryProperties");p();var hx=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:CYr(r,n),verboseLogging:lyo(r,n),testMode:e,simulation:cyo(n)})}};function s1(t){return t.get(hx).flags.testMode}a(s1,"isRunningInTest");function sSe(t){return s1(t)}a(sSe,"shouldFailForDebugPurposes");function aSe(t){return t.get(hx).flags.debug}a(aSe,"isDebugEnabled");function vYr(t){return t.get(hx).flags.verboseLogging}a(vYr,"isVerboseLoggingEnabled");function CYr(t,e){return t.includes("--debug")||JDt(e,"DEBUG")}a(CYr,"determineDebugFlag");function cyo(t){return JDt(t,"SIMULATION")}a(cyo,"determineSimulationFlag");function P7e(t){return t.get(hx).flags.simulation}a(P7e,"isRunningInSimulation");function lyo(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||JDt(e,"VERBOSE")||CYr(t,e)}a(lyo,"determineVerboseLoggingEnabled");function JDt(t,e){for(let r of["GH_COPILOT_","GITHUB_COPILOT_"]){let n=t[`${r}${e}`];if(n)return n==="1"||n?.toLowerCase()==="true"}return!1}a(JDt,"determineEnvFlagEnabled");p();var Qd=class{constructor(){this.promises=new Set}static{a(this,"PromiseQueue")}register(e){this.promises.add(e),e.finally(()=>this.promises.delete(e))}async flush(){await Promise.allSettled(this.promises)}};p();var TYr=require("os"),IYr=fe(require("path"));function cSe(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(cSe,"redactPaths");var uyo=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),dyo=[/^[\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}.]+ is not a function[ \w]*$/u,/^Cannot read properties of undefined \(reading '[\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}]+'\)$/u];function XDt(t){if(uyo.has(t))return t;for(let e of dyo)if(e.test(t))return t;return cSe(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(XDt,"redactMessage");function vse(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(vse,"escapeForRegExp");var fyo=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+vse((0,TYr.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function ZDt(t){return t.replace(fyo,"~")}a(ZDt,"redactHomeDir");var xYr="[\\\\/]?([^:)]*)(?=:\\d)",bYr=new RegExp(vse(IYr.sep),"g"),SYr=new RegExp(vse(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+xYr,"gi");function eNt(t,e,r=!1,n=[]){let o=new Error(e(t));o.name=t.name,typeof t.syscall=="string"&&(o.syscall=t.syscall),typeof t.code=="string"&&(o.code=t.code),typeof t.errno=="number"&&(o.errno=t.errno),o.stack=void 0;let s=t.stack?.replace(/^.*?:\d+\n.*\n *\^?\n\n/,""),c;for(let l of[t.toString(),`${t.name}: ${t.message}`])if(s?.startsWith(l+` +`)){c=s.slice(l.length+1).split(/\n/);break}if(c){o.stack=o.toString();for(let l of c)if(SYr.test(l))o.stack+=` +${cSe(l.replace(SYr,(u,d)=>"./"+d.replace(bYr,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` +${cSe(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(vse(f.replace(/[\\/]$/,""))+xYr,"gi");if(h.test(l)){o.stack+=` +${cSe(l.replace(h,(m,g)=>d+g.replace(bYr,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` +${ZDt(l)}`:o.stack+=` + at [redacted]:0:0`}}else r&&s&&(o.stack=ZDt(s));return t.cause instanceof Error&&(o.cause=eNt(t.cause,e,r,n)),o}a(eNt,"cloneError");function wYr(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(wYr,"errorMessageWithoutPath");function RYr(t,e){return eNt(t,a(function(n){return ZDt(wYr(n))},"prepareMessage"),!0,e)}a(RYr,"prepareErrorForRestrictedTelemetry");function kYr(t,e,r=!1){return eNt(t,a(function(o){if(r)return XDt(wYr(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=cSe(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(kYr,"redactError");p();p();var Zy={};Ti(Zy,{HasPropertyKey:()=>D7e,IsArray:()=>$p,IsAsyncIterator:()=>tNt,IsBigInt:()=>lSe,IsBoolean:()=>jB,IsDate:()=>Sz,IsFunction:()=>rNt,IsIterator:()=>nNt,IsNull:()=>iNt,IsNumber:()=>a1,IsObject:()=>al,IsRegExp:()=>uSe,IsString:()=>Zl,IsSymbol:()=>oNt,IsUint8Array:()=>HB,IsUndefined:()=>Vp});p();function D7e(t,e){return e in t}a(D7e,"HasPropertyKey");function tNt(t){return al(t)&&!$p(t)&&!HB(t)&&Symbol.asyncIterator in t}a(tNt,"IsAsyncIterator");function $p(t){return Array.isArray(t)}a($p,"IsArray");function lSe(t){return typeof t=="bigint"}a(lSe,"IsBigInt");function jB(t){return typeof t=="boolean"}a(jB,"IsBoolean");function Sz(t){return t instanceof globalThis.Date}a(Sz,"IsDate");function rNt(t){return typeof t=="function"}a(rNt,"IsFunction");function nNt(t){return al(t)&&!$p(t)&&!HB(t)&&Symbol.iterator in t}a(nNt,"IsIterator");function iNt(t){return t===null}a(iNt,"IsNull");function a1(t){return typeof t=="number"}a(a1,"IsNumber");function al(t){return typeof t=="object"&&t!==null}a(al,"IsObject");function uSe(t){return t instanceof globalThis.RegExp}a(uSe,"IsRegExp");function Zl(t){return typeof t=="string"}a(Zl,"IsString");function oNt(t){return typeof t=="symbol"}a(oNt,"IsSymbol");function HB(t){return t instanceof globalThis.Uint8Array}a(HB,"IsUint8Array");function Vp(t){return t===void 0}a(Vp,"IsUndefined");function pyo(t){return t.map(e=>N7e(e))}a(pyo,"ArrayType");function hyo(t){return new Date(t.getTime())}a(hyo,"DateType");function myo(t){return new Uint8Array(t)}a(myo,"Uint8ArrayType");function gyo(t){return new RegExp(t.source,t.flags)}a(gyo,"RegExpType");function Ayo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=N7e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=N7e(t[r]);return e}a(Ayo,"ObjectType");function N7e(t){return $p(t)?pyo(t):Sz(t)?hyo(t):HB(t)?myo(t):uSe(t)?gyo(t):al(t)?Ayo(t):t}a(N7e,"Visit");function zu(t){return N7e(t)}a(zu,"Clone");function Cse(t,e){return e===void 0?zu(t):zu({...e,...t})}a(Cse,"CloneType");p();p();p();function M7e(t){return To(t)&&globalThis.Symbol.asyncIterator in t}a(M7e,"IsAsyncIterator");function O7e(t){return To(t)&&globalThis.Symbol.iterator in t}a(O7e,"IsIterator");function sNt(t){return To(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(sNt,"IsStandardObject");function L7e(t){return t instanceof globalThis.Promise}a(L7e,"IsPromise");function BE(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(BE,"IsDate");function PYr(t){return t instanceof globalThis.Map}a(PYr,"IsMap");function DYr(t){return t instanceof globalThis.Set}a(DYr,"IsSet");function mx(t){return globalThis.ArrayBuffer.isView(t)}a(mx,"IsTypedArray");function bse(t){return t instanceof globalThis.Uint8Array}a(bse,"IsUint8Array");function Hi(t,e){return e in t}a(Hi,"HasPropertyKey");function To(t){return t!==null&&typeof t=="object"}a(To,"IsObject");function Mi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(Mi,"IsArray");function Yu(t){return t===void 0}a(Yu,"IsUndefined");function GB(t){return t===null}a(GB,"IsNull");function DM(t){return typeof t=="boolean"}a(DM,"IsBoolean");function ui(t){return typeof t=="number"}a(ui,"IsNumber");function B7e(t){return globalThis.Number.isInteger(t)}a(B7e,"IsInteger");function TA(t){return typeof t=="bigint"}a(TA,"IsBigInt");function pa(t){return typeof t=="string"}a(pa,"IsString");function J9(t){return typeof t=="function"}a(J9,"IsFunction");function $B(t){return typeof t=="symbol"}a($B,"IsSymbol");function c1(t){return TA(t)||DM(t)||GB(t)||ui(t)||pa(t)||$B(t)||Yu(t)}a(c1,"IsValueType");var yu;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(c,l){return t.ExactOptionalPropertyTypes?l in c:c[l]!==void 0}a(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function r(c){let l=To(c);return t.AllowArrayObject?l:l&&!Mi(c)}a(r,"IsObjectLike"),t.IsObjectLike=r;function n(c){return r(c)&&!(c instanceof Date)&&!(c instanceof Uint8Array)}a(n,"IsRecordLike"),t.IsRecordLike=n;function o(c){return t.AllowNaN?ui(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=Yu(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(yu||(yu={}));p();function yyo(t){return globalThis.Object.freeze(t).map(e=>dSe(e))}a(yyo,"ImmutableArray");function _yo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=dSe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=dSe(t[r]);return globalThis.Object.freeze(e)}a(_yo,"ImmutableObject");function dSe(t){return $p(t)?yyo(t):Sz(t)?t:HB(t)?t:uSe(t)?t:al(t)?_yo(t):t}a(dSe,"Immutable");function wt(t,e){let r=e!==void 0?{...e,...t}:t;switch(yu.InstanceMode){case"freeze":return dSe(r);case"clone":return zu(r);default:return r}}a(wt,"CreateType");p();var Gi=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};p();p();p();var qd=Symbol.for("TypeBox.Transform"),cP=Symbol.for("TypeBox.Readonly"),IA=Symbol.for("TypeBox.Optional"),gx=Symbol.for("TypeBox.Hint"),St=Symbol.for("TypeBox.Kind");function Sse(t){return al(t)&&t[cP]==="Readonly"}a(Sse,"IsReadonly");function bC(t){return al(t)&&t[IA]==="Optional"}a(bC,"IsOptional");function aNt(t){return ha(t,"Any")}a(aNt,"IsAny");function cNt(t){return ha(t,"Argument")}a(cNt,"IsArgument");function lP(t){return ha(t,"Array")}a(lP,"IsArray");function Tz(t){return ha(t,"AsyncIterator")}a(Tz,"IsAsyncIterator");function Iz(t){return ha(t,"BigInt")}a(Iz,"IsBigInt");function VB(t){return ha(t,"Boolean")}a(VB,"IsBoolean");function uP(t){return ha(t,"Computed")}a(uP,"IsComputed");function dP(t){return ha(t,"Constructor")}a(dP,"IsConstructor");function Eyo(t){return ha(t,"Date")}a(Eyo,"IsDate");function fP(t){return ha(t,"Function")}a(fP,"IsFunction");function pP(t){return ha(t,"Integer")}a(pP,"IsInteger");function _f(t){return ha(t,"Intersect")}a(_f,"IsIntersect");function xz(t){return ha(t,"Iterator")}a(xz,"IsIterator");function ha(t,e){return al(t)&&St in t&&t[St]===e}a(ha,"IsKindOf");function F7e(t){return jB(t)||a1(t)||Zl(t)}a(F7e,"IsLiteralValue");function l1(t){return ha(t,"Literal")}a(l1,"IsLiteral");function u1(t){return ha(t,"MappedKey")}a(u1,"IsMappedKey");function Ku(t){return ha(t,"MappedResult")}a(Ku,"IsMappedResult");function Z9(t){return ha(t,"Never")}a(Z9,"IsNever");function vyo(t){return ha(t,"Not")}a(vyo,"IsNot");function fSe(t){return ha(t,"Null")}a(fSe,"IsNull");function hP(t){return ha(t,"Number")}a(hP,"IsNumber");function Wp(t){return ha(t,"Object")}a(Wp,"IsObject");function wz(t){return ha(t,"Promise")}a(wz,"IsPromise");function Rz(t){return ha(t,"Record")}a(Rz,"IsRecord");function Zf(t){return ha(t,"Ref")}a(Zf,"IsRef");function lNt(t){return ha(t,"RegExp")}a(lNt,"IsRegExp");function WB(t){return ha(t,"String")}a(WB,"IsString");function pSe(t){return ha(t,"Symbol")}a(pSe,"IsSymbol");function d1(t){return ha(t,"TemplateLiteral")}a(d1,"IsTemplateLiteral");function Cyo(t){return ha(t,"This")}a(Cyo,"IsThis");function uc(t){return al(t)&&qd in t}a(uc,"IsTransform");function f1(t){return ha(t,"Tuple")}a(f1,"IsTuple");function zB(t){return ha(t,"Undefined")}a(zB,"IsUndefined");function Pa(t){return ha(t,"Union")}a(Pa,"IsUnion");function byo(t){return ha(t,"Uint8Array")}a(byo,"IsUint8Array");function Syo(t){return ha(t,"Unknown")}a(Syo,"IsUnknown");function Tyo(t){return ha(t,"Unsafe")}a(Tyo,"IsUnsafe");function Iyo(t){return ha(t,"Void")}a(Iyo,"IsVoid");function X9(t){return al(t)&&St in t&&Zl(t[St])}a(X9,"IsKind");function jd(t){return aNt(t)||cNt(t)||lP(t)||VB(t)||Iz(t)||Tz(t)||uP(t)||dP(t)||Eyo(t)||fP(t)||pP(t)||_f(t)||xz(t)||l1(t)||u1(t)||Ku(t)||Z9(t)||vyo(t)||fSe(t)||hP(t)||Wp(t)||wz(t)||Rz(t)||Zf(t)||lNt(t)||WB(t)||pSe(t)||d1(t)||Cyo(t)||f1(t)||zB(t)||Pa(t)||byo(t)||Syo(t)||Tyo(t)||Iyo(t)||X9(t)}a(jd,"IsSchema");var it={};Ti(it,{IsAny:()=>LYr,IsArgument:()=>BYr,IsArray:()=>FYr,IsAsyncIterator:()=>UYr,IsBigInt:()=>QYr,IsBoolean:()=>qYr,IsComputed:()=>jYr,IsConstructor:()=>HYr,IsDate:()=>GYr,IsFunction:()=>$Yr,IsImport:()=>Dyo,IsInteger:()=>VYr,IsIntersect:()=>WYr,IsIterator:()=>zYr,IsKind:()=>EKr,IsKindOf:()=>js,IsLiteral:()=>mSe,IsLiteralBoolean:()=>Nyo,IsLiteralNumber:()=>KYr,IsLiteralString:()=>YYr,IsLiteralValue:()=>JYr,IsMappedKey:()=>ZYr,IsMappedResult:()=>XYr,IsNever:()=>eKr,IsNot:()=>tKr,IsNull:()=>rKr,IsNumber:()=>nKr,IsObject:()=>iKr,IsOptional:()=>Pyo,IsPromise:()=>oKr,IsProperties:()=>U7e,IsReadonly:()=>kyo,IsRecord:()=>sKr,IsRecursive:()=>Myo,IsRef:()=>aKr,IsRegExp:()=>cKr,IsSchema:()=>Ju,IsString:()=>lKr,IsSymbol:()=>uKr,IsTemplateLiteral:()=>dKr,IsThis:()=>fKr,IsTransform:()=>pKr,IsTuple:()=>hKr,IsUint8Array:()=>gKr,IsUndefined:()=>mKr,IsUnion:()=>pNt,IsUnionLiteral:()=>Oyo,IsUnknown:()=>AKr,IsUnsafe:()=>yKr,IsVoid:()=>_Kr,TypeGuardUnknownTypeError:()=>uNt});p();var uNt=class extends Gi{static{a(this,"TypeGuardUnknownTypeError")}},xyo=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function NYr(t){try{return new RegExp(t),!0}catch{return!1}}a(NYr,"IsPattern");function dNt(t){if(!Zl(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(dNt,"IsControlCharacterFree");function MYr(t){return fNt(t)||Ju(t)}a(MYr,"IsAdditionalProperties");function hSe(t){return Vp(t)||lSe(t)}a(hSe,"IsOptionalBigInt");function Xl(t){return Vp(t)||a1(t)}a(Xl,"IsOptionalNumber");function fNt(t){return Vp(t)||jB(t)}a(fNt,"IsOptionalBoolean");function cl(t){return Vp(t)||Zl(t)}a(cl,"IsOptionalString");function wyo(t){return Vp(t)||Zl(t)&&dNt(t)&&NYr(t)}a(wyo,"IsOptionalPattern");function Ryo(t){return Vp(t)||Zl(t)&&dNt(t)}a(Ryo,"IsOptionalFormat");function OYr(t){return Vp(t)||Ju(t)}a(OYr,"IsOptionalSchema");function kyo(t){return al(t)&&t[cP]==="Readonly"}a(kyo,"IsReadonly");function Pyo(t){return al(t)&&t[IA]==="Optional"}a(Pyo,"IsOptional");function LYr(t){return js(t,"Any")&&cl(t.$id)}a(LYr,"IsAny");function BYr(t){return js(t,"Argument")&&a1(t.index)}a(BYr,"IsArgument");function FYr(t){return js(t,"Array")&&t.type==="array"&&cl(t.$id)&&Ju(t.items)&&Xl(t.minItems)&&Xl(t.maxItems)&&fNt(t.uniqueItems)&&OYr(t.contains)&&Xl(t.minContains)&&Xl(t.maxContains)}a(FYr,"IsArray");function UYr(t){return js(t,"AsyncIterator")&&t.type==="AsyncIterator"&&cl(t.$id)&&Ju(t.items)}a(UYr,"IsAsyncIterator");function QYr(t){return js(t,"BigInt")&&t.type==="bigint"&&cl(t.$id)&&hSe(t.exclusiveMaximum)&&hSe(t.exclusiveMinimum)&&hSe(t.maximum)&&hSe(t.minimum)&&hSe(t.multipleOf)}a(QYr,"IsBigInt");function qYr(t){return js(t,"Boolean")&&t.type==="boolean"&&cl(t.$id)}a(qYr,"IsBoolean");function jYr(t){return js(t,"Computed")&&Zl(t.target)&&$p(t.parameters)&&t.parameters.every(e=>Ju(e))}a(jYr,"IsComputed");function HYr(t){return js(t,"Constructor")&&t.type==="Constructor"&&cl(t.$id)&&$p(t.parameters)&&t.parameters.every(e=>Ju(e))&&Ju(t.returns)}a(HYr,"IsConstructor");function GYr(t){return js(t,"Date")&&t.type==="Date"&&cl(t.$id)&&Xl(t.exclusiveMaximumTimestamp)&&Xl(t.exclusiveMinimumTimestamp)&&Xl(t.maximumTimestamp)&&Xl(t.minimumTimestamp)&&Xl(t.multipleOfTimestamp)}a(GYr,"IsDate");function $Yr(t){return js(t,"Function")&&t.type==="Function"&&cl(t.$id)&&$p(t.parameters)&&t.parameters.every(e=>Ju(e))&&Ju(t.returns)}a($Yr,"IsFunction");function Dyo(t){return js(t,"Import")&&D7e(t,"$defs")&&al(t.$defs)&&U7e(t.$defs)&&D7e(t,"$ref")&&Zl(t.$ref)&&t.$ref in t.$defs}a(Dyo,"IsImport");function VYr(t){return js(t,"Integer")&&t.type==="integer"&&cl(t.$id)&&Xl(t.exclusiveMaximum)&&Xl(t.exclusiveMinimum)&&Xl(t.maximum)&&Xl(t.minimum)&&Xl(t.multipleOf)}a(VYr,"IsInteger");function U7e(t){return al(t)&&Object.entries(t).every(([e,r])=>dNt(e)&&Ju(r))}a(U7e,"IsProperties");function WYr(t){return js(t,"Intersect")&&!(Zl(t.type)&&t.type!=="object")&&$p(t.allOf)&&t.allOf.every(e=>Ju(e)&&!pKr(e))&&cl(t.type)&&(fNt(t.unevaluatedProperties)||OYr(t.unevaluatedProperties))&&cl(t.$id)}a(WYr,"IsIntersect");function zYr(t){return js(t,"Iterator")&&t.type==="Iterator"&&cl(t.$id)&&Ju(t.items)}a(zYr,"IsIterator");function js(t,e){return al(t)&&St in t&&t[St]===e}a(js,"IsKindOf");function YYr(t){return mSe(t)&&Zl(t.const)}a(YYr,"IsLiteralString");function KYr(t){return mSe(t)&&a1(t.const)}a(KYr,"IsLiteralNumber");function Nyo(t){return mSe(t)&&jB(t.const)}a(Nyo,"IsLiteralBoolean");function mSe(t){return js(t,"Literal")&&cl(t.$id)&&JYr(t.const)}a(mSe,"IsLiteral");function JYr(t){return jB(t)||a1(t)||Zl(t)}a(JYr,"IsLiteralValue");function ZYr(t){return js(t,"MappedKey")&&$p(t.keys)&&t.keys.every(e=>a1(e)||Zl(e))}a(ZYr,"IsMappedKey");function XYr(t){return js(t,"MappedResult")&&U7e(t.properties)}a(XYr,"IsMappedResult");function eKr(t){return js(t,"Never")&&al(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(eKr,"IsNever");function tKr(t){return js(t,"Not")&&Ju(t.not)}a(tKr,"IsNot");function rKr(t){return js(t,"Null")&&t.type==="null"&&cl(t.$id)}a(rKr,"IsNull");function nKr(t){return js(t,"Number")&&t.type==="number"&&cl(t.$id)&&Xl(t.exclusiveMaximum)&&Xl(t.exclusiveMinimum)&&Xl(t.maximum)&&Xl(t.minimum)&&Xl(t.multipleOf)}a(nKr,"IsNumber");function iKr(t){return js(t,"Object")&&t.type==="object"&&cl(t.$id)&&U7e(t.properties)&&MYr(t.additionalProperties)&&Xl(t.minProperties)&&Xl(t.maxProperties)}a(iKr,"IsObject");function oKr(t){return js(t,"Promise")&&t.type==="Promise"&&cl(t.$id)&&Ju(t.item)}a(oKr,"IsPromise");function sKr(t){return js(t,"Record")&&t.type==="object"&&cl(t.$id)&&MYr(t.additionalProperties)&&al(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&NYr(r[0])&&al(e.patternProperties)&&Ju(e.patternProperties[r[0]])})(t)}a(sKr,"IsRecord");function Myo(t){return al(t)&&gx in t&&t[gx]==="Recursive"}a(Myo,"IsRecursive");function aKr(t){return js(t,"Ref")&&cl(t.$id)&&Zl(t.$ref)}a(aKr,"IsRef");function cKr(t){return js(t,"RegExp")&&cl(t.$id)&&Zl(t.source)&&Zl(t.flags)&&Xl(t.maxLength)&&Xl(t.minLength)}a(cKr,"IsRegExp");function lKr(t){return js(t,"String")&&t.type==="string"&&cl(t.$id)&&Xl(t.minLength)&&Xl(t.maxLength)&&wyo(t.pattern)&&Ryo(t.format)}a(lKr,"IsString");function uKr(t){return js(t,"Symbol")&&t.type==="symbol"&&cl(t.$id)}a(uKr,"IsSymbol");function dKr(t){return js(t,"TemplateLiteral")&&t.type==="string"&&Zl(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(dKr,"IsTemplateLiteral");function fKr(t){return js(t,"This")&&cl(t.$id)&&Zl(t.$ref)}a(fKr,"IsThis");function pKr(t){return al(t)&&qd in t}a(pKr,"IsTransform");function hKr(t){return js(t,"Tuple")&&t.type==="array"&&cl(t.$id)&&a1(t.minItems)&&a1(t.maxItems)&&t.minItems===t.maxItems&&(Vp(t.items)&&Vp(t.additionalItems)&&t.minItems===0||$p(t.items)&&t.items.every(e=>Ju(e)))}a(hKr,"IsTuple");function mKr(t){return js(t,"Undefined")&&t.type==="undefined"&&cl(t.$id)}a(mKr,"IsUndefined");function Oyo(t){return pNt(t)&&t.anyOf.every(e=>YYr(e)||KYr(e))}a(Oyo,"IsUnionLiteral");function pNt(t){return js(t,"Union")&&cl(t.$id)&&al(t)&&$p(t.anyOf)&&t.anyOf.every(e=>Ju(e))}a(pNt,"IsUnion");function gKr(t){return js(t,"Uint8Array")&&t.type==="Uint8Array"&&cl(t.$id)&&Xl(t.minByteLength)&&Xl(t.maxByteLength)}a(gKr,"IsUint8Array");function AKr(t){return js(t,"Unknown")&&cl(t.$id)}a(AKr,"IsUnknown");function yKr(t){return js(t,"Unsafe")}a(yKr,"IsUnsafe");function _Kr(t){return js(t,"Void")&&t.type==="void"&&cl(t.$id)}a(_Kr,"IsVoid");function EKr(t){return al(t)&&St in t&&Zl(t[St])&&!xyo.includes(t[St])}a(EKr,"IsKind");function Ju(t){return al(t)&&(LYr(t)||BYr(t)||FYr(t)||qYr(t)||QYr(t)||UYr(t)||jYr(t)||HYr(t)||GYr(t)||$Yr(t)||VYr(t)||WYr(t)||zYr(t)||mSe(t)||ZYr(t)||XYr(t)||eKr(t)||tKr(t)||rKr(t)||nKr(t)||iKr(t)||oKr(t)||sKr(t)||aKr(t)||cKr(t)||lKr(t)||uKr(t)||dKr(t)||fKr(t)||hKr(t)||mKr(t)||pNt(t)||gKr(t)||AKr(t)||yKr(t)||_Kr(t)||EKr(t))}a(Ju,"IsSchema");p();var hNt="(true|false)",gSe="(0|[1-9][0-9]*)",mNt="(.*)",Lyo="(?!.*)",Uvl=`^${hNt}$`,e7=`^${gSe}$`,t7=`^${mNt}$`,vKr=`^${Lyo}$`;p();var mP={};Ti(mP,{Clear:()=>Fyo,Delete:()=>Uyo,Entries:()=>Byo,Get:()=>jyo,Has:()=>Qyo,Set:()=>qyo});p();var Tse=new Map;function Byo(){return new Map(Tse)}a(Byo,"Entries");function Fyo(){return Tse.clear()}a(Fyo,"Clear");function Uyo(t){return Tse.delete(t)}a(Uyo,"Delete");function Qyo(t){return Tse.has(t)}a(Qyo,"Has");function qyo(t,e){Tse.set(t,e)}a(qyo,"Set");function jyo(t){return Tse.get(t)}a(jyo,"Get");var FE={};Ti(FE,{Clear:()=>Gyo,Delete:()=>$yo,Entries:()=>Hyo,Get:()=>zyo,Has:()=>Vyo,Set:()=>Wyo});p();var Ise=new Map;function Hyo(){return new Map(Ise)}a(Hyo,"Entries");function Gyo(){return Ise.clear()}a(Gyo,"Clear");function $yo(t){return Ise.delete(t)}a($yo,"Delete");function Vyo(t){return Ise.has(t)}a(Vyo,"Has");function Wyo(t,e){Ise.set(t,e)}a(Wyo,"Set");function zyo(t){return Ise.get(t)}a(zyo,"Get");p();function CKr(t,e){return t.includes(e)}a(CKr,"SetIncludes");function bKr(t){return[...new Set(t)]}a(bKr,"SetDistinct");function Yyo(t,e){return t.filter(r=>e.includes(r))}a(Yyo,"SetIntersect");function Kyo(t,e){return t.reduce((r,n)=>Yyo(r,n),e)}a(Kyo,"SetIntersectManyResolve");function SKr(t){return t.length===1?t[0]:t.length>1?Kyo(t.slice(1),t[0]):[]}a(SKr,"SetIntersectMany");function TKr(t){let e=[];for(let r of t)e.push(...r);return e}a(TKr,"SetUnionMany");p();function r7(t){return wt({[St]:"Any"},t)}a(r7,"Any");p();function xse(t,e){return wt({[St]:"Array",type:"array",items:t},e)}a(xse,"Array");p();function IKr(t){return wt({[St]:"Argument",index:t})}a(IKr,"Argument");p();function wse(t,e){return wt({[St]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(wse,"AsyncIterator");p();p();function _u(t,e,r){return wt({[St]:"Computed",target:t,parameters:e},r)}a(_u,"Computed");p();p();function Jyo(t,e){let{[e]:r,...n}=t;return n}a(Jyo,"DiscardKey");function Ef(t,e){return e.reduce((r,n)=>Jyo(r,n),t)}a(Ef,"Discard");p();function is(t){return wt({[St]:"Never",not:{}},t)}a(is,"Never");p();p();function Ya(t){return wt({[St]:"MappedResult",properties:t})}a(Ya,"MappedResult");p();p();function Rse(t,e,r){return wt({[St]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(Rse,"Constructor");p();function NM(t,e,r){return wt({[St]:"Function",type:"Function",parameters:t,returns:e},r)}a(NM,"Function");p();p();p();p();function ASe(t,e){return wt({[St]:"Union",anyOf:t},e)}a(ASe,"UnionCreate");function Zyo(t){return t.some(e=>bC(e))}a(Zyo,"IsUnionOptional");function xKr(t){return t.map(e=>bC(e)?Xyo(e):e)}a(xKr,"RemoveOptionalFromRest");function Xyo(t){return Ef(t,[IA])}a(Xyo,"RemoveOptionalFromType");function e_o(t,e){return Zyo(t)?Xy(ASe(xKr(t),e)):ASe(xKr(t),e)}a(e_o,"ResolveUnion");function MM(t,e){return t.length===1?wt(t[0],e):t.length===0?is(e):e_o(t,e)}a(MM,"UnionEvaluated");p();function dc(t,e){return t.length===0?is(e):t.length===1?wt(t[0],e):ASe(t,e)}a(dc,"Union");p();p();p();var Q7e=class extends Gi{static{a(this,"TemplateLiteralParserError")}};function t_o(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(t_o,"Unescape");function gNt(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(gNt,"IsNonEscaped");function KB(t,e){return gNt(t,e,"(")}a(KB,"IsOpenParen");function ySe(t,e){return gNt(t,e,")")}a(ySe,"IsCloseParen");function wKr(t,e){return gNt(t,e,"|")}a(wKr,"IsSeparator");function r_o(t){if(!(KB(t,0)&&ySe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(kse(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(kse(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(s_o,"Or");function a_o(t){function e(o,s){if(!KB(o,s))throw new Q7e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(kse(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(a_o,"And");function kse(t){return r_o(t)?kse(n_o(t)):i_o(t)?s_o(t):o_o(t)?a_o(t):{type:"const",const:t_o(t)}}a(kse,"TemplateLiteralParse");function Pse(t){return kse(t.slice(1,t.length-1))}a(Pse,"TemplateLiteralParseExact");var ANt=class extends Gi{static{a(this,"TemplateLiteralFiniteError")}};function c_o(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}a(c_o,"IsNumberExpression");function l_o(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}a(l_o,"IsBooleanExpression");function u_o(t){return t.type==="const"&&t.const===".*"}a(u_o,"IsStringExpression");function kz(t){return c_o(t)||u_o(t)?!1:l_o(t)?!0:t.type==="and"?t.expr.every(e=>kz(e)):t.type==="or"?t.expr.every(e=>kz(e)):t.type==="const"?!0:(()=>{throw new ANt("Unknown expression type")})()}a(kz,"IsTemplateLiteralExpressionFinite");function q7e(t){let e=Pse(t.pattern);return kz(e)}a(q7e,"IsTemplateLiteralFinite");p();var yNt=class extends Gi{static{a(this,"TemplateLiteralGenerateError")}};function*RKr(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of RKr(t.slice(1)))yield`${e}${r}`}a(RKr,"GenerateReduce");function*d_o(t){return yield*RKr(t.expr.map(e=>[..._Se(e)]))}a(d_o,"GenerateAnd");function*f_o(t){for(let e of t.expr)yield*_Se(e)}a(f_o,"GenerateOr");function*p_o(t){return yield t.const}a(p_o,"GenerateConst");function*_Se(t){return t.type==="and"?yield*d_o(t):t.type==="or"?yield*f_o(t):t.type==="const"?yield*p_o(t):(()=>{throw new yNt("Unknown expression")})()}a(_Se,"TemplateLiteralExpressionGenerate");function Dse(t){let e=Pse(t.pattern);return kz(e)?[..._Se(e)]:[]}a(Dse,"TemplateLiteralGenerate");p();p();function ma(t,e){return wt({[St]:"Literal",const:t,type:typeof t},e)}a(ma,"Literal");p();function j7e(t){return wt({[St]:"Boolean",type:"boolean"},t)}a(j7e,"Boolean");p();function Nse(t){return wt({[St]:"BigInt",type:"bigint"},t)}a(Nse,"BigInt");p();function Ax(t){return wt({[St]:"Number",type:"number"},t)}a(Ax,"Number");p();function UE(t){return wt({[St]:"String",type:"string"},t)}a(UE,"String");function*h_o(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield j7e():e==="number"?yield Ax():e==="bigint"?yield Nse():e==="string"?yield UE():yield(()=>{let r=e.split("|").map(n=>ma(n.trim()));return r.length===0?is():r.length===1?r[0]:MM(r)})()}a(h_o,"FromUnion");function*m_o(t){if(t[1]!=="{"){let e=ma("$"),r=_Nt(t.slice(1));return yield*[e,...r]}for(let e=2;ePKr(r,e)).join("|")})`:hP(t)?`${e}${gSe}`:pP(t)?`${e}${gSe}`:Iz(t)?`${e}${gSe}`:WB(t)?`${e}${mNt}`:l1(t)?`${e}${g_o(t.const.toString())}`:VB(t)?`${e}${hNt}`:(()=>{throw new ENt(`Unexpected Kind '${t[St]}'`)})()}a(PKr,"Visit");function vNt(t){return`^${t.map(e=>PKr(e,"")).join("")}$`}a(vNt,"TemplateLiteralPattern");p();function Pz(t){let r=Dse(t).map(n=>ma(n));return MM(r)}a(Pz,"TemplateLiteralToUnion");p();function H7e(t,e){let r=Zl(t)?vNt(kKr(t)):vNt(t);return wt({[St]:"TemplateLiteral",type:"string",pattern:r},e)}a(H7e,"TemplateLiteral");function A_o(t){return Dse(t).map(r=>r.toString())}a(A_o,"FromTemplateLiteral");function y_o(t){let e=[];for(let r of t)e.push(...SC(r));return e}a(y_o,"FromUnion");function __o(t){return[t.toString()]}a(__o,"FromLiteral");function SC(t){return[...new Set(d1(t)?A_o(t):Pa(t)?y_o(t.anyOf):l1(t)?__o(t.const):hP(t)?["[number]"]:pP(t)?["[number]"]:[])]}a(SC,"IndexPropertyKeys");p();function E_o(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=n7(t,SC(e[o]),r);return n}a(E_o,"FromProperties");function v_o(t,e,r){return E_o(t,e.properties,r)}a(v_o,"FromMappedResult");function DKr(t,e,r){let n=v_o(t,e,r);return Ya(n)}a(DKr,"IndexFromMappedResult");function MKr(t,e){return t.map(r=>OKr(r,e))}a(MKr,"FromRest");function C_o(t){return t.filter(e=>!Z9(e))}a(C_o,"FromIntersectRest");function b_o(t,e){return G7e(C_o(MKr(t,e)))}a(b_o,"FromIntersect");function S_o(t){return t.some(e=>Z9(e))?[]:t}a(S_o,"FromUnionRest");function T_o(t,e){return MM(S_o(MKr(t,e)))}a(T_o,"FromUnion");function I_o(t,e){return e in t?t[e]:e==="[number]"?MM(t):is()}a(I_o,"FromTuple");function x_o(t,e){return e==="[number]"?t:is()}a(x_o,"FromArray");function w_o(t,e){return e in t?t[e]:is()}a(w_o,"FromProperty");function OKr(t,e){return _f(t)?b_o(t.allOf,e):Pa(t)?T_o(t.anyOf,e):f1(t)?I_o(t.items??[],e):lP(t)?x_o(t.items,e):Wp(t)?w_o(t.properties,e):is()}a(OKr,"IndexFromPropertyKey");function ESe(t,e){return e.map(r=>OKr(t,r))}a(ESe,"IndexFromPropertyKeys");function NKr(t,e){return MM(ESe(t,e))}a(NKr,"FromSchema");function n7(t,e,r){if(Zf(t)||Zf(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!jd(t)||!jd(e))throw new Gi(n);return _u("Index",[t,e])}return Ku(e)?DKr(t,e,r):u1(e)?LKr(t,e,r):wt(jd(e)?NKr(t,SC(e)):NKr(t,e),r)}a(n7,"Index");function R_o(t,e,r){return{[e]:n7(t,[e],zu(r))}}a(R_o,"MappedIndexPropertyKey");function k_o(t,e,r){return e.reduce((n,o)=>({...n,...R_o(t,o,r)}),{})}a(k_o,"MappedIndexPropertyKeys");function P_o(t,e,r){return k_o(t,e.keys,r)}a(P_o,"MappedIndexProperties");function LKr(t,e,r){let n=P_o(t,e,r);return Ya(n)}a(LKr,"IndexFromMappedKey");p();function Mse(t,e){return wt({[St]:"Iterator",type:"Iterator",items:t},e)}a(Mse,"Iterator");p();function D_o(t){return globalThis.Object.keys(t).filter(e=>!bC(t[e]))}a(D_o,"RequiredArray");function N_o(t,e){let r=D_o(t),n=r.length>0?{[St]:"Object",type:"object",required:r,properties:t}:{[St]:"Object",type:"object",properties:t};return wt(n,e)}a(N_o,"_Object_");var fc=N_o;p();function $7e(t,e){return wt({[St]:"Promise",type:"Promise",item:t},e)}a($7e,"Promise");p();p();function M_o(t){return wt(Ef(t,[cP]))}a(M_o,"RemoveReadonly");function O_o(t){return wt({...t,[cP]:"Readonly"})}a(O_o,"AddReadonly");function L_o(t,e){return e===!1?M_o(t):O_o(t)}a(L_o,"ReadonlyWithFlag");function TC(t,e){let r=e??!0;return Ku(t)?BKr(t,r):L_o(t,r)}a(TC,"Readonly");function B_o(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=TC(t[n],e);return r}a(B_o,"FromProperties");function F_o(t,e){return B_o(t.properties,e)}a(F_o,"FromMappedResult");function BKr(t,e){let r=F_o(t,e);return Ya(r)}a(BKr,"ReadonlyFromMappedResult");p();function yx(t,e){return wt(t.length>0?{[St]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[St]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(yx,"Tuple");function FKr(t,e){return t in e?_x(t,e[t]):Ya(e)}a(FKr,"FromMappedResult");function U_o(t){return{[t]:ma(t)}}a(U_o,"MappedKeyToKnownMappedResultProperties");function Q_o(t){let e={};for(let r of t)e[r]=ma(r);return e}a(Q_o,"MappedKeyToUnknownMappedResultProperties");function q_o(t,e){return CKr(e,t)?U_o(t):Q_o(e)}a(q_o,"MappedKeyToMappedResultProperties");function j_o(t,e){let r=q_o(t,e);return FKr(t,r)}a(j_o,"FromMappedKey");function vSe(t,e){return e.map(r=>_x(t,r))}a(vSe,"FromRest");function H_o(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=_x(t,e[n]);return r}a(H_o,"FromProperties");function _x(t,e){let r={...e};return bC(e)?Xy(_x(t,Ef(e,[IA]))):Sse(e)?TC(_x(t,Ef(e,[cP]))):Ku(e)?FKr(t,e.properties):u1(e)?j_o(t,e.keys):dP(e)?Rse(vSe(t,e.parameters),_x(t,e.returns),r):fP(e)?NM(vSe(t,e.parameters),_x(t,e.returns),r):Tz(e)?wse(_x(t,e.items),r):xz(e)?Mse(_x(t,e.items),r):_f(e)?e_(vSe(t,e.allOf),r):Pa(e)?dc(vSe(t,e.anyOf),r):f1(e)?yx(vSe(t,e.items??[]),r):Wp(e)?fc(H_o(t,e.properties),r):lP(e)?xse(_x(t,e.items),r):wz(e)?$7e(_x(t,e.item),r):e}a(_x,"FromSchemaType");function G_o(t,e){let r={};for(let n of t)r[n]=_x(n,e);return r}a(G_o,"MappedFunctionReturnType");function UKr(t,e,r){let n=jd(t)?SC(t):t,o=e({[St]:"MappedKey",keys:n}),s=G_o(n,o);return fc(s,r)}a(UKr,"Mapped");p();function $_o(t){return wt(Ef(t,[IA]))}a($_o,"RemoveOptional");function V_o(t){return wt({...t,[IA]:"Optional"})}a(V_o,"AddOptional");function W_o(t,e){return e===!1?$_o(t):V_o(t)}a(W_o,"OptionalWithFlag");function Xy(t,e){let r=e??!0;return Ku(t)?QKr(t,r):W_o(t,r)}a(Xy,"Optional");function z_o(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Xy(t[n],e);return r}a(z_o,"FromProperties");function Y_o(t,e){return z_o(t.properties,e)}a(Y_o,"FromMappedResult");function QKr(t,e){let r=Y_o(t,e);return Ya(r)}a(QKr,"OptionalFromMappedResult");p();function CSe(t,e={}){let r=t.every(o=>Wp(o)),n=jd(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return wt(e.unevaluatedProperties===!1||jd(e.unevaluatedProperties)||r?{...n,[St]:"Intersect",type:"object",allOf:t}:{...n,[St]:"Intersect",allOf:t},e)}a(CSe,"IntersectCreate");function K_o(t){return t.every(e=>bC(e))}a(K_o,"IsIntersectOptional");function J_o(t){return Ef(t,[IA])}a(J_o,"RemoveOptionalFromType");function qKr(t){return t.map(e=>bC(e)?J_o(e):e)}a(qKr,"RemoveOptionalFromRest");function Z_o(t,e){return K_o(t)?Xy(CSe(qKr(t),e)):CSe(qKr(t),e)}a(Z_o,"ResolveIntersect");function G7e(t,e={}){if(t.length===1)return wt(t[0],e);if(t.length===0)return is(e);if(t.some(r=>uc(r)))throw new Error("Cannot intersect transform types");return Z_o(t,e)}a(G7e,"IntersectEvaluated");p();function e_(t,e){if(t.length===1)return wt(t[0],e);if(t.length===0)return is(e);if(t.some(r=>uc(r)))throw new Error("Cannot intersect transform types");return CSe(t,e)}a(e_,"Intersect");p();function Ex(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new Gi("Ref: $ref must be a string");return wt({[St]:"Ref",$ref:e},r)}a(Ex,"Ref");function X_o(t,e){return _u("Awaited",[_u(t,e)])}a(X_o,"FromComputed");function eEo(t){return _u("Awaited",[Ex(t)])}a(eEo,"FromRef");function tEo(t){return e_(jKr(t))}a(tEo,"FromIntersect");function rEo(t){return dc(jKr(t))}a(rEo,"FromUnion");function nEo(t){return Ose(t)}a(nEo,"FromPromise");function jKr(t){return t.map(e=>Ose(e))}a(jKr,"FromRest");function Ose(t,e){return wt(uP(t)?X_o(t.target,t.parameters):_f(t)?tEo(t.allOf):Pa(t)?rEo(t.anyOf):wz(t)?nEo(t.item):Zf(t)?eEo(t.$ref):t,e)}a(Ose,"Awaited");p();p();p();p();function HKr(t){let e=[];for(let r of t)e.push(IC(r));return e}a(HKr,"FromRest");function iEo(t){let e=HKr(t);return TKr(e)}a(iEo,"FromIntersect");function oEo(t){let e=HKr(t);return SKr(e)}a(oEo,"FromUnion");function sEo(t){return t.map((e,r)=>r.toString())}a(sEo,"FromTuple");function aEo(t){return["[number]"]}a(aEo,"FromArray");function cEo(t){return globalThis.Object.getOwnPropertyNames(t)}a(cEo,"FromProperties");function lEo(t){return CNt?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(lEo,"FromPatternProperties");function IC(t){return _f(t)?iEo(t.allOf):Pa(t)?oEo(t.anyOf):f1(t)?sEo(t.items??[]):lP(t)?aEo(t.items):Wp(t)?cEo(t.properties):Rz(t)?lEo(t.patternProperties):[]}a(IC,"KeyOfPropertyKeys");var CNt=!1;function JB(t){CNt=!0;let e=IC(t);return CNt=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(JB,"KeyOfPattern");function uEo(t,e){return _u("KeyOf",[_u(t,e)])}a(uEo,"FromComputed");function dEo(t){return _u("KeyOf",[Ex(t)])}a(dEo,"FromRef");function fEo(t,e){let r=IC(t),n=pEo(r),o=MM(n);return wt(o,e)}a(fEo,"KeyOfFromType");function pEo(t){return t.map(e=>e==="[number]"?Ax():ma(e))}a(pEo,"KeyOfPropertyKeysToRest");function Lse(t,e){return uP(t)?uEo(t.target,t.parameters):Zf(t)?dEo(t.$ref):Ku(t)?GKr(t,e):fEo(t,e)}a(Lse,"KeyOf");function hEo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Lse(t[n],zu(e));return r}a(hEo,"FromProperties");function mEo(t,e){return hEo(t.properties,e)}a(mEo,"FromMappedResult");function GKr(t,e){let r=mEo(t,e);return Ya(r)}a(GKr,"KeyOfFromMappedResult");p();function V7e(t){let e=IC(t),r=ESe(t,e);return e.map((n,o)=>[e[o],r[o]])}a(V7e,"KeyOfPropertyEntries");function gEo(t){let e=[];for(let r of t)e.push(...IC(r));return bKr(e)}a(gEo,"CompositeKeys");function AEo(t){return t.filter(e=>!Z9(e))}a(AEo,"FilterNever");function yEo(t,e){let r=[];for(let n of t)r.push(...ESe(n,[e]));return AEo(r)}a(yEo,"CompositeProperty");function _Eo(t,e){let r={};for(let n of e)r[n]=G7e(yEo(t,n));return r}a(_Eo,"CompositeProperties");function $Kr(t,e){let r=gEo(t),n=_Eo(t,r);return fc(n,e)}a($Kr,"Composite");p();p();function W7e(t){return wt({[St]:"Date",type:"Date"},t)}a(W7e,"Date");p();function z7e(t){return wt({[St]:"Null",type:"null"},t)}a(z7e,"Null");p();function Y7e(t){return wt({[St]:"Symbol",type:"symbol"},t)}a(Y7e,"Symbol");p();function K7e(t){return wt({[St]:"Undefined",type:"undefined"},t)}a(K7e,"Undefined");p();function J7e(t){return wt({[St]:"Uint8Array",type:"Uint8Array"},t)}a(J7e,"Uint8Array");p();function gP(t){return wt({[St]:"Unknown"},t)}a(gP,"Unknown");function EEo(t){return t.map(e=>bNt(e,!1))}a(EEo,"FromArray");function vEo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=TC(bNt(t[r],!1));return e}a(vEo,"FromProperties");function Z7e(t,e){return e===!0?t:TC(t)}a(Z7e,"ConditionalReadonly");function bNt(t,e){return tNt(t)?Z7e(r7(),e):nNt(t)?Z7e(r7(),e):$p(t)?TC(yx(EEo(t))):HB(t)?J7e():Sz(t)?W7e():al(t)?Z7e(fc(vEo(t)),e):rNt(t)?Z7e(NM([],gP()),e):Vp(t)?K7e():iNt(t)?z7e():oNt(t)?Y7e():lSe(t)?Nse():a1(t)?ma(t):jB(t)?ma(t):Zl(t)?ma(t):fc({})}a(bNt,"FromValue");function VKr(t,e){return wt(bNt(t,!0),e)}a(VKr,"Const");p();function WKr(t,e){return dP(t)?yx(t.parameters,e):is(e)}a(WKr,"ConstructorParameters");p();function zKr(t,e){if(Vp(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>ma(s));return dc(o,{...e,[gx]:"Enum"})}a(zKr,"Enum");p();p();p();var TNt=class extends Gi{static{a(this,"ExtendsResolverError")}},Rt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Rt||(Rt={}));function vx(t){return t===Rt.False?t:Rt.True}a(vx,"IntoBooleanResult");function Bse(t){throw new TNt(t)}a(Bse,"Throw");function jh(t){return it.IsNever(t)||it.IsIntersect(t)||it.IsUnion(t)||it.IsUnknown(t)||it.IsAny(t)}a(jh,"IsStructuralRight");function Hh(t,e){return it.IsNever(e)?tJr(t,e):it.IsIntersect(e)?X7e(t,e):it.IsUnion(e)?RNt(t,e):it.IsUnknown(e)?oJr(t,e):it.IsAny(e)?wNt(t,e):Bse("StructuralRight")}a(Hh,"StructuralRight");function wNt(t,e){return Rt.True}a(wNt,"FromAnyRight");function CEo(t,e){return it.IsIntersect(e)?X7e(t,e):it.IsUnion(e)&&e.anyOf.some(r=>it.IsAny(r)||it.IsUnknown(r))?Rt.True:it.IsUnion(e)?Rt.Union:it.IsUnknown(e)||it.IsAny(e)?Rt.True:Rt.Union}a(CEo,"FromAny");function bEo(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)?Rt.True:Rt.False}a(bEo,"FromArrayRight");function SEo(t,e){return it.IsObject(e)&&eQe(e)?Rt.True:jh(e)?Hh(t,e):it.IsArray(e)?vx(ll(t.items,e.items)):Rt.False}a(SEo,"FromArray");function TEo(t,e){return jh(e)?Hh(t,e):it.IsAsyncIterator(e)?vx(ll(t.items,e.items)):Rt.False}a(TEo,"FromAsyncIterator");function IEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsBigInt(e)?Rt.True:Rt.False}a(IEo,"FromBigInt");function XKr(t,e){return it.IsLiteralBoolean(t)||it.IsBoolean(t)?Rt.True:Rt.False}a(XKr,"FromBooleanRight");function xEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsBoolean(e)?Rt.True:Rt.False}a(xEo,"FromBoolean");function wEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsConstructor(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>vx(ll(e.parameters[n],r))===Rt.True)?vx(ll(t.returns,e.returns)):Rt.False:Rt.False}a(wEo,"FromConstructor");function REo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsDate(e)?Rt.True:Rt.False}a(REo,"FromDate");function kEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsFunction(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>vx(ll(e.parameters[n],r))===Rt.True)?vx(ll(t.returns,e.returns)):Rt.False:Rt.False}a(kEo,"FromFunction");function eJr(t,e){return it.IsLiteral(t)&&Zy.IsNumber(t.const)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(eJr,"FromIntegerRight");function PEo(t,e){return it.IsInteger(e)||it.IsNumber(e)?Rt.True:jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):Rt.False}a(PEo,"FromInteger");function X7e(t,e){return e.allOf.every(r=>ll(t,r)===Rt.True)?Rt.True:Rt.False}a(X7e,"FromIntersectRight");function DEo(t,e){return t.allOf.some(r=>ll(r,e)===Rt.True)?Rt.True:Rt.False}a(DEo,"FromIntersect");function NEo(t,e){return jh(e)?Hh(t,e):it.IsIterator(e)?vx(ll(t.items,e.items)):Rt.False}a(NEo,"FromIterator");function MEo(t,e){return it.IsLiteral(e)&&e.const===t.const?Rt.True:jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsString(e)?iJr(t,e):it.IsNumber(e)?rJr(t,e):it.IsInteger(e)?eJr(t,e):it.IsBoolean(e)?XKr(t,e):Rt.False}a(MEo,"FromLiteral");function tJr(t,e){return Rt.False}a(tJr,"FromNeverRight");function OEo(t,e){return Rt.True}a(OEo,"FromNever");function YKr(t){let[e,r]=[t,0];for(;it.IsNot(e);)e=e.not,r+=1;return r%2===0?e:gP()}a(YKr,"UnwrapTNot");function LEo(t,e){return it.IsNot(t)?ll(YKr(t),e):it.IsNot(e)?ll(t,YKr(e)):Bse("Invalid fallthrough for Not")}a(LEo,"FromNot");function BEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsNull(e)?Rt.True:Rt.False}a(BEo,"FromNull");function rJr(t,e){return it.IsLiteralNumber(t)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(rJr,"FromNumberRight");function FEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsInteger(e)||it.IsNumber(e)?Rt.True:Rt.False}a(FEo,"FromNumber");function xC(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(xC,"IsObjectPropertyCount");function KKr(t){return eQe(t)}a(KKr,"IsObjectStringLike");function JKr(t){return xC(t,0)||xC(t,1)&&"description"in t.properties&&it.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(it.IsString(t.properties.description.anyOf[0])&&it.IsUndefined(t.properties.description.anyOf[1])||it.IsString(t.properties.description.anyOf[1])&&it.IsUndefined(t.properties.description.anyOf[0]))}a(JKr,"IsObjectSymbolLike");function SNt(t){return xC(t,0)}a(SNt,"IsObjectNumberLike");function ZKr(t){return xC(t,0)}a(ZKr,"IsObjectBooleanLike");function UEo(t){return xC(t,0)}a(UEo,"IsObjectBigIntLike");function QEo(t){return xC(t,0)}a(QEo,"IsObjectDateLike");function qEo(t){return eQe(t)}a(qEo,"IsObjectUint8ArrayLike");function jEo(t){let e=Ax();return xC(t,0)||xC(t,1)&&"length"in t.properties&&vx(ll(t.properties.length,e))===Rt.True}a(jEo,"IsObjectFunctionLike");function HEo(t){return xC(t,0)}a(HEo,"IsObjectConstructorLike");function eQe(t){let e=Ax();return xC(t,0)||xC(t,1)&&"length"in t.properties&&vx(ll(t.properties.length,e))===Rt.True}a(eQe,"IsObjectArrayLike");function GEo(t){let e=NM([r7()],r7());return xC(t,0)||xC(t,1)&&"then"in t.properties&&vx(ll(t.properties.then,e))===Rt.True}a(GEo,"IsObjectPromiseLike");function nJr(t,e){return ll(t,e)===Rt.False||it.IsOptional(t)&&!it.IsOptional(e)?Rt.False:Rt.True}a(nJr,"Property");function t_(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)||it.IsLiteralString(t)&&KKr(e)||it.IsLiteralNumber(t)&&SNt(e)||it.IsLiteralBoolean(t)&&ZKr(e)||it.IsSymbol(t)&&JKr(e)||it.IsBigInt(t)&&UEo(e)||it.IsString(t)&&KKr(e)||it.IsSymbol(t)&&JKr(e)||it.IsNumber(t)&&SNt(e)||it.IsInteger(t)&&SNt(e)||it.IsBoolean(t)&&ZKr(e)||it.IsUint8Array(t)&&qEo(e)||it.IsDate(t)&&QEo(e)||it.IsConstructor(t)&&HEo(e)||it.IsFunction(t)&&jEo(e)?Rt.True:it.IsRecord(t)&&it.IsString(INt(t))?e[gx]==="Record"?Rt.True:Rt.False:it.IsRecord(t)&&it.IsNumber(INt(t))&&xC(e,0)?Rt.True:Rt.False}a(t_,"FromObjectRight");function $Eo(t,e){return jh(e)?Hh(t,e):it.IsRecord(e)?Cx(t,e):it.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!it.IsOptional(e.properties[r]))return Rt.False;if(it.IsOptional(e.properties[r]))return Rt.True;if(nJr(t.properties[r],e.properties[r])===Rt.False)return Rt.False}return Rt.True})():Rt.False}a($Eo,"FromObject");function VEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)&&GEo(e)?Rt.True:it.IsPromise(e)?vx(ll(t.item,e.item)):Rt.False}a(VEo,"FromPromise");function INt(t){return e7 in t.patternProperties?Ax():t7 in t.patternProperties?UE():Bse("Unknown record key pattern")}a(INt,"RecordKey");function xNt(t){return e7 in t.patternProperties?t.patternProperties[e7]:t7 in t.patternProperties?t.patternProperties[t7]:Bse("Unable to get record value schema")}a(xNt,"RecordValue");function Cx(t,e){let[r,n]=[INt(e),xNt(e)];return it.IsLiteralString(t)&&it.IsNumber(r)&&vx(ll(t,n))===Rt.True?Rt.True:it.IsUint8Array(t)&&it.IsNumber(r)||it.IsString(t)&&it.IsNumber(r)||it.IsArray(t)&&it.IsNumber(r)?ll(t,n):it.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(nJr(n,t.properties[o])===Rt.False)return Rt.False;return Rt.True})():Rt.False}a(Cx,"FromRecordRight");function WEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?ll(xNt(t),xNt(e)):Rt.False}a(WEo,"FromRecord");function zEo(t,e){let r=it.IsRegExp(t)?UE():t,n=it.IsRegExp(e)?UE():e;return ll(r,n)}a(zEo,"FromRegExp");function iJr(t,e){return it.IsLiteral(t)&&Zy.IsString(t.const)||it.IsString(t)?Rt.True:Rt.False}a(iJr,"FromStringRight");function YEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsString(e)?Rt.True:Rt.False}a(YEo,"FromString");function KEo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsSymbol(e)?Rt.True:Rt.False}a(KEo,"FromSymbol");function JEo(t,e){return it.IsTemplateLiteral(t)?ll(Pz(t),e):it.IsTemplateLiteral(e)?ll(t,Pz(e)):Bse("Invalid fallthrough for TemplateLiteral")}a(JEo,"FromTemplateLiteral");function ZEo(t,e){return it.IsArray(e)&&t.items!==void 0&&t.items.every(r=>ll(r,e.items)===Rt.True)}a(ZEo,"IsArrayOfTuple");function XEo(t,e){return it.IsNever(t)?Rt.True:it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:Rt.False}a(XEo,"FromTupleRight");function evo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)&&eQe(e)||it.IsArray(e)&&ZEo(t,e)?Rt.True:it.IsTuple(e)?Zy.IsUndefined(t.items)&&!Zy.IsUndefined(e.items)||!Zy.IsUndefined(t.items)&&Zy.IsUndefined(e.items)?Rt.False:Zy.IsUndefined(t.items)&&!Zy.IsUndefined(e.items)||t.items.every((r,n)=>ll(r,e.items[n])===Rt.True)?Rt.True:Rt.False:Rt.False}a(evo,"FromTuple");function tvo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsUint8Array(e)?Rt.True:Rt.False}a(tvo,"FromUint8Array");function rvo(t,e){return jh(e)?Hh(t,e):it.IsObject(e)?t_(t,e):it.IsRecord(e)?Cx(t,e):it.IsVoid(e)?ovo(t,e):it.IsUndefined(e)?Rt.True:Rt.False}a(rvo,"FromUndefined");function RNt(t,e){return e.anyOf.some(r=>ll(t,r)===Rt.True)?Rt.True:Rt.False}a(RNt,"FromUnionRight");function nvo(t,e){return t.anyOf.every(r=>ll(r,e)===Rt.True)?Rt.True:Rt.False}a(nvo,"FromUnion");function oJr(t,e){return Rt.True}a(oJr,"FromUnknownRight");function ivo(t,e){return it.IsNever(e)?tJr(t,e):it.IsIntersect(e)?X7e(t,e):it.IsUnion(e)?RNt(t,e):it.IsAny(e)?wNt(t,e):it.IsString(e)?iJr(t,e):it.IsNumber(e)?rJr(t,e):it.IsInteger(e)?eJr(t,e):it.IsBoolean(e)?XKr(t,e):it.IsArray(e)?bEo(t,e):it.IsTuple(e)?XEo(t,e):it.IsObject(e)?t_(t,e):it.IsUnknown(e)?Rt.True:Rt.False}a(ivo,"FromUnknown");function ovo(t,e){return it.IsUndefined(t)||it.IsUndefined(t)?Rt.True:Rt.False}a(ovo,"FromVoidRight");function svo(t,e){return it.IsIntersect(e)?X7e(t,e):it.IsUnion(e)?RNt(t,e):it.IsUnknown(e)?oJr(t,e):it.IsAny(e)?wNt(t,e):it.IsObject(e)?t_(t,e):it.IsVoid(e)?Rt.True:Rt.False}a(svo,"FromVoid");function ll(t,e){return it.IsTemplateLiteral(t)||it.IsTemplateLiteral(e)?JEo(t,e):it.IsRegExp(t)||it.IsRegExp(e)?zEo(t,e):it.IsNot(t)||it.IsNot(e)?LEo(t,e):it.IsAny(t)?CEo(t,e):it.IsArray(t)?SEo(t,e):it.IsBigInt(t)?IEo(t,e):it.IsBoolean(t)?xEo(t,e):it.IsAsyncIterator(t)?TEo(t,e):it.IsConstructor(t)?wEo(t,e):it.IsDate(t)?REo(t,e):it.IsFunction(t)?kEo(t,e):it.IsInteger(t)?PEo(t,e):it.IsIntersect(t)?DEo(t,e):it.IsIterator(t)?NEo(t,e):it.IsLiteral(t)?MEo(t,e):it.IsNever(t)?OEo(t,e):it.IsNull(t)?BEo(t,e):it.IsNumber(t)?FEo(t,e):it.IsObject(t)?$Eo(t,e):it.IsRecord(t)?WEo(t,e):it.IsString(t)?YEo(t,e):it.IsSymbol(t)?KEo(t,e):it.IsTuple(t)?evo(t,e):it.IsPromise(t)?VEo(t,e):it.IsUint8Array(t)?tvo(t,e):it.IsUndefined(t)?rvo(t,e):it.IsUnion(t)?nvo(t,e):it.IsUnknown(t)?ivo(t,e):it.IsVoid(t)?svo(t,e):Bse(`Unknown left type operand '${t[St]}'`)}a(ll,"Visit");function i7(t,e){return ll(t,e)}a(i7,"ExtendsCheck");p();p();p();function avo(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=Fse(t[c],e,r,n,zu(o));return s}a(avo,"FromProperties");function cvo(t,e,r,n,o){return avo(t.properties,e,r,n,o)}a(cvo,"FromMappedResult");function sJr(t,e,r,n,o){let s=cvo(t,e,r,n,o);return Ya(s)}a(sJr,"ExtendsFromMappedResult");function lvo(t,e,r,n){let o=i7(t,e);return o===Rt.Union?dc([r,n]):o===Rt.True?r:n}a(lvo,"ExtendsResolve");function Fse(t,e,r,n,o){return Ku(t)?sJr(t,e,r,n,o):u1(t)?wt(aJr(t,e,r,n,o)):wt(lvo(t,e,r,n),o)}a(Fse,"Extends");function uvo(t,e,r,n,o){return{[t]:Fse(ma(t),e,r,n,zu(o))}}a(uvo,"FromPropertyKey");function dvo(t,e,r,n,o){return t.reduce((s,c)=>({...s,...uvo(c,e,r,n,o)}),{})}a(dvo,"FromPropertyKeys");function fvo(t,e,r,n,o){return dvo(t.keys,e,r,n,o)}a(fvo,"FromMappedKey");function aJr(t,e,r,n,o){let s=fvo(t,e,r,n,o);return Ya(s)}a(aJr,"ExtendsFromMappedKey");p();function pvo(t){return t.allOf.every(e=>ZB(e))}a(pvo,"Intersect");function hvo(t){return t.anyOf.some(e=>ZB(e))}a(hvo,"Union");function mvo(t){return!ZB(t.not)}a(mvo,"Not");function ZB(t){return t[St]==="Intersect"?pvo(t):t[St]==="Union"?hvo(t):t[St]==="Not"?mvo(t):t[St]==="Undefined"}a(ZB,"ExtendsUndefinedCheck");p();function cJr(t,e){return Use(Pz(t),e)}a(cJr,"ExcludeFromTemplateLiteral");function gvo(t,e){let r=t.filter(n=>i7(n,e)===Rt.False);return r.length===1?r[0]:dc(r)}a(gvo,"ExcludeRest");function Use(t,e,r={}){return d1(t)?wt(cJr(t,e),r):Ku(t)?wt(lJr(t,e),r):wt(Pa(t)?gvo(t.anyOf,e):i7(t,e)!==Rt.False?is():t,r)}a(Use,"Exclude");function Avo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Use(t[n],e);return r}a(Avo,"FromProperties");function yvo(t,e){return Avo(t.properties,e)}a(yvo,"FromMappedResult");function lJr(t,e){let r=yvo(t,e);return Ya(r)}a(lJr,"ExcludeFromMappedResult");p();p();p();function uJr(t,e){return Qse(Pz(t),e)}a(uJr,"ExtractFromTemplateLiteral");function _vo(t,e){let r=t.filter(n=>i7(n,e)!==Rt.False);return r.length===1?r[0]:dc(r)}a(_vo,"ExtractRest");function Qse(t,e,r){return d1(t)?wt(uJr(t,e),r):Ku(t)?wt(dJr(t,e),r):wt(Pa(t)?_vo(t.anyOf,e):i7(t,e)!==Rt.False?t:is(),r)}a(Qse,"Extract");function Evo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Qse(t[n],e);return r}a(Evo,"FromProperties");function vvo(t,e){return Evo(t.properties,e)}a(vvo,"FromMappedResult");function dJr(t,e){let r=vvo(t,e);return Ya(r)}a(dJr,"ExtractFromMappedResult");p();function fJr(t,e){return dP(t)?wt(t.returns,e):is(e)}a(fJr,"InstanceType");p();p();function tQe(t){return TC(Xy(t))}a(tQe,"ReadonlyOptional");p();function Dz(t,e,r){return wt({[St]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(Dz,"RecordCreateFromPattern");function kNt(t,e,r){let n={};for(let o of t)n[o]=e;return fc(n,{...r,[gx]:"Record"})}a(kNt,"RecordCreateFromKeys");function Cvo(t,e,r){return q7e(t)?kNt(SC(t),e,r):Dz(t.pattern,e,r)}a(Cvo,"FromTemplateLiteralKey");function bvo(t,e,r){return kNt(SC(dc(t)),e,r)}a(bvo,"FromUnionKey");function Svo(t,e,r){return kNt([t.toString()],e,r)}a(Svo,"FromLiteralKey");function Tvo(t,e,r){return Dz(t.source,e,r)}a(Tvo,"FromRegExpKey");function Ivo(t,e,r){let n=Vp(t.pattern)?t7:t.pattern;return Dz(n,e,r)}a(Ivo,"FromStringKey");function xvo(t,e,r){return Dz(t7,e,r)}a(xvo,"FromAnyKey");function wvo(t,e,r){return Dz(vKr,e,r)}a(wvo,"FromNeverKey");function Rvo(t,e,r){return fc({true:e,false:e},r)}a(Rvo,"FromBooleanKey");function kvo(t,e,r){return Dz(e7,e,r)}a(kvo,"FromIntegerKey");function Pvo(t,e,r){return Dz(e7,e,r)}a(Pvo,"FromNumberKey");function rQe(t,e,r={}){return Pa(t)?bvo(t.anyOf,e,r):d1(t)?Cvo(t,e,r):l1(t)?Svo(t.const,e,r):VB(t)?Rvo(t,e,r):pP(t)?kvo(t,e,r):hP(t)?Pvo(t,e,r):lNt(t)?Tvo(t,e,r):WB(t)?Ivo(t,e,r):aNt(t)?xvo(t,e,r):Z9(t)?wvo(t,e,r):is(r)}a(rQe,"Record");function nQe(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(nQe,"RecordPattern");function pJr(t){let e=nQe(t);return e===t7?UE():e===e7?Ax():UE({pattern:e})}a(pJr,"RecordKey");function iQe(t){return t.patternProperties[nQe(t)]}a(iQe,"RecordValue");function Dvo(t,e){return e.parameters=bSe(t,e.parameters),e.returns=AP(t,e.returns),e}a(Dvo,"FromConstructor");function Nvo(t,e){return e.parameters=bSe(t,e.parameters),e.returns=AP(t,e.returns),e}a(Nvo,"FromFunction");function Mvo(t,e){return e.allOf=bSe(t,e.allOf),e}a(Mvo,"FromIntersect");function Ovo(t,e){return e.anyOf=bSe(t,e.anyOf),e}a(Ovo,"FromUnion");function Lvo(t,e){return Vp(e.items)||(e.items=bSe(t,e.items)),e}a(Lvo,"FromTuple");function Bvo(t,e){return e.items=AP(t,e.items),e}a(Bvo,"FromArray");function Fvo(t,e){return e.items=AP(t,e.items),e}a(Fvo,"FromAsyncIterator");function Uvo(t,e){return e.items=AP(t,e.items),e}a(Uvo,"FromIterator");function Qvo(t,e){return e.item=AP(t,e.item),e}a(Qvo,"FromPromise");function qvo(t,e){let r=$vo(t,e.properties);return{...e,...fc(r)}}a(qvo,"FromObject");function jvo(t,e){let r=AP(t,pJr(e)),n=AP(t,iQe(e)),o=rQe(r,n);return{...e,...o}}a(jvo,"FromRecord");function Hvo(t,e){return e.index in t?t[e.index]:gP()}a(Hvo,"FromArgument");function Gvo(t,e){let r=Sse(e),n=bC(e),o=AP(t,e);return r&&n?tQe(o):r&&!n?TC(o):!r&&n?Xy(o):o}a(Gvo,"FromProperty");function $vo(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:Gvo(t,e[n])}),{})}a($vo,"FromProperties");function bSe(t,e){return e.map(r=>AP(t,r))}a(bSe,"FromTypes");function AP(t,e){return dP(e)?Dvo(t,e):fP(e)?Nvo(t,e):_f(e)?Mvo(t,e):Pa(e)?Ovo(t,e):f1(e)?Lvo(t,e):lP(e)?Bvo(t,e):Tz(e)?Fvo(t,e):xz(e)?Uvo(t,e):wz(e)?Qvo(t,e):Wp(e)?qvo(t,e):Rz(e)?jvo(t,e):cNt(e)?Hvo(t,e):e}a(AP,"FromType");function hJr(t,e){return AP(e,Cse(t))}a(hJr,"Instantiate");p();function mJr(t){return wt({[St]:"Integer",type:"integer"},t)}a(mJr,"Integer");p();p();p();function Vvo(t,e,r){return{[t]:yP(ma(t),e,zu(r))}}a(Vvo,"MappedIntrinsicPropertyKey");function Wvo(t,e,r){return t.reduce((o,s)=>({...o,...Vvo(s,e,r)}),{})}a(Wvo,"MappedIntrinsicPropertyKeys");function zvo(t,e,r){return Wvo(t.keys,e,r)}a(zvo,"MappedIntrinsicProperties");function gJr(t,e,r){let n=zvo(t,e,r);return Ya(n)}a(gJr,"IntrinsicFromMappedKey");function Yvo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(Yvo,"ApplyUncapitalize");function Kvo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(Kvo,"ApplyCapitalize");function Jvo(t){return t.toUpperCase()}a(Jvo,"ApplyUppercase");function Zvo(t){return t.toLowerCase()}a(Zvo,"ApplyLowercase");function Xvo(t,e,r){let n=Pse(t.pattern);if(!kz(n))return{...t,pattern:AJr(t.pattern,e)};let c=[..._Se(n)].map(d=>ma(d)),l=yJr(c,e),u=dc(l);return H7e([u],r)}a(Xvo,"FromTemplateLiteral");function AJr(t,e){return typeof t=="string"?e==="Uncapitalize"?Yvo(t):e==="Capitalize"?Kvo(t):e==="Uppercase"?Jvo(t):e==="Lowercase"?Zvo(t):t:t.toString()}a(AJr,"FromLiteralValue");function yJr(t,e){return t.map(r=>yP(r,e))}a(yJr,"FromRest");function yP(t,e,r={}){return u1(t)?gJr(t,e,r):d1(t)?Xvo(t,e,r):Pa(t)?dc(yJr(t.anyOf,e),r):l1(t)?ma(AJr(t.const,e),r):wt(t,r)}a(yP,"Intrinsic");function _Jr(t,e={}){return yP(t,"Capitalize",e)}a(_Jr,"Capitalize");p();function EJr(t,e={}){return yP(t,"Lowercase",e)}a(EJr,"Lowercase");p();function vJr(t,e={}){return yP(t,"Uncapitalize",e)}a(vJr,"Uncapitalize");p();function CJr(t,e={}){return yP(t,"Uppercase",e)}a(CJr,"Uppercase");p();p();p();p();p();function eCo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=o7(t[o],e,zu(r));return n}a(eCo,"FromProperties");function tCo(t,e,r){return eCo(t.properties,e,r)}a(tCo,"FromMappedResult");function bJr(t,e,r){let n=tCo(t,e,r);return Ya(n)}a(bJr,"OmitFromMappedResult");function rCo(t,e){return t.map(r=>PNt(r,e))}a(rCo,"FromIntersect");function nCo(t,e){return t.map(r=>PNt(r,e))}a(nCo,"FromUnion");function iCo(t,e){let{[e]:r,...n}=t;return n}a(iCo,"FromProperty");function oCo(t,e){return e.reduce((r,n)=>iCo(r,n),t)}a(oCo,"FromProperties");function sCo(t,e,r){let n=Ef(t,[qd,"$id","required","properties"]),o=oCo(r,e);return fc(o,n)}a(sCo,"FromObject");function aCo(t){let e=t.reduce((r,n)=>F7e(n)?[...r,ma(n)]:r,[]);return dc(e)}a(aCo,"UnionFromPropertyKeys");function PNt(t,e){return _f(t)?e_(rCo(t.allOf,e)):Pa(t)?dc(nCo(t.anyOf,e)):Wp(t)?sCo(t,e,t.properties):fc({})}a(PNt,"OmitResolve");function o7(t,e,r){let n=$p(e)?aCo(e):e,o=jd(e)?SC(e):e,s=Zf(t),c=Zf(e);return Ku(t)?bJr(t,o,r):u1(e)?SJr(t,e,r):s&&c?_u("Omit",[t,n],r):!s&&c?_u("Omit",[t,n],r):s&&!c?_u("Omit",[t,n],r):wt({...PNt(t,o),...r})}a(o7,"Omit");function cCo(t,e,r){return{[e]:o7(t,[e],zu(r))}}a(cCo,"FromPropertyKey");function lCo(t,e,r){return e.reduce((n,o)=>({...n,...cCo(t,o,r)}),{})}a(lCo,"FromPropertyKeys");function uCo(t,e,r){return lCo(t,e.keys,r)}a(uCo,"FromMappedKey");function SJr(t,e,r){let n=uCo(t,e,r);return Ya(n)}a(SJr,"OmitFromMappedKey");p();p();p();function dCo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=s7(t[o],e,zu(r));return n}a(dCo,"FromProperties");function fCo(t,e,r){return dCo(t.properties,e,r)}a(fCo,"FromMappedResult");function TJr(t,e,r){let n=fCo(t,e,r);return Ya(n)}a(TJr,"PickFromMappedResult");function pCo(t,e){return t.map(r=>DNt(r,e))}a(pCo,"FromIntersect");function hCo(t,e){return t.map(r=>DNt(r,e))}a(hCo,"FromUnion");function mCo(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(mCo,"FromProperties");function gCo(t,e,r){let n=Ef(t,[qd,"$id","required","properties"]),o=mCo(r,e);return fc(o,n)}a(gCo,"FromObject");function ACo(t){let e=t.reduce((r,n)=>F7e(n)?[...r,ma(n)]:r,[]);return dc(e)}a(ACo,"UnionFromPropertyKeys");function DNt(t,e){return _f(t)?e_(pCo(t.allOf,e)):Pa(t)?dc(hCo(t.anyOf,e)):Wp(t)?gCo(t,e,t.properties):fc({})}a(DNt,"PickResolve");function s7(t,e,r){let n=$p(e)?ACo(e):e,o=jd(e)?SC(e):e,s=Zf(t),c=Zf(e);return Ku(t)?TJr(t,o,r):u1(e)?IJr(t,e,r):s&&c?_u("Pick",[t,n],r):!s&&c?_u("Pick",[t,n],r):s&&!c?_u("Pick",[t,n],r):wt({...DNt(t,o),...r})}a(s7,"Pick");function yCo(t,e,r){return{[e]:s7(t,[e],zu(r))}}a(yCo,"FromPropertyKey");function _Co(t,e,r){return e.reduce((n,o)=>({...n,...yCo(t,o,r)}),{})}a(_Co,"FromPropertyKeys");function ECo(t,e,r){return _Co(t,e.keys,r)}a(ECo,"FromMappedKey");function IJr(t,e,r){let n=ECo(t,e,r);return Ya(n)}a(IJr,"PickFromMappedKey");p();p();function vCo(t,e){return _u("Partial",[_u(t,e)])}a(vCo,"FromComputed");function CCo(t){return _u("Partial",[Ex(t)])}a(CCo,"FromRef");function bCo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=Xy(t[r]);return e}a(bCo,"FromProperties");function SCo(t,e){let r=Ef(t,[qd,"$id","required","properties"]),n=bCo(e);return fc(n,r)}a(SCo,"FromObject");function xJr(t){return t.map(e=>wJr(e))}a(xJr,"FromRest");function wJr(t){return uP(t)?vCo(t.target,t.parameters):Zf(t)?CCo(t.$ref):_f(t)?e_(xJr(t.allOf)):Pa(t)?dc(xJr(t.anyOf)):Wp(t)?SCo(t,t.properties):Iz(t)||VB(t)||pP(t)||l1(t)||fSe(t)||hP(t)||WB(t)||pSe(t)||zB(t)?t:fc({})}a(wJr,"PartialResolve");function qse(t,e){return Ku(t)?RJr(t,e):wt({...wJr(t),...e})}a(qse,"Partial");function TCo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=qse(t[n],zu(e));return r}a(TCo,"FromProperties");function ICo(t,e){return TCo(t.properties,e)}a(ICo,"FromMappedResult");function RJr(t,e){let r=ICo(t,e);return Ya(r)}a(RJr,"PartialFromMappedResult");p();p();function xCo(t,e){return _u("Required",[_u(t,e)])}a(xCo,"FromComputed");function wCo(t){return _u("Required",[Ex(t)])}a(wCo,"FromRef");function RCo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=Ef(t[r],[IA]);return e}a(RCo,"FromProperties");function kCo(t,e){let r=Ef(t,[qd,"$id","required","properties"]),n=RCo(e);return fc(n,r)}a(kCo,"FromObject");function kJr(t){return t.map(e=>PJr(e))}a(kJr,"FromRest");function PJr(t){return uP(t)?xCo(t.target,t.parameters):Zf(t)?wCo(t.$ref):_f(t)?e_(kJr(t.allOf)):Pa(t)?dc(kJr(t.anyOf)):Wp(t)?kCo(t,t.properties):Iz(t)||VB(t)||pP(t)||l1(t)||fSe(t)||hP(t)||WB(t)||pSe(t)||zB(t)?t:fc({})}a(PJr,"RequiredResolve");function jse(t,e){return Ku(t)?DJr(t,e):wt({...PJr(t),...e})}a(jse,"Required");function PCo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=jse(t[n],e);return r}a(PCo,"FromProperties");function DCo(t,e){return PCo(t.properties,e)}a(DCo,"FromMappedResult");function DJr(t,e){let r=DCo(t,e);return Ya(r)}a(DJr,"RequiredFromMappedResult");function NCo(t,e){return e.map(r=>Zf(r)?NNt(t,r.$ref):p1(t,r))}a(NCo,"DereferenceParameters");function NNt(t,e){return e in t?Zf(t[e])?NNt(t,t[e].$ref):p1(t,t[e]):is()}a(NNt,"Dereference");function MCo(t){return Ose(t[0])}a(MCo,"FromAwaited");function OCo(t){return n7(t[0],t[1])}a(OCo,"FromIndex");function LCo(t){return Lse(t[0])}a(LCo,"FromKeyOf");function BCo(t){return qse(t[0])}a(BCo,"FromPartial");function FCo(t){return o7(t[0],t[1])}a(FCo,"FromOmit");function UCo(t){return s7(t[0],t[1])}a(UCo,"FromPick");function QCo(t){return jse(t[0])}a(QCo,"FromRequired");function qCo(t,e,r){let n=NCo(t,r);return e==="Awaited"?MCo(n):e==="Index"?OCo(n):e==="KeyOf"?LCo(n):e==="Partial"?BCo(n):e==="Omit"?FCo(n):e==="Pick"?UCo(n):e==="Required"?QCo(n):is()}a(qCo,"FromComputed");function jCo(t,e){return xse(p1(t,e))}a(jCo,"FromArray");function HCo(t,e){return wse(p1(t,e))}a(HCo,"FromAsyncIterator");function GCo(t,e,r){return Rse(SSe(t,e),p1(t,r))}a(GCo,"FromConstructor");function $Co(t,e,r){return NM(SSe(t,e),p1(t,r))}a($Co,"FromFunction");function VCo(t,e){return e_(SSe(t,e))}a(VCo,"FromIntersect");function WCo(t,e){return Mse(p1(t,e))}a(WCo,"FromIterator");function zCo(t,e){return fc(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:p1(t,e[n])}),{}))}a(zCo,"FromObject");function YCo(t,e){let[r,n]=[p1(t,iQe(e)),nQe(e)],o=Cse(e);return o.patternProperties[n]=r,o}a(YCo,"FromRecord");function KCo(t,e){return Zf(e)?{...NNt(t,e.$ref),[qd]:e[qd]}:e}a(KCo,"FromTransform");function JCo(t,e){return yx(SSe(t,e))}a(JCo,"FromTuple");function ZCo(t,e){return dc(SSe(t,e))}a(ZCo,"FromUnion");function SSe(t,e){return e.map(r=>p1(t,r))}a(SSe,"FromTypes");function p1(t,e){return bC(e)?wt(p1(t,Ef(e,[IA])),e):Sse(e)?wt(p1(t,Ef(e,[cP])),e):uc(e)?wt(KCo(t,e),e):lP(e)?wt(jCo(t,e.items),e):Tz(e)?wt(HCo(t,e.items),e):uP(e)?wt(qCo(t,e.target,e.parameters)):dP(e)?wt(GCo(t,e.parameters,e.returns),e):fP(e)?wt($Co(t,e.parameters,e.returns),e):_f(e)?wt(VCo(t,e.allOf),e):xz(e)?wt(WCo(t,e.items),e):Wp(e)?wt(zCo(t,e.properties),e):Rz(e)?wt(YCo(t,e)):f1(e)?wt(JCo(t,e.items||[]),e):Pa(e)?wt(ZCo(t,e.anyOf),e):e}a(p1,"FromType");function XCo(t,e){return e in t?p1(t,t[e]):is()}a(XCo,"ComputeType");function NJr(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:XCo(t,r)}),{})}a(NJr,"ComputeModuleProperties");var MNt=class{static{a(this,"TModule")}constructor(e){let r=NJr(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:wt(this.$defs[e],r)};return wt({[St]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};function MJr(t){return new MNt(t)}a(MJr,"Module");p();function OJr(t,e){return wt({[St]:"Not",not:t},e)}a(OJr,"Not");p();function LJr(t,e){return fP(t)?yx(t.parameters,e):is()}a(LJr,"Parameters");p();var ebo=0;function BJr(t,e={}){Vp(e.$id)&&(e.$id=`T${ebo++}`);let r=Cse(t({[St]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,wt({[gx]:"Recursive",...r},e)}a(BJr,"Recursive");p();function FJr(t,e){let r=Zl(t)?new globalThis.RegExp(t):t;return wt({[St]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(FJr,"RegExp");p();function tbo(t){return _f(t)?t.allOf:Pa(t)?t.anyOf:f1(t)?t.items??[]:[]}a(tbo,"RestResolve");function UJr(t){return tbo(t)}a(UJr,"Rest");p();function QJr(t,e){return fP(t)?wt(t.returns,e):is(e)}a(QJr,"ReturnType");p();var ONt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new LNt(this.schema,e)}},LNt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[qd].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[qd].Decode(c)),"Decode")};return{...r,[qd]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[qd]:n}}Encode(e){return uc(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function qJr(t){return new ONt(t)}a(qJr,"Transform");p();function jJr(t={}){return wt({[St]:t[St]??"Unsafe"},t)}a(jJr,"Unsafe");p();function HJr(t){return wt({[St]:"Void",type:"void"},t)}a(HJr,"Void");p();var BNt={};Ti(BNt,{Any:()=>r7,Argument:()=>IKr,Array:()=>xse,AsyncIterator:()=>wse,Awaited:()=>Ose,BigInt:()=>Nse,Boolean:()=>j7e,Capitalize:()=>_Jr,Composite:()=>$Kr,Const:()=>VKr,Constructor:()=>Rse,ConstructorParameters:()=>WKr,Date:()=>W7e,Enum:()=>zKr,Exclude:()=>Use,Extends:()=>Fse,Extract:()=>Qse,Function:()=>NM,Index:()=>n7,InstanceType:()=>fJr,Instantiate:()=>hJr,Integer:()=>mJr,Intersect:()=>e_,Iterator:()=>Mse,KeyOf:()=>Lse,Literal:()=>ma,Lowercase:()=>EJr,Mapped:()=>UKr,Module:()=>MJr,Never:()=>is,Not:()=>OJr,Null:()=>z7e,Number:()=>Ax,Object:()=>fc,Omit:()=>o7,Optional:()=>Xy,Parameters:()=>LJr,Partial:()=>qse,Pick:()=>s7,Promise:()=>$7e,Readonly:()=>TC,ReadonlyOptional:()=>tQe,Record:()=>rQe,Recursive:()=>BJr,Ref:()=>Ex,RegExp:()=>FJr,Required:()=>jse,Rest:()=>UJr,ReturnType:()=>QJr,String:()=>UE,Symbol:()=>Y7e,TemplateLiteral:()=>H7e,Transform:()=>qJr,Tuple:()=>yx,Uint8Array:()=>J7e,Uncapitalize:()=>vJr,Undefined:()=>K7e,Union:()=>dc,Unknown:()=>gP,Unsafe:()=>jJr,Uppercase:()=>CJr,Void:()=>HJr});p();var b=BNt;p();p();function GJr(...t){return new globalThis.Function(...t)}a(GJr,"Evaluate");p();function rbo(t){switch(t.errorType){case bt.ArrayContains:return"Expected array to contain at least one matching value";case bt.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case bt.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case bt.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case bt.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case bt.ArrayUniqueItems:return"Expected array elements to be unique";case bt.Array:return"Expected array";case bt.AsyncIterator:return"Expected AsyncIterator";case bt.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case bt.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case bt.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case bt.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case bt.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case bt.BigInt:return"Expected bigint";case bt.Boolean:return"Expected boolean";case bt.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case bt.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case bt.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case bt.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case bt.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case bt.Date:return"Expected Date";case bt.Function:return"Expected function";case bt.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case bt.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case bt.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case bt.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case bt.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case bt.Integer:return"Expected integer";case bt.IntersectUnevaluatedProperties:return"Unexpected property";case bt.Intersect:return"Expected all values to match";case bt.Iterator:return"Expected Iterator";case bt.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case bt.Never:return"Never";case bt.Not:return"Value should not match";case bt.Null:return"Expected null";case bt.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case bt.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case bt.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case bt.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case bt.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case bt.Number:return"Expected number";case bt.Object:return"Expected object";case bt.ObjectAdditionalProperties:return"Unexpected property";case bt.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case bt.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case bt.ObjectRequiredProperty:return"Expected required property";case bt.Promise:return"Expected Promise";case bt.RegExp:return"Expected string to match regular expression";case bt.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case bt.StringFormat:return`Expected string to match '${t.schema.format}' format`;case bt.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case bt.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case bt.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case bt.String:return"Expected string";case bt.Symbol:return"Expected symbol";case bt.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case bt.Tuple:return"Expected tuple";case bt.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case bt.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case bt.Uint8Array:return"Expected Uint8Array";case bt.Undefined:return"Expected undefined";case bt.Union:return"Expected union value";case bt.Void:return"Expected void";case bt.Kind:return`Expected kind '${t.schema[St]}'`;default:return"Unknown error type"}}a(rbo,"DefaultErrorFunction");var nbo=rbo;function $Jr(){return nbo}a($Jr,"GetErrorFunction");p();var FNt=class extends Gi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function ibo(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new FNt(t);return Da(r,e)}a(ibo,"Resolve");function o0(t,e){return!pa(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(o0,"Pushref");function Da(t,e){return t[St]==="This"||t[St]==="Ref"?ibo(t,e):t}a(Da,"Deref");p();var UNt=class extends Gi{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}},h1;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(h1||(h1={}));var Hse=BigInt("14695981039346656037"),[obo,sbo]=[BigInt("1099511628211"),BigInt("18446744073709551616")],abo=Array.from({length:256}).map((t,e)=>BigInt(e)),VJr=new Float64Array(1),WJr=new DataView(VJr.buffer),zJr=new Uint8Array(VJr.buffer);function*cbo(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let r=0;r>8*(e-1-r)&255}a(cbo,"NumberToBytes");function lbo(t){r_(h1.Array);for(let e of t)Gse(e)}a(lbo,"ArrayType");function ubo(t){r_(h1.Boolean),r_(t?1:0)}a(ubo,"BooleanType");function dbo(t){r_(h1.BigInt),WJr.setBigInt64(0,t);for(let e of zJr)r_(e)}a(dbo,"BigIntType");function fbo(t){r_(h1.Date),Gse(t.getTime())}a(fbo,"DateType");function pbo(t){r_(h1.Null)}a(pbo,"NullType");function hbo(t){r_(h1.Number),WJr.setFloat64(0,t);for(let e of zJr)r_(e)}a(hbo,"NumberType");function mbo(t){r_(h1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())Gse(e),Gse(t[e])}a(mbo,"ObjectType");function gbo(t){r_(h1.String);for(let e=0;e=t.minItems)||ea(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!s0(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=a7(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(ea(t.contains)||ui(t.minContains)||ui(t.maxContains)))return!0;let n=ea(t.contains)?t.contains:is(),o=r.reduce((s,c)=>s0(n,e,c)?s+1:s,0);return!(o===0||ui(t.minContains)&&ot.maxContains)}a(bbo,"FromArray");function Sbo(t,e,r){return M7e(r)}a(Sbo,"FromAsyncIterator");function Tbo(t,e,r){return!(!TA(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(Tbo,"FromBigInt");function Ibo(t,e,r){return DM(r)}a(Ibo,"FromBoolean");function xbo(t,e,r){return s0(t.returns,e,r.prototype)}a(xbo,"FromConstructor");function wbo(t,e,r){return!(!BE(r)||ea(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||ea(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||ea(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||ea(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(wbo,"FromDate");function Rbo(t,e,r){return J9(r)}a(Rbo,"FromFunction");function kbo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return s0(o,[...e,...n],r)}a(kbo,"FromImport");function Pbo(t,e,r){return!(!B7e(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.multipleOf)&&r%t.multipleOf!==0)}a(Pbo,"FromInteger");function Dbo(t,e,r){let n=t.allOf.every(o=>s0(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(JB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(jd(t.unevaluatedProperties)){let o=new RegExp(JB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||s0(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(Dbo,"FromIntersect");function Nbo(t,e,r){return O7e(r)}a(Nbo,"FromIterator");function Mbo(t,e,r){return r===t.const}a(Mbo,"FromLiteral");function Obo(t,e,r){return!1}a(Obo,"FromNever");function Lbo(t,e,r){return!s0(t.not,e,r)}a(Lbo,"FromNot");function Bbo(t,e,r){return GB(r)}a(Bbo,"FromNull");function Fbo(t,e,r){return!(!yu.IsNumberLike(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.multipleOf)&&r%t.multipleOf!==0)}a(Fbo,"FromNumber");function Ubo(t,e,r){if(!yu.IsObjectLike(r)||ea(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ea(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!s0(s,e,r[o])||(ZB(s)||Ebo(s))&&!(o in r))return!1}else if(yu.IsExactOptionalProperty(r,o)&&!s0(s,e,r[o]))return!1}if(t.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return t.required&&t.required.length===n.length&&o.length===n.length?!0:o.every(s=>n.includes(s))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||s0(t.additionalProperties,e,r[s])):!0}a(Ubo,"FromObject");function Qbo(t,e,r){return L7e(r)}a(Qbo,"FromPromise");function qbo(t,e,r){if(!yu.IsRecordLike(r)||ea(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ea(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?s0(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:s0(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(qbo,"FromRecord");function jbo(t,e,r){return s0(Da(t,e),e,r)}a(jbo,"FromRef");function Hbo(t,e,r){let n=new RegExp(t.source,t.flags);return ea(t.minLength)&&!(r.length>=t.minLength)||ea(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(Hbo,"FromRegExp");function Gbo(t,e,r){return!pa(r)||ea(t.minLength)&&!(r.length>=t.minLength)||ea(t.maxLength)&&!(r.length<=t.maxLength)||ea(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:ea(t.format)?mP.Has(t.format)?mP.Get(t.format)(r):!1:!0}a(Gbo,"FromString");function $bo(t,e,r){return $B(r)}a($bo,"FromSymbol");function Vbo(t,e,r){return pa(r)&&new RegExp(t.pattern).test(r)}a(Vbo,"FromTemplateLiteral");function Wbo(t,e,r){return s0(Da(t,e),e,r)}a(Wbo,"FromThis");function zbo(t,e,r){if(!Mi(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;ns0(n,e,r))}a(Kbo,"FromUnion");function Jbo(t,e,r){return!(!bse(r)||ea(t.maxByteLength)&&!(r.length<=t.maxByteLength)||ea(t.minByteLength)&&!(r.length>=t.minByteLength))}a(Jbo,"FromUint8Array");function Zbo(t,e,r){return!0}a(Zbo,"FromUnknown");function Xbo(t,e,r){return yu.IsVoidLike(r)}a(Xbo,"FromVoid");function eSo(t,e,r){return FE.Has(t[St])?FE.Get(t[St])(t,r):!1}a(eSo,"FromKind");function s0(t,e,r){let n=ea(t.$id)?o0(t,e):e,o=t;switch(o[St]){case"Any":return vbo(o,n,r);case"Argument":return Cbo(o,n,r);case"Array":return bbo(o,n,r);case"AsyncIterator":return Sbo(o,n,r);case"BigInt":return Tbo(o,n,r);case"Boolean":return Ibo(o,n,r);case"Constructor":return xbo(o,n,r);case"Date":return wbo(o,n,r);case"Function":return Rbo(o,n,r);case"Import":return kbo(o,n,r);case"Integer":return Pbo(o,n,r);case"Intersect":return Dbo(o,n,r);case"Iterator":return Nbo(o,n,r);case"Literal":return Mbo(o,n,r);case"Never":return Obo(o,n,r);case"Not":return Lbo(o,n,r);case"Null":return Bbo(o,n,r);case"Number":return Fbo(o,n,r);case"Object":return Ubo(o,n,r);case"Promise":return Qbo(o,n,r);case"Record":return qbo(o,n,r);case"Ref":return jbo(o,n,r);case"RegExp":return Hbo(o,n,r);case"String":return Gbo(o,n,r);case"Symbol":return $bo(o,n,r);case"TemplateLiteral":return Vbo(o,n,r);case"This":return Wbo(o,n,r);case"Tuple":return zbo(o,n,r);case"Undefined":return Ybo(o,n,r);case"Union":return Kbo(o,n,r);case"Uint8Array":return Jbo(o,n,r);case"Unknown":return Zbo(o,n,r);case"Void":return Xbo(o,n,r);default:if(!FE.Has(o[St]))throw new QNt(o);return eSo(o,n,r)}}a(s0,"Visit");function os(...t){return t.length===3?s0(t[0],t[1],t[2]):s0(t[0],[],t[1])}a(os,"Check");var bt;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(bt||(bt={}));var qNt=class extends Gi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function XB(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(XB,"EscapeKey");function ta(t){return t!==void 0}a(ta,"IsDefined");var c7=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};function ln(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:$Jr()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(ln,"Create");function*tSo(t,e,r,n){}a(tSo,"FromAny");function*rSo(t,e,r,n){}a(rSo,"FromArgument");function*nSo(t,e,r,n){if(!Mi(n))return yield ln(bt.Array,t,r,n);ta(t.minItems)&&!(n.length>=t.minItems)&&(yield ln(bt.ArrayMinItems,t,r,n)),ta(t.maxItems)&&!(n.length<=t.maxItems)&&(yield ln(bt.ArrayMaxItems,t,r,n));for(let c=0;ca0(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield ln(bt.ArrayContains,t,r,n)),ui(t.minContains)&&st.maxContains&&(yield ln(bt.ArrayMaxContains,t,r,n))}a(nSo,"FromArray");function*iSo(t,e,r,n){M7e(n)||(yield ln(bt.AsyncIterator,t,r,n))}a(iSo,"FromAsyncIterator");function*oSo(t,e,r,n){if(!TA(n))return yield ln(bt.BigInt,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield ln(bt.BigIntExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield ln(bt.BigIntMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield ln(bt.BigIntMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield ln(bt.BigIntMultipleOf,t,r,n))}a(oSo,"FromBigInt");function*sSo(t,e,r,n){DM(n)||(yield ln(bt.Boolean,t,r,n))}a(sSo,"FromBoolean");function*aSo(t,e,r,n){yield*a0(t.returns,e,r,n.prototype)}a(aSo,"FromConstructor");function*cSo(t,e,r,n){if(!BE(n))return yield ln(bt.Date,t,r,n);ta(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield ln(bt.DateExclusiveMinimumTimestamp,t,r,n)),ta(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield ln(bt.DateMaximumTimestamp,t,r,n)),ta(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield ln(bt.DateMinimumTimestamp,t,r,n)),ta(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield ln(bt.DateMultipleOfTimestamp,t,r,n))}a(cSo,"FromDate");function*lSo(t,e,r,n){J9(n)||(yield ln(bt.Function,t,r,n))}a(lSo,"FromFunction");function*uSo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*a0(s,[...e,...o],r,n)}a(uSo,"FromImport");function*dSo(t,e,r,n){if(!B7e(n))return yield ln(bt.Integer,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield ln(bt.IntegerExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield ln(bt.IntegerMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield ln(bt.IntegerMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==0&&(yield ln(bt.IntegerMultipleOf,t,r,n))}a(dSo,"FromInteger");function*fSo(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of a0(s,e,r,n))o=!0,yield c;if(o)return yield ln(bt.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(JB(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield ln(bt.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(JB(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=a0(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(fSo,"FromIntersect");function*pSo(t,e,r,n){O7e(n)||(yield ln(bt.Iterator,t,r,n))}a(pSo,"FromIterator");function*hSo(t,e,r,n){n!==t.const&&(yield ln(bt.Literal,t,r,n))}a(hSo,"FromLiteral");function*mSo(t,e,r,n){yield ln(bt.Never,t,r,n)}a(mSo,"FromNever");function*gSo(t,e,r,n){a0(t.not,e,r,n).next().done===!0&&(yield ln(bt.Not,t,r,n))}a(gSo,"FromNot");function*ASo(t,e,r,n){GB(n)||(yield ln(bt.Null,t,r,n))}a(ASo,"FromNull");function*ySo(t,e,r,n){if(!yu.IsNumberLike(n))return yield ln(bt.Number,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield ln(bt.NumberExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield ln(bt.NumberMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield ln(bt.NumberMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==0&&(yield ln(bt.NumberMultipleOf,t,r,n))}a(ySo,"FromNumber");function*_So(t,e,r,n){if(!yu.IsObjectLike(n))return yield ln(bt.Object,t,r,n);ta(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield ln(bt.ObjectMinProperties,t,r,n)),ta(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield ln(bt.ObjectMaxProperties,t,r,n));let o=Array.isArray(t.required)?t.required:[],s=Object.getOwnPropertyNames(t.properties),c=Object.getOwnPropertyNames(n);for(let l of o)c.includes(l)||(yield ln(bt.ObjectRequiredProperty,t.properties[l],`${r}/${XB(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield ln(bt.ObjectAdditionalProperties,t,`${r}/${XB(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*a0(t.additionalProperties,e,`${r}/${XB(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*a0(u,e,`${r}/${XB(l)}`,n[l]),ZB(t)&&!(l in n)&&(yield ln(bt.ObjectRequiredProperty,u,`${r}/${XB(l)}`,void 0))):yu.IsExactOptionalProperty(n,l)&&(yield*a0(u,e,`${r}/${XB(l)}`,n[l]))}}a(_So,"FromObject");function*ESo(t,e,r,n){L7e(n)||(yield ln(bt.Promise,t,r,n))}a(ESo,"FromPromise");function*vSo(t,e,r,n){if(!yu.IsRecordLike(n))return yield ln(bt.Object,t,r,n);ta(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield ln(bt.ObjectMinProperties,t,r,n)),ta(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield ln(bt.ObjectMaxProperties,t,r,n));let[o,s]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let[l,u]of Object.entries(n))c.test(l)&&(yield*a0(s,e,`${r}/${XB(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*a0(t.additionalProperties,e,`${r}/${XB(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield ln(bt.ObjectAdditionalProperties,t,`${r}/${XB(l)}`,u)}}a(vSo,"FromRecord");function*CSo(t,e,r,n){yield*a0(Da(t,e),e,r,n)}a(CSo,"FromRef");function*bSo(t,e,r,n){if(!pa(n))return yield ln(bt.String,t,r,n);if(ta(t.minLength)&&!(n.length>=t.minLength)&&(yield ln(bt.StringMinLength,t,r,n)),ta(t.maxLength)&&!(n.length<=t.maxLength)&&(yield ln(bt.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield ln(bt.RegExp,t,r,n)}a(bSo,"FromRegExp");function*SSo(t,e,r,n){if(!pa(n))return yield ln(bt.String,t,r,n);ta(t.minLength)&&!(n.length>=t.minLength)&&(yield ln(bt.StringMinLength,t,r,n)),ta(t.maxLength)&&!(n.length<=t.maxLength)&&(yield ln(bt.StringMaxLength,t,r,n)),pa(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield ln(bt.StringPattern,t,r,n))),pa(t.format)&&(mP.Has(t.format)?mP.Get(t.format)(n)||(yield ln(bt.StringFormat,t,r,n)):yield ln(bt.StringFormatUnknown,t,r,n))}a(SSo,"FromString");function*TSo(t,e,r,n){$B(n)||(yield ln(bt.Symbol,t,r,n))}a(TSo,"FromSymbol");function*ISo(t,e,r,n){if(!pa(n))return yield ln(bt.String,t,r,n);new RegExp(t.pattern).test(n)||(yield ln(bt.StringPattern,t,r,n))}a(ISo,"FromTemplateLiteral");function*xSo(t,e,r,n){yield*a0(Da(t,e),e,r,n)}a(xSo,"FromThis");function*wSo(t,e,r,n){if(!Mi(n))return yield ln(bt.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield ln(bt.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield ln(bt.TupleLength,t,r,n);if(t.items)for(let o=0;onew c7(a0(s,e,r,n)));yield ln(bt.Union,t,r,n,o)}a(kSo,"FromUnion");function*PSo(t,e,r,n){if(!bse(n))return yield ln(bt.Uint8Array,t,r,n);ta(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield ln(bt.Uint8ArrayMaxByteLength,t,r,n)),ta(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield ln(bt.Uint8ArrayMinByteLength,t,r,n))}a(PSo,"FromUint8Array");function*DSo(t,e,r,n){}a(DSo,"FromUnknown");function*NSo(t,e,r,n){yu.IsVoidLike(n)||(yield ln(bt.Void,t,r,n))}a(NSo,"FromVoid");function*MSo(t,e,r,n){FE.Get(t[St])(t,n)||(yield ln(bt.Kind,t,r,n))}a(MSo,"FromKind");function*a0(t,e,r,n){let o=ta(t.$id)?[...e,t]:e,s=t;switch(s[St]){case"Any":return yield*tSo(s,o,r,n);case"Argument":return yield*rSo(s,o,r,n);case"Array":return yield*nSo(s,o,r,n);case"AsyncIterator":return yield*iSo(s,o,r,n);case"BigInt":return yield*oSo(s,o,r,n);case"Boolean":return yield*sSo(s,o,r,n);case"Constructor":return yield*aSo(s,o,r,n);case"Date":return yield*cSo(s,o,r,n);case"Function":return yield*lSo(s,o,r,n);case"Import":return yield*uSo(s,o,r,n);case"Integer":return yield*dSo(s,o,r,n);case"Intersect":return yield*fSo(s,o,r,n);case"Iterator":return yield*pSo(s,o,r,n);case"Literal":return yield*hSo(s,o,r,n);case"Never":return yield*mSo(s,o,r,n);case"Not":return yield*gSo(s,o,r,n);case"Null":return yield*ASo(s,o,r,n);case"Number":return yield*ySo(s,o,r,n);case"Object":return yield*_So(s,o,r,n);case"Promise":return yield*ESo(s,o,r,n);case"Record":return yield*vSo(s,o,r,n);case"Ref":return yield*CSo(s,o,r,n);case"RegExp":return yield*bSo(s,o,r,n);case"String":return yield*SSo(s,o,r,n);case"Symbol":return yield*TSo(s,o,r,n);case"TemplateLiteral":return yield*ISo(s,o,r,n);case"This":return yield*xSo(s,o,r,n);case"Tuple":return yield*wSo(s,o,r,n);case"Undefined":return yield*RSo(s,o,r,n);case"Union":return yield*kSo(s,o,r,n);case"Uint8Array":return yield*PSo(s,o,r,n);case"Unknown":return yield*DSo(s,o,r,n);case"Void":return yield*NSo(s,o,r,n);default:if(!FE.Has(s[St]))throw new qNt(t);return yield*MSo(s,o,r,n)}}a(a0,"Visit");function OM(...t){let e=t.length===3?a0(t[0],t[1],"",t[2]):a0(t[0],[],"",t[1]);return new c7(e)}a(OM,"Errors");p();p();var $se=class extends Gi{static{a(this,"TransformDecodeCheckError")}constructor(e,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=r,this.error=n}},jNt=class extends Gi{static{a(this,"TransformDecodeError")}constructor(e,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=e,this.path=r,this.value=n,this.error=o}};function Hd(t,e,r){try{return uc(t)?t[qd].Decode(r):r}catch(n){throw new jNt(t,e,r,n)}}a(Hd,"Default");function OSo(t,e,r,n){return Mi(n)?Hd(t,r,n.map((o,s)=>_P(t.items,e,`${r}/${s}`,o))):Hd(t,r,n)}a(OSo,"FromArray");function LSo(t,e,r,n){if(!To(n)||c1(n))return Hd(t,r,n);let o=V7e(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=_P(h,e,`${r}/${f}`,c[f]));if(!uc(t.unevaluatedProperties))return Hd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Hd(u,`${r}/${f}`,d[f]));return Hd(t,r,d)}a(LSo,"FromIntersect");function BSo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=_P(s,[...e,...o],r,n);return Hd(t,r,c)}a(BSo,"FromImport");function FSo(t,e,r,n){return Hd(t,r,_P(t.not,e,r,n))}a(FSo,"FromNot");function USo(t,e,r,n){if(!To(n))return Hd(t,r,n);let o=IC(t),s={...n};for(let d of o)Hi(s,d)&&(Yu(s[d])&&(!zB(t.properties[d])||yu.IsExactOptionalProperty(s,d))||(s[d]=_P(t.properties[d],e,`${r}/${d}`,s[d])));if(!jd(t.additionalProperties))return Hd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=Hd(l,`${r}/${d}`,u[d]));return Hd(t,r,u)}a(USo,"FromObject");function QSo(t,e,r,n){if(!To(n))return Hd(t,r,n);let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=new RegExp(o),c={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(c[f]=_P(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!jd(t.additionalProperties))return Hd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=Hd(u,`${r}/${f}`,d[f]));return Hd(t,r,d)}a(QSo,"FromRecord");function qSo(t,e,r,n){let o=Da(t,e);return Hd(t,r,_P(o,e,r,n))}a(qSo,"FromRef");function jSo(t,e,r,n){let o=Da(t,e);return Hd(t,r,_P(o,e,r,n))}a(jSo,"FromThis");function HSo(t,e,r,n){return Mi(n)&&Mi(t.items)?Hd(t,r,t.items.map((o,s)=>_P(o,e,`${r}/${s}`,n[s]))):Hd(t,r,n)}a(HSo,"FromTuple");function GSo(t,e,r,n){for(let o of t.anyOf){if(!os(o,e,n))continue;let s=_P(o,e,r,n);return Hd(t,r,s)}return Hd(t,r,n)}a(GSo,"FromUnion");function _P(t,e,r,n){let o=o0(t,e),s=t;switch(t[St]){case"Array":return OSo(s,o,r,n);case"Import":return BSo(s,o,r,n);case"Intersect":return LSo(s,o,r,n);case"Not":return FSo(s,o,r,n);case"Object":return USo(s,o,r,n);case"Record":return QSo(s,o,r,n);case"Ref":return qSo(s,o,r,n);case"Symbol":return Hd(s,r,n);case"This":return jSo(s,o,r,n);case"Tuple":return HSo(s,o,r,n);case"Union":return GSo(s,o,r,n);default:return Hd(s,r,n)}}a(_P,"Visit");function Vse(t,e,r){return _P(t,e,"",r)}a(Vse,"TransformDecode");p();var Wse=class extends Gi{static{a(this,"TransformEncodeCheckError")}constructor(e,r,n){super("The encoded value does not match the expected schema"),this.schema=e,this.value=r,this.error=n}},HNt=class extends Gi{static{a(this,"TransformEncodeError")}constructor(e,r,n,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=e,this.path=r,this.value=n,this.error=o}};function xA(t,e,r){try{return uc(t)?t[qd].Encode(r):r}catch(n){throw new HNt(t,e,r,n)}}a(xA,"Default");function $So(t,e,r,n){let o=xA(t,r,n);return Mi(o)?o.map((s,c)=>EP(t.items,e,`${r}/${c}`,s)):o}a($So,"FromArray");function VSo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=xA(t,r,n);return EP(s,[...e,...o],r,c)}a(VSo,"FromImport");function WSo(t,e,r,n){let o=xA(t,r,n);if(!To(n)||c1(n))return o;let s=V7e(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=EP(m,e,`${r}/${h}`,l[h]));if(!uc(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=xA(d,`${r}/${h}`,f[h]));return f}a(WSo,"FromIntersect");function zSo(t,e,r,n){return xA(t.not,r,xA(t,r,n))}a(zSo,"FromNot");function YSo(t,e,r,n){let o=xA(t,r,n);if(!To(o))return o;let s=IC(t),c={...o};for(let f of s)Hi(c,f)&&(Yu(c[f])&&(!zB(t.properties[f])||yu.IsExactOptionalProperty(c,f))||(c[f]=EP(t.properties[f],e,`${r}/${f}`,c[f])));if(!jd(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=xA(u,`${r}/${f}`,d[f]));return d}a(YSo,"FromObject");function KSo(t,e,r,n){let o=xA(t,r,n);if(!To(n))return o;let s=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(s),l={...o};for(let h of Object.getOwnPropertyNames(n))c.test(h)&&(l[h]=EP(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!jd(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=xA(d,`${r}/${h}`,f[h]));return f}a(KSo,"FromRecord");function JSo(t,e,r,n){let o=Da(t,e),s=EP(o,e,r,n);return xA(t,r,s)}a(JSo,"FromRef");function ZSo(t,e,r,n){let o=Da(t,e),s=EP(o,e,r,n);return xA(t,r,s)}a(ZSo,"FromThis");function XSo(t,e,r,n){let o=xA(t,r,n);return Mi(t.items)?t.items.map((s,c)=>EP(s,e,`${r}/${c}`,o[c])):[]}a(XSo,"FromTuple");function e1o(t,e,r,n){for(let o of t.anyOf){if(!os(o,e,n))continue;let s=EP(o,e,r,n);return xA(t,r,s)}for(let o of t.anyOf){let s=EP(o,e,r,n);if(os(t,e,s))return xA(t,r,s)}return xA(t,r,n)}a(e1o,"FromUnion");function EP(t,e,r,n){let o=o0(t,e),s=t;switch(t[St]){case"Array":return $So(s,o,r,n);case"Import":return VSo(s,o,r,n);case"Intersect":return WSo(s,o,r,n);case"Not":return zSo(s,o,r,n);case"Object":return YSo(s,o,r,n);case"Record":return KSo(s,o,r,n);case"Ref":return JSo(s,o,r,n);case"This":return ZSo(s,o,r,n);case"Tuple":return XSo(s,o,r,n);case"Union":return e1o(s,o,r,n);default:return xA(s,r,n)}}a(EP,"Visit");function zse(t,e,r){return EP(t,e,"",r)}a(zse,"TransformEncode");p();function t1o(t,e){return uc(t)||ng(t.items,e)}a(t1o,"FromArray");function r1o(t,e){return uc(t)||ng(t.items,e)}a(r1o,"FromAsyncIterator");function n1o(t,e){return uc(t)||ng(t.returns,e)||t.parameters.some(r=>ng(r,e))}a(n1o,"FromConstructor");function i1o(t,e){return uc(t)||ng(t.returns,e)||t.parameters.some(r=>ng(r,e))}a(i1o,"FromFunction");function o1o(t,e){return uc(t)||uc(t.unevaluatedProperties)||t.allOf.some(r=>ng(r,e))}a(o1o,"FromIntersect");function s1o(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return uc(t)||ng(n,[...r,...e])}a(s1o,"FromImport");function a1o(t,e){return uc(t)||ng(t.items,e)}a(a1o,"FromIterator");function c1o(t,e){return uc(t)||ng(t.not,e)}a(c1o,"FromNot");function l1o(t,e){return uc(t)||Object.values(t.properties).some(r=>ng(r,e))||jd(t.additionalProperties)&&ng(t.additionalProperties,e)}a(l1o,"FromObject");function u1o(t,e){return uc(t)||ng(t.item,e)}a(u1o,"FromPromise");function d1o(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return uc(t)||ng(n,e)||jd(t.additionalProperties)&&uc(t.additionalProperties)}a(d1o,"FromRecord");function f1o(t,e){return uc(t)?!0:ng(Da(t,e),e)}a(f1o,"FromRef");function p1o(t,e){return uc(t)?!0:ng(Da(t,e),e)}a(p1o,"FromThis");function h1o(t,e){return uc(t)||!Yu(t.items)&&t.items.some(r=>ng(r,e))}a(h1o,"FromTuple");function m1o(t,e){return uc(t)||t.anyOf.some(r=>ng(r,e))}a(m1o,"FromUnion");function ng(t,e){let r=o0(t,e),n=t;if(t.$id&&GNt.has(t.$id))return!1;switch(t.$id&&GNt.add(t.$id),t[St]){case"Array":return t1o(n,r);case"AsyncIterator":return r1o(n,r);case"Constructor":return n1o(n,r);case"Function":return i1o(n,r);case"Import":return s1o(n,r);case"Intersect":return o1o(n,r);case"Iterator":return a1o(n,r);case"Not":return c1o(n,r);case"Object":return l1o(n,r);case"Promise":return u1o(n,r);case"Record":return d1o(n,r);case"Ref":return f1o(n,r);case"This":return p1o(n,r);case"Tuple":return h1o(n,r);case"Union":return m1o(n,r);default:return uc(t)}}a(ng,"Visit");var GNt=new Set;function e3(t,e){return GNt.clear(),ng(t,e)}a(e3,"HasTransform");var $Nt=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=e3(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return OM(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new $se(this.schema,e,this.Errors(e).First());return this.hasTransform?Vse(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?zse(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new Wse(this.schema,e,this.Errors(e).First());return r}},oQe;(function(t){function e(s){return s===36}a(e,"DollarSign"),t.DollarSign=e;function r(s){return s===95}a(r,"IsUnderscore"),t.IsUnderscore=r;function n(s){return s>=65&&s<=90||s>=97&&s<=122}a(n,"IsAlpha"),t.IsAlpha=n;function o(s){return s>=48&&s<=57}a(o,"IsNumeric"),t.IsNumeric=o})(oQe||(oQe={}));var VNt;(function(t){function e(r){let n=[];for(let o=0;o= ${te.minItems}`);let de=z(te.items,ee,"value");if(yield`((array) => { for(const ${he} of array) if(!(${de})) { return false }; return true; })(${K})`,Ju(te.contains)||ui(te.minContains)||ui(te.maxContains)){let Be=Ju(te.contains)?te.contains:is(),ne=z(Be,ee,"value"),ue=ui(te.minContains)?[`(count >= ${te.minContains})`]:[],Ne=ui(te.maxContains)?[`(count <= ${te.maxContains})`]:[],xe=`const count = value.reduce((${X}, ${he}) => ${ne} ? acc + 1 : acc, 0)`,Fe=["(count > 0)",...ue,...Ne].join(" && ");yield`((${he}) => { ${xe}; return ${Fe}})(${K})`}te.uniqueItems===!0&&(yield`((${he}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${K})`)}a(o,"FromArray");function*s(te,ee,K){yield`(typeof value === 'object' && Symbol.asyncIterator in ${K})`}a(s,"FromAsyncIterator");function*c(te,ee,K){yield`(typeof ${K} === 'bigint')`,TA(te.exclusiveMaximum)&&(yield`${K} < BigInt(${te.exclusiveMaximum})`),TA(te.exclusiveMinimum)&&(yield`${K} > BigInt(${te.exclusiveMinimum})`),TA(te.maximum)&&(yield`${K} <= BigInt(${te.maximum})`),TA(te.minimum)&&(yield`${K} >= BigInt(${te.minimum})`),TA(te.multipleOf)&&(yield`(${K} % BigInt(${te.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(te,ee,K){yield`(typeof ${K} === 'boolean')`}a(l,"FromBoolean");function*u(te,ee,K){yield*W(te.returns,ee,`${K}.prototype`)}a(u,"FromConstructor");function*d(te,ee,K){yield`(${K} instanceof Date) && Number.isFinite(${K}.getTime())`,ui(te.exclusiveMaximumTimestamp)&&(yield`${K}.getTime() < ${te.exclusiveMaximumTimestamp}`),ui(te.exclusiveMinimumTimestamp)&&(yield`${K}.getTime() > ${te.exclusiveMinimumTimestamp}`),ui(te.maximumTimestamp)&&(yield`${K}.getTime() <= ${te.maximumTimestamp}`),ui(te.minimumTimestamp)&&(yield`${K}.getTime() >= ${te.minimumTimestamp}`),ui(te.multipleOfTimestamp)&&(yield`(${K}.getTime() % ${te.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(te,ee,K){yield`(typeof ${K} === 'function')`}a(f,"FromFunction");function*h(te,ee,K){let he=globalThis.Object.getOwnPropertyNames(te.$defs).reduce((X,de)=>[...X,te.$defs[de]],[]);yield*W(Ex(te.$ref),[...ee,...he],K)}a(h,"FromImport");function*m(te,ee,K){yield`Number.isInteger(${K})`,ui(te.exclusiveMaximum)&&(yield`${K} < ${te.exclusiveMaximum}`),ui(te.exclusiveMinimum)&&(yield`${K} > ${te.exclusiveMinimum}`),ui(te.maximum)&&(yield`${K} <= ${te.maximum}`),ui(te.minimum)&&(yield`${K} >= ${te.minimum}`),ui(te.multipleOf)&&(yield`(${K} % ${te.multipleOf}) === 0`)}a(m,"FromInteger");function*g(te,ee,K){let he=te.allOf.map(X=>z(X,ee,K)).join(" && ");if(te.unevaluatedProperties===!1){let X=H(`${new RegExp(JB(te))};`),de=`Object.getOwnPropertyNames(${K}).every(key => ${X}.test(key))`;yield`(${he} && ${de})`}else if(Ju(te.unevaluatedProperties)){let X=H(`${new RegExp(JB(te))};`),de=`Object.getOwnPropertyNames(${K}).every(key => ${X}.test(key) || ${z(te.unevaluatedProperties,ee,`${K}[key]`)})`;yield`(${he} && ${de})`}else yield`(${he})`}a(g,"FromIntersect");function*A(te,ee,K){yield`(typeof value === 'object' && Symbol.iterator in ${K})`}a(A,"FromIterator");function*y(te,ee,K){if(typeof te.const=="number"||typeof te.const=="boolean")yield`(${K} === ${te.const})`;else if(typeof te.const=="string")yield`(${K} === ${l7(te.const)})`;else throw Error("Invalid Literal Value")}a(y,"FromLiteral");function*_(te,ee,K){yield"false"}a(_,"FromNever");function*E(te,ee,K){yield`(!${z(te.not,ee,K)})`}a(E,"FromNot");function*v(te,ee,K){yield`(${K} === null)`}a(v,"FromNull");function*S(te,ee,K){yield Nz.IsNumberLike(K),ui(te.exclusiveMaximum)&&(yield`${K} < ${te.exclusiveMaximum}`),ui(te.exclusiveMinimum)&&(yield`${K} > ${te.exclusiveMinimum}`),ui(te.maximum)&&(yield`${K} <= ${te.maximum}`),ui(te.minimum)&&(yield`${K} >= ${te.minimum}`),ui(te.multipleOf)&&(yield`(${K} % ${te.multipleOf}) === 0`)}a(S,"FromNumber");function*T(te,ee,K){yield Nz.IsObjectLike(K),ui(te.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${te.minProperties}`),ui(te.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${te.maxProperties}`);let he=Object.getOwnPropertyNames(te.properties);for(let X of he){let de=YJr(K,X),Be=te.properties[X];if(te.required&&te.required.includes(X))yield*W(Be,ee,de),(ZB(Be)||e(Be))&&(yield`(${l7(X)} in ${K})`);else{let ne=z(Be,ee,de);yield Nz.IsExactOptionalProperty(K,X,ne)}}if(te.additionalProperties===!1)if(te.required&&te.required.length===he.length)yield`Object.getOwnPropertyNames(${K}).length === ${he.length}`;else{let X=`[${he.map(de=>`${l7(de)}`).join(", ")}]`;yield`Object.getOwnPropertyNames(${K}).every(key => ${X}.includes(key))`}if(typeof te.additionalProperties=="object"){let X=z(te.additionalProperties,ee,`${K}[key]`),de=`[${he.map(Be=>`${l7(Be)}`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${K}).every(key => ${de}.includes(key) || ${X}))`}}a(T,"FromObject");function*w(te,ee,K){yield`${K} instanceof Promise`}a(w,"FromPromise");function*R(te,ee,K){yield Nz.IsRecordLike(K),ui(te.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${te.minProperties}`),ui(te.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${te.maxProperties}`);let[he,X]=Object.entries(te.patternProperties)[0],de=H(`${new RegExp(he)}`),Be=z(X,ee,"value"),ne=Ju(te.additionalProperties)?z(te.additionalProperties,ee,K):te.additionalProperties===!1?"false":"true",ue=`(${de}.test(key) ? ${Be} : ${ne})`;yield`(Object.entries(${K}).every(([key, value]) => ${ue}))`}a(R,"FromRecord");function*x(te,ee,K){let he=Da(te,ee);if(V.functions.has(te.$ref))return yield`${ie(te.$ref)}(${K})`;yield*W(he,ee,K)}a(x,"FromRef");function*k(te,ee,K){let he=H(`${new RegExp(te.source,te.flags)};`);yield`(typeof ${K} === 'string')`,ui(te.maxLength)&&(yield`${K}.length <= ${te.maxLength}`),ui(te.minLength)&&(yield`${K}.length >= ${te.minLength}`),yield`${he}.test(${K})`}a(k,"FromRegExp");function*D(te,ee,K){yield`(typeof ${K} === 'string')`,ui(te.maxLength)&&(yield`${K}.length <= ${te.maxLength}`),ui(te.minLength)&&(yield`${K}.length >= ${te.minLength}`),te.pattern!==void 0&&(yield`${H(`${new RegExp(te.pattern)};`)}.test(${K})`),te.format!==void 0&&(yield`format(${l7(te.format)}, ${K})`)}a(D,"FromString");function*N(te,ee,K){yield`(typeof ${K} === 'symbol')`}a(N,"FromSymbol");function*O(te,ee,K){yield`(typeof ${K} === 'string')`,yield`${H(`${new RegExp(te.pattern)};`)}.test(${K})`}a(O,"FromTemplateLiteral");function*B(te,ee,K){yield`${ie(te.$ref)}(${K})`}a(B,"FromThis");function*q(te,ee,K){if(yield`Array.isArray(${K})`,te.items===void 0)return yield`${K}.length === 0`;yield`(${K}.length === ${te.maxItems})`;for(let he=0;hez(X,ee,K)).join(" || ")})`}a(L,"FromUnion");function*U(te,ee,K){yield`${K} instanceof Uint8Array`,ui(te.maxByteLength)&&(yield`(${K}.length <= ${te.maxByteLength})`),ui(te.minByteLength)&&(yield`(${K}.length >= ${te.minByteLength})`)}a(U,"FromUint8Array");function*j(te,ee,K){yield"true"}a(j,"FromUnknown");function*Q(te,ee,K){yield Nz.IsVoidLike(K)}a(Q,"FromVoid");function*Y(te,ee,K){let he=V.instances.size;V.instances.set(he,te),yield`kind(${l7(te[St])}, ${he}, ${K})`}a(Y,"FromKind");function*W(te,ee,K,he=!0){let X=pa(te.$id)?[...ee,te]:ee,de=te;if(he&&pa(te.$id)){let Be=ie(te.$id);if(V.functions.has(Be))return yield`${Be}(${K})`;{V.functions.set(Be,"");let ne=re(Be,te,ee,"value",!1);return V.functions.set(Be,ne),yield`${Be}(${K})`}}switch(de[St]){case"Any":return yield*r(de,X,K);case"Argument":return yield*n(de,X,K);case"Array":return yield*o(de,X,K);case"AsyncIterator":return yield*s(de,X,K);case"BigInt":return yield*c(de,X,K);case"Boolean":return yield*l(de,X,K);case"Constructor":return yield*u(de,X,K);case"Date":return yield*d(de,X,K);case"Function":return yield*f(de,X,K);case"Import":return yield*h(de,X,K);case"Integer":return yield*m(de,X,K);case"Intersect":return yield*g(de,X,K);case"Iterator":return yield*A(de,X,K);case"Literal":return yield*y(de,X,K);case"Never":return yield*_(de,X,K);case"Not":return yield*E(de,X,K);case"Null":return yield*v(de,X,K);case"Number":return yield*S(de,X,K);case"Object":return yield*T(de,X,K);case"Promise":return yield*w(de,X,K);case"Record":return yield*R(de,X,K);case"Ref":return yield*x(de,X,K);case"RegExp":return yield*k(de,X,K);case"String":return yield*D(de,X,K);case"Symbol":return yield*N(de,X,K);case"TemplateLiteral":return yield*O(de,X,K);case"This":return yield*B(de,X,K);case"Tuple":return yield*q(de,X,K);case"Undefined":return yield*M(de,X,K);case"Union":return yield*L(de,X,K);case"Uint8Array":return yield*U(de,X,K);case"Unknown":return yield*j(de,X,K);case"Void":return yield*Q(de,X,K);default:if(!FE.Has(de[St]))throw new WNt(te);return yield*Y(de,X,K)}}a(W,"Visit");let V={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function z(te,ee,K,he=!0){return`(${[...W(te,ee,K,he)].join(" && ")})`}a(z,"CreateExpression");function ie(te){return`check_${VNt.Encode(te)}`}a(ie,"CreateFunctionName");function H(te){let ee=`local_${V.variables.size}`;return V.variables.set(ee,`const ${ee} = ${te}`),ee}a(H,"CreateVariable");function re(te,ee,K,he,X=!0){let[de,Be]=[` `,xe=>"".padStart(xe," ")],ne=le("value","any"),ue=Le("boolean"),Ne=[...W(ee,K,he,X)].map(xe=>`${Be(4)}${xe}`).join(` &&${de}`);return`function ${te}(${ne})${ue} {${de}${Be(2)}return (${de}${Ne}${de}${Be(2)}) }`}a(re,"CreateFunction");function le(te,ee){let K=V.language==="typescript"?`: ${ee}`:"";return`${te}${K}`}a(le,"CreateParameter");function Le(te){return V.language==="typescript"?`: ${te}`:""}a(Le,"CreateReturns");function me(te,ee,K){let he=re("check",te,ee,"value"),X=le("value","any"),de=Le("boolean"),Be=[...V.functions.values()],ne=[...V.variables.values()],ue=pa(te.$id)?`return function check(${X})${de} { return ${ie(te.$id)}(value) }`:`return ${he}`;return[...ne,...Be,ue].join(` -`)}a(me,"Build");function Oe(...te){let ee={language:"javascript"},[K,he,X]=te.length===2&&Mi(te[1])?[te[0],te[1],ee]:te.length===2&&!Mi(te[1])?[te[0],[],te[1]]:te.length===3?[te[0],te[1],te[2]]:te.length===1?[te[0],[],ee]:[null,[],ee];if(V.language=X.language,V.variables.clear(),V.functions.clear(),V.instances.clear(),!Ju(K))throw new sQe(K);for(let de of he)if(!Ju(de))throw new sQe(de);return me(K,he,X)}a(Oe,"Code"),t.Code=Oe;function Te(te,ee=[]){let K=Oe(te,ee,{language:"javascript"}),he=HJr("kind","format","hash",K),X=new Map(V.instances);function de(Ne,xe,Fe){if(!FE.Has(Ne)||!X.has(xe))return!1;let tt=FE.Get(Ne),st=X.get(xe);return tt(st,Fe)}a(de,"typeRegistryFunction");function Be(Ne,xe){return mP.Has(Ne)?mP.Get(Ne)(xe):!1}a(Be,"formatRegistryFunction");function ne(Ne){return a7(Ne)}a(ne,"hashFunction");let ue=he(de,Be,ne);return new GNt(te,ee,ue,K)}a(Te,"Compile"),t.Compile=Te})(Zu||(Zu={}));var VQe=fe(Y9()),pae=fe(require("os"));Fo();var WQe=fe(ii());function LSe(t){return t===1}a(LSe,"isRestricted");var OSe=8192,ATo=21;var c0=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return LSe(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(mae(e))return this.reporterRestricted;if(sSe(e))return new w7e}getMsft1pReporter(){return this.reporterMsft1p}getMsftReporter(){return this.reporterMsft}setReporter(e){this.reporter=e}setRestrictedReporter(e){this.reporterRestricted=e}setMsft1pReporter(e){this.reporterMsft1p=e}setMsftReporter(e){this.reporterMsft=e}async deactivate(){let e=[this.reporter,this.reporterRestricted,this.reporterMsft1p,this.reporterMsft];this.reporter=this.reporterRestricted=this.reporterMsft1p=this.reporterMsft=void 0,await Promise.all(e.map(r=>r?.dispose()))}},yTo=b.Object({},{additionalProperties:b.String()}),_To=b.Object({meanLogProb:b.Optional(b.Number()),meanAlternativeLogProb:b.Optional(b.Number())},{additionalProperties:b.Number()}),ETo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function vTo(t){return ETo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(vTo,"isOomError");function CTo(t){return wx(t)?"network":vTo(t)||t.code==="EMFILE"||t.code==="ENFILE"||t.syscall==="uv_cwd"&&(t.code==="ENOENT"||t.code=="EIO")||t.code==="CopilotPromptLoadFailure"||`${t.code}`.startsWith("CopilotPromptWorkerExit")?"local":"exception"}a(CTo,"getErrorType");var Vt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=Zu.Compile(yTo)}static{this.validateTelemetryMeasurements=Zu.Compile(_To)}static{this.keysExemptedFromSanitization=["abexp.assignmentcontext","VSCode.ABExp.Features"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Rl())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=Rl())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(tr).getFallbackExpAndFilters();n.addToTelemetry(e,this),r.addToTelemetry(this)}extendWithCoreEditorAgnosticFields(e){this.properties.editor_version=o1(e.get(Ir).getEditorInfo()),this.properties.editor_plugin_version=o1(e.get(Ir).getEditorPluginInfo());let r=e.get(za);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${A1(e)}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`)}extendWithEditorAgnosticFields(e){this.extendWithCoreEditorAgnosticFields(e);let r=e.get(Ir);this.properties.common_extname=r.getEditorPluginInfo().name,this.properties.common_extversion=r.getEditorPluginInfo().version,this.properties.common_vscodeversion=o1(r.getEditorInfo());let n=e.get(Jt);this.properties.fetcher=n.name;let o=e.get(Qo).getHttpSettings();this.properties.proxy_enabled=o.proxy?"true":"false",this.properties.proxy_auth=o.proxyAuthorization?"true":"false",this.properties.proxy_kerberos_spn=o.proxyKerberosServicePrincipal?"true":"false",this.properties.reject_unauthorized=o.proxyStrictSSL!==!1?"true":"false"}extendWithConfigProperties(e){let r=Rtn(e);r["copilot.build"]=ktn(e),r["copilot.buildType"]=_7(e),this.properties={...this.properties,...r}}extendWithRequestId(e){let r={headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetryHack=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromPropertiesHack(e,r){if(LSe(e))return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetryHack.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements);for(let e in this.measurements)isNaN(this.measurements[e])&&delete this.measurements[e]}multiplexProperties(){this.properties=t.multiplexProperties(this.properties)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}static multiplexProperties(e){let r={...e};for(let n in e){let o=e[n],s=o?.length??0;if(s>OSe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+OSe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(hae,"telemetrizePromptLength");function Rl(){return performance.now()}a(Rl,"now");function ITo(t){return Math.floor(t/1e3)}a(ITo,"nowSeconds");function mae(t){return t.get(Gp).optedIn}a(mae,"shouldSendRestricted");function ft(t,e,r,n){return t.get(Ud).register(xTo(t,e,Rl(),r?.extendedBy(),n))}a(ft,"telemetry");function Ix(t,e,r){return t.get(Ud).register(YQe(t,e,r?.extendedBy()))}a(Ix,"telemetryMsft");function sr(t,e,r,n){let o=Vt.createAndMarkAsIssued(r,n);return t.get(Ud).register(YQe(t,e,o))}a(sr,"telemetryMs");function $c(t,e,r,n){sr(t,e,r,n),ft(t,e)}a($c,"telemetryMsAndGitHub");function xx(t,e,r,n){sr(t,e,r,n),ft(t,e,Vt.createAndMarkAsIssued(r))}a(xx,"telemetryMsAndGitHubWithProperties");function zQe(t,e,r,n){let o=(n||Vt.createAndMarkAsIssued()).extendedBy(Stn(r));return t.get(Ud).register(YQe(t,e,o))}a(zQe,"telemetryMsftWithError");function Hs(t,e,r,n,o){let s=Vt.createAndMarkAsIssued({...n,...Stn(r)},o);return t.get(Ud).register(YQe(t,e,s))}a(Hs,"telemetryMsWithError");function zp(t,e,r,n,o){Hs(t,e,r,n,o),Ma(t,r,e)}a(zp,"telemetryMsAndGitHubWithError");function Stn(t){let e={};if(t){let r=kTo(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(Stn,"buildErrorProperties");async function xTo(t,e,r,n,o=0){let s=n||Vt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!LSe(o)||mae(t))&&BSe(t,o,e,s),bTo(t,e,s)}a(xTo,"_telemetry");async function YQe(t,e,r){let n=r||Vt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),TTo(t,e,n)}a(YQe,"_telemetryMsft");function q9e(t,e){return t.get(Ud).register(wTo(t,e,Rl()))}a(q9e,"telemetryExpProblem");async function wTo(t,e,r){let n="expProblem",o=Vt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),BSe(t,0,n,o)}a(wTo,"_telemetryExpProblem");function gae(t,e,r,n,o=0){let s={...r,...Ttn(t)};BSe(t,o,e,{properties:s,measurements:n})}a(gae,"telemetryRaw");function Ttn(t){let e=t.get(Ir),r={unique_id:Dt(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:o1(e.getEditorInfo())};return{...t.get(Gp).getProperties(),...r}}a(Ttn,"createRequiredProperties");var EOt=class extends Error{static{a(this,"CopilotNonError")}constructor(e){let r;try{r=JSON.stringify(e)}catch{r=String(e)}super(r),this.name="CopilotNonError",this.code=(0,VQe.SHA256)(VQe.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function Ma(t,e,r,n,o){return t.get(Ud).register(Itn(t,e,Rl(),r,{...n},o))}a(Ma,"telemetryException");async function Itn(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||ng(c)||c instanceof WQe.ConnectionError||c instanceof WQe.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new EOt(e),e&&typeof e=="object"&&e.name==="ExitStatus")return;if(c.stack?.startsWith(`${c} +`)}a(me,"Build");function Oe(...te){let ee={language:"javascript"},[K,he,X]=te.length===2&&Mi(te[1])?[te[0],te[1],ee]:te.length===2&&!Mi(te[1])?[te[0],[],te[1]]:te.length===3?[te[0],te[1],te[2]]:te.length===1?[te[0],[],ee]:[null,[],ee];if(V.language=X.language,V.variables.clear(),V.functions.clear(),V.instances.clear(),!Ju(K))throw new sQe(K);for(let de of he)if(!Ju(de))throw new sQe(de);return me(K,he,X)}a(Oe,"Code"),t.Code=Oe;function Te(te,ee=[]){let K=Oe(te,ee,{language:"javascript"}),he=GJr("kind","format","hash",K),X=new Map(V.instances);function de(Ne,xe,Fe){if(!FE.Has(Ne)||!X.has(xe))return!1;let tt=FE.Get(Ne),st=X.get(xe);return tt(st,Fe)}a(de,"typeRegistryFunction");function Be(Ne,xe){return mP.Has(Ne)?mP.Get(Ne)(xe):!1}a(Be,"formatRegistryFunction");function ne(Ne){return a7(Ne)}a(ne,"hashFunction");let ue=he(de,Be,ne);return new $Nt(te,ee,ue,K)}a(Te,"Compile"),t.Compile=Te})(Zu||(Zu={}));var VQe=fe(Y9()),hae=fe(require("os"));Fo();var WQe=fe(ii());function LSe(t){return t===1}a(LSe,"isRestricted");var OSe=8192,_To=21;var l0=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return LSe(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(gae(e))return this.reporterRestricted;if(sSe(e))return new w7e}getMsft1pReporter(){return this.reporterMsft1p}getMsftReporter(){return this.reporterMsft}setReporter(e){this.reporter=e}setRestrictedReporter(e){this.reporterRestricted=e}setMsft1pReporter(e){this.reporterMsft1p=e}setMsftReporter(e){this.reporterMsft=e}async deactivate(){let e=[this.reporter,this.reporterRestricted,this.reporterMsft1p,this.reporterMsft];this.reporter=this.reporterRestricted=this.reporterMsft1p=this.reporterMsft=void 0,await Promise.all(e.map(r=>r?.dispose()))}},ETo=b.Object({},{additionalProperties:b.String()}),vTo=b.Object({meanLogProb:b.Optional(b.Number()),meanAlternativeLogProb:b.Optional(b.Number())},{additionalProperties:b.Number()}),CTo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function bTo(t){return CTo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(bTo,"isOomError");function STo(t){return wx(t)?"network":bTo(t)||t.code==="EMFILE"||t.code==="ENFILE"||t.syscall==="uv_cwd"&&(t.code==="ENOENT"||t.code=="EIO")||t.code==="CopilotPromptLoadFailure"||`${t.code}`.startsWith("CopilotPromptWorkerExit")?"local":"exception"}a(STo,"getErrorType");var Vt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=Zu.Compile(ETo)}static{this.validateTelemetryMeasurements=Zu.Compile(vTo)}static{this.keysExemptedFromSanitization=["abexp.assignmentcontext","VSCode.ABExp.Features"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Rl())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=Rl())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(tr).getFallbackExpAndFilters();n.addToTelemetry(e,this),r.addToTelemetry(this)}extendWithCoreEditorAgnosticFields(e){this.properties.editor_version=o1(e.get(Ir).getEditorInfo()),this.properties.editor_plugin_version=o1(e.get(Ir).getEditorPluginInfo());let r=e.get(za);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${A1(e)}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`)}extendWithEditorAgnosticFields(e){this.extendWithCoreEditorAgnosticFields(e);let r=e.get(Ir);this.properties.common_extname=r.getEditorPluginInfo().name,this.properties.common_extversion=r.getEditorPluginInfo().version,this.properties.common_vscodeversion=o1(r.getEditorInfo());let n=e.get(Jt);this.properties.fetcher=n.name;let o=e.get(Qo).getHttpSettings();this.properties.proxy_enabled=o.proxy?"true":"false",this.properties.proxy_auth=o.proxyAuthorization?"true":"false",this.properties.proxy_kerberos_spn=o.proxyKerberosServicePrincipal?"true":"false",this.properties.reject_unauthorized=o.proxyStrictSSL!==!1?"true":"false"}extendWithConfigProperties(e){let r=ktn(e);r["copilot.build"]=Ptn(e),r["copilot.buildType"]=_7(e),this.properties={...this.properties,...r}}extendWithRequestId(e){let r={headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetryHack=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromPropertiesHack(e,r){if(LSe(e))return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetryHack.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements);for(let e in this.measurements)isNaN(this.measurements[e])&&delete this.measurements[e]}multiplexProperties(){this.properties=t.multiplexProperties(this.properties)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}static multiplexProperties(e){let r={...e};for(let n in e){let o=e[n],s=o?.length??0;if(s>OSe){let c=0,l=0;for(;s>0&&l<_To;){l+=1;let u=n;l>1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+OSe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(mae,"telemetrizePromptLength");function Rl(){return performance.now()}a(Rl,"now");function wTo(t){return Math.floor(t/1e3)}a(wTo,"nowSeconds");function gae(t){return t.get(Gp).optedIn}a(gae,"shouldSendRestricted");function ft(t,e,r,n){return t.get(Qd).register(RTo(t,e,Rl(),r?.extendedBy(),n))}a(ft,"telemetry");function Ix(t,e,r){return t.get(Qd).register(YQe(t,e,r?.extendedBy()))}a(Ix,"telemetryMsft");function sr(t,e,r,n){let o=Vt.createAndMarkAsIssued(r,n);return t.get(Qd).register(YQe(t,e,o))}a(sr,"telemetryMs");function $c(t,e,r,n){sr(t,e,r,n),ft(t,e)}a($c,"telemetryMsAndGitHub");function xx(t,e,r,n){sr(t,e,r,n),ft(t,e,Vt.createAndMarkAsIssued(r))}a(xx,"telemetryMsAndGitHubWithProperties");function zQe(t,e,r,n){let o=(n||Vt.createAndMarkAsIssued()).extendedBy(Ttn(r));return t.get(Qd).register(YQe(t,e,o))}a(zQe,"telemetryMsftWithError");function Hs(t,e,r,n,o){let s=Vt.createAndMarkAsIssued({...n,...Ttn(r)},o);return t.get(Qd).register(YQe(t,e,s))}a(Hs,"telemetryMsWithError");function zp(t,e,r,n,o){Hs(t,e,r,n,o),Ma(t,r,e)}a(zp,"telemetryMsAndGitHubWithError");function Ttn(t){let e={};if(t){let r=DTo(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(Ttn,"buildErrorProperties");async function RTo(t,e,r,n,o=0){let s=n||Vt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!LSe(o)||gae(t))&&BSe(t,o,e,s),TTo(t,e,s)}a(RTo,"_telemetry");async function YQe(t,e,r){let n=r||Vt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),xTo(t,e,n)}a(YQe,"_telemetryMsft");function q9e(t,e){return t.get(Qd).register(kTo(t,e,Rl()))}a(q9e,"telemetryExpProblem");async function kTo(t,e,r){let n="expProblem",o=Vt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),BSe(t,0,n,o)}a(kTo,"_telemetryExpProblem");function Aae(t,e,r,n,o=0){let s={...r,...Itn(t)};BSe(t,o,e,{properties:s,measurements:n})}a(Aae,"telemetryRaw");function Itn(t){let e=t.get(Ir),r={unique_id:Dt(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:o1(e.getEditorInfo())};return{...t.get(Gp).getProperties(),...r}}a(Itn,"createRequiredProperties");var vOt=class extends Error{static{a(this,"CopilotNonError")}constructor(e){let r;try{r=JSON.stringify(e)}catch{r=String(e)}super(r),this.name="CopilotNonError",this.code=(0,VQe.SHA256)(VQe.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function Ma(t,e,r,n,o){return t.get(Qd).register(xtn(t,e,Rl(),r,{...n},o))}a(Ma,"telemetryException");async function xtn(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||ig(c)||c instanceof WQe.ConnectionError||c instanceof WQe.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new vOt(e),e&&typeof e=="object"&&e.name==="ExitStatus")return;if(c.stack?.startsWith(`${c} `)){let y=c.stack.slice(`${c} `.length).split(` `);/^\s*(?:at )?(?:\w+\.)*_telemetryException\b/.test(y[0]??"")&&y.shift(),/^\s*(?:at )?(?:\w+\.)*telemetryException\b/.test(y[0]??"")&&y.shift(),c.stack=`${c} ${y.join(` -`)}`}}let l=t.get(Ir).getEditorInfo(),u;l.root&&(u=[{prefix:`${l.name}:`,path:l.root}]);let d=mae(t),f=RYr(c,u,d),h=CTo(c),m=h==="exception",g=Vt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:f.stack||f.toString(),message:f.message,...o});if(await g.makeReadyForSending(t,0,"IncludeExp",r),s?.exception_detail)for(let y of s.exception_detail)y.value&&(d?y.value=ZDt(y.value):y.value="[redacted]");s??=pYr(t,f,n),s.context={...s.context,"copilot_event.unique_id":g.properties.unique_id,"#restricted_telemetry":d?"true":"false"},s.rollup_id!=="auto"&&(g.properties.errno=s.rollup_id),s.created_at=new Date(g.issuedTime).toISOString();let A=s.rollup_id==="auto"?c.stack??"":s.rollup_id;if(!t.get(PM).isThrottled(A)){if(d){let y=wYr(c,u),_=Vt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:y.stack||y.toString(),message:y.message,...o});s.rollup_id!=="auto"&&(_.properties.errno=s.rollup_id),await _.makeReadyForSending(t,1,"IncludeExp",r),_.properties.unique_id=g.properties.unique_id,g.properties.restricted_unique_id=_.properties.unique_id,BSe(t,1,`error.${h}`,_)}m&&(g.properties.failbot_payload=JSON.stringify(s)),BSe(t,0,`error.${h}`,g)}}a(Itn,"_telemetryException");function n0(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await Itn(t,c,Rl(),r,n)}},"wrapped");return(...s)=>t.get(Ud).register(o(...s))}a(n0,"telemetryCatch");function l0(t,e,r,n){return t.get(Ud).register(RTo(t,e,Rl(),r?.extendedBy(),n))}a(l0,"telemetryError");async function RTo(t,e,r,n,o=0){if(LSe(o)&&!mae(t))return;let s=n||Vt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),STo(t,o,e,s)}a(RTo,"_telemetryError");function xtn(t,e,r,n,o,s){let c={completionTextJson:JSON.stringify(e),choiceIndex:o.toString()},l=s?.properties?.engineName;l&&(c.engineName=l,c.modelId=l);let u=Vt.createAndMarkAsIssued(c);if(r.logprobs)for(let[d,f]of Object.entries(r.logprobs))u.properties["logprobs_"+d]=JSON.stringify(f)??"unset";return u.extendWithRequestId(n),ft(t,"engine.completion",u,1)}a(xtn,"logEngineCompletion");function wtn(t,e,r){let n={promptJson:JSON.stringify({prefix:e.prefix,context:e.context}),promptSuffixJson:JSON.stringify(e.suffix)};if(e.context){let s=r.properties["request.option.extra"]?JSON.parse(r.properties["request.option.extra"]):{};s.context=e.context,n["request.option.extra"]=JSON.stringify(s)}let o=r.extendedBy(n);return ft(t,"engine.prompt",o,1)}a(wtn,"logEnginePrompt");function kTo(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){let e=t,r;if(typeof e.message=="string")r=e.message;else try{r=JSON.stringify(e)}catch{r="Unknown error"}let n=new Error(r);return n.name=typeof e.name=="string"?e.name:typeof t,typeof e.stack=="string"&&(n.stack=e.stack),n}return new Error("Unknown error")}a(kTo,"buildErrorFromUnknown");p();var Fz=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function ng(t){return!t||typeof t!="object"?!1:t instanceof Fz||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(ng,"isAbortError");var Aae=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},Rx=class extends Error{static{a(this,"FetchResponseError")}constructor(e,r=`HTTP ${e.status} ${e.statusText}`){super(r),this.name="FetchResponseError",this.code=`HTTP${e.status}`}},PTo=new Set(["ECONNABORTED","ECONNRESET","EHOSTUNREACH","ENETUNREACH","ENOTCONN","ENOTFOUND","ETIMEDOUT","ERR_HTTP2_STREAM_ERROR","ERR_SSL_BAD_DECRYPT","ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC","ERR_SSL_INVALID_LIBRARY_(0)","ERR_SSL_SSLV3_ALERT_BAD_RECORD_MAC","ERR_SSL_WRONG_VERSION_NUMBER","ERR_STREAM_PREMATURE_CLOSE","ERR_TLS_CERT_ALTNAME_INVALID"]);function wx(t,e=!0){return t instanceof Error?e&&"cause"in t&&wx(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof Aae||t instanceof Rx||t?.message?.startsWith("net::")||PTo.has(t.code??""):!1}a(wx,"isNetworkError");var kx=class{constructor(e,r,n,o,s){this.status=e;this.statusText=r;this.headers=n;this.getText=o;this.getBody=s;this.ok=this.status>=200&&this.status<300;this.clientError=this.status>=400&&this.status<500}static{a(this,"Response")}async text(){return this.getText()}async json(){let e=await this.text(),r=this.headers.get("content-type");if(!r||!r.includes("json"))throw new Aae(`Response content-type is ${r??"missing"} (status=${this.status})`,`ContentType=${r}`);try{return JSON.parse(e)}catch(n){if(n instanceof SyntaxError){let o=n.message.match(/^(.*?) in JSON at position (\d+)(?: \(line \d+ column \d+\))?$/);if(o&&parseInt(o[2],10)==e.length||n.message==="Unexpected end of JSON input"){let s=new TextEncoder().encode(e).length,c=this.headers.get("content-length");throw c===null?new Aae(`Response body truncated: actualLength=${s}`,"Truncated"):new Aae(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function UM(t){let e=t.headers.get("retry-after");if(!e)return;let r=Number.parseFloat(e);if(Number.isFinite(r)&&r>=0)return r;let n=Date.parse(e);if(Number.isNaN(n))return;let o=n-Date.now();return o<=0?0:o/1e3}a(UM,"parseRetryAfterSeconds");var Jt=class{static{a(this,"Fetcher")}getImplementation(){return this}};function Uz(t,e,r,n,o,s,c,l,u,d,f,h){let m=l?.["x-api-key"],g=typeof m=="string"&&m.length>0,A={...l,...g?{}:{Authorization:`Bearer ${r}`},...s_(t)};d===void 0&&(A["Openai-Organization"]="github-copilot",A["X-Request-Id"]=o,A["VScode-SessionId"]=t.get(za).sessionId,A["VScode-MachineId"]=t.get(za).machineId,A["X-GitHub-Api-Version"]="2026-01-09"),n&&(A["OpenAI-Intent"]=n);let y={method:"POST",headers:A,json:s,timeout:u};f&&h&&f.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:A,messages:h,body:s});let _=t.get(Jt);if(c){let v=new AbortController;c.onCancellationRequested(()=>{ft(t,"networking.cancelRequest",Vt.createAndMarkAsIssued({headerRequestId:o})),v.abort()}),y.signal=v.signal}return _.fetch(e,y).catch(v=>{if(DTo(v))return ft(t,"networking.disconnectAll"),_.disconnectAll().then(()=>_.fetch(e,y));throw v})}a(Uz,"postRequest");function DTo(t){return t instanceof Error?t.message=="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code=="ECONNRESET"||t.code=="ETIMEDOUT"||t.code=="ERR_HTTP2_INVALID_SESSION":!1:!1}a(DTo,"isInterruptedNetworkError");p();function KQe(){return typeof process>"u"}a(KQe,"isWeb");function n3(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(n3,"isMsBenchModeEnabled");var vOt=class extends Rx{static{a(this,"ProxiedResponseError")}constructor(e){super(e,`HTTP ${e.status} response does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`)}};async function Gd(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...KQe()?{}:s_(t),...n.headers}};let o=await t.get(Jt).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new Rx(o);if(!o.headers.get("x-github-request-id"))throw new vOt(o);return o}a(Gd,"apiFetch");p();p();var ss=class{constructor(){this.recentNotifications=new Sn(100)}static{a(this,"NotificationSender")}async showWarningMessageOnlyOnce(e,r,...n){if(!this.recentNotifications.has(e??r))return this.recentNotifications.set(e??r,!0),this.showWarningMessage(r,...n)}async showInformationMessageOnlyOnce(e,r,...n){if(!this.recentNotifications.has(e??r))return this.recentNotifications.set(e??r,!0),this.showInformationMessage(r,...n)}};p();p();var ga=class t{static{a(this,"ContentProvider")}static{this.registeredSchemes=new Set}static registerSchemes(e){for(let r of e)t.registeredSchemes.add(r)}static isRegisteredScheme(e){return t.registeredSchemes.has(e)}};var Ntn=require("os"),JQe=require("path");p();var Ptn;(()=>{"use strict";var t={975:O=>{function B(L){if(typeof L!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(L))}a(B,"e");function q(L,U){for(var j,Q="",Y=0,W=-1,V=0,z=0;z<=L.length;++z){if(z2){var ie=Q.lastIndexOf("/");if(ie!==Q.length-1){ie===-1?(Q="",Y=0):Y=(Q=Q.slice(0,ie)).length-1-Q.lastIndexOf("/"),W=z,V=0;continue}}else if(Q.length===2||Q.length===1){Q="",Y=0,W=z,V=0;continue}}U&&(Q.length>0?Q+="/..":Q="..",Y=2)}else Q.length>0?Q+="/"+L.slice(W+1,z):Q=L.slice(W+1,z),Y=z-W-1;W=z,V=0}else j===46&&V!==-1?++V:V=-1}return Q}a(q,"r");var M={resolve:a(function(){for(var L,U="",j=!1,Q=arguments.length-1;Q>=-1&&!j;Q--){var Y;Q>=0?Y=arguments[Q]:(L===void 0&&(L=process.cwd()),Y=L),B(Y),Y.length!==0&&(U=Y+"/"+U,j=Y.charCodeAt(0)===47)}return U=q(U,!j),j?U.length>0?"/"+U:"/":U.length>0?U:"."},"resolve"),normalize:a(function(L){if(B(L),L.length===0)return".";var U=L.charCodeAt(0)===47,j=L.charCodeAt(L.length-1)===47;return(L=q(L,!U)).length!==0||U||(L="."),L.length>0&&j&&(L+="/"),U?"/"+L:L},"normalize"),isAbsolute:a(function(L){return B(L),L.length>0&&L.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var L,U=0;U0&&(L===void 0?L=j:L+="/"+j)}return L===void 0?".":M.normalize(L)},"join"),relative:a(function(L,U){if(B(L),B(U),L===U||(L=M.resolve(L))===(U=M.resolve(U)))return"";for(var j=1;jz){if(U.charCodeAt(W+H)===47)return U.slice(W+H+1);if(H===0)return U.slice(W+H)}else Y>z&&(L.charCodeAt(j+H)===47?ie=H:H===0&&(ie=0));break}var re=L.charCodeAt(j+H);if(re!==U.charCodeAt(W+H))break;re===47&&(ie=H)}var le="";for(H=j+ie+1;H<=Q;++H)H!==Q&&L.charCodeAt(H)!==47||(le.length===0?le+="..":le+="/..");return le.length>0?le+U.slice(W+ie):(W+=ie,U.charCodeAt(W)===47&&++W,U.slice(W))},"relative"),_makeLong:a(function(L){return L},"_makeLong"),dirname:a(function(L){if(B(L),L.length===0)return".";for(var U=L.charCodeAt(0),j=U===47,Q=-1,Y=!0,W=L.length-1;W>=1;--W)if((U=L.charCodeAt(W))===47){if(!Y){Q=W;break}}else Y=!1;return Q===-1?j?"/":".":j&&Q===1?"//":L.slice(0,Q)},"dirname"),basename:a(function(L,U){if(U!==void 0&&typeof U!="string")throw new TypeError('"ext" argument must be a string');B(L);var j,Q=0,Y=-1,W=!0;if(U!==void 0&&U.length>0&&U.length<=L.length){if(U.length===L.length&&U===L)return"";var V=U.length-1,z=-1;for(j=L.length-1;j>=0;--j){var ie=L.charCodeAt(j);if(ie===47){if(!W){Q=j+1;break}}else z===-1&&(W=!1,z=j+1),V>=0&&(ie===U.charCodeAt(V)?--V==-1&&(Y=j):(V=-1,Y=z))}return Q===Y?Y=z:Y===-1&&(Y=L.length),L.slice(Q,Y)}for(j=L.length-1;j>=0;--j)if(L.charCodeAt(j)===47){if(!W){Q=j+1;break}}else Y===-1&&(W=!1,Y=j+1);return Y===-1?"":L.slice(Q,Y)},"basename"),extname:a(function(L){B(L);for(var U=-1,j=0,Q=-1,Y=!0,W=0,V=L.length-1;V>=0;--V){var z=L.charCodeAt(V);if(z!==47)Q===-1&&(Y=!1,Q=V+1),z===46?U===-1?U=V:W!==1&&(W=1):U!==-1&&(W=-1);else if(!Y){j=V+1;break}}return U===-1||Q===-1||W===0||W===1&&U===Q-1&&U===j+1?"":L.slice(U,Q)},"extname"),format:a(function(L){if(L===null||typeof L!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof L);return(function(U,j){var Q=j.dir||j.root,Y=j.base||(j.name||"")+(j.ext||"");return Q?Q===j.root?Q+Y:Q+"/"+Y:Y})(0,L)},"format"),parse:a(function(L){B(L);var U={root:"",dir:"",base:"",ext:"",name:""};if(L.length===0)return U;var j,Q=L.charCodeAt(0),Y=Q===47;Y?(U.root="/",j=1):j=0;for(var W=-1,V=0,z=-1,ie=!0,H=L.length-1,re=0;H>=j;--H)if((Q=L.charCodeAt(H))!==47)z===-1&&(ie=!1,z=H+1),Q===46?W===-1?W=H:re!==1&&(re=1):W!==-1&&(re=-1);else if(!ie){V=H+1;break}return W===-1||z===-1||re===0||re===1&&W===z-1&&W===V+1?z!==-1&&(U.base=U.name=V===0&&Y?L.slice(1,z):L.slice(V,z)):(V===0&&Y?(U.name=L.slice(1,W),U.base=L.slice(1,z)):(U.name=L.slice(V,W),U.base=L.slice(V,z)),U.ext=L.slice(W,z)),V>0?U.dir=L.slice(0,V-1):Y&&(U.dir="/"),U},"parse"),sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,O.exports=M}},e={};function r(O){var B=e[O];if(B!==void 0)return B.exports;var q=e[O]={exports:{}};return t[O](q,q.exports,r),q.exports}a(r,"r"),r.d=(O,B)=>{for(var q in B)r.o(B,q)&&!r.o(O,q)&&Object.defineProperty(O,q,{enumerable:!0,get:B[q]})},r.o=(O,B)=>Object.prototype.hasOwnProperty.call(O,B),r.r=O=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(O,"__esModule",{value:!0})};var n={};let o;r.r(n),r.d(n,{URI:a(()=>m,"URI"),Utils:a(()=>N,"Utils")}),typeof process=="object"?o=process.platform==="win32":typeof navigator=="object"&&(o=navigator.userAgent.indexOf("Windows")>=0);let s=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function u(O,B){if(!O.scheme&&B)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${O.authority}", path: "${O.path}", query: "${O.query}", fragment: "${O.fragment}"}`);if(O.scheme&&!s.test(O.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(O.path){if(O.authority){if(!c.test(O.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(O.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(u,"a");let d="",f="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{static{a(this,"l")}static isUri(B){return B instanceof m||!!B&&typeof B.authority=="string"&&typeof B.fragment=="string"&&typeof B.path=="string"&&typeof B.query=="string"&&typeof B.scheme=="string"&&typeof B.fsPath=="string"&&typeof B.with=="function"&&typeof B.toString=="function"}scheme;authority;path;query;fragment;constructor(B,q,M,L,U,j=!1){typeof B=="object"?(this.scheme=B.scheme||d,this.authority=B.authority||d,this.path=B.path||d,this.query=B.query||d,this.fragment=B.fragment||d):(this.scheme=(function(Q,Y){return Q||Y?Q:"file"})(B,j),this.authority=q||d,this.path=(function(Q,Y){switch(Q){case"https":case"http":case"file":Y?Y[0]!==f&&(Y=f+Y):Y=f}return Y})(this.scheme,M||d),this.query=L||d,this.fragment=U||d,u(this,j))}get fsPath(){return v(this,!1)}with(B){if(!B)return this;let{scheme:q,authority:M,path:L,query:U,fragment:j}=B;return q===void 0?q=this.scheme:q===null&&(q=d),M===void 0?M=this.authority:M===null&&(M=d),L===void 0?L=this.path:L===null&&(L=d),U===void 0?U=this.query:U===null&&(U=d),j===void 0?j=this.fragment:j===null&&(j=d),q===this.scheme&&M===this.authority&&L===this.path&&U===this.query&&j===this.fragment?this:new A(q,M,L,U,j)}static parse(B,q=!1){let M=h.exec(B);return M?new A(M[2]||d,R(M[4]||d),R(M[5]||d),R(M[7]||d),R(M[9]||d),q):new A(d,d,d,d,d)}static file(B){let q=d;if(o&&(B=B.replace(/\\/g,f)),B[0]===f&&B[1]===f){let M=B.indexOf(f,2);M===-1?(q=B.substring(2),B=f):(q=B.substring(2,M),B=B.substring(M)||f)}return new A("file",q,B,d,d)}static from(B){let q=new A(B.scheme,B.authority,B.path,B.query,B.fragment);return u(q,!0),q}toString(B=!1){return S(this,B)}toJSON(){return this}static revive(B){if(B){if(B instanceof m)return B;{let q=new A(B);return q._formatted=B.external,q._fsPath=B._sep===g?B.fsPath:null,q}}return B}}let g=o?1:void 0;class A extends m{static{a(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=v(this,!1)),this._fsPath}toString(B=!1){return B?S(this,!0):(this._formatted||(this._formatted=S(this,!1)),this._formatted)}toJSON(){let B={$mid:1};return this._fsPath&&(B.fsPath=this._fsPath,B._sep=g),this._formatted&&(B.external=this._formatted),this.path&&(B.path=this.path),this.scheme&&(B.scheme=this.scheme),this.authority&&(B.authority=this.authority),this.query&&(B.query=this.query),this.fragment&&(B.fragment=this.fragment),B}}let y={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function _(O,B,q){let M,L=-1;for(let U=0;U=97&&j<=122||j>=65&&j<=90||j>=48&&j<=57||j===45||j===46||j===95||j===126||B&&j===47||q&&j===91||q&&j===93||q&&j===58)L!==-1&&(M+=encodeURIComponent(O.substring(L,U)),L=-1),M!==void 0&&(M+=O.charAt(U));else{M===void 0&&(M=O.substr(0,U));let Q=y[j];Q!==void 0?(L!==-1&&(M+=encodeURIComponent(O.substring(L,U)),L=-1),M+=Q):L===-1&&(L=U)}}return L!==-1&&(M+=encodeURIComponent(O.substring(L))),M!==void 0?M:O}a(_,"m");function E(O){let B;for(let q=0;q1&&O.scheme==="file"?`//${O.authority}${O.path}`:O.path.charCodeAt(0)===47&&(O.path.charCodeAt(1)>=65&&O.path.charCodeAt(1)<=90||O.path.charCodeAt(1)>=97&&O.path.charCodeAt(1)<=122)&&O.path.charCodeAt(2)===58?B?O.path.substr(1):O.path[1].toLowerCase()+O.path.substr(2):O.path,o&&(q=q.replace(/\//g,"\\")),q}a(v,"v");function S(O,B){let q=B?E:_,M="",{scheme:L,authority:U,path:j,query:Q,fragment:Y}=O;if(L&&(M+=L,M+=":"),(U||L==="file")&&(M+=f,M+=f),U){let W=U.indexOf("@");if(W!==-1){let V=U.substr(0,W);U=U.substr(W+1),W=V.lastIndexOf(":"),W===-1?M+=q(V,!1,!1):(M+=q(V.substr(0,W),!1,!1),M+=":",M+=q(V.substr(W+1),!1,!0)),M+="@"}U=U.toLowerCase(),W=U.lastIndexOf(":"),W===-1?M+=q(U,!1,!0):(M+=q(U.substr(0,W),!1,!0),M+=U.substr(W))}if(j){if(j.length>=3&&j.charCodeAt(0)===47&&j.charCodeAt(2)===58){let W=j.charCodeAt(1);W>=65&&W<=90&&(j=`/${String.fromCharCode(W+32)}:${j.substr(3)}`)}else if(j.length>=2&&j.charCodeAt(1)===58){let W=j.charCodeAt(0);W>=65&&W<=90&&(j=`${String.fromCharCode(W+32)}:${j.substr(2)}`)}M+=q(j,!0,!1)}return Q&&(M+="?",M+=q(Q,!1,!1)),Y&&(M+="#",M+=B?Y:_(Y,!1,!1)),M}a(S,"b");function T(O){try{return decodeURIComponent(O)}catch{return O.length>3?O.substr(0,3)+T(O.substr(3)):O}}a(T,"C");let w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function R(O){return O.match(w)?O.replace(w,(B=>T(B))):O}a(R,"w");var x=r(975);let k=x.posix||x,D="/";var N;(function(O){O.joinPath=function(B,...q){return B.with({path:k.join(B.path,...q)})},O.resolvePath=function(B,...q){let M=B.path,L=!1;M[0]!==D&&(M=D+M,L=!0);let U=k.resolve(M,...q);return L&&U[0]===D&&!B.authority&&(U=U.substring(1)),B.with({path:U})},O.dirname=function(B){if(B.path.length===0||B.path===D)return B;let q=k.dirname(B.path);return q.length===1&&q.charCodeAt(0)===46&&(q=""),B.with({path:q})},O.basename=function(B){return k.basename(B.path)},O.extname=function(B){return k.extname(B.path)}})(N||(N={})),Ptn=n})();var{URI:E7,Utils:FSe}=Ptn;function Mtn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+Mtn(t.substring(3)):t}}a(Mtn,"decodeURIComponentGraceful");var Dtn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function COt(t){return t.match(Dtn)?t.replace(Dtn,e=>Mtn(e)):t}a(COt,"percentDecode");function Ko(t){if(/^[A-Za-z][A-Za-z0-9+.-]+:/.test(t))throw new Error("Path must not contain a scheme");if(!t)throw new Error("Path must not be empty");return E7.file(t).toString()}a(Ko,"makeFsUri");function oo(t){if(typeof t!="string"&&(t=t.uri),/^[A-Za-z]:\\/.test(t))throw new Error(`Could not parse <${t}>: Windows-style path`);try{let e=t.match(/^(?:([^:/?#]+?:)?\/\/)(\/\/.*)$/);return e?E7.parse(e[1]+e[2],!0):E7.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(oo,"parseUri");function ZQe(t){return oo(t),t}a(ZQe,"validateUri");function Gs(t){try{return oo(t).toString()}catch{return t}}a(Gs,"normalizeUri");function Otn(t){let e=Gs(t);return e.endsWith("/")?e.slice(0,-1):e}a(Otn,"normalizeUriNoTrailingSlash");var Qz=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function un(t){let e=oo(t);if(!Qz.has(e.scheme)&&!ga.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,Ntn.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,JQe.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(un,"fsPath");function ys(t){try{return un(t)}catch{return}}a(ys,"getFsPath");function Ltn(t){let e=ys(t);if(e)return E7.file(e).toString()}a(Ltn,"getFsUri");function qz(t,...e){let r,n=ys(t);return n?r=Ko((0,JQe.resolve)(n,...e)):r=FSe.resolvePath(oo(t),...e.map(o=>Btn(o))).toString(),typeof t=="string"?r:{uri:r}}a(qz,"resolveFilePath");function Oa(t,...e){let r=FSe.joinPath(oo(t),...e.map(Btn)).toString();return typeof t=="string"?r:{uri:r}}a(Oa,"joinPath");function Btn(t){return NTo(t)?t.replaceAll("\\","/"):t}a(Btn,"pathToURIPath");function NTo(t){return/^[^/\\]*\\/.test(t)}a(NTo,"isWinPath");function ro(t){return COt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(ro,"basename");function Cf(t){let e=FSe.dirname(oo(t)),r;return Qz.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(Cf,"dirname");function Ftn(t){return FSe.extname(oo(t))}a(Ftn,"extname");var ig=class{static{a(this,"NetworkConfiguration")}};function XQe(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!SOt(t)&&r.protocol==="http:")return r.href}catch{}}a(XQe,"ensurePermittedUrl");var jz={api:"https://api.githubcopilot.com",proxy:"https://copilot-proxy.githubusercontent.com",telemetry:"https://copilot-telemetry.githubusercontent.com","origin-tracker":"https://origin-tracker.githubusercontent.com"};function bOt(t,e,r){if(r&&s1(t)){for(let n of r){let o=kt(t,n);if(o)return o}return}for(let n of e){let o=kt(t,n);if(o)return o}}a(bOt,"urlConfigOverride");function MTo(t,e){switch(e){case"api":return bOt(t,[ze.DebugOverrideCapiUrl,ze.DebugOverrideCapiUrlLegacy],[ze.DebugTestOverrideCapiUrl,ze.DebugTestOverrideCapiUrlLegacy]);case"proxy":return bOt(t,[ze.DebugOverrideProxyUrl,ze.DebugOverrideProxyUrlLegacy],[ze.DebugTestOverrideProxyUrl,ze.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!SOt(t))return bOt(t,[ze.DebugSnippyOverrideUrl])}}a(MTo,"getEndpointOverrideUrl");function Px(t,e,r,...n){let o=MTo(t,r)??e.endpoints[r];return Oa(o,...n)}a(Px,"getEndpointUrl");function i3(t){return Dx(t)?.endpoints??jz}a(i3,"getLastKnownEndpoints");function eqe(t,e){if(e&&!XQe(t,e)){t.get(ss).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get(ig).setConfiguredUrls(t,{serverUrl:e})}a(eqe,"updateServerUrl");p();var og=class{static{a(this,"UrlOpener")}};var DC=new pe("auth"),TOt=60,OTo=300;var LTo=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],BTo="4535c7beffc844b46bb1ed4aa04d759a";function a_(t){let e=t.serverUrl?.match(/^https?:\/\//)?t.serverUrl:"",r=t.apiUrl?.match(/^https?:\/\//)?t.apiUrl:"";return e?r||=e.replace("://","://api."):r?.includes("://api.")&&(e||=r.replace("://api.","://")),(!e||!r)&&(e="https://github.com/",r="https://api.github.com/"),{apiUrl:r,serverUrl:e}}a(a_,"fillGitHubUrls");function v7(){return Math.floor(Date.now()/1e3)}a(v7,"nowSeconds");async function IOt(t,e,r){let n=Vt.createAndMarkAsIssued({},{});ft(t,"auth.new_login");let o={"X-GitHub-Api-Version":"2024-12-15"};r?.hasKnownOrg&&(o["X-GitHub-Staff-Request"]="1");let s=await Gd(t,e,"copilot_internal/v2/token",{timeout:12e4,headers:o}),c=await s.json();if(s.status===401){let h="Failed to get copilot token due to 401 status. Please sign out and try again.",m=s.headers.get("x-github-request-id")??"",g=c.error_details,A=[];m&&A.push(`request_id=${m}`),g?.url&&A.push(`url=${g.url}`),g?.notification_id&&A.push(`notification_id=${g.notification_id}`),g?.message&&A.push(`error=${g.message}`);let y=A.length>0?` (${A.join(", ")})`:"";return DC.info(t,`${h}${y}`),l0(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:h}}if(!s.ok||!c.token){DC.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),l0(t,"auth.invalid_token",n.extendedBy({status:s.status.toString(),status_text:s.statusText}));let h=c.error_details;return h?.notification_id!=="not_signed_up"&&FTo(t,h,e),{failureKind:"NotAuthorized",message:h?.message??"Could not retrieve token",canSignUpForLimited:c.can_signup_for_limited??!1}}let l=v7()+c.refresh_in+TOt,u=await USe(t,e),d;u.ok&&(d=await u.json());let f=new Hz(c,d,l);return ft(t,"auth.new_token",n.extendedBy({...$Dt(f)},{adjusted_expires_at:f.expiresAt,expires_at:c.expires_at,current_time:v7()})),{copilotToken:f}}a(IOt,"authFromGitHubSession");var $h=class{static{a(this,"CopilotTokenFetcher")}},tqe=class extends $h{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await IOt(e,r,n)}};async function USe(t,e){return await Gd(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a(USe,"fetchCopilotUserInfo");function FTo(t,e,r){e&&t.get(ss).showWarningMessageOnlyOnce(e.notification_id,e.message,{title:e.title},{title:"Dismiss"}).then(async n=>{let o=n?.title===e.title,s=o||n?.title==="Dismiss";if(o){let c=t.get(Ir).getEditorPluginInfo(),l=e.url.replace("{EDITOR}",encodeURIComponent(c.name+"_"+c.version));await t.get(og).open(l)}e.notification_id&&s&&await UTo(t,e.notification_id,r)}).catch(n=>{DC.exception(t,n,"copilotToken.notification")})}a(FTo,"notifyUser");async function UTo(t,e,r){let n=await Gd(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&DC.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(UTo,"sendNotificationResultToGitHub");var Hz=class{constructor(e,r,n){this.envelope=e;this.expiresAt=n;this.token=e.token,this.organization_list=e.organization_list,this.enterprise_list=e.enterprise_list,this.tokenMap=this.parseToken(this.token),this.userInfo=new C9e(r)}static{a(this,"CopilotToken")}get endpoints(){return{...jz,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-OTo(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(BTo)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var Ei=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function rqe(t){return`Environment variable ${t} provides a token that is not valid for GitHub Copilot. Please unset it (or replace with a working token) and retry.`}a(rqe,"authEnvVarConflictMessage");var C7=class extends Ei{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function Utn(t){let e=t.trim();if(!e)throw new Ei("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new Ei("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new Ei("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new Ei("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(Utn,"validateGitHubServerUrl");p();p();var QM=class{static{a(this,"AuthRepository")}};p();function Qtn(t){let e=t.trim();if(!e)throw new Ei("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=Utn(r),{apiUrl:o}=a_({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(Qtn,"buildAuthServerEndpoint");function b7(t,e){if(e!==void 0)return Qtn(e);{let r=t.get(ig),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(b7,"resolveAuthServerEndpoint");function xOt(t){if(!t)return!1;try{return Qtn(t),!0}catch{return!1}}a(xOt,"isValidAuthServer");p();p();p();p();p();p();p();p();function a3(t,e){return t||e}a(a3,"_pureAssign");function sg(t,e){return t[e]}a(sg,"_pureRef");var NC=void 0,Vh=null,jOt="",uqe="function",qSe="object",o3="prototype",QOt="__proto__",Gz="undefined",sqe="constructor",HOt="Symbol",QTo="_polyfill",$z="length",aqe="name",RA="call",dqe="toString",Nx=a3(Object),GOt=sg(Nx,o3),Vtn=a3(String),Vz=sg(Vtn,o3),jSe=a3(Math),Wtn=a3(Array),fqe=sg(Wtn,o3),s3=sg(fqe,"slice");function ep(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a(ep,"safe");function qTo(t,e){var r=ep(t);return r.e?e:r.v}a(qTo,"safeGet");var wOt;function pqe(t){return function(e){return typeof e===t}}a(pqe,"_createIs");function ztn(t){var e="[object "+t+"]";return function(r){return!!(r&&HSe(r)===e)}}a(ztn,"_createObjIs");function HSe(t){return GOt[dqe].call(t)}a(HSe,"objToString");function Bn(t){return typeof t===Gz||t===Gz}a(Bn,"isUndefined");function jTo(t){return!Eae(t)}a(jTo,"isStrictUndefined");function Xt(t){return t===Vh||Bn(t)}a(Xt,"isNullOrUndefined");function HTo(t){return t===Vh||!Eae(t)}a(HTo,"isStrictNullOrUndefined");function Eae(t){return!!t||t!==NC}a(Eae,"isDefined");function GTo(t){return!wOt&&(wOt=["string","number","boolean",Gz,"symbol","bigint"]),t!==qSe&&wOt.indexOf(t)!==-1}a(GTo,"isPrimitiveType");var vi=pqe("string"),qr=pqe(uqe);function td(t){return!t&&Xt(t)?!1:!!t&&typeof t===qSe}a(td,"isObject");var pr=sg(Wtn,"isArray"),hqe=ztn("Date"),zh=pqe("number"),bP=pqe("boolean");var c3=ztn("Error");function u0(t){return!!(t&&t.then&&qr(t.then))}a(u0,"isPromiseLike");function y1(t){return!(!t||qTo(function(){return!(t&&0+t)},!t))}a(y1,"isTruthy");var vae=sg(Nx,"getOwnPropertyDescriptor");function d0(t,e){return!!t&&GOt.hasOwnProperty[RA](t,e)}a(d0,"objHasOwnProperty");var kA=a3(sg(Nx,"hasOwn"),$To);function $To(t,e){return d0(t,e)||!!vae(t,e)}a($To,"polyObjHasOwn");function Zr(t,e,r){if(t&&td(t)){for(var n in t)if(kA(t,n)&&e[RA](r||t,n,t[n])===-1)break}}a(Zr,"objForEachKey");var nqe={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function VTo(t){var e={};if(e[nqe.c]=!0,e[nqe.e]=!0,t.l){e.get=function(){return t.l.v};var r=vae(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return Zr(t,function(n,o){e[nqe[n]]=jTo(o)?e[nqe[n]]:o}),e}a(VTo,"_createProp");var QE=sg(Nx,"defineProperty"),Ytn=sg(Nx,"defineProperties");function $i(t,e,r){return QE(t,e,VTo(r))}a($i,"objDefine");function Ktn(t,e,r,n,o){var s={};return Zr(t,function(c,l){cqe(s,c,e?l:c),cqe(s,l,r?l:c)}),n?n(s):s}a(Ktn,"_createKeyValueMap");function cqe(t,e,r,n){QE(t,e,{value:r,enumerable:!0,writable:!1})}a(cqe,"_assignMapValue");var ed=a3(Vtn),WTo="[object Error]";function hr(t,e){var r=jOt,n=GOt[dqe][RA](t);n===WTo&&(t={stack:ed(t.stack),message:ed(t.message),name:ed(t.name)});try{r=JSON.stringify(t,Vh,e?typeof e=="number"?e:4:NC),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):Vh)||ed(t)}catch(o){r=" - "+hr(o,e)}return n+": "+r}a(hr,"dumpObj");function ul(t){throw new Error(t)}a(ul,"throwError");function ag(t){throw new TypeError(t)}a(ag,"throwTypeError");var Jtn=sg(Nx,"freeze");function zTo(t){return t}a(zTo,"_doNothing");function YTo(t){return t[QOt]||Vh}a(YTo,"_getProto");var l3=sg(Nx,"assign"),rd=sg(Nx,"keys");function qE(t){return Jtn&&Zr(t,function(e,r){(pr(r)||td(r))&&qE(r)}),Yh(t)}a(qE,"objDeepFreeze");var Yh=a3(Jtn,zTo);var qOt=a3(sg(Nx,"getPrototypeOf"),YTo);function mqe(t){return Ktn(t,1,0,Yh)}a(mqe,"createEnum");function KTo(t){return Ktn(t,0,0,Yh)}a(KTo,"createEnumKeyMap");function JTo(t){var e={};return Zr(t,function(r,n){cqe(e,r,n[1]),cqe(e,n[0],n[1])}),Yh(e)}a(JTo,"createSimpleMap");function $Ot(t){return JTo(t)}a($Ot,"createTypeMap");var Ztn=KTo({asyncIterator:0,hasInstance:1,isConcatSpreadable:2,iterator:3,match:4,matchAll:5,replace:6,search:7,species:8,split:9,toPrimitive:10,toStringTag:11,unscopables:12}),qtn="__tsUtils$gblCfg",ROt;function Xtn(){var t;return typeof globalThis!==Gz&&(t=globalThis),!t&&typeof self!==Gz&&(t=self),!t&&typeof window!==Gz&&(t=window),!t&&typeof global!==Gz&&(t=global),t}a(Xtn,"_getGlobalValue");function ern(){if(!ROt){var t=ep(Xtn).v||{};ROt=t[qtn]=t[qtn]||{}}return ROt}a(ern,"_getGlobalConfig");var Cae=GSe;function GSe(t,e,r){var n=e?e[t]:Vh;return function(o){var s=(o?o[t]:Vh)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?s3[RA](c,1):c)}ag('"'+ed(t)+'" not defined for '+hr(o))}}a(GSe,"_unwrapFunctionWithPoly");function ZTo(t){return function(e){return e[t]}}a(ZTo,"_unwrapProp");var S7=sg(jSe,"min"),SP=sg(jSe,"max"),jtn=Cae("slice",Vz),tp=Cae("substring",Vz),gqe=GSe("substr",Vz,XTo);function XTo(t,e,r){return Xt(t)&&ag("Invalid "+hr(t)),r<0?jOt:(e=e||0,e<0&&(e=SP(e+t[$z],0)),Bn(r)?jtn(t,e):jtn(t,e,e+r))}a(XTo,"polyStrSubstr");function qM(t,e){return tp(t,0,e)}a(qM,"strLeft");var Htn="_urid",kOt;function eIo(){if(!kOt){var t=ern();kOt=t.gblSym=t.gblSym||{k:{},s:{}}}return kOt}a(eIo,"_globalSymbolRegistry");var iqe;function VOt(t){var e={description:ed(t),toString:a(function(){return HOt+"("+t+")"},"toString")};return e[QTo]=!0,e}a(VOt,"polyNewSymbol");function tIo(t){var e=eIo();if(!kA(e.k,t)){var r=VOt(t),n=rd(e.s).length;r[Htn]=function(){return n+"_"+r[dqe]()},e.k[t]=r,e.s[r[Htn]()]=ed(t)}return e.k[t]}a(tIo,"polySymbolFor");function rIo(t){!iqe&&(iqe={});var e,r=Ztn[t];return r&&(e=iqe[r]=iqe[r]||VOt(HOt+"."+r)),e}a(rIo,"polyGetKnownSymbol");var Wh;function T7(){Wh=ern()}a(T7,"_initTestHooks");function Aqe(t){var e={};return!Wh&&T7(),e.b=Wh.lzy,QE(e,"v",{configurable:!0,get:a(function(){var r=t();return Wh.lzy||QE(e,"v",{value:r}),e.b=Wh.lzy,r},"get")}),e}a(Aqe,"getLazy");function _1(t){return QE({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(_1,"createCachedValue");var trn="window",QSe;function yqe(t,e){var r;return function(){return!Wh&&T7(),(!r||Wh.lzy)&&(r=_1(ep(t,e).v)),r.v}}a(yqe,"_getGlobalInstFn");function c_(t){return!Wh&&T7(),(!QSe||t===!1||Wh.lzy)&&(QSe=_1(ep(Xtn).v||Vh)),QSe.v}a(c_,"getGlobal");function Oi(t,e){var r;if(!QSe||e===!1?r=c_(e):r=QSe.v,r&&r[t])return r[t];if(t===trn)try{return window}catch{}return Vh}a(Oi,"getInst");function u3(){return!!bf()}a(u3,"hasDocument");var bf=yqe(Oi,["document"]);function bae(){return!!Sf()}a(bae,"hasWindow");var Sf=yqe(Oi,[trn]);function Wz(){return!!nd()}a(Wz,"hasNavigator");var nd=yqe(Oi,["navigator"]);var rrn=yqe(function(){return!!ep(function(){return process&&(process.versions||{}).node}).v});var _ae,POt;function _qe(){return _ae=_1(ep(Oi,[HOt]).v),_ae}a(_qe,"_initSymbol");function nIo(t){var e=(Wh.lzy?0:_ae)||_qe();return e.v?e.v[t]:NC}a(nIo,"_getSymbolKey");function nrn(){return!!iIo()}a(nrn,"hasSymbol");function iIo(){return!Wh&&T7(),((Wh.lzy?0:_ae)||_qe()).v}a(iIo,"getSymbol");function $Se(t,e){var r=Ztn[t];!Wh&&T7();var n=(Wh.lzy?0:_ae)||_qe();return n.v?n.v[r||t]:e?NC:rIo(t)}a($Se,"getKnownSymbol");function Mx(t,e){!Wh&&T7();var r=(Wh.lzy?0:_ae)||_qe();return r.v?r.v(t):e?Vh:VOt(t)}a(Mx,"newSymbol");function I7(t){return!Wh&&T7(),POt=(Wh.lzy?0:POt)||_1(ep(nIo,["for"]).v),(POt.v||tIo)(t)}a(I7,"symbolFor");function lqe(t){return!!t&&qr(t.next)}a(lqe,"isIterator");function WOt(t){return!HTo(t)&&qr(t[$Se(3)])}a(WOt,"isIterable");var oqe;function Eqe(t,e,r){if(t&&(lqe(t)||(!oqe&&(oqe=_1($Se(3))),t=t[oqe.v]?t[oqe.v]():Vh),lqe(t))){var n=NC,o=NC;try{for(var s=0;!(o=t.next()).done&&e[RA](r||t,o.value,s,t)!==-1;)s++}catch(c){n={e:c},t.throw&&(o=Vh,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(Eqe,"iterForOf");function yae(t,e,r){return t.apply(e,r)}a(yae,"fnApply");function Kh(t,e){return!Bn(e)&&t&&(pr(e)?yae(t.push,t,e):lqe(e)||WOt(e)?Eqe(e,function(r){t.push(r)}):t.push(e)),t}a(Kh,"arrAppend");function Ct(t,e,r){if(t)for(var n=t[$z]>>>0,o=0;o0?r:0;return tp(t,o,o+n[$z])===n}a(_Io,"polyStrStartsWith");var BOt="ref",FOt="unref",UOt="hasRef",EIo="enabled";function vIo(t,e,r){var n=!0,o=t?e(Vh):Vh,s;function c(){return n=!1,o&&o[FOt]&&o[FOt](),s}a(c,"_unref");function l(){o&&r(o),o=Vh}a(l,"_cancel");function u(){return o=e(o),n||c(),s}a(u,"_refresh");function d(f){!f&&o&&l(),f&&!o&&u()}return a(d,"_setEnabled"),s={cancel:l,refresh:u},s[UOt]=function(){return o&&o[UOt]?o[UOt]():n},s[BOt]=function(){return n=!0,o&&o[BOt]&&o[BOt](),s},s[FOt]=c,s=QE(s,EIo,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=Vh},"dn")}}a(vIo,"_createTimerHandler");function YOt(t,e,r){var n=pr(e),o=n?e.length:0,s=(o>0?e[0]:n?NC:e)||setTimeout,c=(o>1?e[1]:NC)||clearTimeout,l=r[0];r[0]=function(){u.dn(),yae(l,NC,s3[RA](arguments))};var u=vIo(t,function(d){if(d){if(d.refresh)return d.refresh(),d;yae(c,NC,[d])}return yae(s,NC,r)},function(d){yae(c,NC,[d])});return u.h}a(YOt,"_createTimeoutWith");function Yp(t,e){return YOt(!0,NC,s3[RA](arguments))}a(Yp,"scheduleTimeout");function lrn(t,e,r){return YOt(!0,t,s3[RA](arguments,1))}a(lrn,"scheduleTimeoutWith");function vqe(t,e){return YOt(!1,NC,s3[RA](arguments))}a(vqe,"createTimeout");var KSe=mqe,KOt=$Ot;p();var TP=KSe({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var IP="toLowerCase",mn="length",Iae="warnToConsole",p3="throwInternal",HM="watch",w7="apply",qi="push",Ox="splice",id="logger",GM="cancel",h3="initialize",$M="identifier",xae="removeNotificationListener",wae="addNotificationListener",MC="isInitialized",JSe="getNotifyMgr",R7="getPlugin",v1="name",cg="processNext",Cqe="getProcessTelContext",m3="value",k7="enabled",JOt="stopPollingInternalLogs",Lx="unload",ZSe="onComplete",bqe="version",Sqe="loggingLevelConsole",VM="createNew",C1="teardown",Rae="messageId",WM="message",OC="diagLog",P7="_doTeardown",Yz="update",b1="getNext",D7="setNextPlugin",XSe="userAgent",Bx="split",xP="replace",e1e="substring",t1e="indexOf",g3="type",ZOt="evtName",wP="status",XOt="getAllResponseHeaders",r1e="isChildEvt",S1="data",Kz="getCtx",RP="setCtx",e5t="itemsReceived",n1e="headers",kae="urlString",Jz="timeout";var Tqe="traceFlags";var t5t;function urn(t,e){t5t||(t5t=WSe("AggregationError",function(n,o){o[mn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` -`.concat(o," > ").concat(hr(n))}),new t5t(r,e||[])}a(urn,"throwAggregationError");p();p();p();var Pae="function",Fx="object",T1="undefined",I1="prototype";var N7=Object,i1e=N7[I1];p();var KBl=(c_()||{}).Symbol,JBl=(c_()||{}).Reflect;var drn="hasOwnProperty",bIo=a(function(t){for(var e,r=1,n=arguments.length;r0)for(var o=0;o=0;r--)if(t[r]===e)return!0;return!1}a(p5t,"_hasVisited");function IIo(t,e,r,n){function o(u,d,f){var h=d[f];if(h[o5t]&&n){var m=u[Dqe]||{};m[o1e]!==!1&&(h=(m[d[Dae]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=jM(null);Nqe(r,function(u){s[u]=o(e,r,u)});for(var c=Xz(t),l=[];c&&!d5t(c)&&!p5t(l,c);)Nqe(c,function(u){!s[u]&&f5t(c,u,!s1e)&&(s[u]=o(e,c,u))}),l.push(c),c=Xz(c);return s}a(IIo,"_getBaseFuncs");function xIo(t,e,r,n){var o=null;if(t&&d0(r,Dae)){var s=t[Dqe]||jM(null);if(o=(s[r[Dae]]||jM(null))[e],o||Mqe("Missing ["+e+"] "+Pqe),!o[s5t]&&s[o1e]!==!1){for(var c=!d0(t,e),l=Xz(t),u=[];c&&l&&!d5t(l)&&!p5t(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=Xz(l)}try{c&&(t[e]=o),o[s5t]=1}catch{s[o1e]=!1}}}return o}a(xIo,"_getInstFunc");function wIo(t,e,r){var n=e[t];return n===r&&(n=Xz(e)[t]),typeof n!==Pqe&&Mqe("["+t+"] is not a "+Pqe),n}a(wIo,"_getProtoFunc");function RIo(t,e,r,n,o){function s(u,d){var f=a(function(){var h=xIo(this,d,u,f)||wIo(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[o5t]=1,f}if(a(s,"_createDynamicPrototype"),!Rqe(t)){var c=r[Dqe]=r[Dqe]||jM(null);if(!Rqe(c)){var l=c[e]=c[e]||jM(null);c[o1e]!==!1&&(c[o1e]=!!o),Rqe(l)||Nqe(r,function(u){f5t(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!d0(t,u)||t[u]&&!t[u][o5t])&&(t[u]=s(t,u)))})}}}a(RIo,"_populatePrototype");function kIo(t,e){if(s1e){for(var r=[],n=Xz(e);n&&!d5t(n)&&!p5t(r,n);){if(n===t)return!0;r.push(n),n=Xz(n)}return!1}return!0}a(kIo,"_checkPrototype");function i5t(t,e){return d0(t,A3)?t.name||e||frn:((t||{})[kqe]||{}).name||e||frn}a(i5t,"_getObjName");function ki(t,e,r,n){d0(t,A3)||Mqe("theClass is an invalid class definition.");var o=t[A3];kIo(o,e)||Mqe("["+i5t(t)+"] not in hierarchy of ["+i5t(e)+"]");var s=null;d0(o,Dae)?s=o[Dae]:(s=SIo+i5t(t,"_")+"$"+c5t.n,c5t.n++,o[Dae]=s);var c=ki[grn],l=!!c[wqe];l&&n&&n[wqe]!==void 0&&(l=!!n[wqe]);var u=TIo(e),d=IIo(o,e,u,l);r(e,d);var f=!!s1e&&!!c[a5t];f&&n&&(f=!!n[a5t]),RIo(o,s,e,u,f!==!1)}a(ki,"dynamicProto");ki[grn]=c5t.o;p();var Lqe="Promise";var v5t="rejected";function Pl(t,e){return Bqe(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:v5t,rejected:!0,reason:r}):r})}a(Pl,"doAwaitResponse");function Bqe(t,e,r,n){var o=t;try{if(u0(t))(e||r)&&(o=t.then(e,r));else try{e&&(o=e(t))}catch(s){if(r)o=r(s);else throw s}}finally{n&&PIo(o,n)}return o}a(Bqe,"doAwait");function PIo(t,e){var r=t;return e&&(u0(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(PIo,"doFinally");var h5t,m5t,g5t,Arn=!1;function DIo(t,e,r,n){h5t=h5t||{toString:a(function(){return"[[PromiseState]]"},"toString")},m5t=m5t||{toString:a(function(){return"[[PromiseResult]]"},"toString")},g5t=g5t||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[h5t]={get:e},o[m5t]={get:r},o[g5t]={get:n},Ytn(t,o)}a(DIo,"_addDebugState$1");var Ern=["pending","resolving","resolved",v5t],yrn="dispatchEvent",Oqe;function NIo(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(NIo,"_hasInitEventFn");function MIo(t,e,r,n){var o=bf();!Oqe&&(Oqe=_1(!!ep(NIo,[o]).v));var s=Oqe.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),Oqe.v&&s.initEvent(e,!1,!0),s&&t[yrn])t[yrn](s);else{var c=t["on"+e];if(c)c(s);else{var l=Oi("console");l&&(l.error||l.log)(e,hr(s))}}}a(MIo,"emitEvent");var vrn="unhandledRejection",OIo=vrn.toLowerCase(),a1e=[],LIo=0,BIo=10;var A5t;function _rn(t){return qr(t)?t.toString():hr(t)}a(_rn,"dumpFnObj");function Crn(t,e,r){var n=x7(arguments,3),o=0,s=!1,c,l=[],u=LIo++,d=a1e.length>0?a1e[a1e.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{a1e.push(u),f=!0,h&&h.cancel(),h=null;var x=t(function(k,D){l.push(function(){try{var N=o===2?w:R,O=Bn(N)?c:qr(N)?N(c):N;u0(O)?O.then(k,D):N?k(O):o===3?D(O):k(O)}catch(B){D(B)}}),s&&E()},n);return x}finally{a1e.pop()}}a(g,"_then");function A(w){return g(void 0,w)}a(A,"_catch");function y(w){var R=w,x=w;return qr(w)&&(R=a(function(k){return w&&w(),k},"thenFinally"),x=a(function(k){throw w&&w(),k},"catchFinally")),g(R,x)}a(y,"_finally");function _(){return Ern[o]}a(_,"_strState");function E(){if(l.length>0){var w=l.slice();l=[],f=!0,h&&h.cancel(),h=null,e(w)}}a(E,"_processQueue");function v(w,R){return function(x){if(o===R){if(w===2&&u0(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,E(),!f&&w===3&&!h&&(h=Yp(S,BIo))}}}a(v,"_createSettleIfFn");function S(){if(!f)if(f=!0,rrn())process.emit(vrn,c,m);else{var w=Sf()||c_();!A5t&&(A5t=_1(ep(Oi,[Lqe+"RejectionEvent"]).v)),MIo(w,OIo,function(R){return $i(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!A5t.v)}}a(S,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},QE(m,"state",{get:_}),Arn&&DIo(m,_,function(){return HSe(c)},function(){return f}),nrn()&&(m[$Se(11)]="IPromise");function T(){return"IPromise"+(Arn?"["+u+(Bn(d)?"":":"+d)+"]":"")+" "+_()+(s?" - "+_rn(c):"")}return a(T,"_toString"),m.toString=T,a((function(){qr(r)||ag(Lqe+": executor is not a function - "+_rn(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(Crn,"_createPromise");function FIo(t){return function(e){var r=x7(arguments,1);return t(function(n,o){try{var s=[],c=1;Eqe(e,function(l,u){l&&(c++,Bqe(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a(FIo,"_createAllPromise");function UIo(t){return _1(function(e){var r=x7(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,Pl(u,function(f){f.rejected?s[d]={status:v5t,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{pr(e)?Ct(e,l):WOt(e)?Eqe(e,l):ag("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(UIo,"_createAllSettledPromise");function brn(t){Ct(t,function(e){try{e()}catch{}})}a(brn,"syncItemProcessor");function QIo(t){var e=zh(t)?t:0;return function(r){Yp(function(){brn(r)},e)}}a(QIo,"timeoutItemProcessor");function Srn(t,e){return Crn(Srn,QIo(e),t,e)}a(Srn,"createAsyncPromise");var y5t;function qIo(t,e){!y5t&&(y5t=_1(ep(Oi,[Lqe]).v||null));var r=y5t.v;if(!r)return Srn(t);qr(t)||ag(Lqe+": executor is not a function - "+hr(t));var n=0;function o(){return Ern[n]}a(o,"_strState");var s=new r(function(c,l){function u(f){n=2,c(f)}a(u,"_resolve");function d(f){n=3,l(f)}a(d,"_reject"),t(u,d)});return QE(s,"state",{get:o}),s}a(qIo,"createNativePromise");var _5t;function c1e(t){return Crn(c1e,brn,t)}a(c1e,"createSyncPromise");function Fqe(t,e){return!_5t&&(_5t=UIo(c1e)),_5t.v(t,e)}a(Fqe,"createSyncAllSettledPromise");var E5t;function $d(t,e){return!E5t&&(E5t=_1(qIo)),E5t.v.call(this,t,e)}a($d,"createPromise");var Uqe=FIo($d);var k3l=$Se(11);p();p();p();p();var x1=void 0,Io="",eY="channels",rp="core",Qqe="createPerfMgr",l1e="disabled",y3="extensionConfig",tY="extensions",LC="processTelemetry",rY="priority",Nae="eventsSent",M7="eventsDiscarded",Mae="eventsSendRequest",zM="perfEvent",qqe="offlineEventsStored",jqe="offlineBatchSent",Hqe="offlineBatchDrop",Oae="getPerfMgr",Gqe="domain",$qe="path",Trn="Not dynamic - ",Irn="REDACTED",C5t=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var jIo="getPrototypeOf",HIo=/-([a-z])/g,GIo=/([^\w\d_$])/g,$Io=/^(\d+[\w\d_$])/,Q3l=Object[jIo];function O7(t){return!Xt(t)}a(O7,"isNotNullOrUndefined");function u1e(t){var e=t;return e&&vi(e)&&(e=e[xP](HIo,function(r,n){return n.toUpperCase()}),e=e[xP](GIo,"_"),e=e[xP]($Io,function(r,n){return"_"+n})),e}a(u1e,"normalizeJsName");function lg(t,e){return t&&e?vu(t,e)!==-1:!1}a(lg,"strContains");function L7(t){return t&&t.toISOString()||""}a(L7,"toISOString");function Kp(t){return c3(t)?t[v1]:Io}a(Kp,"getExceptionName");function YM(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(YM,"setValue");function b5t(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Bn(r)?{}:r,t[e]=n)):n=Bn(r)?{}:r,n}a(b5t,"getSetValue");function VIo(t,e){var r=null,n=null;return qr(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][w7](n,o)}}a(VIo,"_createProxyFunction");function nY(t,e,r,n,o){t&&e&&r&&(o!==!1||Bn(t[e]))&&(t[e]=VIo(r,n))}a(nY,"proxyFunctionAs");function iY(t,e,r,n){return t&&e&&td(t)&&pr(r)&&Ct(r,function(o){vi(o)&&nY(t,o,e,o,n)}),t}a(iY,"proxyFunctions");function S5t(t){return(function(){function e(){var r=this;t&&Zr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(S5t,"createClassFromInterface");function Wqe(t){return t&&l3&&(t=N7(l3({},t))),t}a(Wqe,"optimizeObject");function zqe(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[mn],d=!1,f=1;for(u>0&&bP(l)&&(d=l,l=c[f]||{},f++),td(l)||(l={});f>>=0),m1e=Mrn+t&sY,g1e=Orn-t&sY,Lrn=!0}a(sxo,"_mwcSeed");function axo(){try{var t=kl()&2147483647;sxo((Math.random()*Nrn^t)+t)}catch{}}a(axo,"_autoSeedMwc");function Drn(t){var e=0,r=N5t()||M5t();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&sY),e===0&&Fae()&&(Lrn||axo(),e=cxo()&sY),e===0&&(e=E1(Nrn*Math.random()|0)),t||(e>>>=0),e}a(Drn,"random32");function cxo(t){g1e=36969*(g1e&65535)+(g1e>>16)&sY,m1e=18e3*(m1e&65535)+(m1e>>16)&sY;var e=(g1e<<16)+(m1e&65535)>>>0&sY|0;return t||(e>>>=0),e}a(cxo,"mwcRandom32");function Brn(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=Drn()>>>0,n=0,o=Io;o[mn]>>=6,n===5&&(r=(Drn()<<2&4294967295|r&3)>>>0,n=0);return o}a(Brn,"newId");var Frn="3.3.11",lxo="."+Brn(6),uxo=0;function Urn(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(Urn,"_canAcceptData");function dxo(t,e){var r=e[t.id];if(!r){r={};try{Urn(e)&&$i(e,t.id,{e:!1,v:r})}catch{}}return r}a(dxo,"_getCache");function w1(t,e){return e===void 0&&(e=!1),u1e(t+uxo+++(e?"."+Frn:Io)+lxo)}a(w1,"createUniqueNamespace");function Jqe(t){var e={id:w1("_aiData-"+(t||Io)+"."+Frn),accept:a(function(r){return Urn(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[u1e(n)]:(s&&(c=dxo(e,r),c[u1e(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(Jqe,"createElmNodeData");p();function Zqe(t){return t&&td(t)&&!pr(t)&&(t.isVal||t.fb||kA(t,"v")||kA(t,"mrg")||kA(t,"ref")||t.set)}a(Zqe,"_isConfigDefaults");function Qrn(t,e,r){var n,o=r.dfVal||Eae;if(e&&r.fb){var s=r.fb;pr(s)||(s=[s]);for(var c=0;c0&&urn("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[mn]>0){c||(c=[]),l||(l=Yp(function(){l=null,f()},0));for(var A=0;A0?Pl(_3(t[0],e),function(){nje(x7(t,1),e,r)}):r(),n}a(nje,"doUnloadAll");p();var $rn=500,Q5t="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function _xo(t,e,r){return!t&&Xt(t)?e:bP(t)?t:ed(t)[IP]()==="true"}a(_xo,"_stringToBoolOrDefault");function q5t(t){return{mrg:!0,v:t}}a(q5t,"cfgDfMerge");function Qae(t,e,r){return{fb:r,isVal:t,v:e}}a(Qae,"cfgDfValidate");function qx(t,e){return{fb:e,set:_xo,v:!!t}}a(qx,"cfgDfBoolean");p();p();var j5t=[Nae,M7,Mae,zM],oje=null,ije;function Exo(t,e){return function(){var r=arguments,n=H5t(e);if(n){var o=n.listener;o&&o[t]&&o[t][w7](o,r)}}}a(Exo,"_listenerProxyFunc");function vxo(){var t=Oi("Microsoft");return t&&(oje=t.ApplicationInsights),oje}a(vxo,"_getExtensionNamespace");function H5t(t){var e=oje;return!e&&t.disableDbgExt!==!0&&(e=oje||vxo()),e?e.ChromeDbgExt:null}a(H5t,"getDebugExt");function Vrn(t){if(!ije){ije={};for(var e=0;e=A&&(d[T](S[WM]),n[w]=!0)}else o>=A&&d[T](S[WM]);f(A,S)}},d.debugToConsole=function(A){G5t("debug",A),g("warning",A)},d[Iae]=function(A){G5t("warn",A),g("warning",A)},d.errorToConsole=function(A){G5t("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[Lx]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var _=!0,E=Sxo+y[Rae];if(n[E]?_=!1:n[E]=!0,_&&(A<=s&&(d.queue[qi](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",S=new C1e(23,v,!1);d.queue[qi](S),A===1?d.errorToConsole(v):d[Iae](v)}}}a(f,"_logInternalMessage");function h(A){return Qx(Jh(A,Txo,d).cfg,function(y){var _=y.cfg;o=_[Sqe],s=_.loggingLevelTelemetry,c=_.maxMessageLimit,l=_.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var _=H5t(e||{});_&&_[OC]&&_[OC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function Yrn(t){return t||new jae}a(Yrn,"_getLogger");function Jr(t,e,r,n,o,s){s===void 0&&(s=!1),Yrn(t)[p3](e,r,n,o,s)}a(Jr,"_throwInternal");function E3(t,e){Yrn(t)[Iae](e)}a(E3,"_warnToConsole");var $5t,U7,Krn="toGMTString",Jrn="toUTCString",Y5t="cookie",V5t="expires",Zrn="isCookieUseDisabled",b1e="disableCookiesUsage",Xrn="_ckMgr",sje=null,W5t=null,enn=null,JM,tnn={},rnn={},xxo=($5t={cookieCfg:q5t((U7={},U7[Gqe]={fb:"cookieDomain",dfVal:O7},U7.path={fb:"cookiePath",dfVal:O7},U7.enabled=x1,U7.ignoreCookies=x1,U7.blockedCookies=x1,U7.disableCookieDefer=!1,U7)),cookieDomain:x1,cookiePath:x1},$5t[b1e]=x1,$5t);function K5t(){!JM&&(JM=Aqe(function(){return bf()}))}a(K5t,"_getDoc");function aje(t){return t?t.isEnabled():!0}a(aje,"_isMgrEnabled");function cnn(t,e){return e&&t&&pr(t.ignoreCookies)?Jo(t.ignoreCookies,e)!==-1:!1}a(cnn,"_isIgnoredCookie");function nnn(t,e){return e&&t&&pr(t.blockedCookies)&&Jo(t.blockedCookies,e)!==-1?!0:cnn(t,e)}a(nnn,"_isBlockedCookie");function inn(t,e){var r=e[k7];if(Xt(r)){var n=void 0;Bn(t[Zrn])||(n=!t[Zrn]),Bn(t[b1e])||(n=!t[b1e]),r=n}return r}a(inn,"_isCfgEnabled");function lnn(t,e){var r,n,o,s,c,l,u,d,f=[];function h(_){var E,v=(E={},E[$qe]=_||"/",E[V5t]="Thu, 01 Jan 1970 00:00:01 GMT",E);return Fae()||(v["max-age"]="0"),snn(Io,v)}a(h,"_formatDeletionValue");function m(_,E,v,S){var T={},w=Li(_||Io),R=vu(w,";");if(R!==-1&&(w=Li(qM(_,R)),T=unn(tp(_,R+1))),YM(T,Gqe,v||o,y1,Bn),!Xt(E)){var x=Fae();if(Bn(T[V5t])){var k=kl(),D=k+E*1e3;if(D>0){var N=new Date;N.setTime(D),YM(T,V5t,onn(N,x?Krn:Jrn)||onn(N,x?Krn:Jrn)||Io,y1)}}x||YM(T,"max-age",Io+E,null,Bn)}var O=p1e();return O&&O.protocol==="https:"&&(YM(T,"secure",null,null,Bn),W5t===null&&(W5t=!Rxo((nd()||{})[XSe])),W5t&&YM(T,"SameSite","None",null,Bn)),YM(T,$qe,S||n,null,Bn),snn(w,T)}a(m,"_formatSetCookieValue");function g(_){if(f)for(var E=f[mn]-1;E>=0;E--)f[E].n===_&&f[Ox](E,1)}a(g,"_removePendingCookie");function A(){z5t(e)&&f&&(Ct(f,function(_){nnn(r,_.n)||(_.o===0?u(_.n,_.v):_.o===1&&d(_.n,_.v))}),f=[])}a(A,"_flushPendingCookies"),t=Jh(t||rnn,null,e).cfg,s=Qx(t,function(_){_.setDf(_.cfg,xxo),r=_.ref(_.cfg,"cookieCfg"),n=r[$qe]||"/",o=r[Gqe],r.disableCookieDefer?f=null:f===null&&(f=[]);var E=c;c=inn(t,r)!==!1,l=r.getCookie||wxo,u=r.setCookie||ann,d=r.delCookie||ann,!E&&c&&f&&A()},e);var y={isEnabled:a(function(){var _=inn(t,r)!==!1&&c&&z5t(e),E=rnn[Xrn];return _&&E&&y!==E&&(_=aje(E)),_},"isEnabled"),setEnabled:a(function(_){r[k7]=_,Bn(t[b1e])||(t[b1e]=!_)},"setEnabled"),set:a(function(_,E,v,S,T){var w=!1,R=nnn(r,_);if(!R){var x=m(E,v,S,T);aje(y)?(u(_,x),w=!0):f&&(g(_),f[qi]({n:_,o:0,v:x}),w=!0)}return w},"set"),get:a(function(_){var E=Io,v=cnn(r,_);if(!v){if(aje(y))E=l(_);else if(f)for(var S=f[mn]-1;S>=0;S--){var T=f[S];if(T.n===_){if(T.o===0){var w=T.v,R=vu(w,";");E=R!==-1?Li(qM(w,R)):Li(w)}break}}}return E},"get"),del:a(function(_,E){var v=!1;return aje(y)?v=y.purge(_,E):f&&(g(_),f[qi]({n:_,o:1,v:h(E)}),v=!0),v},"del"),purge:a(function(_,E){var v=!1;return z5t(e)&&(d(_,h(E)),v=!0),v},"purge"),unload:a(function(_){s&&s.rm(),s=null,f=null},"unload")};return y[Xrn]=y,y}a(lnn,"createCookieMgr");function z5t(t){if(sje===null){sje=!1,!JM&&K5t();try{var e=JM.v||{};sje=e[Y5t]!==void 0}catch(r){Jr(t,2,68,"Cannot access document.cookie - "+Kp(r),{exception:hr(r)})}}return sje}a(z5t,"areCookiesSupported");function unn(t){var e={};if(t&&t[mn]){var r=Li(t)[Bx](";");Ct(r,function(n){if(n=Li(n||Io),n){var o=vu(n,"=");o===-1?e[n]=null:e[Li(qM(n,o))]=Li(tp(n,o+1))}})}return e}a(unn,"_extractParts");function onn(t,e){return qr(t[e])?t[e]():null}a(onn,"_formatDate");function snn(t,e){var r=t||Io;return Zr(e,function(n,o){r+="; "+n+(Xt(o)?Io:"="+o)}),r}a(snn,"_formatCookieValue");function wxo(t){var e=Io;if(!JM&&K5t(),JM.v){var r=JM.v[Y5t]||Io;enn!==r&&(tnn=unn(r),enn=r),e=Li(tnn[t]||Io)}return e}a(wxo,"_getCookieValue");function ann(t,e){!JM&&K5t(),JM.v&&(JM.v[Y5t]=t+"="+e)}a(ann,"_setCookieValue");function Rxo(t){return vi(t)?!!(lg(t,"CPU iPhone OS 12")||lg(t,"iPad; CPU OS 12")||lg(t,"Macintosh; Intel Mac OS X 10_14")&&lg(t,"Version/")&&lg(t,"Safari")||lg(t,"Macintosh; Intel Mac OS X 10_14")&&f3(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||lg(t,"Chrome/5")||lg(t,"Chrome/6")||lg(t,"UnrealEngine")&&!lg(t,"Chrome")||lg(t,"UCBrowser/12")||lg(t,"UCBrowser/11")):!1}a(Rxo,"uaDisallowsSameSiteNone");p();var kxo={perfEvtsSendAll:!1};function Pxo(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){ep(r.fn,[r.arg])})}a(Pxo,"_runScheduledListeners");function Q7(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[qi]({fn:n,arg:o}),r.h=r.h||Yp(Pxo,0,r)):ep(n,[o]))})}a(Q7,"_runListeners");var dnn=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Jh(e,kxo);n=c[HM](function(l){r=!!l.cfg.perfEvtsSendAll}),ki(t,this,function(l){$i(l,"listeners",{g:a(function(){return o},"g")}),l[wae]=function(u){o[qi](u)},l[xae]=function(u){for(var d=Jo(o,u);d>-1;)o[Ox](d,1),d=Jo(o,u)},l[Nae]=function(u){Q7(o,Nae,s,function(d){d[Nae](u)})},l[M7]=function(u,d,f){Q7(o,M7,s,function(h){h[M7](u,d,f)})},l[Mae]=function(u,d){Q7(o,Mae,d?s:null,function(f){f[Mae](u,d)})},l[zM]=function(u){u&&(r||!u[r1e]())&&Q7(o,zM,null,function(d){u.isAsync?Yp(function(){return d[zM](u)},0):d[zM](u)})},l[qqe]=function(u){u&&u[mn]&&Q7(o,qqe,s,function(d){d[qqe](u)})},l[jqe]=function(u){u&&u[S1]&&Q7(o,jqe,s,function(d){d[jqe](u)})},l[Hqe]=function(u,d){if(u>0){var f=d||0;Q7(o,Hqe,s,function(h){h[Hqe](u,f)})}},l[Lx]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[GM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(Q7(o,"unload",null,function(h){var m=h[Lx](u);m&&(f||(f=[]),f[qi](m))}),f)return $d(function(h){return Pl(Uqe(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Hae="ctx",Z5t="ParentContextKey",S1e="ChildrenContextKey",Dxo=null,cje=(function(){function t(e,r,n){var o=this;if(o.start=kl(),o[v1]=e,o.isAsync=n,o[r1e]=function(){return!1},qr(r)){var s;$i(o,"payload",{g:a(function(){return!s&&qr(r)&&(s=r(),r=null),s},"g")})}o[Kz]=function(c){return c?c===t[Z5t]||c===t[S1e]?o[c]:(o[Hae]||{})[c]:null},o[RP]=function(c,l){if(c)if(c===t[Z5t])o[c]||(o[r1e]=function(){return!0}),o[c]=l;else if(c===t[S1e])o[c]=l;else{var u=o[Hae]=o[Hae]||{};u[c]=l}},o.complete=function(){var c=0,l=o[Kz](t[S1e]);if(pr(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(_){Jr(r[id],2,73,"Unexpected Exception during onComplete - "+hr(_))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,_=e.cfg;if(_&&g){var E=_[y3];!E&&A&&(E={}),_[y3]=E,E=e.ref(_,y3),E&&(y=E[g],!y&&A&&(y={}),E[g]=y,y=e.ref(E,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&Zr(A,function(_,E){if(Xt(y[_])){var v=e.cfg[_];(v||!Xt(v))&&(y[_]=v)}A1e(e,y,_,E)}),e.setDf(y,A)}a(f,"_resolveExtCfg");function h(g,A,y){y===void 0&&(y=!1);var _,E=d(g,!1),v=e.cfg;return E&&(E[A]||!Xt(E[A]))?_=E[A]:(v[A]||!Xt(v[A]))&&(_=v[A]),_||!Xt(_)?_:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[R7]();y&&g(y)}}return a(m,"_iterateChain"),c}a(r4t,"_createInternalContext");function kP(t,e,r,n){var o=Jh(e),s=r4t(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[LC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),pr(d)&&(d=q7(d,o.cfg,r,f)),kP(d||c[b1](),o.cfg,r,f)}return a(u,"_createNew"),c[cg]=l,c[VM]=u,c}a(kP,"createProcessTelemetryContext");function Gae(t,e,r){var n=Jh(e.config),o=r4t(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[Lx](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),pr(u)&&(u=q7(u,n.cfg,e,d)),Gae(u||s[b1](),e,d)}return a(l,"_createNew"),s[cg]=c,s[VM]=l,s}a(Gae,"createProcessTelemetryUnloadContext");function T1e(t,e,r){var n=Jh(e.config),o=r4t(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){qr(d[Yz])&&d[Yz](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),pr(u)&&(u=q7(u,n.cfg,e,d)),T1e(u||s[b1](),e,d)}return a(l,"_createNew"),s[cg]=c,s[VM]=l,s}a(T1e,"createProcessTelemetryUpdateContext");function q7(t,e,r,n){var o=null,s=!n;if(pr(t)&&t[mn]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&qr(l[LC])){var u=Fxo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?q7([n],e,r):o}a(q7,"createTelemetryProxyChain");function Fxo(t,e,r){var n=null,o=qr(t[LC]),s=qr(t[D7]),c;t?c=t[$M]+"-"+t[rY]+"-"+ynn++:c="Unknown-0-"+ynn++;var l={getPlugin:a(function(){return t},"getPlugin"),getNext:a(function(){return n},"getNext"),processTelemetry:f,unload:h,update:m,_id:c,_setNext:a(function(g){n=g},"_setNext")};function u(){var g;return t&&qr(t[Ann])&&(g=t[Ann]()),g||(g=kP(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,_,E){var v=!1,S=t?t[$M]:Lxo,T=g[gnn];return T||(T=g[gnn]={}),g.setNext(n),t&&lje(g[rp](),function(){return S+":"+y},function(){T[c]=!0;try{var w=n?n._id:Io;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Jr(g[OC](),1,73,"Plugin ["+S+"] failed during "+y+" - "+hr(x)+", run flags: "+hr(T))}},_,E),v}a(d,"_processChain");function f(g,A){A=A||u();function y(_){if(!t||!o)return!1;var E=v3(t);return E[C1]||E[l1e]?!1:(s&&t[D7](n),t[LC](g,_),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[cg](g)}a(f,"_processTelemetry");function h(g,A){function y(){var _=!1;if(t){var E=v3(t),v=t[rp]||E[rp];t&&(!v||v===g.core())&&!E[C1]&&(E[rp]=null,E[C1]=!0,E[MC]=!1,t[C1]&&t[C1](g,A)===!0&&(_=!0))}return _}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[cg](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var _=!1;if(t){var E=v3(t),v=t[rp]||E[rp];t&&(!v||v===g.core())&&!E[C1]&&t[Yz]&&t[Yz](g,A)===!0&&(_=!0)}return _}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[cg](A)}return a(m,"_updatePlugin"),Yh(l)}a(Fxo,"createTelemetryPluginProxy");var Uxo=(function(){function t(e,r,n,o){var s=this,c=kP(e,r,n,o);iY(s,c,rd(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function dje(){var t=[];function e(n){n&&t[qi](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){Jr(n[OC](),2,73,"Unexpected error calling unload handler - "+hr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(dje,"createUnloadHandlerContainer");p();var fje,pje;function hje(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Jr(n,2,73,"Unloading:"+hr(c))}}),fje&&o[mn]>fje&&(pje?pje("doUnload",o):Jr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Kh(t,n),fje&&t[mn]>fje&&(pje?pje("Add",t):Jr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected.")))}return a(r,"_addHook"),{run:e,add:r}}a(hje,"createUnloadHookContainer");var n4t,j7="getPlugin",Qxo=(n4t={},n4t[y3]={isVal:O7,v:{}},n4t),I1e=(function(){function t(){var e=this,r,n,o,s,c;d(),ki(t,e,function(f){f[h3]=function(h,m,g,A){u(h,m,A),r=!0},f[C1]=function(h,m){var g=f[rp];if(!g||h&&g!==h[rp]())return;var A,y=!1,_=h||Gae(null,g,o&&o[j7]?o[j7]():o),E=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(_,m),c.run(_[OC]()),A===!0&&_[cg](E),d())}return a(v,"_unloadCallback"),!f[P7]||f[P7](_,E,v)!==!0?v():A=!0,A},f[Yz]=function(h,m){var g=f[rp];if(!g||h&&g!==h[rp]())return;var A,y=!1,_=h||T1e(null,g,o&&o[j7]?o[j7]():o),E=m||{reason:0};function v(){y||(y=!0,u(_.getCfg(),_.core(),_[b1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(_,E,v)!==!0?v():A=!0,A},nY(f,"_addUnloadCb",function(){return s},"add"),nY(f,"_addHook",function(){return c},"add"),$i(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[OC]=function(f){return l(f)[OC]()},e[MC]=function(){return r},e.setInitialized=function(f){r=f},e[D7]=function(f){o=f},e[cg]=function(f,h){h?h[cg](f):o&&qr(o[LC])&&o[LC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||kP(null,{},e[rp]);o&&o[j7]?h=m[VM](null,o[j7]):h=m[VM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Jh(f,Qxo,aY(h)),!m&&h&&(m=h[Cqe]()[b1]());var g=o;o&&o[j7]&&(g=o[j7]()),e[rp]=h,n=kP(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[rp]=null,n=null,o=null,c=hje(),s=dje()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function qxo(t,e,r){var n={id:e,fn:r};Kh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[Ox](c,1),-1})},"remove")};return o}a(qxo,"_addInitializer");function jxo(t,e,r){for(var n=!1,o=t[mn],s=0;s"},"v")})}a(Zxo,"_createUnloadHook");var s4t=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S,T,w,R,x,k,D,N,O,B,q,M,L,U,j;ki(t,this,function(Q){re(),Q._getDbgPlgTargets=function(){return[x,o]},Q[MC]=function(){return r},Q.activeStatus=function(){return N},Q._setPendingStatus=function(){N=3},Q[h3]=function(ne,ue,Ne,xe){g&&ul(Enn),Q[MC]()&&ul("Core cannot be initialized more than once"),e=Jh(ne,i4t,Ne||Q[id],!1),ne=e.cfg,Be(e[HM](function(st){var vt=st.cfg;B=vt.initInMemoMaxSize||$xo,Y(vt);var Pt=st.ref(st.cfg,y3);Zr(Pt,function(Ht){st.ref(Pt,Ht)})})),s=xe,S=Jxo(e,v,s&&Q[JSe](),S),K(),Q[id]=Ne;var Fe=ne[tY];if(f=[],f[qi].apply(f,Zz(Zz([],ue,!1),Fe,!1)),h=ne[eY],Le(null),(!m||m[mn]===0)&&ul("No "+eY+" available"),h&&h[mn]>1){var tt=Q[R7]("TeeChannelController");(!tt||!tt.plugin)&&Jr(n,1,28,"TeeChannel required")}Kxo(ne,R,n),R=null,r=!0,N===TP.ACTIVE&&z()},Q.getChannels=function(){var ne=[];return m&&Ct(m,function(ue){ne[qi](ue)}),Yh(ne)},Q.track=function(ne){lje(Q[Oae](),function(){return"AppInsightsCore:track"},function(){ne===null&&(de(ne),ul("Invalid telemetry item")),!ne[v1]&&Xt(ne[v1])&&(de(ne),ul("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||L7(new Date),ne.ver=ne.ver||"4.0",!g&&Q[MC]()&&N===TP.ACTIVE?le()[cg](ne):N!==TP.INACTIVE&&o[mn]<=B&&o[qi](ne)},function(){return{item:ne}},!ne.sync)},Q[Cqe]=le,Q[JSe]=function(){return s||(s=new dnn(e.cfg),Q[Hxo]=s),s},Q[wae]=function(ne){Q.getNotifyMgr()[wae](ne)},Q[xae]=function(ne){s&&s[xae](ne)},Q.getCookieMgr=function(){return u||(u=lnn(e.cfg,Q[id])),u},Q.setCookieMgr=function(ne){u!==ne&&(_3(u,!1),u=ne)},Q[Oae]=function(){return c||l||pnn()},Q.setPerfMgr=function(ne){c=ne},Q.eventCnt=function(){return o[mn]},Q.releaseQueue=function(){if(r&&o[mn]>0){var ne=o;o=[],N===2?Ct(ne,function(ue){ue.iKey=ue.iKey||w,le()[cg](ue)}):Jr(n,2,20,"core init status is not active")}},Q.pollInternalLogs=function(ne){return y=ne||null,j=!1,L&&L[GM](),ie(!0)};function Y(ne){var ue=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Xt(ue)){w=null,N=TP.INACTIVE;var xe="Please provide instrumentation key";r?(Jr(n,1,100,xe),z()):ul(xe);return}var Fe=[];u0(ue)?(Fe[qi](ue),w=null):w=ue,u0(Ne)?(Fe[qi](Ne),O=null):O=Ne,Fe[mn]?W(ne,Fe):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ue){q=!1,N=3;var Ne=O7(ne.initTimeOut)?ne.initTimeOut:Vxo,xe=Fqe(ue);M&&M[GM](),M=Yp(function(){M=null,q||V()},Ne),Pl(xe,function(Fe){try{if(q)return;if(!Fe.rejected){var tt=Fe[m3];if(tt&&tt[mn]){var st=tt[0];if(w=st&&st[m3],tt[mn]>1){var vt=tt[1];O=vt&&vt[m3]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=O)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=TP.INACTIVE,Jr(n,1,112,"ikey can't be resolved from promises")):N=TP.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(Q.releaseQueue(),Q.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!L||!L[k7])&&!j){var ue=ne||n&&n.queue[mn]>0;ue&&(U||(U=!0,Be(e[HM](function(Ne){var xe=Ne.cfg.diagnosticLogInterval;(!xe||!(xe>0))&&(xe=1e4);var Fe=!1;L&&(Fe=L[k7],L[GM]()),L=vqe(te,xe),L.unref(),L[k7]=Fe}))),L[k7]=!0)}return L}a(ie,"_startLogPoller"),Q[JOt]=function(){j=!0,L&&L[GM](),te()},iY(Q,function(){return A},["addTelemetryInitializer"]),Q[Lx]=function(ne,ue,Ne){ne===void 0&&(ne=!0),r||ul(Gxo),g&&ul(Enn);var xe={reason:50,isAsync:ne,flushComplete:!1},Fe;ne&&!ue&&(Fe=$d(function(vt){ue=vt}));var tt=Gae(Oe(),Q);tt[ZSe](function(){v.run(Q[id]),nje([u,s,n],ne,function(){re(),ue&&ue(xe)})},Q);function st(vt){xe.flushComplete=vt,g=!0,E.run(tt,xe),Q[JOt](),tt[cg](xe)}return a(st,"_doUnload"),te(),ee(ne,st,6,Ne)||st(!1),Fe},Q[R7]=me,Q.addPlugin=function(ne,ue,Ne,xe){if(!ne){xe&&xe(!1),X(bnn);return}var Fe=me(ne[$M]);if(Fe&&!ue){xe&&xe(!1),X("Plugin ["+ne[$M]+"] is already loaded!");return}var tt={reason:16};function st(Ht){f[qi](ne),tt.added=[ne],Le(tt),xe&&xe(!0)}if(a(st,"_addPlugin"),Fe){var vt=[Fe.plugin],Pt={reason:2,isAsync:!!Ne};Te(vt,Pt,function(Ht){Ht?(tt.removed=vt,tt.reason|=32,st(!0)):xe&&xe(!1)})}else st(!1)},Q.updateCfg=function(ne,ue){ue===void 0&&(ue=!0);var Ne;if(Q[MC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Sae({},e.cfg),newConfig:Sae({},ne),merge:ue},ne=Ne.newConfig;var xe=e.cfg;ne[tY]=xe[tY],ne[eY]=xe[eY]}e._block(function(Fe){var tt=Fe.cfg;o4t(Fe,tt,ne,ue),ue||Zr(tt,function(st){kA(ne,st)||Fe.set(tt,st,x1)}),Fe.setDf(tt,i4t)},!0),e.notify(),Ne&&he(Ne)},Q.evtNamespace=function(){return _},Q.flush=ee,Q.getTraceCtx=function(ne){return T||(T=mnn()),T},Q.setTraceCtx=function(ne){T=ne||null},Q.addUnloadHook=Be,nY(Q,"addUnloadCb",function(){return E},"add"),Q.onCfgChange=function(ne){var ue;return r?ue=Qx(e.cfg,ne,Q[id]):ue=Yxo(R,ne),Zxo(ue)},Q.getWParam=function(){return u3()||e.cfg.enableWParam?0:-1};function H(){var ne={};k=[];var ue=a(function(Ne){Ne&&Ct(Ne,function(xe){if(xe[$M]&&xe[bqe]&&!ne[xe.identifier]){var Fe=xe[$M]+"="+xe[bqe];k[qi](Fe),ne[xe.identifier]=xe}})},"_addPluginVersions");ue(m),h&&Ct(h,function(Ne){ue(Ne)}),ue(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Jh({},i4t,Q[id]),e.cfg[Sqe]=1,$i(Q,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ue){Q.updateCfg(ue,!1)},"s")}),$i(Q,"pluginVersionStringArr",{g:a(function(){return k||H(),k},"g")}),$i(Q,"pluginVersionString",{g:a(function(){return D||(k||H(),D=k.join(";")),D||Io},"g")}),$i(Q,"logger",{g:a(function(){return n||(n=new jae(e.cfg),e[id]=n),n},"g"),s:a(function(ue){e[id]=ue,n!==ue&&(_3(n,!1),n=ue)},"s")}),Q[id]=new jae(e.cfg),x=[];var ne=Q.config[tY]||[];ne.splice(0,ne[mn]),Kh(ne,x),A=new _nn,o=[],_3(s,!1),s=null,c=null,l=null,_3(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,_=w1("AIBaseCore",!0),E=dje(),T=null,w=null,v=hje(),R=[],D=null,k=null,j=!1,L=null,U=!1,N=0,O=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=kP(Oe(),e.cfg,Q);return ne[ZSe](ie),ne}a(le,"_createTelCtx");function Le(ne){var ue=zxo(Q[id],$rn,f);d=null,D=null,k=null,m=(h||[])[0]||[],m=uje(Kh(m,ue[eY]));var Ne=Kh(uje(ue[rp]),m);x=Yh(Ne);var xe=Q.config[tY]||[];xe.splice(0,xe[mn]),Kh(xe,x);var Fe=le();m&&m[mn]>0&&t4t(Fe[VM](m),Ne),t4t(Fe,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function me(ne){var ue=null,Ne=null,xe=[];return Ct(x,function(Fe){if(Fe[$M]===ne&&Fe!==A)return Ne=Fe,-1;Fe.getChannel&&xe[qi](Fe)}),!Ne&&xe[mn]>0&&Ct(xe,function(Fe){if(Ne=Fe.getChannel(ne),!Ne)return-1}),Ne&&(ue={plugin:Ne,setEnabled:a(function(Fe){v3(Ne)[l1e]=!Fe},"setEnabled"),isEnabled:a(function(){var Fe=v3(Ne);return!Fe[C1]&&!Fe[l1e]},"isEnabled"),remove:a(function(Fe,tt){Fe===void 0&&(Fe=!0);var st=[Ne],vt={reason:1,isAsync:Fe};Te(st,vt,function(Pt){Pt&&Le({reason:32,removed:st}),tt&&tt(Pt)})},"remove")}),ue}a(me,"_getPlugin");function Oe(){if(!d){var ne=(x||[]).slice();Jo(ne,A)===-1&&ne[qi](A),d=q7(uje(ne),e.cfg,Q)}return d}a(Oe,"_getPluginChain");function Te(ne,ue,Ne){if(ne&&ne[mn]>0){var xe=q7(ne,e.cfg,Q),Fe=Gae(xe,Q);Fe[ZSe](function(){var tt=!1,st=[];Ct(f,function(Pt,Ht){vnn(Pt,ne)?tt=!0:st[qi](Pt)}),f=st,D=null,k=null;var vt=[];h&&(Ct(h,function(Pt,Ht){var F=[];Ct(Pt,function(se){vnn(se,ne)?tt=!0:F[qi](se)}),vt[qi](F)}),h=vt),Ne&&Ne(tt),ie()}),Fe[cg](ue)}else Ne(!1)}a(Te,"_removePlugins");function te(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[mn]=0,Ct(ne,function(ue){var Ne={name:y||"InternalMessageId: "+ue[Rae],iKey:w,time:L7(new Date),baseType:C1e.dataType,baseData:{message:ue[WM]}};Q.track(Ne)})}}a(te,"_flushInternalLogs");function ee(ne,ue,Ne,xe){var Fe=1,tt=!1,st=null;xe=xe||5e3;function vt(){Fe--,tt&&Fe===0&&(st&&st[GM](),st=null,ue&&ue(tt),ue=null)}if(a(vt,"doCallback"),m&&m[mn]>0){var Pt=le()[VM](m);Pt.iterate(function(Ht){if(Ht.flush){Fe++;var F=!1;Ht.flush(ne,function(){F=!0,vt()},Ne)||F||(ne&&st==null?st=Yp(function(){st=null,vt()},xe):vt())}})}return tt=!0,vt(),!0}a(ee,"_flushChannels");function K(){var ne;Be(e[HM](function(ue){var Ne=ue.cfg.enablePerfMgr;if(Ne){var xe=ue.cfg[Qqe];(ne!==xe||!ne)&&(xe||(xe=Wxo),b5t(ue.cfg,Qqe,xe),ne=xe,l=null),!c&&!l&&qr(xe)&&(l=xe(Q,Q[JSe]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ue=T1e(Oe(),Q);ue[ZSe](ie),(!Q._updateHook||Q._updateHook(ue,ne)!==!0)&&ue[cg](ne)}a(he,"_doUpdate");function X(ne){var ue=Q[id];ue?(Jr(ue,2,73,ne),ie()):ul(ne)}a(X,"_logOrThrowError");function de(ne){var ue=Q[JSe]();ue&&ue[M7]([ne],2)}a(de,"_notifyInvalidEvent");function Be(ne){v.add(ne)}a(Be,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function x1e(t,e){try{if(t&&t!==""){var r=jE().parse(t);if(r&&r[e5t]&&r[e5t]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[mn])return r}}catch(n){Jr(e,1,43,"Cannot parse the response. "+(n[v1]||hr(n)),{response:t})}return null}a(x1e,"parseResponse");p();var PP="",Xxo="NoResponseBody",Snn="&"+Xxo+"=true",a4t="POST",c4t=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;ki(t,this,function(_,E){var v=!0;q(),_[h3]=function(M,L){o=L,n&&Jr(o,1,28,"Sender is already initialized"),_.SetConfig(M),n=!0},_._getDbgPlgTargets=function(){return[n,s,l,r]},_.SetConfig=function(M){try{if(c=M.senderOnCompleteCallBack||{},l=!!M.disableCredentials,u=M.fetchCredentials,s=!!M.isOneDs,r=!!M.enableSendPromise,f=!!M.disableXhr,h=!!M.disableBeacon,m=!!M.disableBeaconSync,y=M.timeWrapper,A=!!M.addNoResponse,g=!!M.disableFetchKeepAlive,d={sendPOST:N},s||(v=!1),l){var L=p1e();L&&L.protocol&&L.protocol[IP]()==="file:"&&(v=!1)}return!0}catch{}return!1},_.getSyncFetchPayload=function(){return e},_.getSenderInst=function(M,L){return M&&M[mn]?R(M,L):null},_.getFallbackInst=function(){return d},_[P7]=function(M,L){q()},_.preparePayload=function(M,L,U,j){if(!L||j||!U[S1]){M(U);return}try{var Q=Oi("CompressionStream");if(!qr(Q)){M(U);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(vi(U[S1])?new TextEncoder().encode(U[S1]):U[S1]),re.close()},"start")}),W=Y.pipeThrough(new Q("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return Pl(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[m3];if(!Le.done)return z[qi](Le[m3]),ie+=Le.value[mn],Pl(V.read(),re);for(var me=new Uint8Array(ie),Oe=0,Te=0,te=z;Te0&&(Ct(rd(me),function(K){H.append(K,me[K])}),Oe[n1e]=H),u?Oe.credentials=u:v&&s&&(Oe.credentials="include"),U&&(Oe.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(Q+=Snn)):le=!0);var Te=new Request(Q,Oe);try{Te[Q5t]=!0}catch{}if(!U&&r&&(V=$d(function(K,he){z=K,ie=he})),!Q){w(L),z&&z(!1);return}function te(K,he){he?x(L,s?0:he,{},s?PP:K):x(L,s?0:400,{},s?PP:K)}a(te,"_handleError");function ee(K,he,X){var de=K[wP],Be=c.fetchOnComplete;Be&&qr(Be)?Be(K,L,X||PP,he):x(L,de,{},X||PP)}a(ee,"_onFetchComplete");try{Pl(fetch(s?Q:Te,s?Oe:null),function(K){if(U&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)te(K.reason&&K.reason[WM],499),ie&&ie(K.reason);else{var he=K[m3];try{!s&&!he.ok?(he[wP]?te(he.statusText,he[wP]):te(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,PP),z&&z(!0)):Pl(he.text(),function(X){ee(he,M,X[m3]),z&&z(!0)})}catch(X){he&&he[wP]?te(hr(X),he[wP]):te(hr(X),499),ie&&ie(X)}}})}catch(K){Le||(te(hr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(L,200,{}),z&&z(!0)),s&&!Le&&M[Jz]>0&&y&&y.set(function(){Le||(Le=!0,x(L,500,{}),z&&z(!0))},M[Jz]),V}a(O,"_doFetchSender");function B(M,L,U){var j=Sf(),Q=new XDomainRequest,Y=M[S1];Q.onload=function(){var H=Lae(Q),re=c&&c.xdrOnComplete;re&&qr(re)?re(Q,L,M):x(L,200,{},H)},Q.onerror=function(){x(L,400,{},s?PP:d1e(Q))},Q.ontimeout=function(){x(L,500,{})},Q.onprogress=function(){};var W=j&&j.location&&j.location.protocol||"",V=M[kae];if(!V){w(L);return}if(!s&&V.lastIndexOf(W,0)!==0){var z="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Jr(o,2,40,". "+z),T(z,L);return}var ie=s?V:V[xP](/^(https?:)/,"");Q.open(a4t,ie),M[Jz]&&(Q[Jz]=M[Jz]),Q.send(Y),s&&U?y&&y.set(function(){Q.send(Y)},0):Q.send(Y)}a(B,"_xdrSender");function q(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(q,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var Pnn="on",Tnn="attachEvent",Inn="addEventListener",xnn="detachEvent",wnn="removeEventListener",l4t="events";var zUl=w1("aiEvtPageHide"),YUl=w1("aiEvtPageShow"),ewo=/\.[\.]+/g,two=/[\.]+$/,rwo=1,mje=Jqe("events"),nwo=/^([^.]*)(?:\.(.+)|)/;function Rnn(t){return t&&t[xP]?t[xP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Io):t}a(Rnn,"_normalizeNamespace");function u4t(t,e){if(e){var r=Io;pr(e)?(r=Io,Ct(e,function(o){o=Rnn(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=Rnn(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Io)+r)}var n=nwo.exec(t||Io)||[];return{type:n[1],ns:(n[2]||Io).replace(ewo,".").replace(two,Io)[Bx](".").sort().join(".")}}a(u4t,"_getEvtNamespace");function Dnn(t,e,r){r===void 0&&(r=!0);var n=mje.get(t,l4t,{},r),o=n[e];return o||(o=n[e]=[]),o}a(Dnn,"_getRegisteredEvents");function Nnn(t,e,r,n){t&&e&&e[g3]&&(t[wnn]?t[wnn](e[g3],r,n):t[xnn]&&t[xnn](Pnn+e[g3],r))}a(Nnn,"_doDetach");function iwo(t,e,r,n){var o=!1;return t&&e&&e[g3]&&r&&(t[Inn]?(t[Inn](e[g3],r,n),o=!0):t[Tnn]&&(t[Tnn](Pnn+e[g3],r),o=!0)),o}a(iwo,"_doAttach");function knn(t,e,r,n){for(var o=e[mn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[ZOt].ns)&&(!n||n(s))&&(Nnn(t,s[ZOt],s.handler,s.capture),e[Ox](o,1))}}a(knn,"_doUnregister");function owo(t,e,r){if(e[g3])knn(t,Dnn(t,e[g3]),e,r);else{var n=mje.get(t,l4t,{});Zr(n,function(o,s){knn(t,s,e,r)}),rd(n)[mn]===0&&mje.kill(t,l4t)}}a(owo,"_unregisterEvents");function w1e(t,e){var r;return e?(pr(e)?r=[t].concat(e):r=[t,e],r=u4t("xx",r).ns[Bx](".")):r=t,r}a(w1e,"mergeEvtNamespace");function gje(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=u4t(e,n);if(s=iwo(t,c,r,o),s&&mje.accept(t)){var l={guid:rwo++,evtName:c,handler:r,capture:o};Dnn(t,c.type)[qi](l)}}catch{}return s}a(gje,"eventOn");function d4t(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=u4t(e,n),c=!1;owo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||Nnn(t,s,r,o)}catch{}}a(d4t,"eventOff");p();var R1e="sampleRate",k1e="ProcessLegacy",Aje="http.method",cY="https://dc.services.visualstudio.com",ZM="/v2/track",u_="not_specified";p();var yje=KOt({requestContextHeader:[0,"Request-Context"],requestContextTargetKey:[1,"appId"],requestContextAppIdFormat:[2,"appId=cid-v1:"],requestIdHeader:[3,"Request-Id"],traceParentHeader:[4,"traceparent"],traceStateHeader:[5,"tracestate"],sdkContextHeader:[6,"Sdk-Context"],sdkContextHeaderAppIdRequest:[7,"appId"],requestContextHeaderLowerCase:[8,"request-context"]});p();p();var lY="split",Ao="length",uY="toLowerCase",G7="ingestionendpoint",$7="toString",f4t="removeItem",$ae="message",Qnn="count";var P1e="stringify",D1e="pathname",dY="match";var d_="name";var PA="properties",f_="measurements",N1e="sizeInBytes",M1e="typeName",Vae="exceptions",fY="severityLevel",_je="problemGroup",pY="parsedStack",O1e="hasFullStack",L1e="assembly",XM="fileName",hY="line",Wae="aiDataContract",mY="duration";function p4t(t,e,r){var n=e[Ao],o=qnn(t,e);if(o[Ao]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=tp(o,0,147)+jnn(s);o=c}return o}a(p4t,"dataSanitizeKeyAndAddUniqueness");function qnn(t,e){var r;return e&&(e=Li(ed(e)),e[Ao]>150&&(r=tp(e,0,150),Jr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(qnn,"dataSanitizeKey");function Cu(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Li(ed(e)),e[Ao]>r&&(n=tp(e,0,r),Jr(t,2,61,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}a(Cu,"dataSanitizeString");function gY(t,e,r){return vi(e)&&(e=B5t(e,r)),g4t(t,e,2048,66)}a(gY,"dataSanitizeUrl");function B1e(t,e){var r;return e&&e[Ao]>32768&&(r=tp(e,0,32768),Jr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(B1e,"dataSanitizeMessage");function h4t(t,e){var r;if(e){var n=""+e;n[Ao]>32768&&(r=tp(n,0,32768),Jr(t,2,52,"exception is too long, it has been truncated to 32768 characters.",{exception:e},!0))}return r||e}a(h4t,"dataSanitizeException");function HE(t,e){if(e){var r={};Zr(e,function(n,o){if(td(o)&&B7())try{o=jE()[P1e](o)}catch(s){Jr(t,2,49,"custom property is not valid",{exception:s},!0)}o=Cu(t,o,8192),n=p4t(t,n,r),r[n]=o}),e=r}return e}a(HE,"dataSanitizeProperties");function GE(t,e){if(e){var r={};Zr(e,function(n,o){n=p4t(t,n,r),r[n]=o}),e=r}return e}a(GE,"dataSanitizeMeasurements");function m4t(t,e){return e&&g4t(t,e,128,69)[$7]()}a(m4t,"dataSanitizeId");function g4t(t,e,r,n){var o;return e&&(e=Li(ed(e)),e[Ao]>r&&(o=tp(e,0,r),Jr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(g4t,"dataSanitizeInput");function jnn(t){var e="00"+t;return gqe(e,e[Ao]-3)}a(jnn,"dsPadNumber");p();var Hnn=bf()||{},Gnn=0,awo=[null,null,null,null,null];function $nn(t){var e=Gnn,r=awo,n=r[e];return Hnn.createElement?r[e]||(n=r[e]=Hnn.createElement("a")):n={host:cwo(t,!0)},n.href=t,e++,e>=r[Ao]&&(e=0),Gnn=e,n}a($nn,"urlParseUrl");function cwo(t,e){var r=Vnn(t,e)||"";if(r){var n=r[dY](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[Ao]>3&&vi(n[2])&&n[2][Ao]>0)return n[2]+(n[3]||"")}return r}a(cwo,"urlParseHost");function Vnn(t,e){var r=null;if(t){var n=t[dY](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[Ao]>2&&vi(n[2])&&n[2][Ao]>0&&(r=n[2]||"",e&&n[Ao]>2)){var o=(n[1]||"")[uY](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(Vnn,"urlParseFullHost");var lwo=[cY+ZM,"https://breeze.aimon.applicationinsights.io"+ZM,"https://dc-int.services.visualstudio.com"+ZM];function Eje(t){return Jo(lwo,t[uY]())!==-1}a(Eje,"isInternalApplicationInsightsEndpoint");function Wnn(t,e,r,n){var o,s=n,c=n;if(e&&e[Ao]>0){var l=$nn(e);if(o=l.host,!s)if(l[D1e]!=null){var u=l.pathname[Ao]===0?"/":l[D1e];u.charAt(0)!=="/"&&(u="/"+u),c=l[D1e],s=Cu(t,r?r+" "+u:u)}else s=Cu(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a(Wnn,"AjaxHelperParseDependencyPath");p();p();var vje=KSe({LocalStorage:0,SessionStorage:1});var zae=void 0,znn="";function Ynn(t){try{if(Xt(c_()))return null;var e=new Date()[$7](),r=Oi(t===vje.LocalStorage?"localStorage":"sessionStorage"),n=znn+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[f4t](n),!o)return r}catch{}return null}a(Ynn,"_getVerifiedStorageObject");function A4t(){return Cje()?Ynn(vje.SessionStorage):null}a(A4t,"_getSessionStorageObject");function y4t(t){znn=t||""}a(y4t,"utlSetStoragePrefix");function Cje(t){return(t||zae===void 0)&&(zae=!!Ynn(vje.SessionStorage)),zae}a(Cje,"utlCanUseSessionStorage");function _4t(t,e){var r=A4t();if(r!==null)try{return r.getItem(e)}catch(n){zae=!1,Jr(t,2,2,"Browser failed read of session storage. "+Kp(n),{exception:hr(n)})}return null}a(_4t,"utlGetSessionStorage");function E4t(t,e,r){var n=A4t();if(n!==null)try{return n.setItem(e,r),!0}catch(o){zae=!1,Jr(t,2,4,"Browser failed write to session storage. "+Kp(o),{exception:hr(o)})}return!1}a(E4t,"utlSetSessionStorage");function v4t(t,e){var r=A4t();if(r!==null)try{return r[f4t](e),!0}catch(n){zae=!1,Jr(t,2,6,"Browser failed removal of session storage item. "+Kp(n),{exception:hr(n)})}return!1}a(v4t,"utlRemoveSessionStorage");p();var uwo=";",dwo="=";function F1e(t){if(!t)return{};var e=t[lY](uwo),r=VSe(e,function(o,s){var c=s[lY](dwo);if(c[Ao]===2){var l=c[0][uY](),u=c[1];o[l]=u}return o},{});if(rd(r)[Ao]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[G7]=r[G7]||"https://"+n+"dc."+r.endpointsuffix}r[G7]=r[G7]||cY,f3(r[G7],"/")&&(r[G7]=r[G7].slice(0,-1))}return r}a(F1e,"parseConnectionString");p();var C4t=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[d_]=Cu(e,n)||u_,s.data=r,s.time=L7(new Date),s[Wae]={time:1,iKey:1,name:1,sampleRate:a(function(){return o.sampleRate===100?4:1},"sampleRate"),tags:1,data:1}}return a(t,"Envelope"),t})();p();var C3=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[d_]=Cu(e,r)||u_,s[PA]=HE(e,n),s[f_]=GE(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var fwo=58,pwo=/^\s{0,50}(from\s|at\s|Line\s{1,5}\d{1,10}\s{1,5}of|\w{1,50}@\w{1,80}|[^\(\s\n]+:[0-9\?]+(?::[0-9\?]+)?)/,hwo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,mwo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,gwo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,Awo=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,ywo=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,_wo=/([^\(\s\n]+):([0-9]+)$/,Knn="",Yae="error",jx="stack",S4t="stackDetails",Jnn="errorSrc",T4t="message",tin="description",Znn=[{re:hwo,len:5,m:1,fn:2,ln:3,col:4},{chk:vwo,pre:Ewo,re:mwo,len:4,m:1,fn:2,ln:3},{re:gwo,len:3,m:1,fn:2,hdl:ein},{re:Awo,len:2,fn:1,hdl:ein}];function Ewo(t){return t.replace(/(\(anonymous\))/,"")}a(Ewo,"_scrubAnonymous");function vwo(t){return vu(t,"[native")<0}a(vwo,"_ignoreNative");function I4t(t,e){var r=t;return r&&!vi(r)&&(JSON&&JSON[P1e]?(r=JSON[P1e](t),e&&(!r||r==="{}")&&(qr(t[$7])?r=t[$7]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a(I4t,"_stringify");function rin(t,e){var r=t;return t&&(r&&!vi(r)&&(r=t[T4t]||t[tin]||r),r&&!vi(r)&&(r=I4t(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&vu(r||"",e)===-1&&(r=e+": "+r),r||""}a(rin,"_formatMessage");function Cwo(t){try{if(td(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(Cwo,"_isExceptionDetailsInternal");function bwo(t){try{if(td(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(bwo,"_isExceptionInternal");function Xnn(t){return t&&t.src&&vi(t.src)&&t.obj&&pr(t.obj)}a(Xnn,"_isStackDetails");function AY(t){var e=t||"";vi(e)||(vi(e[jx])?e=e[jx]:e=""+e);var r=e[lY](` -`);return{src:e,obj:r}}a(AY,"_convertStackObj");function Swo(t){for(var e=[],r=t[lY](` -`),n=0;n0){e=[];var n=0,o=!1,s=0;Ct(r,function(y){if(o||kwo(y)){var _=ed(y);o=!0;var E=Pwo(_,n);E&&(s+=E[N1e],e.push(E),n++)}});var c=32*1024;if(s>c)for(var l=0,u=e[Ao]-1,d=0,f=l,h=u;lc){var A=h-f+1;e.splice(f,A);break}f=l,h=u,l++,u--}}return e}a(Iwo,"_parseStack");function bje(t){var e="";if(t&&(e=t.typeName||t[d_]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[$7]());e=n&&n[Ao]>1?n[1]:""}catch{}return e}a(bje,"_getErrorType");function b4t(t){if(t)try{if(!vi(t)){var e=bje(t),r=I4t(t,!1);return(!r||r==="{}")&&(t[Yae]&&(t=t[Yae],e=bje(t)),r=I4t(t,!0)),vu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(b4t,"_formatErrorCode");var yY=(function(){function t(e,r,n,o,s,c){this.aiDataContract={ver:1,exceptions:1,severityLevel:0,properties:0,measurements:0};var l=this;l.ver=2,bwo(r)?(l[Vae]=r[Vae]||[],l[PA]=r[PA],l[f_]=r[f_],r[fY]&&(l[fY]=r[fY]),r.id&&(l.id=r.id,r[PA].id=r.id),r[_je]&&(l[_je]=r[_je]),Xt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[Vae]=[iin(e,r,n)],l[PA]=HE(e,n),l[f_]=GE(e,o),s&&(l[fY]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=bje(s||c||e);return{message:rin(e,d),url:r,lineNumber:n,columnNumber:o,error:b4t(s||c||e),evt:b4t(c||e),typeName:d,stackDetails:nin(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[Vae]&&d3(r[Vae],function(l){return Rwo(e,l)}),c=new t(e,Ux(Ux({},r),{exceptions:s}),n,o);return c},t.prototype.toInterface=function(){var e=this,r=e.exceptions,n=e.properties,o=e.measurements,s=e.severityLevel,c=e.problemGroup,l=e.id,u=e.isManual,d=r instanceof Array&&d3(r,function(f){return f.toInterface()})||void 0;return{ver:"4.0",exceptions:d,severityLevel:s,properties:n,measurements:o,problemGroup:c,id:l,isManual:u}},t.CreateSimpleException=function(e,r,n,o,s,c){var l;return{exceptions:[(l={},l[O1e]=!0,l.message=e,l.stack=s,l.typeName=r,l)]}},t.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",t.dataType="ExceptionData",t.formatError=b4t,t})();var xwo=Yh({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function wwo(){var t=this,e=pr(t[pY])&&d3(t[pY],function(n){return Nwo(n)}),r={id:t.id,outerId:t.outerId,typeName:t[M1e],message:t[$ae],hasFullStack:t[O1e],stack:t[jx],parsedStack:e||void 0};return r}a(wwo,"_toInterface");function iin(t,e,r){var n,o,s,c,l,u,d,f;if(Cwo(e))c=e[M1e],l=e[$ae],d=e[jx],f=e[pY]||[],u=e[O1e];else{var h=e,m=h&&h.evt;c3(h)||(h=h[Yae]||m||h),c=Cu(t,bje(h))||u_,l=B1e(t,rin(e||h,c))||u_;var g=e[S4t]||nin(e);f=Iwo(g),pr(f)&&d3(f,function(A){A[L1e]=Cu(t,A[L1e]),A[XM]=Cu(t,A[XM])}),d=h4t(t,Two(g)),u=pr(f)&&f[Ao]>0,r&&(r[M1e]=r[M1e]||c)}return n={},n[Wae]=xwo,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[O1e]=u,n.stack=d,n.parsedStack=f,n.toInterface=wwo,n}a(iin,"_createExceptionDetails");function Rwo(t,e){var r=pr(e[pY])&&d3(e[pY],function(o){return Dwo(o)})||e[pY],n=iin(t,Ux(Ux({},e),{parsedStack:r}));return n}a(Rwo,"_createExDetailsFromInterface");function oin(t,e){var r=e[dY](ywo);if(r&&r[Ao]>=4)t[XM]=r[1],t[hY]=parseInt(r[2]);else{var n=e[dY](_wo);n&&n[Ao]>=3?(t[XM]=n[1],t[hY]=parseInt(n[2])):t[XM]=e}}a(oin,"_parseFilename");function ein(t,e,r){var n=t[XM];e.fn&&r&&r[Ao]>e.fn&&(e.ln&&r[Ao]>e.ln?(n=Li(r[e.fn]||""),t[hY]=parseInt(Li(r[e.ln]||""))||0):n=Li(r[e.fn]||"")),n&&oin(t,n)}a(ein,"_handleFilename");function kwo(t){var e=!1;if(t&&vi(t)){var r=Li(t);r&&(e=pwo.test(r))}return e}a(kwo,"_isStackFrame");var sin=Yh({level:1,method:1,assembly:0,fileName:0,line:0});function Pwo(t,e){var r,n;if(t&&vi(t)&&Li(t)){n=(r={},r[Wae]=sin,r.level=e,r.assembly=Li(t),r.method=Knn,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o=s.len){s.m&&(n.method=Li(c[s.m]||Knn)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[XM]=Li(c[s.fn]||""),n[hY]=parseInt(Li(c[s.ln]||""))||0):oin(n,c[s.fn]||""));break}o++}}return ain(n)}a(Pwo,"_extractStackFrame");function Dwo(t){var e,r=(e={},e[Wae]=sin,e.level=t.level,e.method=t.method,e.assembly=t[L1e],e.fileName=t[XM],e.line=t[hY],e.sizeInBytes=0,e);return ain(r)}a(Dwo,"_stackFrameFromInterface");function ain(t){var e=fwo;return t&&(e+=t.method[Ao],e+=t.assembly[Ao],e+=t.fileName[Ao],e+=t.level.toString()[Ao],e+=t.line.toString()[Ao],t[N1e]=e),t}a(ain,"_populateFrameSizeInBytes");function Nwo(t){return{level:t.level,method:t.method,assembly:t[L1e],fileName:t[XM],line:t[hY]}}a(Nwo,"_parsedFrameToInterface");p();p();var cin=(function(){function t(){this.aiDataContract={name:1,kind:0,value:1,count:0,min:0,max:0,stdDev:0},this.kind=0}return a(t,"DataPoint"),t})();var b3=(function(){function t(e,r,n,o,s,c,l,u,d){this.aiDataContract={ver:1,metrics:1,properties:0};var f=this;f.ver=2;var h=new cin;h[Qnn]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[d_]=Cu(e,r)||u_,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[PA]=HE(e,u),f[f_]=GE(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var U1e="";function Sje(t){(isNaN(t)||t<0)&&(t=0),t=crn(t);var e=U1e+t%1e3,r=U1e+E1(t/1e3)%60,n=U1e+E1(t/(1e3*60))%60,o=U1e+E1(t/(1e3*60*60))%24,s=E1(t/(1e3*60*60*24));return e=e[Ao]===1?"00"+e:e[Ao]===2?"0"+e:e,r=r[Ao]<2?"0"+r:r,n=n[Ao]<2?"0"+n:n,o=o[Ao]<2?"0"+o:o,(s>0?s+".":U1e)+o+":"+n+":"+r+"."+e}a(Sje,"msToTimeSpan");var _Y=(function(){function t(e,r,n,o,s,c,l){this.aiDataContract={ver:1,name:0,url:0,duration:0,properties:0,measurements:0,id:0};var u=this;u.ver=2,u.id=m4t(e,l),u.url=gY(e,n),u[d_]=Cu(e,r)||u_,isNaN(o)||(u[mY]=Sje(o)),u[PA]=HE(e,s),u[f_]=GE(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var EY=(function(){function t(e,r,n,o,s,c,l,u,d,f,h,m){d===void 0&&(d="Ajax"),this.aiDataContract={id:1,ver:1,name:0,resultCode:0,duration:0,success:0,data:0,target:0,type:0,properties:0,measurements:0,kind:0,value:0,count:0,min:0,max:0,stdDev:0,dependencyKind:0,dependencySource:0,commandName:0,dependencyTypeName:0};var g=this;g.ver=2,g.id=r,g[mY]=Sje(s),g.success=c,g.resultCode=l+"",g.type=Cu(e,d);var A=Wnn(e,n,u,o);g.data=gY(e,o)||A.data,g.target=Cu(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[d_]=Cu(e,A[d_]),g[PA]=HE(e,h),g[f_]=GE(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var vY=(function(){function t(e,r,n,o,s){this.aiDataContract={ver:1,message:1,severityLevel:0,properties:0};var c=this;c.ver=2,r=r||u_,c[$ae]=B1e(e,r),c[PA]=HE(e,o),c[f_]=GE(e,s),n&&(c[fY]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var CY=(function(){function t(e,r,n,o,s,c,l){this.aiDataContract={ver:1,name:0,url:0,duration:0,perfTotal:0,networkConnect:0,sentRequest:0,receivedResponse:0,domProcessing:0,properties:0,measurements:0};var u=this;u.ver=2,u.url=gY(e,n),u[d_]=Cu(e,r)||u_,u[PA]=HE(e,s),u[f_]=GE(e,c),l&&(u.domProcessing=l.domProcessing,u[mY]=l[mY],u.networkConnect=l.networkConnect,u.perfTotal=l.perfTotal,u.receivedResponse=l.receivedResponse,u.sentRequest=l.sentRequest)}return a(t,"PageViewPerformance"),t.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",t.dataType="PageviewPerformanceData",t})();p();var S3=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function W7(t){var e="ai."+t+".";return function(r){return e+r}}a(W7,"_aiNameFunc");var Q1e=W7("application"),ug=W7("device"),Tje=W7("location"),Kae=W7("operation"),x4t=W7("session"),V7=W7("user"),bY=W7("cloud"),q1e=W7("internal"),j1e=(function(t){l_(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(S5t({applicationVersion:Q1e("ver"),applicationBuild:Q1e("build"),applicationTypeId:Q1e("typeId"),applicationId:Q1e("applicationId"),applicationLayer:Q1e("layer"),deviceId:ug("id"),deviceIp:ug("ip"),deviceLanguage:ug("language"),deviceLocale:ug("locale"),deviceModel:ug("model"),deviceFriendlyName:ug("friendlyName"),deviceNetwork:ug("network"),deviceNetworkName:ug("networkName"),deviceOEMName:ug("oemName"),deviceOS:ug("os"),deviceOSVersion:ug("osVersion"),deviceRoleInstance:ug("roleInstance"),deviceRoleName:ug("roleName"),deviceScreenResolution:ug("screenResolution"),deviceType:ug("type"),deviceMachineName:ug("machineName"),deviceVMName:ug("vmName"),deviceBrowser:ug("browser"),deviceBrowserVersion:ug("browserVersion"),locationIp:Tje("ip"),locationCountry:Tje("country"),locationProvince:Tje("province"),locationCity:Tje("city"),operationId:Kae("id"),operationName:Kae("name"),operationParentId:Kae("parentId"),operationRootId:Kae("rootId"),operationSyntheticSource:Kae("syntheticSource"),operationCorrelationVector:Kae("correlationVector"),sessionId:x4t("id"),sessionIsFirst:x4t("isFirst"),sessionIsNew:x4t("isNew"),userAccountAcquisitionDate:V7("accountAcquisitionDate"),userAccountId:V7("accountId"),userAgent:V7("userAgent"),userId:V7("id"),userStoreRegion:V7("storeRegion"),userAuthUserId:V7("authUserId"),userAnonymousUserAcquisitionDate:V7("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:V7("authUserAcquisitionDate"),cloudName:bY("name"),cloudRole:bY("role"),cloudRoleVer:bY("roleVer"),cloudRoleInstance:bY("roleInstance"),cloudEnvironment:bY("environment"),cloudLocation:bY("location"),cloudDeploymentUnit:bY("deploymentUnit"),internalNodeName:q1e("nodeName"),internalSdkVersion:q1e("sdkVersion"),internalAgentVersion:q1e("agentVersion"),internalSnippet:q1e("snippet"),internalSdkSrc:q1e("sdkSrc")}));p();var Zh=new j1e;p();function lin(t,e){d4t(t,null,null,e)}a(lin,"_disableEvents");function w4t(t){var e=bf(),r=nd(),n=!1,o=[],s=1;r&&!Xt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=w1e(w1("OfflineListener"),t);try{if(f(Sf())&&(n=!0),e){var d=e.body||e;d.ononline&&f(d)&&(n=!0)}}catch{n=!1}function f(S){var T=!1;return S&&(T=gje(S,"online",y,u),T&&gje(S,"offline",_,u)),T}a(f,"_enableEvents");function h(){return l}a(h,"_isOnline");function m(){return!(c===2||s===2)}a(m,"calCurrentState");function g(){var S=m();l!==S&&(l=S,Ct(o,function(T){var w={isOnline:l,rState:s,uState:c};try{T(w)}catch{}}))}a(g,"listnerNoticeCheck");function A(S){c=S,g()}a(A,"setOnlineState");function y(){s=1,g()}a(y,"_setOnline");function _(){s=2,g()}a(_,"_setOffline");function E(){var S=Sf();if(S&&n){if(lin(S,u),e){var T=e.body||e;Bn(T.ononline)||lin(T,u)}n=!1}}a(E,"_unload");function v(S){return o.push(S),{rm:a(function(){var T=o.indexOf(S);if(T>-1)return o.splice(T,1)},"rm")}}return a(v,"addListener"),{isOnline:h,isListening:a(function(){return n},"isListening"),unload:E,addListener:v,setOnlineState:A}}a(w4t,"createOfflineListener");var Ije="AppInsightsChannelPlugin";p();p();p();p();p();var z7="duration";p();var Xh="tags",xje="deviceType",BC="data",eO="name",SY="traceID",qo="length",Y7="stringify",K7="measurements",Hx="dataType",J7="envelopeType",T3="toString",I3="enqueue",x3="count",Gx="push",H1e="emitLineDelimitedJson",Z7="clear",Jae="markAsSent",TY="clearSent",G1e="bufferOverride",Zae="BUFFER_KEY",w3="SENT_BUFFER_KEY",X7="concat",Xae="MAX_BUFFER_SIZE",ece="triggerSend",DA="diagLog",wje="initialize",tce="_sender",rce="endpointUrl",nce="instrumentationKey",Rje="customHeaders",R4t="maxBatchSizeInBytes",kje="onunloadDisableBeacon",Pje="isBeaconApiDisabled",k4t="alwaysUseXhrOverride",P4t="enableSessionStorageBuffer",DP="_buffer",D4t="onunloadDisableFetch",N4t="disableSendBeaconSplit",$1e="getSenderInst",eQ="_onError",Dje="_onPartialSuccess",V1e="_onSuccess",Nje="itemsReceived",Mje="itemsAccepted",Oje="baseType",ice="sampleRate",uin="getHashCodeScore";var M4t="baseType",Vd="baseData",f0="properties",din="true";function Jp(t,e,r){return YM(t,e,r,y1)}a(Jp,"_setValueIf");function Mwo(t,e,r){var n=r[Xh]=r[Xh]||{},o=e.ext=e.ext||{},s=e[Xh]=e[Xh]||[],c=o.user;c&&(Jp(n,Zh.userAuthUserId,c.authId),Jp(n,Zh.userId,c.id||c.localId));var l=o.app;l&&Jp(n,Zh.sessionId,l.sesId);var u=o.device;u&&(Jp(n,Zh.deviceId,u.id||u.localId),Jp(n,Zh[xje],u.deviceClass),Jp(n,Zh.deviceIp,u.ip),Jp(n,Zh.deviceModel,u.model),Jp(n,Zh[xje],u[xje]));var d=e.ext.web;if(d){Jp(n,Zh.deviceLanguage,d.browserLang),Jp(n,Zh.deviceBrowserVersion,d.browserVer),Jp(n,Zh.deviceBrowser,d.browser);var f=r[BC]=r[BC]||{},h=f[Vd]=f[Vd]||{},m=h[f0]=h[f0]||{};Jp(m,"domain",d.domain),Jp(m,"isManual",d.isManual?din:null),Jp(m,"screenRes",d.screenRes),Jp(m,"userConsent",d.userConsent?din:null)}var g=o.os;g&&(Jp(n,Zh.deviceOS,g[eO]),Jp(n,Zh.deviceOSVersion,g.osVer));var A=o.trace;A&&(Jp(n,Zh.operationParentId,A.parentID),Jp(n,Zh.operationName,Cu(t,A[eO])),Jp(n,Zh.operationId,A[SY]));for(var y={},_=s[qo]-1;_>=0;_--){var E=s[_];Zr(E,function(S,T){y[S]=T}),s.splice(_,1)}Zr(s,function(S,T){y[S]=T});var v=Ux(Ux({},n),y);v[Zh.internalSdkVersion]||(v[Zh.internalSdkVersion]=Cu(t,"javascript:".concat(Owo.Version),64)),r[Xh]=Wqe(v)}a(Mwo,"_extractPartAExtensions");function tQ(t,e,r){Xt(t)||Zr(t,function(n,o){zh(o)?r[n]=o:vi(o)?e[n]=o:B7()&&(e[n]=jE()[Y7](o))})}a(tQ,"_extractPropsAndMeasurements");function IY(t,e){Xt(t)||Zr(t,function(r,n){t[r]=n||e})}a(IY,"_convertPropsUndefinedToCustomDefinedValue");function xY(t,e,r,n){var o=new C4t(t,n,e);Jp(o,"sampleRate",r[R1e]),(r[Vd]||{}).startTime&&(o.time=L7(r[Vd].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[eO]=o[eO].replace("{0}",s),Mwo(t,r,o),r[Xh]=r[Xh]||[],Wqe(o)}a(xY,"_createEnvelope");function wY(t,e){Xt(e[Vd])&&Jr(t,1,46,"telemetryItem.baseData cannot be null.")}a(wY,"EnvelopeCreatorInit");var Owo={Version:"3.3.11"};function fin(t,e,r){wY(t,e);var n=e[Vd][K7]||{},o=e[Vd][f0]||{};tQ(e[BC],o,n),Xt(r)||IY(o,r);var s=e[Vd];if(Xt(s))return E3(t,"Invalid input for dependency data"),null;var c=s[f0]&&s[f0][Aje]?s[f0][Aje]:"GET",l=new EY(t,s.id,s.target,s[eO],s[z7],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new S3(EY[Hx],l);return xY(t,EY[J7],e,u)}a(fin,"DependencyEnvelopeCreator");function O4t(t,e,r){wY(t,e);var n={},o={};e[M4t]!==C3[Hx]&&(n.baseTypeSource=e[M4t]),e[M4t]===C3[Hx]?(n=e[Vd][f0]||{},o=e[Vd][K7]||{}):e[Vd]&&tQ(e[Vd],n,o),tQ(e[BC],n,o),Xt(r)||IY(n,r);var s=e[Vd][eO],c=new C3(t,s,n,o),l=new S3(C3[Hx],c);return xY(t,C3[J7],e,l)}a(O4t,"EventEnvelopeCreator");function pin(t,e,r){wY(t,e);var n=e[Vd][K7]||{},o=e[Vd][f0]||{};tQ(e[BC],o,n),Xt(r)||IY(o,r);var s=e[Vd],c=yY.CreateFromInterface(t,s,o,n),l=new S3(yY[Hx],c);return xY(t,yY[J7],e,l)}a(pin,"ExceptionEnvelopeCreator");function hin(t,e,r){wY(t,e);var n=e[Vd],o=n[f0]||{},s=n[K7]||{};tQ(e[BC],o,s),Xt(r)||IY(o,r);var c=new b3(t,n[eO],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new S3(b3[Hx],c);return xY(t,b3[J7],e,l)}a(hin,"MetricEnvelopeCreator");function min(t,e,r){wY(t,e);var n,o=e[Vd];!Xt(o)&&!Xt(o[f0])&&!Xt(o[f0][z7])?(n=o[f0][z7],delete o[f0][z7]):!Xt(e[BC])&&!Xt(e[BC][z7])&&(n=e[BC][z7],delete e[BC][z7]);var s=e[Vd],c;((e.ext||{}).trace||{})[SY]&&(c=e.ext.trace[SY]);var l=s.id||c,u=s[eO],d=s.uri,f=s[f0]||{},h=s[K7]||{};if(Xt(s.refUri)||(f.refUri=s.refUri),Xt(s.pageType)||(f.pageType=s.pageType),Xt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[T3]()),!Xt(s[f0])){var m=s[f0];Zr(m,function(y,_){f[y]=_})}tQ(e[BC],f,h),Xt(r)||IY(f,r);var g=new _Y(t,u,d,n,f,h,l),A=new S3(_Y[Hx],g);return xY(t,_Y[J7],e,A)}a(min,"PageViewEnvelopeCreator");function gin(t,e,r){wY(t,e);var n=e[Vd],o=n[eO],s=n.uri||n.url,c=n[f0]||{},l=n[K7]||{};tQ(e[BC],c,l),Xt(r)||IY(c,r);var u=new CY(t,o,s,void 0,c,l,n),d=new S3(CY[Hx],u);return xY(t,CY[J7],e,d)}a(gin,"PageViewPerformanceEnvelopeCreator");function Ain(t,e,r){wY(t,e);var n=e[Vd].message,o=e[Vd].severityLevel,s=e[Vd][f0]||{},c=e[Vd][K7]||{};tQ(e[BC],s,c),Xt(r)||IY(s,r);var l=new vY(t,n,o,s,c),u=new S3(vY[Hx],l);return xY(t,vY[J7],e,u)}a(Ain,"TraceEnvelopeCreator");p();var yin=(function(){function t(e,r){var n=[],o=!1,s=r.maxRetryCnt;this._get=function(){return n},this._set=function(c){return n=c,n},ki(t,this,function(c){c[I3]=function(l){if(c[x3]()>=r.eventsLimitInMem){o||(Jr(e,2,105,"Maximum in-memory buffer size reached: "+c[x3](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Xt(s)&&l.cnt>s)&&n[Gx](l)},c[x3]=function(){return n[qo]},c.size=function(){for(var l=n[qo],u=0;u0){var u=[];Ct(l,function(f){u[Gx](f.item)});var d=r[H1e]?u.join(` -`):"["+u.join(",")+"]";return d}return null},c.createNew=function(l,u,d){var f=n.slice(0);l=l||e,u=u||{};var h=d?new L4t(l,u):new Lje(l,u);return Ct(f,function(m){h[I3](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),Lje=(function(t){l_(e,t);function e(r,n){var o=t.call(this,r,n)||this;return ki(e,o,function(s,c){s[Jae]=function(l){c[Z7]()},s[TY]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(yin);var Lwo=["AI_buffer","AI_sentBuffer"],L4t=(function(t){l_(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[G1e]||{getItem:_4t,setItem:E4t},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return ki(e,s,function(m,g){var A=T(e[Zae]),y=T(e[w3]),_=x(),E=y[X7](_),v=m._set(A[X7](E));v[qo]>e[Xae]&&(v[qo]=e[Xae]),R(e[w3],[]),R(e[Zae],v),m[I3]=function(D){if(m[x3]()>=e[Xae]){c||(Jr(n,2,67,"Maximum buffer size reached: "+m[x3](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Xt(h)&&D.cnt>h)&&(g[I3](D),R(e[Zae],m._get()))},m[Z7]=function(){g[Z7](),R(e[Zae],m._get()),R(e[w3],[]),c=!1},m[Jae]=function(D){R(e[Zae],m._set(S(D,m._get())));var N=T(e[w3]);N instanceof Array&&D instanceof Array&&(N=N[X7](D),N[qo]>e[Xae]&&(Jr(n,1,67,"Sent buffer reached its maximum size: "+N[qo],!0),N[qo]=e[Xae]),R(e[w3],N))},m[TY]=function(D){var N=T(e[w3]);N=S(D,N),R(e[w3],N)},m.createNew=function(D,N,O){O=!!O;var B=m._get().slice(0),q=T(e[w3]).slice(0);D=D||n,N=N||{},m[Z7]();var M=O?new e(D,N):new Lje(D,N);return Ct(B,function(L){M[I3](L)}),O&&M[Jae](q),M};function S(D,N){var O=[],B=[];return Ct(D,function(q){B[Gx](q.item)}),Ct(N,function(q){!qr(q)&&Jo(B,q.item)===-1&&O[Gx](q)}),O}a(S,"_removePayloadsFromBuffer");function T(D){var N=D;return N=l?l+"_"+N:N,w(N)}a(T,"_getBuffer");function w(D){try{var N=d(n,D);if(N){var O=jE().parse(N);if(vi(O)&&(O=jE().parse(O)),O&&pr(O))return O}}catch(B){Jr(n,1,42," storage key: "+D+", "+Kp(B),{exception:hr(B)})}return[]}a(w,"_getBufferBase");function R(D,N){var O=D;try{O=l?l+"_"+O:O;var B=JSON[Y7](N);f(n,O,B)}catch(q){f(n,O,JSON[Y7]([])),Jr(n,2,41," storage key: "+O+", "+Kp(q)+". Buffer cleared",{exception:hr(q)})}}a(R,"_setBuffer");function x(){var D=[];try{return Ct(Lwo,function(N){var O=k(N);if(D=D[X7](O),l){var B=l+"_"+N,q=k(B);D=D[X7](q)}}),D}catch(N){Jr(n,2,41,"Transfer events from previous buffers: "+Kp(N)+". previous Buffer items can not be removed",{exception:hr(N)})}return[]}a(x,"_getPreviousEvents");function k(D){try{var N=w(D),O=[];return Ct(N,function(B){var q={item:B,cnt:0};O[Gx](q)}),v4t(n,D),O}catch{}return[]}a(k,"_getItemsFromPreviousKey")}),s}a(e,"SessionStorageSendBuffer");var r;return r=e,e.VERSION="_1",e.BUFFER_KEY="AI_buffer"+r.VERSION,e.SENT_BUFFER_KEY="AI_sentBuffer"+r.VERSION,e.MAX_BUFFER_SIZE=2e3,e})(yin);p();var _in=(function(){function t(e){ki(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return jE()[Y7](l)}catch(u){Jr(e,1,48,u&&qr(u[T3])?u[T3]():"Error serializing object",null,!0)}};function n(c,l){var u="__aiCircularRefCheck",d={};if(!c)return Jr(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(c[u])return Jr(e,2,50,"Circular reference detected while serializing object",{name:l},!0),d;if(!c.aiDataContract){if(l==="measurements")d=s(c,"number",l);else if(l==="properties")d=s(c,"string",l);else if(l==="tags")d=s(c,"string",l);else if(pr(c))d=o(c,l);else{Jr(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{jE()[Y7](c),d=c}catch(f){Jr(e,1,48,f&&qr(f[T3])?f[T3]():"Error serializing object",null,!0)}}return d}return c[u]=!0,Zr(c.aiDataContract,function(f,h){var m=qr(h)?h()&1:h&1,g=qr(h)?h()&4:h&4,A=h&2,y=c[f]!==void 0,_=td(c[f])&&c[f]!==null;if(m&&!y&&!A)Jr(e,1,24,"Missing required field specification. The field is required but not present on source",{field:f,name:l});else if(!g){var E=void 0;_?A?E=o(c[f],f):E=n(c[f],f):E=c[f],E!==void 0&&(d[f]=E)}}),delete c[u],d}a(n,"_serializeObject");function o(c,l){var u;if(c)if(!pr(c))Jr(e,1,54,`This field was specified as an array in the contract but the item is not an array.\r -`,{name:l},!0);else{u=[];for(var d=0;d100||e<0)&&(n.throwInternal(2,58,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),e=100),this[ice]=e,this.samplingScoreGenerator=new vin}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[ice],n=!1;return r==null||r>=100||e.baseType===b3[Hx]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(Qwo,"_chkSampling");var qwo=(R3={},R3[C3.dataType]=O4t,R3[vY.dataType]=Ain,R3[_Y.dataType]=min,R3[CY.dataType]=gin,R3[yY.dataType]=pin,R3[b3.dataType]=hin,R3[EY.dataType]=fin,R3),B4t=(function(t){l_(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=Ije;var n,o,s,c,l,u,d,f,h=0,m,g,A,y,_,E,v,S,T,w,R,x,k,D,N,O,B,q,M,L,U,j,Q,Y,W,V,z,ie;return ki(e,r,function(H,re){je(),H.pause=function(){ge(),c=!0},H.resume=function(){c&&(c=!1,o=null,tt(),Qe())},H.flush=function(J,ae,Ce){if(J===void 0&&(J=!0),!c){ge();try{var Re=H[ece](J,null,Ce||1);return Pl(Re,function($e){return ae?(ae(!$e.rejected),!0):J?$d(function(Ye){Ye(!$e.rejected)}):Re})}catch($e){Jr(H[DA](),1,22,"flush failed, telemetry will not be collected: "+Kp($e),{exception:hr($e)})}}},H.onunloadFlush=function(){if(!c)if(v||L)try{return H[ece](!0,Pt,2)}catch(J){Jr(H[DA](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+Kp(J),{exception:hr(J)})}else H.flush(!1)},H.addHeader=function(J,ae){f[J]=ae},H[wje]=function(J,ae,Ce,Re){H.isInitialized()&&Jr(H[DA](),1,28,"Sender is already initialized"),re[wje](J,ae,Ce,Re);var $e=H.identifier;u=new _in(ae.logger),n=0,o=null,s=0,H[tce]=null,d=0;var Ye=H[DA]();A=w1e(w1("Sender"),ae.evtNamespace&&ae.evtNamespace()),g=w4t(A),H._addHook(Qx(J,function(ut){var yt=ut.cfg;yt.storagePrefix&&y4t(yt.storagePrefix);var $t=kP(null,yt,ae),Tt=$t.getExtCfg($e,Tin),We=Tt[rce];if(y&&We===y){var ce=yt[rce];ce&&ce!==We&&(Tt[rce]=ce)}var Pe=Oi("CompressionStream");ie=T5t("zipPayload",yt,!1),qr(Pe)||(ie=!1);var Me=Tt.corsPolicy;Me?(Me==="same-origin"||Me==="same-site"||Me==="cross-origin")&&r.addHeader(Iin,Me):delete f[Iin],u0(Tt[nce])&&(Tt[nce]=yt[nce]),$i(H,"_senderConfig",{g:a(function(){return Tt},"g")}),_!==Tt[rce]&&(y=_=Tt[rce]),ae.activeStatus()===TP.PENDING?H.pause():ae.activeStatus()===TP.ACTIVE&&H.resume(),w&&w!==Tt[Rje]&&Ct(w,function(Tr){delete f[Tr.header]}),E=Tt[R4t],v=(Tt[kje]===!1||Tt[Pje]===!1)&&F7(),S=Tt[kje]===!1&&F7(),T=Tt[Pje]===!1&&F7(),L=Tt[k4t],U=!!Tt.disableXhr,z=Tt.retryCodes;var ye=Tt[G1e],oe=!!Tt[P4t]&&(!!ye||Cje()),Ke=Tt.namePrefix,lt=oe!==O||oe&&q!==Ke||oe&&B!==ye;if(H[DP]){if(lt)try{H[DP]=H[DP].createNew(Ye,Tt,oe)}catch(Tr){Jr(H[DA](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+Kp(Tr),{exception:hr(Tr)})}tt()}else H[DP]=oe?new L4t(Ye,Tt):new Lje(Ye,Tt);q=Ke,O=oe,B=ye,j=!Tt[D4t]&&h1e(!0),W=!!Tt[N4t],H._sample=new Cin(Tt.samplingPercentage,Ye),x=Tt[nce],!u0(x)&&!qe(x,yt)&&Jr(Ye,1,100,"Invalid Instrumentation key "+x),w=Tt[Rje],vi(y)&&!Eje(y)&&w&&w[qo]>0?Ct(w,function(Tr){r.addHeader(Tr.header,Tr.value)}):w=null,M=Tt.enableSendPromise;var Gt=Le();V?V.SetConfig(Gt):(V=new c4t,V[wje](Gt,Ye));var Er=Tt.httpXHROverride,dr=null,Ur=null,Wr=Yqe([3,1,2],Tt.transports);dr=V&&V[$1e](Wr,!1);var zr=V&&V.getFallbackInst();Q=a(function(Tr,e0){return Ne(zr,Tr,e0)},"_xhrSend"),Y=a(function(Tr,e0){return Ne(zr,Tr,e0,!1)},"_fallbackSend"),dr=L?Er:dr||Er||zr,H[tce]=function(Tr,e0){return Ne(dr,Tr,e0)},j&&(m=se);var zt=Yqe([3,1],Tt.unloadTransports);j||(zt=zt.filter(function(Tr){return Tr!==2})),Ur=V&&V[$1e](zt,!0),Ur=L?Er:Ur||Er,(L||Tt.unloadTransports||!m)&&Ur&&(m=a(function(Tr,e0){return Ne(Ur,Tr,e0)},"_syncUnloadSender")),m||(m=Q),R=Tt.disableTelemetry,k=Tt.convertUndefined||NP,D=Tt.isRetryDisabled,N=Tt.maxBatchInterval}))},H.processTelemetry=function(J,ae){ae=H._getTelCtx(ae);var Ce=ae[DA]();try{var Re=K(J,Ce);if(!Re)return;var $e=he(J,Ce);if(!$e)return;var Ye=u.serialize($e),ut=H[DP];tt(Ye);var yt={item:Ye,cnt:0};ut[I3](yt),Qe()}catch($t){Jr(Ce,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Kp($t),{exception:hr($t)})}H.processNext(J,ae)},H.isCompletelyIdle=function(){return!c&&h===0&&H._buffer[x3]()===0},H.getOfflineListener=function(){return g},H._xhrReadyStateChange=function(J,ae,Ce){if(!F(ae))return me(J,ae,Ce)},H[ece]=function(J,ae,Ce){J===void 0&&(J=!0);var Re;if(!c)try{var $e=H[DP];if(R)$e[Z7]();else{if($e[x3]()>0){var Ye=$e.getItems();Ge(Ce||0,J),ae?Re=ae.call(H,Ye,J):Re=H[tce](Ye,J)}s=+new Date}ge()}catch(yt){var ut=O5t();(!ut||ut>9)&&Jr(H[DA](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+Kp(yt),{exception:hr(yt)})}return Re},H.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:Be,serialize:X,batch:de,shouldProcess:a(function(J){return!!K(J)},"shouldProcess")}},H._doTeardown=function(J,ae){H.onunloadFlush(),_3(g,!1),je()},H[eQ]=function(J,ae,Ce){if(!F(J))return Oe(J,ae,Ce)},H[Dje]=function(J,ae){if(!F(J))return Te(J,ae)},H[V1e]=function(J,ae){if(!F(J))return te(J,ae)},H._xdrOnLoad=function(J,ae){if(!F(ae))return le(J,ae)};function le(J,ae){var Ce=Sin(J);if(J&&(Ce+""=="200"||Ce===""))n=0,H[V1e](ae,0);else{var Re=x1e(Ce);Re&&Re[Nje]&&Re[Nje]>Re[Mje]&&!D?H[Dje](ae,Re):H[eQ](ae,d1e(J))}}a(le,"_xdrOnLoad");function Le(){try{var J={xdrOnComplete:a(function(Ce,Re,$e){var Ye=ee($e);if(Ye)return le(Ce,Ye)},"xdrOnComplete"),fetchOnComplete:a(function(Ce,Re,$e,Ye){var ut=ee(Ye);if(ut)return st(Ce.status,ut,Ce.url,ut[qo],Ce.statusText,$e||"")},"fetchOnComplete"),xhrOnComplete:a(function(Ce,Re,$e){var Ye=ee($e);if(Ye)return me(Ce,Ye,Ye[qo])},"xhrOnComplete"),beaconOnRetry:a(function(Ce,Re,$e){return Ht(Ce,Re,$e)},"beaconOnRetry")},ae={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:U,disableBeacon:!T,disableBeaconSync:!S,senderOnCompleteCallBack:J};return ae}catch{}return null}a(Le,"_getSendPostMgrConfig");function me(J,ae,Ce){J.readyState===4&&st(J.status,ae,J.responseURL,Ce,oY(J),Sin(J)||J.response)}a(me,"_xhrReadyStateChange");function Oe(J,ae,Ce){Jr(H[DA](),2,26,"Failed to send telemetry.",{message:ae}),H._buffer&&H._buffer[TY](J)}a(Oe,"_onError");function Te(J,ae){for(var Ce=[],Re=[],$e=ae.errors.reverse(),Ye=0,ut=$e;Ye0&&H[V1e](J,ae[Mje]),Ce[qo]>0&&H[eQ](Ce,oY(null,["partial success",ae[Mje],"of",ae.itemsReceived].join(" "))),Re[qo]>0&&(be(Re),Jr(H[DA](),2,40,"Partial success. Delivered: "+J[qo]+", Failed: "+Ce[qo]+". Will retry to send "+Re[qo]+" our of "+ae[Nje]+" items"))}a(Te,"_onPartialSuccess");function te(J,ae){H._buffer&&H._buffer[TY](J)}a(te,"_onSuccess");function ee(J){try{if(J){var ae=J,Ce=ae.oriPayload;return Ce&&Ce[qo]?Ce:null}}catch{}return null}a(ee,"_getPayloadArr");function K(J,ae){if(R)return!1;if(!J)return ae&&Jr(ae,1,7,"Cannot send empty telemetry"),!1;if(J.baseData&&!J[Oje])return ae&&Jr(ae,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(J[Oje]||(J[Oje]="EventData"),!H[tce])return ae&&Jr(ae,1,28,"Sender was not initialized"),!1;if(ne(J))J[R1e]=H._sample[ice];else return ae&&Jr(ae,2,33,"Telemetry item was sampled out and not sent",{SampleRate:H._sample[ice]}),!1;return!0}a(K,"_validate");function he(J,ae){var Ce=J.iKey||x,Re=e.constructEnvelope(J,Ce,ae,k);if(!Re){Jr(ae,1,47,"Unable to create an AppInsights envelope");return}var $e=!1;if(J[Xh]&&J[Xh][k1e]&&(Ct(J[Xh][k1e],function(Ye){try{Ye&&Ye(Re)===!1&&($e=!0,E3(ae,"Telemetry processor check returns false"))}catch(ut){Jr(ae,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+Kp(ut),{exception:hr(ut)},!0)}}),delete J[Xh][k1e]),!$e)return Re}a(he,"_getEnvelope");function X(J){var ae=bin,Ce=H[DA]();try{var Re=K(J,Ce),$e=null;Re&&($e=he(J,Ce)),$e&&(ae=u.serialize($e))}catch{}return ae}a(X,"_serialize");function de(J){var ae=bin;return J&&J[qo]&&(ae="["+J.join(",")+"]"),ae}a(de,"_batch");function Be(J){var ae=Fe();return{urlString:y,data:J,headers:ae}}a(Be,"_createPayload");function ne(J){return H._sample.isSampledIn(J)}a(ne,"_isSampledIn");function ue(J,ae,Ce,Re){ae===200&&J?H._onSuccess(J,J[qo]):Re&&H[eQ](J,Re)}a(ue,"_getOnComplete");function Ne(J,ae,Ce,Re){Re===void 0&&(Re=!0);var $e=a(function(ce,Pe,Me){return ue(ae,ce,Pe,Me)},"onComplete"),Ye=xe(ae),ut=J&&J.sendPOST;if(ut&&Ye){Re&&H._buffer[Jae](ae);var yt,$t=!1,Tt,We;return V.preparePayload(function(ce){yt=ut(ce,$e,!Ce),$t=!0,Tt&&Bqe(yt,Tt,We)},ie,Ye,!Ce),$t?yt:$d(function(ce,Pe){Tt=ce,We=Pe})}return null}a(Ne,"_doSend");function xe(J){if(pr(J)&&J[qo]>0){var ae=H[DP].batchPayloads(J),Ce=Fe(),Re={data:ae,urlString:y,headers:Ce,disableXhrSync:U,disableFetchKeepAlive:!j,oriPayload:J};return Re}return null}a(xe,"_getPayload");function Fe(){try{var J=f||{};return Eje(y)&&(J[yje[6]]=yje[7]),J}catch{}return null}a(Fe,"_getHeaders");function tt(J){var ae=J?J[qo]:0;return H[DP].size()+ae>E?((!g||g.isOnline())&&H[ece](!0,null,10),!0):!1}a(tt,"_checkMaxSize");function st(J,ae,Ce,Re,$e,Ye){var ut=null;if(H._appId||(ut=x1e(Ye),ut&&ut.appId&&(H._appId=ut.appId)),(J<200||J>=300)&&J!==0){if((J===301||J===307||J===308)&&!vt(Ce)){H[eQ](ae,$e);return}if(g&&!g.isOnline()){if(!D){var yt=10;be(ae,yt),Jr(H[DA](),2,40,". Offline - Response Code: ".concat(J,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(ae.length," items."))}return}!D&&Z(J)?(be(ae),Jr(H[DA](),2,40,". Response code "+J+". Will retry to send "+ae[qo]+" items.")):H[eQ](ae,$e)}else vt(Ce),J===206?(ut||(ut=x1e(Ye)),ut&&!D?H[Dje](ae,ut):H[eQ](ae,$e)):(n=0,H[V1e](ae,Re))}a(st,"_checkResponsStatus");function vt(J){return d>=10?!1:!Xt(J)&&J!==""&&J!==y?(y=J,++d,!0):!1}a(vt,"_checkAndUpdateEndPointUrl");function Pt(J,ae){if(m)m(J,!1);else{var Ce=V&&V[$1e]([3],!0);return Ne(Ce,J,ae)}}a(Pt,"_doUnloadSend");function Ht(J,ae,Ce){var Re=J,$e=Re&&Re.oriPayload;if(W)Y&&Y($e,!0),Jr(H[DA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var Ye=[],ut=0;ut<$e[qo];ut++){var yt=$e[ut],$t=[yt],Tt=xe($t);Ce(Tt,ae)?H._onSuccess($t,$t[qo]):Ye[Gx](yt)}Ye[qo]>0&&(Y&&Y(Ye,!0),Jr(H[DA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a(Ht,"_onBeaconRetry");function F(J){try{if(J&&J[qo])return vi(J[0])}catch{}return null}a(F,"_isStringArr");function se(J,ae){var Ce=null;if(pr(J)){for(var Re=J[qo],$e=0;$e-1}a(Z,"_isRetriable");function ve(){var J="getNotifyMgr",ae,Ce=H.core;return Ce&&(Ce[J]?ae=Ce[J]():ae=Ce._notificationManager),ae}a(ve,"_getNotifyMgr");function Ge(J,ae){var Ce=ve();if(Ce&&Ce.eventsSendRequest)try{Ce.eventsSendRequest(J,ae)}catch(Re){Jr(H[DA](),1,74,"send request notification failed: "+Kp(Re),{exception:hr(Re)})}}a(Ge,"_notifySendRequest");function qe(J,ae){var Ce=ae.disableInstrumentationKeyValidation,Re=Xt(Ce)?!1:Ce;if(Re)return!0;var $e="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",Ye=new RegExp($e);return Ye.test(J)}a(qe,"_validateInstrumentationKey");function je(){H[tce]=null,H[DP]=null,H._appId=null,H._sample=null,f={},g=null,n=0,o=null,s=null,c=!1,l=null,u=null,d=0,h=0,m=null,A=null,y=null,_=null,E=0,v=!1,w=null,R=!1,x=null,k=NP,D=!1,O=null,q=NP,U=!1,j=!1,W=!1,Q=null,Y=null,V=null,$i(H,"_senderConfig",{g:a(function(){return zqe({},Tin)},"g")})}a(je,"_initDefaults")}),r}return a(e,"Sender"),e.constructEnvelope=function(r,n,o,s){var c;n!==r.iKey&&!Xt(n)?c=Ux(Ux({},r),{iKey:n}):c=r;var l=qwo[c.baseType]||O4t;return l(o,c,s)},e})(I1e);p();var RY="instrumentationKey",W1e="connectionString",oce="endpointUrl",sce="userOverrideEndpointUrl";var kY,F4t,U4t=void 0,jwo=(kY={diagnosticLogInterval:Qae(Hwo,1e4)},kY[W1e]=U4t,kY.endpointUrl=U4t,kY[RY]=U4t,kY.featureOptIn=(F4t={},F4t.zipPayload={mode:1},F4t),kY.extensionConfig={},kY);function Hwo(t){return t&&t>0}a(Hwo,"_chkDiagLevel");var xin=(function(){function t(e){var r=new s4t,n;(Xt(e)||Xt(e[RY])&&Xt(e[W1e]))&&ul("Invalid input configuration"),ki(t,this,function(s){$i(s,"config",{g:a(function(){return n},"g")}),c(),s.initialize=c,s.track=o,iY(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=Jh(e||{},jwo);n=l.cfg,r.addUnloadHook(Qx(l,function(){var u=n[W1e];if(u0(u)){var d=c1e(function(g,A){Pl(u,function(y){var _=y.value,E=n[RY];if(!y.rejected&&_){n[W1e]=_;var v=F1e(_);E=v.instrumentationkey||E}g(E)})}),f=c1e(function(g,A){Pl(u,function(y){var _=y.value,E=n[oce];if(!y.rejected&&_){var v=F1e(_),S=v.ingestionendpoint;E=S?S+ZM:E}g(E)})});n[RY]=d,n[oce]=n[sce]||f}if(vi(u)){var h=F1e(u),m=h.ingestionendpoint;n[oce]=n[sce]?n[sce]:m+ZM,n[RY]=h.instrumentationkey||n[RY]}n[oce]=n[sce]?n[sce]:n[oce]})),r.initialize(n,[new B4t])}a(c,"_initialize")});function o(s){s&&(s.baseData=s.baseData||{},s.baseType=s.baseType||"EventData"),r.track(s)}a(o,"_track")}return a(t,"ApplicationInsights"),t.__ieDyn=1,t})();var R1=fe(require("os"));var ace=class{constructor(e,r,n,o){this.ctx=e;this.namespace=r;this.onCopilotToken=a(e=>{this.commonProperties["common.isinternal"]=e?.isInternalUser()?"true":"false";let r=e.getTokenValue("tid");r!==void 0&&(this.tags["ai.user.id"]=r)},"onCopilotToken");this.xhrOverride={sendPOST:a((e,r)=>{if(typeof e.data!="string")throw new Error(`AppInsightsReporter only supports string payloads, received ${typeof e.data}`);let n=e.headers??{};n["Content-Type"]="application/json";let o={method:"POST",headers:n,body:e.data};this.ctx.get(Jt).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Br.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")};this.client=new xin({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[Ije]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:Gwo(e),this.commonProperties=n?.excludeCommonProperties?{}:$wo(e),this.#e=ws(e,this.onCopilotToken),o&&this.onCopilotToken(o)}static{a(this,"AppInsightsReporter")}#e;sendTelemetryEvent(e,r,n){r={...r,...this.commonProperties};let o=this.qualifyEventName(e);this.client.track({name:o,tags:this.tags,data:{...r,...n},baseType:"EventData",baseData:{name:o,properties:r,measurements:n}})}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}};function Gwo(t){let e={},r=t.get(za);e["ai.session.id"]=r.sessionId;let n=t.get(Gp);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${R1.type()} ${R1.release()}`,e["ai.device.osArchitecture"]=R1.arch(),e["ai.device.osPlatform"]=R1.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(As).getVersion(),e}a(Gwo,"getTags");function $wo(t){let e={};e.common_os=R1.platform(),e.common_platformversion=R1.release(),e.common_arch=R1.arch(),e.common_cpu=Array.from(new Set(R1.cpus().map(n=>n.model))).join();let r=t.get(za);return e.common_vscodemachineid=r.machineId,e.common_vscodesessionid=r.sessionId,e.client_deviceid=r.devDeviceId,e.common_uikind=r.uiKind,e.common_remotename=r.remoteName,e.common_isnewappinstall="",e}a($wo,"getCommonProperties");p();p();p();p();p();p();var z1e=mqe;var tO=z1e({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var rQ=z1e({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var PY="toLowerCase",xn="length",cce="warnToConsole",k3="throwInternal",rO="watch",nQ="apply",so="push",$x="splice",od="logger",nO="cancel",P3="initialize",iO="identifier",lce="removeNotificationListener",uce="addNotificationListener",FC="isInitialized",Y1e="getNotifyMgr",iQ="getPlugin",MP="name",dg="processNext",Bje="getProcessTelContext",D3="value",oQ="enabled",Q4t="stopPollingInternalLogs",Vx="unload",K1e="onComplete",Fje="version",Uje="loggingLevelConsole",oO="createNew",k1="teardown",dce="messageId",sO="message",UC="diagLog",sQ="_doTeardown",DY="update",P1="getNext",aQ="setNextPlugin",J1e="userAgent",N3="split",OP="replace",q4t="substring",Qje="indexOf",M3="type",j4t="evtName",LP="status",H4t="getAllResponseHeaders",Z1e="isChildEvt",D1="data",NY="getCtx",BP="setCtx";var X1e="headers",fce="urlString",MY="timeout";var qje="traceFlags";var G4t;function win(t,e){G4t||(G4t=WSe("AggregationError",function(n,o){o[xn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` -`.concat(o," > ").concat(hr(n))}),new G4t(r,e||[])}a(win,"throwAggregationError");p();p();p();p();p();var N1=void 0,Rs="",OY="channels",np="core",jje="createPerfMgr",eTe="disabled",O3="extensionConfig",LY="extensions",QC="processTelemetry",BY="priority",pce="eventsSent",cQ="eventsDiscarded",hce="eventsSendRequest",aO="perfEvent",Hje="offlineEventsStored",Gje="offlineBatchSent",$je="offlineBatchDrop",mce="getPerfMgr",Vje="domain",Wje="path",Rin="Not dynamic - ";var Vwo="getPrototypeOf",Wwo=/-([a-z])/g,zwo=/([^\w\d_$])/g,Ywo=/^(\d+[\w\d_$])/,qHl=Object[Vwo];function lQ(t){return!Xt(t)}a(lQ,"isNotNullOrUndefined");function gce(t){var e=t;return e&&vi(e)&&(e=e[OP](Wwo,function(r,n){return n.toUpperCase()}),e=e[OP](zwo,"_"),e=e[OP](Ywo,function(r,n){return"_"+n})),e}a(gce,"normalizeJsName");function p0(t,e){return t&&e?vu(t,e)!==-1:!1}a(p0,"strContains");function Ace(t){return t&&t.toISOString()||""}a(Ace,"toISOString");function yce(t){return c3(t)?t[MP]:Rs}a(yce,"getExceptionName");function L3(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(L3,"setValue");function zje(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Bn(r)?{}:r,t[e]=n)):n=Bn(r)?{}:r,n}a(zje,"getSetValue");function Kwo(t,e){var r=null,n=null;return qr(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][nQ](n,o)}}a(Kwo,"_createProxyFunction");function uQ(t,e,r,n,o){t&&e&&r&&(o!==!1||Bn(t[e]))&&(t[e]=Kwo(r,n))}a(uQ,"proxyFunctionAs");function dQ(t,e,r,n){return t&&e&&td(t)&&pr(r)&&Ct(r,function(o){vi(o)&&uQ(t,o,e,o,n)}),t}a(dQ,"proxyFunctions");function cO(t){return t&&l3&&(t=N7(l3({},t))),t}a(cO,"optimizeObject");function Yje(t,e,r){var n=e&&e.featureOptIn&&e.featureOptIn[t];if(t&&n){var o=n.mode;if(o===3)return!0;if(o===2)return!1}return r}a(Yje,"isFeatureEnabled");function lO(t){try{return t.responseText}catch{}return null}a(lO,"getResponseText");function Kje(t,e){return t?"XDomainRequest,Response:"+lO(t)||"":e}a(Kje,"formatErrorMessageXdr");function rTe(t,e){return t?"XMLHttpRequest,Status:"+t[LP]+",Response:"+lO(t)||t.response||"":e}a(rTe,"formatErrorMessageXhr");function nTe(t,e){return e&&(zh(e)?t=[e].concat(t):pr(e)&&(t=e.concat(t))),t}a(nTe,"prependTransports");var Jwo="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",kin="withCredentials",Zwo="timeout";function $4t(t,e,r,n,o,s){n===void 0&&(n=!1),o===void 0&&(o=!1);function c(u,d,f){try{u[d]=f}catch{}}a(c,"_wrapSetXhrProp");var l=new XMLHttpRequest;return n&&c(l,Jwo,n),r&&c(l,kin,r),l.open(t,e,!o),r&&c(l,kin,r),!o&&s&&c(l,Zwo,s),l}a($4t,"openXhr");function V4t(t){var e={};if(vi(t)){var r=Li(t)[N3](/[\r\n]+/);Ct(r,function(n){if(n){var o=n[Qje](": ");if(o!==-1){var s=Li(n.substring(0,o))[PY](),c=Li(n[q4t](o+1));e[s]=c}else e[Li(n)]=1}})}return e}a(V4t,"convertAllHeadersToMap");function tTe(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Li(n))}return t}a(tTe,"_appendHeader");var Xwo="kill-duration",eRo="kill-duration-seconds",tRo="time-delta-millis";function fQ(t,e){var r={};return t[H4t]?r=V4t(t[H4t]()):e&&(r=tTe(r,t,tRo),r=tTe(r,t,Xwo),r=tTe(r,t,eRo)),r}a(fQ,"_getAllResponseHeaders");p();p();var rRo="location",nRo="console",Pin="JSON",iRo="crypto",oRo="msCrypto",sRo="ReactNative",aRo="msie",cRo="trident/",Din="XMLHttpRequest",W4t=null,z4t=null,lRo=!1,_ce=null,Y4t=null;function Nin(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[I1];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!Bn(o[e])}catch{}}return r}a(Nin,"_hasProperty");function Ece(t){if(t&&lRo){var e=Oi("__mockLocation");if(e)return e}return typeof location===Fx&&location?location:Oi(rRo)}a(Ece,"getLocation");function Jje(){return typeof console!==T1?console:Oi(nRo)}a(Jje,"getConsole");function iTe(){return!!(typeof JSON===Fx&&JSON||Oi(Pin)!==null)}a(iTe,"hasJSON");function Zje(){return iTe()?JSON||Oi(Pin):null}a(Zje,"getJSON");function Xje(){return Oi(iRo)}a(Xje,"getCrypto");function eHe(){return Oi(oRo)}a(eHe,"getMsCrypto");function vce(){var t=nd();return t&&t.product?t.product===sRo:!1}a(vce,"isReactNative");function FY(){var t=nd();if(t&&(t[J1e]!==z4t||W4t===null)){z4t=t[J1e];var e=(z4t||Rs)[PY]();W4t=p0(e,aRo)||p0(e,cRo)}return W4t}a(FY,"isIE");function Cce(t){return(Y4t===null||t===!1)&&(Y4t=Wz()&&!!nd().sendBeacon),Y4t}a(Cce,"isBeaconsSupported");function bce(t){var e=!1;try{e=!!Oi("fetch");var r=Oi("Request");e&&t&&r&&(e=Nin(r,"keepalive"))}catch{}return e}a(bce,"isFetchSupported");function tHe(){return _ce===null&&(_ce=typeof XDomainRequest!==T1,_ce&&oTe()&&(_ce=_ce&&!Nin(Oi(Din),"withCredentials"))),_ce}a(tHe,"useXDomainRequest");function oTe(){var t=!1;try{var e=Oi(Din);t=!!e}catch{}return t}a(oTe,"isXhrSupported");var Min=4294967296,UY=4294967295,Oin=123456789,Lin=987654321,Bin=!1,sTe=Oin,aTe=Lin;function uRo(t){t<0&&(t>>>=0),sTe=Oin+t&UY,aTe=Lin-t&UY,Bin=!0}a(uRo,"_mwcSeed");function dRo(){try{var t=kl()&2147483647;uRo((Math.random()*Min^t)+t)}catch{}}a(dRo,"_autoSeedMwc");function K4t(t){var e=0,r=Xje()||eHe();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&UY),e===0&&FY()&&(Bin||dRo(),e=fRo()&UY),e===0&&(e=E1(Min*Math.random()|0)),t||(e>>>=0),e}a(K4t,"random32");function fRo(t){aTe=36969*(aTe&65535)+(aTe>>16)&UY,sTe=18e3*(sTe&65535)+(sTe>>16)&UY;var e=(aTe<<16)+(sTe&65535)>>>0&UY|0;return t||(e>>>=0),e}a(fRo,"mwcRandom32");function J4t(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=K4t()>>>0,n=0,o=Rs;o[xn]>>=6,n===5&&(r=(K4t()<<2&4294967295|r&3)>>>0,n=0);return o}a(J4t,"newId");var Fin="3.3.10",pRo="."+J4t(6),hRo=0;function Uin(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(Uin,"_canAcceptData");function mRo(t,e){var r=e[t.id];if(!r){r={};try{Uin(e)&&$i(e,t.id,{e:!1,v:r})}catch{}}return r}a(mRo,"_getCache");function Wx(t,e){return e===void 0&&(e=!1),gce(t+hRo+++(e?"."+Fin:Rs)+pRo)}a(Wx,"createUniqueNamespace");function rHe(t){var e={id:Wx("_aiData-"+(t||Rs)+"."+Fin),accept:a(function(r){return Uin(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[gce(n)]:(s&&(c=mRo(e,r),c[gce(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(rHe,"createElmNodeData");p();function nHe(t){return t&&td(t)&&!pr(t)&&(t.isVal||t.fb||kA(t,"v")||kA(t,"mrg")||kA(t,"ref")||t.set)}a(nHe,"_isConfigDefaults");function Qin(t,e,r){var n,o=r.dfVal||Eae;if(e&&r.fb){var s=r.fb;pr(s)||(s=[s]);for(var c=0;c0&&win("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[xn]>0){c||(c=[]),l||(l=Yp(function(){l=null,f()},0));for(var A=0;A0?Pl(Tce(t[0],e),function(){rLt(x7(t,1),e,r)}):r(),n}a(rLt,"doUnloadAll");p();var Hin=500,nLt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function Gin(t){return{mrg:!0,v:t}}a(Gin,"cfgDfMerge");p();p();var iLt=[pce,cQ,hce,aO],lHe=null,cHe;function bRo(t,e){return function(){var r=arguments,n=oLt(e);if(n){var o=n.listener;o&&o[t]&&o[t][nQ](o,r)}}}a(bRo,"_listenerProxyFunc");function SRo(){var t=Oi("Microsoft");return t&&(lHe=t.ApplicationInsights),lHe}a(SRo,"_getExtensionNamespace");function oLt(t){var e=lHe;return!e&&t.disableDbgExt!==!0&&(e=lHe||SRo()),e?e.ChromeDbgExt:null}a(oLt,"getDebugExt");function $in(t){if(!cHe){cHe={};for(var e=0;e=A&&(d[T](S[sO]),n[w]=!0)}else o>=A&&d[T](S[sO]);f(A,S)}},d.debugToConsole=function(A){sLt("debug",A),g("warning",A)},d[cce]=function(A){sLt("warn",A),g("warning",A)},d.errorToConsole=function(A){sLt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[Vx]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var _=!0,E=xRo+y[dce];if(n[E]?_=!1:n[E]=!0,_&&(A<=s&&(d.queue[so](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",S=new xce(23,v,!1);d.queue[so](S),A===1?d.errorToConsole(v):d[cce](v)}}}a(f,"_logInternalMessage");function h(A){return M1(Zp(A,wRo,d).cfg,function(y){var _=y.cfg;o=_[Uje],s=_.loggingLevelTelemetry,c=_.maxMessageLimit,l=_.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var _=oLt(e||{});_&&_[UC]&&_[UC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function zin(t){return t||new QY}a(zin,"_getLogger");function La(t,e,r,n,o,s){s===void 0&&(s=!1),zin(t)[k3](e,r,n,o,s)}a(La,"_throwInternal");function dO(t,e){zin(t)[cce](e)}a(dO,"_warnToConsole");var aLt,pQ,Yin="toGMTString",Kin="toUTCString",uLt="cookie",cLt="expires",Jin="isCookieUseDisabled",hTe="disableCookiesUsage",Zin="_ckMgr",uHe=null,lLt=null,Xin=null,fO,eon={},ton={},kRo=(aLt={cookieCfg:Gin((pQ={},pQ[Vje]={fb:"cookieDomain",dfVal:lQ},pQ.path={fb:"cookiePath",dfVal:lQ},pQ.enabled=N1,pQ.ignoreCookies=N1,pQ.blockedCookies=N1,pQ.disableCookieDefer=!1,pQ)),cookieDomain:N1,cookiePath:N1},aLt[hTe]=N1,aLt);function dLt(){!fO&&(fO=Aqe(function(){return bf()}))}a(dLt,"_getDoc");function dHe(t){return t?t.isEnabled():!0}a(dHe,"_isMgrEnabled");function aon(t,e){return e&&t&&pr(t.ignoreCookies)?Jo(t.ignoreCookies,e)!==-1:!1}a(aon,"_isIgnoredCookie");function ron(t,e){return e&&t&&pr(t.blockedCookies)&&Jo(t.blockedCookies,e)!==-1?!0:aon(t,e)}a(ron,"_isBlockedCookie");function non(t,e){var r=e[oQ];if(Xt(r)){var n=void 0;Bn(t[Jin])||(n=!t[Jin]),Bn(t[hTe])||(n=!t[hTe]),r=n}return r}a(non,"_isCfgEnabled");function fLt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(_){var E,v=(E={},E[Wje]=_||"/",E[cLt]="Thu, 01 Jan 1970 00:00:01 GMT",E);return FY()||(v["max-age"]="0"),oon(Rs,v)}a(h,"_formatDeletionValue");function m(_,E,v,S){var T={},w=Li(_||Rs),R=vu(w,";");if(R!==-1&&(w=Li(qM(_,R)),T=con(tp(_,R+1))),L3(T,Vje,v||o,y1,Bn),!Xt(E)){var x=FY();if(Bn(T[cLt])){var k=kl(),D=k+E*1e3;if(D>0){var N=new Date;N.setTime(D),L3(T,cLt,ion(N,x?Yin:Kin)||ion(N,x?Yin:Kin)||Rs,y1)}}x||L3(T,"max-age",Rs+E,null,Bn)}var O=Ece();return O&&O.protocol==="https:"&&(L3(T,"secure",null,null,Bn),lLt===null&&(lLt=!lon((nd()||{})[J1e])),lLt&&L3(T,"SameSite","None",null,Bn)),L3(T,Wje,S||n,null,Bn),oon(w,T)}a(m,"_formatSetCookieValue");function g(_){if(f)for(var E=f[xn]-1;E>=0;E--)f[E].n===_&&f[$x](E,1)}a(g,"_removePendingCookie");function A(){pTe(e)&&f&&(Ct(f,function(_){ron(r,_.n)||(_.o===0?u(_.n,_.v):_.o===1&&d(_.n,_.v))}),f=[])}a(A,"_flushPendingCookies"),t=Zp(t||ton,null,e).cfg,s=M1(t,function(_){_.setDf(_.cfg,kRo),r=_.ref(_.cfg,"cookieCfg"),n=r[Wje]||"/",o=r[Vje],r.disableCookieDefer?f=null:f===null&&(f=[]);var E=c;c=non(t,r)!==!1,l=r.getCookie||PRo,u=r.setCookie||son,d=r.delCookie||son,!E&&c&&f&&A()},e);var y={isEnabled:a(function(){var _=non(t,r)!==!1&&c&&pTe(e),E=ton[Zin];return _&&E&&y!==E&&(_=dHe(E)),_},"isEnabled"),setEnabled:a(function(_){r[oQ]=_,Bn(t[hTe])||(t[hTe]=!_)},"setEnabled"),set:a(function(_,E,v,S,T){var w=!1,R=ron(r,_);if(!R){var x=m(E,v,S,T);dHe(y)?(u(_,x),w=!0):f&&(g(_),f[so]({n:_,o:0,v:x}),w=!0)}return w},"set"),get:a(function(_){var E=Rs,v=aon(r,_);if(!v){if(dHe(y))E=l(_);else if(f)for(var S=f[xn]-1;S>=0;S--){var T=f[S];if(T.n===_){if(T.o===0){var w=T.v,R=vu(w,";");E=R!==-1?Li(qM(w,R)):Li(w)}break}}}return E},"get"),del:a(function(_,E){var v=!1;return dHe(y)?v=y.purge(_,E):f&&(g(_),f[so]({n:_,o:1,v:h(E)}),v=!0),v},"del"),purge:a(function(_,E){var v=!1;return pTe(e)&&(d(_,h(E)),v=!0),v},"purge"),unload:a(function(_){s&&s.rm(),s=null,f=null},"unload")};return y[Zin]=y,y}a(fLt,"createCookieMgr");function pTe(t){if(uHe===null){uHe=!1,!fO&&dLt();try{var e=fO.v||{};uHe=e[uLt]!==void 0}catch(r){La(t,2,68,"Cannot access document.cookie - "+yce(r),{exception:hr(r)})}}return uHe}a(pTe,"areCookiesSupported");function con(t){var e={};if(t&&t[xn]){var r=Li(t)[N3](";");Ct(r,function(n){if(n=Li(n||Rs),n){var o=vu(n,"=");o===-1?e[n]=null:e[Li(qM(n,o))]=Li(tp(n,o+1))}})}return e}a(con,"_extractParts");function ion(t,e){return qr(t[e])?t[e]():null}a(ion,"_formatDate");function oon(t,e){var r=t||Rs;return Zr(e,function(n,o){r+="; "+n+(Xt(o)?Rs:"="+o)}),r}a(oon,"_formatCookieValue");function PRo(t){var e=Rs;if(!fO&&dLt(),fO.v){var r=fO.v[uLt]||Rs;Xin!==r&&(eon=con(r),Xin=r),e=Li(eon[t]||Rs)}return e}a(PRo,"_getCookieValue");function son(t,e){!fO&&dLt(),fO.v&&(fO.v[uLt]=t+"="+e)}a(son,"_setCookieValue");function lon(t){return vi(t)?!!(p0(t,"CPU iPhone OS 12")||p0(t,"iPad; CPU OS 12")||p0(t,"Macintosh; Intel Mac OS X 10_14")&&p0(t,"Version/")&&p0(t,"Safari")||p0(t,"Macintosh; Intel Mac OS X 10_14")&&f3(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||p0(t,"Chrome/5")||p0(t,"Chrome/6")||p0(t,"UnrealEngine")&&!p0(t,"Chrome")||p0(t,"UCBrowser/12")||p0(t,"UCBrowser/11")):!1}a(lon,"uaDisallowsSameSiteNone");p();var DRo={perfEvtsSendAll:!1};function NRo(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){ep(r.fn,[r.arg])})}a(NRo,"_runScheduledListeners");function hQ(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[so]({fn:n,arg:o}),r.h=r.h||Yp(NRo,0,r)):ep(n,[o]))})}a(hQ,"_runListeners");var pLt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Zp(e,DRo);n=c[rO](function(l){r=!!l.cfg.perfEvtsSendAll}),ki(t,this,function(l){$i(l,"listeners",{g:a(function(){return o},"g")}),l[uce]=function(u){o[so](u)},l[lce]=function(u){for(var d=Jo(o,u);d>-1;)o[$x](d,1),d=Jo(o,u)},l[pce]=function(u){hQ(o,pce,s,function(d){d[pce](u)})},l[cQ]=function(u,d){hQ(o,cQ,s,function(f){f[cQ](u,d)})},l[hce]=function(u,d){hQ(o,hce,d?s:null,function(f){f[hce](u,d)})},l[aO]=function(u){u&&(r||!u[Z1e]())&&hQ(o,aO,null,function(d){u.isAsync?Yp(function(){return d[aO](u)},0):d[aO](u)})},l[Hje]=function(u){u&&u[xn]&&hQ(o,Hje,s,function(d){d[Hje](u)})},l[Gje]=function(u){u&&u[D1]&&hQ(o,Gje,s,function(d){d[Gje](u)})},l[$je]=function(u,d){if(u>0){var f=d||0;hQ(o,$je,s,function(h){h[$je](u,f)})}},l[Vx]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[nO](),s.h=null,s.cb=[]},"_finishUnload"),f;if(hQ(o,"unload",null,function(h){var m=h[Vx](u);m&&(f||(f=[]),f[so](m))}),f)return $d(function(h){return Pl(Uqe(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Rce="ctx",mLt="ParentContextKey",mTe="ChildrenContextKey",MRo=null,kce=(function(){function t(e,r,n){var o=this;if(o.start=kl(),o[MP]=e,o.isAsync=n,o[Z1e]=function(){return!1},qr(r)){var s;$i(o,"payload",{g:a(function(){return!s&&qr(r)&&(s=r(),r=null),s},"g")})}o[NY]=function(c){return c?c===t[mLt]||c===t[mTe]?o[c]:(o[Rce]||{})[c]:null},o[BP]=function(c,l){if(c)if(c===t[mLt])o[c]||(o[Z1e]=function(){return!0}),o[c]=l;else if(c===t[mTe])o[c]=l;else{var u=o[Rce]=o[Rce]||{};u[c]=l}},o.complete=function(){var c=0,l=o[NY](t[mTe]);if(pr(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(_){La(r[od],2,73,"Unexpected Exception during onComplete - "+hr(_))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,_=e.cfg;if(_&&g){var E=_[O3];!E&&A&&(E={}),_[O3]=E,E=e.ref(_,O3),E&&(y=E[g],!y&&A&&(y={}),E[g]=y,y=e.ref(E,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&Zr(A,function(_,E){if(Xt(y[_])){var v=e.cfg[_];(v||!Xt(v))&&(y[_]=v)}cTe(e,y,_,E)}),e.setDf(y,A)}a(f,"_resolveExtCfg");function h(g,A,y){y===void 0&&(y=!1);var _,E=d(g,!1),v=e.cfg;return E&&(E[A]||!Xt(E[A]))?_=E[A]:(v[A]||!Xt(v[A]))&&(_=v[A]),_||!Xt(_)?_:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[iQ]();y&&g(y)}}return a(m,"_iterateChain"),c}a(ELt,"_createInternalContext");function zx(t,e,r,n){var o=Zp(e),s=ELt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[QC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),pr(d)&&(d=mQ(d,o.cfg,r,f)),zx(d||c[P1](),o.cfg,r,f)}return a(u,"_createNew"),c[dg]=l,c[oO]=u,c}a(zx,"createProcessTelemetryContext");function Pce(t,e,r){var n=Zp(e.config),o=ELt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[Vx](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),pr(u)&&(u=mQ(u,n.cfg,e,d)),Pce(u||s[P1](),e,d)}return a(l,"_createNew"),s[dg]=c,s[oO]=l,s}a(Pce,"createProcessTelemetryUnloadContext");function gTe(t,e,r){var n=Zp(e.config),o=ELt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){qr(d[DY])&&d[DY](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),pr(u)&&(u=mQ(u,n.cfg,e,d)),gTe(u||s[P1](),e,d)}return a(l,"_createNew"),s[dg]=c,s[oO]=l,s}a(gTe,"createProcessTelemetryUpdateContext");function mQ(t,e,r,n){var o=null,s=!n;if(pr(t)&&t[xn]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&qr(l[QC])){var u=QRo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?mQ([n],e,r):o}a(mQ,"createTelemetryProxyChain");function QRo(t,e,r){var n=null,o=qr(t[QC]),s=qr(t[aQ]),c;t?c=t[iO]+"-"+t[BY]+"-"+hon++:c="Unknown-0-"+hon++;var l={getPlugin:a(function(){return t},"getPlugin"),getNext:a(function(){return n},"getNext"),processTelemetry:f,unload:h,update:m,_id:c,_setNext:a(function(g){n=g},"_setNext")};function u(){var g;return t&&qr(t[pon])&&(g=t[pon]()),g||(g=zx(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,_,E){var v=!1,S=t?t[iO]:FRo,T=g[fon];return T||(T=g[fon]={}),g.setNext(n),t&&Xp(g[np](),function(){return S+":"+y},function(){T[c]=!0;try{var w=n?n._id:Rs;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&La(g[UC](),1,73,"Plugin ["+S+"] failed during "+y+" - "+hr(x)+", run flags: "+hr(T))}},_,E),v}a(d,"_processChain");function f(g,A){A=A||u();function y(_){if(!t||!o)return!1;var E=B3(t);return E[k1]||E[eTe]?!1:(s&&t[aQ](n),t[QC](g,_),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[dg](g)}a(f,"_processTelemetry");function h(g,A){function y(){var _=!1;if(t){var E=B3(t),v=t[np]||E[np];t&&(!v||v===g.core())&&!E[k1]&&(E[np]=null,E[k1]=!0,E[FC]=!1,t[k1]&&t[k1](g,A)===!0&&(_=!0))}return _}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[dg](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var _=!1;if(t){var E=B3(t),v=t[np]||E[np];t&&(!v||v===g.core())&&!E[k1]&&t[DY]&&t[DY](g,A)===!0&&(_=!0)}return _}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[dg](A)}return a(m,"_updatePlugin"),Yh(l)}a(QRo,"createTelemetryPluginProxy");var mon=(function(){function t(e,r,n,o){var s=this,c=zx(e,r,n,o);dQ(s,c,rd(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function ATe(){var t=[];function e(n){n&&t[so](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){La(n[UC](),2,73,"Unexpected error calling unload handler - "+hr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(ATe,"createUnloadHandlerContainer");p();var hHe,mHe;function gHe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){La(n,2,73,"Unloading:"+hr(c))}}),hHe&&o[xn]>hHe&&(mHe?mHe("doUnload",o):La(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Kh(t,n),hHe&&t[xn]>hHe&&(mHe?mHe("Add",t):La(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected.")))}return a(r,"_addHook"),{run:e,add:r}}a(gHe,"createUnloadHookContainer");var vLt,gQ="getPlugin",qRo=(vLt={},vLt[O3]={isVal:lQ,v:{}},vLt),Dce=(function(){function t(){var e=this,r,n,o,s,c;d(),ki(t,e,function(f){f[P3]=function(h,m,g,A){u(h,m,A),r=!0},f[k1]=function(h,m){var g=f[np];if(!g||h&&g!==h[np]())return;var A,y=!1,_=h||Pce(null,g,o&&o[gQ]?o[gQ]():o),E=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(_,m),c.run(_[UC]()),A===!0&&_[dg](E),d())}return a(v,"_unloadCallback"),!f[sQ]||f[sQ](_,E,v)!==!0?v():A=!0,A},f[DY]=function(h,m){var g=f[np];if(!g||h&&g!==h[np]())return;var A,y=!1,_=h||gTe(null,g,o&&o[gQ]?o[gQ]():o),E=m||{reason:0};function v(){y||(y=!0,u(_.getCfg(),_.core(),_[P1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(_,E,v)!==!0?v():A=!0,A},uQ(f,"_addUnloadCb",function(){return s},"add"),uQ(f,"_addHook",function(){return c},"add"),$i(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[UC]=function(f){return l(f)[UC]()},e[FC]=function(){return r},e.setInitialized=function(f){r=f},e[aQ]=function(f){o=f},e[dg]=function(f,h){h?h[dg](f):o&&qr(o[QC])&&o[QC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||zx(null,{},e[np]);o&&o[gQ]?h=m[oO](null,o[gQ]):h=m[oO](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Zp(f,qRo,wce(h)),!m&&h&&(m=h[Bje]()[P1]());var g=o;o&&o[gQ]&&(g=o[gQ]()),e[np]=h,n=zx(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[np]=null,n=null,o=null,c=gHe(),s=ATe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function jRo(t,e,r){var n={id:e,fn:r};Kh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[$x](c,1),-1})},"remove")};return o}a(jRo,"_addInitializer");function HRo(t,e,r){for(var n=!1,o=t[xn],s=0;s"},"v")})}a(XRo,"_createUnloadHook");var AHe=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S,T,w,R,x,k,D,N,O,B,q,M,L,U,j;ki(t,this,function(Q){re(),Q._getDbgPlgTargets=function(){return[x,o]},Q[FC]=function(){return r},Q.activeStatus=function(){return N},Q._setPendingStatus=function(){N=3},Q[P3]=function(ne,ue,Ne,xe){g&&ul(Aon),Q[FC]()&&ul("Core cannot be initialized more than once"),e=Zp(ne,CLt,Ne||Q[od],!1),ne=e.cfg,Be(e[rO](function(st){var vt=st.cfg;B=vt.initInMemoMaxSize||VRo,Y(vt);var Pt=st.ref(st.cfg,O3);Zr(Pt,function(Ht){st.ref(Pt,Ht)})})),s=xe,S=ZRo(e,v,s&&Q[Y1e](),S),K(),Q[od]=Ne;var Fe=ne[LY];if(f=[],f[so].apply(f,Zz(Zz([],ue,!1),Fe,!1)),h=ne[OY],Le(null),(!m||m[xn]===0)&&ul("No "+OY+" available"),h&&h[xn]>1){var tt=Q[iQ]("TeeChannelController");(!tt||!tt.plugin)&&La(n,1,28,"TeeChannel required")}JRo(ne,R,n),R=null,r=!0,N===rQ.ACTIVE&&z()},Q.getChannels=function(){var ne=[];return m&&Ct(m,function(ue){ne[so](ue)}),Yh(ne)},Q.track=function(ne){Xp(Q[mce](),function(){return"AppInsightsCore:track"},function(){ne===null&&(de(ne),ul("Invalid telemetry item")),!ne[MP]&&Xt(ne[MP])&&(de(ne),ul("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||Ace(new Date),ne.ver=ne.ver||"4.0",!g&&Q[FC]()&&N===rQ.ACTIVE?le()[dg](ne):N!==rQ.INACTIVE&&o[xn]<=B&&o[so](ne)},function(){return{item:ne}},!ne.sync)},Q[Bje]=le,Q[Y1e]=function(){return s||(s=new pLt(e.cfg),Q[GRo]=s),s},Q[uce]=function(ne){Q.getNotifyMgr()[uce](ne)},Q[lce]=function(ne){s&&s[lce](ne)},Q.getCookieMgr=function(){return u||(u=fLt(e.cfg,Q[od])),u},Q.setCookieMgr=function(ne){u!==ne&&(Tce(u,!1),u=ne)},Q[mce]=function(){return c||l||gLt()},Q.setPerfMgr=function(ne){c=ne},Q.eventCnt=function(){return o[xn]},Q.releaseQueue=function(){if(r&&o[xn]>0){var ne=o;o=[],N===2?Ct(ne,function(ue){ue.iKey=ue.iKey||w,le()[dg](ue)}):La(n,2,20,"core init status is not active")}},Q.pollInternalLogs=function(ne){return y=ne||null,j=!1,L&&L[nO](),ie(!0)};function Y(ne){var ue=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Xt(ue)){w=null,N=rQ.INACTIVE;var xe="Please provide instrumentation key";r?(La(n,1,100,xe),z()):ul(xe);return}var Fe=[];u0(ue)?(Fe[so](ue),w=null):w=ue,u0(Ne)?(Fe[so](Ne),O=null):O=Ne,Fe[xn]?W(ne,Fe):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ue){q=!1,N=3;var Ne=lQ(ne.initTimeOut)?ne.initTimeOut:WRo,xe=Fqe(ue);M&&M[nO](),M=Yp(function(){M=null,q||V()},Ne),Pl(xe,function(Fe){try{if(q)return;if(!Fe.rejected){var tt=Fe[D3];if(tt&&tt[xn]){var st=tt[0];if(w=st&&st[D3],tt[xn]>1){var vt=tt[1];O=vt&&vt[D3]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=O)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=rQ.INACTIVE,La(n,1,112,"ikey can't be resolved from promises")):N=rQ.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(Q.releaseQueue(),Q.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!L||!L[oQ])&&!j){var ue=ne||n&&n.queue[xn]>0;ue&&(U||(U=!0,Be(e[rO](function(Ne){var xe=Ne.cfg.diagnosticLogInterval;(!xe||!(xe>0))&&(xe=1e4);var Fe=!1;L&&(Fe=L[oQ],L[nO]()),L=vqe(te,xe),L.unref(),L[oQ]=Fe}))),L[oQ]=!0)}return L}a(ie,"_startLogPoller"),Q[Q4t]=function(){j=!0,L&&L[nO](),te()},dQ(Q,function(){return A},["addTelemetryInitializer"]),Q[Vx]=function(ne,ue,Ne){ne===void 0&&(ne=!0),r||ul($Ro),g&&ul(Aon);var xe={reason:50,isAsync:ne,flushComplete:!1},Fe;ne&&!ue&&(Fe=$d(function(vt){ue=vt}));var tt=Pce(Oe(),Q);tt[K1e](function(){v.run(Q[od]),rLt([u,s,n],ne,function(){re(),ue&&ue(xe)})},Q);function st(vt){xe.flushComplete=vt,g=!0,E.run(tt,xe),Q[Q4t](),tt[dg](xe)}return a(st,"_doUnload"),te(),ee(ne,st,6,Ne)||st(!1),Fe},Q[iQ]=me,Q.addPlugin=function(ne,ue,Ne,xe){if(!ne){xe&&xe(!1),X(Eon);return}var Fe=me(ne[iO]);if(Fe&&!ue){xe&&xe(!1),X("Plugin ["+ne[iO]+"] is already loaded!");return}var tt={reason:16};function st(Ht){f[so](ne),tt.added=[ne],Le(tt),xe&&xe(!0)}if(a(st,"_addPlugin"),Fe){var vt=[Fe.plugin],Pt={reason:2,isAsync:!!Ne};Te(vt,Pt,function(Ht){Ht?(tt.removed=vt,tt.reason|=32,st(!0)):xe&&xe(!1)})}else st(!1)},Q.updateCfg=function(ne,ue){ue===void 0&&(ue=!0);var Ne;if(Q[FC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Sae({},e.cfg),newConfig:Sae({},ne),merge:ue},ne=Ne.newConfig;var xe=e.cfg;ne[LY]=xe[LY],ne[OY]=xe[OY]}e._block(function(Fe){var tt=Fe.cfg;bLt(Fe,tt,ne,ue),ue||Zr(tt,function(st){kA(ne,st)||Fe.set(tt,st,N1)}),Fe.setDf(tt,CLt)},!0),e.notify(),Ne&&he(Ne)},Q.evtNamespace=function(){return _},Q.flush=ee,Q.getTraceCtx=function(ne){return T||(T=don()),T},Q.setTraceCtx=function(ne){T=ne||null},Q.addUnloadHook=Be,uQ(Q,"addUnloadCb",function(){return E},"add"),Q.onCfgChange=function(ne){var ue;return r?ue=M1(e.cfg,ne,Q[od]):ue=KRo(R,ne),XRo(ue)},Q.getWParam=function(){return u3()||e.cfg.enableWParam?0:-1};function H(){var ne={};k=[];var ue=a(function(Ne){Ne&&Ct(Ne,function(xe){if(xe[iO]&&xe[Fje]&&!ne[xe.identifier]){var Fe=xe[iO]+"="+xe[Fje];k[so](Fe),ne[xe.identifier]=xe}})},"_addPluginVersions");ue(m),h&&Ct(h,function(Ne){ue(Ne)}),ue(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Zp({},CLt,Q[od]),e.cfg[Uje]=1,$i(Q,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ue){Q.updateCfg(ue,!1)},"s")}),$i(Q,"pluginVersionStringArr",{g:a(function(){return k||H(),k},"g")}),$i(Q,"pluginVersionString",{g:a(function(){return D||(k||H(),D=k.join(";")),D||Rs},"g")}),$i(Q,"logger",{g:a(function(){return n||(n=new QY(e.cfg),e[od]=n),n},"g"),s:a(function(ue){e[od]=ue,n!==ue&&(Tce(n,!1),n=ue)},"s")}),Q[od]=new QY(e.cfg),x=[];var ne=Q.config[LY]||[];ne.splice(0,ne[xn]),Kh(ne,x),A=new gon,o=[],Tce(s,!1),s=null,c=null,l=null,Tce(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,_=Wx("AIBaseCore",!0),E=ATe(),T=null,w=null,v=gHe(),R=[],D=null,k=null,j=!1,L=null,U=!1,N=0,O=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=zx(Oe(),e.cfg,Q);return ne[K1e](ie),ne}a(le,"_createTelCtx");function Le(ne){var ue=YRo(Q[od],Hin,f);d=null,D=null,k=null,m=(h||[])[0]||[],m=pHe(Kh(m,ue[OY]));var Ne=Kh(pHe(ue[np]),m);x=Yh(Ne);var xe=Q.config[LY]||[];xe.splice(0,xe[xn]),Kh(xe,x);var Fe=le();m&&m[xn]>0&&_Lt(Fe[oO](m),Ne),_Lt(Fe,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function me(ne){var ue=null,Ne=null,xe=[];return Ct(x,function(Fe){if(Fe[iO]===ne&&Fe!==A)return Ne=Fe,-1;Fe.getChannel&&xe[so](Fe)}),!Ne&&xe[xn]>0&&Ct(xe,function(Fe){if(Ne=Fe.getChannel(ne),!Ne)return-1}),Ne&&(ue={plugin:Ne,setEnabled:a(function(Fe){B3(Ne)[eTe]=!Fe},"setEnabled"),isEnabled:a(function(){var Fe=B3(Ne);return!Fe[k1]&&!Fe[eTe]},"isEnabled"),remove:a(function(Fe,tt){Fe===void 0&&(Fe=!0);var st=[Ne],vt={reason:1,isAsync:Fe};Te(st,vt,function(Pt){Pt&&Le({reason:32,removed:st}),tt&&tt(Pt)})},"remove")}),ue}a(me,"_getPlugin");function Oe(){if(!d){var ne=(x||[]).slice();Jo(ne,A)===-1&&ne[so](A),d=mQ(pHe(ne),e.cfg,Q)}return d}a(Oe,"_getPluginChain");function Te(ne,ue,Ne){if(ne&&ne[xn]>0){var xe=mQ(ne,e.cfg,Q),Fe=Pce(xe,Q);Fe[K1e](function(){var tt=!1,st=[];Ct(f,function(Pt,Ht){yon(Pt,ne)?tt=!0:st[so](Pt)}),f=st,D=null,k=null;var vt=[];h&&(Ct(h,function(Pt,Ht){var F=[];Ct(Pt,function(se){yon(se,ne)?tt=!0:F[so](se)}),vt[so](F)}),h=vt),Ne&&Ne(tt),ie()}),Fe[dg](ue)}else Ne(!1)}a(Te,"_removePlugins");function te(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[xn]=0,Ct(ne,function(ue){var Ne={name:y||"InternalMessageId: "+ue[dce],iKey:w,time:Ace(new Date),baseType:xce.dataType,baseData:{message:ue[sO]}};Q.track(Ne)})}}a(te,"_flushInternalLogs");function ee(ne,ue,Ne,xe){var Fe=1,tt=!1,st=null;xe=xe||5e3;function vt(){Fe--,tt&&Fe===0&&(st&&st[nO](),st=null,ue&&ue(tt),ue=null)}if(a(vt,"doCallback"),m&&m[xn]>0){var Pt=le()[oO](m);Pt.iterate(function(Ht){if(Ht.flush){Fe++;var F=!1;Ht.flush(ne,function(){F=!0,vt()},Ne)||F||(ne&&st==null?st=Yp(function(){st=null,vt()},xe):vt())}})}return tt=!0,vt(),!0}a(ee,"_flushChannels");function K(){var ne;Be(e[rO](function(ue){var Ne=ue.cfg.enablePerfMgr;if(Ne){var xe=ue.cfg[jje];(ne!==xe||!ne)&&(xe||(xe=zRo),zje(ue.cfg,jje,xe),ne=xe,l=null),!c&&!l&&qr(xe)&&(l=xe(Q,Q[Y1e]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ue=gTe(Oe(),Q);ue[K1e](ie),(!Q._updateHook||Q._updateHook(ue,ne)!==!0)&&ue[dg](ne)}a(he,"_doUpdate");function X(ne){var ue=Q[od];ue?(La(ue,2,73,ne),ie()):ul(ne)}a(X,"_logOrThrowError");function de(ne){var ue=Q[Y1e]();ue&&ue[cQ]([ne],2)}a(de,"_notifyInvalidEvent");function Be(ne){v.add(ne)}a(Be,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var FP="",eko="NoResponseBody",von="&"+eko+"=true",SLt="POST",yHe=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;ki(t,this,function(_,E){var v=!0;q(),_[P3]=function(M,L){o=L,n&&La(o,1,28,"Sender is already initialized"),_.SetConfig(M),n=!0},_._getDbgPlgTargets=function(){return[n,s,l,r]},_.SetConfig=function(M){try{if(c=M.senderOnCompleteCallBack||{},l=!!M.disableCredentials,u=M.fetchCredentials,s=!!M.isOneDs,r=!!M.enableSendPromise,f=!!M.disableXhr,h=!!M.disableBeacon,m=!!M.disableBeaconSync,y=M.timeWrapper,A=!!M.addNoResponse,g=!!M.disableFetchKeepAlive,d={sendPOST:N},s||(v=!1),l){var L=Ece();L&&L.protocol&&L.protocol[PY]()==="file:"&&(v=!1)}return!0}catch{}return!1},_.getSyncFetchPayload=function(){return e},_.getSenderInst=function(M,L){return M&&M[xn]?R(M,L):null},_.getFallbackInst=function(){return d},_[sQ]=function(M,L){q()},_.preparePayload=function(M,L,U,j){if(!L||j||!U[D1]){M(U);return}try{var Q=Oi("CompressionStream");if(!qr(Q)){M(U);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(vi(U[D1])?new TextEncoder().encode(U[D1]):U[D1]),re.close()},"start")}),W=Y.pipeThrough(new Q("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return Pl(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[D3];if(!Le.done)return z[so](Le[D3]),ie+=Le.value[xn],Pl(V.read(),re);for(var me=new Uint8Array(ie),Oe=0,Te=0,te=z;Te0&&(Ct(rd(me),function(K){H.append(K,me[K])}),Oe[X1e]=H),u?Oe.credentials=u:v&&s&&(Oe.credentials="include"),U&&(Oe.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(Q+=von)):le=!0);var Te=new Request(Q,Oe);try{Te[nLt]=!0}catch{}if(!U&&r&&(V=$d(function(K,he){z=K,ie=he})),!Q){w(L),z&&z(!1);return}function te(K,he){he?x(L,s?0:he,{},s?FP:K):x(L,s?0:400,{},s?FP:K)}a(te,"_handleError");function ee(K,he,X){var de=K[LP],Be=c.fetchOnComplete;Be&&qr(Be)?Be(K,L,X||FP,he):x(L,de,{},X||FP)}a(ee,"_onFetchComplete");try{Pl(fetch(s?Q:Te,s?Oe:null),function(K){if(U&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)te(K.reason&&K.reason[sO],499),ie&&ie(K.reason);else{var he=K[D3];try{!s&&!he.ok?(he[LP]?te(he.statusText,he[LP]):te(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,FP),z&&z(!0)):Pl(he.text(),function(X){ee(he,M,X[D3]),z&&z(!0)})}catch(X){he&&he[LP]?te(hr(X),he[LP]):te(hr(X),499),ie&&ie(X)}}})}catch(K){Le||(te(hr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(L,200,{}),z&&z(!0)),s&&!Le&&M[MY]>0&&y&&y.set(function(){Le||(Le=!0,x(L,500,{}),z&&z(!0))},M[MY]),V}a(O,"_doFetchSender");function B(M,L,U){var j=Sf(),Q=new XDomainRequest,Y=M[D1];Q.onload=function(){var H=lO(Q),re=c&&c.xdrOnComplete;re&&qr(re)?re(Q,L,M):x(L,200,{},H)},Q.onerror=function(){x(L,400,{},s?FP:Kje(Q))},Q.ontimeout=function(){x(L,500,{})},Q.onprogress=function(){};var W=j&&j.location&&j.location.protocol||"",V=M[fce];if(!V){w(L);return}if(!s&&V.lastIndexOf(W,0)!==0){var z="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";La(o,2,40,". "+z),T(z,L);return}var ie=s?V:V[OP](/^(https?:)/,"");Q.open(SLt,ie),M[MY]&&(Q[MY]=M[MY]),Q.send(Y),s&&U?y&&y.set(function(){Q.send(Y)},0):Q.send(Y)}a(B,"_xdrSender");function q(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(q,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var won="on",Con="attachEvent",bon="addEventListener",Son="detachEvent",Ton="removeEventListener",TLt="events",ETe="visibilitychange",EHe="pagehide",Ron="pageshow",kon="unload",Pon="beforeunload",Don=Wx("aiEvtPageHide"),Non=Wx("aiEvtPageShow"),tko=/\.[\.]+/g,rko=/[\.]+$/,nko=1,_He=rHe("events"),iko=/^([^.]*)(?:\.(.+)|)/;function Ion(t){return t&&t[OP]?t[OP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Rs):t}a(Ion,"_normalizeNamespace");function ILt(t,e){if(e){var r=Rs;pr(e)?(r=Rs,Ct(e,function(o){o=Ion(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=Ion(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Rs)+r)}var n=iko.exec(t||Rs)||[];return{type:n[1],ns:(n[2]||Rs).replace(tko,".").replace(rko,Rs)[N3](".").sort().join(".")}}a(ILt,"_getEvtNamespace");function Mon(t,e,r){r===void 0&&(r=!0);var n=_He.get(t,TLt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(Mon,"_getRegisteredEvents");function Oon(t,e,r,n){t&&e&&e[M3]&&(t[Ton]?t[Ton](e[M3],r,n):t[Son]&&t[Son](won+e[M3],r))}a(Oon,"_doDetach");function oko(t,e,r,n){var o=!1;return t&&e&&e[M3]&&r&&(t[bon]?(t[bon](e[M3],r,n),o=!0):t[Con]&&(t[Con](won+e[M3],r),o=!0)),o}a(oko,"_doAttach");function xon(t,e,r,n){for(var o=e[xn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[j4t].ns)&&(!n||n(s))&&(Oon(t,s[j4t],s.handler,s.capture),e[$x](o,1))}}a(xon,"_doUnregister");function sko(t,e,r){if(e[M3])xon(t,Mon(t,e[M3]),e,r);else{var n=_He.get(t,TLt,{});Zr(n,function(o,s){xon(t,s,e,r)}),rd(n)[xn]===0&&_He.kill(t,TLt)}}a(sko,"_unregisterEvents");function yQ(t,e){var r;return e?(pr(e)?r=[t].concat(e):r=[t,e],r=ILt("xx",r).ns[N3](".")):r=t,r}a(yQ,"mergeEvtNamespace");function yTe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=ILt(e,n);if(s=oko(t,c,r,o),s&&_He.accept(t)){var l={guid:nko++,evtName:c,handler:r,capture:o};Mon(t,c.type)[so](l)}}catch{}return s}a(yTe,"eventOn");function _Te(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=ILt(e,n),c=!1;sko(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||Oon(t,s,r,o)}catch{}}a(_Te,"eventOff");function xLt(t,e,r){var n=!1,o=Sf();o&&(n=yTe(o,t,e,r),n=yTe(o.body,t,e,r)||n);var s=bf();return s&&(n=yTe(s,t,e,r)||n),n}a(xLt,"addEventHandler");function wLt(t,e,r){var n=Sf();n&&(_Te(n,t,e,r),_Te(n.body,t,e,r));var o=bf();o&&_Te(o,t,e,r)}a(wLt,"removeEventHandler");function Nce(t,e,r,n){var o=!1;return e&&t&&t[xn]>0&&Ct(t,function(s){s&&(!r||Jo(r,s)===-1)&&(o=xLt(s,e,n)||o)}),o}a(Nce,"_addEventListeners");function RLt(t,e,r,n){var o=!1;return e&&t&&pr(t)&&(o=Nce(t,e,r,n),!o&&r&&r[xn]>0&&(o=Nce(t,e,null,n))),o}a(RLt,"addEventListeners");function qY(t,e,r){t&&pr(t)&&Ct(t,function(n){n&&wLt(n,e,r)})}a(qY,"removeEventListeners");function vHe(t,e,r){return RLt([Pon,kon,EHe],t,e,r)}a(vHe,"addPageUnloadEventListener");function CHe(t,e){qY([Pon,kon,EHe],t,e)}a(CHe,"removePageUnloadEventListener");function vTe(t,e,r){function n(c){var l=bf();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=yQ(Don,r),s=Nce([EHe],t,e,o);return(!e||Jo(e,ETe)===-1)&&(s=Nce([ETe],n,e,o)||s),!s&&e&&(s=vTe(t,null,r)),s}a(vTe,"addPageHideEventListener");function bHe(t,e){var r=yQ(Don,e);qY([EHe],t,r),qY([ETe],null,r)}a(bHe,"removePageHideEventListener");function CTe(t,e,r){function n(c){var l=bf();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=yQ(Non,r),s=Nce([Ron],t,e,o);return s=Nce([ETe],n,e,o)||s,!s&&e&&(s=CTe(t,null,r)),s}a(CTe,"addPageShowEventListener");function SHe(t,e){var r=yQ(Non,e);qY([Ron],t,r),qY([ETe],null,r)}a(SHe,"removePageShowEventListener");p();var Mce="",Lon="https://browser.events.data.microsoft.com/OneCollector/1.0/",kLt="version",THe="properties";p();p();var PLt="initialize",DLt="indexOf",pO="timings",NLt="pollInternalLogs",O1="value",IHe="length",xHe="processTelemetryStart";var F3,Bon="4.3.10",bTe="1DS-Web-JS-"+Bon,Fon=i1e.hasOwnProperty;var gko=(F3={},F3[0]=0,F3[2]=6,F3[1]=1,F3[3]=7,F3[4098]=6,F3[4097]=1,F3[4099]=7,F3);var Ako=u3(),yko=bae();function Yx(t){return!(t===Mce||Xt(t))}a(Yx,"isValueAssigned");function MLt(t){if(t){var e=vu(t,"-");if(e>-1)return qM(t,e)}return Mce}a(MLt,"getTenantId");function OLt(t){return!!(t&&zh(t)&&t>=1&&t<=4)}a(OLt,"isLatency");function LLt(t,e,r){if(!e&&!Yx(e)||typeof t!="string")return null;var n=typeof e;if(n==="string"||n==="number"||n==="boolean"||pr(e))e={value:e};else if(n==="object"&&!Fon.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Xt(e[O1])||e[O1]===Mce||!vi(e[O1])&&!zh(e[O1])&&!bP(e[O1])&&!pr(e[O1]))return null;if(pr(e[O1])&&!Qon(e[O1]))return null;if(!Xt(e.kind)){if(pr(e[O1])||!Uon(e.kind))return null;e[O1]=e[O1].toString()}return e}a(LLt,"sanitizeProperty");function STe(t,e,r){var n=-1;if(!Bn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),_ko(r))n===-1&&(n=0),n|=r;else{var o=gko[wHe(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(STe,"getCommonSchemaMetaData");function Oce(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[IHe],d=arguments;for(bP(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(Uon,"isValueKind");function _ko(t){return t>=0&&t<=9}a(_ko,"isDataType");function Qon(t){return t[IHe]>0}a(Qon,"isArrayValid");function RHe(t,e){var r=t;r[pO]=r[pO]||{},r[pO][xHe]=r[pO][xHe]||{},r[pO][xHe][e]=L1()}a(RHe,"setProcessTelemetryTimings");function wHe(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===Fx&&(e=4,pr(t)?(e=4096,t[IHe]>0&&(e|=wHe(t[0]))):Fon.call(t,"value")&&(e=8192|wHe(t[O1])))}return e}a(wHe,"getFieldValueType");function BLt(){return!!Oi("chrome")}a(BLt,"isChromium");function jY(t){return t>0}a(jY,"isGreaterThanZero");var Eko=qE({endpointUrl:Lon,propertyStorageOverride:{isVal:vko}});function vko(t){return t&&(!t.getProperty||!t.setProperty)&&ul("Invalid property storage override passed."),!0}a(vko,"_chkPropOverride");var FLt=(function(t){l_(e,t);function e(){var r=t.call(this)||this;return ki(e,r,function(n,o){n[PLt]=function(s,c,l,u){Xp(n,function(){return"AppInsightsCore.initialize"},function(){try{o[PLt](Zp(s,Eko,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=hr(h);f[DLt]("channels")!==-1&&(f+=` - - Channels must be provided through config.channels only!`),La(d,1,514,"SDK Initialization Failed - no telemetry will be sent: "+f)}},function(){return{config:s,extensions:c,logger:l,notificationManager:u}})},n.track=function(s){Xp(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[pO]=c[pO]||{},c[pO].trackStart=L1(),OLt(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=bTe;var u=c.baseData=c.baseData||{};u[THe]=u[THe]||{};var d=u[THe];d[kLt]=d[kLt]||n.pluginVersionString||Mce}o.track(c)},function(){return{item:s}},!s.sync)},n[NLt]=function(s){return o[NLt](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(AHe);p();p();var TTe="REAL_TIME",qon="NEAR_REAL_TIME",jon="BEST_EFFORT";p();p();p();var UP="";var kHe="drop",Hon="send",ULt="requeue",Gon="rspFail",$on="oth",QLt="no-cache, no-store",PHe="application/x-json-stream",ITe="cache-control",Lce="content-type",Von="kill-tokens",Won="kill-duration";var zon="time-delta-millis",DHe="client-version",qLt="client-id",NHe="time-delta-to-apply-millis",MHe="upload-time",OHe="apikey",xTe="AuthMsaDeviceTicket",jLt="WebAuthToken",HLt="AuthXToken";var Yon="NoResponseBody",Bce="msfpc",GLt="trace",LHe="user";p();var wTe="allowRequestSending",BHe="shouldAddClockSkewHeaders",FHe="getClockSkewHeaderValue",RTe="setClockSkew",Zo="length",hO="concat",B1="iKey",ip="count",mO="events",fg="push",gO="split",UHe="toLowerCase",HY="hdrs",QHe="useHdrs",GY="initialize",qHe="setTimeoutOverride",jHe="clearTimeoutOverride",Kon="payloadPreprocessor",$Lt="overrideEndpointUrl",VLt="avoidOptions",Jon="disableEventTimings",HHe="enableCompoundKey",WLt="disableXhrSync",zLt="disableFetchKeepAlive",Zon="addNoResponse",YLt="useSendBeacon",KLt="fetchCredentials",JLt="alwaysUseXhrOverride",GHe="serializeOfflineEvt",$He="getOfflineRequestDetails",VHe="createPayload",kTe="createOneDSPayload",ZLt="payloadBlob",QP="headers",Fce="_thePayload",p_="batches",qC="sendType",PTe="canSendRequest",Uce="sendQueuedRequests",DTe="setUnloading",Xon="isTenantKilled",WHe="sendSynchronousBatch",zHe="_transport",Qce="getWParam",XLt="isBeacon",NTe="timings",YHe="isTeardown",KHe="_sendReason",JHe="setKillSwitchTenants",ZHe="_backOffTransmission",MTe="identifier",esn="ignoreMc1Ms0CookieProcessing",eBt="autoFlushEventsLimit",tsn="disableAutoBatchFlushLimit",rsn="overrideInstrumentationKey",OTe="sendAttempt",_Q="latency",$Y="sync";function isn(t){var e=(t.ext||{}).intweb;return e&&Yx(e[Bce])?e[Bce]:null}a(isn,"_getEventMsfpc");function nsn(t){for(var e=null,r=0;e===null&&rkl()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var bko=.8,Sko=1.2,asn=3e3,Tko=6e5;function csn(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a(csn,"retryPolicyShouldRetryForStatus");function XHe(t){var e=0,r=asn*bko,n=asn*Sko,o=E1(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,S7(e,Tko)}a(XHe,"retryPolicyGetMillisToBackoffForRetry");p();var Iko=20,xko=3145728,usn=65e3,dsn=2e6,wko=S7(dsn,usn),lsn="metadata",eGe="f",Rko=/\./,fsn=(function(){function t(e,r,n,o,s,c,l){var u="data",d="baseData",f="ext",h=!!o,m=!0,g=r,A={},y=!!c,_=s||STe,E=kko(l),v=tGe(E.requestLimit,xko,0),S=tGe(E.requestLimit,usn,1),T=tGe(E.recordLimit,dsn,0),w=Math.min(tGe(E.recordLimit,wko,1),S);ki(t,this,function(R){R.createPayload=function(D,N,O,B,q,M){return{apiKeys:[],payloadBlob:UP,overflow:null,sizeExceed:[],failedEvts:[],batches:[],numEvents:0,retryCnt:D,isTeardown:N,isSync:O,isBeacon:B,sendType:M,sendReason:q}},R.appendPayload=function(D,N,O){var B=D&&N&&!D.overflow;return B&&Xp(e,function(){return"Serializer:appendPayload"},function(){for(var q=N.events(),M=D.payloadBlob,L=D.numEvents,U=!1,j=[],Q=[],Y=D.isBeacon,W=Y?S:v,V=Y?w:T,z=0,ie=0;z=O){D.overflow=N.split(z);break}var re=R.getEventBlob(H);if(re&&re.length<=V){var le=re.length,Le=M.length;if(Le+le>W){D.overflow=N.split(z);break}M&&(M+=` -`),M+=re,ie++,ie>Iko&&(gqe(M,0,1),ie=0),U=!0,L++}else re?j.push(H):Q.push(H),q.splice(z,1),z--}z++}if(j.length>0&&D.sizeExceed.push(EQ.create(N.iKey(),j)),Q.length>0&&D.failedEvts.push(EQ.create(N.iKey(),Q)),U){D.batches.push(N),D.payloadBlob=M,D.numEvents=L;var me=N.iKey();Jo(D.apiKeys,me)===-1&&D.apiKeys.push(me)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:O}}),B},R.getEventBlob=function(D){try{return Xp(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+MLt(D.iKey);var O={},B;y||(B=a(function(U,j,Q){Pko(_,O,U,j,Q)},"_addMetadataCallback"));var q=D[f];q&&(N[f]=O,Zr(q,function(U,j){var Q=O[U]={};k(j,Q,"ext."+U,!0,null,null,!0)}));var M=N[u]={};M.baseType=D.baseType;var L=M[d]={};return k(D.baseData,L,d,!1,[d],B,m),k(D.data,M,u,!1,[],B,m),JSON.stringify(N)},function(){return{item:D}})}catch{return null}};function x(D,N){var O=A[D];return O===void 0&&(D.length>=7&&(O=Tae(D,"ext.metadata")||Tae(D,"ext.web")),A[D]=O),O}a(x,"_isReservedField");function k(D,N,O,B,q,M,L){Zr(D,function(U,j){var Q=null;if(j||Yx(j)){var Y=O,W=U,V=q,z=N;if(h&&!B&&Rko.test(U)){var ie=U.split("."),H=ie.length;if(H>1){V&&(V=V.slice());for(var re=0;re0&&n<=e)return n}return e}a(tGe,"_validateSizeLimit");function kko(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a(kko,"_getSizeLimtCfg");function Pko(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[lsn];c||(c=e[lsn]={f:{}});var l=c[eGe];if(l||(l=c[eGe]={}),r)for(var u=0;u0)for(var o=e[UHe](),s=0;s0&&(n&&rBt[e]?(t[HY][rBt[e]]=r,t[QHe]=!0):t.url+="&"+e+"="+r)}a(jce,"_addRequestDetails");function Oko(t,e,r){for(var n=0;n=0&&j.splice(Z,1)},"rm")}},H[GHe]=function(ge){try{if(S)return S.getEventBlob(ge)}catch{}return UP},H[$He]=function(){try{var ge=S&&S[VHe](0,!1,!1,!1,1,0);return xe(ge,x)}catch{}return null},H[kTe]=function(ge,Z){try{var ve=[];Ct(ge,function(ae){Z&&(ae=cO(ae));var Ce=EQ.create(ae[B1],[ae]);ve[fg](Ce)});for(var Ge=null;ve[Zo]>0&&S;){var qe=ve.shift();qe&&qe[ip]()>0&&(Ge=Ge||S[VHe](0,!1,!1,!1,1,0),S.appendPayload(Ge,qe,ie))}var je=xe(Ge,x),J={data:Ge[ZLt],urlString:je.url,headers:je[HY],timeout:k,disableXhrSync:N,disableFetchKeepAlive:O};return x&&(rGe(J[QP],ITe)||(J[QP][ITe]=QLt),rGe(J[QP],Lce)||(J[QP][Lce]=PHe)),J}catch{}return null};function le(ge,Z){try{return V&&V.getSenderInst(ge,Z)}catch{}return null}a(le,"_getSenderInterface"),H._getDbgPlgTargets=function(){return[g[0],c,S,g,Le(),s,ie]};function Le(){try{var ge={xdrOnComplete:me,fetchOnComplete:Te,xhrOnComplete:te,beaconOnRetry:K},Z={enableSendPromise:!1,isOneDs:!0,disableCredentials:!re,fetchCredentials:z,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:O,timeWrapper:Y,addNoResponse:q,senderOnCompleteCallBack:ge};return Z}catch{}return null}a(Le,"_getSendPostMgrConfig");function me(ge,Z,ve){var Ge=lO(ge);ee(Z,200,{},Ge),be(Ge)}a(me,"_xdrOncomplete");function Oe(){var ge;s=null,c=new ssn,l=!1,u=new osn,d=!1,f=0,h=null,m=null,g=null,A=null,y=!0,_=[],E={},v=[],S=null,T=!1,w=null,R=!1,x=!1,k=ge,N=ge,O=ge,B=ge,q=ge,M=[],L=ge,U=ge,j=[],Q=!1,Y=qce(),W=!1,V=null,ie=null}a(Oe,"_initDefaults");function Te(ge,Z,ve,Ge){var qe=a(function(ae,Ce,Re){ee(Z,ae,Ce,Re),be(Re)},"handleResponse"),je={},J=ge[QP];J&&J.forEach(function(ae,Ce){je[Ce]=ae}),qe(ge.status,je,ve||UP)}a(Te,"_fetchOnComplete");function te(ge,Z,ve){var Ge=lO(ge);ee(Z,ge.status,fQ(ge,!0),Ge),be(Ge)}a(te,"_xhrOnComplete");function ee(ge,Z,ve,Ge){try{ge(Z,ve,Ge)}catch(qe){La(m,2,518,hr(qe))}}a(ee,"_doOnComplete");function K(ge,Z,ve){var Ge=ge,qe=200,je=Ge[Fce],J=ge.urlString+(q?Dko:UP);try{var ae=nd();if(je){var Ce=!!A.getPlugin("LocalStorage"),Re=[],$e=[];Ct(je[p_],function(Ye){if(Re&&Ye&&Ye[ip]()>0)for(var ut=Ye[mO](),yt=0;yt0&&(je.sentEvts=$e),Ce||Ue(Re,8003,je[qC],!0)}else qe=0}catch(Ye){dO(m,"Failed to send telemetry using sendBeacon API. Ex:"+hr(Ye)),qe=0}finally{ee(Z,qe,{},UP)}}a(K,"_onBeaconRetry");function he(ge){return ge===2||ge===3}a(he,"_isBeaconPayload");function X(ge){return R&&he(ge)&&(ge=2),ge}a(X,"_adjustSendType"),H.addHeader=function(ge,Z){E[ge]=Z},H.removeHeader=function(ge){delete E[ge]},H[PTe]=function(){return de()&&u[wTe]()},H[Uce]=function(ge,Z){Bn(ge)&&(ge=0),R&&(ge=X(ge),Z=2),ne(v,ge,0)&&Ne(Be(),0,!1,ge,Z||0)},H.isCompletelyIdle=function(){return!l&&f===0&&v[Zo]===0},H[DTe]=function(ge){R=ge},H.addBatch=function(ge){if(ge&&ge[ip]()>0){if(c.isTenantKilled(ge[B1]()))return!1;v[fg](ge)}return!0},H.teardown=function(){v[Zo]>0&&Ne(Be(),0,!0,2,2),Ct(M,function(ge){ge&&ge.rm&&ge.rm()}),M=[]},H.pause=function(){l=!0},H.resume=function(){l=!1,H[Uce](0,4)},H[WHe]=function(ge,Z,ve){ge&&ge[ip]()>0&&(Xt(Z)&&(Z=1),R&&(Z=X(Z),ve=2),Ne([ge],0,!1,Z,ve||0))};function de(){return!l&&f0&&!l&&g[Z]&&S&&(Ge=Z!==0||de()&&(ve>0||u[wTe]())),Ge}a(ne,"_canSendPayload");function ue(ge){var Z={};return ge&&Ct(ge,function(ve,Ge){Z[Ge]={iKey:ve[B1](),evts:ve[mO]()}}),Z}a(ue,"_createDebugBatches");function Ne(ge,Z,ve,Ge,qe){if(!(!ge||ge[Zo]===0)){if(l){Ue(ge,1,Ge);return}Ge=X(Ge);try{var je=ge,J=Ge!==0;Xp(A,function(){return"HttpManager:_sendBatches"},function(ae){ae&&(ge=ge.slice(0));for(var Ce=[],Re=null,$e=L1(),Ye=g[Ge]||(J?g[1]:g[0]),ut=Ye&&Ye[zHe],yt=B&&(R||he(Ge)||ut===3||Ye._isSync&&ut===2);ne(ge,Ge,Z);){var $t=ge.shift();$t&&$t[ip]()>0&&(c.isTenantKilled($t[B1]())?Ce[fg]($t):(Re=Re||S[VHe](Z,ve,J,yt,qe,Ge),S.appendPayload(Re,$t,ie)?Re.overflow!==null&&(ge=[Re.overflow][hO](ge),Re.overflow=null,tt(Re,$e,L1(),qe),$e=L1(),Re=null):(tt(Re,$e,L1(),qe),$e=L1(),ge=[$t][hO](ge),Re=null)))}Re&&tt(Re,$e,L1(),qe),ge[Zo]>0&&(v=ge[hO](v)),Ue(Ce,8004,Ge)},function(){return{batches:ue(je),retryCount:Z,isTeardown:ve,isSynchronous:J,sendReason:qe,useSendBeacon:he(Ge),sendType:Ge}},!J)}catch(ae){La(m,2,48,"Unexpected Exception sending batch: "+hr(ae))}}}a(Ne,"_sendBatches");function xe(ge,Z){var ve={url:s,hdrs:{},useHdrs:!1};Z?(ve[HY]=Oce(ve[HY],E),ve.useHdrs=rd(ve.hdrs)[Zo]>0):Zr(E,function(ae,Ce){nBt[ae]?jce(ve,nBt[ae],Ce,!1):(ve[HY][ae]=Ce,ve[QHe]=!0)}),jce(ve,qLt,"NO_AUTH",Z),jce(ve,DHe,bTe,Z);var Ge=UP;Ct(ge.apiKeys,function(ae){Ge[Zo]>0&&(Ge+=","),Ge+=ae}),jce(ve,OHe,Ge,Z),jce(ve,MHe,kl().toString(),Z);var qe=se(ge);if(Yx(qe)&&(ve.url+="&ext.intweb.msfpc="+qe),u[BHe]()&&jce(ve,NHe,u[FHe](),Z),A[Qce]){var je=A[Qce]();je>=0&&(ve.url+="&w="+je)}for(var J=0;J<_[Zo];J++)ve.url+="&"+_[J].name+"="+_[J].value;return ve}a(xe,"_buildRequestDetails");function Fe(ge,Z,ve){ge[Z]=ge[Z]||{},ge[Z][h.identifier]=ve}a(Fe,"_setTimingValue");function tt(ge,Z,ve,Ge){if(ge&&ge.payloadBlob&&ge.payloadBlob[Zo]>0){var qe=!!L,je=g[ge.sendType];!he(ge[qC])&&ge[XLt]&&ge.sendReason===2&&(je=g[2]||g[3]||je);var J=x;(ge.isBeacon||je[zHe]===3)&&(J=!1);var ae=xe(ge,J);J=J||ae[QHe];var Ce=L1();Xp(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Re=0;Re0?yt[tBt]++:yt[tBt]=1}Ue(ge[p_],1e3+(Ge||0),ge[qC],!0);var Tt={data:ge[ZLt],urlString:ae.url,headers:ae[HY],_thePayload:ge,_sendReason:Ge,timeout:k,disableXhrSync:N,disableFetchKeepAlive:O};J&&(rGe(Tt[QP],ITe)||(Tt[QP][ITe]=QLt),rGe(Tt[QP],Lce)||(Tt[QP][Lce]=PHe));var We=null;je&&(We=a(function(ce){u.firstRequestSent();var Pe=a(function(ye,oe){vt(ye,oe,ge,Ge)},"onComplete"),Me=ge[YHe]||ge.isSync;V.preparePayload(function(ye){try{je.sendPOST(ye,Pe,Me),U&&U(Tt,ye,Me,ge[XLt])}catch(oe){ee(Pe,0,{}),dO(m,"Unexpected exception sending payload. Ex:"+hr(oe))}},D,ce,Me)},"sender")),Xp(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(We)if(ge[qC]===0&&f++,qe&&!ge.isBeacon&&je[zHe]!==3){var ce={data:Tt.data,urlString:Tt.urlString,headers:Oce({},Tt[QP]),timeout:Tt.timeout,disableXhrSync:Tt[WLt],disableFetchKeepAlive:Tt[zLt]},Pe=!1;Xp(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{L(ce,function(Me){Pe=!0,!y&&!Me[Fce]&&(Me[Fce]=Me[Fce]||Tt[Fce],Me[KHe]=Me[KHe]||Tt[KHe]),We(Me)},ge.isSync||ge[YHe])}catch{Pe||We(Tt)}})}else We(Tt)})},function(){return{thePayload:ge,serializationStart:Z,serializationCompleted:ve,sendReason:Ge}},ge.isSync)}ge.sizeExceed&&ge.sizeExceed[Zo]>0&&Ue(ge.sizeExceed,8003,ge[qC]),ge.failedEvts&&ge.failedEvts[Zo]>0&&Ue(ge.failedEvts,8002,ge[qC])}a(tt,"_doPayloadSend");function st(ge,Z){T&&Ct(ge,function(ve){var Ge=ve[NTe]=ve[NTe]||{};Fe(Ge,"sendEventCompleted",Z)})}a(st,"_addEventCompletedTimings");function vt(ge,Z,ve,Ge){var qe=9e3,je=null,J=!1,ae=!1;try{var Ce=!0;if(typeof ge!==T1){if(Z){u[RTe](Z[zon]);var Re=Z[Won]||Z["kill-duration-seconds"];Ct(c[JHe](Z[Von],Re),function(Ye){Ct(ve[p_],function(ut){if(ut[B1]()===Ye){je=je||[];var yt=ut[gO](0);ve.numEvents-=yt[ip](),je[fg](yt)}})})}if(ge==200||ge==204){qe=200;return}(!csn(ge)||ve.numEvents<=0)&&(Ce=!1),qe=9e3+ge%1e3}if(Ce){qe=100;var $e=ve.retryCnt;ve[qC]===0&&($e0&&st(ve[mO](),Z)})}}a(Ht,"_addCompleteTimings");function F(ge,Z,ve){Z?ge():Y.set(ge,ve)}a(F,"_doAction");function se(ge){for(var Z=0;Z0&&o){var qe=o[Qe(Z)];if(qe){var je=ve!==0;Xp(A,function(){return"HttpManager:_sendBatchesNotification"},function(){F(function(){try{qe.call(o,ge,Z,je,ve)}catch(J){La(m,1,74,"send request notification failed: "+J)}},Ge||je,0)},function(){return{batches:ue(ge),reason:Z,isSync:je,sendSync:Ge,sendType:ve}},!je)}}}a(Ue,"_sendBatchesNotification");function Qe(ge){var Z=Mko[ge];return Yx(Z)||(Z=$on,ge>=9e3&&ge<=9999?Z=Gon:ge>=8e3&&ge<=8999?Z=kHe:ge>=1e3&&ge<=1999&&(Z=Hon)),Z}a(Qe,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var Bko=.25,gsn=500,Fko=20,Asn=6,ysn=2,Uko=4,hsn=2,Qko=1,iBt=1e4,zY="eventsDiscarded",msn="",em=void 0,qko=qE({eventsLimitInMem:{isVal:jY,v:iBt},immediateEventLimit:{isVal:jY,v:500},autoFlushEventsLimit:{isVal:jY,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:jko,v:em},overrideInstrumentationKey:em,overrideEndpointUrl:em,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:em,clearTimeoutOverride:em,payloadPreprocessor:em,payloadListener:em,disableEventTimings:em,valueSanitizer:em,stringifyObjects:em,enableCompoundKey:em,disableOptimizeObj:!1,fetchCredentials:em,transports:em,unloadTransports:em,useSendBeacon:em,disableFetchKeepAlive:em,avoidOptions:!1,xhrTimeout:em,disableXhrSync:em,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:zh,v:Asn},maxUnloadEventRetryAttempts:{isVal:zh,v:ysn},addNoResponse:em,maxEvtPerBatch:{isVal:zh,v:gsn},excludeCsMetaData:em,requestLimit:{}});function jko(t){return t&&t.sendPOST}a(jko,"isOverrideFn");var oBt=(function(t){l_(e,t);function e(){var r=t.call(this)||this;r.identifier="PostChannel",r.priority=1011,r.version="4.3.10";var n,o=!1,s=[],c,l=!1,u=0,d,f=0,h,m={},g=TTe,A,y,_,E,v,S,T,w,R,x,k,D,N,O,B,q,M,L,U,j,Q,Y,W;return ki(e,r,function(V,z){he(),V._getDbgPlgTargets=function(){return[v,n]},V[GY]=function(J,ae,Ce){Xp(ae,function(){return"PostChannel:initialize"},function(){z[GY](J,ae,Ce),U=ae.getNotifyMgr();try{B=yQ(Wx(V[MTe]),ae.evtNamespace&&ae.evtNamespace()),V._addHook(M1(J,function(Re){var $e=Re.cfg,Ye=zx(null,$e,ae);n=Ye.getExtCfg(V[MTe],qko),q=qce(n[qHe],n[jHe]),k=!n.disableOptimizeObj&&BLt(),M=n[esn],H(ae),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[eBt],N=n.maxEventRetryAttempts,O=n.maxUnloadEventRetryAttempts,L=n[tsn],W=n.maxEvtPerBatch,u0($e.endpointUrl)?V.pause():l&&V.resume(),je(),Q=n[rsn],Y=!!n.disableTelemetry,j&&ie();var ut=$e.disablePageUnloadEvents||[];j=vHe(Le,ut,B),j=vTe(Le,ut,B)||j,j=CTe(me,$e.disablePageShowEvents,B)||j})),v[GY](J,V.core,V)}catch(Re){throw V.setInitialized(!1),Re}},function(){return{theConfig:J,core:ae,extensions:Ce}})},V.processTelemetry=function(J,ae){RHe(J,V[MTe]),ae=ae||V._getTelCtx(ae);var Ce=J;!Y&&!o&&(Q&&(Ce[B1]=Q),Te(Ce,!0),D?Be(2,2):K()),V.processNext(Ce,ae)},V.getOfflineSupport=function(){try{var J=v&&v[$He]();if(v)return{getUrl:a(function(){return J?J.url:null},"getUrl"),serialize:le,batch:re,shouldProcess:a(function(ae){return!Y},"shouldProcess"),createPayload:a(function(ae){return null},"createPayload"),createOneDSPayload:a(function(ae){if(v[kTe])return v[kTe](ae,k)},"createOneDSPayload")}}catch{}return null},V._doTeardown=function(J,ae){Be(2,2),o=!0,v.teardown(),ie(),he()};function ie(){CHe(null,B),bHe(null,B),SHe(null,B)}a(ie,"_removeUnloadHandlers");function H(J){var ae=J[Qce];J[Qce]=function(){var Ce=0;return M&&(Ce=Ce|2),Ce|ae.call(J)}}a(H,"_hookWParam");function re(J){var ae=msn;return J&&J[Zo]&&Ct(J,function(Ce){ae&&(ae+=` -`),ae+=Ce}),ae}a(re,"_batch");function le(J){var ae=msn;try{Oe(J),ae=v[GHe](J)}catch{}return ae}a(le,"_serialize");function Le(J){var ae=J||Sf().event;ae.type!=="beforeunload"&&(D=!0,v[DTe](D)),Be(2,2)}a(Le,"_handleUnloadEvents");function me(J){D=!1,v[DTe](D)}a(me,"_handleShowEvents");function Oe(J){J.ext&&J.ext[GLt]&&delete J.ext[GLt],J.ext&&J.ext[LHe]&&J.ext[LHe].id&&delete J.ext[LHe].id,k&&(J.ext=cO(J.ext),J.baseData&&(J.baseData=cO(J.baseData)),J.data&&(J.data=cO(J.data)))}a(Oe,"_cleanEvent");function Te(J,ae){if(J[OTe]||(J[OTe]=0),J[_Q]||(J[_Q]=1),Oe(J),J[$Y]){if(_||l)J[_Q]=3,J[$Y]=!1;else if(v){k&&(J=cO(J)),v[WHe](EQ.create(J[B1],[J]),J[$Y]===!0?1:J[$Y],3);return}}var Ce=J[_Q],Re=f,$e=h;Ce===4&&(Re=u,$e=d);var Ye=!1;if(Re<$e)Ye=!xe(J,ae);else{var ut=1,yt=Fko;Ce===4&&(ut=4,yt=1),Ye=!0,Fe(J[B1],J[_Q],ut,yt)&&(Ye=!xe(J,ae))}Ye&&Ue(zY,[J],tO.QueueFull)}a(Te,"_addEventToQueues"),V.setEventQueueLimits=function(J,ae){n.eventsLimitInMem=h=jY(J)?J:iBt,n[eBt]=T=jY(ae)?ae:0,je();var Ce=f>J;if(!Ce&&w>0)for(var Re=1;!Ce&&Re<=3;Re++){var $e=S[Re];$e&&$e[p_]&&Ct($e[p_],function(Ye){Ye&&Ye[ip]()>=w&&(Ce=!0)})}Ne(!0,Ce)},V.pause=function(){de(),l=!0,v&&v.pause()},V.resume=function(){l=!1,v&&v.resume(),K()},V._loadTransmitProfiles=function(J){Ht(),Zr(J,function(ae,Ce){var Re=Ce[Zo];if(Re>=2){var $e=Re>2?Ce[2]:0;if(Ce.splice(0,Re-2),Ce[1]<0&&(Ce[0]=-1),Ce[1]>0&&Ce[0]>0){var Ye=Ce[0]/Ce[1];Ce[0]=orn(Ye)*Ce[1]}$e>=0&&Ce[1]>=0&&$e>Ce[1]&&($e=Ce[1]),Ce[fg]($e),m[ae]=Ce}})},V.flush=function(J,ae,Ce){J===void 0&&(J=!0);var Re;if(!l)if(Ce=Ce||1,J)ae||(Re=$d(function(Ye){ae=Ye})),c==null?(de(),st(1,0,Ce),c=X(function(){c=null,vt(ae,Ce)},0)):s[fg](ae);else{var $e=de();te(1,1,Ce),ae&&ae(),$e&&K()}return Re},V.setMsaAuthTicket=function(J){v.addHeader(xTe,J)},V.setAuthPluginHeader=function(J){v.addHeader(jLt,J)},V.removeAuthPluginHeader=function(){v.removeHeader(jLt)},V.hasEvents=ee,V._setTransmitProfile=function(J){g!==J&&m[J]!==void 0&&(de(),g=J,K())},dQ(V,function(){return v},["addResponseHandler"]);function te(J,ae,Ce){var Re=st(J,ae,Ce);return v[Uce](ae,Ce),Re}a(te,"_sendEventsForLatencyAndAbove");function ee(){return f>0}a(ee,"_hasEvents");function K(){if(R>=0&&st(R,0,x)&&v[Uce](0,x),u>0&&!y&&!l){var J=m[g][2];J>=0&&(y=X(function(){y=null,te(4,0,1),K()},J))}var ae=m[g][1];!A&&!c&&ae>=0&&!l&&(ee()?A=X(function(){A=null,te(E===0?3:1,0,1),E++,E%=2,K()},ae):E=0)}a(K,"_scheduleTimer"),V[ZHe]=function(){_0&&f>T&&(ae=!0),ae&&c==null&&V.flush(J,function(){},20))}a(Ne,"_performAutoFlush");function xe(J,ae){k&&(J=cO(J));var Ce=J[_Q],Re=ue(J[B1],Ce,!0);return Re.addEvent(J)?(Ce!==4?(f++,ae&&J[OTe]===0&&Ne(!J.sync,w>0&&Re[ip]()>=w)):u++,!0):!1}a(xe,"_addEventToProperQueue");function Fe(J,ae,Ce,Re){for(;Ce<=ae;){var $e=ue(J,ae,!0);if($e&&$e[ip]()>0){var Ye=$e[gO](0,Re),ut=Ye[ip]();if(ut>0)return Ce===4?u-=ut:f-=ut,Qe(zY,[Ye],tO.QueueFull),!0}Ce++}return tt(),!1}a(Fe,"_dropEventWithLatencyOrLess");function tt(){for(var J=0,ae=0,Ce=a(function($e){var Ye=S[$e];Ye&&Ye[p_]&&Ct(Ye[p_],function(ut){$e===4?J+=ut[ip]():ae+=ut[ip]()})},"_loop_1"),Re=1;Re<=4;Re++)Ce(Re);f=ae,u=J}a(tt,"_resetQueueCounts");function st(J,ae,Ce){var Re=!1,$e=ae===0;return!$e||v[PTe]()?Xp(V.core,function(){return"PostChannel._queueBatches"},function(){for(var Ye=[],ut=4;ut>=J;){var yt=S[ut];yt&&yt.batches&&yt.batches[Zo]>0&&(Ct(yt[p_],function($t){v.addBatch($t)?Re=Re||$t&&$t[ip]()>0:Ye=Ye[hO]($t[mO]()),ut===4?u-=$t[ip]():f-=$t[ip]()}),yt[p_]=[],yt.iKeyMap={}),ut--}Ye[Zo]>0&&Ue(zY,Ye,tO.KillSwitch),Re&&R>=J&&(R=-1,x=0)},function(){return{latency:J,sendType:ae,sendReason:Ce}},!$e):(R=R>=0?S7(R,J):J,x=SP(x,Ce)),Re}a(st,"_queueBatches");function vt(J,ae){te(1,0,ae),tt(),Pt(function(){J&&J(),s[Zo]>0?c=X(function(){c=null,vt(s.shift(),ae)},0):(c=null,K())})}a(vt,"_flushImpl");function Pt(J){v.isCompletelyIdle()?J():c=X(function(){c=null,Pt(J)},Bko)}a(Pt,"_waitForIdleManager");function Ht(){de(),F(),g=TTe,K()}a(Ht,"_resetTransmitProfiles");function F(){m={},m[TTe]=[2,1,0],m[qon]=[6,3,0],m[jon]=[18,9,0]}a(F,"_initializeProfiles");function se(J,ae){var Ce=[],Re=N;D&&(Re=O),Ct(J,function($e){$e&&$e[ip]()>0&&Ct($e[mO](),function(Ye){Ye&&(Ye[$Y]&&(Ye[_Q]=4,Ye[$Y]=!1),Ye[OTe]0&&Ue(zY,Ce,tO.NonRetryableStatus),D&&Be(2,2)}a(se,"_requeueEvents");function be(J,ae){var Ce=U||{},Re=Ce[J];if(Re)try{Re.apply(Ce,ae)}catch($e){La(V.diagLog(),1,74,J+" notification failed: "+$e)}}a(be,"_callNotification");function Ue(J,ae){for(var Ce=[],Re=2;Re0&&be(J,[ae][hO](Ce))}a(Ue,"_notifyEvents");function Qe(J,ae){for(var Ce=[],Re=2;Re0&&Ct(ae,function($e){$e&&$e[ip]()>0&&be(J,[$e.events()][hO](Ce))})}a(Qe,"_notifyBatchEvents");function ge(J,ae,Ce){J&&J[Zo]>0&&be("eventsSendRequest",[ae>=1e3&&ae<=1999?ae-1e3:0,Ce!==!0])}a(ge,"_sendingEvent");function Z(J,ae){Qe("eventsSent",J,ae),K()}a(Z,"_eventsSentEvent");function ve(J,ae){Qe(zY,J,ae>=8e3&&ae<=8999?ae-8e3:tO.Unknown)}a(ve,"_eventsDropped");function Ge(J){Qe(zY,J,tO.NonRetryableStatus),K()}a(Ge,"_eventsResponseFail");function qe(J,ae){Qe(zY,J,tO.Unknown),K()}a(qe,"_otherEvent");function je(){L?w=0:w=SP(W*(hsn+1),h/6)}a(je,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(Dce);var F1=fe(require("os"));var nGe=class{constructor(e,r,n,o=!0,s){this.ctx=e;this.namespace=r;this.internalOnly=o;this.onCopilotToken=a(async e=>{this.token=e,this.commonProperties["common.isinternal"]=e?.isInternalUser()?"true":"false",await this.refreshGitHubHandleInCommonProperties();let r=e.getTokenValue("tid");r!==void 0&&(this.tags["ai.user.id"]=r)},"onCopilotToken");this.client=this.initializeClient(n),this.tags=Hko(e),this.commonProperties=Gko(e),this.#e=ws(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new FLt,n=new oBt,o={instrumentationKey:e,loggingLevelTelemetry:0,loggingLevelConsole:0,disableCookiesUsage:!0,disableDbgExt:!0,disableInstrumentationKeyValidation:!0,channels:[[n]]},s={alwaysUseXhrOverride:!0,httpXHROverride:this.createXhrOverride()};return o.extensionConfig={},o.extensionConfig[n.identifier]=s,r.initialize(o,[]),r.addTelemetryInitializer(c=>{let l=c.ext??{},u=l.web??{};u.consentDetails='{"GPC_DataSharingOptIn":false}',l.web=u,c.ext=l,c.tags={...c.tags??{},...this.tags}}),r}catch(r){Br.error(this.ctx,"Failed to initialize MSFT 1DS reporter",r)}}sendTelemetryEvent(e,r,n){if(!this.client||this.internalOnly&&!this.token?.isInternalUser())return;r={...r,...this.commonProperties};let o=this.qualifyEventName(e);try{this.client.track({name:o,baseData:{name:o,properties:r,measurements:n}})}catch(s){Br.debug(this.ctx,"Error tracking telemetry event",s)}}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client?.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}async refreshGitHubHandleInCommonProperties(){try{let e=await this.ctx.get(Fr).resolveSession();e?.login?this.commonProperties["common.github_handle"]=e.login:delete this.commonProperties["common.github_handle"]}catch(e){Br.debug(this.ctx,"Error resolving GitHub handle for telemetry",e)}}createXhrOverride(){return{sendPOST:a((e,r)=>{if(typeof e.data!="string")throw new Error(`Telemetry reporter only supports string payloads, received ${typeof e.data}`);let n=e.headers??{};n["Content-Type"]="application/json";let o={method:"POST",headers:n,body:e.data};this.ctx.get(Jt).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Br.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")}}};function Hko(t){let e={},r=t.get(za);e["ai.session.id"]=r.sessionId;let n=t.get(Gp);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${F1.type()} ${F1.release()}`,e["ai.device.osArchitecture"]=F1.arch(),e["ai.device.osPlatform"]=F1.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(As).getVersion(),e}a(Hko,"getTags");function Gko(t){let e={};e.common_os=F1.platform(),e.common_platformversion=F1.release(),e.common_arch=F1.arch(),e.common_cpu=Array.from(new Set(F1.cpus().map(n=>n.model))).join();let r=t.get(za);return e.common_vscodemachineid=r.machineId,e.common_vscodesessionid=r.sessionId,e.client_deviceid=r.devDeviceId,e.common_uikind=r.uiKind,e.common_remotename=r.remoteName,e.common_isnewappinstall="",e}a(Gko,"getCommonProperties");var $ko="7d7048df-6dd0-4048-bb23-b716c1461f8f",Vko="3fdd7f28-937a-48c8-9a21-ba337db23bd1",Wko="b73649cf-ca8f-4768-9e0e-b789d8529db5",zko="5fb6107a-6a29-423f-a824-22e3724fa2a6",Yko="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function Kko(t){return _7(t)==="prod"?Wko:zko}a(Kko,"getMsftInstrumentationKey");function _sn(t){return new URL(t).hostname==="github.com"?jz.telemetry:t.replace("://","://copilot-telemetry-service.")}a(_sn,"getEndpointForServerUrl");var op=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=_sn(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];ws(e,n=>{this.cachedToken=n,this.updateServiceEndpoints(n.endpoints)})}static{a(this,"TelemetryInitialization")}get endpointUrl(){return this.overrideEndpointUrlForTesting||new URL("telemetry",this.rootUrl).href}get isInitialized(){return this.initializedWith!==void 0}get isEnabled(){return this._enabled??!1}initialize(e){let r=this.ctx;this._enabled=e;let n=this.endpointUrl;if(!(this.initializedWith?.enabled===this._enabled&&this.initializedWith?.endpointUrl===this.endpointUrl)&&(this.shutdownWithoutWaiting(),this.initializedWith={endpointUrl:n,enabled:this._enabled},e)){let o=r.get(c0);if(o.setReporter(new ace(r,this.namespace,{instrumentationKey:$ko,endpointUrl:n})),o.setRestrictedReporter(new ace(r,this.namespace,{instrumentationKey:Vko,endpointUrl:n})),o.setMsftReporter(new ace(r,`copilot/${this.namespace}`,{instrumentationKey:Kko(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new nGe(r,"ThirdParty.copilot-chat",Yko,!0,this.cachedToken)),this.initListeners){let s=this.initListeners;this.initListeners=void 0;for(let c of s)try{c()}catch{}}}}onInitialized(e){if(this.initListeners)this.initListeners.push(e);else try{e()}catch{}}setCustomReporters(e,r){this.shutdownWithoutWaiting();let n=this.ctx.get(c0);n.setReporter(e),n.setRestrictedReporter(r)}async shutdown(){this.shutdownWithoutWaiting(),await Promise.all(this.shuttingDown)}shutdownWithoutWaiting(){this.initializedWith=void 0;let e=this.ctx.get(c0).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=_sn(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function Jko(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await Gd(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(op).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return DC.exception(t,n,"signUpLimited failed"),!1}}a(Jko,"apiFetchSignUpLimited");async function aBt(t,e,r){let n=await t.get(Qt).getTokenResult();switch(n.failureKind){case void 0:return"OK";case"HTTP401":case"NotSignedIn":return"NotSignedIn";case"NotAuthorized":return r&&n.canSignUpForLimited&&await Jko(t,e)?aBt(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(aBt,"getTokenWithSignUpLimited");p();p();var Esn=fe(ii());var Ji=class extends Esn.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var Zko={didChangeFeatureFlags:!1,didChangeManagedSettings:!1,fetch:!1,ipCodeCitation:!1,redirectedTelemetry:!1,related:!1,token:!1,watchedFiles:!1,showPanelMessage:!1,mcpElicitation:!1,mcpSampling:!1,mcpAllowlist:!1,stateDatabase:!1,subAgent:!1,mcpServerManagement:!1,cveRemediatorAgent:!1,debuggerAgent:!1,contentProvider:[],manageTodoListTool:!1,agentDebugLog:!1,accountPickerEnabled:!1},Nn=class{constructor(){this.capabilities={...Zko};this.emitter=new Ji;this.onDidSetCapabilities=this.emitter.event}static{a(this,"CopilotCapabilitiesProvider")}setCapabilities(e){let r;for(r in e){let n=e[r];n!==void 0&&(this.capabilities[r]=n)}this.emitter.fire(this.capabilities)}getCapabilities(){return this.capabilities}};p();var U3=require("fs"),Hce=require("os"),Gce=fe(require("path")),vQ=require("process");var Un=class{static{a(this,"PersistenceManager")}},cBt=class extends Un{constructor(r){super();this.directory=r}static{a(this,"FilePersistenceManager")}async read(r,n){try{return(await this.readJsonObject(r))[n]}catch{return}}async update(r,n,o){await U3.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=Gce.dirname(s);c!==this.directory&&await U3.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await LTe.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await U3.promises.writeFile(s,JSON.stringify(u)+` +`)}`}}let l=t.get(Ir).getEditorInfo(),u;l.root&&(u=[{prefix:`${l.name}:`,path:l.root}]);let d=gae(t),f=kYr(c,u,d),h=STo(c),m=h==="exception",g=Vt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:f.stack||f.toString(),message:f.message,...o});if(await g.makeReadyForSending(t,0,"IncludeExp",r),s?.exception_detail)for(let y of s.exception_detail)y.value&&(d?y.value=XDt(y.value):y.value="[redacted]");s??=hYr(t,f,n),s.context={...s.context,"copilot_event.unique_id":g.properties.unique_id,"#restricted_telemetry":d?"true":"false"},s.rollup_id!=="auto"&&(g.properties.errno=s.rollup_id),s.created_at=new Date(g.issuedTime).toISOString();let A=s.rollup_id==="auto"?c.stack??"":s.rollup_id;if(!t.get(PM).isThrottled(A)){if(d){let y=RYr(c,u),_=Vt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:y.stack||y.toString(),message:y.message,...o});s.rollup_id!=="auto"&&(_.properties.errno=s.rollup_id),await _.makeReadyForSending(t,1,"IncludeExp",r),_.properties.unique_id=g.properties.unique_id,g.properties.restricted_unique_id=_.properties.unique_id,BSe(t,1,`error.${h}`,_)}m&&(g.properties.failbot_payload=JSON.stringify(s)),BSe(t,0,`error.${h}`,g)}}a(xtn,"_telemetryException");function i0(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await xtn(t,c,Rl(),r,n)}},"wrapped");return(...s)=>t.get(Qd).register(o(...s))}a(i0,"telemetryCatch");function u0(t,e,r,n){return t.get(Qd).register(PTo(t,e,Rl(),r?.extendedBy(),n))}a(u0,"telemetryError");async function PTo(t,e,r,n,o=0){if(LSe(o)&&!gae(t))return;let s=n||Vt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),ITo(t,o,e,s)}a(PTo,"_telemetryError");function wtn(t,e,r,n,o,s){let c={completionTextJson:JSON.stringify(e),choiceIndex:o.toString()},l=s?.properties?.engineName;l&&(c.engineName=l,c.modelId=l);let u=Vt.createAndMarkAsIssued(c);if(r.logprobs)for(let[d,f]of Object.entries(r.logprobs))u.properties["logprobs_"+d]=JSON.stringify(f)??"unset";return u.extendWithRequestId(n),ft(t,"engine.completion",u,1)}a(wtn,"logEngineCompletion");function Rtn(t,e,r){let n={promptJson:JSON.stringify({prefix:e.prefix,context:e.context}),promptSuffixJson:JSON.stringify(e.suffix)};if(e.context){let s=r.properties["request.option.extra"]?JSON.parse(r.properties["request.option.extra"]):{};s.context=e.context,n["request.option.extra"]=JSON.stringify(s)}let o=r.extendedBy(n);return ft(t,"engine.prompt",o,1)}a(Rtn,"logEnginePrompt");function DTo(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){let e=t,r;if(typeof e.message=="string")r=e.message;else try{r=JSON.stringify(e)}catch{r="Unknown error"}let n=new Error(r);return n.name=typeof e.name=="string"?e.name:typeof t,typeof e.stack=="string"&&(n.stack=e.stack),n}return new Error("Unknown error")}a(DTo,"buildErrorFromUnknown");p();var Uz=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function ig(t){return!t||typeof t!="object"?!1:t instanceof Uz||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(ig,"isAbortError");var yae=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},Rx=class extends Error{static{a(this,"FetchResponseError")}constructor(e,r=`HTTP ${e.status} ${e.statusText}`){super(r),this.name="FetchResponseError",this.code=`HTTP${e.status}`}},NTo=new Set(["ECONNABORTED","ECONNRESET","EHOSTUNREACH","ENETUNREACH","ENOTCONN","ENOTFOUND","ETIMEDOUT","ERR_HTTP2_STREAM_ERROR","ERR_SSL_BAD_DECRYPT","ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC","ERR_SSL_INVALID_LIBRARY_(0)","ERR_SSL_SSLV3_ALERT_BAD_RECORD_MAC","ERR_SSL_WRONG_VERSION_NUMBER","ERR_STREAM_PREMATURE_CLOSE","ERR_TLS_CERT_ALTNAME_INVALID"]);function wx(t,e=!0){return t instanceof Error?e&&"cause"in t&&wx(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof yae||t instanceof Rx||t?.message?.startsWith("net::")||NTo.has(t.code??""):!1}a(wx,"isNetworkError");var kx=class{constructor(e,r,n,o,s){this.status=e;this.statusText=r;this.headers=n;this.getText=o;this.getBody=s;this.ok=this.status>=200&&this.status<300;this.clientError=this.status>=400&&this.status<500}static{a(this,"Response")}async text(){return this.getText()}async json(){let e=await this.text(),r=this.headers.get("content-type");if(!r||!r.includes("json"))throw new yae(`Response content-type is ${r??"missing"} (status=${this.status})`,`ContentType=${r}`);try{return JSON.parse(e)}catch(n){if(n instanceof SyntaxError){let o=n.message.match(/^(.*?) in JSON at position (\d+)(?: \(line \d+ column \d+\))?$/);if(o&&parseInt(o[2],10)==e.length||n.message==="Unexpected end of JSON input"){let s=new TextEncoder().encode(e).length,c=this.headers.get("content-length");throw c===null?new yae(`Response body truncated: actualLength=${s}`,"Truncated"):new yae(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function UM(t){let e=t.headers.get("retry-after");if(!e)return;let r=Number.parseFloat(e);if(Number.isFinite(r)&&r>=0)return r;let n=Date.parse(e);if(Number.isNaN(n))return;let o=n-Date.now();return o<=0?0:o/1e3}a(UM,"parseRetryAfterSeconds");var Jt=class{static{a(this,"Fetcher")}getImplementation(){return this}};function Qz(t,e,r,n,o,s,c,l,u,d,f,h){let m=l?.["x-api-key"],g=typeof m=="string"&&m.length>0,A={...l,...g?{}:{Authorization:`Bearer ${r}`},...s_(t)};d===void 0&&(A["Openai-Organization"]="github-copilot",A["X-Request-Id"]=o,A["VScode-SessionId"]=t.get(za).sessionId,A["VScode-MachineId"]=t.get(za).machineId,A["X-GitHub-Api-Version"]="2026-01-09"),n&&(A["OpenAI-Intent"]=n);let y={method:"POST",headers:A,json:s,timeout:u};f&&h&&f.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:A,messages:h,body:s});let _=t.get(Jt);if(c){let v=new AbortController;c.onCancellationRequested(()=>{ft(t,"networking.cancelRequest",Vt.createAndMarkAsIssued({headerRequestId:o})),v.abort()}),y.signal=v.signal}return _.fetch(e,y).catch(v=>{if(MTo(v))return ft(t,"networking.disconnectAll"),_.disconnectAll().then(()=>_.fetch(e,y));throw v})}a(Qz,"postRequest");function MTo(t){return t instanceof Error?t.message=="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code=="ECONNRESET"||t.code=="ETIMEDOUT"||t.code=="ERR_HTTP2_INVALID_SESSION":!1:!1}a(MTo,"isInterruptedNetworkError");p();function KQe(){return typeof process>"u"}a(KQe,"isWeb");function n3(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(n3,"isMsBenchModeEnabled");var COt=class extends Rx{static{a(this,"ProxiedResponseError")}constructor(e){super(e,`HTTP ${e.status} response does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`)}};async function $d(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...KQe()?{}:s_(t),...n.headers}};let o=await t.get(Jt).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new Rx(o);if(!o.headers.get("x-github-request-id"))throw new COt(o);return o}a($d,"apiFetch");p();p();var ss=class{constructor(){this.recentNotifications=new Sn(100)}static{a(this,"NotificationSender")}async showWarningMessageOnlyOnce(e,r,...n){if(!this.recentNotifications.has(e??r))return this.recentNotifications.set(e??r,!0),this.showWarningMessage(r,...n)}async showInformationMessageOnlyOnce(e,r,...n){if(!this.recentNotifications.has(e??r))return this.recentNotifications.set(e??r,!0),this.showInformationMessage(r,...n)}};p();p();var ga=class t{static{a(this,"ContentProvider")}static{this.registeredSchemes=new Set}static registerSchemes(e){for(let r of e)t.registeredSchemes.add(r)}static isRegisteredScheme(e){return t.registeredSchemes.has(e)}};var Mtn=require("os"),JQe=require("path");p();var Dtn;(()=>{"use strict";var t={975:O=>{function B(L){if(typeof L!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(L))}a(B,"e");function q(L,U){for(var j,Q="",Y=0,W=-1,V=0,z=0;z<=L.length;++z){if(z2){var ie=Q.lastIndexOf("/");if(ie!==Q.length-1){ie===-1?(Q="",Y=0):Y=(Q=Q.slice(0,ie)).length-1-Q.lastIndexOf("/"),W=z,V=0;continue}}else if(Q.length===2||Q.length===1){Q="",Y=0,W=z,V=0;continue}}U&&(Q.length>0?Q+="/..":Q="..",Y=2)}else Q.length>0?Q+="/"+L.slice(W+1,z):Q=L.slice(W+1,z),Y=z-W-1;W=z,V=0}else j===46&&V!==-1?++V:V=-1}return Q}a(q,"r");var M={resolve:a(function(){for(var L,U="",j=!1,Q=arguments.length-1;Q>=-1&&!j;Q--){var Y;Q>=0?Y=arguments[Q]:(L===void 0&&(L=process.cwd()),Y=L),B(Y),Y.length!==0&&(U=Y+"/"+U,j=Y.charCodeAt(0)===47)}return U=q(U,!j),j?U.length>0?"/"+U:"/":U.length>0?U:"."},"resolve"),normalize:a(function(L){if(B(L),L.length===0)return".";var U=L.charCodeAt(0)===47,j=L.charCodeAt(L.length-1)===47;return(L=q(L,!U)).length!==0||U||(L="."),L.length>0&&j&&(L+="/"),U?"/"+L:L},"normalize"),isAbsolute:a(function(L){return B(L),L.length>0&&L.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var L,U=0;U0&&(L===void 0?L=j:L+="/"+j)}return L===void 0?".":M.normalize(L)},"join"),relative:a(function(L,U){if(B(L),B(U),L===U||(L=M.resolve(L))===(U=M.resolve(U)))return"";for(var j=1;jz){if(U.charCodeAt(W+H)===47)return U.slice(W+H+1);if(H===0)return U.slice(W+H)}else Y>z&&(L.charCodeAt(j+H)===47?ie=H:H===0&&(ie=0));break}var re=L.charCodeAt(j+H);if(re!==U.charCodeAt(W+H))break;re===47&&(ie=H)}var le="";for(H=j+ie+1;H<=Q;++H)H!==Q&&L.charCodeAt(H)!==47||(le.length===0?le+="..":le+="/..");return le.length>0?le+U.slice(W+ie):(W+=ie,U.charCodeAt(W)===47&&++W,U.slice(W))},"relative"),_makeLong:a(function(L){return L},"_makeLong"),dirname:a(function(L){if(B(L),L.length===0)return".";for(var U=L.charCodeAt(0),j=U===47,Q=-1,Y=!0,W=L.length-1;W>=1;--W)if((U=L.charCodeAt(W))===47){if(!Y){Q=W;break}}else Y=!1;return Q===-1?j?"/":".":j&&Q===1?"//":L.slice(0,Q)},"dirname"),basename:a(function(L,U){if(U!==void 0&&typeof U!="string")throw new TypeError('"ext" argument must be a string');B(L);var j,Q=0,Y=-1,W=!0;if(U!==void 0&&U.length>0&&U.length<=L.length){if(U.length===L.length&&U===L)return"";var V=U.length-1,z=-1;for(j=L.length-1;j>=0;--j){var ie=L.charCodeAt(j);if(ie===47){if(!W){Q=j+1;break}}else z===-1&&(W=!1,z=j+1),V>=0&&(ie===U.charCodeAt(V)?--V==-1&&(Y=j):(V=-1,Y=z))}return Q===Y?Y=z:Y===-1&&(Y=L.length),L.slice(Q,Y)}for(j=L.length-1;j>=0;--j)if(L.charCodeAt(j)===47){if(!W){Q=j+1;break}}else Y===-1&&(W=!1,Y=j+1);return Y===-1?"":L.slice(Q,Y)},"basename"),extname:a(function(L){B(L);for(var U=-1,j=0,Q=-1,Y=!0,W=0,V=L.length-1;V>=0;--V){var z=L.charCodeAt(V);if(z!==47)Q===-1&&(Y=!1,Q=V+1),z===46?U===-1?U=V:W!==1&&(W=1):U!==-1&&(W=-1);else if(!Y){j=V+1;break}}return U===-1||Q===-1||W===0||W===1&&U===Q-1&&U===j+1?"":L.slice(U,Q)},"extname"),format:a(function(L){if(L===null||typeof L!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof L);return(function(U,j){var Q=j.dir||j.root,Y=j.base||(j.name||"")+(j.ext||"");return Q?Q===j.root?Q+Y:Q+"/"+Y:Y})(0,L)},"format"),parse:a(function(L){B(L);var U={root:"",dir:"",base:"",ext:"",name:""};if(L.length===0)return U;var j,Q=L.charCodeAt(0),Y=Q===47;Y?(U.root="/",j=1):j=0;for(var W=-1,V=0,z=-1,ie=!0,H=L.length-1,re=0;H>=j;--H)if((Q=L.charCodeAt(H))!==47)z===-1&&(ie=!1,z=H+1),Q===46?W===-1?W=H:re!==1&&(re=1):W!==-1&&(re=-1);else if(!ie){V=H+1;break}return W===-1||z===-1||re===0||re===1&&W===z-1&&W===V+1?z!==-1&&(U.base=U.name=V===0&&Y?L.slice(1,z):L.slice(V,z)):(V===0&&Y?(U.name=L.slice(1,W),U.base=L.slice(1,z)):(U.name=L.slice(V,W),U.base=L.slice(V,z)),U.ext=L.slice(W,z)),V>0?U.dir=L.slice(0,V-1):Y&&(U.dir="/"),U},"parse"),sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,O.exports=M}},e={};function r(O){var B=e[O];if(B!==void 0)return B.exports;var q=e[O]={exports:{}};return t[O](q,q.exports,r),q.exports}a(r,"r"),r.d=(O,B)=>{for(var q in B)r.o(B,q)&&!r.o(O,q)&&Object.defineProperty(O,q,{enumerable:!0,get:B[q]})},r.o=(O,B)=>Object.prototype.hasOwnProperty.call(O,B),r.r=O=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(O,"__esModule",{value:!0})};var n={};let o;r.r(n),r.d(n,{URI:a(()=>m,"URI"),Utils:a(()=>N,"Utils")}),typeof process=="object"?o=process.platform==="win32":typeof navigator=="object"&&(o=navigator.userAgent.indexOf("Windows")>=0);let s=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function u(O,B){if(!O.scheme&&B)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${O.authority}", path: "${O.path}", query: "${O.query}", fragment: "${O.fragment}"}`);if(O.scheme&&!s.test(O.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(O.path){if(O.authority){if(!c.test(O.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(O.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(u,"a");let d="",f="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{static{a(this,"l")}static isUri(B){return B instanceof m||!!B&&typeof B.authority=="string"&&typeof B.fragment=="string"&&typeof B.path=="string"&&typeof B.query=="string"&&typeof B.scheme=="string"&&typeof B.fsPath=="string"&&typeof B.with=="function"&&typeof B.toString=="function"}scheme;authority;path;query;fragment;constructor(B,q,M,L,U,j=!1){typeof B=="object"?(this.scheme=B.scheme||d,this.authority=B.authority||d,this.path=B.path||d,this.query=B.query||d,this.fragment=B.fragment||d):(this.scheme=(function(Q,Y){return Q||Y?Q:"file"})(B,j),this.authority=q||d,this.path=(function(Q,Y){switch(Q){case"https":case"http":case"file":Y?Y[0]!==f&&(Y=f+Y):Y=f}return Y})(this.scheme,M||d),this.query=L||d,this.fragment=U||d,u(this,j))}get fsPath(){return v(this,!1)}with(B){if(!B)return this;let{scheme:q,authority:M,path:L,query:U,fragment:j}=B;return q===void 0?q=this.scheme:q===null&&(q=d),M===void 0?M=this.authority:M===null&&(M=d),L===void 0?L=this.path:L===null&&(L=d),U===void 0?U=this.query:U===null&&(U=d),j===void 0?j=this.fragment:j===null&&(j=d),q===this.scheme&&M===this.authority&&L===this.path&&U===this.query&&j===this.fragment?this:new A(q,M,L,U,j)}static parse(B,q=!1){let M=h.exec(B);return M?new A(M[2]||d,R(M[4]||d),R(M[5]||d),R(M[7]||d),R(M[9]||d),q):new A(d,d,d,d,d)}static file(B){let q=d;if(o&&(B=B.replace(/\\/g,f)),B[0]===f&&B[1]===f){let M=B.indexOf(f,2);M===-1?(q=B.substring(2),B=f):(q=B.substring(2,M),B=B.substring(M)||f)}return new A("file",q,B,d,d)}static from(B){let q=new A(B.scheme,B.authority,B.path,B.query,B.fragment);return u(q,!0),q}toString(B=!1){return S(this,B)}toJSON(){return this}static revive(B){if(B){if(B instanceof m)return B;{let q=new A(B);return q._formatted=B.external,q._fsPath=B._sep===g?B.fsPath:null,q}}return B}}let g=o?1:void 0;class A extends m{static{a(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=v(this,!1)),this._fsPath}toString(B=!1){return B?S(this,!0):(this._formatted||(this._formatted=S(this,!1)),this._formatted)}toJSON(){let B={$mid:1};return this._fsPath&&(B.fsPath=this._fsPath,B._sep=g),this._formatted&&(B.external=this._formatted),this.path&&(B.path=this.path),this.scheme&&(B.scheme=this.scheme),this.authority&&(B.authority=this.authority),this.query&&(B.query=this.query),this.fragment&&(B.fragment=this.fragment),B}}let y={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function _(O,B,q){let M,L=-1;for(let U=0;U=97&&j<=122||j>=65&&j<=90||j>=48&&j<=57||j===45||j===46||j===95||j===126||B&&j===47||q&&j===91||q&&j===93||q&&j===58)L!==-1&&(M+=encodeURIComponent(O.substring(L,U)),L=-1),M!==void 0&&(M+=O.charAt(U));else{M===void 0&&(M=O.substr(0,U));let Q=y[j];Q!==void 0?(L!==-1&&(M+=encodeURIComponent(O.substring(L,U)),L=-1),M+=Q):L===-1&&(L=U)}}return L!==-1&&(M+=encodeURIComponent(O.substring(L))),M!==void 0?M:O}a(_,"m");function E(O){let B;for(let q=0;q1&&O.scheme==="file"?`//${O.authority}${O.path}`:O.path.charCodeAt(0)===47&&(O.path.charCodeAt(1)>=65&&O.path.charCodeAt(1)<=90||O.path.charCodeAt(1)>=97&&O.path.charCodeAt(1)<=122)&&O.path.charCodeAt(2)===58?B?O.path.substr(1):O.path[1].toLowerCase()+O.path.substr(2):O.path,o&&(q=q.replace(/\//g,"\\")),q}a(v,"v");function S(O,B){let q=B?E:_,M="",{scheme:L,authority:U,path:j,query:Q,fragment:Y}=O;if(L&&(M+=L,M+=":"),(U||L==="file")&&(M+=f,M+=f),U){let W=U.indexOf("@");if(W!==-1){let V=U.substr(0,W);U=U.substr(W+1),W=V.lastIndexOf(":"),W===-1?M+=q(V,!1,!1):(M+=q(V.substr(0,W),!1,!1),M+=":",M+=q(V.substr(W+1),!1,!0)),M+="@"}U=U.toLowerCase(),W=U.lastIndexOf(":"),W===-1?M+=q(U,!1,!0):(M+=q(U.substr(0,W),!1,!0),M+=U.substr(W))}if(j){if(j.length>=3&&j.charCodeAt(0)===47&&j.charCodeAt(2)===58){let W=j.charCodeAt(1);W>=65&&W<=90&&(j=`/${String.fromCharCode(W+32)}:${j.substr(3)}`)}else if(j.length>=2&&j.charCodeAt(1)===58){let W=j.charCodeAt(0);W>=65&&W<=90&&(j=`${String.fromCharCode(W+32)}:${j.substr(2)}`)}M+=q(j,!0,!1)}return Q&&(M+="?",M+=q(Q,!1,!1)),Y&&(M+="#",M+=B?Y:_(Y,!1,!1)),M}a(S,"b");function T(O){try{return decodeURIComponent(O)}catch{return O.length>3?O.substr(0,3)+T(O.substr(3)):O}}a(T,"C");let w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function R(O){return O.match(w)?O.replace(w,(B=>T(B))):O}a(R,"w");var x=r(975);let k=x.posix||x,D="/";var N;(function(O){O.joinPath=function(B,...q){return B.with({path:k.join(B.path,...q)})},O.resolvePath=function(B,...q){let M=B.path,L=!1;M[0]!==D&&(M=D+M,L=!0);let U=k.resolve(M,...q);return L&&U[0]===D&&!B.authority&&(U=U.substring(1)),B.with({path:U})},O.dirname=function(B){if(B.path.length===0||B.path===D)return B;let q=k.dirname(B.path);return q.length===1&&q.charCodeAt(0)===46&&(q=""),B.with({path:q})},O.basename=function(B){return k.basename(B.path)},O.extname=function(B){return k.extname(B.path)}})(N||(N={})),Dtn=n})();var{URI:E7,Utils:FSe}=Dtn;function Otn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+Otn(t.substring(3)):t}}a(Otn,"decodeURIComponentGraceful");var Ntn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function bOt(t){return t.match(Ntn)?t.replace(Ntn,e=>Otn(e)):t}a(bOt,"percentDecode");function Ko(t){if(/^[A-Za-z][A-Za-z0-9+.-]+:/.test(t))throw new Error("Path must not contain a scheme");if(!t)throw new Error("Path must not be empty");return E7.file(t).toString()}a(Ko,"makeFsUri");function oo(t){if(typeof t!="string"&&(t=t.uri),/^[A-Za-z]:\\/.test(t))throw new Error(`Could not parse <${t}>: Windows-style path`);try{let e=t.match(/^(?:([^:/?#]+?:)?\/\/)(\/\/.*)$/);return e?E7.parse(e[1]+e[2],!0):E7.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(oo,"parseUri");function ZQe(t){return oo(t),t}a(ZQe,"validateUri");function Gs(t){try{return oo(t).toString()}catch{return t}}a(Gs,"normalizeUri");function Ltn(t){let e=Gs(t);return e.endsWith("/")?e.slice(0,-1):e}a(Ltn,"normalizeUriNoTrailingSlash");var qz=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function un(t){let e=oo(t);if(!qz.has(e.scheme)&&!ga.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,Mtn.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,JQe.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(un,"fsPath");function ys(t){try{return un(t)}catch{return}}a(ys,"getFsPath");function Btn(t){let e=ys(t);if(e)return E7.file(e).toString()}a(Btn,"getFsUri");function jz(t,...e){let r,n=ys(t);return n?r=Ko((0,JQe.resolve)(n,...e)):r=FSe.resolvePath(oo(t),...e.map(o=>Ftn(o))).toString(),typeof t=="string"?r:{uri:r}}a(jz,"resolveFilePath");function Oa(t,...e){let r=FSe.joinPath(oo(t),...e.map(Ftn)).toString();return typeof t=="string"?r:{uri:r}}a(Oa,"joinPath");function Ftn(t){return OTo(t)?t.replaceAll("\\","/"):t}a(Ftn,"pathToURIPath");function OTo(t){return/^[^/\\]*\\/.test(t)}a(OTo,"isWinPath");function ro(t){return bOt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(ro,"basename");function Cf(t){let e=FSe.dirname(oo(t)),r;return qz.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(Cf,"dirname");function Utn(t){return FSe.extname(oo(t))}a(Utn,"extname");var og=class{static{a(this,"NetworkConfiguration")}};function XQe(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!TOt(t)&&r.protocol==="http:")return r.href}catch{}}a(XQe,"ensurePermittedUrl");var Hz={api:"https://api.githubcopilot.com",proxy:"https://copilot-proxy.githubusercontent.com",telemetry:"https://copilot-telemetry.githubusercontent.com","origin-tracker":"https://origin-tracker.githubusercontent.com"};function SOt(t,e,r){if(r&&s1(t)){for(let n of r){let o=kt(t,n);if(o)return o}return}for(let n of e){let o=kt(t,n);if(o)return o}}a(SOt,"urlConfigOverride");function LTo(t,e){switch(e){case"api":return SOt(t,[ze.DebugOverrideCapiUrl,ze.DebugOverrideCapiUrlLegacy],[ze.DebugTestOverrideCapiUrl,ze.DebugTestOverrideCapiUrlLegacy]);case"proxy":return SOt(t,[ze.DebugOverrideProxyUrl,ze.DebugOverrideProxyUrlLegacy],[ze.DebugTestOverrideProxyUrl,ze.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!TOt(t))return SOt(t,[ze.DebugSnippyOverrideUrl])}}a(LTo,"getEndpointOverrideUrl");function Px(t,e,r,...n){let o=LTo(t,r)??e.endpoints[r];return Oa(o,...n)}a(Px,"getEndpointUrl");function i3(t){return Dx(t)?.endpoints??Hz}a(i3,"getLastKnownEndpoints");function eqe(t,e){if(e&&!XQe(t,e)){t.get(ss).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get(og).setConfiguredUrls(t,{serverUrl:e})}a(eqe,"updateServerUrl");p();var sg=class{static{a(this,"UrlOpener")}};var DC=new pe("auth"),IOt=60,BTo=300;var FTo=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],UTo="4535c7beffc844b46bb1ed4aa04d759a";function a_(t){let e=t.serverUrl?.match(/^https?:\/\//)?t.serverUrl:"",r=t.apiUrl?.match(/^https?:\/\//)?t.apiUrl:"";return e?r||=e.replace("://","://api."):r?.includes("://api.")&&(e||=r.replace("://api.","://")),(!e||!r)&&(e="https://github.com/",r="https://api.github.com/"),{apiUrl:r,serverUrl:e}}a(a_,"fillGitHubUrls");function v7(){return Math.floor(Date.now()/1e3)}a(v7,"nowSeconds");async function xOt(t,e,r){let n=Vt.createAndMarkAsIssued({},{});ft(t,"auth.new_login");let o={"X-GitHub-Api-Version":"2024-12-15"};r?.hasKnownOrg&&(o["X-GitHub-Staff-Request"]="1");let s=await $d(t,e,"copilot_internal/v2/token",{timeout:12e4,headers:o}),c=await s.json();if(s.status===401){let h="Failed to get copilot token due to 401 status. Please sign out and try again.",m=s.headers.get("x-github-request-id")??"",g=c.error_details,A=[];m&&A.push(`request_id=${m}`),g?.url&&A.push(`url=${g.url}`),g?.notification_id&&A.push(`notification_id=${g.notification_id}`),g?.message&&A.push(`error=${g.message}`);let y=A.length>0?` (${A.join(", ")})`:"";return DC.info(t,`${h}${y}`),u0(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:h}}if(!s.ok||!c.token){DC.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),u0(t,"auth.invalid_token",n.extendedBy({status:s.status.toString(),status_text:s.statusText}));let h=c.error_details;return h?.notification_id!=="not_signed_up"&&QTo(t,h,e),{failureKind:"NotAuthorized",message:h?.message??"Could not retrieve token",canSignUpForLimited:c.can_signup_for_limited??!1}}let l=v7()+c.refresh_in+IOt,u=await USe(t,e),d;u.ok&&(d=await u.json());let f=new Gz(c,d,l);return ft(t,"auth.new_token",n.extendedBy({...VDt(f)},{adjusted_expires_at:f.expiresAt,expires_at:c.expires_at,current_time:v7()})),{copilotToken:f}}a(xOt,"authFromGitHubSession");var $h=class{static{a(this,"CopilotTokenFetcher")}},tqe=class extends $h{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await xOt(e,r,n)}};async function USe(t,e){return await $d(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a(USe,"fetchCopilotUserInfo");function QTo(t,e,r){e&&t.get(ss).showWarningMessageOnlyOnce(e.notification_id,e.message,{title:e.title},{title:"Dismiss"}).then(async n=>{let o=n?.title===e.title,s=o||n?.title==="Dismiss";if(o){let c=t.get(Ir).getEditorPluginInfo(),l=e.url.replace("{EDITOR}",encodeURIComponent(c.name+"_"+c.version));await t.get(sg).open(l)}e.notification_id&&s&&await qTo(t,e.notification_id,r)}).catch(n=>{DC.exception(t,n,"copilotToken.notification")})}a(QTo,"notifyUser");async function qTo(t,e,r){let n=await $d(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&DC.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(qTo,"sendNotificationResultToGitHub");var Gz=class{constructor(e,r,n){this.envelope=e;this.expiresAt=n;this.token=e.token,this.organization_list=e.organization_list,this.enterprise_list=e.enterprise_list,this.tokenMap=this.parseToken(this.token),this.userInfo=new C9e(r)}static{a(this,"CopilotToken")}get endpoints(){return{...Hz,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-BTo(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(UTo)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var Ei=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function rqe(t){return`Environment variable ${t} provides a token that is not valid for GitHub Copilot. Please unset it (or replace with a working token) and retry.`}a(rqe,"authEnvVarConflictMessage");var C7=class extends Ei{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function Qtn(t){let e=t.trim();if(!e)throw new Ei("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new Ei("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new Ei("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new Ei("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(Qtn,"validateGitHubServerUrl");p();p();var QM=class{static{a(this,"AuthRepository")}};p();function qtn(t){let e=t.trim();if(!e)throw new Ei("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=Qtn(r),{apiUrl:o}=a_({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(qtn,"buildAuthServerEndpoint");function b7(t,e){if(e!==void 0)return qtn(e);{let r=t.get(og),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(b7,"resolveAuthServerEndpoint");function wOt(t){if(!t)return!1;try{return qtn(t),!0}catch{return!1}}a(wOt,"isValidAuthServer");p();p();p();p();p();p();p();p();function a3(t,e){return t||e}a(a3,"_pureAssign");function ag(t,e){return t[e]}a(ag,"_pureRef");var NC=void 0,Vh=null,HOt="",uqe="function",qSe="object",o3="prototype",qOt="__proto__",$z="undefined",sqe="constructor",GOt="Symbol",jTo="_polyfill",Vz="length",aqe="name",RA="call",dqe="toString",Nx=a3(Object),$Ot=ag(Nx,o3),Wtn=a3(String),Wz=ag(Wtn,o3),jSe=a3(Math),ztn=a3(Array),fqe=ag(ztn,o3),s3=ag(fqe,"slice");function ep(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a(ep,"safe");function HTo(t,e){var r=ep(t);return r.e?e:r.v}a(HTo,"safeGet");var ROt;function pqe(t){return function(e){return typeof e===t}}a(pqe,"_createIs");function Ytn(t){var e="[object "+t+"]";return function(r){return!!(r&&HSe(r)===e)}}a(Ytn,"_createObjIs");function HSe(t){return $Ot[dqe].call(t)}a(HSe,"objToString");function Bn(t){return typeof t===$z||t===$z}a(Bn,"isUndefined");function GTo(t){return!vae(t)}a(GTo,"isStrictUndefined");function Xt(t){return t===Vh||Bn(t)}a(Xt,"isNullOrUndefined");function $To(t){return t===Vh||!vae(t)}a($To,"isStrictNullOrUndefined");function vae(t){return!!t||t!==NC}a(vae,"isDefined");function VTo(t){return!ROt&&(ROt=["string","number","boolean",$z,"symbol","bigint"]),t!==qSe&&ROt.indexOf(t)!==-1}a(VTo,"isPrimitiveType");var vi=pqe("string"),qr=pqe(uqe);function td(t){return!t&&Xt(t)?!1:!!t&&typeof t===qSe}a(td,"isObject");var pr=ag(ztn,"isArray"),hqe=Ytn("Date"),zh=pqe("number"),bP=pqe("boolean");var c3=Ytn("Error");function d0(t){return!!(t&&t.then&&qr(t.then))}a(d0,"isPromiseLike");function y1(t){return!(!t||HTo(function(){return!(t&&0+t)},!t))}a(y1,"isTruthy");var Cae=ag(Nx,"getOwnPropertyDescriptor");function f0(t,e){return!!t&&$Ot.hasOwnProperty[RA](t,e)}a(f0,"objHasOwnProperty");var kA=a3(ag(Nx,"hasOwn"),WTo);function WTo(t,e){return f0(t,e)||!!Cae(t,e)}a(WTo,"polyObjHasOwn");function Zr(t,e,r){if(t&&td(t)){for(var n in t)if(kA(t,n)&&e[RA](r||t,n,t[n])===-1)break}}a(Zr,"objForEachKey");var nqe={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function zTo(t){var e={};if(e[nqe.c]=!0,e[nqe.e]=!0,t.l){e.get=function(){return t.l.v};var r=Cae(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return Zr(t,function(n,o){e[nqe[n]]=GTo(o)?e[nqe[n]]:o}),e}a(zTo,"_createProp");var QE=ag(Nx,"defineProperty"),Ktn=ag(Nx,"defineProperties");function $i(t,e,r){return QE(t,e,zTo(r))}a($i,"objDefine");function Jtn(t,e,r,n,o){var s={};return Zr(t,function(c,l){cqe(s,c,e?l:c),cqe(s,l,r?l:c)}),n?n(s):s}a(Jtn,"_createKeyValueMap");function cqe(t,e,r,n){QE(t,e,{value:r,enumerable:!0,writable:!1})}a(cqe,"_assignMapValue");var ed=a3(Wtn),YTo="[object Error]";function hr(t,e){var r=HOt,n=$Ot[dqe][RA](t);n===YTo&&(t={stack:ed(t.stack),message:ed(t.message),name:ed(t.name)});try{r=JSON.stringify(t,Vh,e?typeof e=="number"?e:4:NC),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):Vh)||ed(t)}catch(o){r=" - "+hr(o,e)}return n+": "+r}a(hr,"dumpObj");function ul(t){throw new Error(t)}a(ul,"throwError");function cg(t){throw new TypeError(t)}a(cg,"throwTypeError");var Ztn=ag(Nx,"freeze");function KTo(t){return t}a(KTo,"_doNothing");function JTo(t){return t[qOt]||Vh}a(JTo,"_getProto");var l3=ag(Nx,"assign"),rd=ag(Nx,"keys");function qE(t){return Ztn&&Zr(t,function(e,r){(pr(r)||td(r))&&qE(r)}),Yh(t)}a(qE,"objDeepFreeze");var Yh=a3(Ztn,KTo);var jOt=a3(ag(Nx,"getPrototypeOf"),JTo);function mqe(t){return Jtn(t,1,0,Yh)}a(mqe,"createEnum");function ZTo(t){return Jtn(t,0,0,Yh)}a(ZTo,"createEnumKeyMap");function XTo(t){var e={};return Zr(t,function(r,n){cqe(e,r,n[1]),cqe(e,n[0],n[1])}),Yh(e)}a(XTo,"createSimpleMap");function VOt(t){return XTo(t)}a(VOt,"createTypeMap");var Xtn=ZTo({asyncIterator:0,hasInstance:1,isConcatSpreadable:2,iterator:3,match:4,matchAll:5,replace:6,search:7,species:8,split:9,toPrimitive:10,toStringTag:11,unscopables:12}),jtn="__tsUtils$gblCfg",kOt;function ern(){var t;return typeof globalThis!==$z&&(t=globalThis),!t&&typeof self!==$z&&(t=self),!t&&typeof window!==$z&&(t=window),!t&&typeof global!==$z&&(t=global),t}a(ern,"_getGlobalValue");function trn(){if(!kOt){var t=ep(ern).v||{};kOt=t[jtn]=t[jtn]||{}}return kOt}a(trn,"_getGlobalConfig");var bae=GSe;function GSe(t,e,r){var n=e?e[t]:Vh;return function(o){var s=(o?o[t]:Vh)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?s3[RA](c,1):c)}cg('"'+ed(t)+'" not defined for '+hr(o))}}a(GSe,"_unwrapFunctionWithPoly");function eIo(t){return function(e){return e[t]}}a(eIo,"_unwrapProp");var S7=ag(jSe,"min"),SP=ag(jSe,"max"),Htn=bae("slice",Wz),tp=bae("substring",Wz),gqe=GSe("substr",Wz,tIo);function tIo(t,e,r){return Xt(t)&&cg("Invalid "+hr(t)),r<0?HOt:(e=e||0,e<0&&(e=SP(e+t[Vz],0)),Bn(r)?Htn(t,e):Htn(t,e,e+r))}a(tIo,"polyStrSubstr");function qM(t,e){return tp(t,0,e)}a(qM,"strLeft");var Gtn="_urid",POt;function rIo(){if(!POt){var t=trn();POt=t.gblSym=t.gblSym||{k:{},s:{}}}return POt}a(rIo,"_globalSymbolRegistry");var iqe;function WOt(t){var e={description:ed(t),toString:a(function(){return GOt+"("+t+")"},"toString")};return e[jTo]=!0,e}a(WOt,"polyNewSymbol");function nIo(t){var e=rIo();if(!kA(e.k,t)){var r=WOt(t),n=rd(e.s).length;r[Gtn]=function(){return n+"_"+r[dqe]()},e.k[t]=r,e.s[r[Gtn]()]=ed(t)}return e.k[t]}a(nIo,"polySymbolFor");function iIo(t){!iqe&&(iqe={});var e,r=Xtn[t];return r&&(e=iqe[r]=iqe[r]||WOt(GOt+"."+r)),e}a(iIo,"polyGetKnownSymbol");var Wh;function T7(){Wh=trn()}a(T7,"_initTestHooks");function Aqe(t){var e={};return!Wh&&T7(),e.b=Wh.lzy,QE(e,"v",{configurable:!0,get:a(function(){var r=t();return Wh.lzy||QE(e,"v",{value:r}),e.b=Wh.lzy,r},"get")}),e}a(Aqe,"getLazy");function _1(t){return QE({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(_1,"createCachedValue");var rrn="window",QSe;function yqe(t,e){var r;return function(){return!Wh&&T7(),(!r||Wh.lzy)&&(r=_1(ep(t,e).v)),r.v}}a(yqe,"_getGlobalInstFn");function c_(t){return!Wh&&T7(),(!QSe||t===!1||Wh.lzy)&&(QSe=_1(ep(ern).v||Vh)),QSe.v}a(c_,"getGlobal");function Oi(t,e){var r;if(!QSe||e===!1?r=c_(e):r=QSe.v,r&&r[t])return r[t];if(t===rrn)try{return window}catch{}return Vh}a(Oi,"getInst");function u3(){return!!bf()}a(u3,"hasDocument");var bf=yqe(Oi,["document"]);function Sae(){return!!Sf()}a(Sae,"hasWindow");var Sf=yqe(Oi,[rrn]);function zz(){return!!nd()}a(zz,"hasNavigator");var nd=yqe(Oi,["navigator"]);var nrn=yqe(function(){return!!ep(function(){return process&&(process.versions||{}).node}).v});var Eae,DOt;function _qe(){return Eae=_1(ep(Oi,[GOt]).v),Eae}a(_qe,"_initSymbol");function oIo(t){var e=(Wh.lzy?0:Eae)||_qe();return e.v?e.v[t]:NC}a(oIo,"_getSymbolKey");function irn(){return!!sIo()}a(irn,"hasSymbol");function sIo(){return!Wh&&T7(),((Wh.lzy?0:Eae)||_qe()).v}a(sIo,"getSymbol");function $Se(t,e){var r=Xtn[t];!Wh&&T7();var n=(Wh.lzy?0:Eae)||_qe();return n.v?n.v[r||t]:e?NC:iIo(t)}a($Se,"getKnownSymbol");function Mx(t,e){!Wh&&T7();var r=(Wh.lzy?0:Eae)||_qe();return r.v?r.v(t):e?Vh:WOt(t)}a(Mx,"newSymbol");function I7(t){return!Wh&&T7(),DOt=(Wh.lzy?0:DOt)||_1(ep(oIo,["for"]).v),(DOt.v||nIo)(t)}a(I7,"symbolFor");function lqe(t){return!!t&&qr(t.next)}a(lqe,"isIterator");function zOt(t){return!$To(t)&&qr(t[$Se(3)])}a(zOt,"isIterable");var oqe;function Eqe(t,e,r){if(t&&(lqe(t)||(!oqe&&(oqe=_1($Se(3))),t=t[oqe.v]?t[oqe.v]():Vh),lqe(t))){var n=NC,o=NC;try{for(var s=0;!(o=t.next()).done&&e[RA](r||t,o.value,s,t)!==-1;)s++}catch(c){n={e:c},t.throw&&(o=Vh,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(Eqe,"iterForOf");function _ae(t,e,r){return t.apply(e,r)}a(_ae,"fnApply");function Kh(t,e){return!Bn(e)&&t&&(pr(e)?_ae(t.push,t,e):lqe(e)||zOt(e)?Eqe(e,function(r){t.push(r)}):t.push(e)),t}a(Kh,"arrAppend");function Ct(t,e,r){if(t)for(var n=t[Vz]>>>0,o=0;o0?r:0;return tp(t,o,o+n[Vz])===n}a(vIo,"polyStrStartsWith");var FOt="ref",UOt="unref",QOt="hasRef",CIo="enabled";function bIo(t,e,r){var n=!0,o=t?e(Vh):Vh,s;function c(){return n=!1,o&&o[UOt]&&o[UOt](),s}a(c,"_unref");function l(){o&&r(o),o=Vh}a(l,"_cancel");function u(){return o=e(o),n||c(),s}a(u,"_refresh");function d(f){!f&&o&&l(),f&&!o&&u()}return a(d,"_setEnabled"),s={cancel:l,refresh:u},s[QOt]=function(){return o&&o[QOt]?o[QOt]():n},s[FOt]=function(){return n=!0,o&&o[FOt]&&o[FOt](),s},s[UOt]=c,s=QE(s,CIo,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=Vh},"dn")}}a(bIo,"_createTimerHandler");function KOt(t,e,r){var n=pr(e),o=n?e.length:0,s=(o>0?e[0]:n?NC:e)||setTimeout,c=(o>1?e[1]:NC)||clearTimeout,l=r[0];r[0]=function(){u.dn(),_ae(l,NC,s3[RA](arguments))};var u=bIo(t,function(d){if(d){if(d.refresh)return d.refresh(),d;_ae(c,NC,[d])}return _ae(s,NC,r)},function(d){_ae(c,NC,[d])});return u.h}a(KOt,"_createTimeoutWith");function Yp(t,e){return KOt(!0,NC,s3[RA](arguments))}a(Yp,"scheduleTimeout");function urn(t,e,r){return KOt(!0,t,s3[RA](arguments,1))}a(urn,"scheduleTimeoutWith");function vqe(t,e){return KOt(!1,NC,s3[RA](arguments))}a(vqe,"createTimeout");var KSe=mqe,JOt=VOt;p();var TP=KSe({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var IP="toLowerCase",mn="length",xae="warnToConsole",p3="throwInternal",HM="watch",w7="apply",qi="push",Ox="splice",id="logger",GM="cancel",h3="initialize",$M="identifier",wae="removeNotificationListener",Rae="addNotificationListener",MC="isInitialized",JSe="getNotifyMgr",R7="getPlugin",v1="name",lg="processNext",Cqe="getProcessTelContext",m3="value",k7="enabled",ZOt="stopPollingInternalLogs",Lx="unload",ZSe="onComplete",bqe="version",Sqe="loggingLevelConsole",VM="createNew",C1="teardown",kae="messageId",WM="message",OC="diagLog",P7="_doTeardown",Kz="update",b1="getNext",D7="setNextPlugin",XSe="userAgent",Bx="split",xP="replace",e1e="substring",t1e="indexOf",g3="type",XOt="evtName",wP="status",e5t="getAllResponseHeaders",r1e="isChildEvt",S1="data",Jz="getCtx",RP="setCtx",t5t="itemsReceived",n1e="headers",Pae="urlString",Zz="timeout";var Tqe="traceFlags";var r5t;function drn(t,e){r5t||(r5t=WSe("AggregationError",function(n,o){o[mn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` +`.concat(o," > ").concat(hr(n))}),new r5t(r,e||[])}a(drn,"throwAggregationError");p();p();p();var Dae="function",Fx="object",T1="undefined",I1="prototype";var N7=Object,i1e=N7[I1];p();var ZBl=(c_()||{}).Symbol,XBl=(c_()||{}).Reflect;var frn="hasOwnProperty",TIo=a(function(t){for(var e,r=1,n=arguments.length;r0)for(var o=0;o=0;r--)if(t[r]===e)return!0;return!1}a(h5t,"_hasVisited");function wIo(t,e,r,n){function o(u,d,f){var h=d[f];if(h[s5t]&&n){var m=u[Dqe]||{};m[o1e]!==!1&&(h=(m[d[Nae]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=jM(null);Nqe(r,function(u){s[u]=o(e,r,u)});for(var c=eY(t),l=[];c&&!f5t(c)&&!h5t(l,c);)Nqe(c,function(u){!s[u]&&p5t(c,u,!s1e)&&(s[u]=o(e,c,u))}),l.push(c),c=eY(c);return s}a(wIo,"_getBaseFuncs");function RIo(t,e,r,n){var o=null;if(t&&f0(r,Nae)){var s=t[Dqe]||jM(null);if(o=(s[r[Nae]]||jM(null))[e],o||Mqe("Missing ["+e+"] "+Pqe),!o[a5t]&&s[o1e]!==!1){for(var c=!f0(t,e),l=eY(t),u=[];c&&l&&!f5t(l)&&!h5t(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=eY(l)}try{c&&(t[e]=o),o[a5t]=1}catch{s[o1e]=!1}}}return o}a(RIo,"_getInstFunc");function kIo(t,e,r){var n=e[t];return n===r&&(n=eY(e)[t]),typeof n!==Pqe&&Mqe("["+t+"] is not a "+Pqe),n}a(kIo,"_getProtoFunc");function PIo(t,e,r,n,o){function s(u,d){var f=a(function(){var h=RIo(this,d,u,f)||kIo(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[s5t]=1,f}if(a(s,"_createDynamicPrototype"),!Rqe(t)){var c=r[Dqe]=r[Dqe]||jM(null);if(!Rqe(c)){var l=c[e]=c[e]||jM(null);c[o1e]!==!1&&(c[o1e]=!!o),Rqe(l)||Nqe(r,function(u){p5t(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!f0(t,u)||t[u]&&!t[u][s5t])&&(t[u]=s(t,u)))})}}}a(PIo,"_populatePrototype");function DIo(t,e){if(s1e){for(var r=[],n=eY(e);n&&!f5t(n)&&!h5t(r,n);){if(n===t)return!0;r.push(n),n=eY(n)}return!1}return!0}a(DIo,"_checkPrototype");function o5t(t,e){return f0(t,A3)?t.name||e||prn:((t||{})[kqe]||{}).name||e||prn}a(o5t,"_getObjName");function ki(t,e,r,n){f0(t,A3)||Mqe("theClass is an invalid class definition.");var o=t[A3];DIo(o,e)||Mqe("["+o5t(t)+"] not in hierarchy of ["+o5t(e)+"]");var s=null;f0(o,Nae)?s=o[Nae]:(s=IIo+o5t(t,"_")+"$"+l5t.n,l5t.n++,o[Nae]=s);var c=ki[Arn],l=!!c[wqe];l&&n&&n[wqe]!==void 0&&(l=!!n[wqe]);var u=xIo(e),d=wIo(o,e,u,l);r(e,d);var f=!!s1e&&!!c[c5t];f&&n&&(f=!!n[c5t]),PIo(o,s,e,u,f!==!1)}a(ki,"dynamicProto");ki[Arn]=l5t.o;p();var Lqe="Promise";var C5t="rejected";function Pl(t,e){return Bqe(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:C5t,rejected:!0,reason:r}):r})}a(Pl,"doAwaitResponse");function Bqe(t,e,r,n){var o=t;try{if(d0(t))(e||r)&&(o=t.then(e,r));else try{e&&(o=e(t))}catch(s){if(r)o=r(s);else throw s}}finally{n&&NIo(o,n)}return o}a(Bqe,"doAwait");function NIo(t,e){var r=t;return e&&(d0(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(NIo,"doFinally");var m5t,g5t,A5t,yrn=!1;function MIo(t,e,r,n){m5t=m5t||{toString:a(function(){return"[[PromiseState]]"},"toString")},g5t=g5t||{toString:a(function(){return"[[PromiseResult]]"},"toString")},A5t=A5t||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[m5t]={get:e},o[g5t]={get:r},o[A5t]={get:n},Ktn(t,o)}a(MIo,"_addDebugState$1");var vrn=["pending","resolving","resolved",C5t],_rn="dispatchEvent",Oqe;function OIo(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(OIo,"_hasInitEventFn");function LIo(t,e,r,n){var o=bf();!Oqe&&(Oqe=_1(!!ep(OIo,[o]).v));var s=Oqe.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),Oqe.v&&s.initEvent(e,!1,!0),s&&t[_rn])t[_rn](s);else{var c=t["on"+e];if(c)c(s);else{var l=Oi("console");l&&(l.error||l.log)(e,hr(s))}}}a(LIo,"emitEvent");var Crn="unhandledRejection",BIo=Crn.toLowerCase(),a1e=[],FIo=0,UIo=10;var y5t;function Ern(t){return qr(t)?t.toString():hr(t)}a(Ern,"dumpFnObj");function brn(t,e,r){var n=x7(arguments,3),o=0,s=!1,c,l=[],u=FIo++,d=a1e.length>0?a1e[a1e.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{a1e.push(u),f=!0,h&&h.cancel(),h=null;var x=t(function(k,D){l.push(function(){try{var N=o===2?w:R,O=Bn(N)?c:qr(N)?N(c):N;d0(O)?O.then(k,D):N?k(O):o===3?D(O):k(O)}catch(B){D(B)}}),s&&E()},n);return x}finally{a1e.pop()}}a(g,"_then");function A(w){return g(void 0,w)}a(A,"_catch");function y(w){var R=w,x=w;return qr(w)&&(R=a(function(k){return w&&w(),k},"thenFinally"),x=a(function(k){throw w&&w(),k},"catchFinally")),g(R,x)}a(y,"_finally");function _(){return vrn[o]}a(_,"_strState");function E(){if(l.length>0){var w=l.slice();l=[],f=!0,h&&h.cancel(),h=null,e(w)}}a(E,"_processQueue");function v(w,R){return function(x){if(o===R){if(w===2&&d0(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,E(),!f&&w===3&&!h&&(h=Yp(S,UIo))}}}a(v,"_createSettleIfFn");function S(){if(!f)if(f=!0,nrn())process.emit(Crn,c,m);else{var w=Sf()||c_();!y5t&&(y5t=_1(ep(Oi,[Lqe+"RejectionEvent"]).v)),LIo(w,BIo,function(R){return $i(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!y5t.v)}}a(S,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},QE(m,"state",{get:_}),yrn&&MIo(m,_,function(){return HSe(c)},function(){return f}),irn()&&(m[$Se(11)]="IPromise");function T(){return"IPromise"+(yrn?"["+u+(Bn(d)?"":":"+d)+"]":"")+" "+_()+(s?" - "+Ern(c):"")}return a(T,"_toString"),m.toString=T,a((function(){qr(r)||cg(Lqe+": executor is not a function - "+Ern(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(brn,"_createPromise");function QIo(t){return function(e){var r=x7(arguments,1);return t(function(n,o){try{var s=[],c=1;Eqe(e,function(l,u){l&&(c++,Bqe(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a(QIo,"_createAllPromise");function qIo(t){return _1(function(e){var r=x7(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,Pl(u,function(f){f.rejected?s[d]={status:C5t,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{pr(e)?Ct(e,l):zOt(e)?Eqe(e,l):cg("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(qIo,"_createAllSettledPromise");function Srn(t){Ct(t,function(e){try{e()}catch{}})}a(Srn,"syncItemProcessor");function jIo(t){var e=zh(t)?t:0;return function(r){Yp(function(){Srn(r)},e)}}a(jIo,"timeoutItemProcessor");function Trn(t,e){return brn(Trn,jIo(e),t,e)}a(Trn,"createAsyncPromise");var _5t;function HIo(t,e){!_5t&&(_5t=_1(ep(Oi,[Lqe]).v||null));var r=_5t.v;if(!r)return Trn(t);qr(t)||cg(Lqe+": executor is not a function - "+hr(t));var n=0;function o(){return vrn[n]}a(o,"_strState");var s=new r(function(c,l){function u(f){n=2,c(f)}a(u,"_resolve");function d(f){n=3,l(f)}a(d,"_reject"),t(u,d)});return QE(s,"state",{get:o}),s}a(HIo,"createNativePromise");var E5t;function c1e(t){return brn(c1e,Srn,t)}a(c1e,"createSyncPromise");function Fqe(t,e){return!E5t&&(E5t=qIo(c1e)),E5t.v(t,e)}a(Fqe,"createSyncAllSettledPromise");var v5t;function Vd(t,e){return!v5t&&(v5t=_1(HIo)),v5t.v.call(this,t,e)}a(Vd,"createPromise");var Uqe=QIo(Vd);var D3l=$Se(11);p();p();p();p();var x1=void 0,Io="",tY="channels",rp="core",Qqe="createPerfMgr",l1e="disabled",y3="extensionConfig",rY="extensions",LC="processTelemetry",nY="priority",Mae="eventsSent",M7="eventsDiscarded",Oae="eventsSendRequest",zM="perfEvent",qqe="offlineEventsStored",jqe="offlineBatchSent",Hqe="offlineBatchDrop",Lae="getPerfMgr",Gqe="domain",$qe="path",Irn="Not dynamic - ",xrn="REDACTED",b5t=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var GIo="getPrototypeOf",$Io=/-([a-z])/g,VIo=/([^\w\d_$])/g,WIo=/^(\d+[\w\d_$])/,j3l=Object[GIo];function O7(t){return!Xt(t)}a(O7,"isNotNullOrUndefined");function u1e(t){var e=t;return e&&vi(e)&&(e=e[xP]($Io,function(r,n){return n.toUpperCase()}),e=e[xP](VIo,"_"),e=e[xP](WIo,function(r,n){return"_"+n})),e}a(u1e,"normalizeJsName");function ug(t,e){return t&&e?vu(t,e)!==-1:!1}a(ug,"strContains");function L7(t){return t&&t.toISOString()||""}a(L7,"toISOString");function Kp(t){return c3(t)?t[v1]:Io}a(Kp,"getExceptionName");function YM(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(YM,"setValue");function S5t(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Bn(r)?{}:r,t[e]=n)):n=Bn(r)?{}:r,n}a(S5t,"getSetValue");function zIo(t,e){var r=null,n=null;return qr(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][w7](n,o)}}a(zIo,"_createProxyFunction");function iY(t,e,r,n,o){t&&e&&r&&(o!==!1||Bn(t[e]))&&(t[e]=zIo(r,n))}a(iY,"proxyFunctionAs");function oY(t,e,r,n){return t&&e&&td(t)&&pr(r)&&Ct(r,function(o){vi(o)&&iY(t,o,e,o,n)}),t}a(oY,"proxyFunctions");function T5t(t){return(function(){function e(){var r=this;t&&Zr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(T5t,"createClassFromInterface");function Wqe(t){return t&&l3&&(t=N7(l3({},t))),t}a(Wqe,"optimizeObject");function zqe(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[mn],d=!1,f=1;for(u>0&&bP(l)&&(d=l,l=c[f]||{},f++),td(l)||(l={});f>>=0),m1e=Orn+t&aY,g1e=Lrn-t&aY,Brn=!0}a(cxo,"_mwcSeed");function lxo(){try{var t=kl()&2147483647;cxo((Math.random()*Mrn^t)+t)}catch{}}a(lxo,"_autoSeedMwc");function Nrn(t){var e=0,r=M5t()||O5t();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&aY),e===0&&Uae()&&(Brn||lxo(),e=uxo()&aY),e===0&&(e=E1(Mrn*Math.random()|0)),t||(e>>>=0),e}a(Nrn,"random32");function uxo(t){g1e=36969*(g1e&65535)+(g1e>>16)&aY,m1e=18e3*(m1e&65535)+(m1e>>16)&aY;var e=(g1e<<16)+(m1e&65535)>>>0&aY|0;return t||(e>>>=0),e}a(uxo,"mwcRandom32");function Frn(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=Nrn()>>>0,n=0,o=Io;o[mn]>>=6,n===5&&(r=(Nrn()<<2&4294967295|r&3)>>>0,n=0);return o}a(Frn,"newId");var Urn="3.3.11",dxo="."+Frn(6),fxo=0;function Qrn(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(Qrn,"_canAcceptData");function pxo(t,e){var r=e[t.id];if(!r){r={};try{Qrn(e)&&$i(e,t.id,{e:!1,v:r})}catch{}}return r}a(pxo,"_getCache");function w1(t,e){return e===void 0&&(e=!1),u1e(t+fxo+++(e?"."+Urn:Io)+dxo)}a(w1,"createUniqueNamespace");function Jqe(t){var e={id:w1("_aiData-"+(t||Io)+"."+Urn),accept:a(function(r){return Qrn(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[u1e(n)]:(s&&(c=pxo(e,r),c[u1e(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(Jqe,"createElmNodeData");p();function Zqe(t){return t&&td(t)&&!pr(t)&&(t.isVal||t.fb||kA(t,"v")||kA(t,"mrg")||kA(t,"ref")||t.set)}a(Zqe,"_isConfigDefaults");function qrn(t,e,r){var n,o=r.dfVal||vae;if(e&&r.fb){var s=r.fb;pr(s)||(s=[s]);for(var c=0;c0&&drn("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[mn]>0){c||(c=[]),l||(l=Yp(function(){l=null,f()},0));for(var A=0;A0?Pl(_3(t[0],e),function(){nje(x7(t,1),e,r)}):r(),n}a(nje,"doUnloadAll");p();var Vrn=500,q5t="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function vxo(t,e,r){return!t&&Xt(t)?e:bP(t)?t:ed(t)[IP]()==="true"}a(vxo,"_stringToBoolOrDefault");function j5t(t){return{mrg:!0,v:t}}a(j5t,"cfgDfMerge");function qae(t,e,r){return{fb:r,isVal:t,v:e}}a(qae,"cfgDfValidate");function qx(t,e){return{fb:e,set:vxo,v:!!t}}a(qx,"cfgDfBoolean");p();p();var H5t=[Mae,M7,Oae,zM],oje=null,ije;function Cxo(t,e){return function(){var r=arguments,n=G5t(e);if(n){var o=n.listener;o&&o[t]&&o[t][w7](o,r)}}}a(Cxo,"_listenerProxyFunc");function bxo(){var t=Oi("Microsoft");return t&&(oje=t.ApplicationInsights),oje}a(bxo,"_getExtensionNamespace");function G5t(t){var e=oje;return!e&&t.disableDbgExt!==!0&&(e=oje||bxo()),e?e.ChromeDbgExt:null}a(G5t,"getDebugExt");function Wrn(t){if(!ije){ije={};for(var e=0;e=A&&(d[T](S[WM]),n[w]=!0)}else o>=A&&d[T](S[WM]);f(A,S)}},d.debugToConsole=function(A){$5t("debug",A),g("warning",A)},d[xae]=function(A){$5t("warn",A),g("warning",A)},d.errorToConsole=function(A){$5t("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[Lx]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var _=!0,E=Ixo+y[kae];if(n[E]?_=!1:n[E]=!0,_&&(A<=s&&(d.queue[qi](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",S=new C1e(23,v,!1);d.queue[qi](S),A===1?d.errorToConsole(v):d[xae](v)}}}a(f,"_logInternalMessage");function h(A){return Qx(Jh(A,xxo,d).cfg,function(y){var _=y.cfg;o=_[Sqe],s=_.loggingLevelTelemetry,c=_.maxMessageLimit,l=_.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var _=G5t(e||{});_&&_[OC]&&_[OC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function Krn(t){return t||new Hae}a(Krn,"_getLogger");function Jr(t,e,r,n,o,s){s===void 0&&(s=!1),Krn(t)[p3](e,r,n,o,s)}a(Jr,"_throwInternal");function E3(t,e){Krn(t)[xae](e)}a(E3,"_warnToConsole");var V5t,U7,Jrn="toGMTString",Zrn="toUTCString",K5t="cookie",W5t="expires",Xrn="isCookieUseDisabled",b1e="disableCookiesUsage",enn="_ckMgr",sje=null,z5t=null,tnn=null,JM,rnn={},nnn={},Rxo=(V5t={cookieCfg:j5t((U7={},U7[Gqe]={fb:"cookieDomain",dfVal:O7},U7.path={fb:"cookiePath",dfVal:O7},U7.enabled=x1,U7.ignoreCookies=x1,U7.blockedCookies=x1,U7.disableCookieDefer=!1,U7)),cookieDomain:x1,cookiePath:x1},V5t[b1e]=x1,V5t);function J5t(){!JM&&(JM=Aqe(function(){return bf()}))}a(J5t,"_getDoc");function aje(t){return t?t.isEnabled():!0}a(aje,"_isMgrEnabled");function lnn(t,e){return e&&t&&pr(t.ignoreCookies)?Jo(t.ignoreCookies,e)!==-1:!1}a(lnn,"_isIgnoredCookie");function inn(t,e){return e&&t&&pr(t.blockedCookies)&&Jo(t.blockedCookies,e)!==-1?!0:lnn(t,e)}a(inn,"_isBlockedCookie");function onn(t,e){var r=e[k7];if(Xt(r)){var n=void 0;Bn(t[Xrn])||(n=!t[Xrn]),Bn(t[b1e])||(n=!t[b1e]),r=n}return r}a(onn,"_isCfgEnabled");function unn(t,e){var r,n,o,s,c,l,u,d,f=[];function h(_){var E,v=(E={},E[$qe]=_||"/",E[W5t]="Thu, 01 Jan 1970 00:00:01 GMT",E);return Uae()||(v["max-age"]="0"),ann(Io,v)}a(h,"_formatDeletionValue");function m(_,E,v,S){var T={},w=Li(_||Io),R=vu(w,";");if(R!==-1&&(w=Li(qM(_,R)),T=dnn(tp(_,R+1))),YM(T,Gqe,v||o,y1,Bn),!Xt(E)){var x=Uae();if(Bn(T[W5t])){var k=kl(),D=k+E*1e3;if(D>0){var N=new Date;N.setTime(D),YM(T,W5t,snn(N,x?Jrn:Zrn)||snn(N,x?Jrn:Zrn)||Io,y1)}}x||YM(T,"max-age",Io+E,null,Bn)}var O=p1e();return O&&O.protocol==="https:"&&(YM(T,"secure",null,null,Bn),z5t===null&&(z5t=!Pxo((nd()||{})[XSe])),z5t&&YM(T,"SameSite","None",null,Bn)),YM(T,$qe,S||n,null,Bn),ann(w,T)}a(m,"_formatSetCookieValue");function g(_){if(f)for(var E=f[mn]-1;E>=0;E--)f[E].n===_&&f[Ox](E,1)}a(g,"_removePendingCookie");function A(){Y5t(e)&&f&&(Ct(f,function(_){inn(r,_.n)||(_.o===0?u(_.n,_.v):_.o===1&&d(_.n,_.v))}),f=[])}a(A,"_flushPendingCookies"),t=Jh(t||nnn,null,e).cfg,s=Qx(t,function(_){_.setDf(_.cfg,Rxo),r=_.ref(_.cfg,"cookieCfg"),n=r[$qe]||"/",o=r[Gqe],r.disableCookieDefer?f=null:f===null&&(f=[]);var E=c;c=onn(t,r)!==!1,l=r.getCookie||kxo,u=r.setCookie||cnn,d=r.delCookie||cnn,!E&&c&&f&&A()},e);var y={isEnabled:a(function(){var _=onn(t,r)!==!1&&c&&Y5t(e),E=nnn[enn];return _&&E&&y!==E&&(_=aje(E)),_},"isEnabled"),setEnabled:a(function(_){r[k7]=_,Bn(t[b1e])||(t[b1e]=!_)},"setEnabled"),set:a(function(_,E,v,S,T){var w=!1,R=inn(r,_);if(!R){var x=m(E,v,S,T);aje(y)?(u(_,x),w=!0):f&&(g(_),f[qi]({n:_,o:0,v:x}),w=!0)}return w},"set"),get:a(function(_){var E=Io,v=lnn(r,_);if(!v){if(aje(y))E=l(_);else if(f)for(var S=f[mn]-1;S>=0;S--){var T=f[S];if(T.n===_){if(T.o===0){var w=T.v,R=vu(w,";");E=R!==-1?Li(qM(w,R)):Li(w)}break}}}return E},"get"),del:a(function(_,E){var v=!1;return aje(y)?v=y.purge(_,E):f&&(g(_),f[qi]({n:_,o:1,v:h(E)}),v=!0),v},"del"),purge:a(function(_,E){var v=!1;return Y5t(e)&&(d(_,h(E)),v=!0),v},"purge"),unload:a(function(_){s&&s.rm(),s=null,f=null},"unload")};return y[enn]=y,y}a(unn,"createCookieMgr");function Y5t(t){if(sje===null){sje=!1,!JM&&J5t();try{var e=JM.v||{};sje=e[K5t]!==void 0}catch(r){Jr(t,2,68,"Cannot access document.cookie - "+Kp(r),{exception:hr(r)})}}return sje}a(Y5t,"areCookiesSupported");function dnn(t){var e={};if(t&&t[mn]){var r=Li(t)[Bx](";");Ct(r,function(n){if(n=Li(n||Io),n){var o=vu(n,"=");o===-1?e[n]=null:e[Li(qM(n,o))]=Li(tp(n,o+1))}})}return e}a(dnn,"_extractParts");function snn(t,e){return qr(t[e])?t[e]():null}a(snn,"_formatDate");function ann(t,e){var r=t||Io;return Zr(e,function(n,o){r+="; "+n+(Xt(o)?Io:"="+o)}),r}a(ann,"_formatCookieValue");function kxo(t){var e=Io;if(!JM&&J5t(),JM.v){var r=JM.v[K5t]||Io;tnn!==r&&(rnn=dnn(r),tnn=r),e=Li(rnn[t]||Io)}return e}a(kxo,"_getCookieValue");function cnn(t,e){!JM&&J5t(),JM.v&&(JM.v[K5t]=t+"="+e)}a(cnn,"_setCookieValue");function Pxo(t){return vi(t)?!!(ug(t,"CPU iPhone OS 12")||ug(t,"iPad; CPU OS 12")||ug(t,"Macintosh; Intel Mac OS X 10_14")&&ug(t,"Version/")&&ug(t,"Safari")||ug(t,"Macintosh; Intel Mac OS X 10_14")&&f3(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||ug(t,"Chrome/5")||ug(t,"Chrome/6")||ug(t,"UnrealEngine")&&!ug(t,"Chrome")||ug(t,"UCBrowser/12")||ug(t,"UCBrowser/11")):!1}a(Pxo,"uaDisallowsSameSiteNone");p();var Dxo={perfEvtsSendAll:!1};function Nxo(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){ep(r.fn,[r.arg])})}a(Nxo,"_runScheduledListeners");function Q7(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[qi]({fn:n,arg:o}),r.h=r.h||Yp(Nxo,0,r)):ep(n,[o]))})}a(Q7,"_runListeners");var fnn=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Jh(e,Dxo);n=c[HM](function(l){r=!!l.cfg.perfEvtsSendAll}),ki(t,this,function(l){$i(l,"listeners",{g:a(function(){return o},"g")}),l[Rae]=function(u){o[qi](u)},l[wae]=function(u){for(var d=Jo(o,u);d>-1;)o[Ox](d,1),d=Jo(o,u)},l[Mae]=function(u){Q7(o,Mae,s,function(d){d[Mae](u)})},l[M7]=function(u,d,f){Q7(o,M7,s,function(h){h[M7](u,d,f)})},l[Oae]=function(u,d){Q7(o,Oae,d?s:null,function(f){f[Oae](u,d)})},l[zM]=function(u){u&&(r||!u[r1e]())&&Q7(o,zM,null,function(d){u.isAsync?Yp(function(){return d[zM](u)},0):d[zM](u)})},l[qqe]=function(u){u&&u[mn]&&Q7(o,qqe,s,function(d){d[qqe](u)})},l[jqe]=function(u){u&&u[S1]&&Q7(o,jqe,s,function(d){d[jqe](u)})},l[Hqe]=function(u,d){if(u>0){var f=d||0;Q7(o,Hqe,s,function(h){h[Hqe](u,f)})}},l[Lx]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[GM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(Q7(o,"unload",null,function(h){var m=h[Lx](u);m&&(f||(f=[]),f[qi](m))}),f)return Vd(function(h){return Pl(Uqe(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Gae="ctx",X5t="ParentContextKey",S1e="ChildrenContextKey",Mxo=null,cje=(function(){function t(e,r,n){var o=this;if(o.start=kl(),o[v1]=e,o.isAsync=n,o[r1e]=function(){return!1},qr(r)){var s;$i(o,"payload",{g:a(function(){return!s&&qr(r)&&(s=r(),r=null),s},"g")})}o[Jz]=function(c){return c?c===t[X5t]||c===t[S1e]?o[c]:(o[Gae]||{})[c]:null},o[RP]=function(c,l){if(c)if(c===t[X5t])o[c]||(o[r1e]=function(){return!0}),o[c]=l;else if(c===t[S1e])o[c]=l;else{var u=o[Gae]=o[Gae]||{};u[c]=l}},o.complete=function(){var c=0,l=o[Jz](t[S1e]);if(pr(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(_){Jr(r[id],2,73,"Unexpected Exception during onComplete - "+hr(_))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,_=e.cfg;if(_&&g){var E=_[y3];!E&&A&&(E={}),_[y3]=E,E=e.ref(_,y3),E&&(y=E[g],!y&&A&&(y={}),E[g]=y,y=e.ref(E,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&Zr(A,function(_,E){if(Xt(y[_])){var v=e.cfg[_];(v||!Xt(v))&&(y[_]=v)}A1e(e,y,_,E)}),e.setDf(y,A)}a(f,"_resolveExtCfg");function h(g,A,y){y===void 0&&(y=!1);var _,E=d(g,!1),v=e.cfg;return E&&(E[A]||!Xt(E[A]))?_=E[A]:(v[A]||!Xt(v[A]))&&(_=v[A]),_||!Xt(_)?_:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[R7]();y&&g(y)}}return a(m,"_iterateChain"),c}a(n4t,"_createInternalContext");function kP(t,e,r,n){var o=Jh(e),s=n4t(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[LC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),pr(d)&&(d=q7(d,o.cfg,r,f)),kP(d||c[b1](),o.cfg,r,f)}return a(u,"_createNew"),c[lg]=l,c[VM]=u,c}a(kP,"createProcessTelemetryContext");function $ae(t,e,r){var n=Jh(e.config),o=n4t(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[Lx](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),pr(u)&&(u=q7(u,n.cfg,e,d)),$ae(u||s[b1](),e,d)}return a(l,"_createNew"),s[lg]=c,s[VM]=l,s}a($ae,"createProcessTelemetryUnloadContext");function T1e(t,e,r){var n=Jh(e.config),o=n4t(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){qr(d[Kz])&&d[Kz](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),pr(u)&&(u=q7(u,n.cfg,e,d)),T1e(u||s[b1](),e,d)}return a(l,"_createNew"),s[lg]=c,s[VM]=l,s}a(T1e,"createProcessTelemetryUpdateContext");function q7(t,e,r,n){var o=null,s=!n;if(pr(t)&&t[mn]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&qr(l[LC])){var u=Qxo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?q7([n],e,r):o}a(q7,"createTelemetryProxyChain");function Qxo(t,e,r){var n=null,o=qr(t[LC]),s=qr(t[D7]),c;t?c=t[$M]+"-"+t[nY]+"-"+_nn++:c="Unknown-0-"+_nn++;var l={getPlugin:a(function(){return t},"getPlugin"),getNext:a(function(){return n},"getNext"),processTelemetry:f,unload:h,update:m,_id:c,_setNext:a(function(g){n=g},"_setNext")};function u(){var g;return t&&qr(t[ynn])&&(g=t[ynn]()),g||(g=kP(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,_,E){var v=!1,S=t?t[$M]:Fxo,T=g[Ann];return T||(T=g[Ann]={}),g.setNext(n),t&&lje(g[rp](),function(){return S+":"+y},function(){T[c]=!0;try{var w=n?n._id:Io;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Jr(g[OC](),1,73,"Plugin ["+S+"] failed during "+y+" - "+hr(x)+", run flags: "+hr(T))}},_,E),v}a(d,"_processChain");function f(g,A){A=A||u();function y(_){if(!t||!o)return!1;var E=v3(t);return E[C1]||E[l1e]?!1:(s&&t[D7](n),t[LC](g,_),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[lg](g)}a(f,"_processTelemetry");function h(g,A){function y(){var _=!1;if(t){var E=v3(t),v=t[rp]||E[rp];t&&(!v||v===g.core())&&!E[C1]&&(E[rp]=null,E[C1]=!0,E[MC]=!1,t[C1]&&t[C1](g,A)===!0&&(_=!0))}return _}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[lg](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var _=!1;if(t){var E=v3(t),v=t[rp]||E[rp];t&&(!v||v===g.core())&&!E[C1]&&t[Kz]&&t[Kz](g,A)===!0&&(_=!0)}return _}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[lg](A)}return a(m,"_updatePlugin"),Yh(l)}a(Qxo,"createTelemetryPluginProxy");var qxo=(function(){function t(e,r,n,o){var s=this,c=kP(e,r,n,o);oY(s,c,rd(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function dje(){var t=[];function e(n){n&&t[qi](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){Jr(n[OC](),2,73,"Unexpected error calling unload handler - "+hr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(dje,"createUnloadHandlerContainer");p();var fje,pje;function hje(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Jr(n,2,73,"Unloading:"+hr(c))}}),fje&&o[mn]>fje&&(pje?pje("doUnload",o):Jr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Kh(t,n),fje&&t[mn]>fje&&(pje?pje("Add",t):Jr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected.")))}return a(r,"_addHook"),{run:e,add:r}}a(hje,"createUnloadHookContainer");var i4t,j7="getPlugin",jxo=(i4t={},i4t[y3]={isVal:O7,v:{}},i4t),I1e=(function(){function t(){var e=this,r,n,o,s,c;d(),ki(t,e,function(f){f[h3]=function(h,m,g,A){u(h,m,A),r=!0},f[C1]=function(h,m){var g=f[rp];if(!g||h&&g!==h[rp]())return;var A,y=!1,_=h||$ae(null,g,o&&o[j7]?o[j7]():o),E=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(_,m),c.run(_[OC]()),A===!0&&_[lg](E),d())}return a(v,"_unloadCallback"),!f[P7]||f[P7](_,E,v)!==!0?v():A=!0,A},f[Kz]=function(h,m){var g=f[rp];if(!g||h&&g!==h[rp]())return;var A,y=!1,_=h||T1e(null,g,o&&o[j7]?o[j7]():o),E=m||{reason:0};function v(){y||(y=!0,u(_.getCfg(),_.core(),_[b1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(_,E,v)!==!0?v():A=!0,A},iY(f,"_addUnloadCb",function(){return s},"add"),iY(f,"_addHook",function(){return c},"add"),$i(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[OC]=function(f){return l(f)[OC]()},e[MC]=function(){return r},e.setInitialized=function(f){r=f},e[D7]=function(f){o=f},e[lg]=function(f,h){h?h[lg](f):o&&qr(o[LC])&&o[LC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||kP(null,{},e[rp]);o&&o[j7]?h=m[VM](null,o[j7]):h=m[VM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Jh(f,jxo,cY(h)),!m&&h&&(m=h[Cqe]()[b1]());var g=o;o&&o[j7]&&(g=o[j7]()),e[rp]=h,n=kP(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[rp]=null,n=null,o=null,c=hje(),s=dje()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function Hxo(t,e,r){var n={id:e,fn:r};Kh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[Ox](c,1),-1})},"remove")};return o}a(Hxo,"_addInitializer");function Gxo(t,e,r){for(var n=!1,o=t[mn],s=0;s"},"v")})}a(ewo,"_createUnloadHook");var a4t=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S,T,w,R,x,k,D,N,O,B,q,M,L,U,j;ki(t,this,function(Q){re(),Q._getDbgPlgTargets=function(){return[x,o]},Q[MC]=function(){return r},Q.activeStatus=function(){return N},Q._setPendingStatus=function(){N=3},Q[h3]=function(ne,ue,Ne,xe){g&&ul(vnn),Q[MC]()&&ul("Core cannot be initialized more than once"),e=Jh(ne,o4t,Ne||Q[id],!1),ne=e.cfg,Be(e[HM](function(st){var vt=st.cfg;B=vt.initInMemoMaxSize||Wxo,Y(vt);var Pt=st.ref(st.cfg,y3);Zr(Pt,function(Ht){st.ref(Pt,Ht)})})),s=xe,S=Xxo(e,v,s&&Q[JSe](),S),K(),Q[id]=Ne;var Fe=ne[rY];if(f=[],f[qi].apply(f,Xz(Xz([],ue,!1),Fe,!1)),h=ne[tY],Le(null),(!m||m[mn]===0)&&ul("No "+tY+" available"),h&&h[mn]>1){var tt=Q[R7]("TeeChannelController");(!tt||!tt.plugin)&&Jr(n,1,28,"TeeChannel required")}Zxo(ne,R,n),R=null,r=!0,N===TP.ACTIVE&&z()},Q.getChannels=function(){var ne=[];return m&&Ct(m,function(ue){ne[qi](ue)}),Yh(ne)},Q.track=function(ne){lje(Q[Lae](),function(){return"AppInsightsCore:track"},function(){ne===null&&(de(ne),ul("Invalid telemetry item")),!ne[v1]&&Xt(ne[v1])&&(de(ne),ul("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||L7(new Date),ne.ver=ne.ver||"4.0",!g&&Q[MC]()&&N===TP.ACTIVE?le()[lg](ne):N!==TP.INACTIVE&&o[mn]<=B&&o[qi](ne)},function(){return{item:ne}},!ne.sync)},Q[Cqe]=le,Q[JSe]=function(){return s||(s=new fnn(e.cfg),Q[$xo]=s),s},Q[Rae]=function(ne){Q.getNotifyMgr()[Rae](ne)},Q[wae]=function(ne){s&&s[wae](ne)},Q.getCookieMgr=function(){return u||(u=unn(e.cfg,Q[id])),u},Q.setCookieMgr=function(ne){u!==ne&&(_3(u,!1),u=ne)},Q[Lae]=function(){return c||l||hnn()},Q.setPerfMgr=function(ne){c=ne},Q.eventCnt=function(){return o[mn]},Q.releaseQueue=function(){if(r&&o[mn]>0){var ne=o;o=[],N===2?Ct(ne,function(ue){ue.iKey=ue.iKey||w,le()[lg](ue)}):Jr(n,2,20,"core init status is not active")}},Q.pollInternalLogs=function(ne){return y=ne||null,j=!1,L&&L[GM](),ie(!0)};function Y(ne){var ue=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Xt(ue)){w=null,N=TP.INACTIVE;var xe="Please provide instrumentation key";r?(Jr(n,1,100,xe),z()):ul(xe);return}var Fe=[];d0(ue)?(Fe[qi](ue),w=null):w=ue,d0(Ne)?(Fe[qi](Ne),O=null):O=Ne,Fe[mn]?W(ne,Fe):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ue){q=!1,N=3;var Ne=O7(ne.initTimeOut)?ne.initTimeOut:zxo,xe=Fqe(ue);M&&M[GM](),M=Yp(function(){M=null,q||V()},Ne),Pl(xe,function(Fe){try{if(q)return;if(!Fe.rejected){var tt=Fe[m3];if(tt&&tt[mn]){var st=tt[0];if(w=st&&st[m3],tt[mn]>1){var vt=tt[1];O=vt&&vt[m3]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=O)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=TP.INACTIVE,Jr(n,1,112,"ikey can't be resolved from promises")):N=TP.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(Q.releaseQueue(),Q.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!L||!L[k7])&&!j){var ue=ne||n&&n.queue[mn]>0;ue&&(U||(U=!0,Be(e[HM](function(Ne){var xe=Ne.cfg.diagnosticLogInterval;(!xe||!(xe>0))&&(xe=1e4);var Fe=!1;L&&(Fe=L[k7],L[GM]()),L=vqe(te,xe),L.unref(),L[k7]=Fe}))),L[k7]=!0)}return L}a(ie,"_startLogPoller"),Q[ZOt]=function(){j=!0,L&&L[GM](),te()},oY(Q,function(){return A},["addTelemetryInitializer"]),Q[Lx]=function(ne,ue,Ne){ne===void 0&&(ne=!0),r||ul(Vxo),g&&ul(vnn);var xe={reason:50,isAsync:ne,flushComplete:!1},Fe;ne&&!ue&&(Fe=Vd(function(vt){ue=vt}));var tt=$ae(Oe(),Q);tt[ZSe](function(){v.run(Q[id]),nje([u,s,n],ne,function(){re(),ue&&ue(xe)})},Q);function st(vt){xe.flushComplete=vt,g=!0,E.run(tt,xe),Q[ZOt](),tt[lg](xe)}return a(st,"_doUnload"),te(),ee(ne,st,6,Ne)||st(!1),Fe},Q[R7]=me,Q.addPlugin=function(ne,ue,Ne,xe){if(!ne){xe&&xe(!1),X(Snn);return}var Fe=me(ne[$M]);if(Fe&&!ue){xe&&xe(!1),X("Plugin ["+ne[$M]+"] is already loaded!");return}var tt={reason:16};function st(Ht){f[qi](ne),tt.added=[ne],Le(tt),xe&&xe(!0)}if(a(st,"_addPlugin"),Fe){var vt=[Fe.plugin],Pt={reason:2,isAsync:!!Ne};Te(vt,Pt,function(Ht){Ht?(tt.removed=vt,tt.reason|=32,st(!0)):xe&&xe(!1)})}else st(!1)},Q.updateCfg=function(ne,ue){ue===void 0&&(ue=!0);var Ne;if(Q[MC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Tae({},e.cfg),newConfig:Tae({},ne),merge:ue},ne=Ne.newConfig;var xe=e.cfg;ne[rY]=xe[rY],ne[tY]=xe[tY]}e._block(function(Fe){var tt=Fe.cfg;s4t(Fe,tt,ne,ue),ue||Zr(tt,function(st){kA(ne,st)||Fe.set(tt,st,x1)}),Fe.setDf(tt,o4t)},!0),e.notify(),Ne&&he(Ne)},Q.evtNamespace=function(){return _},Q.flush=ee,Q.getTraceCtx=function(ne){return T||(T=gnn()),T},Q.setTraceCtx=function(ne){T=ne||null},Q.addUnloadHook=Be,iY(Q,"addUnloadCb",function(){return E},"add"),Q.onCfgChange=function(ne){var ue;return r?ue=Qx(e.cfg,ne,Q[id]):ue=Jxo(R,ne),ewo(ue)},Q.getWParam=function(){return u3()||e.cfg.enableWParam?0:-1};function H(){var ne={};k=[];var ue=a(function(Ne){Ne&&Ct(Ne,function(xe){if(xe[$M]&&xe[bqe]&&!ne[xe.identifier]){var Fe=xe[$M]+"="+xe[bqe];k[qi](Fe),ne[xe.identifier]=xe}})},"_addPluginVersions");ue(m),h&&Ct(h,function(Ne){ue(Ne)}),ue(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Jh({},o4t,Q[id]),e.cfg[Sqe]=1,$i(Q,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ue){Q.updateCfg(ue,!1)},"s")}),$i(Q,"pluginVersionStringArr",{g:a(function(){return k||H(),k},"g")}),$i(Q,"pluginVersionString",{g:a(function(){return D||(k||H(),D=k.join(";")),D||Io},"g")}),$i(Q,"logger",{g:a(function(){return n||(n=new Hae(e.cfg),e[id]=n),n},"g"),s:a(function(ue){e[id]=ue,n!==ue&&(_3(n,!1),n=ue)},"s")}),Q[id]=new Hae(e.cfg),x=[];var ne=Q.config[rY]||[];ne.splice(0,ne[mn]),Kh(ne,x),A=new Enn,o=[],_3(s,!1),s=null,c=null,l=null,_3(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,_=w1("AIBaseCore",!0),E=dje(),T=null,w=null,v=hje(),R=[],D=null,k=null,j=!1,L=null,U=!1,N=0,O=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=kP(Oe(),e.cfg,Q);return ne[ZSe](ie),ne}a(le,"_createTelCtx");function Le(ne){var ue=Kxo(Q[id],Vrn,f);d=null,D=null,k=null,m=(h||[])[0]||[],m=uje(Kh(m,ue[tY]));var Ne=Kh(uje(ue[rp]),m);x=Yh(Ne);var xe=Q.config[rY]||[];xe.splice(0,xe[mn]),Kh(xe,x);var Fe=le();m&&m[mn]>0&&r4t(Fe[VM](m),Ne),r4t(Fe,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function me(ne){var ue=null,Ne=null,xe=[];return Ct(x,function(Fe){if(Fe[$M]===ne&&Fe!==A)return Ne=Fe,-1;Fe.getChannel&&xe[qi](Fe)}),!Ne&&xe[mn]>0&&Ct(xe,function(Fe){if(Ne=Fe.getChannel(ne),!Ne)return-1}),Ne&&(ue={plugin:Ne,setEnabled:a(function(Fe){v3(Ne)[l1e]=!Fe},"setEnabled"),isEnabled:a(function(){var Fe=v3(Ne);return!Fe[C1]&&!Fe[l1e]},"isEnabled"),remove:a(function(Fe,tt){Fe===void 0&&(Fe=!0);var st=[Ne],vt={reason:1,isAsync:Fe};Te(st,vt,function(Pt){Pt&&Le({reason:32,removed:st}),tt&&tt(Pt)})},"remove")}),ue}a(me,"_getPlugin");function Oe(){if(!d){var ne=(x||[]).slice();Jo(ne,A)===-1&&ne[qi](A),d=q7(uje(ne),e.cfg,Q)}return d}a(Oe,"_getPluginChain");function Te(ne,ue,Ne){if(ne&&ne[mn]>0){var xe=q7(ne,e.cfg,Q),Fe=$ae(xe,Q);Fe[ZSe](function(){var tt=!1,st=[];Ct(f,function(Pt,Ht){Cnn(Pt,ne)?tt=!0:st[qi](Pt)}),f=st,D=null,k=null;var vt=[];h&&(Ct(h,function(Pt,Ht){var F=[];Ct(Pt,function(se){Cnn(se,ne)?tt=!0:F[qi](se)}),vt[qi](F)}),h=vt),Ne&&Ne(tt),ie()}),Fe[lg](ue)}else Ne(!1)}a(Te,"_removePlugins");function te(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[mn]=0,Ct(ne,function(ue){var Ne={name:y||"InternalMessageId: "+ue[kae],iKey:w,time:L7(new Date),baseType:C1e.dataType,baseData:{message:ue[WM]}};Q.track(Ne)})}}a(te,"_flushInternalLogs");function ee(ne,ue,Ne,xe){var Fe=1,tt=!1,st=null;xe=xe||5e3;function vt(){Fe--,tt&&Fe===0&&(st&&st[GM](),st=null,ue&&ue(tt),ue=null)}if(a(vt,"doCallback"),m&&m[mn]>0){var Pt=le()[VM](m);Pt.iterate(function(Ht){if(Ht.flush){Fe++;var F=!1;Ht.flush(ne,function(){F=!0,vt()},Ne)||F||(ne&&st==null?st=Yp(function(){st=null,vt()},xe):vt())}})}return tt=!0,vt(),!0}a(ee,"_flushChannels");function K(){var ne;Be(e[HM](function(ue){var Ne=ue.cfg.enablePerfMgr;if(Ne){var xe=ue.cfg[Qqe];(ne!==xe||!ne)&&(xe||(xe=Yxo),S5t(ue.cfg,Qqe,xe),ne=xe,l=null),!c&&!l&&qr(xe)&&(l=xe(Q,Q[JSe]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ue=T1e(Oe(),Q);ue[ZSe](ie),(!Q._updateHook||Q._updateHook(ue,ne)!==!0)&&ue[lg](ne)}a(he,"_doUpdate");function X(ne){var ue=Q[id];ue?(Jr(ue,2,73,ne),ie()):ul(ne)}a(X,"_logOrThrowError");function de(ne){var ue=Q[JSe]();ue&&ue[M7]([ne],2)}a(de,"_notifyInvalidEvent");function Be(ne){v.add(ne)}a(Be,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function x1e(t,e){try{if(t&&t!==""){var r=jE().parse(t);if(r&&r[t5t]&&r[t5t]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[mn])return r}}catch(n){Jr(e,1,43,"Cannot parse the response. "+(n[v1]||hr(n)),{response:t})}return null}a(x1e,"parseResponse");p();var PP="",two="NoResponseBody",Tnn="&"+two+"=true",c4t="POST",l4t=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;ki(t,this,function(_,E){var v=!0;q(),_[h3]=function(M,L){o=L,n&&Jr(o,1,28,"Sender is already initialized"),_.SetConfig(M),n=!0},_._getDbgPlgTargets=function(){return[n,s,l,r]},_.SetConfig=function(M){try{if(c=M.senderOnCompleteCallBack||{},l=!!M.disableCredentials,u=M.fetchCredentials,s=!!M.isOneDs,r=!!M.enableSendPromise,f=!!M.disableXhr,h=!!M.disableBeacon,m=!!M.disableBeaconSync,y=M.timeWrapper,A=!!M.addNoResponse,g=!!M.disableFetchKeepAlive,d={sendPOST:N},s||(v=!1),l){var L=p1e();L&&L.protocol&&L.protocol[IP]()==="file:"&&(v=!1)}return!0}catch{}return!1},_.getSyncFetchPayload=function(){return e},_.getSenderInst=function(M,L){return M&&M[mn]?R(M,L):null},_.getFallbackInst=function(){return d},_[P7]=function(M,L){q()},_.preparePayload=function(M,L,U,j){if(!L||j||!U[S1]){M(U);return}try{var Q=Oi("CompressionStream");if(!qr(Q)){M(U);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(vi(U[S1])?new TextEncoder().encode(U[S1]):U[S1]),re.close()},"start")}),W=Y.pipeThrough(new Q("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return Pl(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[m3];if(!Le.done)return z[qi](Le[m3]),ie+=Le.value[mn],Pl(V.read(),re);for(var me=new Uint8Array(ie),Oe=0,Te=0,te=z;Te0&&(Ct(rd(me),function(K){H.append(K,me[K])}),Oe[n1e]=H),u?Oe.credentials=u:v&&s&&(Oe.credentials="include"),U&&(Oe.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(Q+=Tnn)):le=!0);var Te=new Request(Q,Oe);try{Te[q5t]=!0}catch{}if(!U&&r&&(V=Vd(function(K,he){z=K,ie=he})),!Q){w(L),z&&z(!1);return}function te(K,he){he?x(L,s?0:he,{},s?PP:K):x(L,s?0:400,{},s?PP:K)}a(te,"_handleError");function ee(K,he,X){var de=K[wP],Be=c.fetchOnComplete;Be&&qr(Be)?Be(K,L,X||PP,he):x(L,de,{},X||PP)}a(ee,"_onFetchComplete");try{Pl(fetch(s?Q:Te,s?Oe:null),function(K){if(U&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)te(K.reason&&K.reason[WM],499),ie&&ie(K.reason);else{var he=K[m3];try{!s&&!he.ok?(he[wP]?te(he.statusText,he[wP]):te(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,PP),z&&z(!0)):Pl(he.text(),function(X){ee(he,M,X[m3]),z&&z(!0)})}catch(X){he&&he[wP]?te(hr(X),he[wP]):te(hr(X),499),ie&&ie(X)}}})}catch(K){Le||(te(hr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(L,200,{}),z&&z(!0)),s&&!Le&&M[Zz]>0&&y&&y.set(function(){Le||(Le=!0,x(L,500,{}),z&&z(!0))},M[Zz]),V}a(O,"_doFetchSender");function B(M,L,U){var j=Sf(),Q=new XDomainRequest,Y=M[S1];Q.onload=function(){var H=Bae(Q),re=c&&c.xdrOnComplete;re&&qr(re)?re(Q,L,M):x(L,200,{},H)},Q.onerror=function(){x(L,400,{},s?PP:d1e(Q))},Q.ontimeout=function(){x(L,500,{})},Q.onprogress=function(){};var W=j&&j.location&&j.location.protocol||"",V=M[Pae];if(!V){w(L);return}if(!s&&V.lastIndexOf(W,0)!==0){var z="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Jr(o,2,40,". "+z),T(z,L);return}var ie=s?V:V[xP](/^(https?:)/,"");Q.open(c4t,ie),M[Zz]&&(Q[Zz]=M[Zz]),Q.send(Y),s&&U?y&&y.set(function(){Q.send(Y)},0):Q.send(Y)}a(B,"_xdrSender");function q(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(q,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var Dnn="on",Inn="attachEvent",xnn="addEventListener",wnn="detachEvent",Rnn="removeEventListener",u4t="events";var KUl=w1("aiEvtPageHide"),JUl=w1("aiEvtPageShow"),rwo=/\.[\.]+/g,nwo=/[\.]+$/,iwo=1,mje=Jqe("events"),owo=/^([^.]*)(?:\.(.+)|)/;function knn(t){return t&&t[xP]?t[xP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Io):t}a(knn,"_normalizeNamespace");function d4t(t,e){if(e){var r=Io;pr(e)?(r=Io,Ct(e,function(o){o=knn(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=knn(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Io)+r)}var n=owo.exec(t||Io)||[];return{type:n[1],ns:(n[2]||Io).replace(rwo,".").replace(nwo,Io)[Bx](".").sort().join(".")}}a(d4t,"_getEvtNamespace");function Nnn(t,e,r){r===void 0&&(r=!0);var n=mje.get(t,u4t,{},r),o=n[e];return o||(o=n[e]=[]),o}a(Nnn,"_getRegisteredEvents");function Mnn(t,e,r,n){t&&e&&e[g3]&&(t[Rnn]?t[Rnn](e[g3],r,n):t[wnn]&&t[wnn](Dnn+e[g3],r))}a(Mnn,"_doDetach");function swo(t,e,r,n){var o=!1;return t&&e&&e[g3]&&r&&(t[xnn]?(t[xnn](e[g3],r,n),o=!0):t[Inn]&&(t[Inn](Dnn+e[g3],r),o=!0)),o}a(swo,"_doAttach");function Pnn(t,e,r,n){for(var o=e[mn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[XOt].ns)&&(!n||n(s))&&(Mnn(t,s[XOt],s.handler,s.capture),e[Ox](o,1))}}a(Pnn,"_doUnregister");function awo(t,e,r){if(e[g3])Pnn(t,Nnn(t,e[g3]),e,r);else{var n=mje.get(t,u4t,{});Zr(n,function(o,s){Pnn(t,s,e,r)}),rd(n)[mn]===0&&mje.kill(t,u4t)}}a(awo,"_unregisterEvents");function w1e(t,e){var r;return e?(pr(e)?r=[t].concat(e):r=[t,e],r=d4t("xx",r).ns[Bx](".")):r=t,r}a(w1e,"mergeEvtNamespace");function gje(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=d4t(e,n);if(s=swo(t,c,r,o),s&&mje.accept(t)){var l={guid:iwo++,evtName:c,handler:r,capture:o};Nnn(t,c.type)[qi](l)}}catch{}return s}a(gje,"eventOn");function f4t(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=d4t(e,n),c=!1;awo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||Mnn(t,s,r,o)}catch{}}a(f4t,"eventOff");p();var R1e="sampleRate",k1e="ProcessLegacy",Aje="http.method",lY="https://dc.services.visualstudio.com",ZM="/v2/track",u_="not_specified";p();var yje=JOt({requestContextHeader:[0,"Request-Context"],requestContextTargetKey:[1,"appId"],requestContextAppIdFormat:[2,"appId=cid-v1:"],requestIdHeader:[3,"Request-Id"],traceParentHeader:[4,"traceparent"],traceStateHeader:[5,"tracestate"],sdkContextHeader:[6,"Sdk-Context"],sdkContextHeaderAppIdRequest:[7,"appId"],requestContextHeaderLowerCase:[8,"request-context"]});p();p();var uY="split",Ao="length",dY="toLowerCase",G7="ingestionendpoint",$7="toString",p4t="removeItem",Vae="message",qnn="count";var P1e="stringify",D1e="pathname",fY="match";var d_="name";var PA="properties",f_="measurements",N1e="sizeInBytes",M1e="typeName",Wae="exceptions",pY="severityLevel",_je="problemGroup",hY="parsedStack",O1e="hasFullStack",L1e="assembly",XM="fileName",mY="line",zae="aiDataContract",gY="duration";function h4t(t,e,r){var n=e[Ao],o=jnn(t,e);if(o[Ao]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=tp(o,0,147)+Hnn(s);o=c}return o}a(h4t,"dataSanitizeKeyAndAddUniqueness");function jnn(t,e){var r;return e&&(e=Li(ed(e)),e[Ao]>150&&(r=tp(e,0,150),Jr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(jnn,"dataSanitizeKey");function Cu(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Li(ed(e)),e[Ao]>r&&(n=tp(e,0,r),Jr(t,2,61,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}a(Cu,"dataSanitizeString");function AY(t,e,r){return vi(e)&&(e=F5t(e,r)),A4t(t,e,2048,66)}a(AY,"dataSanitizeUrl");function B1e(t,e){var r;return e&&e[Ao]>32768&&(r=tp(e,0,32768),Jr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(B1e,"dataSanitizeMessage");function m4t(t,e){var r;if(e){var n=""+e;n[Ao]>32768&&(r=tp(n,0,32768),Jr(t,2,52,"exception is too long, it has been truncated to 32768 characters.",{exception:e},!0))}return r||e}a(m4t,"dataSanitizeException");function HE(t,e){if(e){var r={};Zr(e,function(n,o){if(td(o)&&B7())try{o=jE()[P1e](o)}catch(s){Jr(t,2,49,"custom property is not valid",{exception:s},!0)}o=Cu(t,o,8192),n=h4t(t,n,r),r[n]=o}),e=r}return e}a(HE,"dataSanitizeProperties");function GE(t,e){if(e){var r={};Zr(e,function(n,o){n=h4t(t,n,r),r[n]=o}),e=r}return e}a(GE,"dataSanitizeMeasurements");function g4t(t,e){return e&&A4t(t,e,128,69)[$7]()}a(g4t,"dataSanitizeId");function A4t(t,e,r,n){var o;return e&&(e=Li(ed(e)),e[Ao]>r&&(o=tp(e,0,r),Jr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(A4t,"dataSanitizeInput");function Hnn(t){var e="00"+t;return gqe(e,e[Ao]-3)}a(Hnn,"dsPadNumber");p();var Gnn=bf()||{},$nn=0,lwo=[null,null,null,null,null];function Vnn(t){var e=$nn,r=lwo,n=r[e];return Gnn.createElement?r[e]||(n=r[e]=Gnn.createElement("a")):n={host:uwo(t,!0)},n.href=t,e++,e>=r[Ao]&&(e=0),$nn=e,n}a(Vnn,"urlParseUrl");function uwo(t,e){var r=Wnn(t,e)||"";if(r){var n=r[fY](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[Ao]>3&&vi(n[2])&&n[2][Ao]>0)return n[2]+(n[3]||"")}return r}a(uwo,"urlParseHost");function Wnn(t,e){var r=null;if(t){var n=t[fY](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[Ao]>2&&vi(n[2])&&n[2][Ao]>0&&(r=n[2]||"",e&&n[Ao]>2)){var o=(n[1]||"")[dY](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(Wnn,"urlParseFullHost");var dwo=[lY+ZM,"https://breeze.aimon.applicationinsights.io"+ZM,"https://dc-int.services.visualstudio.com"+ZM];function Eje(t){return Jo(dwo,t[dY]())!==-1}a(Eje,"isInternalApplicationInsightsEndpoint");function znn(t,e,r,n){var o,s=n,c=n;if(e&&e[Ao]>0){var l=Vnn(e);if(o=l.host,!s)if(l[D1e]!=null){var u=l.pathname[Ao]===0?"/":l[D1e];u.charAt(0)!=="/"&&(u="/"+u),c=l[D1e],s=Cu(t,r?r+" "+u:u)}else s=Cu(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a(znn,"AjaxHelperParseDependencyPath");p();p();var vje=KSe({LocalStorage:0,SessionStorage:1});var Yae=void 0,Ynn="";function Knn(t){try{if(Xt(c_()))return null;var e=new Date()[$7](),r=Oi(t===vje.LocalStorage?"localStorage":"sessionStorage"),n=Ynn+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[p4t](n),!o)return r}catch{}return null}a(Knn,"_getVerifiedStorageObject");function y4t(){return Cje()?Knn(vje.SessionStorage):null}a(y4t,"_getSessionStorageObject");function _4t(t){Ynn=t||""}a(_4t,"utlSetStoragePrefix");function Cje(t){return(t||Yae===void 0)&&(Yae=!!Knn(vje.SessionStorage)),Yae}a(Cje,"utlCanUseSessionStorage");function E4t(t,e){var r=y4t();if(r!==null)try{return r.getItem(e)}catch(n){Yae=!1,Jr(t,2,2,"Browser failed read of session storage. "+Kp(n),{exception:hr(n)})}return null}a(E4t,"utlGetSessionStorage");function v4t(t,e,r){var n=y4t();if(n!==null)try{return n.setItem(e,r),!0}catch(o){Yae=!1,Jr(t,2,4,"Browser failed write to session storage. "+Kp(o),{exception:hr(o)})}return!1}a(v4t,"utlSetSessionStorage");function C4t(t,e){var r=y4t();if(r!==null)try{return r[p4t](e),!0}catch(n){Yae=!1,Jr(t,2,6,"Browser failed removal of session storage item. "+Kp(n),{exception:hr(n)})}return!1}a(C4t,"utlRemoveSessionStorage");p();var fwo=";",pwo="=";function F1e(t){if(!t)return{};var e=t[uY](fwo),r=VSe(e,function(o,s){var c=s[uY](pwo);if(c[Ao]===2){var l=c[0][dY](),u=c[1];o[l]=u}return o},{});if(rd(r)[Ao]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[G7]=r[G7]||"https://"+n+"dc."+r.endpointsuffix}r[G7]=r[G7]||lY,f3(r[G7],"/")&&(r[G7]=r[G7].slice(0,-1))}return r}a(F1e,"parseConnectionString");p();var b4t=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[d_]=Cu(e,n)||u_,s.data=r,s.time=L7(new Date),s[zae]={time:1,iKey:1,name:1,sampleRate:a(function(){return o.sampleRate===100?4:1},"sampleRate"),tags:1,data:1}}return a(t,"Envelope"),t})();p();var C3=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[d_]=Cu(e,r)||u_,s[PA]=HE(e,n),s[f_]=GE(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var hwo=58,mwo=/^\s{0,50}(from\s|at\s|Line\s{1,5}\d{1,10}\s{1,5}of|\w{1,50}@\w{1,80}|[^\(\s\n]+:[0-9\?]+(?::[0-9\?]+)?)/,gwo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,Awo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,ywo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,_wo=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,Ewo=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,vwo=/([^\(\s\n]+):([0-9]+)$/,Jnn="",Kae="error",jx="stack",T4t="stackDetails",Znn="errorSrc",I4t="message",rin="description",Xnn=[{re:gwo,len:5,m:1,fn:2,ln:3,col:4},{chk:bwo,pre:Cwo,re:Awo,len:4,m:1,fn:2,ln:3},{re:ywo,len:3,m:1,fn:2,hdl:tin},{re:_wo,len:2,fn:1,hdl:tin}];function Cwo(t){return t.replace(/(\(anonymous\))/,"")}a(Cwo,"_scrubAnonymous");function bwo(t){return vu(t,"[native")<0}a(bwo,"_ignoreNative");function x4t(t,e){var r=t;return r&&!vi(r)&&(JSON&&JSON[P1e]?(r=JSON[P1e](t),e&&(!r||r==="{}")&&(qr(t[$7])?r=t[$7]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a(x4t,"_stringify");function nin(t,e){var r=t;return t&&(r&&!vi(r)&&(r=t[I4t]||t[rin]||r),r&&!vi(r)&&(r=x4t(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&vu(r||"",e)===-1&&(r=e+": "+r),r||""}a(nin,"_formatMessage");function Swo(t){try{if(td(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(Swo,"_isExceptionDetailsInternal");function Two(t){try{if(td(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(Two,"_isExceptionInternal");function ein(t){return t&&t.src&&vi(t.src)&&t.obj&&pr(t.obj)}a(ein,"_isStackDetails");function yY(t){var e=t||"";vi(e)||(vi(e[jx])?e=e[jx]:e=""+e);var r=e[uY](` +`);return{src:e,obj:r}}a(yY,"_convertStackObj");function Iwo(t){for(var e=[],r=t[uY](` +`),n=0;n0){e=[];var n=0,o=!1,s=0;Ct(r,function(y){if(o||Dwo(y)){var _=ed(y);o=!0;var E=Nwo(_,n);E&&(s+=E[N1e],e.push(E),n++)}});var c=32*1024;if(s>c)for(var l=0,u=e[Ao]-1,d=0,f=l,h=u;lc){var A=h-f+1;e.splice(f,A);break}f=l,h=u,l++,u--}}return e}a(wwo,"_parseStack");function bje(t){var e="";if(t&&(e=t.typeName||t[d_]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[$7]());e=n&&n[Ao]>1?n[1]:""}catch{}return e}a(bje,"_getErrorType");function S4t(t){if(t)try{if(!vi(t)){var e=bje(t),r=x4t(t,!1);return(!r||r==="{}")&&(t[Kae]&&(t=t[Kae],e=bje(t)),r=x4t(t,!0)),vu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(S4t,"_formatErrorCode");var _Y=(function(){function t(e,r,n,o,s,c){this.aiDataContract={ver:1,exceptions:1,severityLevel:0,properties:0,measurements:0};var l=this;l.ver=2,Two(r)?(l[Wae]=r[Wae]||[],l[PA]=r[PA],l[f_]=r[f_],r[pY]&&(l[pY]=r[pY]),r.id&&(l.id=r.id,r[PA].id=r.id),r[_je]&&(l[_je]=r[_je]),Xt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[Wae]=[oin(e,r,n)],l[PA]=HE(e,n),l[f_]=GE(e,o),s&&(l[pY]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=bje(s||c||e);return{message:nin(e,d),url:r,lineNumber:n,columnNumber:o,error:S4t(s||c||e),evt:S4t(c||e),typeName:d,stackDetails:iin(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[Wae]&&d3(r[Wae],function(l){return Pwo(e,l)}),c=new t(e,Ux(Ux({},r),{exceptions:s}),n,o);return c},t.prototype.toInterface=function(){var e=this,r=e.exceptions,n=e.properties,o=e.measurements,s=e.severityLevel,c=e.problemGroup,l=e.id,u=e.isManual,d=r instanceof Array&&d3(r,function(f){return f.toInterface()})||void 0;return{ver:"4.0",exceptions:d,severityLevel:s,properties:n,measurements:o,problemGroup:c,id:l,isManual:u}},t.CreateSimpleException=function(e,r,n,o,s,c){var l;return{exceptions:[(l={},l[O1e]=!0,l.message=e,l.stack=s,l.typeName=r,l)]}},t.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",t.dataType="ExceptionData",t.formatError=S4t,t})();var Rwo=Yh({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function kwo(){var t=this,e=pr(t[hY])&&d3(t[hY],function(n){return Owo(n)}),r={id:t.id,outerId:t.outerId,typeName:t[M1e],message:t[Vae],hasFullStack:t[O1e],stack:t[jx],parsedStack:e||void 0};return r}a(kwo,"_toInterface");function oin(t,e,r){var n,o,s,c,l,u,d,f;if(Swo(e))c=e[M1e],l=e[Vae],d=e[jx],f=e[hY]||[],u=e[O1e];else{var h=e,m=h&&h.evt;c3(h)||(h=h[Kae]||m||h),c=Cu(t,bje(h))||u_,l=B1e(t,nin(e||h,c))||u_;var g=e[T4t]||iin(e);f=wwo(g),pr(f)&&d3(f,function(A){A[L1e]=Cu(t,A[L1e]),A[XM]=Cu(t,A[XM])}),d=m4t(t,xwo(g)),u=pr(f)&&f[Ao]>0,r&&(r[M1e]=r[M1e]||c)}return n={},n[zae]=Rwo,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[O1e]=u,n.stack=d,n.parsedStack=f,n.toInterface=kwo,n}a(oin,"_createExceptionDetails");function Pwo(t,e){var r=pr(e[hY])&&d3(e[hY],function(o){return Mwo(o)})||e[hY],n=oin(t,Ux(Ux({},e),{parsedStack:r}));return n}a(Pwo,"_createExDetailsFromInterface");function sin(t,e){var r=e[fY](Ewo);if(r&&r[Ao]>=4)t[XM]=r[1],t[mY]=parseInt(r[2]);else{var n=e[fY](vwo);n&&n[Ao]>=3?(t[XM]=n[1],t[mY]=parseInt(n[2])):t[XM]=e}}a(sin,"_parseFilename");function tin(t,e,r){var n=t[XM];e.fn&&r&&r[Ao]>e.fn&&(e.ln&&r[Ao]>e.ln?(n=Li(r[e.fn]||""),t[mY]=parseInt(Li(r[e.ln]||""))||0):n=Li(r[e.fn]||"")),n&&sin(t,n)}a(tin,"_handleFilename");function Dwo(t){var e=!1;if(t&&vi(t)){var r=Li(t);r&&(e=mwo.test(r))}return e}a(Dwo,"_isStackFrame");var ain=Yh({level:1,method:1,assembly:0,fileName:0,line:0});function Nwo(t,e){var r,n;if(t&&vi(t)&&Li(t)){n=(r={},r[zae]=ain,r.level=e,r.assembly=Li(t),r.method=Jnn,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o=s.len){s.m&&(n.method=Li(c[s.m]||Jnn)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[XM]=Li(c[s.fn]||""),n[mY]=parseInt(Li(c[s.ln]||""))||0):sin(n,c[s.fn]||""));break}o++}}return cin(n)}a(Nwo,"_extractStackFrame");function Mwo(t){var e,r=(e={},e[zae]=ain,e.level=t.level,e.method=t.method,e.assembly=t[L1e],e.fileName=t[XM],e.line=t[mY],e.sizeInBytes=0,e);return cin(r)}a(Mwo,"_stackFrameFromInterface");function cin(t){var e=hwo;return t&&(e+=t.method[Ao],e+=t.assembly[Ao],e+=t.fileName[Ao],e+=t.level.toString()[Ao],e+=t.line.toString()[Ao],t[N1e]=e),t}a(cin,"_populateFrameSizeInBytes");function Owo(t){return{level:t.level,method:t.method,assembly:t[L1e],fileName:t[XM],line:t[mY]}}a(Owo,"_parsedFrameToInterface");p();p();var lin=(function(){function t(){this.aiDataContract={name:1,kind:0,value:1,count:0,min:0,max:0,stdDev:0},this.kind=0}return a(t,"DataPoint"),t})();var b3=(function(){function t(e,r,n,o,s,c,l,u,d){this.aiDataContract={ver:1,metrics:1,properties:0};var f=this;f.ver=2;var h=new lin;h[qnn]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[d_]=Cu(e,r)||u_,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[PA]=HE(e,u),f[f_]=GE(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var U1e="";function Sje(t){(isNaN(t)||t<0)&&(t=0),t=lrn(t);var e=U1e+t%1e3,r=U1e+E1(t/1e3)%60,n=U1e+E1(t/(1e3*60))%60,o=U1e+E1(t/(1e3*60*60))%24,s=E1(t/(1e3*60*60*24));return e=e[Ao]===1?"00"+e:e[Ao]===2?"0"+e:e,r=r[Ao]<2?"0"+r:r,n=n[Ao]<2?"0"+n:n,o=o[Ao]<2?"0"+o:o,(s>0?s+".":U1e)+o+":"+n+":"+r+"."+e}a(Sje,"msToTimeSpan");var EY=(function(){function t(e,r,n,o,s,c,l){this.aiDataContract={ver:1,name:0,url:0,duration:0,properties:0,measurements:0,id:0};var u=this;u.ver=2,u.id=g4t(e,l),u.url=AY(e,n),u[d_]=Cu(e,r)||u_,isNaN(o)||(u[gY]=Sje(o)),u[PA]=HE(e,s),u[f_]=GE(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var vY=(function(){function t(e,r,n,o,s,c,l,u,d,f,h,m){d===void 0&&(d="Ajax"),this.aiDataContract={id:1,ver:1,name:0,resultCode:0,duration:0,success:0,data:0,target:0,type:0,properties:0,measurements:0,kind:0,value:0,count:0,min:0,max:0,stdDev:0,dependencyKind:0,dependencySource:0,commandName:0,dependencyTypeName:0};var g=this;g.ver=2,g.id=r,g[gY]=Sje(s),g.success=c,g.resultCode=l+"",g.type=Cu(e,d);var A=znn(e,n,u,o);g.data=AY(e,o)||A.data,g.target=Cu(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[d_]=Cu(e,A[d_]),g[PA]=HE(e,h),g[f_]=GE(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var CY=(function(){function t(e,r,n,o,s){this.aiDataContract={ver:1,message:1,severityLevel:0,properties:0};var c=this;c.ver=2,r=r||u_,c[Vae]=B1e(e,r),c[PA]=HE(e,o),c[f_]=GE(e,s),n&&(c[pY]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var bY=(function(){function t(e,r,n,o,s,c,l){this.aiDataContract={ver:1,name:0,url:0,duration:0,perfTotal:0,networkConnect:0,sentRequest:0,receivedResponse:0,domProcessing:0,properties:0,measurements:0};var u=this;u.ver=2,u.url=AY(e,n),u[d_]=Cu(e,r)||u_,u[PA]=HE(e,s),u[f_]=GE(e,c),l&&(u.domProcessing=l.domProcessing,u[gY]=l[gY],u.networkConnect=l.networkConnect,u.perfTotal=l.perfTotal,u.receivedResponse=l.receivedResponse,u.sentRequest=l.sentRequest)}return a(t,"PageViewPerformance"),t.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",t.dataType="PageviewPerformanceData",t})();p();var S3=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function W7(t){var e="ai."+t+".";return function(r){return e+r}}a(W7,"_aiNameFunc");var Q1e=W7("application"),dg=W7("device"),Tje=W7("location"),Jae=W7("operation"),w4t=W7("session"),V7=W7("user"),SY=W7("cloud"),q1e=W7("internal"),j1e=(function(t){l_(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(T5t({applicationVersion:Q1e("ver"),applicationBuild:Q1e("build"),applicationTypeId:Q1e("typeId"),applicationId:Q1e("applicationId"),applicationLayer:Q1e("layer"),deviceId:dg("id"),deviceIp:dg("ip"),deviceLanguage:dg("language"),deviceLocale:dg("locale"),deviceModel:dg("model"),deviceFriendlyName:dg("friendlyName"),deviceNetwork:dg("network"),deviceNetworkName:dg("networkName"),deviceOEMName:dg("oemName"),deviceOS:dg("os"),deviceOSVersion:dg("osVersion"),deviceRoleInstance:dg("roleInstance"),deviceRoleName:dg("roleName"),deviceScreenResolution:dg("screenResolution"),deviceType:dg("type"),deviceMachineName:dg("machineName"),deviceVMName:dg("vmName"),deviceBrowser:dg("browser"),deviceBrowserVersion:dg("browserVersion"),locationIp:Tje("ip"),locationCountry:Tje("country"),locationProvince:Tje("province"),locationCity:Tje("city"),operationId:Jae("id"),operationName:Jae("name"),operationParentId:Jae("parentId"),operationRootId:Jae("rootId"),operationSyntheticSource:Jae("syntheticSource"),operationCorrelationVector:Jae("correlationVector"),sessionId:w4t("id"),sessionIsFirst:w4t("isFirst"),sessionIsNew:w4t("isNew"),userAccountAcquisitionDate:V7("accountAcquisitionDate"),userAccountId:V7("accountId"),userAgent:V7("userAgent"),userId:V7("id"),userStoreRegion:V7("storeRegion"),userAuthUserId:V7("authUserId"),userAnonymousUserAcquisitionDate:V7("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:V7("authUserAcquisitionDate"),cloudName:SY("name"),cloudRole:SY("role"),cloudRoleVer:SY("roleVer"),cloudRoleInstance:SY("roleInstance"),cloudEnvironment:SY("environment"),cloudLocation:SY("location"),cloudDeploymentUnit:SY("deploymentUnit"),internalNodeName:q1e("nodeName"),internalSdkVersion:q1e("sdkVersion"),internalAgentVersion:q1e("agentVersion"),internalSnippet:q1e("snippet"),internalSdkSrc:q1e("sdkSrc")}));p();var Zh=new j1e;p();function uin(t,e){f4t(t,null,null,e)}a(uin,"_disableEvents");function R4t(t){var e=bf(),r=nd(),n=!1,o=[],s=1;r&&!Xt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=w1e(w1("OfflineListener"),t);try{if(f(Sf())&&(n=!0),e){var d=e.body||e;d.ononline&&f(d)&&(n=!0)}}catch{n=!1}function f(S){var T=!1;return S&&(T=gje(S,"online",y,u),T&&gje(S,"offline",_,u)),T}a(f,"_enableEvents");function h(){return l}a(h,"_isOnline");function m(){return!(c===2||s===2)}a(m,"calCurrentState");function g(){var S=m();l!==S&&(l=S,Ct(o,function(T){var w={isOnline:l,rState:s,uState:c};try{T(w)}catch{}}))}a(g,"listnerNoticeCheck");function A(S){c=S,g()}a(A,"setOnlineState");function y(){s=1,g()}a(y,"_setOnline");function _(){s=2,g()}a(_,"_setOffline");function E(){var S=Sf();if(S&&n){if(uin(S,u),e){var T=e.body||e;Bn(T.ononline)||uin(T,u)}n=!1}}a(E,"_unload");function v(S){return o.push(S),{rm:a(function(){var T=o.indexOf(S);if(T>-1)return o.splice(T,1)},"rm")}}return a(v,"addListener"),{isOnline:h,isListening:a(function(){return n},"isListening"),unload:E,addListener:v,setOnlineState:A}}a(R4t,"createOfflineListener");var Ije="AppInsightsChannelPlugin";p();p();p();p();p();var z7="duration";p();var Xh="tags",xje="deviceType",BC="data",eO="name",TY="traceID",qo="length",Y7="stringify",K7="measurements",Hx="dataType",J7="envelopeType",T3="toString",I3="enqueue",x3="count",Gx="push",H1e="emitLineDelimitedJson",Z7="clear",Zae="markAsSent",IY="clearSent",G1e="bufferOverride",Xae="BUFFER_KEY",w3="SENT_BUFFER_KEY",X7="concat",ece="MAX_BUFFER_SIZE",tce="triggerSend",DA="diagLog",wje="initialize",rce="_sender",nce="endpointUrl",ice="instrumentationKey",Rje="customHeaders",k4t="maxBatchSizeInBytes",kje="onunloadDisableBeacon",Pje="isBeaconApiDisabled",P4t="alwaysUseXhrOverride",D4t="enableSessionStorageBuffer",DP="_buffer",N4t="onunloadDisableFetch",M4t="disableSendBeaconSplit",$1e="getSenderInst",eQ="_onError",Dje="_onPartialSuccess",V1e="_onSuccess",Nje="itemsReceived",Mje="itemsAccepted",Oje="baseType",oce="sampleRate",din="getHashCodeScore";var O4t="baseType",Wd="baseData",p0="properties",fin="true";function Jp(t,e,r){return YM(t,e,r,y1)}a(Jp,"_setValueIf");function Lwo(t,e,r){var n=r[Xh]=r[Xh]||{},o=e.ext=e.ext||{},s=e[Xh]=e[Xh]||[],c=o.user;c&&(Jp(n,Zh.userAuthUserId,c.authId),Jp(n,Zh.userId,c.id||c.localId));var l=o.app;l&&Jp(n,Zh.sessionId,l.sesId);var u=o.device;u&&(Jp(n,Zh.deviceId,u.id||u.localId),Jp(n,Zh[xje],u.deviceClass),Jp(n,Zh.deviceIp,u.ip),Jp(n,Zh.deviceModel,u.model),Jp(n,Zh[xje],u[xje]));var d=e.ext.web;if(d){Jp(n,Zh.deviceLanguage,d.browserLang),Jp(n,Zh.deviceBrowserVersion,d.browserVer),Jp(n,Zh.deviceBrowser,d.browser);var f=r[BC]=r[BC]||{},h=f[Wd]=f[Wd]||{},m=h[p0]=h[p0]||{};Jp(m,"domain",d.domain),Jp(m,"isManual",d.isManual?fin:null),Jp(m,"screenRes",d.screenRes),Jp(m,"userConsent",d.userConsent?fin:null)}var g=o.os;g&&(Jp(n,Zh.deviceOS,g[eO]),Jp(n,Zh.deviceOSVersion,g.osVer));var A=o.trace;A&&(Jp(n,Zh.operationParentId,A.parentID),Jp(n,Zh.operationName,Cu(t,A[eO])),Jp(n,Zh.operationId,A[TY]));for(var y={},_=s[qo]-1;_>=0;_--){var E=s[_];Zr(E,function(S,T){y[S]=T}),s.splice(_,1)}Zr(s,function(S,T){y[S]=T});var v=Ux(Ux({},n),y);v[Zh.internalSdkVersion]||(v[Zh.internalSdkVersion]=Cu(t,"javascript:".concat(Bwo.Version),64)),r[Xh]=Wqe(v)}a(Lwo,"_extractPartAExtensions");function tQ(t,e,r){Xt(t)||Zr(t,function(n,o){zh(o)?r[n]=o:vi(o)?e[n]=o:B7()&&(e[n]=jE()[Y7](o))})}a(tQ,"_extractPropsAndMeasurements");function xY(t,e){Xt(t)||Zr(t,function(r,n){t[r]=n||e})}a(xY,"_convertPropsUndefinedToCustomDefinedValue");function wY(t,e,r,n){var o=new b4t(t,n,e);Jp(o,"sampleRate",r[R1e]),(r[Wd]||{}).startTime&&(o.time=L7(r[Wd].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[eO]=o[eO].replace("{0}",s),Lwo(t,r,o),r[Xh]=r[Xh]||[],Wqe(o)}a(wY,"_createEnvelope");function RY(t,e){Xt(e[Wd])&&Jr(t,1,46,"telemetryItem.baseData cannot be null.")}a(RY,"EnvelopeCreatorInit");var Bwo={Version:"3.3.11"};function pin(t,e,r){RY(t,e);var n=e[Wd][K7]||{},o=e[Wd][p0]||{};tQ(e[BC],o,n),Xt(r)||xY(o,r);var s=e[Wd];if(Xt(s))return E3(t,"Invalid input for dependency data"),null;var c=s[p0]&&s[p0][Aje]?s[p0][Aje]:"GET",l=new vY(t,s.id,s.target,s[eO],s[z7],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new S3(vY[Hx],l);return wY(t,vY[J7],e,u)}a(pin,"DependencyEnvelopeCreator");function L4t(t,e,r){RY(t,e);var n={},o={};e[O4t]!==C3[Hx]&&(n.baseTypeSource=e[O4t]),e[O4t]===C3[Hx]?(n=e[Wd][p0]||{},o=e[Wd][K7]||{}):e[Wd]&&tQ(e[Wd],n,o),tQ(e[BC],n,o),Xt(r)||xY(n,r);var s=e[Wd][eO],c=new C3(t,s,n,o),l=new S3(C3[Hx],c);return wY(t,C3[J7],e,l)}a(L4t,"EventEnvelopeCreator");function hin(t,e,r){RY(t,e);var n=e[Wd][K7]||{},o=e[Wd][p0]||{};tQ(e[BC],o,n),Xt(r)||xY(o,r);var s=e[Wd],c=_Y.CreateFromInterface(t,s,o,n),l=new S3(_Y[Hx],c);return wY(t,_Y[J7],e,l)}a(hin,"ExceptionEnvelopeCreator");function min(t,e,r){RY(t,e);var n=e[Wd],o=n[p0]||{},s=n[K7]||{};tQ(e[BC],o,s),Xt(r)||xY(o,r);var c=new b3(t,n[eO],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new S3(b3[Hx],c);return wY(t,b3[J7],e,l)}a(min,"MetricEnvelopeCreator");function gin(t,e,r){RY(t,e);var n,o=e[Wd];!Xt(o)&&!Xt(o[p0])&&!Xt(o[p0][z7])?(n=o[p0][z7],delete o[p0][z7]):!Xt(e[BC])&&!Xt(e[BC][z7])&&(n=e[BC][z7],delete e[BC][z7]);var s=e[Wd],c;((e.ext||{}).trace||{})[TY]&&(c=e.ext.trace[TY]);var l=s.id||c,u=s[eO],d=s.uri,f=s[p0]||{},h=s[K7]||{};if(Xt(s.refUri)||(f.refUri=s.refUri),Xt(s.pageType)||(f.pageType=s.pageType),Xt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[T3]()),!Xt(s[p0])){var m=s[p0];Zr(m,function(y,_){f[y]=_})}tQ(e[BC],f,h),Xt(r)||xY(f,r);var g=new EY(t,u,d,n,f,h,l),A=new S3(EY[Hx],g);return wY(t,EY[J7],e,A)}a(gin,"PageViewEnvelopeCreator");function Ain(t,e,r){RY(t,e);var n=e[Wd],o=n[eO],s=n.uri||n.url,c=n[p0]||{},l=n[K7]||{};tQ(e[BC],c,l),Xt(r)||xY(c,r);var u=new bY(t,o,s,void 0,c,l,n),d=new S3(bY[Hx],u);return wY(t,bY[J7],e,d)}a(Ain,"PageViewPerformanceEnvelopeCreator");function yin(t,e,r){RY(t,e);var n=e[Wd].message,o=e[Wd].severityLevel,s=e[Wd][p0]||{},c=e[Wd][K7]||{};tQ(e[BC],s,c),Xt(r)||xY(s,r);var l=new CY(t,n,o,s,c),u=new S3(CY[Hx],l);return wY(t,CY[J7],e,u)}a(yin,"TraceEnvelopeCreator");p();var _in=(function(){function t(e,r){var n=[],o=!1,s=r.maxRetryCnt;this._get=function(){return n},this._set=function(c){return n=c,n},ki(t,this,function(c){c[I3]=function(l){if(c[x3]()>=r.eventsLimitInMem){o||(Jr(e,2,105,"Maximum in-memory buffer size reached: "+c[x3](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Xt(s)&&l.cnt>s)&&n[Gx](l)},c[x3]=function(){return n[qo]},c.size=function(){for(var l=n[qo],u=0;u0){var u=[];Ct(l,function(f){u[Gx](f.item)});var d=r[H1e]?u.join(` +`):"["+u.join(",")+"]";return d}return null},c.createNew=function(l,u,d){var f=n.slice(0);l=l||e,u=u||{};var h=d?new B4t(l,u):new Lje(l,u);return Ct(f,function(m){h[I3](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),Lje=(function(t){l_(e,t);function e(r,n){var o=t.call(this,r,n)||this;return ki(e,o,function(s,c){s[Zae]=function(l){c[Z7]()},s[IY]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(_in);var Fwo=["AI_buffer","AI_sentBuffer"],B4t=(function(t){l_(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[G1e]||{getItem:E4t,setItem:v4t},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return ki(e,s,function(m,g){var A=T(e[Xae]),y=T(e[w3]),_=x(),E=y[X7](_),v=m._set(A[X7](E));v[qo]>e[ece]&&(v[qo]=e[ece]),R(e[w3],[]),R(e[Xae],v),m[I3]=function(D){if(m[x3]()>=e[ece]){c||(Jr(n,2,67,"Maximum buffer size reached: "+m[x3](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Xt(h)&&D.cnt>h)&&(g[I3](D),R(e[Xae],m._get()))},m[Z7]=function(){g[Z7](),R(e[Xae],m._get()),R(e[w3],[]),c=!1},m[Zae]=function(D){R(e[Xae],m._set(S(D,m._get())));var N=T(e[w3]);N instanceof Array&&D instanceof Array&&(N=N[X7](D),N[qo]>e[ece]&&(Jr(n,1,67,"Sent buffer reached its maximum size: "+N[qo],!0),N[qo]=e[ece]),R(e[w3],N))},m[IY]=function(D){var N=T(e[w3]);N=S(D,N),R(e[w3],N)},m.createNew=function(D,N,O){O=!!O;var B=m._get().slice(0),q=T(e[w3]).slice(0);D=D||n,N=N||{},m[Z7]();var M=O?new e(D,N):new Lje(D,N);return Ct(B,function(L){M[I3](L)}),O&&M[Zae](q),M};function S(D,N){var O=[],B=[];return Ct(D,function(q){B[Gx](q.item)}),Ct(N,function(q){!qr(q)&&Jo(B,q.item)===-1&&O[Gx](q)}),O}a(S,"_removePayloadsFromBuffer");function T(D){var N=D;return N=l?l+"_"+N:N,w(N)}a(T,"_getBuffer");function w(D){try{var N=d(n,D);if(N){var O=jE().parse(N);if(vi(O)&&(O=jE().parse(O)),O&&pr(O))return O}}catch(B){Jr(n,1,42," storage key: "+D+", "+Kp(B),{exception:hr(B)})}return[]}a(w,"_getBufferBase");function R(D,N){var O=D;try{O=l?l+"_"+O:O;var B=JSON[Y7](N);f(n,O,B)}catch(q){f(n,O,JSON[Y7]([])),Jr(n,2,41," storage key: "+O+", "+Kp(q)+". Buffer cleared",{exception:hr(q)})}}a(R,"_setBuffer");function x(){var D=[];try{return Ct(Fwo,function(N){var O=k(N);if(D=D[X7](O),l){var B=l+"_"+N,q=k(B);D=D[X7](q)}}),D}catch(N){Jr(n,2,41,"Transfer events from previous buffers: "+Kp(N)+". previous Buffer items can not be removed",{exception:hr(N)})}return[]}a(x,"_getPreviousEvents");function k(D){try{var N=w(D),O=[];return Ct(N,function(B){var q={item:B,cnt:0};O[Gx](q)}),C4t(n,D),O}catch{}return[]}a(k,"_getItemsFromPreviousKey")}),s}a(e,"SessionStorageSendBuffer");var r;return r=e,e.VERSION="_1",e.BUFFER_KEY="AI_buffer"+r.VERSION,e.SENT_BUFFER_KEY="AI_sentBuffer"+r.VERSION,e.MAX_BUFFER_SIZE=2e3,e})(_in);p();var Ein=(function(){function t(e){ki(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return jE()[Y7](l)}catch(u){Jr(e,1,48,u&&qr(u[T3])?u[T3]():"Error serializing object",null,!0)}};function n(c,l){var u="__aiCircularRefCheck",d={};if(!c)return Jr(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(c[u])return Jr(e,2,50,"Circular reference detected while serializing object",{name:l},!0),d;if(!c.aiDataContract){if(l==="measurements")d=s(c,"number",l);else if(l==="properties")d=s(c,"string",l);else if(l==="tags")d=s(c,"string",l);else if(pr(c))d=o(c,l);else{Jr(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{jE()[Y7](c),d=c}catch(f){Jr(e,1,48,f&&qr(f[T3])?f[T3]():"Error serializing object",null,!0)}}return d}return c[u]=!0,Zr(c.aiDataContract,function(f,h){var m=qr(h)?h()&1:h&1,g=qr(h)?h()&4:h&4,A=h&2,y=c[f]!==void 0,_=td(c[f])&&c[f]!==null;if(m&&!y&&!A)Jr(e,1,24,"Missing required field specification. The field is required but not present on source",{field:f,name:l});else if(!g){var E=void 0;_?A?E=o(c[f],f):E=n(c[f],f):E=c[f],E!==void 0&&(d[f]=E)}}),delete c[u],d}a(n,"_serializeObject");function o(c,l){var u;if(c)if(!pr(c))Jr(e,1,54,`This field was specified as an array in the contract but the item is not an array.\r +`,{name:l},!0);else{u=[];for(var d=0;d100||e<0)&&(n.throwInternal(2,58,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),e=100),this[oce]=e,this.samplingScoreGenerator=new Cin}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[oce],n=!1;return r==null||r>=100||e.baseType===b3[Hx]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(jwo,"_chkSampling");var Hwo=(R3={},R3[C3.dataType]=L4t,R3[CY.dataType]=yin,R3[EY.dataType]=gin,R3[bY.dataType]=Ain,R3[_Y.dataType]=hin,R3[b3.dataType]=min,R3[vY.dataType]=pin,R3),F4t=(function(t){l_(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=Ije;var n,o,s,c,l,u,d,f,h=0,m,g,A,y,_,E,v,S,T,w,R,x,k,D,N,O,B,q,M,L,U,j,Q,Y,W,V,z,ie;return ki(e,r,function(H,re){je(),H.pause=function(){ge(),c=!0},H.resume=function(){c&&(c=!1,o=null,tt(),Qe())},H.flush=function(J,ae,Ce){if(J===void 0&&(J=!0),!c){ge();try{var Re=H[tce](J,null,Ce||1);return Pl(Re,function($e){return ae?(ae(!$e.rejected),!0):J?Vd(function(Ye){Ye(!$e.rejected)}):Re})}catch($e){Jr(H[DA](),1,22,"flush failed, telemetry will not be collected: "+Kp($e),{exception:hr($e)})}}},H.onunloadFlush=function(){if(!c)if(v||L)try{return H[tce](!0,Pt,2)}catch(J){Jr(H[DA](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+Kp(J),{exception:hr(J)})}else H.flush(!1)},H.addHeader=function(J,ae){f[J]=ae},H[wje]=function(J,ae,Ce,Re){H.isInitialized()&&Jr(H[DA](),1,28,"Sender is already initialized"),re[wje](J,ae,Ce,Re);var $e=H.identifier;u=new Ein(ae.logger),n=0,o=null,s=0,H[rce]=null,d=0;var Ye=H[DA]();A=w1e(w1("Sender"),ae.evtNamespace&&ae.evtNamespace()),g=R4t(A),H._addHook(Qx(J,function(ut){var yt=ut.cfg;yt.storagePrefix&&_4t(yt.storagePrefix);var $t=kP(null,yt,ae),Tt=$t.getExtCfg($e,Iin),We=Tt[nce];if(y&&We===y){var ce=yt[nce];ce&&ce!==We&&(Tt[nce]=ce)}var Pe=Oi("CompressionStream");ie=I5t("zipPayload",yt,!1),qr(Pe)||(ie=!1);var Me=Tt.corsPolicy;Me?(Me==="same-origin"||Me==="same-site"||Me==="cross-origin")&&r.addHeader(xin,Me):delete f[xin],d0(Tt[ice])&&(Tt[ice]=yt[ice]),$i(H,"_senderConfig",{g:a(function(){return Tt},"g")}),_!==Tt[nce]&&(y=_=Tt[nce]),ae.activeStatus()===TP.PENDING?H.pause():ae.activeStatus()===TP.ACTIVE&&H.resume(),w&&w!==Tt[Rje]&&Ct(w,function(Tr){delete f[Tr.header]}),E=Tt[k4t],v=(Tt[kje]===!1||Tt[Pje]===!1)&&F7(),S=Tt[kje]===!1&&F7(),T=Tt[Pje]===!1&&F7(),L=Tt[P4t],U=!!Tt.disableXhr,z=Tt.retryCodes;var ye=Tt[G1e],oe=!!Tt[D4t]&&(!!ye||Cje()),Ke=Tt.namePrefix,lt=oe!==O||oe&&q!==Ke||oe&&B!==ye;if(H[DP]){if(lt)try{H[DP]=H[DP].createNew(Ye,Tt,oe)}catch(Tr){Jr(H[DA](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+Kp(Tr),{exception:hr(Tr)})}tt()}else H[DP]=oe?new B4t(Ye,Tt):new Lje(Ye,Tt);q=Ke,O=oe,B=ye,j=!Tt[N4t]&&h1e(!0),W=!!Tt[M4t],H._sample=new bin(Tt.samplingPercentage,Ye),x=Tt[ice],!d0(x)&&!qe(x,yt)&&Jr(Ye,1,100,"Invalid Instrumentation key "+x),w=Tt[Rje],vi(y)&&!Eje(y)&&w&&w[qo]>0?Ct(w,function(Tr){r.addHeader(Tr.header,Tr.value)}):w=null,M=Tt.enableSendPromise;var Gt=Le();V?V.SetConfig(Gt):(V=new l4t,V[wje](Gt,Ye));var Er=Tt.httpXHROverride,dr=null,Ur=null,Wr=Yqe([3,1,2],Tt.transports);dr=V&&V[$1e](Wr,!1);var zr=V&&V.getFallbackInst();Q=a(function(Tr,t0){return Ne(zr,Tr,t0)},"_xhrSend"),Y=a(function(Tr,t0){return Ne(zr,Tr,t0,!1)},"_fallbackSend"),dr=L?Er:dr||Er||zr,H[rce]=function(Tr,t0){return Ne(dr,Tr,t0)},j&&(m=se);var zt=Yqe([3,1],Tt.unloadTransports);j||(zt=zt.filter(function(Tr){return Tr!==2})),Ur=V&&V[$1e](zt,!0),Ur=L?Er:Ur||Er,(L||Tt.unloadTransports||!m)&&Ur&&(m=a(function(Tr,t0){return Ne(Ur,Tr,t0)},"_syncUnloadSender")),m||(m=Q),R=Tt.disableTelemetry,k=Tt.convertUndefined||NP,D=Tt.isRetryDisabled,N=Tt.maxBatchInterval}))},H.processTelemetry=function(J,ae){ae=H._getTelCtx(ae);var Ce=ae[DA]();try{var Re=K(J,Ce);if(!Re)return;var $e=he(J,Ce);if(!$e)return;var Ye=u.serialize($e),ut=H[DP];tt(Ye);var yt={item:Ye,cnt:0};ut[I3](yt),Qe()}catch($t){Jr(Ce,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Kp($t),{exception:hr($t)})}H.processNext(J,ae)},H.isCompletelyIdle=function(){return!c&&h===0&&H._buffer[x3]()===0},H.getOfflineListener=function(){return g},H._xhrReadyStateChange=function(J,ae,Ce){if(!F(ae))return me(J,ae,Ce)},H[tce]=function(J,ae,Ce){J===void 0&&(J=!0);var Re;if(!c)try{var $e=H[DP];if(R)$e[Z7]();else{if($e[x3]()>0){var Ye=$e.getItems();Ge(Ce||0,J),ae?Re=ae.call(H,Ye,J):Re=H[rce](Ye,J)}s=+new Date}ge()}catch(yt){var ut=L5t();(!ut||ut>9)&&Jr(H[DA](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+Kp(yt),{exception:hr(yt)})}return Re},H.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:Be,serialize:X,batch:de,shouldProcess:a(function(J){return!!K(J)},"shouldProcess")}},H._doTeardown=function(J,ae){H.onunloadFlush(),_3(g,!1),je()},H[eQ]=function(J,ae,Ce){if(!F(J))return Oe(J,ae,Ce)},H[Dje]=function(J,ae){if(!F(J))return Te(J,ae)},H[V1e]=function(J,ae){if(!F(J))return te(J,ae)},H._xdrOnLoad=function(J,ae){if(!F(ae))return le(J,ae)};function le(J,ae){var Ce=Tin(J);if(J&&(Ce+""=="200"||Ce===""))n=0,H[V1e](ae,0);else{var Re=x1e(Ce);Re&&Re[Nje]&&Re[Nje]>Re[Mje]&&!D?H[Dje](ae,Re):H[eQ](ae,d1e(J))}}a(le,"_xdrOnLoad");function Le(){try{var J={xdrOnComplete:a(function(Ce,Re,$e){var Ye=ee($e);if(Ye)return le(Ce,Ye)},"xdrOnComplete"),fetchOnComplete:a(function(Ce,Re,$e,Ye){var ut=ee(Ye);if(ut)return st(Ce.status,ut,Ce.url,ut[qo],Ce.statusText,$e||"")},"fetchOnComplete"),xhrOnComplete:a(function(Ce,Re,$e){var Ye=ee($e);if(Ye)return me(Ce,Ye,Ye[qo])},"xhrOnComplete"),beaconOnRetry:a(function(Ce,Re,$e){return Ht(Ce,Re,$e)},"beaconOnRetry")},ae={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:U,disableBeacon:!T,disableBeaconSync:!S,senderOnCompleteCallBack:J};return ae}catch{}return null}a(Le,"_getSendPostMgrConfig");function me(J,ae,Ce){J.readyState===4&&st(J.status,ae,J.responseURL,Ce,sY(J),Tin(J)||J.response)}a(me,"_xhrReadyStateChange");function Oe(J,ae,Ce){Jr(H[DA](),2,26,"Failed to send telemetry.",{message:ae}),H._buffer&&H._buffer[IY](J)}a(Oe,"_onError");function Te(J,ae){for(var Ce=[],Re=[],$e=ae.errors.reverse(),Ye=0,ut=$e;Ye0&&H[V1e](J,ae[Mje]),Ce[qo]>0&&H[eQ](Ce,sY(null,["partial success",ae[Mje],"of",ae.itemsReceived].join(" "))),Re[qo]>0&&(be(Re),Jr(H[DA](),2,40,"Partial success. Delivered: "+J[qo]+", Failed: "+Ce[qo]+". Will retry to send "+Re[qo]+" our of "+ae[Nje]+" items"))}a(Te,"_onPartialSuccess");function te(J,ae){H._buffer&&H._buffer[IY](J)}a(te,"_onSuccess");function ee(J){try{if(J){var ae=J,Ce=ae.oriPayload;return Ce&&Ce[qo]?Ce:null}}catch{}return null}a(ee,"_getPayloadArr");function K(J,ae){if(R)return!1;if(!J)return ae&&Jr(ae,1,7,"Cannot send empty telemetry"),!1;if(J.baseData&&!J[Oje])return ae&&Jr(ae,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(J[Oje]||(J[Oje]="EventData"),!H[rce])return ae&&Jr(ae,1,28,"Sender was not initialized"),!1;if(ne(J))J[R1e]=H._sample[oce];else return ae&&Jr(ae,2,33,"Telemetry item was sampled out and not sent",{SampleRate:H._sample[oce]}),!1;return!0}a(K,"_validate");function he(J,ae){var Ce=J.iKey||x,Re=e.constructEnvelope(J,Ce,ae,k);if(!Re){Jr(ae,1,47,"Unable to create an AppInsights envelope");return}var $e=!1;if(J[Xh]&&J[Xh][k1e]&&(Ct(J[Xh][k1e],function(Ye){try{Ye&&Ye(Re)===!1&&($e=!0,E3(ae,"Telemetry processor check returns false"))}catch(ut){Jr(ae,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+Kp(ut),{exception:hr(ut)},!0)}}),delete J[Xh][k1e]),!$e)return Re}a(he,"_getEnvelope");function X(J){var ae=Sin,Ce=H[DA]();try{var Re=K(J,Ce),$e=null;Re&&($e=he(J,Ce)),$e&&(ae=u.serialize($e))}catch{}return ae}a(X,"_serialize");function de(J){var ae=Sin;return J&&J[qo]&&(ae="["+J.join(",")+"]"),ae}a(de,"_batch");function Be(J){var ae=Fe();return{urlString:y,data:J,headers:ae}}a(Be,"_createPayload");function ne(J){return H._sample.isSampledIn(J)}a(ne,"_isSampledIn");function ue(J,ae,Ce,Re){ae===200&&J?H._onSuccess(J,J[qo]):Re&&H[eQ](J,Re)}a(ue,"_getOnComplete");function Ne(J,ae,Ce,Re){Re===void 0&&(Re=!0);var $e=a(function(ce,Pe,Me){return ue(ae,ce,Pe,Me)},"onComplete"),Ye=xe(ae),ut=J&&J.sendPOST;if(ut&&Ye){Re&&H._buffer[Zae](ae);var yt,$t=!1,Tt,We;return V.preparePayload(function(ce){yt=ut(ce,$e,!Ce),$t=!0,Tt&&Bqe(yt,Tt,We)},ie,Ye,!Ce),$t?yt:Vd(function(ce,Pe){Tt=ce,We=Pe})}return null}a(Ne,"_doSend");function xe(J){if(pr(J)&&J[qo]>0){var ae=H[DP].batchPayloads(J),Ce=Fe(),Re={data:ae,urlString:y,headers:Ce,disableXhrSync:U,disableFetchKeepAlive:!j,oriPayload:J};return Re}return null}a(xe,"_getPayload");function Fe(){try{var J=f||{};return Eje(y)&&(J[yje[6]]=yje[7]),J}catch{}return null}a(Fe,"_getHeaders");function tt(J){var ae=J?J[qo]:0;return H[DP].size()+ae>E?((!g||g.isOnline())&&H[tce](!0,null,10),!0):!1}a(tt,"_checkMaxSize");function st(J,ae,Ce,Re,$e,Ye){var ut=null;if(H._appId||(ut=x1e(Ye),ut&&ut.appId&&(H._appId=ut.appId)),(J<200||J>=300)&&J!==0){if((J===301||J===307||J===308)&&!vt(Ce)){H[eQ](ae,$e);return}if(g&&!g.isOnline()){if(!D){var yt=10;be(ae,yt),Jr(H[DA](),2,40,". Offline - Response Code: ".concat(J,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(ae.length," items."))}return}!D&&Z(J)?(be(ae),Jr(H[DA](),2,40,". Response code "+J+". Will retry to send "+ae[qo]+" items.")):H[eQ](ae,$e)}else vt(Ce),J===206?(ut||(ut=x1e(Ye)),ut&&!D?H[Dje](ae,ut):H[eQ](ae,$e)):(n=0,H[V1e](ae,Re))}a(st,"_checkResponsStatus");function vt(J){return d>=10?!1:!Xt(J)&&J!==""&&J!==y?(y=J,++d,!0):!1}a(vt,"_checkAndUpdateEndPointUrl");function Pt(J,ae){if(m)m(J,!1);else{var Ce=V&&V[$1e]([3],!0);return Ne(Ce,J,ae)}}a(Pt,"_doUnloadSend");function Ht(J,ae,Ce){var Re=J,$e=Re&&Re.oriPayload;if(W)Y&&Y($e,!0),Jr(H[DA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var Ye=[],ut=0;ut<$e[qo];ut++){var yt=$e[ut],$t=[yt],Tt=xe($t);Ce(Tt,ae)?H._onSuccess($t,$t[qo]):Ye[Gx](yt)}Ye[qo]>0&&(Y&&Y(Ye,!0),Jr(H[DA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a(Ht,"_onBeaconRetry");function F(J){try{if(J&&J[qo])return vi(J[0])}catch{}return null}a(F,"_isStringArr");function se(J,ae){var Ce=null;if(pr(J)){for(var Re=J[qo],$e=0;$e-1}a(Z,"_isRetriable");function ve(){var J="getNotifyMgr",ae,Ce=H.core;return Ce&&(Ce[J]?ae=Ce[J]():ae=Ce._notificationManager),ae}a(ve,"_getNotifyMgr");function Ge(J,ae){var Ce=ve();if(Ce&&Ce.eventsSendRequest)try{Ce.eventsSendRequest(J,ae)}catch(Re){Jr(H[DA](),1,74,"send request notification failed: "+Kp(Re),{exception:hr(Re)})}}a(Ge,"_notifySendRequest");function qe(J,ae){var Ce=ae.disableInstrumentationKeyValidation,Re=Xt(Ce)?!1:Ce;if(Re)return!0;var $e="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",Ye=new RegExp($e);return Ye.test(J)}a(qe,"_validateInstrumentationKey");function je(){H[rce]=null,H[DP]=null,H._appId=null,H._sample=null,f={},g=null,n=0,o=null,s=null,c=!1,l=null,u=null,d=0,h=0,m=null,A=null,y=null,_=null,E=0,v=!1,w=null,R=!1,x=null,k=NP,D=!1,O=null,q=NP,U=!1,j=!1,W=!1,Q=null,Y=null,V=null,$i(H,"_senderConfig",{g:a(function(){return zqe({},Iin)},"g")})}a(je,"_initDefaults")}),r}return a(e,"Sender"),e.constructEnvelope=function(r,n,o,s){var c;n!==r.iKey&&!Xt(n)?c=Ux(Ux({},r),{iKey:n}):c=r;var l=Hwo[c.baseType]||L4t;return l(o,c,s)},e})(I1e);p();var kY="instrumentationKey",W1e="connectionString",sce="endpointUrl",ace="userOverrideEndpointUrl";var PY,U4t,Q4t=void 0,Gwo=(PY={diagnosticLogInterval:qae($wo,1e4)},PY[W1e]=Q4t,PY.endpointUrl=Q4t,PY[kY]=Q4t,PY.featureOptIn=(U4t={},U4t.zipPayload={mode:1},U4t),PY.extensionConfig={},PY);function $wo(t){return t&&t>0}a($wo,"_chkDiagLevel");var win=(function(){function t(e){var r=new a4t,n;(Xt(e)||Xt(e[kY])&&Xt(e[W1e]))&&ul("Invalid input configuration"),ki(t,this,function(s){$i(s,"config",{g:a(function(){return n},"g")}),c(),s.initialize=c,s.track=o,oY(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=Jh(e||{},Gwo);n=l.cfg,r.addUnloadHook(Qx(l,function(){var u=n[W1e];if(d0(u)){var d=c1e(function(g,A){Pl(u,function(y){var _=y.value,E=n[kY];if(!y.rejected&&_){n[W1e]=_;var v=F1e(_);E=v.instrumentationkey||E}g(E)})}),f=c1e(function(g,A){Pl(u,function(y){var _=y.value,E=n[sce];if(!y.rejected&&_){var v=F1e(_),S=v.ingestionendpoint;E=S?S+ZM:E}g(E)})});n[kY]=d,n[sce]=n[ace]||f}if(vi(u)){var h=F1e(u),m=h.ingestionendpoint;n[sce]=n[ace]?n[ace]:m+ZM,n[kY]=h.instrumentationkey||n[kY]}n[sce]=n[ace]?n[ace]:n[sce]})),r.initialize(n,[new F4t])}a(c,"_initialize")});function o(s){s&&(s.baseData=s.baseData||{},s.baseType=s.baseType||"EventData"),r.track(s)}a(o,"_track")}return a(t,"ApplicationInsights"),t.__ieDyn=1,t})();var R1=fe(require("os"));var cce=class{constructor(e,r,n,o){this.ctx=e;this.namespace=r;this.onCopilotToken=a(e=>{this.commonProperties["common.isinternal"]=e?.isInternalUser()?"true":"false";let r=e.getTokenValue("tid");r!==void 0&&(this.tags["ai.user.id"]=r)},"onCopilotToken");this.xhrOverride={sendPOST:a((e,r)=>{if(typeof e.data!="string")throw new Error(`AppInsightsReporter only supports string payloads, received ${typeof e.data}`);let n=e.headers??{};n["Content-Type"]="application/json";let o={method:"POST",headers:n,body:e.data};this.ctx.get(Jt).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Fr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")};this.client=new win({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[Ije]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:Vwo(e),this.commonProperties=n?.excludeCommonProperties?{}:Wwo(e),this.#e=ws(e,this.onCopilotToken),o&&this.onCopilotToken(o)}static{a(this,"AppInsightsReporter")}#e;sendTelemetryEvent(e,r,n){r={...r,...this.commonProperties};let o=this.qualifyEventName(e);this.client.track({name:o,tags:this.tags,data:{...r,...n},baseType:"EventData",baseData:{name:o,properties:r,measurements:n}})}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}};function Vwo(t){let e={},r=t.get(za);e["ai.session.id"]=r.sessionId;let n=t.get(Gp);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${R1.type()} ${R1.release()}`,e["ai.device.osArchitecture"]=R1.arch(),e["ai.device.osPlatform"]=R1.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(As).getVersion(),e}a(Vwo,"getTags");function Wwo(t){let e={};e.common_os=R1.platform(),e.common_platformversion=R1.release(),e.common_arch=R1.arch(),e.common_cpu=Array.from(new Set(R1.cpus().map(n=>n.model))).join();let r=t.get(za);return e.common_vscodemachineid=r.machineId,e.common_vscodesessionid=r.sessionId,e.client_deviceid=r.devDeviceId,e.common_uikind=r.uiKind,e.common_remotename=r.remoteName,e.common_isnewappinstall="",e}a(Wwo,"getCommonProperties");p();p();p();p();p();p();var z1e=mqe;var tO=z1e({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var rQ=z1e({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var DY="toLowerCase",xn="length",lce="warnToConsole",k3="throwInternal",rO="watch",nQ="apply",so="push",$x="splice",od="logger",nO="cancel",P3="initialize",iO="identifier",uce="removeNotificationListener",dce="addNotificationListener",FC="isInitialized",Y1e="getNotifyMgr",iQ="getPlugin",MP="name",fg="processNext",Bje="getProcessTelContext",D3="value",oQ="enabled",q4t="stopPollingInternalLogs",Vx="unload",K1e="onComplete",Fje="version",Uje="loggingLevelConsole",oO="createNew",k1="teardown",fce="messageId",sO="message",UC="diagLog",sQ="_doTeardown",NY="update",P1="getNext",aQ="setNextPlugin",J1e="userAgent",N3="split",OP="replace",j4t="substring",Qje="indexOf",M3="type",H4t="evtName",LP="status",G4t="getAllResponseHeaders",Z1e="isChildEvt",D1="data",MY="getCtx",BP="setCtx";var X1e="headers",pce="urlString",OY="timeout";var qje="traceFlags";var $4t;function Rin(t,e){$4t||($4t=WSe("AggregationError",function(n,o){o[xn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` +`.concat(o," > ").concat(hr(n))}),new $4t(r,e||[])}a(Rin,"throwAggregationError");p();p();p();p();p();var N1=void 0,Rs="",LY="channels",np="core",jje="createPerfMgr",eTe="disabled",O3="extensionConfig",BY="extensions",QC="processTelemetry",FY="priority",hce="eventsSent",cQ="eventsDiscarded",mce="eventsSendRequest",aO="perfEvent",Hje="offlineEventsStored",Gje="offlineBatchSent",$je="offlineBatchDrop",gce="getPerfMgr",Vje="domain",Wje="path",kin="Not dynamic - ";var zwo="getPrototypeOf",Ywo=/-([a-z])/g,Kwo=/([^\w\d_$])/g,Jwo=/^(\d+[\w\d_$])/,HHl=Object[zwo];function lQ(t){return!Xt(t)}a(lQ,"isNotNullOrUndefined");function Ace(t){var e=t;return e&&vi(e)&&(e=e[OP](Ywo,function(r,n){return n.toUpperCase()}),e=e[OP](Kwo,"_"),e=e[OP](Jwo,function(r,n){return"_"+n})),e}a(Ace,"normalizeJsName");function h0(t,e){return t&&e?vu(t,e)!==-1:!1}a(h0,"strContains");function yce(t){return t&&t.toISOString()||""}a(yce,"toISOString");function _ce(t){return c3(t)?t[MP]:Rs}a(_ce,"getExceptionName");function L3(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(L3,"setValue");function zje(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Bn(r)?{}:r,t[e]=n)):n=Bn(r)?{}:r,n}a(zje,"getSetValue");function Zwo(t,e){var r=null,n=null;return qr(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][nQ](n,o)}}a(Zwo,"_createProxyFunction");function uQ(t,e,r,n,o){t&&e&&r&&(o!==!1||Bn(t[e]))&&(t[e]=Zwo(r,n))}a(uQ,"proxyFunctionAs");function dQ(t,e,r,n){return t&&e&&td(t)&&pr(r)&&Ct(r,function(o){vi(o)&&uQ(t,o,e,o,n)}),t}a(dQ,"proxyFunctions");function cO(t){return t&&l3&&(t=N7(l3({},t))),t}a(cO,"optimizeObject");function Yje(t,e,r){var n=e&&e.featureOptIn&&e.featureOptIn[t];if(t&&n){var o=n.mode;if(o===3)return!0;if(o===2)return!1}return r}a(Yje,"isFeatureEnabled");function lO(t){try{return t.responseText}catch{}return null}a(lO,"getResponseText");function Kje(t,e){return t?"XDomainRequest,Response:"+lO(t)||"":e}a(Kje,"formatErrorMessageXdr");function rTe(t,e){return t?"XMLHttpRequest,Status:"+t[LP]+",Response:"+lO(t)||t.response||"":e}a(rTe,"formatErrorMessageXhr");function nTe(t,e){return e&&(zh(e)?t=[e].concat(t):pr(e)&&(t=e.concat(t))),t}a(nTe,"prependTransports");var Xwo="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",Pin="withCredentials",eRo="timeout";function V4t(t,e,r,n,o,s){n===void 0&&(n=!1),o===void 0&&(o=!1);function c(u,d,f){try{u[d]=f}catch{}}a(c,"_wrapSetXhrProp");var l=new XMLHttpRequest;return n&&c(l,Xwo,n),r&&c(l,Pin,r),l.open(t,e,!o),r&&c(l,Pin,r),!o&&s&&c(l,eRo,s),l}a(V4t,"openXhr");function W4t(t){var e={};if(vi(t)){var r=Li(t)[N3](/[\r\n]+/);Ct(r,function(n){if(n){var o=n[Qje](": ");if(o!==-1){var s=Li(n.substring(0,o))[DY](),c=Li(n[j4t](o+1));e[s]=c}else e[Li(n)]=1}})}return e}a(W4t,"convertAllHeadersToMap");function tTe(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Li(n))}return t}a(tTe,"_appendHeader");var tRo="kill-duration",rRo="kill-duration-seconds",nRo="time-delta-millis";function fQ(t,e){var r={};return t[G4t]?r=W4t(t[G4t]()):e&&(r=tTe(r,t,nRo),r=tTe(r,t,tRo),r=tTe(r,t,rRo)),r}a(fQ,"_getAllResponseHeaders");p();p();var iRo="location",oRo="console",Din="JSON",sRo="crypto",aRo="msCrypto",cRo="ReactNative",lRo="msie",uRo="trident/",Nin="XMLHttpRequest",z4t=null,Y4t=null,dRo=!1,Ece=null,K4t=null;function Min(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[I1];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!Bn(o[e])}catch{}}return r}a(Min,"_hasProperty");function vce(t){if(t&&dRo){var e=Oi("__mockLocation");if(e)return e}return typeof location===Fx&&location?location:Oi(iRo)}a(vce,"getLocation");function Jje(){return typeof console!==T1?console:Oi(oRo)}a(Jje,"getConsole");function iTe(){return!!(typeof JSON===Fx&&JSON||Oi(Din)!==null)}a(iTe,"hasJSON");function Zje(){return iTe()?JSON||Oi(Din):null}a(Zje,"getJSON");function Xje(){return Oi(sRo)}a(Xje,"getCrypto");function eHe(){return Oi(aRo)}a(eHe,"getMsCrypto");function Cce(){var t=nd();return t&&t.product?t.product===cRo:!1}a(Cce,"isReactNative");function UY(){var t=nd();if(t&&(t[J1e]!==Y4t||z4t===null)){Y4t=t[J1e];var e=(Y4t||Rs)[DY]();z4t=h0(e,lRo)||h0(e,uRo)}return z4t}a(UY,"isIE");function bce(t){return(K4t===null||t===!1)&&(K4t=zz()&&!!nd().sendBeacon),K4t}a(bce,"isBeaconsSupported");function Sce(t){var e=!1;try{e=!!Oi("fetch");var r=Oi("Request");e&&t&&r&&(e=Min(r,"keepalive"))}catch{}return e}a(Sce,"isFetchSupported");function tHe(){return Ece===null&&(Ece=typeof XDomainRequest!==T1,Ece&&oTe()&&(Ece=Ece&&!Min(Oi(Nin),"withCredentials"))),Ece}a(tHe,"useXDomainRequest");function oTe(){var t=!1;try{var e=Oi(Nin);t=!!e}catch{}return t}a(oTe,"isXhrSupported");var Oin=4294967296,QY=4294967295,Lin=123456789,Bin=987654321,Fin=!1,sTe=Lin,aTe=Bin;function fRo(t){t<0&&(t>>>=0),sTe=Lin+t&QY,aTe=Bin-t&QY,Fin=!0}a(fRo,"_mwcSeed");function pRo(){try{var t=kl()&2147483647;fRo((Math.random()*Oin^t)+t)}catch{}}a(pRo,"_autoSeedMwc");function J4t(t){var e=0,r=Xje()||eHe();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&QY),e===0&&UY()&&(Fin||pRo(),e=hRo()&QY),e===0&&(e=E1(Oin*Math.random()|0)),t||(e>>>=0),e}a(J4t,"random32");function hRo(t){aTe=36969*(aTe&65535)+(aTe>>16)&QY,sTe=18e3*(sTe&65535)+(sTe>>16)&QY;var e=(aTe<<16)+(sTe&65535)>>>0&QY|0;return t||(e>>>=0),e}a(hRo,"mwcRandom32");function Z4t(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=J4t()>>>0,n=0,o=Rs;o[xn]>>=6,n===5&&(r=(J4t()<<2&4294967295|r&3)>>>0,n=0);return o}a(Z4t,"newId");var Uin="3.3.10",mRo="."+Z4t(6),gRo=0;function Qin(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(Qin,"_canAcceptData");function ARo(t,e){var r=e[t.id];if(!r){r={};try{Qin(e)&&$i(e,t.id,{e:!1,v:r})}catch{}}return r}a(ARo,"_getCache");function Wx(t,e){return e===void 0&&(e=!1),Ace(t+gRo+++(e?"."+Uin:Rs)+mRo)}a(Wx,"createUniqueNamespace");function rHe(t){var e={id:Wx("_aiData-"+(t||Rs)+"."+Uin),accept:a(function(r){return Qin(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[Ace(n)]:(s&&(c=ARo(e,r),c[Ace(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(rHe,"createElmNodeData");p();function nHe(t){return t&&td(t)&&!pr(t)&&(t.isVal||t.fb||kA(t,"v")||kA(t,"mrg")||kA(t,"ref")||t.set)}a(nHe,"_isConfigDefaults");function qin(t,e,r){var n,o=r.dfVal||vae;if(e&&r.fb){var s=r.fb;pr(s)||(s=[s]);for(var c=0;c0&&Rin("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[xn]>0){c||(c=[]),l||(l=Yp(function(){l=null,f()},0));for(var A=0;A0?Pl(Ice(t[0],e),function(){nLt(x7(t,1),e,r)}):r(),n}a(nLt,"doUnloadAll");p();var Gin=500,iLt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function $in(t){return{mrg:!0,v:t}}a($in,"cfgDfMerge");p();p();var oLt=[hce,cQ,mce,aO],lHe=null,cHe;function TRo(t,e){return function(){var r=arguments,n=sLt(e);if(n){var o=n.listener;o&&o[t]&&o[t][nQ](o,r)}}}a(TRo,"_listenerProxyFunc");function IRo(){var t=Oi("Microsoft");return t&&(lHe=t.ApplicationInsights),lHe}a(IRo,"_getExtensionNamespace");function sLt(t){var e=lHe;return!e&&t.disableDbgExt!==!0&&(e=lHe||IRo()),e?e.ChromeDbgExt:null}a(sLt,"getDebugExt");function Vin(t){if(!cHe){cHe={};for(var e=0;e=A&&(d[T](S[sO]),n[w]=!0)}else o>=A&&d[T](S[sO]);f(A,S)}},d.debugToConsole=function(A){aLt("debug",A),g("warning",A)},d[lce]=function(A){aLt("warn",A),g("warning",A)},d.errorToConsole=function(A){aLt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[Vx]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var _=!0,E=RRo+y[fce];if(n[E]?_=!1:n[E]=!0,_&&(A<=s&&(d.queue[so](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",S=new wce(23,v,!1);d.queue[so](S),A===1?d.errorToConsole(v):d[lce](v)}}}a(f,"_logInternalMessage");function h(A){return M1(Zp(A,kRo,d).cfg,function(y){var _=y.cfg;o=_[Uje],s=_.loggingLevelTelemetry,c=_.maxMessageLimit,l=_.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var _=sLt(e||{});_&&_[UC]&&_[UC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function Yin(t){return t||new qY}a(Yin,"_getLogger");function La(t,e,r,n,o,s){s===void 0&&(s=!1),Yin(t)[k3](e,r,n,o,s)}a(La,"_throwInternal");function dO(t,e){Yin(t)[lce](e)}a(dO,"_warnToConsole");var cLt,pQ,Kin="toGMTString",Jin="toUTCString",dLt="cookie",lLt="expires",Zin="isCookieUseDisabled",hTe="disableCookiesUsage",Xin="_ckMgr",uHe=null,uLt=null,eon=null,fO,ton={},ron={},DRo=(cLt={cookieCfg:$in((pQ={},pQ[Vje]={fb:"cookieDomain",dfVal:lQ},pQ.path={fb:"cookiePath",dfVal:lQ},pQ.enabled=N1,pQ.ignoreCookies=N1,pQ.blockedCookies=N1,pQ.disableCookieDefer=!1,pQ)),cookieDomain:N1,cookiePath:N1},cLt[hTe]=N1,cLt);function fLt(){!fO&&(fO=Aqe(function(){return bf()}))}a(fLt,"_getDoc");function dHe(t){return t?t.isEnabled():!0}a(dHe,"_isMgrEnabled");function con(t,e){return e&&t&&pr(t.ignoreCookies)?Jo(t.ignoreCookies,e)!==-1:!1}a(con,"_isIgnoredCookie");function non(t,e){return e&&t&&pr(t.blockedCookies)&&Jo(t.blockedCookies,e)!==-1?!0:con(t,e)}a(non,"_isBlockedCookie");function ion(t,e){var r=e[oQ];if(Xt(r)){var n=void 0;Bn(t[Zin])||(n=!t[Zin]),Bn(t[hTe])||(n=!t[hTe]),r=n}return r}a(ion,"_isCfgEnabled");function pLt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(_){var E,v=(E={},E[Wje]=_||"/",E[lLt]="Thu, 01 Jan 1970 00:00:01 GMT",E);return UY()||(v["max-age"]="0"),son(Rs,v)}a(h,"_formatDeletionValue");function m(_,E,v,S){var T={},w=Li(_||Rs),R=vu(w,";");if(R!==-1&&(w=Li(qM(_,R)),T=lon(tp(_,R+1))),L3(T,Vje,v||o,y1,Bn),!Xt(E)){var x=UY();if(Bn(T[lLt])){var k=kl(),D=k+E*1e3;if(D>0){var N=new Date;N.setTime(D),L3(T,lLt,oon(N,x?Kin:Jin)||oon(N,x?Kin:Jin)||Rs,y1)}}x||L3(T,"max-age",Rs+E,null,Bn)}var O=vce();return O&&O.protocol==="https:"&&(L3(T,"secure",null,null,Bn),uLt===null&&(uLt=!uon((nd()||{})[J1e])),uLt&&L3(T,"SameSite","None",null,Bn)),L3(T,Wje,S||n,null,Bn),son(w,T)}a(m,"_formatSetCookieValue");function g(_){if(f)for(var E=f[xn]-1;E>=0;E--)f[E].n===_&&f[$x](E,1)}a(g,"_removePendingCookie");function A(){pTe(e)&&f&&(Ct(f,function(_){non(r,_.n)||(_.o===0?u(_.n,_.v):_.o===1&&d(_.n,_.v))}),f=[])}a(A,"_flushPendingCookies"),t=Zp(t||ron,null,e).cfg,s=M1(t,function(_){_.setDf(_.cfg,DRo),r=_.ref(_.cfg,"cookieCfg"),n=r[Wje]||"/",o=r[Vje],r.disableCookieDefer?f=null:f===null&&(f=[]);var E=c;c=ion(t,r)!==!1,l=r.getCookie||NRo,u=r.setCookie||aon,d=r.delCookie||aon,!E&&c&&f&&A()},e);var y={isEnabled:a(function(){var _=ion(t,r)!==!1&&c&&pTe(e),E=ron[Xin];return _&&E&&y!==E&&(_=dHe(E)),_},"isEnabled"),setEnabled:a(function(_){r[oQ]=_,Bn(t[hTe])||(t[hTe]=!_)},"setEnabled"),set:a(function(_,E,v,S,T){var w=!1,R=non(r,_);if(!R){var x=m(E,v,S,T);dHe(y)?(u(_,x),w=!0):f&&(g(_),f[so]({n:_,o:0,v:x}),w=!0)}return w},"set"),get:a(function(_){var E=Rs,v=con(r,_);if(!v){if(dHe(y))E=l(_);else if(f)for(var S=f[xn]-1;S>=0;S--){var T=f[S];if(T.n===_){if(T.o===0){var w=T.v,R=vu(w,";");E=R!==-1?Li(qM(w,R)):Li(w)}break}}}return E},"get"),del:a(function(_,E){var v=!1;return dHe(y)?v=y.purge(_,E):f&&(g(_),f[so]({n:_,o:1,v:h(E)}),v=!0),v},"del"),purge:a(function(_,E){var v=!1;return pTe(e)&&(d(_,h(E)),v=!0),v},"purge"),unload:a(function(_){s&&s.rm(),s=null,f=null},"unload")};return y[Xin]=y,y}a(pLt,"createCookieMgr");function pTe(t){if(uHe===null){uHe=!1,!fO&&fLt();try{var e=fO.v||{};uHe=e[dLt]!==void 0}catch(r){La(t,2,68,"Cannot access document.cookie - "+_ce(r),{exception:hr(r)})}}return uHe}a(pTe,"areCookiesSupported");function lon(t){var e={};if(t&&t[xn]){var r=Li(t)[N3](";");Ct(r,function(n){if(n=Li(n||Rs),n){var o=vu(n,"=");o===-1?e[n]=null:e[Li(qM(n,o))]=Li(tp(n,o+1))}})}return e}a(lon,"_extractParts");function oon(t,e){return qr(t[e])?t[e]():null}a(oon,"_formatDate");function son(t,e){var r=t||Rs;return Zr(e,function(n,o){r+="; "+n+(Xt(o)?Rs:"="+o)}),r}a(son,"_formatCookieValue");function NRo(t){var e=Rs;if(!fO&&fLt(),fO.v){var r=fO.v[dLt]||Rs;eon!==r&&(ton=lon(r),eon=r),e=Li(ton[t]||Rs)}return e}a(NRo,"_getCookieValue");function aon(t,e){!fO&&fLt(),fO.v&&(fO.v[dLt]=t+"="+e)}a(aon,"_setCookieValue");function uon(t){return vi(t)?!!(h0(t,"CPU iPhone OS 12")||h0(t,"iPad; CPU OS 12")||h0(t,"Macintosh; Intel Mac OS X 10_14")&&h0(t,"Version/")&&h0(t,"Safari")||h0(t,"Macintosh; Intel Mac OS X 10_14")&&f3(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||h0(t,"Chrome/5")||h0(t,"Chrome/6")||h0(t,"UnrealEngine")&&!h0(t,"Chrome")||h0(t,"UCBrowser/12")||h0(t,"UCBrowser/11")):!1}a(uon,"uaDisallowsSameSiteNone");p();var MRo={perfEvtsSendAll:!1};function ORo(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){ep(r.fn,[r.arg])})}a(ORo,"_runScheduledListeners");function hQ(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[so]({fn:n,arg:o}),r.h=r.h||Yp(ORo,0,r)):ep(n,[o]))})}a(hQ,"_runListeners");var hLt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Zp(e,MRo);n=c[rO](function(l){r=!!l.cfg.perfEvtsSendAll}),ki(t,this,function(l){$i(l,"listeners",{g:a(function(){return o},"g")}),l[dce]=function(u){o[so](u)},l[uce]=function(u){for(var d=Jo(o,u);d>-1;)o[$x](d,1),d=Jo(o,u)},l[hce]=function(u){hQ(o,hce,s,function(d){d[hce](u)})},l[cQ]=function(u,d){hQ(o,cQ,s,function(f){f[cQ](u,d)})},l[mce]=function(u,d){hQ(o,mce,d?s:null,function(f){f[mce](u,d)})},l[aO]=function(u){u&&(r||!u[Z1e]())&&hQ(o,aO,null,function(d){u.isAsync?Yp(function(){return d[aO](u)},0):d[aO](u)})},l[Hje]=function(u){u&&u[xn]&&hQ(o,Hje,s,function(d){d[Hje](u)})},l[Gje]=function(u){u&&u[D1]&&hQ(o,Gje,s,function(d){d[Gje](u)})},l[$je]=function(u,d){if(u>0){var f=d||0;hQ(o,$je,s,function(h){h[$je](u,f)})}},l[Vx]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[nO](),s.h=null,s.cb=[]},"_finishUnload"),f;if(hQ(o,"unload",null,function(h){var m=h[Vx](u);m&&(f||(f=[]),f[so](m))}),f)return Vd(function(h){return Pl(Uqe(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var kce="ctx",gLt="ParentContextKey",mTe="ChildrenContextKey",LRo=null,Pce=(function(){function t(e,r,n){var o=this;if(o.start=kl(),o[MP]=e,o.isAsync=n,o[Z1e]=function(){return!1},qr(r)){var s;$i(o,"payload",{g:a(function(){return!s&&qr(r)&&(s=r(),r=null),s},"g")})}o[MY]=function(c){return c?c===t[gLt]||c===t[mTe]?o[c]:(o[kce]||{})[c]:null},o[BP]=function(c,l){if(c)if(c===t[gLt])o[c]||(o[Z1e]=function(){return!0}),o[c]=l;else if(c===t[mTe])o[c]=l;else{var u=o[kce]=o[kce]||{};u[c]=l}},o.complete=function(){var c=0,l=o[MY](t[mTe]);if(pr(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(_){La(r[od],2,73,"Unexpected Exception during onComplete - "+hr(_))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,_=e.cfg;if(_&&g){var E=_[O3];!E&&A&&(E={}),_[O3]=E,E=e.ref(_,O3),E&&(y=E[g],!y&&A&&(y={}),E[g]=y,y=e.ref(E,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&Zr(A,function(_,E){if(Xt(y[_])){var v=e.cfg[_];(v||!Xt(v))&&(y[_]=v)}cTe(e,y,_,E)}),e.setDf(y,A)}a(f,"_resolveExtCfg");function h(g,A,y){y===void 0&&(y=!1);var _,E=d(g,!1),v=e.cfg;return E&&(E[A]||!Xt(E[A]))?_=E[A]:(v[A]||!Xt(v[A]))&&(_=v[A]),_||!Xt(_)?_:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[iQ]();y&&g(y)}}return a(m,"_iterateChain"),c}a(vLt,"_createInternalContext");function zx(t,e,r,n){var o=Zp(e),s=vLt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[QC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),pr(d)&&(d=mQ(d,o.cfg,r,f)),zx(d||c[P1](),o.cfg,r,f)}return a(u,"_createNew"),c[fg]=l,c[oO]=u,c}a(zx,"createProcessTelemetryContext");function Dce(t,e,r){var n=Zp(e.config),o=vLt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[Vx](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),pr(u)&&(u=mQ(u,n.cfg,e,d)),Dce(u||s[P1](),e,d)}return a(l,"_createNew"),s[fg]=c,s[oO]=l,s}a(Dce,"createProcessTelemetryUnloadContext");function gTe(t,e,r){var n=Zp(e.config),o=vLt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){qr(d[NY])&&d[NY](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),pr(u)&&(u=mQ(u,n.cfg,e,d)),gTe(u||s[P1](),e,d)}return a(l,"_createNew"),s[fg]=c,s[oO]=l,s}a(gTe,"createProcessTelemetryUpdateContext");function mQ(t,e,r,n){var o=null,s=!n;if(pr(t)&&t[xn]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&qr(l[QC])){var u=jRo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?mQ([n],e,r):o}a(mQ,"createTelemetryProxyChain");function jRo(t,e,r){var n=null,o=qr(t[QC]),s=qr(t[aQ]),c;t?c=t[iO]+"-"+t[FY]+"-"+mon++:c="Unknown-0-"+mon++;var l={getPlugin:a(function(){return t},"getPlugin"),getNext:a(function(){return n},"getNext"),processTelemetry:f,unload:h,update:m,_id:c,_setNext:a(function(g){n=g},"_setNext")};function u(){var g;return t&&qr(t[hon])&&(g=t[hon]()),g||(g=zx(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,_,E){var v=!1,S=t?t[iO]:QRo,T=g[pon];return T||(T=g[pon]={}),g.setNext(n),t&&Xp(g[np](),function(){return S+":"+y},function(){T[c]=!0;try{var w=n?n._id:Rs;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&La(g[UC](),1,73,"Plugin ["+S+"] failed during "+y+" - "+hr(x)+", run flags: "+hr(T))}},_,E),v}a(d,"_processChain");function f(g,A){A=A||u();function y(_){if(!t||!o)return!1;var E=B3(t);return E[k1]||E[eTe]?!1:(s&&t[aQ](n),t[QC](g,_),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[fg](g)}a(f,"_processTelemetry");function h(g,A){function y(){var _=!1;if(t){var E=B3(t),v=t[np]||E[np];t&&(!v||v===g.core())&&!E[k1]&&(E[np]=null,E[k1]=!0,E[FC]=!1,t[k1]&&t[k1](g,A)===!0&&(_=!0))}return _}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[fg](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var _=!1;if(t){var E=B3(t),v=t[np]||E[np];t&&(!v||v===g.core())&&!E[k1]&&t[NY]&&t[NY](g,A)===!0&&(_=!0)}return _}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[fg](A)}return a(m,"_updatePlugin"),Yh(l)}a(jRo,"createTelemetryPluginProxy");var gon=(function(){function t(e,r,n,o){var s=this,c=zx(e,r,n,o);dQ(s,c,rd(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function ATe(){var t=[];function e(n){n&&t[so](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){La(n[UC](),2,73,"Unexpected error calling unload handler - "+hr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(ATe,"createUnloadHandlerContainer");p();var hHe,mHe;function gHe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){La(n,2,73,"Unloading:"+hr(c))}}),hHe&&o[xn]>hHe&&(mHe?mHe("doUnload",o):La(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Kh(t,n),hHe&&t[xn]>hHe&&(mHe?mHe("Add",t):La(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected.")))}return a(r,"_addHook"),{run:e,add:r}}a(gHe,"createUnloadHookContainer");var CLt,gQ="getPlugin",HRo=(CLt={},CLt[O3]={isVal:lQ,v:{}},CLt),Nce=(function(){function t(){var e=this,r,n,o,s,c;d(),ki(t,e,function(f){f[P3]=function(h,m,g,A){u(h,m,A),r=!0},f[k1]=function(h,m){var g=f[np];if(!g||h&&g!==h[np]())return;var A,y=!1,_=h||Dce(null,g,o&&o[gQ]?o[gQ]():o),E=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(_,m),c.run(_[UC]()),A===!0&&_[fg](E),d())}return a(v,"_unloadCallback"),!f[sQ]||f[sQ](_,E,v)!==!0?v():A=!0,A},f[NY]=function(h,m){var g=f[np];if(!g||h&&g!==h[np]())return;var A,y=!1,_=h||gTe(null,g,o&&o[gQ]?o[gQ]():o),E=m||{reason:0};function v(){y||(y=!0,u(_.getCfg(),_.core(),_[P1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(_,E,v)!==!0?v():A=!0,A},uQ(f,"_addUnloadCb",function(){return s},"add"),uQ(f,"_addHook",function(){return c},"add"),$i(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[UC]=function(f){return l(f)[UC]()},e[FC]=function(){return r},e.setInitialized=function(f){r=f},e[aQ]=function(f){o=f},e[fg]=function(f,h){h?h[fg](f):o&&qr(o[QC])&&o[QC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||zx(null,{},e[np]);o&&o[gQ]?h=m[oO](null,o[gQ]):h=m[oO](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Zp(f,HRo,Rce(h)),!m&&h&&(m=h[Bje]()[P1]());var g=o;o&&o[gQ]&&(g=o[gQ]()),e[np]=h,n=zx(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[np]=null,n=null,o=null,c=gHe(),s=ATe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function GRo(t,e,r){var n={id:e,fn:r};Kh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[$x](c,1),-1})},"remove")};return o}a(GRo,"_addInitializer");function $Ro(t,e,r){for(var n=!1,o=t[xn],s=0;s"},"v")})}a(tko,"_createUnloadHook");var AHe=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_,E,v,S,T,w,R,x,k,D,N,O,B,q,M,L,U,j;ki(t,this,function(Q){re(),Q._getDbgPlgTargets=function(){return[x,o]},Q[FC]=function(){return r},Q.activeStatus=function(){return N},Q._setPendingStatus=function(){N=3},Q[P3]=function(ne,ue,Ne,xe){g&&ul(yon),Q[FC]()&&ul("Core cannot be initialized more than once"),e=Zp(ne,bLt,Ne||Q[od],!1),ne=e.cfg,Be(e[rO](function(st){var vt=st.cfg;B=vt.initInMemoMaxSize||zRo,Y(vt);var Pt=st.ref(st.cfg,O3);Zr(Pt,function(Ht){st.ref(Pt,Ht)})})),s=xe,S=eko(e,v,s&&Q[Y1e](),S),K(),Q[od]=Ne;var Fe=ne[BY];if(f=[],f[so].apply(f,Xz(Xz([],ue,!1),Fe,!1)),h=ne[LY],Le(null),(!m||m[xn]===0)&&ul("No "+LY+" available"),h&&h[xn]>1){var tt=Q[iQ]("TeeChannelController");(!tt||!tt.plugin)&&La(n,1,28,"TeeChannel required")}XRo(ne,R,n),R=null,r=!0,N===rQ.ACTIVE&&z()},Q.getChannels=function(){var ne=[];return m&&Ct(m,function(ue){ne[so](ue)}),Yh(ne)},Q.track=function(ne){Xp(Q[gce](),function(){return"AppInsightsCore:track"},function(){ne===null&&(de(ne),ul("Invalid telemetry item")),!ne[MP]&&Xt(ne[MP])&&(de(ne),ul("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||yce(new Date),ne.ver=ne.ver||"4.0",!g&&Q[FC]()&&N===rQ.ACTIVE?le()[fg](ne):N!==rQ.INACTIVE&&o[xn]<=B&&o[so](ne)},function(){return{item:ne}},!ne.sync)},Q[Bje]=le,Q[Y1e]=function(){return s||(s=new hLt(e.cfg),Q[VRo]=s),s},Q[dce]=function(ne){Q.getNotifyMgr()[dce](ne)},Q[uce]=function(ne){s&&s[uce](ne)},Q.getCookieMgr=function(){return u||(u=pLt(e.cfg,Q[od])),u},Q.setCookieMgr=function(ne){u!==ne&&(Ice(u,!1),u=ne)},Q[gce]=function(){return c||l||ALt()},Q.setPerfMgr=function(ne){c=ne},Q.eventCnt=function(){return o[xn]},Q.releaseQueue=function(){if(r&&o[xn]>0){var ne=o;o=[],N===2?Ct(ne,function(ue){ue.iKey=ue.iKey||w,le()[fg](ue)}):La(n,2,20,"core init status is not active")}},Q.pollInternalLogs=function(ne){return y=ne||null,j=!1,L&&L[nO](),ie(!0)};function Y(ne){var ue=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Xt(ue)){w=null,N=rQ.INACTIVE;var xe="Please provide instrumentation key";r?(La(n,1,100,xe),z()):ul(xe);return}var Fe=[];d0(ue)?(Fe[so](ue),w=null):w=ue,d0(Ne)?(Fe[so](Ne),O=null):O=Ne,Fe[xn]?W(ne,Fe):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ue){q=!1,N=3;var Ne=lQ(ne.initTimeOut)?ne.initTimeOut:YRo,xe=Fqe(ue);M&&M[nO](),M=Yp(function(){M=null,q||V()},Ne),Pl(xe,function(Fe){try{if(q)return;if(!Fe.rejected){var tt=Fe[D3];if(tt&&tt[xn]){var st=tt[0];if(w=st&&st[D3],tt[xn]>1){var vt=tt[1];O=vt&&vt[D3]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=O)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=rQ.INACTIVE,La(n,1,112,"ikey can't be resolved from promises")):N=rQ.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(Q.releaseQueue(),Q.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!L||!L[oQ])&&!j){var ue=ne||n&&n.queue[xn]>0;ue&&(U||(U=!0,Be(e[rO](function(Ne){var xe=Ne.cfg.diagnosticLogInterval;(!xe||!(xe>0))&&(xe=1e4);var Fe=!1;L&&(Fe=L[oQ],L[nO]()),L=vqe(te,xe),L.unref(),L[oQ]=Fe}))),L[oQ]=!0)}return L}a(ie,"_startLogPoller"),Q[q4t]=function(){j=!0,L&&L[nO](),te()},dQ(Q,function(){return A},["addTelemetryInitializer"]),Q[Vx]=function(ne,ue,Ne){ne===void 0&&(ne=!0),r||ul(WRo),g&&ul(yon);var xe={reason:50,isAsync:ne,flushComplete:!1},Fe;ne&&!ue&&(Fe=Vd(function(vt){ue=vt}));var tt=Dce(Oe(),Q);tt[K1e](function(){v.run(Q[od]),nLt([u,s,n],ne,function(){re(),ue&&ue(xe)})},Q);function st(vt){xe.flushComplete=vt,g=!0,E.run(tt,xe),Q[q4t](),tt[fg](xe)}return a(st,"_doUnload"),te(),ee(ne,st,6,Ne)||st(!1),Fe},Q[iQ]=me,Q.addPlugin=function(ne,ue,Ne,xe){if(!ne){xe&&xe(!1),X(von);return}var Fe=me(ne[iO]);if(Fe&&!ue){xe&&xe(!1),X("Plugin ["+ne[iO]+"] is already loaded!");return}var tt={reason:16};function st(Ht){f[so](ne),tt.added=[ne],Le(tt),xe&&xe(!0)}if(a(st,"_addPlugin"),Fe){var vt=[Fe.plugin],Pt={reason:2,isAsync:!!Ne};Te(vt,Pt,function(Ht){Ht?(tt.removed=vt,tt.reason|=32,st(!0)):xe&&xe(!1)})}else st(!1)},Q.updateCfg=function(ne,ue){ue===void 0&&(ue=!0);var Ne;if(Q[FC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Tae({},e.cfg),newConfig:Tae({},ne),merge:ue},ne=Ne.newConfig;var xe=e.cfg;ne[BY]=xe[BY],ne[LY]=xe[LY]}e._block(function(Fe){var tt=Fe.cfg;SLt(Fe,tt,ne,ue),ue||Zr(tt,function(st){kA(ne,st)||Fe.set(tt,st,N1)}),Fe.setDf(tt,bLt)},!0),e.notify(),Ne&&he(Ne)},Q.evtNamespace=function(){return _},Q.flush=ee,Q.getTraceCtx=function(ne){return T||(T=fon()),T},Q.setTraceCtx=function(ne){T=ne||null},Q.addUnloadHook=Be,uQ(Q,"addUnloadCb",function(){return E},"add"),Q.onCfgChange=function(ne){var ue;return r?ue=M1(e.cfg,ne,Q[od]):ue=ZRo(R,ne),tko(ue)},Q.getWParam=function(){return u3()||e.cfg.enableWParam?0:-1};function H(){var ne={};k=[];var ue=a(function(Ne){Ne&&Ct(Ne,function(xe){if(xe[iO]&&xe[Fje]&&!ne[xe.identifier]){var Fe=xe[iO]+"="+xe[Fje];k[so](Fe),ne[xe.identifier]=xe}})},"_addPluginVersions");ue(m),h&&Ct(h,function(Ne){ue(Ne)}),ue(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Zp({},bLt,Q[od]),e.cfg[Uje]=1,$i(Q,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ue){Q.updateCfg(ue,!1)},"s")}),$i(Q,"pluginVersionStringArr",{g:a(function(){return k||H(),k},"g")}),$i(Q,"pluginVersionString",{g:a(function(){return D||(k||H(),D=k.join(";")),D||Rs},"g")}),$i(Q,"logger",{g:a(function(){return n||(n=new qY(e.cfg),e[od]=n),n},"g"),s:a(function(ue){e[od]=ue,n!==ue&&(Ice(n,!1),n=ue)},"s")}),Q[od]=new qY(e.cfg),x=[];var ne=Q.config[BY]||[];ne.splice(0,ne[xn]),Kh(ne,x),A=new Aon,o=[],Ice(s,!1),s=null,c=null,l=null,Ice(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,_=Wx("AIBaseCore",!0),E=ATe(),T=null,w=null,v=gHe(),R=[],D=null,k=null,j=!1,L=null,U=!1,N=0,O=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=zx(Oe(),e.cfg,Q);return ne[K1e](ie),ne}a(le,"_createTelCtx");function Le(ne){var ue=JRo(Q[od],Gin,f);d=null,D=null,k=null,m=(h||[])[0]||[],m=pHe(Kh(m,ue[LY]));var Ne=Kh(pHe(ue[np]),m);x=Yh(Ne);var xe=Q.config[BY]||[];xe.splice(0,xe[xn]),Kh(xe,x);var Fe=le();m&&m[xn]>0&&ELt(Fe[oO](m),Ne),ELt(Fe,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function me(ne){var ue=null,Ne=null,xe=[];return Ct(x,function(Fe){if(Fe[iO]===ne&&Fe!==A)return Ne=Fe,-1;Fe.getChannel&&xe[so](Fe)}),!Ne&&xe[xn]>0&&Ct(xe,function(Fe){if(Ne=Fe.getChannel(ne),!Ne)return-1}),Ne&&(ue={plugin:Ne,setEnabled:a(function(Fe){B3(Ne)[eTe]=!Fe},"setEnabled"),isEnabled:a(function(){var Fe=B3(Ne);return!Fe[k1]&&!Fe[eTe]},"isEnabled"),remove:a(function(Fe,tt){Fe===void 0&&(Fe=!0);var st=[Ne],vt={reason:1,isAsync:Fe};Te(st,vt,function(Pt){Pt&&Le({reason:32,removed:st}),tt&&tt(Pt)})},"remove")}),ue}a(me,"_getPlugin");function Oe(){if(!d){var ne=(x||[]).slice();Jo(ne,A)===-1&&ne[so](A),d=mQ(pHe(ne),e.cfg,Q)}return d}a(Oe,"_getPluginChain");function Te(ne,ue,Ne){if(ne&&ne[xn]>0){var xe=mQ(ne,e.cfg,Q),Fe=Dce(xe,Q);Fe[K1e](function(){var tt=!1,st=[];Ct(f,function(Pt,Ht){_on(Pt,ne)?tt=!0:st[so](Pt)}),f=st,D=null,k=null;var vt=[];h&&(Ct(h,function(Pt,Ht){var F=[];Ct(Pt,function(se){_on(se,ne)?tt=!0:F[so](se)}),vt[so](F)}),h=vt),Ne&&Ne(tt),ie()}),Fe[fg](ue)}else Ne(!1)}a(Te,"_removePlugins");function te(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[xn]=0,Ct(ne,function(ue){var Ne={name:y||"InternalMessageId: "+ue[fce],iKey:w,time:yce(new Date),baseType:wce.dataType,baseData:{message:ue[sO]}};Q.track(Ne)})}}a(te,"_flushInternalLogs");function ee(ne,ue,Ne,xe){var Fe=1,tt=!1,st=null;xe=xe||5e3;function vt(){Fe--,tt&&Fe===0&&(st&&st[nO](),st=null,ue&&ue(tt),ue=null)}if(a(vt,"doCallback"),m&&m[xn]>0){var Pt=le()[oO](m);Pt.iterate(function(Ht){if(Ht.flush){Fe++;var F=!1;Ht.flush(ne,function(){F=!0,vt()},Ne)||F||(ne&&st==null?st=Yp(function(){st=null,vt()},xe):vt())}})}return tt=!0,vt(),!0}a(ee,"_flushChannels");function K(){var ne;Be(e[rO](function(ue){var Ne=ue.cfg.enablePerfMgr;if(Ne){var xe=ue.cfg[jje];(ne!==xe||!ne)&&(xe||(xe=KRo),zje(ue.cfg,jje,xe),ne=xe,l=null),!c&&!l&&qr(xe)&&(l=xe(Q,Q[Y1e]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ue=gTe(Oe(),Q);ue[K1e](ie),(!Q._updateHook||Q._updateHook(ue,ne)!==!0)&&ue[fg](ne)}a(he,"_doUpdate");function X(ne){var ue=Q[od];ue?(La(ue,2,73,ne),ie()):ul(ne)}a(X,"_logOrThrowError");function de(ne){var ue=Q[Y1e]();ue&&ue[cQ]([ne],2)}a(de,"_notifyInvalidEvent");function Be(ne){v.add(ne)}a(Be,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var FP="",rko="NoResponseBody",Con="&"+rko+"=true",TLt="POST",yHe=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;ki(t,this,function(_,E){var v=!0;q(),_[P3]=function(M,L){o=L,n&&La(o,1,28,"Sender is already initialized"),_.SetConfig(M),n=!0},_._getDbgPlgTargets=function(){return[n,s,l,r]},_.SetConfig=function(M){try{if(c=M.senderOnCompleteCallBack||{},l=!!M.disableCredentials,u=M.fetchCredentials,s=!!M.isOneDs,r=!!M.enableSendPromise,f=!!M.disableXhr,h=!!M.disableBeacon,m=!!M.disableBeaconSync,y=M.timeWrapper,A=!!M.addNoResponse,g=!!M.disableFetchKeepAlive,d={sendPOST:N},s||(v=!1),l){var L=vce();L&&L.protocol&&L.protocol[DY]()==="file:"&&(v=!1)}return!0}catch{}return!1},_.getSyncFetchPayload=function(){return e},_.getSenderInst=function(M,L){return M&&M[xn]?R(M,L):null},_.getFallbackInst=function(){return d},_[sQ]=function(M,L){q()},_.preparePayload=function(M,L,U,j){if(!L||j||!U[D1]){M(U);return}try{var Q=Oi("CompressionStream");if(!qr(Q)){M(U);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(vi(U[D1])?new TextEncoder().encode(U[D1]):U[D1]),re.close()},"start")}),W=Y.pipeThrough(new Q("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return Pl(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[D3];if(!Le.done)return z[so](Le[D3]),ie+=Le.value[xn],Pl(V.read(),re);for(var me=new Uint8Array(ie),Oe=0,Te=0,te=z;Te0&&(Ct(rd(me),function(K){H.append(K,me[K])}),Oe[X1e]=H),u?Oe.credentials=u:v&&s&&(Oe.credentials="include"),U&&(Oe.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(Q+=Con)):le=!0);var Te=new Request(Q,Oe);try{Te[iLt]=!0}catch{}if(!U&&r&&(V=Vd(function(K,he){z=K,ie=he})),!Q){w(L),z&&z(!1);return}function te(K,he){he?x(L,s?0:he,{},s?FP:K):x(L,s?0:400,{},s?FP:K)}a(te,"_handleError");function ee(K,he,X){var de=K[LP],Be=c.fetchOnComplete;Be&&qr(Be)?Be(K,L,X||FP,he):x(L,de,{},X||FP)}a(ee,"_onFetchComplete");try{Pl(fetch(s?Q:Te,s?Oe:null),function(K){if(U&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)te(K.reason&&K.reason[sO],499),ie&&ie(K.reason);else{var he=K[D3];try{!s&&!he.ok?(he[LP]?te(he.statusText,he[LP]):te(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,FP),z&&z(!0)):Pl(he.text(),function(X){ee(he,M,X[D3]),z&&z(!0)})}catch(X){he&&he[LP]?te(hr(X),he[LP]):te(hr(X),499),ie&&ie(X)}}})}catch(K){Le||(te(hr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(L,200,{}),z&&z(!0)),s&&!Le&&M[OY]>0&&y&&y.set(function(){Le||(Le=!0,x(L,500,{}),z&&z(!0))},M[OY]),V}a(O,"_doFetchSender");function B(M,L,U){var j=Sf(),Q=new XDomainRequest,Y=M[D1];Q.onload=function(){var H=lO(Q),re=c&&c.xdrOnComplete;re&&qr(re)?re(Q,L,M):x(L,200,{},H)},Q.onerror=function(){x(L,400,{},s?FP:Kje(Q))},Q.ontimeout=function(){x(L,500,{})},Q.onprogress=function(){};var W=j&&j.location&&j.location.protocol||"",V=M[pce];if(!V){w(L);return}if(!s&&V.lastIndexOf(W,0)!==0){var z="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";La(o,2,40,". "+z),T(z,L);return}var ie=s?V:V[OP](/^(https?:)/,"");Q.open(TLt,ie),M[OY]&&(Q[OY]=M[OY]),Q.send(Y),s&&U?y&&y.set(function(){Q.send(Y)},0):Q.send(Y)}a(B,"_xdrSender");function q(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(q,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var Ron="on",bon="attachEvent",Son="addEventListener",Ton="detachEvent",Ion="removeEventListener",ILt="events",ETe="visibilitychange",EHe="pagehide",kon="pageshow",Pon="unload",Don="beforeunload",Non=Wx("aiEvtPageHide"),Mon=Wx("aiEvtPageShow"),nko=/\.[\.]+/g,iko=/[\.]+$/,oko=1,_He=rHe("events"),sko=/^([^.]*)(?:\.(.+)|)/;function xon(t){return t&&t[OP]?t[OP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Rs):t}a(xon,"_normalizeNamespace");function xLt(t,e){if(e){var r=Rs;pr(e)?(r=Rs,Ct(e,function(o){o=xon(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=xon(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Rs)+r)}var n=sko.exec(t||Rs)||[];return{type:n[1],ns:(n[2]||Rs).replace(nko,".").replace(iko,Rs)[N3](".").sort().join(".")}}a(xLt,"_getEvtNamespace");function Oon(t,e,r){r===void 0&&(r=!0);var n=_He.get(t,ILt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(Oon,"_getRegisteredEvents");function Lon(t,e,r,n){t&&e&&e[M3]&&(t[Ion]?t[Ion](e[M3],r,n):t[Ton]&&t[Ton](Ron+e[M3],r))}a(Lon,"_doDetach");function ako(t,e,r,n){var o=!1;return t&&e&&e[M3]&&r&&(t[Son]?(t[Son](e[M3],r,n),o=!0):t[bon]&&(t[bon](Ron+e[M3],r),o=!0)),o}a(ako,"_doAttach");function won(t,e,r,n){for(var o=e[xn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[H4t].ns)&&(!n||n(s))&&(Lon(t,s[H4t],s.handler,s.capture),e[$x](o,1))}}a(won,"_doUnregister");function cko(t,e,r){if(e[M3])won(t,Oon(t,e[M3]),e,r);else{var n=_He.get(t,ILt,{});Zr(n,function(o,s){won(t,s,e,r)}),rd(n)[xn]===0&&_He.kill(t,ILt)}}a(cko,"_unregisterEvents");function yQ(t,e){var r;return e?(pr(e)?r=[t].concat(e):r=[t,e],r=xLt("xx",r).ns[N3](".")):r=t,r}a(yQ,"mergeEvtNamespace");function yTe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=xLt(e,n);if(s=ako(t,c,r,o),s&&_He.accept(t)){var l={guid:oko++,evtName:c,handler:r,capture:o};Oon(t,c.type)[so](l)}}catch{}return s}a(yTe,"eventOn");function _Te(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=xLt(e,n),c=!1;cko(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||Lon(t,s,r,o)}catch{}}a(_Te,"eventOff");function wLt(t,e,r){var n=!1,o=Sf();o&&(n=yTe(o,t,e,r),n=yTe(o.body,t,e,r)||n);var s=bf();return s&&(n=yTe(s,t,e,r)||n),n}a(wLt,"addEventHandler");function RLt(t,e,r){var n=Sf();n&&(_Te(n,t,e,r),_Te(n.body,t,e,r));var o=bf();o&&_Te(o,t,e,r)}a(RLt,"removeEventHandler");function Mce(t,e,r,n){var o=!1;return e&&t&&t[xn]>0&&Ct(t,function(s){s&&(!r||Jo(r,s)===-1)&&(o=wLt(s,e,n)||o)}),o}a(Mce,"_addEventListeners");function kLt(t,e,r,n){var o=!1;return e&&t&&pr(t)&&(o=Mce(t,e,r,n),!o&&r&&r[xn]>0&&(o=Mce(t,e,null,n))),o}a(kLt,"addEventListeners");function jY(t,e,r){t&&pr(t)&&Ct(t,function(n){n&&RLt(n,e,r)})}a(jY,"removeEventListeners");function vHe(t,e,r){return kLt([Don,Pon,EHe],t,e,r)}a(vHe,"addPageUnloadEventListener");function CHe(t,e){jY([Don,Pon,EHe],t,e)}a(CHe,"removePageUnloadEventListener");function vTe(t,e,r){function n(c){var l=bf();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=yQ(Non,r),s=Mce([EHe],t,e,o);return(!e||Jo(e,ETe)===-1)&&(s=Mce([ETe],n,e,o)||s),!s&&e&&(s=vTe(t,null,r)),s}a(vTe,"addPageHideEventListener");function bHe(t,e){var r=yQ(Non,e);jY([EHe],t,r),jY([ETe],null,r)}a(bHe,"removePageHideEventListener");function CTe(t,e,r){function n(c){var l=bf();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=yQ(Mon,r),s=Mce([kon],t,e,o);return s=Mce([ETe],n,e,o)||s,!s&&e&&(s=CTe(t,null,r)),s}a(CTe,"addPageShowEventListener");function SHe(t,e){var r=yQ(Mon,e);jY([kon],t,r),jY([ETe],null,r)}a(SHe,"removePageShowEventListener");p();var Oce="",Bon="https://browser.events.data.microsoft.com/OneCollector/1.0/",PLt="version",THe="properties";p();p();var DLt="initialize",NLt="indexOf",pO="timings",MLt="pollInternalLogs",O1="value",IHe="length",xHe="processTelemetryStart";var F3,Fon="4.3.10",bTe="1DS-Web-JS-"+Fon,Uon=i1e.hasOwnProperty;var yko=(F3={},F3[0]=0,F3[2]=6,F3[1]=1,F3[3]=7,F3[4098]=6,F3[4097]=1,F3[4099]=7,F3);var _ko=u3(),Eko=Sae();function Yx(t){return!(t===Oce||Xt(t))}a(Yx,"isValueAssigned");function OLt(t){if(t){var e=vu(t,"-");if(e>-1)return qM(t,e)}return Oce}a(OLt,"getTenantId");function LLt(t){return!!(t&&zh(t)&&t>=1&&t<=4)}a(LLt,"isLatency");function BLt(t,e,r){if(!e&&!Yx(e)||typeof t!="string")return null;var n=typeof e;if(n==="string"||n==="number"||n==="boolean"||pr(e))e={value:e};else if(n==="object"&&!Uon.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Xt(e[O1])||e[O1]===Oce||!vi(e[O1])&&!zh(e[O1])&&!bP(e[O1])&&!pr(e[O1]))return null;if(pr(e[O1])&&!qon(e[O1]))return null;if(!Xt(e.kind)){if(pr(e[O1])||!Qon(e.kind))return null;e[O1]=e[O1].toString()}return e}a(BLt,"sanitizeProperty");function STe(t,e,r){var n=-1;if(!Bn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),vko(r))n===-1&&(n=0),n|=r;else{var o=yko[wHe(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(STe,"getCommonSchemaMetaData");function Lce(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[IHe],d=arguments;for(bP(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(Qon,"isValueKind");function vko(t){return t>=0&&t<=9}a(vko,"isDataType");function qon(t){return t[IHe]>0}a(qon,"isArrayValid");function RHe(t,e){var r=t;r[pO]=r[pO]||{},r[pO][xHe]=r[pO][xHe]||{},r[pO][xHe][e]=L1()}a(RHe,"setProcessTelemetryTimings");function wHe(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===Fx&&(e=4,pr(t)?(e=4096,t[IHe]>0&&(e|=wHe(t[0]))):Uon.call(t,"value")&&(e=8192|wHe(t[O1])))}return e}a(wHe,"getFieldValueType");function FLt(){return!!Oi("chrome")}a(FLt,"isChromium");function HY(t){return t>0}a(HY,"isGreaterThanZero");var Cko=qE({endpointUrl:Bon,propertyStorageOverride:{isVal:bko}});function bko(t){return t&&(!t.getProperty||!t.setProperty)&&ul("Invalid property storage override passed."),!0}a(bko,"_chkPropOverride");var ULt=(function(t){l_(e,t);function e(){var r=t.call(this)||this;return ki(e,r,function(n,o){n[DLt]=function(s,c,l,u){Xp(n,function(){return"AppInsightsCore.initialize"},function(){try{o[DLt](Zp(s,Cko,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=hr(h);f[NLt]("channels")!==-1&&(f+=` + - Channels must be provided through config.channels only!`),La(d,1,514,"SDK Initialization Failed - no telemetry will be sent: "+f)}},function(){return{config:s,extensions:c,logger:l,notificationManager:u}})},n.track=function(s){Xp(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[pO]=c[pO]||{},c[pO].trackStart=L1(),LLt(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=bTe;var u=c.baseData=c.baseData||{};u[THe]=u[THe]||{};var d=u[THe];d[PLt]=d[PLt]||n.pluginVersionString||Oce}o.track(c)},function(){return{item:s}},!s.sync)},n[MLt]=function(s){return o[MLt](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(AHe);p();p();var TTe="REAL_TIME",jon="NEAR_REAL_TIME",Hon="BEST_EFFORT";p();p();p();var UP="";var kHe="drop",Gon="send",QLt="requeue",$on="rspFail",Von="oth",qLt="no-cache, no-store",PHe="application/x-json-stream",ITe="cache-control",Bce="content-type",Won="kill-tokens",zon="kill-duration";var Yon="time-delta-millis",DHe="client-version",jLt="client-id",NHe="time-delta-to-apply-millis",MHe="upload-time",OHe="apikey",xTe="AuthMsaDeviceTicket",HLt="WebAuthToken",GLt="AuthXToken";var Kon="NoResponseBody",Fce="msfpc",$Lt="trace",LHe="user";p();var wTe="allowRequestSending",BHe="shouldAddClockSkewHeaders",FHe="getClockSkewHeaderValue",RTe="setClockSkew",Zo="length",hO="concat",B1="iKey",ip="count",mO="events",pg="push",gO="split",UHe="toLowerCase",GY="hdrs",QHe="useHdrs",$Y="initialize",qHe="setTimeoutOverride",jHe="clearTimeoutOverride",Jon="payloadPreprocessor",VLt="overrideEndpointUrl",WLt="avoidOptions",Zon="disableEventTimings",HHe="enableCompoundKey",zLt="disableXhrSync",YLt="disableFetchKeepAlive",Xon="addNoResponse",KLt="useSendBeacon",JLt="fetchCredentials",ZLt="alwaysUseXhrOverride",GHe="serializeOfflineEvt",$He="getOfflineRequestDetails",VHe="createPayload",kTe="createOneDSPayload",XLt="payloadBlob",QP="headers",Uce="_thePayload",p_="batches",qC="sendType",PTe="canSendRequest",Qce="sendQueuedRequests",DTe="setUnloading",esn="isTenantKilled",WHe="sendSynchronousBatch",zHe="_transport",qce="getWParam",eBt="isBeacon",NTe="timings",YHe="isTeardown",KHe="_sendReason",JHe="setKillSwitchTenants",ZHe="_backOffTransmission",MTe="identifier",tsn="ignoreMc1Ms0CookieProcessing",tBt="autoFlushEventsLimit",rsn="disableAutoBatchFlushLimit",nsn="overrideInstrumentationKey",OTe="sendAttempt",_Q="latency",VY="sync";function osn(t){var e=(t.ext||{}).intweb;return e&&Yx(e[Fce])?e[Fce]:null}a(osn,"_getEventMsfpc");function isn(t){for(var e=null,r=0;e===null&&rkl()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var Tko=.8,Iko=1.2,csn=3e3,xko=6e5;function lsn(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a(lsn,"retryPolicyShouldRetryForStatus");function XHe(t){var e=0,r=csn*Tko,n=csn*Iko,o=E1(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,S7(e,xko)}a(XHe,"retryPolicyGetMillisToBackoffForRetry");p();var wko=20,Rko=3145728,dsn=65e3,fsn=2e6,kko=S7(fsn,dsn),usn="metadata",eGe="f",Pko=/\./,psn=(function(){function t(e,r,n,o,s,c,l){var u="data",d="baseData",f="ext",h=!!o,m=!0,g=r,A={},y=!!c,_=s||STe,E=Dko(l),v=tGe(E.requestLimit,Rko,0),S=tGe(E.requestLimit,dsn,1),T=tGe(E.recordLimit,fsn,0),w=Math.min(tGe(E.recordLimit,kko,1),S);ki(t,this,function(R){R.createPayload=function(D,N,O,B,q,M){return{apiKeys:[],payloadBlob:UP,overflow:null,sizeExceed:[],failedEvts:[],batches:[],numEvents:0,retryCnt:D,isTeardown:N,isSync:O,isBeacon:B,sendType:M,sendReason:q}},R.appendPayload=function(D,N,O){var B=D&&N&&!D.overflow;return B&&Xp(e,function(){return"Serializer:appendPayload"},function(){for(var q=N.events(),M=D.payloadBlob,L=D.numEvents,U=!1,j=[],Q=[],Y=D.isBeacon,W=Y?S:v,V=Y?w:T,z=0,ie=0;z=O){D.overflow=N.split(z);break}var re=R.getEventBlob(H);if(re&&re.length<=V){var le=re.length,Le=M.length;if(Le+le>W){D.overflow=N.split(z);break}M&&(M+=` +`),M+=re,ie++,ie>wko&&(gqe(M,0,1),ie=0),U=!0,L++}else re?j.push(H):Q.push(H),q.splice(z,1),z--}z++}if(j.length>0&&D.sizeExceed.push(EQ.create(N.iKey(),j)),Q.length>0&&D.failedEvts.push(EQ.create(N.iKey(),Q)),U){D.batches.push(N),D.payloadBlob=M,D.numEvents=L;var me=N.iKey();Jo(D.apiKeys,me)===-1&&D.apiKeys.push(me)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:O}}),B},R.getEventBlob=function(D){try{return Xp(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+OLt(D.iKey);var O={},B;y||(B=a(function(U,j,Q){Nko(_,O,U,j,Q)},"_addMetadataCallback"));var q=D[f];q&&(N[f]=O,Zr(q,function(U,j){var Q=O[U]={};k(j,Q,"ext."+U,!0,null,null,!0)}));var M=N[u]={};M.baseType=D.baseType;var L=M[d]={};return k(D.baseData,L,d,!1,[d],B,m),k(D.data,M,u,!1,[],B,m),JSON.stringify(N)},function(){return{item:D}})}catch{return null}};function x(D,N){var O=A[D];return O===void 0&&(D.length>=7&&(O=Iae(D,"ext.metadata")||Iae(D,"ext.web")),A[D]=O),O}a(x,"_isReservedField");function k(D,N,O,B,q,M,L){Zr(D,function(U,j){var Q=null;if(j||Yx(j)){var Y=O,W=U,V=q,z=N;if(h&&!B&&Pko.test(U)){var ie=U.split("."),H=ie.length;if(H>1){V&&(V=V.slice());for(var re=0;re0&&n<=e)return n}return e}a(tGe,"_validateSizeLimit");function Dko(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a(Dko,"_getSizeLimtCfg");function Nko(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[usn];c||(c=e[usn]={f:{}});var l=c[eGe];if(l||(l=c[eGe]={}),r)for(var u=0;u0)for(var o=e[UHe](),s=0;s0&&(n&&nBt[e]?(t[GY][nBt[e]]=r,t[QHe]=!0):t.url+="&"+e+"="+r)}a(Hce,"_addRequestDetails");function Bko(t,e,r){for(var n=0;n=0&&j.splice(Z,1)},"rm")}},H[GHe]=function(ge){try{if(S)return S.getEventBlob(ge)}catch{}return UP},H[$He]=function(){try{var ge=S&&S[VHe](0,!1,!1,!1,1,0);return xe(ge,x)}catch{}return null},H[kTe]=function(ge,Z){try{var ve=[];Ct(ge,function(ae){Z&&(ae=cO(ae));var Ce=EQ.create(ae[B1],[ae]);ve[pg](Ce)});for(var Ge=null;ve[Zo]>0&&S;){var qe=ve.shift();qe&&qe[ip]()>0&&(Ge=Ge||S[VHe](0,!1,!1,!1,1,0),S.appendPayload(Ge,qe,ie))}var je=xe(Ge,x),J={data:Ge[XLt],urlString:je.url,headers:je[GY],timeout:k,disableXhrSync:N,disableFetchKeepAlive:O};return x&&(rGe(J[QP],ITe)||(J[QP][ITe]=qLt),rGe(J[QP],Bce)||(J[QP][Bce]=PHe)),J}catch{}return null};function le(ge,Z){try{return V&&V.getSenderInst(ge,Z)}catch{}return null}a(le,"_getSenderInterface"),H._getDbgPlgTargets=function(){return[g[0],c,S,g,Le(),s,ie]};function Le(){try{var ge={xdrOnComplete:me,fetchOnComplete:Te,xhrOnComplete:te,beaconOnRetry:K},Z={enableSendPromise:!1,isOneDs:!0,disableCredentials:!re,fetchCredentials:z,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:O,timeWrapper:Y,addNoResponse:q,senderOnCompleteCallBack:ge};return Z}catch{}return null}a(Le,"_getSendPostMgrConfig");function me(ge,Z,ve){var Ge=lO(ge);ee(Z,200,{},Ge),be(Ge)}a(me,"_xdrOncomplete");function Oe(){var ge;s=null,c=new asn,l=!1,u=new ssn,d=!1,f=0,h=null,m=null,g=null,A=null,y=!0,_=[],E={},v=[],S=null,T=!1,w=null,R=!1,x=!1,k=ge,N=ge,O=ge,B=ge,q=ge,M=[],L=ge,U=ge,j=[],Q=!1,Y=jce(),W=!1,V=null,ie=null}a(Oe,"_initDefaults");function Te(ge,Z,ve,Ge){var qe=a(function(ae,Ce,Re){ee(Z,ae,Ce,Re),be(Re)},"handleResponse"),je={},J=ge[QP];J&&J.forEach(function(ae,Ce){je[Ce]=ae}),qe(ge.status,je,ve||UP)}a(Te,"_fetchOnComplete");function te(ge,Z,ve){var Ge=lO(ge);ee(Z,ge.status,fQ(ge,!0),Ge),be(Ge)}a(te,"_xhrOnComplete");function ee(ge,Z,ve,Ge){try{ge(Z,ve,Ge)}catch(qe){La(m,2,518,hr(qe))}}a(ee,"_doOnComplete");function K(ge,Z,ve){var Ge=ge,qe=200,je=Ge[Uce],J=ge.urlString+(q?Mko:UP);try{var ae=nd();if(je){var Ce=!!A.getPlugin("LocalStorage"),Re=[],$e=[];Ct(je[p_],function(Ye){if(Re&&Ye&&Ye[ip]()>0)for(var ut=Ye[mO](),yt=0;yt0&&(je.sentEvts=$e),Ce||Ue(Re,8003,je[qC],!0)}else qe=0}catch(Ye){dO(m,"Failed to send telemetry using sendBeacon API. Ex:"+hr(Ye)),qe=0}finally{ee(Z,qe,{},UP)}}a(K,"_onBeaconRetry");function he(ge){return ge===2||ge===3}a(he,"_isBeaconPayload");function X(ge){return R&&he(ge)&&(ge=2),ge}a(X,"_adjustSendType"),H.addHeader=function(ge,Z){E[ge]=Z},H.removeHeader=function(ge){delete E[ge]},H[PTe]=function(){return de()&&u[wTe]()},H[Qce]=function(ge,Z){Bn(ge)&&(ge=0),R&&(ge=X(ge),Z=2),ne(v,ge,0)&&Ne(Be(),0,!1,ge,Z||0)},H.isCompletelyIdle=function(){return!l&&f===0&&v[Zo]===0},H[DTe]=function(ge){R=ge},H.addBatch=function(ge){if(ge&&ge[ip]()>0){if(c.isTenantKilled(ge[B1]()))return!1;v[pg](ge)}return!0},H.teardown=function(){v[Zo]>0&&Ne(Be(),0,!0,2,2),Ct(M,function(ge){ge&&ge.rm&&ge.rm()}),M=[]},H.pause=function(){l=!0},H.resume=function(){l=!1,H[Qce](0,4)},H[WHe]=function(ge,Z,ve){ge&&ge[ip]()>0&&(Xt(Z)&&(Z=1),R&&(Z=X(Z),ve=2),Ne([ge],0,!1,Z,ve||0))};function de(){return!l&&f0&&!l&&g[Z]&&S&&(Ge=Z!==0||de()&&(ve>0||u[wTe]())),Ge}a(ne,"_canSendPayload");function ue(ge){var Z={};return ge&&Ct(ge,function(ve,Ge){Z[Ge]={iKey:ve[B1](),evts:ve[mO]()}}),Z}a(ue,"_createDebugBatches");function Ne(ge,Z,ve,Ge,qe){if(!(!ge||ge[Zo]===0)){if(l){Ue(ge,1,Ge);return}Ge=X(Ge);try{var je=ge,J=Ge!==0;Xp(A,function(){return"HttpManager:_sendBatches"},function(ae){ae&&(ge=ge.slice(0));for(var Ce=[],Re=null,$e=L1(),Ye=g[Ge]||(J?g[1]:g[0]),ut=Ye&&Ye[zHe],yt=B&&(R||he(Ge)||ut===3||Ye._isSync&&ut===2);ne(ge,Ge,Z);){var $t=ge.shift();$t&&$t[ip]()>0&&(c.isTenantKilled($t[B1]())?Ce[pg]($t):(Re=Re||S[VHe](Z,ve,J,yt,qe,Ge),S.appendPayload(Re,$t,ie)?Re.overflow!==null&&(ge=[Re.overflow][hO](ge),Re.overflow=null,tt(Re,$e,L1(),qe),$e=L1(),Re=null):(tt(Re,$e,L1(),qe),$e=L1(),ge=[$t][hO](ge),Re=null)))}Re&&tt(Re,$e,L1(),qe),ge[Zo]>0&&(v=ge[hO](v)),Ue(Ce,8004,Ge)},function(){return{batches:ue(je),retryCount:Z,isTeardown:ve,isSynchronous:J,sendReason:qe,useSendBeacon:he(Ge),sendType:Ge}},!J)}catch(ae){La(m,2,48,"Unexpected Exception sending batch: "+hr(ae))}}}a(Ne,"_sendBatches");function xe(ge,Z){var ve={url:s,hdrs:{},useHdrs:!1};Z?(ve[GY]=Lce(ve[GY],E),ve.useHdrs=rd(ve.hdrs)[Zo]>0):Zr(E,function(ae,Ce){iBt[ae]?Hce(ve,iBt[ae],Ce,!1):(ve[GY][ae]=Ce,ve[QHe]=!0)}),Hce(ve,jLt,"NO_AUTH",Z),Hce(ve,DHe,bTe,Z);var Ge=UP;Ct(ge.apiKeys,function(ae){Ge[Zo]>0&&(Ge+=","),Ge+=ae}),Hce(ve,OHe,Ge,Z),Hce(ve,MHe,kl().toString(),Z);var qe=se(ge);if(Yx(qe)&&(ve.url+="&ext.intweb.msfpc="+qe),u[BHe]()&&Hce(ve,NHe,u[FHe](),Z),A[qce]){var je=A[qce]();je>=0&&(ve.url+="&w="+je)}for(var J=0;J<_[Zo];J++)ve.url+="&"+_[J].name+"="+_[J].value;return ve}a(xe,"_buildRequestDetails");function Fe(ge,Z,ve){ge[Z]=ge[Z]||{},ge[Z][h.identifier]=ve}a(Fe,"_setTimingValue");function tt(ge,Z,ve,Ge){if(ge&&ge.payloadBlob&&ge.payloadBlob[Zo]>0){var qe=!!L,je=g[ge.sendType];!he(ge[qC])&&ge[eBt]&&ge.sendReason===2&&(je=g[2]||g[3]||je);var J=x;(ge.isBeacon||je[zHe]===3)&&(J=!1);var ae=xe(ge,J);J=J||ae[QHe];var Ce=L1();Xp(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Re=0;Re0?yt[rBt]++:yt[rBt]=1}Ue(ge[p_],1e3+(Ge||0),ge[qC],!0);var Tt={data:ge[XLt],urlString:ae.url,headers:ae[GY],_thePayload:ge,_sendReason:Ge,timeout:k,disableXhrSync:N,disableFetchKeepAlive:O};J&&(rGe(Tt[QP],ITe)||(Tt[QP][ITe]=qLt),rGe(Tt[QP],Bce)||(Tt[QP][Bce]=PHe));var We=null;je&&(We=a(function(ce){u.firstRequestSent();var Pe=a(function(ye,oe){vt(ye,oe,ge,Ge)},"onComplete"),Me=ge[YHe]||ge.isSync;V.preparePayload(function(ye){try{je.sendPOST(ye,Pe,Me),U&&U(Tt,ye,Me,ge[eBt])}catch(oe){ee(Pe,0,{}),dO(m,"Unexpected exception sending payload. Ex:"+hr(oe))}},D,ce,Me)},"sender")),Xp(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(We)if(ge[qC]===0&&f++,qe&&!ge.isBeacon&&je[zHe]!==3){var ce={data:Tt.data,urlString:Tt.urlString,headers:Lce({},Tt[QP]),timeout:Tt.timeout,disableXhrSync:Tt[zLt],disableFetchKeepAlive:Tt[YLt]},Pe=!1;Xp(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{L(ce,function(Me){Pe=!0,!y&&!Me[Uce]&&(Me[Uce]=Me[Uce]||Tt[Uce],Me[KHe]=Me[KHe]||Tt[KHe]),We(Me)},ge.isSync||ge[YHe])}catch{Pe||We(Tt)}})}else We(Tt)})},function(){return{thePayload:ge,serializationStart:Z,serializationCompleted:ve,sendReason:Ge}},ge.isSync)}ge.sizeExceed&&ge.sizeExceed[Zo]>0&&Ue(ge.sizeExceed,8003,ge[qC]),ge.failedEvts&&ge.failedEvts[Zo]>0&&Ue(ge.failedEvts,8002,ge[qC])}a(tt,"_doPayloadSend");function st(ge,Z){T&&Ct(ge,function(ve){var Ge=ve[NTe]=ve[NTe]||{};Fe(Ge,"sendEventCompleted",Z)})}a(st,"_addEventCompletedTimings");function vt(ge,Z,ve,Ge){var qe=9e3,je=null,J=!1,ae=!1;try{var Ce=!0;if(typeof ge!==T1){if(Z){u[RTe](Z[Yon]);var Re=Z[zon]||Z["kill-duration-seconds"];Ct(c[JHe](Z[Won],Re),function(Ye){Ct(ve[p_],function(ut){if(ut[B1]()===Ye){je=je||[];var yt=ut[gO](0);ve.numEvents-=yt[ip](),je[pg](yt)}})})}if(ge==200||ge==204){qe=200;return}(!lsn(ge)||ve.numEvents<=0)&&(Ce=!1),qe=9e3+ge%1e3}if(Ce){qe=100;var $e=ve.retryCnt;ve[qC]===0&&($e0&&st(ve[mO](),Z)})}}a(Ht,"_addCompleteTimings");function F(ge,Z,ve){Z?ge():Y.set(ge,ve)}a(F,"_doAction");function se(ge){for(var Z=0;Z0&&o){var qe=o[Qe(Z)];if(qe){var je=ve!==0;Xp(A,function(){return"HttpManager:_sendBatchesNotification"},function(){F(function(){try{qe.call(o,ge,Z,je,ve)}catch(J){La(m,1,74,"send request notification failed: "+J)}},Ge||je,0)},function(){return{batches:ue(ge),reason:Z,isSync:je,sendSync:Ge,sendType:ve}},!je)}}}a(Ue,"_sendBatchesNotification");function Qe(ge){var Z=Lko[ge];return Yx(Z)||(Z=Von,ge>=9e3&&ge<=9999?Z=$on:ge>=8e3&&ge<=8999?Z=kHe:ge>=1e3&&ge<=1999&&(Z=Gon)),Z}a(Qe,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var Uko=.25,Asn=500,Qko=20,ysn=6,_sn=2,qko=4,msn=2,jko=1,oBt=1e4,YY="eventsDiscarded",gsn="",em=void 0,Hko=qE({eventsLimitInMem:{isVal:HY,v:oBt},immediateEventLimit:{isVal:HY,v:500},autoFlushEventsLimit:{isVal:HY,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:Gko,v:em},overrideInstrumentationKey:em,overrideEndpointUrl:em,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:em,clearTimeoutOverride:em,payloadPreprocessor:em,payloadListener:em,disableEventTimings:em,valueSanitizer:em,stringifyObjects:em,enableCompoundKey:em,disableOptimizeObj:!1,fetchCredentials:em,transports:em,unloadTransports:em,useSendBeacon:em,disableFetchKeepAlive:em,avoidOptions:!1,xhrTimeout:em,disableXhrSync:em,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:zh,v:ysn},maxUnloadEventRetryAttempts:{isVal:zh,v:_sn},addNoResponse:em,maxEvtPerBatch:{isVal:zh,v:Asn},excludeCsMetaData:em,requestLimit:{}});function Gko(t){return t&&t.sendPOST}a(Gko,"isOverrideFn");var sBt=(function(t){l_(e,t);function e(){var r=t.call(this)||this;r.identifier="PostChannel",r.priority=1011,r.version="4.3.10";var n,o=!1,s=[],c,l=!1,u=0,d,f=0,h,m={},g=TTe,A,y,_,E,v,S,T,w,R,x,k,D,N,O,B,q,M,L,U,j,Q,Y,W;return ki(e,r,function(V,z){he(),V._getDbgPlgTargets=function(){return[v,n]},V[$Y]=function(J,ae,Ce){Xp(ae,function(){return"PostChannel:initialize"},function(){z[$Y](J,ae,Ce),U=ae.getNotifyMgr();try{B=yQ(Wx(V[MTe]),ae.evtNamespace&&ae.evtNamespace()),V._addHook(M1(J,function(Re){var $e=Re.cfg,Ye=zx(null,$e,ae);n=Ye.getExtCfg(V[MTe],Hko),q=jce(n[qHe],n[jHe]),k=!n.disableOptimizeObj&&FLt(),M=n[tsn],H(ae),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[tBt],N=n.maxEventRetryAttempts,O=n.maxUnloadEventRetryAttempts,L=n[rsn],W=n.maxEvtPerBatch,d0($e.endpointUrl)?V.pause():l&&V.resume(),je(),Q=n[nsn],Y=!!n.disableTelemetry,j&&ie();var ut=$e.disablePageUnloadEvents||[];j=vHe(Le,ut,B),j=vTe(Le,ut,B)||j,j=CTe(me,$e.disablePageShowEvents,B)||j})),v[$Y](J,V.core,V)}catch(Re){throw V.setInitialized(!1),Re}},function(){return{theConfig:J,core:ae,extensions:Ce}})},V.processTelemetry=function(J,ae){RHe(J,V[MTe]),ae=ae||V._getTelCtx(ae);var Ce=J;!Y&&!o&&(Q&&(Ce[B1]=Q),Te(Ce,!0),D?Be(2,2):K()),V.processNext(Ce,ae)},V.getOfflineSupport=function(){try{var J=v&&v[$He]();if(v)return{getUrl:a(function(){return J?J.url:null},"getUrl"),serialize:le,batch:re,shouldProcess:a(function(ae){return!Y},"shouldProcess"),createPayload:a(function(ae){return null},"createPayload"),createOneDSPayload:a(function(ae){if(v[kTe])return v[kTe](ae,k)},"createOneDSPayload")}}catch{}return null},V._doTeardown=function(J,ae){Be(2,2),o=!0,v.teardown(),ie(),he()};function ie(){CHe(null,B),bHe(null,B),SHe(null,B)}a(ie,"_removeUnloadHandlers");function H(J){var ae=J[qce];J[qce]=function(){var Ce=0;return M&&(Ce=Ce|2),Ce|ae.call(J)}}a(H,"_hookWParam");function re(J){var ae=gsn;return J&&J[Zo]&&Ct(J,function(Ce){ae&&(ae+=` +`),ae+=Ce}),ae}a(re,"_batch");function le(J){var ae=gsn;try{Oe(J),ae=v[GHe](J)}catch{}return ae}a(le,"_serialize");function Le(J){var ae=J||Sf().event;ae.type!=="beforeunload"&&(D=!0,v[DTe](D)),Be(2,2)}a(Le,"_handleUnloadEvents");function me(J){D=!1,v[DTe](D)}a(me,"_handleShowEvents");function Oe(J){J.ext&&J.ext[$Lt]&&delete J.ext[$Lt],J.ext&&J.ext[LHe]&&J.ext[LHe].id&&delete J.ext[LHe].id,k&&(J.ext=cO(J.ext),J.baseData&&(J.baseData=cO(J.baseData)),J.data&&(J.data=cO(J.data)))}a(Oe,"_cleanEvent");function Te(J,ae){if(J[OTe]||(J[OTe]=0),J[_Q]||(J[_Q]=1),Oe(J),J[VY]){if(_||l)J[_Q]=3,J[VY]=!1;else if(v){k&&(J=cO(J)),v[WHe](EQ.create(J[B1],[J]),J[VY]===!0?1:J[VY],3);return}}var Ce=J[_Q],Re=f,$e=h;Ce===4&&(Re=u,$e=d);var Ye=!1;if(Re<$e)Ye=!xe(J,ae);else{var ut=1,yt=Qko;Ce===4&&(ut=4,yt=1),Ye=!0,Fe(J[B1],J[_Q],ut,yt)&&(Ye=!xe(J,ae))}Ye&&Ue(YY,[J],tO.QueueFull)}a(Te,"_addEventToQueues"),V.setEventQueueLimits=function(J,ae){n.eventsLimitInMem=h=HY(J)?J:oBt,n[tBt]=T=HY(ae)?ae:0,je();var Ce=f>J;if(!Ce&&w>0)for(var Re=1;!Ce&&Re<=3;Re++){var $e=S[Re];$e&&$e[p_]&&Ct($e[p_],function(Ye){Ye&&Ye[ip]()>=w&&(Ce=!0)})}Ne(!0,Ce)},V.pause=function(){de(),l=!0,v&&v.pause()},V.resume=function(){l=!1,v&&v.resume(),K()},V._loadTransmitProfiles=function(J){Ht(),Zr(J,function(ae,Ce){var Re=Ce[Zo];if(Re>=2){var $e=Re>2?Ce[2]:0;if(Ce.splice(0,Re-2),Ce[1]<0&&(Ce[0]=-1),Ce[1]>0&&Ce[0]>0){var Ye=Ce[0]/Ce[1];Ce[0]=srn(Ye)*Ce[1]}$e>=0&&Ce[1]>=0&&$e>Ce[1]&&($e=Ce[1]),Ce[pg]($e),m[ae]=Ce}})},V.flush=function(J,ae,Ce){J===void 0&&(J=!0);var Re;if(!l)if(Ce=Ce||1,J)ae||(Re=Vd(function(Ye){ae=Ye})),c==null?(de(),st(1,0,Ce),c=X(function(){c=null,vt(ae,Ce)},0)):s[pg](ae);else{var $e=de();te(1,1,Ce),ae&&ae(),$e&&K()}return Re},V.setMsaAuthTicket=function(J){v.addHeader(xTe,J)},V.setAuthPluginHeader=function(J){v.addHeader(HLt,J)},V.removeAuthPluginHeader=function(){v.removeHeader(HLt)},V.hasEvents=ee,V._setTransmitProfile=function(J){g!==J&&m[J]!==void 0&&(de(),g=J,K())},dQ(V,function(){return v},["addResponseHandler"]);function te(J,ae,Ce){var Re=st(J,ae,Ce);return v[Qce](ae,Ce),Re}a(te,"_sendEventsForLatencyAndAbove");function ee(){return f>0}a(ee,"_hasEvents");function K(){if(R>=0&&st(R,0,x)&&v[Qce](0,x),u>0&&!y&&!l){var J=m[g][2];J>=0&&(y=X(function(){y=null,te(4,0,1),K()},J))}var ae=m[g][1];!A&&!c&&ae>=0&&!l&&(ee()?A=X(function(){A=null,te(E===0?3:1,0,1),E++,E%=2,K()},ae):E=0)}a(K,"_scheduleTimer"),V[ZHe]=function(){_0&&f>T&&(ae=!0),ae&&c==null&&V.flush(J,function(){},20))}a(Ne,"_performAutoFlush");function xe(J,ae){k&&(J=cO(J));var Ce=J[_Q],Re=ue(J[B1],Ce,!0);return Re.addEvent(J)?(Ce!==4?(f++,ae&&J[OTe]===0&&Ne(!J.sync,w>0&&Re[ip]()>=w)):u++,!0):!1}a(xe,"_addEventToProperQueue");function Fe(J,ae,Ce,Re){for(;Ce<=ae;){var $e=ue(J,ae,!0);if($e&&$e[ip]()>0){var Ye=$e[gO](0,Re),ut=Ye[ip]();if(ut>0)return Ce===4?u-=ut:f-=ut,Qe(YY,[Ye],tO.QueueFull),!0}Ce++}return tt(),!1}a(Fe,"_dropEventWithLatencyOrLess");function tt(){for(var J=0,ae=0,Ce=a(function($e){var Ye=S[$e];Ye&&Ye[p_]&&Ct(Ye[p_],function(ut){$e===4?J+=ut[ip]():ae+=ut[ip]()})},"_loop_1"),Re=1;Re<=4;Re++)Ce(Re);f=ae,u=J}a(tt,"_resetQueueCounts");function st(J,ae,Ce){var Re=!1,$e=ae===0;return!$e||v[PTe]()?Xp(V.core,function(){return"PostChannel._queueBatches"},function(){for(var Ye=[],ut=4;ut>=J;){var yt=S[ut];yt&&yt.batches&&yt.batches[Zo]>0&&(Ct(yt[p_],function($t){v.addBatch($t)?Re=Re||$t&&$t[ip]()>0:Ye=Ye[hO]($t[mO]()),ut===4?u-=$t[ip]():f-=$t[ip]()}),yt[p_]=[],yt.iKeyMap={}),ut--}Ye[Zo]>0&&Ue(YY,Ye,tO.KillSwitch),Re&&R>=J&&(R=-1,x=0)},function(){return{latency:J,sendType:ae,sendReason:Ce}},!$e):(R=R>=0?S7(R,J):J,x=SP(x,Ce)),Re}a(st,"_queueBatches");function vt(J,ae){te(1,0,ae),tt(),Pt(function(){J&&J(),s[Zo]>0?c=X(function(){c=null,vt(s.shift(),ae)},0):(c=null,K())})}a(vt,"_flushImpl");function Pt(J){v.isCompletelyIdle()?J():c=X(function(){c=null,Pt(J)},Uko)}a(Pt,"_waitForIdleManager");function Ht(){de(),F(),g=TTe,K()}a(Ht,"_resetTransmitProfiles");function F(){m={},m[TTe]=[2,1,0],m[jon]=[6,3,0],m[Hon]=[18,9,0]}a(F,"_initializeProfiles");function se(J,ae){var Ce=[],Re=N;D&&(Re=O),Ct(J,function($e){$e&&$e[ip]()>0&&Ct($e[mO](),function(Ye){Ye&&(Ye[VY]&&(Ye[_Q]=4,Ye[VY]=!1),Ye[OTe]0&&Ue(YY,Ce,tO.NonRetryableStatus),D&&Be(2,2)}a(se,"_requeueEvents");function be(J,ae){var Ce=U||{},Re=Ce[J];if(Re)try{Re.apply(Ce,ae)}catch($e){La(V.diagLog(),1,74,J+" notification failed: "+$e)}}a(be,"_callNotification");function Ue(J,ae){for(var Ce=[],Re=2;Re0&&be(J,[ae][hO](Ce))}a(Ue,"_notifyEvents");function Qe(J,ae){for(var Ce=[],Re=2;Re0&&Ct(ae,function($e){$e&&$e[ip]()>0&&be(J,[$e.events()][hO](Ce))})}a(Qe,"_notifyBatchEvents");function ge(J,ae,Ce){J&&J[Zo]>0&&be("eventsSendRequest",[ae>=1e3&&ae<=1999?ae-1e3:0,Ce!==!0])}a(ge,"_sendingEvent");function Z(J,ae){Qe("eventsSent",J,ae),K()}a(Z,"_eventsSentEvent");function ve(J,ae){Qe(YY,J,ae>=8e3&&ae<=8999?ae-8e3:tO.Unknown)}a(ve,"_eventsDropped");function Ge(J){Qe(YY,J,tO.NonRetryableStatus),K()}a(Ge,"_eventsResponseFail");function qe(J,ae){Qe(YY,J,tO.Unknown),K()}a(qe,"_otherEvent");function je(){L?w=0:w=SP(W*(msn+1),h/6)}a(je,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(Nce);var F1=fe(require("os"));var nGe=class{constructor(e,r,n,o=!0,s){this.ctx=e;this.namespace=r;this.internalOnly=o;this.onCopilotToken=a(async e=>{this.token=e,this.commonProperties["common.isinternal"]=e?.isInternalUser()?"true":"false",await this.refreshGitHubHandleInCommonProperties();let r=e.getTokenValue("tid");r!==void 0&&(this.tags["ai.user.id"]=r)},"onCopilotToken");this.client=this.initializeClient(n),this.tags=$ko(e),this.commonProperties=Vko(e),this.#e=ws(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new ULt,n=new sBt,o={instrumentationKey:e,loggingLevelTelemetry:0,loggingLevelConsole:0,disableCookiesUsage:!0,disableDbgExt:!0,disableInstrumentationKeyValidation:!0,channels:[[n]]},s={alwaysUseXhrOverride:!0,httpXHROverride:this.createXhrOverride()};return o.extensionConfig={},o.extensionConfig[n.identifier]=s,r.initialize(o,[]),r.addTelemetryInitializer(c=>{let l=c.ext??{},u=l.web??{};u.consentDetails='{"GPC_DataSharingOptIn":false}',l.web=u,c.ext=l,c.tags={...c.tags??{},...this.tags}}),r}catch(r){Fr.error(this.ctx,"Failed to initialize MSFT 1DS reporter",r)}}sendTelemetryEvent(e,r,n){if(!this.client||this.internalOnly&&!this.token?.isInternalUser())return;r={...r,...this.commonProperties};let o=this.qualifyEventName(e);try{this.client.track({name:o,baseData:{name:o,properties:r,measurements:n}})}catch(s){Fr.debug(this.ctx,"Error tracking telemetry event",s)}}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client?.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}async refreshGitHubHandleInCommonProperties(){try{let e=await this.ctx.get(Or).resolveSession();e?.login?this.commonProperties["common.github_handle"]=e.login:delete this.commonProperties["common.github_handle"]}catch(e){Fr.debug(this.ctx,"Error resolving GitHub handle for telemetry",e)}}createXhrOverride(){return{sendPOST:a((e,r)=>{if(typeof e.data!="string")throw new Error(`Telemetry reporter only supports string payloads, received ${typeof e.data}`);let n=e.headers??{};n["Content-Type"]="application/json";let o={method:"POST",headers:n,body:e.data};this.ctx.get(Jt).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Fr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")}}};function $ko(t){let e={},r=t.get(za);e["ai.session.id"]=r.sessionId;let n=t.get(Gp);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${F1.type()} ${F1.release()}`,e["ai.device.osArchitecture"]=F1.arch(),e["ai.device.osPlatform"]=F1.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(As).getVersion(),e}a($ko,"getTags");function Vko(t){let e={};e.common_os=F1.platform(),e.common_platformversion=F1.release(),e.common_arch=F1.arch(),e.common_cpu=Array.from(new Set(F1.cpus().map(n=>n.model))).join();let r=t.get(za);return e.common_vscodemachineid=r.machineId,e.common_vscodesessionid=r.sessionId,e.client_deviceid=r.devDeviceId,e.common_uikind=r.uiKind,e.common_remotename=r.remoteName,e.common_isnewappinstall="",e}a(Vko,"getCommonProperties");var Wko="7d7048df-6dd0-4048-bb23-b716c1461f8f",zko="3fdd7f28-937a-48c8-9a21-ba337db23bd1",Yko="b73649cf-ca8f-4768-9e0e-b789d8529db5",Kko="5fb6107a-6a29-423f-a824-22e3724fa2a6",Jko="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function Zko(t){return _7(t)==="prod"?Yko:Kko}a(Zko,"getMsftInstrumentationKey");function Esn(t){return new URL(t).hostname==="github.com"?Hz.telemetry:t.replace("://","://copilot-telemetry-service.")}a(Esn,"getEndpointForServerUrl");var op=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=Esn(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];ws(e,n=>{this.cachedToken=n,this.updateServiceEndpoints(n.endpoints)})}static{a(this,"TelemetryInitialization")}get endpointUrl(){return this.overrideEndpointUrlForTesting||new URL("telemetry",this.rootUrl).href}get isInitialized(){return this.initializedWith!==void 0}get isEnabled(){return this._enabled??!1}initialize(e){let r=this.ctx;this._enabled=e;let n=this.endpointUrl;if(!(this.initializedWith?.enabled===this._enabled&&this.initializedWith?.endpointUrl===this.endpointUrl)&&(this.shutdownWithoutWaiting(),this.initializedWith={endpointUrl:n,enabled:this._enabled},e)){let o=r.get(l0);if(o.setReporter(new cce(r,this.namespace,{instrumentationKey:Wko,endpointUrl:n})),o.setRestrictedReporter(new cce(r,this.namespace,{instrumentationKey:zko,endpointUrl:n})),o.setMsftReporter(new cce(r,`copilot/${this.namespace}`,{instrumentationKey:Zko(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new nGe(r,"ThirdParty.copilot-chat",Jko,!0,this.cachedToken)),this.initListeners){let s=this.initListeners;this.initListeners=void 0;for(let c of s)try{c()}catch{}}}}onInitialized(e){if(this.initListeners)this.initListeners.push(e);else try{e()}catch{}}setCustomReporters(e,r){this.shutdownWithoutWaiting();let n=this.ctx.get(l0);n.setReporter(e),n.setRestrictedReporter(r)}async shutdown(){this.shutdownWithoutWaiting(),await Promise.all(this.shuttingDown)}shutdownWithoutWaiting(){this.initializedWith=void 0;let e=this.ctx.get(l0).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=Esn(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function Xko(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await $d(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(op).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return DC.exception(t,n,"signUpLimited failed"),!1}}a(Xko,"apiFetchSignUpLimited");async function cBt(t,e,r){let n=await t.get(Qt).getTokenResult();switch(n.failureKind){case void 0:return"OK";case"HTTP401":case"NotSignedIn":return"NotSignedIn";case"NotAuthorized":return r&&n.canSignUpForLimited&&await Xko(t,e)?cBt(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(cBt,"getTokenWithSignUpLimited");p();p();var vsn=fe(ii());var Ji=class extends vsn.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var ePo={didChangeFeatureFlags:!1,didChangeManagedSettings:!1,fetch:!1,ipCodeCitation:!1,redirectedTelemetry:!1,related:!1,token:!1,watchedFiles:!1,showPanelMessage:!1,mcpElicitation:!1,mcpSampling:!1,mcpAllowlist:!1,stateDatabase:!1,subAgent:!1,mcpServerManagement:!1,cveRemediatorAgent:!1,debuggerAgent:!1,contentProvider:[],manageTodoListTool:!1,agentDebugLog:!1,accountPickerEnabled:!1},Nn=class{constructor(){this.capabilities={...ePo};this.emitter=new Ji;this.onDidSetCapabilities=this.emitter.event}static{a(this,"CopilotCapabilitiesProvider")}setCapabilities(e){let r;for(r in e){let n=e[r];n!==void 0&&(this.capabilities[r]=n)}this.emitter.fire(this.capabilities)}getCapabilities(){return this.capabilities}};p();var U3=require("fs"),Gce=require("os"),$ce=fe(require("path")),vQ=require("process");var Un=class{static{a(this,"PersistenceManager")}},lBt=class extends Un{constructor(r){super();this.directory=r}static{a(this,"FilePersistenceManager")}async read(r,n){try{return(await this.readJsonObject(r))[n]}catch{return}}async update(r,n,o){await U3.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=$ce.dirname(s);c!==this.directory&&await U3.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await LTe.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await U3.promises.writeFile(s,JSON.stringify(u)+` `,{encoding:"utf8",mode:384})}finally{l&&await l()}}async delete(r,n){let o=`${this.directory}/${r}.json`,s;try{s=await LTe.acquire(o);let c=await this.readJsonObject(r);delete c[n];let l=JSON.stringify(c)+` `;l===`{} -`?await U3.promises.rm(o):await U3.promises.writeFile(o,l,{encoding:"utf8",mode:384})}catch{}finally{s&&await s()}}async deleteSetting(r){let n=`${this.directory}/${r}.json`,o;try{o=await LTe.acquire(n),await U3.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await U3.promises.readdir(this.directory)).filter(n=>n.endsWith(".json")).map(n=>n.slice(0,-5))}catch{return[]}}async listKeys(r){return Object.keys(await this.readJsonObject(r))}async readAll(r){return await this.readJsonObject(r)}async readJsonObject(r){let n=`${this.directory}/${r}.json`;try{let o=await U3.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},LTe=class{static{a(this,"LockManager")}static{this.locks=new Map}static{this.DEFAULT_TIMEOUT_MS=1e4}static async acquire(e){await this.getLock(e);let r,n=new Promise(o=>{r=o});return this.locks.set(e,n),()=>Promise.resolve().then(()=>{r&&(r(),r=void 0,this.locks.get(e)===n&&this.locks.delete(e))})}static async getLock(e){let r=Date.now();for(;Date.now()-r{setTimeout(()=>{l(new Error("timeout"))},o)});try{await Promise.race([n,s])}catch{return}}}};function Xko(){if(vQ.env.XDG_CONFIG_HOME&&Gce.isAbsolute(vQ.env.XDG_CONFIG_HOME))return vQ.env.XDG_CONFIG_HOME+"/github-copilot";if((0,Hce.platform)()==="win32"){let e=vQ.env.USERPROFILE||lBt.homedir();return e?e+"\\AppData\\Local\\github-copilot":vsn()}let t=vQ.env.HOME&&vQ.env.HOME.length>0?vQ.env.HOME:lBt.homedir();return t?t+"/.config/github-copilot":vsn()}a(Xko,"getXdgConfigPath");var lBt={homedir:Hce.homedir,tmpdir:Hce.tmpdir};function vsn(){return Gce.join(lBt.tmpdir(),"github-copilot")}a(vsn,"tmpdirConfigPath");function Csn(){return new cBt(Xko())}a(Csn,"makeXdgPersistenceManager");p();var ks=class{static{a(this,"StatusReporter")}#e=0;#t="Normal";#r;#n;#i=!0;#o={category:"auth",kind:"Warning",message:"Not initialized",askToReSignin:!1,result:{status:"NotSignedIn"}};#s={category:"cls",kind:"Normal",inactive:!1};get busy(){return this.#e>0}trackCompletionJob(e){return this.#t==="Warning"&&this.forceNormalV1(),this.#s.kind==="Warning"&&this.forceNormalV2("cls",{inactive:!1}),this.#e++===0&&(this.#a(),this.#c("completion")),e().finally(()=>{--this.#e===0&&(this.#a(),this.#c("completion"))})}forceStatusV1(e,r,n){this.#t===e&&this.#r===r&&!n&&!this.#n&&!this.#i||(this.#t=e,this.#r=r,this.#n=n,this.#i=!1,this.#a())}forceStatusV2(e,r){e==="auth"?this.#o=r:this.#s=r,this.#c(e)}forceStatus(e,r,n){this.forceStatusV1(r.kind,r.message,n),this.forceStatusV2(e,r)}forceNormalV1(){this.#t!=="Inactive"&&this.forceStatusV1("Normal")}forceNormalV2(e,r){this.forceStatusV2(e,{...r,kind:"Normal",category:e})}forceNormal(e,r){this.forceNormalV1(),this.forceNormalV2(e,r)}setErrorV1(e,r){this.forceStatusV1("Error",e,r)}setErrorV2(e,r){let n=e==="auth"?this.#o:this.#s;this.forceStatusV2(e,{...n,...r,kind:"Error",category:e})}setError(e,r,n){this.setErrorV1(r.message,n),this.setErrorV2(e,r)}setWarningV1(e){this.#t!=="Error"&&this.forceStatusV1("Warning",e)}setWarningV2(e,r){let n=e==="auth"?this.#o:this.#s;n.kind!=="Error"&&this.forceStatusV2(e,{...n,...r,kind:"Warning",category:e})}setWarning(e,r){r?.message&&this.setWarningV1(r.message),this.setWarningV2(e,r)}setInactiveV1(e){this.#t==="Error"||this.#t==="Warning"||this.forceStatusV1("Inactive",e)}setClsInactiveV2(e){this.setInactiveV1(e),!(this.#s.kind==="Error"||this.#s.kind==="Warning")&&(this.#s.inactive&&this.#s.message===e||(this.#s={category:"cls",kind:"Normal",inactive:!0,message:e},this.#c("cls")))}setClsInactive(e){this.setInactiveV1(e),this.setClsInactiveV2(e)}clearInactiveV1(){this.#t==="Inactive"&&this.forceStatusV1("Normal")}clearClsInactiveV2(){this.#s.inactive&&(this.#s={category:"cls",kind:"Normal",inactive:!1},this.#c("cls"))}clearClsInactive(){this.clearInactiveV1(),this.clearClsInactiveV2()}sendInitNonAuthStatus(){this.didChangeV2({statuses:[this.#s,{category:"completion",busy:this.busy}]})}#a(){let e={kind:this.#t,message:this.#r,busy:this.busy,command:this.#n};this.didChangeV1(e)}#c(e){let r=this.#u(e);this.didChangeV2({statuses:[r]})}#u(e){switch(e){case"completion":return{category:"completion",busy:this.#e>0};case"auth":return this.#o;case"cls":return this.#s}}},iGe=class extends ks{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var bsn={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function Ssn(t,e){sr(t,bsn.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(Ssn,"telemetryAuthPickerListed");function uBt(t,e){sr(t,bsn.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a(uBt,"telemetryAuthPickerUsed");p();var CQ={StoreInitialize:"auth.store.initialize",StoreError:"auth.store.error",StoreMigration:"auth.store.migration",SessionActivated:"auth.session.activated",SessionDeactivated:"auth.session.deactivated",TokenRevoked:"auth.token.revoked",EncryptionInitialize:"auth.encryption.initialize"};function Tsn(t,e){Hs(t,CQ.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs}),ft(t,CQ.StoreInitialize)}a(Tsn,"telemetryAuthStoreInitialize");function Isn(t,e){Hs(t,CQ.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(Isn,"telemetryAuthStoreError");function xsn(t,e){Hs(t,CQ.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a(xsn,"telemetryAuthStoreMigration");function dBt(t,e){let r={editorId:e.editorId,trigger:e.trigger};e.crossEditorReuse!==void 0&&(r.crossEditorReuse=String(e.crossEditorReuse)),e.tokenRewrite!==void 0&&(r.tokenRewrite=String(e.tokenRewrite)),sr(t,CQ.SessionActivated,r,{durationMs:e.durationMs})}a(dBt,"telemetryAuthSessionActivated");function wsn(t,e){sr(t,CQ.SessionDeactivated,{editorId:e.editorId})}a(wsn,"telemetryAuthSessionDeactivated");function oGe(t,e){sr(t,CQ.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(oGe,"telemetryAuthTokenRevoked");function sGe(t,e){Hs(t,CQ.EncryptionInitialize,e.diagnostics.error,{writerKind:e.writerKind,available:String(e.diagnostics.available),errorPhase:e.diagnostics.errorPhase??"",masterKeySource:e.diagnostics.masterKeySource??""})}a(sGe,"telemetryAuthEncryptionInitialize");var ePo="apps",Rsn="hosts",Wd=new pe("AuthManager"),ksn="legacy_files_migration_done",tPo=5,rPo=6e4,Fr=class{constructor(e,r){this.ctx=e;this.env=r}static{a(this,"AuthManager")}hasTransientSession(){return this.transientSession!==void 0}get _copilotTokenManager(){return this.ctx.get(Qt)}getConfiguredUrls(){return this.ctx.get(ig).getConfiguredUrls()}async checkAndUpdateStatus(e){let r=e?.localChecksOnly??!1,n=e?.githubAppId!==void 0?await this.resolvePersistedSession(e):await this.resolveSession(e?.authAuthority);return n===void 0?(this._copilotTokenManager.resetToken("session_not_found"),Wd.info(this.ctx,"checkAndUpdateStatus: no session found, priming token"),await this._copilotTokenManager.primeToken(),{status:"NotSignedIn"}):r?(this.ctx.get(ks).forceNormalV2("auth",{result:{status:"MaybeOK",user:n.login}}),{status:"MaybeOK",user:n.login}):(e?.forceRefresh&&this._copilotTokenManager.resetToken("force_refresh"),{status:await aBt(this.ctx,n,e?.freshSignIn??!1),user:n.login})}getAuthSourceEnvVar(){return cGe(this.env).sourceEnvVar}async resolveSession(e){await this.ctx.get(Qo).requireReady();let{session:r,sourceEnvVar:n}=cGe(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),Wd.info(this.ctx,`resolveSession: resolved from env var ${n}`),{...r,...a_(r)};let o=await this.transientSession;if(o){if(o.accessToken===void 0){Wd.info(this.ctx,"resolveSession: transient session is a shadow, no session");return}return Wd.info(this.ctx,"resolveSession: resolved from transient session"),{...o,...a_(o)}}let s=await this.resolvePersistedSession({authAuthority:e});return Wd.info(this.ctx,`resolveSession: persisted store ${s?"resolved a session":"returned no session"}`),s}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},aGe=class extends Fr{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(QM)}async tracked(r,n){try{return await n()}catch(o){throw Wd.exception(this.ctx,o,`authStore.${r}`),Isn(this.ctx,{editorId:this.editorId(),op:r,error:o}),o}}editorId(){return this.cachedEditorId===void 0&&(this.cachedEditorId=this.ctx.get(Ir).getEditorIdentity().editorId),this.cachedEditorId}tokenRecordToSession(r){let n;try{n=b7(this.ctx,r.authAuthority)}catch(o){Wd.warn(this.ctx,"tokenRecordToSession: dropping record with unparseable authAuthority",o);return}return{serverUrl:n.serverUrl,apiUrl:n.apiUrl,accessToken:r.accessToken,login:r.user,githubAppId:r.oauthClientId||void 0,scopes:iPo(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(ksn))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(Un),h=this.editorId(),[m,g]=await Promise.all([f.readAll(ePo).catch(()=>({})),f.readAll(Rsn).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let _=Psn(y);if(!_){c++;continue}let[E,v]=nPo(A)??["github.com",$ce],S=_.oauth_token||_.access_token,T=_.user||_.login;if(!S||!T){c++;continue}let w=_.authAuthority||E;if(!xOt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:S,authAuthority:w,oauthClientId:_.githubAppId??v,scopes:fBt(_.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let _=Psn(y);if(!_){c++;continue}let E=_.oauth_token||_.access_token,v=_.user||_.login;if(!E||!v){c++;continue}let S=_.authAuthority||A;if(!xOt(S)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:E,authAuthority:S,oauthClientId:_.githubAppId??$ce,scopes:fBt(_.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(ksn,String(Date.now())))}catch{}this.ctx.get(Un).deleteSetting(Rsn).catch(()=>{}),xsn(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),Wd.info(this.ctx,`runSqliteMigration: outcome=${l} apps=${o} hosts=${s} skipped=${c}`)}}tryAutoAdoptCoalesced(){return this.autoAdoptPromise||(this.autoAdoptPromise=this.tryAutoAdopt().finally(()=>{this.autoAdoptPromise=void 0})),this.autoAdoptPromise}async tryAutoAdopt(){let r=this.authRepository,n=this.editorId(),o=Date.now(),s=await r.listTokensByRecency(tPo);if(Wd.debug(this.ctx,`tryAutoAdopt: editorId=${n} candidates=${s.length}`),s.length===0)return;let c=this.ctx.get($h);for(let l of s){let u=this.tokenRecordToSession(l.record);if(!u){Wd.info(this.ctx,`tryAutoAdopt: dropping corrupt-authority tokenId=${l.tokenId}; continuing walk`),await this.revokeTokenById(l.tokenId,"corrupt_authority");continue}let d;try{d=await c.fetchTokenResult(this.ctx,u)}catch{Wd.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${l.tokenId}; aborting walk`);return}if(d.copilotToken||d.failureKind==="NotAuthorized"){Wd.info(this.ctx,`tryAutoAdopt: adopting tokenId=${l.tokenId} crossEditor=${l.sourceEditorId!==n} noCopilotAccess=${d.failureKind==="NotAuthorized"}`);try{await this.tracked("assign",()=>r.assignActiveSession(n,l.tokenId))}catch(f){Wd.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${l.tokenId} (${f?.message??f}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(l.tokenId),dBt(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:l.sourceEditorId!==n,durationMs:Date.now()-o}),u}if(d.failureKind==="HTTP401"){Wd.info(this.ctx,`tryAutoAdopt: skipping invalid tokenId=${l.tokenId} (not revoking); continuing walk`);continue}Wd.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${l.tokenId} kind=${d.failureKind}; aborting walk`);return}Wd.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new Ei("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new Ei("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();Wd.debug(this.ctx,`signInEditor: editorId=${n} authority=${r.authAuthority} appId=${r.githubAppId??""}`);let s=await this.tracked("upsert",()=>this.authRepository.upsertTokenAndAssign(n,{user:r.user,accessToken:r.accessToken,authAuthority:r.authAuthority,oauthClientId:r.githubAppId??"",scopes:fBt(r.scopes)}));Wd.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),dBt(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=b7(this.ctx,r.authAuthority);return this.setTransientSession({login:r.user,accessToken:r.accessToken,githubAppId:r.githubAppId,serverUrl:c.serverUrl,apiUrl:c.apiUrl}),this._copilotTokenManager.setActiveTokenId(s.tokenId),await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:r.authAuthority})}async signOutEditor(){let r=this.editorId();return Wd.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),wsn(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){Wd.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return Wd.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),oGe(this.ctx,{editorId:this.editorId(),trigger:n??"unknown",affectedEditors:o.affectedEditors}),this._copilotTokenManager.resetToken("token_revoked",void 0,r),this._copilotTokenManager.getActiveTokenId()===r&&(this._copilotTokenManager.setActiveTokenId(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})),o}async useExistingToken(r){let n=this.authRepository,o=this.editorId(),s=await n.getTokenById(r);if(!s)return uBt(this.ctx,{editorId:o,status:"revoked",clearedTombstone:!1,crossEditorReuse:!1,validationMs:0}),{status:"revoked"};let c=s.sourceEditorId!==o,l=await n.hasOptOutTombstone(o);this.setTransientSession(void 0),await n.assignActiveSession(o,r),this._copilotTokenManager.setActiveTokenId(r);let u=performance.now(),d,f=!1;try{d=(await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:s.record.authAuthority})).status}catch{f=!0,d="NotSignedIn"}let h;switch(d){case"OK":h="ok";break;case"NotAuthorized":h="not_entitled";break;default:h=f?"transient":"revoked";break}return uBt(this.ctx,{editorId:o,status:h,clearedTombstone:l,crossEditorReuse:c,validationMs:performance.now()-u}),{status:h}}async listAvailableTokens(){await this.ensureSqliteMigration();let r=this.authRepository,n=this.editorId(),o=await r.listAvailableTokens(),s=await r.getActiveSession(n),c=o.map(d=>({tokenId:d.tokenId,authAuthority:d.authAuthority,userLogin:d.userLogin,isCurrent:s?.tokenId===d.tokenId,lastUsedAt:d.lastUsedAt})),l=c.some(d=>d.isCurrent),u=await r.hasOptOutTombstone(n);return Ssn(this.ctx,{editorId:n,candidateCount:c.length,hasCurrentSession:l,hasOptOutTombstone:u}),c}async resolvePersistedSession(r){await this.ensureSqliteMigration();let n=this.authRepository,o=this.editorId(),s=this.ctx.get(Nn).getCapabilities().accountPickerEnabled,c=await n.hasOptOutTombstone(o),l=await n.getActiveSession(o),u=!l&&!s&&!c;if(u&&(await this.tryAutoAdoptCoalesced(),l=await n.getActiveSession(o)),!l){Wd.info(this.ctx,`resolvePersistedSession: no active session editorId=${o} pickerEnabled=${s} optedOut=${c} autoAdoptAttempted=${u}`);return}let d=b7(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==d.authAuthority){Wd.info(this.ctx,`resolvePersistedSession: active session authority mismatch editorId=${o}`);return}if(r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId){Wd.info(this.ctx,`resolvePersistedSession: active session appId mismatch editorId=${o}`);return}let f=this.tokenRecordToSession(l.record);if(!f){await this.revokeTokenById(l.tokenId,"corrupt_authority");return}this._copilotTokenManager.setActiveTokenId(l.tokenId);let h=Date.now();return h-this.lastTouchAt>=rPo&&(this.lastTouchAt=h,n.touchActiveSession(o).catch(()=>{})),f}};function nPo(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(nPo,"splitAppsKey");function iPo(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(iPo,"normalizeScopes");function fBt(t){return t?typeof t=="string"?t:t.join(" "):""}a(fBt,"scopesToString");function Psn(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(Psn,"asLegacyAuthRecord");function cGe(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...a_({apiUrl:t.GH_COPILOT_API_URL,serverUrl:t.GH_COPILOT_SERVER_URL}),login:t.GH_COPILOT_USER||"",accessToken:t.GH_COPILOT_TOKEN},sourceEnvVar:"GH_COPILOT_TOKEN"}:t.GITHUB_COPILOT_TOKEN?{session:{...a_({apiUrl:t.GITHUB_COPILOT_API_URL,serverUrl:t.GITHUB_COPILOT_SERVER_URL}),login:t.GITHUB_COPILOT_USER||"",accessToken:t.GITHUB_COPILOT_TOKEN},sourceEnvVar:"GITHUB_COPILOT_TOKEN"}:t.CODESPACES==="true"&&t.GITHUB_TOKEN?{session:{...a_({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(cGe,"getSessionFromEnv");p();var oPo=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],Dsn="Your proxy connection requires a trusted certificate. Please make sure the proxy certificate and any issuers are configured correctly and trusted by your operating system.",Nsn="https://gh.io/copilot-network-errors",jC=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&oPo.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new pe("certificates").error(e,`${Dsn} Please visit ${Nsn} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(ss).showWarningMessage(Dsn,n).then(o=>{if(o?.title===n.title)return e.get(og).open(Nsn)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};var pBt=class extends Ei{constructor(r){super("message"in r?r.message:`${r.failureKind}`);this.result=r}static{a(this,"TokenResultError")}},Qt=class{constructor(e,r=!1){this.ctx=e;this.primed=r;this.lastToken=void 0;this.activeToken=void 0;this.activeTokenId=void 0;this.tokenPromise=void 0;this.tokenPrimingError=void 0;this.didChangeTokenResult=new Ji;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new Ji;this.onDidResetToken=this.didResetToken.event}static{a(this,"CopilotTokenManager")}async getGitHubSession(){return await this.ctx.get(Fr).resolveSession()}primeToken(){if(this.tokenPrimingError)return Promise.reject(this.tokenPrimingError);this.primed=!0;try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async fetchTokenResult(e){return await this.ctx.get($h).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e}async getTokenResult(){if(!this.primed){let r=new Error("Token requested before initialization");if(Msn(this.ctx))throw this.tokenPrimingError=r,r;DC.exception(this.ctx,r,".getToken")}if(this.activeToken!==void 0&&!this.activeToken.needsRefresh())return{copilotToken:this.activeToken};if(!this.tokenPromise){let r,n=this.captureFetchContext(),o=this.getGitHubSession().then(async s=>s?(r=s.login,await this.fetchTokenResult(s)):{failureKind:"NotSignedIn"}).catch(s=>{if(!(s instanceof Error))throw s;return{failureKind:"Exception",message:String(s),exception:s}}).then(s=>(this.tokenPromise!==o||(this.tokenPromise=void 0,this.handleTokenResult(s,r,n)),s));this.tokenPromise=o}return await this.tokenPromise}handleTokenResult(e,r,n){let o=this.ctx.get(ks);switch(e.failureKind){case"NotSignedIn":o.setError("auth",{message:"You are not signed into GitHub.",askToReSignin:!1,result:{status:"NotSignedIn",user:r}});break;case"HTTP401":o.setError("auth",{message:"Your GitHub Copilot session has expired. You have been signed out. Please sign in again to continue using GitHub Copilot.",askToReSignin:!0,result:{status:"NotSignedIn",user:r}},{command:"github.copilot.signIn",title:"Sign In"});break;case"NotAuthorized":o.setError("auth",{message:e.message,askToReSignin:!1,result:{status:"NotAuthorized",user:r??""}});break;case"Exception":o.setWarning("auth",{message:e.message,askToReSignin:!1}),this.ctx.get(jC).notifyUser(this.ctx,e.exception);break;case void 0:o.forceNormal("auth",{result:{status:"OK",user:r??""}}),this.setToken(e.copilotToken)}this.didChangeTokenResult.fire(e);let s={result:e.copilotToken?"success":"failure",errorCode:e.failureKind??"",trigger:n?.trigger??"unknown",editorPreviewEnabled:e.copilotToken?e.copilotToken.getTokenValue("editor_preview_features")==="0"?"false":"true":""},c=v7(),l={previousRemainingLifetime:n?.previousRemainingLifetime??-1,previousUnadjustedRemainingLifetime:n?.previousUnadjustedRemainingLifetime??-1,newRefreshIn:e.copilotToken?.envelope.refresh_in??-1,newRemainingLifetime:e.copilotToken?e.copilotToken.expiresAt-c:-1,newUnadjustedRemainingLifetime:e.copilotToken?e.copilotToken.envelope.expires_at-c:-1};"exception"in e&&e.exception?Hs(this.ctx,"auth.token_reset_complete",e.exception,s,l):sr(this.ctx,"auth.token_reset_complete",s,l)}captureFetchContext(){let e=this.activeToken??this.lastToken,r=this.lastToken===void 0?"initial":this.activeToken===void 0?"after_reset":"expiry",n=v7(),o=e?e.expiresAt-n:-1,s=e?e.envelope.expires_at-n:-1;return{trigger:r,previousRemainingLifetime:o,previousUnadjustedRemainingLifetime:s}}async getToken(){let e=await this.getTokenResult();if(e.copilotToken)return e.copilotToken;throw e.exception?e.exception:new pBt(e)}setActiveTokenId(e){if(this.activeTokenId===e)return;let r=this.activeTokenId;this.activeTokenId=e,r!==void 0&&this.activeToken&&this.resetToken("active_token_id_changed")}getActiveTokenId(){return this.activeTokenId}resetToken(e,r,n){if(n!==void 0&&this.activeTokenId!==void 0&&n!==this.activeTokenId){DC.debug(this.ctx,`Skipping token reset from ${e} for tokenId ${n} because activeTokenId is ${this.activeTokenId}`);return}if(r!==void 0?(ft(this.ctx,"auth.reset_token_"+r),DC.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):DC.debug(this.ctx,`Resetting copilot token (caller: ${e})`),!this.activeToken&&!this.tokenPromise)return;let o=v7(),s=this.activeToken?this.activeToken.expiresAt-o:-1,c=this.activeToken?this.activeToken.envelope.expires_at-o:-1;sr(this.ctx,"auth.token_reset_trigger",{caller:e,httpStatus:r!==void 0?String(r):"",hadActiveToken:String(!!this.activeToken),hadPendingRefresh:String(!!this.tokenPromise)},{remainingLifetime:s,unadjustedRemainingLifetime:c}),this.activeToken=void 0,this.tokenPromise=void 0,this.didResetToken.fire()}getLastToken(){return this.lastToken}};function Dx(t){return t.get(Qt).getLastToken()}a(Dx,"getLastCopilotToken");p();var HC=class{static{a(this,"Clock")}now(){return new Date}};p();var qP=class{static{a(this,"ExpConfigMaker")}},sPo=5e3,aPo=2e3,BTe=class extends qP{constructor(r={}){super();this.defaultFilters=r}static{a(this,"ExpConfigFromTAS")}async fetchExperiments(r,n,o){let s=Object.keys(o).length===0?this.defaultFilters:o,c=new URL("telemetry",n.telemetry).href,l=await this.fetchOnce(r,c,s,sPo);return l.kind==="failure"&&l.retryable&&(l=await this.fetchOnce(r,c,s,aPo)),l.kind==="failure"?px.createFallbackConfig(r,l.reason):l.config}async fetchOnce(r,n,o,s){let c=r.get(Jt),l;try{l=await c.fetch(n,{method:"GET",headers:o,timeout:s})}catch(h){return{kind:"failure",reason:`Error fetching ExP config: ${String(h)}`,retryable:!0}}if(!l.ok){let h=l.status>=500||l.status===429;return{kind:"failure",reason:`ExP responded with ${l.status}`,retryable:h}}let u;try{u=await l.json()}catch(h){if(h instanceof SyntaxError)return Ma(r,h,"fetchExperiments"),{kind:"failure",reason:"ExP responded with invalid JSON",retryable:!1};throw h}let d=u.Configs.find(h=>h.Id==="vscode")??{Id:"vscode",Parameters:{}},f=Object.entries(d.Parameters).map(([h,m])=>h+(m?"":"cf"));return{kind:"success",config:new px(d.Parameters,u.AssignmentContext,f.join(";"))}}},lGe=class extends qP{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(px.createEmptyConfig())}};p();p();var uGe=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},hBt=class extends uGe{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},Osn=a(t=>new hBt(t),"DEFAULT_GRANULARITY"),dGe=class extends uGe{constructor(r,n=.5,o=new Date().setUTCHours(0,0,0,0)){super(r);this.prefix=r;this.fetchBeforeFactor=n;this.anchor=o}static{a(this,"TimeBucketGranularity")}setTimePeriod(r){isNaN(r)?this.timePeriodLengthMs=void 0:this.timePeriodLengthMs=r}setByCallBuckets(r){isNaN(r)?this.numByCallBuckets=void 0:this.numByCallBuckets=r}getValue(r){return this.prefix+this.getTimePeriodBucketString(r)+(this.numByCallBuckets?this.timeHash(r):"")}getTimePeriodBucketString(r){return this.timePeriodLengthMs?this.dateToTimePartString(r):""}getUpcomingValues(r){let n=[],o=this.getUpcomingTimePeriodBucketStrings(r),s=this.getUpcomingByCallBucketStrings();for(let c of o)for(let l of s)n.push(this.prefix+c+l);return n}getUpcomingTimePeriodBucketStrings(r){if(this.timePeriodLengthMs===void 0)return[""];if((r.getTime()-this.anchor)%this.timePeriodLengthMsr.toString())}timeHash(r){return this.numByCallBuckets==null?0:7883*(r.getTime()%this.numByCallBuckets)%this.numByCallBuckets}dateToTimePartString(r){return this.timePeriodLengthMs==null?"":Math.floor((r.getTime()-this.anchor)/this.timePeriodLengthMs).toString()}};var Lsn="X-Copilot-ClientTimeBucket",fGe=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=Osn(e)}static{a(this,"GranularityDirectory")}selectGranularity(e){for(let[r,n]of this.specs.entries())if(e.extends(r))return n;return this.defaultGranularity}update(e,r,n){if(r=r>1?r:NaN,n=n>0?n:NaN,isNaN(r)&&isNaN(n))this.specs.delete(e);else{let o=new dGe(this.prefix);isNaN(r)||o.setByCallBuckets(r),isNaN(n)||o.setTimePeriod(n*3600*1e3),this.specs.set(e,o)}}extendFilters(e){let r=this.selectGranularity(e),[n,o]=r.getCurrentAndUpComingValues(this.clock.now());return{newFilterSettings:e.withChange(Lsn,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(Lsn,s))}}};p();p();p();p();var mBt=new Map;async function cPo(t){if(mBt.has(t))return mBt.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return mBt.set(t,e),e}a(cPo,"getCachedHmacKey");async function lPo(t){if(t)try{let e=await cPo(t),r=Math.floor(Date.now()/1e3).toString(),n=new TextEncoder().encode(r),o=await crypto.subtle.sign("HMAC",e,n),c=Array.from(new Uint8Array(o)).map(l=>l.toString(16).padStart(2,"0")).join("");return`${r}.${c}`}catch{return}}a(lPo,"createRequestHMAC");async function Bsn(t,e){let r=await lPo(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(Bsn,"createMsBenchHmacHeaders");p();p();p();p();var hGe="4.13.1",YY="04b07795-8ddb-461a-bbee-02f9e1bf7b46",Fsn="common",pGe;(function(t){t.AzureChina="https://login.chinacloudapi.cn",t.AzureGermany="https://login.microsoftonline.de",t.AzureGovernment="https://login.microsoftonline.us",t.AzurePublicCloud="https://login.microsoftonline.com"})(pGe||(pGe={}));var FTe=pGe.AzurePublicCloud,Usn="login.microsoftonline.com",Qsn=["*"],qsn="cae",jsn="nocae",Hsn="msal.cache";var gBt;var uPo,mGe,$sn;function Vsn(){return mGe!==void 0&&$sn!==void 0}a(Vsn,"hasVSCodePlugin");function dPo(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(gBt===void 0)throw new Error(["Persistent token caching was requested, but no persistence provider was configured.","You must install the identity-cache-persistence plugin package (`npm install --save @azure/identity-cache-persistence`)","and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling","`useIdentityPlugin(cachePersistencePlugin)` before using `tokenCachePersistenceOptions`."].join(" "));let r=t.tokenCachePersistenceOptions.name||Hsn;e.cache.cachePlugin=gBt({name:`${r}.${jsn}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=gBt({name:`${r}.${qsn}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=pPo(t.isVSCodeCredential||!1)),e}a(dPo,"generatePluginConfiguration");var Gsn={missing:a((t,e,r)=>[`${t} was requested, but no plugin was configured or no authentication record was found.`,`You must install the ${e} plugin package (npm install --save ${e})`,"and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling",`useIdentityPlugin(${r}) before using enableBroker.`].join(" "),"missing"),unavailable:a((t,e)=>[`${t} was requested, and the plugin is configured, but the broker is unavailable.`,`Ensure the ${t} plugin is properly installed and configured.`,"Check for missing native dependencies and ensure the package is properly installed.",`See the README for prerequisites on installing and using ${e}.`].join(" "),"unavailable")},fPo={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return $sn}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return uPo}}};function pPo(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=fPo[t?"vsCode":"native"];if(o===void 0)throw new Error(Gsn.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error(Gsn.unavailable(e,r));return o.broker}a(pPo,"getBrokerPlugin");var Wsn={generatePluginConfiguration:dPo};p();p();p();function hPo(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(hPo,"isErrorResponse");var Ysn="CredentialUnavailableError",Fn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=Ysn}},gGe="AuthenticationError",bQ=class extends Error{static{a(this,"AuthenticationError")}statusCode;errorResponse;constructor(e,r,n){let o={error:"unknown",errorDescription:"An unknown error occurred and no additional details are available."};if(hPo(r))o=zsn(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=zsn(s)}catch{e===400?o={error:"invalid_request",errorDescription:`The service indicated that the request was invalid. +`?await U3.promises.rm(o):await U3.promises.writeFile(o,l,{encoding:"utf8",mode:384})}catch{}finally{s&&await s()}}async deleteSetting(r){let n=`${this.directory}/${r}.json`,o;try{o=await LTe.acquire(n),await U3.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await U3.promises.readdir(this.directory)).filter(n=>n.endsWith(".json")).map(n=>n.slice(0,-5))}catch{return[]}}async listKeys(r){return Object.keys(await this.readJsonObject(r))}async readAll(r){return await this.readJsonObject(r)}async readJsonObject(r){let n=`${this.directory}/${r}.json`;try{let o=await U3.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},LTe=class{static{a(this,"LockManager")}static{this.locks=new Map}static{this.DEFAULT_TIMEOUT_MS=1e4}static async acquire(e){await this.getLock(e);let r,n=new Promise(o=>{r=o});return this.locks.set(e,n),()=>Promise.resolve().then(()=>{r&&(r(),r=void 0,this.locks.get(e)===n&&this.locks.delete(e))})}static async getLock(e){let r=Date.now();for(;Date.now()-r{setTimeout(()=>{l(new Error("timeout"))},o)});try{await Promise.race([n,s])}catch{return}}}};function tPo(){if(vQ.env.XDG_CONFIG_HOME&&$ce.isAbsolute(vQ.env.XDG_CONFIG_HOME))return vQ.env.XDG_CONFIG_HOME+"/github-copilot";if((0,Gce.platform)()==="win32"){let e=vQ.env.USERPROFILE||uBt.homedir();return e?e+"\\AppData\\Local\\github-copilot":Csn()}let t=vQ.env.HOME&&vQ.env.HOME.length>0?vQ.env.HOME:uBt.homedir();return t?t+"/.config/github-copilot":Csn()}a(tPo,"getXdgConfigPath");var uBt={homedir:Gce.homedir,tmpdir:Gce.tmpdir};function Csn(){return $ce.join(uBt.tmpdir(),"github-copilot")}a(Csn,"tmpdirConfigPath");function bsn(){return new lBt(tPo())}a(bsn,"makeXdgPersistenceManager");p();var ks=class{static{a(this,"StatusReporter")}#e=0;#t="Normal";#r;#n;#i=!0;#o={category:"auth",kind:"Warning",message:"Not initialized",askToReSignin:!1,result:{status:"NotSignedIn"}};#s={category:"cls",kind:"Normal",inactive:!1};get busy(){return this.#e>0}trackCompletionJob(e){return this.#t==="Warning"&&this.forceNormalV1(),this.#s.kind==="Warning"&&this.forceNormalV2("cls",{inactive:!1}),this.#e++===0&&(this.#a(),this.#c("completion")),e().finally(()=>{--this.#e===0&&(this.#a(),this.#c("completion"))})}forceStatusV1(e,r,n){this.#t===e&&this.#r===r&&!n&&!this.#n&&!this.#i||(this.#t=e,this.#r=r,this.#n=n,this.#i=!1,this.#a())}forceStatusV2(e,r){e==="auth"?this.#o=r:this.#s=r,this.#c(e)}forceStatus(e,r,n){this.forceStatusV1(r.kind,r.message,n),this.forceStatusV2(e,r)}forceNormalV1(){this.#t!=="Inactive"&&this.forceStatusV1("Normal")}forceNormalV2(e,r){this.forceStatusV2(e,{...r,kind:"Normal",category:e})}forceNormal(e,r){this.forceNormalV1(),this.forceNormalV2(e,r)}setErrorV1(e,r){this.forceStatusV1("Error",e,r)}setErrorV2(e,r){let n=e==="auth"?this.#o:this.#s;this.forceStatusV2(e,{...n,...r,kind:"Error",category:e})}setError(e,r,n){this.setErrorV1(r.message,n),this.setErrorV2(e,r)}setWarningV1(e){this.#t!=="Error"&&this.forceStatusV1("Warning",e)}setWarningV2(e,r){let n=e==="auth"?this.#o:this.#s;n.kind!=="Error"&&this.forceStatusV2(e,{...n,...r,kind:"Warning",category:e})}setWarning(e,r){r?.message&&this.setWarningV1(r.message),this.setWarningV2(e,r)}setInactiveV1(e){this.#t==="Error"||this.#t==="Warning"||this.forceStatusV1("Inactive",e)}setClsInactiveV2(e){this.setInactiveV1(e),!(this.#s.kind==="Error"||this.#s.kind==="Warning")&&(this.#s.inactive&&this.#s.message===e||(this.#s={category:"cls",kind:"Normal",inactive:!0,message:e},this.#c("cls")))}setClsInactive(e){this.setInactiveV1(e),this.setClsInactiveV2(e)}clearInactiveV1(){this.#t==="Inactive"&&this.forceStatusV1("Normal")}clearClsInactiveV2(){this.#s.inactive&&(this.#s={category:"cls",kind:"Normal",inactive:!1},this.#c("cls"))}clearClsInactive(){this.clearInactiveV1(),this.clearClsInactiveV2()}sendInitNonAuthStatus(){this.didChangeV2({statuses:[this.#s,{category:"completion",busy:this.busy}]})}#a(){let e={kind:this.#t,message:this.#r,busy:this.busy,command:this.#n};this.didChangeV1(e)}#c(e){let r=this.#u(e);this.didChangeV2({statuses:[r]})}#u(e){switch(e){case"completion":return{category:"completion",busy:this.#e>0};case"auth":return this.#o;case"cls":return this.#s}}},iGe=class extends ks{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var Ssn={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function Tsn(t,e){sr(t,Ssn.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(Tsn,"telemetryAuthPickerListed");function dBt(t,e){sr(t,Ssn.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a(dBt,"telemetryAuthPickerUsed");p();var CQ={StoreInitialize:"auth.store.initialize",StoreError:"auth.store.error",StoreMigration:"auth.store.migration",SessionActivated:"auth.session.activated",SessionDeactivated:"auth.session.deactivated",TokenRevoked:"auth.token.revoked",EncryptionInitialize:"auth.encryption.initialize"};function Isn(t,e){Hs(t,CQ.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs}),ft(t,CQ.StoreInitialize)}a(Isn,"telemetryAuthStoreInitialize");function xsn(t,e){Hs(t,CQ.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(xsn,"telemetryAuthStoreError");function wsn(t,e){Hs(t,CQ.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a(wsn,"telemetryAuthStoreMigration");function fBt(t,e){let r={editorId:e.editorId,trigger:e.trigger};e.crossEditorReuse!==void 0&&(r.crossEditorReuse=String(e.crossEditorReuse)),e.tokenRewrite!==void 0&&(r.tokenRewrite=String(e.tokenRewrite)),sr(t,CQ.SessionActivated,r,{durationMs:e.durationMs})}a(fBt,"telemetryAuthSessionActivated");function Rsn(t,e){sr(t,CQ.SessionDeactivated,{editorId:e.editorId})}a(Rsn,"telemetryAuthSessionDeactivated");function oGe(t,e){sr(t,CQ.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(oGe,"telemetryAuthTokenRevoked");function sGe(t,e){Hs(t,CQ.EncryptionInitialize,e.diagnostics.error,{writerKind:e.writerKind,available:String(e.diagnostics.available),errorPhase:e.diagnostics.errorPhase??"",masterKeySource:e.diagnostics.masterKeySource??""})}a(sGe,"telemetryAuthEncryptionInitialize");var rPo="apps",ksn="hosts",zd=new pe("AuthManager"),Psn="legacy_files_migration_done",nPo=5,iPo=6e4,Or=class{constructor(e,r){this.ctx=e;this.env=r}static{a(this,"AuthManager")}hasTransientSession(){return this.transientSession!==void 0}get _copilotTokenManager(){return this.ctx.get(Qt)}getConfiguredUrls(){return this.ctx.get(og).getConfiguredUrls()}async checkAndUpdateStatus(e){let r=e?.localChecksOnly??!1,n=e?.githubAppId!==void 0?await this.resolvePersistedSession(e):await this.resolveSession(e?.authAuthority);return n===void 0?(this._copilotTokenManager.resetToken("session_not_found"),zd.info(this.ctx,"checkAndUpdateStatus: no session found, priming token"),await this._copilotTokenManager.primeToken(),{status:"NotSignedIn"}):r?(this.ctx.get(ks).forceNormalV2("auth",{result:{status:"MaybeOK",user:n.login}}),{status:"MaybeOK",user:n.login}):(e?.forceRefresh&&this._copilotTokenManager.resetToken("force_refresh"),{status:await cBt(this.ctx,n,e?.freshSignIn??!1),user:n.login})}getAuthSourceEnvVar(){return cGe(this.env).sourceEnvVar}async resolveSession(e){await this.ctx.get(Qo).requireReady();let{session:r,sourceEnvVar:n}=cGe(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),zd.info(this.ctx,`resolveSession: resolved from env var ${n}`),{...r,...a_(r)};let o=await this.transientSession;if(o){if(o.accessToken===void 0){zd.info(this.ctx,"resolveSession: transient session is a shadow, no session");return}return zd.info(this.ctx,"resolveSession: resolved from transient session"),{...o,...a_(o)}}let s=await this.resolvePersistedSession({authAuthority:e});return zd.info(this.ctx,`resolveSession: persisted store ${s?"resolved a session":"returned no session"}`),s}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},aGe=class extends Or{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(QM)}async tracked(r,n){try{return await n()}catch(o){throw zd.exception(this.ctx,o,`authStore.${r}`),xsn(this.ctx,{editorId:this.editorId(),op:r,error:o}),o}}editorId(){return this.cachedEditorId===void 0&&(this.cachedEditorId=this.ctx.get(Ir).getEditorIdentity().editorId),this.cachedEditorId}tokenRecordToSession(r){let n;try{n=b7(this.ctx,r.authAuthority)}catch(o){zd.warn(this.ctx,"tokenRecordToSession: dropping record with unparseable authAuthority",o);return}return{serverUrl:n.serverUrl,apiUrl:n.apiUrl,accessToken:r.accessToken,login:r.user,githubAppId:r.oauthClientId||void 0,scopes:sPo(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(Psn))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(Un),h=this.editorId(),[m,g]=await Promise.all([f.readAll(rPo).catch(()=>({})),f.readAll(ksn).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let _=Dsn(y);if(!_){c++;continue}let[E,v]=oPo(A)??["github.com",Vce],S=_.oauth_token||_.access_token,T=_.user||_.login;if(!S||!T){c++;continue}let w=_.authAuthority||E;if(!wOt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:S,authAuthority:w,oauthClientId:_.githubAppId??v,scopes:pBt(_.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let _=Dsn(y);if(!_){c++;continue}let E=_.oauth_token||_.access_token,v=_.user||_.login;if(!E||!v){c++;continue}let S=_.authAuthority||A;if(!wOt(S)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:E,authAuthority:S,oauthClientId:_.githubAppId??Vce,scopes:pBt(_.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(Psn,String(Date.now())))}catch{}this.ctx.get(Un).deleteSetting(ksn).catch(()=>{}),wsn(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),zd.info(this.ctx,`runSqliteMigration: outcome=${l} apps=${o} hosts=${s} skipped=${c}`)}}tryAutoAdoptCoalesced(){return this.autoAdoptPromise||(this.autoAdoptPromise=this.tryAutoAdopt().finally(()=>{this.autoAdoptPromise=void 0})),this.autoAdoptPromise}async tryAutoAdopt(){let r=this.authRepository,n=this.editorId(),o=Date.now(),s=await r.listTokensByRecency(nPo);if(zd.debug(this.ctx,`tryAutoAdopt: editorId=${n} candidates=${s.length}`),s.length===0)return;let c=this.ctx.get($h);for(let l of s){let u=this.tokenRecordToSession(l.record);if(!u){zd.info(this.ctx,`tryAutoAdopt: dropping corrupt-authority tokenId=${l.tokenId}; continuing walk`),await this.revokeTokenById(l.tokenId,"corrupt_authority");continue}let d;try{d=await c.fetchTokenResult(this.ctx,u)}catch{zd.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${l.tokenId}; aborting walk`);return}if(d.copilotToken||d.failureKind==="NotAuthorized"){zd.info(this.ctx,`tryAutoAdopt: adopting tokenId=${l.tokenId} crossEditor=${l.sourceEditorId!==n} noCopilotAccess=${d.failureKind==="NotAuthorized"}`);try{await this.tracked("assign",()=>r.assignActiveSession(n,l.tokenId))}catch(f){zd.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${l.tokenId} (${f?.message??f}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(l.tokenId),fBt(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:l.sourceEditorId!==n,durationMs:Date.now()-o}),u}if(d.failureKind==="HTTP401"){zd.info(this.ctx,`tryAutoAdopt: skipping invalid tokenId=${l.tokenId} (not revoking); continuing walk`);continue}zd.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${l.tokenId} kind=${d.failureKind}; aborting walk`);return}zd.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new Ei("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new Ei("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();zd.debug(this.ctx,`signInEditor: editorId=${n} authority=${r.authAuthority} appId=${r.githubAppId??""}`);let s=await this.tracked("upsert",()=>this.authRepository.upsertTokenAndAssign(n,{user:r.user,accessToken:r.accessToken,authAuthority:r.authAuthority,oauthClientId:r.githubAppId??"",scopes:pBt(r.scopes)}));zd.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),fBt(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=b7(this.ctx,r.authAuthority);return this.setTransientSession({login:r.user,accessToken:r.accessToken,githubAppId:r.githubAppId,serverUrl:c.serverUrl,apiUrl:c.apiUrl}),this._copilotTokenManager.setActiveTokenId(s.tokenId),await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:r.authAuthority})}async signOutEditor(){let r=this.editorId();return zd.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),Rsn(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){zd.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return zd.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),oGe(this.ctx,{editorId:this.editorId(),trigger:n??"unknown",affectedEditors:o.affectedEditors}),this._copilotTokenManager.resetToken("token_revoked",void 0,r),this._copilotTokenManager.getActiveTokenId()===r&&(this._copilotTokenManager.setActiveTokenId(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})),o}async useExistingToken(r){let n=this.authRepository,o=this.editorId(),s=await n.getTokenById(r);if(!s)return dBt(this.ctx,{editorId:o,status:"revoked",clearedTombstone:!1,crossEditorReuse:!1,validationMs:0}),{status:"revoked"};let c=s.sourceEditorId!==o,l=await n.hasOptOutTombstone(o);this.setTransientSession(void 0),await n.assignActiveSession(o,r),this._copilotTokenManager.setActiveTokenId(r);let u=performance.now(),d,f=!1;try{d=(await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:s.record.authAuthority})).status}catch{f=!0,d="NotSignedIn"}let h;switch(d){case"OK":h="ok";break;case"NotAuthorized":h="not_entitled";break;default:h=f?"transient":"revoked";break}return dBt(this.ctx,{editorId:o,status:h,clearedTombstone:l,crossEditorReuse:c,validationMs:performance.now()-u}),{status:h}}async listAvailableTokens(){await this.ensureSqliteMigration();let r=this.authRepository,n=this.editorId(),o=await r.listAvailableTokens(),s=await r.getActiveSession(n),c=o.map(d=>({tokenId:d.tokenId,authAuthority:d.authAuthority,userLogin:d.userLogin,isCurrent:s?.tokenId===d.tokenId,lastUsedAt:d.lastUsedAt})),l=c.some(d=>d.isCurrent),u=await r.hasOptOutTombstone(n);return Tsn(this.ctx,{editorId:n,candidateCount:c.length,hasCurrentSession:l,hasOptOutTombstone:u}),c}async resolvePersistedSession(r){await this.ensureSqliteMigration();let n=this.authRepository,o=this.editorId(),s=this.ctx.get(Nn).getCapabilities().accountPickerEnabled,c=await n.hasOptOutTombstone(o),l=await n.getActiveSession(o),u=!l&&!s&&!c;if(u&&(await this.tryAutoAdoptCoalesced(),l=await n.getActiveSession(o)),!l){zd.info(this.ctx,`resolvePersistedSession: no active session editorId=${o} pickerEnabled=${s} optedOut=${c} autoAdoptAttempted=${u}`);return}let d=b7(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==d.authAuthority){zd.info(this.ctx,`resolvePersistedSession: active session authority mismatch editorId=${o}`);return}if(r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId){zd.info(this.ctx,`resolvePersistedSession: active session appId mismatch editorId=${o}`);return}let f=this.tokenRecordToSession(l.record);if(!f){await this.revokeTokenById(l.tokenId,"corrupt_authority");return}this._copilotTokenManager.setActiveTokenId(l.tokenId);let h=Date.now();return h-this.lastTouchAt>=iPo&&(this.lastTouchAt=h,n.touchActiveSession(o).catch(()=>{})),f}};function oPo(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(oPo,"splitAppsKey");function sPo(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(sPo,"normalizeScopes");function pBt(t){return t?typeof t=="string"?t:t.join(" "):""}a(pBt,"scopesToString");function Dsn(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(Dsn,"asLegacyAuthRecord");function cGe(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...a_({apiUrl:t.GH_COPILOT_API_URL,serverUrl:t.GH_COPILOT_SERVER_URL}),login:t.GH_COPILOT_USER||"",accessToken:t.GH_COPILOT_TOKEN},sourceEnvVar:"GH_COPILOT_TOKEN"}:t.GITHUB_COPILOT_TOKEN?{session:{...a_({apiUrl:t.GITHUB_COPILOT_API_URL,serverUrl:t.GITHUB_COPILOT_SERVER_URL}),login:t.GITHUB_COPILOT_USER||"",accessToken:t.GITHUB_COPILOT_TOKEN},sourceEnvVar:"GITHUB_COPILOT_TOKEN"}:t.CODESPACES==="true"&&t.GITHUB_TOKEN?{session:{...a_({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(cGe,"getSessionFromEnv");p();var aPo=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],Nsn="Your proxy connection requires a trusted certificate. Please make sure the proxy certificate and any issuers are configured correctly and trusted by your operating system.",Msn="https://gh.io/copilot-network-errors",jC=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&aPo.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new pe("certificates").error(e,`${Nsn} Please visit ${Msn} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(ss).showWarningMessage(Nsn,n).then(o=>{if(o?.title===n.title)return e.get(sg).open(Msn)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};var hBt=class extends Ei{constructor(r){super("message"in r?r.message:`${r.failureKind}`);this.result=r}static{a(this,"TokenResultError")}},Qt=class{constructor(e,r=!1){this.ctx=e;this.primed=r;this.lastToken=void 0;this.activeToken=void 0;this.activeTokenId=void 0;this.tokenPromise=void 0;this.tokenPrimingError=void 0;this.didChangeTokenResult=new Ji;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new Ji;this.onDidResetToken=this.didResetToken.event}static{a(this,"CopilotTokenManager")}async getGitHubSession(){return await this.ctx.get(Or).resolveSession()}primeToken(){if(this.tokenPrimingError)return Promise.reject(this.tokenPrimingError);this.primed=!0;try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async fetchTokenResult(e){return await this.ctx.get($h).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e}async getTokenResult(){if(!this.primed){let r=new Error("Token requested before initialization");if(Osn(this.ctx))throw this.tokenPrimingError=r,r;DC.exception(this.ctx,r,".getToken")}if(this.activeToken!==void 0&&!this.activeToken.needsRefresh())return{copilotToken:this.activeToken};if(!this.tokenPromise){let r,n=this.captureFetchContext(),o=this.getGitHubSession().then(async s=>s?(r=s.login,await this.fetchTokenResult(s)):{failureKind:"NotSignedIn"}).catch(s=>{if(!(s instanceof Error))throw s;return{failureKind:"Exception",message:String(s),exception:s}}).then(s=>(this.tokenPromise!==o||(this.tokenPromise=void 0,this.handleTokenResult(s,r,n)),s));this.tokenPromise=o}return await this.tokenPromise}handleTokenResult(e,r,n){let o=this.ctx.get(ks);switch(e.failureKind){case"NotSignedIn":o.setError("auth",{message:"You are not signed into GitHub.",askToReSignin:!1,result:{status:"NotSignedIn",user:r}});break;case"HTTP401":o.setError("auth",{message:"Your GitHub Copilot session has expired. You have been signed out. Please sign in again to continue using GitHub Copilot.",askToReSignin:!0,result:{status:"NotSignedIn",user:r}},{command:"github.copilot.signIn",title:"Sign In"});break;case"NotAuthorized":o.setError("auth",{message:e.message,askToReSignin:!1,result:{status:"NotAuthorized",user:r??""}});break;case"Exception":o.setWarning("auth",{message:e.message,askToReSignin:!1}),this.ctx.get(jC).notifyUser(this.ctx,e.exception);break;case void 0:o.forceNormal("auth",{result:{status:"OK",user:r??""}}),this.setToken(e.copilotToken)}this.didChangeTokenResult.fire(e);let s={result:e.copilotToken?"success":"failure",errorCode:e.failureKind??"",trigger:n?.trigger??"unknown",editorPreviewEnabled:e.copilotToken?e.copilotToken.getTokenValue("editor_preview_features")==="0"?"false":"true":""},c=v7(),l={previousRemainingLifetime:n?.previousRemainingLifetime??-1,previousUnadjustedRemainingLifetime:n?.previousUnadjustedRemainingLifetime??-1,newRefreshIn:e.copilotToken?.envelope.refresh_in??-1,newRemainingLifetime:e.copilotToken?e.copilotToken.expiresAt-c:-1,newUnadjustedRemainingLifetime:e.copilotToken?e.copilotToken.envelope.expires_at-c:-1};"exception"in e&&e.exception?Hs(this.ctx,"auth.token_reset_complete",e.exception,s,l):sr(this.ctx,"auth.token_reset_complete",s,l)}captureFetchContext(){let e=this.activeToken??this.lastToken,r=this.lastToken===void 0?"initial":this.activeToken===void 0?"after_reset":"expiry",n=v7(),o=e?e.expiresAt-n:-1,s=e?e.envelope.expires_at-n:-1;return{trigger:r,previousRemainingLifetime:o,previousUnadjustedRemainingLifetime:s}}async getToken(){let e=await this.getTokenResult();if(e.copilotToken)return e.copilotToken;throw e.exception?e.exception:new hBt(e)}setActiveTokenId(e){if(this.activeTokenId===e)return;let r=this.activeTokenId;this.activeTokenId=e,r!==void 0&&this.activeToken&&this.resetToken("active_token_id_changed")}getActiveTokenId(){return this.activeTokenId}resetToken(e,r,n){if(n!==void 0&&this.activeTokenId!==void 0&&n!==this.activeTokenId){DC.debug(this.ctx,`Skipping token reset from ${e} for tokenId ${n} because activeTokenId is ${this.activeTokenId}`);return}if(r!==void 0?(ft(this.ctx,"auth.reset_token_"+r),DC.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):DC.debug(this.ctx,`Resetting copilot token (caller: ${e})`),!this.activeToken&&!this.tokenPromise)return;let o=v7(),s=this.activeToken?this.activeToken.expiresAt-o:-1,c=this.activeToken?this.activeToken.envelope.expires_at-o:-1;sr(this.ctx,"auth.token_reset_trigger",{caller:e,httpStatus:r!==void 0?String(r):"",hadActiveToken:String(!!this.activeToken),hadPendingRefresh:String(!!this.tokenPromise)},{remainingLifetime:s,unadjustedRemainingLifetime:c}),this.activeToken=void 0,this.tokenPromise=void 0,this.didResetToken.fire()}getLastToken(){return this.lastToken}};function Dx(t){return t.get(Qt).getLastToken()}a(Dx,"getLastCopilotToken");p();var HC=class{static{a(this,"Clock")}now(){return new Date}};p();var qP=class{static{a(this,"ExpConfigMaker")}},cPo=5e3,lPo=2e3,BTe=class extends qP{constructor(r={}){super();this.defaultFilters=r}static{a(this,"ExpConfigFromTAS")}async fetchExperiments(r,n,o){let s=Object.keys(o).length===0?this.defaultFilters:o,c=new URL("telemetry",n.telemetry).href,l=await this.fetchOnce(r,c,s,cPo);return l.kind==="failure"&&l.retryable&&(l=await this.fetchOnce(r,c,s,lPo)),l.kind==="failure"?px.createFallbackConfig(r,l.reason):l.config}async fetchOnce(r,n,o,s){let c=r.get(Jt),l;try{l=await c.fetch(n,{method:"GET",headers:o,timeout:s})}catch(h){return{kind:"failure",reason:`Error fetching ExP config: ${String(h)}`,retryable:!0}}if(!l.ok){let h=l.status>=500||l.status===429;return{kind:"failure",reason:`ExP responded with ${l.status}`,retryable:h}}let u;try{u=await l.json()}catch(h){if(h instanceof SyntaxError)return Ma(r,h,"fetchExperiments"),{kind:"failure",reason:"ExP responded with invalid JSON",retryable:!1};throw h}let d=u.Configs.find(h=>h.Id==="vscode")??{Id:"vscode",Parameters:{}},f=Object.entries(d.Parameters).map(([h,m])=>h+(m?"":"cf"));return{kind:"success",config:new px(d.Parameters,u.AssignmentContext,f.join(";"))}}},lGe=class extends qP{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(px.createEmptyConfig())}};p();p();var uGe=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},mBt=class extends uGe{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},Lsn=a(t=>new mBt(t),"DEFAULT_GRANULARITY"),dGe=class extends uGe{constructor(r,n=.5,o=new Date().setUTCHours(0,0,0,0)){super(r);this.prefix=r;this.fetchBeforeFactor=n;this.anchor=o}static{a(this,"TimeBucketGranularity")}setTimePeriod(r){isNaN(r)?this.timePeriodLengthMs=void 0:this.timePeriodLengthMs=r}setByCallBuckets(r){isNaN(r)?this.numByCallBuckets=void 0:this.numByCallBuckets=r}getValue(r){return this.prefix+this.getTimePeriodBucketString(r)+(this.numByCallBuckets?this.timeHash(r):"")}getTimePeriodBucketString(r){return this.timePeriodLengthMs?this.dateToTimePartString(r):""}getUpcomingValues(r){let n=[],o=this.getUpcomingTimePeriodBucketStrings(r),s=this.getUpcomingByCallBucketStrings();for(let c of o)for(let l of s)n.push(this.prefix+c+l);return n}getUpcomingTimePeriodBucketStrings(r){if(this.timePeriodLengthMs===void 0)return[""];if((r.getTime()-this.anchor)%this.timePeriodLengthMsr.toString())}timeHash(r){return this.numByCallBuckets==null?0:7883*(r.getTime()%this.numByCallBuckets)%this.numByCallBuckets}dateToTimePartString(r){return this.timePeriodLengthMs==null?"":Math.floor((r.getTime()-this.anchor)/this.timePeriodLengthMs).toString()}};var Bsn="X-Copilot-ClientTimeBucket",fGe=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=Lsn(e)}static{a(this,"GranularityDirectory")}selectGranularity(e){for(let[r,n]of this.specs.entries())if(e.extends(r))return n;return this.defaultGranularity}update(e,r,n){if(r=r>1?r:NaN,n=n>0?n:NaN,isNaN(r)&&isNaN(n))this.specs.delete(e);else{let o=new dGe(this.prefix);isNaN(r)||o.setByCallBuckets(r),isNaN(n)||o.setTimePeriod(n*3600*1e3),this.specs.set(e,o)}}extendFilters(e){let r=this.selectGranularity(e),[n,o]=r.getCurrentAndUpComingValues(this.clock.now());return{newFilterSettings:e.withChange(Bsn,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(Bsn,s))}}};p();p();p();p();var gBt=new Map;async function uPo(t){if(gBt.has(t))return gBt.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return gBt.set(t,e),e}a(uPo,"getCachedHmacKey");async function dPo(t){if(t)try{let e=await uPo(t),r=Math.floor(Date.now()/1e3).toString(),n=new TextEncoder().encode(r),o=await crypto.subtle.sign("HMAC",e,n),c=Array.from(new Uint8Array(o)).map(l=>l.toString(16).padStart(2,"0")).join("");return`${r}.${c}`}catch{return}}a(dPo,"createRequestHMAC");async function Fsn(t,e){let r=await dPo(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(Fsn,"createMsBenchHmacHeaders");p();p();p();p();var hGe="4.13.1",KY="04b07795-8ddb-461a-bbee-02f9e1bf7b46",Usn="common",pGe;(function(t){t.AzureChina="https://login.chinacloudapi.cn",t.AzureGermany="https://login.microsoftonline.de",t.AzureGovernment="https://login.microsoftonline.us",t.AzurePublicCloud="https://login.microsoftonline.com"})(pGe||(pGe={}));var FTe=pGe.AzurePublicCloud,Qsn="login.microsoftonline.com",qsn=["*"],jsn="cae",Hsn="nocae",Gsn="msal.cache";var ABt;var fPo,mGe,Vsn;function Wsn(){return mGe!==void 0&&Vsn!==void 0}a(Wsn,"hasVSCodePlugin");function pPo(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(ABt===void 0)throw new Error(["Persistent token caching was requested, but no persistence provider was configured.","You must install the identity-cache-persistence plugin package (`npm install --save @azure/identity-cache-persistence`)","and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling","`useIdentityPlugin(cachePersistencePlugin)` before using `tokenCachePersistenceOptions`."].join(" "));let r=t.tokenCachePersistenceOptions.name||Gsn;e.cache.cachePlugin=ABt({name:`${r}.${Hsn}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=ABt({name:`${r}.${jsn}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=mPo(t.isVSCodeCredential||!1)),e}a(pPo,"generatePluginConfiguration");var $sn={missing:a((t,e,r)=>[`${t} was requested, but no plugin was configured or no authentication record was found.`,`You must install the ${e} plugin package (npm install --save ${e})`,"and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling",`useIdentityPlugin(${r}) before using enableBroker.`].join(" "),"missing"),unavailable:a((t,e)=>[`${t} was requested, and the plugin is configured, but the broker is unavailable.`,`Ensure the ${t} plugin is properly installed and configured.`,"Check for missing native dependencies and ensure the package is properly installed.",`See the README for prerequisites on installing and using ${e}.`].join(" "),"unavailable")},hPo={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return Vsn}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return fPo}}};function mPo(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=hPo[t?"vsCode":"native"];if(o===void 0)throw new Error($sn.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error($sn.unavailable(e,r));return o.broker}a(mPo,"getBrokerPlugin");var zsn={generatePluginConfiguration:pPo};p();p();p();function gPo(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(gPo,"isErrorResponse");var Ksn="CredentialUnavailableError",Fn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=Ksn}},gGe="AuthenticationError",bQ=class extends Error{static{a(this,"AuthenticationError")}statusCode;errorResponse;constructor(e,r,n){let o={error:"unknown",errorDescription:"An unknown error occurred and no additional details are available."};if(gPo(r))o=Ysn(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=Ysn(s)}catch{e===400?o={error:"invalid_request",errorDescription:`The service indicated that the request was invalid. ${r}`}:o={error:"unknown_error",errorDescription:`An unknown error has occurred. Response body: ${r}`}}else o={error:"unknown_error",errorDescription:"An unknown error occurred and no additional details are available."};super(`${o.error} Status code: ${e} More details: -${o.errorDescription},`,n),this.statusCode=e,this.errorResponse=o,this.name=gGe}},Ksn="AggregateAuthenticationError",UTe=class extends Error{static{a(this,"AggregateAuthenticationError")}errors;constructor(e,r){let n=e.join(` +${o.errorDescription},`,n),this.statusCode=e,this.errorResponse=o,this.name=gGe}},Jsn="AggregateAuthenticationError",UTe=class extends Error{static{a(this,"AggregateAuthenticationError")}errors;constructor(e,r){let n=e.join(` `);super(`${r} -${n}`),this.errors=e,this.name=Ksn}};function zsn(t){return{error:t.error,errorDescription:t.error_description,correlationId:t.correlation_id,errorCodes:t.error_codes,timestamp:t.timestamp,traceId:t.trace_id}}a(zsn,"convertOAuthErrorResponseToErrorResponse");var Kx=class extends Error{static{a(this,"AuthenticationRequiredError")}scopes;getTokenOptions;constructor(e){super(e.message,e.cause?{cause:e.cause}:void 0),this.scopes=e.scopes,this.getTokenOptions=e.getTokenOptions,this.name="AuthenticationRequiredError"}};p();p();p();p();var Jsn=require("node:os"),Zsn=fe(require("node:util"),1),Xsn=fe(require("node:process"),1);function ean(t,...e){Xsn.stderr.write(`${Zsn.default.format(t,...e)}${Jsn.EOL}`)}a(ean,"log");var tan=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,ran,ABt=[],yBt=[],AGe=[];tan&&_Bt(tan);var nan=Object.assign(t=>ian(t),{enable:_Bt,enabled:EBt,disable:mPo,log:ean});function _Bt(t){ran=t,ABt=[],yBt=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?yBt.push(new RegExp(`^${n.substr(1)}$`)):ABt.push(new RegExp(`^${n}$`));for(let n of AGe)n.enabled=EBt(n.namespace)}a(_Bt,"enable");function EBt(t){if(t.endsWith("*"))return!0;for(let e of yBt)if(e.test(t))return!1;for(let e of ABt)if(e.test(t))return!0;return!1}a(EBt,"enabled");function mPo(){let t=ran||"";return _Bt(""),t}a(mPo,"disable");function ian(t){let e=Object.assign(r,{enabled:EBt(t),destroy:gPo,log:nan.log,namespace:t,extend:APo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),AGe.push(e),e}a(ian,"createDebugger");function gPo(){let t=AGe.indexOf(this);return t>=0?(AGe.splice(t,1),!0):!1}a(gPo,"destroy");function APo(t){let e=ian(`${this.namespace}:${t}`);return e.log=this.log,e}a(APo,"extend");var Vce=nan;var san=new Set,yGe=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,EGe,vBt=Vce("azure");vBt.log=(...t)=>{Vce.log(...t)};var CBt=["verbose","info","warning","error"];yGe&&(lan(yGe)?yPo(yGe):console.error(`AZURE_LOG_LEVEL set to unknown log level '${yGe}'; logging is not enabled. Acceptable values: ${CBt.join(", ")}.`));function yPo(t){if(t&&!lan(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${CBt.join(",")}`);EGe=t;let e=[];for(let r of san)can(r)&&e.push(r.namespace);Vce.enable(e.join(","))}a(yPo,"setLogLevel");function vGe(){return EGe}a(vGe,"getLogLevel");var oan={verbose:400,info:300,warning:200,error:100};function SQ(t){let e=vBt.extend(t);return aan(vBt,e),{error:_Ge(e,"error"),warning:_Ge(e,"warning"),info:_Ge(e,"info"),verbose:_Ge(e,"verbose")}}a(SQ,"createClientLogger");function aan(t,e){e.log=(...r)=>{t.log(...r)}}a(aan,"patchLogMethod");function _Ge(t,e){let r=Object.assign(t.extend(e),{level:e});if(aan(t,r),can(r)){let n=Vce.disable();Vce.enable(n+","+r.namespace)}return san.add(r),r}a(_Ge,"createLogger");function can(t){return!!(EGe&&oan[t.level]<=oan[EGe])}a(can,"shouldEnable");function lan(t){return CBt.includes(t)}a(lan,"isAzureLogLevel");var U1=SQ("identity");function CGe(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(CGe,"processEnvVars");function pg(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(pg,"formatSuccess");function $s(t,e){let r="ERROR.";return t?.length&&(r+=` Scopes: ${Array.isArray(t)?t.join(", "):t}.`),`${r} Error message: ${typeof e=="string"?e:e.message}.`}a($s,"formatError");function uan(t,e,r=U1){let n=e?`${e.fullTitle} ${t}`:t;function o(u){r.info(`${n} =>`,u)}a(o,"info");function s(u){r.warning(`${n} =>`,u)}a(s,"warning");function c(u){r.verbose(`${n} =>`,u)}a(c,"verbose");function l(u){r.error(`${n} =>`,u)}return a(l,"error"),{title:t,fullTitle:n,info:o,warning:s,verbose:c,error:l}}a(uan,"credentialLoggerInstance");function fo(t,e=U1){let r=uan(t,void 0,e);return{...r,parent:e,getToken:uan("=> getToken()",r,e)}}a(fo,"credentialLogger");p();p();p();p();var Wce={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function dan(t={}){let e=new bBt(t.parentContext);return t.span&&(e=e.setValue(Wce.span,t.span)),t.namespace&&(e=e.setValue(Wce.namespace,t.namespace)),e}a(dan,"createTracingContext");var bBt=class t{static{a(this,"TracingContextImpl")}constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,r){let n=new t(this);return n._contextMap.set(e,r),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let r=new t(this);return r._contextMap.delete(e),r}};p();var fan=fe(SBt(),1),SGe=fan.state;function _Po(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(_Po,"createDefaultTracingSpan");function EPo(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:_Po(),tracingContext:dan({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(EPo,"createDefaultInstrumenter");function QTe(){return SGe.instrumenterImplementation||(SGe.instrumenterImplementation=EPo()),SGe.instrumenterImplementation}a(QTe,"getInstrumenter");p();function qTe(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=QTe().startSpan(d,Object.assign(Object.assign({},h),{packageName:r,packageVersion:n,tracingContext:(m=f?.tracingOptions)===null||m===void 0?void 0:m.tracingContext})),A=g.tracingContext,y=g.span;A.getValue(Wce.namespace)||(A=A.setValue(Wce.namespace,e)),y.setAttribute("az.namespace",A.getValue(Wce.namespace));let _=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:_}}a(o,"startSpan");async function s(d,f,h,m){let{span:g,updatedOptions:A}=o(d,f,m);try{let y=await c(A.tracingOptions.tracingContext,()=>Promise.resolve(h(A,g)));return g.setStatus({status:"success"}),y}catch(y){throw g.setStatus({status:"error",error:y}),y}finally{g.end()}}a(s,"withSpan");function c(d,f,...h){return QTe().withContext(d,f,...h)}a(c,"withContext");function l(d){return QTe().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return QTe().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(qTe,"createTracingClient");var Vc=qTe({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:hGe});var TBt=fo("ChainedTokenCredential"),jTe=class{static{a(this,"ChainedTokenCredential")}_sources=[];constructor(...e){this._sources=e}async getToken(e,r={}){let{token:n}=await this.getTokenInternal(e,r);return n}async getTokenInternal(e,r={}){let n=null,o,s=[];return Vc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new UTe(s,"ChainedTokenCredential authentication failed.");throw TBt.getToken.info($s(e,l)),l}if(TBt.getToken.info(`Result for ${o.constructor.name}: ${pg(e)}`),n===null)throw new Fn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var $1={};Ti($1,{AuthError:()=>jo,AuthErrorCodes:()=>hle,AzureCloudInstance:()=>H3,ClientAssertion:()=>W3,ClientAuthError:()=>wQ,ClientAuthErrorCodes:()=>th,ClientConfigurationError:()=>tle,ClientConfigurationErrorCodes:()=>nle,ConfidentialClientApplication:()=>Ple,CryptoProvider:()=>vO,DistributedCachePlugin:()=>cVe,InteractionRequiredAuthError:()=>j1,InteractionRequiredAuthErrorCodes:()=>o$e,LogLevel:()=>If,Logger:()=>mg,ManagedIdentityApplication:()=>Dle,ManagedIdentitySourceNames:()=>ao,PromptValue:()=>pBo,ProtocolMode:()=>m_,PublicClientApplication:()=>Rle,ResponseMode:()=>hBo,ServerError:()=>VE,TokenCache:()=>Ale,TokenCacheContext:()=>Q1,internals:()=>ZFt,version:()=>G1});p();var ZFt={};Ti(ZFt,{Deserializer:()=>V3,Serializer:()=>TQ});p();p();var TQ=class{static{a(this,"Serializer")}static serializeJSONBlob(e){return JSON.stringify(e)}static serializeAccounts(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,realm:o.realm,local_account_id:o.localAccountId,username:o.username,authority_type:o.authorityType,name:o.name,client_info:o.clientInfo,last_modification_time:o.lastModificationTime,last_modification_app:o.lastModificationApp,tenantProfiles:o.tenantProfiles?.map(s=>JSON.stringify(s))}}),r}static serializeIdTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm}}),r}static serializeAccessTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm,target:o.target,cached_at:o.cachedAt,expires_on:o.expiresOn,extended_expires_on:o.extendedExpiresOn,refresh_on:o.refreshOn,key_id:o.keyId,token_type:o.tokenType,userAssertionHash:o.userAssertionHash,resource:o.resource}}),r}static serializeRefreshTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,family_id:o.familyId,target:o.target,realm:o.realm}}),r}static serializeAppMetadata(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={client_id:o.clientId,environment:o.environment,family_id:o.familyId}}),r}static serializeAllCache(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}}};p();p();p();var dn={};Ti(dn,{addApplicationTelemetry:()=>rIe,addAuthorizationCode:()=>IFt,addBrokerParameters:()=>j3,addCcsOid:()=>Q3,addCcsUpn:()=>RQ,addClaims:()=>sK,addCliData:()=>RFt,addClientAssertion:()=>oIe,addClientAssertionType:()=>sIe,addClientCapabilitiesToClaims:()=>Aan,addClientId:()=>iK,addClientInfo:()=>cK,addClientSecret:()=>iIe,addCodeChallengeParams:()=>I2o,addCodeVerifier:()=>wFt,addCorrelationId:()=>aK,addDeviceCode:()=>x2o,addDomainHint:()=>bFt,addEARParameters:()=>D2o,addExtraParameters:()=>q3,addGrantType:()=>aIe,addIdTokenHint:()=>CFt,addInstanceAware:()=>cIe,addLibraryInfo:()=>tIe,addLoginHint:()=>ole,addLogoutHint:()=>kFt,addNativeBroker:()=>T2o,addNonce:()=>TFt,addOboAssertion:()=>w2o,addPassword:()=>P2o,addPopToken:()=>lIe,addPostLogoutRedirectUri:()=>vFt,addPrompt:()=>SFt,addRedirectUri:()=>oK,addRefreshToken:()=>xFt,addRequestTokenUse:()=>R2o,addResource:()=>pIe,addResponseMode:()=>EFt,addResponseType:()=>S2o,addScopes:()=>nK,addServerTelemetry:()=>dIe,addSid:()=>zGe,addSshJwk:()=>uIe,addState:()=>nIe,addThrottling:()=>fIe,addUsername:()=>k2o,instrumentBrokerParams:()=>rK});p();var rr={};Ti(rr,{AADAuthority:()=>jP,AAD_INSTANCE_DISCOVERY_ENDPT:()=>kBt,AAD_TENANT_DOMAIN_SUFFIX:()=>PBt,ADFS:()=>wBt,APP_METADATA:()=>Zce,AUTHORITY_METADATA_CACHE_KEY:()=>Xce,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>WBt,AUTHORIZATION_PENDING:()=>SPo,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>OBt,AuthenticationScheme:()=>Tf,AuthorityMetadataSource:()=>h_,CACHE_ACCOUNT_TYPE_ADFS:()=>$Bt,CACHE_ACCOUNT_TYPE_GENERIC:()=>DGe,CACHE_ACCOUNT_TYPE_MSAV1:()=>HPo,CACHE_ACCOUNT_TYPE_MSSTS:()=>GBt,CACHE_KEY_SEPARATOR:()=>JY,CIAM_AUTH_URL:()=>TGe,CLIENT_INFO:()=>VBt,CLIENT_INFO_SEPARATOR:()=>Jce,CLIENT_MISMATCH_ERROR:()=>n3t,CODE_GRANT_TYPE:()=>CPo,CONSUMER_UTID:()=>vPo,CacheOutcome:()=>HP,CacheType:()=>GPo,ClaimsRequestKeys:()=>Kce,CodeChallengeMethodValues:()=>qPo,CredentialType:()=>hg,DEFAULT_AUTHORITY:()=>pan,DEFAULT_AUTHORITY_HOST:()=>xBt,DEFAULT_COMMON_TENANT:()=>HTe,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>e3t,DEFAULT_THROTTLE_TIME_SECONDS:()=>XBt,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>i3t,DSTS:()=>RBt,EMAIL_SCOPE:()=>gan,EncodingTypes:()=>zPo,FORWARD_SLASH:()=>zce,GrantType:()=>VTe,HTTP_BAD_REQUEST:()=>kGe,HTTP_CLIENT_ERROR:()=>RPo,HTTP_CLIENT_ERROR_RANGE_END:()=>QBt,HTTP_CLIENT_ERROR_RANGE_START:()=>UBt,HTTP_GATEWAY_TIMEOUT:()=>BPo,HTTP_GONE:()=>NPo,HTTP_MULTI_SIDED_ERROR:()=>FPo,HTTP_NOT_FOUND:()=>PPo,HTTP_REDIRECT:()=>wPo,HTTP_REQUEST_TIMEOUT:()=>DPo,HTTP_SERVER_ERROR:()=>OPo,HTTP_SERVER_ERROR_RANGE_END:()=>jBt,HTTP_SERVER_ERROR_RANGE_START:()=>qBt,HTTP_SERVICE_UNAVAILABLE:()=>LPo,HTTP_SUCCESS:()=>RGe,HTTP_SUCCESS_RANGE_END:()=>xPo,HTTP_SUCCESS_RANGE_START:()=>IPo,HTTP_TOO_MANY_REQUESTS:()=>MPo,HTTP_UNAUTHORIZED:()=>kPo,HeaderNames:()=>eh,HttpMethod:()=>UPo,IMDS_ENDPOINT:()=>wGe,IMDS_TIMEOUT:()=>MBt,IMDS_VERSION:()=>NBt,INVALID_GRANT_ERROR:()=>r3t,INVALID_INSTANCE:()=>FBt,JsonWebTokenTypes:()=>VPo,KNOWN_PUBLIC_CLOUDS:()=>BBt,NOT_APPLICABLE:()=>GTe,NOT_AVAILABLE:()=>KY,OAuthResponseType:()=>jPo,OFFLINE_ACCESS_SCOPE:()=>xGe,OIDC_DEFAULT_SCOPES:()=>Yce,OIDC_SCOPES:()=>PGe,ONE_DAY_IN_MS:()=>WPo,OPENID_SCOPE:()=>han,PROFILE_SCOPE:()=>man,PasswordGrantConstants:()=>OGe,PersistentCacheKeys:()=>QPo,PromptValue:()=>$Te,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>LBt,RESOURCE_DELIM:()=>IGe,RegionDiscoveryOutcomes:()=>YTe,RegionDiscoverySources:()=>xQ,ResponseMode:()=>HBt,S256_CODE_CHALLENGE_METHOD:()=>bPo,SERVER_TELEM_CACHE_KEY:()=>WTe,SERVER_TELEM_CATEGORY_SEPARATOR:()=>MGe,SERVER_TELEM_MAX_CACHED_ERRORS:()=>YBt,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>$Po,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>zBt,SERVER_TELEM_OVERFLOW_FALSE:()=>JBt,SERVER_TELEM_OVERFLOW_TRUE:()=>KBt,SERVER_TELEM_SCHEMA_VERSION:()=>NGe,SERVER_TELEM_UNKNOWN_ERROR:()=>ZBt,SERVER_TELEM_VALUE_SEPARATOR:()=>IQ,SHR_NONCE_VALIDITY:()=>TPo,SKU:()=>IBt,THE_FAMILY_ID:()=>ZY,THROTTLING_PREFIX:()=>zTe,URL_FORM_CONTENT_TYPE:()=>DBt,X_MS_LIB_CAPABILITY_VALUE:()=>t3t});p();var IBt="msal.js.common",pan="https://login.microsoftonline.com/common/",xBt="login.microsoftonline.com",HTe="common",wBt="adfs",RBt="dstsv2",kBt=`${pan}discovery/instance?api-version=1.1&authorization_endpoint=`,TGe=".ciamlogin.com",PBt=".onmicrosoft.com",IGe="|",vPo="9188040d-6c67-4c5b-b112-36a304b66dad",han="openid",man="profile",xGe="offline_access",gan="email",CPo="authorization_code",bPo="S256",DBt="application/x-www-form-urlencoded;charset=utf-8",SPo="authorization_pending",GTe="N/A",KY="Not Available",zce="/",wGe="http://169.254.169.254/metadata/instance/compute/location",NBt="2020-06-01",MBt=2e3,OBt="TryAutoDetect",LBt="login.microsoft.com",BBt=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TPo=240,FBt="invalid_instance",RGe=200,IPo=200,xPo=299,wPo=302,RPo=400,UBt=400,kGe=400,kPo=401,PPo=404,DPo=408,NPo=410,MPo=429,QBt=499,OPo=500,qBt=500,LPo=503,BPo=504,jBt=599,FPo=600,UPo={GET:"GET",POST:"POST"},Yce=[han,man,xGe],PGe=[...Yce,gan],eh={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},QPo={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},jP={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},Kce={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},$Te={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},qPo={PLAIN:"plain",S256:"S256"},jPo={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},HBt={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},VTe={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},GBt="MSSTS",$Bt="ADFS",HPo="MSA",DGe="Generic",JY="-",Jce=".",hg={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},GPo={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},Zce="appmetadata",VBt="client_info",ZY="1",Xce="authority-metadata",WBt=3600*24,h_={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},NGe=5,$Po=80,zBt=330,YBt=50,WTe="server-telemetry",MGe="|",IQ=",",KBt="1",JBt="0",ZBt="unknown_error",Tf={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},XBt=60,e3t=3600,zTe="throttling",t3t="retry-after, h429",r3t="invalid_grant",n3t="client_mismatch",OGe={username:"username",password:"password"},xQ={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},YTe={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},HP={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},VPo={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},WPo=864e5,i3t=300,zPo={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var XY={};Ti(XY,{ACCESS_TOKEN:()=>JPo,BROKER_CLIENT_ID:()=>KTe,BROKER_REDIRECT_URI:()=>QGe,CCS_HEADER:()=>o2o,CLAIMS:()=>c3t,CLIENT_ASSERTION:()=>D3t,CLIENT_ASSERTION_TYPE:()=>N3t,CLIENT_ID:()=>AO,CLIENT_INFO:()=>r2o,CLIENT_REQUEST_ID:()=>y3t,CLIENT_SECRET:()=>P3t,CLI_DATA:()=>G3t,CODE:()=>h3t,CODE_CHALLENGE:()=>m3t,CODE_CHALLENGE_METHOD:()=>g3t,CODE_VERIFIER:()=>A3t,DEVICE_CODE:()=>k3t,DOMAIN_HINT:()=>Q3t,EAR_JWE_CRYPTO:()=>j3t,EAR_JWK:()=>q3t,ERROR:()=>YPo,ERROR_DESCRIPTION:()=>KPo,EXPIRES_IN:()=>XPo,FOCI:()=>i2o,GRANT_TYPE:()=>a3t,ID_TOKEN:()=>ZPo,ID_TOKEN_HINT:()=>R3t,INSTANCE_AWARE:()=>ele,LOGIN_HINT:()=>U3t,LOGOUT_HINT:()=>B3t,NATIVE_BROKER:()=>L3t,NONCE:()=>f3t,OBO_ASSERTION:()=>M3t,ON_BEHALF_OF:()=>n2o,POST_LOGOUT_URI:()=>w3t,PROMPT:()=>p3t,REDIRECT_URI:()=>LGe,REFRESH_TOKEN:()=>u3t,REFRESH_TOKEN_EXPIRES_IN:()=>e2o,REQUESTED_TOKEN_USE:()=>O3t,REQ_CNF:()=>FGe,RESOURCE:()=>H3t,RESPONSE_MODE:()=>s3t,RESPONSE_TYPE:()=>o3t,RETURN_SPA_CODE:()=>UGe,SCOPE:()=>l3t,SESSION_STATE:()=>t2o,SID:()=>F3t,STATE:()=>d3t,TOKEN_TYPE:()=>BGe,X_APP_NAME:()=>I3t,X_APP_VER:()=>x3t,X_CLIENT_CPU:()=>C3t,X_CLIENT_CURR_TELEM:()=>b3t,X_CLIENT_EXTRA_SKU:()=>s2o,X_CLIENT_LAST_TELEM:()=>S3t,X_CLIENT_OS:()=>v3t,X_CLIENT_SKU:()=>_3t,X_CLIENT_VER:()=>E3t,X_MS_LIB_CAPABILITY:()=>T3t});p();var AO="client_id",LGe="redirect_uri",o3t="response_type",s3t="response_mode",a3t="grant_type",c3t="claims",l3t="scope",YPo="error",KPo="error_description",JPo="access_token",ZPo="id_token",u3t="refresh_token",XPo="expires_in",e2o="refresh_token_expires_in",d3t="state",f3t="nonce",p3t="prompt",t2o="session_state",r2o="client_info",h3t="code",m3t="code_challenge",g3t="code_challenge_method",A3t="code_verifier",y3t="client-request-id",_3t="x-client-SKU",E3t="x-client-VER",v3t="x-client-OS",C3t="x-client-CPU",b3t="x-client-current-telemetry",S3t="x-client-last-telemetry",T3t="x-ms-lib-capability",I3t="x-app-name",x3t="x-app-ver",w3t="post_logout_redirect_uri",R3t="id_token_hint",k3t="device_code",P3t="client_secret",D3t="client_assertion",N3t="client_assertion_type",BGe="token_type",FGe="req_cnf",M3t="assertion",O3t="requested_token_use",n2o="on_behalf_of",i2o="foci",o2o="X-AnchorMailbox",UGe="return_spa_code",L3t="nativebroker",B3t="logout_hint",F3t="sid",U3t="login_hint",Q3t="domain_hint",s2o="x-client-xtra-sku",KTe="brk_client_id",QGe="brk_redirect_uri",ele="instance_aware",q3t="ear_jwk",j3t="ear_jwe_crypto",H3t="resource",G3t="clidata";p();p();p();function qGe(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(qGe,"getDefaultErrorMessage");var jo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?qGe(e):""),s=o?`${e}: ${o}`:e;super(s),Object.setPrototypeOf(this,t.prototype),this.errorCode=e||"",this.errorMessage=o||"",this.subError=n||"",this.name="AuthError"}setCorrelationId(e){this.correlationId=e}};function eK(t,e){return new jo(t,e||qGe(t))}a(eK,"createAuthError");var tle=class t extends jo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function Dl(t){return new tle(t)}a(Dl,"createClientConfigurationError");p();var Su=class{static{a(this,"StringUtils")}static isEmptyObj(e){if(e)try{let r=JSON.parse(e);return Object.keys(r).length===0}catch{}return!0}static startsWith(e,r){return e.indexOf(r)===0}static endsWith(e,r){return e.length>=r.length&&e.lastIndexOf(r)===e.length-r.length}static queryStringToObject(e){let r={},n=e.split("&"),o=a(s=>decodeURIComponent(s.replace(/\+/g," ")),"decode");return n.forEach(s=>{if(s.trim()){let[c,l]=s.split(/=(.+)/g,2);c&&l&&(r[o(c)]=o(l))}}),r}static trimArrayEntries(e){return e.map(r=>r.trim())}static removeEmptyStringsFromArray(e){return e.filter(r=>!!r)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}};p();var wQ=class t extends jo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function Nt(t,e){return new wQ(t,e)}a(Nt,"createClientAuthError");var nle={};Ti(nle,{authorityMismatch:()=>h2o,authorityUriInsecure:()=>V3t,cannotAllowPlatformBroker:()=>p2o,cannotSetOIDCOptions:()=>f2o,claimsRequestParsingError:()=>a2o,emptyInputScopesError:()=>z3t,invalidAuthenticationHeader:()=>d2o,invalidAuthorityMetadata:()=>Z3t,invalidClaims:()=>jGe,invalidCloudDiscoveryMetadata:()=>HGe,invalidCodeChallengeMethod:()=>c2o,invalidRequestMethodForEAR:()=>m2o,logoutRequestEmpty:()=>K3t,missingNonceAuthenticationHeader:()=>u2o,missingSshJwk:()=>JTe,missingSshKid:()=>l2o,pkceParamsMissing:()=>J3t,redirectUriEmpty:()=>$3t,tokenRequestEmpty:()=>Y3t,untrustedAuthority:()=>X3t,urlEmptyError:()=>W3t,urlParseError:()=>rle});p();var $3t="redirect_uri_empty",a2o="claims_request_parsing_error",V3t="authority_uri_insecure",rle="url_parse_error",W3t="empty_url_error",z3t="empty_input_scopes_error",jGe="invalid_claims",Y3t="token_request_empty",K3t="logout_request_empty",c2o="invalid_code_challenge_method",J3t="pkce_params_missing",HGe="invalid_cloud_discovery_metadata",Z3t="invalid_authority_metadata",X3t="untrusted_authority",JTe="missing_ssh_jwk",l2o="missing_ssh_kid",u2o="missing_nonce_authentication_header",d2o="invalid_authentication_header",f2o="cannot_set_OIDCOptions",p2o="cannot_allow_platform_broker",h2o="authority_mismatch",m2o="invalid_request_method_for_EAR";var th={};Ti(th,{authTimeNotFound:()=>ZTe,authorizationCodeMissingFromServerResponse:()=>mFt,bindingKeyNotRemoved:()=>_2o,cannotAppendScopeSet:()=>dFt,cannotRemoveEmptyScope:()=>uFt,clientInfoDecodingError:()=>GGe,clientInfoEmptyError:()=>eFt,emptyInputScopeSet:()=>WGe,endSessionEndpointNotSupported:()=>gFt,endpointResolutionError:()=>GP,hashNotDeserialized:()=>iFt,invalidCacheEnvironment:()=>eIe,invalidCacheRecord:()=>fFt,invalidState:()=>tK,keyIdMissing:()=>AFt,maxAgeTranspired:()=>aFt,methodNotImplemented:()=>Ps,misplacedResourceParam:()=>_Ft,multipleMatchingAppMetadata:()=>cFt,multipleMatchingTokens:()=>g2o,nestedAppAuthBridgeDisabled:()=>C2o,networkError:()=>rFt,noAccountFound:()=>A2o,noAccountInSilentRequest:()=>XTe,noCryptoObject:()=>pFt,noNetworkConnectivity:()=>E2o,nonceMismatch:()=>sFt,nullOrEmptyToken:()=>tFt,openIdConfigError:()=>nFt,platformBrokerError:()=>b2o,requestCannotBeMade:()=>lFt,resourceParameterRequired:()=>yFt,stateMismatch:()=>oFt,stateNotFound:()=>VGe,tokenClaimsCnfRequiredForSignedJwt:()=>hFt,tokenParsingError:()=>$Ge,tokenRefreshRequired:()=>ile,unexpectedCredentialType:()=>y2o,userCanceled:()=>v2o});p();var GGe="client_info_decoding_error",eFt="client_info_empty_error",$Ge="token_parsing_error",tFt="null_or_empty_token",GP="endpoints_resolution_error",rFt="network_error",nFt="openid_config_error",iFt="hash_not_deserialized",tK="invalid_state",oFt="state_mismatch",VGe="state_not_found",sFt="nonce_mismatch",ZTe="auth_time_not_found",aFt="max_age_transpired",g2o="multiple_matching_tokens",cFt="multiple_matching_appMetadata",lFt="request_cannot_be_made",uFt="cannot_remove_empty_scope",dFt="cannot_append_scopeset",WGe="empty_input_scopeset",XTe="no_account_in_silent_request",fFt="invalid_cache_record",eIe="invalid_cache_environment",A2o="no_account_found",pFt="no_crypto_object",y2o="unexpected_credential_type",ile="token_refresh_required",hFt="token_claims_cnf_required_for_signedjwt",mFt="authorization_code_missing_from_server_response",_2o="binding_key_not_removed",gFt="end_session_endpoint_not_supported",AFt="key_id_missing",E2o="no_network_connectivity",v2o="user_canceled",Ps="method_not_implemented",C2o="nested_app_auth_bridge_disabled",b2o="platform_broker_error",yFt="resource_parameter_required",_Ft="misplaced_resource_parameter";var tm=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?Su.trimArrayEntries([...e]):[],n=r?Su.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw Dl(z3t);this.scopes=new Set,n.forEach(o=>this.scopes.add(o))}static fromString(e){let n=(e||"").split(" ");return new t(n)}static createSearchScopes(e){let r=e&&e.length>0?e:[...Yce],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(xGe):n.removeOIDCScopes(),n}containsScope(e){let r=this.printScopesLowerCase().split(" "),n=new t(r);return e?n.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(r=>this.containsScope(r))}containsOnlyOIDCScopes(){let e=0;return PGe.forEach(r=>{this.containsScope(r)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(r=>this.appendScope(r))}catch{throw Nt(dFt)}}removeScope(e){if(!e)throw Nt(uFt);this.scopes.delete(e.trim())}removeOIDCScopes(){PGe.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw Nt(WGe);let r=new Set;return e.scopes.forEach(n=>r.add(n.toLowerCase())),this.scopes.forEach(n=>r.add(n.toLowerCase())),r}intersectingScopeSets(e){if(!e)throw Nt(WGe);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();let r=this.unionScopeSets(e),n=e.getScopeCount(),o=this.getScopeCount();return r.sizee.push(r)),e}printScopes(){return this.scopes?this.asArray().join(" "):""}printScopesLowerCase(){return this.printScopes().toLowerCase()}};function rK(t,e,r){if(!e)return;let n=t.get(AO);n&&t.has(KTe)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get(LGe)},e)}a(rK,"instrumentBrokerParams");function S2o(t,e){t.set(o3t,e)}a(S2o,"addResponseType");function EFt(t,e){t.set(s3t,e||HBt.QUERY)}a(EFt,"addResponseMode");function T2o(t){t.set(L3t,"1")}a(T2o,"addNativeBroker");function nK(t,e,r=!0,n=Yce){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new tm(o);t.set(l3t,s.printScopes())}a(nK,"addScopes");function iK(t,e){t.set(AO,e)}a(iK,"addClientId");function oK(t,e){t.set(LGe,e)}a(oK,"addRedirectUri");function vFt(t,e){t.set(w3t,e)}a(vFt,"addPostLogoutRedirectUri");function CFt(t,e){t.set(R3t,e)}a(CFt,"addIdTokenHint");function bFt(t,e){t.set(Q3t,e)}a(bFt,"addDomainHint");function ole(t,e){t.set(U3t,e)}a(ole,"addLoginHint");function RQ(t,e){t.set(eh.CCS_HEADER,`UPN:${e}`)}a(RQ,"addCcsUpn");function Q3(t,e){t.set(eh.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(Q3,"addCcsOid");function zGe(t,e){t.set("sid",e)}a(zGe,"addSid");function sK(t,e,r){let n=Aan(e,r);try{JSON.parse(n)}catch{throw Dl(jGe)}t.set(c3t,n)}a(sK,"addClaims");function aK(t,e){t.set(y3t,e)}a(aK,"addCorrelationId");function tIe(t,e){t.set(_3t,e.sku),t.set(E3t,e.version),e.os&&t.set(v3t,e.os),e.cpu&&t.set(C3t,e.cpu)}a(tIe,"addLibraryInfo");function rIe(t,e){e?.appName&&t.set(I3t,e.appName),e?.appVersion&&t.set(x3t,e.appVersion)}a(rIe,"addApplicationTelemetry");function SFt(t,e){t.set(p3t,e)}a(SFt,"addPrompt");function nIe(t,e){e&&t.set(d3t,e)}a(nIe,"addState");function TFt(t,e){t.set(f3t,e)}a(TFt,"addNonce");function I2o(t,e,r){if(e&&r)t.set(m3t,e),t.set(g3t,r);else throw Dl(J3t)}a(I2o,"addCodeChallengeParams");function IFt(t,e){t.set(h3t,e)}a(IFt,"addAuthorizationCode");function x2o(t,e){t.set(k3t,e)}a(x2o,"addDeviceCode");function xFt(t,e){t.set(u3t,e)}a(xFt,"addRefreshToken");function wFt(t,e){t.set(A3t,e)}a(wFt,"addCodeVerifier");function iIe(t,e){t.set(P3t,e)}a(iIe,"addClientSecret");function oIe(t,e){e&&t.set(D3t,e)}a(oIe,"addClientAssertion");function sIe(t,e){e&&t.set(N3t,e)}a(sIe,"addClientAssertionType");function w2o(t,e){t.set(M3t,e)}a(w2o,"addOboAssertion");function R2o(t,e){t.set(O3t,e)}a(R2o,"addRequestTokenUse");function aIe(t,e){t.set(a3t,e)}a(aIe,"addGrantType");function cK(t){t.set(VBt,"1")}a(cK,"addClientInfo");function RFt(t){t.set(G3t,"1")}a(RFt,"addCliData");function cIe(t){t.has(ele)||t.set(ele,"true")}a(cIe,"addInstanceAware");function q3(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(q3,"addExtraParameters");function Aan(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw Dl(jGe)}return e&&e.length>0&&(r.hasOwnProperty(Kce.ACCESS_TOKEN)||(r[Kce.ACCESS_TOKEN]={}),r[Kce.ACCESS_TOKEN][Kce.XMS_CC]={values:e}),JSON.stringify(r)}a(Aan,"addClientCapabilitiesToClaims");function k2o(t,e){t.set(OGe.username,e)}a(k2o,"addUsername");function P2o(t,e){t.set(OGe.password,e)}a(P2o,"addPassword");function lIe(t,e){e&&(t.set(BGe,Tf.POP),t.set(FGe,e))}a(lIe,"addPopToken");function uIe(t,e){e&&(t.set(BGe,Tf.SSH),t.set(FGe,e))}a(uIe,"addSshJwk");function dIe(t,e){t.set(b3t,e.generateCurrentRequestHeaderValue()),t.set(S3t,e.generateLastRequestHeaderValue())}a(dIe,"addServerTelemetry");function fIe(t){t.set(T3t,t3t)}a(fIe,"addThrottling");function kFt(t,e){t.set(B3t,e)}a(kFt,"addLogoutHint");function j3(t,e,r){t.has(KTe)||t.set(KTe,e),t.has(QGe)||t.set(QGe,r)}a(j3,"addBrokerParameters");function D2o(t,e){t.set(q3t,encodeURIComponent(e)),t.set(j3t,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(D2o,"addEARParameters");function pIe(t,e){e&&t.set(H3t,e)}a(pIe,"addResource");var NA={};Ti(NA,{getDeserializedResponse:()=>N2o,mapToQueryString:()=>yO,normalizeUrlForComparison:()=>M2o,stripLeadingHashOrQuery:()=>_an});p();function yan(t){if(!t)return t;let e=t.toLowerCase();return Su.endsWith(e,"?")?e=e.slice(0,-1):Su.endsWith(e,"?/")&&(e=e.slice(0,-2)),Su.endsWith(e,"/")||(e+="/"),e}a(yan,"canonicalizeUrl");function _an(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(_an,"stripLeadingHashOrQuery");function N2o(t){if(!t||t.indexOf("=")<0)return null;try{let e=_an(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch{throw Nt(iFt)}return null}a(N2o,"getDeserializedResponse");function yO(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(yO,"mapToQueryString");function M2o(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return yan(n)}catch{return yan(e)}}a(M2o,"normalizeUrlForComparison");p();p();var sle={createNewGuid:a(()=>{throw Nt(Ps)},"createNewGuid"),base64Decode:a(()=>{throw Nt(Ps)},"base64Decode"),base64Encode:a(()=>{throw Nt(Ps)},"base64Encode"),base64UrlEncode:a(()=>{throw Nt(Ps)},"base64UrlEncode"),encodeKid:a(()=>{throw Nt(Ps)},"encodeKid"),async getPublicKeyThumbprint(){throw Nt(Ps)},async removeTokenBindingKey(){throw Nt(Ps)},async clearKeystore(){throw Nt(Ps)},async signJwt(){throw Nt(Ps)},async hashString(){throw Nt(Ps)}};p();var If;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(If||(If={}));var O2o=50,L2o=500,lK=new Map;function B2o(t,e){lK.delete(t),lK.set(t,e)}a(B2o,"markAsRecentlyUsed");function F2o(t,e){let r=Date.now(),n=lK.get(t);if(n)B2o(t,n);else if(n={logs:[],firstEventTime:r},lK.set(t,n),lK.size>O2o){let o=lK.keys().next().value;o&&lK.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>L2o&&n.logs.shift()}a(F2o,"addLogToCache");function U2o(t){if(t.length!==6)return!1;for(let e=0;e="a"&&r<="z"||r>="A"&&r<="Z"||r>="0"&&r<="9"))return!1}return!0}a(U2o,"isHashedString");var mg=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=If.Info;let o=a(()=>{},"defaultLoggerCallback"),s=e||t.createDefaultLoggerOptions();this.localCallback=s.loggerCallback||o,this.piiLoggingEnabled=s.piiLoggingEnabled||!1,this.level=typeof s.logLevel=="number"?s.logLevel:If.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:If.Info}}clone(e,r){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level},e,r)}logMessage(e,r){let n=r.correlationId;if(U2o(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};F2o(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${If[r.logLevel]} - ${e}`;this.executeCallback(r.logLevel,l,r.containsPii||!1)}executeCallback(e,r,n){this.localCallback&&this.localCallback(e,r,n)}error(e,r){this.logMessage(e,{logLevel:If.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:If.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:If.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:If.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:If.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:If.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:If.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:If.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:If.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:If.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var kQ="@azure/msal-common",_O="16.4.1";p();var H3={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};p();p();function Ean(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(Ean,"tenantIdMatchesHomeTenant");function uK(t,e,r,n){if(n){let{oid:o,sub:s,tid:c,name:l,tfp:u,acr:d,preferred_username:f,upn:h,login_hint:m}=n,g=c||u||d||"";return{tenantId:g,localAccountId:o||s||"",name:l,username:f||h||"",loginHint:m,isHomeTenant:Ean(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:Ean(r,t)}}a(uK,"buildTenantProfile");function YGe(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=uK(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(YGe,"updateAccountTenantProfileData");var KGe={};Ti(KGe,{checkMaxAge:()=>hIe,extractTokenClaims:()=>G3,getJWSPayload:()=>van,isKmsi:()=>PFt});p();function G3(t,e){let r=van(t);try{let n=e(r);return JSON.parse(n)}catch{throw Nt($Ge)}}a(G3,"extractTokenClaims");function PFt(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(PFt,"isKmsi");function van(t){if(!t)throw Nt(tFt);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw Nt($Ge);return r[2]}a(van,"getJWSPayload");function hIe(t,e){if(e===0||Date.now()-3e5>t+e)throw Nt(aFt)}a(hIe,"checkMaxAge");p();p();var Ds=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Dl(W3t);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return Su.endsWith(r,"?")?r=r.slice(0,-1):Su.endsWith(r,"?/")&&(r=r.slice(0,-2)),Su.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw Dl(rle)}if(!e.HostNameAndPort||!e.PathSegments)throw Dl(rle);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Dl(V3t)}static appendQueryString(e,r){return r?e.indexOf("?")<0?`${e}?${r}`:`${e}&${r}`:e}static removeHashFromUrl(e){return t.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){let r=this.getUrlComponents(),n=r.PathSegments;return e&&n.length!==0&&(n[0]===jP.COMMON||n[0]===jP.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw Dl(rle);let n={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5],QueryString:r[7]},o=n.AbsolutePath.split("/");return o=o.filter(s=>s&&s.length>0),n.PathSegments=o,n.QueryString&&n.QueryString.endsWith("/")&&(n.QueryString=n.QueryString.substring(0,n.QueryString.length-1)),n}static getDomainFromUrl(e){let r=RegExp("^([^:/?#]+://)?([^/?#]*)"),n=e.match(r);if(!n)throw Dl(rle);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===zce){let o=new t(r).getUrlComponents();return o.Protocol+"//"+o.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new t(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}};var Q2o=[{host:"login.microsoftonline.com"},{host:"login.chinacloudapi.cn",issuerHost:"login.partner.microsoftonline.cn"},{host:"login.microsoftonline.us"},{host:"login.sovcloud-identity.fr"},{host:"login.sovcloud-identity.de"},{host:"login.sovcloud-identity.sg"}];function q2o(t,e){return{token_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/token`,jwks_uri:`https://${t}/{tenantid}/discovery/v2.0/keys`,issuer:`https://${e}/{tenantid}/v2.0`,authorization_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/authorize`,end_session_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/logout`}}a(q2o,"buildOpenIdConfig");var j2o=Q2o.reduce((t,{host:e,issuerHost:r})=>(t[e]=q2o(e,r||e),t),{}),ban={endpointMetadata:j2o,instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]},{preferred_network:"login.sovcloud-identity.fr",preferred_cache:"login.sovcloud-identity.fr",aliases:["login.sovcloud-identity.fr"]},{preferred_network:"login.sovcloud-identity.de",preferred_cache:"login.sovcloud-identity.de",aliases:["login.sovcloud-identity.de"]},{preferred_network:"login.sovcloud-identity.sg",preferred_cache:"login.sovcloud-identity.sg",aliases:["login.sovcloud-identity.sg"]}]}},DFt=ban.endpointMetadata,NFt=ban.instanceDiscoveryMetadata,MFt=new Set;NFt.metadata.forEach(t=>{t.aliases.forEach(e=>{MFt.add(e)})});function San(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new Ds(o).getUrlComponents().HostNameAndPort;n=Can(e,r,s,t.cloudDiscoveryMetadata?.metadata,h_.CONFIG)||Can(e,r,s,NFt.metadata,h_.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(San,"getAliasesFromStaticSources");function Can(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=mIe(n,r);if(s)return t.trace(`getAliasesFromMetadata: found cloud discovery metadata in '${o}', returning aliases`,e),s.aliases;t.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in '${o}'`,e)}return null}a(Can,"getAliasesFromMetadata");function Tan(t){return mIe(NFt.metadata,t)}a(Tan,"getCloudDiscoveryMetadataFromHardcodedValues");function mIe(t,e){for(let r=0;rOFt,createAccountEntityFromAccountInfo:()=>$2o,generateAccountId:()=>H2o,generateHomeAccountId:()=>LFt,getAccountInfo:()=>cle,isAccountEntity:()=>V2o,isSingleTenant:()=>G2o});p();p();function ale(t,e){if(!t)throw Nt(eFt);try{let r=e(t);return JSON.parse(r)}catch{throw Nt(GGe)}}a(ale,"buildClientInfo");function EO(t){if(!t)throw Nt(GGe);let e=t.split(Jce,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(EO,"buildClientInfoFromHomeAccountId");p();var Jx={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function JGe(t){return t&&(t.tid||t.tfp||t.acr)||null}a(JGe,"getTenantIdFromIdTokenClaims");p();var m_={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function H2o(t){return[t.homeAccountId,t.environment].join(JY).toLowerCase()}a(H2o,"generateAccountId");function cle(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(uK(t.homeAccountId,t.localAccountId,t.realm)),{homeAccountId:t.homeAccountId,environment:t.environment,tenantId:t.realm,username:t.username,localAccountId:t.localAccountId,loginHint:t.loginHint,name:t.name,nativeAccountId:t.nativeAccountId,authorityType:t.authorityType,tenantProfiles:new Map(e.map(r=>[r.tenantId,r])),dataBoundary:t.dataBoundary}}a(cle,"getAccountInfo");function G2o(t){return!t.tenantProfiles}a(G2o,"isSingleTenant");function OFt(t,e,r){let n;e.authorityType===Jx.Adfs?n=$Bt:e.protocolMode===m_.OIDC?n=DGe:n=GBt;let o,s;t.clientInfo&&r&&(o=ale(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw Nt(eIe);let l=t.idTokenClaims?.preferred_username||t.idTokenClaims?.upn,u=t.idTokenClaims?.emails?t.idTokenClaims.emails[0]:null,d=l||u||"",f=t.idTokenClaims?.login_hint,h=o?.utid||JGe(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[uK(t.homeAccountId,m,h,t.idTokenClaims)],{homeAccountId:t.homeAccountId,environment:c,realm:h,localAccountId:m,username:d,authorityType:n,loginHint:f,clientInfo:t.clientInfo,name:t.idTokenClaims?.name||"",lastModificationTime:void 0,lastModificationApp:void 0,cloudGraphHostName:t.cloudGraphHostName,msGraphHost:t.msGraphHost,nativeAccountId:t.nativeAccountId,tenantProfiles:g,dataBoundary:s}}a(OFt,"createAccountEntity");function $2o(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(uK(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||DGe,homeAccountId:t.homeAccountId,localAccountId:t.localAccountId,nativeAccountId:t.nativeAccountId,realm:t.tenantId,environment:t.environment,username:t.username,loginHint:t.loginHint,name:t.name,cloudGraphHostName:e,msGraphHost:r,tenantProfiles:n,dataBoundary:t.dataBoundary}}a($2o,"createAccountEntityFromAccountInfo");function LFt(t,e,r,n,o,s){if(!(e===Jx.Adfs||e===Jx.Dsts)){if(t)try{let c=ale(t,n.base64Decode);if(c.uid&&c.utid)return`${c.uid}.${c.utid}`}catch{}r.warning("No client info in response",o)}return s?.sub||""}a(LFt,"generateHomeAccountId");function V2o(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a(V2o,"isAccountEntity");var PQ=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(kQ,_O),this.staticAuthorityOptions=s,this.performanceClient=o}getAllAccounts(e={},r){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,r),r,e)}getAccountInfoFilteredBy(e,r){if(Object.keys(e).length===0||Object.values(e).every(o=>o==null||o===""))return this.commonLogger.warning("getAccountInfoFilteredBy: Account filter is empty or invalid, returning null",r),null;let n=this.getAllAccounts(e,r);return n.length>1?n.sort(s=>s.idTokenClaims?-1:1)[0]:n.length===1?n[0]:null}getBaseAccountInfo(e,r){let n=this.getAccountsFilteredBy(e,r);return n.length>0?cle(n[0]):null}buildTenantProfiles(e,r,n){return e.flatMap(o=>this.getTenantProfilesFromAccountEntity(o,r,n?.tenantId,n))}getTenantedAccountInfoByFilter(e,r,n,o,s){let c=null,l;if(s&&!this.tenantProfileMatchesFilter(n,s))return null;let u=this.getIdToken(e,o,r,n.tenantId);return u&&(l=G3(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=YGe(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=cle(e),c=s.tenantProfiles||new Map,l=this.getTokenKeys();if(n){let d=c.get(n);if(d)c=new Map([[n,d]]);else return[]}let u=[];return c.forEach(d=>{let f=this.getTenantedAccountInfoByFilter(s,l,d,r,o);f&&u.push(f)}),u}tenantProfileMatchesFilter(e,r){return!(r.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,r.localAccountId)||r.name&&e.name!==r.name||r.isHomeTenant!==void 0&&e.isHomeTenant!==r.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,r){return!(r&&(r.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,r.localAccountId)||r.loginHint&&!this.matchLoginHintFromTokenClaims(e,r.loginHint)||r.username&&!this.matchUsername(e.preferred_username,r.username)||r.name&&!this.matchName(e,r.name)||r.sid&&!this.matchSid(e,r.sid)))}async saveCacheRecord(e,r,n,o,s){if(!e)throw Nt(fFt);try{e.account&&await this.setAccount(e.account,r,n,o),e.idToken&&s?.idToken!==!1&&await this.setIdTokenCredential(e.idToken,r,n),e.accessToken&&s?.accessToken!==!1&&await this.saveAccessToken(e.accessToken,r,n),e.refreshToken&&s?.refreshToken!==!1&&await this.setRefreshTokenCredential(e.refreshToken,r,n),e.appMetadata&&this.setAppMetadata(e.appMetadata,r)}catch(c){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed",r),c instanceof jo?c:wan(c)}}async saveAccessToken(e,r,n){let o={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType},s=this.getTokenKeys(),c=tm.fromString(e.target);s.accessToken.forEach(l=>{if(!this.accessTokenKeyMatchesFilter(l,o,!1))return;let u=this.getAccessTokenCredential(l,r);u&&this.credentialMatchesFilter(u,o,r)&&tm.fromString(u.target).intersectingScopeSets(c)&&this.removeAccessToken(l,r)}),await this.setAccessTokenCredential(e,r,n)}getAccountsFilteredBy(e,r){let n=this.getAccountKeys(),o=[];return n.forEach(s=>{let c=this.getAccount(s,r);if(!c||e.homeAccountId&&!this.matchHomeAccountId(c,e.homeAccountId)||e.username&&!this.matchUsername(c.username,e.username)||e.environment&&!this.matchEnvironment(c,e.environment,r)||e.realm&&!this.matchRealm(c,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(c,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(c,e.authorityType))return;let l={localAccountId:e?.localAccountId,name:e?.name},u=c.tenantProfiles?.filter(d=>this.tenantProfileMatchesFilter(d,l));u&&u.length===0||o.push(c)}),o}credentialMatchesFilter(e,r,n){return!(r.clientId&&!this.matchClientId(e,r.clientId)||r.userAssertionHash&&!this.matchUserAssertionHash(e,r.userAssertionHash)||typeof r.homeAccountId=="string"&&!this.matchHomeAccountId(e,r.homeAccountId)||r.environment&&!this.matchEnvironment(e,r.environment,n)||r.realm&&!this.matchRealm(e,r.realm)||r.credentialType&&!this.matchCredentialType(e,r.credentialType)||r.familyId&&!this.matchFamilyId(e,r.familyId)||r.target&&!this.matchTarget(e,r.target)||e.credentialType===hg.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===Tf.SSH&&r.keyId&&!this.matchKeyId(e,r.keyId)))}getAppMetadataFilteredBy(e,r){let n=this.getKeys(),o={};return n.forEach(s=>{if(!this.isAppMetadata(s))return;let c=this.getAppMetadata(s,r);c&&(e.environment&&!this.matchEnvironment(c,e.environment,r)||e.clientId&&!this.matchClientId(c,e.clientId)||(o[s]=c))}),o}getAuthorityMetadataByAlias(e,r){let n=this.getAuthorityMetadataKeys(),o=null;return n.forEach(s=>{if(!this.isAuthorityMetadata(s)||s.indexOf(this.clientId)===-1)return;let c=this.getAuthorityMetadata(s,r);c&&c.aliases.indexOf(e)!==-1&&(o=c)}),o}removeAllAccounts(e){this.getAllAccounts({},e).forEach(n=>{this.removeAccount(n,e)})}removeAccount(e,r){this.removeAccountContext(e,r);let n=this.getAccountKeys(),o=a(s=>s.includes(e.homeAccountId)&&s.includes(e.environment),"keyFilter");n.filter(o).forEach(s=>{this.removeItem(s,r),this.performanceClient.incrementFields({accountsRemoved:1},r)})}removeAccountContext(e,r){let n=this.getTokenKeys(),o=a(s=>s.includes(e.homeAccountId)&&s.includes(e.environment),"keyFilter");n.idToken.filter(o).forEach(s=>{this.removeIdToken(s,r)}),n.accessToken.filter(o).forEach(s=>{this.removeAccessToken(s,r)}),n.refreshToken.filter(o).forEach(s=>{this.removeRefreshToken(s,r)})}removeAccessToken(e,r){let n=this.getAccessTokenCredential(e,r);if(n&&(this.removeItem(e,r),this.performanceClient.incrementFields({accessTokensRemoved:1},r),n.credentialType.toLowerCase()===hg.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===Tf.POP)){let s=n.keyId;s&&this.cryptoImpl.removeTokenBindingKey(s,r).catch(()=>{this.commonLogger.error(`Failed to remove token binding key '${s}'`,r),this.performanceClient?.incrementFields({removeTokenBindingKeyFailure:1},r)})}}removeAppMetadata(e){return this.getKeys().forEach(n=>{this.isAppMetadata(n)&&this.removeItem(n,e)}),!0}getIdToken(e,r,n,o){this.commonLogger.trace("CacheManager - getIdToken called",r);let s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:hg.ID_TOKEN,clientId:this.clientId,realm:o},c=this.getIdTokensByFilter(s,r,n),l=c.size;if(l<1)return this.commonLogger.info("CacheManager:getIdToken - No token found",r),null;if(l>1){let u=c;if(!o){let d=new Map;c.forEach((h,m)=>{h.realm===e.tenantId&&d.set(m,h)});let f=d.size;if(f<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result",r),c.values().next().value;if(f===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile",r),d.values().next().value;u=d}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them",r),u.forEach((d,f)=>{this.removeIdToken(f,r)}),this.performanceClient.addFields({multiMatchedID:c.size},r),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token",r),c.values().next().value}getIdTokensByFilter(e,r,n){let o=n&&n.idToken||this.getTokenKeys().idToken,s=new Map;return o.forEach(c=>{if(!this.idTokenKeyMatchesFilter(c,{clientId:this.clientId,...e}))return;let l=this.getIdTokenCredential(c,r);l&&this.credentialMatchesFilter(l,e,r)&&s.set(c,l)}),s}idTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}removeIdToken(e,r){this.removeItem(e,r)}removeRefreshToken(e,r){this.removeItem(e,r)}getAccessToken(e,r,n,o){let s=r.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",s);let c=tm.createSearchScopes(r.scopes),l=r.authenticationScheme||Tf.BEARER,u=l&&l.toLowerCase()!==Tf.BEARER.toLowerCase()?hg.ACCESS_TOKEN_WITH_AUTH_SCHEME:hg.ACCESS_TOKEN,d={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:u,clientId:this.clientId,realm:o||e.tenantId,target:c,tokenType:l,keyId:r.sshKid},f=n&&n.accessToken||this.getTokenKeys().accessToken,h=[];f.forEach(g=>{if(this.accessTokenKeyMatchesFilter(g,d,!0)){let A=this.getAccessTokenCredential(g,s);A&&this.credentialMatchesFilter(A,d,s)&&h.push(A)}});let m=h.length;return m<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",s),null):m>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",s),h.forEach(g=>{this.removeAccessToken(this.generateCredentialKey(g),s)}),this.performanceClient.addFields({multiMatchedAT:h.length},s),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",s),h[0])}accessTokenKeyMatchesFilter(e,r,n){let o=e.toLowerCase();if(r.clientId&&o.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&o.indexOf(r.homeAccountId.toLowerCase())===-1||r.realm&&o.indexOf(r.realm.toLowerCase())===-1)return!1;if(r.target){let s=r.target.asArray();for(let c=0;c{if(!this.accessTokenKeyMatchesFilter(s,e,!0))return;let c=this.getAccessTokenCredential(s,r);c&&this.credentialMatchesFilter(c,e,r)&&o.push(c)}),o}getRefreshToken(e,r,n,o){this.commonLogger.trace("CacheManager - getRefreshToken called",n);let s=r?ZY:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:hg.REFRESH_TOKEN,clientId:this.clientId,familyId:s},l=o&&o.refreshToken||this.getTokenKeys().refreshToken,u=[];l.forEach(f=>{if(this.refreshTokenKeyMatchesFilter(f,c)){let h=this.getRefreshTokenCredential(f,n);h&&this.credentialMatchesFilter(h,c,n)&&u.push(h)}});let d=u.length;return d<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found.",n),null):(d>1&&this.performanceClient.addFields({multiMatchedRT:d},n),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token",n),u[0])}refreshTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.familyId&&n.indexOf(r.familyId.toLowerCase())===-1||!r.familyId&&r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e,r){let n={environment:e,clientId:this.clientId},o=this.getAppMetadataFilteredBy(n,r),s=Object.keys(o).map(l=>o[l]),c=s.length;if(c<1)return null;if(c>1)throw Nt(cFt);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===ZY)}matchHomeAccountId(e,r){return typeof e.homeAccountId=="string"&&r===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,r){let n=e.oid||e.sub;return r===n}matchLocalAccountIdFromTenantProfile(e,r){return e.localAccountId===r}matchName(e,r){return r.toLowerCase()===e.name?.toLowerCase()}matchUsername(e,r){return!!(e&&typeof e=="string"&&r?.toLowerCase()===e.toLowerCase())}matchUserAssertionHash(e,r){return!!(e.userAssertionHash&&r===e.userAssertionHash)}matchEnvironment(e,r,n){if(this.staticAuthorityOptions){let s=San(this.staticAuthorityOptions,this.commonLogger,n);if(s.includes(r)&&s.includes(e.environment))return!0}let o=this.getAuthorityMetadataByAlias(r,n);return!!(o&&o.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,r){return e.credentialType&&r.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,r){return!!(e.clientId&&r===e.clientId)}matchFamilyId(e,r){return!!(e.familyId&&r===e.familyId)}matchRealm(e,r){return e.realm?.toLowerCase()===r.toLowerCase()}matchNativeAccountId(e,r){return!!(e.nativeAccountId&&r===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,r){return e.login_hint===r||e.preferred_username===r||e.upn===r}matchSid(e,r){return e.sid===r}matchAuthorityType(e,r){return!!(e.authorityType&&r.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,r){return e.credentialType!==hg.ACCESS_TOKEN&&e.credentialType!==hg.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:tm.fromString(e.target).containsScopeSet(r)}matchTokenType(e,r){return!!(e.tokenType&&e.tokenType===r)}matchKeyId(e,r){return!!(e.keyId&&e.keyId===r)}isAppMetadata(e){return e.indexOf(Zce)!==-1}isAuthorityMetadata(e){return e.indexOf(Xce)!==-1}generateAuthorityMetadataCacheKey(e){return`${Xce}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},AIe=class extends PQ{static{a(this,"DefaultStorageClass")}async setAccount(){throw Nt(Ps)}getAccount(){throw Nt(Ps)}async setIdTokenCredential(){throw Nt(Ps)}getIdTokenCredential(){throw Nt(Ps)}async setAccessTokenCredential(){throw Nt(Ps)}getAccessTokenCredential(){throw Nt(Ps)}async setRefreshTokenCredential(){throw Nt(Ps)}getRefreshTokenCredential(){throw Nt(Ps)}setAppMetadata(){throw Nt(Ps)}getAppMetadata(){throw Nt(Ps)}setServerTelemetry(){throw Nt(Ps)}getServerTelemetry(){throw Nt(Ps)}setAuthorityMetadata(){throw Nt(Ps)}getAuthorityMetadata(){throw Nt(Ps)}getAuthorityMetadataKeys(){throw Nt(Ps)}setThrottlingCache(){throw Nt(Ps)}getThrottlingCache(){throw Nt(Ps)}removeItem(){throw Nt(Ps)}getKeys(){throw Nt(Ps)}getAccountKeys(){throw Nt(Ps)}getTokenKeys(){throw Nt(Ps)}generateCredentialKey(){throw Nt(Ps)}generateAccountKey(){throw Nt(Ps)}};p();p();var Ran={NotStarted:0,InProgress:1,Completed:2};var rm=class{static{a(this,"StubPerformanceClient")}generateId(){return"callback-id"}startMeasurement(e,r){return{end:a(()=>null,"end"),discard:a(()=>{},"discard"),add:a(()=>{},"add"),increment:a(()=>{},"increment"),event:{eventId:this.generateId(),status:Ran.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:r||""}}}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}};var kan={tokenRenewalOffsetSeconds:i3t,preventCorsPreflight:!1},W2o={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:If.Info,correlationId:""},z2o={async sendGetRequestAsync(){throw Nt(Ps)},async sendPostRequestAsync(){throw Nt(Ps)}},Y2o={sku:IBt,version:_O,cpu:"",os:""},K2o={clientSecret:"",clientAssertion:void 0},J2o={azureCloudInstance:H3.None,tenant:`${HTe}`},Z2o={application:{appName:"",appVersion:""}};function $3({authOptions:t,systemOptions:e,loggerOptions:r,storageInterface:n,networkInterface:o,cryptoInterface:s,clientCredentials:c,libraryInfo:l,telemetry:u,serverTelemetryManager:d,persistencePlugin:f,serializableCache:h}){let m={...W2o,...r};return{authOptions:X2o(t),systemOptions:{...kan,...e},loggerOptions:m,storageInterface:n||new AIe(t.clientId,sle,new mg(m),new rm),networkInterface:o||z2o,cryptoInterface:s||sle,clientCredentials:c||K2o,libraryInfo:{...Y2o,...l},telemetry:{...Z2o,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a($3,"buildClientConfiguration");function X2o(t){return{clientCapabilities:[],azureCloudOptions:J2o,instanceAware:!1,isMcp:!1,...t}}a(X2o,"buildAuthOptions");function ZGe(t){return t.authOptions.authority.options.protocolMode===m_.OIDC}a(ZGe,"isOidcProtocolMode");p();p();var Q1=class{static{a(this,"TokenCacheContext")}constructor(e,r){this.cache=e,this.hasChanged=r}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}};var $E={};Ti($E,{createAccessTokenEntity:()=>UFt,createIdTokenEntity:()=>FFt,createRefreshTokenEntity:()=>QFt,generateAppMetadataKey:()=>cDo,generateAuthorityMetadataExpiresAt:()=>e$e,isAccessTokenEntity:()=>nDo,isAppMetadataEntity:()=>lDo,isAuthorityMetadataEntity:()=>uDo,isAuthorityMetadataExpired:()=>t$e,isCredentialEntity:()=>XGe,isIdTokenEntity:()=>iDo,isRefreshTokenEntity:()=>oDo,isServerTelemetryEntity:()=>sDo,isThrottlingEntity:()=>aDo,updateAuthorityEndpointMetadata:()=>ule,updateCloudDiscoveryMetadata:()=>_Ie});p();var sd={};Ti(sd,{delay:()=>rDo,isCacheExpired:()=>tDo,isTokenExpired:()=>lle,nowSeconds:()=>q1,toDateFromSeconds:()=>yIe,toSecondsFromDate:()=>eDo,wasClockTurnedBack:()=>BFt});p();function q1(){return Math.round(new Date().getTime()/1e3)}a(q1,"nowSeconds");function eDo(t){return t.getTime()/1e3}a(eDo,"toSecondsFromDate");function yIe(t){return t?new Date(Number(t)*1e3):new Date}a(yIe,"toDateFromSeconds");function lle(t,e){let r=Number(t)||0;return q1()+e>r}a(lle,"isTokenExpired");function tDo(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(tDo,"isCacheExpired");function BFt(t){return Number(t)>q1()}a(BFt,"wasClockTurnedBack");function rDo(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(rDo,"delay");function FFt(t,e,r,n,o){return{credentialType:hg.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(FFt,"createIdTokenEntity");function UFt(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:hg.ACCESS_TOKEN,secret:r,cachedAt:q1().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||Tf.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==Tf.BEARER.toLowerCase())switch(g.credentialType=hg.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case Tf.POP:let A=G3(r,u);if(!A?.cnf?.kid)throw Nt(hFt);g.keyId=A.cnf.kid;break;case Tf.SSH:g.keyId=m}return g}a(UFt,"createAccessTokenEntity");function QFt(t,e,r,n,o,s,c){let l={credentialType:hg.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,lastUpdatedAt:Date.now().toString()};return s&&(l.userAssertionHash=s),o&&(l.familyId=o),c&&(l.expiresOn=c.toString()),l}a(QFt,"createRefreshTokenEntity");function XGe(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(XGe,"isCredentialEntity");function nDo(t){return t?XGe(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===hg.ACCESS_TOKEN||t.credentialType===hg.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(nDo,"isAccessTokenEntity");function iDo(t){return t?XGe(t)&&t.hasOwnProperty("realm")&&t.credentialType===hg.ID_TOKEN:!1}a(iDo,"isIdTokenEntity");function oDo(t){return t?XGe(t)&&t.credentialType===hg.REFRESH_TOKEN:!1}a(oDo,"isRefreshTokenEntity");function sDo(t,e){let r=t.indexOf(WTe)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(sDo,"isServerTelemetryEntity");function aDo(t,e){let r=!1;t&&(r=t.indexOf(zTe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(aDo,"isThrottlingEntity");function cDo({environment:t,clientId:e}){return[Zce,t,e].join(JY).toLowerCase()}a(cDo,"generateAppMetadataKey");function lDo(t,e){return e?t.indexOf(Zce)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(lDo,"isAppMetadataEntity");function uDo(t,e){return e?t.indexOf(Xce)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}a(uDo,"isAuthorityMetadataEntity");function e$e(){return q1()+WBt}a(e$e,"generateAuthorityMetadataExpiresAt");function ule(t,e,r){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=r,t.jwks_uri=e.jwks_uri}a(ule,"updateAuthorityEndpointMetadata");function _Ie(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(_Ie,"updateCloudDiscoveryMetadata");function t$e(t){return t.expiresAt<=q1()}a(t$e,"isAuthorityMetadataExpired");p();p();var Pan="networkClientSendPostRequestAsync",Dan="refreshTokenClientExecutePostToTokenEndpoint",Nan="authorizationCodeClientExecutePostToTokenEndpoint",Man="refreshTokenClientExecuteTokenRequest",Oan="refreshTokenClientAcquireToken",r$e="refreshTokenClientAcquireTokenWithCachedRefreshToken",Lan="refreshTokenClientCreateTokenRequestBody",Ban="silentFlowClientGenerateResultFromCacheRecord";var Fan="authClientExecuteTokenRequest",Uan="authClientCreateTokenRequestBody",Qan="updateTokenEndpointAuthority",dle="popTokenGenerateCnf",n$e="handleServerTokenResponse",qan="authorityResolveEndpointsAsync",jan="authorityGetCloudDiscoveryMetadataFromNetwork",Han="authorityUpdateCloudDiscoveryMetadata",Gan="authorityGetEndpointMetadataFromNetwork",$an="authorityUpdateEndpointMetadata",qFt="authorityUpdateMetadataWithRegionalInformation",Van="regionDiscoveryDetectRegion",jFt="regionDiscoveryGetRegionFromIMDS",Wan="regionDiscoveryGetCurrentVersion",zan="cacheManagerGetRefreshToken";p();var Yan=a((t,e,r,n,o)=>(...s)=>{r.trace(`Executing function '${e}'`,o);let c=n.startMeasurement(e,o);o&&n.incrementFields({[`ext.${e}CallCount`]:1},o);try{let l=t(...s);return c.end({success:!0}),r.trace(`Returning result from '${e}'`,o),l}catch(l){r.trace(`Error occurred in '${e}'`,o);try{r.trace(JSON.stringify(l),o)}catch{r.trace("Unable to print error message.",o)}throw c.end({success:!1},l),l}},"invoke"),ra=a((t,e,r,n,o)=>(...s)=>{r.trace(`Executing function '${e}'`,o);let c=n.startMeasurement(e,o);return o&&n.incrementFields({[`ext.${e}CallCount`]:1},o),t(...s).then(l=>(r.trace(`Returning result from '${e}'`,o),c.end({success:!0}),l)).catch(l=>{r.trace(`Error occurred in '${e}'`,o);try{r.trace(JSON.stringify(l),o)}catch{r.trace("Unable to print error message.",o)}throw c.end({success:!1},l),l})},"invokeAsync");var dDo={SW:"sw"},DQ=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await ra(this.generateKid.bind(this),dle,r,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(n));return{kid:n.kid,reqCnfString:o}}async generateKid(e){return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:dDo.SW}}async signPopToken(e,r,n){return this.signPayload(e,r,n)}async signPayload(e,r,n,o){let{resourceRequestMethod:s,resourceRequestUri:c,shrClaims:l,shrNonce:u,shrOptions:d}=n,h=(c?new Ds(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:q1(),m:s?.toUpperCase(),u:h?.HostNameAndPort,nonce:u||this.cryptoUtils.createNewGuid(),p:h?.AbsolutePath,q:h?.QueryString?[[],h.QueryString]:void 0,client_claims:l||void 0,...o},r,d,n.correlationId)}};p();var o$e={};Ti(o$e,{badToken:()=>EIe,consentRequired:()=>VFt,interactionRequired:()=>$Ft,interruptedUser:()=>zFt,loginRequired:()=>WFt,nativeAccountUnavailable:()=>fDo,noTokensFound:()=>i$e,refreshTokenExpired:()=>HFt,uxNotAllowed:()=>GFt});p();var i$e="no_tokens_found",fDo="native_account_unavailable",HFt="refresh_token_expired",GFt="ux_not_allowed",$Ft="interaction_required",VFt="consent_required",WFt="login_required",EIe="bad_token",zFt="interrupted_user";var Kan=[$Ft,VFt,WFt,EIe,GFt,zFt],pDo=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],j1=class t extends jo{static{a(this,"InteractionRequiredAuthError")}constructor(e,r,n,o,s,c,l,u){super(e,r,n),Object.setPrototypeOf(this,t.prototype),this.timestamp=o||"",this.traceId=s||"",this.correlationId=c||"",this.claims=l||"",this.name="InteractionRequiredAuthError",this.errorNo=u}};function s$e(t,e,r){let n=!!t&&Kan.indexOf(t)>-1,o=!!r&&pDo.indexOf(r)>-1,s=!!e&&Kan.some(c=>e.indexOf(c)>-1);return n||s||o}a(s$e,"isInteractionRequiredError");function a$e(t,e){return new j1(t,e)}a(a$e,"createInteractionRequiredAuthError");p();var VE=class t extends jo{static{a(this,"ServerError")}constructor(e,r,n,o,s){super(e,r,n),this.name="ServerError",this.errorNo=o,this.status=s,Object.setPrototypeOf(this,t.prototype)}};p();function Jan(t,e){if(!t)throw Nt(pFt);if(!e)throw Nt(tK);try{let r=e.split(IGe),n=r[0],o=r.length>1?r.slice(1).join(IGe):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw Nt(tK)}}a(Jan,"parseRequestState");var rh=class t{static{a(this,"ResponseHandler")}constructor(e,r,n,o,s,c,l){this.clientId=e,this.cacheStorage=r,this.cryptoObj=n,this.logger=o,this.performanceClient=s,this.serializableCache=c,this.persistencePlugin=l}validateTokenResponse(e,r,n){if(e.error||e.error_description||e.suberror){let o=`Error(s): ${e.error_codes||KY} - Timestamp: ${e.timestamp||KY} - Description: ${e.error_description||KY} - Correlation ID: ${e.correlation_id||KY} - Trace ID: ${e.trace_id||KY}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new VE(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=qBt&&e.status<=jBt){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. -${c}`,r);return}else if(n&&e.status&&e.status>=UBt&&e.status<=QBt){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. -${c}`,r);return}throw s$e(e.error,e.error_description,e.suberror)?new j1(e.error,e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",s):c}}async handleServerTokenResponse(e,r,n,o,s,c,l,u,d,f){let h;if(e.id_token){if(h=G3(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw Nt(sFt);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw Nt(ZTe);hIe(y,o.maxAge)}}this.homeAccountIdentifier=LFt(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=Jan(this.cryptoObj.base64Decode,c.state)),e.key_id=e.key_id||o.sshKid||void 0;let g=this.generateCacheRecord(e,r,n,o,h,l,c),A;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess",o.correlationId),A=new Q1(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(A)),u&&!d&&g.account&&this.cacheStorage.getAllAccounts({homeAccountId:g.account.homeAccountId,environment:g.account.environment},o.correlationId).length<1)return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache",o.correlationId),this.performanceClient?.addFields({acntLoggedOut:!0},o.correlationId),await t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,void 0,f);await this.cacheStorage.saveCacheRecord(g,o.correlationId,PFt(h||{}),s,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&A&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess",o.correlationId),await this.persistencePlugin.afterCacheAccess(A))}return t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,e,f)}generateCacheRecord(e,r,n,o,s,c,l){let u=r.getPreferredCache();if(!u)throw Nt(eIe);let d=JGe(s),f,h;e.id_token&&s&&(f=FFt(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=Zan(this.cacheStorage,r,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,s,e.client_info,u,d,l,void 0,this.logger,this.performanceClient));let m=null;if(e.access_token){let y=e.scope?tm.fromString(e.scope):new tm(o.scopes||[]),_=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,E=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,v=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,S=n+_,T=S+E,w=v&&v>0?n+v:void 0;m=UFt(this.homeAccountIdentifier,u,e.access_token,this.clientId,d||r.tenant||"",y.printScopes(),S,T,this.cryptoObj.base64Decode,w,e.token_type,c,e.key_id);let R=o.resource||null;R&&(m.resource=R)}let g=null;if(e.refresh_token){let y;if(e.refresh_token_expires_in){let _=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;y=n+_,this.performanceClient?.addFields({ntwkRtExpiresOnSeconds:y},o.correlationId)}g=QFt(this.homeAccountIdentifier,u,e.refresh_token,this.clientId,e.foci,c,y)}let A=null;return e.foci&&(A={clientId:this.clientId,environment:u,familyId:e.foci}),{account:h,idToken:f,accessToken:m,refreshToken:g,appMetadata:A}}static async generateAuthenticationResult(e,r,n,o,s,c,l,u,d,f){let h="",m=[],g=null,A,y,_="";if(n.accessToken){if(n.accessToken.tokenType===Tf.POP&&!s.popKid){let T=new DQ(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw Nt(AFt);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=tm.fromString(n.accessToken.target).asArray(),g=yIe(n.accessToken.expiresOn),A=yIe(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=yIe(n.accessToken.refreshOn))}n.appMetadata&&(_=n.appMetadata.familyId===ZY?ZY:"");let E=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let S=n.account?YGe(cle(n.account),void 0,l,n.idToken?.secret):null;return{authority:r.canonicalAuthority,uniqueId:E,tenantId:v,scopes:m,account:S,idToken:n?.idToken?.secret||"",idTokenClaims:l||{},accessToken:h,fromCache:o,expiresOn:g,extExpiresOn:A,refreshOn:y,correlationId:s.correlationId,requestId:f||"",familyId:_,tokenType:n.accessToken?.tokenType||"",state:u?u.userRequestState:"",cloudGraphHostName:n.account?.cloudGraphHostName||"",msGraphHost:n.account?.msGraphHost||"",code:d?.spa_code,fromPlatformBroker:!1}}};function Zan(t,e,r,n,o,s,c,l,u,d,f,h,m){h?.verbose("setCachedAccount called",o);let g=l||e.getPreferredCache(),A=t.getAccountsFilteredBy({homeAccountId:r,environment:g},o);m?.addFields({cacheMatchedAccounts:A.length},o),A.length>1&&h?.warning("Multiple base accounts matched homeAccountId. Ignoring cached account and creating a new base account.",o);let _=(A.length===1?A[0]:null)||OFt({homeAccountId:r,idTokenClaims:s,clientInfo:c,environment:l,cloudGraphHostName:d?.cloud_graph_host_name,msGraphHost:d?.msgraph_host,nativeAccountId:f},e,n),E=_.tenantProfiles||[],v=u||_.realm;if(v&&!E.find(S=>S.tenantId===v)){let S=uK(r,_.localAccountId,v,s);E.push(S)}return _.tenantProfiles=E,_}a(Zan,"buildAccountToCache");p();var WE={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};p();async function zE(t,e,r){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:r})}a(zE,"getClientAssertion");p();function fle(t,e,r){return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:r,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||e.extraParameters?.clientId}}a(fle,"getRequestThumbprint");var fK={};Ti(fK,{createTokenQueryParameters:()=>bIe,createTokenRequestHeaders:()=>CIe,executePostToTokenEndpoint:()=>SIe,sendPostRequest:()=>Xan});p();p();var vIe=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${zTe}.${JSON.stringify(e)}`}static preProcess(e,r,n){let o=t.generateThrottlingStorageKey(r),s=e.getThrottlingCache(o,n);if(s){if(s.throttleTime=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(eh.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){let r=e<=0?0:e,n=Date.now()/1e3;return Math.floor(Math.min(n+(r||XBt),n+e3t)*1e3)}static removeThrottle(e,r,n,o){let s=fle(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var ple=class t extends jo{static{a(this,"NetworkError")}constructor(e,r,n){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,t.prototype),this.name="NetworkError",this.error=e,this.httpStatus=r,this.responseHeaders=n}};function YFt(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new ple(t,e,r)}a(YFt,"createNetworkError");function CIe(t,e,r){let n={};if(n[eh.CONTENT_TYPE]=DBt,!e&&r)switch(r.type){case WE.HOME_ACCOUNT_ID:try{let o=EO(r.credential);n[eh.CCS_HEADER]=`Oid:${o.uid}@${o.utid}`}catch(o){t.verbose(`Could not parse home account ID for CCS Header: '${o}'`,"")}break;case WE.UPN:n[eh.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(CIe,"createTokenRequestHeaders");function bIe(t,e,r,n){let o=new Map;return t.embeddedClientId&&j3(o,e,r),t.extraQueryParameters&&q3(o,t.extraQueryParameters),aK(o,t.correlationId),rK(o,t.correlationId,n),yO(o)}a(bIe,"createTokenQueryParameters");async function SIe(t,e,r,n,o,s,c,l,u,d){let f=await Xan(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(SIe,"executePostToTokenEndpoint");async function Xan(t,e,r,n,o,s,c,l){vIe.preProcess(o,t,n);let u;try{u=await ra(s.sendPostRequestAsync.bind(s),Pan,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[eh.X_MS_HTTP_VERSION]||"",requestId:d[eh.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof ple){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[eh.X_MS_HTTP_VERSION]||"",requestId:f[eh.X_MS_REQUEST_ID]||"",contentTypeHeader:f[eh.CONTENT_TYPE]||void 0,contentLengthHeader:f[eh.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof jo?d:Nt(rFt)}return vIe.postProcess(o,t,u,n),u}a(Xan,"sendPostRequest");var l$e={};Ti(l$e,{createDiscoveredInstance:()=>JFt});p();p();p();function ecn(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(ecn,"isOpenIdConfigResponse");p();function tcn(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(tcn,"isCloudInstanceDiscoveryResponse");p();function rcn(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(rcn,"isCloudInstanceDiscoveryErrorResponse");p();var TIe=class t{static{a(this,"RegionDiscovery")}constructor(e,r,n,o){this.networkInterface=e,this.logger=r,this.performanceClient=n,this.correlationId=o}async detectRegion(e,r){let n=e;if(n)r.region_source=xQ.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await ra(this.getRegionFromIMDS.bind(this),jFt,this.logger,this.performanceClient,this.correlationId)(NBt,o);if(s.status===RGe&&(n=s.body,r.region_source=xQ.IMDS),s.status===kGe){let c=await ra(this.getCurrentVersion.bind(this),Wan,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=xQ.FAILED_AUTO_DETECTION,null;let l=await ra(this.getRegionFromIMDS.bind(this),jFt,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===RGe&&(n=l.body,r.region_source=xQ.IMDS)}}catch{return r.region_source=xQ.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=xQ.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${wGe}?api-version=${e}&format=text`,r,MBt)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${wGe}?format=json`,e);return r.status===kGe&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};TIe.IMDS_OPTIONS={headers:{Metadata:"true"}};var $P=class t{static{a(this,"Authority")}constructor(e,r,n,o,s,c,l,u){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=r,this.cacheManager=n,this.authorityOptions=o,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=s,this.performanceClient=l,this.correlationId=c,this.managedIdentity=u||!1,this.regionDiscovery=new TIe(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(TGe))return Jx.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case wBt:return Jx.Adfs;case RBt:return Jx.Dsts}return Jx.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new Ds(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw Nt(GP)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw Nt(GP)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw Nt(GP)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Nt(gFt);return this.replacePath(this.metadata.end_session_endpoint)}else throw Nt(GP)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw Nt(GP)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw Nt(GP)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Jx.Default&&this.protocolMode!==m_.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new Ds(this.metadata.canonical_authority).getUrlComponents(),s=o.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((l,u)=>{let d=s[u];if(u===0&&this.canReplaceTenant(o)){let f=new Ds(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];d!==f&&(this.logger.verbose(`Replacing tenant domain name '${d}' with id '${f}'`,this.correlationId),d=f)}l!==d&&(r=r.replace(`/${d}/`,`/${l}/`))}),this.replaceTenant(r)}get defaultOpenIdConfigurationEndpoint(){let e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Jx.Adfs||this.protocolMode===m_.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){let e=this.getCurrentMetadataEntity(),r=await ra(this.updateCloudDiscoveryMetadata.bind(this),Han,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await ra(this.updateEndpointMetadata.bind(this),$an,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,r,{source:n}),this.performanceClient?.addFields({cloudDiscoverySource:r,authorityEndpointSource:n},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort,this.correlationId);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:e$e(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==h_.CACHE&&n?.source!==h_.CACHE&&(e.expiresAt=e$e(),e.canonical_authority=this.canonicalAuthority);let o=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache,this.correlationId);this.cacheManager.setAuthorityMetadata(o,e,this.correlationId),this.metadata=e}async updateEndpointMetadata(e){let r=this.updateEndpointMetadataFromLocalSources(e);if(r){if(r.source===h_.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await ra(this.updateMetadataWithRegionalInformation.bind(this),qFt,this.logger,this.performanceClient,this.correlationId)(r.metadata);ule(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await ra(this.getEndpointMetadataFromNetwork.bind(this),Gan,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await ra(this.updateMetadataWithRegionalInformation.bind(this),qFt,this.logger,this.performanceClient,this.correlationId)(n)),ule(e,n,!0),h_.NETWORK;throw Nt(nFt,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration",this.correlationId);let r=this.getEndpointMetadataFromConfig();if(r)return this.logger.verbose("Found endpoint metadata in authority configuration",this.correlationId),ule(e,r,!1),{source:h_.CONFIG};this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values.",this.correlationId);let n=this.getEndpointMetadataFromHardcodedValues();if(n)return ule(e,n,!1),{source:h_.HARDCODED_VALUES,metadata:n};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.",this.correlationId);let o=t$e(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:h_.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new Ds(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Dl(Z3t)}return null}async getEndpointMetadataFromNetwork(){let e={},r=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from '${r}'`,this.correlationId);try{let n=await this.networkInterface.sendGetRequestAsync(r,e);return ecn(n.body)?n.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration",this.correlationId),null)}catch(n){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: '${n}'`,this.correlationId),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in DFt?DFt[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==OBt)return this.regionDiscoveryMetadata.region_outcome=YTe.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await ra(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),Van,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=YTe.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=YTe.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await ra(this.getCloudDiscoveryMetadataFromNetwork.bind(this),jan,this.logger,this.performanceClient,this.correlationId)();if(n)return _Ie(e,n,!0),h_.NETWORK;throw Dl(X3t)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||GTe}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||GTe}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||GTe}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),_Ie(e,r,!1),h_.CONFIG;this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values.",this.correlationId);let n=Tan(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),_Ie(e,n,!1),h_.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.",this.correlationId);let o=t$e(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),h_.CACHE):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Jx.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.",this.correlationId),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.",this.correlationId);try{this.logger.verbose("Attempting to parse the cloud discovery metadata.",this.correlationId);let e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=mIe(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata.",""),r)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata.",this.correlationId),r;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.",this.correlationId)}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.",this.correlationId),Dl(HGe)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host.",this.correlationId),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){let e=`${kBt}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(tcn(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(rcn(o.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: '${o.status}'`,this.correlationId),s=o.body,s.error===FBt)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance.",this.correlationId),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is '${s.error}'`,this.correlationId),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is '${s.error_description}'`,this.correlationId),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network, correlationId) to []",this.correlationId),c=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse",this.correlationId),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),n=mIe(c,this.hostnameAndPort)}catch(o){if(o instanceof jo)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. +${n}`),this.errors=e,this.name=Jsn}};function Ysn(t){return{error:t.error,errorDescription:t.error_description,correlationId:t.correlation_id,errorCodes:t.error_codes,timestamp:t.timestamp,traceId:t.trace_id}}a(Ysn,"convertOAuthErrorResponseToErrorResponse");var Kx=class extends Error{static{a(this,"AuthenticationRequiredError")}scopes;getTokenOptions;constructor(e){super(e.message,e.cause?{cause:e.cause}:void 0),this.scopes=e.scopes,this.getTokenOptions=e.getTokenOptions,this.name="AuthenticationRequiredError"}};p();p();p();p();var Zsn=require("node:os"),Xsn=fe(require("node:util"),1),ean=fe(require("node:process"),1);function tan(t,...e){ean.stderr.write(`${Xsn.default.format(t,...e)}${Zsn.EOL}`)}a(tan,"log");var ran=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,nan,yBt=[],_Bt=[],AGe=[];ran&&EBt(ran);var ian=Object.assign(t=>oan(t),{enable:EBt,enabled:vBt,disable:APo,log:tan});function EBt(t){nan=t,yBt=[],_Bt=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?_Bt.push(new RegExp(`^${n.substr(1)}$`)):yBt.push(new RegExp(`^${n}$`));for(let n of AGe)n.enabled=vBt(n.namespace)}a(EBt,"enable");function vBt(t){if(t.endsWith("*"))return!0;for(let e of _Bt)if(e.test(t))return!1;for(let e of yBt)if(e.test(t))return!0;return!1}a(vBt,"enabled");function APo(){let t=nan||"";return EBt(""),t}a(APo,"disable");function oan(t){let e=Object.assign(r,{enabled:vBt(t),destroy:yPo,log:ian.log,namespace:t,extend:_Po});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),AGe.push(e),e}a(oan,"createDebugger");function yPo(){let t=AGe.indexOf(this);return t>=0?(AGe.splice(t,1),!0):!1}a(yPo,"destroy");function _Po(t){let e=oan(`${this.namespace}:${t}`);return e.log=this.log,e}a(_Po,"extend");var Wce=ian;var aan=new Set,yGe=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,EGe,CBt=Wce("azure");CBt.log=(...t)=>{Wce.log(...t)};var bBt=["verbose","info","warning","error"];yGe&&(uan(yGe)?EPo(yGe):console.error(`AZURE_LOG_LEVEL set to unknown log level '${yGe}'; logging is not enabled. Acceptable values: ${bBt.join(", ")}.`));function EPo(t){if(t&&!uan(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${bBt.join(",")}`);EGe=t;let e=[];for(let r of aan)lan(r)&&e.push(r.namespace);Wce.enable(e.join(","))}a(EPo,"setLogLevel");function vGe(){return EGe}a(vGe,"getLogLevel");var san={verbose:400,info:300,warning:200,error:100};function SQ(t){let e=CBt.extend(t);return can(CBt,e),{error:_Ge(e,"error"),warning:_Ge(e,"warning"),info:_Ge(e,"info"),verbose:_Ge(e,"verbose")}}a(SQ,"createClientLogger");function can(t,e){e.log=(...r)=>{t.log(...r)}}a(can,"patchLogMethod");function _Ge(t,e){let r=Object.assign(t.extend(e),{level:e});if(can(t,r),lan(r)){let n=Wce.disable();Wce.enable(n+","+r.namespace)}return aan.add(r),r}a(_Ge,"createLogger");function lan(t){return!!(EGe&&san[t.level]<=san[EGe])}a(lan,"shouldEnable");function uan(t){return bBt.includes(t)}a(uan,"isAzureLogLevel");var U1=SQ("identity");function CGe(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(CGe,"processEnvVars");function hg(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(hg,"formatSuccess");function $s(t,e){let r="ERROR.";return t?.length&&(r+=` Scopes: ${Array.isArray(t)?t.join(", "):t}.`),`${r} Error message: ${typeof e=="string"?e:e.message}.`}a($s,"formatError");function dan(t,e,r=U1){let n=e?`${e.fullTitle} ${t}`:t;function o(u){r.info(`${n} =>`,u)}a(o,"info");function s(u){r.warning(`${n} =>`,u)}a(s,"warning");function c(u){r.verbose(`${n} =>`,u)}a(c,"verbose");function l(u){r.error(`${n} =>`,u)}return a(l,"error"),{title:t,fullTitle:n,info:o,warning:s,verbose:c,error:l}}a(dan,"credentialLoggerInstance");function fo(t,e=U1){let r=dan(t,void 0,e);return{...r,parent:e,getToken:dan("=> getToken()",r,e)}}a(fo,"credentialLogger");p();p();p();p();var zce={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function fan(t={}){let e=new SBt(t.parentContext);return t.span&&(e=e.setValue(zce.span,t.span)),t.namespace&&(e=e.setValue(zce.namespace,t.namespace)),e}a(fan,"createTracingContext");var SBt=class t{static{a(this,"TracingContextImpl")}constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,r){let n=new t(this);return n._contextMap.set(e,r),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let r=new t(this);return r._contextMap.delete(e),r}};p();var pan=fe(TBt(),1),SGe=pan.state;function vPo(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(vPo,"createDefaultTracingSpan");function CPo(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:vPo(),tracingContext:fan({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(CPo,"createDefaultInstrumenter");function QTe(){return SGe.instrumenterImplementation||(SGe.instrumenterImplementation=CPo()),SGe.instrumenterImplementation}a(QTe,"getInstrumenter");p();function qTe(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=QTe().startSpan(d,Object.assign(Object.assign({},h),{packageName:r,packageVersion:n,tracingContext:(m=f?.tracingOptions)===null||m===void 0?void 0:m.tracingContext})),A=g.tracingContext,y=g.span;A.getValue(zce.namespace)||(A=A.setValue(zce.namespace,e)),y.setAttribute("az.namespace",A.getValue(zce.namespace));let _=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:_}}a(o,"startSpan");async function s(d,f,h,m){let{span:g,updatedOptions:A}=o(d,f,m);try{let y=await c(A.tracingOptions.tracingContext,()=>Promise.resolve(h(A,g)));return g.setStatus({status:"success"}),y}catch(y){throw g.setStatus({status:"error",error:y}),y}finally{g.end()}}a(s,"withSpan");function c(d,f,...h){return QTe().withContext(d,f,...h)}a(c,"withContext");function l(d){return QTe().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return QTe().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(qTe,"createTracingClient");var Vc=qTe({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:hGe});var IBt=fo("ChainedTokenCredential"),jTe=class{static{a(this,"ChainedTokenCredential")}_sources=[];constructor(...e){this._sources=e}async getToken(e,r={}){let{token:n}=await this.getTokenInternal(e,r);return n}async getTokenInternal(e,r={}){let n=null,o,s=[];return Vc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new UTe(s,"ChainedTokenCredential authentication failed.");throw IBt.getToken.info($s(e,l)),l}if(IBt.getToken.info(`Result for ${o.constructor.name}: ${hg(e)}`),n===null)throw new Fn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var $1={};Ti($1,{AuthError:()=>jo,AuthErrorCodes:()=>mle,AzureCloudInstance:()=>H3,ClientAssertion:()=>W3,ClientAuthError:()=>wQ,ClientAuthErrorCodes:()=>th,ClientConfigurationError:()=>rle,ClientConfigurationErrorCodes:()=>ile,ConfidentialClientApplication:()=>Dle,CryptoProvider:()=>vO,DistributedCachePlugin:()=>cVe,InteractionRequiredAuthError:()=>j1,InteractionRequiredAuthErrorCodes:()=>o$e,LogLevel:()=>If,Logger:()=>gg,ManagedIdentityApplication:()=>Nle,ManagedIdentitySourceNames:()=>ao,PromptValue:()=>mBo,ProtocolMode:()=>m_,PublicClientApplication:()=>kle,ResponseMode:()=>gBo,ServerError:()=>VE,TokenCache:()=>yle,TokenCacheContext:()=>Q1,internals:()=>XFt,version:()=>G1});p();var XFt={};Ti(XFt,{Deserializer:()=>V3,Serializer:()=>TQ});p();p();var TQ=class{static{a(this,"Serializer")}static serializeJSONBlob(e){return JSON.stringify(e)}static serializeAccounts(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,realm:o.realm,local_account_id:o.localAccountId,username:o.username,authority_type:o.authorityType,name:o.name,client_info:o.clientInfo,last_modification_time:o.lastModificationTime,last_modification_app:o.lastModificationApp,tenantProfiles:o.tenantProfiles?.map(s=>JSON.stringify(s))}}),r}static serializeIdTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm}}),r}static serializeAccessTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm,target:o.target,cached_at:o.cachedAt,expires_on:o.expiresOn,extended_expires_on:o.extendedExpiresOn,refresh_on:o.refreshOn,key_id:o.keyId,token_type:o.tokenType,userAssertionHash:o.userAssertionHash,resource:o.resource}}),r}static serializeRefreshTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,family_id:o.familyId,target:o.target,realm:o.realm}}),r}static serializeAppMetadata(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={client_id:o.clientId,environment:o.environment,family_id:o.familyId}}),r}static serializeAllCache(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}}};p();p();p();var dn={};Ti(dn,{addApplicationTelemetry:()=>rIe,addAuthorizationCode:()=>xFt,addBrokerParameters:()=>j3,addCcsOid:()=>Q3,addCcsUpn:()=>RQ,addClaims:()=>aK,addCliData:()=>kFt,addClientAssertion:()=>oIe,addClientAssertionType:()=>sIe,addClientCapabilitiesToClaims:()=>yan,addClientId:()=>oK,addClientInfo:()=>lK,addClientSecret:()=>iIe,addCodeChallengeParams:()=>w2o,addCodeVerifier:()=>RFt,addCorrelationId:()=>cK,addDeviceCode:()=>R2o,addDomainHint:()=>SFt,addEARParameters:()=>M2o,addExtraParameters:()=>q3,addGrantType:()=>aIe,addIdTokenHint:()=>bFt,addInstanceAware:()=>cIe,addLibraryInfo:()=>tIe,addLoginHint:()=>sle,addLogoutHint:()=>PFt,addNativeBroker:()=>x2o,addNonce:()=>IFt,addOboAssertion:()=>k2o,addPassword:()=>N2o,addPopToken:()=>lIe,addPostLogoutRedirectUri:()=>CFt,addPrompt:()=>TFt,addRedirectUri:()=>sK,addRefreshToken:()=>wFt,addRequestTokenUse:()=>P2o,addResource:()=>pIe,addResponseMode:()=>vFt,addResponseType:()=>I2o,addScopes:()=>iK,addServerTelemetry:()=>dIe,addSid:()=>zGe,addSshJwk:()=>uIe,addState:()=>nIe,addThrottling:()=>fIe,addUsername:()=>D2o,instrumentBrokerParams:()=>nK});p();var rr={};Ti(rr,{AADAuthority:()=>jP,AAD_INSTANCE_DISCOVERY_ENDPT:()=>PBt,AAD_TENANT_DOMAIN_SUFFIX:()=>DBt,ADFS:()=>RBt,APP_METADATA:()=>Xce,AUTHORITY_METADATA_CACHE_KEY:()=>ele,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>zBt,AUTHORIZATION_PENDING:()=>IPo,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>LBt,AuthenticationScheme:()=>Tf,AuthorityMetadataSource:()=>h_,CACHE_ACCOUNT_TYPE_ADFS:()=>VBt,CACHE_ACCOUNT_TYPE_GENERIC:()=>DGe,CACHE_ACCOUNT_TYPE_MSAV1:()=>$Po,CACHE_ACCOUNT_TYPE_MSSTS:()=>$Bt,CACHE_KEY_SEPARATOR:()=>ZY,CIAM_AUTH_URL:()=>TGe,CLIENT_INFO:()=>WBt,CLIENT_INFO_SEPARATOR:()=>Zce,CLIENT_MISMATCH_ERROR:()=>i3t,CODE_GRANT_TYPE:()=>SPo,CONSUMER_UTID:()=>bPo,CacheOutcome:()=>HP,CacheType:()=>VPo,ClaimsRequestKeys:()=>Jce,CodeChallengeMethodValues:()=>HPo,CredentialType:()=>mg,DEFAULT_AUTHORITY:()=>han,DEFAULT_AUTHORITY_HOST:()=>wBt,DEFAULT_COMMON_TENANT:()=>HTe,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>t3t,DEFAULT_THROTTLE_TIME_SECONDS:()=>e3t,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>o3t,DSTS:()=>kBt,EMAIL_SCOPE:()=>Aan,EncodingTypes:()=>KPo,FORWARD_SLASH:()=>Yce,GrantType:()=>VTe,HTTP_BAD_REQUEST:()=>kGe,HTTP_CLIENT_ERROR:()=>PPo,HTTP_CLIENT_ERROR_RANGE_END:()=>qBt,HTTP_CLIENT_ERROR_RANGE_START:()=>QBt,HTTP_GATEWAY_TIMEOUT:()=>UPo,HTTP_GONE:()=>OPo,HTTP_MULTI_SIDED_ERROR:()=>QPo,HTTP_NOT_FOUND:()=>NPo,HTTP_REDIRECT:()=>kPo,HTTP_REQUEST_TIMEOUT:()=>MPo,HTTP_SERVER_ERROR:()=>BPo,HTTP_SERVER_ERROR_RANGE_END:()=>HBt,HTTP_SERVER_ERROR_RANGE_START:()=>jBt,HTTP_SERVICE_UNAVAILABLE:()=>FPo,HTTP_SUCCESS:()=>RGe,HTTP_SUCCESS_RANGE_END:()=>RPo,HTTP_SUCCESS_RANGE_START:()=>wPo,HTTP_TOO_MANY_REQUESTS:()=>LPo,HTTP_UNAUTHORIZED:()=>DPo,HeaderNames:()=>eh,HttpMethod:()=>qPo,IMDS_ENDPOINT:()=>wGe,IMDS_TIMEOUT:()=>OBt,IMDS_VERSION:()=>MBt,INVALID_GRANT_ERROR:()=>n3t,INVALID_INSTANCE:()=>UBt,JsonWebTokenTypes:()=>zPo,KNOWN_PUBLIC_CLOUDS:()=>FBt,NOT_APPLICABLE:()=>GTe,NOT_AVAILABLE:()=>JY,OAuthResponseType:()=>GPo,OFFLINE_ACCESS_SCOPE:()=>xGe,OIDC_DEFAULT_SCOPES:()=>Kce,OIDC_SCOPES:()=>PGe,ONE_DAY_IN_MS:()=>YPo,OPENID_SCOPE:()=>man,PROFILE_SCOPE:()=>gan,PasswordGrantConstants:()=>OGe,PersistentCacheKeys:()=>jPo,PromptValue:()=>$Te,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>BBt,RESOURCE_DELIM:()=>IGe,RegionDiscoveryOutcomes:()=>YTe,RegionDiscoverySources:()=>xQ,ResponseMode:()=>GBt,S256_CODE_CHALLENGE_METHOD:()=>TPo,SERVER_TELEM_CACHE_KEY:()=>WTe,SERVER_TELEM_CATEGORY_SEPARATOR:()=>MGe,SERVER_TELEM_MAX_CACHED_ERRORS:()=>KBt,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>WPo,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>YBt,SERVER_TELEM_OVERFLOW_FALSE:()=>ZBt,SERVER_TELEM_OVERFLOW_TRUE:()=>JBt,SERVER_TELEM_SCHEMA_VERSION:()=>NGe,SERVER_TELEM_UNKNOWN_ERROR:()=>XBt,SERVER_TELEM_VALUE_SEPARATOR:()=>IQ,SHR_NONCE_VALIDITY:()=>xPo,SKU:()=>xBt,THE_FAMILY_ID:()=>XY,THROTTLING_PREFIX:()=>zTe,URL_FORM_CONTENT_TYPE:()=>NBt,X_MS_LIB_CAPABILITY_VALUE:()=>r3t});p();var xBt="msal.js.common",han="https://login.microsoftonline.com/common/",wBt="login.microsoftonline.com",HTe="common",RBt="adfs",kBt="dstsv2",PBt=`${han}discovery/instance?api-version=1.1&authorization_endpoint=`,TGe=".ciamlogin.com",DBt=".onmicrosoft.com",IGe="|",bPo="9188040d-6c67-4c5b-b112-36a304b66dad",man="openid",gan="profile",xGe="offline_access",Aan="email",SPo="authorization_code",TPo="S256",NBt="application/x-www-form-urlencoded;charset=utf-8",IPo="authorization_pending",GTe="N/A",JY="Not Available",Yce="/",wGe="http://169.254.169.254/metadata/instance/compute/location",MBt="2020-06-01",OBt=2e3,LBt="TryAutoDetect",BBt="login.microsoft.com",FBt=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],xPo=240,UBt="invalid_instance",RGe=200,wPo=200,RPo=299,kPo=302,PPo=400,QBt=400,kGe=400,DPo=401,NPo=404,MPo=408,OPo=410,LPo=429,qBt=499,BPo=500,jBt=500,FPo=503,UPo=504,HBt=599,QPo=600,qPo={GET:"GET",POST:"POST"},Kce=[man,gan,xGe],PGe=[...Kce,Aan],eh={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},jPo={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},jP={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},Jce={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},$Te={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},HPo={PLAIN:"plain",S256:"S256"},GPo={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},GBt={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},VTe={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},$Bt="MSSTS",VBt="ADFS",$Po="MSA",DGe="Generic",ZY="-",Zce=".",mg={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},VPo={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},Xce="appmetadata",WBt="client_info",XY="1",ele="authority-metadata",zBt=3600*24,h_={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},NGe=5,WPo=80,YBt=330,KBt=50,WTe="server-telemetry",MGe="|",IQ=",",JBt="1",ZBt="0",XBt="unknown_error",Tf={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},e3t=60,t3t=3600,zTe="throttling",r3t="retry-after, h429",n3t="invalid_grant",i3t="client_mismatch",OGe={username:"username",password:"password"},xQ={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},YTe={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},HP={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},zPo={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},YPo=864e5,o3t=300,KPo={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var eK={};Ti(eK,{ACCESS_TOKEN:()=>XPo,BROKER_CLIENT_ID:()=>KTe,BROKER_REDIRECT_URI:()=>QGe,CCS_HEADER:()=>a2o,CLAIMS:()=>l3t,CLIENT_ASSERTION:()=>N3t,CLIENT_ASSERTION_TYPE:()=>M3t,CLIENT_ID:()=>AO,CLIENT_INFO:()=>i2o,CLIENT_REQUEST_ID:()=>_3t,CLIENT_SECRET:()=>D3t,CLI_DATA:()=>$3t,CODE:()=>m3t,CODE_CHALLENGE:()=>g3t,CODE_CHALLENGE_METHOD:()=>A3t,CODE_VERIFIER:()=>y3t,DEVICE_CODE:()=>P3t,DOMAIN_HINT:()=>q3t,EAR_JWE_CRYPTO:()=>H3t,EAR_JWK:()=>j3t,ERROR:()=>JPo,ERROR_DESCRIPTION:()=>ZPo,EXPIRES_IN:()=>t2o,FOCI:()=>s2o,GRANT_TYPE:()=>c3t,ID_TOKEN:()=>e2o,ID_TOKEN_HINT:()=>k3t,INSTANCE_AWARE:()=>tle,LOGIN_HINT:()=>Q3t,LOGOUT_HINT:()=>F3t,NATIVE_BROKER:()=>B3t,NONCE:()=>p3t,OBO_ASSERTION:()=>O3t,ON_BEHALF_OF:()=>o2o,POST_LOGOUT_URI:()=>R3t,PROMPT:()=>h3t,REDIRECT_URI:()=>LGe,REFRESH_TOKEN:()=>d3t,REFRESH_TOKEN_EXPIRES_IN:()=>r2o,REQUESTED_TOKEN_USE:()=>L3t,REQ_CNF:()=>FGe,RESOURCE:()=>G3t,RESPONSE_MODE:()=>a3t,RESPONSE_TYPE:()=>s3t,RETURN_SPA_CODE:()=>UGe,SCOPE:()=>u3t,SESSION_STATE:()=>n2o,SID:()=>U3t,STATE:()=>f3t,TOKEN_TYPE:()=>BGe,X_APP_NAME:()=>x3t,X_APP_VER:()=>w3t,X_CLIENT_CPU:()=>b3t,X_CLIENT_CURR_TELEM:()=>S3t,X_CLIENT_EXTRA_SKU:()=>c2o,X_CLIENT_LAST_TELEM:()=>T3t,X_CLIENT_OS:()=>C3t,X_CLIENT_SKU:()=>E3t,X_CLIENT_VER:()=>v3t,X_MS_LIB_CAPABILITY:()=>I3t});p();var AO="client_id",LGe="redirect_uri",s3t="response_type",a3t="response_mode",c3t="grant_type",l3t="claims",u3t="scope",JPo="error",ZPo="error_description",XPo="access_token",e2o="id_token",d3t="refresh_token",t2o="expires_in",r2o="refresh_token_expires_in",f3t="state",p3t="nonce",h3t="prompt",n2o="session_state",i2o="client_info",m3t="code",g3t="code_challenge",A3t="code_challenge_method",y3t="code_verifier",_3t="client-request-id",E3t="x-client-SKU",v3t="x-client-VER",C3t="x-client-OS",b3t="x-client-CPU",S3t="x-client-current-telemetry",T3t="x-client-last-telemetry",I3t="x-ms-lib-capability",x3t="x-app-name",w3t="x-app-ver",R3t="post_logout_redirect_uri",k3t="id_token_hint",P3t="device_code",D3t="client_secret",N3t="client_assertion",M3t="client_assertion_type",BGe="token_type",FGe="req_cnf",O3t="assertion",L3t="requested_token_use",o2o="on_behalf_of",s2o="foci",a2o="X-AnchorMailbox",UGe="return_spa_code",B3t="nativebroker",F3t="logout_hint",U3t="sid",Q3t="login_hint",q3t="domain_hint",c2o="x-client-xtra-sku",KTe="brk_client_id",QGe="brk_redirect_uri",tle="instance_aware",j3t="ear_jwk",H3t="ear_jwe_crypto",G3t="resource",$3t="clidata";p();p();p();function qGe(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(qGe,"getDefaultErrorMessage");var jo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?qGe(e):""),s=o?`${e}: ${o}`:e;super(s),Object.setPrototypeOf(this,t.prototype),this.errorCode=e||"",this.errorMessage=o||"",this.subError=n||"",this.name="AuthError"}setCorrelationId(e){this.correlationId=e}};function tK(t,e){return new jo(t,e||qGe(t))}a(tK,"createAuthError");var rle=class t extends jo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function Dl(t){return new rle(t)}a(Dl,"createClientConfigurationError");p();var Su=class{static{a(this,"StringUtils")}static isEmptyObj(e){if(e)try{let r=JSON.parse(e);return Object.keys(r).length===0}catch{}return!0}static startsWith(e,r){return e.indexOf(r)===0}static endsWith(e,r){return e.length>=r.length&&e.lastIndexOf(r)===e.length-r.length}static queryStringToObject(e){let r={},n=e.split("&"),o=a(s=>decodeURIComponent(s.replace(/\+/g," ")),"decode");return n.forEach(s=>{if(s.trim()){let[c,l]=s.split(/=(.+)/g,2);c&&l&&(r[o(c)]=o(l))}}),r}static trimArrayEntries(e){return e.map(r=>r.trim())}static removeEmptyStringsFromArray(e){return e.filter(r=>!!r)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}};p();var wQ=class t extends jo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function Nt(t,e){return new wQ(t,e)}a(Nt,"createClientAuthError");var ile={};Ti(ile,{authorityMismatch:()=>g2o,authorityUriInsecure:()=>W3t,cannotAllowPlatformBroker:()=>m2o,cannotSetOIDCOptions:()=>h2o,claimsRequestParsingError:()=>l2o,emptyInputScopesError:()=>Y3t,invalidAuthenticationHeader:()=>p2o,invalidAuthorityMetadata:()=>X3t,invalidClaims:()=>jGe,invalidCloudDiscoveryMetadata:()=>HGe,invalidCodeChallengeMethod:()=>u2o,invalidRequestMethodForEAR:()=>A2o,logoutRequestEmpty:()=>J3t,missingNonceAuthenticationHeader:()=>f2o,missingSshJwk:()=>JTe,missingSshKid:()=>d2o,pkceParamsMissing:()=>Z3t,redirectUriEmpty:()=>V3t,tokenRequestEmpty:()=>K3t,untrustedAuthority:()=>eFt,urlEmptyError:()=>z3t,urlParseError:()=>nle});p();var V3t="redirect_uri_empty",l2o="claims_request_parsing_error",W3t="authority_uri_insecure",nle="url_parse_error",z3t="empty_url_error",Y3t="empty_input_scopes_error",jGe="invalid_claims",K3t="token_request_empty",J3t="logout_request_empty",u2o="invalid_code_challenge_method",Z3t="pkce_params_missing",HGe="invalid_cloud_discovery_metadata",X3t="invalid_authority_metadata",eFt="untrusted_authority",JTe="missing_ssh_jwk",d2o="missing_ssh_kid",f2o="missing_nonce_authentication_header",p2o="invalid_authentication_header",h2o="cannot_set_OIDCOptions",m2o="cannot_allow_platform_broker",g2o="authority_mismatch",A2o="invalid_request_method_for_EAR";var th={};Ti(th,{authTimeNotFound:()=>ZTe,authorizationCodeMissingFromServerResponse:()=>gFt,bindingKeyNotRemoved:()=>v2o,cannotAppendScopeSet:()=>fFt,cannotRemoveEmptyScope:()=>dFt,clientInfoDecodingError:()=>GGe,clientInfoEmptyError:()=>tFt,emptyInputScopeSet:()=>WGe,endSessionEndpointNotSupported:()=>AFt,endpointResolutionError:()=>GP,hashNotDeserialized:()=>oFt,invalidCacheEnvironment:()=>eIe,invalidCacheRecord:()=>pFt,invalidState:()=>rK,keyIdMissing:()=>yFt,maxAgeTranspired:()=>cFt,methodNotImplemented:()=>Ps,misplacedResourceParam:()=>EFt,multipleMatchingAppMetadata:()=>lFt,multipleMatchingTokens:()=>y2o,nestedAppAuthBridgeDisabled:()=>S2o,networkError:()=>nFt,noAccountFound:()=>_2o,noAccountInSilentRequest:()=>XTe,noCryptoObject:()=>hFt,noNetworkConnectivity:()=>C2o,nonceMismatch:()=>aFt,nullOrEmptyToken:()=>rFt,openIdConfigError:()=>iFt,platformBrokerError:()=>T2o,requestCannotBeMade:()=>uFt,resourceParameterRequired:()=>_Ft,stateMismatch:()=>sFt,stateNotFound:()=>VGe,tokenClaimsCnfRequiredForSignedJwt:()=>mFt,tokenParsingError:()=>$Ge,tokenRefreshRequired:()=>ole,unexpectedCredentialType:()=>E2o,userCanceled:()=>b2o});p();var GGe="client_info_decoding_error",tFt="client_info_empty_error",$Ge="token_parsing_error",rFt="null_or_empty_token",GP="endpoints_resolution_error",nFt="network_error",iFt="openid_config_error",oFt="hash_not_deserialized",rK="invalid_state",sFt="state_mismatch",VGe="state_not_found",aFt="nonce_mismatch",ZTe="auth_time_not_found",cFt="max_age_transpired",y2o="multiple_matching_tokens",lFt="multiple_matching_appMetadata",uFt="request_cannot_be_made",dFt="cannot_remove_empty_scope",fFt="cannot_append_scopeset",WGe="empty_input_scopeset",XTe="no_account_in_silent_request",pFt="invalid_cache_record",eIe="invalid_cache_environment",_2o="no_account_found",hFt="no_crypto_object",E2o="unexpected_credential_type",ole="token_refresh_required",mFt="token_claims_cnf_required_for_signedjwt",gFt="authorization_code_missing_from_server_response",v2o="binding_key_not_removed",AFt="end_session_endpoint_not_supported",yFt="key_id_missing",C2o="no_network_connectivity",b2o="user_canceled",Ps="method_not_implemented",S2o="nested_app_auth_bridge_disabled",T2o="platform_broker_error",_Ft="resource_parameter_required",EFt="misplaced_resource_parameter";var tm=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?Su.trimArrayEntries([...e]):[],n=r?Su.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw Dl(Y3t);this.scopes=new Set,n.forEach(o=>this.scopes.add(o))}static fromString(e){let n=(e||"").split(" ");return new t(n)}static createSearchScopes(e){let r=e&&e.length>0?e:[...Kce],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(xGe):n.removeOIDCScopes(),n}containsScope(e){let r=this.printScopesLowerCase().split(" "),n=new t(r);return e?n.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(r=>this.containsScope(r))}containsOnlyOIDCScopes(){let e=0;return PGe.forEach(r=>{this.containsScope(r)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(r=>this.appendScope(r))}catch{throw Nt(fFt)}}removeScope(e){if(!e)throw Nt(dFt);this.scopes.delete(e.trim())}removeOIDCScopes(){PGe.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw Nt(WGe);let r=new Set;return e.scopes.forEach(n=>r.add(n.toLowerCase())),this.scopes.forEach(n=>r.add(n.toLowerCase())),r}intersectingScopeSets(e){if(!e)throw Nt(WGe);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();let r=this.unionScopeSets(e),n=e.getScopeCount(),o=this.getScopeCount();return r.sizee.push(r)),e}printScopes(){return this.scopes?this.asArray().join(" "):""}printScopesLowerCase(){return this.printScopes().toLowerCase()}};function nK(t,e,r){if(!e)return;let n=t.get(AO);n&&t.has(KTe)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get(LGe)},e)}a(nK,"instrumentBrokerParams");function I2o(t,e){t.set(s3t,e)}a(I2o,"addResponseType");function vFt(t,e){t.set(a3t,e||GBt.QUERY)}a(vFt,"addResponseMode");function x2o(t){t.set(B3t,"1")}a(x2o,"addNativeBroker");function iK(t,e,r=!0,n=Kce){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new tm(o);t.set(u3t,s.printScopes())}a(iK,"addScopes");function oK(t,e){t.set(AO,e)}a(oK,"addClientId");function sK(t,e){t.set(LGe,e)}a(sK,"addRedirectUri");function CFt(t,e){t.set(R3t,e)}a(CFt,"addPostLogoutRedirectUri");function bFt(t,e){t.set(k3t,e)}a(bFt,"addIdTokenHint");function SFt(t,e){t.set(q3t,e)}a(SFt,"addDomainHint");function sle(t,e){t.set(Q3t,e)}a(sle,"addLoginHint");function RQ(t,e){t.set(eh.CCS_HEADER,`UPN:${e}`)}a(RQ,"addCcsUpn");function Q3(t,e){t.set(eh.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(Q3,"addCcsOid");function zGe(t,e){t.set("sid",e)}a(zGe,"addSid");function aK(t,e,r){let n=yan(e,r);try{JSON.parse(n)}catch{throw Dl(jGe)}t.set(l3t,n)}a(aK,"addClaims");function cK(t,e){t.set(_3t,e)}a(cK,"addCorrelationId");function tIe(t,e){t.set(E3t,e.sku),t.set(v3t,e.version),e.os&&t.set(C3t,e.os),e.cpu&&t.set(b3t,e.cpu)}a(tIe,"addLibraryInfo");function rIe(t,e){e?.appName&&t.set(x3t,e.appName),e?.appVersion&&t.set(w3t,e.appVersion)}a(rIe,"addApplicationTelemetry");function TFt(t,e){t.set(h3t,e)}a(TFt,"addPrompt");function nIe(t,e){e&&t.set(f3t,e)}a(nIe,"addState");function IFt(t,e){t.set(p3t,e)}a(IFt,"addNonce");function w2o(t,e,r){if(e&&r)t.set(g3t,e),t.set(A3t,r);else throw Dl(Z3t)}a(w2o,"addCodeChallengeParams");function xFt(t,e){t.set(m3t,e)}a(xFt,"addAuthorizationCode");function R2o(t,e){t.set(P3t,e)}a(R2o,"addDeviceCode");function wFt(t,e){t.set(d3t,e)}a(wFt,"addRefreshToken");function RFt(t,e){t.set(y3t,e)}a(RFt,"addCodeVerifier");function iIe(t,e){t.set(D3t,e)}a(iIe,"addClientSecret");function oIe(t,e){e&&t.set(N3t,e)}a(oIe,"addClientAssertion");function sIe(t,e){e&&t.set(M3t,e)}a(sIe,"addClientAssertionType");function k2o(t,e){t.set(O3t,e)}a(k2o,"addOboAssertion");function P2o(t,e){t.set(L3t,e)}a(P2o,"addRequestTokenUse");function aIe(t,e){t.set(c3t,e)}a(aIe,"addGrantType");function lK(t){t.set(WBt,"1")}a(lK,"addClientInfo");function kFt(t){t.set($3t,"1")}a(kFt,"addCliData");function cIe(t){t.has(tle)||t.set(tle,"true")}a(cIe,"addInstanceAware");function q3(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(q3,"addExtraParameters");function yan(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw Dl(jGe)}return e&&e.length>0&&(r.hasOwnProperty(Jce.ACCESS_TOKEN)||(r[Jce.ACCESS_TOKEN]={}),r[Jce.ACCESS_TOKEN][Jce.XMS_CC]={values:e}),JSON.stringify(r)}a(yan,"addClientCapabilitiesToClaims");function D2o(t,e){t.set(OGe.username,e)}a(D2o,"addUsername");function N2o(t,e){t.set(OGe.password,e)}a(N2o,"addPassword");function lIe(t,e){e&&(t.set(BGe,Tf.POP),t.set(FGe,e))}a(lIe,"addPopToken");function uIe(t,e){e&&(t.set(BGe,Tf.SSH),t.set(FGe,e))}a(uIe,"addSshJwk");function dIe(t,e){t.set(S3t,e.generateCurrentRequestHeaderValue()),t.set(T3t,e.generateLastRequestHeaderValue())}a(dIe,"addServerTelemetry");function fIe(t){t.set(I3t,r3t)}a(fIe,"addThrottling");function PFt(t,e){t.set(F3t,e)}a(PFt,"addLogoutHint");function j3(t,e,r){t.has(KTe)||t.set(KTe,e),t.has(QGe)||t.set(QGe,r)}a(j3,"addBrokerParameters");function M2o(t,e){t.set(j3t,encodeURIComponent(e)),t.set(H3t,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(M2o,"addEARParameters");function pIe(t,e){e&&t.set(G3t,e)}a(pIe,"addResource");var NA={};Ti(NA,{getDeserializedResponse:()=>O2o,mapToQueryString:()=>yO,normalizeUrlForComparison:()=>L2o,stripLeadingHashOrQuery:()=>Ean});p();function _an(t){if(!t)return t;let e=t.toLowerCase();return Su.endsWith(e,"?")?e=e.slice(0,-1):Su.endsWith(e,"?/")&&(e=e.slice(0,-2)),Su.endsWith(e,"/")||(e+="/"),e}a(_an,"canonicalizeUrl");function Ean(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(Ean,"stripLeadingHashOrQuery");function O2o(t){if(!t||t.indexOf("=")<0)return null;try{let e=Ean(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch{throw Nt(oFt)}return null}a(O2o,"getDeserializedResponse");function yO(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(yO,"mapToQueryString");function L2o(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return _an(n)}catch{return _an(e)}}a(L2o,"normalizeUrlForComparison");p();p();var ale={createNewGuid:a(()=>{throw Nt(Ps)},"createNewGuid"),base64Decode:a(()=>{throw Nt(Ps)},"base64Decode"),base64Encode:a(()=>{throw Nt(Ps)},"base64Encode"),base64UrlEncode:a(()=>{throw Nt(Ps)},"base64UrlEncode"),encodeKid:a(()=>{throw Nt(Ps)},"encodeKid"),async getPublicKeyThumbprint(){throw Nt(Ps)},async removeTokenBindingKey(){throw Nt(Ps)},async clearKeystore(){throw Nt(Ps)},async signJwt(){throw Nt(Ps)},async hashString(){throw Nt(Ps)}};p();var If;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(If||(If={}));var B2o=50,F2o=500,uK=new Map;function U2o(t,e){uK.delete(t),uK.set(t,e)}a(U2o,"markAsRecentlyUsed");function Q2o(t,e){let r=Date.now(),n=uK.get(t);if(n)U2o(t,n);else if(n={logs:[],firstEventTime:r},uK.set(t,n),uK.size>B2o){let o=uK.keys().next().value;o&&uK.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>F2o&&n.logs.shift()}a(Q2o,"addLogToCache");function q2o(t){if(t.length!==6)return!1;for(let e=0;e="a"&&r<="z"||r>="A"&&r<="Z"||r>="0"&&r<="9"))return!1}return!0}a(q2o,"isHashedString");var gg=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=If.Info;let o=a(()=>{},"defaultLoggerCallback"),s=e||t.createDefaultLoggerOptions();this.localCallback=s.loggerCallback||o,this.piiLoggingEnabled=s.piiLoggingEnabled||!1,this.level=typeof s.logLevel=="number"?s.logLevel:If.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:If.Info}}clone(e,r){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level},e,r)}logMessage(e,r){let n=r.correlationId;if(q2o(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};Q2o(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${If[r.logLevel]} - ${e}`;this.executeCallback(r.logLevel,l,r.containsPii||!1)}executeCallback(e,r,n){this.localCallback&&this.localCallback(e,r,n)}error(e,r){this.logMessage(e,{logLevel:If.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:If.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:If.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:If.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:If.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:If.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:If.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:If.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:If.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:If.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var kQ="@azure/msal-common",_O="16.4.1";p();var H3={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};p();p();function van(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(van,"tenantIdMatchesHomeTenant");function dK(t,e,r,n){if(n){let{oid:o,sub:s,tid:c,name:l,tfp:u,acr:d,preferred_username:f,upn:h,login_hint:m}=n,g=c||u||d||"";return{tenantId:g,localAccountId:o||s||"",name:l,username:f||h||"",loginHint:m,isHomeTenant:van(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:van(r,t)}}a(dK,"buildTenantProfile");function YGe(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=dK(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(YGe,"updateAccountTenantProfileData");var KGe={};Ti(KGe,{checkMaxAge:()=>hIe,extractTokenClaims:()=>G3,getJWSPayload:()=>Can,isKmsi:()=>DFt});p();function G3(t,e){let r=Can(t);try{let n=e(r);return JSON.parse(n)}catch{throw Nt($Ge)}}a(G3,"extractTokenClaims");function DFt(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(DFt,"isKmsi");function Can(t){if(!t)throw Nt(rFt);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw Nt($Ge);return r[2]}a(Can,"getJWSPayload");function hIe(t,e){if(e===0||Date.now()-3e5>t+e)throw Nt(cFt)}a(hIe,"checkMaxAge");p();p();var Ds=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Dl(z3t);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return Su.endsWith(r,"?")?r=r.slice(0,-1):Su.endsWith(r,"?/")&&(r=r.slice(0,-2)),Su.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw Dl(nle)}if(!e.HostNameAndPort||!e.PathSegments)throw Dl(nle);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Dl(W3t)}static appendQueryString(e,r){return r?e.indexOf("?")<0?`${e}?${r}`:`${e}&${r}`:e}static removeHashFromUrl(e){return t.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){let r=this.getUrlComponents(),n=r.PathSegments;return e&&n.length!==0&&(n[0]===jP.COMMON||n[0]===jP.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw Dl(nle);let n={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5],QueryString:r[7]},o=n.AbsolutePath.split("/");return o=o.filter(s=>s&&s.length>0),n.PathSegments=o,n.QueryString&&n.QueryString.endsWith("/")&&(n.QueryString=n.QueryString.substring(0,n.QueryString.length-1)),n}static getDomainFromUrl(e){let r=RegExp("^([^:/?#]+://)?([^/?#]*)"),n=e.match(r);if(!n)throw Dl(nle);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===Yce){let o=new t(r).getUrlComponents();return o.Protocol+"//"+o.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new t(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}};var j2o=[{host:"login.microsoftonline.com"},{host:"login.chinacloudapi.cn",issuerHost:"login.partner.microsoftonline.cn"},{host:"login.microsoftonline.us"},{host:"login.sovcloud-identity.fr"},{host:"login.sovcloud-identity.de"},{host:"login.sovcloud-identity.sg"}];function H2o(t,e){return{token_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/token`,jwks_uri:`https://${t}/{tenantid}/discovery/v2.0/keys`,issuer:`https://${e}/{tenantid}/v2.0`,authorization_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/authorize`,end_session_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/logout`}}a(H2o,"buildOpenIdConfig");var G2o=j2o.reduce((t,{host:e,issuerHost:r})=>(t[e]=H2o(e,r||e),t),{}),San={endpointMetadata:G2o,instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]},{preferred_network:"login.sovcloud-identity.fr",preferred_cache:"login.sovcloud-identity.fr",aliases:["login.sovcloud-identity.fr"]},{preferred_network:"login.sovcloud-identity.de",preferred_cache:"login.sovcloud-identity.de",aliases:["login.sovcloud-identity.de"]},{preferred_network:"login.sovcloud-identity.sg",preferred_cache:"login.sovcloud-identity.sg",aliases:["login.sovcloud-identity.sg"]}]}},NFt=San.endpointMetadata,MFt=San.instanceDiscoveryMetadata,OFt=new Set;MFt.metadata.forEach(t=>{t.aliases.forEach(e=>{OFt.add(e)})});function Tan(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new Ds(o).getUrlComponents().HostNameAndPort;n=ban(e,r,s,t.cloudDiscoveryMetadata?.metadata,h_.CONFIG)||ban(e,r,s,MFt.metadata,h_.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(Tan,"getAliasesFromStaticSources");function ban(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=mIe(n,r);if(s)return t.trace(`getAliasesFromMetadata: found cloud discovery metadata in '${o}', returning aliases`,e),s.aliases;t.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in '${o}'`,e)}return null}a(ban,"getAliasesFromMetadata");function Ian(t){return mIe(MFt.metadata,t)}a(Ian,"getCloudDiscoveryMetadataFromHardcodedValues");function mIe(t,e){for(let r=0;rLFt,createAccountEntityFromAccountInfo:()=>W2o,generateAccountId:()=>$2o,generateHomeAccountId:()=>BFt,getAccountInfo:()=>lle,isAccountEntity:()=>z2o,isSingleTenant:()=>V2o});p();p();function cle(t,e){if(!t)throw Nt(tFt);try{let r=e(t);return JSON.parse(r)}catch{throw Nt(GGe)}}a(cle,"buildClientInfo");function EO(t){if(!t)throw Nt(GGe);let e=t.split(Zce,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(EO,"buildClientInfoFromHomeAccountId");p();var Jx={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function JGe(t){return t&&(t.tid||t.tfp||t.acr)||null}a(JGe,"getTenantIdFromIdTokenClaims");p();var m_={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function $2o(t){return[t.homeAccountId,t.environment].join(ZY).toLowerCase()}a($2o,"generateAccountId");function lle(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(dK(t.homeAccountId,t.localAccountId,t.realm)),{homeAccountId:t.homeAccountId,environment:t.environment,tenantId:t.realm,username:t.username,localAccountId:t.localAccountId,loginHint:t.loginHint,name:t.name,nativeAccountId:t.nativeAccountId,authorityType:t.authorityType,tenantProfiles:new Map(e.map(r=>[r.tenantId,r])),dataBoundary:t.dataBoundary}}a(lle,"getAccountInfo");function V2o(t){return!t.tenantProfiles}a(V2o,"isSingleTenant");function LFt(t,e,r){let n;e.authorityType===Jx.Adfs?n=VBt:e.protocolMode===m_.OIDC?n=DGe:n=$Bt;let o,s;t.clientInfo&&r&&(o=cle(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw Nt(eIe);let l=t.idTokenClaims?.preferred_username||t.idTokenClaims?.upn,u=t.idTokenClaims?.emails?t.idTokenClaims.emails[0]:null,d=l||u||"",f=t.idTokenClaims?.login_hint,h=o?.utid||JGe(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[dK(t.homeAccountId,m,h,t.idTokenClaims)],{homeAccountId:t.homeAccountId,environment:c,realm:h,localAccountId:m,username:d,authorityType:n,loginHint:f,clientInfo:t.clientInfo,name:t.idTokenClaims?.name||"",lastModificationTime:void 0,lastModificationApp:void 0,cloudGraphHostName:t.cloudGraphHostName,msGraphHost:t.msGraphHost,nativeAccountId:t.nativeAccountId,tenantProfiles:g,dataBoundary:s}}a(LFt,"createAccountEntity");function W2o(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(dK(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||DGe,homeAccountId:t.homeAccountId,localAccountId:t.localAccountId,nativeAccountId:t.nativeAccountId,realm:t.tenantId,environment:t.environment,username:t.username,loginHint:t.loginHint,name:t.name,cloudGraphHostName:e,msGraphHost:r,tenantProfiles:n,dataBoundary:t.dataBoundary}}a(W2o,"createAccountEntityFromAccountInfo");function BFt(t,e,r,n,o,s){if(!(e===Jx.Adfs||e===Jx.Dsts)){if(t)try{let c=cle(t,n.base64Decode);if(c.uid&&c.utid)return`${c.uid}.${c.utid}`}catch{}r.warning("No client info in response",o)}return s?.sub||""}a(BFt,"generateHomeAccountId");function z2o(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a(z2o,"isAccountEntity");var PQ=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(kQ,_O),this.staticAuthorityOptions=s,this.performanceClient=o}getAllAccounts(e={},r){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,r),r,e)}getAccountInfoFilteredBy(e,r){if(Object.keys(e).length===0||Object.values(e).every(o=>o==null||o===""))return this.commonLogger.warning("getAccountInfoFilteredBy: Account filter is empty or invalid, returning null",r),null;let n=this.getAllAccounts(e,r);return n.length>1?n.sort(s=>s.idTokenClaims?-1:1)[0]:n.length===1?n[0]:null}getBaseAccountInfo(e,r){let n=this.getAccountsFilteredBy(e,r);return n.length>0?lle(n[0]):null}buildTenantProfiles(e,r,n){return e.flatMap(o=>this.getTenantProfilesFromAccountEntity(o,r,n?.tenantId,n))}getTenantedAccountInfoByFilter(e,r,n,o,s){let c=null,l;if(s&&!this.tenantProfileMatchesFilter(n,s))return null;let u=this.getIdToken(e,o,r,n.tenantId);return u&&(l=G3(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=YGe(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=lle(e),c=s.tenantProfiles||new Map,l=this.getTokenKeys();if(n){let d=c.get(n);if(d)c=new Map([[n,d]]);else return[]}let u=[];return c.forEach(d=>{let f=this.getTenantedAccountInfoByFilter(s,l,d,r,o);f&&u.push(f)}),u}tenantProfileMatchesFilter(e,r){return!(r.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,r.localAccountId)||r.name&&e.name!==r.name||r.isHomeTenant!==void 0&&e.isHomeTenant!==r.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,r){return!(r&&(r.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,r.localAccountId)||r.loginHint&&!this.matchLoginHintFromTokenClaims(e,r.loginHint)||r.username&&!this.matchUsername(e.preferred_username,r.username)||r.name&&!this.matchName(e,r.name)||r.sid&&!this.matchSid(e,r.sid)))}async saveCacheRecord(e,r,n,o,s){if(!e)throw Nt(pFt);try{e.account&&await this.setAccount(e.account,r,n,o),e.idToken&&s?.idToken!==!1&&await this.setIdTokenCredential(e.idToken,r,n),e.accessToken&&s?.accessToken!==!1&&await this.saveAccessToken(e.accessToken,r,n),e.refreshToken&&s?.refreshToken!==!1&&await this.setRefreshTokenCredential(e.refreshToken,r,n),e.appMetadata&&this.setAppMetadata(e.appMetadata,r)}catch(c){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed",r),c instanceof jo?c:Ran(c)}}async saveAccessToken(e,r,n){let o={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType},s=this.getTokenKeys(),c=tm.fromString(e.target);s.accessToken.forEach(l=>{if(!this.accessTokenKeyMatchesFilter(l,o,!1))return;let u=this.getAccessTokenCredential(l,r);u&&this.credentialMatchesFilter(u,o,r)&&tm.fromString(u.target).intersectingScopeSets(c)&&this.removeAccessToken(l,r)}),await this.setAccessTokenCredential(e,r,n)}getAccountsFilteredBy(e,r){let n=this.getAccountKeys(),o=[];return n.forEach(s=>{let c=this.getAccount(s,r);if(!c||e.homeAccountId&&!this.matchHomeAccountId(c,e.homeAccountId)||e.username&&!this.matchUsername(c.username,e.username)||e.environment&&!this.matchEnvironment(c,e.environment,r)||e.realm&&!this.matchRealm(c,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(c,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(c,e.authorityType))return;let l={localAccountId:e?.localAccountId,name:e?.name},u=c.tenantProfiles?.filter(d=>this.tenantProfileMatchesFilter(d,l));u&&u.length===0||o.push(c)}),o}credentialMatchesFilter(e,r,n){return!(r.clientId&&!this.matchClientId(e,r.clientId)||r.userAssertionHash&&!this.matchUserAssertionHash(e,r.userAssertionHash)||typeof r.homeAccountId=="string"&&!this.matchHomeAccountId(e,r.homeAccountId)||r.environment&&!this.matchEnvironment(e,r.environment,n)||r.realm&&!this.matchRealm(e,r.realm)||r.credentialType&&!this.matchCredentialType(e,r.credentialType)||r.familyId&&!this.matchFamilyId(e,r.familyId)||r.target&&!this.matchTarget(e,r.target)||e.credentialType===mg.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===Tf.SSH&&r.keyId&&!this.matchKeyId(e,r.keyId)))}getAppMetadataFilteredBy(e,r){let n=this.getKeys(),o={};return n.forEach(s=>{if(!this.isAppMetadata(s))return;let c=this.getAppMetadata(s,r);c&&(e.environment&&!this.matchEnvironment(c,e.environment,r)||e.clientId&&!this.matchClientId(c,e.clientId)||(o[s]=c))}),o}getAuthorityMetadataByAlias(e,r){let n=this.getAuthorityMetadataKeys(),o=null;return n.forEach(s=>{if(!this.isAuthorityMetadata(s)||s.indexOf(this.clientId)===-1)return;let c=this.getAuthorityMetadata(s,r);c&&c.aliases.indexOf(e)!==-1&&(o=c)}),o}removeAllAccounts(e){this.getAllAccounts({},e).forEach(n=>{this.removeAccount(n,e)})}removeAccount(e,r){this.removeAccountContext(e,r);let n=this.getAccountKeys(),o=a(s=>s.includes(e.homeAccountId)&&s.includes(e.environment),"keyFilter");n.filter(o).forEach(s=>{this.removeItem(s,r),this.performanceClient.incrementFields({accountsRemoved:1},r)})}removeAccountContext(e,r){let n=this.getTokenKeys(),o=a(s=>s.includes(e.homeAccountId)&&s.includes(e.environment),"keyFilter");n.idToken.filter(o).forEach(s=>{this.removeIdToken(s,r)}),n.accessToken.filter(o).forEach(s=>{this.removeAccessToken(s,r)}),n.refreshToken.filter(o).forEach(s=>{this.removeRefreshToken(s,r)})}removeAccessToken(e,r){let n=this.getAccessTokenCredential(e,r);if(n&&(this.removeItem(e,r),this.performanceClient.incrementFields({accessTokensRemoved:1},r),n.credentialType.toLowerCase()===mg.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===Tf.POP)){let s=n.keyId;s&&this.cryptoImpl.removeTokenBindingKey(s,r).catch(()=>{this.commonLogger.error(`Failed to remove token binding key '${s}'`,r),this.performanceClient?.incrementFields({removeTokenBindingKeyFailure:1},r)})}}removeAppMetadata(e){return this.getKeys().forEach(n=>{this.isAppMetadata(n)&&this.removeItem(n,e)}),!0}getIdToken(e,r,n,o){this.commonLogger.trace("CacheManager - getIdToken called",r);let s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:mg.ID_TOKEN,clientId:this.clientId,realm:o},c=this.getIdTokensByFilter(s,r,n),l=c.size;if(l<1)return this.commonLogger.info("CacheManager:getIdToken - No token found",r),null;if(l>1){let u=c;if(!o){let d=new Map;c.forEach((h,m)=>{h.realm===e.tenantId&&d.set(m,h)});let f=d.size;if(f<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result",r),c.values().next().value;if(f===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile",r),d.values().next().value;u=d}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them",r),u.forEach((d,f)=>{this.removeIdToken(f,r)}),this.performanceClient.addFields({multiMatchedID:c.size},r),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token",r),c.values().next().value}getIdTokensByFilter(e,r,n){let o=n&&n.idToken||this.getTokenKeys().idToken,s=new Map;return o.forEach(c=>{if(!this.idTokenKeyMatchesFilter(c,{clientId:this.clientId,...e}))return;let l=this.getIdTokenCredential(c,r);l&&this.credentialMatchesFilter(l,e,r)&&s.set(c,l)}),s}idTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}removeIdToken(e,r){this.removeItem(e,r)}removeRefreshToken(e,r){this.removeItem(e,r)}getAccessToken(e,r,n,o){let s=r.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",s);let c=tm.createSearchScopes(r.scopes),l=r.authenticationScheme||Tf.BEARER,u=l&&l.toLowerCase()!==Tf.BEARER.toLowerCase()?mg.ACCESS_TOKEN_WITH_AUTH_SCHEME:mg.ACCESS_TOKEN,d={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:u,clientId:this.clientId,realm:o||e.tenantId,target:c,tokenType:l,keyId:r.sshKid},f=n&&n.accessToken||this.getTokenKeys().accessToken,h=[];f.forEach(g=>{if(this.accessTokenKeyMatchesFilter(g,d,!0)){let A=this.getAccessTokenCredential(g,s);A&&this.credentialMatchesFilter(A,d,s)&&h.push(A)}});let m=h.length;return m<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",s),null):m>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",s),h.forEach(g=>{this.removeAccessToken(this.generateCredentialKey(g),s)}),this.performanceClient.addFields({multiMatchedAT:h.length},s),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",s),h[0])}accessTokenKeyMatchesFilter(e,r,n){let o=e.toLowerCase();if(r.clientId&&o.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&o.indexOf(r.homeAccountId.toLowerCase())===-1||r.realm&&o.indexOf(r.realm.toLowerCase())===-1)return!1;if(r.target){let s=r.target.asArray();for(let c=0;c{if(!this.accessTokenKeyMatchesFilter(s,e,!0))return;let c=this.getAccessTokenCredential(s,r);c&&this.credentialMatchesFilter(c,e,r)&&o.push(c)}),o}getRefreshToken(e,r,n,o){this.commonLogger.trace("CacheManager - getRefreshToken called",n);let s=r?XY:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:mg.REFRESH_TOKEN,clientId:this.clientId,familyId:s},l=o&&o.refreshToken||this.getTokenKeys().refreshToken,u=[];l.forEach(f=>{if(this.refreshTokenKeyMatchesFilter(f,c)){let h=this.getRefreshTokenCredential(f,n);h&&this.credentialMatchesFilter(h,c,n)&&u.push(h)}});let d=u.length;return d<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found.",n),null):(d>1&&this.performanceClient.addFields({multiMatchedRT:d},n),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token",n),u[0])}refreshTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.familyId&&n.indexOf(r.familyId.toLowerCase())===-1||!r.familyId&&r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e,r){let n={environment:e,clientId:this.clientId},o=this.getAppMetadataFilteredBy(n,r),s=Object.keys(o).map(l=>o[l]),c=s.length;if(c<1)return null;if(c>1)throw Nt(lFt);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===XY)}matchHomeAccountId(e,r){return typeof e.homeAccountId=="string"&&r===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,r){let n=e.oid||e.sub;return r===n}matchLocalAccountIdFromTenantProfile(e,r){return e.localAccountId===r}matchName(e,r){return r.toLowerCase()===e.name?.toLowerCase()}matchUsername(e,r){return!!(e&&typeof e=="string"&&r?.toLowerCase()===e.toLowerCase())}matchUserAssertionHash(e,r){return!!(e.userAssertionHash&&r===e.userAssertionHash)}matchEnvironment(e,r,n){if(this.staticAuthorityOptions){let s=Tan(this.staticAuthorityOptions,this.commonLogger,n);if(s.includes(r)&&s.includes(e.environment))return!0}let o=this.getAuthorityMetadataByAlias(r,n);return!!(o&&o.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,r){return e.credentialType&&r.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,r){return!!(e.clientId&&r===e.clientId)}matchFamilyId(e,r){return!!(e.familyId&&r===e.familyId)}matchRealm(e,r){return e.realm?.toLowerCase()===r.toLowerCase()}matchNativeAccountId(e,r){return!!(e.nativeAccountId&&r===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,r){return e.login_hint===r||e.preferred_username===r||e.upn===r}matchSid(e,r){return e.sid===r}matchAuthorityType(e,r){return!!(e.authorityType&&r.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,r){return e.credentialType!==mg.ACCESS_TOKEN&&e.credentialType!==mg.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:tm.fromString(e.target).containsScopeSet(r)}matchTokenType(e,r){return!!(e.tokenType&&e.tokenType===r)}matchKeyId(e,r){return!!(e.keyId&&e.keyId===r)}isAppMetadata(e){return e.indexOf(Xce)!==-1}isAuthorityMetadata(e){return e.indexOf(ele)!==-1}generateAuthorityMetadataCacheKey(e){return`${ele}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},AIe=class extends PQ{static{a(this,"DefaultStorageClass")}async setAccount(){throw Nt(Ps)}getAccount(){throw Nt(Ps)}async setIdTokenCredential(){throw Nt(Ps)}getIdTokenCredential(){throw Nt(Ps)}async setAccessTokenCredential(){throw Nt(Ps)}getAccessTokenCredential(){throw Nt(Ps)}async setRefreshTokenCredential(){throw Nt(Ps)}getRefreshTokenCredential(){throw Nt(Ps)}setAppMetadata(){throw Nt(Ps)}getAppMetadata(){throw Nt(Ps)}setServerTelemetry(){throw Nt(Ps)}getServerTelemetry(){throw Nt(Ps)}setAuthorityMetadata(){throw Nt(Ps)}getAuthorityMetadata(){throw Nt(Ps)}getAuthorityMetadataKeys(){throw Nt(Ps)}setThrottlingCache(){throw Nt(Ps)}getThrottlingCache(){throw Nt(Ps)}removeItem(){throw Nt(Ps)}getKeys(){throw Nt(Ps)}getAccountKeys(){throw Nt(Ps)}getTokenKeys(){throw Nt(Ps)}generateCredentialKey(){throw Nt(Ps)}generateAccountKey(){throw Nt(Ps)}};p();p();var kan={NotStarted:0,InProgress:1,Completed:2};var rm=class{static{a(this,"StubPerformanceClient")}generateId(){return"callback-id"}startMeasurement(e,r){return{end:a(()=>null,"end"),discard:a(()=>{},"discard"),add:a(()=>{},"add"),increment:a(()=>{},"increment"),event:{eventId:this.generateId(),status:kan.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:r||""}}}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}};var Pan={tokenRenewalOffsetSeconds:o3t,preventCorsPreflight:!1},Y2o={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:If.Info,correlationId:""},K2o={async sendGetRequestAsync(){throw Nt(Ps)},async sendPostRequestAsync(){throw Nt(Ps)}},J2o={sku:xBt,version:_O,cpu:"",os:""},Z2o={clientSecret:"",clientAssertion:void 0},X2o={azureCloudInstance:H3.None,tenant:`${HTe}`},eDo={application:{appName:"",appVersion:""}};function $3({authOptions:t,systemOptions:e,loggerOptions:r,storageInterface:n,networkInterface:o,cryptoInterface:s,clientCredentials:c,libraryInfo:l,telemetry:u,serverTelemetryManager:d,persistencePlugin:f,serializableCache:h}){let m={...Y2o,...r};return{authOptions:tDo(t),systemOptions:{...Pan,...e},loggerOptions:m,storageInterface:n||new AIe(t.clientId,ale,new gg(m),new rm),networkInterface:o||K2o,cryptoInterface:s||ale,clientCredentials:c||Z2o,libraryInfo:{...J2o,...l},telemetry:{...eDo,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a($3,"buildClientConfiguration");function tDo(t){return{clientCapabilities:[],azureCloudOptions:X2o,instanceAware:!1,isMcp:!1,...t}}a(tDo,"buildAuthOptions");function ZGe(t){return t.authOptions.authority.options.protocolMode===m_.OIDC}a(ZGe,"isOidcProtocolMode");p();p();var Q1=class{static{a(this,"TokenCacheContext")}constructor(e,r){this.cache=e,this.hasChanged=r}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}};var $E={};Ti($E,{createAccessTokenEntity:()=>QFt,createIdTokenEntity:()=>UFt,createRefreshTokenEntity:()=>qFt,generateAppMetadataKey:()=>uDo,generateAuthorityMetadataExpiresAt:()=>e$e,isAccessTokenEntity:()=>oDo,isAppMetadataEntity:()=>dDo,isAuthorityMetadataEntity:()=>fDo,isAuthorityMetadataExpired:()=>t$e,isCredentialEntity:()=>XGe,isIdTokenEntity:()=>sDo,isRefreshTokenEntity:()=>aDo,isServerTelemetryEntity:()=>cDo,isThrottlingEntity:()=>lDo,updateAuthorityEndpointMetadata:()=>dle,updateCloudDiscoveryMetadata:()=>_Ie});p();var sd={};Ti(sd,{delay:()=>iDo,isCacheExpired:()=>nDo,isTokenExpired:()=>ule,nowSeconds:()=>q1,toDateFromSeconds:()=>yIe,toSecondsFromDate:()=>rDo,wasClockTurnedBack:()=>FFt});p();function q1(){return Math.round(new Date().getTime()/1e3)}a(q1,"nowSeconds");function rDo(t){return t.getTime()/1e3}a(rDo,"toSecondsFromDate");function yIe(t){return t?new Date(Number(t)*1e3):new Date}a(yIe,"toDateFromSeconds");function ule(t,e){let r=Number(t)||0;return q1()+e>r}a(ule,"isTokenExpired");function nDo(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(nDo,"isCacheExpired");function FFt(t){return Number(t)>q1()}a(FFt,"wasClockTurnedBack");function iDo(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(iDo,"delay");function UFt(t,e,r,n,o){return{credentialType:mg.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(UFt,"createIdTokenEntity");function QFt(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:mg.ACCESS_TOKEN,secret:r,cachedAt:q1().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||Tf.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==Tf.BEARER.toLowerCase())switch(g.credentialType=mg.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case Tf.POP:let A=G3(r,u);if(!A?.cnf?.kid)throw Nt(mFt);g.keyId=A.cnf.kid;break;case Tf.SSH:g.keyId=m}return g}a(QFt,"createAccessTokenEntity");function qFt(t,e,r,n,o,s,c){let l={credentialType:mg.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,lastUpdatedAt:Date.now().toString()};return s&&(l.userAssertionHash=s),o&&(l.familyId=o),c&&(l.expiresOn=c.toString()),l}a(qFt,"createRefreshTokenEntity");function XGe(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(XGe,"isCredentialEntity");function oDo(t){return t?XGe(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===mg.ACCESS_TOKEN||t.credentialType===mg.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(oDo,"isAccessTokenEntity");function sDo(t){return t?XGe(t)&&t.hasOwnProperty("realm")&&t.credentialType===mg.ID_TOKEN:!1}a(sDo,"isIdTokenEntity");function aDo(t){return t?XGe(t)&&t.credentialType===mg.REFRESH_TOKEN:!1}a(aDo,"isRefreshTokenEntity");function cDo(t,e){let r=t.indexOf(WTe)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(cDo,"isServerTelemetryEntity");function lDo(t,e){let r=!1;t&&(r=t.indexOf(zTe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(lDo,"isThrottlingEntity");function uDo({environment:t,clientId:e}){return[Xce,t,e].join(ZY).toLowerCase()}a(uDo,"generateAppMetadataKey");function dDo(t,e){return e?t.indexOf(Xce)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(dDo,"isAppMetadataEntity");function fDo(t,e){return e?t.indexOf(ele)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}a(fDo,"isAuthorityMetadataEntity");function e$e(){return q1()+zBt}a(e$e,"generateAuthorityMetadataExpiresAt");function dle(t,e,r){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=r,t.jwks_uri=e.jwks_uri}a(dle,"updateAuthorityEndpointMetadata");function _Ie(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(_Ie,"updateCloudDiscoveryMetadata");function t$e(t){return t.expiresAt<=q1()}a(t$e,"isAuthorityMetadataExpired");p();p();var Dan="networkClientSendPostRequestAsync",Nan="refreshTokenClientExecutePostToTokenEndpoint",Man="authorizationCodeClientExecutePostToTokenEndpoint",Oan="refreshTokenClientExecuteTokenRequest",Lan="refreshTokenClientAcquireToken",r$e="refreshTokenClientAcquireTokenWithCachedRefreshToken",Ban="refreshTokenClientCreateTokenRequestBody",Fan="silentFlowClientGenerateResultFromCacheRecord";var Uan="authClientExecuteTokenRequest",Qan="authClientCreateTokenRequestBody",qan="updateTokenEndpointAuthority",fle="popTokenGenerateCnf",n$e="handleServerTokenResponse",jan="authorityResolveEndpointsAsync",Han="authorityGetCloudDiscoveryMetadataFromNetwork",Gan="authorityUpdateCloudDiscoveryMetadata",$an="authorityGetEndpointMetadataFromNetwork",Van="authorityUpdateEndpointMetadata",jFt="authorityUpdateMetadataWithRegionalInformation",Wan="regionDiscoveryDetectRegion",HFt="regionDiscoveryGetRegionFromIMDS",zan="regionDiscoveryGetCurrentVersion",Yan="cacheManagerGetRefreshToken";p();var Kan=a((t,e,r,n,o)=>(...s)=>{r.trace(`Executing function '${e}'`,o);let c=n.startMeasurement(e,o);o&&n.incrementFields({[`ext.${e}CallCount`]:1},o);try{let l=t(...s);return c.end({success:!0}),r.trace(`Returning result from '${e}'`,o),l}catch(l){r.trace(`Error occurred in '${e}'`,o);try{r.trace(JSON.stringify(l),o)}catch{r.trace("Unable to print error message.",o)}throw c.end({success:!1},l),l}},"invoke"),ra=a((t,e,r,n,o)=>(...s)=>{r.trace(`Executing function '${e}'`,o);let c=n.startMeasurement(e,o);return o&&n.incrementFields({[`ext.${e}CallCount`]:1},o),t(...s).then(l=>(r.trace(`Returning result from '${e}'`,o),c.end({success:!0}),l)).catch(l=>{r.trace(`Error occurred in '${e}'`,o);try{r.trace(JSON.stringify(l),o)}catch{r.trace("Unable to print error message.",o)}throw c.end({success:!1},l),l})},"invokeAsync");var pDo={SW:"sw"},DQ=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await ra(this.generateKid.bind(this),fle,r,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(n));return{kid:n.kid,reqCnfString:o}}async generateKid(e){return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:pDo.SW}}async signPopToken(e,r,n){return this.signPayload(e,r,n)}async signPayload(e,r,n,o){let{resourceRequestMethod:s,resourceRequestUri:c,shrClaims:l,shrNonce:u,shrOptions:d}=n,h=(c?new Ds(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:q1(),m:s?.toUpperCase(),u:h?.HostNameAndPort,nonce:u||this.cryptoUtils.createNewGuid(),p:h?.AbsolutePath,q:h?.QueryString?[[],h.QueryString]:void 0,client_claims:l||void 0,...o},r,d,n.correlationId)}};p();var o$e={};Ti(o$e,{badToken:()=>EIe,consentRequired:()=>WFt,interactionRequired:()=>VFt,interruptedUser:()=>YFt,loginRequired:()=>zFt,nativeAccountUnavailable:()=>hDo,noTokensFound:()=>i$e,refreshTokenExpired:()=>GFt,uxNotAllowed:()=>$Ft});p();var i$e="no_tokens_found",hDo="native_account_unavailable",GFt="refresh_token_expired",$Ft="ux_not_allowed",VFt="interaction_required",WFt="consent_required",zFt="login_required",EIe="bad_token",YFt="interrupted_user";var Jan=[VFt,WFt,zFt,EIe,$Ft,YFt],mDo=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],j1=class t extends jo{static{a(this,"InteractionRequiredAuthError")}constructor(e,r,n,o,s,c,l,u){super(e,r,n),Object.setPrototypeOf(this,t.prototype),this.timestamp=o||"",this.traceId=s||"",this.correlationId=c||"",this.claims=l||"",this.name="InteractionRequiredAuthError",this.errorNo=u}};function s$e(t,e,r){let n=!!t&&Jan.indexOf(t)>-1,o=!!r&&mDo.indexOf(r)>-1,s=!!e&&Jan.some(c=>e.indexOf(c)>-1);return n||s||o}a(s$e,"isInteractionRequiredError");function a$e(t,e){return new j1(t,e)}a(a$e,"createInteractionRequiredAuthError");p();var VE=class t extends jo{static{a(this,"ServerError")}constructor(e,r,n,o,s){super(e,r,n),this.name="ServerError",this.errorNo=o,this.status=s,Object.setPrototypeOf(this,t.prototype)}};p();function Zan(t,e){if(!t)throw Nt(hFt);if(!e)throw Nt(rK);try{let r=e.split(IGe),n=r[0],o=r.length>1?r.slice(1).join(IGe):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw Nt(rK)}}a(Zan,"parseRequestState");var rh=class t{static{a(this,"ResponseHandler")}constructor(e,r,n,o,s,c,l){this.clientId=e,this.cacheStorage=r,this.cryptoObj=n,this.logger=o,this.performanceClient=s,this.serializableCache=c,this.persistencePlugin=l}validateTokenResponse(e,r,n){if(e.error||e.error_description||e.suberror){let o=`Error(s): ${e.error_codes||JY} - Timestamp: ${e.timestamp||JY} - Description: ${e.error_description||JY} - Correlation ID: ${e.correlation_id||JY} - Trace ID: ${e.trace_id||JY}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new VE(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=jBt&&e.status<=HBt){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. +${c}`,r);return}else if(n&&e.status&&e.status>=QBt&&e.status<=qBt){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. +${c}`,r);return}throw s$e(e.error,e.error_description,e.suberror)?new j1(e.error,e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",s):c}}async handleServerTokenResponse(e,r,n,o,s,c,l,u,d,f){let h;if(e.id_token){if(h=G3(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw Nt(aFt);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw Nt(ZTe);hIe(y,o.maxAge)}}this.homeAccountIdentifier=BFt(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=Zan(this.cryptoObj.base64Decode,c.state)),e.key_id=e.key_id||o.sshKid||void 0;let g=this.generateCacheRecord(e,r,n,o,h,l,c),A;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess",o.correlationId),A=new Q1(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(A)),u&&!d&&g.account&&this.cacheStorage.getAllAccounts({homeAccountId:g.account.homeAccountId,environment:g.account.environment},o.correlationId).length<1)return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache",o.correlationId),this.performanceClient?.addFields({acntLoggedOut:!0},o.correlationId),await t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,void 0,f);await this.cacheStorage.saveCacheRecord(g,o.correlationId,DFt(h||{}),s,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&A&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess",o.correlationId),await this.persistencePlugin.afterCacheAccess(A))}return t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,e,f)}generateCacheRecord(e,r,n,o,s,c,l){let u=r.getPreferredCache();if(!u)throw Nt(eIe);let d=JGe(s),f,h;e.id_token&&s&&(f=UFt(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=Xan(this.cacheStorage,r,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,s,e.client_info,u,d,l,void 0,this.logger,this.performanceClient));let m=null;if(e.access_token){let y=e.scope?tm.fromString(e.scope):new tm(o.scopes||[]),_=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,E=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,v=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,S=n+_,T=S+E,w=v&&v>0?n+v:void 0;m=QFt(this.homeAccountIdentifier,u,e.access_token,this.clientId,d||r.tenant||"",y.printScopes(),S,T,this.cryptoObj.base64Decode,w,e.token_type,c,e.key_id);let R=o.resource||null;R&&(m.resource=R)}let g=null;if(e.refresh_token){let y;if(e.refresh_token_expires_in){let _=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;y=n+_,this.performanceClient?.addFields({ntwkRtExpiresOnSeconds:y},o.correlationId)}g=qFt(this.homeAccountIdentifier,u,e.refresh_token,this.clientId,e.foci,c,y)}let A=null;return e.foci&&(A={clientId:this.clientId,environment:u,familyId:e.foci}),{account:h,idToken:f,accessToken:m,refreshToken:g,appMetadata:A}}static async generateAuthenticationResult(e,r,n,o,s,c,l,u,d,f){let h="",m=[],g=null,A,y,_="";if(n.accessToken){if(n.accessToken.tokenType===Tf.POP&&!s.popKid){let T=new DQ(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw Nt(yFt);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=tm.fromString(n.accessToken.target).asArray(),g=yIe(n.accessToken.expiresOn),A=yIe(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=yIe(n.accessToken.refreshOn))}n.appMetadata&&(_=n.appMetadata.familyId===XY?XY:"");let E=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let S=n.account?YGe(lle(n.account),void 0,l,n.idToken?.secret):null;return{authority:r.canonicalAuthority,uniqueId:E,tenantId:v,scopes:m,account:S,idToken:n?.idToken?.secret||"",idTokenClaims:l||{},accessToken:h,fromCache:o,expiresOn:g,extExpiresOn:A,refreshOn:y,correlationId:s.correlationId,requestId:f||"",familyId:_,tokenType:n.accessToken?.tokenType||"",state:u?u.userRequestState:"",cloudGraphHostName:n.account?.cloudGraphHostName||"",msGraphHost:n.account?.msGraphHost||"",code:d?.spa_code,fromPlatformBroker:!1}}};function Xan(t,e,r,n,o,s,c,l,u,d,f,h,m){h?.verbose("setCachedAccount called",o);let g=l||e.getPreferredCache(),A=t.getAccountsFilteredBy({homeAccountId:r,environment:g},o);m?.addFields({cacheMatchedAccounts:A.length},o),A.length>1&&h?.warning("Multiple base accounts matched homeAccountId. Ignoring cached account and creating a new base account.",o);let _=(A.length===1?A[0]:null)||LFt({homeAccountId:r,idTokenClaims:s,clientInfo:c,environment:l,cloudGraphHostName:d?.cloud_graph_host_name,msGraphHost:d?.msgraph_host,nativeAccountId:f},e,n),E=_.tenantProfiles||[],v=u||_.realm;if(v&&!E.find(S=>S.tenantId===v)){let S=dK(r,_.localAccountId,v,s);E.push(S)}return _.tenantProfiles=E,_}a(Xan,"buildAccountToCache");p();var WE={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};p();async function zE(t,e,r){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:r})}a(zE,"getClientAssertion");p();function ple(t,e,r){return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:r,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||e.extraParameters?.clientId}}a(ple,"getRequestThumbprint");var pK={};Ti(pK,{createTokenQueryParameters:()=>bIe,createTokenRequestHeaders:()=>CIe,executePostToTokenEndpoint:()=>SIe,sendPostRequest:()=>ecn});p();p();var vIe=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${zTe}.${JSON.stringify(e)}`}static preProcess(e,r,n){let o=t.generateThrottlingStorageKey(r),s=e.getThrottlingCache(o,n);if(s){if(s.throttleTime=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(eh.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){let r=e<=0?0:e,n=Date.now()/1e3;return Math.floor(Math.min(n+(r||e3t),n+t3t)*1e3)}static removeThrottle(e,r,n,o){let s=ple(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var hle=class t extends jo{static{a(this,"NetworkError")}constructor(e,r,n){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,t.prototype),this.name="NetworkError",this.error=e,this.httpStatus=r,this.responseHeaders=n}};function KFt(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new hle(t,e,r)}a(KFt,"createNetworkError");function CIe(t,e,r){let n={};if(n[eh.CONTENT_TYPE]=NBt,!e&&r)switch(r.type){case WE.HOME_ACCOUNT_ID:try{let o=EO(r.credential);n[eh.CCS_HEADER]=`Oid:${o.uid}@${o.utid}`}catch(o){t.verbose(`Could not parse home account ID for CCS Header: '${o}'`,"")}break;case WE.UPN:n[eh.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(CIe,"createTokenRequestHeaders");function bIe(t,e,r,n){let o=new Map;return t.embeddedClientId&&j3(o,e,r),t.extraQueryParameters&&q3(o,t.extraQueryParameters),cK(o,t.correlationId),nK(o,t.correlationId,n),yO(o)}a(bIe,"createTokenQueryParameters");async function SIe(t,e,r,n,o,s,c,l,u,d){let f=await ecn(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(SIe,"executePostToTokenEndpoint");async function ecn(t,e,r,n,o,s,c,l){vIe.preProcess(o,t,n);let u;try{u=await ra(s.sendPostRequestAsync.bind(s),Dan,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[eh.X_MS_HTTP_VERSION]||"",requestId:d[eh.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof hle){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[eh.X_MS_HTTP_VERSION]||"",requestId:f[eh.X_MS_REQUEST_ID]||"",contentTypeHeader:f[eh.CONTENT_TYPE]||void 0,contentLengthHeader:f[eh.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof jo?d:Nt(nFt)}return vIe.postProcess(o,t,u,n),u}a(ecn,"sendPostRequest");var l$e={};Ti(l$e,{createDiscoveredInstance:()=>ZFt});p();p();p();function tcn(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(tcn,"isOpenIdConfigResponse");p();function rcn(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(rcn,"isCloudInstanceDiscoveryResponse");p();function ncn(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(ncn,"isCloudInstanceDiscoveryErrorResponse");p();var TIe=class t{static{a(this,"RegionDiscovery")}constructor(e,r,n,o){this.networkInterface=e,this.logger=r,this.performanceClient=n,this.correlationId=o}async detectRegion(e,r){let n=e;if(n)r.region_source=xQ.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await ra(this.getRegionFromIMDS.bind(this),HFt,this.logger,this.performanceClient,this.correlationId)(MBt,o);if(s.status===RGe&&(n=s.body,r.region_source=xQ.IMDS),s.status===kGe){let c=await ra(this.getCurrentVersion.bind(this),zan,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=xQ.FAILED_AUTO_DETECTION,null;let l=await ra(this.getRegionFromIMDS.bind(this),HFt,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===RGe&&(n=l.body,r.region_source=xQ.IMDS)}}catch{return r.region_source=xQ.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=xQ.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${wGe}?api-version=${e}&format=text`,r,OBt)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${wGe}?format=json`,e);return r.status===kGe&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};TIe.IMDS_OPTIONS={headers:{Metadata:"true"}};var $P=class t{static{a(this,"Authority")}constructor(e,r,n,o,s,c,l,u){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=r,this.cacheManager=n,this.authorityOptions=o,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=s,this.performanceClient=l,this.correlationId=c,this.managedIdentity=u||!1,this.regionDiscovery=new TIe(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(TGe))return Jx.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case RBt:return Jx.Adfs;case kBt:return Jx.Dsts}return Jx.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new Ds(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw Nt(GP)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw Nt(GP)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw Nt(GP)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Nt(AFt);return this.replacePath(this.metadata.end_session_endpoint)}else throw Nt(GP)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw Nt(GP)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw Nt(GP)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Jx.Default&&this.protocolMode!==m_.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new Ds(this.metadata.canonical_authority).getUrlComponents(),s=o.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((l,u)=>{let d=s[u];if(u===0&&this.canReplaceTenant(o)){let f=new Ds(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];d!==f&&(this.logger.verbose(`Replacing tenant domain name '${d}' with id '${f}'`,this.correlationId),d=f)}l!==d&&(r=r.replace(`/${d}/`,`/${l}/`))}),this.replaceTenant(r)}get defaultOpenIdConfigurationEndpoint(){let e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Jx.Adfs||this.protocolMode===m_.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){let e=this.getCurrentMetadataEntity(),r=await ra(this.updateCloudDiscoveryMetadata.bind(this),Gan,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await ra(this.updateEndpointMetadata.bind(this),Van,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,r,{source:n}),this.performanceClient?.addFields({cloudDiscoverySource:r,authorityEndpointSource:n},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort,this.correlationId);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:e$e(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==h_.CACHE&&n?.source!==h_.CACHE&&(e.expiresAt=e$e(),e.canonical_authority=this.canonicalAuthority);let o=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache,this.correlationId);this.cacheManager.setAuthorityMetadata(o,e,this.correlationId),this.metadata=e}async updateEndpointMetadata(e){let r=this.updateEndpointMetadataFromLocalSources(e);if(r){if(r.source===h_.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await ra(this.updateMetadataWithRegionalInformation.bind(this),jFt,this.logger,this.performanceClient,this.correlationId)(r.metadata);dle(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await ra(this.getEndpointMetadataFromNetwork.bind(this),$an,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await ra(this.updateMetadataWithRegionalInformation.bind(this),jFt,this.logger,this.performanceClient,this.correlationId)(n)),dle(e,n,!0),h_.NETWORK;throw Nt(iFt,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration",this.correlationId);let r=this.getEndpointMetadataFromConfig();if(r)return this.logger.verbose("Found endpoint metadata in authority configuration",this.correlationId),dle(e,r,!1),{source:h_.CONFIG};this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values.",this.correlationId);let n=this.getEndpointMetadataFromHardcodedValues();if(n)return dle(e,n,!1),{source:h_.HARDCODED_VALUES,metadata:n};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.",this.correlationId);let o=t$e(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:h_.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new Ds(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Dl(X3t)}return null}async getEndpointMetadataFromNetwork(){let e={},r=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from '${r}'`,this.correlationId);try{let n=await this.networkInterface.sendGetRequestAsync(r,e);return tcn(n.body)?n.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration",this.correlationId),null)}catch(n){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: '${n}'`,this.correlationId),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in NFt?NFt[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==LBt)return this.regionDiscoveryMetadata.region_outcome=YTe.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await ra(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),Wan,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=YTe.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=YTe.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await ra(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Han,this.logger,this.performanceClient,this.correlationId)();if(n)return _Ie(e,n,!0),h_.NETWORK;throw Dl(eFt)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||GTe}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||GTe}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||GTe}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),_Ie(e,r,!1),h_.CONFIG;this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values.",this.correlationId);let n=Ian(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),_Ie(e,n,!1),h_.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.",this.correlationId);let o=t$e(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),h_.CACHE):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Jx.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.",this.correlationId),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.",this.correlationId);try{this.logger.verbose("Attempting to parse the cloud discovery metadata.",this.correlationId);let e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=mIe(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata.",""),r)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata.",this.correlationId),r;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.",this.correlationId)}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.",this.correlationId),Dl(HGe)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host.",this.correlationId),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){let e=`${PBt}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(rcn(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(ncn(o.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: '${o.status}'`,this.correlationId),s=o.body,s.error===UBt)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance.",this.correlationId),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is '${s.error}'`,this.correlationId),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is '${s.error_description}'`,this.correlationId),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network, correlationId) to []",this.correlationId),c=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse",this.correlationId),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),n=mIe(c,this.hostnameAndPort)}catch(o){if(o instanceof jo)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. Error: '${o.errorCode}' Error Description: '${o.errorMessage}'`,this.correlationId);else{let s=o;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata. Error: '${s.name}' -Error Description: '${s.message}'`,this.correlationId)}return null}return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),this.logger.verbose("Creating custom Authority for custom domain scenario.",this.correlationId),n=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),n}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(r=>r&&Ds.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==H3.None){let o=r.tenant?r.tenant:HTe;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return xBt;if(this.discoveryComplete())return this.metadata.preferred_cache;throw Nt(GP)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return MFt.has(e)}static isPublicCloudAuthority(e){return BBt.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new Ds(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${LBt}`);let l=Ds.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:c}).urlString;return n?`${l}?${n}`:l}static replaceWithRegionalInformation(e,r){let n={...e};return n.authorization_endpoint=t.buildRegionalAuthorityString(n.authorization_endpoint,r),n.token_endpoint=t.buildRegionalAuthorityString(n.token_endpoint,r),n.end_session_endpoint&&(n.end_session_endpoint=t.buildRegionalAuthorityString(n.end_session_endpoint,r)),n}static transformCIAMAuthority(e){let r=e,o=new Ds(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(TGe)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${PBt}`}return r}};$P.reservedTenantDomains=new Set(["{tenant}","{tenantid}",jP.COMMON,jP.CONSUMERS,jP.ORGANIZATIONS]);function ncn(t){let n=new Ds(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case jP.COMMON:case jP.ORGANIZATIONS:case jP.CONSUMERS:return;default:return n}}a(ncn,"getTenantFromAuthorityString");function c$e(t){return t.endsWith(zce)?t:`${t}${zce}`}a(c$e,"formatAuthorityUri");function KFt(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw Dl(HGe)}return{canonicalAuthority:t.authority?c$e(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(KFt,"buildStaticAuthorityOptions");async function JFt(t,e,r,n,o,s,c){let l=$P.transformCIAMAuthority(c$e(t)),u=new $P(l,e,r,n,o,s,c);try{return await ra(u.resolveEndpointsAsync.bind(u),qan,o,c,s)(),u}catch{throw Nt(GP)}}a(JFt,"createDiscoveredInstance");var IIe=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=$3(e),this.logger=new mg(this.config.loggerOptions,kQ,_O),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async acquireToken(e,r,n){if(!e.code)throw Nt(lFt);n&&n.cloud_instance_host_name&&await ra(this.updateTokenEndpointAuthority.bind(this),Qan,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=q1(),s=await ra(this.executeTokenRequest.bind(this),Fan,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[eh.X_MS_REQUEST_ID],l=new rh(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return l.validateTokenResponse(s.body,e.correlationId),ra(l.handleServerTokenResponse.bind(l),n$e,this.logger,this.performanceClient,e.correlationId)(s.body,this.authority,o,e,r,n,void 0,void 0,void 0,c)}getLogoutUri(e){if(!e)throw Dl(K3t);let r=this.createLogoutUrlQueryString(e);return Ds.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=bIe(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=Ds.appendQueryString(e.tokenEndpoint,o),c=await ra(this.createTokenRequestBody.bind(this),Uan,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=ale(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${Jce}${f.utid}`,type:WE.HOME_ACCOUNT_ID}}catch(f){this.logger.verbose(`Could not parse client info for CCS Header: '${f}'`,r.correlationId)}let u=CIe(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=fle(this.config.authOptions.clientId,r);return ra(SIe,Nan,this.logger,this.performanceClient,r.correlationId)(s,c,u,d,r.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,n)}async createTokenRequestBody(e){let r=new Map;if(iK(r,e.embeddedClientId||e.extraParameters?.[AO]||this.config.authOptions.clientId),this.includeRedirectUri)oK(r,e.redirectUri);else if(!e.redirectUri)throw Dl($3t);if(nK(r,e.scopes,!0,this.oidcDefaultScopes),pIe(r,e.resource),IFt(r,e.code),tIe(r,this.config.libraryInfo),rIe(r,this.config.telemetry.application),fIe(r),this.serverTelemetryManager&&!ZGe(this.config)&&dIe(r,this.serverTelemetryManager),e.codeVerifier&&wFt(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&iIe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;oIe(r,await zE(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),sIe(r,o.assertionType)}if(aIe(r,VTe.AUTHORIZATION_CODE_GRANT),cK(r),e.authenticationScheme===Tf.POP){let o=new DQ(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await ra(o.generateCnf.bind(o),dle,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,lIe(r,s)}else if(e.authenticationScheme===Tf.SSH)if(e.sshJwk)uIe(r,e.sshJwk);else throw Dl(JTe);(!Su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sK(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=ale(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${Jce}${o.utid}`,type:WE.HOME_ACCOUNT_ID}}catch(o){this.logger.verbose(`Could not parse client info for CCS Header: '${o}'`,e.correlationId)}else n=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&n)switch(n.type){case WE.HOME_ACCOUNT_ID:try{let o=EO(n.credential);Q3(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case WE.UPN:RQ(r,n.credential);break}return e.embeddedClientId&&j3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&q3(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[UGe])&&q3(r,{[UGe]:"1"}),rK(r,e.correlationId,this.performanceClient),yO(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&vFt(r,e.postLogoutRedirectUri),e.correlationId&&aK(r,e.correlationId),e.idTokenHint&&CFt(r,e.idTokenHint),e.state&&nIe(r,e.state),e.logoutHint&&kFt(r,e.logoutHint),e.extraQueryParameters&&q3(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&cIe(r),yO(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await JFt(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var hDo=300,pK=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=$3(e),this.logger=new mg(this.config.loggerOptions,kQ,_O),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}async acquireToken(e,r){let n=q1(),o=await ra(this.executeTokenRequest.bind(this),Man,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[eh.X_MS_REQUEST_ID],c=new rh(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(o.body,e.correlationId),ra(c.handleServerTokenResponse.bind(c),n$e,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,n,e,r,void 0,void 0,!0,e.forceCache,s)}async acquireTokenByRefreshToken(e,r){if(!e)throw Dl(Y3t);if(!e.account)throw Nt(XTe);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await ra(this.acquireTokenWithCachedRefreshToken.bind(this),r$e,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof j1&&o.errorCode===i$e,c=o instanceof VE&&o.errorCode===r3t&&o.subError===n3t;if(s||c)return ra(this.acquireTokenWithCachedRefreshToken.bind(this),r$e,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return ra(this.acquireTokenWithCachedRefreshToken.bind(this),r$e,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=Yan(this.cacheManager.getRefreshToken.bind(this.cacheManager),zan,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw a$e(i$e);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||hDo;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),lle(o.expiresOn,c))throw a$e(HFt)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||Tf.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:WE.HOME_ACCOUNT_ID}};try{return await ra(this.acquireToken.bind(this),Oan,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof j1&&c.subError===EIe){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache",e.correlationId);let l=this.cacheManager.generateCredentialKey(o);this.cacheManager.removeRefreshToken(l,e.correlationId)}throw c}}async executeTokenRequest(e,r){let n=bIe(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=Ds.appendQueryString(r.tokenEndpoint,n),s=await ra(this.createTokenRequestBody.bind(this),Lan,this.logger,this.performanceClient,e.correlationId)(e),c=CIe(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=fle(this.config.authOptions.clientId,e);return ra(SIe,Dan,this.logger,this.performanceClient,e.correlationId)(o,s,c,l,e.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,this.serverTelemetryManager)}async createTokenRequestBody(e){let r=new Map;if(iK(r,e.embeddedClientId||e.extraParameters?.[AO]||this.config.authOptions.clientId),e.redirectUri&&oK(r,e.redirectUri),nK(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),aIe(r,VTe.REFRESH_TOKEN_GRANT),cK(r),tIe(r,this.config.libraryInfo),rIe(r,this.config.telemetry.application),fIe(r),this.serverTelemetryManager&&!ZGe(this.config)&&dIe(r,this.serverTelemetryManager),xFt(r,e.refreshToken),this.config.clientCredentials.clientSecret&&iIe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;oIe(r,await zE(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),sIe(r,n.assertionType)}if(e.authenticationScheme===Tf.POP){let n=new DQ(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await ra(n.generateCnf.bind(n),dle,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,lIe(r,o)}else if(e.authenticationScheme===Tf.SSH)if(e.sshJwk)uIe(r,e.sshJwk);else throw Dl(JTe);if((!Su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sK(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case WE.HOME_ACCOUNT_ID:try{let n=EO(e.ccsCredential.credential);Q3(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case WE.UPN:RQ(r,e.ccsCredential.credential);break}return e.embeddedClientId&&j3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&q3(r,{...e.extraParameters}),rK(r,e.correlationId,this.performanceClient),yO(r)}};p();var xIe=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=$3(e),this.logger=new mg(this.config.loggerOptions,kQ,_O),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}async acquireCachedToken(e){let r=HP.NOT_APPLICABLE;if(e.forceRefresh||!Su.isEmptyObj(e.claims))throw this.setCacheOutcome(HP.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Nt(ile);if(!e.account)throw Nt(XTe);let n=e.account.tenantId||ncn(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(BFt(s.cachedAt)||lle(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(HP.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Nt(ile);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(HP.NO_CACHED_ACCESS_TOKEN,e.correlationId),Nt(ile)}else s.refreshOn&&lle(s.refreshOn,0)&&(r=HP.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(HP.NO_CACHED_ACCESS_TOKEN,e.correlationId),Nt(ile);let c=e.authority||this.authority.getPreferredCache(),l={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,n),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c,e.correlationId)};return this.setCacheOutcome(r,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await ra(this.generateResultFromCacheRecord.bind(this),Ban,this.logger,this.performanceClient,e.correlationId)(l,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==HP.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: '${e}'`,r)}async generateResultFromCacheRecord(e,r){let n;if(e.idToken&&(n=G3(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw Nt(ZTe);hIe(o,r.maxAge)}return rh.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var wIe={};Ti(wIe,{getAuthorizationCodePayload:()=>ADo,getAuthorizeUrl:()=>gDo,getStandardAuthorizeRequestParameters:()=>mDo,validateAuthorizationResponse:()=>icn});p();function mDo(t,e,r,n){let o=e.correlationId,s=new Map;iK(s,e.embeddedClientId||e.extraQueryParameters?.[AO]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(nK(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),pIe(s,e.resource),oK(s,e.redirectUri),aK(s,o),EFt(s,e.responseMode),cK(s),RFt(s),e.prompt&&(SFt(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(bFt(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==$Te.SELECT_ACCOUNT)if(e.sid&&e.prompt===$Te.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),zGe(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=_Do(e.account),u=EDo(e.account);if(u&&e.domainHint&&(r.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint',e.correlationId),u=null),u){r.verbose("createAuthCodeUrlQueryString: login_hint claim present on account",e.correlationId),ole(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=EO(e.account.homeAccountId);Q3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===$Te.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),zGe(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=EO(e.account.homeAccountId);Q3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(e.loginHint)r.verbose("createAuthCodeUrlQueryString: Adding login_hint from request",e.correlationId),ole(s,e.loginHint),RQ(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),ole(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=EO(e.account.homeAccountId);Q3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}}else e.loginHint&&(r.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request",e.correlationId),ole(s,e.loginHint),RQ(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&TFt(s,e.nonce),e.state&&nIe(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&sK(s,e.claims,t.clientCapabilities),e.embeddedClientId&&j3(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(ele))&&cIe(s),s}a(mDo,"getStandardAuthorizeRequestParameters");function gDo(t,e){let r=yO(e);return Ds.appendQueryString(t.authorizationEndpoint,r)}a(gDo,"getAuthorizeUrl");function ADo(t,e){if(icn(t,e),!t.code)throw Nt(mFt);return t}a(ADo,"getAuthorizationCodePayload");function icn(t,e){if(!t.state||!e)throw t.state?Nt(VGe,"Cached State"):Nt(VGe,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw Nt(tK,t.state)}try{n=decodeURIComponent(e)}catch{throw Nt(tK,t.state)}if(r!==n)throw Nt(oFt);if(t.error||t.error_description||t.suberror){let o=yDo(t);throw s$e(t.error,t.error_description,t.suberror)?new j1(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new VE(t.error||"",t.error_description,t.suberror,o)}}a(icn,"validateAuthorizationResponse");function yDo(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(yDo,"parseServerErrorNo");function _Do(t){return t.idTokenClaims?.sid||null}a(_Do,"extractAccountSid");function EDo(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(EDo,"extractLoginHint");p();function hK(t,e){if(t){if(e.resource&&(ocn(e.extraParameters)||ocn(e.extraQueryParameters)))throw Nt(_Ft);if(!e.resource)throw Nt(yFt)}}a(hK,"enforceResourceParameter");function ocn(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(ocn,"containsResourceParam");var hle={};Ti(hle,{postRequestFailed:()=>CDo,unexpectedError:()=>vDo});p();var vDo="unexpected_error",CDo="post_request_failed";p();var scn=",",acn="|";function bDo(t){let{skus:e,libraryName:r,libraryVersion:n,extensionName:o,extensionVersion:s}=t,c=new Map([[0,[r,n]],[2,[o,s]]]),l=[];if(e?.length){if(l=e.split(scn),l.length<4)return e}else l=Array.from({length:4},()=>acn);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&SDo({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(scn)}a(bDo,"makeExtraSkuString");function SDo(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(acn))}a(SDo,"setSku");var mK=class t{static{a(this,"ServerTelemetryManager")}constructor(e,r){this.cacheOutcome=HP.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=WTe+JY+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${IQ}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(IQ),s=this.getRegionDiscoveryFields(),c=[e,s].join(IQ);return[NGe,c,o].join(MGe)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(IQ),o=e.errors.slice(0,r).join(IQ),s=e.errors.length,c=r=YBt&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof jo?e.subError?r.errors.push(e.subError):e.errorCode?r.errors.push(e.errorCode):r.errors.push(e.toString()):r.errors.push(e.toString()):r.errors.push(ZBt),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r,this.correlationId)}incrementCacheHits(){let e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){let e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey,this.correlationId)||e}clearTelemetryCache(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.errors.length;if(r===n)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{let o={failedRequests:e.failedRequests.slice(r*2),errors:e.errors.slice(r),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let r,n=0,o=0,s=e.errors.length;for(r=0;rJSON.parse(l)),lastUpdatedAt:Date.now().toString()},c={};PQ.toObject(c,s),r[n]=c}),r}static deserializeIdTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAccessTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,target:o.target,cachedAt:o.cached_at,expiresOn:o.expires_on,extendedExpiresOn:o.extended_expires_on,refreshOn:o.refresh_on,keyId:o.key_id,tokenType:o.token_type,userAssertionHash:o.userAssertionHash,resource:o.resource,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeRefreshTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,familyId:o.family_id,target:o.target,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAppMetadata(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n];r[n]={clientId:o.client_id,environment:o.environment,familyId:o.family_id}}),r}static deserializeAllCache(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}}};p();p();var ccn="system_assigned_managed_identity",TDo="managed_identity",XFt=`https://login.microsoftonline.com/${TDo}/`,GC={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},nm={API_VERSION:"api-version",RESOURCE:"resource",SHA256_TOKEN_TO_REFRESH:"token_sha256_to_refresh",XMS_CC:"xms_cc"},Zi={AZURE_POD_IDENTITY_AUTHORITY_HOST:"AZURE_POD_IDENTITY_AUTHORITY_HOST",DEFAULT_IDENTITY_CLIENT_ID:"DEFAULT_IDENTITY_CLIENT_ID",IDENTITY_ENDPOINT:"IDENTITY_ENDPOINT",IDENTITY_HEADER:"IDENTITY_HEADER",IDENTITY_SERVER_THUMBPRINT:"IDENTITY_SERVER_THUMBPRINT",IMDS_ENDPOINT:"IMDS_ENDPOINT",MSI_ENDPOINT:"MSI_ENDPOINT",MSI_SECRET:"MSI_SECRET"},ao={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},xf={SYSTEM_ASSIGNED:"system-assigned",USER_ASSIGNED_CLIENT_ID:"user-assigned-client-id",USER_ASSIGNED_RESOURCE_ID:"user-assigned-resource-id",USER_ASSIGNED_OBJECT_ID:"user-assigned-object-id"},sp={GET:"GET",POST:"POST"},lcn="REGION_NAME",ucn="MSAL_FORCE_REGION",dcn=32,fcn={SHA256:"sha256"},u$e={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},e8t={KEY_SEPARATOR:"-"},Zx={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},wf={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByOBO:772,acquireTokenWithManagedIdentity:773,acquireTokenByCode:871,acquireTokenByRefreshToken:872},Xx={RSA_256:"RS256",PSS_256:"PS256",X5T_256:"x5t#S256",X5T:"x5t",X5C:"x5c",AUDIENCE:"aud",EXPIRATION_TIME:"exp",ISSUER:"iss",SUBJECT:"sub",NOT_BEFORE:"nbf",JWT_ID:"jti"},d$e={INTERVAL_MS:100,TIMEOUT_MS:5e3},pcn=4096;p();p();p();var mle=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,sp.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,sp.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:xDo(n),signal:s.signal};r===sp.POST&&(l.body=n?.body||"");let u;try{u=await fetch(e,l)}catch(d){if(c&&clearTimeout(c),d instanceof Error&&d.name==="AbortError")throw eK(th.networkError,"Request timeout");let f=eK(th.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw YFt(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:IDo(u.headers),body:await u.json(),status:u.status}}catch(d){throw eK(th.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function IDo(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(IDo,"getHeaderDict");function xDo(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(xDo,"getFetchHeaders");p();p();p();var f$e="invalid_file_extension",p$e="invalid_file_path",NQ="invalid_managed_identity_id_type",h$e="invalid_secret",hcn="missing_client_id",mcn="network_unavailable",m$e="platform_not_supported",g$e="unable_to_create_azure_arc",A$e="unable_to_create_cloud_shell",y$e="unable_to_create_source",RIe="unable_to_read_secret_file",gcn="user_assigned_not_available_at_runtime",_$e="www_authenticate_header_missing",E$e="www_authenticate_header_unsupported_format",gK={[Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]:"azure_pod_identity_authority_host_url_malformed",[Zi.IDENTITY_ENDPOINT]:"identity_endpoint_url_malformed",[Zi.IMDS_ENDPOINT]:"imds_endpoint_url_malformed",[Zi.MSI_ENDPOINT]:"msi_endpoint_url_malformed"};var wDo={[f$e]:"The file path in the WWW-Authenticate header does not contain a .key file.",[p$e]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[NQ]:"More than one ManagedIdentityIdType was provided.",[h$e]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[m$e]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[hcn]:"A ManagedIdentityId id was not provided.",[gK.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[gK.IDENTITY_ENDPOINT]:`The Managed Identity's '${Zi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[gK.IMDS_ENDPOINT]:`The Managed Identity's '${Zi.IMDS_ENDPOINT}' environment variable is malformed.`,[gK.MSI_ENDPOINT]:`The Managed Identity's '${Zi.MSI_ENDPOINT}' environment variable is malformed.`,[mcn]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[g$e]:"Azure Arc Managed Identities can only be system assigned.",[A$e]:"Cloud Shell Managed Identities can only be system assigned.",[y$e]:"Unable to create a Managed Identity source based on environment variables.",[RIe]:"Unable to read the secret file.",[gcn]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[_$e]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[E$e]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},t8t=class t extends jo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,wDo[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function nh(t){return new t8t(t)}a(nh,"createManagedIdentityError");var v$e=class{static{a(this,"ManagedIdentityId")}get id(){return this._id}set id(e){this._id=e}get idType(){return this._idType}set idType(e){this._idType=e}constructor(e){let r=e?.userAssignedClientId,n=e?.userAssignedResourceId,o=e?.userAssignedObjectId;if(r){if(n||o)throw nh(NQ);this.id=r,this.idType=xf.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw nh(NQ);this.id=n,this.idType=xf.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw nh(NQ);this.id=o,this.idType=xf.USER_ASSIGNED_OBJECT_ID}else this.id=ccn,this.idType=xf.SYSTEM_ASSIGNED}};p();var im={invalidLoopbackAddressType:{code:"invalid_loopback_server_address_type",desc:"Loopback server address is not type string. This is unexpected."},unableToLoadRedirectUri:{code:"unable_to_load_redirectUrl",desc:"Loopback server callback was invoked without a url. This is unexpected."},noAuthCodeInResponse:{code:"no_auth_code_in_response",desc:"No auth code found in the server response. Please check your network trace to determine what happened."},noLoopbackServerExists:{code:"no_loopback_server_exists",desc:"No loopback server exists yet."},loopbackServerAlreadyExists:{code:"loopback_server_already_exists",desc:"Loopback server already exists. Cannot create another."},loopbackServerTimeout:{code:"loopback_server_timeout",desc:"Timed out waiting for auth code listener to be registered."},stateNotFoundError:{code:"state_not_found",desc:"State not found. Please verify that the request originated from msal."},thumbprintMissing:{code:"thumbprint_missing_from_client_certificate",desc:"Client certificate does not contain a SHA-1 or SHA-256 thumbprint."},redirectUriNotSupported:{code:"redirect_uri_not_supported",desc:"RedirectUri is not supported in this scenario. Please remove redirectUri from the request."}},g_=class t extends jo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(im.invalidLoopbackAddressType.code,`${im.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(im.unableToLoadRedirectUri.code,`${im.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(im.noAuthCodeInResponse.code,`${im.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(im.noLoopbackServerExists.code,`${im.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(im.loopbackServerAlreadyExists.code,`${im.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(im.loopbackServerTimeout.code,`${im.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(im.stateNotFoundError.code,im.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(im.thumbprintMissing.code,im.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(im.redirectUriNotSupported.code,im.redirectUriNotSupported.desc)}};var RDo={clientId:"",authority:rr.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:H3.None,tenant:""},isMcp:!1},r8t={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:If.Info},kDo={loggerOptions:r8t,networkClient:new mle,disableInternalRetries:!1,protocolMode:m_.AAD},PDo={application:{appName:"",appVersion:""}};function Acn({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...kDo,networkClient:new mle,loggerOptions:n?.loggerOptions||r8t,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw g_.createStateNotFoundError();return{auth:{...RDo,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...PDo,...o}}}a(Acn,"buildAppConfiguration");function ycn({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new v$e(e),o=r?.loggerOptions||r8t,s;return r?.networkClient?s=r.networkClient:s=new mle,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(ycn,"buildManagedIdentityConfiguration");p();p();Fo();var gle=class{static{a(this,"GuidGenerator")}generateGuid(){return Dt()}isGuid(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}};p();var H1=class t{static{a(this,"EncodingUtils")}static base64Encode(e,r){return Buffer.from(e,r).toString(rr.EncodingTypes.BASE64)}static base64EncodeUrl(e,r){return t.base64Encode(e,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,rr.EncodingTypes.BASE64).toString("utf8")}static base64DecodeUrl(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");for(;r.length%4;)r+="=";return t.base64Decode(r)}};p();p();var _cn=fe(require("crypto"),1);var MQ=class{static{a(this,"HashUtils")}sha256(e){return _cn.default.createHash(fcn.SHA256).update(e).digest()}};var Ecn=fe(require("crypto"),1);var C$e=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new MQ}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%u$e.CV_CHARSET.length;for(;e.length<=dcn;){let o=Ecn.default.randomBytes(1)[0];if(o>=r)continue;let s=o%u$e.CV_CHARSET.length;e.push(u$e.CV_CHARSET[s])}let n=e.join("");return H1.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return H1.base64EncodeUrl(this.hashUtils.sha256(e).toString(rr.EncodingTypes.BASE64),rr.EncodingTypes.BASE64)}};var vO=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new C$e,this.guidGenerator=new gle,this.hashUtils=new MQ}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return H1.base64Encode(e)}base64Decode(e){return H1.base64Decode(e)}generatePkceCodes(){return this.pkceGenerator.generatePkceCodes()}getPublicKeyThumbprint(){throw new Error("Method not implemented.")}removeTokenBindingKey(){throw new Error("Method not implemented.")}clearKeystore(){throw new Error("Method not implemented.")}signJwt(){throw new Error("Method not implemented.")}async hashString(e){return H1.base64EncodeUrl(this.hashUtils.sha256(e).toString(rr.EncodingTypes.BASE64),rr.EncodingTypes.BASE64)}};p();p();function vcn(t){let e=t.credentialType===rr.CredentialType.REFRESH_TOKEN&&t.familyId||t.clientId,r=t.tokenType&&t.tokenType.toLowerCase()!==rr.AuthenticationScheme.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",r].join(e8t.KEY_SEPARATOR).toLowerCase()}a(vcn,"generateCredentialKey");function Ccn(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(e8t.KEY_SEPARATOR).toLowerCase()}a(Ccn,"generateAccountKey");var OQ=class extends PQ{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new rm,o),this.cache={},this.changeEmitters=[],this.logger=e}registerChangeEmitter(e){this.changeEmitters.push(e)}emitChange(){this.changeEmitters.forEach(e=>e.call(null))}cacheToInMemoryCache(e){let r={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(let n in e){let o=e[n];if(typeof o=="object")if(dK.isAccountEntity(o))r.accounts[n]=o;else if($E.isIdTokenEntity(o))r.idTokens[n]=o;else if($E.isAccessTokenEntity(o))r.accessTokens[n]=o;else if($E.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if($E.isAppMetadataEntity(n,o))r.appMetadata[n]=o;else continue}return r}inMemoryCacheToCache(e){let r=this.getCache();return r={...r,...e.accounts,...e.idTokens,...e.accessTokens,...e.refreshTokens,...e.appMetadata},r}getInMemoryCache(){return this.logger.trace("Getting in-memory cache",""),this.cacheToInMemoryCache(this.getCache())}setInMemoryCache(e){this.logger.trace("Setting in-memory cache","");let r=this.inMemoryCacheToCache(e);this.setCache(r),this.emitChange()}getCache(){return this.logger.trace("Getting cache key-value store",""),this.cache}setCache(e){this.logger.trace("Setting cache key value store",""),this.cache=e,this.emitChange()}getItem(e){return this.logger.tracePii(`Item key: ${e}`,""),this.getCache()[e]}setItem(e,r){this.logger.tracePii(`Item key: ${e}`,"");let n=this.getCache();n[e]=r,this.setCache(n)}generateCredentialKey(e){return vcn(e)}generateAccountKey(e){return Ccn(e)}getAccountKeys(){let e=this.getInMemoryCache();return Object.keys(e.accounts)}getTokenKeys(){let e=this.getInMemoryCache();return{idToken:Object.keys(e.idTokens),accessToken:Object.keys(e.accessTokens),refreshToken:Object.keys(e.refreshTokens)}}getAccount(e){let r=this.getItem(e);return r&&typeof r=="object"?{...r}:null}async setAccount(e){let r=this.generateAccountKey(dK.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return $E.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return $E.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return $E.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return $E.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=$E.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&$E.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&$E.isAuthorityMetadataEntity(e,r)?r:null}getAuthorityMetadataKeys(){return this.getKeys().filter(e=>this.isAuthorityMetadata(e))}setAuthorityMetadata(e,r){this.setItem(e,r)}getThrottlingCache(e){let r=this.getItem(e);return r&&$E.isThrottlingEntity(e,r)?r:null}setThrottlingCache(e,r){this.setItem(e,r)}removeItem(e){this.logger.tracePii(`Item key: ${e}`,"");let r=!1,n=this.getCache();return n[e]&&(delete n[e],r=!0),r&&(this.setCache(n),this.emitChange()),r}removeOutdatedAccount(e){this.removeItem(e)}containsKey(e){return this.getKeys().includes(e)}getKeys(){this.logger.trace("Retrieving all cache keys","");let e=this.getCache();return[...Object.keys(e)]}clear(){this.logger.trace("Clearing cache entries created by MSAL",""),this.getKeys().forEach(r=>{this.removeItem(r)}),this.emitChange()}static generateInMemoryCache(e){return V3.deserializeAllCache(V3.deserializeJSONBlob(e))}static generateJsonCache(e){return TQ.serializeAllCache(e)}updateCredentialCacheKey(e,r){let n=this.generateCredentialKey(r);if(e!==n){let o=this.getItem(e);if(o)return this.removeItem(e),this.setItem(n,o),this.logger.verbose(`Updated an outdated ${r.credentialType} cache key`,""),n;this.logger.error(`Attempted to update an outdated ${r.credentialType} cache key but no item matching the outdated key was found in storage`,"")}return e}};p();var kIe={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},Ale=class{static{a(this,"TokenCache")}constructor(e,r,n){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),n&&(this.persistence=n),this.logger=r}hasChanged(){return this.cacheHasChanged}serialize(){this.logger.trace("Serializing in-memory cache","");let e=TQ.serializeAllCache(this.storage.getInMemoryCache());return this.cacheSnapshot?(this.logger.trace("Reading cache snapshot from disk",""),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)):this.logger.trace("No cache snapshot to merge",""),this.cacheHasChanged=!1,JSON.stringify(e)}deserialize(e){if(this.logger.trace("Deserializing JSON to in-memory cache",""),this.cacheSnapshot=e,this.cacheSnapshot){this.logger.trace("Reading cache snapshot from disk","");let r=V3.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(r)}else this.logger.trace("No cache snapshot to deserialize","")}getKVStore(){return this.storage.getCache()}getCacheSnapshot(){let e=OQ.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new vO().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new Q1(this,!1),await this.persistence.beforeCacheAccess(r)),this.storage.getAllAccounts({},e)}finally{this.persistence&&r&&await this.persistence.afterCacheAccess(r)}}async getAccountByHomeId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(n=>n.homeAccountId===e)[0]||null}async getAccountByLocalId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(n=>n.localAccountId===e)[0]||null}async removeAccount(e,r){this.logger.trace("removeAccount called",r||"");let n;try{this.persistence&&(n=new Q1(this,!0),await this.persistence.beforeCacheAccess(n)),this.storage.removeAccount(e,r||new gle().generateGuid())}finally{this.persistence&&n&&await this.persistence.afterCacheAccess(n)}}async overwriteCache(){if(!this.persistence){this.logger.info("No persistence layer specified, cache cannot be overwritten","");return}this.logger.info("Overwriting in-memory cache with persistent cache",""),this.storage.clear();let e=new Q1(this,!1);await this.persistence.beforeCacheAccess(e);let r=this.getCacheSnapshot();this.storage.setCache(r),await this.persistence.afterCacheAccess(e)}handleChangeEvent(){this.cacheHasChanged=!0}mergeState(e,r){this.logger.trace("Merging in-memory cache with cache snapshot","");let n=this.mergeRemovals(e,r);return this.mergeUpdates(n,r)}mergeUpdates(e,r){return Object.keys(r).forEach(n=>{let o=r[n];if(!e.hasOwnProperty(n))o!==null&&(e[n]=o);else{let s=o!==null,c=typeof o=="object",l=!Array.isArray(o),u=typeof e[n]<"u"&&e[n]!==null;s&&c&&l&&u?this.mergeUpdates(e[n],o):e[n]=o}}),e}mergeRemovals(e,r){this.logger.trace("Remove updated entries in cache","");let n=e.Account?this.mergeRemovalsDict(e.Account,r.Account):e.Account,o=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,r.AccessToken):e.AccessToken,s=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,r.RefreshToken):e.RefreshToken,c=e.IdToken?this.mergeRemovalsDict(e.IdToken,r.IdToken):e.IdToken,l=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,r.AppMetadata):e.AppMetadata;return{...e,Account:n,AccessToken:o,RefreshToken:s,IdToken:c,AppMetadata:l}}mergeRemovalsDict(e,r){let n={...e};return Object.keys(e).forEach(o=>{(!r||!r.hasOwnProperty(o))&&delete n[o]}),n}overlayDefaults(e){return this.logger.trace("Overlaying input cache with the default cache",""),{Account:{...kIe.Account,...e.Account},IdToken:{...kIe.IdToken,...e.IdToken},AccessToken:{...kIe.AccessToken,...e.AccessToken},RefreshToken:{...kIe.RefreshToken,...e.RefreshToken},AppMetadata:{...kIe.AppMetadata,...e.AppMetadata}}}};p();var cfn=fe(tfn(),1);p();var rfn="missing_tenant_id_error",nfn="user_timeout_reached",ifn="invalid_assertion",W8t="invalid_client_credential",ofn="device_code_polling_cancelled",sfn="device_code_expired",afn="device_code_unknown_error";var W3=class t{static{a(this,"ClientAssertion")}static fromAssertion(e){let r=new t;return r.jwt=e,r}static fromCertificate(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!1,n&&(o.publicCertificate=this.parseCertificate(n)),o}static fromCertificateWithSha256Thumbprint(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!0,n&&(o.publicCertificate=this.parseCertificate(n)),o}getJwt(e,r,n){if(this.privateKey&&this.thumbprint)return this.jwt&&!this.isExpired()&&r===this.issuer&&n===this.jwtAudience?this.jwt:this.createJwt(e,r,n);if(this.jwt)return this.jwt;throw Nt(ifn)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=sd.nowSeconds();this.expirationTime=o+600;let c={alg:this.useSha256?Xx.PSS_256:Xx.RSA_256},l=this.useSha256?Xx.X5T_256:Xx.X5T;Object.assign(c,{[l]:H1.base64EncodeUrl(this.thumbprint,rr.EncodingTypes.HEX)}),this.publicCertificate&&Object.assign(c,{[Xx.X5C]:this.publicCertificate});let u={[Xx.AUDIENCE]:this.jwtAudience,[Xx.EXPIRATION_TIME]:this.expirationTime,[Xx.ISSUER]:this.issuer,[Xx.SUBJECT]:this.issuer,[Xx.NOT_BEFORE]:o,[Xx.JWT_ID]:e.createNewGuid()};return this.jwt=cfn.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&dn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&dn.addCcsUpn(r,e.username),NA.mapToQueryString(r)}};p();function lfn(t,e,r,n){let o=wIe.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return dn.addLibraryInfo(o,{sku:Zx.MSAL_SKU,version:G1,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==m_.OIDC&&dn.addApplicationTelemetry(o,t.telemetry.application),dn.addResponseType(o,rr.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&dn.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),dn.addExtraParameters(o,r.extraQueryParameters||{}),wIe.getAuthorizeUrl(e,o)}a(lfn,"getAuthCodeRequestUrl");var wle=class{static{a(this,"ClientApplication")}constructor(e){this.config=Acn(e),this.cryptoProvider=new vO,this.logger=new mg(this.config.system.loggerOptions,xle,G1),this.storage=new OQ(this.logger,this.config.auth.clientId,this.cryptoProvider,KFt(this.config.auth)),this.tokenCache=new Ale(this.storage,this.logger,this.config.cache.cachePlugin)}async getAuthCodeUrl(e){this.logger.info("getAuthCodeUrl called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),responseMode:e.responseMode||rr.ResponseMode.QUERY,authenticationScheme:rr.AuthenticationScheme.BEARER,state:e.state||"",nonce:e.nonce||""},n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions);return lfn(this.config,n,r,this.logger)}async acquireTokenByCode(e,r){this.logger.info("acquireTokenByCode called",e.correlationId||""),e.state&&r&&(this.logger.info("acquireTokenByCode - validating state",e.correlationId||""),this.validateState(e.state,r.state||""),r={...r,state:""});let n={...e,...await this.initializeBaseRequest(e),authenticationScheme:rr.AuthenticationScheme.BEARER},o=this.initializeServerTelemetryManager(wf.acquireTokenByCode,n.correlationId);try{let s=await this.createAuthority(n.authority,n.correlationId,void 0,e.azureCloudOptions),c=await this.buildOauthClientConfiguration(s,n.correlationId,n.redirectUri,o),l=new IIe(c,new rm);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,wf.acquireTokenByCode,r)}catch(s){throw s instanceof jo&&s.setCorrelationId(n.correlationId),o.cacheFailedRequest(s),s}}async acquireTokenByRefreshToken(e){this.logger.info("acquireTokenByRefreshToken called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),authenticationScheme:rr.AuthenticationScheme.BEARER},n=this.initializeServerTelemetryManager(wf.acquireTokenByRefreshToken,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,r.redirectUri||"",n),c=new pK(s,new rm);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,wf.acquireTokenByRefreshToken)}catch(o){throw o instanceof jo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenSilent(e){let r={...e,...await this.initializeBaseRequest(e),forceRefresh:e.forceRefresh||!1},n=this.initializeServerTelemetryManager(wf.acquireTokenSilent,r.correlationId,r.forceRefresh);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,r.redirectUri||"",n),c=new xIe(s,new rm);this.logger.verbose("Silent flow client created",r.correlationId);try{return await this.tokenCache.overwriteCache(),await this.acquireCachedTokenSilent(r,c,s)}catch(l){if(l instanceof wQ&&l.errorCode===th.tokenRefreshRequired)return new pK(s,new rm).acquireTokenByRefreshToken(r,wf.acquireTokenSilent);throw l}}catch(o){throw o instanceof jo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireCachedTokenSilent(e,r,n){let[o,s]=await r.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...rr.OIDC_DEFAULT_SCOPES]});if(s===rr.CacheOutcome.PROACTIVELY_REFRESHED){this.logger.info("ClientApplication:acquireCachedTokenSilent - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.",e.correlationId);let c=new pK(n,new rm);try{await c.acquireTokenByRefreshToken(e,wf.acquireTokenSilent)}catch{}}return o}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)},n=this.initializeServerTelemetryManager(wf.acquireTokenByUsernamePassword,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,"",n),c=new Z$e(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof jo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw g_.createStateNotFoundError();if(e!==r)throw Nt(th.stateMismatch)}getLogger(){return this.logger}setLogger(e){this.logger=e}async buildOauthClientConfiguration(e,r,n,o){return this.logger.verbose("buildOauthClientConfiguration called",r),this.logger.info(`Building oauth client configuration with the following authority: ${e.tokenEndpoint}.`,r),o?.updateRegionDiscoveryMetadata(e.regionDiscoveryMetadata),{authOptions:{clientId:this.config.auth.clientId,authority:e,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:n,isMcp:this.config.auth.isMcp},loggerOptions:{logLevel:this.config.system.loggerOptions.logLevel,loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,correlationId:r},cryptoInterface:this.cryptoProvider,networkInterface:this.config.system.networkClient,storageInterface:this.storage,serverTelemetryManager:o,clientCredentials:{clientSecret:this.clientSecret,clientAssertion:await this.getClientAssertion(e)},libraryInfo:{sku:Zx.MSAL_SKU,version:G1,cpu:process.arch||"",os:process.platform||""},telemetry:this.config.telemetry,persistencePlugin:this.config.cache.cachePlugin,serializableCache:this.tokenCache}}async getClientAssertion(e){return this.developerProvidedClientAssertion&&(this.clientAssertion=W3.fromAssertion(await zE(this.developerProvidedClientAssertion,this.config.auth.clientId,e.tokenEndpoint))),this.clientAssertion&&{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:Zx.JWT_BEARER_ASSERTION_TYPE}}async initializeBaseRequest(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();return this.logger.verbose("initializeRequestScopes called",r),e.authenticationScheme&&e.authenticationScheme===rr.AuthenticationScheme.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",r),e.authenticationScheme=rr.AuthenticationScheme.BEARER,{...e,scopes:[...e&&e.scopes||[],...rr.OIDC_DEFAULT_SCOPES],correlationId:r,authority:e.authority||this.config.auth.authority}}initializeServerTelemetryManager(e,r,n){let o={clientId:this.config.auth.clientId,correlationId:r,apiId:e,forceRefresh:n||!1};return new mK(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=$P.generateAuthority(e,o||this.config.auth.azureCloudOptions),c={protocolMode:this.config.system.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,azureRegionConfiguration:n};return l$e.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new rm)}clearCache(){this.storage.clear()}};p();var ufn=fe(require("http"),1);var X$e=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw g_.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=ufn.default.createServer((s,c)=>{let l=s.url;if(l){if(l===rr.FORWARD_SLASH){c.end(e||"Auth code was successfully acquired. You can close this window now.");return}}else{c.end(r||"Error occurred loading redirectUrl"),o(g_.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=NA.getDeserializedResponse(d.search)||{};f.code&&(c.writeHead(rr.HTTP_REDIRECT,{location:u}),c.end()),f.error&&c.end(r||`Error occurred: ${f.error}`),n(f)}),this.server.listen(0,"127.0.0.1")})}getRedirectUri(){if(!this.server||!this.server.listening)throw g_.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),g_.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${Zx.HTTP_PROTOCOL}${Zx.LOCALHOST}:${r}`}closeServer(){this.server&&(this.server.close(),typeof this.server.closeAllConnections=="function"&&this.server.closeAllConnections(),this.server.unref(),this.server=void 0)}};p();var eVe=class extends SO{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=sd.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new rh(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(o,e.correlationId),s.handleServerTokenResponse(o,this.authority,n,e,wf.acquireTokenByDeviceCode)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),n=Ds.appendQueryString(this.authority.deviceCodeEndpoint,r),o=this.createQueryString(e),s=this.createTokenRequestHeaders(),c={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return this.executePostRequestToDeviceCodeEndpoint(n,o,s,c,e.correlationId)}createExtraQueryParameters(e){let r=new Map;return e.extraQueryParameters&&dn.addExtraParameters(r,e.extraQueryParameters),NA.mapToQueryString(r)}async executePostRequestToDeviceCodeEndpoint(e,r,n,o,s){let{body:{user_code:c,device_code:l,verification_uri:u,expires_in:d,interval:f,message:h}}=await this.sendPostRequest(o,e,{body:r,headers:n},s);return{userCode:c,deviceCode:l,verificationUri:u,expiresIn:d,interval:f,message:h}}createQueryString(e){let r=new Map;return dn.addScopes(r,e.scopes),dn.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&dn.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&dn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),NA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),Nt(ofn);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),Nt(nfn);if(sd.nowSeconds()>e)throw r&&this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${r}`,""),this.logger.error(`Device code expired. Expiration time of device code was ${e}`,""),Nt(sfn);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=Ds.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?sd.nowSeconds()+e.timeout:void 0,u=sd.nowSeconds()+r.expiresIn,d=r.interval*1e3;for(;this.continuePolling(u,l,e.cancel);){let f={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},h=await this.executePostToTokenEndpoint(o,s,c,f,e.correlationId);if(h.body&&h.body.error)if(h.body.error===rr.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling.",e.correlationId),await sd.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),eK(hle.postRequestFailed,h.body.error);else return this.logger.verbose("Authorization completed successfully. Polling stopped.",e.correlationId),h.body}throw this.logger.error("Polling stopped for unknown reasons.",e.correlationId),Nt(afn)}createTokenRequestBody(e,r){let n=new Map;dn.addScopes(n,e.scopes),dn.addClientId(n,this.config.authOptions.clientId),dn.addGrantType(n,rr.GrantType.DEVICE_CODE_GRANT),dn.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return dn.addCorrelationId(n,o),dn.addClientInfo(n),dn.addLibraryInfo(n,this.config.libraryInfo),dn.addApplicationTelemetry(n,this.config.telemetry.application),dn.addThrottling(n),this.serverTelemetryManager&&dn.addServerTelemetry(n,this.serverTelemetryManager),(!Su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&dn.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),NA.mapToQueryString(n)}};var Rle=class extends wle{static{a(this,"PublicClientApplication")}constructor(e){super(e),this.config.broker.nativeBrokerPlugin&&(this.config.broker.nativeBrokerPlugin.isBrokerAvailable?(this.nativeBrokerPlugin=this.config.broker.nativeBrokerPlugin,this.nativeBrokerPlugin.setLogger(this.config.system.loggerOptions)):this.logger.warning("NativeBroker implementation was provided but the broker is unavailable.","")),this.skus=mK.makeExtraSkuString({libraryName:Zx.MSAL_SKU,libraryVersion:G1})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),hK(this.config.auth.isMcp,e);let r=Object.assign(e,await this.initializeBaseRequest(e)),n=this.initializeServerTelemetryManager(wf.acquireTokenByDeviceCode,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,"",n),c=new eVe(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof jo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),hK(this.config.auth.isMcp,e);let{openBrowser:n,successTemplate:o,errorTemplate:s,windowHandle:c,loopbackClient:l,...u}=e;if(this.nativeBrokerPlugin){let A={...u,clientId:this.config.auth.clientId,scopes:e.scopes||rr.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...u.extraQueryParameters,...u.extraParameters,[XY.X_CLIENT_EXTRA_SKU]:this.skus},accountId:u.account?.nativeAccountId};return this.nativeBrokerPlugin.acquireTokenInteractive(A,c)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw g_.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new X$e,m={},g=null;try{let A=h.listenForAuthCode(o,s).then(T=>{m=T}).catch(T=>{g=T}),y=await this.waitForRedirectUri(h),_={...u,correlationId:r,scopes:e.scopes||rr.OIDC_DEFAULT_SCOPES,redirectUri:y,responseMode:rr.ResponseMode.QUERY,codeChallenge:f,codeChallengeMethod:rr.CodeChallengeMethodValues.S256},E=await this.getAuthCodeUrl(_);if(await n(E),await A,g)throw g;if(m.error)throw new VE(m.error,m.error_description,m.suberror);if(!m.code)throw g_.createNoAuthCodeInResponseError();let v=m.client_info,S={code:m.code,codeVerifier:d,clientInfo:v||"",..._};return await this.acquireTokenByCode(S)}finally{h.closeServer()}}async acquireTokenSilent(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();if(this.logger.trace("acquireTokenSilent called",r),hK(this.config.auth.isMcp,e),this.nativeBrokerPlugin){let n={...e,clientId:this.config.auth.clientId,scopes:e.scopes||rr.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...e.extraQueryParameters,...e.extraParameters,[XY.X_CLIENT_EXTRA_SKU]:this.skus},accountId:e.account.nativeAccountId,forceRefresh:e.forceRefresh||!1};return this.nativeBrokerPlugin.acquireTokenSilent(n)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw g_.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return hK(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return hK(this.config.auth.isMcp,e),super.acquireTokenByRefreshToken(e)}async signOut(e){if(this.nativeBrokerPlugin&&e.account.nativeAccountId){let r={clientId:this.config.auth.clientId,accountId:e.account.nativeAccountId,correlationId:e.correlationId||this.cryptoProvider.createNewGuid()};await this.nativeBrokerPlugin.signOut(r)}await this.getTokenCache().removeAccount(e.account,e.correlationId)}async getAllAccounts(){if(this.nativeBrokerPlugin){let e=this.cryptoProvider.createNewGuid();return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId,e)}return this.getTokenCache().getAllAccounts()}async waitForRedirectUri(e){return new Promise((r,n)=>{let o=0,s=setInterval(()=>{if(d$e.TIMEOUT_MS/d$e.INTERVAL_MS1)throw Nt(th.multipleMatchingTokens);return l[0]}async executeTokenRequest(e,r,n){let o,s;if(this.appTokenProvider){this.logger.info("Using appTokenProvider extensibility.",e.correlationId);let u={correlationId:e.correlationId,tenantId:this.config.authOptions.authority.tenant,scopes:e.scopes,claims:e.claims};s=sd.nowSeconds();let d=await this.appTokenProvider(u);o={access_token:d.accessToken,expires_in:d.expiresInSeconds,refresh_in:d.refreshInSeconds,token_type:rr.AuthenticationScheme.BEARER}}else{let u=this.createTokenQueryParameters(e),d=Ds.appendQueryString(r.tokenEndpoint,u),f=await this.createTokenRequestBody(e),h=this.createTokenRequestHeaders(),m={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};this.logger.info("Sending token request to endpoint: "+r.tokenEndpoint,e.correlationId),s=sd.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new rh(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(o,e.correlationId,n),await c.handleServerTokenResponse(o,this.authority,s,e,wf.acquireTokenByClientCredential)}async createTokenRequestBody(e){let r=new Map;dn.addClientId(r,this.config.authOptions.clientId),dn.addScopes(r,e.scopes,!1),dn.addGrantType(r,rr.GrantType.CLIENT_CREDENTIALS_GRANT),dn.addLibraryInfo(r,this.config.libraryInfo),dn.addApplicationTelemetry(r,this.config.telemetry.application),dn.addThrottling(r),this.serverTelemetryManager&&dn.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();dn.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&dn.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(dn.addClientAssertion(r,await zE(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),dn.addClientAssertionType(r,o.assertionType)),(!Su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&dn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),NA.mapToQueryString(r)}};p();var tVe=class extends SO{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new tm(e.scopes||[]),this.userAssertionHash=await this.cryptoUtils.hashString(e.oboAssertion),e.skipCache||e.claims)return this.executeTokenRequest(e,this.authority,this.userAssertionHash);try{return await this.getCachedAuthenticationResult(e)}catch{return await this.executeTokenRequest(e,this.authority,this.userAssertionHash)}}async getCachedAuthenticationResult(e){let r=this.readAccessTokenFromCacheForOBO(this.config.authOptions.clientId,e);if(r){if(sd.isTokenExpired(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(rr.CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info(`OnbehalfofFlow:getCachedAuthenticationResult - Cached access token is expired or will expire within ${this.config.systemOptions.tokenRenewalOffsetSeconds} seconds.`,e.correlationId),Nt(th.tokenRefreshRequired)}else throw this.serverTelemetryManager?.setCacheOutcome(rr.CacheOutcome.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.",e.correlationId),Nt(th.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=KGe.extractTokenClaims(n.secret,H1.base64Decode);let c=o.oid||o.sub,l={homeAccountId:n.homeAccountId,environment:n.environment,tenantId:n.realm,username:"",localAccountId:c||""};s=this.cacheManager.getAccount(this.cacheManager.generateAccountKey(l),e.correlationId)}return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),rh.generateAuthenticationResult(this.cryptoUtils,this.authority,{account:s,accessToken:r,idToken:n,refreshToken:null,appMetadata:null},!0,e,this.performanceClient,o)}readIdTokenFromCacheForOBO(e,r){let n={homeAccountId:e,environment:this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,credentialType:rr.CredentialType.ID_TOKEN,clientId:this.config.authOptions.clientId,realm:this.authority.tenant},o=this.cacheManager.getIdTokensByFilter(n,r);return Object.values(o).length<1?null:Object.values(o)[0]}readAccessTokenFromCacheForOBO(e,r){let n=r.authenticationScheme||rr.AuthenticationScheme.BEARER,s={credentialType:n&&n.toLowerCase()!==rr.AuthenticationScheme.BEARER.toLowerCase()?rr.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:rr.CredentialType.ACCESS_TOKEN,clientId:e,target:tm.createSearchScopes(this.scopeSet.asArray()),tokenType:n,keyId:r.sshKid,userAssertionHash:this.userAssertionHash},c=this.cacheManager.getAccessTokensByFilter(s,r.correlationId),l=c.length;if(l<1)return null;if(l>1)throw Nt(th.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=Ds.appendQueryString(r.tokenEndpoint,o),c=await this.createTokenRequestBody(e),l=this.createTokenRequestHeaders(),u={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},d=sd.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new rh(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return h.validateTokenResponse(f.body,e.correlationId),await h.handleServerTokenResponse(f.body,this.authority,d,e,wf.acquireTokenByOBO,void 0,n)}async createTokenRequestBody(e){let r=new Map;dn.addClientId(r,this.config.authOptions.clientId),dn.addScopes(r,e.scopes),dn.addGrantType(r,rr.GrantType.JWT_BEARER),dn.addClientInfo(r),dn.addLibraryInfo(r,this.config.libraryInfo),dn.addApplicationTelemetry(r,this.config.telemetry.application),dn.addThrottling(r),this.serverTelemetryManager&&dn.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();dn.addCorrelationId(r,n),dn.addRequestTokenUse(r,XY.ON_BEHALF_OF),dn.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&dn.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(dn.addClientAssertion(r,await zE(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),dn.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&dn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),NA.mapToQueryString(r)}};var Ple=class extends wle{static{a(this,"ConfidentialClientApplication")}constructor(e){super(e);let r=!!this.config.auth.clientSecret,n=!!this.config.auth.clientAssertion,o=(!!this.config.auth.clientCertificate?.thumbprint||!!this.config.auth.clientCertificate?.thumbprintSha256)&&!!this.config.auth.clientCertificate?.privateKey;if(!this.appTokenProvider){if(r&&n||n&&o||r&&o)throw Nt(W8t);if(this.config.auth.clientSecret){this.clientSecret=this.config.auth.clientSecret;return}if(this.config.auth.clientAssertion){this.developerProvidedClientAssertion=this.config.auth.clientAssertion;return}if(o)this.clientAssertion=this.config.auth.clientCertificate.thumbprintSha256?W3.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):W3.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw Nt(W8t);this.appTokenProvider=void 0}}SetAppTokenProvider(e){this.appTokenProvider=e}async acquireTokenByClientCredential(e){this.logger.info("acquireTokenByClientCredential called",e.correlationId||"");let r;e.clientAssertion&&(r={assertion:await zE(e.clientAssertion,this.config.auth.clientId),assertionType:Zx.JWT_BEARER_ASSERTION_TYPE});let n=await this.initializeBaseRequest(e),o={...n,scopes:n.scopes.filter(m=>!rr.OIDC_DEFAULT_SCOPES.includes(m))},s={...e,...o,clientAssertion:r},l=new Ds(s.authority).getUrlComponents().PathSegments[0];if(Object.values(rr.AADAuthority).includes(l))throw Nt(rfn);let u=process.env[ucn],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[lcn]},h=this.initializeServerTelemetryManager(wf.acquireTokenByClientCredential,s.correlationId,s.skipCache);try{let m=await this.createAuthority(s.authority,s.correlationId,f,e.azureCloudOptions),g=await this.buildOauthClientConfiguration(m,s.correlationId,"",h),A=new kle(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof jo&&m.setCorrelationId(s.correlationId),h.cacheFailedRequest(m),m}}async acquireTokenOnBehalfOf(e){this.logger.info("acquireTokenOnBehalfOf called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)};try{let n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),o=await this.buildOauthClientConfiguration(n,r.correlationId,"",void 0),s=new tVe(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof jo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function dfn(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(dfn,"isIso8601");p();var rVe=class{static{a(this,"HttpClientWithRetries")}constructor(e,r,n){this.httpClientNoRetries=e,this.retryPolicy=r,this.logger=n}async sendNetworkRequestAsyncHelper(e,r,n){return e===sp.GET?this.httpClientNoRetries.sendGetRequestAsync(r,n):this.httpClientNoRetries.sendPostRequestAsync(r,n)}async sendNetworkRequestAsync(e,r,n){let o=await this.sendNetworkRequestAsyncHelper(e,r,n);"isNewRequest"in this.retryPolicy&&(this.retryPolicy.isNewRequest=!0);let s=0;for(;await this.retryPolicy.pauseForRetry(o.status,s,this.logger,o.headers[rr.HeaderNames.RETRY_AFTER]);)o=await this.sendNetworkRequestAsyncHelper(e,r,n),s++;return o}async sendGetRequestAsync(e,r){return this.sendNetworkRequestAsync(sp.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(sp.POST,e,r)}};var _K={MANAGED_IDENTITY_CLIENT_ID_2017:"clientid",MANAGED_IDENTITY_CLIENT_ID:"client_id",MANAGED_IDENTITY_OBJECT_ID:"object_id",MANAGED_IDENTITY_RESOURCE_ID_IMDS:"msi_res_id",MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS:"mi_res_id"},KE=class{static{a(this,"BaseManagedIdentitySource")}constructor(e,r,n,o,s){this.logger=e,this.nodeStorage=r,this.networkClient=n,this.cryptoProvider=o,this.disableInternalRetries=s}async getServerTokenResponseAsync(e,r,n,o){return this.getServerTokenResponse(e)}getServerTokenResponse(e){let r,n;return e.body.expires_on&&(dfn(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-sd.nowSeconds(),n>2*3600&&(r=n/2)),{status:e.status,access_token:e.body.access_token,expires_in:n,scope:e.body.resource,token_type:e.body.token_type,refresh_in:r,correlation_id:e.body.correlation_id||e.body.correlationId,error:typeof e.body.error=="string"?e.body.error:e.body.error?.code,error_description:e.body.message||(typeof e.body.error=="string"?e.body.error_description:e.body.error?.message),error_codes:e.body.error_codes,timestamp:e.body.timestamp,trace_id:e.body.trace_id}}async acquireTokenWithManagedIdentity(e,r,n,o){let s=this.createRequest(e.resource,r);if(e.revokedTokenSha256Hash&&(this.logger.info(`[Managed Identity] The following claims are present in the request: ${e.claims}`,""),s.queryParameters[nm.SHA256_TOKEN_TO_REFRESH]=e.revokedTokenSha256Hash),e.clientCapabilities?.length){let g=e.clientCapabilities.toString();this.logger.info(`[Managed Identity] The following client capabilities are present in the request: ${g}`,""),s.queryParameters[nm.XMS_CC]=g}let c=s.headers;c[rr.HeaderNames.CONTENT_TYPE]=rr.URL_FORM_CONTENT_TYPE;let l={headers:c};Object.keys(s.bodyParameters).length&&(l.body=s.computeParametersBodyString());let u=this.disableInternalRetries?this.networkClient:new rVe(this.networkClient,s.retryPolicy,this.logger),d=sd.nowSeconds(),f;try{s.httpMethod===sp.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof jo?g:Nt(th.networkError)}let h=new rh(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new rm,null,null),m=await this.getServerTokenResponseAsync(f,u,s,l);return h.validateTokenResponse(m,m.correlation_id||"",o),h.handleServerTokenResponse(m,n,d,e,wf.acquireTokenWithManagedIdentity)}getManagedIdentityUserAssignedIdQueryParameterKey(e,r,n){switch(e){case xf.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?_K.MANAGED_IDENTITY_CLIENT_ID_2017:_K.MANAGED_IDENTITY_CLIENT_ID;case xf.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?_K.MANAGED_IDENTITY_RESOURCE_ID_IMDS:_K.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case xf.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),_K.MANAGED_IDENTITY_OBJECT_ID;default:throw nh(NQ)}}};KE.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new Ds(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),nh(gK[t])}};p();p();p();var nVe=class{static{a(this,"LinearRetryStrategy")}calculateDelay(e,r){if(!e)return r;let n=Math.round(parseFloat(e)*1e3);return isNaN(n)&&(n=new Date(e).valueOf()-new Date().valueOf()),Math.max(r,n)}};var zLo=3,YLo=1e3,KLo=[rr.HTTP_NOT_FOUND,rr.HTTP_REQUEST_TIMEOUT,rr.HTTP_TOO_MANY_REQUESTS,rr.HTTP_SERVER_ERROR,rr.HTTP_SERVICE_UNAVAILABLE,rr.HTTP_GATEWAY_TIMEOUT],iVe=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new nVe}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return YLo}async pauseForRetry(e,r,n,o){if(KLo.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var $C=class{static{a(this,"ManagedIdentityRequestParameters")}constructor(e,r,n){this.httpMethod=e,this._baseEndpoint=r,this.headers={},this.bodyParameters={},this.queryParameters={},this.retryPolicy=n||new iVe}computeUri(){let e=new Map;this.queryParameters&&dn.addExtraParameters(e,this.queryParameters);let r=NA.mapToQueryString(e);return Ds.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&dn.addExtraParameters(e,this.bodyParameters),NA.mapToQueryString(e)}};var JLo="2019-08-01",QIe=class t extends KE{static{a(this,"AppService")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[Zi.IDENTITY_ENDPOINT],r=process.env[Zi.IDENTITY_HEADER];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${ao.APP_SERVICE} managed identity is unavailable because one or both of the '${Zi.IDENTITY_HEADER}' and '${Zi.IDENTITY_ENDPOINT}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Zi.IDENTITY_ENDPOINT,c,ao.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${ao.APP_SERVICE} managed identity. Endpoint URI: ${u}. Creating ${ao.APP_SERVICE} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new $C(sp.GET,this.identityEndpoint);return n.headers[GC.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[nm.API_VERSION]=JLo,n.queryParameters[nm.RESOURCE]=e,r.idType!==xf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var z3=require("fs"),mfn=fe(require("path"),1);var ZLo="2019-11-01",ffn="http://127.0.0.1:40342/metadata/identity/oauth2/token",pfn="N/A: himds executable exists",hfn={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},XLo={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},qIe=class t extends KE{static{a(this,"AzureArc")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static getEnvironmentVariables(){let e=process.env[Zi.IDENTITY_ENDPOINT],r=process.env[Zi.IMDS_ENDPOINT];if(!e||!r){let n=XLo[process.platform];try{(0,z3.accessSync)(n,z3.constants.F_OK|z3.constants.R_OK),e=ffn,r=pfn}catch{}}return[e,r]}static tryCreate(e,r,n,o,s,c){let[l,u]=t.getEnvironmentVariables();if(!l||!u)return e.info(`[Managed Identity] ${ao.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${Zi.IDENTITY_ENDPOINT}' and '${Zi.IMDS_ENDPOINT}' are not defined. ${ao.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===pfn)e.info(`[Managed Identity] ${ao.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${ao.AZURE_ARC} endpoint: ${ffn}. Creating ${ao.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(Zi.IDENTITY_ENDPOINT,l,ao.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(Zi.IMDS_ENDPOINT,u,ao.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${ao.AZURE_ARC} managed identity. Endpoint URI: ${d}. Creating ${ao.AZURE_ARC} managed identity.`,"")}if(c.idType!==xf.SYSTEM_ASSIGNED)throw nh(g$e);return new t(e,r,n,o,s,l)}createRequest(e){let r=new $C(sp.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[GC.METADATA_HEADER_NAME]="true",r.queryParameters[nm.API_VERSION]=ZLo,r.queryParameters[nm.RESOURCE]=e,r}async getServerTokenResponseAsync(e,r,n,o){let s;if(e.status===rr.HTTP_UNAUTHORIZED){let c=e.headers["www-authenticate"];if(!c)throw nh(_$e);if(!c.includes("Basic realm="))throw nh(E$e);let l=c.split("Basic realm=")[1];if(!hfn.hasOwnProperty(process.platform))throw nh(m$e);let u=hfn[process.platform],d=mfn.default.basename(l);if(!d.endsWith(".key"))throw nh(f$e);if(u+d!==l)throw nh(p$e);let f;try{f=await(0,z3.statSync)(l).size}catch{throw nh(RIe)}if(f>pcn)throw nh(h$e);let h;try{h=(0,z3.readFileSync)(l,rr.EncodingTypes.UTF8)}catch{throw nh(RIe)}let m=`Basic ${h}`;this.logger.info("[Managed Identity] Adding authorization header to the request.",""),n.headers[GC.AUTHORIZATION_HEADER_NAME]=m;try{s=await r.sendGetRequestAsync(n.computeUri(),o)}catch(g){throw g instanceof jo?g:Nt(th.networkError)}}return this.getServerTokenResponse(s||e)}};p();var jIe=class t extends KE{static{a(this,"CloudShell")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.msiEndpoint=c}static getEnvironmentVariables(){return[process.env[Zi.MSI_ENDPOINT]]}static tryCreate(e,r,n,o,s,c){let[l]=t.getEnvironmentVariables();if(!l)return e.info(`[Managed Identity] ${ao.CLOUD_SHELL} managed identity is unavailable because the '${Zi.MSI_ENDPOINT} environment variable is not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Zi.MSI_ENDPOINT,l,ao.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${ao.CLOUD_SHELL} managed identity. Endpoint URI: ${u}. Creating ${ao.CLOUD_SHELL} managed identity.`,""),c.idType!==xf.SYSTEM_ASSIGNED)throw nh(A$e);return new t(e,r,n,o,s,l)}createRequest(e){let r=new $C(sp.POST,this.msiEndpoint);return r.headers[GC.METADATA_HEADER_NAME]="true",r.bodyParameters[nm.RESOURCE]=e,r}};p();p();p();var oVe=class{static{a(this,"ExponentialRetryStrategy")}constructor(e,r,n){this.minExponentialBackoff=e,this.maxExponentialBackoff=r,this.exponentialDeltaBackoff=n}calculateDelay(e){return e===0?this.minExponentialBackoff:Math.min(Math.pow(2,e-1)*this.exponentialDeltaBackoff,this.maxExponentialBackoff)}};var eBo=[rr.HTTP_NOT_FOUND,rr.HTTP_REQUEST_TIMEOUT,rr.HTTP_GONE,rr.HTTP_TOO_MANY_REQUESTS],tBo=3,rBo=7,nBo=1e3,iBo=4e3,oBo=2e3,sBo=10*1e3,sVe=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new oVe(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return nBo}static get MAX_EXPONENTIAL_BACKOFF_MS(){return iBo}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return oBo}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return sBo}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===rr.HTTP_GONE?rBo:tBo),(eBo.includes(e)||e>=rr.HTTP_SERVER_ERROR_RANGE_START&&e<=rr.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var gfn="/metadata/identity/oauth2/token",aBo=`http://169.254.169.254${gfn}`,cBo="2018-02-01",aVe=class t extends KE{static{a(this,"Imds")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static tryCreate(e,r,n,o,s){let c;return process.env[Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]?(e.info(`[Managed Identity] Environment variable ${Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} for ${ao.IMDS} returned endpoint: ${process.env[Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}`,""),c=t.getValidatedEnvVariableUrlString(Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST,`${process.env[Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}${gfn}`,ao.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${ao.IMDS}, using the default endpoint.`,""),c=aBo),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new $C(sp.GET,this.identityEndpoint);return n.headers[GC.METADATA_HEADER_NAME]="true",n.queryParameters[nm.API_VERSION]=cBo,n.queryParameters[nm.RESOURCE]=e,r.idType!==xf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new sVe,n}};p();var lBo="2019-07-01-preview",HIe=class t extends KE{static{a(this,"ServiceFabric")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[Zi.IDENTITY_ENDPOINT],r=process.env[Zi.IDENTITY_HEADER],n=process.env[Zi.IDENTITY_SERVER_THUMBPRINT];return[e,r,n]}static tryCreate(e,r,n,o,s,c){let[l,u,d]=t.getEnvironmentVariables();if(!l||!u||!d)return e.info(`[Managed Identity] ${ao.SERVICE_FABRIC} managed identity is unavailable because one or all of the '${Zi.IDENTITY_HEADER}', '${Zi.IDENTITY_ENDPOINT}' or '${Zi.IDENTITY_SERVER_THUMBPRINT}' environment variables are not defined.`,""),null;let f=t.getValidatedEnvVariableUrlString(Zi.IDENTITY_ENDPOINT,l,ao.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${ao.SERVICE_FABRIC} managed identity. Endpoint URI: ${f}. Creating ${ao.SERVICE_FABRIC} managed identity.`,""),c.idType!==xf.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${ao.SERVICE_FABRIC} user assigned managed identity is configured in the cluster, not during runtime. See also: https://learn.microsoft.com/en-us/azure/service-fabric/configure-existing-cluster-enable-managed-identity-token-service.`,""),new t(e,r,n,o,s,l,u)}createRequest(e,r){let n=new $C(sp.GET,this.identityEndpoint);return n.headers[GC.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[nm.API_VERSION]=lBo,n.queryParameters[nm.RESOURCE]=e,r.idType!==xf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var uBo="2017-09-01",dBo=`Only client id is supported for user-assigned managed identity in ${ao.MACHINE_LEARNING}.`,GIe=class t extends KE{static{a(this,"MachineLearning")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.msiEndpoint=c,this.secret=l}static getEnvironmentVariables(){let e=process.env[Zi.MSI_ENDPOINT],r=process.env[Zi.MSI_SECRET];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${ao.MACHINE_LEARNING} managed identity is unavailable because one or both of the '${Zi.MSI_ENDPOINT}' and '${Zi.MSI_SECRET}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Zi.MSI_ENDPOINT,c,ao.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${ao.MACHINE_LEARNING} managed identity. Endpoint URI: ${u}. Creating ${ao.MACHINE_LEARNING} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new $C(sp.GET,this.msiEndpoint);if(n.headers[GC.METADATA_HEADER_NAME]="true",n.headers[GC.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[nm.API_VERSION]=uBo,n.queryParameters[nm.RESOURCE]=e,r.idType===xf.SYSTEM_ASSIGNED)n.queryParameters[_K.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[Zi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===xf.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(dBo);return n}};var $Ie=class t{static{a(this,"ManagedIdentityClient")}constructor(e,r,n,o,s){this.logger=e,this.nodeStorage=r,this.networkClient=n,this.cryptoProvider=o,this.disableInternalRetries=s}async sendManagedIdentityTokenRequest(e,r,n,o){return t.identitySource||(t.identitySource=this.selectManagedIdentitySource(this.logger,this.nodeStorage,this.networkClient,this.cryptoProvider,this.disableInternalRetries,r)),t.identitySource.acquireTokenWithManagedIdentity(e,r,n,o)}allEnvironmentVariablesAreDefined(e){return Object.values(e).every(r=>r!==void 0)}getManagedIdentitySource(){return t.sourceName=this.allEnvironmentVariablesAreDefined(HIe.getEnvironmentVariables())?ao.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(QIe.getEnvironmentVariables())?ao.APP_SERVICE:this.allEnvironmentVariablesAreDefined(GIe.getEnvironmentVariables())?ao.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(jIe.getEnvironmentVariables())?ao.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(qIe.getEnvironmentVariables())?ao.AZURE_ARC:ao.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=HIe.tryCreate(e,r,n,o,s,c)||QIe.tryCreate(e,r,n,o,s)||GIe.tryCreate(e,r,n,o,s)||jIe.tryCreate(e,r,n,o,s,c)||qIe.tryCreate(e,r,n,o,s,c)||aVe.tryCreate(e,r,n,o,s);if(!l)throw nh(y$e);return l}};var fBo=[ao.SERVICE_FABRIC],Dle=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=ycn(e||{}),this.logger=new mg(this.config.system.loggerOptions,xle,G1);let r={canonicalAuthority:rr.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new OQ(this.logger,this.config.managedIdentityId.id,sle,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new vO;let n={protocolMode:m_.AAD,knownAuthorities:[XFt],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new $P(XFt,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new rm,!0),this.fakeClientCredentialClient=new kle({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new $Ie(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new MQ}async acquireToken(e){if(!e.resource)throw Dl(nle.urlEmptyError);let r={forceRefresh:e.forceRefresh,resource:e.resource.replace("/.default",""),scopes:[e.resource.replace("/.default","")],authority:this.fakeAuthority.canonicalAuthority,correlationId:this.cryptoProvider.createNewGuid(),claims:e.claims,clientCapabilities:this.config.clientCapabilities};if(r.forceRefresh)return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority);let[n,o]=await this.fakeClientCredentialClient.getCachedAuthenticationResult(r,this.config,this.cryptoProvider,this.fakeAuthority,t.nodeStorage);if(r.claims){let s=this.managedIdentityClient.getManagedIdentitySource();if(n&&fBo.includes(s)){let c=this.hashUtils.sha256(n.accessToken).toString(rr.EncodingTypes.HEX);r.revokedTokenSha256Hash=c}return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}return n?(o===rr.CacheOutcome.PROACTIVELY_REFRESHED&&(this.logger.info("ClientCredentialClient:getCachedAuthenticationResult - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.",r.correlationId),await this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority,!0)),n):this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}async acquireTokenFromManagedIdentity(e,r,n,o){return this.managedIdentityClient.sendManagedIdentityTokenRequest(e,r,n,o)}getManagedIdentitySource(){return $Ie.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var cVe=class{static{a(this,"DistributedCachePlugin")}constructor(e,r){this.client=e,this.partitionManager=r}async beforeCacheAccess(e){let r=await this.partitionManager.getKey(),n=await this.client.get(r);e.tokenCache.deserialize(n)}async afterCacheAccess(e){if(e.cacheHasChanged){let r=e.tokenCache.getKVStore(),n=Object.values(r).filter(s=>dK.isAccountEntity(s)),o;if(n.length>0){let s=n[0];o=await this.partitionManager.extractKey(s)}else o=await this.partitionManager.getKey();await this.client.set(o,e.tokenCache.serialize())}}};var pBo=rr.PromptValue,hBo=rr.ResponseMode;p();p();p();p();p();function VIe(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(VIe,"getRandomIntegerInclusive");function WIe(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+VIe(0,n/2)}}a(WIe,"calculateRetryDelay");p();function Nle(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Nle,"isObject");p();function EK(t){if(Nle(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(EK,"isError");p();p();var Afn=require("node:crypto");var z8t,mBo=typeof((z8t=globalThis?.crypto)===null||z8t===void 0?void 0:z8t.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):Afn.randomUUID;function Mle(){return mBo()}a(Mle,"randomUUID");p();var Y8t,K8t,J8t,Z8t,yfn=typeof window<"u"&&typeof window.document<"u",_fn=typeof self=="object"&&typeof self?.importScripts=="function"&&(((Y8t=self.constructor)===null||Y8t===void 0?void 0:Y8t.name)==="DedicatedWorkerGlobalScope"||((K8t=self.constructor)===null||K8t===void 0?void 0:K8t.name)==="ServiceWorkerGlobalScope"||((J8t=self.constructor)===null||J8t===void 0?void 0:J8t.name)==="SharedWorkerGlobalScope"),Efn=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",vfn=typeof Bun<"u"&&typeof Bun.version<"u",UQ=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((Z8t=globalThis.process.versions)===null||Z8t===void 0)&&Z8t.node);var Cfn=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function VC(t,e){return Buffer.from(t,e)}a(VC,"stringToUint8Array");p();var X8t="REDACTED",gBo=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],ABo=["api-version"],zP=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=gBo.concat(e),r=ABo.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||Nle(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,X8t);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=X8t;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=X8t;return r}};p();p();p();p();var vK=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function t6t(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new vK(o??"The operation was aborted."))}a(l,"rejectOnAbort");function u(){n?.removeEventListener("abort",d)}a(u,"removeListeners");function d(){r?.(),u(),l()}if(a(d,"onAbort"),n?.aborted)return l();try{t(f=>{u(),s(f)},f=>{u(),c(f)})}catch(f){c(f)}n?.addEventListener("abort",d)})}a(t6t,"createAbortablePromise");p();var CBo="The delay was aborted.";function r6t(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return t6t(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??CBo})}a(r6t,"delay");p();function Ole(t){if(EK(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}a(Ole,"getErrorMessage");p();function bfn(t,e){return WIe(t,e)}a(bfn,"calculateRetryDelay");function lVe(t){return EK(t)}a(lVe,"isError");var uVe=UQ,Lle=UQ;p();var zIe=fo("IdentityUtils"),Sfn="1.0";function CK(t,e,r){let n=a(o=>(zIe.getToken.info(o),new Kx({scopes:Array.isArray(t)?t:[t],getTokenOptions:r,message:o})),"error");if(!e)throw n("No response");if(!e.expiresOn)throw n('Response had no "expiresOn" property.');if(!e.accessToken)throw n('Response had no "accessToken" property.')}a(CK,"ensureValidMsalToken");function n6t(t){let e=t?.authorityHost;return!e&&Lle&&(e=process.env.AZURE_AUTHORITY_HOST),e??FTe}a(n6t,"getAuthorityHost");function i6t(t,e){return e||(e=FTe),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(i6t,"getAuthority");function Tfn(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(Tfn,"getKnownAuthorities");var dVe=a((t,e=uVe?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case $1.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case $1.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case $1.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case $1.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function fVe(t){switch(t){case"error":return $1.LogLevel.Error;case"info":return $1.LogLevel.Info;case"verbose":return $1.LogLevel.Verbose;case"warning":return $1.LogLevel.Warning;default:return $1.LogLevel.Info}}a(fVe,"getMSALLogLevel");function bK(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return zIe.info($s(t,e.message)),new Fn(e.message);case"device_code_polling_cancelled":return new vK("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":zIe.info($s(t,`Authentication returned errorCode ${n.errorCode}`));break;default:zIe.info($s(t,`Failed to acquire token: ${e.message}`));break}}return e.name==="ClientConfigurationError"||e.name==="BrowserConfigurationAuthError"||e.name==="AbortError"||e.name==="AuthenticationError"?e:e.name==="NativeAuthError"?(zIe.info($s(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new Kx({scopes:t,getTokenOptions:r,message:e.message})}a(bK,"handleMsalError");function Ifn(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(Ifn,"publicToMsal");function xfn(t,e){return{authority:e.environment??Usn,homeAccountId:e.homeAccountId,tenantId:e.tenantId||Fsn,username:e.username,clientId:t,version:Sfn}}a(xfn,"msalToPublic");function o6t(t){let e=JSON.parse(t);if(e.version&&e.version!==Sfn)throw Error("Unsupported AuthenticationRecord version");return e}a(o6t,"deserializeAuthenticationRecord");p();p();p();p();p();p();function SBo(t,e){return e!=="Composite"&&e!=="Dictionary"&&(typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)!==null||t===void 0||t===null)}a(SBo,"isPrimitiveBody");function TBo(t){let e=Object.assign(Object.assign({},t.headers),t.body);return t.hasNullableType&&Object.getOwnPropertyNames(e).length===0?t.shouldWrapBody?{body:null}:null:t.shouldWrapBody?Object.assign(Object.assign({},t.headers),{body:t.body}):e}a(TBo,"handleNullableResponseAndWrappableBody");function s6t(t,e){var r,n;let o=t.parsedHeaders;if(t.request.method==="HEAD")return Object.assign(Object.assign({},o),{body:t.parsedBody});let s=e&&e.bodyMapper,c=!!s?.nullable,l=s?.type.name;if(l==="Stream")return Object.assign(Object.assign({},o),{blobBody:t.blobBody,readableStreamBody:t.readableStreamBody});let u=l==="Composite"&&s.type.modelProperties||{},d=Object.keys(u).some(f=>u[f].serializedName==="");if(l==="Sequence"||d){let f=(r=t.parsedBody)!==null&&r!==void 0?r:[];for(let h of Object.keys(u))u[h].serializedName&&(f[h]=(n=t.parsedBody)===null||n===void 0?void 0:n[h]);if(o)for(let h of Object.keys(o))f[h]=o[h];return c&&!t.parsedBody&&!o&&Object.getOwnPropertyNames(u).length===0?null:f}return TBo({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:SBo(t.parsedBody,l)})}a(s6t,"flattenResponse");var TO={Base64Url:"Base64Url",Boolean:"Boolean",ByteArray:"ByteArray",Composite:"Composite",Date:"Date",DateTime:"DateTime",DateTimeRfc1123:"DateTimeRfc1123",Dictionary:"Dictionary",Enum:"Enum",Number:"Number",Object:"Object",Sequence:"Sequence",String:"String",Stream:"Stream",TimeSpan:"TimeSpan",UnixTime:"UnixTime"};p();p();p();p();p();var IO=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var wfn=require("node:os"),Rfn=fe(require("node:util"),1),kfn=fe(require("node:process"),1);function Pfn(t,...e){kfn.stderr.write(`${Rfn.default.format(t,...e)}${wfn.EOL}`)}a(Pfn,"log");var Dfn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Nfn,a6t=[],c6t=[],hVe=[];Dfn&&l6t(Dfn);var Mfn=Object.assign(t=>Ofn(t),{enable:l6t,enabled:u6t,disable:IBo,log:Pfn});function l6t(t){Nfn=t,a6t=[],c6t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?c6t.push(new RegExp(`^${n.substr(1)}$`)):a6t.push(new RegExp(`^${n}$`));for(let n of hVe)n.enabled=u6t(n.namespace)}a(l6t,"enable");function u6t(t){if(t.endsWith("*"))return!0;for(let e of c6t)if(e.test(t))return!1;for(let e of a6t)if(e.test(t))return!0;return!1}a(u6t,"enabled");function IBo(){let t=Nfn||"";return l6t(""),t}a(IBo,"disable");function Ofn(t){let e=Object.assign(r,{enabled:u6t(t),destroy:xBo,log:Mfn.log,namespace:t,extend:wBo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),hVe.push(e),e}a(Ofn,"createDebugger");function xBo(){let t=hVe.indexOf(this);return t>=0?(hVe.splice(t,1),!0):!1}a(xBo,"destroy");function wBo(t){let e=Ofn(`${this.namespace}:${t}`);return e.log=this.log,e}a(wBo,"extend");var Ble=Mfn;var d6t=["verbose","info","warning","error"],Lfn={verbose:400,info:300,warning:200,error:100};function Bfn(t,e){e.log=(...r)=>{t.log(...r)}}a(Bfn,"patchLogMethod");function Ffn(t){return d6t.includes(t)}a(Ffn,"isTypeSpecRuntimeLogLevel");function RBo(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=Ble(t.namespace);o.log=(...f)=>{Ble.log(...f)};function s(f){if(f&&!Ffn(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${d6t.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);Ble.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(Ffn(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${d6t.join(", ")}.`));function c(f){return!!(n&&Lfn[f.level]<=Lfn[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(Bfn(f,m),c(m)){let g=Ble.disable();Ble.enable(g+","+m.namespace)}return e.add(m),m}a(l,"createLogger");function u(){return n}a(u,"contextGetLogLevel");function d(f){let h=o.extend(f);return Bfn(o,h),{error:l(h,"error"),warning:l(h,"warning"),info:l(h,"info"),verbose:l(h,"verbose")}}return a(d,"contextCreateClientLogger"),{setLogLevel:s,getLogLevel:u,createClientLogger:d,logger:o}}a(RBo,"createLoggerContext");var Ufn=RBo({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),kBo=Ufn.logger;function KIe(t){return Ufn.createClientLogger(t)}a(KIe,"createClientLogger");p();function mVe(t){return t.toLowerCase()}a(mVe,"normalizeName");function*PBo(t){for(let e of t.values())yield[e.name,e.value]}a(PBo,"headerIterator");var f6t=class{static{a(this,"HttpHeadersImpl")}constructor(e){if(this._headersMap=new Map,e)for(let r of Object.keys(e))this.set(r,e[r])}set(e,r){this._headersMap.set(mVe(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(mVe(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(mVe(e))}delete(e){this._headersMap.delete(mVe(e))}toJSON(e={}){let r={};if(e.preserveCase)for(let n of this._headersMap.values())r[n.name]=n.value;else for(let[n,o]of this._headersMap)r[n]=o.value;return r}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return PBo(this._headersMap)}};function V1(t){return new f6t(t)}a(V1,"createHttpHeaders");p();p();p();var p6t=class{static{a(this,"PipelineRequestImpl")}constructor(e){var r,n,o,s,c,l,u;this.url=e.url,this.body=e.body,this.headers=(r=e.headers)!==null&&r!==void 0?r:V1(),this.method=(n=e.method)!==null&&n!==void 0?n:"GET",this.timeout=(o=e.timeout)!==null&&o!==void 0?o:0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=(s=e.disableKeepAlive)!==null&&s!==void 0?s:!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=(c=e.withCredentials)!==null&&c!==void 0?c:!1,this.abortSignal=e.abortSignal,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||Mle(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1,this.requestOverrides=e.requestOverrides,this.authSchemes=e.authSchemes}};function gVe(t){return new p6t(t)}a(gVe,"createPipelineRequest");p();var Qfn=new Set(["Deserialize","Serialize","Retry","Sign"]),h6t=class t{static{a(this,"HttpPipeline")}constructor(e){var r;this._policies=[],this._policies=(r=e?.slice(0))!==null&&r!==void 0?r:[],this._orderedPolicies=void 0}addPolicy(e,r={}){if(r.phase&&r.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(r.phase&&!Qfn.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!Qfn.has(r.afterPhase))throw new Error(`Invalid afterPhase name: ${r.afterPhase}`);this._policies.push({policy:e,options:r}),this._orderedPolicies=void 0}removePolicy(e){let r=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(r.push(n.policy),!1):!0),this._orderedPolicies=void 0,r}sendRequest(e,r){return this.getOrderedPolicies().reduceRight((s,c)=>l=>c.sendRequest(l,s),s=>e.sendRequest(s))(r)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],r=new Map;function n(A){return{name:A,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}a(n,"createPhase");let o=n("Serialize"),s=n("None"),c=n("Deserialize"),l=n("Retry"),u=n("Sign"),d=[o,s,c,l,u];function f(A){return A==="Retry"?l:A==="Serialize"?o:A==="Deserialize"?c:A==="Sign"?u:s}a(f,"getPhase");for(let A of this._policies){let y=A.policy,_=A.options,E=y.name;if(r.has(E))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};_.afterPhase&&(v.afterPhase=f(_.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(E,v),f(_.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:_}=A,E=y.name,v=r.get(E);if(!v)throw new Error(`Missing node for policy ${E}`);if(_.afterPolicies)for(let S of _.afterPolicies){let T=r.get(S);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(_.beforePolicies)for(let S of _.beforePolicies){let T=r.get(S);T&&(T.dependsOn.add(v),v.dependants.add(T))}}function h(A){A.hasRun=!0;for(let y of A.policies)if(!(y.afterPhase&&(!y.afterPhase.hasRun||y.afterPhase.policies.size))&&y.dependsOn.size===0){e.push(y.policy);for(let _ of y.dependants)_.dependsOn.delete(y);r.delete(y.policy.name),A.policies.delete(y)}}a(h,"walkPhase");function m(){for(let A of d){if(h(A),A.policies.size>0&&A!==s){s.hasRun||h(s);return}A.hasAfterPolicies&&h(s)}}a(m,"walkPhases");let g=0;for(;r.size>0;){g++;let A=e.length;if(m(),e.length<=A&&g>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function AVe(){return h6t.create()}a(AVe,"createEmptyPipeline");p();p();var qfn=require("node:util"),jfn=qfn.inspect.custom;var DBo=new zP,LA=class t extends Error{static{a(this,"RestError")}constructor(e,r={}){super(e),this.name="RestError",this.code=r.code,this.statusCode=r.statusCode,Object.defineProperty(this,"request",{value:r.request,enumerable:!1}),Object.defineProperty(this,"response",{value:r.response,enumerable:!1}),Object.defineProperty(this,jfn,{value:a(()=>`RestError: ${this.message} - ${DBo.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};LA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";LA.PARSE_ERROR="PARSE_ERROR";function yVe(t){return t instanceof LA?!0:EK(t)&&t.name==="RestError"}a(yVe,"isRestError");p();p();var Fle=fe(require("node:http"),1),Ule=fe(require("node:https"),1),EVe=fe(require("node:zlib"),1),Gfn=require("node:stream");p();var nw=KIe("ts-http-runtime");var NBo={};function JIe(t){return t&&typeof t.pipe=="function"}a(JIe,"isReadableStream");function Hfn(t){return t.readable===!1?Promise.resolve():new Promise(e=>{let r=a(()=>{e(),t.removeListener("close",r),t.removeListener("end",r),t.removeListener("error",r)},"handler");t.on("close",r),t.on("end",r),t.on("error",r)})}a(Hfn,"isStreamComplete");function $fn(t){return t&&typeof t.byteLength=="number"}a($fn,"isArrayBuffer");var _Ve=class extends Gfn.Transform{static{a(this,"ReportTransform")}_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(o){n(o)}}constructor(e){super(),this.loadedBytes=0,this.progressCallback=e}},m6t=class{static{a(this,"NodeHttpClient")}constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(e){var r,n,o;let s=new AbortController,c;if(e.abortSignal){if(e.abortSignal.aborted)throw new IO("The operation was aborted. Request has already been canceled.");c=a(m=>{m.type==="abort"&&s.abort()},"abortListener"),e.abortSignal.addEventListener("abort",c)}let l;e.timeout>0&&(l=setTimeout(()=>{let m=new zP;nw.info(`request to '${m.sanitizeUrl(e.url)}' timed out. canceling...`),s.abort()},e.timeout));let u=e.headers.get("Accept-Encoding"),d=u?.includes("gzip")||u?.includes("deflate"),f=typeof e.body=="function"?e.body():e.body;if(f&&!e.headers.has("Content-Length")){let m=BBo(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let E=e.onUploadProgress,v=new _Ve(E);v.on("error",S=>{nw.error("Error in upload progress",S)}),JIe(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=MBo(m),y={status:(r=m.statusCode)!==null&&r!==void 0?r:0,headers:g,request:e};if(e.method==="HEAD")return m.resume(),y;h=d?OBo(m,g):m;let _=e.onDownloadProgress;if(_){let E=new _Ve(_);E.on("error",v=>{nw.error("Error in download progress",v)}),h.pipe(E),h=E}return!((n=e.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((o=e.streamResponseStatusCodes)===null||o===void 0)&&o.has(y.status)?y.readableStreamBody=h:y.bodyAsText=await LBo(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();JIe(f)&&(m=Hfn(f));let g=Promise.resolve();JIe(h)&&(g=Hfn(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{nw.warning("Error when cleaning up abortListener on httpRequest",A)})}}}makeRequest(e,r,n){var o;let s=new URL(e.url),c=s.protocol!=="https:";if(c&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let l=(o=e.agent)!==null&&o!==void 0?o:this.getOrCreateAgent(e,c),u=Object.assign({agent:l,hostname:s.hostname,path:`${s.pathname}${s.search}`,port:s.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0})},e.requestOverrides);return new Promise((d,f)=>{let h=c?Fle.request(u,d):Ule.request(u,d);h.once("error",m=>{var g;f(new LA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:LA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new IO("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&JIe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):$fn(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(nw.error("Unrecognized body type",n),f(new LA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?Fle.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new Fle.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return Ule.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:NBo,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(nw.info("No cached TLS Agent exist, creating a new Agent"),c=new Ule.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function MBo(t){let e=V1();for(let r of Object.keys(t.headers)){let n=t.headers[r];Array.isArray(n)?n.length>0&&e.set(r,n[0]):n&&e.set(r,n)}return e}a(MBo,"getResponseHeaders");function OBo(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=EVe.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=EVe.createInflate();return t.pipe(n),n}return t}a(OBo,"getDecodedResponseStream");function LBo(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{Buffer.isBuffer(o)?n.push(o):n.push(Buffer.from(o))}),t.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),t.on("error",o=>{o&&o?.name==="AbortError"?r(o):r(new LA(`Error reading response as text: ${o.message}`,{code:LA.PARSE_ERROR}))})})}a(LBo,"streamToText");function BBo(t){return t?Buffer.isBuffer(t)?t.length:JIe(t)?null:$fn(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(BBo,"getBodyLength");function Vfn(){return new m6t}a(Vfn,"createNodeHttpClient");function vVe(){return Vfn()}a(vVe,"createDefaultHttpClient");p();p();p();p();var g6t="logPolicy";function CVe(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:nw.info,n=new zP({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:g6t,async sendRequest(o,s){if(!r.enabled)return s(o);r(`Request: ${n.sanitize(o)}`);let c=await s(o);return r(`Response status code: ${c.status}`),r(`Headers: ${n.sanitize(c.headers)}`),c}}}a(CVe,"logPolicy");p();var A6t="redirectPolicy",Wfn=["GET","HEAD"];function bVe(t={}){let{maxRetries:e=20}=t;return{name:A6t,async sendRequest(r,n){let o=await n(r);return zfn(n,o,e)}}}a(bVe,"redirectPolicy");async function zfn(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&Wfn.includes(o.method)||s===302&&Wfn.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new IO(r?.abortErrorMsg?r?.abortErrorMsg:FBo)),"rejectOnAbort"),u=a(()=>{r?.abortSignal&&c&&r.abortSignal.removeEventListener("abort",c)},"removeListeners");if(c=a(()=>(s&&clearTimeout(s),u(),l()),"onAborted"),r?.abortSignal&&r.abortSignal.aborted)return l();s=setTimeout(()=>{u(),n(e)},t),r?.abortSignal&&r.abortSignal.addEventListener("abort",c)})}a(Jfn,"delay");function Zfn(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Zfn,"parseHeaderValueAsNumber");var _6t="Retry-After",UBo=["retry-after-ms","x-ms-retry-after-ms",_6t];function Xfn(t){if(t&&[429,503].includes(t.status))try{for(let o of UBo){let s=Zfn(t,o);if(s===0||s)return s*(o===_6t?1e3:1)}let e=t.headers.get(_6t);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(Xfn,"getRetryAfterInMs");function epn(t){return Number.isFinite(Xfn(t))}a(epn,"isThrottlingRetryResponse");function E6t(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=Xfn(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(E6t,"throttlingRetryStrategy");var QBo=1e3,qBo=1e3*64;function TVe(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:QBo,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:qBo;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=HBo(l),d=u&&t.ignoreSystemErrors,f=jBo(c),h=f&&t.ignoreHttpStatusCodes;return c&&(epn(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:WIe(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(TVe,"exponentialRetryStrategy");function jBo(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(jBo,"isExponentialRetryResponse");function HBo(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(HBo,"isSystemError");p();var GBo=KIe("ts-http-runtime retryPolicy"),$Bo="retryPolicy";function QQ(t,e={maxRetries:3}){let r=e.logger||GBo;return{name:$Bo,async sendRequest(n,o){var s,c;let l,u,d=-1;e:for(;;){d+=1,l=void 0,u=void 0;try{r.info(`Retry ${d}: Attempting to send request`,n.requestId),l=await o(n),r.info(`Retry ${d}: Received a response from request`,n.requestId)}catch(f){if(r.error(`Retry ${d}: Received an error from request`,n.requestId),u=f,!f||u.name!=="RestError")throw f;l=u.response}if(!((s=n.abortSignal)===null||s===void 0)&&s.aborted)throw r.error(`Retry ${d}: Request aborted.`),new IO;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:3)){if(r.info(`Retry ${d}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),u)throw u;if(l)return l;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${d}: Processing ${t.length} retry strategies.`);t:for(let f of t){let h=f.logger||r;h.info(`Retry ${d}: Processing retry strategy ${f.name}.`);let m=f.retry({retryCount:d,response:l,responseError:u});if(m.skipStrategy){h.info(`Retry ${d}: Skipped.`);continue t}let{errorToThrow:g,retryAfterInMs:A,redirectTo:y}=m;if(g)throw h.error(`Retry ${d}: Retry strategy ${f.name} throws error:`,g),g;if(A||A===0){h.info(`Retry ${d}: Retry strategy ${f.name} retries after ${A}`),await Jfn(A,void 0,{abortSignal:n.abortSignal});continue e}if(y){h.info(`Retry ${d}: Retry strategy ${f.name} redirects to ${y}`),n.url=y;continue e}}if(u)throw r.info("None of the retry strategies could work with the received error. Throwing it."),u;if(l)return r.info("None of the retry strategies could work with the received response. Returning it."),l}}}}a(QQ,"retryPolicy");var v6t="defaultRetryPolicy";function IVe(t={}){var e;return{name:v6t,sendRequest:QQ([E6t(),TVe(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(IVe,"defaultRetryPolicy");p();var C6t="formDataPolicy";function VBo(t){var e;let r={};for(let[n,o]of t.entries())(e=r[n])!==null&&e!==void 0||(r[n]=[]),r[n].push(o);return r}a(VBo,"formDataToFormDataMap");function xVe(){return{name:C6t,async sendRequest(t,e){if(UQ&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=VBo(t.body),t.body=void 0),t.formData){let r=t.headers.get("Content-Type");r&&r.indexOf("application/x-www-form-urlencoded")!==-1?t.body=WBo(t.formData):await zBo(t.formData,t),t.formData=void 0}return e(t)}}}a(xVe,"formDataPolicy");function WBo(t){let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.append(r,o.toString());else e.append(r,n.toString());return e.toString()}a(WBo,"wwwFormUrlEncode");async function zBo(t,e){let r=e.headers.get("Content-Type");if(r&&!r.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",r??"multipart/form-data");let n=[];for(let[o,s]of Object.entries(t))for(let c of Array.isArray(s)?s:[s])if(typeof c=="string")n.push({headers:V1({"Content-Disposition":`form-data; name="${o}"`}),body:VC(c,"utf-8")});else{if(c==null||typeof c!="object")throw new Error(`Unexpected value for key ${o}: ${c}. Value should be serialized to string first.`);{let l=c.name||"blob",u=V1();u.set("Content-Disposition",`form-data; name="${o}"; filename="${l}"`),u.set("Content-Type",c.type||"application/octet-stream"),n.push({headers:u,body:c})}}e.multipartBody={parts:n}}a(zBo,"prepareFormData");p();var Tpn=fe(k6t(),1),Ipn=fe(P6t(),1);var j3o="HTTPS_PROXY",H3o="HTTP_PROXY",G3o="ALL_PROXY",$3o="NO_PROXY",D6t="proxyPolicy",Cpn=[],xpn=!1,V3o=new Map;function OVe(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(OVe,"getEnvironmentValue");function W3o(){if(!process)return;let t=OVe(j3o),e=OVe(G3o),r=OVe(H3o);return t||e||r}a(W3o,"loadEnvironmentProxyValue");function z3o(t,e,r){if(e.length===0)return!1;let n=new URL(t).hostname;if(r?.has(n))return r.get(n);let o=!1;for(let s of e)s[0]==="."?(n.endsWith(s)||n.length===s.length-1&&n===s.slice(1))&&(o=!0):n===s&&(o=!0);return r?.set(n,o),o}a(z3o,"isBypassed");function Y3o(){let t=OVe($3o);return xpn=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(Y3o,"loadNoProxy");function K3o(){let t=W3o();return t?new URL(t):void 0}a(K3o,"getDefaultProxySettingsInternal");function bpn(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}a(bpn,"getUrlFromProxySettings");function Spn(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&nw.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let s=t.headers.toJSON();o?(e.httpProxyAgent||(e.httpProxyAgent=new Ipn.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new Tpn.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(Spn,"setProxyAgentOnRequest");function LVe(t,e){xpn||Cpn.push(...Y3o());let r=t?bpn(t):K3o(),n={};return{name:D6t,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!z3o(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:Cpn,e?.customNoProxyList?void 0:V3o)?Spn(o,n,r):o.proxySettings&&Spn(o,n,bpn(o.proxySettings)),s(o)}}}a(LVe,"proxyPolicy");p();var N6t="agentPolicy";function BVe(t){return{name:N6t,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(BVe,"agentPolicy");p();var M6t="tlsPolicy";function FVe(t){return{name:M6t,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(FVe,"tlsPolicy");p();p();function UVe(t){return typeof t.stream=="function"}a(UVe,"isBlob");p();Y3();var GVe=require("stream");function Xpn(){return XIe(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield Y1(e.read());if(r)return yield Y1(void 0);yield yield Y1(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(Xpn,"streamAsyncIterator");function eFo(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=Xpn.bind(t)),t.values||(t.values=Xpn.bind(t))}a(eFo,"makeAsyncIterable");function ehn(t){return t instanceof ReadableStream?(eFo(t),GVe.Readable.fromWeb(t)):t}a(ehn,"ensureNodeStream");function tFo(t){return t instanceof Uint8Array?GVe.Readable.from(Buffer.from(t)):UVe(t)?ehn(t.stream()):ehn(t)}a(tFo,"toStream");async function thn(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(tFo);return GVe.Readable.from((function(){return XIe(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,HVe(d)),u;u=yield Y1(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield Y1(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield Y1(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(thn,"concat");function rFo(){return`----AzSDKFormBoundary${Mle()}`}a(rFo,"generateBoundary");function nFo(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(nFo,"encodeHeaders");function iFo(t){return t instanceof Uint8Array?t.byteLength:UVe(t)?t.size===-1?void 0:t.size:void 0}a(iFo,"getLength");function oFo(t){let e=0;for(let r of t){let n=iFo(r);if(n===void 0)return;e+=n}return e}a(oFo,"getTotalLength");async function sFo(t,e,r){let n=[VC(`--${r}`,"utf-8"),...e.flatMap(s=>[VC(`\r -`,"utf-8"),VC(nFo(s.headers),"utf-8"),VC(`\r +Error Description: '${s.message}'`,this.correlationId)}return null}return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),this.logger.verbose("Creating custom Authority for custom domain scenario.",this.correlationId),n=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),n}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(r=>r&&Ds.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==H3.None){let o=r.tenant?r.tenant:HTe;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return wBt;if(this.discoveryComplete())return this.metadata.preferred_cache;throw Nt(GP)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return OFt.has(e)}static isPublicCloudAuthority(e){return FBt.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new Ds(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${BBt}`);let l=Ds.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:c}).urlString;return n?`${l}?${n}`:l}static replaceWithRegionalInformation(e,r){let n={...e};return n.authorization_endpoint=t.buildRegionalAuthorityString(n.authorization_endpoint,r),n.token_endpoint=t.buildRegionalAuthorityString(n.token_endpoint,r),n.end_session_endpoint&&(n.end_session_endpoint=t.buildRegionalAuthorityString(n.end_session_endpoint,r)),n}static transformCIAMAuthority(e){let r=e,o=new Ds(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(TGe)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${DBt}`}return r}};$P.reservedTenantDomains=new Set(["{tenant}","{tenantid}",jP.COMMON,jP.CONSUMERS,jP.ORGANIZATIONS]);function icn(t){let n=new Ds(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case jP.COMMON:case jP.ORGANIZATIONS:case jP.CONSUMERS:return;default:return n}}a(icn,"getTenantFromAuthorityString");function c$e(t){return t.endsWith(Yce)?t:`${t}${Yce}`}a(c$e,"formatAuthorityUri");function JFt(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw Dl(HGe)}return{canonicalAuthority:t.authority?c$e(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(JFt,"buildStaticAuthorityOptions");async function ZFt(t,e,r,n,o,s,c){let l=$P.transformCIAMAuthority(c$e(t)),u=new $P(l,e,r,n,o,s,c);try{return await ra(u.resolveEndpointsAsync.bind(u),jan,o,c,s)(),u}catch{throw Nt(GP)}}a(ZFt,"createDiscoveredInstance");var IIe=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=$3(e),this.logger=new gg(this.config.loggerOptions,kQ,_O),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async acquireToken(e,r,n){if(!e.code)throw Nt(uFt);n&&n.cloud_instance_host_name&&await ra(this.updateTokenEndpointAuthority.bind(this),qan,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=q1(),s=await ra(this.executeTokenRequest.bind(this),Uan,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[eh.X_MS_REQUEST_ID],l=new rh(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return l.validateTokenResponse(s.body,e.correlationId),ra(l.handleServerTokenResponse.bind(l),n$e,this.logger,this.performanceClient,e.correlationId)(s.body,this.authority,o,e,r,n,void 0,void 0,void 0,c)}getLogoutUri(e){if(!e)throw Dl(J3t);let r=this.createLogoutUrlQueryString(e);return Ds.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=bIe(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=Ds.appendQueryString(e.tokenEndpoint,o),c=await ra(this.createTokenRequestBody.bind(this),Qan,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=cle(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${Zce}${f.utid}`,type:WE.HOME_ACCOUNT_ID}}catch(f){this.logger.verbose(`Could not parse client info for CCS Header: '${f}'`,r.correlationId)}let u=CIe(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=ple(this.config.authOptions.clientId,r);return ra(SIe,Man,this.logger,this.performanceClient,r.correlationId)(s,c,u,d,r.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,n)}async createTokenRequestBody(e){let r=new Map;if(oK(r,e.embeddedClientId||e.extraParameters?.[AO]||this.config.authOptions.clientId),this.includeRedirectUri)sK(r,e.redirectUri);else if(!e.redirectUri)throw Dl(V3t);if(iK(r,e.scopes,!0,this.oidcDefaultScopes),pIe(r,e.resource),xFt(r,e.code),tIe(r,this.config.libraryInfo),rIe(r,this.config.telemetry.application),fIe(r),this.serverTelemetryManager&&!ZGe(this.config)&&dIe(r,this.serverTelemetryManager),e.codeVerifier&&RFt(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&iIe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;oIe(r,await zE(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),sIe(r,o.assertionType)}if(aIe(r,VTe.AUTHORIZATION_CODE_GRANT),lK(r),e.authenticationScheme===Tf.POP){let o=new DQ(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await ra(o.generateCnf.bind(o),fle,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,lIe(r,s)}else if(e.authenticationScheme===Tf.SSH)if(e.sshJwk)uIe(r,e.sshJwk);else throw Dl(JTe);(!Su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&aK(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=cle(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${Zce}${o.utid}`,type:WE.HOME_ACCOUNT_ID}}catch(o){this.logger.verbose(`Could not parse client info for CCS Header: '${o}'`,e.correlationId)}else n=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&n)switch(n.type){case WE.HOME_ACCOUNT_ID:try{let o=EO(n.credential);Q3(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case WE.UPN:RQ(r,n.credential);break}return e.embeddedClientId&&j3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&q3(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[UGe])&&q3(r,{[UGe]:"1"}),nK(r,e.correlationId,this.performanceClient),yO(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&CFt(r,e.postLogoutRedirectUri),e.correlationId&&cK(r,e.correlationId),e.idTokenHint&&bFt(r,e.idTokenHint),e.state&&nIe(r,e.state),e.logoutHint&&PFt(r,e.logoutHint),e.extraQueryParameters&&q3(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&cIe(r),yO(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await ZFt(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var gDo=300,hK=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=$3(e),this.logger=new gg(this.config.loggerOptions,kQ,_O),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}async acquireToken(e,r){let n=q1(),o=await ra(this.executeTokenRequest.bind(this),Oan,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[eh.X_MS_REQUEST_ID],c=new rh(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(o.body,e.correlationId),ra(c.handleServerTokenResponse.bind(c),n$e,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,n,e,r,void 0,void 0,!0,e.forceCache,s)}async acquireTokenByRefreshToken(e,r){if(!e)throw Dl(K3t);if(!e.account)throw Nt(XTe);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await ra(this.acquireTokenWithCachedRefreshToken.bind(this),r$e,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof j1&&o.errorCode===i$e,c=o instanceof VE&&o.errorCode===n3t&&o.subError===i3t;if(s||c)return ra(this.acquireTokenWithCachedRefreshToken.bind(this),r$e,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return ra(this.acquireTokenWithCachedRefreshToken.bind(this),r$e,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=Kan(this.cacheManager.getRefreshToken.bind(this.cacheManager),Yan,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw a$e(i$e);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||gDo;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),ule(o.expiresOn,c))throw a$e(GFt)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||Tf.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:WE.HOME_ACCOUNT_ID}};try{return await ra(this.acquireToken.bind(this),Lan,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof j1&&c.subError===EIe){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache",e.correlationId);let l=this.cacheManager.generateCredentialKey(o);this.cacheManager.removeRefreshToken(l,e.correlationId)}throw c}}async executeTokenRequest(e,r){let n=bIe(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=Ds.appendQueryString(r.tokenEndpoint,n),s=await ra(this.createTokenRequestBody.bind(this),Ban,this.logger,this.performanceClient,e.correlationId)(e),c=CIe(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=ple(this.config.authOptions.clientId,e);return ra(SIe,Nan,this.logger,this.performanceClient,e.correlationId)(o,s,c,l,e.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,this.serverTelemetryManager)}async createTokenRequestBody(e){let r=new Map;if(oK(r,e.embeddedClientId||e.extraParameters?.[AO]||this.config.authOptions.clientId),e.redirectUri&&sK(r,e.redirectUri),iK(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),aIe(r,VTe.REFRESH_TOKEN_GRANT),lK(r),tIe(r,this.config.libraryInfo),rIe(r,this.config.telemetry.application),fIe(r),this.serverTelemetryManager&&!ZGe(this.config)&&dIe(r,this.serverTelemetryManager),wFt(r,e.refreshToken),this.config.clientCredentials.clientSecret&&iIe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;oIe(r,await zE(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),sIe(r,n.assertionType)}if(e.authenticationScheme===Tf.POP){let n=new DQ(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await ra(n.generateCnf.bind(n),fle,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,lIe(r,o)}else if(e.authenticationScheme===Tf.SSH)if(e.sshJwk)uIe(r,e.sshJwk);else throw Dl(JTe);if((!Su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&aK(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case WE.HOME_ACCOUNT_ID:try{let n=EO(e.ccsCredential.credential);Q3(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case WE.UPN:RQ(r,e.ccsCredential.credential);break}return e.embeddedClientId&&j3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&q3(r,{...e.extraParameters}),nK(r,e.correlationId,this.performanceClient),yO(r)}};p();var xIe=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=$3(e),this.logger=new gg(this.config.loggerOptions,kQ,_O),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}async acquireCachedToken(e){let r=HP.NOT_APPLICABLE;if(e.forceRefresh||!Su.isEmptyObj(e.claims))throw this.setCacheOutcome(HP.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Nt(ole);if(!e.account)throw Nt(XTe);let n=e.account.tenantId||icn(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(FFt(s.cachedAt)||ule(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(HP.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Nt(ole);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(HP.NO_CACHED_ACCESS_TOKEN,e.correlationId),Nt(ole)}else s.refreshOn&&ule(s.refreshOn,0)&&(r=HP.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(HP.NO_CACHED_ACCESS_TOKEN,e.correlationId),Nt(ole);let c=e.authority||this.authority.getPreferredCache(),l={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,n),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c,e.correlationId)};return this.setCacheOutcome(r,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await ra(this.generateResultFromCacheRecord.bind(this),Fan,this.logger,this.performanceClient,e.correlationId)(l,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==HP.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: '${e}'`,r)}async generateResultFromCacheRecord(e,r){let n;if(e.idToken&&(n=G3(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw Nt(ZTe);hIe(o,r.maxAge)}return rh.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var wIe={};Ti(wIe,{getAuthorizationCodePayload:()=>_Do,getAuthorizeUrl:()=>yDo,getStandardAuthorizeRequestParameters:()=>ADo,validateAuthorizationResponse:()=>ocn});p();function ADo(t,e,r,n){let o=e.correlationId,s=new Map;oK(s,e.embeddedClientId||e.extraQueryParameters?.[AO]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(iK(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),pIe(s,e.resource),sK(s,e.redirectUri),cK(s,o),vFt(s,e.responseMode),lK(s),kFt(s),e.prompt&&(TFt(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(SFt(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==$Te.SELECT_ACCOUNT)if(e.sid&&e.prompt===$Te.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),zGe(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=vDo(e.account),u=CDo(e.account);if(u&&e.domainHint&&(r.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint',e.correlationId),u=null),u){r.verbose("createAuthCodeUrlQueryString: login_hint claim present on account",e.correlationId),sle(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=EO(e.account.homeAccountId);Q3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===$Te.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),zGe(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=EO(e.account.homeAccountId);Q3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(e.loginHint)r.verbose("createAuthCodeUrlQueryString: Adding login_hint from request",e.correlationId),sle(s,e.loginHint),RQ(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),sle(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=EO(e.account.homeAccountId);Q3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}}else e.loginHint&&(r.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request",e.correlationId),sle(s,e.loginHint),RQ(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&IFt(s,e.nonce),e.state&&nIe(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&aK(s,e.claims,t.clientCapabilities),e.embeddedClientId&&j3(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(tle))&&cIe(s),s}a(ADo,"getStandardAuthorizeRequestParameters");function yDo(t,e){let r=yO(e);return Ds.appendQueryString(t.authorizationEndpoint,r)}a(yDo,"getAuthorizeUrl");function _Do(t,e){if(ocn(t,e),!t.code)throw Nt(gFt);return t}a(_Do,"getAuthorizationCodePayload");function ocn(t,e){if(!t.state||!e)throw t.state?Nt(VGe,"Cached State"):Nt(VGe,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw Nt(rK,t.state)}try{n=decodeURIComponent(e)}catch{throw Nt(rK,t.state)}if(r!==n)throw Nt(sFt);if(t.error||t.error_description||t.suberror){let o=EDo(t);throw s$e(t.error,t.error_description,t.suberror)?new j1(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new VE(t.error||"",t.error_description,t.suberror,o)}}a(ocn,"validateAuthorizationResponse");function EDo(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(EDo,"parseServerErrorNo");function vDo(t){return t.idTokenClaims?.sid||null}a(vDo,"extractAccountSid");function CDo(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(CDo,"extractLoginHint");p();function mK(t,e){if(t){if(e.resource&&(scn(e.extraParameters)||scn(e.extraQueryParameters)))throw Nt(EFt);if(!e.resource)throw Nt(_Ft)}}a(mK,"enforceResourceParameter");function scn(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(scn,"containsResourceParam");var mle={};Ti(mle,{postRequestFailed:()=>SDo,unexpectedError:()=>bDo});p();var bDo="unexpected_error",SDo="post_request_failed";p();var acn=",",ccn="|";function TDo(t){let{skus:e,libraryName:r,libraryVersion:n,extensionName:o,extensionVersion:s}=t,c=new Map([[0,[r,n]],[2,[o,s]]]),l=[];if(e?.length){if(l=e.split(acn),l.length<4)return e}else l=Array.from({length:4},()=>ccn);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&IDo({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(acn)}a(TDo,"makeExtraSkuString");function IDo(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(ccn))}a(IDo,"setSku");var gK=class t{static{a(this,"ServerTelemetryManager")}constructor(e,r){this.cacheOutcome=HP.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=WTe+ZY+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${IQ}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(IQ),s=this.getRegionDiscoveryFields(),c=[e,s].join(IQ);return[NGe,c,o].join(MGe)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(IQ),o=e.errors.slice(0,r).join(IQ),s=e.errors.length,c=r=KBt&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof jo?e.subError?r.errors.push(e.subError):e.errorCode?r.errors.push(e.errorCode):r.errors.push(e.toString()):r.errors.push(e.toString()):r.errors.push(XBt),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r,this.correlationId)}incrementCacheHits(){let e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){let e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey,this.correlationId)||e}clearTelemetryCache(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.errors.length;if(r===n)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{let o={failedRequests:e.failedRequests.slice(r*2),errors:e.errors.slice(r),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let r,n=0,o=0,s=e.errors.length;for(r=0;rJSON.parse(l)),lastUpdatedAt:Date.now().toString()},c={};PQ.toObject(c,s),r[n]=c}),r}static deserializeIdTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAccessTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,target:o.target,cachedAt:o.cached_at,expiresOn:o.expires_on,extendedExpiresOn:o.extended_expires_on,refreshOn:o.refresh_on,keyId:o.key_id,tokenType:o.token_type,userAssertionHash:o.userAssertionHash,resource:o.resource,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeRefreshTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,familyId:o.family_id,target:o.target,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAppMetadata(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n];r[n]={clientId:o.client_id,environment:o.environment,familyId:o.family_id}}),r}static deserializeAllCache(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}}};p();p();var lcn="system_assigned_managed_identity",xDo="managed_identity",e8t=`https://login.microsoftonline.com/${xDo}/`,GC={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},nm={API_VERSION:"api-version",RESOURCE:"resource",SHA256_TOKEN_TO_REFRESH:"token_sha256_to_refresh",XMS_CC:"xms_cc"},Zi={AZURE_POD_IDENTITY_AUTHORITY_HOST:"AZURE_POD_IDENTITY_AUTHORITY_HOST",DEFAULT_IDENTITY_CLIENT_ID:"DEFAULT_IDENTITY_CLIENT_ID",IDENTITY_ENDPOINT:"IDENTITY_ENDPOINT",IDENTITY_HEADER:"IDENTITY_HEADER",IDENTITY_SERVER_THUMBPRINT:"IDENTITY_SERVER_THUMBPRINT",IMDS_ENDPOINT:"IMDS_ENDPOINT",MSI_ENDPOINT:"MSI_ENDPOINT",MSI_SECRET:"MSI_SECRET"},ao={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},xf={SYSTEM_ASSIGNED:"system-assigned",USER_ASSIGNED_CLIENT_ID:"user-assigned-client-id",USER_ASSIGNED_RESOURCE_ID:"user-assigned-resource-id",USER_ASSIGNED_OBJECT_ID:"user-assigned-object-id"},sp={GET:"GET",POST:"POST"},ucn="REGION_NAME",dcn="MSAL_FORCE_REGION",fcn=32,pcn={SHA256:"sha256"},u$e={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},t8t={KEY_SEPARATOR:"-"},Zx={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},wf={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByOBO:772,acquireTokenWithManagedIdentity:773,acquireTokenByCode:871,acquireTokenByRefreshToken:872},Xx={RSA_256:"RS256",PSS_256:"PS256",X5T_256:"x5t#S256",X5T:"x5t",X5C:"x5c",AUDIENCE:"aud",EXPIRATION_TIME:"exp",ISSUER:"iss",SUBJECT:"sub",NOT_BEFORE:"nbf",JWT_ID:"jti"},d$e={INTERVAL_MS:100,TIMEOUT_MS:5e3},hcn=4096;p();p();p();var gle=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,sp.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,sp.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:RDo(n),signal:s.signal};r===sp.POST&&(l.body=n?.body||"");let u;try{u=await fetch(e,l)}catch(d){if(c&&clearTimeout(c),d instanceof Error&&d.name==="AbortError")throw tK(th.networkError,"Request timeout");let f=tK(th.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw KFt(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:wDo(u.headers),body:await u.json(),status:u.status}}catch(d){throw tK(th.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function wDo(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(wDo,"getHeaderDict");function RDo(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(RDo,"getFetchHeaders");p();p();p();var f$e="invalid_file_extension",p$e="invalid_file_path",NQ="invalid_managed_identity_id_type",h$e="invalid_secret",mcn="missing_client_id",gcn="network_unavailable",m$e="platform_not_supported",g$e="unable_to_create_azure_arc",A$e="unable_to_create_cloud_shell",y$e="unable_to_create_source",RIe="unable_to_read_secret_file",Acn="user_assigned_not_available_at_runtime",_$e="www_authenticate_header_missing",E$e="www_authenticate_header_unsupported_format",AK={[Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]:"azure_pod_identity_authority_host_url_malformed",[Zi.IDENTITY_ENDPOINT]:"identity_endpoint_url_malformed",[Zi.IMDS_ENDPOINT]:"imds_endpoint_url_malformed",[Zi.MSI_ENDPOINT]:"msi_endpoint_url_malformed"};var kDo={[f$e]:"The file path in the WWW-Authenticate header does not contain a .key file.",[p$e]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[NQ]:"More than one ManagedIdentityIdType was provided.",[h$e]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[m$e]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[mcn]:"A ManagedIdentityId id was not provided.",[AK.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[AK.IDENTITY_ENDPOINT]:`The Managed Identity's '${Zi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[AK.IMDS_ENDPOINT]:`The Managed Identity's '${Zi.IMDS_ENDPOINT}' environment variable is malformed.`,[AK.MSI_ENDPOINT]:`The Managed Identity's '${Zi.MSI_ENDPOINT}' environment variable is malformed.`,[gcn]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[g$e]:"Azure Arc Managed Identities can only be system assigned.",[A$e]:"Cloud Shell Managed Identities can only be system assigned.",[y$e]:"Unable to create a Managed Identity source based on environment variables.",[RIe]:"Unable to read the secret file.",[Acn]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[_$e]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[E$e]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},r8t=class t extends jo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,kDo[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function nh(t){return new r8t(t)}a(nh,"createManagedIdentityError");var v$e=class{static{a(this,"ManagedIdentityId")}get id(){return this._id}set id(e){this._id=e}get idType(){return this._idType}set idType(e){this._idType=e}constructor(e){let r=e?.userAssignedClientId,n=e?.userAssignedResourceId,o=e?.userAssignedObjectId;if(r){if(n||o)throw nh(NQ);this.id=r,this.idType=xf.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw nh(NQ);this.id=n,this.idType=xf.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw nh(NQ);this.id=o,this.idType=xf.USER_ASSIGNED_OBJECT_ID}else this.id=lcn,this.idType=xf.SYSTEM_ASSIGNED}};p();var im={invalidLoopbackAddressType:{code:"invalid_loopback_server_address_type",desc:"Loopback server address is not type string. This is unexpected."},unableToLoadRedirectUri:{code:"unable_to_load_redirectUrl",desc:"Loopback server callback was invoked without a url. This is unexpected."},noAuthCodeInResponse:{code:"no_auth_code_in_response",desc:"No auth code found in the server response. Please check your network trace to determine what happened."},noLoopbackServerExists:{code:"no_loopback_server_exists",desc:"No loopback server exists yet."},loopbackServerAlreadyExists:{code:"loopback_server_already_exists",desc:"Loopback server already exists. Cannot create another."},loopbackServerTimeout:{code:"loopback_server_timeout",desc:"Timed out waiting for auth code listener to be registered."},stateNotFoundError:{code:"state_not_found",desc:"State not found. Please verify that the request originated from msal."},thumbprintMissing:{code:"thumbprint_missing_from_client_certificate",desc:"Client certificate does not contain a SHA-1 or SHA-256 thumbprint."},redirectUriNotSupported:{code:"redirect_uri_not_supported",desc:"RedirectUri is not supported in this scenario. Please remove redirectUri from the request."}},g_=class t extends jo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(im.invalidLoopbackAddressType.code,`${im.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(im.unableToLoadRedirectUri.code,`${im.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(im.noAuthCodeInResponse.code,`${im.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(im.noLoopbackServerExists.code,`${im.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(im.loopbackServerAlreadyExists.code,`${im.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(im.loopbackServerTimeout.code,`${im.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(im.stateNotFoundError.code,im.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(im.thumbprintMissing.code,im.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(im.redirectUriNotSupported.code,im.redirectUriNotSupported.desc)}};var PDo={clientId:"",authority:rr.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:H3.None,tenant:""},isMcp:!1},n8t={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:If.Info},DDo={loggerOptions:n8t,networkClient:new gle,disableInternalRetries:!1,protocolMode:m_.AAD},NDo={application:{appName:"",appVersion:""}};function ycn({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...DDo,networkClient:new gle,loggerOptions:n?.loggerOptions||n8t,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw g_.createStateNotFoundError();return{auth:{...PDo,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...NDo,...o}}}a(ycn,"buildAppConfiguration");function _cn({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new v$e(e),o=r?.loggerOptions||n8t,s;return r?.networkClient?s=r.networkClient:s=new gle,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(_cn,"buildManagedIdentityConfiguration");p();p();Fo();var Ale=class{static{a(this,"GuidGenerator")}generateGuid(){return Dt()}isGuid(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}};p();var H1=class t{static{a(this,"EncodingUtils")}static base64Encode(e,r){return Buffer.from(e,r).toString(rr.EncodingTypes.BASE64)}static base64EncodeUrl(e,r){return t.base64Encode(e,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,rr.EncodingTypes.BASE64).toString("utf8")}static base64DecodeUrl(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");for(;r.length%4;)r+="=";return t.base64Decode(r)}};p();p();var Ecn=fe(require("crypto"),1);var MQ=class{static{a(this,"HashUtils")}sha256(e){return Ecn.default.createHash(pcn.SHA256).update(e).digest()}};var vcn=fe(require("crypto"),1);var C$e=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new MQ}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%u$e.CV_CHARSET.length;for(;e.length<=fcn;){let o=vcn.default.randomBytes(1)[0];if(o>=r)continue;let s=o%u$e.CV_CHARSET.length;e.push(u$e.CV_CHARSET[s])}let n=e.join("");return H1.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return H1.base64EncodeUrl(this.hashUtils.sha256(e).toString(rr.EncodingTypes.BASE64),rr.EncodingTypes.BASE64)}};var vO=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new C$e,this.guidGenerator=new Ale,this.hashUtils=new MQ}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return H1.base64Encode(e)}base64Decode(e){return H1.base64Decode(e)}generatePkceCodes(){return this.pkceGenerator.generatePkceCodes()}getPublicKeyThumbprint(){throw new Error("Method not implemented.")}removeTokenBindingKey(){throw new Error("Method not implemented.")}clearKeystore(){throw new Error("Method not implemented.")}signJwt(){throw new Error("Method not implemented.")}async hashString(e){return H1.base64EncodeUrl(this.hashUtils.sha256(e).toString(rr.EncodingTypes.BASE64),rr.EncodingTypes.BASE64)}};p();p();function Ccn(t){let e=t.credentialType===rr.CredentialType.REFRESH_TOKEN&&t.familyId||t.clientId,r=t.tokenType&&t.tokenType.toLowerCase()!==rr.AuthenticationScheme.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",r].join(t8t.KEY_SEPARATOR).toLowerCase()}a(Ccn,"generateCredentialKey");function bcn(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(t8t.KEY_SEPARATOR).toLowerCase()}a(bcn,"generateAccountKey");var OQ=class extends PQ{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new rm,o),this.cache={},this.changeEmitters=[],this.logger=e}registerChangeEmitter(e){this.changeEmitters.push(e)}emitChange(){this.changeEmitters.forEach(e=>e.call(null))}cacheToInMemoryCache(e){let r={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(let n in e){let o=e[n];if(typeof o=="object")if(fK.isAccountEntity(o))r.accounts[n]=o;else if($E.isIdTokenEntity(o))r.idTokens[n]=o;else if($E.isAccessTokenEntity(o))r.accessTokens[n]=o;else if($E.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if($E.isAppMetadataEntity(n,o))r.appMetadata[n]=o;else continue}return r}inMemoryCacheToCache(e){let r=this.getCache();return r={...r,...e.accounts,...e.idTokens,...e.accessTokens,...e.refreshTokens,...e.appMetadata},r}getInMemoryCache(){return this.logger.trace("Getting in-memory cache",""),this.cacheToInMemoryCache(this.getCache())}setInMemoryCache(e){this.logger.trace("Setting in-memory cache","");let r=this.inMemoryCacheToCache(e);this.setCache(r),this.emitChange()}getCache(){return this.logger.trace("Getting cache key-value store",""),this.cache}setCache(e){this.logger.trace("Setting cache key value store",""),this.cache=e,this.emitChange()}getItem(e){return this.logger.tracePii(`Item key: ${e}`,""),this.getCache()[e]}setItem(e,r){this.logger.tracePii(`Item key: ${e}`,"");let n=this.getCache();n[e]=r,this.setCache(n)}generateCredentialKey(e){return Ccn(e)}generateAccountKey(e){return bcn(e)}getAccountKeys(){let e=this.getInMemoryCache();return Object.keys(e.accounts)}getTokenKeys(){let e=this.getInMemoryCache();return{idToken:Object.keys(e.idTokens),accessToken:Object.keys(e.accessTokens),refreshToken:Object.keys(e.refreshTokens)}}getAccount(e){let r=this.getItem(e);return r&&typeof r=="object"?{...r}:null}async setAccount(e){let r=this.generateAccountKey(fK.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return $E.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return $E.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return $E.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return $E.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=$E.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&$E.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&$E.isAuthorityMetadataEntity(e,r)?r:null}getAuthorityMetadataKeys(){return this.getKeys().filter(e=>this.isAuthorityMetadata(e))}setAuthorityMetadata(e,r){this.setItem(e,r)}getThrottlingCache(e){let r=this.getItem(e);return r&&$E.isThrottlingEntity(e,r)?r:null}setThrottlingCache(e,r){this.setItem(e,r)}removeItem(e){this.logger.tracePii(`Item key: ${e}`,"");let r=!1,n=this.getCache();return n[e]&&(delete n[e],r=!0),r&&(this.setCache(n),this.emitChange()),r}removeOutdatedAccount(e){this.removeItem(e)}containsKey(e){return this.getKeys().includes(e)}getKeys(){this.logger.trace("Retrieving all cache keys","");let e=this.getCache();return[...Object.keys(e)]}clear(){this.logger.trace("Clearing cache entries created by MSAL",""),this.getKeys().forEach(r=>{this.removeItem(r)}),this.emitChange()}static generateInMemoryCache(e){return V3.deserializeAllCache(V3.deserializeJSONBlob(e))}static generateJsonCache(e){return TQ.serializeAllCache(e)}updateCredentialCacheKey(e,r){let n=this.generateCredentialKey(r);if(e!==n){let o=this.getItem(e);if(o)return this.removeItem(e),this.setItem(n,o),this.logger.verbose(`Updated an outdated ${r.credentialType} cache key`,""),n;this.logger.error(`Attempted to update an outdated ${r.credentialType} cache key but no item matching the outdated key was found in storage`,"")}return e}};p();var kIe={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},yle=class{static{a(this,"TokenCache")}constructor(e,r,n){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),n&&(this.persistence=n),this.logger=r}hasChanged(){return this.cacheHasChanged}serialize(){this.logger.trace("Serializing in-memory cache","");let e=TQ.serializeAllCache(this.storage.getInMemoryCache());return this.cacheSnapshot?(this.logger.trace("Reading cache snapshot from disk",""),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)):this.logger.trace("No cache snapshot to merge",""),this.cacheHasChanged=!1,JSON.stringify(e)}deserialize(e){if(this.logger.trace("Deserializing JSON to in-memory cache",""),this.cacheSnapshot=e,this.cacheSnapshot){this.logger.trace("Reading cache snapshot from disk","");let r=V3.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(r)}else this.logger.trace("No cache snapshot to deserialize","")}getKVStore(){return this.storage.getCache()}getCacheSnapshot(){let e=OQ.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new vO().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new Q1(this,!1),await this.persistence.beforeCacheAccess(r)),this.storage.getAllAccounts({},e)}finally{this.persistence&&r&&await this.persistence.afterCacheAccess(r)}}async getAccountByHomeId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(n=>n.homeAccountId===e)[0]||null}async getAccountByLocalId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(n=>n.localAccountId===e)[0]||null}async removeAccount(e,r){this.logger.trace("removeAccount called",r||"");let n;try{this.persistence&&(n=new Q1(this,!0),await this.persistence.beforeCacheAccess(n)),this.storage.removeAccount(e,r||new Ale().generateGuid())}finally{this.persistence&&n&&await this.persistence.afterCacheAccess(n)}}async overwriteCache(){if(!this.persistence){this.logger.info("No persistence layer specified, cache cannot be overwritten","");return}this.logger.info("Overwriting in-memory cache with persistent cache",""),this.storage.clear();let e=new Q1(this,!1);await this.persistence.beforeCacheAccess(e);let r=this.getCacheSnapshot();this.storage.setCache(r),await this.persistence.afterCacheAccess(e)}handleChangeEvent(){this.cacheHasChanged=!0}mergeState(e,r){this.logger.trace("Merging in-memory cache with cache snapshot","");let n=this.mergeRemovals(e,r);return this.mergeUpdates(n,r)}mergeUpdates(e,r){return Object.keys(r).forEach(n=>{let o=r[n];if(!e.hasOwnProperty(n))o!==null&&(e[n]=o);else{let s=o!==null,c=typeof o=="object",l=!Array.isArray(o),u=typeof e[n]<"u"&&e[n]!==null;s&&c&&l&&u?this.mergeUpdates(e[n],o):e[n]=o}}),e}mergeRemovals(e,r){this.logger.trace("Remove updated entries in cache","");let n=e.Account?this.mergeRemovalsDict(e.Account,r.Account):e.Account,o=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,r.AccessToken):e.AccessToken,s=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,r.RefreshToken):e.RefreshToken,c=e.IdToken?this.mergeRemovalsDict(e.IdToken,r.IdToken):e.IdToken,l=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,r.AppMetadata):e.AppMetadata;return{...e,Account:n,AccessToken:o,RefreshToken:s,IdToken:c,AppMetadata:l}}mergeRemovalsDict(e,r){let n={...e};return Object.keys(e).forEach(o=>{(!r||!r.hasOwnProperty(o))&&delete n[o]}),n}overlayDefaults(e){return this.logger.trace("Overlaying input cache with the default cache",""),{Account:{...kIe.Account,...e.Account},IdToken:{...kIe.IdToken,...e.IdToken},AccessToken:{...kIe.AccessToken,...e.AccessToken},RefreshToken:{...kIe.RefreshToken,...e.RefreshToken},AppMetadata:{...kIe.AppMetadata,...e.AppMetadata}}}};p();var lfn=fe(rfn(),1);p();var nfn="missing_tenant_id_error",ifn="user_timeout_reached",ofn="invalid_assertion",z8t="invalid_client_credential",sfn="device_code_polling_cancelled",afn="device_code_expired",cfn="device_code_unknown_error";var W3=class t{static{a(this,"ClientAssertion")}static fromAssertion(e){let r=new t;return r.jwt=e,r}static fromCertificate(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!1,n&&(o.publicCertificate=this.parseCertificate(n)),o}static fromCertificateWithSha256Thumbprint(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!0,n&&(o.publicCertificate=this.parseCertificate(n)),o}getJwt(e,r,n){if(this.privateKey&&this.thumbprint)return this.jwt&&!this.isExpired()&&r===this.issuer&&n===this.jwtAudience?this.jwt:this.createJwt(e,r,n);if(this.jwt)return this.jwt;throw Nt(ofn)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=sd.nowSeconds();this.expirationTime=o+600;let c={alg:this.useSha256?Xx.PSS_256:Xx.RSA_256},l=this.useSha256?Xx.X5T_256:Xx.X5T;Object.assign(c,{[l]:H1.base64EncodeUrl(this.thumbprint,rr.EncodingTypes.HEX)}),this.publicCertificate&&Object.assign(c,{[Xx.X5C]:this.publicCertificate});let u={[Xx.AUDIENCE]:this.jwtAudience,[Xx.EXPIRATION_TIME]:this.expirationTime,[Xx.ISSUER]:this.issuer,[Xx.SUBJECT]:this.issuer,[Xx.NOT_BEFORE]:o,[Xx.JWT_ID]:e.createNewGuid()};return this.jwt=lfn.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&dn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&dn.addCcsUpn(r,e.username),NA.mapToQueryString(r)}};p();function ufn(t,e,r,n){let o=wIe.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return dn.addLibraryInfo(o,{sku:Zx.MSAL_SKU,version:G1,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==m_.OIDC&&dn.addApplicationTelemetry(o,t.telemetry.application),dn.addResponseType(o,rr.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&dn.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),dn.addExtraParameters(o,r.extraQueryParameters||{}),wIe.getAuthorizeUrl(e,o)}a(ufn,"getAuthCodeRequestUrl");var Rle=class{static{a(this,"ClientApplication")}constructor(e){this.config=ycn(e),this.cryptoProvider=new vO,this.logger=new gg(this.config.system.loggerOptions,wle,G1),this.storage=new OQ(this.logger,this.config.auth.clientId,this.cryptoProvider,JFt(this.config.auth)),this.tokenCache=new yle(this.storage,this.logger,this.config.cache.cachePlugin)}async getAuthCodeUrl(e){this.logger.info("getAuthCodeUrl called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),responseMode:e.responseMode||rr.ResponseMode.QUERY,authenticationScheme:rr.AuthenticationScheme.BEARER,state:e.state||"",nonce:e.nonce||""},n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions);return ufn(this.config,n,r,this.logger)}async acquireTokenByCode(e,r){this.logger.info("acquireTokenByCode called",e.correlationId||""),e.state&&r&&(this.logger.info("acquireTokenByCode - validating state",e.correlationId||""),this.validateState(e.state,r.state||""),r={...r,state:""});let n={...e,...await this.initializeBaseRequest(e),authenticationScheme:rr.AuthenticationScheme.BEARER},o=this.initializeServerTelemetryManager(wf.acquireTokenByCode,n.correlationId);try{let s=await this.createAuthority(n.authority,n.correlationId,void 0,e.azureCloudOptions),c=await this.buildOauthClientConfiguration(s,n.correlationId,n.redirectUri,o),l=new IIe(c,new rm);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,wf.acquireTokenByCode,r)}catch(s){throw s instanceof jo&&s.setCorrelationId(n.correlationId),o.cacheFailedRequest(s),s}}async acquireTokenByRefreshToken(e){this.logger.info("acquireTokenByRefreshToken called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),authenticationScheme:rr.AuthenticationScheme.BEARER},n=this.initializeServerTelemetryManager(wf.acquireTokenByRefreshToken,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,r.redirectUri||"",n),c=new hK(s,new rm);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,wf.acquireTokenByRefreshToken)}catch(o){throw o instanceof jo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenSilent(e){let r={...e,...await this.initializeBaseRequest(e),forceRefresh:e.forceRefresh||!1},n=this.initializeServerTelemetryManager(wf.acquireTokenSilent,r.correlationId,r.forceRefresh);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,r.redirectUri||"",n),c=new xIe(s,new rm);this.logger.verbose("Silent flow client created",r.correlationId);try{return await this.tokenCache.overwriteCache(),await this.acquireCachedTokenSilent(r,c,s)}catch(l){if(l instanceof wQ&&l.errorCode===th.tokenRefreshRequired)return new hK(s,new rm).acquireTokenByRefreshToken(r,wf.acquireTokenSilent);throw l}}catch(o){throw o instanceof jo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireCachedTokenSilent(e,r,n){let[o,s]=await r.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...rr.OIDC_DEFAULT_SCOPES]});if(s===rr.CacheOutcome.PROACTIVELY_REFRESHED){this.logger.info("ClientApplication:acquireCachedTokenSilent - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.",e.correlationId);let c=new hK(n,new rm);try{await c.acquireTokenByRefreshToken(e,wf.acquireTokenSilent)}catch{}}return o}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)},n=this.initializeServerTelemetryManager(wf.acquireTokenByUsernamePassword,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,"",n),c=new Z$e(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof jo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw g_.createStateNotFoundError();if(e!==r)throw Nt(th.stateMismatch)}getLogger(){return this.logger}setLogger(e){this.logger=e}async buildOauthClientConfiguration(e,r,n,o){return this.logger.verbose("buildOauthClientConfiguration called",r),this.logger.info(`Building oauth client configuration with the following authority: ${e.tokenEndpoint}.`,r),o?.updateRegionDiscoveryMetadata(e.regionDiscoveryMetadata),{authOptions:{clientId:this.config.auth.clientId,authority:e,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:n,isMcp:this.config.auth.isMcp},loggerOptions:{logLevel:this.config.system.loggerOptions.logLevel,loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,correlationId:r},cryptoInterface:this.cryptoProvider,networkInterface:this.config.system.networkClient,storageInterface:this.storage,serverTelemetryManager:o,clientCredentials:{clientSecret:this.clientSecret,clientAssertion:await this.getClientAssertion(e)},libraryInfo:{sku:Zx.MSAL_SKU,version:G1,cpu:process.arch||"",os:process.platform||""},telemetry:this.config.telemetry,persistencePlugin:this.config.cache.cachePlugin,serializableCache:this.tokenCache}}async getClientAssertion(e){return this.developerProvidedClientAssertion&&(this.clientAssertion=W3.fromAssertion(await zE(this.developerProvidedClientAssertion,this.config.auth.clientId,e.tokenEndpoint))),this.clientAssertion&&{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:Zx.JWT_BEARER_ASSERTION_TYPE}}async initializeBaseRequest(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();return this.logger.verbose("initializeRequestScopes called",r),e.authenticationScheme&&e.authenticationScheme===rr.AuthenticationScheme.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",r),e.authenticationScheme=rr.AuthenticationScheme.BEARER,{...e,scopes:[...e&&e.scopes||[],...rr.OIDC_DEFAULT_SCOPES],correlationId:r,authority:e.authority||this.config.auth.authority}}initializeServerTelemetryManager(e,r,n){let o={clientId:this.config.auth.clientId,correlationId:r,apiId:e,forceRefresh:n||!1};return new gK(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=$P.generateAuthority(e,o||this.config.auth.azureCloudOptions),c={protocolMode:this.config.system.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,azureRegionConfiguration:n};return l$e.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new rm)}clearCache(){this.storage.clear()}};p();var dfn=fe(require("http"),1);var X$e=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw g_.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=dfn.default.createServer((s,c)=>{let l=s.url;if(l){if(l===rr.FORWARD_SLASH){c.end(e||"Auth code was successfully acquired. You can close this window now.");return}}else{c.end(r||"Error occurred loading redirectUrl"),o(g_.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=NA.getDeserializedResponse(d.search)||{};f.code&&(c.writeHead(rr.HTTP_REDIRECT,{location:u}),c.end()),f.error&&c.end(r||`Error occurred: ${f.error}`),n(f)}),this.server.listen(0,"127.0.0.1")})}getRedirectUri(){if(!this.server||!this.server.listening)throw g_.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),g_.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${Zx.HTTP_PROTOCOL}${Zx.LOCALHOST}:${r}`}closeServer(){this.server&&(this.server.close(),typeof this.server.closeAllConnections=="function"&&this.server.closeAllConnections(),this.server.unref(),this.server=void 0)}};p();var eVe=class extends SO{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=sd.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new rh(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(o,e.correlationId),s.handleServerTokenResponse(o,this.authority,n,e,wf.acquireTokenByDeviceCode)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),n=Ds.appendQueryString(this.authority.deviceCodeEndpoint,r),o=this.createQueryString(e),s=this.createTokenRequestHeaders(),c={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return this.executePostRequestToDeviceCodeEndpoint(n,o,s,c,e.correlationId)}createExtraQueryParameters(e){let r=new Map;return e.extraQueryParameters&&dn.addExtraParameters(r,e.extraQueryParameters),NA.mapToQueryString(r)}async executePostRequestToDeviceCodeEndpoint(e,r,n,o,s){let{body:{user_code:c,device_code:l,verification_uri:u,expires_in:d,interval:f,message:h}}=await this.sendPostRequest(o,e,{body:r,headers:n},s);return{userCode:c,deviceCode:l,verificationUri:u,expiresIn:d,interval:f,message:h}}createQueryString(e){let r=new Map;return dn.addScopes(r,e.scopes),dn.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&dn.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&dn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),NA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),Nt(sfn);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),Nt(ifn);if(sd.nowSeconds()>e)throw r&&this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${r}`,""),this.logger.error(`Device code expired. Expiration time of device code was ${e}`,""),Nt(afn);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=Ds.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?sd.nowSeconds()+e.timeout:void 0,u=sd.nowSeconds()+r.expiresIn,d=r.interval*1e3;for(;this.continuePolling(u,l,e.cancel);){let f={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},h=await this.executePostToTokenEndpoint(o,s,c,f,e.correlationId);if(h.body&&h.body.error)if(h.body.error===rr.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling.",e.correlationId),await sd.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),tK(mle.postRequestFailed,h.body.error);else return this.logger.verbose("Authorization completed successfully. Polling stopped.",e.correlationId),h.body}throw this.logger.error("Polling stopped for unknown reasons.",e.correlationId),Nt(cfn)}createTokenRequestBody(e,r){let n=new Map;dn.addScopes(n,e.scopes),dn.addClientId(n,this.config.authOptions.clientId),dn.addGrantType(n,rr.GrantType.DEVICE_CODE_GRANT),dn.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return dn.addCorrelationId(n,o),dn.addClientInfo(n),dn.addLibraryInfo(n,this.config.libraryInfo),dn.addApplicationTelemetry(n,this.config.telemetry.application),dn.addThrottling(n),this.serverTelemetryManager&&dn.addServerTelemetry(n,this.serverTelemetryManager),(!Su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&dn.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),NA.mapToQueryString(n)}};var kle=class extends Rle{static{a(this,"PublicClientApplication")}constructor(e){super(e),this.config.broker.nativeBrokerPlugin&&(this.config.broker.nativeBrokerPlugin.isBrokerAvailable?(this.nativeBrokerPlugin=this.config.broker.nativeBrokerPlugin,this.nativeBrokerPlugin.setLogger(this.config.system.loggerOptions)):this.logger.warning("NativeBroker implementation was provided but the broker is unavailable.","")),this.skus=gK.makeExtraSkuString({libraryName:Zx.MSAL_SKU,libraryVersion:G1})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),mK(this.config.auth.isMcp,e);let r=Object.assign(e,await this.initializeBaseRequest(e)),n=this.initializeServerTelemetryManager(wf.acquireTokenByDeviceCode,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,"",n),c=new eVe(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof jo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),mK(this.config.auth.isMcp,e);let{openBrowser:n,successTemplate:o,errorTemplate:s,windowHandle:c,loopbackClient:l,...u}=e;if(this.nativeBrokerPlugin){let A={...u,clientId:this.config.auth.clientId,scopes:e.scopes||rr.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...u.extraQueryParameters,...u.extraParameters,[eK.X_CLIENT_EXTRA_SKU]:this.skus},accountId:u.account?.nativeAccountId};return this.nativeBrokerPlugin.acquireTokenInteractive(A,c)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw g_.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new X$e,m={},g=null;try{let A=h.listenForAuthCode(o,s).then(T=>{m=T}).catch(T=>{g=T}),y=await this.waitForRedirectUri(h),_={...u,correlationId:r,scopes:e.scopes||rr.OIDC_DEFAULT_SCOPES,redirectUri:y,responseMode:rr.ResponseMode.QUERY,codeChallenge:f,codeChallengeMethod:rr.CodeChallengeMethodValues.S256},E=await this.getAuthCodeUrl(_);if(await n(E),await A,g)throw g;if(m.error)throw new VE(m.error,m.error_description,m.suberror);if(!m.code)throw g_.createNoAuthCodeInResponseError();let v=m.client_info,S={code:m.code,codeVerifier:d,clientInfo:v||"",..._};return await this.acquireTokenByCode(S)}finally{h.closeServer()}}async acquireTokenSilent(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();if(this.logger.trace("acquireTokenSilent called",r),mK(this.config.auth.isMcp,e),this.nativeBrokerPlugin){let n={...e,clientId:this.config.auth.clientId,scopes:e.scopes||rr.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...e.extraQueryParameters,...e.extraParameters,[eK.X_CLIENT_EXTRA_SKU]:this.skus},accountId:e.account.nativeAccountId,forceRefresh:e.forceRefresh||!1};return this.nativeBrokerPlugin.acquireTokenSilent(n)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw g_.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return mK(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return mK(this.config.auth.isMcp,e),super.acquireTokenByRefreshToken(e)}async signOut(e){if(this.nativeBrokerPlugin&&e.account.nativeAccountId){let r={clientId:this.config.auth.clientId,accountId:e.account.nativeAccountId,correlationId:e.correlationId||this.cryptoProvider.createNewGuid()};await this.nativeBrokerPlugin.signOut(r)}await this.getTokenCache().removeAccount(e.account,e.correlationId)}async getAllAccounts(){if(this.nativeBrokerPlugin){let e=this.cryptoProvider.createNewGuid();return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId,e)}return this.getTokenCache().getAllAccounts()}async waitForRedirectUri(e){return new Promise((r,n)=>{let o=0,s=setInterval(()=>{if(d$e.TIMEOUT_MS/d$e.INTERVAL_MS1)throw Nt(th.multipleMatchingTokens);return l[0]}async executeTokenRequest(e,r,n){let o,s;if(this.appTokenProvider){this.logger.info("Using appTokenProvider extensibility.",e.correlationId);let u={correlationId:e.correlationId,tenantId:this.config.authOptions.authority.tenant,scopes:e.scopes,claims:e.claims};s=sd.nowSeconds();let d=await this.appTokenProvider(u);o={access_token:d.accessToken,expires_in:d.expiresInSeconds,refresh_in:d.refreshInSeconds,token_type:rr.AuthenticationScheme.BEARER}}else{let u=this.createTokenQueryParameters(e),d=Ds.appendQueryString(r.tokenEndpoint,u),f=await this.createTokenRequestBody(e),h=this.createTokenRequestHeaders(),m={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};this.logger.info("Sending token request to endpoint: "+r.tokenEndpoint,e.correlationId),s=sd.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new rh(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(o,e.correlationId,n),await c.handleServerTokenResponse(o,this.authority,s,e,wf.acquireTokenByClientCredential)}async createTokenRequestBody(e){let r=new Map;dn.addClientId(r,this.config.authOptions.clientId),dn.addScopes(r,e.scopes,!1),dn.addGrantType(r,rr.GrantType.CLIENT_CREDENTIALS_GRANT),dn.addLibraryInfo(r,this.config.libraryInfo),dn.addApplicationTelemetry(r,this.config.telemetry.application),dn.addThrottling(r),this.serverTelemetryManager&&dn.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();dn.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&dn.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(dn.addClientAssertion(r,await zE(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),dn.addClientAssertionType(r,o.assertionType)),(!Su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&dn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),NA.mapToQueryString(r)}};p();var tVe=class extends SO{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new tm(e.scopes||[]),this.userAssertionHash=await this.cryptoUtils.hashString(e.oboAssertion),e.skipCache||e.claims)return this.executeTokenRequest(e,this.authority,this.userAssertionHash);try{return await this.getCachedAuthenticationResult(e)}catch{return await this.executeTokenRequest(e,this.authority,this.userAssertionHash)}}async getCachedAuthenticationResult(e){let r=this.readAccessTokenFromCacheForOBO(this.config.authOptions.clientId,e);if(r){if(sd.isTokenExpired(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(rr.CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info(`OnbehalfofFlow:getCachedAuthenticationResult - Cached access token is expired or will expire within ${this.config.systemOptions.tokenRenewalOffsetSeconds} seconds.`,e.correlationId),Nt(th.tokenRefreshRequired)}else throw this.serverTelemetryManager?.setCacheOutcome(rr.CacheOutcome.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.",e.correlationId),Nt(th.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=KGe.extractTokenClaims(n.secret,H1.base64Decode);let c=o.oid||o.sub,l={homeAccountId:n.homeAccountId,environment:n.environment,tenantId:n.realm,username:"",localAccountId:c||""};s=this.cacheManager.getAccount(this.cacheManager.generateAccountKey(l),e.correlationId)}return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),rh.generateAuthenticationResult(this.cryptoUtils,this.authority,{account:s,accessToken:r,idToken:n,refreshToken:null,appMetadata:null},!0,e,this.performanceClient,o)}readIdTokenFromCacheForOBO(e,r){let n={homeAccountId:e,environment:this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,credentialType:rr.CredentialType.ID_TOKEN,clientId:this.config.authOptions.clientId,realm:this.authority.tenant},o=this.cacheManager.getIdTokensByFilter(n,r);return Object.values(o).length<1?null:Object.values(o)[0]}readAccessTokenFromCacheForOBO(e,r){let n=r.authenticationScheme||rr.AuthenticationScheme.BEARER,s={credentialType:n&&n.toLowerCase()!==rr.AuthenticationScheme.BEARER.toLowerCase()?rr.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:rr.CredentialType.ACCESS_TOKEN,clientId:e,target:tm.createSearchScopes(this.scopeSet.asArray()),tokenType:n,keyId:r.sshKid,userAssertionHash:this.userAssertionHash},c=this.cacheManager.getAccessTokensByFilter(s,r.correlationId),l=c.length;if(l<1)return null;if(l>1)throw Nt(th.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=Ds.appendQueryString(r.tokenEndpoint,o),c=await this.createTokenRequestBody(e),l=this.createTokenRequestHeaders(),u={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},d=sd.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new rh(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return h.validateTokenResponse(f.body,e.correlationId),await h.handleServerTokenResponse(f.body,this.authority,d,e,wf.acquireTokenByOBO,void 0,n)}async createTokenRequestBody(e){let r=new Map;dn.addClientId(r,this.config.authOptions.clientId),dn.addScopes(r,e.scopes),dn.addGrantType(r,rr.GrantType.JWT_BEARER),dn.addClientInfo(r),dn.addLibraryInfo(r,this.config.libraryInfo),dn.addApplicationTelemetry(r,this.config.telemetry.application),dn.addThrottling(r),this.serverTelemetryManager&&dn.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();dn.addCorrelationId(r,n),dn.addRequestTokenUse(r,eK.ON_BEHALF_OF),dn.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&dn.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(dn.addClientAssertion(r,await zE(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),dn.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&dn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),NA.mapToQueryString(r)}};var Dle=class extends Rle{static{a(this,"ConfidentialClientApplication")}constructor(e){super(e);let r=!!this.config.auth.clientSecret,n=!!this.config.auth.clientAssertion,o=(!!this.config.auth.clientCertificate?.thumbprint||!!this.config.auth.clientCertificate?.thumbprintSha256)&&!!this.config.auth.clientCertificate?.privateKey;if(!this.appTokenProvider){if(r&&n||n&&o||r&&o)throw Nt(z8t);if(this.config.auth.clientSecret){this.clientSecret=this.config.auth.clientSecret;return}if(this.config.auth.clientAssertion){this.developerProvidedClientAssertion=this.config.auth.clientAssertion;return}if(o)this.clientAssertion=this.config.auth.clientCertificate.thumbprintSha256?W3.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):W3.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw Nt(z8t);this.appTokenProvider=void 0}}SetAppTokenProvider(e){this.appTokenProvider=e}async acquireTokenByClientCredential(e){this.logger.info("acquireTokenByClientCredential called",e.correlationId||"");let r;e.clientAssertion&&(r={assertion:await zE(e.clientAssertion,this.config.auth.clientId),assertionType:Zx.JWT_BEARER_ASSERTION_TYPE});let n=await this.initializeBaseRequest(e),o={...n,scopes:n.scopes.filter(m=>!rr.OIDC_DEFAULT_SCOPES.includes(m))},s={...e,...o,clientAssertion:r},l=new Ds(s.authority).getUrlComponents().PathSegments[0];if(Object.values(rr.AADAuthority).includes(l))throw Nt(nfn);let u=process.env[dcn],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[ucn]},h=this.initializeServerTelemetryManager(wf.acquireTokenByClientCredential,s.correlationId,s.skipCache);try{let m=await this.createAuthority(s.authority,s.correlationId,f,e.azureCloudOptions),g=await this.buildOauthClientConfiguration(m,s.correlationId,"",h),A=new Ple(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof jo&&m.setCorrelationId(s.correlationId),h.cacheFailedRequest(m),m}}async acquireTokenOnBehalfOf(e){this.logger.info("acquireTokenOnBehalfOf called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)};try{let n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),o=await this.buildOauthClientConfiguration(n,r.correlationId,"",void 0),s=new tVe(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof jo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function ffn(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(ffn,"isIso8601");p();var rVe=class{static{a(this,"HttpClientWithRetries")}constructor(e,r,n){this.httpClientNoRetries=e,this.retryPolicy=r,this.logger=n}async sendNetworkRequestAsyncHelper(e,r,n){return e===sp.GET?this.httpClientNoRetries.sendGetRequestAsync(r,n):this.httpClientNoRetries.sendPostRequestAsync(r,n)}async sendNetworkRequestAsync(e,r,n){let o=await this.sendNetworkRequestAsyncHelper(e,r,n);"isNewRequest"in this.retryPolicy&&(this.retryPolicy.isNewRequest=!0);let s=0;for(;await this.retryPolicy.pauseForRetry(o.status,s,this.logger,o.headers[rr.HeaderNames.RETRY_AFTER]);)o=await this.sendNetworkRequestAsyncHelper(e,r,n),s++;return o}async sendGetRequestAsync(e,r){return this.sendNetworkRequestAsync(sp.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(sp.POST,e,r)}};var EK={MANAGED_IDENTITY_CLIENT_ID_2017:"clientid",MANAGED_IDENTITY_CLIENT_ID:"client_id",MANAGED_IDENTITY_OBJECT_ID:"object_id",MANAGED_IDENTITY_RESOURCE_ID_IMDS:"msi_res_id",MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS:"mi_res_id"},KE=class{static{a(this,"BaseManagedIdentitySource")}constructor(e,r,n,o,s){this.logger=e,this.nodeStorage=r,this.networkClient=n,this.cryptoProvider=o,this.disableInternalRetries=s}async getServerTokenResponseAsync(e,r,n,o){return this.getServerTokenResponse(e)}getServerTokenResponse(e){let r,n;return e.body.expires_on&&(ffn(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-sd.nowSeconds(),n>2*3600&&(r=n/2)),{status:e.status,access_token:e.body.access_token,expires_in:n,scope:e.body.resource,token_type:e.body.token_type,refresh_in:r,correlation_id:e.body.correlation_id||e.body.correlationId,error:typeof e.body.error=="string"?e.body.error:e.body.error?.code,error_description:e.body.message||(typeof e.body.error=="string"?e.body.error_description:e.body.error?.message),error_codes:e.body.error_codes,timestamp:e.body.timestamp,trace_id:e.body.trace_id}}async acquireTokenWithManagedIdentity(e,r,n,o){let s=this.createRequest(e.resource,r);if(e.revokedTokenSha256Hash&&(this.logger.info(`[Managed Identity] The following claims are present in the request: ${e.claims}`,""),s.queryParameters[nm.SHA256_TOKEN_TO_REFRESH]=e.revokedTokenSha256Hash),e.clientCapabilities?.length){let g=e.clientCapabilities.toString();this.logger.info(`[Managed Identity] The following client capabilities are present in the request: ${g}`,""),s.queryParameters[nm.XMS_CC]=g}let c=s.headers;c[rr.HeaderNames.CONTENT_TYPE]=rr.URL_FORM_CONTENT_TYPE;let l={headers:c};Object.keys(s.bodyParameters).length&&(l.body=s.computeParametersBodyString());let u=this.disableInternalRetries?this.networkClient:new rVe(this.networkClient,s.retryPolicy,this.logger),d=sd.nowSeconds(),f;try{s.httpMethod===sp.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof jo?g:Nt(th.networkError)}let h=new rh(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new rm,null,null),m=await this.getServerTokenResponseAsync(f,u,s,l);return h.validateTokenResponse(m,m.correlation_id||"",o),h.handleServerTokenResponse(m,n,d,e,wf.acquireTokenWithManagedIdentity)}getManagedIdentityUserAssignedIdQueryParameterKey(e,r,n){switch(e){case xf.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?EK.MANAGED_IDENTITY_CLIENT_ID_2017:EK.MANAGED_IDENTITY_CLIENT_ID;case xf.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?EK.MANAGED_IDENTITY_RESOURCE_ID_IMDS:EK.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case xf.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),EK.MANAGED_IDENTITY_OBJECT_ID;default:throw nh(NQ)}}};KE.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new Ds(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),nh(AK[t])}};p();p();p();var nVe=class{static{a(this,"LinearRetryStrategy")}calculateDelay(e,r){if(!e)return r;let n=Math.round(parseFloat(e)*1e3);return isNaN(n)&&(n=new Date(e).valueOf()-new Date().valueOf()),Math.max(r,n)}};var KLo=3,JLo=1e3,ZLo=[rr.HTTP_NOT_FOUND,rr.HTTP_REQUEST_TIMEOUT,rr.HTTP_TOO_MANY_REQUESTS,rr.HTTP_SERVER_ERROR,rr.HTTP_SERVICE_UNAVAILABLE,rr.HTTP_GATEWAY_TIMEOUT],iVe=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new nVe}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return JLo}async pauseForRetry(e,r,n,o){if(ZLo.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var $C=class{static{a(this,"ManagedIdentityRequestParameters")}constructor(e,r,n){this.httpMethod=e,this._baseEndpoint=r,this.headers={},this.bodyParameters={},this.queryParameters={},this.retryPolicy=n||new iVe}computeUri(){let e=new Map;this.queryParameters&&dn.addExtraParameters(e,this.queryParameters);let r=NA.mapToQueryString(e);return Ds.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&dn.addExtraParameters(e,this.bodyParameters),NA.mapToQueryString(e)}};var XLo="2019-08-01",QIe=class t extends KE{static{a(this,"AppService")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[Zi.IDENTITY_ENDPOINT],r=process.env[Zi.IDENTITY_HEADER];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${ao.APP_SERVICE} managed identity is unavailable because one or both of the '${Zi.IDENTITY_HEADER}' and '${Zi.IDENTITY_ENDPOINT}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Zi.IDENTITY_ENDPOINT,c,ao.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${ao.APP_SERVICE} managed identity. Endpoint URI: ${u}. Creating ${ao.APP_SERVICE} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new $C(sp.GET,this.identityEndpoint);return n.headers[GC.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[nm.API_VERSION]=XLo,n.queryParameters[nm.RESOURCE]=e,r.idType!==xf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var z3=require("fs"),gfn=fe(require("path"),1);var eBo="2019-11-01",pfn="http://127.0.0.1:40342/metadata/identity/oauth2/token",hfn="N/A: himds executable exists",mfn={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},tBo={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},qIe=class t extends KE{static{a(this,"AzureArc")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static getEnvironmentVariables(){let e=process.env[Zi.IDENTITY_ENDPOINT],r=process.env[Zi.IMDS_ENDPOINT];if(!e||!r){let n=tBo[process.platform];try{(0,z3.accessSync)(n,z3.constants.F_OK|z3.constants.R_OK),e=pfn,r=hfn}catch{}}return[e,r]}static tryCreate(e,r,n,o,s,c){let[l,u]=t.getEnvironmentVariables();if(!l||!u)return e.info(`[Managed Identity] ${ao.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${Zi.IDENTITY_ENDPOINT}' and '${Zi.IMDS_ENDPOINT}' are not defined. ${ao.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===hfn)e.info(`[Managed Identity] ${ao.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${ao.AZURE_ARC} endpoint: ${pfn}. Creating ${ao.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(Zi.IDENTITY_ENDPOINT,l,ao.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(Zi.IMDS_ENDPOINT,u,ao.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${ao.AZURE_ARC} managed identity. Endpoint URI: ${d}. Creating ${ao.AZURE_ARC} managed identity.`,"")}if(c.idType!==xf.SYSTEM_ASSIGNED)throw nh(g$e);return new t(e,r,n,o,s,l)}createRequest(e){let r=new $C(sp.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[GC.METADATA_HEADER_NAME]="true",r.queryParameters[nm.API_VERSION]=eBo,r.queryParameters[nm.RESOURCE]=e,r}async getServerTokenResponseAsync(e,r,n,o){let s;if(e.status===rr.HTTP_UNAUTHORIZED){let c=e.headers["www-authenticate"];if(!c)throw nh(_$e);if(!c.includes("Basic realm="))throw nh(E$e);let l=c.split("Basic realm=")[1];if(!mfn.hasOwnProperty(process.platform))throw nh(m$e);let u=mfn[process.platform],d=gfn.default.basename(l);if(!d.endsWith(".key"))throw nh(f$e);if(u+d!==l)throw nh(p$e);let f;try{f=await(0,z3.statSync)(l).size}catch{throw nh(RIe)}if(f>hcn)throw nh(h$e);let h;try{h=(0,z3.readFileSync)(l,rr.EncodingTypes.UTF8)}catch{throw nh(RIe)}let m=`Basic ${h}`;this.logger.info("[Managed Identity] Adding authorization header to the request.",""),n.headers[GC.AUTHORIZATION_HEADER_NAME]=m;try{s=await r.sendGetRequestAsync(n.computeUri(),o)}catch(g){throw g instanceof jo?g:Nt(th.networkError)}}return this.getServerTokenResponse(s||e)}};p();var jIe=class t extends KE{static{a(this,"CloudShell")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.msiEndpoint=c}static getEnvironmentVariables(){return[process.env[Zi.MSI_ENDPOINT]]}static tryCreate(e,r,n,o,s,c){let[l]=t.getEnvironmentVariables();if(!l)return e.info(`[Managed Identity] ${ao.CLOUD_SHELL} managed identity is unavailable because the '${Zi.MSI_ENDPOINT} environment variable is not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Zi.MSI_ENDPOINT,l,ao.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${ao.CLOUD_SHELL} managed identity. Endpoint URI: ${u}. Creating ${ao.CLOUD_SHELL} managed identity.`,""),c.idType!==xf.SYSTEM_ASSIGNED)throw nh(A$e);return new t(e,r,n,o,s,l)}createRequest(e){let r=new $C(sp.POST,this.msiEndpoint);return r.headers[GC.METADATA_HEADER_NAME]="true",r.bodyParameters[nm.RESOURCE]=e,r}};p();p();p();var oVe=class{static{a(this,"ExponentialRetryStrategy")}constructor(e,r,n){this.minExponentialBackoff=e,this.maxExponentialBackoff=r,this.exponentialDeltaBackoff=n}calculateDelay(e){return e===0?this.minExponentialBackoff:Math.min(Math.pow(2,e-1)*this.exponentialDeltaBackoff,this.maxExponentialBackoff)}};var rBo=[rr.HTTP_NOT_FOUND,rr.HTTP_REQUEST_TIMEOUT,rr.HTTP_GONE,rr.HTTP_TOO_MANY_REQUESTS],nBo=3,iBo=7,oBo=1e3,sBo=4e3,aBo=2e3,cBo=10*1e3,sVe=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new oVe(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return oBo}static get MAX_EXPONENTIAL_BACKOFF_MS(){return sBo}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return aBo}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return cBo}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===rr.HTTP_GONE?iBo:nBo),(rBo.includes(e)||e>=rr.HTTP_SERVER_ERROR_RANGE_START&&e<=rr.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var Afn="/metadata/identity/oauth2/token",lBo=`http://169.254.169.254${Afn}`,uBo="2018-02-01",aVe=class t extends KE{static{a(this,"Imds")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static tryCreate(e,r,n,o,s){let c;return process.env[Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]?(e.info(`[Managed Identity] Environment variable ${Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} for ${ao.IMDS} returned endpoint: ${process.env[Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}`,""),c=t.getValidatedEnvVariableUrlString(Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST,`${process.env[Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}${Afn}`,ao.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${Zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${ao.IMDS}, using the default endpoint.`,""),c=lBo),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new $C(sp.GET,this.identityEndpoint);return n.headers[GC.METADATA_HEADER_NAME]="true",n.queryParameters[nm.API_VERSION]=uBo,n.queryParameters[nm.RESOURCE]=e,r.idType!==xf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new sVe,n}};p();var dBo="2019-07-01-preview",HIe=class t extends KE{static{a(this,"ServiceFabric")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[Zi.IDENTITY_ENDPOINT],r=process.env[Zi.IDENTITY_HEADER],n=process.env[Zi.IDENTITY_SERVER_THUMBPRINT];return[e,r,n]}static tryCreate(e,r,n,o,s,c){let[l,u,d]=t.getEnvironmentVariables();if(!l||!u||!d)return e.info(`[Managed Identity] ${ao.SERVICE_FABRIC} managed identity is unavailable because one or all of the '${Zi.IDENTITY_HEADER}', '${Zi.IDENTITY_ENDPOINT}' or '${Zi.IDENTITY_SERVER_THUMBPRINT}' environment variables are not defined.`,""),null;let f=t.getValidatedEnvVariableUrlString(Zi.IDENTITY_ENDPOINT,l,ao.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${ao.SERVICE_FABRIC} managed identity. Endpoint URI: ${f}. Creating ${ao.SERVICE_FABRIC} managed identity.`,""),c.idType!==xf.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${ao.SERVICE_FABRIC} user assigned managed identity is configured in the cluster, not during runtime. See also: https://learn.microsoft.com/en-us/azure/service-fabric/configure-existing-cluster-enable-managed-identity-token-service.`,""),new t(e,r,n,o,s,l,u)}createRequest(e,r){let n=new $C(sp.GET,this.identityEndpoint);return n.headers[GC.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[nm.API_VERSION]=dBo,n.queryParameters[nm.RESOURCE]=e,r.idType!==xf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var fBo="2017-09-01",pBo=`Only client id is supported for user-assigned managed identity in ${ao.MACHINE_LEARNING}.`,GIe=class t extends KE{static{a(this,"MachineLearning")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.msiEndpoint=c,this.secret=l}static getEnvironmentVariables(){let e=process.env[Zi.MSI_ENDPOINT],r=process.env[Zi.MSI_SECRET];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${ao.MACHINE_LEARNING} managed identity is unavailable because one or both of the '${Zi.MSI_ENDPOINT}' and '${Zi.MSI_SECRET}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Zi.MSI_ENDPOINT,c,ao.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${ao.MACHINE_LEARNING} managed identity. Endpoint URI: ${u}. Creating ${ao.MACHINE_LEARNING} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new $C(sp.GET,this.msiEndpoint);if(n.headers[GC.METADATA_HEADER_NAME]="true",n.headers[GC.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[nm.API_VERSION]=fBo,n.queryParameters[nm.RESOURCE]=e,r.idType===xf.SYSTEM_ASSIGNED)n.queryParameters[EK.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[Zi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===xf.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(pBo);return n}};var $Ie=class t{static{a(this,"ManagedIdentityClient")}constructor(e,r,n,o,s){this.logger=e,this.nodeStorage=r,this.networkClient=n,this.cryptoProvider=o,this.disableInternalRetries=s}async sendManagedIdentityTokenRequest(e,r,n,o){return t.identitySource||(t.identitySource=this.selectManagedIdentitySource(this.logger,this.nodeStorage,this.networkClient,this.cryptoProvider,this.disableInternalRetries,r)),t.identitySource.acquireTokenWithManagedIdentity(e,r,n,o)}allEnvironmentVariablesAreDefined(e){return Object.values(e).every(r=>r!==void 0)}getManagedIdentitySource(){return t.sourceName=this.allEnvironmentVariablesAreDefined(HIe.getEnvironmentVariables())?ao.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(QIe.getEnvironmentVariables())?ao.APP_SERVICE:this.allEnvironmentVariablesAreDefined(GIe.getEnvironmentVariables())?ao.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(jIe.getEnvironmentVariables())?ao.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(qIe.getEnvironmentVariables())?ao.AZURE_ARC:ao.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=HIe.tryCreate(e,r,n,o,s,c)||QIe.tryCreate(e,r,n,o,s)||GIe.tryCreate(e,r,n,o,s)||jIe.tryCreate(e,r,n,o,s,c)||qIe.tryCreate(e,r,n,o,s,c)||aVe.tryCreate(e,r,n,o,s);if(!l)throw nh(y$e);return l}};var hBo=[ao.SERVICE_FABRIC],Nle=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=_cn(e||{}),this.logger=new gg(this.config.system.loggerOptions,wle,G1);let r={canonicalAuthority:rr.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new OQ(this.logger,this.config.managedIdentityId.id,ale,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new vO;let n={protocolMode:m_.AAD,knownAuthorities:[e8t],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new $P(e8t,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new rm,!0),this.fakeClientCredentialClient=new Ple({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new $Ie(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new MQ}async acquireToken(e){if(!e.resource)throw Dl(ile.urlEmptyError);let r={forceRefresh:e.forceRefresh,resource:e.resource.replace("/.default",""),scopes:[e.resource.replace("/.default","")],authority:this.fakeAuthority.canonicalAuthority,correlationId:this.cryptoProvider.createNewGuid(),claims:e.claims,clientCapabilities:this.config.clientCapabilities};if(r.forceRefresh)return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority);let[n,o]=await this.fakeClientCredentialClient.getCachedAuthenticationResult(r,this.config,this.cryptoProvider,this.fakeAuthority,t.nodeStorage);if(r.claims){let s=this.managedIdentityClient.getManagedIdentitySource();if(n&&hBo.includes(s)){let c=this.hashUtils.sha256(n.accessToken).toString(rr.EncodingTypes.HEX);r.revokedTokenSha256Hash=c}return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}return n?(o===rr.CacheOutcome.PROACTIVELY_REFRESHED&&(this.logger.info("ClientCredentialClient:getCachedAuthenticationResult - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.",r.correlationId),await this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority,!0)),n):this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}async acquireTokenFromManagedIdentity(e,r,n,o){return this.managedIdentityClient.sendManagedIdentityTokenRequest(e,r,n,o)}getManagedIdentitySource(){return $Ie.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var cVe=class{static{a(this,"DistributedCachePlugin")}constructor(e,r){this.client=e,this.partitionManager=r}async beforeCacheAccess(e){let r=await this.partitionManager.getKey(),n=await this.client.get(r);e.tokenCache.deserialize(n)}async afterCacheAccess(e){if(e.cacheHasChanged){let r=e.tokenCache.getKVStore(),n=Object.values(r).filter(s=>fK.isAccountEntity(s)),o;if(n.length>0){let s=n[0];o=await this.partitionManager.extractKey(s)}else o=await this.partitionManager.getKey();await this.client.set(o,e.tokenCache.serialize())}}};var mBo=rr.PromptValue,gBo=rr.ResponseMode;p();p();p();p();p();function VIe(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(VIe,"getRandomIntegerInclusive");function WIe(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+VIe(0,n/2)}}a(WIe,"calculateRetryDelay");p();function Mle(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Mle,"isObject");p();function vK(t){if(Mle(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(vK,"isError");p();p();var yfn=require("node:crypto");var Y8t,ABo=typeof((Y8t=globalThis?.crypto)===null||Y8t===void 0?void 0:Y8t.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):yfn.randomUUID;function Ole(){return ABo()}a(Ole,"randomUUID");p();var K8t,J8t,Z8t,X8t,_fn=typeof window<"u"&&typeof window.document<"u",Efn=typeof self=="object"&&typeof self?.importScripts=="function"&&(((K8t=self.constructor)===null||K8t===void 0?void 0:K8t.name)==="DedicatedWorkerGlobalScope"||((J8t=self.constructor)===null||J8t===void 0?void 0:J8t.name)==="ServiceWorkerGlobalScope"||((Z8t=self.constructor)===null||Z8t===void 0?void 0:Z8t.name)==="SharedWorkerGlobalScope"),vfn=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Cfn=typeof Bun<"u"&&typeof Bun.version<"u",UQ=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((X8t=globalThis.process.versions)===null||X8t===void 0)&&X8t.node);var bfn=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function VC(t,e){return Buffer.from(t,e)}a(VC,"stringToUint8Array");p();var e6t="REDACTED",yBo=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],_Bo=["api-version"],zP=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=yBo.concat(e),r=_Bo.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||Mle(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,e6t);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=e6t;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=e6t;return r}};p();p();p();p();var CK=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function r6t(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new CK(o??"The operation was aborted."))}a(l,"rejectOnAbort");function u(){n?.removeEventListener("abort",d)}a(u,"removeListeners");function d(){r?.(),u(),l()}if(a(d,"onAbort"),n?.aborted)return l();try{t(f=>{u(),s(f)},f=>{u(),c(f)})}catch(f){c(f)}n?.addEventListener("abort",d)})}a(r6t,"createAbortablePromise");p();var SBo="The delay was aborted.";function n6t(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return r6t(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??SBo})}a(n6t,"delay");p();function Lle(t){if(vK(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}a(Lle,"getErrorMessage");p();function Sfn(t,e){return WIe(t,e)}a(Sfn,"calculateRetryDelay");function lVe(t){return vK(t)}a(lVe,"isError");var uVe=UQ,Ble=UQ;p();var zIe=fo("IdentityUtils"),Tfn="1.0";function bK(t,e,r){let n=a(o=>(zIe.getToken.info(o),new Kx({scopes:Array.isArray(t)?t:[t],getTokenOptions:r,message:o})),"error");if(!e)throw n("No response");if(!e.expiresOn)throw n('Response had no "expiresOn" property.');if(!e.accessToken)throw n('Response had no "accessToken" property.')}a(bK,"ensureValidMsalToken");function i6t(t){let e=t?.authorityHost;return!e&&Ble&&(e=process.env.AZURE_AUTHORITY_HOST),e??FTe}a(i6t,"getAuthorityHost");function o6t(t,e){return e||(e=FTe),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(o6t,"getAuthority");function Ifn(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(Ifn,"getKnownAuthorities");var dVe=a((t,e=uVe?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case $1.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case $1.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case $1.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case $1.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function fVe(t){switch(t){case"error":return $1.LogLevel.Error;case"info":return $1.LogLevel.Info;case"verbose":return $1.LogLevel.Verbose;case"warning":return $1.LogLevel.Warning;default:return $1.LogLevel.Info}}a(fVe,"getMSALLogLevel");function SK(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return zIe.info($s(t,e.message)),new Fn(e.message);case"device_code_polling_cancelled":return new CK("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":zIe.info($s(t,`Authentication returned errorCode ${n.errorCode}`));break;default:zIe.info($s(t,`Failed to acquire token: ${e.message}`));break}}return e.name==="ClientConfigurationError"||e.name==="BrowserConfigurationAuthError"||e.name==="AbortError"||e.name==="AuthenticationError"?e:e.name==="NativeAuthError"?(zIe.info($s(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new Kx({scopes:t,getTokenOptions:r,message:e.message})}a(SK,"handleMsalError");function xfn(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(xfn,"publicToMsal");function wfn(t,e){return{authority:e.environment??Qsn,homeAccountId:e.homeAccountId,tenantId:e.tenantId||Usn,username:e.username,clientId:t,version:Tfn}}a(wfn,"msalToPublic");function s6t(t){let e=JSON.parse(t);if(e.version&&e.version!==Tfn)throw Error("Unsupported AuthenticationRecord version");return e}a(s6t,"deserializeAuthenticationRecord");p();p();p();p();p();p();function IBo(t,e){return e!=="Composite"&&e!=="Dictionary"&&(typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)!==null||t===void 0||t===null)}a(IBo,"isPrimitiveBody");function xBo(t){let e=Object.assign(Object.assign({},t.headers),t.body);return t.hasNullableType&&Object.getOwnPropertyNames(e).length===0?t.shouldWrapBody?{body:null}:null:t.shouldWrapBody?Object.assign(Object.assign({},t.headers),{body:t.body}):e}a(xBo,"handleNullableResponseAndWrappableBody");function a6t(t,e){var r,n;let o=t.parsedHeaders;if(t.request.method==="HEAD")return Object.assign(Object.assign({},o),{body:t.parsedBody});let s=e&&e.bodyMapper,c=!!s?.nullable,l=s?.type.name;if(l==="Stream")return Object.assign(Object.assign({},o),{blobBody:t.blobBody,readableStreamBody:t.readableStreamBody});let u=l==="Composite"&&s.type.modelProperties||{},d=Object.keys(u).some(f=>u[f].serializedName==="");if(l==="Sequence"||d){let f=(r=t.parsedBody)!==null&&r!==void 0?r:[];for(let h of Object.keys(u))u[h].serializedName&&(f[h]=(n=t.parsedBody)===null||n===void 0?void 0:n[h]);if(o)for(let h of Object.keys(o))f[h]=o[h];return c&&!t.parsedBody&&!o&&Object.getOwnPropertyNames(u).length===0?null:f}return xBo({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:IBo(t.parsedBody,l)})}a(a6t,"flattenResponse");var TO={Base64Url:"Base64Url",Boolean:"Boolean",ByteArray:"ByteArray",Composite:"Composite",Date:"Date",DateTime:"DateTime",DateTimeRfc1123:"DateTimeRfc1123",Dictionary:"Dictionary",Enum:"Enum",Number:"Number",Object:"Object",Sequence:"Sequence",String:"String",Stream:"Stream",TimeSpan:"TimeSpan",UnixTime:"UnixTime"};p();p();p();p();p();var IO=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var Rfn=require("node:os"),kfn=fe(require("node:util"),1),Pfn=fe(require("node:process"),1);function Dfn(t,...e){Pfn.stderr.write(`${kfn.default.format(t,...e)}${Rfn.EOL}`)}a(Dfn,"log");var Nfn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Mfn,c6t=[],l6t=[],hVe=[];Nfn&&u6t(Nfn);var Ofn=Object.assign(t=>Lfn(t),{enable:u6t,enabled:d6t,disable:wBo,log:Dfn});function u6t(t){Mfn=t,c6t=[],l6t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?l6t.push(new RegExp(`^${n.substr(1)}$`)):c6t.push(new RegExp(`^${n}$`));for(let n of hVe)n.enabled=d6t(n.namespace)}a(u6t,"enable");function d6t(t){if(t.endsWith("*"))return!0;for(let e of l6t)if(e.test(t))return!1;for(let e of c6t)if(e.test(t))return!0;return!1}a(d6t,"enabled");function wBo(){let t=Mfn||"";return u6t(""),t}a(wBo,"disable");function Lfn(t){let e=Object.assign(r,{enabled:d6t(t),destroy:RBo,log:Ofn.log,namespace:t,extend:kBo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),hVe.push(e),e}a(Lfn,"createDebugger");function RBo(){let t=hVe.indexOf(this);return t>=0?(hVe.splice(t,1),!0):!1}a(RBo,"destroy");function kBo(t){let e=Lfn(`${this.namespace}:${t}`);return e.log=this.log,e}a(kBo,"extend");var Fle=Ofn;var f6t=["verbose","info","warning","error"],Bfn={verbose:400,info:300,warning:200,error:100};function Ffn(t,e){e.log=(...r)=>{t.log(...r)}}a(Ffn,"patchLogMethod");function Ufn(t){return f6t.includes(t)}a(Ufn,"isTypeSpecRuntimeLogLevel");function PBo(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=Fle(t.namespace);o.log=(...f)=>{Fle.log(...f)};function s(f){if(f&&!Ufn(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${f6t.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);Fle.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(Ufn(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${f6t.join(", ")}.`));function c(f){return!!(n&&Bfn[f.level]<=Bfn[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(Ffn(f,m),c(m)){let g=Fle.disable();Fle.enable(g+","+m.namespace)}return e.add(m),m}a(l,"createLogger");function u(){return n}a(u,"contextGetLogLevel");function d(f){let h=o.extend(f);return Ffn(o,h),{error:l(h,"error"),warning:l(h,"warning"),info:l(h,"info"),verbose:l(h,"verbose")}}return a(d,"contextCreateClientLogger"),{setLogLevel:s,getLogLevel:u,createClientLogger:d,logger:o}}a(PBo,"createLoggerContext");var Qfn=PBo({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),DBo=Qfn.logger;function KIe(t){return Qfn.createClientLogger(t)}a(KIe,"createClientLogger");p();function mVe(t){return t.toLowerCase()}a(mVe,"normalizeName");function*NBo(t){for(let e of t.values())yield[e.name,e.value]}a(NBo,"headerIterator");var p6t=class{static{a(this,"HttpHeadersImpl")}constructor(e){if(this._headersMap=new Map,e)for(let r of Object.keys(e))this.set(r,e[r])}set(e,r){this._headersMap.set(mVe(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(mVe(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(mVe(e))}delete(e){this._headersMap.delete(mVe(e))}toJSON(e={}){let r={};if(e.preserveCase)for(let n of this._headersMap.values())r[n.name]=n.value;else for(let[n,o]of this._headersMap)r[n]=o.value;return r}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return NBo(this._headersMap)}};function V1(t){return new p6t(t)}a(V1,"createHttpHeaders");p();p();p();var h6t=class{static{a(this,"PipelineRequestImpl")}constructor(e){var r,n,o,s,c,l,u;this.url=e.url,this.body=e.body,this.headers=(r=e.headers)!==null&&r!==void 0?r:V1(),this.method=(n=e.method)!==null&&n!==void 0?n:"GET",this.timeout=(o=e.timeout)!==null&&o!==void 0?o:0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=(s=e.disableKeepAlive)!==null&&s!==void 0?s:!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=(c=e.withCredentials)!==null&&c!==void 0?c:!1,this.abortSignal=e.abortSignal,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||Ole(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1,this.requestOverrides=e.requestOverrides,this.authSchemes=e.authSchemes}};function gVe(t){return new h6t(t)}a(gVe,"createPipelineRequest");p();var qfn=new Set(["Deserialize","Serialize","Retry","Sign"]),m6t=class t{static{a(this,"HttpPipeline")}constructor(e){var r;this._policies=[],this._policies=(r=e?.slice(0))!==null&&r!==void 0?r:[],this._orderedPolicies=void 0}addPolicy(e,r={}){if(r.phase&&r.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(r.phase&&!qfn.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!qfn.has(r.afterPhase))throw new Error(`Invalid afterPhase name: ${r.afterPhase}`);this._policies.push({policy:e,options:r}),this._orderedPolicies=void 0}removePolicy(e){let r=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(r.push(n.policy),!1):!0),this._orderedPolicies=void 0,r}sendRequest(e,r){return this.getOrderedPolicies().reduceRight((s,c)=>l=>c.sendRequest(l,s),s=>e.sendRequest(s))(r)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],r=new Map;function n(A){return{name:A,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}a(n,"createPhase");let o=n("Serialize"),s=n("None"),c=n("Deserialize"),l=n("Retry"),u=n("Sign"),d=[o,s,c,l,u];function f(A){return A==="Retry"?l:A==="Serialize"?o:A==="Deserialize"?c:A==="Sign"?u:s}a(f,"getPhase");for(let A of this._policies){let y=A.policy,_=A.options,E=y.name;if(r.has(E))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};_.afterPhase&&(v.afterPhase=f(_.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(E,v),f(_.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:_}=A,E=y.name,v=r.get(E);if(!v)throw new Error(`Missing node for policy ${E}`);if(_.afterPolicies)for(let S of _.afterPolicies){let T=r.get(S);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(_.beforePolicies)for(let S of _.beforePolicies){let T=r.get(S);T&&(T.dependsOn.add(v),v.dependants.add(T))}}function h(A){A.hasRun=!0;for(let y of A.policies)if(!(y.afterPhase&&(!y.afterPhase.hasRun||y.afterPhase.policies.size))&&y.dependsOn.size===0){e.push(y.policy);for(let _ of y.dependants)_.dependsOn.delete(y);r.delete(y.policy.name),A.policies.delete(y)}}a(h,"walkPhase");function m(){for(let A of d){if(h(A),A.policies.size>0&&A!==s){s.hasRun||h(s);return}A.hasAfterPolicies&&h(s)}}a(m,"walkPhases");let g=0;for(;r.size>0;){g++;let A=e.length;if(m(),e.length<=A&&g>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function AVe(){return m6t.create()}a(AVe,"createEmptyPipeline");p();p();var jfn=require("node:util"),Hfn=jfn.inspect.custom;var MBo=new zP,LA=class t extends Error{static{a(this,"RestError")}constructor(e,r={}){super(e),this.name="RestError",this.code=r.code,this.statusCode=r.statusCode,Object.defineProperty(this,"request",{value:r.request,enumerable:!1}),Object.defineProperty(this,"response",{value:r.response,enumerable:!1}),Object.defineProperty(this,Hfn,{value:a(()=>`RestError: ${this.message} + ${MBo.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};LA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";LA.PARSE_ERROR="PARSE_ERROR";function yVe(t){return t instanceof LA?!0:vK(t)&&t.name==="RestError"}a(yVe,"isRestError");p();p();var Ule=fe(require("node:http"),1),Qle=fe(require("node:https"),1),EVe=fe(require("node:zlib"),1),$fn=require("node:stream");p();var nw=KIe("ts-http-runtime");var OBo={};function JIe(t){return t&&typeof t.pipe=="function"}a(JIe,"isReadableStream");function Gfn(t){return t.readable===!1?Promise.resolve():new Promise(e=>{let r=a(()=>{e(),t.removeListener("close",r),t.removeListener("end",r),t.removeListener("error",r)},"handler");t.on("close",r),t.on("end",r),t.on("error",r)})}a(Gfn,"isStreamComplete");function Vfn(t){return t&&typeof t.byteLength=="number"}a(Vfn,"isArrayBuffer");var _Ve=class extends $fn.Transform{static{a(this,"ReportTransform")}_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(o){n(o)}}constructor(e){super(),this.loadedBytes=0,this.progressCallback=e}},g6t=class{static{a(this,"NodeHttpClient")}constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(e){var r,n,o;let s=new AbortController,c;if(e.abortSignal){if(e.abortSignal.aborted)throw new IO("The operation was aborted. Request has already been canceled.");c=a(m=>{m.type==="abort"&&s.abort()},"abortListener"),e.abortSignal.addEventListener("abort",c)}let l;e.timeout>0&&(l=setTimeout(()=>{let m=new zP;nw.info(`request to '${m.sanitizeUrl(e.url)}' timed out. canceling...`),s.abort()},e.timeout));let u=e.headers.get("Accept-Encoding"),d=u?.includes("gzip")||u?.includes("deflate"),f=typeof e.body=="function"?e.body():e.body;if(f&&!e.headers.has("Content-Length")){let m=UBo(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let E=e.onUploadProgress,v=new _Ve(E);v.on("error",S=>{nw.error("Error in upload progress",S)}),JIe(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=LBo(m),y={status:(r=m.statusCode)!==null&&r!==void 0?r:0,headers:g,request:e};if(e.method==="HEAD")return m.resume(),y;h=d?BBo(m,g):m;let _=e.onDownloadProgress;if(_){let E=new _Ve(_);E.on("error",v=>{nw.error("Error in download progress",v)}),h.pipe(E),h=E}return!((n=e.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((o=e.streamResponseStatusCodes)===null||o===void 0)&&o.has(y.status)?y.readableStreamBody=h:y.bodyAsText=await FBo(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();JIe(f)&&(m=Gfn(f));let g=Promise.resolve();JIe(h)&&(g=Gfn(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{nw.warning("Error when cleaning up abortListener on httpRequest",A)})}}}makeRequest(e,r,n){var o;let s=new URL(e.url),c=s.protocol!=="https:";if(c&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let l=(o=e.agent)!==null&&o!==void 0?o:this.getOrCreateAgent(e,c),u=Object.assign({agent:l,hostname:s.hostname,path:`${s.pathname}${s.search}`,port:s.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0})},e.requestOverrides);return new Promise((d,f)=>{let h=c?Ule.request(u,d):Qle.request(u,d);h.once("error",m=>{var g;f(new LA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:LA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new IO("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&JIe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):Vfn(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(nw.error("Unrecognized body type",n),f(new LA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?Ule.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new Ule.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return Qle.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:OBo,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(nw.info("No cached TLS Agent exist, creating a new Agent"),c=new Qle.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function LBo(t){let e=V1();for(let r of Object.keys(t.headers)){let n=t.headers[r];Array.isArray(n)?n.length>0&&e.set(r,n[0]):n&&e.set(r,n)}return e}a(LBo,"getResponseHeaders");function BBo(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=EVe.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=EVe.createInflate();return t.pipe(n),n}return t}a(BBo,"getDecodedResponseStream");function FBo(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{Buffer.isBuffer(o)?n.push(o):n.push(Buffer.from(o))}),t.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),t.on("error",o=>{o&&o?.name==="AbortError"?r(o):r(new LA(`Error reading response as text: ${o.message}`,{code:LA.PARSE_ERROR}))})})}a(FBo,"streamToText");function UBo(t){return t?Buffer.isBuffer(t)?t.length:JIe(t)?null:Vfn(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(UBo,"getBodyLength");function Wfn(){return new g6t}a(Wfn,"createNodeHttpClient");function vVe(){return Wfn()}a(vVe,"createDefaultHttpClient");p();p();p();p();var A6t="logPolicy";function CVe(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:nw.info,n=new zP({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:A6t,async sendRequest(o,s){if(!r.enabled)return s(o);r(`Request: ${n.sanitize(o)}`);let c=await s(o);return r(`Response status code: ${c.status}`),r(`Headers: ${n.sanitize(c.headers)}`),c}}}a(CVe,"logPolicy");p();var y6t="redirectPolicy",zfn=["GET","HEAD"];function bVe(t={}){let{maxRetries:e=20}=t;return{name:y6t,async sendRequest(r,n){let o=await n(r);return Yfn(n,o,e)}}}a(bVe,"redirectPolicy");async function Yfn(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&zfn.includes(o.method)||s===302&&zfn.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new IO(r?.abortErrorMsg?r?.abortErrorMsg:QBo)),"rejectOnAbort"),u=a(()=>{r?.abortSignal&&c&&r.abortSignal.removeEventListener("abort",c)},"removeListeners");if(c=a(()=>(s&&clearTimeout(s),u(),l()),"onAborted"),r?.abortSignal&&r.abortSignal.aborted)return l();s=setTimeout(()=>{u(),n(e)},t),r?.abortSignal&&r.abortSignal.addEventListener("abort",c)})}a(Zfn,"delay");function Xfn(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Xfn,"parseHeaderValueAsNumber");var E6t="Retry-After",qBo=["retry-after-ms","x-ms-retry-after-ms",E6t];function epn(t){if(t&&[429,503].includes(t.status))try{for(let o of qBo){let s=Xfn(t,o);if(s===0||s)return s*(o===E6t?1e3:1)}let e=t.headers.get(E6t);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(epn,"getRetryAfterInMs");function tpn(t){return Number.isFinite(epn(t))}a(tpn,"isThrottlingRetryResponse");function v6t(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=epn(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(v6t,"throttlingRetryStrategy");var jBo=1e3,HBo=1e3*64;function TVe(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:jBo,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:HBo;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=$Bo(l),d=u&&t.ignoreSystemErrors,f=GBo(c),h=f&&t.ignoreHttpStatusCodes;return c&&(tpn(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:WIe(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(TVe,"exponentialRetryStrategy");function GBo(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(GBo,"isExponentialRetryResponse");function $Bo(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a($Bo,"isSystemError");p();var VBo=KIe("ts-http-runtime retryPolicy"),WBo="retryPolicy";function QQ(t,e={maxRetries:3}){let r=e.logger||VBo;return{name:WBo,async sendRequest(n,o){var s,c;let l,u,d=-1;e:for(;;){d+=1,l=void 0,u=void 0;try{r.info(`Retry ${d}: Attempting to send request`,n.requestId),l=await o(n),r.info(`Retry ${d}: Received a response from request`,n.requestId)}catch(f){if(r.error(`Retry ${d}: Received an error from request`,n.requestId),u=f,!f||u.name!=="RestError")throw f;l=u.response}if(!((s=n.abortSignal)===null||s===void 0)&&s.aborted)throw r.error(`Retry ${d}: Request aborted.`),new IO;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:3)){if(r.info(`Retry ${d}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),u)throw u;if(l)return l;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${d}: Processing ${t.length} retry strategies.`);t:for(let f of t){let h=f.logger||r;h.info(`Retry ${d}: Processing retry strategy ${f.name}.`);let m=f.retry({retryCount:d,response:l,responseError:u});if(m.skipStrategy){h.info(`Retry ${d}: Skipped.`);continue t}let{errorToThrow:g,retryAfterInMs:A,redirectTo:y}=m;if(g)throw h.error(`Retry ${d}: Retry strategy ${f.name} throws error:`,g),g;if(A||A===0){h.info(`Retry ${d}: Retry strategy ${f.name} retries after ${A}`),await Zfn(A,void 0,{abortSignal:n.abortSignal});continue e}if(y){h.info(`Retry ${d}: Retry strategy ${f.name} redirects to ${y}`),n.url=y;continue e}}if(u)throw r.info("None of the retry strategies could work with the received error. Throwing it."),u;if(l)return r.info("None of the retry strategies could work with the received response. Returning it."),l}}}}a(QQ,"retryPolicy");var C6t="defaultRetryPolicy";function IVe(t={}){var e;return{name:C6t,sendRequest:QQ([v6t(),TVe(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(IVe,"defaultRetryPolicy");p();var b6t="formDataPolicy";function zBo(t){var e;let r={};for(let[n,o]of t.entries())(e=r[n])!==null&&e!==void 0||(r[n]=[]),r[n].push(o);return r}a(zBo,"formDataToFormDataMap");function xVe(){return{name:b6t,async sendRequest(t,e){if(UQ&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=zBo(t.body),t.body=void 0),t.formData){let r=t.headers.get("Content-Type");r&&r.indexOf("application/x-www-form-urlencoded")!==-1?t.body=YBo(t.formData):await KBo(t.formData,t),t.formData=void 0}return e(t)}}}a(xVe,"formDataPolicy");function YBo(t){let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.append(r,o.toString());else e.append(r,n.toString());return e.toString()}a(YBo,"wwwFormUrlEncode");async function KBo(t,e){let r=e.headers.get("Content-Type");if(r&&!r.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",r??"multipart/form-data");let n=[];for(let[o,s]of Object.entries(t))for(let c of Array.isArray(s)?s:[s])if(typeof c=="string")n.push({headers:V1({"Content-Disposition":`form-data; name="${o}"`}),body:VC(c,"utf-8")});else{if(c==null||typeof c!="object")throw new Error(`Unexpected value for key ${o}: ${c}. Value should be serialized to string first.`);{let l=c.name||"blob",u=V1();u.set("Content-Disposition",`form-data; name="${o}"; filename="${l}"`),u.set("Content-Type",c.type||"application/octet-stream"),n.push({headers:u,body:c})}}e.multipartBody={parts:n}}a(KBo,"prepareFormData");p();var Ipn=fe(P6t(),1),xpn=fe(D6t(),1);var G3o="HTTPS_PROXY",$3o="HTTP_PROXY",V3o="ALL_PROXY",W3o="NO_PROXY",N6t="proxyPolicy",bpn=[],wpn=!1,z3o=new Map;function OVe(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(OVe,"getEnvironmentValue");function Y3o(){if(!process)return;let t=OVe(G3o),e=OVe(V3o),r=OVe($3o);return t||e||r}a(Y3o,"loadEnvironmentProxyValue");function K3o(t,e,r){if(e.length===0)return!1;let n=new URL(t).hostname;if(r?.has(n))return r.get(n);let o=!1;for(let s of e)s[0]==="."?(n.endsWith(s)||n.length===s.length-1&&n===s.slice(1))&&(o=!0):n===s&&(o=!0);return r?.set(n,o),o}a(K3o,"isBypassed");function J3o(){let t=OVe(W3o);return wpn=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(J3o,"loadNoProxy");function Z3o(){let t=Y3o();return t?new URL(t):void 0}a(Z3o,"getDefaultProxySettingsInternal");function Spn(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}a(Spn,"getUrlFromProxySettings");function Tpn(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&nw.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let s=t.headers.toJSON();o?(e.httpProxyAgent||(e.httpProxyAgent=new xpn.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new Ipn.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(Tpn,"setProxyAgentOnRequest");function LVe(t,e){wpn||bpn.push(...J3o());let r=t?Spn(t):Z3o(),n={};return{name:N6t,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!K3o(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:bpn,e?.customNoProxyList?void 0:z3o)?Tpn(o,n,r):o.proxySettings&&Tpn(o,n,Spn(o.proxySettings)),s(o)}}}a(LVe,"proxyPolicy");p();var M6t="agentPolicy";function BVe(t){return{name:M6t,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(BVe,"agentPolicy");p();var O6t="tlsPolicy";function FVe(t){return{name:O6t,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(FVe,"tlsPolicy");p();p();function UVe(t){return typeof t.stream=="function"}a(UVe,"isBlob");p();Y3();var GVe=require("stream");function ehn(){return XIe(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield Y1(e.read());if(r)return yield Y1(void 0);yield yield Y1(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(ehn,"streamAsyncIterator");function rFo(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=ehn.bind(t)),t.values||(t.values=ehn.bind(t))}a(rFo,"makeAsyncIterable");function thn(t){return t instanceof ReadableStream?(rFo(t),GVe.Readable.fromWeb(t)):t}a(thn,"ensureNodeStream");function nFo(t){return t instanceof Uint8Array?GVe.Readable.from(Buffer.from(t)):UVe(t)?thn(t.stream()):thn(t)}a(nFo,"toStream");async function rhn(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(nFo);return GVe.Readable.from((function(){return XIe(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,HVe(d)),u;u=yield Y1(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield Y1(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield Y1(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(rhn,"concat");function iFo(){return`----AzSDKFormBoundary${Ole()}`}a(iFo,"generateBoundary");function oFo(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r +`;return e}a(oFo,"encodeHeaders");function sFo(t){return t instanceof Uint8Array?t.byteLength:UVe(t)?t.size===-1?void 0:t.size:void 0}a(sFo,"getLength");function aFo(t){let e=0;for(let r of t){let n=sFo(r);if(n===void 0)return;e+=n}return e}a(aFo,"getTotalLength");async function cFo(t,e,r){let n=[VC(`--${r}`,"utf-8"),...e.flatMap(s=>[VC(`\r +`,"utf-8"),VC(oFo(s.headers),"utf-8"),VC(`\r `,"utf-8"),s.body,VC(`\r --${r}`,"utf-8")]),VC(`--\r \r -`,"utf-8")],o=oFo(n);o&&t.headers.set("Content-Length",o),t.body=await thn(n)}a(sFo,"buildRequestBody");var exe="multipartPolicy",aFo=70,cFo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function lFo(t){if(t.length>aFo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!cFo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(lFo,"assertValidBoundary");function $Ve(){return{name:exe,async sendRequest(t,e){var r;if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,o=(r=t.headers.get("Content-Type"))!==null&&r!==void 0?r:"multipart/mixed",s=o.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!s)throw new Error(`Got multipart request body, but content-type header was not multipart: ${o}`);let[,c,l]=s;if(l&&n&&l!==n)throw new Error(`Multipart boundary was specified as ${l} in the header, but got ${n} in the request body`);return n??(n=l),n?lFo(n):n=rFo(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await sFo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a($Ve,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function VVe(){return AVe()}a(VVe,"createEmptyPipeline");p();p();p();var wO=SQ("core-rest-pipeline");p();p();p();p();function U6t(t={}){return CVe(Object.assign({logger:wO.info},t))}a(U6t,"logPolicy");p();function Q6t(t={}){return bVe(t)}a(Q6t,"redirectPolicy");p();p();p();var jle=fe(require("node:os"),1),WVe=fe(require("node:process"),1);function rhn(){return"User-Agent"}a(rhn,"getHeaderName");async function nhn(t){if(WVe&&WVe.versions){let e=WVe.versions;e.bun?t.set("Bun",e.bun):e.deno?t.set("Deno",e.deno):e.node&&t.set("Node",e.node)}t.set("OS",`(${jle.arch()}-${jle.type()}-${jle.release()})`)}a(nhn,"setPlatformSpecificData");p();var zVe="1.22.0";function yFo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(yFo,"getUserAgentString");function ihn(){return rhn()}a(ihn,"getUserAgentHeaderName");async function YVe(t){let e=new Map;e.set("core-rest-pipeline",zVe),await nhn(e);let r=yFo(e);return t?`${t} ${r}`:r}a(YVe,"getUserAgentValue");var ohn=ihn(),shn="userAgentPolicy";function q6t(t={}){let e=YVe(t.userAgentPrefix);return{name:shn,async sendRequest(r,n){return r.headers.has(ohn)||r.headers.set(ohn,await e),n(r)}}}a(q6t,"userAgentPolicy");p();p();var ahn=Symbol("rawContent");function j6t(t){return typeof t[ahn]=="function"}a(j6t,"hasRawContent");function chn(t){return j6t(t)?t[ahn]():t}a(chn,"getRawContent");var KVe=exe;function H6t(){let t=$Ve();return{name:KVe,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)j6t(n.body)&&(n.body=chn(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(H6t,"multipartPolicy");p();function G6t(){return SVe()}a(G6t,"decompressResponsePolicy");p();function $6t(t={}){return IVe(t)}a($6t,"defaultRetryPolicy");p();function V6t(){return xVe()}a(V6t,"formDataPolicy");p();function W6t(t,e){return LVe(t,e)}a(W6t,"proxyPolicy");p();var lhn="setClientRequestIdPolicy";function z6t(t="x-ms-client-request-id"){return{name:lhn,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(z6t,"setClientRequestIdPolicy");p();function Y6t(t){return BVe(t)}a(Y6t,"agentPolicy");p();function K6t(t){return FVe(t)}a(K6t,"tlsPolicy");p();p();var Hle=LA;function txe(t){return yVe(t)}a(txe,"isRestError");var uhn="tracingPolicy";function J6t(t={}){let e=YVe(t.userAgentPrefix),r=new zP({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=_Fo();return{name:uhn,async sendRequest(o,s){var c;if(!n)return s(o);let l=await e,u={"http.url":r.sanitizeUrl(o.url),"http.method":o.method,"http.user_agent":l,requestId:o.requestId};l&&(u["http.user_agent"]=l);let{span:d,tracingContext:f}=(c=EFo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return CFo(d,h),h}catch(h){throw vFo(d,h),h}}}}a(J6t,"tracingPolicy");function _Fo(){try{return qTe({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:zVe})}catch(t){wO.warning(`Error when creating the TracingClient: ${Ole(t)}`);return}}a(_Fo,"tryCreateTracingClient");function EFo(t,e,r){try{let{span:n,updatedOptions:o}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let s=t.createRequestHeaders(o.tracingOptions.tracingContext);for(let[c,l]of Object.entries(s))e.headers.set(c,l);return{span:n,tracingContext:o.tracingOptions.tracingContext}}catch(n){wO.warning(`Skipping creating a tracing span due to an error: ${Ole(n)}`);return}}a(EFo,"tryCreateSpan");function vFo(t,e){try{t.setStatus({status:"error",error:lVe(e)?e:void 0}),txe(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){wO.warning(`Skipping tracing span processing due to an error: ${Ole(r)}`)}}a(vFo,"tryProcessError");function CFo(t,e){try{t.setAttribute("http.status_code",e.status);let r=e.headers.get("x-ms-request-id");r&&t.setAttribute("serviceRequestId",r),e.status>=400&&t.setStatus({status:"error"}),t.end()}catch(r){wO.warning(`Skipping tracing span processing due to an error: ${Ole(r)}`)}}a(CFo,"tryProcessResponse");p();p();function JVe(t){if(t instanceof AbortSignal)return{abortSignal:t};if(t.aborted)return{abortSignal:AbortSignal.abort(t.reason)};let e=new AbortController,r=!0;function n(){r&&(t.removeEventListener("abort",o),r=!1)}a(n,"cleanup");function o(){e.abort(t.reason),n()}return a(o,"listener"),t.addEventListener("abort",o),{abortSignal:e.signal,cleanup:n}}a(JVe,"wrapAbortSignalLike");var bFo="wrapAbortSignalLikePolicy";function dhn(){return{name:bFo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=JVe(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(dhn,"wrapAbortSignalLikePolicy");function Z6t(t){var e;let r=VVe();return Lle&&(t.agent&&r.addPolicy(Y6t(t.agent)),t.tlsOptions&&r.addPolicy(K6t(t.tlsOptions)),r.addPolicy(W6t(t.proxyOptions)),r.addPolicy(G6t())),r.addPolicy(dhn()),r.addPolicy(V6t(),{beforePolicies:[KVe]}),r.addPolicy(q6t(t.userAgentOptions)),r.addPolicy(z6t((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(H6t(),{afterPhase:"Deserialize"}),r.addPolicy($6t(t.retryOptions),{phase:"Retry"}),r.addPolicy(J6t(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),Lle&&r.addPolicy(Q6t(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(U6t(t.loggingOptions),{afterPhase:"Sign"}),r}a(Z6t,"createPipelineFromOptions");p();function X6t(){let t=vVe();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?JVe(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a(X6t,"createDefaultHttpClient");p();function HQ(t){return V1(t)}a(HQ,"createHttpHeaders");p();function KP(t){return gVe(t)}a(KP,"createPipelineRequest");p();p();p();p();var TFo=SQ("core-rest-pipeline retryPolicy");function eUt(t,e={maxRetries:3}){return QQ(t,Object.assign({logger:TFo},e))}a(eUt,"retryPolicy");p();p();var IFo={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function xFo(t,e,r){async function n(){if(Date.now()t.getToken(u,d),"tryGetAccessToken"),s.retryIntervalInMs,(f=n?.expiresOnTimestamp)!==null&&f!==void 0?f:Date.now()).then(m=>(r=null,n=m,o=d.tenantId,n)).catch(m=>{throw r=null,n=null,o=void 0,m})),r}return a(l,"refresh"),async(u,d)=>{let f=!!d.claims,h=o!==d.tenantId;return f&&(n=null),h||f||c.mustRefresh?l(u,d):(c.shouldRefresh&&l(u,d),n)}}a(tUt,"createTokenCycler");var mhn="bearerTokenAuthenticationPolicy";async function ZVe(t,e){try{return[await e(t),void 0]}catch(r){if(txe(r)&&r.response)return[r.response,r];throw r}}a(ZVe,"trySendRequest");async function wFo(t){let{scopes:e,getAccessToken:r,request:n}=t,o={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions,enableCae:!0},s=await r(e,o);s&&t.request.headers.set("Authorization",`Bearer ${s.token}`)}a(wFo,"defaultAuthorizeRequest");function fhn(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(fhn,"isChallengeResponse");async function phn(t,e){var r;let{scopes:n}=t,o=await t.getAccessToken(n,{enableCae:!0,claims:e});return o?(t.request.headers.set("Authorization",`${(r=o.tokenType)!==null&&r!==void 0?r:"Bearer"} ${o.token}`),!0):!1}a(phn,"authorizeRequestOnCaeChallenge");function XVe(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||wO,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:wFo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?tUt(o):()=>Promise.resolve(null);return{name:mhn,async sendRequest(f,h){if(!f.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await u.authorizeRequest({scopes:Array.isArray(s)?s:[s],request:f,getAccessToken:d,logger:l});let m,g,A;if([m,g]=await ZVe(f,h),fhn(m)){let y=hhn(m.headers.get("WWW-Authenticate"));if(y){let _;try{_=atob(y)}catch{return l.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${y}`),m}A=await phn({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},_),A&&([m,g]=await ZVe(f,h))}else if(u.authorizeRequestOnChallenge&&(A=await u.authorizeRequestOnChallenge({scopes:Array.isArray(s)?s:[s],request:f,response:m,getAccessToken:d,logger:l}),A&&([m,g]=await ZVe(f,h)),fhn(m)&&(y=hhn(m.headers.get("WWW-Authenticate")),y))){let _;try{_=atob(y)}catch{return l.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${y}`),m}A=await phn({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},_),A&&([m,g]=await ZVe(f,h))}}if(g)throw g;return m}}}a(XVe,"bearerTokenAuthenticationPolicy");function RFo(t){let e=/(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g,r=/(\w+)="([^"]*)"/g,n=[],o;for(;(o=e.exec(t))!==null;){let s=o[1],c=o[2],l={},u;for(;(u=r.exec(c))!==null;)l[u[1]]=u[2];n.push({scheme:s,params:l})}return n}a(RFo,"parseChallenges");function hhn(t){var e;return t?(e=RFo(t).find(n=>n.scheme==="Bearer"&&n.params.claims&&n.params.error==="insufficient_claims"))===null||e===void 0?void 0:e.params.claims:void 0}a(hhn,"getCaeChallengeClaims");p();p();p();p();p();p();var Ahn=fe(ghn(),1),rUt=Ahn.state;function GQ(t,e,r){let n=e.parameterPath,o=e.mapper,s;if(typeof n=="string"&&(n=[n]),Array.isArray(n)){if(n.length>0)if(o.isConstant)s=o.defaultValue;else{let c=yhn(t,n);!c.propertyFound&&r&&(c=yhn(r,n));let l=!1;c.propertyFound||(l=o.required||n[0]==="options"&&n.length===2),s=l?o.defaultValue:c.propertyValue}}else{o.required&&(s={});for(let c in n){let l=o.type.modelProperties[c],u=n[c],d=GQ(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(GQ,"getOperationArgumentValueFromParameter");function yhn(t,e){let r={propertyFound:!1},n=0;for(;n=200&&r.status<300);u.headersMapper&&(s.parsedHeaders=l.serializer.deserialize(u.headersMapper,s.headers.toJSON(),"operationRes.parsedHeaders",{xml:{},ignoreUnknownProperties:!0}))}return s}a(OFo,"deserializeResponseBody");function LFo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(LFo,"isOperationSpecEmpty");function BFo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(LFo(e)?s:!!r)if(r){if(!r.isError)return{error:null,shouldReturnResponse:!1}}else return{error:null,shouldReturnResponse:!1};let l=r??e.responses.default,u=!((o=t.request.streamResponseStatusCodes)===null||o===void 0)&&o.has(t.status)?`Unexpected status code: ${t.status}`:t.bodyAsText,d=new Hle(u,{statusCode:t.status,request:t.request,response:t});if(!l)throw d;let f=l.bodyMapper,h=l.headersMapper;try{if(t.parsedBody){let m=t.parsedBody,g;if(f){let y=m;if(e.isXML&&f.type.name===TO.Sequence){y=[];let _=f.xmlElementName;typeof m=="object"&&_&&(y=m[_])}g=e.serializer.deserialize(f,y,"error.response.parsedBody",n)}let A=m.error||g||m;d.code=A.code,A.message&&(d.message=A.message),f&&(d.response.parsedBody=g)}t.headers&&h&&(d.response.parsedHeaders=e.serializer.deserialize(h,t.headers.toJSON(),"operationRes.parsedHeaders"))}catch(m){d.message=`Error "${m.message}" occurred in deserializing the responseBody - "${t.bodyAsText}" for the default response.`}return{error:d,shouldReturnResponse:!1}}a(BFo,"handleErrorResponse");async function FFo(t,e,r,n,o){var s;if(!(!((s=r.request.streamResponseStatusCodes)===null||s===void 0)&&s.has(r.status))&&r.bodyAsText){let c=r.bodyAsText,l=r.headers.get("Content-Type")||"",u=l?l.split(";").map(d=>d.toLowerCase()):[];try{if(u.length===0||u.some(d=>t.indexOf(d)!==-1))return r.parsedBody=JSON.parse(c),r;if(u.some(d=>e.indexOf(d)!==-1)){if(!o)throw new Error("Parsing XML not supported.");let d=await o(c,n.xml);return r.parsedBody=d,r}}catch(d){let f=`Error "${d}" occurred while parsing the response body - ${r.bodyAsText}.`,h=d.code||Hle.PARSE_ERROR;throw new Hle(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a(FFo,"parse");p();p();function vhn(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===TO.Stream&&e.add(Number(r))}return e}a(vhn,"getStreamingResponseStatusCodes");function RO(t){let{parameterPath:e,mapper:r}=t,n;return typeof e=="string"?n=e:Array.isArray(e)?n=e.join("."):n=r.serializedName,n}a(RO,"getPathStringFromParameter");var Chn="serializationPolicy";function iUt(t={}){let e=t.stringifyXML;return{name:Chn,async sendRequest(r,n){let o=K3(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&(UFo(r,c,s),QFo(r,c,s,e)),n(r)}}}a(iUt,"serializationPolicy");function UFo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=GQ(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,RO(c));let u=c.mapper.headerCollectionPrefix;if(u)for(let d of Object.keys(l))t.headers.set(u+d,l[d]);else t.headers.set(c.mapper.serializedName||RO(c),l)}}let s=(o=(n=e.options)===null||n===void 0?void 0:n.requestOptions)===null||o===void 0?void 0:o.customHeaders;if(s)for(let c of Object.keys(s))t.headers.set(c,s[c])}a(UFo,"serializeHeaders");function QFo(t,e,r,n=function(){throw new Error("XML serialization unsupported!")}){var o,s,c,l,u;let d=(o=e.options)===null||o===void 0?void 0:o.serializerOptions,f={xml:{rootName:(s=d?.xml.rootName)!==null&&s!==void 0?s:"",includeRoot:(c=d?.xml.includeRoot)!==null&&c!==void 0?c:!1,xmlCharKey:(l=d?.xml.xmlCharKey)!==null&&l!==void 0?l:"_"}},h=f.xml.xmlCharKey;if(r.requestBody&&r.requestBody.mapper){t.body=GQ(e,r.requestBody);let m=r.requestBody.mapper,{required:g,serializedName:A,xmlName:y,xmlElementName:_,xmlNamespace:E,xmlNamespacePrefix:v,nullable:S}=m,T=m.type.name;try{if(t.body!==void 0&&t.body!==null||S&&t.body===null||g){let w=RO(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===TO.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",k=qFo(E,x,T,t.body,f);T===TO.Sequence?t.body=n(jFo(k,_||y||A,x,E),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(k,{rootName:y||A,xmlCharKey:h}))}else{if(T===TO.String&&(!((u=r.contentType)===null||u===void 0)&&u.match("text/plain")||r.mediaType==="text"))return;R||(t.body=JSON.stringify(t.body))}}}catch(w){throw new Error(`Error "${w.message}" occurred in serializing the payload - ${JSON.stringify(A,void 0," ")}.`)}}else if(r.formDataParameters&&r.formDataParameters.length>0){t.formData={};for(let m of r.formDataParameters){let g=GQ(e,m);if(g!=null){let A=m.mapper.serializedName||RO(m);t.formData[A]=r.serializer.serialize(m.mapper,g,RO(m),f)}}}}a(QFo,"serializeRequestBody");function qFo(t,e,r,n,o){if(t&&!["Composite","Sequence","Dictionary"].includes(r)){let s={};return s[o.xml.xmlCharKey]=n,s["$"]={[e]:t},s}return n}a(qFo,"getXmlValueWithNamespace");function jFo(t,e,r,n){if(Array.isArray(t)||(t=[t]),!r||!n)return{[e]:t};let o={[e]:t};return o["$"]={[r]:n},o}a(jFo,"prepareXMLRootList");function oUt(t={}){let e=Z6t(t??{});return t.credentialOptions&&e.addPolicy(XVe({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(iUt(t.serializationOptions),{phase:"Serialize"}),e.addPolicy(nUt(t.deserializationOptions),{phase:"Deserialize"}),e}a(oUt,"createClientPipeline");p();var sUt;function bhn(){return sUt||(sUt=X6t()),sUt}a(bhn,"getCachedDefaultHttpClient");p();var HFo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function Thn(t,e,r,n){let o=GFo(e,r,n),s=!1,c=Shn(t,o);if(e.path){let d=Shn(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),$Fo(d)?(c=d,s=!0):c=VFo(c,d)}let{queryParams:l,sequenceParams:u}=WFo(e,r,n);return c=YFo(c,l,u,s),c}a(Thn,"getRequestUrl");function Shn(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(Shn,"replaceAll");function GFo(t,e,r){var n;let o=new Map;if(!((n=t.urlParameters)===null||n===void 0)&&n.length)for(let s of t.urlParameters){let c=GQ(e,s,r),l=RO(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(GFo,"calculateUrlReplacements");function $Fo(t){return t.includes("://")}a($Fo,"isAbsoluteUrl");function VFo(t,e){if(!e)return t;let r=new URL(t),n=r.pathname;n.endsWith("/")||(n=`${n}/`),e.startsWith("/")&&(e=e.substring(1));let o=e.indexOf("?");if(o!==-1){let s=e.substring(0,o),c=e.substring(o+1);n=n+s,c&&(r.search=r.search?`${r.search}&${c}`:c)}else n=n+e;return r.pathname=n,r.toString()}a(VFo,"appendPath");function WFo(t,e,r){var n;let o=new Map,s=new Set;if(!((n=t.queryParameters)===null||n===void 0)&&n.length)for(let c of t.queryParameters){c.mapper.type.name==="Sequence"&&c.mapper.serializedName&&s.add(c.mapper.serializedName);let l=GQ(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,RO(c));let u=c.collectionFormat?HFo[c.collectionFormat]:"";if(Array.isArray(l)&&(l=l.map(d=>d??"")),c.collectionFormat==="Multi"&&l.length===0)continue;Array.isArray(l)&&(c.collectionFormat==="SSV"||c.collectionFormat==="TSV")&&(l=l.join(u)),c.skipEncoding||(Array.isArray(l)?l=l.map(d=>encodeURIComponent(d)):l=encodeURIComponent(l)),Array.isArray(l)&&(c.collectionFormat==="CSV"||c.collectionFormat==="Pipes")&&(l=l.join(u)),o.set(c.mapper.serializedName||RO(c),l)}}return{queryParams:o,sequenceParams:s}}a(WFo,"calculateQueryParameters");function zFo(t){let e=new Map;if(!t||t[0]!=="?")return e;t=t.slice(1);let r=t.split("&");for(let n of r){let[o,s]=n.split("=",2),c=e.get(o);c?Array.isArray(c)?c.push(s):e.set(o,[c,s]):e.set(o,s)}return e}a(zFo,"simpleParseQueryParams");function YFo(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=zFo(o.search);for(let[l,u]of e){let d=s.get(l);if(Array.isArray(d))if(Array.isArray(u)){d.push(...u);let f=new Set(d);s.set(l,Array.from(f))}else d.push(u);else d?(Array.isArray(u)?u.unshift(d):r.has(l)&&s.set(l,[d,u]),n||s.set(l,u)):s.set(l,u)}let c=[];for(let[l,u]of s)if(typeof u=="string")c.push(`${l}=${u}`);else if(Array.isArray(u))for(let d of u)c.push(`${l}=${d}`);else c.push(`${l}=${u}`);return o.search=c.length?`?${c.join("&")}`:"",o.toString()}a(YFo,"appendQueryParams");p();var aUt=SQ("core-client");var rxe=class{static{a(this,"ServiceClient")}constructor(e={}){var r,n;if(this._requestContentType=e.requestContentType,this._endpoint=(r=e.endpoint)!==null&&r!==void 0?r:e.baseUri,e.baseUri&&aUt.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||bhn(),this.pipeline=e.pipeline||KFo(e),!((n=e.additionalPolicies)===null||n===void 0)&&n.length)for(let{policy:o,position:s}of e.additionalPolicies){let c=s==="perRetry"?"Sign":void 0;this.pipeline.addPolicy(o,{afterPhase:c})}}async sendRequest(e){return this.pipeline.sendRequest(this._httpClient,e)}async sendOperationRequest(e,r){let n=r.baseUrl||this._endpoint;if(!n)throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.");let o=Thn(n,r,e,this),s=KP({url:o});s.method=r.httpMethod;let c=K3(s);c.operationSpec=r,c.operationArguments=e;let l=r.contentType||this._requestContentType;l&&r.requestBody&&s.headers.set("Content-Type",l);let u=e.options;if(u){let d=u.requestOptions;d&&(d.timeout&&(s.timeout=d.timeout),d.onUploadProgress&&(s.onUploadProgress=d.onUploadProgress),d.onDownloadProgress&&(s.onDownloadProgress=d.onDownloadProgress),d.shouldDeserialize!==void 0&&(c.shouldDeserialize=d.shouldDeserialize),d.allowInsecureConnection&&(s.allowInsecureConnection=!0)),u.abortSignal&&(s.abortSignal=u.abortSignal),u.tracingOptions&&(s.tracingOptions=u.tracingOptions)}this._allowInsecureConnection&&(s.allowInsecureConnection=!0),s.streamResponseStatusCodes===void 0&&(s.streamResponseStatusCodes=vhn(r));try{let d=await this.sendRequest(s),f=s6t(d,r.responses[d.status]);return u?.onResponse&&u.onResponse(d,f),f}catch(d){if(typeof d=="object"&&d?.response){let f=d.response,h=s6t(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function KFo(t){let e=JFo(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return oUt(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(KFo,"createDefaultPipeline");function JFo(t){if(t.credentialScopes)return t.credentialScopes;if(t.endpoint)return`${t.endpoint}/.default`;if(t.baseUri)return`${t.baseUri}/.default`;if(t.credential&&!t.credentialScopes)throw new Error("When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy")}a(JFo,"getCredentialScopes");p();p();p();function Ihn(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(Ihn,"getIdentityTokenEndpointSuffix");p();var xhn="/.default",whn="Specifying a `clientId` or `resourceId` is not supported by the Service Fabric managed identity environment. The managed identity configuration is determined by the Service Fabric cluster resource configuration. See https://aka.ms/servicefabricmi for more information";function nxe(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(xhn)?e.substr(0,e.lastIndexOf(xhn)):e}a(nxe,"mapScopesToResource");function Rhn(t){if(typeof t.expires_on=="number")return t.expires_on*1e3;if(typeof t.expires_on=="string"){let e=+t.expires_on;if(!isNaN(e))return e*1e3;let r=Date.parse(t.expires_on);if(!isNaN(r))return r}if(typeof t.expires_in=="number")return Date.now()+t.expires_in*1e3;throw new Error(`Failed to parse token expiration from body. expires_in="${t.expires_in}", expires_on="${t.expires_on}"`)}a(Rhn,"parseExpirationTimestamp");function khn(t){if(t.refresh_on){if(typeof t.refresh_on=="number")return t.refresh_on*1e3;if(typeof t.refresh_on=="string"){let e=+t.refresh_on;if(!isNaN(e))return e*1e3;let r=Date.parse(t.refresh_on);if(!isNaN(r))return r}throw new Error(`Failed to parse refresh_on from body. refresh_on="${t.refresh_on}"`)}else return}a(khn,"parseRefreshTimestamp");var ixe="noCorrelationId";function ZFo(t){let e=t?.authorityHost;return uVe&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??FTe}a(ZFo,"getIdentityClientAuthorityHost");var $Q=class extends rxe{static{a(this,"IdentityClient")}authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let r=`azsdk-js-identity/${hGe}`,n=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,o=ZFo(e);if(!o.startsWith("https:"))throw new Error("The authorityHost address must use the 'https' protocol.");super({requestContentType:"application/json; charset=utf-8",retryOptions:{maxRetries:3},...e,userAgentOptions:{userAgentPrefix:n},baseUri:o}),this.authorityHost=o,this.abortControllers=new Map,this.allowLoggingAccountIdentifiers=e?.loggingOptions?.allowLoggingAccountIdentifiers,this.tokenCredentialOptions={...e},e?.allowInsecureConnection&&(this.allowInsecureConnection=e.allowInsecureConnection)}async sendTokenRequest(e){U1.info(`IdentityClient: sending token request to [${e.url}]`);let r=await this.sendRequest(e);if(r.bodyAsText&&(r.status===200||r.status===201)){let n=JSON.parse(r.bodyAsText);if(!n.access_token)return null;this.logIdentifiers(r);let o={accessToken:{token:n.access_token,expiresOnTimestamp:Rhn(n),refreshAfterTimestamp:khn(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return U1.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new bQ(r.status,r.bodyAsText);throw U1.warning(`IdentityClient: authentication error. HTTP status: ${r.status}, ${n.errorResponse.errorDescription}`),n}}async refreshAccessToken(e,r,n,o,s,c={}){if(o===void 0)return null;U1.info(`IdentityClient: refreshing access token with client ID: ${r}, scopes: ${n} started`);let l={grant_type:"refresh_token",client_id:r,refresh_token:o,scope:n};s!==void 0&&(l.client_secret=s);let u=new URLSearchParams(l);return Vc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=Ihn(e),h=KP({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:HQ({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return U1.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===gGe&&f.errorResponse.error==="interaction_required")return U1.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw U1.warning(`IdentityClient: failed refreshing token for client ID: ${r}: ${f}`),f}})}generateAbortSignal(e){let r=new AbortController,n=this.abortControllers.get(e)||[];n.push(r),this.abortControllers.set(e,n);let o=r.signal.onabort;return r.signal.onabort=(...s)=>{this.abortControllers.set(e,void 0),o&&o.apply(r.signal,s)},r.signal}abortRequests(e){let r=e||ixe,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(ixe)||[]];if(n.length){for(let o of n)o.abort();this.abortControllers.set(r,void 0)}}getCorrelationId(e){let r=e?.body?.split("&").map(n=>n.split("=")).find(([n])=>n==="client-request-id");return r&&r.length&&r[1]||ixe}async sendGetRequestAsync(e,r){let n=KP({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:HQ(r?.headers),abortSignal:this.generateAbortSignal(ixe)}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}async sendPostRequestAsync(e,r){let n=KP({url:e,method:"POST",body:r?.body,headers:HQ(r?.headers),allowInsecureConnection:this.allowInsecureConnection,abortSignal:this.generateAbortSignal(this.getCorrelationId(r))}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}getTokenCredentialOptions(){return this.tokenCredentialOptions}logIdentifiers(e){if(!this.allowLoggingAccountIdentifiers||!e.bodyAsText)return;let r="No User Principal Name available";try{let o=(e.parsedBody||JSON.parse(e.bodyAsText)).access_token;if(!o)return;let s=o.split(".")[1],{appid:c,upn:l,tid:u,oid:d}=JSON.parse(Buffer.from(s,"base64").toString("utf8"));U1.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){U1.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var cUt;(function(t){t.AutoDiscoverRegion="AutoDiscoverRegion",t.USWest="westus",t.USWest2="westus2",t.USCentral="centralus",t.USEast="eastus",t.USEast2="eastus2",t.USNorthCentral="northcentralus",t.USSouthCentral="southcentralus",t.USWestCentral="westcentralus",t.CanadaCentral="canadacentral",t.CanadaEast="canadaeast",t.BrazilSouth="brazilsouth",t.EuropeNorth="northeurope",t.EuropeWest="westeurope",t.UKSouth="uksouth",t.UKWest="ukwest",t.FranceCentral="francecentral",t.FranceSouth="francesouth",t.SwitzerlandNorth="switzerlandnorth",t.SwitzerlandWest="switzerlandwest",t.GermanyNorth="germanynorth",t.GermanyWestCentral="germanywestcentral",t.NorwayWest="norwaywest",t.NorwayEast="norwayeast",t.AsiaEast="eastasia",t.AsiaSouthEast="southeastasia",t.JapanEast="japaneast",t.JapanWest="japanwest",t.AustraliaEast="australiaeast",t.AustraliaSouthEast="australiasoutheast",t.AustraliaCentral="australiacentral",t.AustraliaCentral2="australiacentral2",t.IndiaCentral="centralindia",t.IndiaSouth="southindia",t.IndiaWest="westindia",t.KoreaSouth="koreasouth",t.KoreaCentral="koreacentral",t.UAECentral="uaecentral",t.UAENorth="uaenorth",t.SouthAfricaNorth="southafricanorth",t.SouthAfricaWest="southafricawest",t.ChinaNorth="chinanorth",t.ChinaEast="chinaeast",t.ChinaNorth2="chinanorth2",t.ChinaEast2="chinaeast2",t.GermanyCentral="germanycentral",t.GermanyNorthEast="germanynortheast",t.GovernmentUSVirginia="usgovvirginia",t.GovernmentUSIowa="usgoviowa",t.GovernmentUSArizona="usgovarizona",t.GovernmentUSTexas="usgovtexas",t.GovernmentUSDodEast="usdodeast",t.GovernmentUSDodCentral="usdodcentral"})(cUt||(cUt={}));function tWe(t){let e=t;return e===void 0&&globalThis.process?.env?.AZURE_REGIONAL_AUTHORITY_NAME!==void 0&&(e=process.env.AZURE_REGIONAL_AUTHORITY_NAME),e===cUt.AutoDiscoverRegion?"AUTO_DISCOVER":e}a(tWe,"calculateRegionalAuthority");p();p();function XFo(t){return`The current credential is not configured to acquire tokens for tenant ${t}. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to AdditionallyAllowedTenants to allow acquiring tokens for any tenant.`}a(XFo,"createConfigurationErrorMessage");function Rf(t,e,r=[],n){let o;if(process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH||t==="adfs"?o=t:o=e?.tenantId??t,t&&o!==t&&!r.includes("*")&&!r.some(s=>s.localeCompare(o)===0)){let s=XFo(o);throw n?.info(s),new Fn(s)}return o}a(Rf,"processMultiTenantRequest");function m0(t,e){if(!e.match(/^[0-9a-zA-Z-.]+$/)){let r=new Error("Invalid tenant id provided. You can locate your tenant id by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names.");throw t.info($s("",r)),r}}a(m0,"checkTenantId");function Gle(t,e,r){return e?(m0(t,e),e):(r||(r=YY),r!==YY?"common":"organizations")}a(Gle,"resolveTenantId");function ap(t){return!t||t.length===0?[]:t.includes("*")?Qsn:t}a(ap,"resolveAdditionallyAllowedTenantIds");var JE=fo("MsalClient");function m8o(t,e,r={}){let n=Gle(r.logger??JE,e,t),o=i6t(n,n6t(r)),s=new $Q({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:Tfn(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:dVe(r.logger??JE),logLevel:fVe(vGe()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(m8o,"generateMsalConfiguration");function A_(t,e,r={}){let n={msalConfig:m8o(t,e,r),cachedAccount:r.authenticationRecord?Ifn(r.authenticationRecord):null,pluginConfiguration:Wsn.generatePluginConfiguration(r),logger:r.logger??JE},o=new Map;async function s(x={}){let k=x.enableCae?"CAE":"default",D=o.get(k);if(D)return n.logger.getToken.info("Existing PublicClientApplication found in cache, returning it."),D;n.logger.getToken.info(`Creating new PublicClientApplication with CAE ${x.enableCae?"enabled":"disabled"}.`);let N=x.enableCae?n.pluginConfiguration.cache.cachePluginCae:n.pluginConfiguration.cache.cachePlugin;return n.msalConfig.auth.clientCapabilities=x.enableCae?["cp1"]:void 0,D=new Rle({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),o.set(k,D),D}a(s,"getPublicApp");let c=new Map;async function l(x={}){let k=x.enableCae?"CAE":"default",D=c.get(k);if(D)return n.logger.getToken.info("Existing ConfidentialClientApplication found in cache, returning it."),D;n.logger.getToken.info(`Creating new ConfidentialClientApplication with CAE ${x.enableCae?"enabled":"disabled"}.`);let N=x.enableCae?n.pluginConfiguration.cache.cachePluginCae:n.pluginConfiguration.cache.cachePlugin;return n.msalConfig.auth.clientCapabilities=x.enableCae?["cp1"]:void 0,D=new Ple({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),c.set(k,D),D}a(l,"getConfidentialApp");async function u(x,k,D={}){if(n.cachedAccount===null)throw n.logger.getToken.info("No cached account found in local state."),new Kx({scopes:k});D.claims&&(n.cachedClaims=D.claims);let N={account:n.cachedAccount,scopes:k,claims:n.cachedClaims};n.pluginConfiguration.broker.isEnabled&&(N.extraQueryParameters||={},n.pluginConfiguration.broker.enableMsaPassthrough&&(N.extraQueryParameters.msal_request_type="consumer_passthrough")),D.proofOfPossessionOptions&&(N.shrNonce=D.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl),n.logger.getToken.info("Attempting to acquire token silently");try{return await x.acquireTokenSilent(N)}catch(O){throw bK(k,O,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?i6t(x.tenantId,n6t(r)):n.msalConfig.auth.authority}a(d,"calculateRequestAuthority");async function f(x,k,D,N){let O=null;try{O=await u(x,k,D)}catch(B){if(B.name!=="AuthenticationRequiredError")throw B;if(D.disableAutomaticAuthentication)throw new Kx({scopes:k,getTokenOptions:D,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(O===null)try{O=await N()}catch(B){throw bK(k,B,D)}return CK(k,O,D),n.cachedAccount=O?.account??null,n.logger.getToken.info(pg(k)),{token:O.accessToken,expiresOnTimestamp:O.expiresOn.getTime(),refreshAfterTimestamp:O.refreshOn?.getTime(),tokenType:O.tokenType}}a(f,"withSilentAuthentication");async function h(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using client secret"),n.msalConfig.auth.clientSecret=k;let N=await l(D);try{let O=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:tWe(),claims:D?.claims});return CK(x,O,D),n.logger.getToken.info(pg(x)),{token:O.accessToken,expiresOnTimestamp:O.expiresOn.getTime(),refreshAfterTimestamp:O.refreshOn?.getTime(),tokenType:O.tokenType}}catch(O){throw bK(x,O,D)}}a(h,"getTokenByClientSecret");async function m(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using client assertion"),n.msalConfig.auth.clientAssertion=k;let N=await l(D);try{let O=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:tWe(),claims:D?.claims,clientAssertion:k});return CK(x,O,D),n.logger.getToken.info(pg(x)),{token:O.accessToken,expiresOnTimestamp:O.expiresOn.getTime(),refreshAfterTimestamp:O.refreshOn?.getTime(),tokenType:O.tokenType}}catch(O){throw bK(x,O,D)}}a(m,"getTokenByClientAssertion");async function g(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using client certificate"),n.msalConfig.auth.clientCertificate=k;let N=await l(D);try{let O=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:tWe(),claims:D?.claims});return CK(x,O,D),n.logger.getToken.info(pg(x)),{token:O.accessToken,expiresOnTimestamp:O.expiresOn.getTime(),refreshAfterTimestamp:O.refreshOn?.getTime(),tokenType:O.tokenType}}catch(O){throw bK(x,O,D)}}a(g,"getTokenByClientCertificate");async function A(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using device code");let N=await s(D);return f(N,x,D,()=>{let O={scopes:x,cancel:D?.abortSignal?.aborted??!1,deviceCodeCallback:k,authority:d(D),claims:D?.claims},B=N.acquireTokenByDeviceCode(O);return D.abortSignal&&D.abortSignal.addEventListener("abort",()=>{O.cancel=!0}),B})}a(A,"getTokenByDeviceCode");async function y(x,k,D,N={}){n.logger.getToken.info("Attempting to acquire token using username and password");let O=await s(N);return f(O,x,N,()=>{let B={scopes:x,username:k,password:D,authority:d(N),claims:N?.claims};return O.acquireTokenByUsernamePassword(B)})}a(y,"getTokenByUsernamePassword");function _(){if(n.cachedAccount)return xfn(t,n.cachedAccount)}a(_,"getActiveAccount");async function E(x,k,D,N,O={}){n.logger.getToken.info("Attempting to acquire token using authorization code");let B;return N?(n.msalConfig.auth.clientSecret=N,B=await l(O)):B=await s(O),f(B,x,O,()=>B.acquireTokenByCode({scopes:x,redirectUri:k,code:D,authority:d(O),claims:O?.claims}))}a(E,"getTokenByAuthorizationCode");async function v(x,k,D,N={}){JE.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(JE.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(JE.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(JE.getToken.info("Using client certificate for on behalf of flow"),n.msalConfig.auth.clientCertificate=D);let O=await l(N);try{let B=await O.acquireTokenOnBehalfOf({scopes:x,authority:d(N),claims:N.claims,oboAssertion:k});return CK(x,B,N),JE.getToken.info(pg(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw bK(x,B,N)}}a(v,"getTokenOnBehalfOf");function S(x,k){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(sWe(),omn))).default(D,{newInstance:!0})},"openBrowser"),scopes:x,authority:d(k),claims:k?.claims,loginHint:k?.loginHint,errorTemplate:k?.browserCustomizationOptions?.errorMessage,successTemplate:k?.browserCustomizationOptions?.successMessage,prompt:k?.loginHint?"login":"select_account"}}a(S,"createBaseInteractiveRequest");async function T(x,k,D={}){JE.verbose("Authentication will resume through the broker");let N=await s(D),O=S(x,D);n.pluginConfiguration.broker.parentWindowHandle?O.windowHandle=Buffer.from(n.pluginConfiguration.broker.parentWindowHandle):JE.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle."),n.pluginConfiguration.broker.enableMsaPassthrough&&((O.extraQueryParameters??={}).msal_request_type="consumer_passthrough"),k?(O.prompt="none",JE.verbose("Attempting broker authentication using the default broker account")):JE.verbose("Attempting broker authentication without the default broker account"),D.proofOfPossessionOptions&&(O.shrNonce=D.proofOfPossessionOptions.nonce,O.authenticationScheme="pop",O.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,O.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl);try{return await N.acquireTokenInteractive(O)}catch(B){if(JE.verbose(`Failed to authenticate through the broker: ${B.message}`),D.disableAutomaticAuthentication)throw new Kx({scopes:x,getTokenOptions:D,message:"Cannot silently authenticate with default broker account."});if(k)return T(x,!1,D);throw B}}a(T,"getBrokeredTokenInternal");async function w(x,k,D={}){JE.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${k}`);let N=await T(x,k,D);return CK(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(pg(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,k={}){JE.getToken.info("Attempting to acquire token interactively");let D=await s(k);return f(D,x,k,async()=>{let N=S(x,k);return n.pluginConfiguration.broker.isEnabled?T(x,n.pluginConfiguration.broker.useDefaultBrokerAccount??!1,k):(k.proofOfPossessionOptions&&(N.shrNonce=k.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=k.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=k.proofOfPossessionOptions.resourceRequestUrl),D.acquireTokenInteractive(N))})}return a(R,"getTokenByInteractiveRequest"),{getActiveAccount:_,getBrokeredToken:w,getTokenByClientSecret:h,getTokenByClientAssertion:m,getTokenByClientCertificate:g,getTokenByDeviceCode:A,getTokenByUsernamePassword:y,getTokenByAuthorizationCode:E,getTokenOnBehalfOf:v,getTokenByInteractiveRequest:R}}a(A_,"createMsalClient");var lxe=require("node:crypto");var amn=require("node:fs/promises");var cxe="ClientCertificateCredential",smn=fo(cxe),uxe=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${cxe}: tenantId and clientId are required parameters.`);this.tenantId=e,this.additionallyAllowedTenantIds=ap(o?.additionallyAllowedTenants),this.sendCertificateChain=o.sendCertificateChain,this.certificateConfiguration={...typeof n=="string"?{certificatePath:n}:n};let s=this.certificateConfiguration.certificate,c=this.certificateConfiguration.certificatePath;if(!this.certificateConfiguration||!(s||c))throw new Error(`${cxe}: Provide either a PEM certificate in string form, or the path to that certificate in the filesystem. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(s&&c)throw new Error(`${cxe}: To avoid unexpected behaviors, providing both the contents of a PEM certificate and the path to a PEM certificate is forbidden. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);this.msalClient=A_(r,e,{...o,logger:smn,tokenCredentialOptions:o})}async getToken(e,r={}){return Vc.withSpan(`${cxe}.getToken`,r,async n=>{n.tenantId=Rf(this.tenantId,n,this.additionallyAllowedTenantIds,smn);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await g8o(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,lxe.createPrivateKey)({key:e.certificateContents,passphrase:this.certificateConfiguration.certificatePassword,format:"pem"}).export({format:"pem",type:"pkcs8"}).toString():r=e.certificateContents,{thumbprint:e.thumbprint,thumbprintSha256:e.thumbprintSha256,privateKey:r,x5c:e.x5c}}};async function g8o(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,amn.readFile)(n,"utf8"),s=e?o:void 0,c=/(-+BEGIN CERTIFICATE-+)(\n\r?|\r\n?)([A-Za-z0-9+/\n\r]+=*)(\n\r?|\r\n?)(-+END CERTIFICATE-+)/g,l=[],u;do u=c.exec(o),u&&l.push(u[3]);while(u);if(l.length===0)throw new Error("The file at the specified path does not contain a PEM-encoded certificate.");let d=(0,lxe.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,lxe.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(g8o,"parseCertificate");p();p();function aw(t){return Array.isArray(t)?t:[t]}a(aw,"ensureScopes");function Wle(t,e){if(!t.match(/^[0-9a-zA-Z-_.:/]+$/)){let r=new Error("Invalid scope was specified by the user or calling client");throw e.getToken.info($s(t,r)),r}}a(Wle,"ensureValidScopeForDevTimeCreds");function aWe(t){return t.replace(/\/.default$/,"")}a(aWe,"getScopeResource");var cmn=fo("ClientSecretCredential"),dxe=class{static{a(this,"ClientSecretCredential")}tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,r,n,o={}){if(!e)throw new Fn("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!r)throw new Fn("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new Fn("ClientSecretCredential: clientSecret is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");this.clientSecret=n,this.tenantId=e,this.additionallyAllowedTenantIds=ap(o?.additionallyAllowedTenants),this.msalClient=A_(r,e,{...o,logger:cmn,tokenCredentialOptions:o})}async getToken(e,r={}){return Vc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=Rf(this.tenantId,n,this.additionallyAllowedTenantIds,cmn);let o=aw(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var A8o=fo("UsernamePasswordCredential"),fxe=class{static{a(this,"UsernamePasswordCredential")}tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,r,n,o,s={}){if(!e)throw new Fn("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new Fn("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new Fn("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!o)throw new Fn("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=e,this.additionallyAllowedTenantIds=ap(s?.additionallyAllowedTenants),this.username=n,this.password=o,this.msalClient=A_(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return Vc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=Rf(this.tenantId,n,this.additionallyAllowedTenantIds,A8o);let o=aw(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var y8o=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_CLIENT_SECRET","AZURE_CLIENT_CERTIFICATE_PATH","AZURE_CLIENT_CERTIFICATE_PASSWORD","AZURE_USERNAME","AZURE_PASSWORD","AZURE_ADDITIONALLY_ALLOWED_TENANTS","AZURE_CLIENT_SEND_CERTIFICATE_CHAIN"];function _8o(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(_8o,"getAdditionallyAllowedTenants");var cWe="EnvironmentCredential",J3=fo(cWe);function E8o(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return J3.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(E8o,"getSendCertificateChain");var pxe=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=CGe(y8o).assigned.join(", ");J3.info(`Found the following environment variables: ${r}`);let n=process.env.AZURE_TENANT_ID,o=process.env.AZURE_CLIENT_ID,s=process.env.AZURE_CLIENT_SECRET,c=_8o(),l=E8o(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&m0(J3,n),n&&o&&s){J3.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new dxe(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){J3.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new uxe(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(J3.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),J3.warning("Environment is configured to use username and password authentication. This authentication method is deprecated, as it doesn't support multifactor authentication (MFA). Use a more secure credential. For more details, see https://aka.ms/azsdk/identity/mfa."),this._credential=new fxe(n,o,h,m,u))}async getToken(e,r={}){return Vc.withSpan(`${cWe}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return J3.getToken.info(pg(e)),o}catch(o){let s=new bQ(400,{error:`${cWe} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw J3.getToken.info($s(e,s)),s}throw new Fn(`${cWe} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var v8o=1e3*64,C8o=3e3;function lmn(t){return eUt([{name:"imdsRetryPolicy",retry:a(({retryCount:e,response:r})=>{if(r?.status!==404&&r?.status!==410)return{skipStrategy:!0};let n=r?.status===410?Math.max(C8o,t.startDelayInMs):t.startDelayInMs;return bfn(e,{retryDelayInMs:n,maxRetryDelayInMs:v8o})},"retry")}],{maxRetries:t.maxRetries})}a(lmn,"imdsRetryPolicy");p();var Z3="ManagedIdentityCredential - IMDS",TK=fo(Z3),b8o="http://169.254.169.254",S8o="/metadata/identity/oauth2/token";function T8o(t){if(!nxe(t))throw new Error(`${Z3}: Multiple scopes are not supported.`);let r=new URL(S8o,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??b8o),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:HQ(n)}}a(T8o,"prepareInvalidRequestOptions");var umn={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=nxe(e);if(!o)return TK.info(`${Z3}: Unavailable. Multiple scopes are not supported.`),!1;if(process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST)return!0;if(!r)throw new Error("Missing IdentityClient");let s=T8o(o);return Vc.withSpan("ManagedIdentityCredential-pingImdsEndpoint",n??{},async c=>{s.tracingOptions=c.tracingOptions;let l=KP(s);l.timeout=c.requestOptions?.timeout||1e3,l.allowInsecureConnection=!0;let u;try{TK.info(`${Z3}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return lVe(d)&&TK.verbose(`${Z3}: Caught error ${d.name}: ${d.message}`),TK.info(`${Z3}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(TK.info(`${Z3}: The Azure IMDS endpoint is unavailable`),TK.info(`${Z3}: ${u.bodyAsText}`),!1):(TK.info(`${Z3}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var dmn=fo("ClientAssertionCredential"),zle=class{static{a(this,"ClientAssertionCredential")}msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,r,n,o={}){if(!e)throw new Fn("ClientAssertionCredential: tenantId is a required parameter.");if(!r)throw new Fn("ClientAssertionCredential: clientId is a required parameter.");if(!n)throw new Fn("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=ap(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=A_(r,e,{...o,logger:dmn,tokenCredentialOptions:this.options})}async getToken(e,r={}){return Vc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=Rf(this.tenantId,n,this.additionallyAllowedTenantIds,dmn);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var fmn=require("node:fs/promises");var IK="WorkloadIdentityCredential",I8o=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],hxe=fo(IK),X3=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=CGe(I8o).assigned.join(", ");hxe.info(`Found the following environment variables: ${r}`);let n=e??{},o=n.tenantId||process.env.AZURE_TENANT_ID,s=n.clientId||process.env.AZURE_CLIENT_ID;if(this.federatedTokenFilePath=n.tokenFilePath||process.env.AZURE_FEDERATED_TOKEN_FILE,o&&m0(hxe,o),!s)throw new Fn(`${IK}: is unavailable. clientId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_CLIENT_ID". - See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!o)throw new Fn(`${IK}: is unavailable. tenantId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_TENANT_ID". - See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!this.federatedTokenFilePath)throw new Fn(`${IK}: is unavailable. federatedTokenFilePath is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_FEDERATED_TOKEN_FILE". - See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);hxe.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new zle(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${IK}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters. +`,"utf-8")],o=aFo(n);o&&t.headers.set("Content-Length",o),t.body=await rhn(n)}a(cFo,"buildRequestBody");var exe="multipartPolicy",lFo=70,uFo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function dFo(t){if(t.length>lFo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!uFo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(dFo,"assertValidBoundary");function $Ve(){return{name:exe,async sendRequest(t,e){var r;if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,o=(r=t.headers.get("Content-Type"))!==null&&r!==void 0?r:"multipart/mixed",s=o.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!s)throw new Error(`Got multipart request body, but content-type header was not multipart: ${o}`);let[,c,l]=s;if(l&&n&&l!==n)throw new Error(`Multipart boundary was specified as ${l} in the header, but got ${n} in the request body`);return n??(n=l),n?dFo(n):n=iFo(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await cFo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a($Ve,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function VVe(){return AVe()}a(VVe,"createEmptyPipeline");p();p();p();var wO=SQ("core-rest-pipeline");p();p();p();p();function Q6t(t={}){return CVe(Object.assign({logger:wO.info},t))}a(Q6t,"logPolicy");p();function q6t(t={}){return bVe(t)}a(q6t,"redirectPolicy");p();p();p();var Hle=fe(require("node:os"),1),WVe=fe(require("node:process"),1);function nhn(){return"User-Agent"}a(nhn,"getHeaderName");async function ihn(t){if(WVe&&WVe.versions){let e=WVe.versions;e.bun?t.set("Bun",e.bun):e.deno?t.set("Deno",e.deno):e.node&&t.set("Node",e.node)}t.set("OS",`(${Hle.arch()}-${Hle.type()}-${Hle.release()})`)}a(ihn,"setPlatformSpecificData");p();var zVe="1.22.0";function EFo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(EFo,"getUserAgentString");function ohn(){return nhn()}a(ohn,"getUserAgentHeaderName");async function YVe(t){let e=new Map;e.set("core-rest-pipeline",zVe),await ihn(e);let r=EFo(e);return t?`${t} ${r}`:r}a(YVe,"getUserAgentValue");var shn=ohn(),ahn="userAgentPolicy";function j6t(t={}){let e=YVe(t.userAgentPrefix);return{name:ahn,async sendRequest(r,n){return r.headers.has(shn)||r.headers.set(shn,await e),n(r)}}}a(j6t,"userAgentPolicy");p();p();var chn=Symbol("rawContent");function H6t(t){return typeof t[chn]=="function"}a(H6t,"hasRawContent");function lhn(t){return H6t(t)?t[chn]():t}a(lhn,"getRawContent");var KVe=exe;function G6t(){let t=$Ve();return{name:KVe,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)H6t(n.body)&&(n.body=lhn(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(G6t,"multipartPolicy");p();function $6t(){return SVe()}a($6t,"decompressResponsePolicy");p();function V6t(t={}){return IVe(t)}a(V6t,"defaultRetryPolicy");p();function W6t(){return xVe()}a(W6t,"formDataPolicy");p();function z6t(t,e){return LVe(t,e)}a(z6t,"proxyPolicy");p();var uhn="setClientRequestIdPolicy";function Y6t(t="x-ms-client-request-id"){return{name:uhn,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(Y6t,"setClientRequestIdPolicy");p();function K6t(t){return BVe(t)}a(K6t,"agentPolicy");p();function J6t(t){return FVe(t)}a(J6t,"tlsPolicy");p();p();var Gle=LA;function txe(t){return yVe(t)}a(txe,"isRestError");var dhn="tracingPolicy";function Z6t(t={}){let e=YVe(t.userAgentPrefix),r=new zP({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=vFo();return{name:dhn,async sendRequest(o,s){var c;if(!n)return s(o);let l=await e,u={"http.url":r.sanitizeUrl(o.url),"http.method":o.method,"http.user_agent":l,requestId:o.requestId};l&&(u["http.user_agent"]=l);let{span:d,tracingContext:f}=(c=CFo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return SFo(d,h),h}catch(h){throw bFo(d,h),h}}}}a(Z6t,"tracingPolicy");function vFo(){try{return qTe({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:zVe})}catch(t){wO.warning(`Error when creating the TracingClient: ${Lle(t)}`);return}}a(vFo,"tryCreateTracingClient");function CFo(t,e,r){try{let{span:n,updatedOptions:o}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let s=t.createRequestHeaders(o.tracingOptions.tracingContext);for(let[c,l]of Object.entries(s))e.headers.set(c,l);return{span:n,tracingContext:o.tracingOptions.tracingContext}}catch(n){wO.warning(`Skipping creating a tracing span due to an error: ${Lle(n)}`);return}}a(CFo,"tryCreateSpan");function bFo(t,e){try{t.setStatus({status:"error",error:lVe(e)?e:void 0}),txe(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){wO.warning(`Skipping tracing span processing due to an error: ${Lle(r)}`)}}a(bFo,"tryProcessError");function SFo(t,e){try{t.setAttribute("http.status_code",e.status);let r=e.headers.get("x-ms-request-id");r&&t.setAttribute("serviceRequestId",r),e.status>=400&&t.setStatus({status:"error"}),t.end()}catch(r){wO.warning(`Skipping tracing span processing due to an error: ${Lle(r)}`)}}a(SFo,"tryProcessResponse");p();p();function JVe(t){if(t instanceof AbortSignal)return{abortSignal:t};if(t.aborted)return{abortSignal:AbortSignal.abort(t.reason)};let e=new AbortController,r=!0;function n(){r&&(t.removeEventListener("abort",o),r=!1)}a(n,"cleanup");function o(){e.abort(t.reason),n()}return a(o,"listener"),t.addEventListener("abort",o),{abortSignal:e.signal,cleanup:n}}a(JVe,"wrapAbortSignalLike");var TFo="wrapAbortSignalLikePolicy";function fhn(){return{name:TFo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=JVe(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(fhn,"wrapAbortSignalLikePolicy");function X6t(t){var e;let r=VVe();return Ble&&(t.agent&&r.addPolicy(K6t(t.agent)),t.tlsOptions&&r.addPolicy(J6t(t.tlsOptions)),r.addPolicy(z6t(t.proxyOptions)),r.addPolicy($6t())),r.addPolicy(fhn()),r.addPolicy(W6t(),{beforePolicies:[KVe]}),r.addPolicy(j6t(t.userAgentOptions)),r.addPolicy(Y6t((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(G6t(),{afterPhase:"Deserialize"}),r.addPolicy(V6t(t.retryOptions),{phase:"Retry"}),r.addPolicy(Z6t(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),Ble&&r.addPolicy(q6t(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(Q6t(t.loggingOptions),{afterPhase:"Sign"}),r}a(X6t,"createPipelineFromOptions");p();function eUt(){let t=vVe();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?JVe(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a(eUt,"createDefaultHttpClient");p();function HQ(t){return V1(t)}a(HQ,"createHttpHeaders");p();function KP(t){return gVe(t)}a(KP,"createPipelineRequest");p();p();p();p();var xFo=SQ("core-rest-pipeline retryPolicy");function tUt(t,e={maxRetries:3}){return QQ(t,Object.assign({logger:xFo},e))}a(tUt,"retryPolicy");p();p();var wFo={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function RFo(t,e,r){async function n(){if(Date.now()t.getToken(u,d),"tryGetAccessToken"),s.retryIntervalInMs,(f=n?.expiresOnTimestamp)!==null&&f!==void 0?f:Date.now()).then(m=>(r=null,n=m,o=d.tenantId,n)).catch(m=>{throw r=null,n=null,o=void 0,m})),r}return a(l,"refresh"),async(u,d)=>{let f=!!d.claims,h=o!==d.tenantId;return f&&(n=null),h||f||c.mustRefresh?l(u,d):(c.shouldRefresh&&l(u,d),n)}}a(rUt,"createTokenCycler");var ghn="bearerTokenAuthenticationPolicy";async function ZVe(t,e){try{return[await e(t),void 0]}catch(r){if(txe(r)&&r.response)return[r.response,r];throw r}}a(ZVe,"trySendRequest");async function kFo(t){let{scopes:e,getAccessToken:r,request:n}=t,o={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions,enableCae:!0},s=await r(e,o);s&&t.request.headers.set("Authorization",`Bearer ${s.token}`)}a(kFo,"defaultAuthorizeRequest");function phn(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(phn,"isChallengeResponse");async function hhn(t,e){var r;let{scopes:n}=t,o=await t.getAccessToken(n,{enableCae:!0,claims:e});return o?(t.request.headers.set("Authorization",`${(r=o.tokenType)!==null&&r!==void 0?r:"Bearer"} ${o.token}`),!0):!1}a(hhn,"authorizeRequestOnCaeChallenge");function XVe(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||wO,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:kFo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?rUt(o):()=>Promise.resolve(null);return{name:ghn,async sendRequest(f,h){if(!f.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await u.authorizeRequest({scopes:Array.isArray(s)?s:[s],request:f,getAccessToken:d,logger:l});let m,g,A;if([m,g]=await ZVe(f,h),phn(m)){let y=mhn(m.headers.get("WWW-Authenticate"));if(y){let _;try{_=atob(y)}catch{return l.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${y}`),m}A=await hhn({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},_),A&&([m,g]=await ZVe(f,h))}else if(u.authorizeRequestOnChallenge&&(A=await u.authorizeRequestOnChallenge({scopes:Array.isArray(s)?s:[s],request:f,response:m,getAccessToken:d,logger:l}),A&&([m,g]=await ZVe(f,h)),phn(m)&&(y=mhn(m.headers.get("WWW-Authenticate")),y))){let _;try{_=atob(y)}catch{return l.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${y}`),m}A=await hhn({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},_),A&&([m,g]=await ZVe(f,h))}}if(g)throw g;return m}}}a(XVe,"bearerTokenAuthenticationPolicy");function PFo(t){let e=/(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g,r=/(\w+)="([^"]*)"/g,n=[],o;for(;(o=e.exec(t))!==null;){let s=o[1],c=o[2],l={},u;for(;(u=r.exec(c))!==null;)l[u[1]]=u[2];n.push({scheme:s,params:l})}return n}a(PFo,"parseChallenges");function mhn(t){var e;return t?(e=PFo(t).find(n=>n.scheme==="Bearer"&&n.params.claims&&n.params.error==="insufficient_claims"))===null||e===void 0?void 0:e.params.claims:void 0}a(mhn,"getCaeChallengeClaims");p();p();p();p();p();p();var yhn=fe(Ahn(),1),nUt=yhn.state;function GQ(t,e,r){let n=e.parameterPath,o=e.mapper,s;if(typeof n=="string"&&(n=[n]),Array.isArray(n)){if(n.length>0)if(o.isConstant)s=o.defaultValue;else{let c=_hn(t,n);!c.propertyFound&&r&&(c=_hn(r,n));let l=!1;c.propertyFound||(l=o.required||n[0]==="options"&&n.length===2),s=l?o.defaultValue:c.propertyValue}}else{o.required&&(s={});for(let c in n){let l=o.type.modelProperties[c],u=n[c],d=GQ(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(GQ,"getOperationArgumentValueFromParameter");function _hn(t,e){let r={propertyFound:!1},n=0;for(;n=200&&r.status<300);u.headersMapper&&(s.parsedHeaders=l.serializer.deserialize(u.headersMapper,s.headers.toJSON(),"operationRes.parsedHeaders",{xml:{},ignoreUnknownProperties:!0}))}return s}a(BFo,"deserializeResponseBody");function FFo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(FFo,"isOperationSpecEmpty");function UFo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(FFo(e)?s:!!r)if(r){if(!r.isError)return{error:null,shouldReturnResponse:!1}}else return{error:null,shouldReturnResponse:!1};let l=r??e.responses.default,u=!((o=t.request.streamResponseStatusCodes)===null||o===void 0)&&o.has(t.status)?`Unexpected status code: ${t.status}`:t.bodyAsText,d=new Gle(u,{statusCode:t.status,request:t.request,response:t});if(!l)throw d;let f=l.bodyMapper,h=l.headersMapper;try{if(t.parsedBody){let m=t.parsedBody,g;if(f){let y=m;if(e.isXML&&f.type.name===TO.Sequence){y=[];let _=f.xmlElementName;typeof m=="object"&&_&&(y=m[_])}g=e.serializer.deserialize(f,y,"error.response.parsedBody",n)}let A=m.error||g||m;d.code=A.code,A.message&&(d.message=A.message),f&&(d.response.parsedBody=g)}t.headers&&h&&(d.response.parsedHeaders=e.serializer.deserialize(h,t.headers.toJSON(),"operationRes.parsedHeaders"))}catch(m){d.message=`Error "${m.message}" occurred in deserializing the responseBody - "${t.bodyAsText}" for the default response.`}return{error:d,shouldReturnResponse:!1}}a(UFo,"handleErrorResponse");async function QFo(t,e,r,n,o){var s;if(!(!((s=r.request.streamResponseStatusCodes)===null||s===void 0)&&s.has(r.status))&&r.bodyAsText){let c=r.bodyAsText,l=r.headers.get("Content-Type")||"",u=l?l.split(";").map(d=>d.toLowerCase()):[];try{if(u.length===0||u.some(d=>t.indexOf(d)!==-1))return r.parsedBody=JSON.parse(c),r;if(u.some(d=>e.indexOf(d)!==-1)){if(!o)throw new Error("Parsing XML not supported.");let d=await o(c,n.xml);return r.parsedBody=d,r}}catch(d){let f=`Error "${d}" occurred while parsing the response body - ${r.bodyAsText}.`,h=d.code||Gle.PARSE_ERROR;throw new Gle(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a(QFo,"parse");p();p();function Chn(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===TO.Stream&&e.add(Number(r))}return e}a(Chn,"getStreamingResponseStatusCodes");function RO(t){let{parameterPath:e,mapper:r}=t,n;return typeof e=="string"?n=e:Array.isArray(e)?n=e.join("."):n=r.serializedName,n}a(RO,"getPathStringFromParameter");var bhn="serializationPolicy";function oUt(t={}){let e=t.stringifyXML;return{name:bhn,async sendRequest(r,n){let o=K3(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&(qFo(r,c,s),jFo(r,c,s,e)),n(r)}}}a(oUt,"serializationPolicy");function qFo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=GQ(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,RO(c));let u=c.mapper.headerCollectionPrefix;if(u)for(let d of Object.keys(l))t.headers.set(u+d,l[d]);else t.headers.set(c.mapper.serializedName||RO(c),l)}}let s=(o=(n=e.options)===null||n===void 0?void 0:n.requestOptions)===null||o===void 0?void 0:o.customHeaders;if(s)for(let c of Object.keys(s))t.headers.set(c,s[c])}a(qFo,"serializeHeaders");function jFo(t,e,r,n=function(){throw new Error("XML serialization unsupported!")}){var o,s,c,l,u;let d=(o=e.options)===null||o===void 0?void 0:o.serializerOptions,f={xml:{rootName:(s=d?.xml.rootName)!==null&&s!==void 0?s:"",includeRoot:(c=d?.xml.includeRoot)!==null&&c!==void 0?c:!1,xmlCharKey:(l=d?.xml.xmlCharKey)!==null&&l!==void 0?l:"_"}},h=f.xml.xmlCharKey;if(r.requestBody&&r.requestBody.mapper){t.body=GQ(e,r.requestBody);let m=r.requestBody.mapper,{required:g,serializedName:A,xmlName:y,xmlElementName:_,xmlNamespace:E,xmlNamespacePrefix:v,nullable:S}=m,T=m.type.name;try{if(t.body!==void 0&&t.body!==null||S&&t.body===null||g){let w=RO(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===TO.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",k=HFo(E,x,T,t.body,f);T===TO.Sequence?t.body=n(GFo(k,_||y||A,x,E),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(k,{rootName:y||A,xmlCharKey:h}))}else{if(T===TO.String&&(!((u=r.contentType)===null||u===void 0)&&u.match("text/plain")||r.mediaType==="text"))return;R||(t.body=JSON.stringify(t.body))}}}catch(w){throw new Error(`Error "${w.message}" occurred in serializing the payload - ${JSON.stringify(A,void 0," ")}.`)}}else if(r.formDataParameters&&r.formDataParameters.length>0){t.formData={};for(let m of r.formDataParameters){let g=GQ(e,m);if(g!=null){let A=m.mapper.serializedName||RO(m);t.formData[A]=r.serializer.serialize(m.mapper,g,RO(m),f)}}}}a(jFo,"serializeRequestBody");function HFo(t,e,r,n,o){if(t&&!["Composite","Sequence","Dictionary"].includes(r)){let s={};return s[o.xml.xmlCharKey]=n,s["$"]={[e]:t},s}return n}a(HFo,"getXmlValueWithNamespace");function GFo(t,e,r,n){if(Array.isArray(t)||(t=[t]),!r||!n)return{[e]:t};let o={[e]:t};return o["$"]={[r]:n},o}a(GFo,"prepareXMLRootList");function sUt(t={}){let e=X6t(t??{});return t.credentialOptions&&e.addPolicy(XVe({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(oUt(t.serializationOptions),{phase:"Serialize"}),e.addPolicy(iUt(t.deserializationOptions),{phase:"Deserialize"}),e}a(sUt,"createClientPipeline");p();var aUt;function Shn(){return aUt||(aUt=eUt()),aUt}a(Shn,"getCachedDefaultHttpClient");p();var $Fo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function Ihn(t,e,r,n){let o=VFo(e,r,n),s=!1,c=Thn(t,o);if(e.path){let d=Thn(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),WFo(d)?(c=d,s=!0):c=zFo(c,d)}let{queryParams:l,sequenceParams:u}=YFo(e,r,n);return c=JFo(c,l,u,s),c}a(Ihn,"getRequestUrl");function Thn(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(Thn,"replaceAll");function VFo(t,e,r){var n;let o=new Map;if(!((n=t.urlParameters)===null||n===void 0)&&n.length)for(let s of t.urlParameters){let c=GQ(e,s,r),l=RO(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(VFo,"calculateUrlReplacements");function WFo(t){return t.includes("://")}a(WFo,"isAbsoluteUrl");function zFo(t,e){if(!e)return t;let r=new URL(t),n=r.pathname;n.endsWith("/")||(n=`${n}/`),e.startsWith("/")&&(e=e.substring(1));let o=e.indexOf("?");if(o!==-1){let s=e.substring(0,o),c=e.substring(o+1);n=n+s,c&&(r.search=r.search?`${r.search}&${c}`:c)}else n=n+e;return r.pathname=n,r.toString()}a(zFo,"appendPath");function YFo(t,e,r){var n;let o=new Map,s=new Set;if(!((n=t.queryParameters)===null||n===void 0)&&n.length)for(let c of t.queryParameters){c.mapper.type.name==="Sequence"&&c.mapper.serializedName&&s.add(c.mapper.serializedName);let l=GQ(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,RO(c));let u=c.collectionFormat?$Fo[c.collectionFormat]:"";if(Array.isArray(l)&&(l=l.map(d=>d??"")),c.collectionFormat==="Multi"&&l.length===0)continue;Array.isArray(l)&&(c.collectionFormat==="SSV"||c.collectionFormat==="TSV")&&(l=l.join(u)),c.skipEncoding||(Array.isArray(l)?l=l.map(d=>encodeURIComponent(d)):l=encodeURIComponent(l)),Array.isArray(l)&&(c.collectionFormat==="CSV"||c.collectionFormat==="Pipes")&&(l=l.join(u)),o.set(c.mapper.serializedName||RO(c),l)}}return{queryParams:o,sequenceParams:s}}a(YFo,"calculateQueryParameters");function KFo(t){let e=new Map;if(!t||t[0]!=="?")return e;t=t.slice(1);let r=t.split("&");for(let n of r){let[o,s]=n.split("=",2),c=e.get(o);c?Array.isArray(c)?c.push(s):e.set(o,[c,s]):e.set(o,s)}return e}a(KFo,"simpleParseQueryParams");function JFo(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=KFo(o.search);for(let[l,u]of e){let d=s.get(l);if(Array.isArray(d))if(Array.isArray(u)){d.push(...u);let f=new Set(d);s.set(l,Array.from(f))}else d.push(u);else d?(Array.isArray(u)?u.unshift(d):r.has(l)&&s.set(l,[d,u]),n||s.set(l,u)):s.set(l,u)}let c=[];for(let[l,u]of s)if(typeof u=="string")c.push(`${l}=${u}`);else if(Array.isArray(u))for(let d of u)c.push(`${l}=${d}`);else c.push(`${l}=${u}`);return o.search=c.length?`?${c.join("&")}`:"",o.toString()}a(JFo,"appendQueryParams");p();var cUt=SQ("core-client");var rxe=class{static{a(this,"ServiceClient")}constructor(e={}){var r,n;if(this._requestContentType=e.requestContentType,this._endpoint=(r=e.endpoint)!==null&&r!==void 0?r:e.baseUri,e.baseUri&&cUt.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||Shn(),this.pipeline=e.pipeline||ZFo(e),!((n=e.additionalPolicies)===null||n===void 0)&&n.length)for(let{policy:o,position:s}of e.additionalPolicies){let c=s==="perRetry"?"Sign":void 0;this.pipeline.addPolicy(o,{afterPhase:c})}}async sendRequest(e){return this.pipeline.sendRequest(this._httpClient,e)}async sendOperationRequest(e,r){let n=r.baseUrl||this._endpoint;if(!n)throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.");let o=Ihn(n,r,e,this),s=KP({url:o});s.method=r.httpMethod;let c=K3(s);c.operationSpec=r,c.operationArguments=e;let l=r.contentType||this._requestContentType;l&&r.requestBody&&s.headers.set("Content-Type",l);let u=e.options;if(u){let d=u.requestOptions;d&&(d.timeout&&(s.timeout=d.timeout),d.onUploadProgress&&(s.onUploadProgress=d.onUploadProgress),d.onDownloadProgress&&(s.onDownloadProgress=d.onDownloadProgress),d.shouldDeserialize!==void 0&&(c.shouldDeserialize=d.shouldDeserialize),d.allowInsecureConnection&&(s.allowInsecureConnection=!0)),u.abortSignal&&(s.abortSignal=u.abortSignal),u.tracingOptions&&(s.tracingOptions=u.tracingOptions)}this._allowInsecureConnection&&(s.allowInsecureConnection=!0),s.streamResponseStatusCodes===void 0&&(s.streamResponseStatusCodes=Chn(r));try{let d=await this.sendRequest(s),f=a6t(d,r.responses[d.status]);return u?.onResponse&&u.onResponse(d,f),f}catch(d){if(typeof d=="object"&&d?.response){let f=d.response,h=a6t(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function ZFo(t){let e=XFo(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return sUt(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(ZFo,"createDefaultPipeline");function XFo(t){if(t.credentialScopes)return t.credentialScopes;if(t.endpoint)return`${t.endpoint}/.default`;if(t.baseUri)return`${t.baseUri}/.default`;if(t.credential&&!t.credentialScopes)throw new Error("When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy")}a(XFo,"getCredentialScopes");p();p();p();function xhn(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(xhn,"getIdentityTokenEndpointSuffix");p();var whn="/.default",Rhn="Specifying a `clientId` or `resourceId` is not supported by the Service Fabric managed identity environment. The managed identity configuration is determined by the Service Fabric cluster resource configuration. See https://aka.ms/servicefabricmi for more information";function nxe(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(whn)?e.substr(0,e.lastIndexOf(whn)):e}a(nxe,"mapScopesToResource");function khn(t){if(typeof t.expires_on=="number")return t.expires_on*1e3;if(typeof t.expires_on=="string"){let e=+t.expires_on;if(!isNaN(e))return e*1e3;let r=Date.parse(t.expires_on);if(!isNaN(r))return r}if(typeof t.expires_in=="number")return Date.now()+t.expires_in*1e3;throw new Error(`Failed to parse token expiration from body. expires_in="${t.expires_in}", expires_on="${t.expires_on}"`)}a(khn,"parseExpirationTimestamp");function Phn(t){if(t.refresh_on){if(typeof t.refresh_on=="number")return t.refresh_on*1e3;if(typeof t.refresh_on=="string"){let e=+t.refresh_on;if(!isNaN(e))return e*1e3;let r=Date.parse(t.refresh_on);if(!isNaN(r))return r}throw new Error(`Failed to parse refresh_on from body. refresh_on="${t.refresh_on}"`)}else return}a(Phn,"parseRefreshTimestamp");var ixe="noCorrelationId";function e8o(t){let e=t?.authorityHost;return uVe&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??FTe}a(e8o,"getIdentityClientAuthorityHost");var $Q=class extends rxe{static{a(this,"IdentityClient")}authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let r=`azsdk-js-identity/${hGe}`,n=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,o=e8o(e);if(!o.startsWith("https:"))throw new Error("The authorityHost address must use the 'https' protocol.");super({requestContentType:"application/json; charset=utf-8",retryOptions:{maxRetries:3},...e,userAgentOptions:{userAgentPrefix:n},baseUri:o}),this.authorityHost=o,this.abortControllers=new Map,this.allowLoggingAccountIdentifiers=e?.loggingOptions?.allowLoggingAccountIdentifiers,this.tokenCredentialOptions={...e},e?.allowInsecureConnection&&(this.allowInsecureConnection=e.allowInsecureConnection)}async sendTokenRequest(e){U1.info(`IdentityClient: sending token request to [${e.url}]`);let r=await this.sendRequest(e);if(r.bodyAsText&&(r.status===200||r.status===201)){let n=JSON.parse(r.bodyAsText);if(!n.access_token)return null;this.logIdentifiers(r);let o={accessToken:{token:n.access_token,expiresOnTimestamp:khn(n),refreshAfterTimestamp:Phn(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return U1.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new bQ(r.status,r.bodyAsText);throw U1.warning(`IdentityClient: authentication error. HTTP status: ${r.status}, ${n.errorResponse.errorDescription}`),n}}async refreshAccessToken(e,r,n,o,s,c={}){if(o===void 0)return null;U1.info(`IdentityClient: refreshing access token with client ID: ${r}, scopes: ${n} started`);let l={grant_type:"refresh_token",client_id:r,refresh_token:o,scope:n};s!==void 0&&(l.client_secret=s);let u=new URLSearchParams(l);return Vc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=xhn(e),h=KP({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:HQ({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return U1.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===gGe&&f.errorResponse.error==="interaction_required")return U1.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw U1.warning(`IdentityClient: failed refreshing token for client ID: ${r}: ${f}`),f}})}generateAbortSignal(e){let r=new AbortController,n=this.abortControllers.get(e)||[];n.push(r),this.abortControllers.set(e,n);let o=r.signal.onabort;return r.signal.onabort=(...s)=>{this.abortControllers.set(e,void 0),o&&o.apply(r.signal,s)},r.signal}abortRequests(e){let r=e||ixe,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(ixe)||[]];if(n.length){for(let o of n)o.abort();this.abortControllers.set(r,void 0)}}getCorrelationId(e){let r=e?.body?.split("&").map(n=>n.split("=")).find(([n])=>n==="client-request-id");return r&&r.length&&r[1]||ixe}async sendGetRequestAsync(e,r){let n=KP({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:HQ(r?.headers),abortSignal:this.generateAbortSignal(ixe)}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}async sendPostRequestAsync(e,r){let n=KP({url:e,method:"POST",body:r?.body,headers:HQ(r?.headers),allowInsecureConnection:this.allowInsecureConnection,abortSignal:this.generateAbortSignal(this.getCorrelationId(r))}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}getTokenCredentialOptions(){return this.tokenCredentialOptions}logIdentifiers(e){if(!this.allowLoggingAccountIdentifiers||!e.bodyAsText)return;let r="No User Principal Name available";try{let o=(e.parsedBody||JSON.parse(e.bodyAsText)).access_token;if(!o)return;let s=o.split(".")[1],{appid:c,upn:l,tid:u,oid:d}=JSON.parse(Buffer.from(s,"base64").toString("utf8"));U1.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){U1.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var lUt;(function(t){t.AutoDiscoverRegion="AutoDiscoverRegion",t.USWest="westus",t.USWest2="westus2",t.USCentral="centralus",t.USEast="eastus",t.USEast2="eastus2",t.USNorthCentral="northcentralus",t.USSouthCentral="southcentralus",t.USWestCentral="westcentralus",t.CanadaCentral="canadacentral",t.CanadaEast="canadaeast",t.BrazilSouth="brazilsouth",t.EuropeNorth="northeurope",t.EuropeWest="westeurope",t.UKSouth="uksouth",t.UKWest="ukwest",t.FranceCentral="francecentral",t.FranceSouth="francesouth",t.SwitzerlandNorth="switzerlandnorth",t.SwitzerlandWest="switzerlandwest",t.GermanyNorth="germanynorth",t.GermanyWestCentral="germanywestcentral",t.NorwayWest="norwaywest",t.NorwayEast="norwayeast",t.AsiaEast="eastasia",t.AsiaSouthEast="southeastasia",t.JapanEast="japaneast",t.JapanWest="japanwest",t.AustraliaEast="australiaeast",t.AustraliaSouthEast="australiasoutheast",t.AustraliaCentral="australiacentral",t.AustraliaCentral2="australiacentral2",t.IndiaCentral="centralindia",t.IndiaSouth="southindia",t.IndiaWest="westindia",t.KoreaSouth="koreasouth",t.KoreaCentral="koreacentral",t.UAECentral="uaecentral",t.UAENorth="uaenorth",t.SouthAfricaNorth="southafricanorth",t.SouthAfricaWest="southafricawest",t.ChinaNorth="chinanorth",t.ChinaEast="chinaeast",t.ChinaNorth2="chinanorth2",t.ChinaEast2="chinaeast2",t.GermanyCentral="germanycentral",t.GermanyNorthEast="germanynortheast",t.GovernmentUSVirginia="usgovvirginia",t.GovernmentUSIowa="usgoviowa",t.GovernmentUSArizona="usgovarizona",t.GovernmentUSTexas="usgovtexas",t.GovernmentUSDodEast="usdodeast",t.GovernmentUSDodCentral="usdodcentral"})(lUt||(lUt={}));function tWe(t){let e=t;return e===void 0&&globalThis.process?.env?.AZURE_REGIONAL_AUTHORITY_NAME!==void 0&&(e=process.env.AZURE_REGIONAL_AUTHORITY_NAME),e===lUt.AutoDiscoverRegion?"AUTO_DISCOVER":e}a(tWe,"calculateRegionalAuthority");p();p();function t8o(t){return`The current credential is not configured to acquire tokens for tenant ${t}. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to AdditionallyAllowedTenants to allow acquiring tokens for any tenant.`}a(t8o,"createConfigurationErrorMessage");function Rf(t,e,r=[],n){let o;if(process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH||t==="adfs"?o=t:o=e?.tenantId??t,t&&o!==t&&!r.includes("*")&&!r.some(s=>s.localeCompare(o)===0)){let s=t8o(o);throw n?.info(s),new Fn(s)}return o}a(Rf,"processMultiTenantRequest");function g0(t,e){if(!e.match(/^[0-9a-zA-Z-.]+$/)){let r=new Error("Invalid tenant id provided. You can locate your tenant id by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names.");throw t.info($s("",r)),r}}a(g0,"checkTenantId");function $le(t,e,r){return e?(g0(t,e),e):(r||(r=KY),r!==KY?"common":"organizations")}a($le,"resolveTenantId");function ap(t){return!t||t.length===0?[]:t.includes("*")?qsn:t}a(ap,"resolveAdditionallyAllowedTenantIds");var JE=fo("MsalClient");function A8o(t,e,r={}){let n=$le(r.logger??JE,e,t),o=o6t(n,i6t(r)),s=new $Q({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:Ifn(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:dVe(r.logger??JE),logLevel:fVe(vGe()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(A8o,"generateMsalConfiguration");function A_(t,e,r={}){let n={msalConfig:A8o(t,e,r),cachedAccount:r.authenticationRecord?xfn(r.authenticationRecord):null,pluginConfiguration:zsn.generatePluginConfiguration(r),logger:r.logger??JE},o=new Map;async function s(x={}){let k=x.enableCae?"CAE":"default",D=o.get(k);if(D)return n.logger.getToken.info("Existing PublicClientApplication found in cache, returning it."),D;n.logger.getToken.info(`Creating new PublicClientApplication with CAE ${x.enableCae?"enabled":"disabled"}.`);let N=x.enableCae?n.pluginConfiguration.cache.cachePluginCae:n.pluginConfiguration.cache.cachePlugin;return n.msalConfig.auth.clientCapabilities=x.enableCae?["cp1"]:void 0,D=new kle({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),o.set(k,D),D}a(s,"getPublicApp");let c=new Map;async function l(x={}){let k=x.enableCae?"CAE":"default",D=c.get(k);if(D)return n.logger.getToken.info("Existing ConfidentialClientApplication found in cache, returning it."),D;n.logger.getToken.info(`Creating new ConfidentialClientApplication with CAE ${x.enableCae?"enabled":"disabled"}.`);let N=x.enableCae?n.pluginConfiguration.cache.cachePluginCae:n.pluginConfiguration.cache.cachePlugin;return n.msalConfig.auth.clientCapabilities=x.enableCae?["cp1"]:void 0,D=new Dle({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),c.set(k,D),D}a(l,"getConfidentialApp");async function u(x,k,D={}){if(n.cachedAccount===null)throw n.logger.getToken.info("No cached account found in local state."),new Kx({scopes:k});D.claims&&(n.cachedClaims=D.claims);let N={account:n.cachedAccount,scopes:k,claims:n.cachedClaims};n.pluginConfiguration.broker.isEnabled&&(N.extraQueryParameters||={},n.pluginConfiguration.broker.enableMsaPassthrough&&(N.extraQueryParameters.msal_request_type="consumer_passthrough")),D.proofOfPossessionOptions&&(N.shrNonce=D.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl),n.logger.getToken.info("Attempting to acquire token silently");try{return await x.acquireTokenSilent(N)}catch(O){throw SK(k,O,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?o6t(x.tenantId,i6t(r)):n.msalConfig.auth.authority}a(d,"calculateRequestAuthority");async function f(x,k,D,N){let O=null;try{O=await u(x,k,D)}catch(B){if(B.name!=="AuthenticationRequiredError")throw B;if(D.disableAutomaticAuthentication)throw new Kx({scopes:k,getTokenOptions:D,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(O===null)try{O=await N()}catch(B){throw SK(k,B,D)}return bK(k,O,D),n.cachedAccount=O?.account??null,n.logger.getToken.info(hg(k)),{token:O.accessToken,expiresOnTimestamp:O.expiresOn.getTime(),refreshAfterTimestamp:O.refreshOn?.getTime(),tokenType:O.tokenType}}a(f,"withSilentAuthentication");async function h(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using client secret"),n.msalConfig.auth.clientSecret=k;let N=await l(D);try{let O=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:tWe(),claims:D?.claims});return bK(x,O,D),n.logger.getToken.info(hg(x)),{token:O.accessToken,expiresOnTimestamp:O.expiresOn.getTime(),refreshAfterTimestamp:O.refreshOn?.getTime(),tokenType:O.tokenType}}catch(O){throw SK(x,O,D)}}a(h,"getTokenByClientSecret");async function m(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using client assertion"),n.msalConfig.auth.clientAssertion=k;let N=await l(D);try{let O=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:tWe(),claims:D?.claims,clientAssertion:k});return bK(x,O,D),n.logger.getToken.info(hg(x)),{token:O.accessToken,expiresOnTimestamp:O.expiresOn.getTime(),refreshAfterTimestamp:O.refreshOn?.getTime(),tokenType:O.tokenType}}catch(O){throw SK(x,O,D)}}a(m,"getTokenByClientAssertion");async function g(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using client certificate"),n.msalConfig.auth.clientCertificate=k;let N=await l(D);try{let O=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:tWe(),claims:D?.claims});return bK(x,O,D),n.logger.getToken.info(hg(x)),{token:O.accessToken,expiresOnTimestamp:O.expiresOn.getTime(),refreshAfterTimestamp:O.refreshOn?.getTime(),tokenType:O.tokenType}}catch(O){throw SK(x,O,D)}}a(g,"getTokenByClientCertificate");async function A(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using device code");let N=await s(D);return f(N,x,D,()=>{let O={scopes:x,cancel:D?.abortSignal?.aborted??!1,deviceCodeCallback:k,authority:d(D),claims:D?.claims},B=N.acquireTokenByDeviceCode(O);return D.abortSignal&&D.abortSignal.addEventListener("abort",()=>{O.cancel=!0}),B})}a(A,"getTokenByDeviceCode");async function y(x,k,D,N={}){n.logger.getToken.info("Attempting to acquire token using username and password");let O=await s(N);return f(O,x,N,()=>{let B={scopes:x,username:k,password:D,authority:d(N),claims:N?.claims};return O.acquireTokenByUsernamePassword(B)})}a(y,"getTokenByUsernamePassword");function _(){if(n.cachedAccount)return wfn(t,n.cachedAccount)}a(_,"getActiveAccount");async function E(x,k,D,N,O={}){n.logger.getToken.info("Attempting to acquire token using authorization code");let B;return N?(n.msalConfig.auth.clientSecret=N,B=await l(O)):B=await s(O),f(B,x,O,()=>B.acquireTokenByCode({scopes:x,redirectUri:k,code:D,authority:d(O),claims:O?.claims}))}a(E,"getTokenByAuthorizationCode");async function v(x,k,D,N={}){JE.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(JE.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(JE.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(JE.getToken.info("Using client certificate for on behalf of flow"),n.msalConfig.auth.clientCertificate=D);let O=await l(N);try{let B=await O.acquireTokenOnBehalfOf({scopes:x,authority:d(N),claims:N.claims,oboAssertion:k});return bK(x,B,N),JE.getToken.info(hg(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw SK(x,B,N)}}a(v,"getTokenOnBehalfOf");function S(x,k){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(sWe(),smn))).default(D,{newInstance:!0})},"openBrowser"),scopes:x,authority:d(k),claims:k?.claims,loginHint:k?.loginHint,errorTemplate:k?.browserCustomizationOptions?.errorMessage,successTemplate:k?.browserCustomizationOptions?.successMessage,prompt:k?.loginHint?"login":"select_account"}}a(S,"createBaseInteractiveRequest");async function T(x,k,D={}){JE.verbose("Authentication will resume through the broker");let N=await s(D),O=S(x,D);n.pluginConfiguration.broker.parentWindowHandle?O.windowHandle=Buffer.from(n.pluginConfiguration.broker.parentWindowHandle):JE.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle."),n.pluginConfiguration.broker.enableMsaPassthrough&&((O.extraQueryParameters??={}).msal_request_type="consumer_passthrough"),k?(O.prompt="none",JE.verbose("Attempting broker authentication using the default broker account")):JE.verbose("Attempting broker authentication without the default broker account"),D.proofOfPossessionOptions&&(O.shrNonce=D.proofOfPossessionOptions.nonce,O.authenticationScheme="pop",O.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,O.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl);try{return await N.acquireTokenInteractive(O)}catch(B){if(JE.verbose(`Failed to authenticate through the broker: ${B.message}`),D.disableAutomaticAuthentication)throw new Kx({scopes:x,getTokenOptions:D,message:"Cannot silently authenticate with default broker account."});if(k)return T(x,!1,D);throw B}}a(T,"getBrokeredTokenInternal");async function w(x,k,D={}){JE.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${k}`);let N=await T(x,k,D);return bK(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(hg(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,k={}){JE.getToken.info("Attempting to acquire token interactively");let D=await s(k);return f(D,x,k,async()=>{let N=S(x,k);return n.pluginConfiguration.broker.isEnabled?T(x,n.pluginConfiguration.broker.useDefaultBrokerAccount??!1,k):(k.proofOfPossessionOptions&&(N.shrNonce=k.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=k.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=k.proofOfPossessionOptions.resourceRequestUrl),D.acquireTokenInteractive(N))})}return a(R,"getTokenByInteractiveRequest"),{getActiveAccount:_,getBrokeredToken:w,getTokenByClientSecret:h,getTokenByClientAssertion:m,getTokenByClientCertificate:g,getTokenByDeviceCode:A,getTokenByUsernamePassword:y,getTokenByAuthorizationCode:E,getTokenOnBehalfOf:v,getTokenByInteractiveRequest:R}}a(A_,"createMsalClient");var lxe=require("node:crypto");var cmn=require("node:fs/promises");var cxe="ClientCertificateCredential",amn=fo(cxe),uxe=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${cxe}: tenantId and clientId are required parameters.`);this.tenantId=e,this.additionallyAllowedTenantIds=ap(o?.additionallyAllowedTenants),this.sendCertificateChain=o.sendCertificateChain,this.certificateConfiguration={...typeof n=="string"?{certificatePath:n}:n};let s=this.certificateConfiguration.certificate,c=this.certificateConfiguration.certificatePath;if(!this.certificateConfiguration||!(s||c))throw new Error(`${cxe}: Provide either a PEM certificate in string form, or the path to that certificate in the filesystem. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(s&&c)throw new Error(`${cxe}: To avoid unexpected behaviors, providing both the contents of a PEM certificate and the path to a PEM certificate is forbidden. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);this.msalClient=A_(r,e,{...o,logger:amn,tokenCredentialOptions:o})}async getToken(e,r={}){return Vc.withSpan(`${cxe}.getToken`,r,async n=>{n.tenantId=Rf(this.tenantId,n,this.additionallyAllowedTenantIds,amn);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await y8o(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,lxe.createPrivateKey)({key:e.certificateContents,passphrase:this.certificateConfiguration.certificatePassword,format:"pem"}).export({format:"pem",type:"pkcs8"}).toString():r=e.certificateContents,{thumbprint:e.thumbprint,thumbprintSha256:e.thumbprintSha256,privateKey:r,x5c:e.x5c}}};async function y8o(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,cmn.readFile)(n,"utf8"),s=e?o:void 0,c=/(-+BEGIN CERTIFICATE-+)(\n\r?|\r\n?)([A-Za-z0-9+/\n\r]+=*)(\n\r?|\r\n?)(-+END CERTIFICATE-+)/g,l=[],u;do u=c.exec(o),u&&l.push(u[3]);while(u);if(l.length===0)throw new Error("The file at the specified path does not contain a PEM-encoded certificate.");let d=(0,lxe.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,lxe.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(y8o,"parseCertificate");p();p();function aw(t){return Array.isArray(t)?t:[t]}a(aw,"ensureScopes");function zle(t,e){if(!t.match(/^[0-9a-zA-Z-_.:/]+$/)){let r=new Error("Invalid scope was specified by the user or calling client");throw e.getToken.info($s(t,r)),r}}a(zle,"ensureValidScopeForDevTimeCreds");function aWe(t){return t.replace(/\/.default$/,"")}a(aWe,"getScopeResource");var lmn=fo("ClientSecretCredential"),dxe=class{static{a(this,"ClientSecretCredential")}tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,r,n,o={}){if(!e)throw new Fn("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!r)throw new Fn("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new Fn("ClientSecretCredential: clientSecret is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");this.clientSecret=n,this.tenantId=e,this.additionallyAllowedTenantIds=ap(o?.additionallyAllowedTenants),this.msalClient=A_(r,e,{...o,logger:lmn,tokenCredentialOptions:o})}async getToken(e,r={}){return Vc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=Rf(this.tenantId,n,this.additionallyAllowedTenantIds,lmn);let o=aw(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var _8o=fo("UsernamePasswordCredential"),fxe=class{static{a(this,"UsernamePasswordCredential")}tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,r,n,o,s={}){if(!e)throw new Fn("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new Fn("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new Fn("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!o)throw new Fn("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=e,this.additionallyAllowedTenantIds=ap(s?.additionallyAllowedTenants),this.username=n,this.password=o,this.msalClient=A_(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return Vc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=Rf(this.tenantId,n,this.additionallyAllowedTenantIds,_8o);let o=aw(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var E8o=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_CLIENT_SECRET","AZURE_CLIENT_CERTIFICATE_PATH","AZURE_CLIENT_CERTIFICATE_PASSWORD","AZURE_USERNAME","AZURE_PASSWORD","AZURE_ADDITIONALLY_ALLOWED_TENANTS","AZURE_CLIENT_SEND_CERTIFICATE_CHAIN"];function v8o(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(v8o,"getAdditionallyAllowedTenants");var cWe="EnvironmentCredential",J3=fo(cWe);function C8o(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return J3.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(C8o,"getSendCertificateChain");var pxe=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=CGe(E8o).assigned.join(", ");J3.info(`Found the following environment variables: ${r}`);let n=process.env.AZURE_TENANT_ID,o=process.env.AZURE_CLIENT_ID,s=process.env.AZURE_CLIENT_SECRET,c=v8o(),l=C8o(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&g0(J3,n),n&&o&&s){J3.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new dxe(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){J3.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new uxe(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(J3.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),J3.warning("Environment is configured to use username and password authentication. This authentication method is deprecated, as it doesn't support multifactor authentication (MFA). Use a more secure credential. For more details, see https://aka.ms/azsdk/identity/mfa."),this._credential=new fxe(n,o,h,m,u))}async getToken(e,r={}){return Vc.withSpan(`${cWe}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return J3.getToken.info(hg(e)),o}catch(o){let s=new bQ(400,{error:`${cWe} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw J3.getToken.info($s(e,s)),s}throw new Fn(`${cWe} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var b8o=1e3*64,S8o=3e3;function umn(t){return tUt([{name:"imdsRetryPolicy",retry:a(({retryCount:e,response:r})=>{if(r?.status!==404&&r?.status!==410)return{skipStrategy:!0};let n=r?.status===410?Math.max(S8o,t.startDelayInMs):t.startDelayInMs;return Sfn(e,{retryDelayInMs:n,maxRetryDelayInMs:b8o})},"retry")}],{maxRetries:t.maxRetries})}a(umn,"imdsRetryPolicy");p();var Z3="ManagedIdentityCredential - IMDS",IK=fo(Z3),T8o="http://169.254.169.254",I8o="/metadata/identity/oauth2/token";function x8o(t){if(!nxe(t))throw new Error(`${Z3}: Multiple scopes are not supported.`);let r=new URL(I8o,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??T8o),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:HQ(n)}}a(x8o,"prepareInvalidRequestOptions");var dmn={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=nxe(e);if(!o)return IK.info(`${Z3}: Unavailable. Multiple scopes are not supported.`),!1;if(process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST)return!0;if(!r)throw new Error("Missing IdentityClient");let s=x8o(o);return Vc.withSpan("ManagedIdentityCredential-pingImdsEndpoint",n??{},async c=>{s.tracingOptions=c.tracingOptions;let l=KP(s);l.timeout=c.requestOptions?.timeout||1e3,l.allowInsecureConnection=!0;let u;try{IK.info(`${Z3}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return lVe(d)&&IK.verbose(`${Z3}: Caught error ${d.name}: ${d.message}`),IK.info(`${Z3}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(IK.info(`${Z3}: The Azure IMDS endpoint is unavailable`),IK.info(`${Z3}: ${u.bodyAsText}`),!1):(IK.info(`${Z3}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var fmn=fo("ClientAssertionCredential"),Yle=class{static{a(this,"ClientAssertionCredential")}msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,r,n,o={}){if(!e)throw new Fn("ClientAssertionCredential: tenantId is a required parameter.");if(!r)throw new Fn("ClientAssertionCredential: clientId is a required parameter.");if(!n)throw new Fn("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=ap(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=A_(r,e,{...o,logger:fmn,tokenCredentialOptions:this.options})}async getToken(e,r={}){return Vc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=Rf(this.tenantId,n,this.additionallyAllowedTenantIds,fmn);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var pmn=require("node:fs/promises");var xK="WorkloadIdentityCredential",w8o=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],hxe=fo(xK),X3=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=CGe(w8o).assigned.join(", ");hxe.info(`Found the following environment variables: ${r}`);let n=e??{},o=n.tenantId||process.env.AZURE_TENANT_ID,s=n.clientId||process.env.AZURE_CLIENT_ID;if(this.federatedTokenFilePath=n.tokenFilePath||process.env.AZURE_FEDERATED_TOKEN_FILE,o&&g0(hxe,o),!s)throw new Fn(`${xK}: is unavailable. clientId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_CLIENT_ID". + See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!o)throw new Fn(`${xK}: is unavailable. tenantId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_TENANT_ID". + See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!this.federatedTokenFilePath)throw new Fn(`${xK}: is unavailable. federatedTokenFilePath is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_FEDERATED_TOKEN_FILE". + See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);hxe.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new Yle(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${xK}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters. In DefaultAzureCredential and ManagedIdentityCredential, these can be provided as environment variables - "AZURE_TENANT_ID", "AZURE_CLIENT_ID", - "AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;throw hxe.info(n),new Fn(n)}return hxe.info("Invoking getToken() of Client Assertion Credential"),this.client.getToken(e,r)}async readFileContents(){if(this.cacheDate!==void 0&&Date.now()-this.cacheDate>=1e3*60*5&&(this.azureFederatedTokenFileContent=void 0),!this.federatedTokenFilePath)throw new Fn(`${IK}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,fmn.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Fn(`${IK}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var pmn="ManagedIdentityCredential - Token Exchange",x8o=fo(pmn),wUt={name:"tokenExchangeMsi",async isAvailable(t){let e=process.env,r=!!((t||e.AZURE_CLIENT_ID)&&e.AZURE_TENANT_ID&&process.env.AZURE_FEDERATED_TOKEN_FILE);return r||x8o.info(`${pmn}: Unavailable. The environment variables needed are: AZURE_CLIENT_ID (or the client ID sent through the parameters), AZURE_TENANT_ID and AZURE_FEDERATED_TOKEN_FILE`),r},async getToken(t,e={}){let{scopes:r,clientId:n}=t,o={};return new X3({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var K1=fo("ManagedIdentityCredential"),YQ=class{static{a(this,"ManagedIdentityCredential")}managedIdentityApp;identityClient;clientId;resourceId;objectId;msiRetryConfig={maxRetries:5,startDelayInMs:800,intervalIncrement:2};isAvailableIdentityClient;sendProbeRequest;constructor(e,r){let n;typeof e=="string"?(this.clientId=e,n=r??{}):(this.clientId=e?.clientId,n=e??{}),this.resourceId=n?.resourceId,this.objectId=n?.objectId,this.sendProbeRequest=n?.sendProbeRequest??!1;let o=[{key:"clientId",value:this.clientId},{key:"resourceId",value:this.resourceId},{key:"objectId",value:this.objectId}].filter(c=>c.value);if(o.length>1)throw new Error(`ManagedIdentityCredential: only one of 'clientId', 'resourceId', or 'objectId' can be provided. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}`);n.allowInsecureConnection=!0,n.retryOptions?.maxRetries!==void 0&&(this.msiRetryConfig.maxRetries=n.retryOptions.maxRetries),this.identityClient=new $Q({...n,additionalPolicies:[{policy:lmn(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Dle({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:fVe(vGe()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:dVe(K1)}}}),this.isAvailableIdentityClient=new $Q({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw K1.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Fn("ManagedIdentityCredential: Specifying a user-assigned managed identity is not supported for CloudShell at runtime. When using Managed Identity in CloudShell, omit the clientId, resourceId, and objectId parameters.");if(s==="ServiceFabric"&&(this.clientId||this.resourceId||this.objectId))throw K1.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Fn(`ManagedIdentityCredential: ${whn}`);if(K1.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];K1.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){K1.getToken.info("Using the MSAL provider for Managed Identity.");let n=nxe(e);if(!n)throw new Fn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return Vc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await wUt.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(K1.getToken.info(`MSAL Identity source: ${s}`),o){K1.getToken.info("Using the token exchange managed identity.");let u=await wUt.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(u===null)throw new Fn("Attempted to use the token exchange managed identity, but received a null response.");return u}else if(c&&this.sendProbeRequest&&(K1.getToken.info("Using the IMDS endpoint to probe for availability."),!await umn.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:r,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new Fn("Attempted to use the IMDS endpoint, but it is not available.");K1.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),K1.getToken.info(pg(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw K1.getToken.error($s(e,o)),o.name==="AuthenticationRequiredError"?o:w8o(o)?new Fn(`ManagedIdentityCredential: Network unreachable. Message: ${o.message}`,{cause:o}):new Fn(`ManagedIdentityCredential: Authentication failed. Message ${o.message}`,{cause:o})}})}ensureValidMsalToken(e,r,n){let o=a(s=>(K1.getToken.info(s),new Kx({scopes:Array.isArray(e)?e:[e],getTokenOptions:n,message:s})),"createError");if(!r)throw o("No response.");if(!r.expiresOn)throw o('Response had no "expiresOn" property.');if(!r.accessToken)throw o('Response had no "accessToken" property.')}};function w8o(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(w8o,"isNetworkError");p();var hmn=fe(require("child_process"),1);var kO=fo("AzureDeveloperCliCredential"),lWe={notInstalled:"Azure Developer CLI couldn't be found. To mitigate this issue, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",login:"Please run 'azd auth login' from a command prompt to authenticate before using this credential. For more information, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",unknown:"Unknown error while trying to retrieve the access token",claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:"},mmn={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(kO.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure Developer CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzdAccessToken(t,e,r,n){let o=[];e&&(o=["--tenant-id",e]);let s=[];return n&&(s=["--claims",btoa(n)]),new Promise((c,l)=>{try{let d=["azd",...["auth","token","--output","json","--no-prompt",...t.reduce((f,h)=>f.concat("--scope",h),[]),...o,...s]].join(" ");hmn.default.exec(d,{cwd:mmn.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},mxe=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(m0(kO,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=ap(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=Rf(this.tenantId,r,this.additionallyAllowedTenantIds);n&&m0(kO,n);let o;return typeof e=="string"?o=[e]:o=e,kO.getToken.info(`Using the scopes ${e}`),Vc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{Wle(d,kO)});let s=await mmn.getAzdAccessToken(o,n,this.timeout,r.claims),c=s.stderr?.match("must use multi-factor authentication")||s.stderr?.match("reauthentication required"),l=s.stderr?.match("not logged in, run `azd login` to login")||s.stderr?.match("not logged in, run `azd auth login` to login");if(s.stderr?.match("azd:(.*)not found")||s.stderr?.startsWith("'azd' is not recognized")||s.error&&s.error.code==="ENOENT"){let d=new Fn(lWe.notInstalled);throw kO.getToken.info($s(e,d)),d}if(l){let d=new Fn(lWe.login);throw kO.getToken.info($s(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Fn(`${lWe.claim} ${f}`);throw kO.getToken.info($s(e,h)),h}try{let d=JSON.parse(s.stdout);return kO.getToken.info(pg(e)),{token:d.token,expiresOnTimestamp:new Date(d.expiresOn).getTime(),tokenType:"Bearer"}}catch(d){throw s.stderr?new Fn(s.stderr):d}}catch(s){let c=s.name==="CredentialUnavailableError"?s:new Fn(s.message||lWe.unknown);throw kO.getToken.info($s(e,c)),c}})}};p();var gmn=fe(require("child_process"),1);p();function RUt(t,e){if(!e.match(/^[0-9a-zA-Z-._ ]+$/)){let r=new Error(`Subscription '${e}' contains invalid characters. If this is the name of a subscription, use its ID instead. You can locate your subscription by following the instructions listed here: https://learn.microsoft.com/azure/azure-portal/get-subscription-tenant-id`);throw t.info($s("",r)),r}}a(RUt,"checkSubscription");var J1=fo("AzureCliCredential"),gxe={claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",notInstalled:"Azure CLI could not be found. Please visit https://aka.ms/azure-cli for installation instructions and then, once installed, authenticate to your Azure account using 'az login'.",login:"Please run 'az login' from a command prompt to authenticate before using this credential.",unknown:"Unknown error while trying to retrieve the access token",unexpectedResponse:'Unexpected response from Azure CLI when getting token. Expected "expiresOn" to be a RFC3339 date string. Got:'},Amn={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(J1.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzureCliAccessToken(t,e,r,n){let o=[],s=[];return e&&(o=["--tenant",e]),r&&(s=["--subscription",`"${r}"`]),new Promise((c,l)=>{try{let d=["az",...["account","get-access-token","--output","json","--resource",t,...o,...s]].join(" ");gmn.default.exec(d,{cwd:Amn.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},Axe=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&(m0(J1,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(RUt(J1,e?.subscription),this.subscription=e?.subscription),this.additionallyAllowedTenantIds=ap(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=typeof e=="string"?e:e[0],o=r.claims;if(o&&o.trim()){let l=`az login --claims-challenge ${btoa(o)} --scope ${n}`,u=r.tenantId;u&&(l+=` --tenant ${u}`);let d=new Fn(`${gxe.claim} ${l}`);throw J1.getToken.info($s(n,d)),d}let s=Rf(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&m0(J1,s),this.subscription&&RUt(J1,this.subscription),J1.getToken.info(`Using the scope ${n}`),Vc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{Wle(n,J1);let c=aWe(n),l=await Amn.getAzureCliAccessToken(c,s,this.subscription,this.timeout),u=l.stderr?.match("(.*)az login --scope(.*)"),d=l.stderr?.match("(.*)az login(.*)")&&!u;if(l.stderr?.match("az:(.*)not found")||l.stderr?.startsWith("'az' is not recognized")){let h=new Fn(gxe.notInstalled);throw J1.getToken.info($s(e,h)),h}if(d){let h=new Fn(gxe.login);throw J1.getToken.info($s(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return J1.getToken.info(pg(e)),m}catch(h){throw l.stderr?new Fn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Fn(c.message||gxe.unknown);throw J1.getToken.info($s(e,l)),l}})}parseRawResponse(e){let r=JSON.parse(e),n=r.accessToken,o=Number.parseInt(r.expires_on,10)*1e3;if(!isNaN(o))return J1.getToken.info("expires_on is available and is valid, using it"),{token:n,expiresOnTimestamp:o,tokenType:"Bearer"};if(o=new Date(r.expiresOn).getTime(),isNaN(o))throw new Fn(`${gxe.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var ymn=fe(require("node:child_process"),1),_mn={execFile(t,e,r){return new Promise((n,o)=>{ymn.default.execFile(t,e,r,(s,c,l)=>{Buffer.isBuffer(c)&&(c=c.toString("utf8")),Buffer.isBuffer(l)&&(l=l.toString("utf8")),l||s?o(l?new Error(l):s):n(c)})})}};var PO=fo("AzurePowerShellCredential"),vmn=process.platform==="win32";function Cmn(t){return vmn?`${t}.exe`:t}a(Cmn,"formatCommand");async function Emn(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await _mn.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(Emn,"runCommands");var bmn={login:"Run Connect-AzAccount to login",installed:"The specified module 'Az.Accounts' with version '2.2.0' was not loaded because no valid module file was found in any module directory"},uWe={login:"Please run 'Connect-AzAccount' from PowerShell to authenticate before using this credential.",installed:`The 'Az.Account' module >= 2.2.0 is not installed. Install the Azure Az PowerShell module with: "Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force".`,claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",troubleshoot:"To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot."},R8o=a(t=>t.message.match(`(.*)${bmn.login}(.*)`),"isLoginError"),k8o=a(t=>t.message.match(bmn.installed),"isNotInstalledError"),kUt=[Cmn("pwsh")];vmn&&kUt.push(Cmn("powershell"));var yxe=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(m0(PO,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=ap(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...kUt]){try{await Emn([[o,"/?"]],n)}catch{kUt.shift();continue}let c=(await Emn([[o,"-NoProfile","-NonInteractive","-Command",` + "AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;throw hxe.info(n),new Fn(n)}return hxe.info("Invoking getToken() of Client Assertion Credential"),this.client.getToken(e,r)}async readFileContents(){if(this.cacheDate!==void 0&&Date.now()-this.cacheDate>=1e3*60*5&&(this.azureFederatedTokenFileContent=void 0),!this.federatedTokenFilePath)throw new Fn(`${xK}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,pmn.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Fn(`${xK}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var hmn="ManagedIdentityCredential - Token Exchange",R8o=fo(hmn),RUt={name:"tokenExchangeMsi",async isAvailable(t){let e=process.env,r=!!((t||e.AZURE_CLIENT_ID)&&e.AZURE_TENANT_ID&&process.env.AZURE_FEDERATED_TOKEN_FILE);return r||R8o.info(`${hmn}: Unavailable. The environment variables needed are: AZURE_CLIENT_ID (or the client ID sent through the parameters), AZURE_TENANT_ID and AZURE_FEDERATED_TOKEN_FILE`),r},async getToken(t,e={}){let{scopes:r,clientId:n}=t,o={};return new X3({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var K1=fo("ManagedIdentityCredential"),YQ=class{static{a(this,"ManagedIdentityCredential")}managedIdentityApp;identityClient;clientId;resourceId;objectId;msiRetryConfig={maxRetries:5,startDelayInMs:800,intervalIncrement:2};isAvailableIdentityClient;sendProbeRequest;constructor(e,r){let n;typeof e=="string"?(this.clientId=e,n=r??{}):(this.clientId=e?.clientId,n=e??{}),this.resourceId=n?.resourceId,this.objectId=n?.objectId,this.sendProbeRequest=n?.sendProbeRequest??!1;let o=[{key:"clientId",value:this.clientId},{key:"resourceId",value:this.resourceId},{key:"objectId",value:this.objectId}].filter(c=>c.value);if(o.length>1)throw new Error(`ManagedIdentityCredential: only one of 'clientId', 'resourceId', or 'objectId' can be provided. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}`);n.allowInsecureConnection=!0,n.retryOptions?.maxRetries!==void 0&&(this.msiRetryConfig.maxRetries=n.retryOptions.maxRetries),this.identityClient=new $Q({...n,additionalPolicies:[{policy:umn(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Nle({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:fVe(vGe()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:dVe(K1)}}}),this.isAvailableIdentityClient=new $Q({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw K1.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Fn("ManagedIdentityCredential: Specifying a user-assigned managed identity is not supported for CloudShell at runtime. When using Managed Identity in CloudShell, omit the clientId, resourceId, and objectId parameters.");if(s==="ServiceFabric"&&(this.clientId||this.resourceId||this.objectId))throw K1.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Fn(`ManagedIdentityCredential: ${Rhn}`);if(K1.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];K1.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){K1.getToken.info("Using the MSAL provider for Managed Identity.");let n=nxe(e);if(!n)throw new Fn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return Vc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await RUt.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(K1.getToken.info(`MSAL Identity source: ${s}`),o){K1.getToken.info("Using the token exchange managed identity.");let u=await RUt.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(u===null)throw new Fn("Attempted to use the token exchange managed identity, but received a null response.");return u}else if(c&&this.sendProbeRequest&&(K1.getToken.info("Using the IMDS endpoint to probe for availability."),!await dmn.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:r,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new Fn("Attempted to use the IMDS endpoint, but it is not available.");K1.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),K1.getToken.info(hg(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw K1.getToken.error($s(e,o)),o.name==="AuthenticationRequiredError"?o:k8o(o)?new Fn(`ManagedIdentityCredential: Network unreachable. Message: ${o.message}`,{cause:o}):new Fn(`ManagedIdentityCredential: Authentication failed. Message ${o.message}`,{cause:o})}})}ensureValidMsalToken(e,r,n){let o=a(s=>(K1.getToken.info(s),new Kx({scopes:Array.isArray(e)?e:[e],getTokenOptions:n,message:s})),"createError");if(!r)throw o("No response.");if(!r.expiresOn)throw o('Response had no "expiresOn" property.');if(!r.accessToken)throw o('Response had no "accessToken" property.')}};function k8o(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(k8o,"isNetworkError");p();var mmn=fe(require("child_process"),1);var kO=fo("AzureDeveloperCliCredential"),lWe={notInstalled:"Azure Developer CLI couldn't be found. To mitigate this issue, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",login:"Please run 'azd auth login' from a command prompt to authenticate before using this credential. For more information, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",unknown:"Unknown error while trying to retrieve the access token",claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:"},gmn={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(kO.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure Developer CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzdAccessToken(t,e,r,n){let o=[];e&&(o=["--tenant-id",e]);let s=[];return n&&(s=["--claims",btoa(n)]),new Promise((c,l)=>{try{let d=["azd",...["auth","token","--output","json","--no-prompt",...t.reduce((f,h)=>f.concat("--scope",h),[]),...o,...s]].join(" ");mmn.default.exec(d,{cwd:gmn.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},mxe=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(g0(kO,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=ap(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=Rf(this.tenantId,r,this.additionallyAllowedTenantIds);n&&g0(kO,n);let o;return typeof e=="string"?o=[e]:o=e,kO.getToken.info(`Using the scopes ${e}`),Vc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{zle(d,kO)});let s=await gmn.getAzdAccessToken(o,n,this.timeout,r.claims),c=s.stderr?.match("must use multi-factor authentication")||s.stderr?.match("reauthentication required"),l=s.stderr?.match("not logged in, run `azd login` to login")||s.stderr?.match("not logged in, run `azd auth login` to login");if(s.stderr?.match("azd:(.*)not found")||s.stderr?.startsWith("'azd' is not recognized")||s.error&&s.error.code==="ENOENT"){let d=new Fn(lWe.notInstalled);throw kO.getToken.info($s(e,d)),d}if(l){let d=new Fn(lWe.login);throw kO.getToken.info($s(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Fn(`${lWe.claim} ${f}`);throw kO.getToken.info($s(e,h)),h}try{let d=JSON.parse(s.stdout);return kO.getToken.info(hg(e)),{token:d.token,expiresOnTimestamp:new Date(d.expiresOn).getTime(),tokenType:"Bearer"}}catch(d){throw s.stderr?new Fn(s.stderr):d}}catch(s){let c=s.name==="CredentialUnavailableError"?s:new Fn(s.message||lWe.unknown);throw kO.getToken.info($s(e,c)),c}})}};p();var Amn=fe(require("child_process"),1);p();function kUt(t,e){if(!e.match(/^[0-9a-zA-Z-._ ]+$/)){let r=new Error(`Subscription '${e}' contains invalid characters. If this is the name of a subscription, use its ID instead. You can locate your subscription by following the instructions listed here: https://learn.microsoft.com/azure/azure-portal/get-subscription-tenant-id`);throw t.info($s("",r)),r}}a(kUt,"checkSubscription");var J1=fo("AzureCliCredential"),gxe={claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",notInstalled:"Azure CLI could not be found. Please visit https://aka.ms/azure-cli for installation instructions and then, once installed, authenticate to your Azure account using 'az login'.",login:"Please run 'az login' from a command prompt to authenticate before using this credential.",unknown:"Unknown error while trying to retrieve the access token",unexpectedResponse:'Unexpected response from Azure CLI when getting token. Expected "expiresOn" to be a RFC3339 date string. Got:'},ymn={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(J1.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzureCliAccessToken(t,e,r,n){let o=[],s=[];return e&&(o=["--tenant",e]),r&&(s=["--subscription",`"${r}"`]),new Promise((c,l)=>{try{let d=["az",...["account","get-access-token","--output","json","--resource",t,...o,...s]].join(" ");Amn.default.exec(d,{cwd:ymn.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},Axe=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&(g0(J1,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(kUt(J1,e?.subscription),this.subscription=e?.subscription),this.additionallyAllowedTenantIds=ap(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=typeof e=="string"?e:e[0],o=r.claims;if(o&&o.trim()){let l=`az login --claims-challenge ${btoa(o)} --scope ${n}`,u=r.tenantId;u&&(l+=` --tenant ${u}`);let d=new Fn(`${gxe.claim} ${l}`);throw J1.getToken.info($s(n,d)),d}let s=Rf(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&g0(J1,s),this.subscription&&kUt(J1,this.subscription),J1.getToken.info(`Using the scope ${n}`),Vc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{zle(n,J1);let c=aWe(n),l=await ymn.getAzureCliAccessToken(c,s,this.subscription,this.timeout),u=l.stderr?.match("(.*)az login --scope(.*)"),d=l.stderr?.match("(.*)az login(.*)")&&!u;if(l.stderr?.match("az:(.*)not found")||l.stderr?.startsWith("'az' is not recognized")){let h=new Fn(gxe.notInstalled);throw J1.getToken.info($s(e,h)),h}if(d){let h=new Fn(gxe.login);throw J1.getToken.info($s(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return J1.getToken.info(hg(e)),m}catch(h){throw l.stderr?new Fn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Fn(c.message||gxe.unknown);throw J1.getToken.info($s(e,l)),l}})}parseRawResponse(e){let r=JSON.parse(e),n=r.accessToken,o=Number.parseInt(r.expires_on,10)*1e3;if(!isNaN(o))return J1.getToken.info("expires_on is available and is valid, using it"),{token:n,expiresOnTimestamp:o,tokenType:"Bearer"};if(o=new Date(r.expiresOn).getTime(),isNaN(o))throw new Fn(`${gxe.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var _mn=fe(require("node:child_process"),1),Emn={execFile(t,e,r){return new Promise((n,o)=>{_mn.default.execFile(t,e,r,(s,c,l)=>{Buffer.isBuffer(c)&&(c=c.toString("utf8")),Buffer.isBuffer(l)&&(l=l.toString("utf8")),l||s?o(l?new Error(l):s):n(c)})})}};var PO=fo("AzurePowerShellCredential"),Cmn=process.platform==="win32";function bmn(t){return Cmn?`${t}.exe`:t}a(bmn,"formatCommand");async function vmn(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await Emn.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(vmn,"runCommands");var Smn={login:"Run Connect-AzAccount to login",installed:"The specified module 'Az.Accounts' with version '2.2.0' was not loaded because no valid module file was found in any module directory"},uWe={login:"Please run 'Connect-AzAccount' from PowerShell to authenticate before using this credential.",installed:`The 'Az.Account' module >= 2.2.0 is not installed. Install the Azure Az PowerShell module with: "Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force".`,claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",troubleshoot:"To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot."},P8o=a(t=>t.message.match(`(.*)${Smn.login}(.*)`),"isLoginError"),D8o=a(t=>t.message.match(Smn.installed),"isNotInstalledError"),PUt=[bmn("pwsh")];Cmn&&PUt.push(bmn("powershell"));var yxe=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(g0(PO,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=ap(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...PUt]){try{await vmn([[o,"/?"]],n)}catch{PUt.shift();continue}let c=(await vmn([[o,"-NoProfile","-NonInteractive","-Command",` $tenantId = "${r??""}" $m = Import-Module Az.Accounts -MinimumVersion 2.2.0 -PassThru $useSecureString = $m.Version -ge [version]'2.17.0' -and $m.Version -lt [version]'5.0.0' @@ -1771,26 +1771,26 @@ Error Description: '${s.message}'`,this.correlationId)}return null}return n||(th } Write-Output (ConvertTo-Json $result) - `]]))[0];return P8o(c)}throw new Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(e,r={}){return Vc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{let n=typeof e=="string"?e:e[0],o=r.claims;if(o&&o.trim()){let l=`Connect-AzAccount -ClaimsChallenge ${btoa(o)}`,u=r.tenantId;u&&(l+=` -Tenant ${u}`);let d=new Fn(`${uWe.claim} ${l}`);throw PO.getToken.info($s(n,d)),d}let s=Rf(this.tenantId,r,this.additionallyAllowedTenantIds);s&&m0(PO,s);try{Wle(n,PO),PO.getToken.info(`Using the scope ${n}`);let c=aWe(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return PO.getToken.info(pg(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(k8o(c)){let u=new Fn(uWe.installed);throw PO.getToken.info($s(n,u)),u}else if(R8o(c)){let u=new Fn(uWe.login);throw PO.getToken.info($s(n,u)),u}let l=new Fn(`${c}. ${uWe.troubleshoot}`);throw PO.getToken.info($s(n,l)),l}})}};async function P8o(t){let e=/{[^{}]*}/g,r=t.match(e),n=t;if(r)try{for(let o of r)try{let s=JSON.parse(o);if(s?.Token)return n=n.replace(o,""),n&&PO.getToken.warning(n),s}catch{continue}}catch{throw new Error(`Unable to parse the output of PowerShell. Received output: ${t}`)}throw new Error(`No access token found in the output. Received output: ${t}`)}a(P8o,"parseJsonToken");p();var Smn=require("node:fs/promises");var D8o="common",N8o="aebc6443-996d-45c2-90f0-388ff96faa56",PUt=fo("VisualStudioCodeCredential"),M8o={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function O8o(t){let e=M8o[t];if(e)throw new Fn(e)}a(O8o,"checkUnsupportedTenant");var _xe=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?(m0(PUt,e.tenantId),this.tenantId=e.tenantId):this.tenantId=D8o,this.additionallyAllowedTenantIds=ap(e?.additionallyAllowedTenants),O8o(this.tenantId)}async prepare(e){let r=Rf(this.tenantId,this.options,this.additionallyAllowedTenantIds,PUt)||this.tenantId;if(!Vsn()||!mGe)throw new Fn("Visual Studio Code Authentication is not available. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");let n=await this.loadAuthRecord(mGe,e);this.msalClient=A_(N8o,r,{...this.options,isVSCodeCredential:!0,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0},authenticationRecord:n})}preparePromise;prepareOnce(e){return this.preparePromise||(this.preparePromise=this.prepare(e)),this.preparePromise}async getToken(e,r){let n=aw(e);if(await this.prepareOnce(n),!this.msalClient)throw new Fn("Visual Studio Code Authentication failed to initialize. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");return this.msalClient.getTokenByInteractiveRequest(n,{...r,disableAutomaticAuthentication:!0})}async loadAuthRecord(e,r){try{let n=await(0,Smn.readFile)(e,{encoding:"utf8"});return o6t(n)}catch(n){throw PUt.getToken.info($s(r,n)),new Fn("Cannot load authentication record in Visual Studio Code. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.")}}};p();var dWe=fo("BrokerCredential"),fWe=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=Gle(dWe,e.tenantId),this.brokerAdditionallyAllowedTenantIds=ap(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:dWe,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=A_(YY,this.brokerTenantId,r)}async getToken(e,r={}){return Vc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=Rf(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,dWe);let o=aw(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw dWe.getToken.info($s(o,s)),new Fn("Failed to acquire token using broker authentication",{cause:s})}})}};function Tmn(t={}){return new fWe(t)}a(Tmn,"createDefaultBrokerCredential");function DUt(t={}){return new _xe(t)}a(DUt,"createDefaultVisualStudioCodeCredential");function NUt(t={}){t.retryOptions??={maxRetries:5,retryDelayInMs:800},t.sendProbeRequest??=!0;let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,r=t?.workloadIdentityClientId??e,n=t?.managedIdentityResourceId,o=process.env.AZURE_FEDERATED_TOKEN_FILE,s=t?.tenantId??process.env.AZURE_TENANT_ID;if(n){let c={...t,resourceId:n};return new YQ(c)}if(o&&r){let c={...t,tenantId:s};return new YQ(r,c)}if(e){let c={...t,clientId:e};return new YQ(c)}return new YQ(t)}a(NUt,"createDefaultManagedIdentityCredential");function MUt(t){let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,r=t?.workloadIdentityClientId??e,n=process.env.AZURE_FEDERATED_TOKEN_FILE,o=t?.tenantId??process.env.AZURE_TENANT_ID;if(n&&r){let s={...t,tenantId:o,clientId:r,tokenFilePath:n};return new X3(s)}if(o){let s={...t,tenantId:o};return new X3(s)}return new X3(t)}a(MUt,"createDefaultWorkloadIdentityCredential");function OUt(t={}){return new mxe(t)}a(OUt,"createDefaultAzureDeveloperCliCredential");function LUt(t={}){return new Axe(t)}a(LUt,"createDefaultAzureCliCredential");function BUt(t={}){return new yxe(t)}a(BUt,"createDefaultAzurePowershellCredential");function FUt(t={}){return new pxe(t)}a(FUt,"createDefaultEnvironmentCredential");var pWe=fo("DefaultAzureCredential"),UUt=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return pWe.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},Yle=class extends jTe{static{a(this,"DefaultAzureCredential")}constructor(e){L8o(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[DUt,LUt,BUt,OUt,Tmn],o=[FUt,MUt,NUt],s=[],c="EnvironmentCredential, WorkloadIdentityCredential, ManagedIdentityCredential, VisualStudioCodeCredential, AzureCliCredential, AzurePowerShellCredential, AzureDeveloperCliCredential";if(r)switch(r){case"dev":s=n;break;case"prod":s=o;break;case"environmentcredential":s=[FUt];break;case"workloadidentitycredential":s=[MUt];break;case"managedidentitycredential":s=[()=>NUt({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[DUt];break;case"azureclicredential":s=[LUt];break;case"azurepowershellcredential":s=[BUt];break;case"azuredeveloperclicredential":s=[OUt];break;default:{let u=`Invalid value for AZURE_TOKEN_CREDENTIALS = ${process.env.AZURE_TOKEN_CREDENTIALS}. Valid values are 'prod' or 'dev' or any of these credentials - ${c}.`;throw pWe.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return pWe.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new UUt(u.name,d.message)}});super(...l)}};function L8o(t){if(t?.requiredEnvVars){let r=(Array.isArray(t.requiredEnvVars)?t.requiredEnvVars:[t.requiredEnvVars]).filter(n=>!process.env[n]);if(r.length>0){let n=`Required environment ${r.length===1?"variable":"variables"} '${r.join(", ")}' for DefaultAzureCredential ${r.length===1?"is":"are"} not set or empty.`;throw pWe.warning(n),new Error(n)}}}a(L8o,"validateRequiredEnvVars");p();var y2u=fo("InteractiveBrowserCredential");p();var w2u=fo("DeviceCodeCredential");p();var B8o="AzurePipelinesCredential",F2u=fo(B8o);p();var z2u=fo("AuthorizationCodeCredential");p();var F8o="OnBehalfOfCredential",iDu=fo(F8o);p();var hWe=new pe("capiFetchUtilities");function om(t){let e={...s_(t),"X-GitHub-Api-Version":"2026-06-01"},r=AWe(t.get(Ir));return r&&(e["Copilot-Integration-Id"]=r),e}a(om,"getCapiHeaders");function Imn(t,e){return hWe.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":jz.api,"Copilot-Integration-Id":"autodev-test"}}a(Imn,"addMsBenchCesProxyHeaders");async function xmn(t,e){let r=process.env.INTEGRATION_ID_FOR_HMAC_SECRET;hWe.info(t,"Using HMAC authentication mode for msbench with integration id",r);let n=await Bsn(process.env.HMAC_SECRET,r);return{...e,...n}}a(xmn,"addMsBenchHmacHeaders");function U8o(){return n3()&&!!process.env.HMAC_SECRET}a(U8o,"isMsBenchHmacModeEnabled");function QUt(){return n3()&&!process.env.HMAC_SECRET}a(QUt,"isMsBenchCesProxyModeEnabled");async function mWe(t,e){return process.env.HMAC_SECRET?await xmn(t,e):Imn(t,e)}a(mWe,"addMsBenchHeaders");async function Kle(t,e,r){let n=r;QUt()&&(n=await Q8o());let o={...e,Authorization:`Bearer ${n}`};return{headers:U8o()?await xmn(t,o):QUt()?Imn(t,o):o,token:n}}a(Kle,"applyMsBenchAuth");function Jle(t,e,...r){if(QUt()){hWe.debug(t,"Using CES proxy endpoint for URL generation");let n=r.join("/");return n.startsWith("/")&&(n=n.slice(1)),`https://ces-dev1.azurewebsites.net/api/proxy/${n}`}return Px(t,e,"api",...r)}a(Jle,"getCapiUrl");function Zle(t,e,r){(e.status===401||e.status===403)&&(hWe.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Qt).resetToken("capi_fetch",e.status))}a(Zle,"handleCapiAuthError");async function xK(t,e,r){r??=await t.get(Qt).getToken();let n=Jle(t,r,e),{headers:o}=await Kle(t,om(t),r.token),s=await t.get(Jt).fetch(new URL(n).href,{method:"GET",headers:o});return Zle(t,s,e),s}a(xK,"fetchCapiUrl");async function gWe(t,e,r){let n=await t.get(Qt).getToken(),o=Jle(t,n,e),{headers:s}=await Kle(t,om(t),n.token),c=await t.get(Jt).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return Zle(t,c,e),c}a(gWe,"postCapiUrl");async function Q8o(){let e=await new Yle().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(Q8o,"getMsBenchToken");p();var Rmn=600*1e3,kn={Gpt35turbo:"gpt-3.5-turbo",Gpt4:"gpt-4",Gpt4turbo:"gpt-4-turbo",Gpt4o:"gpt-4o",Gpt4oMini:"gpt-4o-mini",O1Mini:"o1-mini",O1Ga:"o1-ga",Claude35Sonnet:"claude-3.5-sonnet",O3Mini:"o3-mini",Gemini20Flash:"gemini-2.0-flash",Gemini20Pro:"gemini-2.0-pro",Claude37Sonnet:"claude-3.7-sonnet",Claude37SonnetThought:"claude-3.7-sonnet-thought",Gpt45:"gpt-4.5",Gpt41:"gpt-4.1",Gpt5:"gpt-5",Gpt5Mini:"gpt-5-mini",Gpt5CodeX:"gpt-5-codex",Gpt51:"gpt-5.1",Gpt51CodeX:"gpt-5.1-codex",Gpt51CodeXMini:"gpt-5.1-codex-mini",Gpt52:"gpt-5.2",Gpt54Mini:"gpt-5.4-mini",ClaudeHaiku45:"claude-haiku-4.5",Gemini3Flash:"gemini-3-flash",CopilotBase:"copilot-base",BYOK:"byok",Unknown:"unknown"},EWe={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},Xle=new Set([kn.O1Ga,kn.O3Mini,kn.O1Mini,kn.Gemini20Pro,kn.Gemini20Flash]);function vWe(t){return t.startsWith("claude")}a(vWe,"isClaudeFamily");function Z1(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[kn.Gpt4o]:r=[kn.Gpt4o,kn.Gpt4turbo,kn.Gpt4,kn.O1Mini,kn.O1Ga,kn.Claude35Sonnet,kn.O3Mini,kn.Gemini20Flash,kn.Claude37Sonnet,kn.Claude37SonnetThought,kn.Gpt45,kn.Gpt41,kn.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[kn.Gpt4oMini]:r=[kn.Gpt4oMini,kn.Gpt4o,kn.Gpt35turbo,kn.Gpt41,kn.CopilotBase];break;case"gitCommit":e?r=[kn.Gpt4oMini]:r=[kn.Gpt4oMini,kn.Gpt4o,kn.Gpt4,kn.Gpt41,kn.CopilotBase];break;case"nesStubs":e?r=[kn.Gpt4oMini]:r=[kn.Gpt4oMini,kn.Gpt4o,kn.Gpt41,kn.CopilotBase];break;case"codeMapper":r=[kn.Gpt41]}return r}a(Z1,"getSupportedModelFamiliesForPrompt");var kmn={textEmbedding3Small:"text-embedding-3-small"},q8o=b.Object({type:b.Union([b.Literal("chat"),b.Literal("embeddings"),b.Literal("completion")]),tokenizer:b.String(),family:b.String(),object:b.String(),supports:b.Optional(b.Object({tool_calls:b.Optional(b.Boolean()),parallel_tool_calls:b.Optional(b.Boolean()),streaming:b.Optional(b.Boolean()),vision:b.Optional(b.Boolean()),adaptive_thinking:b.Optional(b.Boolean()),reasoning_effort:b.Optional(b.Array(b.String()))})),limits:b.Optional(b.Object({max_inputs:b.Optional(b.Number()),max_prompt_tokens:b.Optional(b.Number()),max_output_tokens:b.Optional(b.Number()),max_non_streaming_output_tokens:b.Optional(b.Number()),max_context_window_tokens:b.Optional(b.Number())}))}),wmn=b.Object({cache_price:b.Optional(b.Number()),cache_write_price:b.Optional(b.Number()),input_price:b.Optional(b.Number()),output_price:b.Optional(b.Number()),context_max:b.Optional(b.Number())}),j8o=b.Object({id:b.String(),vendor:b.Optional(b.String()),name:b.String(),version:b.String(),model_picker_enabled:b.Boolean(),model_picker_category:b.Optional(b.String()),model_picker_price_category:b.Optional(b.String()),is_chat_default:b.Optional(b.Boolean()),is_chat_fallback:b.Optional(b.Boolean()),capabilities:q8o,billing:b.Optional(b.Object({is_premium:b.Optional(b.Boolean()),multiplier:b.Optional(b.Number()),token_prices:b.Optional(b.Object({batch_size:b.Optional(b.Number()),default:b.Optional(wmn),long_context:b.Optional(wmn)})),promo:b.Optional(b.Object({id:b.String(),discount_percent:b.Number(),ends_at:b.String(),message:b.String()}))})),custom_model:b.Optional(b.Object({key_name:b.Optional(b.String()),owner_name:b.Optional(b.String()),owner_type:b.Optional(b.String()),provider:b.Optional(b.String())})),object:b.String(),preview:b.Optional(b.Boolean()),isExperimental:b.Optional(b.Boolean()),policy:b.Optional(b.Object({state:b.String(),terms:b.String()})),supported_endpoints:b.Optional(b.Array(b.String())),warning_messages:b.Optional(b.Array(b.Object({message:b.String()}))),info_messages:b.Optional(b.Array(b.Object({message:b.String()})))}),Pmn=b.Object({data:b.Array(j8o)});function Dmn(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(Dmn,"getDegradationReason");var Ns=class{static{a(this,"ModelMetadataProvider")}},yWe=class extends Ns{constructor(r){super();this.ctx=r;this._metadata=[];this._lastFetchTime=0;this._xGithubRequestId=void 0;this.allowTokenRefresh=a(()=>{this._lastFetchTime=0},"allowTokenRefresh");r.get(Qt).onDidResetToken(this.allowTokenRefresh)}static{a(this,"CapiModelMetadataProvider")}async getMetadata(r){return(r||this.shouldRefreshModels())&&await this.fetchMetadata(),this._metadata.slice()}async getModelMetadataList(){return this.shouldRefreshModels()&&await this.fetchMetadata(),{models:this._metadata.slice(),xGithubRequestId:this._xGithubRequestId}}async getFallbackModel(){return(await this.getMetadata()).find(n=>n.is_chat_fallback)}async fetchMetadata(){let r=await xK(this.ctx,"/models");if(this._xGithubRequestId=r.headers.get("X-GitHub-Request-Id")??void 0,r.status<200||r.status>=300){if(r.status===429&&this._metadata.length>0){Br.error(this.ctx,"Rate limited while fetching models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId});return}throw Br.error(this.ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId}),new Rx(r)}await this.processModels(r)}async fetchModel(r){let n=await xK(this.ctx,`/models/${r}`);if(!n.ok){Br.error(this.ctx,`Failed to fetch model ${r} from CAPI`,{status:n.status,statusText:n.statusText,xGithubRequestId:this._xGithubRequestId});return}return await n.json()}async acceptModelPolicy(r){return(await gWe(this.ctx,`/models/${r}/policy`,JSON.stringify({status:"enabled"}))).ok?(await this.fetchMetadata(),!0):!1}async processModels(r){try{let n=await r.json();this._metadata=n.data,this._lastFetchTime=Date.now()}catch(n){Br.error(this.ctx,"Failed to parse models from CAPI",{error:n})}}shouldRefreshModels(){return this._metadata.length===0||!this._lastFetchTime?!0:this.isLastFetchOlderTenMinutes()}isLastFetchOlderTenMinutes(){return Date.now()-this._lastFetchTime>Rmn}},_We=class extends Ns{constructor(r,n){super();this.ctx=r;this.delegate=n;this._exp_models_cache=new Map}static{a(this,"ExpModelMetadataProvider")}async getMetadata(r){let n=this.ctx.get(tr),o=await n.fetchTokenAndUpdateExPValuesAndAssignments(),s=n.ideChatExpModelIds(o),c=[];if(s){let l=s?.split(",");for(let u of l){let d=await this.fetchModel(u.trim());d!==void 0&&(d.isExperimental=!0,c.push(d))}}return c.concat(await this.delegate.getMetadata(r))}async getModelMetadataList(){return this.delegate.getModelMetadataList()}async fetchModel(r){let n=this._exp_models_cache.get(r);if(n){let[s,c]=n;if(Date.now()-c0?e:null}a(Nmn,"getUserSelectedModelConfiguration");p();p();p();var KQ=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();p();var Mmn=fe(require("node:fs/promises")),CWe=fe(require("node:path"));async function bWe(t){return await Mmn.readFile(Exe(t))}a(bWe,"readFile");function Exe(t){return CWe.default.resolve(CWe.default.extname(__filename)!==".ts"?__dirname:CWe.default.resolve(__dirname,"../../dist"),t)}a(Exe,"locateFile");var qUt=fe(require("node:fs")),vxe=fe(require("node:path"));function Lmn(){let t=vxe.join("compiled",process.platform,process.arch,"copilot-tokenizer.node"),e=[vxe.join(__dirname,t),vxe.join(__dirname,"../../../packages/copilot-tokenizer",t)],r=[];for(let n of e)try{return{binding:require(n)}}catch(o){r.push(`${n}: ${o instanceof Error?o.message:String(o)}`)}return{error:new Error(`could not load copilot-tokenizer.node: + `]]))[0];return N8o(c)}throw new Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(e,r={}){return Vc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{let n=typeof e=="string"?e:e[0],o=r.claims;if(o&&o.trim()){let l=`Connect-AzAccount -ClaimsChallenge ${btoa(o)}`,u=r.tenantId;u&&(l+=` -Tenant ${u}`);let d=new Fn(`${uWe.claim} ${l}`);throw PO.getToken.info($s(n,d)),d}let s=Rf(this.tenantId,r,this.additionallyAllowedTenantIds);s&&g0(PO,s);try{zle(n,PO),PO.getToken.info(`Using the scope ${n}`);let c=aWe(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return PO.getToken.info(hg(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(D8o(c)){let u=new Fn(uWe.installed);throw PO.getToken.info($s(n,u)),u}else if(P8o(c)){let u=new Fn(uWe.login);throw PO.getToken.info($s(n,u)),u}let l=new Fn(`${c}. ${uWe.troubleshoot}`);throw PO.getToken.info($s(n,l)),l}})}};async function N8o(t){let e=/{[^{}]*}/g,r=t.match(e),n=t;if(r)try{for(let o of r)try{let s=JSON.parse(o);if(s?.Token)return n=n.replace(o,""),n&&PO.getToken.warning(n),s}catch{continue}}catch{throw new Error(`Unable to parse the output of PowerShell. Received output: ${t}`)}throw new Error(`No access token found in the output. Received output: ${t}`)}a(N8o,"parseJsonToken");p();var Tmn=require("node:fs/promises");var M8o="common",O8o="aebc6443-996d-45c2-90f0-388ff96faa56",DUt=fo("VisualStudioCodeCredential"),L8o={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function B8o(t){let e=L8o[t];if(e)throw new Fn(e)}a(B8o,"checkUnsupportedTenant");var _xe=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?(g0(DUt,e.tenantId),this.tenantId=e.tenantId):this.tenantId=M8o,this.additionallyAllowedTenantIds=ap(e?.additionallyAllowedTenants),B8o(this.tenantId)}async prepare(e){let r=Rf(this.tenantId,this.options,this.additionallyAllowedTenantIds,DUt)||this.tenantId;if(!Wsn()||!mGe)throw new Fn("Visual Studio Code Authentication is not available. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");let n=await this.loadAuthRecord(mGe,e);this.msalClient=A_(O8o,r,{...this.options,isVSCodeCredential:!0,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0},authenticationRecord:n})}preparePromise;prepareOnce(e){return this.preparePromise||(this.preparePromise=this.prepare(e)),this.preparePromise}async getToken(e,r){let n=aw(e);if(await this.prepareOnce(n),!this.msalClient)throw new Fn("Visual Studio Code Authentication failed to initialize. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");return this.msalClient.getTokenByInteractiveRequest(n,{...r,disableAutomaticAuthentication:!0})}async loadAuthRecord(e,r){try{let n=await(0,Tmn.readFile)(e,{encoding:"utf8"});return s6t(n)}catch(n){throw DUt.getToken.info($s(r,n)),new Fn("Cannot load authentication record in Visual Studio Code. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.")}}};p();var dWe=fo("BrokerCredential"),fWe=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=$le(dWe,e.tenantId),this.brokerAdditionallyAllowedTenantIds=ap(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:dWe,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=A_(KY,this.brokerTenantId,r)}async getToken(e,r={}){return Vc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=Rf(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,dWe);let o=aw(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw dWe.getToken.info($s(o,s)),new Fn("Failed to acquire token using broker authentication",{cause:s})}})}};function Imn(t={}){return new fWe(t)}a(Imn,"createDefaultBrokerCredential");function NUt(t={}){return new _xe(t)}a(NUt,"createDefaultVisualStudioCodeCredential");function MUt(t={}){t.retryOptions??={maxRetries:5,retryDelayInMs:800},t.sendProbeRequest??=!0;let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,r=t?.workloadIdentityClientId??e,n=t?.managedIdentityResourceId,o=process.env.AZURE_FEDERATED_TOKEN_FILE,s=t?.tenantId??process.env.AZURE_TENANT_ID;if(n){let c={...t,resourceId:n};return new YQ(c)}if(o&&r){let c={...t,tenantId:s};return new YQ(r,c)}if(e){let c={...t,clientId:e};return new YQ(c)}return new YQ(t)}a(MUt,"createDefaultManagedIdentityCredential");function OUt(t){let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,r=t?.workloadIdentityClientId??e,n=process.env.AZURE_FEDERATED_TOKEN_FILE,o=t?.tenantId??process.env.AZURE_TENANT_ID;if(n&&r){let s={...t,tenantId:o,clientId:r,tokenFilePath:n};return new X3(s)}if(o){let s={...t,tenantId:o};return new X3(s)}return new X3(t)}a(OUt,"createDefaultWorkloadIdentityCredential");function LUt(t={}){return new mxe(t)}a(LUt,"createDefaultAzureDeveloperCliCredential");function BUt(t={}){return new Axe(t)}a(BUt,"createDefaultAzureCliCredential");function FUt(t={}){return new yxe(t)}a(FUt,"createDefaultAzurePowershellCredential");function UUt(t={}){return new pxe(t)}a(UUt,"createDefaultEnvironmentCredential");var pWe=fo("DefaultAzureCredential"),QUt=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return pWe.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},Kle=class extends jTe{static{a(this,"DefaultAzureCredential")}constructor(e){F8o(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[NUt,BUt,FUt,LUt,Imn],o=[UUt,OUt,MUt],s=[],c="EnvironmentCredential, WorkloadIdentityCredential, ManagedIdentityCredential, VisualStudioCodeCredential, AzureCliCredential, AzurePowerShellCredential, AzureDeveloperCliCredential";if(r)switch(r){case"dev":s=n;break;case"prod":s=o;break;case"environmentcredential":s=[UUt];break;case"workloadidentitycredential":s=[OUt];break;case"managedidentitycredential":s=[()=>MUt({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[NUt];break;case"azureclicredential":s=[BUt];break;case"azurepowershellcredential":s=[FUt];break;case"azuredeveloperclicredential":s=[LUt];break;default:{let u=`Invalid value for AZURE_TOKEN_CREDENTIALS = ${process.env.AZURE_TOKEN_CREDENTIALS}. Valid values are 'prod' or 'dev' or any of these credentials - ${c}.`;throw pWe.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return pWe.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new QUt(u.name,d.message)}});super(...l)}};function F8o(t){if(t?.requiredEnvVars){let r=(Array.isArray(t.requiredEnvVars)?t.requiredEnvVars:[t.requiredEnvVars]).filter(n=>!process.env[n]);if(r.length>0){let n=`Required environment ${r.length===1?"variable":"variables"} '${r.join(", ")}' for DefaultAzureCredential ${r.length===1?"is":"are"} not set or empty.`;throw pWe.warning(n),new Error(n)}}}a(F8o,"validateRequiredEnvVars");p();var E2u=fo("InteractiveBrowserCredential");p();var k2u=fo("DeviceCodeCredential");p();var U8o="AzurePipelinesCredential",Q2u=fo(U8o);p();var K2u=fo("AuthorizationCodeCredential");p();var Q8o="OnBehalfOfCredential",sDu=fo(Q8o);p();var hWe=new pe("capiFetchUtilities");function om(t){let e={...s_(t),"X-GitHub-Api-Version":"2026-06-01"},r=AWe(t.get(Ir));return r&&(e["Copilot-Integration-Id"]=r),e}a(om,"getCapiHeaders");function xmn(t,e){return hWe.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":Hz.api,"Copilot-Integration-Id":"autodev-test"}}a(xmn,"addMsBenchCesProxyHeaders");async function wmn(t,e){let r=process.env.INTEGRATION_ID_FOR_HMAC_SECRET;hWe.info(t,"Using HMAC authentication mode for msbench with integration id",r);let n=await Fsn(process.env.HMAC_SECRET,r);return{...e,...n}}a(wmn,"addMsBenchHmacHeaders");function q8o(){return n3()&&!!process.env.HMAC_SECRET}a(q8o,"isMsBenchHmacModeEnabled");function qUt(){return n3()&&!process.env.HMAC_SECRET}a(qUt,"isMsBenchCesProxyModeEnabled");async function mWe(t,e){return process.env.HMAC_SECRET?await wmn(t,e):xmn(t,e)}a(mWe,"addMsBenchHeaders");async function Jle(t,e,r){let n=r;qUt()&&(n=await j8o());let o={...e,Authorization:`Bearer ${n}`};return{headers:q8o()?await wmn(t,o):qUt()?xmn(t,o):o,token:n}}a(Jle,"applyMsBenchAuth");function Zle(t,e,...r){if(qUt()){hWe.debug(t,"Using CES proxy endpoint for URL generation");let n=r.join("/");return n.startsWith("/")&&(n=n.slice(1)),`https://ces-dev1.azurewebsites.net/api/proxy/${n}`}return Px(t,e,"api",...r)}a(Zle,"getCapiUrl");function Xle(t,e,r){(e.status===401||e.status===403)&&(hWe.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Qt).resetToken("capi_fetch",e.status))}a(Xle,"handleCapiAuthError");async function wK(t,e,r){r??=await t.get(Qt).getToken();let n=Zle(t,r,e),{headers:o}=await Jle(t,om(t),r.token),s=await t.get(Jt).fetch(new URL(n).href,{method:"GET",headers:o});return Xle(t,s,e),s}a(wK,"fetchCapiUrl");async function gWe(t,e,r){let n=await t.get(Qt).getToken(),o=Zle(t,n,e),{headers:s}=await Jle(t,om(t),n.token),c=await t.get(Jt).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return Xle(t,c,e),c}a(gWe,"postCapiUrl");async function j8o(){let e=await new Kle().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(j8o,"getMsBenchToken");p();var kmn=600*1e3,kn={Gpt35turbo:"gpt-3.5-turbo",Gpt4:"gpt-4",Gpt4turbo:"gpt-4-turbo",Gpt4o:"gpt-4o",Gpt4oMini:"gpt-4o-mini",O1Mini:"o1-mini",O1Ga:"o1-ga",Claude35Sonnet:"claude-3.5-sonnet",O3Mini:"o3-mini",Gemini20Flash:"gemini-2.0-flash",Gemini20Pro:"gemini-2.0-pro",Claude37Sonnet:"claude-3.7-sonnet",Claude37SonnetThought:"claude-3.7-sonnet-thought",Gpt45:"gpt-4.5",Gpt41:"gpt-4.1",Gpt5:"gpt-5",Gpt5Mini:"gpt-5-mini",Gpt5CodeX:"gpt-5-codex",Gpt51:"gpt-5.1",Gpt51CodeX:"gpt-5.1-codex",Gpt51CodeXMini:"gpt-5.1-codex-mini",Gpt52:"gpt-5.2",Gpt54Mini:"gpt-5.4-mini",ClaudeHaiku45:"claude-haiku-4.5",Gemini3Flash:"gemini-3-flash",CopilotBase:"copilot-base",BYOK:"byok",Unknown:"unknown"},EWe={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},eue=new Set([kn.O1Ga,kn.O3Mini,kn.O1Mini,kn.Gemini20Pro,kn.Gemini20Flash]);function vWe(t){return t.startsWith("claude")}a(vWe,"isClaudeFamily");function Z1(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[kn.Gpt4o]:r=[kn.Gpt4o,kn.Gpt4turbo,kn.Gpt4,kn.O1Mini,kn.O1Ga,kn.Claude35Sonnet,kn.O3Mini,kn.Gemini20Flash,kn.Claude37Sonnet,kn.Claude37SonnetThought,kn.Gpt45,kn.Gpt41,kn.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[kn.Gpt4oMini]:r=[kn.Gpt4oMini,kn.Gpt4o,kn.Gpt35turbo,kn.Gpt41,kn.CopilotBase];break;case"gitCommit":e?r=[kn.Gpt4oMini]:r=[kn.Gpt4oMini,kn.Gpt4o,kn.Gpt4,kn.Gpt41,kn.CopilotBase];break;case"nesStubs":e?r=[kn.Gpt4oMini]:r=[kn.Gpt4oMini,kn.Gpt4o,kn.Gpt41,kn.CopilotBase];break;case"codeMapper":r=[kn.Gpt41]}return r}a(Z1,"getSupportedModelFamiliesForPrompt");var Pmn={textEmbedding3Small:"text-embedding-3-small"},H8o=b.Object({type:b.Union([b.Literal("chat"),b.Literal("embeddings"),b.Literal("completion")]),tokenizer:b.String(),family:b.String(),object:b.String(),supports:b.Optional(b.Object({tool_calls:b.Optional(b.Boolean()),parallel_tool_calls:b.Optional(b.Boolean()),streaming:b.Optional(b.Boolean()),vision:b.Optional(b.Boolean()),adaptive_thinking:b.Optional(b.Boolean()),reasoning_effort:b.Optional(b.Array(b.String()))})),limits:b.Optional(b.Object({max_inputs:b.Optional(b.Number()),max_prompt_tokens:b.Optional(b.Number()),max_output_tokens:b.Optional(b.Number()),max_non_streaming_output_tokens:b.Optional(b.Number()),max_context_window_tokens:b.Optional(b.Number())}))}),Rmn=b.Object({cache_price:b.Optional(b.Number()),cache_write_price:b.Optional(b.Number()),input_price:b.Optional(b.Number()),output_price:b.Optional(b.Number()),context_max:b.Optional(b.Number())}),G8o=b.Object({id:b.String(),vendor:b.Optional(b.String()),name:b.String(),version:b.String(),model_picker_enabled:b.Boolean(),model_picker_category:b.Optional(b.String()),model_picker_price_category:b.Optional(b.String()),is_chat_default:b.Optional(b.Boolean()),is_chat_fallback:b.Optional(b.Boolean()),capabilities:H8o,billing:b.Optional(b.Object({is_premium:b.Optional(b.Boolean()),multiplier:b.Optional(b.Number()),token_prices:b.Optional(b.Object({batch_size:b.Optional(b.Number()),default:b.Optional(Rmn),long_context:b.Optional(Rmn)})),promo:b.Optional(b.Object({id:b.String(),discount_percent:b.Number(),ends_at:b.String(),message:b.String()}))})),custom_model:b.Optional(b.Object({key_name:b.Optional(b.String()),owner_name:b.Optional(b.String()),owner_type:b.Optional(b.String()),provider:b.Optional(b.String())})),object:b.String(),preview:b.Optional(b.Boolean()),isExperimental:b.Optional(b.Boolean()),policy:b.Optional(b.Object({state:b.String(),terms:b.String()})),supported_endpoints:b.Optional(b.Array(b.String())),warning_messages:b.Optional(b.Array(b.Object({message:b.String()}))),info_messages:b.Optional(b.Array(b.Object({message:b.String()})))}),Dmn=b.Object({data:b.Array(G8o)});function Nmn(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(Nmn,"getDegradationReason");var Ns=class{static{a(this,"ModelMetadataProvider")}},yWe=class extends Ns{constructor(r){super();this.ctx=r;this._metadata=[];this._lastFetchTime=0;this._xGithubRequestId=void 0;this.allowTokenRefresh=a(()=>{this._lastFetchTime=0},"allowTokenRefresh");r.get(Qt).onDidResetToken(this.allowTokenRefresh)}static{a(this,"CapiModelMetadataProvider")}async getMetadata(r){return(r||this.shouldRefreshModels())&&await this.fetchMetadata(),this._metadata.slice()}async getModelMetadataList(){return this.shouldRefreshModels()&&await this.fetchMetadata(),{models:this._metadata.slice(),xGithubRequestId:this._xGithubRequestId}}async getFallbackModel(){return(await this.getMetadata()).find(n=>n.is_chat_fallback)}async fetchMetadata(){let r=await wK(this.ctx,"/models");if(this._xGithubRequestId=r.headers.get("X-GitHub-Request-Id")??void 0,r.status<200||r.status>=300){if(r.status===429&&this._metadata.length>0){Fr.error(this.ctx,"Rate limited while fetching models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId});return}throw Fr.error(this.ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId}),new Rx(r)}await this.processModels(r)}async fetchModel(r){let n=await wK(this.ctx,`/models/${r}`);if(!n.ok){Fr.error(this.ctx,`Failed to fetch model ${r} from CAPI`,{status:n.status,statusText:n.statusText,xGithubRequestId:this._xGithubRequestId});return}return await n.json()}async acceptModelPolicy(r){return(await gWe(this.ctx,`/models/${r}/policy`,JSON.stringify({status:"enabled"}))).ok?(await this.fetchMetadata(),!0):!1}async processModels(r){try{let n=await r.json();this._metadata=n.data,this._lastFetchTime=Date.now()}catch(n){Fr.error(this.ctx,"Failed to parse models from CAPI",{error:n})}}shouldRefreshModels(){return this._metadata.length===0||!this._lastFetchTime?!0:this.isLastFetchOlderTenMinutes()}isLastFetchOlderTenMinutes(){return Date.now()-this._lastFetchTime>kmn}},_We=class extends Ns{constructor(r,n){super();this.ctx=r;this.delegate=n;this._exp_models_cache=new Map}static{a(this,"ExpModelMetadataProvider")}async getMetadata(r){let n=this.ctx.get(tr),o=await n.fetchTokenAndUpdateExPValuesAndAssignments(),s=n.ideChatExpModelIds(o),c=[];if(s){let l=s?.split(",");for(let u of l){let d=await this.fetchModel(u.trim());d!==void 0&&(d.isExperimental=!0,c.push(d))}}return c.concat(await this.delegate.getMetadata(r))}async getModelMetadataList(){return this.delegate.getModelMetadataList()}async fetchModel(r){let n=this._exp_models_cache.get(r);if(n){let[s,c]=n;if(Date.now()-c0?e:null}a(Mmn,"getUserSelectedModelConfiguration");p();p();p();var KQ=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();p();var Omn=fe(require("node:fs/promises")),CWe=fe(require("node:path"));async function bWe(t){return await Omn.readFile(Exe(t))}a(bWe,"readFile");function Exe(t){return CWe.default.resolve(CWe.default.extname(__filename)!==".ts"?__dirname:CWe.default.resolve(__dirname,"../../dist"),t)}a(Exe,"locateFile");var jUt=fe(require("node:fs")),vxe=fe(require("node:path"));function Bmn(){let t=vxe.join("compiled",process.platform,process.arch,"copilot-tokenizer.node"),e=[vxe.join(__dirname,t),vxe.join(__dirname,"../../../packages/copilot-tokenizer",t)],r=[];for(let n of e)try{return{binding:require(n)}}catch(o){r.push(`${n}: ${o instanceof Error?o.message:String(o)}`)}return{error:new Error(`could not load copilot-tokenizer.node: ${r.join(` -`)}`)}}a(Lmn,"loadNativeTokenizer");var Omn=new Set;function H8o(t){return[Exe(`resources/${t}.tiktoken.noindex`),vxe.join(__dirname,"resources",`${t}.tiktoken.noindex`)]}a(H8o,"vocabularyCandidates");async function Bmn(t,e){if(!Omn.has(e)){if(!t.tokenEncoderInitialized(e)){let r=await qUt.promises.readFile(await G8o(e));t.tokenInitEncoder(e,r)}Omn.add(e)}}a(Bmn,"initializeEncoderAsync");async function G8o(t){let e=H8o(t);for(let r of e)try{return await qUt.promises.access(r),r}catch{}throw new Error(`vocabulary for "${t}" not found at ${e.join(" or ")}`)}a(G8o,"firstExistingVocabulary");var TWe=new Map;function Ms(t="o200k_base"){$Ut(t);let e=TWe.get(t);return e!==void 0?e:$8o(t)}a(Ms,"getTokenizer");var Fmn=new Map;function $8o(t){let e=Fmn.get(t);if(!e){let r=new JQ(t),n=a(()=>TWe.get(t)??r,"current");e={tokenLength:a(o=>n().tokenLength(o),"tokenLength"),tokenize:a(o=>n().tokenize(o),"tokenize"),detokenize:a(o=>n().detokenize(o),"detokenize"),tokenizeStrings:a(o=>n().tokenizeStrings(o),"tokenizeStrings"),takeLastTokens:a((o,s)=>n().takeLastTokens(o,s),"takeLastTokens"),takeFirstTokens:a((o,s)=>n().takeFirstTokens(o,s),"takeFirstTokens"),takeLastLinesTokens:a((o,s)=>n().takeLastLinesTokens(o,s),"takeLastLinesTokens")},Fmn.set(t,e)}return e}a($8o,"getUpgradingTokenizer");async function ZQ(t="o200k_base"){return await $Ut(t),Ms(t)}a(ZQ,"getTokenizerAsync");var SWe=Lmn(),HUt=class t{constructor(e,r){this._binding=e;this._encoder=r}static{a(this,"TTokenizer")}static async create(e){if(e!=="cl100k_base"&&e!=="o200k_base")throw new KQ("Could not load tokenizer",new Error(`unsupported encoder ${e}`));if(SWe.error)throw new KQ("Could not load tokenizer",SWe.error);try{return await Bmn(SWe.binding,e),new t(SWe.binding,e)}catch(r){throw r instanceof Error?new KQ("Could not load tokenizer",r):r}}tokenize(e){return this._binding.tokenEncode(e,this._encoder)}encode(e,r){return r!==void 0&&r.length>0?this._binding.tokenEncodeWithSpecial(e,this._encoder,[...r]):this._binding.tokenEncode(e,this._encoder)}detokenize(e){return this._binding.tokenDecode(e,this._encoder)}tokenLength(e){return this._binding.tokenCount(e,this._encoder)}tokenizeStrings(e){return this._binding.tokenEncodeStrings(e,this._encoder)}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.lengthTWe.get(t)??r,"current");e={tokenLength:a(o=>n().tokenLength(o),"tokenLength"),tokenize:a(o=>n().tokenize(o),"tokenize"),detokenize:a(o=>n().detokenize(o),"detokenize"),tokenizeStrings:a(o=>n().tokenizeStrings(o),"tokenizeStrings"),takeLastTokens:a((o,s)=>n().takeLastTokens(o,s),"takeLastTokens"),takeFirstTokens:a((o,s)=>n().takeFirstTokens(o,s),"takeFirstTokens"),takeLastLinesTokens:a((o,s)=>n().takeLastLinesTokens(o,s),"takeLastLinesTokens")},Umn.set(t,e)}return e}a(W8o,"getUpgradingTokenizer");async function ZQ(t="o200k_base"){return await VUt(t),Ms(t)}a(ZQ,"getTokenizerAsync");var SWe=Bmn(),GUt=class t{constructor(e,r){this._binding=e;this._encoder=r}static{a(this,"TTokenizer")}static async create(e){if(e!=="cl100k_base"&&e!=="o200k_base")throw new KQ("Could not load tokenizer",new Error(`unsupported encoder ${e}`));if(SWe.error)throw new KQ("Could not load tokenizer",SWe.error);try{return await Fmn(SWe.binding,e),new t(SWe.binding,e)}catch(r){throw r instanceof Error?new KQ("Could not load tokenizer",r):r}}tokenize(e){return this._binding.tokenEncode(e,this._encoder)}encode(e,r){return r!==void 0&&r.length>0?this._binding.tokenEncodeWithSpecial(e,this._encoder,[...r]):this._binding.tokenEncode(e,this._encoder)}detokenize(e){return this._binding.tokenDecode(e,this._encoder)}tokenLength(e){return this._binding.tokenCount(e,this._encoder)}tokenizeStrings(e){return this._binding.tokenEncodeStrings(e,this._encoder)}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.length{let r=0;for(let n=0;nr.toString()).join(" ")}tokenizeStrings(e){return e.split(/\b/)}tokenLength(e){return this.tokenizeStrings(e).length}takeLastTokens(e,r){let n=this.tokenizeStrings(e).slice(-r);return{text:n.join(""),tokens:n.map(this.hash)}}takeFirstTokens(e,r){let n=this.tokenizeStrings(e).slice(0,r);return{text:n.join(""),tokens:n.map(this.hash)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` +`);return n.substring(o+1)}},$Ut=class{constructor(){this.hash=a(e=>{let r=0;for(let n=0;nr.toString()).join(" ")}tokenizeStrings(e){return e.split(/\b/)}tokenLength(e){return this.tokenizeStrings(e).length}takeLastTokens(e,r){let n=this.tokenizeStrings(e).slice(-r);return{text:n.join(""),tokens:n.map(this.hash)}}takeFirstTokens(e,r){let n=this.tokenizeStrings(e).slice(0,r);return{text:n.join(""),tokens:n.map(this.hash)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` `)return n;let o=n.indexOf(` -`);return n.substring(o+1)}},V8o={cl100k_base:{python:3.99,typescript:4.54,typescriptreact:4.58,javascript:4.76,csharp:5.13,java:4.86,cpp:3.85,php:4.1,html:4.57,vue:4.22,go:3.93,dart:5.66,javascriptreact:4.81,css:3.37},o200k_base:{python:4.05,typescript:4.12,typescriptreact:5.01,javascript:4.47,csharp:5.47,java:4.86,cpp:3.8,php:4.35,html:4.86,vue:4.3,go:4.21,dart:5.7,javascriptreact:4.83,css:3.33}},jUt=4,JQ=class{constructor(e="o200k_base",r){this.languageId=r;this.tokenizerName=e}static{a(this,"ApproximateTokenizer")}tokenize(e){return this.tokenizeStrings(e).map(r=>{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-jUt),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-jUt)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?V8o[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(-Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeFirstTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(0,Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` +`);return n.substring(o+1)}},z8o={cl100k_base:{python:3.99,typescript:4.54,typescriptreact:4.58,javascript:4.76,csharp:5.13,java:4.86,cpp:3.85,php:4.1,html:4.57,vue:4.22,go:3.93,dart:5.66,javascriptreact:4.81,css:3.37},o200k_base:{python:4.05,typescript:4.12,typescriptreact:5.01,javascript:4.47,csharp:5.47,java:4.86,cpp:3.8,php:4.35,html:4.86,vue:4.3,go:4.21,dart:5.7,javascriptreact:4.83,css:3.33}},HUt=4,JQ=class{constructor(e="o200k_base",r){this.languageId=r;this.tokenizerName=e}static{a(this,"ApproximateTokenizer")}tokenize(e){return this.tokenizeStrings(e).map(r=>{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-HUt),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-HUt)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?z8o[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(-Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeFirstTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(0,Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` `)return n;let o=n.indexOf(` -`);return n.substring(o+1)}};async function W8o(t){try{let e=await HUt.create(t);TWe.set(t,e)}catch(e){console.error(`[tokenizer] failed to load ${t}, using approximate token counts: ${String(e)}`)}}a(W8o,"setTokenizer");var Umn=new Map,Qmn=!1;function $Ut(t="o200k_base"){if(Qmn||(Qmn=!0,TWe.set("mock",new GUt)),t==="mock")return Promise.resolve();let e=Umn.get(t);return e||(e=W8o(t).catch(()=>{}),Umn.set(t,e)),e}a($Ut,"_ensureLoaded");async function qmn(t){let e=t==="cl100k_base"?"cl100k_base":t==="o200k_base"||t===void 0?"o200k_base":void 0;e&&await $Ut(e)}a(qmn,"ensureNativeTokenizersLoaded");p();p();var z8o=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},Hmn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},VUt,IWe,Gmn,WUt=class extends Gi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),VUt.add(this),IWe.set(this,void 0),z8o(this,IWe,e,"f"),this.error=r}Errors(){return new c7(Hmn(this,VUt,"m",Gmn).call(this))}};IWe=new WeakMap,VUt=new WeakSet,Gmn=a(function*(){this.error&&(yield this.error),yield*Hmn(this,IWe,"f")},"_AssertError_Iterator");function jmn(t,e,r){if(!os(t,e,r))throw new WUt(OM(t,e,r))}a(jmn,"AssertValue");function xWe(...t){return t.length===3?jmn(t[0],t[1],t[2]):jmn(t[0],[],t[1])}a(xWe,"Assert");p();p();p();function Y8o(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Ka(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Ka(t[r]);return e}a(Y8o,"FromObject");function K8o(t){return t.map(e=>Ka(e))}a(K8o,"FromArray");function J8o(t){return t.slice()}a(J8o,"FromTypedArray");function Z8o(t){return new Map(Ka([...t.entries()]))}a(Z8o,"FromMap");function X8o(t){return new Set(Ka([...t.entries()]))}a(X8o,"FromSet");function e6o(t){return new Date(t.toISOString())}a(e6o,"FromDate");function Ka(t){if(Mi(t))return K8o(t);if(BE(t))return e6o(t);if(mx(t))return J8o(t);if(kYr(t))return Z8o(t);if(PYr(t))return X8o(t);if(To(t))return Y8o(t);if(c1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(Ka,"Clone");var X1=class extends Gi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function Ja(t){return J9(t)?t():Ka(t)}a(Ja,"FromDefault");function t6o(t,e){return Hi(t,"default")?Ja(t.default):{}}a(t6o,"FromAny");function r6o(t,e){return{}}a(r6o,"FromArgument");function n6o(t,e){if(t.uniqueItems===!0&&!Hi(t,"default"))throw new X1(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Hi(t,"default"))throw new X1(t,"Array with the contains constraint requires a default value");return"default"in t?Ja(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>eT(t.items,e)):[]}a(n6o,"FromArray");function i6o(t,e){return Hi(t,"default")?Ja(t.default):(async function*(){})()}a(i6o,"FromAsyncIterator");function o6o(t,e){return Hi(t,"default")?Ja(t.default):BigInt(0)}a(o6o,"FromBigInt");function s6o(t,e){return Hi(t,"default")?Ja(t.default):!1}a(s6o,"FromBoolean");function a6o(t,e){if(Hi(t,"default"))return Ja(t.default);{let r=eT(t.returns,e);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let s=this;s[n]=o}}}:class{}}}a(a6o,"FromConstructor");function c6o(t,e){return Hi(t,"default")?Ja(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(c6o,"FromDate");function l6o(t,e){return Hi(t,"default")?Ja(t.default):()=>eT(t.returns,e)}a(l6o,"FromFunction");function u6o(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return eT(n,[...e,...r])}a(u6o,"FromImport");function d6o(t,e){return Hi(t,"default")?Ja(t.default):t.minimum!==void 0?t.minimum:0}a(d6o,"FromInteger");function f6o(t,e){if(Hi(t,"default"))return Ja(t.default);{let r=t.allOf.reduce((n,o)=>{let s=eT(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!os(t,e,r))throw new X1(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(f6o,"FromIntersect");function p6o(t,e){return Hi(t,"default")?Ja(t.default):(function*(){})()}a(p6o,"FromIterator");function h6o(t,e){return Hi(t,"default")?Ja(t.default):t.const}a(h6o,"FromLiteral");function m6o(t,e){if(Hi(t,"default"))return Ja(t.default);throw new X1(t,"Never types cannot be created. Consider using a default value.")}a(m6o,"FromNever");function g6o(t,e){if(Hi(t,"default"))return Ja(t.default);throw new X1(t,"Not types must have a default value")}a(g6o,"FromNot");function A6o(t,e){return Hi(t,"default")?Ja(t.default):null}a(A6o,"FromNull");function y6o(t,e){return Hi(t,"default")?Ja(t.default):t.minimum!==void 0?t.minimum:0}a(y6o,"FromNumber");function _6o(t,e){if(Hi(t,"default"))return Ja(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=eT(s,e));return n}}a(_6o,"FromObject");function E6o(t,e){return Hi(t,"default")?Ja(t.default):Promise.resolve(eT(t.item,e))}a(E6o,"FromPromise");function v6o(t,e){return Hi(t,"default")?Ja(t.default):{}}a(v6o,"FromRecord");function C6o(t,e){return Hi(t,"default")?Ja(t.default):eT(Da(t,e),e)}a(C6o,"FromRef");function b6o(t,e){if(Hi(t,"default"))return Ja(t.default);throw new X1(t,"RegExp types cannot be created. Consider using a default value.")}a(b6o,"FromRegExp");function S6o(t,e){if(t.pattern!==void 0){if(Hi(t,"default"))return Ja(t.default);throw new X1(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Hi(t,"default"))return Ja(t.default);throw new X1(t,"String types with formats must specify a default value")}else return Hi(t,"default")?Ja(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(S6o,"FromString");function T6o(t,e){return Hi(t,"default")?Ja(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(T6o,"FromSymbol");function I6o(t,e){if(Hi(t,"default"))return Ja(t.default);if(!q7e(t))throw new X1(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return Pse(t)[0]}a(I6o,"FromTemplateLiteral");function x6o(t,e){if($mn++>O6o)throw new X1(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Hi(t,"default")?Ja(t.default):eT(Da(t,e),e)}a(x6o,"FromThis");function w6o(t,e){return Hi(t,"default")?Ja(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>eT(t.items[n],e))}a(w6o,"FromTuple");function R6o(t,e){if(Hi(t,"default"))return Ja(t.default)}a(R6o,"FromUndefined");function k6o(t,e){if(Hi(t,"default"))return Ja(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return eT(t.anyOf[0],e)}a(k6o,"FromUnion");function P6o(t,e){return Hi(t,"default")?Ja(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(P6o,"FromUint8Array");function D6o(t,e){return Hi(t,"default")?Ja(t.default):{}}a(D6o,"FromUnknown");function N6o(t,e){if(Hi(t,"default"))return Ja(t.default)}a(N6o,"FromVoid");function M6o(t,e){if(Hi(t,"default"))return Ja(t.default);throw new Error("User defined types must specify a default value")}a(M6o,"FromKind");function eT(t,e){let r=i0(t,e),n=t;switch(n[St]){case"Any":return t6o(n,r);case"Argument":return r6o(n,r);case"Array":return n6o(n,r);case"AsyncIterator":return i6o(n,r);case"BigInt":return o6o(n,r);case"Boolean":return s6o(n,r);case"Constructor":return a6o(n,r);case"Date":return c6o(n,r);case"Function":return l6o(n,r);case"Import":return u6o(n,r);case"Integer":return d6o(n,r);case"Intersect":return f6o(n,r);case"Iterator":return p6o(n,r);case"Literal":return h6o(n,r);case"Never":return m6o(n,r);case"Not":return g6o(n,r);case"Null":return A6o(n,r);case"Number":return y6o(n,r);case"Object":return _6o(n,r);case"Promise":return E6o(n,r);case"Record":return v6o(n,r);case"Ref":return C6o(n,r);case"RegExp":return b6o(n,r);case"String":return S6o(n,r);case"Symbol":return T6o(n,r);case"TemplateLiteral":return I6o(n,r);case"This":return x6o(n,r);case"Tuple":return w6o(n,r);case"Undefined":return R6o(n,r);case"Union":return k6o(n,r);case"Uint8Array":return P6o(n,r);case"Unknown":return D6o(n,r);case"Void":return N6o(n,r);default:if(!FE.Has(n[St]))throw new X1(n,"Unknown type");return M6o(n,r)}}a(eT,"Visit");var O6o=512,$mn=0;function JP(...t){return $mn=0,t.length===2?eT(t[0],t[1]):eT(t[0],[])}a(JP,"Create");var wWe=class extends Gi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function Vmn(t,e,r){if(t[St]==="Object"&&typeof r=="object"&&!GB(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[St]==="Literal"&&u.const===r[l]?100:0,f=os(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[St]==="Union"){let o=t.anyOf.map(s=>Da(s,e)).map(s=>Vmn(s,e,r));return Math.max(...o)}else return os(t,e,r)?1:0}a(Vmn,"ScoreUnion");function L6o(t,e,r){let n=t.anyOf.map(c=>Da(c,e)),[o,s]=[n[0],0];for(let c of n){let l=Vmn(c,e,r);l>s&&(o=c,s=l)}return o}a(L6o,"SelectUnion");function B6o(t,e,r){if("default"in t)return typeof r=="function"?t.default:Ka(t.default);{let n=L6o(t,e,r);return Cxe(n,e,r)}}a(B6o,"CastUnion");function F6o(t,e,r){return os(t,e,r)?Ka(r):JP(t,e)}a(F6o,"DefaultClone");function U6o(t,e,r){return os(t,e,r)?r:JP(t,e)}a(U6o,"Default");function Q6o(t,e,r){if(os(t,e,r))return Ka(r);let n=Mi(r)?Ka(r):JP(t,e),o=ui(t.minItems)&&n.lengthnull)]:n,c=(ui(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>ZP(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!os(t,e,l))throw new wWe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(Q6o,"FromArray");function q6o(t,e,r){if(os(t,e,r))return JP(t,e);let n=new Set(t.returns.required||[]),o=a(function(){},"result");for(let[s,c]of Object.entries(t.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(o.prototype[s]=ZP(c,e,r.prototype[s]));return o}a(q6o,"FromConstructor");function j6o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return ZP(o,[...e,...n],r)}a(j6o,"FromImport");function Wmn(t,e){return To(t)&&!To(e)||!To(t)&&To(e)?t:!To(t)||!To(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?Wmn(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(Wmn,"IntersectAssign");function H6o(t,e,r){if(os(t,e,r))return r;let n=JP(t,e),o=Wmn(n,r);return os(t,e,o)?o:n}a(H6o,"FromIntersect");function G6o(t,e,r){throw new wWe(t,"Never types cannot be cast")}a(G6o,"FromNever");function $6o(t,e,r){if(os(t,e,r))return r;if(r===null||typeof r!="object")return JP(t,e);let n=new Set(t.required||[]),o={};for(let[s,c]of Object.entries(t.properties))!n.has(s)&&r[s]===void 0||(o[s]=ZP(c,e,r[s]));if(typeof t.additionalProperties=="object"){let s=Object.getOwnPropertyNames(t.properties);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||(o[c]=ZP(t.additionalProperties,e,r[c]))}return o}a($6o,"FromObject");function V6o(t,e,r){if(os(t,e,r))return Ka(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return JP(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=ZP(o,e,l);return s}a(V6o,"FromRecord");function W6o(t,e,r){return ZP(Da(t,e),e,r)}a(W6o,"FromRef");function z6o(t,e,r){return ZP(Da(t,e),e,r)}a(z6o,"FromThis");function Y6o(t,e,r){return os(t,e,r)?Ka(r):Mi(r)?t.items===void 0?[]:t.items.map((n,o)=>ZP(n,e,r[o])):JP(t,e)}a(Y6o,"FromTuple");function K6o(t,e,r){return os(t,e,r)?Ka(r):B6o(t,e,r)}a(K6o,"FromUnion");function ZP(t,e,r){let n=pa(t.$id)?i0(t,e):e,o=t;switch(t[St]){case"Array":return Q6o(o,n,r);case"Constructor":return q6o(o,n,r);case"Import":return j6o(o,n,r);case"Intersect":return H6o(o,n,r);case"Never":return G6o(o,n,r);case"Object":return $6o(o,n,r);case"Record":return V6o(o,n,r);case"Ref":return W6o(o,n,r);case"This":return z6o(o,n,r);case"Tuple":return Y6o(o,n,r);case"Union":return K6o(o,n,r);case"Date":case"Symbol":case"Uint8Array":return F6o(t,e,r);default:return U6o(o,n,r)}}a(ZP,"Visit");function Cxe(...t){return t.length===3?ZP(t[0],t[1],t[2]):ZP(t[0],[],t[1])}a(Cxe,"Cast");p();function J6o(t){return X9(t)&&t[St]!=="Unsafe"}a(J6o,"IsCheckable");function Z6o(t,e,r){return Mi(r)?r.map(n=>zC(t.items,e,n)):r}a(Z6o,"FromArray");function X6o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return zC(o,[...e,...n],r)}a(X6o,"FromImport");function eUo(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>zC(l,e,Ka(r))).reduce((l,u)=>To(u)?{...l,...u}:u,{});if(!To(r)||!To(s)||!X9(n))return s;let c=IC(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||os(n,e,r[l])&&(s[l]=zC(n,e,r[l]));return s}a(eUo,"FromIntersect");function tUo(t,e,r){if(!To(r)||Mi(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Hi(t.properties,o)){r[o]=zC(t.properties[o],e,r[o]);continue}if(X9(n)&&os(n,e,r[o])){r[o]=zC(n,e,r[o]);continue}delete r[o]}return r}a(tUo,"FromObject");function rUo(t,e,r){if(!To(r))return r;let n=t.additionalProperties,o=Object.getOwnPropertyNames(r),[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of o){if(l.test(u)){r[u]=zC(c,e,r[u]);continue}if(X9(n)&&os(n,e,r[u])){r[u]=zC(n,e,r[u]);continue}delete r[u]}return r}a(rUo,"FromRecord");function nUo(t,e,r){return zC(Da(t,e),e,r)}a(nUo,"FromRef");function iUo(t,e,r){return zC(Da(t,e),e,r)}a(iUo,"FromThis");function oUo(t,e,r){if(!Mi(r))return r;if(Yu(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(oUo,"FromTuple");function sUo(t,e,r){for(let n of t.anyOf)if(J6o(n)&&os(n,e,r))return zC(n,e,r);return r}a(sUo,"FromUnion");function zC(t,e,r){let n=pa(t.$id)?i0(t,e):e,o=t;switch(o[St]){case"Array":return Z6o(o,n,r);case"Import":return X6o(o,n,r);case"Intersect":return eUo(o,n,r);case"Object":return tUo(o,n,r);case"Record":return rUo(o,n,r);case"Ref":return nUo(o,n,r);case"This":return iUo(o,n,r);case"Tuple":return oUo(o,n,r);case"Union":return sUo(o,n,r);default:return r}}a(zC,"Visit");function RWe(...t){return t.length===3?zC(t[0],t[1],t[2]):zC(t[0],[],t[1])}a(RWe,"Clean");p();function kWe(t){return pa(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(kWe,"IsStringNumeric");function aUo(t){return TA(t)||DM(t)||ui(t)}a(aUo,"IsValueToString");function bxe(t){return t===!0||ui(t)&&t===1||TA(t)&&t===BigInt("1")||pa(t)&&(t.toLowerCase()==="true"||t==="1")}a(bxe,"IsValueTrue");function Sxe(t){return t===!1||ui(t)&&(t===0||Object.is(t,-0))||TA(t)&&t===BigInt("0")||pa(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(Sxe,"IsValueFalse");function cUo(t){return pa(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(cUo,"IsTimeStringWithTimeZone");function lUo(t){return pa(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(lUo,"IsTimeStringWithoutTimeZone");function uUo(t){return pa(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(uUo,"IsDateTimeStringWithTimeZone");function dUo(t){return pa(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(dUo,"IsDateTimeStringWithoutTimeZone");function fUo(t){return pa(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(fUo,"IsDateString");function pUo(t,e){let r=Ymn(t);return r===e?r:t}a(pUo,"TryConvertLiteralString");function hUo(t,e){let r=Kmn(t);return r===e?r:t}a(hUo,"TryConvertLiteralNumber");function mUo(t,e){let r=zmn(t);return r===e?r:t}a(mUo,"TryConvertLiteralBoolean");function gUo(t,e){return pa(t.const)?pUo(e,t.const):ui(t.const)?hUo(e,t.const):DM(t.const)?mUo(e,t.const):e}a(gUo,"TryConvertLiteral");function zmn(t){return bxe(t)?!0:Sxe(t)?!1:t}a(zmn,"TryConvertBoolean");function AUo(t){let e=a(r=>r.split(".")[0],"truncateInteger");return kWe(t)?BigInt(e(t)):ui(t)?BigInt(Math.trunc(t)):Sxe(t)?BigInt(0):bxe(t)?BigInt(1):t}a(AUo,"TryConvertBigInt");function Ymn(t){return $B(t)&&t.description!==void 0?t.description.toString():aUo(t)?t.toString():t}a(Ymn,"TryConvertString");function Kmn(t){return kWe(t)?parseFloat(t):bxe(t)?1:Sxe(t)?0:t}a(Kmn,"TryConvertNumber");function yUo(t){return kWe(t)?parseInt(t):ui(t)?Math.trunc(t):bxe(t)?1:Sxe(t)?0:t}a(yUo,"TryConvertInteger");function _Uo(t){return pa(t)&&t.toLowerCase()==="null"?null:t}a(_Uo,"TryConvertNull");function EUo(t){return pa(t)&&t==="undefined"?void 0:t}a(EUo,"TryConvertUndefined");function vUo(t){return BE(t)?t:ui(t)?new Date(t):bxe(t)?new Date(1):Sxe(t)?new Date(0):kWe(t)?new Date(parseInt(t)):lUo(t)?new Date(`1970-01-01T${t}.000Z`):cUo(t)?new Date(`1970-01-01T${t}`):dUo(t)?new Date(`${t}.000Z`):uUo(t)?new Date(t):fUo(t)?new Date(`${t}T00:00:00.000Z`):t}a(vUo,"TryConvertDate");function CUo(t,e,r){return(Mi(r)?r:[r]).map(o=>XP(t.items,e,o))}a(CUo,"FromArray");function bUo(t,e,r){return AUo(r)}a(bUo,"FromBigInt");function SUo(t,e,r){return zmn(r)}a(SUo,"FromBoolean");function TUo(t,e,r){return vUo(r)}a(TUo,"FromDate");function IUo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return XP(o,[...e,...n],r)}a(IUo,"FromImport");function xUo(t,e,r){return yUo(r)}a(xUo,"FromInteger");function wUo(t,e,r){return t.allOf.reduce((n,o)=>XP(o,e,n),r)}a(wUo,"FromIntersect");function RUo(t,e,r){return gUo(t,r)}a(RUo,"FromLiteral");function kUo(t,e,r){return _Uo(r)}a(kUo,"FromNull");function PUo(t,e,r){return Kmn(r)}a(PUo,"FromNumber");function DUo(t,e,r){if(!To(r)||Mi(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Hi(r,n)&&(r[n]=XP(t.properties[n],e,r[n]));return r}a(DUo,"FromObject");function NUo(t,e,r){if(!(To(r)&&!Mi(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=XP(s,e,l);return r}a(NUo,"FromRecord");function MUo(t,e,r){return XP(Da(t,e),e,r)}a(MUo,"FromRef");function OUo(t,e,r){return Ymn(r)}a(OUo,"FromString");function LUo(t,e,r){return pa(r)||ui(r)?Symbol(r):r}a(LUo,"FromSymbol");function BUo(t,e,r){return XP(Da(t,e),e,r)}a(BUo,"FromThis");function FUo(t,e,r){return Mi(r)&&!Yu(t.items)?r.map((o,s)=>s{let c=ZE(s,e,n);return To(c)?{...o,...c}:c},{})}a(GUo,"FromIntersect");function $Uo(t,e,r){let n=eF(t,r);if(!To(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=ZE(t.properties[s],e,n[s]);Yu(c)||(n[s]=ZE(t.properties[s],e,n[s]))}if(!zUt(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=ZE(t.additionalProperties,e,n[s]));return n}a($Uo,"FromObject");function VUo(t,e,r){let n=eF(t,r);if(!To(n))return n;let o=t.additionalProperties,[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of Object.getOwnPropertyNames(n))l.test(u)&&zUt(c)&&(n[u]=ZE(c,e,n[u]));if(!zUt(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=ZE(o,e,n[u]));return n}a(VUo,"FromRecord");function WUo(t,e,r){return ZE(Da(t,e),e,eF(t,r))}a(WUo,"FromRef");function zUo(t,e,r){return ZE(Da(t,e),e,r)}a(zUo,"FromThis");function YUo(t,e,r){let n=eF(t,r);if(!Mi(n)||Yu(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;cZUo,Format:()=>Txe,Get:()=>e9o,Has:()=>XUo,Set:()=>JUo,ValuePointerRootDeleteError:()=>MWe,ValuePointerRootSetError:()=>NWe});p();var NWe=class extends Gi{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}},MWe=class extends Gi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function Zmn(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(Zmn,"Escape");function*Txe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nwK(t[o],e[o]))}a(t9o,"ObjectType");function r9o(t,e){return BE(e)&&t.getTime()===e.getTime()}a(r9o,"DateType");function n9o(t,e){return!Mi(e)||t.length!==e.length?!1:t.every((r,n)=>wK(r,e[n]))}a(n9o,"ArrayType");function i9o(t,e){return!mx(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>wK(r,e[n]))}a(i9o,"TypedArrayType");function o9o(t,e){return t===e}a(o9o,"ValueType");function wK(t,e){if(BE(t))return r9o(t,e);if(mx(t))return i9o(t,e);if(Mi(t))return n9o(t,e);if(To(t))return t9o(t,e);if(c1(t))return o9o(t,e);throw new Error("ValueEquals: Unable to compare value")}a(wK,"Equal");var s9o=fc({type:ma("insert"),path:UE(),value:gP()}),a9o=fc({type:ma("update"),path:UE(),value:gP()}),c9o=fc({type:ma("delete"),path:UE()}),egn=dc([s9o,a9o,c9o]),OWe=class extends Gi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function LWe(t,e){return{type:"update",path:t,value:e}}a(LWe,"CreateUpdate");function tgn(t,e){return{type:"insert",path:t,value:e}}a(tgn,"CreateInsert");function rgn(t){return{type:"delete",path:t}}a(rgn,"CreateDelete");function Xmn(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new OWe(t,"Cannot diff objects with symbols")}a(Xmn,"AssertDiffable");function*l9o(t,e,r){if(Xmn(e),Xmn(r),!oNt(r))return yield LWe(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Hi(e,s)||(yield tgn(`${t}/${s}`,r[s]));for(let s of n)Hi(r,s)&&(wK(e,r)||(yield*BWe(`${t}/${s}`,e[s],r[s])));for(let s of n)Hi(r,s)||(yield rgn(`${t}/${s}`))}a(l9o,"ObjectType");function*u9o(t,e,r){if(!Mi(r))return yield LWe(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(p9o,"IsRootUpdate");function h9o(t){return t.length===0}a(h9o,"IsIdentity");function ign(t,e){if(p9o(e))return Ka(e[0].value);if(h9o(e))return Ka(t);let r=Ka(t);for(let n of e)switch(n.type){case"insert":{e2.Set(r,n.path,n.value);break}case"update":{e2.Set(r,n.path,n.value);break}case"delete":{e2.Delete(r,n.path);break}}return r}a(ign,"Patch");p();function ogn(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=e3(e,r)?Wse(e,r,n):n;if(!os(e,r,o))throw new Vse(e,o,OM(e,r,o).First());return o}a(ogn,"Encode");p();function FWe(t){return To(t)&&!Mi(t)}a(FWe,"IsStandardObject");var UWe=class extends Gi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function m9o(t,e,r,n){if(!FWe(r))e2.Set(t,e,Ka(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)YUt(t,`${e}/${c}`,r[c],n[c])}}a(m9o,"ObjectType");function g9o(t,e,r,n){if(!Mi(r))e2.Set(t,e,Ka(n));else{for(let o=0;o(xWe(s,c,l),l)],["Cast",(s,c,l)=>Cxe(s,c,l)],["Clean",(s,c,l)=>RWe(s,c,l)],["Clone",(s,c,l)=>Ka(l)],["Convert",(s,c,l)=>PWe(s,c,l)],["Decode",(s,c,l)=>e3(s,c)?$se(s,c,l):l],["Default",(s,c,l)=>DWe(s,c,l)],["Encode",(s,c,l)=>e3(s,c)?Wse(s,c,l):l]]);function r(s){e.delete(s)}a(r,"Delete"),t.Delete=r;function n(s,c){e.set(s,c)}a(n,"Set"),t.Set=n;function o(s){return e.get(s)}a(o,"Get"),t.Get=o})(KUt||(KUt={}));var cgn=["Clone","Clean","Default","Convert","Assert","Decode"];function E9o(t,e,r,n){return t.reduce((o,s)=>{let c=KUt.Get(s);if(Yu(c))throw new QWe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(E9o,"ParseValue");function lgn(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?Mi(t[0])?[t[0],t[1],[],t[2]]:[cgn,t[0],t[1],t[2]]:t.length===2?[cgn,t[0],[],t[1]]:(()=>{throw new QWe("Invalid Arguments")})();return E9o(e,r,n,o)}a(lgn,"Parse");p();var DO={};Ti(DO,{Assert:()=>xWe,Cast:()=>Cxe,Check:()=>os,Clean:()=>RWe,Clone:()=>Ka,Convert:()=>PWe,Create:()=>JP,Decode:()=>Jmn,Default:()=>DWe,Diff:()=>ngn,Edit:()=>egn,Encode:()=>ogn,Equal:()=>wK,Errors:()=>OM,Hash:()=>a7,Mutate:()=>agn,Parse:()=>lgn,Patch:()=>ign,ValueErrorIterator:()=>c7});p();var v9o="gpt-41-copilot",cw=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&ws(this._ctx,n=>this.refreshAvailableModels(n))}static{a(this,"AvailableModelsManager")}async refreshAvailableModels(e){await this.refreshModels(e);for(let r of this.onModelsFetchedCallbacks)r()}addHandler(e){this.onModelsFetchedCallbacks.push(e)}getDefaultModelId(){if(this.fetchedModelData){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return v9o}parseModelsResponse(e){try{return DO.Parse(Pmn,e)}catch(r){Br.exception(this._ctx,r,"Failed to parse /models response from CAPI");return}}async refreshModels(e){let r=await this.fetchModels(e);r&&(this.fetchedModelData=r)}async fetchModels(e){return this.editorPreviewFeaturesDisabled=e.getTokenValue("editor_preview_features")=="0",await this.fetch(e)}fetch(e){return(!this.fetchInProgress||this.fetchInProgress.withToken.token!==e.token)&&(this.fetchInProgress={withToken:e,response:this.fetchImpl(e).finally(()=>{this.fetchInProgress=void 0})}),this.fetchInProgress.response}async fetchImpl(e){let r=await xK(this._ctx,"/models",e);return r.ok?this.parseModelsResponse(await r.json())?.data??[]:(Br.error(this._ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText}),null)}getGenericCompletionModels(){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return t.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:"o200k_base"}static filterCompletionModels(e,r){return e.filter(n=>n.capabilities.type==="completion").filter(n=>!r||n.preview===!1||n.preview===void 0)}static filterModelsWithEditorPreviewFeatures(e,r){return e.filter(n=>!r||n.preview===!1||n.preview===void 0)}static mapCompletionModels(e){return e.map(r=>({modelId:r.id,label:r.name,preview:!!r.preview,tokenizer:r.capabilities.tokenizer}))}getCurrentModelRequestInfo(e=void 0){let r=this.getDefaultModelId(),n=Nmn(this._ctx);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&Br.error(this._ctx,`User selected model ${n} is not in the list of generic models: ${l.join(", ")}, falling back to default model.`),n=null),r===n&&(n=null)}let o=kt(this._ctx,ze.DebugOverrideEngine)||kt(this._ctx,ze.DebugOverrideEngineLegacy);if(o)return new RK(o,"override");let s=e?this._ctx.get(tr).customEngine(e):"",c=e?this._ctx.get(tr).customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new RK(s,"exp"):new RK(n,"modelpicker"):s?new RK(s,"exp"):new RK(r,"default")}},RK=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function XQ(t,e=void 0){let r=t.get(cw),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(XQ,"getEngineRequestInfo");p();p();var Go=class{static{a(this,"FileSystem")}};var xgn=fe(Ign());function wgn(t){return t!==void 0&&t!==0}a(wgn,"isRepoInfo");function Rgn(t){if(t===void 0||t===0)return"";let e=kK(t);if(e==="github/github")return e;let r=W9o(t)?.toLowerCase();return r!==void 0?r:""}a(Rgn,"getDogFood");function kK(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(kK,"tryGetGitHubNWO");function W9o(t){if(t===void 0||t===0)return;let e=t.hostname.toLowerCase(),r=e==="azure.com"||e.endsWith(".azure.com"),n=e==="visualstudio.com"||e.endsWith(".visualstudio.com");if(r||n)return t.owner+"/"+t.repo}a(W9o,"tryGetADONWO");function eq(t,e){let r=Cf(e);return z9o(t,r)}a(eq,"extractRepoInfoInBackground");var z9o=Z9o(Y9o,1e4);async function Y9o(t,e){let r=Ltn(e);if(!r)return;let n=await K9o(t,r);if(!n)return;let o=t.get(Go),s=Oa(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=J9o(c)??"",u=e9t(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(Y9o,"extractRepoInfo");function e9t(t){let e;try{if(e=(0,xgn.default)(t),e.resource==""||e.owner==""||e.name==""||e.pathname=="")return}catch{return}return{hostname:e.resource,owner:e.owner,repo:e.name,pathname:e.pathname}}a(e9t,"parseRepoUrl");async function K9o(t,e){let r=e+"_add_to_make_longer",n=t.get(Go);for(;e!=="file:///"&&e.length{let c=JSON.stringify(s),l=r.get(c);if(l)return l.result;if(n.has(c))return 0;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new XUt(d)),n.delete(c)}),0}}a(Z9o,"computeInBackgroundAndMemoize");p();var Ixe=500,kgn=8192-Ixe,Pgn=4,qWe=10,Dgn=1e3*5,jWe={prefix:35,suffix:15,stableContext:35,volatileContext:15},X9o={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function xxe(t){return t=t.toLowerCase(),X9o[t]??t}a(xxe,"normalizeLanguageId");var t9t=class{constructor(e){this.ctx=e;this.cache=new Sn(200)}static{a(this,"FilterSettingsToExpConfigs")}async fetchExpConfig(e,r){let n=e.stringify()+` -`+JSON.stringify(r),o=this.cache.get(n);return o||(o=new r9t(()=>this.ctx.get(qP).fetchExperiments(this.ctx,r,e.toHeaders()),1e3*60*60),this.cache.set(n,o)),o.run()}getCachedExpConfig(e){return this.cache.get(e.stringify())?.value()}},r9t=class{constructor(e,r=1/0){this.producer=e;this.expirationMs=r}static{a(this,"Task")}async run(){return this.promise===void 0&&(this.promise=this.producer(),this.storeResult(this.promise).then(()=>{this.expirationMs<1/0&&this.promise!==void 0&&setTimeout(()=>this.promise=void 0,this.expirationMs)})),this.promise}async storeResult(e){try{this.result=await e}finally{this.result===void 0&&(this.promise=void 0)}}value(){return this.result}};function t7o(t){return"uri"in t}a(t7o,"isCompletionsFiltersInfo");var tr=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new t9t(this.ctx)}static{a(this,"Features")}static{this.upcomingDynamicFilterCheckDelayMs=20}static{this.upcomingTimeBucketMinutes=5+Math.floor(Math.random()*11)}registerStaticFilters(e){Object.assign(this.staticFilters,e)}registerDynamicFilter(e,r){this.dynamicFilters[e]=r}registerDynamicFilterGroup(e){this.dynamicFilterGroups.push(e)}getDynamicFilterValues(){let e={};for(let r of this.dynamicFilterGroups)Object.assign(e,r());for(let[r,n]of Object.entries(this.dynamicFilters))e[r]=n();return e}registerUpcomingDynamicFilter(e,r){this.upcomingDynamicFilters[e]=r}async updateExPValuesAndAssignments(e,r,n=Vt.createAndMarkAsIssued()){if(n instanceof Tx)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&t7o(r)?eq(this.ctx,r.uri):void 0,s=kK(o)??"",c=Rgn(o)??"",l=r?.languageId??"",u=XQ(this.ctx).modelId,d=x$r(e),f=e.getTokenValue("ol")??"",h=e.getTokenValue("tid")??"",m=e.getTokenValue("fcv1")==="1",g=e.getTokenValue("sn")==="1",y=this.ctx.get(Gp).getProperties(),_=e.endpoints,E={"X-Copilot-Repository":s,"X-Copilot-FileType":l,"X-Copilot-UserKind":d,"X-Copilot-Dogfood":c,"X-Copilot-Engine":u,"X-Copilot-Orgs":f,"X-Copilot-CopilotTrackingId":h,"X-GitHub-Copilot-SKU":y.sku||"","X-GitHub-Copilot-IsFcv1":m?"1":"0","X-GitHub-Copilot-IsSn":g?"1":"0"},v=this.getGranularityDirectory(),S=this.makeFilterSettings(E),T=v.extendFilters(S),w=await this.getExpConfig(T.newFilterSettings,_);v.update(S,+(w.variables.copilotbycallbuckets??NaN),+(w.variables.copilottimeperiodsizeinh??NaN));let R=v.extendFilters(S),x=R.newFilterSettings,k=await this.getExpConfig(x,_),D=new Promise(N=>setTimeout(N,t.upcomingDynamicFilterCheckDelayMs));for(let N of R.otherFilterSettingsToPrefetch)D=D.then(async()=>{await new Promise(O=>setTimeout(O,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(N,_)});return this.prepareForUpcomingFilters(x,_),new Tx(n.properties,n.measurements,n.issuedTime,{filters:x,exp:k})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){let n=await this.ctx.get(Qt).getToken();return await this.updateExPValuesAndAssignments(n,e,r)}getGranularityDirectory(){if(!this.granularityDirectory){let e=this.ctx.get(za).machineId;this.granularityDirectory=new fGe(e,this.ctx.get(HC))}return this.granularityDirectory}makeFilterSettings(e){return new QB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return px.createFallbackConfig(this.ctx,`Error fetching ExP config: ${String(n)}`)}}async prepareForUpcomingFilters(e,r){if(!(new Date().getMinutes()<60-t.upcomingTimeBucketMinutes))for(let[n,o]of Object.entries(this.upcomingDynamicFilters))await new Promise(s=>setTimeout(s,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(e.withChange(n,o()),r)}stringify(){let e=this.assignments.getCachedExpConfig(new QB({}));return JSON.stringify(e?.variables??{})}async getFallbackExpAndFilters(){let e=this.makeFilterSettings({}),r=i3(this.ctx),n=await this.getExpConfig(e,r);return{filters:e,exp:n}}disableLogProb(e){return e.filtersAndExp.exp.variables.copilotdisablelogprob??!0}overrideBlockMode(e){return e.filtersAndExp.exp.variables.copilotoverrideblockmode||void 0}customEngine(e){return e.filtersAndExp.exp.variables.copilotcustomengine??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables.copilotcustomenginetargetengine}suffixPercent(e){return e.filtersAndExp.exp.variables.CopilotSuffixPercent??jWe.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??qWe}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables.copilotcppheadersenableswitch??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscodecsharp??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscodetypescript??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscode??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables.copilotcontextproviders??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e){return e.filtersAndExp.exp.variables.copilotcontextprovidertimebudget??150}includeNeighboringFiles(e){return e.filtersAndExp.exp.variables.copilotincludeneighboringfiles??!1}excludeRelatedFiles(e){return e.filtersAndExp.exp.variables.copilotexcluderelatedfiles??!1}maxPromptCompletionTokens(e){return e.filtersAndExp.exp.variables.maxpromptcompletionTokens??kgn+Ixe}ideChatMaxRequestTokens(e){return e.filtersAndExp.exp.variables.idechatmaxrequesttokens??-1}ideChatExpModelIds(e){return e.filtersAndExp.exp.variables.idechatexpmodelids??""}ideChatEnableProjectMetadata(e){return e.filtersAndExp.exp.variables.idechatenableprojectmetadata??!1}ideDataMigrationCompleted(e){return e.filtersAndExp.exp.variables.idedatamigrationcompleted??!1}workspaceContextCoordinator(e){return e.filtersAndExp.exp.variables.copilotworkspacecontextcoordinator??!1}workspaceContextCacheTime(e){return e.filtersAndExp.exp.variables.copilotworkspacecontextcachetime??Dgn}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??jWe.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??jWe.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotcppContextProviderParams}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotcsharpcontextproviderparams}javaContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotjavacontextproviderparams}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotmultilanguagecontextproviderparams}tsContextProviderParams(e){return e.filtersAndExp.exp.variables.copilottscontextproviderparams}completionsDebounce(e){return e.filtersAndExp.exp.variables.copilotcompletionsdebounce}enableElectronFetcher(e){return e.filtersAndExp.exp.variables.copilotelectronfetcher??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables.copilotfetchfetcher??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables.copilotasynccompletionstimeout??200}enablePromptContextProxyField(e){return e.filtersAndExp.exp.variables.copilotenablepromptcontextproxyfield??!1}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables.copilotprogressivereveal??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables.copilotmodelterminatesingleline??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables.copilotprogressivereveallonglookaheadsize??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables.copilotprogressiverevealshortlookaheadsize??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables.copilotmaxmultilinetokens??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables.copilotmultilineafteracceptlines??1}enableNESXTab(e){return e.filtersAndExp.exp.variables.copilotnesxtab??!1}getNESXTabModelID(e){return e.filtersAndExp.exp.variables.copilotnesxtabmodelid??"copilot-nes-xtab"}completionsDelay(e){return e.filtersAndExp.exp.variables.copilotcompletionsdelay??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables.copilotsinglelineunlessaccepted??!1}useCompletionsComparisonPanel(e){return e.filtersAndExp.exp.variables.copilotusecompletionscomparisonpanel??!1}comparisonPanelModelIds(e){return e.filtersAndExp.exp.variables.copilotcomparisonpanelmodelids??""}comparisonPanelRandomizedMode(e){return e.filtersAndExp.exp.variables.copilotcomparisonpanelrandomizedmode??!0}useChatLibCompletions(e){return e.filtersAndExp.exp.variables.copilotusechatlibcompletions??!1}cveRemediatorAgentEnabled(e){return e.filtersAndExp.exp.variables.cveremediatoragentenabled??!1}instantApplyModelMigration(e){return e.filtersAndExp.exp.variables.copilotinstantapplymodelmigration??!1}appmodContextMenuEnabled(e){return e.filtersAndExp.exp.variables.copilotappmodcontextmenuenabled??!1}appmodProblemsViewEnabled(e){return e.filtersAndExp.exp.variables.copilotappmodproblemsviewenabled??!1}searchAgentEnabled(e){return e.filtersAndExp.exp.variables.copilotsearchagentenabled??!1}cliAsDefaultAgentProviderEnabled(e){return e.filtersAndExp.exp.variables.copilotcliasdefaultagentprovider??!1}inlineChatUseCliEnabled(e){return e.filtersAndExp.exp.variables.inlinechatusecli??!1}};async function HWe(t){let e=kt(t,ze.SearchAgent);if(e==="true")return!0;if(e==="false")return!1;let r=t.get(tr),n=await r.fetchTokenAndUpdateExPValuesAndAssignments();return r.searchAgentEnabled(n)}a(HWe,"isSearchAgentEnabled");p();p();p();var GWe=fe(eue());var i9t={python:"python",javascript:"javascript",javascriptreact:"javascript",jsx:"javascript",typescript:"typescript",typescriptreact:"tsx",go:"go",ruby:"ruby",csharp:"c-sharp",java:"java",php:"php",c:"cpp",cpp:"cpp"};function tT(t){return t in i9t&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(tT,"isSupportedLanguageId");function $We(t){if(!(t in i9t))throw new Error(`Unrecognized language: ${t}`);return i9t[t]}a($We,"languageIdToWasmLanguage");var n9t=new Map;async function r7o(t){let e;try{e=await bWe(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new KQ(`Could not load tree-sitter-${t}.wasm`,r):r}return GWe.default.Language.load(e)}a(r7o,"loadWasmLanguage");function s9t(t){let e=$We(t);if(!n9t.has(e)){let r=r7o(e);n9t.set(e,r)}return n9t.get(e)}a(s9t,"getLanguage");var o9t=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function tq(t,e){return(await a9t(t,e))[0]}a(tq,"parseTreeSitter");async function a9t(t,e){await GWe.default.init({locateFile:a(s=>Exe(s),"locateFile")});let r;try{r=new GWe.default}catch(s){throw s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&s.message.includes("table index is out of bounds")?new o9t(`Could not init Parse for language <${t}>`,s):s}let n=await s9t(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(a9t,"parseTreeSitterIncludingVersion");function Ngn(t){switch($We(t)){case"python":return null;case"javascript":case"typescript":case"tsx":case"go":case"c-sharp":case"java":case"php":case"cpp":return"}";case"ruby":return"end"}}a(Ngn,"getBlockCloseToken");function n7o(t,e){let r=[];for(let n of t){if(!n[1]){let o=e.tree.getLanguage();n[1]=o.query(n[0])}r.push(...n[1].matches(e))}return r}a(n7o,"innerQuery");var i7o=[`[ +`);return n.substring(o+1)}};async function Y8o(t){try{let e=await GUt.create(t);TWe.set(t,e)}catch(e){console.error(`[tokenizer] failed to load ${t}, using approximate token counts: ${String(e)}`)}}a(Y8o,"setTokenizer");var Qmn=new Map,qmn=!1;function VUt(t="o200k_base"){if(qmn||(qmn=!0,TWe.set("mock",new $Ut)),t==="mock")return Promise.resolve();let e=Qmn.get(t);return e||(e=Y8o(t).catch(()=>{}),Qmn.set(t,e)),e}a(VUt,"_ensureLoaded");async function jmn(t){let e=t==="cl100k_base"?"cl100k_base":t==="o200k_base"||t===void 0?"o200k_base":void 0;e&&await VUt(e)}a(jmn,"ensureNativeTokenizersLoaded");p();p();var K8o=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},Gmn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},WUt,IWe,$mn,zUt=class extends Gi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),WUt.add(this),IWe.set(this,void 0),K8o(this,IWe,e,"f"),this.error=r}Errors(){return new c7(Gmn(this,WUt,"m",$mn).call(this))}};IWe=new WeakMap,WUt=new WeakSet,$mn=a(function*(){this.error&&(yield this.error),yield*Gmn(this,IWe,"f")},"_AssertError_Iterator");function Hmn(t,e,r){if(!os(t,e,r))throw new zUt(OM(t,e,r))}a(Hmn,"AssertValue");function xWe(...t){return t.length===3?Hmn(t[0],t[1],t[2]):Hmn(t[0],[],t[1])}a(xWe,"Assert");p();p();p();function J8o(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Ka(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Ka(t[r]);return e}a(J8o,"FromObject");function Z8o(t){return t.map(e=>Ka(e))}a(Z8o,"FromArray");function X8o(t){return t.slice()}a(X8o,"FromTypedArray");function e6o(t){return new Map(Ka([...t.entries()]))}a(e6o,"FromMap");function t6o(t){return new Set(Ka([...t.entries()]))}a(t6o,"FromSet");function r6o(t){return new Date(t.toISOString())}a(r6o,"FromDate");function Ka(t){if(Mi(t))return Z8o(t);if(BE(t))return r6o(t);if(mx(t))return X8o(t);if(PYr(t))return e6o(t);if(DYr(t))return t6o(t);if(To(t))return J8o(t);if(c1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(Ka,"Clone");var X1=class extends Gi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function Ja(t){return J9(t)?t():Ka(t)}a(Ja,"FromDefault");function n6o(t,e){return Hi(t,"default")?Ja(t.default):{}}a(n6o,"FromAny");function i6o(t,e){return{}}a(i6o,"FromArgument");function o6o(t,e){if(t.uniqueItems===!0&&!Hi(t,"default"))throw new X1(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Hi(t,"default"))throw new X1(t,"Array with the contains constraint requires a default value");return"default"in t?Ja(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>eT(t.items,e)):[]}a(o6o,"FromArray");function s6o(t,e){return Hi(t,"default")?Ja(t.default):(async function*(){})()}a(s6o,"FromAsyncIterator");function a6o(t,e){return Hi(t,"default")?Ja(t.default):BigInt(0)}a(a6o,"FromBigInt");function c6o(t,e){return Hi(t,"default")?Ja(t.default):!1}a(c6o,"FromBoolean");function l6o(t,e){if(Hi(t,"default"))return Ja(t.default);{let r=eT(t.returns,e);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let s=this;s[n]=o}}}:class{}}}a(l6o,"FromConstructor");function u6o(t,e){return Hi(t,"default")?Ja(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(u6o,"FromDate");function d6o(t,e){return Hi(t,"default")?Ja(t.default):()=>eT(t.returns,e)}a(d6o,"FromFunction");function f6o(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return eT(n,[...e,...r])}a(f6o,"FromImport");function p6o(t,e){return Hi(t,"default")?Ja(t.default):t.minimum!==void 0?t.minimum:0}a(p6o,"FromInteger");function h6o(t,e){if(Hi(t,"default"))return Ja(t.default);{let r=t.allOf.reduce((n,o)=>{let s=eT(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!os(t,e,r))throw new X1(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(h6o,"FromIntersect");function m6o(t,e){return Hi(t,"default")?Ja(t.default):(function*(){})()}a(m6o,"FromIterator");function g6o(t,e){return Hi(t,"default")?Ja(t.default):t.const}a(g6o,"FromLiteral");function A6o(t,e){if(Hi(t,"default"))return Ja(t.default);throw new X1(t,"Never types cannot be created. Consider using a default value.")}a(A6o,"FromNever");function y6o(t,e){if(Hi(t,"default"))return Ja(t.default);throw new X1(t,"Not types must have a default value")}a(y6o,"FromNot");function _6o(t,e){return Hi(t,"default")?Ja(t.default):null}a(_6o,"FromNull");function E6o(t,e){return Hi(t,"default")?Ja(t.default):t.minimum!==void 0?t.minimum:0}a(E6o,"FromNumber");function v6o(t,e){if(Hi(t,"default"))return Ja(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=eT(s,e));return n}}a(v6o,"FromObject");function C6o(t,e){return Hi(t,"default")?Ja(t.default):Promise.resolve(eT(t.item,e))}a(C6o,"FromPromise");function b6o(t,e){return Hi(t,"default")?Ja(t.default):{}}a(b6o,"FromRecord");function S6o(t,e){return Hi(t,"default")?Ja(t.default):eT(Da(t,e),e)}a(S6o,"FromRef");function T6o(t,e){if(Hi(t,"default"))return Ja(t.default);throw new X1(t,"RegExp types cannot be created. Consider using a default value.")}a(T6o,"FromRegExp");function I6o(t,e){if(t.pattern!==void 0){if(Hi(t,"default"))return Ja(t.default);throw new X1(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Hi(t,"default"))return Ja(t.default);throw new X1(t,"String types with formats must specify a default value")}else return Hi(t,"default")?Ja(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(I6o,"FromString");function x6o(t,e){return Hi(t,"default")?Ja(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(x6o,"FromSymbol");function w6o(t,e){if(Hi(t,"default"))return Ja(t.default);if(!q7e(t))throw new X1(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return Dse(t)[0]}a(w6o,"FromTemplateLiteral");function R6o(t,e){if(Vmn++>B6o)throw new X1(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Hi(t,"default")?Ja(t.default):eT(Da(t,e),e)}a(R6o,"FromThis");function k6o(t,e){return Hi(t,"default")?Ja(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>eT(t.items[n],e))}a(k6o,"FromTuple");function P6o(t,e){if(Hi(t,"default"))return Ja(t.default)}a(P6o,"FromUndefined");function D6o(t,e){if(Hi(t,"default"))return Ja(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return eT(t.anyOf[0],e)}a(D6o,"FromUnion");function N6o(t,e){return Hi(t,"default")?Ja(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(N6o,"FromUint8Array");function M6o(t,e){return Hi(t,"default")?Ja(t.default):{}}a(M6o,"FromUnknown");function O6o(t,e){if(Hi(t,"default"))return Ja(t.default)}a(O6o,"FromVoid");function L6o(t,e){if(Hi(t,"default"))return Ja(t.default);throw new Error("User defined types must specify a default value")}a(L6o,"FromKind");function eT(t,e){let r=o0(t,e),n=t;switch(n[St]){case"Any":return n6o(n,r);case"Argument":return i6o(n,r);case"Array":return o6o(n,r);case"AsyncIterator":return s6o(n,r);case"BigInt":return a6o(n,r);case"Boolean":return c6o(n,r);case"Constructor":return l6o(n,r);case"Date":return u6o(n,r);case"Function":return d6o(n,r);case"Import":return f6o(n,r);case"Integer":return p6o(n,r);case"Intersect":return h6o(n,r);case"Iterator":return m6o(n,r);case"Literal":return g6o(n,r);case"Never":return A6o(n,r);case"Not":return y6o(n,r);case"Null":return _6o(n,r);case"Number":return E6o(n,r);case"Object":return v6o(n,r);case"Promise":return C6o(n,r);case"Record":return b6o(n,r);case"Ref":return S6o(n,r);case"RegExp":return T6o(n,r);case"String":return I6o(n,r);case"Symbol":return x6o(n,r);case"TemplateLiteral":return w6o(n,r);case"This":return R6o(n,r);case"Tuple":return k6o(n,r);case"Undefined":return P6o(n,r);case"Union":return D6o(n,r);case"Uint8Array":return N6o(n,r);case"Unknown":return M6o(n,r);case"Void":return O6o(n,r);default:if(!FE.Has(n[St]))throw new X1(n,"Unknown type");return L6o(n,r)}}a(eT,"Visit");var B6o=512,Vmn=0;function JP(...t){return Vmn=0,t.length===2?eT(t[0],t[1]):eT(t[0],[])}a(JP,"Create");var wWe=class extends Gi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function Wmn(t,e,r){if(t[St]==="Object"&&typeof r=="object"&&!GB(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[St]==="Literal"&&u.const===r[l]?100:0,f=os(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[St]==="Union"){let o=t.anyOf.map(s=>Da(s,e)).map(s=>Wmn(s,e,r));return Math.max(...o)}else return os(t,e,r)?1:0}a(Wmn,"ScoreUnion");function F6o(t,e,r){let n=t.anyOf.map(c=>Da(c,e)),[o,s]=[n[0],0];for(let c of n){let l=Wmn(c,e,r);l>s&&(o=c,s=l)}return o}a(F6o,"SelectUnion");function U6o(t,e,r){if("default"in t)return typeof r=="function"?t.default:Ka(t.default);{let n=F6o(t,e,r);return Cxe(n,e,r)}}a(U6o,"CastUnion");function Q6o(t,e,r){return os(t,e,r)?Ka(r):JP(t,e)}a(Q6o,"DefaultClone");function q6o(t,e,r){return os(t,e,r)?r:JP(t,e)}a(q6o,"Default");function j6o(t,e,r){if(os(t,e,r))return Ka(r);let n=Mi(r)?Ka(r):JP(t,e),o=ui(t.minItems)&&n.lengthnull)]:n,c=(ui(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>ZP(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!os(t,e,l))throw new wWe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(j6o,"FromArray");function H6o(t,e,r){if(os(t,e,r))return JP(t,e);let n=new Set(t.returns.required||[]),o=a(function(){},"result");for(let[s,c]of Object.entries(t.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(o.prototype[s]=ZP(c,e,r.prototype[s]));return o}a(H6o,"FromConstructor");function G6o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return ZP(o,[...e,...n],r)}a(G6o,"FromImport");function zmn(t,e){return To(t)&&!To(e)||!To(t)&&To(e)?t:!To(t)||!To(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?zmn(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(zmn,"IntersectAssign");function $6o(t,e,r){if(os(t,e,r))return r;let n=JP(t,e),o=zmn(n,r);return os(t,e,o)?o:n}a($6o,"FromIntersect");function V6o(t,e,r){throw new wWe(t,"Never types cannot be cast")}a(V6o,"FromNever");function W6o(t,e,r){if(os(t,e,r))return r;if(r===null||typeof r!="object")return JP(t,e);let n=new Set(t.required||[]),o={};for(let[s,c]of Object.entries(t.properties))!n.has(s)&&r[s]===void 0||(o[s]=ZP(c,e,r[s]));if(typeof t.additionalProperties=="object"){let s=Object.getOwnPropertyNames(t.properties);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||(o[c]=ZP(t.additionalProperties,e,r[c]))}return o}a(W6o,"FromObject");function z6o(t,e,r){if(os(t,e,r))return Ka(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return JP(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=ZP(o,e,l);return s}a(z6o,"FromRecord");function Y6o(t,e,r){return ZP(Da(t,e),e,r)}a(Y6o,"FromRef");function K6o(t,e,r){return ZP(Da(t,e),e,r)}a(K6o,"FromThis");function J6o(t,e,r){return os(t,e,r)?Ka(r):Mi(r)?t.items===void 0?[]:t.items.map((n,o)=>ZP(n,e,r[o])):JP(t,e)}a(J6o,"FromTuple");function Z6o(t,e,r){return os(t,e,r)?Ka(r):U6o(t,e,r)}a(Z6o,"FromUnion");function ZP(t,e,r){let n=pa(t.$id)?o0(t,e):e,o=t;switch(t[St]){case"Array":return j6o(o,n,r);case"Constructor":return H6o(o,n,r);case"Import":return G6o(o,n,r);case"Intersect":return $6o(o,n,r);case"Never":return V6o(o,n,r);case"Object":return W6o(o,n,r);case"Record":return z6o(o,n,r);case"Ref":return Y6o(o,n,r);case"This":return K6o(o,n,r);case"Tuple":return J6o(o,n,r);case"Union":return Z6o(o,n,r);case"Date":case"Symbol":case"Uint8Array":return Q6o(t,e,r);default:return q6o(o,n,r)}}a(ZP,"Visit");function Cxe(...t){return t.length===3?ZP(t[0],t[1],t[2]):ZP(t[0],[],t[1])}a(Cxe,"Cast");p();function X6o(t){return X9(t)&&t[St]!=="Unsafe"}a(X6o,"IsCheckable");function eUo(t,e,r){return Mi(r)?r.map(n=>zC(t.items,e,n)):r}a(eUo,"FromArray");function tUo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return zC(o,[...e,...n],r)}a(tUo,"FromImport");function rUo(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>zC(l,e,Ka(r))).reduce((l,u)=>To(u)?{...l,...u}:u,{});if(!To(r)||!To(s)||!X9(n))return s;let c=IC(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||os(n,e,r[l])&&(s[l]=zC(n,e,r[l]));return s}a(rUo,"FromIntersect");function nUo(t,e,r){if(!To(r)||Mi(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Hi(t.properties,o)){r[o]=zC(t.properties[o],e,r[o]);continue}if(X9(n)&&os(n,e,r[o])){r[o]=zC(n,e,r[o]);continue}delete r[o]}return r}a(nUo,"FromObject");function iUo(t,e,r){if(!To(r))return r;let n=t.additionalProperties,o=Object.getOwnPropertyNames(r),[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of o){if(l.test(u)){r[u]=zC(c,e,r[u]);continue}if(X9(n)&&os(n,e,r[u])){r[u]=zC(n,e,r[u]);continue}delete r[u]}return r}a(iUo,"FromRecord");function oUo(t,e,r){return zC(Da(t,e),e,r)}a(oUo,"FromRef");function sUo(t,e,r){return zC(Da(t,e),e,r)}a(sUo,"FromThis");function aUo(t,e,r){if(!Mi(r))return r;if(Yu(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(aUo,"FromTuple");function cUo(t,e,r){for(let n of t.anyOf)if(X6o(n)&&os(n,e,r))return zC(n,e,r);return r}a(cUo,"FromUnion");function zC(t,e,r){let n=pa(t.$id)?o0(t,e):e,o=t;switch(o[St]){case"Array":return eUo(o,n,r);case"Import":return tUo(o,n,r);case"Intersect":return rUo(o,n,r);case"Object":return nUo(o,n,r);case"Record":return iUo(o,n,r);case"Ref":return oUo(o,n,r);case"This":return sUo(o,n,r);case"Tuple":return aUo(o,n,r);case"Union":return cUo(o,n,r);default:return r}}a(zC,"Visit");function RWe(...t){return t.length===3?zC(t[0],t[1],t[2]):zC(t[0],[],t[1])}a(RWe,"Clean");p();function kWe(t){return pa(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(kWe,"IsStringNumeric");function lUo(t){return TA(t)||DM(t)||ui(t)}a(lUo,"IsValueToString");function bxe(t){return t===!0||ui(t)&&t===1||TA(t)&&t===BigInt("1")||pa(t)&&(t.toLowerCase()==="true"||t==="1")}a(bxe,"IsValueTrue");function Sxe(t){return t===!1||ui(t)&&(t===0||Object.is(t,-0))||TA(t)&&t===BigInt("0")||pa(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(Sxe,"IsValueFalse");function uUo(t){return pa(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(uUo,"IsTimeStringWithTimeZone");function dUo(t){return pa(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(dUo,"IsTimeStringWithoutTimeZone");function fUo(t){return pa(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(fUo,"IsDateTimeStringWithTimeZone");function pUo(t){return pa(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(pUo,"IsDateTimeStringWithoutTimeZone");function hUo(t){return pa(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(hUo,"IsDateString");function mUo(t,e){let r=Kmn(t);return r===e?r:t}a(mUo,"TryConvertLiteralString");function gUo(t,e){let r=Jmn(t);return r===e?r:t}a(gUo,"TryConvertLiteralNumber");function AUo(t,e){let r=Ymn(t);return r===e?r:t}a(AUo,"TryConvertLiteralBoolean");function yUo(t,e){return pa(t.const)?mUo(e,t.const):ui(t.const)?gUo(e,t.const):DM(t.const)?AUo(e,t.const):e}a(yUo,"TryConvertLiteral");function Ymn(t){return bxe(t)?!0:Sxe(t)?!1:t}a(Ymn,"TryConvertBoolean");function _Uo(t){let e=a(r=>r.split(".")[0],"truncateInteger");return kWe(t)?BigInt(e(t)):ui(t)?BigInt(Math.trunc(t)):Sxe(t)?BigInt(0):bxe(t)?BigInt(1):t}a(_Uo,"TryConvertBigInt");function Kmn(t){return $B(t)&&t.description!==void 0?t.description.toString():lUo(t)?t.toString():t}a(Kmn,"TryConvertString");function Jmn(t){return kWe(t)?parseFloat(t):bxe(t)?1:Sxe(t)?0:t}a(Jmn,"TryConvertNumber");function EUo(t){return kWe(t)?parseInt(t):ui(t)?Math.trunc(t):bxe(t)?1:Sxe(t)?0:t}a(EUo,"TryConvertInteger");function vUo(t){return pa(t)&&t.toLowerCase()==="null"?null:t}a(vUo,"TryConvertNull");function CUo(t){return pa(t)&&t==="undefined"?void 0:t}a(CUo,"TryConvertUndefined");function bUo(t){return BE(t)?t:ui(t)?new Date(t):bxe(t)?new Date(1):Sxe(t)?new Date(0):kWe(t)?new Date(parseInt(t)):dUo(t)?new Date(`1970-01-01T${t}.000Z`):uUo(t)?new Date(`1970-01-01T${t}`):pUo(t)?new Date(`${t}.000Z`):fUo(t)?new Date(t):hUo(t)?new Date(`${t}T00:00:00.000Z`):t}a(bUo,"TryConvertDate");function SUo(t,e,r){return(Mi(r)?r:[r]).map(o=>XP(t.items,e,o))}a(SUo,"FromArray");function TUo(t,e,r){return _Uo(r)}a(TUo,"FromBigInt");function IUo(t,e,r){return Ymn(r)}a(IUo,"FromBoolean");function xUo(t,e,r){return bUo(r)}a(xUo,"FromDate");function wUo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return XP(o,[...e,...n],r)}a(wUo,"FromImport");function RUo(t,e,r){return EUo(r)}a(RUo,"FromInteger");function kUo(t,e,r){return t.allOf.reduce((n,o)=>XP(o,e,n),r)}a(kUo,"FromIntersect");function PUo(t,e,r){return yUo(t,r)}a(PUo,"FromLiteral");function DUo(t,e,r){return vUo(r)}a(DUo,"FromNull");function NUo(t,e,r){return Jmn(r)}a(NUo,"FromNumber");function MUo(t,e,r){if(!To(r)||Mi(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Hi(r,n)&&(r[n]=XP(t.properties[n],e,r[n]));return r}a(MUo,"FromObject");function OUo(t,e,r){if(!(To(r)&&!Mi(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=XP(s,e,l);return r}a(OUo,"FromRecord");function LUo(t,e,r){return XP(Da(t,e),e,r)}a(LUo,"FromRef");function BUo(t,e,r){return Kmn(r)}a(BUo,"FromString");function FUo(t,e,r){return pa(r)||ui(r)?Symbol(r):r}a(FUo,"FromSymbol");function UUo(t,e,r){return XP(Da(t,e),e,r)}a(UUo,"FromThis");function QUo(t,e,r){return Mi(r)&&!Yu(t.items)?r.map((o,s)=>s{let c=ZE(s,e,n);return To(c)?{...o,...c}:c},{})}a(VUo,"FromIntersect");function WUo(t,e,r){let n=eF(t,r);if(!To(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=ZE(t.properties[s],e,n[s]);Yu(c)||(n[s]=ZE(t.properties[s],e,n[s]))}if(!YUt(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=ZE(t.additionalProperties,e,n[s]));return n}a(WUo,"FromObject");function zUo(t,e,r){let n=eF(t,r);if(!To(n))return n;let o=t.additionalProperties,[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of Object.getOwnPropertyNames(n))l.test(u)&&YUt(c)&&(n[u]=ZE(c,e,n[u]));if(!YUt(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=ZE(o,e,n[u]));return n}a(zUo,"FromRecord");function YUo(t,e,r){return ZE(Da(t,e),e,eF(t,r))}a(YUo,"FromRef");function KUo(t,e,r){return ZE(Da(t,e),e,r)}a(KUo,"FromThis");function JUo(t,e,r){let n=eF(t,r);if(!Mi(n)||Yu(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;ce9o,Format:()=>Txe,Get:()=>r9o,Has:()=>t9o,Set:()=>XUo,ValuePointerRootDeleteError:()=>MWe,ValuePointerRootSetError:()=>NWe});p();var NWe=class extends Gi{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}},MWe=class extends Gi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function Xmn(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(Xmn,"Escape");function*Txe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nRK(t[o],e[o]))}a(n9o,"ObjectType");function i9o(t,e){return BE(e)&&t.getTime()===e.getTime()}a(i9o,"DateType");function o9o(t,e){return!Mi(e)||t.length!==e.length?!1:t.every((r,n)=>RK(r,e[n]))}a(o9o,"ArrayType");function s9o(t,e){return!mx(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>RK(r,e[n]))}a(s9o,"TypedArrayType");function a9o(t,e){return t===e}a(a9o,"ValueType");function RK(t,e){if(BE(t))return i9o(t,e);if(mx(t))return s9o(t,e);if(Mi(t))return o9o(t,e);if(To(t))return n9o(t,e);if(c1(t))return a9o(t,e);throw new Error("ValueEquals: Unable to compare value")}a(RK,"Equal");var c9o=fc({type:ma("insert"),path:UE(),value:gP()}),l9o=fc({type:ma("update"),path:UE(),value:gP()}),u9o=fc({type:ma("delete"),path:UE()}),tgn=dc([c9o,l9o,u9o]),OWe=class extends Gi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function LWe(t,e){return{type:"update",path:t,value:e}}a(LWe,"CreateUpdate");function rgn(t,e){return{type:"insert",path:t,value:e}}a(rgn,"CreateInsert");function ngn(t){return{type:"delete",path:t}}a(ngn,"CreateDelete");function egn(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new OWe(t,"Cannot diff objects with symbols")}a(egn,"AssertDiffable");function*d9o(t,e,r){if(egn(e),egn(r),!sNt(r))return yield LWe(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Hi(e,s)||(yield rgn(`${t}/${s}`,r[s]));for(let s of n)Hi(r,s)&&(RK(e,r)||(yield*BWe(`${t}/${s}`,e[s],r[s])));for(let s of n)Hi(r,s)||(yield ngn(`${t}/${s}`))}a(d9o,"ObjectType");function*f9o(t,e,r){if(!Mi(r))return yield LWe(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(m9o,"IsRootUpdate");function g9o(t){return t.length===0}a(g9o,"IsIdentity");function ogn(t,e){if(m9o(e))return Ka(e[0].value);if(g9o(e))return Ka(t);let r=Ka(t);for(let n of e)switch(n.type){case"insert":{e2.Set(r,n.path,n.value);break}case"update":{e2.Set(r,n.path,n.value);break}case"delete":{e2.Delete(r,n.path);break}}return r}a(ogn,"Patch");p();function sgn(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=e3(e,r)?zse(e,r,n):n;if(!os(e,r,o))throw new Wse(e,o,OM(e,r,o).First());return o}a(sgn,"Encode");p();function FWe(t){return To(t)&&!Mi(t)}a(FWe,"IsStandardObject");var UWe=class extends Gi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function A9o(t,e,r,n){if(!FWe(r))e2.Set(t,e,Ka(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)KUt(t,`${e}/${c}`,r[c],n[c])}}a(A9o,"ObjectType");function y9o(t,e,r,n){if(!Mi(r))e2.Set(t,e,Ka(n));else{for(let o=0;o(xWe(s,c,l),l)],["Cast",(s,c,l)=>Cxe(s,c,l)],["Clean",(s,c,l)=>RWe(s,c,l)],["Clone",(s,c,l)=>Ka(l)],["Convert",(s,c,l)=>PWe(s,c,l)],["Decode",(s,c,l)=>e3(s,c)?Vse(s,c,l):l],["Default",(s,c,l)=>DWe(s,c,l)],["Encode",(s,c,l)=>e3(s,c)?zse(s,c,l):l]]);function r(s){e.delete(s)}a(r,"Delete"),t.Delete=r;function n(s,c){e.set(s,c)}a(n,"Set"),t.Set=n;function o(s){return e.get(s)}a(o,"Get"),t.Get=o})(JUt||(JUt={}));var lgn=["Clone","Clean","Default","Convert","Assert","Decode"];function C9o(t,e,r,n){return t.reduce((o,s)=>{let c=JUt.Get(s);if(Yu(c))throw new QWe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(C9o,"ParseValue");function ugn(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?Mi(t[0])?[t[0],t[1],[],t[2]]:[lgn,t[0],t[1],t[2]]:t.length===2?[lgn,t[0],[],t[1]]:(()=>{throw new QWe("Invalid Arguments")})();return C9o(e,r,n,o)}a(ugn,"Parse");p();var DO={};Ti(DO,{Assert:()=>xWe,Cast:()=>Cxe,Check:()=>os,Clean:()=>RWe,Clone:()=>Ka,Convert:()=>PWe,Create:()=>JP,Decode:()=>Zmn,Default:()=>DWe,Diff:()=>ign,Edit:()=>tgn,Encode:()=>sgn,Equal:()=>RK,Errors:()=>OM,Hash:()=>a7,Mutate:()=>cgn,Parse:()=>ugn,Patch:()=>ogn,ValueErrorIterator:()=>c7});p();var b9o="gpt-41-copilot",cw=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&ws(this._ctx,n=>this.refreshAvailableModels(n))}static{a(this,"AvailableModelsManager")}async refreshAvailableModels(e){await this.refreshModels(e);for(let r of this.onModelsFetchedCallbacks)r()}addHandler(e){this.onModelsFetchedCallbacks.push(e)}getDefaultModelId(){if(this.fetchedModelData){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return b9o}parseModelsResponse(e){try{return DO.Parse(Dmn,e)}catch(r){Fr.exception(this._ctx,r,"Failed to parse /models response from CAPI");return}}async refreshModels(e){let r=await this.fetchModels(e);r&&(this.fetchedModelData=r)}async fetchModels(e){return this.editorPreviewFeaturesDisabled=e.getTokenValue("editor_preview_features")=="0",await this.fetch(e)}fetch(e){return(!this.fetchInProgress||this.fetchInProgress.withToken.token!==e.token)&&(this.fetchInProgress={withToken:e,response:this.fetchImpl(e).finally(()=>{this.fetchInProgress=void 0})}),this.fetchInProgress.response}async fetchImpl(e){let r=await wK(this._ctx,"/models",e);return r.ok?this.parseModelsResponse(await r.json())?.data??[]:(Fr.error(this._ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText}),null)}getGenericCompletionModels(){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return t.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:"o200k_base"}static filterCompletionModels(e,r){return e.filter(n=>n.capabilities.type==="completion").filter(n=>!r||n.preview===!1||n.preview===void 0)}static filterModelsWithEditorPreviewFeatures(e,r){return e.filter(n=>!r||n.preview===!1||n.preview===void 0)}static mapCompletionModels(e){return e.map(r=>({modelId:r.id,label:r.name,preview:!!r.preview,tokenizer:r.capabilities.tokenizer}))}getCurrentModelRequestInfo(e=void 0){let r=this.getDefaultModelId(),n=Mmn(this._ctx);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&Fr.error(this._ctx,`User selected model ${n} is not in the list of generic models: ${l.join(", ")}, falling back to default model.`),n=null),r===n&&(n=null)}let o=kt(this._ctx,ze.DebugOverrideEngine)||kt(this._ctx,ze.DebugOverrideEngineLegacy);if(o)return new kK(o,"override");let s=e?this._ctx.get(tr).customEngine(e):"",c=e?this._ctx.get(tr).customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new kK(s,"exp"):new kK(n,"modelpicker"):s?new kK(s,"exp"):new kK(r,"default")}},kK=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function XQ(t,e=void 0){let r=t.get(cw),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(XQ,"getEngineRequestInfo");p();p();var Go=class{static{a(this,"FileSystem")}};var wgn=fe(xgn());function Rgn(t){return t!==void 0&&t!==0}a(Rgn,"isRepoInfo");function kgn(t){if(t===void 0||t===0)return"";let e=PK(t);if(e==="github/github")return e;let r=Y9o(t)?.toLowerCase();return r!==void 0?r:""}a(kgn,"getDogFood");function PK(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(PK,"tryGetGitHubNWO");function Y9o(t){if(t===void 0||t===0)return;let e=t.hostname.toLowerCase(),r=e==="azure.com"||e.endsWith(".azure.com"),n=e==="visualstudio.com"||e.endsWith(".visualstudio.com");if(r||n)return t.owner+"/"+t.repo}a(Y9o,"tryGetADONWO");function eq(t,e){let r=Cf(e);return K9o(t,r)}a(eq,"extractRepoInfoInBackground");var K9o=e7o(J9o,1e4);async function J9o(t,e){let r=Btn(e);if(!r)return;let n=await Z9o(t,r);if(!n)return;let o=t.get(Go),s=Oa(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=X9o(c)??"",u=t9t(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(J9o,"extractRepoInfo");function t9t(t){let e;try{if(e=(0,wgn.default)(t),e.resource==""||e.owner==""||e.name==""||e.pathname=="")return}catch{return}return{hostname:e.resource,owner:e.owner,repo:e.name,pathname:e.pathname}}a(t9t,"parseRepoUrl");async function Z9o(t,e){let r=e+"_add_to_make_longer",n=t.get(Go);for(;e!=="file:///"&&e.length{let c=JSON.stringify(s),l=r.get(c);if(l)return l.result;if(n.has(c))return 0;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new e9t(d)),n.delete(c)}),0}}a(e7o,"computeInBackgroundAndMemoize");p();var Ixe=500,Pgn=8192-Ixe,Dgn=4,qWe=10,Ngn=1e3*5,jWe={prefix:35,suffix:15,stableContext:35,volatileContext:15},t7o={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function xxe(t){return t=t.toLowerCase(),t7o[t]??t}a(xxe,"normalizeLanguageId");var r9t=class{constructor(e){this.ctx=e;this.cache=new Sn(200)}static{a(this,"FilterSettingsToExpConfigs")}async fetchExpConfig(e,r){let n=e.stringify()+` +`+JSON.stringify(r),o=this.cache.get(n);return o||(o=new n9t(()=>this.ctx.get(qP).fetchExperiments(this.ctx,r,e.toHeaders()),1e3*60*60),this.cache.set(n,o)),o.run()}getCachedExpConfig(e){return this.cache.get(e.stringify())?.value()}},n9t=class{constructor(e,r=1/0){this.producer=e;this.expirationMs=r}static{a(this,"Task")}async run(){return this.promise===void 0&&(this.promise=this.producer(),this.storeResult(this.promise).then(()=>{this.expirationMs<1/0&&this.promise!==void 0&&setTimeout(()=>this.promise=void 0,this.expirationMs)})),this.promise}async storeResult(e){try{this.result=await e}finally{this.result===void 0&&(this.promise=void 0)}}value(){return this.result}};function n7o(t){return"uri"in t}a(n7o,"isCompletionsFiltersInfo");var tr=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new r9t(this.ctx)}static{a(this,"Features")}static{this.upcomingDynamicFilterCheckDelayMs=20}static{this.upcomingTimeBucketMinutes=5+Math.floor(Math.random()*11)}registerStaticFilters(e){Object.assign(this.staticFilters,e)}registerDynamicFilter(e,r){this.dynamicFilters[e]=r}registerDynamicFilterGroup(e){this.dynamicFilterGroups.push(e)}getDynamicFilterValues(){let e={};for(let r of this.dynamicFilterGroups)Object.assign(e,r());for(let[r,n]of Object.entries(this.dynamicFilters))e[r]=n();return e}registerUpcomingDynamicFilter(e,r){this.upcomingDynamicFilters[e]=r}async updateExPValuesAndAssignments(e,r,n=Vt.createAndMarkAsIssued()){if(n instanceof Tx)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&n7o(r)?eq(this.ctx,r.uri):void 0,s=PK(o)??"",c=kgn(o)??"",l=r?.languageId??"",u=XQ(this.ctx).modelId,d=w$r(e),f=e.getTokenValue("ol")??"",h=e.getTokenValue("tid")??"",m=e.getTokenValue("fcv1")==="1",g=e.getTokenValue("sn")==="1",y=this.ctx.get(Gp).getProperties(),_=e.endpoints,E={"X-Copilot-Repository":s,"X-Copilot-FileType":l,"X-Copilot-UserKind":d,"X-Copilot-Dogfood":c,"X-Copilot-Engine":u,"X-Copilot-Orgs":f,"X-Copilot-CopilotTrackingId":h,"X-GitHub-Copilot-SKU":y.sku||"","X-GitHub-Copilot-IsFcv1":m?"1":"0","X-GitHub-Copilot-IsSn":g?"1":"0"},v=this.getGranularityDirectory(),S=this.makeFilterSettings(E),T=v.extendFilters(S),w=await this.getExpConfig(T.newFilterSettings,_);v.update(S,+(w.variables.copilotbycallbuckets??NaN),+(w.variables.copilottimeperiodsizeinh??NaN));let R=v.extendFilters(S),x=R.newFilterSettings,k=await this.getExpConfig(x,_),D=new Promise(N=>setTimeout(N,t.upcomingDynamicFilterCheckDelayMs));for(let N of R.otherFilterSettingsToPrefetch)D=D.then(async()=>{await new Promise(O=>setTimeout(O,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(N,_)});return this.prepareForUpcomingFilters(x,_),new Tx(n.properties,n.measurements,n.issuedTime,{filters:x,exp:k})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){let n=await this.ctx.get(Qt).getToken();return await this.updateExPValuesAndAssignments(n,e,r)}getGranularityDirectory(){if(!this.granularityDirectory){let e=this.ctx.get(za).machineId;this.granularityDirectory=new fGe(e,this.ctx.get(HC))}return this.granularityDirectory}makeFilterSettings(e){return new QB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return px.createFallbackConfig(this.ctx,`Error fetching ExP config: ${String(n)}`)}}async prepareForUpcomingFilters(e,r){if(!(new Date().getMinutes()<60-t.upcomingTimeBucketMinutes))for(let[n,o]of Object.entries(this.upcomingDynamicFilters))await new Promise(s=>setTimeout(s,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(e.withChange(n,o()),r)}stringify(){let e=this.assignments.getCachedExpConfig(new QB({}));return JSON.stringify(e?.variables??{})}async getFallbackExpAndFilters(){let e=this.makeFilterSettings({}),r=i3(this.ctx),n=await this.getExpConfig(e,r);return{filters:e,exp:n}}disableLogProb(e){return e.filtersAndExp.exp.variables.copilotdisablelogprob??!0}overrideBlockMode(e){return e.filtersAndExp.exp.variables.copilotoverrideblockmode||void 0}customEngine(e){return e.filtersAndExp.exp.variables.copilotcustomengine??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables.copilotcustomenginetargetengine}suffixPercent(e){return e.filtersAndExp.exp.variables.CopilotSuffixPercent??jWe.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??qWe}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables.copilotcppheadersenableswitch??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscodecsharp??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscodetypescript??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscode??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables.copilotcontextproviders??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e){return e.filtersAndExp.exp.variables.copilotcontextprovidertimebudget??150}includeNeighboringFiles(e){return e.filtersAndExp.exp.variables.copilotincludeneighboringfiles??!1}excludeRelatedFiles(e){return e.filtersAndExp.exp.variables.copilotexcluderelatedfiles??!1}maxPromptCompletionTokens(e){return e.filtersAndExp.exp.variables.maxpromptcompletionTokens??Pgn+Ixe}ideChatMaxRequestTokens(e){return e.filtersAndExp.exp.variables.idechatmaxrequesttokens??-1}ideChatExpModelIds(e){return e.filtersAndExp.exp.variables.idechatexpmodelids??""}ideChatEnableProjectMetadata(e){return e.filtersAndExp.exp.variables.idechatenableprojectmetadata??!1}ideDataMigrationCompleted(e){return e.filtersAndExp.exp.variables.idedatamigrationcompleted??!1}workspaceContextCoordinator(e){return e.filtersAndExp.exp.variables.copilotworkspacecontextcoordinator??!1}workspaceContextCacheTime(e){return e.filtersAndExp.exp.variables.copilotworkspacecontextcachetime??Ngn}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??jWe.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??jWe.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotcppContextProviderParams}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotcsharpcontextproviderparams}javaContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotjavacontextproviderparams}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotmultilanguagecontextproviderparams}tsContextProviderParams(e){return e.filtersAndExp.exp.variables.copilottscontextproviderparams}completionsDebounce(e){return e.filtersAndExp.exp.variables.copilotcompletionsdebounce}enableElectronFetcher(e){return e.filtersAndExp.exp.variables.copilotelectronfetcher??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables.copilotfetchfetcher??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables.copilotasynccompletionstimeout??200}enablePromptContextProxyField(e){return e.filtersAndExp.exp.variables.copilotenablepromptcontextproxyfield??!1}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables.copilotprogressivereveal??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables.copilotmodelterminatesingleline??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables.copilotprogressivereveallonglookaheadsize??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables.copilotprogressiverevealshortlookaheadsize??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables.copilotmaxmultilinetokens??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables.copilotmultilineafteracceptlines??1}enableNESXTab(e){return e.filtersAndExp.exp.variables.copilotnesxtab??!1}getNESXTabModelID(e){return e.filtersAndExp.exp.variables.copilotnesxtabmodelid??"copilot-nes-xtab"}completionsDelay(e){return e.filtersAndExp.exp.variables.copilotcompletionsdelay??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables.copilotsinglelineunlessaccepted??!1}useCompletionsComparisonPanel(e){return e.filtersAndExp.exp.variables.copilotusecompletionscomparisonpanel??!1}comparisonPanelModelIds(e){return e.filtersAndExp.exp.variables.copilotcomparisonpanelmodelids??""}comparisonPanelRandomizedMode(e){return e.filtersAndExp.exp.variables.copilotcomparisonpanelrandomizedmode??!0}useChatLibCompletions(e){return e.filtersAndExp.exp.variables.copilotusechatlibcompletions??!1}cveRemediatorAgentEnabled(e){return e.filtersAndExp.exp.variables.cveremediatoragentenabled??!1}instantApplyModelMigration(e){return e.filtersAndExp.exp.variables.copilotinstantapplymodelmigration??!1}appmodContextMenuEnabled(e){return e.filtersAndExp.exp.variables.copilotappmodcontextmenuenabled??!1}appmodProblemsViewEnabled(e){return e.filtersAndExp.exp.variables.copilotappmodproblemsviewenabled??!1}searchAgentEnabled(e){return e.filtersAndExp.exp.variables.copilotsearchagentenabled??!1}cliAsDefaultAgentProviderEnabled(e){return e.filtersAndExp.exp.variables.copilotcliasdefaultagentprovider??!1}inlineChatUseCliEnabled(e){return e.filtersAndExp.exp.variables.inlinechatusecli??!1}};async function HWe(t){let e=kt(t,ze.SearchAgent);if(e==="true")return!0;if(e==="false")return!1;let r=t.get(tr),n=await r.fetchTokenAndUpdateExPValuesAndAssignments();return r.searchAgentEnabled(n)}a(HWe,"isSearchAgentEnabled");p();p();p();var GWe=fe(tue());var o9t={python:"python",javascript:"javascript",javascriptreact:"javascript",jsx:"javascript",typescript:"typescript",typescriptreact:"tsx",go:"go",ruby:"ruby",csharp:"c-sharp",java:"java",php:"php",c:"cpp",cpp:"cpp"};function tT(t){return t in o9t&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(tT,"isSupportedLanguageId");function $We(t){if(!(t in o9t))throw new Error(`Unrecognized language: ${t}`);return o9t[t]}a($We,"languageIdToWasmLanguage");var i9t=new Map;async function i7o(t){let e;try{e=await bWe(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new KQ(`Could not load tree-sitter-${t}.wasm`,r):r}return GWe.default.Language.load(e)}a(i7o,"loadWasmLanguage");function a9t(t){let e=$We(t);if(!i9t.has(e)){let r=i7o(e);i9t.set(e,r)}return i9t.get(e)}a(a9t,"getLanguage");var s9t=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function tq(t,e){return(await c9t(t,e))[0]}a(tq,"parseTreeSitter");async function c9t(t,e){await GWe.default.init({locateFile:a(s=>Exe(s),"locateFile")});let r;try{r=new GWe.default}catch(s){throw s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&s.message.includes("table index is out of bounds")?new s9t(`Could not init Parse for language <${t}>`,s):s}let n=await a9t(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(c9t,"parseTreeSitterIncludingVersion");function Mgn(t){switch($We(t)){case"python":return null;case"javascript":case"typescript":case"tsx":case"go":case"c-sharp":case"java":case"php":case"cpp":return"}";case"ruby":return"end"}}a(Mgn,"getBlockCloseToken");function o7o(t,e){let r=[];for(let n of t){if(!n[1]){let o=e.tree.getLanguage();n[1]=o.query(n[0])}r.push(...n[1].matches(e))}return r}a(o7o,"innerQuery");var s7o=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function Mgn(t){return n7o([i7o],t).length==1}a(Mgn,"queryPythonIsDocstring");var NO=class{constructor(e){this.node=e;this.children=[];this.collapsed=!1}static{a(this,"StatementNode")}addChild(e){e.parent=this,e.nextSibling=void 0,this.children.length>0&&(this.children[this.children.length-1].nextSibling=e),this.children.push(e)}childrenFinished(){}containsStatement(e){return this.node.startIndex<=e.node.startIndex&&this.node.endIndex>=e.node.endIndex}statementAt(e){if(this.node.startIndex>e||this.node.endIndex(r=n.statementAt(e),r!==void 0)),r??this}collapse(){this.children.length=0,this.collapsed=!0}get description(){return`${this.node.type} ([${this.node.startPosition.row},${this.node.startPosition.column}]..[${this.node.endPosition.row},${this.node.endPosition.column}]): ${JSON.stringify(this.node.text.length>33?this.node.text.substring(0,15)+"..."+this.node.text.slice(-15):this.node.text)}`}dump(e="",r=""){let n=[`${e}${this.description}`];return this.children.forEach(o=>{n.push(o.dump(`${r}+- `,o.nextSibling===void 0?`${r} `:`${r}| `))}),n.join(` +]`];function Ogn(t){return o7o([s7o],t).length==1}a(Ogn,"queryPythonIsDocstring");var NO=class{constructor(e){this.node=e;this.children=[];this.collapsed=!1}static{a(this,"StatementNode")}addChild(e){e.parent=this,e.nextSibling=void 0,this.children.length>0&&(this.children[this.children.length-1].nextSibling=e),this.children.push(e)}childrenFinished(){}containsStatement(e){return this.node.startIndex<=e.node.startIndex&&this.node.endIndex>=e.node.endIndex}statementAt(e){if(this.node.startIndex>e||this.node.endIndex(r=n.statementAt(e),r!==void 0)),r??this}collapse(){this.children.length=0,this.collapsed=!0}get description(){return`${this.node.type} ([${this.node.startPosition.row},${this.node.startPosition.column}]..[${this.node.endPosition.row},${this.node.endPosition.column}]): ${JSON.stringify(this.node.text.length>33?this.node.text.substring(0,15)+"..."+this.node.text.slice(-15):this.node.text)}`}dump(e="",r=""){let n=[`${e}${this.description}`];return this.children.forEach(o=>{n.push(o.dump(`${r}+- `,o.nextSibling===void 0?`${r} `:`${r}| `))}),n.join(` `)}dumpPath(e="",r="",n=!1){if(this.parent){let o=this.parent.dumpPath(e,r,!0),s=o.length-o.lastIndexOf(` `)-1-r.length,c=" ".repeat(s),l=n?` ${r}${c}+- `:"";return o+this.description+l}else{let o=n?` -${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.languageId=e;this.text=r;this.startOffset=n;this.endOffset=o;this.statements=[]}static{a(this,"StatementTree")}static isSupported(e){return tue.languageIds.has(e)||rue.languageIds.has(e)||wxe.languageIds.has(e)||nue.languageIds.has(e)||Rxe.languageIds.has(e)||kxe.languageIds.has(e)||Pxe.languageIds.has(e)||Dxe.languageIds.has(e)||Nxe.languageIds.has(e)}static isTrimmedByDefault(e){return tue.languageIds.has(e)||rue.languageIds.has(e)||nue.languageIds.has(e)}static create(e,r,n,o){if(tue.languageIds.has(e))return new tue(e,r,n,o);if(rue.languageIds.has(e))return new rue(e,r,n,o);if(wxe.languageIds.has(e))return new wxe(e,r,n,o);if(nue.languageIds.has(e))return new nue(e,r,n,o);if(Pxe.languageIds.has(e))return new Pxe(e,r,n,o);if(Rxe.languageIds.has(e))return new Rxe(e,r,n,o);if(kxe.languageIds.has(e))return new kxe(e,r,n,o);if(Dxe.languageIds.has(e))return new Dxe(e,r,n,o);if(Nxe.languageIds.has(e))return new Nxe(e,r,n,o);throw new Error(`Unsupported languageId: ${e}`)}[Symbol.dispose](){this.tree&&(this.tree.delete(),this.tree=void 0)}clear(){this.statements.length=0}statementAt(e){let r;return this.statements.find(n=>(r=n.statementAt(e),r!==void 0)),r}async build(){let e=[];this.clear();let r=await this.parse();this.getStatementQuery(r).captures(r.rootNode,{startPosition:this.offsetToPosition(this.startOffset),endPosition:this.offsetToPosition(this.endOffset)}).forEach(o=>{let s=this.createNode(o.node);for(;e.length>0&&!e[0].containsStatement(s);)e.shift()?.childrenFinished();e.length>0?e[0].addChild(s):this.addStatement(s),e.unshift(s)}),e.forEach(o=>o.childrenFinished())}addStatement(e){e.parent=void 0,e.nextSibling=void 0,this.statements.length>0&&(this.statements[this.statements.length-1].nextSibling=e),this.statements.push(e)}async parse(){return this.tree||(this.tree=await tq(this.languageId,this.text)),this.tree}getStatementQuery(e){return this.getQuery(e.getLanguage(),this.getStatementQueryText())}getQuery(e,r){return e.query(r)}offsetToPosition(e){let r=this.text.slice(0,e).split(` +${r}+- `:"";return e+this.description+o}}},A0=class{constructor(e,r,n,o){this.languageId=e;this.text=r;this.startOffset=n;this.endOffset=o;this.statements=[]}static{a(this,"StatementTree")}static isSupported(e){return rue.languageIds.has(e)||nue.languageIds.has(e)||wxe.languageIds.has(e)||iue.languageIds.has(e)||Rxe.languageIds.has(e)||kxe.languageIds.has(e)||Pxe.languageIds.has(e)||Dxe.languageIds.has(e)||Nxe.languageIds.has(e)}static isTrimmedByDefault(e){return rue.languageIds.has(e)||nue.languageIds.has(e)||iue.languageIds.has(e)}static create(e,r,n,o){if(rue.languageIds.has(e))return new rue(e,r,n,o);if(nue.languageIds.has(e))return new nue(e,r,n,o);if(wxe.languageIds.has(e))return new wxe(e,r,n,o);if(iue.languageIds.has(e))return new iue(e,r,n,o);if(Pxe.languageIds.has(e))return new Pxe(e,r,n,o);if(Rxe.languageIds.has(e))return new Rxe(e,r,n,o);if(kxe.languageIds.has(e))return new kxe(e,r,n,o);if(Dxe.languageIds.has(e))return new Dxe(e,r,n,o);if(Nxe.languageIds.has(e))return new Nxe(e,r,n,o);throw new Error(`Unsupported languageId: ${e}`)}[Symbol.dispose](){this.tree&&(this.tree.delete(),this.tree=void 0)}clear(){this.statements.length=0}statementAt(e){let r;return this.statements.find(n=>(r=n.statementAt(e),r!==void 0)),r}async build(){let e=[];this.clear();let r=await this.parse();this.getStatementQuery(r).captures(r.rootNode,{startPosition:this.offsetToPosition(this.startOffset),endPosition:this.offsetToPosition(this.endOffset)}).forEach(o=>{let s=this.createNode(o.node);for(;e.length>0&&!e[0].containsStatement(s);)e.shift()?.childrenFinished();e.length>0?e[0].addChild(s):this.addStatement(s),e.unshift(s)}),e.forEach(o=>o.childrenFinished())}addStatement(e){e.parent=void 0,e.nextSibling=void 0,this.statements.length>0&&(this.statements[this.statements.length-1].nextSibling=e),this.statements.push(e)}async parse(){return this.tree||(this.tree=await tq(this.languageId,this.text)),this.tree}getStatementQuery(e){return this.getQuery(e.getLanguage(),this.getStatementQueryText())}getQuery(e,r){return e.query(r)}offsetToPosition(e){let r=this.text.slice(0,e).split(` `),n=r.length-1,o=r[r.length-1].length;return{row:n,column:o}}dump(e=""){let r=[];return this.statements.forEach((n,o)=>{let s=`[${o}]`,c=" ".repeat(s.length);r.push(n.dump(`${e} ${s} `,`${e} ${c} `))}),r.join(` -`)}},VWe=class t extends NO{static{a(this,"JSStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","generator_function_declaration","class_declaration","statement_block","if_statement","switch_statement","for_statement","for_in_statement","while_statement","do_statement","try_statement","with_statement","labeled_statement","method_definition","interface_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="statement_block"||this.children.length===2&&this.node.childForFieldName("alternative")!==null&&this.children[0].node.type!=="statement_block"&&this.children[1].node.type!=="statement_block"}},tue=class extends g0{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new VWe(e)}getStatementQueryText(){return`[ +`)}},VWe=class t extends NO{static{a(this,"JSStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","generator_function_declaration","class_declaration","statement_block","if_statement","switch_statement","for_statement","for_in_statement","while_statement","do_statement","try_statement","with_statement","labeled_statement","method_definition","interface_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="statement_block"||this.children.length===2&&this.node.childForFieldName("alternative")!==null&&this.children[0].node.type!=="statement_block"&&this.children[1].node.type!=="statement_block"}},rue=class extends A0{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new VWe(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -1813,7 +1813,7 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (field_definition) - ] @statement`}},rue=class extends g0{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new VWe(e)}getStatementQueryText(){return`[ + ] @statement`}},nue=class extends A0{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new VWe(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -1836,7 +1836,7 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},c9t=class t extends NO{static{a(this,"PyStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","for_statement","while_statement","try_statement","with_statement","function_definition","class_definition","decorated_definition","match_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"?!1:this.node.startPosition.row===this.node.endPosition.row}},wxe=class extends g0{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new c9t(e)}getStatementQueryText(){return`[ + ] @statement`}},l9t=class t extends NO{static{a(this,"PyStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","for_statement","while_statement","try_statement","with_statement","function_definition","class_definition","decorated_definition","match_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"?!1:this.node.startPosition.row===this.node.endPosition.row}},wxe=class extends A0{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new l9t(e)}getStatementQueryText(){return`[ (future_import_statement) (import_statement) (import_from_statement) @@ -1862,24 +1862,24 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la (decorated_definition) (match_statement) (block) - ] @statement`}},l9t=class t extends NO{static{a(this,"GoStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","method_declaration","if_statement","for_statement","expression_switch_statement","type_switch_statement","select_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},nue=class extends g0{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new l9t(e)}getStatementQueryText(){return`[ + ] @statement`}},u9t=class t extends NO{static{a(this,"GoStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","method_declaration","if_statement","for_statement","expression_switch_statement","type_switch_statement","select_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},iue=class extends A0{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new u9t(e)}getStatementQueryText(){return`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},u9t=class t extends NO{static{a(this,"PhpStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","else_clause","else_if_clause","for_statement","foreach_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","finally_clause","anonymous_function","compound_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},Rxe=class extends g0{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new u9t(e)}getStatementQueryText(){return`[ + ] @statement`}},d9t=class t extends NO{static{a(this,"PhpStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","else_clause","else_if_clause","for_statement","foreach_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","finally_clause","anonymous_function","compound_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},Rxe=class extends A0{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new d9t(e)}getStatementQueryText(){return`[ (statement) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},d9t=class t extends NO{static{a(this,"RubyStatementNode")}static{this.compoundTypeNames=new Set(["if","case","while","until","for","begin","module","class","method"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},kxe=class extends g0{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new d9t(e)}getStatementQueryText(){return`[ + ] @statement`}},f9t=class t extends NO{static{a(this,"RubyStatementNode")}static{this.compoundTypeNames=new Set(["if","case","while","until","for","begin","module","class","method"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},kxe=class extends A0{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new f9t(e)}getStatementQueryText(){return`[ (_statement) (when) - ] @statement`}},f9t=class t extends NO{static{a(this,"JavaStatementNode")}static{this.compoundTypeNames=new Set(["block","do_statement","enhanced_for_statement","for_statement","if_statement","labeled_statement","switch_expression","synchronized_statement","try_statement","try_with_resources_statement","while_statement","interface_declaration","method_declaration","constructor_declaration","compact_constructor_declaration","class_declaration","annotation_type_declaration","static_initializer"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},Pxe=class extends g0{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new f9t(e)}getStatementQueryText(){return`[ + ] @statement`}},p9t=class t extends NO{static{a(this,"JavaStatementNode")}static{this.compoundTypeNames=new Set(["block","do_statement","enhanced_for_statement","for_statement","if_statement","labeled_statement","switch_expression","synchronized_statement","try_statement","try_with_resources_statement","while_statement","interface_declaration","method_declaration","constructor_declaration","compact_constructor_declaration","class_declaration","annotation_type_declaration","static_initializer"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},Pxe=class extends A0{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new p9t(e)}getStatementQueryText(){return`[ (statement) (field_declaration) (record_declaration) @@ -1892,7 +1892,7 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la (block) (static_initializer) (constructor_declaration) - ] @statement`}},p9t=class t extends NO{static{a(this,"CSharpStatementNode")}static{this.compoundTypeNames=new Set(["block","checked_statement","class_declaration","constructor_declaration","destructor_declaration","do_statement","fixed_statement","for_statement","foreach_statement","if_statement","interface_declaration","lock_statement","method_declaration","struct_declaration","switch_statement","try_statement","unsafe_statement","while_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},Dxe=class extends g0{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new p9t(e)}getStatementQueryText(){return`[ + ] @statement`}},h9t=class t extends NO{static{a(this,"CSharpStatementNode")}static{this.compoundTypeNames=new Set(["block","checked_statement","class_declaration","constructor_declaration","destructor_declaration","do_statement","fixed_statement","for_statement","foreach_statement","if_statement","interface_declaration","lock_statement","method_declaration","struct_declaration","switch_statement","try_statement","unsafe_statement","while_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},Dxe=class extends A0{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new h9t(e)}getStatementQueryText(){return`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -1904,7 +1904,7 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la (declaration) (accessor_declaration) (block) - ] @statement`}},h9t=class t extends NO{static{a(this,"CStatementNode")}static{this.compoundTypeNames=new Set(["declaration","function_definition","enum_specifier","field_declaration_list","type_definition","compound_statement","if_statement","switch_statement","while_statement","for_statement","do_statement","preproc_if","preproc_ifdef","namespace_definition","class_specifier","field_declaration_list","concept_definition","template_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){(this.isSingleLineDeclarationStatement()||this.isSingleLineConceptDefinition())&&this.collapse()}isSingleLineDeclarationStatement(){return!(this.node.type!=="declaration"||this.node.startPosition.row!==this.node.endPosition.row)}isSingleLineConceptDefinition(){return!(this.node.type!=="concept_definition"||this.node.startPosition.row!==this.node.endPosition.row)}},Nxe=class extends g0{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new h9t(e)}getStatementQueryText(){return`[ + ] @statement`}},m9t=class t extends NO{static{a(this,"CStatementNode")}static{this.compoundTypeNames=new Set(["declaration","function_definition","enum_specifier","field_declaration_list","type_definition","compound_statement","if_statement","switch_statement","while_statement","for_statement","do_statement","preproc_if","preproc_ifdef","namespace_definition","class_specifier","field_declaration_list","concept_definition","template_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){(this.isSingleLineDeclarationStatement()||this.isSingleLineConceptDefinition())&&this.collapse()}isSingleLineDeclarationStatement(){return!(this.node.type!=="declaration"||this.node.startPosition.row!==this.node.endPosition.row)}isSingleLineConceptDefinition(){return!(this.node.type!=="concept_definition"||this.node.startPosition.row!==this.node.endPosition.row)}},Nxe=class extends A0{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new m9t(e)}getStatementQueryText(){return`[ (declaration) (function_definition) (type_definition) @@ -1941,7 +1941,7 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}};var MO=class{constructor(e,r,n){this.languageId=e;this.prefix=r;this.completion=n}static{a(this,"BlockTrimmer")}static isSupported(e){return g0.isSupported(e)}static isTrimmedByDefault(e){return g0.isTrimmedByDefault(e)}async withParsedStatementTree(e){var n=[];try{let r=mDt(n,g0.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length));await r.build();return await e(r)}catch(o){var s=o,c=!0}finally{gDt(n,s,c)}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};var WWe=class extends MO{constructor(r,n,o,s=3,c=7){super(r,n,o);this.lineLimit=s;this.lookAhead=c;let l=[...this.completion.matchAll(/\n/g)],u=this.lineLimit+this.lookAhead;l.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=l[this.lineLimit-1].index),l.length>=u&&u>0&&(this.lookAheadOffset=l[u-1].index)}static{a(this,"TerseBlockTrimmer")}async getCompletionTrimOffset(){return await this.withParsedStatementTree(r=>{let n=r.statementAt(this.stmtStartPos()),o=this.getContainingBlockOffset(n);return o=this.trimAtFirstBlankLine(o),n&&(o=this.trimAtStatementChange(n,o)),this.limitOffset&&this.lookAheadOffset&&(o===void 0||o>this.lookAheadOffset)?this.limitOffset:o})}stmtStartPos(){let r=this.completion.match(/\S/);return r&&r.index!==void 0?this.prefix.length+r.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(r){let n=[...this.trimmedCompletion(r).matchAll(/\r?\n\s*\r?\n/g)];for(;n.length>0&&(r===void 0||r>n[0].index);){let o=n.shift();if(this.completion.substring(0,o.index).trim()!=="")return o.index}return r}trimAtStatementChange(r,n){let o=this.prefix.length,s=this.prefix.length+(n??this.completion.length);if(r.node.endIndex>o&&this.isCompoundStatement(r))return r.nextSibling&&r.node.endIndexo&&c.node.endIndexm7o,build:()=>f7o,buildType:()=>p7o,default:()=>v7o,dependencies:()=>y7o,description:()=>u7o,devDependencies:()=>A7o,displayName:()=>l7o,engines:()=>h7o,name:()=>c7o,overrides:()=>_7o,overridesComments:()=>E7o,scripts:()=>g7o,version:()=>d7o});var c7o="copilot",l7o="GitHub Copilot",u7o="Your AI pair programmer",d7o="1.527.1",f7o="86",p7o="prod",h7o={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},m7o={cliPackageVersion:"2.1.159"},g7o={build:"tsx esbuild.ts",clean:"./script/build/clean.sh",compress:"tsx ./script/compressTokenizer.ts",generate_languages:"tsx script/generateLanguages.ts && prettier --write lib/src/language/generatedLanguages.ts",get_token:"tsx script/deviceFlow.ts --save-as-test-token",lint:'run-p --aggregate-output "lint:*"',"lint:deps":"depcruise -c .dependency-cruiser.js .","lint:eslint":"eslint -f visualstudio --quiet --cache .","lint:overrides":"tsx script/checkOverridesDocumented.ts","lint:prettier":"prettier --check . 2>&1","lint:types":"tsc --noEmit",inspect_auth_db:"tsx script/inspectAuthDb.ts",prebuild:"npm install",pretest:"npm run build","pretest:headless":"npm run build","pretest:lsp-client":"npm run build","pretest:lib-e2e":"npm run build",prewatch:"npm run build","prewatch:esbuild":"npm run build",start:"npm run watch",test:'npm-run-all "test:headless --ignore-scripts" lint',"test:headless":'npm-run-all test:lib test:agent "test:lib-e2e --ignore-scripts" test:prompt "test:lsp-client --ignore-scripts" lint',"test:agent":'mocha "agent/src/**/*.test.{ts,tsx}"',"test:lib":'mocha "lib/src/**/*.test.{ts,tsx}" "script/**/*.test.{ts,tsx}" --exclude "lib/src/**/*.int.test.ts"',"test:lib-int":'mocha "lib/src/**/*.int.test.ts"',"test:lib-e2e":'mocha "lib/e2e/src/**/*.test.{ts,tsx}" --exclude "lib/e2e/src/prompt/**/*.test.ts"',"test:lib-e2e-no-ci":'mocha "lib/e2e/no-ci/**/*.test.{ts,tsx}"',"test:lib-prompt-e2e":'mocha "lib/e2e/src/prompt/prompt.test.ts"',"test:lib-prompt-e2e-perf":"INCLUDE_PERFORMANCE=true npm run test:lib-prompt-e2e","test:lsp-client":'mocha "lsp-client/test/*.test.{ts,tsx}"',"test:pkg-runtime":"tsx script/smokeCopilotRuntimePkg.ts","test:prompt":'mocha "prompt/test/**/*.test.{ts,tsx}"',"test:prepare-msbench":"tsx script/setupMsbench.ts","test:run-msbench":"tsx lsp-client/test/msbench/agent/index.ts",watch:'run-p "watch:esbuild --ignore-scripts" "watch:types -- --preserveWatchOutput"',"watch:esbuild":"tsx esbuild.ts --watch","watch:types":"tsc --noEmit --watch"},A7o={"@azure/identity":"^4.13.1","@azure/keyvault-secrets":"^4.11.2","@github/prettier-config":"0.0.6","@limegrass/eslint-plugin-import-alias":"^1.6.1","@types/crypto-js":"^4.2.2","@types/diff":"^8.0.0","@types/git-url-parse":"^16.0.2","@types/js-yaml":"^4.0.6","@types/kerberos":"^1.1.2","@types/markdown-it":"^14.1.2","@types/mocha":"^10.0.10","@types/node":"~22.13.0","@types/semver":"^7.7.1","@types/sinon":"^22.0.0","@types/toposort":"^2.0.7","@types/vscode":"1.125.0","@types/which":"^3.0.0","@types/yargs":"^17.0.35","@vscode/tree-sitter-wasm":"0.0.5-php.2","@yao-pkg/pkg":"^6.21.0",boxen:"^8.0.1",chalk:"^5.6.2","dependency-cruiser":"^18.1.0",esbuild:"^0.28.1","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.5","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.8.0","js-yaml":"^4.2.0",mocha:"^11.7.6","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^6.49.0",prettier:"^3.5.3","prettier-plugin-organize-imports":"^4.2.0","simple-git":"^3.36.0",sinon:"^22.1.0","tree-sitter-bash":"^0.23.0","tree-sitter-powershell":"0.25.9","ts-dedent":"^2.3.0",tsx:"^4.23.1",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},y7o={"@adobe/helix-fetch":"github:devm33/helix-fetch#2a08fa939591a0e14f34f611adcc3ed767579e9a","@agentclientprotocol/sdk":"^0.22.1","@anthropic-ai/claude-agent-sdk":"0.3.159","@anthropic-ai/sdk":"^0.98.0","@github/copilot":"^1.0.70","@github/copilot-sdk":"^1.0.6-preview.1","@github/keytar":"7.10.6","@github/memoize":"1.1.5","@microsoft/1ds-core-js":"^4.3.10","@microsoft/1ds-post-js":"^4.3.10","@microsoft/applicationinsights-web-basic":"^3.3.11","@microsoft/mxc-sdk":"0.7.0","@modelcontextprotocol/sdk":"^1.29.0","@octokit/graphql":"^9.0.3","@octokit/rest":"^22.0.1","@parcel/watcher":"^2.6.0","@sinclair/typebox":"^0.34.52","@vscode/chat-lib":"^0.57.0","@vscode/codicons":"^0.0.45","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.4.0","@vscode/prompt-tsx":"^0.4.0-alpha.9","@vscode/webview-ui-toolkit":"^1.3.1","crypto-js":"^4.2.0",diff:"^9.0.0",dldr:"^0.0.10",events:"^3.3.0","git-url-parse":"^16.1.0",glob:"^11.1.0","jsonc-parser":"^3.3.1",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^14.3.0",minimatch:"^10.2.6",open:"^10.2.0",semver:"^7.8.5",shiki:"~1.15.0","source-map-support":"^0.5.21",toposort:"^2.0.2",undici:"^7.29.0",uuid:"^14.0.0","vscode-languageclient":"^9.0.0","vscode-languageserver":"^9.0.0","vscode-languageserver-protocol":"^3.17","vscode-languageserver-textdocument":"~1.0.11","vscode-uri":"^3.1.0","web-tree-sitter":"^0.23.0",which:"^7.0.0","windows-ca-certs":"^0.2.2",ws:"^8.21.1",yargs:"^18.1.0"},_7o={fsevents:"<0","@github/copilot-linuxmusl-arm64":"<0","@github/copilot-linuxmusl-x64":"<0",bindings:"npm:bundled-bindings@^1.5.0",jws:"^3.2.3",tar:"7.5.11","serialize-javascript":"^7.0.5",uuid:"^14.0.0","ip-address":"^10.1.1","fast-uri":"^3.1.4"},E7o={"//":"Rationale for each entry in `overrides`. Required by `npm run lint:overrides` (script/checkOverridesDocumented.ts). Each value should cover: why (CVE/GHSA or build-hack reason), which direct dep pulls in the vulnerable transitive, and the remove-when condition.",fsevents:"Build hack: macOS-only optional native dep; '<0' is an impossible semver that force-skips install on Linux/Windows pkg builds. Permanent \u2014 keep until @yao-pkg/pkg handles macOS-only optionalDependencies natively. See commit d635096c.","@github/copilot-linuxmusl-arm64":"Build hack: @github/copilot declares a Linux musl optional runtime package, but CLS does not support musl. '<0' prevents npm from installing the unsupported runtime. Drop only if CLS adds musl support.","@github/copilot-linuxmusl-x64":"Build hack: @github/copilot declares a Linux musl optional runtime package, but CLS does not support musl. '<0' prevents npm from installing the unsupported runtime. Drop only if CLS adds musl support.",bindings:"Build hack: alias to bundled-bindings fork that resolves .node native addon paths after pkg/esbuild bundling. Required by kerberos. Drop when upstream `bindings` adopts platform-specific path resolution. See commits c4461665 and b55ece83.",jws:"CVE GHSA-869p-cjfg-cm3x (Improperly Verifies HMAC Signature). Pulled in by jsonwebtoken-family deps. Drop when all transitive consumers pin jws >= 3.2.3. See commit 2b5dc766.",tar:"CVE GHSA-9ppj-qmqm-q256 + GHSA-qffp-2rhf-9h96 (Symlink/Hardlink Path Traversal via Drive-Relative Linkpath). Pulled in by node-gyp / native-build deps. Drop when transitive consumers bump tar >= 7.5.11. See commit e2dff0f3.","serialize-javascript":"CVE GHSA-5c6j-r48x-rmvq (RCE via RegExp.flags / Date.toISOString) + GHSA-qj8w-gfj5-8c6v (ReDoS). Pulled in by mocha 11.x (^6.0.2). Dev-only. Drop when mocha bumps to a release that carries serialize-javascript >= 7.0.3. See commit d49f75fd.",uuid:"CVE GHSA-w5hq-g745-h8pq (missing buffer bounds checks in v3/v5/v6). Pulled in by msal-node and @vscode/deviceid as uuid 8.x/9.x. Drop when both upgrade to uuid >= 14. Dependabot alert #128. See commit 6315f3f8.","ip-address":"CVE GHSA-v2v4-37r5-5v8g (XSS in Address6 HTML-emitting methods: group/link/spanAll and AddressError.parseMessage). Pulled in by @modelcontextprotocol/sdk -> express-rate-limit. Not exploitable here (we don't render HTML or call the affected methods), but the override clears the alert. Drop when express-rate-limit bumps to a release carrying ip-address >= 10.1.1. Dependabot alert #129. See PR #854.","fast-uri":"CVE-2026-6321 GHSA-q3j6-qgpj-74h6 (host confusion via percent-encoded authority delimiters) + CVE-2026-6322 GHSA-v39h-62p7-jpjc (path traversal via percent-encoded dot segments). Pulled in by @modelcontextprotocol/sdk -> ajv -> fast-uri. Drop when ajv bumps to a release carrying fast-uri >= 3.1.2. Dependabot alerts #132, #133."},v7o={name:c7o,displayName:l7o,description:u7o,version:d7o,build:f7o,buildType:p7o,engines:h7o,anthropicClaude:m7o,scripts:g7o,devDependencies:A7o,dependencies:y7o,overrides:_7o,overridesComments:E7o};var ze={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",FetchStrategy:"fetchStrategy",ToolConfirmAutoApprove:"agent.toolConfirmAutoApprove",AutoApproveUnmatchedTerminal:"agent.autoApproveUnmatchedTerminal",AutoApproveUnmatchedFileOp:"agent.autoApproveUnmatchedFileOp",TrustToolAnnotations:"agent.trustToolAnnotations",AutoApproveYoloMode:"agent.autoApproveYoloMode",EditorHandlesAllConfirmation:"agent.editorHandlesAllConfirmation",MaxToolCallingLoop:"agent.maxToolCallingLoop",AutoCompress:"agent.autoCompress",AnthropicThinkingBudgetToken:"agent.anthropicThinkingBudgetToken",EnableSkills:"agent.enableSkills",EnableHooks:"agent.enableHooks",EnableSandbox:"agent.sandbox.enabled",SandboxAddCurrentWorkingDirectory:"agent.sandbox.addCurrentWorkingDirectory",SandboxUserPolicy:"agent.sandbox.userPolicy",EnablePlugins:"agent.enablePlugins",EnableCustomAgents:"agent.enableCustomAgents",EnableOrgCustomAgents:"agent.enableOrgCustomAgents",UseAgentsMd:"agent.useAgentsMdFile",UseNestedAgentsMd:"agent.useNestedAgentsMdFiles",UseClaudeMd:"agent.useClaudeMdFile",UseNestedClaudeMd:"agent.useNestedClaudeMdFiles",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",EnableThinking:"agent.enableThinking",TranscriptDirectory:"agent.transcriptDirectory",AgentDebugLogsDirectory:"agent.agentDebugLogsDirectory",ClaudeCliPath:"agent.claude.cliPath",CodexCliPath:"agent.codex.cliPath",OtelEnabled:"agent.otel.enabled",OtelEndpoint:"agent.otel.otlpEndpoint",OtelCaptureContent:"agent.otel.captureContent",OtelExporterType:"agent.otel.exporterType",OtelProtocol:"agent.otel.protocol",OtelOutfile:"agent.otel.outfile",OtelServiceName:"agent.otel.serviceName",OtelResourceAttributes:"agent.otel.resourceAttributes",NESExtendedRange:"nextEditSuggestions.extendedRange",NESEagerness:"nextEditSuggestions.eagerness",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugOverrideLogLevels:"advanced.debug.overrideLogLevels",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",DebugUseElectronFetcher:"advanced.debug.useElectronFetcher",DebugUseEditorFetcher:"advanced.debug.useEditorFetcher",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",TrimCompletionsAggressively:"internal.trimCompletionsAggressively",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",ShowWorkspaceContextDebugger:"internal.showWorkspaceContextDebugger",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",NESXTab:"internal.useXTab",NESUseExplicitRejection:"internal.nesUseExplicitRejection",NESModelConfiguration:"internal.nesModelConfiguration",UseSplitContextPrompt:"internal.useSplitContextPrompt",UseCompletionsComparisonPanel:"internal.useCompletionsComparisonPanel",ComparisonPanelModelIds:"internal.comparisonPanelModelIds",ComparisonPanelRandomizedMode:"internal.comparisonPanelRandomizedMode",UseFetchFetcher:"internal.useFetchFetcher",UseChatLibCompletions:"internal.useChatLibCompletions",HookErrorOccurredStackTrace:"internal.hookErrorOccurredStackTrace",AppendPromptTokenCache:"internal.appendPromptTokenCache",PromptPersistBasePath:"internal.promptPersistBasePath",AnthropicMessagesEndpoint:"internal.anthropic.messagesEndpoint",UseHelixFetcher:"internal.useHelixFetcher",EnableMapCodeFallback:"internal.enableMapCodeFallback",SearchAgent:"internal.searchAgent",PerfEnabled:"internal.perf.enabled",AuthTokenEncryption:"internal.auth.tokenEncryption",EnableWorkspaceIndex:"workspaceIndex.enabled"};function Fgn(t){return["server","parsingandserver"].includes(t)}a(Fgn,"shouldDoServerTrimming");var t2=class{static{a(this,"BlockModeConfig")}},iue=class extends t2{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(tr).overrideBlockMode(n);if(o)return m9t(o,r);let s=e.get(tr).enableProgressiveReveal(n);return(kt(e,ze.AlwaysRequestMultiline)??s)||MO.isTrimmedByDefault(r)?m9t("moremultiline",r):r=="ruby"?"parsing":tT(r)?"parsingandserver":"server"}};function C7o(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(C7o,"blockModeRequiresTreeSitter");function m9t(t,e){return t==="moremultiline"&&g0.isSupported(e)?t:C7o(t)&&!tT(e)?"server":t}a(m9t,"toApplicableBlockMode");var Qo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},oue=class extends Qo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return b7o(r)}getOptionalConfig(r){return S7o(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},PK=class extends Qo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new Ji;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new Ji;this.onDidChangeHttpSettings=this.didChangeHttpSettingsEmitter.event;this.httpSettings=this.baseConfigProvider.getHttpSettings()}static{a(this,"InMemoryConfigProvider")}getOptionalOverride(r){return this.overrides.get(r)}getConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getConfig(r)}getOptionalConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getOptionalConfig(r)}setConfig(r,n){this.setCopilotSettings({[r]:n})}setCopilotSettings(r){for(let[n,o]of Object.entries(r))o!==void 0?this.overrides.set(n,o):this.overrides.delete(n);this.copilotEmitter.fire(this)}getExplicitlySetConfigs(){let r=new Map(this.baseConfigProvider.getExplicitlySetConfigs());for(let[n,o]of this.overrides)r.set(n,o);return r}getHttpSettings(){return this.httpSettings}setHttpSettings(r){let n=Mxe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[ze.ShowEditorCompletions,ze.EnableAutoCompletions,ze.DelayCompletions,ze.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function Ugn(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(Ugn,"getConfigKeyRecursively");function b7o(t){if(zWe.has(t))return zWe.get(t);throw new Error(`Missing config default value: ${_Dt}.${t}`)}a(b7o,"getConfigDefaultForKey");function S7o(t){return zWe.get(t)}a(S7o,"getOptionalConfigDefaultForKey");function Lxe(t){return t.get(Qo).getExplicitlySetConfigs()}a(Lxe,"getExplicitlySetConfigs");var T7o={[ze.DebugOverrideCppHeadersEnableSwitch]:!1,[ze.RelatedFilesVSCodeCSharp]:!1,[ze.RelatedFilesVSCodeTypeScript]:!1,[ze.RelatedFilesVSCode]:!1,[ze.IncludeNeighboringFiles]:!1,[ze.ExcludeRelatedFiles]:!1,[ze.ContextProviders]:[],[ze.DebugUseEditorFetcher]:null,[ze.DebugUseElectronFetcher]:null,[ze.DebugOverrideLogLevels]:{},[ze.DebugSnippyOverrideUrl]:"",[ze.AgentDebugLogsDirectory]:void 0,[ze.ClaudeCliPath]:void 0,[ze.CodexCliPath]:void 0,[ze.OtelEnabled]:!1,[ze.OtelEndpoint]:void 0,[ze.OtelCaptureContent]:!1,[ze.OtelExporterType]:"otlp-http",[ze.OtelProtocol]:"",[ze.OtelOutfile]:"",[ze.OtelServiceName]:"",[ze.OtelResourceAttributes]:{},[ze.FetchStrategy]:"auto",[ze.ToolConfirmAutoApprove]:!1,[ze.AutoApproveUnmatchedTerminal]:void 0,[ze.AutoApproveUnmatchedFileOp]:void 0,[ze.TrustToolAnnotations]:!1,[ze.AutoApproveYoloMode]:!1,[ze.EditorHandlesAllConfirmation]:!1,[ze.MaxToolCallingLoop]:25,[ze.AutoCompress]:!1,[ze.AnthropicThinkingBudgetToken]:1024,[ze.EnableSkills]:!1,[ze.EnableHooks]:!1,[ze.EnableSandbox]:!1,[ze.SandboxAddCurrentWorkingDirectory]:void 0,[ze.SandboxUserPolicy]:void 0,[ze.EnablePlugins]:!1,[ze.EnableCustomAgents]:!0,[ze.EnableOrgCustomAgents]:!0,[ze.UseAgentsMd]:!1,[ze.UseNestedAgentsMd]:!1,[ze.UseClaudeMd]:!1,[ze.UseNestedClaudeMd]:!1,[ze.UseSubsetMatching]:null,[ze.ContextProviderTimeBudget]:void 0,[ze.DebugOverrideCapiUrl]:"",[ze.DebugTestOverrideCapiUrl]:"",[ze.DebugOverrideProxyUrl]:"",[ze.DebugTestOverrideProxyUrl]:"",[ze.DebugOverrideEngine]:"",[ze.AlwaysRequestMultiline]:void 0,[ze.ModelAlwaysTerminatesSingleline]:void 0,[ze.TrimCompletionsAggressively]:void 0,[ze.CompletionsDebounce]:void 0,[ze.NESXTab]:void 0,[ze.UseWorkspaceContextCoordinator]:void 0,[ze.ShowWorkspaceContextDebugger]:!1,[ze.CompletionsDelay]:void 0,[ze.UseSplitContextPrompt]:void 0,[ze.UseCompletionsComparisonPanel]:void 0,[ze.ComparisonPanelModelIds]:void 0,[ze.ComparisonPanelRandomizedMode]:void 0,[ze.UseFetchFetcher]:void 0,[ze.UseChatLibCompletions]:void 0,[ze.TranscriptDirectory]:void 0,[ze.EnableThinking]:!0,[ze.ShowEditorCompletions]:void 0,[ze.EnableAutoCompletions]:void 0,[ze.DelayCompletions]:void 0,[ze.FilterCompletions]:void 0,[ze.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[ze.UserSelectedCompletionModel]:"",[ze.DebugFilterLogCategories]:[],[ze.DebugOverrideEngineLegacy]:"",[ze.DebugTestOverrideProxyUrlLegacy]:"",[ze.DebugOverrideProxyUrlLegacy]:"",[ze.DebugTestOverrideCapiUrlLegacy]:"",[ze.DebugOverrideCapiUrlLegacy]:"",[ze.HookErrorOccurredStackTrace]:!1,[ze.NESUseExplicitRejection]:!1,[ze.NESModelConfiguration]:void 0,[ze.AppendPromptTokenCache]:"",[ze.PromptPersistBasePath]:void 0,[ze.AnthropicMessagesEndpoint]:"",[ze.UseHelixFetcher]:"",[ze.EnableMapCodeFallback]:"enabled",[ze.SearchAgent]:"",[ze.PerfEnabled]:"",[ze.NESExtendedRange]:!1,[ze.NESEagerness]:"auto",[ze.AuthTokenEncryption]:"",[ze.EnableWorkspaceIndex]:!1},zWe=new Map(Object.entries(T7o));for(let t of Object.values(ze))if(!zWe.has(t))throw new Error(`Missing config default value ${_Dt}.${t}`);function kt(t,e){return t.get(Qo).getConfig(e)}a(kt,"getConfig");function XE(t){let e=kt(t,ze.EnableWorkspaceIndex);return e===!0||e==="true"}a(XE,"isSemanticSearchEnabled");function Rtn(t){return t.get(Qo).dumpForTelemetry()}a(Rtn,"dumpForTelemetry");var As=class{constructor(){this.packageJson=Oxe}static{a(this,"BuildInfo")}isProduction(){return this.getBuildType()!=="dev"}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getDisplayVersion(){return this.getBuildType()==="dev"?`${this.getVersion()}-dev`:this.getVersion()}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}};function SOt(t){return t.get(As).isProduction()}a(SOt,"isProduction");function Msn(t){return t.get(As).getBuildType()==="dev"}a(Msn,"isDevBuild");function _7(t){return t.get(As).getBuildType()}a(_7,"getBuildType");function ktn(t){return t.get(As).getBuild()}a(ktn,"getBuild");function A1(t){return t.get(As).getVersion()}a(A1,"getVersion");var za=class{constructor(e,r,n,o="none",s="desktop"){this.sessionId=e;this.machineId=r;this.devDeviceId=n;this.remoteName=o;this.uiKind=s}static{a(this,"EditorSession")}};function o1({name:t,version:e}){return`${t}/${e}`}a(o1,"formatNameAndVersion");var Ir=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return I$r({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}isEditorPluginInfoKnown(){return!0}};function AWe(t){let e=t.getCopilotIntegrationId();if(e)return e;switch(t.getEditorPluginInfo().name){case"copilot-intellij":return"jetbrains-chat";case"copilot":case"copilot-vs":return;default:return"jetbrains-chat"}}a(AWe,"getIntegrationId");function s_(t){let e=t.get(Ir);return{"Editor-Version":o1(e.getEditorInfo()),"Editor-Plugin-Version":o1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":A1(t)}}a(s_,"editorVersionHeaders");var Qgn="Iv1.b507a08c87ecfe98",I7o="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",$ce="Ov23liV9UpD7Rnfnskm3",x7o="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",w7o={[Qgn]:I7o,[$ce]:x7o},ih=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??Qgn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=w7o[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};function qgn(t){return kt(t,ze.AuthTokenEncryption)==="false"}a(qgn,"isAuthTokenEncryptionDisabled");p();var zgn=fe(require("node:crypto"));var rq=new pe("KeytarMasterKey"),Ggn="copilot-language-server",$gn="oauth-token-key",Vgn=5e3,Ygn=32,g9t;function P7o(t){return g9t??=D7o(t).finally(()=>{g9t=void 0}),g9t}a(P7o,"resolveMasterKey");async function D7o(t){rq.info(t,"keytar-master-key: resolving master key");let e;try{e=await y9t.loadKeytar(),rq.info(t,"keytar-master-key: module loaded")}catch(n){return rq.warn(t,"keytar-master-key: @github/keytar failed to load",n),{diagnostics:A9t("loadModule",n)}}let r;try{r=await M7o(t,e)}catch(n){return n instanceof YWe?(rq.error(t,"keytar-master-key: existing entry is corrupt; refusing to overwrite",n),{diagnostics:A9t("corruptExistingEntry",n)}):(rq.warn(t,"keytar-master-key: master-key resolution failed",n),{diagnostics:A9t("getOrCreateMasterKey",n)})}return rq.info(t,`keytar-master-key: resolved (source=${r.source})`),{masterKey:r.key,diagnostics:{available:!0,masterKeySource:r.source}}}a(D7o,"doResolveMasterKey");function N7o(){return Promise.resolve().then(()=>fe(Hgn()))}a(N7o,"loadKeytar");var y9t={resolveMasterKey:P7o,loadKeytar:N7o};async function M7o(t,e){let r=await Wgn(e.getPassword(Ggn,$gn),Vgn,"getMasterKey");if(rq.info(t,`keytar-master-key: getPassword returned (found=${r!=null})`),r){let o=O7o(r);if(o)return{key:o,source:"useExisting"};throw new YWe}let n=zgn.randomBytes(Ygn);return await Wgn(e.setPassword(Ggn,$gn,n.toString("base64")),Vgn,"setMasterKey"),rq.info(t,"keytar-master-key: setPassword (new key) completed"),{key:n,source:"createNew"}}a(M7o,"getOrCreateMasterKey");function Wgn(t,e,r){return new Promise((n,o)=>{let s=setTimeout(()=>o(new Error(`${r}: timeout after ${e}ms`)),e);s.unref?.(),t.then(c=>{clearTimeout(s),n(c)},c=>{clearTimeout(s),o(c instanceof Error?c:new Error(`${r}: ${String(c)}`))})})}a(Wgn,"withTimeout");var YWe=class extends Error{static{a(this,"CorruptMasterKeyError")}constructor(){super("keytar master-key entry present but undecodable"),this.name="CorruptMasterKeyError"}};function A9t(t,e){return{available:!1,errorPhase:t,error:e}}a(A9t,"unavailable");function O7o(t){let e=Buffer.from(t,"base64");return e.length===Ygn?e:void 0}a(O7o,"decodeMasterKey");p();var sue=fe(require("node:crypto"));var L7o=0,v9t=1,DK=class extends Error{constructor(r,n,o){super(r,o?.cause!==void 0?{cause:o.cause}:void 0);this.kind=n;this.name="SecretUnwrapError"}static{a(this,"SecretUnwrapError")}},JWe=class{static{a(this,"SecretCodec")}},E9t=class extends JWe{constructor(){super(...arguments);this.schemaVersion=L7o}static{a(this,"PlaintextCodec")}encode(r){return Buffer.from(r,"utf8")}decode(r){return Buffer.from(r).toString("utf8")}},KWe=12,_9t=16,Kgn=32,ZWe=class extends JWe{constructor(r){super();this.key=r;this.schemaVersion=v9t;if(r.length!==Kgn)throw new Error(`AesGcmCodec requires a ${Kgn}-byte key, got ${r.length}`)}static{a(this,"AesGcmCodec")}encode(r){let n=sue.randomBytes(KWe),o=sue.createCipheriv("aes-256-gcm",this.key,n),s=Buffer.concat([o.update(Buffer.from(r,"utf8")),o.final()]);return Buffer.concat([n,s,o.getAuthTag()])}decode(r){let n=Buffer.from(r);if(n.length0}};var WWe=class extends MO{constructor(r,n,o,s=3,c=7){super(r,n,o);this.lineLimit=s;this.lookAhead=c;let l=[...this.completion.matchAll(/\n/g)],u=this.lineLimit+this.lookAhead;l.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=l[this.lineLimit-1].index),l.length>=u&&u>0&&(this.lookAheadOffset=l[u-1].index)}static{a(this,"TerseBlockTrimmer")}async getCompletionTrimOffset(){return await this.withParsedStatementTree(r=>{let n=r.statementAt(this.stmtStartPos()),o=this.getContainingBlockOffset(n);return o=this.trimAtFirstBlankLine(o),n&&(o=this.trimAtStatementChange(n,o)),this.limitOffset&&this.lookAheadOffset&&(o===void 0||o>this.lookAheadOffset)?this.limitOffset:o})}stmtStartPos(){let r=this.completion.match(/\S/);return r&&r.index!==void 0?this.prefix.length+r.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(r){let n=[...this.trimmedCompletion(r).matchAll(/\r?\n\s*\r?\n/g)];for(;n.length>0&&(r===void 0||r>n[0].index);){let o=n.shift();if(this.completion.substring(0,o.index).trim()!=="")return o.index}return r}trimAtStatementChange(r,n){let o=this.prefix.length,s=this.prefix.length+(n??this.completion.length);if(r.node.endIndex>o&&this.isCompoundStatement(r))return r.nextSibling&&r.node.endIndexo&&c.node.endIndexA7o,build:()=>h7o,buildType:()=>m7o,default:()=>b7o,dependencies:()=>E7o,description:()=>f7o,devDependencies:()=>_7o,displayName:()=>d7o,engines:()=>g7o,name:()=>u7o,overrides:()=>v7o,overridesComments:()=>C7o,scripts:()=>y7o,version:()=>p7o});var u7o="copilot",d7o="GitHub Copilot",f7o="Your AI pair programmer",p7o="1.527.3",h7o="88",m7o="prod",g7o={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},A7o={cliPackageVersion:"2.1.159"},y7o={build:"tsx esbuild.ts",clean:"./script/build/clean.sh",compress:"tsx ./script/compressTokenizer.ts",generate_languages:"tsx script/generateLanguages.ts && prettier --write lib/src/language/generatedLanguages.ts",get_token:"tsx script/deviceFlow.ts --save-as-test-token",lint:'run-p --aggregate-output "lint:*"',"lint:deps":"depcruise -c .dependency-cruiser.js .","lint:eslint":"eslint -f visualstudio --quiet --cache .","lint:overrides":"tsx script/checkOverridesDocumented.ts","lint:prettier":"prettier --check . 2>&1","lint:types":"tsc --noEmit",inspect_auth_db:"tsx script/inspectAuthDb.ts",prebuild:"npm install",pretest:"npm run build","pretest:headless":"npm run build","pretest:lsp-client":"npm run build","pretest:lib-e2e":"npm run build",prewatch:"npm run build","prewatch:esbuild":"npm run build",start:"npm run watch",test:'npm-run-all "test:headless --ignore-scripts" lint',"test:headless":'npm-run-all test:lib test:agent "test:lib-e2e --ignore-scripts" test:prompt "test:lsp-client --ignore-scripts" lint',"test:agent":'mocha "agent/src/**/*.test.{ts,tsx}"',"test:lib":'mocha "lib/src/**/*.test.{ts,tsx}" "script/**/*.test.{ts,tsx}" --exclude "lib/src/**/*.int.test.ts"',"test:lib-int":'mocha "lib/src/**/*.int.test.ts"',"test:lib-e2e":'mocha "lib/e2e/src/**/*.test.{ts,tsx}" --exclude "lib/e2e/src/prompt/**/*.test.ts"',"test:lib-e2e-no-ci":'mocha "lib/e2e/no-ci/**/*.test.{ts,tsx}"',"test:lib-prompt-e2e":'mocha "lib/e2e/src/prompt/prompt.test.ts"',"test:lib-prompt-e2e-perf":"INCLUDE_PERFORMANCE=true npm run test:lib-prompt-e2e","test:lsp-client":'mocha "lsp-client/test/*.test.{ts,tsx}"',"test:pkg-runtime":"tsx script/smokeCopilotRuntimePkg.ts","test:prompt":'mocha "prompt/test/**/*.test.{ts,tsx}"',"test:prepare-msbench":"tsx script/setupMsbench.ts","test:run-msbench":"tsx lsp-client/test/msbench/agent/index.ts",watch:'run-p "watch:esbuild --ignore-scripts" "watch:types -- --preserveWatchOutput"',"watch:esbuild":"tsx esbuild.ts --watch","watch:types":"tsc --noEmit --watch"},_7o={"@azure/identity":"^4.13.1","@azure/keyvault-secrets":"^4.11.2","@github/prettier-config":"0.0.6","@limegrass/eslint-plugin-import-alias":"^1.6.1","@types/crypto-js":"^4.2.2","@types/diff":"^8.0.0","@types/git-url-parse":"^16.0.2","@types/js-yaml":"^4.0.6","@types/kerberos":"^1.1.2","@types/markdown-it":"^14.1.2","@types/mocha":"^10.0.10","@types/node":"~22.13.0","@types/semver":"^7.7.1","@types/sinon":"^22.0.0","@types/toposort":"^2.0.7","@types/vscode":"1.125.0","@types/which":"^3.0.0","@types/yargs":"^17.0.35","@vscode/tree-sitter-wasm":"0.0.5-php.2","@yao-pkg/pkg":"^6.21.0",boxen:"^8.0.1",chalk:"^5.6.2","dependency-cruiser":"^18.1.0",esbuild:"^0.28.1","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.5","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.8.0","js-yaml":"^4.2.0",mocha:"^11.7.6","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^6.49.0",prettier:"^3.5.3","prettier-plugin-organize-imports":"^4.2.0","simple-git":"^3.36.0",sinon:"^22.1.0","tree-sitter-bash":"^0.23.0","tree-sitter-powershell":"0.25.9","ts-dedent":"^2.3.0",tsx:"^4.23.1",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},E7o={"@adobe/helix-fetch":"github:devm33/helix-fetch#2a08fa939591a0e14f34f611adcc3ed767579e9a","@agentclientprotocol/sdk":"^0.22.1","@anthropic-ai/claude-agent-sdk":"0.3.159","@anthropic-ai/sdk":"^0.98.0","@github/copilot":"^1.0.70","@github/copilot-sdk":"^1.0.6-preview.1","@github/keytar":"7.10.6","@github/memoize":"1.1.5","@microsoft/1ds-core-js":"^4.3.10","@microsoft/1ds-post-js":"^4.3.10","@microsoft/applicationinsights-web-basic":"^3.3.11","@microsoft/mxc-sdk":"0.7.0","@modelcontextprotocol/sdk":"^1.29.0","@octokit/graphql":"^9.0.3","@octokit/rest":"^22.0.1","@parcel/watcher":"^2.6.0","@sinclair/typebox":"^0.34.52","@vscode/chat-lib":"^0.57.0","@vscode/codicons":"^0.0.45","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.4.0","@vscode/prompt-tsx":"^0.4.0-alpha.9","@vscode/webview-ui-toolkit":"^1.3.1","crypto-js":"^4.2.0",diff:"^9.0.0",dldr:"^0.0.10",events:"^3.3.0","git-url-parse":"^16.1.0",glob:"^11.1.0","jsonc-parser":"^3.3.1",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^14.3.0",minimatch:"^10.2.6",open:"^10.2.0",semver:"^7.8.5",shiki:"~1.15.0","source-map-support":"^0.5.21",toposort:"^2.0.2",undici:"^7.29.0",uuid:"^14.0.0","vscode-languageclient":"^9.0.0","vscode-languageserver":"^9.0.0","vscode-languageserver-protocol":"^3.17","vscode-languageserver-textdocument":"~1.0.11","vscode-uri":"^3.1.0","web-tree-sitter":"^0.23.0",which:"^7.0.0","windows-ca-certs":"^0.2.2",ws:"^8.21.1",yargs:"^18.1.0"},v7o={fsevents:"<0","@github/copilot-linuxmusl-arm64":"<0","@github/copilot-linuxmusl-x64":"<0",bindings:"npm:bundled-bindings@^1.5.0",jws:"^3.2.3",tar:"7.5.11","serialize-javascript":"^7.0.5",uuid:"^14.0.0","ip-address":"^10.1.1","fast-uri":"^3.1.4"},C7o={"//":"Rationale for each entry in `overrides`. Required by `npm run lint:overrides` (script/checkOverridesDocumented.ts). Each value should cover: why (CVE/GHSA or build-hack reason), which direct dep pulls in the vulnerable transitive, and the remove-when condition.",fsevents:"Build hack: macOS-only optional native dep; '<0' is an impossible semver that force-skips install on Linux/Windows pkg builds. Permanent \u2014 keep until @yao-pkg/pkg handles macOS-only optionalDependencies natively. See commit d635096c.","@github/copilot-linuxmusl-arm64":"Build hack: @github/copilot declares a Linux musl optional runtime package, but CLS does not support musl. '<0' prevents npm from installing the unsupported runtime. Drop only if CLS adds musl support.","@github/copilot-linuxmusl-x64":"Build hack: @github/copilot declares a Linux musl optional runtime package, but CLS does not support musl. '<0' prevents npm from installing the unsupported runtime. Drop only if CLS adds musl support.",bindings:"Build hack: alias to bundled-bindings fork that resolves .node native addon paths after pkg/esbuild bundling. Required by kerberos. Drop when upstream `bindings` adopts platform-specific path resolution. See commits c4461665 and b55ece83.",jws:"CVE GHSA-869p-cjfg-cm3x (Improperly Verifies HMAC Signature). Pulled in by jsonwebtoken-family deps. Drop when all transitive consumers pin jws >= 3.2.3. See commit 2b5dc766.",tar:"CVE GHSA-9ppj-qmqm-q256 + GHSA-qffp-2rhf-9h96 (Symlink/Hardlink Path Traversal via Drive-Relative Linkpath). Pulled in by node-gyp / native-build deps. Drop when transitive consumers bump tar >= 7.5.11. See commit e2dff0f3.","serialize-javascript":"CVE GHSA-5c6j-r48x-rmvq (RCE via RegExp.flags / Date.toISOString) + GHSA-qj8w-gfj5-8c6v (ReDoS). Pulled in by mocha 11.x (^6.0.2). Dev-only. Drop when mocha bumps to a release that carries serialize-javascript >= 7.0.3. See commit d49f75fd.",uuid:"CVE GHSA-w5hq-g745-h8pq (missing buffer bounds checks in v3/v5/v6). Pulled in by msal-node and @vscode/deviceid as uuid 8.x/9.x. Drop when both upgrade to uuid >= 14. Dependabot alert #128. See commit 6315f3f8.","ip-address":"CVE GHSA-v2v4-37r5-5v8g (XSS in Address6 HTML-emitting methods: group/link/spanAll and AddressError.parseMessage). Pulled in by @modelcontextprotocol/sdk -> express-rate-limit. Not exploitable here (we don't render HTML or call the affected methods), but the override clears the alert. Drop when express-rate-limit bumps to a release carrying ip-address >= 10.1.1. Dependabot alert #129. See PR #854.","fast-uri":"CVE-2026-6321 GHSA-q3j6-qgpj-74h6 (host confusion via percent-encoded authority delimiters) + CVE-2026-6322 GHSA-v39h-62p7-jpjc (path traversal via percent-encoded dot segments). Pulled in by @modelcontextprotocol/sdk -> ajv -> fast-uri. Drop when ajv bumps to a release carrying fast-uri >= 3.1.2. Dependabot alerts #132, #133."},b7o={name:u7o,displayName:d7o,description:f7o,version:p7o,build:h7o,buildType:m7o,engines:g7o,anthropicClaude:A7o,scripts:y7o,devDependencies:_7o,dependencies:E7o,overrides:v7o,overridesComments:C7o};var ze={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",FetchStrategy:"fetchStrategy",ToolConfirmAutoApprove:"agent.toolConfirmAutoApprove",AutoApproveUnmatchedTerminal:"agent.autoApproveUnmatchedTerminal",AutoApproveUnmatchedFileOp:"agent.autoApproveUnmatchedFileOp",TrustToolAnnotations:"agent.trustToolAnnotations",AutoApproveYoloMode:"agent.autoApproveYoloMode",EditorHandlesAllConfirmation:"agent.editorHandlesAllConfirmation",MaxToolCallingLoop:"agent.maxToolCallingLoop",AutoCompress:"agent.autoCompress",AnthropicThinkingBudgetToken:"agent.anthropicThinkingBudgetToken",EnableSkills:"agent.enableSkills",EnableHooks:"agent.enableHooks",EnableSandbox:"agent.sandbox.enabled",SandboxAddCurrentWorkingDirectory:"agent.sandbox.addCurrentWorkingDirectory",SandboxUserPolicy:"agent.sandbox.userPolicy",EnablePlugins:"agent.enablePlugins",EnableCustomAgents:"agent.enableCustomAgents",EnableOrgCustomAgents:"agent.enableOrgCustomAgents",UseAgentsMd:"agent.useAgentsMdFile",UseNestedAgentsMd:"agent.useNestedAgentsMdFiles",UseClaudeMd:"agent.useClaudeMdFile",UseNestedClaudeMd:"agent.useNestedClaudeMdFiles",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",EnableThinking:"agent.enableThinking",TranscriptDirectory:"agent.transcriptDirectory",AgentDebugLogsDirectory:"agent.agentDebugLogsDirectory",ClaudeCliPath:"agent.claude.cliPath",CodexCliPath:"agent.codex.cliPath",OtelEnabled:"agent.otel.enabled",OtelEndpoint:"agent.otel.otlpEndpoint",OtelCaptureContent:"agent.otel.captureContent",OtelExporterType:"agent.otel.exporterType",OtelProtocol:"agent.otel.protocol",OtelOutfile:"agent.otel.outfile",OtelServiceName:"agent.otel.serviceName",OtelResourceAttributes:"agent.otel.resourceAttributes",NESExtendedRange:"nextEditSuggestions.extendedRange",NESEagerness:"nextEditSuggestions.eagerness",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugOverrideLogLevels:"advanced.debug.overrideLogLevels",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",DebugUseElectronFetcher:"advanced.debug.useElectronFetcher",DebugUseEditorFetcher:"advanced.debug.useEditorFetcher",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",TrimCompletionsAggressively:"internal.trimCompletionsAggressively",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",ShowWorkspaceContextDebugger:"internal.showWorkspaceContextDebugger",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",NESXTab:"internal.useXTab",NESUseExplicitRejection:"internal.nesUseExplicitRejection",NESModelConfiguration:"internal.nesModelConfiguration",UseSplitContextPrompt:"internal.useSplitContextPrompt",UseCompletionsComparisonPanel:"internal.useCompletionsComparisonPanel",ComparisonPanelModelIds:"internal.comparisonPanelModelIds",ComparisonPanelRandomizedMode:"internal.comparisonPanelRandomizedMode",UseFetchFetcher:"internal.useFetchFetcher",UseChatLibCompletions:"internal.useChatLibCompletions",HookErrorOccurredStackTrace:"internal.hookErrorOccurredStackTrace",AppendPromptTokenCache:"internal.appendPromptTokenCache",PromptPersistBasePath:"internal.promptPersistBasePath",AnthropicMessagesEndpoint:"internal.anthropic.messagesEndpoint",UseHelixFetcher:"internal.useHelixFetcher",EnableMapCodeFallback:"internal.enableMapCodeFallback",SearchAgent:"internal.searchAgent",PerfEnabled:"internal.perf.enabled",AuthTokenEncryption:"internal.auth.tokenEncryption",EnableWorkspaceIndex:"workspaceIndex.enabled"};function Ugn(t){return["server","parsingandserver"].includes(t)}a(Ugn,"shouldDoServerTrimming");var t2=class{static{a(this,"BlockModeConfig")}},oue=class extends t2{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(tr).overrideBlockMode(n);if(o)return g9t(o,r);let s=e.get(tr).enableProgressiveReveal(n);return(kt(e,ze.AlwaysRequestMultiline)??s)||MO.isTrimmedByDefault(r)?g9t("moremultiline",r):r=="ruby"?"parsing":tT(r)?"parsingandserver":"server"}};function S7o(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(S7o,"blockModeRequiresTreeSitter");function g9t(t,e){return t==="moremultiline"&&A0.isSupported(e)?t:S7o(t)&&!tT(e)?"server":t}a(g9t,"toApplicableBlockMode");var Qo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},sue=class extends Qo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return T7o(r)}getOptionalConfig(r){return I7o(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},DK=class extends Qo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new Ji;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new Ji;this.onDidChangeHttpSettings=this.didChangeHttpSettingsEmitter.event;this.httpSettings=this.baseConfigProvider.getHttpSettings()}static{a(this,"InMemoryConfigProvider")}getOptionalOverride(r){return this.overrides.get(r)}getConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getConfig(r)}getOptionalConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getOptionalConfig(r)}setConfig(r,n){this.setCopilotSettings({[r]:n})}setCopilotSettings(r){for(let[n,o]of Object.entries(r))o!==void 0?this.overrides.set(n,o):this.overrides.delete(n);this.copilotEmitter.fire(this)}getExplicitlySetConfigs(){let r=new Map(this.baseConfigProvider.getExplicitlySetConfigs());for(let[n,o]of this.overrides)r.set(n,o);return r}getHttpSettings(){return this.httpSettings}setHttpSettings(r){let n=Mxe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[ze.ShowEditorCompletions,ze.EnableAutoCompletions,ze.DelayCompletions,ze.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function Qgn(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(Qgn,"getConfigKeyRecursively");function T7o(t){if(zWe.has(t))return zWe.get(t);throw new Error(`Missing config default value: ${EDt}.${t}`)}a(T7o,"getConfigDefaultForKey");function I7o(t){return zWe.get(t)}a(I7o,"getOptionalConfigDefaultForKey");function Lxe(t){return t.get(Qo).getExplicitlySetConfigs()}a(Lxe,"getExplicitlySetConfigs");var x7o={[ze.DebugOverrideCppHeadersEnableSwitch]:!1,[ze.RelatedFilesVSCodeCSharp]:!1,[ze.RelatedFilesVSCodeTypeScript]:!1,[ze.RelatedFilesVSCode]:!1,[ze.IncludeNeighboringFiles]:!1,[ze.ExcludeRelatedFiles]:!1,[ze.ContextProviders]:[],[ze.DebugUseEditorFetcher]:null,[ze.DebugUseElectronFetcher]:null,[ze.DebugOverrideLogLevels]:{},[ze.DebugSnippyOverrideUrl]:"",[ze.AgentDebugLogsDirectory]:void 0,[ze.ClaudeCliPath]:void 0,[ze.CodexCliPath]:void 0,[ze.OtelEnabled]:!1,[ze.OtelEndpoint]:void 0,[ze.OtelCaptureContent]:!1,[ze.OtelExporterType]:"otlp-http",[ze.OtelProtocol]:"",[ze.OtelOutfile]:"",[ze.OtelServiceName]:"",[ze.OtelResourceAttributes]:{},[ze.FetchStrategy]:"auto",[ze.ToolConfirmAutoApprove]:!1,[ze.AutoApproveUnmatchedTerminal]:void 0,[ze.AutoApproveUnmatchedFileOp]:void 0,[ze.TrustToolAnnotations]:!1,[ze.AutoApproveYoloMode]:!1,[ze.EditorHandlesAllConfirmation]:!1,[ze.MaxToolCallingLoop]:25,[ze.AutoCompress]:!1,[ze.AnthropicThinkingBudgetToken]:1024,[ze.EnableSkills]:!1,[ze.EnableHooks]:!1,[ze.EnableSandbox]:!1,[ze.SandboxAddCurrentWorkingDirectory]:void 0,[ze.SandboxUserPolicy]:void 0,[ze.EnablePlugins]:!1,[ze.EnableCustomAgents]:!0,[ze.EnableOrgCustomAgents]:!0,[ze.UseAgentsMd]:!1,[ze.UseNestedAgentsMd]:!1,[ze.UseClaudeMd]:!1,[ze.UseNestedClaudeMd]:!1,[ze.UseSubsetMatching]:null,[ze.ContextProviderTimeBudget]:void 0,[ze.DebugOverrideCapiUrl]:"",[ze.DebugTestOverrideCapiUrl]:"",[ze.DebugOverrideProxyUrl]:"",[ze.DebugTestOverrideProxyUrl]:"",[ze.DebugOverrideEngine]:"",[ze.AlwaysRequestMultiline]:void 0,[ze.ModelAlwaysTerminatesSingleline]:void 0,[ze.TrimCompletionsAggressively]:void 0,[ze.CompletionsDebounce]:void 0,[ze.NESXTab]:void 0,[ze.UseWorkspaceContextCoordinator]:void 0,[ze.ShowWorkspaceContextDebugger]:!1,[ze.CompletionsDelay]:void 0,[ze.UseSplitContextPrompt]:void 0,[ze.UseCompletionsComparisonPanel]:void 0,[ze.ComparisonPanelModelIds]:void 0,[ze.ComparisonPanelRandomizedMode]:void 0,[ze.UseFetchFetcher]:void 0,[ze.UseChatLibCompletions]:void 0,[ze.TranscriptDirectory]:void 0,[ze.EnableThinking]:!0,[ze.ShowEditorCompletions]:void 0,[ze.EnableAutoCompletions]:void 0,[ze.DelayCompletions]:void 0,[ze.FilterCompletions]:void 0,[ze.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[ze.UserSelectedCompletionModel]:"",[ze.DebugFilterLogCategories]:[],[ze.DebugOverrideEngineLegacy]:"",[ze.DebugTestOverrideProxyUrlLegacy]:"",[ze.DebugOverrideProxyUrlLegacy]:"",[ze.DebugTestOverrideCapiUrlLegacy]:"",[ze.DebugOverrideCapiUrlLegacy]:"",[ze.HookErrorOccurredStackTrace]:!1,[ze.NESUseExplicitRejection]:!1,[ze.NESModelConfiguration]:void 0,[ze.AppendPromptTokenCache]:"",[ze.PromptPersistBasePath]:void 0,[ze.AnthropicMessagesEndpoint]:"",[ze.UseHelixFetcher]:"",[ze.EnableMapCodeFallback]:"enabled",[ze.SearchAgent]:"",[ze.PerfEnabled]:"",[ze.NESExtendedRange]:!1,[ze.NESEagerness]:"auto",[ze.AuthTokenEncryption]:"",[ze.EnableWorkspaceIndex]:!1},zWe=new Map(Object.entries(x7o));for(let t of Object.values(ze))if(!zWe.has(t))throw new Error(`Missing config default value ${EDt}.${t}`);function kt(t,e){return t.get(Qo).getConfig(e)}a(kt,"getConfig");function XE(t){let e=kt(t,ze.EnableWorkspaceIndex);return e===!0||e==="true"}a(XE,"isSemanticSearchEnabled");function ktn(t){return t.get(Qo).dumpForTelemetry()}a(ktn,"dumpForTelemetry");var As=class{constructor(){this.packageJson=Oxe}static{a(this,"BuildInfo")}isProduction(){return this.getBuildType()!=="dev"}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getDisplayVersion(){return this.getBuildType()==="dev"?`${this.getVersion()}-dev`:this.getVersion()}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}};function TOt(t){return t.get(As).isProduction()}a(TOt,"isProduction");function Osn(t){return t.get(As).getBuildType()==="dev"}a(Osn,"isDevBuild");function _7(t){return t.get(As).getBuildType()}a(_7,"getBuildType");function Ptn(t){return t.get(As).getBuild()}a(Ptn,"getBuild");function A1(t){return t.get(As).getVersion()}a(A1,"getVersion");var za=class{constructor(e,r,n,o="none",s="desktop"){this.sessionId=e;this.machineId=r;this.devDeviceId=n;this.remoteName=o;this.uiKind=s}static{a(this,"EditorSession")}};function o1({name:t,version:e}){return`${t}/${e}`}a(o1,"formatNameAndVersion");var Ir=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return x$r({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}isEditorPluginInfoKnown(){return!0}};function AWe(t){let e=t.getCopilotIntegrationId();if(e)return e;switch(t.getEditorPluginInfo().name){case"copilot-intellij":return"jetbrains-chat";case"copilot":case"copilot-vs":return;default:return"jetbrains-chat"}}a(AWe,"getIntegrationId");function s_(t){let e=t.get(Ir);return{"Editor-Version":o1(e.getEditorInfo()),"Editor-Plugin-Version":o1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":A1(t)}}a(s_,"editorVersionHeaders");var qgn="Iv1.b507a08c87ecfe98",w7o="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Vce="Ov23liV9UpD7Rnfnskm3",R7o="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",k7o={[qgn]:w7o,[Vce]:R7o},ih=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??qgn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=k7o[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};function jgn(t){return kt(t,ze.AuthTokenEncryption)==="false"}a(jgn,"isAuthTokenEncryptionDisabled");p();var Ygn=fe(require("node:crypto"));var rq=new pe("KeytarMasterKey"),$gn="copilot-language-server",Vgn="oauth-token-key",Wgn=5e3,Kgn=32,A9t;function N7o(t){return A9t??=M7o(t).finally(()=>{A9t=void 0}),A9t}a(N7o,"resolveMasterKey");async function M7o(t){rq.info(t,"keytar-master-key: resolving master key");let e;try{e=await _9t.loadKeytar(),rq.info(t,"keytar-master-key: module loaded")}catch(n){return rq.warn(t,"keytar-master-key: @github/keytar failed to load",n),{diagnostics:y9t("loadModule",n)}}let r;try{r=await L7o(t,e)}catch(n){return n instanceof YWe?(rq.error(t,"keytar-master-key: existing entry is corrupt; refusing to overwrite",n),{diagnostics:y9t("corruptExistingEntry",n)}):(rq.warn(t,"keytar-master-key: master-key resolution failed",n),{diagnostics:y9t("getOrCreateMasterKey",n)})}return rq.info(t,`keytar-master-key: resolved (source=${r.source})`),{masterKey:r.key,diagnostics:{available:!0,masterKeySource:r.source}}}a(M7o,"doResolveMasterKey");function O7o(){return Promise.resolve().then(()=>fe(Ggn()))}a(O7o,"loadKeytar");var _9t={resolveMasterKey:N7o,loadKeytar:O7o};async function L7o(t,e){let r=await zgn(e.getPassword($gn,Vgn),Wgn,"getMasterKey");if(rq.info(t,`keytar-master-key: getPassword returned (found=${r!=null})`),r){let o=B7o(r);if(o)return{key:o,source:"useExisting"};throw new YWe}let n=Ygn.randomBytes(Kgn);return await zgn(e.setPassword($gn,Vgn,n.toString("base64")),Wgn,"setMasterKey"),rq.info(t,"keytar-master-key: setPassword (new key) completed"),{key:n,source:"createNew"}}a(L7o,"getOrCreateMasterKey");function zgn(t,e,r){return new Promise((n,o)=>{let s=setTimeout(()=>o(new Error(`${r}: timeout after ${e}ms`)),e);s.unref?.(),t.then(c=>{clearTimeout(s),n(c)},c=>{clearTimeout(s),o(c instanceof Error?c:new Error(`${r}: ${String(c)}`))})})}a(zgn,"withTimeout");var YWe=class extends Error{static{a(this,"CorruptMasterKeyError")}constructor(){super("keytar master-key entry present but undecodable"),this.name="CorruptMasterKeyError"}};function y9t(t,e){return{available:!1,errorPhase:t,error:e}}a(y9t,"unavailable");function B7o(t){let e=Buffer.from(t,"base64");return e.length===Kgn?e:void 0}a(B7o,"decodeMasterKey");p();var aue=fe(require("node:crypto"));var F7o=0,C9t=1,NK=class extends Error{constructor(r,n,o){super(r,o?.cause!==void 0?{cause:o.cause}:void 0);this.kind=n;this.name="SecretUnwrapError"}static{a(this,"SecretUnwrapError")}},JWe=class{static{a(this,"SecretCodec")}},v9t=class extends JWe{constructor(){super(...arguments);this.schemaVersion=F7o}static{a(this,"PlaintextCodec")}encode(r){return Buffer.from(r,"utf8")}decode(r){return Buffer.from(r).toString("utf8")}},KWe=12,E9t=16,Jgn=32,ZWe=class extends JWe{constructor(r){super();this.key=r;this.schemaVersion=C9t;if(r.length!==Jgn)throw new Error(`AesGcmCodec requires a ${Jgn}-byte key, got ${r.length}`)}static{a(this,"AesGcmCodec")}encode(r){let n=aue.randomBytes(KWe),o=aue.createCipheriv("aes-256-gcm",this.key,n),s=Buffer.concat([o.update(Buffer.from(r,"utf8")),o.final()]);return Buffer.concat([n,s,o.getAuthTag()])}decode(r){let n=Buffer.from(r);if(n.length{let c=this.stmts.upsertToken.get(n.authAuthority,n.oauthClientId,n.user,n.scopes,s.ciphertext,s.schemaVersion,r,o,o,o);return this.stmts.upsertActiveSession.run(r,c.token_id,o),this.stmts.deleteSignoutTombstone.run(r),{tokenId:c.token_id,tokenRewrite:c.token_rewrite===1}})}async assignActiveSession(r,n){let o=Date.now();_z(this.db,()=>{if(!this.stmts.selectTokenById.get(n))throw new Error(`assignActiveSession: tokenId ${n} not found`);this.stmts.upsertActiveSession.run(r,n,o),this.stmts.deleteSignoutTombstone.run(r),this.stmts.bumpLastUsed.run(o,n)})}async markEditorOptedOut(r){let n=Date.now();_z(this.db,()=>{this.stmts.deleteActiveSession.run(r),this.stmts.insertSignoutTombstone.run(r,n)})}async hasOptOutTombstone(r){return this.stmts.selectSignoutTombstone.get(r)!==void 0}async listTokensByRecency(r=-1){let n=this.stmts.selectAllTokensByRecency.all(r),o=[];for(let s of n){let c=await this.toStoredTokenRecordOrPurge(s);c&&o.push(c)}return o}async findTokenByAuthority(r){let n=this.stmts.selectTokenByAuthority.get(r);return n?await this.toStoredTokenRecordOrPurge(n):void 0}async listAvailableTokens(){return this.stmts.selectAllTokensByRecency.all(-1).map(n=>({tokenId:n.token_id,authAuthority:n.auth_authority,oauthClientId:n.oauth_client_id,userLogin:n.user_login,sourceEditorId:n.source_editor_id,lastUsedAt:n.last_used_at}))}async deleteTokenCascade(r){let n=Date.now();return _z(this.db,()=>{let o=this.stmts.deleteActiveSessionsForTokenReturning.all(r),s=this.stmts.deleteTokenById.run(r);for(let{editor_id:c}of o)this.stmts.insertSignoutTombstone.run(c,n);return{affectedEditors:o.length,tokenDeleted:Number(s.changes)===1}})}async touchActiveSession(r){let n=Date.now();_z(this.db,()=>{let o=this.stmts.selectActiveSessionByEditor.get(r);o&&this.stmts.bumpLastUsed.run(n,o.token_id)})}async getMetadata(r){return this.stmts.getMetadata.get(r)?.value}async setMetadata(r,n){this.stmts.setMetadata.run(r,n)}async toStoredTokenRecordOrPurge(r){try{let n=this.secretStorage.unwrap({schemaVersion:r.token_schema_version,ciphertext:r.token_ciphertext});if(r.token_schema_version===v9t){let o=r.token_id,s=n;setImmediate(()=>{try{_z(this.db,()=>this.stmts.updateTokenToPlaintext.run(Buffer.from(s,"utf8"),o))}catch(c){C9t.info(this.ctx,`opportunistic v1->v0 heal failed tokenId=${o} (will retry on next read)`,c)}})}return{tokenId:r.token_id,sourceEditorId:r.source_editor_id,record:{user:r.user_login,accessToken:n,authAuthority:r.auth_authority,oauthClientId:r.oauth_client_id,scopes:r.scopes}}}catch(n){n instanceof DK&&n.kind==="tagMismatch"&&this.deleteTokenCascade(r.token_id).then(({affectedEditors:o,tokenDeleted:s})=>{s&&(C9t.warn(this.ctx,`purged token after AES unwrap failure (tagMismatch) tokenId=${r.token_id} affectedEditors=${o}`),oGe(this.ctx,{editorId:r.source_editor_id,trigger:"unwrap_failure",affectedEditors:o}))}).catch(o=>C9t.error(this.ctx,`cleanup after AES unwrap failure failed tokenId=${r.token_id} (row may be preserved, will retry on next read)`,o));return}}};var Xgn=fe(require("fs")),b9t=fe(require("node:sqlite")),e0n=fe(require("path"));var NK=new pe("AuthRepoInit");function aue(){return typeof performance<"u"?performance.now():Date.now()}a(aue,"nowMs");function Zgn(t){try{t.close()}catch{}}a(Zgn,"safeClose");function B7o(t){let e=aue(),r={durationMs:0};try{Xgn.mkdirSync(e0n.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=aue()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new b9t.default.DatabaseSync(t)}catch(o){return r.durationMs=aue()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{ADt(n)}catch(o){return r.durationMs=aue()-e,r.errorPhase="applyPragmas",r.error=o,Zgn(n),{db:void 0,diagnostics:r}}try{yDt(n)}catch(o){return r.durationMs=aue()-e,r.errorPhase="applySchema",r.error=o,Zgn(n),{db:void 0,diagnostics:r}}return r.durationMs=aue()-e,{db:n,diagnostics:r}}a(B7o,"tryOpenAuthDb");function F7o(t,e){let r=new b9t.default.DatabaseSync(":memory:");return ADt(r),yDt(r),new Bxe(t,r,e)}a(F7o,"openInMemoryAuthRepo");function t0n(t,e,r){let{db:n,diagnostics:o}=B7o(e);return n?{repo:new Bxe(t,n,r),diagnostics:{...o,repoKind:"sqlite"}}:{repo:F7o(t,r),diagnostics:{...o,repoKind:"memory"}}}a(t0n,"buildAuthRepository");function r0n(t,e){if(e.repoKind==="memory"){NK.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(ss).showWarningMessageOnlyOnce("auth.db.inMemoryFallback","GitHub Copilot could not open its credential store and is using an in-memory fallback. You will need to sign in again after restarting.").catch(r=>{NK.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){NK.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(r0n,"reportAuthRepoFallbackNotice");function n0n(t,e){Tsn(t,e)}a(n0n,"reportAuthRepoTelemetry");async function S9t(t){let e=t.get(tF),r=t.get(op);if(qgn(t)){NK.info(t,"secret-store: encryption disabled by config; pinning writes to plaintext v0");let c={available:!1,errorPhase:"disabledByConfig"};return r.onInitialized(()=>sGe(t,{writerKind:"plaintext",diagnostics:c})),{diagnostics:c}}let{masterKey:n,diagnostics:o}=await y9t.resolveMasterKey(t);if(!n)return U7o(t,o),r.onInitialized(()=>sGe(t,{writerKind:"plaintext",diagnostics:o})),{diagnostics:o};let s=new ZWe(n);return e.addReader(s),r.onInitialized(()=>sGe(t,{writerKind:"plaintext",diagnostics:o})),{diagnostics:o}}a(S9t,"initializeSecretStorage");function U7o(t,e){NK.info(t,`secret-store fallback: tokens stored in plaintext on disk (no OS keychain available; phase=${e.errorPhase??"n/a"})`);try{t.get(ss).showWarningMessageOnlyOnce("auth.secretStorage.plaintextFallback","GitHub Copilot could not access the OS keychain. OAuth tokens are stored in plaintext on disk.").catch(r=>{NK.info(t,"reportSecretStorageFallbackNotice: notification failed",r)})}catch(r){NK.info(t,"reportSecretStorageFallbackNotice: notification skipped",r)}}a(U7o,"reportSecretStorageFallbackNotice");p();p();var Q7o=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function q7o(t){return Q7o.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(q7o,"isOomError");function MK(t,e,r,n=Br){if(!ng(e)){if(e instanceof Error){let o=e;q7o(o)?t.get(ks).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(ks).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(ks).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(ks).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(ks).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a(MK,"handleException");function i0n(t){process.addListener("uncaughtException",r=>{MK(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,MK(t,r,"unhandledRejection")}finally{e=!1}})}a(i0n,"registerDefaultHandlers");function o0n(){ZQ("o200k_base").catch(()=>{})}a(o0n,"prewarmTokenizers");p();p();p();var rF={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}};p();p();var s0n=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],a0n={".php":[".blade"]},nq=Object.keys(rF).flatMap(t=>rF[t].extensions);var T9t=fe(require("node:path"));var lue=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},Fxe=class{static{a(this,"LanguageDetection")}},I9t=new Map,cue=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(rF)){for(let n of e)I9t.set(n,[...I9t.get(n)??[],t]);for(let n of r??[])cue.set(n,[...cue.get(n)??[],t])}var x9t=class extends Fxe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=ro(e.uri),n=T9t.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new lue(s.languageId,s.isGuess,c):new lue(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(s0n.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=T9t.extname(n).toLowerCase();if(o.length>0&&nq.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=a0n[e];return!n||n.includes(r)}detectLanguageId(e,r){if(cue.has(e))return{languageId:cue.get(e)[0],isGuess:!1};let n=I9t.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),cue.has(e))return{languageId:cue.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},w9t=class extends Fxe{constructor(r){super();this.delegate=r}static{a(this,"GroupingLanguageDetection")}detectLanguage(r){let n=this.delegate.detectLanguage(r),o=n.languageId;return o==="c"||o==="cpp"?new lue("cpp",n.isGuess,n.fileExtension):n}},R9t=class extends Fxe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new lue(r.languageId,!0,""):this.delegate.detectLanguage(r)}},j7o=new w9t(new R9t(new x9t));function OO({uri:t,languageId:e}){let r=j7o.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(OO,"detectLanguage");p();p();p();p();function sm(t){if(t.isCancellationRequested)throw new XWe}a(sm,"throwIfCancellationRequested");function r2(t){return t instanceof XWe?!0:t instanceof Error&&t.name===k9t&&t.message===k9t}a(r2,"isCancellationError");var XWe=class extends Error{static{a(this,"CancellationError")}constructor(){super(k9t),this.name=this.message}},k9t="Canceled",eze=class{constructor(){this.items=[]}static{a(this,"Stack")}push(e){this.items.push(e)}pop(){return this.items.pop()}peek(){return this.items[this.items.length-1]}tryPeek(){return this.items.length>0}toArray(){return this.items}};function OK(t){switch(t){case 0:case 2:case 7:case 8:case 11:case 12:case 13:case 14:return!0;default:return!1}}a(OK,"isTypeDefinition");var Iu=class t{static{a(this,"TextRange")}static{this.empty=new t(0,0)}constructor(e,r){this.start=e,this.length=r}static fromBounds(e,r){return new t(e,r-e)}get end(){return this.start+this.length}contains(e){return this.start<=e&&this.end>=e}containsRange(e){return this.start<=e.start&&this.end>=e.end}equals(e){return this.start===e.start&&this.length===e.length}getText(e){return e.slice(this.start,this.end)}getTextWithIndentation(e,r){let n=[],o=this.start;for(o=l0n(e,e.length,o),c0n(n,r);o{let c=this.stmts.upsertToken.get(n.authAuthority,n.oauthClientId,n.user,n.scopes,s.ciphertext,s.schemaVersion,r,o,o,o);return this.stmts.upsertActiveSession.run(r,c.token_id,o),this.stmts.deleteSignoutTombstone.run(r),{tokenId:c.token_id,tokenRewrite:c.token_rewrite===1}})}async assignActiveSession(r,n){let o=Date.now();Ez(this.db,()=>{if(!this.stmts.selectTokenById.get(n))throw new Error(`assignActiveSession: tokenId ${n} not found`);this.stmts.upsertActiveSession.run(r,n,o),this.stmts.deleteSignoutTombstone.run(r),this.stmts.bumpLastUsed.run(o,n)})}async markEditorOptedOut(r){let n=Date.now();Ez(this.db,()=>{this.stmts.deleteActiveSession.run(r),this.stmts.insertSignoutTombstone.run(r,n)})}async hasOptOutTombstone(r){return this.stmts.selectSignoutTombstone.get(r)!==void 0}async listTokensByRecency(r=-1){let n=this.stmts.selectAllTokensByRecency.all(r),o=[];for(let s of n){let c=await this.toStoredTokenRecordOrPurge(s);c&&o.push(c)}return o}async findTokenByAuthority(r){let n=this.stmts.selectTokenByAuthority.get(r);return n?await this.toStoredTokenRecordOrPurge(n):void 0}async listAvailableTokens(){return this.stmts.selectAllTokensByRecency.all(-1).map(n=>({tokenId:n.token_id,authAuthority:n.auth_authority,oauthClientId:n.oauth_client_id,userLogin:n.user_login,sourceEditorId:n.source_editor_id,lastUsedAt:n.last_used_at}))}async deleteTokenCascade(r){let n=Date.now();return Ez(this.db,()=>{let o=this.stmts.deleteActiveSessionsForTokenReturning.all(r),s=this.stmts.deleteTokenById.run(r);for(let{editor_id:c}of o)this.stmts.insertSignoutTombstone.run(c,n);return{affectedEditors:o.length,tokenDeleted:Number(s.changes)===1}})}async touchActiveSession(r){let n=Date.now();Ez(this.db,()=>{let o=this.stmts.selectActiveSessionByEditor.get(r);o&&this.stmts.bumpLastUsed.run(n,o.token_id)})}async getMetadata(r){return this.stmts.getMetadata.get(r)?.value}async setMetadata(r,n){this.stmts.setMetadata.run(r,n)}async toStoredTokenRecordOrPurge(r){try{let n=this.secretStorage.unwrap({schemaVersion:r.token_schema_version,ciphertext:r.token_ciphertext});if(r.token_schema_version===C9t){let o=r.token_id,s=n;setImmediate(()=>{try{Ez(this.db,()=>this.stmts.updateTokenToPlaintext.run(Buffer.from(s,"utf8"),o))}catch(c){b9t.info(this.ctx,`opportunistic v1->v0 heal failed tokenId=${o} (will retry on next read)`,c)}})}return{tokenId:r.token_id,sourceEditorId:r.source_editor_id,record:{user:r.user_login,accessToken:n,authAuthority:r.auth_authority,oauthClientId:r.oauth_client_id,scopes:r.scopes}}}catch(n){n instanceof NK&&n.kind==="tagMismatch"&&this.deleteTokenCascade(r.token_id).then(({affectedEditors:o,tokenDeleted:s})=>{s&&(b9t.warn(this.ctx,`purged token after AES unwrap failure (tagMismatch) tokenId=${r.token_id} affectedEditors=${o}`),oGe(this.ctx,{editorId:r.source_editor_id,trigger:"unwrap_failure",affectedEditors:o}))}).catch(o=>b9t.error(this.ctx,`cleanup after AES unwrap failure failed tokenId=${r.token_id} (row may be preserved, will retry on next read)`,o));return}}};var e0n=fe(require("fs")),S9t=fe(require("node:sqlite")),t0n=fe(require("path"));var MK=new pe("AuthRepoInit");function cue(){return typeof performance<"u"?performance.now():Date.now()}a(cue,"nowMs");function Xgn(t){try{t.close()}catch{}}a(Xgn,"safeClose");function U7o(t){let e=cue(),r={durationMs:0};try{e0n.mkdirSync(t0n.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=cue()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new S9t.default.DatabaseSync(t)}catch(o){return r.durationMs=cue()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{yDt(n)}catch(o){return r.durationMs=cue()-e,r.errorPhase="applyPragmas",r.error=o,Xgn(n),{db:void 0,diagnostics:r}}try{_Dt(n)}catch(o){return r.durationMs=cue()-e,r.errorPhase="applySchema",r.error=o,Xgn(n),{db:void 0,diagnostics:r}}return r.durationMs=cue()-e,{db:n,diagnostics:r}}a(U7o,"tryOpenAuthDb");function Q7o(t,e){let r=new S9t.default.DatabaseSync(":memory:");return yDt(r),_Dt(r),new Bxe(t,r,e)}a(Q7o,"openInMemoryAuthRepo");function r0n(t,e,r){let{db:n,diagnostics:o}=U7o(e);return n?{repo:new Bxe(t,n,r),diagnostics:{...o,repoKind:"sqlite"}}:{repo:Q7o(t,r),diagnostics:{...o,repoKind:"memory"}}}a(r0n,"buildAuthRepository");function n0n(t,e){if(e.repoKind==="memory"){MK.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(ss).showWarningMessageOnlyOnce("auth.db.inMemoryFallback","GitHub Copilot could not open its credential store and is using an in-memory fallback. You will need to sign in again after restarting.").catch(r=>{MK.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){MK.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(n0n,"reportAuthRepoFallbackNotice");function i0n(t,e){Isn(t,e)}a(i0n,"reportAuthRepoTelemetry");async function T9t(t){let e=t.get(tF),r=t.get(op);if(jgn(t)){MK.info(t,"secret-store: encryption disabled by config; pinning writes to plaintext v0");let c={available:!1,errorPhase:"disabledByConfig"};return r.onInitialized(()=>sGe(t,{writerKind:"plaintext",diagnostics:c})),{diagnostics:c}}let{masterKey:n,diagnostics:o}=await _9t.resolveMasterKey(t);if(!n)return q7o(t,o),r.onInitialized(()=>sGe(t,{writerKind:"plaintext",diagnostics:o})),{diagnostics:o};let s=new ZWe(n);return e.addReader(s),r.onInitialized(()=>sGe(t,{writerKind:"plaintext",diagnostics:o})),{diagnostics:o}}a(T9t,"initializeSecretStorage");function q7o(t,e){MK.info(t,`secret-store fallback: tokens stored in plaintext on disk (no OS keychain available; phase=${e.errorPhase??"n/a"})`);try{t.get(ss).showWarningMessageOnlyOnce("auth.secretStorage.plaintextFallback","GitHub Copilot could not access the OS keychain. OAuth tokens are stored in plaintext on disk.").catch(r=>{MK.info(t,"reportSecretStorageFallbackNotice: notification failed",r)})}catch(r){MK.info(t,"reportSecretStorageFallbackNotice: notification skipped",r)}}a(q7o,"reportSecretStorageFallbackNotice");p();p();var j7o=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function H7o(t){return j7o.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(H7o,"isOomError");function OK(t,e,r,n=Fr){if(!ig(e)){if(e instanceof Error){let o=e;H7o(o)?t.get(ks).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(ks).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(ks).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(ks).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(ks).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a(OK,"handleException");function o0n(t){process.addListener("uncaughtException",r=>{OK(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,OK(t,r,"unhandledRejection")}finally{e=!1}})}a(o0n,"registerDefaultHandlers");function s0n(){ZQ("o200k_base").catch(()=>{})}a(s0n,"prewarmTokenizers");p();p();p();var rF={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}};p();p();var a0n=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],c0n={".php":[".blade"]},nq=Object.keys(rF).flatMap(t=>rF[t].extensions);var I9t=fe(require("node:path"));var uue=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},Fxe=class{static{a(this,"LanguageDetection")}},x9t=new Map,lue=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(rF)){for(let n of e)x9t.set(n,[...x9t.get(n)??[],t]);for(let n of r??[])lue.set(n,[...lue.get(n)??[],t])}var w9t=class extends Fxe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=ro(e.uri),n=I9t.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new uue(s.languageId,s.isGuess,c):new uue(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(a0n.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=I9t.extname(n).toLowerCase();if(o.length>0&&nq.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=c0n[e];return!n||n.includes(r)}detectLanguageId(e,r){if(lue.has(e))return{languageId:lue.get(e)[0],isGuess:!1};let n=x9t.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),lue.has(e))return{languageId:lue.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},R9t=class extends Fxe{constructor(r){super();this.delegate=r}static{a(this,"GroupingLanguageDetection")}detectLanguage(r){let n=this.delegate.detectLanguage(r),o=n.languageId;return o==="c"||o==="cpp"?new uue("cpp",n.isGuess,n.fileExtension):n}},k9t=class extends Fxe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new uue(r.languageId,!0,""):this.delegate.detectLanguage(r)}},G7o=new R9t(new k9t(new w9t));function OO({uri:t,languageId:e}){let r=G7o.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(OO,"detectLanguage");p();p();p();p();function sm(t){if(t.isCancellationRequested)throw new XWe}a(sm,"throwIfCancellationRequested");function r2(t){return t instanceof XWe?!0:t instanceof Error&&t.name===P9t&&t.message===P9t}a(r2,"isCancellationError");var XWe=class extends Error{static{a(this,"CancellationError")}constructor(){super(P9t),this.name=this.message}},P9t="Canceled",eze=class{constructor(){this.items=[]}static{a(this,"Stack")}push(e){this.items.push(e)}pop(){return this.items.pop()}peek(){return this.items[this.items.length-1]}tryPeek(){return this.items.length>0}toArray(){return this.items}};function LK(t){switch(t){case 0:case 2:case 7:case 8:case 11:case 12:case 13:case 14:return!0;default:return!1}}a(LK,"isTypeDefinition");var Iu=class t{static{a(this,"TextRange")}static{this.empty=new t(0,0)}constructor(e,r){this.start=e,this.length=r}static fromBounds(e,r){return new t(e,r-e)}get end(){return this.start+this.length}contains(e){return this.start<=e&&this.end>=e}containsRange(e){return this.start<=e.start&&this.end>=e.end}equals(e){return this.start===e.start&&this.length===e.length}getText(e){return e.slice(this.start,this.end)}getTextWithIndentation(e,r){let n=[],o=this.start;for(o=u0n(e,e.length,o),l0n(n,r);o0||u>0||d>0||f>0?new uw(r,"","",Iu.fromBounds(s,c),Iu.fromBounds(d,f),Iu.fromBounds(h,m),y,t.kindFromString(g),0):null;if(_){t.updateScopesForSymbol(e,_);let E=_.nameRange.getText(n),v=this.createNameFromScopes(n,e.toArray());return v=A?`${A}.${v}`:v,new uw(r,v,E.substring(E.lastIndexOf(".")+1),_.commentRange,_.nameRange,_.bodyRange,_.extentRange,_.kind,0)}return null}static updateScopesForSymbol(e,r){for(;e.tryPeek()&&!e.peek()?.extentRange.containsRange(r.extentRange);)e.pop();e.push(r)}static kindFromString(e){switch(e){case"definition.class":return 0;case"definition.constant":return 1;case"definition.enum_variant":return 3;case"definition.enum":return 2;case"definition.field":return 4;case"definition.function":return 5;case"definition.implementation":return 6;case"definition.interface":return 7;case"definition.macro":return 8;case"definition.method":return 9;case"import.module":case"definition.module":case"definition.module.filescoped":return 10;case"definition.struct":return 11;case"definition.trait":return 12;case"definition.type":return 13;case"definition.union":return 14;case"reference":return 16;case"wildcard":return 18;case"alias":return 19;case"import":return 17;default:throw new Error("NotSupportedException")}}cleanQuotedString(e){return e.replace(/^(['"])(.*)\1$/,"$2")}};var tze=class extends am{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,H7o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},rze=class extends am{static{a(this,"GoReferenceExtractor")}get languageId(){return"go"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}extractReferences(e,r){return this.executeQuery(e,r,$7o)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,V7o),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},nze=class extends am{static{a(this,"GoImportExtractor")}get languageId(){return"go"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){let n=await this.findMatches(r,G7o),o=new Set;try{n.matches.forEach(s=>{let c,l,u;for(let d of s.captures)d.name==="import.name"?c=d:d.name==="alias"?l=d:d.name==="import"&&(u=d);if(c&&u){let d=this.cleanQuotedString(c.node.text),f=c.node.startIndex+1,h=c.node.endIndex-1,m=l?new Iu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new Iu(f,h-f),g=new Iu(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=Iu.empty,y=Iu.empty,_=d.substring(d.lastIndexOf("/")+1);o.add(new uw(e,d,_,A,m,y,g,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},H7o=` +`),o=u0n(e,e.length,++o),l0n(n,r)):o++;return n.join("")}};function l0n(t,e){for(let r=0;r0||u>0||d>0||f>0?new uw(r,"","",Iu.fromBounds(s,c),Iu.fromBounds(d,f),Iu.fromBounds(h,m),y,t.kindFromString(g),0):null;if(_){t.updateScopesForSymbol(e,_);let E=_.nameRange.getText(n),v=this.createNameFromScopes(n,e.toArray());return v=A?`${A}.${v}`:v,new uw(r,v,E.substring(E.lastIndexOf(".")+1),_.commentRange,_.nameRange,_.bodyRange,_.extentRange,_.kind,0)}return null}static updateScopesForSymbol(e,r){for(;e.tryPeek()&&!e.peek()?.extentRange.containsRange(r.extentRange);)e.pop();e.push(r)}static kindFromString(e){switch(e){case"definition.class":return 0;case"definition.constant":return 1;case"definition.enum_variant":return 3;case"definition.enum":return 2;case"definition.field":return 4;case"definition.function":return 5;case"definition.implementation":return 6;case"definition.interface":return 7;case"definition.macro":return 8;case"definition.method":return 9;case"import.module":case"definition.module":case"definition.module.filescoped":return 10;case"definition.struct":return 11;case"definition.trait":return 12;case"definition.type":return 13;case"definition.union":return 14;case"reference":return 16;case"wildcard":return 18;case"alias":return 19;case"import":return 17;default:throw new Error("NotSupportedException")}}cleanQuotedString(e){return e.replace(/^(['"])(.*)\1$/,"$2")}};var tze=class extends am{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,$7o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},rze=class extends am{static{a(this,"GoReferenceExtractor")}get languageId(){return"go"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}extractReferences(e,r){return this.executeQuery(e,r,W7o)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,z7o),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},nze=class extends am{static{a(this,"GoImportExtractor")}get languageId(){return"go"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){let n=await this.findMatches(r,V7o),o=new Set;try{n.matches.forEach(s=>{let c,l,u;for(let d of s.captures)d.name==="import.name"?c=d:d.name==="alias"?l=d:d.name==="import"&&(u=d);if(c&&u){let d=this.cleanQuotedString(c.node.text),f=c.node.startIndex+1,h=c.node.endIndex-1,m=l?new Iu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new Iu(f,h-f),g=new Iu(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=Iu.empty,y=Iu.empty,_=d.substring(d.lastIndexOf("/")+1);o.add(new uw(e,d,_,A,m,y,g,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},$7o=` ( ((comment)* @comment) . @@ -2027,7 +2027,7 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la . (field_declaration name: (_) @name) @definition.field ) -`,G7o=` +`,V7o=` (import_declaration (import_spec name: (package_identifier)? @alias @@ -2038,15 +2038,15 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la (import_spec name: (package_identifier)? @alias path: (interpreted_string_literal) @import.name))+) @import -`,$7o=` +`,W7o=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`,V7o=` +`,z7o=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`;p();var oze=class extends am{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,W7o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},sze=class extends am{static{a(this,"JavaReferenceExtractor")}get languageId(){return"java"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}extractReferences(e,r){return this.executeQuery(e,r,Y7o)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,K7o),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},aze=class extends am{static{a(this,"JavaImportExtractor")}get languageId(){return"java"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){return(await this.executeQuery(e,r,z7o)).filter(o=>o.kind===0)}},W7o=` +`;p();var oze=class extends am{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,Y7o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},sze=class extends am{static{a(this,"JavaReferenceExtractor")}get languageId(){return"java"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}extractReferences(e,r){return this.executeQuery(e,r,J7o)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,Z7o),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},aze=class extends am{static{a(this,"JavaImportExtractor")}get languageId(){return"java"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){return(await this.executeQuery(e,r,K7o)).filter(o=>o.kind===0)}},Y7o=` ( [ (block_comment) @comment @@ -2109,7 +2109,7 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la . (enum_constant name: (identifier) @name) @definition.enum_variant ) -`,z7o=` +`,K7o=` ( [ ((line_comment)* @comment) @@ -2121,19 +2121,19 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la (asterisk)? @wildcard ) @definition.class ) -`,Y7o=` +`,J7o=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`,K7o=` +`,Z7o=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`;p();var J7o=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),cze=class extends am{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,Z7o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},lze=class extends am{static{a(this,"JavaScriptReferenceExtractor")}extractLocalReferences(e,r,n){throw new Error("Method not implemented.")}get languageId(){return"javascript"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,X7o)).filter(o=>!J7o.has(o.unqualifiedName))}};var Z7o=` +`;p();var X7o=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),cze=class extends am{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,eQo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},lze=class extends am{static{a(this,"JavaScriptReferenceExtractor")}extractLocalReferences(e,r,n){throw new Error("Method not implemented.")}get languageId(){return"javascript"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,tQo)).filter(o=>!X7o.has(o.unqualifiedName))}};var eQo=` ( ((comment)* @comment) . @@ -2143,9 +2143,9 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la (export_statement declaration: (lexical_declaration (variable_declarator name: (identifier) @name value: (_) @body))) @definition.function ] ) -`,X7o=` +`,tQo=` (call_expression function: (_) @name) @reference -`;p();var eQo=new Set(["int","str","float","bool","list","dict","tuple","set"]),uze=class extends am{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,tQo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},dze=class extends am{static{a(this,"PythonReferenceExtractor")}get languageId(){return"python"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,rQo)).filter(o=>!eQo.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,iQo),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},fze=class extends am{static{a(this,"PythonImportExtractor")}get languageId(){return"python"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){let n=await this.findMatches(r,nQo),o=new Set;try{n.matches.forEach(s=>{let c,l,u,d;for(let f of s.captures)f.name==="import.name"?c=f:f.name==="import.module"?u=f:f.name==="alias"?l=f:f.name==="import"&&(d=f);if(u&&d){let f=c||u,h=l?new Iu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new Iu(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new Iu(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=Iu.empty,A=Iu.empty,y=f.node.text,_=y.split(".").pop()||y,E;c?E=`${u.node.text}.${c.node.text}`:E=u.node.text,o.add(new uw(e,E,_,g,h,A,m,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},tQo=` +`;p();var rQo=new Set(["int","str","float","bool","list","dict","tuple","set"]),uze=class extends am{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,nQo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},dze=class extends am{static{a(this,"PythonReferenceExtractor")}get languageId(){return"python"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,iQo)).filter(o=>!rQo.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,sQo),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},fze=class extends am{static{a(this,"PythonImportExtractor")}get languageId(){return"python"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){let n=await this.findMatches(r,oQo),o=new Set;try{n.matches.forEach(s=>{let c,l,u,d;for(let f of s.captures)f.name==="import.name"?c=f:f.name==="import.module"?u=f:f.name==="alias"?l=f:f.name==="import"&&(d=f);if(u&&d){let f=c||u,h=l?new Iu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new Iu(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new Iu(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=Iu.empty,A=Iu.empty,y=f.node.text,_=y.split(".").pop()||y,E;c?E=`${u.node.text}.${c.node.text}`:E=u.node.text,o.add(new uw(e,E,_,g,h,A,m,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},nQo=` ( ((comment)* @comment) . @@ -2157,7 +2157,7 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la . (function_definition name: (_) @name body: (_) @body) @definition.method ) -`,rQo=` +`,iQo=` (call function: (_) @name) @reference (type [ @@ -2166,7 +2166,7 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`,nQo=` +`,oQo=` (import_statement name: (dotted_name) @import.module) @import (import_from_statement @@ -2181,7 +2181,7 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la (aliased_import name: ((dotted_name) @import.name) alias: (identifier) @alias)) @import -`,iQo=` +`,sQo=` (call function: (_) @name) @reference (type [ @@ -2190,7 +2190,7 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`;p();var oQo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),uue=class extends am{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,sQo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},due=class extends am{static{a(this,"TypeScriptReferenceExtractor")}get languageId(){return"typescript"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,aQo)).filter(o=>!oQo.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var sQo=` +`;p();var aQo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),due=class extends am{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,cQo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},fue=class extends am{static{a(this,"TypeScriptReferenceExtractor")}get languageId(){return"typescript"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,lQo)).filter(o=>!aQo.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var cQo=` ( ((comment)* @comment) . @@ -2215,13 +2215,13 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la (variable_declarator name: (identifier) @name type: (type_annotation (type_identifier))) ] ) -`,aQo=` +`,lQo=` (call_expression function: (_) @name) @reference (type_identifier) @name @reference (new_expression constructor: (identifier) @name) @reference -`;p();var cQo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),pze=class extends uue{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,lQo),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},hze=class extends due{static{a(this,"TypeScriptReactReferenceExtractor")}get languageId(){return"typescriptreact"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){let[n,o]=await Promise.all([this.executeQuery(e,r,uQo),super.extractReferences(e,r)]);return[...n.filter(s=>!cQo.has(s.unqualifiedName)),...o]}},lQo=` +`;p();var uQo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),pze=class extends due{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,dQo),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},hze=class extends fue{static{a(this,"TypeScriptReactReferenceExtractor")}get languageId(){return"typescriptreact"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){let[n,o]=await Promise.all([this.executeQuery(e,r,fQo),super.extractReferences(e,r)]);return[...n.filter(s=>!uQo.has(s.unqualifiedName)),...o]}},dQo=` ( ((comment)* @comment) . @@ -2234,30 +2234,30 @@ ${r}+- `:"";return e+this.description+o}}},g0=class{constructor(e,r,n,o){this.la body: (_) @body))) @definition.function ] ) -`,uQo=` +`,fQo=` (jsx_element open_tag: (jsx_opening_element name: (_) @name) close_tag: (jsx_closing_element) ) @reference (jsx_self_closing_element name: (_) @name) @reference (import_specifier name:(identifier) @name) @reference -`;var Uxe=[{symbolExtractor:new oze,referenceExtractor:new sze,importExtractor:new aze,languageId:"java"},{symbolExtractor:new tze,referenceExtractor:new rze,importExtractor:new nze,languageId:"go"},{symbolExtractor:new uze,referenceExtractor:new dze,importExtractor:new fze,languageId:"python"},{symbolExtractor:new uue,referenceExtractor:new due,languageId:"typescript"},{symbolExtractor:new pze,referenceExtractor:new hze,languageId:"typescriptreact"},{symbolExtractor:new cze,referenceExtractor:new lze,languageId:"javascript"}];function u0n(t){let e=OO({uri:t});if(e&&Uxe.some(r=>e===r.languageId))return e}a(u0n,"getSupportedLanguageIdForMultiLanguageProvider");var d0n=new Map(Uxe.map(t=>[t.languageId,t.referenceExtractor])),f0n=new Map(Uxe.map(t=>[t.languageId,t.symbolExtractor])),p0n=new Map(Uxe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),P9t=Uxe.map(t=>rF[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function D9t(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(D9t,"virtualNode");function h0n(t,e,r,n,o){if(r==="")throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:t,lineNumber:e,sourceLine:r,subs:n,label:o}}a(h0n,"lineNode");function N9t(t){return{type:"blank",lineNumber:t,subs:[]}}a(N9t,"blankNode");function mze(t){return{type:"top",indentation:-1,subs:t??[]}}a(mze,"topNode");function FA(t){return t.type==="blank"}a(FA,"isBlank");function LK(t){return t.type==="line"}a(LK,"isLine");function BK(t){return t.type==="virtual"}a(BK,"isVirtual");p();function m0n(t,e){return y_(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(m0n,"clearLabelsIf");function FK(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>FK(n,e));return{...t,subs:r,label:t.label?e(t.label):void 0}}case"blank":return{...t,label:t.label?e(t.label):void 0};case"top":return{...t,subs:t.subs.map(r=>FK(r,e)),label:t.label?e(t.label):void 0}}}a(FK,"mapLabels");function y_(t,e,r){function n(o){r==="topDown"&&e(o),o.subs.forEach(s=>{n(s)}),r==="bottomUp"&&e(o)}a(n,"_visit"),n(t)}a(y_,"visitTree");function M9t(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),y_(t,s,n),o}a(M9t,"foldTree");function gze(t,e,r){let n=a(s=>{if(r!==void 0&&r(s))return s;{let c=s.subs.map(n).filter(l=>l!==void 0);return s.subs=c,e(s)}},"rebuild"),o=n(t);return o!==void 0?o:mze()}a(gze,"rebuildTree");p();function fQo(t){let e=t.split(` -`),r=e.map(d=>d.match(/^\s*/)[0].length),n=e.map(d=>d.trimLeft());function o(d){let[f,h]=s(d+1,r[d]);return[h0n(r[d],d,n[d],f),h]}a(o,"parseNode");function s(d,f){let h,m=[],g=d,A;for(;gf);)if(n[g]==="")A===void 0&&(A=g),g+=1;else{if(A!==void 0){for(let y=A;ys.matches(n.sourceLine));o&&(n.label=o.label)}}a(r,"visitor"),y_(t,r,"bottomUp")}a(Qxe,"labelLines");function Aze(t){function e(r){if(BK(r)&&r.label===void 0){let n=r.subs.filter(o=>!FA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),y_(t,e,"bottomUp")}a(Aze,"labelVirtualInherited");function qxe(t){return Object.keys(t).map(e=>{let r;return t[e].test?r=a(n=>t[e].test(n),"matches"):r=t[e],{matches:r,label:e}})}a(qxe,"buildLabelRules");function O9t(t){let r=gze(t,a(function(n){if(n.subs.length===0||n.subs.findIndex(c=>c.label==="closer"||c.label==="opener")===-1)return n;let o=[],s;for(let c=0;cu.subs.push(d)),l.subs=[];else if(l.label==="closer"&&s!==void 0&&(LK(l)||BK(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&FA(o[d]);)d-=1;if(s.subs.push(...o.splice(d+1)),l.subs.length>0){let f=s.subs.findIndex(A=>A.label!=="newVirtual"),h=s.subs.slice(0,f),m=s.subs.slice(f),g=m.length>0?[D9t(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),FA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return m0n(t,n=>n==="newVirtual"),r}a(O9t,"combineClosersAndOpeners");function g0n(t,e=FA,r){return gze(t,a(function(o){if(o.subs.length<=1)return o;let s=[],c=[],l,u=!1;function d(f=!1){if(l!==void 0&&(s.length>0||!f)){let h=D9t(l,c,r);s.push(h)}else c.forEach(h=>s.push(h))}a(d,"flushBlockIntoNewSubs");for(let f=0;f{if(r.label==="class"||r.label==="interface")for(let n of r.subs)!FA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(y0n,"processJava");p();var AQo={heading:/^# /,subheading:/^## /,subsubheading:/### /},yQo=qxe(AQo);function _0n(t){let e=t;if(Qxe(e,yQo),FA(e))return e;function r(s){if(s.label==="heading")return 1;if(s.label==="subheading")return 2;if(s.label==="subsubheading")return 3}a(r,"headingLevel");let n=[e],o=[...e.subs];e.subs=[];for(let s of o){let c=r(s);if(c===void 0||FA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=g0n(e),e=UK(e),Aze(e),e}a(_0n,"processMarkdown");p();function E0n(t){return" ".repeat(t.indentation)+t.sourceLine+` -`}a(E0n,"deparseLine");L9t("markdown",_0n);L9t("java",y0n);var _Qo={worthUp:.9,worthSibling:.88,worthDown:.8};function B9t(t,e,r=Ms(),n=_Qo){let o=FK(t,s=>s?1:void 0);return y_(o,s=>{if(FA(s))return;let c=s.subs.reduce((l,u)=>Math.max(l,u.label??0),0);s.label=Math.max(s.label??0,c*n.worthUp)},"bottomUp"),y_(o,s=>{if(FA(s))return;let c=s.subs.map(d=>d.label??0),l=[...c];for(let d=0;dMath.max(f,Math.pow(n.worthSibling,Math.abs(d-h))*c[d])));let u=s.label;u!==void 0&&(l=l.map(d=>Math.max(d,n.worthDown*u))),s.subs.forEach((d,f)=>d.label=l[f])},"topDown"),EQo(o,e,r)}a(B9t,"fromTreeWithFocussedLines");function EQo(t,e,r=Ms()){let n=M9t(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[E0n(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new vr(n,e,r)}a(EQo,"fromTreeWithValuedLines");function rT(t,e=!0,r=!0,n,o=Ms()){let s=typeof t=="string"?QK(t):QK(t.source,t.languageId);UK(s);let c=FK(s,l=>e&&l!=="closer");return y_(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&y_(c,l=>{if(l.label){let u=!1;for(let d of[...l.subs].reverse())d.label&&!u?u=!0:d.label=!1}else for(let u of l.subs)u.label=!1;l.subs.length>0&&(l.label=!1)},"topDown"),r&&y_(c,l=>{l.label||=(LK(l)||FA(l))&&l.lineNumber==0},"topDown"),B9t(c,n,o)}a(rT,"elidableTextForSourceCode");p();var jxe=class t{constructor(e,r,n,o="strict",s){this.text=e;this._value=r;this._cost=n;this.metadata=s;this.markedForRemoval=!1;if(e.includes(` +`;var Uxe=[{symbolExtractor:new oze,referenceExtractor:new sze,importExtractor:new aze,languageId:"java"},{symbolExtractor:new tze,referenceExtractor:new rze,importExtractor:new nze,languageId:"go"},{symbolExtractor:new uze,referenceExtractor:new dze,importExtractor:new fze,languageId:"python"},{symbolExtractor:new due,referenceExtractor:new fue,languageId:"typescript"},{symbolExtractor:new pze,referenceExtractor:new hze,languageId:"typescriptreact"},{symbolExtractor:new cze,referenceExtractor:new lze,languageId:"javascript"}];function d0n(t){let e=OO({uri:t});if(e&&Uxe.some(r=>e===r.languageId))return e}a(d0n,"getSupportedLanguageIdForMultiLanguageProvider");var f0n=new Map(Uxe.map(t=>[t.languageId,t.referenceExtractor])),p0n=new Map(Uxe.map(t=>[t.languageId,t.symbolExtractor])),h0n=new Map(Uxe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),D9t=Uxe.map(t=>rF[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function N9t(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(N9t,"virtualNode");function m0n(t,e,r,n,o){if(r==="")throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:t,lineNumber:e,sourceLine:r,subs:n,label:o}}a(m0n,"lineNode");function M9t(t){return{type:"blank",lineNumber:t,subs:[]}}a(M9t,"blankNode");function mze(t){return{type:"top",indentation:-1,subs:t??[]}}a(mze,"topNode");function FA(t){return t.type==="blank"}a(FA,"isBlank");function BK(t){return t.type==="line"}a(BK,"isLine");function FK(t){return t.type==="virtual"}a(FK,"isVirtual");p();function g0n(t,e){return y_(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(g0n,"clearLabelsIf");function UK(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>UK(n,e));return{...t,subs:r,label:t.label?e(t.label):void 0}}case"blank":return{...t,label:t.label?e(t.label):void 0};case"top":return{...t,subs:t.subs.map(r=>UK(r,e)),label:t.label?e(t.label):void 0}}}a(UK,"mapLabels");function y_(t,e,r){function n(o){r==="topDown"&&e(o),o.subs.forEach(s=>{n(s)}),r==="bottomUp"&&e(o)}a(n,"_visit"),n(t)}a(y_,"visitTree");function O9t(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),y_(t,s,n),o}a(O9t,"foldTree");function gze(t,e,r){let n=a(s=>{if(r!==void 0&&r(s))return s;{let c=s.subs.map(n).filter(l=>l!==void 0);return s.subs=c,e(s)}},"rebuild"),o=n(t);return o!==void 0?o:mze()}a(gze,"rebuildTree");p();function hQo(t){let e=t.split(` +`),r=e.map(d=>d.match(/^\s*/)[0].length),n=e.map(d=>d.trimLeft());function o(d){let[f,h]=s(d+1,r[d]);return[m0n(r[d],d,n[d],f),h]}a(o,"parseNode");function s(d,f){let h,m=[],g=d,A;for(;gf);)if(n[g]==="")A===void 0&&(A=g),g+=1;else{if(A!==void 0){for(let y=A;ys.matches(n.sourceLine));o&&(n.label=o.label)}}a(r,"visitor"),y_(t,r,"bottomUp")}a(Qxe,"labelLines");function Aze(t){function e(r){if(FK(r)&&r.label===void 0){let n=r.subs.filter(o=>!FA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),y_(t,e,"bottomUp")}a(Aze,"labelVirtualInherited");function qxe(t){return Object.keys(t).map(e=>{let r;return t[e].test?r=a(n=>t[e].test(n),"matches"):r=t[e],{matches:r,label:e}})}a(qxe,"buildLabelRules");function L9t(t){let r=gze(t,a(function(n){if(n.subs.length===0||n.subs.findIndex(c=>c.label==="closer"||c.label==="opener")===-1)return n;let o=[],s;for(let c=0;cu.subs.push(d)),l.subs=[];else if(l.label==="closer"&&s!==void 0&&(BK(l)||FK(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&FA(o[d]);)d-=1;if(s.subs.push(...o.splice(d+1)),l.subs.length>0){let f=s.subs.findIndex(A=>A.label!=="newVirtual"),h=s.subs.slice(0,f),m=s.subs.slice(f),g=m.length>0?[N9t(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),FA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return g0n(t,n=>n==="newVirtual"),r}a(L9t,"combineClosersAndOpeners");function A0n(t,e=FA,r){return gze(t,a(function(o){if(o.subs.length<=1)return o;let s=[],c=[],l,u=!1;function d(f=!1){if(l!==void 0&&(s.length>0||!f)){let h=N9t(l,c,r);s.push(h)}else c.forEach(h=>s.push(h))}a(d,"flushBlockIntoNewSubs");for(let f=0;f{if(r.label==="class"||r.label==="interface")for(let n of r.subs)!FA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(_0n,"processJava");p();var _Qo={heading:/^# /,subheading:/^## /,subsubheading:/### /},EQo=qxe(_Qo);function E0n(t){let e=t;if(Qxe(e,EQo),FA(e))return e;function r(s){if(s.label==="heading")return 1;if(s.label==="subheading")return 2;if(s.label==="subsubheading")return 3}a(r,"headingLevel");let n=[e],o=[...e.subs];e.subs=[];for(let s of o){let c=r(s);if(c===void 0||FA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=A0n(e),e=QK(e),Aze(e),e}a(E0n,"processMarkdown");p();function v0n(t){return" ".repeat(t.indentation)+t.sourceLine+` +`}a(v0n,"deparseLine");B9t("markdown",E0n);B9t("java",_0n);var vQo={worthUp:.9,worthSibling:.88,worthDown:.8};function F9t(t,e,r=Ms(),n=vQo){let o=UK(t,s=>s?1:void 0);return y_(o,s=>{if(FA(s))return;let c=s.subs.reduce((l,u)=>Math.max(l,u.label??0),0);s.label=Math.max(s.label??0,c*n.worthUp)},"bottomUp"),y_(o,s=>{if(FA(s))return;let c=s.subs.map(d=>d.label??0),l=[...c];for(let d=0;dMath.max(f,Math.pow(n.worthSibling,Math.abs(d-h))*c[d])));let u=s.label;u!==void 0&&(l=l.map(d=>Math.max(d,n.worthDown*u))),s.subs.forEach((d,f)=>d.label=l[f])},"topDown"),CQo(o,e,r)}a(F9t,"fromTreeWithFocussedLines");function CQo(t,e,r=Ms()){let n=O9t(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[v0n(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new vr(n,e,r)}a(CQo,"fromTreeWithValuedLines");function rT(t,e=!0,r=!0,n,o=Ms()){let s=typeof t=="string"?qK(t):qK(t.source,t.languageId);QK(s);let c=UK(s,l=>e&&l!=="closer");return y_(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&y_(c,l=>{if(l.label){let u=!1;for(let d of[...l.subs].reverse())d.label&&!u?u=!0:d.label=!1}else for(let u of l.subs)u.label=!1;l.subs.length>0&&(l.label=!1)},"topDown"),r&&y_(c,l=>{l.label||=(BK(l)||FA(l))&&l.lineNumber==0},"topDown"),F9t(c,n,o)}a(rT,"elidableTextForSourceCode");p();var jxe=class t{constructor(e,r,n,o="strict",s){this.text=e;this._value=r;this._cost=n;this.metadata=s;this.markedForRemoval=!1;if(e.includes(` `)&&o!=="none")throw new Error("LineWithValueAndCost: text contains newline");if(r<0&&o!=="none")throw new Error("LineWithValueAndCost: value is negative");if(n<0&&o!=="none")throw new Error("LineWithValueAndCost: cost is negative");if(o=="strict"&&r>1)throw new Error("Value should normally be between 0 and 1 -- set validation to `loose` to ignore this error")}static{a(this,"LineWithValueAndCost")}get value(){return this._value}get cost(){return this._cost}adjustValue(e){return this._value*=e,this}setValue(e){return this._value=e,this}recost(e=r=>Ms().tokenLength(r+` `)){return this._cost=e(this.text),this}copy(){let e=new t(this.text,this.value,this.cost,"none",this.metadata);return e.markedForRemoval=this.markedForRemoval,e}};var vr=class t{constructor(e,r,n=Ms()){this.metadata=r;this.tokenizer=n;this.lines=[];let o=[];for(let s of e){let c=Array.isArray(s)?s[1]:1,l=Array.isArray(s)?s[0]:s;typeof l=="string"?l.split(` `).forEach(u=>o.push(new jxe(u,c,n.tokenLength(u+` `),"strict",this.metadata))):l instanceof t?l.lines.forEach(u=>o.push(u.copy().adjustValue(c))):"source"in l&&"languageId"in l&&rT(l).lines.forEach(u=>o.push(u.copy().adjustValue(c)))}this.lines=o}static{a(this,"ElidableText")}adjust(e){this.lines.forEach(r=>r.adjustValue(e))}recost(e=r=>Ms().tokenLength(r+` `)){this.lines.forEach(r=>r.recost(e))}elide(e,r="[...]",n=!0,o="removeLeastDesirable",s=this.tokenizer,c="topToBottom"){if(s.tokenLength(r+` -`)>e)throw new Error("maxTokens must be larger than the ellipsis length");let{lines:l,totalCost:u,priorityQueue:d}=CQo(this.lines,o);if(u<=e)return F9t(l);bQo(d,c);let f=u;for(;f>e&&d.length>0;){let m=d.shift().originalIndex,g=l[m];if(g.markedForRemoval)continue;let A=n?SQo(l,m):"",y=v0n(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let _=m+1;if(_=0){let v=l[E];yze(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return F9t([v0n("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)yze(h[m],r)&&yze(h[m-1],r)&&h.splice(m,1);return F9t(h)}};function vQo(t){return t?.text.match(/^\s*/)?.[0]??""}a(vQo,"getIndentation");function yze(t,e){return t?.text.trim()===e.trim()}a(yze,"isEllipsis");function F9t(t){return{getText:a(()=>t.map(e=>e.text).join(` -`),"getText"),getLines:a(()=>t,"getLines")}}a(F9t,"produceElidedText");function CQo(t,e){let r=0,n=[];return{lines:t.map((s,c)=>{let l=s.copy();return e==="removeLeastBangForBuck"&&l.adjustValue(1/l.cost),r+=l.cost,n.push({originalIndex:c,value:l.value}),l}),totalCost:r,priorityQueue:n}}a(CQo,"initializeElisionContext");function bQo(t,e){t.sort((r,n)=>r.value!==n.value?r.value-n.value:e==="bottomToTop"?n.originalIndex-r.originalIndex:r.originalIndex-n.originalIndex)}a(bQo,"sortPriorityQueue");function SQo(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=vQo(o);break}}return r}a(SQo,"getClosestIndentation");function v0n(t,e,r,n){let o=t+e;return new jxe(o,1/0,r.tokenLength(o+` -`),"loose",n?.metadata)}a(v0n,"getNewEllipsis");p();var C0n=require("fs");async function b0n(t,e,r,n,o){let s=new Map,c=0;for(let h of t){let m=h.node.fileName.toLowerCase(),g=s.get(m);g?g.symbols.push(h):s.set(m,{symbols:[h],topRank:c}),c++}if(s.delete(r.toLowerCase()),s.size===0)return[];let l=e,u=e/Math.min(4,s.size),d=[],f=Array.from(s.keys());f.sort((h,m)=>{let g=s.get(h).topRank,A=s.get(m).topRank;return g-A});for(let h of f){let m=s.get(h).symbols;if(m.length===0)continue;let g=m[0].node.fileName,A=m.reduce((y,_)=>y+_.node.extentRange.length,0);for(let y of m){if(l<=5)return d;sm(o);let _=y.node.extentRange.length/A,E=Math.min(l,_*u),v=(await TQo([y])).elide(E).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(b0n,"symbolRangesToCodeSnippets");async function TQo(t){if(t.length===0)return new vr([]);let e=t[0].node.fileName,r=[],n="";try{let o=ys(e);o&&(n=(await C0n.promises.readFile(o)).toString())}catch{}for(let o of t)S0n(o,n).forEach(s=>r.push(s));return new vr(r)}a(TQo,"sameFileSymbolRangeToElidableText");function S0n(t,e){let n=[],o=t.node,s=e.substring(U9t(e,o.commentRange.start),o.commentRange.end);n.push([Q9t(s),1-3e-4]);let c=U9t(e,o.bodyRange.start),l=U9t(e,o.extentRange.start),u=o.bodyRange.length===0?e.substring(l,o.extentRange.end):e.substring(o.commentRange.length===0?l:o.commentRange.end,c);if(OK(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([Q9t(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...S0n(d,e));else{let d=1-(OK(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([Q9t(f),d])}return OK(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(S0n,"prepareForElidableText");function U9t(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(U9t,"shiftLeftToNearestLineEndingOrAlphanumeric");function Q9t(t){let e=0;for(;ee)throw new Error("maxTokens must be larger than the ellipsis length");let{lines:l,totalCost:u,priorityQueue:d}=SQo(this.lines,o);if(u<=e)return U9t(l);TQo(d,c);let f=u;for(;f>e&&d.length>0;){let m=d.shift().originalIndex,g=l[m];if(g.markedForRemoval)continue;let A=n?IQo(l,m):"",y=C0n(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let _=m+1;if(_=0){let v=l[E];yze(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return U9t([C0n("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)yze(h[m],r)&&yze(h[m-1],r)&&h.splice(m,1);return U9t(h)}};function bQo(t){return t?.text.match(/^\s*/)?.[0]??""}a(bQo,"getIndentation");function yze(t,e){return t?.text.trim()===e.trim()}a(yze,"isEllipsis");function U9t(t){return{getText:a(()=>t.map(e=>e.text).join(` +`),"getText"),getLines:a(()=>t,"getLines")}}a(U9t,"produceElidedText");function SQo(t,e){let r=0,n=[];return{lines:t.map((s,c)=>{let l=s.copy();return e==="removeLeastBangForBuck"&&l.adjustValue(1/l.cost),r+=l.cost,n.push({originalIndex:c,value:l.value}),l}),totalCost:r,priorityQueue:n}}a(SQo,"initializeElisionContext");function TQo(t,e){t.sort((r,n)=>r.value!==n.value?r.value-n.value:e==="bottomToTop"?n.originalIndex-r.originalIndex:r.originalIndex-n.originalIndex)}a(TQo,"sortPriorityQueue");function IQo(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=bQo(o);break}}return r}a(IQo,"getClosestIndentation");function C0n(t,e,r,n){let o=t+e;return new jxe(o,1/0,r.tokenLength(o+` +`),"loose",n?.metadata)}a(C0n,"getNewEllipsis");p();var b0n=require("fs");async function S0n(t,e,r,n,o){let s=new Map,c=0;for(let h of t){let m=h.node.fileName.toLowerCase(),g=s.get(m);g?g.symbols.push(h):s.set(m,{symbols:[h],topRank:c}),c++}if(s.delete(r.toLowerCase()),s.size===0)return[];let l=e,u=e/Math.min(4,s.size),d=[],f=Array.from(s.keys());f.sort((h,m)=>{let g=s.get(h).topRank,A=s.get(m).topRank;return g-A});for(let h of f){let m=s.get(h).symbols;if(m.length===0)continue;let g=m[0].node.fileName,A=m.reduce((y,_)=>y+_.node.extentRange.length,0);for(let y of m){if(l<=5)return d;sm(o);let _=y.node.extentRange.length/A,E=Math.min(l,_*u),v=(await xQo([y])).elide(E).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(S0n,"symbolRangesToCodeSnippets");async function xQo(t){if(t.length===0)return new vr([]);let e=t[0].node.fileName,r=[],n="";try{let o=ys(e);o&&(n=(await b0n.promises.readFile(o)).toString())}catch{}for(let o of t)T0n(o,n).forEach(s=>r.push(s));return new vr(r)}a(xQo,"sameFileSymbolRangeToElidableText");function T0n(t,e){let n=[],o=t.node,s=e.substring(Q9t(e,o.commentRange.start),o.commentRange.end);n.push([q9t(s),1-3e-4]);let c=Q9t(e,o.bodyRange.start),l=Q9t(e,o.extentRange.start),u=o.bodyRange.length===0?e.substring(l,o.extentRange.end):e.substring(o.commentRange.length===0?l:o.commentRange.end,c);if(LK(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([q9t(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...T0n(d,e));else{let d=1-(LK(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([q9t(f),d])}return LK(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(T0n,"prepareForElidableText");function Q9t(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(Q9t,"shiftLeftToNearestLineEndingOrAlphanumeric");function q9t(t){let e=0;for(;e=0&&(t[r]==="\r"||t[r]===` -`||t[r]===" "||t[r]===" ");)r--;return t.substring(e,r+1)}a(Q9t,"trimLineEndingsAndTrailingWhitespace");var q9t=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},iq=class extends q9t{static{a(this,"UnqualifiedNameRetrievalStrategy")}constructor(e,r,n,o){super(e,r),this.caseSensitive=n,this.typesOnly=o}async getContextAtPositionAsync(e,r,n,o,s,c){let l=this.referenceExtractors.get(o);if(!l)return[];sm(c);let u=await l.extractReferences(e,r);sm(c);let d=Array.from(u);d.sort((g,A)=>this.compareSymbolRangesByProximityToCaret(g,A,n));let f=[],h=new Set,m=await this.findDefinitionsViaUnqualifiedNames(d,s,c);this.typesOnly&&(m=m.filter(g=>OK(g.kind)));for(let g of m)h.has(JSON.stringify(g))||(h.add(JSON.stringify(g)),f.push(await this.makeSymbolRangeNodeFromDefinition(g,c)));return f}async findDefinitionsViaUnqualifiedNames(e,r,n){let o=Array.from(new Set(e.map(h=>h.unqualifiedName))),s=!this.caseSensitive,c=await this.index.findPotentialDefinitionsAsync(o,s,n),l=a(h=>s?h.toLowerCase():h,"lowercaseIfCaseInsensitive"),u=a(h=>l(h.unqualifiedName),"getSymbolKey"),d=new Map;for(let h of c){let m=u(h),g=d.get(m)??[];d.set(m,[...g,h])}let f=[];for(let h of o){let m=d.get(l(h));if(!(!m||m.length>r.mlcpMaxSymbolMatches)){if(f.length+m.length>r.mlcpMaxContextItems){f.push(...m.slice(0,r.mlcpMaxContextItems-f.length));break}f.push(...m)}}return f}async makeSymbolRangeNodeFromDefinition(e,r){if(sm(r),OK(e.kind)){let n=await this.index.findSymbolsByFullyQualifiedNamePrefix(e.fileName,e.fullyQualifiedName+".",r),o=await Promise.all(n.map(s=>this.makeSymbolRangeNodeFromDefinition(s,r)));return{node:e,children:o}}else return{node:e,children:[]}}compareSymbolRangesByProximityToCaret(e,r,n){let o=e.extentRange.end<=n,s=r.extentRange.end<=n;if(o&&!s)return-1;if(!o&&s)return 1;let c=Math.abs(e.extentRange.start-n),l=Math.abs(r.extentRange.start-n);return c-l}},_ze=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new iq(e,r,!0,!0)),this.strategies.set("java",new iq(e,r,!0,!0)),this.strategies.set("python",new iq(e,r,!0,!1)),this.strategies.set("typescript",new iq(e,r,!0,!0)),this.strategies.set("typescriptreact",new iq(e,r,!0,!0)),this.strategies.set("javascript",new iq(e,r,!0,!1))}static{a(this,"SyntaxAwareContextRetrieval")}async getStringifiedContextAtPositionAsync(e,r,n,o,s,c,l){let u=await this.getContextAtPositionAsync(e,r,n,o,s,l);sm(l);let d=Ms();return b0n(u,c,e,d,l)}async getContextAtPositionAsync(e,r,n,o,s,c){return this.strategies.has(o)?this.strategies.get(o).getContextAtPositionAsync(e,r,n,o,s,c):[]}};p();p();p();p();var qK={Id:"id"},nT={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},Aa={DocumentId:"documentId",FullyQualifiedName:"fullyQualifiedName",UnqualifiedName:"unqualifiedName",CommentStart:"commentStart",CommentLength:"commentLength",NameStart:"nameStart",NameLength:"nameLength",BodyStart:"bodyStart",BodyLength:"bodyLength",ExtentStart:"extentStart",ExtentLength:"extentLength",SymbolKind:"symbolKind",RefKind:"refKind"};p();p();var Eze=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new j9t(qK.Id)}static{a(this,"SQLTableQueryGenerator")}createTableQueries(){return this.createTableString??=this.generateCreateTableString(),[this.createTableString,...this.createOptimizations]}generateCreateTableString(){let e=this.fields.map(r=>r.initColumnString());return this.extraCreateDeclarations&&e.push(this.extraCreateDeclarations),e.push(),[`CREATE TABLE IF NOT EXISTS ${this.tableName} (`,` ${this.primaryKey.initColumnString()},`,` ${e.join(`, +`||t[r]===" "||t[r]===" ");)r--;return t.substring(e,r+1)}a(q9t,"trimLineEndingsAndTrailingWhitespace");var j9t=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},iq=class extends j9t{static{a(this,"UnqualifiedNameRetrievalStrategy")}constructor(e,r,n,o){super(e,r),this.caseSensitive=n,this.typesOnly=o}async getContextAtPositionAsync(e,r,n,o,s,c){let l=this.referenceExtractors.get(o);if(!l)return[];sm(c);let u=await l.extractReferences(e,r);sm(c);let d=Array.from(u);d.sort((g,A)=>this.compareSymbolRangesByProximityToCaret(g,A,n));let f=[],h=new Set,m=await this.findDefinitionsViaUnqualifiedNames(d,s,c);this.typesOnly&&(m=m.filter(g=>LK(g.kind)));for(let g of m)h.has(JSON.stringify(g))||(h.add(JSON.stringify(g)),f.push(await this.makeSymbolRangeNodeFromDefinition(g,c)));return f}async findDefinitionsViaUnqualifiedNames(e,r,n){let o=Array.from(new Set(e.map(h=>h.unqualifiedName))),s=!this.caseSensitive,c=await this.index.findPotentialDefinitionsAsync(o,s,n),l=a(h=>s?h.toLowerCase():h,"lowercaseIfCaseInsensitive"),u=a(h=>l(h.unqualifiedName),"getSymbolKey"),d=new Map;for(let h of c){let m=u(h),g=d.get(m)??[];d.set(m,[...g,h])}let f=[];for(let h of o){let m=d.get(l(h));if(!(!m||m.length>r.mlcpMaxSymbolMatches)){if(f.length+m.length>r.mlcpMaxContextItems){f.push(...m.slice(0,r.mlcpMaxContextItems-f.length));break}f.push(...m)}}return f}async makeSymbolRangeNodeFromDefinition(e,r){if(sm(r),LK(e.kind)){let n=await this.index.findSymbolsByFullyQualifiedNamePrefix(e.fileName,e.fullyQualifiedName+".",r),o=await Promise.all(n.map(s=>this.makeSymbolRangeNodeFromDefinition(s,r)));return{node:e,children:o}}else return{node:e,children:[]}}compareSymbolRangesByProximityToCaret(e,r,n){let o=e.extentRange.end<=n,s=r.extentRange.end<=n;if(o&&!s)return-1;if(!o&&s)return 1;let c=Math.abs(e.extentRange.start-n),l=Math.abs(r.extentRange.start-n);return c-l}},_ze=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new iq(e,r,!0,!0)),this.strategies.set("java",new iq(e,r,!0,!0)),this.strategies.set("python",new iq(e,r,!0,!1)),this.strategies.set("typescript",new iq(e,r,!0,!0)),this.strategies.set("typescriptreact",new iq(e,r,!0,!0)),this.strategies.set("javascript",new iq(e,r,!0,!1))}static{a(this,"SyntaxAwareContextRetrieval")}async getStringifiedContextAtPositionAsync(e,r,n,o,s,c,l){let u=await this.getContextAtPositionAsync(e,r,n,o,s,l);sm(l);let d=Ms();return S0n(u,c,e,d,l)}async getContextAtPositionAsync(e,r,n,o,s,c){return this.strategies.has(o)?this.strategies.get(o).getContextAtPositionAsync(e,r,n,o,s,c):[]}};p();p();p();p();var jK={Id:"id"},nT={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},Aa={DocumentId:"documentId",FullyQualifiedName:"fullyQualifiedName",UnqualifiedName:"unqualifiedName",CommentStart:"commentStart",CommentLength:"commentLength",NameStart:"nameStart",NameLength:"nameLength",BodyStart:"bodyStart",BodyLength:"bodyLength",ExtentStart:"extentStart",ExtentLength:"extentLength",SymbolKind:"symbolKind",RefKind:"refKind"};p();p();var Eze=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new H9t(jK.Id)}static{a(this,"SQLTableQueryGenerator")}createTableQueries(){return this.createTableString??=this.generateCreateTableString(),[this.createTableString,...this.createOptimizations]}generateCreateTableString(){let e=this.fields.map(r=>r.initColumnString());return this.extraCreateDeclarations&&e.push(this.extraCreateDeclarations),e.push(),[`CREATE TABLE IF NOT EXISTS ${this.tableName} (`,` ${this.primaryKey.initColumnString()},`,` ${e.join(`, `)}`,")"].join(` `)}insertQuery(e,r){this.cachedInsertQueryStrings??=this.generateInsertQueryStrings();let n=[this.cachedInsertQueryStrings.prefix,Array(r).fill(this.cachedInsertQueryStrings.valuesTemplate).join(`, `)];return e&&n.push("ON CONFLICT DO NOTHING"),n.join(` `)}generateInsertQueryStrings(){return{prefix:`INSERT INTO ${this.tableName} (${this.fields.map(e=>e.name).join(", ")}) -VALUES`,valuesTemplate:`(${Array(this.fields.length).fill("?").join(", ")})`}}},Hxe=class t extends Eze{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${nT.FilePath}');`]);this.fields=[new Vxe(nT.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new KC(nT.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},Gxe=class t extends Eze{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${Aa.DocumentId}', '${Aa.ExtentStart}', '${Aa.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${Aa.UnqualifiedName}');`],`FOREIGN KEY(${Aa.DocumentId}) REFERENCES Document(${qK.Id}) ON DELETE CASCADE`);this.fields=[new KC(Aa.DocumentId),new Vxe(Aa.FullyQualifiedName,{notNull:!0}),new Vxe(Aa.UnqualifiedName,{notNull:!0}),new KC(Aa.CommentStart,{notNull:!0}),new KC(Aa.CommentLength,{notNull:!0}),new KC(Aa.NameStart,{notNull:!0}),new KC(Aa.NameLength,{notNull:!0}),new KC(Aa.BodyStart,{notNull:!0}),new KC(Aa.BodyLength,{notNull:!0}),new KC(Aa.ExtentStart,{notNull:!0}),new KC(Aa.ExtentLength,{notNull:!0}),new KC(Aa.SymbolKind,{notNull:!0}),new KC(Aa.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},$xe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},Vxe=class extends $xe{static{a(this,"StringColumn")}constructor(e,r){super(e,{notNull:r?.notNull}),this.collate=r?.collate??!1,this.noCase=r?.noCase??!1,this.unique=r?.unique??!1}initColumnString(){let e=this.collate?"COLLATE":void 0,r=this.noCase?"NOCASE":void 0,n=this.notNull?"NOT NULL":void 0,o=this.unique?"UNIQUE":void 0,s=[e,r,n,o].filter(c=>c).join(" ");return`'${this.name}' VARCHAR(500) ${s}`}},KC=class extends $xe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},j9t=class extends $xe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var vze=class{static{a(this,"SQLTable")}constructor(e){this.queryGenerator=this.createQueryGenerator(),this.init=this.doInit(e)}async doInit(e){let r=await e;if(r)return this.create(r),r}create(e){let r=this.queryGenerator.createTableQueries();for(let n of r)e.exec(n)}async insert(e,r){let n=await this.init;if(!n)return;let o=this.queryGenerator.insertQuery(r,e.length),c=e.map(l=>Object.values(l)).flat();n.prepare(o).run(...c)}async getAllRows(){let e=await this.init;return e?bze(e,`SELECT * FROM ${this.queryGenerator.tableName}`,[]):[]}async deleteRow(e){let r=await this.init;r&&Cze(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${qK.Id} = ?`,[e])}},nF=class t extends vze{static{a(this,"DocumentTable")}static{this.tableName=Hxe.tableName}createQueryGenerator(){return new Hxe}async updateTimestamp(e,r){let n=await this.init;n&&Cze(n,`UPDATE ${t.tableName} SET ${nT.LastWriteTimeUtc} = ? WHERE ${nT.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&Cze(r,`DELETE FROM ${t.tableName} WHERE ${nT.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?bze(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${nT.FilePath} = ?`,[e]):[]}},cm=class t extends vze{static{a(this,"SymbolTable")}static{this.tableName=Gxe.tableName}createQueryGenerator(){return new Gxe}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&Cze(r,`DELETE FROM ${t.tableName} WHERE ${Aa.DocumentId} = ?`,[e])}};function bze(t,e,r){let o=Array.isArray(r)?r:[r];return o.length>0?t.prepare(e).all(...o):t.prepare(e).all()}a(bze,"runDBQuery");function Cze(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(Cze,"runDBCommand");var T0n=fe(require("node:sqlite"));var Sze=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${nF.tableName} ON ${cm.tableName}.${Aa.DocumentId} = ${nF.tableName}.${qK.Id}`;this.db=this.initDb(e),this.documentTable=new nF(this.db),this.symbolTable=new cm(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new T0n.default.DatabaseSync(e,{open:!0});return r.exec(` +VALUES`,valuesTemplate:`(${Array(this.fields.length).fill("?").join(", ")})`}}},Hxe=class t extends Eze{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${nT.FilePath}');`]);this.fields=[new Vxe(nT.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new KC(nT.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},Gxe=class t extends Eze{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${Aa.DocumentId}', '${Aa.ExtentStart}', '${Aa.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${Aa.UnqualifiedName}');`],`FOREIGN KEY(${Aa.DocumentId}) REFERENCES Document(${jK.Id}) ON DELETE CASCADE`);this.fields=[new KC(Aa.DocumentId),new Vxe(Aa.FullyQualifiedName,{notNull:!0}),new Vxe(Aa.UnqualifiedName,{notNull:!0}),new KC(Aa.CommentStart,{notNull:!0}),new KC(Aa.CommentLength,{notNull:!0}),new KC(Aa.NameStart,{notNull:!0}),new KC(Aa.NameLength,{notNull:!0}),new KC(Aa.BodyStart,{notNull:!0}),new KC(Aa.BodyLength,{notNull:!0}),new KC(Aa.ExtentStart,{notNull:!0}),new KC(Aa.ExtentLength,{notNull:!0}),new KC(Aa.SymbolKind,{notNull:!0}),new KC(Aa.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},$xe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},Vxe=class extends $xe{static{a(this,"StringColumn")}constructor(e,r){super(e,{notNull:r?.notNull}),this.collate=r?.collate??!1,this.noCase=r?.noCase??!1,this.unique=r?.unique??!1}initColumnString(){let e=this.collate?"COLLATE":void 0,r=this.noCase?"NOCASE":void 0,n=this.notNull?"NOT NULL":void 0,o=this.unique?"UNIQUE":void 0,s=[e,r,n,o].filter(c=>c).join(" ");return`'${this.name}' VARCHAR(500) ${s}`}},KC=class extends $xe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},H9t=class extends $xe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var vze=class{static{a(this,"SQLTable")}constructor(e){this.queryGenerator=this.createQueryGenerator(),this.init=this.doInit(e)}async doInit(e){let r=await e;if(r)return this.create(r),r}create(e){let r=this.queryGenerator.createTableQueries();for(let n of r)e.exec(n)}async insert(e,r){let n=await this.init;if(!n)return;let o=this.queryGenerator.insertQuery(r,e.length),c=e.map(l=>Object.values(l)).flat();n.prepare(o).run(...c)}async getAllRows(){let e=await this.init;return e?bze(e,`SELECT * FROM ${this.queryGenerator.tableName}`,[]):[]}async deleteRow(e){let r=await this.init;r&&Cze(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${jK.Id} = ?`,[e])}},nF=class t extends vze{static{a(this,"DocumentTable")}static{this.tableName=Hxe.tableName}createQueryGenerator(){return new Hxe}async updateTimestamp(e,r){let n=await this.init;n&&Cze(n,`UPDATE ${t.tableName} SET ${nT.LastWriteTimeUtc} = ? WHERE ${nT.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&Cze(r,`DELETE FROM ${t.tableName} WHERE ${nT.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?bze(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${nT.FilePath} = ?`,[e]):[]}},cm=class t extends vze{static{a(this,"SymbolTable")}static{this.tableName=Gxe.tableName}createQueryGenerator(){return new Gxe}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&Cze(r,`DELETE FROM ${t.tableName} WHERE ${Aa.DocumentId} = ?`,[e])}};function bze(t,e,r){let o=Array.isArray(r)?r:[r];return o.length>0?t.prepare(e).all(...o):t.prepare(e).all()}a(bze,"runDBQuery");function Cze(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(Cze,"runDBCommand");var I0n=fe(require("node:sqlite"));var Sze=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${nF.tableName} ON ${cm.tableName}.${Aa.DocumentId} = ${nF.tableName}.${jK.Id}`;this.db=this.initDb(e),this.documentTable=new nF(this.db),this.symbolTable=new cm(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new I0n.default.DatabaseSync(e,{open:!0});return r.exec(` PRAGMA journal_mode = wal; PRAGMA synchronous = normal; PRAGMA optimize = 0x10002; @@ -2268,24 +2268,24 @@ VALUES`,valuesTemplate:`(${Array(this.fields.length).fill("?").join(", ")})`}}}, `),[e])}async querySymbolsContainingPosition(e,r){return this.query([`SELECT * FROM ${cm.tableName}`,this.innerJoinStatement,`WHERE ${nF.tableName}.${nT.FilePath} = ? AND ${cm.tableName}.${Aa.ExtentStart} <= ? AND (${cm.tableName}.${Aa.ExtentStart} + ${cm.tableName}.${Aa.ExtentLength}) >= ?`].join(` `),[e,r,r])}async querySymbolsContainedByRange(e,r,n){return this.query([`SELECT * FROM ${cm.tableName}`,this.innerJoinStatement,`WHERE ${nF.tableName}.${nT.FilePath} = ? AND ${cm.tableName}.${Aa.ExtentStart} >= ? AND (${cm.tableName}.${Aa.ExtentStart} + ${cm.tableName}.${Aa.ExtentLength}) <= ?`,`ORDER BY ${cm.tableName}.${Aa.ExtentStart}`].join(` `),[e,r,n])}async querySymbolsByQualifiedNamePrefix(e,r){return this.query([`SELECT * FROM ${cm.tableName}`,this.innerJoinStatement,`WHERE ${nF.tableName}.${nT.FilePath} = ? AND ${cm.tableName}.${Aa.FullyQualifiedName} LIKE ?`,`ORDER BY ${cm.tableName}.${Aa.ExtentStart}`].join(` -`),[e,`${r}%`])}async insertSymbols(e){return await this.symbolTable.insert(e,!1)}async insertDocument(e,r,n=!1){return await this.documentTable.insert([{filePath:e,lastWriteTimeUtc:r}],n)}async clearAllSymbolsFromDocument(e){return this.symbolTable.clearAllSymbolsFromDocument(e)}async updateDocumentTimestamp(e,r){return this.documentTable.updateTimestamp(e,r)}async deleteAllDocumentsWithPath(e){return this.documentTable.deleteAllWithPath(e)}async getAllDocuments(){return this.documentTable.getAllRows()}getDocument(e){return this.documentTable.getDocumentByFilePath(e)}async query(e,r){let n=await this.db;return n?(await this.documentTable.init,await this.symbolTable.init,bze(n,e,r)):[]}};var Tze=class{static{a(this,"SQLStorageReaderWriter")}constructor(e){this.database=new Sze(e)}async close(){await this.database.close()}async insertOrReplaceDocumentSymbolsAsync(e,r,n){let o=await this.getOrCreateDocumentAsync(e,r);await this.database.clearAllSymbolsFromDocument(o.id),n.length>0&&await this.database.insertSymbols(n.map(s=>({documentId:o.id,fullyQualifiedName:s.fullyQualifiedName,unqualifiedName:s.unqualifiedName,commentStart:s.commentRange.start,commentLength:s.commentRange.length,nameStart:s.nameRange.start,nameLength:s.nameRange.length,bodyStart:s.bodyRange.start,bodyLength:s.bodyRange.length,extentStart:s.extentRange.start,extentLength:s.extentRange.length,symbolKind:s.kind,refKind:s.refKind}))),await this.database.updateDocumentTimestamp(e,r)}async addDocumentsAsync(e){for(let r of e)r=r.toLowerCase(),await this.database.insertDocument(r,Date.now(),!0)}async deleteDocumentAsync(e){return await this.database.deleteAllDocumentsWithPath(e.toLowerCase())}async updateDocumentTimestampAsync(e,r){return await this.database.updateDocumentTimestamp(e.toLowerCase(),r)}async fuzzyMatchSymbolsAsync(e,r){return fue(await this.database.querySymbolsFuzzilyUsingUnqualifiedName(e,r))}async findPotentialDefinitionsAsync(e,r,n){let o=[],c=0;for(;cnew uw(e.filePath,e.fullyQualifiedName,e.unqualifiedName,new Iu(e.commentStart,e.commentLength),new Iu(e.nameStart,e.nameLength),new Iu(e.bodyStart,e.bodyLength),new Iu(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(fue,"symbolsToSymbolRanges");var xze=fe(require("fs/promises"));var Ize=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new Tze(e),this.symbolExtractors=r,this.importExtractors=n,this.params=o}dispose(){return this.storage.close()}get reader(){return this.storage}async indexFile(e,r){let n=ys(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await xze.stat(n)}catch{await this.storage.deleteDocumentAsync(e);return}let s=o.mtimeMs,c=await this.storage.getDocumentAsync(e);if(c&&c.lastWriteTimeUtc>=s)return;let l=this.symbolExtractors.get(r);if(!l)return;let u=(await xze.readFile(n)).toString(),d=await l.extractSymbols(e,u),f=d;if(this.params?.mlcpEnableImports){let h=this.importExtractors.get(r);if(h){let m=await h.extractSymbols(e,u);f=[...d,...m]}}await this.storage.insertOrReplaceDocumentSymbolsAsync(e,s,f)}async getDocumentFilePaths(){return(await this.storage.getDocumentsAsync()).map(r=>r.filePath)}};p();function H9t(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>IQo(r))}a(H9t,"isIndexWorkerData");var Wxe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},oq=class extends Wxe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},wze=class extends Wxe{constructor(r){super(__.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},__={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},Rze=class extends oq{constructor(r,n,o){super(r,__.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},kze=class extends oq{constructor(r,n){super(r,__.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},Pze=class extends oq{constructor(r,n,o){super(r,__.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},Dze=class extends oq{constructor(r,n){super(r,__.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},Nze=class extends oq{constructor(r,n,o,s,c,l){super(r,__.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},Mze=class extends oq{static{a(this,"ExitRequest")}constructor(e){super(e,__.Exit)}},n2=class extends Wxe{constructor(r,n,o){super(__.Response);this.id=r;this.error=n;this.data=o;n&&"code"in n&&typeof n.code=="string"&&(this.code=n.code)}static{a(this,"ResponseMessage")}};function IQo(t){return"databaseFilePath"in t&&"rootPath"in t}a(IQo,"isIndexableWorkspaceFolder");var I0n=fe(ii()),sq=require("worker_threads");var Oze=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new Ize(e,f0n,p0n,r),this.contextRetreival=new _ze(this.index.reader,d0n)}},G9t=class t{constructor(e,r,n){this.indices=new Map;this.cancellationTokens=new Map;this.params=n;for(let o of r){let s=un(o.rootPath);this.indices.set(s,new Oze(o.databaseFilePath,n))}this.port=e,this.port.on("message",o=>{o&&typeof o=="object"&&o.__perf__&&this.port?.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",o=>{this.dispatchMessage(o,this.indices,this.cancellationTokens)})}static{a(this,"IndexWorker")}async dispatchMessage(e,r,n){if(!e.__perf__)try{let o=new I0n.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case __.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case __.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case __.Cancel:n.get(e.id)?.cancel(),s=new n2(e.id,void 0,void 0);break;case __.Exit:s=await this.dispatchExit(e,r,o.token);break;case __.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case __.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case __.GetAllDocumentsInWorkspace:s=await t.GetAllDocumentsInWorkspaceRequest(e,r,o.token);break;default:this.port?.postMessage(new Error(`Unknown operation: ${e.operation}`))}s&&this.port?.postMessage(s),n.get(e.id)?.dispose(),n.delete(e.id)}catch(o){if(!(o instanceof Error))throw o;this.port?.postMessage(new n2(e.id,o,void 0))}}static async GetAllDocumentsInWorkspaceRequest(e,r,n){let o=un(e.baseWorkspaceFolderUri),s,c;return r.has(o)?c=await r.get(o).index.getDocumentFilePaths():s=new Error(`Index not found for ${e.baseWorkspaceFolderUri}`),new n2(e.id,s,c)}static async dispatchAddOrInvalidate(e,r,n){let o=un(e.fileUri),s=t.getIndexInfo(o,r)?.index,c;return s?await s.indexFile(e.fileUri,e.languageId):c=new Error(`Index not found for ${e.fileUri}`),new n2(e.id,c,void 0)}static async dispatchGetContext(e,r,n){let o=un(e.fileUri),s=t.getIndexInfo(o,r)?.contextRetreival,c,l;return s?l=await s.getStringifiedContextAtPositionAsync(e.fileUri,e.code,e.offset,e.languageId,e.params,8e3,n):c=new Error(`ContextRetrieval not found for ${e.fileUri}`),new n2(e.id,c,l)}async dispatchExit(e,r,n){for(let o of r.values())await o.index.dispose();r.clear(),this.port?.postMessage(new n2(e.id,void 0,void 0)),this.port?.close()}static dispatchCreateIndex(e,r,n){let o=un(e.baseWorkspaceFolderUri);return r.has(o)||r.set(o,new Oze(e.databaseFilePath)),new n2(e.id,void 0,void 0)}static async dispatchRemoveIndex(e,r,n){let o=un(e.baseWorkspaceFolderUri);if(r.has(o)){let s=r.get(o);s&&await s.index.dispose(),r.delete(o)}return new n2(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function x0n(){return H9t(sq.workerData)}a(x0n,"isIndexWorker");function w0n(){let t=sq.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!H9t(sq.workerData))throw new Error("Worker data must provide a valid database path.");let e=sq.workerData.cwd;process.cwd=()=>e,new G9t(t,sq.workerData.indexWorkspaceRoots,sq.workerData.params)}a(w0n,"runIndexWorker");p();p();var zxe=require("fs"),R0n=require("path");var aq=class extends Go{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await zxe.promises.readFile(un(e),r)}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink(un(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=un(e),n=await zxe.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,R0n.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await zxe.promises.lstat(e);if(r.isSymbolicLink())try{let n=await zxe.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=0;return e.isFile()&&(o=1),e.isDirectory()&&(o=2),r.isSymbolicLink()&&n&&(o|=64),o}};p();p();var UA=class{constructor(){this.resolve=a(()=>{},"resolve");this.reject=a(()=>{},"reject");this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}static{a(this,"Deferred")}};function JC(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(JC,"delay");async function ZC(t,e,r){let n=new Array(t.length),o=Math.floor(e)>0?Math.floor(e):1,s=Math.max(1,Math.min(o,t.length)),c=0,l=a(async()=>{for(let u=c++;ul())),n}a(ZC,"mapWithConcurrency");function pue(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(pue,"fireAndForget");function k0n(t){let e=Math.floor(t)>0?Math.floor(t):1,r=0,n=[],o=a(()=>rn.push(()=>{r++,c()})),"acquire"),s=a(()=>{r--,n.shift()?.()},"release");return{async run(c){await o();try{return await c()}finally{s()}}}}a(k0n,"createLimiter");function LO(t,e,r){return new Promise(n=>{let o=!1,s=setTimeout(()=>{o||(o=!0,n(r))},e),c=a(l=>{o||(o=!0,clearTimeout(s),n(l))},"finish");t.then(c,()=>c(r))})}a(LO,"withTimeout");function hue(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(hue,"safeInit");async function xQo(t){if(t.isCancellationRequested)return;let e=new UA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(xQo,"cancellationTokenToPromise");async function P0n(t,e){if(e){let r=xQo(e);await Promise.race([t,r])}else await t}a(P0n,"raceCancellation");function $9t(t){return Array.isArray(t)}a($9t,"isArrayOfT");async function D0n(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await V9t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(D0n,"resolveAll");async function V9t(t,e){let r;return t instanceof Promise?r=await wQo(t,e):r=await RQo(t,e),r}a(V9t,"resolve");async function wQo(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{let s=await t;if(e?.isCancellationRequested)return;n={status:"full",resolutionTime:0,value:$9t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await P0n(o,e),n.resolutionTime=performance.now()-r,n}a(wQo,"resolvePromise");async function RQo(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{for await(let s of t){if(e?.isCancellationRequested)return;n.status!="partial"&&(n={status:"partial",resolutionTime:0,value:[]}),n.value.push(s)}e?.isCancellationRequested||(n.status!=="partial"?n={status:"full",resolutionTime:0,value:[]}:n.status="full")}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await P0n(o,e),n.resolutionTime=performance.now()-r,n}a(RQo,"resolveIterable");p();p();var Lze="[...]",kQo=0,XC=-1;function kf(){return kQo++}a(kf,"getAvailableNodeId");function PQo(t,e){let r=t.children.map(n=>n.elisionMarker??e);return[...t.text.entries()].map(([n,o])=>n===0?o:r[n-1]+o).join("")}a(PQo,"elideChildren");function N0n(t,e=Lze){return r=>t.tokenLength(PQo(r,e))}a(N0n,"getTokenizerCostFunction");p();var lq=class{static{a(this,"PriorityQueue")}constructor(e){if(this.heap=e?[...e]:[],this.heap.length>0)for(let r=Math.floor(this.heap.length/2)-1;r>=0;r--)this.siftDown(r)}get size(){return this.heap.length}insert(e,r){let n={item:e,priority:r};this.heap.push(n);let o=this.heap.length-1;this.siftUp(o)}peek(){return this.heap.length===0?null:this.heap[0]}pop(){if(this.heap.length===0)return null;let e=this.heap[0],r=this.heap.pop();return this.heap.length>0&&(this.heap[0]=r,this.siftDown(0)),e}clear(){let e=this.heap;return this.heap=[],e}siftUp(e){let r=this.heap[e];for(;e>0;){let n=Math.floor((e-1)/2);if(this.heap[n].priority>=r.priority)break;this.heap[e]=this.heap[n],e=n}this.heap[e]=r}siftDown(e){for(;ethis.heap[r].priority&&(r=n),othis.heap[r].priority&&(r=o),r===e)break;let s=this.heap[e];this.heap[e]=this.heap[r],this.heap[r]=s,e=r}}};function DQo(t){let e={id:t.id??kf(),text:t.text??new Array((t.children?.length??0)+1).fill(""),children:t.children??[],cost:t.cost??1,weight:t.weight??0,rectifiedWeight:t.rectifiedWeight,canMerge:t.canMerge??!1,elisionMarker:t.elisionMarker??Lze,requireRenderedChild:t.requireRenderedChild??!1};if(e.text.length!==e.children.length+1)throw new Error(`RenderNode text length (${e.text.length}) must be children length + 1 (${e.children.length+1})`);return e}a(DQo,"createRenderNode");function NQo(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a(NQo,"isRenderedChildRequired");function M0n(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(M0n,"rectifiedValue");function Yxe(t,e){let r=O0n(t,e);for(let{item:n,priority:o}of r.clear())for(let s of n.nodes)s.rectifiedWeight=o*Math.max(s.cost,1)}a(Yxe,"rectifyWeights");function O0n(t,e){let r=t.children.map(s=>O0n(s,e));if(t.weight=Math.max(0,e?e(t):t.weight),t.weight===0&&r.reduce((s,c)=>s+c.size,0)===0)return new lq([]);let n=new lq(r.flatMap(s=>s.clear())),o={nodes:[t],totalCost:t.cost,totalWeight:t.weight};for(;(n.peek()?.priority??0)>o.totalWeight/Math.max(o.totalCost,1);){let{item:s}=n.pop();o.nodes.push(...s.nodes),o.totalCost+=s.totalCost,o.totalWeight+=s.totalWeight}return n.insert(o,o.totalWeight/Math.max(o.totalCost,1)),n}a(O0n,"recursivelyRectifyWeights");function L0n(t,e={}){let{budget:r,mask:n,costFunction:o}=e,s=n??[],c=new Set(Array.isArray(s)?s:[s]);if((r??t.cost)c.has(_.id),"elider"),m=[],g=new Map;if(z9t(t,m,h,g),m.length===0)return W9t(t,o);let A=m.join(""),y=o?o(A):[...g.values()].reduce((_,E)=>_+E.cost,0);return{text:A,cost:y,renderedNodes:g}}let l=new Map,u=[],d=new lq([{item:t,priority:M0n(t)}]),f=r;for(;f>0&&d.size>0;){let{item:h}=d.pop();if(!c.has(h.id)&&h.cost<=f){f-=h.cost,l.set(h.id,h),u.push(h);for(let m of h.children)d.insert(m,M0n(m))}}for(;l.size>0;){let h=[],m=a(_=>!l.has(_.id),"elider"),g=new Map;if(z9t(t,h,m,g),h.length===0)return W9t(t,o);let A=h.join("");if(o===void 0){let _=[...g.values()].reduce((E,v)=>E+v.cost,0);return{text:A,cost:_,renderedNodes:g}}let y=o(A);if(y<=r)return{text:A,cost:y,renderedNodes:g};for(l=g;u.length>0&&y>r;){let _=u.pop();l.has(_.id)&&(y-=_.cost,l.delete(_.id))}if(u.length===0)break}return W9t(t,o)}a(L0n,"render");function W9t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(W9t,"renderEmpty");function z9t(t,e,r,n,o=!1){let s=e.length;if(r(t))return s>=2&&(o||e[s-2]===t.elisionMarker&&e[s-1].trim().length===0)?(e.pop(),!1):(e.push(t.elisionMarker),!1);let c=NQo(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=z9t(d,e,r,n,d.canMerge&&!l),c&&=!l;if(c){for(;e.length>s;)e.pop();return!1}return e.push(t.text[t.text.length-1]??""),n.set(t.id,t),!0}a(z9t,"recursivelyRender");function Kxe(t,e,r=Lze){let n=t.children.map(c=>Kxe(c,e,r));r=t.elisionMarker??r;let o=e(t);return DQo({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(Kxe,"snapshot");var uq={id:kf(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var i2=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var Fze={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function MQo(t,e,r=Fze,n){let o=n?.get(e);if(o!==void 0)return o;let s;try{s=await t.readDirectory(e)}catch{}if(s===void 0||r.MaxDirectorySize!==void 0&&s.length>r.MaxDirectorySize)return n?.set(e,"Invalid",r.InvalidCacheTime),"Invalid";let c={documents:[],directories:[]};for(let[l,u]of s){let d=Oa(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(MQo,"getDirectoryChildren");function OQo(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=Cf(e);for(;o.startsWith(r);){n.push(o);let s=Cf(o);if(s.length>=o.length)break;o=s}return n}a(OQo,"getAncestors");function LQo(t,e,r=Fze.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=OQo(t,l.uri);if(u.length===0){n.set(l.uri,new Set);continue}let d;for(let f of u){if(d!==void 0){let h=o.get(f)??new Set;h.add(d),o.set(f,h)}d=f}s.set(l.uri,d),n.set(l.uri,new Set(u))}for(let l of e){let u=[],d=n.get(l.uri);if(!(!d||d.size===0))for(u.push({uri:s.get(l.uri),weight:l.weight*Math.pow(r,d.size)});u.length>0;){let f=u.pop();c.set(f.uri,(c.get(f.uri)??0)+f.weight);let h=o.get(f.uri)??new Set;for(let m of h){let g=f.weight;d.has(m)?g/=r:g*=r,u.push({uri:m,weight:g})}}}return c}a(LQo,"getAncestorWeights");async function*Y9t(t,e,r,n,o,s){let c={...Fze,...r},l=c.MaxResults,u=c.Decay,d=LQo(t,e,u),f=new lq([...d.entries()].map(([m,g])=>({item:m,priority:g}))),h=0;for(;f.size>0;){let{item:m,priority:g}=f.pop(),A=await MQo(t,m,c,n);if(s?.isCancellationRequested)return;if(A!=="Invalid"){for(let y of A.documents)if(!o||o(y)){try{if((await t.stat(y)).size>c.MaxFileBytes)continue}catch{continue}if(yield{uri:y,weight:g},h++,h>=l)return}for(let y of A.directories)d.has(y)||(f.insert(y,g*u),d.set(y,g*u))}}}a(Y9t,"getNearbyDocuments");var Bze=class extends i2{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=Fze;this.cache=new aP(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of Y9t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function Ag(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(Ag,"setDefault");var BQo={MaxActiveSymbols:500,SymbolCacheSize:1e6},Uze=class extends i2{constructor(){super(...arguments);this.config=BQo;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new Sn(this.config.SymbolCacheSize);this.textSymbols=new Sn(this.config.SymbolCacheSize);this.nextSymbolId=0}static{a(this,"SymbolContextProvider")}getContext(r,n,o,s){this.updateSymbolIndex(r,o);let c=this.getWeightedSymbols(n);return Promise.resolve(this.getWeightedNodes(c))}updateSymbolIndex(r,n){for(let{id:o}of r.getInvalidatedNodes()){let s=this.nodeToSymbol.get(o);if(this.nodeToSymbol.delete(o),this.nodeValency.delete(o),s)for(let[c,l]of s.entries()){let u=this.symbolToNode.get(c);u?.delete(o),u?.size===0?(this.symbolToNode.delete(c),this.symbolValency.delete(c),this.identifierSymbols.delete(c)):this.symbolValency.has(c)&&this.symbolValency.set(c,Math.max(1,(this.symbolValency.get(c)??0)-l))}}for(let{id:o}of r.getCreatedNodes()){let s=n.getNode(o);s!==void 0&&this.extractSymbols(s.document,s.node)}}getWeightedSymbols(r){let n=new Map;for(let{id:s,weight:c}of r.nodes){let l=this.nodeValency.get(s)??0,u=[],d=0;for(let[f,h]of this.nodeToSymbol.get(s)??[]){let m=this.symbolValency.get(f);if((m??0)<1)continue;let g=h/(Math.max(l,1)*Math.max(1,m));u.push({symbolId:f,nodeSymbolWeight:g}),d+=g}d=Math.max(d,1);for(let{symbolId:f,nodeSymbolWeight:h}of u)n.set(f,(n.get(f)??0)+c*h/d)}return[...n.entries()].map(([s,c])=>({symbolId:s,symbolWeight:c,symbolValency:this.symbolValency.get(s)})).filter(({symbolValency:s})=>(s??0)>0).sort((s,c)=>c.symbolWeight/c.symbolValency-s.symbolWeight/s.symbolValency).slice(0,this.config.MaxActiveSymbols)}getWeightedNodes(r){let n=[];for(let{symbolId:o,symbolWeight:s,symbolValency:c}of r){let l=this.identifierSymbols.has(o)?"SymbolContextProvider.Identifiers":"SymbolContextProvider.Text";for(let[u,d]of this.symbolToNode.get(o)??[]){let f=s*d/Math.max(c,this.nodeValency.get(u)??d);n.push({id:u,weight:f,source:l})}}return n}extractSymbols(r,n){if(this.nodeToSymbol.has(n.id))return;let o=new Map;this.nodeToSymbol.set(n.id,o);let s=0;for(let c of n.syntaxNodes()){let l=r.document.getText(c.range);if(this.isIdentifier(r,c,l)){let u=Ag(this.identifiers,l,()=>this.createSymbol(!0));o.set(u,(o.get(u)??0)+1),s+=1}if(this.isText(r,c,l)||this.isIdentifier(r,c,l))for(let u of K9t(l)){let d=Ag(this.textSymbols,u,()=>this.createSymbol());o.set(d,(o.get(d)??0)+1),s+=1}}this.nodeValency.set(n.id,s);for(let[c,l]of o.entries())Ag(this.symbolToNode,c,()=>new Map).set(n.id,l),this.symbolValency.set(c,(this.symbolValency.get(c)??0)+l)}createSymbol(r=!1){let n=this.nextSymbolId++;return r&&this.identifierSymbols.add(n),n}isText(r,n,o){return r.parser.labeler.isText?.(n)??(n.children.length===0&&o.search(/\s/)>=0)}isIdentifier(r,n,o){return r.parser.labeler.isIdentifier?.(n)??(n.children.length===0&&B0n(o))}},FQo=/^[a-zA-Z_]{2,}\w+$/;function B0n(t){return FQo.test(t)}a(B0n,"isSymbol");function UQo(t){return t.toLowerCase()}a(UQo,"normalizeWord");function*K9t(t){for(let e of t.split(/\W/))B0n(e)&&(yield UQo(e))}a(K9t,"getTextSymbols");var QQo={MaxDirectorySize:50,MaxResults:50,Decay:.5,CacheSize:1e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:1*1024*1024,MaxActiveSymbols:500,DebouncedRemovalThreshold:3,UpdateDebounceTimeout:500,SymbolCacheSize:1e5},Qze=class extends Uze{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=QQo;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new aP(this.config.CacheSize,this.config.CacheTime);this.debouncedExpirationCount=new Map;this.updateDebounce=new Map;this.currentlyUpdating=new Set;this.isUpdatingIndex=!1;this.fileSystem.onDidFileChange(o=>{let s=o.document.uri;this.documentToSymbols.has(s)&&this.debouncedReadOrUpdateDocument(s)})}static{a(this,"IndexingSymbolContextProvider")}async getContext(r,n,o,s){super.updateSymbolIndex(r,o),await this.updateDocumentIndex(n);let c=super.getWeightedSymbols(n),l=super.getWeightedNodes(c),u=this.getWeightedDocuments(c);return[...l,...u]}getWeightedDocuments(r){let n=[];for(let{symbolId:o,symbolWeight:s}of r)for(let[c,l]of this.symbolToDocuments.get(o)??[]){let u=l/Math.max(1,this.documentValency.get(c)??1),d=Math.log(Math.max(this.documentToSymbols.size,1)/Math.max(1,this.symbolToDocuments.get(o)?.size??1)),f=s*u*d;n.push({source:"IndexingSymbolContextProvider.Text",uri:c,weight:f})}return n}debouncedReadOrUpdateDocument(r){this.updateDebounce.has(r)&&clearTimeout(this.updateDebounce.get(r)),this.updateDebounce.set(r,setTimeout(()=>{this.updateDebounce.delete(r),this.readOrUpdateDocument(r)},this.config.UpdateDebounceTimeout))}async readOrUpdateDocument(r){try{if(this.currentlyUpdating.has(r))return;if(this.documentManager.normalizeUri(r)===void 0){this.removeFromIndex(r);return}this.currentlyUpdating.add(r);let n=await this.fileSystem.readFileString({uri:r}),o=new Map,s=0;for(let l of K9t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=Ag(this.textSymbols,l,()=>this.createSymbol(!1));Ag(this.symbolToDocuments,d,()=>new Map).set(r,u),c.push(d)}this.documentValency.set(r,s),this.documentToSymbols.set(r,c)}catch{this.removeFromIndex(r)}finally{this.currentlyUpdating.delete(r)}}async updateDocumentIndex(r){if(!this.isUpdatingIndex){this.isUpdatingIndex=!0;try{for(let s of this.documentToSymbols.keys())this.debouncedExpirationCount.set(s,(this.debouncedExpirationCount.get(s)??0)+1);let n=a(s=>this.documentManager.normalizeUri(s)!==void 0,"filter");for await(let{uri:s}of Y9t(this.fileSystem,r.documents,this.config,this.cache,n))this.documentToSymbols.has(s)||await this.readOrUpdateDocument(s),this.debouncedExpirationCount.delete(s);let o=[...this.debouncedExpirationCount.entries()].filter(([s,c])=>c>=this.config.DebouncedRemovalThreshold&&!this.currentlyUpdating.has(s)&&!this.updateDebounce.has(s));for(let[s]of o)this.removeFromIndex(s),this.debouncedExpirationCount.delete(s)}finally{this.isUpdatingIndex=!1}}}removeFromIndex(r){this.documentValency.delete(r);for(let n of this.documentToSymbols.get(r)??[]){let o=this.symbolToDocuments.get(n);o?.delete(r),o?.size===0&&this.symbolToDocuments.delete(n)}this.documentToSymbols.delete(r)}};p();function F0n(t){return t.nodeId!==void 0}a(F0n,"isNodeLocation");var U0n={"RecentDocumentProvider.RecentlyFocused":{maxEventCount:100,halflife:1e3*60*5,isImpulse:!1},"RecentDocumentProvider.RecentlyEdited":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!0},"RecentDocumentProvider.RecentlyOpen":{maxEventCount:100,halflife:1e3*60*5,isImpulse:!1},RecentCompletionsRequestProvider:{maxEventCount:100,halflife:1e3*60*5,isImpulse:!0},"ExtensionActivityProvider.CurrentSelection":{maxEventCount:1,halflife:1e5,isImpulse:!0},"ExtensionActivityProvider.PrimarySelection":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1},"ExtensionActivityProvider.Selection":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1},"ExtensionActivityProvider.VisibleRange":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1}},qze=class extends i2{constructor(){super(...arguments);this.eventsByType=new Map;this.nextId=0}static{a(this,"RecentActivityProvider")}getContext(r,n,o,s){let c=performance.now(),l=[];for(let[u,d]of this.eventsByType.entries()){let f=U0n[u],h=[...d.values()].sort((g,A)=>A.timestamp-g.timestamp),m=1;for(let g of h){this.resolveRanges(g,o);let A=.5**((c-g.timestamp)/f.halflife),y=f.isImpulse?A:m-A;m=A;for(let _ of g.locations)F0n(_)?l.push({weight:y,uri:_.uri,id:_.nodeId,source:u}):l.push({weight:y,uri:_.uri,source:u})}}return Promise.resolve(l)}resolveRanges(r,n){if(r.isFullyResolved)return;let o=!0,s=[];for(let c of r.locations)if(F0n(c))s.push(c);else if(c.range&&c.range.start!==void 0&&c.range.end!==void 0){let l=n.getDocument(c.uri)?.document;if(l!==void 0){let u=l.findNode(l.document.offsetAt(c.range.start),l.document.offsetAt(c.range.end));s.push({uri:c.uri,nodeId:u.id})}else o=!1,s.push(c)}else s.push({uri:c.uri,nodeId:XC});r.locations=s,r.isFullyResolved=o}recordEvent(r,n,o){let s=U0n[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};Ag(this.eventsByType,r,()=>new Sn(s.maxEventCount)).set(++this.nextId,c)}};p();var jze=class extends i2{constructor(){super(...arguments);this.nodeParent=new Map;this.nodeChildren=new Map}static{a(this,"TreeProximityProvider")}getContext(r,n,o,s){this.updateIndex(r,o,s);let c=new Map,l=new Map,u=new Map;for(let{id:f,weight:h}of n.nodes){let m=this.nodeParent.get(f)??XC,g=this.nodeChildren.get(m)?.size??0;g>0&&c.set(m,(c.get(m)??0)+h/g);let A=this.nodeChildren.get(f);if(A&&A.size>0)for(let _ of A)l.set(_,(l.get(_)??0)+h/A.size);let y=this.nodeChildren.get(m);if(y&&y.size>1)for(let _ of y)_!==f&&u.set(_,(u.get(_)??0)+h/y.size)}let d=[...[...c.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Parent"})),...[...l.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Children"})),...[...u.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Siblings"}))];return Promise.resolve(d)}updateIndex(r,n,o){for(let{id:s}of r.getInvalidatedNodes())this.nodeParent.delete(s),this.nodeChildren.delete(s);for(let{id:s}of r.getCreatedNodes()){let c=n.getNode(s),l=new Set;if(c!==void 0)for(let u of c.node.children)this.nodeParent.set(u.id,s),l.add(u.id);l.size>0&&this.nodeChildren.set(s,l)}}};p();function qQo(t){return t.id!==void 0}a(qQo,"isNodeItem");function jQo(t){return!("uri"in t)&&!("id"in t)}a(jQo,"isNullItem");var Q0n={"RecentDocumentProvider.RecentlyOpen":.1,"RecentDocumentProvider.RecentlyFocused":.1,"RecentDocumentProvider.RecentlyEdited":.1,RecentCompletionsRequestProvider:1,"ExtensionActivityProvider.CurrentSelection":5,"ExtensionActivityProvider.PrimarySelection":2,"ExtensionActivityProvider.Selection":.2,"ExtensionActivityProvider.VisibleRange":1,FileDirectoryDocumentProvider:.05,"SymbolContextProvider.Identifiers":.2,"SymbolContextProvider.Text":.2,"IndexingSymbolContextProvider.Text":1,"TreeProximityProvider.Parent":.3,"TreeProximityProvider.Children":.3,"TreeProximityProvider.Siblings":.3,"ExtensionReferenceProvider.References":.2,"ExtensionReferenceProvider.Definitions":1};function q0n(t){return t in Q0n}a(q0n,"isSourceId");var dq="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",mue=class{static{a(this,"WorkspaceContextWeights")}constructor(e){let r=new Map;for(let{uri:n,weight:o}of e)r.set(n,(r.get(n)??0)+o);this.documents=[...r.entries()].map(([n,o])=>({uri:n,weight:o})).sort((n,o)=>o.weight-n.weight),this.docWeights=r,this.nodes=e.filter(({id:n})=>n!==XC),this.nodeWeights=new Map(e.map(({id:n,weight:o})=>[n,o]))}getNodeWeight(e){return this.nodeWeights.get(e)??0}getDocumentWeight(e){return this.docWeights.get(e)??0}},Hze=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=Q0n;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new mue([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new mue(r.items):new mue([])}return this.weights}updateWeights(){let e=new Map,r=0,n=this.config.StaleWeightHalflife;for(let[o,{items:s,updateTime:c}]of this.sourceContext.entries()){let l=this.sourceWeights[o]??0;if(l<=0||s.length===0)continue;let u=.5**(-Math.max(0,(this.prevUpdateTime??c)-c)/n);l*=u,r+=l,this.aggregateWeights(s,e,l,!0)}if(r>0){if(this.weights.nodes.length>0){let o=r*this.config.Laziness,s=this.prevItems;this.aggregateWeights(s,e,o,!0)}for(let[o,s]of e.entries()){let c=this.activeContext.getDocument(o)?.document;if(c===void 0)continue;let l=s.get(XC);if(l!==void 0&&l>0){s.delete(XC);let u=0;for(let d of s.values())u+=d;if(u<=0){let d=c.getAllIds(),f=l/Math.max(d.length,1);for(let h of d)s.set(h,f)}else for(let[d,f]of[...s.entries()])s.set(d,f+l*(f/u))}}this.prevItems=this.truncateAndNormalize(e),this.weights=new mue(this.prevItems)}return this.prevUpdateTime=performance.now(),this.weights}pushWorkspaceContext(e,r){let n=performance.now(),o=this.addUriAndId(r),s=new Map;this.aggregateWeights(o,s);let c=this.truncateAndNormalize(s);this.sourceContext.set(e,{items:c,updateTime:n})}addUriAndId(e){return e.filter(r=>r.weight>0).map(r=>{if(jQo(r))return{weight:r.weight,uri:dq,id:XC};let n=qQo(r)?r.id:XC,o=r.uri??this.activeContext.getUri(n)??dq;return o===dq&&(n=XC),{weight:r.weight,uri:o,id:n}})}aggregateWeights(e,r,n=1,o=!1){for(let{uri:s,id:c,weight:l}of e){if(l<=0||isNaN(l))continue;let u=Ag(r,s,()=>new Map),d=XC;(!o||this.activeContext.getUri(c)!==void 0)&&(d=c),u.set(d,(u.get(d)??0)+l*n)}}truncateAndNormalize(e){let r=[],n=new Map,o=0;for(let[u,d]of e.entries()){let f=u!==dq?this.activeContext.normalizeUri(u)??dq:dq;for(let[h,m]of d.entries())u===dq||h===XC?n.set(f,(n.get(f)??0)+m):r.push({uri:f,id:h,weight:m}),o+=m}if(o<=0)return[];n.delete(dq),r.sort((u,d)=>d.weight-u.weight);for(let{uri:u,weight:d}of r.slice(this.config.MaxActiveNodes,r.length))n.set(u,(n.get(u)??0)+d);let s=[...n.entries()].sort((u,d)=>d[1]-u[1]).slice(0,this.config.MaxActiveFiles).map(([u,d])=>({uri:u,id:XC,weight:d}));return r.slice(0,this.config.MaxActiveNodes).concat(s).sort((u,d)=>d.weight-u.weight).map(u=>({...u,weight:u.weight/o}))}};p();p();p();var J9t=class{constructor(e,r,n,o=!1){this.id=e;this.parts=r;this.text=n;this.canMerge=o}static{a(this,"ContextNode")}get startOffset(){return this.parts[0].root.startOffset}get endOffset(){return this.parts[this.parts.length-1].root.endOffset}get syntaxRoots(){return this.parts.map(e=>e.root)}get children(){return this.parts.flatMap(e=>e.children)}get syntaxLimits(){return this.children.flatMap(e=>e.syntaxRoots)}*syntaxNodes(){let e=new Set(this.syntaxLimits.map(r=>r.id));for(let r of this.syntaxRoots)yield*j0n(r,e)}findChild(e,r){if(ethis.endOffset||r=r)break;s.root.endOffset=r)break;c.endOffsets.root.startOffset-c.root.startOffset);let n=GQo(e,this.document),o=new J9t(kf(),e,n,r);return this.nodeById.set(o.id,o),o}buildTree(){let e=this.buildRecursively(this._syntaxRoot);return this.createNode([{root:this._syntaxRoot,children:e}])}buildRecursively(e){if(e.endOffset-e.startOffset({root:o,children:this.buildRecursively(o)}));if(this.canMergeChildren(e))return this.mergeChildren(r);let n=[];for(let{root:o,children:s}of r){if(this.canBeNode(o)&&o.endOffset-o.startOffset-s.reduce((l,u)=>l+(u.endOffset-u.startOffset),0)>=this.minSize){n.push(this.createNode([{root:o,children:s}]));continue}n.push(...s)}return n}mergeChildren(e){if(e.length===0)return[];e.sort((m,g)=>m.root.startOffset-g.root.startOffset);let r=e[e.length-1].root.endOffset-e[0].root.startOffset,n=[];for(let m of e){let g=m.root.endOffset-m.root.startOffset;for(let A of m.children){let y=A.endOffset-A.startOffset;g-=y,r-=y}n.push(g)}if(rm.children);let o=[0],s=0,c=null,l={line:-1,size:-1},u=e[0].root.startOffset,d=e[0].root.range.start.line;for(let m=0;mthis.minSize&&sl.line||A.line==l.line&&A.size>l.size)&&(l=A,c=m)}u=g.root.endOffset,d=g.root.range.end.line,s>=this.maxSize&&(c=c??m,o.push(c+1),m=c,s=0,c=null,l={line:-1,size:-1},u=e[m+1]?.root.startOffset,d=e[m+1]?.root.range.start.line)}o.length==1?o.push(e.length):o[o.length-1]!==e.length&&(o[o.length-1]=e.length);let f=[],h=!1;for(let m=0;mHQo}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function GQo(t,e){if(t.length===0)return[""];let r=[],n=e.positionAt(t[0].root.startOffset);for(let s of t.flatMap(c=>c.children).sort((c,l)=>c.startOffset-l.startOffset)){let c=e.positionAt(s.startOffset);r.push(e.getText({start:n,end:c})),n=e.positionAt(s.endOffset)}let o=e.positionAt(t[t.length-1].root.endOffset);return r.push(e.getText({start:n,end:o})),r}a(GQo,"buildText");function*j0n(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*j0n(r,e))}a(j0n,"walk");p();p();p();var $ze=class{constructor(e,r,n,o,s,c){this.id=e;this.raw=r;this.children=n;this.source="indentation";this.parent=null;let l={start:{line:o,character:0},end:{line:s,character:c.lineAt(s).text.length}},u=c.getText(l),d=u.search(/\S/);if(d===-1){let m={line:s,character:0};this.startOffset=c.offsetAt(m),this.endOffset=this.startOffset,this.range={start:m,end:m};return}let f=u.search(/\S(?!.*\S)/s),h=c.offsetAt(l.start);this.startOffset=h+d,this.endOffset=h+f+1,this.range={start:c.positionAt(this.startOffset),end:c.positionAt(this.endOffset)}}static{a(this,"IndentationNode")}get type(){return this.raw.type}};function Z9t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:Z9t(u,e,r)})).filter(u=>u.node!==null).sort((u,d)=>u.node.startOffset-d.node.startOffset),o=[],s=e;for(let u=n.length-1;u>=0;u--){let{subtree:d,node:f}=n[u];if(f.range.end.line>=s){let h=Z9t(d,s,r);h!==null&&(o.push(h),s=Math.min(h.range.start.line,s))}else o.push(f),s=Math.min(f.range.start.line,s)}o.sort((u,d)=>u.startOffset-d.startOffset);let c=e,l=0;if(o.length>0&&(c=Math.min(c,o[0].range.start.line),l=Math.max(l,o[o.length-1].range.end.line)),(t.type==="blank"||t.type==="line")&&(c=Math.min(c,t.lineNumber),l=Math.max(l,t.lineNumber),t.type==="blank"&&c===l))return null;if(l=Math.min(l,e-1),c<=l){let u=new $ze(kf(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(Z9t,"recursivelyBuildNode");function H0n(t){let e=QK(t.getText(),t.detectedLanguageId);return Z9t(e,t.lineCount,t)??new $ze(kf(),e,[],0,t.lineCount-1,t)}a(H0n,"parse");var Vze={source:"indentation",parse:H0n,update(t,e){return{root:H0n(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var $0n=fe(eue());function G0n(t){return{line:t.row,character:t.column}}a(G0n,"asPosition");var BO=class{constructor(e,r,n,o){this.nodeList=e;this.mergeList=r;this.identifierList=n;this.textList=o}static{a(this,"BasicNodeLabeler")}canBeNode(e){return this.nodeList.has(e.type)}canMergeChildren(e){return this.mergeList.has(e.type)}isIdentifier(e){return this.identifierList.has(e.type)}isText(e){return this.textList.has(e.type)}},fq=class{constructor(e,r,n={}){this.language=e;this.source=r;this.labeler=n}static{a(this,"TreeSitterParser")}dispose(){}parse(e){let r,n;try{return r=new $0n.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return Vze.parse(e)}finally{n?.delete(),r?.delete()}}update(e,r){return{root:this.parse(r),remapper:a(()=>{},"remapper")}}snapshot(e,r){let n={id:e.id,source:this.source,type:e.type,startOffset:e.startIndex,endOffset:e.endIndex,range:{start:G0n(e.startPosition),end:G0n(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var $Qo=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),VQo=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),WQo=new Set(["identifier"]),zQo=new Set(["string","comment"]),V0n=new BO($Qo,VQo,WQo,zQo);p();var YQo=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),KQo=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),JQo=new Set(["identifier"]),ZQo=new Set(["string_literal","line_comment","block_comment"]),W0n=new BO(YQo,KQo,JQo,ZQo);p();var XQo=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),eqo=new Set(["module","block","parameters","dictionary","list"]),tqo=new Set(["identifier"]),rqo=new Set(["string","comment"]),z0n=new BO(XQo,eqo,tqo,rqo);p();var nqo=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),iqo=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),oqo=new Set(["identifier"]),sqo=new Set(["string","comment"]),Y0n=new BO(nqo,iqo,oqo,sqo);var K0n=fe(eue());async function J0n(t){await K0n.default.init();try{let e=await s9t(t);switch(t){case"python":return new fq(e,"tree-sitter-python",z0n);case"typescript":return new fq(e,"tree-sitter-typescript",Y0n);case"java":return new fq(e,"tree-sitter-java",W0n);case"cpp":return new fq(e,"tree-sitter-cpp",V0n);default:return new fq(e,"tree-sitter-generic")}}catch{return Vze}}a(J0n,"getParser");var X9t=class{constructor(e,r){this.created=e;this.invalidated=r;this.updatedDocuments=Array.from(new Set([...e.entries(),...r.entries()].filter(([n,o])=>o.size>0).map(([n,o])=>n)))}static{a(this,"WorkspaceContextChanges")}getInvalidatedNodes(e){return this.getNodes(this.invalidated,e)}getCreatedNodes(e){return this.getNodes(this.created,e)}getNodes(e,r){return r===void 0?Array.from(e.entries()).flatMap(([n,o])=>[...o].map(s=>({uri:n,id:s}))):Array.from(e.get(r)??[]).map(n=>({uri:r,id:n}))}},Wze=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},Z0n=500,zze=class{constructor(e,r){this.fileSystem=e;this.config=r;this.targetSet=new Set;this.activeDocuments=new Map;this.nodeToDoc=new Map;this.createdNodes=new Map;this.invalidatedNodes=new Map;this.parsers=new Map;this.staleDocuments=new Set;this.pendingUpdates=new Map;this.uriCache=new Sn(Z0n);this.allowedExtensions=new Set(nq);this.invalidDocumentCache=new aP(Z0n,this.config.InvalidCacheTime),this.cachedDocuments=new R7e(this.config.MaxActiveFiles),this.fileSystem.onDidFileChange(n=>this.handleFileChange(n.document.uri))}static{a(this,"WorkspaceContextDocumentManager")}setAllowedLanguages(e){this.allowedExtensions=new Set(e.flatMap(r=>rF[r]?.extensions??[]))}getActiveDocuments(){return Array.from(this.activeDocuments.values())}getNode(e){let r=this.nodeToDoc.get(e);if(r===void 0)return;let n=this.getDocument(r);if(n===void 0)return;let o=n.document.getNode(e);if(o!==void 0)return{...n,node:o}}getDocument(e){let r=this.activeDocuments.get(e);if(r!==void 0)return{document:r,isActive:!0};let n=this.cachedDocuments.get(e);if(n!==void 0)return{document:n.item,isActive:!1}}getUri(e){return this.nodeToDoc.get(e)}normalizeUri(e){let r,n=this.uriCache.get(e);if(n!==null){if(n!==void 0)r=n;else try{if(ZQe(e),r=Gs(e),!(this.fileSystem.getWorkspaceFolder({uri:r})!==void 0)){this.uriCache.set(e,null);return}this.uriCache.set(e,r)}catch{this.uriCache.set(e,null);return}if(!(!this.allowedExtensions.has(Ftn(r))||this.invalidDocumentCache.has(r)))return r}}dispose(){this.parsers.clear(),this.activeDocuments.clear(),this.cachedDocuments.clear()}updateDocuments(e){this.targetSet.clear();let r=[],n=e.documents.map(({uri:o})=>this.normalizeUri(o)).filter(o=>o!==void 0).slice(0,this.config.MaxActiveFiles);for(let o of n)this.targetSet.add(o),r.push(this.updateDocument(o));for(let o of[...this.activeDocuments.keys()])this.targetSet.has(o)||this.deactivateDocument(o);return Promise.all(r)}popChanges(){let e=new X9t(this.createdNodes,this.invalidatedNodes);return this.createdNodes=new Map,this.invalidatedNodes=new Map,e}isKnownDocument(e){return this.activeDocuments.has(e)||this.cachedDocuments.has(e)||this.pendingUpdates.has(e)}deactivateDocument(e){let r=this.activeDocuments.get(e);r!==void 0&&(this.activeDocuments.delete(e),this.pendingUpdates.has(e)||this.cachedDocuments.set(e,new Wze(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new UA;this.pendingUpdates.set(e,r.promise);let n;this.activeDocuments.has(e)?n=this.activeDocuments.get(e):this.cachedDocuments.has(e)&&(n=this.cachedDocuments.get(e).item,this.cachedDocuments.uncache(e)),(n===void 0||this.staleDocuments.has(e))&&(this.staleDocuments.delete(e),n=await this.createUpdatedDocument(e,n)),n!==void 0&&(this.targetSet.has(e)?this.activeDocuments.set(e,n):(this.activeDocuments.delete(e),this.cachedDocuments.set(e,new Wze(n,o=>this.disposeDocument(o))))),this.pendingUpdates.delete(e),r.resolve()}async createUpdatedDocument(e,r){let n=await this.readTextDocument(e);if(n===void 0){r!==void 0&&this.disposeDocument(r);return}let o;try{o=await this.getParser(n.detectedLanguageId)}catch{this.invalidDocumentCache.set(e,!0),r!==void 0&&this.disposeDocument(r);return}if(r!==void 0)if(n.detectedLanguageId!==r.document.detectedLanguageId)this.disposeDocument(r);else{let c=new Set(r.getAllIds());r.update(n);let l=new Set(r.getAllIds()),u=[...l].filter(f=>!c.has(f)),d=[...c].filter(f=>!l.has(f));return this.recordDocumentChanges(e,{created:u,invalidated:d}),r}let s=new Gze(n,o,this.config.MinNodeSize);return this.recordDocumentChanges(e,{created:s.getAllIds(),invalidated:[]}),s}disposeDocument(e){this.recordDocumentChanges(e.uri,{created:[],invalidated:e.getAllIds()})}recordDocumentChanges(e,r){let n=Ag(this.createdNodes,e,()=>new Set),o=Ag(this.invalidatedNodes,e,()=>new Set);for(let s of r.created)n.add(s),this.nodeToDoc.set(s,e);for(let s of r.invalidated)n.has(s)?n.delete(s):o.add(s),this.nodeToDoc.delete(s)}async getParser(e){let r=this.parsers.get(e);return r===void 0&&(r=await J0n(e),this.parsers.set(e,r)),r}async readTextDocument(e){if(this.invalidDocumentCache.has(e)||this.normalizeUri(e)===void 0)return;let r=await this.fileSystem.readValidFile({uri:e});if(r.status!=="valid"||r.document.uri!==e){this.invalidDocumentCache.set(e,!0);return}return r.document}handleFileChange(e){this.isKnownDocument(e)&&this.staleDocuments.add(e)}};p();var aqo="WorkspaceContextWorker";function e7t(t){let e=t;return e?.workerId===aqo&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(e7t,"isContextWorkerData");var cqo=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function X0n(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return cqo.includes(e)?e:void 0}a(X0n,"getContextMessageType");var pq=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();r7t();p();var iAn;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(iAn||(iAn={}));var n7t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(n7t||(n7t={}));var oAn;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}a(e,"is"),t.is=e})(oAn||(oAn={}));var Kze;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}a(e,"is"),t.is=e})(Kze||(Kze={}));var E_;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=Kze.MAX_VALUE),o===Number.MAX_VALUE&&(o=Kze.MAX_VALUE),{line:n,character:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.uinteger(o.line)&&mt.uinteger(o.character)}a(r,"is"),t.is=r})(E_||(E_={}));var xu;(function(t){function e(n,o,s,c){if(mt.uinteger(n)&&mt.uinteger(o)&&mt.uinteger(s)&&mt.uinteger(c))return{start:E_.create(n,o),end:E_.create(s,c)};if(E_.is(n)&&E_.is(o))return{start:n,end:o};throw new Error(`Range#create called with invalid arguments[${n}, ${o}, ${s}, ${c}]`)}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&E_.is(o.start)&&E_.is(o.end)}a(r,"is"),t.is=r})(xu||(xu={}));var Jze;(function(t){function e(n,o){return{uri:n,range:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&xu.is(o.range)&&(mt.string(o.uri)||mt.undefined(o.uri))}a(r,"is"),t.is=r})(Jze||(Jze={}));var sAn;(function(t){function e(n,o,s,c){return{targetUri:n,targetRange:o,targetSelectionRange:s,originSelectionRange:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&xu.is(o.targetRange)&&mt.string(o.targetUri)&&xu.is(o.targetSelectionRange)&&(xu.is(o.originSelectionRange)||mt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(sAn||(sAn={}));var i7t;(function(t){function e(n,o,s,c){return{red:n,green:o,blue:s,alpha:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.numberRange(o.red,0,1)&&mt.numberRange(o.green,0,1)&&mt.numberRange(o.blue,0,1)&&mt.numberRange(o.alpha,0,1)}a(r,"is"),t.is=r})(i7t||(i7t={}));var aAn;(function(t){function e(n,o){return{range:n,color:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&xu.is(o.range)&&i7t.is(o.color)}a(r,"is"),t.is=r})(aAn||(aAn={}));var cAn;(function(t){function e(n,o,s){return{label:n,textEdit:o,additionalTextEdits:s}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.string(o.label)&&(mt.undefined(o.textEdit)||Aue.is(o))&&(mt.undefined(o.additionalTextEdits)||mt.typedArray(o.additionalTextEdits,Aue.is))}a(r,"is"),t.is=r})(cAn||(cAn={}));var lAn;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(lAn||(lAn={}));var uAn;(function(t){function e(n,o,s,c,l,u){let d={startLine:n,endLine:o};return mt.defined(s)&&(d.startCharacter=s),mt.defined(c)&&(d.endCharacter=c),mt.defined(l)&&(d.kind=l),mt.defined(u)&&(d.collapsedText=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.uinteger(o.startLine)&&mt.uinteger(o.startLine)&&(mt.undefined(o.startCharacter)||mt.uinteger(o.startCharacter))&&(mt.undefined(o.endCharacter)||mt.uinteger(o.endCharacter))&&(mt.undefined(o.kind)||mt.string(o.kind))}a(r,"is"),t.is=r})(uAn||(uAn={}));var o7t;(function(t){function e(n,o){return{location:n,message:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&Jze.is(o.location)&&mt.string(o.message)}a(r,"is"),t.is=r})(o7t||(o7t={}));var dAn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(dAn||(dAn={}));var fAn;(function(t){t.Unnecessary=1,t.Deprecated=2})(fAn||(fAn={}));var pAn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&mt.string(n.href)}a(e,"is"),t.is=e})(pAn||(pAn={}));var Zze;(function(t){function e(n,o,s,c,l,u){let d={range:n,message:o};return mt.defined(s)&&(d.severity=s),mt.defined(c)&&(d.code=c),mt.defined(l)&&(d.source=l),mt.defined(u)&&(d.relatedInformation=u),d}a(e,"create"),t.create=e;function r(n){var o;let s=n;return mt.defined(s)&&xu.is(s.range)&&mt.string(s.message)&&(mt.number(s.severity)||mt.undefined(s.severity))&&(mt.integer(s.code)||mt.string(s.code)||mt.undefined(s.code))&&(mt.undefined(s.codeDescription)||mt.string((o=s.codeDescription)===null||o===void 0?void 0:o.href))&&(mt.string(s.source)||mt.undefined(s.source))&&(mt.undefined(s.relatedInformation)||mt.typedArray(s.relatedInformation,o7t.is))}a(r,"is"),t.is=r})(Zze||(Zze={}));var gue;(function(t){function e(n,o,...s){let c={title:n,command:o};return mt.defined(s)&&s.length>0&&(c.arguments=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.title)&&mt.string(o.command)}a(r,"is"),t.is=r})(gue||(gue={}));var Aue;(function(t){function e(s,c){return{range:s,newText:c}}a(e,"replace"),t.replace=e;function r(s,c){return{range:{start:s,end:s},newText:c}}a(r,"insert"),t.insert=r;function n(s){return{range:s,newText:""}}a(n,"del"),t.del=n;function o(s){let c=s;return mt.objectLiteral(c)&&mt.string(c.newText)&&xu.is(c.range)}a(o,"is"),t.is=o})(Aue||(Aue={}));var s7t;(function(t){function e(n,o,s){let c={label:n};return o!==void 0&&(c.needsConfirmation=o),s!==void 0&&(c.description=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.string(o.label)&&(mt.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(mt.string(o.description)||o.description===void 0)}a(r,"is"),t.is=r})(s7t||(s7t={}));var yue;(function(t){function e(r){let n=r;return mt.string(n)}a(e,"is"),t.is=e})(yue||(yue={}));var hAn;(function(t){function e(s,c,l){return{range:s,newText:c,annotationId:l}}a(e,"replace"),t.replace=e;function r(s,c,l){return{range:{start:s,end:s},newText:c,annotationId:l}}a(r,"insert"),t.insert=r;function n(s,c){return{range:s,newText:"",annotationId:c}}a(n,"del"),t.del=n;function o(s){let c=s;return Aue.is(c)&&(s7t.is(c.annotationId)||yue.is(c.annotationId))}a(o,"is"),t.is=o})(hAn||(hAn={}));var a7t;(function(t){function e(n,o){return{textDocument:n,edits:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&f7t.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(a7t||(a7t={}));var c7t;(function(t){function e(n,o,s){let c={kind:"create",uri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="create"&&mt.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||mt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||mt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||yue.is(o.annotationId))}a(r,"is"),t.is=r})(c7t||(c7t={}));var l7t;(function(t){function e(n,o,s,c){let l={kind:"rename",oldUri:n,newUri:o};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),c!==void 0&&(l.annotationId=c),l}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="rename"&&mt.string(o.oldUri)&&mt.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||mt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||mt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||yue.is(o.annotationId))}a(r,"is"),t.is=r})(l7t||(l7t={}));var u7t;(function(t){function e(n,o,s){let c={kind:"delete",uri:n};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="delete"&&mt.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||mt.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||mt.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||yue.is(o.annotationId))}a(r,"is"),t.is=r})(u7t||(u7t={}));var d7t;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(o=>mt.string(o.kind)?c7t.is(o)||l7t.is(o)||u7t.is(o):a7t.is(o)))}a(e,"is"),t.is=e})(d7t||(d7t={}));var mAn;(function(t){function e(n){return{uri:n}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)}a(r,"is"),t.is=r})(mAn||(mAn={}));var gAn;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&mt.integer(o.version)}a(r,"is"),t.is=r})(gAn||(gAn={}));var f7t;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&(o.version===null||mt.integer(o.version))}a(r,"is"),t.is=r})(f7t||(f7t={}));var AAn;(function(t){function e(n,o,s,c){return{uri:n,languageId:o,version:s,text:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&mt.string(o.languageId)&&mt.integer(o.version)&&mt.string(o.text)}a(r,"is"),t.is=r})(AAn||(AAn={}));var p7t;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}a(e,"is"),t.is=e})(p7t||(p7t={}));var Jxe;(function(t){function e(r){let n=r;return mt.objectLiteral(r)&&p7t.is(n.kind)&&mt.string(n.value)}a(e,"is"),t.is=e})(Jxe||(Jxe={}));var yAn;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(yAn||(yAn={}));var _An;(function(t){t.PlainText=1,t.Snippet=2})(_An||(_An={}));var EAn;(function(t){t.Deprecated=1})(EAn||(EAn={}));var vAn;(function(t){function e(n,o,s){return{newText:n,insert:o,replace:s}}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.newText)&&xu.is(o.insert)&&xu.is(o.replace)}a(r,"is"),t.is=r})(vAn||(vAn={}));var CAn;(function(t){t.asIs=1,t.adjustIndentation=2})(CAn||(CAn={}));var bAn;(function(t){function e(r){let n=r;return n&&(mt.string(n.detail)||n.detail===void 0)&&(mt.string(n.description)||n.description===void 0)}a(e,"is"),t.is=e})(bAn||(bAn={}));var SAn;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(SAn||(SAn={}));var TAn;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(TAn||(TAn={}));var Xze;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(e,"fromPlainText"),t.fromPlainText=e;function r(n){let o=n;return mt.string(o)||mt.objectLiteral(o)&&mt.string(o.language)&&mt.string(o.value)}a(r,"is"),t.is=r})(Xze||(Xze={}));var IAn;(function(t){function e(r){let n=r;return!!n&&mt.objectLiteral(n)&&(Jxe.is(n.contents)||Xze.is(n.contents)||mt.typedArray(n.contents,Xze.is))&&(r.range===void 0||xu.is(r.range))}a(e,"is"),t.is=e})(IAn||(IAn={}));var xAn;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})(xAn||(xAn={}));var wAn;(function(t){function e(r,n,...o){let s={label:r};return mt.defined(n)&&(s.documentation=n),mt.defined(o)?s.parameters=o:s.parameters=[],s}a(e,"create"),t.create=e})(wAn||(wAn={}));var RAn;(function(t){t.Text=1,t.Read=2,t.Write=3})(RAn||(RAn={}));var kAn;(function(t){function e(r,n){let o={range:r};return mt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(kAn||(kAn={}));var PAn;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(PAn||(PAn={}));var DAn;(function(t){t.Deprecated=1})(DAn||(DAn={}));var NAn;(function(t){function e(r,n,o,s,c){let l={name:r,kind:n,location:{uri:s,range:o}};return c&&(l.containerName=c),l}a(e,"create"),t.create=e})(NAn||(NAn={}));var MAn;(function(t){function e(r,n,o,s){return s!==void 0?{name:r,kind:n,location:{uri:o,range:s}}:{name:r,kind:n,location:{uri:o}}}a(e,"create"),t.create=e})(MAn||(MAn={}));var OAn;(function(t){function e(n,o,s,c,l,u){let d={name:n,detail:o,kind:s,range:c,selectionRange:l};return u!==void 0&&(d.children=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.name)&&mt.number(o.kind)&&xu.is(o.range)&&xu.is(o.selectionRange)&&(o.detail===void 0||mt.string(o.detail))&&(o.deprecated===void 0||mt.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}a(r,"is"),t.is=r})(OAn||(OAn={}));var LAn;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(LAn||(LAn={}));var eYe;(function(t){t.Invoked=1,t.Automatic=2})(eYe||(eYe={}));var BAn;(function(t){function e(n,o,s){let c={diagnostics:n};return o!=null&&(c.only=o),s!=null&&(c.triggerKind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.typedArray(o.diagnostics,Zze.is)&&(o.only===void 0||mt.typedArray(o.only,mt.string))&&(o.triggerKind===void 0||o.triggerKind===eYe.Invoked||o.triggerKind===eYe.Automatic)}a(r,"is"),t.is=r})(BAn||(BAn={}));var FAn;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):gue.is(o)?c.command=o:c.edit=o,l&&s!==void 0&&(c.kind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.title)&&(o.diagnostics===void 0||mt.typedArray(o.diagnostics,Zze.is))&&(o.kind===void 0||mt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||gue.is(o.command))&&(o.isPreferred===void 0||mt.boolean(o.isPreferred))&&(o.edit===void 0||d7t.is(o.edit))}a(r,"is"),t.is=r})(FAn||(FAn={}));var UAn;(function(t){function e(n,o){let s={range:n};return mt.defined(o)&&(s.data=o),s}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&xu.is(o.range)&&(mt.undefined(o.command)||gue.is(o.command))}a(r,"is"),t.is=r})(UAn||(UAn={}));var QAn;(function(t){function e(n,o){return{tabSize:n,insertSpaces:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.uinteger(o.tabSize)&&mt.boolean(o.insertSpaces)}a(r,"is"),t.is=r})(QAn||(QAn={}));var qAn;(function(t){function e(n,o,s){return{range:n,target:o,data:s}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&xu.is(o.range)&&(mt.undefined(o.target)||mt.string(o.target))}a(r,"is"),t.is=r})(qAn||(qAn={}));var jAn;(function(t){function e(n,o){return{range:n,parent:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&xu.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})(jAn||(jAn={}));var HAn;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(HAn||(HAn={}));var GAn;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(GAn||(GAn={}));var $An;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}a(e,"is"),t.is=e})($An||($An={}));var VAn;(function(t){function e(n,o){return{range:n,text:o}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&xu.is(o.range)&&mt.string(o.text)}a(r,"is"),t.is=r})(VAn||(VAn={}));var WAn;(function(t){function e(n,o,s){return{range:n,variableName:o,caseSensitiveLookup:s}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&xu.is(o.range)&&mt.boolean(o.caseSensitiveLookup)&&(mt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})(WAn||(WAn={}));var zAn;(function(t){function e(n,o){return{range:n,expression:o}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&xu.is(o.range)&&(mt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})(zAn||(zAn={}));var YAn;(function(t){function e(n,o){return{frameId:n,stoppedLocation:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&xu.is(n.stoppedLocation)}a(r,"is"),t.is=r})(YAn||(YAn={}));var h7t;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(h7t||(h7t={}));var m7t;(function(t){function e(n){return{value:n}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&(o.tooltip===void 0||mt.string(o.tooltip)||Jxe.is(o.tooltip))&&(o.location===void 0||Jze.is(o.location))&&(o.command===void 0||gue.is(o.command))}a(r,"is"),t.is=r})(m7t||(m7t={}));var KAn;(function(t){function e(n,o,s){let c={position:n,label:o};return s!==void 0&&(c.kind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&E_.is(o.position)&&(mt.string(o.label)||mt.typedArray(o.label,m7t.is))&&(o.kind===void 0||h7t.is(o.kind))&&o.textEdits===void 0||mt.typedArray(o.textEdits,Aue.is)&&(o.tooltip===void 0||mt.string(o.tooltip)||Jxe.is(o.tooltip))&&(o.paddingLeft===void 0||mt.boolean(o.paddingLeft))&&(o.paddingRight===void 0||mt.boolean(o.paddingRight))}a(r,"is"),t.is=r})(KAn||(KAn={}));var JAn;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(JAn||(JAn={}));var ZAn;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(ZAn||(ZAn={}));var XAn;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(XAn||(XAn={}));var eyn;(function(t){t.Invoked=0,t.Automatic=1})(eyn||(eyn={}));var tyn;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(tyn||(tyn={}));var ryn;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(ryn||(ryn={}));var nyn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&n7t.is(n.uri)&&mt.string(n.name)}a(e,"is"),t.is=e})(nyn||(nyn={}));var iyn;(function(t){function e(s,c,l,u){return new g7t(s,c,l,u)}a(e,"create"),t.create=e;function r(s){let c=s;return!!(mt.defined(c)&&mt.string(c.uri)&&(mt.undefined(c.languageId)||mt.string(c.languageId))&&mt.uinteger(c.lineCount)&&mt.func(c.getText)&&mt.func(c.positionAt)&&mt.func(c.offsetAt))}a(r,"is"),t.is=r;function n(s,c){let l=s.getText(),u=o(c,(f,h)=>{let m=f.range.start.line-h.range.start.line;return m===0?f.range.start.character-h.range.start.character:m}),d=l.length;for(let f=u.length-1;f>=0;f--){let h=u[f],m=s.offsetAt(h.range.start),g=s.offsetAt(h.range.end);if(g<=d)l=l.substring(0,m)+h.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");d=m}return l}a(n,"applyEdits"),t.applyEdits=n;function o(s,c){if(s.length<=1)return s;let l=s.length/2|0,u=s.slice(0,l),d=s.slice(l);o(u,c),o(d,c);let f=0,h=0,m=0;for(;f0&&await this.database.insertSymbols(n.map(s=>({documentId:o.id,fullyQualifiedName:s.fullyQualifiedName,unqualifiedName:s.unqualifiedName,commentStart:s.commentRange.start,commentLength:s.commentRange.length,nameStart:s.nameRange.start,nameLength:s.nameRange.length,bodyStart:s.bodyRange.start,bodyLength:s.bodyRange.length,extentStart:s.extentRange.start,extentLength:s.extentRange.length,symbolKind:s.kind,refKind:s.refKind}))),await this.database.updateDocumentTimestamp(e,r)}async addDocumentsAsync(e){for(let r of e)r=r.toLowerCase(),await this.database.insertDocument(r,Date.now(),!0)}async deleteDocumentAsync(e){return await this.database.deleteAllDocumentsWithPath(e.toLowerCase())}async updateDocumentTimestampAsync(e,r){return await this.database.updateDocumentTimestamp(e.toLowerCase(),r)}async fuzzyMatchSymbolsAsync(e,r){return pue(await this.database.querySymbolsFuzzilyUsingUnqualifiedName(e,r))}async findPotentialDefinitionsAsync(e,r,n){let o=[],c=0;for(;cnew uw(e.filePath,e.fullyQualifiedName,e.unqualifiedName,new Iu(e.commentStart,e.commentLength),new Iu(e.nameStart,e.nameLength),new Iu(e.bodyStart,e.bodyLength),new Iu(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(pue,"symbolsToSymbolRanges");var xze=fe(require("fs/promises"));var Ize=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new Tze(e),this.symbolExtractors=r,this.importExtractors=n,this.params=o}dispose(){return this.storage.close()}get reader(){return this.storage}async indexFile(e,r){let n=ys(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await xze.stat(n)}catch{await this.storage.deleteDocumentAsync(e);return}let s=o.mtimeMs,c=await this.storage.getDocumentAsync(e);if(c&&c.lastWriteTimeUtc>=s)return;let l=this.symbolExtractors.get(r);if(!l)return;let u=(await xze.readFile(n)).toString(),d=await l.extractSymbols(e,u),f=d;if(this.params?.mlcpEnableImports){let h=this.importExtractors.get(r);if(h){let m=await h.extractSymbols(e,u);f=[...d,...m]}}await this.storage.insertOrReplaceDocumentSymbolsAsync(e,s,f)}async getDocumentFilePaths(){return(await this.storage.getDocumentsAsync()).map(r=>r.filePath)}};p();function G9t(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>wQo(r))}a(G9t,"isIndexWorkerData");var Wxe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},oq=class extends Wxe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},wze=class extends Wxe{constructor(r){super(__.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},__={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},Rze=class extends oq{constructor(r,n,o){super(r,__.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},kze=class extends oq{constructor(r,n){super(r,__.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},Pze=class extends oq{constructor(r,n,o){super(r,__.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},Dze=class extends oq{constructor(r,n){super(r,__.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},Nze=class extends oq{constructor(r,n,o,s,c,l){super(r,__.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},Mze=class extends oq{static{a(this,"ExitRequest")}constructor(e){super(e,__.Exit)}},n2=class extends Wxe{constructor(r,n,o){super(__.Response);this.id=r;this.error=n;this.data=o;n&&"code"in n&&typeof n.code=="string"&&(this.code=n.code)}static{a(this,"ResponseMessage")}};function wQo(t){return"databaseFilePath"in t&&"rootPath"in t}a(wQo,"isIndexableWorkspaceFolder");var x0n=fe(ii()),sq=require("worker_threads");var Oze=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new Ize(e,p0n,h0n,r),this.contextRetreival=new _ze(this.index.reader,f0n)}},$9t=class t{constructor(e,r,n){this.indices=new Map;this.cancellationTokens=new Map;this.params=n;for(let o of r){let s=un(o.rootPath);this.indices.set(s,new Oze(o.databaseFilePath,n))}this.port=e,this.port.on("message",o=>{o&&typeof o=="object"&&o.__perf__&&this.port?.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",o=>{this.dispatchMessage(o,this.indices,this.cancellationTokens)})}static{a(this,"IndexWorker")}async dispatchMessage(e,r,n){if(!e.__perf__)try{let o=new x0n.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case __.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case __.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case __.Cancel:n.get(e.id)?.cancel(),s=new n2(e.id,void 0,void 0);break;case __.Exit:s=await this.dispatchExit(e,r,o.token);break;case __.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case __.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case __.GetAllDocumentsInWorkspace:s=await t.GetAllDocumentsInWorkspaceRequest(e,r,o.token);break;default:this.port?.postMessage(new Error(`Unknown operation: ${e.operation}`))}s&&this.port?.postMessage(s),n.get(e.id)?.dispose(),n.delete(e.id)}catch(o){if(!(o instanceof Error))throw o;this.port?.postMessage(new n2(e.id,o,void 0))}}static async GetAllDocumentsInWorkspaceRequest(e,r,n){let o=un(e.baseWorkspaceFolderUri),s,c;return r.has(o)?c=await r.get(o).index.getDocumentFilePaths():s=new Error(`Index not found for ${e.baseWorkspaceFolderUri}`),new n2(e.id,s,c)}static async dispatchAddOrInvalidate(e,r,n){let o=un(e.fileUri),s=t.getIndexInfo(o,r)?.index,c;return s?await s.indexFile(e.fileUri,e.languageId):c=new Error(`Index not found for ${e.fileUri}`),new n2(e.id,c,void 0)}static async dispatchGetContext(e,r,n){let o=un(e.fileUri),s=t.getIndexInfo(o,r)?.contextRetreival,c,l;return s?l=await s.getStringifiedContextAtPositionAsync(e.fileUri,e.code,e.offset,e.languageId,e.params,8e3,n):c=new Error(`ContextRetrieval not found for ${e.fileUri}`),new n2(e.id,c,l)}async dispatchExit(e,r,n){for(let o of r.values())await o.index.dispose();r.clear(),this.port?.postMessage(new n2(e.id,void 0,void 0)),this.port?.close()}static dispatchCreateIndex(e,r,n){let o=un(e.baseWorkspaceFolderUri);return r.has(o)||r.set(o,new Oze(e.databaseFilePath)),new n2(e.id,void 0,void 0)}static async dispatchRemoveIndex(e,r,n){let o=un(e.baseWorkspaceFolderUri);if(r.has(o)){let s=r.get(o);s&&await s.index.dispose(),r.delete(o)}return new n2(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function w0n(){return G9t(sq.workerData)}a(w0n,"isIndexWorker");function R0n(){let t=sq.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!G9t(sq.workerData))throw new Error("Worker data must provide a valid database path.");let e=sq.workerData.cwd;process.cwd=()=>e,new $9t(t,sq.workerData.indexWorkspaceRoots,sq.workerData.params)}a(R0n,"runIndexWorker");p();p();var zxe=require("fs"),k0n=require("path");var aq=class extends Go{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await zxe.promises.readFile(un(e),r)}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink(un(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=un(e),n=await zxe.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,k0n.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await zxe.promises.lstat(e);if(r.isSymbolicLink())try{let n=await zxe.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=0;return e.isFile()&&(o=1),e.isDirectory()&&(o=2),r.isSymbolicLink()&&n&&(o|=64),o}};p();p();var UA=class{constructor(){this.resolve=a(()=>{},"resolve");this.reject=a(()=>{},"reject");this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}static{a(this,"Deferred")}};function JC(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(JC,"delay");async function ZC(t,e,r){let n=new Array(t.length),o=Math.floor(e)>0?Math.floor(e):1,s=Math.max(1,Math.min(o,t.length)),c=0,l=a(async()=>{for(let u=c++;ul())),n}a(ZC,"mapWithConcurrency");function hue(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(hue,"fireAndForget");function P0n(t){let e=Math.floor(t)>0?Math.floor(t):1,r=0,n=[],o=a(()=>rn.push(()=>{r++,c()})),"acquire"),s=a(()=>{r--,n.shift()?.()},"release");return{async run(c){await o();try{return await c()}finally{s()}}}}a(P0n,"createLimiter");function LO(t,e,r){return new Promise(n=>{let o=!1,s=setTimeout(()=>{o||(o=!0,n(r))},e),c=a(l=>{o||(o=!0,clearTimeout(s),n(l))},"finish");t.then(c,()=>c(r))})}a(LO,"withTimeout");function mue(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(mue,"safeInit");async function RQo(t){if(t.isCancellationRequested)return;let e=new UA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(RQo,"cancellationTokenToPromise");async function D0n(t,e){if(e){let r=RQo(e);await Promise.race([t,r])}else await t}a(D0n,"raceCancellation");function V9t(t){return Array.isArray(t)}a(V9t,"isArrayOfT");async function N0n(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await W9t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(N0n,"resolveAll");async function W9t(t,e){let r;return t instanceof Promise?r=await kQo(t,e):r=await PQo(t,e),r}a(W9t,"resolve");async function kQo(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{let s=await t;if(e?.isCancellationRequested)return;n={status:"full",resolutionTime:0,value:V9t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await D0n(o,e),n.resolutionTime=performance.now()-r,n}a(kQo,"resolvePromise");async function PQo(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{for await(let s of t){if(e?.isCancellationRequested)return;n.status!="partial"&&(n={status:"partial",resolutionTime:0,value:[]}),n.value.push(s)}e?.isCancellationRequested||(n.status!=="partial"?n={status:"full",resolutionTime:0,value:[]}:n.status="full")}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await D0n(o,e),n.resolutionTime=performance.now()-r,n}a(PQo,"resolveIterable");p();p();var Lze="[...]",DQo=0,XC=-1;function kf(){return DQo++}a(kf,"getAvailableNodeId");function NQo(t,e){let r=t.children.map(n=>n.elisionMarker??e);return[...t.text.entries()].map(([n,o])=>n===0?o:r[n-1]+o).join("")}a(NQo,"elideChildren");function M0n(t,e=Lze){return r=>t.tokenLength(NQo(r,e))}a(M0n,"getTokenizerCostFunction");p();var lq=class{static{a(this,"PriorityQueue")}constructor(e){if(this.heap=e?[...e]:[],this.heap.length>0)for(let r=Math.floor(this.heap.length/2)-1;r>=0;r--)this.siftDown(r)}get size(){return this.heap.length}insert(e,r){let n={item:e,priority:r};this.heap.push(n);let o=this.heap.length-1;this.siftUp(o)}peek(){return this.heap.length===0?null:this.heap[0]}pop(){if(this.heap.length===0)return null;let e=this.heap[0],r=this.heap.pop();return this.heap.length>0&&(this.heap[0]=r,this.siftDown(0)),e}clear(){let e=this.heap;return this.heap=[],e}siftUp(e){let r=this.heap[e];for(;e>0;){let n=Math.floor((e-1)/2);if(this.heap[n].priority>=r.priority)break;this.heap[e]=this.heap[n],e=n}this.heap[e]=r}siftDown(e){for(;ethis.heap[r].priority&&(r=n),othis.heap[r].priority&&(r=o),r===e)break;let s=this.heap[e];this.heap[e]=this.heap[r],this.heap[r]=s,e=r}}};function MQo(t){let e={id:t.id??kf(),text:t.text??new Array((t.children?.length??0)+1).fill(""),children:t.children??[],cost:t.cost??1,weight:t.weight??0,rectifiedWeight:t.rectifiedWeight,canMerge:t.canMerge??!1,elisionMarker:t.elisionMarker??Lze,requireRenderedChild:t.requireRenderedChild??!1};if(e.text.length!==e.children.length+1)throw new Error(`RenderNode text length (${e.text.length}) must be children length + 1 (${e.children.length+1})`);return e}a(MQo,"createRenderNode");function OQo(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a(OQo,"isRenderedChildRequired");function O0n(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(O0n,"rectifiedValue");function Yxe(t,e){let r=L0n(t,e);for(let{item:n,priority:o}of r.clear())for(let s of n.nodes)s.rectifiedWeight=o*Math.max(s.cost,1)}a(Yxe,"rectifyWeights");function L0n(t,e){let r=t.children.map(s=>L0n(s,e));if(t.weight=Math.max(0,e?e(t):t.weight),t.weight===0&&r.reduce((s,c)=>s+c.size,0)===0)return new lq([]);let n=new lq(r.flatMap(s=>s.clear())),o={nodes:[t],totalCost:t.cost,totalWeight:t.weight};for(;(n.peek()?.priority??0)>o.totalWeight/Math.max(o.totalCost,1);){let{item:s}=n.pop();o.nodes.push(...s.nodes),o.totalCost+=s.totalCost,o.totalWeight+=s.totalWeight}return n.insert(o,o.totalWeight/Math.max(o.totalCost,1)),n}a(L0n,"recursivelyRectifyWeights");function B0n(t,e={}){let{budget:r,mask:n,costFunction:o}=e,s=n??[],c=new Set(Array.isArray(s)?s:[s]);if((r??t.cost)c.has(_.id),"elider"),m=[],g=new Map;if(Y9t(t,m,h,g),m.length===0)return z9t(t,o);let A=m.join(""),y=o?o(A):[...g.values()].reduce((_,E)=>_+E.cost,0);return{text:A,cost:y,renderedNodes:g}}let l=new Map,u=[],d=new lq([{item:t,priority:O0n(t)}]),f=r;for(;f>0&&d.size>0;){let{item:h}=d.pop();if(!c.has(h.id)&&h.cost<=f){f-=h.cost,l.set(h.id,h),u.push(h);for(let m of h.children)d.insert(m,O0n(m))}}for(;l.size>0;){let h=[],m=a(_=>!l.has(_.id),"elider"),g=new Map;if(Y9t(t,h,m,g),h.length===0)return z9t(t,o);let A=h.join("");if(o===void 0){let _=[...g.values()].reduce((E,v)=>E+v.cost,0);return{text:A,cost:_,renderedNodes:g}}let y=o(A);if(y<=r)return{text:A,cost:y,renderedNodes:g};for(l=g;u.length>0&&y>r;){let _=u.pop();l.has(_.id)&&(y-=_.cost,l.delete(_.id))}if(u.length===0)break}return z9t(t,o)}a(B0n,"render");function z9t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(z9t,"renderEmpty");function Y9t(t,e,r,n,o=!1){let s=e.length;if(r(t))return s>=2&&(o||e[s-2]===t.elisionMarker&&e[s-1].trim().length===0)?(e.pop(),!1):(e.push(t.elisionMarker),!1);let c=OQo(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=Y9t(d,e,r,n,d.canMerge&&!l),c&&=!l;if(c){for(;e.length>s;)e.pop();return!1}return e.push(t.text[t.text.length-1]??""),n.set(t.id,t),!0}a(Y9t,"recursivelyRender");function Kxe(t,e,r=Lze){let n=t.children.map(c=>Kxe(c,e,r));r=t.elisionMarker??r;let o=e(t);return MQo({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(Kxe,"snapshot");var uq={id:kf(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var i2=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var Fze={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function LQo(t,e,r=Fze,n){let o=n?.get(e);if(o!==void 0)return o;let s;try{s=await t.readDirectory(e)}catch{}if(s===void 0||r.MaxDirectorySize!==void 0&&s.length>r.MaxDirectorySize)return n?.set(e,"Invalid",r.InvalidCacheTime),"Invalid";let c={documents:[],directories:[]};for(let[l,u]of s){let d=Oa(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(LQo,"getDirectoryChildren");function BQo(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=Cf(e);for(;o.startsWith(r);){n.push(o);let s=Cf(o);if(s.length>=o.length)break;o=s}return n}a(BQo,"getAncestors");function FQo(t,e,r=Fze.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=BQo(t,l.uri);if(u.length===0){n.set(l.uri,new Set);continue}let d;for(let f of u){if(d!==void 0){let h=o.get(f)??new Set;h.add(d),o.set(f,h)}d=f}s.set(l.uri,d),n.set(l.uri,new Set(u))}for(let l of e){let u=[],d=n.get(l.uri);if(!(!d||d.size===0))for(u.push({uri:s.get(l.uri),weight:l.weight*Math.pow(r,d.size)});u.length>0;){let f=u.pop();c.set(f.uri,(c.get(f.uri)??0)+f.weight);let h=o.get(f.uri)??new Set;for(let m of h){let g=f.weight;d.has(m)?g/=r:g*=r,u.push({uri:m,weight:g})}}}return c}a(FQo,"getAncestorWeights");async function*K9t(t,e,r,n,o,s){let c={...Fze,...r},l=c.MaxResults,u=c.Decay,d=FQo(t,e,u),f=new lq([...d.entries()].map(([m,g])=>({item:m,priority:g}))),h=0;for(;f.size>0;){let{item:m,priority:g}=f.pop(),A=await LQo(t,m,c,n);if(s?.isCancellationRequested)return;if(A!=="Invalid"){for(let y of A.documents)if(!o||o(y)){try{if((await t.stat(y)).size>c.MaxFileBytes)continue}catch{continue}if(yield{uri:y,weight:g},h++,h>=l)return}for(let y of A.directories)d.has(y)||(f.insert(y,g*u),d.set(y,g*u))}}}a(K9t,"getNearbyDocuments");var Bze=class extends i2{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=Fze;this.cache=new aP(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of K9t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function yg(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(yg,"setDefault");var UQo={MaxActiveSymbols:500,SymbolCacheSize:1e6},Uze=class extends i2{constructor(){super(...arguments);this.config=UQo;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new Sn(this.config.SymbolCacheSize);this.textSymbols=new Sn(this.config.SymbolCacheSize);this.nextSymbolId=0}static{a(this,"SymbolContextProvider")}getContext(r,n,o,s){this.updateSymbolIndex(r,o);let c=this.getWeightedSymbols(n);return Promise.resolve(this.getWeightedNodes(c))}updateSymbolIndex(r,n){for(let{id:o}of r.getInvalidatedNodes()){let s=this.nodeToSymbol.get(o);if(this.nodeToSymbol.delete(o),this.nodeValency.delete(o),s)for(let[c,l]of s.entries()){let u=this.symbolToNode.get(c);u?.delete(o),u?.size===0?(this.symbolToNode.delete(c),this.symbolValency.delete(c),this.identifierSymbols.delete(c)):this.symbolValency.has(c)&&this.symbolValency.set(c,Math.max(1,(this.symbolValency.get(c)??0)-l))}}for(let{id:o}of r.getCreatedNodes()){let s=n.getNode(o);s!==void 0&&this.extractSymbols(s.document,s.node)}}getWeightedSymbols(r){let n=new Map;for(let{id:s,weight:c}of r.nodes){let l=this.nodeValency.get(s)??0,u=[],d=0;for(let[f,h]of this.nodeToSymbol.get(s)??[]){let m=this.symbolValency.get(f);if((m??0)<1)continue;let g=h/(Math.max(l,1)*Math.max(1,m));u.push({symbolId:f,nodeSymbolWeight:g}),d+=g}d=Math.max(d,1);for(let{symbolId:f,nodeSymbolWeight:h}of u)n.set(f,(n.get(f)??0)+c*h/d)}return[...n.entries()].map(([s,c])=>({symbolId:s,symbolWeight:c,symbolValency:this.symbolValency.get(s)})).filter(({symbolValency:s})=>(s??0)>0).sort((s,c)=>c.symbolWeight/c.symbolValency-s.symbolWeight/s.symbolValency).slice(0,this.config.MaxActiveSymbols)}getWeightedNodes(r){let n=[];for(let{symbolId:o,symbolWeight:s,symbolValency:c}of r){let l=this.identifierSymbols.has(o)?"SymbolContextProvider.Identifiers":"SymbolContextProvider.Text";for(let[u,d]of this.symbolToNode.get(o)??[]){let f=s*d/Math.max(c,this.nodeValency.get(u)??d);n.push({id:u,weight:f,source:l})}}return n}extractSymbols(r,n){if(this.nodeToSymbol.has(n.id))return;let o=new Map;this.nodeToSymbol.set(n.id,o);let s=0;for(let c of n.syntaxNodes()){let l=r.document.getText(c.range);if(this.isIdentifier(r,c,l)){let u=yg(this.identifiers,l,()=>this.createSymbol(!0));o.set(u,(o.get(u)??0)+1),s+=1}if(this.isText(r,c,l)||this.isIdentifier(r,c,l))for(let u of J9t(l)){let d=yg(this.textSymbols,u,()=>this.createSymbol());o.set(d,(o.get(d)??0)+1),s+=1}}this.nodeValency.set(n.id,s);for(let[c,l]of o.entries())yg(this.symbolToNode,c,()=>new Map).set(n.id,l),this.symbolValency.set(c,(this.symbolValency.get(c)??0)+l)}createSymbol(r=!1){let n=this.nextSymbolId++;return r&&this.identifierSymbols.add(n),n}isText(r,n,o){return r.parser.labeler.isText?.(n)??(n.children.length===0&&o.search(/\s/)>=0)}isIdentifier(r,n,o){return r.parser.labeler.isIdentifier?.(n)??(n.children.length===0&&F0n(o))}},QQo=/^[a-zA-Z_]{2,}\w+$/;function F0n(t){return QQo.test(t)}a(F0n,"isSymbol");function qQo(t){return t.toLowerCase()}a(qQo,"normalizeWord");function*J9t(t){for(let e of t.split(/\W/))F0n(e)&&(yield qQo(e))}a(J9t,"getTextSymbols");var jQo={MaxDirectorySize:50,MaxResults:50,Decay:.5,CacheSize:1e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:1*1024*1024,MaxActiveSymbols:500,DebouncedRemovalThreshold:3,UpdateDebounceTimeout:500,SymbolCacheSize:1e5},Qze=class extends Uze{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=jQo;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new aP(this.config.CacheSize,this.config.CacheTime);this.debouncedExpirationCount=new Map;this.updateDebounce=new Map;this.currentlyUpdating=new Set;this.isUpdatingIndex=!1;this.fileSystem.onDidFileChange(o=>{let s=o.document.uri;this.documentToSymbols.has(s)&&this.debouncedReadOrUpdateDocument(s)})}static{a(this,"IndexingSymbolContextProvider")}async getContext(r,n,o,s){super.updateSymbolIndex(r,o),await this.updateDocumentIndex(n);let c=super.getWeightedSymbols(n),l=super.getWeightedNodes(c),u=this.getWeightedDocuments(c);return[...l,...u]}getWeightedDocuments(r){let n=[];for(let{symbolId:o,symbolWeight:s}of r)for(let[c,l]of this.symbolToDocuments.get(o)??[]){let u=l/Math.max(1,this.documentValency.get(c)??1),d=Math.log(Math.max(this.documentToSymbols.size,1)/Math.max(1,this.symbolToDocuments.get(o)?.size??1)),f=s*u*d;n.push({source:"IndexingSymbolContextProvider.Text",uri:c,weight:f})}return n}debouncedReadOrUpdateDocument(r){this.updateDebounce.has(r)&&clearTimeout(this.updateDebounce.get(r)),this.updateDebounce.set(r,setTimeout(()=>{this.updateDebounce.delete(r),this.readOrUpdateDocument(r)},this.config.UpdateDebounceTimeout))}async readOrUpdateDocument(r){try{if(this.currentlyUpdating.has(r))return;if(this.documentManager.normalizeUri(r)===void 0){this.removeFromIndex(r);return}this.currentlyUpdating.add(r);let n=await this.fileSystem.readFileString({uri:r}),o=new Map,s=0;for(let l of J9t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=yg(this.textSymbols,l,()=>this.createSymbol(!1));yg(this.symbolToDocuments,d,()=>new Map).set(r,u),c.push(d)}this.documentValency.set(r,s),this.documentToSymbols.set(r,c)}catch{this.removeFromIndex(r)}finally{this.currentlyUpdating.delete(r)}}async updateDocumentIndex(r){if(!this.isUpdatingIndex){this.isUpdatingIndex=!0;try{for(let s of this.documentToSymbols.keys())this.debouncedExpirationCount.set(s,(this.debouncedExpirationCount.get(s)??0)+1);let n=a(s=>this.documentManager.normalizeUri(s)!==void 0,"filter");for await(let{uri:s}of K9t(this.fileSystem,r.documents,this.config,this.cache,n))this.documentToSymbols.has(s)||await this.readOrUpdateDocument(s),this.debouncedExpirationCount.delete(s);let o=[...this.debouncedExpirationCount.entries()].filter(([s,c])=>c>=this.config.DebouncedRemovalThreshold&&!this.currentlyUpdating.has(s)&&!this.updateDebounce.has(s));for(let[s]of o)this.removeFromIndex(s),this.debouncedExpirationCount.delete(s)}finally{this.isUpdatingIndex=!1}}}removeFromIndex(r){this.documentValency.delete(r);for(let n of this.documentToSymbols.get(r)??[]){let o=this.symbolToDocuments.get(n);o?.delete(r),o?.size===0&&this.symbolToDocuments.delete(n)}this.documentToSymbols.delete(r)}};p();function U0n(t){return t.nodeId!==void 0}a(U0n,"isNodeLocation");var Q0n={"RecentDocumentProvider.RecentlyFocused":{maxEventCount:100,halflife:1e3*60*5,isImpulse:!1},"RecentDocumentProvider.RecentlyEdited":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!0},"RecentDocumentProvider.RecentlyOpen":{maxEventCount:100,halflife:1e3*60*5,isImpulse:!1},RecentCompletionsRequestProvider:{maxEventCount:100,halflife:1e3*60*5,isImpulse:!0},"ExtensionActivityProvider.CurrentSelection":{maxEventCount:1,halflife:1e5,isImpulse:!0},"ExtensionActivityProvider.PrimarySelection":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1},"ExtensionActivityProvider.Selection":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1},"ExtensionActivityProvider.VisibleRange":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1}},qze=class extends i2{constructor(){super(...arguments);this.eventsByType=new Map;this.nextId=0}static{a(this,"RecentActivityProvider")}getContext(r,n,o,s){let c=performance.now(),l=[];for(let[u,d]of this.eventsByType.entries()){let f=Q0n[u],h=[...d.values()].sort((g,A)=>A.timestamp-g.timestamp),m=1;for(let g of h){this.resolveRanges(g,o);let A=.5**((c-g.timestamp)/f.halflife),y=f.isImpulse?A:m-A;m=A;for(let _ of g.locations)U0n(_)?l.push({weight:y,uri:_.uri,id:_.nodeId,source:u}):l.push({weight:y,uri:_.uri,source:u})}}return Promise.resolve(l)}resolveRanges(r,n){if(r.isFullyResolved)return;let o=!0,s=[];for(let c of r.locations)if(U0n(c))s.push(c);else if(c.range&&c.range.start!==void 0&&c.range.end!==void 0){let l=n.getDocument(c.uri)?.document;if(l!==void 0){let u=l.findNode(l.document.offsetAt(c.range.start),l.document.offsetAt(c.range.end));s.push({uri:c.uri,nodeId:u.id})}else o=!1,s.push(c)}else s.push({uri:c.uri,nodeId:XC});r.locations=s,r.isFullyResolved=o}recordEvent(r,n,o){let s=Q0n[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};yg(this.eventsByType,r,()=>new Sn(s.maxEventCount)).set(++this.nextId,c)}};p();var jze=class extends i2{constructor(){super(...arguments);this.nodeParent=new Map;this.nodeChildren=new Map}static{a(this,"TreeProximityProvider")}getContext(r,n,o,s){this.updateIndex(r,o,s);let c=new Map,l=new Map,u=new Map;for(let{id:f,weight:h}of n.nodes){let m=this.nodeParent.get(f)??XC,g=this.nodeChildren.get(m)?.size??0;g>0&&c.set(m,(c.get(m)??0)+h/g);let A=this.nodeChildren.get(f);if(A&&A.size>0)for(let _ of A)l.set(_,(l.get(_)??0)+h/A.size);let y=this.nodeChildren.get(m);if(y&&y.size>1)for(let _ of y)_!==f&&u.set(_,(u.get(_)??0)+h/y.size)}let d=[...[...c.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Parent"})),...[...l.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Children"})),...[...u.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Siblings"}))];return Promise.resolve(d)}updateIndex(r,n,o){for(let{id:s}of r.getInvalidatedNodes())this.nodeParent.delete(s),this.nodeChildren.delete(s);for(let{id:s}of r.getCreatedNodes()){let c=n.getNode(s),l=new Set;if(c!==void 0)for(let u of c.node.children)this.nodeParent.set(u.id,s),l.add(u.id);l.size>0&&this.nodeChildren.set(s,l)}}};p();function HQo(t){return t.id!==void 0}a(HQo,"isNodeItem");function GQo(t){return!("uri"in t)&&!("id"in t)}a(GQo,"isNullItem");var q0n={"RecentDocumentProvider.RecentlyOpen":.1,"RecentDocumentProvider.RecentlyFocused":.1,"RecentDocumentProvider.RecentlyEdited":.1,RecentCompletionsRequestProvider:1,"ExtensionActivityProvider.CurrentSelection":5,"ExtensionActivityProvider.PrimarySelection":2,"ExtensionActivityProvider.Selection":.2,"ExtensionActivityProvider.VisibleRange":1,FileDirectoryDocumentProvider:.05,"SymbolContextProvider.Identifiers":.2,"SymbolContextProvider.Text":.2,"IndexingSymbolContextProvider.Text":1,"TreeProximityProvider.Parent":.3,"TreeProximityProvider.Children":.3,"TreeProximityProvider.Siblings":.3,"ExtensionReferenceProvider.References":.2,"ExtensionReferenceProvider.Definitions":1};function j0n(t){return t in q0n}a(j0n,"isSourceId");var dq="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",gue=class{static{a(this,"WorkspaceContextWeights")}constructor(e){let r=new Map;for(let{uri:n,weight:o}of e)r.set(n,(r.get(n)??0)+o);this.documents=[...r.entries()].map(([n,o])=>({uri:n,weight:o})).sort((n,o)=>o.weight-n.weight),this.docWeights=r,this.nodes=e.filter(({id:n})=>n!==XC),this.nodeWeights=new Map(e.map(({id:n,weight:o})=>[n,o]))}getNodeWeight(e){return this.nodeWeights.get(e)??0}getDocumentWeight(e){return this.docWeights.get(e)??0}},Hze=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=q0n;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new gue([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new gue(r.items):new gue([])}return this.weights}updateWeights(){let e=new Map,r=0,n=this.config.StaleWeightHalflife;for(let[o,{items:s,updateTime:c}]of this.sourceContext.entries()){let l=this.sourceWeights[o]??0;if(l<=0||s.length===0)continue;let u=.5**(-Math.max(0,(this.prevUpdateTime??c)-c)/n);l*=u,r+=l,this.aggregateWeights(s,e,l,!0)}if(r>0){if(this.weights.nodes.length>0){let o=r*this.config.Laziness,s=this.prevItems;this.aggregateWeights(s,e,o,!0)}for(let[o,s]of e.entries()){let c=this.activeContext.getDocument(o)?.document;if(c===void 0)continue;let l=s.get(XC);if(l!==void 0&&l>0){s.delete(XC);let u=0;for(let d of s.values())u+=d;if(u<=0){let d=c.getAllIds(),f=l/Math.max(d.length,1);for(let h of d)s.set(h,f)}else for(let[d,f]of[...s.entries()])s.set(d,f+l*(f/u))}}this.prevItems=this.truncateAndNormalize(e),this.weights=new gue(this.prevItems)}return this.prevUpdateTime=performance.now(),this.weights}pushWorkspaceContext(e,r){let n=performance.now(),o=this.addUriAndId(r),s=new Map;this.aggregateWeights(o,s);let c=this.truncateAndNormalize(s);this.sourceContext.set(e,{items:c,updateTime:n})}addUriAndId(e){return e.filter(r=>r.weight>0).map(r=>{if(GQo(r))return{weight:r.weight,uri:dq,id:XC};let n=HQo(r)?r.id:XC,o=r.uri??this.activeContext.getUri(n)??dq;return o===dq&&(n=XC),{weight:r.weight,uri:o,id:n}})}aggregateWeights(e,r,n=1,o=!1){for(let{uri:s,id:c,weight:l}of e){if(l<=0||isNaN(l))continue;let u=yg(r,s,()=>new Map),d=XC;(!o||this.activeContext.getUri(c)!==void 0)&&(d=c),u.set(d,(u.get(d)??0)+l*n)}}truncateAndNormalize(e){let r=[],n=new Map,o=0;for(let[u,d]of e.entries()){let f=u!==dq?this.activeContext.normalizeUri(u)??dq:dq;for(let[h,m]of d.entries())u===dq||h===XC?n.set(f,(n.get(f)??0)+m):r.push({uri:f,id:h,weight:m}),o+=m}if(o<=0)return[];n.delete(dq),r.sort((u,d)=>d.weight-u.weight);for(let{uri:u,weight:d}of r.slice(this.config.MaxActiveNodes,r.length))n.set(u,(n.get(u)??0)+d);let s=[...n.entries()].sort((u,d)=>d[1]-u[1]).slice(0,this.config.MaxActiveFiles).map(([u,d])=>({uri:u,id:XC,weight:d}));return r.slice(0,this.config.MaxActiveNodes).concat(s).sort((u,d)=>d.weight-u.weight).map(u=>({...u,weight:u.weight/o}))}};p();p();p();var Z9t=class{constructor(e,r,n,o=!1){this.id=e;this.parts=r;this.text=n;this.canMerge=o}static{a(this,"ContextNode")}get startOffset(){return this.parts[0].root.startOffset}get endOffset(){return this.parts[this.parts.length-1].root.endOffset}get syntaxRoots(){return this.parts.map(e=>e.root)}get children(){return this.parts.flatMap(e=>e.children)}get syntaxLimits(){return this.children.flatMap(e=>e.syntaxRoots)}*syntaxNodes(){let e=new Set(this.syntaxLimits.map(r=>r.id));for(let r of this.syntaxRoots)yield*H0n(r,e)}findChild(e,r){if(ethis.endOffset||r=r)break;s.root.endOffset=r)break;c.endOffsets.root.startOffset-c.root.startOffset);let n=VQo(e,this.document),o=new Z9t(kf(),e,n,r);return this.nodeById.set(o.id,o),o}buildTree(){let e=this.buildRecursively(this._syntaxRoot);return this.createNode([{root:this._syntaxRoot,children:e}])}buildRecursively(e){if(e.endOffset-e.startOffset({root:o,children:this.buildRecursively(o)}));if(this.canMergeChildren(e))return this.mergeChildren(r);let n=[];for(let{root:o,children:s}of r){if(this.canBeNode(o)&&o.endOffset-o.startOffset-s.reduce((l,u)=>l+(u.endOffset-u.startOffset),0)>=this.minSize){n.push(this.createNode([{root:o,children:s}]));continue}n.push(...s)}return n}mergeChildren(e){if(e.length===0)return[];e.sort((m,g)=>m.root.startOffset-g.root.startOffset);let r=e[e.length-1].root.endOffset-e[0].root.startOffset,n=[];for(let m of e){let g=m.root.endOffset-m.root.startOffset;for(let A of m.children){let y=A.endOffset-A.startOffset;g-=y,r-=y}n.push(g)}if(rm.children);let o=[0],s=0,c=null,l={line:-1,size:-1},u=e[0].root.startOffset,d=e[0].root.range.start.line;for(let m=0;mthis.minSize&&sl.line||A.line==l.line&&A.size>l.size)&&(l=A,c=m)}u=g.root.endOffset,d=g.root.range.end.line,s>=this.maxSize&&(c=c??m,o.push(c+1),m=c,s=0,c=null,l={line:-1,size:-1},u=e[m+1]?.root.startOffset,d=e[m+1]?.root.range.start.line)}o.length==1?o.push(e.length):o[o.length-1]!==e.length&&(o[o.length-1]=e.length);let f=[],h=!1;for(let m=0;m$Qo}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function VQo(t,e){if(t.length===0)return[""];let r=[],n=e.positionAt(t[0].root.startOffset);for(let s of t.flatMap(c=>c.children).sort((c,l)=>c.startOffset-l.startOffset)){let c=e.positionAt(s.startOffset);r.push(e.getText({start:n,end:c})),n=e.positionAt(s.endOffset)}let o=e.positionAt(t[t.length-1].root.endOffset);return r.push(e.getText({start:n,end:o})),r}a(VQo,"buildText");function*H0n(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*H0n(r,e))}a(H0n,"walk");p();p();p();var $ze=class{constructor(e,r,n,o,s,c){this.id=e;this.raw=r;this.children=n;this.source="indentation";this.parent=null;let l={start:{line:o,character:0},end:{line:s,character:c.lineAt(s).text.length}},u=c.getText(l),d=u.search(/\S/);if(d===-1){let m={line:s,character:0};this.startOffset=c.offsetAt(m),this.endOffset=this.startOffset,this.range={start:m,end:m};return}let f=u.search(/\S(?!.*\S)/s),h=c.offsetAt(l.start);this.startOffset=h+d,this.endOffset=h+f+1,this.range={start:c.positionAt(this.startOffset),end:c.positionAt(this.endOffset)}}static{a(this,"IndentationNode")}get type(){return this.raw.type}};function X9t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:X9t(u,e,r)})).filter(u=>u.node!==null).sort((u,d)=>u.node.startOffset-d.node.startOffset),o=[],s=e;for(let u=n.length-1;u>=0;u--){let{subtree:d,node:f}=n[u];if(f.range.end.line>=s){let h=X9t(d,s,r);h!==null&&(o.push(h),s=Math.min(h.range.start.line,s))}else o.push(f),s=Math.min(f.range.start.line,s)}o.sort((u,d)=>u.startOffset-d.startOffset);let c=e,l=0;if(o.length>0&&(c=Math.min(c,o[0].range.start.line),l=Math.max(l,o[o.length-1].range.end.line)),(t.type==="blank"||t.type==="line")&&(c=Math.min(c,t.lineNumber),l=Math.max(l,t.lineNumber),t.type==="blank"&&c===l))return null;if(l=Math.min(l,e-1),c<=l){let u=new $ze(kf(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(X9t,"recursivelyBuildNode");function G0n(t){let e=qK(t.getText(),t.detectedLanguageId);return X9t(e,t.lineCount,t)??new $ze(kf(),e,[],0,t.lineCount-1,t)}a(G0n,"parse");var Vze={source:"indentation",parse:G0n,update(t,e){return{root:G0n(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var V0n=fe(tue());function $0n(t){return{line:t.row,character:t.column}}a($0n,"asPosition");var BO=class{constructor(e,r,n,o){this.nodeList=e;this.mergeList=r;this.identifierList=n;this.textList=o}static{a(this,"BasicNodeLabeler")}canBeNode(e){return this.nodeList.has(e.type)}canMergeChildren(e){return this.mergeList.has(e.type)}isIdentifier(e){return this.identifierList.has(e.type)}isText(e){return this.textList.has(e.type)}},fq=class{constructor(e,r,n={}){this.language=e;this.source=r;this.labeler=n}static{a(this,"TreeSitterParser")}dispose(){}parse(e){let r,n;try{return r=new V0n.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return Vze.parse(e)}finally{n?.delete(),r?.delete()}}update(e,r){return{root:this.parse(r),remapper:a(()=>{},"remapper")}}snapshot(e,r){let n={id:e.id,source:this.source,type:e.type,startOffset:e.startIndex,endOffset:e.endIndex,range:{start:$0n(e.startPosition),end:$0n(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var WQo=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),zQo=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),YQo=new Set(["identifier"]),KQo=new Set(["string","comment"]),W0n=new BO(WQo,zQo,YQo,KQo);p();var JQo=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),ZQo=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),XQo=new Set(["identifier"]),eqo=new Set(["string_literal","line_comment","block_comment"]),z0n=new BO(JQo,ZQo,XQo,eqo);p();var tqo=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),rqo=new Set(["module","block","parameters","dictionary","list"]),nqo=new Set(["identifier"]),iqo=new Set(["string","comment"]),Y0n=new BO(tqo,rqo,nqo,iqo);p();var oqo=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),sqo=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),aqo=new Set(["identifier"]),cqo=new Set(["string","comment"]),K0n=new BO(oqo,sqo,aqo,cqo);var J0n=fe(tue());async function Z0n(t){await J0n.default.init();try{let e=await a9t(t);switch(t){case"python":return new fq(e,"tree-sitter-python",Y0n);case"typescript":return new fq(e,"tree-sitter-typescript",K0n);case"java":return new fq(e,"tree-sitter-java",z0n);case"cpp":return new fq(e,"tree-sitter-cpp",W0n);default:return new fq(e,"tree-sitter-generic")}}catch{return Vze}}a(Z0n,"getParser");var e7t=class{constructor(e,r){this.created=e;this.invalidated=r;this.updatedDocuments=Array.from(new Set([...e.entries(),...r.entries()].filter(([n,o])=>o.size>0).map(([n,o])=>n)))}static{a(this,"WorkspaceContextChanges")}getInvalidatedNodes(e){return this.getNodes(this.invalidated,e)}getCreatedNodes(e){return this.getNodes(this.created,e)}getNodes(e,r){return r===void 0?Array.from(e.entries()).flatMap(([n,o])=>[...o].map(s=>({uri:n,id:s}))):Array.from(e.get(r)??[]).map(n=>({uri:r,id:n}))}},Wze=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},X0n=500,zze=class{constructor(e,r){this.fileSystem=e;this.config=r;this.targetSet=new Set;this.activeDocuments=new Map;this.nodeToDoc=new Map;this.createdNodes=new Map;this.invalidatedNodes=new Map;this.parsers=new Map;this.staleDocuments=new Set;this.pendingUpdates=new Map;this.uriCache=new Sn(X0n);this.allowedExtensions=new Set(nq);this.invalidDocumentCache=new aP(X0n,this.config.InvalidCacheTime),this.cachedDocuments=new R7e(this.config.MaxActiveFiles),this.fileSystem.onDidFileChange(n=>this.handleFileChange(n.document.uri))}static{a(this,"WorkspaceContextDocumentManager")}setAllowedLanguages(e){this.allowedExtensions=new Set(e.flatMap(r=>rF[r]?.extensions??[]))}getActiveDocuments(){return Array.from(this.activeDocuments.values())}getNode(e){let r=this.nodeToDoc.get(e);if(r===void 0)return;let n=this.getDocument(r);if(n===void 0)return;let o=n.document.getNode(e);if(o!==void 0)return{...n,node:o}}getDocument(e){let r=this.activeDocuments.get(e);if(r!==void 0)return{document:r,isActive:!0};let n=this.cachedDocuments.get(e);if(n!==void 0)return{document:n.item,isActive:!1}}getUri(e){return this.nodeToDoc.get(e)}normalizeUri(e){let r,n=this.uriCache.get(e);if(n!==null){if(n!==void 0)r=n;else try{if(ZQe(e),r=Gs(e),!(this.fileSystem.getWorkspaceFolder({uri:r})!==void 0)){this.uriCache.set(e,null);return}this.uriCache.set(e,r)}catch{this.uriCache.set(e,null);return}if(!(!this.allowedExtensions.has(Utn(r))||this.invalidDocumentCache.has(r)))return r}}dispose(){this.parsers.clear(),this.activeDocuments.clear(),this.cachedDocuments.clear()}updateDocuments(e){this.targetSet.clear();let r=[],n=e.documents.map(({uri:o})=>this.normalizeUri(o)).filter(o=>o!==void 0).slice(0,this.config.MaxActiveFiles);for(let o of n)this.targetSet.add(o),r.push(this.updateDocument(o));for(let o of[...this.activeDocuments.keys()])this.targetSet.has(o)||this.deactivateDocument(o);return Promise.all(r)}popChanges(){let e=new e7t(this.createdNodes,this.invalidatedNodes);return this.createdNodes=new Map,this.invalidatedNodes=new Map,e}isKnownDocument(e){return this.activeDocuments.has(e)||this.cachedDocuments.has(e)||this.pendingUpdates.has(e)}deactivateDocument(e){let r=this.activeDocuments.get(e);r!==void 0&&(this.activeDocuments.delete(e),this.pendingUpdates.has(e)||this.cachedDocuments.set(e,new Wze(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new UA;this.pendingUpdates.set(e,r.promise);let n;this.activeDocuments.has(e)?n=this.activeDocuments.get(e):this.cachedDocuments.has(e)&&(n=this.cachedDocuments.get(e).item,this.cachedDocuments.uncache(e)),(n===void 0||this.staleDocuments.has(e))&&(this.staleDocuments.delete(e),n=await this.createUpdatedDocument(e,n)),n!==void 0&&(this.targetSet.has(e)?this.activeDocuments.set(e,n):(this.activeDocuments.delete(e),this.cachedDocuments.set(e,new Wze(n,o=>this.disposeDocument(o))))),this.pendingUpdates.delete(e),r.resolve()}async createUpdatedDocument(e,r){let n=await this.readTextDocument(e);if(n===void 0){r!==void 0&&this.disposeDocument(r);return}let o;try{o=await this.getParser(n.detectedLanguageId)}catch{this.invalidDocumentCache.set(e,!0),r!==void 0&&this.disposeDocument(r);return}if(r!==void 0)if(n.detectedLanguageId!==r.document.detectedLanguageId)this.disposeDocument(r);else{let c=new Set(r.getAllIds());r.update(n);let l=new Set(r.getAllIds()),u=[...l].filter(f=>!c.has(f)),d=[...c].filter(f=>!l.has(f));return this.recordDocumentChanges(e,{created:u,invalidated:d}),r}let s=new Gze(n,o,this.config.MinNodeSize);return this.recordDocumentChanges(e,{created:s.getAllIds(),invalidated:[]}),s}disposeDocument(e){this.recordDocumentChanges(e.uri,{created:[],invalidated:e.getAllIds()})}recordDocumentChanges(e,r){let n=yg(this.createdNodes,e,()=>new Set),o=yg(this.invalidatedNodes,e,()=>new Set);for(let s of r.created)n.add(s),this.nodeToDoc.set(s,e);for(let s of r.invalidated)n.has(s)?n.delete(s):o.add(s),this.nodeToDoc.delete(s)}async getParser(e){let r=this.parsers.get(e);return r===void 0&&(r=await Z0n(e),this.parsers.set(e,r)),r}async readTextDocument(e){if(this.invalidDocumentCache.has(e)||this.normalizeUri(e)===void 0)return;let r=await this.fileSystem.readValidFile({uri:e});if(r.status!=="valid"||r.document.uri!==e){this.invalidDocumentCache.set(e,!0);return}return r.document}handleFileChange(e){this.isKnownDocument(e)&&this.staleDocuments.add(e)}};p();var lqo="WorkspaceContextWorker";function t7t(t){let e=t;return e?.workerId===lqo&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(t7t,"isContextWorkerData");var uqo=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function eAn(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return uqo.includes(e)?e:void 0}a(eAn,"getContextMessageType");var pq=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();n7t();p();var oAn;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(oAn||(oAn={}));var i7t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(i7t||(i7t={}));var sAn;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}a(e,"is"),t.is=e})(sAn||(sAn={}));var Kze;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}a(e,"is"),t.is=e})(Kze||(Kze={}));var E_;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=Kze.MAX_VALUE),o===Number.MAX_VALUE&&(o=Kze.MAX_VALUE),{line:n,character:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.uinteger(o.line)&&mt.uinteger(o.character)}a(r,"is"),t.is=r})(E_||(E_={}));var xu;(function(t){function e(n,o,s,c){if(mt.uinteger(n)&&mt.uinteger(o)&&mt.uinteger(s)&&mt.uinteger(c))return{start:E_.create(n,o),end:E_.create(s,c)};if(E_.is(n)&&E_.is(o))return{start:n,end:o};throw new Error(`Range#create called with invalid arguments[${n}, ${o}, ${s}, ${c}]`)}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&E_.is(o.start)&&E_.is(o.end)}a(r,"is"),t.is=r})(xu||(xu={}));var Jze;(function(t){function e(n,o){return{uri:n,range:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&xu.is(o.range)&&(mt.string(o.uri)||mt.undefined(o.uri))}a(r,"is"),t.is=r})(Jze||(Jze={}));var aAn;(function(t){function e(n,o,s,c){return{targetUri:n,targetRange:o,targetSelectionRange:s,originSelectionRange:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&xu.is(o.targetRange)&&mt.string(o.targetUri)&&xu.is(o.targetSelectionRange)&&(xu.is(o.originSelectionRange)||mt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(aAn||(aAn={}));var o7t;(function(t){function e(n,o,s,c){return{red:n,green:o,blue:s,alpha:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.numberRange(o.red,0,1)&&mt.numberRange(o.green,0,1)&&mt.numberRange(o.blue,0,1)&&mt.numberRange(o.alpha,0,1)}a(r,"is"),t.is=r})(o7t||(o7t={}));var cAn;(function(t){function e(n,o){return{range:n,color:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&xu.is(o.range)&&o7t.is(o.color)}a(r,"is"),t.is=r})(cAn||(cAn={}));var lAn;(function(t){function e(n,o,s){return{label:n,textEdit:o,additionalTextEdits:s}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.string(o.label)&&(mt.undefined(o.textEdit)||yue.is(o))&&(mt.undefined(o.additionalTextEdits)||mt.typedArray(o.additionalTextEdits,yue.is))}a(r,"is"),t.is=r})(lAn||(lAn={}));var uAn;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(uAn||(uAn={}));var dAn;(function(t){function e(n,o,s,c,l,u){let d={startLine:n,endLine:o};return mt.defined(s)&&(d.startCharacter=s),mt.defined(c)&&(d.endCharacter=c),mt.defined(l)&&(d.kind=l),mt.defined(u)&&(d.collapsedText=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.uinteger(o.startLine)&&mt.uinteger(o.startLine)&&(mt.undefined(o.startCharacter)||mt.uinteger(o.startCharacter))&&(mt.undefined(o.endCharacter)||mt.uinteger(o.endCharacter))&&(mt.undefined(o.kind)||mt.string(o.kind))}a(r,"is"),t.is=r})(dAn||(dAn={}));var s7t;(function(t){function e(n,o){return{location:n,message:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&Jze.is(o.location)&&mt.string(o.message)}a(r,"is"),t.is=r})(s7t||(s7t={}));var fAn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(fAn||(fAn={}));var pAn;(function(t){t.Unnecessary=1,t.Deprecated=2})(pAn||(pAn={}));var hAn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&mt.string(n.href)}a(e,"is"),t.is=e})(hAn||(hAn={}));var Zze;(function(t){function e(n,o,s,c,l,u){let d={range:n,message:o};return mt.defined(s)&&(d.severity=s),mt.defined(c)&&(d.code=c),mt.defined(l)&&(d.source=l),mt.defined(u)&&(d.relatedInformation=u),d}a(e,"create"),t.create=e;function r(n){var o;let s=n;return mt.defined(s)&&xu.is(s.range)&&mt.string(s.message)&&(mt.number(s.severity)||mt.undefined(s.severity))&&(mt.integer(s.code)||mt.string(s.code)||mt.undefined(s.code))&&(mt.undefined(s.codeDescription)||mt.string((o=s.codeDescription)===null||o===void 0?void 0:o.href))&&(mt.string(s.source)||mt.undefined(s.source))&&(mt.undefined(s.relatedInformation)||mt.typedArray(s.relatedInformation,s7t.is))}a(r,"is"),t.is=r})(Zze||(Zze={}));var Aue;(function(t){function e(n,o,...s){let c={title:n,command:o};return mt.defined(s)&&s.length>0&&(c.arguments=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.title)&&mt.string(o.command)}a(r,"is"),t.is=r})(Aue||(Aue={}));var yue;(function(t){function e(s,c){return{range:s,newText:c}}a(e,"replace"),t.replace=e;function r(s,c){return{range:{start:s,end:s},newText:c}}a(r,"insert"),t.insert=r;function n(s){return{range:s,newText:""}}a(n,"del"),t.del=n;function o(s){let c=s;return mt.objectLiteral(c)&&mt.string(c.newText)&&xu.is(c.range)}a(o,"is"),t.is=o})(yue||(yue={}));var a7t;(function(t){function e(n,o,s){let c={label:n};return o!==void 0&&(c.needsConfirmation=o),s!==void 0&&(c.description=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.string(o.label)&&(mt.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(mt.string(o.description)||o.description===void 0)}a(r,"is"),t.is=r})(a7t||(a7t={}));var _ue;(function(t){function e(r){let n=r;return mt.string(n)}a(e,"is"),t.is=e})(_ue||(_ue={}));var mAn;(function(t){function e(s,c,l){return{range:s,newText:c,annotationId:l}}a(e,"replace"),t.replace=e;function r(s,c,l){return{range:{start:s,end:s},newText:c,annotationId:l}}a(r,"insert"),t.insert=r;function n(s,c){return{range:s,newText:"",annotationId:c}}a(n,"del"),t.del=n;function o(s){let c=s;return yue.is(c)&&(a7t.is(c.annotationId)||_ue.is(c.annotationId))}a(o,"is"),t.is=o})(mAn||(mAn={}));var c7t;(function(t){function e(n,o){return{textDocument:n,edits:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&p7t.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(c7t||(c7t={}));var l7t;(function(t){function e(n,o,s){let c={kind:"create",uri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="create"&&mt.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||mt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||mt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||_ue.is(o.annotationId))}a(r,"is"),t.is=r})(l7t||(l7t={}));var u7t;(function(t){function e(n,o,s,c){let l={kind:"rename",oldUri:n,newUri:o};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),c!==void 0&&(l.annotationId=c),l}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="rename"&&mt.string(o.oldUri)&&mt.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||mt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||mt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||_ue.is(o.annotationId))}a(r,"is"),t.is=r})(u7t||(u7t={}));var d7t;(function(t){function e(n,o,s){let c={kind:"delete",uri:n};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="delete"&&mt.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||mt.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||mt.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||_ue.is(o.annotationId))}a(r,"is"),t.is=r})(d7t||(d7t={}));var f7t;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(o=>mt.string(o.kind)?l7t.is(o)||u7t.is(o)||d7t.is(o):c7t.is(o)))}a(e,"is"),t.is=e})(f7t||(f7t={}));var gAn;(function(t){function e(n){return{uri:n}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)}a(r,"is"),t.is=r})(gAn||(gAn={}));var AAn;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&mt.integer(o.version)}a(r,"is"),t.is=r})(AAn||(AAn={}));var p7t;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&(o.version===null||mt.integer(o.version))}a(r,"is"),t.is=r})(p7t||(p7t={}));var yAn;(function(t){function e(n,o,s,c){return{uri:n,languageId:o,version:s,text:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&mt.string(o.languageId)&&mt.integer(o.version)&&mt.string(o.text)}a(r,"is"),t.is=r})(yAn||(yAn={}));var h7t;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}a(e,"is"),t.is=e})(h7t||(h7t={}));var Jxe;(function(t){function e(r){let n=r;return mt.objectLiteral(r)&&h7t.is(n.kind)&&mt.string(n.value)}a(e,"is"),t.is=e})(Jxe||(Jxe={}));var _An;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(_An||(_An={}));var EAn;(function(t){t.PlainText=1,t.Snippet=2})(EAn||(EAn={}));var vAn;(function(t){t.Deprecated=1})(vAn||(vAn={}));var CAn;(function(t){function e(n,o,s){return{newText:n,insert:o,replace:s}}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.newText)&&xu.is(o.insert)&&xu.is(o.replace)}a(r,"is"),t.is=r})(CAn||(CAn={}));var bAn;(function(t){t.asIs=1,t.adjustIndentation=2})(bAn||(bAn={}));var SAn;(function(t){function e(r){let n=r;return n&&(mt.string(n.detail)||n.detail===void 0)&&(mt.string(n.description)||n.description===void 0)}a(e,"is"),t.is=e})(SAn||(SAn={}));var TAn;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(TAn||(TAn={}));var IAn;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(IAn||(IAn={}));var Xze;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(e,"fromPlainText"),t.fromPlainText=e;function r(n){let o=n;return mt.string(o)||mt.objectLiteral(o)&&mt.string(o.language)&&mt.string(o.value)}a(r,"is"),t.is=r})(Xze||(Xze={}));var xAn;(function(t){function e(r){let n=r;return!!n&&mt.objectLiteral(n)&&(Jxe.is(n.contents)||Xze.is(n.contents)||mt.typedArray(n.contents,Xze.is))&&(r.range===void 0||xu.is(r.range))}a(e,"is"),t.is=e})(xAn||(xAn={}));var wAn;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})(wAn||(wAn={}));var RAn;(function(t){function e(r,n,...o){let s={label:r};return mt.defined(n)&&(s.documentation=n),mt.defined(o)?s.parameters=o:s.parameters=[],s}a(e,"create"),t.create=e})(RAn||(RAn={}));var kAn;(function(t){t.Text=1,t.Read=2,t.Write=3})(kAn||(kAn={}));var PAn;(function(t){function e(r,n){let o={range:r};return mt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(PAn||(PAn={}));var DAn;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(DAn||(DAn={}));var NAn;(function(t){t.Deprecated=1})(NAn||(NAn={}));var MAn;(function(t){function e(r,n,o,s,c){let l={name:r,kind:n,location:{uri:s,range:o}};return c&&(l.containerName=c),l}a(e,"create"),t.create=e})(MAn||(MAn={}));var OAn;(function(t){function e(r,n,o,s){return s!==void 0?{name:r,kind:n,location:{uri:o,range:s}}:{name:r,kind:n,location:{uri:o}}}a(e,"create"),t.create=e})(OAn||(OAn={}));var LAn;(function(t){function e(n,o,s,c,l,u){let d={name:n,detail:o,kind:s,range:c,selectionRange:l};return u!==void 0&&(d.children=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.name)&&mt.number(o.kind)&&xu.is(o.range)&&xu.is(o.selectionRange)&&(o.detail===void 0||mt.string(o.detail))&&(o.deprecated===void 0||mt.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}a(r,"is"),t.is=r})(LAn||(LAn={}));var BAn;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(BAn||(BAn={}));var eYe;(function(t){t.Invoked=1,t.Automatic=2})(eYe||(eYe={}));var FAn;(function(t){function e(n,o,s){let c={diagnostics:n};return o!=null&&(c.only=o),s!=null&&(c.triggerKind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.typedArray(o.diagnostics,Zze.is)&&(o.only===void 0||mt.typedArray(o.only,mt.string))&&(o.triggerKind===void 0||o.triggerKind===eYe.Invoked||o.triggerKind===eYe.Automatic)}a(r,"is"),t.is=r})(FAn||(FAn={}));var UAn;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):Aue.is(o)?c.command=o:c.edit=o,l&&s!==void 0&&(c.kind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.title)&&(o.diagnostics===void 0||mt.typedArray(o.diagnostics,Zze.is))&&(o.kind===void 0||mt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Aue.is(o.command))&&(o.isPreferred===void 0||mt.boolean(o.isPreferred))&&(o.edit===void 0||f7t.is(o.edit))}a(r,"is"),t.is=r})(UAn||(UAn={}));var QAn;(function(t){function e(n,o){let s={range:n};return mt.defined(o)&&(s.data=o),s}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&xu.is(o.range)&&(mt.undefined(o.command)||Aue.is(o.command))}a(r,"is"),t.is=r})(QAn||(QAn={}));var qAn;(function(t){function e(n,o){return{tabSize:n,insertSpaces:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.uinteger(o.tabSize)&&mt.boolean(o.insertSpaces)}a(r,"is"),t.is=r})(qAn||(qAn={}));var jAn;(function(t){function e(n,o,s){return{range:n,target:o,data:s}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&xu.is(o.range)&&(mt.undefined(o.target)||mt.string(o.target))}a(r,"is"),t.is=r})(jAn||(jAn={}));var HAn;(function(t){function e(n,o){return{range:n,parent:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&xu.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})(HAn||(HAn={}));var GAn;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(GAn||(GAn={}));var $An;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})($An||($An={}));var VAn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}a(e,"is"),t.is=e})(VAn||(VAn={}));var WAn;(function(t){function e(n,o){return{range:n,text:o}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&xu.is(o.range)&&mt.string(o.text)}a(r,"is"),t.is=r})(WAn||(WAn={}));var zAn;(function(t){function e(n,o,s){return{range:n,variableName:o,caseSensitiveLookup:s}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&xu.is(o.range)&&mt.boolean(o.caseSensitiveLookup)&&(mt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})(zAn||(zAn={}));var YAn;(function(t){function e(n,o){return{range:n,expression:o}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&xu.is(o.range)&&(mt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})(YAn||(YAn={}));var KAn;(function(t){function e(n,o){return{frameId:n,stoppedLocation:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&xu.is(n.stoppedLocation)}a(r,"is"),t.is=r})(KAn||(KAn={}));var m7t;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(m7t||(m7t={}));var g7t;(function(t){function e(n){return{value:n}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&(o.tooltip===void 0||mt.string(o.tooltip)||Jxe.is(o.tooltip))&&(o.location===void 0||Jze.is(o.location))&&(o.command===void 0||Aue.is(o.command))}a(r,"is"),t.is=r})(g7t||(g7t={}));var JAn;(function(t){function e(n,o,s){let c={position:n,label:o};return s!==void 0&&(c.kind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&E_.is(o.position)&&(mt.string(o.label)||mt.typedArray(o.label,g7t.is))&&(o.kind===void 0||m7t.is(o.kind))&&o.textEdits===void 0||mt.typedArray(o.textEdits,yue.is)&&(o.tooltip===void 0||mt.string(o.tooltip)||Jxe.is(o.tooltip))&&(o.paddingLeft===void 0||mt.boolean(o.paddingLeft))&&(o.paddingRight===void 0||mt.boolean(o.paddingRight))}a(r,"is"),t.is=r})(JAn||(JAn={}));var ZAn;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(ZAn||(ZAn={}));var XAn;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(XAn||(XAn={}));var eyn;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(eyn||(eyn={}));var tyn;(function(t){t.Invoked=0,t.Automatic=1})(tyn||(tyn={}));var ryn;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(ryn||(ryn={}));var nyn;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(nyn||(nyn={}));var iyn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&i7t.is(n.uri)&&mt.string(n.name)}a(e,"is"),t.is=e})(iyn||(iyn={}));var oyn;(function(t){function e(s,c,l,u){return new A7t(s,c,l,u)}a(e,"create"),t.create=e;function r(s){let c=s;return!!(mt.defined(c)&&mt.string(c.uri)&&(mt.undefined(c.languageId)||mt.string(c.languageId))&&mt.uinteger(c.lineCount)&&mt.func(c.getText)&&mt.func(c.positionAt)&&mt.func(c.offsetAt))}a(r,"is"),t.is=r;function n(s,c){let l=s.getText(),u=o(c,(f,h)=>{let m=f.range.start.line-h.range.start.line;return m===0?f.range.start.character-h.range.start.character:m}),d=l.length;for(let f=u.length-1;f>=0;f--){let h=u[f],m=s.offsetAt(h.range.start),g=s.offsetAt(h.range.end);if(g<=d)l=l.substring(0,m)+h.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");d=m}return l}a(n,"applyEdits"),t.applyEdits=n;function o(s,c){if(s.length<=1)return s;let l=s.length/2|0,u=s.slice(0,l),d=s.slice(l);o(u,c),o(d,c);let f=0,h=0,m=0;for(;f0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,o=r.length;if(o===0)return E_.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return E_.create(s,e-r[s])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],o=e.line+1"u"}a(n,"undefined"),t.undefined=n;function o(g){return g===!0||g===!1}a(o,"boolean"),t.boolean=o;function s(g){return e.call(g)==="[object String]"}a(s,"string"),t.string=s;function c(g){return e.call(g)==="[object Number]"}a(c,"number"),t.number=c;function l(g,A,y){return e.call(g)==="[object Number]"&&A<=g&&g<=y}a(l,"numberRange"),t.numberRange=l;function u(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}a(u,"integer"),t.integer=u;function d(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}a(d,"uinteger"),t.uinteger=d;function f(g){return e.call(g)==="[object Function]"}a(f,"func"),t.func=f;function h(g){return g!==null&&typeof g=="object"}a(h,"objectLiteral"),t.objectLiteral=h;function m(g,A){return Array.isArray(g)&&g.every(A)}a(m,"typedArray"),t.typedArray=m})(mt||(mt={}));var wu=class{static{a(this,"LocationFactory")}static{this.range=xu.create.bind(xu)}static{this.position=E_.create.bind(E_)}},iT=class t{constructor(e,r,n){this.uri=e;this._textDocument=r;this.detectedLanguageId=n}static{a(this,"CopilotTextDocument")}static withChanges(e,r,n){let o=iF.create(e.clientUri,e.clientLanguageId,n,e.getText());return iF.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=iF.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return iF.update(r,e.map(n=>({text:n.newText,range:n.range})),this.version),new t(this.uri,r,this.detectedLanguageId)}static create(e,r,n,o,s=OO({uri:e,languageId:r})){return new t(Gs(e),iF.create(e,r,n,o),s)}get clientUri(){return this._textDocument.uri}get clientLanguageId(){return this._textDocument.languageId}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){let r=typeof e=="number"?e:e.line;if(r<0||r>=this.lineCount)throw new RangeError("Illegal value for lineNumber");let n=xu.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=xu.create(E_.create(r,0),E_.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var FO=require("worker_threads");var uqo=5,oyn=3e4,A7t=class extends aq{constructor(r){super();this.worker=r;this.didChangeEmitter=new Ji;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>Gs(n))}getWorkspaceFolder(r){let n=Gs(r.uri);for(let o of this.workspaceFolders)if(n.startsWith(o))return o}async readValidFile(r){try{let n=await this.worker.readAndValidateUri(r.uri);return n.valid?{status:"valid",document:iT.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},y7t=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new A7t(this);this.providers=[];this.port=e,this.port.on("message",o=>{o&&typeof o=="object"&&o.__perf__&&this.port.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",o=>{this.handleMessage(o)}),this.fileSystem.setWorkspaceFolders(r),this.documentManager=new zze(this.fileSystem,n),this.coordinator=new Hze(this.documentManager,n),this.recentActivityProvider=new qze,this.providers.push(this.recentActivityProvider)}static{a(this,"ContextWorker")}addLocalProvider(e){this.providers.push(e)}async handleMessage(e){if(e&&typeof e=="object"&&e.__perf__)return;if(!X0n(e)||typeof e.id!="number"){this.port.postMessage({error:new Error(`Received unrecognized context worker message: ${JSON.stringify(e)}`)});return}let n=e;try{await this.handleMessageUnsafe(n)}catch(o){this.port.postMessage(new pq(n.id,"Error",o))}}async handleMessageUnsafe(e){switch(e.messageType){case"Exit":this.exit(),this.port.postMessage(new pq(e.id,"Exit",void 0)),this.port?.close();break;case"RequestUpdate":await this.updateContext(e);break;case"ReadAndValidateResponse":this.settleValidation(e);break;default:throw new Error(`Received inappropriate context client message: ${JSON.stringify(e)}`)}}readAndValidateUri(e){let r=this.validationQueue.get(e)?.deferred;if(!r){let n=this.nextId--,o=setTimeout(()=>{let s=this.activeValidations.get(n)??this.validationQueue.get(e);s&&s.id===n&&(s.deferred.reject(new Error(`Validation timed out after ${oyn}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},oyn);r=new UA,this.validationQueue.set(e,{id:n,uri:e,deferred:r,timeout:o}),this.advanceValidationQueue()}return r.promise}advanceValidationQueue(){for(;this.validationQueue.size>0&&this.activeValidations.sizer.getNodeWeight(h.id)??0),c[d.uri]=f}this.port.postMessage(new pq(e.id,"UpdateResponse",{documents:c}));let l=[];for(let d of this.providers)l.push(V9t(d.getContext(n,r,this.documentManager)));let u=await Promise.all(l);for(let d of u)if(d.status==="error"){let f=d.reason instanceof Error?d.reason:new Error(String(d.reason));this.port.postMessage(new pq(e.id,"Error",f))}else for(let f of d.value??[])this.coordinator.pushWorkspaceContext(f.source,[f])}exit(){for(let e of this.providers)e.dispose();this.providers=[],this.documentManager.dispose()}};function _7t(){return FO.parentPort!==null&&e7t(FO.workerData)}a(_7t,"isContextWorker");function syn(){if(!_7t())throw new Error("This must be run in a worker thread.");if(!e7t(FO.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(FO.workerData)}`);let t=FO.workerData.cwd;process.cwd=()=>t;let e=new y7t(FO.parentPort,FO.workerData.workspaceRoots,FO.workerData.config);e.addLocalProvider(new Bze(e.fileSystem,e.documentManager)),e.addLocalProvider(new Qze(e.fileSystem,e.documentManager)),e.addLocalProvider(new jze)}a(syn,"runContextWorker");p();var Zxe=fe(require("util"));function ayn(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(_7(t)==="dev")return t.get(Jf).logIt(t,n,"console",...o)}return a(r,"logIt"),e.debug=(...n)=>r(4,...n),e.info=(...n)=>r(3,...n),e.warn=(...n)=>r(2,...n),e.error=(...n)=>r(1,...n),e.assert=(n,...o)=>{n||(o.length===0?r(2,"Assertion failed"):r(2,"Assertion failed:",Zxe.format(...o)))},e.dir=(n,o)=>r(4,Zxe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(Zxe.format(...n));o.name="Trace",e.log(o)},e}a(ayn,"createConsole");p();p();var rYe=fe(require("path")),cyn=require("worker_threads");var nYe=new Map,dqo=0;function Xxe(t,e){let r=dqo++;nYe.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,nYe.delete(r),t.removeListener("exit",s),t.removeAllListeners===c&&(t.removeAllListeners=n))},"unregisterWorker"),c=a((l=>((l===void 0||l==="exit")&&s(),n(l))),"patchedRemoveAllListeners");return t.removeAllListeners=c,t.once("exit",s),s}a(Xxe,"registerWorker");function lyn(t,e){let r=new cyn.Worker(rYe.default.resolve(fqo(),t),{workerData:e});return Xxe(r,t),r}a(lyn,"createWorker");function fqo(){return rYe.default.extname(__filename)!==".ts"?__dirname:rYe.default.resolve(__dirname,"../../dist")}a(fqo,"workerBundleDir");function uyn(){return nYe.size}a(uyn,"getActiveWorkerCount");async function dyn(){let t=[],e=[];for(let[r,{worker:n,name:o}]of nYe)e.push(new Promise(s=>{let c=setTimeout(()=>{n.removeListener("message",l),s()},1e3);c.unref();let l=a(u=>{if(u&&typeof u=="object"&&u.__perf__){clearTimeout(c),n.removeListener("message",l);let f=u.memoryUsage;t.push({id:r,name:o,heapUsedBytes:f?.heapUsed??0,heapTotalBytes:f?.heapTotal??0,externalBytes:f?.external??0,arrayBufferBytes:f?.arrayBuffers??0}),s()}},"handler");n.on("message",l);try{n.postMessage({__perf__:!0})}catch{clearTimeout(c),n.removeListener("message",l),s()}}));return await Promise.allSettled(e),t}a(dyn,"collectWorkerPerfStats");var iYe=fe(require("os")),fyn=fe(require("v8"));function pqo(t){let e=kt(t,ze.PerfEnabled);return e==="false"||e===!1?{enabled:!1,shouldSample:!1}:e==="true"||e===!0?{enabled:!0,shouldSample:!0}:{enabled:!0,shouldSample:Math.random()<.01}}a(pqo,"getPerfState");var jK=class t{constructor(e,r=dyn){this.ctx=e;this.collectWorkerStats=r;this.sampled=!1;this.pendingTimeouts=[];this.lastCpuUsage=process.cpuUsage();this.lastCpuTime=Date.now();this.lastHighRssTime=0}static{a(this,"PerfMonitor")}static{this.HIGH_RSS_BYTES=2*1024*1024*1024}start(){this.sampled=pqo(this.ctx).shouldSample,this.sampled&&(this.scheduleTimeout(()=>{this.emitSnapshot("startup_30s")},3e4),this.scheduleTimeout(()=>{this.emitSnapshot("startup_1min")},6e4),this.scheduleTimeout(()=>{this.emitSnapshot("startup_5min")},3e5),this.snapshotTimer=setInterval(()=>{this.emitSnapshot("periodic")},6e5),this.snapshotTimer.unref())}stop(){this.snapshotTimer&&(clearInterval(this.snapshotTimer),this.snapshotTimer=void 0);for(let e of this.pendingTimeouts)clearTimeout(e);this.pendingTimeouts.length=0}scheduleTimeout(e,r){let n=setTimeout(()=>{let o=this.pendingTimeouts.indexOf(n);o>=0&&this.pendingTimeouts.splice(o,1),e()},r);n.unref(),this.pendingTimeouts.push(n)}async emitSnapshot(e){try{let r=process.memoryUsage(),n=fyn.getHeapStatistics(),o=this.cpuDelta(),s=uyn(),c=0,l="";try{let u=await this.collectWorkerStats();s=u.length;for(let d of u)c+=d.heapUsedBytes;u.length>0&&(l=JSON.stringify(u.map(d=>({id:d.id,n:d.name,heap:d.heapUsedBytes,heapTotal:d.heapTotalBytes,ext:d.externalBytes,arrBuf:d.arrayBufferBytes}))))}catch{}if(sr(this.ctx,"cls.perf.memory_snapshot",{platform:process.platform,trigger:e,workerDetails:l},{uptimeMs:Math.round(process.uptime()*1e3),rssBytes:r.rss,heapUsedBytes:r.heapUsed,heapTotalBytes:r.heapTotal,heapSizeLimitBytes:n.heap_size_limit,externalBytes:r.external,arrayBufferBytes:r.arrayBuffers,cpuPercent:o.total,cpuUserPercent:o.user,cpuSystemPercent:o.system,systemFreeMemBytes:iYe.freemem(),systemTotalMemBytes:iYe.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:XE(this.ctx)?0:1}),ft(this.ctx,"cls.perf.memory_snapshot"),e!=="high_rss_followup_30s"&&r.rss>t.HIGH_RSS_BYTES){let u=Date.now();u-this.lastHighRssTime>=6e5&&(this.lastHighRssTime=u,this.scheduleTimeout(()=>{this.emitSnapshot("high_rss_followup_30s")},3e4))}}catch{}}cpuDelta(){let e=Date.now(),r=e-this.lastCpuTime;if(r<=0)return{total:0,user:0,system:0};let n=process.cpuUsage(),o=(n.user-this.lastCpuUsage.user)/1e3/r*100,s=(n.system-this.lastCpuUsage.system)/1e3/r*100;return this.lastCpuUsage=n,this.lastCpuTime=e,{total:Math.round((o+s)*100)/100,user:Math.round(o*100)/100,system:Math.round(s*100)/100}}};var iP=fe(s2()),Zmo=require("worker_threads");p();p();var $Ye=require("assert");p();p();var Ijo={right:Pjo,center:Djo},xjo=0,OYe=1,wjo=2,LYe=3,$7t=class{static{a(this,"UI")}constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(` +`&&o++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,o=r.length;if(o===0)return E_.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return E_.create(s,e-r[s])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],o=e.line+1"u"}a(n,"undefined"),t.undefined=n;function o(g){return g===!0||g===!1}a(o,"boolean"),t.boolean=o;function s(g){return e.call(g)==="[object String]"}a(s,"string"),t.string=s;function c(g){return e.call(g)==="[object Number]"}a(c,"number"),t.number=c;function l(g,A,y){return e.call(g)==="[object Number]"&&A<=g&&g<=y}a(l,"numberRange"),t.numberRange=l;function u(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}a(u,"integer"),t.integer=u;function d(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}a(d,"uinteger"),t.uinteger=d;function f(g){return e.call(g)==="[object Function]"}a(f,"func"),t.func=f;function h(g){return g!==null&&typeof g=="object"}a(h,"objectLiteral"),t.objectLiteral=h;function m(g,A){return Array.isArray(g)&&g.every(A)}a(m,"typedArray"),t.typedArray=m})(mt||(mt={}));var wu=class{static{a(this,"LocationFactory")}static{this.range=xu.create.bind(xu)}static{this.position=E_.create.bind(E_)}},iT=class t{constructor(e,r,n){this.uri=e;this._textDocument=r;this.detectedLanguageId=n}static{a(this,"CopilotTextDocument")}static withChanges(e,r,n){let o=iF.create(e.clientUri,e.clientLanguageId,n,e.getText());return iF.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=iF.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return iF.update(r,e.map(n=>({text:n.newText,range:n.range})),this.version),new t(this.uri,r,this.detectedLanguageId)}static create(e,r,n,o,s=OO({uri:e,languageId:r})){return new t(Gs(e),iF.create(e,r,n,o),s)}get clientUri(){return this._textDocument.uri}get clientLanguageId(){return this._textDocument.languageId}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){let r=typeof e=="number"?e:e.line;if(r<0||r>=this.lineCount)throw new RangeError("Illegal value for lineNumber");let n=xu.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=xu.create(E_.create(r,0),E_.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var FO=require("worker_threads");var fqo=5,syn=3e4,y7t=class extends aq{constructor(r){super();this.worker=r;this.didChangeEmitter=new Ji;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>Gs(n))}getWorkspaceFolder(r){let n=Gs(r.uri);for(let o of this.workspaceFolders)if(n.startsWith(o))return o}async readValidFile(r){try{let n=await this.worker.readAndValidateUri(r.uri);return n.valid?{status:"valid",document:iT.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},_7t=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new y7t(this);this.providers=[];this.port=e,this.port.on("message",o=>{o&&typeof o=="object"&&o.__perf__&&this.port.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",o=>{this.handleMessage(o)}),this.fileSystem.setWorkspaceFolders(r),this.documentManager=new zze(this.fileSystem,n),this.coordinator=new Hze(this.documentManager,n),this.recentActivityProvider=new qze,this.providers.push(this.recentActivityProvider)}static{a(this,"ContextWorker")}addLocalProvider(e){this.providers.push(e)}async handleMessage(e){if(e&&typeof e=="object"&&e.__perf__)return;if(!eAn(e)||typeof e.id!="number"){this.port.postMessage({error:new Error(`Received unrecognized context worker message: ${JSON.stringify(e)}`)});return}let n=e;try{await this.handleMessageUnsafe(n)}catch(o){this.port.postMessage(new pq(n.id,"Error",o))}}async handleMessageUnsafe(e){switch(e.messageType){case"Exit":this.exit(),this.port.postMessage(new pq(e.id,"Exit",void 0)),this.port?.close();break;case"RequestUpdate":await this.updateContext(e);break;case"ReadAndValidateResponse":this.settleValidation(e);break;default:throw new Error(`Received inappropriate context client message: ${JSON.stringify(e)}`)}}readAndValidateUri(e){let r=this.validationQueue.get(e)?.deferred;if(!r){let n=this.nextId--,o=setTimeout(()=>{let s=this.activeValidations.get(n)??this.validationQueue.get(e);s&&s.id===n&&(s.deferred.reject(new Error(`Validation timed out after ${syn}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},syn);r=new UA,this.validationQueue.set(e,{id:n,uri:e,deferred:r,timeout:o}),this.advanceValidationQueue()}return r.promise}advanceValidationQueue(){for(;this.validationQueue.size>0&&this.activeValidations.sizer.getNodeWeight(h.id)??0),c[d.uri]=f}this.port.postMessage(new pq(e.id,"UpdateResponse",{documents:c}));let l=[];for(let d of this.providers)l.push(W9t(d.getContext(n,r,this.documentManager)));let u=await Promise.all(l);for(let d of u)if(d.status==="error"){let f=d.reason instanceof Error?d.reason:new Error(String(d.reason));this.port.postMessage(new pq(e.id,"Error",f))}else for(let f of d.value??[])this.coordinator.pushWorkspaceContext(f.source,[f])}exit(){for(let e of this.providers)e.dispose();this.providers=[],this.documentManager.dispose()}};function E7t(){return FO.parentPort!==null&&t7t(FO.workerData)}a(E7t,"isContextWorker");function ayn(){if(!E7t())throw new Error("This must be run in a worker thread.");if(!t7t(FO.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(FO.workerData)}`);let t=FO.workerData.cwd;process.cwd=()=>t;let e=new _7t(FO.parentPort,FO.workerData.workspaceRoots,FO.workerData.config);e.addLocalProvider(new Bze(e.fileSystem,e.documentManager)),e.addLocalProvider(new Qze(e.fileSystem,e.documentManager)),e.addLocalProvider(new jze)}a(ayn,"runContextWorker");p();var Zxe=fe(require("util"));function cyn(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(_7(t)==="dev")return t.get(Jf).logIt(t,n,"console",...o)}return a(r,"logIt"),e.debug=(...n)=>r(4,...n),e.info=(...n)=>r(3,...n),e.warn=(...n)=>r(2,...n),e.error=(...n)=>r(1,...n),e.assert=(n,...o)=>{n||(o.length===0?r(2,"Assertion failed"):r(2,"Assertion failed:",Zxe.format(...o)))},e.dir=(n,o)=>r(4,Zxe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(Zxe.format(...n));o.name="Trace",e.log(o)},e}a(cyn,"createConsole");p();p();var rYe=fe(require("path")),lyn=require("worker_threads");var nYe=new Map,pqo=0;function Xxe(t,e){let r=pqo++;nYe.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,nYe.delete(r),t.removeListener("exit",s),t.removeAllListeners===c&&(t.removeAllListeners=n))},"unregisterWorker"),c=a((l=>((l===void 0||l==="exit")&&s(),n(l))),"patchedRemoveAllListeners");return t.removeAllListeners=c,t.once("exit",s),s}a(Xxe,"registerWorker");function uyn(t,e){let r=new lyn.Worker(rYe.default.resolve(hqo(),t),{workerData:e});return Xxe(r,t),r}a(uyn,"createWorker");function hqo(){return rYe.default.extname(__filename)!==".ts"?__dirname:rYe.default.resolve(__dirname,"../../dist")}a(hqo,"workerBundleDir");function dyn(){return nYe.size}a(dyn,"getActiveWorkerCount");async function fyn(){let t=[],e=[];for(let[r,{worker:n,name:o}]of nYe)e.push(new Promise(s=>{let c=setTimeout(()=>{n.removeListener("message",l),s()},1e3);c.unref();let l=a(u=>{if(u&&typeof u=="object"&&u.__perf__){clearTimeout(c),n.removeListener("message",l);let f=u.memoryUsage;t.push({id:r,name:o,heapUsedBytes:f?.heapUsed??0,heapTotalBytes:f?.heapTotal??0,externalBytes:f?.external??0,arrayBufferBytes:f?.arrayBuffers??0}),s()}},"handler");n.on("message",l);try{n.postMessage({__perf__:!0})}catch{clearTimeout(c),n.removeListener("message",l),s()}}));return await Promise.allSettled(e),t}a(fyn,"collectWorkerPerfStats");var iYe=fe(require("os")),pyn=fe(require("v8"));function mqo(t){let e=kt(t,ze.PerfEnabled);return e==="false"||e===!1?{enabled:!1,shouldSample:!1}:e==="true"||e===!0?{enabled:!0,shouldSample:!0}:{enabled:!0,shouldSample:Math.random()<.01}}a(mqo,"getPerfState");var HK=class t{constructor(e,r=fyn){this.ctx=e;this.collectWorkerStats=r;this.sampled=!1;this.pendingTimeouts=[];this.lastCpuUsage=process.cpuUsage();this.lastCpuTime=Date.now();this.lastHighRssTime=0}static{a(this,"PerfMonitor")}static{this.HIGH_RSS_BYTES=2*1024*1024*1024}start(){this.sampled=mqo(this.ctx).shouldSample,this.sampled&&(this.scheduleTimeout(()=>{this.emitSnapshot("startup_30s")},3e4),this.scheduleTimeout(()=>{this.emitSnapshot("startup_1min")},6e4),this.scheduleTimeout(()=>{this.emitSnapshot("startup_5min")},3e5),this.snapshotTimer=setInterval(()=>{this.emitSnapshot("periodic")},6e5),this.snapshotTimer.unref())}stop(){this.snapshotTimer&&(clearInterval(this.snapshotTimer),this.snapshotTimer=void 0);for(let e of this.pendingTimeouts)clearTimeout(e);this.pendingTimeouts.length=0}scheduleTimeout(e,r){let n=setTimeout(()=>{let o=this.pendingTimeouts.indexOf(n);o>=0&&this.pendingTimeouts.splice(o,1),e()},r);n.unref(),this.pendingTimeouts.push(n)}async emitSnapshot(e){try{let r=process.memoryUsage(),n=pyn.getHeapStatistics(),o=this.cpuDelta(),s=dyn(),c=0,l="";try{let u=await this.collectWorkerStats();s=u.length;for(let d of u)c+=d.heapUsedBytes;u.length>0&&(l=JSON.stringify(u.map(d=>({id:d.id,n:d.name,heap:d.heapUsedBytes,heapTotal:d.heapTotalBytes,ext:d.externalBytes,arrBuf:d.arrayBufferBytes}))))}catch{}if(sr(this.ctx,"cls.perf.memory_snapshot",{platform:process.platform,trigger:e,workerDetails:l},{uptimeMs:Math.round(process.uptime()*1e3),rssBytes:r.rss,heapUsedBytes:r.heapUsed,heapTotalBytes:r.heapTotal,heapSizeLimitBytes:n.heap_size_limit,externalBytes:r.external,arrayBufferBytes:r.arrayBuffers,cpuPercent:o.total,cpuUserPercent:o.user,cpuSystemPercent:o.system,systemFreeMemBytes:iYe.freemem(),systemTotalMemBytes:iYe.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:XE(this.ctx)?0:1}),ft(this.ctx,"cls.perf.memory_snapshot"),e!=="high_rss_followup_30s"&&r.rss>t.HIGH_RSS_BYTES){let u=Date.now();u-this.lastHighRssTime>=6e5&&(this.lastHighRssTime=u,this.scheduleTimeout(()=>{this.emitSnapshot("high_rss_followup_30s")},3e4))}}catch{}}cpuDelta(){let e=Date.now(),r=e-this.lastCpuTime;if(r<=0)return{total:0,user:0,system:0};let n=process.cpuUsage(),o=(n.user-this.lastCpuUsage.user)/1e3/r*100,s=(n.system-this.lastCpuUsage.system)/1e3/r*100;return this.lastCpuUsage=n,this.lastCpuTime=e,{total:Math.round((o+s)*100)/100,user:Math.round(o*100)/100,system:Math.round(s*100)/100}}};var iP=fe(s2()),ego=require("worker_threads");p();p();var $Ye=require("assert");p();p();var wjo={right:Njo,center:Mjo},Rjo=0,OYe=1,kjo=2,LYe=3,V7t=class{static{a(this,"UI")}constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(` `).map(o=>o.split(" ")),n=0;return r.forEach(o=>{o.length>1&&oT.stringWidth(o[0])>n&&(n=Math.min(Math.floor(this.width*.5),oT.stringWidth(o[0])))}),r.forEach(o=>{this.div(...o.map((s,c)=>({text:s.trim(),padding:this.measurePadding(s),width:c===0&&o.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let r=oT.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(` -`)}rowToString(e,r){return this.rasterize(e).forEach((n,o)=>{let s="";n.forEach((c,l)=>{let{width:u}=e[l],d=this.negatePadding(e[l]),f=c;if(d>oT.stringWidth(c)&&(f+=" ".repeat(d-oT.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=Ijo[e[l].align];f=m(f,d),oT.stringWidth(f)0&&(s=this.renderInline(s,r[r.length-1]))}),r.push({text:s.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),o=n?n[0].length:0,s=r.text,c=oT.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=oT.wrap(s.text,this.negatePadding(s),{hard:!0}).split(` +`)}rowToString(e,r){return this.rasterize(e).forEach((n,o)=>{let s="";n.forEach((c,l)=>{let{width:u}=e[l],d=this.negatePadding(e[l]),f=c;if(d>oT.stringWidth(c)&&(f+=" ".repeat(d-oT.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=wjo[e[l].align];f=m(f,d),oT.stringWidth(f)0&&(s=this.renderInline(s,r[r.length-1]))}),r.push({text:s.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),o=n?n[0].length:0,s=r.text,c=oT.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=oT.wrap(s.text,this.negatePadding(s),{hard:!0}).split(` `):o=s.text.split(` -`),s.border&&(o.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),o.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(o.unshift(...new Array(s.padding[xjo]||0).fill("")),o.push(...new Array(s.padding[wjo]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||oT.stringWidth(c.text));let r=e.length,n=this.width,o=e.map(c=>{if(c.width)return r--,n-=c.width,c.width}),s=r?Math.floor(n/r):0;return o.map((c,l)=>c===void 0?Math.max(s,Rjo(e[l])):c)}};function s_n(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(s_n,"addBorder");function Rjo(t){let e=t.padding||[],r=1+(e[LYe]||0)+(e[OYe]||0);return t.border?r+4:r}a(Rjo,"_minWidth");function kjo(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(kjo,"getWindowWidth");function Pjo(t,e){t=t.trim();let r=oT.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(Djo,"alignCenter");var oT;function a_n(t,e){return oT=e,new $7t({width:t?.width||kjo(),wrap:t?.wrap})}a(a_n,"cliui");p();p();p();function V7t({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}a(V7t,"ansiRegex");var Njo=V7t();function VK(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(Njo,"")}a(VK,"stripAnsi");p();p();p();var c_n=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],l_n=12288,u_n=65510,d_n=[12288,12288,65281,65376,65504,65510];var f_n=4352,p_n=262141,W7t=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];p();var BYe=a((t,e)=>{let r=0,n=Math.floor(t.length/2)-1;for(;r<=n;){let o=Math.floor((r+n)/2),s=o*2;if(et[s+1])r=o+1;else return!0}return!1},"isInRange");var h_n=19968,[Ljo,Bjo]=Fjo(W7t);function Fjo(t){let e=t[0],r=t[1];for(let n=0;n=o&&h_n<=s)return[o,s];s-o>r-e&&(e=o,r=s)}return[e,r]}a(Fjo,"findWideFastPathRange");var m_n=a(t=>t<161||t>1114109?!1:BYe(c_n,t),"isAmbiguous"),g_n=a(t=>tu_n?!1:BYe(d_n,t),"isFullWidth");var A_n=a(t=>t>=Ljo&&t<=Bjo?!0:tp_n?!1:BYe(W7t,t),"isWide");function Ujo(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(Ujo,"validate");function WK(t,{ambiguousAsWide:e=!1}={}){return Ujo(t),g_n(t)||A_n(t)||e&&m_n(t)?2:1}a(WK,"eastAsianWidth");p();var y_n=a(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"default");var Qjo=new Intl.Segmenter,qjo=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function oF(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=VK(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of Qjo.segment(t)){let l=c.codePointAt(0);if(!(l<=31||l>=127&&l<=159)&&!(l>=8203&&l<=8207||l===65279)&&!(l>=768&&l<=879||l>=6832&&l<=6911||l>=7616&&l<=7679||l>=8400&&l<=8447||l>=65056&&l<=65071)&&!(l>=55296&&l<=57343)&&!(l>=65024&&l<=65039)&&!qjo.test(c)){if(y_n().test(c)){o+=2;continue}o+=WK(l,s)}}return o}a(oF,"stringWidth");p();p();var __n=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),E_n=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),v_n=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),zd={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Uju=Object.keys(zd.modifier),jjo=Object.keys(zd.color),Hjo=Object.keys(zd.bgColor),Qju=[...jjo,...Hjo];function Gjo(){let t=new Map;for(let[e,r]of Object.entries(zd)){for(let[n,o]of Object.entries(r))zd[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=zd[n],t.set(o[0],o[1]);Object.defineProperty(zd,e,{value:r,enumerable:!1})}return Object.defineProperty(zd,"codes",{value:t,enumerable:!1}),zd.color.close="\x1B[39m",zd.bgColor.close="\x1B[49m",zd.color.ansi=__n(),zd.color.ansi256=E_n(),zd.color.ansi16m=v_n(),zd.bgColor.ansi=__n(10),zd.bgColor.ansi256=E_n(10),zd.bgColor.ansi16m=v_n(10),Object.defineProperties(zd,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:a(e=>zd.rgbToAnsi256(...zd.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let l=e%36;r=Math.floor(e/36)/5,n=Math.floor(l/6)/5,o=l%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let c=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(c+=60),c},enumerable:!1},rgbToAnsi:{value:a((e,r,n)=>zd.ansi256ToAnsi(zd.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>zd.ansi256ToAnsi(zd.hexToAnsi256(e)),"value"),enumerable:!1}}),zd}a(Gjo,"assembleStyles");var $jo=Gjo(),C_n=$jo;var UYe=new Set(["\x1B","\x9B"]),Vjo=39,Y7t="\x07",T_n="[",Wjo="]",I_n="m",FYe=`${Wjo}8;;`,b_n=a(t=>`${UYe.values().next().value}${T_n}${t}${I_n}`,"wrapAnsiCode"),S_n=a(t=>`${UYe.values().next().value}${FYe}${t}${Y7t}`,"wrapAnsiHyperlink"),zjo=a(t=>t.split(" ").map(e=>oF(e)),"wordLengths"),z7t=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=oF(VK(t.at(-1)));for(let[l,u]of n.entries()){let d=oF(u);if(c+d<=r?t[t.length-1]+=u:(t.push(u),c=0),UYe.has(u)&&(o=!0,s=n.slice(l+1,l+1+FYe.length).join("")===FYe),o){s?u===Y7t&&(o=!1,s=!1):u===I_n&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),Yjo=a(t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(oF(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),Kjo=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=zjo(t),l=[""];for(let[h,m]of t.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l.at(-1).trimStart());let g=oF(l.at(-1));if(h!==0&&(g>=e&&(r.wordWrap===!1||r.trim===!1)&&(l.push(""),g=0),(g>0||r.trim===!1)&&(l[l.length-1]+=" ",g++)),r.hard&&c[h]>e){let A=e-g,y=1+Math.floor((c[h]-A-1)/e);Math.floor((c[h]-1)/e)e&&g>0&&c[h]>0){if(r.wordWrap===!1&&ge&&r.wordWrap===!1){z7t(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>Yjo(h)));let u=l.join(` -`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,UYe.has(m)){let{groups:A}=new RegExp(`(?:\\${T_n}(?\\d+)m|\\${FYe}(?.*)${Y7t})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===Vjo?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=C_n.codes.get(Number(o));d[h+1]===` -`?(s&&(n+=S_n("")),o&&g&&(n+=b_n(g))):m===` -`&&(o&&g&&(n+=b_n(o)),s&&(n+=S_n(s))),f+=m.length}return n},"exec");function K7t(t,e,r){return String(t).normalize().replaceAll(`\r +`),s.border&&(o.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),o.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(o.unshift(...new Array(s.padding[Rjo]||0).fill("")),o.push(...new Array(s.padding[kjo]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||oT.stringWidth(c.text));let r=e.length,n=this.width,o=e.map(c=>{if(c.width)return r--,n-=c.width,c.width}),s=r?Math.floor(n/r):0;return o.map((c,l)=>c===void 0?Math.max(s,Pjo(e[l])):c)}};function a_n(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(a_n,"addBorder");function Pjo(t){let e=t.padding||[],r=1+(e[LYe]||0)+(e[OYe]||0);return t.border?r+4:r}a(Pjo,"_minWidth");function Djo(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(Djo,"getWindowWidth");function Njo(t,e){t=t.trim();let r=oT.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(Mjo,"alignCenter");var oT;function c_n(t,e){return oT=e,new V7t({width:t?.width||Djo(),wrap:t?.wrap})}a(c_n,"cliui");p();p();p();function W7t({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}a(W7t,"ansiRegex");var Ojo=W7t();function WK(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(Ojo,"")}a(WK,"stripAnsi");p();p();p();var l_n=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],u_n=12288,d_n=65510,f_n=[12288,12288,65281,65376,65504,65510];var p_n=4352,h_n=262141,z7t=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];p();var BYe=a((t,e)=>{let r=0,n=Math.floor(t.length/2)-1;for(;r<=n;){let o=Math.floor((r+n)/2),s=o*2;if(et[s+1])r=o+1;else return!0}return!1},"isInRange");var m_n=19968,[Fjo,Ujo]=Qjo(z7t);function Qjo(t){let e=t[0],r=t[1];for(let n=0;n=o&&m_n<=s)return[o,s];s-o>r-e&&(e=o,r=s)}return[e,r]}a(Qjo,"findWideFastPathRange");var g_n=a(t=>t<161||t>1114109?!1:BYe(l_n,t),"isAmbiguous"),A_n=a(t=>td_n?!1:BYe(f_n,t),"isFullWidth");var y_n=a(t=>t>=Fjo&&t<=Ujo?!0:th_n?!1:BYe(z7t,t),"isWide");function qjo(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(qjo,"validate");function zK(t,{ambiguousAsWide:e=!1}={}){return qjo(t),A_n(t)||y_n(t)||e&&g_n(t)?2:1}a(zK,"eastAsianWidth");p();var __n=a(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"default");var jjo=new Intl.Segmenter,Hjo=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function oF(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=WK(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of jjo.segment(t)){let l=c.codePointAt(0);if(!(l<=31||l>=127&&l<=159)&&!(l>=8203&&l<=8207||l===65279)&&!(l>=768&&l<=879||l>=6832&&l<=6911||l>=7616&&l<=7679||l>=8400&&l<=8447||l>=65056&&l<=65071)&&!(l>=55296&&l<=57343)&&!(l>=65024&&l<=65039)&&!Hjo.test(c)){if(__n().test(c)){o+=2;continue}o+=zK(l,s)}}return o}a(oF,"stringWidth");p();p();var E_n=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),v_n=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),C_n=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),Yd={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},qju=Object.keys(Yd.modifier),Gjo=Object.keys(Yd.color),$jo=Object.keys(Yd.bgColor),jju=[...Gjo,...$jo];function Vjo(){let t=new Map;for(let[e,r]of Object.entries(Yd)){for(let[n,o]of Object.entries(r))Yd[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Yd[n],t.set(o[0],o[1]);Object.defineProperty(Yd,e,{value:r,enumerable:!1})}return Object.defineProperty(Yd,"codes",{value:t,enumerable:!1}),Yd.color.close="\x1B[39m",Yd.bgColor.close="\x1B[49m",Yd.color.ansi=E_n(),Yd.color.ansi256=v_n(),Yd.color.ansi16m=C_n(),Yd.bgColor.ansi=E_n(10),Yd.bgColor.ansi256=v_n(10),Yd.bgColor.ansi16m=C_n(10),Object.defineProperties(Yd,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:a(e=>Yd.rgbToAnsi256(...Yd.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let l=e%36;r=Math.floor(e/36)/5,n=Math.floor(l/6)/5,o=l%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let c=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(c+=60),c},enumerable:!1},rgbToAnsi:{value:a((e,r,n)=>Yd.ansi256ToAnsi(Yd.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>Yd.ansi256ToAnsi(Yd.hexToAnsi256(e)),"value"),enumerable:!1}}),Yd}a(Vjo,"assembleStyles");var Wjo=Vjo(),b_n=Wjo;var UYe=new Set(["\x1B","\x9B"]),zjo=39,K7t="\x07",I_n="[",Yjo="]",x_n="m",FYe=`${Yjo}8;;`,S_n=a(t=>`${UYe.values().next().value}${I_n}${t}${x_n}`,"wrapAnsiCode"),T_n=a(t=>`${UYe.values().next().value}${FYe}${t}${K7t}`,"wrapAnsiHyperlink"),Kjo=a(t=>t.split(" ").map(e=>oF(e)),"wordLengths"),Y7t=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=oF(WK(t.at(-1)));for(let[l,u]of n.entries()){let d=oF(u);if(c+d<=r?t[t.length-1]+=u:(t.push(u),c=0),UYe.has(u)&&(o=!0,s=n.slice(l+1,l+1+FYe.length).join("")===FYe),o){s?u===K7t&&(o=!1,s=!1):u===x_n&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),Jjo=a(t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(oF(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),Zjo=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=Kjo(t),l=[""];for(let[h,m]of t.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l.at(-1).trimStart());let g=oF(l.at(-1));if(h!==0&&(g>=e&&(r.wordWrap===!1||r.trim===!1)&&(l.push(""),g=0),(g>0||r.trim===!1)&&(l[l.length-1]+=" ",g++)),r.hard&&c[h]>e){let A=e-g,y=1+Math.floor((c[h]-A-1)/e);Math.floor((c[h]-1)/e)e&&g>0&&c[h]>0){if(r.wordWrap===!1&&ge&&r.wordWrap===!1){Y7t(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>Jjo(h)));let u=l.join(` +`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,UYe.has(m)){let{groups:A}=new RegExp(`(?:\\${I_n}(?\\d+)m|\\${FYe}(?.*)${K7t})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===zjo?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=b_n.codes.get(Number(o));d[h+1]===` +`?(s&&(n+=T_n("")),o&&g&&(n+=S_n(g))):m===` +`&&(o&&g&&(n+=S_n(o)),s&&(n+=T_n(s))),f+=m.length}return n},"exec");function J7t(t,e,r){return String(t).normalize().replaceAll(`\r `,` `).split(` -`).map(n=>Kjo(n,e,r)).join(` -`)}a(K7t,"wrapAnsi");function J7t(t){return a_n(t,{stringWidth:oF,stripAnsi:VK,wrap:K7t})}a(J7t,"ui");p();var Cue=require("path"),QYe=require("fs");function Z7t(t,e){let r=(0,Cue.resolve)(".",t),n;for((0,QYe.statSync)(r).isDirectory()||(r=(0,Cue.dirname)(r));;){if(n=e(r,(0,QYe.readdirSync)(r)),n)return(0,Cue.resolve)(r,n);if(r=(0,Cue.dirname)(n=r),n===r)break}}a(Z7t,"default");var z_n=require("util"),lQt=require("url");p();var D_n=require("util"),GYe=require("path");p();function zK(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1,o=t.match(/^-+/);for(let s=o?o[0].length:0;s0?n+=`${e}${r.charAt(o)}`:n+=c}return n}a(qYe,"decamelize");function jYe(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}a(jYe,"looksLikeNumber");p();p();function x_n(t){if(Array.isArray(t))return t.map(c=>typeof c!="string"?c+"":c);t=t.trim();let e=0,r=null,n=null,o=null,s=[];for(let c=0;c{typeof de=="number"&&(_.nargs[X]=de,_.keys.push(X))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([X,de])=>{typeof de=="function"&&(_.coercions[X]=de,_.keys.push(X))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(X){_.configs[X]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([X,de])=>{(typeof de=="boolean"||typeof de=="function")&&(_.configs[X]=de)})),ie(n.key,c,n.default,_.arrays),Object.keys(u).forEach(function(X){(_.aliases[X]||[]).forEach(function(de){u[de]=u[X]})});let S=null;he();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let X=0;X=3&&(H(xe[1],_.arrays)?X=D(X,xe[1],o,xe[2]):H(xe[1],_.nargs)!==!1?X=k(X,xe[1],o,xe[2]):N(xe[1],xe[2],!0));else if(de.match(v)&&l["boolean-negation"])xe=de.match(v),xe!==null&&Array.isArray(xe)&&xe.length>=2&&(ue=xe[1],N(ue,H(ue,_.arrays)?[!1]:!1));else if(de.match(/^--.+/)||!l["short-option-groups"]&&de.match(/^-[^-]+/))xe=de.match(/^--?(.+)/),xe!==null&&Array.isArray(xe)&&xe.length>=2&&(ue=xe[1],H(ue,_.arrays)?X=D(X,ue,o):H(ue,_.nargs)!==!1?X=k(X,ue,o):(Fe=o[X+1],Fe!==void 0&&(!Fe.match(/^-/)||Fe.match(E))&&!H(ue,_.bools)&&!H(ue,_.counts)||/^(true|false)$/.test(Fe)?(N(ue,Fe),X++):N(ue,Te(ue))));else if(de.match(/^-.\..+=/))xe=de.match(/^-([^=]+)=([\s\S]*)$/),xe!==null&&Array.isArray(xe)&&xe.length>=3&&N(xe[1],xe[2]);else if(de.match(/^-.\..+/)&&!de.match(E))Fe=o[X+1],xe=de.match(/^-(.\..+)/),xe!==null&&Array.isArray(xe)&&xe.length>=2&&(ue=xe[1],Fe!==void 0&&!Fe.match(/^-/)&&!H(ue,_.bools)&&!H(ue,_.counts)?(N(ue,Fe),X++):N(ue,Te(ue)));else if(de.match(/^-[^-]+/)&&!de.match(E)){Ne=de.slice(1,-1).split(""),ne=!1;for(let st=0;stX!=="--"&&X.includes("-")).forEach(X=>{delete w[X]}),l["strip-aliased"]&&[].concat(...Object.keys(c).map(X=>c[X])).forEach(X=>{l["camel-case-expansion"]&&X.includes("-")&&delete w[X.split(".").map(de=>zK(de)).join(".")],delete w[X]});function x(X){let de=q("_",X);(typeof de=="string"||typeof de=="number")&&w._.push(de)}a(x,"pushPositional");function k(X,de,Be,ne){let ue,Ne=H(de,_.nargs);if(Ne=typeof Ne!="number"||isNaN(Ne)?1:Ne,Ne===0)return K(ne)||(S=Error(y("Argument unexpected for: %s",de))),N(de,Te(de)),X;let xe=K(ne)?0:1;if(l["nargs-eats-options"])Be.length-(X+1)+xe0&&(N(de,ne),Fe--),ue=X+1;ue0||xe&&typeof xe=="number"&&ue.length>=xe||(Ne=Be[Fe],/^-/.test(Ne)&&!E.test(Ne)&&!me(Ne)));Fe++)X=Fe,ue.push(B(de,Ne,s))}return typeof xe=="number"&&(xe&&ue.length1&&l["dot-notation"]&&(_.aliases[ue[0]]||[]).forEach(function(Ne){let xe=Ne.split("."),Fe=[].concat(ue);Fe.shift(),xe=xe.concat(Fe),(_.aliases[X]||[]).includes(xe.join("."))||z(w,xe,ne)}),H(X,_.normalize)&&!H(X,_.arrays)&&[X].concat(_.aliases[X]||[]).forEach(function(xe){Object.defineProperty(R,xe,{enumerable:!0,get(){return de},set(Fe){de=typeof Fe=="string"?sF.normalize(Fe):Fe}})})}a(N,"setArg");function O(X,de){_.aliases[X]&&_.aliases[X].length||(_.aliases[X]=[de],g[de]=!0),_.aliases[de]&&_.aliases[de].length||O(de,X)}a(O,"addNewAlias");function B(X,de,Be){Be&&(de=Zjo(de)),(H(X,_.bools)||H(X,_.counts))&&typeof de=="string"&&(de=de==="true");let ne=Array.isArray(de)?de.map(function(ue){return q(X,ue)}):q(X,de);return H(X,_.counts)&&(K(ne)||typeof ne=="boolean")&&(ne=X7t()),H(X,_.normalize)&&H(X,_.arrays)&&(Array.isArray(de)?ne=de.map(ue=>sF.normalize(ue)):ne=sF.normalize(de)),ne}a(B,"processValue");function q(X,de){return!l["parse-positional-numbers"]&&X==="_"||!H(X,_.strings)&&!H(X,_.bools)&&!Array.isArray(de)&&(jYe(de)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${de}`)))||!K(de)&&H(X,_.numbers))&&(de=Number(de)),de}a(q,"maybeCoerceNumber");function M(X){let de=Object.create(null);W(de,_.aliases,u),Object.keys(_.configs).forEach(function(Be){let ne=X[Be]||de[Be];if(ne)try{let ue=null,Ne=sF.resolve(sF.cwd(),ne),xe=_.configs[Be];if(typeof xe=="function"){try{ue=xe(Ne)}catch(Fe){ue=Fe}if(ue instanceof Error){S=ue;return}}else ue=sF.require(Ne);L(ue)}catch(ue){ue.name==="PermissionDenied"?S=ue:X[Be]&&(S=Error(y("Invalid JSON config file: %s",ne)))}})}a(M,"setConfig");function L(X,de){Object.keys(X).forEach(function(Be){let ne=X[Be],ue=de?de+"."+Be:Be;typeof ne=="object"&&ne!==null&&!Array.isArray(ne)&&l["dot-notation"]?L(ne,ue):(!V(w,ue.split("."))||H(ue,_.arrays)&&l["combine-arrays"])&&N(ue,ne)})}a(L,"setConfigObject");function U(){typeof d<"u"&&d.forEach(function(X){L(X)})}a(U,"setConfigObjects");function j(X,de){if(typeof f>"u")return;let Be=typeof f=="string"?f:"",ne=sF.env();Object.keys(ne).forEach(function(ue){if(Be===""||ue.lastIndexOf(Be,0)===0){let Ne=ue.split("__").map(function(xe,Fe){return Fe===0&&(xe=xe.substring(Be.length)),zK(xe)});(de&&_.configs[Ne.join(".")]||!de)&&!V(X,Ne)&&N(Ne.join("."),ne[ue])}})}a(j,"applyEnvVars");function Q(X){let de,Be=new Set;Object.keys(X).forEach(function(ne){if(!Be.has(ne)&&(de=H(ne,_.coercions),typeof de=="function"))try{let ue=q(ne,de(X[ne]));[].concat(_.aliases[ne]||[],ne).forEach(Ne=>{Be.add(Ne),X[Ne]=ue})}catch(ue){S=ue}})}a(Q,"applyCoercions");function Y(X){return _.keys.forEach(de=>{~de.indexOf(".")||typeof X[de]>"u"&&(X[de]=void 0)}),X}a(Y,"setPlaceholderKeys");function W(X,de,Be,ne=!1){Object.keys(Be).forEach(function(ue){V(X,ue.split("."))||(z(X,ue.split("."),Be[ue]),ne&&(A[ue]=!0),(de[ue]||[]).forEach(function(Ne){V(X,Ne.split("."))||z(X,Ne.split("."),Be[ue])}))})}a(W,"applyDefaultsAndAliases");function V(X,de){let Be=X;l["dot-notation"]||(de=[de.join(".")]),de.slice(0,-1).forEach(function(ue){Be=Be[ue]||{}});let ne=de[de.length-1];return typeof Be!="object"?!1:ne in Be}a(V,"hasKey");function z(X,de,Be){let ne=X;l["dot-notation"]||(de=[de.join(".")]),de.slice(0,-1).forEach(function(tt){tt=w_n(tt),typeof ne=="object"&&ne[tt]===void 0&&(ne[tt]={}),typeof ne[tt]!="object"||Array.isArray(ne[tt])?(Array.isArray(ne[tt])?ne[tt].push({}):ne[tt]=[ne[tt],{}],ne=ne[tt][ne[tt].length-1]):ne=ne[tt]});let ue=w_n(de[de.length-1]),Ne=H(de.join("."),_.arrays),xe=Array.isArray(Be),Fe=l["duplicate-arguments-array"];!Fe&&H(ue,_.nargs)&&(Fe=!0,(!K(ne[ue])&&_.nargs[ue]===1||Array.isArray(ne[ue])&&ne[ue].length===_.nargs[ue])&&(ne[ue]=void 0)),Be===X7t()?ne[ue]=X7t(ne[ue]):Array.isArray(ne[ue])?Fe&&Ne&&xe?ne[ue]=l["flatten-duplicate-arrays"]?ne[ue].concat(Be):(Array.isArray(ne[ue][0])?ne[ue]:[ne[ue]]).concat([Be]):!Fe&&!!Ne==!!xe?ne[ue]=Be:ne[ue]=ne[ue].concat([Be]):ne[ue]===void 0&&Ne?ne[ue]=xe?Be:[Be]:Fe&&!(ne[ue]===void 0||H(ue,_.counts)||H(ue,_.bools))?ne[ue]=[ne[ue],Be]:ne[ue]=Be}a(z,"setKey");function ie(...X){X.forEach(function(de){Object.keys(de||{}).forEach(function(Be){_.aliases[Be]||(_.aliases[Be]=[].concat(c[Be]||[]),_.aliases[Be].concat(Be).forEach(function(ne){if(/-/.test(ne)&&l["camel-case-expansion"]){let ue=zK(ne);ue!==Be&&_.aliases[Be].indexOf(ue)===-1&&(_.aliases[Be].push(ue),g[ue]=!0)}}),_.aliases[Be].concat(Be).forEach(function(ne){if(ne.length>1&&/[A-Z]/.test(ne)&&l["camel-case-expansion"]){let ue=qYe(ne,"-");ue!==Be&&_.aliases[Be].indexOf(ue)===-1&&(_.aliases[Be].push(ue),g[ue]=!0)}}),_.aliases[Be].forEach(function(ne){_.aliases[ne]=[Be].concat(_.aliases[Be].filter(function(ue){return ne!==ue}))}))})})}a(ie,"extendAliases");function H(X,de){let Be=[].concat(_.aliases[X]||[],X),ne=Object.keys(de),ue=Be.find(Ne=>ne.includes(Ne));return ue?de[ue]:!1}a(H,"checkAllAliases");function re(X){let de=Object.keys(_);return[].concat(de.map(ne=>_[ne])).some(function(ne){return Array.isArray(ne)?ne.includes(X):ne[X]})}a(re,"hasAnyFlag");function le(X,...de){return[].concat(...de).some(function(ne){let ue=X.match(ne);return ue&&re(ue[1])})}a(le,"hasFlagsMatching");function Le(X){if(X.match(E)||!X.match(/^-[^-]+/))return!1;let de=!0,Be,ne=X.slice(1).split("");for(let ue=0;ueH(X,_.arrays)?(S=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",X)),!0):H(X,_.nargs)?(S=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",X)),!0):!1)}return a(he,"checkConfiguration"),{aliases:Object.assign({},_.aliases),argv:Object.assign(R,w),configuration:l,defaulted:Object.assign({},A),error:S,newAliases:Object.assign({},g)}}};function Jjo(t){let e=[],r=Object.create(null),n=!0;for(Object.keys(t).forEach(function(o){e.push([].concat(t[o],o))});n;){n=!1;for(let o=0;oXjo,"env"),format:D_n.format,normalize:GYe.normalize,resolve:GYe.resolve,require:a(t=>{if(typeof P_n<"u")return P_n(t);if(t.match(/\.json$/))return JSON.parse((0,N_n.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),swe=a(function(e,r){return M_n.parse(e.slice(),r).argv},"Parser");swe.detailed=function(t,e){return M_n.parse(t.slice(),e)};swe.camelCase=zK;swe.decamelize=qYe;swe.looksLikeNumber=jYe;var O_n=swe;var sT=require("path");p();function eHo(){return tHo()?0:1}a(eHo,"getProcessArgvBinIndex");function tHo(){return rHo()&&!process.defaultApp}a(tHo,"isBundledElectronApp");function rHo(){return!!process.versions.electron}a(rHo,"isElectronApp");function L_n(){return process.argv[eHo()]}a(L_n,"getProcessArgvBin");p();p();p();function iQt({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}a(iQt,"ansiRegex");var nHo=iQt();function oQt(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(nHo,"")}a(oQt,"stripAnsi");var iHo=new Intl.Segmenter,B_n=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Nonspacing_Mark}|\\p{Enclosing_Mark}|\\p{Surrogate})+$","v"),oHo=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Nonspacing_Mark}\\p{Enclosing_Mark}\\p{Surrogate}]+","v"),sHo=new RegExp("\\p{Spacing_Mark}","v"),aHo=new RegExp("^\\p{RGI_Emoji}$","v"),cHo=/^[\d#*]\u20E3$/,lHo=new RegExp("\\p{Extended_Pictographic}","gu");function uHo(t){if(t.length>50)return!1;if(cHo.test(t))return!0;if(t.includes("\u200D")){let e=t.match(lHo);return e!==null&&e.length>=2}return!1}a(uHo,"isDoubleWidthNonRgiEmojiSequence");function dHo(t){return t.replace(oHo,"")}a(dHo,"baseVisible");function fHo(t){return B_n.test(t)}a(fHo,"isZeroWidthCluster");function F_n(t){return t>=4352&&t<=4447||t>=43360&&t<=43388}a(F_n,"isHangulLeadingJamo");function U_n(t){return t>=4448&&t<=4519||t>=55216&&t<=55238}a(U_n,"isHangulVowelJamo");function Q_n(t){return t>=4520&&t<=4607||t>=55243&&t<=55291}a(Q_n,"isHangulTrailingJamo");function pHo(t){return F_n(t)||U_n(t)||Q_n(t)}a(pHo,"isHangulJamo");function hHo(t,e){let r=[];for(let o of t)B_n.test(o)||r.push(o.codePointAt(0));if(r.length===0)return;let n=0;for(let o=0;o="\uFF00"&&o<="\uFFEF")&&(r+=WK(o.codePointAt(0),e))}return r}a(mHo,"trailingWidth");function sQt(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e,o=t;if(!n&&(o.includes("\x1B")||o.includes("\x9B"))&&(o=oQt(o)),o.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(o))return o.length;let s=0,c={ambiguousAsWide:!r};for(let{segment:l}of iHo.segment(o)){if(fHo(l))continue;if(aHo.test(l)||uHo(l)){s+=2;continue}let u=dHo(l),d=hHo(u,c);if(d!==void 0){s+=d;continue}let f=u.codePointAt(0);s+=WK(f,c),s+=mHo(u,c)}return s}a(sQt,"stringWidth");p();p();var bue=require("fs"),q_n=require("util"),j_n=require("path");var H_n={fs:{readFileSync:bue.readFileSync,writeFile:bue.writeFile},format:q_n.format,resolve:j_n.resolve,exists:a(t=>{try{return(0,bue.statSync)(t).isFile()}catch{return!1}},"exists")};p();var a2,aQt=class{static{a(this,"Y18N")}constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=e.shift(),n=a(function(){},"cb");return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),a2.format.apply(a2.format,[this.cache[this.locale][r]||r].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),o=e.shift(),s=a(function(){},"cb");typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let c=o===1?r:n;this.cache[this.locale][r]&&(c=this.cache[this.locale][r][o===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let l=[c];return~c.indexOf("%d")&&l.push(o),a2.format.apply(a2.format,l.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(o,s){let c=r[s+1];n+=o,typeof c<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,r=this.writeQueue[0],n=r.directory,o=r.locale,s=r.cb,c=this._resolveLocaleFile(n,o),l=JSON.stringify(this.cache[o],null,2);a2.fs.writeFile(c,l,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(u)})}_readLocaleFile(){let e={},r=this._resolveLocaleFile(this.directory,this.locale);try{a2.fs.readFileSync&&(e=JSON.parse(a2.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=a2.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=a2.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return a2.exists(e)}};function G_n(t,e){a2=e;let r=new aQt(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}a(G_n,"y18n");var gHo=a(t=>G_n(t,H_n),"y18n"),$_n=gHo;var Y_n=require("node:module"),K_n=fe(W_n(),1),VYe=require("node:fs");var cQt=(0,lQt.fileURLToPath)(importMetaUrlShim),AHo=cQt.substring(0,cQt.lastIndexOf("node_modules")),yHo=(0,Y_n.createRequire)(importMetaUrlShim),J_n={assert:{notStrictEqual:$Ye.notStrictEqual,strictEqual:$Ye.strictEqual},cliui:J7t,findUp:Z7t,getEnv:a(t=>process.env[t],"getEnv"),inspect:z_n.inspect,getProcessArgvBin:L_n,mainFilename:AHo||process.cwd(),Parser:O_n,path:{basename:sT.basename,dirname:sT.dirname,extname:sT.extname,relative:sT.relative,resolve:sT.resolve,join:sT.join},process:{argv:a(()=>process.argv,"argv"),cwd:process.cwd,emitWarning:a((t,e)=>process.emitWarning(t,e),"emitWarning"),execPath:a(()=>process.execPath,"execPath"),exit:a(t=>{process.exit(t)},"exit"),nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:VYe.readFileSync,readdirSync:VYe.readdirSync,require:yHo,getCallerFile:a(()=>{let t=(0,K_n.default)(3);return t.match(/^file:\/\//)?(0,lQt.fileURLToPath)(t):t},"getCallerFile"),stringWidth:sQt,y18n:$_n({directory:(0,sT.resolve)(cQt,"../../../locales"),updateFiles:!1})};p();p();p();function ev(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(ev,"assertNotStrictEqual");function uQt(t,e){e.assert.strictEqual(typeof t,"string")}a(uQt,"assertSingleKey");function Sue(t){return Object.keys(t)}a(Sue,"objectKeys");p();function cd(t){return!!t&&!!t.then&&typeof t.then=="function"}a(cd,"isPromise");p();p();p();var oh=class t extends Error{static{a(this,"YError")}constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}};p();function Aq(t){let r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,o=r.shift();if(!o)throw new Error(`No command found in: ${t}`);let s={cmd:o.replace(n,""),demanded:[],optional:[]};return r.forEach((c,l)=>{let u=!1;c=c.replace(/\s/g,""),/\.+[\]>]/.test(c)&&l===r.length-1&&(u=!0),/^\[/.test(c)?s.optional.push({cmd:c.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:c.replace(n,"").split("|"),variadic:u})}),s}a(Aq,"parseCommand");var _Ho=["first","second","third","fourth","fifth","sixth"];function Qn(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[Aq(`cmd ${t}`),e,r]}a(n,"parseArgs");try{let o=0,[s,c,l]=n(),u=[].slice.call(c);for(;u.length&&u[u.length-1]===void 0;)u.pop();let d=l||u.length;if(df)throw new oh(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=Z_n(m);h.cmd.filter(y=>y===g||y==="*").length===0&&X_n(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=Z_n(m);h.cmd.filter(y=>y===g||y==="*").length===0&&X_n(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(Qn,"argsert");function Z_n(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a(Z_n,"guessType");function X_n(t,e,r){throw new oh(`Invalid ${_Ho[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a(X_n,"argumentTypeError");var WYe=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(Qn(" [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let s=0;s{let s=[...n[r]||[],r];return o.option?!s.includes(o.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function eEn(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(eEn,"commandMiddlewareFactory");function YK(t,e,r,n){return r.reduce((o,s)=>{if(s.applyBeforeValidation!==n)return o;if(s.mutates){if(s.applied)return o;s.applied=!0}if(cd(o))return o.then(c=>Promise.all([c,s(c,e)])).then(([c,l])=>Object.assign(c,l));{let c=s(o,e);return cd(c)?c.then(l=>Object.assign(o,l)):Object.assign(o,c)}},t)}a(YK,"applyMiddleware");p();function KK(t,e,r=n=>{throw n}){try{let n=EHo(t)?t():t;return cd(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(KK,"maybeAsyncResult");function EHo(t){return typeof t=="function"}a(EHo,"isFunction");var Tue=/(^\*)|(^\$0)/,dQt=class{static{a(this,"CommandInstance")}constructor(e,r,n,o){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=o,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,o){o=o||{},this.requireCache.add(n);let s=this.shim.path.resolve(this.shim.path.dirname(n),e),c=this.shim.readdirSync(s,{recursive:!!o.recurse});Array.isArray(o.extensions)||(o.extensions=["js"]);let l=typeof o.visit=="function"?o.visit:u=>u;for(let u of c){let d=u.toString();if(o.exclude){let h=!1;if(typeof o.exclude=="function"?h=o.exclude(d):h=o.exclude.test(d),h)continue}if(o.include){let h=!1;if(typeof o.include=="function"?h=o.include(d):h=o.include.test(d),!h)continue}let f=!1;for(let h of o.extensions)d.endsWith(h)&&(f=!0);if(f){let h=this.shim.path.join(s,d),m=r(h),g=Object.create(null,Object.getOwnPropertyDescriptors({...m}));if(l(g,h,d)){if(this.requireCache.has(h))continue;this.requireCache.add(h),g.command||(g.command=this.shim.path.basename(h,this.shim.path.extname(h))),this.addHandler(g)}}}}addHandler(e,r,n,o,s,c){let l=[],u=eEn(s);if(o=o||(()=>{}),Array.isArray(e))if(vHo(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(bHo(e)){let d=Array.isArray(e.command)||typeof e.command=="string"?e.command:null;if(d===null)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);e.aliases&&(d=[].concat(d).concat(e.aliases)),this.addHandler(d,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(tEn(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=Aq(e);l=l.map(m=>Aq(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>Tue.test(m)?(f=!0,!1):!0);h.length===0&&f&&h.push("$0"),f&&(d.cmd=h[0],l=h.slice(1),e=e.replace(Tue,d.cmd)),l.forEach(m=>{this.aliasMap[m]=d.cmd}),r!==!1&&this.usage.command(e,r,f,l,c),this.handlers[d.cmd]={original:e,description:r,handler:o,builder:n||{},middlewares:u,deprecated:c,demanded:d.demanded,optional:d.optional},f&&(this.defaultCommand=this.handlers[d.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,o,s,c){let l=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),d=u.commands.slice(),f=!e;e&&(u.commands.push(e),u.fullCommands.push(l.original));let h=this.applyBuilderUpdateUsageAndParse(f,l,r,n.aliases,d,o,s,c);return cd(h)?h.then(m=>this.applyMiddlewareAndGetResult(f,l,m.innerArgv,u,s,m.aliases,r)):this.applyMiddlewareAndGetResult(f,l,h.innerArgv,u,s,h.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,o,s,c,l,u){let d=r.builder,f=n;if(zYe(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if(cd(h))return h.then(m=>(f=nEn(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else CHo(d)&&(n.getInternalMethods().getUsageInstance().freeze(),f=n.getInternalMethods().reset(o),Object.keys(r.builder).forEach(h=>{f.option(h,d[h])}));return this.parseAndUpdateUsage(e,r,f,s,c,l)}parseAndUpdateUsage(e,r,n,o,s,c){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(o,r),r.description);let l=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,c);return cd(l)?l.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:l}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){let n=Tue.test(r.original)?r.original.replace(Tue,"").trim():r.original,o=e.filter(s=>!Tue.test(s));return o.push(n),`$0 ${o.join(" ")}`}handleValidationAndGetResult(e,r,n,o,s,c,l,u){if(!c.getInternalMethods().getHasOutput()){let d=c.getInternalMethods().runValidation(s,u,c.parsed.error,e);n=KK(n,f=>(d(f),f))}if(r.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let d=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,d,!1,!1),n=YK(n,c,l,!1),n=KK(n,f=>{let h=r.handler(f);return cd(h)?h.then(()=>f):f}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),cd(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(f=>{try{c.getInternalMethods().getUsageInstance().fail(null,f)}catch{}})}return e||(o.commands.pop(),o.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,o,s,c,l){let u={};if(s)return n;l.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,o,l));let d=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),f=YK(n,l,d,!0);return cd(f)?f.then(h=>this.handleValidationAndGetResult(e,r,h,o,c,l,d,u)):this.handleValidationAndGetResult(e,r,f,o,c,l,d,u)}populatePositionals(e,r,n,o){r._=r._.slice(n.commands.length);let s=e.demanded.slice(0),c=e.optional.slice(0),l={};for(this.validation.positionalCount(s.length,r._.length);s.length;){let u=s.shift();this.populatePositional(u,r,l)}for(;c.length;){let u=c.shift();this.populatePositional(u,r,l)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,l,this.cmdToParseOptions(e.original),o),l}populatePositional(e,r,n){let o=e.cmd[0];e.variadic?n[o]=r._.splice(0).map(String):r._.length&&(n[o]=[String(r._.shift())])}cmdToParseOptions(e){let r={array:[],default:{},alias:{},demand:{}},n=Aq(e);return n.demanded.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c,r.demand[s]=!0}),n.optional.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c}),r}postProcessPositionals(e,r,n,o){let s=Object.assign({},o.getOptions());s.default=Object.assign(n.default,s.default);for(let d of Object.keys(n.alias))s.alias[d]=(s.alias[d]||[]).concat(n.alias[d]);s.array=s.array.concat(n.array),s.config={};let c=[];if(Object.keys(r).forEach(d=>{r[d].map(f=>{s.configuration["unknown-options-as-args"]&&(s.key[d]=!0),c.push(`--${d}`),c.push(f)})}),!c.length)return;let l=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(c,Object.assign({},s,{configuration:l}));if(u.error)o.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let d=Object.keys(r);Object.keys(r).forEach(f=>{d.push(...u.aliases[f])}),Object.keys(u.argv).forEach(f=>{d.includes(f)&&(r[f]||(r[f]=u.argv[f]),!this.isInConfigs(o,f)&&!this.isDefaulted(o,f)&&Object.prototype.hasOwnProperty.call(e,f)&&Object.prototype.hasOwnProperty.call(u.argv,f)&&(Array.isArray(e[f])||Array.isArray(u.argv[f]))?e[f]=[].concat(e[f],u.argv[f]):e[f]=u.argv[f])})}}isDefaulted(e,r){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){let{configObjects:n}=e.getOptions();return n.some(o=>Object.prototype.hasOwnProperty.call(o,r))||n.some(o=>Object.prototype.hasOwnProperty.call(o,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=Tue.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(zYe(r))return r(e,!0);tEn(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}extractDesc({describe:e,description:r,desc:n}){for(let o of[e,r,n]){if(typeof o=="string"||o===!1)return o;ev(o,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();ev(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function rEn(t,e,r,n){return new dQt(t,e,r,n)}a(rEn,"command");function tEn(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(tEn,"isCommandBuilderDefinition");function vHo(t){return t.every(e=>typeof e=="string")}a(vHo,"isCommandAndAliases");function zYe(t){return typeof t=="function"}a(zYe,"isCommandBuilderCallback");function CHo(t){return typeof t=="object"}a(CHo,"isCommandBuilderOptionDefinitions");function bHo(t){return typeof t=="object"&&!Array.isArray(t)}a(bHo,"isCommandHandlerDefinition");p();p();function yq(t={},e=()=>!0){let r={};return Sue(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(yq,"objFilter");p();function _q(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}a(_q,"setBlocking");function SHo(t){return typeof t=="boolean"}a(SHo,"isBoolean");function oEn(t,e){let r=e.y18n.__,n={},o=[];n.failFn=a(function(B){o.push(B)},"failFn");let s=null,c=null,l=!0;n.showHelpOnFail=a(function(B=!0,q){let[M,L]=typeof B=="string"?[!0,B]:[B,q];return t.getInternalMethods().isGlobalContext()&&(c=L),s=L,l=M,n},"showHelpOnFailFn");let u=!1;n.fail=a(function(B,q){let M=t.getInternalMethods().getLoggerInstance();if(o.length)for(let L=o.length-1;L>=0;--L){let U=o[L];if(SHo(U)){if(q)throw q;if(B)throw Error(B)}else U(B,q,n)}else{if(t.getExitProcess()&&_q(!0),!u){u=!0,l&&(t.showHelp("error"),M.error()),(B||q)&&M.error(B||q);let L=s||c;L&&((B||q)&&M.error(""),M.error(L))}if(q=q||new oh(B),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,q);throw q}},"fail");let d=[],f=!1;n.usage=(O,B)=>O===null?(f=!0,d=[],n):(f=!1,d.push([O,B||""]),n),n.getUsage=()=>d,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>r("Positionals:");let h=[];n.example=(O,B)=>{h.push([O,B||""])};let m=[];n.command=a(function(B,q,M,L,U=!1){M&&(m=m.map(j=>(j[2]=!1,j))),m.push([B,q||"",M,L,U])},"command"),n.getCommands=()=>m;let g={};n.describe=a(function(B,q){Array.isArray(B)?B.forEach(M=>{n.describe(M,q)}):typeof B=="object"?Object.keys(B).forEach(M=>{n.describe(M,B[M])}):g[B]=q},"describe"),n.getDescriptions=()=>g;let A=[];n.epilog=O=>{A.push(O)};let y=!1,_;n.wrap=O=>{y=!0,_=O},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(_=k(),y=!0),_);let E="__yargsString__:";n.deferY18nLookup=O=>E+O,n.help=a(function(){if(T)return T;S();let B=t.customScriptName?t.$0:e.path.basename(t.$0),q=t.getDemandedOptions(),M=t.getDemandedCommands(),L=t.getDeprecatedOptions(),U=t.getGroups(),j=t.getOptions(),Q=[];Q=Q.concat(Object.keys(g)),Q=Q.concat(Object.keys(q)),Q=Q.concat(Object.keys(M)),Q=Q.concat(Object.keys(j.default)),Q=Q.filter(R),Q=Object.keys(Q.reduce((le,Le)=>(Le!=="_"&&(le[Le]=!0),le),{}));let Y=n.getWrap(),W=e.cliui({width:Y,wrap:!!Y});if(!f){if(d.length)d.forEach(le=>{W.div({text:`${le[0].replace(/\$0/g,B)}`}),le[1]&&W.div({text:`${le[1]}`,padding:[1,0,0,0]})}),W.div();else if(m.length){let le=null;M._?le=`${B} <${r("command")}> +`).map(n=>Zjo(n,e,r)).join(` +`)}a(J7t,"wrapAnsi");function Z7t(t){return c_n(t,{stringWidth:oF,stripAnsi:WK,wrap:J7t})}a(Z7t,"ui");p();var bue=require("path"),QYe=require("fs");function X7t(t,e){let r=(0,bue.resolve)(".",t),n;for((0,QYe.statSync)(r).isDirectory()||(r=(0,bue.dirname)(r));;){if(n=e(r,(0,QYe.readdirSync)(r)),n)return(0,bue.resolve)(r,n);if(r=(0,bue.dirname)(n=r),n===r)break}}a(X7t,"default");var Y_n=require("util"),uQt=require("url");p();var N_n=require("util"),GYe=require("path");p();function YK(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1,o=t.match(/^-+/);for(let s=o?o[0].length:0;s0?n+=`${e}${r.charAt(o)}`:n+=c}return n}a(qYe,"decamelize");function jYe(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}a(jYe,"looksLikeNumber");p();p();function w_n(t){if(Array.isArray(t))return t.map(c=>typeof c!="string"?c+"":c);t=t.trim();let e=0,r=null,n=null,o=null,s=[];for(let c=0;c{typeof de=="number"&&(_.nargs[X]=de,_.keys.push(X))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([X,de])=>{typeof de=="function"&&(_.coercions[X]=de,_.keys.push(X))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(X){_.configs[X]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([X,de])=>{(typeof de=="boolean"||typeof de=="function")&&(_.configs[X]=de)})),ie(n.key,c,n.default,_.arrays),Object.keys(u).forEach(function(X){(_.aliases[X]||[]).forEach(function(de){u[de]=u[X]})});let S=null;he();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let X=0;X=3&&(H(xe[1],_.arrays)?X=D(X,xe[1],o,xe[2]):H(xe[1],_.nargs)!==!1?X=k(X,xe[1],o,xe[2]):N(xe[1],xe[2],!0));else if(de.match(v)&&l["boolean-negation"])xe=de.match(v),xe!==null&&Array.isArray(xe)&&xe.length>=2&&(ue=xe[1],N(ue,H(ue,_.arrays)?[!1]:!1));else if(de.match(/^--.+/)||!l["short-option-groups"]&&de.match(/^-[^-]+/))xe=de.match(/^--?(.+)/),xe!==null&&Array.isArray(xe)&&xe.length>=2&&(ue=xe[1],H(ue,_.arrays)?X=D(X,ue,o):H(ue,_.nargs)!==!1?X=k(X,ue,o):(Fe=o[X+1],Fe!==void 0&&(!Fe.match(/^-/)||Fe.match(E))&&!H(ue,_.bools)&&!H(ue,_.counts)||/^(true|false)$/.test(Fe)?(N(ue,Fe),X++):N(ue,Te(ue))));else if(de.match(/^-.\..+=/))xe=de.match(/^-([^=]+)=([\s\S]*)$/),xe!==null&&Array.isArray(xe)&&xe.length>=3&&N(xe[1],xe[2]);else if(de.match(/^-.\..+/)&&!de.match(E))Fe=o[X+1],xe=de.match(/^-(.\..+)/),xe!==null&&Array.isArray(xe)&&xe.length>=2&&(ue=xe[1],Fe!==void 0&&!Fe.match(/^-/)&&!H(ue,_.bools)&&!H(ue,_.counts)?(N(ue,Fe),X++):N(ue,Te(ue)));else if(de.match(/^-[^-]+/)&&!de.match(E)){Ne=de.slice(1,-1).split(""),ne=!1;for(let st=0;stX!=="--"&&X.includes("-")).forEach(X=>{delete w[X]}),l["strip-aliased"]&&[].concat(...Object.keys(c).map(X=>c[X])).forEach(X=>{l["camel-case-expansion"]&&X.includes("-")&&delete w[X.split(".").map(de=>YK(de)).join(".")],delete w[X]});function x(X){let de=q("_",X);(typeof de=="string"||typeof de=="number")&&w._.push(de)}a(x,"pushPositional");function k(X,de,Be,ne){let ue,Ne=H(de,_.nargs);if(Ne=typeof Ne!="number"||isNaN(Ne)?1:Ne,Ne===0)return K(ne)||(S=Error(y("Argument unexpected for: %s",de))),N(de,Te(de)),X;let xe=K(ne)?0:1;if(l["nargs-eats-options"])Be.length-(X+1)+xe0&&(N(de,ne),Fe--),ue=X+1;ue0||xe&&typeof xe=="number"&&ue.length>=xe||(Ne=Be[Fe],/^-/.test(Ne)&&!E.test(Ne)&&!me(Ne)));Fe++)X=Fe,ue.push(B(de,Ne,s))}return typeof xe=="number"&&(xe&&ue.length1&&l["dot-notation"]&&(_.aliases[ue[0]]||[]).forEach(function(Ne){let xe=Ne.split("."),Fe=[].concat(ue);Fe.shift(),xe=xe.concat(Fe),(_.aliases[X]||[]).includes(xe.join("."))||z(w,xe,ne)}),H(X,_.normalize)&&!H(X,_.arrays)&&[X].concat(_.aliases[X]||[]).forEach(function(xe){Object.defineProperty(R,xe,{enumerable:!0,get(){return de},set(Fe){de=typeof Fe=="string"?sF.normalize(Fe):Fe}})})}a(N,"setArg");function O(X,de){_.aliases[X]&&_.aliases[X].length||(_.aliases[X]=[de],g[de]=!0),_.aliases[de]&&_.aliases[de].length||O(de,X)}a(O,"addNewAlias");function B(X,de,Be){Be&&(de=eHo(de)),(H(X,_.bools)||H(X,_.counts))&&typeof de=="string"&&(de=de==="true");let ne=Array.isArray(de)?de.map(function(ue){return q(X,ue)}):q(X,de);return H(X,_.counts)&&(K(ne)||typeof ne=="boolean")&&(ne=eQt()),H(X,_.normalize)&&H(X,_.arrays)&&(Array.isArray(de)?ne=de.map(ue=>sF.normalize(ue)):ne=sF.normalize(de)),ne}a(B,"processValue");function q(X,de){return!l["parse-positional-numbers"]&&X==="_"||!H(X,_.strings)&&!H(X,_.bools)&&!Array.isArray(de)&&(jYe(de)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${de}`)))||!K(de)&&H(X,_.numbers))&&(de=Number(de)),de}a(q,"maybeCoerceNumber");function M(X){let de=Object.create(null);W(de,_.aliases,u),Object.keys(_.configs).forEach(function(Be){let ne=X[Be]||de[Be];if(ne)try{let ue=null,Ne=sF.resolve(sF.cwd(),ne),xe=_.configs[Be];if(typeof xe=="function"){try{ue=xe(Ne)}catch(Fe){ue=Fe}if(ue instanceof Error){S=ue;return}}else ue=sF.require(Ne);L(ue)}catch(ue){ue.name==="PermissionDenied"?S=ue:X[Be]&&(S=Error(y("Invalid JSON config file: %s",ne)))}})}a(M,"setConfig");function L(X,de){Object.keys(X).forEach(function(Be){let ne=X[Be],ue=de?de+"."+Be:Be;typeof ne=="object"&&ne!==null&&!Array.isArray(ne)&&l["dot-notation"]?L(ne,ue):(!V(w,ue.split("."))||H(ue,_.arrays)&&l["combine-arrays"])&&N(ue,ne)})}a(L,"setConfigObject");function U(){typeof d<"u"&&d.forEach(function(X){L(X)})}a(U,"setConfigObjects");function j(X,de){if(typeof f>"u")return;let Be=typeof f=="string"?f:"",ne=sF.env();Object.keys(ne).forEach(function(ue){if(Be===""||ue.lastIndexOf(Be,0)===0){let Ne=ue.split("__").map(function(xe,Fe){return Fe===0&&(xe=xe.substring(Be.length)),YK(xe)});(de&&_.configs[Ne.join(".")]||!de)&&!V(X,Ne)&&N(Ne.join("."),ne[ue])}})}a(j,"applyEnvVars");function Q(X){let de,Be=new Set;Object.keys(X).forEach(function(ne){if(!Be.has(ne)&&(de=H(ne,_.coercions),typeof de=="function"))try{let ue=q(ne,de(X[ne]));[].concat(_.aliases[ne]||[],ne).forEach(Ne=>{Be.add(Ne),X[Ne]=ue})}catch(ue){S=ue}})}a(Q,"applyCoercions");function Y(X){return _.keys.forEach(de=>{~de.indexOf(".")||typeof X[de]>"u"&&(X[de]=void 0)}),X}a(Y,"setPlaceholderKeys");function W(X,de,Be,ne=!1){Object.keys(Be).forEach(function(ue){V(X,ue.split("."))||(z(X,ue.split("."),Be[ue]),ne&&(A[ue]=!0),(de[ue]||[]).forEach(function(Ne){V(X,Ne.split("."))||z(X,Ne.split("."),Be[ue])}))})}a(W,"applyDefaultsAndAliases");function V(X,de){let Be=X;l["dot-notation"]||(de=[de.join(".")]),de.slice(0,-1).forEach(function(ue){Be=Be[ue]||{}});let ne=de[de.length-1];return typeof Be!="object"?!1:ne in Be}a(V,"hasKey");function z(X,de,Be){let ne=X;l["dot-notation"]||(de=[de.join(".")]),de.slice(0,-1).forEach(function(tt){tt=R_n(tt),typeof ne=="object"&&ne[tt]===void 0&&(ne[tt]={}),typeof ne[tt]!="object"||Array.isArray(ne[tt])?(Array.isArray(ne[tt])?ne[tt].push({}):ne[tt]=[ne[tt],{}],ne=ne[tt][ne[tt].length-1]):ne=ne[tt]});let ue=R_n(de[de.length-1]),Ne=H(de.join("."),_.arrays),xe=Array.isArray(Be),Fe=l["duplicate-arguments-array"];!Fe&&H(ue,_.nargs)&&(Fe=!0,(!K(ne[ue])&&_.nargs[ue]===1||Array.isArray(ne[ue])&&ne[ue].length===_.nargs[ue])&&(ne[ue]=void 0)),Be===eQt()?ne[ue]=eQt(ne[ue]):Array.isArray(ne[ue])?Fe&&Ne&&xe?ne[ue]=l["flatten-duplicate-arrays"]?ne[ue].concat(Be):(Array.isArray(ne[ue][0])?ne[ue]:[ne[ue]]).concat([Be]):!Fe&&!!Ne==!!xe?ne[ue]=Be:ne[ue]=ne[ue].concat([Be]):ne[ue]===void 0&&Ne?ne[ue]=xe?Be:[Be]:Fe&&!(ne[ue]===void 0||H(ue,_.counts)||H(ue,_.bools))?ne[ue]=[ne[ue],Be]:ne[ue]=Be}a(z,"setKey");function ie(...X){X.forEach(function(de){Object.keys(de||{}).forEach(function(Be){_.aliases[Be]||(_.aliases[Be]=[].concat(c[Be]||[]),_.aliases[Be].concat(Be).forEach(function(ne){if(/-/.test(ne)&&l["camel-case-expansion"]){let ue=YK(ne);ue!==Be&&_.aliases[Be].indexOf(ue)===-1&&(_.aliases[Be].push(ue),g[ue]=!0)}}),_.aliases[Be].concat(Be).forEach(function(ne){if(ne.length>1&&/[A-Z]/.test(ne)&&l["camel-case-expansion"]){let ue=qYe(ne,"-");ue!==Be&&_.aliases[Be].indexOf(ue)===-1&&(_.aliases[Be].push(ue),g[ue]=!0)}}),_.aliases[Be].forEach(function(ne){_.aliases[ne]=[Be].concat(_.aliases[Be].filter(function(ue){return ne!==ue}))}))})})}a(ie,"extendAliases");function H(X,de){let Be=[].concat(_.aliases[X]||[],X),ne=Object.keys(de),ue=Be.find(Ne=>ne.includes(Ne));return ue?de[ue]:!1}a(H,"checkAllAliases");function re(X){let de=Object.keys(_);return[].concat(de.map(ne=>_[ne])).some(function(ne){return Array.isArray(ne)?ne.includes(X):ne[X]})}a(re,"hasAnyFlag");function le(X,...de){return[].concat(...de).some(function(ne){let ue=X.match(ne);return ue&&re(ue[1])})}a(le,"hasFlagsMatching");function Le(X){if(X.match(E)||!X.match(/^-[^-]+/))return!1;let de=!0,Be,ne=X.slice(1).split("");for(let ue=0;ueH(X,_.arrays)?(S=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",X)),!0):H(X,_.nargs)?(S=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",X)),!0):!1)}return a(he,"checkConfiguration"),{aliases:Object.assign({},_.aliases),argv:Object.assign(R,w),configuration:l,defaulted:Object.assign({},A),error:S,newAliases:Object.assign({},g)}}};function Xjo(t){let e=[],r=Object.create(null),n=!0;for(Object.keys(t).forEach(function(o){e.push([].concat(t[o],o))});n;){n=!1;for(let o=0;otHo,"env"),format:N_n.format,normalize:GYe.normalize,resolve:GYe.resolve,require:a(t=>{if(typeof D_n<"u")return D_n(t);if(t.match(/\.json$/))return JSON.parse((0,M_n.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),swe=a(function(e,r){return O_n.parse(e.slice(),r).argv},"Parser");swe.detailed=function(t,e){return O_n.parse(t.slice(),e)};swe.camelCase=YK;swe.decamelize=qYe;swe.looksLikeNumber=jYe;var L_n=swe;var sT=require("path");p();function rHo(){return nHo()?0:1}a(rHo,"getProcessArgvBinIndex");function nHo(){return iHo()&&!process.defaultApp}a(nHo,"isBundledElectronApp");function iHo(){return!!process.versions.electron}a(iHo,"isElectronApp");function B_n(){return process.argv[rHo()]}a(B_n,"getProcessArgvBin");p();p();p();function oQt({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}a(oQt,"ansiRegex");var oHo=oQt();function sQt(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(oHo,"")}a(sQt,"stripAnsi");var sHo=new Intl.Segmenter,F_n=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Nonspacing_Mark}|\\p{Enclosing_Mark}|\\p{Surrogate})+$","v"),aHo=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Nonspacing_Mark}\\p{Enclosing_Mark}\\p{Surrogate}]+","v"),cHo=new RegExp("\\p{Spacing_Mark}","v"),lHo=new RegExp("^\\p{RGI_Emoji}$","v"),uHo=/^[\d#*]\u20E3$/,dHo=new RegExp("\\p{Extended_Pictographic}","gu");function fHo(t){if(t.length>50)return!1;if(uHo.test(t))return!0;if(t.includes("\u200D")){let e=t.match(dHo);return e!==null&&e.length>=2}return!1}a(fHo,"isDoubleWidthNonRgiEmojiSequence");function pHo(t){return t.replace(aHo,"")}a(pHo,"baseVisible");function hHo(t){return F_n.test(t)}a(hHo,"isZeroWidthCluster");function U_n(t){return t>=4352&&t<=4447||t>=43360&&t<=43388}a(U_n,"isHangulLeadingJamo");function Q_n(t){return t>=4448&&t<=4519||t>=55216&&t<=55238}a(Q_n,"isHangulVowelJamo");function q_n(t){return t>=4520&&t<=4607||t>=55243&&t<=55291}a(q_n,"isHangulTrailingJamo");function mHo(t){return U_n(t)||Q_n(t)||q_n(t)}a(mHo,"isHangulJamo");function gHo(t,e){let r=[];for(let o of t)F_n.test(o)||r.push(o.codePointAt(0));if(r.length===0)return;let n=0;for(let o=0;o="\uFF00"&&o<="\uFFEF")&&(r+=zK(o.codePointAt(0),e))}return r}a(AHo,"trailingWidth");function aQt(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e,o=t;if(!n&&(o.includes("\x1B")||o.includes("\x9B"))&&(o=sQt(o)),o.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(o))return o.length;let s=0,c={ambiguousAsWide:!r};for(let{segment:l}of sHo.segment(o)){if(hHo(l))continue;if(lHo.test(l)||fHo(l)){s+=2;continue}let u=pHo(l),d=gHo(u,c);if(d!==void 0){s+=d;continue}let f=u.codePointAt(0);s+=zK(f,c),s+=AHo(u,c)}return s}a(aQt,"stringWidth");p();p();var Sue=require("fs"),j_n=require("util"),H_n=require("path");var G_n={fs:{readFileSync:Sue.readFileSync,writeFile:Sue.writeFile},format:j_n.format,resolve:H_n.resolve,exists:a(t=>{try{return(0,Sue.statSync)(t).isFile()}catch{return!1}},"exists")};p();var a2,cQt=class{static{a(this,"Y18N")}constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=e.shift(),n=a(function(){},"cb");return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),a2.format.apply(a2.format,[this.cache[this.locale][r]||r].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),o=e.shift(),s=a(function(){},"cb");typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let c=o===1?r:n;this.cache[this.locale][r]&&(c=this.cache[this.locale][r][o===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let l=[c];return~c.indexOf("%d")&&l.push(o),a2.format.apply(a2.format,l.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(o,s){let c=r[s+1];n+=o,typeof c<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,r=this.writeQueue[0],n=r.directory,o=r.locale,s=r.cb,c=this._resolveLocaleFile(n,o),l=JSON.stringify(this.cache[o],null,2);a2.fs.writeFile(c,l,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(u)})}_readLocaleFile(){let e={},r=this._resolveLocaleFile(this.directory,this.locale);try{a2.fs.readFileSync&&(e=JSON.parse(a2.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=a2.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=a2.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return a2.exists(e)}};function $_n(t,e){a2=e;let r=new cQt(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}a($_n,"y18n");var yHo=a(t=>$_n(t,G_n),"y18n"),V_n=yHo;var K_n=require("node:module"),J_n=fe(z_n(),1),VYe=require("node:fs");var lQt=(0,uQt.fileURLToPath)(importMetaUrlShim),_Ho=lQt.substring(0,lQt.lastIndexOf("node_modules")),EHo=(0,K_n.createRequire)(importMetaUrlShim),Z_n={assert:{notStrictEqual:$Ye.notStrictEqual,strictEqual:$Ye.strictEqual},cliui:Z7t,findUp:X7t,getEnv:a(t=>process.env[t],"getEnv"),inspect:Y_n.inspect,getProcessArgvBin:B_n,mainFilename:_Ho||process.cwd(),Parser:L_n,path:{basename:sT.basename,dirname:sT.dirname,extname:sT.extname,relative:sT.relative,resolve:sT.resolve,join:sT.join},process:{argv:a(()=>process.argv,"argv"),cwd:process.cwd,emitWarning:a((t,e)=>process.emitWarning(t,e),"emitWarning"),execPath:a(()=>process.execPath,"execPath"),exit:a(t=>{process.exit(t)},"exit"),nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:VYe.readFileSync,readdirSync:VYe.readdirSync,require:EHo,getCallerFile:a(()=>{let t=(0,J_n.default)(3);return t.match(/^file:\/\//)?(0,uQt.fileURLToPath)(t):t},"getCallerFile"),stringWidth:aQt,y18n:V_n({directory:(0,sT.resolve)(lQt,"../../../locales"),updateFiles:!1})};p();p();p();function ev(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(ev,"assertNotStrictEqual");function dQt(t,e){e.assert.strictEqual(typeof t,"string")}a(dQt,"assertSingleKey");function Tue(t){return Object.keys(t)}a(Tue,"objectKeys");p();function cd(t){return!!t&&!!t.then&&typeof t.then=="function"}a(cd,"isPromise");p();p();p();var oh=class t extends Error{static{a(this,"YError")}constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}};p();function Aq(t){let r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,o=r.shift();if(!o)throw new Error(`No command found in: ${t}`);let s={cmd:o.replace(n,""),demanded:[],optional:[]};return r.forEach((c,l)=>{let u=!1;c=c.replace(/\s/g,""),/\.+[\]>]/.test(c)&&l===r.length-1&&(u=!0),/^\[/.test(c)?s.optional.push({cmd:c.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:c.replace(n,"").split("|"),variadic:u})}),s}a(Aq,"parseCommand");var vHo=["first","second","third","fourth","fifth","sixth"];function Qn(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[Aq(`cmd ${t}`),e,r]}a(n,"parseArgs");try{let o=0,[s,c,l]=n(),u=[].slice.call(c);for(;u.length&&u[u.length-1]===void 0;)u.pop();let d=l||u.length;if(df)throw new oh(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=X_n(m);h.cmd.filter(y=>y===g||y==="*").length===0&&eEn(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=X_n(m);h.cmd.filter(y=>y===g||y==="*").length===0&&eEn(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(Qn,"argsert");function X_n(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a(X_n,"guessType");function eEn(t,e,r){throw new oh(`Invalid ${vHo[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a(eEn,"argumentTypeError");var WYe=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(Qn(" [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let s=0;s{let s=[...n[r]||[],r];return o.option?!s.includes(o.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function tEn(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(tEn,"commandMiddlewareFactory");function KK(t,e,r,n){return r.reduce((o,s)=>{if(s.applyBeforeValidation!==n)return o;if(s.mutates){if(s.applied)return o;s.applied=!0}if(cd(o))return o.then(c=>Promise.all([c,s(c,e)])).then(([c,l])=>Object.assign(c,l));{let c=s(o,e);return cd(c)?c.then(l=>Object.assign(o,l)):Object.assign(o,c)}},t)}a(KK,"applyMiddleware");p();function JK(t,e,r=n=>{throw n}){try{let n=CHo(t)?t():t;return cd(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(JK,"maybeAsyncResult");function CHo(t){return typeof t=="function"}a(CHo,"isFunction");var Iue=/(^\*)|(^\$0)/,fQt=class{static{a(this,"CommandInstance")}constructor(e,r,n,o){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=o,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,o){o=o||{},this.requireCache.add(n);let s=this.shim.path.resolve(this.shim.path.dirname(n),e),c=this.shim.readdirSync(s,{recursive:!!o.recurse});Array.isArray(o.extensions)||(o.extensions=["js"]);let l=typeof o.visit=="function"?o.visit:u=>u;for(let u of c){let d=u.toString();if(o.exclude){let h=!1;if(typeof o.exclude=="function"?h=o.exclude(d):h=o.exclude.test(d),h)continue}if(o.include){let h=!1;if(typeof o.include=="function"?h=o.include(d):h=o.include.test(d),!h)continue}let f=!1;for(let h of o.extensions)d.endsWith(h)&&(f=!0);if(f){let h=this.shim.path.join(s,d),m=r(h),g=Object.create(null,Object.getOwnPropertyDescriptors({...m}));if(l(g,h,d)){if(this.requireCache.has(h))continue;this.requireCache.add(h),g.command||(g.command=this.shim.path.basename(h,this.shim.path.extname(h))),this.addHandler(g)}}}}addHandler(e,r,n,o,s,c){let l=[],u=tEn(s);if(o=o||(()=>{}),Array.isArray(e))if(bHo(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(THo(e)){let d=Array.isArray(e.command)||typeof e.command=="string"?e.command:null;if(d===null)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);e.aliases&&(d=[].concat(d).concat(e.aliases)),this.addHandler(d,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(rEn(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=Aq(e);l=l.map(m=>Aq(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>Iue.test(m)?(f=!0,!1):!0);h.length===0&&f&&h.push("$0"),f&&(d.cmd=h[0],l=h.slice(1),e=e.replace(Iue,d.cmd)),l.forEach(m=>{this.aliasMap[m]=d.cmd}),r!==!1&&this.usage.command(e,r,f,l,c),this.handlers[d.cmd]={original:e,description:r,handler:o,builder:n||{},middlewares:u,deprecated:c,demanded:d.demanded,optional:d.optional},f&&(this.defaultCommand=this.handlers[d.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,o,s,c){let l=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),d=u.commands.slice(),f=!e;e&&(u.commands.push(e),u.fullCommands.push(l.original));let h=this.applyBuilderUpdateUsageAndParse(f,l,r,n.aliases,d,o,s,c);return cd(h)?h.then(m=>this.applyMiddlewareAndGetResult(f,l,m.innerArgv,u,s,m.aliases,r)):this.applyMiddlewareAndGetResult(f,l,h.innerArgv,u,s,h.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,o,s,c,l,u){let d=r.builder,f=n;if(zYe(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if(cd(h))return h.then(m=>(f=iEn(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else SHo(d)&&(n.getInternalMethods().getUsageInstance().freeze(),f=n.getInternalMethods().reset(o),Object.keys(r.builder).forEach(h=>{f.option(h,d[h])}));return this.parseAndUpdateUsage(e,r,f,s,c,l)}parseAndUpdateUsage(e,r,n,o,s,c){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(o,r),r.description);let l=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,c);return cd(l)?l.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:l}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){let n=Iue.test(r.original)?r.original.replace(Iue,"").trim():r.original,o=e.filter(s=>!Iue.test(s));return o.push(n),`$0 ${o.join(" ")}`}handleValidationAndGetResult(e,r,n,o,s,c,l,u){if(!c.getInternalMethods().getHasOutput()){let d=c.getInternalMethods().runValidation(s,u,c.parsed.error,e);n=JK(n,f=>(d(f),f))}if(r.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let d=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,d,!1,!1),n=KK(n,c,l,!1),n=JK(n,f=>{let h=r.handler(f);return cd(h)?h.then(()=>f):f}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),cd(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(f=>{try{c.getInternalMethods().getUsageInstance().fail(null,f)}catch{}})}return e||(o.commands.pop(),o.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,o,s,c,l){let u={};if(s)return n;l.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,o,l));let d=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),f=KK(n,l,d,!0);return cd(f)?f.then(h=>this.handleValidationAndGetResult(e,r,h,o,c,l,d,u)):this.handleValidationAndGetResult(e,r,f,o,c,l,d,u)}populatePositionals(e,r,n,o){r._=r._.slice(n.commands.length);let s=e.demanded.slice(0),c=e.optional.slice(0),l={};for(this.validation.positionalCount(s.length,r._.length);s.length;){let u=s.shift();this.populatePositional(u,r,l)}for(;c.length;){let u=c.shift();this.populatePositional(u,r,l)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,l,this.cmdToParseOptions(e.original),o),l}populatePositional(e,r,n){let o=e.cmd[0];e.variadic?n[o]=r._.splice(0).map(String):r._.length&&(n[o]=[String(r._.shift())])}cmdToParseOptions(e){let r={array:[],default:{},alias:{},demand:{}},n=Aq(e);return n.demanded.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c,r.demand[s]=!0}),n.optional.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c}),r}postProcessPositionals(e,r,n,o){let s=Object.assign({},o.getOptions());s.default=Object.assign(n.default,s.default);for(let d of Object.keys(n.alias))s.alias[d]=(s.alias[d]||[]).concat(n.alias[d]);s.array=s.array.concat(n.array),s.config={};let c=[];if(Object.keys(r).forEach(d=>{r[d].map(f=>{s.configuration["unknown-options-as-args"]&&(s.key[d]=!0),c.push(`--${d}`),c.push(f)})}),!c.length)return;let l=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(c,Object.assign({},s,{configuration:l}));if(u.error)o.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let d=Object.keys(r);Object.keys(r).forEach(f=>{d.push(...u.aliases[f])}),Object.keys(u.argv).forEach(f=>{d.includes(f)&&(r[f]||(r[f]=u.argv[f]),!this.isInConfigs(o,f)&&!this.isDefaulted(o,f)&&Object.prototype.hasOwnProperty.call(e,f)&&Object.prototype.hasOwnProperty.call(u.argv,f)&&(Array.isArray(e[f])||Array.isArray(u.argv[f]))?e[f]=[].concat(e[f],u.argv[f]):e[f]=u.argv[f])})}}isDefaulted(e,r){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){let{configObjects:n}=e.getOptions();return n.some(o=>Object.prototype.hasOwnProperty.call(o,r))||n.some(o=>Object.prototype.hasOwnProperty.call(o,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=Iue.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(zYe(r))return r(e,!0);rEn(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}extractDesc({describe:e,description:r,desc:n}){for(let o of[e,r,n]){if(typeof o=="string"||o===!1)return o;ev(o,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();ev(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function nEn(t,e,r,n){return new fQt(t,e,r,n)}a(nEn,"command");function rEn(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(rEn,"isCommandBuilderDefinition");function bHo(t){return t.every(e=>typeof e=="string")}a(bHo,"isCommandAndAliases");function zYe(t){return typeof t=="function"}a(zYe,"isCommandBuilderCallback");function SHo(t){return typeof t=="object"}a(SHo,"isCommandBuilderOptionDefinitions");function THo(t){return typeof t=="object"&&!Array.isArray(t)}a(THo,"isCommandHandlerDefinition");p();p();function yq(t={},e=()=>!0){let r={};return Tue(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(yq,"objFilter");p();function _q(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}a(_q,"setBlocking");function IHo(t){return typeof t=="boolean"}a(IHo,"isBoolean");function sEn(t,e){let r=e.y18n.__,n={},o=[];n.failFn=a(function(B){o.push(B)},"failFn");let s=null,c=null,l=!0;n.showHelpOnFail=a(function(B=!0,q){let[M,L]=typeof B=="string"?[!0,B]:[B,q];return t.getInternalMethods().isGlobalContext()&&(c=L),s=L,l=M,n},"showHelpOnFailFn");let u=!1;n.fail=a(function(B,q){let M=t.getInternalMethods().getLoggerInstance();if(o.length)for(let L=o.length-1;L>=0;--L){let U=o[L];if(IHo(U)){if(q)throw q;if(B)throw Error(B)}else U(B,q,n)}else{if(t.getExitProcess()&&_q(!0),!u){u=!0,l&&(t.showHelp("error"),M.error()),(B||q)&&M.error(B||q);let L=s||c;L&&((B||q)&&M.error(""),M.error(L))}if(q=q||new oh(B),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,q);throw q}},"fail");let d=[],f=!1;n.usage=(O,B)=>O===null?(f=!0,d=[],n):(f=!1,d.push([O,B||""]),n),n.getUsage=()=>d,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>r("Positionals:");let h=[];n.example=(O,B)=>{h.push([O,B||""])};let m=[];n.command=a(function(B,q,M,L,U=!1){M&&(m=m.map(j=>(j[2]=!1,j))),m.push([B,q||"",M,L,U])},"command"),n.getCommands=()=>m;let g={};n.describe=a(function(B,q){Array.isArray(B)?B.forEach(M=>{n.describe(M,q)}):typeof B=="object"?Object.keys(B).forEach(M=>{n.describe(M,B[M])}):g[B]=q},"describe"),n.getDescriptions=()=>g;let A=[];n.epilog=O=>{A.push(O)};let y=!1,_;n.wrap=O=>{y=!0,_=O},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(_=k(),y=!0),_);let E="__yargsString__:";n.deferY18nLookup=O=>E+O,n.help=a(function(){if(T)return T;S();let B=t.customScriptName?t.$0:e.path.basename(t.$0),q=t.getDemandedOptions(),M=t.getDemandedCommands(),L=t.getDeprecatedOptions(),U=t.getGroups(),j=t.getOptions(),Q=[];Q=Q.concat(Object.keys(g)),Q=Q.concat(Object.keys(q)),Q=Q.concat(Object.keys(M)),Q=Q.concat(Object.keys(j.default)),Q=Q.filter(R),Q=Object.keys(Q.reduce((le,Le)=>(Le!=="_"&&(le[Le]=!0),le),{}));let Y=n.getWrap(),W=e.cliui({width:Y,wrap:!!Y});if(!f){if(d.length)d.forEach(le=>{W.div({text:`${le[0].replace(/\$0/g,B)}`}),le[1]&&W.div({text:`${le[1]}`,padding:[1,0,0,0]})}),W.div();else if(m.length){let le=null;M._?le=`${B} <${r("command")}> `:le=`${B} [${r("command")}] -`,W.div(`${le}`)}}if(m.length>1||m.length===1&&!m[0][2]){W.div(r("Commands:"));let le=t.getInternalMethods().getContext(),Le=le.commands.length?`${le.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((Oe,Te)=>Oe[0].localeCompare(Te[0])));let me=B?`${B} `:"";m.forEach(Oe=>{let Te=`${me}${Le}${Oe[0].replace(/^\$0 ?/,"")}`;W.span({text:Te,padding:[0,2,0,2],width:v(m,Y,`${B}${Le}`)+4},{text:Oe[1]});let te=[];Oe[2]&&te.push(`[${r("default")}]`),Oe[3]&&Oe[3].length&&te.push(`[${r("aliases:")} ${Oe[3].join(", ")}]`),Oe[4]&&(typeof Oe[4]=="string"?te.push(`[${r("deprecated: %s",Oe[4])}]`):te.push(`[${r("deprecated")}]`)),te.length?W.div({text:te.join(" "),padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}let V=(Object.keys(j.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);Q=Q.filter(le=>!t.parsed.newAliases[le]&&V.every(Le=>(j.alias[Le]||[]).indexOf(le)===-1));let z=r("Options:");U[z]||(U[z]=[]),w(Q,j.alias,U,z);let ie=a(le=>/^--/.test(YYe(le)),"isLongSwitch"),H=Object.keys(U).filter(le=>U[le].length>0).map(le=>{let Le=U[le].filter(R).map(me=>{if(V.includes(me))return me;for(let Oe=0,Te;(Te=V[Oe])!==void 0;Oe++)if((j.alias[Te]||[]).includes(me))return Te;return me});return{groupName:le,normalizedKeys:Le}}).filter(({normalizedKeys:le})=>le.length>0).map(({groupName:le,normalizedKeys:Le})=>{let me=Le.reduce((Oe,Te)=>(Oe[Te]=[Te].concat(j.alias[Te]||[]).map(te=>le===n.getPositionalGroupName()?te:(/^[0-9]$/.test(te)?j.boolean.includes(Te)?"-":"--":te.length>1?"--":"-")+te).sort((te,ee)=>ie(te)===ie(ee)?0:ie(te)?1:-1).join(", "),Oe),{});return{groupName:le,normalizedKeys:Le,switches:me}});if(H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).some(({normalizedKeys:le,switches:Le})=>!le.every(me=>ie(Le[me])))&&H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).forEach(({normalizedKeys:le,switches:Le})=>{le.forEach(me=>{ie(Le[me])&&(Le[me]=THo(Le[me],4))})}),H.forEach(({groupName:le,normalizedKeys:Le,switches:me})=>{W.div(le),Le.forEach(Oe=>{let Te=me[Oe],te=g[Oe]||"",ee=null;te.includes(E)&&(te=r(te.substring(E.length))),j.boolean.includes(Oe)&&(ee=`[${r("boolean")}]`),j.count.includes(Oe)&&(ee=`[${r("count")}]`),j.string.includes(Oe)&&(ee=`[${r("string")}]`),j.normalize.includes(Oe)&&(ee=`[${r("string")}]`),j.array.includes(Oe)&&(ee=`[${r("array")}]`),j.number.includes(Oe)&&(ee=`[${r("number")}]`);let K=a(de=>typeof de=="string"?`[${r("deprecated: %s",de)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),he=[Oe in L?K(L[Oe]):null,ee,Oe in q?`[${r("required")}]`:null,j.choices&&j.choices[Oe]?`[${r("choices:")} ${n.stringifiedValues(j.choices[Oe])}]`:null,x(j.default[Oe],j.defaultDescription[Oe])].filter(Boolean).join(" ");W.span({text:YYe(Te),padding:[0,2,0,2+iEn(Te)],width:v(me,Y)+4},te);let X=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;he&&!X?W.div({text:he,padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}),h.length&&(W.div(r("Examples:")),h.forEach(le=>{le[0]=le[0].replace(/\$0/g,B)}),h.forEach(le=>{le[1]===""?W.div({text:le[0],padding:[0,2,0,2]}):W.div({text:le[0],padding:[0,2,0,2],width:v(h,Y)+4},{text:le[1]})}),W.div()),A.length>0){let le=A.map(Le=>Le.replace(/\$0/g,B)).join(` +`,W.div(`${le}`)}}if(m.length>1||m.length===1&&!m[0][2]){W.div(r("Commands:"));let le=t.getInternalMethods().getContext(),Le=le.commands.length?`${le.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((Oe,Te)=>Oe[0].localeCompare(Te[0])));let me=B?`${B} `:"";m.forEach(Oe=>{let Te=`${me}${Le}${Oe[0].replace(/^\$0 ?/,"")}`;W.span({text:Te,padding:[0,2,0,2],width:v(m,Y,`${B}${Le}`)+4},{text:Oe[1]});let te=[];Oe[2]&&te.push(`[${r("default")}]`),Oe[3]&&Oe[3].length&&te.push(`[${r("aliases:")} ${Oe[3].join(", ")}]`),Oe[4]&&(typeof Oe[4]=="string"?te.push(`[${r("deprecated: %s",Oe[4])}]`):te.push(`[${r("deprecated")}]`)),te.length?W.div({text:te.join(" "),padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}let V=(Object.keys(j.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);Q=Q.filter(le=>!t.parsed.newAliases[le]&&V.every(Le=>(j.alias[Le]||[]).indexOf(le)===-1));let z=r("Options:");U[z]||(U[z]=[]),w(Q,j.alias,U,z);let ie=a(le=>/^--/.test(YYe(le)),"isLongSwitch"),H=Object.keys(U).filter(le=>U[le].length>0).map(le=>{let Le=U[le].filter(R).map(me=>{if(V.includes(me))return me;for(let Oe=0,Te;(Te=V[Oe])!==void 0;Oe++)if((j.alias[Te]||[]).includes(me))return Te;return me});return{groupName:le,normalizedKeys:Le}}).filter(({normalizedKeys:le})=>le.length>0).map(({groupName:le,normalizedKeys:Le})=>{let me=Le.reduce((Oe,Te)=>(Oe[Te]=[Te].concat(j.alias[Te]||[]).map(te=>le===n.getPositionalGroupName()?te:(/^[0-9]$/.test(te)?j.boolean.includes(Te)?"-":"--":te.length>1?"--":"-")+te).sort((te,ee)=>ie(te)===ie(ee)?0:ie(te)?1:-1).join(", "),Oe),{});return{groupName:le,normalizedKeys:Le,switches:me}});if(H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).some(({normalizedKeys:le,switches:Le})=>!le.every(me=>ie(Le[me])))&&H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).forEach(({normalizedKeys:le,switches:Le})=>{le.forEach(me=>{ie(Le[me])&&(Le[me]=xHo(Le[me],4))})}),H.forEach(({groupName:le,normalizedKeys:Le,switches:me})=>{W.div(le),Le.forEach(Oe=>{let Te=me[Oe],te=g[Oe]||"",ee=null;te.includes(E)&&(te=r(te.substring(E.length))),j.boolean.includes(Oe)&&(ee=`[${r("boolean")}]`),j.count.includes(Oe)&&(ee=`[${r("count")}]`),j.string.includes(Oe)&&(ee=`[${r("string")}]`),j.normalize.includes(Oe)&&(ee=`[${r("string")}]`),j.array.includes(Oe)&&(ee=`[${r("array")}]`),j.number.includes(Oe)&&(ee=`[${r("number")}]`);let K=a(de=>typeof de=="string"?`[${r("deprecated: %s",de)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),he=[Oe in L?K(L[Oe]):null,ee,Oe in q?`[${r("required")}]`:null,j.choices&&j.choices[Oe]?`[${r("choices:")} ${n.stringifiedValues(j.choices[Oe])}]`:null,x(j.default[Oe],j.defaultDescription[Oe])].filter(Boolean).join(" ");W.span({text:YYe(Te),padding:[0,2,0,2+oEn(Te)],width:v(me,Y)+4},te);let X=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;he&&!X?W.div({text:he,padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}),h.length&&(W.div(r("Examples:")),h.forEach(le=>{le[0]=le[0].replace(/\$0/g,B)}),h.forEach(le=>{le[1]===""?W.div({text:le[0],padding:[0,2,0,2]}):W.div({text:le[0],padding:[0,2,0,2],width:v(h,Y)+4},{text:le[1]})}),W.div()),A.length>0){let le=A.map(Le=>Le.replace(/\$0/g,B)).join(` `);W.div(`${le} -`)}return W.toString().replace(/\s*$/,"")},"help");function v(O,B,q){let M=0;return Array.isArray(O)||(O=Object.values(O).map(L=>[L])),O.forEach(L=>{M=Math.max(e.stringWidth(q?`${q} ${YYe(L[0])}`:YYe(L[0]))+iEn(L[0]),M)}),B&&(M=Math.min(M,parseInt((B*.5).toString(),10))),M}a(v,"maxWidth");function S(){let O=t.getDemandedOptions(),B=t.getOptions();(Object.keys(B.alias)||[]).forEach(q=>{B.alias[q].forEach(M=>{g[M]&&n.describe(q,g[M]),M in O&&t.demandOption(q,O[M]),B.boolean.includes(M)&&t.boolean(q),B.count.includes(M)&&t.count(q),B.string.includes(M)&&t.string(q),B.normalize.includes(M)&&t.normalize(q),B.array.includes(M)&&t.array(q),B.number.includes(M)&&t.number(q)})})}a(S,"normalizeAliases");let T;n.cacheHelpMessage=function(){T=this.help()},n.clearCachedHelpMessage=function(){T=void 0},n.hasCachedHelpMessage=function(){return!!T};function w(O,B,q,M){let L=[],U=null;return Object.keys(q).forEach(j=>{L=L.concat(q[j])}),O.forEach(j=>{U=[j].concat(B[j]),U.some(Q=>L.indexOf(Q)!==-1)||q[M].push(j)}),L}a(w,"addUngroupedKeys");function R(O){return t.getOptions().hiddenOptions.indexOf(O)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}a(R,"filterHiddenOptions"),n.showHelp=O=>{let B=t.getInternalMethods().getLoggerInstance();O||(O="error"),(typeof O=="function"?O:B[O])(n.help())},n.functionDescription=O=>["(",O.name?e.Parser.decamelize(O.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=a(function(B,q){let M="",L=q||", ",U=[].concat(B);return!B||!U.length||U.forEach(j=>{M.length&&(M+=L),M+=JSON.stringify(j)}),M},"stringifiedValues");function x(O,B){let q=`[${r("default:")} `;if(O===void 0&&!B)return null;if(B)q+=B;else switch(typeof O){case"string":q+=`"${O}"`;break;case"object":q+=JSON.stringify(O);break;default:q+=O}return`${q}]`}a(x,"defaultString");function k(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}a(k,"windowWidth");let D=null;n.version=O=>{D=O},n.showVersion=O=>{let B=t.getInternalMethods().getLoggerInstance();O||(O="error"),(typeof O=="function"?O:B[O])(D)},n.reset=a(function(B){return s=null,u=!1,d=[],f=!1,A=[],h=[],m=[],g=yq(g,q=>!B[q]),n},"reset");let N=[];return n.freeze=a(function(){N.push({failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g})},"freeze"),n.unfreeze=a(function(B=!1){let q=N.pop();q&&(B?(g={...q.descriptions,...g},m=[...q.commands,...m],d=[...q.usages,...d],h=[...q.examples,...h],A=[...q.epilogs,...A]):{failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g}=q)},"unfreeze"),n}a(oEn,"usage");function fQt(t){return typeof t=="object"}a(fQt,"isIndentedText");function THo(t,e){return fQt(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(THo,"addIndentation");function iEn(t){return fQt(t)?t.indentation:0}a(iEn,"getIndentation");function YYe(t){return fQt(t)?t.text:t}a(YYe,"getText");p();p();var sEn=`###-begin-{{app_name}}-completions-### +`)}return W.toString().replace(/\s*$/,"")},"help");function v(O,B,q){let M=0;return Array.isArray(O)||(O=Object.values(O).map(L=>[L])),O.forEach(L=>{M=Math.max(e.stringWidth(q?`${q} ${YYe(L[0])}`:YYe(L[0]))+oEn(L[0]),M)}),B&&(M=Math.min(M,parseInt((B*.5).toString(),10))),M}a(v,"maxWidth");function S(){let O=t.getDemandedOptions(),B=t.getOptions();(Object.keys(B.alias)||[]).forEach(q=>{B.alias[q].forEach(M=>{g[M]&&n.describe(q,g[M]),M in O&&t.demandOption(q,O[M]),B.boolean.includes(M)&&t.boolean(q),B.count.includes(M)&&t.count(q),B.string.includes(M)&&t.string(q),B.normalize.includes(M)&&t.normalize(q),B.array.includes(M)&&t.array(q),B.number.includes(M)&&t.number(q)})})}a(S,"normalizeAliases");let T;n.cacheHelpMessage=function(){T=this.help()},n.clearCachedHelpMessage=function(){T=void 0},n.hasCachedHelpMessage=function(){return!!T};function w(O,B,q,M){let L=[],U=null;return Object.keys(q).forEach(j=>{L=L.concat(q[j])}),O.forEach(j=>{U=[j].concat(B[j]),U.some(Q=>L.indexOf(Q)!==-1)||q[M].push(j)}),L}a(w,"addUngroupedKeys");function R(O){return t.getOptions().hiddenOptions.indexOf(O)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}a(R,"filterHiddenOptions"),n.showHelp=O=>{let B=t.getInternalMethods().getLoggerInstance();O||(O="error"),(typeof O=="function"?O:B[O])(n.help())},n.functionDescription=O=>["(",O.name?e.Parser.decamelize(O.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=a(function(B,q){let M="",L=q||", ",U=[].concat(B);return!B||!U.length||U.forEach(j=>{M.length&&(M+=L),M+=JSON.stringify(j)}),M},"stringifiedValues");function x(O,B){let q=`[${r("default:")} `;if(O===void 0&&!B)return null;if(B)q+=B;else switch(typeof O){case"string":q+=`"${O}"`;break;case"object":q+=JSON.stringify(O);break;default:q+=O}return`${q}]`}a(x,"defaultString");function k(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}a(k,"windowWidth");let D=null;n.version=O=>{D=O},n.showVersion=O=>{let B=t.getInternalMethods().getLoggerInstance();O||(O="error"),(typeof O=="function"?O:B[O])(D)},n.reset=a(function(B){return s=null,u=!1,d=[],f=!1,A=[],h=[],m=[],g=yq(g,q=>!B[q]),n},"reset");let N=[];return n.freeze=a(function(){N.push({failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g})},"freeze"),n.unfreeze=a(function(B=!1){let q=N.pop();q&&(B?(g={...q.descriptions,...g},m=[...q.commands,...m],d=[...q.usages,...d],h=[...q.examples,...h],A=[...q.epilogs,...A]):{failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g}=q)},"unfreeze"),n}a(sEn,"usage");function pQt(t){return typeof t=="object"}a(pQt,"isIndentedText");function xHo(t,e){return pQt(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(xHo,"addIndentation");function oEn(t){return pQt(t)?t.indentation:0}a(oEn,"getIndentation");function YYe(t){return pQt(t)?t.text:t}a(YYe,"getText");p();p();var aEn=`###-begin-{{app_name}}-completions-### # # yargs command completion script # @@ -2314,7 +2314,7 @@ _{{app_name}}_yargs_completions() } complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}} ###-end-{{app_name}}-completions-### -`,aEn=`#compdef {{app_name}} +`,cEn=`#compdef {{app_name}} ###-begin-{{app_name}}-completions-### # # yargs command completion script @@ -2341,22 +2341,22 @@ else compdef _{{app_name}}_yargs_completions {{app_name}} fi ###-end-{{app_name}}-completions-### -`;var pQt=class{static{a(this,"Completion")}constructor(e,r,n,o){var s,c,l;this.yargs=e,this.usage=r,this.command=n,this.shim=o,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(l=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((c=this.shim.getEnv("ZSH_NAME"))===null||c===void 0?void 0:c.includes("zsh")))!==null&&l!==void 0?l:!1}defaultCompletion(e,r,n,o){let s=this.command.getCommandHandlers();for(let l=0,u=e.length;l{let c=Aq(s[0]).cmd;if(r.indexOf(c)===-1)if(!this.zshShell)e.push(c);else{let l=s[1]||"";e.push(c.replace(/:/g,"\\:")+":"+l)}})}optionCompletions(e,r,n,o){if((o.match(/^-/)||o===""&&e.length===0)&&!this.previousArgHasChoices(r)){let s=this.yargs.getOptions(),c=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(l=>{let u=!!s.configuration["boolean-negation"]&&s.boolean.includes(l);!c.includes(l)&&!s.hiddenOptions.includes(l)&&!this.argsContainKey(r,l,u)&&this.completeOptionKey(l,e,o,u&&!!s.default[l])})}}choicesFromOptionsCompletions(e,r,n,o){if(this.previousArgHasChoices(r)){let s=this.getPreviousArgChoices(r);s&&s.length>0&&e.push(...s.map(c=>c.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,o){if(o===""&&e.length>0&&this.previousArgHasChoices(r))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],c=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),l=s[n._.length-c-1];if(!l)return;let u=this.yargs.getOptions().choices[l]||[];for(let d of u)d.startsWith(o)&&e.push(d.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;let o=r.replace(/^-+/,""),s=this.yargs.getOptions(),c=[o,...this.yargs.getAliases()[o]||[]],l;for(let u of c)if(Object.prototype.hasOwnProperty.call(s.key,u)&&Array.isArray(s.choices[u])){l=s.choices[u];break}if(l)return l.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){let r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){let o=a(s=>e.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1,"argsContains");if(o(r)||n&&o(`no-${r}`))return!0;if(this.aliases){for(let s of this.aliases[r])if(o(s))return!0}return!1}completeOptionKey(e,r,n,o){var s,c,l,u;let d=e;if(this.zshShell){let g=this.usage.getDescriptions(),A=(c=(s=this===null||this===void 0?void 0:this.aliases)===null||s===void 0?void 0:s[e])===null||c===void 0?void 0:c.find(E=>{let v=g[E];return typeof v=="string"&&v.length>0}),y=A?g[A]:void 0,_=(u=(l=g[e])!==null&&l!==void 0?l:y)!==null&&u!==void 0?u:"";d=`${e.replace(/:/g,"\\:")}:${_.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let f=a(g=>/^--/.test(g),"startsByTwoDashes"),h=a(g=>/^[^0-9]$/.test(g),"isShortOption"),m=!f(n)&&h(e)?"-":"--";r.push(m+d),o&&r.push(m+"no-"+d)}customCompletion(e,r,n,o){if(ev(this.customCompletionFunction,null,this.shim),xHo(this.customCompletionFunction)){let s=this.customCompletionFunction(n,r);return cd(s)?s.then(c=>{this.shim.process.nextTick(()=>{o(null,c)})}).catch(c=>{this.shim.process.nextTick(()=>{o(c,void 0)})}):o(null,s)}else return wHo(this.customCompletionFunction)?this.customCompletionFunction(n,r,(s=o)=>this.defaultCompletion(e,r,n,s),s=>{o(null,s)}):this.customCompletionFunction(n,r,s=>{o(null,s)})}getCompletion(e,r){let n=e.length?e[e.length-1]:"",o=this.yargs.parse(e,!0),s=this.customCompletionFunction?c=>this.customCompletion(e,c,n,r):c=>this.defaultCompletion(e,c,n,r);return cd(o)?o.then(s):s(o)}generateCompletionScript(e,r){let n=this.zshShell?aEn:sEn,o=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,o),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function cEn(t,e,r,n){return new pQt(t,e,r,n)}a(cEn,"completion");function xHo(t){return t.length<3}a(xHo,"isSyncCompletionFunction");function wHo(t){return t.length>3}a(wHo,"isFallbackCompletionFunction");p();p();function lEn(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let o;for(o=0;o<=t.length;o++)r[0][o]=o;for(n=1;n<=e.length;n++)for(o=1;o<=t.length;o++)e.charAt(n-1)===t.charAt(o-1)?r[n][o]=r[n-1][o-1]:n>1&&o>1&&e.charAt(n-2)===t.charAt(o-1)&&e.charAt(n-1)===t.charAt(o-2)?r[n][o]=r[n-2][o-2]+1:r[n][o]=Math.min(r[n-1][o-1]+1,Math.min(r[n][o-1]+1,r[n-1][o]+1));return r[e.length][t.length]}a(lEn,"levenshtein");var uEn=["$0","--","_"];function dEn(t,e,r){let n=r.y18n.__,o=r.y18n.__n,s={};s.nonOptionCount=a(function(h){let m=t.getDemandedCommands(),A=h._.length+(h["--"]?h["--"].length:0)-t.getInternalMethods().getContext().commands.length;m._&&(Am._.max)&&(Am._.max&&(m._.maxMsg!==void 0?e.fail(m._.maxMsg?m._.maxMsg.replace(/\$0/g,A.toString()).replace(/\$1/,m._.max.toString()):null):e.fail(o("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",A,A.toString(),m._.max.toString()))))},"nonOptionCount"),s.positionalCount=a(function(h,m){m"u")&&(g=g||{},g[A]=m[A]);if(g){let A=[];for(let _ of Object.keys(g)){let E=g[_];E&&A.indexOf(E)<0&&A.push(E)}let y=A.length?` +`;var hQt=class{static{a(this,"Completion")}constructor(e,r,n,o){var s,c,l;this.yargs=e,this.usage=r,this.command=n,this.shim=o,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(l=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((c=this.shim.getEnv("ZSH_NAME"))===null||c===void 0?void 0:c.includes("zsh")))!==null&&l!==void 0?l:!1}defaultCompletion(e,r,n,o){let s=this.command.getCommandHandlers();for(let l=0,u=e.length;l{let c=Aq(s[0]).cmd;if(r.indexOf(c)===-1)if(!this.zshShell)e.push(c);else{let l=s[1]||"";e.push(c.replace(/:/g,"\\:")+":"+l)}})}optionCompletions(e,r,n,o){if((o.match(/^-/)||o===""&&e.length===0)&&!this.previousArgHasChoices(r)){let s=this.yargs.getOptions(),c=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(l=>{let u=!!s.configuration["boolean-negation"]&&s.boolean.includes(l);!c.includes(l)&&!s.hiddenOptions.includes(l)&&!this.argsContainKey(r,l,u)&&this.completeOptionKey(l,e,o,u&&!!s.default[l])})}}choicesFromOptionsCompletions(e,r,n,o){if(this.previousArgHasChoices(r)){let s=this.getPreviousArgChoices(r);s&&s.length>0&&e.push(...s.map(c=>c.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,o){if(o===""&&e.length>0&&this.previousArgHasChoices(r))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],c=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),l=s[n._.length-c-1];if(!l)return;let u=this.yargs.getOptions().choices[l]||[];for(let d of u)d.startsWith(o)&&e.push(d.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;let o=r.replace(/^-+/,""),s=this.yargs.getOptions(),c=[o,...this.yargs.getAliases()[o]||[]],l;for(let u of c)if(Object.prototype.hasOwnProperty.call(s.key,u)&&Array.isArray(s.choices[u])){l=s.choices[u];break}if(l)return l.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){let r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){let o=a(s=>e.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1,"argsContains");if(o(r)||n&&o(`no-${r}`))return!0;if(this.aliases){for(let s of this.aliases[r])if(o(s))return!0}return!1}completeOptionKey(e,r,n,o){var s,c,l,u;let d=e;if(this.zshShell){let g=this.usage.getDescriptions(),A=(c=(s=this===null||this===void 0?void 0:this.aliases)===null||s===void 0?void 0:s[e])===null||c===void 0?void 0:c.find(E=>{let v=g[E];return typeof v=="string"&&v.length>0}),y=A?g[A]:void 0,_=(u=(l=g[e])!==null&&l!==void 0?l:y)!==null&&u!==void 0?u:"";d=`${e.replace(/:/g,"\\:")}:${_.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let f=a(g=>/^--/.test(g),"startsByTwoDashes"),h=a(g=>/^[^0-9]$/.test(g),"isShortOption"),m=!f(n)&&h(e)?"-":"--";r.push(m+d),o&&r.push(m+"no-"+d)}customCompletion(e,r,n,o){if(ev(this.customCompletionFunction,null,this.shim),RHo(this.customCompletionFunction)){let s=this.customCompletionFunction(n,r);return cd(s)?s.then(c=>{this.shim.process.nextTick(()=>{o(null,c)})}).catch(c=>{this.shim.process.nextTick(()=>{o(c,void 0)})}):o(null,s)}else return kHo(this.customCompletionFunction)?this.customCompletionFunction(n,r,(s=o)=>this.defaultCompletion(e,r,n,s),s=>{o(null,s)}):this.customCompletionFunction(n,r,s=>{o(null,s)})}getCompletion(e,r){let n=e.length?e[e.length-1]:"",o=this.yargs.parse(e,!0),s=this.customCompletionFunction?c=>this.customCompletion(e,c,n,r):c=>this.defaultCompletion(e,c,n,r);return cd(o)?o.then(s):s(o)}generateCompletionScript(e,r){let n=this.zshShell?cEn:aEn,o=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,o),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function lEn(t,e,r,n){return new hQt(t,e,r,n)}a(lEn,"completion");function RHo(t){return t.length<3}a(RHo,"isSyncCompletionFunction");function kHo(t){return t.length>3}a(kHo,"isFallbackCompletionFunction");p();p();function uEn(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let o;for(o=0;o<=t.length;o++)r[0][o]=o;for(n=1;n<=e.length;n++)for(o=1;o<=t.length;o++)e.charAt(n-1)===t.charAt(o-1)?r[n][o]=r[n-1][o-1]:n>1&&o>1&&e.charAt(n-2)===t.charAt(o-1)&&e.charAt(n-1)===t.charAt(o-2)?r[n][o]=r[n-2][o-2]+1:r[n][o]=Math.min(r[n-1][o-1]+1,Math.min(r[n][o-1]+1,r[n-1][o]+1));return r[e.length][t.length]}a(uEn,"levenshtein");var dEn=["$0","--","_"];function fEn(t,e,r){let n=r.y18n.__,o=r.y18n.__n,s={};s.nonOptionCount=a(function(h){let m=t.getDemandedCommands(),A=h._.length+(h["--"]?h["--"].length:0)-t.getInternalMethods().getContext().commands.length;m._&&(Am._.max)&&(Am._.max&&(m._.maxMsg!==void 0?e.fail(m._.maxMsg?m._.maxMsg.replace(/\$0/g,A.toString()).replace(/\$1/,m._.max.toString()):null):e.fail(o("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",A,A.toString(),m._.max.toString()))))},"nonOptionCount"),s.positionalCount=a(function(h,m){m"u")&&(g=g||{},g[A]=m[A]);if(g){let A=[];for(let _ of Object.keys(g)){let E=g[_];E&&A.indexOf(E)<0&&A.push(E)}let y=A.length?` ${A.join(` -`)}`:"";e.fail(o("Missing required argument: %s","Missing required arguments: %s",Object.keys(g).length,Object.keys(g).join(", ")+y))}},"requiredArguments"),s.unknownArguments=a(function(h,m,g,A,y=!0){var _;let E=t.getInternalMethods().getCommandInstance().getCommands(),v=[],S=t.getInternalMethods().getContext();if(Object.keys(h).forEach(T=>{!uEn.includes(T)&&!Object.prototype.hasOwnProperty.call(g,T)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),T)&&!s.isValidAndSomeAliasIsNotNew(T,m)&&v.push(T)}),y&&(S.commands.length>0||E.length>0||A)&&h._.slice(S.commands.length).forEach(T=>{E.includes(""+T)||v.push(""+T)}),y){let w=((_=t.getDemandedCommands()._)===null||_===void 0?void 0:_.max)||0,R=S.commands.length+w;R{x=String(x),!S.commands.includes(x)&&!v.includes(x)&&v.push(x)})}v.length&&e.fail(o("Unknown argument: %s","Unknown arguments: %s",v.length,v.map(T=>T.trim()?T:`"${T}"`).join(", ")))},"unknownArguments"),s.unknownCommands=a(function(h){let m=t.getInternalMethods().getCommandInstance().getCommands(),g=[],A=t.getInternalMethods().getContext();return(A.commands.length>0||m.length>0)&&h._.slice(A.commands.length).forEach(y=>{m.includes(""+y)||g.push(""+y)}),g.length>0?(e.fail(o("Unknown command: %s","Unknown commands: %s",g.length,g.join(", "))),!0):!1},"unknownCommands"),s.isValidAndSomeAliasIsNotNew=a(function(h,m){if(!Object.prototype.hasOwnProperty.call(m,h))return!1;let g=t.parsed.newAliases;return[h,...m[h]].some(A=>!Object.prototype.hasOwnProperty.call(g,A)||!g[h])},"isValidAndSomeAliasIsNotNew"),s.limitedChoices=a(function(h){let m=t.getOptions(),g={};if(!Object.keys(m.choices).length)return;Object.keys(h).forEach(_=>{uEn.indexOf(_)===-1&&Object.prototype.hasOwnProperty.call(m.choices,_)&&[].concat(h[_]).forEach(E=>{m.choices[_].indexOf(E)===-1&&E!==void 0&&(g[_]=(g[_]||[]).concat(E))})});let A=Object.keys(g);if(!A.length)return;let y=n("Invalid values:");A.forEach(_=>{y+=` +`)}`:"";e.fail(o("Missing required argument: %s","Missing required arguments: %s",Object.keys(g).length,Object.keys(g).join(", ")+y))}},"requiredArguments"),s.unknownArguments=a(function(h,m,g,A,y=!0){var _;let E=t.getInternalMethods().getCommandInstance().getCommands(),v=[],S=t.getInternalMethods().getContext();if(Object.keys(h).forEach(T=>{!dEn.includes(T)&&!Object.prototype.hasOwnProperty.call(g,T)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),T)&&!s.isValidAndSomeAliasIsNotNew(T,m)&&v.push(T)}),y&&(S.commands.length>0||E.length>0||A)&&h._.slice(S.commands.length).forEach(T=>{E.includes(""+T)||v.push(""+T)}),y){let w=((_=t.getDemandedCommands()._)===null||_===void 0?void 0:_.max)||0,R=S.commands.length+w;R{x=String(x),!S.commands.includes(x)&&!v.includes(x)&&v.push(x)})}v.length&&e.fail(o("Unknown argument: %s","Unknown arguments: %s",v.length,v.map(T=>T.trim()?T:`"${T}"`).join(", ")))},"unknownArguments"),s.unknownCommands=a(function(h){let m=t.getInternalMethods().getCommandInstance().getCommands(),g=[],A=t.getInternalMethods().getContext();return(A.commands.length>0||m.length>0)&&h._.slice(A.commands.length).forEach(y=>{m.includes(""+y)||g.push(""+y)}),g.length>0?(e.fail(o("Unknown command: %s","Unknown commands: %s",g.length,g.join(", "))),!0):!1},"unknownCommands"),s.isValidAndSomeAliasIsNotNew=a(function(h,m){if(!Object.prototype.hasOwnProperty.call(m,h))return!1;let g=t.parsed.newAliases;return[h,...m[h]].some(A=>!Object.prototype.hasOwnProperty.call(g,A)||!g[h])},"isValidAndSomeAliasIsNotNew"),s.limitedChoices=a(function(h){let m=t.getOptions(),g={};if(!Object.keys(m.choices).length)return;Object.keys(h).forEach(_=>{dEn.indexOf(_)===-1&&Object.prototype.hasOwnProperty.call(m.choices,_)&&[].concat(h[_]).forEach(E=>{m.choices[_].indexOf(E)===-1&&E!==void 0&&(g[_]=(g[_]||[]).concat(E))})});let A=Object.keys(g);if(!A.length)return;let y=n("Invalid values:");A.forEach(_=>{y+=` ${n("Argument: %s, Given: %s, Choices: %s",_,e.stringifiedValues(g[_]),e.stringifiedValues(m.choices[_]))}`}),e.fail(y)},"limitedChoices");let c={};s.implies=a(function(h,m){Qn(" [array|number|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.implies(g,h[g])}):(t.global(h),c[h]||(c[h]=[]),Array.isArray(m)?m.forEach(g=>s.implies(h,g)):(ev(m,void 0,r),c[h].push(m)))},"implies"),s.getImplied=a(function(){return c},"getImplied");function l(f,h){let m=Number(h);return h=isNaN(m)?h:m,typeof h=="number"?h=f._.length>=h:h.match(/^--no-.+/)?(h=h.match(/^--no-(.+)/)[1],h=!Object.prototype.hasOwnProperty.call(f,h)):h=Object.prototype.hasOwnProperty.call(f,h),h}a(l,"keyExists"),s.implications=a(function(h){let m=[];if(Object.keys(c).forEach(g=>{let A=g;(c[g]||[]).forEach(y=>{let _=A,E=y;_=l(h,_),y=l(h,y),_&&!y&&m.push(` ${A} -> ${E}`)})}),m.length){let g=`${n("Implications failed:")} -`;m.forEach(A=>{g+=A}),e.fail(g)}},"implications");let u={};s.conflicts=a(function(h,m){Qn(" [array|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.conflicts(g,h[g])}):(t.global(h),u[h]||(u[h]=[]),Array.isArray(m)?m.forEach(g=>s.conflicts(h,g)):u[h].push(m))},"conflicts"),s.getConflicting=()=>u,s.conflicting=a(function(h){Object.keys(h).forEach(m=>{u[m]&&u[m].forEach(g=>{g&&h[m]!==void 0&&h[g]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(m=>{u[m].forEach(g=>{g&&h[r.Parser.camelCase(m)]!==void 0&&h[r.Parser.camelCase(g)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})})},"conflictingFn"),s.recommendCommands=a(function(h,m){m=m.sort((_,E)=>E.length-_.length);let A=null,y=1/0;for(let _=0,E;(E=m[_])!==void 0;_++){let v=lEn(h,E);v<=3&&v!h[m]),u=yq(u,m=>!h[m]),s},"reset");let d=[];return s.freeze=a(function(){d.push({implied:c,conflicting:u})},"freeze"),s.unfreeze=a(function(){let h=d.pop();ev(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(dEn,"validation");p();var PHo={};var hQt=[],awe;function KYe(t,e,r,n){awe=n;let o={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return o;let s=/\.json|\..*rc$/.test(t.extends),c=null;if(s)c=kHo(e,t.extends);else try{c=PHo.resolve(t.extends)}catch{return t}RHo(c),hQt.push(c),o=s?JSON.parse(awe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=KYe(o,awe.path.dirname(c),r,awe)}return hQt=[],r?fEn(o,t):Object.assign({},o,t)}a(KYe,"applyExtends");function RHo(t){if(hQt.indexOf(t)>-1)throw new oh(`Circular extended configurations: '${t}'.`)}a(RHo,"checkForCircularExtends");function kHo(t,e){return awe.path.resolve(t,e)}a(kHo,"getPathToDefaultConfig");function fEn(t,e){let r={};function n(o){return o&&typeof o=="object"&&!Array.isArray(o)}a(n,"isObject"),Object.assign(r,t);for(let o of Object.keys(e))o!=="__proto__"&&(n(e[o])&&n(r[o])?r[o]=fEn(t[o],e[o]):r[o]=e[o]);return r}a(fEn,"mergeDeep");var qn=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},ke=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},sh,JK,cwe,tb,aT,JYe,Eq,ZK,ZYe,gw,XYe,Aw,UO,cT,yw,eKe,XK,A0,oi,tKe,rKe,lT,eJ,Iue,tJ,vq,nKe,Xi,rJ,nJ,iJ,yo,iKe,QO,cp;function DEn(t){return(e=[],r=t.process.cwd(),n)=>{let o=new TQt(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(DEn,"YargsFactory");var pEn=Symbol("copyDoubleDash"),hEn=Symbol("copyDoubleDash"),mQt=Symbol("deleteFromParserHintObject"),mEn=Symbol("emitWarning"),gEn=Symbol("freeze"),AEn=Symbol("getDollarZero"),oJ=Symbol("getParserConfiguration"),yEn=Symbol("getUsageConfiguration"),gQt=Symbol("guessLocale"),_En=Symbol("guessVersion"),EEn=Symbol("parsePositionalNumbers"),AQt=Symbol("pkgUp"),Cq=Symbol("populateParserHintArray"),xue=Symbol("populateParserHintSingleValueDictionary"),yQt=Symbol("populateParserHintArrayDictionary"),_Qt=Symbol("populateParserHintDictionary"),EQt=Symbol("sanitizeKey"),vQt=Symbol("setKey"),CQt=Symbol("unfreeze"),vEn=Symbol("validateAsync"),CEn=Symbol("getCommandInstance"),bEn=Symbol("getContext"),SEn=Symbol("getHasOutput"),TEn=Symbol("getLoggerInstance"),IEn=Symbol("getParseContext"),xEn=Symbol("getUsageInstance"),wEn=Symbol("getValidationInstance"),oKe=Symbol("hasParseCallback"),REn=Symbol("isGlobalContext"),sJ=Symbol("postProcess"),kEn=Symbol("rebase"),bQt=Symbol("reset"),lwe=Symbol("runYargsParserAndExecuteCommands"),SQt=Symbol("runValidation"),PEn=Symbol("setHasOutput"),aJ=Symbol("kTrackManuallySetKeys"),DHo="en_US",TQt=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,sh.set(this,void 0),JK.set(this,void 0),cwe.set(this,{commands:[],fullCommands:[]}),tb.set(this,null),aT.set(this,null),JYe.set(this,"show-hidden"),Eq.set(this,null),ZK.set(this,!0),ZYe.set(this,{}),gw.set(this,!0),XYe.set(this,[]),Aw.set(this,void 0),UO.set(this,{}),cT.set(this,!1),yw.set(this,null),eKe.set(this,!0),XK.set(this,void 0),A0.set(this,""),oi.set(this,void 0),tKe.set(this,void 0),rKe.set(this,{}),lT.set(this,null),eJ.set(this,null),Iue.set(this,{}),tJ.set(this,{}),vq.set(this,void 0),nKe.set(this,!1),Xi.set(this,void 0),rJ.set(this,!1),nJ.set(this,!1),iJ.set(this,!1),yo.set(this,void 0),iKe.set(this,{}),QO.set(this,null),cp.set(this,void 0),qn(this,Xi,o,"f"),qn(this,vq,e,"f"),qn(this,JK,r,"f"),qn(this,tKe,n,"f"),qn(this,Aw,new WYe(this),"f"),this.$0=this[AEn](),this[bQt](),qn(this,sh,ke(this,sh,"f"),"f"),qn(this,yo,ke(this,yo,"f"),"f"),qn(this,cp,ke(this,cp,"f"),"f"),qn(this,oi,ke(this,oi,"f"),"f"),ke(this,oi,"f").showHiddenOpt=ke(this,JYe,"f"),qn(this,XK,this[hEn](),"f"),ke(this,Xi,"f").y18n.setLocale(DHo)}addHelpOpt(e,r){let n="help";return Qn("[string|boolean] [string]",[e,r],arguments.length),ke(this,yw,"f")&&(this[mQt](ke(this,yw,"f")),qn(this,yw,null,"f")),e===!1&&r===void 0?this:(qn(this,yw,typeof e=="string"?e:n,"f"),this.boolean(ke(this,yw,"f")),this.describe(ke(this,yw,"f"),r||ke(this,yo,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(Qn("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:ke(this,JYe,"f");return this.boolean(n),this.describe(n,r||ke(this,yo,"f").deferY18nLookup("Show hidden options")),ke(this,oi,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return Qn(" [string|array]",[e,r],arguments.length),this[yQt](this.alias.bind(this),"alias",e,r),this}array(e){return Qn("",[e],arguments.length),this[Cq]("array",e),this[aJ](e),this}boolean(e){return Qn("",[e],arguments.length),this[Cq]("boolean",e),this[aJ](e),this}check(e,r){return Qn(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>KK(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&ke(this,yo,"f").fail(s.toString(),s):ke(this,yo,"f").fail(ke(this,Xi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(ke(this,yo,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return Qn(" [string|array]",[e,r],arguments.length),this[yQt](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(Qn(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new oh("coerce callback must be provided");for(let o of e)this.coerce(o,r);return this}else if(typeof e=="object"){for(let o of Object.keys(e))this.coerce(o,e[o]);return this}if(!r)throw new oh("coerce callback must be provided");let n=e;return ke(this,oi,"f").key[n]=!0,ke(this,Aw,"f").addCoerceMiddleware((o,s)=>{var c;let l=(c=s.getAliases()[n])!==null&&c!==void 0?c:[],u=[n,...l].filter(d=>Object.prototype.hasOwnProperty.call(o,d));return u.length===0?o:KK(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new oh(d.message)})},n),this}conflicts(e,r){return Qn(" [string|array]",[e,r],arguments.length),ke(this,cp,"f").conflicts(e,r),this}config(e="config",r,n){return Qn("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=KYe(e,ke(this,JK,"f"),this[oJ]()["deep-merge-config"]||!1,ke(this,Xi,"f")),ke(this,oi,"f").configObjects=(ke(this,oi,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||ke(this,yo,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(o=>{ke(this,oi,"f").config[o]=n||!0}),this)}completion(e,r,n){return Qn("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),qn(this,aT,e||ke(this,aT,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(ke(this,aT,"f"),r),n&&ke(this,tb,"f").registerFunction(n),this}command(e,r,n,o,s,c){return Qn(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),ke(this,sh,"f").addHandler(e,r,n,o,s,c),this}commands(e,r,n,o,s,c){return this.command(e,r,n,o,s,c)}commandDir(e,r){Qn(" [object]",[e,r],arguments.length);let n=ke(this,tKe,"f")||ke(this,Xi,"f").require;return ke(this,sh,"f").addDirectory(e,n,ke(this,Xi,"f").getCallerFile(),r),this}count(e){return Qn("",[e],arguments.length),this[Cq]("count",e),this[aJ](e),this}default(e,r,n){return Qn(" [*] [string]",[e,r,n],arguments.length),n&&(uQt(e,ke(this,Xi,"f")),ke(this,oi,"f").defaultDescription[e]=n),typeof r=="function"&&(uQt(e,ke(this,Xi,"f")),ke(this,oi,"f").defaultDescription[e]||(ke(this,oi,"f").defaultDescription[e]=ke(this,yo,"f").functionDescription(r)),r=r.call()),this[xue](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,o){return Qn("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,o],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),ke(this,oi,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:o},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(o=>{ev(n,!0,ke(this,Xi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(ev(n,!0,ke(this,Xi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{ev(n,!0,ke(this,Xi,"f")),this.demandOption(o,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return Qn(" [string]",[e,r],arguments.length),this[xue](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return Qn(" [string|boolean]",[e,r],arguments.length),ke(this,oi,"f").deprecatedOptions[e]=r,this}describe(e,r){return Qn(" [string]",[e,r],arguments.length),this[vQt](e,!0),ke(this,yo,"f").describe(e,r),this}detectLocale(e){return Qn("",[e],arguments.length),qn(this,ZK,e,"f"),this}env(e){return Qn("[string|boolean]",[e],arguments.length),e===!1?delete ke(this,oi,"f").envPrefix:ke(this,oi,"f").envPrefix=e||"",this}epilogue(e){return Qn("",[e],arguments.length),ke(this,yo,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return Qn(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):ke(this,yo,"f").example(e,r),this}exit(e,r){qn(this,cT,!0,"f"),qn(this,Eq,r,"f"),ke(this,gw,"f")&&ke(this,Xi,"f").process.exit(e)}exitProcess(e=!0){return Qn("[boolean]",[e],arguments.length),qn(this,gw,e,"f"),this}fail(e){if(Qn("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new oh("Invalid first argument. Expected function or boolean 'false'");return ke(this,yo,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return Qn(" [function]",[e,r],arguments.length),r?ke(this,tb,"f").getCompletion(e,r):new Promise((n,o)=>{ke(this,tb,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return Qn([],0),ke(this,oi,"f").demandedOptions}getDemandedCommands(){return Qn([],0),ke(this,oi,"f").demandedCommands}getDeprecatedOptions(){return Qn([],0),ke(this,oi,"f").deprecatedOptions}getDetectLocale(){return ke(this,ZK,"f")}getExitProcess(){return ke(this,gw,"f")}getGroups(){return Object.assign({},ke(this,UO,"f"),ke(this,tJ,"f"))}getHelp(){if(qn(this,cT,!0,"f"),!ke(this,yo,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[lwe](ke(this,vq,"f"),void 0,void 0,0,!0);if(cd(r))return r.then(()=>ke(this,yo,"f").help())}let e=ke(this,sh,"f").runDefaultBuilderOn(this);if(cd(e))return e.then(()=>ke(this,yo,"f").help())}return Promise.resolve(ke(this,yo,"f").help())}getOptions(){return ke(this,oi,"f")}getStrict(){return ke(this,rJ,"f")}getStrictCommands(){return ke(this,nJ,"f")}getStrictOptions(){return ke(this,iJ,"f")}global(e,r){return Qn(" [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?ke(this,oi,"f").local=ke(this,oi,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{ke(this,oi,"f").local.includes(n)||ke(this,oi,"f").local.push(n)}),this}group(e,r){Qn(" ",[e,r],arguments.length);let n=ke(this,tJ,"f")[r]||ke(this,UO,"f")[r];ke(this,tJ,"f")[r]&&delete ke(this,tJ,"f")[r];let o={};return ke(this,UO,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return Qn("",[e],arguments.length),ke(this,oi,"f").hiddenOptions.push(e),this}implies(e,r){return Qn(" [number|string|array]",[e,r],arguments.length),ke(this,cp,"f").implies(e,r),this}locale(e){return Qn("[string]",[e],arguments.length),e===void 0?(this[gQt](),ke(this,Xi,"f").y18n.getLocale()):(qn(this,ZK,!1,"f"),ke(this,Xi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return ke(this,Aw,"f").addMiddleware(e,!!r,n)}nargs(e,r){return Qn(" [number]",[e,r],arguments.length),this[xue](this.nargs.bind(this),"narg",e,r),this}normalize(e){return Qn("",[e],arguments.length),this[Cq]("normalize",e),this}number(e){return Qn("",[e],arguments.length),this[Cq]("number",e),this[aJ](e),this}option(e,r){if(Qn(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[aJ](e),ke(this,QO,"f")&&(e==="version"||r?.alias==="version")&&this[mEn](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(` -`),void 0,"versionWarning"),ke(this,oi,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let o=r.demand||r.required||r.require;o&&this.demand(e,o),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(ke(this,oi,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let s=r.describe||r.description||r.desc,c=ke(this,yo,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(c,e)||typeof s=="string")&&this.describe(e,s),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){Qn("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[gEn](),typeof e>"u"&&(e=ke(this,vq,"f")),typeof r=="object"&&(qn(this,eJ,r,"f"),r=n),typeof r=="function"&&(qn(this,lT,r,"f"),r=!1),r||qn(this,vq,e,"f"),ke(this,lT,"f")&&qn(this,gw,!1,"f");let o=this[lwe](e,!!r),s=this.parsed;return ke(this,tb,"f").setParsed(this.parsed),cd(o)?o.then(c=>(ke(this,lT,"f")&&ke(this,lT,"f").call(this,ke(this,Eq,"f"),c,ke(this,A0,"f")),c)).catch(c=>{throw ke(this,lT,"f")&&ke(this,lT,"f")(c,this.parsed.argv,ke(this,A0,"f")),c}).finally(()=>{this[CQt](),this.parsed=s}):(ke(this,lT,"f")&&ke(this,lT,"f").call(this,ke(this,Eq,"f"),o,ke(this,A0,"f")),this[CQt](),this.parsed=s,o)}parseAsync(e,r,n){let o=this.parse(e,r,n);return cd(o)?o:Promise.resolve(o)}parseSync(e,r,n){let o=this.parse(e,r,n);if(cd(o))throw new oh(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return Qn("",[e],arguments.length),qn(this,rKe,e,"f"),this}pkgConf(e,r){Qn(" [string]",[e,r],arguments.length);let n=null,o=this[AQt](r||ke(this,JK,"f"));return o[e]&&typeof o[e]=="object"&&(n=KYe(o[e],r||ke(this,JK,"f"),this[oJ]()["deep-merge-config"]||!1,ke(this,Xi,"f")),ke(this,oi,"f").configObjects=(ke(this,oi,"f").configObjects||[]).concat(n)),this}positional(e,r){Qn(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=yq(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=ke(this,cwe,"f").fullCommands[ke(this,cwe,"f").fullCommands.length-1],s=o?ke(this,sh,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return Sue(s).forEach(c=>{let l=s[c];Array.isArray(l)?l.indexOf(e)!==-1&&(r[c]=!0):l[e]&&!(c in r)&&(r[c]=l[e])}),this.group(e,ke(this,yo,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return Qn("[boolean]",[e],arguments.length),qn(this,nKe,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return Qn(" [number]",[e],arguments.length),typeof e=="string"&&ke(this,oi,"f").narg[e]?this:(this[xue](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return Qn("[string] [string]",[e,r],arguments.length),e=e||this.$0,ke(this,XK,"f").log(ke(this,tb,"f").generateCompletionScript(e,r||ke(this,aT,"f")||"completion")),this}showHelp(e){if(Qn("[string|function]",[e],arguments.length),qn(this,cT,!0,"f"),!ke(this,yo,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[lwe](ke(this,vq,"f"),void 0,void 0,0,!0);if(cd(n))return n.then(()=>{ke(this,yo,"f").showHelp(e)}),this}let r=ke(this,sh,"f").runDefaultBuilderOn(this);if(cd(r))return r.then(()=>{ke(this,yo,"f").showHelp(e)}),this}return ke(this,yo,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return Qn("[boolean|string] [string]",[e,r],arguments.length),ke(this,yo,"f").showHelpOnFail(e,r),this}showVersion(e){return Qn("[string|function]",[e],arguments.length),ke(this,yo,"f").showVersion(e),this}skipValidation(e){return Qn("",[e],arguments.length),this[Cq]("skipValidation",e),this}strict(e){return Qn("[boolean]",[e],arguments.length),qn(this,rJ,e!==!1,"f"),this}strictCommands(e){return Qn("[boolean]",[e],arguments.length),qn(this,nJ,e!==!1,"f"),this}strictOptions(e){return Qn("[boolean]",[e],arguments.length),qn(this,iJ,e!==!1,"f"),this}string(e){return Qn("",[e],arguments.length),this[Cq]("string",e),this[aJ](e),this}terminalWidth(){return Qn([],0),ke(this,Xi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return Qn("",[e],arguments.length),qn(this,ZK,!1,"f"),ke(this,Xi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(Qn(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(ev(e,null,ke(this,Xi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new oh(".usage() description must start with $0 if being used as alias for .command()")}else return ke(this,yo,"f").usage(e),this}usageConfiguration(e){return Qn("",[e],arguments.length),qn(this,iKe,e,"f"),this}version(e,r,n){let o="version";if(Qn("[boolean|string] [string] [string]",[e,r,n],arguments.length),ke(this,QO,"f")&&(this[mQt](ke(this,QO,"f")),ke(this,yo,"f").version(void 0),qn(this,QO,null,"f")),arguments.length===0)n=this[_En](),e=o;else if(arguments.length===1){if(e===!1)return this;n=e,e=o}else arguments.length===2&&(n=r,r=void 0);return qn(this,QO,typeof e=="string"?e:o,"f"),r=r||ke(this,yo,"f").deferY18nLookup("Show version number"),ke(this,yo,"f").version(n||void 0),this.boolean(ke(this,QO,"f")),this.describe(ke(this,QO,"f"),r),this}wrap(e){return Qn("",[e],arguments.length),ke(this,yo,"f").wrap(e),this}[(sh=new WeakMap,JK=new WeakMap,cwe=new WeakMap,tb=new WeakMap,aT=new WeakMap,JYe=new WeakMap,Eq=new WeakMap,ZK=new WeakMap,ZYe=new WeakMap,gw=new WeakMap,XYe=new WeakMap,Aw=new WeakMap,UO=new WeakMap,cT=new WeakMap,yw=new WeakMap,eKe=new WeakMap,XK=new WeakMap,A0=new WeakMap,oi=new WeakMap,tKe=new WeakMap,rKe=new WeakMap,lT=new WeakMap,eJ=new WeakMap,Iue=new WeakMap,tJ=new WeakMap,vq=new WeakMap,nKe=new WeakMap,Xi=new WeakMap,rJ=new WeakMap,nJ=new WeakMap,iJ=new WeakMap,yo=new WeakMap,iKe=new WeakMap,QO=new WeakMap,cp=new WeakMap,pEn)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[hEn](){return{log:a((...e)=>{this[oKe]()||console.log(...e),qn(this,cT,!0,"f"),ke(this,A0,"f").length&&qn(this,A0,ke(this,A0,"f")+` -`,"f"),qn(this,A0,ke(this,A0,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[oKe]()||console.error(...e),qn(this,cT,!0,"f"),ke(this,A0,"f").length&&qn(this,A0,ke(this,A0,"f")+` -`,"f"),qn(this,A0,ke(this,A0,"f")+e.join(" "),"f")},"error")}}[mQt](e){Sue(ke(this,oi,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=ke(this,oi,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete ke(this,yo,"f").getDescriptions()[e]}[mEn](e,r,n){ke(this,ZYe,"f")[n]||(ke(this,Xi,"f").process.emitWarning(e,r),ke(this,ZYe,"f")[n]=!0)}[gEn](){ke(this,XYe,"f").push({options:ke(this,oi,"f"),configObjects:ke(this,oi,"f").configObjects.slice(0),exitProcess:ke(this,gw,"f"),groups:ke(this,UO,"f"),strict:ke(this,rJ,"f"),strictCommands:ke(this,nJ,"f"),strictOptions:ke(this,iJ,"f"),completionCommand:ke(this,aT,"f"),output:ke(this,A0,"f"),exitError:ke(this,Eq,"f"),hasOutput:ke(this,cT,"f"),parsed:this.parsed,parseFn:ke(this,lT,"f"),parseContext:ke(this,eJ,"f")}),ke(this,yo,"f").freeze(),ke(this,cp,"f").freeze(),ke(this,sh,"f").freeze(),ke(this,Aw,"f").freeze()}[AEn](){let e="",r;return/\b(node|iojs|electron|bun)(\.exe)?$/.test(ke(this,Xi,"f").process.argv()[0])?r=ke(this,Xi,"f").process.argv().slice(1,2):r=ke(this,Xi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[kEn](ke(this,JK,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});ev(s,void 0,ke(this,Xi,"f")),n=JSON.parse(ke(this,Xi,"f").readFileSync(s,"utf8"))}catch{}return ke(this,Iue,"f")[r]=n||{},ke(this,Iue,"f")[r]}[Cq](e,r){r=[].concat(r),r.forEach(n=>{n=this[EQt](n),ke(this,oi,"f")[e].push(n)})}[xue](e,r,n,o){this[_Qt](e,r,n,o,(s,c,l)=>{ke(this,oi,"f")[s][c]=l})}[yQt](e,r,n,o){this[_Qt](e,r,n,o,(s,c,l)=>{ke(this,oi,"f")[s][c]=(ke(this,oi,"f")[s][c]||[]).concat(l)})}[_Qt](e,r,n,o,s){if(Array.isArray(n))n.forEach(c=>{e(c,o)});else if((c=>typeof c=="object")(n))for(let c of Sue(n))e(c,n[c]);else s(r,this[EQt](n),o)}[EQt](e){return e==="__proto__"?"___proto___":e}[vQt](e,r){return this[xue](this[vQt].bind(this),"key",e,r),this}[CQt](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=ke(this,XYe,"f").pop();ev(g,void 0,ke(this,Xi,"f"));let A;e=this,r=this,n=this,o=this,s=this,c=this,l=this,u=this,d=this,f=this,h=this,m=this,{options:{set value(y){qn(e,oi,y,"f")}}.value,configObjects:A,exitProcess:{set value(y){qn(r,gw,y,"f")}}.value,groups:{set value(y){qn(n,UO,y,"f")}}.value,output:{set value(y){qn(o,A0,y,"f")}}.value,exitError:{set value(y){qn(s,Eq,y,"f")}}.value,hasOutput:{set value(y){qn(c,cT,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){qn(l,rJ,y,"f")}}.value,strictCommands:{set value(y){qn(u,nJ,y,"f")}}.value,strictOptions:{set value(y){qn(d,iJ,y,"f")}}.value,completionCommand:{set value(y){qn(f,aT,y,"f")}}.value,parseFn:{set value(y){qn(h,lT,y,"f")}}.value,parseContext:{set value(y){qn(m,eJ,y,"f")}}.value}=g,ke(this,oi,"f").configObjects=A,ke(this,yo,"f").unfreeze(),ke(this,cp,"f").unfreeze(),ke(this,sh,"f").unfreeze(),ke(this,Aw,"f").unfreeze()}[vEn](e,r){return KK(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[CEn].bind(this),getContext:this[bEn].bind(this),getHasOutput:this[SEn].bind(this),getLoggerInstance:this[TEn].bind(this),getParseContext:this[IEn].bind(this),getParserConfiguration:this[oJ].bind(this),getUsageConfiguration:this[yEn].bind(this),getUsageInstance:this[xEn].bind(this),getValidationInstance:this[wEn].bind(this),hasParseCallback:this[oKe].bind(this),isGlobalContext:this[REn].bind(this),postProcess:this[sJ].bind(this),reset:this[bQt].bind(this),runValidation:this[SQt].bind(this),runYargsParserAndExecuteCommands:this[lwe].bind(this),setHasOutput:this[PEn].bind(this)}}[CEn](){return ke(this,sh,"f")}[bEn](){return ke(this,cwe,"f")}[SEn](){return ke(this,cT,"f")}[TEn](){return ke(this,XK,"f")}[IEn](){return ke(this,eJ,"f")||{}}[xEn](){return ke(this,yo,"f")}[wEn](){return ke(this,cp,"f")}[oKe](){return!!ke(this,lT,"f")}[REn](){return ke(this,eKe,"f")}[sJ](e,r,n,o){return n||cd(e)||(r||(e=this[pEn](e)),(this[oJ]()["parse-positional-numbers"]||this[oJ]()["parse-positional-numbers"]===void 0)&&(e=this[EEn](e)),o&&(e=YK(e,this,ke(this,Aw,"f").getMiddleware(),!1))),e}[bQt](e={}){qn(this,oi,ke(this,oi,"f")||{},"f");let r={};r.local=ke(this,oi,"f").local||[],r.configObjects=ke(this,oi,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(e[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(ke(this,tJ,"f"),Object.keys(ke(this,UO,"f")).reduce((c,l)=>{let u=ke(this,UO,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),qn(this,UO,{},"f");let o=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return o.forEach(c=>{r[c]=(ke(this,oi,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=yq(ke(this,oi,"f")[c],l=>!n[l])}),r.envPrefix=ke(this,oi,"f").envPrefix,qn(this,oi,r,"f"),qn(this,yo,ke(this,yo,"f")?ke(this,yo,"f").reset(n):oEn(this,ke(this,Xi,"f")),"f"),qn(this,cp,ke(this,cp,"f")?ke(this,cp,"f").reset(n):dEn(this,ke(this,yo,"f"),ke(this,Xi,"f")),"f"),qn(this,sh,ke(this,sh,"f")?ke(this,sh,"f").reset():rEn(ke(this,yo,"f"),ke(this,cp,"f"),ke(this,Aw,"f"),ke(this,Xi,"f")),"f"),ke(this,tb,"f")||qn(this,tb,cEn(this,ke(this,yo,"f"),ke(this,sh,"f"),ke(this,Xi,"f")),"f"),ke(this,Aw,"f").reset(),qn(this,aT,null,"f"),qn(this,A0,"","f"),qn(this,Eq,null,"f"),qn(this,cT,!1,"f"),this.parsed=!1,this}[kEn](e,r){return ke(this,Xi,"f").path.relative(e,r)}[lwe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||ke(this,vq,"f"),ke(this,oi,"f").__=ke(this,Xi,"f").y18n.__,ke(this,oi,"f").configuration=this[oJ]();let h=!!ke(this,oi,"f").configuration["populate--"],m=Object.assign({},ke(this,oi,"f").configuration,{"populate--":!0}),g=ke(this,Xi,"f").Parser.detailed(e,Object.assign({},ke(this,oi,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,ke(this,eJ,"f")),y,_=g.aliases,E=!1,v=!1;Object.keys(A).forEach(S=>{S===ke(this,yw,"f")&&A[S]?E=!0:S===ke(this,QO,"f")&&A[S]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&ke(this,yo,"f").clearCachedHelpMessage();try{if(this[gQt](),r)return this[sJ](A,h,!!n,!1);ke(this,yw,"f")&&[ke(this,yw,"f")].concat(_[ke(this,yw,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),E=!0),qn(this,eKe,!1,"f");let S=ke(this,sh,"f").getCommands(),T=!((c=ke(this,tb,"f"))===null||c===void 0)&&c.completionKey?[(l=ke(this,tb,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=ke(this,tb,"f"))===null||u===void 0?void 0:u.completionKey])!==null&&d!==void 0?d:[]].some(R=>Object.prototype.hasOwnProperty.call(A,R)):!1,w=E||T||s;if(A._.length){if(S.length){let R;for(let x=o||0,k;A._[x]!==void 0;x++)if(k=String(A._[x]),S.includes(k)&&k!==ke(this,aT,"f")){let D=ke(this,sh,"f").runCommand(k,this,g,x+1,s,E||v||s);return this[sJ](D,h,!!n,!1)}else if(!R&&k!==ke(this,aT,"f")){R=k;break}!ke(this,sh,"f").hasDefaultCommand()&&ke(this,nKe,"f")&&R&&!w&&ke(this,cp,"f").recommendCommands(R,S)}ke(this,aT,"f")&&A._.includes(ke(this,aT,"f"))&&!T&&(ke(this,gw,"f")&&_q(!0),this.showCompletionScript(),this.exit(0))}if(ke(this,sh,"f").hasDefaultCommand()&&!w){let R=ke(this,sh,"f").runCommand(null,this,g,0,s,E||v||s);return this[sJ](R,h,!!n,!1)}if(T){ke(this,gw,"f")&&_q(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${ke(this,tb,"f").completionKey}`)+1);return ke(this,tb,"f").getCompletion(R,(x,k)=>{if(x)throw new oh(x.message);(k||[]).forEach(D=>{ke(this,XK,"f").log(D)}),this.exit(0)}),this[sJ](A,!h,!!n,!1)}if(ke(this,cT,"f")||(E?(ke(this,gw,"f")&&_q(!0),f=!0,this.showHelp(R=>{ke(this,XK,"f").log(R),this.exit(0)})):v&&(ke(this,gw,"f")&&_q(!0),f=!0,ke(this,yo,"f").showVersion("log"),this.exit(0))),!f&&ke(this,oi,"f").skipValidation.length>0&&(f=Object.keys(A).some(R=>ke(this,oi,"f").skipValidation.indexOf(R)>=0&&A[R]===!0)),!f){if(g.error)throw new oh(g.error.message);if(!T){let R=this[SQt](_,{},g.error);n||(y=YK(A,this,ke(this,Aw,"f").getMiddleware(),!0)),y=this[vEn](R,y??A),cd(y)&&!n&&(y=y.then(()=>YK(A,this,ke(this,Aw,"f").getMiddleware(),!1)))}}}catch(S){if(S instanceof oh)ke(this,yo,"f").fail(S.message,S);else throw S}return this[sJ](y??A,h,!!n,!0)}[SQt](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new oh(n.message);ke(this,cp,"f").nonOptionCount(c),ke(this,cp,"f").requiredArguments(c,s);let l=!1;ke(this,nJ,"f")&&(l=ke(this,cp,"f").unknownCommands(c)),ke(this,rJ,"f")&&!l?ke(this,cp,"f").unknownArguments(c,e,r,!!o):ke(this,iJ,"f")&&ke(this,cp,"f").unknownArguments(c,e,{},!1,!1),ke(this,cp,"f").limitedChoices(c),ke(this,cp,"f").implications(c),ke(this,cp,"f").conflicting(c)}}[PEn](){qn(this,cT,!0,"f")}[aJ](e){if(typeof e=="string")ke(this,oi,"f").key[e]=!0;else for(let r of e)ke(this,oi,"f").key[r]=!0}};function nEn(t){return!!t&&typeof t.getInternalMethods=="function"}a(nEn,"isYargsInstance");var NHo=DEn(J_n),NEn=NHo;p();p();var LEn=require("node:child_process"),BEn=require("node:util");var MHo=(0,BEn.promisify)(LEn.execFile),bq="1.0.60",MEn="COPILOT_CLI_PATH",OHo="GITHUB_COPILOT_ACP_USE_CLI",wue="@github/copilot",LHo=3e4,BHo=1e4,OEn=6e4,Rue=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function FEn(){return process.env[OHo]!=="0"}a(FEn,"isCLIIntegrationEnabled");var IQt=process.platform==="win32";async function UEn(){if(process.env[MEn]){let l=process.env[MEn],u=await uwe(l,["--version"]);if(u)return UHo(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new Rue("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await uwe("copilot",["--version"]);if(t&&dwe(t,bq))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await uwe(e,["--offline",wue,"--version"],!1,BHo);if(r&&dwe(r,bq))return{path:e,args:[wue],version:r,source:"npx"};let n=`${wue}@${bq}`,o=await uwe(e,[n,"--version"],!1,OEn);if(o&&dwe(o,bq))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${wue}@latest`,c=await uwe(e,[s,"--version"],!0,OEn);if(c){if(dwe(c,bq))return{path:e,args:[s],version:c,source:"npx-latest"};throw new Rue(`Latest published Copilot CLI version ${c} is below the minimum required ${bq}.`)}throw new Rue(`Copilot CLI version could not be determined. 'npx ${s} --version' ran successfully but its output contained no recognisable version. -Try running 'npx ${s} --version' manually to inspect the output, or install/update globally with: npm install -g ${wue}`)}a(UEn,"discoverCLI");function FHo(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(FHo,"parseVersion");async function uwe(t,e,r=!1,n=LHo){try{let{stdout:o}=await MHo(t,e,{timeout:n,shell:IQt});return FHo(o)}catch(o){if(r)throw o;return null}}a(uwe,"tryGetVersion");function UHo(t,e){if(!dwe(t,bq))throw new Rue(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${bq}. Update with: npm install -g ${wue}@latest`)}a(UHo,"validateVersion");function dwe(t,e){let r=a(c=>c.replace(/^v/,"").split(".").map(l=>{let u=parseInt(l,10);return isNaN(u)?0:u}),"parse"),n=r(t),o=r(e),s=Math.max(n.length,o.length);for(let c=0;cu)return!0;if(lr.type==="file").map(r=>r.uri).filter(Boolean),...this.request.activeEditor?.uri?[this.request.activeEditor.uri]:[]];return Array.from(new Set(e))}getMetadata(e){return this._metadata.get(e)?.at(-1)}getAllMetadata(e){return this._metadata.get(e)}setMetadata(e){let r=e.constructor,n=this._metadata.get(r)??[];n.push(e),this._metadata.set(r,n)}hasMetadata(e){let r=this._metadata.get(e);return r!==void 0&&r.length>0}isSubagent(){return this.parentTurnId!==void 0&&this.parentTurnId!==""}},cJ=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=Dt();this._timestamp=Date.now();this.uriSchemeCache=new sKe;this.currentPartitionId=1;this.id=o??this.telemetryId}static{a(this,"Conversation")}copy(){let e=JSON.parse(JSON.stringify(this.turns)),r=new t(e,this.source,this.userLanguage,this.id);return r._telemetryId=this.telemetryId,r._timestamp=this.timestamp,r.currentPartitionId=this.currentPartitionId,r}get telemetryId(){return this._telemetryId}get timestamp(){return this._timestamp}addTurn(e){this.turns.push(e)}deleteTurn(e){this.turns=this.turns.filter(r=>r.id!==e)}getLastTurn(){return this.turns[this.turns.length-1]}findTurn(e){return this.turns.find(r=>r.id===e)}};p();p();var _w=class{constructor(){this.promiseMap=new Map}static{a(this,"SequencerByKey")}queue(e,r){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}async drain(){let e=Array.from(this.promiseMap.values());await Promise.all(e.map(r=>r.catch(()=>{})))}};p();var qO=(o=>(o.Local="LOCAL",o.Background="BACKGROUND",o.Claude="CLAUDE",o.Codex="CODEX",o))(qO||{}),QHo=Object.values(qO);function c2(t){let e=new Set;for(let r of t??[]){let n=r.providers;if(Array.isArray(n))for(let o of n)e.add(o)}return e.size===0?["LOCAL","BACKGROUND"]:QHo.filter(r=>e.has(r))}a(c2,"unionProviders");function uT(t,e){return t?["BACKGROUND"]:e?.length?[...e]:["LOCAL","BACKGROUND"]}a(uT,"providersForListRow");p();p();p();var lJ=fe(require("child_process")),wQt=fe(require("path")),rvn=fe(tvn());function nvn(t){return t.replace(/^git version /,"")}a(nvn,"parseVersion");function RQt(t){return new Promise((e,r)=>{let n=[],o=lJ.spawn(t,["--version"]);o.stdout.on("data",s=>n.push(s)),o.on("error",r),o.on("close",s=>s?r(new Error(`Not found. Code: ${s}`)):e({path:t,version:nvn(Buffer.concat(n).toString("utf8").trim())}))})}a(RQt,"findSpecificGit");function XHo(){return new Promise((t,e)=>{lJ.exec("which git",(r,n)=>{if(r)return e(new Error(`Executing "which git" failed: ${r.message}`));let o=n.toString().trim();function s(c){lJ.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:nvn(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);lJ.exec("xcode-select -p",c=>{if(c&&c.code===2)return e(new Error('Executing "xcode-select -p" failed with error code 2.'));s(o)})})})}a(XHo,"findGitDarwin");function aKe(t){return t?RQt(wQt.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(aKe,"findSystemGitWin32");async function eGo(){let t=await(0,rvn.default)("git.exe");return RQt(t)}a(eGo,"findGitWin32InPath");function tGo(){return aKe(process.env.ProgramW6432).then(void 0,()=>aKe(process.env["ProgramFiles(x86)"])).then(void 0,()=>aKe(process.env.ProgramFiles)).then(void 0,()=>aKe(wQt.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>eGo())}a(tGo,"findGitWin32");async function jO(){try{switch(process.platform){case"darwin":return await XHo();case"win32":return await tGo();default:return await RQt("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(jO,"findGit");var ivn=require("node:child_process"),ovn=require("node:util");var rGo=(0,ovn.promisify)(ivn.execFile);async function svn(t){return kQt(t,["github.com"])}a(svn,"resolveGitHubNwo");async function kQt(t,e){let r;try{r=(await jO()).path}catch{return}let n;try{n=(await rGo(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return nGo(n,e)}a(kQt,"resolveGitHubNwoForHosts");function nGo(t,e){let r=new Set(["github.com",...e.map(h=>h.toLowerCase())]),n=t.trim().match(/^(?:(?:https?|ssh|git):\/\/(?:[^@]+@)?|git@)([^/:]+)(?::\d+)?[:/](.+?)(?:\.git)?$/);if(!n)return;let[,o,s]=n;if(!r.has(o.toLowerCase()))return;let c=s.indexOf("/");if(c<=0)return;let l=s.slice(0,c),u=s.slice(c+1),d=u.indexOf("/"),f=d>=0?u.slice(0,d):u;if(!(!l||!f))return{owner:l,repo:f}}a(nGo,"parseGitRemoteUrl");async function avn(t,e,r=fetch){let n=`https://api.github.com/repos/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.repo)}`,o;try{o=await r(n,{headers:{Authorization:`token ${e}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}})}catch{return}if(!o.ok)return;let s=await o.json();if(!(typeof s.id!="number"||typeof s.owner?.id!="number"))return{ownerId:s.owner.id,repoId:s.id}}a(avn,"resolveRepoIds");p();var iGo=3e4,cKe=class{constructor(e,r=iGo){this.ctx=e;this.timeoutMs=r;this.logger=new pe("OrgCustomAgentClient")}static{a(this,"OrgCustomAgentClient")}async listCustomAgents(e,r){let n=this.ctx,o=await this.tryGetAccessToken();if(!o)return;let s=i3(n).api,c=`${cvn(s)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}?include_sources=org,enterprise`;try{let l=await n.get(Jt).fetch(c,{method:"GET",headers:{Authorization:`Bearer ${o}`,Accept:"application/json",...om(n)},timeout:this.timeoutMs});if(!l.ok){this.logger.warn(n,`[OrgCustomAgentClient] list ${e}/${r} -> ${l.status}`);return}let u=await l.json();return Array.isArray(u?.agents)?u.agents:[]}catch(l){this.logger.warn(n,`[OrgCustomAgentClient] list ${e}/${r} failed: ${String(l)}`);return}}async getCustomAgentDetails(e,r,n,o){let s=this.ctx,c=await this.tryGetAccessToken();if(!c)return;let l=i3(s).api,u=new URL(`${cvn(l)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}`);u.searchParams.set("version",o);try{let d=await s.get(Jt).fetch(u.toString(),{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json",...om(s)},timeout:this.timeoutMs});if(!d.ok){this.logger.warn(s,`[OrgCustomAgentClient] detail ${e}/${r}/${n}?version=${o} -> ${d.status}`);return}return await d.json()}catch(d){this.logger.warn(s,`[OrgCustomAgentClient] detail ${e}/${r}/${n}?version=${o} failed: ${String(d)}`);return}}async tryGetAccessToken(){try{return(await this.ctx.get(Fr).resolveSession())?.accessToken}catch(e){this.logger.debug(this.ctx,`[OrgCustomAgentClient] no GitHub session: ${String(e)}`);return}}};function cvn(t){return t.endsWith("/")?t.slice(0,-1):t}a(cvn,"trimTrailingSlash");p();p();function oGo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}a(oGo,"getDefaultExportFromCjs");var C_={},lKe={},Tq={},lvn;function fwe(){if(lvn)return Tq;lvn=1;function t(c){return typeof c>"u"||c===null}a(t,"isNothing");function e(c){return typeof c=="object"&&c!==null}a(e,"isObject");function r(c){return Array.isArray(c)?c:t(c)?[]:[c]}a(r,"toArray");function n(c,l){if(l){let u=Object.keys(l);for(let d=0,f=u.length;d{g+=A}),e.fail(g)}},"implications");let u={};s.conflicts=a(function(h,m){Qn(" [array|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.conflicts(g,h[g])}):(t.global(h),u[h]||(u[h]=[]),Array.isArray(m)?m.forEach(g=>s.conflicts(h,g)):u[h].push(m))},"conflicts"),s.getConflicting=()=>u,s.conflicting=a(function(h){Object.keys(h).forEach(m=>{u[m]&&u[m].forEach(g=>{g&&h[m]!==void 0&&h[g]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(m=>{u[m].forEach(g=>{g&&h[r.Parser.camelCase(m)]!==void 0&&h[r.Parser.camelCase(g)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})})},"conflictingFn"),s.recommendCommands=a(function(h,m){m=m.sort((_,E)=>E.length-_.length);let A=null,y=1/0;for(let _=0,E;(E=m[_])!==void 0;_++){let v=uEn(h,E);v<=3&&v!h[m]),u=yq(u,m=>!h[m]),s},"reset");let d=[];return s.freeze=a(function(){d.push({implied:c,conflicting:u})},"freeze"),s.unfreeze=a(function(){let h=d.pop();ev(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(fEn,"validation");p();var NHo={};var mQt=[],awe;function KYe(t,e,r,n){awe=n;let o={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return o;let s=/\.json|\..*rc$/.test(t.extends),c=null;if(s)c=DHo(e,t.extends);else try{c=NHo.resolve(t.extends)}catch{return t}PHo(c),mQt.push(c),o=s?JSON.parse(awe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=KYe(o,awe.path.dirname(c),r,awe)}return mQt=[],r?pEn(o,t):Object.assign({},o,t)}a(KYe,"applyExtends");function PHo(t){if(mQt.indexOf(t)>-1)throw new oh(`Circular extended configurations: '${t}'.`)}a(PHo,"checkForCircularExtends");function DHo(t,e){return awe.path.resolve(t,e)}a(DHo,"getPathToDefaultConfig");function pEn(t,e){let r={};function n(o){return o&&typeof o=="object"&&!Array.isArray(o)}a(n,"isObject"),Object.assign(r,t);for(let o of Object.keys(e))o!=="__proto__"&&(n(e[o])&&n(r[o])?r[o]=pEn(t[o],e[o]):r[o]=e[o]);return r}a(pEn,"mergeDeep");var qn=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},ke=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},sh,ZK,cwe,tb,aT,JYe,Eq,XK,ZYe,gw,XYe,Aw,UO,cT,yw,eKe,eJ,y0,oi,tKe,rKe,lT,tJ,xue,rJ,vq,nKe,Xi,nJ,iJ,oJ,yo,iKe,QO,cp;function NEn(t){return(e=[],r=t.process.cwd(),n)=>{let o=new IQt(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(NEn,"YargsFactory");var hEn=Symbol("copyDoubleDash"),mEn=Symbol("copyDoubleDash"),gQt=Symbol("deleteFromParserHintObject"),gEn=Symbol("emitWarning"),AEn=Symbol("freeze"),yEn=Symbol("getDollarZero"),sJ=Symbol("getParserConfiguration"),_En=Symbol("getUsageConfiguration"),AQt=Symbol("guessLocale"),EEn=Symbol("guessVersion"),vEn=Symbol("parsePositionalNumbers"),yQt=Symbol("pkgUp"),Cq=Symbol("populateParserHintArray"),wue=Symbol("populateParserHintSingleValueDictionary"),_Qt=Symbol("populateParserHintArrayDictionary"),EQt=Symbol("populateParserHintDictionary"),vQt=Symbol("sanitizeKey"),CQt=Symbol("setKey"),bQt=Symbol("unfreeze"),CEn=Symbol("validateAsync"),bEn=Symbol("getCommandInstance"),SEn=Symbol("getContext"),TEn=Symbol("getHasOutput"),IEn=Symbol("getLoggerInstance"),xEn=Symbol("getParseContext"),wEn=Symbol("getUsageInstance"),REn=Symbol("getValidationInstance"),oKe=Symbol("hasParseCallback"),kEn=Symbol("isGlobalContext"),aJ=Symbol("postProcess"),PEn=Symbol("rebase"),SQt=Symbol("reset"),lwe=Symbol("runYargsParserAndExecuteCommands"),TQt=Symbol("runValidation"),DEn=Symbol("setHasOutput"),cJ=Symbol("kTrackManuallySetKeys"),MHo="en_US",IQt=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,sh.set(this,void 0),ZK.set(this,void 0),cwe.set(this,{commands:[],fullCommands:[]}),tb.set(this,null),aT.set(this,null),JYe.set(this,"show-hidden"),Eq.set(this,null),XK.set(this,!0),ZYe.set(this,{}),gw.set(this,!0),XYe.set(this,[]),Aw.set(this,void 0),UO.set(this,{}),cT.set(this,!1),yw.set(this,null),eKe.set(this,!0),eJ.set(this,void 0),y0.set(this,""),oi.set(this,void 0),tKe.set(this,void 0),rKe.set(this,{}),lT.set(this,null),tJ.set(this,null),xue.set(this,{}),rJ.set(this,{}),vq.set(this,void 0),nKe.set(this,!1),Xi.set(this,void 0),nJ.set(this,!1),iJ.set(this,!1),oJ.set(this,!1),yo.set(this,void 0),iKe.set(this,{}),QO.set(this,null),cp.set(this,void 0),qn(this,Xi,o,"f"),qn(this,vq,e,"f"),qn(this,ZK,r,"f"),qn(this,tKe,n,"f"),qn(this,Aw,new WYe(this),"f"),this.$0=this[yEn](),this[SQt](),qn(this,sh,ke(this,sh,"f"),"f"),qn(this,yo,ke(this,yo,"f"),"f"),qn(this,cp,ke(this,cp,"f"),"f"),qn(this,oi,ke(this,oi,"f"),"f"),ke(this,oi,"f").showHiddenOpt=ke(this,JYe,"f"),qn(this,eJ,this[mEn](),"f"),ke(this,Xi,"f").y18n.setLocale(MHo)}addHelpOpt(e,r){let n="help";return Qn("[string|boolean] [string]",[e,r],arguments.length),ke(this,yw,"f")&&(this[gQt](ke(this,yw,"f")),qn(this,yw,null,"f")),e===!1&&r===void 0?this:(qn(this,yw,typeof e=="string"?e:n,"f"),this.boolean(ke(this,yw,"f")),this.describe(ke(this,yw,"f"),r||ke(this,yo,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(Qn("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:ke(this,JYe,"f");return this.boolean(n),this.describe(n,r||ke(this,yo,"f").deferY18nLookup("Show hidden options")),ke(this,oi,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return Qn(" [string|array]",[e,r],arguments.length),this[_Qt](this.alias.bind(this),"alias",e,r),this}array(e){return Qn("",[e],arguments.length),this[Cq]("array",e),this[cJ](e),this}boolean(e){return Qn("",[e],arguments.length),this[Cq]("boolean",e),this[cJ](e),this}check(e,r){return Qn(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>JK(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&ke(this,yo,"f").fail(s.toString(),s):ke(this,yo,"f").fail(ke(this,Xi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(ke(this,yo,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return Qn(" [string|array]",[e,r],arguments.length),this[_Qt](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(Qn(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new oh("coerce callback must be provided");for(let o of e)this.coerce(o,r);return this}else if(typeof e=="object"){for(let o of Object.keys(e))this.coerce(o,e[o]);return this}if(!r)throw new oh("coerce callback must be provided");let n=e;return ke(this,oi,"f").key[n]=!0,ke(this,Aw,"f").addCoerceMiddleware((o,s)=>{var c;let l=(c=s.getAliases()[n])!==null&&c!==void 0?c:[],u=[n,...l].filter(d=>Object.prototype.hasOwnProperty.call(o,d));return u.length===0?o:JK(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new oh(d.message)})},n),this}conflicts(e,r){return Qn(" [string|array]",[e,r],arguments.length),ke(this,cp,"f").conflicts(e,r),this}config(e="config",r,n){return Qn("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=KYe(e,ke(this,ZK,"f"),this[sJ]()["deep-merge-config"]||!1,ke(this,Xi,"f")),ke(this,oi,"f").configObjects=(ke(this,oi,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||ke(this,yo,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(o=>{ke(this,oi,"f").config[o]=n||!0}),this)}completion(e,r,n){return Qn("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),qn(this,aT,e||ke(this,aT,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(ke(this,aT,"f"),r),n&&ke(this,tb,"f").registerFunction(n),this}command(e,r,n,o,s,c){return Qn(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),ke(this,sh,"f").addHandler(e,r,n,o,s,c),this}commands(e,r,n,o,s,c){return this.command(e,r,n,o,s,c)}commandDir(e,r){Qn(" [object]",[e,r],arguments.length);let n=ke(this,tKe,"f")||ke(this,Xi,"f").require;return ke(this,sh,"f").addDirectory(e,n,ke(this,Xi,"f").getCallerFile(),r),this}count(e){return Qn("",[e],arguments.length),this[Cq]("count",e),this[cJ](e),this}default(e,r,n){return Qn(" [*] [string]",[e,r,n],arguments.length),n&&(dQt(e,ke(this,Xi,"f")),ke(this,oi,"f").defaultDescription[e]=n),typeof r=="function"&&(dQt(e,ke(this,Xi,"f")),ke(this,oi,"f").defaultDescription[e]||(ke(this,oi,"f").defaultDescription[e]=ke(this,yo,"f").functionDescription(r)),r=r.call()),this[wue](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,o){return Qn("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,o],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),ke(this,oi,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:o},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(o=>{ev(n,!0,ke(this,Xi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(ev(n,!0,ke(this,Xi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{ev(n,!0,ke(this,Xi,"f")),this.demandOption(o,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return Qn(" [string]",[e,r],arguments.length),this[wue](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return Qn(" [string|boolean]",[e,r],arguments.length),ke(this,oi,"f").deprecatedOptions[e]=r,this}describe(e,r){return Qn(" [string]",[e,r],arguments.length),this[CQt](e,!0),ke(this,yo,"f").describe(e,r),this}detectLocale(e){return Qn("",[e],arguments.length),qn(this,XK,e,"f"),this}env(e){return Qn("[string|boolean]",[e],arguments.length),e===!1?delete ke(this,oi,"f").envPrefix:ke(this,oi,"f").envPrefix=e||"",this}epilogue(e){return Qn("",[e],arguments.length),ke(this,yo,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return Qn(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):ke(this,yo,"f").example(e,r),this}exit(e,r){qn(this,cT,!0,"f"),qn(this,Eq,r,"f"),ke(this,gw,"f")&&ke(this,Xi,"f").process.exit(e)}exitProcess(e=!0){return Qn("[boolean]",[e],arguments.length),qn(this,gw,e,"f"),this}fail(e){if(Qn("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new oh("Invalid first argument. Expected function or boolean 'false'");return ke(this,yo,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return Qn(" [function]",[e,r],arguments.length),r?ke(this,tb,"f").getCompletion(e,r):new Promise((n,o)=>{ke(this,tb,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return Qn([],0),ke(this,oi,"f").demandedOptions}getDemandedCommands(){return Qn([],0),ke(this,oi,"f").demandedCommands}getDeprecatedOptions(){return Qn([],0),ke(this,oi,"f").deprecatedOptions}getDetectLocale(){return ke(this,XK,"f")}getExitProcess(){return ke(this,gw,"f")}getGroups(){return Object.assign({},ke(this,UO,"f"),ke(this,rJ,"f"))}getHelp(){if(qn(this,cT,!0,"f"),!ke(this,yo,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[lwe](ke(this,vq,"f"),void 0,void 0,0,!0);if(cd(r))return r.then(()=>ke(this,yo,"f").help())}let e=ke(this,sh,"f").runDefaultBuilderOn(this);if(cd(e))return e.then(()=>ke(this,yo,"f").help())}return Promise.resolve(ke(this,yo,"f").help())}getOptions(){return ke(this,oi,"f")}getStrict(){return ke(this,nJ,"f")}getStrictCommands(){return ke(this,iJ,"f")}getStrictOptions(){return ke(this,oJ,"f")}global(e,r){return Qn(" [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?ke(this,oi,"f").local=ke(this,oi,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{ke(this,oi,"f").local.includes(n)||ke(this,oi,"f").local.push(n)}),this}group(e,r){Qn(" ",[e,r],arguments.length);let n=ke(this,rJ,"f")[r]||ke(this,UO,"f")[r];ke(this,rJ,"f")[r]&&delete ke(this,rJ,"f")[r];let o={};return ke(this,UO,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return Qn("",[e],arguments.length),ke(this,oi,"f").hiddenOptions.push(e),this}implies(e,r){return Qn(" [number|string|array]",[e,r],arguments.length),ke(this,cp,"f").implies(e,r),this}locale(e){return Qn("[string]",[e],arguments.length),e===void 0?(this[AQt](),ke(this,Xi,"f").y18n.getLocale()):(qn(this,XK,!1,"f"),ke(this,Xi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return ke(this,Aw,"f").addMiddleware(e,!!r,n)}nargs(e,r){return Qn(" [number]",[e,r],arguments.length),this[wue](this.nargs.bind(this),"narg",e,r),this}normalize(e){return Qn("",[e],arguments.length),this[Cq]("normalize",e),this}number(e){return Qn("",[e],arguments.length),this[Cq]("number",e),this[cJ](e),this}option(e,r){if(Qn(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[cJ](e),ke(this,QO,"f")&&(e==="version"||r?.alias==="version")&&this[gEn](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(` +`),void 0,"versionWarning"),ke(this,oi,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let o=r.demand||r.required||r.require;o&&this.demand(e,o),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(ke(this,oi,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let s=r.describe||r.description||r.desc,c=ke(this,yo,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(c,e)||typeof s=="string")&&this.describe(e,s),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){Qn("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[AEn](),typeof e>"u"&&(e=ke(this,vq,"f")),typeof r=="object"&&(qn(this,tJ,r,"f"),r=n),typeof r=="function"&&(qn(this,lT,r,"f"),r=!1),r||qn(this,vq,e,"f"),ke(this,lT,"f")&&qn(this,gw,!1,"f");let o=this[lwe](e,!!r),s=this.parsed;return ke(this,tb,"f").setParsed(this.parsed),cd(o)?o.then(c=>(ke(this,lT,"f")&&ke(this,lT,"f").call(this,ke(this,Eq,"f"),c,ke(this,y0,"f")),c)).catch(c=>{throw ke(this,lT,"f")&&ke(this,lT,"f")(c,this.parsed.argv,ke(this,y0,"f")),c}).finally(()=>{this[bQt](),this.parsed=s}):(ke(this,lT,"f")&&ke(this,lT,"f").call(this,ke(this,Eq,"f"),o,ke(this,y0,"f")),this[bQt](),this.parsed=s,o)}parseAsync(e,r,n){let o=this.parse(e,r,n);return cd(o)?o:Promise.resolve(o)}parseSync(e,r,n){let o=this.parse(e,r,n);if(cd(o))throw new oh(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return Qn("",[e],arguments.length),qn(this,rKe,e,"f"),this}pkgConf(e,r){Qn(" [string]",[e,r],arguments.length);let n=null,o=this[yQt](r||ke(this,ZK,"f"));return o[e]&&typeof o[e]=="object"&&(n=KYe(o[e],r||ke(this,ZK,"f"),this[sJ]()["deep-merge-config"]||!1,ke(this,Xi,"f")),ke(this,oi,"f").configObjects=(ke(this,oi,"f").configObjects||[]).concat(n)),this}positional(e,r){Qn(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=yq(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=ke(this,cwe,"f").fullCommands[ke(this,cwe,"f").fullCommands.length-1],s=o?ke(this,sh,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return Tue(s).forEach(c=>{let l=s[c];Array.isArray(l)?l.indexOf(e)!==-1&&(r[c]=!0):l[e]&&!(c in r)&&(r[c]=l[e])}),this.group(e,ke(this,yo,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return Qn("[boolean]",[e],arguments.length),qn(this,nKe,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return Qn(" [number]",[e],arguments.length),typeof e=="string"&&ke(this,oi,"f").narg[e]?this:(this[wue](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return Qn("[string] [string]",[e,r],arguments.length),e=e||this.$0,ke(this,eJ,"f").log(ke(this,tb,"f").generateCompletionScript(e,r||ke(this,aT,"f")||"completion")),this}showHelp(e){if(Qn("[string|function]",[e],arguments.length),qn(this,cT,!0,"f"),!ke(this,yo,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[lwe](ke(this,vq,"f"),void 0,void 0,0,!0);if(cd(n))return n.then(()=>{ke(this,yo,"f").showHelp(e)}),this}let r=ke(this,sh,"f").runDefaultBuilderOn(this);if(cd(r))return r.then(()=>{ke(this,yo,"f").showHelp(e)}),this}return ke(this,yo,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return Qn("[boolean|string] [string]",[e,r],arguments.length),ke(this,yo,"f").showHelpOnFail(e,r),this}showVersion(e){return Qn("[string|function]",[e],arguments.length),ke(this,yo,"f").showVersion(e),this}skipValidation(e){return Qn("",[e],arguments.length),this[Cq]("skipValidation",e),this}strict(e){return Qn("[boolean]",[e],arguments.length),qn(this,nJ,e!==!1,"f"),this}strictCommands(e){return Qn("[boolean]",[e],arguments.length),qn(this,iJ,e!==!1,"f"),this}strictOptions(e){return Qn("[boolean]",[e],arguments.length),qn(this,oJ,e!==!1,"f"),this}string(e){return Qn("",[e],arguments.length),this[Cq]("string",e),this[cJ](e),this}terminalWidth(){return Qn([],0),ke(this,Xi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return Qn("",[e],arguments.length),qn(this,XK,!1,"f"),ke(this,Xi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(Qn(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(ev(e,null,ke(this,Xi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new oh(".usage() description must start with $0 if being used as alias for .command()")}else return ke(this,yo,"f").usage(e),this}usageConfiguration(e){return Qn("",[e],arguments.length),qn(this,iKe,e,"f"),this}version(e,r,n){let o="version";if(Qn("[boolean|string] [string] [string]",[e,r,n],arguments.length),ke(this,QO,"f")&&(this[gQt](ke(this,QO,"f")),ke(this,yo,"f").version(void 0),qn(this,QO,null,"f")),arguments.length===0)n=this[EEn](),e=o;else if(arguments.length===1){if(e===!1)return this;n=e,e=o}else arguments.length===2&&(n=r,r=void 0);return qn(this,QO,typeof e=="string"?e:o,"f"),r=r||ke(this,yo,"f").deferY18nLookup("Show version number"),ke(this,yo,"f").version(n||void 0),this.boolean(ke(this,QO,"f")),this.describe(ke(this,QO,"f"),r),this}wrap(e){return Qn("",[e],arguments.length),ke(this,yo,"f").wrap(e),this}[(sh=new WeakMap,ZK=new WeakMap,cwe=new WeakMap,tb=new WeakMap,aT=new WeakMap,JYe=new WeakMap,Eq=new WeakMap,XK=new WeakMap,ZYe=new WeakMap,gw=new WeakMap,XYe=new WeakMap,Aw=new WeakMap,UO=new WeakMap,cT=new WeakMap,yw=new WeakMap,eKe=new WeakMap,eJ=new WeakMap,y0=new WeakMap,oi=new WeakMap,tKe=new WeakMap,rKe=new WeakMap,lT=new WeakMap,tJ=new WeakMap,xue=new WeakMap,rJ=new WeakMap,vq=new WeakMap,nKe=new WeakMap,Xi=new WeakMap,nJ=new WeakMap,iJ=new WeakMap,oJ=new WeakMap,yo=new WeakMap,iKe=new WeakMap,QO=new WeakMap,cp=new WeakMap,hEn)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[mEn](){return{log:a((...e)=>{this[oKe]()||console.log(...e),qn(this,cT,!0,"f"),ke(this,y0,"f").length&&qn(this,y0,ke(this,y0,"f")+` +`,"f"),qn(this,y0,ke(this,y0,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[oKe]()||console.error(...e),qn(this,cT,!0,"f"),ke(this,y0,"f").length&&qn(this,y0,ke(this,y0,"f")+` +`,"f"),qn(this,y0,ke(this,y0,"f")+e.join(" "),"f")},"error")}}[gQt](e){Tue(ke(this,oi,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=ke(this,oi,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete ke(this,yo,"f").getDescriptions()[e]}[gEn](e,r,n){ke(this,ZYe,"f")[n]||(ke(this,Xi,"f").process.emitWarning(e,r),ke(this,ZYe,"f")[n]=!0)}[AEn](){ke(this,XYe,"f").push({options:ke(this,oi,"f"),configObjects:ke(this,oi,"f").configObjects.slice(0),exitProcess:ke(this,gw,"f"),groups:ke(this,UO,"f"),strict:ke(this,nJ,"f"),strictCommands:ke(this,iJ,"f"),strictOptions:ke(this,oJ,"f"),completionCommand:ke(this,aT,"f"),output:ke(this,y0,"f"),exitError:ke(this,Eq,"f"),hasOutput:ke(this,cT,"f"),parsed:this.parsed,parseFn:ke(this,lT,"f"),parseContext:ke(this,tJ,"f")}),ke(this,yo,"f").freeze(),ke(this,cp,"f").freeze(),ke(this,sh,"f").freeze(),ke(this,Aw,"f").freeze()}[yEn](){let e="",r;return/\b(node|iojs|electron|bun)(\.exe)?$/.test(ke(this,Xi,"f").process.argv()[0])?r=ke(this,Xi,"f").process.argv().slice(1,2):r=ke(this,Xi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[PEn](ke(this,ZK,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});ev(s,void 0,ke(this,Xi,"f")),n=JSON.parse(ke(this,Xi,"f").readFileSync(s,"utf8"))}catch{}return ke(this,xue,"f")[r]=n||{},ke(this,xue,"f")[r]}[Cq](e,r){r=[].concat(r),r.forEach(n=>{n=this[vQt](n),ke(this,oi,"f")[e].push(n)})}[wue](e,r,n,o){this[EQt](e,r,n,o,(s,c,l)=>{ke(this,oi,"f")[s][c]=l})}[_Qt](e,r,n,o){this[EQt](e,r,n,o,(s,c,l)=>{ke(this,oi,"f")[s][c]=(ke(this,oi,"f")[s][c]||[]).concat(l)})}[EQt](e,r,n,o,s){if(Array.isArray(n))n.forEach(c=>{e(c,o)});else if((c=>typeof c=="object")(n))for(let c of Tue(n))e(c,n[c]);else s(r,this[vQt](n),o)}[vQt](e){return e==="__proto__"?"___proto___":e}[CQt](e,r){return this[wue](this[CQt].bind(this),"key",e,r),this}[bQt](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=ke(this,XYe,"f").pop();ev(g,void 0,ke(this,Xi,"f"));let A;e=this,r=this,n=this,o=this,s=this,c=this,l=this,u=this,d=this,f=this,h=this,m=this,{options:{set value(y){qn(e,oi,y,"f")}}.value,configObjects:A,exitProcess:{set value(y){qn(r,gw,y,"f")}}.value,groups:{set value(y){qn(n,UO,y,"f")}}.value,output:{set value(y){qn(o,y0,y,"f")}}.value,exitError:{set value(y){qn(s,Eq,y,"f")}}.value,hasOutput:{set value(y){qn(c,cT,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){qn(l,nJ,y,"f")}}.value,strictCommands:{set value(y){qn(u,iJ,y,"f")}}.value,strictOptions:{set value(y){qn(d,oJ,y,"f")}}.value,completionCommand:{set value(y){qn(f,aT,y,"f")}}.value,parseFn:{set value(y){qn(h,lT,y,"f")}}.value,parseContext:{set value(y){qn(m,tJ,y,"f")}}.value}=g,ke(this,oi,"f").configObjects=A,ke(this,yo,"f").unfreeze(),ke(this,cp,"f").unfreeze(),ke(this,sh,"f").unfreeze(),ke(this,Aw,"f").unfreeze()}[CEn](e,r){return JK(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[bEn].bind(this),getContext:this[SEn].bind(this),getHasOutput:this[TEn].bind(this),getLoggerInstance:this[IEn].bind(this),getParseContext:this[xEn].bind(this),getParserConfiguration:this[sJ].bind(this),getUsageConfiguration:this[_En].bind(this),getUsageInstance:this[wEn].bind(this),getValidationInstance:this[REn].bind(this),hasParseCallback:this[oKe].bind(this),isGlobalContext:this[kEn].bind(this),postProcess:this[aJ].bind(this),reset:this[SQt].bind(this),runValidation:this[TQt].bind(this),runYargsParserAndExecuteCommands:this[lwe].bind(this),setHasOutput:this[DEn].bind(this)}}[bEn](){return ke(this,sh,"f")}[SEn](){return ke(this,cwe,"f")}[TEn](){return ke(this,cT,"f")}[IEn](){return ke(this,eJ,"f")}[xEn](){return ke(this,tJ,"f")||{}}[wEn](){return ke(this,yo,"f")}[REn](){return ke(this,cp,"f")}[oKe](){return!!ke(this,lT,"f")}[kEn](){return ke(this,eKe,"f")}[aJ](e,r,n,o){return n||cd(e)||(r||(e=this[hEn](e)),(this[sJ]()["parse-positional-numbers"]||this[sJ]()["parse-positional-numbers"]===void 0)&&(e=this[vEn](e)),o&&(e=KK(e,this,ke(this,Aw,"f").getMiddleware(),!1))),e}[SQt](e={}){qn(this,oi,ke(this,oi,"f")||{},"f");let r={};r.local=ke(this,oi,"f").local||[],r.configObjects=ke(this,oi,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(e[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(ke(this,rJ,"f"),Object.keys(ke(this,UO,"f")).reduce((c,l)=>{let u=ke(this,UO,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),qn(this,UO,{},"f");let o=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return o.forEach(c=>{r[c]=(ke(this,oi,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=yq(ke(this,oi,"f")[c],l=>!n[l])}),r.envPrefix=ke(this,oi,"f").envPrefix,qn(this,oi,r,"f"),qn(this,yo,ke(this,yo,"f")?ke(this,yo,"f").reset(n):sEn(this,ke(this,Xi,"f")),"f"),qn(this,cp,ke(this,cp,"f")?ke(this,cp,"f").reset(n):fEn(this,ke(this,yo,"f"),ke(this,Xi,"f")),"f"),qn(this,sh,ke(this,sh,"f")?ke(this,sh,"f").reset():nEn(ke(this,yo,"f"),ke(this,cp,"f"),ke(this,Aw,"f"),ke(this,Xi,"f")),"f"),ke(this,tb,"f")||qn(this,tb,lEn(this,ke(this,yo,"f"),ke(this,sh,"f"),ke(this,Xi,"f")),"f"),ke(this,Aw,"f").reset(),qn(this,aT,null,"f"),qn(this,y0,"","f"),qn(this,Eq,null,"f"),qn(this,cT,!1,"f"),this.parsed=!1,this}[PEn](e,r){return ke(this,Xi,"f").path.relative(e,r)}[lwe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||ke(this,vq,"f"),ke(this,oi,"f").__=ke(this,Xi,"f").y18n.__,ke(this,oi,"f").configuration=this[sJ]();let h=!!ke(this,oi,"f").configuration["populate--"],m=Object.assign({},ke(this,oi,"f").configuration,{"populate--":!0}),g=ke(this,Xi,"f").Parser.detailed(e,Object.assign({},ke(this,oi,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,ke(this,tJ,"f")),y,_=g.aliases,E=!1,v=!1;Object.keys(A).forEach(S=>{S===ke(this,yw,"f")&&A[S]?E=!0:S===ke(this,QO,"f")&&A[S]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&ke(this,yo,"f").clearCachedHelpMessage();try{if(this[AQt](),r)return this[aJ](A,h,!!n,!1);ke(this,yw,"f")&&[ke(this,yw,"f")].concat(_[ke(this,yw,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),E=!0),qn(this,eKe,!1,"f");let S=ke(this,sh,"f").getCommands(),T=!((c=ke(this,tb,"f"))===null||c===void 0)&&c.completionKey?[(l=ke(this,tb,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=ke(this,tb,"f"))===null||u===void 0?void 0:u.completionKey])!==null&&d!==void 0?d:[]].some(R=>Object.prototype.hasOwnProperty.call(A,R)):!1,w=E||T||s;if(A._.length){if(S.length){let R;for(let x=o||0,k;A._[x]!==void 0;x++)if(k=String(A._[x]),S.includes(k)&&k!==ke(this,aT,"f")){let D=ke(this,sh,"f").runCommand(k,this,g,x+1,s,E||v||s);return this[aJ](D,h,!!n,!1)}else if(!R&&k!==ke(this,aT,"f")){R=k;break}!ke(this,sh,"f").hasDefaultCommand()&&ke(this,nKe,"f")&&R&&!w&&ke(this,cp,"f").recommendCommands(R,S)}ke(this,aT,"f")&&A._.includes(ke(this,aT,"f"))&&!T&&(ke(this,gw,"f")&&_q(!0),this.showCompletionScript(),this.exit(0))}if(ke(this,sh,"f").hasDefaultCommand()&&!w){let R=ke(this,sh,"f").runCommand(null,this,g,0,s,E||v||s);return this[aJ](R,h,!!n,!1)}if(T){ke(this,gw,"f")&&_q(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${ke(this,tb,"f").completionKey}`)+1);return ke(this,tb,"f").getCompletion(R,(x,k)=>{if(x)throw new oh(x.message);(k||[]).forEach(D=>{ke(this,eJ,"f").log(D)}),this.exit(0)}),this[aJ](A,!h,!!n,!1)}if(ke(this,cT,"f")||(E?(ke(this,gw,"f")&&_q(!0),f=!0,this.showHelp(R=>{ke(this,eJ,"f").log(R),this.exit(0)})):v&&(ke(this,gw,"f")&&_q(!0),f=!0,ke(this,yo,"f").showVersion("log"),this.exit(0))),!f&&ke(this,oi,"f").skipValidation.length>0&&(f=Object.keys(A).some(R=>ke(this,oi,"f").skipValidation.indexOf(R)>=0&&A[R]===!0)),!f){if(g.error)throw new oh(g.error.message);if(!T){let R=this[TQt](_,{},g.error);n||(y=KK(A,this,ke(this,Aw,"f").getMiddleware(),!0)),y=this[CEn](R,y??A),cd(y)&&!n&&(y=y.then(()=>KK(A,this,ke(this,Aw,"f").getMiddleware(),!1)))}}}catch(S){if(S instanceof oh)ke(this,yo,"f").fail(S.message,S);else throw S}return this[aJ](y??A,h,!!n,!0)}[TQt](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new oh(n.message);ke(this,cp,"f").nonOptionCount(c),ke(this,cp,"f").requiredArguments(c,s);let l=!1;ke(this,iJ,"f")&&(l=ke(this,cp,"f").unknownCommands(c)),ke(this,nJ,"f")&&!l?ke(this,cp,"f").unknownArguments(c,e,r,!!o):ke(this,oJ,"f")&&ke(this,cp,"f").unknownArguments(c,e,{},!1,!1),ke(this,cp,"f").limitedChoices(c),ke(this,cp,"f").implications(c),ke(this,cp,"f").conflicting(c)}}[DEn](){qn(this,cT,!0,"f")}[cJ](e){if(typeof e=="string")ke(this,oi,"f").key[e]=!0;else for(let r of e)ke(this,oi,"f").key[r]=!0}};function iEn(t){return!!t&&typeof t.getInternalMethods=="function"}a(iEn,"isYargsInstance");var OHo=NEn(Z_n),MEn=OHo;p();p();var BEn=require("node:child_process"),FEn=require("node:util");var LHo=(0,FEn.promisify)(BEn.execFile),bq="1.0.60",OEn="COPILOT_CLI_PATH",BHo="GITHUB_COPILOT_ACP_USE_CLI",Rue="@github/copilot",FHo=3e4,UHo=1e4,LEn=6e4,kue=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function UEn(){return process.env[BHo]!=="0"}a(UEn,"isCLIIntegrationEnabled");var xQt=process.platform==="win32";async function QEn(){if(process.env[OEn]){let l=process.env[OEn],u=await uwe(l,["--version"]);if(u)return qHo(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new kue("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await uwe("copilot",["--version"]);if(t&&dwe(t,bq))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await uwe(e,["--offline",Rue,"--version"],!1,UHo);if(r&&dwe(r,bq))return{path:e,args:[Rue],version:r,source:"npx"};let n=`${Rue}@${bq}`,o=await uwe(e,[n,"--version"],!1,LEn);if(o&&dwe(o,bq))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${Rue}@latest`,c=await uwe(e,[s,"--version"],!0,LEn);if(c){if(dwe(c,bq))return{path:e,args:[s],version:c,source:"npx-latest"};throw new kue(`Latest published Copilot CLI version ${c} is below the minimum required ${bq}.`)}throw new kue(`Copilot CLI version could not be determined. 'npx ${s} --version' ran successfully but its output contained no recognisable version. +Try running 'npx ${s} --version' manually to inspect the output, or install/update globally with: npm install -g ${Rue}`)}a(QEn,"discoverCLI");function QHo(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(QHo,"parseVersion");async function uwe(t,e,r=!1,n=FHo){try{let{stdout:o}=await LHo(t,e,{timeout:n,shell:xQt});return QHo(o)}catch(o){if(r)throw o;return null}}a(uwe,"tryGetVersion");function qHo(t,e){if(!dwe(t,bq))throw new kue(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${bq}. Update with: npm install -g ${Rue}@latest`)}a(qHo,"validateVersion");function dwe(t,e){let r=a(c=>c.replace(/^v/,"").split(".").map(l=>{let u=parseInt(l,10);return isNaN(u)?0:u}),"parse"),n=r(t),o=r(e),s=Math.max(n.length,o.length);for(let c=0;cu)return!0;if(lr.type==="file").map(r=>r.uri).filter(Boolean),...this.request.activeEditor?.uri?[this.request.activeEditor.uri]:[]];return Array.from(new Set(e))}getMetadata(e){return this._metadata.get(e)?.at(-1)}getAllMetadata(e){return this._metadata.get(e)}setMetadata(e){let r=e.constructor,n=this._metadata.get(r)??[];n.push(e),this._metadata.set(r,n)}hasMetadata(e){let r=this._metadata.get(e);return r!==void 0&&r.length>0}isSubagent(){return this.parentTurnId!==void 0&&this.parentTurnId!==""}},lJ=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=Dt();this._timestamp=Date.now();this.uriSchemeCache=new sKe;this.currentPartitionId=1;this.id=o??this.telemetryId}static{a(this,"Conversation")}copy(){let e=JSON.parse(JSON.stringify(this.turns)),r=new t(e,this.source,this.userLanguage,this.id);return r._telemetryId=this.telemetryId,r._timestamp=this.timestamp,r.currentPartitionId=this.currentPartitionId,r}get telemetryId(){return this._telemetryId}get timestamp(){return this._timestamp}addTurn(e){this.turns.push(e)}deleteTurn(e){this.turns=this.turns.filter(r=>r.id!==e)}getLastTurn(){return this.turns[this.turns.length-1]}findTurn(e){return this.turns.find(r=>r.id===e)}};p();p();var _w=class{constructor(){this.promiseMap=new Map}static{a(this,"SequencerByKey")}queue(e,r){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}async drain(){let e=Array.from(this.promiseMap.values());await Promise.all(e.map(r=>r.catch(()=>{})))}};p();var qO=(o=>(o.Local="LOCAL",o.Background="BACKGROUND",o.Claude="CLAUDE",o.Codex="CODEX",o))(qO||{}),jHo=Object.values(qO);function c2(t){let e=new Set;for(let r of t??[]){let n=r.providers;if(Array.isArray(n))for(let o of n)e.add(o)}return e.size===0?["LOCAL","BACKGROUND"]:jHo.filter(r=>e.has(r))}a(c2,"unionProviders");function uT(t,e){return t?["BACKGROUND"]:e?.length?[...e]:["LOCAL","BACKGROUND"]}a(uT,"providersForListRow");p();p();p();var uJ=fe(require("child_process")),RQt=fe(require("path")),nvn=fe(rvn());function ivn(t){return t.replace(/^git version /,"")}a(ivn,"parseVersion");function kQt(t){return new Promise((e,r)=>{let n=[],o=uJ.spawn(t,["--version"]);o.stdout.on("data",s=>n.push(s)),o.on("error",r),o.on("close",s=>s?r(new Error(`Not found. Code: ${s}`)):e({path:t,version:ivn(Buffer.concat(n).toString("utf8").trim())}))})}a(kQt,"findSpecificGit");function tGo(){return new Promise((t,e)=>{uJ.exec("which git",(r,n)=>{if(r)return e(new Error(`Executing "which git" failed: ${r.message}`));let o=n.toString().trim();function s(c){uJ.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:ivn(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);uJ.exec("xcode-select -p",c=>{if(c&&c.code===2)return e(new Error('Executing "xcode-select -p" failed with error code 2.'));s(o)})})})}a(tGo,"findGitDarwin");function aKe(t){return t?kQt(RQt.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(aKe,"findSystemGitWin32");async function rGo(){let t=await(0,nvn.default)("git.exe");return kQt(t)}a(rGo,"findGitWin32InPath");function nGo(){return aKe(process.env.ProgramW6432).then(void 0,()=>aKe(process.env["ProgramFiles(x86)"])).then(void 0,()=>aKe(process.env.ProgramFiles)).then(void 0,()=>aKe(RQt.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>rGo())}a(nGo,"findGitWin32");async function jO(){try{switch(process.platform){case"darwin":return await tGo();case"win32":return await nGo();default:return await kQt("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(jO,"findGit");var ovn=require("node:child_process"),svn=require("node:util");var iGo=(0,svn.promisify)(ovn.execFile);async function avn(t){return PQt(t,["github.com"])}a(avn,"resolveGitHubNwo");async function PQt(t,e){let r;try{r=(await jO()).path}catch{return}let n;try{n=(await iGo(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return oGo(n,e)}a(PQt,"resolveGitHubNwoForHosts");function oGo(t,e){let r=new Set(["github.com",...e.map(h=>h.toLowerCase())]),n=t.trim().match(/^(?:(?:https?|ssh|git):\/\/(?:[^@]+@)?|git@)([^/:]+)(?::\d+)?[:/](.+?)(?:\.git)?$/);if(!n)return;let[,o,s]=n;if(!r.has(o.toLowerCase()))return;let c=s.indexOf("/");if(c<=0)return;let l=s.slice(0,c),u=s.slice(c+1),d=u.indexOf("/"),f=d>=0?u.slice(0,d):u;if(!(!l||!f))return{owner:l,repo:f}}a(oGo,"parseGitRemoteUrl");async function cvn(t,e,r=fetch){let n=`https://api.github.com/repos/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.repo)}`,o;try{o=await r(n,{headers:{Authorization:`token ${e}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}})}catch{return}if(!o.ok)return;let s=await o.json();if(!(typeof s.id!="number"||typeof s.owner?.id!="number"))return{ownerId:s.owner.id,repoId:s.id}}a(cvn,"resolveRepoIds");p();var sGo=3e4,cKe=class{constructor(e,r=sGo){this.ctx=e;this.timeoutMs=r;this.logger=new pe("OrgCustomAgentClient")}static{a(this,"OrgCustomAgentClient")}async listCustomAgents(e,r){let n=this.ctx,o=await this.tryGetAccessToken();if(!o)return;let s=i3(n).api,c=`${lvn(s)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}?include_sources=org,enterprise`;try{let l=await n.get(Jt).fetch(c,{method:"GET",headers:{Authorization:`Bearer ${o}`,Accept:"application/json",...om(n)},timeout:this.timeoutMs});if(!l.ok){this.logger.warn(n,`[OrgCustomAgentClient] list ${e}/${r} -> ${l.status}`);return}let u=await l.json();return Array.isArray(u?.agents)?u.agents:[]}catch(l){this.logger.warn(n,`[OrgCustomAgentClient] list ${e}/${r} failed: ${String(l)}`);return}}async getCustomAgentDetails(e,r,n,o){let s=this.ctx,c=await this.tryGetAccessToken();if(!c)return;let l=i3(s).api,u=new URL(`${lvn(l)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}`);u.searchParams.set("version",o);try{let d=await s.get(Jt).fetch(u.toString(),{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json",...om(s)},timeout:this.timeoutMs});if(!d.ok){this.logger.warn(s,`[OrgCustomAgentClient] detail ${e}/${r}/${n}?version=${o} -> ${d.status}`);return}return await d.json()}catch(d){this.logger.warn(s,`[OrgCustomAgentClient] detail ${e}/${r}/${n}?version=${o} failed: ${String(d)}`);return}}async tryGetAccessToken(){try{return(await this.ctx.get(Or).resolveSession())?.accessToken}catch(e){this.logger.debug(this.ctx,`[OrgCustomAgentClient] no GitHub session: ${String(e)}`);return}}};function lvn(t){return t.endsWith("/")?t.slice(0,-1):t}a(lvn,"trimTrailingSlash");p();p();function aGo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}a(aGo,"getDefaultExportFromCjs");var C_={},lKe={},Tq={},uvn;function fwe(){if(uvn)return Tq;uvn=1;function t(c){return typeof c>"u"||c===null}a(t,"isNothing");function e(c){return typeof c=="object"&&c!==null}a(e,"isObject");function r(c){return Array.isArray(c)?c:t(c)?[]:[c]}a(r,"toArray");function n(c,l){if(l){let u=Object.keys(l);for(let d=0,f=u.length;dh&&(d=" ... ",s=l-h+d.length),c-l>h&&(f=" ...",c=l+h-f.length),{str:d+o.slice(s,c).replace(/\t/g,"\u2192")+f,pos:l-s+d.length}}a(e,"getLine");function r(o,s){return t.repeat(" ",s-o.length)+o}a(r,"padStart");function n(o,s){if(s=Object.create(s||null),!o.buffer)return null;s.maxLength||(s.maxLength=79),typeof s.indent!="number"&&(s.indent=1),typeof s.linesBefore!="number"&&(s.linesBefore=3),typeof s.linesAfter!="number"&&(s.linesAfter=2);let c=/\r?\n|\r|\0/g,l=[0],u=[],d,f=-1;for(;d=c.exec(o.buffer);)u.push(d.index),l.push(d.index+d[0].length),o.position<=d.index&&f<0&&(f=l.length-2);f<0&&(f=l.length-1);let h="",m=Math.min(o.line+s.linesAfter,u.length).toString().length,g=s.maxLength-(s.indent+m+3);for(let y=1;y<=s.linesBefore&&!(f-y<0);y++){let _=e(o.buffer,l[f-y],u[f-y],o.position-(l[f]-l[f-y]),g);h=t.repeat(" ",s.indent)+r((o.line-y+1).toString(),m)+" | "+_.str+` +`+r.mark.snippet),s+" "+o):s}a(t,"formatError");function e(r,n){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=n,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return a(e,"YAMLException2"),e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.toString=a(function(n){return this.name+": "+t(this,n)},"toString"),DQt=e,DQt}a(pwe,"requireException");var NQt,fvn;function cGo(){if(fvn)return NQt;fvn=1;let t=fwe();function e(o,s,c,l,u){let d="",f="",h=Math.floor(u/2)-1;return l-s>h&&(d=" ... ",s=l-h+d.length),c-l>h&&(f=" ...",c=l+h-f.length),{str:d+o.slice(s,c).replace(/\t/g,"\u2192")+f,pos:l-s+d.length}}a(e,"getLine");function r(o,s){return t.repeat(" ",s-o.length)+o}a(r,"padStart");function n(o,s){if(s=Object.create(s||null),!o.buffer)return null;s.maxLength||(s.maxLength=79),typeof s.indent!="number"&&(s.indent=1),typeof s.linesBefore!="number"&&(s.linesBefore=3),typeof s.linesAfter!="number"&&(s.linesAfter=2);let c=/\r?\n|\r|\0/g,l=[0],u=[],d,f=-1;for(;d=c.exec(o.buffer);)u.push(d.index),l.push(d.index+d[0].length),o.position<=d.index&&f<0&&(f=l.length-2);f<0&&(f=l.length-1);let h="",m=Math.min(o.line+s.linesAfter,u.length).toString().length,g=s.maxLength-(s.indent+m+3);for(let y=1;y<=s.linesBefore&&!(f-y<0);y++){let _=e(o.buffer,l[f-y],u[f-y],o.position-(l[f]-l[f-y]),g);h=t.repeat(" ",s.indent)+r((o.line-y+1).toString(),m)+" | "+_.str+` `+h}let A=e(o.buffer,l[f],u[f],o.position,g);h+=t.repeat(" ",s.indent)+r((o.line+1).toString(),m)+" | "+A.str+` `,h+=t.repeat("-",s.indent+m+3+A.pos)+`^ `;for(let y=1;y<=s.linesAfter&&!(f+y>=u.length);y++){let _=e(o.buffer,l[f+y],u[f+y],o.position-(l[f]-l[f+y]),g);h+=t.repeat(" ",s.indent)+r((o.line+y+1).toString(),m)+" | "+_.str+` -`}return h.replace(/\n$/,"")}return a(n,"makeSnippet"),DQt=n,DQt}a(sGo,"requireSnippet");var NQt,fvn;function rv(){if(fvn)return NQt;fvn=1;let t=pwe(),e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function n(s){let c={};return s!==null&&Object.keys(s).forEach(function(l){s[l].forEach(function(u){c[String(u)]=l})}),c}a(n,"compileStyleAliases");function o(s,c){if(c=c||{},Object.keys(c).forEach(function(l){if(e.indexOf(l)===-1)throw new t('Unknown option "'+l+'" is met in definition of "'+s+'" YAML type.')}),this.options=c,this.tag=s,this.kind=c.kind||null,this.resolve=c.resolve||function(){return!0},this.construct=c.construct||function(l){return l},this.instanceOf=c.instanceOf||null,this.predicate=c.predicate||null,this.represent=c.represent||null,this.representName=c.representName||null,this.defaultStyle=c.defaultStyle||null,this.multi=c.multi||!1,this.styleAliases=n(c.styleAliases||null),r.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+s+'" YAML type.')}return a(o,"Type2"),NQt=o,NQt}a(rv,"requireType");var MQt,pvn;function Mvn(){if(pvn)return MQt;pvn=1;let t=pwe(),e=rv();function r(s,c){let l=[];return s[c].forEach(function(u){let d=l.length;l.forEach(function(f,h){f.tag===u.tag&&f.kind===u.kind&&f.multi===u.multi&&(d=h)}),l[d]=u}),l}a(r,"compileList");function n(){let s={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function c(l){l.multi?(s.multi[l.kind].push(l),s.multi.fallback.push(l)):s[l.kind][l.tag]=s.fallback[l.tag]=l}a(c,"collectType");for(let l=0,u=arguments.length;l=48&&d<=57||d>=65&&d<=70||d>=97&&d<=102}a(r,"isHexCode");function n(d){return d>=48&&d<=55}a(n,"isOctCode");function o(d){return d>=48&&d<=57}a(o,"isDecCode");function s(d){if(d===null)return!1;let f=d.length,h=0,m=!1;if(!f)return!1;let g=d[h];if((g==="-"||g==="+")&&(g=d[++h]),g==="0"){if(h+1===f)return!0;if(g=d[++h],g==="b"){for(h++;h=0?"0b"+d.toString(2):"-0b"+d.toString(2).slice(1)},"binary"),octal:a(function(d){return d>=0?"0o"+d.toString(8):"-0o"+d.toString(8).slice(1)},"octal"),decimal:a(function(d){return d.toString(10)},"decimal"),hexadecimal:a(function(d){return d>=0?"0x"+d.toString(16).toUpperCase():"-0x"+d.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),qQt}a(qvn,"requireInt");var jQt,vvn;function jvn(){if(vvn)return jQt;vvn=1;let t=fwe(),e=rv(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),n=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function o(d){return d===null||!r.test(d)?!1:isFinite(parseFloat(d,10))?!0:n.test(d)}a(o,"resolveYamlFloat");function s(d){let f=d.toLowerCase(),h=f[0]==="-"?-1:1;return"+-".indexOf(f[0])>=0&&(f=f.slice(1)),f===".inf"?h===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:f===".nan"?NaN:h*parseFloat(f,10)}a(s,"constructYamlFloat");let c=/^[-+]?[0-9]+e/;function l(d,f){if(isNaN(d))switch(f){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===d)switch(f){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===d)switch(f){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(d))return"-0.0";let h=d.toString(10);return c.test(h)?h.replace("e",".e"):h}a(l,"representYamlFloat");function u(d){return Object.prototype.toString.call(d)==="[object Number]"&&(d%1!==0||t.isNegativeZero(d))}return a(u,"isFloat"),jQt=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:o,construct:s,predicate:u,represent:l,defaultStyle:"lowercase"}),jQt}a(jvn,"requireFloat");var HQt,Cvn;function Hvn(){return Cvn||(Cvn=1,HQt=Fvn().extend({implicit:[Uvn(),Qvn(),qvn(),jvn()]})),HQt}a(Hvn,"requireJson");var GQt,bvn;function Gvn(){return bvn||(bvn=1,GQt=Hvn()),GQt}a(Gvn,"requireCore");var $Qt,Svn;function $vn(){if(Svn)return $Qt;Svn=1;let t=rv(),e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function n(c){return c===null?!1:e.exec(c)!==null||r.exec(c)!==null}a(n,"resolveYamlTimestamp");function o(c){let l=0,u=null,d=e.exec(c);if(d===null&&(d=r.exec(c)),d===null)throw new Error("Date resolve error");let f=+d[1],h=+d[2]-1,m=+d[3];if(!d[4])return new Date(Date.UTC(f,h,m));let g=+d[4],A=+d[5],y=+d[6];if(d[7]){for(l=d[7].slice(0,3);l.length<3;)l+="0";l=+l}if(d[9]){let E=+d[10],v=+(d[11]||0);u=(E*60+v)*6e4,d[9]==="-"&&(u=-u)}let _=new Date(Date.UTC(f,h,m,g,A,y,l));return u&&_.setTime(_.getTime()-u),_}a(o,"constructYamlTimestamp");function s(c){return c.toISOString()}return a(s,"representYamlTimestamp"),$Qt=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:o,instanceOf:Date,represent:s}),$Qt}a($vn,"requireTimestamp");var VQt,Tvn;function Vvn(){if(Tvn)return VQt;Tvn=1;let t=rv();function e(r){return r==="<<"||r===null}return a(e,"resolveYamlMerge"),VQt=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:e}),VQt}a(Vvn,"requireMerge");var WQt,Ivn;function Wvn(){if(Ivn)return WQt;Ivn=1;let t=rv(),e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function r(c){if(c===null)return!1;let l=0,u=c.length,d=e;for(let f=0;f64)){if(h<0)return!1;l+=6}}return l%8===0}a(r,"resolveYamlBinary");function n(c){let l=c.replace(/[\r\n=]/g,""),u=l.length,d=e,f=0,h=[];for(let g=0;g>16&255),h.push(f>>8&255),h.push(f&255)),f=f<<6|d.indexOf(l.charAt(g));let m=u%4*6;return m===0?(h.push(f>>16&255),h.push(f>>8&255),h.push(f&255)):m===18?(h.push(f>>10&255),h.push(f>>2&255)):m===12&&h.push(f>>4&255),new Uint8Array(h)}a(n,"constructYamlBinary");function o(c){let l="",u=0,d=c.length,f=e;for(let m=0;m>18&63],l+=f[u>>12&63],l+=f[u>>6&63],l+=f[u&63]),u=(u<<8)+c[m];let h=d%3;return h===0?(l+=f[u>>18&63],l+=f[u>>12&63],l+=f[u>>6&63],l+=f[u&63]):h===2?(l+=f[u>>10&63],l+=f[u>>4&63],l+=f[u<<2&63],l+=f[64]):h===1&&(l+=f[u>>2&63],l+=f[u<<4&63],l+=f[64],l+=f[64]),l}a(o,"representYamlBinary");function s(c){return Object.prototype.toString.call(c)==="[object Uint8Array]"}return a(s,"isBinary"),WQt=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:n,predicate:s,represent:o}),WQt}a(Wvn,"requireBinary");var zQt,xvn;function zvn(){if(xvn)return zQt;xvn=1;let t=rv(),e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function n(s){if(s===null)return!0;let c=[],l=s;for(let u=0,d=l.length;u=48&&F<=57)return F-48;let se=F|32;return se>=97&&se<=102?se-97+10:-1}a(R,"fromHexCode");function x(F){return F===120?2:F===117?4:F===85?8:0}a(x,"escapedHexLen");function k(F){return F>=48&&F<=57?F-48:-1}a(k,"fromDecimalCode");function D(F){switch(F){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return` +`}return h.replace(/\n$/,"")}return a(n,"makeSnippet"),NQt=n,NQt}a(cGo,"requireSnippet");var MQt,pvn;function rv(){if(pvn)return MQt;pvn=1;let t=pwe(),e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function n(s){let c={};return s!==null&&Object.keys(s).forEach(function(l){s[l].forEach(function(u){c[String(u)]=l})}),c}a(n,"compileStyleAliases");function o(s,c){if(c=c||{},Object.keys(c).forEach(function(l){if(e.indexOf(l)===-1)throw new t('Unknown option "'+l+'" is met in definition of "'+s+'" YAML type.')}),this.options=c,this.tag=s,this.kind=c.kind||null,this.resolve=c.resolve||function(){return!0},this.construct=c.construct||function(l){return l},this.instanceOf=c.instanceOf||null,this.predicate=c.predicate||null,this.represent=c.represent||null,this.representName=c.representName||null,this.defaultStyle=c.defaultStyle||null,this.multi=c.multi||!1,this.styleAliases=n(c.styleAliases||null),r.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+s+'" YAML type.')}return a(o,"Type2"),MQt=o,MQt}a(rv,"requireType");var OQt,hvn;function Ovn(){if(hvn)return OQt;hvn=1;let t=pwe(),e=rv();function r(s,c){let l=[];return s[c].forEach(function(u){let d=l.length;l.forEach(function(f,h){f.tag===u.tag&&f.kind===u.kind&&f.multi===u.multi&&(d=h)}),l[d]=u}),l}a(r,"compileList");function n(){let s={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function c(l){l.multi?(s.multi[l.kind].push(l),s.multi.fallback.push(l)):s[l.kind][l.tag]=s.fallback[l.tag]=l}a(c,"collectType");for(let l=0,u=arguments.length;l=48&&d<=57||d>=65&&d<=70||d>=97&&d<=102}a(r,"isHexCode");function n(d){return d>=48&&d<=55}a(n,"isOctCode");function o(d){return d>=48&&d<=57}a(o,"isDecCode");function s(d){if(d===null)return!1;let f=d.length,h=0,m=!1;if(!f)return!1;let g=d[h];if((g==="-"||g==="+")&&(g=d[++h]),g==="0"){if(h+1===f)return!0;if(g=d[++h],g==="b"){for(h++;h=0?"0b"+d.toString(2):"-0b"+d.toString(2).slice(1)},"binary"),octal:a(function(d){return d>=0?"0o"+d.toString(8):"-0o"+d.toString(8).slice(1)},"octal"),decimal:a(function(d){return d.toString(10)},"decimal"),hexadecimal:a(function(d){return d>=0?"0x"+d.toString(16).toUpperCase():"-0x"+d.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),jQt}a(jvn,"requireInt");var HQt,Cvn;function Hvn(){if(Cvn)return HQt;Cvn=1;let t=fwe(),e=rv(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),n=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function o(d){return d===null||!r.test(d)?!1:isFinite(parseFloat(d,10))?!0:n.test(d)}a(o,"resolveYamlFloat");function s(d){let f=d.toLowerCase(),h=f[0]==="-"?-1:1;return"+-".indexOf(f[0])>=0&&(f=f.slice(1)),f===".inf"?h===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:f===".nan"?NaN:h*parseFloat(f,10)}a(s,"constructYamlFloat");let c=/^[-+]?[0-9]+e/;function l(d,f){if(isNaN(d))switch(f){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===d)switch(f){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===d)switch(f){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(d))return"-0.0";let h=d.toString(10);return c.test(h)?h.replace("e",".e"):h}a(l,"representYamlFloat");function u(d){return Object.prototype.toString.call(d)==="[object Number]"&&(d%1!==0||t.isNegativeZero(d))}return a(u,"isFloat"),HQt=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:o,construct:s,predicate:u,represent:l,defaultStyle:"lowercase"}),HQt}a(Hvn,"requireFloat");var GQt,bvn;function Gvn(){return bvn||(bvn=1,GQt=Uvn().extend({implicit:[Qvn(),qvn(),jvn(),Hvn()]})),GQt}a(Gvn,"requireJson");var $Qt,Svn;function $vn(){return Svn||(Svn=1,$Qt=Gvn()),$Qt}a($vn,"requireCore");var VQt,Tvn;function Vvn(){if(Tvn)return VQt;Tvn=1;let t=rv(),e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function n(c){return c===null?!1:e.exec(c)!==null||r.exec(c)!==null}a(n,"resolveYamlTimestamp");function o(c){let l=0,u=null,d=e.exec(c);if(d===null&&(d=r.exec(c)),d===null)throw new Error("Date resolve error");let f=+d[1],h=+d[2]-1,m=+d[3];if(!d[4])return new Date(Date.UTC(f,h,m));let g=+d[4],A=+d[5],y=+d[6];if(d[7]){for(l=d[7].slice(0,3);l.length<3;)l+="0";l=+l}if(d[9]){let E=+d[10],v=+(d[11]||0);u=(E*60+v)*6e4,d[9]==="-"&&(u=-u)}let _=new Date(Date.UTC(f,h,m,g,A,y,l));return u&&_.setTime(_.getTime()-u),_}a(o,"constructYamlTimestamp");function s(c){return c.toISOString()}return a(s,"representYamlTimestamp"),VQt=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:o,instanceOf:Date,represent:s}),VQt}a(Vvn,"requireTimestamp");var WQt,Ivn;function Wvn(){if(Ivn)return WQt;Ivn=1;let t=rv();function e(r){return r==="<<"||r===null}return a(e,"resolveYamlMerge"),WQt=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:e}),WQt}a(Wvn,"requireMerge");var zQt,xvn;function zvn(){if(xvn)return zQt;xvn=1;let t=rv(),e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function r(c){if(c===null)return!1;let l=0,u=c.length,d=e;for(let f=0;f64)){if(h<0)return!1;l+=6}}return l%8===0}a(r,"resolveYamlBinary");function n(c){let l=c.replace(/[\r\n=]/g,""),u=l.length,d=e,f=0,h=[];for(let g=0;g>16&255),h.push(f>>8&255),h.push(f&255)),f=f<<6|d.indexOf(l.charAt(g));let m=u%4*6;return m===0?(h.push(f>>16&255),h.push(f>>8&255),h.push(f&255)):m===18?(h.push(f>>10&255),h.push(f>>2&255)):m===12&&h.push(f>>4&255),new Uint8Array(h)}a(n,"constructYamlBinary");function o(c){let l="",u=0,d=c.length,f=e;for(let m=0;m>18&63],l+=f[u>>12&63],l+=f[u>>6&63],l+=f[u&63]),u=(u<<8)+c[m];let h=d%3;return h===0?(l+=f[u>>18&63],l+=f[u>>12&63],l+=f[u>>6&63],l+=f[u&63]):h===2?(l+=f[u>>10&63],l+=f[u>>4&63],l+=f[u<<2&63],l+=f[64]):h===1&&(l+=f[u>>2&63],l+=f[u<<4&63],l+=f[64],l+=f[64]),l}a(o,"representYamlBinary");function s(c){return Object.prototype.toString.call(c)==="[object Uint8Array]"}return a(s,"isBinary"),zQt=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:n,predicate:s,represent:o}),zQt}a(zvn,"requireBinary");var YQt,wvn;function Yvn(){if(wvn)return YQt;wvn=1;let t=rv(),e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function n(s){if(s===null)return!0;let c=[],l=s;for(let u=0,d=l.length;u=48&&F<=57)return F-48;let se=F|32;return se>=97&&se<=102?se-97+10:-1}a(R,"fromHexCode");function x(F){return F===120?2:F===117?4:F===85?8:0}a(x,"escapedHexLen");function k(F){return F>=48&&F<=57?F-48:-1}a(k,"fromDecimalCode");function D(F){switch(F){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return` `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}a(D,"simpleEscapeSequence");function N(F){return F<=65535?String.fromCharCode(F):String.fromCharCode((F-65536>>10)+55296,(F-65536&1023)+56320)}a(N,"charFromCodepoint");function O(F,se,be){se==="__proto__"?Object.defineProperty(F,se,{configurable:!0,enumerable:!0,writable:!0,value:be}):F[se]=be}a(O,"setProperty");let B=new Array(256),q=new Array(256);for(let F=0;F<256;F++)B[F]=D(F)?1:0,q[F]=D(F);function M(F,se){this.input=F,this.filename=se.filename||null,this.schema=se.schema||n,this.onWarning=se.onWarning||null,this.legacy=se.legacy||!1,this.json=se.json||!1,this.listener=se.listener||null,this.maxDepth=typeof se.maxDepth=="number"?se.maxDepth:100,this.maxTotalMergeKeys=typeof se.maxTotalMergeKeys=="number"?se.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=F.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}a(M,"State");function L(F,se){let be={name:F.filename,buffer:F.input.slice(0,-1),position:F.position,line:F.line,column:F.position-F.lineStart};return be.snippet=r(be),new e(se,be)}a(L,"generateError");function U(F,se){throw L(F,se)}a(U,"throwError");function j(F,se){F.onWarning&&F.onWarning.call(null,L(F,se))}a(j,"throwWarning");function Q(F,se,be){let Ue=F.anchorMapTransactions;if(Ue.length!==0){let Qe=Ue[Ue.length-1];o.call(Qe,se)||(Qe[se]={existed:o.call(F.anchorMap,se),value:F.anchorMap[se]})}F.anchorMap[se]=be}a(Q,"storeAnchor");function Y(F){F.anchorMapTransactions.push(Object.create(null))}a(Y,"beginAnchorTransaction");function W(F){let se=F.anchorMapTransactions.pop(),be=F.anchorMapTransactions;if(be.length===0)return;let Ue=be[be.length-1],Qe=Object.keys(se);for(let ge=0,Z=Qe.length;ge=0;Ue-=1){let Qe=se[be[Ue]];Qe.existed?F.anchorMap[be[Ue]]=Qe.value:delete F.anchorMap[be[Ue]]}}a(V,"rollbackAnchorTransaction");function z(F){return{position:F.position,line:F.line,lineStart:F.lineStart,lineIndent:F.lineIndent,firstTabInLine:F.firstTabInLine,tag:F.tag,anchor:F.anchor,kind:F.kind,result:F.result}}a(z,"snapshotState");function ie(F,se){F.position=se.position,F.line=se.line,F.lineStart=se.lineStart,F.lineIndent=se.lineIndent,F.firstTabInLine=se.firstTabInLine,F.tag=se.tag,F.anchor=se.anchor,F.kind=se.kind,F.result=se.result}a(ie,"restoreState");let H={YAML:a(function(se,be,Ue){se.version!==null&&U(se,"duplication of %YAML directive"),Ue.length!==1&&U(se,"YAML directive accepts exactly one argument");let Qe=/^([0-9]+)\.([0-9]+)$/.exec(Ue[0]);Qe===null&&U(se,"ill-formed argument of the YAML directive");let ge=parseInt(Qe[1],10),Z=parseInt(Qe[2],10);ge!==1&&U(se,"unacceptable YAML version of the document"),se.version=Ue[0],se.checkLineBreaks=Z<2,Z!==1&&Z!==2&&j(se,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(se,be,Ue){let Qe;Ue.length!==2&&U(se,"TAG directive accepts exactly two arguments");let ge=Ue[0];Qe=Ue[1],y.test(ge)||U(se,"ill-formed tag handle (first argument) of the TAG directive"),o.call(se.tagMap,ge)&&U(se,'there is a previously declared suffix for "'+ge+'" tag handle'),_.test(Qe)||U(se,"ill-formed tag prefix (second argument) of the TAG directive");try{Qe=decodeURIComponent(Qe)}catch{U(se,"tag prefix is malformed: "+Qe)}se.tagMap[ge]=Qe},"handleTagDirective")};function re(F,se,be,Ue){if(se=32&&ve<=1114111||U(F,"expected valid JSON character")}else m.test(Qe)&&U(F,"the stream contains non-printable characters");F.result+=Qe}}a(re,"captureSegment");function le(F,se,be,Ue){t.isObject(be)||U(F,"cannot merge mappings; the provided source object is unacceptable");let Qe=Object.keys(be);for(let ge=0,Z=Qe.length;geF.maxTotalMergeKeys&&U(F,"merge keys exceeded maxTotalMergeKeys ("+F.maxTotalMergeKeys+")"),o.call(se,ve)||(O(se,ve,be[ve]),Ue[ve]=!0)}}a(le,"mergeMappings");function Le(F,se,be,Ue,Qe,ge,Z,ve,Ge){if(Array.isArray(Qe)){Qe=Array.prototype.slice.call(Qe);for(let qe=0,je=Qe.length;qe1&&(F.result+=t.repeat(` `,se-1))}a(te,"writeFoldedLines");function ee(F,se,be){let Ue,Qe,ge,Z,ve,Ge,qe=F.kind,je=F.result,J=F.input.charCodeAt(F.position);if(T(J)||w(J)||J===35||J===38||J===42||J===33||J===124||J===62||J===39||J===34||J===37||J===64||J===96)return!1;if(J===63||J===45){let ae=F.input.charCodeAt(F.position+1);if(T(ae)||be&&w(ae))return!1}for(F.kind="scalar",F.result="",Ue=Qe=F.position,ge=!1;J!==0;){if(J===58){let ae=F.input.charCodeAt(F.position+1);if(T(ae)||be&&w(ae))break}else if(J===35){let ae=F.input.charCodeAt(F.position-1);if(T(ae))break}else{if(F.position===F.lineStart&&Te(F)||be&&w(J))break;if(v(J))if(Z=F.line,ve=F.lineStart,Ge=F.lineIndent,Oe(F,!1,-1),F.lineIndent>=se){ge=!0,J=F.input.charCodeAt(F.position);continue}else{F.position=Qe,F.line=Z,F.lineStart=ve,F.lineIndent=Ge;break}}ge&&(re(F,Ue,Qe,!1),te(F,F.line-Z),Ue=Qe=F.position,ge=!1),S(J)||(Qe=F.position+1),J=F.input.charCodeAt(++F.position)}return re(F,Ue,Qe,!1),F.result?!0:(F.kind=qe,F.result=je,!1)}a(ee,"readPlainScalar");function K(F,se){let be,Ue,Qe=F.input.charCodeAt(F.position);if(Qe!==39)return!1;for(F.kind="scalar",F.result="",F.position++,be=Ue=F.position;(Qe=F.input.charCodeAt(F.position))!==0;)if(Qe===39)if(re(F,be,F.position,!0),Qe=F.input.charCodeAt(++F.position),Qe===39)be=F.position,F.position++,Ue=F.position;else return!0;else v(Qe)?(re(F,be,Ue,!0),te(F,Oe(F,!1,se)),be=Ue=F.position):F.position===F.lineStart&&Te(F)?U(F,"unexpected end of the document within a single quoted scalar"):(F.position++,S(Qe)||(Ue=F.position));U(F,"unexpected end of the stream within a single quoted scalar")}a(K,"readSingleQuotedScalar");function he(F,se){let be,Ue,Qe,ge=F.input.charCodeAt(F.position);if(ge!==34)return!1;for(F.kind="scalar",F.result="",F.position++,be=Ue=F.position;(ge=F.input.charCodeAt(F.position))!==0;){if(ge===34)return re(F,be,F.position,!0),F.position++,!0;if(ge===92){if(re(F,be,F.position,!0),ge=F.input.charCodeAt(++F.position),v(ge))Oe(F,!1,se);else if(ge<256&&B[ge])F.result+=q[ge],F.position++;else if((Qe=x(ge))>0){let Z=Qe,ve=0;for(;Z>0;Z--)ge=F.input.charCodeAt(++F.position),(Qe=R(ge))>=0?ve=(ve<<4)+Qe:U(F,"expected hexadecimal character");F.result+=N(ve),F.position++}else U(F,"unknown escape sequence");be=Ue=F.position}else v(ge)?(re(F,be,Ue,!0),te(F,Oe(F,!1,se)),be=Ue=F.position):F.position===F.lineStart&&Te(F)?U(F,"unexpected end of the document within a double quoted scalar"):(F.position++,S(ge)||(Ue=F.position))}U(F,"unexpected end of the stream within a double quoted scalar")}a(he,"readDoubleQuotedScalar");function X(F,se){let be=!0,Ue,Qe,ge,Z=F.tag,ve,Ge=F.anchor,qe,je,J,ae,Ce=Object.create(null),Re,$e,Ye,ut=F.input.charCodeAt(F.position);if(ut===91)qe=93,ae=!1,ve=[];else if(ut===123)qe=125,ae=!0,ve={};else return!1;for(F.anchor!==null&&Q(F,F.anchor,ve),ut=F.input.charCodeAt(++F.position);ut!==0;){if(Oe(F,!0,se),ut=F.input.charCodeAt(F.position),ut===qe)return F.position++,F.tag=Z,F.anchor=Ge,F.kind=ae?"mapping":"sequence",F.result=ve,!0;if(be?ut===44&&U(F,"expected the node content, but found ','"):U(F,"missed comma between flow collection entries"),$e=Re=Ye=null,je=J=!1,ut===63){let yt=F.input.charCodeAt(F.position+1);T(yt)&&(je=J=!0,F.position++,Oe(F,!0,se))}Ue=F.line,Qe=F.lineStart,ge=F.position,tt(F,se,s,!1,!0),$e=F.tag,Re=F.result,Oe(F,!0,se),ut=F.input.charCodeAt(F.position),(J||F.line===Ue)&&ut===58&&(je=!0,ut=F.input.charCodeAt(++F.position),Oe(F,!0,se),tt(F,se,s,!1,!0),Ye=F.result),ae?Le(F,ve,Ce,$e,Re,Ye,Ue,Qe,ge):je?ve.push(Le(F,null,Ce,$e,Re,Ye,Ue,Qe,ge)):ve.push(Re),Oe(F,!0,se),ut=F.input.charCodeAt(F.position),ut===44?(be=!0,ut=F.input.charCodeAt(++F.position)):be=!1}U(F,"unexpected end of the stream within a flow collection")}a(X,"readFlowCollection");function de(F,se){let be,Ue=d,Qe=!1,ge=!1,Z=se,ve=0,Ge=!1,qe,je=F.input.charCodeAt(F.position);if(je===124)be=!1;else if(je===62)be=!0;else return!1;for(F.kind="scalar",F.result="";je!==0;)if(je=F.input.charCodeAt(++F.position),je===43||je===45)d===Ue?Ue=je===43?h:f:U(F,"repeat of a chomping mode identifier");else if((qe=k(je))>=0)qe===0?U(F,"bad explicit indentation width of a block scalar; it cannot be less than one"):ge?U(F,"repeat of an indentation width identifier"):(Z=se+qe-1,ge=!0);else break;if(S(je)){do je=F.input.charCodeAt(++F.position);while(S(je));if(je===35)do je=F.input.charCodeAt(++F.position);while(!v(je)&&je!==0)}for(;je!==0;){for(me(F),F.lineIndent=0,je=F.input.charCodeAt(F.position);(!ge||F.lineIndentZ&&(Z=F.lineIndent),v(je)){ve++;continue}if(!ge&&Z===0&&U(F,"missing indentation for block scalar"),F.lineIndentse)&&Z!==0)U(F,"bad indentation of a sequence entry");else if(F.lineIndentse)&&(Re&&(Qe=F.line,ge=F.lineStart,Z=F.position),tt(F,se,u,!0,Ue)&&(Re?ae=F.result:Ce=F.result),Re||(Le(F,qe,je,J,ae,Ce,Qe,ge,Z),J=ae=Ce=null),Oe(F,!0,-1),Ye=F.input.charCodeAt(F.position)),(F.line===yt||F.lineIndent>se)&&Ye!==0)U(F,"bad indentation of a mapping entry");else if(F.lineIndent=F.maxDepth&&U(F,"nesting exceeded maxDepth ("+F.maxDepth+")"),F.depth+=1,F.listener!==null&&F.listener("open",F),F.tag=null,F.anchor=null,F.kind=null,F.result=null;let Re=ge=Z=u===be||l===be;if(Ue&&Oe(F,!0,-1)&&(Ge=!0,F.lineIndent>se?ve=1:F.lineIndent===se?ve=0:F.lineIndentse?ve=1:F.lineIndent===se?ve=0:F.lineIndent tag; it should be "scalar", not "'+F.kind+'"');for(let $e=0,Ye=F.implicitTypes.length;$e"),F.result!==null&&J.kind!==F.kind&&U(F,"unacceptable node kind for !<"+F.tag+'> tag; it should be "'+J.kind+'", not "'+F.kind+'"'),J.resolve(F.result,F.tag)?(F.result=J.construct(F.result,F.tag),F.anchor!==null&&Q(F,F.anchor,F.result)):U(F,"cannot resolve a node with !<"+F.tag+"> explicit tag")}return F.listener!==null&&F.listener("close",F),F.depth-=1,F.tag!==null||F.anchor!==null||qe}a(tt,"composeNode");function st(F){let se=F.position,be=!1,Ue;for(F.version=null,F.checkLineBreaks=F.legacy,F.tagMap=Object.create(null),F.anchorMap=Object.create(null);(Ue=F.input.charCodeAt(F.position))!==0&&(Oe(F,!0,-1),Ue=F.input.charCodeAt(F.position),!(F.lineIndent>0||Ue!==37));){be=!0,Ue=F.input.charCodeAt(++F.position);let Qe=F.position;for(;Ue!==0&&!T(Ue);)Ue=F.input.charCodeAt(++F.position);let ge=F.input.slice(Qe,F.position),Z=[];for(ge.length<1&&U(F,"directive name must not be less than one character in length");Ue!==0;){for(;S(Ue);)Ue=F.input.charCodeAt(++F.position);if(Ue===35){do Ue=F.input.charCodeAt(++F.position);while(Ue!==0&&!v(Ue));break}if(v(Ue))break;for(Qe=F.position;Ue!==0&&!T(Ue);)Ue=F.input.charCodeAt(++F.position);Z.push(F.input.slice(Qe,F.position))}Ue!==0&&me(F),o.call(H,ge)?H[ge](F,ge,Z):j(F,'unknown document directive "'+ge+'"')}if(Oe(F,!0,-1),F.lineIndent===0&&F.input.charCodeAt(F.position)===45&&F.input.charCodeAt(F.position+1)===45&&F.input.charCodeAt(F.position+2)===45?(F.position+=3,Oe(F,!0,-1)):be&&U(F,"directives end mark is expected"),tt(F,F.lineIndent-1,u,!1,!0),Oe(F,!0,-1),F.checkLineBreaks&&g.test(F.input.slice(se,F.position))&&j(F,"non-ASCII line breaks are interpreted as content"),F.documents.push(F.result),F.position===F.lineStart&&Te(F)){F.input.charCodeAt(F.position)===46&&(F.position+=3,Oe(F,!0,-1));return}F.position"u"&&(be=se,se=null);let Ue=vt(F,be);if(typeof se!="function")return Ue;for(let Qe=0,ge=Ue.length;Qe"u"&&(be=se,se=null);let Ue=vt(F,be);if(typeof se!="function")return Ue;for(let Qe=0,ge=Ue.length;Qe=32&&Z<=126||Z>=161&&Z<=55295&&Z!==8232&&Z!==8233||Z>=57344&&Z<=65533&&Z!==s||Z>=65536&&Z<=1114111}a(le,"isPrintable");function Le(Z){return le(Z)&&Z!==s&&Z!==u&&Z!==l}a(Le,"isNsCharOrWhitespace");function me(Z,ve,Ge){let qe=Le(Z),je=qe&&!re(Z);return(Ge?qe:qe&&Z!==E&&Z!==k&&Z!==D&&Z!==O&&Z!==q)&&Z!==m&&!(ve===S&&!je)||Le(ve)&&!re(ve)&&Z===m||ve===S&&je}a(me,"isPlainSafe");function Oe(Z){return le(Z)&&Z!==s&&!re(Z)&&Z!==v&&Z!==R&&Z!==S&&Z!==E&&Z!==k&&Z!==D&&Z!==O&&Z!==q&&Z!==m&&Z!==A&&Z!==_&&Z!==f&&Z!==B&&Z!==T&&Z!==w&&Z!==y&&Z!==h&&Z!==g&&Z!==x&&Z!==N}a(Oe,"isPlainSafeFirst");function Te(Z){return!re(Z)&&Z!==S}a(Te,"isPlainSafeLast");function te(Z,ve){let Ge=Z.charCodeAt(ve),qe;return Ge>=55296&&Ge<=56319&&ve+1=56320&&qe<=57343)?(Ge-55296)*1024+qe-56320+65536:Ge}a(te,"codePointAt");function ee(Z){return/^\n* /.test(Z)}a(ee,"needIndentIndicator");let K=1,he=2,X=3,de=4,Be=5;function ne(Z,ve,Ge,qe,je,J,ae,Ce){let Re,$e=0,Ye=null,ut=!1,yt=!1,$t=qe!==-1,Tt=-1,We=Oe(te(Z,0))&&Te(te(Z,Z.length-1));if(ve||ae)for(Re=0;Re=65536?Re+=2:Re++){if($e=te(Z,Re),!le($e))return Be;We=We&&me($e,Ye,Ce),Ye=$e}else{for(Re=0;Re=65536?Re+=2:Re++){if($e=te(Z,Re),$e===l)ut=!0,$t&&(yt=yt||Re-Tt-1>qe&&Z[Tt+1]!==" ",Tt=Re);else if(!le($e))return Be;We=We&&me($e,Ye,Ce),Ye=$e}yt=yt||$t&&Re-Tt-1>qe&&Z[Tt+1]!==" "}return!ut&&!yt?We&&!ae&&!je(Z)?K:J===W?Be:he:Ge>9&&ee(Z)?Be:ae?J===W?Be:he:yt?de:X}a(ne,"chooseScalarStyle");function ue(Z,ve,Ge,qe,je){Z.dump=(function(){if(ve.length===0)return Z.quotingType===W?'""':"''";if(!Z.noCompatMode&&(L.indexOf(ve)!==-1||U.test(ve)))return Z.quotingType===W?'"'+ve+'"':"'"+ve+"'";let J=Z.indent*Math.max(1,Ge),ae=Z.lineWidth===-1?-1:Math.max(Math.min(Z.lineWidth,40),Z.lineWidth-J),Ce=qe||Z.flowLevel>-1&&Ge>=Z.flowLevel;function Re($e){return H(Z,$e)}switch(a(Re,"testAmbiguity"),ne(ve,Ce,Z.indent,ae,Re,Z.quotingType,Z.forceQuotes&&!qe,je)){case K:return ve;case he:return"'"+ve.replace(/'/g,"''")+"'";case X:return"|"+Ne(ve,Z.indent)+xe(z(ve,J));case de:return">"+Ne(ve,Z.indent)+xe(z(Fe(ve,ae),J));case Be:return'"'+st(ve)+'"';default:throw new e("impossible error: invalid scalar style")}})()}a(ue,"writeScalar");function Ne(Z,ve){let Ge=ee(Z)?String(ve):"",qe=Z[Z.length-1]===` @@ -2380,13 +2380,13 @@ Try running 'npx ${s} --version' manually to inspect the output, or install/upda `+Z.slice(je,J),je=J+1),ae=Ce;return Re+=` `,Z.length-je>ve&&ae>je?Re+=Z.slice(je,ae)+` `+Z.slice(ae+1):Re+=Z.slice(je),Re.slice(1)}a(tt,"foldLine");function st(Z){let ve="",Ge=0;for(let qe=0;qe=65536?qe+=2:qe++){Ge=te(Z,qe);let je=M[Ge];!je&&le(Ge)?(ve+=Z[qe],Ge>=65536&&(ve+=Z[qe+1])):ve+=je||Q(Ge)}return ve}a(st,"escapeString");function vt(Z,ve,Ge){let qe="",je=Z.tag;for(let J=0,ae=Ge.length;J"u"&&be(Z,ve,null,!1,!1))&&(qe!==""&&(qe+=","+(Z.condenseFlow?"":" ")),qe+=Z.dump)}Z.tag=je,Z.dump="["+qe+"]"}a(vt,"writeFlowSequence");function Pt(Z,ve,Ge,qe){let je="",J=Z.tag;for(let ae=0,Ce=Ge.length;ae"u"&&be(Z,ve+1,null,!0,!0,!1,!0))&&((!qe||je!=="")&&(je+=ie(Z,ve)),Z.dump&&l===Z.dump.charCodeAt(0)?je+="-":je+="- ",je+=Z.dump)}Z.tag=J,Z.dump=je||"[]"}a(Pt,"writeBlockSequence");function Ht(Z,ve,Ge){let qe="",je=Z.tag,J=Object.keys(Ge);for(let ae=0,Ce=J.length;ae1024&&(Re+="? "),Re+=Z.dump+(Z.condenseFlow?'"':"")+":"+(Z.condenseFlow?"":" "),be(Z,ve,Ye,!1,!1)&&(Re+=Z.dump,qe+=Re))}Z.tag=je,Z.dump="{"+qe+"}"}a(Ht,"writeFlowMapping");function F(Z,ve,Ge,qe){let je="",J=Z.tag,ae=Object.keys(Ge);if(Z.sortKeys===!0)ae.sort();else if(typeof Z.sortKeys=="function")ae.sort(Z.sortKeys);else if(Z.sortKeys)throw new e("sortKeys must be a boolean or a function");for(let Ce=0,Re=ae.length;Ce1024;yt&&(Z.dump&&l===Z.dump.charCodeAt(0)?$e+="?":$e+="? "),$e+=Z.dump,yt&&($e+=ie(Z,ve)),be(Z,ve+1,ut,!0,yt)&&(Z.dump&&l===Z.dump.charCodeAt(0)?$e+=":":$e+=": ",$e+=Z.dump,je+=$e)}Z.tag=J,Z.dump=je||"{}"}a(F,"writeBlockMapping");function se(Z,ve,Ge){let qe=Ge?Z.explicitTypes:Z.implicitTypes;for(let je=0,J=qe.length;je tag resolver accepts not "'+Ce+'" style');Z.dump=Re}return!0}}return!1}a(se,"detectType");function be(Z,ve,Ge,qe,je,J,ae){Z.tag=null,Z.dump=Ge,se(Z,Ge,!1)||se(Z,Ge,!0);let Ce=n.call(Z.dump),Re=qe;qe&&(qe=Z.flowLevel<0||Z.flowLevel>ve);let $e=Ce==="[object Object]"||Ce==="[object Array]",Ye,ut;if($e&&(Ye=Z.duplicates.indexOf(Ge),ut=Ye!==-1),(Z.tag!==null&&Z.tag!=="?"||ut||Z.indent!==2&&ve>0)&&(je=!1),ut&&Z.usedDuplicates[Ye])Z.dump="*ref_"+Ye;else{if($e&&ut&&!Z.usedDuplicates[Ye]&&(Z.usedDuplicates[Ye]=!0),Ce==="[object Object]")qe&&Object.keys(Z.dump).length!==0?(F(Z,ve,Z.dump,je),ut&&(Z.dump="&ref_"+Ye+Z.dump)):(Ht(Z,ve,Z.dump),ut&&(Z.dump="&ref_"+Ye+" "+Z.dump));else if(Ce==="[object Array]")qe&&Z.dump.length!==0?(Z.noArrayIndent&&!ae&&ve>0?Pt(Z,ve-1,Z.dump,je):Pt(Z,ve,Z.dump,je),ut&&(Z.dump="&ref_"+Ye+Z.dump)):(vt(Z,ve,Z.dump),ut&&(Z.dump="&ref_"+Ye+" "+Z.dump));else if(Ce==="[object String]")Z.tag!=="?"&&ue(Z,Z.dump,ve,J,Re);else{if(Ce==="[object Undefined]")return!1;if(Z.skipInvalid)return!1;throw new e("unacceptable kind of an object to dump "+Ce)}if(Z.tag!==null&&Z.tag!=="?"){let yt=encodeURI(Z.tag[0]==="!"?Z.tag.slice(1):Z.tag).replace(/!/g,"%21");Z.tag[0]==="!"?yt="!"+yt:yt.slice(0,18)==="tag:yaml.org,2002:"?yt="!!"+yt.slice(18):yt="!<"+yt+">",Z.dump=yt+" "+Z.dump}}return!0}a(be,"writeNode");function Ue(Z,ve){let Ge=[],qe=[];Qe(Z,Ge,qe);let je=qe.length;for(let J=0;J0&&!t.tools.includes("*")&&(e.tools=t.tools),t.argument_hint&&(e["argument-hint"]=t.argument_hint),t.target&&(e.target=t.target),t.model&&(e.model=t.model);let r=[];t.user_invocable!==!1&&r.push("user"),t.disable_model_invocation!==!0&&r.push("model"),r.length<2&&(e["x-github-copilot-invoke-policy"]=r);let n=uJ(e,{sortKeys:!1,lineWidth:-1,noRefs:!0,noCompatMode:!0,quotingType:'"',forceQuotes:!1}).trim(),o=t.prompt??"";return`--- +`:""}return a(ge,"dump2"),XQt.dump=ge,XQt}a(uGo,"requireDumper");var Mvn;function dGo(){if(Mvn)return C_;Mvn=1;let t=lGo(),e=uGo();function r(n,o){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+o+" instead, which is now safe by default.")}}return a(r,"renamed"),C_.Type=rv(),C_.Schema=Ovn(),C_.FAILSAFE_SCHEMA=Uvn(),C_.JSON_SCHEMA=Gvn(),C_.CORE_SCHEMA=$vn(),C_.DEFAULT_SCHEMA=eqt(),C_.load=t.load,C_.loadAll=t.loadAll,C_.dump=e.dump,C_.YAMLException=pwe(),C_.types={binary:zvn(),float:Hvn(),map:Fvn(),null:Qvn(),pairs:Kvn(),set:Jvn(),timestamp:Vvn(),bool:qvn(),int:jvn(),merge:Wvn(),omap:Yvn(),seq:Bvn(),str:Lvn()},C_.safeLoad=r("safeLoad","load"),C_.safeLoadAll=r("safeLoadAll","loadAll"),C_.safeDump=r("safeDump","dump"),C_}a(dGo,"requireJsYaml");var fGo=dGo(),pGo=aGo(fGo),{Type:OVu,Schema:LVu,FAILSAFE_SCHEMA:BVu,JSON_SCHEMA:FVu,CORE_SCHEMA:UVu,DEFAULT_SCHEMA:QVu,load:qVu,loadAll:jVu,dump:dJ,YAMLException:HVu,types:GVu,safeLoad:$Vu,safeLoadAll:VVu,safeDump:WVu}=pGo;function Xvn(t){let e={};t.display_name&&(e.name=t.display_name),t.description&&(e.description=t.description),t.tools&&t.tools.length>0&&!t.tools.includes("*")&&(e.tools=t.tools),t.argument_hint&&(e["argument-hint"]=t.argument_hint),t.target&&(e.target=t.target),t.model&&(e.model=t.model);let r=[];t.user_invocable!==!1&&r.push("user"),t.disable_model_invocation!==!0&&r.push("model"),r.length<2&&(e["x-github-copilot-invoke-policy"]=r);let n=dJ(e,{sortKeys:!1,lineWidth:-1,noRefs:!0,noCompatMode:!0,quotingType:'"',forceQuotes:!1}).trim(),o=t.prompt??"";return`--- ${n} --- ${o} -`}a(Zvn,"generateAgentMarkdown");p();p();p();p();p();p();var hwe={isBlocked:!1,reason:"VALID_FILE"},uKe={isBlocked:!1,reason:"NO_MATCHING_POLICY"},Xvn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},dJ={all:"all",repo:"repo"},Iq=new pe("contentExclusion");p();p();var dKe=class{static{a(this,"PolicyEvaluator")}};p();p();p();var eqt=new pe("repository"),fJ=class t{constructor(){this.data={}}static{a(this,"GitConfigData")}getKeys(){return Object.keys(this.data)}getEntries(){return Object.entries(this.data)}get(e){let r=this.getAll(e);return r?r[r.length-1]:void 0}getAll(e){return this.data[this.normalizeKey(e)]}add(e,r){e in this.data||(this.data[e]=[]),this.data[e].push(r)}getSectionValues(e,r){let n=`${e}.`.toLowerCase(),o=`.${r}`.toLowerCase();return Object.keys(this.data).filter(s=>s.startsWith(n)&&s.endsWith(o)).map(s=>s.slice(n.length,-o.length))}concat(e){return this.getEntries().concat(e.getEntries()).reduce((r,[n,o])=>(o.forEach(s=>r.add(n,s)),r),new t)}normalizeKey(e){let r=e.split(".");return r[0]=r[0].toLowerCase(),r[r.length-1]=r[r.length-1].toLowerCase(),r.join(".")}},l2=class{static{a(this,"GitConfigLoader")}},fKe=class extends l2{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackConfigLoader")}async getConfig(r,n){for(let o of this.loaders){let s=await o.getConfig(r,n);if(s)return s}}};p();var eCn=require("os");var pKe=class{constructor(e){this.url=e;this.isUrl()?this.parseUrl():this.tryParseSSHString()||(this._scheme="file")}static{a(this,"GitRemoteUrl")}get scheme(){return this._scheme}get authority(){return this._authority}get hostname(){return this._hostname}get path(){return this._path}isInvalid(){return this._error!==void 0}isRemote(){return this.scheme!=="file"&&this.hostname!==void 0}isGitHub(){return this.isRemote()&&/(?:^|\.)(?:github\.com|ghe\.com)$/i.test(this.hostname??"")}isADO(){return this.isRemote()&&/(?:^|\.)(?:visualstudio\.com|azure\.com)$/i.test(this.hostname??"")}getUrlForApi(){if(!this.isRemote())return null;if(this.isUrl()&&!this.isInvalid())return E7.from({scheme:this.scheme,authority:this.authority.replace(/^[^@]+@/,""),path:this.path}).toString();if(this.scheme=="ssh"&&this.isADO()){let e=this.url.indexOf(":");return this.url.substring(0,e+1)+this.path}return this.url}isUrl(){return/[A-Za-z0-9][A-Za-z0-9]+:\/\//.test(this.url)}parseUrl(){let e;try{e=E7.parse(this.url)}catch(r){this._error=r;return}this._scheme=e.scheme,this.setAuthority(e.authority),this.setPath(e.path)}setAuthority(e){this._authority=e;let r=e.replace(/^[^@]+@/,"").replace(/:\d*$/,"");r&&(this._hostname=r)}tryParseSSHString(){let e=/^(?[^:/\\[]*(?:\[[^/\\\]]*\])?):/.exec(this.url);if(e&&((0,eCn.platform)()!=="win32"||(e.groups?.host?.length??0)>1)){let r=e.groups?.host??"";return this._scheme="ssh",this.setAuthority(r),this.setPath(this.url.substring(r.length+1)),!0}return!1}setPath(e){if(this.isADO())try{this._path=decodeURIComponent(e);return}catch{}this._path=e}};var hKe=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(l2).getConfig(e,r);if(!n)return;let o=this.getRemotes(n),s=o.filter(c=>c.url.isGitHub());if(s.length)return s.find(c=>c.name==="origin")?.url??s[0].url;if(o.length)return o.find(c=>c.name==="origin")?.url??o[0].url}getRemotes(e){let r=this.getInsteadOfRules(e);return e.getSectionValues("remote","url").map(n=>({name:n,url:new pKe(this.applyInsteadOfRules(r,e.get(`remote.${n}.url`)??""))})).filter(n=>n.url.isRemote())}applyInsteadOfRules(e,r){for(let n of e)if(r.startsWith(n.insteadOf))return n.base+r.slice(n.insteadOf.length);return r}getInsteadOfRules(e){return e.getSectionValues("url","insteadof").map(r=>({base:r,insteadOf:e.get(`url.${r}.insteadof`)})).sort((r,n)=>n.base.length-r.base.length)}};var fGo=100,tqt=class{constructor(e,r){this.baseFolder=e;this.remote=r;this.setNWO()}static{a(this,"GitRepository")}get tenant(){return this._tenant}get owner(){return this._owner}get name(){return this._name}get adoOrganization(){return this._adoOrganization}isGitHub(){return this.remote?.isGitHub()??!1}isADO(){return this.remote?.isADO()??!1}setNWO(){let e=this.remote?.path?.replace(/^\//,"").split("/");if(this.isGitHub()){this._owner=e?.[0],this._name=e?.[1]?.replace(/\.git$/,"");let r=/^(?[^.]+)\.ghe\.com$/.exec(this.remote?.hostname??"");r&&(this._tenant=r.groups?.tenant)}else if(this.isADO()&&e?.length===4){if(this.remote?.scheme==="ssh"){this._adoOrganization=e?.[1],this._owner=e?.[2],this._name=e?.[3];return}let r=/(?:(?[^.]+)\.)?visualstudio\.com$/.exec(this.remote?.hostname??"");r?(this._adoOrganization=r.groups?.org,this._owner=e?.[1],this._name=e?.[3]):(this._adoOrganization=e?.[0],this._owner=e?.[1],this._name=e?.[3])}}},Pf=class t{constructor(e){this.ctx=e;this.remoteResolver=new hKe;this.cache=new Sn(fGo)}static{a(this,"RepositoryManager")}async getRepo({uri:e}){let r,n=[];do{if(this.cache.has(e.toString())){let s=this.cache.get(e);return this.updateCache(n,s),s}n.push(e.toString());let o=await this.tryGetRepoForFolder(e);if(o)return this.updateCache(n,o),o;r=e,e=Cf(e)}while(e!==r);this.updateCache(n,void 0)}updateCache(e,r){e.forEach(n=>this.cache.set(n,r))}async tryGetRepoForFolder(e){return await this.isBaseRepoFolder(e)?new tqt(typeof e=="string"?{uri:e}:e,await this.repoUrl(e)):void 0}async isBaseRepoFolder(e){return await t.getRepoConfigLocation(this.ctx,e)!==void 0}async repoUrl(e){return await this.remoteResolver.resolveRemote(this.ctx,e)}static async getRepoConfigLocation(e,r){try{let n=e.get(Go),o=Oa(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=Oa(o,"config");return await n.stat(c),c}catch{return}}static async getConfigLocationForGitfile(e,r,n){let s=(await e.readFileString(n)).match(/^gitdir:\s+(.+)$/m);if(!s)return;let c=qz(r,s[1]),l=Oa(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=Oa(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=Oa(c,"commondir");c=qz(c,(await e.readFileString(d)).trimEnd());let f=Oa(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var pJ=a((t,e)=>{if(DO.Check(t,e))return e;let r=`Typebox schema validation failed: +`}a(Xvn,"generateAgentMarkdown");p();p();p();p();p();p();var hwe={isBlocked:!1,reason:"VALID_FILE"},uKe={isBlocked:!1,reason:"NO_MATCHING_POLICY"},eCn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},fJ={all:"all",repo:"repo"},Iq=new pe("contentExclusion");p();p();var dKe=class{static{a(this,"PolicyEvaluator")}};p();p();p();var tqt=new pe("repository"),pJ=class t{constructor(){this.data={}}static{a(this,"GitConfigData")}getKeys(){return Object.keys(this.data)}getEntries(){return Object.entries(this.data)}get(e){let r=this.getAll(e);return r?r[r.length-1]:void 0}getAll(e){return this.data[this.normalizeKey(e)]}add(e,r){e in this.data||(this.data[e]=[]),this.data[e].push(r)}getSectionValues(e,r){let n=`${e}.`.toLowerCase(),o=`.${r}`.toLowerCase();return Object.keys(this.data).filter(s=>s.startsWith(n)&&s.endsWith(o)).map(s=>s.slice(n.length,-o.length))}concat(e){return this.getEntries().concat(e.getEntries()).reduce((r,[n,o])=>(o.forEach(s=>r.add(n,s)),r),new t)}normalizeKey(e){let r=e.split(".");return r[0]=r[0].toLowerCase(),r[r.length-1]=r[r.length-1].toLowerCase(),r.join(".")}},l2=class{static{a(this,"GitConfigLoader")}},fKe=class extends l2{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackConfigLoader")}async getConfig(r,n){for(let o of this.loaders){let s=await o.getConfig(r,n);if(s)return s}}};p();var tCn=require("os");var pKe=class{constructor(e){this.url=e;this.isUrl()?this.parseUrl():this.tryParseSSHString()||(this._scheme="file")}static{a(this,"GitRemoteUrl")}get scheme(){return this._scheme}get authority(){return this._authority}get hostname(){return this._hostname}get path(){return this._path}isInvalid(){return this._error!==void 0}isRemote(){return this.scheme!=="file"&&this.hostname!==void 0}isGitHub(){return this.isRemote()&&/(?:^|\.)(?:github\.com|ghe\.com)$/i.test(this.hostname??"")}isADO(){return this.isRemote()&&/(?:^|\.)(?:visualstudio\.com|azure\.com)$/i.test(this.hostname??"")}getUrlForApi(){if(!this.isRemote())return null;if(this.isUrl()&&!this.isInvalid())return E7.from({scheme:this.scheme,authority:this.authority.replace(/^[^@]+@/,""),path:this.path}).toString();if(this.scheme=="ssh"&&this.isADO()){let e=this.url.indexOf(":");return this.url.substring(0,e+1)+this.path}return this.url}isUrl(){return/[A-Za-z0-9][A-Za-z0-9]+:\/\//.test(this.url)}parseUrl(){let e;try{e=E7.parse(this.url)}catch(r){this._error=r;return}this._scheme=e.scheme,this.setAuthority(e.authority),this.setPath(e.path)}setAuthority(e){this._authority=e;let r=e.replace(/^[^@]+@/,"").replace(/:\d*$/,"");r&&(this._hostname=r)}tryParseSSHString(){let e=/^(?[^:/\\[]*(?:\[[^/\\\]]*\])?):/.exec(this.url);if(e&&((0,tCn.platform)()!=="win32"||(e.groups?.host?.length??0)>1)){let r=e.groups?.host??"";return this._scheme="ssh",this.setAuthority(r),this.setPath(this.url.substring(r.length+1)),!0}return!1}setPath(e){if(this.isADO())try{this._path=decodeURIComponent(e);return}catch{}this._path=e}};var hKe=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(l2).getConfig(e,r);if(!n)return;let o=this.getRemotes(n),s=o.filter(c=>c.url.isGitHub());if(s.length)return s.find(c=>c.name==="origin")?.url??s[0].url;if(o.length)return o.find(c=>c.name==="origin")?.url??o[0].url}getRemotes(e){let r=this.getInsteadOfRules(e);return e.getSectionValues("remote","url").map(n=>({name:n,url:new pKe(this.applyInsteadOfRules(r,e.get(`remote.${n}.url`)??""))})).filter(n=>n.url.isRemote())}applyInsteadOfRules(e,r){for(let n of e)if(r.startsWith(n.insteadOf))return n.base+r.slice(n.insteadOf.length);return r}getInsteadOfRules(e){return e.getSectionValues("url","insteadof").map(r=>({base:r,insteadOf:e.get(`url.${r}.insteadof`)})).sort((r,n)=>n.base.length-r.base.length)}};var hGo=100,rqt=class{constructor(e,r){this.baseFolder=e;this.remote=r;this.setNWO()}static{a(this,"GitRepository")}get tenant(){return this._tenant}get owner(){return this._owner}get name(){return this._name}get adoOrganization(){return this._adoOrganization}isGitHub(){return this.remote?.isGitHub()??!1}isADO(){return this.remote?.isADO()??!1}setNWO(){let e=this.remote?.path?.replace(/^\//,"").split("/");if(this.isGitHub()){this._owner=e?.[0],this._name=e?.[1]?.replace(/\.git$/,"");let r=/^(?[^.]+)\.ghe\.com$/.exec(this.remote?.hostname??"");r&&(this._tenant=r.groups?.tenant)}else if(this.isADO()&&e?.length===4){if(this.remote?.scheme==="ssh"){this._adoOrganization=e?.[1],this._owner=e?.[2],this._name=e?.[3];return}let r=/(?:(?[^.]+)\.)?visualstudio\.com$/.exec(this.remote?.hostname??"");r?(this._adoOrganization=r.groups?.org,this._owner=e?.[1],this._name=e?.[3]):(this._adoOrganization=e?.[0],this._owner=e?.[1],this._name=e?.[3])}}},Pf=class t{constructor(e){this.ctx=e;this.remoteResolver=new hKe;this.cache=new Sn(hGo)}static{a(this,"RepositoryManager")}async getRepo({uri:e}){let r,n=[];do{if(this.cache.has(e.toString())){let s=this.cache.get(e);return this.updateCache(n,s),s}n.push(e.toString());let o=await this.tryGetRepoForFolder(e);if(o)return this.updateCache(n,o),o;r=e,e=Cf(e)}while(e!==r);this.updateCache(n,void 0)}updateCache(e,r){e.forEach(n=>this.cache.set(n,r))}async tryGetRepoForFolder(e){return await this.isBaseRepoFolder(e)?new rqt(typeof e=="string"?{uri:e}:e,await this.repoUrl(e)):void 0}async isBaseRepoFolder(e){return await t.getRepoConfigLocation(this.ctx,e)!==void 0}async repoUrl(e){return await this.remoteResolver.resolveRemote(this.ctx,e)}static async getRepoConfigLocation(e,r){try{let n=e.get(Go),o=Oa(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=Oa(o,"config");return await n.stat(c),c}catch{return}}static async getConfigLocationForGitfile(e,r,n){let s=(await e.readFileString(n)).match(/^gitdir:\s+(.+)$/m);if(!s)return;let c=jz(r,s[1]),l=Oa(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=Oa(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=Oa(c,"commondir");c=jz(c,(await e.readFileString(d)).trimEnd());let f=Oa(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var hJ=a((t,e)=>{if(DO.Check(t,e))return e;let r=`Typebox schema validation failed: ${[...DO.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");p();p();p();var mKe=new WeakMap;function gKe(t,e){if(t==null||typeof t!="object")return String(t);let r,n="",o=0,s=Object.prototype.toString.call(t);if(s!=="[object RegExp]"&&s!=="[object Date]"&&mKe.has(t))return mKe.get(t);switch(mKe.set(t,"~"+ ++e),s){case"[object Set]":r=Array.from(t);case"[object Array]":for(r||(r=t),n+="a";oe.delete(n))),o}a(pGo,"n");function nCn(t,e){return function(r,n){return pGo(t,e,r,n)}}a(nCn,"o");p();p();p();var nqt=a((t,e,r)=>{let n=t instanceof RegExp?iCn(t,r):t,o=e instanceof RegExp?iCn(e,r):e,s=n!==null&&o!=null&&hGo(n,o,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+n.length,s[1]),post:r.slice(s[1]+o.length)}},"balanced"),iCn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),hGo=a((t,e,r)=>{let n,o,s,c,l,u=r.indexOf(t),d=r.indexOf(e,u+1),f=u;if(u>=0&&d>0){if(t===e)return[u,d];for(n=[],s=r.length;f>=0&&!l;){if(f===u)n.push(f),u=r.indexOf(t,f+1);else if(n.length===1){let h=n.pop();h!==void 0&&(l=[h,d])}else o=n.pop(),o!==void 0&&o=0?u:d}n.length&&c!==void 0&&(l=[s,c])}return l},"range");var oCn="\0SLASH"+Math.random()+"\0",sCn="\0OPEN"+Math.random()+"\0",sqt="\0CLOSE"+Math.random()+"\0",aCn="\0COMMA"+Math.random()+"\0",cCn="\0PERIOD"+Math.random()+"\0",mGo=new RegExp(oCn,"g"),gGo=new RegExp(sCn,"g"),AGo=new RegExp(sqt,"g"),yGo=new RegExp(aCn,"g"),_Go=new RegExp(cCn,"g"),EGo=/\\\\/g,vGo=/\\{/g,CGo=/\\}/g,bGo=/\\,/g,SGo=/\\\./g,TGo=1e5,IGo=4e6;function iqt(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a(iqt,"numeric");function xGo(t){return t.replace(EGo,oCn).replace(vGo,sCn).replace(CGo,sqt).replace(bGo,aCn).replace(SGo,cCn)}a(xGo,"escapeBraces");function wGo(t){return t.replace(mGo,"\\").replace(gGo,"{").replace(AGo,"}").replace(yGo,",").replace(_Go,".")}a(wGo,"unescapeBraces");function lCn(t){if(!t)return[""];let e=[],r=nqt("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=lCn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(lCn,"parseCommaParts");function uCn(t,e={}){if(!t)return[];let{max:r=TGo,maxLength:n=IGo}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),oqt(xGo(t),r,n,!0).map(wGo)}a(uCn,"expand");function RGo(t){return"{"+t+"}"}a(RGo,"embrace");function kGo(t){return/^-?0\d/.test(t)}a(kGo,"isPadded");function PGo(t,e){return t<=e}a(PGo,"lte");function DGo(t,e){return t>=e}a(DGo,"gte");function mwe(t,e,r,n,o,s){let c=[],l=0;for(let u=0;u=n)return c;let f=t[u]+e+r[d];if(!(s&&!f)){if(l+f.length>o)return c;c.push(f),l+=f.length}}return c}a(mwe,"combine");function NGo(t,e,r){let n=t.split(/\.\./),o=[];if(n[0]===void 0||n[1]===void 0)return o;let s=iqt(n[0]),c=iqt(n[1]),l=Math.max(n[0].length,n[1].length),u=n.length===3&&n[2]!==void 0?Math.max(Math.abs(iqt(n[2])),1):1,d=PGo;c0){let y=new Array(A+1).join("0");m<0?g="-"+y+g.slice(1):g=y+g}}o.push(g)}return o}a(NGo,"expandSequence");function oqt(t,e,r,n){let o=[""],s=!1,c=!0;for(;;){let l=nqt("{","}",t);if(!l)return mwe(o,t,[""],e,r,s);let u=l.pre;if(/\$$/.test(u)){if(o=mwe(o,u+"{"+l.body+"}",[""],e,r,s&&!l.post.length),c=!1,!l.post.length)break;t=l.post;continue}let d=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),h=d||f,m=l.body.indexOf(",")>=0;if(!h&&!m){if(l.post.match(/,(?!,).*\}/)){t=l.pre+"{"+l.body+sqt+l.post,n=!0;continue}return mwe(o,u+"{"+l.body+"}"+l.post,[""],e,r,s)}c&&(s=n&&!h,c=!1);let g;if(h)g=NGo(l.body,f,e);else{let A=lCn(l.body);if(A.length===1&&A[0]!==void 0&&(A=oqt(A[0],e,r,!1).map(RGo),A.length===1)){if(o=mwe(o,u+A[0],[""],e,r,s&&!l.post.length),!l.post.length)break;t=l.post;continue}g=[];for(let y=0;y{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");p();p();var MGo={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Awe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),OGo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),dCn=a(t=>t.join(""),"rangesToString"),fCn=a((t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],o=[],s=r+1,c=!1,l=!1,u=!1,d=!1,f=r,h="";e:for(;sh?n.push(Awe(h)+"-"+Awe(y)):y===h&&n.push(Awe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(Awe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(Awe(y)),s++}if(fr?e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var rb,LGo=new Set(["!","?","+","*","@"]),aqt=a(t=>LGo.has(t),"isExtglobType"),pCn=a(t=>aqt(t.type),"isExtglobAST"),BGo=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),FGo=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),UGo=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),hCn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),QGo="(?!(?:^|/)\\.\\.?(?:$|/))",yKe="(?!\\.)",qGo=new Set(["[","."]),jGo=new Set(["..","."]),HGo=new Set("().*{}+?[]^$\\!"),GGo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),cqt="[^/]",mCn=cqt+"*?",gCn=cqt+"+?",$Go=0,hJ=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++$Go;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#n.length,parts:this.#n}}constructor(e,r,n={}){this.type=e,e&&(this.#t=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#s=this.#e===this?[]:this.#e.#s,e==="!"&&!this.#e.#a&&this.#s.push(this),this.#o=this.#i?this.#i.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#u=this.#n.map(e=>String(e)).join("")}#p(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#s.pop();){if(e.type!=="!")continue;let r=e,n=r.#i;for(;n;){for(let o=r.#o+1;!n.type&&otypeof r=="string"?r:r.toJSON()):[this.type,...this.#n.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#a&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#o===0)return!0;let e=this.#i;for(let r=0;rtypeof g!="string"),d=this.#n.map(g=>{let[A,y,_,E]=typeof g=="string"?rb.#k(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||_,this.#r=this.#r||E,A}).join(""),f="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&jGo.has(this.#n[0]))){let A=qGo,y=r&&A.has(d.charAt(0))||d.startsWith("\\.")&&A.has(d.charAt(2))||d.startsWith("\\.\\.")&&A.has(d.charAt(4)),_=!r&&!e&&A.has(d.charAt(0));f=y?QGo:_?yKe:""}let h="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(h="(?:$|\\/)"),[f+d+h,u2(d),this.#t=!!this.#t,this.#r]}let n=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#y(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString(),d=this;return d.#n=[u],d.type=null,d.#t=void 0,[u,u2(this.toString()),!1,!1]}let c=!n||e||r||!yKe?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?yKe:"")+gCn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?yKe:"")+mCn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`;l=o+s+u}return[l,u2(s),this.#t=!!this.#t,this.#r]}#S(){if(pCn(this)){let e=0,r=!1;do{r=!0;for(let n=0;n{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,o,s,c]=r.toRegExpSource(e);return this.#r=this.#r||c,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(e,r,n=!1){let o=!1,s="",c=!1,l=!1;for(let u=0;ur?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Df=a((t,e,r={})=>(gwe(e),!r.nocomment&&e.charAt(0)==="#"?!1:new nv(e,r).match(t)),"minimatch"),VGo=/^\*+([^+@!?*[(]*)$/,WGo=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),zGo=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),YGo=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),KGo=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),JGo=/^\*+\.\*+$/,ZGo=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),XGo=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),e$o=/^\.\*+$/,t$o=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),r$o=/^\*+$/,n$o=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),i$o=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),o$o=/^\?+([^+@!?*[(]*)?$/,s$o=a(([t,e=""])=>{let r=_Cn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),a$o=a(([t,e=""])=>{let r=ECn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),c$o=a(([t,e=""])=>{let r=ECn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),l$o=a(([t,e=""])=>{let r=_Cn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),_Cn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),ECn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),vCn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",ACn={win32:{sep:"\\"},posix:{sep:"/"}},u$o=vCn==="win32"?ACn.win32.sep:ACn.posix.sep;Df.sep=u$o;var ah=Symbol("globstar **");Df.GLOBSTAR=ah;var d$o="[^/]",f$o=d$o+"*?",p$o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",h$o="(?:(?!(?:\\/|^)\\.).)*?",m$o=a((t,e={})=>r=>Df(r,t,e),"filter");Df.filter=m$o;var Ew=a((t,e={})=>Object.assign({},t,e),"ext"),g$o=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Df;let e=Df;return Object.assign(a((n,o,s={})=>e(n,o,Ew(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,Ew(t,s))}static defaults(o){return e.defaults(Ew(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,Ew(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,Ew(t,s))}},unescape:a((n,o={})=>e.unescape(n,Ew(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,Ew(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,Ew(t,o)),"filter"),defaults:a(n=>e.defaults(Ew(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,Ew(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,Ew(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,Ew(t,s)),"match"),sep:e.sep,GLOBSTAR:ah})},"defaults");Df.defaults=g$o;var CCn=a((t,e={})=>(gwe(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:uCn(t,{max:e.braceExpandMax})),"braceExpand");Df.braceExpand=CCn;var A$o=a((t,e={})=>new nv(t,e).makeRe(),"makeRe");Df.makeRe=A$o;var y$o=a((t,e,r={})=>{let n=new nv(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");Df.match=y$o;var yCn=/[?*]|[+@!]\(.*?\)|\[|\]/,_$o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),nv=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,r={}){gwe(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||vCn,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,c,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!yCn.test(s[2]))&&!yCn.test(s[3]),d=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(d)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let o=n;for(;r[o+1]==="**";)o++;o!==n&&r.splice(n,o-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,o)=>{let s=n[n.length-1];return o==="**"&&s==="**"?n:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(o),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let o=1;oo&&n.splice(o+1,c-o);let l=n[o+1],u=n[o+2],d=n[o+3];if(l!==".."||!u||u==="."||u===".."||!d||d==="."||d==="..")continue;r=!0,n.splice(o,1);let f=n.slice(0);f[o]="**",e.push(f),o--}if(!this.preserveMultipleSlashes){for(let c=1;cr.length)}partsMatch(e,r,n=!1){let o=0,s=0,c=[],l="";for(;o=2&&(e=this.levelTwoFileOptimize(e)),r.includes(ah)?this.#e(e,r,n,o,s):this.#r(e,r,n,o,s)}#e(e,r,n,o,s){let c=r.indexOf(ah,s),l=r.lastIndexOf(ah),[u,d,f]=n?[r.slice(s,c),r.slice(c+1),[]]:[r.slice(s,c),r.slice(c+1,l),r.slice(l+1)];if(u.length){let v=e.slice(o,o+u.length);if(!this.#r(v,u,n,0,0))return!1;o+=u.length,s+=u.length}let h=0;if(f.length){if(f.length+o>e.length)return!1;let v=e.length-f.length;if(this.#r(e,f,n,v,0))h=f.length;else{if(e[e.length-1]!==""||o+f.length===e.length||(v--,!this.#r(e,f,n,v,0)))return!1;h=f.length+1}}if(!d.length){let v=!!h;for(let S=o;S{let d=u.map(h=>{if(h instanceof RegExp)for(let m of h.flags.split(""))o.add(m);return typeof h=="string"?_$o(h):h===ah?ah:h._src});d.forEach((h,m)=>{let g=d[m+1],A=d[m-1];h!==ah||A===ah||(A===void 0?g!==void 0&&g!==ah?d[m+1]="(?:\\/|"+n+"\\/)?"+g:d[m]=n:g===void 0?d[m-1]=A+"(?:\\/|\\/"+n+")?":g!==ah&&(d[m-1]=A+"(?:\\/|\\/"+n+"\\/)"+g,d[m+1]=ah))});let f=d.filter(h=>h!==ah);if(this.partial&&f.length>=1){let h=[];for(let m=1;m<=f.length;m++)h.push(f.slice(0,m).join("/"));return"(?:"+h.join("|")+")"}return f.join("/")}).join("|"),[c,l]=e.length>1?["(?:",")"]:["",""];s="^"+c+s+l+"$",this.partial&&(s="^(?:\\/|"+c+s.slice(1,-1)+l+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let c=o[o.length-1];if(!c)for(let l=o.length-2;!c&&l>=0;l--)c=o[l];for(let l of s){let u=o;if(n.matchBase&&l.length===1&&(u=[c]),this.matchOne(u,l,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Df.defaults(e).Minimatch}};Df.AST=hJ;Df.Minimatch=nv;Df.escape=kue;Df.unescape=u2;var lqt="contentExclusion",v$o=1e4,_Ke=class extends dKe{static{a(this,"CopilotContentExclusion")}#e;#t=new Sn(1e4);#r=new Sn(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=qz(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??dJ.all);if(!o)return uKe;let s=n?.baseFolder?.uri??"file://",c=this.evaluateFilePathRules(e,s,o);if(c.isBlocked)return c;let l=this.evaluateTextBasedRules(e,o,r);if(l.isBlocked)return l}catch(n){return Iq.exception(this.#e,n,`${lqt}.evaluate`),Xvn}return hwe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=hwe,c,l=COt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(Df(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=uqt(u,"FILE_BLOCKED_PATH"),c=d;break e}return Iq.debug(this.#e,`Evaluated path-based exclusion rules for <${e}>`,{result:s,baseUri:r,fileName:l,matchingPattern:c}),this.#t.set(o,s),s}evaluateTextBasedRules(e,r,n){let o=r.filter(l=>l.ifAnyMatch),s=r.filter(l=>l.ifNoneMatch);if(!n||o.length===0&&s.length===0)return hwe;let c=this.evaluateFileContent(o,s,n);return Iq.debug(this.#e,`Evaluated text-based exclusion rules for <${e}>`,{result:c}),c}evaluateFileContent(e,r,n){for(let o of e)if(o.ifAnyMatch&&o.ifAnyMatch.length>0&&o.ifAnyMatch.map(c=>bCn(c)).some(c=>c.test(n)))return uqt(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>bCn(c)).some(c=>c.test(n)))return uqt(o,"FILE_BLOCKED_TEXT_BASED");return hwe}async refresh(){try{let e=[...this.#r.keys()];this.reset(),await Promise.all(e.map(r=>this.#o(r)))}catch(e){Ma(this.#e,e,`${lqt}.refresh`)}}reset(){this.#r.clear(),this.#t.clear()}async#n(e){if(this.#i?.length)return this.#i;let r=await this.#o(e.toLowerCase());if(r.length!==0)return r}#i;setTestingRules(e){this.#i=e}#o=nCn(async e=>{let r=await this.#e.get(Qt).getGitHubSession();if(!r)throw new Ei("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(dJ.all);e.filter(u=>u!==dJ.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==dJ.all).join(",")),n.searchParams.set("scope",o?dJ.all:dJ.repo);let c=await Gd(this.#e,r,n.href,{timeout:v$o}),l=await c.json();if(!c.ok){if(c.status===404)return Array.from(e,()=>[]);throw this.#s("fetch.error",{message:l.message}),new Rx(c)}return this.#s("fetch.success"),pJ(T$o,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(Pf).getRepo(Cf(e));if(!n||!n?.remote)return;let o=n.remote.getUrlForApi();if(o)return{baseFolder:n.baseFolder,url:o}}#s(e,r,n){ft(this.#e,`${lqt}.${e}`,Vt.createAndMarkAsIssued(r,n))}};function bCn(t){if(!t.startsWith("/")&&!t.endsWith("/"))return new RegExp(t);let e=t.slice(1,t.lastIndexOf("/")),r=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,r)}a(bCn,"stringToRegex");function uqt(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(uqt,"fileBlockedEvaluationResult");var C$o=b.Object({name:b.String(),type:b.String()}),b$o=b.Object({paths:b.Array(b.String()),ifNoneMatch:b.Optional(b.Array(b.String())),ifAnyMatch:b.Optional(b.Array(b.String())),source:C$o}),dqt=b.Array(b$o),S$o=b.Object({rules:dqt,last_updated_at:b.String(),scope:b.String()}),T$o=b.Array(S$o);var pc=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new _Ke(this.ctx);this.evaluateResultCache=new Map;this.onDidChangeActiveTextEditor=a(async e=>{if(!this.#e)return;if(!e.document){this.updateStatusIcon(!1);return}let r=await this.ctx.get($r).getTextDocumentValidation(e.document),n=r.status==="invalid",o=r.status==="invalid"?r.reason:void 0;this.updateStatusIcon(n,o)},"onDidChangeActiveTextEditor");let r=n0(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get($r).onDidFocusTextDocument(r),ws(this.ctx,n=>{this.#e=n.envelope.copilotignore_enabled??!1,this.evaluateResultCache.clear(),this.#t.refresh()})}static{a(this,"CopilotContentExclusionManager")}#e;#t;get enabled(){return this.#e}async evaluate(e,r,n){if(!this.#e)return{isBlocked:!1};let o=[],s=a(async(u,d)=>{let f=performance.now(),h=await d.evaluate(e,r),m=performance.now();return o.push({key:u,result:h,elapsedMs:Math.round(m-f)}),h},"track"),l=(await Promise.all([s("contentExclusion.evaluate",this.#t)])).find(u=>u?.isBlocked)??{isBlocked:!1};try{for(let u of o)this.#r(u.key,e,u.result,u.elapsedMs)}catch(u){Iq.error(this.ctx,"Error tracking telemetry",u)}return n==="UPDATE"&&this.updateStatusIcon(l.isBlocked,l.message),l}updateStatusIcon(e,r){this.#e&&(e?this.ctx.get(ks).setClsInactive(r??"Copilot is disabled"):this.ctx.get(ks).clearClsInactive())}#r(e,r,n,o){let s=r+e;if(this.evaluateResultCache.get(s)===n.reason)return!1;if(this.evaluateResultCache.set(s,n.reason??"UNKNOWN"),n.reason===uKe.reason)return Iq.debug(this.ctx,`[${e}] No matching policy for this repository. uri: ${r}`),!1;let l={isBlocked:n.isBlocked?"true":"false",reason:n.reason??"UNKNOWN"},u={contentExclusionEvalMs:o};return ft(this.ctx,e,Vt.createAndMarkAsIssued(l,u)),ft(this.ctx,e,Vt.createAndMarkAsIssued({...l,path:r},u),1),Iq.debug(this.ctx,`[${e}] ${r}`,n),!0}setTestingRules(e){this.#t.setTestingRules(e)}set __contentExclusions(e){this.#t=e}get __contentExclusions(){return this.#t}};async function Pue(t,e,r){let n=await t.get(pc).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a(Pue,"isDocumentValid");var $r=class{constructor(e,r=Pue){this.ctx=e;this.validateTextDocument=r}static{a(this,"TextDocumentManager")}async textDocuments(){let e=this.getTextDocumentsUnsafe(),r=[];for(let n of e)(await this.validateTextDocument(this.ctx,n,n.getText())).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=Gs(e.uri);return this.getTextDocumentsUnsafe().find(n=>n.uri===r)}async getTextDocument(e){return this.getTextDocumentWithValidation(e).then(r=>{if(r.status==="valid")return r.document})}async getTextDocumentValidation(e){try{let r=this.getTextDocumentUnsafe(e)?.getText()??await this.readTextDocumentFromDisk(e.uri);return r===void 0?this.notFoundResult(e):this.validateTextDocument(this.ctx,e,r)}catch{return this.notFoundResult(e)}}async getTextDocumentWithValidation(e){let r=this.getTextDocumentUnsafe(e);if(!r)return this.notFoundResult(e);let n=await this.validateTextDocument(this.ctx,e,r.getText());return n.status==="valid"?{status:"valid",document:r}:n}notFoundResult({uri:e}){return{status:"notfound",message:`Document for URI could not be found: ${e}`}}async readTextDocumentFromDisk(e){try{if((await this.ctx.get(Go).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get(Go).readFileString(e)}getWorkspaceFolder(e){let r=Gs(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(Gs(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=Gs(e.uri);for(let n of this.getWorkspaceFolders()){let o=Gs(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return ro(r)}};p();p();var ot=new pe("chat");p();var EKe=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new Ji;this.onFileChange=this.emitter.event;this.status="created",this.startWatching()}static{a(this,"WorkspaceWatcher")}emitFilesCreated(e){this.emitter.fire({type:"create",documents:e,workspaceFolder:this.workspaceFolder})}emitFilesUpdated(e){this.emitter.fire({type:"update",documents:e,workspaceFolder:this.workspaceFolder})}emitFilesDeleted(e){this.emitter.fire({type:"delete",documents:e,workspaceFolder:this.workspaceFolder})}};var vw=class{constructor(e){this.ctx=e;this.watchers=new Sn(25)}static{a(this,"WorkspaceWatcherProvider")}getWatcher(e){let r=this.watchers.get(e.uri);if(r)return r;let n=this.getParentFolder(e.uri);return n?this.watchers.get(n):void 0}getParentFolder(e){return[...this.watchers.keys()].find(n=>{let o=n.replace(/[#?].*/,"").replace(/\/?$/,"/");return e!==n&&e.startsWith(o)})}hasWatcher(e){return this.getParentFolder(e.uri)||this.getWatcher(e)!==void 0}startWatching(e){if(ot.debug(this.ctx,`WorkspaceWatcherProvider - Start watching workspace ${e.uri}`),this.hasWatcher(e)){this.getWatcher(e)?.startWatching();return}let r=this.createWatcher(e);this.watchers.set(e.uri,r)}stopWatching(e){this.getWatcher(e)?.stopWatching()}terminateSubfolderWatchers(e){let r=[];for(let s of this.watchers.values())r.push(s.workspaceFolder);let n=e.uri.replace(/[#?].*/,"").replace(/\/?$/,"/"),o=r.filter(s=>s.uri!==e.uri&&s.uri.startsWith(n));for(let s of o)this.terminateWatching(s);return o}terminateWatching(e){if(this.getWatcher(e)?.status!=="stopped")return this.stopWatching(e),this.watchers.delete(e.uri);this.watchers.delete(e.uri)}onFileChange(e,r,n,o){return this.getWatcher(e)?.onFileChange(n0(this.ctx,r,"WorkspaceWatcherProvider.onFileChange"),n,o)}async getWatchedFiles(e){return await this.getWatcher(e)?.getWatchedFiles()??[]}async getWatchedFileUris(e){return await this.getWatcher(e)?.getWatchedFileUris()??[]}getStatus(e){return this.getWatcher(e)?.status}};var xq=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},I$o="workspaceLifecycleManager",b_=new pe(I$o),dT=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=ws(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?b_.debug(this.ctx,`listener ${e.constructor.name} is already started`):(b_.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):b_.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);b_.debug(this.ctx,"WorkspaceLifecycleManager started"),this.ctx.get($r).onDidChangeWorkspaceFolders(e=>{this.onWorkspacesAdded(e.added,this.ctx),this.onWorkspacesRemoved(e.removed,this.ctx)}),await this.onWorkspacesAdded(this.ctx.get($r).getWorkspaceFolders(),this.ctx)}static isSubfolder(e,r){let n=e.uri,o=r.uri.replace(/[#?].*/,"").replace(/\/?$/,"/");return n!==o&&n.startsWith(o)}async onWorkspacesAdded(e,r){if(!e.length){b_.debug(r,"No workspaces to add.");return}b_.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];b_.debug(r,`Combined workspaces: ${n.map(l=>l.uri).join(", ")}`);let o=n.filter((l,u,d)=>d.findIndex(f=>f.uri===l.uri)===u&&!d.some(f=>t.isSubfolder(l,f)));b_.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));b_.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));b_.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){b_.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(vw).terminateWatching(l);for(let d of this.activeListeners)b_.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;b_.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(vw);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){b_.debug(r,`Terminated subfolder watchers for workspace: ${l.uri}, Subfolders: ${d.map(f=>f.uri).join(", ")}`);for(let f of this.activeListeners)await f.didTerminateWorkspaceSubfolders(l,d)}for(let f of this.activeListeners)b_.debug(r,`Adding file change listener for workspace: ${l.uri}`),u.onFileChange(l,f.didChangeFiles.bind(f))}}for(let l of this.activeListeners)for(let u of s)b_.debug(r,`Notifying ${l.constructor.name} of added workspace: ${u.uri}`),await l.didAddWorkspace(u)}async onWorkspacesRemoved(e,r){if(e.length)for(let n of e){if(!n.uri)continue;r.get(vw).terminateWatching(n),this.watchedWorkspaces=this.watchedWorkspaces.filter(s=>s.uri!==n.uri);for(let s of this.activeListeners)await s.didRemoveWorkspace(n)}}addListener(e){this.activeListeners.push(e)}removeListener(e){this.activeListeners=this.activeListeners.filter(r=>r!==e)}removeAllListeners(){this.activeListeners=[]}};function vKe(t){t.set(dT,new dT(t))}a(vKe,"setupWorkspaceLifecycleListener");var wq=fe(require("fs")),Cw=fe(require("path"));var fqt=".agent.md",x$o=300*1e3,w$o="github",TCn="agents";function ywe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(ywe,"sanitizeSegment");function R$o(t){return t.replace(/\\/g,"/")}a(R$o,"toPosix");var aF=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new pe("OrgCustomAgentService");this.fetchSequencer=new _w;this.activated=!1;this.orgs=new Map;this.client=o.client??new cKe(e),this.resolveNwo=o.resolveNwo??(s=>kQt(s,[e.get(ig).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??x$o,this.cacheRoot=Cw.join(this.persistenceManager.directory,w$o),this.lifecycleListener=new pqt(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=R$o(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${TCn}/*${fqt}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:ICn.githubOrg}),this.tokenSubscription=ws(this.ctx,()=>{this.refreshAll()}),this.refreshIntervalMs>0&&(this.refreshTimer=setInterval(()=>{this.refreshAll()},this.refreshIntervalMs),this.refreshTimer.unref?.())}async dispose(){this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=void 0),this.tokenSubscription?.dispose(),this.tokenSubscription=void 0,this.registration?.dispose(),this.registration=void 0,this.activated=!1,await this.fetchSequencer.drain()}async refreshAll(){let e=Array.from(this.orgs.entries()).map(([r,n])=>this.fetchSequencer.queue(r,()=>this.fetchAndCacheOrg(r,n.probeNwo)));await Promise.all(e)}visibleOwnersForWorkspaces(e){let r=new Set(e.map(o=>Gs(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(ywe(o.probeNwo.owner));break}return n}isCachedAgentVisibleFor(e,r){let n=this.extractOwnerFromPath(e);return n===void 0?!0:this.visibleOwnersForWorkspaces(r).has(n)}extractOwnerFromPath(e){let r=Cw.relative(this.cacheRoot,e);if(r.startsWith("..")||Cw.isAbsolute(r))return;let n=r.indexOf(Cw.sep);if(!(n<=0))return r.slice(0,n)}_isActivated(){return this.activated}async _handleWorkspaceAdded(e){await this.onWorkspaceAdded(e)}async _handleWorkspaceRemoved(e){await this.onWorkspaceRemoved(e)}async onWorkspaceAdded(e){if(!e?.uri)return;let r;try{r=un(e.uri)}catch{return}let n=await this.resolveNwo(r);if(!n)return;let o=Gs(e.uri),s=this.orgs.get(n.owner);if(s){s.workspaces.add(o);return}this.orgs.set(n.owner,{workspaces:new Set([o]),probeNwo:n}),await this.fetchSequencer.queue(n.owner,()=>this.fetchAndCacheOrg(n.owner,n))}async onWorkspaceRemoved(e){if(!e?.uri)return;let r=Gs(e.uri),n=[];for(let[o,s]of this.orgs)s.workspaces.delete(r)&&s.workspaces.size===0&&n.push({org:o,probe:s.probeNwo});for(let{org:o,probe:s}of n)this.orgs.delete(o),await this.fetchSequencer.queue(o,()=>this.removeOrgCache(s))}async fetchAndCacheOrg(e,r){if(kt(this.ctx,ze.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await wq.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${fqt}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(Cw.join(o,l),Zvn(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return Cw.join(this.cacheRoot,ywe(e.owner),ywe(e.repo),TCn)}async fetchDetails(e){return this.client.getCustomAgentDetails(e.repo_owner,e.repo_name,e.name,e.version)}async writeIfChanged(e,r){let n=Buffer.from(r,"utf8");try{if((await wq.promises.stat(e)).size===n.length&&(await wq.promises.readFile(e)).equals(n))return}catch{}await wq.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await wq.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(fqt)&&!r.has(o.name))try{await wq.promises.unlink(Cw.join(e,o.name)),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed orphan ${o.name}`)}catch(s){this.logger.warn(this.ctx,`[OrgCustomAgentService] orphan unlink failed: ${String(s)}`)}}async removeOrgCache(e){let r=Cw.join(this.cacheRoot,ywe(e.owner),ywe(e.repo));try{await wq.promises.rm(r,{recursive:!0,force:!0}),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed cache for ${e.owner}/${e.repo}`)}catch(n){this.logger.warn(this.ctx,`[OrgCustomAgentService] failed to remove cache for ${e.owner}/${e.repo}: ${String(n)}`)}}},pqt=class extends xq{constructor(r){super();this.service=r}static{a(this,"OrgCustomAgentLifecycleListener")}isEnabled(){return Promise.resolve(!0)}isStarted(){return this.service._isActivated()}start(){this.service.activate()}async didAddWorkspace(r){await this.service._handleWorkspaceAdded(r)}async didRemoveWorkspace(r){await this.service._handleWorkspaceRemoved(r)}};p();var _g=class{static{a(this,"PromptChangeNotifier")}},CKe=class extends _g{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function xCn(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a(xCn,"createPromptFilesChangedEvent");function wCn(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(wCn,"createBatchPromptFilesChangedEvent");p();var Lc=class{constructor(){this._listeners=[];this._disposed=!1}static{a(this,"EventEmitter")}get event(){return(e,r,n)=>{if(this._disposed)throw new Error("EventEmitter is disposed");let o={listener:e,thisArgs:r};this._listeners.push(o);let s={dispose:a(()=>{let c=this._listeners.indexOf(o);c>=0&&this._listeners.splice(c,1)},"dispose")};return n&&n.push(s),s}}fire(e){if(this._disposed)return;let r=this._listeners.slice();for(let{listener:n,thisArgs:o}of r)try{n.call(o,e)}catch(s){console.error("Error in event listener:",s)}}dispose(){this._listeners.length=0,this._disposed=!0}};function Due(...t){return(e,r,n)=>{let o=[];for(let c of t)o.push(c(e,r));let s={dispose:a(()=>{for(let c of o)c.dispose()},"dispose")};return n&&n.push(s),s}}a(Due,"anyEvent");var DCn=require("os"),_we=fe(require("path"));function Nue(t){return t.replace(/\\/g,"/")}a(Nue,"toForwardSlash");function RCn(...t){return _we.default.posix.join(...t.map(Nue))}a(RCn,"globJoin");function P$o(t){let e=Nue(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(P$o,"containsTraversal");function kCn(t,e){let r=Nue(_we.default.posix.normalize(Nue(t))),n=Nue(_we.default.posix.normalize(Nue(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(kCn,"isContained");var PCn=["*","?","{","["],QA=class{constructor(e,r){this.ctx=e;this.logger=new pe("PromptFileLocationRegistry");this._onLocationsChanged=new Lc;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??DCn.homedir}static{a(this,"PromptFileLocationRegistry")}register(e,r,n={}){let o=n.watchable??!0,s=n.cacheable??!0,c=n.metadata,l=this.patterns.get(e);l||(l=[],this.patterns.set(e,l));let u=[];for(let d of r){if(P$o(d)){this.logger.warn(this.ctx,`Skipping pattern "${d}" because it contains a ".." segment; traversal is not allowed.`);continue}if(!l.some(f=>f.pattern===d)){let f=PCn.some(m=>d.includes(m)),h=n.classification??{storage:this.derivePatternStorage(d)};l.push({pattern:d,isGlob:f,watchable:o,cacheable:s,metadata:c,classification:h}),u.push(d)}}return u.length>0&&this.fireLocationsChanged(e),{dispose:a(()=>this.unregister(e,u),"dispose")}}replace(e,r,n,o={}){let s=this.patterns.get(r)?.length??0;this.suppressEvents++;try{e?.dispose()}finally{this.suppressEvents--}return n.length>0?this.register(r,n,o):((this.patterns.get(r)?.length??0){},"dispose")})}unregister(e,r){let n=this.patterns.get(e);if(!n)return;let o=new Set(r),s=n.length,c=n.filter(l=>!o.has(l.pattern));c.lengtho.watchable).map(o=>o.pattern):n.map(o=>o.pattern):[]}resolvePatterns(e,r,n){let o=this.patterns.get(e);if(!o)return[];let s=new Set,c=[],l=a((d,f,h)=>{s.has(d)||(s.add(d),c.push({pattern:d,isGlob:f,watchable:h.watchable,cacheable:h.cacheable,metadata:h.metadata,classification:h.classification}))},"addIfNew"),u=n?o.filter(d=>d.watchable):o;for(let d of u)if(d.pattern.startsWith("~/")){let f=this.getHomedir(),h=RCn(f,d.pattern.slice(2));if(!kCn(f,h))continue;l(h,d.isGlob,d)}else if(this.isAbsolutePattern(d.pattern))l(d.pattern,d.isGlob,d);else for(let f of r){let h=RCn(f,d.pattern);kCn(f,h)&&l(h,d.isGlob,d)}return c}clear(e){let r=this.patterns.get(e);r&&r.length>0&&(this.patterns.set(e,[]),this.fireLocationsChanged(e))}derivePatternStorage(e){return e.startsWith("~/")||this.isAbsolutePattern(e)?"user":"local"}isAbsolutePattern(e){let r=e.length;for(let o of PCn){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire(xCn(e,"ConfigChanged"))}};p();p();p();p();var vwe=fe(require("path"));function bw(t,e,r){let n=r?t:t.toLowerCase(),o=r?e:e.toLowerCase();if(n===o)return!0;let s=vwe.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!vwe.posix.isAbsolute(s)}a(bw,"isEqualOrParent");var nb=process.platform==="linux";function Rq(t){return t.replace(/\\/g,"/")}a(Rq,"normalizeSlashes");function Eg(t){let e=Rq(t);return nb?e:e.toLowerCase()}a(Eg,"canonicalKey");function lF(t){return Eg(vwe.resolve(t))}a(lF,"canonicalPathKey");function NCn(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>nb?u:u.toLowerCase(),"toKey");for(let u of t){let d=r(u.path),f=e.get(d);if(!f){e.set(d,{path:u.path,type:u.type});continue}let h=f.type,m=u.type;h==="create"&&m==="delete"?e.delete(d):h==="delete"&&m==="create"?e.set(d,{path:u.path,type:"update"}):h==="create"&&m==="update"||e.set(d,{path:u.path,type:m})}let n=[...e.values()],o=n.filter(u=>u.type==="delete").sort((u,d)=>u.path.length-d.path.length),s=[],c=[];for(let u of o){let d=r(u.path);c.some(h=>d!==h&&bw(h,d,nb))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(NCn,"coalesceEvents");var bKe=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=Due(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=Due(this._parcel.onDidError,this._nodejs.onDidError)}static{a(this,"UniversalWatcher")}watch(e){if(this._disposed)throw new Error("UniversalWatcher: cannot watch after dispose");return e.recursive?this._parcel.watch(e):this._nodejs.watch(e)}async dispose(){this._disposed||(this._disposed=!0,await Promise.all([this._parcel.dispose(),this._nodejs.dispose()]))}};var uF=fe(require("fs"));var mJ=new pe("NodeJSWatcherService"),D$o=1e3,SKe=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new Lc;this.onDidChange=this._onDidChange.event;this._onDidError=new Lc;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??uF.watch,this._fsWatchFile=o??{watchFile:uF.watchFile,unwatchFile:uF.unwatchFile}}static{a(this,"NodeJSWatcherService")}watch(e){if(this._disposed)throw new Error("NodeJSWatcherService: cannot watch after dispose");if(e.recursive)throw new Error("NodeJSWatcherService: only supports non-recursive watches");let r=Rq(e.path),n=Eg(r),o=this._entries.get(n);if(o)return o.refCount++,this._entryDisposable(n);let s=this.recursive?.subscribeToPath(r,u=>{this._onDidChange.fire([u])});if(s)return this._entries.set(n,{path:r,refCount:1,disposable:s}),this._entryDisposable(n);let l=this._isRegularFile(r)?this._startWatchFile(r):this._startFsWatch(r);return this._entries.set(n,{path:r,refCount:1,disposable:l}),this._entryDisposable(n)}dispose(){if(this._disposed)return Promise.resolve();this._disposed=!0;let e=[...this._entries.values()];this._entries.clear();for(let r of e)try{r.disposable.dispose()}catch(n){mJ.debug(this.ctx,"fs watcher dispose threw",r.path,n)}return this._onDidChange.dispose(),this._onDidError.dispose(),Promise.resolve()}_entryDisposable(e){let r=!1;return{dispose:a(()=>{if(r)return;r=!0;let n=this._entries.get(e);if(n&&(n.refCount--,n.refCount<=0)){this._entries.delete(e);try{n.disposable.dispose()}catch(o){mJ.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return uF.statSync(e).isFile()}catch{return!1}}_startFsWatch(e){let r;try{r=this._fsWatch(e,{recursive:!1},(n,o)=>{if(this._disposed)return;let s=o?O$o(e,Rq(o)):e,c=N$o(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),mJ.debug(this.ctx,"fs.watch error for",e,n))})}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),mJ.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){mJ.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=M$o(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:D$o},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),mJ.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){mJ.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function N$o(t,e){if(t==="change")return"update";try{return uF.statSync(e),"create"}catch{return"delete"}}a(N$o,"classify");function M$o(t,e){if(t.mtimeMs===0&&e.mtimeMs!==0)return"delete";if(t.mtimeMs!==0&&e.mtimeMs===0)return"create";if(t.mtimeMs!==e.mtimeMs)return"update"}a(M$o,"classifyStat");function O$o(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(O$o,"joinPosix");p();var pbn=fe(fbn()),hbn=require("os"),mbn=fe(require("path"));var wKe=new pe("ParcelWatcherService"),TVo=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",IVo=process.platform==="darwin"?[mbn.join((0,hbn.homedir)(),"Library","Containers")]:[],RKe=class{constructor(e,r){this.ctx=e;this._onDidChange=new Lc;this.onDidChange=this._onDidChange.event;this._onDidError=new Lc;this.onDidError=this._onDidError.event;this._roots=new Map;this._pendingShutdowns=new Set;this._disposed=!1;this._enospcNotified=!1;this._warnedPaths=new Set;this._subscribe=r??pbn.subscribe}static{a(this,"ParcelWatcherService")}watch(e){if(this._disposed)throw new Error("ParcelWatcherService: cannot watch after dispose");if(!e.recursive)throw new Error("ParcelWatcherService: only supports recursive watches");let r=Rq(e.path),n=Eg(r),o=this._findCoveringRoot(r);if(o){let l={root:o};return o.handles.add(l),{dispose:a(()=>this._releaseHandle(l),"dispose")}}let s={path:r,handles:new Set,pathSubscribers:new Map};this._roots.set(n,s),this._startSubscription(s),this._foldChildrenIntoAfterSubscribed(s);let c={root:s};return s.handles.add(c),{dispose:a(()=>this._releaseHandle(c),"dispose")}}subscribeToPath(e,r){if(this._disposed)return;let n=Rq(e),o=this._findCoveringRoot(n);if(!o)return;let s=Eg(n),c=o.pathSubscribers.get(s);return c||(c=new Set,o.pathSubscribers.set(s,c)),c.add(r),{dispose:a(()=>{let l=o.pathSubscribers.get(s);l&&(l.delete(r),l.size===0&&o.pathSubscribers.delete(s),this._maybeTearDown(o))},"dispose")}}async dispose(){if(this._disposed)return;this._disposed=!0;let e=[...this._roots.values()];for(this._roots.clear(),await Promise.all(e.map(async r=>{r.handles.clear(),r.pathSubscribers.clear(),await this._shutdownEntry(r)}));this._pendingShutdowns.size>0;){let r=[...this._pendingShutdowns];await Promise.allSettled(r)}this._onDidChange.dispose(),this._onDidError.dispose()}_findCoveringRoot(e){for(let r of this._roots.values())if(bw(r.path,e,nb))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&bw(e.path,o.path,nb)){for(let s of o.handles)s.root=e,e.handles.add(s);o.handles.clear();for(let[s,c]of o.pathSubscribers){let l=e.pathSubscribers.get(s);l||(l=new Set,e.pathSubscribers.set(s,l));for(let u of c)l.add(u)}o.pathSubscribers.clear(),this._roots.delete(n),r.push(o)}if(r.length!==0){try{await e.subscribing}catch{}for(let n of r)this._trackShutdown(n,"Shutdown of folded child failed for")}}_releaseHandle(e){let r=e.root;r.handles.delete(e),this._maybeTearDown(r)}_maybeTearDown(e){if(e.handles.size>0||e.pathSubscribers.size>0)return;let r=Eg(e.path);this._roots.get(r)===e&&(this._roots.delete(r),this._trackShutdown(e,"Unsubscribe failed for"))}_trackShutdown(e,r){let n=this._shutdownEntry(e).catch(o=>{wKe.debug(this.ctx,r,e.path,o)});this._pendingShutdowns.add(n),n.finally(()=>this._pendingShutdowns.delete(n))}_startSubscription(e){let r=this._subscribe(e.path,(n,o)=>{if(!this._disposed){if(n){this._onWatchError(n,e.path);return}this._handleParcelEvents(e,o)}},{backend:TVo,ignore:IVo}).then(async n=>{if(e.subscribing=void 0,this._disposed||!this._rootStillActive(e)){await n.unsubscribe();return}return e.subscription=n,n}).catch(n=>{e.subscribing=void 0,this._onWatchError(n instanceof Error?n:new Error(String(n)),e.path)});e.subscribing=r}_rootStillActive(e){let r=Eg(e.path);return this._roots.get(r)===e}async _shutdownEntry(e){let r=e.subscription;e.subscription=void 0;let n=e.subscribing;if(e.subscribing=void 0,r)await r.unsubscribe();else if(n){let o=await n;o&&await o.unsubscribe()}}_handleParcelEvents(e,r){if(r.length===0)return;let n=[];for(let s of r){let c=Rq(s.path);n.push({path:c,type:s.type})}let o=NCn(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=Eg(s.path),l=e.pathSubscribers.get(c);if(l)for(let u of l)try{u(s)}catch(d){wKe.debug(this.ctx,"Path subscriber threw",s.path,d)}}}_onWatchError(e,r){if(this._disposed)return;let n=e.toString();if(wKe.debug(this.ctx,"Watcher error for",r,e),this._onDidError.fire({path:r,error:e}),n.includes("ENOSPC")&&!this._enospcNotified){this._enospcNotified=!0,this.ctx.get(ss).showWarningMessageOnlyOnce("parcelWatcher.enospc","Unable to watch for file changes in AI customization files. The inotify watch limit may have been reached. Please increase the limit by following the instructions at http://aka.ms/ghc-jetbrains-wiki/FAQ#resolving-the-enospc-file-watcher-error-on-linux");return}this._warnedPaths.has(r)||(this._warnedPaths.add(r),wKe.warn(this.ctx,"Failed to watch for file changes at",r,e))}};function kKe(t){let e=new RKe(t),r=new SKe(t,e);return new bKe(t,e,r)}a(kKe,"createUniversalWatcher");var gbn=fe(require("fs"));var kq=fe(require("path"));var xVo=100,PKe=/[*?{[]/,Sqt=class{constructor(e,r,n,o,s){this.request=e;this.watcher=r;this.registerDeferred=n;this.unregisterDeferred=o;this.statSync=s;this._disposed=!1;this._innerSubs=[];this.registerDeferred(this),this._tryActivate()}static{a(this,"DeferredWatchSubscription")}isPending(){return!this._disposed&&this._ancestorPath!==void 0}targetPath(){return this.request.path}handleEvent(e){if(!this._disposed){if(this._ancestorPath!==void 0){if(e.type!=="create"||!bw(e.path,this.request.path,nb)&&!bw(this.request.path,e.path,nb))return;this._tryActivate();return}e.type==="delete"&&bw(e.path,this.request.path,nb)&&this._tryActivate()}}dispose(){this._disposed||(this._disposed=!0,this.unregisterDeferred(this),this._ancestorPath=void 0,this._disposeInnerSubs())}_tryActivate(){if(this._disposed)return;let e=this._isDirectory(this.request.path);if(e||this._exists(this.request.path)){let c=[];if(c.push(this.watcher.watch(this.request)),e){let u=kq.dirname(this.request.path);u!==this.request.path&&this._isDirectory(u)&&c.push(this.watcher.watch({path:u,recursive:!1}))}let l=this._innerSubs;this._innerSubs=c,this._ancestorPath=void 0;for(let u of l)u.dispose();return}let n=wVo(this.request.path,this.statSync);if(n===void 0||RVo(n,this.request.path)){this._ancestorPath="",this._disposeInnerSubs();return}if(this._ancestorPath===n&&this._innerSubs.length>0)return;let o=this.watcher.watch({path:n,recursive:!1}),s=this._innerSubs;this._innerSubs=[o],this._ancestorPath=n;for(let c of s)c.dispose()}_exists(e){try{return this.statSync(e),!0}catch{return!1}}_isDirectory(e){try{return this.statSync(e).isDirectory()}catch{return!1}}_disposeInnerSubs(){let e=this._innerSubs;this._innerSubs=[];for(let r of e)r.dispose()}};function wVo(t,e){let r=kq.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=kq.dirname(r)}}a(wVo,"findExistingAncestor");function RVo(t,e){return kq.dirname(e)===t?!1:t===kq.parse(t).root}a(RVo,"isAncestorTooBroad");var DKe=class{constructor(e,r,n=gbn.statSync){this._onPromptFileChanged=new Lc;this.onPromptFileChanged=this._onPromptFileChanged.event;this._patterns=new Map;this._pendingChanges=[];this._pendingTypes=new Set;this._pendingKeys=new Set;this._disposed=!1;this._deferredSubs=new Set;this._watcher=r??kKe(e),this._ownsWatcher=r===void 0,this._statSync=n,this._subscriptionDisposable=this._watcher.onDidChange(o=>this._handleEvents(o))}static{a(this,"PromptFileWatcher")}watch(e,r,n){if(this._disposed)throw new Error("PromptFileWatcher: cannot watch after dispose");let o=Array.isArray(r)?r:[r],s=[],c=new Map,l=new Map;for(let d of o){let f=d.replace(/\\/g,"/");s.push(f),c.set(f,(c.get(f)??0)+1),!this._patterns.has(f)&&!l.has(f)&&l.set(f,this._toWatchRequest(f))}for(let[d,f]of c){let h=this._patterns.get(d);if(!h){let m=l.get(d),g=this._createDeferredSubscription(m),A=PKe.test(d)?m.path:void 0;h={refCountByType:new Map,matcher:new nv(d,{dot:!0}),subscription:g,baseDir:A},this._patterns.set(d,h)}h.refCountByType.set(e,(h.refCountByType.get(e)??0)+f)}n&&n.dispose();let u=!1;return{dispose:a(()=>{if(!u){u=!0;for(let d of s)this._decrementRefCount(d,e)}},"dispose")}}flush(){if(this._disposed||(this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),this._pendingChanges.length===0))return;let e=wCn([...this._pendingTypes],this._pendingChanges);this._pendingChanges=[],this._pendingTypes=new Set,this._pendingKeys=new Set,this._onPromptFileChanged.fire(e)}async dispose(){if(!this._disposed){this._disposed=!0,this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0);for(let e of this._patterns.values())e.subscription.dispose();this._patterns.clear(),this._subscriptionDisposable.dispose(),this._ownsWatcher&&await this._watcher.dispose(),this._onPromptFileChanged.dispose()}}_createDeferredSubscription(e){return new Sqt(e,this._watcher,r=>this._deferredSubs.add(r),r=>this._deferredSubs.delete(r),this._statSync)}_toWatchRequest(e){if(!PKe.test(e))return{path:e,recursive:!1,includes:[e]};let r=this._extractBaseDir(e),n=e.includes("**")||this._globSpansMultipleSegments(e);return{path:r,recursive:n,includes:[e]}}_globSpansMultipleSegments(e){let r=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));if(r<0)return!1;let n=e.slice(0,r);return PKe.test(n)}_extractBaseDir(e){let r=PKe.exec(e);if(!r)return kq.dirname(e);let n=e.slice(0,r.index),o=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));if(o<0)throw new Error(`PromptFileWatcher: pattern "${e}" has no base directory; expected an absolute path.`);let s=o>0?n.slice(0,o):n;if(/^[A-Za-z]:$/.test(s)&&n.length>s.length){let c=n[s.length];if(c==="/"||c==="\\")return`${s}${c}`}return s}_handleEvents(e){if(!this._disposed){if(this._deferredSubs.size>0)for(let r of e)for(let n of[...this._deferredSubs])n.handleEvent(r);for(let r of e){let n=this._mapEventType(r.type),o=!1;for(let c of this._patterns.values()){if(c.matcher.match(r.path)){for(let f of c.refCountByType.keys())this._pendingTypes.add(f);o=!0;continue}if(r.type!=="delete"||c.baseDir===void 0)continue;let l=c.baseDir,u=bw(r.path,l,nb),d=bw(l,r.path,nb);if(!(!u&&!d)){for(let f of c.refCountByType.keys())this._pendingTypes.add(f);o=!0}}if(!o)continue;let s=`${n}\0${r.path}`;this._pendingKeys.has(s)||(this._pendingKeys.add(s),this._pendingChanges.push({reason:n,path:r.path}))}this._pendingChanges.length>0&&this._scheduleFlush()}}_mapEventType(e){switch(e){case"create":return"FileCreated";case"update":return"FileChanged";case"delete":return"FileDeleted"}}_scheduleFlush(){this._debounceTimer!==void 0&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this.flush()},xVo)}_decrementRefCount(e,r){let n=this._patterns.get(e);if(!n)return;let o=n.refCountByType.get(r);o!==void 0&&(o<=1?n.refCountByType.delete(r):n.refCountByType.set(r,o-1),n.refCountByType.size===0&&(this._patterns.delete(e),n.subscription.dispose()))}};p();p();function Sw(t,e,...r){return e.replace(/\{(\d+)\}/g,(n,o)=>{let s=r[Number(o)];return s!==void 0?String(s):n})}a(Sw,"localize");function kVo(t,e=[],r={}){let o=new Tqt(t).scan();return new Iqt(o,t,e,r).parse()}a(kVo,"parseRaw");function lh(t,e,r,n){return{type:t,startOffset:e,endOffset:r,rawValue:n?.rawValue??"",value:n?.value??"",format:n?.format??"none",indent:n?.indent??0}}a(lh,"makeToken");var Tqt=class{constructor(e){this.input=e;this.pos=0;this.tokens=[];this.flowDepth=0;this.seenBlockColon=!1;this.seenDocumentStart=0}static{a(this,"YamlScanner")}scan(e=1){for(;this.pose)););return this.tokens.push(lh(13,this.pos,this.pos)),this.tokens}scanLine(){if(this.seenBlockColon=!1,this.peekChar()===` +`)}`;throw new Error(r)},"assertShape");p();p();p();var mKe=new WeakMap;function gKe(t,e){if(t==null||typeof t!="object")return String(t);let r,n="",o=0,s=Object.prototype.toString.call(t);if(s!=="[object RegExp]"&&s!=="[object Date]"&&mKe.has(t))return mKe.get(t);switch(mKe.set(t,"~"+ ++e),s){case"[object Set]":r=Array.from(t);case"[object Array]":for(r||(r=t),n+="a";oe.delete(n))),o}a(mGo,"n");function iCn(t,e){return function(r,n){return mGo(t,e,r,n)}}a(iCn,"o");p();p();p();var iqt=a((t,e,r)=>{let n=t instanceof RegExp?oCn(t,r):t,o=e instanceof RegExp?oCn(e,r):e,s=n!==null&&o!=null&&gGo(n,o,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+n.length,s[1]),post:r.slice(s[1]+o.length)}},"balanced"),oCn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),gGo=a((t,e,r)=>{let n,o,s,c,l,u=r.indexOf(t),d=r.indexOf(e,u+1),f=u;if(u>=0&&d>0){if(t===e)return[u,d];for(n=[],s=r.length;f>=0&&!l;){if(f===u)n.push(f),u=r.indexOf(t,f+1);else if(n.length===1){let h=n.pop();h!==void 0&&(l=[h,d])}else o=n.pop(),o!==void 0&&o=0?u:d}n.length&&c!==void 0&&(l=[s,c])}return l},"range");var sCn="\0SLASH"+Math.random()+"\0",aCn="\0OPEN"+Math.random()+"\0",aqt="\0CLOSE"+Math.random()+"\0",cCn="\0COMMA"+Math.random()+"\0",lCn="\0PERIOD"+Math.random()+"\0",AGo=new RegExp(sCn,"g"),yGo=new RegExp(aCn,"g"),_Go=new RegExp(aqt,"g"),EGo=new RegExp(cCn,"g"),vGo=new RegExp(lCn,"g"),CGo=/\\\\/g,bGo=/\\{/g,SGo=/\\}/g,TGo=/\\,/g,IGo=/\\\./g,xGo=1e5,wGo=4e6;function oqt(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a(oqt,"numeric");function RGo(t){return t.replace(CGo,sCn).replace(bGo,aCn).replace(SGo,aqt).replace(TGo,cCn).replace(IGo,lCn)}a(RGo,"escapeBraces");function kGo(t){return t.replace(AGo,"\\").replace(yGo,"{").replace(_Go,"}").replace(EGo,",").replace(vGo,".")}a(kGo,"unescapeBraces");function uCn(t){if(!t)return[""];let e=[],r=iqt("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=uCn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(uCn,"parseCommaParts");function dCn(t,e={}){if(!t)return[];let{max:r=xGo,maxLength:n=wGo}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),sqt(RGo(t),r,n,!0).map(kGo)}a(dCn,"expand");function PGo(t){return"{"+t+"}"}a(PGo,"embrace");function DGo(t){return/^-?0\d/.test(t)}a(DGo,"isPadded");function NGo(t,e){return t<=e}a(NGo,"lte");function MGo(t,e){return t>=e}a(MGo,"gte");function mwe(t,e,r,n,o,s){let c=[],l=0;for(let u=0;u=n)return c;let f=t[u]+e+r[d];if(!(s&&!f)){if(l+f.length>o)return c;c.push(f),l+=f.length}}return c}a(mwe,"combine");function OGo(t,e,r){let n=t.split(/\.\./),o=[];if(n[0]===void 0||n[1]===void 0)return o;let s=oqt(n[0]),c=oqt(n[1]),l=Math.max(n[0].length,n[1].length),u=n.length===3&&n[2]!==void 0?Math.max(Math.abs(oqt(n[2])),1):1,d=NGo;c0){let y=new Array(A+1).join("0");m<0?g="-"+y+g.slice(1):g=y+g}}o.push(g)}return o}a(OGo,"expandSequence");function sqt(t,e,r,n){let o=[""],s=!1,c=!0;for(;;){let l=iqt("{","}",t);if(!l)return mwe(o,t,[""],e,r,s);let u=l.pre;if(/\$$/.test(u)){if(o=mwe(o,u+"{"+l.body+"}",[""],e,r,s&&!l.post.length),c=!1,!l.post.length)break;t=l.post;continue}let d=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),h=d||f,m=l.body.indexOf(",")>=0;if(!h&&!m){if(l.post.match(/,(?!,).*\}/)){t=l.pre+"{"+l.body+aqt+l.post,n=!0;continue}return mwe(o,u+"{"+l.body+"}"+l.post,[""],e,r,s)}c&&(s=n&&!h,c=!1);let g;if(h)g=OGo(l.body,f,e);else{let A=uCn(l.body);if(A.length===1&&A[0]!==void 0&&(A=sqt(A[0],e,r,!1).map(PGo),A.length===1)){if(o=mwe(o,u+A[0],[""],e,r,s&&!l.post.length),!l.post.length)break;t=l.post;continue}g=[];for(let y=0;y{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");p();p();var LGo={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Awe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),BGo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),fCn=a(t=>t.join(""),"rangesToString"),pCn=a((t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],o=[],s=r+1,c=!1,l=!1,u=!1,d=!1,f=r,h="";e:for(;sh?n.push(Awe(h)+"-"+Awe(y)):y===h&&n.push(Awe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(Awe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(Awe(y)),s++}if(fr?e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var rb,FGo=new Set(["!","?","+","*","@"]),cqt=a(t=>FGo.has(t),"isExtglobType"),hCn=a(t=>cqt(t.type),"isExtglobAST"),UGo=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),QGo=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),qGo=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),mCn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),jGo="(?!(?:^|/)\\.\\.?(?:$|/))",yKe="(?!\\.)",HGo=new Set(["[","."]),GGo=new Set(["..","."]),$Go=new Set("().*{}+?[]^$\\!"),VGo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),lqt="[^/]",gCn=lqt+"*?",ACn=lqt+"+?",WGo=0,mJ=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++WGo;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#n.length,parts:this.#n}}constructor(e,r,n={}){this.type=e,e&&(this.#t=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#s=this.#e===this?[]:this.#e.#s,e==="!"&&!this.#e.#a&&this.#s.push(this),this.#o=this.#i?this.#i.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#u=this.#n.map(e=>String(e)).join("")}#p(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#s.pop();){if(e.type!=="!")continue;let r=e,n=r.#i;for(;n;){for(let o=r.#o+1;!n.type&&otypeof r=="string"?r:r.toJSON()):[this.type,...this.#n.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#a&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#o===0)return!0;let e=this.#i;for(let r=0;rtypeof g!="string"),d=this.#n.map(g=>{let[A,y,_,E]=typeof g=="string"?rb.#k(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||_,this.#r=this.#r||E,A}).join(""),f="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&GGo.has(this.#n[0]))){let A=HGo,y=r&&A.has(d.charAt(0))||d.startsWith("\\.")&&A.has(d.charAt(2))||d.startsWith("\\.\\.")&&A.has(d.charAt(4)),_=!r&&!e&&A.has(d.charAt(0));f=y?jGo:_?yKe:""}let h="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(h="(?:$|\\/)"),[f+d+h,u2(d),this.#t=!!this.#t,this.#r]}let n=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#y(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString(),d=this;return d.#n=[u],d.type=null,d.#t=void 0,[u,u2(this.toString()),!1,!1]}let c=!n||e||r||!yKe?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?yKe:"")+ACn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?yKe:"")+gCn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`;l=o+s+u}return[l,u2(s),this.#t=!!this.#t,this.#r]}#S(){if(hCn(this)){let e=0,r=!1;do{r=!0;for(let n=0;n{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,o,s,c]=r.toRegExpSource(e);return this.#r=this.#r||c,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(e,r,n=!1){let o=!1,s="",c=!1,l=!1;for(let u=0;ur?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Df=a((t,e,r={})=>(gwe(e),!r.nocomment&&e.charAt(0)==="#"?!1:new nv(e,r).match(t)),"minimatch"),zGo=/^\*+([^+@!?*[(]*)$/,YGo=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),KGo=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),JGo=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),ZGo=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),XGo=/^\*+\.\*+$/,e$o=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),t$o=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),r$o=/^\.\*+$/,n$o=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),i$o=/^\*+$/,o$o=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),s$o=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),a$o=/^\?+([^+@!?*[(]*)?$/,c$o=a(([t,e=""])=>{let r=ECn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),l$o=a(([t,e=""])=>{let r=vCn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),u$o=a(([t,e=""])=>{let r=vCn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),d$o=a(([t,e=""])=>{let r=ECn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),ECn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),vCn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),CCn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",yCn={win32:{sep:"\\"},posix:{sep:"/"}},f$o=CCn==="win32"?yCn.win32.sep:yCn.posix.sep;Df.sep=f$o;var ah=Symbol("globstar **");Df.GLOBSTAR=ah;var p$o="[^/]",h$o=p$o+"*?",m$o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",g$o="(?:(?!(?:\\/|^)\\.).)*?",A$o=a((t,e={})=>r=>Df(r,t,e),"filter");Df.filter=A$o;var Ew=a((t,e={})=>Object.assign({},t,e),"ext"),y$o=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Df;let e=Df;return Object.assign(a((n,o,s={})=>e(n,o,Ew(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,Ew(t,s))}static defaults(o){return e.defaults(Ew(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,Ew(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,Ew(t,s))}},unescape:a((n,o={})=>e.unescape(n,Ew(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,Ew(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,Ew(t,o)),"filter"),defaults:a(n=>e.defaults(Ew(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,Ew(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,Ew(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,Ew(t,s)),"match"),sep:e.sep,GLOBSTAR:ah})},"defaults");Df.defaults=y$o;var bCn=a((t,e={})=>(gwe(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:dCn(t,{max:e.braceExpandMax})),"braceExpand");Df.braceExpand=bCn;var _$o=a((t,e={})=>new nv(t,e).makeRe(),"makeRe");Df.makeRe=_$o;var E$o=a((t,e,r={})=>{let n=new nv(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");Df.match=E$o;var _Cn=/[?*]|[+@!]\(.*?\)|\[|\]/,v$o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),nv=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,r={}){gwe(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||CCn,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,c,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!_Cn.test(s[2]))&&!_Cn.test(s[3]),d=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(d)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let o=n;for(;r[o+1]==="**";)o++;o!==n&&r.splice(n,o-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,o)=>{let s=n[n.length-1];return o==="**"&&s==="**"?n:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(o),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let o=1;oo&&n.splice(o+1,c-o);let l=n[o+1],u=n[o+2],d=n[o+3];if(l!==".."||!u||u==="."||u===".."||!d||d==="."||d==="..")continue;r=!0,n.splice(o,1);let f=n.slice(0);f[o]="**",e.push(f),o--}if(!this.preserveMultipleSlashes){for(let c=1;cr.length)}partsMatch(e,r,n=!1){let o=0,s=0,c=[],l="";for(;o=2&&(e=this.levelTwoFileOptimize(e)),r.includes(ah)?this.#e(e,r,n,o,s):this.#r(e,r,n,o,s)}#e(e,r,n,o,s){let c=r.indexOf(ah,s),l=r.lastIndexOf(ah),[u,d,f]=n?[r.slice(s,c),r.slice(c+1),[]]:[r.slice(s,c),r.slice(c+1,l),r.slice(l+1)];if(u.length){let v=e.slice(o,o+u.length);if(!this.#r(v,u,n,0,0))return!1;o+=u.length,s+=u.length}let h=0;if(f.length){if(f.length+o>e.length)return!1;let v=e.length-f.length;if(this.#r(e,f,n,v,0))h=f.length;else{if(e[e.length-1]!==""||o+f.length===e.length||(v--,!this.#r(e,f,n,v,0)))return!1;h=f.length+1}}if(!d.length){let v=!!h;for(let S=o;S{let d=u.map(h=>{if(h instanceof RegExp)for(let m of h.flags.split(""))o.add(m);return typeof h=="string"?v$o(h):h===ah?ah:h._src});d.forEach((h,m)=>{let g=d[m+1],A=d[m-1];h!==ah||A===ah||(A===void 0?g!==void 0&&g!==ah?d[m+1]="(?:\\/|"+n+"\\/)?"+g:d[m]=n:g===void 0?d[m-1]=A+"(?:\\/|\\/"+n+")?":g!==ah&&(d[m-1]=A+"(?:\\/|\\/"+n+"\\/)"+g,d[m+1]=ah))});let f=d.filter(h=>h!==ah);if(this.partial&&f.length>=1){let h=[];for(let m=1;m<=f.length;m++)h.push(f.slice(0,m).join("/"));return"(?:"+h.join("|")+")"}return f.join("/")}).join("|"),[c,l]=e.length>1?["(?:",")"]:["",""];s="^"+c+s+l+"$",this.partial&&(s="^(?:\\/|"+c+s.slice(1,-1)+l+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let c=o[o.length-1];if(!c)for(let l=o.length-2;!c&&l>=0;l--)c=o[l];for(let l of s){let u=o;if(n.matchBase&&l.length===1&&(u=[c]),this.matchOne(u,l,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Df.defaults(e).Minimatch}};Df.AST=mJ;Df.Minimatch=nv;Df.escape=Pue;Df.unescape=u2;var uqt="contentExclusion",b$o=1e4,_Ke=class extends dKe{static{a(this,"CopilotContentExclusion")}#e;#t=new Sn(1e4);#r=new Sn(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=jz(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??fJ.all);if(!o)return uKe;let s=n?.baseFolder?.uri??"file://",c=this.evaluateFilePathRules(e,s,o);if(c.isBlocked)return c;let l=this.evaluateTextBasedRules(e,o,r);if(l.isBlocked)return l}catch(n){return Iq.exception(this.#e,n,`${uqt}.evaluate`),eCn}return hwe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=hwe,c,l=bOt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(Df(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=dqt(u,"FILE_BLOCKED_PATH"),c=d;break e}return Iq.debug(this.#e,`Evaluated path-based exclusion rules for <${e}>`,{result:s,baseUri:r,fileName:l,matchingPattern:c}),this.#t.set(o,s),s}evaluateTextBasedRules(e,r,n){let o=r.filter(l=>l.ifAnyMatch),s=r.filter(l=>l.ifNoneMatch);if(!n||o.length===0&&s.length===0)return hwe;let c=this.evaluateFileContent(o,s,n);return Iq.debug(this.#e,`Evaluated text-based exclusion rules for <${e}>`,{result:c}),c}evaluateFileContent(e,r,n){for(let o of e)if(o.ifAnyMatch&&o.ifAnyMatch.length>0&&o.ifAnyMatch.map(c=>SCn(c)).some(c=>c.test(n)))return dqt(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>SCn(c)).some(c=>c.test(n)))return dqt(o,"FILE_BLOCKED_TEXT_BASED");return hwe}async refresh(){try{let e=[...this.#r.keys()];this.reset(),await Promise.all(e.map(r=>this.#o(r)))}catch(e){Ma(this.#e,e,`${uqt}.refresh`)}}reset(){this.#r.clear(),this.#t.clear()}async#n(e){if(this.#i?.length)return this.#i;let r=await this.#o(e.toLowerCase());if(r.length!==0)return r}#i;setTestingRules(e){this.#i=e}#o=iCn(async e=>{let r=await this.#e.get(Qt).getGitHubSession();if(!r)throw new Ei("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(fJ.all);e.filter(u=>u!==fJ.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==fJ.all).join(",")),n.searchParams.set("scope",o?fJ.all:fJ.repo);let c=await $d(this.#e,r,n.href,{timeout:b$o}),l=await c.json();if(!c.ok){if(c.status===404)return Array.from(e,()=>[]);throw this.#s("fetch.error",{message:l.message}),new Rx(c)}return this.#s("fetch.success"),hJ(x$o,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(Pf).getRepo(Cf(e));if(!n||!n?.remote)return;let o=n.remote.getUrlForApi();if(o)return{baseFolder:n.baseFolder,url:o}}#s(e,r,n){ft(this.#e,`${uqt}.${e}`,Vt.createAndMarkAsIssued(r,n))}};function SCn(t){if(!t.startsWith("/")&&!t.endsWith("/"))return new RegExp(t);let e=t.slice(1,t.lastIndexOf("/")),r=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,r)}a(SCn,"stringToRegex");function dqt(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(dqt,"fileBlockedEvaluationResult");var S$o=b.Object({name:b.String(),type:b.String()}),T$o=b.Object({paths:b.Array(b.String()),ifNoneMatch:b.Optional(b.Array(b.String())),ifAnyMatch:b.Optional(b.Array(b.String())),source:S$o}),fqt=b.Array(T$o),I$o=b.Object({rules:fqt,last_updated_at:b.String(),scope:b.String()}),x$o=b.Array(I$o);var pc=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new _Ke(this.ctx);this.evaluateResultCache=new Map;this.onDidChangeActiveTextEditor=a(async e=>{if(!this.#e)return;if(!e.document){this.updateStatusIcon(!1);return}let r=await this.ctx.get($r).getTextDocumentValidation(e.document),n=r.status==="invalid",o=r.status==="invalid"?r.reason:void 0;this.updateStatusIcon(n,o)},"onDidChangeActiveTextEditor");let r=i0(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get($r).onDidFocusTextDocument(r),ws(this.ctx,n=>{this.#e=n.envelope.copilotignore_enabled??!1,this.evaluateResultCache.clear(),this.#t.refresh()})}static{a(this,"CopilotContentExclusionManager")}#e;#t;get enabled(){return this.#e}async evaluate(e,r,n){if(!this.#e)return{isBlocked:!1};let o=[],s=a(async(u,d)=>{let f=performance.now(),h=await d.evaluate(e,r),m=performance.now();return o.push({key:u,result:h,elapsedMs:Math.round(m-f)}),h},"track"),l=(await Promise.all([s("contentExclusion.evaluate",this.#t)])).find(u=>u?.isBlocked)??{isBlocked:!1};try{for(let u of o)this.#r(u.key,e,u.result,u.elapsedMs)}catch(u){Iq.error(this.ctx,"Error tracking telemetry",u)}return n==="UPDATE"&&this.updateStatusIcon(l.isBlocked,l.message),l}updateStatusIcon(e,r){this.#e&&(e?this.ctx.get(ks).setClsInactive(r??"Copilot is disabled"):this.ctx.get(ks).clearClsInactive())}#r(e,r,n,o){let s=r+e;if(this.evaluateResultCache.get(s)===n.reason)return!1;if(this.evaluateResultCache.set(s,n.reason??"UNKNOWN"),n.reason===uKe.reason)return Iq.debug(this.ctx,`[${e}] No matching policy for this repository. uri: ${r}`),!1;let l={isBlocked:n.isBlocked?"true":"false",reason:n.reason??"UNKNOWN"},u={contentExclusionEvalMs:o};return ft(this.ctx,e,Vt.createAndMarkAsIssued(l,u)),ft(this.ctx,e,Vt.createAndMarkAsIssued({...l,path:r},u),1),Iq.debug(this.ctx,`[${e}] ${r}`,n),!0}setTestingRules(e){this.#t.setTestingRules(e)}set __contentExclusions(e){this.#t=e}get __contentExclusions(){return this.#t}};async function Due(t,e,r){let n=await t.get(pc).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a(Due,"isDocumentValid");var $r=class{constructor(e,r=Due){this.ctx=e;this.validateTextDocument=r}static{a(this,"TextDocumentManager")}async textDocuments(){let e=this.getTextDocumentsUnsafe(),r=[];for(let n of e)(await this.validateTextDocument(this.ctx,n,n.getText())).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=Gs(e.uri);return this.getTextDocumentsUnsafe().find(n=>n.uri===r)}async getTextDocument(e){return this.getTextDocumentWithValidation(e).then(r=>{if(r.status==="valid")return r.document})}async getTextDocumentValidation(e){try{let r=this.getTextDocumentUnsafe(e)?.getText()??await this.readTextDocumentFromDisk(e.uri);return r===void 0?this.notFoundResult(e):this.validateTextDocument(this.ctx,e,r)}catch{return this.notFoundResult(e)}}async getTextDocumentWithValidation(e){let r=this.getTextDocumentUnsafe(e);if(!r)return this.notFoundResult(e);let n=await this.validateTextDocument(this.ctx,e,r.getText());return n.status==="valid"?{status:"valid",document:r}:n}notFoundResult({uri:e}){return{status:"notfound",message:`Document for URI could not be found: ${e}`}}async readTextDocumentFromDisk(e){try{if((await this.ctx.get(Go).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get(Go).readFileString(e)}getWorkspaceFolder(e){let r=Gs(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(Gs(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=Gs(e.uri);for(let n of this.getWorkspaceFolders()){let o=Gs(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return ro(r)}};p();p();var ot=new pe("chat");p();var EKe=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new Ji;this.onFileChange=this.emitter.event;this.status="created",this.startWatching()}static{a(this,"WorkspaceWatcher")}emitFilesCreated(e){this.emitter.fire({type:"create",documents:e,workspaceFolder:this.workspaceFolder})}emitFilesUpdated(e){this.emitter.fire({type:"update",documents:e,workspaceFolder:this.workspaceFolder})}emitFilesDeleted(e){this.emitter.fire({type:"delete",documents:e,workspaceFolder:this.workspaceFolder})}};var vw=class{constructor(e){this.ctx=e;this.watchers=new Sn(25)}static{a(this,"WorkspaceWatcherProvider")}getWatcher(e){let r=this.watchers.get(e.uri);if(r)return r;let n=this.getParentFolder(e.uri);return n?this.watchers.get(n):void 0}getParentFolder(e){return[...this.watchers.keys()].find(n=>{let o=n.replace(/[#?].*/,"").replace(/\/?$/,"/");return e!==n&&e.startsWith(o)})}hasWatcher(e){return this.getParentFolder(e.uri)||this.getWatcher(e)!==void 0}startWatching(e){if(ot.debug(this.ctx,`WorkspaceWatcherProvider - Start watching workspace ${e.uri}`),this.hasWatcher(e)){this.getWatcher(e)?.startWatching();return}let r=this.createWatcher(e);this.watchers.set(e.uri,r)}stopWatching(e){this.getWatcher(e)?.stopWatching()}terminateSubfolderWatchers(e){let r=[];for(let s of this.watchers.values())r.push(s.workspaceFolder);let n=e.uri.replace(/[#?].*/,"").replace(/\/?$/,"/"),o=r.filter(s=>s.uri!==e.uri&&s.uri.startsWith(n));for(let s of o)this.terminateWatching(s);return o}terminateWatching(e){if(this.getWatcher(e)?.status!=="stopped")return this.stopWatching(e),this.watchers.delete(e.uri);this.watchers.delete(e.uri)}onFileChange(e,r,n,o){return this.getWatcher(e)?.onFileChange(i0(this.ctx,r,"WorkspaceWatcherProvider.onFileChange"),n,o)}async getWatchedFiles(e){return await this.getWatcher(e)?.getWatchedFiles()??[]}async getWatchedFileUris(e){return await this.getWatcher(e)?.getWatchedFileUris()??[]}getStatus(e){return this.getWatcher(e)?.status}};var xq=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},w$o="workspaceLifecycleManager",b_=new pe(w$o),dT=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=ws(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?b_.debug(this.ctx,`listener ${e.constructor.name} is already started`):(b_.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):b_.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);b_.debug(this.ctx,"WorkspaceLifecycleManager started"),this.ctx.get($r).onDidChangeWorkspaceFolders(e=>{this.onWorkspacesAdded(e.added,this.ctx),this.onWorkspacesRemoved(e.removed,this.ctx)}),await this.onWorkspacesAdded(this.ctx.get($r).getWorkspaceFolders(),this.ctx)}static isSubfolder(e,r){let n=e.uri,o=r.uri.replace(/[#?].*/,"").replace(/\/?$/,"/");return n!==o&&n.startsWith(o)}async onWorkspacesAdded(e,r){if(!e.length){b_.debug(r,"No workspaces to add.");return}b_.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];b_.debug(r,`Combined workspaces: ${n.map(l=>l.uri).join(", ")}`);let o=n.filter((l,u,d)=>d.findIndex(f=>f.uri===l.uri)===u&&!d.some(f=>t.isSubfolder(l,f)));b_.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));b_.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));b_.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){b_.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(vw).terminateWatching(l);for(let d of this.activeListeners)b_.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;b_.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(vw);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){b_.debug(r,`Terminated subfolder watchers for workspace: ${l.uri}, Subfolders: ${d.map(f=>f.uri).join(", ")}`);for(let f of this.activeListeners)await f.didTerminateWorkspaceSubfolders(l,d)}for(let f of this.activeListeners)b_.debug(r,`Adding file change listener for workspace: ${l.uri}`),u.onFileChange(l,f.didChangeFiles.bind(f))}}for(let l of this.activeListeners)for(let u of s)b_.debug(r,`Notifying ${l.constructor.name} of added workspace: ${u.uri}`),await l.didAddWorkspace(u)}async onWorkspacesRemoved(e,r){if(e.length)for(let n of e){if(!n.uri)continue;r.get(vw).terminateWatching(n),this.watchedWorkspaces=this.watchedWorkspaces.filter(s=>s.uri!==n.uri);for(let s of this.activeListeners)await s.didRemoveWorkspace(n)}}addListener(e){this.activeListeners.push(e)}removeListener(e){this.activeListeners=this.activeListeners.filter(r=>r!==e)}removeAllListeners(){this.activeListeners=[]}};function vKe(t){t.set(dT,new dT(t))}a(vKe,"setupWorkspaceLifecycleListener");var wq=fe(require("fs")),Cw=fe(require("path"));var pqt=".agent.md",R$o=300*1e3,k$o="github",ICn="agents";function ywe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(ywe,"sanitizeSegment");function P$o(t){return t.replace(/\\/g,"/")}a(P$o,"toPosix");var aF=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new pe("OrgCustomAgentService");this.fetchSequencer=new _w;this.activated=!1;this.orgs=new Map;this.client=o.client??new cKe(e),this.resolveNwo=o.resolveNwo??(s=>PQt(s,[e.get(og).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??R$o,this.cacheRoot=Cw.join(this.persistenceManager.directory,k$o),this.lifecycleListener=new hqt(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=P$o(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${ICn}/*${pqt}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:xCn.githubOrg}),this.tokenSubscription=ws(this.ctx,()=>{this.refreshAll()}),this.refreshIntervalMs>0&&(this.refreshTimer=setInterval(()=>{this.refreshAll()},this.refreshIntervalMs),this.refreshTimer.unref?.())}async dispose(){this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=void 0),this.tokenSubscription?.dispose(),this.tokenSubscription=void 0,this.registration?.dispose(),this.registration=void 0,this.activated=!1,await this.fetchSequencer.drain()}async refreshAll(){let e=Array.from(this.orgs.entries()).map(([r,n])=>this.fetchSequencer.queue(r,()=>this.fetchAndCacheOrg(r,n.probeNwo)));await Promise.all(e)}visibleOwnersForWorkspaces(e){let r=new Set(e.map(o=>Gs(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(ywe(o.probeNwo.owner));break}return n}isCachedAgentVisibleFor(e,r){let n=this.extractOwnerFromPath(e);return n===void 0?!0:this.visibleOwnersForWorkspaces(r).has(n)}extractOwnerFromPath(e){let r=Cw.relative(this.cacheRoot,e);if(r.startsWith("..")||Cw.isAbsolute(r))return;let n=r.indexOf(Cw.sep);if(!(n<=0))return r.slice(0,n)}_isActivated(){return this.activated}async _handleWorkspaceAdded(e){await this.onWorkspaceAdded(e)}async _handleWorkspaceRemoved(e){await this.onWorkspaceRemoved(e)}async onWorkspaceAdded(e){if(!e?.uri)return;let r;try{r=un(e.uri)}catch{return}let n=await this.resolveNwo(r);if(!n)return;let o=Gs(e.uri),s=this.orgs.get(n.owner);if(s){s.workspaces.add(o);return}this.orgs.set(n.owner,{workspaces:new Set([o]),probeNwo:n}),await this.fetchSequencer.queue(n.owner,()=>this.fetchAndCacheOrg(n.owner,n))}async onWorkspaceRemoved(e){if(!e?.uri)return;let r=Gs(e.uri),n=[];for(let[o,s]of this.orgs)s.workspaces.delete(r)&&s.workspaces.size===0&&n.push({org:o,probe:s.probeNwo});for(let{org:o,probe:s}of n)this.orgs.delete(o),await this.fetchSequencer.queue(o,()=>this.removeOrgCache(s))}async fetchAndCacheOrg(e,r){if(kt(this.ctx,ze.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await wq.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${pqt}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(Cw.join(o,l),Xvn(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return Cw.join(this.cacheRoot,ywe(e.owner),ywe(e.repo),ICn)}async fetchDetails(e){return this.client.getCustomAgentDetails(e.repo_owner,e.repo_name,e.name,e.version)}async writeIfChanged(e,r){let n=Buffer.from(r,"utf8");try{if((await wq.promises.stat(e)).size===n.length&&(await wq.promises.readFile(e)).equals(n))return}catch{}await wq.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await wq.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(pqt)&&!r.has(o.name))try{await wq.promises.unlink(Cw.join(e,o.name)),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed orphan ${o.name}`)}catch(s){this.logger.warn(this.ctx,`[OrgCustomAgentService] orphan unlink failed: ${String(s)}`)}}async removeOrgCache(e){let r=Cw.join(this.cacheRoot,ywe(e.owner),ywe(e.repo));try{await wq.promises.rm(r,{recursive:!0,force:!0}),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed cache for ${e.owner}/${e.repo}`)}catch(n){this.logger.warn(this.ctx,`[OrgCustomAgentService] failed to remove cache for ${e.owner}/${e.repo}: ${String(n)}`)}}},hqt=class extends xq{constructor(r){super();this.service=r}static{a(this,"OrgCustomAgentLifecycleListener")}isEnabled(){return Promise.resolve(!0)}isStarted(){return this.service._isActivated()}start(){this.service.activate()}async didAddWorkspace(r){await this.service._handleWorkspaceAdded(r)}async didRemoveWorkspace(r){await this.service._handleWorkspaceRemoved(r)}};p();var Eg=class{static{a(this,"PromptChangeNotifier")}},CKe=class extends Eg{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function wCn(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a(wCn,"createPromptFilesChangedEvent");function RCn(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(RCn,"createBatchPromptFilesChangedEvent");p();var Lc=class{constructor(){this._listeners=[];this._disposed=!1}static{a(this,"EventEmitter")}get event(){return(e,r,n)=>{if(this._disposed)throw new Error("EventEmitter is disposed");let o={listener:e,thisArgs:r};this._listeners.push(o);let s={dispose:a(()=>{let c=this._listeners.indexOf(o);c>=0&&this._listeners.splice(c,1)},"dispose")};return n&&n.push(s),s}}fire(e){if(this._disposed)return;let r=this._listeners.slice();for(let{listener:n,thisArgs:o}of r)try{n.call(o,e)}catch(s){console.error("Error in event listener:",s)}}dispose(){this._listeners.length=0,this._disposed=!0}};function Nue(...t){return(e,r,n)=>{let o=[];for(let c of t)o.push(c(e,r));let s={dispose:a(()=>{for(let c of o)c.dispose()},"dispose")};return n&&n.push(s),s}}a(Nue,"anyEvent");var NCn=require("os"),_we=fe(require("path"));function Mue(t){return t.replace(/\\/g,"/")}a(Mue,"toForwardSlash");function kCn(...t){return _we.default.posix.join(...t.map(Mue))}a(kCn,"globJoin");function N$o(t){let e=Mue(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(N$o,"containsTraversal");function PCn(t,e){let r=Mue(_we.default.posix.normalize(Mue(t))),n=Mue(_we.default.posix.normalize(Mue(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(PCn,"isContained");var DCn=["*","?","{","["],QA=class{constructor(e,r){this.ctx=e;this.logger=new pe("PromptFileLocationRegistry");this._onLocationsChanged=new Lc;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??NCn.homedir}static{a(this,"PromptFileLocationRegistry")}register(e,r,n={}){let o=n.watchable??!0,s=n.cacheable??!0,c=n.metadata,l=this.patterns.get(e);l||(l=[],this.patterns.set(e,l));let u=[];for(let d of r){if(N$o(d)){this.logger.warn(this.ctx,`Skipping pattern "${d}" because it contains a ".." segment; traversal is not allowed.`);continue}if(!l.some(f=>f.pattern===d)){let f=DCn.some(m=>d.includes(m)),h=n.classification??{storage:this.derivePatternStorage(d)};l.push({pattern:d,isGlob:f,watchable:o,cacheable:s,metadata:c,classification:h}),u.push(d)}}return u.length>0&&this.fireLocationsChanged(e),{dispose:a(()=>this.unregister(e,u),"dispose")}}replace(e,r,n,o={}){let s=this.patterns.get(r)?.length??0;this.suppressEvents++;try{e?.dispose()}finally{this.suppressEvents--}return n.length>0?this.register(r,n,o):((this.patterns.get(r)?.length??0){},"dispose")})}unregister(e,r){let n=this.patterns.get(e);if(!n)return;let o=new Set(r),s=n.length,c=n.filter(l=>!o.has(l.pattern));c.lengtho.watchable).map(o=>o.pattern):n.map(o=>o.pattern):[]}resolvePatterns(e,r,n){let o=this.patterns.get(e);if(!o)return[];let s=new Set,c=[],l=a((d,f,h)=>{s.has(d)||(s.add(d),c.push({pattern:d,isGlob:f,watchable:h.watchable,cacheable:h.cacheable,metadata:h.metadata,classification:h.classification}))},"addIfNew"),u=n?o.filter(d=>d.watchable):o;for(let d of u)if(d.pattern.startsWith("~/")){let f=this.getHomedir(),h=kCn(f,d.pattern.slice(2));if(!PCn(f,h))continue;l(h,d.isGlob,d)}else if(this.isAbsolutePattern(d.pattern))l(d.pattern,d.isGlob,d);else for(let f of r){let h=kCn(f,d.pattern);PCn(f,h)&&l(h,d.isGlob,d)}return c}clear(e){let r=this.patterns.get(e);r&&r.length>0&&(this.patterns.set(e,[]),this.fireLocationsChanged(e))}derivePatternStorage(e){return e.startsWith("~/")||this.isAbsolutePattern(e)?"user":"local"}isAbsolutePattern(e){let r=e.length;for(let o of DCn){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire(wCn(e,"ConfigChanged"))}};p();p();p();p();var vwe=fe(require("path"));function bw(t,e,r){let n=r?t:t.toLowerCase(),o=r?e:e.toLowerCase();if(n===o)return!0;let s=vwe.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!vwe.posix.isAbsolute(s)}a(bw,"isEqualOrParent");var nb=process.platform==="linux";function Rq(t){return t.replace(/\\/g,"/")}a(Rq,"normalizeSlashes");function vg(t){let e=Rq(t);return nb?e:e.toLowerCase()}a(vg,"canonicalKey");function lF(t){return vg(vwe.resolve(t))}a(lF,"canonicalPathKey");function MCn(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>nb?u:u.toLowerCase(),"toKey");for(let u of t){let d=r(u.path),f=e.get(d);if(!f){e.set(d,{path:u.path,type:u.type});continue}let h=f.type,m=u.type;h==="create"&&m==="delete"?e.delete(d):h==="delete"&&m==="create"?e.set(d,{path:u.path,type:"update"}):h==="create"&&m==="update"||e.set(d,{path:u.path,type:m})}let n=[...e.values()],o=n.filter(u=>u.type==="delete").sort((u,d)=>u.path.length-d.path.length),s=[],c=[];for(let u of o){let d=r(u.path);c.some(h=>d!==h&&bw(h,d,nb))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(MCn,"coalesceEvents");var bKe=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=Nue(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=Nue(this._parcel.onDidError,this._nodejs.onDidError)}static{a(this,"UniversalWatcher")}watch(e){if(this._disposed)throw new Error("UniversalWatcher: cannot watch after dispose");return e.recursive?this._parcel.watch(e):this._nodejs.watch(e)}async dispose(){this._disposed||(this._disposed=!0,await Promise.all([this._parcel.dispose(),this._nodejs.dispose()]))}};var uF=fe(require("fs"));var gJ=new pe("NodeJSWatcherService"),M$o=1e3,SKe=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new Lc;this.onDidChange=this._onDidChange.event;this._onDidError=new Lc;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??uF.watch,this._fsWatchFile=o??{watchFile:uF.watchFile,unwatchFile:uF.unwatchFile}}static{a(this,"NodeJSWatcherService")}watch(e){if(this._disposed)throw new Error("NodeJSWatcherService: cannot watch after dispose");if(e.recursive)throw new Error("NodeJSWatcherService: only supports non-recursive watches");let r=Rq(e.path),n=vg(r),o=this._entries.get(n);if(o)return o.refCount++,this._entryDisposable(n);let s=this.recursive?.subscribeToPath(r,u=>{this._onDidChange.fire([u])});if(s)return this._entries.set(n,{path:r,refCount:1,disposable:s}),this._entryDisposable(n);let l=this._isRegularFile(r)?this._startWatchFile(r):this._startFsWatch(r);return this._entries.set(n,{path:r,refCount:1,disposable:l}),this._entryDisposable(n)}dispose(){if(this._disposed)return Promise.resolve();this._disposed=!0;let e=[...this._entries.values()];this._entries.clear();for(let r of e)try{r.disposable.dispose()}catch(n){gJ.debug(this.ctx,"fs watcher dispose threw",r.path,n)}return this._onDidChange.dispose(),this._onDidError.dispose(),Promise.resolve()}_entryDisposable(e){let r=!1;return{dispose:a(()=>{if(r)return;r=!0;let n=this._entries.get(e);if(n&&(n.refCount--,n.refCount<=0)){this._entries.delete(e);try{n.disposable.dispose()}catch(o){gJ.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return uF.statSync(e).isFile()}catch{return!1}}_startFsWatch(e){let r;try{r=this._fsWatch(e,{recursive:!1},(n,o)=>{if(this._disposed)return;let s=o?B$o(e,Rq(o)):e,c=O$o(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),gJ.debug(this.ctx,"fs.watch error for",e,n))})}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),gJ.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){gJ.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=L$o(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:M$o},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),gJ.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){gJ.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function O$o(t,e){if(t==="change")return"update";try{return uF.statSync(e),"create"}catch{return"delete"}}a(O$o,"classify");function L$o(t,e){if(t.mtimeMs===0&&e.mtimeMs!==0)return"delete";if(t.mtimeMs!==0&&e.mtimeMs===0)return"create";if(t.mtimeMs!==e.mtimeMs)return"update"}a(L$o,"classifyStat");function B$o(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(B$o,"joinPosix");p();var hbn=fe(pbn()),mbn=require("os"),gbn=fe(require("path"));var wKe=new pe("ParcelWatcherService"),xVo=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",wVo=process.platform==="darwin"?[gbn.join((0,mbn.homedir)(),"Library","Containers")]:[],RKe=class{constructor(e,r){this.ctx=e;this._onDidChange=new Lc;this.onDidChange=this._onDidChange.event;this._onDidError=new Lc;this.onDidError=this._onDidError.event;this._roots=new Map;this._pendingShutdowns=new Set;this._disposed=!1;this._enospcNotified=!1;this._warnedPaths=new Set;this._subscribe=r??hbn.subscribe}static{a(this,"ParcelWatcherService")}watch(e){if(this._disposed)throw new Error("ParcelWatcherService: cannot watch after dispose");if(!e.recursive)throw new Error("ParcelWatcherService: only supports recursive watches");let r=Rq(e.path),n=vg(r),o=this._findCoveringRoot(r);if(o){let l={root:o};return o.handles.add(l),{dispose:a(()=>this._releaseHandle(l),"dispose")}}let s={path:r,handles:new Set,pathSubscribers:new Map};this._roots.set(n,s),this._startSubscription(s),this._foldChildrenIntoAfterSubscribed(s);let c={root:s};return s.handles.add(c),{dispose:a(()=>this._releaseHandle(c),"dispose")}}subscribeToPath(e,r){if(this._disposed)return;let n=Rq(e),o=this._findCoveringRoot(n);if(!o)return;let s=vg(n),c=o.pathSubscribers.get(s);return c||(c=new Set,o.pathSubscribers.set(s,c)),c.add(r),{dispose:a(()=>{let l=o.pathSubscribers.get(s);l&&(l.delete(r),l.size===0&&o.pathSubscribers.delete(s),this._maybeTearDown(o))},"dispose")}}async dispose(){if(this._disposed)return;this._disposed=!0;let e=[...this._roots.values()];for(this._roots.clear(),await Promise.all(e.map(async r=>{r.handles.clear(),r.pathSubscribers.clear(),await this._shutdownEntry(r)}));this._pendingShutdowns.size>0;){let r=[...this._pendingShutdowns];await Promise.allSettled(r)}this._onDidChange.dispose(),this._onDidError.dispose()}_findCoveringRoot(e){for(let r of this._roots.values())if(bw(r.path,e,nb))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&bw(e.path,o.path,nb)){for(let s of o.handles)s.root=e,e.handles.add(s);o.handles.clear();for(let[s,c]of o.pathSubscribers){let l=e.pathSubscribers.get(s);l||(l=new Set,e.pathSubscribers.set(s,l));for(let u of c)l.add(u)}o.pathSubscribers.clear(),this._roots.delete(n),r.push(o)}if(r.length!==0){try{await e.subscribing}catch{}for(let n of r)this._trackShutdown(n,"Shutdown of folded child failed for")}}_releaseHandle(e){let r=e.root;r.handles.delete(e),this._maybeTearDown(r)}_maybeTearDown(e){if(e.handles.size>0||e.pathSubscribers.size>0)return;let r=vg(e.path);this._roots.get(r)===e&&(this._roots.delete(r),this._trackShutdown(e,"Unsubscribe failed for"))}_trackShutdown(e,r){let n=this._shutdownEntry(e).catch(o=>{wKe.debug(this.ctx,r,e.path,o)});this._pendingShutdowns.add(n),n.finally(()=>this._pendingShutdowns.delete(n))}_startSubscription(e){let r=this._subscribe(e.path,(n,o)=>{if(!this._disposed){if(n){this._onWatchError(n,e.path);return}this._handleParcelEvents(e,o)}},{backend:xVo,ignore:wVo}).then(async n=>{if(e.subscribing=void 0,this._disposed||!this._rootStillActive(e)){await n.unsubscribe();return}return e.subscription=n,n}).catch(n=>{e.subscribing=void 0,this._onWatchError(n instanceof Error?n:new Error(String(n)),e.path)});e.subscribing=r}_rootStillActive(e){let r=vg(e.path);return this._roots.get(r)===e}async _shutdownEntry(e){let r=e.subscription;e.subscription=void 0;let n=e.subscribing;if(e.subscribing=void 0,r)await r.unsubscribe();else if(n){let o=await n;o&&await o.unsubscribe()}}_handleParcelEvents(e,r){if(r.length===0)return;let n=[];for(let s of r){let c=Rq(s.path);n.push({path:c,type:s.type})}let o=MCn(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=vg(s.path),l=e.pathSubscribers.get(c);if(l)for(let u of l)try{u(s)}catch(d){wKe.debug(this.ctx,"Path subscriber threw",s.path,d)}}}_onWatchError(e,r){if(this._disposed)return;let n=e.toString();if(wKe.debug(this.ctx,"Watcher error for",r,e),this._onDidError.fire({path:r,error:e}),n.includes("ENOSPC")&&!this._enospcNotified){this._enospcNotified=!0,this.ctx.get(ss).showWarningMessageOnlyOnce("parcelWatcher.enospc","Unable to watch for file changes in AI customization files. The inotify watch limit may have been reached. Please increase the limit by following the instructions at http://aka.ms/ghc-jetbrains-wiki/FAQ#resolving-the-enospc-file-watcher-error-on-linux");return}this._warnedPaths.has(r)||(this._warnedPaths.add(r),wKe.warn(this.ctx,"Failed to watch for file changes at",r,e))}};function kKe(t){let e=new RKe(t),r=new SKe(t,e);return new bKe(t,e,r)}a(kKe,"createUniversalWatcher");var Abn=fe(require("fs"));var kq=fe(require("path"));var RVo=100,PKe=/[*?{[]/,Tqt=class{constructor(e,r,n,o,s){this.request=e;this.watcher=r;this.registerDeferred=n;this.unregisterDeferred=o;this.statSync=s;this._disposed=!1;this._innerSubs=[];this.registerDeferred(this),this._tryActivate()}static{a(this,"DeferredWatchSubscription")}isPending(){return!this._disposed&&this._ancestorPath!==void 0}targetPath(){return this.request.path}handleEvent(e){if(!this._disposed){if(this._ancestorPath!==void 0){if(e.type!=="create"||!bw(e.path,this.request.path,nb)&&!bw(this.request.path,e.path,nb))return;this._tryActivate();return}e.type==="delete"&&bw(e.path,this.request.path,nb)&&this._tryActivate()}}dispose(){this._disposed||(this._disposed=!0,this.unregisterDeferred(this),this._ancestorPath=void 0,this._disposeInnerSubs())}_tryActivate(){if(this._disposed)return;let e=this._isDirectory(this.request.path);if(e||this._exists(this.request.path)){let c=[];if(c.push(this.watcher.watch(this.request)),e){let u=kq.dirname(this.request.path);u!==this.request.path&&this._isDirectory(u)&&c.push(this.watcher.watch({path:u,recursive:!1}))}let l=this._innerSubs;this._innerSubs=c,this._ancestorPath=void 0;for(let u of l)u.dispose();return}let n=kVo(this.request.path,this.statSync);if(n===void 0||PVo(n,this.request.path)){this._ancestorPath="",this._disposeInnerSubs();return}if(this._ancestorPath===n&&this._innerSubs.length>0)return;let o=this.watcher.watch({path:n,recursive:!1}),s=this._innerSubs;this._innerSubs=[o],this._ancestorPath=n;for(let c of s)c.dispose()}_exists(e){try{return this.statSync(e),!0}catch{return!1}}_isDirectory(e){try{return this.statSync(e).isDirectory()}catch{return!1}}_disposeInnerSubs(){let e=this._innerSubs;this._innerSubs=[];for(let r of e)r.dispose()}};function kVo(t,e){let r=kq.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=kq.dirname(r)}}a(kVo,"findExistingAncestor");function PVo(t,e){return kq.dirname(e)===t?!1:t===kq.parse(t).root}a(PVo,"isAncestorTooBroad");var DKe=class{constructor(e,r,n=Abn.statSync){this._onPromptFileChanged=new Lc;this.onPromptFileChanged=this._onPromptFileChanged.event;this._patterns=new Map;this._pendingChanges=[];this._pendingTypes=new Set;this._pendingKeys=new Set;this._disposed=!1;this._deferredSubs=new Set;this._watcher=r??kKe(e),this._ownsWatcher=r===void 0,this._statSync=n,this._subscriptionDisposable=this._watcher.onDidChange(o=>this._handleEvents(o))}static{a(this,"PromptFileWatcher")}watch(e,r,n){if(this._disposed)throw new Error("PromptFileWatcher: cannot watch after dispose");let o=Array.isArray(r)?r:[r],s=[],c=new Map,l=new Map;for(let d of o){let f=d.replace(/\\/g,"/");s.push(f),c.set(f,(c.get(f)??0)+1),!this._patterns.has(f)&&!l.has(f)&&l.set(f,this._toWatchRequest(f))}for(let[d,f]of c){let h=this._patterns.get(d);if(!h){let m=l.get(d),g=this._createDeferredSubscription(m),A=PKe.test(d)?m.path:void 0;h={refCountByType:new Map,matcher:new nv(d,{dot:!0}),subscription:g,baseDir:A},this._patterns.set(d,h)}h.refCountByType.set(e,(h.refCountByType.get(e)??0)+f)}n&&n.dispose();let u=!1;return{dispose:a(()=>{if(!u){u=!0;for(let d of s)this._decrementRefCount(d,e)}},"dispose")}}flush(){if(this._disposed||(this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),this._pendingChanges.length===0))return;let e=RCn([...this._pendingTypes],this._pendingChanges);this._pendingChanges=[],this._pendingTypes=new Set,this._pendingKeys=new Set,this._onPromptFileChanged.fire(e)}async dispose(){if(!this._disposed){this._disposed=!0,this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0);for(let e of this._patterns.values())e.subscription.dispose();this._patterns.clear(),this._subscriptionDisposable.dispose(),this._ownsWatcher&&await this._watcher.dispose(),this._onPromptFileChanged.dispose()}}_createDeferredSubscription(e){return new Tqt(e,this._watcher,r=>this._deferredSubs.add(r),r=>this._deferredSubs.delete(r),this._statSync)}_toWatchRequest(e){if(!PKe.test(e))return{path:e,recursive:!1,includes:[e]};let r=this._extractBaseDir(e),n=e.includes("**")||this._globSpansMultipleSegments(e);return{path:r,recursive:n,includes:[e]}}_globSpansMultipleSegments(e){let r=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));if(r<0)return!1;let n=e.slice(0,r);return PKe.test(n)}_extractBaseDir(e){let r=PKe.exec(e);if(!r)return kq.dirname(e);let n=e.slice(0,r.index),o=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));if(o<0)throw new Error(`PromptFileWatcher: pattern "${e}" has no base directory; expected an absolute path.`);let s=o>0?n.slice(0,o):n;if(/^[A-Za-z]:$/.test(s)&&n.length>s.length){let c=n[s.length];if(c==="/"||c==="\\")return`${s}${c}`}return s}_handleEvents(e){if(!this._disposed){if(this._deferredSubs.size>0)for(let r of e)for(let n of[...this._deferredSubs])n.handleEvent(r);for(let r of e){let n=this._mapEventType(r.type),o=!1;for(let c of this._patterns.values()){if(c.matcher.match(r.path)){for(let f of c.refCountByType.keys())this._pendingTypes.add(f);o=!0;continue}if(r.type!=="delete"||c.baseDir===void 0)continue;let l=c.baseDir,u=bw(r.path,l,nb),d=bw(l,r.path,nb);if(!(!u&&!d)){for(let f of c.refCountByType.keys())this._pendingTypes.add(f);o=!0}}if(!o)continue;let s=`${n}\0${r.path}`;this._pendingKeys.has(s)||(this._pendingKeys.add(s),this._pendingChanges.push({reason:n,path:r.path}))}this._pendingChanges.length>0&&this._scheduleFlush()}}_mapEventType(e){switch(e){case"create":return"FileCreated";case"update":return"FileChanged";case"delete":return"FileDeleted"}}_scheduleFlush(){this._debounceTimer!==void 0&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this.flush()},RVo)}_decrementRefCount(e,r){let n=this._patterns.get(e);if(!n)return;let o=n.refCountByType.get(r);o!==void 0&&(o<=1?n.refCountByType.delete(r):n.refCountByType.set(r,o-1),n.refCountByType.size===0&&(this._patterns.delete(e),n.subscription.dispose()))}};p();p();function Sw(t,e,...r){return e.replace(/\{(\d+)\}/g,(n,o)=>{let s=r[Number(o)];return s!==void 0?String(s):n})}a(Sw,"localize");function DVo(t,e=[],r={}){let o=new Iqt(t).scan();return new xqt(o,t,e,r).parse()}a(DVo,"parseRaw");function lh(t,e,r,n){return{type:t,startOffset:e,endOffset:r,rawValue:n?.rawValue??"",value:n?.value??"",format:n?.format??"none",indent:n?.indent??0}}a(lh,"makeToken");var Iqt=class{constructor(e){this.input=e;this.pos=0;this.tokens=[];this.flowDepth=0;this.seenBlockColon=!1;this.seenDocumentStart=0}static{a(this,"YamlScanner")}scan(e=1){for(;this.pose)););return this.tokens.push(lh(13,this.pos,this.pos)),this.tokens}scanLine(){if(this.seenBlockColon=!1,this.peekChar()===` `){this.tokens.push(lh(8,this.pos,this.pos+1)),this.pos++;return}if(this.peekChar()==="\r"){let n=this.pos+(this.input[this.pos+1]===` `?2:1);this.tokens.push(lh(8,this.pos,n)),this.pos=n;return}let e=this.pos,r=0;for(;this.pos0&&this.tokens.push(lh(9,e,this.pos,{indent:r})),this.pos>=this.input.length||this.peekChar()===` `||this.peekChar()==="\r"){if(this.pos`${n.path} ${n.message}`).join(` `&&this.input[n]!=="\r";)r++,n--;return r}scanComment(){let e=this.pos;for(;this.pos=this.input.length?!1:this.input[this.pos]==="\r"&&this.input[this.pos+1]===` `?(this.pos+=2,!0):this.input[this.pos]===` -`||this.input[this.pos]==="\r"?(this.pos++,!0):!1}peekChar(){return this.input[this.pos]}},Iqt=class{constructor(e,r,n,o){this.tokens=e;this.input=r;this.errors=n;this.options=o;this.pos=0}static{a(this,"YamlParser")}parse(){return this.skipNewlinesAndComments(),this.currentToken().type===11&&(this.advance(),this.skipNewlinesAndComments()),this.currentToken().type===13||this.currentToken().type===12?void 0:this.parseValue(-1)}currentToken(){return this.tokens[this.pos]}peek(e=0){return this.tokens[Math.min(this.pos+e,this.tokens.length-1)]}advance(){let e=this.tokens[this.pos];return e.type!==13&&this.pos++,e}expect(e){let r=this.currentToken();return r.type===e?this.advance():r}emitError(e,r,n,o){this.errors.push({message:e,startOffset:r,endOffset:n,code:o})}skipNewlinesAndComments(){for(;this.currentToken().type===8||this.currentToken().type===10||this.currentToken().type===9&&this.isFollowedByNewlineOrComment();)this.advance()}isFollowedByNewlineOrComment(){let e=this.peek(1);return e.type===8||e.type===10||e.type===13}currentIndent(){return this.currentToken().type===9?this.currentToken().indent:0}parseValue(e){this.skipNewlinesAndComments();let r=this.currentToken(),n=r.type===9?this.peek(1):r;if(n.type===4||n.type===6)return r.type===9&&this.advance(),n.type===4?this.parseFlowMap():this.parseFlowSeq();let o=this.currentIndent();if(this.peekPastIndent().type===2)return this.parseBlockSequence(o);if(this.looksLikeMapping())return this.parseBlockMapping(o);if(r.type===0||r.type===9)return this.parseScalar(e)}peekPastIndent(){return this.currentToken().type===9?this.peek(1):this.currentToken()}looksLikeMapping(){let e=0;return this.peek(e).type===9&&e++,this.peek(e).type===0&&(e++,this.peek(e).type===1)}parseScalar(e=-1){this.currentToken().type===9&&this.advance();let r=this.expect(0);return r.format!=="none"?this.scalarFromToken(r):this.parsePlainMultiline(r,e)}parsePlainMultiline(e,r){let n=e.value,o=e.endOffset;for(;;){let s=this.pos,c=0,l=!1;for(;this.posr){l=!0;break}else break}if(f.type===13||f.type===11||f.type===12)break;if(r<0){l=!0;break}break}if(d.type===9)break;break}if(!l){this.pos=s;break}if(this.currentToken().type===9&&this.advance(),this.currentToken().type!==0){if(this.currentToken().type===2){let d=this.advance(),f="-";if(this.currentToken().type===0){let h=this.advance();f="- "+h.value,o=h.endOffset}else o=d.endOffset;c>0?n+=` +`||this.input[this.pos]==="\r"?(this.pos++,!0):!1}peekChar(){return this.input[this.pos]}},xqt=class{constructor(e,r,n,o){this.tokens=e;this.input=r;this.errors=n;this.options=o;this.pos=0}static{a(this,"YamlParser")}parse(){return this.skipNewlinesAndComments(),this.currentToken().type===11&&(this.advance(),this.skipNewlinesAndComments()),this.currentToken().type===13||this.currentToken().type===12?void 0:this.parseValue(-1)}currentToken(){return this.tokens[this.pos]}peek(e=0){return this.tokens[Math.min(this.pos+e,this.tokens.length-1)]}advance(){let e=this.tokens[this.pos];return e.type!==13&&this.pos++,e}expect(e){let r=this.currentToken();return r.type===e?this.advance():r}emitError(e,r,n,o){this.errors.push({message:e,startOffset:r,endOffset:n,code:o})}skipNewlinesAndComments(){for(;this.currentToken().type===8||this.currentToken().type===10||this.currentToken().type===9&&this.isFollowedByNewlineOrComment();)this.advance()}isFollowedByNewlineOrComment(){let e=this.peek(1);return e.type===8||e.type===10||e.type===13}currentIndent(){return this.currentToken().type===9?this.currentToken().indent:0}parseValue(e){this.skipNewlinesAndComments();let r=this.currentToken(),n=r.type===9?this.peek(1):r;if(n.type===4||n.type===6)return r.type===9&&this.advance(),n.type===4?this.parseFlowMap():this.parseFlowSeq();let o=this.currentIndent();if(this.peekPastIndent().type===2)return this.parseBlockSequence(o);if(this.looksLikeMapping())return this.parseBlockMapping(o);if(r.type===0||r.type===9)return this.parseScalar(e)}peekPastIndent(){return this.currentToken().type===9?this.peek(1):this.currentToken()}looksLikeMapping(){let e=0;return this.peek(e).type===9&&e++,this.peek(e).type===0&&(e++,this.peek(e).type===1)}parseScalar(e=-1){this.currentToken().type===9&&this.advance();let r=this.expect(0);return r.format!=="none"?this.scalarFromToken(r):this.parsePlainMultiline(r,e)}parsePlainMultiline(e,r){let n=e.value,o=e.endOffset;for(;;){let s=this.pos,c=0,l=!1;for(;this.posr){l=!0;break}else break}if(f.type===13||f.type===11||f.type===12)break;if(r<0){l=!0;break}break}if(d.type===9)break;break}if(!l){this.pos=s;break}if(this.currentToken().type===9&&this.advance(),this.currentToken().type!==0){if(this.currentToken().type===2){let d=this.advance(),f="-";if(this.currentToken().type===0){let h=this.advance();f="- "+h.value,o=h.endOffset}else o=d.endOffset;c>0?n+=` `.repeat(c):n+=" ",n+=f;continue}this.pos=s;break}if(this.peek(1).type===1){this.pos=s;break}let u=this.advance();c>0?n+=` `.repeat(c):n+=" ",n+=u.value,o=u.endOffset}return{type:"scalar",value:n,rawValue:this.input.substring(e.startOffset,o),startOffset:e.startOffset,endOffset:o,format:"none"}}parseBlockMapping(e,r=!1){let n=this.currentToken().startOffset,o=[],s=new Set;if(r){let l=this.parseMappingEntry(e);l&&(s.add(l.key.value),o.push(l))}for(;this.currentToken().type!==13&&(this.skipNewlinesAndComments(),this.currentToken().type!==13);){let l=this.currentIndent();if(le)this.emitError(Sw("unexpectedIndentation","Unexpected indentation (expected {0}, got {1})",e,l),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-indentation");else break;if(!this.looksLikeMapping())break;let u=this.parseMappingEntry(e);if(!u)break;!this.options.allowDuplicateKeys&&s.has(u.key.value)&&this.emitError(Sw("duplicateKey",'Duplicate key: "{0}"',u.key.value),u.key.startOffset,u.key.endOffset,"duplicate-key"),s.add(u.key.value),o.push(u)}let c=o.length>0?o[o.length-1].value.endOffset:n;return{type:"map",properties:o,style:"block",startOffset:n,endOffset:c}}parseMappingEntry(e){this.currentToken().type===9&&this.advance();let r=this.expect(0),n=this.scalarFromToken(r),o=this.expect(1);if(o.type!==1){this.emitError(Sw("expectedColon",'Expected ":"'),o.startOffset,o.endOffset,"expected-colon");return}let s=this.parseMappingValue(e,o);return{key:n,value:s}}parseMappingValue(e,r){let n=this.currentToken();if(n.type===4)return this.parseFlowMap();if(n.type===6)return this.parseFlowSeq();if(n.type===0){this.currentToken().type===9&&this.advance();let c=this.advance();return c.format!=="none"?this.scalarFromToken(c):this.parsePlainMultiline(c,e)}if(this.skipNewlinesAndComments(),this.currentToken().type===13)return this.emitError(Sw("missingValue","Missing value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset);let s=this.currentIndent();return s===e&&this.peekPastIndent().type===2?this.parseValue(e)??this.makeEmptyScalar(r.endOffset):s<=e?(this.emitError(Sw("missingValue","Missing value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.parseValue(e)??this.makeEmptyScalar(r.endOffset)}parseBlockSequence(e){let r=[],n=this.currentToken().startOffset,o=n,s=!0;for(;this.currentToken().type!==13&&(this.skipNewlinesAndComments(),this.currentToken().type!==13);){let c;if(s&&this.currentToken().type===2?c=this.currentToken().startOffset-this.getLineStart(this.currentToken().startOffset):c=this.currentIndent(),s=!1,ce)this.emitError(Sw("unexpectedIndentation","Unexpected indentation (expected {0}, got {1})",e,c),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-indentation");else break;if(this.peekPastIndent().type!==2)break;this.currentToken().type===9&&this.advance();let u=this.advance(),d=this.parseSequenceItemValue(e,u);r.push(d),o=d.endOffset}return{type:"sequence",items:r,style:"block",startOffset:n,endOffset:o}}parseSequenceItemValue(e,r){let n=this.currentToken();if(n.type===10&&this.advance(),n.type===4)return this.parseFlowMap();if(n.type===6)return this.parseFlowSeq();if(n.type===2){let s=n.startOffset-this.getLineStart(n.startOffset);return this.parseBlockSequence(s)}if(n.type===0){if(this.peek(1).type===1){let s=n.startOffset-this.getLineStart(n.startOffset);return this.parseBlockMapping(s,!0)}return this.parseScalar(e)}return this.skipNewlinesAndComments(),this.currentToken().type===13?(this.emitError(Sw("missingSeqItemValue","Missing sequence item value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.currentIndent()<=e?(this.emitError(Sw("missingSeqItemValue","Missing sequence item value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.parseValue(e)??this.makeEmptyScalar(r.endOffset)}getLineStart(e){let r=e-1;for(;r>=0&&this.input[r]!==` -`&&this.input[r]!=="\r";)r--;return r+1}parseFlowMap(){let e=this.advance(),r=[];for(this.skipFlowWhitespace();this.currentToken().type!==5&&this.currentToken().type!==13;){let o;if(this.currentToken().type===0)o=this.parseFlowScalar();else{this.emitError(Sw("expectedMappingKey","Expected mapping key"),this.currentToken().startOffset,this.currentToken().endOffset,"expected-key");break}this.skipFlowWhitespace();let s;this.currentToken().type===1?(this.advance(),this.skipFlowWhitespace(),s=this.parseFlowValue()):s=this.makeEmptyScalar(o.endOffset),r.push({key:o,value:s}),this.skipFlowWhitespace(),this.currentToken().type===3&&(this.advance(),this.skipFlowWhitespace())}let n=this.currentToken();return n.type===5?this.advance():this.emitError(Sw("expectedFlowMapEnd",'Expected "}"'),n.startOffset,n.endOffset,"expected-flow-map-end"),{type:"map",properties:r,style:"flow",startOffset:e.startOffset,endOffset:n.type===5?n.endOffset:n.startOffset}}parseFlowSeq(){let e=this.advance(),r=[];for(this.skipFlowWhitespace();this.currentToken().type!==7&&this.currentToken().type!==13;){let o;if(this.currentToken().type===4)o=this.parseFlowMap();else if(this.currentToken().type===6)o=this.parseFlowSeq();else if(this.currentToken().type===0)o=this.parseFlowScalar();else{this.emitError(Sw("unexpectedTokenInFlowSeq","Unexpected token in flow sequence"),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-token"),this.advance();continue}r.push(o),this.skipFlowWhitespace(),this.currentToken().type===3&&(this.advance(),this.skipFlowWhitespace())}let n=this.currentToken();return n.type===7?this.advance():this.emitError(Sw("expectedFlowSeqEnd",'Expected "]"'),n.startOffset,n.endOffset,"expected-flow-seq-end"),{type:"sequence",items:r,style:"flow",startOffset:e.startOffset,endOffset:n.type===7?n.endOffset:n.startOffset}}parseFlowScalar(){let e=this.advance();if(e.format!=="none")return this.scalarFromToken(e);let r=e.value,n=e.endOffset;for(;;){let o=!1,s=this.pos;for(;s=this.tokens.length)break;let c=this.tokens[s];if(c.type===0&&c.format==="none")this.pos=s+1,r+=" "+c.value,n=c.endOffset;else break}return{type:"scalar",value:r,rawValue:this.input.substring(e.startOffset,n),startOffset:e.startOffset,endOffset:n,format:"none"}}parseFlowValue(){return this.currentToken().type===4?this.parseFlowMap():this.currentToken().type===6?this.parseFlowSeq():this.currentToken().type===0?this.parseFlowScalar():this.makeEmptyScalar(this.currentToken().startOffset)}skipFlowWhitespace(){for(;;){let e=this.currentToken().type;if(e===8||e===9||e===10)this.advance();else break}}scalarFromToken(e){return{type:"scalar",value:e.value,rawValue:e.rawValue,startOffset:e.startOffset,endOffset:e.endOffset,format:e.format}}makeEmptyScalar(e){return{type:"scalar",value:"",rawValue:"",startOffset:e,endOffset:e,format:"none"}}};function Abn(t,e=[],r={}){let n=[],o=kVo(t,n,r),s=PVo(t);for(let c of n)e.push({message:c.message,code:c.code,start:HO(s,c.startOffset),end:HO(s,c.endOffset)});return o===void 0?void 0:xqt(s,o)}a(Abn,"parse");function PVo(t){let e=[0];for(let r=0;r=this.tokens.length)break;let c=this.tokens[s];if(c.type===0&&c.format==="none")this.pos=s+1,r+=" "+c.value,n=c.endOffset;else break}return{type:"scalar",value:r,rawValue:this.input.substring(e.startOffset,n),startOffset:e.startOffset,endOffset:n,format:"none"}}parseFlowValue(){return this.currentToken().type===4?this.parseFlowMap():this.currentToken().type===6?this.parseFlowSeq():this.currentToken().type===0?this.parseFlowScalar():this.makeEmptyScalar(this.currentToken().startOffset)}skipFlowWhitespace(){for(;;){let e=this.currentToken().type;if(e===8||e===9||e===10)this.advance();else break}}scalarFromToken(e){return{type:"scalar",value:e.value,rawValue:e.rawValue,startOffset:e.startOffset,endOffset:e.endOffset,format:e.format}}makeEmptyScalar(e){return{type:"scalar",value:"",rawValue:"",startOffset:e,endOffset:e,format:"none"}}};function ybn(t,e=[],r={}){let n=[],o=DVo(t,n,r),s=NVo(t);for(let c of n)e.push({message:c.message,code:c.code,start:HO(s,c.startOffset),end:HO(s,c.endOffset)});return o===void 0?void 0:wqt(s,o)}a(ybn,"parse");function NVo(t){let e=[0];for(let r=0;r>1;t[s]<=e?(o=s,r=s+1):n=s-1}return{line:o,character:e-t[o]}}a(HO,"offsetToPosition");function xqt(t,e){switch(e.type){case"scalar":return DVo(t,e);case"sequence":return{type:"array",items:e.items.map(r=>xqt(t,r)),start:HO(t,e.startOffset),end:HO(t,e.endOffset)};case"map":return{type:"object",properties:e.properties.map(r=>({key:NVo(t,r.key),value:xqt(t,r.value)})),start:HO(t,e.startOffset),end:HO(t,e.endOffset)}}}a(xqt,"convertNode");function DVo(t,e){let r=HO(t,e.startOffset),n=HO(t,e.endOffset);if(e.format==="none"){let o=e.value;if(o==="true")return{type:"boolean",value:!0,start:r,end:n};if(o==="false")return{type:"boolean",value:!1,start:r,end:n};if(o==="null"||o==="~")return{type:"null",value:null,start:r,end:n};if(o!==""&&/^-?\d*\.?\d+$/.test(o)){let s=Number(o);if(!isNaN(s)&&isFinite(s))return{type:"number",value:s,start:r,end:n}}}return{type:"string",value:e.value,start:r,end:n}}a(DVo,"convertScalar");function NVo(t,e){return{type:"string",value:e.value,start:HO(t,e.startOffset),end:HO(t,e.endOffset)}}a(NVo,"convertScalarAsString");var f2=fe(uh());var GO=class{static{a(this,"PromptsParser")}constructor(){}parse(e,r){let n=this.#t(r);if(n.length===0)return new OKe(e,void 0,void 0);let o,s,c=0;if(n[0].match(/^---[\s\r\n]*$/)){let l=n.findIndex((d,f)=>f>0&&d.match(/^---[\s\r\n]*$/));l===-1?(l=n.length,c=n.length):c=l+1;let u=new f2.Range(2,1,l+1,1);o=new kqt(u,n),this.#e(o,n)}if(cs>0&&o.match(/^---[\s\r\n]*$/))||e.pushError({message:"Missing closing `---` delimiter for frontmatter",range:e.range,code:"MISSING_CLOSING_DELIMITER"})}#t(e){let r=[],n=e.split(/(\r\n|\r|\n)/);for(let o=0;o({message:c.message,range:this.asRange(c),code:c.code}));if(n)if(n.type!=="object")s.push({message:"Invalid header, expecting pairs",range:this.range,code:"INVALID_YAML"});else for(let c of n.properties)o.push({key:c.key.value,range:this.asRange({start:c.key.start,end:c.value.end}),value:this.asValue(c.value)});this._parsed={node:n,attributes:o,errors:s}}return this._parsed}asRange({start:e,end:r}){return new f2.Range(this.range.startLineNumber+e.line,e.character+1,this.range.startLineNumber+r.line,r.character+1)}asValue(e){switch(e.type){case"string":return{type:"string",value:e.value,range:this.asRange(e)};case"number":return{type:"number",value:e.value,range:this.asRange(e)};case"boolean":return{type:"boolean",value:e.value,range:this.asRange(e)};case"null":return{type:"null",value:e.value,range:this.asRange(e)};case"array":return{type:"array",items:e.items.map(r=>this.asValue(r)),range:this.asRange(e)};case"object":return{type:"object",properties:e.properties.map(n=>({key:this.asValue(n.key),value:this.asValue(n.value)})),range:this.asRange(e)}}}get attributes(){return this._parsedHeader.attributes}getAttribute(e){return this._parsedHeader.attributes.find(r=>r.key===e)}get errors(){return this._parsedHeader.errors}pushError(e){this._parsedHeader.errors.unshift(e)}getStringAttribute(e){let r=this._parsedHeader.attributes.find(n=>n.key===e);if(r?.value.type==="string")return r.value.value}get name(){return this.getStringAttribute("name")}get description(){return this.getStringAttribute("description")}get agent(){return this.getStringAttribute("agent")??this.getStringAttribute("mode")}get model(){return this.getStringAttribute("model")}get applyTo(){return this.getStringAttribute("applyTo")}get invokePolicy(){let e=this._parsedHeader.attributes.find(r=>r.key===OVo);if(e?.value.type==="array"){let r=[];for(let n of e.value.items)n.type==="string"&&n.value&&r.push(n.value);return r}}get tools(){let e=this._parsedHeader.attributes.find(r=>r.key==="tools");if(e){if(e.value.type==="array"){let r=[];for(let n of e.value.items)n.type==="string"&&n.value&&r.push(n.value);return r}else if(e.value.type==="object"){let r=[],n=a(({key:o,value:s})=>{s.type==="boolean"?r.push(o.value):s.type==="object"&&s.properties.forEach(n)},"collectLeafs");return e.value.properties.forEach(n),r}}}get handOffs(){let e=this._parsedHeader.attributes.find(r=>r.key==="handoffs");if(e&&e.value.type==="array"){let r=[];for(let n of e.value.items)if(n.type==="object"){let o,s,c,l;for(let u of n.properties)u.key.value==="agent"&&u.value.type==="string"?o=u.value.value:u.key.value==="label"&&u.value.type==="string"?s=u.value.value:u.key.value==="prompt"&&u.value.type==="string"?c=u.value.value:u.key.value==="send"&&u.value.type==="boolean"&&(l=u.value.value);o&&s&&c!==void 0&&r.push({agent:o,label:s,prompt:c,send:l})}return r}}},Pqt=class{constructor(e,r,n){this.range=e;this.linesWithEOL=r;this.uri=n}static{a(this,"PromptBody")}get fileReferences(){return this.getParsedBody().fileReferences}get variableReferences(){return this.getParsedBody().variableReferences}get offset(){return this.getParsedBody().bodyOffset}getParsedBody(){if(this._parsed===void 0){let e=[],r=[],n=[],o=this.linesWithEOL.slice(0,this.range.startLineNumber-1).reduce((s,c)=>c.length+s,0);for(let s=this.range.startLineNumber-1,c=o;sf2.Range.areIntersectingOrTouching(A,m)))continue;let g=h[1];if(g){if(g==="file:"){let A=h.index+h[0].length-h[2].length,y=h.index+h[0].length,_=new f2.Range(s+1,A+1,s+1,y+1);r.push({content:h[2],range:_,isMarkdownLink:!1})}}else{let A=h.index+1,y=h.index+h[0].length,_=new f2.Range(s+1,A+1,s+1,y+1);n.push({name:h[2],range:_,offset:c+h.index})}}c+=l.length}this._parsed={fileReferences:r.sort((s,c)=>f2.Range.compareRangesUsingStarts(s.range,c.range)),variableReferences:n,bodyOffset:o}}return this._parsed}get content(){return this._content===void 0&&(this._content=this.linesWithEOL.slice(this.range.startLineNumber-1,this.range.endLineNumber-1).join("").trim()),this._content}};p();p();function AJ(t){let e=new Set;for(let r of t??[]){let n=r.hookSource;(n==="copilot"||n==="claude")&&e.add(n)}return e.size===1?e.values().next().value:void 0}a(AJ,"getHookSource");var BVo=new Set(["sessionStart","sessionEnd","agentStop","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),_bn="agentHook.event.load";function FVo(t,e){ft(t,_bn);let r={};for(let[n,o]of Object.entries(e))o!==void 0&&(r[`${n}.hookCount`]=String(o.length));sr(t,_bn,r)}a(FVo,"recordHookLoadTelemetry");var Dqt=class{constructor(){this.logger=new pe("CopilotHookParser")}static{a(this,"CopilotHookParser")}parse(e,r,n){let o=JSON.parse(n);if(o.version!==1)throw new Error(`Unsupported hooks config version: ${String(o.version)}`);if(o.hooks===void 0||typeof o.hooks!="object"||o.hooks===null)throw new Error("Invalid or missing hooks section");let s=o,c={};for(let[l,u]of Object.entries(s.hooks)){if(!this.isValidEventType(l)){this.logger.warn(e,`Invalid event type: ${l} in ${r}`);continue}let d=Array.isArray(u)?u:[],f=[];for(let h of d)this.isValidHook(h)?f.push(h):this.logger.warn(e,`Invalid hook configuration in ${r}: ${JSON.stringify(h)}`);c[l]=f}return FVo(e,c),{uri:r,version:1,hooks:c}}isValidEventType(e){return BVo.has(e)}isValidHook(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="command"&&("bash"in e&&typeof e.bash=="string"||"powershell"in e&&typeof e.powershell=="string")}},Nqt=class{constructor(){this.logger=new pe("ClaudeHookParser")}static{a(this,"ClaudeHookParser")}parse(e,r,n){let o=JSON.parse(n);if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Invalid Claude hooks configuration");let s=o;if(s.disableAllHooks===!0)return{uri:r,version:1,hooks:{}};if(!s.hooks||typeof s.hooks!="object"||Array.isArray(s.hooks))return{uri:r,version:1,hooks:{}};let c={};for(let[l,u]of Object.entries(s.hooks)){if(!Array.isArray(u)){this.logger.warn(e,`Invalid Claude hook event configuration in ${r}: ${l}`);continue}let d=[];for(let f of u){if(!f||typeof f!="object"||Array.isArray(f)){this.logger.warn(e,`Invalid Claude hook group for ${l} in ${r}: expected an object`);continue}let h=f;if(Array.isArray(h.hooks))for(let m of h.hooks)this.isExternalHandler(m)?d.push({type:"command"}):this.logger.warn(e,`Invalid Claude hook handler for ${l} in ${r}: missing or invalid type`);else this.isExternalHandler(h)?d.push({type:"command"}):this.logger.warn(e,`Invalid Claude hook group for ${l} in ${r}: hooks must be an array`)}d.length>0&&(c[l]=d)}return{uri:r,version:1,hooks:c}}isExternalHandler(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"type"in e&&typeof e.type=="string"}},LKe=class{constructor(e=new Dqt,r=new Nqt){this.copilotParser=e;this.claudeParser=r}static{a(this,"HookParser")}parse(e,r,n,o){let s=AJ(o);if(s===void 0)throw new Error(`Missing or conflicting hook source metadata for ${r}`);return(s==="copilot"?this.copilotParser:this.claudeParser).parse(e,r,n,o)}};p();var Ebn=require("os");var UVo=(0,Ebn.platform)()==="win32",up=class{constructor(){this.trustByUri=new Map;this.emitter=new Ji;this.onDidChangeTrust=this.emitter.event;this.capabilityEnabled=!1}static{a(this,"WorkspaceTrustService")}setCapabilityEnabled(e){this.capabilityEnabled=e}setTrust(e,r){let n=this.normalizeKey(e),o=this.trustByUri.get(n);if(this.trustByUri.set(n,r),o===r)return;let s=`${n}/`,c=[];for(let l of this.trustByUri.keys())l.startsWith(s)&&c.push(l);for(let l of c)this.trustByUri.delete(l);this.emitter.fire({folderUri:n,trusted:r});for(let l of c)this.emitter.fire({folderUri:l,trusted:this.isTrustedInternal(l)})}forget(e){let r=this.normalizeKey(e);this.trustByUri.delete(r)&&this.emitter.fire({folderUri:r,trusted:this.isTrustedInternal(r)})}isTrusted(e){return this.capabilityEnabled?this.isTrustedInternal(this.normalizeKey(e)):!0}isTrustedInternal(e){let r=e.indexOf("://"),n=r>=0?r+3:0,o=e;for(;o.length>n;){let s=this.trustByUri.get(o);if(s!==void 0)return s;let c=o.lastIndexOf("/");if(cthis.handleChange(f));for(let f of Mqt)this.rewatch(f);this.registrySubscription=o.onLocationsChanged(f=>{for(let h of f.affectedTypes)this.rewatch(h)});let c=a(f=>{this.evictFolder(f),this.rewatchAll()},"onWorkspaceRemoved"),l=a(()=>{this.rewatchAll()},"onWorkspaceAdded");this.workspaceListener=new class extends xq{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(f){c(f)}},e.get(dT).addListener(this.workspaceListener);let u,d=a(()=>{let f=u;if(u=void 0,!(!f||this.disposed)){for(let h of f)this.evictFolder({uri:h});this.rewatchAll();for(let h of Mqt)this.notifyChange(h)}},"flushPending");this.trustSubscription=e.get(up).onDidChangeTrust(f=>{u===void 0&&(u=new Set,queueMicrotask(d)),u.add(f.folderUri)})}static{a(this,"PromptService")}async collect(e,r,n,o){let s=e.get(up),c=n.filter(h=>s.isTrusted(h.uri)),l=await this.fileLocator.listFiles(e,c,r),u=o?.includePlugins?l:l.filter(h=>h.classification.storage!=="plugin"),f=(await Promise.all(u.map(h=>this.resolveEntry(e,r,h)))).filter(h=>h!==void 0);return o?.includePlugins?f:f.filter(h=>h.promptPath.storage!=="plugin")}async resolveEntry(e,r,n){let o=vbn(r,n.uri);if(n.cacheable){let l=this.entryCache.get(o);if(l){let d=await this.fsMtime(e,n.uri);if(d!==void 0&&d===l.timestamp)return l.entry;this.invalidateKey(o)}let u=this.parseInflight.get(o);if(u)return u}let s=this.buildPromptPath(r,n),c=this.parseOne(e,s).then(l=>{if(l===void 0)return;let u={promptPath:s,parsedPromptFile:l};return n.cacheable&&!this.disposed&&this.parseInflight.get(o)===c&&this.entryCache.set(o,{entry:u,timestamp:n.timestamp}),u});return n.cacheable&&(this.parseInflight.set(o,c),c.finally(()=>{this.parseInflight.get(o)===c&&this.parseInflight.delete(o)})),c}async fsMtime(e,r){try{return(await e.get(Go).stat(r)).mtime}catch{return}}buildPromptPath(e,r){let{classification:n}=r;return n.storage==="plugin"?{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata,name:n.pluginInfo.name,description:n.pluginInfo.description,pluginUri:n.pluginInfo.pluginUri}:n.storage==="extension"||n.storage==="clsAssets"?{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata,name:n.extensionInfo.name,description:n.extensionInfo.description,extensionId:n.extensionInfo.extensionId}:{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata}}async dispose(){if(!this.disposed){this.disposed=!0,this.registrySubscription.dispose(),this.mergedChangeSubscription.dispose(),this.trustSubscription.dispose();try{this.ctx.get(dT).removeListener(this.workspaceListener)}catch{}for(let e of this.watchHandles.values())e.dispose();this.watchHandles.clear(),this.entryCache.clear(),this.parseInflight.clear(),this.ownsWatcher&&await this.watcher.dispose()}}async parseOne(e,r){let n=this.parsers.get(r.type);if(!n){this.logger.warn(e,`No parser registered for type ${r.type} (uri: ${r.uri})`);return}try{return await n.parse(e,r.uri,await e.get(Go).readFileString(r.uri),r.metadata)}catch(o){this.logger.warn(e,`Failed to parse ${r.type} file ${r.uri}:`,o);return}}handleChange(e){let r=new Set,n=!1;for(let o of e.changes)o.path?r.add(o.path):n=!0;for(let o of e.affectedTypes){if(n)this.clearType(o);else for(let s of r)this.invalidateKey(vbn(o,Ko(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(_g).notify(e).catch(r=>{this.logger.warn(this.ctx,`PromptChangeNotifier.notify(${e}) failed:`,r)})}catch(r){this.logger.warn(this.ctx,`PromptChangeNotifier.notify(${e}) failed:`,r)}}invalidateKey(e){this.entryCache.delete(e),this.parseInflight.delete(e)}clearType(e){let r=QVo(e),n=new Set;for(let o of this.entryCache.keys())o.startsWith(r)&&n.add(o);for(let o of this.parseInflight.keys())o.startsWith(r)&&n.add(o);for(let o of n)this.invalidateKey(o)}rewatch(e){if(this.disposed)return;let r=this.ctx.get(QA),n=this.currentWorkspacePaths(),o=r.resolvePatterns(e,n,!0).map(l=>l.pattern),s=this.watchHandles.get(e);if(o.length===0){s&&(s.dispose(),this.watchHandles.delete(e));return}let c=this.watcher.watch(e,o,s);this.watchHandles.set(e,c)}rewatchAll(){for(let e of Mqt)this.rewatch(e)}evictFolder(e){let r=e.uri.endsWith("/")?e.uri:`${e.uri}/`;for(let[n,o]of this.entryCache){let s=o.entry.promptPath.uri;(s===e.uri||s.startsWith(r))&&this.invalidateKey(n)}}currentWorkspacePaths(){let e;try{let o=this.ctx.get(up);e=this.ctx.get($r).getWorkspaceFolders().filter(s=>o.isTrusted(s.uri)).map(s=>un(s.uri))}catch{return[]}let r=e.map(o=>({raw:o,normalized:o.replace(/\\/g,"/")})).sort((o,s)=>o.normalized.length-s.normalized.length),n=[];for(let o of r)n.some(s=>bw(s.normalized,o.normalized,nb))||n.push(o);return n.map(o=>o.raw)}};p();var eu=class{constructor(){this.policyChangeEmitter=new Lc;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},BKe=class extends eu{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var Oqt=64;var dF=(r=>(r.enabled="enabled",r.disabled="disabled",r))(dF||{}),_0={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},dp={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},yJ=class{static{a(this,"LanguageModelTool")}constructor(e){this.type=e.type,this.toolProvider=e.toolProvider,this.name=e.name,this.displayName=e.displayName??this.name,this.description=e.description,this.displayDescription=e.displayDescription??this.description,this.inputSchema=e.inputSchema,this.annotations=e.annotations,this.id=`${this.toolProvider.id}.${this.name}`,this.nameForModel=(this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.displayNamePrefix??this.toolProvider.id}_${this.name}`).replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,Oqt),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},Nq=class extends yJ{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},Or=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},Mq=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},_J=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};var Gr=class{static{a(this,"LanguageModelToolResult")}constructor(e,r){this.status=r,this.content=e}},Oq=class extends Gr{static{a(this,"ExtendedLanguageModelToolResult")}},Cbn=b.Object({content:b.Array(b.Union([b.Object({value:b.String()}),b.Object({value:b.Unknown()})])),status:b.Optional(b.Union([b.Literal("success"),b.Literal("error"),b.Literal("cancelled")]))}),fF=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(fF||{}),bbn=b.Object({result:b.Enum(fF)});var Lqt=fe(require("fs"));var xwe=fe(require("path"));var Fqt=["user","model"],Uqt="source",Qqt={githubOrg:"github-org"},ICn={githubOrg:{[Uqt]:Qqt.githubOrg}},Bqt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._id=n.uri;let o=n.header?.name?.trim()||void 0;this._name=r.name??o??ro(n.uri).replace(/\.(agent\.)?md$/i,"")}static{a(this,"CustomAgent")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get id(){return this._id}get name(){return this._name}get description(){return this.parsedPromptFile.header?.description}get tools(){return this.parsedPromptFile.header?.tools}get model(){return this.parsedPromptFile.header?.model}get handOffs(){return this.parsedPromptFile.header?.handOffs}get instruction(){return this.parsedPromptFile.body?.content}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||Oue(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??Fqt}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get pluginUri(){return Dq(this.promptFileEntry.promptPath)}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(Qqt));for(let n of e){let o=n[Uqt];if(typeof o=="string"&&r.has(o))return o}}get providers(){return c2(this.promptFileEntry.promptPath.metadata)}},Sbn="./assets/prompts.contributions.json",Ibn="CVE Remediator",qVo="Debugger",Tbn=new Map([[Ibn,"cveRemediatorAgent"],[qVo,"debuggerAgent"]]),jVo=new Map([[Ibn,["LOCAL"]]]),Yd=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new pe("CustomAgentService");this.agentUpdateSequencer=new _w;this.extensionAgents=new Map;this.agentsByExtension=new Map;this.agentFileLocationsPatterns=[];this.runtimeSources=[];this.gateSubscriptions=[];this.lastGatedCapabilities={};this.syncRegistry(),this.registerClaudeAgentPatterns(),this.ready=this.loadAssetsContributions(e),this.subscribeToGateChanges()}static{a(this,"CustomAgentService")}static{this.DEFAULT_AGENT_REGISTRATIONS=[".github/agents/**/*.agent.md",".claude/agents/**/*.agent.md","~/.copilot/agents/**/*.agent.md"]}static{this.AGENT_GLOB_SUFFIX="**/*.agent.md"}static{this.CLAUDE_AGENT_PATTERNS=[".claude/agents/**/*.md","~/.claude/agents/**/*.md"]}registerClaudeAgentPatterns(){this.promptFileLocationRegistry.register("agent",[...t.CLAUDE_AGENT_PATTERNS],{metadata:{providers:["CLAUDE"]}})}registerRuntimeAgentSource(e){return this.runtimeSources.push(e),{dispose:a(()=>{let r=this.runtimeSources.indexOf(e);r>=0&&this.runtimeSources.splice(r,1)},"dispose")}}subscribeToGateChanges(){try{let e=this.ctx.get(Qo);this.lastEnableCustomAgents=kt(this.ctx,ze.EnableCustomAgents),this.lastEnableOrgCustomAgents=kt(this.ctx,ze.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=kt(this.ctx,ze.EnableCustomAgents),n=kt(this.ctx,ze.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(eu);this.lastCustomAgentPolicyEnabled=e.getPolicyValue("customAgent.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customAgent.enabled");r!==this.lastCustomAgentPolicyEnabled&&(this.lastCustomAgentPolicyEnabled=r,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(Nn),r=Array.from(new Set(Tbn.values())),n=a(o=>{let s={};for(let c of r)s[c]=o[c];return s},"snapshotGated");this.lastGatedCapabilities=n(e.getCapabilities()),this.gateSubscriptions.push(e.onDidSetCapabilities(o=>{let s=n(o);r.every(c=>s[c]===this.lastGatedCapabilities[c])||(this.lastGatedCapabilities=s,this.notifyAgentListChanged())}))}catch{}}notifyAgentListChanged(){try{this.ctx.get(_g).notify("agent").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}syncRegistry(){let e=new Set(t.DEFAULT_AGENT_REGISTRATIONS);for(let r of this.agentFileLocationsPatterns)e.add(r);this.registryAgentPatterns=this.promptFileLocationRegistry.replace(this.registryAgentPatterns,"agent",Array.from(e),{metadata:{providers:["LOCAL","BACKGROUND"]}})}setAgentFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(un(n.uri)):n.type==="location"&&r.add(xwe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e,r){if(this.ctx.get(eu).getPolicyValue("customAgent.enabled")===!1)return[];await this.ready;let s=(await this.ctx.get(y0).collect(this.ctx,"agent",e,{includePlugins:r?.includePlugins})).map(m=>new Bqt(m)),c=this.ctx.get(aF),l=kt(this.ctx,ze.EnableOrgCustomAgents)!==!1,u=this.ctx.get(Nn).getCapabilities(),d=s.filter(m=>{let g=m.promptFileEntry?.parsedPromptFile.header?.errors;if(g&&g.length>0){let _=g[0];return this.logger.warn(this.ctx,`Ignoring custom agent ${m.promptFileEntry?.promptPath.uri}: invalid frontmatter (${_.code}: ${_.message})`),!1}if(this.isOrgScopedAgent(m)){if(!l)return!1;let _=m.promptFileEntry?.parsedPromptFile.uri,E=_?ys(_):void 0;if(!E||!c.isCachedAgentVisibleFor(E,e))return!1}let A=Tbn.get(m.name);if(A===void 0)return!0;let y=u[A]??!1;return y||this.logger.debug(this.ctx,`Filtering out agent '${m.name}' (capability '${A}' is disabled)`),y});if(!r?.includeRuntimeAgents||this.runtimeSources.length===0)return d;let f=new Set(d.map(m=>m.name.toLowerCase())),h=[];for(let m of this.runtimeSources){let g;try{g=await m.getAgents(e)}catch(A){this.logger.warn(this.ctx,"RuntimeAgentSource.getAgents failed:",A);continue}for(let A of g){let y=A.name.toLowerCase();f.has(y)||(f.add(y),h.push(A))}}return[...d,...h]}isOrgScopedAgent(e){let r=e.promptFileEntry?.promptPath.metadata;return r?r.some(n=>n[Uqt]===Qqt.githubOrg):!1}async getCustomAgentById(e,r){return(await this.listCustomAgents(e)).find(o=>o.id===r)}registerExtensionAgent(e,r){let n=[];for(let o of r){if(this.extensionAgents.has(o.uri))continue;let s=this.promptFileLocationRegistry.register("agent",[un(o.uri)],{watchable:!1,classification:{storage:"extension",extensionInfo:{name:o.name,description:o.description,extensionId:e}}}),c=o.uri,l={dispose:a(()=>{s.dispose(),this.extensionAgents.delete(c),this.agentsByExtension.get(e)?.delete(c),this.agentsByExtension.get(e)?.size===0&&this.agentsByExtension.delete(e)},"dispose")};this.extensionAgents.set(c,l);let u=this.agentsByExtension.get(e);u||(u=new Set,this.agentsByExtension.set(e,u)),u.add(c),n.push(c)}return{dispose:a(()=>{for(let o of n)this.extensionAgents.get(o)?.dispose()},"dispose")}}unregisterExtensionAgents(e){let r=this.agentsByExtension.get(e);if(r)for(let n of[...r])this.extensionAgents.get(n)?.dispose()}resolveAssetsPath(e){let r=xwe.default.extname(__filename)===".ts"?xwe.default.resolve(__dirname,"../../../..",e):xwe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(Sbn),n=await Lqt.promises.readFile(r,"utf8"),s=JSON.parse(n).chatAgents||[];for(let c of s)if(c.name&&c.description&&c.path){let l=this.resolveAssetsPath(c.path),u=jVo.get(c.name);this.promptFileLocationRegistry.register("agent",[l],{watchable:!1,classification:{storage:"clsAssets",extensionInfo:{name:c.name,description:c.description}},...u?{metadata:{providers:[...u]}}:{}})}}catch(r){this.logger.warn(e,`Failed to read assets contribution file ${Sbn}:`,r)}}async updateCustomAgent(e,r){if(e.isReadonly)throw new Error(`Cannot update readonly agent: ${e.name}`);await this.agentUpdateSequencer.queue(e.id,async()=>{await this.performUpdateCustomAgent(e,r)})}async performUpdateCustomAgent(e,r){let n=[];a(l=>{l&&n.push(l)},"addIfNotUndefined")(this.updateCustomAgentTools(e,r.updateToolOptions));let s,c=e.promptFileEntry?.parsedPromptFile;if(!c)throw new Error("Cannot update agent: parsedPromptFile is undefined");if(n.forEach(l=>{let u=l(c);u!==void 0&&(s={...s||{},...u})}),s!==void 0){let l={...this.extractHeader(c.header),...s},u="";if(c.header){let m=[];for(let g of c.header.attributes){let A=g.key,y=l[A];if(y!==void 0)if(A==="tools"&&Array.isArray(y)){let _=y.map(E=>JSON.stringify(E).slice(1,-1)).map(E=>`'${E}'`).join(", ");m.push(`tools: [${_}]`)}else{let _=uJ({[A]:y}).trim();m.push(_)}}u=m.join(` +`&&r++,e.push(r+1))}return e}a(NVo,"computeLineStartOffsets");function HO(t,e){let r=0,n=t.length-1,o=0;for(;r<=n;){let s=r+n>>1;t[s]<=e?(o=s,r=s+1):n=s-1}return{line:o,character:e-t[o]}}a(HO,"offsetToPosition");function wqt(t,e){switch(e.type){case"scalar":return MVo(t,e);case"sequence":return{type:"array",items:e.items.map(r=>wqt(t,r)),start:HO(t,e.startOffset),end:HO(t,e.endOffset)};case"map":return{type:"object",properties:e.properties.map(r=>({key:OVo(t,r.key),value:wqt(t,r.value)})),start:HO(t,e.startOffset),end:HO(t,e.endOffset)}}}a(wqt,"convertNode");function MVo(t,e){let r=HO(t,e.startOffset),n=HO(t,e.endOffset);if(e.format==="none"){let o=e.value;if(o==="true")return{type:"boolean",value:!0,start:r,end:n};if(o==="false")return{type:"boolean",value:!1,start:r,end:n};if(o==="null"||o==="~")return{type:"null",value:null,start:r,end:n};if(o!==""&&/^-?\d*\.?\d+$/.test(o)){let s=Number(o);if(!isNaN(s)&&isFinite(s))return{type:"number",value:s,start:r,end:n}}}return{type:"string",value:e.value,start:r,end:n}}a(MVo,"convertScalar");function OVo(t,e){return{type:"string",value:e.value,start:HO(t,e.startOffset),end:HO(t,e.endOffset)}}a(OVo,"convertScalarAsString");var f2=fe(uh());var GO=class{static{a(this,"PromptsParser")}constructor(){}parse(e,r){let n=this.#t(r);if(n.length===0)return new OKe(e,void 0,void 0);let o,s,c=0;if(n[0].match(/^---[\s\r\n]*$/)){let l=n.findIndex((d,f)=>f>0&&d.match(/^---[\s\r\n]*$/));l===-1?(l=n.length,c=n.length):c=l+1;let u=new f2.Range(2,1,l+1,1);o=new Pqt(u,n),this.#e(o,n)}if(cs>0&&o.match(/^---[\s\r\n]*$/))||e.pushError({message:"Missing closing `---` delimiter for frontmatter",range:e.range,code:"MISSING_CLOSING_DELIMITER"})}#t(e){let r=[],n=e.split(/(\r\n|\r|\n)/);for(let o=0;o({message:c.message,range:this.asRange(c),code:c.code}));if(n)if(n.type!=="object")s.push({message:"Invalid header, expecting pairs",range:this.range,code:"INVALID_YAML"});else for(let c of n.properties)o.push({key:c.key.value,range:this.asRange({start:c.key.start,end:c.value.end}),value:this.asValue(c.value)});this._parsed={node:n,attributes:o,errors:s}}return this._parsed}asRange({start:e,end:r}){return new f2.Range(this.range.startLineNumber+e.line,e.character+1,this.range.startLineNumber+r.line,r.character+1)}asValue(e){switch(e.type){case"string":return{type:"string",value:e.value,range:this.asRange(e)};case"number":return{type:"number",value:e.value,range:this.asRange(e)};case"boolean":return{type:"boolean",value:e.value,range:this.asRange(e)};case"null":return{type:"null",value:e.value,range:this.asRange(e)};case"array":return{type:"array",items:e.items.map(r=>this.asValue(r)),range:this.asRange(e)};case"object":return{type:"object",properties:e.properties.map(n=>({key:this.asValue(n.key),value:this.asValue(n.value)})),range:this.asRange(e)}}}get attributes(){return this._parsedHeader.attributes}getAttribute(e){return this._parsedHeader.attributes.find(r=>r.key===e)}get errors(){return this._parsedHeader.errors}pushError(e){this._parsedHeader.errors.unshift(e)}getStringAttribute(e){let r=this._parsedHeader.attributes.find(n=>n.key===e);if(r?.value.type==="string")return r.value.value}get name(){return this.getStringAttribute("name")}get description(){return this.getStringAttribute("description")}get agent(){return this.getStringAttribute("agent")??this.getStringAttribute("mode")}get model(){return this.getStringAttribute("model")}get applyTo(){return this.getStringAttribute("applyTo")}get invokePolicy(){let e=this._parsedHeader.attributes.find(r=>r.key===BVo);if(e?.value.type==="array"){let r=[];for(let n of e.value.items)n.type==="string"&&n.value&&r.push(n.value);return r}}get tools(){let e=this._parsedHeader.attributes.find(r=>r.key==="tools");if(e){if(e.value.type==="array"){let r=[];for(let n of e.value.items)n.type==="string"&&n.value&&r.push(n.value);return r}else if(e.value.type==="object"){let r=[],n=a(({key:o,value:s})=>{s.type==="boolean"?r.push(o.value):s.type==="object"&&s.properties.forEach(n)},"collectLeafs");return e.value.properties.forEach(n),r}}}get handOffs(){let e=this._parsedHeader.attributes.find(r=>r.key==="handoffs");if(e&&e.value.type==="array"){let r=[];for(let n of e.value.items)if(n.type==="object"){let o,s,c,l;for(let u of n.properties)u.key.value==="agent"&&u.value.type==="string"?o=u.value.value:u.key.value==="label"&&u.value.type==="string"?s=u.value.value:u.key.value==="prompt"&&u.value.type==="string"?c=u.value.value:u.key.value==="send"&&u.value.type==="boolean"&&(l=u.value.value);o&&s&&c!==void 0&&r.push({agent:o,label:s,prompt:c,send:l})}return r}}},Dqt=class{constructor(e,r,n){this.range=e;this.linesWithEOL=r;this.uri=n}static{a(this,"PromptBody")}get fileReferences(){return this.getParsedBody().fileReferences}get variableReferences(){return this.getParsedBody().variableReferences}get offset(){return this.getParsedBody().bodyOffset}getParsedBody(){if(this._parsed===void 0){let e=[],r=[],n=[],o=this.linesWithEOL.slice(0,this.range.startLineNumber-1).reduce((s,c)=>c.length+s,0);for(let s=this.range.startLineNumber-1,c=o;sf2.Range.areIntersectingOrTouching(A,m)))continue;let g=h[1];if(g){if(g==="file:"){let A=h.index+h[0].length-h[2].length,y=h.index+h[0].length,_=new f2.Range(s+1,A+1,s+1,y+1);r.push({content:h[2],range:_,isMarkdownLink:!1})}}else{let A=h.index+1,y=h.index+h[0].length,_=new f2.Range(s+1,A+1,s+1,y+1);n.push({name:h[2],range:_,offset:c+h.index})}}c+=l.length}this._parsed={fileReferences:r.sort((s,c)=>f2.Range.compareRangesUsingStarts(s.range,c.range)),variableReferences:n,bodyOffset:o}}return this._parsed}get content(){return this._content===void 0&&(this._content=this.linesWithEOL.slice(this.range.startLineNumber-1,this.range.endLineNumber-1).join("").trim()),this._content}};p();p();function yJ(t){let e=new Set;for(let r of t??[]){let n=r.hookSource;(n==="copilot"||n==="claude")&&e.add(n)}return e.size===1?e.values().next().value:void 0}a(yJ,"getHookSource");var UVo=new Set(["sessionStart","sessionEnd","agentStop","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),Ebn="agentHook.event.load";function QVo(t,e){ft(t,Ebn);let r={};for(let[n,o]of Object.entries(e))o!==void 0&&(r[`${n}.hookCount`]=String(o.length));sr(t,Ebn,r)}a(QVo,"recordHookLoadTelemetry");var Nqt=class{constructor(){this.logger=new pe("CopilotHookParser")}static{a(this,"CopilotHookParser")}parse(e,r,n){let o=JSON.parse(n);if(o.version!==1)throw new Error(`Unsupported hooks config version: ${String(o.version)}`);if(o.hooks===void 0||typeof o.hooks!="object"||o.hooks===null)throw new Error("Invalid or missing hooks section");let s=o,c={};for(let[l,u]of Object.entries(s.hooks)){if(!this.isValidEventType(l)){this.logger.warn(e,`Invalid event type: ${l} in ${r}`);continue}let d=Array.isArray(u)?u:[],f=[];for(let h of d)this.isValidHook(h)?f.push(h):this.logger.warn(e,`Invalid hook configuration in ${r}: ${JSON.stringify(h)}`);c[l]=f}return QVo(e,c),{uri:r,version:1,hooks:c}}isValidEventType(e){return UVo.has(e)}isValidHook(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="command"&&("bash"in e&&typeof e.bash=="string"||"powershell"in e&&typeof e.powershell=="string")}},Mqt=class{constructor(){this.logger=new pe("ClaudeHookParser")}static{a(this,"ClaudeHookParser")}parse(e,r,n){let o=JSON.parse(n);if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Invalid Claude hooks configuration");let s=o;if(s.disableAllHooks===!0)return{uri:r,version:1,hooks:{}};if(!s.hooks||typeof s.hooks!="object"||Array.isArray(s.hooks))return{uri:r,version:1,hooks:{}};let c={};for(let[l,u]of Object.entries(s.hooks)){if(!Array.isArray(u)){this.logger.warn(e,`Invalid Claude hook event configuration in ${r}: ${l}`);continue}let d=[];for(let f of u){if(!f||typeof f!="object"||Array.isArray(f)){this.logger.warn(e,`Invalid Claude hook group for ${l} in ${r}: expected an object`);continue}let h=f;if(Array.isArray(h.hooks))for(let m of h.hooks)this.isExternalHandler(m)?d.push({type:"command"}):this.logger.warn(e,`Invalid Claude hook handler for ${l} in ${r}: missing or invalid type`);else this.isExternalHandler(h)?d.push({type:"command"}):this.logger.warn(e,`Invalid Claude hook group for ${l} in ${r}: hooks must be an array`)}d.length>0&&(c[l]=d)}return{uri:r,version:1,hooks:c}}isExternalHandler(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"type"in e&&typeof e.type=="string"}},LKe=class{constructor(e=new Nqt,r=new Mqt){this.copilotParser=e;this.claudeParser=r}static{a(this,"HookParser")}parse(e,r,n,o){let s=yJ(o);if(s===void 0)throw new Error(`Missing or conflicting hook source metadata for ${r}`);return(s==="copilot"?this.copilotParser:this.claudeParser).parse(e,r,n,o)}};p();var vbn=require("os");var qVo=(0,vbn.platform)()==="win32",up=class{constructor(){this.trustByUri=new Map;this.emitter=new Ji;this.onDidChangeTrust=this.emitter.event;this.capabilityEnabled=!1}static{a(this,"WorkspaceTrustService")}setCapabilityEnabled(e){this.capabilityEnabled=e}setTrust(e,r){let n=this.normalizeKey(e),o=this.trustByUri.get(n);if(this.trustByUri.set(n,r),o===r)return;let s=`${n}/`,c=[];for(let l of this.trustByUri.keys())l.startsWith(s)&&c.push(l);for(let l of c)this.trustByUri.delete(l);this.emitter.fire({folderUri:n,trusted:r});for(let l of c)this.emitter.fire({folderUri:l,trusted:this.isTrustedInternal(l)})}forget(e){let r=this.normalizeKey(e);this.trustByUri.delete(r)&&this.emitter.fire({folderUri:r,trusted:this.isTrustedInternal(r)})}isTrusted(e){return this.capabilityEnabled?this.isTrustedInternal(this.normalizeKey(e)):!0}isTrustedInternal(e){let r=e.indexOf("://"),n=r>=0?r+3:0,o=e;for(;o.length>n;){let s=this.trustByUri.get(o);if(s!==void 0)return s;let c=o.lastIndexOf("/");if(cthis.handleChange(f));for(let f of Oqt)this.rewatch(f);this.registrySubscription=o.onLocationsChanged(f=>{for(let h of f.affectedTypes)this.rewatch(h)});let c=a(f=>{this.evictFolder(f),this.rewatchAll()},"onWorkspaceRemoved"),l=a(()=>{this.rewatchAll()},"onWorkspaceAdded");this.workspaceListener=new class extends xq{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(f){c(f)}},e.get(dT).addListener(this.workspaceListener);let u,d=a(()=>{let f=u;if(u=void 0,!(!f||this.disposed)){for(let h of f)this.evictFolder({uri:h});this.rewatchAll();for(let h of Oqt)this.notifyChange(h)}},"flushPending");this.trustSubscription=e.get(up).onDidChangeTrust(f=>{u===void 0&&(u=new Set,queueMicrotask(d)),u.add(f.folderUri)})}static{a(this,"PromptService")}async collect(e,r,n,o){let s=e.get(up),c=n.filter(h=>s.isTrusted(h.uri)),l=await this.fileLocator.listFiles(e,c,r),u=o?.includePlugins?l:l.filter(h=>h.classification.storage!=="plugin"),f=(await Promise.all(u.map(h=>this.resolveEntry(e,r,h)))).filter(h=>h!==void 0);return o?.includePlugins?f:f.filter(h=>h.promptPath.storage!=="plugin")}async resolveEntry(e,r,n){let o=Cbn(r,n.uri);if(n.cacheable){let l=this.entryCache.get(o);if(l){let d=await this.fsMtime(e,n.uri);if(d!==void 0&&d===l.timestamp)return l.entry;this.invalidateKey(o)}let u=this.parseInflight.get(o);if(u)return u}let s=this.buildPromptPath(r,n),c=this.parseOne(e,s).then(l=>{if(l===void 0)return;let u={promptPath:s,parsedPromptFile:l};return n.cacheable&&!this.disposed&&this.parseInflight.get(o)===c&&this.entryCache.set(o,{entry:u,timestamp:n.timestamp}),u});return n.cacheable&&(this.parseInflight.set(o,c),c.finally(()=>{this.parseInflight.get(o)===c&&this.parseInflight.delete(o)})),c}async fsMtime(e,r){try{return(await e.get(Go).stat(r)).mtime}catch{return}}buildPromptPath(e,r){let{classification:n}=r;return n.storage==="plugin"?{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata,name:n.pluginInfo.name,description:n.pluginInfo.description,pluginUri:n.pluginInfo.pluginUri}:n.storage==="extension"||n.storage==="clsAssets"?{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata,name:n.extensionInfo.name,description:n.extensionInfo.description,extensionId:n.extensionInfo.extensionId}:{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata}}async dispose(){if(!this.disposed){this.disposed=!0,this.registrySubscription.dispose(),this.mergedChangeSubscription.dispose(),this.trustSubscription.dispose();try{this.ctx.get(dT).removeListener(this.workspaceListener)}catch{}for(let e of this.watchHandles.values())e.dispose();this.watchHandles.clear(),this.entryCache.clear(),this.parseInflight.clear(),this.ownsWatcher&&await this.watcher.dispose()}}async parseOne(e,r){let n=this.parsers.get(r.type);if(!n){this.logger.warn(e,`No parser registered for type ${r.type} (uri: ${r.uri})`);return}try{return await n.parse(e,r.uri,await e.get(Go).readFileString(r.uri),r.metadata)}catch(o){this.logger.warn(e,`Failed to parse ${r.type} file ${r.uri}:`,o);return}}handleChange(e){let r=new Set,n=!1;for(let o of e.changes)o.path?r.add(o.path):n=!0;for(let o of e.affectedTypes){if(n)this.clearType(o);else for(let s of r)this.invalidateKey(Cbn(o,Ko(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(Eg).notify(e).catch(r=>{this.logger.warn(this.ctx,`PromptChangeNotifier.notify(${e}) failed:`,r)})}catch(r){this.logger.warn(this.ctx,`PromptChangeNotifier.notify(${e}) failed:`,r)}}invalidateKey(e){this.entryCache.delete(e),this.parseInflight.delete(e)}clearType(e){let r=jVo(e),n=new Set;for(let o of this.entryCache.keys())o.startsWith(r)&&n.add(o);for(let o of this.parseInflight.keys())o.startsWith(r)&&n.add(o);for(let o of n)this.invalidateKey(o)}rewatch(e){if(this.disposed)return;let r=this.ctx.get(QA),n=this.currentWorkspacePaths(),o=r.resolvePatterns(e,n,!0).map(l=>l.pattern),s=this.watchHandles.get(e);if(o.length===0){s&&(s.dispose(),this.watchHandles.delete(e));return}let c=this.watcher.watch(e,o,s);this.watchHandles.set(e,c)}rewatchAll(){for(let e of Oqt)this.rewatch(e)}evictFolder(e){let r=e.uri.endsWith("/")?e.uri:`${e.uri}/`;for(let[n,o]of this.entryCache){let s=o.entry.promptPath.uri;(s===e.uri||s.startsWith(r))&&this.invalidateKey(n)}}currentWorkspacePaths(){let e;try{let o=this.ctx.get(up);e=this.ctx.get($r).getWorkspaceFolders().filter(s=>o.isTrusted(s.uri)).map(s=>un(s.uri))}catch{return[]}let r=e.map(o=>({raw:o,normalized:o.replace(/\\/g,"/")})).sort((o,s)=>o.normalized.length-s.normalized.length),n=[];for(let o of r)n.some(s=>bw(s.normalized,o.normalized,nb))||n.push(o);return n.map(o=>o.raw)}};p();var eu=class{constructor(){this.policyChangeEmitter=new Lc;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},BKe=class extends eu{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var Lqt=64;var dF=(r=>(r.enabled="enabled",r.disabled="disabled",r))(dF||{}),E0={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},dp={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},_J=class{static{a(this,"LanguageModelTool")}constructor(e){this.type=e.type,this.toolProvider=e.toolProvider,this.name=e.name,this.displayName=e.displayName??this.name,this.description=e.description,this.displayDescription=e.displayDescription??this.description,this.inputSchema=e.inputSchema,this.annotations=e.annotations,this.id=`${this.toolProvider.id}.${this.name}`,this.nameForModel=(this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.displayNamePrefix??this.toolProvider.id}_${this.name}`).replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,Lqt),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},Nq=class extends _J{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},Lr=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},Mq=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},EJ=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};var Gr=class{static{a(this,"LanguageModelToolResult")}constructor(e,r){this.status=r,this.content=e}},Oq=class extends Gr{static{a(this,"ExtendedLanguageModelToolResult")}},bbn=b.Object({content:b.Array(b.Union([b.Object({value:b.String()}),b.Object({value:b.Unknown()})])),status:b.Optional(b.Union([b.Literal("success"),b.Literal("error"),b.Literal("cancelled")]))}),fF=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(fF||{}),Sbn=b.Object({result:b.Enum(fF)});var Bqt=fe(require("fs"));var xwe=fe(require("path"));var Uqt=["user","model"],Qqt="source",qqt={githubOrg:"github-org"},xCn={githubOrg:{[Qqt]:qqt.githubOrg}},Fqt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._id=n.uri;let o=n.header?.name?.trim()||void 0;this._name=r.name??o??ro(n.uri).replace(/\.(agent\.)?md$/i,"")}static{a(this,"CustomAgent")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get id(){return this._id}get name(){return this._name}get description(){return this.parsedPromptFile.header?.description}get tools(){return this.parsedPromptFile.header?.tools}get model(){return this.parsedPromptFile.header?.model}get handOffs(){return this.parsedPromptFile.header?.handOffs}get instruction(){return this.parsedPromptFile.body?.content}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||Lue(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??Uqt}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get pluginUri(){return Dq(this.promptFileEntry.promptPath)}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(qqt));for(let n of e){let o=n[Qqt];if(typeof o=="string"&&r.has(o))return o}}get providers(){return c2(this.promptFileEntry.promptPath.metadata)}},Tbn="./assets/prompts.contributions.json",xbn="CVE Remediator",HVo="Debugger",Ibn=new Map([[xbn,"cveRemediatorAgent"],[HVo,"debuggerAgent"]]),GVo=new Map([[xbn,["LOCAL"]]]),Kd=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new pe("CustomAgentService");this.agentUpdateSequencer=new _w;this.extensionAgents=new Map;this.agentsByExtension=new Map;this.agentFileLocationsPatterns=[];this.runtimeSources=[];this.gateSubscriptions=[];this.lastGatedCapabilities={};this.syncRegistry(),this.registerClaudeAgentPatterns(),this.ready=this.loadAssetsContributions(e),this.subscribeToGateChanges()}static{a(this,"CustomAgentService")}static{this.DEFAULT_AGENT_REGISTRATIONS=[".github/agents/**/*.agent.md",".claude/agents/**/*.agent.md","~/.copilot/agents/**/*.agent.md"]}static{this.AGENT_GLOB_SUFFIX="**/*.agent.md"}static{this.CLAUDE_AGENT_PATTERNS=[".claude/agents/**/*.md","~/.claude/agents/**/*.md"]}registerClaudeAgentPatterns(){this.promptFileLocationRegistry.register("agent",[...t.CLAUDE_AGENT_PATTERNS],{metadata:{providers:["CLAUDE"]}})}registerRuntimeAgentSource(e){return this.runtimeSources.push(e),{dispose:a(()=>{let r=this.runtimeSources.indexOf(e);r>=0&&this.runtimeSources.splice(r,1)},"dispose")}}subscribeToGateChanges(){try{let e=this.ctx.get(Qo);this.lastEnableCustomAgents=kt(this.ctx,ze.EnableCustomAgents),this.lastEnableOrgCustomAgents=kt(this.ctx,ze.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=kt(this.ctx,ze.EnableCustomAgents),n=kt(this.ctx,ze.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(eu);this.lastCustomAgentPolicyEnabled=e.getPolicyValue("customAgent.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customAgent.enabled");r!==this.lastCustomAgentPolicyEnabled&&(this.lastCustomAgentPolicyEnabled=r,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(Nn),r=Array.from(new Set(Ibn.values())),n=a(o=>{let s={};for(let c of r)s[c]=o[c];return s},"snapshotGated");this.lastGatedCapabilities=n(e.getCapabilities()),this.gateSubscriptions.push(e.onDidSetCapabilities(o=>{let s=n(o);r.every(c=>s[c]===this.lastGatedCapabilities[c])||(this.lastGatedCapabilities=s,this.notifyAgentListChanged())}))}catch{}}notifyAgentListChanged(){try{this.ctx.get(Eg).notify("agent").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}syncRegistry(){let e=new Set(t.DEFAULT_AGENT_REGISTRATIONS);for(let r of this.agentFileLocationsPatterns)e.add(r);this.registryAgentPatterns=this.promptFileLocationRegistry.replace(this.registryAgentPatterns,"agent",Array.from(e),{metadata:{providers:["LOCAL","BACKGROUND"]}})}setAgentFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(un(n.uri)):n.type==="location"&&r.add(xwe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e,r){if(this.ctx.get(eu).getPolicyValue("customAgent.enabled")===!1)return[];await this.ready;let s=(await this.ctx.get(_0).collect(this.ctx,"agent",e,{includePlugins:r?.includePlugins})).map(m=>new Fqt(m)),c=this.ctx.get(aF),l=kt(this.ctx,ze.EnableOrgCustomAgents)!==!1,u=this.ctx.get(Nn).getCapabilities(),d=s.filter(m=>{let g=m.promptFileEntry?.parsedPromptFile.header?.errors;if(g&&g.length>0){let _=g[0];return this.logger.warn(this.ctx,`Ignoring custom agent ${m.promptFileEntry?.promptPath.uri}: invalid frontmatter (${_.code}: ${_.message})`),!1}if(this.isOrgScopedAgent(m)){if(!l)return!1;let _=m.promptFileEntry?.parsedPromptFile.uri,E=_?ys(_):void 0;if(!E||!c.isCachedAgentVisibleFor(E,e))return!1}let A=Ibn.get(m.name);if(A===void 0)return!0;let y=u[A]??!1;return y||this.logger.debug(this.ctx,`Filtering out agent '${m.name}' (capability '${A}' is disabled)`),y});if(!r?.includeRuntimeAgents||this.runtimeSources.length===0)return d;let f=new Set(d.map(m=>m.name.toLowerCase())),h=[];for(let m of this.runtimeSources){let g;try{g=await m.getAgents(e)}catch(A){this.logger.warn(this.ctx,"RuntimeAgentSource.getAgents failed:",A);continue}for(let A of g){let y=A.name.toLowerCase();f.has(y)||(f.add(y),h.push(A))}}return[...d,...h]}isOrgScopedAgent(e){let r=e.promptFileEntry?.promptPath.metadata;return r?r.some(n=>n[Qqt]===qqt.githubOrg):!1}async getCustomAgentById(e,r){return(await this.listCustomAgents(e)).find(o=>o.id===r)}registerExtensionAgent(e,r){let n=[];for(let o of r){if(this.extensionAgents.has(o.uri))continue;let s=this.promptFileLocationRegistry.register("agent",[un(o.uri)],{watchable:!1,classification:{storage:"extension",extensionInfo:{name:o.name,description:o.description,extensionId:e}}}),c=o.uri,l={dispose:a(()=>{s.dispose(),this.extensionAgents.delete(c),this.agentsByExtension.get(e)?.delete(c),this.agentsByExtension.get(e)?.size===0&&this.agentsByExtension.delete(e)},"dispose")};this.extensionAgents.set(c,l);let u=this.agentsByExtension.get(e);u||(u=new Set,this.agentsByExtension.set(e,u)),u.add(c),n.push(c)}return{dispose:a(()=>{for(let o of n)this.extensionAgents.get(o)?.dispose()},"dispose")}}unregisterExtensionAgents(e){let r=this.agentsByExtension.get(e);if(r)for(let n of[...r])this.extensionAgents.get(n)?.dispose()}resolveAssetsPath(e){let r=xwe.default.extname(__filename)===".ts"?xwe.default.resolve(__dirname,"../../../..",e):xwe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(Tbn),n=await Bqt.promises.readFile(r,"utf8"),s=JSON.parse(n).chatAgents||[];for(let c of s)if(c.name&&c.description&&c.path){let l=this.resolveAssetsPath(c.path),u=GVo.get(c.name);this.promptFileLocationRegistry.register("agent",[l],{watchable:!1,classification:{storage:"clsAssets",extensionInfo:{name:c.name,description:c.description}},...u?{metadata:{providers:[...u]}}:{}})}}catch(r){this.logger.warn(e,`Failed to read assets contribution file ${Tbn}:`,r)}}async updateCustomAgent(e,r){if(e.isReadonly)throw new Error(`Cannot update readonly agent: ${e.name}`);await this.agentUpdateSequencer.queue(e.id,async()=>{await this.performUpdateCustomAgent(e,r)})}async performUpdateCustomAgent(e,r){let n=[];a(l=>{l&&n.push(l)},"addIfNotUndefined")(this.updateCustomAgentTools(e,r.updateToolOptions));let s,c=e.promptFileEntry?.parsedPromptFile;if(!c)throw new Error("Cannot update agent: parsedPromptFile is undefined");if(n.forEach(l=>{let u=l(c);u!==void 0&&(s={...s||{},...u})}),s!==void 0){let l={...this.extractHeader(c.header),...s},u="";if(c.header){let m=[];for(let g of c.header.attributes){let A=g.key,y=l[A];if(y!==void 0)if(A==="tools"&&Array.isArray(y)){let _=y.map(E=>JSON.stringify(E).slice(1,-1)).map(E=>`'${E}'`).join(", ");m.push(`tools: [${_}]`)}else{let _=dJ({[A]:y}).trim();m.push(_)}}u=m.join(` `)+` `}let d=c.body?.content,f=u?`--- ${u}--- -${d}`:d||"",h=ys(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await Lqt.promises.writeFile(h,f,{encoding:"utf8"})}}updateCustomAgentTools(e,r){if(r)return n=>{let o=n.header?.tools;if(o!==void 0)return r.forEach(s=>{let c=o.findIndex(l=>l===s.toolConfigurationKey);s.status==="enabled"?c===-1&&o.push(s.toolConfigurationKey):c!==-1&&o.splice(c,1)}),{tools:o}}}extractHeader(e){let r=a(o=>{if(o.type==="array")return[...o.items.map(s=>r(s))];if(o.type==="object"){let s={};return o.properties.forEach(c=>{s[c.key.value]=r(c.value)}),s}return o.value},"extractValue"),n={};return e?.attributes.forEach(o=>{let{key:s,value:c}=o;n[s]=r(c)}),n}};var Rwe=class{constructor(e){this.customAgent=e;this._isBuiltIn=!1;this.kind="Agent";e.promptFileEntry?.promptPath?.storage==="clsAssets"&&(this._isBuiltIn=!0)}static{a(this,"CustomChatMode")}get isBuiltIn(){return this._isBuiltIn}get id(){return this.customAgent.id}get name(){return this.customAgent.name}get uri(){return this.customAgent?.promptFileEntry?.parsedPromptFile?.uri}get description(){return this.customAgent.description}get customTools(){return this.customAgent.tools}get model(){return this.customAgent.model}get handOffs(){return this.customAgent.handOffs}get instruction(){return this.customAgent.instruction}get source(){return this.customAgent}},wwe=class{constructor(e,r,n,o){this.id=e;this.name=r;this.kind=n;this.description=o;this.isBuiltIn=!0}static{a(this,"BuiltInChatMode")}},Nl={Ask:new wwe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new wwe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new wwe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function wbn(t){return t===Nl.Agent||t.id===Nl.Agent.id}a(wbn,"isBuiltInAgentMode");function HVo(t){return t===Nl.InlineAgent||t.id===Nl.InlineAgent.id}a(HVo,"isBuiltInInlineAgentMode");function Rbn(t){return t===Nl.Ask||t.id===Nl.Ask.id||wbn(t)||HVo(t)}a(Rbn,"isBuiltInChatMode");function kwe(t){return wbn(t)||!t.isBuiltIn&&t.customTools===void 0}a(kwe,"shouldApplyGlobalToolsSetting");var ov=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[Nl.Ask,Nl.Agent,Nl.InlineAgent],o=await this.ctx.get(Yd).listCustomAgents(e||[],{includePlugins:!0});return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new Rwe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return Nl.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??Nl.Agent:Nl.Agent;case"InlineAgent":return Nl.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var zc=class extends Error{static{a(this,"CanceledError")}constructor(){super("Canceled"),this.name="Canceled"}};p();var FKe=class{constructor(){this._tools=new Map}static{a(this,"ToolRegistry")}registerTool(e){this._tools.set(e.id,e)}unregisterTool(e){return this._tools.delete(e)}getTool(e){return this._tools.get(e)}listTools(){return Array.from(this._tools.values())}};p();p();p();var GVo=new pe("conversationProgress"),Lq={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var Bc=class{constructor(e){this.ctx=e;this.progressEntries=new Sn(250)}static{a(this,"ConversationProgress")}async begin(e,r,n){let o={status:"open",handler:n};this.progressEntries.set(e.id,o),await o.handler.begin(this.ctx,e,r)}async report(e,r,n){let o=this.getProgressEntry(e);if(o.status==="open")await o.handler.report(this.ctx,e,r,n);else{let s=Object.keys(n).filter(c=>n[c]!==void 0);GVo.debug(this.ctx,`conversationProgress.report(): dropped because status is '${o.status}' (not open) for conversation ${e.id}. Dropped payload fields: [${s.join(", ")}]. If tokenUsage is among dropped fields, this is a cause of token usage not reaching $progress.`)}}async end(e,r,n){let o=this.getProgressEntry(e);o.status==="open"&&(this.progressEntries.set(e.id,{...o,status:"done",updatedAt:Date.now()}),await o.handler.end(this.ctx,e,r,n))}async cancel(e,r,n){let o=this.getProgressEntry(e);o.status==="open"&&(this.progressEntries.set(e.id,{...o,status:"cancelled",updatedAt:Date.now()}),await o.handler.cancel(this.ctx,e,r,n))}getCurrentHandler(e){return this.progressEntries.get(e.id)?.handler}getProgressEntry(e){let r=this.progressEntries.get(e.id);if(r===void 0)throw new Error(`No work done token for conversation ${e.id}`);return r.status!=="open"&&ot.error(this.ctx,`Work done token for conversation ${e.id} is already ${r.status}, last updated at ${r.updatedAt}`),r}};p();p();p();var Ii={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic",Ollama:"Ollama"},$Vo="http://localhost:11434";function ob(t){return t===Ii.Ollama}a(ob,"isOllama");function qqt(t){let e=(t?.trim()||$Vo).replace(/\/+$/,"");return e=e.replace(/\/v1(?:\/chat\/completions)?$/,""),e}a(qqt,"normalizeOllamaHost");function UKe(t){return`${qqt(t)}/v1`}a(UKe,"resolveOllamaBaseUrl");var VVo=new Set(Object.values(Ii));function VO(t){return!VVo.has(t)}a(VO,"isCustomEndpointProvider");var Pwe="chatCompletions",WVo=128e3,zVo=16e3,YVo=1e5,KVo=8192;function Dwe(t){return VO(t)?{maxInputTokens:WVo,maxOutputTokens:zVo}:{maxInputTokens:YVo,maxOutputTokens:KVo}}a(Dwe,"getDefaultTokenLimits");function WO(t){switch(t){case Ii.Azure:return 1;case Ii.Ollama:return 2;default:return 0}}a(WO,"getAuthTypeForProvider");function kbn(t){switch(t){case"responses":return"responses";case"messages":return"v1/messages";default:return"completions"}}a(kbn,"customEndpointApiTypeToEndpoint");function Nwe(t,e){let r=t.trim();r.endsWith("/")&&(r=r.slice(0,-1));let n=["/v1/messages","/chat/completions","/responses","/messages"];for(let s of n)if(r.endsWith(s)){r=r.slice(0,-s.length);break}let o=/\/v\d+$/;return e==="messages"?r.replace(o,""):o.test(r)?r:`${r}/v1`}a(Nwe,"resolveCustomEndpointBaseUrl");function Lue(t){return t===Ii.OpenAI||t===Ii.Gemini||t===Ii.Groq||t===Ii.OpenRouter||t===Ii.Anthropic}a(Lue,"isOpenAICompatible");async function zO(t,e,r){let n=new as(t.get(Un)),o=await n.getStoredModelConfigs(e),s=o&&o[r]&&o[r].isRegistered!==!1?o[r]:void 0,c=s?.modelCapabilities,l=c?.name||r,u=VO(e),d=Dwe(e),f=c?.maxInputTokens??d.maxInputTokens,h=c?.maxOutputTokens??d.maxOutputTokens,m=s?.deploymentUrl,g;u&&(g=(await n.getProviderConfig(e))?.apiType??Pwe);let A=m;return ob(e)&&(A=(await n.getProviderConfig(e))?.url),{modelId:r,uiName:l,modelFamily:kn.BYOK,providerName:e,deploymentUrl:A,apiType:g,maxRequestTokens:f,maxResponseTokens:h,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!!c?.toolCalling,supportsThinking:!!c?.thinking,reasoningEfforts:c?.supportsReasoningEffort,originalBillingMultiplier:0}}a(zO,"resolveModelConfiguration");async function QKe(t,e,r){return await new as(t.get(Un)).getAPIKey(e,r)}a(QKe,"resolveModelKey");function Pbn(t,e){let{protocol:r,hostname:n,pathname:o}=new URL(e);if(o.endsWith("/chat/completions"))return e;if(n.endsWith(".models.ai.azure.com")||n.endsWith(".inference.ml.azure.com"))return`${r}//${n}/v1/chat/completions`;if(n.endsWith(".openai.azure.com"))return`${r}//${n}/openai/deployments/${t}/chat/completions?api-version=2025-01-01-preview`;throw new Error(`Unrecognized Azure deployment URL: ${e}`)}a(Pbn,"resolveAzureUrl");function Bq(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(Bq,"isBYOKEnabled");var sv="byok",as=class t{constructor(e){this.persistenceManager=e}static{a(this,"BYOKPersistence")}static{this._writeQueue=Promise.resolve()}static enqueue(e){let r=t._writeQueue.then(e,e);return t._writeQueue=r.then(()=>{},()=>{}),r}modelApiKeyKey(e,r){return`${e}-${r}-api-key`}providerApiKeyKey(e){return`${e}-api-key`}modelsConfigKey(e){return`${e}-models-config`}providerConfigKey(e){return`${e}-provider-config`}async getAPIKey(e,r){if(r){let o=await this.persistenceManager.read(sv,this.modelApiKeyKey(e,r));if(o)return o}return await this.persistenceManager.read(sv,this.providerApiKeyKey(e))}async storeAPIKey(e,r,n,o){return t.enqueue(()=>this.storeAPIKeyUnserialized(e,r,n,o))}async deleteAPIKey(e,r,n){return t.enqueue(async()=>{r!==2&&(r===0?await this.persistenceManager.delete(sv,this.providerApiKeyKey(e)):r===1&&n&&await this.persistenceManager.delete(sv,this.modelApiKeyKey(e,n)))})}async getStoredModelConfigs(e){return await this.persistenceManager.read(sv,this.modelsConfigKey(e))||{}}async getProviderConfig(e){return await this.persistenceManager.read(sv,this.providerConfigKey(e))}async saveProviderConfig(e,r){return t.enqueue(async()=>{await this.persistenceManager.update(sv,this.providerConfigKey(e),r)})}async deleteProviderConfig(e){return t.enqueue(async()=>{await this.persistenceManager.delete(sv,this.providerConfigKey(e))})}async listCustomProviderNames(){let e=await this.persistenceManager.listKeys(sv),r=this.providerConfigKey(""),n=new Set(Object.values(Ii));return e.filter(o=>o.endsWith(r)).map(o=>o.slice(0,-r.length)).filter(o=>!n.has(o))}async listAllProviderNames(){let e=await this.listCustomProviderNames();return Array.from(new Set([...Object.values(Ii),...e]))}async getAllModels(e){let r=[];if(!Bq(await e.get(Qt).getToken()))return r;for(let n of await this.listAllProviderNames()){let o=await this.getStoredModelConfigs(n);r.push(...Object.keys(o).map(s=>({name:s,provider:n,capabilities:o[s].modelCapabilities})))}return r}async saveModelConfig(e,r,n,o,s){return t.enqueue(async()=>{let c=await this.getStoredModelConfigs(e);c[r]=n,await this.persistenceManager.update(sv,this.modelsConfigKey(e),c),o&&s&&await this.storeAPIKeyUnserialized(e,o,s,r)})}async storeAPIKeyUnserialized(e,r,n,o){n!==2&&(n===0?await this.persistenceManager.update(sv,this.providerApiKeyKey(e),r):n===1&&o&&await this.persistenceManager.update(sv,this.modelApiKeyKey(e,o),r))}async removeModelConfig(e,r){return t.enqueue(async()=>{let n=await this.getStoredModelConfigs(e),o=n[r];o&&(delete n[r],await this.persistenceManager.update(sv,this.modelsConfigKey(e),n),o.deploymentUrl&&await this.persistenceManager.delete(sv,this.modelApiKeyKey(e,r)))})}async removeAllModelConfigs(e){return t.enqueue(async()=>{await this.persistenceManager.delete(sv,this.modelsConfigKey(e))})}};p();p();p();p();function jqt(t,e){let r=EJ(t,e);return r===-1?void 0:t[r]}a(jqt,"findLastMonotonous");function EJ(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?HKe.isErrorNoTelemetry(e)?new HKe(e.message+` +${d}`:d||"",h=ys(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await Bqt.promises.writeFile(h,f,{encoding:"utf8"})}}updateCustomAgentTools(e,r){if(r)return n=>{let o=n.header?.tools;if(o!==void 0)return r.forEach(s=>{let c=o.findIndex(l=>l===s.toolConfigurationKey);s.status==="enabled"?c===-1&&o.push(s.toolConfigurationKey):c!==-1&&o.splice(c,1)}),{tools:o}}}extractHeader(e){let r=a(o=>{if(o.type==="array")return[...o.items.map(s=>r(s))];if(o.type==="object"){let s={};return o.properties.forEach(c=>{s[c.key.value]=r(c.value)}),s}return o.value},"extractValue"),n={};return e?.attributes.forEach(o=>{let{key:s,value:c}=o;n[s]=r(c)}),n}};var Rwe=class{constructor(e){this.customAgent=e;this._isBuiltIn=!1;this.kind="Agent";e.promptFileEntry?.promptPath?.storage==="clsAssets"&&(this._isBuiltIn=!0)}static{a(this,"CustomChatMode")}get isBuiltIn(){return this._isBuiltIn}get id(){return this.customAgent.id}get name(){return this.customAgent.name}get uri(){return this.customAgent?.promptFileEntry?.parsedPromptFile?.uri}get description(){return this.customAgent.description}get customTools(){return this.customAgent.tools}get model(){return this.customAgent.model}get handOffs(){return this.customAgent.handOffs}get instruction(){return this.customAgent.instruction}get source(){return this.customAgent}},wwe=class{constructor(e,r,n,o){this.id=e;this.name=r;this.kind=n;this.description=o;this.isBuiltIn=!0}static{a(this,"BuiltInChatMode")}},Nl={Ask:new wwe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new wwe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new wwe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function Rbn(t){return t===Nl.Agent||t.id===Nl.Agent.id}a(Rbn,"isBuiltInAgentMode");function $Vo(t){return t===Nl.InlineAgent||t.id===Nl.InlineAgent.id}a($Vo,"isBuiltInInlineAgentMode");function kbn(t){return t===Nl.Ask||t.id===Nl.Ask.id||Rbn(t)||$Vo(t)}a(kbn,"isBuiltInChatMode");function kwe(t){return Rbn(t)||!t.isBuiltIn&&t.customTools===void 0}a(kwe,"shouldApplyGlobalToolsSetting");var ov=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[Nl.Ask,Nl.Agent,Nl.InlineAgent],o=await this.ctx.get(Kd).listCustomAgents(e||[],{includePlugins:!0});return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new Rwe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return Nl.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??Nl.Agent:Nl.Agent;case"InlineAgent":return Nl.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var zc=class extends Error{static{a(this,"CanceledError")}constructor(){super("Canceled"),this.name="Canceled"}};p();var FKe=class{constructor(){this._tools=new Map}static{a(this,"ToolRegistry")}registerTool(e){this._tools.set(e.id,e)}unregisterTool(e){return this._tools.delete(e)}getTool(e){return this._tools.get(e)}listTools(){return Array.from(this._tools.values())}};p();p();p();var VVo=new pe("conversationProgress"),Lq={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var Bc=class{constructor(e){this.ctx=e;this.progressEntries=new Sn(250)}static{a(this,"ConversationProgress")}async begin(e,r,n){let o={status:"open",handler:n};this.progressEntries.set(e.id,o),await o.handler.begin(this.ctx,e,r)}async report(e,r,n){let o=this.getProgressEntry(e);if(o.status==="open")await o.handler.report(this.ctx,e,r,n);else{let s=Object.keys(n).filter(c=>n[c]!==void 0);VVo.debug(this.ctx,`conversationProgress.report(): dropped because status is '${o.status}' (not open) for conversation ${e.id}. Dropped payload fields: [${s.join(", ")}]. If tokenUsage is among dropped fields, this is a cause of token usage not reaching $progress.`)}}async end(e,r,n){let o=this.getProgressEntry(e);o.status==="open"&&(this.progressEntries.set(e.id,{...o,status:"done",updatedAt:Date.now()}),await o.handler.end(this.ctx,e,r,n))}async cancel(e,r,n){let o=this.getProgressEntry(e);o.status==="open"&&(this.progressEntries.set(e.id,{...o,status:"cancelled",updatedAt:Date.now()}),await o.handler.cancel(this.ctx,e,r,n))}getCurrentHandler(e){return this.progressEntries.get(e.id)?.handler}getProgressEntry(e){let r=this.progressEntries.get(e.id);if(r===void 0)throw new Error(`No work done token for conversation ${e.id}`);return r.status!=="open"&&ot.error(this.ctx,`Work done token for conversation ${e.id} is already ${r.status}, last updated at ${r.updatedAt}`),r}};p();p();p();var Ii={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic",Ollama:"Ollama"},WVo="http://localhost:11434";function ob(t){return t===Ii.Ollama}a(ob,"isOllama");function jqt(t){let e=(t?.trim()||WVo).replace(/\/+$/,"");return e=e.replace(/\/v1(?:\/chat\/completions)?$/,""),e}a(jqt,"normalizeOllamaHost");function UKe(t){return`${jqt(t)}/v1`}a(UKe,"resolveOllamaBaseUrl");var zVo=new Set(Object.values(Ii));function VO(t){return!zVo.has(t)}a(VO,"isCustomEndpointProvider");var Pwe="chatCompletions",YVo=128e3,KVo=16e3,JVo=1e5,ZVo=8192;function Dwe(t){return VO(t)?{maxInputTokens:YVo,maxOutputTokens:KVo}:{maxInputTokens:JVo,maxOutputTokens:ZVo}}a(Dwe,"getDefaultTokenLimits");function WO(t){switch(t){case Ii.Azure:return 1;case Ii.Ollama:return 2;default:return 0}}a(WO,"getAuthTypeForProvider");function Pbn(t){switch(t){case"responses":return"responses";case"messages":return"v1/messages";default:return"completions"}}a(Pbn,"customEndpointApiTypeToEndpoint");function Nwe(t,e){let r=t.trim();r.endsWith("/")&&(r=r.slice(0,-1));let n=["/v1/messages","/chat/completions","/responses","/messages"];for(let s of n)if(r.endsWith(s)){r=r.slice(0,-s.length);break}let o=/\/v\d+$/;return e==="messages"?r.replace(o,""):o.test(r)?r:`${r}/v1`}a(Nwe,"resolveCustomEndpointBaseUrl");function Bue(t){return t===Ii.OpenAI||t===Ii.Gemini||t===Ii.Groq||t===Ii.OpenRouter||t===Ii.Anthropic}a(Bue,"isOpenAICompatible");async function zO(t,e,r){let n=new as(t.get(Un)),o=await n.getStoredModelConfigs(e),s=o&&o[r]&&o[r].isRegistered!==!1?o[r]:void 0,c=s?.modelCapabilities,l=c?.name||r,u=VO(e),d=Dwe(e),f=c?.maxInputTokens??d.maxInputTokens,h=c?.maxOutputTokens??d.maxOutputTokens,m=s?.deploymentUrl,g;u&&(g=(await n.getProviderConfig(e))?.apiType??Pwe);let A=m;return ob(e)&&(A=(await n.getProviderConfig(e))?.url),{modelId:r,uiName:l,modelFamily:kn.BYOK,providerName:e,deploymentUrl:A,apiType:g,maxRequestTokens:f,maxResponseTokens:h,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!!c?.toolCalling,supportsThinking:!!c?.thinking,reasoningEfforts:c?.supportsReasoningEffort,originalBillingMultiplier:0}}a(zO,"resolveModelConfiguration");async function QKe(t,e,r){return await new as(t.get(Un)).getAPIKey(e,r)}a(QKe,"resolveModelKey");function Dbn(t,e){let{protocol:r,hostname:n,pathname:o}=new URL(e);if(o.endsWith("/chat/completions"))return e;if(n.endsWith(".models.ai.azure.com")||n.endsWith(".inference.ml.azure.com"))return`${r}//${n}/v1/chat/completions`;if(n.endsWith(".openai.azure.com"))return`${r}//${n}/openai/deployments/${t}/chat/completions?api-version=2025-01-01-preview`;throw new Error(`Unrecognized Azure deployment URL: ${e}`)}a(Dbn,"resolveAzureUrl");function Bq(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(Bq,"isBYOKEnabled");var sv="byok",as=class t{constructor(e){this.persistenceManager=e}static{a(this,"BYOKPersistence")}static{this._writeQueue=Promise.resolve()}static enqueue(e){let r=t._writeQueue.then(e,e);return t._writeQueue=r.then(()=>{},()=>{}),r}modelApiKeyKey(e,r){return`${e}-${r}-api-key`}providerApiKeyKey(e){return`${e}-api-key`}modelsConfigKey(e){return`${e}-models-config`}providerConfigKey(e){return`${e}-provider-config`}async getAPIKey(e,r){if(r){let o=await this.persistenceManager.read(sv,this.modelApiKeyKey(e,r));if(o)return o}return await this.persistenceManager.read(sv,this.providerApiKeyKey(e))}async storeAPIKey(e,r,n,o){return t.enqueue(()=>this.storeAPIKeyUnserialized(e,r,n,o))}async deleteAPIKey(e,r,n){return t.enqueue(async()=>{r!==2&&(r===0?await this.persistenceManager.delete(sv,this.providerApiKeyKey(e)):r===1&&n&&await this.persistenceManager.delete(sv,this.modelApiKeyKey(e,n)))})}async getStoredModelConfigs(e){return await this.persistenceManager.read(sv,this.modelsConfigKey(e))||{}}async getProviderConfig(e){return await this.persistenceManager.read(sv,this.providerConfigKey(e))}async saveProviderConfig(e,r){return t.enqueue(async()=>{await this.persistenceManager.update(sv,this.providerConfigKey(e),r)})}async deleteProviderConfig(e){return t.enqueue(async()=>{await this.persistenceManager.delete(sv,this.providerConfigKey(e))})}async listCustomProviderNames(){let e=await this.persistenceManager.listKeys(sv),r=this.providerConfigKey(""),n=new Set(Object.values(Ii));return e.filter(o=>o.endsWith(r)).map(o=>o.slice(0,-r.length)).filter(o=>!n.has(o))}async listAllProviderNames(){let e=await this.listCustomProviderNames();return Array.from(new Set([...Object.values(Ii),...e]))}async getAllModels(e){let r=[];if(!Bq(await e.get(Qt).getToken()))return r;for(let n of await this.listAllProviderNames()){let o=await this.getStoredModelConfigs(n);r.push(...Object.keys(o).map(s=>({name:s,provider:n,capabilities:o[s].modelCapabilities})))}return r}async saveModelConfig(e,r,n,o,s){return t.enqueue(async()=>{let c=await this.getStoredModelConfigs(e);c[r]=n,await this.persistenceManager.update(sv,this.modelsConfigKey(e),c),o&&s&&await this.storeAPIKeyUnserialized(e,o,s,r)})}async storeAPIKeyUnserialized(e,r,n,o){n!==2&&(n===0?await this.persistenceManager.update(sv,this.providerApiKeyKey(e),r):n===1&&o&&await this.persistenceManager.update(sv,this.modelApiKeyKey(e,o),r))}async removeModelConfig(e,r){return t.enqueue(async()=>{let n=await this.getStoredModelConfigs(e),o=n[r];o&&(delete n[r],await this.persistenceManager.update(sv,this.modelsConfigKey(e),n),o.deploymentUrl&&await this.persistenceManager.delete(sv,this.modelApiKeyKey(e,r)))})}async removeAllModelConfigs(e){return t.enqueue(async()=>{await this.persistenceManager.delete(sv,this.modelsConfigKey(e))})}};p();p();p();p();function Hqt(t,e){let r=vJ(t,e);return r===-1?void 0:t[r]}a(Hqt,"findLastMonotonous");function vJ(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?HKe.isErrorNoTelemetry(e)?new HKe(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},JVo=new Hqt;function Bue(t){Mwe(t)||JVo.onUnexpectedError(t)}a(Bue,"onUnexpectedError");var Gqt="Canceled";function Mwe(t){return t instanceof E0?!0:t instanceof Error&&t.name===Gqt&&t.message===Gqt}a(Mwe,"isCancellationError");var E0=class extends Error{static{a(this,"CancellationError")}constructor(){super(Gqt),this.name=this.message}};var HKe=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Yc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function $qt(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n{let o=Math.sin(n++)*179426549;return o-Math.floor(o)},"rand")}else r=Math.random;for(let n=t.length-1;n>0;n-=1){let o=Math.floor(r()*(n+1)),s=t[n];t[n]=t[o],t[o]=s}}a(Wqt,"shuffle");var Mbn;(l=>{function t(u){return u<0}l.isLessThan=t,a(t,"isLessThan");function e(u){return u<=0}l.isLessThanOrEqual=e,a(e,"isLessThanOrEqual");function r(u){return u>0}l.isGreaterThan=r,a(r,"isGreaterThan");function n(u){return u===0}l.isNeitherLessOrGreaterThan=n,a(n,"isNeitherLessOrGreaterThan"),l.greaterThan=1,l.lessThan=-1,l.neitherLessOrGreaterThan=0})(Mbn||={});function Fue(t,e){return(r,n)=>e(t(r),t(n))}a(Fue,"compareBy");var Uue=a((t,e)=>t-e,"numberComparator");var Nbn=class t{constructor(e){this.iterate=e}static{a(this,"CallbackIterable")}static{this.empty=new t(e=>{})}forEach(e){this.iterate(r=>(e(r),!0))}toArray(){let e=[];return this.iterate(r=>(e.push(r),!0)),e}filter(e){return new t(r=>this.iterate(n=>e(n)?r(n):!0))}map(e){return new t(r=>this.iterate(n=>r(e(n))))}some(e){let r=!1;return this.iterate(n=>(r=e(n),!r)),r}findFirst(e){let r;return this.iterate(n=>e(n)?(r=n,!1):!0),r}findLast(e){let r;return this.iterate(n=>(e(n)&&(r=n),!0)),r}findLastMaxBy(e){let r,n=!0;return this.iterate(o=>((n||Mbn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function Owe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(Owe,"sumBy");p();function Fbn(t,e){let r=Object.create(null);for(let n of t){let o=e(n),s=r[o];s||(s=r[o]=[]),s.push(n)}return r}a(Fbn,"groupBy");var Lbn,Bbn,Obn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[Lbn]="SetWithKey";for(let n of e)this.add(n)}static{a(this,"SetWithKey")}get size(){return this._map.size}add(e){let r=this.toKey(e);return this._map.set(r,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,r){this._map.forEach(n=>e.call(r,n,n,this))}[(Bbn=Symbol.iterator,Lbn=Symbol.toStringTag,Bbn)](){return this.values()}};p();function zqt(t,e){let r=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=t.apply(r,arguments)}finally{e()}else o=t.apply(r,arguments);return o}}a(zqt,"createSingleCallFunction");p();var Yqt;(S=>{function t(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}S.is=t,a(t,"is");let e=Object.freeze([]);function r(){return e}S.empty=r,a(r,"empty");function*n(T){yield T}S.single=n,a(n,"single");function o(T){return t(T)?T:n(T)}S.wrap=o,a(o,"wrap");function s(T){return T||e}S.from=s,a(s,"from");function*c(T){for(let w=T.length-1;w>=0;w--)yield T[w]}S.reverse=c,a(c,"reverse");function l(T){return!T||T[Symbol.iterator]().next().done===!0}S.isEmpty=l,a(l,"isEmpty");function u(T){return T[Symbol.iterator]().next().value}S.first=u,a(u,"first");function d(T,w){let R=0;for(let x of T)if(w(x,R++))return!0;return!1}S.some=d,a(d,"some");function f(T,w){for(let R of T)if(w(R))return R}S.find=f,a(f,"find");function*h(T,w){for(let R of T)w(R)&&(yield R)}S.filter=h,a(h,"filter");function*m(T,w){let R=0;for(let x of T)yield w(x,R++)}S.map=m,a(m,"map");function*g(T,w){let R=0;for(let x of T)yield*w(x,R++)}S.flatMap=g,a(g,"flatMap");function*A(...T){for(let w of T)yield*w}S.concat=A,a(A,"concat");function y(T,w,R){let x=R;for(let k of T)x=w(x,k);return x}S.reduce=y,a(y,"reduce");function*_(T,w,R=T.length){for(w<-T.length&&(w=0),w<0&&(w+=T.length),R<0?R+=T.length:R>T.length&&(R=T.length);we.toString(),"defaultToKey")}set(e,r){return this.map.set(this.toKey(e),new Kqt(e,r)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,r){typeof r<"u"&&(e=e.bind(r));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(Qbn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},qbn,Ubn=class{constructor(e,r){this[qbn]="ResourceSet";!e||typeof e=="function"?this._map=new GKe(e):(this._map=new GKe(r),e.forEach(this.add,this))}static{a(this,"ResourceSet")}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,r){this._map.forEach((n,o)=>e.call(r,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(qbn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var jbn,Jqt=class{constructor(){this[jbn]="LinkedMap";this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}static{a(this,"LinkedMap")}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=0){let n=this._map.get(e);if(n)return r!==0&&this.touch(n,r),n.value}set(e,r,n=0){let o=this._map.get(e);if(o)o.value=r,n!==0&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}[(jbn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}},Zqt=class extends Jqt{static{a(this,"Cache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=2){return super.get(e,r)}peek(e){return super.get(e,0)}set(e,r){return super.set(e,r,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},$Ke=class extends Zqt{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};var VKe=class{constructor(){this.map=new Map}static{a(this,"SetMap")}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};var XVo=!1,Que=null;var Hbn=class t{constructor(){this.livingDisposables=new Map}static{a(this,"DisposableTracker")}static{this.idx=0}getDisposableData(e){let r=this.livingDisposables.get(e);return r||(r={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,r)),r}trackDisposable(e){let r=this.getDisposableData(e);r.source||(r.source=new Error().stack)}setParent(e,r){let n=this.getDisposableData(e);n.parent=r}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,r){let n=r.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),r):e;return r.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,r){let n;if(r)n=r;else{let u=new Map,d=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,u).isSingleton);if(d.length===0)return;let f=new Set(d.map(h=>h.value));if(n=d.filter(h=>!(h.parent&&f.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(u){function d(h,m){for(;h.length>0&&m.some(g=>typeof g=="string"?g===h[0]:h[0].match(g));)h.shift()}a(d,"removePrefix");let f=u.source.split(` +`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},XVo=new Gqt;function Fue(t){Mwe(t)||XVo.onUnexpectedError(t)}a(Fue,"onUnexpectedError");var $qt="Canceled";function Mwe(t){return t instanceof v0?!0:t instanceof Error&&t.name===$qt&&t.message===$qt}a(Mwe,"isCancellationError");var v0=class extends Error{static{a(this,"CancellationError")}constructor(){super($qt),this.name=this.message}};var HKe=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Yc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function Vqt(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n{let o=Math.sin(n++)*179426549;return o-Math.floor(o)},"rand")}else r=Math.random;for(let n=t.length-1;n>0;n-=1){let o=Math.floor(r()*(n+1)),s=t[n];t[n]=t[o],t[o]=s}}a(zqt,"shuffle");var Obn;(l=>{function t(u){return u<0}l.isLessThan=t,a(t,"isLessThan");function e(u){return u<=0}l.isLessThanOrEqual=e,a(e,"isLessThanOrEqual");function r(u){return u>0}l.isGreaterThan=r,a(r,"isGreaterThan");function n(u){return u===0}l.isNeitherLessOrGreaterThan=n,a(n,"isNeitherLessOrGreaterThan"),l.greaterThan=1,l.lessThan=-1,l.neitherLessOrGreaterThan=0})(Obn||={});function Uue(t,e){return(r,n)=>e(t(r),t(n))}a(Uue,"compareBy");var Que=a((t,e)=>t-e,"numberComparator");var Mbn=class t{constructor(e){this.iterate=e}static{a(this,"CallbackIterable")}static{this.empty=new t(e=>{})}forEach(e){this.iterate(r=>(e(r),!0))}toArray(){let e=[];return this.iterate(r=>(e.push(r),!0)),e}filter(e){return new t(r=>this.iterate(n=>e(n)?r(n):!0))}map(e){return new t(r=>this.iterate(n=>r(e(n))))}some(e){let r=!1;return this.iterate(n=>(r=e(n),!r)),r}findFirst(e){let r;return this.iterate(n=>e(n)?(r=n,!1):!0),r}findLast(e){let r;return this.iterate(n=>(e(n)&&(r=n),!0)),r}findLastMaxBy(e){let r,n=!0;return this.iterate(o=>((n||Obn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function Owe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(Owe,"sumBy");p();function Ubn(t,e){let r=Object.create(null);for(let n of t){let o=e(n),s=r[o];s||(s=r[o]=[]),s.push(n)}return r}a(Ubn,"groupBy");var Bbn,Fbn,Lbn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[Bbn]="SetWithKey";for(let n of e)this.add(n)}static{a(this,"SetWithKey")}get size(){return this._map.size}add(e){let r=this.toKey(e);return this._map.set(r,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,r){this._map.forEach(n=>e.call(r,n,n,this))}[(Fbn=Symbol.iterator,Bbn=Symbol.toStringTag,Fbn)](){return this.values()}};p();function Yqt(t,e){let r=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=t.apply(r,arguments)}finally{e()}else o=t.apply(r,arguments);return o}}a(Yqt,"createSingleCallFunction");p();var Kqt;(S=>{function t(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}S.is=t,a(t,"is");let e=Object.freeze([]);function r(){return e}S.empty=r,a(r,"empty");function*n(T){yield T}S.single=n,a(n,"single");function o(T){return t(T)?T:n(T)}S.wrap=o,a(o,"wrap");function s(T){return T||e}S.from=s,a(s,"from");function*c(T){for(let w=T.length-1;w>=0;w--)yield T[w]}S.reverse=c,a(c,"reverse");function l(T){return!T||T[Symbol.iterator]().next().done===!0}S.isEmpty=l,a(l,"isEmpty");function u(T){return T[Symbol.iterator]().next().value}S.first=u,a(u,"first");function d(T,w){let R=0;for(let x of T)if(w(x,R++))return!0;return!1}S.some=d,a(d,"some");function f(T,w){for(let R of T)if(w(R))return R}S.find=f,a(f,"find");function*h(T,w){for(let R of T)w(R)&&(yield R)}S.filter=h,a(h,"filter");function*m(T,w){let R=0;for(let x of T)yield w(x,R++)}S.map=m,a(m,"map");function*g(T,w){let R=0;for(let x of T)yield*w(x,R++)}S.flatMap=g,a(g,"flatMap");function*A(...T){for(let w of T)yield*w}S.concat=A,a(A,"concat");function y(T,w,R){let x=R;for(let k of T)x=w(x,k);return x}S.reduce=y,a(y,"reduce");function*_(T,w,R=T.length){for(w<-T.length&&(w=0),w<0&&(w+=T.length),R<0?R+=T.length:R>T.length&&(R=T.length);we.toString(),"defaultToKey")}set(e,r){return this.map.set(this.toKey(e),new Jqt(e,r)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,r){typeof r<"u"&&(e=e.bind(r));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(qbn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},jbn,Qbn=class{constructor(e,r){this[jbn]="ResourceSet";!e||typeof e=="function"?this._map=new GKe(e):(this._map=new GKe(r),e.forEach(this.add,this))}static{a(this,"ResourceSet")}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,r){this._map.forEach((n,o)=>e.call(r,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(jbn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var Hbn,Zqt=class{constructor(){this[Hbn]="LinkedMap";this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}static{a(this,"LinkedMap")}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=0){let n=this._map.get(e);if(n)return r!==0&&this.touch(n,r),n.value}set(e,r,n=0){let o=this._map.get(e);if(o)o.value=r,n!==0&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}[(Hbn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}},Xqt=class extends Zqt{static{a(this,"Cache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=2){return super.get(e,r)}peek(e){return super.get(e,0)}set(e,r){return super.set(e,r,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},$Ke=class extends Xqt{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};var VKe=class{constructor(){this.map=new Map}static{a(this,"SetMap")}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};var tWo=!1,que=null;var Gbn=class t{constructor(){this.livingDisposables=new Map}static{a(this,"DisposableTracker")}static{this.idx=0}getDisposableData(e){let r=this.livingDisposables.get(e);return r||(r={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,r)),r}trackDisposable(e){let r=this.getDisposableData(e);r.source||(r.source=new Error().stack)}setParent(e,r){let n=this.getDisposableData(e);n.parent=r}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,r){let n=r.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),r):e;return r.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,r){let n;if(r)n=r;else{let u=new Map,d=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,u).isSingleton);if(d.length===0)return;let f=new Set(d.map(h=>h.value));if(n=d.filter(h=>!(h.parent&&f.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(u){function d(h,m){for(;h.length>0&&m.some(g=>typeof g=="string"?g===h[0]:h[0].match(g));)h.shift()}a(d,"removePrefix");let f=u.source.split(` `).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return d(f,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),f.reverse()}a(o,"getStackTracePath");let s=new VKe;for(let u of n){let d=o(u);for(let f=0;f<=d.length;f++)s.add(d.slice(0,f).join(` -`),u)}n.sort(Fue(u=>u.idx,Uue));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;hu.idx,Que));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;ho(_)[h]),_=>_);delete y[d[h]];for(let[_,E]of Object.entries(y))f.unshift(` - stacktraces of ${E.length} other leaks continue with ${_}`);f.unshift(m)}c+=` +`)),y=Ubn([...A].map(_=>o(_)[h]),_=>_);delete y[d[h]];for(let[_,E]of Object.entries(y))f.unshift(` - stacktraces of ${E.length} other leaks continue with ${_}`);f.unshift(m)}c+=` ==================== Leaking disposable ${l}/${n.length}: ${u.value.constructor.name} ==================== @@ -2449,7 +2449,7 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};function eWo(t){Que=t}a(eWo,"setDisposableTracker");if(XVo){let t="__is_disposable_tracked__";eWo(new class{trackDisposable(e){let r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==av.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==av.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function ejt(t){return Que?.trackDisposable(t),t}a(ejt,"trackDisposable");function tjt(t){Que?.markAsDisposed(t)}a(tjt,"markAsDisposed");function Xqt(t,e){Que?.setParent(t,e)}a(Xqt,"setParentOfDisposable");function tWo(t,e){if(Que)for(let r of t)Que.setParent(r,e)}a(tWo,"setParentOfDisposables");function Gbn(t){if(Yqt.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(Gbn,"dispose");function $bn(...t){let e=WKe(()=>Gbn(t));return tWo(t,e),e}a($bn,"combinedDisposable");function WKe(t){let e=ejt({dispose:zqt(()=>{tjt(e),t()})});return e}a(WKe,"toDisposable");var Fq=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;ejt(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(tjt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Gbn(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return Xqt(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),Xqt(e,null))}},av=class{constructor(){this._store=new Fq;ejt(this),Xqt(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){tjt(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};p();function que(t){let e=new Date(t);if(Number.isNaN(e.getTime()))return t;let r=new Date,n=e.getFullYear()!==r.getFullYear();return new Intl.DateTimeFormat("en-US",n?{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}:{month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}).format(e)}a(que,"formatResetDate");var Uq=class{static{a(this,"QuotaWarningNotifier")}};var vJ=class{static{a(this,"QuotaChangeNotifier")}};var rjt=[50,75,90,95],Ru=class extends av{constructor(r){super();this._shownThresholds={chat:new Set,completions:new Set,premium_interactions:new Set};this._hasNotifiedOverage={};this._isTBBEnabled=!1;this._canUpgradePlan=!1;this._turnCredits=new Map;this._ctx=r,this._register(ws(r,n=>{let o=n.userInfo?.raw?.analytics_tracking_id;if(o!==this._userId){for(let s of Object.values(this._shownThresholds))s.clear();this._hasNotifiedOverage={},this._turnCredits.clear(),this._userId=o}this._copilotPlan=n.userInfo.copilotPlan,this._isTBBEnabled=!!n.userInfo?.isTBBEnabled,this._canUpgradePlan=!!n.userInfo?.canUpgradePlan,this.processUserInfoQuotaSnapshot(n.userInfo?.raw)}))}static{a(this,"ChatQuotaService")}get overageEnabled(){return this._quotaInfo?.chat?.overageEnabled===!0||this._quotaInfo?.completions?.overageEnabled===!0||this._quotaInfo?.premium_interactions?.overageEnabled===!0}get quotaExhausted(){return this._quotaInfo?.premium_interactions?this._quotaInfo.premium_interactions.used>=this._quotaInfo.premium_interactions.quota&&!this._quotaInfo.premium_interactions.overageEnabled:!1}setLastCopilotUsage(r,n){let o=r/1e9;this.addAic(o,n)}addAic(r,n){r>0&&this._turnCredits.set(n,(this._turnCredits.get(n)??0)+r)}transferTurnCredits(r,n){if(r===n)return;let o=this._turnCredits.get(r);o!==void 0&&(this._turnCredits.delete(r),this.addAic(o,n))}resetTurnCredits(r){this._turnCredits.delete(r)}getCreditsForTurn(r){return this._turnCredits.get(r)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(r){let n=r.get("x-quota-snapshot-premium_models")||r.get("x-quota-snapshot-premium_interactions"),o=r.get("x-quota-snapshot-chat"),s=r.get("x-quota-snapshot-completions");!n&&!o&&!s||(this._quotaInfo={chat:this._parseQuotaHeader(o),completions:this._parseQuotaHeader(s),premium_interactions:this._parseQuotaHeader(n)},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse()))}processUserInfoQuotaSnapshot(r){if(!r?.quota_snapshots)return;let{chat:n,completions:o,premium_interactions:s}=r.quota_snapshots;this._quotaInfo={chat:n?this._buildSnapshotFromRaw(n):void 0,completions:o?this._buildSnapshotFromRaw(o):void 0,premium_interactions:s?this._buildSnapshotFromRaw(s):void 0},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse())}_parseQuotaHeader(r){if(r)try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("ov")||"0.0"),c=n.get("ovPerm")==="true",l=Number.parseFloat(n.get("rem")||"0.0"),u=n.get("rst")??"",d=Math.max(0,o*(1-l/100)),f=o<0;return{quota:o,used:d,percentRemaining:l,overageUsed:s,overageEnabled:c,resetDate:u,unlimited:f}}catch(n){console.error("Failed to parse quota header",n);return}}_buildSnapshotFromRaw(r){return{overageEnabled:r.overage_permitted,overageUsed:r.overage_count,overageEntitlement:r.overage_entitlement,creditsUsed:r.credits_used,quota:r.entitlement,percentRemaining:r.percent_remaining,resetDate:r.quota_reset_at!=null&&r.quota_reset_at!==0?new Date(r.quota_reset_at*1e3).toISOString():"",used:Math.max(0,r.entitlement*(1-r.percent_remaining/100)),unlimited:r.unlimited}}async sendQuotaChangeNotification(){if(!this._quotaInfo)return;let r={chat:this._quotaInfo.chat,completions:this._quotaInfo.completions,premium_interactions:this._quotaInfo.premium_interactions,copilotPlan:this._copilotPlan};if(this._hasQuotaChanged(r)){this._lastSentQuotaParams=r;try{await this._ctx.get(vJ).notifyQuotaChange(r)}catch(n){console.warn("Failed to send quota change notification",n)}}}_hasQuotaChanged(r){let n=this._lastSentQuotaParams;return n?n.copilotPlan!==r.copilotPlan||this._hasSnapshotChanged(n.chat,r.chat)||this._hasSnapshotChanged(n.completions,r.completions)||this._hasSnapshotChanged(n.premium_interactions,r.premium_interactions):!0}_hasSnapshotChanged(r,n){return r===void 0&&n===void 0?!1:r===void 0||n===void 0?!0:r.overageUsed!==n.overageUsed||r.overageEnabled!==n.overageEnabled||r.percentRemaining!==n.percentRemaining||r.quota!==n.quota||r.used!==n.used||r.resetDate!==n.resetDate}_isSnapshotNotificationActive(r){return r?.notified?!r.resetDate||new Date=0;s--){let c=rjt[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(rjt[l]);return c}}}async _checkAndNotifyOverageSnapshot(r,n,o){if(!(!r||r.quota<=0)&&r.percentRemaining===0&&r.overageEnabled&&!this._isSnapshotNotificationActive(this._hasNotifiedOverage[n])){this._hasNotifiedOverage={...this._hasNotifiedOverage,[n]:{notified:!0,resetDate:r.resetDate}};try{await this._ctx.get(Uq).notifyQuotaWarning(this._buildWarningParams(o,"info"))}catch{}}}async checkAndNotifyOverageInUse(){this._quotaInfo&&(this._copilotPlan==="free"?(await this._checkAndNotifyOverageSnapshot(this._quotaInfo.chat,"chat","You are currently on overage spend until your chat limit resets."),await this._checkAndNotifyOverageSnapshot(this._quotaInfo.completions,"completions","You are currently on overage spend until your completions limit resets.")):await this._checkAndNotifyOverageSnapshot(this._quotaInfo.premium_interactions,"premium_interactions","You are currently on overage spend until your monthly limit resets."))}async checkAndNotifyQuotaThreshold(){if(!this._quotaInfo)return;let r=a(async(n,o)=>{let s=this._shownThresholds[o];if(this.clearStaleThresholds(n,s),this.checkThreshold(n,s)===void 0||!n)return;let l=n&&100-n.percentRemaining>=90?"warning":"info",u=100-n.percentRemaining,d=this.getQuotaThresholdMessage(o,u,n.resetDate);try{await this._ctx.get(Uq).notifyQuotaWarning(this._buildWarningParams(d,l))}catch{}},"notifyForSnapshot");this._copilotPlan==="free"?(await r(this._quotaInfo.chat,"chat"),await r(this._quotaInfo.completions,"completions")):await r(this._quotaInfo.premium_interactions,"premium_interactions")}getQuotaThresholdMessage(r,n,o){return r==="chat"||r==="completions"?n>=95?`You're close to your ${r} limit. Upgrade your plan to continue uninterrupted.`:`You've used over ${n}% of your ${r} budget. Upgrade your plan to continue uninterrupted.`:o?`You've used over ${n}% of your included AI credits. Limits reset on ${que(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function zKe(t){let e=await t.get(Fr).resolveSession();if(e){let r=await USe(t,e);if(r.ok){let n=await r.json();t.get(Ru).processUserInfoQuotaSnapshot(n)}}}a(zKe,"refreshUserQuota");p();p();var YKe=new pe("openAICompatibleLMProvider"),jue={[Ii.OpenAI]:"https://api.openai.com/v1",[Ii.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[Ii.Groq]:"https://api.groq.com/openai/v1",[Ii.OpenRouter]:"https://openrouter.ai/api/v1",[Ii.Anthropic]:"https://api.anthropic.com/v1"},sb=class{constructor(e,r){this._lastFetchTime=0;this.providerName=e,this.ctx=r}static{a(this,"BaseOpenAICompatibleLMProvider")}async getAllModels(e){await this.ensureKnownModelsCache();try{let r=this.getFetchModelUrl(),n={"Content-Type":"application/json"},o=await new as(this.ctx.get(Un)).getAPIKey(this.providerName);o&&(n.Authorization=`Bearer ${o}`);let s=await this.ctx.get(Jt).fetch(r,{method:"GET",headers:n});if(!s.ok)throw new Error(`Failed to fetch models: ${s.status} ${s.statusText}`);let c=await s.json();if(c.error)throw new Error(`API Error: ${JSON.stringify(c.error)}`);let l=[];for(let u of c.data){let d=this._knownModels?.[u.id]??this.resolveModelCapabilities(u);d&&l.push({providerName:this.providerName,modelId:u.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:d})}return l}catch(r){throw YKe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,r),r}}resolveModelCapabilities(e){}getBaseUrl(){let e=jue[this.providerName];if(!e)throw new Error(`Unsupported provider: ${this.providerName}`);return e}getFetchModelUrl(){return`${this.getBaseUrl()}/models`}async ensureKnownModelsCache(){let e=Date.now();if(!this._knownModels){try{this._knownModels=await this.fetchKnownModelList()}catch(n){YKe.error(this.ctx,`Failed to fetch known models list for ${this.providerName} provider:`,n),this._knownModels=void 0}this._lastFetchTime=e}}async fetchKnownModelList(){let e=await(await this.ctx.get(Jt).fetch("https://main.vscode-cdn.net/extensions/copilotChat.json",{method:"GET"})).json(),r;return e.version!==1?r={}:r=e.modelInfo[this.providerName]||{},r}};p();async function*Lwe(t,e){for await(let r of t)yield e(r)}a(Lwe,"asyncIterableMap");async function*Vbn(t,e){for await(let r of t)await e(r)&&(yield r)}a(Vbn,"asyncIterableFilter");async function*Bwe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(Bwe,"asyncIterableMapFilter");p();var KKe="interleaved-thinking-2025-05-14",Wbn="2023-06-01";p();var p2=class{static{a(this,"EndpointStrategyFactory")}static{this.strategies=new Map}static register(e){this.strategies.set(e.name,e)}static getStrategy(e){let r=this.strategies.get(e);if(!r){let n=this.strategies.get("completions");if(!n)throw new Error(`No strategy registered for endpoint '${e}' and no fallback strategy available. Available: ${Array.from(this.strategies.keys()).join(", ")}`);return n}return r}static hasStrategy(e){return this.strategies.has(e)}};p();var dl=class{static{a(this,"ModelConfigurationProvider")}},JKe=class extends dl{constructor(r){super();this.ctx=r}static{a(this,"DefaultModelConfigurationProvider")}async getBestChatModelConfig(r,n,o=!1){let s=[];for(let c of r){let l=await this.getFirstMatchingChatModelConfiguration(c,n,o);l&&s.push(l)}if(s.length>0){let c=s.find(l=>l.isExperimental);return c||s[0]}throw ot.error(this.ctx,`No model configuration found for families: ${r.join(", ")}. Available models: ${JSON.stringify(await this.ctx.get(Ns).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(Ns).getMetadata(),o=nWo(n,r);if(o.length>0)return o[0]}async getFirstMatchingChatModelConfiguration(r,n,o){let s=await this.getFirstMatchingModelMetadata({family:r,type:"chat",supports:n,modelPickerEnabled:o});if(s===void 0)return;let c=s.supported_endpoints&&s.supported_endpoints.length>0?s.supported_endpoints:["/chat/completions"],l=s.capabilities.supports?.adaptive_thinking??!1,u=s.capabilities.supports?.reasoning_effort;return r===kn.Gpt35turbo||r===kn.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:ijt(6144,s),maxLongContextTokens:void 0,maxResponseTokens:njt(2048,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:r===kn.Gpt4||r===kn.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:ijt(10240,s),maxLongContextTokens:void 0,maxResponseTokens:njt(4096,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:r===kn.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await rWo(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:njt(4096,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:zbn(s),maxLongContextTokens:Ybn(s),maxResponseTokens:s.capabilities.limits?.max_output_tokens??4096,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}}async getModelConfigurationById(r){let o=(await this.ctx.get(Ns).getMetadata()).find(c=>c.id===r&&c.capabilities.type==="chat"&&c.model_picker_enabled===!0);if(!o)return;let s=o.supported_endpoints&&o.supported_endpoints.length>0?o.supported_endpoints:["/chat/completions"];return{modelId:o.id,uiName:o.name,modelFamily:o.capabilities.family,maxRequestTokens:zbn(o),maxLongContextTokens:Ybn(o),maxResponseTokens:o.capabilities.limits?.max_output_tokens??4096,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:o.capabilities.tokenizer,isExperimental:o.isExperimental??!1,stream:o.capabilities.supports?.streaming??!1,toolCalls:o.capabilities.supports?.tool_calls??!1,supportedEndpoints:s,supportsAdaptiveThinking:o.capabilities.supports?.adaptive_thinking??!1,reasoningEfforts:o.capabilities.supports?.reasoning_effort,originalBillingMultiplier:o.billing?.multiplier??0}}async getFirstMatchingEmbeddingModelConfiguration(r){let n=await this.getFirstMatchingModelMetadata({family:r,type:"embeddings"});if(n!==void 0&&r===kmn.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function rWo(t,e){let r=t.get(tr),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),ijt(o,e)}a(rWo,"getExpRequestTokens");function ijt(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(ijt,"getRequestTokens");function zbn(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(zbn,"getMaxRequestTokens");function Ybn(t){return t.billing?.token_prices?.long_context?.context_max}a(Ybn,"getMaxLongContextTokens");function njt(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(njt,"getResponseTokens");function nWo(t,e){return t.filter(r=>r.capabilities.type!==e.type||r.capabilities.family!==e.family&&!(r.is_chat_fallback===!0&&r.id===e.family)||r.capabilities.family===e.family&&r.id!==e.family&&r.is_chat_fallback===!0||e.modelPickerEnabled===!0&&!r.model_picker_enabled?!1:r.capabilities.supports===void 0||e.supports===void 0?!0:Object.keys(e.supports).every(n=>e.supports?.[n]===r.capabilities.supports?.[n]))}a(nWo,"filterModelsByCapabilities");function YO(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(YO,"pickReasoningEffort");function iWo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(iWo,"shouldUseResponsesApi");function oWo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(oWo,"shouldUseMessagesApi");var Kbn=["completions","responses","v1/messages"];function ZKe(t,e){return e?"v1/messages":t&&iWo(t)?"responses":"completions"}a(ZKe,"resolveEndpointRoute");function XKe(t,e){if(!oWo(e))return!1;let r=kt(t,ze.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(XKe,"willUseMessagesEndpoint");p();function eJe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(eJe,"isCodexStyleGptModel");function Jbn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(Jbn,"isGpt5PlusFamily");function Zbn(t){return t?t.toLowerCase().startsWith("claude"):!1}a(Zbn,"isAnthropicModel");p();p();p();var pT=class{static{a(this,"RateLimitNotifier")}},tJe=class extends pT{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var ojt=[50,75,90,95],KO=class extends av{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(ws(r,()=>{this._shownSessionThresholds.clear(),this._shownWeeklyThresholds.clear(),this.clearRateLimits()}))}static{a(this,"ChatUsageRateLimitService")}get weeklyRateLimit(){return this._weeklyRateLimit}get sessionRateLimit(){return this._sessionRateLimit}clearRateLimits(){this._weeklyRateLimit=void 0,this._sessionRateLimit=void 0}processRateLimitHeaders(r){let n=r.get("x-usage-ratelimit-weekly"),o=r.get("x-usage-ratelimit-session");if(!n&&!o)return;n&&(this._weeklyRateLimit=this.parseRateLimitHeader(n)),o&&(this._sessionRateLimit=this.parseRateLimitHeader(o)),this.clearStaleThresholds(this._sessionRateLimit,this._shownSessionThresholds),this.clearStaleThresholds(this._weeklyRateLimit,this._shownWeeklyThresholds);let s=this.checkThreshold(this._sessionRateLimit,this._shownSessionThresholds,"session")??this.checkThreshold(this._weeklyRateLimit,this._shownWeeklyThresholds,"weekly");s&&this.ctx.get(pT).notifyRateLimitWarning(s)}clearStaleThresholds(r,n){if(!r){n.clear();return}let o=100-r.percentRemaining;for(let s of n)o=0;c--){let l=ojt[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(ojt[d]);let u=this.getRateLimitMessage(o,r);return{type:o,rateLimit:r,message:u}}}}getRateLimitMessage(r,n){let o=Math.round(100-n.percentRemaining),s=que(n.resetDate);return r==="session"?`You've used ${o}% of your session rate limit. Your session rate limit will reset on ${s}.`:`You've used ${o}% of your weekly rate limit. Your weekly rate limit will reset on ${s}.`}parseRateLimitHeader(r){try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("rem")||"0.0"),c=n.get("rst")||"";return{entitlement:o,percentRemaining:s,resetDate:c}}catch(n){console.error("Failed to parse rate limit header",n);return}}};p();var v0="https://aka.ms/github-copilot-rate-limit-error";function sWo(t){if(t<90)return`${t} ${t===1?"second":"seconds"}`;let e=Math.floor(t/60);if(t<=5400)return`${e} ${e===1?"minute":"minutes"}`;let r=Math.floor(e/60),n=e%60,o=`${r} ${r===1?"hour":"hours"}`;return n>0&&(o+=` ${n} ${n===1?"minute":"minutes"}`),o}a(sWo,"secondsToHumanReadableTime");var cv=class t{static{a(this,"CapiErrorTranslator")}static formatRequestId(e,r){let n=[];return e&&n.push(`Request ID: ${e}`),r&&n.push(`GitHub Request ID: ${r}`),n.length>0?` ${n.join(" | ")}`:""}static appendRequestId(e,r,n){return`${e}${t.formatRequestId(r,n)}`}static translateErrorMessage(e,r,n,o,s,c){let l;switch(e){case 466:l="Oops, your plugin is out of date. Please update it.";break;case 401:l="Oops, you are not authorized. Please sign in. If you are using a custom model, please check if the API key is still valid.";break;case 402:l=r||"Oops, you need to upgrade your plan.";break;case 413:l="Oops, your request is too large. Please try again with a smaller input.";break;case 429:l=t.getRateLimitMessage(o,c);break;case 503:l=r||"Oops, the service is currently unavailable. Please try again later.";break;default:if(r&&r.trim().length>0){let u=360,d=t.formatRequestId(n,s),f="Sorry, an error occurred while generating a response. Details: ",h=u-f.length-d.length;if(r.length<=h)return`${f}${r}${d}`;{let m=r.substring(0,h);return`${f}${m}... Read more from logs.${d}`}}l="Sorry, an error occurred while generating a response.";break}return t.appendRequestId(l,n,s)}static getRateLimitMessage(e,r){let n=e===void 0?"a moment":sWo(e),o=r?.capiErrorCode,s=r?.suggestSwitchToAuto??!r?.isAuto;if(o?.startsWith("agent_mode_limit_exceeded"))return`Sorry, you have exceeded the agent mode rate limit. Please switch to ask mode and try again in ${n}. [Learn More](${v0})`;if(o?.startsWith("model_overloaded")||o?.startsWith("upstream_provider_rate_limit"))return s?`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n} or consider switching to Auto. [Learn More](${v0})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n}. [Learn More](${v0})`;if(o?.startsWith("user_global_rate_limited"))return r?.copilotPlan==="free"||r?.copilotPlan==="individual"||r?.copilotPlan==="individual_pro"?`You've hit your session rate limit. Please upgrade your plan or wait ${n} for your limit to reset. [Learn More](${v0})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${v0})`;if(o?.startsWith("user_weekly_rate_limited")){if(e!==void 0){let l=new Date(Date.now()+e*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"});return r?.copilotPlan==="free"||r?.copilotPlan==="individual"||r?.copilotPlan==="individual_pro"?s?`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${v0})`:`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l}. [Learn More](${v0})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${v0})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${v0})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${v0})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${v0})`}return o?.startsWith("user_model_rate_limited")?s?`You've hit the rate limit for this model. Please try switching to Auto or try again in ${n}. [Learn More](${v0})`:`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${v0})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${v0})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${v0})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${v0})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${v0})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${v0})`}static translate402Reason(e,r){let n=r.retryAfterHeader,o=r.retryAfterSeconds;if(e.includes("free_quota_exceeded"))return n?`You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait until ${new Date(n).toLocaleString()} for your limit to reset.`:"You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.";if(e.includes("additional_spend_limit_reached"))return"You've reached your additional usage limit for your plan. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.";if(e.includes("overage_limit_reached"))return r.isTBBEnabled?"You've reached your additional usage limit for your plan. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.":"You cannot accrue additional overages at this time. Please contact [GitHub Support](https://support.github.com/contact) to continue using Copilot.";if(e.includes("quota_exceeded")){if(r.isTBBEnabled){let s="";o!==void 0&&(s=` Quota resets on ${new Date(Date.now()+o*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}.`);let c=r.overageEnabled?"increase budget":"enable additional overages",l=r.canUpgradePlan?", upgrade your plan":"";switch(r.copilotPlan){case"free":return`You've used your monthly chat messages limit. Please upgrade your plan or wait for your allowance to renew.${s}`;case"individual":case"individual_pro":return`You've used your monthly AI Credits. Please ${c}${l} or wait for your allowance to renew.${s}`;case"individual_max":return`You've used your monthly AI Credits. Please ${c} or wait for your allowance to renew.${s}`;case"business":case"enterprise":return`You've used your monthly AI Credits. Please reach out to your organization's Copilot admin to ${c} or wait for your allowance to renew.${s}`;default:return`You've used your monthly AI Credits.${s}`}}switch(r.copilotPlan){case"free":return"You've reached your monthly chat messages quota. Upgrade to Copilot Pro (30-day free trial) or wait for your allowance to renew.";case"individual":return"You've reached your monthly chat messages quota. Please enable additional paid premium requests, upgrade to Copilot Pro+, or wait for your allowance to renew.";case"individual_pro":return"You've reached your monthly chat messages quota. Please enable additional paid premium requests or wait for your allowance to renew.";case"business":case"enterprise":return"You've reached your monthly chat messages quota. Please reach out to your organization's Copilot admin to enable additional paid premium requests or wait for your allowance to renew.";default:return"You've reached your monthly chat messages quota."}}return e.includes("session_quota_exceeded")?o!==void 0?`You've used your session quota. Wait until ${new Date(Date.now()+o*1e3).toLocaleString()} for your limit to reset.`:"You've used your session quota.":e.includes("billing_not_configured")?"You have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, you must select a billing entity via the GitHub site, under Settings > Copilot > Billing.":r.isTBBEnabled?"Usage limit exceeded. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.":"Quota Exceeded."}static translate400Reason(e,r){if(e.includes("off_topic"))return"filtered as off_topic by intent classifier: message was not programming related";if(e.includes("model_not_supported"))return r?`model is not supported: ${r}`:"model is not supported.";if(e.includes("model_max_prompt_tokens_exceeded"))return"model max prompt tokens exceeded."}};p();p();p();function Hue(t,e,r=!1){!e||!e.providerName||(e.providerName===Ii.Anthropic?(delete t.temperature,delete t.top_p):e.supportsThinking&&(delete t.temperature,!r&&"max_tokens"in t&&(t.max_completion_tokens=t.max_tokens,delete t.max_tokens)),r||delete t.max_tokens)}a(Hue,"adaptRequestForBYOKProvider");p();var Qq="copilot-edits-session";p();p();p();p();Fo();function rJe(t,e,r,n,o,s,c){return xtn(t,e,r,o,n,c),{completionText:e,meanLogProb:aWo(t,r),meanAlternativeLogProb:cWo(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:Dt(),finishReason:r.finish_reason}}a(rJe,"convertToAPIChoice");function aWo(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){Br.exception(t,r,"Error calculating mean prob")}}a(aWo,"calculateMeanLogProb");function cWo(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){Br.exception(t,r,"Error calculating mean prob")}}a(cWo,"calculateMeanAlternativeLogProb");function Gue(t,e){return s1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(Gue,"getTemperatureForSamples");var lWo={markdown:[` +`),{leaks:n,details:c}}};function rWo(t){que=t}a(rWo,"setDisposableTracker");if(tWo){let t="__is_disposable_tracked__";rWo(new class{trackDisposable(e){let r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==av.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==av.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function tjt(t){return que?.trackDisposable(t),t}a(tjt,"trackDisposable");function rjt(t){que?.markAsDisposed(t)}a(rjt,"markAsDisposed");function ejt(t,e){que?.setParent(t,e)}a(ejt,"setParentOfDisposable");function nWo(t,e){if(que)for(let r of t)que.setParent(r,e)}a(nWo,"setParentOfDisposables");function $bn(t){if(Kqt.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a($bn,"dispose");function Vbn(...t){let e=WKe(()=>$bn(t));return nWo(t,e),e}a(Vbn,"combinedDisposable");function WKe(t){let e=tjt({dispose:Yqt(()=>{rjt(e),t()})});return e}a(WKe,"toDisposable");var Fq=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;tjt(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(rjt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{$bn(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return ejt(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),ejt(e,null))}},av=class{constructor(){this._store=new Fq;tjt(this),ejt(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){rjt(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};p();function jue(t){let e=new Date(t);if(Number.isNaN(e.getTime()))return t;let r=new Date,n=e.getFullYear()!==r.getFullYear();return new Intl.DateTimeFormat("en-US",n?{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}:{month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}).format(e)}a(jue,"formatResetDate");var Uq=class{static{a(this,"QuotaWarningNotifier")}};var CJ=class{static{a(this,"QuotaChangeNotifier")}};var njt=[50,75,90,95],Ru=class extends av{constructor(r){super();this._shownThresholds={chat:new Set,completions:new Set,premium_interactions:new Set};this._hasNotifiedOverage={};this._isTBBEnabled=!1;this._canUpgradePlan=!1;this._turnCredits=new Map;this._ctx=r,this._register(ws(r,n=>{let o=n.userInfo?.raw?.analytics_tracking_id;if(o!==this._userId){for(let s of Object.values(this._shownThresholds))s.clear();this._hasNotifiedOverage={},this._turnCredits.clear(),this._userId=o}this._copilotPlan=n.userInfo.copilotPlan,this._isTBBEnabled=!!n.userInfo?.isTBBEnabled,this._canUpgradePlan=!!n.userInfo?.canUpgradePlan,this.processUserInfoQuotaSnapshot(n.userInfo?.raw)}))}static{a(this,"ChatQuotaService")}get overageEnabled(){return this._quotaInfo?.chat?.overageEnabled===!0||this._quotaInfo?.completions?.overageEnabled===!0||this._quotaInfo?.premium_interactions?.overageEnabled===!0}get quotaExhausted(){return this._quotaInfo?.premium_interactions?this._quotaInfo.premium_interactions.used>=this._quotaInfo.premium_interactions.quota&&!this._quotaInfo.premium_interactions.overageEnabled:!1}setLastCopilotUsage(r,n){let o=r/1e9;this.addAic(o,n)}addAic(r,n){r>0&&this._turnCredits.set(n,(this._turnCredits.get(n)??0)+r)}transferTurnCredits(r,n){if(r===n)return;let o=this._turnCredits.get(r);o!==void 0&&(this._turnCredits.delete(r),this.addAic(o,n))}resetTurnCredits(r){this._turnCredits.delete(r)}getCreditsForTurn(r){return this._turnCredits.get(r)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(r){let n=r.get("x-quota-snapshot-premium_models")||r.get("x-quota-snapshot-premium_interactions"),o=r.get("x-quota-snapshot-chat"),s=r.get("x-quota-snapshot-completions");!n&&!o&&!s||(this._quotaInfo={chat:this._parseQuotaHeader(o),completions:this._parseQuotaHeader(s),premium_interactions:this._parseQuotaHeader(n)},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse()))}processUserInfoQuotaSnapshot(r){if(!r?.quota_snapshots)return;let{chat:n,completions:o,premium_interactions:s}=r.quota_snapshots;this._quotaInfo={chat:n?this._buildSnapshotFromRaw(n):void 0,completions:o?this._buildSnapshotFromRaw(o):void 0,premium_interactions:s?this._buildSnapshotFromRaw(s):void 0},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse())}_parseQuotaHeader(r){if(r)try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("ov")||"0.0"),c=n.get("ovPerm")==="true",l=Number.parseFloat(n.get("rem")||"0.0"),u=n.get("rst")??"",d=Math.max(0,o*(1-l/100)),f=o<0;return{quota:o,used:d,percentRemaining:l,overageUsed:s,overageEnabled:c,resetDate:u,unlimited:f}}catch(n){console.error("Failed to parse quota header",n);return}}_buildSnapshotFromRaw(r){return{overageEnabled:r.overage_permitted,overageUsed:r.overage_count,overageEntitlement:r.overage_entitlement,creditsUsed:r.credits_used,quota:r.entitlement,percentRemaining:r.percent_remaining,resetDate:r.quota_reset_at!=null&&r.quota_reset_at!==0?new Date(r.quota_reset_at*1e3).toISOString():"",used:Math.max(0,r.entitlement*(1-r.percent_remaining/100)),unlimited:r.unlimited}}async sendQuotaChangeNotification(){if(!this._quotaInfo)return;let r={chat:this._quotaInfo.chat,completions:this._quotaInfo.completions,premium_interactions:this._quotaInfo.premium_interactions,copilotPlan:this._copilotPlan};if(this._hasQuotaChanged(r)){this._lastSentQuotaParams=r;try{await this._ctx.get(CJ).notifyQuotaChange(r)}catch(n){console.warn("Failed to send quota change notification",n)}}}_hasQuotaChanged(r){let n=this._lastSentQuotaParams;return n?n.copilotPlan!==r.copilotPlan||this._hasSnapshotChanged(n.chat,r.chat)||this._hasSnapshotChanged(n.completions,r.completions)||this._hasSnapshotChanged(n.premium_interactions,r.premium_interactions):!0}_hasSnapshotChanged(r,n){return r===void 0&&n===void 0?!1:r===void 0||n===void 0?!0:r.overageUsed!==n.overageUsed||r.overageEnabled!==n.overageEnabled||r.percentRemaining!==n.percentRemaining||r.quota!==n.quota||r.used!==n.used||r.resetDate!==n.resetDate}_isSnapshotNotificationActive(r){return r?.notified?!r.resetDate||new Date=0;s--){let c=njt[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(njt[l]);return c}}}async _checkAndNotifyOverageSnapshot(r,n,o){if(!(!r||r.quota<=0)&&r.percentRemaining===0&&r.overageEnabled&&!this._isSnapshotNotificationActive(this._hasNotifiedOverage[n])){this._hasNotifiedOverage={...this._hasNotifiedOverage,[n]:{notified:!0,resetDate:r.resetDate}};try{await this._ctx.get(Uq).notifyQuotaWarning(this._buildWarningParams(o,"info"))}catch{}}}async checkAndNotifyOverageInUse(){this._quotaInfo&&(this._copilotPlan==="free"?(await this._checkAndNotifyOverageSnapshot(this._quotaInfo.chat,"chat","You are currently on overage spend until your chat limit resets."),await this._checkAndNotifyOverageSnapshot(this._quotaInfo.completions,"completions","You are currently on overage spend until your completions limit resets.")):await this._checkAndNotifyOverageSnapshot(this._quotaInfo.premium_interactions,"premium_interactions","You are currently on overage spend until your monthly limit resets."))}async checkAndNotifyQuotaThreshold(){if(!this._quotaInfo)return;let r=a(async(n,o)=>{let s=this._shownThresholds[o];if(this.clearStaleThresholds(n,s),this.checkThreshold(n,s)===void 0||!n)return;let l=n&&100-n.percentRemaining>=90?"warning":"info",u=100-n.percentRemaining,d=this.getQuotaThresholdMessage(o,u,n.resetDate);try{await this._ctx.get(Uq).notifyQuotaWarning(this._buildWarningParams(d,l))}catch{}},"notifyForSnapshot");this._copilotPlan==="free"?(await r(this._quotaInfo.chat,"chat"),await r(this._quotaInfo.completions,"completions")):await r(this._quotaInfo.premium_interactions,"premium_interactions")}getQuotaThresholdMessage(r,n,o){return r==="chat"||r==="completions"?n>=95?`You're close to your ${r} limit. Upgrade your plan to continue uninterrupted.`:`You've used over ${n}% of your ${r} budget. Upgrade your plan to continue uninterrupted.`:o?`You've used over ${n}% of your included AI credits. Limits reset on ${jue(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function zKe(t){let e=await t.get(Or).resolveSession();if(e){let r=await USe(t,e);if(r.ok){let n=await r.json();t.get(Ru).processUserInfoQuotaSnapshot(n)}}}a(zKe,"refreshUserQuota");p();p();var YKe=new pe("openAICompatibleLMProvider"),Hue={[Ii.OpenAI]:"https://api.openai.com/v1",[Ii.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[Ii.Groq]:"https://api.groq.com/openai/v1",[Ii.OpenRouter]:"https://openrouter.ai/api/v1",[Ii.Anthropic]:"https://api.anthropic.com/v1"},sb=class{constructor(e,r){this._lastFetchTime=0;this.providerName=e,this.ctx=r}static{a(this,"BaseOpenAICompatibleLMProvider")}async getAllModels(e){await this.ensureKnownModelsCache();try{let r=this.getFetchModelUrl(),n={"Content-Type":"application/json"},o=await new as(this.ctx.get(Un)).getAPIKey(this.providerName);o&&(n.Authorization=`Bearer ${o}`);let s=await this.ctx.get(Jt).fetch(r,{method:"GET",headers:n});if(!s.ok)throw new Error(`Failed to fetch models: ${s.status} ${s.statusText}`);let c=await s.json();if(c.error)throw new Error(`API Error: ${JSON.stringify(c.error)}`);let l=[];for(let u of c.data){let d=this._knownModels?.[u.id]??this.resolveModelCapabilities(u);d&&l.push({providerName:this.providerName,modelId:u.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:d})}return l}catch(r){throw YKe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,r),r}}resolveModelCapabilities(e){}getBaseUrl(){let e=Hue[this.providerName];if(!e)throw new Error(`Unsupported provider: ${this.providerName}`);return e}getFetchModelUrl(){return`${this.getBaseUrl()}/models`}async ensureKnownModelsCache(){let e=Date.now();if(!this._knownModels){try{this._knownModels=await this.fetchKnownModelList()}catch(n){YKe.error(this.ctx,`Failed to fetch known models list for ${this.providerName} provider:`,n),this._knownModels=void 0}this._lastFetchTime=e}}async fetchKnownModelList(){let e=await(await this.ctx.get(Jt).fetch("https://main.vscode-cdn.net/extensions/copilotChat.json",{method:"GET"})).json(),r;return e.version!==1?r={}:r=e.modelInfo[this.providerName]||{},r}};p();async function*Lwe(t,e){for await(let r of t)yield e(r)}a(Lwe,"asyncIterableMap");async function*Wbn(t,e){for await(let r of t)await e(r)&&(yield r)}a(Wbn,"asyncIterableFilter");async function*Bwe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(Bwe,"asyncIterableMapFilter");p();var KKe="interleaved-thinking-2025-05-14",zbn="2023-06-01";p();var p2=class{static{a(this,"EndpointStrategyFactory")}static{this.strategies=new Map}static register(e){this.strategies.set(e.name,e)}static getStrategy(e){let r=this.strategies.get(e);if(!r){let n=this.strategies.get("completions");if(!n)throw new Error(`No strategy registered for endpoint '${e}' and no fallback strategy available. Available: ${Array.from(this.strategies.keys()).join(", ")}`);return n}return r}static hasStrategy(e){return this.strategies.has(e)}};p();var dl=class{static{a(this,"ModelConfigurationProvider")}},JKe=class extends dl{constructor(r){super();this.ctx=r}static{a(this,"DefaultModelConfigurationProvider")}async getBestChatModelConfig(r,n,o=!1){let s=[];for(let c of r){let l=await this.getFirstMatchingChatModelConfiguration(c,n,o);l&&s.push(l)}if(s.length>0){let c=s.find(l=>l.isExperimental);return c||s[0]}throw ot.error(this.ctx,`No model configuration found for families: ${r.join(", ")}. Available models: ${JSON.stringify(await this.ctx.get(Ns).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(Ns).getMetadata(),o=oWo(n,r);if(o.length>0)return o[0]}async getFirstMatchingChatModelConfiguration(r,n,o){let s=await this.getFirstMatchingModelMetadata({family:r,type:"chat",supports:n,modelPickerEnabled:o});if(s===void 0)return;let c=s.supported_endpoints&&s.supported_endpoints.length>0?s.supported_endpoints:["/chat/completions"],l=s.capabilities.supports?.adaptive_thinking??!1,u=s.capabilities.supports?.reasoning_effort;return r===kn.Gpt35turbo||r===kn.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:ojt(6144,s),maxLongContextTokens:void 0,maxResponseTokens:ijt(2048,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:r===kn.Gpt4||r===kn.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:ojt(10240,s),maxLongContextTokens:void 0,maxResponseTokens:ijt(4096,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:r===kn.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await iWo(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:ijt(4096,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:Ybn(s),maxLongContextTokens:Kbn(s),maxResponseTokens:s.capabilities.limits?.max_output_tokens??4096,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}}async getModelConfigurationById(r){let o=(await this.ctx.get(Ns).getMetadata()).find(c=>c.id===r&&c.capabilities.type==="chat"&&c.model_picker_enabled===!0);if(!o)return;let s=o.supported_endpoints&&o.supported_endpoints.length>0?o.supported_endpoints:["/chat/completions"];return{modelId:o.id,uiName:o.name,modelFamily:o.capabilities.family,maxRequestTokens:Ybn(o),maxLongContextTokens:Kbn(o),maxResponseTokens:o.capabilities.limits?.max_output_tokens??4096,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:o.capabilities.tokenizer,isExperimental:o.isExperimental??!1,stream:o.capabilities.supports?.streaming??!1,toolCalls:o.capabilities.supports?.tool_calls??!1,supportedEndpoints:s,supportsAdaptiveThinking:o.capabilities.supports?.adaptive_thinking??!1,reasoningEfforts:o.capabilities.supports?.reasoning_effort,originalBillingMultiplier:o.billing?.multiplier??0}}async getFirstMatchingEmbeddingModelConfiguration(r){let n=await this.getFirstMatchingModelMetadata({family:r,type:"embeddings"});if(n!==void 0&&r===Pmn.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function iWo(t,e){let r=t.get(tr),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),ojt(o,e)}a(iWo,"getExpRequestTokens");function ojt(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(ojt,"getRequestTokens");function Ybn(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(Ybn,"getMaxRequestTokens");function Kbn(t){return t.billing?.token_prices?.long_context?.context_max}a(Kbn,"getMaxLongContextTokens");function ijt(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(ijt,"getResponseTokens");function oWo(t,e){return t.filter(r=>r.capabilities.type!==e.type||r.capabilities.family!==e.family&&!(r.is_chat_fallback===!0&&r.id===e.family)||r.capabilities.family===e.family&&r.id!==e.family&&r.is_chat_fallback===!0||e.modelPickerEnabled===!0&&!r.model_picker_enabled?!1:r.capabilities.supports===void 0||e.supports===void 0?!0:Object.keys(e.supports).every(n=>e.supports?.[n]===r.capabilities.supports?.[n]))}a(oWo,"filterModelsByCapabilities");function YO(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(YO,"pickReasoningEffort");function sWo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(sWo,"shouldUseResponsesApi");function aWo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(aWo,"shouldUseMessagesApi");var Jbn=["completions","responses","v1/messages"];function ZKe(t,e){return e?"v1/messages":t&&sWo(t)?"responses":"completions"}a(ZKe,"resolveEndpointRoute");function XKe(t,e){if(!aWo(e))return!1;let r=kt(t,ze.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(XKe,"willUseMessagesEndpoint");p();function eJe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(eJe,"isCodexStyleGptModel");function Zbn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(Zbn,"isGpt5PlusFamily");function Xbn(t){return t?t.toLowerCase().startsWith("claude"):!1}a(Xbn,"isAnthropicModel");p();p();p();var pT=class{static{a(this,"RateLimitNotifier")}},tJe=class extends pT{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var sjt=[50,75,90,95],KO=class extends av{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(ws(r,()=>{this._shownSessionThresholds.clear(),this._shownWeeklyThresholds.clear(),this.clearRateLimits()}))}static{a(this,"ChatUsageRateLimitService")}get weeklyRateLimit(){return this._weeklyRateLimit}get sessionRateLimit(){return this._sessionRateLimit}clearRateLimits(){this._weeklyRateLimit=void 0,this._sessionRateLimit=void 0}processRateLimitHeaders(r){let n=r.get("x-usage-ratelimit-weekly"),o=r.get("x-usage-ratelimit-session");if(!n&&!o)return;n&&(this._weeklyRateLimit=this.parseRateLimitHeader(n)),o&&(this._sessionRateLimit=this.parseRateLimitHeader(o)),this.clearStaleThresholds(this._sessionRateLimit,this._shownSessionThresholds),this.clearStaleThresholds(this._weeklyRateLimit,this._shownWeeklyThresholds);let s=this.checkThreshold(this._sessionRateLimit,this._shownSessionThresholds,"session")??this.checkThreshold(this._weeklyRateLimit,this._shownWeeklyThresholds,"weekly");s&&this.ctx.get(pT).notifyRateLimitWarning(s)}clearStaleThresholds(r,n){if(!r){n.clear();return}let o=100-r.percentRemaining;for(let s of n)o=0;c--){let l=sjt[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(sjt[d]);let u=this.getRateLimitMessage(o,r);return{type:o,rateLimit:r,message:u}}}}getRateLimitMessage(r,n){let o=Math.round(100-n.percentRemaining),s=jue(n.resetDate);return r==="session"?`You've used ${o}% of your session rate limit. Your session rate limit will reset on ${s}.`:`You've used ${o}% of your weekly rate limit. Your weekly rate limit will reset on ${s}.`}parseRateLimitHeader(r){try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("rem")||"0.0"),c=n.get("rst")||"";return{entitlement:o,percentRemaining:s,resetDate:c}}catch(n){console.error("Failed to parse rate limit header",n);return}}};p();var C0="https://aka.ms/github-copilot-rate-limit-error";function cWo(t){if(t<90)return`${t} ${t===1?"second":"seconds"}`;let e=Math.floor(t/60);if(t<=5400)return`${e} ${e===1?"minute":"minutes"}`;let r=Math.floor(e/60),n=e%60,o=`${r} ${r===1?"hour":"hours"}`;return n>0&&(o+=` ${n} ${n===1?"minute":"minutes"}`),o}a(cWo,"secondsToHumanReadableTime");var cv=class t{static{a(this,"CapiErrorTranslator")}static formatRequestId(e,r){let n=[];return e&&n.push(`Request ID: ${e}`),r&&n.push(`GitHub Request ID: ${r}`),n.length>0?` ${n.join(" | ")}`:""}static appendRequestId(e,r,n){return`${e}${t.formatRequestId(r,n)}`}static translateErrorMessage(e,r,n,o,s,c){let l;switch(e){case 466:l="Oops, your plugin is out of date. Please update it.";break;case 401:l="Oops, you are not authorized. Please sign in. If you are using a custom model, please check if the API key is still valid.";break;case 402:l=r||"Oops, you need to upgrade your plan.";break;case 413:l="Oops, your request is too large. Please try again with a smaller input.";break;case 429:l=t.getRateLimitMessage(o,c);break;case 503:l=r||"Oops, the service is currently unavailable. Please try again later.";break;default:if(r&&r.trim().length>0){let u=360,d=t.formatRequestId(n,s),f="Sorry, an error occurred while generating a response. Details: ",h=u-f.length-d.length;if(r.length<=h)return`${f}${r}${d}`;{let m=r.substring(0,h);return`${f}${m}... Read more from logs.${d}`}}l="Sorry, an error occurred while generating a response.";break}return t.appendRequestId(l,n,s)}static getRateLimitMessage(e,r){let n=e===void 0?"a moment":cWo(e),o=r?.capiErrorCode,s=r?.suggestSwitchToAuto??!r?.isAuto;if(o?.startsWith("agent_mode_limit_exceeded"))return`Sorry, you have exceeded the agent mode rate limit. Please switch to ask mode and try again in ${n}. [Learn More](${C0})`;if(o?.startsWith("model_overloaded")||o?.startsWith("upstream_provider_rate_limit"))return s?`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n} or consider switching to Auto. [Learn More](${C0})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n}. [Learn More](${C0})`;if(o?.startsWith("user_global_rate_limited"))return r?.copilotPlan==="free"||r?.copilotPlan==="individual"||r?.copilotPlan==="individual_pro"?`You've hit your session rate limit. Please upgrade your plan or wait ${n} for your limit to reset. [Learn More](${C0})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${C0})`;if(o?.startsWith("user_weekly_rate_limited")){if(e!==void 0){let l=new Date(Date.now()+e*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"});return r?.copilotPlan==="free"||r?.copilotPlan==="individual"||r?.copilotPlan==="individual_pro"?s?`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${C0})`:`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l}. [Learn More](${C0})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${C0})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${C0})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${C0})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${C0})`}return o?.startsWith("user_model_rate_limited")?s?`You've hit the rate limit for this model. Please try switching to Auto or try again in ${n}. [Learn More](${C0})`:`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${C0})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${C0})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${C0})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${C0})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${C0})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${C0})`}static translate402Reason(e,r){let n=r.retryAfterHeader,o=r.retryAfterSeconds;if(e.includes("free_quota_exceeded"))return n?`You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait until ${new Date(n).toLocaleString()} for your limit to reset.`:"You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.";if(e.includes("additional_spend_limit_reached"))return"You've reached your additional usage limit for your plan. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.";if(e.includes("overage_limit_reached"))return r.isTBBEnabled?"You've reached your additional usage limit for your plan. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.":"You cannot accrue additional overages at this time. Please contact [GitHub Support](https://support.github.com/contact) to continue using Copilot.";if(e.includes("quota_exceeded")){if(r.isTBBEnabled){let s="";o!==void 0&&(s=` Quota resets on ${new Date(Date.now()+o*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}.`);let c=r.overageEnabled?"increase budget":"enable additional overages",l=r.canUpgradePlan?", upgrade your plan":"";switch(r.copilotPlan){case"free":return`You've used your monthly chat messages limit. Please upgrade your plan or wait for your allowance to renew.${s}`;case"individual":case"individual_pro":return`You've used your monthly AI Credits. Please ${c}${l} or wait for your allowance to renew.${s}`;case"individual_max":return`You've used your monthly AI Credits. Please ${c} or wait for your allowance to renew.${s}`;case"business":case"enterprise":return`You've used your monthly AI Credits. Please reach out to your organization's Copilot admin to ${c} or wait for your allowance to renew.${s}`;default:return`You've used your monthly AI Credits.${s}`}}switch(r.copilotPlan){case"free":return"You've reached your monthly chat messages quota. Upgrade to Copilot Pro (30-day free trial) or wait for your allowance to renew.";case"individual":return"You've reached your monthly chat messages quota. Please enable additional paid premium requests, upgrade to Copilot Pro+, or wait for your allowance to renew.";case"individual_pro":return"You've reached your monthly chat messages quota. Please enable additional paid premium requests or wait for your allowance to renew.";case"business":case"enterprise":return"You've reached your monthly chat messages quota. Please reach out to your organization's Copilot admin to enable additional paid premium requests or wait for your allowance to renew.";default:return"You've reached your monthly chat messages quota."}}return e.includes("session_quota_exceeded")?o!==void 0?`You've used your session quota. Wait until ${new Date(Date.now()+o*1e3).toLocaleString()} for your limit to reset.`:"You've used your session quota.":e.includes("billing_not_configured")?"You have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, you must select a billing entity via the GitHub site, under Settings > Copilot > Billing.":r.isTBBEnabled?"Usage limit exceeded. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.":"Quota Exceeded."}static translate400Reason(e,r){if(e.includes("off_topic"))return"filtered as off_topic by intent classifier: message was not programming related";if(e.includes("model_not_supported"))return r?`model is not supported: ${r}`:"model is not supported.";if(e.includes("model_max_prompt_tokens_exceeded"))return"model max prompt tokens exceeded."}};p();p();p();function Gue(t,e,r=!1){!e||!e.providerName||(e.providerName===Ii.Anthropic?(delete t.temperature,delete t.top_p):e.supportsThinking&&(delete t.temperature,!r&&"max_tokens"in t&&(t.max_completion_tokens=t.max_tokens,delete t.max_tokens)),r||delete t.max_tokens)}a(Gue,"adaptRequestForBYOKProvider");p();var Qq="copilot-edits-session";p();p();p();p();Fo();function rJe(t,e,r,n,o,s,c){return wtn(t,e,r,o,n,c),{completionText:e,meanLogProb:lWo(t,r),meanAlternativeLogProb:uWo(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:Dt(),finishReason:r.finish_reason}}a(rJe,"convertToAPIChoice");function lWo(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){Fr.exception(t,r,"Error calculating mean prob")}}a(lWo,"calculateMeanLogProb");function uWo(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){Fr.exception(t,r,"Error calculating mean prob")}}a(uWo,"calculateMeanAlternativeLogProb");function $ue(t,e){return s1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a($ue,"getTemperatureForSamples");var dWo={markdown:[` `],python:[` @@ -2457,23 +2457,23 @@ def `,` class `,` if `,` -#`]};function Xbn(t,e){return lWo[e??""]??[` +#`]};function eSn(t,e){return dWo[e??""]??[` -`,"\n```"]}a(Xbn,"getStops");function $ue(t){return 1}a($ue,"getTopP");function nJe(t){return Ixe}a(nJe,"getMaxSolutionTokens");p();p();var uWo=1.15,dWo=1.17,fWo=2;function pWo(t){if(!t)return!1;let e=t.toLowerCase();return e.includes("opus")||e.includes("sonnet-4.6")}a(pWo,"isHighMultiplierModel");function hWo(t){return t.text?Array.isArray(t.text)?t.text.join(""):t.text:""}a(hWo,"getThinkingText");function Vue(t,e){let r=hWo(t);if(r.length>0){let n=Ms(),o=pWo(e)?dWo:uWo;return Math.ceil(n.tokenLength(r)*fWo*o)}return 0}a(Vue,"estimateThinkingTokens");function sjt(t){let e=t.delta;if(!e)return;let r=gWo(e),n=mWo(e);if(r||n)return{id:r,text:n}}a(sjt,"extractThinkingDeltaFromChoice");function mWo(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(mWo,"getThinkingDeltaText");function gWo(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(gWo,"getThinkingDeltaId");p();function ld(t){if(t instanceof Error)return t.stack?t.stack:t.message;if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}a(ld,"toString");var hT=new pe("streamChoices"),ajt=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new djt;this.tool_calls=new ljt;this.function_call=new ujt;this.copilot_references=[];this.yielded=!1}static{a(this,"APIJsonDataStreaming")}append(e){if(e.text&&this.text.push(e.text),e.delta?.content&&e.delta.role!=="function"&&this.text.push(e.delta.content),e.logprobs&&(this.tokens.push(e.logprobs.tokens??[]),this.text_offset.push(e.logprobs.text_offset??[]),this.logprobs.push(e.logprobs.token_logprobs??[]),this.top_logprobs.push(e.logprobs.top_logprobs??[])),e.copilot_annotations&&this.copilot_annotations.update(e.copilot_annotations),e.delta?.copilot_annotations&&this.copilot_annotations.update(e.delta.copilot_annotations),e.delta?.tool_calls&&e.delta.tool_calls.length>0&&this.tool_calls.update(e.delta.tool_calls),e.delta?.function_call&&this.function_call.update(e.delta.function_call),e?.finish_reason&&(this.finish_reason=e.finish_reason),this.enableThinking){let r=sjt(e);if((r?.id||r?.text)&&(this.thinking??={id:"",text:[]},r.id&&(this.thinking.id=r.id),r.text&&Array.isArray(this.thinking.text))){let n=Array.isArray(r.text)?r.text:[r.text];this.thinking.text.push(...n)}}}};function AWo(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!=""),r]}a(AWo,"splitChunk");var cjt=class{constructor(){this.arguments=[]}static{a(this,"StreamingToolCall")}update(e){e.id&&(this.id=e.id),e.function.name&&(this.name=e.function.name),this.arguments.push(e.function.arguments)}},ljt=class{constructor(){this.toolCalls=[]}static{a(this,"StreamingToolCalls")}update(e){e.forEach(r=>{let n;if(r.id&&(n=this.toolCalls.find(o=>o.id===r.id)),!n&&!r.id&&r.index!==void 0){for(let o=this.toolCalls.length-1;o>=0;o--)if(this.toolCalls[o].index===r.index){n=this.toolCalls[o];break}}n||(n=this.toolCalls.length>0?this.toolCalls[this.toolCalls.length-1]:void 0),(!n||r.id&&n.id!==r.id)&&(n=new cjt,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},ujt=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},djt=class{constructor(){this.current={}}static{a(this,"StreamCopilotAnnotations")}update(e){Object.entries(e).forEach(([r,n])=>{n.forEach(o=>this.update_namespace(r,o))})}update_namespace(e,r){this.current[e]||(this.current[e]=[]);let n=this.current[e],o=n.findIndex(s=>s.id===r.id);o>=0?n[o]=r:n.push(r)}for(e){return this.current[e]??[]}},CJ=class t{constructor(e,r,n,o,s,c,l){this.ctx=e;this.expectedNumChoices=r;this.response=n;this.body=o;this.telemetryData=s;this.dropCompletionReasons=c;this.cancellationToken=l;this.requestId=hF(this.response);this.stats=new fjt;this.solutions={}}static{a(this,"SSEProcessor")}static create(e,r,n,o,s,c){let l=n.body();if(l===null)throw new Error("No response body available");return typeof l.setEncoding=="function"?l.setEncoding("utf8"):l=l.pipeThrough(new TextDecoderStream),new t(e,r,n,l,o,s??[],c)}async*processSSE(e=()=>{}){try{yield*this.processSSEInner(e)}finally{this.cancel(),hT.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),hT.debug(this.ctx,"request stats:",this.stats)}}async*processSSEInner(e){let r="",n=null,o,s,c;e:for await(let l of this.body){if(this.maybeCancel("after awaiting body chunk"))return;let u=l.toString();hT.debug(this.ctx,"chunk",u);let[d,f]=AWo(r+u);r=f;for(let h of d){if(h.startsWith(":"))continue;let m=h.slice(5).trim();if(m=="[DONE]"){yield*this.finishSolutions(n,o,s,c,e);return}n=null;let g;try{g=JSON.parse(m)}catch{hT.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&yWo(g.copilot_confirmation)&&await e("",{text:"",requestId:this.requestId,copilotConfirmation:g.copilot_confirmation}),g.copilot_references&&await e("",{text:"",requestId:this.requestId,copilotReferences:g.copilot_references}),g.choices===void 0){!g.copilot_references&&!g.copilot_confirmation&&(g.error!==void 0?hT.error(this.ctx,"Error in response:",g.error.message):hT.error(this.ctx,"Unexpected response with no choices or error: "+m)),g.copilot_errors&&await e("",{text:"",requestId:this.requestId,copilotErrors:g.copilot_errors});continue}if(o===void 0&&g.model&&(o=g.model),g.usage&&(s=g.usage),g.copilot_usage&&(c=g.copilot_usage),this.allSolutionsDone()){r="";break e}for(let A=0;A0){let n=Ms(),o=mWo(e)?pWo:fWo;return Math.ceil(n.tokenLength(r)*hWo*o)}return 0}a(Wue,"estimateThinkingTokens");function ajt(t){let e=t.delta;if(!e)return;let r=yWo(e),n=AWo(e);if(r||n)return{id:r,text:n}}a(ajt,"extractThinkingDeltaFromChoice");function AWo(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(AWo,"getThinkingDeltaText");function yWo(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(yWo,"getThinkingDeltaId");p();function ld(t){if(t instanceof Error)return t.stack?t.stack:t.message;if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}a(ld,"toString");var hT=new pe("streamChoices"),cjt=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new fjt;this.tool_calls=new ujt;this.function_call=new djt;this.copilot_references=[];this.yielded=!1}static{a(this,"APIJsonDataStreaming")}append(e){if(e.text&&this.text.push(e.text),e.delta?.content&&e.delta.role!=="function"&&this.text.push(e.delta.content),e.logprobs&&(this.tokens.push(e.logprobs.tokens??[]),this.text_offset.push(e.logprobs.text_offset??[]),this.logprobs.push(e.logprobs.token_logprobs??[]),this.top_logprobs.push(e.logprobs.top_logprobs??[])),e.copilot_annotations&&this.copilot_annotations.update(e.copilot_annotations),e.delta?.copilot_annotations&&this.copilot_annotations.update(e.delta.copilot_annotations),e.delta?.tool_calls&&e.delta.tool_calls.length>0&&this.tool_calls.update(e.delta.tool_calls),e.delta?.function_call&&this.function_call.update(e.delta.function_call),e?.finish_reason&&(this.finish_reason=e.finish_reason),this.enableThinking){let r=ajt(e);if((r?.id||r?.text)&&(this.thinking??={id:"",text:[]},r.id&&(this.thinking.id=r.id),r.text&&Array.isArray(this.thinking.text))){let n=Array.isArray(r.text)?r.text:[r.text];this.thinking.text.push(...n)}}}};function _Wo(t){let e=t.split(` +`),r=e.pop();return[e.filter(n=>n!=""),r]}a(_Wo,"splitChunk");var ljt=class{constructor(){this.arguments=[]}static{a(this,"StreamingToolCall")}update(e){e.id&&(this.id=e.id),e.function.name&&(this.name=e.function.name),this.arguments.push(e.function.arguments)}},ujt=class{constructor(){this.toolCalls=[]}static{a(this,"StreamingToolCalls")}update(e){e.forEach(r=>{let n;if(r.id&&(n=this.toolCalls.find(o=>o.id===r.id)),!n&&!r.id&&r.index!==void 0){for(let o=this.toolCalls.length-1;o>=0;o--)if(this.toolCalls[o].index===r.index){n=this.toolCalls[o];break}}n||(n=this.toolCalls.length>0?this.toolCalls[this.toolCalls.length-1]:void 0),(!n||r.id&&n.id!==r.id)&&(n=new ljt,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},djt=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},fjt=class{constructor(){this.current={}}static{a(this,"StreamCopilotAnnotations")}update(e){Object.entries(e).forEach(([r,n])=>{n.forEach(o=>this.update_namespace(r,o))})}update_namespace(e,r){this.current[e]||(this.current[e]=[]);let n=this.current[e],o=n.findIndex(s=>s.id===r.id);o>=0?n[o]=r:n.push(r)}for(e){return this.current[e]??[]}},bJ=class t{constructor(e,r,n,o,s,c,l){this.ctx=e;this.expectedNumChoices=r;this.response=n;this.body=o;this.telemetryData=s;this.dropCompletionReasons=c;this.cancellationToken=l;this.requestId=hF(this.response);this.stats=new pjt;this.solutions={}}static{a(this,"SSEProcessor")}static create(e,r,n,o,s,c){let l=n.body();if(l===null)throw new Error("No response body available");return typeof l.setEncoding=="function"?l.setEncoding("utf8"):l=l.pipeThrough(new TextDecoderStream),new t(e,r,n,l,o,s??[],c)}async*processSSE(e=()=>{}){try{yield*this.processSSEInner(e)}finally{this.cancel(),hT.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),hT.debug(this.ctx,"request stats:",this.stats)}}async*processSSEInner(e){let r="",n=null,o,s,c;e:for await(let l of this.body){if(this.maybeCancel("after awaiting body chunk"))return;let u=l.toString();hT.debug(this.ctx,"chunk",u);let[d,f]=_Wo(r+u);r=f;for(let h of d){if(h.startsWith(":"))continue;let m=h.slice(5).trim();if(m=="[DONE]"){yield*this.finishSolutions(n,o,s,c,e);return}n=null;let g;try{g=JSON.parse(m)}catch{hT.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&EWo(g.copilot_confirmation)&&await e("",{text:"",requestId:this.requestId,copilotConfirmation:g.copilot_confirmation}),g.copilot_references&&await e("",{text:"",requestId:this.requestId,copilotReferences:g.copilot_references}),g.choices===void 0){!g.copilot_references&&!g.copilot_confirmation&&(g.error!==void 0?hT.error(this.ctx,"Error in response:",g.error.message):hT.error(this.ctx,"Unexpected response with no choices or error: "+m)),g.copilot_errors&&await e("",{text:"",requestId:this.requestId,copilotErrors:g.copilot_errors});continue}if(o===void 0&&g.model&&(o=g.model),g.usage&&(s=g.usage),g.copilot_usage&&(c=g.copilot_usage),this.allSolutionsDone()){r="";break e}for(let A=0;A-1||y.delta?.content?.indexOf(` -`)>-1,T=_?sjt(y):void 0;if(y.finish_reason||S||T){let R=E.text.join("");if(v=this.asSolutionDecision(await e(R,{text:R,index:y.index,requestId:this.requestId,annotations:E.copilot_annotations,copilotReferences:E.copilot_references,getAPIJsonData:a(()=>Uwe(E,this.ctx),"getAPIJsonData"),finished:!!y.finish_reason,telemetryData:this.telemetryData,thinking:T?{id:T.id??"",text:T.text}:void 0})),this.maybeCancel("after awaiting finishedCb"))return}if(y.finish_reason&&E.function_call.name!==void 0){n=y.finish_reason;continue}if(y.finish_reason&&(v.yieldSolution=!0,v.continueStreaming=!1),!v.yieldSolution)continue;let w=y.finish_reason??"client-trimmed";if(ft(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:w,engineName:o??"",engineChoiceSource:XQ(this.ctx,this.telemetryData).engineChoiceSource})),this.dropCompletionReasons.includes(y.finish_reason)?this.solutions[y.index]=null:E.yielded||(this.stats.markYielded(y.index),yield{solution:E,finishOffset:v.finishOffset,reason:y.finish_reason,requestId:this.requestId,index:y.index,model:o,usage:s,copilot_usage:c},E.yielded=!0),this.maybeCancel("after yielding finished choice"))return;v.continueStreaming||(this.solutions[y.index]=null)}}}for(let[l,u]of Object.entries(this.solutions)){let d=Number(l);if(u!=null&&(ft(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:"Iteration Done",engineName:o??""})),this.stats.markYielded(d),yield{solution:u,finishOffset:void 0,reason:"Iteration Done",requestId:this.requestId,index:d,model:o,usage:s,copilot_usage:c},this.maybeCancel("after yielding after iteration done")))return}if(r.length>0)try{let l=JSON.parse(r);l.error!==void 0&&hT.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{hT.error(this.ctx,`Error parsing extraData: ${r}`)}}asSolutionDecision(e){return e===void 0?{yieldSolution:!1,continueStreaming:!0}:typeof e=="number"?{yieldSolution:!0,continueStreaming:!1,finishOffset:e}:e}async*finishSolutions(e,r,n,o,s){for(let[c,l]of Object.entries(this.solutions)){let u=Number(c);if(l==null)continue;let d=l.text.join("");if(await s(d,{text:d,index:u,requestId:this.requestId,annotations:l.copilot_annotations,copilotReferences:l.copilot_references,getAPIJsonData:a(()=>Uwe(l,this.ctx),"getAPIJsonData"),finished:!0,telemetryData:this.telemetryData}),!l.yielded&&(this.stats.markYielded(u),ft(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:e??"DONE",engineName:r??""})),yield{solution:l,finishOffset:void 0,reason:e??"DONE",requestId:this.requestId,index:u,model:r,usage:n,copilot_usage:o},this.maybeCancel("after yielding on DONE")))return}}maybeCancel(e){return this.cancellationToken?.isCancellationRequested?(hT.debug(this.ctx,"Cancelled: "+e),this.cancel(),!0):!1}cancel(){this.body&&"destroy"in this.body&&typeof this.body.destroy=="function"?this.body.destroy():this.body instanceof ReadableStream&&this.body.cancel()}allSolutionsDone(){let e=Object.values(this.solutions);return e.length==this.expectedNumChoices&&e.every(r=>r==null)}};function hjt(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(hT.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),hT.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),hT.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=Uwe(e.solution,t);return rJe(t,n,s,e.index,e.requestId,o,r)}a(hjt,"prepareSolutionForReturn");function Uwe(t,e){let r=t.text.join(""),n=_Wo(t,e),o=EWo(t,e),s=t.copilot_annotations.current,c=t.thinking?.id?t.thinking:void 0,l={text:r,tokens:t.text,tool_calls:n,function_call:o,copilot_annotations:s,finish_reason:t.finish_reason??"stop",thinking:c};if(t.logprobs.length===0)return l;let u=t.logprobs.reduce((m,g)=>m.concat(g),[]),d=t.top_logprobs.reduce((m,g)=>m.concat(g),[]),f=t.text_offset.reduce((m,g)=>m.concat(g),[]),h=t.tokens.reduce((m,g)=>m.concat(g),[]);return{...l,logprobs:{token_logprobs:u,top_logprobs:d,text_offset:f,tokens:h}}}a(Uwe,"convertToAPIJsonData");function yWo(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(yWo,"isCopilotConfirmation");function eSn(t,e,r,n,o){if(!t)return{};try{return JSON.parse(t)}catch(s){let c=n?` Chunks (${n.length}): ${JSON.stringify(n)}`:"",l=new Error(`Failed to parse JSON for ${e} '${r}': ${ld(s)}. Input: '${t}'.${c}`);throw o&&$c(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(eSn,"parseCallArguments");function _Wo(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=eSn(s,"tool call",o.name,o.arguments,e);r.push({type:"function",function:{name:o.name,arguments:c},approxNumTokens:o.arguments.length+1,id:o.id})}return r}a(_Wo,"extractToolCalls");function EWo(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=eSn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a(EWo,"extractFunctionCall");var fjt=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new pjt,this.choices.set(e,r)),r}add(e){this.getChoiceStats(e).increment()}markYielded(e){this.getChoiceStats(e).markYielded()}toString(){return Array.from(this.choices.entries()).map(([e,r])=>`${e}: ${r.yieldedTokens} -> ${r.seenTokens}`).join(", ")}},pjt=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function iJe(t,e){return t!==null&&typeof t=="object"&&e in t}a(iJe,"hasKey");function um(t,e){return iJe(t,e)?t[e]:void 0}a(um,"getKey");var rSn=fe(ii());var fp=new pe("fetchCompletions");function hF(t){return{headerRequestId:t.headers.get("x-request-id")||"",serverExperiments:t.headers.get("X-Copilot-Experiment")||"",deploymentId:t.headers.get("azureml-model-deployment")||""}}a(hF,"getRequestId");function mF(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(mF,"getProcessingTime");function nSn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(nSn,"uiKindToIntent");var JO=class{static{a(this,"OpenAIFetcher")}};function vWo(t,e,r,n){return Px(t,e,"proxy","v1/engines",r,n)}a(vWo,"getProxyEngineUrl");function oJe(t,e,r,n){for(let[o,s]of Object.entries(t)){if(r.includes(o))continue;let c=s;if(o==="extra"&&n){let l={...c};for(let u of n)delete l[u];c=l}e.properties[`request.option.${o}`]=JSON.stringify(c)??"undefined"}}a(oJe,"sanitizeRequestOptionTelemetry");async function CWo(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(ks),m=vWo(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},hae(e));oJe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,ft(t,"request.sent",g);let A=Rl(),y=nSn(l);return Uz(t,m,c.token,y,o,s,d,f).then(_=>{let E=hF(_);g.extendWithRequestId(E);let v=Rl()-A;return g.measurements.totalTimeMs=v,fp.info(t,`Request ${o} at <${m}> finished with ${_.status} status after ${v}ms`),g.properties.status=String(_.status),fp.debug(t,"request.response properties",g.properties),fp.debug(t,"request.response measurements",g.measurements),fp.debug(t,"prompt:",e),ft(t,"request.response",g),_}).catch(_=>{if(ng(_))throw ft(t,"request.cancel",g),_;h.setWarning("cls",{message:um(_,"message")??""});let E=g.extendedBy({error:"Network exception"});ft(t,"request.shownWarning",E),g.properties.message=String(um(_,"name")??""),g.properties.code=String(um(_,"code")??""),g.properties.errno=String(um(_,"errno")??""),g.properties.type=String(um(_,"type")??"");let v=Rl()-A;throw g.measurements.totalTimeMs=v,fp.info(t,`Request ${o} at <${m}> rejected with ${String(_)} after ${v}ms`),fp.debug(t,"request.error properties",g.properties),fp.debug(t,"request.error measurements",g.measurements),ft(t,"request.error",g),_}).finally(()=>{wtn(t,e,g)})}a(CWo,"fetchWithInstrumentation");async function bWo(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});oJe(s,f,["messages"]),f.properties.headerRequestId=o,ft(t,"request.sent",f);let h=Rl(),m=nSn(l),g=om(t);n3()&&(g=await mWe(t,g));try{let A=await Uz(t,n,c.token,m,o,s,d,g),y=hF(A);f.extendWithRequestId(y);let _=Rl()-h;return f.measurements.totalTimeMs=_,fp.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${_}ms`),fp.debug(t,"request.response properties",f.properties),fp.debug(t,"request.response measurements",f.measurements),fp.debug(t,"messages:",JSON.stringify(e)),ft(t,"request.response",f),A}catch(A){if(ng(A))throw ft(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});ft(t,"request.shownWarning",y),f.properties.message=String(um(A,"name")??""),f.properties.code=String(um(A,"code")??""),f.properties.errno=String(um(A,"errno")??""),f.properties.type=String(um(A,"type")??"");let _=Rl()-h;throw f.measurements.totalTimeMs=_,fp.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${_}ms`),fp.debug(t,"request.error properties",f.properties),fp.debug(t,"request.error measurements",f.measurements),ft(t,"request.error",f),A}finally{Wue(t,e,f)}}a(bWo,"fetchChatWithInstrumentation");function tSn(t){return Vbn(t,e=>e.completionText.trim().length>0)}a(tSn,"postProcessChoices");var SWo="github.copilot.completions.quotaExceeded",Fwe=class extends JO{static{a(this,"LiveOpenAIFetcher")}#e;async fetchAndStreamCompletions(e,r,n,o,s){if(this.#e)return{type:"canceled",reason:this.#e};let c=e.get(ks),l="completions",u=await e.get(Qt).getToken(),d=await this.fetchWithParameters(e,l,r,u,n,s);if(d==="not-sent")return{type:"canceled",reason:"before fetch request"};if(s?.isCancellationRequested){let g=d.body();try{g&&"destroy"in g&&typeof g.destroy=="function"?g.destroy():g instanceof ReadableStream&&g.cancel()}catch(A){fp.exception(e,A,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(d.status!==200){let g=this.createTelemetryData(l,e,r);return this.handleError(e,c,g,d,r.uiKind)}let h=CJ.create(e,r.count,d,n,[],s).processSSE(o),m=Lwe(h,g=>hjt(e,g,n));return{type:"success",choices:tSn(m),getProcessingTime:a(()=>mF(d),"getProcessingTime")}}async fetchAndStreamChat(e,r,n,o,s,c,l,u={},d){if(this.#e)return{type:"canceled",reason:this.#e};let f="https://copilot-proxy.githubusercontent.com/chat/completions",h={messages:r,model:l.id,stream:!0,...u},m=n.extendedBy({endpoint:f,model:l.name}),g=e.get(ks),A=await e.get(Qt).getToken(),y=await bWo(e,r,l.id,f,s,h,A,o,m,d);if(d?.isCancellationRequested){let S=y.body();try{S&&"destroy"in S&&typeof S.destroy=="function"?S.destroy():S instanceof ReadableStream&&S.cancel()}catch(T){fp.exception(e,T,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(y.status!==200){let S=Vt.createAndMarkAsIssued({endpoint:f,engineName:l.name,uiKind:o,headerRequestId:s});return this.handleError(e,g,S,y,o)}let E=CJ.create(e,1,y,m,[],rSn.CancellationToken.None).processSSE(),v=Lwe(E,S=>hjt(e,S,n));return{type:"success",choices:tSn(v),getProcessingTime:a(()=>mF(y),"getProcessingTime")}}createTelemetryData(e,r,n){return Vt.createAndMarkAsIssued({endpoint:e,engineName:n.engineModelId,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s,c){let l=e.get(tr).disableLogProb(s),u={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:nJe(e),temperature:Gue(e,n.count),top_p:$ue(e),n:n.count,stop:Xbn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=kK(n.repoInfo);return d!==void 0&&(u.nwo=d),n.postOptions&&Object.assign(u,n.postOptions),n.prompt.context&&n.prompt.context.length>0&&(u.extra.context=n.prompt.context),await JC(0),c?.isCancellationRequested?"not-sent":await CWo(e,n.prompt,n.engineModelId,r,n.ourRequestId,u,o,n.uiKind,s,c,n.headers)}async handleError(e,r,n,o,s){let c=await o.text();if(o.status===402){this.#e="monthly free code completions exhausted",r.setError("cls",{message:"Completions limit reached"},{command:SWo,title:"Learn More"});let l=ws(e,u=>{this.#e=void 0,(u.envelope.limited_user_quotas?.completions??1)>0&&(r.forceNormal("cls",{inactive:!1}),l.dispose())});return{type:"failed",reason:this.#e}}if(o.status===466)return r.setError("cls",{message:c}),fp.info(e,c),{type:"failed",reason:`client not supported: ${c}`};if(o.clientError&&!o.headers.get("x-github-request-id")){let l=`Last response was a ${o.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;fp.error(e,l),r.setWarning("cls",{message:l}),n.properties.error=`Response status was ${o.status} with no x-github-request-id header`}else o.clientError?(fp.warn(e,`Response status was ${o.status}:`,c),r.setWarning("cls",{message:`Last response was a ${o.status} error: ${c}`}),n.properties.error=`Response status was ${o.status}: ${c}`):(r.setWarning("cls",{message:`Last response was a ${o.status} error`}),n.properties.error=`Response status was ${o.status}`);if(n.properties.status=String(o.status),ft(e,"request.shownWarning",n),o.status===401||o.status===403)return e.get(Qt).resetToken("code_completion",o.status),{type:"failed",reason:`token expired or invalid: ${o.status}`};if(o.status===429){let l=UM(o);sr(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:l??-1});let u=l??10,d=Math.max(u,0)*1e3;return setTimeout(()=>{this.#e=void 0},d),this.#e=`Rate limited by server. Retry in ${u}s.`,fp.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(fp.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(fp.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};Fo();async function Qwe(t,e,r,n){let o=Vt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(tr).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(Qwe,"createTelemetryWithExpWithId");function fl(t,{turn:e,conversation:r}={},n){return Qwe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(fl,"createTelemetryWithExpWithTurn");function qwe(t,e,r,n,o,s,c,l){let u=t.turns[t.turns.length-1].skills.map(h=>h.skillId).sort(),d={source:"user",turnIndex:(t.turns.length-1).toString(),uiKind:e,skillIds:u.join(",")},f={promptTokenLen:n,messageCharLen:r};return o&&(d.suggestion=o),s&&(d.suggestionId=s),l.length>0&&(d.skillResolutionsJson=JSON.stringify(TWo(l))),c=c.extendedBy(d,f),c}a(qwe,"extendUserMessageTelemetryData");function TWo(t){return t.map(e=>({skillId:e.skillId,resolution:e.resolution,fileStatus:e.files?.map(r=>r.status),tokensPreEliding:e.tokensPreEliding??0,resolutionTimeMs:e.resolutionTimeMs??0,processingTimeMs:e.processingTimeMs??0}))}a(TWo,"mapSkillResolutionsForTelemetry");function iSn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),sJe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(iSn,"createUserMessageTelemetryData");function oSn(t,e,r,n,o,s,c){let l=xWo(r);return sJe(t.ctx,s,e,r,{source:"model",turnIndex:(t.conversation.turns.length-1).toString(),headerRequestId:o,uiKind:e,codeBlockLanguages:JSON.stringify(l),mode:t.turn.getChatModeForTelemetry(),modelId:t.turn.getResolvedModelId()??"unknown"},{messageCharLen:r.length,numCodeBlocks:l.length,numTokens:n},c).properties.messageId}a(oSn,"createModelMessageTelemetryData");function sSn(t,e,r,n,o,s,c){sJe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(sSn,"createOffTopicMessageTelemetryData");function aSn(t,e,r,n,o,s,c,l,u){let d=sJe(t,l,r,n,{source:"suggestion",suggestion:s,turnIndex:(e.turns.length-1).toString(),uiKind:r,suggestionId:c},{promptTokenLen:o,messageCharLen:n.length},u);return IWo(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(aSn,"createSuggestionMessageTelemetryData");async function cSn(t,e,r){let n=await fl(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";mT(t.ctx,void 0,{conversationId:t.conversation.telemetryId,turnIndex:(t.conversation.turns.length-1).toString(),userMessageId:t.turn.telemetryId,provider:e,uiKind:o},r,"index.codesearch",n)}a(cSn,"telemetryIndexCodesearch");function sJe(t,e,r,n,o,s,c){let l=c??Vt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=Dt();o.messageId=m}e&&(o.languageId=e.detectedLanguageId,s.documentLength=e.getText().length,s.documentLineCount=e.lineCount);let u={messageText:n,...o},d=l.extendedBy(o,s),f=l.extendedBy(u),h=S_(r);return ft(t,`${h}.message`,d),ft(t,`${h}.messageText`,f,1),d}a(sJe,"telemetryMessage");function lSn(t,e,r,n){mT(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a(lSn,"createSuggestionShownTelemetryData");function IWo(t,e,r,n,o,s,c,l){mT(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(IWo,"createSuggestionSelectedTelemetryData");function mT(t,e,r,n,o,s){let c=s??Vt.createAndMarkAsIssued();e&&(r.languageId=e.detectedLanguageId,n.documentLength=e.getText().length,n.documentLineCount=e.lineCount);let l=c.extendedBy(r,n);return ft(t,o,l),l}a(mT,"telemetryUserAction");function Wue(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return ft(t,"engine.messages",n,1)}a(Wue,"logEngineMessages");function S_(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(S_,"telemetryPrefixForUiKind");function xWo(t){let e=t.split(` -`),r=[],n;for(let o=0;o-1,T=_?ajt(y):void 0;if(y.finish_reason||S||T){let R=E.text.join("");if(v=this.asSolutionDecision(await e(R,{text:R,index:y.index,requestId:this.requestId,annotations:E.copilot_annotations,copilotReferences:E.copilot_references,getAPIJsonData:a(()=>Uwe(E,this.ctx),"getAPIJsonData"),finished:!!y.finish_reason,telemetryData:this.telemetryData,thinking:T?{id:T.id??"",text:T.text}:void 0})),this.maybeCancel("after awaiting finishedCb"))return}if(y.finish_reason&&E.function_call.name!==void 0){n=y.finish_reason;continue}if(y.finish_reason&&(v.yieldSolution=!0,v.continueStreaming=!1),!v.yieldSolution)continue;let w=y.finish_reason??"client-trimmed";if(ft(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:w,engineName:o??"",engineChoiceSource:XQ(this.ctx,this.telemetryData).engineChoiceSource})),this.dropCompletionReasons.includes(y.finish_reason)?this.solutions[y.index]=null:E.yielded||(this.stats.markYielded(y.index),yield{solution:E,finishOffset:v.finishOffset,reason:y.finish_reason,requestId:this.requestId,index:y.index,model:o,usage:s,copilot_usage:c},E.yielded=!0),this.maybeCancel("after yielding finished choice"))return;v.continueStreaming||(this.solutions[y.index]=null)}}}for(let[l,u]of Object.entries(this.solutions)){let d=Number(l);if(u!=null&&(ft(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:"Iteration Done",engineName:o??""})),this.stats.markYielded(d),yield{solution:u,finishOffset:void 0,reason:"Iteration Done",requestId:this.requestId,index:d,model:o,usage:s,copilot_usage:c},this.maybeCancel("after yielding after iteration done")))return}if(r.length>0)try{let l=JSON.parse(r);l.error!==void 0&&hT.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{hT.error(this.ctx,`Error parsing extraData: ${r}`)}}asSolutionDecision(e){return e===void 0?{yieldSolution:!1,continueStreaming:!0}:typeof e=="number"?{yieldSolution:!0,continueStreaming:!1,finishOffset:e}:e}async*finishSolutions(e,r,n,o,s){for(let[c,l]of Object.entries(this.solutions)){let u=Number(c);if(l==null)continue;let d=l.text.join("");if(await s(d,{text:d,index:u,requestId:this.requestId,annotations:l.copilot_annotations,copilotReferences:l.copilot_references,getAPIJsonData:a(()=>Uwe(l,this.ctx),"getAPIJsonData"),finished:!0,telemetryData:this.telemetryData}),!l.yielded&&(this.stats.markYielded(u),ft(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:e??"DONE",engineName:r??""})),yield{solution:l,finishOffset:void 0,reason:e??"DONE",requestId:this.requestId,index:u,model:r,usage:n,copilot_usage:o},this.maybeCancel("after yielding on DONE")))return}}maybeCancel(e){return this.cancellationToken?.isCancellationRequested?(hT.debug(this.ctx,"Cancelled: "+e),this.cancel(),!0):!1}cancel(){this.body&&"destroy"in this.body&&typeof this.body.destroy=="function"?this.body.destroy():this.body instanceof ReadableStream&&this.body.cancel()}allSolutionsDone(){let e=Object.values(this.solutions);return e.length==this.expectedNumChoices&&e.every(r=>r==null)}};function mjt(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(hT.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),hT.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),hT.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=Uwe(e.solution,t);return rJe(t,n,s,e.index,e.requestId,o,r)}a(mjt,"prepareSolutionForReturn");function Uwe(t,e){let r=t.text.join(""),n=vWo(t,e),o=CWo(t,e),s=t.copilot_annotations.current,c=t.thinking?.id?t.thinking:void 0,l={text:r,tokens:t.text,tool_calls:n,function_call:o,copilot_annotations:s,finish_reason:t.finish_reason??"stop",thinking:c};if(t.logprobs.length===0)return l;let u=t.logprobs.reduce((m,g)=>m.concat(g),[]),d=t.top_logprobs.reduce((m,g)=>m.concat(g),[]),f=t.text_offset.reduce((m,g)=>m.concat(g),[]),h=t.tokens.reduce((m,g)=>m.concat(g),[]);return{...l,logprobs:{token_logprobs:u,top_logprobs:d,text_offset:f,tokens:h}}}a(Uwe,"convertToAPIJsonData");function EWo(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(EWo,"isCopilotConfirmation");function tSn(t,e,r,n,o){if(!t)return{};try{return JSON.parse(t)}catch(s){let c=n?` Chunks (${n.length}): ${JSON.stringify(n)}`:"",l=new Error(`Failed to parse JSON for ${e} '${r}': ${ld(s)}. Input: '${t}'.${c}`);throw o&&$c(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(tSn,"parseCallArguments");function vWo(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=tSn(s,"tool call",o.name,o.arguments,e);r.push({type:"function",function:{name:o.name,arguments:c},approxNumTokens:o.arguments.length+1,id:o.id})}return r}a(vWo,"extractToolCalls");function CWo(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=tSn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a(CWo,"extractFunctionCall");var pjt=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new hjt,this.choices.set(e,r)),r}add(e){this.getChoiceStats(e).increment()}markYielded(e){this.getChoiceStats(e).markYielded()}toString(){return Array.from(this.choices.entries()).map(([e,r])=>`${e}: ${r.yieldedTokens} -> ${r.seenTokens}`).join(", ")}},hjt=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function iJe(t,e){return t!==null&&typeof t=="object"&&e in t}a(iJe,"hasKey");function um(t,e){return iJe(t,e)?t[e]:void 0}a(um,"getKey");var nSn=fe(ii());var fp=new pe("fetchCompletions");function hF(t){return{headerRequestId:t.headers.get("x-request-id")||"",serverExperiments:t.headers.get("X-Copilot-Experiment")||"",deploymentId:t.headers.get("azureml-model-deployment")||""}}a(hF,"getRequestId");function mF(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(mF,"getProcessingTime");function iSn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(iSn,"uiKindToIntent");var JO=class{static{a(this,"OpenAIFetcher")}};function bWo(t,e,r,n){return Px(t,e,"proxy","v1/engines",r,n)}a(bWo,"getProxyEngineUrl");function oJe(t,e,r,n){for(let[o,s]of Object.entries(t)){if(r.includes(o))continue;let c=s;if(o==="extra"&&n){let l={...c};for(let u of n)delete l[u];c=l}e.properties[`request.option.${o}`]=JSON.stringify(c)??"undefined"}}a(oJe,"sanitizeRequestOptionTelemetry");async function SWo(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(ks),m=bWo(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},mae(e));oJe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,ft(t,"request.sent",g);let A=Rl(),y=iSn(l);return Qz(t,m,c.token,y,o,s,d,f).then(_=>{let E=hF(_);g.extendWithRequestId(E);let v=Rl()-A;return g.measurements.totalTimeMs=v,fp.info(t,`Request ${o} at <${m}> finished with ${_.status} status after ${v}ms`),g.properties.status=String(_.status),fp.debug(t,"request.response properties",g.properties),fp.debug(t,"request.response measurements",g.measurements),fp.debug(t,"prompt:",e),ft(t,"request.response",g),_}).catch(_=>{if(ig(_))throw ft(t,"request.cancel",g),_;h.setWarning("cls",{message:um(_,"message")??""});let E=g.extendedBy({error:"Network exception"});ft(t,"request.shownWarning",E),g.properties.message=String(um(_,"name")??""),g.properties.code=String(um(_,"code")??""),g.properties.errno=String(um(_,"errno")??""),g.properties.type=String(um(_,"type")??"");let v=Rl()-A;throw g.measurements.totalTimeMs=v,fp.info(t,`Request ${o} at <${m}> rejected with ${String(_)} after ${v}ms`),fp.debug(t,"request.error properties",g.properties),fp.debug(t,"request.error measurements",g.measurements),ft(t,"request.error",g),_}).finally(()=>{Rtn(t,e,g)})}a(SWo,"fetchWithInstrumentation");async function TWo(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});oJe(s,f,["messages"]),f.properties.headerRequestId=o,ft(t,"request.sent",f);let h=Rl(),m=iSn(l),g=om(t);n3()&&(g=await mWe(t,g));try{let A=await Qz(t,n,c.token,m,o,s,d,g),y=hF(A);f.extendWithRequestId(y);let _=Rl()-h;return f.measurements.totalTimeMs=_,fp.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${_}ms`),fp.debug(t,"request.response properties",f.properties),fp.debug(t,"request.response measurements",f.measurements),fp.debug(t,"messages:",JSON.stringify(e)),ft(t,"request.response",f),A}catch(A){if(ig(A))throw ft(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});ft(t,"request.shownWarning",y),f.properties.message=String(um(A,"name")??""),f.properties.code=String(um(A,"code")??""),f.properties.errno=String(um(A,"errno")??""),f.properties.type=String(um(A,"type")??"");let _=Rl()-h;throw f.measurements.totalTimeMs=_,fp.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${_}ms`),fp.debug(t,"request.error properties",f.properties),fp.debug(t,"request.error measurements",f.measurements),ft(t,"request.error",f),A}finally{zue(t,e,f)}}a(TWo,"fetchChatWithInstrumentation");function rSn(t){return Wbn(t,e=>e.completionText.trim().length>0)}a(rSn,"postProcessChoices");var IWo="github.copilot.completions.quotaExceeded",Fwe=class extends JO{static{a(this,"LiveOpenAIFetcher")}#e;async fetchAndStreamCompletions(e,r,n,o,s){if(this.#e)return{type:"canceled",reason:this.#e};let c=e.get(ks),l="completions",u=await e.get(Qt).getToken(),d=await this.fetchWithParameters(e,l,r,u,n,s);if(d==="not-sent")return{type:"canceled",reason:"before fetch request"};if(s?.isCancellationRequested){let g=d.body();try{g&&"destroy"in g&&typeof g.destroy=="function"?g.destroy():g instanceof ReadableStream&&g.cancel()}catch(A){fp.exception(e,A,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(d.status!==200){let g=this.createTelemetryData(l,e,r);return this.handleError(e,c,g,d,r.uiKind)}let h=bJ.create(e,r.count,d,n,[],s).processSSE(o),m=Lwe(h,g=>mjt(e,g,n));return{type:"success",choices:rSn(m),getProcessingTime:a(()=>mF(d),"getProcessingTime")}}async fetchAndStreamChat(e,r,n,o,s,c,l,u={},d){if(this.#e)return{type:"canceled",reason:this.#e};let f="https://copilot-proxy.githubusercontent.com/chat/completions",h={messages:r,model:l.id,stream:!0,...u},m=n.extendedBy({endpoint:f,model:l.name}),g=e.get(ks),A=await e.get(Qt).getToken(),y=await TWo(e,r,l.id,f,s,h,A,o,m,d);if(d?.isCancellationRequested){let S=y.body();try{S&&"destroy"in S&&typeof S.destroy=="function"?S.destroy():S instanceof ReadableStream&&S.cancel()}catch(T){fp.exception(e,T,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(y.status!==200){let S=Vt.createAndMarkAsIssued({endpoint:f,engineName:l.name,uiKind:o,headerRequestId:s});return this.handleError(e,g,S,y,o)}let E=bJ.create(e,1,y,m,[],nSn.CancellationToken.None).processSSE(),v=Lwe(E,S=>mjt(e,S,n));return{type:"success",choices:rSn(v),getProcessingTime:a(()=>mF(y),"getProcessingTime")}}createTelemetryData(e,r,n){return Vt.createAndMarkAsIssued({endpoint:e,engineName:n.engineModelId,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s,c){let l=e.get(tr).disableLogProb(s),u={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:nJe(e),temperature:$ue(e,n.count),top_p:Vue(e),n:n.count,stop:eSn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=PK(n.repoInfo);return d!==void 0&&(u.nwo=d),n.postOptions&&Object.assign(u,n.postOptions),n.prompt.context&&n.prompt.context.length>0&&(u.extra.context=n.prompt.context),await JC(0),c?.isCancellationRequested?"not-sent":await SWo(e,n.prompt,n.engineModelId,r,n.ourRequestId,u,o,n.uiKind,s,c,n.headers)}async handleError(e,r,n,o,s){let c=await o.text();if(o.status===402){this.#e="monthly free code completions exhausted",r.setError("cls",{message:"Completions limit reached"},{command:IWo,title:"Learn More"});let l=ws(e,u=>{this.#e=void 0,(u.envelope.limited_user_quotas?.completions??1)>0&&(r.forceNormal("cls",{inactive:!1}),l.dispose())});return{type:"failed",reason:this.#e}}if(o.status===466)return r.setError("cls",{message:c}),fp.info(e,c),{type:"failed",reason:`client not supported: ${c}`};if(o.clientError&&!o.headers.get("x-github-request-id")){let l=`Last response was a ${o.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;fp.error(e,l),r.setWarning("cls",{message:l}),n.properties.error=`Response status was ${o.status} with no x-github-request-id header`}else o.clientError?(fp.warn(e,`Response status was ${o.status}:`,c),r.setWarning("cls",{message:`Last response was a ${o.status} error: ${c}`}),n.properties.error=`Response status was ${o.status}: ${c}`):(r.setWarning("cls",{message:`Last response was a ${o.status} error`}),n.properties.error=`Response status was ${o.status}`);if(n.properties.status=String(o.status),ft(e,"request.shownWarning",n),o.status===401||o.status===403)return e.get(Qt).resetToken("code_completion",o.status),{type:"failed",reason:`token expired or invalid: ${o.status}`};if(o.status===429){let l=UM(o);sr(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:l??-1});let u=l??10,d=Math.max(u,0)*1e3;return setTimeout(()=>{this.#e=void 0},d),this.#e=`Rate limited by server. Retry in ${u}s.`,fp.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(fp.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(fp.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};Fo();async function Qwe(t,e,r,n){let o=Vt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(tr).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(Qwe,"createTelemetryWithExpWithId");function fl(t,{turn:e,conversation:r}={},n){return Qwe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(fl,"createTelemetryWithExpWithTurn");function qwe(t,e,r,n,o,s,c,l){let u=t.turns[t.turns.length-1].skills.map(h=>h.skillId).sort(),d={source:"user",turnIndex:(t.turns.length-1).toString(),uiKind:e,skillIds:u.join(",")},f={promptTokenLen:n,messageCharLen:r};return o&&(d.suggestion=o),s&&(d.suggestionId=s),l.length>0&&(d.skillResolutionsJson=JSON.stringify(xWo(l))),c=c.extendedBy(d,f),c}a(qwe,"extendUserMessageTelemetryData");function xWo(t){return t.map(e=>({skillId:e.skillId,resolution:e.resolution,fileStatus:e.files?.map(r=>r.status),tokensPreEliding:e.tokensPreEliding??0,resolutionTimeMs:e.resolutionTimeMs??0,processingTimeMs:e.processingTimeMs??0}))}a(xWo,"mapSkillResolutionsForTelemetry");function oSn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),sJe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(oSn,"createUserMessageTelemetryData");function sSn(t,e,r,n,o,s,c){let l=RWo(r);return sJe(t.ctx,s,e,r,{source:"model",turnIndex:(t.conversation.turns.length-1).toString(),headerRequestId:o,uiKind:e,codeBlockLanguages:JSON.stringify(l),mode:t.turn.getChatModeForTelemetry(),modelId:t.turn.getResolvedModelId()??"unknown"},{messageCharLen:r.length,numCodeBlocks:l.length,numTokens:n},c).properties.messageId}a(sSn,"createModelMessageTelemetryData");function aSn(t,e,r,n,o,s,c){sJe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(aSn,"createOffTopicMessageTelemetryData");function cSn(t,e,r,n,o,s,c,l,u){let d=sJe(t,l,r,n,{source:"suggestion",suggestion:s,turnIndex:(e.turns.length-1).toString(),uiKind:r,suggestionId:c},{promptTokenLen:o,messageCharLen:n.length},u);return wWo(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(cSn,"createSuggestionMessageTelemetryData");async function lSn(t,e,r){let n=await fl(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";mT(t.ctx,void 0,{conversationId:t.conversation.telemetryId,turnIndex:(t.conversation.turns.length-1).toString(),userMessageId:t.turn.telemetryId,provider:e,uiKind:o},r,"index.codesearch",n)}a(lSn,"telemetryIndexCodesearch");function sJe(t,e,r,n,o,s,c){let l=c??Vt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=Dt();o.messageId=m}e&&(o.languageId=e.detectedLanguageId,s.documentLength=e.getText().length,s.documentLineCount=e.lineCount);let u={messageText:n,...o},d=l.extendedBy(o,s),f=l.extendedBy(u),h=S_(r);return ft(t,`${h}.message`,d),ft(t,`${h}.messageText`,f,1),d}a(sJe,"telemetryMessage");function uSn(t,e,r,n){mT(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a(uSn,"createSuggestionShownTelemetryData");function wWo(t,e,r,n,o,s,c,l){mT(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(wWo,"createSuggestionSelectedTelemetryData");function mT(t,e,r,n,o,s){let c=s??Vt.createAndMarkAsIssued();e&&(r.languageId=e.detectedLanguageId,n.documentLength=e.getText().length,n.documentLineCount=e.lineCount);let l=c.extendedBy(r,n);return ft(t,o,l),l}a(mT,"telemetryUserAction");function zue(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return ft(t,"engine.messages",n,1)}a(zue,"logEngineMessages");function S_(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(S_,"telemetryPrefixForUiKind");function RWo(t){let e=t.split(` +`),r=[],n;for(let o=0;o(s.System="system",s.User="user",s.Assistant="assistant",s.Function="function",s.Tool="tool",s))(hc||{});function Mn(t){return t?(t=gT(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(Mn,"getTextPart");function hSn(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(hSn,"hasImageContent");function jq(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(zue(n))return n.some(o=>o.type==="image_url");if(bJ(n))return n.some(o=>Array.isArray(o.content)?o.content.some(s=>s.type==="image_url"):!1)}return!1},"checkContent");return e.request?.message&&r(e.request.message)||e.response?.message&&r(e.response.message)})}a(jq,"hasImageContentInTurns");var mSn=a((t,e)=>b.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),gSn=b.Optional(b.Object({agentSlug:b.String(),state:b.Union([b.Literal("accepted"),b.Literal("dismissed")]),confirmation:b.Any()}));function AF(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a(AF,"parseToolCallArguments");function ASn(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(ASn,"toOpenAIToolCall");function ySn(t,e,r,n,o,s,c,l,u,d,f,h){let m=JSON.parse(JSON.stringify(e));r.tool_calls&&(m.tool_calls=r.tool_calls),Wue(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=Vue(g,h)),{message:e,choiceIndex:n,requestId:o,blockFinished:s,finishReason:c,tokens:r.tokens,numTokens:r.tokens.length,tool_calls:r.tool_calls,function_call:r.function_call,telemetryData:l,copilotEditsSessionHeader:u,thinking:g,usage:d,copilot_usage:f}}a(ySn,"convertToChatCompletion");function zue(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(zue,"isChatCompletionContentPartArray");function bJ(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(bJ,"isChatMessageArray");function gT(t){if(typeof t=="string")return t;if(zue(t))return t;if(bJ(t)){let e=t.filter(n=>n.role==="assistant"),r=[];for(let n of e)Array.isArray(n.content)?r.push(...n.content):r.push({type:"text",text:n.content});return r}return""}a(gT,"resolveAsChatMessageContent");function Hq(t,e){return(typeof t=="string"||zue(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(Hq,"appendChatMessageContent");function ZO(t,e){if(t){if(typeof t=="string"||zue(t))return[{role:"assistant",content:t}];if(bJ(t))return e?t:t.filter(r=>r.role!=="tool").map(r=>r.tool_calls?{...r,tool_calls:void 0,tool_call_id:void 0}:r)}else return[];return[]}a(ZO,"resolveResponseAsChatMessages");p();var gjt=new pe("streamMessages");function _Sn(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(gjt.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),gjt.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),gjt.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=Uwe(e.solution,t),u={role:"assistant",content:s};return ySn(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(_Sn,"prepareChatCompletionForReturn");Fo();var aJe=class{constructor(){this.name="completions";this.engineName="chat"}static{a(this,"ChatCompletionsEndpointStrategy")}buildRequestBody(e,r){let o={messages:r.messages.map(c=>{let l={...c};if(delete l.thinking,c.thinking&&c.thinking.id){l.reasoning_opaque=c.thinking.id;let u=Array.isArray(c.thinking.text)?c.thinking.text.join(""):c.thinking.text;u&&(l.reasoning_text=u)}return l}),tools:r.tools,tool_choice:r.tool_choice,model:r.modelConfiguration?.modelId,temperature:Gue(e,r.count),top_p:$ue(e),n:r.count,stop:[` +`);return r+n}a(DWo,"truncateContentIfNeeded");var NWo=["requestSource","chatRequestModel","mapper","headerRequestId","mode","modelId","languageId","messageId","conversationId","uiKind"];function hSn(t,e,r,n,o,s,c){let l=`${S_(e)}.${c}`,u=s.extendedBy(r,n);ft(t,l,u);let d={...r,uiKind:e||""};ft(t,c),sr(t,c,K9(d,NWo),n);let f={...r};o.currentFileContent!==void 0&&(f.completionTextJson=DWo(o.currentFileContent));let h=s.extendedBy(f,n);ft(t,`${l}.restricted`,h,1)}a(hSn,"telemetryEditSurvivalTracking");var hc=(s=>(s.System="system",s.User="user",s.Assistant="assistant",s.Function="function",s.Tool="tool",s))(hc||{});function Mn(t){return t?(t=gT(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(Mn,"getTextPart");function mSn(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(mSn,"hasImageContent");function jq(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(Yue(n))return n.some(o=>o.type==="image_url");if(SJ(n))return n.some(o=>Array.isArray(o.content)?o.content.some(s=>s.type==="image_url"):!1)}return!1},"checkContent");return e.request?.message&&r(e.request.message)||e.response?.message&&r(e.response.message)})}a(jq,"hasImageContentInTurns");var gSn=a((t,e)=>b.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),ASn=b.Optional(b.Object({agentSlug:b.String(),state:b.Union([b.Literal("accepted"),b.Literal("dismissed")]),confirmation:b.Any()}));function AF(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a(AF,"parseToolCallArguments");function ySn(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(ySn,"toOpenAIToolCall");function _Sn(t,e,r,n,o,s,c,l,u,d,f,h){let m=JSON.parse(JSON.stringify(e));r.tool_calls&&(m.tool_calls=r.tool_calls),zue(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=Wue(g,h)),{message:e,choiceIndex:n,requestId:o,blockFinished:s,finishReason:c,tokens:r.tokens,numTokens:r.tokens.length,tool_calls:r.tool_calls,function_call:r.function_call,telemetryData:l,copilotEditsSessionHeader:u,thinking:g,usage:d,copilot_usage:f}}a(_Sn,"convertToChatCompletion");function Yue(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(Yue,"isChatCompletionContentPartArray");function SJ(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(SJ,"isChatMessageArray");function gT(t){if(typeof t=="string")return t;if(Yue(t))return t;if(SJ(t)){let e=t.filter(n=>n.role==="assistant"),r=[];for(let n of e)Array.isArray(n.content)?r.push(...n.content):r.push({type:"text",text:n.content});return r}return""}a(gT,"resolveAsChatMessageContent");function Hq(t,e){return(typeof t=="string"||Yue(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(Hq,"appendChatMessageContent");function ZO(t,e){if(t){if(typeof t=="string"||Yue(t))return[{role:"assistant",content:t}];if(SJ(t))return e?t:t.filter(r=>r.role!=="tool").map(r=>r.tool_calls?{...r,tool_calls:void 0,tool_call_id:void 0}:r)}else return[];return[]}a(ZO,"resolveResponseAsChatMessages");p();var Ajt=new pe("streamMessages");function ESn(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(Ajt.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),Ajt.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),Ajt.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=Uwe(e.solution,t),u={role:"assistant",content:s};return _Sn(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(ESn,"prepareChatCompletionForReturn");Fo();var aJe=class{constructor(){this.name="completions";this.engineName="chat"}static{a(this,"ChatCompletionsEndpointStrategy")}buildRequestBody(e,r){let o={messages:r.messages.map(c=>{let l={...c};if(delete l.thinking,c.thinking&&c.thinking.id){l.reasoning_opaque=c.thinking.id;let u=Array.isArray(c.thinking.text)?c.thinking.text.join(""):c.thinking.text;u&&(l.reasoning_text=u)}return l}),tools:r.tools,tool_choice:r.tool_choice,model:r.modelConfiguration?.modelId,temperature:$ue(e,r.count),top_p:Vue(e),n:r.count,stop:[` -`],copilot_thread_id:r.copilot_thread_id};r.modelConfiguration?.maxResponseTokens!==void 0&&(o.max_tokens=r.modelConfiguration.maxResponseTokens);let s=kK(r.repoInfo);if(s!==void 0&&(o.nwo=s),r.postOptions&&Object.assign(o,r.postOptions),r.enableThinking||r.modelConfiguration?.reasoningEfforts?.length){let c=YO(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort);c&&(o.reasoning_effort=c)}return r.intentParams?.intent&&(o.intent=r.intentParams.intent,r.intentParams.intent_model&&(o.intent_model=r.intentParams.intent_model),r.intentParams.intent_tokenizer&&(o.intent_tokenizer=r.intentParams.intent_tokenizer),r.intentParams.intent_threshold&&(o.intent_threshold=r.intentParams.intent_threshold),r.intentParams.intent_content&&(o.intent_content=r.intentParams.intent_content)),o}getAuthHeaders(e){return e?{"api-key":e}:{}}adaptRequest(e,r){Hue(e,r)}processResponse(e,r,n,o,s){let c=r.headers.get(Qq)||void 0;return s.postOptions?.stream===!1?{type:"success",chatCompletions:this.processNonStreamingResponse(r,n,o,c),getProcessingTime:a(()=>mF(r),"getProcessingTime")}:this.processStreamingResponse(e,r,n,o,c,s)}processNonStreamingResponse(e,r,n,o){return(async function*(){let s=await e.text(),c=JSON.parse(s),l=c.choices!=null?c.choices[0].message:{role:"assistant",content:""},u=e.headers.get("X-Request-ID")??Dt(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:Mn(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=Mn(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=CJ.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:Lwe(u,f=>_Sn(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>mF(r),"getProcessingTime")}}};p();p();p();var T_=fe(wo());var L1n="ephemeral",cHt=4,Nzo=2;function B1n(t){let e=cHt-Nzo-Mzo(t);if(e<=0)return;let r=!0,n=[...t].reverse();for(let[o,s]of n.entries()){let c=o>0?n[o-1]:void 0;if(s.content.some(f=>f.type===T_.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===T_.Raw.ChatRole.Tool&&c?.role!==T_.Raw.ChatRole.Tool,d=s.role===T_.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===T_.Raw.ChatRole.User)||d)&&(s.content.push({type:T_.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:L1n}),e--,e<=0))break;s.role===T_.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===T_.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===T_.Raw.ChatRole.User||o.role===T_.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:T_.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:L1n})),o.role!==T_.Raw.ChatRole.User&&o.role!==T_.Raw.ChatRole.System)break}}a(B1n,"addCacheBreakpoints");function Mzo(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===T_.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(Mzo,"countCacheBreakpoints");function F1n(t){for(let e of t)e.content=e.content.filter(r=>r.type!==T_.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(F1n,"removeCacheBreakpoints");var Q1n=new pe("messagesApi"),Ozo="Please continue.";function q1n(t){let e=Fzo(t.tools),r=Lzo(t.messages,t.ctx);Uzo(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:Ozo}]});let o={model:t.model,...r,max_tokens:t.maxTokens??4096,stream:t.stream??!0,...e.length>0?{tools:e}:{}};return t.adaptiveThinking?(o.thinking={type:"adaptive"},t.thinkingEffort&&(o.output_config={effort:t.thinkingEffort})):t.thinkingBudget&&t.thinkingBudget>0&&(o.thinking={type:"enabled",budget_tokens:t.thinkingBudget}),o}a(q1n,"buildMessagesApiRequest");function Lzo(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=FJe(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=FJe(s.content);s.copilot_cache_control&&U1n(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=FJe(s.content);if(s.thinking&&Bzo(e,c,s.thinking),s.tool_calls)for(let l of s.tool_calls){if(!l.id)continue;let u={};try{u=typeof l.function.arguments=="string"?JSON.parse(l.function.arguments):l.function.arguments}catch{Q1n.warn(e,`Failed to parse tool call arguments for ${l.function.name}, using empty object`)}c.push({type:"tool_use",id:l.id,name:l.function.name,input:u})}s.copilot_cache_control&&U1n(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=FJe(s.content).filter(d=>(d.type==="text"||d.type==="image")&&!(d.type==="text"&&d.text.trim()==="")),u={type:"tool_result",tool_use_id:s.tool_call_id,content:l.length>0?l:void 0};s.copilot_cache_control&&(u.cache_control={type:"ephemeral"}),r.push({role:"user",content:[u]})}break}}let o=[];for(let s of r){let c=o.at(-1);c&&c.role===s.role?c.content=[...c.content,...s.content]:o.push(s)}return{messages:o,...n.length>0?{system:n}:{}}}a(Lzo,"convertToAnthropicMessages");function FJe(t){if(!t)return[];if(typeof t=="string")return t.trim()?[{type:"text",text:t}]:[];let e=[];for(let r of t)if(r.type==="text")r.text.trim()&&e.push({type:"text",text:r.text});else if(r.type==="image_url"){let n=r.image_url.url,o=n.match(/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/);o?e.push({type:"image",source:{type:"base64",media_type:o[1],data:o[2]}}):n.startsWith("https://")&&e.push({type:"image",source:{type:"url",url:n}})}return e}a(FJe,"convertContentToAnthropicBlocks");function Bzo(t,e,r){let n=Array.isArray(r.text)?r.text.join(""):r.text;n&&r.encrypted?e.unshift({type:"thinking",thinking:n,signature:r.encrypted}):r.encrypted&&!n?e.unshift({type:"redacted_thinking",data:r.encrypted}):n&&!r.encrypted&&Q1n.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(Bzo,"addThinkingBlocks");function U1n(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.type!=="thinking"&&r.type!=="redacted_thinking"){r.cache_control={type:"ephemeral"};return}}}a(U1n,"applyCacheControlToLastBlock");function Fzo(t){return!t||t.length===0?[]:t.filter(e=>e.function.name&&e.function.name.length>0).map(e=>({name:e.function.name,description:e.function.description||"",input_schema:{type:"object",properties:e.function.parameters?.properties??{},required:e.function.parameters?.required}}))}a(Fzo,"convertToAnthropicTools");function Uzo(t,e){let r=0;if(e.system)for(let c of e.system)c.cache_control&&r++;for(let c of e.messages)for(let l of c.content)"cache_control"in l&&l.cache_control&&r++;let n=cHt-r;if(n<=0)return;let o=t.at(-1);o&&n>0&&(o.cache_control={type:"ephemeral"},n--);let s=e.system?.at(-1);s&&!s.cache_control&&n>0&&(s.cache_control={type:"ephemeral"})}a(Uzo,"addToolsAndSystemCacheControl");p();p();var Xue=class{constructor(e,r){this.dataBuffer="";this.eventTypeBuffer="";this.buffer=[];this.endedOnCR=!1;this.onEventHandler=e,this.onUnrecognizedFieldHandler=r,this.decoder=new TextDecoder("utf-8")}static{a(this,"SSEParser")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let r=0;for(this.endedOnCR&&e[0]===10&&r++,this.endedOnCR=!1;rmF(r),"getProcessingTime")}:this.processStreamingResponse(e,r,n,o,c,s)}processNonStreamingResponse(e,r,n,o){return(async function*(){let s=await e.text(),c=JSON.parse(s),l=c.choices!=null?c.choices[0].message:{role:"assistant",content:""},u=e.headers.get("X-Request-ID")??Dt(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:Mn(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=Mn(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=bJ.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:Lwe(u,f=>ESn(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>mF(r),"getProcessingTime")}}};p();p();p();var T_=fe(wo());var B1n="ephemeral",lHt=4,Ozo=2;function F1n(t){let e=lHt-Ozo-Lzo(t);if(e<=0)return;let r=!0,n=[...t].reverse();for(let[o,s]of n.entries()){let c=o>0?n[o-1]:void 0;if(s.content.some(f=>f.type===T_.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===T_.Raw.ChatRole.Tool&&c?.role!==T_.Raw.ChatRole.Tool,d=s.role===T_.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===T_.Raw.ChatRole.User)||d)&&(s.content.push({type:T_.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:B1n}),e--,e<=0))break;s.role===T_.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===T_.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===T_.Raw.ChatRole.User||o.role===T_.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:T_.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:B1n})),o.role!==T_.Raw.ChatRole.User&&o.role!==T_.Raw.ChatRole.System)break}}a(F1n,"addCacheBreakpoints");function Lzo(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===T_.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(Lzo,"countCacheBreakpoints");function U1n(t){for(let e of t)e.content=e.content.filter(r=>r.type!==T_.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(U1n,"removeCacheBreakpoints");var q1n=new pe("messagesApi"),Bzo="Please continue.";function j1n(t){let e=Qzo(t.tools),r=Fzo(t.messages,t.ctx);qzo(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:Bzo}]});let o={model:t.model,...r,max_tokens:t.maxTokens??4096,stream:t.stream??!0,...e.length>0?{tools:e}:{}};return t.adaptiveThinking?(o.thinking={type:"adaptive"},t.thinkingEffort&&(o.output_config={effort:t.thinkingEffort})):t.thinkingBudget&&t.thinkingBudget>0&&(o.thinking={type:"enabled",budget_tokens:t.thinkingBudget}),o}a(j1n,"buildMessagesApiRequest");function Fzo(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=FJe(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=FJe(s.content);s.copilot_cache_control&&Q1n(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=FJe(s.content);if(s.thinking&&Uzo(e,c,s.thinking),s.tool_calls)for(let l of s.tool_calls){if(!l.id)continue;let u={};try{u=typeof l.function.arguments=="string"?JSON.parse(l.function.arguments):l.function.arguments}catch{q1n.warn(e,`Failed to parse tool call arguments for ${l.function.name}, using empty object`)}c.push({type:"tool_use",id:l.id,name:l.function.name,input:u})}s.copilot_cache_control&&Q1n(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=FJe(s.content).filter(d=>(d.type==="text"||d.type==="image")&&!(d.type==="text"&&d.text.trim()==="")),u={type:"tool_result",tool_use_id:s.tool_call_id,content:l.length>0?l:void 0};s.copilot_cache_control&&(u.cache_control={type:"ephemeral"}),r.push({role:"user",content:[u]})}break}}let o=[];for(let s of r){let c=o.at(-1);c&&c.role===s.role?c.content=[...c.content,...s.content]:o.push(s)}return{messages:o,...n.length>0?{system:n}:{}}}a(Fzo,"convertToAnthropicMessages");function FJe(t){if(!t)return[];if(typeof t=="string")return t.trim()?[{type:"text",text:t}]:[];let e=[];for(let r of t)if(r.type==="text")r.text.trim()&&e.push({type:"text",text:r.text});else if(r.type==="image_url"){let n=r.image_url.url,o=n.match(/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/);o?e.push({type:"image",source:{type:"base64",media_type:o[1],data:o[2]}}):n.startsWith("https://")&&e.push({type:"image",source:{type:"url",url:n}})}return e}a(FJe,"convertContentToAnthropicBlocks");function Uzo(t,e,r){let n=Array.isArray(r.text)?r.text.join(""):r.text;n&&r.encrypted?e.unshift({type:"thinking",thinking:n,signature:r.encrypted}):r.encrypted&&!n?e.unshift({type:"redacted_thinking",data:r.encrypted}):n&&!r.encrypted&&q1n.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(Uzo,"addThinkingBlocks");function Q1n(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.type!=="thinking"&&r.type!=="redacted_thinking"){r.cache_control={type:"ephemeral"};return}}}a(Q1n,"applyCacheControlToLastBlock");function Qzo(t){return!t||t.length===0?[]:t.filter(e=>e.function.name&&e.function.name.length>0).map(e=>({name:e.function.name,description:e.function.description||"",input_schema:{type:"object",properties:e.function.parameters?.properties??{},required:e.function.parameters?.required}}))}a(Qzo,"convertToAnthropicTools");function qzo(t,e){let r=0;if(e.system)for(let c of e.system)c.cache_control&&r++;for(let c of e.messages)for(let l of c.content)"cache_control"in l&&l.cache_control&&r++;let n=lHt-r;if(n<=0)return;let o=t.at(-1);o&&n>0&&(o.cache_control={type:"ephemeral"},n--);let s=e.system?.at(-1);s&&!s.cache_control&&n>0&&(s.cache_control={type:"ephemeral"})}a(qzo,"addToolsAndSystemCacheControl");p();p();var ede=class{constructor(e,r){this.dataBuffer="";this.eventTypeBuffer="";this.buffer=[];this.endedOnCR=!1;this.onEventHandler=e,this.onUnrecognizedFieldHandler=r,this.decoder=new TextDecoder("utf-8")}static{a(this,"SSEParser")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let r=0;for(this.endedOnCR&&e[0]===10&&r++,this.endedOnCR=!1;r{try{if(A.data==="[DONE]")return;let y;try{y={type:A.type,...JSON.parse(A.data)}}catch(E){tRe.warn(t,`Skipping malformed SSE event: ${String(E.message).substring(0,100)}`);return}let _=f.push(y,r);_&&h.push(_)}catch(y){m=y}});for await(let A of l){if(s?.isCancellationRequested)break;for(g.feed(new Uint8Array(A));h.length>0;)yield h.shift();if(m)throw m}for(;h.length>0;)yield h.shift()}finally{try{l.destroy()}catch(g){tRe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(j1n,"processMessagesApiStream");var lHt=class{constructor(e,r,n,o,s,c){this.ctx=e;this.telemetryData=r;this.requestId=n;this.ghRequestId=o;this.copilotEditsSessionHeader=s;this.modelId=c;this.textAccumulator="";this.toolCallAccumulator=new Map;this.thinkingAccumulator=new Map;this.completedToolCalls=[];this.completedThinking=[];this.inputTokens=0;this.outputTokens=0;this.cacheCreationTokens=0;this.cacheReadTokens=0;this.hasError=!1}static{a(this,"AnthropicMessagesProcessor")}push(e,r){if(this.hasError)return;let n=a((o,s)=>{this.textAccumulator+=o,r(this.textAccumulator,{text:this.textAccumulator,...s})},"onProgress");switch(e.type){case"message_start":e.message&&(this.inputTokens=e.message.usage.input_tokens??0,this.outputTokens=e.message.usage.output_tokens??0,this.cacheCreationTokens=e.message.usage.cache_creation_input_tokens??0,this.cacheReadTokens=e.message.usage.cache_read_input_tokens??0);return;case"content_block_start":e.content_block?.type==="tool_use"&&e.index!==void 0?this.toolCallAccumulator.set(e.index,{id:e.content_block.id||"",name:e.content_block.name||"",arguments:""}):e.content_block?.type==="thinking"&&e.index!==void 0?this.thinkingAccumulator.set(e.index,{thinking:"",signature:""}):e.content_block?.type==="redacted_thinking"&&e.index!==void 0&&e.content_block.data&&(n("",{thinking:{id:`redacted_thinking_${e.index}`,encrypted:e.content_block.data}}),this.completedThinking.push({index:e.index,thinking:"",signature:e.content_block.data}));return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text)n(e.delta.text,{});else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.thinking+=e.delta.thinking),n("",{thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json)}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&(s.signature?n("",{thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}):tRe.warn(this.ctx,`Thinking block ${e.index} finalized without signature (incomplete stream?)`),this.completedThinking.push({index:e.index,...s}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens),e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.copilot_usage&&(this.copilotUsage=e.copilot_usage);return;case"message_stop":return this.buildFinalCompletion();case"error":{let o=e.error,s=o?.message||"Unknown error",c=o?.type||"unknown";return tRe.warn(this.ctx,`Messages API error (${c}): ${s}`),n("",{copilotErrors:[{type:"error",code:c,message:s,identifier:""}]}),this.stopReason="error",this.hasError=!0,this.buildFinalCompletion()}}}buildFinalCompletion(){let e;switch(this.stopReason){case"max_tokens":case"model_context_window_exceeded":e="length";break;case"tool_use":e="tool_calls";break;case"refusal":e="content_filter";break;default:e="stop";break}let r=this.inputTokens+this.cacheCreationTokens+this.cacheReadTokens,n={prompt_tokens:r,completion_tokens:this.outputTokens,total_tokens:r+this.outputTokens,prompt_tokens_details:{cached_tokens:this.cacheReadTokens}},o=this.copilotUsage,s={role:"assistant",content:this.textAccumulator},c=[...this.completedThinking.map(d=>({index:d.index,thinking:d.thinking,signature:d.signature})),...[...this.thinkingAccumulator.entries()].map(([d,f])=>({index:d,...f}))],l;for(let d of c)if(d.thinking||d.signature)if(!l)l={id:`thinking_${d.index}`,text:d.thinking||void 0,encrypted:d.signature||void 0};else{if(d.thinking){let f=Array.isArray(l.text)?l.text.join(""):l.text??"";l.text=f+d.thinking}d.signature&&(l.encrypted&&tRe.warn(this.ctx,"Multiple thinking blocks with signatures; keeping last"),l.id=`thinking_${d.index}`,l.encrypted=d.signature)}l&&l.tokens===void 0&&(l.tokens=Vue(l,this.modelId));let u={message:s,choiceIndex:0,requestId:{headerRequestId:this.requestId,deploymentId:"",serverExperiments:"",ghRequestId:this.ghRequestId},tokens:[],numTokens:0,blockFinished:!0,finishReason:e,telemetryData:this.telemetryData,usage:n,copilotEditsSessionHeader:this.copilotEditsSessionHeader,thinking:l,copilot_usage:o};return this.completedToolCalls.length>0&&(u.tool_calls=this.completedToolCalls.map(d=>({id:d.id,type:"function",function:{name:d.name,arguments:d.arguments},approxNumTokens:0}))),u}};var UJe=class{constructor(){this.name="v1/messages";this.engineName=""}static{a(this,"MessagesEndpointStrategy")}buildRequestBody(e,r){let n=r.postOptions,o=n?.thinking_budget,s=n?.adaptive_thinking,c=n?.thinking_effort;return q1n({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,maxTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,thinkingBudget:o,adaptiveThinking:s,thinkingEffort:c,ctx:e})}getAuthHeaders(e){return e?{"x-api-key":e,"anthropic-version":Wbn}:{}}adaptRequest(e,r){Hue(e,r,!0)}processResponse(e,r,n,o,s){let c=r.headers.get(Qq)||void 0;return{type:"success",chatCompletions:j1n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>mF(r),"getProcessingTime")}}};p();p();p();p();var $1n=fe(wo());var fr=class extends $1n.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?H1n(r):void 0,s=n?G1n(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?H1n(n):void 0,c=o?G1n(o):void 0;return this.renderCopilot(e,r,s,c)}};function H1n(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(H1n,"adaptProgressCallbackFromVSCode");function G1n(t){return{get isCancellationRequested(){return t?.isCancellationRequested??!1},onCancellationRequested:a((e,r)=>{let n=t?.onCancellationRequested(e,r);return{dispose:a(()=>{n?.dispose()},"dispose")}},"onCancellationRequested")}}a(G1n,"adaptCancellationTokenFromVSCode");var V1n="phase_data",QJe=class extends fr{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:V1n,phase:e}})}};function qJe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===V1n&&typeof r.phase=="string")return r.phase}a(qJe,"rawPartAsPhaseData");p();var W1n="thinking",ede=class extends fr{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:W1n,thinking:e},tokenUsage:e.tokens??0})}};function jJe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===W1n&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(jJe,"rawPartAsThinkingData");var _T=fe(wo());function Qzo(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=z1n(r);e.push({role:"system",content:n});break}case"user":{let n=z1n(r);e.push({role:"user",content:n});break}case"assistant":{if(r.thinking&&r.thinking.id&&r.thinking.encrypted){let o={type:"reasoning",id:r.thinking.id,summary:[],encrypted_content:r.thinking.encrypted};e.push(o)}let n=jzo(r);if(n.length>0){let o={type:"message",role:"assistant",id:"msg_123",status:"completed",content:n,...r.phase?{phase:r.phase}:{}};e.push(o)}if(r.tool_calls)for(let o of r.tool_calls)o.id&&e.push({type:"function_call",call_id:o.id,name:o.function.name,arguments:typeof o.function.arguments=="string"?o.function.arguments:JSON.stringify(o.function.arguments)});break}case"tool":{if(r.tool_call_id){let n=typeof r.content=="string"?r.content:Array.isArray(r.content)?r.content.map(o=>o.type==="text"?o.text:"").join(""):"";e.push({type:"function_call_output",call_id:r.tool_call_id,output:n})}break}}return e}a(Qzo,"convertToResponsesApiInput");function qzo(t){let e=[];for(let r of t)switch(r.role){case _T.Raw.ChatRole.Assistant:if(r.content&&r.content.length>0){let n=Hzo(r.content);e.push(...n)}if(r.content&&r.content.length>0){let n=[];for(let o of r.content)o.type===_T.Raw.ChatCompletionContentPartKind.Text&&o.text.trim()&&n.push({type:"output_text",text:o.text,annotations:[]});if(n.length>0){let o=Gzo(r.content),s={type:"message",role:"assistant",id:"msg_123",status:"completed",content:n,...o?{phase:o}:{}};e.push(s)}}if(r.toolCalls)for(let n of r.toolCalls)e.push({type:"function_call",name:n.function.name,arguments:n.function.arguments,call_id:n.id});break;case _T.Raw.ChatRole.Tool:if(r.toolCallId&&r.content){let n=r.content.filter(s=>s.type===_T.Raw.ChatCompletionContentPartKind.Text).map(s=>s.text).join("");n&&e.push({type:"function_call_output",call_id:r.toolCallId,output:n});let o=r.content.filter(s=>s.type===_T.Raw.ChatCompletionContentPartKind.Image).map(s=>({type:"input_image",image_url:s.imageUrl.url,detail:s.imageUrl.detail||"auto"}));o.length&&e.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...o]})}break;case _T.Raw.ChatRole.User:if(r.content){let n=[];for(let o of r.content)o.type===_T.Raw.ChatCompletionContentPartKind.Text?n.push({type:"input_text",text:o.text}):o.type===_T.Raw.ChatCompletionContentPartKind.Image&&n.push({type:"input_image",image_url:o.imageUrl.url,detail:o.imageUrl.detail||"auto"});n.length>0&&e.push({role:"user",content:n})}break;case _T.Raw.ChatRole.System:if(r.content){let n=[];for(let o of r.content)o.type===_T.Raw.ChatCompletionContentPartKind.Text&&n.push({type:"input_text",text:o.text});n.length>0&&e.push({role:"system",content:n})}break}return{input:e}}a(qzo,"convertRawMessagesToResponsesApiInput");function z1n(t){return typeof t.content=="string"?[{type:"input_text",text:t.content.trim()}]:Array.isArray(t.content)?t.content.map(e=>e.type==="text"?{type:"input_text",text:e.text.trim()}:e.type==="image_url"?{type:"input_image",image_url:e.image_url.url,detail:e.image_url.detail||"auto"}:{type:"input_text",text:""}):[{type:"input_text",text:""}]}a(z1n,"convertMessageContentToInputParts");function jzo(t){if(typeof t.content=="string")return t.content.trim()?[{type:"output_text",text:t.content,annotations:[]}]:[];if(Array.isArray(t.content)){let e=[];for(let r of t.content)r.type==="text"&&r.text.trim()&&e.push({type:"output_text",text:r.text,annotations:[]});return e}return[]}a(jzo,"convertMessageContentToOutputParts");function Hzo(t){let e=[];for(let r of t)if(r.type===_T.Raw.ChatCompletionContentPartKind.Opaque){let n=jJe(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a(Hzo,"extractReasoningFromRawMessage");function Gzo(t){for(let e of t)if(e.type===_T.Raw.ChatCompletionContentPartKind.Opaque){let r=qJe(e);if(r)return r}}a(Gzo,"extractPhaseFromRawMessage");function Y1n(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=qzo(r).input:u=Qzo(e);let d={model:n,input:u};return o&&o.length>0&&(d.tools=o.map(f=>({...f.function,type:"function",strict:!1,parameters:f.function.parameters||{}}))),s&&(typeof s=="object"&&"function"in s?d.tool_choice={type:"function",name:s.function.name}:d.tool_choice=s),c!==void 0&&(d.max_output_tokens=c),d.stream=!0,d.store=!1,d.truncation="disabled",l&&(d.reasoning={effort:t.reasoningEffort??"medium",summary:"detailed"},d.include=["reasoning.encrypted_content"]),d}a(Y1n,"buildResponsesApiRequest");p();var uHt=new pe("responsesApiStream"),$zo=10,HJe=500,NJ=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function K1n(t,e,r){if(!t)return{};try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse JSON for ${e} '${r}': ${ld(n)}. Input: '${t}'`)}}a(K1n,"parseCallArguments");async function*J1n(t,e,r,n,o,s,c){let l=e.body(),u=e.headers.get("X-Request-ID")||e.headers.get("x-request-id")||"unknown",d=e.headers.get("x-github-request-id")||"",f=new dHt(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new Xue(_=>{try{let E={type:_.type,...JSON.parse(_.data)},v=f.push(E,r);v&&h.push(v)}catch(E){m=E}},(_,E)=>{if(A.length>=$zo)return;let v=_.trim(),S=E?.trim(),T=v&&S?`${v}: ${S}`:v||S||"";T.length>0&&A.push(T.length>HJe?T.substring(0,HJe):T)});for await(let _ of l){if(s?.isCancellationRequested)break;for(y.feed(new Uint8Array(_));h.length>0;)g=!0,yield h.shift();if(m)throw m}for(;h.length>0;)g=!0,yield h.shift();if(!g&&!s?.isCancellationRequested){let _=f.hasReceivedContentEvents();if(A.length>0){let E=A.join("; ");throw E.length>HJe&&(E=E.substring(0,HJe)+"\u2026"),uHt.error(t,`Non-SSE text received in stream for request ${u}: ${E}`),_?new NJ(`The server disconnected unexpectedly while generating a response (${E}). The partial response above may be incomplete.`):new NJ(`The server returned an error: ${E}`)}else if(_)throw uHt.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new NJ("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){uHt.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a(J1n,"processResponsesApiStream");var dHt=class{constructor(e,r,n,o,s){this.telemetryData=e;this.requestId=r;this.copilotEditsSessionHeader=n;this.modelId=s;this.textAccumulator="";this.hasReceivedReasoningSummary=!1;this.thinking={id:"",text:[]};this.eventCount=0}static{a(this,"OpenAIResponsesProcessor")}hasReceivedContentEvents(){return this.eventCount>0}push(e,r){let n=a(o=>{this.textAccumulator+=o.text,r(this.textAccumulator,o)},"onProgress");switch(e.type){case"error":n({text:"",copilotErrors:[{code:e.code||"unknown",message:e.message,type:"error",identifier:e.param||""}]});return;case"response.output_text.delta":this.eventCount++,n({text:e.delta});return;case"response.output_item.added":this.eventCount++,e.item.type==="function_call"&&n({text:"",beginToolCalls:[{name:e.item.name}]});return;case"response.output_item.done":return this.handleOutputItemDone(e.item,n);case"response.reasoning_summary_text.delta":this.eventCount++,this.hasReceivedReasoningSummary=!0,e.delta&&Array.isArray(this.thinking.text)&&this.thinking.text.push(e.delta),n({text:"",thinking:{id:e.item_id,text:e.delta}});return;case"response.reasoning_summary_part.done":this.hasReceivedReasoningSummary=!0,Array.isArray(this.thinking.text)&&this.thinking.text.push(` +`)&&(this.dataBuffer=this.dataBuffer.substring(0,this.dataBuffer.length-1));let e={type:this.eventTypeBuffer||"message",data:this.dataBuffer};this.currentEventId!==void 0&&(e.id=this.currentEventId),this.reconnectionTime!==void 0&&(e.retry=this.reconnectionTime),this.onEventHandler(e),this.reset()}reset(){this.dataBuffer="",this.eventTypeBuffer="",this.currentEventId=void 0}};var tRe=new pe("messagesApiStream");async function*H1n(t,e,r,n,o,s,c){let l=e.body(),u=e.headers.get("X-Request-ID")||e.headers.get("x-request-id")||"unknown",d=e.headers.get("x-github-request-id")||"",f=new uHt(t,n,u,d,o,c),h=[],m;try{let g=new ede(A=>{try{if(A.data==="[DONE]")return;let y;try{y={type:A.type,...JSON.parse(A.data)}}catch(E){tRe.warn(t,`Skipping malformed SSE event: ${String(E.message).substring(0,100)}`);return}let _=f.push(y,r);_&&h.push(_)}catch(y){m=y}});for await(let A of l){if(s?.isCancellationRequested)break;for(g.feed(new Uint8Array(A));h.length>0;)yield h.shift();if(m)throw m}for(;h.length>0;)yield h.shift()}finally{try{l.destroy()}catch(g){tRe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(H1n,"processMessagesApiStream");var uHt=class{constructor(e,r,n,o,s,c){this.ctx=e;this.telemetryData=r;this.requestId=n;this.ghRequestId=o;this.copilotEditsSessionHeader=s;this.modelId=c;this.textAccumulator="";this.toolCallAccumulator=new Map;this.thinkingAccumulator=new Map;this.completedToolCalls=[];this.completedThinking=[];this.inputTokens=0;this.outputTokens=0;this.cacheCreationTokens=0;this.cacheReadTokens=0;this.hasError=!1}static{a(this,"AnthropicMessagesProcessor")}push(e,r){if(this.hasError)return;let n=a((o,s)=>{this.textAccumulator+=o,r(this.textAccumulator,{text:this.textAccumulator,...s})},"onProgress");switch(e.type){case"message_start":e.message&&(this.inputTokens=e.message.usage.input_tokens??0,this.outputTokens=e.message.usage.output_tokens??0,this.cacheCreationTokens=e.message.usage.cache_creation_input_tokens??0,this.cacheReadTokens=e.message.usage.cache_read_input_tokens??0);return;case"content_block_start":e.content_block?.type==="tool_use"&&e.index!==void 0?this.toolCallAccumulator.set(e.index,{id:e.content_block.id||"",name:e.content_block.name||"",arguments:""}):e.content_block?.type==="thinking"&&e.index!==void 0?this.thinkingAccumulator.set(e.index,{thinking:"",signature:""}):e.content_block?.type==="redacted_thinking"&&e.index!==void 0&&e.content_block.data&&(n("",{thinking:{id:`redacted_thinking_${e.index}`,encrypted:e.content_block.data}}),this.completedThinking.push({index:e.index,thinking:"",signature:e.content_block.data}));return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text)n(e.delta.text,{});else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.thinking+=e.delta.thinking),n("",{thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json)}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&(s.signature?n("",{thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}):tRe.warn(this.ctx,`Thinking block ${e.index} finalized without signature (incomplete stream?)`),this.completedThinking.push({index:e.index,...s}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens),e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.copilot_usage&&(this.copilotUsage=e.copilot_usage);return;case"message_stop":return this.buildFinalCompletion();case"error":{let o=e.error,s=o?.message||"Unknown error",c=o?.type||"unknown";return tRe.warn(this.ctx,`Messages API error (${c}): ${s}`),n("",{copilotErrors:[{type:"error",code:c,message:s,identifier:""}]}),this.stopReason="error",this.hasError=!0,this.buildFinalCompletion()}}}buildFinalCompletion(){let e;switch(this.stopReason){case"max_tokens":case"model_context_window_exceeded":e="length";break;case"tool_use":e="tool_calls";break;case"refusal":e="content_filter";break;default:e="stop";break}let r=this.inputTokens+this.cacheCreationTokens+this.cacheReadTokens,n={prompt_tokens:r,completion_tokens:this.outputTokens,total_tokens:r+this.outputTokens,prompt_tokens_details:{cached_tokens:this.cacheReadTokens}},o=this.copilotUsage,s={role:"assistant",content:this.textAccumulator},c=[...this.completedThinking.map(d=>({index:d.index,thinking:d.thinking,signature:d.signature})),...[...this.thinkingAccumulator.entries()].map(([d,f])=>({index:d,...f}))],l;for(let d of c)if(d.thinking||d.signature)if(!l)l={id:`thinking_${d.index}`,text:d.thinking||void 0,encrypted:d.signature||void 0};else{if(d.thinking){let f=Array.isArray(l.text)?l.text.join(""):l.text??"";l.text=f+d.thinking}d.signature&&(l.encrypted&&tRe.warn(this.ctx,"Multiple thinking blocks with signatures; keeping last"),l.id=`thinking_${d.index}`,l.encrypted=d.signature)}l&&l.tokens===void 0&&(l.tokens=Wue(l,this.modelId));let u={message:s,choiceIndex:0,requestId:{headerRequestId:this.requestId,deploymentId:"",serverExperiments:"",ghRequestId:this.ghRequestId},tokens:[],numTokens:0,blockFinished:!0,finishReason:e,telemetryData:this.telemetryData,usage:n,copilotEditsSessionHeader:this.copilotEditsSessionHeader,thinking:l,copilot_usage:o};return this.completedToolCalls.length>0&&(u.tool_calls=this.completedToolCalls.map(d=>({id:d.id,type:"function",function:{name:d.name,arguments:d.arguments},approxNumTokens:0}))),u}};var UJe=class{constructor(){this.name="v1/messages";this.engineName=""}static{a(this,"MessagesEndpointStrategy")}buildRequestBody(e,r){let n=r.postOptions,o=n?.thinking_budget,s=n?.adaptive_thinking,c=n?.thinking_effort;return j1n({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,maxTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,thinkingBudget:o,adaptiveThinking:s,thinkingEffort:c,ctx:e})}getAuthHeaders(e){return e?{"x-api-key":e,"anthropic-version":zbn}:{}}adaptRequest(e,r){Gue(e,r,!0)}processResponse(e,r,n,o,s){let c=r.headers.get(Qq)||void 0;return{type:"success",chatCompletions:H1n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>mF(r),"getProcessingTime")}}};p();p();p();p();var V1n=fe(wo());var fr=class extends V1n.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?G1n(r):void 0,s=n?$1n(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?G1n(n):void 0,c=o?$1n(o):void 0;return this.renderCopilot(e,r,s,c)}};function G1n(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(G1n,"adaptProgressCallbackFromVSCode");function $1n(t){return{get isCancellationRequested(){return t?.isCancellationRequested??!1},onCancellationRequested:a((e,r)=>{let n=t?.onCancellationRequested(e,r);return{dispose:a(()=>{n?.dispose()},"dispose")}},"onCancellationRequested")}}a($1n,"adaptCancellationTokenFromVSCode");var W1n="phase_data",QJe=class extends fr{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:W1n,phase:e}})}};function qJe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===W1n&&typeof r.phase=="string")return r.phase}a(qJe,"rawPartAsPhaseData");p();var z1n="thinking",tde=class extends fr{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:z1n,thinking:e},tokenUsage:e.tokens??0})}};function jJe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===z1n&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(jJe,"rawPartAsThinkingData");var _T=fe(wo());function jzo(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=Y1n(r);e.push({role:"system",content:n});break}case"user":{let n=Y1n(r);e.push({role:"user",content:n});break}case"assistant":{if(r.thinking&&r.thinking.id&&r.thinking.encrypted){let o={type:"reasoning",id:r.thinking.id,summary:[],encrypted_content:r.thinking.encrypted};e.push(o)}let n=Gzo(r);if(n.length>0){let o={type:"message",role:"assistant",id:"msg_123",status:"completed",content:n,...r.phase?{phase:r.phase}:{}};e.push(o)}if(r.tool_calls)for(let o of r.tool_calls)o.id&&e.push({type:"function_call",call_id:o.id,name:o.function.name,arguments:typeof o.function.arguments=="string"?o.function.arguments:JSON.stringify(o.function.arguments)});break}case"tool":{if(r.tool_call_id){let n=typeof r.content=="string"?r.content:Array.isArray(r.content)?r.content.map(o=>o.type==="text"?o.text:"").join(""):"";e.push({type:"function_call_output",call_id:r.tool_call_id,output:n})}break}}return e}a(jzo,"convertToResponsesApiInput");function Hzo(t){let e=[];for(let r of t)switch(r.role){case _T.Raw.ChatRole.Assistant:if(r.content&&r.content.length>0){let n=$zo(r.content);e.push(...n)}if(r.content&&r.content.length>0){let n=[];for(let o of r.content)o.type===_T.Raw.ChatCompletionContentPartKind.Text&&o.text.trim()&&n.push({type:"output_text",text:o.text,annotations:[]});if(n.length>0){let o=Vzo(r.content),s={type:"message",role:"assistant",id:"msg_123",status:"completed",content:n,...o?{phase:o}:{}};e.push(s)}}if(r.toolCalls)for(let n of r.toolCalls)e.push({type:"function_call",name:n.function.name,arguments:n.function.arguments,call_id:n.id});break;case _T.Raw.ChatRole.Tool:if(r.toolCallId&&r.content){let n=r.content.filter(s=>s.type===_T.Raw.ChatCompletionContentPartKind.Text).map(s=>s.text).join("");n&&e.push({type:"function_call_output",call_id:r.toolCallId,output:n});let o=r.content.filter(s=>s.type===_T.Raw.ChatCompletionContentPartKind.Image).map(s=>({type:"input_image",image_url:s.imageUrl.url,detail:s.imageUrl.detail||"auto"}));o.length&&e.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...o]})}break;case _T.Raw.ChatRole.User:if(r.content){let n=[];for(let o of r.content)o.type===_T.Raw.ChatCompletionContentPartKind.Text?n.push({type:"input_text",text:o.text}):o.type===_T.Raw.ChatCompletionContentPartKind.Image&&n.push({type:"input_image",image_url:o.imageUrl.url,detail:o.imageUrl.detail||"auto"});n.length>0&&e.push({role:"user",content:n})}break;case _T.Raw.ChatRole.System:if(r.content){let n=[];for(let o of r.content)o.type===_T.Raw.ChatCompletionContentPartKind.Text&&n.push({type:"input_text",text:o.text});n.length>0&&e.push({role:"system",content:n})}break}return{input:e}}a(Hzo,"convertRawMessagesToResponsesApiInput");function Y1n(t){return typeof t.content=="string"?[{type:"input_text",text:t.content.trim()}]:Array.isArray(t.content)?t.content.map(e=>e.type==="text"?{type:"input_text",text:e.text.trim()}:e.type==="image_url"?{type:"input_image",image_url:e.image_url.url,detail:e.image_url.detail||"auto"}:{type:"input_text",text:""}):[{type:"input_text",text:""}]}a(Y1n,"convertMessageContentToInputParts");function Gzo(t){if(typeof t.content=="string")return t.content.trim()?[{type:"output_text",text:t.content,annotations:[]}]:[];if(Array.isArray(t.content)){let e=[];for(let r of t.content)r.type==="text"&&r.text.trim()&&e.push({type:"output_text",text:r.text,annotations:[]});return e}return[]}a(Gzo,"convertMessageContentToOutputParts");function $zo(t){let e=[];for(let r of t)if(r.type===_T.Raw.ChatCompletionContentPartKind.Opaque){let n=jJe(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a($zo,"extractReasoningFromRawMessage");function Vzo(t){for(let e of t)if(e.type===_T.Raw.ChatCompletionContentPartKind.Opaque){let r=qJe(e);if(r)return r}}a(Vzo,"extractPhaseFromRawMessage");function K1n(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=Hzo(r).input:u=jzo(e);let d={model:n,input:u};return o&&o.length>0&&(d.tools=o.map(f=>({...f.function,type:"function",strict:!1,parameters:f.function.parameters||{}}))),s&&(typeof s=="object"&&"function"in s?d.tool_choice={type:"function",name:s.function.name}:d.tool_choice=s),c!==void 0&&(d.max_output_tokens=c),d.stream=!0,d.store=!1,d.truncation="disabled",l&&(d.reasoning={effort:t.reasoningEffort??"medium",summary:"detailed"},d.include=["reasoning.encrypted_content"]),d}a(K1n,"buildResponsesApiRequest");p();var dHt=new pe("responsesApiStream"),Wzo=10,HJe=500,MJ=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function J1n(t,e,r){if(!t)return{};try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse JSON for ${e} '${r}': ${ld(n)}. Input: '${t}'`)}}a(J1n,"parseCallArguments");async function*Z1n(t,e,r,n,o,s,c){let l=e.body(),u=e.headers.get("X-Request-ID")||e.headers.get("x-request-id")||"unknown",d=e.headers.get("x-github-request-id")||"",f=new fHt(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new ede(_=>{try{let E={type:_.type,...JSON.parse(_.data)},v=f.push(E,r);v&&h.push(v)}catch(E){m=E}},(_,E)=>{if(A.length>=Wzo)return;let v=_.trim(),S=E?.trim(),T=v&&S?`${v}: ${S}`:v||S||"";T.length>0&&A.push(T.length>HJe?T.substring(0,HJe):T)});for await(let _ of l){if(s?.isCancellationRequested)break;for(y.feed(new Uint8Array(_));h.length>0;)g=!0,yield h.shift();if(m)throw m}for(;h.length>0;)g=!0,yield h.shift();if(!g&&!s?.isCancellationRequested){let _=f.hasReceivedContentEvents();if(A.length>0){let E=A.join("; ");throw E.length>HJe&&(E=E.substring(0,HJe)+"\u2026"),dHt.error(t,`Non-SSE text received in stream for request ${u}: ${E}`),_?new MJ(`The server disconnected unexpectedly while generating a response (${E}). The partial response above may be incomplete.`):new MJ(`The server returned an error: ${E}`)}else if(_)throw dHt.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new MJ("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){dHt.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a(Z1n,"processResponsesApiStream");var fHt=class{constructor(e,r,n,o,s){this.telemetryData=e;this.requestId=r;this.copilotEditsSessionHeader=n;this.modelId=s;this.textAccumulator="";this.hasReceivedReasoningSummary=!1;this.thinking={id:"",text:[]};this.eventCount=0}static{a(this,"OpenAIResponsesProcessor")}hasReceivedContentEvents(){return this.eventCount>0}push(e,r){let n=a(o=>{this.textAccumulator+=o.text,r(this.textAccumulator,o)},"onProgress");switch(e.type){case"error":n({text:"",copilotErrors:[{code:e.code||"unknown",message:e.message,type:"error",identifier:e.param||""}]});return;case"response.output_text.delta":this.eventCount++,n({text:e.delta});return;case"response.output_item.added":this.eventCount++,e.item.type==="function_call"&&n({text:"",beginToolCalls:[{name:e.item.name}]});return;case"response.output_item.done":return this.handleOutputItemDone(e.item,n);case"response.reasoning_summary_text.delta":this.eventCount++,this.hasReceivedReasoningSummary=!0,e.delta&&Array.isArray(this.thinking.text)&&this.thinking.text.push(e.delta),n({text:"",thinking:{id:e.item_id,text:e.delta}});return;case"response.reasoning_summary_part.done":this.hasReceivedReasoningSummary=!0,Array.isArray(this.thinking.text)&&this.thinking.text.push(` `),n({text:"",thinking:{id:e.item_id,text:` -`}});return;case"response.completed":return this.handleCompletedResponse(e,n);default:return}}handleOutputItemDone(e,r){if(this.eventCount++,e.type==="function_call"){let n=K1n(e.arguments,"tool call",e.name);r({text:"",toolCalls:[{id:e.call_id,type:"function",function:{name:e.name,arguments:n},approxNumTokens:0}],phase:e.phase})}else if(e.type==="reasoning")e.id&&(this.thinking.id=e.id),e.encrypted_content&&(this.thinking.encrypted=e.encrypted_content),r({text:"",thinking:e.encrypted_content?{id:e.id,text:this.hasReceivedReasoningSummary?void 0:e.summary.map(n=>n.text),encrypted:e.encrypted_content}:void 0});else if(e.type==="message"){let n=e.phase;n&&r({text:"",phase:n})}}handleCompletedResponse(e,r){r({text:"",statefulMarker:e.response.id});let n=[],o=[];for(let f of e.response.output)if(f.type==="message"){if(f.content)for(let h of f.content)h.type==="output_text"&&h.text?n.push(h.text):h.type==="refusal"&&h.refusal&&n.push(h.refusal)}else if(f.type==="function_call"){let h=K1n(f.arguments,"tool call",f.name);o.push({id:f.call_id,type:"function",function:{name:f.name,arguments:h},approxNumTokens:0})}let s={role:"assistant",content:n.join("")},c={prompt_tokens:e.response.usage?.input_tokens??0,completion_tokens:e.response.usage?.output_tokens??0,total_tokens:e.response.usage?.total_tokens??0,prompt_tokens_details:{cached_tokens:e.response.usage?.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.response.usage?.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}},l={headerRequestId:this.requestId,serverExperiments:"",deploymentId:""},u=this.thinking.id?this.thinking:void 0;u&&u.tokens===void 0&&(u.tokens=Vue(u,this.modelId));let d=e.copilot_usage;return{message:s,choiceIndex:0,requestId:l,tokens:[],numTokens:c.completion_tokens,blockFinished:!0,finishReason:o.length>0?"tool_calls":"stop",telemetryData:this.telemetryData,tool_calls:o.length>0?o:void 0,thinking:u,copilotEditsSessionHeader:this.copilotEditsSessionHeader,usage:c,copilot_usage:d}}};var GJe=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return Y1n({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??$ue(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:YO(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}getAuthHeaders(e){return e?{"api-key":e}:{}}adaptRequest(e,r){Hue(e,r)}processResponse(e,r,n,o,s){let c=r.headers.get(Qq)||void 0;return{type:"success",chatCompletions:J1n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>mF(r),"getProcessingTime")}}};p2.register(new GJe);p2.register(new aJe);p2.register(new UJe);p();var $Je=require("fs"),ET=fe(require("path"));function zJe(t){return hue(()=>!!kt(t,ze.PromptPersistBasePath)?.trim(),!1)}a(zJe,"isPromptPersistEnabled");var Vzo={mkdir:a((t,e)=>$Je.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>$Je.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>$Je.promises.appendFile(t,e,r),"appendFile")},y2,VJe,hHt,fHt=new Map,Z1n=0,pHt=new Map,mHt=new Map;function gHt(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(gHt,"formatHumanTimestamp");function AHt(t,e){return VJe||(VJe=Wzo(t,e)),VJe}a(AHt,"getSharedProcessRoot");async function Wzo(t,e){let r=gHt(new Date);y2=ET.join(t,`pid-${process.pid}_${r}`),await e.mkdir(y2,{recursive:!0});let n=new Date().toISOString();hHt=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:y2};return await e.writeFile(ET.join(y2,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await Yzo(y2,e).catch(()=>{}),await Kzo(y2,e).catch(()=>{}),y2}a(Wzo,"initProcessRoot");async function zzo(t){if(y2)try{let e=ET.join(y2,"session.json"),r=new Date().toISOString(),n={createdAt:hHt??r,updatedAt:r,pid:process.pid,processRoot:y2};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(zzo,"touchProcessRootSessionJson");function yHt(t){return mHt.get(t)}a(yHt,"getTurnDir");function X1n(){y2=void 0,VJe=void 0,hHt=void 0,fHt.clear(),Z1n=0,pHt.clear(),mHt.clear()}a(X1n,"resetSharedProcessRoot");async function Yzo(t,e){await e.writeFile(ET.join(t,"README.md"),`# Copilot Language Server \u2014 Request Logs +`}});return;case"response.completed":return this.handleCompletedResponse(e,n);default:return}}handleOutputItemDone(e,r){if(this.eventCount++,e.type==="function_call"){let n=J1n(e.arguments,"tool call",e.name);r({text:"",toolCalls:[{id:e.call_id,type:"function",function:{name:e.name,arguments:n},approxNumTokens:0}],phase:e.phase})}else if(e.type==="reasoning")e.id&&(this.thinking.id=e.id),e.encrypted_content&&(this.thinking.encrypted=e.encrypted_content),r({text:"",thinking:e.encrypted_content?{id:e.id,text:this.hasReceivedReasoningSummary?void 0:e.summary.map(n=>n.text),encrypted:e.encrypted_content}:void 0});else if(e.type==="message"){let n=e.phase;n&&r({text:"",phase:n})}}handleCompletedResponse(e,r){r({text:"",statefulMarker:e.response.id});let n=[],o=[];for(let f of e.response.output)if(f.type==="message"){if(f.content)for(let h of f.content)h.type==="output_text"&&h.text?n.push(h.text):h.type==="refusal"&&h.refusal&&n.push(h.refusal)}else if(f.type==="function_call"){let h=J1n(f.arguments,"tool call",f.name);o.push({id:f.call_id,type:"function",function:{name:f.name,arguments:h},approxNumTokens:0})}let s={role:"assistant",content:n.join("")},c={prompt_tokens:e.response.usage?.input_tokens??0,completion_tokens:e.response.usage?.output_tokens??0,total_tokens:e.response.usage?.total_tokens??0,prompt_tokens_details:{cached_tokens:e.response.usage?.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.response.usage?.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}},l={headerRequestId:this.requestId,serverExperiments:"",deploymentId:""},u=this.thinking.id?this.thinking:void 0;u&&u.tokens===void 0&&(u.tokens=Wue(u,this.modelId));let d=e.copilot_usage;return{message:s,choiceIndex:0,requestId:l,tokens:[],numTokens:c.completion_tokens,blockFinished:!0,finishReason:o.length>0?"tool_calls":"stop",telemetryData:this.telemetryData,tool_calls:o.length>0?o:void 0,thinking:u,copilotEditsSessionHeader:this.copilotEditsSessionHeader,usage:c,copilot_usage:d}}};var GJe=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return K1n({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??Vue(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:YO(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}getAuthHeaders(e){return e?{"api-key":e}:{}}adaptRequest(e,r){Gue(e,r)}processResponse(e,r,n,o,s){let c=r.headers.get(Qq)||void 0;return{type:"success",chatCompletions:Z1n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>mF(r),"getProcessingTime")}}};p2.register(new GJe);p2.register(new aJe);p2.register(new UJe);p();var $Je=require("fs"),ET=fe(require("path"));function zJe(t){return mue(()=>!!kt(t,ze.PromptPersistBasePath)?.trim(),!1)}a(zJe,"isPromptPersistEnabled");var zzo={mkdir:a((t,e)=>$Je.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>$Je.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>$Je.promises.appendFile(t,e,r),"appendFile")},y2,VJe,mHt,pHt=new Map,X1n=0,hHt=new Map,gHt=new Map;function AHt(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(AHt,"formatHumanTimestamp");function yHt(t,e){return VJe||(VJe=Yzo(t,e)),VJe}a(yHt,"getSharedProcessRoot");async function Yzo(t,e){let r=AHt(new Date);y2=ET.join(t,`pid-${process.pid}_${r}`),await e.mkdir(y2,{recursive:!0});let n=new Date().toISOString();mHt=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:y2};return await e.writeFile(ET.join(y2,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await Jzo(y2,e).catch(()=>{}),await Zzo(y2,e).catch(()=>{}),y2}a(Yzo,"initProcessRoot");async function Kzo(t){if(y2)try{let e=ET.join(y2,"session.json"),r=new Date().toISOString(),n={createdAt:mHt??r,updatedAt:r,pid:process.pid,processRoot:y2};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(Kzo,"touchProcessRootSessionJson");function _Ht(t){return gHt.get(t)}a(_Ht,"getTurnDir");function eTn(){y2=void 0,VJe=void 0,mHt=void 0,pHt.clear(),X1n=0,hHt.clear(),gHt.clear()}a(eTn,"resetSharedProcessRoot");async function Jzo(t,e){await e.writeFile(ET.join(t,"README.md"),`# Copilot Language Server \u2014 Request Logs This directory contains persisted HTTP requests, LLM call logs, and tool-call trajectory data captured during a single CLS process. @@ -2522,7 +2522,7 @@ node generateHar.js http-log my-session.har \`\`\` Run from this directory, or pass absolute paths. -`,"utf8")}a(Yzo,"writeReadme");async function Kzo(t,e){await e.writeFile(ET.join(t,"generateHar.js"),`#!/usr/bin/env node +`,"utf8")}a(Jzo,"writeReadme");async function Zzo(t,e){await e.writeFile(ET.join(t,"generateHar.js"),`#!/usr/bin/env node "use strict"; /** * Converts per-request JSON files from an http-log directory into a single HAR @@ -2591,37 +2591,37 @@ async function main() { } main().catch(e => { console.error(e); process.exit(1); }); -`,"utf8")}a(Kzo,"writeGenerateHarScript");var WJe=class{constructor(e,r,n,o,s,c,l,u){this.ctx=e;this.source=n;this.conversationId=o;this.turnId=s;this.parentConversationId=c;this.parentTurnId=l;this.subagentName=u;this.sequenceNumber=0;this.appendQueues=new Map;this.fileOps=r??Vzo}static{a(this,"LLMRequestPersistence")}isEnabled(){return!!this.getBasePath()}async ensureInitialized(){if(this.isEnabled())try{await this.ensureSessionDir()}catch{}}getBasePath(){return kt(this.ctx,ze.PromptPersistBasePath)?.trim()||void 0}ensureSessionDir(){return this.sessionDirPromise||(this.sessionDirPromise=this.initSessionDir()),this.sessionDirPromise}async initSessionDir(){let e=this.getBasePath(),r=await AHt(e,this.fileOps);if(this.conversationId&&this.turnId){let n=this.conversationId.slice(0,8),o=this.turnId.slice(0,8),s=this.subagentName?this.subagentName.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,50):void 0,c=s?`_subagent-${s}`:"",l=(fHt.get(this.conversationId)??0)+1;fHt.set(this.conversationId,l);let u=String(l).padStart(6,"0"),d=this.parentTurnId?yHt(this.parentTurnId):void 0;if(this.subagentName&&d)this.sessionDir=ET.join(d,"runSubAgent",n,`${u}_${o}${c}`);else{let f=pHt.get(this.conversationId);f||(f=String(++Z1n).padStart(6,"0"),pHt.set(this.conversationId,f)),this.sessionDir=ET.join(r,"conversations",`${f}_${n}`,`${u}_${o}${c}`)}await this.fileOps.mkdir(this.sessionDir,{recursive:!0}),mHt.set(this.turnId,this.sessionDir),await this.writeTurnMetadata(),zzo(this.fileOps)}else this.sessionDir=r;return this.sessionDir}async writeTurnMetadata(){try{let e={createdAt:new Date().toISOString(),pid:process.pid,conversationId:this.conversationId,turnId:this.turnId,source:this.source,...this.parentConversationId?{parentConversationId:this.parentConversationId}:{},...this.parentTurnId?{parentTurnId:this.parentTurnId}:{},...this.subagentName?{subagentName:this.subagentName}:{}},r=ET.join(this.sessionDir,"turn.json");await this.fileOps.writeFile(r,JSON.stringify(e,null,2),"utf8")}catch{}}async persistLLMRequest(e){if(this.isEnabled())try{let r=await this.ensureSessionDir();this.sequenceNumber++;let n=e.conversationId??this.conversationId,o=e.turnId??this.turnId,s={requestId:e.requestId,sequenceNumber:this.sequenceNumber,timestamp:new Date().toISOString(),...n?{conversationId:n}:{},...o?{turnId:o}:{},messages:e.messages,tools:e.tools,model:e.model,response:e.response,durationMs:e.durationMs},c=ET.join(r,"fetchLog.jsonl"),l=JSON.stringify(s)+` +`,"utf8")}a(Zzo,"writeGenerateHarScript");var WJe=class{constructor(e,r,n,o,s,c,l,u){this.ctx=e;this.source=n;this.conversationId=o;this.turnId=s;this.parentConversationId=c;this.parentTurnId=l;this.subagentName=u;this.sequenceNumber=0;this.appendQueues=new Map;this.fileOps=r??zzo}static{a(this,"LLMRequestPersistence")}isEnabled(){return!!this.getBasePath()}async ensureInitialized(){if(this.isEnabled())try{await this.ensureSessionDir()}catch{}}getBasePath(){return kt(this.ctx,ze.PromptPersistBasePath)?.trim()||void 0}ensureSessionDir(){return this.sessionDirPromise||(this.sessionDirPromise=this.initSessionDir()),this.sessionDirPromise}async initSessionDir(){let e=this.getBasePath(),r=await yHt(e,this.fileOps);if(this.conversationId&&this.turnId){let n=this.conversationId.slice(0,8),o=this.turnId.slice(0,8),s=this.subagentName?this.subagentName.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,50):void 0,c=s?`_subagent-${s}`:"",l=(pHt.get(this.conversationId)??0)+1;pHt.set(this.conversationId,l);let u=String(l).padStart(6,"0"),d=this.parentTurnId?_Ht(this.parentTurnId):void 0;if(this.subagentName&&d)this.sessionDir=ET.join(d,"runSubAgent",n,`${u}_${o}${c}`);else{let f=hHt.get(this.conversationId);f||(f=String(++X1n).padStart(6,"0"),hHt.set(this.conversationId,f)),this.sessionDir=ET.join(r,"conversations",`${f}_${n}`,`${u}_${o}${c}`)}await this.fileOps.mkdir(this.sessionDir,{recursive:!0}),gHt.set(this.turnId,this.sessionDir),await this.writeTurnMetadata(),Kzo(this.fileOps)}else this.sessionDir=r;return this.sessionDir}async writeTurnMetadata(){try{let e={createdAt:new Date().toISOString(),pid:process.pid,conversationId:this.conversationId,turnId:this.turnId,source:this.source,...this.parentConversationId?{parentConversationId:this.parentConversationId}:{},...this.parentTurnId?{parentTurnId:this.parentTurnId}:{},...this.subagentName?{subagentName:this.subagentName}:{}},r=ET.join(this.sessionDir,"turn.json");await this.fileOps.writeFile(r,JSON.stringify(e,null,2),"utf8")}catch{}}async persistLLMRequest(e){if(this.isEnabled())try{let r=await this.ensureSessionDir();this.sequenceNumber++;let n=e.conversationId??this.conversationId,o=e.turnId??this.turnId,s={requestId:e.requestId,sequenceNumber:this.sequenceNumber,timestamp:new Date().toISOString(),...n?{conversationId:n}:{},...o?{turnId:o}:{},messages:e.messages,tools:e.tools,model:e.model,response:e.response,durationMs:e.durationMs},c=ET.join(r,"fetchLog.jsonl"),l=JSON.stringify(s)+` `;await this.serializedAppend(c,l)}catch(r){ot.debug(this.ctx,"Failed to persist LLM request",r)}}async appendTrajectoryStep(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=ET.join(r,"trajectory.jsonl"),o=JSON.stringify(e)+` `;await this.serializedAppend(n,o)}catch(r){ot.debug(this.ctx,"Failed to append trajectory step",r)}}async appendSubagentLink(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=ET.join(r,"trajectory.jsonl"),o=JSON.stringify(e)+` `;await this.serializedAppend(n,o)}catch(r){ot.debug(this.ctx,"Failed to append subagent link",r)}}async appendToolInOut(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=ET.join(r,"tool-in-out.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){ot.debug(this.ctx,"Failed to append tool-in-out entry",r)}}serializedAppend(e,r){let o=(this.appendQueues.get(e)??Promise.resolve()).then(()=>this.fileOps.appendFile(e,r,"utf8"));return this.appendQueues.set(e,o.catch(()=>{})),o}};p();var KJe=require("fs"),n5=fe(require("path"));var eTn=require("stream");var Jzo={mkdir:a((t,e)=>KJe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>KJe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>KJe.promises.appendFile(t,e,r),"appendFile")},YJe,JJe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??Jzo,this.basePath=this.getBasePath(),this.isEnabled=!!this.basePath}static{a(this,"DebugRequestLogger")}static{this.sequence=0}static{this.requestSeqMap=new Map}static{this.requestInteractionMap=new Map}static{this.appendChainMap=new Map}static resetForTesting(){YJe=void 0,X1n(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return kt(this.ctx,ze.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return YJe||(YJe=this.initHttpLogDir()),YJe}toPersistenceFileOps(){return{mkdir:a((e,r)=>this.fileOps.mkdir(e,r),"mkdir"),writeFile:a((e,r,n)=>this.fileOps.writeFile(e,r,n),"writeFile"),appendFile:a((e,r,n)=>this.fileOps.appendFile(e,r,n),"appendFile")}}async initHttpLogDir(){let e=await AHt(this.basePath,this.toPersistenceFileOps()),r=n5.join(e,"http-log");return await this.fileOps.mkdir(r,{recursive:!0}),r}seqForRequest(e){let r=t.requestSeqMap.get(e);if(r!==void 0)return r;let n=++t.sequence;return t.requestSeqMap.set(e,n),n}logRequest(e){this.isEnabled&&this.writeRequestFile(e).catch(r=>{ot.debug(this.ctx,"Failed to persist enhanced request log",r)})}logResponse(e){this.isEnabled&&this.writeResponseFile(e).catch(r=>{ot.debug(this.ctx,"Failed to persist enhanced response log",r)})}static{this.SENSITIVE_HEADERS=new Set(["authorization","cookie","set-cookie","request-hmac","proxy-authorization"].map(e=>e.toLowerCase()))}static redactHeaders(e){let r={};for(let[n,o]of Object.entries(e))r[n]=t.SENSITIVE_HEADERS.has(n.toLowerCase())?"[REDACTED]":o;return r}async resolveTurnHttpLogDir(e){if(!e)return;let r=yHt(e);if(!r)return;let n=n5.join(r,"http-log");return await this.fileOps.mkdir(n,{recursive:!0}),n}static extractInteractionId(e){return Object.entries(e).find(([r])=>r.toLowerCase()==="x-interaction-id")?.[1]}async writeMessagesDump(e,r,n,o){if(!o||o.length===0)return;let s=`${r}_request_messages_dump_${n}.json`;await this.fileOps.writeFile(n5.join(e,s),JSON.stringify(o,null,2),"utf8")}appendResponseChunk(e,r){if(!this.isEnabled)return;let o=(t.appendChainMap.get(e)??Promise.resolve()).then(()=>this.doAppendChunk(e,r)).catch(s=>{ot.debug(this.ctx,"Failed to append SSE chunk",s)});t.appendChainMap.set(e,o)}async doAppendChunk(e,r){let n=await this.ensureDir(),o=this.seqForRequest(e),s=String(o).padStart(6,"0"),c=e.replace(/[^a-zA-Z0-9_-]/g,"_"),l=`${s}_response_sse_chunks_${c}.txt`;await this.fileOps.appendFile(n5.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(n5.join(d,l),r,"utf8")}async writeRequestFile(e){let r=await this.ensureDir(),n=this.seqForRequest(e.requestId),o=String(n).padStart(6,"0"),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${o}_request_${s}.json`,{messages:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},f=JSON.stringify(d,null,2);await this.fileOps.writeFile(n5.join(r,c),f,"utf8"),await this.writeMessagesDump(r,o,s,l);let h=t.extractInteractionId(e.headers);h&&t.requestInteractionMap.set(e.requestId,h);let m=await this.resolveTurnHttpLogDir(h);m&&(await this.fileOps.writeFile(n5.join(m,c),f,"utf8"),await this.writeMessagesDump(m,o,s,l))}async writeResponseFile(e){let r=t.appendChainMap.get(e.requestId);r&&(await r,t.appendChainMap.delete(e.requestId));let n=await this.ensureDir(),o=this.seqForRequest(e.requestId),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${String(o).padStart(6,"0")}_response_headers_${s}.json`,{body:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},f=JSON.stringify(d,null,2);await this.fileOps.writeFile(n5.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(n5.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},ZJe=class extends kx{static{a(this,"DebugLoggingResponseWrapper")}constructor(e,r,n,o){super(e.status,e.statusText,e.headers,()=>e.text(),()=>e.body()),this.logger=r,this.requestId=n,this.startTime=o}async text(){let e=await super.text();return this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),e}body(){let e=super.body();return e?this.createLoggingStream(e):null}createLoggingStream(e){let r=new eTn.PassThrough;return e.on("data",n=>{this.logger.appendResponseChunk(this.requestId,n.toString()),r.write(n)}),e.on("end",()=>{this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),r.end()}),e.on("error",n=>{r.emit("error",n)}),r}headersToObject(){let e={};for(let[r,n]of this.headers)e[r]=n;return e}};p();p();var MJ=class t extends av{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new pe("AutoModelService"),this._register(ws(this._ctx,()=>{this._autoModelCache.clear(),this._reserveToken=void 0,this._ongoingFetches.clear(),this._logger.info(this._ctx,"Auto model cache cleared due to token update")}))}static{a(this,"AutoModelService")}static{this.EXPIRY_THRESHOLD_MS=300*1e3}async resolveModelConfiguration(r,n){let o=this._autoModelCache.get(r);o||(o={},this._autoModelCache.set(r,o)),this._pruneExpiredTokens(o),!o.active&&o.standby&&(o.active=o.standby,o.standby=void 0),o.active||(o.active=await this._acquireActiveToken(r)),(!o.standby||!this._isTokenValid(o.standby)||this._isExpiringSoon(o.standby)||this._isExpiringSoon(o.active))&&this._refreshStandbyInBackground(r),this._ensureReserveRefill();let s=await this._ctx.get(Ns).getMetadata(),c=await this._ctx.get(dl).getBestChatModelConfig([o.active.model]);c.copilotSessionToken=o.active.sessionToken,c.autoModeDiscountedCost=o.active.discountedCost;let l=s.find(u=>u.capabilities.family===o.active.model);return c.originalBillingMultiplier=l?.billing?.multiplier??0,c}_ensureReserveRefill(){if(this._isTokenValid(this._reserveToken))return;let r="reserve";if(this._ongoingFetches.has(r))return;let n=this._fetchToken("reserve");this._ongoingFetches.set(r,n),n.then(o=>{this._reserveToken=o}).catch(o=>{this._logger.error(this._ctx,`Failed to refresh reserve auto mode token: ${o instanceof Error?o.message:String(o)}`)}).finally(()=>{this._ongoingFetches.delete(r)})}async _acquireActiveToken(r){if(this._isTokenValid(this._reserveToken)){let c=this._reserveToken;return this._reserveToken=void 0,c}let n=`active:${r}`,o=this._ongoingFetches.get(n);if(o)return o;let s=this._fetchToken("active").finally(()=>{this._ongoingFetches.delete(n)});return this._ongoingFetches.set(n,s),s}_refreshStandbyInBackground(r){let n=`standby:${r}`;if(this._ongoingFetches.has(n))return;let o=this._fetchToken("standby");this._ongoingFetches.set(n,o),o.then(s=>{let c=this._autoModelCache.get(r);c&&(c.active&&c.active.sessionToken===s.sessionToken||(c.standby=s,this._ongoingFetches.delete(n)))}).catch(s=>{this._logger.error(this._ctx,`Failed to refresh standby auto mode token for ${r}: ${s instanceof Error?s.message:String(s)}`),this._ongoingFetches.delete(n)})}async _fetchToken(r){let n=Date.now();try{let o=await gWe(this._ctx,"/models/session",JSON.stringify({auto_mode:{model_hints:["auto"]}}));if(!o.ok)throw new Error(`Auto mode API returned status ${o.status}`);let s=await o.json(),c=s.selected_model,l=s.session_token,u=s.expires_at*1e3,d=s.discounted_costs?.[c];return this._logger.info(this._ctx,`Fetched auto model for ${r} in ${Date.now()-n}ms: ${c}`),{model:c,sessionToken:l,expiration:u,discountedCost:d}}catch(o){throw this._logger.error(this._ctx,`Failed to fetch auto mode model for ${r}: ${o instanceof Error?o.message:String(o)}`),o}}_pruneExpiredTokens(r){r.active&&!this._isTokenValid(r.active)&&(r.active=void 0),r.standby&&!this._isTokenValid(r.standby)&&(r.standby=void 0)}_isTokenValid(r){return!!r&&r.expiration>Date.now()}_isExpiringSoon(r){return r?r.expiration-Date.now()<=t.EXPIRY_THRESHOLD_MS:!1}};var XJe="Auto",lv="auto";var Ro=class t{static{a(this,"ModelPickerUtils")}static async formatModelDisplayName(e,r,n){if(!r)return;let o=n?.trim();if(o){try{let u=(await new as(e.get(Un)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(Ns).getMetadata()).find(u=>u.id===r);if(l)return`${l.name}`}catch{}return`${r}`}static async getModelConfiguration(e,r,n){let o=await e.get(Qt).getToken(),s=!!o.userInfo?.isTBBEnabled,c=!!o.userInfo?.isFreeUser,l=e.get(Ru);if(!s&&l.quotaExhausted&&!c){let u=await e.get(Ns).getFallbackModel();if(u?.id)return e.get(dl).getBestChatModelConfig([u.id])}if(r)return e.get(dl).getBestChatModelConfig(Z1(r,s),n);throw new Error("Model is not specified")}static async getModelConfigurationById(e,r,n,o){if(!r)throw new Error("Model is not specified");if(r===lv)return await e.get(MJ).resolveModelConfiguration(n??"unknown",o);let s=await e.get(dl).getModelConfigurationById(r);if(!s)throw new Error(`No model configuration found for id '${r}'`);return s}static setUserSelectedReasoningEffort(e,r,n){if(!n)return r;let o=r.reasoningEfforts;return o&&o.length>0&&!o.includes(n)?(ot.warn(e,`User-selected reasoning effort '${n}' for model '${r.modelId}' is not in supported list [${o.join(", ")}].`),r):(r.userSelectedReasoningEffort=n,r)}static overrideMaxRequestTokens(e,r){return typeof r!="number"||!Number.isFinite(r)||r<=0||(e.maxRequestTokens=e.maxLongContextTokens===void 0?Math.min(e.maxRequestTokens,r):Math.min(e.maxLongContextTokens,r)),e}static applyModelConfigurationOverrides(e,r,n){return t.setUserSelectedReasoningEffort(e,r,n?.reasoningEffort),t.overrideMaxRequestTokens(r,n?.contextSize),r}static async resolveModelIdFromFamily(e,r){return r===lv?lv:(await e.get(Ns).getMetadata()).find(o=>o.capabilities.family===r&&o.capabilities.type==="chat"&&o.model_picker_enabled===!0)?.id}static transformMessages(e,r){return r===kn.O1Ga||r===kn.O1Mini?e.map(n=>n.role!=="user"?{role:"user",content:n.content}:n):e}static parseModelNotSupportedReason(e){if(!e)return{};let r=e.indexOf(":");if(r===-1||r===e.length-1)return{};let n=e.slice(r+1).trim();if(!n)return{};let{modelName:o,provider:s}=_Ht(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var dh=new pe("fetchChat"),Zzo=new Set([500,502,504]),Xzo=[1e3,1e4,1e4],eZe=class{static{a(this,"OpenAIChatMLFetcher")}async fetchAndStreamChat(e,r,n,o,s){let c=String(n.properties.headerRequestId??r.ourRequestId);if(s?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"};let l;try{let f=await this.fetchWithParameters(e,r.endpoint,r,n,s);if(f==="not-sent")return{type:"canceled",reason:"before fetch request"};l=f}catch(f){if(ng(f)||!wx(f))throw f;dh.info(e,`Network error during fetch, checking connectivity before retry [${c}]: ${String(f)}`);let h=await this.retryAfterError(e,r,n,s,c);if(h&&"canceled"in h)return h.canceled;if(h&&"response"in h)l=h.response;else throw f}if(s?.isCancellationRequested)return this.destroyResponseBody(e,l),{type:"canceled",reason:"after fetch request"};if(rYo(l.status)){dh.info(e,`Server returned ${l.status}, checking network connectivity before retry [${c}]`);let f=await this.retryAfterError(e,r,n,s,c);if(f&&"canceled"in f)return this.destroyResponseBody(e,l),f.canceled;f&&"response"in f&&(this.destroyResponseBody(e,l),l=f.response)}if(l.status!==200){let f=this.createTelemetryData(r.endpoint,e,r),h=await Ro.formatModelDisplayName(e,r.model,r.modelProviderName),m=await this.handleError(e,f,l,h,r.uiKind);return m.type==="failed"?{...m,ghRequestId:l.headers.get("x-github-request-id")||void 0}:m}e.get(Ru).processQuotaHeaders(l.headers),e.get(KO).processRateLimitHeaders(l.headers);let u=p2.getStrategy(r.endpoint),d={messages:r.messages,tools:r.tools,tool_choice:r.tool_choice,temperature:r.postOptions?.temperature,topP:r.postOptions?.top_p,modelConfiguration:{modelId:r.model,maxResponseTokens:r.postOptions?.max_tokens,stream:!!r.postOptions?.stream},repoInfo:r.repoInfo,count:r.count,postOptions:r.postOptions,intentParams:{intent:r.intent,intent_threshold:r.intent_threshold,intent_model:r.intent_model,intent_tokenizer:r.intent_tokenizer,intent_content:r.intent_content},copilot_thread_id:r.copilot_thread_id,prediction:r.prediction,cancel:s,enableThinking:r.enableThinking};return u.processResponse(e,l,o,n,d)}destroyResponseBody(e,r){try{let n=r.body();n&&"destroy"in n&&typeof n.destroy=="function"?n.destroy():n instanceof ReadableStream&&n.cancel()}catch(n){dh.exception(e,n,"Error destroying response stream")}}async retryAfterError(e,r,n,o,s){if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled before connectivity check"}};let c=await nYo(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){dh.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}dh.info(e,`Connectivity check passed, retrying request [${s}]`);let l=await this.fetchWithParameters(e,r.endpoint,r,n,o);return l==="not-sent"?{canceled:{type:"canceled",reason:"before retry fetch request"}}:o?.isCancellationRequested?(this.destroyResponseBody(e,l),{canceled:{type:"canceled",reason:"after retry fetch request"}}):{response:l}}createTelemetryData(e,r,n){return Vt.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=p2.getStrategy(r),l={messages:n.messages,tools:n.tools,tool_choice:n.tool_choice,temperature:n.postOptions?.temperature,topP:n.postOptions?.top_p,modelConfiguration:{modelId:n.model,providerName:n.modelProviderName,maxResponseTokens:n.postOptions?.max_tokens,stream:n.postOptions?.stream!==!1,supportsThinking:n.supportsThinking,reasoningEfforts:n.reasoningEfforts,userSelectedReasoningEffort:n.userSelectedReasoningEffort},repoInfo:n.repoInfo,count:n.count,postOptions:n.postOptions,intentParams:{intent:n.intent,intent_threshold:n.intent_threshold,intent_model:n.intent_model,intent_tokenizer:n.intent_tokenizer,intent_content:n.intent_content},copilot_thread_id:n.copilot_thread_id,prediction:n.prediction,cancel:s,enableThinking:n.enableThinking},u=c.buildRequestBody(e,l);if(c.adaptRequest(u,l.modelConfiguration),s?.isCancellationRequested)return"not-sent";let d=c.getAuthHeaders(n.apiKey);return await eYo(e,n.messages,n.copilotApiBaseUrl,n.engineName,r,n.ourRequestId,u,n.authToken,n.uiKind,o,n.llmInteraction,n.modelProviderName,n.copilotEditsSessionHeader,n.copilotSessionToken,s,n.supportsAdaptiveThinking,d)}async handleError(e,r,n,o,s){if(n.clientError&&!n.headers.get("x-github-request-id")){let f=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;dh.error(e,f),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else r.properties.error=`Response status was ${n.status}`;if(r.properties.status=String(n.status),ft(e,"request.shownWarning",r),n.status===401)try{let f=await n.text(),h=JSON.parse(f);if(h.authorize_url)return{type:"authRequired",reason:"not authorized",authUrl:h.authorize_url}}catch{}if(n.status===401||n.status===403)return e.get(Qt).resetToken("chat_messages",n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`,code:n.status};if(n.status===499)return dh.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server",code:n.status};let c=await n.text();if(n.status===429){let f=UM(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return sr(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:f??-1}),{type:"failed",reason:"rate limit exceeded",code:n.status,retryAfter:f,capiErrorCode:h}}if(n.status===466)return dh.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400){let f=cv.translate400Reason(c,o);if(f!==void 0)return{type:"failed",reason:f,code:n.status}}if(n.status===424)return{type:"failedDependency",reason:c};let u=n.headers.get("retry-after"),d=await e.get(Qt).getToken();return n.status===402?{type:"failed",reason:cv.translate402Reason(c,{retryAfterHeader:u??void 0,retryAfterSeconds:UM(n),copilotPlan:d.userInfo?.copilotPlan,isTBBEnabled:d.userInfo?.isTBBEnabled,canUpgradePlan:d.userInfo?.canUpgradePlan,overageEnabled:e.get(Ru).overageEnabled}),code:n.status}:n.status===503?{type:"failed",reason:c,code:n.status}:(dh.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function eYo(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_){let E=n===""&&o===""?r:Oa(r,n,o),v=d.extendedBy({endpoint:o,engineName:n,uiKind:u});oJe(c,v,["messages"]),v.properties.headerRequestId=s,ft(t,"request.sent",v);let S=Rl(),T=uSn(u),w={...om(t),...f.toCapiHeaders()};n3()&&(w=await mWe(t,w)),c.messages?.some(x=>Array.isArray(x.content)?x.content.some(k=>"image_url"in k):!1)&&(w["Copilot-Vision-Request"]="true"),_&&Object.assign(w,_),m&&(w[Qq]=m),g&&(w["copilot-session-token"]=g),o==="v1/messages"&&!y&&(w["anthropic-beta"]=KKe),c.messages&&c.messages.forEach(x=>{tYo(x)&&x.tool_calls&&(x.tool_calls=x.tool_calls.map(k=>ASn(k)))});let R=hue(()=>zJe(t)?new JJe(t):void 0,void 0);return Uz(t,E,l,T,s,c,A,w,void 0,h,R,e).then(x=>{let k=hF(x);v.extendWithRequestId(k);let D=Rl()-S;return v.measurements.totalTimeMs=D,dh.info(t,`Request ${s} at <${E}> finished with ${x.status} status after ${D}ms`),dh.debug(t,"request.response properties",v.properties),dh.debug(t,"request.response measurements",v.measurements),dh.debug(t,"messages:",JSON.stringify(e)),ft(t,"request.response",v),R?new ZJe(x,R,s,S):x}).catch(x=>{if(ng(x))throw x;let k=v.extendedBy({error:"Network exception"});ft(t,"request.shownWarning",k),v.properties.message=String(um(x,"name")??""),v.properties.code=String(um(x,"code")??""),v.properties.errno=String(um(x,"errno")??""),v.properties.type=String(um(x,"type")??"");let D=Rl()-S;throw v.measurements.totalTimeMs=D,dh.info(t,`Request ${s} at <${E}> rejected with ${String(x)} after ${D}ms`),dh.debug(t,"request.error properties",v.properties),dh.debug(t,"request.error measurements",v.measurements),ft(t,"request.error",v),x}).finally(()=>{Wue(t,e,v)})}a(eYo,"fetchWithInstrumentation");function tYo(t){return"tool_calls"in t}a(tYo,"isChatMessageWithToolCalls");function rYo(t){return Zzo.has(t)}a(rYo,"shouldRetryStatusCode");async function nYo(t,e,r,n,o=Xzo){let s=t.get(Jt),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(dh.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([JC(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await JC(d);if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};try{let f=await s.fetch(c,{method:"GET",headers:{Authorization:`Bearer ${r}`}});if(f.status>=200&&f.status<300)return dh.info(t,"CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};l=`Status ${f.status}: ${f.statusText??""}`,u=f.headers.get("x-github-request-id")??void 0,dh.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,dh.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return dh.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(nYo,"checkNetworkConnectivity");p();var iYo=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function tZe(t){let e=t.slice();return e.reverse(),tTn(e)||tTn(e.filter(r=>r.trim().length>0))}a(tZe,"isRepetitive");function tTn(t){let e=oYo(t);for(let r of iYo){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(oYo,"kmp_prefix_function");Fo();var mc=class{constructor(e){this.ctx=e;this.fetcher=new eZe}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=Dt(),d={n:e.num_suggestions??1,temperature:e.temperature??0,stop:e.stop,top_p:e.topP??1,copilot_thread_id:e.copilot_thread_id,prediction:e.prediction},f=e.modelConfiguration;f&&(e.prediction?.content||delete d.prediction,e.prediction||e.modelConfiguration?.providerName===void 0&&f.maxResponseTokens!==void 0&&(d.max_tokens=f.maxResponseTokens),d.stream=!!f.stream),e.logitBias&&(d.logit_bias=e.logitBias);let h=e.chatModeKind==="Ask",m=await this.ctx.get(Qt).getToken(),g=!h&&kt(this.ctx,ze.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&Zbn(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=YO(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=kt(this.ctx,ze.AnthropicThinkingBudgetToken);if(D&&D>0){let N=D<1024?1024:D;d.thinking_budget=Math.min(32e3,e.modelConfiguration.maxResponseTokens-1,N)}}let A,y,_,E;if(e.modelConfiguration?.providerName){if(!Bq(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(_=await QKe(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),E=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===Ii.Azure)if(e.modelConfiguration.deploymentUrl)A=Pbn(e.modelConfiguration.modelId,e.modelConfiguration.deploymentUrl),y="",e.engineName="";else throw new Error(`No deployment URL found for Azure model: ${e.modelConfiguration.modelId}`);else if(Lue(e.modelConfiguration?.providerName))A=jue[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=_;else if(ob(e.modelConfiguration.providerName))A=UKe(e.modelConfiguration.deploymentUrl),y="completions",e.authToken="";else{if(!e.modelConfiguration.deploymentUrl)throw new Error(`No endpoint URL found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);if(!_)throw new Error(`No API key found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);let D=e.modelConfiguration.apiType??Pwe;A=Nwe(e.modelConfiguration.deploymentUrl,D),y=kbn(D),e.authToken=_}}else{if(A=Px(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?XKe(this.ctx,f):!1;y=ZKe(f,D)}ot.debug(this.ctx,`Endpoint routing: model=${f?.modelId}, supportedEndpoints=${JSON.stringify(f?.supportedEndpoints)}, selected=${y}`)}let v=f?.copilotSessionToken,S=e.authToken??m.token,T=p2.getStrategy(y),w=e.engineName??T.engineName,R={messages:e.messages,repoInfo:void 0,ourRequestId:u,copilotApiBaseUrl:A,engineName:w,endpoint:y,count:e.num_suggestions??1,uiKind:e.uiKind,postOptions:d,authToken:S,apiKey:_,modelProviderName:E,...e.intentParams,llmInteraction:e.llmInteraction,prediction:e.prediction,copilotEditsSessionHeader:e.copilotEditsSessionHeader,copilotSessionToken:v,supportsThinking:f?.supportsThinking,supportsAdaptiveThinking:f?.supportsAdaptiveThinking,reasoningEfforts:f?.reasoningEfforts,userSelectedReasoningEffort:f?.userSelectedReasoningEffort,enableThinking:g};f&&(R.model=f.modelId),e.tools&&e.tools?.length>0&&(f===void 0||f.toolCalls)&&(R.tools=e.tools,R.tool_choice=e.tool_choice??"auto");let x=await this.fetch(R,o,r,n);if(c){let D=c.maxRetryAttempts??3;for(let N=1;N<=D&&!(!c.shouldRetry(x)||x.type==="failed"&&x.noRetry);N++){let O=x;if(await c.onRetry?.(O,N),O.type==="failed"&&O.retryAfter!==void 0&&O.retryAfter>0){let B=O.retryAfter;if(await new Promise(q=>{let M=setTimeout(()=>{L.dispose(),q()},B*1e3),L=r.onCancellationRequested(()=>{clearTimeout(M),L.dispose(),q()})}),r.isCancellationRequested)break}x=await this.fetch(R,o,r,n),sr(this.ctx,"request.throttled.retry",{requestSource:e.uiKind??"unknown",resultType:x.type,modelId:f?f.providerName?"custom-byok":f.modelId:"unknown"},{retryAfter:O.type==="failed"?O.retryAfter??-1:-1,resultCode:x.type==="failed"?x.code??-1:-1})}}let k=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,x,n,k,y),this.trackTurnCredits(e,x),pue(()=>{if(s)return s.persistLLMRequest({requestId:R.ourRequestId,messages:R.messages,tools:R.tools,model:R.model,response:x,durationMs:k})},D=>ot.debug(this.ctx,"persistLLMRequest failed",D)),x}async fetch(e,r,n,o){try{let s=await this.fetcher.fetchAndStreamChat(this.ctx,e,o.extendedBy({uiKind:e.uiKind}),r||(()=>{}),n);switch(s.type){case"success":return await this.processSuccessfulResponse(e,s,e.ourRequestId,o);case"canceled":return this.processCanceledResponse(s,e.ourRequestId);case"failed":case"failedDependency":return this.processFailedResponse(s,e.ourRequestId);case"authRequired":return{type:"agentAuthRequired",reason:"Agent authentication required.",authUrl:s.authUrl,requestId:e.ourRequestId}}}catch(s){return this.processError(s,e.ourRequestId)}}async processSuccessfulResponse(e,r,n,o){let s=[],c=Bwe(r.chatCompletions,u=>this.postProcess(u,o));ot.debug(this.ctx,`Process success response for request ${e.ourRequestId} with chatParams: ${JSON.stringify(e,null,2)}`);let l=0;for await(let u of c)ot.debug(this.ctx,`Received choice #${l} for request ${e.ourRequestId}: ${JSON.stringify(u,null,2)}`),s.push(u),l++;if(s.length==1){let u=s[0];switch(u.finishReason){case"stop":return{type:"success",value:Mn(u.message?.content)??"",toolCalls:u.tool_calls,requestId:n,numTokens:u.numTokens,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"tool_calls":return{type:"tool_calls",toolCalls:u.tool_calls,requestId:n,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"content_filter":return{type:"filtered",reason:"Response got filtered.",requestId:n,usage:u.usage,copilot_usage:u.copilot_usage};case"length":return{type:"length",reason:"Response too long.",requestId:n,truncatedValue:Mn(u.message?.content)??"",thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"DONE":return{type:"no_finish_reason",reason:"No finish reason received.",requestId:n};default:return{type:"unknown",reason:"Unknown finish reason received.",requestId:n}}}else if(s.length>1){let u=s.filter(d=>d.finishReason=="stop"||d.finishReason=="tool_calls");if(u.length>0)return{type:"successMultiple",value:u.map(d=>Mn(d.message.content)),toolCalls:u.map(d=>d.tool_calls).filter(d=>d),requestId:n,copilotEditsSessionHeader:u[0].copilotEditsSessionHeader,usage:u[0].usage,copilot_usage:u[0].copilot_usage}}return{type:"no_choices",reason:"Response contained no choices.",requestId:n}}postProcess(e,r){return tZe(e.tokens)?(r.extendWithRequestId(e.requestId),ft(this.ctx,"conversation.repetition.detected",r,0),e.finishReason!==""?e:void 0):e.message?e:void 0}processCanceledResponse(e,r){return ot.debug(this.ctx,"Cancelled after awaiting fetchConversation"),{type:"canceled",reason:e.reason,requestId:r}}processFailedResponse(e,r){return e?.reason.includes("filtered as off_topic by intent classifier")?{type:"offTopic",reason:e.reason,requestId:r}:e?.reason.includes("model is not supported")?{type:"model_not_supported",reason:e.reason,requestId:r}:e?.reason.includes("model max prompt tokens exceeded")?{type:"model_max_prompt_tokens_exceeded",reason:e.reason,requestId:r}:{type:"failed",reason:e.reason,requestId:r,code:e.type==="failed"?e.code:void 0,retryAfter:e.type==="failed"?e.retryAfter:void 0,ghRequestId:e.type==="failed"?e.ghRequestId:void 0,capiErrorCode:e.type==="failed"?e.capiErrorCode:void 0}}processError(e,r){if(ng(e))return{type:"canceled",reason:"network request aborted",requestId:r};{ot.exception(this.ctx,e,"Error on conversation request");let n="Error on conversation request. Read more from logs.";if(e instanceof Error){let o=e.message;if(o&&o.trim().length>0){let s=360;o.length<=s?n=`Error on conversation request: ${o}`:n=`Error on conversation request: ${o.substring(0,s)}... Read more from logs.`}}return{type:"failed",reason:n,requestId:r,noRetry:e instanceof NJ?!0:void 0}}}trackTurnCredits(e,r){if(!e.turnId)return;let n="copilot_usage"in r?r.copilot_usage:void 0;!n||n.total_nano_aiu<=0||this.ctx.get(Ru).setLastCopilotUsage(n.total_nano_aiu,e.turnId)}sendFetchResponseTelemetry(e,r,n,o,s){let c={responseType:r.type},l={duration:o};e.modelConfiguration&&!e.modelConfiguration?.providerName&&(c.modelId=e.modelConfiguration.modelId,c.modelFamily=e.modelConfiguration.modelFamily,c.maxRequestTokens=String(e.modelConfiguration.maxRequestTokens),c.userSelectedReasoningEffort=e.modelConfiguration.userSelectedReasoningEffort??""),"reason"in r&&r.reason&&(c.reason=r.reason.substring(0,360)),"code"in r&&r.code!==void 0&&(c.statusCode=String(r.code)),r.type==="failed"&&r.noRetry&&(c.isMidStreamError="true"),c.uiKind=e.uiKind,s&&(c.route=s),r.usage&&(l.completionTokens=r.usage.completion_tokens,l.promptTokens=r.usage.prompt_tokens,l.totalTokens=r.usage.total_tokens,r.usage.prompt_tokens_details?.cached_tokens!==void 0&&(l.cachedTokens=r.usage.prompt_tokens_details.cached_tokens)),r.copilot_usage&&(l.copilotUsageTotalNanoAiu=r.copilot_usage.total_nano_aiu,r.copilot_usage.token_details?.length&&(c.copilotUsageTokenDetails=JSON.stringify(r.copilot_usage.token_details))),n.properties.conversationId&&(c.conversationId=n.properties.conversationId),n.properties.messageId&&(c.messageId=n.properties.messageId),n.properties.messageSource&&(c.messageSource=n.properties.messageSource),sr(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var dm=class{static{a(this,"ConversationInspector")}};p();p();var fm=class{constructor(){this.skills=[]}static{a(this,"ConversationSkillRegistry")}registerSkill(e){if(this.getSkill(e.id))throw new Error(`Skill with id '${e.id}' already registered`);this.skills.push(e)}getSkill(e){return this.skills.find(r=>r.id===e)}getDescriptors(){return[...this.skills]}},EHt=class{constructor(e,r,n){this.delegate=e;this.stepId=r;this.stepTitle=n}static{a(this,"StepReportingSkillResolver")}async resolveSkill(e){await e.steps.start(this.stepId,this.stepTitle);try{let r=await this.delegate.resolveSkill(e);return r||await e.steps.finish(this.stepId),r}catch(r){throw await e.steps.error(this.stepId,r instanceof Error?r.message:`Error resolving ${this.stepTitle}`),r}}},vHt=class{constructor(e,r){this.delegate=e;this.stepId=r}static{a(this,"StepReportingSkillProcessor")}value(){return this.delegate.value()}async processSkill(e,r){try{let n=await this.delegate.processSkill(e,r);return await r.steps.finish(this.stepId),n}catch(n){throw await r.steps.error(this.stepId,n instanceof Error?n.message:`Error processing ${this.stepId}`),n}}},T0=class{constructor(e,r,n,o,s,c="explicit",l=[],u=()=>!0){this.id=e;this._description=r;this.stepTitle=n;this._resolver=o;this._processor=s;this.type=c;this._examples=l;this._isAvailable=u}static{a(this,"SingleStepReportingSkill")}description(){return this._description}examples(){return this._examples}isAvailable(e){return this._isAvailable(e)}resolver(e){return new EHt(this._resolver(e),this.id,this.stepTitle)}processor(e){return new vHt(this._processor(e),this.id)}};p();p();var Ic=class extends Error{constructor(r){super(`No instance of ${r.name} has been registered`);this.ctor=r;this.name=`UnregisteredContextErrorFor${r.name}`}static{a(this,"UnregisteredContextError")}},tde=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new Ic(e)}tryGet(e){let r=this.instances.get(e);if(r)return r}set(e,r){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.assertIsInstance(e,r),this.instances.set(e,r)}forceSet(e,r){this.assertIsInstance(e,r),this.instances.set(e,r)}assertIsInstance(e,r){if(!(r instanceof e)){let n=JSON.stringify(r);throw new Error(`The instance you're trying to register for ${e.name} is not an instance of it (${n}).`)}}};p();var rTn=new pe("EncodingConfigurationService"),i5=class{constructor(e){this.ctx=e;this.fileEncodingCache=new Map}static{a(this,"EncodingConfigurationService")}async getEncodingForFile(e){if(this.fileEncodingCache.has(e))return this.fileEncodingCache.get(e);let r=await this.requestEncodingFromClient(e)??"utf8";return this.fileEncodingCache.set(e,r),r}handleConfigurationChange(e){if(e.copilot?.encodingChanges){if(e.copilot.encodingChanges.length>0)for(let r of e.copilot.encodingChanges)this.fileEncodingCache.delete(r),rTn.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),rTn.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var nTn=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}};p();var sYo=globalThis.performance&&typeof globalThis.performance.now=="function",rZe=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=sYo&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};var iTn=!1,aYo=!1,nRe;(M=>{M.None=a(()=>av.None,"None");function e(L){if(aYo){let{onDidAddListener:U}=L,j=rRe.create(),Q=0;L.onDidAddListener=()=>{++Q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),j.print()),U?.()}}}a(e,"_addLeakageTraceLogic");function r(L,U){return g(L,()=>{},0,void 0,!0,void 0,U)}M.defer=r,a(r,"defer");function n(L){return(U,j=null,Q)=>{let Y=!1,W;return W=L(V=>{if(!Y)return W?W.dispose():Y=!0,U.call(j,V)},null,Q),Y&&W.dispose(),W}}M.once=n,a(n,"once");function o(L,U){return M.once(M.filter(L,U))}M.onceIf=o,a(o,"onceIf");function s(L,U,j){return h((Q,Y=null,W)=>L(V=>Q.call(Y,U(V)),null,W),j)}M.map=s,a(s,"map");function c(L,U,j){return h((Q,Y=null,W)=>L(V=>{U(V),Q.call(Y,V)},null,W),j)}M.forEach=c,a(c,"forEach");function l(L,U,j){return h((Q,Y=null,W)=>L(V=>U(V)&&Q.call(Y,V),null,W),j)}M.filter=l,a(l,"filter");function u(L){return L}M.signal=u,a(u,"signal");function d(...L){return(U,j=null,Q)=>{let Y=$bn(...L.map(W=>W(V=>U.call(j,V))));return m(Y,Q)}}M.any=d,a(d,"any");function f(L,U,j,Q){let Y=j;return s(L,W=>(Y=U(Y,W),Y),Q)}M.reduce=f,a(f,"reduce");function h(L,U){let j,Q={onWillAddFirstListener(){j=L(Y.fire,Y)},onDidRemoveLastListener(){j?.dispose()}};U||e(Q);let Y=new vT(Q);return U?.add(Y),Y.event}a(h,"snapshot");function m(L,U){return U instanceof Array?U.push(L):U&&U.add(L),L}a(m,"addAndReturnDisposable");function g(L,U,j=100,Q=!1,Y=!1,W,V){let z,ie,H,re=0,le,Le={leakWarningThreshold:W,onWillAddFirstListener(){z=L(Oe=>{re++,ie=U(ie,Oe),Q&&!H&&(me.fire(ie),ie=void 0),le=a(()=>{let Te=ie;ie=void 0,H=void 0,(!Q||re>1)&&me.fire(Te),re=0},"doFire"),typeof j=="number"?(clearTimeout(H),H=setTimeout(le,j)):H===void 0&&(H=0,queueMicrotask(le))})},onWillRemoveListener(){Y&&re>0&&le?.()},onDidRemoveLastListener(){le=void 0,z.dispose()}};V||e(Le);let me=new vT(Le);return V?.add(me),me.event}M.debounce=g,a(g,"debounce");function A(L,U=0,j){return M.debounce(L,(Q,Y)=>Q?(Q.push(Y),Q):[Y],U,void 0,!0,void 0,j)}M.accumulate=A,a(A,"accumulate");function y(L,U=(Q,Y)=>Q===Y,j){let Q=!0,Y;return l(L,W=>{let V=Q||!U(W,Y);return Q=!1,Y=W,V},j)}M.latch=y,a(y,"latch");function _(L,U,j){return[M.filter(L,U,j),M.filter(L,Q=>!U(Q),j)]}M.split=_,a(_,"split");function E(L,U=!1,j=[],Q){let Y=j.slice(),W=L(ie=>{Y?Y.push(ie):z.fire(ie)});Q&&Q.add(W);let V=a(()=>{Y?.forEach(ie=>z.fire(ie)),Y=null},"flush"),z=new vT({onWillAddFirstListener(){W||(W=L(ie=>z.fire(ie)),Q&&Q.add(W))},onDidAddFirstListener(){Y&&(U?setTimeout(V):V())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return Q&&Q.add(z),z.event}M.buffer=E,a(E,"buffer");function v(L,U){return a((Q,Y,W)=>{let V=U(new T);return L(function(z){let ie=V.evaluate(z);ie!==S&&Q.call(Y,ie)},void 0,W)},"fn")}M.chain=v,a(v,"chain");let S=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(U){return this.steps.push(U),this}forEach(U){return this.steps.push(j=>(U(j),j)),this}filter(U){return this.steps.push(j=>U(j)?j:S),this}reduce(U,j){let Q=j;return this.steps.push(Y=>(Q=U(Q,Y),Q)),this}latch(U=(j,Q)=>j===Q){let j=!0,Q;return this.steps.push(Y=>{let W=j||!U(Y,Q);return j=!1,Q=Y,W?Y:S}),this}evaluate(U){for(let j of this.steps)if(U=j(U),U===S)break;return U}}function w(L,U,j=Q=>Q){let Q=a((...z)=>V.fire(j(...z)),"fn"),Y=a(()=>L.on(U,Q),"onFirstListenerAdd"),W=a(()=>L.removeListener(U,Q),"onLastListenerRemove"),V=new vT({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(L,U,j=Q=>Q){let Q=a((...z)=>V.fire(j(...z)),"fn"),Y=a(()=>L.addEventListener(U,Q),"onFirstListenerAdd"),W=a(()=>L.removeEventListener(U,Q),"onLastListenerRemove"),V=new vT({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(L,U){return new Promise(j=>n(L)(j,null,U))}M.toPromise=x,a(x,"toPromise");function k(L){let U=new vT;return L.then(j=>{U.fire(j)},()=>{U.fire(void 0)}).finally(()=>{U.dispose()}),U.event}M.fromPromise=k,a(k,"fromPromise");function D(L,U){return L(j=>U.fire(j))}M.forward=D,a(D,"forward");function N(L,U,j){return U(j),L(Q=>U(Q))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class O{constructor(U,j){this._observable=U;this._counter=0;this._hasChanged=!1;let Q={onWillAddFirstListener:a(()=>{U.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{U.removeObserver(this)},"onDidRemoveLastListener")};j||e(Q),this.emitter=new vT(Q),j&&j.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(U){this._counter++}handlePossibleChange(U){}handleChange(U,j){this._hasChanged=!0}endUpdate(U){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(L,U){return new O(L,U).emitter.event}M.fromObservable=B,a(B,"fromObservable");function q(L){return(U,j,Q)=>{let Y=0,W=!1,V={beginUpdate(){Y++},endUpdate(){Y--,Y===0&&(L.reportChanges(),W&&(W=!1,U.call(j)))},handlePossibleChange(){},handleChange(){W=!0}};L.addObserver(V),L.reportChanges();let z={dispose(){L.removeObserver(V)}};return Q instanceof Fq?Q.add(z):Array.isArray(Q)&&Q.push(z),z}}M.fromObservableLight=q,a(q,"fromObservableLight")})(nRe||={});var CHt=class t{constructor(e){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${e}_${t._idPool++}`,t.all.add(this)}static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}start(e){this._stopWatch=new rZe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}},oTn=-1;var bHt=class t{constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e;this.threshold=r;this.name=n;this._warnCountdown=0}static{a(this,"LeakageMonitor")}static{this._idPool=1}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||rthis.fileOps.appendFile(e,r,"utf8"));return this.appendQueues.set(e,o.catch(()=>{})),o}};p();var KJe=require("fs"),n5=fe(require("path"));var tTn=require("stream");var Xzo={mkdir:a((t,e)=>KJe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>KJe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>KJe.promises.appendFile(t,e,r),"appendFile")},YJe,JJe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??Xzo,this.basePath=this.getBasePath(),this.isEnabled=!!this.basePath}static{a(this,"DebugRequestLogger")}static{this.sequence=0}static{this.requestSeqMap=new Map}static{this.requestInteractionMap=new Map}static{this.appendChainMap=new Map}static resetForTesting(){YJe=void 0,eTn(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return kt(this.ctx,ze.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return YJe||(YJe=this.initHttpLogDir()),YJe}toPersistenceFileOps(){return{mkdir:a((e,r)=>this.fileOps.mkdir(e,r),"mkdir"),writeFile:a((e,r,n)=>this.fileOps.writeFile(e,r,n),"writeFile"),appendFile:a((e,r,n)=>this.fileOps.appendFile(e,r,n),"appendFile")}}async initHttpLogDir(){let e=await yHt(this.basePath,this.toPersistenceFileOps()),r=n5.join(e,"http-log");return await this.fileOps.mkdir(r,{recursive:!0}),r}seqForRequest(e){let r=t.requestSeqMap.get(e);if(r!==void 0)return r;let n=++t.sequence;return t.requestSeqMap.set(e,n),n}logRequest(e){this.isEnabled&&this.writeRequestFile(e).catch(r=>{ot.debug(this.ctx,"Failed to persist enhanced request log",r)})}logResponse(e){this.isEnabled&&this.writeResponseFile(e).catch(r=>{ot.debug(this.ctx,"Failed to persist enhanced response log",r)})}static{this.SENSITIVE_HEADERS=new Set(["authorization","cookie","set-cookie","request-hmac","proxy-authorization"].map(e=>e.toLowerCase()))}static redactHeaders(e){let r={};for(let[n,o]of Object.entries(e))r[n]=t.SENSITIVE_HEADERS.has(n.toLowerCase())?"[REDACTED]":o;return r}async resolveTurnHttpLogDir(e){if(!e)return;let r=_Ht(e);if(!r)return;let n=n5.join(r,"http-log");return await this.fileOps.mkdir(n,{recursive:!0}),n}static extractInteractionId(e){return Object.entries(e).find(([r])=>r.toLowerCase()==="x-interaction-id")?.[1]}async writeMessagesDump(e,r,n,o){if(!o||o.length===0)return;let s=`${r}_request_messages_dump_${n}.json`;await this.fileOps.writeFile(n5.join(e,s),JSON.stringify(o,null,2),"utf8")}appendResponseChunk(e,r){if(!this.isEnabled)return;let o=(t.appendChainMap.get(e)??Promise.resolve()).then(()=>this.doAppendChunk(e,r)).catch(s=>{ot.debug(this.ctx,"Failed to append SSE chunk",s)});t.appendChainMap.set(e,o)}async doAppendChunk(e,r){let n=await this.ensureDir(),o=this.seqForRequest(e),s=String(o).padStart(6,"0"),c=e.replace(/[^a-zA-Z0-9_-]/g,"_"),l=`${s}_response_sse_chunks_${c}.txt`;await this.fileOps.appendFile(n5.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(n5.join(d,l),r,"utf8")}async writeRequestFile(e){let r=await this.ensureDir(),n=this.seqForRequest(e.requestId),o=String(n).padStart(6,"0"),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${o}_request_${s}.json`,{messages:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},f=JSON.stringify(d,null,2);await this.fileOps.writeFile(n5.join(r,c),f,"utf8"),await this.writeMessagesDump(r,o,s,l);let h=t.extractInteractionId(e.headers);h&&t.requestInteractionMap.set(e.requestId,h);let m=await this.resolveTurnHttpLogDir(h);m&&(await this.fileOps.writeFile(n5.join(m,c),f,"utf8"),await this.writeMessagesDump(m,o,s,l))}async writeResponseFile(e){let r=t.appendChainMap.get(e.requestId);r&&(await r,t.appendChainMap.delete(e.requestId));let n=await this.ensureDir(),o=this.seqForRequest(e.requestId),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${String(o).padStart(6,"0")}_response_headers_${s}.json`,{body:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},f=JSON.stringify(d,null,2);await this.fileOps.writeFile(n5.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(n5.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},ZJe=class extends kx{static{a(this,"DebugLoggingResponseWrapper")}constructor(e,r,n,o){super(e.status,e.statusText,e.headers,()=>e.text(),()=>e.body()),this.logger=r,this.requestId=n,this.startTime=o}async text(){let e=await super.text();return this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),e}body(){let e=super.body();return e?this.createLoggingStream(e):null}createLoggingStream(e){let r=new tTn.PassThrough;return e.on("data",n=>{this.logger.appendResponseChunk(this.requestId,n.toString()),r.write(n)}),e.on("end",()=>{this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),r.end()}),e.on("error",n=>{r.emit("error",n)}),r}headersToObject(){let e={};for(let[r,n]of this.headers)e[r]=n;return e}};p();p();var OJ=class t extends av{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new pe("AutoModelService"),this._register(ws(this._ctx,()=>{this._autoModelCache.clear(),this._reserveToken=void 0,this._ongoingFetches.clear(),this._logger.info(this._ctx,"Auto model cache cleared due to token update")}))}static{a(this,"AutoModelService")}static{this.EXPIRY_THRESHOLD_MS=300*1e3}async resolveModelConfiguration(r,n){let o=this._autoModelCache.get(r);o||(o={},this._autoModelCache.set(r,o)),this._pruneExpiredTokens(o),!o.active&&o.standby&&(o.active=o.standby,o.standby=void 0),o.active||(o.active=await this._acquireActiveToken(r)),(!o.standby||!this._isTokenValid(o.standby)||this._isExpiringSoon(o.standby)||this._isExpiringSoon(o.active))&&this._refreshStandbyInBackground(r),this._ensureReserveRefill();let s=await this._ctx.get(Ns).getMetadata(),c=await this._ctx.get(dl).getBestChatModelConfig([o.active.model]);c.copilotSessionToken=o.active.sessionToken,c.autoModeDiscountedCost=o.active.discountedCost;let l=s.find(u=>u.capabilities.family===o.active.model);return c.originalBillingMultiplier=l?.billing?.multiplier??0,c}_ensureReserveRefill(){if(this._isTokenValid(this._reserveToken))return;let r="reserve";if(this._ongoingFetches.has(r))return;let n=this._fetchToken("reserve");this._ongoingFetches.set(r,n),n.then(o=>{this._reserveToken=o}).catch(o=>{this._logger.error(this._ctx,`Failed to refresh reserve auto mode token: ${o instanceof Error?o.message:String(o)}`)}).finally(()=>{this._ongoingFetches.delete(r)})}async _acquireActiveToken(r){if(this._isTokenValid(this._reserveToken)){let c=this._reserveToken;return this._reserveToken=void 0,c}let n=`active:${r}`,o=this._ongoingFetches.get(n);if(o)return o;let s=this._fetchToken("active").finally(()=>{this._ongoingFetches.delete(n)});return this._ongoingFetches.set(n,s),s}_refreshStandbyInBackground(r){let n=`standby:${r}`;if(this._ongoingFetches.has(n))return;let o=this._fetchToken("standby");this._ongoingFetches.set(n,o),o.then(s=>{let c=this._autoModelCache.get(r);c&&(c.active&&c.active.sessionToken===s.sessionToken||(c.standby=s,this._ongoingFetches.delete(n)))}).catch(s=>{this._logger.error(this._ctx,`Failed to refresh standby auto mode token for ${r}: ${s instanceof Error?s.message:String(s)}`),this._ongoingFetches.delete(n)})}async _fetchToken(r){let n=Date.now();try{let o=await gWe(this._ctx,"/models/session",JSON.stringify({auto_mode:{model_hints:["auto"]}}));if(!o.ok)throw new Error(`Auto mode API returned status ${o.status}`);let s=await o.json(),c=s.selected_model,l=s.session_token,u=s.expires_at*1e3,d=s.discounted_costs?.[c];return this._logger.info(this._ctx,`Fetched auto model for ${r} in ${Date.now()-n}ms: ${c}`),{model:c,sessionToken:l,expiration:u,discountedCost:d}}catch(o){throw this._logger.error(this._ctx,`Failed to fetch auto mode model for ${r}: ${o instanceof Error?o.message:String(o)}`),o}}_pruneExpiredTokens(r){r.active&&!this._isTokenValid(r.active)&&(r.active=void 0),r.standby&&!this._isTokenValid(r.standby)&&(r.standby=void 0)}_isTokenValid(r){return!!r&&r.expiration>Date.now()}_isExpiringSoon(r){return r?r.expiration-Date.now()<=t.EXPIRY_THRESHOLD_MS:!1}};var XJe="Auto",lv="auto";var Ro=class t{static{a(this,"ModelPickerUtils")}static async formatModelDisplayName(e,r,n){if(!r)return;let o=n?.trim();if(o){try{let u=(await new as(e.get(Un)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(Ns).getMetadata()).find(u=>u.id===r);if(l)return`${l.name}`}catch{}return`${r}`}static async getModelConfiguration(e,r,n){let o=await e.get(Qt).getToken(),s=!!o.userInfo?.isTBBEnabled,c=!!o.userInfo?.isFreeUser,l=e.get(Ru);if(!s&&l.quotaExhausted&&!c){let u=await e.get(Ns).getFallbackModel();if(u?.id)return e.get(dl).getBestChatModelConfig([u.id])}if(r)return e.get(dl).getBestChatModelConfig(Z1(r,s),n);throw new Error("Model is not specified")}static async getModelConfigurationById(e,r,n,o){if(!r)throw new Error("Model is not specified");if(r===lv)return await e.get(OJ).resolveModelConfiguration(n??"unknown",o);let s=await e.get(dl).getModelConfigurationById(r);if(!s)throw new Error(`No model configuration found for id '${r}'`);return s}static setUserSelectedReasoningEffort(e,r,n){if(!n)return r;let o=r.reasoningEfforts;return o&&o.length>0&&!o.includes(n)?(ot.warn(e,`User-selected reasoning effort '${n}' for model '${r.modelId}' is not in supported list [${o.join(", ")}].`),r):(r.userSelectedReasoningEffort=n,r)}static overrideMaxRequestTokens(e,r){return typeof r!="number"||!Number.isFinite(r)||r<=0||(e.maxRequestTokens=e.maxLongContextTokens===void 0?Math.min(e.maxRequestTokens,r):Math.min(e.maxLongContextTokens,r)),e}static applyModelConfigurationOverrides(e,r,n){return t.setUserSelectedReasoningEffort(e,r,n?.reasoningEffort),t.overrideMaxRequestTokens(r,n?.contextSize),r}static async resolveModelIdFromFamily(e,r){return r===lv?lv:(await e.get(Ns).getMetadata()).find(o=>o.capabilities.family===r&&o.capabilities.type==="chat"&&o.model_picker_enabled===!0)?.id}static transformMessages(e,r){return r===kn.O1Ga||r===kn.O1Mini?e.map(n=>n.role!=="user"?{role:"user",content:n.content}:n):e}static parseModelNotSupportedReason(e){if(!e)return{};let r=e.indexOf(":");if(r===-1||r===e.length-1)return{};let n=e.slice(r+1).trim();if(!n)return{};let{modelName:o,provider:s}=EHt(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var dh=new pe("fetchChat"),eYo=new Set([500,502,504]),tYo=[1e3,1e4,1e4],eZe=class{static{a(this,"OpenAIChatMLFetcher")}async fetchAndStreamChat(e,r,n,o,s){let c=String(n.properties.headerRequestId??r.ourRequestId);if(s?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"};let l;try{let f=await this.fetchWithParameters(e,r.endpoint,r,n,s);if(f==="not-sent")return{type:"canceled",reason:"before fetch request"};l=f}catch(f){if(ig(f)||!wx(f))throw f;dh.info(e,`Network error during fetch, checking connectivity before retry [${c}]: ${String(f)}`);let h=await this.retryAfterError(e,r,n,s,c);if(h&&"canceled"in h)return h.canceled;if(h&&"response"in h)l=h.response;else throw f}if(s?.isCancellationRequested)return this.destroyResponseBody(e,l),{type:"canceled",reason:"after fetch request"};if(iYo(l.status)){dh.info(e,`Server returned ${l.status}, checking network connectivity before retry [${c}]`);let f=await this.retryAfterError(e,r,n,s,c);if(f&&"canceled"in f)return this.destroyResponseBody(e,l),f.canceled;f&&"response"in f&&(this.destroyResponseBody(e,l),l=f.response)}if(l.status!==200){let f=this.createTelemetryData(r.endpoint,e,r),h=await Ro.formatModelDisplayName(e,r.model,r.modelProviderName),m=await this.handleError(e,f,l,h,r.uiKind);return m.type==="failed"?{...m,ghRequestId:l.headers.get("x-github-request-id")||void 0}:m}e.get(Ru).processQuotaHeaders(l.headers),e.get(KO).processRateLimitHeaders(l.headers);let u=p2.getStrategy(r.endpoint),d={messages:r.messages,tools:r.tools,tool_choice:r.tool_choice,temperature:r.postOptions?.temperature,topP:r.postOptions?.top_p,modelConfiguration:{modelId:r.model,maxResponseTokens:r.postOptions?.max_tokens,stream:!!r.postOptions?.stream},repoInfo:r.repoInfo,count:r.count,postOptions:r.postOptions,intentParams:{intent:r.intent,intent_threshold:r.intent_threshold,intent_model:r.intent_model,intent_tokenizer:r.intent_tokenizer,intent_content:r.intent_content},copilot_thread_id:r.copilot_thread_id,prediction:r.prediction,cancel:s,enableThinking:r.enableThinking};return u.processResponse(e,l,o,n,d)}destroyResponseBody(e,r){try{let n=r.body();n&&"destroy"in n&&typeof n.destroy=="function"?n.destroy():n instanceof ReadableStream&&n.cancel()}catch(n){dh.exception(e,n,"Error destroying response stream")}}async retryAfterError(e,r,n,o,s){if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled before connectivity check"}};let c=await oYo(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){dh.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}dh.info(e,`Connectivity check passed, retrying request [${s}]`);let l=await this.fetchWithParameters(e,r.endpoint,r,n,o);return l==="not-sent"?{canceled:{type:"canceled",reason:"before retry fetch request"}}:o?.isCancellationRequested?(this.destroyResponseBody(e,l),{canceled:{type:"canceled",reason:"after retry fetch request"}}):{response:l}}createTelemetryData(e,r,n){return Vt.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=p2.getStrategy(r),l={messages:n.messages,tools:n.tools,tool_choice:n.tool_choice,temperature:n.postOptions?.temperature,topP:n.postOptions?.top_p,modelConfiguration:{modelId:n.model,providerName:n.modelProviderName,maxResponseTokens:n.postOptions?.max_tokens,stream:n.postOptions?.stream!==!1,supportsThinking:n.supportsThinking,reasoningEfforts:n.reasoningEfforts,userSelectedReasoningEffort:n.userSelectedReasoningEffort},repoInfo:n.repoInfo,count:n.count,postOptions:n.postOptions,intentParams:{intent:n.intent,intent_threshold:n.intent_threshold,intent_model:n.intent_model,intent_tokenizer:n.intent_tokenizer,intent_content:n.intent_content},copilot_thread_id:n.copilot_thread_id,prediction:n.prediction,cancel:s,enableThinking:n.enableThinking},u=c.buildRequestBody(e,l);if(c.adaptRequest(u,l.modelConfiguration),s?.isCancellationRequested)return"not-sent";let d=c.getAuthHeaders(n.apiKey);return await rYo(e,n.messages,n.copilotApiBaseUrl,n.engineName,r,n.ourRequestId,u,n.authToken,n.uiKind,o,n.llmInteraction,n.modelProviderName,n.copilotEditsSessionHeader,n.copilotSessionToken,s,n.supportsAdaptiveThinking,d)}async handleError(e,r,n,o,s){if(n.clientError&&!n.headers.get("x-github-request-id")){let f=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;dh.error(e,f),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else r.properties.error=`Response status was ${n.status}`;if(r.properties.status=String(n.status),ft(e,"request.shownWarning",r),n.status===401)try{let f=await n.text(),h=JSON.parse(f);if(h.authorize_url)return{type:"authRequired",reason:"not authorized",authUrl:h.authorize_url}}catch{}if(n.status===401||n.status===403)return e.get(Qt).resetToken("chat_messages",n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`,code:n.status};if(n.status===499)return dh.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server",code:n.status};let c=await n.text();if(n.status===429){let f=UM(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return sr(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:f??-1}),{type:"failed",reason:"rate limit exceeded",code:n.status,retryAfter:f,capiErrorCode:h}}if(n.status===466)return dh.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400){let f=cv.translate400Reason(c,o);if(f!==void 0)return{type:"failed",reason:f,code:n.status}}if(n.status===424)return{type:"failedDependency",reason:c};let u=n.headers.get("retry-after"),d=await e.get(Qt).getToken();return n.status===402?{type:"failed",reason:cv.translate402Reason(c,{retryAfterHeader:u??void 0,retryAfterSeconds:UM(n),copilotPlan:d.userInfo?.copilotPlan,isTBBEnabled:d.userInfo?.isTBBEnabled,canUpgradePlan:d.userInfo?.canUpgradePlan,overageEnabled:e.get(Ru).overageEnabled}),code:n.status}:n.status===503?{type:"failed",reason:c,code:n.status}:(dh.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function rYo(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,_){let E=n===""&&o===""?r:Oa(r,n,o),v=d.extendedBy({endpoint:o,engineName:n,uiKind:u});oJe(c,v,["messages"]),v.properties.headerRequestId=s,ft(t,"request.sent",v);let S=Rl(),T=dSn(u),w={...om(t),...f.toCapiHeaders()};n3()&&(w=await mWe(t,w)),c.messages?.some(x=>Array.isArray(x.content)?x.content.some(k=>"image_url"in k):!1)&&(w["Copilot-Vision-Request"]="true"),_&&Object.assign(w,_),m&&(w[Qq]=m),g&&(w["copilot-session-token"]=g),o==="v1/messages"&&!y&&(w["anthropic-beta"]=KKe),c.messages&&c.messages.forEach(x=>{nYo(x)&&x.tool_calls&&(x.tool_calls=x.tool_calls.map(k=>ySn(k)))});let R=mue(()=>zJe(t)?new JJe(t):void 0,void 0);return Qz(t,E,l,T,s,c,A,w,void 0,h,R,e).then(x=>{let k=hF(x);v.extendWithRequestId(k);let D=Rl()-S;return v.measurements.totalTimeMs=D,dh.info(t,`Request ${s} at <${E}> finished with ${x.status} status after ${D}ms`),dh.debug(t,"request.response properties",v.properties),dh.debug(t,"request.response measurements",v.measurements),dh.debug(t,"messages:",JSON.stringify(e)),ft(t,"request.response",v),R?new ZJe(x,R,s,S):x}).catch(x=>{if(ig(x))throw x;let k=v.extendedBy({error:"Network exception"});ft(t,"request.shownWarning",k),v.properties.message=String(um(x,"name")??""),v.properties.code=String(um(x,"code")??""),v.properties.errno=String(um(x,"errno")??""),v.properties.type=String(um(x,"type")??"");let D=Rl()-S;throw v.measurements.totalTimeMs=D,dh.info(t,`Request ${s} at <${E}> rejected with ${String(x)} after ${D}ms`),dh.debug(t,"request.error properties",v.properties),dh.debug(t,"request.error measurements",v.measurements),ft(t,"request.error",v),x}).finally(()=>{zue(t,e,v)})}a(rYo,"fetchWithInstrumentation");function nYo(t){return"tool_calls"in t}a(nYo,"isChatMessageWithToolCalls");function iYo(t){return eYo.has(t)}a(iYo,"shouldRetryStatusCode");async function oYo(t,e,r,n,o=tYo){let s=t.get(Jt),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(dh.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([JC(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await JC(d);if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};try{let f=await s.fetch(c,{method:"GET",headers:{Authorization:`Bearer ${r}`}});if(f.status>=200&&f.status<300)return dh.info(t,"CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};l=`Status ${f.status}: ${f.statusText??""}`,u=f.headers.get("x-github-request-id")??void 0,dh.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,dh.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return dh.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(oYo,"checkNetworkConnectivity");p();var sYo=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function tZe(t){let e=t.slice();return e.reverse(),rTn(e)||rTn(e.filter(r=>r.trim().length>0))}a(tZe,"isRepetitive");function rTn(t){let e=aYo(t);for(let r of sYo){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(aYo,"kmp_prefix_function");Fo();var mc=class{constructor(e){this.ctx=e;this.fetcher=new eZe}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=Dt(),d={n:e.num_suggestions??1,temperature:e.temperature??0,stop:e.stop,top_p:e.topP??1,copilot_thread_id:e.copilot_thread_id,prediction:e.prediction},f=e.modelConfiguration;f&&(e.prediction?.content||delete d.prediction,e.prediction||e.modelConfiguration?.providerName===void 0&&f.maxResponseTokens!==void 0&&(d.max_tokens=f.maxResponseTokens),d.stream=!!f.stream),e.logitBias&&(d.logit_bias=e.logitBias);let h=e.chatModeKind==="Ask",m=await this.ctx.get(Qt).getToken(),g=!h&&kt(this.ctx,ze.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&Xbn(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=YO(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=kt(this.ctx,ze.AnthropicThinkingBudgetToken);if(D&&D>0){let N=D<1024?1024:D;d.thinking_budget=Math.min(32e3,e.modelConfiguration.maxResponseTokens-1,N)}}let A,y,_,E;if(e.modelConfiguration?.providerName){if(!Bq(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(_=await QKe(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),E=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===Ii.Azure)if(e.modelConfiguration.deploymentUrl)A=Dbn(e.modelConfiguration.modelId,e.modelConfiguration.deploymentUrl),y="",e.engineName="";else throw new Error(`No deployment URL found for Azure model: ${e.modelConfiguration.modelId}`);else if(Bue(e.modelConfiguration?.providerName))A=Hue[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=_;else if(ob(e.modelConfiguration.providerName))A=UKe(e.modelConfiguration.deploymentUrl),y="completions",e.authToken="";else{if(!e.modelConfiguration.deploymentUrl)throw new Error(`No endpoint URL found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);if(!_)throw new Error(`No API key found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);let D=e.modelConfiguration.apiType??Pwe;A=Nwe(e.modelConfiguration.deploymentUrl,D),y=Pbn(D),e.authToken=_}}else{if(A=Px(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?XKe(this.ctx,f):!1;y=ZKe(f,D)}ot.debug(this.ctx,`Endpoint routing: model=${f?.modelId}, supportedEndpoints=${JSON.stringify(f?.supportedEndpoints)}, selected=${y}`)}let v=f?.copilotSessionToken,S=e.authToken??m.token,T=p2.getStrategy(y),w=e.engineName??T.engineName,R={messages:e.messages,repoInfo:void 0,ourRequestId:u,copilotApiBaseUrl:A,engineName:w,endpoint:y,count:e.num_suggestions??1,uiKind:e.uiKind,postOptions:d,authToken:S,apiKey:_,modelProviderName:E,...e.intentParams,llmInteraction:e.llmInteraction,prediction:e.prediction,copilotEditsSessionHeader:e.copilotEditsSessionHeader,copilotSessionToken:v,supportsThinking:f?.supportsThinking,supportsAdaptiveThinking:f?.supportsAdaptiveThinking,reasoningEfforts:f?.reasoningEfforts,userSelectedReasoningEffort:f?.userSelectedReasoningEffort,enableThinking:g};f&&(R.model=f.modelId),e.tools&&e.tools?.length>0&&(f===void 0||f.toolCalls)&&(R.tools=e.tools,R.tool_choice=e.tool_choice??"auto");let x=await this.fetch(R,o,r,n);if(c){let D=c.maxRetryAttempts??3;for(let N=1;N<=D&&!(!c.shouldRetry(x)||x.type==="failed"&&x.noRetry);N++){let O=x;if(await c.onRetry?.(O,N),O.type==="failed"&&O.retryAfter!==void 0&&O.retryAfter>0){let B=O.retryAfter;if(await new Promise(q=>{let M=setTimeout(()=>{L.dispose(),q()},B*1e3),L=r.onCancellationRequested(()=>{clearTimeout(M),L.dispose(),q()})}),r.isCancellationRequested)break}x=await this.fetch(R,o,r,n),sr(this.ctx,"request.throttled.retry",{requestSource:e.uiKind??"unknown",resultType:x.type,modelId:f?f.providerName?"custom-byok":f.modelId:"unknown"},{retryAfter:O.type==="failed"?O.retryAfter??-1:-1,resultCode:x.type==="failed"?x.code??-1:-1})}}let k=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,x,n,k,y),this.trackTurnCredits(e,x),hue(()=>{if(s)return s.persistLLMRequest({requestId:R.ourRequestId,messages:R.messages,tools:R.tools,model:R.model,response:x,durationMs:k})},D=>ot.debug(this.ctx,"persistLLMRequest failed",D)),x}async fetch(e,r,n,o){try{let s=await this.fetcher.fetchAndStreamChat(this.ctx,e,o.extendedBy({uiKind:e.uiKind}),r||(()=>{}),n);switch(s.type){case"success":return await this.processSuccessfulResponse(e,s,e.ourRequestId,o);case"canceled":return this.processCanceledResponse(s,e.ourRequestId);case"failed":case"failedDependency":return this.processFailedResponse(s,e.ourRequestId);case"authRequired":return{type:"agentAuthRequired",reason:"Agent authentication required.",authUrl:s.authUrl,requestId:e.ourRequestId}}}catch(s){return this.processError(s,e.ourRequestId)}}async processSuccessfulResponse(e,r,n,o){let s=[],c=Bwe(r.chatCompletions,u=>this.postProcess(u,o));ot.debug(this.ctx,`Process success response for request ${e.ourRequestId} with chatParams: ${JSON.stringify(e,null,2)}`);let l=0;for await(let u of c)ot.debug(this.ctx,`Received choice #${l} for request ${e.ourRequestId}: ${JSON.stringify(u,null,2)}`),s.push(u),l++;if(s.length==1){let u=s[0];switch(u.finishReason){case"stop":return{type:"success",value:Mn(u.message?.content)??"",toolCalls:u.tool_calls,requestId:n,numTokens:u.numTokens,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"tool_calls":return{type:"tool_calls",toolCalls:u.tool_calls,requestId:n,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"content_filter":return{type:"filtered",reason:"Response got filtered.",requestId:n,usage:u.usage,copilot_usage:u.copilot_usage};case"length":return{type:"length",reason:"Response too long.",requestId:n,truncatedValue:Mn(u.message?.content)??"",thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"DONE":return{type:"no_finish_reason",reason:"No finish reason received.",requestId:n};default:return{type:"unknown",reason:"Unknown finish reason received.",requestId:n}}}else if(s.length>1){let u=s.filter(d=>d.finishReason=="stop"||d.finishReason=="tool_calls");if(u.length>0)return{type:"successMultiple",value:u.map(d=>Mn(d.message.content)),toolCalls:u.map(d=>d.tool_calls).filter(d=>d),requestId:n,copilotEditsSessionHeader:u[0].copilotEditsSessionHeader,usage:u[0].usage,copilot_usage:u[0].copilot_usage}}return{type:"no_choices",reason:"Response contained no choices.",requestId:n}}postProcess(e,r){return tZe(e.tokens)?(r.extendWithRequestId(e.requestId),ft(this.ctx,"conversation.repetition.detected",r,0),e.finishReason!==""?e:void 0):e.message?e:void 0}processCanceledResponse(e,r){return ot.debug(this.ctx,"Cancelled after awaiting fetchConversation"),{type:"canceled",reason:e.reason,requestId:r}}processFailedResponse(e,r){return e?.reason.includes("filtered as off_topic by intent classifier")?{type:"offTopic",reason:e.reason,requestId:r}:e?.reason.includes("model is not supported")?{type:"model_not_supported",reason:e.reason,requestId:r}:e?.reason.includes("model max prompt tokens exceeded")?{type:"model_max_prompt_tokens_exceeded",reason:e.reason,requestId:r}:{type:"failed",reason:e.reason,requestId:r,code:e.type==="failed"?e.code:void 0,retryAfter:e.type==="failed"?e.retryAfter:void 0,ghRequestId:e.type==="failed"?e.ghRequestId:void 0,capiErrorCode:e.type==="failed"?e.capiErrorCode:void 0}}processError(e,r){if(ig(e))return{type:"canceled",reason:"network request aborted",requestId:r};{ot.exception(this.ctx,e,"Error on conversation request");let n="Error on conversation request. Read more from logs.";if(e instanceof Error){let o=e.message;if(o&&o.trim().length>0){let s=360;o.length<=s?n=`Error on conversation request: ${o}`:n=`Error on conversation request: ${o.substring(0,s)}... Read more from logs.`}}return{type:"failed",reason:n,requestId:r,noRetry:e instanceof MJ?!0:void 0}}}trackTurnCredits(e,r){if(!e.turnId)return;let n="copilot_usage"in r?r.copilot_usage:void 0;!n||n.total_nano_aiu<=0||this.ctx.get(Ru).setLastCopilotUsage(n.total_nano_aiu,e.turnId)}sendFetchResponseTelemetry(e,r,n,o,s){let c={responseType:r.type},l={duration:o};e.modelConfiguration&&!e.modelConfiguration?.providerName&&(c.modelId=e.modelConfiguration.modelId,c.modelFamily=e.modelConfiguration.modelFamily,c.maxRequestTokens=String(e.modelConfiguration.maxRequestTokens),c.userSelectedReasoningEffort=e.modelConfiguration.userSelectedReasoningEffort??""),"reason"in r&&r.reason&&(c.reason=r.reason.substring(0,360)),"code"in r&&r.code!==void 0&&(c.statusCode=String(r.code)),r.type==="failed"&&r.noRetry&&(c.isMidStreamError="true"),c.uiKind=e.uiKind,s&&(c.route=s),r.usage&&(l.completionTokens=r.usage.completion_tokens,l.promptTokens=r.usage.prompt_tokens,l.totalTokens=r.usage.total_tokens,r.usage.prompt_tokens_details?.cached_tokens!==void 0&&(l.cachedTokens=r.usage.prompt_tokens_details.cached_tokens)),r.copilot_usage&&(l.copilotUsageTotalNanoAiu=r.copilot_usage.total_nano_aiu,r.copilot_usage.token_details?.length&&(c.copilotUsageTokenDetails=JSON.stringify(r.copilot_usage.token_details))),n.properties.conversationId&&(c.conversationId=n.properties.conversationId),n.properties.messageId&&(c.messageId=n.properties.messageId),n.properties.messageSource&&(c.messageSource=n.properties.messageSource),sr(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var dm=class{static{a(this,"ConversationInspector")}};p();p();var fm=class{constructor(){this.skills=[]}static{a(this,"ConversationSkillRegistry")}registerSkill(e){if(this.getSkill(e.id))throw new Error(`Skill with id '${e.id}' already registered`);this.skills.push(e)}getSkill(e){return this.skills.find(r=>r.id===e)}getDescriptors(){return[...this.skills]}},vHt=class{constructor(e,r,n){this.delegate=e;this.stepId=r;this.stepTitle=n}static{a(this,"StepReportingSkillResolver")}async resolveSkill(e){await e.steps.start(this.stepId,this.stepTitle);try{let r=await this.delegate.resolveSkill(e);return r||await e.steps.finish(this.stepId),r}catch(r){throw await e.steps.error(this.stepId,r instanceof Error?r.message:`Error resolving ${this.stepTitle}`),r}}},CHt=class{constructor(e,r){this.delegate=e;this.stepId=r}static{a(this,"StepReportingSkillProcessor")}value(){return this.delegate.value()}async processSkill(e,r){try{let n=await this.delegate.processSkill(e,r);return await r.steps.finish(this.stepId),n}catch(n){throw await r.steps.error(this.stepId,n instanceof Error?n.message:`Error processing ${this.stepId}`),n}}},I0=class{constructor(e,r,n,o,s,c="explicit",l=[],u=()=>!0){this.id=e;this._description=r;this.stepTitle=n;this._resolver=o;this._processor=s;this.type=c;this._examples=l;this._isAvailable=u}static{a(this,"SingleStepReportingSkill")}description(){return this._description}examples(){return this._examples}isAvailable(e){return this._isAvailable(e)}resolver(e){return new vHt(this._resolver(e),this.id,this.stepTitle)}processor(e){return new CHt(this._processor(e),this.id)}};p();p();var Ic=class extends Error{constructor(r){super(`No instance of ${r.name} has been registered`);this.ctor=r;this.name=`UnregisteredContextErrorFor${r.name}`}static{a(this,"UnregisteredContextError")}},rde=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new Ic(e)}tryGet(e){let r=this.instances.get(e);if(r)return r}set(e,r){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.assertIsInstance(e,r),this.instances.set(e,r)}forceSet(e,r){this.assertIsInstance(e,r),this.instances.set(e,r)}assertIsInstance(e,r){if(!(r instanceof e)){let n=JSON.stringify(r);throw new Error(`The instance you're trying to register for ${e.name} is not an instance of it (${n}).`)}}};p();var nTn=new pe("EncodingConfigurationService"),i5=class{constructor(e){this.ctx=e;this.fileEncodingCache=new Map}static{a(this,"EncodingConfigurationService")}async getEncodingForFile(e){if(this.fileEncodingCache.has(e))return this.fileEncodingCache.get(e);let r=await this.requestEncodingFromClient(e)??"utf8";return this.fileEncodingCache.set(e,r),r}handleConfigurationChange(e){if(e.copilot?.encodingChanges){if(e.copilot.encodingChanges.length>0)for(let r of e.copilot.encodingChanges)this.fileEncodingCache.delete(r),nTn.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),nTn.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var iTn=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}};p();var cYo=globalThis.performance&&typeof globalThis.performance.now=="function",rZe=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=cYo&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};var oTn=!1,lYo=!1,nRe;(M=>{M.None=a(()=>av.None,"None");function e(L){if(lYo){let{onDidAddListener:U}=L,j=rRe.create(),Q=0;L.onDidAddListener=()=>{++Q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),j.print()),U?.()}}}a(e,"_addLeakageTraceLogic");function r(L,U){return g(L,()=>{},0,void 0,!0,void 0,U)}M.defer=r,a(r,"defer");function n(L){return(U,j=null,Q)=>{let Y=!1,W;return W=L(V=>{if(!Y)return W?W.dispose():Y=!0,U.call(j,V)},null,Q),Y&&W.dispose(),W}}M.once=n,a(n,"once");function o(L,U){return M.once(M.filter(L,U))}M.onceIf=o,a(o,"onceIf");function s(L,U,j){return h((Q,Y=null,W)=>L(V=>Q.call(Y,U(V)),null,W),j)}M.map=s,a(s,"map");function c(L,U,j){return h((Q,Y=null,W)=>L(V=>{U(V),Q.call(Y,V)},null,W),j)}M.forEach=c,a(c,"forEach");function l(L,U,j){return h((Q,Y=null,W)=>L(V=>U(V)&&Q.call(Y,V),null,W),j)}M.filter=l,a(l,"filter");function u(L){return L}M.signal=u,a(u,"signal");function d(...L){return(U,j=null,Q)=>{let Y=Vbn(...L.map(W=>W(V=>U.call(j,V))));return m(Y,Q)}}M.any=d,a(d,"any");function f(L,U,j,Q){let Y=j;return s(L,W=>(Y=U(Y,W),Y),Q)}M.reduce=f,a(f,"reduce");function h(L,U){let j,Q={onWillAddFirstListener(){j=L(Y.fire,Y)},onDidRemoveLastListener(){j?.dispose()}};U||e(Q);let Y=new vT(Q);return U?.add(Y),Y.event}a(h,"snapshot");function m(L,U){return U instanceof Array?U.push(L):U&&U.add(L),L}a(m,"addAndReturnDisposable");function g(L,U,j=100,Q=!1,Y=!1,W,V){let z,ie,H,re=0,le,Le={leakWarningThreshold:W,onWillAddFirstListener(){z=L(Oe=>{re++,ie=U(ie,Oe),Q&&!H&&(me.fire(ie),ie=void 0),le=a(()=>{let Te=ie;ie=void 0,H=void 0,(!Q||re>1)&&me.fire(Te),re=0},"doFire"),typeof j=="number"?(clearTimeout(H),H=setTimeout(le,j)):H===void 0&&(H=0,queueMicrotask(le))})},onWillRemoveListener(){Y&&re>0&&le?.()},onDidRemoveLastListener(){le=void 0,z.dispose()}};V||e(Le);let me=new vT(Le);return V?.add(me),me.event}M.debounce=g,a(g,"debounce");function A(L,U=0,j){return M.debounce(L,(Q,Y)=>Q?(Q.push(Y),Q):[Y],U,void 0,!0,void 0,j)}M.accumulate=A,a(A,"accumulate");function y(L,U=(Q,Y)=>Q===Y,j){let Q=!0,Y;return l(L,W=>{let V=Q||!U(W,Y);return Q=!1,Y=W,V},j)}M.latch=y,a(y,"latch");function _(L,U,j){return[M.filter(L,U,j),M.filter(L,Q=>!U(Q),j)]}M.split=_,a(_,"split");function E(L,U=!1,j=[],Q){let Y=j.slice(),W=L(ie=>{Y?Y.push(ie):z.fire(ie)});Q&&Q.add(W);let V=a(()=>{Y?.forEach(ie=>z.fire(ie)),Y=null},"flush"),z=new vT({onWillAddFirstListener(){W||(W=L(ie=>z.fire(ie)),Q&&Q.add(W))},onDidAddFirstListener(){Y&&(U?setTimeout(V):V())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return Q&&Q.add(z),z.event}M.buffer=E,a(E,"buffer");function v(L,U){return a((Q,Y,W)=>{let V=U(new T);return L(function(z){let ie=V.evaluate(z);ie!==S&&Q.call(Y,ie)},void 0,W)},"fn")}M.chain=v,a(v,"chain");let S=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(U){return this.steps.push(U),this}forEach(U){return this.steps.push(j=>(U(j),j)),this}filter(U){return this.steps.push(j=>U(j)?j:S),this}reduce(U,j){let Q=j;return this.steps.push(Y=>(Q=U(Q,Y),Q)),this}latch(U=(j,Q)=>j===Q){let j=!0,Q;return this.steps.push(Y=>{let W=j||!U(Y,Q);return j=!1,Q=Y,W?Y:S}),this}evaluate(U){for(let j of this.steps)if(U=j(U),U===S)break;return U}}function w(L,U,j=Q=>Q){let Q=a((...z)=>V.fire(j(...z)),"fn"),Y=a(()=>L.on(U,Q),"onFirstListenerAdd"),W=a(()=>L.removeListener(U,Q),"onLastListenerRemove"),V=new vT({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(L,U,j=Q=>Q){let Q=a((...z)=>V.fire(j(...z)),"fn"),Y=a(()=>L.addEventListener(U,Q),"onFirstListenerAdd"),W=a(()=>L.removeEventListener(U,Q),"onLastListenerRemove"),V=new vT({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(L,U){return new Promise(j=>n(L)(j,null,U))}M.toPromise=x,a(x,"toPromise");function k(L){let U=new vT;return L.then(j=>{U.fire(j)},()=>{U.fire(void 0)}).finally(()=>{U.dispose()}),U.event}M.fromPromise=k,a(k,"fromPromise");function D(L,U){return L(j=>U.fire(j))}M.forward=D,a(D,"forward");function N(L,U,j){return U(j),L(Q=>U(Q))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class O{constructor(U,j){this._observable=U;this._counter=0;this._hasChanged=!1;let Q={onWillAddFirstListener:a(()=>{U.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{U.removeObserver(this)},"onDidRemoveLastListener")};j||e(Q),this.emitter=new vT(Q),j&&j.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(U){this._counter++}handlePossibleChange(U){}handleChange(U,j){this._hasChanged=!0}endUpdate(U){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(L,U){return new O(L,U).emitter.event}M.fromObservable=B,a(B,"fromObservable");function q(L){return(U,j,Q)=>{let Y=0,W=!1,V={beginUpdate(){Y++},endUpdate(){Y--,Y===0&&(L.reportChanges(),W&&(W=!1,U.call(j)))},handlePossibleChange(){},handleChange(){W=!0}};L.addObserver(V),L.reportChanges();let z={dispose(){L.removeObserver(V)}};return Q instanceof Fq?Q.add(z):Array.isArray(Q)&&Q.push(z),z}}M.fromObservableLight=q,a(q,"fromObservableLight")})(nRe||={});var bHt=class t{constructor(e){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${e}_${t._idPool++}`,t.all.add(this)}static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}start(e){this._stopWatch=new rZe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}},sTn=-1;var SHt=class t{constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e;this.threshold=r;this.name=n;this._warnCountdown=0}static{a(this,"LeakageMonitor")}static{this._idPool=1}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||r{if(t instanceof rde)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new bHt(e?.onListenerError??Bue,this._options?.leakWarningThreshold??oTn):void 0,this._perfMon=this._options?._profName?new CHt(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}static{a(this,"Emitter")}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(iTn){let e=this._listeners;queueMicrotask(()=>{uYo(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new THt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||Bue)(f),av.None}if(this._disposed)return av.None;r&&(e=e.bind(r));let o=new rde(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=rRe.create(),s=this._leakageMon.check(o.stack,this._size+1)),iTn&&(o.stack=c??rRe.create()),this._listeners?this._listeners instanceof rde?(this._deliveryQueue??=new IHt,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=WKe(()=>{s?.(),this._removeListener(o)});return n instanceof Fq?n.add(l):Array.isArray(n)&&n.push(l),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,n=r.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*lYo<=r.length){let s=0;for(let c=0;c0}};var IHt=class{constructor(){this.i=-1;this.end=0}static{a(this,"EventDeliveryQueuePrivate")}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}};var sTn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),dYo;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof xHt?!0:!o||typeof o!="object"?!1:typeof o.isCancellationRequested=="boolean"&&typeof o.onCancellationRequested=="function"}n.isCancellationToken=t,a(t,"isCancellationToken"),n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:nRe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:sTn})})(dYo||={});var xHt=class{constructor(){this._isCancelled=!1;this._emitter=null}static{a(this,"MutableToken")}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?sTn:(this._emitter||(this._emitter=new vT),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function pYo(t){return t}a(pYo,"identity");var nZe=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=pYo):(this._fn=r,this._computeKey=e.getCacheKey)}static{a(this,"LRUCachedFunction")}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};p();p();var tj=class{constructor(e){this.executor=e;this._didRun=!1}static{a(this,"Lazy")}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};p();function wHt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(wHt,"escapeRegExpCharacters");function dTn(t,e){if(!t||!e)return t;let r=e.length;if(r===0||t.length===0)return t;let n=0;for(;t.indexOf(e,n)===n;)n=n+r;return t.substring(n)}a(dTn,"ltrim");function iZe(t){return t.split(/\r\n|\r|\n/)}a(iZe,"splitLines");function RHt(t,e){return te?1:0}a(RHt,"compare");function oZe(t,e,r=0,n=t.length,o=0,s=e.length){for(;rd)return 1}let c=n-r,l=s-o;return cl?1:0}a(oZe,"compareSubstring");function kHt(t,e){return oRe(t,e,0,t.length,0,e.length)}a(kHt,"compareIgnoreCase");function oRe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return oZe(t.toLowerCase(),e.toLowerCase(),r,n,o,s);aTn(u)&&(u-=32),aTn(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(oRe,"compareSubstringIgnoreCase");function aTn(t){return t>=97&&t<=122}a(aTn,"isLowerAsciiLetter");function fTn(t,e){let r=e.length;return e.length>t.length?!1:oRe(t,e,0,r)===0}a(fTn,"startsWithIgnoreCase");function nde(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(hYo,"startsWithUTF8BOM");function pTn(t){return hYo(t)?t.substr(1):t}a(pTn,"stripUTF8BOM");var cTn=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=mYo()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(er[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function mYo(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(mYo,"getGraphemeBreakRawData");var lTn=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new tj(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))}static{this.cache=new nZe({getCacheKey:JSON.stringify},e=>{function r(f){let h=new Map;for(let m=0;m!f.startsWith("_")&&f in s);c.length===0&&(c=["_default"]);let l;for(let f of c){let h=r(s[f]);l=o(l,h)}let u=r(s._common),d=n(u,l);return new t(d)})}static getInstance(e){return t.cache.get(Array.from(e))}static{this._locales=new tj(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;rhTn)return{status:"notfound",message:"File too large"};let c=await Pue(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:iT.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=oo(e);if(ga.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(ga),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof Ic))throw c}let o=(await this.ctx.get(Go).stat(e)).size/1024/1024;return o>hTn?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(i5).getEncodingForFile(e)}catch(o){if(!(o instanceof Ic))throw o}let n=await this.ctx.get(Go).readFileString(e,r);return pTn(n)}};p();function aRe(t){for(var e=[],r=1;r{if(t instanceof nde)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new SHt(e?.onListenerError??Fue,this._options?.leakWarningThreshold??sTn):void 0,this._perfMon=this._options?._profName?new bHt(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}static{a(this,"Emitter")}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(oTn){let e=this._listeners;queueMicrotask(()=>{fYo(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new IHt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||Fue)(f),av.None}if(this._disposed)return av.None;r&&(e=e.bind(r));let o=new nde(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=rRe.create(),s=this._leakageMon.check(o.stack,this._size+1)),oTn&&(o.stack=c??rRe.create()),this._listeners?this._listeners instanceof nde?(this._deliveryQueue??=new xHt,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=WKe(()=>{s?.(),this._removeListener(o)});return n instanceof Fq?n.add(l):Array.isArray(n)&&n.push(l),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,n=r.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*dYo<=r.length){let s=0;for(let c=0;c0}};var xHt=class{constructor(){this.i=-1;this.end=0}static{a(this,"EventDeliveryQueuePrivate")}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}};var aTn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),pYo;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof wHt?!0:!o||typeof o!="object"?!1:typeof o.isCancellationRequested=="boolean"&&typeof o.onCancellationRequested=="function"}n.isCancellationToken=t,a(t,"isCancellationToken"),n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:nRe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:aTn})})(pYo||={});var wHt=class{constructor(){this._isCancelled=!1;this._emitter=null}static{a(this,"MutableToken")}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?aTn:(this._emitter||(this._emitter=new vT),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function mYo(t){return t}a(mYo,"identity");var nZe=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=mYo):(this._fn=r,this._computeKey=e.getCacheKey)}static{a(this,"LRUCachedFunction")}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};p();p();var tj=class{constructor(e){this.executor=e;this._didRun=!1}static{a(this,"Lazy")}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};p();function RHt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(RHt,"escapeRegExpCharacters");function fTn(t,e){if(!t||!e)return t;let r=e.length;if(r===0||t.length===0)return t;let n=0;for(;t.indexOf(e,n)===n;)n=n+r;return t.substring(n)}a(fTn,"ltrim");function iZe(t){return t.split(/\r\n|\r|\n/)}a(iZe,"splitLines");function kHt(t,e){return te?1:0}a(kHt,"compare");function oZe(t,e,r=0,n=t.length,o=0,s=e.length){for(;rd)return 1}let c=n-r,l=s-o;return cl?1:0}a(oZe,"compareSubstring");function PHt(t,e){return oRe(t,e,0,t.length,0,e.length)}a(PHt,"compareIgnoreCase");function oRe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return oZe(t.toLowerCase(),e.toLowerCase(),r,n,o,s);cTn(u)&&(u-=32),cTn(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(oRe,"compareSubstringIgnoreCase");function cTn(t){return t>=97&&t<=122}a(cTn,"isLowerAsciiLetter");function pTn(t,e){let r=e.length;return e.length>t.length?!1:oRe(t,e,0,r)===0}a(pTn,"startsWithIgnoreCase");function ide(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(gYo,"startsWithUTF8BOM");function hTn(t){return gYo(t)?t.substr(1):t}a(hTn,"stripUTF8BOM");var lTn=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=AYo()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(er[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function AYo(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(AYo,"getGraphemeBreakRawData");var uTn=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new tj(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))}static{this.cache=new nZe({getCacheKey:JSON.stringify},e=>{function r(f){let h=new Map;for(let m=0;m!f.startsWith("_")&&f in s);c.length===0&&(c=["_default"]);let l;for(let f of c){let h=r(s[f]);l=o(l,h)}let u=r(s._common),d=n(u,l);return new t(d)})}static getInstance(e){return t.cache.get(Array.from(e))}static{this._locales=new tj(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;rmTn)return{status:"notfound",message:"File too large"};let c=await Due(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:iT.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=oo(e);if(ga.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(ga),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof Ic))throw c}let o=(await this.ctx.get(Go).stat(e)).size/1024/1024;return o>mTn?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(i5).getEncodingForFile(e)}catch(o){if(!(o instanceof Ic))throw o}let n=await this.ctx.get(Go).readFileString(e,r);return hTn(n)}};p();function aRe(t){for(var e=[],r=1;rr.status!=="in-progress"&&(r.response===void 0||r.response?.type==="model")),e}a(mTn,"filterConversationTurns");function DHt(t){return mTn(t).getLastTurn()?.id}a(DHt,"getLastTurnId");async function gTn(t){let e=mTn(t.conversation),r=DHt(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(I0).getDump(r),s=yYo(o,e.turns);Br.debug(t.ctx,`conversation.dump +`)),c+=h+n[u+1]}),c}a(aRe,"dedent");var ls=aRe;var DHt=class{constructor(){this.resolvedSkills={};this.resolutions=[]}static{a(this,"SkillDump")}},x0=class{constructor(){this.dump=new Sn(25);this.promptsDump=new Sn(1)}static{a(this,"ConversationDumper")}addResolvedSkill(e,r,n){let o=this.getDump(e);o.resolvedSkills[r]=n}getResolvedSkill(e,r){return this.getDump(e).resolvedSkills[r]}addResolution(e,r){this.getDump(e).resolutions.push(r)}getDump(e){let r=this.dump.get(e);return r||(r=new DHt,this.dump.set(e,r)),r}addPrompt(e,r,n){let o=this.promptsDump.get(e);o===void 0&&(o=new Map,this.promptsDump.set(e,o)),o.set(n,r)}getLastTurnPrompts(){if(this.promptsDump===void 0)return;let e=this.promptsDump.values().next();if(!e.done)return e.value}};function gTn(t){let e=t.copy();return e.turns=e.turns.filter(r=>r.status!=="in-progress"&&(r.response===void 0||r.response?.type==="model")),e}a(gTn,"filterConversationTurns");function NHt(t){return gTn(t).getLastTurn()?.id}a(NHt,"getLastTurnId");async function ATn(t){let e=gTn(t.conversation),r=NHt(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(x0).getDump(r),s=EYo(o,e.turns);Fr.debug(t.ctx,`conversation.dump `,` -`+s);let c=await _Yo(o,t.ctx);return ls` - ${AYo(t.conversation,r)} - ${gYo(t.ctx)} +`+s);let c=await vYo(o,t.ctx);return ls` + ${_Yo(t.conversation,r)} + ${yYo(t.ctx)} The following code can be copied into a chat simulation \`yml\` file. This response has not polluted the conversation history and did not cause any model roundtrip. \`\`\`yaml ${s} \`\`\`${c?` ${c}`:""} - `}a(gTn,"getConversationDump");function gYo(t){let e=t.get(Ir);return ls` + `}a(ATn,"getConversationDump");function yYo(t){let e=t.get(Ir);return ls` - IDE: \`${e.getEditorInfo().name} (${e.getEditorInfo().version})\` - Plugin: \`${e.getEditorPluginInfo().version}\` - `}a(gYo,"getEditorInfoDumpMessage");function AYo(t,e){return ls` + `}a(yYo,"getEditorInfoDumpMessage");function _Yo(t,e){return ls` Debug information for the last turn of the conversation. - ConversationId: \`${t.id}\` - MessageId: \`${e}\` - `}a(AYo,"getInfoDumpMessage");async function ATn(t,e,r){let n=t.ctx.get(fm),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(Xo).getSupportedSkills(t.conversation.id).includes(c.id));if(r&&(s=s.filter(c=>c.id===r)),s.length===0)return`No skill with id ${r} available`;for(let c of s)o+=` + `}a(_Yo,"getInfoDumpMessage");async function yTn(t,e,r){let n=t.ctx.get(fm),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(Xo).getSupportedSkills(t.conversation.id).includes(c.id));if(r&&(s=s.filter(c=>c.id===r)),s.length===0)return`No skill with id ${r} available`;for(let c of s)o+=` - ${c.id}`;t.turn.request.message&&Mn(t.turn.request.message).trim().length>0&&(o+=` **User message**: ${Mn(t.turn.request.message)}`);for(let c of s){o+=` @@ -2634,7 +2634,7 @@ ${c}`:""} **Resolution** \`\`\`yaml - ${uJ(u)} + ${dJ(u)} \`\`\``;let d=await l?.processor(t).processSkill(u,t);if(d){let f=typeof d=="string"?d:d.elide(1e3).getText();o+=ls` \n\n **Processed value** @@ -2643,17 +2643,17 @@ ${c}`:""} **Unprocessable**`}else o+=` -**Unresolvable**`}return o}a(ATn,"getSkillsDump");function yYo(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:Mn(n.request.message)};return n.response&&(s.response=Mn(n.response.message)),s})};return uJ(r)}a(yYo,"toSimulationFormat");async function _Yo(t,e){let r=t.resolutions.map(s=>s.files).flat(),n=r.filter((s,c)=>s&&r.indexOf(s)===c),o;for(let s of n)if(s&&s.status==="included"){o||(o=`The following files have been used: -`);let c=await e.get(si).getOrReadTextDocument(s),l;c.status==="valid"&&(l=c.document);let u=l?.getText();Br.debug(e,`conversation.dump.file +**Unresolvable**`}return o}a(yTn,"getSkillsDump");function EYo(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:Mn(n.request.message)};return n.response&&(s.response=Mn(n.response.message)),s})};return dJ(r)}a(EYo,"toSimulationFormat");async function vYo(t,e){let r=t.resolutions.map(s=>s.files).flat(),n=r.filter((s,c)=>s&&r.indexOf(s)===c),o;for(let s of n)if(s&&s.status==="included"){o||(o=`The following files have been used: +`);let c=await e.get(si).getOrReadTextDocument(s),l;c.status==="valid"&&(l=c.document);let u=l?.getText();Fr.debug(e,`conversation.dump.file `,u),o+=` **${s.uri}** \`\`\`${l?.detectedLanguageId} ${u} -\`\`\``}return o}a(_Yo,"fileDump");p();function NHt(t,e){let r=Ms(e.tokenizer),n=0;for(let o of t)n+=e.baseTokensPerMessage,o.role&&(n+=r.tokenize(o.role).length),o.name&&(n+=r.tokenize(o.name).length+e.baseTokensPerName),o.content&&(n+=r.tokenize(Mn(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(NHt,"countMessagesTokens");p();function yTn(t,e,r,n,o){let s=["You are an AI programming assistant.",'When asked for your name, you must respond with "GitHub Copilot".',"Follow the user's requirements carefully & to the letter.","Follow Microsoft content policies.","Avoid content that violates copyrights.",`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,"Keep your answers short and impersonal.","You can answer general programming questions and perform the following tasks:","* Ask a question about the files in your current workspace","* Explain how the code in your active editor works","* Make changes to existing code","* Review the selected code in your active editor","* Generate unit tests for the selected code","* Propose a fix for the problems in the selected code","* Scaffold code for a new file or project in a workspace","* Create a new Jupyter Notebook","* Ask questions about VS Code","* Generate query parameters for workspace search","* Ask how to do something in the terminal","* Explain what just happened in the terminal"].join(` +\`\`\``}return o}a(vYo,"fileDump");p();function MHt(t,e){let r=Ms(e.tokenizer),n=0;for(let o of t)n+=e.baseTokensPerMessage,o.role&&(n+=r.tokenize(o.role).length),o.name&&(n+=r.tokenize(o.name).length+e.baseTokensPerName),o.content&&(n+=r.tokenize(Mn(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(MHt,"countMessagesTokens");p();function _Tn(t,e,r,n,o){let s=["You are an AI programming assistant.",'When asked for your name, you must respond with "GitHub Copilot".',"Follow the user's requirements carefully & to the letter.","Follow Microsoft content policies.","Avoid content that violates copyrights.",`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,"Keep your answers short and impersonal.","You can answer general programming questions and perform the following tasks:","* Ask a question about the files in your current workspace","* Explain how the code in your active editor works","* Make changes to existing code","* Review the selected code in your active editor","* Generate unit tests for the selected code","* Propose a fix for the problems in the selected code","* Scaffold code for a new file or project in a workspace","* Create a new Jupyter Notebook","* Ask questions about VS Code","* Generate query parameters for workspace search","* Ask how to do something in the terminal","* Explain what just happened in the terminal"].join(` `),c=["The active document is the source code the user is looking at right now.","You have read access to the code in the active document, files the user has recently worked with and open tabs. You are able to retrieve, read and use this code to answer questions.","You cannot retrieve code that is outside of the current project.","You can only give one reply for each conversation turn."].join(` `),l=e?`The user works in an IDE called ${e} which can be used to edit code, run and debug the user's application as well as executing tests.`:"",u=n?`The user is using ${n} as their operating system.`:"",d=o?`You use the ${o} large language model.`:"",f=r?`The user is logged in as ${r} on GitHub.`:"";return[s,u,d,f,l,c].filter(h=>h&&h!="").join(` -`)}a(yTn,"chatBasePrompt");p();p();async function rj(t){return!!(await t.get(Qt).getToken()).userInfo?.isTBBEnabled}a(rj,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function aZe(t){return!!t&&typeof t.then=="function"}a(aZe,"isThenable");var sZe=class{constructor(e,r){this._isDisposed=!1;this._token=-1,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}static{a(this,"TimeoutTimer")}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,r){if(this._isDisposed)throw new Yc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Yc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var EYo;(r=>{async function t(n){let o,s=await Promise.all(n.map(c=>c.then(l=>l,l=>{o||(o=l)})));if(typeof o<"u")throw o;return s}r.settled=t,a(t,"settled");function e(n){return new Promise(async(o,s)=>{try{await n(o,s)}catch(c){s(c)}})}r.withAsyncBody=e,a(e,"withAsyncBody")})(EYo||={});var _Tn=class t{static{a(this,"AsyncIterableObject")}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new vT,queueMicrotask(async()=>{let n={emitOne:a(o=>this.emitOne(o),"emitOne"),emitMany:a(o=>this.emitMany(o),"emitMany"),reject:a(o=>this.reject(o),"reject")};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:a(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}map(e){return t.map(this,e)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static async toPromise(e){let r=[];for await(let n of e)r.push(n);return r}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};p();p();p();p();var cZe=!1,lZe=!1,cRe=!1,vYo=!1,CYo=!1,ETn=!1,bYo=!1,SYo=!1,TYo=!1,IYo=!1;var CF,bF=globalThis,Tw;typeof bF.vscode<"u"&&typeof bF.vscode.process<"u"?Tw=bF.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Tw=process);var vTn=typeof Tw?.versions?.electron=="string",xYo=vTn&&Tw?.type==="renderer";typeof Tw=="object"?(cZe=Tw.platform==="win32",lZe=Tw.platform==="darwin",cRe=Tw.platform==="linux",vYo=cRe&&!!Tw.env.SNAP&&!!Tw.env.SNAP_REVISION,bYo=vTn,TYo=!!Tw.env.CI||!!Tw.env.BUILD_ARTIFACTSTAGINGDIRECTORY,CYo=!0):typeof navigator=="object"&&!xYo?(CF=navigator.userAgent,cZe=CF.indexOf("Windows")>=0,lZe=CF.indexOf("Macintosh")>=0,SYo=(CF.indexOf("Macintosh")>=0||CF.indexOf("iPad")>=0||CF.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,cRe=CF.indexOf("Linux")>=0,IYo=CF?.indexOf("Mobi")>=0,ETn=!0):console.error("Unable to resolve platform.");var MHt=0;lZe?MHt=1:cZe?MHt=3:cRe&&(MHt=2);var OHt=cZe,CTn=lZe,bTn=cRe;var wYo=ETn&&typeof bF.importScripts=="function",Jud=wYo?bF.origin:void 0;var s5=CF;var RYo=typeof bF.postMessage=="function"&&!bF.importScripts,Zud=(()=>{if(RYo){let t=[];bF.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),bF.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var kYo=!!(s5&&s5.indexOf("Chrome")>=0),Xud=!!(s5&&s5.indexOf("Firefox")>=0),edd=!!(!kYo&&s5&&s5.indexOf("Safari")>=0),tdd=!!(s5&&s5.indexOf("Edg/")>=0),rdd=!!(s5&&s5.indexOf("Android")>=0);var OJ,LHt=globalThis.vscode;if(typeof LHt<"u"&&typeof LHt.process<"u"){let t=LHt.process;OJ={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?OJ={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:OJ={get platform(){return OHt?"win32":CTn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var lRe=OJ.cwd,STn=OJ.env,TTn=OJ.platform,cdd=OJ.arch;var DYo=65,NYo=97,MYo=90,OYo=122,oj=46,x0=47,lb=92,nj=58,LYo=63,uZe=class extends Error{static{a(this,"ErrorInvalidArgType")}constructor(e,r,n){let o;typeof r=="string"&&r.indexOf("not ")===0?(o="must not be",r=r.replace(/^not /,"")):o="must be";let s=e.indexOf(".")!==-1?"property":"argument",c=`The "${e}" ${s} ${o} of type ${r}`;c+=`. Received type ${typeof n}`,super(c),this.code="ERR_INVALID_ARG_TYPE"}};function BYo(t,e){if(t===null||typeof t!="object")throw new uZe(e,"Object",t)}a(BYo,"validateObject");function hp(t,e){if(typeof t!="string")throw new uZe(e,"string",t)}a(hp,"validateString");var ub=TTn==="win32";function us(t){return t===x0||t===lb}a(us,"isPathSeparator");function BHt(t){return t===x0}a(BHt,"isPosixPathSeparator");function ij(t){return t>=DYo&&t<=MYo||t>=NYo&&t<=OYo}a(ij,"isWindowsDeviceRoot");function dZe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===oj&&l!==-1?++l:l=-1}return o}a(dZe,"normalizeString");function FYo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(FYo,"formatExt");function ITn(t,e){BYo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${FYo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(ITn,"_format");var pm={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],hp(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=lRe():(s=STn[`=${e}`]||lRe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===lb)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)us(f)&&(l=1,d=!0);else if(us(f))if(d=!0,us(s.charCodeAt(1))){let h=2,m=h;for(;h2&&us(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=dZe(r,!n,"\\",us),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){hp(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return BHt(s)?"\\":t;if(us(s))if(o=!0,us(t.charCodeAt(1))){let l=2,u=l;for(;l2&&us(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&us(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){hp(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return us(r)||e>2&&ij(r)&&t.charCodeAt(1)===nj&&us(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&us(r.charCodeAt(0))){++o;let s=r.length;s>1&&us(r.charCodeAt(1))&&(++o,s>2&&(us(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return pm.normalize(e)},relative(t,e){if(hp(t,"from"),hp(e,"to"),t===e)return"";let r=pm.resolve(t),n=pm.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===lb;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===lb;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===lb)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===lb?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===lb)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===lb&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=pm.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===lb){if(e.charCodeAt(1)===lb){let r=e.charCodeAt(2);if(r!==LYo&&r!==oj)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(ij(e.charCodeAt(0))&&e.charCodeAt(1)===nj&&e.charCodeAt(2)===lb)return`\\\\?\\${e}`;return t},dirname(t){hp(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return us(o)?t:".";if(us(o)){if(r=n=1,us(t.charCodeAt(1))){let l=2,u=l;for(;l2&&us(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(us(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&hp(e,"suffix"),hp(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&ij(t.charCodeAt(0))&&t.charCodeAt(1)===nj&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(us(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(us(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){hp(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===nj&&ij(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(us(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===oj?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:ITn.bind(null,"\\"),parse(t){hp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return us(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(us(o)){if(n=1,us(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),us(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===oj?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},UYo=(()=>{if(ub){let t=/\\/g;return()=>{let e=lRe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>lRe()})(),Nf={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:UYo();hp(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===x0)}return e=dZe(e,!r,"/",BHt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(hp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===x0,r=t.charCodeAt(t.length-1)===x0;return t=dZe(t,!e,"/",BHt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return hp(t,"path"),t.length>0&&t.charCodeAt(0)===x0},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":Nf.normalize(e)},relative(t,e){if(hp(t,"from"),hp(e,"to"),t===e||(t=Nf.resolve(t),e=Nf.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===x0)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===x0?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===x0)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(hp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===x0,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===x0){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&hp(e,"ext"),hp(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===x0){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===x0){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){hp(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===x0){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===oj?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:ITn.bind(null,"/"),parse(t){hp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===x0,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===x0){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===oj?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Nf.win32=pm.win32=pm;Nf.posix=pm.posix=Nf;var QYo=ub?pm.normalize:Nf.normalize,qYo=ub?pm.isAbsolute:Nf.isAbsolute,fZe=ub?pm.join:Nf.join,udd=ub?pm.resolve:Nf.resolve,ddd=ub?pm.relative:Nf.relative,fdd=ub?pm.dirname:Nf.dirname,xTn=ub?pm.basename:Nf.basename,wTn=ub?pm.extname:Nf.extname,pdd=ub?pm.format:Nf.format,hdd=ub?pm.parse:Nf.parse,mdd=ub?pm.toNamespacedPath:Nf.toNamespacedPath,LJ=ub?pm.sep:Nf.sep,gdd=ub?pm.delimiter:Nf.delimiter;p();p();function BJ(t,e="unexpected state"){if(!t)throw new Yc(`Assertion Failed: ${e}`)}a(BJ,"assert");function FHt(t){if(!t()){debugger;t(),Bue(new Yc("Assertion Failed"))}}a(FHt,"assertFn");function uRe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!fTn(t,e))return!1;if(e.length===t.length)return!0;let s=e.length;return e.charAt(e.length-1)===n&&s--,t.charAt(s)===n}return e.charAt(e.length-1)!==n&&(e+=n),t.indexOf(e)===0}a(RTn,"isEqualOrParent");var pZe="**",kTn="/",hZe="[/\\\\]",mZe="[^/\\\\]",HYo=/\//g;function PTn(t,e){switch(t){case 0:return"";case 1:return`${mZe}*?`;default:return`(?:${hZe}|${mZe}+${hZe}${e?`|${hZe}${mZe}+`:""})*?`}}a(PTn,"starsToRegExp");function dRe(t,e){if(!t)return[];let r=[],n=!1,o=!1,s="";for(let c of t){switch(c){case e:if(!n&&!o){r.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=c}return s&&r.push(s),r}a(dRe,"splitGlobAware");function OTn(t){if(!t)return"";let e="",r=dRe(t,kTn);if(r.every(n=>n===pZe))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===pZe){if(n)return;e+=PTn(2,s===r.length-1)}else{let c=!1,l="",u=!1,d="";for(let f of o){if(f!=="}"&&c){l+=f;continue}if(u&&(f!=="]"||!d)){let h;f==="-"?h=f:(f==="^"||f==="!")&&!d?h="^":f===kTn?h="":h=wHt(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${dRe(l,",").map(g=>OTn(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=mZe;continue;case"*":e+=PTn(1);continue;default:e+=wHt(f)}}sqHt(l,e)).filter(l=>l!==_2),t),n=r.length;if(!n)return _2;if(n===1)return r[0];let o=a(function(l,u){for(let d=0,f=r.length;d!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(ZYo,"trivia3");function MTn(t,e,r){let n=LJ===Nf.sep,o=n?t:t.replace(HYo,LJ),s=LJ+o,c=Nf.sep+t,l;return r?l=a(function(u,d){return typeof u=="string"&&(u===o||u.endsWith(s)||!n&&(u===t||u.endsWith(c)))?e:null},"parsedPattern"):l=a(function(u,d){return typeof u=="string"&&(u===o||!n&&u===t)?e:null},"parsedPattern"),l.allPaths=[(r?"*/":"./")+t],l}a(MTn,"trivia4and5");function XYo(t){try{let e=new RegExp(`^${OTn(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return _2}}a(XYo,"toRegExp");function BTn(t,e,r){return!t||typeof e!="string"?!1:jHt(t)(e,void 0,r)}a(BTn,"match");function jHt(t,e={}){if(!t)return QHt;if(typeof t=="string"||eKo(t)){let r=qHt(t,e);if(r===_2)return QHt;let n=a(function(o,s){return!!r(o,s)},"resultPattern");return r.allBasenames&&(n.allBasenames=r.allBasenames),r.allPaths&&(n.allPaths=r.allPaths),n}return tKo(t,e)}a(jHt,"parse");function eKo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(eKo,"isRelativePattern");function tKo(t,e){let r=FTn(Object.getOwnPropertyNames(t).map(l=>rKo(l,t[l],e)).filter(l=>l!==_2)),n=r.length;if(!n)return _2;if(!r.some(l=>!!l.requiresSiblings)){if(n===1)return r[0];let l=a(function(f,h){let m;for(let g=0,A=r.length;g{for(let g of m){let A=await g;if(typeof A=="string")return A}return null})():null},"resultExpression"),u=r.find(f=>!!f.allBasenames);u&&(l.allBasenames=u.allBasenames);let d=r.reduce((f,h)=>h.allPaths?f.concat(h.allPaths):f,[]);return d.length&&(l.allPaths=d),l}let o=a(function(l,u,d){let f,h;for(let m=0,g=r.length;m{for(let m of h){let g=await m;if(typeof g=="string")return g}return null})():null},"resultExpression"),s=r.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(tKo,"parsedExpression");function rKo(t,e,r){if(e===!1)return _2;let n=qHt(t,r);if(n===_2)return _2;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let s=a((c,l,u,d)=>{if(!d||!n(c,l))return null;let f=o.replace("$(basename)",()=>u),h=d(f);return aZe(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(rKo,"parseExpressionPattern");function FTn(t,e){let r=t.filter(l=>!!l.basenames);if(r.length<2)return t;let n=r.reduce((l,u)=>{let d=u.basenames;return d?l.concat(d):l},[]),o;if(e){o=[];for(let l=0,u=n.length;l{let d=u.patterns;return d?l.concat(d):l},[]);let s=a(function(l,u){if(typeof l!="string")return null;if(!u){let f;for(f=l.length;f>0;f--){let h=l.charCodeAt(f-1);if(h===47||h===92)break}u=l.substr(f)}let d=n.indexOf(u);return d!==-1?o[d]:null},"aggregate");s.basenames=n,s.patterns=o,s.allBasenames=n;let c=t.filter(l=>!l.basenames);return c.push(s),c}a(FTn,"aggregateBasenameMatches");function UTn(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return nKo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(UTn,"validate");function QTn(t,e){let r=dRe(e,","),n=a(o=>{if(o=o.trim(),o.length!==0){if(o==="**"||o==="**/*"||o==="*")return{pattern:o};!o.startsWith("/")&&!o.startsWith("**/")&&(o="**/"+o);for(let s of t)if(BTn(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(QTn,"matches");function nKo(t){try{let e=dRe(t,",");if(e.length===0)return!1;for(let r of e){let n=jHt(r);if(LTn(n))return!1}return!0}catch{return!1}}a(nKo,"isValidGlob");var jTn=fe(require("path"));var hm={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var GHt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??ro(n.uri).replace(".instructions.md","")}static{a(this,"CustomInstruction")}get metadata(){return this.promptFileEntry.promptPath.metadata}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get matchKind(){return this.metadata?.length?this.metadata.some(e=>e.matchKind==="ApplyToPattern")?"ApplyToPattern":"AlwaysApplied":"ApplyToPattern"}get source(){if(this.metadata?.length)return this.metadata.map(e=>e.source)}get providers(){return c2(this.metadata)}get uri(){return this.parsedPromptFile.uri}get name(){return this._name}get applyTo(){return this.parsedPromptFile.header?.applyTo||void 0}get description(){return this.promptFileEntry.promptPath.description??this.parsedPromptFile.header?.description}get content(){return this.parsedPromptFile.body?.content??""}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||Oue(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return Dq(this.promptFileEntry.promptPath)}},HTn={name:"copilot-instructions",source:hm.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},GTn={name:"git-commit-instructions",source:hm.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},$Tn={name:"agents-md-instructions",source:hm.agentsMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CODEX"],defaultRegistration:["AGENTS.md"]},iKo={name:"nested-agents-md-instructions",source:hm.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CODEX"],defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},VTn={name:"claude-md-instructions",source:hm.claudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},oKo={name:"nested-claude-md-instructions",source:hm.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},sKo=[HTn,GTn,$Tn,iKo,VTn,oKo],aKo={name:"instruction-file",source:hm.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},HHt={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},cKo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function qTn(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(qTn,"optionKey");function $Ht(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=qTn(n);if(!(o in HHt)||(r=!0,!(e[o]??HHt[o])))continue;let c=cKo[n];if(c){let l=qTn(c);if(!(e[l]??HHt[l]))continue}return!0}return r?!1:void 0}a($Ht,"shouldIncludeSource");var VHt=class{constructor(){this.store=new Map}static{a(this,"InMemoryInstructionManager")}set(e,r){r.length===0?this.store.delete(e):this.store.set(e,r)}get(e){return this.store.get(e)??[]}getAll(e){let r=[];for(let[n,o]of this.store)$Ht([n],e)!==!1&&r.push(...o);return r}},lKo=new GO;function uKo(t,e,r,n,o){if(!t)return;let s=`${Pq}${e}`,c=lKo.parse(s,t),l=c.body?.content??t;if(l.trim())return{matchKind:r,uri:s,name:c.header?.name??e,applyTo:c.header?.applyTo||void 0,description:c.header?.description,content:l,isReadonly:!0,isBuiltIn:!1,source:[n],providers:c2(o?[{providers:o}]:void 0)}}a(uKo,"resolveContent");var FJ=class{constructor(e,r,n){this.descriptor=e;this.manager=r;this.registry=n;this.configsByKey=new Map}static{a(this,"InstructionSlot")}set(e,r="default"){let n=Array.isArray(e)?e:e?[e]:[];this.configsByKey.set(r,n);let o=[];for(let g of this.configsByKey.values())o.push(...g);let{name:s,matchKind:c,source:l}=this.descriptor,u=this.descriptor.providers,d=o.filter(g=>g.type==="content").map(g=>{let A=g.content?.trim();return A?uKo(A,`global-${s}`,c,l,u):void 0}).filter(g=>g!==void 0);this.manager.set(l,d);let f={source:l,matchKind:c,providers:u},h=this.descriptor.globSuffix??"",m=new Set;for(let g of this.descriptor.defaultRegistration??[])m.add(g);for(let g of o)g.type==="location"?m.add(jTn.default.posix.join(g.path,h)):g.type==="file"&&m.add(un(g.uri));this._registryDisposable=this.registry.replace(this._registryDisposable,"instructions",Array.from(m),{watchable:this.descriptor.watchable??!0,cacheable:this.descriptor.cacheable??!0,metadata:f})}};function dKo(t){switch(t.type){case"content":return{type:"content",content:t.content};case"file":return{type:"file",uri:t.uri};case"location":return{type:"location",path:t.path}}}a(dKo,"stripSource");var fKo="workspace",Mf=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new VHt;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[hm.copilotInstructions,new FJ(HTn,this.inMemoryManager,n)],[hm.gitCommitInstructions,new FJ(GTn,this.inMemoryManager,n)],[hm.agentsMdInstructions,new FJ($Tn,this.inMemoryManager,n)],[hm.claudeMdInstructions,new FJ(VTn,this.inMemoryManager,n)],[hm.customInstructionFiles,new FJ(aKo,this.inMemoryManager,n)]]);for(let o of sKo)o.defaultRegistration&&n.register("instructions",o.defaultRegistration,{watchable:o.watchable??!0,cacheable:o.cacheable??!0,metadata:{source:o.source,matchKind:o.matchKind,providers:o.providers}});this.slotsBySource.get(hm.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e,r){return(await this.ctx.get(y0).collect(this.ctx,"instructions",e,{includePlugins:r?.includePlugins})).map(o=>new GHt(o))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=fKo){this.dispatchToSlots(e,r)}dispatchToSlots(e,r){let n=Array.isArray(e)?e:[],o=new Map;for(let s of n){let c;if(s.source===void 0)c=hm.customInstructionFiles;else if(this.slotsBySource.has(s.source))c=s.source;else{Br.warn(this.ctx,`Ignoring instruction setting with unknown source "${String(s.source)}".`);continue}let l=o.get(c)??[];l.push(dKo(s)),o.set(c,l)}for(let[s,c]of this.slotsBySource)c.set(o.get(s)??[],r)}setGlobalInstructionFiles(e){let r=(e??[]).map(n=>({...n,source:hm.customInstructionFiles}));this.dispatchToSlots(r,"global-instruction-files")}getGlobalInstructionFiles(){return this.inMemoryManager.get(hm.customInstructionFiles)}setGlobalCopilotInstructions(e){let r=e?[{...e,source:hm.copilotInstructions}]:[];this.dispatchToSlots(r,"global-copilot-instructions")}setGlobalGitCommitInstructions(e){let r=e?[{...e,source:hm.gitCommitInstructions}]:[];this.dispatchToSlots(r,"global-git-commit-instructions")}setGlobalAgentsMdInstructions(e){let r=e?[{...e,source:hm.agentsMdInstructions}]:[];this.dispatchToSlots(r,"global-agents-md-instructions")}setGlobalClaudeMdInstructions(e){let r=e?[{...e,source:hm.claudeMdInstructions}]:[];this.dispatchToSlots(r,"global-claude-md-instructions")}async collectAllInstructions(e,r,n={},o){let s=[];for(let c of this.inMemoryManager.getAll(n))this.matchesApplyTo(c,o)&&s.push(c);for(let c of await this.listCustomInstructions(r))this.shouldIncludeRegisteredInstruction(c,n,o)&&s.push(c);return this.emitCollectedTelemetry(s,n),s}static formatInstructions(e,r={}){if(!e||e.length===0)return;let n=[];for(let s of e)s.content.trim()&&n.push(` +`)}a(_Tn,"chatBasePrompt");p();p();async function rj(t){return!!(await t.get(Qt).getToken()).userInfo?.isTBBEnabled}a(rj,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function aZe(t){return!!t&&typeof t.then=="function"}a(aZe,"isThenable");var sZe=class{constructor(e,r){this._isDisposed=!1;this._token=-1,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}static{a(this,"TimeoutTimer")}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,r){if(this._isDisposed)throw new Yc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Yc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var CYo;(r=>{async function t(n){let o,s=await Promise.all(n.map(c=>c.then(l=>l,l=>{o||(o=l)})));if(typeof o<"u")throw o;return s}r.settled=t,a(t,"settled");function e(n){return new Promise(async(o,s)=>{try{await n(o,s)}catch(c){s(c)}})}r.withAsyncBody=e,a(e,"withAsyncBody")})(CYo||={});var ETn=class t{static{a(this,"AsyncIterableObject")}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new vT,queueMicrotask(async()=>{let n={emitOne:a(o=>this.emitOne(o),"emitOne"),emitMany:a(o=>this.emitMany(o),"emitMany"),reject:a(o=>this.reject(o),"reject")};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:a(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}map(e){return t.map(this,e)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static async toPromise(e){let r=[];for await(let n of e)r.push(n);return r}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};p();p();p();p();var cZe=!1,lZe=!1,cRe=!1,bYo=!1,SYo=!1,vTn=!1,TYo=!1,IYo=!1,xYo=!1,wYo=!1;var CF,bF=globalThis,Tw;typeof bF.vscode<"u"&&typeof bF.vscode.process<"u"?Tw=bF.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Tw=process);var CTn=typeof Tw?.versions?.electron=="string",RYo=CTn&&Tw?.type==="renderer";typeof Tw=="object"?(cZe=Tw.platform==="win32",lZe=Tw.platform==="darwin",cRe=Tw.platform==="linux",bYo=cRe&&!!Tw.env.SNAP&&!!Tw.env.SNAP_REVISION,TYo=CTn,xYo=!!Tw.env.CI||!!Tw.env.BUILD_ARTIFACTSTAGINGDIRECTORY,SYo=!0):typeof navigator=="object"&&!RYo?(CF=navigator.userAgent,cZe=CF.indexOf("Windows")>=0,lZe=CF.indexOf("Macintosh")>=0,IYo=(CF.indexOf("Macintosh")>=0||CF.indexOf("iPad")>=0||CF.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,cRe=CF.indexOf("Linux")>=0,wYo=CF?.indexOf("Mobi")>=0,vTn=!0):console.error("Unable to resolve platform.");var OHt=0;lZe?OHt=1:cZe?OHt=3:cRe&&(OHt=2);var LHt=cZe,bTn=lZe,STn=cRe;var kYo=vTn&&typeof bF.importScripts=="function",Xud=kYo?bF.origin:void 0;var s5=CF;var PYo=typeof bF.postMessage=="function"&&!bF.importScripts,edd=(()=>{if(PYo){let t=[];bF.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),bF.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var DYo=!!(s5&&s5.indexOf("Chrome")>=0),tdd=!!(s5&&s5.indexOf("Firefox")>=0),rdd=!!(!DYo&&s5&&s5.indexOf("Safari")>=0),ndd=!!(s5&&s5.indexOf("Edg/")>=0),idd=!!(s5&&s5.indexOf("Android")>=0);var LJ,BHt=globalThis.vscode;if(typeof BHt<"u"&&typeof BHt.process<"u"){let t=BHt.process;LJ={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?LJ={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:LJ={get platform(){return LHt?"win32":bTn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var lRe=LJ.cwd,TTn=LJ.env,ITn=LJ.platform,udd=LJ.arch;var MYo=65,OYo=97,LYo=90,BYo=122,oj=46,w0=47,lb=92,nj=58,FYo=63,uZe=class extends Error{static{a(this,"ErrorInvalidArgType")}constructor(e,r,n){let o;typeof r=="string"&&r.indexOf("not ")===0?(o="must not be",r=r.replace(/^not /,"")):o="must be";let s=e.indexOf(".")!==-1?"property":"argument",c=`The "${e}" ${s} ${o} of type ${r}`;c+=`. Received type ${typeof n}`,super(c),this.code="ERR_INVALID_ARG_TYPE"}};function UYo(t,e){if(t===null||typeof t!="object")throw new uZe(e,"Object",t)}a(UYo,"validateObject");function hp(t,e){if(typeof t!="string")throw new uZe(e,"string",t)}a(hp,"validateString");var ub=ITn==="win32";function us(t){return t===w0||t===lb}a(us,"isPathSeparator");function FHt(t){return t===w0}a(FHt,"isPosixPathSeparator");function ij(t){return t>=MYo&&t<=LYo||t>=OYo&&t<=BYo}a(ij,"isWindowsDeviceRoot");function dZe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===oj&&l!==-1?++l:l=-1}return o}a(dZe,"normalizeString");function QYo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(QYo,"formatExt");function xTn(t,e){UYo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${QYo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(xTn,"_format");var pm={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],hp(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=lRe():(s=TTn[`=${e}`]||lRe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===lb)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)us(f)&&(l=1,d=!0);else if(us(f))if(d=!0,us(s.charCodeAt(1))){let h=2,m=h;for(;h2&&us(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=dZe(r,!n,"\\",us),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){hp(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return FHt(s)?"\\":t;if(us(s))if(o=!0,us(t.charCodeAt(1))){let l=2,u=l;for(;l2&&us(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&us(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){hp(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return us(r)||e>2&&ij(r)&&t.charCodeAt(1)===nj&&us(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&us(r.charCodeAt(0))){++o;let s=r.length;s>1&&us(r.charCodeAt(1))&&(++o,s>2&&(us(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return pm.normalize(e)},relative(t,e){if(hp(t,"from"),hp(e,"to"),t===e)return"";let r=pm.resolve(t),n=pm.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===lb;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===lb;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===lb)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===lb?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===lb)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===lb&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=pm.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===lb){if(e.charCodeAt(1)===lb){let r=e.charCodeAt(2);if(r!==FYo&&r!==oj)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(ij(e.charCodeAt(0))&&e.charCodeAt(1)===nj&&e.charCodeAt(2)===lb)return`\\\\?\\${e}`;return t},dirname(t){hp(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return us(o)?t:".";if(us(o)){if(r=n=1,us(t.charCodeAt(1))){let l=2,u=l;for(;l2&&us(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(us(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&hp(e,"suffix"),hp(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&ij(t.charCodeAt(0))&&t.charCodeAt(1)===nj&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(us(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(us(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){hp(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===nj&&ij(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(us(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===oj?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:xTn.bind(null,"\\"),parse(t){hp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return us(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(us(o)){if(n=1,us(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),us(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===oj?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},qYo=(()=>{if(ub){let t=/\\/g;return()=>{let e=lRe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>lRe()})(),Nf={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:qYo();hp(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===w0)}return e=dZe(e,!r,"/",FHt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(hp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===w0,r=t.charCodeAt(t.length-1)===w0;return t=dZe(t,!e,"/",FHt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return hp(t,"path"),t.length>0&&t.charCodeAt(0)===w0},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":Nf.normalize(e)},relative(t,e){if(hp(t,"from"),hp(e,"to"),t===e||(t=Nf.resolve(t),e=Nf.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===w0)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===w0?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===w0)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(hp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===w0,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===w0){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&hp(e,"ext"),hp(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===w0){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===w0){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){hp(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===w0){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===oj?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:xTn.bind(null,"/"),parse(t){hp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===w0,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===w0){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===oj?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Nf.win32=pm.win32=pm;Nf.posix=pm.posix=Nf;var jYo=ub?pm.normalize:Nf.normalize,HYo=ub?pm.isAbsolute:Nf.isAbsolute,fZe=ub?pm.join:Nf.join,fdd=ub?pm.resolve:Nf.resolve,pdd=ub?pm.relative:Nf.relative,hdd=ub?pm.dirname:Nf.dirname,wTn=ub?pm.basename:Nf.basename,RTn=ub?pm.extname:Nf.extname,mdd=ub?pm.format:Nf.format,gdd=ub?pm.parse:Nf.parse,Add=ub?pm.toNamespacedPath:Nf.toNamespacedPath,BJ=ub?pm.sep:Nf.sep,ydd=ub?pm.delimiter:Nf.delimiter;p();p();function FJ(t,e="unexpected state"){if(!t)throw new Yc(`Assertion Failed: ${e}`)}a(FJ,"assert");function UHt(t){if(!t()){debugger;t(),Fue(new Yc("Assertion Failed"))}}a(UHt,"assertFn");function uRe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!pTn(t,e))return!1;if(e.length===t.length)return!0;let s=e.length;return e.charAt(e.length-1)===n&&s--,t.charAt(s)===n}return e.charAt(e.length-1)!==n&&(e+=n),t.indexOf(e)===0}a(kTn,"isEqualOrParent");var pZe="**",PTn="/",hZe="[/\\\\]",mZe="[^/\\\\]",$Yo=/\//g;function DTn(t,e){switch(t){case 0:return"";case 1:return`${mZe}*?`;default:return`(?:${hZe}|${mZe}+${hZe}${e?`|${hZe}${mZe}+`:""})*?`}}a(DTn,"starsToRegExp");function dRe(t,e){if(!t)return[];let r=[],n=!1,o=!1,s="";for(let c of t){switch(c){case e:if(!n&&!o){r.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=c}return s&&r.push(s),r}a(dRe,"splitGlobAware");function LTn(t){if(!t)return"";let e="",r=dRe(t,PTn);if(r.every(n=>n===pZe))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===pZe){if(n)return;e+=DTn(2,s===r.length-1)}else{let c=!1,l="",u=!1,d="";for(let f of o){if(f!=="}"&&c){l+=f;continue}if(u&&(f!=="]"||!d)){let h;f==="-"?h=f:(f==="^"||f==="!")&&!d?h="^":f===PTn?h="":h=RHt(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${dRe(l,",").map(g=>LTn(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=mZe;continue;case"*":e+=DTn(1);continue;default:e+=RHt(f)}}sjHt(l,e)).filter(l=>l!==_2),t),n=r.length;if(!n)return _2;if(n===1)return r[0];let o=a(function(l,u){for(let d=0,f=r.length;d!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(eKo,"trivia3");function OTn(t,e,r){let n=BJ===Nf.sep,o=n?t:t.replace($Yo,BJ),s=BJ+o,c=Nf.sep+t,l;return r?l=a(function(u,d){return typeof u=="string"&&(u===o||u.endsWith(s)||!n&&(u===t||u.endsWith(c)))?e:null},"parsedPattern"):l=a(function(u,d){return typeof u=="string"&&(u===o||!n&&u===t)?e:null},"parsedPattern"),l.allPaths=[(r?"*/":"./")+t],l}a(OTn,"trivia4and5");function tKo(t){try{let e=new RegExp(`^${LTn(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return _2}}a(tKo,"toRegExp");function FTn(t,e,r){return!t||typeof e!="string"?!1:HHt(t)(e,void 0,r)}a(FTn,"match");function HHt(t,e={}){if(!t)return qHt;if(typeof t=="string"||rKo(t)){let r=jHt(t,e);if(r===_2)return qHt;let n=a(function(o,s){return!!r(o,s)},"resultPattern");return r.allBasenames&&(n.allBasenames=r.allBasenames),r.allPaths&&(n.allPaths=r.allPaths),n}return nKo(t,e)}a(HHt,"parse");function rKo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(rKo,"isRelativePattern");function nKo(t,e){let r=UTn(Object.getOwnPropertyNames(t).map(l=>iKo(l,t[l],e)).filter(l=>l!==_2)),n=r.length;if(!n)return _2;if(!r.some(l=>!!l.requiresSiblings)){if(n===1)return r[0];let l=a(function(f,h){let m;for(let g=0,A=r.length;g{for(let g of m){let A=await g;if(typeof A=="string")return A}return null})():null},"resultExpression"),u=r.find(f=>!!f.allBasenames);u&&(l.allBasenames=u.allBasenames);let d=r.reduce((f,h)=>h.allPaths?f.concat(h.allPaths):f,[]);return d.length&&(l.allPaths=d),l}let o=a(function(l,u,d){let f,h;for(let m=0,g=r.length;m{for(let m of h){let g=await m;if(typeof g=="string")return g}return null})():null},"resultExpression"),s=r.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(nKo,"parsedExpression");function iKo(t,e,r){if(e===!1)return _2;let n=jHt(t,r);if(n===_2)return _2;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let s=a((c,l,u,d)=>{if(!d||!n(c,l))return null;let f=o.replace("$(basename)",()=>u),h=d(f);return aZe(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(iKo,"parseExpressionPattern");function UTn(t,e){let r=t.filter(l=>!!l.basenames);if(r.length<2)return t;let n=r.reduce((l,u)=>{let d=u.basenames;return d?l.concat(d):l},[]),o;if(e){o=[];for(let l=0,u=n.length;l{let d=u.patterns;return d?l.concat(d):l},[]);let s=a(function(l,u){if(typeof l!="string")return null;if(!u){let f;for(f=l.length;f>0;f--){let h=l.charCodeAt(f-1);if(h===47||h===92)break}u=l.substr(f)}let d=n.indexOf(u);return d!==-1?o[d]:null},"aggregate");s.basenames=n,s.patterns=o,s.allBasenames=n;let c=t.filter(l=>!l.basenames);return c.push(s),c}a(UTn,"aggregateBasenameMatches");function QTn(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return oKo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(QTn,"validate");function qTn(t,e){let r=dRe(e,","),n=a(o=>{if(o=o.trim(),o.length!==0){if(o==="**"||o==="**/*"||o==="*")return{pattern:o};!o.startsWith("/")&&!o.startsWith("**/")&&(o="**/"+o);for(let s of t)if(FTn(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(qTn,"matches");function oKo(t){try{let e=dRe(t,",");if(e.length===0)return!1;for(let r of e){let n=HHt(r);if(BTn(n))return!1}return!0}catch{return!1}}a(oKo,"isValidGlob");var HTn=fe(require("path"));var hm={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var $Ht=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??ro(n.uri).replace(".instructions.md","")}static{a(this,"CustomInstruction")}get metadata(){return this.promptFileEntry.promptPath.metadata}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get matchKind(){return this.metadata?.length?this.metadata.some(e=>e.matchKind==="ApplyToPattern")?"ApplyToPattern":"AlwaysApplied":"ApplyToPattern"}get source(){if(this.metadata?.length)return this.metadata.map(e=>e.source)}get providers(){return c2(this.metadata)}get uri(){return this.parsedPromptFile.uri}get name(){return this._name}get applyTo(){return this.parsedPromptFile.header?.applyTo||void 0}get description(){return this.promptFileEntry.promptPath.description??this.parsedPromptFile.header?.description}get content(){return this.parsedPromptFile.body?.content??""}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||Lue(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return Dq(this.promptFileEntry.promptPath)}},GTn={name:"copilot-instructions",source:hm.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},$Tn={name:"git-commit-instructions",source:hm.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},VTn={name:"agents-md-instructions",source:hm.agentsMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CODEX"],defaultRegistration:["AGENTS.md"]},sKo={name:"nested-agents-md-instructions",source:hm.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CODEX"],defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},WTn={name:"claude-md-instructions",source:hm.claudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},aKo={name:"nested-claude-md-instructions",source:hm.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},cKo=[GTn,$Tn,VTn,sKo,WTn,aKo],lKo={name:"instruction-file",source:hm.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},GHt={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},uKo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function jTn(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(jTn,"optionKey");function VHt(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=jTn(n);if(!(o in GHt)||(r=!0,!(e[o]??GHt[o])))continue;let c=uKo[n];if(c){let l=jTn(c);if(!(e[l]??GHt[l]))continue}return!0}return r?!1:void 0}a(VHt,"shouldIncludeSource");var WHt=class{constructor(){this.store=new Map}static{a(this,"InMemoryInstructionManager")}set(e,r){r.length===0?this.store.delete(e):this.store.set(e,r)}get(e){return this.store.get(e)??[]}getAll(e){let r=[];for(let[n,o]of this.store)VHt([n],e)!==!1&&r.push(...o);return r}},dKo=new GO;function fKo(t,e,r,n,o){if(!t)return;let s=`${Pq}${e}`,c=dKo.parse(s,t),l=c.body?.content??t;if(l.trim())return{matchKind:r,uri:s,name:c.header?.name??e,applyTo:c.header?.applyTo||void 0,description:c.header?.description,content:l,isReadonly:!0,isBuiltIn:!1,source:[n],providers:c2(o?[{providers:o}]:void 0)}}a(fKo,"resolveContent");var UJ=class{constructor(e,r,n){this.descriptor=e;this.manager=r;this.registry=n;this.configsByKey=new Map}static{a(this,"InstructionSlot")}set(e,r="default"){let n=Array.isArray(e)?e:e?[e]:[];this.configsByKey.set(r,n);let o=[];for(let g of this.configsByKey.values())o.push(...g);let{name:s,matchKind:c,source:l}=this.descriptor,u=this.descriptor.providers,d=o.filter(g=>g.type==="content").map(g=>{let A=g.content?.trim();return A?fKo(A,`global-${s}`,c,l,u):void 0}).filter(g=>g!==void 0);this.manager.set(l,d);let f={source:l,matchKind:c,providers:u},h=this.descriptor.globSuffix??"",m=new Set;for(let g of this.descriptor.defaultRegistration??[])m.add(g);for(let g of o)g.type==="location"?m.add(HTn.default.posix.join(g.path,h)):g.type==="file"&&m.add(un(g.uri));this._registryDisposable=this.registry.replace(this._registryDisposable,"instructions",Array.from(m),{watchable:this.descriptor.watchable??!0,cacheable:this.descriptor.cacheable??!0,metadata:f})}};function pKo(t){switch(t.type){case"content":return{type:"content",content:t.content};case"file":return{type:"file",uri:t.uri};case"location":return{type:"location",path:t.path}}}a(pKo,"stripSource");var hKo="workspace",Mf=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new WHt;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[hm.copilotInstructions,new UJ(GTn,this.inMemoryManager,n)],[hm.gitCommitInstructions,new UJ($Tn,this.inMemoryManager,n)],[hm.agentsMdInstructions,new UJ(VTn,this.inMemoryManager,n)],[hm.claudeMdInstructions,new UJ(WTn,this.inMemoryManager,n)],[hm.customInstructionFiles,new UJ(lKo,this.inMemoryManager,n)]]);for(let o of cKo)o.defaultRegistration&&n.register("instructions",o.defaultRegistration,{watchable:o.watchable??!0,cacheable:o.cacheable??!0,metadata:{source:o.source,matchKind:o.matchKind,providers:o.providers}});this.slotsBySource.get(hm.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e,r){return(await this.ctx.get(_0).collect(this.ctx,"instructions",e,{includePlugins:r?.includePlugins})).map(o=>new $Ht(o))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=hKo){this.dispatchToSlots(e,r)}dispatchToSlots(e,r){let n=Array.isArray(e)?e:[],o=new Map;for(let s of n){let c;if(s.source===void 0)c=hm.customInstructionFiles;else if(this.slotsBySource.has(s.source))c=s.source;else{Fr.warn(this.ctx,`Ignoring instruction setting with unknown source "${String(s.source)}".`);continue}let l=o.get(c)??[];l.push(pKo(s)),o.set(c,l)}for(let[s,c]of this.slotsBySource)c.set(o.get(s)??[],r)}setGlobalInstructionFiles(e){let r=(e??[]).map(n=>({...n,source:hm.customInstructionFiles}));this.dispatchToSlots(r,"global-instruction-files")}getGlobalInstructionFiles(){return this.inMemoryManager.get(hm.customInstructionFiles)}setGlobalCopilotInstructions(e){let r=e?[{...e,source:hm.copilotInstructions}]:[];this.dispatchToSlots(r,"global-copilot-instructions")}setGlobalGitCommitInstructions(e){let r=e?[{...e,source:hm.gitCommitInstructions}]:[];this.dispatchToSlots(r,"global-git-commit-instructions")}setGlobalAgentsMdInstructions(e){let r=e?[{...e,source:hm.agentsMdInstructions}]:[];this.dispatchToSlots(r,"global-agents-md-instructions")}setGlobalClaudeMdInstructions(e){let r=e?[{...e,source:hm.claudeMdInstructions}]:[];this.dispatchToSlots(r,"global-claude-md-instructions")}async collectAllInstructions(e,r,n={},o){let s=[];for(let c of this.inMemoryManager.getAll(n))this.matchesApplyTo(c,o)&&s.push(c);for(let c of await this.listCustomInstructions(r))this.shouldIncludeRegisteredInstruction(c,n,o)&&s.push(c);return this.emitCollectedTelemetry(s,n),s}static formatInstructions(e,r={}){if(!e||e.length===0)return;let n=[];for(let s of e)s.content.trim()&&n.push(` ${s.content} `);return n.length===0?void 0:`${r.customIntroduction||"When generating code, please follow these user provided coding instructions. You can ignore an instruction if it contradicts a system message."} @@ -2661,21 +2661,21 @@ ${s.content} ${n.join(` `)} -`}async getInstructions(e,r,n={},o){try{let s=await this.collectAllInstructions(e,r,n,o);if(s.length===0)return;let c=n;if(!n.customIntroduction){let l=s.filter(u=>u.matchKind==="ApplyToPattern");l.length>0&&(c={...n,customIntroduction:this.buildInstructionTable(l)})}return t.formatInstructions(s,c)}catch{return}}matchesApplyTo(e,r){if(e.matchKind==="AlwaysApplied")return!0;let n=e.applyTo;if(!n)return!1;let o=UTn(n);return o.isValid&&!!QTn(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=$Ht(e.source,r);return o!==void 0?o:r.includeCustomInstructionFiles===!1?!1:this.matchesApplyTo(e,n)}buildInstructionTable(e){let n=["Here is a list of instruction files that contain rules for modifying or creating new code.","These files are important for ensuring that the code is modified or created correctly.","Please make sure to follow the rules specified in these files when working with the codebase.","If the file is not already available as attachment, use the `read_file` tool to acquire it.","Make sure to acquire the instructions before making any changes to the code.","| Pattern | File Path | Description |","| ------- | --------- | ----------- |"],o=e.map(s=>`| \`${s.applyTo||"*"}\` | \`${s.uri}\` | ${s.description||""} |`);return n.concat(o).join(` -`)}emitCollectedTelemetry(e,r){let n=e.filter(o=>o.source&&$Ht(o.source,r)!==void 0).length;$c(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function sj(t,e){if(t.length==0)return new vr([]);let r=t.map((n,o)=>{let s;switch(e){case"linear":s=1-o/t.length;break;case"inverseLinear":s=(o+1)/t.length;break;case"positional":s=1/(o+1);break;case"inversePositional":s=1/(t.length-o);break}return Array.isArray(n)&&n.length==2&&(s*=n[1],n=n[0]),[n,s]});return new vr(r)}a(sj,"weighElidableList");p();function WTn(t){let e=t.split(` +`}async getInstructions(e,r,n={},o){try{let s=await this.collectAllInstructions(e,r,n,o);if(s.length===0)return;let c=n;if(!n.customIntroduction){let l=s.filter(u=>u.matchKind==="ApplyToPattern");l.length>0&&(c={...n,customIntroduction:this.buildInstructionTable(l)})}return t.formatInstructions(s,c)}catch{return}}matchesApplyTo(e,r){if(e.matchKind==="AlwaysApplied")return!0;let n=e.applyTo;if(!n)return!1;let o=QTn(n);return o.isValid&&!!qTn(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=VHt(e.source,r);return o!==void 0?o:r.includeCustomInstructionFiles===!1?!1:this.matchesApplyTo(e,n)}buildInstructionTable(e){let n=["Here is a list of instruction files that contain rules for modifying or creating new code.","These files are important for ensuring that the code is modified or created correctly.","Please make sure to follow the rules specified in these files when working with the codebase.","If the file is not already available as attachment, use the `read_file` tool to acquire it.","Make sure to acquire the instructions before making any changes to the code.","| Pattern | File Path | Description |","| ------- | --------- | ----------- |"],o=e.map(s=>`| \`${s.applyTo||"*"}\` | \`${s.uri}\` | ${s.description||""} |`);return n.concat(o).join(` +`)}emitCollectedTelemetry(e,r){let n=e.filter(o=>o.source&&VHt(o.source,r)!==void 0).length;$c(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function sj(t,e){if(t.length==0)return new vr([]);let r=t.map((n,o)=>{let s;switch(e){case"linear":s=1-o/t.length;break;case"inverseLinear":s=(o+1)/t.length;break;case"positional":s=1/(o+1);break;case"inversePositional":s=1/(t.length-o);break}return Array.isArray(n)&&n.length==2&&(s*=n[1],n=n[0]),[n,s]});return new vr(r)}a(sj,"weighElidableList");p();function zTn(t){let e=t.split(` `),r=[],n=!1,o=[];for(let s of e)s.startsWith("```")?(n?(r.push([rT(o.join(` `)),1]),o=[],r.push([new vr([s]),1])):r.push([new vr([s]),1]),n=!n):n?o.push(s):r.push([new vr([s]),.8]);return n&&(r.push([rT(o.join(` -`)),1]),r.push([new vr(["```"]),1])),new vr(r)}a(WTn,"fromMessage");function ide(t){let e=zHt(t),r=[];for(let n=0;n1&&n!==e.length-1?` -`:"")),r.push(WTn(l))}return r.length>0?new vr([[new vr(["Consider the following conversation history:"]),1],[sj(r,"inverseLinear"),1]]):null}a(ide,"fromHistory");var pKo=5;function zHt(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&Mn(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,pKo).reverse()}a(zHt,"filterTurns");function zTn(t,e=0){let r;switch(t.type){case"user":case"template":r="User";break;case"model":r="GitHub Copilot";break;default:r=t.type}let n=Mn(t.message).startsWith("```")?` -`:" ";return`${e>0?`${e}) `:""}${r}:${n}${Mn(t.message)}`}a(zTn,"formatTurnMessage");p();p();p();var hKo=4,YHt={skillIds:[]},gZe=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"MetaPromptFetcher")}async fetchPromptContext(e,r,n,o,s){let c=e.conversation.getLastTurn().request.message;if(r.length>0){let l=await Ro.getModelConfiguration(e.ctx,"meta",{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(jA).toPrompt(e,u),f=o.extendedBy({messageSource:"chat.metaprompt"},{promptTokenLen:d.tokens}),h={modelConfiguration:l,messages:d.messages,uiKind:s,llmInteraction:e.toLlmInteraction()};if(d.toolConfig===void 0)throw new Error("No tool call configuration found in meta prompt.");h.tool_choice=d.toolConfig.tool_choice,h.tools=d.toolConfig.tools;let m=await this.chatFetcher.fetchResponse(h,n,f);return m.type!=="success"&&(ot.error(this.ctx,"Failed to fetch prompt context, trying again..."),m=await this.chatFetcher.fetchResponse(h,n,f)),await e.ctx.get(dm).inspectFetchResult(m),this.handleResult(m,f,Mn(c),s,d.toolConfig)}else return YHt}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),YHt;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,hKo);else return ot.error(this.ctx,"Missing tool call in meta prompt response"),YHt;let u=r.extendedBy({uiKind:o,skillIds:l?.join(",")??""},{numTokens:e.numTokens+e.toolCalls[0].approxNumTokens}),d=u.extendedBy({messageText:n});return ft(this.ctx,`${S_(o)}.metaPrompt`,u,0),ft(this.ctx,`${S_(o)}.promptContext`,d,1),{skillIds:l??[]}}telemetryError(e,r){let n=e.extendedBy({resultType:r.type,reason:r.reason??""});ft(this.ctx,"conversation.promptContextError",n,1)}};p();p();var c5=class{constructor(e,r,n){this.doc=e;this.selection=r;this.visibleRange=n}static{a(this,"ElidableDocument")}fromSelectedCode(e){let r=this.getExpandedSelection(),n=r;if(e.trimNewLines){let s=this.doc.getText(r),c=s.match(/^\n*/)?.[0].length??0,l=s.match(/\n*$/)?.[0].length??0;n={start:this.getLineStart(r.start.line+c),end:this.expandLineToEnd(r.end.line-l)}}let o=new vr([ls(this.doc.getText(n)).trim()]);return[this.wrapInTicks(o),n]}fromAllCode(e){let r=this.getDocumentRange(),n=this.getExpandedSelection(),o;!this.visibleRange||!this.rangeContainedIn(this.visibleRange,n)?o=n:o={start:this.getLineStart(this.visibleRange.start.line),end:this.expandLineToEnd(this.visibleRange.end.line)};let s={start:r.start,end:o.start.line>0?this.expandLineToEnd(o.start.line-1):r.start},c={start:o.start,end:n.start.line>0&&n.start.line>o.start.line?this.expandLineToEnd(n.start.line-1):o.start},l={start:n.end.line!ode(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:rT(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||ode(this.selection)}getExpandedSelection(){return this.selection!==void 0?{start:this.getLineStart(this.selection.start.line),end:this.expandLineToEnd(this.selection.end.line)}:this.getDocumentRange()}getDocumentRange(){return{start:this.getLineStart(0),end:this.expandLineToEnd(this.doc.lineCount-1)}}getLineStart(e){return{line:e,character:0}}expandLineToEnd(e){return e>this.doc.lineCount-1&&(e=this.doc.lineCount-1),{line:e,character:this.doc.lineAt({line:e,character:0}).text.length}}rangeContainedIn(e,r){return e.start.line<=r.start.line&&e.end.line>=r.end.line}rangeEquals(e,r){return e.start.line==r.start.line&&e.end.line==r.end.line}wrapInTicks(e,r){return new vr([["```"+this.doc.detectedLanguageId,1],[e,r??1],["```",1]])}addLineNumbers(e){let r=this.doc.getText(e).split(` +`:"")),r.push(zTn(l))}return r.length>0?new vr([[new vr(["Consider the following conversation history:"]),1],[sj(r,"inverseLinear"),1]]):null}a(ode,"fromHistory");var mKo=5;function YHt(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&Mn(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,mKo).reverse()}a(YHt,"filterTurns");function YTn(t,e=0){let r;switch(t.type){case"user":case"template":r="User";break;case"model":r="GitHub Copilot";break;default:r=t.type}let n=Mn(t.message).startsWith("```")?` +`:" ";return`${e>0?`${e}) `:""}${r}:${n}${Mn(t.message)}`}a(YTn,"formatTurnMessage");p();p();p();var gKo=4,KHt={skillIds:[]},gZe=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"MetaPromptFetcher")}async fetchPromptContext(e,r,n,o,s){let c=e.conversation.getLastTurn().request.message;if(r.length>0){let l=await Ro.getModelConfiguration(e.ctx,"meta",{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(jA).toPrompt(e,u),f=o.extendedBy({messageSource:"chat.metaprompt"},{promptTokenLen:d.tokens}),h={modelConfiguration:l,messages:d.messages,uiKind:s,llmInteraction:e.toLlmInteraction()};if(d.toolConfig===void 0)throw new Error("No tool call configuration found in meta prompt.");h.tool_choice=d.toolConfig.tool_choice,h.tools=d.toolConfig.tools;let m=await this.chatFetcher.fetchResponse(h,n,f);return m.type!=="success"&&(ot.error(this.ctx,"Failed to fetch prompt context, trying again..."),m=await this.chatFetcher.fetchResponse(h,n,f)),await e.ctx.get(dm).inspectFetchResult(m),this.handleResult(m,f,Mn(c),s,d.toolConfig)}else return KHt}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),KHt;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,gKo);else return ot.error(this.ctx,"Missing tool call in meta prompt response"),KHt;let u=r.extendedBy({uiKind:o,skillIds:l?.join(",")??""},{numTokens:e.numTokens+e.toolCalls[0].approxNumTokens}),d=u.extendedBy({messageText:n});return ft(this.ctx,`${S_(o)}.metaPrompt`,u,0),ft(this.ctx,`${S_(o)}.promptContext`,d,1),{skillIds:l??[]}}telemetryError(e,r){let n=e.extendedBy({resultType:r.type,reason:r.reason??""});ft(this.ctx,"conversation.promptContextError",n,1)}};p();p();var c5=class{constructor(e,r,n){this.doc=e;this.selection=r;this.visibleRange=n}static{a(this,"ElidableDocument")}fromSelectedCode(e){let r=this.getExpandedSelection(),n=r;if(e.trimNewLines){let s=this.doc.getText(r),c=s.match(/^\n*/)?.[0].length??0,l=s.match(/\n*$/)?.[0].length??0;n={start:this.getLineStart(r.start.line+c),end:this.expandLineToEnd(r.end.line-l)}}let o=new vr([ls(this.doc.getText(n)).trim()]);return[this.wrapInTicks(o),n]}fromAllCode(e){let r=this.getDocumentRange(),n=this.getExpandedSelection(),o;!this.visibleRange||!this.rangeContainedIn(this.visibleRange,n)?o=n:o={start:this.getLineStart(this.visibleRange.start.line),end:this.expandLineToEnd(this.visibleRange.end.line)};let s={start:r.start,end:o.start.line>0?this.expandLineToEnd(o.start.line-1):r.start},c={start:o.start,end:n.start.line>0&&n.start.line>o.start.line?this.expandLineToEnd(n.start.line-1):o.start},l={start:n.end.line!sde(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:rT(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||sde(this.selection)}getExpandedSelection(){return this.selection!==void 0?{start:this.getLineStart(this.selection.start.line),end:this.expandLineToEnd(this.selection.end.line)}:this.getDocumentRange()}getDocumentRange(){return{start:this.getLineStart(0),end:this.expandLineToEnd(this.doc.lineCount-1)}}getLineStart(e){return{line:e,character:0}}expandLineToEnd(e){return e>this.doc.lineCount-1&&(e=this.doc.lineCount-1),{line:e,character:this.doc.lineAt({line:e,character:0}).text.length}}rangeContainedIn(e,r){return e.start.line<=r.start.line&&e.end.line>=r.end.line}rangeEquals(e,r){return e.start.line==r.start.line&&e.end.line==r.end.line}wrapInTicks(e,r){return new vr([["```"+this.doc.detectedLanguageId,1],[e,r??1],["```",1]])}addLineNumbers(e){let r=this.doc.getText(e).split(` `),n=this.doc.lineCount.toString().length;return r.map((s,c)=>`${(e.start.line+c+1).toString().padEnd(n," ")}:${s}`).join(` -`)}};function ode(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(ode,"isEmptyRange");p();p();var YTn=fe(ii()),KTn=b.Object({accessToken:b.Optional(b.String({minLength:1})),handle:b.Optional(b.String({minLength:1})),login:b.Optional(b.String({minLength:1})),githubAppId:b.Optional(b.String({minLength:1})),apiUrl:b.Optional(b.String({})),serverUrl:b.Optional(b.String({})),tokenEndpoint:b.Optional(b.String({}))}),KHt;(r=>(r.method="github/didChangeAuth",r.type=new YTn.ProtocolNotificationType(r.method)))(KHt||={});p();var JTn=fe(ii()),JHt;(r=>(r.method="copilot/ipCodeCitation",r.type=new JTn.NotificationType(r.method)))(JHt||={});p();var ZTn=fe(ii()),AZe;(r=>(r.method="context/update",r.type=new ZTn.ProtocolRequestType(r.method)))(AZe||={});p();p();p();var jn=fe(ii()),fRe=b.String(),db=b.Object({uri:fRe}),UJ=b.Intersect([db,b.Object({version:b.Optional(b.Integer())})]),apd=b.Required(UJ),vg=b.Object({line:b.Integer({minimum:0}),character:b.Integer({minimum:0})}),Of=b.Object({start:vg,end:vg}),ZHt=b.Union([b.Integer(),b.String()]),cpd=b.Object({isCancellationRequested:b.Boolean(),onCancellationRequested:b.Any()});p();var XTn=fe(ii()),XHt;(r=>(r.method="textDocument/didFocus",r.type=new XTn.ProtocolNotificationType(r.method)))(XHt||={});p();var mKo=b.Object({didChangeFeatureFlags:b.Boolean(),didChangeManagedSettings:b.Boolean(),fetch:b.Boolean(),ipCodeCitation:b.Boolean(),redirectedTelemetry:b.Boolean(),related:b.Boolean(),token:b.Boolean(),watchedFiles:b.Boolean(),showPanelMessage:b.Boolean(),mcpElicitation:b.Boolean(),mcpSampling:b.Boolean(),mcpAllowlist:b.Boolean(),stateDatabase:b.Boolean(),subAgent:b.Boolean(),mcpServerManagement:b.Boolean(),cveRemediatorAgent:b.Boolean(),debuggerAgent:b.Boolean(),contentProvider:b.Array(b.String()),manageTodoListTool:b.Boolean(),agentDebugLog:b.Boolean(),accountPickerEnabled:b.Boolean()}),gKo=b.Object({name:b.String(),version:b.String(),readableName:b.Optional(b.String())}),eIn=b.Object({name:b.String(),version:b.Optional(b.String()),readableName:b.Optional(b.String())}),tIn=b.Object({editorInfo:b.Optional(eIn),editorPluginInfo:b.Optional(eIn),relatedPluginInfo:b.Optional(b.Array(gKo)),copilotIntegrationId:b.Optional(b.String()),copilotCapabilities:b.Optional(b.Partial(mKo)),githubAppId:b.Optional(b.String()),sessionId:b.Optional(b.String())});p();var pRe=fe(ii());var eGt=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(eGt||{}),AKo=b.Enum(eGt),yKo=b.Object({triggerKind:AKo,selectedCompletionInfo:b.Optional(b.Object({text:b.String(),range:Of,tooltipSignature:b.Optional(b.String())}))}),rIn=b.Object({textDocument:UJ,position:vg,formattingOptions:b.Optional(b.Object({tabSize:b.Optional(b.Union([b.Integer({minimum:1}),b.String()])),insertSpaces:b.Optional(b.Union([b.Boolean(),b.String()]))})),context:yKo,data:b.Optional(b.Unknown())}),tGt;(r=>(r.method="textDocument/inlineCompletion",r.type=new pRe.ProtocolRequestType(r.method)))(tGt||={});var nIn=b.Object({command:b.Object({arguments:b.Tuple([b.String({minLength:1})])})}),iIn=b.Object({item:nIn}),rGt;(r=>(r.method="textDocument/didShowCompletion",r.type=new pRe.ProtocolNotificationType(r.method)))(rGt||={});var oIn=b.Object({item:nIn,acceptedLength:b.Integer({minimum:1})}),nGt;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new pRe.ProtocolNotificationType(r.method)))(nGt||={});p();var sIn=fe(ii()),_Ko;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new sIn.ProtocolRequestType(r.method)))(_Ko||={});p();var aIn=fe(ii()),EKo=b.Object({severity:b.Union([b.Literal("error"),b.Literal("warning")]),message:b.String(),range:Of,code:b.Optional(b.Union([b.String(),b.Number()])),source:b.Optional(b.String())}),cIn=b.Object({textDocument:UJ,position:vg,diagnostics:b.Optional(b.Array(EKo))}),vKo=b.Object({command:b.Object({arguments:b.Tuple([b.String({minLength:1})])})}),lIn=b.Object({item:vKo}),iGt;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new aIn.ProtocolNotificationType(r.method)))(iGt||={});p();var yZe=fe(ii());var uIn=b.Object({textDocument:UJ,position:vg,partialResultToken:b.Optional(ZHt),workDoneToken:b.Optional(ZHt)}),_Ze;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new yZe.ProtocolRequestType(n.method),n.partialResult=new yZe.ProgressType))(_Ze||={});p();var dIn=fe(ii()),oGt;(r=>(r.method="copilot/related",r.type=new dIn.ProtocolRequestType(r.method)))(oGt||={});p();var sGt=fe(ii()),aGt;(r=>(r.method="statusNotification",r.type=new sGt.ProtocolNotificationType(r.method)))(aGt||={});var cGt;(r=>(r.method="didChangeStatus/v2",r.type=new sGt.ProtocolNotificationType(r.method)))(cGt||={});var fIn=fe(require("path"));var pIn=b.Object({uri:b.String(),visibleRange:b.Optional(Of),selection:b.Optional(Of)}),lGt=class{constructor(e){this.turnContext=e}static{a(this,"CurrentEditorSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(si),n=await r.getOrReadTextDocument(e),o=dd(n);if(await this.turnContext.collectFile(I_,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new c5(n.document,e.selection,e.visibleRange),l=r.getRelativePath(n.document);if(o==="empty")return new vr([`The currently open file \`${l}\` is empty.`]);let u=[[`Code excerpt from the currently open file \`${l}\`:`,1],[c.fromAllCode({addLineNumbers:s}),1]],d=[];if(c.selectionIsDocument())d=[["The user is selecting the entire file.",1]];else if(s){let[f,h]=c.fromSelectedCode({trimNewLines:!0}),m=h.start.line+1;if(ode(h))d=[[`The user is selecting line ${m}, which is empty.`,1]];else{let g=h.end.line+1;d=[["The user is selecting"+(m==g?` line ${m}:`:` lines ${m} to ${g} (inclusive):`),1],[f,1]]}}else c.selectionIsEmpty()||(d=[["The user is selecting this code:",1],[c.fromSelectedCode({trimNewLines:!1})[0],1]]);return new vr([...u,...d])}else if(n.status==="invalid")return new vr([`The currently open file \`${fIn.basename(e.uri)}\` is content excluded.`])}},I_="current-editor",EZe=class{constructor(e){this._resolver=e;this.id=I_;this.type="explicit"}static{a(this,"CurrentEditorSkill")}description(){return"The code from the user's currently open file"}resolver(){return this._resolver}processor(e){return new lGt(e)}};p();var hIn=b.Object({labels:b.Array(b.String())}),uGt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectLabelsSkillProcessor")}value(){return 1}processSkill(e){let r=[];return r.push([new vr(["The developer is working on a project with the following characteristics (languages, frameworks):"]),1]),e.labels.forEach(n=>{r.push([new vr([`- ${n}`]),.9]),this.turnContext.collectLabel(E2,n)}),new vr(r)}},E2="project-labels",vZe=class{constructor(e){this._resolver=e;this.id=E2;this.type="explicit"}static{a(this,"ProjectLabelsSkill")}description(){return"The characteristics of the project the developer is working on (languages, frameworks)"}resolver(){return this._resolver}processor(e){return new uGt(e)}};p();p();p();var CZe=class{constructor(){this.languageId=["java","kotlin","scala","groovy"]}static{a(this,"JavaProjectMetadataLookup")}determineBuildTools(e){return[...e.buildTools]}determineApplicationFrameworks(e){let r=[];return De(e,r,"org.springframework.boot","Spring Boot"),De(e,r,"jakarta.jakartaee-api","Jakarta EE"),De(e,r,"javax:javaee-api","Java EE"),De(e,r,"org.apache.struts:struts2-core","Apache Struts"),De(e,r,"org.hibernate:hibernate-core","Hibernate"),De(e,r,"org.apache.wicket:wicket-core","Apache Wicket"),De(e,r,"javax.faces:jsf-api","JSF"),De(e,r,"org.grails:grails-core","Grails"),r}determineCoreLibraries(e){let r=[];return De(e,r,"com.google.guava","Google Guava"),De(e,r,"org.apache.commons:commons-lang3","Apache Commons Lang"),De(e,r,"org.apache.commons:commons-io","Apache Commons IO"),De(e,r,"joda-time:joda-time","Joda-Time"),De(e,r,"com.google.code.gson:gson","Google Gson"),De(e,r,"org.apache.commons:commons-math3","Apache Commons Math"),De(e,r,"org.apache.commons:commons-collections4","Apache Commons Collections"),De(e,r,"org.apache.commons:commons-net","Apache Commons Net"),De(e,r,"org.apache.poi:poi","Apache POI"),De(e,r,"com.fasterxml.jackson.core:jackson-databind","Jackson"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"org.junit.jupiter:junit-jupiter","JUnit"),De(e,r,"junit:junit","JUnit"),De(e,r,"org.testng:testng","TestNG"),De(e,r,"org.spockframework:spock-core","Spock"),De(e,r,"io.cucumber:cucumber-java","Cucumber"),De(e,r,"org.jboss.arquillian.junit:arquillian-junit-container","Arquillian"),r}determineTestingLibraries(e){let r=[];return De(e,r,"org.mockito","Mockito"),De(e,r,"org.assertj","AssertJ"),De(e,r,"org.hamcrest","Hamcrest"),De(e,r,"org.powermock","PowerMock"),De(e,r,"org.jmock","JMock"),De(e,r,"org.easymock","EasyMock"),De(e,r,"org.jmockit:jmockit","JMockit"),De(e,r,"com.github.tomakehurst:wiremock","WireMock"),De(e,r,"org.dbunit:dbunit","DBUnit"),De(e,r,"com.icegreen:greenmail","GreenMail"),De(e,r,"net.sourceforge.htmlunit:htmlunit","HtmlUnit"),De(e,r,"org.seleniumhq.selenium:selenium-java","Selenium"),De(e,r,"io.rest-assured:rest-assured","Rest-Assured"),De(e,r,"io.gatling.highcharts:gatling-charts-highcharts","Gatling"),De(e,r,"org.apache.jmeter:ApacheJMeter","JMeter"),r}},bZe=class{constructor(){this.languageId=["javascript","javascriptreact","typescript","typescriptreact","vue"]}static{a(this,"JavaScriptProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"@types/node","Node.js"),De(e,r,"react-native","React Native"),r.find(n=>n.name==="React Native")||De(e,r,"react","React"),De(e,r,"angular","Angular"),De(e,r,"vue","Vue.js"),De(e,r,"ember","Ember.js"),De(e,r,"backbone","Backbone.js"),De(e,r,"meteor","Meteor"),De(e,r,"polymer","Polymer"),De(e,r,"aurelia","Aurelia"),De(e,r,"knockout","Knockout.js"),De(e,r,"dojo","Dojo Toolkit"),De(e,r,"mithril","Mithril.js"),De(e,r,"marionette","Marionette.js"),De(e,r,"marko","Marko.js"),De(e,r,"svelte","Svelte"),De(e,r,"hyperapp","Hyperapp"),De(e,r,"inferno","Inferno.js"),De(e,r,"preact","Preact"),De(e,r,"riot","Riot.js"),De(e,r,"moon","Moon.js"),De(e,r,"stencil","Stencil.js"),r}determineCoreLibraries(e){let r=[];return De(e,r,"lodash","Lodash"),De(e,r,"moment","Moment.js"),De(e,r,"axios","Axios"),De(e,r,"redux","Redux"),De(e,r,"recoil","Recoil"),De(e,r,"jquery","jQuery"),De(e,r,"d3","D3.js"),De(e,r,"underscore","Underscore.js"),De(e,r,"ramda","Ramda"),De(e,r,"immutable","Immutable.js"),De(e,r,"rxjs","RxJS"),De(e,r,"three","Three.js"),De(e,r,"socket.io","Socket.IO"),De(e,r,"express","Express.js"),De(e,r,"next","Next.js"),De(e,r,"puppeteer","Puppeteer"),De(e,r,"cheerio","Cheerio"),De(e,r,"nodemailer","Nodemailer"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"jest","Jest"),De(e,r,"mocha","Mocha"),De(e,r,"jasmine","Jasmine"),De(e,r,"ava","AVA"),De(e,r,"qunit","QUnit"),De(e,r,"tape","Tape"),r}determineTestingLibraries(e){let r=[];return De(e,r,"chai","Chai"),De(e,r,"sinon","Sinon"),De(e,r,"enzyme","Enzyme"),De(e,r,"protractor","Protractor"),De(e,r,"supertest","Supertest"),De(e,r,"nock","Nock"),De(e,r,"cypress","Cypress"),De(e,r,"@testing-library/react","React Testing Library"),r}},SZe=class{constructor(){this.languageId="go"}static{a(this,"GoProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"github.com/gorilla/mux","Gorilla Mux"),De(e,r,"github.com/go-chi/chi","Chi"),De(e,r,"github.com/gin-gonic/gin","Gin"),De(e,r,"github.com/labstack/echo","Echo"),De(e,r,"github.com/revel/revel","Revel"),De(e,r,"github.com/astaxie/beego","Beego"),De(e,r,"github.com/go-martini/martini","Martini"),De(e,r,"github.com/gobuffalo/buffalo","Buffalo"),De(e,r,"github.com/goji/goji","Goji"),De(e,r,"github.com/hoisie/web","Web.go"),r}determineCoreLibraries(e){let r=[];return De(e,r,"net/http","net/http"),De(e,r,"fmt","fmt"),De(e,r,"io","io"),De(e,r,"time","time"),De(e,r,"math","math"),De(e,r,"strconv","strconv"),De(e,r,"strings","strings"),De(e,r,"sort","sort"),De(e,r,"encoding/json","encoding/json"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"github.com/onsi/ginkgo","ginkgo"),De(e,r,"github.com/onsi/gomega","gomega"),De(e,r,"github.com/stretchr/testify","testify"),De(e,r,"gopkg.in/check.v1","gocheck"),De(e,r,"github.com/franela/goblin","goblin"),De(e,r,"github.com/DATA-DOG/godog","godog"),De(e,r,"github.com/stesla/gospec","gospec"),De(e,r,"github.com/rjeczalik/gotest","gotest"),De(e,r,"github.com/smartystreets/goconvey","goconvey"),r}determineTestingLibraries(e){let r=[];return De(e,r,"github.com/stretchr/testify","Testify"),De(e,r,"github.com/smartystreets/goconvey","GoConvey"),De(e,r,"github.com/onsi/ginkgo","Ginkgo"),De(e,r,"github.com/golang/mock","GoMock"),De(e,r,"gopkg.in/check.v1","GoCheck"),De(e,r,"github.com/franela/goblin","Goblin"),De(e,r,"github.com/DATA-DOG/godog","GoDog"),De(e,r,"github.com/onsi/gomega","Gomega"),De(e,r,"github.com/stesla/gospec","GoSpec"),De(e,r,"github.com/rjeczalik/gotest","GoTest"),r}},TZe=class{constructor(){this.languageId=["python","jupyter"]}static{a(this,"PythonProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"flask","Flask"),De(e,r,"django","Django"),De(e,r,"pyramid","Pyramid"),De(e,r,"tornado","Tornado"),De(e,r,"fastapi","FastAPI"),r}determineCoreLibraries(e){let r=[];return De(e,r,"requests","requests"),De(e,r,"numpy","numpy"),De(e,r,"pandas","pandas"),De(e,r,"scipy","scipy"),De(e,r,"matplotlib","matplotlib"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"pytest","Pytest"),De(e,r,"unittest","Unittest"),De(e,r,"doctest","Doctest"),De(e,r,"nose","Nose"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mock","Mock"),De(e,r,"hypothesis","Hypothesis"),De(e,r,"behave","Behave"),De(e,r,"lettuce","Lettuce"),De(e,r,"testify","Testify"),De(e,r,"pyhamcrest","PyHamcrest"),r}},IZe=class{constructor(){this.languageId=["php","blade"]}static{a(this,"PhpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"laravel/framework","Laravel"),De(e,r,"symfony/symfony","Symfony"),De(e,r,"slim/slim","Slim"),De(e,r,"cakephp/cakephp","CakePHP"),De(e,r,"yiisoft/yii2","Yii"),De(e,r,"zendframework/zendframework","Zend Framework"),De(e,r,"phalcon/cphalcon","Phalcon"),De(e,r,"bcosca/fatfree","Fat-Free"),De(e,r,"fuel/fuel","FuelPHP"),De(e,r,"phpixie/framework","PHPixie"),r}determineCoreLibraries(e){let r=[];return De(e,r,"monolog/monolog","Monolog"),De(e,r,"vlucas/phpdotenv","PHP dotenv"),De(e,r,"symfony/console","Symfony Console"),De(e,r,"guzzlehttp/guzzle","GuzzleHttp"),De(e,r,"ramsey/uuid","Ramsey UUID"),De(e,r,"doctrine/orm","Doctrine ORM"),De(e,r,"php-di/php-di","PHP-DI"),De(e,r,"phpunit/php-timer","PHPUnit Timer"),De(e,r,"symfony/finder","Symfony Finder"),De(e,r,"symfony/yaml","Symfony Yaml"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"phpunit/phpunit","PHPUnit"),De(e,r,"behat/behat","Behat"),De(e,r,"phpspec/phpspec","PHPSpec"),De(e,r,"codeception/codeception","Codeception"),De(e,r,"atoum/atoum","Atoum"),De(e,r,"pestphp/pest","PestPHP"),De(e,r,"kahlan/kahlan","Kahlan"),De(e,r,"peridot-php/peridot","Peridot"),De(e,r,"phake/phake","Phake"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockery/mockery","Mockery"),De(e,r,"php-mock/php-mock","PHP-Mock"),De(e,r,"php-mock/php-mock-phpunit","PHP-Mock PHPUnit"),De(e,r,"padraic/mockery","Padraic Mockery"),De(e,r,"phpspec/prophecy","PHPSpec Prophecy"),De(e,r,"phpunit/php-invoker","PHPUnit Invoker"),De(e,r,"phpunit/php-token-stream","PHPUnit Token Stream"),De(e,r,"phpunit/php-code-coverage","PHPUnit Code Coverage"),De(e,r,"phpunit/php-timer","PHPUnit Timer"),De(e,r,"phpunit/php-text-template","PHPUnit Text Template"),r}},xZe=class{constructor(){this.languageId="csharp"}static{a(this,"CSharpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"Microsoft.NETCore.App",".NET Core"),De(e,r,"Microsoft.AspNetCore.App","ASP.NET Core"),r}determineCoreLibraries(e){let r=[];return De(e,r,"EntityFramework","Entity Framework"),De(e,r,"Newtonsoft.Json","Newtonsoft.Json"),De(e,r,"AutoMapper","AutoMapper"),De(e,r,"Serilog","Serilog"),De(e,r,"Dapper","Dapper"),De(e,r,"Polly","Polly"),De(e,r,"FluentValidation","FluentValidation"),De(e,r,"MediatR","MediatR"),De(e,r,"Hangfire","Hangfire"),De(e,r,"RabbitMQ.Client","RabbitMQ.Client"),De(e,r,"MassTransit","MassTransit"),De(e,r,"Microsoft.Extensions.Logging","Microsoft.Extensions.Logging"),De(e,r,"Microsoft.Extensions.DependencyInjection","Microsoft.Extensions.DependencyInjection"),De(e,r,"Microsoft.Extensions.Configuration","Microsoft.Extensions.Configuration"),De(e,r,"Microsoft.Extensions.Http","Microsoft.Extensions.Http"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"xunit","xUnit"),De(e,r,"NUnit","NUnit"),De(e,r,"SpecFlow","SpecFlow"),r}determineTestingLibraries(e){let r=[];return De(e,r,"Moq","Moq"),De(e,r,"FluentAssertions","FluentAssertions"),De(e,r,"Bogus","Bogus"),De(e,r,"RestSharp","RestSharp"),De(e,r,"Swashbuckle.AspNetCore","Swashbuckle.AspNetCore"),r}},wZe=class{constructor(){this.languageId="dart"}static{a(this,"DartProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"flutter","Flutter"),De(e,r,"angular","AngularDart"),r}determineCoreLibraries(e){let r=[];return De(e,r,"dartx","dartx"),De(e,r,"provider","Provider"),De(e,r,"rxdart","RxDart"),De(e,r,"dio","Dio"),De(e,r,"json_serializable","json_serializable"),De(e,r,"freezed","Freezed"),De(e,r,"moor","Moor"),De(e,r,"hive","Hive"),De(e,r,"http","http"),De(e,r,"path","path"),De(e,r,"intl","intl"),De(e,r,"equatable","equatable"),De(e,r,"get_it","get_it"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"test","test"),De(e,r,"flutter_test","flutter_test"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockito","mockito"),De(e,r,"bloc_test","bloc_test"),r}},RZe=class{constructor(){this.languageId="ruby"}static{a(this,"RubyProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"rails","Rails"),De(e,r,"sinatra","Sinatra"),De(e,r,"hanami","Hanami"),De(e,r,"grape","Grape"),De(e,r,"roda","Roda"),De(e,r,"padrino","Padrino"),De(e,r,"cuba","Cuba"),De(e,r,"ramaze","Ramaze"),De(e,r,"nyara","Nyara"),De(e,r,"rack","Rack"),r}determineCoreLibraries(e){let r=[];return De(e,r,"active_record","ActiveRecord"),De(e,r,"sequel","Sequel"),De(e,r,"rom","ROM"),De(e,r,"datamapper","DataMapper"),De(e,r,"mongoid","Mongoid"),De(e,r,"neo4j","Neo4j"),De(e,r,"redis","Redis"),De(e,r,"cassandra","Cassandra"),De(e,r,"couchrest","CouchRest"),De(e,r,"riak","Riak"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"rspec","RSpec"),De(e,r,"minitest","Minitest"),De(e,r,"cucumber","Cucumber"),De(e,r,"spinach","Spinach"),De(e,r,"turnip","Turnip"),De(e,r,"bacon","Bacon"),De(e,r,"shoulda","Shoulda"),De(e,r,"test-unit","Test::Unit"),De(e,r,"wrong","Wrong"),De(e,r,"contest","Contest"),r}determineTestingLibraries(e){let r=[];return De(e,r,"factory_bot","FactoryBot"),De(e,r,"faker","Faker"),De(e,r,"ffaker","FFaker"),De(e,r,"fabrication","Fabrication"),De(e,r,"machinist","Machinist"),De(e,r,"mocha","Mocha"),De(e,r,"flexmock","FlexMock"),De(e,r,"rr","RR"),De(e,r,"bourne","Bourne"),De(e,r,"not_a_mock","NotAMock"),r}},kZe=class{constructor(){this.languageId="rust"}static{a(this,"RustProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"tokio","tokio"),De(e,r,"async-std","async-std"),De(e,r,"hyper","hyper"),De(e,r,"actix-web","actix-web"),De(e,r,"rocket","rocket"),r}determineCoreLibraries(e){let r=[];return De(e,r,"serde","serde"),De(e,r,"regex","regex"),De(e,r,"rand","rand"),De(e,r,"log","log"),De(e,r,"lazy_static","lazy_static"),De(e,r,"libc","libc"),De(e,r,"futures","futures"),De(e,r,"rayon","rayon"),De(e,r,"reqwest","reqwest"),De(e,r,"warp","warp"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"test-case","test-case"),De(e,r,"proptest","proptest"),De(e,r,"quickcheck","quickcheck"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockall","mockall"),De(e,r,"double","double"),De(e,r,"rstest","rstest"),De(e,r,"mockiato","mockiato"),De(e,r,"mock_derive","mock_derive"),De(e,r,"mocktopus","mocktopus"),De(e,r,"mockers","mockers"),De(e,r,"mock_it","mock_it"),r}},PZe=class{constructor(){this.languageId=["c","cpp"]}static{a(this,"CProjectMetadataLookup")}determineBuildTools(e){return e.buildTools.filter(r=>["gcc","clang","make","cmake","autotools","ninja","meson"].includes(r.name))}determineApplicationFrameworks(e){return e.libraries.filter(r=>["libc","libuv","openssl","zlib","libevent","libcurl"].includes(r.name))}determineCoreLibraries(e){return e.libraries.filter(r=>["libpng","libjpeg","libxml2","sqlite","postgres","mysql"].includes(r.name))}determineTestingFrameworks(e){return e.libraries.filter(r=>["unity","criterion","cmocka","check","ctest","minunit"].includes(r.name))}determineTestingLibraries(e){return e.libraries.filter(r=>["cmock","fff","trompeloeil","fakeit"].includes(r.name))}};function De(t,e,r,n){let o=t.libraries.find(s=>s.name.toLowerCase().indexOf(r.toLowerCase())>-1);o&&e.push({name:n,version:o.version})}a(De,"addFromLibraries");var DZe=class{constructor(e,r){this.languageId=e;this.delegates=r}static{a(this,"CompositeProjectMetadataLookup")}determineBuildTools(e){return this.delegates.map(r=>r.determineBuildTools(e)).flat()}determineApplicationFrameworks(e){return this.delegates.map(r=>r.determineApplicationFrameworks(e)).flat()}determineCoreLibraries(e){return this.delegates.map(r=>r.determineCoreLibraries(e)).flat()}determineTestingFrameworks(e){return this.delegates.map(r=>r.determineTestingFrameworks(e)).flat()}determineTestingLibraries(e){return this.delegates.map(r=>r.determineTestingLibraries(e)).flat()}};function gIn(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(gIn,"determineProgrammingLanguage");var mIn=[new CZe,new bZe,new SZe,new TZe,new IZe,new xZe,new wZe,new RZe,new kZe,new PZe];function AIn(t){let e=mIn.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new DZe(t,mIn);return new dGt(e)}a(AIn,"getMetadataLookup");var dGt=class{constructor(e){this.delegate=e;this.languageId=e.languageId}static{a(this,"DistinctProjectMetadataLookup")}determineBuildTools(e){return this.deduplicateDependencies(this.delegate.determineBuildTools(e))}determineApplicationFrameworks(e){return this.deduplicateDependencies(this.delegate.determineApplicationFrameworks(e))}determineCoreLibraries(e){return this.deduplicateDependencies(this.delegate.determineCoreLibraries(e))}determineTestingFrameworks(e){return this.deduplicateDependencies(this.delegate.determineTestingFrameworks(e))}determineTestingLibraries(e){return this.deduplicateDependencies(this.delegate.determineTestingLibraries(e))}deduplicateDependencies(e){let r=[];return e.forEach(n=>{r.find(o=>o.name===n.name)||r.push(n)}),r}};var yIn=b.Object({name:b.String(),version:b.Optional(b.String())}),_In=b.Object({language:b.Object({id:b.String(),name:b.String(),version:b.Optional(b.String())}),libraries:b.Array(yIn),buildTools:b.Array(yIn)}),fGt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectMetadataSkillProcessor")}value(){return 1}processSkill(e){let r=[];r.push([new vr([`The user is working on a project with the following characteristics: -`]),1]);let n=AIn(e.language.id);return this.addProgrammingLanguage(e,r),this.addBuildTools(e,r,n),this.addApplicationFramework(e,r,n),this.addCoreLibraries(e,r,n),this.addTestingFrameworks(e,r,n),this.addTestingLibraries(e,r,n),new vr(r)}addProgrammingLanguage(e,r){let n=gIn(e);this.turnContext.collectLabel(l5,n),r.push([new vr([`- programming language: ${n}`]),1])}addBuildTools(e,r,n){this.addToPrompt(r,"- build tools:",n.determineBuildTools(e))}addApplicationFramework(e,r,n){this.addToPrompt(r,"- application frameworks:",n.determineApplicationFrameworks(e))}addCoreLibraries(e,r,n){this.addToPrompt(r,"- core libraries:",n.determineCoreLibraries(e))}addTestingFrameworks(e,r,n){this.addToPrompt(r,"- testing frameworks:",n.determineTestingFrameworks(e))}addTestingLibraries(e,r,n){this.addToPrompt(r,"- testing libraries:",n.determineTestingLibraries(e))}addToPrompt(e,r,n){if(n.length>0){n.forEach(s=>{this.turnContext.collectLabel(l5,`${s.name}${s.version?" "+s.version:""}`)});let o=n.map(s=>` - ${s.name}${s.version?" "+s.version:""}`).join(` +`)}};function sde(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(sde,"isEmptyRange");p();p();var KTn=fe(ii()),JTn=b.Object({accessToken:b.Optional(b.String({minLength:1})),handle:b.Optional(b.String({minLength:1})),login:b.Optional(b.String({minLength:1})),githubAppId:b.Optional(b.String({minLength:1})),apiUrl:b.Optional(b.String({})),serverUrl:b.Optional(b.String({})),tokenEndpoint:b.Optional(b.String({}))}),JHt;(r=>(r.method="github/didChangeAuth",r.type=new KTn.ProtocolNotificationType(r.method)))(JHt||={});p();var ZTn=fe(ii()),ZHt;(r=>(r.method="copilot/ipCodeCitation",r.type=new ZTn.NotificationType(r.method)))(ZHt||={});p();var XTn=fe(ii()),AZe;(r=>(r.method="context/update",r.type=new XTn.ProtocolRequestType(r.method)))(AZe||={});p();p();p();var jn=fe(ii()),fRe=b.String(),db=b.Object({uri:fRe}),QJ=b.Intersect([db,b.Object({version:b.Optional(b.Integer())})]),lpd=b.Required(QJ),Cg=b.Object({line:b.Integer({minimum:0}),character:b.Integer({minimum:0})}),Of=b.Object({start:Cg,end:Cg}),XHt=b.Union([b.Integer(),b.String()]),upd=b.Object({isCancellationRequested:b.Boolean(),onCancellationRequested:b.Any()});p();var eIn=fe(ii()),eGt;(r=>(r.method="textDocument/didFocus",r.type=new eIn.ProtocolNotificationType(r.method)))(eGt||={});p();var AKo=b.Object({didChangeFeatureFlags:b.Boolean(),didChangeManagedSettings:b.Boolean(),fetch:b.Boolean(),ipCodeCitation:b.Boolean(),redirectedTelemetry:b.Boolean(),related:b.Boolean(),token:b.Boolean(),watchedFiles:b.Boolean(),showPanelMessage:b.Boolean(),mcpElicitation:b.Boolean(),mcpSampling:b.Boolean(),mcpAllowlist:b.Boolean(),stateDatabase:b.Boolean(),subAgent:b.Boolean(),mcpServerManagement:b.Boolean(),cveRemediatorAgent:b.Boolean(),debuggerAgent:b.Boolean(),contentProvider:b.Array(b.String()),manageTodoListTool:b.Boolean(),agentDebugLog:b.Boolean(),accountPickerEnabled:b.Boolean()}),yKo=b.Object({name:b.String(),version:b.String(),readableName:b.Optional(b.String())}),tIn=b.Object({name:b.String(),version:b.Optional(b.String()),readableName:b.Optional(b.String())}),rIn=b.Object({editorInfo:b.Optional(tIn),editorPluginInfo:b.Optional(tIn),relatedPluginInfo:b.Optional(b.Array(yKo)),copilotIntegrationId:b.Optional(b.String()),copilotCapabilities:b.Optional(b.Partial(AKo)),githubAppId:b.Optional(b.String()),sessionId:b.Optional(b.String())});p();var pRe=fe(ii());var tGt=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(tGt||{}),_Ko=b.Enum(tGt),EKo=b.Object({triggerKind:_Ko,selectedCompletionInfo:b.Optional(b.Object({text:b.String(),range:Of,tooltipSignature:b.Optional(b.String())}))}),nIn=b.Object({textDocument:QJ,position:Cg,formattingOptions:b.Optional(b.Object({tabSize:b.Optional(b.Union([b.Integer({minimum:1}),b.String()])),insertSpaces:b.Optional(b.Union([b.Boolean(),b.String()]))})),context:EKo,data:b.Optional(b.Unknown())}),rGt;(r=>(r.method="textDocument/inlineCompletion",r.type=new pRe.ProtocolRequestType(r.method)))(rGt||={});var iIn=b.Object({command:b.Object({arguments:b.Tuple([b.String({minLength:1})])})}),oIn=b.Object({item:iIn}),nGt;(r=>(r.method="textDocument/didShowCompletion",r.type=new pRe.ProtocolNotificationType(r.method)))(nGt||={});var sIn=b.Object({item:iIn,acceptedLength:b.Integer({minimum:1})}),iGt;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new pRe.ProtocolNotificationType(r.method)))(iGt||={});p();var aIn=fe(ii()),vKo;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new aIn.ProtocolRequestType(r.method)))(vKo||={});p();var cIn=fe(ii()),CKo=b.Object({severity:b.Union([b.Literal("error"),b.Literal("warning")]),message:b.String(),range:Of,code:b.Optional(b.Union([b.String(),b.Number()])),source:b.Optional(b.String())}),lIn=b.Object({textDocument:QJ,position:Cg,diagnostics:b.Optional(b.Array(CKo))}),bKo=b.Object({command:b.Object({arguments:b.Tuple([b.String({minLength:1})])})}),uIn=b.Object({item:bKo}),oGt;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new cIn.ProtocolNotificationType(r.method)))(oGt||={});p();var yZe=fe(ii());var dIn=b.Object({textDocument:QJ,position:Cg,partialResultToken:b.Optional(XHt),workDoneToken:b.Optional(XHt)}),_Ze;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new yZe.ProtocolRequestType(n.method),n.partialResult=new yZe.ProgressType))(_Ze||={});p();var fIn=fe(ii()),sGt;(r=>(r.method="copilot/related",r.type=new fIn.ProtocolRequestType(r.method)))(sGt||={});p();var aGt=fe(ii()),cGt;(r=>(r.method="statusNotification",r.type=new aGt.ProtocolNotificationType(r.method)))(cGt||={});var lGt;(r=>(r.method="didChangeStatus/v2",r.type=new aGt.ProtocolNotificationType(r.method)))(lGt||={});var pIn=fe(require("path"));var hIn=b.Object({uri:b.String(),visibleRange:b.Optional(Of),selection:b.Optional(Of)}),uGt=class{constructor(e){this.turnContext=e}static{a(this,"CurrentEditorSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(si),n=await r.getOrReadTextDocument(e),o=dd(n);if(await this.turnContext.collectFile(I_,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new c5(n.document,e.selection,e.visibleRange),l=r.getRelativePath(n.document);if(o==="empty")return new vr([`The currently open file \`${l}\` is empty.`]);let u=[[`Code excerpt from the currently open file \`${l}\`:`,1],[c.fromAllCode({addLineNumbers:s}),1]],d=[];if(c.selectionIsDocument())d=[["The user is selecting the entire file.",1]];else if(s){let[f,h]=c.fromSelectedCode({trimNewLines:!0}),m=h.start.line+1;if(sde(h))d=[[`The user is selecting line ${m}, which is empty.`,1]];else{let g=h.end.line+1;d=[["The user is selecting"+(m==g?` line ${m}:`:` lines ${m} to ${g} (inclusive):`),1],[f,1]]}}else c.selectionIsEmpty()||(d=[["The user is selecting this code:",1],[c.fromSelectedCode({trimNewLines:!1})[0],1]]);return new vr([...u,...d])}else if(n.status==="invalid")return new vr([`The currently open file \`${pIn.basename(e.uri)}\` is content excluded.`])}},I_="current-editor",EZe=class{constructor(e){this._resolver=e;this.id=I_;this.type="explicit"}static{a(this,"CurrentEditorSkill")}description(){return"The code from the user's currently open file"}resolver(){return this._resolver}processor(e){return new uGt(e)}};p();var mIn=b.Object({labels:b.Array(b.String())}),dGt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectLabelsSkillProcessor")}value(){return 1}processSkill(e){let r=[];return r.push([new vr(["The developer is working on a project with the following characteristics (languages, frameworks):"]),1]),e.labels.forEach(n=>{r.push([new vr([`- ${n}`]),.9]),this.turnContext.collectLabel(E2,n)}),new vr(r)}},E2="project-labels",vZe=class{constructor(e){this._resolver=e;this.id=E2;this.type="explicit"}static{a(this,"ProjectLabelsSkill")}description(){return"The characteristics of the project the developer is working on (languages, frameworks)"}resolver(){return this._resolver}processor(e){return new dGt(e)}};p();p();p();var CZe=class{constructor(){this.languageId=["java","kotlin","scala","groovy"]}static{a(this,"JavaProjectMetadataLookup")}determineBuildTools(e){return[...e.buildTools]}determineApplicationFrameworks(e){let r=[];return De(e,r,"org.springframework.boot","Spring Boot"),De(e,r,"jakarta.jakartaee-api","Jakarta EE"),De(e,r,"javax:javaee-api","Java EE"),De(e,r,"org.apache.struts:struts2-core","Apache Struts"),De(e,r,"org.hibernate:hibernate-core","Hibernate"),De(e,r,"org.apache.wicket:wicket-core","Apache Wicket"),De(e,r,"javax.faces:jsf-api","JSF"),De(e,r,"org.grails:grails-core","Grails"),r}determineCoreLibraries(e){let r=[];return De(e,r,"com.google.guava","Google Guava"),De(e,r,"org.apache.commons:commons-lang3","Apache Commons Lang"),De(e,r,"org.apache.commons:commons-io","Apache Commons IO"),De(e,r,"joda-time:joda-time","Joda-Time"),De(e,r,"com.google.code.gson:gson","Google Gson"),De(e,r,"org.apache.commons:commons-math3","Apache Commons Math"),De(e,r,"org.apache.commons:commons-collections4","Apache Commons Collections"),De(e,r,"org.apache.commons:commons-net","Apache Commons Net"),De(e,r,"org.apache.poi:poi","Apache POI"),De(e,r,"com.fasterxml.jackson.core:jackson-databind","Jackson"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"org.junit.jupiter:junit-jupiter","JUnit"),De(e,r,"junit:junit","JUnit"),De(e,r,"org.testng:testng","TestNG"),De(e,r,"org.spockframework:spock-core","Spock"),De(e,r,"io.cucumber:cucumber-java","Cucumber"),De(e,r,"org.jboss.arquillian.junit:arquillian-junit-container","Arquillian"),r}determineTestingLibraries(e){let r=[];return De(e,r,"org.mockito","Mockito"),De(e,r,"org.assertj","AssertJ"),De(e,r,"org.hamcrest","Hamcrest"),De(e,r,"org.powermock","PowerMock"),De(e,r,"org.jmock","JMock"),De(e,r,"org.easymock","EasyMock"),De(e,r,"org.jmockit:jmockit","JMockit"),De(e,r,"com.github.tomakehurst:wiremock","WireMock"),De(e,r,"org.dbunit:dbunit","DBUnit"),De(e,r,"com.icegreen:greenmail","GreenMail"),De(e,r,"net.sourceforge.htmlunit:htmlunit","HtmlUnit"),De(e,r,"org.seleniumhq.selenium:selenium-java","Selenium"),De(e,r,"io.rest-assured:rest-assured","Rest-Assured"),De(e,r,"io.gatling.highcharts:gatling-charts-highcharts","Gatling"),De(e,r,"org.apache.jmeter:ApacheJMeter","JMeter"),r}},bZe=class{constructor(){this.languageId=["javascript","javascriptreact","typescript","typescriptreact","vue"]}static{a(this,"JavaScriptProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"@types/node","Node.js"),De(e,r,"react-native","React Native"),r.find(n=>n.name==="React Native")||De(e,r,"react","React"),De(e,r,"angular","Angular"),De(e,r,"vue","Vue.js"),De(e,r,"ember","Ember.js"),De(e,r,"backbone","Backbone.js"),De(e,r,"meteor","Meteor"),De(e,r,"polymer","Polymer"),De(e,r,"aurelia","Aurelia"),De(e,r,"knockout","Knockout.js"),De(e,r,"dojo","Dojo Toolkit"),De(e,r,"mithril","Mithril.js"),De(e,r,"marionette","Marionette.js"),De(e,r,"marko","Marko.js"),De(e,r,"svelte","Svelte"),De(e,r,"hyperapp","Hyperapp"),De(e,r,"inferno","Inferno.js"),De(e,r,"preact","Preact"),De(e,r,"riot","Riot.js"),De(e,r,"moon","Moon.js"),De(e,r,"stencil","Stencil.js"),r}determineCoreLibraries(e){let r=[];return De(e,r,"lodash","Lodash"),De(e,r,"moment","Moment.js"),De(e,r,"axios","Axios"),De(e,r,"redux","Redux"),De(e,r,"recoil","Recoil"),De(e,r,"jquery","jQuery"),De(e,r,"d3","D3.js"),De(e,r,"underscore","Underscore.js"),De(e,r,"ramda","Ramda"),De(e,r,"immutable","Immutable.js"),De(e,r,"rxjs","RxJS"),De(e,r,"three","Three.js"),De(e,r,"socket.io","Socket.IO"),De(e,r,"express","Express.js"),De(e,r,"next","Next.js"),De(e,r,"puppeteer","Puppeteer"),De(e,r,"cheerio","Cheerio"),De(e,r,"nodemailer","Nodemailer"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"jest","Jest"),De(e,r,"mocha","Mocha"),De(e,r,"jasmine","Jasmine"),De(e,r,"ava","AVA"),De(e,r,"qunit","QUnit"),De(e,r,"tape","Tape"),r}determineTestingLibraries(e){let r=[];return De(e,r,"chai","Chai"),De(e,r,"sinon","Sinon"),De(e,r,"enzyme","Enzyme"),De(e,r,"protractor","Protractor"),De(e,r,"supertest","Supertest"),De(e,r,"nock","Nock"),De(e,r,"cypress","Cypress"),De(e,r,"@testing-library/react","React Testing Library"),r}},SZe=class{constructor(){this.languageId="go"}static{a(this,"GoProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"github.com/gorilla/mux","Gorilla Mux"),De(e,r,"github.com/go-chi/chi","Chi"),De(e,r,"github.com/gin-gonic/gin","Gin"),De(e,r,"github.com/labstack/echo","Echo"),De(e,r,"github.com/revel/revel","Revel"),De(e,r,"github.com/astaxie/beego","Beego"),De(e,r,"github.com/go-martini/martini","Martini"),De(e,r,"github.com/gobuffalo/buffalo","Buffalo"),De(e,r,"github.com/goji/goji","Goji"),De(e,r,"github.com/hoisie/web","Web.go"),r}determineCoreLibraries(e){let r=[];return De(e,r,"net/http","net/http"),De(e,r,"fmt","fmt"),De(e,r,"io","io"),De(e,r,"time","time"),De(e,r,"math","math"),De(e,r,"strconv","strconv"),De(e,r,"strings","strings"),De(e,r,"sort","sort"),De(e,r,"encoding/json","encoding/json"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"github.com/onsi/ginkgo","ginkgo"),De(e,r,"github.com/onsi/gomega","gomega"),De(e,r,"github.com/stretchr/testify","testify"),De(e,r,"gopkg.in/check.v1","gocheck"),De(e,r,"github.com/franela/goblin","goblin"),De(e,r,"github.com/DATA-DOG/godog","godog"),De(e,r,"github.com/stesla/gospec","gospec"),De(e,r,"github.com/rjeczalik/gotest","gotest"),De(e,r,"github.com/smartystreets/goconvey","goconvey"),r}determineTestingLibraries(e){let r=[];return De(e,r,"github.com/stretchr/testify","Testify"),De(e,r,"github.com/smartystreets/goconvey","GoConvey"),De(e,r,"github.com/onsi/ginkgo","Ginkgo"),De(e,r,"github.com/golang/mock","GoMock"),De(e,r,"gopkg.in/check.v1","GoCheck"),De(e,r,"github.com/franela/goblin","Goblin"),De(e,r,"github.com/DATA-DOG/godog","GoDog"),De(e,r,"github.com/onsi/gomega","Gomega"),De(e,r,"github.com/stesla/gospec","GoSpec"),De(e,r,"github.com/rjeczalik/gotest","GoTest"),r}},TZe=class{constructor(){this.languageId=["python","jupyter"]}static{a(this,"PythonProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"flask","Flask"),De(e,r,"django","Django"),De(e,r,"pyramid","Pyramid"),De(e,r,"tornado","Tornado"),De(e,r,"fastapi","FastAPI"),r}determineCoreLibraries(e){let r=[];return De(e,r,"requests","requests"),De(e,r,"numpy","numpy"),De(e,r,"pandas","pandas"),De(e,r,"scipy","scipy"),De(e,r,"matplotlib","matplotlib"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"pytest","Pytest"),De(e,r,"unittest","Unittest"),De(e,r,"doctest","Doctest"),De(e,r,"nose","Nose"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mock","Mock"),De(e,r,"hypothesis","Hypothesis"),De(e,r,"behave","Behave"),De(e,r,"lettuce","Lettuce"),De(e,r,"testify","Testify"),De(e,r,"pyhamcrest","PyHamcrest"),r}},IZe=class{constructor(){this.languageId=["php","blade"]}static{a(this,"PhpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"laravel/framework","Laravel"),De(e,r,"symfony/symfony","Symfony"),De(e,r,"slim/slim","Slim"),De(e,r,"cakephp/cakephp","CakePHP"),De(e,r,"yiisoft/yii2","Yii"),De(e,r,"zendframework/zendframework","Zend Framework"),De(e,r,"phalcon/cphalcon","Phalcon"),De(e,r,"bcosca/fatfree","Fat-Free"),De(e,r,"fuel/fuel","FuelPHP"),De(e,r,"phpixie/framework","PHPixie"),r}determineCoreLibraries(e){let r=[];return De(e,r,"monolog/monolog","Monolog"),De(e,r,"vlucas/phpdotenv","PHP dotenv"),De(e,r,"symfony/console","Symfony Console"),De(e,r,"guzzlehttp/guzzle","GuzzleHttp"),De(e,r,"ramsey/uuid","Ramsey UUID"),De(e,r,"doctrine/orm","Doctrine ORM"),De(e,r,"php-di/php-di","PHP-DI"),De(e,r,"phpunit/php-timer","PHPUnit Timer"),De(e,r,"symfony/finder","Symfony Finder"),De(e,r,"symfony/yaml","Symfony Yaml"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"phpunit/phpunit","PHPUnit"),De(e,r,"behat/behat","Behat"),De(e,r,"phpspec/phpspec","PHPSpec"),De(e,r,"codeception/codeception","Codeception"),De(e,r,"atoum/atoum","Atoum"),De(e,r,"pestphp/pest","PestPHP"),De(e,r,"kahlan/kahlan","Kahlan"),De(e,r,"peridot-php/peridot","Peridot"),De(e,r,"phake/phake","Phake"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockery/mockery","Mockery"),De(e,r,"php-mock/php-mock","PHP-Mock"),De(e,r,"php-mock/php-mock-phpunit","PHP-Mock PHPUnit"),De(e,r,"padraic/mockery","Padraic Mockery"),De(e,r,"phpspec/prophecy","PHPSpec Prophecy"),De(e,r,"phpunit/php-invoker","PHPUnit Invoker"),De(e,r,"phpunit/php-token-stream","PHPUnit Token Stream"),De(e,r,"phpunit/php-code-coverage","PHPUnit Code Coverage"),De(e,r,"phpunit/php-timer","PHPUnit Timer"),De(e,r,"phpunit/php-text-template","PHPUnit Text Template"),r}},xZe=class{constructor(){this.languageId="csharp"}static{a(this,"CSharpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"Microsoft.NETCore.App",".NET Core"),De(e,r,"Microsoft.AspNetCore.App","ASP.NET Core"),r}determineCoreLibraries(e){let r=[];return De(e,r,"EntityFramework","Entity Framework"),De(e,r,"Newtonsoft.Json","Newtonsoft.Json"),De(e,r,"AutoMapper","AutoMapper"),De(e,r,"Serilog","Serilog"),De(e,r,"Dapper","Dapper"),De(e,r,"Polly","Polly"),De(e,r,"FluentValidation","FluentValidation"),De(e,r,"MediatR","MediatR"),De(e,r,"Hangfire","Hangfire"),De(e,r,"RabbitMQ.Client","RabbitMQ.Client"),De(e,r,"MassTransit","MassTransit"),De(e,r,"Microsoft.Extensions.Logging","Microsoft.Extensions.Logging"),De(e,r,"Microsoft.Extensions.DependencyInjection","Microsoft.Extensions.DependencyInjection"),De(e,r,"Microsoft.Extensions.Configuration","Microsoft.Extensions.Configuration"),De(e,r,"Microsoft.Extensions.Http","Microsoft.Extensions.Http"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"xunit","xUnit"),De(e,r,"NUnit","NUnit"),De(e,r,"SpecFlow","SpecFlow"),r}determineTestingLibraries(e){let r=[];return De(e,r,"Moq","Moq"),De(e,r,"FluentAssertions","FluentAssertions"),De(e,r,"Bogus","Bogus"),De(e,r,"RestSharp","RestSharp"),De(e,r,"Swashbuckle.AspNetCore","Swashbuckle.AspNetCore"),r}},wZe=class{constructor(){this.languageId="dart"}static{a(this,"DartProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"flutter","Flutter"),De(e,r,"angular","AngularDart"),r}determineCoreLibraries(e){let r=[];return De(e,r,"dartx","dartx"),De(e,r,"provider","Provider"),De(e,r,"rxdart","RxDart"),De(e,r,"dio","Dio"),De(e,r,"json_serializable","json_serializable"),De(e,r,"freezed","Freezed"),De(e,r,"moor","Moor"),De(e,r,"hive","Hive"),De(e,r,"http","http"),De(e,r,"path","path"),De(e,r,"intl","intl"),De(e,r,"equatable","equatable"),De(e,r,"get_it","get_it"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"test","test"),De(e,r,"flutter_test","flutter_test"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockito","mockito"),De(e,r,"bloc_test","bloc_test"),r}},RZe=class{constructor(){this.languageId="ruby"}static{a(this,"RubyProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"rails","Rails"),De(e,r,"sinatra","Sinatra"),De(e,r,"hanami","Hanami"),De(e,r,"grape","Grape"),De(e,r,"roda","Roda"),De(e,r,"padrino","Padrino"),De(e,r,"cuba","Cuba"),De(e,r,"ramaze","Ramaze"),De(e,r,"nyara","Nyara"),De(e,r,"rack","Rack"),r}determineCoreLibraries(e){let r=[];return De(e,r,"active_record","ActiveRecord"),De(e,r,"sequel","Sequel"),De(e,r,"rom","ROM"),De(e,r,"datamapper","DataMapper"),De(e,r,"mongoid","Mongoid"),De(e,r,"neo4j","Neo4j"),De(e,r,"redis","Redis"),De(e,r,"cassandra","Cassandra"),De(e,r,"couchrest","CouchRest"),De(e,r,"riak","Riak"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"rspec","RSpec"),De(e,r,"minitest","Minitest"),De(e,r,"cucumber","Cucumber"),De(e,r,"spinach","Spinach"),De(e,r,"turnip","Turnip"),De(e,r,"bacon","Bacon"),De(e,r,"shoulda","Shoulda"),De(e,r,"test-unit","Test::Unit"),De(e,r,"wrong","Wrong"),De(e,r,"contest","Contest"),r}determineTestingLibraries(e){let r=[];return De(e,r,"factory_bot","FactoryBot"),De(e,r,"faker","Faker"),De(e,r,"ffaker","FFaker"),De(e,r,"fabrication","Fabrication"),De(e,r,"machinist","Machinist"),De(e,r,"mocha","Mocha"),De(e,r,"flexmock","FlexMock"),De(e,r,"rr","RR"),De(e,r,"bourne","Bourne"),De(e,r,"not_a_mock","NotAMock"),r}},kZe=class{constructor(){this.languageId="rust"}static{a(this,"RustProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"tokio","tokio"),De(e,r,"async-std","async-std"),De(e,r,"hyper","hyper"),De(e,r,"actix-web","actix-web"),De(e,r,"rocket","rocket"),r}determineCoreLibraries(e){let r=[];return De(e,r,"serde","serde"),De(e,r,"regex","regex"),De(e,r,"rand","rand"),De(e,r,"log","log"),De(e,r,"lazy_static","lazy_static"),De(e,r,"libc","libc"),De(e,r,"futures","futures"),De(e,r,"rayon","rayon"),De(e,r,"reqwest","reqwest"),De(e,r,"warp","warp"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"test-case","test-case"),De(e,r,"proptest","proptest"),De(e,r,"quickcheck","quickcheck"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockall","mockall"),De(e,r,"double","double"),De(e,r,"rstest","rstest"),De(e,r,"mockiato","mockiato"),De(e,r,"mock_derive","mock_derive"),De(e,r,"mocktopus","mocktopus"),De(e,r,"mockers","mockers"),De(e,r,"mock_it","mock_it"),r}},PZe=class{constructor(){this.languageId=["c","cpp"]}static{a(this,"CProjectMetadataLookup")}determineBuildTools(e){return e.buildTools.filter(r=>["gcc","clang","make","cmake","autotools","ninja","meson"].includes(r.name))}determineApplicationFrameworks(e){return e.libraries.filter(r=>["libc","libuv","openssl","zlib","libevent","libcurl"].includes(r.name))}determineCoreLibraries(e){return e.libraries.filter(r=>["libpng","libjpeg","libxml2","sqlite","postgres","mysql"].includes(r.name))}determineTestingFrameworks(e){return e.libraries.filter(r=>["unity","criterion","cmocka","check","ctest","minunit"].includes(r.name))}determineTestingLibraries(e){return e.libraries.filter(r=>["cmock","fff","trompeloeil","fakeit"].includes(r.name))}};function De(t,e,r,n){let o=t.libraries.find(s=>s.name.toLowerCase().indexOf(r.toLowerCase())>-1);o&&e.push({name:n,version:o.version})}a(De,"addFromLibraries");var DZe=class{constructor(e,r){this.languageId=e;this.delegates=r}static{a(this,"CompositeProjectMetadataLookup")}determineBuildTools(e){return this.delegates.map(r=>r.determineBuildTools(e)).flat()}determineApplicationFrameworks(e){return this.delegates.map(r=>r.determineApplicationFrameworks(e)).flat()}determineCoreLibraries(e){return this.delegates.map(r=>r.determineCoreLibraries(e)).flat()}determineTestingFrameworks(e){return this.delegates.map(r=>r.determineTestingFrameworks(e)).flat()}determineTestingLibraries(e){return this.delegates.map(r=>r.determineTestingLibraries(e)).flat()}};function AIn(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(AIn,"determineProgrammingLanguage");var gIn=[new CZe,new bZe,new SZe,new TZe,new IZe,new xZe,new wZe,new RZe,new kZe,new PZe];function yIn(t){let e=gIn.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new DZe(t,gIn);return new fGt(e)}a(yIn,"getMetadataLookup");var fGt=class{constructor(e){this.delegate=e;this.languageId=e.languageId}static{a(this,"DistinctProjectMetadataLookup")}determineBuildTools(e){return this.deduplicateDependencies(this.delegate.determineBuildTools(e))}determineApplicationFrameworks(e){return this.deduplicateDependencies(this.delegate.determineApplicationFrameworks(e))}determineCoreLibraries(e){return this.deduplicateDependencies(this.delegate.determineCoreLibraries(e))}determineTestingFrameworks(e){return this.deduplicateDependencies(this.delegate.determineTestingFrameworks(e))}determineTestingLibraries(e){return this.deduplicateDependencies(this.delegate.determineTestingLibraries(e))}deduplicateDependencies(e){let r=[];return e.forEach(n=>{r.find(o=>o.name===n.name)||r.push(n)}),r}};var _In=b.Object({name:b.String(),version:b.Optional(b.String())}),EIn=b.Object({language:b.Object({id:b.String(),name:b.String(),version:b.Optional(b.String())}),libraries:b.Array(_In),buildTools:b.Array(_In)}),pGt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectMetadataSkillProcessor")}value(){return 1}processSkill(e){let r=[];r.push([new vr([`The user is working on a project with the following characteristics: +`]),1]);let n=yIn(e.language.id);return this.addProgrammingLanguage(e,r),this.addBuildTools(e,r,n),this.addApplicationFramework(e,r,n),this.addCoreLibraries(e,r,n),this.addTestingFrameworks(e,r,n),this.addTestingLibraries(e,r,n),new vr(r)}addProgrammingLanguage(e,r){let n=AIn(e);this.turnContext.collectLabel(l5,n),r.push([new vr([`- programming language: ${n}`]),1])}addBuildTools(e,r,n){this.addToPrompt(r,"- build tools:",n.determineBuildTools(e))}addApplicationFramework(e,r,n){this.addToPrompt(r,"- application frameworks:",n.determineApplicationFrameworks(e))}addCoreLibraries(e,r,n){this.addToPrompt(r,"- core libraries:",n.determineCoreLibraries(e))}addTestingFrameworks(e,r,n){this.addToPrompt(r,"- testing frameworks:",n.determineTestingFrameworks(e))}addTestingLibraries(e,r,n){this.addToPrompt(r,"- testing libraries:",n.determineTestingLibraries(e))}addToPrompt(e,r,n){if(n.length>0){n.forEach(s=>{this.turnContext.collectLabel(l5,`${s.name}${s.version?" "+s.version:""}`)});let o=n.map(s=>` - ${s.name}${s.version?" "+s.version:""}`).join(` `);e.push([new vr([`${r} -${o}`]),1])}}},l5="project-metadata",NZe=class{constructor(e){this._resolver=e;this.id=l5;this.type="explicit"}static{a(this,"ProjectMetadataSkill")}description(){return"The characteristics of the project the developer is working on (languages, frameworks)"}resolver(){return this._resolver}processor(e){return new fGt(e)}};p();var EIn=fe(require("path"));var pGt=class{constructor(e){this.turnContext=e}static{a(this,"ReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(si),n=[],o=this.filterIncludedFiles(e),s=(await this.toFileChunks(o,r)).filter(c=>c!==void 0).flat();if(s.length>0)return n.push([new vr(["The user wants you to consider the following referenced files when computing your answer."]),1]),n.push(...s),new vr(n)}filterIncludedFiles(e){return e.filter(r=>r.type==="file"&&!this.turnContext.isFileIncluded(r.uri))}async toFileChunks(e,r){return await Promise.all(e.map(async n=>{if(n.type==="file"&&n.uri)return await this.elideReferencedFiles(r,n)}))}async elideReferencedFiles(e,r){let n=await e.getOrReadTextDocument(r),o=dd(n);if(await this.turnContext.collectFile(OZe,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new c5(n.document,r.selection,r.visibleRange);return[[`Code excerpt from referenced file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),1]]}else if(o==="empty")return[[new vr([`The referenced file \`${s}\` is empty.`]),1]]}else if(n.status==="invalid")return[[new vr([`The referenced file \`${EIn.basename(r.uri)}\` is content excluded.`]),1]]}},hGt=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},OZe="references",MZe=class{constructor(){this.id=OZe;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new hGt}processor(e){return new pGt(e)}};var QJ=a(()=>[l5,E2,OZe,I_],"mandatorySkills"),sde=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new gZe(e,this.chatFetcher)}static{a(this,"ConversationContextCollector")}async collectContext(e,r,n,o,s,c){let l=[];if(s){let u=s.requiredSkills?await s.requiredSkills(e.ctx):[];l.push(...u.filter(d=>!QJ().includes(d)))}else(await this.metaPromptFetcher.fetchPromptContext(e,await this.selectableSkillDescriptors(e.ctx,e.conversation,e.turn),r,n,o)).skillIds.reverse().forEach(d=>{!l.includes(d)&&!QJ().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!QJ().includes(d)))}return l.push(...QJ()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(Xo).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(Xo).getSupportedSkills(r.id),c=e.get(fm).getDescriptors(),l=[];for(let u of c){if(o.includes(u.id)||!s.includes(u.id))continue;(!u.isAvailable||await u.isAvailable(e))&&!this.isIgnoredSkill(u.id,n)&&l.push(u)}return l}async getNonSelectableSkills(e){let r=await Iw(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...QJ(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function BZe(t,e){let[r,n,o]=await CKo(t,e);return o.push(...TKo(t)),r.length>0||n.length>0?[new vr([[new vr(["Consider the additional context:"]),1],[sj(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(BZe,"fromSkills");async function CKo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await IKo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await bKo(t,c.skillId);l&&(QJ().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(CKo,"handleSkillsInReverse");async function bKo(t,e){let n=t.ctx.get(fm).getSkill(e);try{let o=Date.now(),s=await t.skillResolver.resolve(e),c=Date.now()-o;if(s){let l=n?.processor(t),u=Date.now(),d=await l?.processSkill(s,t),f=Date.now()-u;return d?await SKo(t,n,l,d,c,f):[void 0,await LZe(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await LZe(t,n,"unresolvable",void 0,c)]}catch(o){if(ot.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof hRe)throw o;return[void 0,await LZe(t,n,"failed")]}}a(bKo,"safelyProcessSkill");async function SKo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new vr([[n,1]]):c=n,[[c,r?.value()||0],await LZe(t,e,"resolved",c,o,s)]}a(SKo,"handleProcessedSkill");async function LZe(t,e,r,n,o,s){let l=t.collector.collectiblesForCollector(e?.id??"unknown").filter(d=>d.type==="file"),u={skillId:e?.id??"unknown",resolution:r,files:l,resolutionTimeMs:o,processingTimeMs:s};if(n){let d=await rj(t.ctx),f=await t.ctx.get(dl).getBestChatModelConfig(Z1("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=Ms(f.tokenizer).tokenLength(h)}return t.ctx.get(I0).addResolution(t.turn.id,u),u}a(LZe,"determineResolution");function TKo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(TKo,"handleIgnoredSkills");async function IKo(t,e,r){if(e!==l5&&e!==E2)return!0;let n=t.ctx.get(tr),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===l5:e===E2}a(IKo,"includeSkill");var qJ=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=ide(e.conversation.turns.slice(0,-1));o!==null&&n.push([o,.6]);let[s,c]=await this.elidableSkills(e,r);return s!==null&&(o!==null&&n.push(["",.1]),n.push([s,.8])),[new vr(n),c]}async elidableSkills(e,r){return await BZe(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:kt(e.ctx,ze.UseAgentsMd),includeNestedAgentsMdInstructions:kt(e.ctx,ze.UseNestedAgentsMd),includeClaudeMdInstructions:kt(e.ctx,ze.UseClaudeMd),includeNestedClaudeMdInstructions:kt(e.ctx,ze.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(Mf).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(Mf).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=gT(e.conversation.getLastTurn().request.message),u;o?typeof l=="string"?u=o+` +${o}`]),1])}}},l5="project-metadata",NZe=class{constructor(e){this._resolver=e;this.id=l5;this.type="explicit"}static{a(this,"ProjectMetadataSkill")}description(){return"The characteristics of the project the developer is working on (languages, frameworks)"}resolver(){return this._resolver}processor(e){return new pGt(e)}};p();var vIn=fe(require("path"));var hGt=class{constructor(e){this.turnContext=e}static{a(this,"ReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(si),n=[],o=this.filterIncludedFiles(e),s=(await this.toFileChunks(o,r)).filter(c=>c!==void 0).flat();if(s.length>0)return n.push([new vr(["The user wants you to consider the following referenced files when computing your answer."]),1]),n.push(...s),new vr(n)}filterIncludedFiles(e){return e.filter(r=>r.type==="file"&&!this.turnContext.isFileIncluded(r.uri))}async toFileChunks(e,r){return await Promise.all(e.map(async n=>{if(n.type==="file"&&n.uri)return await this.elideReferencedFiles(r,n)}))}async elideReferencedFiles(e,r){let n=await e.getOrReadTextDocument(r),o=dd(n);if(await this.turnContext.collectFile(OZe,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new c5(n.document,r.selection,r.visibleRange);return[[`Code excerpt from referenced file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),1]]}else if(o==="empty")return[[new vr([`The referenced file \`${s}\` is empty.`]),1]]}else if(n.status==="invalid")return[[new vr([`The referenced file \`${vIn.basename(r.uri)}\` is content excluded.`]),1]]}},mGt=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},OZe="references",MZe=class{constructor(){this.id=OZe;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new mGt}processor(e){return new hGt(e)}};var qJ=a(()=>[l5,E2,OZe,I_],"mandatorySkills"),ade=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new gZe(e,this.chatFetcher)}static{a(this,"ConversationContextCollector")}async collectContext(e,r,n,o,s,c){let l=[];if(s){let u=s.requiredSkills?await s.requiredSkills(e.ctx):[];l.push(...u.filter(d=>!qJ().includes(d)))}else(await this.metaPromptFetcher.fetchPromptContext(e,await this.selectableSkillDescriptors(e.ctx,e.conversation,e.turn),r,n,o)).skillIds.reverse().forEach(d=>{!l.includes(d)&&!qJ().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!qJ().includes(d)))}return l.push(...qJ()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(Xo).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(Xo).getSupportedSkills(r.id),c=e.get(fm).getDescriptors(),l=[];for(let u of c){if(o.includes(u.id)||!s.includes(u.id))continue;(!u.isAvailable||await u.isAvailable(e))&&!this.isIgnoredSkill(u.id,n)&&l.push(u)}return l}async getNonSelectableSkills(e){let r=await Iw(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...qJ(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function BZe(t,e){let[r,n,o]=await SKo(t,e);return o.push(...xKo(t)),r.length>0||n.length>0?[new vr([[new vr(["Consider the additional context:"]),1],[sj(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(BZe,"fromSkills");async function SKo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await wKo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await TKo(t,c.skillId);l&&(qJ().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(SKo,"handleSkillsInReverse");async function TKo(t,e){let n=t.ctx.get(fm).getSkill(e);try{let o=Date.now(),s=await t.skillResolver.resolve(e),c=Date.now()-o;if(s){let l=n?.processor(t),u=Date.now(),d=await l?.processSkill(s,t),f=Date.now()-u;return d?await IKo(t,n,l,d,c,f):[void 0,await LZe(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await LZe(t,n,"unresolvable",void 0,c)]}catch(o){if(ot.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof hRe)throw o;return[void 0,await LZe(t,n,"failed")]}}a(TKo,"safelyProcessSkill");async function IKo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new vr([[n,1]]):c=n,[[c,r?.value()||0],await LZe(t,e,"resolved",c,o,s)]}a(IKo,"handleProcessedSkill");async function LZe(t,e,r,n,o,s){let l=t.collector.collectiblesForCollector(e?.id??"unknown").filter(d=>d.type==="file"),u={skillId:e?.id??"unknown",resolution:r,files:l,resolutionTimeMs:o,processingTimeMs:s};if(n){let d=await rj(t.ctx),f=await t.ctx.get(dl).getBestChatModelConfig(Z1("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=Ms(f.tokenizer).tokenLength(h)}return t.ctx.get(x0).addResolution(t.turn.id,u),u}a(LZe,"determineResolution");function xKo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(xKo,"handleIgnoredSkills");async function wKo(t,e,r){if(e!==l5&&e!==E2)return!0;let n=t.ctx.get(tr),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===l5:e===E2}a(wKo,"includeSkill");var jJ=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=ode(e.conversation.turns.slice(0,-1));o!==null&&n.push([o,.6]);let[s,c]=await this.elidableSkills(e,r);return s!==null&&(o!==null&&n.push(["",.1]),n.push([s,.8])),[new vr(n),c]}async elidableSkills(e,r){return await BZe(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:kt(e.ctx,ze.UseAgentsMd),includeNestedAgentsMdInstructions:kt(e.ctx,ze.UseNestedAgentsMd),includeClaudeMdInstructions:kt(e.ctx,ze.UseClaudeMd),includeNestedClaudeMdInstructions:kt(e.ctx,ze.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(Mf).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(Mf).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=gT(e.conversation.getLastTurn().request.message),u;o?typeof l=="string"?u=o+` -`+l:u=[{type:"text",text:o},...l]:u=l;let[d,f]=await this.elidableContent(e,n);return[[{role:"system",content:r},{role:"user",content:d},{role:"system",content:this.suffix(e)},{role:"user",content:u}],f]}},FZe=class extends qJ{static{a(this,"PanelUserPromptStrategy")}suffix(e){return ls` +`+l:u=[{type:"text",text:o},...l]:u=l;let[d,f]=await this.elidableContent(e,n);return[[{role:"system",content:r},{role:"user",content:d},{role:"system",content:this.suffix(e)},{role:"user",content:u}],f]}},FZe=class extends jJ{static{a(this,"PanelUserPromptStrategy")}suffix(e){return ls` Use the above information, including the additional context and conversation history (if available) to answer the user's question below. Prioritize the context given in the user's question. When generating code, think step-by-step. Briefly explain the code and then output it in a single code block. @@ -2693,7 +2693,7 @@ ${o}`]),1])}}},l5="project-metadata",NZe=class{constructor(e){this._resolver=e;t Do not start your answer with a programming language name. Do not include follow up questions or suggestions for next turns. Respond in the following locale: ${e.conversation.userLanguage}. - `.trim()}};var UZe=class extends qJ{static{a(this,"InlineUserPromptStrategy")}suffix(e){return ls` + `.trim()}};var UZe=class extends jJ{static{a(this,"InlineUserPromptStrategy")}suffix(e){return ls` Use the above information, including the additional context and conversation history (if available) to answer the user's question below. Prioritize the context given in the user's question. Keep your answers short and impersonal. @@ -2748,7 +2748,7 @@ ${o}`]),1])}}},l5="project-metadata",NZe=class{constructor(e){this._resolver=e;t - The first row of a codeblock must never be indented. - Code in codeblocks must not contain line numbers. - You must not return a codeblock containing the final code, but only individual codeblocks for each change. - `.trim()}};p();var QZe=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=ide(e.turns.slice(0,-1)),n=[];return r!==null&&n.push([r,.6]),new vr(n)}suffix(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");if(!e.supportedSkillDescriptors)throw new Error("Supported skills must be provided for meta prompts");return this.buildMetaPrompt(e.supportedSkillDescriptors)}buildMetaPrompt(e){return ls` + `.trim()}};p();var QZe=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=ode(e.turns.slice(0,-1)),n=[];return r!==null&&n.push([r,.6]),new vr(n)}suffix(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");if(!e.supportedSkillDescriptors)throw new Error("Supported skills must be provided for meta prompts");return this.buildMetaPrompt(e.supportedSkillDescriptors)}buildMetaPrompt(e){return ls` Your task is to provide a helpful answer to the user's question. To help you create that answer, you can resolve skills that give you more context. Each skill has a description and some example user questions to help you understand when the skill may be useful. @@ -2757,7 +2757,7 @@ ${o}`]),1])}}},l5="project-metadata",NZe=class{constructor(e){this._resolver=e;t ${e.map(r=>`${this.skillToPrompt(r)} `).join(` `)} - `.trim()}createFunctionArgumentSchema(e){let r=mSn(e.map(n=>n.id));return b.Object({skillIds:b.Array(r,{description:"The skill ids to resolve ranked from most to least useful"})})}toolConfig(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");return{tool_choice:{type:"function",function:{name:"resolveSkills"}},tools:[{type:"function",function:{name:"resolveSkills",description:"Resolves the skills by id to help answer the user question.",parameters:this.createFunctionArgumentSchema(e.supportedSkillDescriptors)}}],extractArguments(r){return{skillIds:AF(r).skillIds}}}}skillToPrompt(e){let r=e.description?e.description():e.id,n=`Skill Id: ${e.id} + `.trim()}createFunctionArgumentSchema(e){let r=gSn(e.map(n=>n.id));return b.Object({skillIds:b.Array(r,{description:"The skill ids to resolve ranked from most to least useful"})})}toolConfig(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");return{tool_choice:{type:"function",function:{name:"resolveSkills"}},tools:[{type:"function",function:{name:"resolveSkills",description:"Resolves the skills by id to help answer the user question.",parameters:this.createFunctionArgumentSchema(e.supportedSkillDescriptors)}}],extractArguments(r){return{skillIds:AF(r).skillIds}}}}skillToPrompt(e){let r=e.description?e.description():e.id,n=`Skill Id: ${e.id} Skill Description: ${r}`,o=e.examples?e.examples():[];return o.length>0&&(n+=` Skill Examples: ${o.map(s=>` - ${s}`).join(` @@ -2780,7 +2780,7 @@ ${o.map(s=>` - ${s}`).join(` - The question must not appear in the conversation history. - The question must not have already been answered. - The question must be in the following locale: ${e.conversation.userLanguage}. - `.trim()}elidableContent(e){let r=ide(e.turns.slice()),n=[];return r!==null&&n.push([r,.6]),new vr(n)}promptContent(e,r,n){return[[{role:"system",content:r},{role:"user",content:this.elidableContent(e.conversation)},{role:"system",content:this.suffix(e)}],[]]}};p();var xKo=[{type:"function",function:{name:"queryWithKeywords",description:"Searches the workspace for synonyms and relevant keywords related to the original user query. These keywords could be used as file names, symbol names, abbreviations, or comments in the relevant code.",parameters:b.Object({keywords:b.Array(b.Object({keyword:b.String({description:"A keyword or phrase relevant to the original user query that a user could search to answer their question. Keywords are not generic and do not repeat."}),variations:b.Array(b.String(),{description:"An array of relevant variations of the keyword. Variations include synonyms and plural forms. Variations are not generic and do not repeat."})}))})}}],jZe=class extends qJ{static{a(this,"UserQuerySynonymsPromptStrategy")}suffix(){return` + `.trim()}elidableContent(e){let r=ode(e.turns.slice()),n=[];return r!==null&&n.push([r,.6]),new vr(n)}promptContent(e,r,n){return[[{role:"system",content:r},{role:"user",content:this.elidableContent(e.conversation)},{role:"system",content:this.suffix(e)}],[]]}};p();var RKo=[{type:"function",function:{name:"queryWithKeywords",description:"Searches the workspace for synonyms and relevant keywords related to the original user query. These keywords could be used as file names, symbol names, abbreviations, or comments in the relevant code.",parameters:b.Object({keywords:b.Array(b.Object({keyword:b.String({description:"A keyword or phrase relevant to the original user query that a user could search to answer their question. Keywords are not generic and do not repeat."}),variations:b.Array(b.String(),{description:"An array of relevant variations of the keyword. Variations include synonyms and plural forms. Variations are not generic and do not repeat."})}))})}}],jZe=class extends jJ{static{a(this,"UserQuerySynonymsPromptStrategy")}suffix(){return` You are a coding assistant that helps developers find relevant code in their workspace by providing a list of relevant keywords they can search for. The user will provide you with potentially relevant information from the workspace. This information may be incomplete. @@ -2803,39 +2803,39 @@ queryWithKeywords([ { "keyword": "base64", "variations": ["base 64"] }, { "keyword": "encode", "variations": ["encoding", "encoded", "encoder", "encoders"] } ]); -`.trim()}promptContent(e,r,n){if(n.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");let o=gT(e.conversation.getLastTurn().request.message),s=[{role:"system",content:r},{role:"system",content:this.suffix()},{role:"user",content:o}];return Promise.resolve([s,[]])}toolConfig(e){if(e.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");return{tools:xKo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=AF(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!iJe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!iJe(s,"variations")||!s.variations||!Array.isArray(s.variations))))for(let c of s.variations)typeof c=="string"&&o.add(c.toLowerCase());return{keywords:Array.from(o)??[]}}}}};var mGt=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function mRe(t,e,r){return new mGt(t,e,r)}a(mRe,"descriptor");var vIn=[mRe("user",Z1("user"),()=>new FZe),mRe("inline",Z1("inline"),()=>new UZe),mRe("meta",Z1("meta"),()=>new QZe),mRe("suggestions",Z1("suggestions"),()=>new qZe),mRe("synonyms",Z1("synonyms"),()=>new jZe)],HZe=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await rj(e),s=Z1(r,o),c=vIn.find(l=>l.promptType===r&&s.includes(n));if(!c)throw new Error(`No prompt strategy found for promptType: ${r} and modelFamily: ${n}`);return c.strategy(e)}get descriptors(){return vIn}};var bIn=require("console");var jA=class{constructor(e,r=new HZe){this.ctx=e;this.promptStrategyFactory=r}static{a(this,"ConversationPromptEngine")}async toPrompt(e,r){let n=await this.promptStrategyFactory.createPromptStrategy(this.ctx,r.promptType,r.modelConfiguration.modelFamily),o=await this.ctx.get(Fr).resolveSession(),[s,c]=await n.promptContent(e,this.safetyPrompt(r.userSelectedModelName??r.modelConfiguration.uiName,o),r),[l,u]=this.elideChatMessages(s,r.modelConfiguration);return await this.ctx.get(dm).inspectPrompt({type:r.promptType,prompt:CIn(l),tokens:u}),this.ctx.get(I0).addPrompt(e.turn.id,CIn(l),r.promptType),{messages:l,tokens:u,skillResolutions:c,toolConfig:n.toolConfig?.(r)}}elideChatMessages(e,r){let n=e.filter(l=>!(typeof l.content=="string"||Array.isArray(l.content)));(0,bIn.assert)(n.length==1,"Only one elidable message is supported right now.");let o=this.computeNonElidableTokens(e,r),s=r.maxRequestTokens-o,c=e.map(l=>typeof l.content=="string"||Array.isArray(l.content)?l:{role:l.role,content:wKo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,NHt(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),NHt(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Ir).getEditorInfo().readableName??this.ctx.get(Ir).getEditorInfo().name,o=RKo(process.platform);return yTn(this.ctx,n,r?.login,o,e)}};function wKo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(wKo,"processResultOfElidableText");function CIn(t){return t.map(e=>Mn(e.content)).join(` +`.trim()}promptContent(e,r,n){if(n.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");let o=gT(e.conversation.getLastTurn().request.message),s=[{role:"system",content:r},{role:"system",content:this.suffix()},{role:"user",content:o}];return Promise.resolve([s,[]])}toolConfig(e){if(e.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");return{tools:RKo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=AF(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!iJe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!iJe(s,"variations")||!s.variations||!Array.isArray(s.variations))))for(let c of s.variations)typeof c=="string"&&o.add(c.toLowerCase());return{keywords:Array.from(o)??[]}}}}};var gGt=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function mRe(t,e,r){return new gGt(t,e,r)}a(mRe,"descriptor");var CIn=[mRe("user",Z1("user"),()=>new FZe),mRe("inline",Z1("inline"),()=>new UZe),mRe("meta",Z1("meta"),()=>new QZe),mRe("suggestions",Z1("suggestions"),()=>new qZe),mRe("synonyms",Z1("synonyms"),()=>new jZe)],HZe=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await rj(e),s=Z1(r,o),c=CIn.find(l=>l.promptType===r&&s.includes(n));if(!c)throw new Error(`No prompt strategy found for promptType: ${r} and modelFamily: ${n}`);return c.strategy(e)}get descriptors(){return CIn}};var SIn=require("console");var jA=class{constructor(e,r=new HZe){this.ctx=e;this.promptStrategyFactory=r}static{a(this,"ConversationPromptEngine")}async toPrompt(e,r){let n=await this.promptStrategyFactory.createPromptStrategy(this.ctx,r.promptType,r.modelConfiguration.modelFamily),o=await this.ctx.get(Or).resolveSession(),[s,c]=await n.promptContent(e,this.safetyPrompt(r.userSelectedModelName??r.modelConfiguration.uiName,o),r),[l,u]=this.elideChatMessages(s,r.modelConfiguration);return await this.ctx.get(dm).inspectPrompt({type:r.promptType,prompt:bIn(l),tokens:u}),this.ctx.get(x0).addPrompt(e.turn.id,bIn(l),r.promptType),{messages:l,tokens:u,skillResolutions:c,toolConfig:n.toolConfig?.(r)}}elideChatMessages(e,r){let n=e.filter(l=>!(typeof l.content=="string"||Array.isArray(l.content)));(0,SIn.assert)(n.length==1,"Only one elidable message is supported right now.");let o=this.computeNonElidableTokens(e,r),s=r.maxRequestTokens-o,c=e.map(l=>typeof l.content=="string"||Array.isArray(l.content)?l:{role:l.role,content:kKo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,MHt(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),MHt(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Ir).getEditorInfo().readableName??this.ctx.get(Ir).getEditorInfo().name,o=PKo(process.platform);return _Tn(this.ctx,n,r?.login,o,e)}};function kKo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(kKo,"processResultOfElidableText");function bIn(t){return t.map(e=>Mn(e.content)).join(` -`)}a(CIn,"debugChatMessages");function RKo(t){switch(t){case"darwin":return"macOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";case"openbsd":return"OpenBSD";case"sunos":return"SunOS";case"aix":return"AIX";default:return}}a(RKo,"mapPlatformToOs");var aj=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await Ro.getModelConfiguration(e.ctx,"suggestions",{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(jA).toPrompt(e,c),u=o.extendedBy({messageSource:"chat.suggestions"},{promptTokenLen:l.tokens}),d={modelConfiguration:s,messages:l.messages,uiKind:n,llmInteraction:e.toLlmInteraction()};if(l.toolConfig===void 0)throw new Error("No tool call configuration found in suggestions prompt.");d.tool_choice=l.toolConfig.tool_choice,d.tools=l.toolConfig.tools;let f=await this.chatFetcher.fetchResponse(d,r,u);if(f.type!=="success"&&(ot.error(this.ctx,"Failed to fetch suggestions, trying again..."),f=await this.chatFetcher.fetchResponse(d,r,u)),f.type==="success"){if(!f.toolCalls||f.toolCalls.length===0){ot.error(this.ctx,"Missing tool call in suggestions response");return}let h=f.toolCalls[0],{followUp:m,suggestedTitle:g}=l.toolConfig.extractArguments(h);if(!m||!g){ot.error(this.ctx,"Missing follow-up or suggested title in suggestions response");return}return{followUp:m.trim(),suggestedTitle:g.trim(),promptTokenLen:l.tokens,numTokens:f.numTokens+h.approxNumTokens}}else if(f.type==="successMultiple"){ot.error(this.ctx,"successMultiple response is unexpected for suggestions");return}else if(f.type==="tool_calls"){ot.error(this.ctx,"tool_calls response is unexpected for suggestions");return}else{ot.error(this.ctx,`Failed to fetch suggestions due to reason: ${f.reason}`);return}}};p();p();var gGt="v1",xw=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},ww=class extends xw{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},mm=class extends xw{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},mp=class extends xw{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},ade=class extends xw{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var lde=new pe("codingAgentUtils"),cde=29950;function SIn(t,e,r){if(e.length>=cde)return lde.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${cde}`),e=e.slice(-cde),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=cde){let o=cde-e.length-2;lde.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${cde}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` +`)}a(bIn,"debugChatMessages");function PKo(t){switch(t){case"darwin":return"macOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";case"openbsd":return"OpenBSD";case"sunos":return"SunOS";case"aix":return"AIX";default:return}}a(PKo,"mapPlatformToOs");var aj=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await Ro.getModelConfiguration(e.ctx,"suggestions",{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(jA).toPrompt(e,c),u=o.extendedBy({messageSource:"chat.suggestions"},{promptTokenLen:l.tokens}),d={modelConfiguration:s,messages:l.messages,uiKind:n,llmInteraction:e.toLlmInteraction()};if(l.toolConfig===void 0)throw new Error("No tool call configuration found in suggestions prompt.");d.tool_choice=l.toolConfig.tool_choice,d.tools=l.toolConfig.tools;let f=await this.chatFetcher.fetchResponse(d,r,u);if(f.type!=="success"&&(ot.error(this.ctx,"Failed to fetch suggestions, trying again..."),f=await this.chatFetcher.fetchResponse(d,r,u)),f.type==="success"){if(!f.toolCalls||f.toolCalls.length===0){ot.error(this.ctx,"Missing tool call in suggestions response");return}let h=f.toolCalls[0],{followUp:m,suggestedTitle:g}=l.toolConfig.extractArguments(h);if(!m||!g){ot.error(this.ctx,"Missing follow-up or suggested title in suggestions response");return}return{followUp:m.trim(),suggestedTitle:g.trim(),promptTokenLen:l.tokens,numTokens:f.numTokens+h.approxNumTokens}}else if(f.type==="successMultiple"){ot.error(this.ctx,"successMultiple response is unexpected for suggestions");return}else if(f.type==="tool_calls"){ot.error(this.ctx,"tool_calls response is unexpected for suggestions");return}else{ot.error(this.ctx,`Failed to fetch suggestions due to reason: ${f.reason}`);return}}};p();p();var AGt="v1",xw=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},ww=class extends xw{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},mm=class extends xw{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},mp=class extends xw{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},cde=class extends xw{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var ude=new pe("codingAgentUtils"),lde=29950;function TIn(t,e,r){if(e.length>=lde)return ude.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${lde}`),e=e.slice(-lde),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=lde){let o=lde-e.length-2;ude.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${lde}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` -${r}`:""),isTruncated:n}}a(SIn,"truncatePrompt");function ude(t){return t.length<=20?t:t.substring(0,20)+"..."}a(ude,"generateTitleFromUserPrompt");function TIn(t){return`Cloud agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a(TIn,"formatBodyPlaceholder");function IIn(t,e,r){let n=t.get(si),o=[],s=new Set;if(e)for(let c of e)try{if(c.type==="file"||c.type==="directory"){let l=n.getRelativePath({uri:c.uri});l&&!s.has(l)&&(o.push(l),s.add(l),lde.debug(t,`Added ${c.type} context: ${l}`))}}catch(l){let u=c.type==="file"||c.type==="directory"||c.type==="tool"?c.uri:`${c.type} reference`;lde.warn(t,`Error extracting relative path for ${u}`,l)}if(r?.uri)try{let c=n.getRelativePath({uri:r.uri});c&&!s.has(c)&&(o.push(c),s.add(c),lde.debug(t,`Added active editor: ${c}`))}catch(c){lde.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a(IIn,"extractContextPaths");function xIn(t){return t.length===0?"":`The user has attached the following files from their workspace: +${r}`:""),isTruncated:n}}a(TIn,"truncatePrompt");function dde(t){return t.length<=20?t:t.substring(0,20)+"..."}a(dde,"generateTitleFromUserPrompt");function IIn(t){return`Cloud agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a(IIn,"formatBodyPlaceholder");function xIn(t,e,r){let n=t.get(si),o=[],s=new Set;if(e)for(let c of e)try{if(c.type==="file"||c.type==="directory"){let l=n.getRelativePath({uri:c.uri});l&&!s.has(l)&&(o.push(l),s.add(l),ude.debug(t,`Added ${c.type} context: ${l}`))}}catch(l){let u=c.type==="file"||c.type==="directory"||c.type==="tool"?c.uri:`${c.type} reference`;ude.warn(t,`Error extracting relative path for ${u}`,l)}if(r?.uri)try{let c=n.getRelativePath({uri:r.uri});c&&!s.has(c)&&(o.push(c),s.add(c),ude.debug(t,`Added active editor: ${c}`))}catch(c){ude.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a(xIn,"extractContextPaths");function wIn(t){return t.length===0?"":`The user has attached the following files from their workspace: ${t.map(r=>`- ${r}`).join(` -`)}`}a(xIn,"formatContextFiles");p();p();var GZe=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},x_=class extends GZe{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},fd=class extends GZe{constructor(r,n,o){super(o||`GitHub API request failed: ${r} ${n}`);this.status=r;this.statusText=n}static{a(this,"GitHubClientApiError")}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500&&this.status<600}};p();var AGt=(h=>(h.Actions="actions",h.Composer="composer",h.Erlang="erlang",h.Go="go",h.Maven="maven",h.Npm="npm",h.Nuget="nuget",h.Pip="pip",h.Pub="pub",h.RubyGems="rubygems",h.Rust="rust",h))(AGt||{});p();p();p();function cj(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}a(cj,"getUserAgent");p();p();function $Ze(t,e,r,n){if(typeof r!="function")throw new Error("method for before hook must be a function");return n||(n={}),Array.isArray(e)?e.reverse().reduce((o,s)=>$Ze.bind(null,t,s,o,n),r)():Promise.resolve().then(()=>t.registry[e]?t.registry[e].reduce((o,s)=>s.hook.bind(null,o,n),r)():r(n))}a($Ze,"register");p();function wIn(t,e,r,n){let o=n;t.registry[r]||(t.registry[r]=[]),e==="before"&&(n=a((s,c)=>Promise.resolve().then(o.bind(null,c)).then(s.bind(null,c)),"hook")),e==="after"&&(n=a((s,c)=>{let l;return Promise.resolve().then(s.bind(null,c)).then(u=>(l=u,o(l,c))).then(()=>l)},"hook")),e==="error"&&(n=a((s,c)=>Promise.resolve().then(s.bind(null,c)).catch(l=>o(l,c)),"hook")),t.registry[r].push({hook:n,orig:o})}a(wIn,"addHook");p();function RIn(t,e,r){if(!t.registry[e])return;let n=t.registry[e].map(o=>o.orig).indexOf(r);n!==-1&&t.registry[e].splice(n,1)}a(RIn,"removeHook");var kIn=Function.bind,PIn=kIn.bind(kIn);function DIn(t,e,r){let n=PIn(RIn,null).apply(null,r?[e,r]:[e]);t.api={remove:n},t.remove=n,["before","error","after","wrap"].forEach(o=>{let s=r?[e,o,r]:[e,o];t[o]=t.api[o]=PIn(wIn,null).apply(null,s)})}a(DIn,"bindApi");function kKo(){let t=Symbol("Singular"),e={registry:{}},r=$Ze.bind(null,e,t);return DIn(r,e,t),r}a(kKo,"Singular");function PKo(){let t={registry:{}},e=$Ze.bind(null,t);return DIn(e,t),e}a(PKo,"Collection");var NIn={Singular:kKo,Collection:PKo};p();p();var DKo="0.0.0-development",NKo=`octokit-endpoint.js/${DKo} ${cj()}`,MKo={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":NKo},mediaType:{format:""}};function OKo(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(OKo,"lowercaseKeys");function LKo(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);if(e===null)return!0;let r=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(t)}a(LKo,"isPlainObject");function LIn(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{LKo(e[n])?n in t?r[n]=LIn(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(LIn,"mergeDeep");function MIn(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(MIn,"removeUndefinedProperties");function _Gt(t,e,r){if(typeof e=="string"){let[o,s]=e.split(" ");r=Object.assign(s?{method:o,url:s}:{url:o},r)}else r=Object.assign({},e);r.headers=OKo(r.headers),MIn(r),MIn(r.headers);let n=LIn(t||{},r);return r.url==="/graphql"&&(t&&t.mediaType.previews?.length&&(n.mediaType.previews=t.mediaType.previews.filter(o=>!n.mediaType.previews.includes(o)).concat(n.mediaType.previews)),n.mediaType.previews=(n.mediaType.previews||[]).map(o=>o.replace(/-preview/,""))),n}a(_Gt,"merge");function BKo(t,e){let r=/\?/.test(t)?"&":"?",n=Object.keys(e);return n.length===0?t:t+r+n.map(o=>o==="q"?"q="+e.q.split("+").map(encodeURIComponent).join("+"):`${o}=${encodeURIComponent(e[o])}`).join("&")}a(BKo,"addQueryParameters");var FKo=/\{[^{}}]+\}/g;function UKo(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(QKo,"extractUrlVariableNames");function OIn(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(OIn,"omit");function BIn(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e}).join("")}a(BIn,"encodeReserved");function fde(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a(fde,"encodeUnreserved");function gRe(t,e,r){return e=t==="+"||t==="#"?BIn(e):fde(e),r?fde(r)+"="+e:e}a(gRe,"encodeValue");function dde(t){return t!=null}a(dde,"isDefined");function yGt(t){return t===";"||t==="&"||t==="?"}a(yGt,"isKeyOperator");function qKo(t,e,r,n){var o=t[r],s=[];if(dde(o)&&o!=="")if(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||typeof o=="boolean")o=o.toString(),n&&n!=="*"&&(o=o.substring(0,parseInt(n,10))),s.push(gRe(e,o,yGt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(dde).forEach(function(c){s.push(gRe(e,c,yGt(e)?r:""))}):Object.keys(o).forEach(function(c){dde(o[c])&&s.push(gRe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(dde).forEach(function(l){c.push(gRe(e,l))}):Object.keys(o).forEach(function(l){dde(o[l])&&(c.push(fde(l)),c.push(gRe(e,o[l].toString())))}),yGt(e)?s.push(fde(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?dde(o)&&s.push(fde(r)):o===""&&(e==="&"||e==="?")?s.push(fde(r)+"="):o===""&&s.push("");return s}a(qKo,"getValues");function jKo(t){return{expand:HKo.bind(null,t)}}a(jKo,"parseUrl");function HKo(t,e){var r=["+","#",".","/",";","?","&"];return t=t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(n,o,s){if(o){let l="",u=[];if(r.indexOf(o.charAt(0))!==-1&&(l=o.charAt(0),o=o.substr(1)),o.split(/,/g).forEach(function(d){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(d);u.push(qKo(e,l,f[1],f[2]||f[3]))}),l&&l!=="+"){var c=",";return l==="?"?c="&":l!=="#"&&(c=l),(u.length!==0?l:"")+u.join(c)}else return u.join(",")}else return BIn(s)}),t==="/"?t:t.replace(/\/$/,"")}a(HKo,"expand");function FIn(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=OIn(t,["method","baseUrl","url","headers","request","mediaType"]),c=QKo(r);r=jKo(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=OIn(s,l);if(!/application\/octet-stream/i.test(n.accept)&&(t.mediaType.format&&(n.accept=n.accept.split(/,/).map(f=>f.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),r.endsWith("/graphql")&&t.mediaType.previews?.length)){let f=n.accept.match(/(?{let m=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${h}-preview${m}`}).join(",")}return["GET","HEAD"].includes(e)?r=BKo(r,u):"data"in u?o=u.data:Object.keys(u).length&&(o=u),!n["content-type"]&&typeof o<"u"&&(n["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(e)&&typeof o>"u"&&(o=""),Object.assign({method:e,url:r,headers:n},typeof o<"u"?{body:o}:null,t.request?{request:t.request}:null)}a(FIn,"parse");function GKo(t,e,r){return FIn(_Gt(t,e,r))}a(GKo,"endpointWithDefaults");function UIn(t,e){let r=_Gt(t,e),n=GKo.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:UIn.bind(null,r),merge:_Gt.bind(null,r),parse:FIn})}a(UIn,"withDefaults");var QIn=UIn(null,MKo);var XIn=fe(GIn(),1);p();var $Ko=/^-?\d+$/,WIn=/^-?\d+n+$/,EGt=JSON.stringify,$In=JSON.parse,VKo=/^-?\d+n$/,WKo=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,zKo=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,zIn=a((t,e,r)=>"rawJSON"in JSON?EGt(t,(c,l)=>typeof l=="bigint"?JSON.rawJSON(l.toString()):typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r):t?EGt(t,(c,l)=>typeof l=="string"&&WIn.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(WKo,"$1$2$3").replace(zKo,"$1$2$3"):EGt(t,e,r),"JSONStringify"),YZe=new Map,YKo=a(()=>{let t=JSON.parse.toString();if(YZe.has(t))return YZe.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return YZe.set(t,e),e}catch{return YZe.set(t,!1),!1}},"isContextSourceSupported"),KKo=a((t,e,r,n)=>typeof e=="string"&&VKo.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&WIn.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),JKo=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return $In(t,e);if(YKo())return JKo(t,e);let r=t.replace(ZKo,(n,o,s,c)=>{let l=n[0]==='"';if(l&&XKo.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.lengthKKo(n,o,s,e))},"JSONParse");p();var HJ=class extends Error{static{a(this,"RequestError")}name;status;request;response;constructor(e,r,n){super(e,{cause:n.cause}),this.name="HttpError",this.status=Number.parseInt(r),Number.isNaN(this.status)&&(this.status=0);"response"in n&&(this.response=n.response);let o=Object.assign({},n.request);n.request.headers.authorization&&(o.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/(?"","noop");async function ZIn(t){let e=t.request?.fetch||globalThis.fetch;if(!e)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let r=t.request?.log||console,n=t.request?.parseSuccessResponseBody!==!1,o=rJo(t.body)||Array.isArray(t.body)?zIn(t.body):t.body,s=Object.fromEntries(Object.entries(t.headers).map(([h,m])=>[h,String(m)])),c;try{c=await e(t.url,{method:t.method,body:o,redirect:t.request?.redirect,headers:s,signal:t.request?.signal,...t.body&&{duplex:"half"}})}catch(h){let m="Unknown Error";if(h instanceof Error){if(h.name==="AbortError")throw h.status=500,h;m=h.message,h.name==="TypeError"&&"cause"in h&&(h.cause instanceof Error?m=h.cause.message:typeof h.cause=="string"&&(m=h.cause))}let g=new HJ(m,500,{request:t});throw g.cause=h,g}let l=c.status,u=c.url,d={};for(let[h,m]of c.headers)d[h]=m;let f={url:u,status:l,headers:d,data:""};if("deprecation"in d){let h=d.link&&d.link.match(/<([^<>]+)>; rel="deprecation"/),m=h&&h.pop();r.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${d.sunset}${m?`. See ${m}`:""}`)}if(l===204||l===205)return f;if(t.method==="HEAD"){if(l<400)return f;throw new HJ(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await vGt(c),new HJ("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await vGt(c),new HJ(iJo(f.data),l,{response:f,request:t});return f.data=n?await vGt(c):c.body,f}a(ZIn,"fetchWrapper");async function vGt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch(JIn);let r=(0,XIn.safeParse)(e);if(nJo(r)){let n="";try{return n=await t.text(),KIn(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(JIn):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(vGt,"getResponseData");function nJo(t){return t.type==="application/json"||t.type==="application/scim+json"}a(nJo,"isJSONResponse");function iJo(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return"Unknown error";if("message"in t){let e="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(r=>JSON.stringify(r)).join(", ")}${e}`:`${t.message}${e}`}return`Unknown error: ${JSON.stringify(t)}`}a(iJo,"toErrorMessage");function CGt(t,e){let r=t.defaults(e);return Object.assign(a(function(o,s){let c=r.merge(o,s);if(!c.request||!c.request.hook)return ZIn(r.parse(c));let l=a((u,d)=>ZIn(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:CGt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:CGt.bind(null,r)})}a(CGt,"withDefaults");var yRe=CGt(QIn,tJo);p();var oJo="0.0.0-development";function sJo(t){return`Request failed due to following response errors: +`)}`}a(wIn,"formatContextFiles");p();p();var GZe=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},x_=class extends GZe{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},fd=class extends GZe{constructor(r,n,o){super(o||`GitHub API request failed: ${r} ${n}`);this.status=r;this.statusText=n}static{a(this,"GitHubClientApiError")}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500&&this.status<600}};p();var yGt=(h=>(h.Actions="actions",h.Composer="composer",h.Erlang="erlang",h.Go="go",h.Maven="maven",h.Npm="npm",h.Nuget="nuget",h.Pip="pip",h.Pub="pub",h.RubyGems="rubygems",h.Rust="rust",h))(yGt||{});p();p();p();function cj(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}a(cj,"getUserAgent");p();p();function $Ze(t,e,r,n){if(typeof r!="function")throw new Error("method for before hook must be a function");return n||(n={}),Array.isArray(e)?e.reverse().reduce((o,s)=>$Ze.bind(null,t,s,o,n),r)():Promise.resolve().then(()=>t.registry[e]?t.registry[e].reduce((o,s)=>s.hook.bind(null,o,n),r)():r(n))}a($Ze,"register");p();function RIn(t,e,r,n){let o=n;t.registry[r]||(t.registry[r]=[]),e==="before"&&(n=a((s,c)=>Promise.resolve().then(o.bind(null,c)).then(s.bind(null,c)),"hook")),e==="after"&&(n=a((s,c)=>{let l;return Promise.resolve().then(s.bind(null,c)).then(u=>(l=u,o(l,c))).then(()=>l)},"hook")),e==="error"&&(n=a((s,c)=>Promise.resolve().then(s.bind(null,c)).catch(l=>o(l,c)),"hook")),t.registry[r].push({hook:n,orig:o})}a(RIn,"addHook");p();function kIn(t,e,r){if(!t.registry[e])return;let n=t.registry[e].map(o=>o.orig).indexOf(r);n!==-1&&t.registry[e].splice(n,1)}a(kIn,"removeHook");var PIn=Function.bind,DIn=PIn.bind(PIn);function NIn(t,e,r){let n=DIn(kIn,null).apply(null,r?[e,r]:[e]);t.api={remove:n},t.remove=n,["before","error","after","wrap"].forEach(o=>{let s=r?[e,o,r]:[e,o];t[o]=t.api[o]=DIn(RIn,null).apply(null,s)})}a(NIn,"bindApi");function DKo(){let t=Symbol("Singular"),e={registry:{}},r=$Ze.bind(null,e,t);return NIn(r,e,t),r}a(DKo,"Singular");function NKo(){let t={registry:{}},e=$Ze.bind(null,t);return NIn(e,t),e}a(NKo,"Collection");var MIn={Singular:DKo,Collection:NKo};p();p();var MKo="0.0.0-development",OKo=`octokit-endpoint.js/${MKo} ${cj()}`,LKo={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":OKo},mediaType:{format:""}};function BKo(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(BKo,"lowercaseKeys");function FKo(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);if(e===null)return!0;let r=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(t)}a(FKo,"isPlainObject");function BIn(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{FKo(e[n])?n in t?r[n]=BIn(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(BIn,"mergeDeep");function OIn(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(OIn,"removeUndefinedProperties");function EGt(t,e,r){if(typeof e=="string"){let[o,s]=e.split(" ");r=Object.assign(s?{method:o,url:s}:{url:o},r)}else r=Object.assign({},e);r.headers=BKo(r.headers),OIn(r),OIn(r.headers);let n=BIn(t||{},r);return r.url==="/graphql"&&(t&&t.mediaType.previews?.length&&(n.mediaType.previews=t.mediaType.previews.filter(o=>!n.mediaType.previews.includes(o)).concat(n.mediaType.previews)),n.mediaType.previews=(n.mediaType.previews||[]).map(o=>o.replace(/-preview/,""))),n}a(EGt,"merge");function UKo(t,e){let r=/\?/.test(t)?"&":"?",n=Object.keys(e);return n.length===0?t:t+r+n.map(o=>o==="q"?"q="+e.q.split("+").map(encodeURIComponent).join("+"):`${o}=${encodeURIComponent(e[o])}`).join("&")}a(UKo,"addQueryParameters");var QKo=/\{[^{}}]+\}/g;function qKo(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(jKo,"extractUrlVariableNames");function LIn(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(LIn,"omit");function FIn(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e}).join("")}a(FIn,"encodeReserved");function pde(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a(pde,"encodeUnreserved");function gRe(t,e,r){return e=t==="+"||t==="#"?FIn(e):pde(e),r?pde(r)+"="+e:e}a(gRe,"encodeValue");function fde(t){return t!=null}a(fde,"isDefined");function _Gt(t){return t===";"||t==="&"||t==="?"}a(_Gt,"isKeyOperator");function HKo(t,e,r,n){var o=t[r],s=[];if(fde(o)&&o!=="")if(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||typeof o=="boolean")o=o.toString(),n&&n!=="*"&&(o=o.substring(0,parseInt(n,10))),s.push(gRe(e,o,_Gt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(fde).forEach(function(c){s.push(gRe(e,c,_Gt(e)?r:""))}):Object.keys(o).forEach(function(c){fde(o[c])&&s.push(gRe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(fde).forEach(function(l){c.push(gRe(e,l))}):Object.keys(o).forEach(function(l){fde(o[l])&&(c.push(pde(l)),c.push(gRe(e,o[l].toString())))}),_Gt(e)?s.push(pde(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?fde(o)&&s.push(pde(r)):o===""&&(e==="&"||e==="?")?s.push(pde(r)+"="):o===""&&s.push("");return s}a(HKo,"getValues");function GKo(t){return{expand:$Ko.bind(null,t)}}a(GKo,"parseUrl");function $Ko(t,e){var r=["+","#",".","/",";","?","&"];return t=t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(n,o,s){if(o){let l="",u=[];if(r.indexOf(o.charAt(0))!==-1&&(l=o.charAt(0),o=o.substr(1)),o.split(/,/g).forEach(function(d){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(d);u.push(HKo(e,l,f[1],f[2]||f[3]))}),l&&l!=="+"){var c=",";return l==="?"?c="&":l!=="#"&&(c=l),(u.length!==0?l:"")+u.join(c)}else return u.join(",")}else return FIn(s)}),t==="/"?t:t.replace(/\/$/,"")}a($Ko,"expand");function UIn(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=LIn(t,["method","baseUrl","url","headers","request","mediaType"]),c=jKo(r);r=GKo(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=LIn(s,l);if(!/application\/octet-stream/i.test(n.accept)&&(t.mediaType.format&&(n.accept=n.accept.split(/,/).map(f=>f.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),r.endsWith("/graphql")&&t.mediaType.previews?.length)){let f=n.accept.match(/(?{let m=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${h}-preview${m}`}).join(",")}return["GET","HEAD"].includes(e)?r=UKo(r,u):"data"in u?o=u.data:Object.keys(u).length&&(o=u),!n["content-type"]&&typeof o<"u"&&(n["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(e)&&typeof o>"u"&&(o=""),Object.assign({method:e,url:r,headers:n},typeof o<"u"?{body:o}:null,t.request?{request:t.request}:null)}a(UIn,"parse");function VKo(t,e,r){return UIn(EGt(t,e,r))}a(VKo,"endpointWithDefaults");function QIn(t,e){let r=EGt(t,e),n=VKo.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:QIn.bind(null,r),merge:EGt.bind(null,r),parse:UIn})}a(QIn,"withDefaults");var qIn=QIn(null,LKo);var exn=fe($In(),1);p();var WKo=/^-?\d+$/,zIn=/^-?\d+n+$/,vGt=JSON.stringify,VIn=JSON.parse,zKo=/^-?\d+n$/,YKo=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,KKo=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,YIn=a((t,e,r)=>"rawJSON"in JSON?vGt(t,(c,l)=>typeof l=="bigint"?JSON.rawJSON(l.toString()):typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r):t?vGt(t,(c,l)=>typeof l=="string"&&zIn.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(YKo,"$1$2$3").replace(KKo,"$1$2$3"):vGt(t,e,r),"JSONStringify"),YZe=new Map,JKo=a(()=>{let t=JSON.parse.toString();if(YZe.has(t))return YZe.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return YZe.set(t,e),e}catch{return YZe.set(t,!1),!1}},"isContextSourceSupported"),ZKo=a((t,e,r,n)=>typeof e=="string"&&zKo.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&zIn.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),XKo=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return VIn(t,e);if(JKo())return XKo(t,e);let r=t.replace(eJo,(n,o,s,c)=>{let l=n[0]==='"';if(l&&tJo.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.lengthZKo(n,o,s,e))},"JSONParse");p();var GJ=class extends Error{static{a(this,"RequestError")}name;status;request;response;constructor(e,r,n){super(e,{cause:n.cause}),this.name="HttpError",this.status=Number.parseInt(r),Number.isNaN(this.status)&&(this.status=0);"response"in n&&(this.response=n.response);let o=Object.assign({},n.request);n.request.headers.authorization&&(o.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/(?"","noop");async function XIn(t){let e=t.request?.fetch||globalThis.fetch;if(!e)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let r=t.request?.log||console,n=t.request?.parseSuccessResponseBody!==!1,o=iJo(t.body)||Array.isArray(t.body)?YIn(t.body):t.body,s=Object.fromEntries(Object.entries(t.headers).map(([h,m])=>[h,String(m)])),c;try{c=await e(t.url,{method:t.method,body:o,redirect:t.request?.redirect,headers:s,signal:t.request?.signal,...t.body&&{duplex:"half"}})}catch(h){let m="Unknown Error";if(h instanceof Error){if(h.name==="AbortError")throw h.status=500,h;m=h.message,h.name==="TypeError"&&"cause"in h&&(h.cause instanceof Error?m=h.cause.message:typeof h.cause=="string"&&(m=h.cause))}let g=new GJ(m,500,{request:t});throw g.cause=h,g}let l=c.status,u=c.url,d={};for(let[h,m]of c.headers)d[h]=m;let f={url:u,status:l,headers:d,data:""};if("deprecation"in d){let h=d.link&&d.link.match(/<([^<>]+)>; rel="deprecation"/),m=h&&h.pop();r.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${d.sunset}${m?`. See ${m}`:""}`)}if(l===204||l===205)return f;if(t.method==="HEAD"){if(l<400)return f;throw new GJ(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await CGt(c),new GJ("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await CGt(c),new GJ(sJo(f.data),l,{response:f,request:t});return f.data=n?await CGt(c):c.body,f}a(XIn,"fetchWrapper");async function CGt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch(ZIn);let r=(0,exn.safeParse)(e);if(oJo(r)){let n="";try{return n=await t.text(),JIn(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(ZIn):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(CGt,"getResponseData");function oJo(t){return t.type==="application/json"||t.type==="application/scim+json"}a(oJo,"isJSONResponse");function sJo(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return"Unknown error";if("message"in t){let e="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(r=>JSON.stringify(r)).join(", ")}${e}`:`${t.message}${e}`}return`Unknown error: ${JSON.stringify(t)}`}a(sJo,"toErrorMessage");function bGt(t,e){let r=t.defaults(e);return Object.assign(a(function(o,s){let c=r.merge(o,s);if(!c.request||!c.request.hook)return XIn(r.parse(c));let l=a((u,d)=>XIn(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:bGt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:bGt.bind(null,r)})}a(bGt,"withDefaults");var yRe=bGt(qIn,nJo);p();var aJo="0.0.0-development";function cJo(t){return`Request failed due to following response errors: `+t.errors.map(e=>` - ${e.message}`).join(` -`)}a(sJo,"_buildMessageForResponseErrors");var aJo=class extends Error{static{a(this,"GraphqlResponseError")}constructor(t,e,r){super(sJo(r)),this.request=t,this.headers=e,this.response=r,this.errors=r.errors,this.data=r.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}name="GraphqlResponseError";errors;data},cJo=["method","baseUrl","url","headers","request","query","mediaType","operationName"],lJo=["query","method","url"],exn=/\/api\/v3\/?$/;function uJo(t,e,r){if(r){if(typeof e=="string"&&"query"in r)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let c in r)if(lJo.includes(c))return Promise.reject(new Error(`[@octokit/graphql] "${c}" cannot be used as variable name`))}let n=typeof e=="string"?Object.assign({query:e},r):e,o=Object.keys(n).reduce((c,l)=>cJo.includes(l)?(c[l]=n[l],c):(c.variables||(c.variables={}),c.variables[l]=n[l],c),{}),s=n.baseUrl||t.endpoint.DEFAULTS.baseUrl;return exn.test(s)&&(o.url=s.replace(exn,"/api/graphql")),t(o).then(c=>{if(c.data.errors){let l={};for(let u of Object.keys(c.headers))l[u]=c.headers[u];throw new aJo(o,l,c.data)}return c.data.data})}a(uJo,"graphql");function bGt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>uJo(r,o,s),"newApi"),{defaults:bGt.bind(null,r),endpoint:r.endpoint})}a(bGt,"withDefaults");var txn=bGt(yRe,{headers:{"user-agent":`octokit-graphql.js/${oJo} ${cj()}`},method:"POST",url:"/graphql"});function rxn(t){return bGt(t,{method:"POST",url:"/graphql"})}a(rxn,"withCustomRequest");p();var SGt="(?:[a-zA-Z0-9_-]+)",nxn="\\.",ixn=new RegExp(`^${SGt}${nxn}${SGt}${nxn}${SGt}$`),dJo=ixn.test.bind(ixn);async function fJo(t){let e=dJo(t),r=t.startsWith("v1.")||t.startsWith("ghs_"),n=t.startsWith("ghu_");return{type:"token",token:t,tokenType:e?"app":r?"installation":n?"user-to-server":"oauth"}}a(fJo,"auth");function pJo(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a(pJo,"withAuthorizationPrefix");async function hJo(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=pJo(t),e(o)}a(hJo,"hook");var oxn=a(function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof e!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(fJo.bind(null,e),{hook:hJo.bind(null,e)})},"createTokenAuth2");p();var TGt="7.0.6";var sxn=a(()=>{},"noop"),mJo=console.warn.bind(console),gJo=console.error.bind(console);function AJo(t={}){return typeof t.debug!="function"&&(t.debug=sxn),typeof t.info!="function"&&(t.info=sxn),typeof t.warn!="function"&&(t.warn=mJo),typeof t.error!="function"&&(t.error=gJo),t}a(AJo,"createLogger");var axn=`octokit-core.js/${TGt} ${cj()}`,KZe=class{static{a(this,"Octokit")}static VERSION=TGt;static defaults(e){return class extends this{static{a(this,"OctokitWithDefaults")}constructor(...n){let o=n[0]||{};if(typeof e=="function"){super(e(o));return}super(Object.assign({},e,o,o.userAgent&&e.userAgent?{userAgent:`${o.userAgent} ${e.userAgent}`}:null))}}}static plugins=[];static plugin(...e){let r=this.plugins;return class extends this{static{a(this,"NewOctokit")}static plugins=r.concat(e.filter(o=>!r.includes(o)))}}constructor(e={}){let r=new NIn.Collection,n={baseUrl:yRe.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:r.bind(null,"request")}),mediaType:{previews:[],format:""}};if(n.headers["user-agent"]=e.userAgent?`${e.userAgent} ${axn}`:axn,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=yRe.defaults(n),this.graphql=rxn(this.request).defaults(n),this.log=AJo(e.log),this.hook=r,e.authStrategy){let{authStrategy:s,...c}=e,l=s(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:c},e.auth));r.wrap("request",l.hook),this.auth=l}else if(!e.auth)this.auth=async()=>({type:"unauthenticated"});else{let s=oxn(e.auth);r.wrap("request",s.hook),this.auth=s}let o=this.constructor;for(let s=0;s{t.log.debug("request",r);let n=Date.now(),o=t.request.endpoint.parse(r),s=o.url.replace(r.baseUrl,"");return e(r).then(c=>{let l=c.headers["x-github-request-id"];return t.log.info(`${o.method} ${s} - ${c.status} with id ${l} in ${Date.now()-n}ms`),c}).catch(c=>{let l=c.response?.headers["x-github-request-id"]||"UNKNOWN";throw t.log.error(`${o.method} ${s} - ${c.status} with id ${l} in ${Date.now()-n}ms`),c})})}a(IGt,"requestLog");IGt.VERSION=cxn;p();var yJo="0.0.0-development";function _Jo(t){if(!t.data)return{...t,data:[]};if(!(("total_count"in t.data||"total_commits"in t.data)&&!("url"in t.data)))return t;let r=t.data.incomplete_results,n=t.data.repository_selection,o=t.data.total_count,s=t.data.total_commits;delete t.data.incomplete_results,delete t.data.repository_selection,delete t.data.total_count,delete t.data.total_commits;let c=Object.keys(t.data)[0],l=t.data[c];return t.data=l,typeof r<"u"&&(t.data.incomplete_results=r),typeof n<"u"&&(t.data.repository_selection=n),t.data.total_count=o,t.data.total_commits=s,t}a(_Jo,"normalizePaginatedListResponse");function xGt(t,e,r){let n=typeof e=="function"?e.endpoint(r):t.request.endpoint(e,r),o=typeof e=="function"?e:t.request,s=n.method,c=n.headers,l=n.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!l)return{done:!0};try{let u=await o({method:s,url:l,headers:c}),d=_Jo(u);if(l=((d.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!l&&"total_commits"in d.data){let f=new URL(d.url),h=f.searchParams,m=parseInt(h.get("page")||"1",10),g=parseInt(h.get("per_page")||"250",10);m*g{if(o.done)return e;let s=!1;function c(){s=!0}return a(c,"done"),e=e.concat(n?n(o.value,c):o.value.data),s?e:uxn(t,e,r,n)})}a(uxn,"gather");var lAd=Object.assign(lxn,{iterator:xGt});function wGt(t){return{paginate:Object.assign(lxn.bind(null,t),{iterator:xGt.bind(null,t)})}}a(wGt,"paginateRest");wGt.VERSION=yJo;p();p();var RGt="17.0.0";p();p();var EJo={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteCustomImageFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],deleteCustomImageVersionFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomImageForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],getCustomImageVersionForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listCustomImageVersionsForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"],listCustomImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingPremiumRequestUsageReportOrg:["GET /organizations/{org}/settings/billing/premium_request/usage"],getGithubBillingPremiumRequestUsageReportUser:["GET /users/{username}/settings/billing/premium_request/usage"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],repositoryAccessForOrg:["GET /organizations/{org}/dependabot/repository-access"],setRepositoryAccessDefaultLevel:["PUT /organizations/{org}/dependabot/repository-access/default-level"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],updateRepositoryAccessForOrg:["PATCH /organizations/{org}/dependabot/repository-access"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},enterpriseTeamMemberships:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"],get:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],list:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],remove:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"]},enterpriseTeamOrganizations:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"],delete:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignment:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignments:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"]},enterpriseTeams:{create:["POST /enterprises/{enterprise}/teams"],delete:["DELETE /enterprises/{enterprise}/teams/{team_slug}"],get:["GET /enterprises/{enterprise}/teams/{team_slug}"],list:["GET /enterprises/{enterprise}/teams"],update:["PATCH /enterprises/{enterprise}/teams/{team_slug}"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addBlockedByDependency:["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],getParent:["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listDependenciesBlockedBy:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],listDependenciesBlocking:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeDependencyBlockedBy:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createArtifactStorageRecord:["POST /orgs/{org}/artifacts/metadata/storage-record"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createWebhook:["POST /orgs/{org}/hooks"],customPropertiesForOrgsCreateOrUpdateOrganizationValues:["PATCH /organizations/{org}/org-properties/values"],customPropertiesForOrgsGetOrganizationValues:["GET /organizations/{org}/org-properties/values"],customPropertiesForReposCreateOrUpdateOrganizationDefinition:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposCreateOrUpdateOrganizationDefinitions:["PATCH /orgs/{org}/properties/schema"],customPropertiesForReposCreateOrUpdateOrganizationValues:["PATCH /orgs/{org}/properties/values"],customPropertiesForReposDeleteOrganizationDefinition:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinition:["GET /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinitions:["GET /orgs/{org}/properties/schema"],customPropertiesForReposGetOrganizationValues:["GET /orgs/{org}/properties/values"],delete:["DELETE /orgs/{org}"],deleteAttestationsBulk:["POST /orgs/{org}/attestations/delete-request"],deleteAttestationsById:["DELETE /orgs/{org}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /orgs/{org}/attestations/digest/{subject_digest}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],disableSelectedRepositoryImmutableReleasesOrganization:["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],enableSelectedRepositoryImmutableReleasesOrganization:["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],get:["GET /orgs/{org}"],getImmutableReleasesSettings:["GET /orgs/{org}/settings/immutable-releases"],getImmutableReleasesSettingsRepositories:["GET /orgs/{org}/settings/immutable-releases/repositories"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listArtifactStorageRecords:["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"],listAttestationRepositories:["GET /orgs/{org}/attestations/repositories"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listAttestationsBulk:["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setImmutableReleasesSettings:["PUT /orgs/{org}/settings/immutable-releases"],setImmutableReleasesSettingsRepositories:["PUT /orgs/{org}/settings/immutable-releases/repositories"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addItemForOrg:["POST /orgs/{org}/projectsV2/{project_number}/items"],addItemForUser:["POST /users/{username}/projectsV2/{project_number}/items"],deleteItemForOrg:["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],deleteItemForUser:["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"],getFieldForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"],getFieldForUser:["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"],getForOrg:["GET /orgs/{org}/projectsV2/{project_number}"],getForUser:["GET /users/{username}/projectsV2/{project_number}"],getOrgItem:["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],getUserItem:["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"],listFieldsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields"],listFieldsForUser:["GET /users/{username}/projectsV2/{project_number}/fields"],listForOrg:["GET /orgs/{org}/projectsV2"],listForUser:["GET /users/{username}/projectsV2"],listItemsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/items"],listItemsForUser:["GET /users/{username}/projectsV2/{project_number}/items"],updateItemForOrg:["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],updateItemForUser:["PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkImmutableReleases:["GET /repos/{owner}/{repo}/immutable-releases"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],customPropertiesForReposCreateOrUpdateRepositoryValues:["PATCH /repos/{owner}/{repo}/properties/values"],customPropertiesForReposGetRepositoryValues:["GET /repos/{owner}/{repo}/properties/values"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disableImmutableReleases:["DELETE /repos/{owner}/{repo}/immutable-releases"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enableImmutableReleases:["PUT /repos/{owner}/{repo}/immutable-releases"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],listOrgPatternConfigs:["GET /orgs/{org}/secret-scanning/pattern-configurations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],updateOrgPatternConfigs:["PATCH /orgs/{org}/secret-scanning/pattern-configurations"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteAttestationsBulk:["POST /users/{username}/attestations/delete-request"],deleteAttestationsById:["DELETE /users/{username}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /users/{username}/attestations/digest/{subject_digest}"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listAttestationsBulk:["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},dxn=EJo;var GJ=new Map;for(let[t,e]of Object.entries(dxn))for(let[r,n]of Object.entries(e)){let[o,s,c]=n,[l,u]=o.split(/ /),d=Object.assign({method:l,url:u},s);GJ.has(t)||GJ.set(t,new Map),GJ.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var vJo={has({scope:t},e){return GJ.get(t).has(e)},getOwnPropertyDescriptor(t,e){return{value:this.get(t,e),configurable:!0,writable:!0,enumerable:!0}},defineProperty(t,e,r){return Object.defineProperty(t.cache,e,r),!0},deleteProperty(t,e){return delete t.cache[e],!0},ownKeys({scope:t}){return[...GJ.get(t).keys()]},set(t,e,r){return t.cache[e]=r},get({octokit:t,scope:e,cache:r},n){if(r[n])return r[n];let o=GJ.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=CJo(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function kGt(t){let e={};for(let r of GJ.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},vJo);return e}a(kGt,"endpointsToMethods");function CJo(t,e,r,n,o){let s=t.request.defaults(n);function c(...l){let u=s.endpoint.merge(...l);if(o.mapToData)return u=Object.assign({},u,{data:u[o.mapToData],[o.mapToData]:void 0}),s(u);if(o.renamed){let[d,f]=o.renamed;t.log.warn(`octokit.${e}.${r}() has been renamed to octokit.${d}.${f}()`)}if(o.deprecated&&t.log.warn(o.deprecated),o.renamedParameters){let d=s.endpoint.merge(...l);for(let[f,h]of Object.entries(o.renamedParameters))f in d&&(t.log.warn(`"${f}" parameter is deprecated for "octokit.${e}.${r}()". Use "${h}" instead`),h in d||(d[h]=d[f]),delete d[f]);return s(d)}return s(...l)}return a(c,"withDecorations"),Object.assign(c,s)}a(CJo,"decorate");function bJo(t){return{rest:kGt(t)}}a(bJo,"restEndpointMethods");bJo.VERSION=RGt;function PGt(t){let e=kGt(t);return{...e,rest:e}}a(PGt,"legacyRestEndpointMethods");PGt.VERSION=RGt;p();var fxn="22.0.1";var pxn=KZe.plugin(IGt,PGt,wGt).defaults({userAgent:`octokit-rest.js/${fxn}`});var TJo=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),xc=new pe("GitHubClient"),gm=class{constructor(e){this.ctx=e;this.octokit=null}static{a(this,"GitHubClient")}async getOctokit(){if(this.octokit)return this.octokit;let e=await this.getApiSession(),r=this.ctx.get(Jt);return this.octokit=new pxn({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!TJo.has(o))return xc.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];xc.debug(this.ctx,`Fetching Copilot timeline events for ${e}/${r}#${n}`);let s=await this.getOctokit();try{let c=[],l=1,u=!0;for(;u;){xc.debug(this.ctx,`Fetching timeline events page ${l} for ${e}/${r}#${n}`);let d=await s.rest.issues.listEventsForTimeline({owner:e,repo:r,issue_number:n,per_page:100,page:l});for(let h of d.data){let m=h;m.created_at&&m.node_id&&(h.event==="copilot_work_started"?c.push({id:m.node_id,eventType:"in_progress",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}):h.event==="copilot_work_finished"?c.push({id:m.node_id,eventType:"done",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}):h.event==="copilot_work_finished_failure"&&c.push({id:m.node_id,eventType:"error",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}))}let f=d.headers.link;u=f?f.includes('rel="next"'):!1,l++}return xc.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(xc.error(this.ctx,`Failed to fetch Copilot timeline events for ${e}/${r}#${n}:`,c),c&&typeof c=="object"&&"status"in c){let l=c;throw new fd(l.status,l.message||"GitHub API error")}throw c}}async getCopilotWorkingStatus(e,r,n,o){xc.debug(this.ctx,`Getting Copilot working status for ${e}/${r}#${n}`);try{let s=await this.getCopilotTimelineEvents(e,r,n,o),c;if(s.length>0){let l=s[s.length-1];l.eventType==="done"?c="done":l.eventType==="in_progress"?c="in_progress":l.eventType==="error"?c="error":c="not_copilot_issue"}else c="not_copilot_issue";return xc.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return xc.error(this.ctx,`Error getting Copilot working status for ${e}/${r}#${n}, treating as not Copilot issue:`,s),"not_copilot_issue"}}async cancelWorkflow(e,r,n){xc.debug(this.ctx,`Cancelling workflow run ${n} for ${e}/${r}`);let o=await this.getOctokit();try{return await o.rest.actions.cancelWorkflowRun({owner:e,repo:r,run_id:n}),xc.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(xc.error(this.ctx,`Failed to cancel workflow run ${n} for ${e}/${r}:`,s),s&&typeof s=="object"&&"status"in s){let c=s;throw new fd(c.status,c.message||"GitHub API error")}throw s}}async listPullRequestFiles(e,r,n){xc.debug(this.ctx,`Listing files for pull request ${e}/${r}#${n}`);let o=await this.getOctokit();try{let s=[],c=1,l=!0;for(;l;){xc.debug(this.ctx,`Fetching pull request files page ${c} for ${e}/${r}#${n}`);let u=await o.rest.pulls.listFiles({owner:e,repo:r,pull_number:n,per_page:100,page:c});for(let f of u.data)s.push({fileName:f.filename});let d=u.headers.link;l=d?d.includes('rel="next"'):!1,c++}return xc.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(xc.error(this.ctx,`Failed to list files for pull request ${e}/${r}#${n}:`,s),s&&typeof s=="object"&&"status"in s){let c=s;throw new fd(c.status,c.message||"GitHub API error")}throw s}}async getBranch(e,r,n){xc.debug(this.ctx,`Getting branch ${n} from ${e}/${r}`);let o=await this.getOctokit();try{let s=await o.rest.repos.getBranch({owner:e,repo:r,branch:n});return xc.debug(this.ctx,`Successfully retrieved branch ${n} from ${e}/${r}`),s.data}catch(s){if(s&&typeof s=="object"&&"status"in s){let c=s;throw xc.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new fd(c.status,c.message||"GitHub API error")}throw xc.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){xc.debug(this.ctx,`Getting pull request ${e}/${r}#${n}`);let o=await this.getOctokit();try{let s=await o.rest.pulls.get({owner:e,repo:r,pull_number:n});return xc.debug(this.ctx,`Successfully retrieved pull request ${e}/${r}#${n}`),{id:s.data.id,html_url:s.data.html_url,number:s.data.number,title:s.data.title,user:s.data.user?{login:s.data.user.login}:void 0,draft:s.data.draft,body:s.data.body||void 0,repository:{owner:{login:s.data.base.repo.owner.login},name:s.data.base.repo.name},updated_at:s.data.updated_at}}catch(s){if(s&&typeof s=="object"&&"status"in s){let c=s;throw xc.debug(this.ctx,`GitHub API error getting pull request #${n}: HTTP ${c.status} - ${c.message}`),new fd(c.status,c.message||"GitHub API error")}throw xc.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){xc.debug(this.ctx,`Adding comment to pull request ${e}/${r}#${n}`);let s=await this.getOctokit();try{let c=await s.rest.issues.createComment({owner:e,repo:r,issue_number:n,body:o});return xc.debug(this.ctx,`Successfully added comment to ${e}/${r}#${n}`),{html_url:c.data.html_url}}catch(c){if(c&&typeof c=="object"&&"status"in c){let l=c;throw xc.debug(this.ctx,`GitHub API error adding comment to #${n}: HTTP ${l.status} - ${l.message}`),new fd(l.status,l.message||"GitHub API error")}throw xc.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){xc.debug(this.ctx,`Listing security advisories for ${r.length} ${e} packages`);let o=await this.getOctokit();try{let s=[],c=1,l=!0;for(;l;){xc.debug(this.ctx,`Fetching security advisories page ${c} for ${r.length} ${e} packages`);let u=await o.securityAdvisories.listGlobalAdvisories({ecosystem:e,affects:r,direction:"asc",sort:"published",per_page:n,page:c});s.push(...u.data);let d=u.headers.link;l=d?d.includes('rel="next"'):!1,c++}return xc.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(xc.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw xc.debug(this.ctx,`GitHub API error listing security advisories for ${r.length} ${e} packages: HTTP ${c.status} - ${c.message}`),new fd(c.status,c.message||"GitHub API error")}throw s}}async getApiSession(){let e=await this.ctx.get(Fr).resolveSession();if(!e)throw new x_;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var Za=new pe("CodingAgentClient"),fb=class{constructor(e,r){this.ctx=e;this.timeout=r??3e4}static{a(this,"CodingAgentClient")}getBaseUrl(){return"https://api.githubcopilot.com"}async createCodingTask(e,r,n,o,s,c){Za.debug(this.ctx,`Creating coding agent task for ${n}/${o} with title: ${e}`),this.validateCreateTaskParams(e,r,n,o);let l=await this.getAccessToken(),d=`${this.getBaseUrl()}/agents/swe/${gGt}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:TIn(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...om(this.ctx)};if(c?.isCancellationRequested)throw Za.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new E0;let g=await this.ctx.get(Jt).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw Za.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new E0;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw Za.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new E0;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw Za.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new E0;let _=y.pull_request?.number;if(typeof _!="number")throw new mm("No valid pull request number returned from job");let v=await new gm(this.ctx).getPullRequest(n,o,_);return Za.debug(this.ctx,`Coding task created successfully for ${n}/${o}: job ${A.job_id}, session ${A.session_id}, PR #${v.number}`),{pullRequest:v,sessionId:A.session_id}}validateCreateTaskParams(e,r,n,o){if(!e?.trim())throw Za.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new mp("Title is required and cannot be empty");if(!r?.trim())throw Za.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new mp("ProblemStatement is required and cannot be empty");if(!n?.trim())throw Za.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new mp("Owner is required and cannot be empty");if(!o?.trim())throw Za.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new mp("Repository name is required and cannot be empty");Za.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Fr).resolveSession();if(!r?.accessToken)throw Za.debug(this.ctx,"Failed to get access token"),new ww("Failed to call cloud agent API: Not authenticated with GitHub");return r.accessToken}async fetchWithCancellation(e,r,n){let o=new AbortController,s=n?.onCancellationRequested(()=>o.abort());try{return await this.ctx.get(Jt).fetch(e,{timeout:this.timeout,signal:o.signal,...r})}finally{s?.dispose()}}async getAllSessions(e,r){Za.debug(this.ctx,`Getting all coding agent sessions for pull request ID: ${e}`);let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw Za.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new E0;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...om(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Za.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new E0;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get cloud agent sessions: HTTP ${l.status} - ${d}`;throw Za.error(this.ctx,f),new mm(f)}let u=await l.json();return Za.debug(this.ctx,`Found ${u.sessions?.length||0} coding agent sessions for pull request ID: ${e}`),u.sessions||null}catch(s){if(s instanceof xw)throw s;let c=`Failed to get cloud agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Za.error(this.ctx,c),new ade(c)}}async getRepoSessions(e,r){Za.debug(this.ctx,`Getting all coding agent sessions for repo: ${e}`);let n=await this.getAccessToken(),o=this.getBaseUrl(),s=20,c=[],l=1;try{for(;;){if(r?.isCancellationRequested)throw new E0;let u=`${o}/agents/sessions?page_size=${s}&page_number=${l}&resource_state=draft,open&repo_nwo=${e}`,d={Authorization:`Bearer ${n}`,Accept:"application/json",...om(this.ctx)},f=await this.fetchWithCancellation(u,{method:"GET",headers:d},r);if(r?.isCancellationRequested)throw Za.debug(this.ctx,`Get repo sessions operation was cancelled after sending API request for repo: ${e}`),new E0;if(!f.ok){let g=await f.text().catch(()=>f.statusText),A=`Failed to get repo cloud agent sessions: HTTP ${f.status} - ${g}`;throw Za.error(this.ctx,A),new mm(A)}let m=(await f.json()).sessions??[];if(c.push(...m),m.lengthl.statusText),d=`Failed to get cloud agent session logs: HTTP ${l.status} - ${u}`;throw Za.error(this.ctx,d),new mm(d)}return await l.text()}catch(s){if(s instanceof xw)throw s;let c=`Failed to get cloud agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Za.error(this.ctx,c),new ade(c)}}async waitForJobPullRequest(e,r,n,o,s){let c=Date.now(),l=3e4,u=2e3;for(;Date.now()-csetTimeout(r,e))}async handleCreateJobResponse(e){if(!e.ok){let n=await e.text().catch(()=>e.statusText);throw Za.error(this.ctx,`Cloud agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new mm("Cloud agent is not enabled or you do not have access. Learn more about cloud agent at https://docs.github.com/copilot/concepts/agents/cloud-agent/about-cloud-agent"):new mm(`API request failed: HTTP ${e.status} - ${n}`)}let r;try{r=await e.json()}catch(n){let o=n instanceof Error?n.message:JSON.stringify(n);throw Za.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new mm(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw Za.error(this.ctx,"API response missing job_id or session_id",r),new mm("Invalid response from cloud agent");return r}};p();p();var u5=class{static{a(this,"LSPRequestSender")}};var hxn=fe(ii());var JZe=class{constructor(){this.codingAgentMessageRequestType=new hxn.ProtocolRequestType("copilot/codingAgentMessage")}static{a(this,"CodingAgentMessageHandler")}async sendCodingAgentMessage(e,r,n,o){try{ot.debug(e.ctx,`Sending coding agent message to client: ${r} - ${o}`);let c=await e.ctx.get(u5).sendRequest(this.codingAgentMessageRequestType,{title:r,description:n,prLink:o,conversationId:e.conversation.id.toString(),turnId:e.turn.id.toString()});return ot.debug(e.ctx,"Successfully sent coding agent message to client"),c}catch(s){let c=`Failed to send coding agent message: ${s instanceof Error?s.message:JSON.stringify(s)}`;return ot.error(e.ctx,c,s),{success:!1,error:c}}}};p();p();p();p();var pb=fe(wo());function DGt(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(DGt,"adaptCancellationToken");function mxn(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(mxn,"adaptProgressCallback");function gxn(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(gxn,"createEndpointInfo");function Axn(t){let e={role:IJo(t.role),content:xJo(t.content)};if(t.role===pb.Raw.ChatRole.Assistant&&"toolCalls"in t&&t.toolCalls&&(e.tool_calls=t.toolCalls.map(r=>({id:r.id,type:r.type,function:r.function,approxNumTokens:0}))),t.role===pb.Raw.ChatRole.Tool&&"toolCallId"in t&&t.toolCallId&&(e.tool_call_id=t.toolCallId),Array.isArray(t.content)){let r=!1;for(let n of t.content){if(n.type===pb.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=jJe(n);o&&(e.thinking=o);let s=qJe(n);s&&(e.phase=s)}n.type===pb.Raw.ChatCompletionContentPartKind.CacheBreakpoint&&(r=!0)}r&&(e.copilot_cache_control={type:"ephemeral"})}return Object.entries(t).forEach(([r,n])=>{["role","content","toolCalls","toolCallId"].includes(r)||(e[r]=n)}),e}a(Axn,"convertToCopilotChatMessage");function IJo(t){switch(t){case pb.Raw.ChatRole.System:return"system";case pb.Raw.ChatRole.User:return"user";case pb.Raw.ChatRole.Assistant:return"assistant";case pb.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(IJo,"convertRole");function xJo(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===pb.Raw.ChatCompletionContentPartKind.Text||r.type===pb.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===pb.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===pb.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===pb.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(xJo,"convertContent");p();var SF=fe(wo());var ZZe=class extends SF.PromptRenderer{constructor(r,n,o,s,c){super(o,r,n,s);this.options=c;this._promptTsxRemovedNodeCount=0}static{a(this,"InternalPromptRenderer")}get promptTsxRemovedNodeCount(){return this._promptTsxRemovedNodeCount}async renderWithOptions(r,n,o){this._promptTsxRemovedNodeCount=0,this.tracer={didMaterializeTree:a(l=>{this._promptTsxRemovedNodeCount=l.renderedTree.removed},"didMaterializeTree")};let s=await super.render(r,n);return{...this.options,...o}.collapseSystemMessages&&this.collapseConsecutiveSystemMessages(s.messages),s}collapseConsecutiveSystemMessages(r){let n=[],o=null;for(let s of r)if(s.role===SF.Raw.ChatRole.System&&o?.role===SF.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===SF.Raw.ChatCompletionContentPartKind.Text&&l.type===SF.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` +`)}a(cJo,"_buildMessageForResponseErrors");var lJo=class extends Error{static{a(this,"GraphqlResponseError")}constructor(t,e,r){super(cJo(r)),this.request=t,this.headers=e,this.response=r,this.errors=r.errors,this.data=r.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}name="GraphqlResponseError";errors;data},uJo=["method","baseUrl","url","headers","request","query","mediaType","operationName"],dJo=["query","method","url"],txn=/\/api\/v3\/?$/;function fJo(t,e,r){if(r){if(typeof e=="string"&&"query"in r)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let c in r)if(dJo.includes(c))return Promise.reject(new Error(`[@octokit/graphql] "${c}" cannot be used as variable name`))}let n=typeof e=="string"?Object.assign({query:e},r):e,o=Object.keys(n).reduce((c,l)=>uJo.includes(l)?(c[l]=n[l],c):(c.variables||(c.variables={}),c.variables[l]=n[l],c),{}),s=n.baseUrl||t.endpoint.DEFAULTS.baseUrl;return txn.test(s)&&(o.url=s.replace(txn,"/api/graphql")),t(o).then(c=>{if(c.data.errors){let l={};for(let u of Object.keys(c.headers))l[u]=c.headers[u];throw new lJo(o,l,c.data)}return c.data.data})}a(fJo,"graphql");function SGt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>fJo(r,o,s),"newApi"),{defaults:SGt.bind(null,r),endpoint:r.endpoint})}a(SGt,"withDefaults");var rxn=SGt(yRe,{headers:{"user-agent":`octokit-graphql.js/${aJo} ${cj()}`},method:"POST",url:"/graphql"});function nxn(t){return SGt(t,{method:"POST",url:"/graphql"})}a(nxn,"withCustomRequest");p();var TGt="(?:[a-zA-Z0-9_-]+)",ixn="\\.",oxn=new RegExp(`^${TGt}${ixn}${TGt}${ixn}${TGt}$`),pJo=oxn.test.bind(oxn);async function hJo(t){let e=pJo(t),r=t.startsWith("v1.")||t.startsWith("ghs_"),n=t.startsWith("ghu_");return{type:"token",token:t,tokenType:e?"app":r?"installation":n?"user-to-server":"oauth"}}a(hJo,"auth");function mJo(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a(mJo,"withAuthorizationPrefix");async function gJo(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=mJo(t),e(o)}a(gJo,"hook");var sxn=a(function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof e!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(hJo.bind(null,e),{hook:gJo.bind(null,e)})},"createTokenAuth2");p();var IGt="7.0.6";var axn=a(()=>{},"noop"),AJo=console.warn.bind(console),yJo=console.error.bind(console);function _Jo(t={}){return typeof t.debug!="function"&&(t.debug=axn),typeof t.info!="function"&&(t.info=axn),typeof t.warn!="function"&&(t.warn=AJo),typeof t.error!="function"&&(t.error=yJo),t}a(_Jo,"createLogger");var cxn=`octokit-core.js/${IGt} ${cj()}`,KZe=class{static{a(this,"Octokit")}static VERSION=IGt;static defaults(e){return class extends this{static{a(this,"OctokitWithDefaults")}constructor(...n){let o=n[0]||{};if(typeof e=="function"){super(e(o));return}super(Object.assign({},e,o,o.userAgent&&e.userAgent?{userAgent:`${o.userAgent} ${e.userAgent}`}:null))}}}static plugins=[];static plugin(...e){let r=this.plugins;return class extends this{static{a(this,"NewOctokit")}static plugins=r.concat(e.filter(o=>!r.includes(o)))}}constructor(e={}){let r=new MIn.Collection,n={baseUrl:yRe.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:r.bind(null,"request")}),mediaType:{previews:[],format:""}};if(n.headers["user-agent"]=e.userAgent?`${e.userAgent} ${cxn}`:cxn,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=yRe.defaults(n),this.graphql=nxn(this.request).defaults(n),this.log=_Jo(e.log),this.hook=r,e.authStrategy){let{authStrategy:s,...c}=e,l=s(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:c},e.auth));r.wrap("request",l.hook),this.auth=l}else if(!e.auth)this.auth=async()=>({type:"unauthenticated"});else{let s=sxn(e.auth);r.wrap("request",s.hook),this.auth=s}let o=this.constructor;for(let s=0;s{t.log.debug("request",r);let n=Date.now(),o=t.request.endpoint.parse(r),s=o.url.replace(r.baseUrl,"");return e(r).then(c=>{let l=c.headers["x-github-request-id"];return t.log.info(`${o.method} ${s} - ${c.status} with id ${l} in ${Date.now()-n}ms`),c}).catch(c=>{let l=c.response?.headers["x-github-request-id"]||"UNKNOWN";throw t.log.error(`${o.method} ${s} - ${c.status} with id ${l} in ${Date.now()-n}ms`),c})})}a(xGt,"requestLog");xGt.VERSION=lxn;p();var EJo="0.0.0-development";function vJo(t){if(!t.data)return{...t,data:[]};if(!(("total_count"in t.data||"total_commits"in t.data)&&!("url"in t.data)))return t;let r=t.data.incomplete_results,n=t.data.repository_selection,o=t.data.total_count,s=t.data.total_commits;delete t.data.incomplete_results,delete t.data.repository_selection,delete t.data.total_count,delete t.data.total_commits;let c=Object.keys(t.data)[0],l=t.data[c];return t.data=l,typeof r<"u"&&(t.data.incomplete_results=r),typeof n<"u"&&(t.data.repository_selection=n),t.data.total_count=o,t.data.total_commits=s,t}a(vJo,"normalizePaginatedListResponse");function wGt(t,e,r){let n=typeof e=="function"?e.endpoint(r):t.request.endpoint(e,r),o=typeof e=="function"?e:t.request,s=n.method,c=n.headers,l=n.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!l)return{done:!0};try{let u=await o({method:s,url:l,headers:c}),d=vJo(u);if(l=((d.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!l&&"total_commits"in d.data){let f=new URL(d.url),h=f.searchParams,m=parseInt(h.get("page")||"1",10),g=parseInt(h.get("per_page")||"250",10);m*g{if(o.done)return e;let s=!1;function c(){s=!0}return a(c,"done"),e=e.concat(n?n(o.value,c):o.value.data),s?e:dxn(t,e,r,n)})}a(dxn,"gather");var dAd=Object.assign(uxn,{iterator:wGt});function RGt(t){return{paginate:Object.assign(uxn.bind(null,t),{iterator:wGt.bind(null,t)})}}a(RGt,"paginateRest");RGt.VERSION=EJo;p();p();var kGt="17.0.0";p();p();var CJo={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteCustomImageFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],deleteCustomImageVersionFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomImageForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],getCustomImageVersionForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listCustomImageVersionsForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"],listCustomImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingPremiumRequestUsageReportOrg:["GET /organizations/{org}/settings/billing/premium_request/usage"],getGithubBillingPremiumRequestUsageReportUser:["GET /users/{username}/settings/billing/premium_request/usage"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],repositoryAccessForOrg:["GET /organizations/{org}/dependabot/repository-access"],setRepositoryAccessDefaultLevel:["PUT /organizations/{org}/dependabot/repository-access/default-level"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],updateRepositoryAccessForOrg:["PATCH /organizations/{org}/dependabot/repository-access"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},enterpriseTeamMemberships:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"],get:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],list:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],remove:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"]},enterpriseTeamOrganizations:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"],delete:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignment:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignments:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"]},enterpriseTeams:{create:["POST /enterprises/{enterprise}/teams"],delete:["DELETE /enterprises/{enterprise}/teams/{team_slug}"],get:["GET /enterprises/{enterprise}/teams/{team_slug}"],list:["GET /enterprises/{enterprise}/teams"],update:["PATCH /enterprises/{enterprise}/teams/{team_slug}"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addBlockedByDependency:["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],getParent:["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listDependenciesBlockedBy:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],listDependenciesBlocking:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeDependencyBlockedBy:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createArtifactStorageRecord:["POST /orgs/{org}/artifacts/metadata/storage-record"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createWebhook:["POST /orgs/{org}/hooks"],customPropertiesForOrgsCreateOrUpdateOrganizationValues:["PATCH /organizations/{org}/org-properties/values"],customPropertiesForOrgsGetOrganizationValues:["GET /organizations/{org}/org-properties/values"],customPropertiesForReposCreateOrUpdateOrganizationDefinition:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposCreateOrUpdateOrganizationDefinitions:["PATCH /orgs/{org}/properties/schema"],customPropertiesForReposCreateOrUpdateOrganizationValues:["PATCH /orgs/{org}/properties/values"],customPropertiesForReposDeleteOrganizationDefinition:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinition:["GET /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinitions:["GET /orgs/{org}/properties/schema"],customPropertiesForReposGetOrganizationValues:["GET /orgs/{org}/properties/values"],delete:["DELETE /orgs/{org}"],deleteAttestationsBulk:["POST /orgs/{org}/attestations/delete-request"],deleteAttestationsById:["DELETE /orgs/{org}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /orgs/{org}/attestations/digest/{subject_digest}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],disableSelectedRepositoryImmutableReleasesOrganization:["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],enableSelectedRepositoryImmutableReleasesOrganization:["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],get:["GET /orgs/{org}"],getImmutableReleasesSettings:["GET /orgs/{org}/settings/immutable-releases"],getImmutableReleasesSettingsRepositories:["GET /orgs/{org}/settings/immutable-releases/repositories"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listArtifactStorageRecords:["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"],listAttestationRepositories:["GET /orgs/{org}/attestations/repositories"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listAttestationsBulk:["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setImmutableReleasesSettings:["PUT /orgs/{org}/settings/immutable-releases"],setImmutableReleasesSettingsRepositories:["PUT /orgs/{org}/settings/immutable-releases/repositories"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addItemForOrg:["POST /orgs/{org}/projectsV2/{project_number}/items"],addItemForUser:["POST /users/{username}/projectsV2/{project_number}/items"],deleteItemForOrg:["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],deleteItemForUser:["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"],getFieldForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"],getFieldForUser:["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"],getForOrg:["GET /orgs/{org}/projectsV2/{project_number}"],getForUser:["GET /users/{username}/projectsV2/{project_number}"],getOrgItem:["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],getUserItem:["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"],listFieldsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields"],listFieldsForUser:["GET /users/{username}/projectsV2/{project_number}/fields"],listForOrg:["GET /orgs/{org}/projectsV2"],listForUser:["GET /users/{username}/projectsV2"],listItemsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/items"],listItemsForUser:["GET /users/{username}/projectsV2/{project_number}/items"],updateItemForOrg:["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],updateItemForUser:["PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkImmutableReleases:["GET /repos/{owner}/{repo}/immutable-releases"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],customPropertiesForReposCreateOrUpdateRepositoryValues:["PATCH /repos/{owner}/{repo}/properties/values"],customPropertiesForReposGetRepositoryValues:["GET /repos/{owner}/{repo}/properties/values"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disableImmutableReleases:["DELETE /repos/{owner}/{repo}/immutable-releases"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enableImmutableReleases:["PUT /repos/{owner}/{repo}/immutable-releases"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],listOrgPatternConfigs:["GET /orgs/{org}/secret-scanning/pattern-configurations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],updateOrgPatternConfigs:["PATCH /orgs/{org}/secret-scanning/pattern-configurations"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteAttestationsBulk:["POST /users/{username}/attestations/delete-request"],deleteAttestationsById:["DELETE /users/{username}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /users/{username}/attestations/digest/{subject_digest}"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listAttestationsBulk:["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},fxn=CJo;var $J=new Map;for(let[t,e]of Object.entries(fxn))for(let[r,n]of Object.entries(e)){let[o,s,c]=n,[l,u]=o.split(/ /),d=Object.assign({method:l,url:u},s);$J.has(t)||$J.set(t,new Map),$J.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var bJo={has({scope:t},e){return $J.get(t).has(e)},getOwnPropertyDescriptor(t,e){return{value:this.get(t,e),configurable:!0,writable:!0,enumerable:!0}},defineProperty(t,e,r){return Object.defineProperty(t.cache,e,r),!0},deleteProperty(t,e){return delete t.cache[e],!0},ownKeys({scope:t}){return[...$J.get(t).keys()]},set(t,e,r){return t.cache[e]=r},get({octokit:t,scope:e,cache:r},n){if(r[n])return r[n];let o=$J.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=SJo(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function PGt(t){let e={};for(let r of $J.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},bJo);return e}a(PGt,"endpointsToMethods");function SJo(t,e,r,n,o){let s=t.request.defaults(n);function c(...l){let u=s.endpoint.merge(...l);if(o.mapToData)return u=Object.assign({},u,{data:u[o.mapToData],[o.mapToData]:void 0}),s(u);if(o.renamed){let[d,f]=o.renamed;t.log.warn(`octokit.${e}.${r}() has been renamed to octokit.${d}.${f}()`)}if(o.deprecated&&t.log.warn(o.deprecated),o.renamedParameters){let d=s.endpoint.merge(...l);for(let[f,h]of Object.entries(o.renamedParameters))f in d&&(t.log.warn(`"${f}" parameter is deprecated for "octokit.${e}.${r}()". Use "${h}" instead`),h in d||(d[h]=d[f]),delete d[f]);return s(d)}return s(...l)}return a(c,"withDecorations"),Object.assign(c,s)}a(SJo,"decorate");function TJo(t){return{rest:PGt(t)}}a(TJo,"restEndpointMethods");TJo.VERSION=kGt;function DGt(t){let e=PGt(t);return{...e,rest:e}}a(DGt,"legacyRestEndpointMethods");DGt.VERSION=kGt;p();var pxn="22.0.1";var hxn=KZe.plugin(xGt,DGt,RGt).defaults({userAgent:`octokit-rest.js/${pxn}`});var xJo=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),xc=new pe("GitHubClient"),gm=class{constructor(e){this.ctx=e;this.octokit=null}static{a(this,"GitHubClient")}async getOctokit(){if(this.octokit)return this.octokit;let e=await this.getApiSession(),r=this.ctx.get(Jt);return this.octokit=new hxn({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!xJo.has(o))return xc.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];xc.debug(this.ctx,`Fetching Copilot timeline events for ${e}/${r}#${n}`);let s=await this.getOctokit();try{let c=[],l=1,u=!0;for(;u;){xc.debug(this.ctx,`Fetching timeline events page ${l} for ${e}/${r}#${n}`);let d=await s.rest.issues.listEventsForTimeline({owner:e,repo:r,issue_number:n,per_page:100,page:l});for(let h of d.data){let m=h;m.created_at&&m.node_id&&(h.event==="copilot_work_started"?c.push({id:m.node_id,eventType:"in_progress",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}):h.event==="copilot_work_finished"?c.push({id:m.node_id,eventType:"done",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}):h.event==="copilot_work_finished_failure"&&c.push({id:m.node_id,eventType:"error",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}))}let f=d.headers.link;u=f?f.includes('rel="next"'):!1,l++}return xc.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(xc.error(this.ctx,`Failed to fetch Copilot timeline events for ${e}/${r}#${n}:`,c),c&&typeof c=="object"&&"status"in c){let l=c;throw new fd(l.status,l.message||"GitHub API error")}throw c}}async getCopilotWorkingStatus(e,r,n,o){xc.debug(this.ctx,`Getting Copilot working status for ${e}/${r}#${n}`);try{let s=await this.getCopilotTimelineEvents(e,r,n,o),c;if(s.length>0){let l=s[s.length-1];l.eventType==="done"?c="done":l.eventType==="in_progress"?c="in_progress":l.eventType==="error"?c="error":c="not_copilot_issue"}else c="not_copilot_issue";return xc.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return xc.error(this.ctx,`Error getting Copilot working status for ${e}/${r}#${n}, treating as not Copilot issue:`,s),"not_copilot_issue"}}async cancelWorkflow(e,r,n){xc.debug(this.ctx,`Cancelling workflow run ${n} for ${e}/${r}`);let o=await this.getOctokit();try{return await o.rest.actions.cancelWorkflowRun({owner:e,repo:r,run_id:n}),xc.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(xc.error(this.ctx,`Failed to cancel workflow run ${n} for ${e}/${r}:`,s),s&&typeof s=="object"&&"status"in s){let c=s;throw new fd(c.status,c.message||"GitHub API error")}throw s}}async listPullRequestFiles(e,r,n){xc.debug(this.ctx,`Listing files for pull request ${e}/${r}#${n}`);let o=await this.getOctokit();try{let s=[],c=1,l=!0;for(;l;){xc.debug(this.ctx,`Fetching pull request files page ${c} for ${e}/${r}#${n}`);let u=await o.rest.pulls.listFiles({owner:e,repo:r,pull_number:n,per_page:100,page:c});for(let f of u.data)s.push({fileName:f.filename});let d=u.headers.link;l=d?d.includes('rel="next"'):!1,c++}return xc.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(xc.error(this.ctx,`Failed to list files for pull request ${e}/${r}#${n}:`,s),s&&typeof s=="object"&&"status"in s){let c=s;throw new fd(c.status,c.message||"GitHub API error")}throw s}}async getBranch(e,r,n){xc.debug(this.ctx,`Getting branch ${n} from ${e}/${r}`);let o=await this.getOctokit();try{let s=await o.rest.repos.getBranch({owner:e,repo:r,branch:n});return xc.debug(this.ctx,`Successfully retrieved branch ${n} from ${e}/${r}`),s.data}catch(s){if(s&&typeof s=="object"&&"status"in s){let c=s;throw xc.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new fd(c.status,c.message||"GitHub API error")}throw xc.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){xc.debug(this.ctx,`Getting pull request ${e}/${r}#${n}`);let o=await this.getOctokit();try{let s=await o.rest.pulls.get({owner:e,repo:r,pull_number:n});return xc.debug(this.ctx,`Successfully retrieved pull request ${e}/${r}#${n}`),{id:s.data.id,html_url:s.data.html_url,number:s.data.number,title:s.data.title,user:s.data.user?{login:s.data.user.login}:void 0,draft:s.data.draft,body:s.data.body||void 0,repository:{owner:{login:s.data.base.repo.owner.login},name:s.data.base.repo.name},updated_at:s.data.updated_at}}catch(s){if(s&&typeof s=="object"&&"status"in s){let c=s;throw xc.debug(this.ctx,`GitHub API error getting pull request #${n}: HTTP ${c.status} - ${c.message}`),new fd(c.status,c.message||"GitHub API error")}throw xc.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){xc.debug(this.ctx,`Adding comment to pull request ${e}/${r}#${n}`);let s=await this.getOctokit();try{let c=await s.rest.issues.createComment({owner:e,repo:r,issue_number:n,body:o});return xc.debug(this.ctx,`Successfully added comment to ${e}/${r}#${n}`),{html_url:c.data.html_url}}catch(c){if(c&&typeof c=="object"&&"status"in c){let l=c;throw xc.debug(this.ctx,`GitHub API error adding comment to #${n}: HTTP ${l.status} - ${l.message}`),new fd(l.status,l.message||"GitHub API error")}throw xc.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){xc.debug(this.ctx,`Listing security advisories for ${r.length} ${e} packages`);let o=await this.getOctokit();try{let s=[],c=1,l=!0;for(;l;){xc.debug(this.ctx,`Fetching security advisories page ${c} for ${r.length} ${e} packages`);let u=await o.securityAdvisories.listGlobalAdvisories({ecosystem:e,affects:r,direction:"asc",sort:"published",per_page:n,page:c});s.push(...u.data);let d=u.headers.link;l=d?d.includes('rel="next"'):!1,c++}return xc.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(xc.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw xc.debug(this.ctx,`GitHub API error listing security advisories for ${r.length} ${e} packages: HTTP ${c.status} - ${c.message}`),new fd(c.status,c.message||"GitHub API error")}throw s}}async getApiSession(){let e=await this.ctx.get(Or).resolveSession();if(!e)throw new x_;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var Za=new pe("CodingAgentClient"),fb=class{constructor(e,r){this.ctx=e;this.timeout=r??3e4}static{a(this,"CodingAgentClient")}getBaseUrl(){return"https://api.githubcopilot.com"}async createCodingTask(e,r,n,o,s,c){Za.debug(this.ctx,`Creating coding agent task for ${n}/${o} with title: ${e}`),this.validateCreateTaskParams(e,r,n,o);let l=await this.getAccessToken(),d=`${this.getBaseUrl()}/agents/swe/${AGt}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:IIn(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...om(this.ctx)};if(c?.isCancellationRequested)throw Za.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new v0;let g=await this.ctx.get(Jt).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw Za.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new v0;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw Za.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new v0;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw Za.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new v0;let _=y.pull_request?.number;if(typeof _!="number")throw new mm("No valid pull request number returned from job");let v=await new gm(this.ctx).getPullRequest(n,o,_);return Za.debug(this.ctx,`Coding task created successfully for ${n}/${o}: job ${A.job_id}, session ${A.session_id}, PR #${v.number}`),{pullRequest:v,sessionId:A.session_id}}validateCreateTaskParams(e,r,n,o){if(!e?.trim())throw Za.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new mp("Title is required and cannot be empty");if(!r?.trim())throw Za.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new mp("ProblemStatement is required and cannot be empty");if(!n?.trim())throw Za.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new mp("Owner is required and cannot be empty");if(!o?.trim())throw Za.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new mp("Repository name is required and cannot be empty");Za.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Or).resolveSession();if(!r?.accessToken)throw Za.debug(this.ctx,"Failed to get access token"),new ww("Failed to call cloud agent API: Not authenticated with GitHub");return r.accessToken}async fetchWithCancellation(e,r,n){let o=new AbortController,s=n?.onCancellationRequested(()=>o.abort());try{return await this.ctx.get(Jt).fetch(e,{timeout:this.timeout,signal:o.signal,...r})}finally{s?.dispose()}}async getAllSessions(e,r){Za.debug(this.ctx,`Getting all coding agent sessions for pull request ID: ${e}`);let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw Za.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new v0;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...om(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Za.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new v0;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get cloud agent sessions: HTTP ${l.status} - ${d}`;throw Za.error(this.ctx,f),new mm(f)}let u=await l.json();return Za.debug(this.ctx,`Found ${u.sessions?.length||0} coding agent sessions for pull request ID: ${e}`),u.sessions||null}catch(s){if(s instanceof xw)throw s;let c=`Failed to get cloud agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Za.error(this.ctx,c),new cde(c)}}async getRepoSessions(e,r){Za.debug(this.ctx,`Getting all coding agent sessions for repo: ${e}`);let n=await this.getAccessToken(),o=this.getBaseUrl(),s=20,c=[],l=1;try{for(;;){if(r?.isCancellationRequested)throw new v0;let u=`${o}/agents/sessions?page_size=${s}&page_number=${l}&resource_state=draft,open&repo_nwo=${e}`,d={Authorization:`Bearer ${n}`,Accept:"application/json",...om(this.ctx)},f=await this.fetchWithCancellation(u,{method:"GET",headers:d},r);if(r?.isCancellationRequested)throw Za.debug(this.ctx,`Get repo sessions operation was cancelled after sending API request for repo: ${e}`),new v0;if(!f.ok){let g=await f.text().catch(()=>f.statusText),A=`Failed to get repo cloud agent sessions: HTTP ${f.status} - ${g}`;throw Za.error(this.ctx,A),new mm(A)}let m=(await f.json()).sessions??[];if(c.push(...m),m.lengthl.statusText),d=`Failed to get cloud agent session logs: HTTP ${l.status} - ${u}`;throw Za.error(this.ctx,d),new mm(d)}return await l.text()}catch(s){if(s instanceof xw)throw s;let c=`Failed to get cloud agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Za.error(this.ctx,c),new cde(c)}}async waitForJobPullRequest(e,r,n,o,s){let c=Date.now(),l=3e4,u=2e3;for(;Date.now()-csetTimeout(r,e))}async handleCreateJobResponse(e){if(!e.ok){let n=await e.text().catch(()=>e.statusText);throw Za.error(this.ctx,`Cloud agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new mm("Cloud agent is not enabled or you do not have access. Learn more about cloud agent at https://docs.github.com/copilot/concepts/agents/cloud-agent/about-cloud-agent"):new mm(`API request failed: HTTP ${e.status} - ${n}`)}let r;try{r=await e.json()}catch(n){let o=n instanceof Error?n.message:JSON.stringify(n);throw Za.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new mm(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw Za.error(this.ctx,"API response missing job_id or session_id",r),new mm("Invalid response from cloud agent");return r}};p();p();var u5=class{static{a(this,"LSPRequestSender")}};var mxn=fe(ii());var JZe=class{constructor(){this.codingAgentMessageRequestType=new mxn.ProtocolRequestType("copilot/codingAgentMessage")}static{a(this,"CodingAgentMessageHandler")}async sendCodingAgentMessage(e,r,n,o){try{ot.debug(e.ctx,`Sending coding agent message to client: ${r} - ${o}`);let c=await e.ctx.get(u5).sendRequest(this.codingAgentMessageRequestType,{title:r,description:n,prLink:o,conversationId:e.conversation.id.toString(),turnId:e.turn.id.toString()});return ot.debug(e.ctx,"Successfully sent coding agent message to client"),c}catch(s){let c=`Failed to send coding agent message: ${s instanceof Error?s.message:JSON.stringify(s)}`;return ot.error(e.ctx,c,s),{success:!1,error:c}}}};p();p();p();p();var pb=fe(wo());function NGt(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(NGt,"adaptCancellationToken");function gxn(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(gxn,"adaptProgressCallback");function Axn(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(Axn,"createEndpointInfo");function yxn(t){let e={role:wJo(t.role),content:RJo(t.content)};if(t.role===pb.Raw.ChatRole.Assistant&&"toolCalls"in t&&t.toolCalls&&(e.tool_calls=t.toolCalls.map(r=>({id:r.id,type:r.type,function:r.function,approxNumTokens:0}))),t.role===pb.Raw.ChatRole.Tool&&"toolCallId"in t&&t.toolCallId&&(e.tool_call_id=t.toolCallId),Array.isArray(t.content)){let r=!1;for(let n of t.content){if(n.type===pb.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=jJe(n);o&&(e.thinking=o);let s=qJe(n);s&&(e.phase=s)}n.type===pb.Raw.ChatCompletionContentPartKind.CacheBreakpoint&&(r=!0)}r&&(e.copilot_cache_control={type:"ephemeral"})}return Object.entries(t).forEach(([r,n])=>{["role","content","toolCalls","toolCallId"].includes(r)||(e[r]=n)}),e}a(yxn,"convertToCopilotChatMessage");function wJo(t){switch(t){case pb.Raw.ChatRole.System:return"system";case pb.Raw.ChatRole.User:return"user";case pb.Raw.ChatRole.Assistant:return"assistant";case pb.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(wJo,"convertRole");function RJo(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===pb.Raw.ChatCompletionContentPartKind.Text||r.type===pb.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===pb.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===pb.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===pb.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(RJo,"convertContent");p();var SF=fe(wo());var ZZe=class extends SF.PromptRenderer{constructor(r,n,o,s,c){super(o,r,n,s);this.options=c;this._promptTsxRemovedNodeCount=0}static{a(this,"InternalPromptRenderer")}get promptTsxRemovedNodeCount(){return this._promptTsxRemovedNodeCount}async renderWithOptions(r,n,o){this._promptTsxRemovedNodeCount=0,this.tracer={didMaterializeTree:a(l=>{this._promptTsxRemovedNodeCount=l.renderedTree.removed},"didMaterializeTree")};let s=await super.render(r,n);return{...this.options,...o}.collapseSystemMessages&&this.collapseConsecutiveSystemMessages(s.messages),s}collapseConsecutiveSystemMessages(r){let n=[],o=null;for(let s of r)if(s.role===SF.Raw.ChatRole.System&&o?.role===SF.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===SF.Raw.ChatCompletionContentPartKind.Text&&l.type===SF.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` `+l.text,o.content=o.content.concat(s.content.slice(1))):(o.content.push({type:SF.Raw.ChatCompletionContentPartKind.Text,text:` -`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===SF.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function yxn(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(DJo(e)){case"image/png":return wJo(e);case"image/gif":return RJo(e);case"image/jpeg":case"image/jpg":return kJo(e);case"image/webp":return PJo(e);default:throw new Error("Unsupported image format")}}a(yxn,"getImageDimensions");function wJo(t){let e=atob(t.slice(0,50)).slice(16,24),r=Uint8Array.from(e,o=>o.charCodeAt(0)),n=new DataView(r.buffer);return{width:n.getUint32(0,!1),height:n.getUint32(4,!1)}}a(wJo,"getPngDimensions");function RJo(t){let e=atob(t.slice(0,50)),r=Uint8Array.from(e,o=>o.charCodeAt(0)),n=new DataView(r.buffer);return{width:n.getUint16(6,!0),height:n.getUint16(8,!0)}}a(RJo,"getGifDimensions");function kJo(t){let e=atob(t),r=Uint8Array.from(e,s=>s.charCodeAt(0)),n=r.length,o=2;for(;o=65472&&s<=65474){let l=new DataView(r.buffer,o+5,4);return{height:l.getUint16(0,!1),width:l.getUint16(2,!1)}}o+=2+c}throw new Error("JPEG dimensions not found")}a(kJo,"getJpegDimensions");function PJo(t){let e=atob(t),r=new Uint8Array(e.length);for(let o=0;o2048||o>2048){let l=2048/Math.max(n,o);n=Math.round(n*l),o=Math.round(o*l)}let s=768/Math.min(n,o);return n=Math.round(n*s),o=Math.round(o*s),Math.ceil(n/512)*Math.ceil(o/512)*170+85}};function XZe(t){let e=Ms(t.tokenizer);return new NGt(e,t)}a(XZe,"createPromptTsxTokenizer");function OJo(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(OJo,"estimateDocumentTokenCost");var gp=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=gxn(n),c=XZe(n);this._internalRenderer=new ZZe(e,r,s,c,o)}static create(e,r,n,o={}){return new t(e,r,n,o)}async renderPrompt(e,r,n){let o=e?mxn(e):void 0,s=r?DGt(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?B1n(c.messages):F1n(c.messages),{messages:c.messages.map(Axn),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles,promptTsxRemovedNodeCount:this._internalRenderer.promptTsxRemovedNodeCount}}async countTokens(e){let r=e?DGt(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function MGt(t,e,r,n,o,s){return await gp.create(t,e,r,s).renderPrompt(n,o,s)}a(MGt,"renderTsxPrompt");p();p();p();var _xn=new pe("toolCallRoundsBuilder");function d5(t,e={}){let r=[],{ctx:n,identifier:o,enableWarnings:s=!1}=e,c=0;for(;c0){let u=new Set(l.tool_calls.map(m=>m.id)),d=[],f=c+1,h=!1;for(;f0){let u=r[r.length-1];u.followUpUserMessage||(u.followUpUserMessage=l)}c++}}return r}a(d5,"buildAssistantRounds");p();var uv=fe(wo());var _Re=new pe("toolCalling"),Rw=class extends fr{static{a(this,"ChatAssistantRounds")}renderCopilot(){if(!this.props.assistantRounds||this.props.assistantRounds.length===0)return vscpp(vscppf,null);let e=this.props.assistantRounds.length,r=this.props.assistantRounds.flatMap((o,s)=>this.renderOneAssistantRound(o,s,e));if(r.length===0)return vscpp(vscppf,null);let n=(0,uv.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},r))}renderOneAssistantRound(e,r,n){let o=e.assistantMessage;if(o.role!=="assistant")return _Re.warn(this.props.ctx,`Tool call round ${r} does not have a valid assistant message`),[];let s=o.modelId!==void 0&&this.props.modelConfiguration?.modelId===o.modelId,c=s&&o.thinking?vscpp(ede,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(QJe,{phase:o.phase}):vscpp(vscppf,null);if(!o.tool_calls||o.tool_calls.length===0){let A=this.getMessageContent(o),y=s&&!!o.thinking,_=!!e.followUpUserMessage,E=[];if((A&&A.trim().length>0||y||_)&&E.push(vscpp(uv.AssistantMessage,null,vscpp(vscppf,null,A),c,l)),e.followUpUserMessage){let v=this.getMessageContent(e.followUpUserMessage);v&&E.push(vscpp(uv.UserMessage,null,vscpp(vscppf,null,v)))}return E}let u=new Set;for(let A of e.toolResults)A.role==="tool"&&A.tool_call_id&&u.add(A.tool_call_id);let d=o.tool_calls.filter(A=>A.id&&u.has(A.id));if(d.length===0){let A=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;_Re.warn(this.props.ctx,`Tool call round ${r} has ${o.tool_calls.length} tool call(s) but none have corresponding results in ${A}. Rendering assistant message content only.`);let y=this.getMessageContent(o);if(!y||y.trim().length===0){if(e.followUpUserMessage){let E=this.getMessageContent(e.followUpUserMessage);if(E)return[vscpp(uv.AssistantMessage,null,vscpp(vscppf,null,""),c,l),vscpp(uv.UserMessage,null,vscpp(vscppf,null,E))]}return[]}let _=[vscpp(uv.AssistantMessage,null,vscpp(vscppf,null,y),c,l)];if(e.followUpUserMessage){let E=this.getMessageContent(e.followUpUserMessage);E&&_.push(vscpp(uv.UserMessage,null,vscpp(vscppf,null,E)))}return _}if(d.length{let y=(0,uv.useKeepWith)();return f.set(A.id,y),{type:"function",function:{name:A.function.name,arguments:typeof A.function.arguments=="string"?A.function.arguments:JSON.stringify(A.function.arguments)},id:A.id,keepWith:y}}),m=[];m.push(vscpp(uv.AssistantMessage,{toolCalls:h},vscpp(vscppf,null,this.getMessageContent(o)),c,l));let g=1/(n*4)/d.length;for(let A=0;AT.tool_call_id===y.id);if(!E){let T=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;_Re.warn(this.props.ctx,`No tool result found for tool call ID ${y.id} in ${T}`);continue}let v=this.getMessageContent(E);this.props.truncateAt&&(v=this.truncateContent(v,this.props.truncateAt));let S=_;m.push(vscpp(S,{priority:r,flexGrow:r+1,flexReserve:`/${1/g}`},vscpp(uv.ToolMessage,{toolCallId:y.id},vscpp(vscppf,null,v))))}if(e.followUpUserMessage){let A=this.getMessageContent(e.followUpUserMessage);A&&m.push(vscpp(uv.UserMessage,null,vscpp(vscppf,null,A)))}return m}getMessageContent(e){return typeof e.content=="string"?e.content:Array.isArray(e.content)?e.content.map(r=>r.type==="text"?r.text:"").filter(r=>r.length>0).join(` +`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===SF.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function _xn(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(MJo(e)){case"image/png":return kJo(e);case"image/gif":return PJo(e);case"image/jpeg":case"image/jpg":return DJo(e);case"image/webp":return NJo(e);default:throw new Error("Unsupported image format")}}a(_xn,"getImageDimensions");function kJo(t){let e=atob(t.slice(0,50)).slice(16,24),r=Uint8Array.from(e,o=>o.charCodeAt(0)),n=new DataView(r.buffer);return{width:n.getUint32(0,!1),height:n.getUint32(4,!1)}}a(kJo,"getPngDimensions");function PJo(t){let e=atob(t.slice(0,50)),r=Uint8Array.from(e,o=>o.charCodeAt(0)),n=new DataView(r.buffer);return{width:n.getUint16(6,!0),height:n.getUint16(8,!0)}}a(PJo,"getGifDimensions");function DJo(t){let e=atob(t),r=Uint8Array.from(e,s=>s.charCodeAt(0)),n=r.length,o=2;for(;o=65472&&s<=65474){let l=new DataView(r.buffer,o+5,4);return{height:l.getUint16(0,!1),width:l.getUint16(2,!1)}}o+=2+c}throw new Error("JPEG dimensions not found")}a(DJo,"getJpegDimensions");function NJo(t){let e=atob(t),r=new Uint8Array(e.length);for(let o=0;o2048||o>2048){let l=2048/Math.max(n,o);n=Math.round(n*l),o=Math.round(o*l)}let s=768/Math.min(n,o);return n=Math.round(n*s),o=Math.round(o*s),Math.ceil(n/512)*Math.ceil(o/512)*170+85}};function XZe(t){let e=Ms(t.tokenizer);return new MGt(e,t)}a(XZe,"createPromptTsxTokenizer");function BJo(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(BJo,"estimateDocumentTokenCost");var gp=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=Axn(n),c=XZe(n);this._internalRenderer=new ZZe(e,r,s,c,o)}static create(e,r,n,o={}){return new t(e,r,n,o)}async renderPrompt(e,r,n){let o=e?gxn(e):void 0,s=r?NGt(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?F1n(c.messages):U1n(c.messages),{messages:c.messages.map(yxn),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles,promptTsxRemovedNodeCount:this._internalRenderer.promptTsxRemovedNodeCount}}async countTokens(e){let r=e?NGt(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function OGt(t,e,r,n,o,s){return await gp.create(t,e,r,s).renderPrompt(n,o,s)}a(OGt,"renderTsxPrompt");p();p();p();var Exn=new pe("toolCallRoundsBuilder");function d5(t,e={}){let r=[],{ctx:n,identifier:o,enableWarnings:s=!1}=e,c=0;for(;c0){let u=new Set(l.tool_calls.map(m=>m.id)),d=[],f=c+1,h=!1;for(;f0){let u=r[r.length-1];u.followUpUserMessage||(u.followUpUserMessage=l)}c++}}return r}a(d5,"buildAssistantRounds");p();var uv=fe(wo());var _Re=new pe("toolCalling"),Rw=class extends fr{static{a(this,"ChatAssistantRounds")}renderCopilot(){if(!this.props.assistantRounds||this.props.assistantRounds.length===0)return vscpp(vscppf,null);let e=this.props.assistantRounds.length,r=this.props.assistantRounds.flatMap((o,s)=>this.renderOneAssistantRound(o,s,e));if(r.length===0)return vscpp(vscppf,null);let n=(0,uv.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},r))}renderOneAssistantRound(e,r,n){let o=e.assistantMessage;if(o.role!=="assistant")return _Re.warn(this.props.ctx,`Tool call round ${r} does not have a valid assistant message`),[];let s=o.modelId!==void 0&&this.props.modelConfiguration?.modelId===o.modelId,c=s&&o.thinking?vscpp(tde,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(QJe,{phase:o.phase}):vscpp(vscppf,null);if(!o.tool_calls||o.tool_calls.length===0){let A=this.getMessageContent(o),y=s&&!!o.thinking,_=!!e.followUpUserMessage,E=[];if((A&&A.trim().length>0||y||_)&&E.push(vscpp(uv.AssistantMessage,null,vscpp(vscppf,null,A),c,l)),e.followUpUserMessage){let v=this.getMessageContent(e.followUpUserMessage);v&&E.push(vscpp(uv.UserMessage,null,vscpp(vscppf,null,v)))}return E}let u=new Set;for(let A of e.toolResults)A.role==="tool"&&A.tool_call_id&&u.add(A.tool_call_id);let d=o.tool_calls.filter(A=>A.id&&u.has(A.id));if(d.length===0){let A=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;_Re.warn(this.props.ctx,`Tool call round ${r} has ${o.tool_calls.length} tool call(s) but none have corresponding results in ${A}. Rendering assistant message content only.`);let y=this.getMessageContent(o);if(!y||y.trim().length===0){if(e.followUpUserMessage){let E=this.getMessageContent(e.followUpUserMessage);if(E)return[vscpp(uv.AssistantMessage,null,vscpp(vscppf,null,""),c,l),vscpp(uv.UserMessage,null,vscpp(vscppf,null,E))]}return[]}let _=[vscpp(uv.AssistantMessage,null,vscpp(vscppf,null,y),c,l)];if(e.followUpUserMessage){let E=this.getMessageContent(e.followUpUserMessage);E&&_.push(vscpp(uv.UserMessage,null,vscpp(vscppf,null,E)))}return _}if(d.length{let y=(0,uv.useKeepWith)();return f.set(A.id,y),{type:"function",function:{name:A.function.name,arguments:typeof A.function.arguments=="string"?A.function.arguments:JSON.stringify(A.function.arguments)},id:A.id,keepWith:y}}),m=[];m.push(vscpp(uv.AssistantMessage,{toolCalls:h},vscpp(vscppf,null,this.getMessageContent(o)),c,l));let g=1/(n*4)/d.length;for(let A=0;AT.tool_call_id===y.id);if(!E){let T=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;_Re.warn(this.props.ctx,`No tool result found for tool call ID ${y.id} in ${T}`);continue}let v=this.getMessageContent(E);this.props.truncateAt&&(v=this.truncateContent(v,this.props.truncateAt));let S=_;m.push(vscpp(S,{priority:r,flexGrow:r+1,flexReserve:`/${1/g}`},vscpp(uv.ToolMessage,{toolCallId:y.id},vscpp(vscppf,null,v))))}if(e.followUpUserMessage){let A=this.getMessageContent(e.followUpUserMessage);A&&m.push(vscpp(uv.UserMessage,null,vscpp(vscppf,null,A)))}return m}getMessageContent(e){return typeof e.content=="string"?e.content:Array.isArray(e.content)?e.content.map(r=>r.type==="text"?r.text:"").filter(r=>r.length>0).join(` `):JSON.stringify(e.content)}truncateContent(e,r){let n=this.props.modelConfiguration;if(!n||e.lengthn.type==="image_url"),r=t.filter(n=>n.type==="text").map(n=>n.text).join("");return{imageUrls:e,textContent:r}}a(LJo,"separateTextAndImages");function BJo(t){return t.map(e=>vscpp(Am.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(BJo,"createImageElements");function eXe(t){let{imageUrls:e,textContent:r}=LJo(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(Am.TextChunk,null,vscpp(vscppf,null,r)),...BJo(e)]}a(eXe,"renderMixedContent");function OGt(t){return t==null?[]:t.map(r=>({id:r.id||"",type:"function",function:{name:r.function.name,arguments:typeof r.function.arguments=="string"?r.function.arguments:JSON.stringify(r.function.arguments)},approxNumTokens:r.approxNumTokens}))}a(OGt,"convertToPromptTsxToolCall");function tXe(t){switch(t.role){case"assistant":return FJo(t);case"tool":return UJo(t);case"user":return QJo(t);case"system":return qJo(t);case"function":throw new Error("ChatRole.Function is not supported in prompt-tsx conversion. Use ChatRole.Tool instead.");default:throw new Error(`Unsupported chat role: ${String(t.role)}`)}}a(tXe,"convertChatMessageToPromptTsx");function FJo(t){let e=t.thinking?vscpp(ede,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(Am.AssistantMessage,{toolCalls:OGt(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(Am.AssistantMessage,{toolCalls:OGt(t.tool_calls)},vscpp(vscppf,null,eXe(t.content)),e):vscpp(Am.AssistantMessage,{toolCalls:OGt(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(FJo,"renderAssistantMessage");function UJo(t){return typeof t.content=="string"?vscpp(Am.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Am.ToolMessage,{toolCallId:t.tool_call_id||""},eXe(t.content)):vscpp(Am.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(UJo,"renderToolMessage");function QJo(t){return typeof t.content=="string"?vscpp(Am.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Am.UserMessage,null,eXe(t.content)):vscpp(Am.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(QJo,"renderUserMessage");function qJo(t){return typeof t.content=="string"?vscpp(Am.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Am.SystemMessage,null,eXe(t.content)):vscpp(Am.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(qJo,"renderSystemMessage");var jJo=new pe("conversationHistoryPrompt"),pde=class extends fr{static{a(this,"ConversationHistoryPrompt")}fixToolCallsInResponse(e,r){if(e.tool_calls&&e.tool_calls.length){let n=e.tool_calls,o=[];for(let s of n)r.some(l=>l.role==="tool"&&l.tool_call_id===s.id)?o.push(s):jJo.warn(this.props.ctx,`Tool call ${s.id} does not have a result in the response. Removing it from the tool calls history.`);return{...e,tool_calls:o}}return e}renderCopilot(){return vscpp(vscppf,null,this.renderHistory())}renderHistory(){let e=[];for(let r=0;rthis.fixToolCallsInResponse(l,o)),c=d5(s,{ctx:this.props.ctx,identifier:"conversation history",enableWarnings:!0});c.length>0&&e.push(vscpp(Rw,{assistantRounds:c,ctx:this.props.ctx,isHistorical:!0,identifier:"conversation-history",modelConfiguration:this.props.modelConfiguration}))}}return e}};var nXe=fe(wo());var rXe=class extends fr{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(nXe.SystemMessage,null,"You are an expert at summarizing chat conversations.",vscpp("br",null),vscpp("br",null),"You will be provided:",vscpp("br",null),vscpp("br",null),"- A series of user/assistant message pairs in chronological order",vscpp("br",null),"- A final user message indicating the user's intent.",vscpp("br",null),vscpp("br",null),"Your task is to:",vscpp("br",null),vscpp("br",null),"- Create a detailed summary of the conversation that captures the user's intent and key information.",vscpp("br",null),vscpp("br",null),"Keep in mind:",vscpp("br",null),vscpp("br",null),"- The user is iterating on a feature specification, bug fix, or other common programming task.",vscpp("br",null),"- There may be relevant code snippets or files referenced in the conversation.",vscpp("br",null),"- The user is collaborating with the assistant to refine their ideas and solutions, course-correcting the assistant as needed.",vscpp("br",null),"- The user will provide feedback on the assistant's suggestions and may request changes or improvements.",vscpp("br",null),"- Disregard messages that the user has indicated are incorrect, irrelevant, or unhelpful.",vscpp("br",null),"- Preserve relevant and actionable context and key information.",vscpp("br",null),"- If the conversation is long or discusses several tasks, keep the summary focused on the task indicated by the user's intent.",vscpp("br",null),"- Always prefer decisions in later messages over earlier ones.",vscpp("br",null),vscpp("br",null),"Structure your summary using the following format:",vscpp("br",null),vscpp("br",null),"TITLE: A brief title for the summary",vscpp("br",null),"USER INTENT: The user's goal or intent for the conversation",vscpp("br",null),"TASK DESCRIPTION: Main technical goals and user requirements",vscpp("br",null),"EXISTING: What has already been accomplished. Include file paths and other direct references.",vscpp("br",null),"PENDING: What still needs to be done. Include file paths and other direct references.",vscpp("br",null),"CODE STATE: A list of all files discussed or modified. Provide code snippets or diffs that illustrate important context.",vscpp("br",null),"RELEVANT CODE/DOCUMENTATION SNIPPETS: Key code or documentation snippets from referenced files or discussions.",vscpp("br",null),"OTHER NOTES: Any additional context or information that may be relevant."),vscpp(pde,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(nXe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function Exn(t){let e={title:"",userIntent:""},r=t.match(/\*{0,2}TITLE:\*{0,2}\s*(.+?)(?=\*{2}[A-Z]|\n|$)/);r&&(e.title=r[1].trim());let n=t.match(/\*{0,2}USER INTENT:\*{0,2}\s*(.+?)(?=\*{2}[A-Z]|\n|$)/);return n&&(e.userIntent=n[1].trim()),e}a(Exn,"parseStructuredSummary");var iXe=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"ChatMLConversationSummarizer")}async provideSummary(e,r,n){try{let o=e.turns.filter(m=>m.status==="success"&&m.request?.message&&m.response?.message),s=e.turns.length>0?e.turns[e.turns.length-1]:null,c=s&&s.request?.message?[...o,s]:o;if(c.length===0)return ot.debug(this.ctx,"No turns to summarize"),"";let l=n.modelProviderName&&n.userRequestedModelIdOrEmpty?await zO(this.ctx,n.modelProviderName,n.userRequestedModelIdOrEmpty):await Ro.getModelConfigurationById(this.ctx,n.userRequestedModelIdOrEmpty,e.id.toString(),jq(c));Ro.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await gp.create(rXe,{ctx:this.ctx,conversationTurns:c},l).renderPrompt(void 0,r)).messages,uiKind:n.uiKind,llmInteraction:n.llmInteraction,modelConfiguration:l,turnId:n.turnId},h=await this.chatFetcher.fetchResponse(f,r,n.telemetryWithExp,void 0);if(r.isCancellationRequested)return ot.debug(this.ctx,"Summarization cancelled"),"";if(h.type==="success"){let m=h.value.trim();return m.match(/^".*"$/)&&(m=m.slice(1,-1)),ot.debug(this.ctx,`Successfully generated conversation summary of length ${m.length}`),m}else{let m="reason"in h?h.reason:"unknown";return ot.error(this.ctx,`Failed to fetch conversation summary because of response type (${h.type}) and reason (${m})`),""}}catch(o){return ot.exception(this.ctx,o,"Error generating conversation summary"),""}}};p();var ERe=new pe("repository"),TF=class t{static{a(this,"GitBranchData")}constructor(e,r=!1){this.currentBranch=e,this.isDetachedHead=r}static detachedHead(){return new t(void 0,!0)}static branch(e){return new t(e,!1)}},kw=class{static{a(this,"GitBranchLoader")}},f5=class extends kw{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackBranchLoader")}async getBranchInfo(r,n){for(let o of this.loaders){let s=await o.getBranchInfo(r,n);if(s)return s}}};p();var vxn=require("child_process");var p5=class extends kw{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,vxn.execFile)(r,n,{cwd:e},(c,l)=>{c?s(c):o(l)})})}async tryRunCommand(e,r,n,o){try{return await this.runCommand(r,n,o)}catch(s){ERe.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=ys(r);if(n===void 0)return;let o;try{o=(await jO()).path}catch(c){ERe.info(e,`Skipping git branch lookup: ${c.message}`);return}let s=await this.tryRunCommand(e,n,o,["-c","safe.directory=*","branch","--show-current",...this.extraArgs()]);if(s!==void 0){let c=s.trim();return c?TF.branch(c):TF.detachedHead()}}extraArgs(){return[]}};p();var h5=class extends kw{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get(Go),o=Oa(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;ERe.info(e,`Failed to parse git HEAD file in ${o}:`,n);return}}parseHeadContent(e){if(e.startsWith("ref: refs/heads/")){let r=e.substring(16);return TF.branch(r)}else return this.isCommitSha(e)?TF.detachedHead():TF.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var lj=new pe("codingAgentTurnProcessor"),oXe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Bc),this.chatFetcher=this.chatFetcher??new mc(e.ctx),this.turnSuggestions=new aj(e.ctx,this.chatFetcher),this.codingAgentClient=new fb(e.ctx),this.gitHubClient=new gm(e.ctx),this.codingAgentMessageHandler=new JZe,this.conversationSummarizer=new iXe(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn}static{a(this,"CodingAgentTurnProcessor")}async process(e,r,n,o,s){try{let c=await fl(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});await this.processWithCodingAgent(e,r,this.turnContext,c,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c),Ma(this.turnContext.ctx,c,"codingAgent");let l=c instanceof Error?c.message:JSON.stringify(c);this.turn.status="error",this.updateTurnResponseWithError(l),await this.endProgress({error:{message:l,code:Lq.Unknown,responseIsIncomplete:!0}})}finally{zKe(this.turnContext.ctx).catch(()=>{})}}async processWithCodingAgent(e,r,n,o,s,c,l){await this.conversationProgress.begin(this.conversation,this.turn,e),r.onCancellationRequested(async()=>{lj.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});try{let u;if(this.turnContext.turn.workspaceFolders&&this.turnContext.turn.workspaceFolders.length>0?u=this.turnContext.turn.workspaceFolders[0]:u=this.turnContext.turn.workspaceFolder,!u)throw new mp("No workspace folder available for git repository detection");let f=await new Pf(this.turnContext.ctx).getRepo(u);if(!f||!f.isGitHub())throw new mp("No GitHub repository found in the workspace folder");if(!f.owner||!f.name)throw new mp("Could not determine repository owner and name");let h={owner:f.owner,name:f.name},g=await new f5([new p5,new h5]).getBranchInfo(this.turnContext.ctx,u),A;if(g?.currentBranch&&!g.isDetachedHead){A=g.currentBranch,lj.debug(this.turnContext.ctx,`Found current branch: ${A}`);try{await this.gitHubClient.getBranch(h.owner,h.name,A),lj.debug(this.turnContext.ctx,`Branch ${A} exists remotely`)}catch(N){if(N instanceof fd&&N.status===404){let O=`Base branch "${A}" does not exist remotely in ${h.owner}/${h.name}. Please push the branch to the remote repository before creating a cloud agent job.`;throw await this.conversationProgress.report(this.conversation,this.turn,{reply:`${O} +`,u=Math.round(c*(r-Math.floor(l.length/c))),d=Math.round(u*.4),f=u-d;return e.slice(0,d)+l+e.slice(-f)}};p();var Am=fe(wo());function FJo(t){let e=t.filter(n=>n.type==="image_url"),r=t.filter(n=>n.type==="text").map(n=>n.text).join("");return{imageUrls:e,textContent:r}}a(FJo,"separateTextAndImages");function UJo(t){return t.map(e=>vscpp(Am.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(UJo,"createImageElements");function eXe(t){let{imageUrls:e,textContent:r}=FJo(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(Am.TextChunk,null,vscpp(vscppf,null,r)),...UJo(e)]}a(eXe,"renderMixedContent");function LGt(t){return t==null?[]:t.map(r=>({id:r.id||"",type:"function",function:{name:r.function.name,arguments:typeof r.function.arguments=="string"?r.function.arguments:JSON.stringify(r.function.arguments)},approxNumTokens:r.approxNumTokens}))}a(LGt,"convertToPromptTsxToolCall");function tXe(t){switch(t.role){case"assistant":return QJo(t);case"tool":return qJo(t);case"user":return jJo(t);case"system":return HJo(t);case"function":throw new Error("ChatRole.Function is not supported in prompt-tsx conversion. Use ChatRole.Tool instead.");default:throw new Error(`Unsupported chat role: ${String(t.role)}`)}}a(tXe,"convertChatMessageToPromptTsx");function QJo(t){let e=t.thinking?vscpp(tde,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(Am.AssistantMessage,{toolCalls:LGt(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(Am.AssistantMessage,{toolCalls:LGt(t.tool_calls)},vscpp(vscppf,null,eXe(t.content)),e):vscpp(Am.AssistantMessage,{toolCalls:LGt(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(QJo,"renderAssistantMessage");function qJo(t){return typeof t.content=="string"?vscpp(Am.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Am.ToolMessage,{toolCallId:t.tool_call_id||""},eXe(t.content)):vscpp(Am.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(qJo,"renderToolMessage");function jJo(t){return typeof t.content=="string"?vscpp(Am.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Am.UserMessage,null,eXe(t.content)):vscpp(Am.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(jJo,"renderUserMessage");function HJo(t){return typeof t.content=="string"?vscpp(Am.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Am.SystemMessage,null,eXe(t.content)):vscpp(Am.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(HJo,"renderSystemMessage");var GJo=new pe("conversationHistoryPrompt"),hde=class extends fr{static{a(this,"ConversationHistoryPrompt")}fixToolCallsInResponse(e,r){if(e.tool_calls&&e.tool_calls.length){let n=e.tool_calls,o=[];for(let s of n)r.some(l=>l.role==="tool"&&l.tool_call_id===s.id)?o.push(s):GJo.warn(this.props.ctx,`Tool call ${s.id} does not have a result in the response. Removing it from the tool calls history.`);return{...e,tool_calls:o}}return e}renderCopilot(){return vscpp(vscppf,null,this.renderHistory())}renderHistory(){let e=[];for(let r=0;rthis.fixToolCallsInResponse(l,o)),c=d5(s,{ctx:this.props.ctx,identifier:"conversation history",enableWarnings:!0});c.length>0&&e.push(vscpp(Rw,{assistantRounds:c,ctx:this.props.ctx,isHistorical:!0,identifier:"conversation-history",modelConfiguration:this.props.modelConfiguration}))}}return e}};var nXe=fe(wo());var rXe=class extends fr{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(nXe.SystemMessage,null,"You are an expert at summarizing chat conversations.",vscpp("br",null),vscpp("br",null),"You will be provided:",vscpp("br",null),vscpp("br",null),"- A series of user/assistant message pairs in chronological order",vscpp("br",null),"- A final user message indicating the user's intent.",vscpp("br",null),vscpp("br",null),"Your task is to:",vscpp("br",null),vscpp("br",null),"- Create a detailed summary of the conversation that captures the user's intent and key information.",vscpp("br",null),vscpp("br",null),"Keep in mind:",vscpp("br",null),vscpp("br",null),"- The user is iterating on a feature specification, bug fix, or other common programming task.",vscpp("br",null),"- There may be relevant code snippets or files referenced in the conversation.",vscpp("br",null),"- The user is collaborating with the assistant to refine their ideas and solutions, course-correcting the assistant as needed.",vscpp("br",null),"- The user will provide feedback on the assistant's suggestions and may request changes or improvements.",vscpp("br",null),"- Disregard messages that the user has indicated are incorrect, irrelevant, or unhelpful.",vscpp("br",null),"- Preserve relevant and actionable context and key information.",vscpp("br",null),"- If the conversation is long or discusses several tasks, keep the summary focused on the task indicated by the user's intent.",vscpp("br",null),"- Always prefer decisions in later messages over earlier ones.",vscpp("br",null),vscpp("br",null),"Structure your summary using the following format:",vscpp("br",null),vscpp("br",null),"TITLE: A brief title for the summary",vscpp("br",null),"USER INTENT: The user's goal or intent for the conversation",vscpp("br",null),"TASK DESCRIPTION: Main technical goals and user requirements",vscpp("br",null),"EXISTING: What has already been accomplished. Include file paths and other direct references.",vscpp("br",null),"PENDING: What still needs to be done. Include file paths and other direct references.",vscpp("br",null),"CODE STATE: A list of all files discussed or modified. Provide code snippets or diffs that illustrate important context.",vscpp("br",null),"RELEVANT CODE/DOCUMENTATION SNIPPETS: Key code or documentation snippets from referenced files or discussions.",vscpp("br",null),"OTHER NOTES: Any additional context or information that may be relevant."),vscpp(hde,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(nXe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function vxn(t){let e={title:"",userIntent:""},r=t.match(/\*{0,2}TITLE:\*{0,2}\s*(.+?)(?=\*{2}[A-Z]|\n|$)/);r&&(e.title=r[1].trim());let n=t.match(/\*{0,2}USER INTENT:\*{0,2}\s*(.+?)(?=\*{2}[A-Z]|\n|$)/);return n&&(e.userIntent=n[1].trim()),e}a(vxn,"parseStructuredSummary");var iXe=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"ChatMLConversationSummarizer")}async provideSummary(e,r,n){try{let o=e.turns.filter(m=>m.status==="success"&&m.request?.message&&m.response?.message),s=e.turns.length>0?e.turns[e.turns.length-1]:null,c=s&&s.request?.message?[...o,s]:o;if(c.length===0)return ot.debug(this.ctx,"No turns to summarize"),"";let l=n.modelProviderName&&n.userRequestedModelIdOrEmpty?await zO(this.ctx,n.modelProviderName,n.userRequestedModelIdOrEmpty):await Ro.getModelConfigurationById(this.ctx,n.userRequestedModelIdOrEmpty,e.id.toString(),jq(c));Ro.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await gp.create(rXe,{ctx:this.ctx,conversationTurns:c},l).renderPrompt(void 0,r)).messages,uiKind:n.uiKind,llmInteraction:n.llmInteraction,modelConfiguration:l,turnId:n.turnId},h=await this.chatFetcher.fetchResponse(f,r,n.telemetryWithExp,void 0);if(r.isCancellationRequested)return ot.debug(this.ctx,"Summarization cancelled"),"";if(h.type==="success"){let m=h.value.trim();return m.match(/^".*"$/)&&(m=m.slice(1,-1)),ot.debug(this.ctx,`Successfully generated conversation summary of length ${m.length}`),m}else{let m="reason"in h?h.reason:"unknown";return ot.error(this.ctx,`Failed to fetch conversation summary because of response type (${h.type}) and reason (${m})`),""}}catch(o){return ot.exception(this.ctx,o,"Error generating conversation summary"),""}}};p();var ERe=new pe("repository"),TF=class t{static{a(this,"GitBranchData")}constructor(e,r=!1){this.currentBranch=e,this.isDetachedHead=r}static detachedHead(){return new t(void 0,!0)}static branch(e){return new t(e,!1)}},kw=class{static{a(this,"GitBranchLoader")}},f5=class extends kw{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackBranchLoader")}async getBranchInfo(r,n){for(let o of this.loaders){let s=await o.getBranchInfo(r,n);if(s)return s}}};p();var Cxn=require("child_process");var p5=class extends kw{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,Cxn.execFile)(r,n,{cwd:e},(c,l)=>{c?s(c):o(l)})})}async tryRunCommand(e,r,n,o){try{return await this.runCommand(r,n,o)}catch(s){ERe.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=ys(r);if(n===void 0)return;let o;try{o=(await jO()).path}catch(c){ERe.info(e,`Skipping git branch lookup: ${c.message}`);return}let s=await this.tryRunCommand(e,n,o,["-c","safe.directory=*","branch","--show-current",...this.extraArgs()]);if(s!==void 0){let c=s.trim();return c?TF.branch(c):TF.detachedHead()}}extraArgs(){return[]}};p();var h5=class extends kw{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get(Go),o=Oa(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;ERe.info(e,`Failed to parse git HEAD file in ${o}:`,n);return}}parseHeadContent(e){if(e.startsWith("ref: refs/heads/")){let r=e.substring(16);return TF.branch(r)}else return this.isCommitSha(e)?TF.detachedHead():TF.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var lj=new pe("codingAgentTurnProcessor"),oXe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Bc),this.chatFetcher=this.chatFetcher??new mc(e.ctx),this.turnSuggestions=new aj(e.ctx,this.chatFetcher),this.codingAgentClient=new fb(e.ctx),this.gitHubClient=new gm(e.ctx),this.codingAgentMessageHandler=new JZe,this.conversationSummarizer=new iXe(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn}static{a(this,"CodingAgentTurnProcessor")}async process(e,r,n,o,s){try{let c=await fl(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});await this.processWithCodingAgent(e,r,this.turnContext,c,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c),Ma(this.turnContext.ctx,c,"codingAgent");let l=c instanceof Error?c.message:JSON.stringify(c);this.turn.status="error",this.updateTurnResponseWithError(l),await this.endProgress({error:{message:l,code:Lq.Unknown,responseIsIncomplete:!0}})}finally{zKe(this.turnContext.ctx).catch(()=>{})}}async processWithCodingAgent(e,r,n,o,s,c,l){await this.conversationProgress.begin(this.conversation,this.turn,e),r.onCancellationRequested(async()=>{lj.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});try{let u;if(this.turnContext.turn.workspaceFolders&&this.turnContext.turn.workspaceFolders.length>0?u=this.turnContext.turn.workspaceFolders[0]:u=this.turnContext.turn.workspaceFolder,!u)throw new mp("No workspace folder available for git repository detection");let f=await new Pf(this.turnContext.ctx).getRepo(u);if(!f||!f.isGitHub())throw new mp("No GitHub repository found in the workspace folder");if(!f.owner||!f.name)throw new mp("Could not determine repository owner and name");let h={owner:f.owner,name:f.name},g=await new f5([new p5,new h5]).getBranchInfo(this.turnContext.ctx,u),A;if(g?.currentBranch&&!g.isDetachedHead){A=g.currentBranch,lj.debug(this.turnContext.ctx,`Found current branch: ${A}`);try{await this.gitHubClient.getBranch(h.owner,h.name,A),lj.debug(this.turnContext.ctx,`Branch ${A} exists remotely`)}catch(N){if(N instanceof fd&&N.status===404){let O=`Base branch "${A}" does not exist remotely in ${h.owner}/${h.name}. Please push the branch to the remote repository before creating a cloud agent job.`;throw await this.conversationProgress.report(this.conversation,this.turn,{reply:`${O} -`}),lj.error(this.turnContext.ctx,O),new mp(O)}throw N}}else throw new mp("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let y=Mn(this.turn.request.message),_=IIn(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),E=xIn(_);lj.debug(this.turnContext.ctx,`Extracted ${_.length} context file paths (${E.length} characters formatted)`);let v="",S=ude(y);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... +`}),lj.error(this.turnContext.ctx,O),new mp(O)}throw N}}else throw new mp("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let y=Mn(this.turn.request.message),_=xIn(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),E=wIn(_);lj.debug(this.turnContext.ctx,`Extracted ${_.length} context file paths (${E.length} characters formatted)`);let v="",S=dde(y);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... `});let{structuredSummary:N,rawSummary:O}=await this.summarizeConversation(r,o,l);if(r.isCancellationRequested)return;N&&N.title&&(S=N.title),v=O||""}let T=E;v&&(T=E+(E?` -`:"")+v);let{problemStatement:w}=SIn(this.turnContext.ctx,y,T||void 0);await this.conversationProgress.report(this.conversation,this.turn,{reply:`Delegating to cloud agent... +`:"")+v);let{problemStatement:w}=TIn(this.turnContext.ctx,y,T||void 0);await this.conversationProgress.report(this.conversation,this.turn,{reply:`Delegating to cloud agent... -`});let R=await this.codingAgentClient.createCodingTask(S,w,h.owner,h.name,A,r);if(r.isCancellationRequested)return;try{await this.codingAgentMessageHandler.sendCodingAgentMessage(this.turnContext,R.pullRequest.title,R.pullRequest.body||"",R.pullRequest.html_url)}catch(N){lj.warn(this.turnContext.ctx,"Failed to send coding agent message to client",N)}let x="Your work will be continued in this pull request:";await this.conversationProgress.report(this.conversation,this.turn,{reply:x}),this.turn.response={message:x,type:"model"},this.turn.status="success";let k={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let N=await this.fetchSuggestedTitle(r,o.extendedBy({messageSource:"chat.user"},{}));typeof N=="string"&&N!==""&&(k.suggestedTitle=N)}let D=o.extendedBy({modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});ft(this.turnContext.ctx,"codingAgent",D),Ix(this.turnContext.ctx,"codingAgent",D),await this.endProgress(k)}catch(u){if(zQe(this.turnContext.ctx,"codingAgent",u,o),u instanceof zc)lj.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,u),Ma(this.turnContext.ctx,u,"codingAgent"),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(u instanceof xw)Ma(this.turnContext.ctx,u,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(u.message),await this.endProgress({error:{message:u.message,code:Lq.Default,responseIsIncomplete:!0}});else throw lj.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,u),u}}async summarizeConversation(e,r,n){let o=await this.conversationSummarizer.provideSummary(this.conversation,e,{userRequestedModelIdOrEmpty:n?.id||"",modelProviderName:n?.providerName||"",modelInfo:n||void 0,llmInteraction:this.turnContext.toLlmInteraction(),uiKind:this.strategy.uiKind,telemetryWithExp:r,turnId:String(this.turn.id)});if(!o)return{structuredSummary:null,rawSummary:null};let s=Exn(o);return ot.debug(this.turnContext.ctx,`Generated conversation summary - Title: ${s.title}, Intent: ${s.userIntent}`),{structuredSummary:s,rawSummary:o}}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return ot.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=Hq(this.turn.response?.message,{role:"assistant",content:e}):this.turn.response={message:e,type:"meta"}}async endProgress(e){await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}};p();p();var Cxn="```",vRe=String.raw``,HJo=String.raw`${Cxn}[\w]*?\n(?[\s\S]*?)\n${Cxn}`,GJo=new RegExp(vRe+` -`+HJo,"gs"),LGt=["replace","delete"];function BGt(t,e){let r=t.matchAll(GJo),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!LGt.includes(c.mode))continue;let l=c.start?parseInt(c.start)-1:-1,u=c.end?parseInt(c.end)-1:l,f=c.codeblock.split(` +`});let R=await this.codingAgentClient.createCodingTask(S,w,h.owner,h.name,A,r);if(r.isCancellationRequested)return;try{await this.codingAgentMessageHandler.sendCodingAgentMessage(this.turnContext,R.pullRequest.title,R.pullRequest.body||"",R.pullRequest.html_url)}catch(N){lj.warn(this.turnContext.ctx,"Failed to send coding agent message to client",N)}let x="Your work will be continued in this pull request:";await this.conversationProgress.report(this.conversation,this.turn,{reply:x}),this.turn.response={message:x,type:"model"},this.turn.status="success";let k={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let N=await this.fetchSuggestedTitle(r,o.extendedBy({messageSource:"chat.user"},{}));typeof N=="string"&&N!==""&&(k.suggestedTitle=N)}let D=o.extendedBy({modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});ft(this.turnContext.ctx,"codingAgent",D),Ix(this.turnContext.ctx,"codingAgent",D),await this.endProgress(k)}catch(u){if(zQe(this.turnContext.ctx,"codingAgent",u,o),u instanceof zc)lj.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,u),Ma(this.turnContext.ctx,u,"codingAgent"),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(u instanceof xw)Ma(this.turnContext.ctx,u,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(u.message),await this.endProgress({error:{message:u.message,code:Lq.Default,responseIsIncomplete:!0}});else throw lj.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,u),u}}async summarizeConversation(e,r,n){let o=await this.conversationSummarizer.provideSummary(this.conversation,e,{userRequestedModelIdOrEmpty:n?.id||"",modelProviderName:n?.providerName||"",modelInfo:n||void 0,llmInteraction:this.turnContext.toLlmInteraction(),uiKind:this.strategy.uiKind,telemetryWithExp:r,turnId:String(this.turn.id)});if(!o)return{structuredSummary:null,rawSummary:null};let s=vxn(o);return ot.debug(this.turnContext.ctx,`Generated conversation summary - Title: ${s.title}, Intent: ${s.userIntent}`),{structuredSummary:s,rawSummary:o}}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return ot.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=Hq(this.turn.response?.message,{role:"assistant",content:e}):this.turn.response={message:e,type:"meta"}}async endProgress(e){await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}};p();p();var bxn="```",vRe=String.raw``,$Jo=String.raw`${bxn}[\w]*?\n(?[\s\S]*?)\n${bxn}`,VJo=new RegExp(vRe+` +`+$Jo,"gs"),BGt=["replace","delete"];function FGt(t,e){let r=t.matchAll(VJo),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!BGt.includes(c.mode))continue;let l=c.start?parseInt(c.start)-1:-1,u=c.end?parseInt(c.end)-1:l,f=c.codeblock.split(` `),h=f[0].match(/^\s*/)?.[0]??"";f.forEach((y,_)=>{f[_]=y.slice(h.length)});let m={mode:c.mode,codeblock:f.join(` -`),start:l,end:u},g=FGt([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(BGt,"extractEditsFromTaggedCodeblocks");function FGt(t,e){if(t.length===0)return;t.sort((n,o)=>n.start!==o.start?o.start-n.start:o.end-n.end);let r=e.getText().split(` +`),start:l,end:u},g=UGt([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(FGt,"extractEditsFromTaggedCodeblocks");function UGt(t,e){if(t.length===0)return;t.sort((n,o)=>n.start!==o.start?o.start-n.start:o.end-n.end);let r=e.getText().split(` `);for(let n of t){let o=n.start,s=n.end,c=n.mode,l=n.codeblock.split(` `);if(!(o<0||s<0||s=r.length||s>=r.length)){if(c==="delete")r.splice(o,s-o+1);else if(c==="replace"){let u=r[o].match(/^\s*/)?.[0]??"";l.forEach((d,f)=>{l[f]=u+d}),r.splice(o,s-o+1,...l)}}}return r.join(` -`)}a(FGt,"applyEditsToDocument");var hde=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Oops, an error has occurred. Please try again";this.uiKind="conversationPanel";this.computeSuggestions=!0}static{a(this,"PanelTurnProcessorStrategy")}processResponse(){return[]}async buildConversationPrompt(e,r,n,o){let s="user",c=await Ro.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(jA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},sXe=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Please open a file and select code for the inline chat to be available";this.uiKind="conversationInline";this.computeSuggestions=!1}static{a(this,"InlineTurnProcessorStrategy")}async buildConversationPrompt(e,r,n){let o=await this.getCurrentEditorSkill(e);if(!o)return;let s=await this.getDocumentIfValid(o.uri);if(!s)return;let c=n?.producesCodeEdits===!1?"user":"inline",l=await rj(e.ctx),u=await e.ctx.get(dl).getBestChatModelConfig(Z1(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(jA).toPrompt(e,d)}async processResponse(e){let r=[],n=Mn(e.response?.message??"");if(n&&e.status==="success"&&this.currentDocument){let o=await this.processInlineResponse(n,this.currentDocument);o&&r.push(o)}return r}async getCurrentEditorSkill(e){let r=await e.skillResolver.resolve(I_);if(r)return r}async getDocumentIfValid(e){let r=await this.ctx.get(si).getOrReadTextDocument({uri:e});if(r.status==="valid")return r.document}async processInlineResponse(e,r){let o=BGt(e,r).filter(c=>LGt.includes(c.mode)),s=FGt(o,r);if(s)return await this.ctx.get(dm).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return BGt(e,r)}};var aXe=class{constructor(){this.slug="github-copilot-coding-agent";this.name="GitHub Copilot Coding Agent";this.description="Create coding tasks that are executed by GitHub Copilot Coding Agent";this.avatarUrl=void 0}static{a(this,"BackendCodingAgent")}additionalSkills(e){return[]}turnProcessor(e){let r=new hde(e.ctx);return new oXe(e,r)}};p();p();p();p();function bxn(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(bxn,"filterUnsupportedReferences");function Sxn(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(Sxn,"convertToCopilotReferences");var Txn=b.Object({type:b.Literal("github.web-search"),id:b.String(),data:b.Object({query:b.String(),type:b.String(),results:b.Optional(b.Array(b.Object({title:b.String(),excerpt:b.String(),url:b.String()})))}),metadata:b.Optional(b.Object({display_name:b.Optional(b.String()),display_icon:b.Optional(b.String())}))});var uj=class{constructor(e){this.deltaApplier=e;this.appliedLength=0;this.appliedText="";this.appliedAnnotations=[]}static{a(this,"ConversationFinishCallback")}isFinishedAfter(e,r){let n=e.substring(this.appliedLength,e.length),s=this.mapAnnotations(r.annotations).filter(c=>!this.appliedAnnotations.includes(c.id));this.append(n,s,bxn(r.copilotReferences),r.copilotErrors??[],r.copilotConfirmation,r.thinking)}append(e,r,n,o,s,c){this.deltaApplier(e,r,n,o,s,c),this.appliedLength+=e.length,this.appliedText+=e,this.appliedAnnotations.push(...r.map(l=>l.id))}mapAnnotations(e){if(!e)return[];let r=[],n=e.for("CodeVulnerability").map(s=>({...s,type:"code_vulnerability"})),o=e.for("IPCodeCitations").map(s=>({...s,type:"ip_code_citations"}));return r.push(...n),r.push(...o),r}};p();p();var m5=class{constructor(e){this.ctx=e;this.githubRepositoryInfoCache=new Map}static{a(this,"GitHubRepositoryApi")}async getRepositoryInfo(e){let r=`${e.hostname}/${e.owner}/${e.repo}`,n=this.githubRepositoryInfoCache.get(r);if(n)return n;let o=await this._doGetRepositoryInfo(e);if(o?.ok){let s=await o.json();return this.githubRepositoryInfoCache.set(r,s),s}}async _doGetRepositoryInfo({owner:e,repo:r,hostname:n}){let o=await this.ctx.get(Fr).resolveSession(),s;if(o&&new URL(o.serverUrl).hostname===n)s=o;else{let u=await this.ctx.get(QM).findTokenByAuthority(n);u&&(s={accessToken:u.record.accessToken,apiUrl:`https://api.${n}/`})}if(!s&&!(n==="github.com"||n.endsWith(".ghe.com")))return;let c={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};s&&(c.Authorization=`Bearer ${s.accessToken}`);let l=new URL(`repos/${e}/${r}`,s?.apiUrl||`https://api.${n}`).href;return this.ctx.get(Jt).fetch(l,{method:"GET",headers:c})}};p();p();var Ixn=b.Object({name:b.String(),url:b.String()}),xxn=b.Object({path:b.String(),head:b.Optional(b.Object({name:b.String(),upstream:b.Optional(Ixn)})),remotes:b.Optional(b.Array(Ixn))}),UGt=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(g5,"git repository information");let r=[];return r.push([new vr(["Metadata about the current git repository:"]),1]),e.head&&e.head.name?(r.push([new vr([`- Current branch name: ${e.head.name}`]),1]),e.head.upstream&&r.push([new vr([`- Upstream name and url: ${e.head.upstream.name} - ${e.head.upstream.url}`]),1])):r.push([new vr(["- Detached HEAD: yes"]),1]),e.remotes&&e.remotes.length>0&&r.push([new vr([`- Remotes: ${e.remotes.map(n=>n.name).join(", ")}`]),1]),new vr(r)}},g5="git-metadata",cXe=class extends T0{static{a(this,"GitMetadataSkill")}constructor(e){super(g5,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new UGt(r))}};async function wxn(t){let e=await t.skillResolver.resolve(I_);if(e){let c=e.uri,l=eq(t.ctx,c);if(wgn(l))return{repoInfo:l,skillUsed:I_}}let r=await t.skillResolver.resolve(g5);if(!r||!r.remotes||r.remotes.length===0){ot.debug(t.ctx,"Git metadata skill is not available or no remotes available.");return}let o=r.remotes.find(c=>c.name==="origin")??r.remotes[0],s=e9t(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:g5}}a(wxn,"extractRepoInfo");async function Rxn(t){let e=[];return await $Jo(t,e),await VJo(t,e),await WJo(t,e),e}a(Rxn,"skillsToReference");async function $Jo(t,e){let r=await zJo(t);r&&e.push(r)}a($Jo,"addRepositoryReference");async function VJo(t,e){let r=await YJo(t);r&&e.push(r)}a(VJo,"addSelectionReference");async function WJo(t,e){let r=[],n=await JJo(t);n&&r.push(n),r.push(...await ZJo(t)),r.length>0&&e.push(...r)}a(WJo,"addFileReferences");async function zJo(t){let e=await wxn(t);if(e){let r=t.ctx.get(m5),n=e.repoInfo.owner,o=e.repoInfo.repo,s=await r.getRepositoryInfo(e.repoInfo);if(s)return{type:"github.repository",id:`${n}/${o}`,data:{type:"repository",name:o,ownerLogin:n,id:s.id}}}}a(zJo,"gitMetadataToReference");async function YJo(t){let e=await t.skillResolver.resolve(I_);if(e&&e.selection){let n=await t.ctx.get(si).getOrReadTextDocument(e),o=dd(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return KJo(e,n.document)}}a(YJo,"currentEditorToSelectionReference");function KJo(t,e){if(t.selection&&!ode(t.selection)){let r=e.getText(t.selection);return{type:"client.selection",id:t.uri,data:{start:{line:t.selection.start.line,col:t.selection.start.character},end:{line:t.selection.end.line,col:t.selection.end.character},content:r}}}}a(KJo,"extractSelection");async function JJo(t){let e=await t.skillResolver.resolve(I_);if(e){let n=await t.ctx.get(si).getOrReadTextDocument(e),o=dd(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o),n.status==="valid")return{type:"client.file",id:n.document.uri,data:{content:n.document.getText(),language:n.document.detectedLanguageId}}}}a(JJo,"currentEditorToFileReference");async function ZJo(t){let e=[],r=t.turn.request.references;if(r&&r.length>0){let n=t.ctx.get(si);for(let o of r)if(o.type==="file"){let s=await n.getOrReadTextDocument(o),c=dd(s);if(await t.collectFile(t.turn.agent.agentSlug,o.uri,c,o.selection),s.status==="valid"){let l=s.document.getText();e.push({type:"client.file",id:o.uri,data:{content:l,language:s.document.detectedLanguageId}})}}}return e}a(ZJo,"fileReferenceToPlatformFileReference");p();Fo();var XJo=new pe("ChatFetchResultPostProcessor"),mde=class{constructor(e,r,n){this.turnContext=e;this.chatFetcher=r;this.computeSuggestions=n}static{a(this,"ChatFetchResultPostProcessor")}async postProcess(e,r,n,o,s,c,l,u){switch(iSn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s),await this.turnContext.ctx.get(dm).inspectFetchResult(e),e.type){case"success":return await this.processSuccessfulFetchResult(n,e.numTokens,e.requestId,r,l,o,s,u);case"offTopic":return this.processOffTopicFetchResult(s,l,u);case"canceled":return this.turnContext.turn.status="cancelled",this.turnContext.turn.response={message:"Cancelled",type:"user"},{error:{message:Mn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}};case"failed":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:e.reason,type:"server"},XJo.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:cv.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===lv,copilotPlan:Dx(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:e.code}};case"filtered":return this.turnContext.turn.status="filtered",{error:{message:"Oops, your response got filtered. Vote down if you think this shouldn't have happened.",responseIsFiltered:!0}};case"length":return this.turnContext.turn.status="error",{error:{message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0}};case"agentAuthRequired":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},{error:{message:"Authorization required",responseIsFiltered:!1}};case"no_choices":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"No choices returned",type:"server"},{error:{message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"no_finish_reason":return this.turnContext.turn.status="error",n&&n.length>0?this.turnContext.turn.response={message:n,type:"model",references:this.turnContext.turn.response?.references}:this.turnContext.turn.response={message:"No finish reason",type:"server"},{error:{message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"model_not_supported":{this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model not supported",type:"server"};let{modelName:d,modelProviderName:f}=Ro.parseModelNotSupportedReason(e.reason);return{error:{message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:d,modelProviderName:f}}}case"model_max_prompt_tokens_exceeded":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model max prompt tokens exceeded",type:"server"},{error:{message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",code:400,reason:"model_max_prompt_tokens_exceeded",responseIsFiltered:!1}};case"successMultiple":case"tool_calls":case"unknown":return this.turnContext.turn.status="error",{error:{message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1}}}}async processSuccessfulFetchResult(e,r,n,o,s,c,l,u){if(e&&e.length>0){c.markAsDisplayed(),l.markAsDisplayed(),this.turnContext.turn.status="success",this.turnContext.turn.response={message:e,type:"model",references:this.turnContext.turn.response?.references},oSn(this.turnContext,s,e,r,n,u,l);let d=this.computeSuggestions?await this.fetchSuggestions(o,s,c,u):void 0;if(d){let{followUp:f,suggestedTitle:h}=d;return{followup:f.message!==""?f:void 0,suggestedTitle:h!==""?h:void 0}}return{}}return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"The model returned successful but did not contain any response text.",type:"meta"},{error:{message:Mn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new aj(this.turnContext.ctx,this.chatFetcher).fetchRawSuggestions(this.turnContext,e,r,n);if(c===void 0)return;let l=this.enrichFollowup(c,r,n,o);return ot.debug(this.turnContext.ctx,"Computed followup",l),ot.debug(this.turnContext.ctx,"Computed suggested title",c.suggestedTitle),{followUp:l,suggestedTitle:c.suggestedTitle}}enrichFollowup(e,r,n,o){let s=n.extendedBy({messageSource:"chat.suggestions",suggestionId:Dt(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return lSn(this.turnContext.ctx,r,s,o),{message:e.followUp,id:s.properties.suggestionId,type:s.properties.suggestion}}processOffTopicFetchResult(e,r,n){let o="Sorry, but I can only assist with programming related questions.";return this.turnContext.turn.response={message:o,type:"offtopic-detection"},this.turnContext.turn.status="off-topic",sSn(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var lXe=b.Union([b.String(),b.Number()]),$J=b.Union([b.String(),b.Number()]),eZo=b.Union([b.Literal("included"),b.Literal("blocked"),b.Literal("notfound"),b.Literal("empty")]),uXe=b.Object({uri:b.String(),position:b.Optional(vg)}),tZo=b.Object({type:b.Literal("file"),uri:b.String(),position:b.Optional(vg),visibleRange:b.Optional(Of),selection:b.Optional(Of),status:b.Optional(eZo),range:b.Optional(Of)}),rZo=b.Object({type:b.Literal("directory"),uri:b.String()}),nZo=b.Object({type:b.Literal("tool"),uri:b.String(),name:b.Optional(b.String()),server:b.Optional(b.String()),description:b.Optional(b.String())}),A5=b.Union([tZo,rZo,Txn,nZo]),y5=b.Union([b.Literal("panel"),b.Literal("inline")]),iZo=b.Union([b.Object({type:b.Literal("text"),text:b.String()}),b.Object({type:b.Literal("image_url"),imageUrl:b.Object({url:b.String(),detail:b.Optional(b.Union([b.Literal("low"),b.Literal("high")]))})})]),QGt=b.Union([b.String(),b.Array(iZo)]),kxn=b.Object({request:QGt,response:b.Optional(b.String()),agentSlug:b.Optional(b.String()),turnId:b.Optional($J),model:b.Optional(b.String())});function dXe(t){return typeof t=="string"?t:t.map(e=>e.type==="image_url"?{type:"image_url",image_url:{url:e.imageUrl.url,detail:e.imageUrl.detail}}:{type:"text",text:e.text})}a(dXe,"convertToMessageContent");function fXe(t,e){if(t=gT(t),typeof t=="string")return t+e;let r=t.map(n=>n.type==="text").lastIndexOf(!0);if(r>=0){let n=[...t],o=n[r];return n[r]={type:"text",text:o.text+e},n}return[...t,{type:"text",text:e}]}a(fXe,"appendToMessage");var pXe=b.Union([b.Literal("Ask"),b.Literal("Agent"),b.Literal("InlineAgent")]),oZo=b.Object({type:b.String(),description:b.String()}),Pxn=b.Object({name:b.String(),description:b.String(),inputSchema:b.Optional(b.Object({type:b.String(),properties:b.Record(b.String(),oZo),required:b.Array(b.String())})),confirmationMessages:b.Optional(b.Object({title:b.String(),message:b.String()}))}),Kc=b.Object({uri:b.String(),name:b.String()}),sZo=b.Union([b.Literal("not-started"),b.Literal("in-progress"),b.Literal("completed")]),hXe=b.Object({id:b.Number(),title:b.String(),description:b.Optional(b.String()),status:sZo});Fo();var qGt="generate-response",mXe=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},CRe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(Bc),this.chatFetcher=this.chatFetcher??new mc(r.ctx),this.postProcessor=new mde(r,this.chatFetcher,!1),this.conversation=r.conversation,this.turn=r.turn}static{a(this,"RemoteAgentTurnProcessor")}async process(e,r,n,o){try{await this.processWithAgent(e,r,this.turnContext,o)}catch(s){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,s);let c=s instanceof Error?s.message:String(s);this.turn.status="error",this.turn.response={message:c,type:"meta"},s instanceof mXe?await this.endProgress({unauthorized:{authorizationUri:s.authorizationUri,agentSlug:s.agentSlug,agentName:s.agentName}}):await this.endProgress({error:{message:c,responseIsIncomplete:!0}})}}async processWithAgent(e,r,n,o){await this.conversationProgress.begin(this.conversation,this.turn,e);let s=await fl(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let c=await this.buildAgentPrompt(n);if(!c)await this.endTurnWithResponse(`No prompt created for agent ${this.agent.id}`,"error");else{let l={type:"user",prompt:JSON.stringify(c.messages,null,2),tokens:c.tokens};await n.ctx.get(dm).inspectPrompt(l),await n.steps.start(qGt,"Generating response");let u=this.augmentTelemetry(c,s,this.turn.template,o);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let d=await this.fetchConversationResponse(n,c.messages,r,s.extendedBy({messageSource:"chat.user"},{promptTokenLen:c.tokens}),u,o);this.turn.status==="cancelled"&&this.turn.response?.type==="user"?await this.cancelProgress():(await this.finishGenerateResponseStep(d,n),await this.endProgress({error:d.error,followUp:d.followup,suggestedTitle:d.suggestedTitle,skillResolutions:c.skillResolutions}))}}async buildAgentPrompt(e){let r=this.createMessagesFromHistory(e),n=await this.computeCopilotReferences(e),o=this.getOrCreateAgentSessionId(e);return this.turn.agent&&(this.turn.agent.sessionId=o),this.turn.confirmationResponse?this.addConfirmationResponse(this.turn.confirmationResponse,r):r.push({role:"user",content:gT(e.turn.request.message),copilot_references:n.length>0?n:void 0}),{messages:r,tokens:-1,skillResolutions:[]}}getOrCreateAgentSessionId(e){let r=this.turn.agent?.agentSlug;if(r){for(let n of e.conversation.turns)if(n.agent?.agentSlug===r&&n.agent.sessionId)return n.agent.sessionId}return Dt()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return zHt(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:gT(r.request.message)}),r.response&&r.response.type==="model"){let o=Sxn(r.response.references);n.push({role:"assistant",content:gT(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await Rxn(e)}async endTurnWithResponse(e,r){this.turn.response={type:"meta",message:e},this.turn.status=r,await this.conversationProgress.report(this.conversation,this.turn,{reply:e}),await this.endProgress()}async fetchConversationResponse(e,r,n,o,s,c){n.onCancellationRequested(async()=>{await this.cancelProgress()});let l=new uj((h,m,g,A,y,_)=>{let E=y?{...y,agentSlug:this.agent.slug}:void 0;this.conversationProgress.report(this.conversation,this.turn,{reply:h,annotations:m,references:g,notifications:A.map(v=>({message:v.message,severity:"warning"})),confirmationRequest:E,thinking:_}),this.turn.response?(this.turn.response.message=fXe(this.turn.response.message,h),this.turn.response.references.push(...g)):this.turn.response={message:h,type:"model",references:g},this.turn.annotations.push(...m??[]),E&&(this.turn.confirmationRequest=E)}),u=await this.turnContext.ctx.get(Qt).getGitHubSession(),d={engineName:"agents",endpoint:this.agent.endpoint??this.agent.slug,messages:r,uiKind:"conversationPanel",intentParams:{intent:!0,intent_threshold:.7,intent_content:Mn(this.turn.request.message)},authToken:u?.accessToken,copilot_thread_id:this.turn.agent?.sessionId,llmInteraction:e.toLlmInteraction(),turnId:String(this.turn.id)},f=await this.chatFetcher.fetchResponse(d,n,o,(h,m)=>l.isFinishedAfter(h,m));return this.ensureAgentIsAuthorized(f),await this.postProcessor.postProcess(f,n,l.appliedText,o,s.extendedBy(this.addExtensibilityInfoTelemetry()),Mn(this.turn.request.message),"conversationPanel",c)}ensureAgentIsAuthorized(e){if(e.type==="agentAuthRequired")throw this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},new mXe("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return qwe(this.conversation,"conversationPanel",Mn(this.turn.request.message).length,e.tokens,n?.templateId,void 0,r,e.skillResolutions)}addExtensibilityInfoTelemetry(){return{extensibilityInfoJson:JSON.stringify({agent:this.agent.slug,outgoingReferences:this.turn.request.references?.map(e=>e.type)??[],incomingReferences:this.turn.response?.references?.map(e=>e.type)??[]})}}async finishGenerateResponseStep(e,r){e.error?await r.steps.error(qGt,e.error.message):await r.steps.finish(qGt)}async endProgress(e){await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}};var bRe=class{constructor(e,r,n,o,s,c){this.id=e;this.slug=r;this.name=n;this.description=o;this.avatarUrl=s;this.endpoint=c}static{a(this,"RemoteAgent")}additionalSkills(){return[]}turnProcessor(e){return new CRe(this,e)}},gXe=class extends bRe{static{a(this,"ExtensibilityPlatformAgent")}constructor(){super(0,"github","GitHub","Get answers grounded in web search, code search, and your enterprise's knowledge bases.","https://avatars.githubusercontent.com/u/9919?s=200&v=4","chat")}turnProcessor(e){return new CRe(this,e)}};p();var aZo="github",C2=class{static{a(this,"RemoteAgentRegistry")}},AXe=class extends C2{constructor(r){super();this.ctx=r;this._agents=void 0;this._lastFetchTime=0}static{a(this,"CapiRemoteAgentRegistry")}async agents(){return this.shouldRefreshAgents()&&(this._agents=await this.fetchAgents()),this._agents!=null?this._agents.slice():[]}shouldRefreshAgents(){return!this._agents||!this._lastFetchTime?!0:this.isLastFetchOlderOneHour()}isLastFetchOlderOneHour(){return Date.now()-this._lastFetchTime>36e5}async fetchAgents(){let r=await xK(this.ctx,"/agents");return r.ok?(this._lastFetchTime=Date.now(),this.parseAgents(await r.text())):(Br.error(this.ctx,"Failed to fetch agents from CAPI",{status:r.status,statusText:r.statusText}),[])}parseAgents(r){let n;try{n=JSON.parse(r).agents,Array.isArray(n)||Br.error(this.ctx,"Expected 'agents' to be an array")}catch(o){return r.includes("access denied")||Br.warn(this.ctx,"Invalid remote agent response:",r,o),[]}return n.filter(o=>o.slug!==aZo).map(o=>new bRe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var Dxn=fe(require("fs")),dv=fe(require("path"));var jGt=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],HGt="test_",SRe={js:{suffix:[".test",".spec"],location:"sameFolder"},ts:{suffix:[".test",".spec"],location:"sameFolder"},go:{suffix:["_test"],location:"sameFolder"},java:{suffix:["Test"],location:"testFolder"},php:{suffix:["Test"],location:"testFolder"},dart:{suffix:["_test"],location:"testFolder"},cs:{suffix:["Test"],location:"testFolder"},rb:{suffix:["_test","_spec"],location:"testFolder"},py:{prefix:"test_",location:"testFolder"},ps1:{suffix:[".Tests"],location:"testFolder"},kt:{suffix:["Test"],location:"testFolder"}},TRe=class{constructor(e,r,n=void 0){this.ctx=e;this.fileExists=r;this.baseUri=n}static{a(this,"TestFileFinder")}async findTestFileForSourceFile(e){let r=ro(e),n=dv.extname(r).replace(".",""),o=SRe[n]??{location:"sameFolder",prefix:HGt,suffix:jGt},s=[];if(o.prefix&&s.push(o.prefix+r),o.suffix)for(let d of o.suffix??[]){let f=r.replace(`.${n}`,d+"."+n);s.push(f)}let c=o.location??"sameFolder",l;if(c==="sameFolder"){if(l=ys(Cf(e)),l===void 0)return}else{let d=ys(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=dv.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=Ko(l);if(await this.fileExists(u))return Oa(u,s[0])}parseTestFilePath(e){try{return Ko(e)}catch(r){Br.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=ro(e),n=dv.extname(r).replace(".",""),o=SRe[n]??{location:"sameFolder",prefix:HGt,suffix:jGt},s=[];if(o.prefix&&s.push(r.substring(o.prefix.length)),o.suffix)for(let u of o.suffix??[]){let f=r.substring(0,r.length-u.length-1-n.length)+"."+n;s.push(f)}let c=o.location??"sameFolder",l;c==="sameFolder"?l=Cf(e):l=this.determineImplFolder(e);for(let u of s){let d=Oa(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=ys(e);if(r===void 0)return;let n=dv.extname(ro(e)).replace(".",""),o,s=SRe[n]?.location??"sameFolder";s==="sameFolder"?o=dv.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,SRe[n]);if(c.length>0)return Ko(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${dv.sep}${c}`;n?.prefix&&c.startsWith(n.prefix)&&s.push(l),n?.suffix&&n?.suffix.some(u=>c.endsWith(u+r))&&s.push(l)}return s}_readdir(e){return Dxn.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&ys(this.baseUri))??"",o=dv.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(dv.sep)}getRelativeTestFolder(e,r,n,o){let s=dv.dirname(e).replace(r,"");switch(n){case"php":case"dart":case"py":return["tests"];case"ps1":return["Tests"];case"rb":return["test",s];case"cs":return[s.replace("src","src/tests")];case"java":case"scala":case"kt":return[s.replace(/src[\\/]main/,"src/test")];default:return o==="testFolder"?[s.replace("src","test")]:[s]}}determineImplFolder(e){let r=dv.extname(ro(e)).replace(".",""),n=Cf(e);switch(r){case"php":case"dart":case"py":return n.replace("tests","src");case"ps1":return n.replace("Tests","src");case"rb":return n.replace("/test","");case"cs":return n.replace("src/tests","src");case"java":case"scala":case"kt":return n.replace("src/test","src/main");default:return n.replace("test/","src/")}}};function IRe(t){let e=ro(t),r=dv.extname(e),n=SRe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(jGt.some(s=>e.endsWith(s+r))||e.startsWith(HGt))}a(IRe,"isTestFile");p();var GGt=class extends Error{static{a(this,"UserQueryParserError")}constructor(e){super(String(e),{cause:e}),this.name="UserQueryParserError"}};async function Nxn(t,e){let r=t.ctx,n=await Ro.getModelConfiguration(r,"synonyms",{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(jA).toPrompt(t,o);if(!s.toolConfig)return;let c={modelConfiguration:n,uiKind:"conversationPanel",messages:s.messages,tools:s.toolConfig?.tools,tool_choice:s.toolConfig?.tool_choice,llmInteraction:t.toLlmInteraction()},l=new mc(r),u=await fl(r,t),d=await l.fetchResponse(c,e,u.extendedBy({messageSource:"chat.synonyms"}));if(d.type==="success"&&d.toolCalls&&d.toolCalls.length>0){let f=d.toolCalls[0],h=s.toolConfig?.extractArguments(f).keywords;return!h||!Array.isArray(h)?void 0:(ot.debug(r,`UserQueryParser: Parsed ${h.length} keywords from the original user query: ${h.join(", ")}`),h.length?h:void 0)}else{let f="reason"in d?d.reason:"";Ma(r,new GGt(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"UserQueryParser.parseUserQuery")}}a(Nxn,"parseUserQuery");p();p();p();p();var es=class t{static{a(this,"Position")}constructor(e,r){this.lineNumber=e,this.column=r}with(e=this.lineNumber,r=this.column){return e===this.lineNumber&&r===this.column?this:new t(e,r)}delta(e=0,r=0){return this.with(this.lineNumber+e,this.column+r)}equals(e){return t.equals(this,e)}static equals(e,r){return!e&&!r?!0:!!e&&!!r&&e.lineNumber===r.lineNumber&&e.column===r.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,r){return e.lineNumbern||e===n&&r>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=r):(this.startLineNumber=e,this.startColumn=r,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.columne.endColumn)}static strictContainsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.column<=e.startColumn||r.lineNumber===e.endLineNumber&&r.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumn<=e.startColumn||r.endLineNumber===e.endLineNumber&&r.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,r){let n,o,s,c;return r.startLineNumbere.endLineNumber?(s=r.endLineNumber,c=r.endColumn):r.endLineNumber===e.endLineNumber?(s=r.endLineNumber,c=Math.max(r.endColumn,e.endColumn)):(s=e.endLineNumber,c=e.endColumn),new t(n,o,s,c)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,r){let n=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,c=e.endColumn,l=r.startLineNumber,u=r.startColumn,d=r.endLineNumber,f=r.endColumn;return nd?(s=d,c=f):s===d&&(c=Math.min(c,f)),n>s||n===s&&o>c?null:new t(n,o,s,c)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,r){return!e&&!r?!0:!!e&&!!r&&e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&e.endLineNumber===r.endLineNumber&&e.endColumn===r.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new es(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new es(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,r){return new t(this.startLineNumber,this.startColumn,e,r)}setStartPosition(e,r){return new t(e,r,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,r=e){return new t(e.lineNumber,e.column,r.lineNumber,r.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,r){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};var Mxn=250;function HA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/Mxn)),typeof t.maxResults=="number"&&(e=typeof e=="number"?Math.min(t.maxResults,e):t.maxResults),typeof e!="number")throw new Error("Either maxResults or tokenBudget must be provided");return e}a(HA,"getMaxChunks");var Oxn=32e3,Lxn=2e4,xRe=.75;p();p();function GA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(GA,"getFenceForCodeBlock");p();var _Rn=fe(Ml()),ERn=fe(uh());p();var hb=class t{constructor(e){this.id=e}static{a(this,"EmbeddingType")}static{this.text3small_512=new t("text-embedding-3-small-512")}static{this.metis_1024_I16_Binary=new t("metis-1024-I16-Binary")}toString(){return this.id}equals(e){return this.id===e.id}};var AXo=Object.freeze({[hb.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[hb.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function o$t(t){return AXo[t.id]}a(o$t,"getWellKnownEmbeddingTypeInfo");function yXo(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:wRe(l,t),value:c})).filter(c=>c.distance.value>o).sort((c,l)=>l.distance.value-c.distance.value).slice(0,r).map(c=>({distance:c.distance,value:c.value}));if(s.length&&typeof n?.maxSpread=="number"){let c=s.at(0).distance.value*(1-n.maxSpread);return s.filter(u=>u.distance.value>=c)}return s}a(zxn,"rankEmbeddings");p();p();var BF=fe(pl()),yRn=fe(uh());var b5=new pe("GitHubCodeSearch"),lns=300*1e3,aet=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new BF.IntervalTimer,this.startPeriodicRefresh()}static{a(this,"GithubCodeSearchService")}getIndexedCommit(e){return this._indexedCommits.get(e)}setIndexedCommit(e,r){this._indexedCommits.get(e)!==r&&this._indexedCommits.set(e,r)}startPeriodicRefresh(){this._refreshTimer.cancelAndSet(()=>{this.updateIndexedRepoCommit()},lns)}updateIndexedRepoCommit(){if(this._indexedRepos.size!==0)for(let[e,r]of this._indexedRepos.entries())this._indexedCommits.get(e)&&(async()=>{try{let o=await this._ctx.get(Qt).getGitHubSession();if(!o)return;let{currentStatus:s,indexedCommit:c}=await this.getRemoteIndexState(o,r,{isCancellationRequested:!1});if(s==="ready"&&c){let l=this._indexedCommits.get(e);l!==c&&(this._indexedCommits.set(e,c),b5.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){b5.warn(this._ctx,`Failed to update indexed commit for ${e}`,o)}})()}async ensureReposIndexed(e,r,n){return await Promise.all(r.map(async o=>{let s=o?.baseFolder.uri;if(!s||n.isCancellationRequested||this._indexedRepos.has(s))return;let{currentStatus:c,indexedCommit:l}=await this.getRemoteIndexState(e,o,n);if(b5.info(this._ctx,`Index status check for ${o.owner}/${o.name}`,{status:c,indexedCommit:l}),c==="ready")this._indexedRepos.set(s,o),l&&this.setIndexedCommit(s,l);else if(c==="not-yet-indexed")try{await this.tryToInstantIndexRepo(e,o,n),b5.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){b5.warn(this._ctx,`Instant indexing failed for ${o.owner}/${o.name}`,u)}})),r.filter(o=>this._indexedRepos.has(o.baseFolder.uri))}async tryToInstantIndexRepo(e,r,n){await(0,BF.raceTimeout)((async()=>{if(!await(0,BF.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,BF.raceCancellationError)((0,BF.timeout)(l),n);let{currentStatus:u,indexedCommit:d}=await this.getRemoteIndexState(e,r,n);if(u==="ready"){this._indexedRepos.set(r.baseFolder.uri,r),d&&this.setIndexedCommit(r.baseFolder.uri,d);break}else if(u!=="building-index"){let f=`Instant indexing for '${r.owner}/${r.name}' failed. Found unexpected status: '${u}'`;throw b5.error(this._ctx,f),new Error(f)}}return!0})(),8e3)}async getRemoteIndexState(e,r,n){if(!r.owner||!r.name)return{currentStatus:"not-indexable"};let o=r.owner+"/"+r.name,s=await Gd(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return b5.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return b5.debug(this._ctx,`${o} - semantic_code_search_ok: ${c.semantic_code_search_ok}`),c.semantic_code_search_ok?{currentStatus:"ready",indexedCommit:c.semantic_commit_sha}:c.semantic_indexing_enabled?{currentStatus:"building-index"}:{currentStatus:"not-yet-indexed"}}async triggerIndexing(e,r,n,o){let s=xde(this._ctx),c=n.owner+"/"+n.name,l=await Gd(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(b5.error(this._ctx,`Failed to request indexing for '${c}'. Response: ${l.status}. ${await l.text()}`),!1)}async searchRepo(e,r,n,o,s,c){let l=xde(this._ctx),u=await Gd(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:dns(o,7800),include_embeddings:!1,limit:s,embedding_model:r.id}});if(!u.ok)throw new Error(`Code search semantic search failed with status: ${u.status}`);let d=await u.json();if(!Array.isArray(d.results))throw new Error("Code search semantic search unexpected response json shape");return uns(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function xde(t){let e=t.get(Ir);return{"X-Client-Application":`${o1(e.getEditorInfo())}`,"X-Client-Source":o1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(xde,"editorVersionHeaders");async function uns(t,e,r){let o=[],s=new hb(e.embedding_model),c=Gs(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=Oa(c,l.location.path)}catch(d){b5.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:cet(l.chunk.text),rawText:void 0,range:new yRn.Range(l.chunk.line_range.start+1,1,l.chunk.line_range.end+1,1),isFullFile:!1},distance:{embeddingType:s,value:l.distance}})})),{chunks:o,outOfSync:!1}}a(uns,"parseGithubCodeSearchResponse");function dns(t,e){if(t.length*4<=e)return t;let o=new TextEncoder().encode(t);if(o.length<=e)return t;let s=o.slice(0,e);return new TextDecoder().decode(s,{stream:!0})}a(dns,"truncateToMaxUtf8Length");function cet(t){let e=fns(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` -`):t}a(cet,"stripChunkTextMetadata");function fns(t){return t.split(/\r\n|\r|\n/)}a(fns,"splitLines");var w2=fe(pl()),vRn=fe(Ade()),CRn=fe(ym());var WRe=new pe("ChunkingEndpointClient"),LVt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new vRn.LinkedList;this._numberInFlightRequests=0;this._lastSendTime=Date.now();this._isPumping=!1}static{a(this,"RequestRateLimiter")}static{this._abuseLimit=1e3/40}async enqueue(e,r){let n=new w2.DeferredPromise;return r.onCancellationRequested(()=>n.cancel()),this.requestQueue.push({task:e,attempt:0,deferred:n,token:r}),await this.pump(),n.p}async pump(){if(!this._isPumping)try{for(this._isPumping=!0;!this.requestQueue.isEmpty();){this._rateLimitTimeout&&(await this._rateLimitTimeout,this._rateLimitTimeout=void 0);let e=Date.now()-this._lastSendTime;if(e=this._maxParallelChunksRequests){await(0,w2.timeout)(10);continue}if(this._latestRateLimitHint){let o=Date.now();if(othis.targetQuota){let o=Date.now(),s=this._latestQuotaUsed.quota-this.targetQuota,c=o-this._latestQuotaUsed.timestamp,l=2500,u=1e3,d=s/(100-this.targetQuota);d*=Math.max(1-c/l,0);let f=d*u;f>0&&await(0,w2.timeout)(Math.min(f,u))}let r=this.requestQueue.shift();if(r.token.isCancellationRequested){await r.deferred.cancel();continue}this._numberInFlightRequests++,this._lastSendTime=Date.now(),r.task(r.attempt).then(async o=>{if(this.updateQuotasFromResponse(o),r.token.isCancellationRequested){await r.deferred.cancel();return}if(o.ok){await r.deferred.complete(o);return}if(r.attempt0&&(this._rateLimitTimeout=(0,w2.timeout)(s*1e3)),this.requestQueue.unshift({task:r.task,attempt:r.attempt+1,deferred:r.deferred,token:r.token}),await this.pump();return}await r.deferred.complete(o)}).catch(async o=>{await r.deferred.error(o)}).finally(()=>{this._numberInFlightRequests--})}}finally{this._isPumping=!1}}updateQuotasFromResponse(e){let r=Date.now();try{let n=e.headers.get("x-ratelimit-remaining"),o=e.headers.get("x-ratelimit-reset");n&&o&&(this._latestRateLimitHint={timestamp:r,remaining:parseFloat(n),resetAt:parseFloat(o)*1e3});let s=e.headers.get("x-github-total-quota-used");s&&(this._latestQuotaUsed?this._latestQuotaUsed={timestamp:r,quota:parseFloat(s)}:this._latestQuotaUsed={timestamp:r,quota:parseFloat(s)})}catch(n){WRe.error(this.ctx,"Error parsing rate limit/quota headers",n)}}getRequestRetryDelay(e){try{let r=e.headers.get("retry-after");if(r){let n=parseFloat(r);if(!isNaN(n))return n}}catch{WRe.error(this.ctx,"Error parsing retry-after header")}try{let r=e.headers.get("x-ratelimit-reset");if(r){let n=parseFloat(r);if(!isNaN(n)){let o=Math.floor(Date.now()/1e3);return n-o}}}catch{WRe.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},uet=class{constructor(e){this.ctx=e;this._requestLimiter=new LVt(e)}static{a(this,"ChunkingEndpointClientImpl")}computeChunks(e,r,n,o,s,c,l){return this.doComputeChunksAndEmbeddings(e,r,n,o,{qos:s,computeEmbeddings:!1},c,l)}async computeChunksAndEmbeddings(e,r,n,o,s,c,l){return await this.doComputeChunksAndEmbeddings(e,r,n,o,{qos:s,computeEmbeddings:!0},c,l)}async doComputeChunksAndEmbeddings(e,r,n,o,s,c,l){let u=await(0,w2.raceCancellationError)(n.getText(),l);if((0,CRn.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=xde(this.ctx);return await Gd(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:ys(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,w2.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){WRe.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,_Rn.coalesce)(h.chunks.map(m=>{let g=new ERn.Range(m.line_range.start+1,1,m.line_range.end+1,1),A=c?.get(m.hash);if(A)return{chunk:{file:n.uri.toString(),text:cet(A.chunk.text),rawText:void 0,range:g,isFullFile:A.chunk.isFullFile},chunkHash:m.hash,embedding:A.embedding};if(typeof m.text!="string")return;let y;if(m.embedding?.embedding){let _=new hb(h.embedding_model);if(!_.equals(r))throw new Error(`Unexpected embedding model. Got: ${_.id}. Expected: ${r.id}`);y={type:_,value:new Float32Array(m.embedding.embedding)}}if(!(s.computeEmbeddings&&!y))return{chunk:{file:n.uri.toString(),text:cet(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){WRe.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var R_={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},Sg=class t{static{a(this,"WorkspaceChunkSearchTelemetry")}static sendSuccess(e,r,n,o){let s={status_text:"success",...n},c=Vt.createAndMarkAsIssued(s,o);ft(e,r,c),sr(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};Ma(e,n,r,o),Hs(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,R_.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,R_.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,R_.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,R_.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,R_.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,R_.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,R_.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,R_.Remote,r)}static sendSearchFailure(e,r,n){t.sendFailure(e,r,n)}static sendSkipped(e,r,n){let o={status_text:"skipped",reason:n},s=Vt.createAndMarkAsIssued(o,{});ft(e,r,s),sr(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,R_.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,R_.Aggregate,r)}};var bRn=fe(Ml()),SRn=fe(pl()),BVt=fe(E5());var FF=new pe("Remote Search"),det=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._localDiffSearch=n;this._githubCodeSearchService=o;this.id="codesearch";this.localDiffSearchTimeout=15e3}static{a(this,"CodeSearchChunkSearch")}async isAvailable(e){return(await this.getRepos(e)).length>0}async getRepos(e){if(!e?.length)return[];let r=this.ctx.get(Pf),o=(await Promise.all(e.map(async c=>await r.getRepo({uri:c})))).filter(c=>c!==void 0).filter(c=>c.isGitHub()&&c.owner&&c.name),s=new Map;for(let c of o){let l=`${c.owner}/${c.name}`;s.has(l)||s.set(l,c)}return Array.from(s.values())}async searchWorkspace(e,r,n){let o=new BVt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(FF.info(this.ctx,"Starting workspace search",{rawQuery:e.rawQuery,repoCount:s.length,repos:s.map(k=>`${k.owner}/${k.name}`),maxResults:HA(r)}),s.length===0)throw FF.error(this.ctx,"No GitHub repositories found"),Sg.sendRemoteSkipped(this.ctx,"no_github_repos"),new Error("No GitHub repositories found in CodeSearchChunkSearch");let c=await this.ctx.get(Qt).getGitHubSession();if(!c)throw FF.error(this.ctx,"No GitHub session found"),Sg.sendRemoteSkipped(this.ctx,"no_github_session"),new Error("No GitHub session found in CodeSearchChunkSearch");let l=await this._githubCodeSearchService.ensureReposIndexed(c,s,n);if(l.length===0)throw FF.error(this.ctx,"Remote index not ready for any repositories"),Sg.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=HA(r),d=Promise.all(l.map(async k=>{sm(n);let D=await e.resolveQuery(n),N=new BVt.StopWatch,O=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,k,D,u,n);return FF.info(this.ctx,`Search completed for ${k.owner}/${k.name}`,{searchTime:N.elapsed(),chunkCount:O.chunks.length}),O})),f=await this._localDiffSearch.getLocalDiff(r.workspaceFolders),h=new Set(f),m=this._localDiffSearch.shouldDoLocalDiffSearch(f,r.workspaceFolders);FF.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,SRn.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{FF.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(k=>{FF.error(this.ctx,"Local diff search failed",k)})??Promise.resolve(void 0)]),_=(0,bRn.coalesce)(A).flatMap(k=>k.chunks),E=y?.isOk()?y.val.result.chunks:[],v=E.length>0?[..._.filter(k=>!h.has(k.chunk.file)),...E]:_,S=v.length,w=new Set(v.map(k=>k.chunk.file)).size,R=o.elapsed();FF.info(this.ctx,`Search completed successfully in ${R}ms`,{totalTime:R,totalChunkCount:S,uniqueFileCount:w,indexedRepoCount:l.length,localDiffChunkCount:E.length,localDiffStrategy:y?.isOk()?y.val.strategy:"none"});let x=y?.isOk()?"mixed":"codesearch";return Sg.sendRemoteSuccess(this.ctx,R,S,w,x),{chunks:v}}};p();p();var E2n=require("node:url"),v2n=require("path");p();var wet=fe(IRn(),1);p();var FVt=new WeakMap;function Rde(...t){let e=new String(t);return FVt.set(e,t),e}a(Rde,"c");function Dw(t){return t instanceof String&&FVt.has(t)}a(Dw,"r");function kde(t){return FVt.get(t)??[]}a(kde,"o");var Iet=fe(NRn(),1),lPn=require("child_process");var WPn=fe(jVt(),1),i2n=require("node:path");p();function*MRn(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(MRn,"U");var Uns=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),Qns=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),qns=new Set(["edit","remove-section","rename-section","set","unset"]),jns=new Set(["get","get-color","get-colorbool","list"]);function Hns(t,e){for(let{name:n}of MRn(t,"task")){if(Uns.has(n))return Mde(!0,e);if(Qns.has(n))return Mde(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:qns.has(r)?Mde(!0,e.slice(1)):jns.has(r)?Mde(!1,e.slice(1)):e.length===1?Mde(!1,e):Mde(!0,e)}a(Hns,"F");function Mde(t=!1,e=[]){let r=e.at(0)?.toLowerCase();return r===void 0?null:{isWrite:t,isRead:!t,key:r,value:e.at(1)}}a(Mde,"p");function Gns(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(Gns,"A");function $ns(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a($ns,"M");function Vns(t){for(let{name:e}of MRn(t,"task"))switch(e){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}a(Vns,"N");function Wns({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(Wns,"G");function*zns(t){for(let e of t){let r=Wns(e),n=r&&$ns(e.value);n&&(yield{...n,scope:r})}}a(zns,"O");function Yns(t,e,r){let n={read:[],write:[...zns(e)]};return t==="config"&&Kns(n,Vns(e),Hns(e,r)),n}a(Yns,"L");function Kns(t,e,r){if(r===null)return;let n=Gns(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(Kns,"$");var ORn={short:new Map([["c",!0]])},Jns={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...ORn.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},Zns={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"])}},Xns={short:new Map,long:new Set};function eis(t){let e=Zns[t??""]??Xns;return{short:new Map([...ORn.short.entries(),...e.short.entries()]),long:e.long}}a(eis,"I");function LRn(t,e=Jns){if(t.startsWith("--")){let r=t.indexOf("=");if(r>2)return[{name:t.slice(0,r),value:t.slice(r+1),needsNext:!1}];let n=t.slice(2);return[{name:t,needsNext:e.long.has(n)}]}if(t.length===2){let r=t.charAt(1),n=e.short.get(r);return[{name:t,needsNext:n===!0}]}return tis(t,e.short)}a(LRn,"b");function tis(t,e){let r=t.slice(1).split(""),n=[];for(let o=0;oe.has(u)))return n.push({name:`-${s}`,value:l,needsNext:!1}),n}n.push({name:`-${s}`,needsNext:c})}return n}a(tis,"W");function ris(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[dWt(t)[0]])(t=0)),e},"__init"),"__esm"),Ais=a((t,e)=>a(function(){return e||(0,t[dWt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),_m=a((t,e)=>{for(var r in e)uWt(t,r,{get:e[r],enumerable:!0})},"__export"),yis=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of dWt(e))!gis.call(t,o)&&o!==r&&uWt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=mis(e,o))||n.enumerable});return t},"__copyProps"),fh=a(t=>yis(uWt({},"__esModule",{value:!0}),t),"__toCommonJS"),UF,Ej=tn({"src/lib/errors/git-error.ts"(){"use strict";UF=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),ZRe,Fde=tn({"src/lib/errors/git-response-error.ts"(){"use strict";Ej(),ZRe=class extends UF{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),ykn,_kn=tn({"src/lib/errors/task-configuration-error.ts"(){"use strict";Ej(),ykn=class extends UF{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function Ekn(t){return typeof t!="function"?iZ:t}a(Ekn,"asFunction");function vkn(t){return typeof t=="function"&&t!==iZ}a(vkn,"isUserFunction");function Ckn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a(Ckn,"splitOn");function bkn(t,e=0){return Skn(t)&&t.length>e?t[e]:void 0}a(bkn,"first");function nZ(t,e=0){if(Skn(t)&&t.length>e)return t[t.length-1-e]}a(nZ,"last");function Skn(t){return Det(t)}a(Skn,"isArrayLike");function XRe(t="",e=!0,r=` -`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(XRe,"toLinesWithContent");function fWt(t,e){return XRe(t,!0).map(r=>e(r))}a(fWt,"forEachLineWithContent");function pWt(t){return(0,wet.exists)(t,wet.FOLDER)}a(pWt,"folderExists");function Ow(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(Ow,"append");function Tkn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(Tkn,"including");function Ret(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(Ret,"remove");function S5(t){return Array.isArray(t)?t:[t]}a(S5,"asArray");function Ikn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a(Ikn,"asCamelCase");function Ude(t){return S5(t).map(e=>e instanceof String?e:String(e))}a(Ude,"asStringArray");function Pu(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(Pu,"asNumber");function KRe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a(xkn,"pick");function YVt(t=0){return new Promise(e=>setTimeout(e,t))}a(YVt,"delay");function KVt(t){if(t!==!1)return t}a(KVt,"orVoid");var Lde,iZ,eke,ket=tn({"src/lib/utils/util.ts"(){"use strict";hWt(),Lde="\0",iZ=a(()=>{},"NOOP"),eke=Object.prototype.toString.call.bind(Object.prototype.toString)}});function k_(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(k_,"filterType");function JVt(t,e){let r=Dw(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(JVt,"filterPrimitives");function Pet(t){return!!t&&eke(t)==="[object Object]"}a(Pet,"filterPlainObject");function wkn(t){return typeof t=="function"}a(wkn,"filterFunction");var tke,Rkn,yp,bet,Det,hWt=tn({"src/lib/utils/argument-filters.ts"(){"use strict";ket(),tke=a(t=>Array.isArray(t),"filterArray"),Rkn=a(t=>typeof t=="number","filterNumber"),yp=a(t=>typeof t=="string"||Dw(t),"filterString"),bet=a(t=>yp(t)||Array.isArray(t)&&t.every(yp),"filterStringOrStringArray"),Det=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),ZVt,_is=tn({"src/lib/utils/exit-codes.ts"(){"use strict";ZVt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(ZVt||{})}}),Tet,Eis=tn({"src/lib/utils/git-output-streams.ts"(){"use strict";Tet=class kkn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new kkn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function vis(){throw new Error("LineParser:useMatches not implemented")}a(vis,"useMatchesDefault");var Do,_j,Cis=tn({"src/lib/utils/line-parser.ts"(){"use strict";Do=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=vis,this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((o,s)=>this.addMatch(o,s,r(s)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let n=r&&t.exec(r);return n&&this.pushMatch(e,n),!!n}pushMatch(t,e){this.matches.push(...e.slice(1))}},_j=class extends Do{static{a(this,"RemoteLineParser")}addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function Pkn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...Dkn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(Pkn,"createInstanceConfig");var Dkn,bis=tn({"src/lib/utils/simple-git-options.ts"(){"use strict";Dkn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function mWt(t,e=[]){return Pet(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(Dw(o))r.push(o);else if(JVt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)JVt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(mWt,"appendTaskOptions");function hv(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=XRe(o,n),c=0,l=s.length;c{if(!(c+d>=l))return s[c+d]},"line");e.some(({parse:d})=>d(u,t))}}),t}a(Eb,"parseStringResponse");var Iis=tn({"src/lib/utils/task-parser.ts"(){"use strict";ket()}}),Nkn={};_m(Nkn,{ExitCodes:a(()=>ZVt,"ExitCodes"),GitOutputStreams:a(()=>Tet,"GitOutputStreams"),LineParser:a(()=>Do,"LineParser"),NOOP:a(()=>iZ,"NOOP"),NULL:a(()=>Lde,"NULL"),RemoteLineParser:a(()=>_j,"RemoteLineParser"),append:a(()=>Ow,"append"),appendTaskOptions:a(()=>mWt,"appendTaskOptions"),asArray:a(()=>S5,"asArray"),asCamelCase:a(()=>Ikn,"asCamelCase"),asFunction:a(()=>Ekn,"asFunction"),asNumber:a(()=>Pu,"asNumber"),asStringArray:a(()=>Ude,"asStringArray"),bufferToString:a(()=>JRe,"bufferToString"),callTaskParser:a(()=>XVt,"callTaskParser"),createInstanceConfig:a(()=>Pkn,"createInstanceConfig"),delay:a(()=>YVt,"delay"),filterArray:a(()=>tke,"filterArray"),filterFunction:a(()=>wkn,"filterFunction"),filterHasLength:a(()=>Det,"filterHasLength"),filterNumber:a(()=>Rkn,"filterNumber"),filterPlainObject:a(()=>Pet,"filterPlainObject"),filterPrimitives:a(()=>JVt,"filterPrimitives"),filterString:a(()=>yp,"filterString"),filterStringOrStringArray:a(()=>bet,"filterStringOrStringArray"),filterType:a(()=>k_,"filterType"),first:a(()=>bkn,"first"),folderExists:a(()=>pWt,"folderExists"),forEachLineWithContent:a(()=>fWt,"forEachLineWithContent"),getTrailingOptions:a(()=>hv,"getTrailingOptions"),including:a(()=>Tkn,"including"),isUserFunction:a(()=>vkn,"isUserFunction"),last:a(()=>nZ,"last"),objectToString:a(()=>eke,"objectToString"),orVoid:a(()=>KVt,"orVoid"),parseStringResponse:a(()=>Eb,"parseStringResponse"),pick:a(()=>xkn,"pick"),prefixedArray:a(()=>KRe,"prefixedArray"),remove:a(()=>Ret,"remove"),splitOn:a(()=>Ckn,"splitOn"),toLinesWithContent:a(()=>XRe,"toLinesWithContent"),trailingFunctionArgument:a(()=>Zd,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>gWt,"trailingOptionsArgument")});var co=tn({"src/lib/utils/index.ts"(){"use strict";hWt(),_is(),Eis(),Cis(),bis(),Tis(),Iis(),ket()}}),Mkn={};_m(Mkn,{CheckRepoActions:a(()=>eWt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>Lkn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>Okn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>xis,"checkIsRepoTask")});function xis(t){switch(t){case"bare":return Lkn();case"root":return Okn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:Net,parser:AWt}}a(xis,"checkIsRepoTask");function Okn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:Net,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(Okn,"checkIsRepoRootTask");function Lkn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:Net,parser:AWt}}a(Lkn,"checkIsBareRepoTask");function wis(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(wis,"isNotRepoMessage");var eWt,Net,AWt,Bkn=tn({"src/lib/tasks/check-is-repo.ts"(){"use strict";co(),eWt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(eWt||{}),Net=a(({exitCode:t},e,r,n)=>{if(t===128&&wis(e))return r(Buffer.from("false"));n(e)},"onError"),AWt=a(t=>t.trim()==="true","parser")}});function Ris(t,e){let r=new Fkn(t),n=t?Qkn:Ukn;return XRe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(qkn.test(s)?r.folders:r.files).push(s)}),r}a(Ris,"cleanSummaryParser");var Fkn,Ukn,Qkn,qkn,kis=tn({"src/lib/responses/CleanSummary.ts"(){"use strict";co(),Fkn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},Ukn=/^[a-z]+\s*/i,Qkn=/^[a-z]+\s+[a-z]+\s*/i,qkn=/\/$/}}),tWt={};_m(tWt,{EMPTY_COMMANDS:a(()=>Met,"EMPTY_COMMANDS"),adhocExecTask:a(()=>jkn,"adhocExecTask"),configurationErrorTask:a(()=>_b,"configurationErrorTask"),isBufferTask:a(()=>Gkn,"isBufferTask"),isEmptyTask:a(()=>$kn,"isEmptyTask"),straightThroughBufferTask:a(()=>Hkn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>mv,"straightThroughStringTask")});function jkn(t){return{commands:Met,format:"empty",parser:t}}a(jkn,"adhocExecTask");function _b(t){return{commands:Met,format:"empty",parser(){throw typeof t=="string"?new ykn(t):t}}}a(_b,"configurationErrorTask");function mv(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(mv,"straightThroughStringTask");function Hkn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(Hkn,"straightThroughBufferTask");function Gkn(t){return t.format==="buffer"}a(Gkn,"isBufferTask");function $kn(t){return t.format==="empty"||!t.commands.length}a($kn,"isEmptyTask");var Met,ph=tn({"src/lib/tasks/task.ts"(){"use strict";_kn(),Met=[]}}),Vkn={};_m(Vkn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>yWt,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>_Wt,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>EWt,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>_et,"CleanOptions"),cleanTask:a(()=>Wkn,"cleanTask"),cleanWithOptionsTask:a(()=>Pis,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>Dis,"isCleanOptionsArray")});function Pis(t,e){let{cleanMode:r,options:n,valid:o}=Nis(t);return r?o.options?(n.push(...e),n.some(Lis)?_b(yWt):Wkn(r,n)):_b(EWt+JSON.stringify(t)):_b(_Wt)}a(Pis,"cleanWithOptionsTask");function Wkn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return Ris(t==="n",n)}}}a(Wkn,"cleanTask");function Dis(t){return Array.isArray(t)&&t.every(e=>vWt.has(e))}a(Dis,"isCleanOptionsArray");function Nis(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{Mis(o)?(e=o,n.cleanMode=!0):n.options=n.options&&Ois(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(Nis,"getCleanOptions");function Mis(t){return t==="f"||t==="n"}a(Mis,"isCleanMode");function Ois(t){return/^-[a-z]$/i.test(t)&&vWt.has(t.charAt(1))}a(Ois,"isKnownOption");function Lis(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(Lis,"isInteractiveMode");var yWt,_Wt,EWt,_et,vWt,zkn=tn({"src/lib/tasks/clean.ts"(){"use strict";kis(),co(),ph(),yWt="Git clean interactive mode is not supported",_Wt='Git clean mode parameter ("n" or "f") is required',EWt="Git clean unknown option found in: ",_et=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(_et||{}),vWt=new Set(["i",...Ude(Object.values(_et))])}});function Bis(t){let e=new Kkn;for(let r of Ykn(t))e.addValue(r.file,String(r.key),r.value);return e}a(Bis,"configListParser");function Fis(t,e){let r=null,n=[],o=new Map;for(let s of Ykn(t,e))s.key===e&&(n.push(r=s.value),o.has(s.file)||o.set(s.file,[]),o.get(s.file).push(r));return{key:e,paths:Array.from(o.keys()),scopes:o,value:r,values:n}}a(Fis,"configGetParser");function Uis(t){return t.replace(/^(file):/,"")}a(Uis,"configFilePath");function*Ykn(t,e=null){let r=t.split("\0");for(let n=0,o=r.length-1;nObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=nZ(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let n=this.addFile(t);Object.hasOwn(n,e)?Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]:n[e]=r,this._all=void 0}}}});function HVt(t,e){return typeof t=="string"&&Object.hasOwn(rWt,t)?t:e}a(HVt,"asConfigScope");function qis(t,e,r,n){let o=["config",`--${n}`];return r&&o.push("--add"),o.push(t,e),{commands:o,format:"utf-8",parser(s){return s}}}a(qis,"addConfigTask");function jis(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(n){return Fis(n,t)}}}a(jis,"getConfigTask");function His(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return Bis(r)}}}a(His,"listConfigTask");function Gis(){return{addConfig(t,e,...r){return this._runTask(qis(t,e,r[0]===!0,HVt(r[1],"local")),Zd(arguments))},getConfig(t,e){return this._runTask(jis(t,HVt(e,void 0)),Zd(arguments))},listConfig(...t){return this._runTask(His(HVt(t[0],void 0)),Zd(arguments))}}}a(Gis,"config_default");var rWt,Jkn=tn({"src/lib/tasks/config.ts"(){"use strict";Qis(),co(),rWt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(rWt||{})}});function $is(t){return Zkn.has(t)}a($is,"isDiffNameStatus");var GVt,Zkn,Xkn=tn({"src/lib/tasks/diff-name-status.ts"(){"use strict";GVt=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(GVt||{}),Zkn=new Set(Object.values(GVt))}});function Vis(...t){return new tPn().param(...t)}a(Vis,"grepQueryBuilder");function Wis(t){let e=new Set,r={};return fWt(t,n=>{let[o,s,c]=n.split(Lde);e.add(o),(r[o]=r[o]||[]).push({line:Pu(s),path:o,preview:c})}),{paths:e,results:r}}a(Wis,"parseGrep");function zis(){return{grep(t){let e=Zd(arguments),r=hv(arguments);for(let o of ePn)if(r.includes(o))return this._runTask(_b(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=Vis().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return Wis(o)}},e)}}}a(zis,"grep_default");var ePn,YRe,qRn,tPn,rPn=tn({"src/lib/tasks/grep.ts"(){"use strict";co(),ph(),ePn=["-h"],YRe=Symbol("grepQuery"),tPn=class{static{a(this,"GrepQuery")}constructor(){this[qRn]=[]}*[(qRn=YRe,Symbol.iterator)](){for(let t of this[YRe])yield t}and(...t){return t.length&&this[YRe].push("--and","(",...KRe(t,"-e"),")"),this}param(...t){return this[YRe].push(...KRe(t,"-e")),this}}}}),nPn={};_m(nPn,{ResetMode:a(()=>Eet,"ResetMode"),getResetMode:a(()=>Kis,"getResetMode"),resetTask:a(()=>Yis,"resetTask")});function Yis(t,e){let r=["reset"];return iPn(t)&&r.push(`--${t}`),r.push(...e),mv(r)}a(Yis,"resetTask");function Kis(t){if(iPn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(Kis,"getResetMode");function iPn(t){return typeof t=="string"&&oPn.includes(t)}a(iPn,"isValidResetMode");var Eet,oPn,sPn=tn({"src/lib/tasks/reset.ts"(){"use strict";co(),ph(),Eet=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(Eet||{}),oPn=Ude(Object.values(Eet))}});function Jis(){return(0,Iet.default)("simple-git")}a(Jis,"createLog");function jRn(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(n,...o)=>{t(n,...o),r(n,...o)}:t:(n,...o)=>{t(`%s ${n}`,e,...o),r&&r(n,...o)}}a(jRn,"prefixedLogger");function Zis(t,e,{namespace:r}){if(typeof t=="string")return t;let n=e&&e.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}a(Zis,"childLoggerName");function CWt(t,e,r,n=Jis()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=Zis(k_(e,yp),c,n);return d(r);function u(f,h){return Ow(s,CWt(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&&jRn(c,h)||iZ,g=jRn(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(CWt,"createLogger");var aPn=tn({"src/lib/git-logger.ts"(){"use strict";co(),Iet.default.formatters.L=t=>String(Det(t)?t.length:"-"),Iet.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):eke(t)}}),cPn,Xis=tn({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Ej(),aPn(),cPn=class nWt{static{a(this,"_TasksPendingQueue")}constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let r=nWt.getName(e.commands[0]),n=CWt(this.logLabel,r);return{task:e,logger:n,name:r}}push(e){let r=this.createProgress(e);return r.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,r),r}fatal(e){for(let[r,{logger:n}]of Array.from(this._queue.entries()))r===e.task?(n.info("Failed %o",e),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(r);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let r=this.withProgress(e);if(!r)throw new UF(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++nWt.counter}`}static{this.counter=0}}}});function rZ(t,e){return{method:bkn(t.commands)||"",commands:e}}a(rZ,"pluginContext");function eos(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(eos,"onErrorReceived");function HRn(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(HRn,"onDataReceived");var iWt,tos=tn({"src/lib/runners/git-executor-chain.ts"(){"use strict";Ej(),ph(),co(),Xis(),iWt=class{static{a(this,"GitExecutorChain")}constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new cPn}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),r=a(()=>this._queue.complete(t),"onQueueComplete");try{let{logger:n}=this._queue.attempt(t);return await($kn(t)?this.attemptEmptyTask(t,n):this.attemptRemoteTask(t,n))}catch(n){throw this.onFatalException(t,n)}finally{r(),e()}}onFatalException(t,e){let r=e instanceof UF?Object.assign(e,{task:t}):new UF(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(t,e){let r=this._plugins.exec("spawn.binary","",rZ(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...rZ(t,t.commands),env:{...this.env}}),o=await this.gitResponse(t,r,n,this.outputHandler,e.step("SPAWN")),s=await this.handleTaskData(t,n,o,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),Gkn(t)?XVt(t.parser,s):XVt(t.parser,s.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,r,n){let{exitCode:o,rejection:s,stdOut:c,stdErr:l}=r;return new Promise((u,d)=>{n("Preparing to handle process response exitCode=%d stdOut=",o);let{error:f}=this._plugins.exec("task.error",{error:s},{...rZ(t,e),...r});if(f&&t.onError)return n.info("exitCode=%s handling with custom error handler"),t.onError(r,f,h=>{n.info("custom error handler treated as success"),n("custom error returned a %s",eke(h)),u(new Tet(Array.isArray(h)?Buffer.concat(h):h,Buffer.concat(l)))},d);if(f)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",o,l.length,s),d(f);n.info("retrieving task output complete"),u(new Tet(Buffer.concat(c),Buffer.concat(l)))})}async gitResponse(t,e,r,n,o){let s=o.sibling("output"),c=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},rZ(t,t.commands));return new Promise(l=>{let u=[],d=[];o.info("%s %o",e,r),o("%O",c);let f=this._beforeSpawn(t,r);if(f)return l({stdOut:u,stdErr:d,exitCode:9901,rejection:f});this._plugins.exec("spawn.before",void 0,{...rZ(t,r),kill(m){f=m||f}});let h=(0,lPn.spawn)(e,r,c);h.stdout.on("data",HRn(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",HRn(d,"stdErr",o,s.step("stdErr"))),h.on("error",eos(d,o)),n&&(o("Passing child process stdOut/stdErr to custom outputHandler"),n(e,h.stdout,h.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...rZ(t,r),spawned:h,close(m,g){l({stdOut:u,stdErr:d,exitCode:m,rejection:f||g})},kill(m){h.killed||(f=m,h.kill("SIGINT"))}})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,{...rZ(t,e),kill(n){r=n||r}}),r}}}}),uPn={};_m(uPn,{GitExecutor:a(()=>dPn,"GitExecutor")});var dPn,ros=tn({"src/lib/runners/git-executor.ts"(){"use strict";tos(),dPn=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new iWt(this,this._scheduler,this._plugins)}chain(){return new iWt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function nos(t,e,r=iZ){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof ZRe?ios(s):s,void 0)},"onError2");e.then(n,o)}a(nos,"taskCallback");function ios(t){let e=a(n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),e=iZ},"log");return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(n,o){return o in t||(n[o]={enumerable:!1,configurable:!1,get(){return e(o),t.git[o]}}),n}}a(ios,"addDeprecationNoticeToError");var oos=tn({"src/lib/task-callback.ts"(){"use strict";Fde(),co()}});function GRn(t,e){return jkn(r=>{if(!pWt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a(GRn,"changeWorkingDirectoryTask");var sos=tn({"src/lib/tasks/change-working-directory.ts"(){"use strict";co(),ph()}});function $Vt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=Ret(e,"-B")),mv(e)}a($Vt,"checkoutTask");function aos(){return{checkout(){return this._runTask($Vt(hv(arguments,1)),Zd(arguments))},checkoutBranch(t,e){return this._runTask($Vt(["-b",t,e,...hv(arguments)]),Zd(arguments))},checkoutLocalBranch(t){return this._runTask($Vt(["-b",t,...hv(arguments)]),Zd(arguments))}}}a(aos,"checkout_default");var cos=tn({"src/lib/tasks/checkout.ts"(){"use strict";co(),ph()}});function los(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(los,"countObjectsResponse");function uos(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return Eb(los(),[fPn],t)}})}}}a(uos,"count_objects_default");var fPn,dos=tn({"src/lib/tasks/count-objects.ts"(){"use strict";co(),fPn=new Do(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=Ikn(e);Object.hasOwn(t,n)&&(t[n]=Pu(r))})}});function fos(t){return Eb({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},pPn,t)}a(fos,"parseCommitResult");var pPn,pos=tn({"src/lib/parsers/parse-commit.ts"(){"use strict";co(),pPn=[new Do(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new Do(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),n=r.pop();!n||!n.includes("@")||(t.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new Do(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(n,10)||0}),new Do(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0;let o=parseInt(r,10)||0;n==="-"?t.summary.deletions=o:n==="+"&&(t.summary.insertions=o)})]}});function hos(t,e,r){return{commands:["-c","core.abbrev=40","commit",...KRe(t,"-m"),...e,...r],format:"utf-8",parser:fos}}a(hos,"commitTask");function mos(){return{commit(e,...r){let n=Zd(arguments),o=t(e)||hos(S5(e),S5(k_(r[0],bet,[])),[...Ude(k_(r[1],tke,[])),...hv(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!bet(e)&&_b("git.commit: requires the commit message to be supplied as a string/string[]")}}a(mos,"commit_default");var gos=tn({"src/lib/tasks/commit.ts"(){"use strict";pos(),co(),ph()}});function Aos(){return{firstCommit(){return this._runTask(mv(["rev-list","--max-parents=0","HEAD"],!0),Zd(arguments))}}}a(Aos,"first_commit_default");var yos=tn({"src/lib/tasks/first-commit.ts"(){"use strict";co(),ph()}});function _os(t,e){let r=["hash-object",t];return e&&r.push("-w"),mv(r,!0)}a(_os,"hashObjectTask");var Eos=tn({"src/lib/tasks/hash-object.ts"(){"use strict";ph()}});function vos(t,e,r){let n=String(r).trim(),o;if(o=hPn.exec(n))return new vet(t,e,!1,o[1]);if(o=mPn.exec(n))return new vet(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new vet(t,e,/^re/i.test(n),s)}a(vos,"parseInit");var vet,hPn,mPn,Cos=tn({"src/lib/responses/InitSummary.ts"(){"use strict";vet=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},hPn=/^Init.+ repository in (.+)$/,mPn=/^Rein.+ in (.+)$/}});function bos(t){return t.includes(bWt)}a(bos,"hasBareCommand");function Sos(t=!1,e,r){let n=["init",...r];return t&&!bos(n)&&n.splice(1,0,bWt),{commands:n,format:"utf-8",parser(o){return vos(n.includes("--bare"),e,o)}}}a(Sos,"initTask");var bWt,Tos=tn({"src/lib/tasks/init.ts"(){"use strict";Cos(),bWt="--bare"}});function SWt(t){for(let e=0;eEb(new gPn,e,r,!1)}a(APn,"getDiffParser");var VVt,$Rn,VRn,WRn,yPn,_Pn=tn({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";rke(),xos(),Xkn(),co(),VVt=[new Do(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:Pu(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new Do(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:Pu(r),after:Pu(n),binary:!0})}),new Do(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);t.changed=Pu(e),t.insertions=Pu(n?.[1]),t.deletions=Pu(o?.[1])})],$Rn=[new Do(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=Pu(e),s=Pu(r);t.changed++,t.insertions+=o,t.deletions+=s,t.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new Do(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],VRn=[new Do(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],WRn=[new Do(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,n,o,s])=>{t.changed++,t.files.push({file:s??n,changes:0,insertions:0,deletions:0,binary:!1,status:KVt($is(e)&&e),from:KVt(!!s&&n!==s&&n),similarity:Pu(r)})})],yPn={"":VVt,"--stat":VVt,"--numstat":$Rn,"--name-status":WRn,"--name-only":VRn}}});function wos(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(wos,"lineBuilder");function EPn(t=wWt,e=vPn,r=""){let n=APn(r);return function(o){let s=XRe(o.trim(),!1,IWt).map(function(c){let l=c.split(xWt),u=wos(l[0].split(t),e);return l.length>1&&l[1].trim()&&(u.diff=n(l[1])),u});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}a(EPn,"createListLogSummaryParser");var IWt,xWt,wWt,vPn,CPn=tn({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";co(),_Pn(),rke(),IWt="\xF2\xF2\xF2\xF2\xF2\xF2 ",xWt=" \xF2\xF2",wWt=" \xF2 ",vPn=["hash","date","message","refs","author_name","author_email"]}}),bPn={};_m(bPn,{diffSummaryTask:a(()=>Ros,"diffSummaryTask"),validateLogFormatConfig:a(()=>Oet,"validateLogFormatConfig")});function Ros(t){let e=SWt(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),Oet(r)||{commands:r,format:"utf-8",parser:APn(e)}}a(Ros,"diffSummaryTask");function Oet(t){let e=t.filter(Ios);if(e.length>1)return _b(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return _b(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}a(Oet,"validateLogFormatConfig");var RWt=tn({"src/lib/tasks/diff.ts"(){"use strict";rke(),_Pn(),ph()}});function kos(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(kos,"prettyFormat");function Pos(t){return Object.keys(t).reduce((e,r)=>(r in oWt||(e[r]=t[r]),e),{})}a(Pos,"userOptions");function SPn(t={},e=[]){let r=k_(t.splitter,yp,wWt),n=Pet(t.format)?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[o,s]=kos(n,r),c=[],l=[`--pretty=format:${IWt}${s}${xWt}`,...e],u=t.n||t["max-count"]||t.maxCount;if(u&&l.push(`--max-count=${u}`),t.from||t.to){let d=t.symmetric!==!1?"...":"..";c.push(`${t.from||""}${d}${t.to||""}`)}return yp(t.file)&&l.push("--follow",Rde(t.file)),mWt(Pos(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(SPn,"parseLogOptions");function Dos(t,e,r){let n=EPn(t,e,SWt(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(Dos,"logTask");function Nos(){return{log(...r){let n=Zd(arguments),o=SPn(gWt(arguments),Ude(k_(arguments[0],tke,[]))),s=e(...r)||Oet(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return Dos(r.splitter,r.fields,r.commands)}function e(r,n){return yp(r)&&yp(n)&&_b("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(Nos,"log_default");var oWt,TPn=tn({"src/lib/tasks/log.ts"(){"use strict";rke(),CPn(),co(),ph(),RWt(),oWt=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(oWt||{})}}),Cet,IPn,Mos=tn({"src/lib/responses/MergeSummary.ts"(){"use strict";Cet=class{static{a(this,"MergeSummaryConflict")}constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},IPn=class{static{a(this,"MergeSummaryDetail")}constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),sWt,xPn,Oos=tn({"src/lib/responses/PullSummary.ts"(){"use strict";sWt=class{static{a(this,"PullSummary")}constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},xPn=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function WVt(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}a(WVt,"objectEnumerationResult");function zRn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:Pu(e&&e[1]||"0"),delta:Pu(r&&r[1]||"0")}}a(zRn,"asObjectCount");var wPn,Los=tn({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";co(),wPn=[new _j(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=WVt(t.remoteMessages);Object.assign(o,{[n]:Pu(r)})}),new _j(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=WVt(t.remoteMessages);Object.assign(o,{[n]:Pu(r)})}),new _j(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=WVt(t.remoteMessages);o.total=zRn(e),o.reused=zRn(r),o.packReused=Pu(n)})]}});function RPn(t,e){return Eb({remoteMessages:new PPn},kPn,e)}a(RPn,"parseRemoteMessages");var kPn,PPn,DPn=tn({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";co(),Los(),kPn=[new _j(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...wPn,new _j([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new _j([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:Pu(e),summary:r,url:n}})],PPn=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function Bos(t,e){let r=Eb(new xPn,NPn,[t,e]);return r.message&&r}a(Bos,"parsePullErrorResult");var YRn,KRn,JRn,ZRn,NPn,XRn,kWt,MPn=tn({"src/lib/parsers/parse-pull.ts"(){"use strict";Oos(),co(),DPn(),YRn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,KRn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,JRn=/^(create|delete) mode \d+ (.+)/,ZRn=[new Do(YRn,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new Do(KRn,(t,[e,,r,,n])=>r!==void 0||n!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+n||0,!0):!1),new Do(JRn,(t,[e,r])=>{Ow(t.files,r),Ow(e==="create"?t.created:t.deleted,r)})],NPn=[new Do(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new Do(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new Do(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,n,o])=>{t.branch.local=n,t.hash.local=e,t.branch.remote=o,t.hash.remote=r})],XRn=a((t,e)=>Eb(new sWt,ZRn,[t,e]),"parsePullDetail"),kWt=a((t,e)=>Object.assign(new sWt,XRn(t,e),RPn(t,e)),"parsePullResult")}}),ekn,OPn,tkn,Fos=tn({"src/lib/parsers/parse-merge.ts"(){"use strict";Mos(),co(),MPn(),ekn=[new Do(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new Do(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new Cet(e,r))}),new Do(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new Cet(e,r,{deleteRef:n}))}),new Do(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new Cet(e,null))}),new Do(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],OPn=a((t,e)=>Object.assign(tkn(t,e),kWt(t,e)),"parseMergeResult"),tkn=a(t=>Eb(new IPn,ekn,t),"parseMergeDetail")}});function rkn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=OPn(e,r);if(n.failed)throw new ZRe(n);return n}}:_b("Git.merge requires at least one option")}a(rkn,"mergeTask");var Uos=tn({"src/lib/tasks/merge.ts"(){"use strict";Fde(),Fos(),ph()}});function Qos(t,e,r){let n=r.includes("deleted"),o=r.includes("tag")||/^refs\/tags/.test(t),s=!r.includes("new");return{deleted:n,tag:o,branch:!o,new:!s,alreadyUpdated:s,local:t,remote:e}}a(Qos,"pushResultPushedItem");var nkn,LPn,ikn,qos=tn({"src/lib/parsers/parse-push.ts"(){"use strict";co(),DPn(),nkn=[new Do(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new Do(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new Do(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(Qos(e,r,n))}),new Do(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:n}}),new Do(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,n,o])=>{t.update={head:{local:e,remote:r},hash:{from:n,to:o}}})],LPn=a((t,e)=>{let r=ikn(t,e),n=RPn(t,e);return{...r,...n}},"parsePushResult"),ikn=a((t,e)=>Eb({pushed:[]},nkn,[t,e]),"parsePushDetail")}}),BPn={};_m(BPn,{pushTagsTask:a(()=>jos,"pushTagsTask"),pushTask:a(()=>PWt,"pushTask")});function jos(t={},e){return Ow(e,"--tags"),PWt(t,e)}a(jos,"pushTagsTask");function PWt(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),Ret(r,"-v"),Ow(r,"--verbose"),Ow(r,"--porcelain"),{commands:r,format:"utf-8",parser:LPn}}a(PWt,"pushTask");var FPn=tn({"src/lib/tasks/push.ts"(){"use strict";qos(),co()}});function Hos(){return{showBuffer(){let t=["show",...hv(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(Hkn(t),Zd(arguments))},show(){let t=["show",...hv(arguments,1)];return this._runTask(mv(t),Zd(arguments))}}}a(Hos,"show_default");var Gos=tn({"src/lib/tasks/show.ts"(){"use strict";co(),ph()}}),okn,UPn,$os=tn({"src/lib/responses/FileStatusSummary.ts"(){"use strict";okn=/^(.+)\0(.+)$/,UPn=class{static{a(this,"FileStatusSummary")}constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let n=okn.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function skn(t){let[e,r]=t.split(Lde);return{from:r||e,to:e}}a(skn,"renamedFile");function TT(t,e,r){return[`${t}${e}`,r]}a(TT,"parser3");function zVt(t,...e){return e.map(r=>TT(t,r,(n,o)=>n.conflicted.push(o)))}a(zVt,"conflicts");function Vos(t,e){let r=e.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return n(" ",r.charAt(0),r.slice(2));default:return}function n(o,s,c){let l=`${o}${s}`,u=QPn.get(l);u&&u(t,c),l!=="##"&&l!=="!!"&&t.files.push(new UPn(c,o,s))}a(n,"data")}a(Vos,"splitLine");var akn,QPn,qPn,Wos=tn({"src/lib/responses/StatusSummary.ts"(){"use strict";co(),$os(),akn=class{static{a(this,"StatusSummary")}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}},QPn=new Map([TT(" ","A",(t,e)=>t.created.push(e)),TT(" ","D",(t,e)=>t.deleted.push(e)),TT(" ","M",(t,e)=>t.modified.push(e)),TT("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),TT("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),TT("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),TT("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),TT("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),TT("R"," ",(t,e)=>{t.renamed.push(skn(e))}),TT("R","M",(t,e)=>{let r=skn(e);t.renamed.push(r),t.modified.push(r.to)}),TT("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),TT("?","?",(t,e)=>t.not_added.push(e)),...zVt("A","A","U"),...zVt("D","D","U"),...zVt("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,o=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,c=/\son\s(\S+?)(?=\.{3}|$)/,l=r.exec(e);t.ahead=l&&+l[1]||0,l=n.exec(e),t.behind=l&&+l[1]||0,l=o.exec(e),t.current=k_(l?.[1],yp,null),l=s.exec(e),t.tracking=k_(l?.[1],yp,null),l=c.exec(e),l&&(t.current=k_(l?.[1],yp,t.current)),t.detached=/\(no branch\)/.test(e)}]]),qPn=a(function(t){let e=t.split(Lde),r=new akn;for(let n=0,o=e.length;n!jPn.includes(r))],parser(r){return qPn(r)}}}a(zos,"statusTask");var jPn,Yos=tn({"src/lib/tasks/status.ts"(){"use strict";Wos(),jPn=["--null","-z"]}});function xet(t=0,e=0,r=0,n="",o=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:n,installed:o},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}a(xet,"versionResponse");function Kos(){return xet(0,0,0,"",!1)}a(Kos,"notInstalledResponse");function Jos(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:Zos,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(DWt));n(e)}})}}}a(Jos,"version_default");function Zos(t){return t===DWt?Kos():Eb(xet(0,0,0,t),HPn,t)}a(Zos,"versionParser");var DWt,HPn,Xos=tn({"src/lib/tasks/version.ts"(){"use strict";co(),DWt="installed=false",HPn=[new Do(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,xet(Pu(e),Pu(r),Pu(n),o))}),new Do(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,xet(Pu(e),Pu(r),n,o))})]}});function ckn(t,e,r,...n){return yp(r)?e(r,k_(n[0],yp),hv(arguments)):_b(`git.${t}() requires a string 'repoPath'`)}a(ckn,"createCloneTask");function ess(){return{clone(t,...e){return this._runTask(ckn("clone",aWt,k_(t,yp),...e),Zd(arguments))},mirror(t,...e){return this._runTask(ckn("mirror",GPn,k_(t,yp),...e),Zd(arguments))}}}a(ess,"clone_default");var aWt,GPn,tss=tn({"src/lib/tasks/clone.ts"(){"use strict";ph(),co(),aWt=a((t,e,r)=>{let n=["clone",...r];return yp(t)&&n.push(Rde(t)),yp(e)&&n.push(Rde(e)),mv(n)},"cloneTask"),GPn=a((t,e,r)=>(Ow(r,"--mirror"),aWt(t,e,r)),"cloneMirrorTask")}}),$Pn={};_m($Pn,{SimpleGitApi:a(()=>cWt,"SimpleGitApi")});var cWt,rss=tn({"src/lib/simple-git-api.ts"(){"use strict";oos(),sos(),cos(),dos(),gos(),Jkn(),yos(),rPn(),Eos(),Tos(),TPn(),Uos(),FPn(),Gos(),Yos(),ph(),Xos(),co(),tss(),cWt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&nos(t,n,e),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(t){return this._runTask(mv(["add",...S5(t)]),Zd(arguments))}cwd(t){let e=Zd(arguments);return typeof t=="string"?this._runTask(GRn(t,this._executor),e):typeof t?.path=="string"?this._runTask(GRn(t.path,t.root&&this._executor||void 0),e):this._runTask(_b("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(_os(t,e===!0),Zd(arguments))}init(t){return this._runTask(Sos(t===!0,this._executor.cwd,hv(arguments)),Zd(arguments))}merge(){return this._runTask(rkn(hv(arguments)),Zd(arguments))}mergeFromTo(t,e){return yp(t)&&yp(e)?this._runTask(rkn([t,e,...hv(arguments)]),Zd(arguments,!1)):this._runTask(_b("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=PWt({remote:k_(arguments[0],yp),branch:k_(arguments[1],yp)},hv(arguments));return this._runTask(t,Zd(arguments))}stash(){return this._runTask(mv(["stash",...hv(arguments)]),Zd(arguments))}status(){return this._runTask(zos(hv(arguments)),Zd(arguments))}},Object.assign(cWt.prototype,aos(),ess(),mos(),Gis(),uos(),Aos(),zis(),Nos(),Hos(),Jos())}}),VPn={};_m(VPn,{Scheduler:a(()=>zPn,"Scheduler")});var lkn,zPn,nss=tn({"src/lib/runners/scheduler.ts"(){"use strict";co(),aPn(),lkn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,WPn.createDeferred)();return{promise:e,done:r,id:t}}})(),zPn=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=CWt("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}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 t=Ow(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),Ret(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=Ow(this.pending,lkn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),YPn={};_m(YPn,{applyPatchTask:a(()=>iss,"applyPatchTask")});function iss(t,e){return mv(["apply",...e,...t])}a(iss,"applyPatchTask");var oss=tn({"src/lib/tasks/apply-patch.ts"(){"use strict";ph()}});function sss(t,e){return{branch:t,hash:e,success:!0}}a(sss,"branchDeletionSuccess");function ass(t){return{branch:t,hash:null,success:!1}}a(ass,"branchDeletionFailure");var KPn,css=tn({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";KPn=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function JPn(t,e){return e===1&&lWt.test(t)}a(JPn,"hasBranchDeletionError");var ukn,lWt,dkn,Let,lss=tn({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";css(),co(),ukn=/(\S+)\s+\(\S+\s([^)]+)\)/,lWt=/^error[^']+'([^']+)'/m,dkn=[new Do(ukn,(t,[e,r])=>{let n=sss(e,r);t.all.push(n),t.branches[e]=n}),new Do(lWt,(t,[e])=>{let r=ass(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],Let=a((t,e)=>Eb(new KPn,dkn,[t,e]),"parseBranchDeletions")}}),ZPn,uss=tn({"src/lib/responses/BranchSummary.ts"(){"use strict";ZPn=class{static{a(this,"BranchSummaryResult")}constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,n,o){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:n,label:o}}}}});function fkn(t){return t?t.charAt(0):""}a(fkn,"branchStatus");function XPn(t,e=!1){return Eb(new ZPn,e?[t2n]:e2n,t)}a(XPn,"parseBranchSummary");var e2n,t2n,dss=tn({"src/lib/parsers/parse-branch.ts"(){"use strict";uss(),co(),e2n=[new Do(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(fkn(e),!0,r,n,o)}),new Do(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(fkn(e),!1,r,n,o)})],t2n=new Do(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),r2n={};_m(r2n,{branchLocalTask:a(()=>pss,"branchLocalTask"),branchTask:a(()=>fss,"branchTask"),containsDeleteBranchCommand:a(()=>n2n,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>mss,"deleteBranchTask"),deleteBranchesTask:a(()=>hss,"deleteBranchesTask")});function n2n(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(n2n,"containsDeleteBranchCommand");function fss(t){let e=n2n(t),r=t.includes("--show-current"),n=["branch",...t];return n.length===1&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser(o,s){return e?Let(o,s).all[0]:XPn(o,r)}}}a(fss,"branchTask");function pss(){return{format:"utf-8",commands:["branch","-v"],parser(t){return XPn(t)}}}a(pss,"branchLocalTask");function hss(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return Let(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!JPn(String(o),r))return c(o);s(n)}}}a(hss,"deleteBranchesTask");function mss(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return Let(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!JPn(String(c),n))return u(c);throw new ZRe(r.parser(JRe(s),JRe(o)),String(c))}};return r}a(mss,"deleteBranchTask");var gss=tn({"src/lib/tasks/branch.ts"(){"use strict";Fde(),lss(),dss(),co()}});function Ass(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,i2n.normalize)(e)}a(Ass,"toPath");var o2n,yss=tn({"src/lib/responses/CheckIgnore.ts"(){"use strict";o2n=a(t=>t.split(/\n/g).map(Ass).filter(Boolean),"parseCheckIgnore")}}),s2n={};_m(s2n,{checkIgnoreTask:a(()=>_ss,"checkIgnoreTask")});function _ss(t){return{commands:["check-ignore",...t],format:"utf-8",parser:o2n}}a(_ss,"checkIgnoreTask");var Ess=tn({"src/lib/tasks/check-ignore.ts"(){"use strict";yss()}});function vss(t,e){return Eb({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},a2n,[t,e])}a(vss,"parseFetchResult");var a2n,Css=tn({"src/lib/parsers/parse-fetch.ts"(){"use strict";co(),a2n=[new Do(/From (.+)$/,(t,[e])=>{t.remote=e}),new Do(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new Do(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new Do(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new Do(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,o])=>{t.updated.push({name:n,tracking:o,to:r,from:e})})]}}),c2n={};_m(c2n,{fetchTask:a(()=>Sss,"fetchTask")});function bss(t){return/^--upload-pack(=|$)/.test(t)}a(bss,"disallowedCommand");function Sss(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(bss)?_b("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:vss}}a(Sss,"fetchTask");var Tss=tn({"src/lib/tasks/fetch.ts"(){"use strict";Css(),ph()}});function Iss(t){return Eb({moves:[]},l2n,t)}a(Iss,"parseMoveResult");var l2n,xss=tn({"src/lib/parsers/parse-move.ts"(){"use strict";co(),l2n=[new Do(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),u2n={};_m(u2n,{moveTask:a(()=>wss,"moveTask")});function wss(t,e){return{commands:["mv","-v",...S5(t),e],format:"utf-8",parser:Iss}}a(wss,"moveTask");var Rss=tn({"src/lib/tasks/move.ts"(){"use strict";xss(),co()}}),d2n={};_m(d2n,{pullTask:a(()=>kss,"pullTask")});function kss(t,e,r){let n=["pull",...r];return t&&e&&n.splice(1,0,t,e),{commands:n,format:"utf-8",parser(o,s){return kWt(o,s)},onError(o,s,c,l){let u=Bos(JRe(o.stdOut),JRe(o.stdErr));if(u)return l(new ZRe(u));l(s)}}}a(kss,"pullTask");var Pss=tn({"src/lib/tasks/pull.ts"(){"use strict";Fde(),MPn(),co()}});function Dss(t){let e={};return f2n(t,([r])=>e[r]={name:r}),Object.values(e)}a(Dss,"parseGetRemotes");function Nss(t){let e={};return f2n(t,([r,n,o])=>{Object.hasOwn(e,r)||(e[r]={name:r,refs:{fetch:"",push:""}}),o&&n&&(e[r].refs[o.replace(/[^a-z]/g,"")]=n)}),Object.values(e)}a(Nss,"parseGetRemotesVerbose");function f2n(t,e){fWt(t,r=>e(r.split(/\s+/)))}a(f2n,"forEach");var Mss=tn({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";co()}}),p2n={};_m(p2n,{addRemoteTask:a(()=>Oss,"addRemoteTask"),getRemotesTask:a(()=>Lss,"getRemotesTask"),listRemotesTask:a(()=>Bss,"listRemotesTask"),remoteTask:a(()=>Fss,"remoteTask"),removeRemoteTask:a(()=>Uss,"removeRemoteTask")});function Oss(t,e,r){return mv(["remote","add",...r,t,e])}a(Oss,"addRemoteTask");function Lss(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?Nss:Dss}}a(Lss,"getRemotesTask");function Bss(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),mv(e)}a(Bss,"listRemotesTask");function Fss(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),mv(e)}a(Fss,"remoteTask");function Uss(t){return mv(["remote","remove",t])}a(Uss,"removeRemoteTask");var Qss=tn({"src/lib/tasks/remote.ts"(){"use strict";Mss(),ph()}}),h2n={};_m(h2n,{stashListTask:a(()=>qss,"stashListTask")});function qss(t={},e){let r=SPn(t),n=["stash","list",...r.commands,...e],o=EPn(r.splitter,r.fields,SWt(n));return Oet(n)||{commands:n,format:"utf-8",parser:o}}a(qss,"stashListTask");var jss=tn({"src/lib/tasks/stash-list.ts"(){"use strict";rke(),CPn(),RWt(),TPn()}}),m2n={};_m(m2n,{addSubModuleTask:a(()=>Hss,"addSubModuleTask"),initSubModuleTask:a(()=>Gss,"initSubModuleTask"),subModuleTask:a(()=>Bet,"subModuleTask"),updateSubModuleTask:a(()=>$ss,"updateSubModuleTask")});function Hss(t,e){return Bet(["add",t,e])}a(Hss,"addSubModuleTask");function Gss(t){return Bet(["init",...t])}a(Gss,"initSubModuleTask");function Bet(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),mv(e)}a(Bet,"subModuleTask");function $ss(t){return Bet(["update",...t])}a($ss,"updateSubModuleTask");var Vss=tn({"src/lib/tasks/sub-module.ts"(){"use strict";ph()}});function Wss(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?g2n(t,e):0}a(Wss,"singleSorted");function g2n(t,e){return t===e?0:t>e?1:-1}a(g2n,"sorted");function zss(t){return t.trim()}a(zss,"trimmed");function yet(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(yet,"toNumber");var pkn,A2n,Yss=tn({"src/lib/responses/TagList.ts"(){"use strict";pkn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},A2n=a(function(t,e=!1){let r=t.split(` -`).map(zss).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return Wss(yet(c[0]),yet(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new pkn(r,n)},"parseTagList")}}),y2n={};_m(y2n,{addAnnotatedTagTask:a(()=>Zss,"addAnnotatedTagTask"),addTagTask:a(()=>Jss,"addTagTask"),tagListTask:a(()=>Kss,"tagListTask")});function Kss(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return A2n(r,e)}}}a(Kss,"tagListTask");function Jss(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a(Jss,"addTagTask");function Zss(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(Zss,"addAnnotatedTagTask");var Xss=tn({"src/lib/tasks/tag.ts"(){"use strict";Yss()}}),eas=Ais({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(ros(),fh(uPn)),{SimpleGitApi:n}=(rss(),fh($Pn)),{Scheduler:o}=(nss(),fh(VPn)),{adhocExecTask:s,configurationErrorTask:c}=(ph(),fh(tWt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(co(),fh(Nkn)),{applyPatchTask:_}=(oss(),fh(YPn)),{branchTask:E,branchLocalTask:v,deleteBranchesTask:S,deleteBranchTask:T}=(gss(),fh(r2n)),{checkIgnoreTask:w}=(Ess(),fh(s2n)),{checkIsRepoTask:R}=(Bkn(),fh(Mkn)),{cleanWithOptionsTask:x,isCleanOptionsArray:k}=(zkn(),fh(Vkn)),{diffSummaryTask:D}=(RWt(),fh(bPn)),{fetchTask:N}=(Tss(),fh(c2n)),{moveTask:O}=(Rss(),fh(u2n)),{pullTask:B}=(Pss(),fh(d2n)),{pushTagsTask:q}=(FPn(),fh(BPn)),{addRemoteTask:M,getRemotesTask:L,listRemotesTask:U,remoteTask:j,removeRemoteTask:Q}=(Qss(),fh(p2n)),{getResetMode:Y,resetTask:W}=(sPn(),fh(nPn)),{stashListTask:V}=(jss(),fh(h2n)),{addSubModuleTask:z,initSubModuleTask:ie,subModuleTask:H,updateSubModuleTask:re}=(Vss(),fh(m2n)),{addAnnotatedTagTask:le,addTagTask:Le,tagListTask:me}=(Xss(),fh(y2n)),{straightThroughBufferTask:Oe,straightThroughStringTask:Te}=(ph(),fh(tWt));function te(ee,K){this._plugins=K,this._executor=new r(ee.baseDir,new o(ee.maxConcurrentProcesses),K),this._trimmed=ee.trimmed}a(te,"Git2"),(te.prototype=Object.create(n.prototype)).constructor=te,te.prototype.customBinary=function(ee){return this._plugins.reconfigure("binary",ee),this},te.prototype.env=function(ee,K){return arguments.length===1&&typeof ee=="object"?this._executor.env=ee:(this._executor.env=this._executor.env||{})[ee]=K,this},te.prototype.stashList=function(ee){return this._runTask(V(y(arguments)||{},u(ee)&&ee||[]),A(arguments))},te.prototype.mv=function(ee,K){return this._runTask(O(ee,K),A(arguments))},te.prototype.checkoutLatestTag=function(ee){var K=this;return this.pull(function(){K.tags(function(he,X){K.checkout(X.latest,ee)})})},te.prototype.pull=function(ee,K,he,X){return this._runTask(B(m(ee,f),m(K,f),g(arguments)),A(arguments))},te.prototype.fetch=function(ee,K){return this._runTask(N(m(ee,f),m(K,f),g(arguments)),A(arguments))},te.prototype.silent=function(ee){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},te.prototype.tags=function(ee,K){return this._runTask(me(g(arguments)),A(arguments))},te.prototype.rebase=function(){return this._runTask(Te(["rebase",...g(arguments)]),A(arguments))},te.prototype.reset=function(ee){return this._runTask(W(Y(ee),g(arguments)),A(arguments))},te.prototype.revert=function(ee){let K=A(arguments);return typeof ee!="string"?this._runTask(c("Commit must be a string"),K):this._runTask(Te(["revert",...g(arguments,0,!0),ee]),K)},te.prototype.addTag=function(ee){let K=typeof ee=="string"?Le(ee):c("Git.addTag requires a tag name");return this._runTask(K,A(arguments))},te.prototype.addAnnotatedTag=function(ee,K){return this._runTask(le(ee,K),A(arguments))},te.prototype.deleteLocalBranch=function(ee,K,he){return this._runTask(T(ee,typeof K=="boolean"?K:!1),A(arguments))},te.prototype.deleteLocalBranches=function(ee,K,he){return this._runTask(S(ee,typeof K=="boolean"?K:!1),A(arguments))},te.prototype.branch=function(ee,K){return this._runTask(E(g(arguments)),A(arguments))},te.prototype.branchLocal=function(ee){return this._runTask(v(),A(arguments))},te.prototype.raw=function(ee){let K=!Array.isArray(ee),he=[].slice.call(K?arguments:ee,0);for(let de=0;deconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},te.prototype.checkIgnore=function(ee,K){return this._runTask(w(l(m(ee,h,[]))),A(arguments))},te.prototype.checkIsRepo=function(ee,K){return this._runTask(R(m(ee,f)),A(arguments))},e.exports=te}});Ej();var tas=class extends UF{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};Ej();Ej();var Bde=class extends UF{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};Fde();_kn();Bkn();zkn();Jkn();Xkn();rPn();sPn();function ras(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new Bde(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new Bde(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(ras,"abortPlugin");function nas(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of QRn(e,r))if(t[n.category]!==!0)throw new Bde(void 0,"unsafe",n.message);return e}}}a(nas,"blockUnsafeOperationsPlugin");co();function ias(t){let e=KRe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(ias,"commandConfigPrefixingPlugin");co();var hkn=(0,Ode.deferred)().promise;function oas({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,Ode.deferred)(),closeTimeout:(0,Ode.deferred)(),exit:(0,Ode.deferred)(),exitTimeout:(0,Ode.deferred)()},c=Promise.race([t===!1?hkn:s.closeTimeout.promise,e===!1?hkn:s.exitTimeout.promise]);return n(t,s.close,s.closeTimeout),n(e,s.exit,s.exitTimeout),{close(l){o=l,s.close.done()},exit(l){o=l,s.exit.done()},get exitCode(){return o},result:c}}a(r,"createEvents");function n(o,s,c){o!==!1&&(o===!0?s.promise:s.promise.then(()=>YVt(o))).then(c.done)}return a(n,"configureTimeout"),{type:"spawn.after",async action(o,{spawned:s,close:c}){let l=r(),u=!0,d=a(()=>{u=!1},"quickClose");s.stdout?.on("data",d),s.stderr?.on("data",d),s.on("error",d),s.on("close",f=>l.close(f)),s.on("exit",f=>l.exit(f));try{await l.result,u&&await YVt(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(oas,"completionDetectionPlugin");co();var sas="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",mkn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function aas(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}a(aas,"isBadArgument");function gkn(t,e){if(t.length<1||t.length>2)throw new Bde(void 0,"binary",sas);if(t.some(aas))if(e)console.warn(mkn);else throw new Bde(void 0,"binary",mkn);let[n,o]=t;return{binary:n,prefix:o}}a(gkn,"toBinaryConfig");function cas(t,e=["git"],r=!1){let n=gkn(S5(e),r);t.on("binary",o=>{n=gkn(S5(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(cas,"customBinaryPlugin");Ej();function las(t){return!!(t.exitCode&&t.stdErr.length)}a(las,"isTaskError");function uas(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(uas,"getErrorMessage");function das(t=!1,e=las,r=uas){return(n,o)=>!t&&n||!e(o)?n:r(o)}a(das,"errorDetectionHandler");function Akn(t){return{type:"task.error",action(e,r){let n=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new UF(void 0,n.toString("utf-8"))}:{error:n}}}}a(Akn,"errorDetectionPlugin");co();var fas=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new _2n.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=Ow(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return S5(t).forEach(r=>r&&this.plugins.add(Ow(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let n=e,o=Object.freeze(Object.create(r));for(let s of this.plugins)s.type===t&&(n=s.action(n,o));return n}};co();function pas(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?Tkn(s,e):s}},{type:"spawn.after",action(s,c){c.commands.includes(e)&&c.spawned.stderr?.on("data",l=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));u&&t({method:c.method,stage:has(u[1]),progress:Pu(u[2]),processed:Pu(u[3]),total:Pu(u[4])})})}}]}a(pas,"progressMonitorPlugin");function has(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(has,"progressEventStage");co();function mas(t){let e=xkn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(mas,"spawnOptionsPlugin");function gas({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(n,o){let s;function c(){s&&clearTimeout(s),s=setTimeout(u,t)}a(c,"wait");function l(){o.spawned.stdout?.off("data",c),o.spawned.stderr?.off("data",c),o.spawned.off("exit",l),o.spawned.off("close",l),s&&clearTimeout(s)}a(l,"stop");function u(){l(),o.kill(new Bde(void 0,"timeout","block timeout reached"))}a(u,"kill"),r&&o.spawned.stdout?.on("data",c),e&&o.spawned.stderr?.on("data",c),o.spawned.on("exit",l),o.spawned.on("close",l),c()}}}a(gas,"timeoutPlugin");function Aas(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;oDw(c)&&kde(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a(Aas,"suffixPathsPlugin");co();var yas=eas();function _as(t,e){let r=new fas,n=Pkn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!pWt(n.baseDir))throw new tas(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(ias(n.config)),r.add(nas(n.unsafe)),r.add(oas(n.completion)),n.abort&&r.add(ras(n.abort)),n.progress&&r.add(pas(n.progress)),n.timeout&&r.add(gas(n.timeout)),n.spawnOptions&&r.add(mas(n.spawnOptions)),r.add(Aas()),r.add(Akn(das(!0))),n.errors&&r.add(Akn(n.errors)),cas(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new yas(n,r)}a(_as,"gitInstanceFactory");Fde();var Qde=_as;var Lw=new pe("Git Service");var Fet=class t{constructor(e){this.ctx=e;this.gitInstances=new Map;this._upstreamCache=new Map}static{a(this,"GitService")}static{this._upstreamCacheTtlMs=300*1e3}async getGitInstance(e){let r=this.normalizeRepoPath(e),n=this.gitInstances.get(r);if(!n){let o=(await jO()).path;n=Qde({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,v2n.join)(n,r);return Ko(o)}parseStatus(e){switch(e){case"M":return 2;case"A":return 0;case"D":return 3;case"R":return 1;default:return 2}}parseDiffOutput(e,r){let n=[],o=r.split("\0").filter(s=>s.length>0);for(let s=0;s=o.length){Lw.warn(this.ctx,`Malformed git diff output: rename status without both paths at position ${s}. Output: ${r}`);continue}let f=o[s+1],h=o[s+2];if(!f||!h){Lw.warn(this.ctx,`Malformed git diff output: empty path(s) for rename at position ${s}. Paths: [${f}, ${h}]. Output: ${r}`);continue}let m=this.constructFileUri(e,f),g=this.constructFileUri(e,h);n.push({uri:g,originalUri:m,renameUri:g,status:1}),s+=2}else{if(s+1>=o.length){Lw.warn(this.ctx,`Malformed git diff output: status without path at position ${s}. Status: ${u}. Output: ${r}`);continue}let f=o[s+1];if(!f){Lw.warn(this.ctx,`Malformed git diff output: empty file path at position ${s}. Status: ${u}. Output: ${r}`);continue}let h=this.constructFileUri(e,f);n.push({uri:h,originalUri:h,renameUri:void 0,status:d}),s+=1}}return n}async diffWith(e,r){try{let o=await(await this.getGitInstance(e)).raw(["diff","--name-status","-z","--diff-filter=ADMR",r,"--"]);return!o||o.trim().length===0?[]:this.parseDiffOutput(e,o)}catch(n){Lw.warn(this.ctx,`Failed to diff with ${r} for ${e}`,n);return}}async hasUpstream(e){let r=this.normalizeRepoPath(e),n=this._upstreamCache.get(r),o=Date.now();if(n&&o-n.checkedAt0}catch(o){return Lw.warn(this.ctx,`Failed to query upstream config for ${e}`,o),!1}}clearUpstreamCache(e){e?this._upstreamCache.delete(this.normalizeRepoPath(e)):this._upstreamCache.clear()}async diffWithIndexedCommit(e,r){try{if(r){let o=await this.diffWith(e,r);if(o)return{changes:o,mayBeOutdated:!1};Lw.warn(this.ctx,`Failed to diff with indexed commit ${r}, falling back to upstream`)}if(!await this.hasUpstream(e)){Lw.debug(this.ctx,`No upstream branch configured for ${e}, cannot determine changes`);return}let n=await this.diffWith(e,"@{upstream}");return n?{changes:n,mayBeOutdated:!0}:void 0}catch(n){Lw.warn(this.ctx,`Failed to diff with indexed commit for ${e}`,n);return}}normalizeRepoPath(e){if(e.startsWith("file://"))try{return(0,E2n.fileURLToPath)(e)}catch(r){Lw.warn(this.ctx,`Failed to convert URI to path: ${e}, attempting fallback`,r);try{let n=new URL(e),o=decodeURIComponent(n.pathname);return process.platform==="win32"&&/^\/[a-zA-Z]:/.test(o)&&(o=o.slice(1).replace(/\//g,"\\")),o}catch(n){return Lw.error(this.ctx,`Failed to parse URI with fallback: ${e}`,n),e}}return e}dispose(){this.gitInstances.clear(),this._upstreamCache.clear()}};var Qet=fe(pl());var vb=new pe("Local Diff Tracker"),C2n=15e3;var Uet=class t{constructor(e,r,n){this.ctx=e;this._workspaceFileIndex=r;this._githubCodeSearchService=n;this._repos=new Map;this._locallyChangedFiles=new Set;this._fileWatcherDisposables=[];this._isDisposed=!1;this._gitService=new Fet(e),this._repositoryManager=e.get(Pf),this._diffRefreshTimer=new Qet.IntervalTimer}static{a(this,"CodeSearchWorkspaceDiffTracker")}static{this._diffRefreshInterval=1e3*60*2}static{this._diffRefreshMaxInterval=1e3*60*30}static{this._maxDiffFiles=1e4}async initialize(){return this._initializePromise??=this.doInitialize(),this._initializePromise}async doInitialize(){try{vb.info(this.ctx,"Initializing Local Diff Tracker");let e=await this.awaitWorkspaceFileIndex();if(this._isDisposed)return;let r=a(o=>{for(let s of o)this._locallyChangedFiles.add(s)},"addFiles");this._fileWatcherDisposables.push(this._workspaceFileIndex.onDidCreateFiles(r),this._workspaceFileIndex.onDidChangeFiles(r),this._workspaceFileIndex.onDidDeleteFiles(o=>{for(let s of o)this._locallyChangedFiles.delete(s)})),!await this.tryOpenRepo()&&!e&&this.retryOpenRepoWhenIndexReady()}catch(e){vb.error(this.ctx,"Initialization failed",e)}}async awaitWorkspaceFileIndex(){let e=await(0,Qet.raceTimeout)(this._workspaceFileIndex.initialize().then(()=>!0),C2n);return e||vb.warn(this.ctx,"Workspace file index bootstrap exceeded budget; continuing with a partial index",{budgetMs:C2n}),e===!0}async tryOpenRepo(){let e=await this._repositoryManager.getRepo({uri:this._workspaceFileIndex.workspaceFolder.uri});return e||(e=await this.tryInferRepoFromFiles()),e&&e.isGitHub()&&e.owner&&e.name?(await this.openRepo(e),!0):(vb.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`),!1)}retryOpenRepoWhenIndexReady(){this._workspaceFileIndex.initialize().then(async()=>{this._isDisposed||this._repos.size||(vb.info(this.ctx,"Workspace file index finished after the budget; retrying repo lookup"),await this.tryOpenRepo())}).catch(e=>vb.error(this.ctx,"Retrying repo lookup failed",e))}async tryInferRepoFromFiles(){try{let e=Array.from(this._workspaceFileIndex.values());if(e.length===0)return;for(let r=0;r{this.refreshRepoDiffs()},t._diffRefreshInterval),await this.refreshRepoDiff(n)}async tryGetDiffedIndexedFiles(e,r){let n=await this.tryGetDiff(e,r);if(!n)return;let o=new Set,s=n.changes.slice(0,t._maxDiffFiles);for(let c of s){let l=c.uri;this._workspaceFileIndex.get(l)&&o.add(l)}return o}async tryGetDiff(e,r){try{let n=e.baseFolder.uri,o=await this._gitService.diffWithIndexedCommit(n,r);return o?{changes:o.changes,mayBeOutdated:o.mayBeOutdated}:void 0}catch(n){vb.error(this.ctx,`Failed to get diff for ${e.baseFolder.uri}`,n);return}}async refreshRepoDiffs(){let e=Date.now(),r=Array.from(this._repos.values(),n=>n).filter(n=>n.nextRefreshAt<=e);await Promise.all(r.map(n=>this.refreshRepoDiff(n)))}getNextRefreshDelay(e){if(e<=0)return t._diffRefreshInterval;let r=Math.min(e,5),n=t._diffRefreshInterval*Math.pow(2,r);return Math.min(n,t._diffRefreshMaxInterval)}async refreshRepoDiff(e){try{let r=this._githubCodeSearchService.getIndexedCommit(e.repo.baseFolder.uri),n=await this.tryGetDiffedIndexedFiles(e.repo,r);if(n){e.initialChanges.clear();for(let c of n)e.initialChanges.add(c);let o=e.repo.baseFolder.uri,s=[];for(let c of this._locallyChangedFiles)if(c.startsWith(o)){let l=this._workspaceFileIndex.get(c);(!l||!l.isDirty())&&s.push(c)}for(let c of s)this._locallyChangedFiles.delete(c);(e.state===1||e.consecutiveFailures>0)&&vb.info(this.ctx,`Diff refresh recovered for ${e.repo.baseFolder.uri}`),e.state=2,e.consecutiveFailures=0,e.lastErrorKey=void 0}else this.handleDiffFailure(e,"no-diff",`Failed to get new diff for ${e.repo.baseFolder.uri}.`)}catch(r){this.handleDiffFailure(e,"exception",`Failed to refresh diff for ${e.repo.baseFolder.uri}.`,r)}finally{e.nextRefreshAt=Date.now()+this.getNextRefreshDelay(e.consecutiveFailures)}}handleDiffFailure(e,r,n,o){e.state=1,e.consecutiveFailures++;let s=e.lastErrorKey!==r;e.lastErrorKey=r,s?o!==void 0?vb.warn(this.ctx,n,o):vb.warn(this.ctx,n):o!==void 0?vb.debug(this.ctx,n,o):vb.debug(this.ctx,n)}dispose(){this._isDisposed=!0,this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var vj;(n=>{function t(o){return new NWt(o)}n.ok=t,a(t,"ok");function e(o){return new MWt(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(vj||={});var NWt=class t{constructor(e){this.val=e}static{a(this,"ResultOk")}map(e){return new t(e(this.val))}flatMap(e){return e(this.val)}isOk(){return!0}isError(){return!1}},MWt=class{constructor(e){this.err=e}static{a(this,"ResultError")}map(e){return this}flatMap(e){return this}isOk(){return!1}isError(){return!0}};var OWt=new pe("GithubAvailableEmbeddingTypes"),qet=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Qt).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):vj.error({type:"noSession"}))}static{a(this,"GithubAvailableEmbeddingTypesManager")}async getAllAvailableTypes(){if(this._cached){let e=this._cached;try{let r=await this._cached;if(r.isOk())return r}catch{}this._cached===e&&(this._cached=void 0)}return this._cached??=(async()=>{let e=await this._ctx.get(Qt).getGitHubSession();return e?await this.doGetAvailableTypes(e):vj.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=xde(this._ctx);r=await Gd(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return OWt.error(this._ctx,"Error fetching available embedding types",c),vj.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?vj.error({type:"unauthorized",status:r.status}):vj.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new hb(c.id);c.active===!1?s.push(l):o.push(l)}return vj.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){OWt.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return OWt.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var Eas=new pe("GithubEmbeddingComputer"),qde=class{constructor(e){this.ctx=e;this.batchSize=100}static{a(this,"GithubEmbeddingComputer")}async computeEmbeddings(e,r,n,o){try{let s=await this.ctx.get(Qt).getGitHubSession();if(!s)throw new Error("No GitHub session available");let c=[],l;for(let u=0;u0&&(l=f[0].type),c.push(...f)}if(!l)throw new Error("No embedding type resolved from API response");return{type:l,values:c}}catch(s){Eas.error(this.ctx,"Error computing embeddings:",s);return}}async fetchBatchEmbeddings(e,r,n,o,s){try{let c={inputs:n};if(r&&(c.embedding_model=r.id),o?.inputType&&(c.input_type=o.inputType),s?.isCancellationRequested)return;let l=await Gd(this.ctx,e,"embeddings",{method:"POST",json:c});if(!l.ok)throw new Error(`Error fetching embeddings: ${l.status}. ${await l.text()}`);let u=await l.json(),d=new hb(u.embedding_model);if(r&&!d.equals(r))throw new Error(`Unexpected embedding model. Got: ${d.id}. Expected: ${r.id}`);if(n.length!==u.embeddings.length)throw new Error(`Mismatched embedding result count. Expected: ${n.length}. Got: ${u.embeddings.length}`);return u.embeddings.map(f=>({type:d,value:new Float32Array(f.embedding)}))}catch(c){throw new Error("Error fetching batch embeddings: "+(c instanceof Error?c.message:String(c)))}}};p();p();p();var nke=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var b2n=fe($A()),S2n=fe(Y9()),T2n=require("os"),LWt=fe(require("path")),jde=require("process");function jet(t){let e=un(t.workspaceFolder.uri),r=(0,b2n.basename)(e),o=(0,S2n.SHA256)(e).toString().substring(0,8);return LWt.default.join(vas(),"project-index",`${r}.${o}`)}a(jet,"getWorkspaceCachePath");function vas(){return jde.env.XDG_CACHE_HOME&&LWt.default.isAbsolute(jde.env.XDG_CACHE_HOME)?jde.env.XDG_CACHE_HOME+"/github-copilot":(0,T2n.platform)()==="win32"?jde.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":jde.env.HOME+"/.cache/github-copilot"}a(vas,"getXdgCachePath");p();p();function I2n(t){if(o$t(t.type)?.quantization.document==="binary"){if(t.value.length%8!==0)throw new Error(`Embedding value length must be a multiple of 8 for ${t.type.id}, got ${t.value.length}`);let n=new Uint8Array(t.value.length/8);for(let o=0;o=0?1:0)<=1024)){let o=new Float32Array(e.length*8);for(let s=0;s0?.03125:-.03125}return{type:t,value:o}}let n=new Float32Array(e.byteLength/4);return new Uint8Array(n.buffer).set(e),{type:t,value:n}}a(BWt,"unpackEmbedding");p();var x2n=fe(pl()),w2n=fe(b2()),UWt=fe(uh()),R2n=fe(require("fs")),QWt=fe(require("node:sqlite")),qWt=fe(require("path"));var FWt=new pe("WorkspaceChunkAndEmbeddingCache");async function k2n(t,e,r,n){return await jWt.create(t,e,r??":memory:",n)}a(k2n,"createWorkspaceChunkAndEmbeddingCache");var jWt=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new w2n.ResourceMap}static{a(this,"DbCache")}static{this.version="1.0.0"}static async create(e,r,n,o){let s={open:!0},c;if(n!==":memory:"){let f=qWt.default.join(n,"workspace-chunks.db");try{await R2n.default.promises.mkdir(qWt.default.dirname(f),{recursive:!0}),c=new QWt.default.DatabaseSync(f,s),FWt.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${f}`)}catch(h){FWt.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",h)}}c||(c=new QWt.default.DatabaseSync(":memory:",s),FWt.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` +`)}a(UGt,"applyEditsToDocument");var mde=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Oops, an error has occurred. Please try again";this.uiKind="conversationPanel";this.computeSuggestions=!0}static{a(this,"PanelTurnProcessorStrategy")}processResponse(){return[]}async buildConversationPrompt(e,r,n,o){let s="user",c=await Ro.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(jA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},sXe=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Please open a file and select code for the inline chat to be available";this.uiKind="conversationInline";this.computeSuggestions=!1}static{a(this,"InlineTurnProcessorStrategy")}async buildConversationPrompt(e,r,n){let o=await this.getCurrentEditorSkill(e);if(!o)return;let s=await this.getDocumentIfValid(o.uri);if(!s)return;let c=n?.producesCodeEdits===!1?"user":"inline",l=await rj(e.ctx),u=await e.ctx.get(dl).getBestChatModelConfig(Z1(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(jA).toPrompt(e,d)}async processResponse(e){let r=[],n=Mn(e.response?.message??"");if(n&&e.status==="success"&&this.currentDocument){let o=await this.processInlineResponse(n,this.currentDocument);o&&r.push(o)}return r}async getCurrentEditorSkill(e){let r=await e.skillResolver.resolve(I_);if(r)return r}async getDocumentIfValid(e){let r=await this.ctx.get(si).getOrReadTextDocument({uri:e});if(r.status==="valid")return r.document}async processInlineResponse(e,r){let o=FGt(e,r).filter(c=>BGt.includes(c.mode)),s=UGt(o,r);if(s)return await this.ctx.get(dm).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return FGt(e,r)}};var aXe=class{constructor(){this.slug="github-copilot-coding-agent";this.name="GitHub Copilot Coding Agent";this.description="Create coding tasks that are executed by GitHub Copilot Coding Agent";this.avatarUrl=void 0}static{a(this,"BackendCodingAgent")}additionalSkills(e){return[]}turnProcessor(e){let r=new mde(e.ctx);return new oXe(e,r)}};p();p();p();p();function Sxn(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(Sxn,"filterUnsupportedReferences");function Txn(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(Txn,"convertToCopilotReferences");var Ixn=b.Object({type:b.Literal("github.web-search"),id:b.String(),data:b.Object({query:b.String(),type:b.String(),results:b.Optional(b.Array(b.Object({title:b.String(),excerpt:b.String(),url:b.String()})))}),metadata:b.Optional(b.Object({display_name:b.Optional(b.String()),display_icon:b.Optional(b.String())}))});var uj=class{constructor(e){this.deltaApplier=e;this.appliedLength=0;this.appliedText="";this.appliedAnnotations=[]}static{a(this,"ConversationFinishCallback")}isFinishedAfter(e,r){let n=e.substring(this.appliedLength,e.length),s=this.mapAnnotations(r.annotations).filter(c=>!this.appliedAnnotations.includes(c.id));this.append(n,s,Sxn(r.copilotReferences),r.copilotErrors??[],r.copilotConfirmation,r.thinking)}append(e,r,n,o,s,c){this.deltaApplier(e,r,n,o,s,c),this.appliedLength+=e.length,this.appliedText+=e,this.appliedAnnotations.push(...r.map(l=>l.id))}mapAnnotations(e){if(!e)return[];let r=[],n=e.for("CodeVulnerability").map(s=>({...s,type:"code_vulnerability"})),o=e.for("IPCodeCitations").map(s=>({...s,type:"ip_code_citations"}));return r.push(...n),r.push(...o),r}};p();p();var m5=class{constructor(e){this.ctx=e;this.githubRepositoryInfoCache=new Map}static{a(this,"GitHubRepositoryApi")}async getRepositoryInfo(e){let r=`${e.hostname}/${e.owner}/${e.repo}`,n=this.githubRepositoryInfoCache.get(r);if(n)return n;let o=await this._doGetRepositoryInfo(e);if(o?.ok){let s=await o.json();return this.githubRepositoryInfoCache.set(r,s),s}}async _doGetRepositoryInfo({owner:e,repo:r,hostname:n}){let o=await this.ctx.get(Or).resolveSession(),s;if(o&&new URL(o.serverUrl).hostname===n)s=o;else{let u=await this.ctx.get(QM).findTokenByAuthority(n);u&&(s={accessToken:u.record.accessToken,apiUrl:`https://api.${n}/`})}if(!s&&!(n==="github.com"||n.endsWith(".ghe.com")))return;let c={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};s&&(c.Authorization=`Bearer ${s.accessToken}`);let l=new URL(`repos/${e}/${r}`,s?.apiUrl||`https://api.${n}`).href;return this.ctx.get(Jt).fetch(l,{method:"GET",headers:c})}};p();p();var xxn=b.Object({name:b.String(),url:b.String()}),wxn=b.Object({path:b.String(),head:b.Optional(b.Object({name:b.String(),upstream:b.Optional(xxn)})),remotes:b.Optional(b.Array(xxn))}),QGt=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(g5,"git repository information");let r=[];return r.push([new vr(["Metadata about the current git repository:"]),1]),e.head&&e.head.name?(r.push([new vr([`- Current branch name: ${e.head.name}`]),1]),e.head.upstream&&r.push([new vr([`- Upstream name and url: ${e.head.upstream.name} - ${e.head.upstream.url}`]),1])):r.push([new vr(["- Detached HEAD: yes"]),1]),e.remotes&&e.remotes.length>0&&r.push([new vr([`- Remotes: ${e.remotes.map(n=>n.name).join(", ")}`]),1]),new vr(r)}},g5="git-metadata",cXe=class extends I0{static{a(this,"GitMetadataSkill")}constructor(e){super(g5,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new QGt(r))}};async function Rxn(t){let e=await t.skillResolver.resolve(I_);if(e){let c=e.uri,l=eq(t.ctx,c);if(Rgn(l))return{repoInfo:l,skillUsed:I_}}let r=await t.skillResolver.resolve(g5);if(!r||!r.remotes||r.remotes.length===0){ot.debug(t.ctx,"Git metadata skill is not available or no remotes available.");return}let o=r.remotes.find(c=>c.name==="origin")??r.remotes[0],s=t9t(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:g5}}a(Rxn,"extractRepoInfo");async function kxn(t){let e=[];return await WJo(t,e),await zJo(t,e),await YJo(t,e),e}a(kxn,"skillsToReference");async function WJo(t,e){let r=await KJo(t);r&&e.push(r)}a(WJo,"addRepositoryReference");async function zJo(t,e){let r=await JJo(t);r&&e.push(r)}a(zJo,"addSelectionReference");async function YJo(t,e){let r=[],n=await XJo(t);n&&r.push(n),r.push(...await eZo(t)),r.length>0&&e.push(...r)}a(YJo,"addFileReferences");async function KJo(t){let e=await Rxn(t);if(e){let r=t.ctx.get(m5),n=e.repoInfo.owner,o=e.repoInfo.repo,s=await r.getRepositoryInfo(e.repoInfo);if(s)return{type:"github.repository",id:`${n}/${o}`,data:{type:"repository",name:o,ownerLogin:n,id:s.id}}}}a(KJo,"gitMetadataToReference");async function JJo(t){let e=await t.skillResolver.resolve(I_);if(e&&e.selection){let n=await t.ctx.get(si).getOrReadTextDocument(e),o=dd(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return ZJo(e,n.document)}}a(JJo,"currentEditorToSelectionReference");function ZJo(t,e){if(t.selection&&!sde(t.selection)){let r=e.getText(t.selection);return{type:"client.selection",id:t.uri,data:{start:{line:t.selection.start.line,col:t.selection.start.character},end:{line:t.selection.end.line,col:t.selection.end.character},content:r}}}}a(ZJo,"extractSelection");async function XJo(t){let e=await t.skillResolver.resolve(I_);if(e){let n=await t.ctx.get(si).getOrReadTextDocument(e),o=dd(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o),n.status==="valid")return{type:"client.file",id:n.document.uri,data:{content:n.document.getText(),language:n.document.detectedLanguageId}}}}a(XJo,"currentEditorToFileReference");async function eZo(t){let e=[],r=t.turn.request.references;if(r&&r.length>0){let n=t.ctx.get(si);for(let o of r)if(o.type==="file"){let s=await n.getOrReadTextDocument(o),c=dd(s);if(await t.collectFile(t.turn.agent.agentSlug,o.uri,c,o.selection),s.status==="valid"){let l=s.document.getText();e.push({type:"client.file",id:o.uri,data:{content:l,language:s.document.detectedLanguageId}})}}}return e}a(eZo,"fileReferenceToPlatformFileReference");p();Fo();var tZo=new pe("ChatFetchResultPostProcessor"),gde=class{constructor(e,r,n){this.turnContext=e;this.chatFetcher=r;this.computeSuggestions=n}static{a(this,"ChatFetchResultPostProcessor")}async postProcess(e,r,n,o,s,c,l,u){switch(oSn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s),await this.turnContext.ctx.get(dm).inspectFetchResult(e),e.type){case"success":return await this.processSuccessfulFetchResult(n,e.numTokens,e.requestId,r,l,o,s,u);case"offTopic":return this.processOffTopicFetchResult(s,l,u);case"canceled":return this.turnContext.turn.status="cancelled",this.turnContext.turn.response={message:"Cancelled",type:"user"},{error:{message:Mn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}};case"failed":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:e.reason,type:"server"},tZo.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:cv.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===lv,copilotPlan:Dx(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:e.code}};case"filtered":return this.turnContext.turn.status="filtered",{error:{message:"Oops, your response got filtered. Vote down if you think this shouldn't have happened.",responseIsFiltered:!0}};case"length":return this.turnContext.turn.status="error",{error:{message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0}};case"agentAuthRequired":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},{error:{message:"Authorization required",responseIsFiltered:!1}};case"no_choices":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"No choices returned",type:"server"},{error:{message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"no_finish_reason":return this.turnContext.turn.status="error",n&&n.length>0?this.turnContext.turn.response={message:n,type:"model",references:this.turnContext.turn.response?.references}:this.turnContext.turn.response={message:"No finish reason",type:"server"},{error:{message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"model_not_supported":{this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model not supported",type:"server"};let{modelName:d,modelProviderName:f}=Ro.parseModelNotSupportedReason(e.reason);return{error:{message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:d,modelProviderName:f}}}case"model_max_prompt_tokens_exceeded":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model max prompt tokens exceeded",type:"server"},{error:{message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",code:400,reason:"model_max_prompt_tokens_exceeded",responseIsFiltered:!1}};case"successMultiple":case"tool_calls":case"unknown":return this.turnContext.turn.status="error",{error:{message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1}}}}async processSuccessfulFetchResult(e,r,n,o,s,c,l,u){if(e&&e.length>0){c.markAsDisplayed(),l.markAsDisplayed(),this.turnContext.turn.status="success",this.turnContext.turn.response={message:e,type:"model",references:this.turnContext.turn.response?.references},sSn(this.turnContext,s,e,r,n,u,l);let d=this.computeSuggestions?await this.fetchSuggestions(o,s,c,u):void 0;if(d){let{followUp:f,suggestedTitle:h}=d;return{followup:f.message!==""?f:void 0,suggestedTitle:h!==""?h:void 0}}return{}}return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"The model returned successful but did not contain any response text.",type:"meta"},{error:{message:Mn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new aj(this.turnContext.ctx,this.chatFetcher).fetchRawSuggestions(this.turnContext,e,r,n);if(c===void 0)return;let l=this.enrichFollowup(c,r,n,o);return ot.debug(this.turnContext.ctx,"Computed followup",l),ot.debug(this.turnContext.ctx,"Computed suggested title",c.suggestedTitle),{followUp:l,suggestedTitle:c.suggestedTitle}}enrichFollowup(e,r,n,o){let s=n.extendedBy({messageSource:"chat.suggestions",suggestionId:Dt(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return uSn(this.turnContext.ctx,r,s,o),{message:e.followUp,id:s.properties.suggestionId,type:s.properties.suggestion}}processOffTopicFetchResult(e,r,n){let o="Sorry, but I can only assist with programming related questions.";return this.turnContext.turn.response={message:o,type:"offtopic-detection"},this.turnContext.turn.status="off-topic",aSn(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var lXe=b.Union([b.String(),b.Number()]),VJ=b.Union([b.String(),b.Number()]),rZo=b.Union([b.Literal("included"),b.Literal("blocked"),b.Literal("notfound"),b.Literal("empty")]),uXe=b.Object({uri:b.String(),position:b.Optional(Cg)}),nZo=b.Object({type:b.Literal("file"),uri:b.String(),position:b.Optional(Cg),visibleRange:b.Optional(Of),selection:b.Optional(Of),status:b.Optional(rZo),range:b.Optional(Of)}),iZo=b.Object({type:b.Literal("directory"),uri:b.String()}),oZo=b.Object({type:b.Literal("tool"),uri:b.String(),name:b.Optional(b.String()),server:b.Optional(b.String()),description:b.Optional(b.String())}),A5=b.Union([nZo,iZo,Ixn,oZo]),y5=b.Union([b.Literal("panel"),b.Literal("inline")]),sZo=b.Union([b.Object({type:b.Literal("text"),text:b.String()}),b.Object({type:b.Literal("image_url"),imageUrl:b.Object({url:b.String(),detail:b.Optional(b.Union([b.Literal("low"),b.Literal("high")]))})})]),qGt=b.Union([b.String(),b.Array(sZo)]),Pxn=b.Object({request:qGt,response:b.Optional(b.String()),agentSlug:b.Optional(b.String()),turnId:b.Optional(VJ),model:b.Optional(b.String())});function dXe(t){return typeof t=="string"?t:t.map(e=>e.type==="image_url"?{type:"image_url",image_url:{url:e.imageUrl.url,detail:e.imageUrl.detail}}:{type:"text",text:e.text})}a(dXe,"convertToMessageContent");function fXe(t,e){if(t=gT(t),typeof t=="string")return t+e;let r=t.map(n=>n.type==="text").lastIndexOf(!0);if(r>=0){let n=[...t],o=n[r];return n[r]={type:"text",text:o.text+e},n}return[...t,{type:"text",text:e}]}a(fXe,"appendToMessage");var pXe=b.Union([b.Literal("Ask"),b.Literal("Agent"),b.Literal("InlineAgent")]),aZo=b.Object({type:b.String(),description:b.String()}),Dxn=b.Object({name:b.String(),description:b.String(),inputSchema:b.Optional(b.Object({type:b.String(),properties:b.Record(b.String(),aZo),required:b.Array(b.String())})),confirmationMessages:b.Optional(b.Object({title:b.String(),message:b.String()}))}),Kc=b.Object({uri:b.String(),name:b.String()}),cZo=b.Union([b.Literal("not-started"),b.Literal("in-progress"),b.Literal("completed")]),hXe=b.Object({id:b.Number(),title:b.String(),description:b.Optional(b.String()),status:cZo});Fo();var jGt="generate-response",mXe=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},CRe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(Bc),this.chatFetcher=this.chatFetcher??new mc(r.ctx),this.postProcessor=new gde(r,this.chatFetcher,!1),this.conversation=r.conversation,this.turn=r.turn}static{a(this,"RemoteAgentTurnProcessor")}async process(e,r,n,o){try{await this.processWithAgent(e,r,this.turnContext,o)}catch(s){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,s);let c=s instanceof Error?s.message:String(s);this.turn.status="error",this.turn.response={message:c,type:"meta"},s instanceof mXe?await this.endProgress({unauthorized:{authorizationUri:s.authorizationUri,agentSlug:s.agentSlug,agentName:s.agentName}}):await this.endProgress({error:{message:c,responseIsIncomplete:!0}})}}async processWithAgent(e,r,n,o){await this.conversationProgress.begin(this.conversation,this.turn,e);let s=await fl(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let c=await this.buildAgentPrompt(n);if(!c)await this.endTurnWithResponse(`No prompt created for agent ${this.agent.id}`,"error");else{let l={type:"user",prompt:JSON.stringify(c.messages,null,2),tokens:c.tokens};await n.ctx.get(dm).inspectPrompt(l),await n.steps.start(jGt,"Generating response");let u=this.augmentTelemetry(c,s,this.turn.template,o);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let d=await this.fetchConversationResponse(n,c.messages,r,s.extendedBy({messageSource:"chat.user"},{promptTokenLen:c.tokens}),u,o);this.turn.status==="cancelled"&&this.turn.response?.type==="user"?await this.cancelProgress():(await this.finishGenerateResponseStep(d,n),await this.endProgress({error:d.error,followUp:d.followup,suggestedTitle:d.suggestedTitle,skillResolutions:c.skillResolutions}))}}async buildAgentPrompt(e){let r=this.createMessagesFromHistory(e),n=await this.computeCopilotReferences(e),o=this.getOrCreateAgentSessionId(e);return this.turn.agent&&(this.turn.agent.sessionId=o),this.turn.confirmationResponse?this.addConfirmationResponse(this.turn.confirmationResponse,r):r.push({role:"user",content:gT(e.turn.request.message),copilot_references:n.length>0?n:void 0}),{messages:r,tokens:-1,skillResolutions:[]}}getOrCreateAgentSessionId(e){let r=this.turn.agent?.agentSlug;if(r){for(let n of e.conversation.turns)if(n.agent?.agentSlug===r&&n.agent.sessionId)return n.agent.sessionId}return Dt()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return YHt(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:gT(r.request.message)}),r.response&&r.response.type==="model"){let o=Txn(r.response.references);n.push({role:"assistant",content:gT(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await kxn(e)}async endTurnWithResponse(e,r){this.turn.response={type:"meta",message:e},this.turn.status=r,await this.conversationProgress.report(this.conversation,this.turn,{reply:e}),await this.endProgress()}async fetchConversationResponse(e,r,n,o,s,c){n.onCancellationRequested(async()=>{await this.cancelProgress()});let l=new uj((h,m,g,A,y,_)=>{let E=y?{...y,agentSlug:this.agent.slug}:void 0;this.conversationProgress.report(this.conversation,this.turn,{reply:h,annotations:m,references:g,notifications:A.map(v=>({message:v.message,severity:"warning"})),confirmationRequest:E,thinking:_}),this.turn.response?(this.turn.response.message=fXe(this.turn.response.message,h),this.turn.response.references.push(...g)):this.turn.response={message:h,type:"model",references:g},this.turn.annotations.push(...m??[]),E&&(this.turn.confirmationRequest=E)}),u=await this.turnContext.ctx.get(Qt).getGitHubSession(),d={engineName:"agents",endpoint:this.agent.endpoint??this.agent.slug,messages:r,uiKind:"conversationPanel",intentParams:{intent:!0,intent_threshold:.7,intent_content:Mn(this.turn.request.message)},authToken:u?.accessToken,copilot_thread_id:this.turn.agent?.sessionId,llmInteraction:e.toLlmInteraction(),turnId:String(this.turn.id)},f=await this.chatFetcher.fetchResponse(d,n,o,(h,m)=>l.isFinishedAfter(h,m));return this.ensureAgentIsAuthorized(f),await this.postProcessor.postProcess(f,n,l.appliedText,o,s.extendedBy(this.addExtensibilityInfoTelemetry()),Mn(this.turn.request.message),"conversationPanel",c)}ensureAgentIsAuthorized(e){if(e.type==="agentAuthRequired")throw this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},new mXe("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return qwe(this.conversation,"conversationPanel",Mn(this.turn.request.message).length,e.tokens,n?.templateId,void 0,r,e.skillResolutions)}addExtensibilityInfoTelemetry(){return{extensibilityInfoJson:JSON.stringify({agent:this.agent.slug,outgoingReferences:this.turn.request.references?.map(e=>e.type)??[],incomingReferences:this.turn.response?.references?.map(e=>e.type)??[]})}}async finishGenerateResponseStep(e,r){e.error?await r.steps.error(jGt,e.error.message):await r.steps.finish(jGt)}async endProgress(e){await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}};var bRe=class{constructor(e,r,n,o,s,c){this.id=e;this.slug=r;this.name=n;this.description=o;this.avatarUrl=s;this.endpoint=c}static{a(this,"RemoteAgent")}additionalSkills(){return[]}turnProcessor(e){return new CRe(this,e)}},gXe=class extends bRe{static{a(this,"ExtensibilityPlatformAgent")}constructor(){super(0,"github","GitHub","Get answers grounded in web search, code search, and your enterprise's knowledge bases.","https://avatars.githubusercontent.com/u/9919?s=200&v=4","chat")}turnProcessor(e){return new CRe(this,e)}};p();var lZo="github",C2=class{static{a(this,"RemoteAgentRegistry")}},AXe=class extends C2{constructor(r){super();this.ctx=r;this._agents=void 0;this._lastFetchTime=0}static{a(this,"CapiRemoteAgentRegistry")}async agents(){return this.shouldRefreshAgents()&&(this._agents=await this.fetchAgents()),this._agents!=null?this._agents.slice():[]}shouldRefreshAgents(){return!this._agents||!this._lastFetchTime?!0:this.isLastFetchOlderOneHour()}isLastFetchOlderOneHour(){return Date.now()-this._lastFetchTime>36e5}async fetchAgents(){let r=await wK(this.ctx,"/agents");return r.ok?(this._lastFetchTime=Date.now(),this.parseAgents(await r.text())):(Fr.error(this.ctx,"Failed to fetch agents from CAPI",{status:r.status,statusText:r.statusText}),[])}parseAgents(r){let n;try{n=JSON.parse(r).agents,Array.isArray(n)||Fr.error(this.ctx,"Expected 'agents' to be an array")}catch(o){return r.includes("access denied")||Fr.warn(this.ctx,"Invalid remote agent response:",r,o),[]}return n.filter(o=>o.slug!==lZo).map(o=>new bRe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var Nxn=fe(require("fs")),dv=fe(require("path"));var HGt=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],GGt="test_",SRe={js:{suffix:[".test",".spec"],location:"sameFolder"},ts:{suffix:[".test",".spec"],location:"sameFolder"},go:{suffix:["_test"],location:"sameFolder"},java:{suffix:["Test"],location:"testFolder"},php:{suffix:["Test"],location:"testFolder"},dart:{suffix:["_test"],location:"testFolder"},cs:{suffix:["Test"],location:"testFolder"},rb:{suffix:["_test","_spec"],location:"testFolder"},py:{prefix:"test_",location:"testFolder"},ps1:{suffix:[".Tests"],location:"testFolder"},kt:{suffix:["Test"],location:"testFolder"}},TRe=class{constructor(e,r,n=void 0){this.ctx=e;this.fileExists=r;this.baseUri=n}static{a(this,"TestFileFinder")}async findTestFileForSourceFile(e){let r=ro(e),n=dv.extname(r).replace(".",""),o=SRe[n]??{location:"sameFolder",prefix:GGt,suffix:HGt},s=[];if(o.prefix&&s.push(o.prefix+r),o.suffix)for(let d of o.suffix??[]){let f=r.replace(`.${n}`,d+"."+n);s.push(f)}let c=o.location??"sameFolder",l;if(c==="sameFolder"){if(l=ys(Cf(e)),l===void 0)return}else{let d=ys(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=dv.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=Ko(l);if(await this.fileExists(u))return Oa(u,s[0])}parseTestFilePath(e){try{return Ko(e)}catch(r){Fr.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=ro(e),n=dv.extname(r).replace(".",""),o=SRe[n]??{location:"sameFolder",prefix:GGt,suffix:HGt},s=[];if(o.prefix&&s.push(r.substring(o.prefix.length)),o.suffix)for(let u of o.suffix??[]){let f=r.substring(0,r.length-u.length-1-n.length)+"."+n;s.push(f)}let c=o.location??"sameFolder",l;c==="sameFolder"?l=Cf(e):l=this.determineImplFolder(e);for(let u of s){let d=Oa(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=ys(e);if(r===void 0)return;let n=dv.extname(ro(e)).replace(".",""),o,s=SRe[n]?.location??"sameFolder";s==="sameFolder"?o=dv.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,SRe[n]);if(c.length>0)return Ko(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${dv.sep}${c}`;n?.prefix&&c.startsWith(n.prefix)&&s.push(l),n?.suffix&&n?.suffix.some(u=>c.endsWith(u+r))&&s.push(l)}return s}_readdir(e){return Nxn.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&ys(this.baseUri))??"",o=dv.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(dv.sep)}getRelativeTestFolder(e,r,n,o){let s=dv.dirname(e).replace(r,"");switch(n){case"php":case"dart":case"py":return["tests"];case"ps1":return["Tests"];case"rb":return["test",s];case"cs":return[s.replace("src","src/tests")];case"java":case"scala":case"kt":return[s.replace(/src[\\/]main/,"src/test")];default:return o==="testFolder"?[s.replace("src","test")]:[s]}}determineImplFolder(e){let r=dv.extname(ro(e)).replace(".",""),n=Cf(e);switch(r){case"php":case"dart":case"py":return n.replace("tests","src");case"ps1":return n.replace("Tests","src");case"rb":return n.replace("/test","");case"cs":return n.replace("src/tests","src");case"java":case"scala":case"kt":return n.replace("src/test","src/main");default:return n.replace("test/","src/")}}};function IRe(t){let e=ro(t),r=dv.extname(e),n=SRe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(HGt.some(s=>e.endsWith(s+r))||e.startsWith(GGt))}a(IRe,"isTestFile");p();var $Gt=class extends Error{static{a(this,"UserQueryParserError")}constructor(e){super(String(e),{cause:e}),this.name="UserQueryParserError"}};async function Mxn(t,e){let r=t.ctx,n=await Ro.getModelConfiguration(r,"synonyms",{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(jA).toPrompt(t,o);if(!s.toolConfig)return;let c={modelConfiguration:n,uiKind:"conversationPanel",messages:s.messages,tools:s.toolConfig?.tools,tool_choice:s.toolConfig?.tool_choice,llmInteraction:t.toLlmInteraction()},l=new mc(r),u=await fl(r,t),d=await l.fetchResponse(c,e,u.extendedBy({messageSource:"chat.synonyms"}));if(d.type==="success"&&d.toolCalls&&d.toolCalls.length>0){let f=d.toolCalls[0],h=s.toolConfig?.extractArguments(f).keywords;return!h||!Array.isArray(h)?void 0:(ot.debug(r,`UserQueryParser: Parsed ${h.length} keywords from the original user query: ${h.join(", ")}`),h.length?h:void 0)}else{let f="reason"in d?d.reason:"";Ma(r,new $Gt(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"UserQueryParser.parseUserQuery")}}a(Mxn,"parseUserQuery");p();p();p();p();var es=class t{static{a(this,"Position")}constructor(e,r){this.lineNumber=e,this.column=r}with(e=this.lineNumber,r=this.column){return e===this.lineNumber&&r===this.column?this:new t(e,r)}delta(e=0,r=0){return this.with(this.lineNumber+e,this.column+r)}equals(e){return t.equals(this,e)}static equals(e,r){return!e&&!r?!0:!!e&&!!r&&e.lineNumber===r.lineNumber&&e.column===r.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,r){return e.lineNumbern||e===n&&r>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=r):(this.startLineNumber=e,this.startColumn=r,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.columne.endColumn)}static strictContainsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.column<=e.startColumn||r.lineNumber===e.endLineNumber&&r.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumn<=e.startColumn||r.endLineNumber===e.endLineNumber&&r.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,r){let n,o,s,c;return r.startLineNumbere.endLineNumber?(s=r.endLineNumber,c=r.endColumn):r.endLineNumber===e.endLineNumber?(s=r.endLineNumber,c=Math.max(r.endColumn,e.endColumn)):(s=e.endLineNumber,c=e.endColumn),new t(n,o,s,c)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,r){let n=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,c=e.endColumn,l=r.startLineNumber,u=r.startColumn,d=r.endLineNumber,f=r.endColumn;return nd?(s=d,c=f):s===d&&(c=Math.min(c,f)),n>s||n===s&&o>c?null:new t(n,o,s,c)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,r){return!e&&!r?!0:!!e&&!!r&&e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&e.endLineNumber===r.endLineNumber&&e.endColumn===r.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new es(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new es(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,r){return new t(this.startLineNumber,this.startColumn,e,r)}setStartPosition(e,r){return new t(e,r,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,r=e){return new t(e.lineNumber,e.column,r.lineNumber,r.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,r){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};var Oxn=250;function HA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/Oxn)),typeof t.maxResults=="number"&&(e=typeof e=="number"?Math.min(t.maxResults,e):t.maxResults),typeof e!="number")throw new Error("Either maxResults or tokenBudget must be provided");return e}a(HA,"getMaxChunks");var Lxn=32e3,Bxn=2e4,xRe=.75;p();p();function GA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(GA,"getFenceForCodeBlock");p();var ERn=fe(Ml()),vRn=fe(uh());p();var hb=class t{constructor(e){this.id=e}static{a(this,"EmbeddingType")}static{this.text3small_512=new t("text-embedding-3-small-512")}static{this.metis_1024_I16_Binary=new t("metis-1024-I16-Binary")}toString(){return this.id}equals(e){return this.id===e.id}};var _Xo=Object.freeze({[hb.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[hb.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function s$t(t){return _Xo[t.id]}a(s$t,"getWellKnownEmbeddingTypeInfo");function EXo(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:wRe(l,t),value:c})).filter(c=>c.distance.value>o).sort((c,l)=>l.distance.value-c.distance.value).slice(0,r).map(c=>({distance:c.distance,value:c.value}));if(s.length&&typeof n?.maxSpread=="number"){let c=s.at(0).distance.value*(1-n.maxSpread);return s.filter(u=>u.distance.value>=c)}return s}a(Yxn,"rankEmbeddings");p();p();var BF=fe(pl()),_Rn=fe(uh());var b5=new pe("GitHubCodeSearch"),dns=300*1e3,aet=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new BF.IntervalTimer,this.startPeriodicRefresh()}static{a(this,"GithubCodeSearchService")}getIndexedCommit(e){return this._indexedCommits.get(e)}setIndexedCommit(e,r){this._indexedCommits.get(e)!==r&&this._indexedCommits.set(e,r)}startPeriodicRefresh(){this._refreshTimer.cancelAndSet(()=>{this.updateIndexedRepoCommit()},dns)}updateIndexedRepoCommit(){if(this._indexedRepos.size!==0)for(let[e,r]of this._indexedRepos.entries())this._indexedCommits.get(e)&&(async()=>{try{let o=await this._ctx.get(Qt).getGitHubSession();if(!o)return;let{currentStatus:s,indexedCommit:c}=await this.getRemoteIndexState(o,r,{isCancellationRequested:!1});if(s==="ready"&&c){let l=this._indexedCommits.get(e);l!==c&&(this._indexedCommits.set(e,c),b5.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){b5.warn(this._ctx,`Failed to update indexed commit for ${e}`,o)}})()}async ensureReposIndexed(e,r,n){return await Promise.all(r.map(async o=>{let s=o?.baseFolder.uri;if(!s||n.isCancellationRequested||this._indexedRepos.has(s))return;let{currentStatus:c,indexedCommit:l}=await this.getRemoteIndexState(e,o,n);if(b5.info(this._ctx,`Index status check for ${o.owner}/${o.name}`,{status:c,indexedCommit:l}),c==="ready")this._indexedRepos.set(s,o),l&&this.setIndexedCommit(s,l);else if(c==="not-yet-indexed")try{await this.tryToInstantIndexRepo(e,o,n),b5.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){b5.warn(this._ctx,`Instant indexing failed for ${o.owner}/${o.name}`,u)}})),r.filter(o=>this._indexedRepos.has(o.baseFolder.uri))}async tryToInstantIndexRepo(e,r,n){await(0,BF.raceTimeout)((async()=>{if(!await(0,BF.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,BF.raceCancellationError)((0,BF.timeout)(l),n);let{currentStatus:u,indexedCommit:d}=await this.getRemoteIndexState(e,r,n);if(u==="ready"){this._indexedRepos.set(r.baseFolder.uri,r),d&&this.setIndexedCommit(r.baseFolder.uri,d);break}else if(u!=="building-index"){let f=`Instant indexing for '${r.owner}/${r.name}' failed. Found unexpected status: '${u}'`;throw b5.error(this._ctx,f),new Error(f)}}return!0})(),8e3)}async getRemoteIndexState(e,r,n){if(!r.owner||!r.name)return{currentStatus:"not-indexable"};let o=r.owner+"/"+r.name,s=await $d(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return b5.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return b5.debug(this._ctx,`${o} - semantic_code_search_ok: ${c.semantic_code_search_ok}`),c.semantic_code_search_ok?{currentStatus:"ready",indexedCommit:c.semantic_commit_sha}:c.semantic_indexing_enabled?{currentStatus:"building-index"}:{currentStatus:"not-yet-indexed"}}async triggerIndexing(e,r,n,o){let s=wde(this._ctx),c=n.owner+"/"+n.name,l=await $d(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(b5.error(this._ctx,`Failed to request indexing for '${c}'. Response: ${l.status}. ${await l.text()}`),!1)}async searchRepo(e,r,n,o,s,c){let l=wde(this._ctx),u=await $d(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:pns(o,7800),include_embeddings:!1,limit:s,embedding_model:r.id}});if(!u.ok)throw new Error(`Code search semantic search failed with status: ${u.status}`);let d=await u.json();if(!Array.isArray(d.results))throw new Error("Code search semantic search unexpected response json shape");return fns(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function wde(t){let e=t.get(Ir);return{"X-Client-Application":`${o1(e.getEditorInfo())}`,"X-Client-Source":o1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(wde,"editorVersionHeaders");async function fns(t,e,r){let o=[],s=new hb(e.embedding_model),c=Gs(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=Oa(c,l.location.path)}catch(d){b5.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:cet(l.chunk.text),rawText:void 0,range:new _Rn.Range(l.chunk.line_range.start+1,1,l.chunk.line_range.end+1,1),isFullFile:!1},distance:{embeddingType:s,value:l.distance}})})),{chunks:o,outOfSync:!1}}a(fns,"parseGithubCodeSearchResponse");function pns(t,e){if(t.length*4<=e)return t;let o=new TextEncoder().encode(t);if(o.length<=e)return t;let s=o.slice(0,e);return new TextDecoder().decode(s,{stream:!0})}a(pns,"truncateToMaxUtf8Length");function cet(t){let e=hns(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` +`):t}a(cet,"stripChunkTextMetadata");function hns(t){return t.split(/\r\n|\r|\n/)}a(hns,"splitLines");var w2=fe(pl()),CRn=fe(yde()),bRn=fe(ym());var WRe=new pe("ChunkingEndpointClient"),BVt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new CRn.LinkedList;this._numberInFlightRequests=0;this._lastSendTime=Date.now();this._isPumping=!1}static{a(this,"RequestRateLimiter")}static{this._abuseLimit=1e3/40}async enqueue(e,r){let n=new w2.DeferredPromise;return r.onCancellationRequested(()=>n.cancel()),this.requestQueue.push({task:e,attempt:0,deferred:n,token:r}),await this.pump(),n.p}async pump(){if(!this._isPumping)try{for(this._isPumping=!0;!this.requestQueue.isEmpty();){this._rateLimitTimeout&&(await this._rateLimitTimeout,this._rateLimitTimeout=void 0);let e=Date.now()-this._lastSendTime;if(e=this._maxParallelChunksRequests){await(0,w2.timeout)(10);continue}if(this._latestRateLimitHint){let o=Date.now();if(othis.targetQuota){let o=Date.now(),s=this._latestQuotaUsed.quota-this.targetQuota,c=o-this._latestQuotaUsed.timestamp,l=2500,u=1e3,d=s/(100-this.targetQuota);d*=Math.max(1-c/l,0);let f=d*u;f>0&&await(0,w2.timeout)(Math.min(f,u))}let r=this.requestQueue.shift();if(r.token.isCancellationRequested){await r.deferred.cancel();continue}this._numberInFlightRequests++,this._lastSendTime=Date.now(),r.task(r.attempt).then(async o=>{if(this.updateQuotasFromResponse(o),r.token.isCancellationRequested){await r.deferred.cancel();return}if(o.ok){await r.deferred.complete(o);return}if(r.attempt0&&(this._rateLimitTimeout=(0,w2.timeout)(s*1e3)),this.requestQueue.unshift({task:r.task,attempt:r.attempt+1,deferred:r.deferred,token:r.token}),await this.pump();return}await r.deferred.complete(o)}).catch(async o=>{await r.deferred.error(o)}).finally(()=>{this._numberInFlightRequests--})}}finally{this._isPumping=!1}}updateQuotasFromResponse(e){let r=Date.now();try{let n=e.headers.get("x-ratelimit-remaining"),o=e.headers.get("x-ratelimit-reset");n&&o&&(this._latestRateLimitHint={timestamp:r,remaining:parseFloat(n),resetAt:parseFloat(o)*1e3});let s=e.headers.get("x-github-total-quota-used");s&&(this._latestQuotaUsed?this._latestQuotaUsed={timestamp:r,quota:parseFloat(s)}:this._latestQuotaUsed={timestamp:r,quota:parseFloat(s)})}catch(n){WRe.error(this.ctx,"Error parsing rate limit/quota headers",n)}}getRequestRetryDelay(e){try{let r=e.headers.get("retry-after");if(r){let n=parseFloat(r);if(!isNaN(n))return n}}catch{WRe.error(this.ctx,"Error parsing retry-after header")}try{let r=e.headers.get("x-ratelimit-reset");if(r){let n=parseFloat(r);if(!isNaN(n)){let o=Math.floor(Date.now()/1e3);return n-o}}}catch{WRe.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},uet=class{constructor(e){this.ctx=e;this._requestLimiter=new BVt(e)}static{a(this,"ChunkingEndpointClientImpl")}computeChunks(e,r,n,o,s,c,l){return this.doComputeChunksAndEmbeddings(e,r,n,o,{qos:s,computeEmbeddings:!1},c,l)}async computeChunksAndEmbeddings(e,r,n,o,s,c,l){return await this.doComputeChunksAndEmbeddings(e,r,n,o,{qos:s,computeEmbeddings:!0},c,l)}async doComputeChunksAndEmbeddings(e,r,n,o,s,c,l){let u=await(0,w2.raceCancellationError)(n.getText(),l);if((0,bRn.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=wde(this.ctx);return await $d(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:ys(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,w2.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){WRe.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,ERn.coalesce)(h.chunks.map(m=>{let g=new vRn.Range(m.line_range.start+1,1,m.line_range.end+1,1),A=c?.get(m.hash);if(A)return{chunk:{file:n.uri.toString(),text:cet(A.chunk.text),rawText:void 0,range:g,isFullFile:A.chunk.isFullFile},chunkHash:m.hash,embedding:A.embedding};if(typeof m.text!="string")return;let y;if(m.embedding?.embedding){let _=new hb(h.embedding_model);if(!_.equals(r))throw new Error(`Unexpected embedding model. Got: ${_.id}. Expected: ${r.id}`);y={type:_,value:new Float32Array(m.embedding.embedding)}}if(!(s.computeEmbeddings&&!y))return{chunk:{file:n.uri.toString(),text:cet(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){WRe.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var R_={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},Tg=class t{static{a(this,"WorkspaceChunkSearchTelemetry")}static sendSuccess(e,r,n,o){let s={status_text:"success",...n},c=Vt.createAndMarkAsIssued(s,o);ft(e,r,c),sr(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};Ma(e,n,r,o),Hs(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,R_.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,R_.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,R_.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,R_.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,R_.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,R_.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,R_.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,R_.Remote,r)}static sendSearchFailure(e,r,n){t.sendFailure(e,r,n)}static sendSkipped(e,r,n){let o={status_text:"skipped",reason:n},s=Vt.createAndMarkAsIssued(o,{});ft(e,r,s),sr(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,R_.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,R_.Aggregate,r)}};var SRn=fe(Ml()),TRn=fe(pl()),FVt=fe(E5());var FF=new pe("Remote Search"),det=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._localDiffSearch=n;this._githubCodeSearchService=o;this.id="codesearch";this.localDiffSearchTimeout=15e3}static{a(this,"CodeSearchChunkSearch")}async isAvailable(e){return(await this.getRepos(e)).length>0}async getRepos(e){if(!e?.length)return[];let r=this.ctx.get(Pf),o=(await Promise.all(e.map(async c=>await r.getRepo({uri:c})))).filter(c=>c!==void 0).filter(c=>c.isGitHub()&&c.owner&&c.name),s=new Map;for(let c of o){let l=`${c.owner}/${c.name}`;s.has(l)||s.set(l,c)}return Array.from(s.values())}async searchWorkspace(e,r,n){let o=new FVt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(FF.info(this.ctx,"Starting workspace search",{rawQuery:e.rawQuery,repoCount:s.length,repos:s.map(k=>`${k.owner}/${k.name}`),maxResults:HA(r)}),s.length===0)throw FF.error(this.ctx,"No GitHub repositories found"),Tg.sendRemoteSkipped(this.ctx,"no_github_repos"),new Error("No GitHub repositories found in CodeSearchChunkSearch");let c=await this.ctx.get(Qt).getGitHubSession();if(!c)throw FF.error(this.ctx,"No GitHub session found"),Tg.sendRemoteSkipped(this.ctx,"no_github_session"),new Error("No GitHub session found in CodeSearchChunkSearch");let l=await this._githubCodeSearchService.ensureReposIndexed(c,s,n);if(l.length===0)throw FF.error(this.ctx,"Remote index not ready for any repositories"),Tg.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=HA(r),d=Promise.all(l.map(async k=>{sm(n);let D=await e.resolveQuery(n),N=new FVt.StopWatch,O=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,k,D,u,n);return FF.info(this.ctx,`Search completed for ${k.owner}/${k.name}`,{searchTime:N.elapsed(),chunkCount:O.chunks.length}),O})),f=await this._localDiffSearch.getLocalDiff(r.workspaceFolders),h=new Set(f),m=this._localDiffSearch.shouldDoLocalDiffSearch(f,r.workspaceFolders);FF.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,TRn.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{FF.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(k=>{FF.error(this.ctx,"Local diff search failed",k)})??Promise.resolve(void 0)]),_=(0,SRn.coalesce)(A).flatMap(k=>k.chunks),E=y?.isOk()?y.val.result.chunks:[],v=E.length>0?[..._.filter(k=>!h.has(k.chunk.file)),...E]:_,S=v.length,w=new Set(v.map(k=>k.chunk.file)).size,R=o.elapsed();FF.info(this.ctx,`Search completed successfully in ${R}ms`,{totalTime:R,totalChunkCount:S,uniqueFileCount:w,indexedRepoCount:l.length,localDiffChunkCount:E.length,localDiffStrategy:y?.isOk()?y.val.strategy:"none"});let x=y?.isOk()?"mixed":"codesearch";return Tg.sendRemoteSuccess(this.ctx,R,S,w,x),{chunks:v}}};p();p();var v2n=require("node:url"),C2n=require("path");p();var wet=fe(xRn(),1);p();var UVt=new WeakMap;function kde(...t){let e=new String(t);return UVt.set(e,t),e}a(kde,"c");function Dw(t){return t instanceof String&&UVt.has(t)}a(Dw,"r");function Pde(t){return UVt.get(t)??[]}a(Pde,"o");var Iet=fe(MRn(),1),uPn=require("child_process");var zPn=fe(HVt(),1),o2n=require("node:path");p();function*ORn(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(ORn,"U");var qns=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),jns=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),Hns=new Set(["edit","remove-section","rename-section","set","unset"]),Gns=new Set(["get","get-color","get-colorbool","list"]);function $ns(t,e){for(let{name:n}of ORn(t,"task")){if(qns.has(n))return Ode(!0,e);if(jns.has(n))return Ode(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:Hns.has(r)?Ode(!0,e.slice(1)):Gns.has(r)?Ode(!1,e.slice(1)):e.length===1?Ode(!1,e):Ode(!0,e)}a($ns,"F");function Ode(t=!1,e=[]){let r=e.at(0)?.toLowerCase();return r===void 0?null:{isWrite:t,isRead:!t,key:r,value:e.at(1)}}a(Ode,"p");function Vns(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(Vns,"A");function Wns(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a(Wns,"M");function zns(t){for(let{name:e}of ORn(t,"task"))switch(e){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}a(zns,"N");function Yns({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(Yns,"G");function*Kns(t){for(let e of t){let r=Yns(e),n=r&&Wns(e.value);n&&(yield{...n,scope:r})}}a(Kns,"O");function Jns(t,e,r){let n={read:[],write:[...Kns(e)]};return t==="config"&&Zns(n,zns(e),$ns(e,r)),n}a(Jns,"L");function Zns(t,e,r){if(r===null)return;let n=Vns(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(Zns,"$");var LRn={short:new Map([["c",!0]])},Xns={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...LRn.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},eis={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"])}},tis={short:new Map,long:new Set};function ris(t){let e=eis[t??""]??tis;return{short:new Map([...LRn.short.entries(),...e.short.entries()]),long:e.long}}a(ris,"I");function BRn(t,e=Xns){if(t.startsWith("--")){let r=t.indexOf("=");if(r>2)return[{name:t.slice(0,r),value:t.slice(r+1),needsNext:!1}];let n=t.slice(2);return[{name:t,needsNext:e.long.has(n)}]}if(t.length===2){let r=t.charAt(1),n=e.short.get(r);return[{name:t,needsNext:n===!0}]}return nis(t,e.short)}a(BRn,"b");function nis(t,e){let r=t.slice(1).split(""),n=[];for(let o=0;oe.has(u)))return n.push({name:`-${s}`,value:l,needsNext:!1}),n}n.push({name:`-${s}`,needsNext:c})}return n}a(nis,"W");function iis(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[fWt(t)[0]])(t=0)),e},"__init"),"__esm"),_is=a((t,e)=>a(function(){return e||(0,t[fWt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),_m=a((t,e)=>{for(var r in e)dWt(t,r,{get:e[r],enumerable:!0})},"__export"),Eis=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of fWt(e))!yis.call(t,o)&&o!==r&&dWt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=Ais(e,o))||n.enumerable});return t},"__copyProps"),fh=a(t=>Eis(dWt({},"__esModule",{value:!0}),t),"__toCommonJS"),UF,Ej=tn({"src/lib/errors/git-error.ts"(){"use strict";UF=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),ZRe,Ude=tn({"src/lib/errors/git-response-error.ts"(){"use strict";Ej(),ZRe=class extends UF{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),_kn,Ekn=tn({"src/lib/errors/task-configuration-error.ts"(){"use strict";Ej(),_kn=class extends UF{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function vkn(t){return typeof t!="function"?oZ:t}a(vkn,"asFunction");function Ckn(t){return typeof t=="function"&&t!==oZ}a(Ckn,"isUserFunction");function bkn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a(bkn,"splitOn");function Skn(t,e=0){return Tkn(t)&&t.length>e?t[e]:void 0}a(Skn,"first");function iZ(t,e=0){if(Tkn(t)&&t.length>e)return t[t.length-1-e]}a(iZ,"last");function Tkn(t){return Det(t)}a(Tkn,"isArrayLike");function XRe(t="",e=!0,r=` +`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(XRe,"toLinesWithContent");function pWt(t,e){return XRe(t,!0).map(r=>e(r))}a(pWt,"forEachLineWithContent");function hWt(t){return(0,wet.exists)(t,wet.FOLDER)}a(hWt,"folderExists");function Ow(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(Ow,"append");function Ikn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(Ikn,"including");function Ret(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(Ret,"remove");function S5(t){return Array.isArray(t)?t:[t]}a(S5,"asArray");function xkn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a(xkn,"asCamelCase");function Qde(t){return S5(t).map(e=>e instanceof String?e:String(e))}a(Qde,"asStringArray");function Pu(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(Pu,"asNumber");function KRe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a(wkn,"pick");function KVt(t=0){return new Promise(e=>setTimeout(e,t))}a(KVt,"delay");function JVt(t){if(t!==!1)return t}a(JVt,"orVoid");var Bde,oZ,eke,ket=tn({"src/lib/utils/util.ts"(){"use strict";mWt(),Bde="\0",oZ=a(()=>{},"NOOP"),eke=Object.prototype.toString.call.bind(Object.prototype.toString)}});function k_(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(k_,"filterType");function ZVt(t,e){let r=Dw(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(ZVt,"filterPrimitives");function Pet(t){return!!t&&eke(t)==="[object Object]"}a(Pet,"filterPlainObject");function Rkn(t){return typeof t=="function"}a(Rkn,"filterFunction");var tke,kkn,yp,bet,Det,mWt=tn({"src/lib/utils/argument-filters.ts"(){"use strict";ket(),tke=a(t=>Array.isArray(t),"filterArray"),kkn=a(t=>typeof t=="number","filterNumber"),yp=a(t=>typeof t=="string"||Dw(t),"filterString"),bet=a(t=>yp(t)||Array.isArray(t)&&t.every(yp),"filterStringOrStringArray"),Det=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),XVt,vis=tn({"src/lib/utils/exit-codes.ts"(){"use strict";XVt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(XVt||{})}}),Tet,Cis=tn({"src/lib/utils/git-output-streams.ts"(){"use strict";Tet=class Pkn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new Pkn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function bis(){throw new Error("LineParser:useMatches not implemented")}a(bis,"useMatchesDefault");var Do,_j,Sis=tn({"src/lib/utils/line-parser.ts"(){"use strict";Do=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=bis,this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((o,s)=>this.addMatch(o,s,r(s)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let n=r&&t.exec(r);return n&&this.pushMatch(e,n),!!n}pushMatch(t,e){this.matches.push(...e.slice(1))}},_j=class extends Do{static{a(this,"RemoteLineParser")}addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function Dkn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...Nkn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(Dkn,"createInstanceConfig");var Nkn,Tis=tn({"src/lib/utils/simple-git-options.ts"(){"use strict";Nkn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function gWt(t,e=[]){return Pet(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(Dw(o))r.push(o);else if(ZVt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)ZVt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(gWt,"appendTaskOptions");function hv(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=XRe(o,n),c=0,l=s.length;c{if(!(c+d>=l))return s[c+d]},"line");e.some(({parse:d})=>d(u,t))}}),t}a(Eb,"parseStringResponse");var wis=tn({"src/lib/utils/task-parser.ts"(){"use strict";ket()}}),Mkn={};_m(Mkn,{ExitCodes:a(()=>XVt,"ExitCodes"),GitOutputStreams:a(()=>Tet,"GitOutputStreams"),LineParser:a(()=>Do,"LineParser"),NOOP:a(()=>oZ,"NOOP"),NULL:a(()=>Bde,"NULL"),RemoteLineParser:a(()=>_j,"RemoteLineParser"),append:a(()=>Ow,"append"),appendTaskOptions:a(()=>gWt,"appendTaskOptions"),asArray:a(()=>S5,"asArray"),asCamelCase:a(()=>xkn,"asCamelCase"),asFunction:a(()=>vkn,"asFunction"),asNumber:a(()=>Pu,"asNumber"),asStringArray:a(()=>Qde,"asStringArray"),bufferToString:a(()=>JRe,"bufferToString"),callTaskParser:a(()=>eWt,"callTaskParser"),createInstanceConfig:a(()=>Dkn,"createInstanceConfig"),delay:a(()=>KVt,"delay"),filterArray:a(()=>tke,"filterArray"),filterFunction:a(()=>Rkn,"filterFunction"),filterHasLength:a(()=>Det,"filterHasLength"),filterNumber:a(()=>kkn,"filterNumber"),filterPlainObject:a(()=>Pet,"filterPlainObject"),filterPrimitives:a(()=>ZVt,"filterPrimitives"),filterString:a(()=>yp,"filterString"),filterStringOrStringArray:a(()=>bet,"filterStringOrStringArray"),filterType:a(()=>k_,"filterType"),first:a(()=>Skn,"first"),folderExists:a(()=>hWt,"folderExists"),forEachLineWithContent:a(()=>pWt,"forEachLineWithContent"),getTrailingOptions:a(()=>hv,"getTrailingOptions"),including:a(()=>Ikn,"including"),isUserFunction:a(()=>Ckn,"isUserFunction"),last:a(()=>iZ,"last"),objectToString:a(()=>eke,"objectToString"),orVoid:a(()=>JVt,"orVoid"),parseStringResponse:a(()=>Eb,"parseStringResponse"),pick:a(()=>wkn,"pick"),prefixedArray:a(()=>KRe,"prefixedArray"),remove:a(()=>Ret,"remove"),splitOn:a(()=>bkn,"splitOn"),toLinesWithContent:a(()=>XRe,"toLinesWithContent"),trailingFunctionArgument:a(()=>Xd,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>AWt,"trailingOptionsArgument")});var co=tn({"src/lib/utils/index.ts"(){"use strict";mWt(),vis(),Cis(),Sis(),Tis(),xis(),wis(),ket()}}),Okn={};_m(Okn,{CheckRepoActions:a(()=>tWt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>Bkn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>Lkn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>Ris,"checkIsRepoTask")});function Ris(t){switch(t){case"bare":return Bkn();case"root":return Lkn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:Net,parser:yWt}}a(Ris,"checkIsRepoTask");function Lkn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:Net,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(Lkn,"checkIsRepoRootTask");function Bkn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:Net,parser:yWt}}a(Bkn,"checkIsBareRepoTask");function kis(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(kis,"isNotRepoMessage");var tWt,Net,yWt,Fkn=tn({"src/lib/tasks/check-is-repo.ts"(){"use strict";co(),tWt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(tWt||{}),Net=a(({exitCode:t},e,r,n)=>{if(t===128&&kis(e))return r(Buffer.from("false"));n(e)},"onError"),yWt=a(t=>t.trim()==="true","parser")}});function Pis(t,e){let r=new Ukn(t),n=t?qkn:Qkn;return XRe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(jkn.test(s)?r.folders:r.files).push(s)}),r}a(Pis,"cleanSummaryParser");var Ukn,Qkn,qkn,jkn,Dis=tn({"src/lib/responses/CleanSummary.ts"(){"use strict";co(),Ukn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},Qkn=/^[a-z]+\s*/i,qkn=/^[a-z]+\s+[a-z]+\s*/i,jkn=/\/$/}}),rWt={};_m(rWt,{EMPTY_COMMANDS:a(()=>Met,"EMPTY_COMMANDS"),adhocExecTask:a(()=>Hkn,"adhocExecTask"),configurationErrorTask:a(()=>_b,"configurationErrorTask"),isBufferTask:a(()=>$kn,"isBufferTask"),isEmptyTask:a(()=>Vkn,"isEmptyTask"),straightThroughBufferTask:a(()=>Gkn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>mv,"straightThroughStringTask")});function Hkn(t){return{commands:Met,format:"empty",parser:t}}a(Hkn,"adhocExecTask");function _b(t){return{commands:Met,format:"empty",parser(){throw typeof t=="string"?new _kn(t):t}}}a(_b,"configurationErrorTask");function mv(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(mv,"straightThroughStringTask");function Gkn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(Gkn,"straightThroughBufferTask");function $kn(t){return t.format==="buffer"}a($kn,"isBufferTask");function Vkn(t){return t.format==="empty"||!t.commands.length}a(Vkn,"isEmptyTask");var Met,ph=tn({"src/lib/tasks/task.ts"(){"use strict";Ekn(),Met=[]}}),Wkn={};_m(Wkn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>_Wt,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>EWt,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>vWt,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>_et,"CleanOptions"),cleanTask:a(()=>zkn,"cleanTask"),cleanWithOptionsTask:a(()=>Nis,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>Mis,"isCleanOptionsArray")});function Nis(t,e){let{cleanMode:r,options:n,valid:o}=Ois(t);return r?o.options?(n.push(...e),n.some(Fis)?_b(_Wt):zkn(r,n)):_b(vWt+JSON.stringify(t)):_b(EWt)}a(Nis,"cleanWithOptionsTask");function zkn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return Pis(t==="n",n)}}}a(zkn,"cleanTask");function Mis(t){return Array.isArray(t)&&t.every(e=>CWt.has(e))}a(Mis,"isCleanOptionsArray");function Ois(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{Lis(o)?(e=o,n.cleanMode=!0):n.options=n.options&&Bis(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(Ois,"getCleanOptions");function Lis(t){return t==="f"||t==="n"}a(Lis,"isCleanMode");function Bis(t){return/^-[a-z]$/i.test(t)&&CWt.has(t.charAt(1))}a(Bis,"isKnownOption");function Fis(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(Fis,"isInteractiveMode");var _Wt,EWt,vWt,_et,CWt,Ykn=tn({"src/lib/tasks/clean.ts"(){"use strict";Dis(),co(),ph(),_Wt="Git clean interactive mode is not supported",EWt='Git clean mode parameter ("n" or "f") is required',vWt="Git clean unknown option found in: ",_et=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(_et||{}),CWt=new Set(["i",...Qde(Object.values(_et))])}});function Uis(t){let e=new Jkn;for(let r of Kkn(t))e.addValue(r.file,String(r.key),r.value);return e}a(Uis,"configListParser");function Qis(t,e){let r=null,n=[],o=new Map;for(let s of Kkn(t,e))s.key===e&&(n.push(r=s.value),o.has(s.file)||o.set(s.file,[]),o.get(s.file).push(r));return{key:e,paths:Array.from(o.keys()),scopes:o,value:r,values:n}}a(Qis,"configGetParser");function qis(t){return t.replace(/^(file):/,"")}a(qis,"configFilePath");function*Kkn(t,e=null){let r=t.split("\0");for(let n=0,o=r.length-1;nObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=iZ(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let n=this.addFile(t);Object.hasOwn(n,e)?Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]:n[e]=r,this._all=void 0}}}});function GVt(t,e){return typeof t=="string"&&Object.hasOwn(nWt,t)?t:e}a(GVt,"asConfigScope");function His(t,e,r,n){let o=["config",`--${n}`];return r&&o.push("--add"),o.push(t,e),{commands:o,format:"utf-8",parser(s){return s}}}a(His,"addConfigTask");function Gis(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(n){return Qis(n,t)}}}a(Gis,"getConfigTask");function $is(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return Uis(r)}}}a($is,"listConfigTask");function Vis(){return{addConfig(t,e,...r){return this._runTask(His(t,e,r[0]===!0,GVt(r[1],"local")),Xd(arguments))},getConfig(t,e){return this._runTask(Gis(t,GVt(e,void 0)),Xd(arguments))},listConfig(...t){return this._runTask($is(GVt(t[0],void 0)),Xd(arguments))}}}a(Vis,"config_default");var nWt,Zkn=tn({"src/lib/tasks/config.ts"(){"use strict";jis(),co(),nWt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(nWt||{})}});function Wis(t){return Xkn.has(t)}a(Wis,"isDiffNameStatus");var $Vt,Xkn,ePn=tn({"src/lib/tasks/diff-name-status.ts"(){"use strict";$Vt=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))($Vt||{}),Xkn=new Set(Object.values($Vt))}});function zis(...t){return new rPn().param(...t)}a(zis,"grepQueryBuilder");function Yis(t){let e=new Set,r={};return pWt(t,n=>{let[o,s,c]=n.split(Bde);e.add(o),(r[o]=r[o]||[]).push({line:Pu(s),path:o,preview:c})}),{paths:e,results:r}}a(Yis,"parseGrep");function Kis(){return{grep(t){let e=Xd(arguments),r=hv(arguments);for(let o of tPn)if(r.includes(o))return this._runTask(_b(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=zis().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return Yis(o)}},e)}}}a(Kis,"grep_default");var tPn,YRe,jRn,rPn,nPn=tn({"src/lib/tasks/grep.ts"(){"use strict";co(),ph(),tPn=["-h"],YRe=Symbol("grepQuery"),rPn=class{static{a(this,"GrepQuery")}constructor(){this[jRn]=[]}*[(jRn=YRe,Symbol.iterator)](){for(let t of this[YRe])yield t}and(...t){return t.length&&this[YRe].push("--and","(",...KRe(t,"-e"),")"),this}param(...t){return this[YRe].push(...KRe(t,"-e")),this}}}}),iPn={};_m(iPn,{ResetMode:a(()=>Eet,"ResetMode"),getResetMode:a(()=>Zis,"getResetMode"),resetTask:a(()=>Jis,"resetTask")});function Jis(t,e){let r=["reset"];return oPn(t)&&r.push(`--${t}`),r.push(...e),mv(r)}a(Jis,"resetTask");function Zis(t){if(oPn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(Zis,"getResetMode");function oPn(t){return typeof t=="string"&&sPn.includes(t)}a(oPn,"isValidResetMode");var Eet,sPn,aPn=tn({"src/lib/tasks/reset.ts"(){"use strict";co(),ph(),Eet=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(Eet||{}),sPn=Qde(Object.values(Eet))}});function Xis(){return(0,Iet.default)("simple-git")}a(Xis,"createLog");function HRn(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(n,...o)=>{t(n,...o),r(n,...o)}:t:(n,...o)=>{t(`%s ${n}`,e,...o),r&&r(n,...o)}}a(HRn,"prefixedLogger");function eos(t,e,{namespace:r}){if(typeof t=="string")return t;let n=e&&e.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}a(eos,"childLoggerName");function bWt(t,e,r,n=Xis()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=eos(k_(e,yp),c,n);return d(r);function u(f,h){return Ow(s,bWt(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&&HRn(c,h)||oZ,g=HRn(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(bWt,"createLogger");var cPn=tn({"src/lib/git-logger.ts"(){"use strict";co(),Iet.default.formatters.L=t=>String(Det(t)?t.length:"-"),Iet.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):eke(t)}}),lPn,tos=tn({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Ej(),cPn(),lPn=class iWt{static{a(this,"_TasksPendingQueue")}constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let r=iWt.getName(e.commands[0]),n=bWt(this.logLabel,r);return{task:e,logger:n,name:r}}push(e){let r=this.createProgress(e);return r.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,r),r}fatal(e){for(let[r,{logger:n}]of Array.from(this._queue.entries()))r===e.task?(n.info("Failed %o",e),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(r);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let r=this.withProgress(e);if(!r)throw new UF(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++iWt.counter}`}static{this.counter=0}}}});function nZ(t,e){return{method:Skn(t.commands)||"",commands:e}}a(nZ,"pluginContext");function ros(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(ros,"onErrorReceived");function GRn(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(GRn,"onDataReceived");var oWt,nos=tn({"src/lib/runners/git-executor-chain.ts"(){"use strict";Ej(),ph(),co(),tos(),oWt=class{static{a(this,"GitExecutorChain")}constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new lPn}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),r=a(()=>this._queue.complete(t),"onQueueComplete");try{let{logger:n}=this._queue.attempt(t);return await(Vkn(t)?this.attemptEmptyTask(t,n):this.attemptRemoteTask(t,n))}catch(n){throw this.onFatalException(t,n)}finally{r(),e()}}onFatalException(t,e){let r=e instanceof UF?Object.assign(e,{task:t}):new UF(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(t,e){let r=this._plugins.exec("spawn.binary","",nZ(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...nZ(t,t.commands),env:{...this.env}}),o=await this.gitResponse(t,r,n,this.outputHandler,e.step("SPAWN")),s=await this.handleTaskData(t,n,o,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),$kn(t)?eWt(t.parser,s):eWt(t.parser,s.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,r,n){let{exitCode:o,rejection:s,stdOut:c,stdErr:l}=r;return new Promise((u,d)=>{n("Preparing to handle process response exitCode=%d stdOut=",o);let{error:f}=this._plugins.exec("task.error",{error:s},{...nZ(t,e),...r});if(f&&t.onError)return n.info("exitCode=%s handling with custom error handler"),t.onError(r,f,h=>{n.info("custom error handler treated as success"),n("custom error returned a %s",eke(h)),u(new Tet(Array.isArray(h)?Buffer.concat(h):h,Buffer.concat(l)))},d);if(f)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",o,l.length,s),d(f);n.info("retrieving task output complete"),u(new Tet(Buffer.concat(c),Buffer.concat(l)))})}async gitResponse(t,e,r,n,o){let s=o.sibling("output"),c=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},nZ(t,t.commands));return new Promise(l=>{let u=[],d=[];o.info("%s %o",e,r),o("%O",c);let f=this._beforeSpawn(t,r);if(f)return l({stdOut:u,stdErr:d,exitCode:9901,rejection:f});this._plugins.exec("spawn.before",void 0,{...nZ(t,r),kill(m){f=m||f}});let h=(0,uPn.spawn)(e,r,c);h.stdout.on("data",GRn(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",GRn(d,"stdErr",o,s.step("stdErr"))),h.on("error",ros(d,o)),n&&(o("Passing child process stdOut/stdErr to custom outputHandler"),n(e,h.stdout,h.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...nZ(t,r),spawned:h,close(m,g){l({stdOut:u,stdErr:d,exitCode:m,rejection:f||g})},kill(m){h.killed||(f=m,h.kill("SIGINT"))}})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,{...nZ(t,e),kill(n){r=n||r}}),r}}}}),dPn={};_m(dPn,{GitExecutor:a(()=>fPn,"GitExecutor")});var fPn,ios=tn({"src/lib/runners/git-executor.ts"(){"use strict";nos(),fPn=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new oWt(this,this._scheduler,this._plugins)}chain(){return new oWt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function oos(t,e,r=oZ){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof ZRe?sos(s):s,void 0)},"onError2");e.then(n,o)}a(oos,"taskCallback");function sos(t){let e=a(n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),e=oZ},"log");return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(n,o){return o in t||(n[o]={enumerable:!1,configurable:!1,get(){return e(o),t.git[o]}}),n}}a(sos,"addDeprecationNoticeToError");var aos=tn({"src/lib/task-callback.ts"(){"use strict";Ude(),co()}});function $Rn(t,e){return Hkn(r=>{if(!hWt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a($Rn,"changeWorkingDirectoryTask");var cos=tn({"src/lib/tasks/change-working-directory.ts"(){"use strict";co(),ph()}});function VVt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=Ret(e,"-B")),mv(e)}a(VVt,"checkoutTask");function los(){return{checkout(){return this._runTask(VVt(hv(arguments,1)),Xd(arguments))},checkoutBranch(t,e){return this._runTask(VVt(["-b",t,e,...hv(arguments)]),Xd(arguments))},checkoutLocalBranch(t){return this._runTask(VVt(["-b",t,...hv(arguments)]),Xd(arguments))}}}a(los,"checkout_default");var uos=tn({"src/lib/tasks/checkout.ts"(){"use strict";co(),ph()}});function dos(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(dos,"countObjectsResponse");function fos(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return Eb(dos(),[pPn],t)}})}}}a(fos,"count_objects_default");var pPn,pos=tn({"src/lib/tasks/count-objects.ts"(){"use strict";co(),pPn=new Do(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=xkn(e);Object.hasOwn(t,n)&&(t[n]=Pu(r))})}});function hos(t){return Eb({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},hPn,t)}a(hos,"parseCommitResult");var hPn,mos=tn({"src/lib/parsers/parse-commit.ts"(){"use strict";co(),hPn=[new Do(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new Do(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),n=r.pop();!n||!n.includes("@")||(t.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new Do(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(n,10)||0}),new Do(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0;let o=parseInt(r,10)||0;n==="-"?t.summary.deletions=o:n==="+"&&(t.summary.insertions=o)})]}});function gos(t,e,r){return{commands:["-c","core.abbrev=40","commit",...KRe(t,"-m"),...e,...r],format:"utf-8",parser:hos}}a(gos,"commitTask");function Aos(){return{commit(e,...r){let n=Xd(arguments),o=t(e)||gos(S5(e),S5(k_(r[0],bet,[])),[...Qde(k_(r[1],tke,[])),...hv(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!bet(e)&&_b("git.commit: requires the commit message to be supplied as a string/string[]")}}a(Aos,"commit_default");var yos=tn({"src/lib/tasks/commit.ts"(){"use strict";mos(),co(),ph()}});function _os(){return{firstCommit(){return this._runTask(mv(["rev-list","--max-parents=0","HEAD"],!0),Xd(arguments))}}}a(_os,"first_commit_default");var Eos=tn({"src/lib/tasks/first-commit.ts"(){"use strict";co(),ph()}});function vos(t,e){let r=["hash-object",t];return e&&r.push("-w"),mv(r,!0)}a(vos,"hashObjectTask");var Cos=tn({"src/lib/tasks/hash-object.ts"(){"use strict";ph()}});function bos(t,e,r){let n=String(r).trim(),o;if(o=mPn.exec(n))return new vet(t,e,!1,o[1]);if(o=gPn.exec(n))return new vet(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new vet(t,e,/^re/i.test(n),s)}a(bos,"parseInit");var vet,mPn,gPn,Sos=tn({"src/lib/responses/InitSummary.ts"(){"use strict";vet=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},mPn=/^Init.+ repository in (.+)$/,gPn=/^Rein.+ in (.+)$/}});function Tos(t){return t.includes(SWt)}a(Tos,"hasBareCommand");function Ios(t=!1,e,r){let n=["init",...r];return t&&!Tos(n)&&n.splice(1,0,SWt),{commands:n,format:"utf-8",parser(o){return bos(n.includes("--bare"),e,o)}}}a(Ios,"initTask");var SWt,xos=tn({"src/lib/tasks/init.ts"(){"use strict";Sos(),SWt="--bare"}});function TWt(t){for(let e=0;eEb(new APn,e,r,!1)}a(yPn,"getDiffParser");var WVt,VRn,WRn,zRn,_Pn,EPn=tn({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";rke(),Ros(),ePn(),co(),WVt=[new Do(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:Pu(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new Do(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:Pu(r),after:Pu(n),binary:!0})}),new Do(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);t.changed=Pu(e),t.insertions=Pu(n?.[1]),t.deletions=Pu(o?.[1])})],VRn=[new Do(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=Pu(e),s=Pu(r);t.changed++,t.insertions+=o,t.deletions+=s,t.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new Do(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],WRn=[new Do(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],zRn=[new Do(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,n,o,s])=>{t.changed++,t.files.push({file:s??n,changes:0,insertions:0,deletions:0,binary:!1,status:JVt(Wis(e)&&e),from:JVt(!!s&&n!==s&&n),similarity:Pu(r)})})],_Pn={"":WVt,"--stat":WVt,"--numstat":VRn,"--name-status":zRn,"--name-only":WRn}}});function kos(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(kos,"lineBuilder");function vPn(t=RWt,e=CPn,r=""){let n=yPn(r);return function(o){let s=XRe(o.trim(),!1,xWt).map(function(c){let l=c.split(wWt),u=kos(l[0].split(t),e);return l.length>1&&l[1].trim()&&(u.diff=n(l[1])),u});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}a(vPn,"createListLogSummaryParser");var xWt,wWt,RWt,CPn,bPn=tn({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";co(),EPn(),rke(),xWt="\xF2\xF2\xF2\xF2\xF2\xF2 ",wWt=" \xF2\xF2",RWt=" \xF2 ",CPn=["hash","date","message","refs","author_name","author_email"]}}),SPn={};_m(SPn,{diffSummaryTask:a(()=>Pos,"diffSummaryTask"),validateLogFormatConfig:a(()=>Oet,"validateLogFormatConfig")});function Pos(t){let e=TWt(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),Oet(r)||{commands:r,format:"utf-8",parser:yPn(e)}}a(Pos,"diffSummaryTask");function Oet(t){let e=t.filter(wos);if(e.length>1)return _b(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return _b(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}a(Oet,"validateLogFormatConfig");var kWt=tn({"src/lib/tasks/diff.ts"(){"use strict";rke(),EPn(),ph()}});function Dos(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(Dos,"prettyFormat");function Nos(t){return Object.keys(t).reduce((e,r)=>(r in sWt||(e[r]=t[r]),e),{})}a(Nos,"userOptions");function TPn(t={},e=[]){let r=k_(t.splitter,yp,RWt),n=Pet(t.format)?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[o,s]=Dos(n,r),c=[],l=[`--pretty=format:${xWt}${s}${wWt}`,...e],u=t.n||t["max-count"]||t.maxCount;if(u&&l.push(`--max-count=${u}`),t.from||t.to){let d=t.symmetric!==!1?"...":"..";c.push(`${t.from||""}${d}${t.to||""}`)}return yp(t.file)&&l.push("--follow",kde(t.file)),gWt(Nos(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(TPn,"parseLogOptions");function Mos(t,e,r){let n=vPn(t,e,TWt(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(Mos,"logTask");function Oos(){return{log(...r){let n=Xd(arguments),o=TPn(AWt(arguments),Qde(k_(arguments[0],tke,[]))),s=e(...r)||Oet(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return Mos(r.splitter,r.fields,r.commands)}function e(r,n){return yp(r)&&yp(n)&&_b("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(Oos,"log_default");var sWt,IPn=tn({"src/lib/tasks/log.ts"(){"use strict";rke(),bPn(),co(),ph(),kWt(),sWt=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(sWt||{})}}),Cet,xPn,Los=tn({"src/lib/responses/MergeSummary.ts"(){"use strict";Cet=class{static{a(this,"MergeSummaryConflict")}constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},xPn=class{static{a(this,"MergeSummaryDetail")}constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),aWt,wPn,Bos=tn({"src/lib/responses/PullSummary.ts"(){"use strict";aWt=class{static{a(this,"PullSummary")}constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},wPn=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function zVt(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}a(zVt,"objectEnumerationResult");function YRn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:Pu(e&&e[1]||"0"),delta:Pu(r&&r[1]||"0")}}a(YRn,"asObjectCount");var RPn,Fos=tn({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";co(),RPn=[new _j(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=zVt(t.remoteMessages);Object.assign(o,{[n]:Pu(r)})}),new _j(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=zVt(t.remoteMessages);Object.assign(o,{[n]:Pu(r)})}),new _j(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=zVt(t.remoteMessages);o.total=YRn(e),o.reused=YRn(r),o.packReused=Pu(n)})]}});function kPn(t,e){return Eb({remoteMessages:new DPn},PPn,e)}a(kPn,"parseRemoteMessages");var PPn,DPn,NPn=tn({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";co(),Fos(),PPn=[new _j(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...RPn,new _j([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new _j([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:Pu(e),summary:r,url:n}})],DPn=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function Uos(t,e){let r=Eb(new wPn,MPn,[t,e]);return r.message&&r}a(Uos,"parsePullErrorResult");var KRn,JRn,ZRn,XRn,MPn,ekn,PWt,OPn=tn({"src/lib/parsers/parse-pull.ts"(){"use strict";Bos(),co(),NPn(),KRn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,JRn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,ZRn=/^(create|delete) mode \d+ (.+)/,XRn=[new Do(KRn,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new Do(JRn,(t,[e,,r,,n])=>r!==void 0||n!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+n||0,!0):!1),new Do(ZRn,(t,[e,r])=>{Ow(t.files,r),Ow(e==="create"?t.created:t.deleted,r)})],MPn=[new Do(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new Do(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new Do(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,n,o])=>{t.branch.local=n,t.hash.local=e,t.branch.remote=o,t.hash.remote=r})],ekn=a((t,e)=>Eb(new aWt,XRn,[t,e]),"parsePullDetail"),PWt=a((t,e)=>Object.assign(new aWt,ekn(t,e),kPn(t,e)),"parsePullResult")}}),tkn,LPn,rkn,Qos=tn({"src/lib/parsers/parse-merge.ts"(){"use strict";Los(),co(),OPn(),tkn=[new Do(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new Do(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new Cet(e,r))}),new Do(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new Cet(e,r,{deleteRef:n}))}),new Do(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new Cet(e,null))}),new Do(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],LPn=a((t,e)=>Object.assign(rkn(t,e),PWt(t,e)),"parseMergeResult"),rkn=a(t=>Eb(new xPn,tkn,t),"parseMergeDetail")}});function nkn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=LPn(e,r);if(n.failed)throw new ZRe(n);return n}}:_b("Git.merge requires at least one option")}a(nkn,"mergeTask");var qos=tn({"src/lib/tasks/merge.ts"(){"use strict";Ude(),Qos(),ph()}});function jos(t,e,r){let n=r.includes("deleted"),o=r.includes("tag")||/^refs\/tags/.test(t),s=!r.includes("new");return{deleted:n,tag:o,branch:!o,new:!s,alreadyUpdated:s,local:t,remote:e}}a(jos,"pushResultPushedItem");var ikn,BPn,okn,Hos=tn({"src/lib/parsers/parse-push.ts"(){"use strict";co(),NPn(),ikn=[new Do(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new Do(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new Do(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(jos(e,r,n))}),new Do(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:n}}),new Do(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,n,o])=>{t.update={head:{local:e,remote:r},hash:{from:n,to:o}}})],BPn=a((t,e)=>{let r=okn(t,e),n=kPn(t,e);return{...r,...n}},"parsePushResult"),okn=a((t,e)=>Eb({pushed:[]},ikn,[t,e]),"parsePushDetail")}}),FPn={};_m(FPn,{pushTagsTask:a(()=>Gos,"pushTagsTask"),pushTask:a(()=>DWt,"pushTask")});function Gos(t={},e){return Ow(e,"--tags"),DWt(t,e)}a(Gos,"pushTagsTask");function DWt(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),Ret(r,"-v"),Ow(r,"--verbose"),Ow(r,"--porcelain"),{commands:r,format:"utf-8",parser:BPn}}a(DWt,"pushTask");var UPn=tn({"src/lib/tasks/push.ts"(){"use strict";Hos(),co()}});function $os(){return{showBuffer(){let t=["show",...hv(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(Gkn(t),Xd(arguments))},show(){let t=["show",...hv(arguments,1)];return this._runTask(mv(t),Xd(arguments))}}}a($os,"show_default");var Vos=tn({"src/lib/tasks/show.ts"(){"use strict";co(),ph()}}),skn,QPn,Wos=tn({"src/lib/responses/FileStatusSummary.ts"(){"use strict";skn=/^(.+)\0(.+)$/,QPn=class{static{a(this,"FileStatusSummary")}constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let n=skn.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function akn(t){let[e,r]=t.split(Bde);return{from:r||e,to:e}}a(akn,"renamedFile");function TT(t,e,r){return[`${t}${e}`,r]}a(TT,"parser3");function YVt(t,...e){return e.map(r=>TT(t,r,(n,o)=>n.conflicted.push(o)))}a(YVt,"conflicts");function zos(t,e){let r=e.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return n(" ",r.charAt(0),r.slice(2));default:return}function n(o,s,c){let l=`${o}${s}`,u=qPn.get(l);u&&u(t,c),l!=="##"&&l!=="!!"&&t.files.push(new QPn(c,o,s))}a(n,"data")}a(zos,"splitLine");var ckn,qPn,jPn,Yos=tn({"src/lib/responses/StatusSummary.ts"(){"use strict";co(),Wos(),ckn=class{static{a(this,"StatusSummary")}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}},qPn=new Map([TT(" ","A",(t,e)=>t.created.push(e)),TT(" ","D",(t,e)=>t.deleted.push(e)),TT(" ","M",(t,e)=>t.modified.push(e)),TT("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),TT("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),TT("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),TT("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),TT("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),TT("R"," ",(t,e)=>{t.renamed.push(akn(e))}),TT("R","M",(t,e)=>{let r=akn(e);t.renamed.push(r),t.modified.push(r.to)}),TT("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),TT("?","?",(t,e)=>t.not_added.push(e)),...YVt("A","A","U"),...YVt("D","D","U"),...YVt("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,o=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,c=/\son\s(\S+?)(?=\.{3}|$)/,l=r.exec(e);t.ahead=l&&+l[1]||0,l=n.exec(e),t.behind=l&&+l[1]||0,l=o.exec(e),t.current=k_(l?.[1],yp,null),l=s.exec(e),t.tracking=k_(l?.[1],yp,null),l=c.exec(e),l&&(t.current=k_(l?.[1],yp,t.current)),t.detached=/\(no branch\)/.test(e)}]]),jPn=a(function(t){let e=t.split(Bde),r=new ckn;for(let n=0,o=e.length;n!HPn.includes(r))],parser(r){return jPn(r)}}}a(Kos,"statusTask");var HPn,Jos=tn({"src/lib/tasks/status.ts"(){"use strict";Yos(),HPn=["--null","-z"]}});function xet(t=0,e=0,r=0,n="",o=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:n,installed:o},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}a(xet,"versionResponse");function Zos(){return xet(0,0,0,"",!1)}a(Zos,"notInstalledResponse");function Xos(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:ess,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(NWt));n(e)}})}}}a(Xos,"version_default");function ess(t){return t===NWt?Zos():Eb(xet(0,0,0,t),GPn,t)}a(ess,"versionParser");var NWt,GPn,tss=tn({"src/lib/tasks/version.ts"(){"use strict";co(),NWt="installed=false",GPn=[new Do(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,xet(Pu(e),Pu(r),Pu(n),o))}),new Do(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,xet(Pu(e),Pu(r),n,o))})]}});function lkn(t,e,r,...n){return yp(r)?e(r,k_(n[0],yp),hv(arguments)):_b(`git.${t}() requires a string 'repoPath'`)}a(lkn,"createCloneTask");function rss(){return{clone(t,...e){return this._runTask(lkn("clone",cWt,k_(t,yp),...e),Xd(arguments))},mirror(t,...e){return this._runTask(lkn("mirror",$Pn,k_(t,yp),...e),Xd(arguments))}}}a(rss,"clone_default");var cWt,$Pn,nss=tn({"src/lib/tasks/clone.ts"(){"use strict";ph(),co(),cWt=a((t,e,r)=>{let n=["clone",...r];return yp(t)&&n.push(kde(t)),yp(e)&&n.push(kde(e)),mv(n)},"cloneTask"),$Pn=a((t,e,r)=>(Ow(r,"--mirror"),cWt(t,e,r)),"cloneMirrorTask")}}),VPn={};_m(VPn,{SimpleGitApi:a(()=>lWt,"SimpleGitApi")});var lWt,iss=tn({"src/lib/simple-git-api.ts"(){"use strict";aos(),cos(),uos(),pos(),yos(),Zkn(),Eos(),nPn(),Cos(),xos(),IPn(),qos(),UPn(),Vos(),Jos(),ph(),tss(),co(),nss(),lWt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&oos(t,n,e),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(t){return this._runTask(mv(["add",...S5(t)]),Xd(arguments))}cwd(t){let e=Xd(arguments);return typeof t=="string"?this._runTask($Rn(t,this._executor),e):typeof t?.path=="string"?this._runTask($Rn(t.path,t.root&&this._executor||void 0),e):this._runTask(_b("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(vos(t,e===!0),Xd(arguments))}init(t){return this._runTask(Ios(t===!0,this._executor.cwd,hv(arguments)),Xd(arguments))}merge(){return this._runTask(nkn(hv(arguments)),Xd(arguments))}mergeFromTo(t,e){return yp(t)&&yp(e)?this._runTask(nkn([t,e,...hv(arguments)]),Xd(arguments,!1)):this._runTask(_b("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=DWt({remote:k_(arguments[0],yp),branch:k_(arguments[1],yp)},hv(arguments));return this._runTask(t,Xd(arguments))}stash(){return this._runTask(mv(["stash",...hv(arguments)]),Xd(arguments))}status(){return this._runTask(Kos(hv(arguments)),Xd(arguments))}},Object.assign(lWt.prototype,los(),rss(),Aos(),Vis(),fos(),_os(),Kis(),Oos(),$os(),Xos())}}),WPn={};_m(WPn,{Scheduler:a(()=>YPn,"Scheduler")});var ukn,YPn,oss=tn({"src/lib/runners/scheduler.ts"(){"use strict";co(),cPn(),ukn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,zPn.createDeferred)();return{promise:e,done:r,id:t}}})(),YPn=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=bWt("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}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 t=Ow(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),Ret(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=Ow(this.pending,ukn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),KPn={};_m(KPn,{applyPatchTask:a(()=>sss,"applyPatchTask")});function sss(t,e){return mv(["apply",...e,...t])}a(sss,"applyPatchTask");var ass=tn({"src/lib/tasks/apply-patch.ts"(){"use strict";ph()}});function css(t,e){return{branch:t,hash:e,success:!0}}a(css,"branchDeletionSuccess");function lss(t){return{branch:t,hash:null,success:!1}}a(lss,"branchDeletionFailure");var JPn,uss=tn({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";JPn=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function ZPn(t,e){return e===1&&uWt.test(t)}a(ZPn,"hasBranchDeletionError");var dkn,uWt,fkn,Let,dss=tn({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";uss(),co(),dkn=/(\S+)\s+\(\S+\s([^)]+)\)/,uWt=/^error[^']+'([^']+)'/m,fkn=[new Do(dkn,(t,[e,r])=>{let n=css(e,r);t.all.push(n),t.branches[e]=n}),new Do(uWt,(t,[e])=>{let r=lss(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],Let=a((t,e)=>Eb(new JPn,fkn,[t,e]),"parseBranchDeletions")}}),XPn,fss=tn({"src/lib/responses/BranchSummary.ts"(){"use strict";XPn=class{static{a(this,"BranchSummaryResult")}constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,n,o){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:n,label:o}}}}});function pkn(t){return t?t.charAt(0):""}a(pkn,"branchStatus");function e2n(t,e=!1){return Eb(new XPn,e?[r2n]:t2n,t)}a(e2n,"parseBranchSummary");var t2n,r2n,pss=tn({"src/lib/parsers/parse-branch.ts"(){"use strict";fss(),co(),t2n=[new Do(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(pkn(e),!0,r,n,o)}),new Do(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(pkn(e),!1,r,n,o)})],r2n=new Do(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),n2n={};_m(n2n,{branchLocalTask:a(()=>mss,"branchLocalTask"),branchTask:a(()=>hss,"branchTask"),containsDeleteBranchCommand:a(()=>i2n,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>Ass,"deleteBranchTask"),deleteBranchesTask:a(()=>gss,"deleteBranchesTask")});function i2n(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(i2n,"containsDeleteBranchCommand");function hss(t){let e=i2n(t),r=t.includes("--show-current"),n=["branch",...t];return n.length===1&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser(o,s){return e?Let(o,s).all[0]:e2n(o,r)}}}a(hss,"branchTask");function mss(){return{format:"utf-8",commands:["branch","-v"],parser(t){return e2n(t)}}}a(mss,"branchLocalTask");function gss(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return Let(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!ZPn(String(o),r))return c(o);s(n)}}}a(gss,"deleteBranchesTask");function Ass(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return Let(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!ZPn(String(c),n))return u(c);throw new ZRe(r.parser(JRe(s),JRe(o)),String(c))}};return r}a(Ass,"deleteBranchTask");var yss=tn({"src/lib/tasks/branch.ts"(){"use strict";Ude(),dss(),pss(),co()}});function _ss(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,o2n.normalize)(e)}a(_ss,"toPath");var s2n,Ess=tn({"src/lib/responses/CheckIgnore.ts"(){"use strict";s2n=a(t=>t.split(/\n/g).map(_ss).filter(Boolean),"parseCheckIgnore")}}),a2n={};_m(a2n,{checkIgnoreTask:a(()=>vss,"checkIgnoreTask")});function vss(t){return{commands:["check-ignore",...t],format:"utf-8",parser:s2n}}a(vss,"checkIgnoreTask");var Css=tn({"src/lib/tasks/check-ignore.ts"(){"use strict";Ess()}});function bss(t,e){return Eb({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},c2n,[t,e])}a(bss,"parseFetchResult");var c2n,Sss=tn({"src/lib/parsers/parse-fetch.ts"(){"use strict";co(),c2n=[new Do(/From (.+)$/,(t,[e])=>{t.remote=e}),new Do(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new Do(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new Do(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new Do(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,o])=>{t.updated.push({name:n,tracking:o,to:r,from:e})})]}}),l2n={};_m(l2n,{fetchTask:a(()=>Iss,"fetchTask")});function Tss(t){return/^--upload-pack(=|$)/.test(t)}a(Tss,"disallowedCommand");function Iss(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(Tss)?_b("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:bss}}a(Iss,"fetchTask");var xss=tn({"src/lib/tasks/fetch.ts"(){"use strict";Sss(),ph()}});function wss(t){return Eb({moves:[]},u2n,t)}a(wss,"parseMoveResult");var u2n,Rss=tn({"src/lib/parsers/parse-move.ts"(){"use strict";co(),u2n=[new Do(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),d2n={};_m(d2n,{moveTask:a(()=>kss,"moveTask")});function kss(t,e){return{commands:["mv","-v",...S5(t),e],format:"utf-8",parser:wss}}a(kss,"moveTask");var Pss=tn({"src/lib/tasks/move.ts"(){"use strict";Rss(),co()}}),f2n={};_m(f2n,{pullTask:a(()=>Dss,"pullTask")});function Dss(t,e,r){let n=["pull",...r];return t&&e&&n.splice(1,0,t,e),{commands:n,format:"utf-8",parser(o,s){return PWt(o,s)},onError(o,s,c,l){let u=Uos(JRe(o.stdOut),JRe(o.stdErr));if(u)return l(new ZRe(u));l(s)}}}a(Dss,"pullTask");var Nss=tn({"src/lib/tasks/pull.ts"(){"use strict";Ude(),OPn(),co()}});function Mss(t){let e={};return p2n(t,([r])=>e[r]={name:r}),Object.values(e)}a(Mss,"parseGetRemotes");function Oss(t){let e={};return p2n(t,([r,n,o])=>{Object.hasOwn(e,r)||(e[r]={name:r,refs:{fetch:"",push:""}}),o&&n&&(e[r].refs[o.replace(/[^a-z]/g,"")]=n)}),Object.values(e)}a(Oss,"parseGetRemotesVerbose");function p2n(t,e){pWt(t,r=>e(r.split(/\s+/)))}a(p2n,"forEach");var Lss=tn({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";co()}}),h2n={};_m(h2n,{addRemoteTask:a(()=>Bss,"addRemoteTask"),getRemotesTask:a(()=>Fss,"getRemotesTask"),listRemotesTask:a(()=>Uss,"listRemotesTask"),remoteTask:a(()=>Qss,"remoteTask"),removeRemoteTask:a(()=>qss,"removeRemoteTask")});function Bss(t,e,r){return mv(["remote","add",...r,t,e])}a(Bss,"addRemoteTask");function Fss(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?Oss:Mss}}a(Fss,"getRemotesTask");function Uss(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),mv(e)}a(Uss,"listRemotesTask");function Qss(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),mv(e)}a(Qss,"remoteTask");function qss(t){return mv(["remote","remove",t])}a(qss,"removeRemoteTask");var jss=tn({"src/lib/tasks/remote.ts"(){"use strict";Lss(),ph()}}),m2n={};_m(m2n,{stashListTask:a(()=>Hss,"stashListTask")});function Hss(t={},e){let r=TPn(t),n=["stash","list",...r.commands,...e],o=vPn(r.splitter,r.fields,TWt(n));return Oet(n)||{commands:n,format:"utf-8",parser:o}}a(Hss,"stashListTask");var Gss=tn({"src/lib/tasks/stash-list.ts"(){"use strict";rke(),bPn(),kWt(),IPn()}}),g2n={};_m(g2n,{addSubModuleTask:a(()=>$ss,"addSubModuleTask"),initSubModuleTask:a(()=>Vss,"initSubModuleTask"),subModuleTask:a(()=>Bet,"subModuleTask"),updateSubModuleTask:a(()=>Wss,"updateSubModuleTask")});function $ss(t,e){return Bet(["add",t,e])}a($ss,"addSubModuleTask");function Vss(t){return Bet(["init",...t])}a(Vss,"initSubModuleTask");function Bet(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),mv(e)}a(Bet,"subModuleTask");function Wss(t){return Bet(["update",...t])}a(Wss,"updateSubModuleTask");var zss=tn({"src/lib/tasks/sub-module.ts"(){"use strict";ph()}});function Yss(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?A2n(t,e):0}a(Yss,"singleSorted");function A2n(t,e){return t===e?0:t>e?1:-1}a(A2n,"sorted");function Kss(t){return t.trim()}a(Kss,"trimmed");function yet(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(yet,"toNumber");var hkn,y2n,Jss=tn({"src/lib/responses/TagList.ts"(){"use strict";hkn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},y2n=a(function(t,e=!1){let r=t.split(` +`).map(Kss).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return Yss(yet(c[0]),yet(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new hkn(r,n)},"parseTagList")}}),_2n={};_m(_2n,{addAnnotatedTagTask:a(()=>eas,"addAnnotatedTagTask"),addTagTask:a(()=>Xss,"addTagTask"),tagListTask:a(()=>Zss,"tagListTask")});function Zss(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return y2n(r,e)}}}a(Zss,"tagListTask");function Xss(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a(Xss,"addTagTask");function eas(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(eas,"addAnnotatedTagTask");var tas=tn({"src/lib/tasks/tag.ts"(){"use strict";Jss()}}),ras=_is({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(ios(),fh(dPn)),{SimpleGitApi:n}=(iss(),fh(VPn)),{Scheduler:o}=(oss(),fh(WPn)),{adhocExecTask:s,configurationErrorTask:c}=(ph(),fh(rWt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(co(),fh(Mkn)),{applyPatchTask:_}=(ass(),fh(KPn)),{branchTask:E,branchLocalTask:v,deleteBranchesTask:S,deleteBranchTask:T}=(yss(),fh(n2n)),{checkIgnoreTask:w}=(Css(),fh(a2n)),{checkIsRepoTask:R}=(Fkn(),fh(Okn)),{cleanWithOptionsTask:x,isCleanOptionsArray:k}=(Ykn(),fh(Wkn)),{diffSummaryTask:D}=(kWt(),fh(SPn)),{fetchTask:N}=(xss(),fh(l2n)),{moveTask:O}=(Pss(),fh(d2n)),{pullTask:B}=(Nss(),fh(f2n)),{pushTagsTask:q}=(UPn(),fh(FPn)),{addRemoteTask:M,getRemotesTask:L,listRemotesTask:U,remoteTask:j,removeRemoteTask:Q}=(jss(),fh(h2n)),{getResetMode:Y,resetTask:W}=(aPn(),fh(iPn)),{stashListTask:V}=(Gss(),fh(m2n)),{addSubModuleTask:z,initSubModuleTask:ie,subModuleTask:H,updateSubModuleTask:re}=(zss(),fh(g2n)),{addAnnotatedTagTask:le,addTagTask:Le,tagListTask:me}=(tas(),fh(_2n)),{straightThroughBufferTask:Oe,straightThroughStringTask:Te}=(ph(),fh(rWt));function te(ee,K){this._plugins=K,this._executor=new r(ee.baseDir,new o(ee.maxConcurrentProcesses),K),this._trimmed=ee.trimmed}a(te,"Git2"),(te.prototype=Object.create(n.prototype)).constructor=te,te.prototype.customBinary=function(ee){return this._plugins.reconfigure("binary",ee),this},te.prototype.env=function(ee,K){return arguments.length===1&&typeof ee=="object"?this._executor.env=ee:(this._executor.env=this._executor.env||{})[ee]=K,this},te.prototype.stashList=function(ee){return this._runTask(V(y(arguments)||{},u(ee)&&ee||[]),A(arguments))},te.prototype.mv=function(ee,K){return this._runTask(O(ee,K),A(arguments))},te.prototype.checkoutLatestTag=function(ee){var K=this;return this.pull(function(){K.tags(function(he,X){K.checkout(X.latest,ee)})})},te.prototype.pull=function(ee,K,he,X){return this._runTask(B(m(ee,f),m(K,f),g(arguments)),A(arguments))},te.prototype.fetch=function(ee,K){return this._runTask(N(m(ee,f),m(K,f),g(arguments)),A(arguments))},te.prototype.silent=function(ee){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},te.prototype.tags=function(ee,K){return this._runTask(me(g(arguments)),A(arguments))},te.prototype.rebase=function(){return this._runTask(Te(["rebase",...g(arguments)]),A(arguments))},te.prototype.reset=function(ee){return this._runTask(W(Y(ee),g(arguments)),A(arguments))},te.prototype.revert=function(ee){let K=A(arguments);return typeof ee!="string"?this._runTask(c("Commit must be a string"),K):this._runTask(Te(["revert",...g(arguments,0,!0),ee]),K)},te.prototype.addTag=function(ee){let K=typeof ee=="string"?Le(ee):c("Git.addTag requires a tag name");return this._runTask(K,A(arguments))},te.prototype.addAnnotatedTag=function(ee,K){return this._runTask(le(ee,K),A(arguments))},te.prototype.deleteLocalBranch=function(ee,K,he){return this._runTask(T(ee,typeof K=="boolean"?K:!1),A(arguments))},te.prototype.deleteLocalBranches=function(ee,K,he){return this._runTask(S(ee,typeof K=="boolean"?K:!1),A(arguments))},te.prototype.branch=function(ee,K){return this._runTask(E(g(arguments)),A(arguments))},te.prototype.branchLocal=function(ee){return this._runTask(v(),A(arguments))},te.prototype.raw=function(ee){let K=!Array.isArray(ee),he=[].slice.call(K?arguments:ee,0);for(let de=0;deconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},te.prototype.checkIgnore=function(ee,K){return this._runTask(w(l(m(ee,h,[]))),A(arguments))},te.prototype.checkIsRepo=function(ee,K){return this._runTask(R(m(ee,f)),A(arguments))},e.exports=te}});Ej();var nas=class extends UF{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};Ej();Ej();var Fde=class extends UF{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};Ude();Ekn();Fkn();Ykn();Zkn();ePn();nPn();aPn();function ias(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new Fde(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new Fde(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(ias,"abortPlugin");function oas(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of qRn(e,r))if(t[n.category]!==!0)throw new Fde(void 0,"unsafe",n.message);return e}}}a(oas,"blockUnsafeOperationsPlugin");co();function sas(t){let e=KRe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(sas,"commandConfigPrefixingPlugin");co();var mkn=(0,Lde.deferred)().promise;function aas({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,Lde.deferred)(),closeTimeout:(0,Lde.deferred)(),exit:(0,Lde.deferred)(),exitTimeout:(0,Lde.deferred)()},c=Promise.race([t===!1?mkn:s.closeTimeout.promise,e===!1?mkn:s.exitTimeout.promise]);return n(t,s.close,s.closeTimeout),n(e,s.exit,s.exitTimeout),{close(l){o=l,s.close.done()},exit(l){o=l,s.exit.done()},get exitCode(){return o},result:c}}a(r,"createEvents");function n(o,s,c){o!==!1&&(o===!0?s.promise:s.promise.then(()=>KVt(o))).then(c.done)}return a(n,"configureTimeout"),{type:"spawn.after",async action(o,{spawned:s,close:c}){let l=r(),u=!0,d=a(()=>{u=!1},"quickClose");s.stdout?.on("data",d),s.stderr?.on("data",d),s.on("error",d),s.on("close",f=>l.close(f)),s.on("exit",f=>l.exit(f));try{await l.result,u&&await KVt(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(aas,"completionDetectionPlugin");co();var cas="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",gkn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function las(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}a(las,"isBadArgument");function Akn(t,e){if(t.length<1||t.length>2)throw new Fde(void 0,"binary",cas);if(t.some(las))if(e)console.warn(gkn);else throw new Fde(void 0,"binary",gkn);let[n,o]=t;return{binary:n,prefix:o}}a(Akn,"toBinaryConfig");function uas(t,e=["git"],r=!1){let n=Akn(S5(e),r);t.on("binary",o=>{n=Akn(S5(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(uas,"customBinaryPlugin");Ej();function das(t){return!!(t.exitCode&&t.stdErr.length)}a(das,"isTaskError");function fas(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(fas,"getErrorMessage");function pas(t=!1,e=das,r=fas){return(n,o)=>!t&&n||!e(o)?n:r(o)}a(pas,"errorDetectionHandler");function ykn(t){return{type:"task.error",action(e,r){let n=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new UF(void 0,n.toString("utf-8"))}:{error:n}}}}a(ykn,"errorDetectionPlugin");co();var has=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new E2n.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=Ow(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return S5(t).forEach(r=>r&&this.plugins.add(Ow(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let n=e,o=Object.freeze(Object.create(r));for(let s of this.plugins)s.type===t&&(n=s.action(n,o));return n}};co();function mas(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?Ikn(s,e):s}},{type:"spawn.after",action(s,c){c.commands.includes(e)&&c.spawned.stderr?.on("data",l=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));u&&t({method:c.method,stage:gas(u[1]),progress:Pu(u[2]),processed:Pu(u[3]),total:Pu(u[4])})})}}]}a(mas,"progressMonitorPlugin");function gas(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(gas,"progressEventStage");co();function Aas(t){let e=wkn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(Aas,"spawnOptionsPlugin");function yas({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(n,o){let s;function c(){s&&clearTimeout(s),s=setTimeout(u,t)}a(c,"wait");function l(){o.spawned.stdout?.off("data",c),o.spawned.stderr?.off("data",c),o.spawned.off("exit",l),o.spawned.off("close",l),s&&clearTimeout(s)}a(l,"stop");function u(){l(),o.kill(new Fde(void 0,"timeout","block timeout reached"))}a(u,"kill"),r&&o.spawned.stdout?.on("data",c),e&&o.spawned.stderr?.on("data",c),o.spawned.on("exit",l),o.spawned.on("close",l),c()}}}a(yas,"timeoutPlugin");function _as(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;oDw(c)&&Pde(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a(_as,"suffixPathsPlugin");co();var Eas=ras();function vas(t,e){let r=new has,n=Dkn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!hWt(n.baseDir))throw new nas(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(sas(n.config)),r.add(oas(n.unsafe)),r.add(aas(n.completion)),n.abort&&r.add(ias(n.abort)),n.progress&&r.add(mas(n.progress)),n.timeout&&r.add(yas(n.timeout)),n.spawnOptions&&r.add(Aas(n.spawnOptions)),r.add(_as()),r.add(ykn(pas(!0))),n.errors&&r.add(ykn(n.errors)),uas(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new Eas(n,r)}a(vas,"gitInstanceFactory");Ude();var qde=vas;var Lw=new pe("Git Service");var Fet=class t{constructor(e){this.ctx=e;this.gitInstances=new Map;this._upstreamCache=new Map}static{a(this,"GitService")}static{this._upstreamCacheTtlMs=300*1e3}async getGitInstance(e){let r=this.normalizeRepoPath(e),n=this.gitInstances.get(r);if(!n){let o=(await jO()).path;n=qde({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,C2n.join)(n,r);return Ko(o)}parseStatus(e){switch(e){case"M":return 2;case"A":return 0;case"D":return 3;case"R":return 1;default:return 2}}parseDiffOutput(e,r){let n=[],o=r.split("\0").filter(s=>s.length>0);for(let s=0;s=o.length){Lw.warn(this.ctx,`Malformed git diff output: rename status without both paths at position ${s}. Output: ${r}`);continue}let f=o[s+1],h=o[s+2];if(!f||!h){Lw.warn(this.ctx,`Malformed git diff output: empty path(s) for rename at position ${s}. Paths: [${f}, ${h}]. Output: ${r}`);continue}let m=this.constructFileUri(e,f),g=this.constructFileUri(e,h);n.push({uri:g,originalUri:m,renameUri:g,status:1}),s+=2}else{if(s+1>=o.length){Lw.warn(this.ctx,`Malformed git diff output: status without path at position ${s}. Status: ${u}. Output: ${r}`);continue}let f=o[s+1];if(!f){Lw.warn(this.ctx,`Malformed git diff output: empty file path at position ${s}. Status: ${u}. Output: ${r}`);continue}let h=this.constructFileUri(e,f);n.push({uri:h,originalUri:h,renameUri:void 0,status:d}),s+=1}}return n}async diffWith(e,r){try{let o=await(await this.getGitInstance(e)).raw(["diff","--name-status","-z","--diff-filter=ADMR",r,"--"]);return!o||o.trim().length===0?[]:this.parseDiffOutput(e,o)}catch(n){Lw.warn(this.ctx,`Failed to diff with ${r} for ${e}`,n);return}}async hasUpstream(e){let r=this.normalizeRepoPath(e),n=this._upstreamCache.get(r),o=Date.now();if(n&&o-n.checkedAt0}catch(o){return Lw.warn(this.ctx,`Failed to query upstream config for ${e}`,o),!1}}clearUpstreamCache(e){e?this._upstreamCache.delete(this.normalizeRepoPath(e)):this._upstreamCache.clear()}async diffWithIndexedCommit(e,r){try{if(r){let o=await this.diffWith(e,r);if(o)return{changes:o,mayBeOutdated:!1};Lw.warn(this.ctx,`Failed to diff with indexed commit ${r}, falling back to upstream`)}if(!await this.hasUpstream(e)){Lw.debug(this.ctx,`No upstream branch configured for ${e}, cannot determine changes`);return}let n=await this.diffWith(e,"@{upstream}");return n?{changes:n,mayBeOutdated:!0}:void 0}catch(n){Lw.warn(this.ctx,`Failed to diff with indexed commit for ${e}`,n);return}}normalizeRepoPath(e){if(e.startsWith("file://"))try{return(0,v2n.fileURLToPath)(e)}catch(r){Lw.warn(this.ctx,`Failed to convert URI to path: ${e}, attempting fallback`,r);try{let n=new URL(e),o=decodeURIComponent(n.pathname);return process.platform==="win32"&&/^\/[a-zA-Z]:/.test(o)&&(o=o.slice(1).replace(/\//g,"\\")),o}catch(n){return Lw.error(this.ctx,`Failed to parse URI with fallback: ${e}`,n),e}}return e}dispose(){this.gitInstances.clear(),this._upstreamCache.clear()}};var Qet=fe(pl());var vb=new pe("Local Diff Tracker"),b2n=15e3;var Uet=class t{constructor(e,r,n){this.ctx=e;this._workspaceFileIndex=r;this._githubCodeSearchService=n;this._repos=new Map;this._locallyChangedFiles=new Set;this._fileWatcherDisposables=[];this._isDisposed=!1;this._gitService=new Fet(e),this._repositoryManager=e.get(Pf),this._diffRefreshTimer=new Qet.IntervalTimer}static{a(this,"CodeSearchWorkspaceDiffTracker")}static{this._diffRefreshInterval=1e3*60*2}static{this._diffRefreshMaxInterval=1e3*60*30}static{this._maxDiffFiles=1e4}async initialize(){return this._initializePromise??=this.doInitialize(),this._initializePromise}async doInitialize(){try{vb.info(this.ctx,"Initializing Local Diff Tracker");let e=await this.awaitWorkspaceFileIndex();if(this._isDisposed)return;let r=a(o=>{for(let s of o)this._locallyChangedFiles.add(s)},"addFiles");this._fileWatcherDisposables.push(this._workspaceFileIndex.onDidCreateFiles(r),this._workspaceFileIndex.onDidChangeFiles(r),this._workspaceFileIndex.onDidDeleteFiles(o=>{for(let s of o)this._locallyChangedFiles.delete(s)})),!await this.tryOpenRepo()&&!e&&this.retryOpenRepoWhenIndexReady()}catch(e){vb.error(this.ctx,"Initialization failed",e)}}async awaitWorkspaceFileIndex(){let e=await(0,Qet.raceTimeout)(this._workspaceFileIndex.initialize().then(()=>!0),b2n);return e||vb.warn(this.ctx,"Workspace file index bootstrap exceeded budget; continuing with a partial index",{budgetMs:b2n}),e===!0}async tryOpenRepo(){let e=await this._repositoryManager.getRepo({uri:this._workspaceFileIndex.workspaceFolder.uri});return e||(e=await this.tryInferRepoFromFiles()),e&&e.isGitHub()&&e.owner&&e.name?(await this.openRepo(e),!0):(vb.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`),!1)}retryOpenRepoWhenIndexReady(){this._workspaceFileIndex.initialize().then(async()=>{this._isDisposed||this._repos.size||(vb.info(this.ctx,"Workspace file index finished after the budget; retrying repo lookup"),await this.tryOpenRepo())}).catch(e=>vb.error(this.ctx,"Retrying repo lookup failed",e))}async tryInferRepoFromFiles(){try{let e=Array.from(this._workspaceFileIndex.values());if(e.length===0)return;for(let r=0;r{this.refreshRepoDiffs()},t._diffRefreshInterval),await this.refreshRepoDiff(n)}async tryGetDiffedIndexedFiles(e,r){let n=await this.tryGetDiff(e,r);if(!n)return;let o=new Set,s=n.changes.slice(0,t._maxDiffFiles);for(let c of s){let l=c.uri;this._workspaceFileIndex.get(l)&&o.add(l)}return o}async tryGetDiff(e,r){try{let n=e.baseFolder.uri,o=await this._gitService.diffWithIndexedCommit(n,r);return o?{changes:o.changes,mayBeOutdated:o.mayBeOutdated}:void 0}catch(n){vb.error(this.ctx,`Failed to get diff for ${e.baseFolder.uri}`,n);return}}async refreshRepoDiffs(){let e=Date.now(),r=Array.from(this._repos.values(),n=>n).filter(n=>n.nextRefreshAt<=e);await Promise.all(r.map(n=>this.refreshRepoDiff(n)))}getNextRefreshDelay(e){if(e<=0)return t._diffRefreshInterval;let r=Math.min(e,5),n=t._diffRefreshInterval*Math.pow(2,r);return Math.min(n,t._diffRefreshMaxInterval)}async refreshRepoDiff(e){try{let r=this._githubCodeSearchService.getIndexedCommit(e.repo.baseFolder.uri),n=await this.tryGetDiffedIndexedFiles(e.repo,r);if(n){e.initialChanges.clear();for(let c of n)e.initialChanges.add(c);let o=e.repo.baseFolder.uri,s=[];for(let c of this._locallyChangedFiles)if(c.startsWith(o)){let l=this._workspaceFileIndex.get(c);(!l||!l.isDirty())&&s.push(c)}for(let c of s)this._locallyChangedFiles.delete(c);(e.state===1||e.consecutiveFailures>0)&&vb.info(this.ctx,`Diff refresh recovered for ${e.repo.baseFolder.uri}`),e.state=2,e.consecutiveFailures=0,e.lastErrorKey=void 0}else this.handleDiffFailure(e,"no-diff",`Failed to get new diff for ${e.repo.baseFolder.uri}.`)}catch(r){this.handleDiffFailure(e,"exception",`Failed to refresh diff for ${e.repo.baseFolder.uri}.`,r)}finally{e.nextRefreshAt=Date.now()+this.getNextRefreshDelay(e.consecutiveFailures)}}handleDiffFailure(e,r,n,o){e.state=1,e.consecutiveFailures++;let s=e.lastErrorKey!==r;e.lastErrorKey=r,s?o!==void 0?vb.warn(this.ctx,n,o):vb.warn(this.ctx,n):o!==void 0?vb.debug(this.ctx,n,o):vb.debug(this.ctx,n)}dispose(){this._isDisposed=!0,this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var vj;(n=>{function t(o){return new MWt(o)}n.ok=t,a(t,"ok");function e(o){return new OWt(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(vj||={});var MWt=class t{constructor(e){this.val=e}static{a(this,"ResultOk")}map(e){return new t(e(this.val))}flatMap(e){return e(this.val)}isOk(){return!0}isError(){return!1}},OWt=class{constructor(e){this.err=e}static{a(this,"ResultError")}map(e){return this}flatMap(e){return this}isOk(){return!1}isError(){return!0}};var LWt=new pe("GithubAvailableEmbeddingTypes"),qet=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Qt).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):vj.error({type:"noSession"}))}static{a(this,"GithubAvailableEmbeddingTypesManager")}async getAllAvailableTypes(){if(this._cached){let e=this._cached;try{let r=await this._cached;if(r.isOk())return r}catch{}this._cached===e&&(this._cached=void 0)}return this._cached??=(async()=>{let e=await this._ctx.get(Qt).getGitHubSession();return e?await this.doGetAvailableTypes(e):vj.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=wde(this._ctx);r=await $d(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return LWt.error(this._ctx,"Error fetching available embedding types",c),vj.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?vj.error({type:"unauthorized",status:r.status}):vj.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new hb(c.id);c.active===!1?s.push(l):o.push(l)}return vj.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){LWt.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return LWt.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var Cas=new pe("GithubEmbeddingComputer"),jde=class{constructor(e){this.ctx=e;this.batchSize=100}static{a(this,"GithubEmbeddingComputer")}async computeEmbeddings(e,r,n,o){try{let s=await this.ctx.get(Qt).getGitHubSession();if(!s)throw new Error("No GitHub session available");let c=[],l;for(let u=0;u0&&(l=f[0].type),c.push(...f)}if(!l)throw new Error("No embedding type resolved from API response");return{type:l,values:c}}catch(s){Cas.error(this.ctx,"Error computing embeddings:",s);return}}async fetchBatchEmbeddings(e,r,n,o,s){try{let c={inputs:n};if(r&&(c.embedding_model=r.id),o?.inputType&&(c.input_type=o.inputType),s?.isCancellationRequested)return;let l=await $d(this.ctx,e,"embeddings",{method:"POST",json:c});if(!l.ok)throw new Error(`Error fetching embeddings: ${l.status}. ${await l.text()}`);let u=await l.json(),d=new hb(u.embedding_model);if(r&&!d.equals(r))throw new Error(`Unexpected embedding model. Got: ${d.id}. Expected: ${r.id}`);if(n.length!==u.embeddings.length)throw new Error(`Mismatched embedding result count. Expected: ${n.length}. Got: ${u.embeddings.length}`);return u.embeddings.map(f=>({type:d,value:new Float32Array(f.embedding)}))}catch(c){throw new Error("Error fetching batch embeddings: "+(c instanceof Error?c.message:String(c)))}}};p();p();p();var nke=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var S2n=fe($A()),T2n=fe(Y9()),I2n=require("os"),BWt=fe(require("path")),Hde=require("process");function jet(t){let e=un(t.workspaceFolder.uri),r=(0,S2n.basename)(e),o=(0,T2n.SHA256)(e).toString().substring(0,8);return BWt.default.join(bas(),"project-index",`${r}.${o}`)}a(jet,"getWorkspaceCachePath");function bas(){return Hde.env.XDG_CACHE_HOME&&BWt.default.isAbsolute(Hde.env.XDG_CACHE_HOME)?Hde.env.XDG_CACHE_HOME+"/github-copilot":(0,I2n.platform)()==="win32"?Hde.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":Hde.env.HOME+"/.cache/github-copilot"}a(bas,"getXdgCachePath");p();p();function x2n(t){if(s$t(t.type)?.quantization.document==="binary"){if(t.value.length%8!==0)throw new Error(`Embedding value length must be a multiple of 8 for ${t.type.id}, got ${t.value.length}`);let n=new Uint8Array(t.value.length/8);for(let o=0;o=0?1:0)<=1024)){let o=new Float32Array(e.length*8);for(let s=0;s0?.03125:-.03125}return{type:t,value:o}}let n=new Float32Array(e.byteLength/4);return new Uint8Array(n.buffer).set(e),{type:t,value:n}}a(FWt,"unpackEmbedding");p();var w2n=fe(pl()),R2n=fe(b2()),QWt=fe(uh()),k2n=fe(require("fs")),qWt=fe(require("node:sqlite")),jWt=fe(require("path"));var UWt=new pe("WorkspaceChunkAndEmbeddingCache");async function P2n(t,e,r,n){return await HWt.create(t,e,r??":memory:",n)}a(P2n,"createWorkspaceChunkAndEmbeddingCache");var HWt=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new R2n.ResourceMap}static{a(this,"DbCache")}static{this.version="1.0.0"}static async create(e,r,n,o){let s={open:!0},c;if(n!==":memory:"){let f=jWt.default.join(n,"workspace-chunks.db");try{await k2n.default.promises.mkdir(jWt.default.dirname(f),{recursive:!0}),c=new qWt.default.DatabaseSync(f,s),UWt.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${f}`)}catch(h){UWt.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",h)}}c||(c=new qWt.default.DatabaseSync(":memory:",s),UWt.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` PRAGMA journal_mode = OFF; PRAGMA synchronous = 0; PRAGMA cache_size = ${-32768}; @@ -2868,20 +2868,20 @@ ${t.map(r=>`- ${r}`).join(` CREATE INDEX IF NOT EXISTS idx_files_uri ON Files(uri); CREATE INDEX IF NOT EXISTS idx_filechunks_fileId ON FileChunks(fileId); - `);let l=c.prepare("SELECT version, embeddingModel FROM CacheMeta LIMIT 1").get();(!l||l.version!==this.version||l.embeddingModel!==r.id)&&c.exec("DELETE FROM CacheMeta; DELETE FROM Files; DELETE FROM FileChunks;"),c.exec("DELETE FROM CacheMeta;"),c.prepare("INSERT INTO CacheMeta (version, embeddingModel) VALUES (?, ?)").run(this.version,r.id),await o.initialize();let u=c.prepare("SELECT id, uri FROM Files"),d=c.prepare("DELETE FROM Files WHERE id = ?");try{c.exec("BEGIN TRANSACTION");for(let f of u.all()){let h=f;try{if(o.get(h.uri))continue}catch{}d.run(h.id)}}finally{c.exec("COMMIT")}return new t(r,c)}dispose(){this.db.close()}async isIndexed(e){return(await this.getEntry(e))?.state==="resolved"}async get(e){return(await this.getEntry(e))?.value}getCurrentChunksForUri(e){let r=oo(e),n=this._inMemory.get(r);if(n?.state==="pending"||n?.state==="rejected")return;let o=this.db.prepare("SELECT fc.text, fc.range_startLineNumber, fc.range_startColumn, fc.range_endLineNumber, fc.range_endColumn, fc.embedding, fc.chunkHash FROM Files f JOIN FileChunks fc ON f.id = fc.fileId WHERE f.uri = ?").all(e.toString());if(o.length>0){let s=new Map;for(let c of o){let l=BWt(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new UWt.Range(c.range_startLineNumber,c.range_startColumn,c.range_endLineNumber,c.range_endColumn)},embedding:l,chunkHash:c.chunkHash};u.chunkHash&&s.set(u.chunkHash,u)}return s}}async getEntry(e){let r=oo(e.uri),n=this._inMemory.get(r),o=await e.getFastContentVersionId();if(n?.contentVersionId===o)return n;let s=this.db.prepare("SELECT id, contentVersionId FROM Files WHERE uri = ?").get(e.uri.toString());if(!s||s.contentVersionId!==o)return;let c=this.db.prepare("SELECT text, range_startLineNumber, range_startColumn, range_endLineNumber, range_endColumn, embedding, chunkHash FROM FileChunks WHERE fileId = ?").all(s.id);return{state:"resolved",contentVersionId:s.contentVersionId,fileHash:void 0,value:c.map(l=>({chunk:{file:e.uri.toString(),text:l.text,rawText:void 0,range:new UWt.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:BWt(this.embeddingType,l.embedding),chunkHash:l.chunkHash}))}}async update(e,r){let n=oo(e.uri),o=this._inMemory.get(n),s=await e.getFastContentVersionId();if(o?.contentVersionId===s)return o.value;let c=await this.getEntry(e);if(c?.contentVersionId===s)return c.value;o?.state==="pending"&&o.value.cancel();let l=(0,x2n.createCancelablePromise)(r),u={contentVersionId:s,fileHash:void 0,state:"pending",value:l};return this._inMemory.set(n,u),await l.then(d=>({contentVersionId:s,fileHash:void 0,state:Array.isArray(d)?"resolved":"rejected",value:d}),()=>({contentVersionId:s,fileHash:void 0,state:"rejected",value:void 0})).then(d=>{let f=this._inMemory.get(n);if(u===f)if(d.state==="rejected")this._inMemory.set(n,d),this.db.prepare("DELETE FROM Files WHERE uri = ?").run(n.toString());else{this._inMemory.delete(n);let h=this.db.prepare("INSERT OR REPLACE INTO Files (uri, contentVersionId) VALUES (?, ?)").run(e.uri.toString(),s);try{let m=this.db.prepare("INSERT INTO FileChunks (fileId, text, range_startLineNumber, range_startColumn, range_endLineNumber, range_endColumn, embedding, chunkHash) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");this.db.exec("BEGIN TRANSACTION");for(let g of d.value??[])m.run(h.lastInsertRowid,g.chunk.text,g.chunk.range.startLineNumber,g.chunk.range.startColumn,g.chunk.range.endLineNumber,g.chunk.range.endColumn,I2n(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var P2n=fe(Ml()),QF=fe(pl()),D2n=fe(MF());var HWt=20,Het=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new D2n.Lazy(async()=>(this._cacheRoot=jet(this._workspaceFileIndex),await k2n(this.ctx,this._embeddingType,this._cacheRoot,this._workspaceFileIndex)))}static{a(this,"WorkspaceChunkEmbeddingsIndex")}dispose(){this._cache.hasValue&&this._cache.value.then(e=>e.dispose())}async getIndexState(){if(!this._cache.hasValue)return;let e=await this._cache.value,r=Array.from(this._workspaceFileIndex.values()),n=0,o=new QF.Limiter(HWt);return await Promise.all(r.map(s=>o.queue(async()=>{await e.isIndexed(s)&&n++}))),{totalFileCount:r.length,indexedFileCount:n}}get fileCount(){return this._workspaceFileIndex.fileCount}async triggerIndexingOfWorkspace(e,r){let n=Array.from(this._workspaceFileIndex.values()),o=new QF.Limiter(HWt);await Promise.all(n.map(s=>o.queue(()=>this.triggerIndexingOfFile(s.uri,e,r))))}async triggerIndexingOfFile(e,r,n){let o=this._workspaceFileIndex.get(e);o&&await this.getChunksAndEmbeddings(r,o,new nke,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,QF.raceCancellationError)(Promise.all([r,this.getAllWorkspaceEmbeddings(e,o)]),o);return this.rankEmbeddings(s,c,n)}async searchSubsetOfFiles(e,r,n,o,s){if(!r.length)return[];let[c,l]=await(0,QF.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return zxn(e,r.map(o=>[o.chunk,o.embedding]),n).map(o=>({chunk:o.value,distance:o.distance}))}async getAllWorkspaceEmbeddings(e,r){let o=Array.from(this._workspaceFileIndex.values()).map(s=>s.uri);return this.getEmbeddingsForFiles(e,o,r)}async getEmbeddingsForFiles(e,r,n){let o=new nke,s=new QF.Limiter(HWt),c=await Promise.all(r.map(l=>s.queue(async()=>{let u=this._workspaceFileIndex.get(l);if(u)return await this.getChunksAndEmbeddings(e,u,o,"Batch",n)})));return(0,P2n.coalesce)(c).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,QF.raceCancellationError)(this._cache.value,s),l=await(0,QF.raceCancellationError)(c.get(r),s);if(l)return l;let u=c.getCurrentChunksForUri(r.uri);return await c.update(r,async f=>this._chunkingEndpointClient.computeChunksAndEmbeddings(e,this._embeddingType,r,n,o,u,f))}};var N2n=fe(pl()),M2n=fe(b2()),Hde=fe(E5());var VA=new pe("Embeddings Search"),Get=class t{constructor(e,r,n,o){this._ctx=e;this._workspaceFileIndex=r;this.embeddingType=n;this.chunkingEndpointClient=o;this.id="embeddings";this._state="unknown";this._disposeCts=new jn.CancellationTokenSource;this._reindexRequests=new M2n.ResourceMap}static{a(this,"EmbeddingsChunkSearch")}static{this.defaultAutomaticIndexingFileCap=750}dispose(){this._disposeCts.cancel(),this._disposeCts.dispose();for(let[,e]of this._reindexRequests)e.dispose();this._reindexRequests.clear(),this._embeddingsIndex?.dispose()}async triggerLocalIndexing(){if(VA.info(this._ctx,"Triggering local indexing..."),await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAutomaticIndexing"){VA.info(this._ctx,"Skipping automatic indexing: too many files",{fileCount:this._workspaceFileIndex.fileCount});return}await this.triggerIndexingOfWorkspace()}async searchWorkspace(e,r,n){let o=new Hde.StopWatch;VA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:HA(r),indexStatus:this._state});let s=await this._ctx.get(Qt).getGitHubSession();if(!s)throw VA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let c=e.resolveQueryEmbeddings(n);if(await this.doInitialIndexing(),sm(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new Hde.StopWatch,d=await this._embeddingsIndex.searchWorkspace(s,c,HA(r),n),f=u.elapsed(),h=o.elapsed(),m=d.length,A=new Set(d.map(_=>_.chunk.file)).size,y=this._workspaceFileIndex.fileCount;return VA.info(this._ctx,`Workspace search completed successfully in ${h}ms`,{totalTime:h,searchTime:f,chunkCount:m,uniqueFileCount:A,indexStatus:this._state}),Sg.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,R_.Aggregate),{chunks:d}}else{VA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),Sg.sendEmbeddingsSkipped(this._ctx,"index_not_ready");return}}async searchFiles(e,r,n,o){if(!n.length)return VA.info(this._ctx,"No files to search, returning empty results"),{chunks:[]};let s=new Hde.StopWatch;VA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:HA(r),fileCount:n.length});let c=await this._ctx.get(Qt).getGitHubSession();if(!c)throw VA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let l=e.resolveQueryEmbeddings(o),u=await this.initializeForFileSubset(n.length);if(!u){VA.info(this._ctx,"Too many files for subset search",{fileCount:n.length});return}sm(o);let d=new Hde.StopWatch,f=await u.searchSubsetOfFiles(c,n,l,HA(r),o),h=d.elapsed(),m=s.elapsed(),g=f.length,y=new Set(f.map(E=>E.chunk.file)).size,_=this._workspaceFileIndex.fileCount;return VA.info(this._ctx,`File subset search completed successfully in ${m}ms`,{totalTime:m,searchTime:h,chunkCount:g,uniqueFileCount:y}),Sg.sendEmbeddingsSuccess(this._ctx,m,h,g,y,_,R_.Remote),{chunks:f}}async initializeForFileSubset(e){await this._workspaceFileIndex.initialize();let r=this.getAutoIndexFileCap();if(e>r){VA.info(this._ctx,`EmbeddingsChunkSearch: skipping subset search due to too many files. Found ${e} files. Max: ${r}`);return}return this.getOrCreateEmbeddingsIndex()}async initializeWorkspaceIndex(){return this._init??=(async()=>{await this._workspaceFileIndex.initialize();let e=this.checkWorkspaceIndexSizeLimits();return e?(VA.info(this._ctx,`EmbeddingsChunkSearch: skipping automatic indexing due to too many files. Found ${this._workspaceFileIndex.fileCount} files. Max: ${this.getAutoIndexFileCap()}`),this.setState(e),!0):(this.getOrCreateEmbeddingsIndex(),this.setState("ready"),!0)})(),this._init}getOrCreateEmbeddingsIndex(){return this._embeddingsIndex||(this._embeddingsIndex=new Het(this._ctx,this.embeddingType,this._workspaceFileIndex,this.chunkingEndpointClient),VA.info(this._ctx,`EmbeddingsChunkSearch: initializing embeddings index for ${this._workspaceFileIndex.fileCount} files.`)),this._embeddingsIndex}checkWorkspaceIndexSizeLimits(){let e=this.getAutoIndexFileCap();if(this._workspaceFileIndex.fileCount>e)return"tooManyFilesForAutomaticIndexing"}async doInitialIndexing(){return this._initialIndexing??=(async()=>{if(await this.initializeWorkspaceIndex(),!(this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing"))return this.triggerIndexingOfWorkspace(),this.registerAutomaticReindexListeners(),!0})(),this._initialIndexing}async triggerIndexingOfWorkspace(){let e=new Hde.StopWatch;VA.info(this._ctx,"Starting workspace indexing...",{fileCount:this._workspaceFileIndex.fileCount}),this.setState("updatingIndex");try{let r=await this._ctx.get(Qt).getGitHubSession();if(!r)throw new Error("No GitHub session found");await this._embeddingsIndex?.triggerIndexingOfWorkspace(r,new jn.CancellationTokenSource().token),this.setState("ready"),VA.info(this._ctx,`Workspace indexing completed in ${e.elapsed()}ms`,{status:"ready",indexingTime:e.elapsed()})}catch(r){VA.error(this._ctx,"Workspace indexing failed",r),this.setState("unknown")}}registerAutomaticReindexListeners(){this._reindexRequests.clear(),this._workspaceFileIndex.onDidCreateFiles(e=>{this.tryTriggerReindexing(e,!0)}),this._workspaceFileIndex.onDidChangeFiles(e=>this.tryTriggerReindexing(e,!0)),this._workspaceFileIndex.onDidDeleteFiles(e=>{for(let r of e){let n=oo(r);this._reindexRequests.get(n)?.dispose(),this._reindexRequests.delete(n)}})}getAutoIndexFileCap(){return t.defaultAutomaticIndexingFileCap}setState(e){this._state!==e&&(this._state=e)}tryTriggerReindexing(e,r=!1){if(this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let n=6e4;for(let o of e){let s=oo(o),c=this._reindexRequests.get(s);c||(c=new N2n.Delayer(n),this._reindexRequests.set(s,c)),c.trigger(async()=>{if(await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let l=await this._ctx.get(Qt).getGitHubSession();this._embeddingsIndex?.triggerIndexingOfFile(o,l,this._disposeCts.token)},r?0:n)}}};p();p();var oke=fe(xT());async function zet(t){for(let r of t)r.then(n=>{n.isOk()&&t.forEach(o=>{o!==r&&o.cancel()})},()=>{});let e=await Promise.allSettled(t);for(let r of e)if(r.status==="fulfilled"&&r.value.isOk())return r.value;{let r=[];for(let n of e)n.status==="fulfilled"&&n.value.isError()&&r.push(n.value.err.errorDiagMessage);if(r.length)return oke.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&r2(r.reason)))return oke.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!r2(r.reason))return oke.Result.error({errorDiagMessage:r.reason+""});return oke.Result.error({errorDiagMessage:"unknown error"})}a(zet,"raceSearchOperations");var ske=fe(xT()),ake=fe(pl());var Das=2e3,Nas=.7,Q2n=8e3,Mas=300,Yet=class{constructor(e,r,n,o){this._embeddingsByWorkspace=e;this._tfidfByWorkspace=r;this._workspaceFileIndexes=n;this._diffTrackers=o}static{a(this,"LocalDiffSearch")}getTotalFileCount(e){let r=0;for(let n of e){let o=this._workspaceFileIndexes.get(n);o&&(r+=o.fileCount)}return r}async getLocalDiff(e){let r=new Set;for(let n of e){let o=this._diffTrackers.get(n);if(o){let s=await o.getDiffFiles();if(s)for(let c of s)r.add(c)}}return Array.from(r)}shouldDoLocalDiffSearch(e,r){if(e.length===0||e.length>Das)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>Nas)}async searchLocalDiff(e,r,n,o){if(e.length===0)return ske.Result.ok({strategy:"none",result:{chunks:[]}});let s=[],c=[];for(let u of n.workspaceFolders){let d=this._embeddingsByWorkspace.get(u),f=this._tfidfByWorkspace.get(u);d&&s.push(d),f&&c.push(f)}if(s.length===0&&c.length===0)return ske.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,ake.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return ske.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>Mas){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return ske.Result.error({errorDiagMessage:"Diff size too large for embeddings and no TF-IDF available"})}if(s.length>0&&c.length>0){let u=l(s,"embeddings");o.onCancellationRequested(()=>u.cancel());let d=await(0,ake.raceTimeout)(u,Q2n),f=d===void 0;if(d?.isOk()&&d.val.result.chunks.length>0)return d;let h=l(c,"tfidf");return o.onCancellationRequested(()=>h.cancel()),f?(h.then(()=>u.cancel(),()=>u.cancel()),await zet([u,h])):(u.cancel(),await h)}else if(s.length>0&&c.length===0){let u=l(s,"embeddings");o.onCancellationRequested(()=>u.cancel());let d=await(0,ake.raceTimeout)(u,Q2n);if(d?.isOk()&&d.val.result.chunks.length>0)return d;u.cancel();return}else if(s.length===0&&c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}}mergeSearchResults(e){let r=e.filter(o=>!!o);if(r.length===0)return{chunks:[]};if(r.length===1)return{chunks:[...r[0].chunks]};let n=new Map;for(let o of r)for(let s of o.chunks){let c=s.chunk.file,l=n.get(c),u=s.distance?.value??Number.MAX_VALUE,d=l?.distance?.value??Number.MAX_VALUE;(!l||ug.text.toLowerCase()),e.toLowerCase()],u=await s.computeEmbeddings(c,l,{inputType:"document"},o);if(!u||u.values.length===0)return[];if(o.isCancellationRequested)return[];let d=u.values[u.values.length-1],f=u.values.slice(0,-1);if(!r.length||f.length!==r.length)return[];let h=f[0].type,m=f.map((g,A)=>({chunk:r[A],score:wRe(d,g).value}));return m.sort((g,A)=>A.score-g.score),m.slice(0,n).map(g=>({chunk:g.chunk,distance:{embeddingType:h,value:g.score}}))}};p();var q2n=fe(require("path")),j2n=require("worker_threads");var YWt=class{constructor(){this.nextId=1;this.handlers=new Map}static{a(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function Oas(t){let e={get:a((r,n)=>{if(typeof n=="string")return r[n]||(r[n]=(...o)=>t(n,o)),r[n]},"get")};return new Proxy(Object.create(null),e)}a(Oas,"createRpcProxy");var Jet=class{constructor(e,r,n){this.responseHandler=new YWt;this.worker=new j2n.Worker(e,r),Xxe(this.worker,q2n.basename(e,".js")),this.worker.on("message",o=>{"fn"in o?(async()=>{try{let s=n?.[o.fn];if(!s)throw new Error(`Unknown method: ${o.fn}`);let c=await s.apply(n,o.args);this.worker.postMessage({id:o.id,res:c})}catch(s){this.worker.postMessage({id:o.id,err:s instanceof Error?s:new Error(String(s))})}})():this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=Oas((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}static{a(this,"WorkerWithRpcProxy")}terminate(){this.worker.removeAllListeners(),this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};var ett=fe(pl()),H2n=fe(MF()),G2n=fe(Po()),Gde=fe(E5()),$2n=require("fs"),Zet=fe(require("path"));var Em=new pe("Tfidf Search"),Las=100,Xet=class extends G2n.Disposable{constructor(r,n,o){super();this.id="tfidf";this._maxFileCount=25e3;this._isDisposed=!1;this._tokenizerName="o200k_base";this._workspaceFileIndex=n,this.ctx=r,this._embeddingReranker=new Ket(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new H2n.Lazy(()=>{let s=this.firstExistingPath([Zet.join(__dirname,"tfidfWorker.js"),Zet.join(__dirname,"../../../../dist/tfidfWorker.js")]);if(s===void 0)throw new Error("tfidfWorker file not found");let c={tokenizer:this._tokenizerName,dbPath:this.getDbPath()},l={readFile:a(async u=>{let f=await r.get(si).getOrReadTextDocument({uri:u});if(f.status!=="valid")throw new Error(`Could not read file ${u}: ${f.status}`);return f.document.getText()},"readFile"),getContentVersionId:a(async u=>{try{return await this.getFastContentVersionId(u)}catch(d){throw new Error(`Could not find file ${u}, error: ${String(d)}`)}},"getContentVersionId"),logWarn:a((u,...d)=>(Em.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(Em.error(r,u,...d),Promise.resolve()),"logError")};return new Jet(s,{workerData:c},l)}),this._register(this.registerFileWatchers())}static{a(this,"TfidfChunkSearch")}dispose(){this._isDisposed=!0,super.dispose(),this._tfIdfWorker.hasValue&&this._tfIdfWorker.value.terminate()}async initialize(){Em.info(this.ctx,"Starting initialization...");let r=new Gde.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return Em.info(this.ctx,`Initialization completed in ${r.elapsed()}ms`,{outOfSyncFileCount:n.outOfSyncFileCount,newFileCount:n.newFileCount,deletedFileCount:n.deletedFileCount,initTime:n.initTime,dbPath:this.getDbPath()}),n}async searchWorkspace(r,n,o){let s=new Gde.StopWatch;Em.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:HA(n)});try{if(await this.initialize(),this._isDisposed)throw Sg.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:HA(n),maxSpread:xRe},l=await r.resolveQuery(o),u=new Gde.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();Em.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),sm(o);let h=await this.applyEmbeddingReranking(l,d.chunks,HA(n),o),m=h.chunks.length,A=new Set(h.chunks.map(E=>E.chunk.file)).size,y=this._workspaceFileIndex.fileCount,_=s.elapsed();return Em.info(this.ctx,`Search with reranking completed successfully in ${_}ms`,{totalTime:_,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),Sg.sendTfidfSuccess(this.ctx,_,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,R_.Aggregate),{chunks:h.chunks}}catch(c){throw Em.error(this.ctx,"TF-IDF search failed",c),Sg.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new Gde.StopWatch;if(Em.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return Em.info(this.ctx,"No files to search, returning empty results"),{chunks:[]};if(await this.initializeFiles(o),this._isDisposed)throw new Error("TfidfChunkSearch has been disposed");let l={maxResults:HA(n),maxSpread:xRe},u=await r.resolveQuery(s),d=await this._tfIdfWorker.value.proxy.search(u,l),f=new Set(o),h=d.chunks.filter(v=>f.has(v.file));Em.info(this.ctx,"Chunks filtered by file scope",{beforeFilter:d.chunks.length,afterFilter:h.length});let m=c.elapsed(),g=await this.applyEmbeddingReranking(u,h,HA(n),s),A=g.chunks.length,_=new Set(g.chunks.map(v=>v.chunk.file)).size,E=c.elapsed();return Em.info(this.ctx,`File-scoped search completed in ${E}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),Sg.sendTfidfSuccess(this.ctx,E,m,g.telemetry.rerankTime,A,_,h.length,o.length,R_.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new Gde.StopWatch,l=[];if(Em.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new jn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,ett.raceTimeout)(h,f,()=>{Em.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,Em.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(Em.warn(this.ctx,"Reranking returned no results, falling back to TF-IDF results"),l=n.slice(0,o).map(g=>({chunk:g,distance:void 0})))}catch(h){Em.error(this.ctx,"Error during embedding reranking, falling back to TF-IDF results:",h),l=n.slice(0,o).map(m=>({chunk:m,distance:void 0}))}}else Em.info(this.ctx,"No chunks to rerank");return{chunks:l,telemetry:{rerankTime:c.elapsed()}}}async initializeWorkspace(){if(await this._workspaceFileIndex.initialize(),this._isDisposed)throw new Error("TfidfChunkSearch disposed during initialization");let r=Array.from(this._workspaceFileIndex.values()),n=r;r.length>this._maxFileCount&&(n=r.slice(0,this._maxFileCount),Em.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),Em.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new ett.Limiter(Las),s=await Promise.all(n.map(c=>o.queue(async()=>({uri:c.uri,contentId:await c.getFastContentVersionId()}))));return await this._tfIdfWorker.value.proxy.initialize(s)}async getFastContentVersionId(r){let n=await this.ctx.get(Go).stat(r);return`${n.size}-${n.mtime}`}async initializeFiles(r){let n=new Set(r),o=Array.from(this._workspaceFileIndex.values()).filter(s=>n.has(s.uri)).map(s=>s.uri);o.length&&await this._tfIdfWorker.value.proxy.addOrUpdate(o)}registerFileWatchers(){let r=[],n=this._workspaceFileIndex.onDidCreateFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.addOrUpdate(c).catch(l=>{console.error("Error handling file create event:",l)})});r.push(n);let o=this._workspaceFileIndex.onDidChangeFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.addOrUpdate(c).catch(l=>{console.error("Error handling file change event:",l)})});r.push(o);let s=this._workspaceFileIndex.onDidDeleteFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.delete(c).catch(l=>{console.error("Error handling file delete event:",l)})});return r.push(s),{dispose:a(()=>{r.forEach(c=>c.dispose())},"dispose")}}getDbPath(){if(this._customDbPath)return this._customDbPath;let r=jet(this._workspaceFileIndex);return Zet.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,$2n.existsSync)(n))return n}};p();p();p();var KWt=class{constructor(){this._value="";this._pos=0}static{a(this,"StringIterator")}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;r--,this._valueLen--){let n=this._value.charCodeAt(r);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,r=()=>!1){return new t(new ZWt(e,r))}static forPaths(e=!1){return new t(new ttt(void 0,!e))}static forStrings(){return new t(new KWt)}static forConfigKeys(){return new t(new JWt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);Wqt(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);Wqt(n);for(let o of n)this.set(o[0],o[1])}}set(e,r){let n=this._iter.reset(e),o;this._root||(this._root=new $de,this._root.segment=n.value());let s=[];for(o=this._root;;){let l=n.cmp(o.segment);if(l>0)o.left||(o.left=new $de,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new $de,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new $de,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=qF.unwrap(o.value);o.value=qF.wrap(r),o.key=e;for(let l=s.length-1;l>=0;l--){let u=s[l][1];u.updateHeight();let d=u.balanceFactor();if(d<-1||d>1){let f=s[l][0],h=s[l+1][0];if(f===1&&h===1)s[l][1]=u.rotateLeft();else if(f===-1&&h===-1)s[l][1]=u.rotateRight();else if(f===1&&h===-1)u.right=s[l+1][1]=s[l+1][1].rotateRight(),s[l][1]=u.rotateLeft();else if(f===-1&&h===1)u.left=s[l+1][1]=s[l+1][1].rotateLeft(),s[l][1]=u.rotateRight();else throw new Error;if(l>0)switch(s[l-1][0]){case-1:s[l-1][1].left=s[l][1];break;case 1:s[l-1][1].right=s[l][1];break;case 0:s[l-1][1].mid=s[l][1];break}else this._root=s[0][1]}}return c}get(e){return qF.unwrap(this._getNode(e)?.value)}_getNode(e){let r=this._iter.reset(e),n=this._root;for(;n;){let o=r.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(r.hasNext())r.next(),n=n.mid;else break}return n}has(e){let r=this._getNode(e);return!(r?.value===void 0&&r?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,r){let n=this._iter.reset(e),o=[],s=this._root;for(;s;){let c=n.cmp(s.segment);if(c>0)o.push([-1,s]),s=s.left;else if(c<0)o.push([1,s]),s=s.right;else if(n.hasNext())n.next(),o.push([0,s]),s=s.mid;else break}if(s){if(r?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){let c=[[1,s]],l=this._min(s.right,c);if(l.key){s.key=l.key,s.value=l.value,s.segment=l.segment;let u=l.right;if(c.length>1){let[f,h]=c[c.length-1];switch(f){case-1:h.left=u;break;case 0:BJ(!1);case 1:BJ(!1)}}else s.right=u;let d=this._balanceByStack(c);if(o.length>0){let[f,h]=o[o.length-1];switch(f){case-1:h.left=d;break;case 0:h.mid=d;break;case 1:h.right=d;break}}else this._root=d}}else{let c=s.left??s.right;if(o.length>0){let[l,u]=o[o.length-1];switch(l){case-1:u.left=c;break;case 0:u.mid=c;break;case 1:u.right=c;break}}else this._root=c}this._root=this._balanceByStack(o)??this._root}}_min(e,r){for(;e.left;)r.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let r=e.length-1;r>=0;r--){let n=e[r][1];n.updateHeight();let o=n.balanceFactor();if(o>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),e[r][1]=n.rotateLeft()):o<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),e[r][1]=n.rotateRight()),r>0)switch(e[r-1][0]){case-1:e[r-1][1].left=e[r][1];break;case 1:e[r-1][1].right=e[r][1];break;case 0:e[r-1][1].mid=e[r][1];break}else return e[0][1]}}findSubstr(e){let r=this._iter.reset(e),n=this._root,o;for(;n;){let s=r.cmp(n.segment);if(s>0)n=n.left;else if(s<0)n=n.right;else if(r.hasNext())r.next(),o=qF.unwrap(n.value)||o,n=n.mid;else break}return n&&qF.unwrap(n.value)||o}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,r){let n=this._iter.reset(e),o=this._root;for(;o;){let s=n.cmp(o.segment);if(s>0)o=o.left;else if(s<0)o=o.right;else if(n.hasNext())n.next(),o=o.mid;else return o.mid?this._entries(o.mid):r?qF.unwrap(o.value):void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(let[r,n]of this)e(n,r)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){let r=[];return this._dfsEntries(e,r),r[Symbol.iterator]()}_dfsEntries(e,r){e&&(e.left&&this._dfsEntries(e.left,r),e.value!==void 0&&r.push([e.key,qF.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,r),e.right&&this._dfsEntries(e.right,r))}_isBalanced(){let e=a(r=>{if(!r)return!0;let n=r.balanceFactor();return n<-1||n>1?!1:e(r.left)&&e(r.right)},"nodeIsBalanced");return e(this._root)}};var Vde=fe(pl()),W2n=fe(require("fs")),z2n=fe(ii());var Bas=new pe("Workspace File Index"),Fas=1.5*1024*1024,Uas=50,V2n=1e4,XWt=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new z2n.CancellationTokenSource}static{a(this,"FileRepresentation")}dispose(){this._isDisposed=!0,this._disposedCts.cancel(),this._disposedCts.dispose()}get uri(){return this._uri}async getFastContentVersionId(){let e=await this.getStats();return`${e.size}-${e.mtime}`}},ntt=class extends XWt{constructor(r,n,o){super(r);this._ctx=o;this._fileReadLimiter=n}static{a(this,"FsFileRepresentation")}isDirty(){return!1}async getStats(){let r=await this._ctx.get(Go).stat(this.uri.toString());return{size:r.size,mtime:r.mtime}}async getText(){try{let r=await this._readFile();if(!r||this._isDisposed)return"";let o=new TextDecoder().decode(r.data);return(await this._ctx.get(pc).evaluate(this.uri,o)).isBlocked?"":o}catch{return""}}async _readFile(){try{let r=un(this.uri);return await this._fileReadLimiter.queue(async()=>({data:await(0,Vde.raceCancellationError)(Qas(r,Fas),this._disposedCts.token)}))}catch{return}}};async function Qas(t,e){return new Promise((r,n)=>{let o=W2n.createReadStream(t,{start:0,end:e-1}),s=[],c=0;o.on("data",l=>(c+=l.length,s.push(l))),o.on("end",()=>r(Buffer.concat(s))),o.on("error",n)})}a(Qas,"readLocalTextFileUsingReadStream");var itt=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new ezt;this._onDidCreateFiles=new Ji;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new Ji;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new Ji;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=ys(e);return r?this._fsFileTree.get(r):void 0}tryLoad(e){throw new Error("Method not implemented.")}tryRead(e){throw new Error("Method not implemented.")}createOrUpdateFsEntry(e){let r=this._fsFileTree.get(e);r&&r.dispose();let n=new ntt(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(vw).getWatchedFileUris(this.workspaceFolder);(await this.filterExcludedFiles(e)).forEach(n=>{let o=ys(n.uri);o&&this._fsFileTree.addFile(o,new ntt(n.uri,this.limiter,this.ctx))})})(),this._initializePromise}async filterExcludedFiles(e){let r=this.ctx.get(pc);if(!r.enabled)return e;let n=new Vde.Limiter(Uas),o=!1,s=await(0,Vde.raceTimeout)(Promise.all(e.map(c=>n.queue(async()=>{if(o)return c;let l=await r.evaluate(c.uri,""),u=l.reason==="POLICY_ERROR";return l.isBlocked&&!u?void 0:c}))),V2n,()=>{o=!0});return s?s.filter(c=>c!==void 0):(Bas.warn(this.ctx,"Content exclusion pre-filter timed out; indexing without path pre-filter",{fileCount:e.length,budgetMs:V2n}),e)}async didChangeFiles(e){if(e.type==="create"){let r=[];for(let n of e.documents){if(await this.statFileType(n.uri)!==1)continue;let s=n.uri;this._fsFileTree.get(s)||(this.createOrUpdateFsEntry(s),r.push(s))}r.length&&this._onDidCreateFiles.fire(r)}else if(e.type==="update"){let r=[];for(let n of e.documents){if(await this.statFileType(n.uri)!==1)continue;let s=n.uri;this.createOrUpdateFsEntry(s),r.push(s)}r.length&&this._onDidChangeFiles.fire(r)}else if(e.type==="delete"){let r=[];for(let n of e.documents){let o=n.uri,s=this._fsFileTree.get(o);if(s)s.dispose(),this._fsFileTree.delete(o),r.push(o);else{let c=this._fsFileTree.deleteFolder(o);c.length&&r.push(...c)}}r.length&&this._onDidDeleteFiles.fire(r)}}async statFileType(e){try{return(await this.ctx.get(Go).stat(e)).type}catch{return}}},ezt=class{constructor(){this._tree=rtt.forPaths();this._fileCount=0}static{a(this,"SimpleFsTree")}get fileCount(){return this._fileCount}get(e){return this._tree.get(e)}addFile(e,r){this._tree.get(e)||this._fileCount++,this._tree.set(e,r)}clear(){this._tree.clear()}delete(e){let r=!!this.get(e);return this._tree.delete(e),r&&(this._fileCount=Math.max(0,this._fileCount-1)),r}deleteFolder(e){let r=[];for(let[n]of this._tree.findSuperstr(e)??[])r.push(n);for(let n of r)this._tree.delete(n);return this._fileCount=Math.max(0,this._fileCount-r.length),r}*values(){for(let[,e]of this.entries())yield e}entries(){return this._tree}};var Y2n=fe(pl());var ott=class extends xq{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new Ji;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new Ji;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(dT).addListener(this),this._fileReadLimiter=new Y2n.Limiter(20)}static{a(this,"WorkspaceFileWatcher")}isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}async didAddWorkspace(r){if(!await this.isEnabled())return;let n=new itt(this.ctx,r,this._fileReadLimiter);this.workspaceFileIndexes.set(r.uri,n),this._onDidWorkspaceAdded.fire(n)}async didRemoveWorkspace(r){if(!await this.isEnabled())return;let n=this.workspaceFileIndexes.get(r.uri);if(n){for(let o of n.values())o.dispose();this._onDidWorkspaceRemoved.fire(n),this.workspaceFileIndexes.delete(r.uri)}}async didChangeFiles(r){if(!await this.isEnabled())return;let n=this.workspaceFileIndexes.get(r.workspaceFolder.uri);n&&await n.didChangeFiles(r)}};var cke=fe(xT()),K2n=fe(Ml()),Bw=fe(pl()),bj=fe(E5());var hl=new pe("Semantic Search"),R2=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new qet(e),this.tryInit()}static{a(this,"WorkspaceChunkSearchService")}dispose(){this._impl?.dispose()}async tryInit(){if(this._impl)return this._impl;let e=await this._availableEmbeddingTypes.getPreferredType();if(e)return this._impl=new tzt(this._ctx,e),this._impl}async searchWorkspace(e,r,n){let o=await this.tryInit();if(!o)throw new Error("Workspace chunk search service not available");return await o.searchWorkspace(e,r,n)}},tzt=class{constructor(e,r){this._ctx=e;this._embeddingType=r;this._localEmbeddingsByWorkspace=new Map;this._localTfidfByWorkspace=new Map;this._diffTrackersByWorkspace=new Map;this._workspaceFileIndexes=new Map;let n=new ott(this._ctx),o=new uet(this._ctx);this._localDiffSearch=new Yet(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new aet(this._ctx),this._codeSearchChunkSearch=new det(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new Get(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new Xet(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new Uet(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&XE(this._ctx)&&(u.initialize(),c.triggerLocalIndexing(),l.initialize())}),n.onDidWorkspaceRemoved(s=>{let c=s.workspaceFolder.uri,l=this._diffTrackersByWorkspace.get(c);l&&(l.dispose(),this._diffTrackersByWorkspace.delete(c));let u=this._localTfidfByWorkspace.get(c);u&&(u.dispose(),this._localTfidfByWorkspace.delete(c));let d=this._localEmbeddingsByWorkspace.get(c);d&&(d.dispose(),this._localEmbeddingsByWorkspace.delete(c))})}static{a(this,"WorkspaceChunkSearchServiceImpl")}dispose(){this._githubCodeSearchService.dispose();for(let e of this._localTfidfByWorkspace.values())e.dispose();this._localTfidfByWorkspace.clear();for(let e of this._localEmbeddingsByWorkspace.values())e.dispose();this._localEmbeddingsByWorkspace.clear();for(let e of this._diffTrackersByWorkspace.values())e.dispose();this._diffTrackersByWorkspace.clear(),this._workspaceFileIndexes.clear()}async searchWorkspace(e,r,n){let o=new bj.StopWatch,s=await this.resolveQueryText(e,n);hl.info(this._ctx,"Starting semantic search",{resolvedQuery:s,maxResults:HA(r),tokenBudget:r.tokenBudget,workspaceFolders:r.workspaceFolders});let c=this.toQueryWithEmbeddings(e,s),l=await this.doSearchFileChunks(c,r,n);if(l.isError())throw hl.error(this._ctx,"Semantic search failed",l.err),Sg.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);hl.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,Bw.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);hl.info(this._ctx,"Chunks filtered",{beforeFilter:l.val.result.chunks.length,afterFilter:u.length});let d=await this.rerankChunks(c,u,HA(r),n),f=d.length,m=new Set(d.map(A=>A.chunk.file)).size,g=o.elapsed();return hl.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),Sg.sendAggregateSuccess(this._ctx,l.val.strategy,g,f,m,r.workspaceFolders.length,r.source),{chunks:d}}toQueryWithEmbeddings(e,r){let n;return{...e,resolveQueryEmbeddings:a(o=>(n??=this.computeQueryEmbedding(e,o,r),n),"resolveQueryEmbeddings")}}async computeQueryEmbedding(e,r,n){sm(r);let o=n??await this.resolveQueryText(e,r),s=await this.getEmbeddingComputer().computeEmbeddings(this._embeddingType,[o],{inputType:"query"},r);if(!s?.values.length)throw new Error("Failed to compute query embeddings");return s.values[0]}async resolveQueryText(e,r){try{return await e.resolveQuery(r)}catch(n){if(r2(n))throw n;return hl.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new qde(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){hl.info(this._ctx,"Starting semantic search with fallback strategy");let o=process.env.GITHUB_COPILOT_SIMULATION==="1"?1e6:12500;return this.runSearchStrategyWithFallback(this._codeSearchChunkSearch,()=>(0,Bw.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new bj.StopWatch;hl.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,Bw.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,Bw.raceCancellationError)((0,Bw.raceTimeout)(u,n),c);if(d?.isOk())return hl.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;hl.warn(this._ctx,`Primary strategy '${e.id}' failed or timed out, falling back to local search`,{elapsedTime:l.elapsed(),isTimeout:d===void 0,error:d?.isError()?d.err:void 0});let f=r();c.onCancellationRequested(()=>f.cancel()),f.then(()=>u.cancel(),()=>u.cancel());let h=new bj.StopWatch,m=await zet([u,f]);return hl.info(this._ctx,`Search operation completed in ${l.elapsed()}ms (fallback took ${h.elapsed()}ms)`,{totalTime:l.elapsed(),fallbackTime:h.elapsed(),success:m.isOk()}),m}async doSearchFileChunksLocally(e,r,n){hl.info(this._ctx,"Starting local file chunk search",{folderCount:r.workspaceFolders.length});let o=[],s=new Set;for(let l of r.workspaceFolders){let u=this._localEmbeddingsByWorkspace.get(l),d=this._localTfidfByWorkspace.get(l);if(u&&d){hl.info(this._ctx,`Both strategies available for folder: ${l}, using embeddings with TF-IDF fallback`);let f=8e3,h=new bj.StopWatch,m=await this.runSearchStrategyWithFallback(u,()=>(0,Bw.createCancelablePromise)(g=>this.runSearchStrategy(d,e,r,g)),f,e,r,n);m.isOk()&&(o.push(...m.val.result.chunks),s.add(m.val.strategy),hl.info(this._ctx,`Folder search completed in ${h.elapsed()}ms`,{folder:l,strategy:m.val.strategy,chunkCount:m.val.result.chunks.length,elapsedTime:h.elapsed()}))}else if(u){hl.info(this._ctx,`Using embeddings search for folder: ${l}`);let f=new bj.StopWatch,h=await this.runSearchStrategy(u,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(u.id),hl.info(this._ctx,`Embeddings search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else if(d){hl.info(this._ctx,`Using TF-IDF search for folder: ${l}`);let f=new bj.StopWatch,h=await this.runSearchStrategy(d,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(d.id),hl.info(this._ctx,`TF-IDF search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else hl.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return hl.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),cke.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new bj.StopWatch;hl.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,Bw.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(hl.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),cke.Result.ok({strategy:e.id,result:c})):(hl.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),cke.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(r2(c))throw hl.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return hl.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),cke.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,K2n.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(pc).evaluate(r.chunk.file,r.chunk.text)).isBlocked?null:r)))}async rerankChunks(e,r,n,o){if(!r.length)return[];try{let s,c=r.at(0)?.distance?.embeddingType;if(c&&r.every(f=>typeof f.distance<"u"&&f.distance.embeddingType.equals(c)))s=[...r].sort((f,h)=>h.distance.value-f.distance.value);else{let h=r.map((A,y)=>({...A.chunk,distance:A.distance,index:y})).filter(A=>typeof A.distance>"u"||!A.distance.embeddingType.equals(this._embeddingType)),m;if(h.length){hl.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,Bw.raceCancellationError)(A,o)}let g=[];for(let A=0;AA?.distance?.embeddingType.equals(this._embeddingType)).sort((A,y)=>y.distance.value-A.distance.value)}if(!s.length)return s;s=s.slice(0,n);let u=s[0].distance.value*xRe,d=s.filter(f=>f.distance.value>=u);return hl.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return r2(s)||hl.error(this._ctx,"Failed to search chunk embeddings index"),r.slice(0,n)}}async scoreChunks(e,r,n){if(!r.length)return[];let o=r.map(l=>this.chunkToIndexString(l)),[s,c]=await(0,Bw.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:wRe(s,l)}))}async computeEmbeddings(e,r,n){let o=await this.getEmbeddingComputer().computeEmbeddings(this._embeddingType,r,{inputType:e},n);if(!o)throw new Error("Failed to compute embeddings");return o}chunkToIndexString(e){return this.toStringForEmbeddingsComputer(e,ys(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=GA(e.text);return`File: \`${r}\` + `);let l=c.prepare("SELECT version, embeddingModel FROM CacheMeta LIMIT 1").get();(!l||l.version!==this.version||l.embeddingModel!==r.id)&&c.exec("DELETE FROM CacheMeta; DELETE FROM Files; DELETE FROM FileChunks;"),c.exec("DELETE FROM CacheMeta;"),c.prepare("INSERT INTO CacheMeta (version, embeddingModel) VALUES (?, ?)").run(this.version,r.id),await o.initialize();let u=c.prepare("SELECT id, uri FROM Files"),d=c.prepare("DELETE FROM Files WHERE id = ?");try{c.exec("BEGIN TRANSACTION");for(let f of u.all()){let h=f;try{if(o.get(h.uri))continue}catch{}d.run(h.id)}}finally{c.exec("COMMIT")}return new t(r,c)}dispose(){this.db.close()}async isIndexed(e){return(await this.getEntry(e))?.state==="resolved"}async get(e){return(await this.getEntry(e))?.value}getCurrentChunksForUri(e){let r=oo(e),n=this._inMemory.get(r);if(n?.state==="pending"||n?.state==="rejected")return;let o=this.db.prepare("SELECT fc.text, fc.range_startLineNumber, fc.range_startColumn, fc.range_endLineNumber, fc.range_endColumn, fc.embedding, fc.chunkHash FROM Files f JOIN FileChunks fc ON f.id = fc.fileId WHERE f.uri = ?").all(e.toString());if(o.length>0){let s=new Map;for(let c of o){let l=FWt(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new QWt.Range(c.range_startLineNumber,c.range_startColumn,c.range_endLineNumber,c.range_endColumn)},embedding:l,chunkHash:c.chunkHash};u.chunkHash&&s.set(u.chunkHash,u)}return s}}async getEntry(e){let r=oo(e.uri),n=this._inMemory.get(r),o=await e.getFastContentVersionId();if(n?.contentVersionId===o)return n;let s=this.db.prepare("SELECT id, contentVersionId FROM Files WHERE uri = ?").get(e.uri.toString());if(!s||s.contentVersionId!==o)return;let c=this.db.prepare("SELECT text, range_startLineNumber, range_startColumn, range_endLineNumber, range_endColumn, embedding, chunkHash FROM FileChunks WHERE fileId = ?").all(s.id);return{state:"resolved",contentVersionId:s.contentVersionId,fileHash:void 0,value:c.map(l=>({chunk:{file:e.uri.toString(),text:l.text,rawText:void 0,range:new QWt.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:FWt(this.embeddingType,l.embedding),chunkHash:l.chunkHash}))}}async update(e,r){let n=oo(e.uri),o=this._inMemory.get(n),s=await e.getFastContentVersionId();if(o?.contentVersionId===s)return o.value;let c=await this.getEntry(e);if(c?.contentVersionId===s)return c.value;o?.state==="pending"&&o.value.cancel();let l=(0,w2n.createCancelablePromise)(r),u={contentVersionId:s,fileHash:void 0,state:"pending",value:l};return this._inMemory.set(n,u),await l.then(d=>({contentVersionId:s,fileHash:void 0,state:Array.isArray(d)?"resolved":"rejected",value:d}),()=>({contentVersionId:s,fileHash:void 0,state:"rejected",value:void 0})).then(d=>{let f=this._inMemory.get(n);if(u===f)if(d.state==="rejected")this._inMemory.set(n,d),this.db.prepare("DELETE FROM Files WHERE uri = ?").run(n.toString());else{this._inMemory.delete(n);let h=this.db.prepare("INSERT OR REPLACE INTO Files (uri, contentVersionId) VALUES (?, ?)").run(e.uri.toString(),s);try{let m=this.db.prepare("INSERT INTO FileChunks (fileId, text, range_startLineNumber, range_startColumn, range_endLineNumber, range_endColumn, embedding, chunkHash) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");this.db.exec("BEGIN TRANSACTION");for(let g of d.value??[])m.run(h.lastInsertRowid,g.chunk.text,g.chunk.range.startLineNumber,g.chunk.range.startColumn,g.chunk.range.endLineNumber,g.chunk.range.endColumn,x2n(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var D2n=fe(Ml()),QF=fe(pl()),N2n=fe(MF());var GWt=20,Het=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new N2n.Lazy(async()=>(this._cacheRoot=jet(this._workspaceFileIndex),await P2n(this.ctx,this._embeddingType,this._cacheRoot,this._workspaceFileIndex)))}static{a(this,"WorkspaceChunkEmbeddingsIndex")}dispose(){this._cache.hasValue&&this._cache.value.then(e=>e.dispose())}async getIndexState(){if(!this._cache.hasValue)return;let e=await this._cache.value,r=Array.from(this._workspaceFileIndex.values()),n=0,o=new QF.Limiter(GWt);return await Promise.all(r.map(s=>o.queue(async()=>{await e.isIndexed(s)&&n++}))),{totalFileCount:r.length,indexedFileCount:n}}get fileCount(){return this._workspaceFileIndex.fileCount}async triggerIndexingOfWorkspace(e,r){let n=Array.from(this._workspaceFileIndex.values()),o=new QF.Limiter(GWt);await Promise.all(n.map(s=>o.queue(()=>this.triggerIndexingOfFile(s.uri,e,r))))}async triggerIndexingOfFile(e,r,n){let o=this._workspaceFileIndex.get(e);o&&await this.getChunksAndEmbeddings(r,o,new nke,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,QF.raceCancellationError)(Promise.all([r,this.getAllWorkspaceEmbeddings(e,o)]),o);return this.rankEmbeddings(s,c,n)}async searchSubsetOfFiles(e,r,n,o,s){if(!r.length)return[];let[c,l]=await(0,QF.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return Yxn(e,r.map(o=>[o.chunk,o.embedding]),n).map(o=>({chunk:o.value,distance:o.distance}))}async getAllWorkspaceEmbeddings(e,r){let o=Array.from(this._workspaceFileIndex.values()).map(s=>s.uri);return this.getEmbeddingsForFiles(e,o,r)}async getEmbeddingsForFiles(e,r,n){let o=new nke,s=new QF.Limiter(GWt),c=await Promise.all(r.map(l=>s.queue(async()=>{let u=this._workspaceFileIndex.get(l);if(u)return await this.getChunksAndEmbeddings(e,u,o,"Batch",n)})));return(0,D2n.coalesce)(c).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,QF.raceCancellationError)(this._cache.value,s),l=await(0,QF.raceCancellationError)(c.get(r),s);if(l)return l;let u=c.getCurrentChunksForUri(r.uri);return await c.update(r,async f=>this._chunkingEndpointClient.computeChunksAndEmbeddings(e,this._embeddingType,r,n,o,u,f))}};var M2n=fe(pl()),O2n=fe(b2()),Gde=fe(E5());var VA=new pe("Embeddings Search"),Get=class t{constructor(e,r,n,o){this._ctx=e;this._workspaceFileIndex=r;this.embeddingType=n;this.chunkingEndpointClient=o;this.id="embeddings";this._state="unknown";this._disposeCts=new jn.CancellationTokenSource;this._reindexRequests=new O2n.ResourceMap}static{a(this,"EmbeddingsChunkSearch")}static{this.defaultAutomaticIndexingFileCap=750}dispose(){this._disposeCts.cancel(),this._disposeCts.dispose();for(let[,e]of this._reindexRequests)e.dispose();this._reindexRequests.clear(),this._embeddingsIndex?.dispose()}async triggerLocalIndexing(){if(VA.info(this._ctx,"Triggering local indexing..."),await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAutomaticIndexing"){VA.info(this._ctx,"Skipping automatic indexing: too many files",{fileCount:this._workspaceFileIndex.fileCount});return}await this.triggerIndexingOfWorkspace()}async searchWorkspace(e,r,n){let o=new Gde.StopWatch;VA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:HA(r),indexStatus:this._state});let s=await this._ctx.get(Qt).getGitHubSession();if(!s)throw VA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let c=e.resolveQueryEmbeddings(n);if(await this.doInitialIndexing(),sm(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new Gde.StopWatch,d=await this._embeddingsIndex.searchWorkspace(s,c,HA(r),n),f=u.elapsed(),h=o.elapsed(),m=d.length,A=new Set(d.map(_=>_.chunk.file)).size,y=this._workspaceFileIndex.fileCount;return VA.info(this._ctx,`Workspace search completed successfully in ${h}ms`,{totalTime:h,searchTime:f,chunkCount:m,uniqueFileCount:A,indexStatus:this._state}),Tg.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,R_.Aggregate),{chunks:d}}else{VA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),Tg.sendEmbeddingsSkipped(this._ctx,"index_not_ready");return}}async searchFiles(e,r,n,o){if(!n.length)return VA.info(this._ctx,"No files to search, returning empty results"),{chunks:[]};let s=new Gde.StopWatch;VA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:HA(r),fileCount:n.length});let c=await this._ctx.get(Qt).getGitHubSession();if(!c)throw VA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let l=e.resolveQueryEmbeddings(o),u=await this.initializeForFileSubset(n.length);if(!u){VA.info(this._ctx,"Too many files for subset search",{fileCount:n.length});return}sm(o);let d=new Gde.StopWatch,f=await u.searchSubsetOfFiles(c,n,l,HA(r),o),h=d.elapsed(),m=s.elapsed(),g=f.length,y=new Set(f.map(E=>E.chunk.file)).size,_=this._workspaceFileIndex.fileCount;return VA.info(this._ctx,`File subset search completed successfully in ${m}ms`,{totalTime:m,searchTime:h,chunkCount:g,uniqueFileCount:y}),Tg.sendEmbeddingsSuccess(this._ctx,m,h,g,y,_,R_.Remote),{chunks:f}}async initializeForFileSubset(e){await this._workspaceFileIndex.initialize();let r=this.getAutoIndexFileCap();if(e>r){VA.info(this._ctx,`EmbeddingsChunkSearch: skipping subset search due to too many files. Found ${e} files. Max: ${r}`);return}return this.getOrCreateEmbeddingsIndex()}async initializeWorkspaceIndex(){return this._init??=(async()=>{await this._workspaceFileIndex.initialize();let e=this.checkWorkspaceIndexSizeLimits();return e?(VA.info(this._ctx,`EmbeddingsChunkSearch: skipping automatic indexing due to too many files. Found ${this._workspaceFileIndex.fileCount} files. Max: ${this.getAutoIndexFileCap()}`),this.setState(e),!0):(this.getOrCreateEmbeddingsIndex(),this.setState("ready"),!0)})(),this._init}getOrCreateEmbeddingsIndex(){return this._embeddingsIndex||(this._embeddingsIndex=new Het(this._ctx,this.embeddingType,this._workspaceFileIndex,this.chunkingEndpointClient),VA.info(this._ctx,`EmbeddingsChunkSearch: initializing embeddings index for ${this._workspaceFileIndex.fileCount} files.`)),this._embeddingsIndex}checkWorkspaceIndexSizeLimits(){let e=this.getAutoIndexFileCap();if(this._workspaceFileIndex.fileCount>e)return"tooManyFilesForAutomaticIndexing"}async doInitialIndexing(){return this._initialIndexing??=(async()=>{if(await this.initializeWorkspaceIndex(),!(this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing"))return this.triggerIndexingOfWorkspace(),this.registerAutomaticReindexListeners(),!0})(),this._initialIndexing}async triggerIndexingOfWorkspace(){let e=new Gde.StopWatch;VA.info(this._ctx,"Starting workspace indexing...",{fileCount:this._workspaceFileIndex.fileCount}),this.setState("updatingIndex");try{let r=await this._ctx.get(Qt).getGitHubSession();if(!r)throw new Error("No GitHub session found");await this._embeddingsIndex?.triggerIndexingOfWorkspace(r,new jn.CancellationTokenSource().token),this.setState("ready"),VA.info(this._ctx,`Workspace indexing completed in ${e.elapsed()}ms`,{status:"ready",indexingTime:e.elapsed()})}catch(r){VA.error(this._ctx,"Workspace indexing failed",r),this.setState("unknown")}}registerAutomaticReindexListeners(){this._reindexRequests.clear(),this._workspaceFileIndex.onDidCreateFiles(e=>{this.tryTriggerReindexing(e,!0)}),this._workspaceFileIndex.onDidChangeFiles(e=>this.tryTriggerReindexing(e,!0)),this._workspaceFileIndex.onDidDeleteFiles(e=>{for(let r of e){let n=oo(r);this._reindexRequests.get(n)?.dispose(),this._reindexRequests.delete(n)}})}getAutoIndexFileCap(){return t.defaultAutomaticIndexingFileCap}setState(e){this._state!==e&&(this._state=e)}tryTriggerReindexing(e,r=!1){if(this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let n=6e4;for(let o of e){let s=oo(o),c=this._reindexRequests.get(s);c||(c=new M2n.Delayer(n),this._reindexRequests.set(s,c)),c.trigger(async()=>{if(await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let l=await this._ctx.get(Qt).getGitHubSession();this._embeddingsIndex?.triggerIndexingOfFile(o,l,this._disposeCts.token)},r?0:n)}}};p();p();var oke=fe(xT());async function zet(t){for(let r of t)r.then(n=>{n.isOk()&&t.forEach(o=>{o!==r&&o.cancel()})},()=>{});let e=await Promise.allSettled(t);for(let r of e)if(r.status==="fulfilled"&&r.value.isOk())return r.value;{let r=[];for(let n of e)n.status==="fulfilled"&&n.value.isError()&&r.push(n.value.err.errorDiagMessage);if(r.length)return oke.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&r2(r.reason)))return oke.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!r2(r.reason))return oke.Result.error({errorDiagMessage:r.reason+""});return oke.Result.error({errorDiagMessage:"unknown error"})}a(zet,"raceSearchOperations");var ske=fe(xT()),ake=fe(pl());var Mas=2e3,Oas=.7,q2n=8e3,Las=300,Yet=class{constructor(e,r,n,o){this._embeddingsByWorkspace=e;this._tfidfByWorkspace=r;this._workspaceFileIndexes=n;this._diffTrackers=o}static{a(this,"LocalDiffSearch")}getTotalFileCount(e){let r=0;for(let n of e){let o=this._workspaceFileIndexes.get(n);o&&(r+=o.fileCount)}return r}async getLocalDiff(e){let r=new Set;for(let n of e){let o=this._diffTrackers.get(n);if(o){let s=await o.getDiffFiles();if(s)for(let c of s)r.add(c)}}return Array.from(r)}shouldDoLocalDiffSearch(e,r){if(e.length===0||e.length>Mas)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>Oas)}async searchLocalDiff(e,r,n,o){if(e.length===0)return ske.Result.ok({strategy:"none",result:{chunks:[]}});let s=[],c=[];for(let u of n.workspaceFolders){let d=this._embeddingsByWorkspace.get(u),f=this._tfidfByWorkspace.get(u);d&&s.push(d),f&&c.push(f)}if(s.length===0&&c.length===0)return ske.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,ake.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return ske.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>Las){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return ske.Result.error({errorDiagMessage:"Diff size too large for embeddings and no TF-IDF available"})}if(s.length>0&&c.length>0){let u=l(s,"embeddings");o.onCancellationRequested(()=>u.cancel());let d=await(0,ake.raceTimeout)(u,q2n),f=d===void 0;if(d?.isOk()&&d.val.result.chunks.length>0)return d;let h=l(c,"tfidf");return o.onCancellationRequested(()=>h.cancel()),f?(h.then(()=>u.cancel(),()=>u.cancel()),await zet([u,h])):(u.cancel(),await h)}else if(s.length>0&&c.length===0){let u=l(s,"embeddings");o.onCancellationRequested(()=>u.cancel());let d=await(0,ake.raceTimeout)(u,q2n);if(d?.isOk()&&d.val.result.chunks.length>0)return d;u.cancel();return}else if(s.length===0&&c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}}mergeSearchResults(e){let r=e.filter(o=>!!o);if(r.length===0)return{chunks:[]};if(r.length===1)return{chunks:[...r[0].chunks]};let n=new Map;for(let o of r)for(let s of o.chunks){let c=s.chunk.file,l=n.get(c),u=s.distance?.value??Number.MAX_VALUE,d=l?.distance?.value??Number.MAX_VALUE;(!l||ug.text.toLowerCase()),e.toLowerCase()],u=await s.computeEmbeddings(c,l,{inputType:"document"},o);if(!u||u.values.length===0)return[];if(o.isCancellationRequested)return[];let d=u.values[u.values.length-1],f=u.values.slice(0,-1);if(!r.length||f.length!==r.length)return[];let h=f[0].type,m=f.map((g,A)=>({chunk:r[A],score:wRe(d,g).value}));return m.sort((g,A)=>A.score-g.score),m.slice(0,n).map(g=>({chunk:g.chunk,distance:{embeddingType:h,value:g.score}}))}};p();var j2n=fe(require("path")),H2n=require("worker_threads");var KWt=class{constructor(){this.nextId=1;this.handlers=new Map}static{a(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function Bas(t){let e={get:a((r,n)=>{if(typeof n=="string")return r[n]||(r[n]=(...o)=>t(n,o)),r[n]},"get")};return new Proxy(Object.create(null),e)}a(Bas,"createRpcProxy");var Jet=class{constructor(e,r,n){this.responseHandler=new KWt;this.worker=new H2n.Worker(e,r),Xxe(this.worker,j2n.basename(e,".js")),this.worker.on("message",o=>{"fn"in o?(async()=>{try{let s=n?.[o.fn];if(!s)throw new Error(`Unknown method: ${o.fn}`);let c=await s.apply(n,o.args);this.worker.postMessage({id:o.id,res:c})}catch(s){this.worker.postMessage({id:o.id,err:s instanceof Error?s:new Error(String(s))})}})():this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=Bas((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}static{a(this,"WorkerWithRpcProxy")}terminate(){this.worker.removeAllListeners(),this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};var ett=fe(pl()),G2n=fe(MF()),$2n=fe(Po()),$de=fe(E5()),V2n=require("fs"),Zet=fe(require("path"));var Em=new pe("Tfidf Search"),Fas=100,Xet=class extends $2n.Disposable{constructor(r,n,o){super();this.id="tfidf";this._maxFileCount=25e3;this._isDisposed=!1;this._tokenizerName="o200k_base";this._workspaceFileIndex=n,this.ctx=r,this._embeddingReranker=new Ket(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new G2n.Lazy(()=>{let s=this.firstExistingPath([Zet.join(__dirname,"tfidfWorker.js"),Zet.join(__dirname,"../../../../dist/tfidfWorker.js")]);if(s===void 0)throw new Error("tfidfWorker file not found");let c={tokenizer:this._tokenizerName,dbPath:this.getDbPath()},l={readFile:a(async u=>{let f=await r.get(si).getOrReadTextDocument({uri:u});if(f.status!=="valid")throw new Error(`Could not read file ${u}: ${f.status}`);return f.document.getText()},"readFile"),getContentVersionId:a(async u=>{try{return await this.getFastContentVersionId(u)}catch(d){throw new Error(`Could not find file ${u}, error: ${String(d)}`)}},"getContentVersionId"),logWarn:a((u,...d)=>(Em.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(Em.error(r,u,...d),Promise.resolve()),"logError")};return new Jet(s,{workerData:c},l)}),this._register(this.registerFileWatchers())}static{a(this,"TfidfChunkSearch")}dispose(){this._isDisposed=!0,super.dispose(),this._tfIdfWorker.hasValue&&this._tfIdfWorker.value.terminate()}async initialize(){Em.info(this.ctx,"Starting initialization...");let r=new $de.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return Em.info(this.ctx,`Initialization completed in ${r.elapsed()}ms`,{outOfSyncFileCount:n.outOfSyncFileCount,newFileCount:n.newFileCount,deletedFileCount:n.deletedFileCount,initTime:n.initTime,dbPath:this.getDbPath()}),n}async searchWorkspace(r,n,o){let s=new $de.StopWatch;Em.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:HA(n)});try{if(await this.initialize(),this._isDisposed)throw Tg.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:HA(n),maxSpread:xRe},l=await r.resolveQuery(o),u=new $de.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();Em.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),sm(o);let h=await this.applyEmbeddingReranking(l,d.chunks,HA(n),o),m=h.chunks.length,A=new Set(h.chunks.map(E=>E.chunk.file)).size,y=this._workspaceFileIndex.fileCount,_=s.elapsed();return Em.info(this.ctx,`Search with reranking completed successfully in ${_}ms`,{totalTime:_,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),Tg.sendTfidfSuccess(this.ctx,_,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,R_.Aggregate),{chunks:h.chunks}}catch(c){throw Em.error(this.ctx,"TF-IDF search failed",c),Tg.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new $de.StopWatch;if(Em.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return Em.info(this.ctx,"No files to search, returning empty results"),{chunks:[]};if(await this.initializeFiles(o),this._isDisposed)throw new Error("TfidfChunkSearch has been disposed");let l={maxResults:HA(n),maxSpread:xRe},u=await r.resolveQuery(s),d=await this._tfIdfWorker.value.proxy.search(u,l),f=new Set(o),h=d.chunks.filter(v=>f.has(v.file));Em.info(this.ctx,"Chunks filtered by file scope",{beforeFilter:d.chunks.length,afterFilter:h.length});let m=c.elapsed(),g=await this.applyEmbeddingReranking(u,h,HA(n),s),A=g.chunks.length,_=new Set(g.chunks.map(v=>v.chunk.file)).size,E=c.elapsed();return Em.info(this.ctx,`File-scoped search completed in ${E}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),Tg.sendTfidfSuccess(this.ctx,E,m,g.telemetry.rerankTime,A,_,h.length,o.length,R_.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new $de.StopWatch,l=[];if(Em.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new jn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,ett.raceTimeout)(h,f,()=>{Em.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,Em.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(Em.warn(this.ctx,"Reranking returned no results, falling back to TF-IDF results"),l=n.slice(0,o).map(g=>({chunk:g,distance:void 0})))}catch(h){Em.error(this.ctx,"Error during embedding reranking, falling back to TF-IDF results:",h),l=n.slice(0,o).map(m=>({chunk:m,distance:void 0}))}}else Em.info(this.ctx,"No chunks to rerank");return{chunks:l,telemetry:{rerankTime:c.elapsed()}}}async initializeWorkspace(){if(await this._workspaceFileIndex.initialize(),this._isDisposed)throw new Error("TfidfChunkSearch disposed during initialization");let r=Array.from(this._workspaceFileIndex.values()),n=r;r.length>this._maxFileCount&&(n=r.slice(0,this._maxFileCount),Em.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),Em.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new ett.Limiter(Fas),s=await Promise.all(n.map(c=>o.queue(async()=>({uri:c.uri,contentId:await c.getFastContentVersionId()}))));return await this._tfIdfWorker.value.proxy.initialize(s)}async getFastContentVersionId(r){let n=await this.ctx.get(Go).stat(r);return`${n.size}-${n.mtime}`}async initializeFiles(r){let n=new Set(r),o=Array.from(this._workspaceFileIndex.values()).filter(s=>n.has(s.uri)).map(s=>s.uri);o.length&&await this._tfIdfWorker.value.proxy.addOrUpdate(o)}registerFileWatchers(){let r=[],n=this._workspaceFileIndex.onDidCreateFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.addOrUpdate(c).catch(l=>{console.error("Error handling file create event:",l)})});r.push(n);let o=this._workspaceFileIndex.onDidChangeFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.addOrUpdate(c).catch(l=>{console.error("Error handling file change event:",l)})});r.push(o);let s=this._workspaceFileIndex.onDidDeleteFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.delete(c).catch(l=>{console.error("Error handling file delete event:",l)})});return r.push(s),{dispose:a(()=>{r.forEach(c=>c.dispose())},"dispose")}}getDbPath(){if(this._customDbPath)return this._customDbPath;let r=jet(this._workspaceFileIndex);return Zet.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,V2n.existsSync)(n))return n}};p();p();p();var JWt=class{constructor(){this._value="";this._pos=0}static{a(this,"StringIterator")}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;r--,this._valueLen--){let n=this._value.charCodeAt(r);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,r=()=>!1){return new t(new XWt(e,r))}static forPaths(e=!1){return new t(new ttt(void 0,!e))}static forStrings(){return new t(new JWt)}static forConfigKeys(){return new t(new ZWt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);zqt(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);zqt(n);for(let o of n)this.set(o[0],o[1])}}set(e,r){let n=this._iter.reset(e),o;this._root||(this._root=new Vde,this._root.segment=n.value());let s=[];for(o=this._root;;){let l=n.cmp(o.segment);if(l>0)o.left||(o.left=new Vde,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new Vde,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new Vde,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=qF.unwrap(o.value);o.value=qF.wrap(r),o.key=e;for(let l=s.length-1;l>=0;l--){let u=s[l][1];u.updateHeight();let d=u.balanceFactor();if(d<-1||d>1){let f=s[l][0],h=s[l+1][0];if(f===1&&h===1)s[l][1]=u.rotateLeft();else if(f===-1&&h===-1)s[l][1]=u.rotateRight();else if(f===1&&h===-1)u.right=s[l+1][1]=s[l+1][1].rotateRight(),s[l][1]=u.rotateLeft();else if(f===-1&&h===1)u.left=s[l+1][1]=s[l+1][1].rotateLeft(),s[l][1]=u.rotateRight();else throw new Error;if(l>0)switch(s[l-1][0]){case-1:s[l-1][1].left=s[l][1];break;case 1:s[l-1][1].right=s[l][1];break;case 0:s[l-1][1].mid=s[l][1];break}else this._root=s[0][1]}}return c}get(e){return qF.unwrap(this._getNode(e)?.value)}_getNode(e){let r=this._iter.reset(e),n=this._root;for(;n;){let o=r.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(r.hasNext())r.next(),n=n.mid;else break}return n}has(e){let r=this._getNode(e);return!(r?.value===void 0&&r?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,r){let n=this._iter.reset(e),o=[],s=this._root;for(;s;){let c=n.cmp(s.segment);if(c>0)o.push([-1,s]),s=s.left;else if(c<0)o.push([1,s]),s=s.right;else if(n.hasNext())n.next(),o.push([0,s]),s=s.mid;else break}if(s){if(r?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){let c=[[1,s]],l=this._min(s.right,c);if(l.key){s.key=l.key,s.value=l.value,s.segment=l.segment;let u=l.right;if(c.length>1){let[f,h]=c[c.length-1];switch(f){case-1:h.left=u;break;case 0:FJ(!1);case 1:FJ(!1)}}else s.right=u;let d=this._balanceByStack(c);if(o.length>0){let[f,h]=o[o.length-1];switch(f){case-1:h.left=d;break;case 0:h.mid=d;break;case 1:h.right=d;break}}else this._root=d}}else{let c=s.left??s.right;if(o.length>0){let[l,u]=o[o.length-1];switch(l){case-1:u.left=c;break;case 0:u.mid=c;break;case 1:u.right=c;break}}else this._root=c}this._root=this._balanceByStack(o)??this._root}}_min(e,r){for(;e.left;)r.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let r=e.length-1;r>=0;r--){let n=e[r][1];n.updateHeight();let o=n.balanceFactor();if(o>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),e[r][1]=n.rotateLeft()):o<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),e[r][1]=n.rotateRight()),r>0)switch(e[r-1][0]){case-1:e[r-1][1].left=e[r][1];break;case 1:e[r-1][1].right=e[r][1];break;case 0:e[r-1][1].mid=e[r][1];break}else return e[0][1]}}findSubstr(e){let r=this._iter.reset(e),n=this._root,o;for(;n;){let s=r.cmp(n.segment);if(s>0)n=n.left;else if(s<0)n=n.right;else if(r.hasNext())r.next(),o=qF.unwrap(n.value)||o,n=n.mid;else break}return n&&qF.unwrap(n.value)||o}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,r){let n=this._iter.reset(e),o=this._root;for(;o;){let s=n.cmp(o.segment);if(s>0)o=o.left;else if(s<0)o=o.right;else if(n.hasNext())n.next(),o=o.mid;else return o.mid?this._entries(o.mid):r?qF.unwrap(o.value):void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(let[r,n]of this)e(n,r)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){let r=[];return this._dfsEntries(e,r),r[Symbol.iterator]()}_dfsEntries(e,r){e&&(e.left&&this._dfsEntries(e.left,r),e.value!==void 0&&r.push([e.key,qF.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,r),e.right&&this._dfsEntries(e.right,r))}_isBalanced(){let e=a(r=>{if(!r)return!0;let n=r.balanceFactor();return n<-1||n>1?!1:e(r.left)&&e(r.right)},"nodeIsBalanced");return e(this._root)}};var Wde=fe(pl()),z2n=fe(require("fs")),Y2n=fe(ii());var Uas=new pe("Workspace File Index"),Qas=1.5*1024*1024,qas=50,W2n=1e4,ezt=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new Y2n.CancellationTokenSource}static{a(this,"FileRepresentation")}dispose(){this._isDisposed=!0,this._disposedCts.cancel(),this._disposedCts.dispose()}get uri(){return this._uri}async getFastContentVersionId(){let e=await this.getStats();return`${e.size}-${e.mtime}`}},ntt=class extends ezt{constructor(r,n,o){super(r);this._ctx=o;this._fileReadLimiter=n}static{a(this,"FsFileRepresentation")}isDirty(){return!1}async getStats(){let r=await this._ctx.get(Go).stat(this.uri.toString());return{size:r.size,mtime:r.mtime}}async getText(){try{let r=await this._readFile();if(!r||this._isDisposed)return"";let o=new TextDecoder().decode(r.data);return(await this._ctx.get(pc).evaluate(this.uri,o)).isBlocked?"":o}catch{return""}}async _readFile(){try{let r=un(this.uri);return await this._fileReadLimiter.queue(async()=>({data:await(0,Wde.raceCancellationError)(jas(r,Qas),this._disposedCts.token)}))}catch{return}}};async function jas(t,e){return new Promise((r,n)=>{let o=z2n.createReadStream(t,{start:0,end:e-1}),s=[],c=0;o.on("data",l=>(c+=l.length,s.push(l))),o.on("end",()=>r(Buffer.concat(s))),o.on("error",n)})}a(jas,"readLocalTextFileUsingReadStream");var itt=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new tzt;this._onDidCreateFiles=new Ji;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new Ji;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new Ji;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=ys(e);return r?this._fsFileTree.get(r):void 0}tryLoad(e){throw new Error("Method not implemented.")}tryRead(e){throw new Error("Method not implemented.")}createOrUpdateFsEntry(e){let r=this._fsFileTree.get(e);r&&r.dispose();let n=new ntt(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(vw).getWatchedFileUris(this.workspaceFolder);(await this.filterExcludedFiles(e)).forEach(n=>{let o=ys(n.uri);o&&this._fsFileTree.addFile(o,new ntt(n.uri,this.limiter,this.ctx))})})(),this._initializePromise}async filterExcludedFiles(e){let r=this.ctx.get(pc);if(!r.enabled)return e;let n=new Wde.Limiter(qas),o=!1,s=await(0,Wde.raceTimeout)(Promise.all(e.map(c=>n.queue(async()=>{if(o)return c;let l=await r.evaluate(c.uri,""),u=l.reason==="POLICY_ERROR";return l.isBlocked&&!u?void 0:c}))),W2n,()=>{o=!0});return s?s.filter(c=>c!==void 0):(Uas.warn(this.ctx,"Content exclusion pre-filter timed out; indexing without path pre-filter",{fileCount:e.length,budgetMs:W2n}),e)}async didChangeFiles(e){if(e.type==="create"){let r=[];for(let n of e.documents){if(await this.statFileType(n.uri)!==1)continue;let s=n.uri;this._fsFileTree.get(s)||(this.createOrUpdateFsEntry(s),r.push(s))}r.length&&this._onDidCreateFiles.fire(r)}else if(e.type==="update"){let r=[];for(let n of e.documents){if(await this.statFileType(n.uri)!==1)continue;let s=n.uri;this.createOrUpdateFsEntry(s),r.push(s)}r.length&&this._onDidChangeFiles.fire(r)}else if(e.type==="delete"){let r=[];for(let n of e.documents){let o=n.uri,s=this._fsFileTree.get(o);if(s)s.dispose(),this._fsFileTree.delete(o),r.push(o);else{let c=this._fsFileTree.deleteFolder(o);c.length&&r.push(...c)}}r.length&&this._onDidDeleteFiles.fire(r)}}async statFileType(e){try{return(await this.ctx.get(Go).stat(e)).type}catch{return}}},tzt=class{constructor(){this._tree=rtt.forPaths();this._fileCount=0}static{a(this,"SimpleFsTree")}get fileCount(){return this._fileCount}get(e){return this._tree.get(e)}addFile(e,r){this._tree.get(e)||this._fileCount++,this._tree.set(e,r)}clear(){this._tree.clear()}delete(e){let r=!!this.get(e);return this._tree.delete(e),r&&(this._fileCount=Math.max(0,this._fileCount-1)),r}deleteFolder(e){let r=[];for(let[n]of this._tree.findSuperstr(e)??[])r.push(n);for(let n of r)this._tree.delete(n);return this._fileCount=Math.max(0,this._fileCount-r.length),r}*values(){for(let[,e]of this.entries())yield e}entries(){return this._tree}};var K2n=fe(pl());var ott=class extends xq{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new Ji;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new Ji;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(dT).addListener(this),this._fileReadLimiter=new K2n.Limiter(20)}static{a(this,"WorkspaceFileWatcher")}isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}async didAddWorkspace(r){if(!await this.isEnabled())return;let n=new itt(this.ctx,r,this._fileReadLimiter);this.workspaceFileIndexes.set(r.uri,n),this._onDidWorkspaceAdded.fire(n)}async didRemoveWorkspace(r){if(!await this.isEnabled())return;let n=this.workspaceFileIndexes.get(r.uri);if(n){for(let o of n.values())o.dispose();this._onDidWorkspaceRemoved.fire(n),this.workspaceFileIndexes.delete(r.uri)}}async didChangeFiles(r){if(!await this.isEnabled())return;let n=this.workspaceFileIndexes.get(r.workspaceFolder.uri);n&&await n.didChangeFiles(r)}};var cke=fe(xT()),J2n=fe(Ml()),Bw=fe(pl()),bj=fe(E5());var hl=new pe("Semantic Search"),R2=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new qet(e),this.tryInit()}static{a(this,"WorkspaceChunkSearchService")}dispose(){this._impl?.dispose()}async tryInit(){if(this._impl)return this._impl;let e=await this._availableEmbeddingTypes.getPreferredType();if(e)return this._impl=new rzt(this._ctx,e),this._impl}async searchWorkspace(e,r,n){let o=await this.tryInit();if(!o)throw new Error("Workspace chunk search service not available");return await o.searchWorkspace(e,r,n)}},rzt=class{constructor(e,r){this._ctx=e;this._embeddingType=r;this._localEmbeddingsByWorkspace=new Map;this._localTfidfByWorkspace=new Map;this._diffTrackersByWorkspace=new Map;this._workspaceFileIndexes=new Map;let n=new ott(this._ctx),o=new uet(this._ctx);this._localDiffSearch=new Yet(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new aet(this._ctx),this._codeSearchChunkSearch=new det(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new Get(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new Xet(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new Uet(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&XE(this._ctx)&&(u.initialize(),c.triggerLocalIndexing(),l.initialize())}),n.onDidWorkspaceRemoved(s=>{let c=s.workspaceFolder.uri,l=this._diffTrackersByWorkspace.get(c);l&&(l.dispose(),this._diffTrackersByWorkspace.delete(c));let u=this._localTfidfByWorkspace.get(c);u&&(u.dispose(),this._localTfidfByWorkspace.delete(c));let d=this._localEmbeddingsByWorkspace.get(c);d&&(d.dispose(),this._localEmbeddingsByWorkspace.delete(c))})}static{a(this,"WorkspaceChunkSearchServiceImpl")}dispose(){this._githubCodeSearchService.dispose();for(let e of this._localTfidfByWorkspace.values())e.dispose();this._localTfidfByWorkspace.clear();for(let e of this._localEmbeddingsByWorkspace.values())e.dispose();this._localEmbeddingsByWorkspace.clear();for(let e of this._diffTrackersByWorkspace.values())e.dispose();this._diffTrackersByWorkspace.clear(),this._workspaceFileIndexes.clear()}async searchWorkspace(e,r,n){let o=new bj.StopWatch,s=await this.resolveQueryText(e,n);hl.info(this._ctx,"Starting semantic search",{resolvedQuery:s,maxResults:HA(r),tokenBudget:r.tokenBudget,workspaceFolders:r.workspaceFolders});let c=this.toQueryWithEmbeddings(e,s),l=await this.doSearchFileChunks(c,r,n);if(l.isError())throw hl.error(this._ctx,"Semantic search failed",l.err),Tg.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);hl.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,Bw.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);hl.info(this._ctx,"Chunks filtered",{beforeFilter:l.val.result.chunks.length,afterFilter:u.length});let d=await this.rerankChunks(c,u,HA(r),n),f=d.length,m=new Set(d.map(A=>A.chunk.file)).size,g=o.elapsed();return hl.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),Tg.sendAggregateSuccess(this._ctx,l.val.strategy,g,f,m,r.workspaceFolders.length,r.source),{chunks:d}}toQueryWithEmbeddings(e,r){let n;return{...e,resolveQueryEmbeddings:a(o=>(n??=this.computeQueryEmbedding(e,o,r),n),"resolveQueryEmbeddings")}}async computeQueryEmbedding(e,r,n){sm(r);let o=n??await this.resolveQueryText(e,r),s=await this.getEmbeddingComputer().computeEmbeddings(this._embeddingType,[o],{inputType:"query"},r);if(!s?.values.length)throw new Error("Failed to compute query embeddings");return s.values[0]}async resolveQueryText(e,r){try{return await e.resolveQuery(r)}catch(n){if(r2(n))throw n;return hl.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new jde(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){hl.info(this._ctx,"Starting semantic search with fallback strategy");let o=process.env.GITHUB_COPILOT_SIMULATION==="1"?1e6:12500;return this.runSearchStrategyWithFallback(this._codeSearchChunkSearch,()=>(0,Bw.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new bj.StopWatch;hl.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,Bw.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,Bw.raceCancellationError)((0,Bw.raceTimeout)(u,n),c);if(d?.isOk())return hl.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;hl.warn(this._ctx,`Primary strategy '${e.id}' failed or timed out, falling back to local search`,{elapsedTime:l.elapsed(),isTimeout:d===void 0,error:d?.isError()?d.err:void 0});let f=r();c.onCancellationRequested(()=>f.cancel()),f.then(()=>u.cancel(),()=>u.cancel());let h=new bj.StopWatch,m=await zet([u,f]);return hl.info(this._ctx,`Search operation completed in ${l.elapsed()}ms (fallback took ${h.elapsed()}ms)`,{totalTime:l.elapsed(),fallbackTime:h.elapsed(),success:m.isOk()}),m}async doSearchFileChunksLocally(e,r,n){hl.info(this._ctx,"Starting local file chunk search",{folderCount:r.workspaceFolders.length});let o=[],s=new Set;for(let l of r.workspaceFolders){let u=this._localEmbeddingsByWorkspace.get(l),d=this._localTfidfByWorkspace.get(l);if(u&&d){hl.info(this._ctx,`Both strategies available for folder: ${l}, using embeddings with TF-IDF fallback`);let f=8e3,h=new bj.StopWatch,m=await this.runSearchStrategyWithFallback(u,()=>(0,Bw.createCancelablePromise)(g=>this.runSearchStrategy(d,e,r,g)),f,e,r,n);m.isOk()&&(o.push(...m.val.result.chunks),s.add(m.val.strategy),hl.info(this._ctx,`Folder search completed in ${h.elapsed()}ms`,{folder:l,strategy:m.val.strategy,chunkCount:m.val.result.chunks.length,elapsedTime:h.elapsed()}))}else if(u){hl.info(this._ctx,`Using embeddings search for folder: ${l}`);let f=new bj.StopWatch,h=await this.runSearchStrategy(u,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(u.id),hl.info(this._ctx,`Embeddings search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else if(d){hl.info(this._ctx,`Using TF-IDF search for folder: ${l}`);let f=new bj.StopWatch,h=await this.runSearchStrategy(d,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(d.id),hl.info(this._ctx,`TF-IDF search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else hl.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return hl.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),cke.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new bj.StopWatch;hl.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,Bw.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(hl.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),cke.Result.ok({strategy:e.id,result:c})):(hl.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),cke.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(r2(c))throw hl.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return hl.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),cke.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,J2n.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(pc).evaluate(r.chunk.file,r.chunk.text)).isBlocked?null:r)))}async rerankChunks(e,r,n,o){if(!r.length)return[];try{let s,c=r.at(0)?.distance?.embeddingType;if(c&&r.every(f=>typeof f.distance<"u"&&f.distance.embeddingType.equals(c)))s=[...r].sort((f,h)=>h.distance.value-f.distance.value);else{let h=r.map((A,y)=>({...A.chunk,distance:A.distance,index:y})).filter(A=>typeof A.distance>"u"||!A.distance.embeddingType.equals(this._embeddingType)),m;if(h.length){hl.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,Bw.raceCancellationError)(A,o)}let g=[];for(let A=0;AA?.distance?.embeddingType.equals(this._embeddingType)).sort((A,y)=>y.distance.value-A.distance.value)}if(!s.length)return s;s=s.slice(0,n);let u=s[0].distance.value*xRe,d=s.filter(f=>f.distance.value>=u);return hl.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return r2(s)||hl.error(this._ctx,"Failed to search chunk embeddings index"),r.slice(0,n)}}async scoreChunks(e,r,n){if(!r.length)return[];let o=r.map(l=>this.chunkToIndexString(l)),[s,c]=await(0,Bw.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:wRe(s,l)}))}async computeEmbeddings(e,r,n){let o=await this.getEmbeddingComputer().computeEmbeddings(this._embeddingType,r,{inputType:e},n);if(!o)throw new Error("Failed to compute embeddings");return o}chunkToIndexString(e){return this.toStringForEmbeddingsComputer(e,ys(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=GA(e.text);return`File: \`${r}\` ${n} ${e.text} -${n}`}};var J2n=new pe("ProjectContextSkill"),Gkd=b.Object({uri:b.String(),snippet:b.String(),range:b.Object({start:b.Object({line:b.Number(),character:b.Number()}),end:b.Object({line:b.Number(),character:b.Number()})})}),qas=47,rzt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectContextSkillProcessor")}value(){return 1}async processSkill(e){if(this.turnContext.cancelationToken.isCancellationRequested){await this.turnContext.steps.cancel(jF);return}let r=[],n=this.turnContext.ctx.get(si),o=this.removeDuplicateSnippets(e);for(let s of o){let{uri:c,snippet:l,range:u}=s,d=await n.getOrReadTextDocument(s);if(d.status==="valid"){let f=new c5(d.document,u,u),h=new vr([l]),g=IRe(c)?.5:.8;r.push([`Code excerpt from file \`${ys(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(Wde,c,dd(d),u)}}if(r.length>0)return r.unshift([new vr(["The user wants you to consider the following snippets when computing your answer."]),1]),new vr(r)}removeDuplicateSnippets(e){let r={};return e.forEach(n=>{let o=`${n.uri}#[${n.range.start.line},${n.range.start.character}]-[${n.range.end.line},${n.range.end.character}]`;r[o]||(r[o]=n)}),Object.values(r)}},jF="collect-project-context",stt=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if(J2n.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(jF,"Collecting relevant project context"),!XE(e.ctx)){await e.steps.error(jF,"Workspace indexing is disabled by configuration");return}await e.info(ls`Project context is applied to this response, which may lead to slightly longer load times. For faster and more general Copilot responses, remove the project context option from your prompt.`);let r=e.ctx.get(R2);if(!r){await e.steps.error(jF,"Code search service for project context is unavailable");return}let n=[];if(e.turn.workspaceFolder&&n.push(e.turn.workspaceFolder.uri),e.turn.workspaceFolders)for(let u of e.turn.workspaceFolders)n.includes(u.uri)||n.push(u.uri);if(!n.length){await e.steps.error(jF,"No workspace folders available for search");return}let o=Mn(e.turn.request.message),c=await(this.dependencies.parseUserQuery??Nxn)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(jF,"No keywords parsed from user query");return}let l=c.join(" ");try{let u=await r.searchWorkspace({rawQuery:o,resolveQueryAndKeywords:a(async()=>Promise.resolve({rephrasedQuery:l,keywords:c.map(f=>({keyword:f,variations:[]}))}),"resolveQueryAndKeywords"),resolveQuery:a(async()=>Promise.resolve(l),"resolveQuery")},{tokenBudget:Oxn,maxResults:Math.min(10*c.length,qas),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??cSn)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(jF,"No project context found");return}return await e.steps.finish(jF),u.chunks.map(f=>({uri:f.chunk.file,snippet:f.chunk.text,range:{start:{line:f.chunk.range.startLineNumber,character:f.chunk.range.startColumn},end:{line:f.chunk.range.endLineNumber,character:f.chunk.range.endColumn}}}))}catch(u){await e.steps.error(jF,"Project context search failed"),J2n.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}},Wde="project-context",att=class extends T0{static{a(this,"ProjectContextSkill")}constructor(e){super(Wde,"Code snippets and documentation from the open project. This skill is useful when the user question is specific to the open project and its context. Do not include this skill for general programming questions.","Performing code search",()=>e,r=>new rzt(r),"implicit",["Relevant: How do I add a custom server route?","Relevant: Where is the code that processes the response from CopyableThreadElement?","Relevant: Where do I add tests for the InputValidation class?","Relevant: How to implement a shared buffer component","Not relevant: What does numpy do?"],r=>XE(r))}};var nzt=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[Wde]}};async function Iw(t){let e=[];return e.push(new gXe),e.push(...await t.get(C2).agents()),XE(t)&&e.push(new nzt),e.push(new aXe),e}a(Iw,"getAgents");p();p();var Fw=require("fs"),oZ=fe(require("path"));Fo();var Tg=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return kt(this.ctx,ze.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=oZ.dirname(o);await Fw.promises.mkdir(s,{recursive:!0,mode:448});let c=JSON.stringify(n)+` -`;await Fw.promises.appendFile(o,c,{encoding:"utf8",mode:384})}catch(o){ot.error(this.ctx,`Failed to append transcript event: ${o instanceof Error?o.message:String(o)}`)}}async initializePartition(e,r,n){if(!this.isEnabled())return;let o={type:"partition.created",data:{conversationId:String(e),partitionId:r,...n},id:Dt(),timestamp:new Date().toISOString(),parentId:null};await this.appendEvent(e,r,o)}getTranscriptPath(e,r){return`${e}/partition-${r}.jsonl`}getTranscriptFilePath(e,r){let n=this.getTranscriptDirectory();if(!n)throw new Error("Transcript directory not configured");return oZ.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return oZ.join(r,String(e))}async readTranscriptFile(e,r){if(!this.isEnabled())return[];try{let n=this.getTranscriptFilePath(e,r);return(await Fw.promises.readFile(n,"utf8")).trim().split(` -`).filter(c=>c.length>0).map(c=>JSON.parse(c))}catch(n){return n.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to read transcript file: ${n instanceof Error?n.message:String(n)}`),[])}}async listPartitionTranscripts(e){if(!this.isEnabled())return[];try{let r=this.getConversationDirectory(e);return(await Fw.promises.readdir(r)).filter(o=>o.startsWith("partition-")&&o.endsWith(".jsonl")&&!o.includes(".v")).map(o=>{let s=o.match(/^partition-(\d+)\.jsonl$/);return s?parseInt(s[1],10):NaN}).filter(o=>!isNaN(o)).sort((o,s)=>o-s)}catch(r){return r.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to list partition transcripts: ${r instanceof Error?r.message:String(r)}`),[])}}async deleteTranscript(e,r){if(this.isEnabled())try{let n=this.getTranscriptFilePath(e,r);await Fw.promises.unlink(n),ot.debug(this.ctx,`Deleted transcript: ${n}`)}catch(n){n.code!=="ENOENT"&&ot.error(this.ctx,`Failed to delete transcript: ${n instanceof Error?n.message:String(n)}`)}}async writeTranscriptFile(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=oZ.dirname(o);await Fw.promises.mkdir(s,{recursive:!0,mode:448});let c=n.map(l=>JSON.stringify(l)).join(` +${n}`}};var Z2n=new pe("ProjectContextSkill"),Vkd=b.Object({uri:b.String(),snippet:b.String(),range:b.Object({start:b.Object({line:b.Number(),character:b.Number()}),end:b.Object({line:b.Number(),character:b.Number()})})}),Has=47,nzt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectContextSkillProcessor")}value(){return 1}async processSkill(e){if(this.turnContext.cancelationToken.isCancellationRequested){await this.turnContext.steps.cancel(jF);return}let r=[],n=this.turnContext.ctx.get(si),o=this.removeDuplicateSnippets(e);for(let s of o){let{uri:c,snippet:l,range:u}=s,d=await n.getOrReadTextDocument(s);if(d.status==="valid"){let f=new c5(d.document,u,u),h=new vr([l]),g=IRe(c)?.5:.8;r.push([`Code excerpt from file \`${ys(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(zde,c,dd(d),u)}}if(r.length>0)return r.unshift([new vr(["The user wants you to consider the following snippets when computing your answer."]),1]),new vr(r)}removeDuplicateSnippets(e){let r={};return e.forEach(n=>{let o=`${n.uri}#[${n.range.start.line},${n.range.start.character}]-[${n.range.end.line},${n.range.end.character}]`;r[o]||(r[o]=n)}),Object.values(r)}},jF="collect-project-context",stt=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if(Z2n.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(jF,"Collecting relevant project context"),!XE(e.ctx)){await e.steps.error(jF,"Workspace indexing is disabled by configuration");return}await e.info(ls`Project context is applied to this response, which may lead to slightly longer load times. For faster and more general Copilot responses, remove the project context option from your prompt.`);let r=e.ctx.get(R2);if(!r){await e.steps.error(jF,"Code search service for project context is unavailable");return}let n=[];if(e.turn.workspaceFolder&&n.push(e.turn.workspaceFolder.uri),e.turn.workspaceFolders)for(let u of e.turn.workspaceFolders)n.includes(u.uri)||n.push(u.uri);if(!n.length){await e.steps.error(jF,"No workspace folders available for search");return}let o=Mn(e.turn.request.message),c=await(this.dependencies.parseUserQuery??Mxn)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(jF,"No keywords parsed from user query");return}let l=c.join(" ");try{let u=await r.searchWorkspace({rawQuery:o,resolveQueryAndKeywords:a(async()=>Promise.resolve({rephrasedQuery:l,keywords:c.map(f=>({keyword:f,variations:[]}))}),"resolveQueryAndKeywords"),resolveQuery:a(async()=>Promise.resolve(l),"resolveQuery")},{tokenBudget:Lxn,maxResults:Math.min(10*c.length,Has),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??lSn)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(jF,"No project context found");return}return await e.steps.finish(jF),u.chunks.map(f=>({uri:f.chunk.file,snippet:f.chunk.text,range:{start:{line:f.chunk.range.startLineNumber,character:f.chunk.range.startColumn},end:{line:f.chunk.range.endLineNumber,character:f.chunk.range.endColumn}}}))}catch(u){await e.steps.error(jF,"Project context search failed"),Z2n.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}},zde="project-context",att=class extends I0{static{a(this,"ProjectContextSkill")}constructor(e){super(zde,"Code snippets and documentation from the open project. This skill is useful when the user question is specific to the open project and its context. Do not include this skill for general programming questions.","Performing code search",()=>e,r=>new nzt(r),"implicit",["Relevant: How do I add a custom server route?","Relevant: Where is the code that processes the response from CopyableThreadElement?","Relevant: Where do I add tests for the InputValidation class?","Relevant: How to implement a shared buffer component","Not relevant: What does numpy do?"],r=>XE(r))}};var izt=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[zde]}};async function Iw(t){let e=[];return e.push(new gXe),e.push(...await t.get(C2).agents()),XE(t)&&e.push(new izt),e.push(new aXe),e}a(Iw,"getAgents");p();p();var Fw=require("fs"),sZ=fe(require("path"));Fo();var Ig=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return kt(this.ctx,ze.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=sZ.dirname(o);await Fw.promises.mkdir(s,{recursive:!0,mode:448});let c=JSON.stringify(n)+` +`;await Fw.promises.appendFile(o,c,{encoding:"utf8",mode:384})}catch(o){ot.error(this.ctx,`Failed to append transcript event: ${o instanceof Error?o.message:String(o)}`)}}async initializePartition(e,r,n){if(!this.isEnabled())return;let o={type:"partition.created",data:{conversationId:String(e),partitionId:r,...n},id:Dt(),timestamp:new Date().toISOString(),parentId:null};await this.appendEvent(e,r,o)}getTranscriptPath(e,r){return`${e}/partition-${r}.jsonl`}getTranscriptFilePath(e,r){let n=this.getTranscriptDirectory();if(!n)throw new Error("Transcript directory not configured");return sZ.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return sZ.join(r,String(e))}async readTranscriptFile(e,r){if(!this.isEnabled())return[];try{let n=this.getTranscriptFilePath(e,r);return(await Fw.promises.readFile(n,"utf8")).trim().split(` +`).filter(c=>c.length>0).map(c=>JSON.parse(c))}catch(n){return n.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to read transcript file: ${n instanceof Error?n.message:String(n)}`),[])}}async listPartitionTranscripts(e){if(!this.isEnabled())return[];try{let r=this.getConversationDirectory(e);return(await Fw.promises.readdir(r)).filter(o=>o.startsWith("partition-")&&o.endsWith(".jsonl")&&!o.includes(".v")).map(o=>{let s=o.match(/^partition-(\d+)\.jsonl$/);return s?parseInt(s[1],10):NaN}).filter(o=>!isNaN(o)).sort((o,s)=>o-s)}catch(r){return r.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to list partition transcripts: ${r instanceof Error?r.message:String(r)}`),[])}}async deleteTranscript(e,r){if(this.isEnabled())try{let n=this.getTranscriptFilePath(e,r);await Fw.promises.unlink(n),ot.debug(this.ctx,`Deleted transcript: ${n}`)}catch(n){n.code!=="ENOENT"&&ot.error(this.ctx,`Failed to delete transcript: ${n instanceof Error?n.message:String(n)}`)}}async writeTranscriptFile(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=sZ.dirname(o);await Fw.promises.mkdir(s,{recursive:!0,mode:448});let c=n.map(l=>JSON.stringify(l)).join(` `)+` -`;await Fw.promises.writeFile(o,c,{encoding:"utf8",mode:384}),ot.debug(this.ctx,`Wrote ${n.length} events to transcript: ${o}`)}catch(o){ot.error(this.ctx,`Failed to write transcript file: ${o instanceof Error?o.message:String(o)}`)}}getVersionedTranscriptFilePath(e,r,n){let o=this.getTranscriptDirectory();if(!o)throw new Error("Transcript directory not configured");return oZ.join(o,String(e),`partition-${r}.v${n}.jsonl`)}async readVersionedTranscriptFile(e,r,n){if(!this.isEnabled())return[];try{let o=this.getVersionedTranscriptFilePath(e,r,n);return(await Fw.promises.readFile(o,"utf8")).trim().split(` -`).filter(l=>l.length>0).map(l=>JSON.parse(l))}catch(o){return o.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to read versioned transcript file: ${o instanceof Error?o.message:String(o)}`),[])}}async buildPartitionFromVersionedTranscript(e,r,n){let o=await this.readVersionedTranscriptFile(e,r,n);if(o.length===0)return;let s=[];for(let l of o)switch(l.type){case"user.message":{let u=l.data.content,d=l.data.turnId,f=new lp({message:u,type:"user"},d);f.timestamp=new Date(l.timestamp).getTime(),s.push(f);break}case"assistant.message":{if(s.length>0){let u=s[s.length-1],d=l.data.content,f=Z2n(d);u.response={message:f,type:"model"}}break}case"assistant.turn_end":{if(s.length>0){let u=s[s.length-1];u.status==="in-progress"&&(u.status="success")}break}case"partition.created":{let u=l.data.summary;if(u&&l.data.compressedFrom){let d=new lp({message:u,type:"meta"},l.data.turnId);d.timestamp=new Date(l.timestamp).getTime(),d.response={message:"",type:"model"},d.status="success",s.push(d)}break}case"user.message_rendered":{let u=l.data.turnId,d=l.data.renderedMessage;if(u&&d){for(let f=s.length-1;f>=0;f--)if(String(s[f].id)===u){s[f].renderedUserMessage=d;break}}break}case"tool.execution_start":case"tool.execution_complete":case"session.start":case"assistant.turn_start":break}let c=(r-1)*10+1;return{conversationId:e,partitionId:r,turns:s,status:"archived",createdAt:s[0]?.timestamp??Date.now(),startTurnNumber:c,endTurnNumber:c+s.length-1,turnCount:s.length}}async archiveTranscriptsAsVersion(e,r,n){if(this.isEnabled())for(let o of r)try{let s=this.getTranscriptFilePath(e,o),c=this.getVersionedTranscriptFilePath(e,o,n);try{await Fw.promises.access(s)}catch{continue}await Fw.promises.copyFile(s,c),ot.debug(this.ctx,`Archived transcript: ${s} -> ${c}`)}catch(s){ot.error(this.ctx,`Failed to archive transcript for partition ${o}: ${s instanceof Error?s.message:String(s)}`)}}async replayTranscriptToTurns(e,r,n){let o=await this.readTranscriptFile(e,r);if(o.length===0)return[];let s=[],c=!1,l=new Map,u=new Map;for(let d of o){if(c)break;switch(d.type){case"user.message":{let f=d.data.content,h=d.data.turnId,m=new lp({message:f,type:"user"},h);m.timestamp=new Date(d.timestamp).getTime(),s.push(m),n!==void 0&&m.id===n&&(c=!0);break}case"assistant.message":{if(s.length>0){let f=s[s.length-1],h=d.data.content,m=Z2n(h);f.response={message:m,type:"model"}}break}case"assistant.turn_end":{if(s.length>0){let f=s[s.length-1];f.status==="in-progress"&&(f.status="success"),n!==void 0&&f.id===n&&(c=!0)}break}case"partition.created":{let f=d.data.summary;if(f&&d.data.compressedFrom){let h=new lp({message:f,type:"meta"},d.data.turnId);h.timestamp=new Date(d.timestamp).getTime(),h.response={message:"",type:"model"},h.status="success",s.push(h)}break}case"tool.execution_start":{let f=d.data.toolCallId;if(f){let h=l.get(f)||{};h.start=d,l.set(f,h),s.length>0&&u.set(f,s.length-1)}break}case"tool.execution_complete":{let f=d.data.toolCallId;if(f){let h=l.get(f)||{};h.complete=d,l.set(f,h)}break}case"user.message_rendered":{let f=d.data.turnId,h=d.data.renderedMessage;if(f&&h){for(let m=s.length-1;m>=0;m--)if(String(s[m].id)===f){s[m].renderedUserMessage=h;break}}break}case"session.start":case"assistant.turn_start":break}}return this.reconstructToolCallsForTurns(s,l,u),ot.debug(this.ctx,`Replayed transcript: partitionId=${r}, events=${o.length}, turns=${s.length}`),s}reconstructToolCallsForTurns(e,r,n){let o=new Map;for(let[s,c]of r){let l=n.get(s);if(l===void 0){ot.debug(this.ctx,`Tool call ${s} has no associated turn`);continue}let u=this.reconstructToolCallFromEvents(s,c);if(u){let d=o.get(l)||[];d.push(u),o.set(l,d)}}for(let[s,c]of o)if(s0){let l=e[s],u=[{roundId:1,toolCalls:c}];l.restoredToolCalls=u}}reconstructToolCallFromEvents(e,r){let{start:n,complete:o}=r;if(!n){ot.debug(this.ctx,`Tool call ${e} has no start event`);return}let s=n.data.toolName||"unknown",c=n.data.arguments,l="running",u,d,f,h,m;if(o){let A=o.data.success;o.data.status==="Cancelled"?l="cancelled":A?l="completed":l="error";let _=o.data.result;_&&(u=_.result,d=_.error,f=_.resultDetails,h=_.toolSpecificData,m=_.progressMessage)}let g={id:e,name:s,toolType:"default",status:l,input:c};return u&&(g.result=u),d&&(g.error=d),f&&(g.resultDetails=f),h&&(g.toolSpecificData=h),m&&(g.progressMessage=m),g}async buildPartitionFromTranscript(e,r){let n=await this.replayTranscriptToTurns(e,r);if(n.length===0&&(await this.readTranscriptFile(e,r)).length===0)return;let o=(r-1)*10+1;return{conversationId:e,partitionId:r,turns:n,status:"active",createdAt:n[0]?.timestamp??Date.now(),startTurnNumber:o,endTurnNumber:o+n.length-1,turnCount:n.length}}async findTurnInTranscripts(e,r){let n=await this.listPartitionTranscripts(e);if(n.length===0)return;let o=String(r);for(let s=n.length-1;s>=0;s--){let c=n[s];if(!(await this.readTranscriptFile(e,c)).some(h=>(h.type==="user.message"||h.type==="assistant.turn_end")&&h.data&&String(h.data.turnId)===o))continue;let d=await this.replayTranscriptToTurns(e,c),f=d.findIndex(h=>String(h.id)===o);if(f!==-1)return{partitionId:c,turnIndex:f};if(d.length>0){let h=d[d.length-1];return ot.info(this.ctx,`Turn ${o} referenced in partition ${c} events but not in replayed turns (split-turn from compression). Resolving to turn ${h.id}.`),{partitionId:c,turnIndex:d.length-1,resolvedTurnId:h.id}}}}async deriveMetadata(e){let r=await this.listPartitionTranscripts(e);if(r.length===0)return;let n=Math.max(...r),o=r.length,s=Date.now(),c=Math.min(...r),l=await this.readTranscriptFile(e,c);l.length>0&&(s=new Date(l[0].timestamp).getTime());let u=Date.now(),d=await this.readTranscriptFile(e,n);if(d.length>0){let h=d[d.length-1];u=new Date(h.timestamp).getTime()}let f=await this.listArchivedVersions(e);return{conversationId:e,currentPartitionId:n,totalPartitions:o,createdAt:s,lastActivity:u,archivedVersions:f.length>0?f:void 0}}async listArchivedVersions(e){if(!this.isEnabled())return[];try{let r=this.getConversationDirectory(e),n=await Fw.promises.readdir(r),o=new Set;for(let s of n){let c=s.match(/partition-\d+\.v(\d+)\.jsonl$/);c&&o.add(parseInt(c[1],10))}return Array.from(o).sort((s,c)=>c-s)}catch(r){return r.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to list archived versions: ${r instanceof Error?r.message:String(r)}`),[])}}};function X2n(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:Dt(),timestamp:new Date().toISOString(),parentId:r}}a(X2n,"createUserMessageEvent");function eDn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:Dt(),timestamp:new Date().toISOString(),parentId:r}}a(eDn,"createUserMessageRenderedEvent");function ctt(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:Dt(),timestamp:new Date().toISOString(),parentId:r}}a(ctt,"createAssistantMessageEvent");function tDn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:Dt(),timestamp:new Date().toISOString(),parentId:n}}a(tDn,"createToolExecutionStartEvent");function rDn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:Dt(),timestamp:new Date().toISOString(),parentId:n}}a(rDn,"createToolExecutionCompleteEvent");function ltt(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:Dt(),timestamp:new Date().toISOString(),parentId:e}}a(ltt,"createAssistantTurnStartEvent");function zde(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:Dt(),timestamp:new Date().toISOString(),parentId:r}}a(zde,"createAssistantTurnEndEvent");function Z2n(t){try{let e=JSON.parse(t);if(Array.isArray(e)&&e.length>0&&typeof e[0]=="object"&&e[0]&&"role"in e[0])return e}catch{}return t}a(Z2n,"parseAssistantMessageContent");var HF=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},T5=class{constructor(e){this.ctx=e;this.transcriptPersistence=new Tg(e)}static{a(this,"ConversationRestoration")}async findTurnInPartitions(e,r){ot.debug(this.ctx,`Finding turn in partitions: conversationId=${e}, turnId=${r}`);let n=await this.transcriptPersistence.findTurnInTranscripts(e,r);if(n)return ot.debug(this.ctx,`Turn found in transcript: conversationId=${e}, turnId=${r}, partitionId=${n.partitionId}, turnIndex=${n.turnIndex}`),n;ot.debug(this.ctx,`Turn not found: conversationId=${e}, turnId=${r}`)}async loadPartitionForRestoration(e,r){ot.debug(this.ctx,`Loading partition for restoration: conversationId=${e}, partitionId=${r}`);let n=await this.transcriptPersistence.buildPartitionFromTranscript(e,r);if(!n){let o=new HF(`Partition not found: conversationId=${e}, partitionId=${r}`,"PARTITION_NOT_FOUND");throw ot.error(this.ctx,o.message),o}if(!Array.isArray(n.turns)){let o=new HF(`Invalid partition data: turns is not an array: conversationId=${e}, partitionId=${r}`,"INVALID_PARTITION_DATA");throw ot.error(this.ctx,o.message),o}return ot.debug(this.ctx,`Partition built from transcript: conversationId=${e}, partitionId=${r}, turnCount=${n.turns.length}`),n}async loadVersionedPartition(e,r,n){ot.debug(this.ctx,`Loading versioned partition: conversationId=${e}, partitionId=${r}, version=${n}`);let o=await this.transcriptPersistence.buildPartitionFromVersionedTranscript(e,r,n);if(!o){let s=new HF(`Versioned partition not found: conversationId=${e}, partitionId=${r}, version=${n}`,"PARTITION_NOT_FOUND");throw ot.error(this.ctx,s.message),s}if(!Array.isArray(o.turns)){let s=new HF("Invalid versioned partition data: turns is not an array","INVALID_PARTITION_DATA");throw ot.error(this.ctx,s.message),s}return o}reconstructTurns(e,r){let n=e.turns.findIndex(s=>s.id===r);if(n===-1)throw new HF(`Turn not found in partition: turnId=${r}, partitionId=${e.partitionId}`,"TURN_NOT_FOUND");let o=e.turns.slice(0,n+1);return ot.debug(this.ctx,`Reconstructed turns: partitionId=${e.partitionId}, targetTurnIndex=${n}, turnCount=${o.length}`),o.map(s=>this.ensureTurnInstance(s))}async isLatestTurn(e,r,n,o){if(n.partitionId!==o.currentPartitionId)return ot.debug(this.ctx,`Turn ${r} is not in current partition (in P${n.partitionId}, current is P${o.currentPartitionId})`),!1;let s=await this.transcriptPersistence.replayTranscriptToTurns(e,o.currentPartitionId);if(s.length===0)return!1;let c=s[s.length-1],l=c.id===r;return ot.debug(this.ctx,`Turn ${r} isLatest=${l} (last turn is ${c.id})`),l}async createVersionArchive(e,r,n,o){if(o.length===0)return r;ot.info(this.ctx,`Creating version archive: conversationId=${e}, versionTimestamp=${n}, partitions=${o.join(",")}`),await this.archiveTranscriptsAsVersion(e,o,n),ot.debug(this.ctx,`Archived ${o.length} transcript partitions with version ${n}`);for(let c of o)await this.transcriptPersistence.deleteTranscript(e,c);return{...r,archivedVersions:[...r.archivedVersions??[],n],lastActivity:Date.now()}}async archiveTranscriptsAsVersion(e,r,n){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.archiveTranscriptsAsVersion(e,r,n)}catch(o){ot.error(this.ctx,`Failed to archive transcripts: ${o instanceof Error?o.message:String(o)}`)}}async restoreConversation(e,r){let n=Date.now(),o=r;ot.debug(this.ctx,`Starting conversation restoration: conversationId=${e}, targetTurnId=${o}`),this.sendStartedTelemetry(e,o);try{let s=await this.transcriptPersistence.deriveMetadata(e);if(!s){let m=new HF(`No transcripts found for conversation: conversationId=${e}`,"CONVERSATION_NOT_FOUND");throw ot.error(this.ctx,m.message),this.sendFailedTelemetry(e,o,m.code,Date.now()-n),m}let c=await this.findTurnInPartitions(e,o);if(!c){ot.debug(this.ctx,`Turn not found for restoration: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"TURN_NOT_FOUND",Date.now()-n);return}c.resolvedTurnId&&(ot.info(this.ctx,`Turn ${o} resolved to ${c.resolvedTurnId} in partition ${c.partitionId} (split-turn from compression)`),o=c.resolvedTurnId);let l=await this.isLatestTurn(e,o,c,s),u;if(!l){let m=Date.now(),A=(await this.transcriptPersistence.listPartitionTranscripts(e)).filter(y=>y>=c.partitionId);s=await this.createVersionArchive(e,s,m,A),u=m,ot.info(this.ctx,`Version created: conversationId=${e}, version=${m}`)}let d;u?d=await this.loadVersionedPartition(e,c.partitionId,u):d=await this.loadPartitionForRestoration(e,c.partitionId);let f=this.reconstructTurns(d,o);u&&(await this.rewritePartitionTranscriptFromVersion(e,c.partitionId,o,u),s={...s,currentPartitionId:c.partitionId,totalPartitions:c.partitionId,lastActivity:Date.now()});let h=Date.now()-n;return ot.info(this.ctx,`Conversation restored: conversationId=${e}, partitionId=${c.partitionId}, turnCount=${f.length}, versionCreated=${u??"none"}, duration=${h}ms`),this.sendCompletedTelemetry(e,o,c.partitionId,f.length,h),{partitionId:c.partitionId,turns:f,metadata:s,partition:d,versionCreated:u}}catch(s){throw s instanceof HF||(ot.exception(this.ctx,s,`Restoration failed: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"UNKNOWN",Date.now()-n)),s}}ensureTurnInstance(e){if(e instanceof lp)return e;let r=e,n=new lp(r.request,r.id);return n.timestamp=r.timestamp??Date.now(),n.response=r.response,n.status=r.status??"success",n.skills=r.skills??[],n.ignoredSkills=r.ignoredSkills??[],n.annotations=r.annotations??[],n.workspaceFolder=r.workspaceFolder,n.workspaceFolders=r.workspaceFolders,n.agent=r.agent,n.template=r.template,n.confirmationRequest=r.confirmationRequest,n.confirmationResponse=r.confirmationResponse,n.chatMode=r.chatMode,n.needToolCallConfirmation=r.needToolCallConfirmation,n.userRequestedModel=r.userRequestedModel,n.resolvedModelConfiguration=r.resolvedModelConfiguration,n}async initializeRestoredTranscript(e,r){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.initializePartition(e,r,{source:"restoration"})}catch(n){ot.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)}}sliceTranscriptEventsToTurn(e,r){let n=String(r),o=[],s=!1;for(let c of e){if(s&&c.type==="user.message"){let l=c.data.turnId;if(l!==void 0&&String(l)!==n)break}if(o.push(c),!s){if(c.type==="user.message"){let l=c.data.turnId;l!==void 0&&String(l)===n&&(s=!0)}else if(c.type==="partition.created"){let l=c.data.turnId;l!==void 0&&String(l)===n&&(s=!0)}}}return o}async rewritePartitionTranscriptFromVersion(e,r,n,o){if(this.transcriptPersistence.isEnabled())try{let s=await this.transcriptPersistence.readVersionedTranscriptFile(e,r,o);if(s.length===0){ot.warn(this.ctx,`No versioned transcript events found when rewriting: conversationId=${e}, partitionId=${r}, version=${o}`);return}let c=this.sliceTranscriptEventsToTurn(s,n);await this.transcriptPersistence.writeTranscriptFile(e,r,c)}catch(s){ot.error(this.ctx,`Failed to rewrite transcript from version: conversationId=${e}, partitionId=${r}, version=${o}, error=${s instanceof Error?s.message:String(s)}`)}}sendStartedTelemetry(e,r){let n=Vt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r)},{});ft(this.ctx,"conversationPartition.restoration.started",n,0)}sendCompletedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),partitionId:String(n)},{turnCount:o,restorationTimeMs:s});ft(this.ctx,"conversationPartition.restoration.completed",c,0)}sendFailedTelemetry(e,r,n,o){let s=Vt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),errorCode:n},{restorationTimeMs:o});ft(this.ctx,"conversationPartition.restoration.failed",s,0)}};p();p();p();p();var nDn={id:0,start_offset:0,stop_offset:0,type:"ip_code_citations",details:{},citations:{snippet:`html lang="en"> +`;await Fw.promises.writeFile(o,c,{encoding:"utf8",mode:384}),ot.debug(this.ctx,`Wrote ${n.length} events to transcript: ${o}`)}catch(o){ot.error(this.ctx,`Failed to write transcript file: ${o instanceof Error?o.message:String(o)}`)}}getVersionedTranscriptFilePath(e,r,n){let o=this.getTranscriptDirectory();if(!o)throw new Error("Transcript directory not configured");return sZ.join(o,String(e),`partition-${r}.v${n}.jsonl`)}async readVersionedTranscriptFile(e,r,n){if(!this.isEnabled())return[];try{let o=this.getVersionedTranscriptFilePath(e,r,n);return(await Fw.promises.readFile(o,"utf8")).trim().split(` +`).filter(l=>l.length>0).map(l=>JSON.parse(l))}catch(o){return o.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to read versioned transcript file: ${o instanceof Error?o.message:String(o)}`),[])}}async buildPartitionFromVersionedTranscript(e,r,n){let o=await this.readVersionedTranscriptFile(e,r,n);if(o.length===0)return;let s=[];for(let l of o)switch(l.type){case"user.message":{let u=l.data.content,d=l.data.turnId,f=new lp({message:u,type:"user"},d);f.timestamp=new Date(l.timestamp).getTime(),s.push(f);break}case"assistant.message":{if(s.length>0){let u=s[s.length-1],d=l.data.content,f=X2n(d);u.response={message:f,type:"model"}}break}case"assistant.turn_end":{if(s.length>0){let u=s[s.length-1];u.status==="in-progress"&&(u.status="success")}break}case"partition.created":{let u=l.data.summary;if(u&&l.data.compressedFrom){let d=new lp({message:u,type:"meta"},l.data.turnId);d.timestamp=new Date(l.timestamp).getTime(),d.response={message:"",type:"model"},d.status="success",s.push(d)}break}case"user.message_rendered":{let u=l.data.turnId,d=l.data.renderedMessage;if(u&&d){for(let f=s.length-1;f>=0;f--)if(String(s[f].id)===u){s[f].renderedUserMessage=d;break}}break}case"tool.execution_start":case"tool.execution_complete":case"session.start":case"assistant.turn_start":break}let c=(r-1)*10+1;return{conversationId:e,partitionId:r,turns:s,status:"archived",createdAt:s[0]?.timestamp??Date.now(),startTurnNumber:c,endTurnNumber:c+s.length-1,turnCount:s.length}}async archiveTranscriptsAsVersion(e,r,n){if(this.isEnabled())for(let o of r)try{let s=this.getTranscriptFilePath(e,o),c=this.getVersionedTranscriptFilePath(e,o,n);try{await Fw.promises.access(s)}catch{continue}await Fw.promises.copyFile(s,c),ot.debug(this.ctx,`Archived transcript: ${s} -> ${c}`)}catch(s){ot.error(this.ctx,`Failed to archive transcript for partition ${o}: ${s instanceof Error?s.message:String(s)}`)}}async replayTranscriptToTurns(e,r,n){let o=await this.readTranscriptFile(e,r);if(o.length===0)return[];let s=[],c=!1,l=new Map,u=new Map;for(let d of o){if(c)break;switch(d.type){case"user.message":{let f=d.data.content,h=d.data.turnId,m=new lp({message:f,type:"user"},h);m.timestamp=new Date(d.timestamp).getTime(),s.push(m),n!==void 0&&m.id===n&&(c=!0);break}case"assistant.message":{if(s.length>0){let f=s[s.length-1],h=d.data.content,m=X2n(h);f.response={message:m,type:"model"}}break}case"assistant.turn_end":{if(s.length>0){let f=s[s.length-1];f.status==="in-progress"&&(f.status="success"),n!==void 0&&f.id===n&&(c=!0)}break}case"partition.created":{let f=d.data.summary;if(f&&d.data.compressedFrom){let h=new lp({message:f,type:"meta"},d.data.turnId);h.timestamp=new Date(d.timestamp).getTime(),h.response={message:"",type:"model"},h.status="success",s.push(h)}break}case"tool.execution_start":{let f=d.data.toolCallId;if(f){let h=l.get(f)||{};h.start=d,l.set(f,h),s.length>0&&u.set(f,s.length-1)}break}case"tool.execution_complete":{let f=d.data.toolCallId;if(f){let h=l.get(f)||{};h.complete=d,l.set(f,h)}break}case"user.message_rendered":{let f=d.data.turnId,h=d.data.renderedMessage;if(f&&h){for(let m=s.length-1;m>=0;m--)if(String(s[m].id)===f){s[m].renderedUserMessage=h;break}}break}case"session.start":case"assistant.turn_start":break}}return this.reconstructToolCallsForTurns(s,l,u),ot.debug(this.ctx,`Replayed transcript: partitionId=${r}, events=${o.length}, turns=${s.length}`),s}reconstructToolCallsForTurns(e,r,n){let o=new Map;for(let[s,c]of r){let l=n.get(s);if(l===void 0){ot.debug(this.ctx,`Tool call ${s} has no associated turn`);continue}let u=this.reconstructToolCallFromEvents(s,c);if(u){let d=o.get(l)||[];d.push(u),o.set(l,d)}}for(let[s,c]of o)if(s0){let l=e[s],u=[{roundId:1,toolCalls:c}];l.restoredToolCalls=u}}reconstructToolCallFromEvents(e,r){let{start:n,complete:o}=r;if(!n){ot.debug(this.ctx,`Tool call ${e} has no start event`);return}let s=n.data.toolName||"unknown",c=n.data.arguments,l="running",u,d,f,h,m;if(o){let A=o.data.success;o.data.status==="Cancelled"?l="cancelled":A?l="completed":l="error";let _=o.data.result;_&&(u=_.result,d=_.error,f=_.resultDetails,h=_.toolSpecificData,m=_.progressMessage)}let g={id:e,name:s,toolType:"default",status:l,input:c};return u&&(g.result=u),d&&(g.error=d),f&&(g.resultDetails=f),h&&(g.toolSpecificData=h),m&&(g.progressMessage=m),g}async buildPartitionFromTranscript(e,r){let n=await this.replayTranscriptToTurns(e,r);if(n.length===0&&(await this.readTranscriptFile(e,r)).length===0)return;let o=(r-1)*10+1;return{conversationId:e,partitionId:r,turns:n,status:"active",createdAt:n[0]?.timestamp??Date.now(),startTurnNumber:o,endTurnNumber:o+n.length-1,turnCount:n.length}}async findTurnInTranscripts(e,r){let n=await this.listPartitionTranscripts(e);if(n.length===0)return;let o=String(r);for(let s=n.length-1;s>=0;s--){let c=n[s];if(!(await this.readTranscriptFile(e,c)).some(h=>(h.type==="user.message"||h.type==="assistant.turn_end")&&h.data&&String(h.data.turnId)===o))continue;let d=await this.replayTranscriptToTurns(e,c),f=d.findIndex(h=>String(h.id)===o);if(f!==-1)return{partitionId:c,turnIndex:f};if(d.length>0){let h=d[d.length-1];return ot.info(this.ctx,`Turn ${o} referenced in partition ${c} events but not in replayed turns (split-turn from compression). Resolving to turn ${h.id}.`),{partitionId:c,turnIndex:d.length-1,resolvedTurnId:h.id}}}}async deriveMetadata(e){let r=await this.listPartitionTranscripts(e);if(r.length===0)return;let n=Math.max(...r),o=r.length,s=Date.now(),c=Math.min(...r),l=await this.readTranscriptFile(e,c);l.length>0&&(s=new Date(l[0].timestamp).getTime());let u=Date.now(),d=await this.readTranscriptFile(e,n);if(d.length>0){let h=d[d.length-1];u=new Date(h.timestamp).getTime()}let f=await this.listArchivedVersions(e);return{conversationId:e,currentPartitionId:n,totalPartitions:o,createdAt:s,lastActivity:u,archivedVersions:f.length>0?f:void 0}}async listArchivedVersions(e){if(!this.isEnabled())return[];try{let r=this.getConversationDirectory(e),n=await Fw.promises.readdir(r),o=new Set;for(let s of n){let c=s.match(/partition-\d+\.v(\d+)\.jsonl$/);c&&o.add(parseInt(c[1],10))}return Array.from(o).sort((s,c)=>c-s)}catch(r){return r.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to list archived versions: ${r instanceof Error?r.message:String(r)}`),[])}}};function eDn(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:Dt(),timestamp:new Date().toISOString(),parentId:r}}a(eDn,"createUserMessageEvent");function tDn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:Dt(),timestamp:new Date().toISOString(),parentId:r}}a(tDn,"createUserMessageRenderedEvent");function ctt(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:Dt(),timestamp:new Date().toISOString(),parentId:r}}a(ctt,"createAssistantMessageEvent");function rDn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:Dt(),timestamp:new Date().toISOString(),parentId:n}}a(rDn,"createToolExecutionStartEvent");function nDn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:Dt(),timestamp:new Date().toISOString(),parentId:n}}a(nDn,"createToolExecutionCompleteEvent");function ltt(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:Dt(),timestamp:new Date().toISOString(),parentId:e}}a(ltt,"createAssistantTurnStartEvent");function Yde(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:Dt(),timestamp:new Date().toISOString(),parentId:r}}a(Yde,"createAssistantTurnEndEvent");function X2n(t){try{let e=JSON.parse(t);if(Array.isArray(e)&&e.length>0&&typeof e[0]=="object"&&e[0]&&"role"in e[0])return e}catch{}return t}a(X2n,"parseAssistantMessageContent");var HF=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},T5=class{constructor(e){this.ctx=e;this.transcriptPersistence=new Ig(e)}static{a(this,"ConversationRestoration")}async findTurnInPartitions(e,r){ot.debug(this.ctx,`Finding turn in partitions: conversationId=${e}, turnId=${r}`);let n=await this.transcriptPersistence.findTurnInTranscripts(e,r);if(n)return ot.debug(this.ctx,`Turn found in transcript: conversationId=${e}, turnId=${r}, partitionId=${n.partitionId}, turnIndex=${n.turnIndex}`),n;ot.debug(this.ctx,`Turn not found: conversationId=${e}, turnId=${r}`)}async loadPartitionForRestoration(e,r){ot.debug(this.ctx,`Loading partition for restoration: conversationId=${e}, partitionId=${r}`);let n=await this.transcriptPersistence.buildPartitionFromTranscript(e,r);if(!n){let o=new HF(`Partition not found: conversationId=${e}, partitionId=${r}`,"PARTITION_NOT_FOUND");throw ot.error(this.ctx,o.message),o}if(!Array.isArray(n.turns)){let o=new HF(`Invalid partition data: turns is not an array: conversationId=${e}, partitionId=${r}`,"INVALID_PARTITION_DATA");throw ot.error(this.ctx,o.message),o}return ot.debug(this.ctx,`Partition built from transcript: conversationId=${e}, partitionId=${r}, turnCount=${n.turns.length}`),n}async loadVersionedPartition(e,r,n){ot.debug(this.ctx,`Loading versioned partition: conversationId=${e}, partitionId=${r}, version=${n}`);let o=await this.transcriptPersistence.buildPartitionFromVersionedTranscript(e,r,n);if(!o){let s=new HF(`Versioned partition not found: conversationId=${e}, partitionId=${r}, version=${n}`,"PARTITION_NOT_FOUND");throw ot.error(this.ctx,s.message),s}if(!Array.isArray(o.turns)){let s=new HF("Invalid versioned partition data: turns is not an array","INVALID_PARTITION_DATA");throw ot.error(this.ctx,s.message),s}return o}reconstructTurns(e,r){let n=e.turns.findIndex(s=>s.id===r);if(n===-1)throw new HF(`Turn not found in partition: turnId=${r}, partitionId=${e.partitionId}`,"TURN_NOT_FOUND");let o=e.turns.slice(0,n+1);return ot.debug(this.ctx,`Reconstructed turns: partitionId=${e.partitionId}, targetTurnIndex=${n}, turnCount=${o.length}`),o.map(s=>this.ensureTurnInstance(s))}async isLatestTurn(e,r,n,o){if(n.partitionId!==o.currentPartitionId)return ot.debug(this.ctx,`Turn ${r} is not in current partition (in P${n.partitionId}, current is P${o.currentPartitionId})`),!1;let s=await this.transcriptPersistence.replayTranscriptToTurns(e,o.currentPartitionId);if(s.length===0)return!1;let c=s[s.length-1],l=c.id===r;return ot.debug(this.ctx,`Turn ${r} isLatest=${l} (last turn is ${c.id})`),l}async createVersionArchive(e,r,n,o){if(o.length===0)return r;ot.info(this.ctx,`Creating version archive: conversationId=${e}, versionTimestamp=${n}, partitions=${o.join(",")}`),await this.archiveTranscriptsAsVersion(e,o,n),ot.debug(this.ctx,`Archived ${o.length} transcript partitions with version ${n}`);for(let c of o)await this.transcriptPersistence.deleteTranscript(e,c);return{...r,archivedVersions:[...r.archivedVersions??[],n],lastActivity:Date.now()}}async archiveTranscriptsAsVersion(e,r,n){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.archiveTranscriptsAsVersion(e,r,n)}catch(o){ot.error(this.ctx,`Failed to archive transcripts: ${o instanceof Error?o.message:String(o)}`)}}async restoreConversation(e,r){let n=Date.now(),o=r;ot.debug(this.ctx,`Starting conversation restoration: conversationId=${e}, targetTurnId=${o}`),this.sendStartedTelemetry(e,o);try{let s=await this.transcriptPersistence.deriveMetadata(e);if(!s){let m=new HF(`No transcripts found for conversation: conversationId=${e}`,"CONVERSATION_NOT_FOUND");throw ot.error(this.ctx,m.message),this.sendFailedTelemetry(e,o,m.code,Date.now()-n),m}let c=await this.findTurnInPartitions(e,o);if(!c){ot.debug(this.ctx,`Turn not found for restoration: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"TURN_NOT_FOUND",Date.now()-n);return}c.resolvedTurnId&&(ot.info(this.ctx,`Turn ${o} resolved to ${c.resolvedTurnId} in partition ${c.partitionId} (split-turn from compression)`),o=c.resolvedTurnId);let l=await this.isLatestTurn(e,o,c,s),u;if(!l){let m=Date.now(),A=(await this.transcriptPersistence.listPartitionTranscripts(e)).filter(y=>y>=c.partitionId);s=await this.createVersionArchive(e,s,m,A),u=m,ot.info(this.ctx,`Version created: conversationId=${e}, version=${m}`)}let d;u?d=await this.loadVersionedPartition(e,c.partitionId,u):d=await this.loadPartitionForRestoration(e,c.partitionId);let f=this.reconstructTurns(d,o);u&&(await this.rewritePartitionTranscriptFromVersion(e,c.partitionId,o,u),s={...s,currentPartitionId:c.partitionId,totalPartitions:c.partitionId,lastActivity:Date.now()});let h=Date.now()-n;return ot.info(this.ctx,`Conversation restored: conversationId=${e}, partitionId=${c.partitionId}, turnCount=${f.length}, versionCreated=${u??"none"}, duration=${h}ms`),this.sendCompletedTelemetry(e,o,c.partitionId,f.length,h),{partitionId:c.partitionId,turns:f,metadata:s,partition:d,versionCreated:u}}catch(s){throw s instanceof HF||(ot.exception(this.ctx,s,`Restoration failed: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"UNKNOWN",Date.now()-n)),s}}ensureTurnInstance(e){if(e instanceof lp)return e;let r=e,n=new lp(r.request,r.id);return n.timestamp=r.timestamp??Date.now(),n.response=r.response,n.status=r.status??"success",n.skills=r.skills??[],n.ignoredSkills=r.ignoredSkills??[],n.annotations=r.annotations??[],n.workspaceFolder=r.workspaceFolder,n.workspaceFolders=r.workspaceFolders,n.agent=r.agent,n.template=r.template,n.confirmationRequest=r.confirmationRequest,n.confirmationResponse=r.confirmationResponse,n.chatMode=r.chatMode,n.needToolCallConfirmation=r.needToolCallConfirmation,n.userRequestedModel=r.userRequestedModel,n.resolvedModelConfiguration=r.resolvedModelConfiguration,n}async initializeRestoredTranscript(e,r){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.initializePartition(e,r,{source:"restoration"})}catch(n){ot.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)}}sliceTranscriptEventsToTurn(e,r){let n=String(r),o=[],s=!1;for(let c of e){if(s&&c.type==="user.message"){let l=c.data.turnId;if(l!==void 0&&String(l)!==n)break}if(o.push(c),!s){if(c.type==="user.message"){let l=c.data.turnId;l!==void 0&&String(l)===n&&(s=!0)}else if(c.type==="partition.created"){let l=c.data.turnId;l!==void 0&&String(l)===n&&(s=!0)}}}return o}async rewritePartitionTranscriptFromVersion(e,r,n,o){if(this.transcriptPersistence.isEnabled())try{let s=await this.transcriptPersistence.readVersionedTranscriptFile(e,r,o);if(s.length===0){ot.warn(this.ctx,`No versioned transcript events found when rewriting: conversationId=${e}, partitionId=${r}, version=${o}`);return}let c=this.sliceTranscriptEventsToTurn(s,n);await this.transcriptPersistence.writeTranscriptFile(e,r,c)}catch(s){ot.error(this.ctx,`Failed to rewrite transcript from version: conversationId=${e}, partitionId=${r}, version=${o}, error=${s instanceof Error?s.message:String(s)}`)}}sendStartedTelemetry(e,r){let n=Vt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r)},{});ft(this.ctx,"conversationPartition.restoration.started",n,0)}sendCompletedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),partitionId:String(n)},{turnCount:o,restorationTimeMs:s});ft(this.ctx,"conversationPartition.restoration.completed",c,0)}sendFailedTelemetry(e,r,n,o){let s=Vt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),errorCode:n},{restorationTimeMs:o});ft(this.ctx,"conversationPartition.restoration.failed",s,0)}};p();p();p();p();var iDn={id:0,start_offset:0,stop_offset:0,type:"ip_code_citations",details:{},citations:{snippet:`html lang="en"> Canvas Example -<`,url:"https://github.com/duonghle285/gnoud9x.github.io/tree/c95127bc5b7a491d9223f21ac3b8c5100996e754/26062020-vehinhchunhat%2Findex.html",ip_type:"LICENSE",license:"NOASSERTION"}},iDn="Alright, This response contains a code citation.";p();var oDn=` +<`,url:"https://github.com/duonghle285/gnoud9x.github.io/tree/c95127bc5b7a491d9223f21ac3b8c5100996e754/26062020-vehinhchunhat%2Findex.html",ip_type:"LICENSE",license:"NOASSERTION"}},oDn="Alright, This response contains a code citation.";p();var sDn=` # Should render ## Links @@ -3091,7 +3091,7 @@ Only img src/alt and a href attributes should make it to the dom. The following paragraph should not render the \`id\` attribute in the dom.

This is a paragraph with an id

-`;p();var sDn="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",jas=95,Has={agent:"agent_mode_limit_exceeded",overloaded:"model_overloaded",upstream:"upstream_provider_rate_limit",global:"user_global_rate_limited",model:"user_model_rate_limited",integration:"integration_rate_limited",unknown:"some_new_code"};function aDn(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(aDn,"parseFirstNumber");function Gas(t){return Math.min(100,Math.max(0,t))}a(Gas,"clampPercentage");function $as(t){return t.includes("session")?"session":"weekly"}a($as,"getRateLimitNotificationKind");function Vas(t,e,r){let n=que(r);return t==="session"?`You've used ${e}% of your session rate limit. Your session rate limit will reset on ${n}.`:`You've used ${e}% of your weekly rate limit. Your weekly rate limit will reset on ${n}.`}a(Vas,"getRateLimitNotificationMessage");function Was(t){return t.includes("agent")?"agent":t.includes("overloaded")?"overloaded":t.includes("upstream")?"upstream":t.includes("global")?"global":t.includes("model")?"model":t.includes("integration")?"integration":t.includes("unknown")?"unknown":"default"}a(Was,"getRateLimitErrorVariant");var izt=class{constructor(){this.id="debug.upgrade";this.description="upgrade for debugging purposes";this.shortDescription="upgrade";this.scopes=["chat-panel"]}static{a(this,"DebugUpgradePromptTemplate")}response(e){return new hh(sDn,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},azt=new izt,ozt=class{constructor(){this.id="debug.ratelimit.notify";this.description="Generate weekly or session rate limit notifications";this.shortDescription="RateLimit Notify";this.scopes=["chat-panel","inline"]}static{a(this,"DebugRateLimitNotificationPromptTemplate")}async response(e,r){let n=r.toLowerCase(),o=$as(n),s=Gas(aDn(n)??jas),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=Vas(o,s,c);return await e.ctx.get(pT).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new hh("Alright, I'm producing a rate limit notification")}},czt=new ozt,szt=class{constructor(){this.id="debug.ratelimit.error";this.description="Generate 429 rate limit errors for agent, model, global, integration, or default cases";this.shortDescription="RateLimit Error";this.scopes=["chat-panel"]}static{a(this,"DebugRateLimitErrorPromptTemplate")}response(e,r){let n=r.toLowerCase(),o=Was(n),s=aDn(n),c=cv.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:Has[o],isAuto:n.includes("auto")});return new hh(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},lzt=new szt;p();function zas(t,e,r){return{id:t,start_offset:e,stop_offset:r,type:"code_vulnerability",details:{type:"server-side-unvalidated-url-redirection",description:"Allows a URL to be redirected to a different URL that is specified by an external user.",ui_type:"test",ui_description:"test"}}}a(zas,"createVulnerability");var lDn=aRe` +`;p();var aDn="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",Gas=95,$as={agent:"agent_mode_limit_exceeded",overloaded:"model_overloaded",upstream:"upstream_provider_rate_limit",global:"user_global_rate_limited",model:"user_model_rate_limited",integration:"integration_rate_limited",unknown:"some_new_code"};function cDn(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(cDn,"parseFirstNumber");function Vas(t){return Math.min(100,Math.max(0,t))}a(Vas,"clampPercentage");function Was(t){return t.includes("session")?"session":"weekly"}a(Was,"getRateLimitNotificationKind");function zas(t,e,r){let n=jue(r);return t==="session"?`You've used ${e}% of your session rate limit. Your session rate limit will reset on ${n}.`:`You've used ${e}% of your weekly rate limit. Your weekly rate limit will reset on ${n}.`}a(zas,"getRateLimitNotificationMessage");function Yas(t){return t.includes("agent")?"agent":t.includes("overloaded")?"overloaded":t.includes("upstream")?"upstream":t.includes("global")?"global":t.includes("model")?"model":t.includes("integration")?"integration":t.includes("unknown")?"unknown":"default"}a(Yas,"getRateLimitErrorVariant");var ozt=class{constructor(){this.id="debug.upgrade";this.description="upgrade for debugging purposes";this.shortDescription="upgrade";this.scopes=["chat-panel"]}static{a(this,"DebugUpgradePromptTemplate")}response(e){return new hh(aDn,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},czt=new ozt,szt=class{constructor(){this.id="debug.ratelimit.notify";this.description="Generate weekly or session rate limit notifications";this.shortDescription="RateLimit Notify";this.scopes=["chat-panel","inline"]}static{a(this,"DebugRateLimitNotificationPromptTemplate")}async response(e,r){let n=r.toLowerCase(),o=Was(n),s=Vas(cDn(n)??Gas),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=zas(o,s,c);return await e.ctx.get(pT).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new hh("Alright, I'm producing a rate limit notification")}},lzt=new szt,azt=class{constructor(){this.id="debug.ratelimit.error";this.description="Generate 429 rate limit errors for agent, model, global, integration, or default cases";this.shortDescription="RateLimit Error";this.scopes=["chat-panel"]}static{a(this,"DebugRateLimitErrorPromptTemplate")}response(e,r){let n=r.toLowerCase(),o=Yas(n),s=cDn(n),c=cv.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:$as[o],isAuto:n.includes("auto")});return new hh(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},uzt=new azt;p();function Kas(t,e,r){return{id:t,start_offset:e,stop_offset:r,type:"code_vulnerability",details:{type:"server-side-unvalidated-url-redirection",description:"Allows a URL to be redirected to a different URL that is specified by an external user.",ui_type:"test",ui_description:"test"}}}a(Kas,"createVulnerability");var uDn=aRe` Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. `,utt=aRe` @@ -3100,7 +3100,7 @@ The following paragraph should not render the \`id\` attribute in the dom. println("Hello, World!") } \`\`\` -`,Yas=aRe` +`,Jas=aRe` ### Inputs \`p\` - paragraph message @@ -3116,20 +3116,20 @@ The following paragraph should not render the \`id\` attribute in the dom. \`/debug.vulnerability pcc2\` - 1 paragraph followed by 2 code blocks with 2 vulnerabilities each \`/debug.vulnerability cpc3\` - 1 code block followed by 1 paragraph followed by 1 code block--each code block has 3 vulnerabilities -`,uzt=` +`,dzt=` -`,cDn=lDn+uzt+utt;function uDn(t){let e=1,r="",n=[];if(t.length===0)r=cDn;else if(t==="0")r=cDn,e=0;else{if(t==="help")return{reply:Yas,vulnerabilities:[]};{let o=t.slice(-1);isNaN(Number(o))||(e=Number(o),t=t.slice(0,-1));for(let s of t)s==="p"?r+=lDn+uzt:s==="c"&&(r+=utt+uzt);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(utt,o);if(c===-1)break;let l=c+utt.length;for(let u=0;u0?r:"Debug Fail")}},Jas=new dzt,fzt=class{constructor(){this.id="debug.notify";this.description="Notify for debugging purposes";this.shortDescription="Notify";this.scopes=["chat-panel","inline"]}static{a(this,"DebugNotificationPromptTemplate")}response(e,r){let n="warning";r.includes("info")&&(n="info");let o=r.replace("info","").replace("warning","").trim(),s=[{severity:n,message:o.length>0?o:"Debug Notification"}];return new hh("Alright, I'm producing a notification",void 0,[],s)}},Zas=new fzt,pzt=class{constructor(){this.id="debug.filter";this.description="Make the RAI filter kick in";this.shortDescription="RAI Filter";this.scopes=["chat-panel"]}static{a(this,"DebugFilterPromptTemplate")}response(e){return e.turn.status="filtered",new hh(Kas,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},Xas=new pzt,hzt=class{constructor(){this.id="debug.dump";this.description="Dump the conversation";this.shortDescription="Dump";this.scopes=["chat-panel"]}static{a(this,"DebugDumpPromptTemplate")}async response(e){return new hh(await gTn(e))}},ecs=new hzt,mzt=class{constructor(){this.id="debug.tree";this.description="Jingle bells, jingle bells, jingle all the way";this.shortDescription="Christmas Tree";this.scopes=["chat-panel"]}static{a(this,"DebugChristmasTreePromptTemplate")}requiredSkills(){return[E2,I_]}instructions(e,r){return"Create a function that prints a christmas tree"}},tcs=new mzt,gzt=class{constructor(){this.id="debug.echo";this.description="Echo the user message back to the user";this.shortDescription="Echo";this.scopes=["chat-panel"]}static{a(this,"DebugEchoPromptTemplate")}response(e){return new hh(Mn(e.turn.request.message))}},rcs=new gzt,Azt=class{constructor(){this.id="debug.prompt";this.description="Show the prompt for the last response or generate a new one";this.shortDescription="Prompt";this.scopes=["chat-panel"]}static{a(this,"DebugPromptPromptTemplate")}response(e,r){let n=e.ctx.get(I0).getLastTurnPrompts();if(n!==void 0&&n.size>0){let o="Here are the prompts used in the last turn:";return n.forEach((s,c)=>{o+=ls` +`,lDn=uDn+dzt+utt;function dDn(t){let e=1,r="",n=[];if(t.length===0)r=lDn;else if(t==="0")r=lDn,e=0;else{if(t==="help")return{reply:Jas,vulnerabilities:[]};{let o=t.slice(-1);isNaN(Number(o))||(e=Number(o),t=t.slice(0,-1));for(let s of t)s==="p"?r+=uDn+dzt:s==="c"&&(r+=utt+dzt);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(utt,o);if(c===-1)break;let l=c+utt.length;for(let u=0;u0?r:"Debug Fail")}},Xas=new fzt,pzt=class{constructor(){this.id="debug.notify";this.description="Notify for debugging purposes";this.shortDescription="Notify";this.scopes=["chat-panel","inline"]}static{a(this,"DebugNotificationPromptTemplate")}response(e,r){let n="warning";r.includes("info")&&(n="info");let o=r.replace("info","").replace("warning","").trim(),s=[{severity:n,message:o.length>0?o:"Debug Notification"}];return new hh("Alright, I'm producing a notification",void 0,[],s)}},ecs=new pzt,hzt=class{constructor(){this.id="debug.filter";this.description="Make the RAI filter kick in";this.shortDescription="RAI Filter";this.scopes=["chat-panel"]}static{a(this,"DebugFilterPromptTemplate")}response(e){return e.turn.status="filtered",new hh(Zas,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},tcs=new hzt,mzt=class{constructor(){this.id="debug.dump";this.description="Dump the conversation";this.shortDescription="Dump";this.scopes=["chat-panel"]}static{a(this,"DebugDumpPromptTemplate")}async response(e){return new hh(await ATn(e))}},rcs=new mzt,gzt=class{constructor(){this.id="debug.tree";this.description="Jingle bells, jingle bells, jingle all the way";this.shortDescription="Christmas Tree";this.scopes=["chat-panel"]}static{a(this,"DebugChristmasTreePromptTemplate")}requiredSkills(){return[E2,I_]}instructions(e,r){return"Create a function that prints a christmas tree"}},ncs=new gzt,Azt=class{constructor(){this.id="debug.echo";this.description="Echo the user message back to the user";this.shortDescription="Echo";this.scopes=["chat-panel"]}static{a(this,"DebugEchoPromptTemplate")}response(e){return new hh(Mn(e.turn.request.message))}},ics=new Azt,yzt=class{constructor(){this.id="debug.prompt";this.description="Show the prompt for the last response or generate a new one";this.shortDescription="Prompt";this.scopes=["chat-panel"]}static{a(this,"DebugPromptPromptTemplate")}response(e,r){let n=e.ctx.get(x0).getLastTurnPrompts();if(n!==void 0&&n.size>0){let o="Here are the prompts used in the last turn:";return n.forEach((s,c)=>{o+=ls` ### ${c} prompt \`\`\`\` ${s} \`\`\`\` - `}),new hh(o)}return new hh("No prompt available")}},ncs=new Azt,yzt=class{constructor(){this.id="debug.skills";this.description="Resolves and displays all available skills or a single skill (id) if provided";this.shortDescription="Skills";this.scopes=["chat-panel"]}static{a(this,"DebugSkillsPromptTemplate")}async response(e,r,n){let o,s;if(r.length>0){let c=r.split(" ");o=c[0],s=c.slice(1).join(" ")}return e.turn.request.message=s??"",new hh(await ATn(e,n,o))}},ics=new yzt,_zt=class{constructor(){this.id="debug.vulnerability";this.description="Create a message with a vulnerability annotation";this.shortDescription="Vulnerability";this.scopes=["chat-panel"]}static{a(this,"DebugVulnerabilityPromptTemplate")}response(e,r){let{reply:n,vulnerabilities:o}=uDn(r);return e.turn.annotations.push(...o),new hh(n,void 0,e.turn.annotations)}},ocs=new _zt,Ezt=class{constructor(){this.id="debug.citation";this.description="Create a message with a code citation annotation";this.shortDescription="CodeCitation";this.scopes=["chat-panel"]}static{a(this,"DebugCodeCitationPromptTemplate")}response(e){return e.turn.annotations.push(nDn),new hh(iDn,void 0,e.turn.annotations)}},scs=new Ezt,vzt=class{constructor(){this.id="debug.markdown";this.description="Markdown rendering specification by example";this.shortDescription="Markdown";this.scopes=["chat-panel","inline"]}static{a(this,"DebugMarkdownRenderingPromptTemplate")}response(){return new hh(oDn)}},acs=new vzt,Czt=class{constructor(){this.id="debug.long";this.description="Generate a long response";this.shortDescription="Long";this.scopes=["chat-panel"]}static{a(this,"DebugLongPromptTemplate")}instructions(e,r){return"Write out the OWASP top 10 with code examples in java"}},ccs=new Czt,bzt=class{constructor(){this.id="debug.project";this.description="Generate a response using the project context skill";this.shortDescription="Project";this.scopes=["chat-panel","inline"]}static{a(this,"DebugProjectContextPromptTemplate")}requiredSkills(){return[Wde]}},lcs=new bzt,Szt=class{constructor(){this.id="debug.confirmation";this.description="Generate a response with a confirmation";this.shortDescription="Confirmation";this.scopes=["chat-panel","inline"]}static{a(this,"DebugConfirmationPromptTemplate")}response(){let e={type:"action",title:"Confirmation that you want to proceed",message:"Do you want to proceed?",agentSlug:"debug.confirmation",confirmation:{answer:"yes"}};return new hh("Alright, I'm producing a notification",void 0,[],[],[],e)}},ucs=new Szt;function dDn(){return[Jas,azt,czt,lzt,Zas,Xas,tcs,ecs,rcs,ncs,ics,ocs,scs,ucs,acs,ccs,lcs]}a(dDn,"getDebugTemplates");p();var fDn=b.Object({uri:b.String(),problems:b.Array(b.Object({message:b.String(),range:Of}))}),Tzt=class{constructor(e){this.turnContext=e}static{a(this,"ProblemsInActiveDocumentSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(si),n=await r.getOrReadTextDocument(e);if(await this.turnContext.collectFile(Sj,e.uri,dd(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(Sj,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(Sj,"problem markers")}getElidableProblems(e,r,n){let o=[];return o.push(new vr([`Problems and errors in the active document (\`${n}\`):`])),o.push(...this.createElidableProblems(e,r)),sj(o,"linear")}createElidableProblems(e,r){return e.problems.map(n=>{let o=[];o.push(new vr([`- "${n.message}" at line ${n.range.start.line}.`+(r.document?" Excerpt from the code:":"")]));let s=n.range,c;if(s&&(this.isEmpty(s)?c=r.document.lineAt(s.start).text:c=r.document.getText(s),c)){let l=r.document.detectedLanguageId;o.push(new vr([["```"+l,1],[rT(c),.8],["```",1]]))}return new vr(o)})}isEmpty(e){return e.start.line===e.end.line&&e.start.character===e.end.character}async preElideDocuments(e){let r=(await Ro.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new vr([n])}},Sj="problems-in-active-document",dtt=class extends T0{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(Sj,"List of problems and errors in the active document, useful when the user question is about finding and fixing errors, non-functioning code, compilation issues, etc.","Analyzing problems and errors",()=>e,r=>new Tzt(r),"explicit",["How can I fix the errors?","Why is my app not working?","Why am I getting compilation errors?","Raw error messages or stack traces"])}};p();p();var ftt=class{constructor(e){this.turnContext=e}static{a(this,"PromptForTestGeneration")}async fromImplementationFile(e){let r=this.turnContext.ctx.get($r).getWorkspaceFolder(e),n=this.fileExistFn(),o=new TRe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=IRe(e.uri);if(s&&!c){let l=e.detectedLanguageId;if(await n(s))return await this.asTestFilePrompt(l,s);{let u=o.findExampleTestFile(e.uri);if(u)return await this.asExampleFilePrompt(l,u)}}}async fromTestFile(e){if(!IRe(e))return;let n=this.turnContext.ctx.get($r).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new TRe(this.turnContext.ctx,o,n?.uri).findImplFileForTestFile(e.uri);if(c){let l=e.detectedLanguageId;if(await o(c))return await this.asImplFilePrompt(l,c)}}async asImplFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new vr([[`${dcs} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new vr([])}async asTestFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new vr([[`${fcs} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new vr([])}async asExampleFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new vr([[`${pcs} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new vr([])}async fileInfoForPrompt(e){if(!this.turnContext.isFileIncluded(e)){let r=this.turnContext.ctx.get(si),n=await r.getOrReadTextDocument({uri:e});if(await this.turnContext.collectFile(k2,e,dd(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[rT(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get(Go).stat(e),!0}catch{return!1}}}},dcs="Code excerpt from the implementation source file",fcs="Code excerpt from the test file",pcs="Code excerpt from an example test file";var pDn=b.Object({currentFileUri:b.String(),sourceFileUri:b.Optional(b.String()),testFileUri:b.Optional(b.String())}),Izt=class{constructor(e){this.turnContext=e}static{a(this,"TestContextSkillProcessor")}value(){return .9}async processSkill(e){let r=this.turnContext.ctx.get(si),n=new ftt(this.turnContext);if(e.sourceFileUri&&e.testFileUri){if(e.sourceFileUri!==e.currentFileUri&&e.testFileUri!==e.currentFileUri)return;if(e.testFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.testFileUri});if(await this.turnContext.collectFile(k2,e.testFileUri,dd(o)),o.status==="valid")return await n.asImplFilePrompt(o.document.detectedLanguageId,e.sourceFileUri)}else if(e.sourceFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.sourceFileUri});if(await this.turnContext.collectFile(k2,e.sourceFileUri,dd(o)),o.status==="valid")return await n.asTestFilePrompt(o.document.detectedLanguageId,e.testFileUri)}}else if(e.sourceFileUri&&e.sourceFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.sourceFileUri});if(await this.turnContext.collectFile(k2,e.sourceFileUri,dd(o)),o.status==="valid")return await n.fromImplementationFile(o.document)}else if(e.testFileUri&&e.testFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.testFileUri});if(await this.turnContext.collectFile(k2,e.testFileUri,dd(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},k2="test-context",ptt=class extends T0{static{a(this,"TestContextSkill")}constructor(e){super(k2,"Example tests useful for creating, adding and fixing tests, to detect available test frameworks as well as finding the corresponding implementation to existing tests","Searching test examples",()=>e,r=>new Izt(r))}};p();var hDn=b.Object({failures:b.Array(b.Object({testName:b.String(),testSuite:b.Optional(b.String()),testFileUri:b.String(),failureReason:b.Optional(b.String()),testLocation:Of}))}),xzt=class{constructor(e){this.turnContext=e}static{a(this,"TestFailuresSkillProcessor")}value(){return .9}async processSkill(e){if(e.failures.length>0){this.turnContext.collectLabel(sZ,"test failures");let r=await this.createElidableFailures(e.failures);if(r){let n=new vr(["The latest test run produced the following failures and errors:"]);return new vr([[n,1],[r,1]])}}}async createElidableFailures(e){let r=this.turnContext.ctx.get(si),n=[],o=this.groupFailuresByFile(e);for(let[s,c]of o.entries()){let l=await r.getOrReadTextDocument({uri:s});if(await this.turnContext.collectFile(sZ,s,dd(l)),l.status==="valid"){let u=r.getRelativePath(l.document),d=this.createElidableFailuresOfDoc(c,u),f=this.appendCode(d,u,l.document);n.push([f,1])}}if(n.length>0)return new vr(n)}groupFailuresByFile(e){let r=new Map;for(let n of e){let o=r.get(n.testFileUri)||[];o.push(n),r.set(n.testFileUri,o)}return r}createElidableFailuresOfDoc(e,r){let n=e.map(o=>{let s=`\`${o.testName}\``,c=`${o.testSuite?` in suite \`${o.testSuite}\``:""}`,l=` in file \`${r}\` `,u=". ";o.failureReason&&(u=" with the following error:",o.failureReason.includes(` + `}),new hh(o)}return new hh("No prompt available")}},ocs=new yzt,_zt=class{constructor(){this.id="debug.skills";this.description="Resolves and displays all available skills or a single skill (id) if provided";this.shortDescription="Skills";this.scopes=["chat-panel"]}static{a(this,"DebugSkillsPromptTemplate")}async response(e,r,n){let o,s;if(r.length>0){let c=r.split(" ");o=c[0],s=c.slice(1).join(" ")}return e.turn.request.message=s??"",new hh(await yTn(e,n,o))}},scs=new _zt,Ezt=class{constructor(){this.id="debug.vulnerability";this.description="Create a message with a vulnerability annotation";this.shortDescription="Vulnerability";this.scopes=["chat-panel"]}static{a(this,"DebugVulnerabilityPromptTemplate")}response(e,r){let{reply:n,vulnerabilities:o}=dDn(r);return e.turn.annotations.push(...o),new hh(n,void 0,e.turn.annotations)}},acs=new Ezt,vzt=class{constructor(){this.id="debug.citation";this.description="Create a message with a code citation annotation";this.shortDescription="CodeCitation";this.scopes=["chat-panel"]}static{a(this,"DebugCodeCitationPromptTemplate")}response(e){return e.turn.annotations.push(iDn),new hh(oDn,void 0,e.turn.annotations)}},ccs=new vzt,Czt=class{constructor(){this.id="debug.markdown";this.description="Markdown rendering specification by example";this.shortDescription="Markdown";this.scopes=["chat-panel","inline"]}static{a(this,"DebugMarkdownRenderingPromptTemplate")}response(){return new hh(sDn)}},lcs=new Czt,bzt=class{constructor(){this.id="debug.long";this.description="Generate a long response";this.shortDescription="Long";this.scopes=["chat-panel"]}static{a(this,"DebugLongPromptTemplate")}instructions(e,r){return"Write out the OWASP top 10 with code examples in java"}},ucs=new bzt,Szt=class{constructor(){this.id="debug.project";this.description="Generate a response using the project context skill";this.shortDescription="Project";this.scopes=["chat-panel","inline"]}static{a(this,"DebugProjectContextPromptTemplate")}requiredSkills(){return[zde]}},dcs=new Szt,Tzt=class{constructor(){this.id="debug.confirmation";this.description="Generate a response with a confirmation";this.shortDescription="Confirmation";this.scopes=["chat-panel","inline"]}static{a(this,"DebugConfirmationPromptTemplate")}response(){let e={type:"action",title:"Confirmation that you want to proceed",message:"Do you want to proceed?",agentSlug:"debug.confirmation",confirmation:{answer:"yes"}};return new hh("Alright, I'm producing a notification",void 0,[],[],[],e)}},fcs=new Tzt;function fDn(){return[Xas,czt,lzt,uzt,ecs,tcs,ncs,rcs,ics,ocs,scs,acs,ccs,fcs,lcs,ucs,dcs]}a(fDn,"getDebugTemplates");p();var pDn=b.Object({uri:b.String(),problems:b.Array(b.Object({message:b.String(),range:Of}))}),Izt=class{constructor(e){this.turnContext=e}static{a(this,"ProblemsInActiveDocumentSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(si),n=await r.getOrReadTextDocument(e);if(await this.turnContext.collectFile(Sj,e.uri,dd(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(Sj,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(Sj,"problem markers")}getElidableProblems(e,r,n){let o=[];return o.push(new vr([`Problems and errors in the active document (\`${n}\`):`])),o.push(...this.createElidableProblems(e,r)),sj(o,"linear")}createElidableProblems(e,r){return e.problems.map(n=>{let o=[];o.push(new vr([`- "${n.message}" at line ${n.range.start.line}.`+(r.document?" Excerpt from the code:":"")]));let s=n.range,c;if(s&&(this.isEmpty(s)?c=r.document.lineAt(s.start).text:c=r.document.getText(s),c)){let l=r.document.detectedLanguageId;o.push(new vr([["```"+l,1],[rT(c),.8],["```",1]]))}return new vr(o)})}isEmpty(e){return e.start.line===e.end.line&&e.start.character===e.end.character}async preElideDocuments(e){let r=(await Ro.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new vr([n])}},Sj="problems-in-active-document",dtt=class extends I0{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(Sj,"List of problems and errors in the active document, useful when the user question is about finding and fixing errors, non-functioning code, compilation issues, etc.","Analyzing problems and errors",()=>e,r=>new Izt(r),"explicit",["How can I fix the errors?","Why is my app not working?","Why am I getting compilation errors?","Raw error messages or stack traces"])}};p();p();var ftt=class{constructor(e){this.turnContext=e}static{a(this,"PromptForTestGeneration")}async fromImplementationFile(e){let r=this.turnContext.ctx.get($r).getWorkspaceFolder(e),n=this.fileExistFn(),o=new TRe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=IRe(e.uri);if(s&&!c){let l=e.detectedLanguageId;if(await n(s))return await this.asTestFilePrompt(l,s);{let u=o.findExampleTestFile(e.uri);if(u)return await this.asExampleFilePrompt(l,u)}}}async fromTestFile(e){if(!IRe(e))return;let n=this.turnContext.ctx.get($r).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new TRe(this.turnContext.ctx,o,n?.uri).findImplFileForTestFile(e.uri);if(c){let l=e.detectedLanguageId;if(await o(c))return await this.asImplFilePrompt(l,c)}}async asImplFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new vr([[`${pcs} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new vr([])}async asTestFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new vr([[`${hcs} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new vr([])}async asExampleFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new vr([[`${mcs} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new vr([])}async fileInfoForPrompt(e){if(!this.turnContext.isFileIncluded(e)){let r=this.turnContext.ctx.get(si),n=await r.getOrReadTextDocument({uri:e});if(await this.turnContext.collectFile(k2,e,dd(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[rT(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get(Go).stat(e),!0}catch{return!1}}}},pcs="Code excerpt from the implementation source file",hcs="Code excerpt from the test file",mcs="Code excerpt from an example test file";var hDn=b.Object({currentFileUri:b.String(),sourceFileUri:b.Optional(b.String()),testFileUri:b.Optional(b.String())}),xzt=class{constructor(e){this.turnContext=e}static{a(this,"TestContextSkillProcessor")}value(){return .9}async processSkill(e){let r=this.turnContext.ctx.get(si),n=new ftt(this.turnContext);if(e.sourceFileUri&&e.testFileUri){if(e.sourceFileUri!==e.currentFileUri&&e.testFileUri!==e.currentFileUri)return;if(e.testFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.testFileUri});if(await this.turnContext.collectFile(k2,e.testFileUri,dd(o)),o.status==="valid")return await n.asImplFilePrompt(o.document.detectedLanguageId,e.sourceFileUri)}else if(e.sourceFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.sourceFileUri});if(await this.turnContext.collectFile(k2,e.sourceFileUri,dd(o)),o.status==="valid")return await n.asTestFilePrompt(o.document.detectedLanguageId,e.testFileUri)}}else if(e.sourceFileUri&&e.sourceFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.sourceFileUri});if(await this.turnContext.collectFile(k2,e.sourceFileUri,dd(o)),o.status==="valid")return await n.fromImplementationFile(o.document)}else if(e.testFileUri&&e.testFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.testFileUri});if(await this.turnContext.collectFile(k2,e.testFileUri,dd(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},k2="test-context",ptt=class extends I0{static{a(this,"TestContextSkill")}constructor(e){super(k2,"Example tests useful for creating, adding and fixing tests, to detect available test frameworks as well as finding the corresponding implementation to existing tests","Searching test examples",()=>e,r=>new xzt(r))}};p();var mDn=b.Object({failures:b.Array(b.Object({testName:b.String(),testSuite:b.Optional(b.String()),testFileUri:b.String(),failureReason:b.Optional(b.String()),testLocation:Of}))}),wzt=class{constructor(e){this.turnContext=e}static{a(this,"TestFailuresSkillProcessor")}value(){return .9}async processSkill(e){if(e.failures.length>0){this.turnContext.collectLabel(aZ,"test failures");let r=await this.createElidableFailures(e.failures);if(r){let n=new vr(["The latest test run produced the following failures and errors:"]);return new vr([[n,1],[r,1]])}}}async createElidableFailures(e){let r=this.turnContext.ctx.get(si),n=[],o=this.groupFailuresByFile(e);for(let[s,c]of o.entries()){let l=await r.getOrReadTextDocument({uri:s});if(await this.turnContext.collectFile(aZ,s,dd(l)),l.status==="valid"){let u=r.getRelativePath(l.document),d=this.createElidableFailuresOfDoc(c,u),f=this.appendCode(d,u,l.document);n.push([f,1])}}if(n.length>0)return new vr(n)}groupFailuresByFile(e){let r=new Map;for(let n of e){let o=r.get(n.testFileUri)||[];o.push(n),r.set(n.testFileUri,o)}return r}createElidableFailuresOfDoc(e,r){let n=e.map(o=>{let s=`\`${o.testName}\``,c=`${o.testSuite?` in suite \`${o.testSuite}\``:""}`,l=` in file \`${r}\` `,u=". ";o.failureReason&&(u=" with the following error:",o.failureReason.includes(` `)?u+="\n```\n"+o.failureReason+"\n```\n":u+=` \`${o.failureReason}\`. `);let d=`${o.testLocation.start.line==o.testLocation.end.line?"on line "+o.testLocation.start.line:"between lines "+o.testLocation.start.line+" and "+o.testLocation.end.line}`;return[new vr([ls`\n\n- Test ${s}${c}${l}failed${u}The failed test is ${d}.\n`]),1]});return new vr(n)}appendCode(e,r,n){let o=[new vr([` The code of file \`${r}\` is: -`]),.6],s=[new vr([["```"+n.detectedLanguageId,1],[rT(n.getText()),.9],["```",1]]),.7];return new vr([[e,1],o,s])}},sZ="test-failures",htt=class extends T0{static{a(this,"TestFailuresSkill")}constructor(e){super(sZ,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new xzt(r))}};var hh=class{constructor(e,r,n=[],o=[],s=[],c){this.message=e;this.error=r;this.annotations=n;this.notifications=o;this.references=s;this.confirmationRequest=c}static{a(this,"PromptTemplateResponse")}},Uw=class{constructor(e,r,n,o,s=[],c=[],l,u=!1){this.id=e;this.description=r;this.shortDescription=n;this.prompt=o;this.skills=s;this.scopes=c;this.inlinePrompt=l;this.producesCodeEdits=u}static{a(this,"StaticPromptTemplate")}instructions(e,r,n="panel"){let o;return n==="inline"?o=this.inlinePrompt??this.prompt:o=this.prompt,o+` -`+r}requiredSkills(){return this.skills}},hcs=new Uw("tests","Generate unit tests","Generate Tests",ls` +`]),.6],s=[new vr([["```"+n.detectedLanguageId,1],[rT(n.getText()),.9],["```",1]]),.7];return new vr([[e,1],o,s])}},aZ="test-failures",htt=class extends I0{static{a(this,"TestFailuresSkill")}constructor(e){super(aZ,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new wzt(r))}};var hh=class{constructor(e,r,n=[],o=[],s=[],c){this.message=e;this.error=r;this.annotations=n;this.notifications=o;this.references=s;this.confirmationRequest=c}static{a(this,"PromptTemplateResponse")}},Uw=class{constructor(e,r,n,o,s=[],c=[],l,u=!1){this.id=e;this.description=r;this.shortDescription=n;this.prompt=o;this.skills=s;this.scopes=c;this.inlinePrompt=l;this.producesCodeEdits=u}static{a(this,"StaticPromptTemplate")}instructions(e,r,n="panel"){let o;return n==="inline"?o=this.inlinePrompt??this.prompt:o=this.prompt,o+` +`+r}requiredSkills(){return this.skills}},gcs=new Uw("tests","Generate unit tests","Generate Tests",ls` Write a set of unit tests for the code above, or for the selected code if provided. Provide tests for the functionality of the code and not the implementation details. The tests should test the happy path as well as the edge cases. @@ -3140,7 +3140,7 @@ The code of file \`${r}\` is: Follow the same test style as in existing tests if they exist. You must not create inline comments like "Arrange, Act, Assert", unless existing tests use inline comments as well. If existing tests use any mocking or stubbing libraries, use the same libraries before writing your own test doubles. - `,[k2,sZ],["chat-panel","agent-panel","editor"]),mcs=new Uw("simplify","Simplify the code","Simplify This",ls` + `,[k2,aZ],["chat-panel","agent-panel","editor"]),Acs=new Uw("simplify","Simplify the code","Simplify This",ls` Provide a simplified version of the selected code above. Do not change the behavior of the code. The code should still be readable and easy to understand. @@ -3151,7 +3151,7 @@ The code of file \`${r}\` is: Do not change the behavior of the code. Removing empty lines is not a simplification. You must not omit any code that is necessary for the code to compile and run, for example by replacing lines with ... or similar. - Do not reply with the original code but only a simplified version.`,!0),gcs=new Uw("fix","Fix problems and compile errors","Fix This",ls` + Do not reply with the original code but only a simplified version.`,!0),ycs=new Uw("fix","Fix problems and compile errors","Fix This",ls` Fix the provided errors and problems. Do not invent new problems. The fixed code should still be readable and easy to understand. @@ -3168,7 +3168,7 @@ The code of file \`${r}\` is: The fixed code should still be readable and easy to understand. If there are no problems provided do reply that you can't detect any problems and the user should describe more precisely what they want to be fixed. Do not attempt to fix problems that are not provided, like unbalanced brackets or parentheses that are not causing errors. - Briefly explain the problems without repeating the detailed error message.`,!0),Acs=new Uw("explain","Explain how the code works","Explain This",ls` + Briefly explain the problems without repeating the detailed error message.`,!0),_cs=new Uw("explain","Explain how the code works","Explain This",ls` Write an explanation for the selected code above as paragraphs of text. Include excerpts of code snippets to underline your explanation. Do not repeat the complete code. @@ -3176,14 +3176,14 @@ The code of file \`${r}\` is: Write an explanation for the code the user is selecting. Include excerpts of code snippets to underline your explanation. Do not repeat the complete code. - Keep the explanation brief and easy to understand for a developer who is familiar with the programming language used but not familiar with the code.`,!1),ycs=new Uw("doc","Document the current selection or file","Generate Docs",ls` + Keep the explanation brief and easy to understand for a developer who is familiar with the programming language used but not familiar with the code.`,!1),Ecs=new Uw("doc","Document the current selection or file","Generate Docs",ls` Write documentation for the selected code. If no code is explicitly selected, document the provided code in its entirety. The reply should be a codeblock containing the code with the documentation added as comments. Use the most appropriate documentation style for the programming language used (e.g. JSDoc for JavaScript, docstrings for Python etc.)`,[],["editor","chat-panel","agent-panel","inline","inline-agent"],ls` Add documentation to the provided code. If a specific selection is given, only document the selected code. Otherwise, document all the code provided. Modify the code by adding documentation as comments. Use the most appropriate documentation style for the programming language used (e.g. JSDoc for JavaScript, docstrings for Python etc.). - Place the comments before functions and methods, unless the language has a different convention (for example Python's docstring).`,!0),mDn=new Uw("create-agent","Create a new custom agent","Create Agent",ls` + Place the comments before functions and methods, unless the language has a different convention (for example Python's docstring).`,!0),gDn=new Uw("create-agent","Create a new custom agent","Create Agent",ls` Help the user create a new custom agent file (a Markdown file with a \`.agent.md\` extension). A custom agent defines a specialized persona with its own description and allowed tools. @@ -3202,7 +3202,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created and how to use it.`,[],["chat-panel","agent-panel"]),gDn=new Uw("create-skill","Create a new custom skill","Create Skill",ls` + After the file is created, open it and briefly summarize what you created and how to use it.`,[],["chat-panel","agent-panel"]),ADn=new Uw("create-skill","Create a new custom skill","Create Skill",ls` Help the user create a new custom skill. A skill is a folder containing a \`SKILL.md\` file that provides domain-specific knowledge or a reusable workflow the agent can load on demand. @@ -3220,7 +3220,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),ADn=new Uw("create-instruction","Create a new instruction file","Create Instruction",ls` + After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),yDn=new Uw("create-instruction","Create a new instruction file","Create Instruction",ls` Help the user create a new instructions file (a Markdown file with an \`.instructions.md\` extension). Instructions provide always-on guidance that Copilot applies when working on matching files. @@ -3238,7 +3238,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),yDn=new Uw("create-prompt","Create a new prompt file","Create Prompt",ls` + After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),_Dn=new Uw("create-prompt","Create a new prompt file","Create Prompt",ls` Help the user create a new prompt file (a Markdown file with a \`.prompt.md\` extension). A prompt file is a reusable task the user can run later. @@ -3256,7 +3256,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),_Dn=new Uw("create-hook","Create a new hook configuration","Create Hook",ls` + After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),EDn=new Uw("create-hook","Create a new hook configuration","Create Hook",ls` Help the user create a new hook configuration file (a JSON file under \`.github/hooks/\` with a \`.json\` extension). Hooks run shell scripts at specific agent lifecycle events — common uses include blocking dangerous @@ -3309,7 +3309,7 @@ The code of file \`${r}\` is: After the file is created, open it and briefly summarize what the hook does, which event it fires on, and how to test it (e.g. submitting a prompt for \`userPromptSubmitted\`, or running a tool that matches a - \`preToolUse\` filter).`,[],["chat-panel","agent-panel"]),wzt=class{constructor(){this.id="feedback";this.description="Steps to provide feedback";this.shortDescription="Feedback";this.scopes=["chat-panel","agent-panel"]}static{a(this,"FeedbackPromptTemplate")}response(e){let r=DHt(e.conversation),n=ls` + \`preToolUse\` filter).`,[],["chat-panel","agent-panel"]),Rzt=class{constructor(){this.id="feedback";this.description="Steps to provide feedback";this.shortDescription="Feedback";this.scopes=["chat-panel","agent-panel"]}static{a(this,"FeedbackPromptTemplate")}response(e){let r=NHt(e.conversation),n=ls` You can provide direct feedback by pressing the thumbs up/down buttons on a single message. In case you want to share more details, please click [here](https://aka.ms/copilot-jetbrains-feedback) to share your feedback. `;return r?new hh(n+` @@ -3317,7 +3317,7 @@ The code of file \`${r}\` is: In order to help us understand your feedback better, you can include the following identifier in your feedback: by doing so, you are granting us permission to access the telemetry data associated with your feedback. \`\`\`yaml ${e.conversation.id}/${r} -\`\`\``):new hh(n)}},_cs=new wzt,Rzt=class{constructor(){this.id="help";this.description="Get help on how to use Copilot chat";this.shortDescription="Help";this.scopes=["chat-panel","agent-panel"]}static{a(this,"HelpPromptTemplate")}response(e){let r=kzt(e.ctx).filter(o=>o!=this),n=ls` +\`\`\``):new hh(n)}},vcs=new Rzt,kzt=class{constructor(){this.id="help";this.description="Get help on how to use Copilot chat";this.shortDescription="Help";this.scopes=["chat-panel","agent-panel"]}static{a(this,"HelpPromptTemplate")}response(e){let r=Pzt(e.ctx).filter(o=>o!=this),n=ls` You can ask me general programming questions, or use one of the following commands to get help with a specific task: ${r.map(o=>`- \`/${o.id}\` - ${o.description}`).join(` @@ -3329,39 +3329,39 @@ ${e.conversation.id}/${r} - On top of files, **I take different parts of your IDE into consideration** when answering questions. This includes, but is not limited to, test results and failures, build and runtime logs, active Git repository as well as details of the open project. - **Make refinements** by asking me follow-up questions, adding clarifications, providing errors, etc. - **Review my suggested code** and tell me about issues or improvements, so I can iterate on it. - `;return new hh(n)}},Ecs=new Rzt,EDn=new Set([mDn.id,gDn.id,ADn.id,yDn.id,_Dn.id]);function P2(){return[hcs,mcs,gcs,Acs,ycs,mDn,gDn,ADn,yDn,_Dn,_cs,Ecs,...dDn()]}a(P2,"getPromptTemplates");function kzt(t){let e=P2();return!aSe(t)&&!s1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(kzt,"getUserFacingPromptTemplates");var vDn=fe(require("path"));var Pzt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??ro(n.uri).replace(".prompt.md","")}static{a(this,"CustomPrompt")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get uri(){return this.parsedPromptFile.uri}get name(){return this._name}get description(){return this.promptFileEntry.promptPath.description??this.parsedPromptFile.header?.description}get mode(){return this.parsedPromptFile.header?.agent}get model(){return this.parsedPromptFile.header?.model}get content(){return this.parsedPromptFile.body?.content??""}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||Oue(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return Dq(this.promptFileEntry.promptPath)}get providers(){return c2(this.promptFileEntry.promptPath.metadata)}},P0=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.promptTemplatesCache=null;this.promptBuffers=new Map;this.patternsByKey=new Map;this.syncRegistry()}static{a(this,"CustomPromptService")}static{this.DEFAULT_PROMPT_REGISTRATION=".github/prompts/**/*.prompt.md"}static{this.PROMPT_GLOB_SUFFIX="**/*.prompt.md"}syncRegistry(){let e=new Set([t.DEFAULT_PROMPT_REGISTRATION]);for(let r of this.patternsByKey.values())for(let n of r)e.add(n);this.registryPromptPatterns=this.promptFileLocationRegistry.replace(this.registryPromptPatterns,"prompt",Array.from(e),{watchable:!0})}static{this.parser=new GO}partitionSettings(e){let r=new Set,n=[];for(let o of e)if(o.type==="file")r.add(un(o.uri));else if(o.type==="location")r.add(vDn.default.posix.join(o.path,t.PROMPT_GLOB_SUFFIX));else if(o.type==="content"){let s=this.resolvePrompt(o);s&&n.push(s)}return{patterns:Array.from(r),prompts:n}}setGlobalPromptFiles(e){this.setPromptSettingsForKey(e||[],"global-prompt-files")}collectBufferedPrompts(){return Array.from(this.promptBuffers.values()).flat()}resolvePrompt(e){if(!e.content?.trim())return;let r=t.parser.parse(`${Pq}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${Pq}${n}`,name:n,description:r.header?.description,mode:r.header?.agent,model:r.header?.model,content:r.body.content,isReadonly:!0,isBuiltIn:!1}}setPromptFileLocations(e,r="workspace"){this.setPromptSettingsForKey(e,r)}setPromptSettingsForKey(e,r){let{patterns:n,prompts:o}=this.partitionSettings(e);this.promptBuffers.set(r,o),this.patternsByKey.set(r,n),this.promptTemplatesCache=null,this.syncRegistry()}async getPromptTemplate(e,r){let n=this.promptTemplatesCache?.get(e);return n?n.pluginUri!==void 0&&!r?.includePlugins?void 0:Promise.resolve(n):Promise.resolve(this.collectBufferedPrompts().find(o=>o.name===e))}async listCustomPrompts(e,r){let s=(await this.ctx.get(y0).collect(this.ctx,"prompt",e,{includePlugins:r?.includePlugins})).map(u=>new Pzt(u));this.promptTemplatesCache?this.promptTemplatesCache.clear():this.promptTemplatesCache=new Map;let c=[...s],l=new Set(s.map(u=>u.name));for(let u of this.collectBufferedPrompts())l.has(u.name)||(l.add(u.name),c.push(u));for(let u of c)this.promptTemplatesCache.set(u.name,u);return c}async getCustomPromptById(e,r){return(await this.listCustomPrompts(e)).find(o=>o.uri===r)}async getCustomPromptByName(e,r,n){return(await this.listCustomPrompts(e,n)).find(s=>s.name===r)}async applyPromptTemplateToRequest(e,r,n,o){let s=e.message.trim();if(!s.startsWith("/"))return!1;let[c,...l]=s.split(" "),u=c.replace("/",""),d=l.join(" ");if(!u)return!1;let f=r?.length?await this.getCustomPromptByName(r,u,o):await this.getPromptTemplate(u,o);if(f){if(f.uri.startsWith(Pq))return e.message=`Follow instructions: ${f.content} + `;return new hh(n)}},Ccs=new kzt,vDn=new Set([gDn.id,ADn.id,yDn.id,_Dn.id,EDn.id]);function P2(){return[gcs,Acs,ycs,_cs,Ecs,gDn,ADn,yDn,_Dn,EDn,vcs,Ccs,...fDn()]}a(P2,"getPromptTemplates");function Pzt(t){let e=P2();return!aSe(t)&&!s1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(Pzt,"getUserFacingPromptTemplates");var CDn=fe(require("path"));var Dzt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??ro(n.uri).replace(".prompt.md","")}static{a(this,"CustomPrompt")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get uri(){return this.parsedPromptFile.uri}get name(){return this._name}get description(){return this.promptFileEntry.promptPath.description??this.parsedPromptFile.header?.description}get mode(){return this.parsedPromptFile.header?.agent}get model(){return this.parsedPromptFile.header?.model}get content(){return this.parsedPromptFile.body?.content??""}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||Lue(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return Dq(this.promptFileEntry.promptPath)}get providers(){return c2(this.promptFileEntry.promptPath.metadata)}},D0=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.promptTemplatesCache=null;this.promptBuffers=new Map;this.patternsByKey=new Map;this.syncRegistry()}static{a(this,"CustomPromptService")}static{this.DEFAULT_PROMPT_REGISTRATION=".github/prompts/**/*.prompt.md"}static{this.PROMPT_GLOB_SUFFIX="**/*.prompt.md"}syncRegistry(){let e=new Set([t.DEFAULT_PROMPT_REGISTRATION]);for(let r of this.patternsByKey.values())for(let n of r)e.add(n);this.registryPromptPatterns=this.promptFileLocationRegistry.replace(this.registryPromptPatterns,"prompt",Array.from(e),{watchable:!0})}static{this.parser=new GO}partitionSettings(e){let r=new Set,n=[];for(let o of e)if(o.type==="file")r.add(un(o.uri));else if(o.type==="location")r.add(CDn.default.posix.join(o.path,t.PROMPT_GLOB_SUFFIX));else if(o.type==="content"){let s=this.resolvePrompt(o);s&&n.push(s)}return{patterns:Array.from(r),prompts:n}}setGlobalPromptFiles(e){this.setPromptSettingsForKey(e||[],"global-prompt-files")}collectBufferedPrompts(){return Array.from(this.promptBuffers.values()).flat()}resolvePrompt(e){if(!e.content?.trim())return;let r=t.parser.parse(`${Pq}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${Pq}${n}`,name:n,description:r.header?.description,mode:r.header?.agent,model:r.header?.model,content:r.body.content,isReadonly:!0,isBuiltIn:!1}}setPromptFileLocations(e,r="workspace"){this.setPromptSettingsForKey(e,r)}setPromptSettingsForKey(e,r){let{patterns:n,prompts:o}=this.partitionSettings(e);this.promptBuffers.set(r,o),this.patternsByKey.set(r,n),this.promptTemplatesCache=null,this.syncRegistry()}async getPromptTemplate(e,r){let n=this.promptTemplatesCache?.get(e);return n?n.pluginUri!==void 0&&!r?.includePlugins?void 0:Promise.resolve(n):Promise.resolve(this.collectBufferedPrompts().find(o=>o.name===e))}async listCustomPrompts(e,r){let s=(await this.ctx.get(_0).collect(this.ctx,"prompt",e,{includePlugins:r?.includePlugins})).map(u=>new Dzt(u));this.promptTemplatesCache?this.promptTemplatesCache.clear():this.promptTemplatesCache=new Map;let c=[...s],l=new Set(s.map(u=>u.name));for(let u of this.collectBufferedPrompts())l.has(u.name)||(l.add(u.name),c.push(u));for(let u of c)this.promptTemplatesCache.set(u.name,u);return c}async getCustomPromptById(e,r){return(await this.listCustomPrompts(e)).find(o=>o.uri===r)}async getCustomPromptByName(e,r,n){return(await this.listCustomPrompts(e,n)).find(s=>s.name===r)}async applyPromptTemplateToRequest(e,r,n,o){let s=e.message.trim();if(!s.startsWith("/"))return!1;let[c,...l]=s.split(" "),u=c.replace("/",""),d=l.join(" ");if(!u)return!1;let f=r?.length?await this.getCustomPromptByName(r,u,o):await this.getPromptTemplate(u,o);if(f){if(f.uri.startsWith(Pq))return e.message=`Follow instructions: ${f.content} -${d}`,!0;e.message=`Follow instructions in [${f.name}](${f.uri}). ${d}`;let g=e.references??[];return g.some(A=>A.type==="file"&&A.uri===f.uri)||g.push({type:"file",uri:f.uri}),e.references=g,!0}if(!n)return!1;let h="inline",m=P2().find(g=>g.id===u&&g.scopes.includes(h));return m?.instructions?(e.message=m.instructions(this.ctx,d,"inline"),!0):!1}};var mtt=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},Xo=class{constructor(e){this.ctx=e;this.conversations=new Sn(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new cJ([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(fm).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new mtt(s,{skills:c})),this.initializePartitionTranscript(s),s}destroy(e){this.conversations.delete(e)}async restore(e){let{conversationId:r,targetTurnId:n,capabilities:o,source:s,userLanguage:c}=e;ot.debug(this.ctx,`Restoring conversation: conversationId=${r}, targetTurnId=${n}`);let u=await this.ctx.get(T5).restoreConversation(r,n);if(!u){ot.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new cJ(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(fm).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new mtt(d,{skills:f})),this.initializeRestoredPartitionTranscript(d),ot.info(this.ctx,`Conversation restored: conversationId=${r}, partitionId=${u.partitionId}, turnCount=${u.turns.length}`),{conversation:d,partitionId:u.partitionId,turnCount:u.turns.length}}async createOrRestore(e={}){let{restoreToTurnId:r,conversationId:n,...o}=e;if(r&&n){try{let s=await this.restore({conversationId:n,targetTurnId:r,capabilities:o.capabilities,source:o.source,userLanguage:o.userLanguage});if(s)return s.conversation}catch(s){ot.warn(this.ctx,`Failed to restore conversation: conversationId=${n}, turnId=${r}, error=${s instanceof Error?s.message:String(s)}`)}return ot.info(this.ctx,`Creating new conversation after failed restoration: originalConversationId=${n}`),$c(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new Tg(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:"restoration"}).catch(n=>{ot.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.ctx,`Failed to create transcript persistence for restoration: ${r instanceof Error?r.message:String(r)}`)}}async addTurn(e,r,n,o,s,c,l,u){let d=this.get(e);r.request.references=n&&n.length>0?n:[],o&&(r.request.activeEditor=o),s&&(r.workspaceFolder=s),c&&c.length>0&&(r.workspaceFolders=c),l&&l.length>0&&(r.ignoredSkills=l.map(g=>({skillId:g}))),u&&(r.agent={agentSlug:u.agentSlug},r.confirmationResponse=u);let f=n?.filter(g=>g.type==="file"&&!Qz.has(oo(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!Qz.has(oo(g).scheme))??[];d.uriSchemeCache.addUris([...f,h,...m]),await this.determineAndApplyAgent(d,r),await this.determineAndApplyTemplate(d,r),await this.determineAndApplyPromptTemplate(this.ctx,d,r),d.addTurn(r);try{await this.writeUserMessageTranscriptEvent(d,r)}catch(g){ot.error(this.ctx,`Failed to write user message transcript event: ${g instanceof Error?g.message:String(g)}`)}if(r.response)try{await this.writeAssistantResponseTranscriptEvents(d,r)}catch(g){ot.error(this.ctx,`Failed to write assistant response transcript events: ${g instanceof Error?g.message:String(g)}`)}return r}async writeUserMessageTranscriptEvent(e,r){let n=new Tg(this.ctx);if(!n.isEnabled())return;let o=X2n(Mn(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new Tg(this.ctx);if(!n.isEnabled()||!r.response)return;let o=Mn(r.response.message),s=String(r.id),c=ctt(o,s,null,{text:o,iterationNumber:1});await n.appendEvent(e.id,e.currentPartitionId,c);let l=r.status==="error"?"error":r.status==="cancelled"?"cancelled":"success",u=zde(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&Mn(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Mn(r.request.message),"@");(await Iw(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(Mn(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Mn(r.request.message),"/"),s=P2().find(c=>c.id===n);if(s){r.request.message=o,r.request.type="user",await this.determineAndApplyAgent(e,r);let c=s.instructions?s.instructions(this.ctx,r.request.message,e.source):o;r.template={templateId:n,userQuestion:r.request.message},r.request.message=c,r.request.type="template"}}}async determineAndApplyPromptTemplate(e,r,n){if(Mn(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(Mn(n.request.message),"/"),l=await e.get(P0).getPromptTemplate(o);l&&(l.uri.startsWith(Pq)?n.request.message=`Follow instructions: ${l.content} +${d}`,!0;e.message=`Follow instructions in [${f.name}](${f.uri}). ${d}`;let g=e.references??[];return g.some(A=>A.type==="file"&&A.uri===f.uri)||g.push({type:"file",uri:f.uri}),e.references=g,!0}if(!n)return!1;let h="inline",m=P2().find(g=>g.id===u&&g.scopes.includes(h));return m?.instructions?(e.message=m.instructions(this.ctx,d,"inline"),!0):!1}};var mtt=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},Xo=class{constructor(e){this.ctx=e;this.conversations=new Sn(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new lJ([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(fm).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new mtt(s,{skills:c})),this.initializePartitionTranscript(s),s}destroy(e){this.conversations.delete(e)}async restore(e){let{conversationId:r,targetTurnId:n,capabilities:o,source:s,userLanguage:c}=e;ot.debug(this.ctx,`Restoring conversation: conversationId=${r}, targetTurnId=${n}`);let u=await this.ctx.get(T5).restoreConversation(r,n);if(!u){ot.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new lJ(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(fm).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new mtt(d,{skills:f})),this.initializeRestoredPartitionTranscript(d),ot.info(this.ctx,`Conversation restored: conversationId=${r}, partitionId=${u.partitionId}, turnCount=${u.turns.length}`),{conversation:d,partitionId:u.partitionId,turnCount:u.turns.length}}async createOrRestore(e={}){let{restoreToTurnId:r,conversationId:n,...o}=e;if(r&&n){try{let s=await this.restore({conversationId:n,targetTurnId:r,capabilities:o.capabilities,source:o.source,userLanguage:o.userLanguage});if(s)return s.conversation}catch(s){ot.warn(this.ctx,`Failed to restore conversation: conversationId=${n}, turnId=${r}, error=${s instanceof Error?s.message:String(s)}`)}return ot.info(this.ctx,`Creating new conversation after failed restoration: originalConversationId=${n}`),$c(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new Ig(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:"restoration"}).catch(n=>{ot.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.ctx,`Failed to create transcript persistence for restoration: ${r instanceof Error?r.message:String(r)}`)}}async addTurn(e,r,n,o,s,c,l,u){let d=this.get(e);r.request.references=n&&n.length>0?n:[],o&&(r.request.activeEditor=o),s&&(r.workspaceFolder=s),c&&c.length>0&&(r.workspaceFolders=c),l&&l.length>0&&(r.ignoredSkills=l.map(g=>({skillId:g}))),u&&(r.agent={agentSlug:u.agentSlug},r.confirmationResponse=u);let f=n?.filter(g=>g.type==="file"&&!qz.has(oo(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!qz.has(oo(g).scheme))??[];d.uriSchemeCache.addUris([...f,h,...m]),await this.determineAndApplyAgent(d,r),await this.determineAndApplyTemplate(d,r),await this.determineAndApplyPromptTemplate(this.ctx,d,r),d.addTurn(r);try{await this.writeUserMessageTranscriptEvent(d,r)}catch(g){ot.error(this.ctx,`Failed to write user message transcript event: ${g instanceof Error?g.message:String(g)}`)}if(r.response)try{await this.writeAssistantResponseTranscriptEvents(d,r)}catch(g){ot.error(this.ctx,`Failed to write assistant response transcript events: ${g instanceof Error?g.message:String(g)}`)}return r}async writeUserMessageTranscriptEvent(e,r){let n=new Ig(this.ctx);if(!n.isEnabled())return;let o=eDn(Mn(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new Ig(this.ctx);if(!n.isEnabled()||!r.response)return;let o=Mn(r.response.message),s=String(r.id),c=ctt(o,s,null,{text:o,iterationNumber:1});await n.appendEvent(e.id,e.currentPartitionId,c);let l=r.status==="error"?"error":r.status==="cancelled"?"cancelled":"success",u=Yde(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&Mn(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Mn(r.request.message),"@");(await Iw(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(Mn(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Mn(r.request.message),"/"),s=P2().find(c=>c.id===n);if(s){r.request.message=o,r.request.type="user",await this.determineAndApplyAgent(e,r);let c=s.instructions?s.instructions(this.ctx,r.request.message,e.source):o;r.template={templateId:n,userQuestion:r.request.message},r.request.message=c,r.request.type="template"}}}async determineAndApplyPromptTemplate(e,r,n){if(Mn(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(Mn(n.request.message),"/"),l=await e.get(D0).getPromptTemplate(o);l&&(l.uri.startsWith(Pq)?n.request.message=`Follow instructions: ${l.content} -${s}`:(n.request.message=`Follow instructions in [${l.name}](${l.uri}). ${s}`,n.request.references=[...n.request.references||[],{type:"file",uri:l.uri}]))}}extractKeywordAndQuestionFromRequest(e,r){let[n,...o]=e.trim().split(" "),s=o.join(" ");return[n.replace(r,""),s]}deleteTurn(e,r){this.get(e).deleteTurn(r)}get(e){return this.getHolder(e).conversation}getCapabilities(e){return this.getHolder(e).capabilities}getSupportedSkills(e){let r=this.ctx.get(fm).getDescriptors().filter(o=>o.type==="implicit").map(o=>o.id),n=this.getCapabilities(e).skills;return[...r,...n]}filterSupportedSkills(e,r){let n=this.getSupportedSkills(e);return r.filter(o=>n.includes(o))}getHolder(e){let r=this.conversations.get(e);if(!r)throw new Error(`Conversation with id ${e} does not exist`);return r}getAll(){let e=this.conversations.values();return Array.from(e).map(r=>r.conversation)}findByTurnId(e){for(let r of this.getAll()){let n=r.findTurn(e);if(n)return{conversation:r,turn:n}}}initializePartitionTranscript(e){try{let r=new Tg(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:e.source,createdAt:e.timestamp}).catch(n=>{ot.error(this.ctx,`Failed to initialize partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.ctx,`Failed to create transcript persistence: ${r instanceof Error?r.message:String(r)}`)}}};p();var gtt=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.progress=o;this.rounds=[]}static{a(this,"AgentToolCalls")}getRound(e){return this.rounds.find(r=>r.roundId===e)}getToolCallById(e){for(let r of this.rounds){let n=r.toolCalls?.find(o=>o.id===e);if(n)return n}}init(e,r,n,o,s,c){let l=this.getRound(e);if(l||(l={roundId:e,reply:""},this.rounds.push(l)),l.toolCalls?.find(d=>d.id===r))ot.error(this.ctx,`Tool call ${r} already exists for the round ${e} in conversation ${this.conversation.id} and turn ${this.turn.id}`);else{let d={id:r,name:n,toolType:o,status:"not started",input:s,inputMessage:c};l.toolCalls=[d]}}async running(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.progressMessage=n,o.status="running"})}async finish(e,r){await this.update({roundId:e,toolCallId:r},n=>{n.status="completed"})}async result(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.status="completed",o.result=n.data,n.toolResultMessage&&(o.progressMessage=n.toolResultMessage),o.resultDetails=n.toolResultDetails,o.toolSpecificData=n.toolSpecificData})}async cancel(e,r){await this.update({roundId:e,toolCallId:r},n=>{n.status="cancelled"})}async finishAll(e="completed"){let r=this.rounds.filter(n=>{let o=n.toolCalls?.filter(s=>s.status==="running").map(s=>(s.status=e,s));if(o&&o.length>0)return n.toolCalls=o,!0});r.length>0&&await this.progress.report(this.conversation,this.turn,{editAgentRounds:r})}async error(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.status="error",o.error=n||"Unknown error"})}async updateProgressMessage(e,r,n){await this.update({roundId:e,toolCallId:r,silent:!0},o=>{o.progressMessage=n})}async update({roundId:e,toolCallId:r,silent:n=!1},o){let s=this.rounds.find(l=>l.roundId===e);s||(s={roundId:e,reply:""},this.rounds.push(s));let c=s.toolCalls?.find(l=>l.id===r);c?(o(c),n||await this.progress.report(this.conversation,this.turn,{editAgentRounds:[s]})):ot.error(this.ctx,`Tool call ${r} not found for the agent round ${e} in conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var Att=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.progress=o;this.steps=[]}static{a(this,"Steps")}async start(e,r,n){let o=this.steps.find(s=>s.id===e);if(!o)o={id:e,title:r,description:n,status:"running"},this.steps.push(o),await this.progress.report(this.conversation,this.turn,{steps:[o]});else throw new Error(`Step with id "${e}" already started`)}async finish(e){await this.updateStep(e,r=>{r.status="completed"})}async cancel(e){await this.updateStep(e,r=>{r.status="cancelled"})}async finishAll(e="completed"){let r=this.steps.filter(n=>n.status==="running").map(n=>(n.status=e,n));r.length>0&&await this.progress.report(this.conversation,this.turn,{steps:r})}async error(e,r){return this.updateStep(e,n=>{n.status="failed",n.error={message:r||"Unknown error"}})}async updateStep(e,r){let n=this.steps.find(o=>o.id===e);n?(r(n),await this.progress.report(this.conversation,this.turn,{steps:[n]})):ot.error(this.ctx,`Step ${e} not found for conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var vcs="X-Initiator",Ccs="X-Interaction-ID",bcs="X-Interaction-Type";var ytt=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},Dzt=class extends ytt{static{a(this,"User")}static id(){return"user"}},Nzt=class extends ytt{static{a(this,"Agent")}static id(){return"agent"}},Mzt=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[vcs]:this.initiator,[Ccs]:this.interactionId,[bcs]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return WA.agent(e??this.interactionType,this.interactionId)}},WA=class t extends Mzt{static{a(this,"LlmInteraction")}static user(e,r){return new t(Dzt,e,r)}static agent(e,r){return new t(Nzt,e,r)}};function CDn(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a(CDn,"interactionTypeForChatMode");var Qw=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new Ozt(this),this.steps=new Att(e,r,n,e.get(Bc)),this.collector=new Lzt(r,n,e.get(Bc)),this.agentToolCalls=new gtt(e,r,n,e.get(Bc))}static{a(this,"TurnContext")}get uriSchemeCache(){return this.conversation.uriSchemeCache}setResolvedModelConfiguration(e){this.turn.resolvedModelConfiguration=e}toLlmInteraction(){if(this.turn.isSubagent()&&this.turn.parentLlmInteraction)return this.turn.parentLlmInteraction.cloneAsAgentInteraction("conversation-subagent");if(this.conversation.source==="inline")return WA.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?WA.agent(e,this.turn.telemetryId):WA.user(e,this.turn.telemetryId)}}async collectFile(e,r,n,o){let s={type:"file",collector:e,uri:r,status:n};o&&(s.range=o),await this.collector.collect(s)}collectLabel(e,r){this.collector.collect({type:"label",collector:e,label:r})}isFileIncluded(e){return this.collector.collectibles.some(r=>r.type==="file"&&r.status==="included"&&r.uri===e)}async info(e){await this.sendChatNotification(e,"info")}async warn(e){await this.sendChatNotification(e,"warning")}async sendChatNotification(e,r){await this.ctx.get(Bc).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},_tt=class extends Error{constructor(r,n){super(`Cycle detected while resolving skills: ${n.join(" -> ")} -> ${r}`);this.skillId=r;this.skillStack=n}static{a(this,"CycleError")}},hRe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},Ozt=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(Xo).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(I0).getResolvedSkill(this.turnContext.turn.id,e);if(n)return this.resolveStack.pop(),n;let o=await this.newlyResolve(e);return this.resolveStack.pop(),o}}ensureNoCycle(e){if(this.resolveStack.includes(e))throw new _tt(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(fm).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(I0).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof _tt||o instanceof hRe)throw o;ot.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},Lzt=class{constructor(e,r,n){this.conversation=e;this.turn=r;this.conversationProgress=n;this.collectibles=[]}static{a(this,"Collector")}async collect(e){this.collectibles.push(e),await this.reportCollectedFile(e)}async reportCollectedFile(e){e.type==="file"&&await this.conversationProgress.report(this.conversation,this.turn,{references:[{type:"file",uri:e.uri,status:e.status,range:e.range}]})}collectiblesForCollector(e){return this.collectibles.filter(r=>r.collector===e)}};p();p();p();var Scs={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function bDn(t){let e=kt(t,ze.AutoCompress);return{...Scs,enabled:e}}a(bDn,"getAutomaticCompressionConfig");p();var Tj=class t{static{a(this,"TokenBudgetEstimator")}static{this.CHARS_PER_TOKEN=4}static{this.MESSAGE_OVERHEAD_MULTIPLIER=1.15}constructor(){}estimateToolDefinitionTokens(e,r){try{let o=e.get(vs).getToolsForModel(r),s=0;for(let c of o){let l={type:"function",function:{name:c.nameForModel,description:c.description,parameters:c.inputSchema}},u=JSON.stringify(l);s+=Math.ceil(u.length/t.CHARS_PER_TOKEN)}return s}catch{return(r?.customTools?.length??0)*100}}estimateTokensFromText(e){return e?Math.ceil(e.length/t.CHARS_PER_TOKEN):0}estimateSystemMessageTokens(e){return 1500+e.baseTokensPerMessage}shouldCompressWithContextSize(e,r){let{totalTokenLimit:n,totalUsedTokens:o}=e;return!Number.isFinite(n)||n<=0?!1:o/n>=r}calculateContextSize(e,r,n){let o=this.estimateSystemMessageTokens(n),s=r.turns[r.turns.length-1],c=s?this.estimateToolDefinitionTokens(e,s.chatMode):0,l=0,u=0,d=0,f=0;for(let y of r.turns){let _=Mn(y.request.message),E=this.estimateTokensFromText(_)+n.baseTokensPerMessage;if(l+=Math.ceil(E*t.MESSAGE_OVERHEAD_MULTIPLIER),y.request.references?.length&&(d+=Math.ceil(y.request.references.length*50*t.MESSAGE_OVERHEAD_MULTIPLIER)),y.response){let v=Mn(y.response.message),S=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(S*t.MESSAGE_OVERHEAD_MULTIPLIER),bJ(y.response.message))for(let T of y.response.message){if(T.role==="tool"&&T.content){let w=typeof T.content=="string"?T.content:JSON.stringify(T.content),R=this.estimateTokensFromText(w)+n.baseTokensPerMessage;f+=Math.ceil(R*t.MESSAGE_OVERHEAD_MULTIPLIER)}if(T.thinking){let w=T.thinking;if(typeof w.tokens=="number"&&w.tokens>0)u+=w.tokens;else if(w.text!==void 0){let R=0;if(typeof w.text=="string")R=w.text.length;else if(Array.isArray(w.text))for(let x of w.text)R+=x.length;if(R>0){let x=Math.ceil(R/t.CHARS_PER_TOKEN);u+=Math.ceil(x*t.MESSAGE_OVERHEAD_MULTIPLIER)}}}}}if(y.restoredToolCalls?.length){for(let v of y.restoredToolCalls)if(v.toolCalls?.length){for(let S of v.toolCalls)if(S.result&&Array.isArray(S.result)){let T="";for(let w of S.result)w.type==="text"?T+=w.value:w.type==="data"&&(T+=JSON.stringify(w.value));if(T){let w=this.estimateTokensFromText(T)+n.baseTokensPerMessage;f+=Math.ceil(w*t.MESSAGE_OVERHEAD_MULTIPLIER)}}}}}let h=o+c+l+u+d+f,m=n.maxRequestTokens,g=n.maxResponseTokens,A=m>0?h/m*100:0;return{totalTokenLimit:m,reservedOutputTokens:g,systemPromptTokens:o,toolDefinitionTokens:c,userMessagesTokens:l,assistantMessagesTokens:u,attachedFilesTokens:d,toolResultsTokens:f,totalUsedTokens:h,utilizationPercentage:Math.min(100,Math.round(A*100)/100)}}};var Cb=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new Tj}static{a(this,"AutomaticCompressionManager")}async checkAndCompress(e,r,n,o,s){let c=this.tokenEstimator.calculateContextSize(this.ctx,e,r),l={estimatedTokens:c.totalUsedTokens,maxTokens:c.totalTokenLimit,utilizationRatio:c.utilizationPercentage/100,turnCount:e.turns.length},u=bDn(this.ctx);if(!u.enabled)return this.sendSkippedTelemetry(e,n,"disabled",l,r),{triggered:!1,tokenEstimate:l,skipReason:"disabled"};let d=n==="pre-turn"?u.preTurnThreshold:u.postToolCallThreshold;return this.tokenEstimator.shouldCompressWithContextSize(c,d)?(ot.info(this.ctx,`Automatic compression triggered: conversationId=${e.id}, trigger=${n}, tokens=${l.estimatedTokens}/${l.maxTokens} (${(l.utilizationRatio*100).toFixed(1)}%)`),await this.performCompression(e,r,n,o,l,s)):(this.sendSkippedTelemetry(e,n,"below_threshold",l,r),{triggered:!1,tokenEstimate:l,skipReason:"below_threshold"})}async performCompression(e,r,n,o,s,c){let l=Date.now(),u=String(e.id),d=e.currentPartitionId,f=e.turns.length;try{await this.notifier.notifyCompressionStarted({conversationId:u,partitionId:d,reason:n});let h=await this.compressor.compressCurrentPartition(e,r,o,c),m=Date.now()-l;if(h.success){let g=e.turns[0],A=typeof g?.request?.message=="string"?g.request.message.length:0,y;try{y=this.tokenEstimator.calculateContextSize(this.ctx,e,r)}catch(_){ot.warn(this.ctx,`Failed to calculate context size after compression: ${_ instanceof Error?_.message:String(_)}`)}return await this.notifier.notifyCompressionCompleted({conversationId:u,archivedPartitionId:h.archivedPartitionId,newPartitionId:h.newPartitionId,summaryLength:A,turnCount:f,durationMs:m,contextInfo:y}),this.sendTriggeredTelemetry(e,n,"success",s,h,m,r),{triggered:!0,compressionResult:h,tokenEstimate:s}}else return ot.error(this.ctx,`Automatic compression failed: conversationId=${u}, error=${h.error}`),this.sendTriggeredTelemetry(e,n,"failed",s,h,m,r),{triggered:!0,compressionResult:h,tokenEstimate:s,skipReason:"compression_failed"}}catch(h){let m=Date.now()-l,g=h instanceof Error?h.message:String(h);return ot.exception(this.ctx,h,`Automatic compression exception: conversationId=${u}`),this.sendExceptionTelemetry(e,n,g,s,m,r),{triggered:!0,tokenEstimate:s,skipReason:"compression_failed"}}}sendSkippedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,reason:n,...s?{modelId:s.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount});ft(this.ctx,"automaticCompression.skipped",c,0)}sendTriggeredTelemetry(e,r,n,o,s,c,l){let u=Vt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,outcome:n,archivedPartitionId:String(s.archivedPartitionId),newPartitionId:String(s.newPartitionId),...s.error&&{error:s.error},...l?{modelId:l.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount,durationMs:c});ft(this.ctx,"automaticCompression.triggered",u,0)}sendExceptionTelemetry(e,r,n,o,s,c){let l=Vt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,outcome:"exception",error:n,...c?{modelId:c.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount,durationMs:s});ft(this.ctx,"automaticCompression.triggered",l,0)}};p();var zA=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var Xd=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var Ett=fe(eue());var SDn=new Map;function P_(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(P_,"createNumberRange");function Bzt(t){return[...t].sort((e,r)=>r.length-e.length)}a(Bzt,"sortByStringLengthDesc");async function Tcs(t){let e=SDn.get(t);if(e)return e;let r=(async()=>{try{let n=await bWe(`tree-sitter-${t}.wasm`);return await Ett.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return SDn.set(t,r),r}a(Tcs,"loadShellLanguage");function TDn(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(TDn,"isPowerShell");var Ics=new Map([["sh",Bzt([...P_(1,9).concat("").map(t=>`${t}<<<`),...P_(1,9).concat("").flatMap(t=>P_(1,9).map(e=>`${t}>&${e}`)),...P_(1,9).concat("").map(t=>`${t}<>`),...P_(1,9).concat("&","").map(t=>`${t}>>`),...P_(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",Bzt([...P_(1,9).concat("").map(t=>`${t}<<<`),...P_(1,9).concat("").flatMap(t=>P_(1,9).map(e=>`${t}>&${e}`)),...P_(1,9).concat("").map(t=>`${t}<>`),...P_(1,9).concat("&","").map(t=>`${t}>>`),...P_(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",Bzt([...P_(1,6).concat("*","").flatMap(t=>P_(1,6).map(e=>`${t}>&${e}`)),...P_(1,6).concat("*","").map(t=>`${t}>>`),...P_(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function xcs(t,e){let r,n=e.replace(/\.exe$/,"");TDn(e)?r="pwsh":r=(n.split(/[/\\]/).pop()||"")==="zsh"?"zsh":"sh";let o=[t],s=Ics.get(r);if(s)for(let c of s)for(let l=0;ld.trim())),l--)}return o.filter(c=>c.trim().length>0)}a(xcs,"splitCommandLineIntoSubCommands");async function vtt(t,e){try{let r;TDn(e)?r="powershell":r="bash",await Ett.default.init();let n,o;try{n=new Ett.default;let s=await Tcs(r);return n.setLanguage(s),o=n.parse(t),s.query("(command) @command").captures(o.rootNode).map(u=>u.node.text.trim()).filter(u=>u.length>0)}finally{o?.delete(),n?.delete()}}catch{return xcs(t,e)}}a(vtt,"extractSubCommandsWithTreeSitter");var wcs=new Set(["sudo","env"]),Rcs=/^[A-Za-z_][A-Za-z0-9_]*=/;function Fzt(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(Rcs.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||wcs.has(r.toLowerCase()))continue;let n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\")),o=n>=0?r.substring(n+1):r;return o.length>0?o:void 0}}a(Fzt,"extractCommandNameFromSubCommand");var Yde=new pe("CommandLineAutoApprover"),IDn=/(?!.*)/,kcs=/^[A-Z_][A-Z0-9_]*=/i,wT=class{constructor(e){this.ctx=e;this._denyListRules=[];this._allowListRules=[]}static{a(this,"CommandLineAutoApprover")}updateConfiguration(e){let{denyListRules:r,allowListRules:n}=this._mapAutoApproveConfigToRules(e);this._allowListRules=n,this._denyListRules=r}isCommandAutoApproved(e){if(kcs.test(e))return{result:"denied",reason:`Command '${e}' is denied because it contains transient environment variables`};for(let r of this._denyListRules)if(this._commandMatchesRegex(r.regex,e))return{result:"denied",reason:`Command '${e}' is denied by deny list rule: ${r.sourceText}`};for(let r of this._allowListRules)if(this._commandMatchesRegex(r.regex,e))return{result:"approved",reason:`Command '${e}' is approved by allow list rule: ${r.sourceText}`};return{result:"noMatch",reason:`Command '${e}' has no matching auto approve entries`}}async isTerminalCommandApprovalRequired(e,r){let n=await vtt(e,r);Yde.info(this.ctx,`Command '${e}' is split into sub-commands: ${JSON.stringify(n)}`);let o=n.map(l=>this.isCommandAutoApproved(l)),s=o.find(l=>l.result==="denied");if(s)return Yde.info(this.ctx,`Command '${e}' is denied, reason:'${s.reason}'`),s;if(o.every(l=>l.result==="approved")){let l=`Command '${e}' is approved, reason:'${o.map(u=>u.reason).join("; ")}'`;return Yde.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return Yde.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await vtt(e,r),o=[...new Set(n.map(Fzt).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await vtt(e,r),o=n.map(s=>Fzt(s)??"");return{subCommands:n,commandNames:o}}_commandMatchesRegex(e,r){return!!e.test(r)}_mapAutoApproveConfigToRules(e){if(!e||typeof e!="object")return{denyListRules:[],allowListRules:[]};let r=[],n=[];return Object.entries(e).forEach(([o,s])=>{if(typeof s=="boolean"){let c=this._convertAutoApproveEntryToRegex(o);s===!0?n.push({regex:c,sourceText:o}):s===!1&&r.push({regex:c,sourceText:o})}else if(typeof s=="object"&&s!==null){let c=s;if(typeof c.approve=="boolean"){let l=this._convertAutoApproveEntryToRegex(o);c.approve===!0?n.push({regex:l,sourceText:o}):c.approve===!1&&r.push({regex:l,sourceText:o})}}}),Yde.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),Yde.debug(this.ctx,"Update CommandLineAutoApprover allowListRules",n),{denyListRules:r,allowListRules:n}}_convertAutoApproveEntryToRegex(e){let r=e.match(/^\/(?.+)\/(?[dgimsuvy]*)$/),n=r?.groups?.pattern;if(n){let s=r.groups?.flags;s&&(s=s.replaceAll("g",""));try{let c=new RegExp(n,s||void 0);return this._regExpLeadsToEndlessLoop(c)?IDn:c}catch{return IDn}}let o=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return new RegExp(`^${o}\\b`)}_regExpLeadsToEndlessLoop(e){return e.source==="^"||e.source==="^$"||e.source==="$"||e.source==="^\\s*$"?!1:!!(e.exec("")&&e.lastIndex===0)}};p();var Ctt=class{constructor(e){this.cache=new Map;this.inner=e}static{a(this,"SnapshotTextDocumentProvider")}getByUri(e){let r=this.cache.get(e);return r||(r=this.inner.getByUri(e),this.cache.set(e,r)),r}};p();var btt=class{constructor(e){this.ctx=e}static{a(this,"DefaultTextDocumentProvider")}async getByUri(e){return await this.ctx.get(si).getOrReadTextDocument({uri:e})}};p();p();p();p();p();p();var Stt=class{constructor(e,r,n,o,s){this.event=e;this.hook=r;this.exitCode=n;this.stdout=o;this.stderr=s;this.type="command";this.output=Pcs(this.stdout)}static{a(this,"CommandHookResult")}};function Pcs(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(Pcs,"parseOutput");var qzt=require("child_process");var Ttt=new pe("HookExecutor"),Itt=class{constructor(){this.handlers=[new Uzt,new Qzt]}static{a(this,"HookExecutor")}async execute(e,r,n,o){if(!e.get(up).isTrusted(r.source)){Ttt.warn(e,`Refusing to execute hook from untrusted workspace folder: ${r.source}`);return}for(let s of this.handlers)if(s.isAcceptable(n))try{return await s.handle(e,r,n,o)}catch(c){Ttt.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}Ttt.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},xtt=class{static{a(this,"CommandHookHandler")}async handle(e,r,n,o){o.cwd=n.cwd??o.cwd??process.cwd();let s=this.spawnProcess(n,o);if(!s.stdout||!s.stderr||!s.stdin)throw new Error("Failed to create child process with stdio pipes");let{stdout:c,stderr:l,stdin:u}=s,d="",f="",h=10*1024*1024;c.on("data",g=>{if(d+=g.toString(),d.length>h)throw s.kill(),new Error("Command output exceeded maximum size")}),l.on("data",g=>{if(f+=g.toString(),f.length>h)throw s.kill(),new Error("Command error output exceeded maximum size")}),u.on("error",g=>{g.code!=="EPIPE"&&Ttt.warn(e,`stdin error: ${g instanceof Error?g.message:String(g)}`)});let m=JSON.stringify(o);return u.write(m),u.end(),new Promise((g,A)=>{let y=n.timeoutSec??30,_=setTimeout(()=>{s.kill("SIGTERM"),A(new Error(`Command timed out after ${y} seconds`))},y*1e3),E=a(()=>{clearTimeout(_)},"cleanup");s.on("error",v=>{E(),A(new Error(`Failed to execute command: ${v.message}`))}),s.on("close",v=>{E(),g(new Stt(r,n,v??0,d,f))})})}buildSpawnOptions(e,r){return{cwd:r.cwd,env:e.env?{...process.env,...e.env}:process.env,stdio:["pipe","pipe","pipe"]}}},Uzt=class extends xtt{static{a(this,"BashCommandHookHandler")}isAcceptable(e){return process.platform!=="win32"&&e.type==="command"&&e.bash!==void 0}spawnProcess(e,r){let n={...this.buildSpawnOptions(e,r),shell:!0};return(0,qzt.spawn)(e.bash,[],n)}},Qzt=class extends xtt{static{a(this,"PowerShellCommandHookHandler")}isAcceptable(e){return process.platform==="win32"&&e.type==="command"&&e.powershell!==void 0}spawnProcess(e,r){let n=this.buildSpawnOptions(e,r);return(0,qzt.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var Dcs=new Itt,D_=class{constructor(e,r,n=[]){this.source=e;this.eventType=r;this.hooks=n}static{a(this,"HookEvent")}async fire(e,r){let n=this.hooks.map(async o=>await Dcs.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var uke=class extends D_{static{a(this,"AgentStopEvent")}constructor(e,r=[]){super(e,"agentStop",r)}};p();var GF=class extends D_{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var D2=class extends D_{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var Kde={allow:"allow",deny:"deny",ask:"ask"},N2=class extends D_{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var $F=class extends D_{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var VF=class extends D_{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var M2=class extends D_{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var aZ=class{constructor(e,r,n){this.conversation=e;this.turn=r;this.conversationProgress=n}static{a(this,"HookProgress")}async reportPlanned(e){let r=[];for(let n of e)for(let o of n.hooks)r.push({eventType:n.eventType,source:n.source,status:"planned"});r.length>0&&await this.conversationProgress.report(this.conversation,this.turn,{hookExecutions:r})}async reportResults(e){if(e.length===0)return;let r=e.map(n=>n.type!=="command"?{eventType:n.event.eventType,source:n.event.source,status:"failure"}:{eventType:n.event.eventType,source:n.event.source,status:n.exitCode===0?"success":"failure",result:{exitCode:n.exitCode,stdout:n.stdout,stderr:n.stderr}});await this.conversationProgress.report(this.conversation,this.turn,{hookExecutions:r})}};p();p();function WF(t){try{return!(!kt(t,ze.EnableHooks)||t.get(eu).getPolicyValue("customHook.enabled")===!1)}catch{return!1}}a(WF,"hooksEnabled");var Ncs=".github/hooks/**/*.json",Mcs=[".claude/settings.json",".claude/settings.local.json","~/.claude/settings.json"],xDn="agentHook.execution",Ocs={sessionStart:VF,sessionEnd:$F,agentStop:uke,userPromptSubmitted:M2,preToolUse:N2,postToolUse:D2,errorOccurred:GF},D0=class{constructor(e){this.logger=new pe("HookService");this.gateSubscriptions=[];this.ctx=e;let r=this.ctx.get(QA);this.registrations=[r.register("hook",[Ncs],{metadata:{hookSource:"copilot",providers:["LOCAL","BACKGROUND"]}}),r.register("hook",Mcs,{metadata:{hookSource:"claude",providers:["CLAUDE"]}})],this.subscribeToGateChanges()}static{a(this,"HookService")}dispose(){for(let e of this.registrations)e.dispose();for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}async hook(e,r,n,o,s){if(!this.areHooksEnabled())return[];let c=await this.collect(e,r,o);s&&await s(c),c.length>0&&(ft(e,xDn),sr(e,xDn,{eventType:c[0].eventType,eventCount:c.length.toString(),hookCount:c.reduce((u,d)=>u+d.hooks.length,0).toString()}));let l=c.map(async u=>await u.fire(e,n));return(await Promise.all(l)).flat()}async listHooks(e){return this.areHooksEnabled()?(await this.ctx.get(y0).collect(this.ctx,"hook",e)).filter(n=>{let o=AJ(n.promptPath.metadata);return o==="copilot"?!0:o==="claude"?Object.values(n.parsedPromptFile.hooks).some(s=>(s?.length??0)>0):!1}):[]}areHooksEnabled(){let e=WF(this.ctx);return e||this.logger.debug(this.ctx,"Hooks are disabled by configuration or customHook.enabled policy."),e}subscribeToGateChanges(){try{let e=this.ctx.get(Qo);this.lastEnableHooks=kt(this.ctx,ze.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=kt(this.ctx,ze.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(eu);this.lastCustomHookPolicyEnabled=e.getPolicyValue("customHook.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customHook.enabled");r!==this.lastCustomHookPolicyEnabled&&(this.lastCustomHookPolicyEnabled=r,this.notifyHookListChanged())}))}catch{}}notifyHookListChanged(){try{this.ctx.get(_g).notify("hook").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(hook) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(hook) failed:",e)}}async collect(e,r,n){let o=Object.entries(Ocs).find(([,l])=>l===r)?.[0];if(!o)return this.logger.warn(this.ctx,`Unknown hook event constructor: ${r.name}`),[];let s=await this.ctx.get(y0).collect(e,"hook",[n]),c=[];for(let l of s){if(AJ(l.promptPath.metadata)!=="copilot")continue;let u=l.parsedPromptFile,d=u.hooks[o];d!==void 0&&c.push(new r(u.uri,[...d]))}return c}};p();function YA(t){return`[${ro(t)}](${t})`}a(YA,"formatUriForFileWidget");function md(t,e){let r=Lcs(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(md,"resolvePathInput");function Lcs(t,e){let r=e?.resolveFromCache(t);if(r)return r;let n=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):\/\//);if(n){let s=n[1].toLowerCase();return Qz.has(s)||ga.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(ga.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||wDn()&&Fcs(t)||wDn()&&t.startsWith("\\\\"))return Ko(t)}a(Lcs,"resolveFsUri");function wDn(){return process.platform==="win32"}a(wDn,"isWindows");function Bcs(t){return t>=65&&t<=90||t>=97&&t<=122}a(Bcs,"isWindowsDriveLetter");function Fcs(t){return Bcs(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(Fcs,"hasDriveLetter");function I5(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof Or?r.value:r instanceof _J?"":r instanceof Mq?JSON.stringify(r.value):"").join(` -`)),e===""?"(empty)":e}a(I5,"parseToolResultToString");function wtt(t){let{content:e}=t;return{message:I5(e)}}a(wtt,"formatToolErrorResult");function RDn(t){let{content:e}=t,r={data:e.map(n=>n instanceof Or?{type:"text",value:n.value}:n instanceof _J?{type:"text",value:""}:n instanceof Mq?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof Oq&&(t.toolResultMessage!==void 0&&(r.toolResultMessage=t.toolResultMessage),t.toolResultDetails!==void 0&&(r.toolResultDetails=t.toolResultDetails),t.toolSpecificData!==void 0&&(r.toolSpecificData=t.toolSpecificData)),r}a(RDn,"formatToolSuccessResult");function cZ(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(cZ,"extractShellFromToolDescription");var Rtt=new pe("HookTrigger"),Jde=class{constructor(e,r,n){this.ctx=e;this.conversation=r;this.workspaceFolders=n}static{a(this,"HookTrigger")}async firePreToolUseHook(e,r,n,o){try{let s=this.ctx.get(D0),c=o?new aZ(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,N2,{timestamp:Date.now(),cwd:un(u.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r)},u,c?async f=>{u===this.workspaceFolders[0]&&await c.reportPlanned(f)}:void 0);l.push(...d)}return c&&await c.reportResults(l),this.checkPreToolUseHookResults(l)}catch(s){return Rtt.error(this.ctx,`Failed to execute PreToolUse hook for tool ${e.name}`,s),{denied:!1}}}async firePostToolUseHook(e,r,n,o,s){try{let c=this.ctx.get(D0),l=s?new aZ(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,D2,{timestamp:Date.now(),cwd:un(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:I5(n.content)}},d,l?async h=>{d===this.workspaceFolders[0]&&await l.reportPlanned(h)}:void 0);u.push(...f)}l&&await l.reportResults(u)}catch(c){Rtt.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(D0),o=this.extractPromptFromMessage(e),s=r?new aZ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,M2,{timestamp:Date.now(),cwd:un(l.uri),prompt:o},l,s?async d=>{l===this.workspaceFolders[0]&&await s.reportPlanned(d)}:void 0);c.push(...u)}s&&await s.reportResults(c)}catch(n){Rtt.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(D0),o=kt(this.ctx,ze.HookErrorOccurredStackTrace),s=r?new aZ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,GF,{timestamp:Date.now(),cwd:un(l.uri),error:{message:e.message,name:e.name,stack:o?e.stack:void 0}},l,s?async d=>{l===this.workspaceFolders[0]&&await s.reportPlanned(d)}:void 0);c.push(...u)}s&&await s.reportResults(c)}catch(n){Rtt.error(this.ctx,"Failed to execute ErrorOccurred hook",n)}}extractPromptFromMessage(e){return typeof e=="string"?e:Array.isArray(e)?e.map(r=>typeof r=="string"?r:typeof r=="object"&&r!==null&&"content"in r&&typeof r.content=="string"?r.content:typeof r=="object"&&r!==null&&"text"in r&&typeof r.text=="string"?r.text:"").filter(Boolean).join(" "):""}checkPreToolUseHookResults(e){for(let r of e){let n=r.output;if(n&&n.permissionDecision===Kde.deny)return{denied:!0,reason:n.permissionDecisionReason||"Tool execution denied by hook"}}return{denied:!1}}toToolResultType(e){switch(e){case"success":return"success";case"error":return"failure";case"cancelled":return"denied";default:return"failure"}}};p();p();var jzt=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},dke=class extends jzt{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var lZ=fe(wo());var Wn=class t extends lZ.PromptElement{static{a(this,"Tag")}static{this._regex=/^[a-zA-Z_][\w.-]*$/}render(){let{name:e,children:r,attrs:n={}}=this.props;if(!t._regex.test(e))throw new Error(`Invalid tag name: ${this.props.name}. Tag names must start with a letter or underscore, and can contain letters, digits, underscores, hyphens, or periods.`);let o="";for(let[c,l]of Object.entries(n))l!==void 0&&(o+=` ${c}=${JSON.stringify(l)}`);if(r?.length===0)return o?vscpp(lZ.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,lZ.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> -`)),vscpp(Hzt,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},Hzt=class extends lZ.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function kDn(){return vscpp(Wn,{name:"modeInstructions"},'You are currently running in "Ask" mode. Below are your instructions for this mode, they must take precedence over any instructions above.',vscpp("br",null),vscpp("br",null),"You are an ASK AGENT \u2014 a knowledgeable assistant that answers questions, explains code, and provides information.",vscpp("br",null),vscpp("br",null),"You are strictly read-only: NEVER modify files or run commands that change state.",vscpp("br",null),vscpp("br",null),vscpp(Wn,{name:"rules"},"- NEVER use file editing tools, terminal commands that modify state, or any write operations",vscpp("br",null),"- Focus on answering questions, explaining concepts, and providing information",vscpp("br",null),"- Use search and read tools to gather context from the codebase when needed",vscpp("br",null),"- Provide code examples in your responses when helpful, but do NOT apply them",vscpp("br",null),"- When the user's question is about code, reference specific files and symbols",vscpp("br",null),"- If a question would require making changes, explain what changes would be needed but do NOT make them",vscpp("br",null),"- SKIP a plan when: The task is simple and direct. Breaking it down would only produce literal or trivial steps.",vscpp("br",null),"- Keep your response focused and proportional to the question. Don't over-explain simple concepts unless the user asks for more detail."),vscpp("br",null),vscpp(Wn,{name:"capabilities"},"You can help with:",vscpp("br",null),"- **Code explanation**: How does this code work? What does this function do?",vscpp("br",null),"- **Architecture questions**: How is the project structured? How do components interact?",vscpp("br",null),"- **Debugging guidance**: Why might this error occur? What could cause this behavior?",vscpp("br",null),"- **Best practices**: What's the recommended approach for X? How should I structure Y?",vscpp("br",null),"- **API and library questions**: How do I use this API? What does this method expect?",vscpp("br",null),"- **Codebase navigation**: Where is X defined? Where is Y used?",vscpp("br",null),"- **General programming**: Language features, algorithms, design patterns, etc."),vscpp("br",null),vscpp(Wn,{name:"workflow"},"1. **Understand** the question \u2014 identify what the user needs to know",vscpp("br",null),"2. **Research** the codebase if needed \u2014 use search and read tools to find relevant code",vscpp("br",null),"3. **Answer** clearly \u2014 provide a well-structured response with references to relevant code"))}a(kDn,"renderAskModeInstructionBody");p();p();var Ij=class extends fr{static{a(this,"UserOSPrompt")}renderCopilot(e,r,n,o){let s=process.platform;return vscpp(vscppf,null,"The user's current OS is: ",s==="win32"?"Windows":s==="darwin"?"macOS":s==="linux"?"Linux":"Unknown")}};p();var ktt=class extends fr{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var PDn=require("path");var Ptt=class extends fr{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,PDn.basename)(s),l=c==="powershell.exe"?" (Windows PowerShell v5.1)":"",u="";return c==="powershell.exe"&&(u=" Use the `;` character if joining commands on a single line is needed."),vscpp(vscppf,null,`The user's default shell is: "`,c,'"',l,". When you generate terminal commands, please generate them correctly for this shell.",u)}getUserShell(){let n=this.props.ctx.get(vs).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=cZ(n.description);if(o)return o}if(process.env.SHELL)return process.env.SHELL;switch(process.platform){case"win32":return process.env.ComSpec||"cmd.exe";case"darwin":case"linux":return"/bin/bash";default:return"sh"}}};p();var xj=class extends fr{static{a(this,"WorkspaceFoldersHint")}renderCopilot(e,r,n,o){if(this.props.workspaceFolders&&this.props.workspaceFolders.length>0){let s=this.props.workspaceFolders.map(c=>{let l=oo(c.uri);return` - ${ga.isRegisteredScheme(l.scheme)?c.uri:ys(c.uri)}`}).join(` -`);return vscpp(vscppf,null,"I am working in a workspace with the following folders:",vscpp("br",null),s)}else return vscpp(vscppf,null,"There is no workspace currently open.")}};p();p();p();function DDn(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(DDn,"partsLength");async function MDn(t,e=1/0,r){let n=NDn(0,t,e),o=e-DDn(n);for(;;){let s=!1,c=[];for(let l of n)if(l.type==="text")c.push(l);else if(l.type==="dir"){c.push({type:"text",uri:l.uri,value:l.value});let u=await l.getChildren();if(r?.isCancellationRequested)return Ucs();let d=NDn(l.level+1,u,o-1);d.length&&(s=!0,o-=DDn(d)+1,c.push(...d))}if(n=c,!s)break}return{files:n.map(s=>s.uri).filter(s=>s!==void 0),tree:n.map(s=>s.value).join(` -`)}}a(MDn,"visualFileTree");function NDn(t,e,r){let n=" ".repeat(t),o=[],s=r;for(let c=0;cs){let d=n+"...";for(;d.length>s&&o.length>0;)s+=o.pop().value.length+1;d.length<=s&&o.push({type:"text",uri:void 0,value:d});break}l.type===2?o.push({type:"dir",uri:l.uri,level:t,value:u,getChildren:l.getChildren}):o.push({type:"text",uri:l.uri,value:u}),s-=u.length,c!==e.length-1&&(s-=1)}return o}a(NDn,"toParts");var Ucs=a(()=>({tree:"",files:[]}),"emptyTree");p();async function Dtt(t,e){let r=oo(e);return ga.isRegisteredScheme(r.scheme)?(await t.get(ga).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get(Go).readDirectory(e)}a(Dtt,"readDirectory");var Qcs=new pe("fileReferencesPrompt");async function ODn(t,e,r,n){let o=await LDn(t,e,r,n);if(!o.length)return"";let s="";for(let{label:l,uri:u,tree:d}of o){let f=oo(u),h=ga.isRegisteredScheme(f.scheme)?u:un(u);s+=`${l} (Absolute Path: ${h})/ +${s}`:(n.request.message=`Follow instructions in [${l.name}](${l.uri}). ${s}`,n.request.references=[...n.request.references||[],{type:"file",uri:l.uri}]))}}extractKeywordAndQuestionFromRequest(e,r){let[n,...o]=e.trim().split(" "),s=o.join(" ");return[n.replace(r,""),s]}deleteTurn(e,r){this.get(e).deleteTurn(r)}get(e){return this.getHolder(e).conversation}getCapabilities(e){return this.getHolder(e).capabilities}getSupportedSkills(e){let r=this.ctx.get(fm).getDescriptors().filter(o=>o.type==="implicit").map(o=>o.id),n=this.getCapabilities(e).skills;return[...r,...n]}filterSupportedSkills(e,r){let n=this.getSupportedSkills(e);return r.filter(o=>n.includes(o))}getHolder(e){let r=this.conversations.get(e);if(!r)throw new Error(`Conversation with id ${e} does not exist`);return r}getAll(){let e=this.conversations.values();return Array.from(e).map(r=>r.conversation)}findByTurnId(e){for(let r of this.getAll()){let n=r.findTurn(e);if(n)return{conversation:r,turn:n}}}initializePartitionTranscript(e){try{let r=new Ig(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:e.source,createdAt:e.timestamp}).catch(n=>{ot.error(this.ctx,`Failed to initialize partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.ctx,`Failed to create transcript persistence: ${r instanceof Error?r.message:String(r)}`)}}};p();var gtt=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.progress=o;this.rounds=[]}static{a(this,"AgentToolCalls")}getRound(e){return this.rounds.find(r=>r.roundId===e)}getToolCallById(e){for(let r of this.rounds){let n=r.toolCalls?.find(o=>o.id===e);if(n)return n}}init(e,r,n,o,s,c){let l=this.getRound(e);if(l||(l={roundId:e,reply:""},this.rounds.push(l)),l.toolCalls?.find(d=>d.id===r))ot.error(this.ctx,`Tool call ${r} already exists for the round ${e} in conversation ${this.conversation.id} and turn ${this.turn.id}`);else{let d={id:r,name:n,toolType:o,status:"not started",input:s,inputMessage:c};l.toolCalls=[d]}}async running(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.progressMessage=n,o.status="running"})}async finish(e,r){await this.update({roundId:e,toolCallId:r},n=>{n.status="completed"})}async result(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.status="completed",o.result=n.data,n.toolResultMessage&&(o.progressMessage=n.toolResultMessage),o.resultDetails=n.toolResultDetails,o.toolSpecificData=n.toolSpecificData})}async cancel(e,r){await this.update({roundId:e,toolCallId:r},n=>{n.status="cancelled"})}async finishAll(e="completed"){let r=this.rounds.filter(n=>{let o=n.toolCalls?.filter(s=>s.status==="running").map(s=>(s.status=e,s));if(o&&o.length>0)return n.toolCalls=o,!0});r.length>0&&await this.progress.report(this.conversation,this.turn,{editAgentRounds:r})}async error(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.status="error",o.error=n||"Unknown error"})}async updateProgressMessage(e,r,n){await this.update({roundId:e,toolCallId:r,silent:!0},o=>{o.progressMessage=n})}async update({roundId:e,toolCallId:r,silent:n=!1},o){let s=this.rounds.find(l=>l.roundId===e);s||(s={roundId:e,reply:""},this.rounds.push(s));let c=s.toolCalls?.find(l=>l.id===r);c?(o(c),n||await this.progress.report(this.conversation,this.turn,{editAgentRounds:[s]})):ot.error(this.ctx,`Tool call ${r} not found for the agent round ${e} in conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var Att=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.progress=o;this.steps=[]}static{a(this,"Steps")}async start(e,r,n){let o=this.steps.find(s=>s.id===e);if(!o)o={id:e,title:r,description:n,status:"running"},this.steps.push(o),await this.progress.report(this.conversation,this.turn,{steps:[o]});else throw new Error(`Step with id "${e}" already started`)}async finish(e){await this.updateStep(e,r=>{r.status="completed"})}async cancel(e){await this.updateStep(e,r=>{r.status="cancelled"})}async finishAll(e="completed"){let r=this.steps.filter(n=>n.status==="running").map(n=>(n.status=e,n));r.length>0&&await this.progress.report(this.conversation,this.turn,{steps:r})}async error(e,r){return this.updateStep(e,n=>{n.status="failed",n.error={message:r||"Unknown error"}})}async updateStep(e,r){let n=this.steps.find(o=>o.id===e);n?(r(n),await this.progress.report(this.conversation,this.turn,{steps:[n]})):ot.error(this.ctx,`Step ${e} not found for conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var bcs="X-Initiator",Scs="X-Interaction-ID",Tcs="X-Interaction-Type";var ytt=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},Nzt=class extends ytt{static{a(this,"User")}static id(){return"user"}},Mzt=class extends ytt{static{a(this,"Agent")}static id(){return"agent"}},Ozt=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[bcs]:this.initiator,[Scs]:this.interactionId,[Tcs]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return WA.agent(e??this.interactionType,this.interactionId)}},WA=class t extends Ozt{static{a(this,"LlmInteraction")}static user(e,r){return new t(Nzt,e,r)}static agent(e,r){return new t(Mzt,e,r)}};function bDn(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a(bDn,"interactionTypeForChatMode");var Qw=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new Lzt(this),this.steps=new Att(e,r,n,e.get(Bc)),this.collector=new Bzt(r,n,e.get(Bc)),this.agentToolCalls=new gtt(e,r,n,e.get(Bc))}static{a(this,"TurnContext")}get uriSchemeCache(){return this.conversation.uriSchemeCache}setResolvedModelConfiguration(e){this.turn.resolvedModelConfiguration=e}toLlmInteraction(){if(this.turn.isSubagent()&&this.turn.parentLlmInteraction)return this.turn.parentLlmInteraction.cloneAsAgentInteraction("conversation-subagent");if(this.conversation.source==="inline")return WA.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?WA.agent(e,this.turn.telemetryId):WA.user(e,this.turn.telemetryId)}}async collectFile(e,r,n,o){let s={type:"file",collector:e,uri:r,status:n};o&&(s.range=o),await this.collector.collect(s)}collectLabel(e,r){this.collector.collect({type:"label",collector:e,label:r})}isFileIncluded(e){return this.collector.collectibles.some(r=>r.type==="file"&&r.status==="included"&&r.uri===e)}async info(e){await this.sendChatNotification(e,"info")}async warn(e){await this.sendChatNotification(e,"warning")}async sendChatNotification(e,r){await this.ctx.get(Bc).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},_tt=class extends Error{constructor(r,n){super(`Cycle detected while resolving skills: ${n.join(" -> ")} -> ${r}`);this.skillId=r;this.skillStack=n}static{a(this,"CycleError")}},hRe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},Lzt=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(Xo).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(x0).getResolvedSkill(this.turnContext.turn.id,e);if(n)return this.resolveStack.pop(),n;let o=await this.newlyResolve(e);return this.resolveStack.pop(),o}}ensureNoCycle(e){if(this.resolveStack.includes(e))throw new _tt(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(fm).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(x0).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof _tt||o instanceof hRe)throw o;ot.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},Bzt=class{constructor(e,r,n){this.conversation=e;this.turn=r;this.conversationProgress=n;this.collectibles=[]}static{a(this,"Collector")}async collect(e){this.collectibles.push(e),await this.reportCollectedFile(e)}async reportCollectedFile(e){e.type==="file"&&await this.conversationProgress.report(this.conversation,this.turn,{references:[{type:"file",uri:e.uri,status:e.status,range:e.range}]})}collectiblesForCollector(e){return this.collectibles.filter(r=>r.collector===e)}};p();p();p();var Ics={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function SDn(t){let e=kt(t,ze.AutoCompress);return{...Ics,enabled:e}}a(SDn,"getAutomaticCompressionConfig");p();var Tj=class t{static{a(this,"TokenBudgetEstimator")}static{this.CHARS_PER_TOKEN=4}static{this.MESSAGE_OVERHEAD_MULTIPLIER=1.15}constructor(){}estimateToolDefinitionTokens(e,r){try{let o=e.get(vs).getToolsForModel(r),s=0;for(let c of o){let l={type:"function",function:{name:c.nameForModel,description:c.description,parameters:c.inputSchema}},u=JSON.stringify(l);s+=Math.ceil(u.length/t.CHARS_PER_TOKEN)}return s}catch{return(r?.customTools?.length??0)*100}}estimateTokensFromText(e){return e?Math.ceil(e.length/t.CHARS_PER_TOKEN):0}estimateSystemMessageTokens(e){return 1500+e.baseTokensPerMessage}shouldCompressWithContextSize(e,r){let{totalTokenLimit:n,totalUsedTokens:o}=e;return!Number.isFinite(n)||n<=0?!1:o/n>=r}calculateContextSize(e,r,n){let o=this.estimateSystemMessageTokens(n),s=r.turns[r.turns.length-1],c=s?this.estimateToolDefinitionTokens(e,s.chatMode):0,l=0,u=0,d=0,f=0;for(let y of r.turns){let _=Mn(y.request.message),E=this.estimateTokensFromText(_)+n.baseTokensPerMessage;if(l+=Math.ceil(E*t.MESSAGE_OVERHEAD_MULTIPLIER),y.request.references?.length&&(d+=Math.ceil(y.request.references.length*50*t.MESSAGE_OVERHEAD_MULTIPLIER)),y.response){let v=Mn(y.response.message),S=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(S*t.MESSAGE_OVERHEAD_MULTIPLIER),SJ(y.response.message))for(let T of y.response.message){if(T.role==="tool"&&T.content){let w=typeof T.content=="string"?T.content:JSON.stringify(T.content),R=this.estimateTokensFromText(w)+n.baseTokensPerMessage;f+=Math.ceil(R*t.MESSAGE_OVERHEAD_MULTIPLIER)}if(T.thinking){let w=T.thinking;if(typeof w.tokens=="number"&&w.tokens>0)u+=w.tokens;else if(w.text!==void 0){let R=0;if(typeof w.text=="string")R=w.text.length;else if(Array.isArray(w.text))for(let x of w.text)R+=x.length;if(R>0){let x=Math.ceil(R/t.CHARS_PER_TOKEN);u+=Math.ceil(x*t.MESSAGE_OVERHEAD_MULTIPLIER)}}}}}if(y.restoredToolCalls?.length){for(let v of y.restoredToolCalls)if(v.toolCalls?.length){for(let S of v.toolCalls)if(S.result&&Array.isArray(S.result)){let T="";for(let w of S.result)w.type==="text"?T+=w.value:w.type==="data"&&(T+=JSON.stringify(w.value));if(T){let w=this.estimateTokensFromText(T)+n.baseTokensPerMessage;f+=Math.ceil(w*t.MESSAGE_OVERHEAD_MULTIPLIER)}}}}}let h=o+c+l+u+d+f,m=n.maxRequestTokens,g=n.maxResponseTokens,A=m>0?h/m*100:0;return{totalTokenLimit:m,reservedOutputTokens:g,systemPromptTokens:o,toolDefinitionTokens:c,userMessagesTokens:l,assistantMessagesTokens:u,attachedFilesTokens:d,toolResultsTokens:f,totalUsedTokens:h,utilizationPercentage:Math.min(100,Math.round(A*100)/100)}}};var Cb=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new Tj}static{a(this,"AutomaticCompressionManager")}async checkAndCompress(e,r,n,o,s){let c=this.tokenEstimator.calculateContextSize(this.ctx,e,r),l={estimatedTokens:c.totalUsedTokens,maxTokens:c.totalTokenLimit,utilizationRatio:c.utilizationPercentage/100,turnCount:e.turns.length},u=SDn(this.ctx);if(!u.enabled)return this.sendSkippedTelemetry(e,n,"disabled",l,r),{triggered:!1,tokenEstimate:l,skipReason:"disabled"};let d=n==="pre-turn"?u.preTurnThreshold:u.postToolCallThreshold;return this.tokenEstimator.shouldCompressWithContextSize(c,d)?(ot.info(this.ctx,`Automatic compression triggered: conversationId=${e.id}, trigger=${n}, tokens=${l.estimatedTokens}/${l.maxTokens} (${(l.utilizationRatio*100).toFixed(1)}%)`),await this.performCompression(e,r,n,o,l,s)):(this.sendSkippedTelemetry(e,n,"below_threshold",l,r),{triggered:!1,tokenEstimate:l,skipReason:"below_threshold"})}async performCompression(e,r,n,o,s,c){let l=Date.now(),u=String(e.id),d=e.currentPartitionId,f=e.turns.length;try{await this.notifier.notifyCompressionStarted({conversationId:u,partitionId:d,reason:n});let h=await this.compressor.compressCurrentPartition(e,r,o,c),m=Date.now()-l;if(h.success){let g=e.turns[0],A=typeof g?.request?.message=="string"?g.request.message.length:0,y;try{y=this.tokenEstimator.calculateContextSize(this.ctx,e,r)}catch(_){ot.warn(this.ctx,`Failed to calculate context size after compression: ${_ instanceof Error?_.message:String(_)}`)}return await this.notifier.notifyCompressionCompleted({conversationId:u,archivedPartitionId:h.archivedPartitionId,newPartitionId:h.newPartitionId,summaryLength:A,turnCount:f,durationMs:m,contextInfo:y}),this.sendTriggeredTelemetry(e,n,"success",s,h,m,r),{triggered:!0,compressionResult:h,tokenEstimate:s}}else return ot.error(this.ctx,`Automatic compression failed: conversationId=${u}, error=${h.error}`),this.sendTriggeredTelemetry(e,n,"failed",s,h,m,r),{triggered:!0,compressionResult:h,tokenEstimate:s,skipReason:"compression_failed"}}catch(h){let m=Date.now()-l,g=h instanceof Error?h.message:String(h);return ot.exception(this.ctx,h,`Automatic compression exception: conversationId=${u}`),this.sendExceptionTelemetry(e,n,g,s,m,r),{triggered:!0,tokenEstimate:s,skipReason:"compression_failed"}}}sendSkippedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,reason:n,...s?{modelId:s.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount});ft(this.ctx,"automaticCompression.skipped",c,0)}sendTriggeredTelemetry(e,r,n,o,s,c,l){let u=Vt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,outcome:n,archivedPartitionId:String(s.archivedPartitionId),newPartitionId:String(s.newPartitionId),...s.error&&{error:s.error},...l?{modelId:l.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount,durationMs:c});ft(this.ctx,"automaticCompression.triggered",u,0)}sendExceptionTelemetry(e,r,n,o,s,c){let l=Vt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,outcome:"exception",error:n,...c?{modelId:c.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount,durationMs:s});ft(this.ctx,"automaticCompression.triggered",l,0)}};p();var zA=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var ef=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var Ett=fe(tue());var TDn=new Map;function P_(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(P_,"createNumberRange");function Fzt(t){return[...t].sort((e,r)=>r.length-e.length)}a(Fzt,"sortByStringLengthDesc");async function xcs(t){let e=TDn.get(t);if(e)return e;let r=(async()=>{try{let n=await bWe(`tree-sitter-${t}.wasm`);return await Ett.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return TDn.set(t,r),r}a(xcs,"loadShellLanguage");function IDn(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(IDn,"isPowerShell");var wcs=new Map([["sh",Fzt([...P_(1,9).concat("").map(t=>`${t}<<<`),...P_(1,9).concat("").flatMap(t=>P_(1,9).map(e=>`${t}>&${e}`)),...P_(1,9).concat("").map(t=>`${t}<>`),...P_(1,9).concat("&","").map(t=>`${t}>>`),...P_(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",Fzt([...P_(1,9).concat("").map(t=>`${t}<<<`),...P_(1,9).concat("").flatMap(t=>P_(1,9).map(e=>`${t}>&${e}`)),...P_(1,9).concat("").map(t=>`${t}<>`),...P_(1,9).concat("&","").map(t=>`${t}>>`),...P_(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",Fzt([...P_(1,6).concat("*","").flatMap(t=>P_(1,6).map(e=>`${t}>&${e}`)),...P_(1,6).concat("*","").map(t=>`${t}>>`),...P_(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function Rcs(t,e){let r,n=e.replace(/\.exe$/,"");IDn(e)?r="pwsh":r=(n.split(/[/\\]/).pop()||"")==="zsh"?"zsh":"sh";let o=[t],s=wcs.get(r);if(s)for(let c of s)for(let l=0;ld.trim())),l--)}return o.filter(c=>c.trim().length>0)}a(Rcs,"splitCommandLineIntoSubCommands");async function vtt(t,e){try{let r;IDn(e)?r="powershell":r="bash",await Ett.default.init();let n,o;try{n=new Ett.default;let s=await xcs(r);return n.setLanguage(s),o=n.parse(t),s.query("(command) @command").captures(o.rootNode).map(u=>u.node.text.trim()).filter(u=>u.length>0)}finally{o?.delete(),n?.delete()}}catch{return Rcs(t,e)}}a(vtt,"extractSubCommandsWithTreeSitter");var kcs=new Set(["sudo","env"]),Pcs=/^[A-Za-z_][A-Za-z0-9_]*=/;function Uzt(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(Pcs.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||kcs.has(r.toLowerCase()))continue;let n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\")),o=n>=0?r.substring(n+1):r;return o.length>0?o:void 0}}a(Uzt,"extractCommandNameFromSubCommand");var Kde=new pe("CommandLineAutoApprover"),xDn=/(?!.*)/,Dcs=/^[A-Z_][A-Z0-9_]*=/i,wT=class{constructor(e){this.ctx=e;this._denyListRules=[];this._allowListRules=[]}static{a(this,"CommandLineAutoApprover")}updateConfiguration(e){let{denyListRules:r,allowListRules:n}=this._mapAutoApproveConfigToRules(e);this._allowListRules=n,this._denyListRules=r}isCommandAutoApproved(e){if(Dcs.test(e))return{result:"denied",reason:`Command '${e}' is denied because it contains transient environment variables`};for(let r of this._denyListRules)if(this._commandMatchesRegex(r.regex,e))return{result:"denied",reason:`Command '${e}' is denied by deny list rule: ${r.sourceText}`};for(let r of this._allowListRules)if(this._commandMatchesRegex(r.regex,e))return{result:"approved",reason:`Command '${e}' is approved by allow list rule: ${r.sourceText}`};return{result:"noMatch",reason:`Command '${e}' has no matching auto approve entries`}}async isTerminalCommandApprovalRequired(e,r){let n=await vtt(e,r);Kde.info(this.ctx,`Command '${e}' is split into sub-commands: ${JSON.stringify(n)}`);let o=n.map(l=>this.isCommandAutoApproved(l)),s=o.find(l=>l.result==="denied");if(s)return Kde.info(this.ctx,`Command '${e}' is denied, reason:'${s.reason}'`),s;if(o.every(l=>l.result==="approved")){let l=`Command '${e}' is approved, reason:'${o.map(u=>u.reason).join("; ")}'`;return Kde.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return Kde.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await vtt(e,r),o=[...new Set(n.map(Uzt).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await vtt(e,r),o=n.map(s=>Uzt(s)??"");return{subCommands:n,commandNames:o}}_commandMatchesRegex(e,r){return!!e.test(r)}_mapAutoApproveConfigToRules(e){if(!e||typeof e!="object")return{denyListRules:[],allowListRules:[]};let r=[],n=[];return Object.entries(e).forEach(([o,s])=>{if(typeof s=="boolean"){let c=this._convertAutoApproveEntryToRegex(o);s===!0?n.push({regex:c,sourceText:o}):s===!1&&r.push({regex:c,sourceText:o})}else if(typeof s=="object"&&s!==null){let c=s;if(typeof c.approve=="boolean"){let l=this._convertAutoApproveEntryToRegex(o);c.approve===!0?n.push({regex:l,sourceText:o}):c.approve===!1&&r.push({regex:l,sourceText:o})}}}),Kde.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),Kde.debug(this.ctx,"Update CommandLineAutoApprover allowListRules",n),{denyListRules:r,allowListRules:n}}_convertAutoApproveEntryToRegex(e){let r=e.match(/^\/(?.+)\/(?[dgimsuvy]*)$/),n=r?.groups?.pattern;if(n){let s=r.groups?.flags;s&&(s=s.replaceAll("g",""));try{let c=new RegExp(n,s||void 0);return this._regExpLeadsToEndlessLoop(c)?xDn:c}catch{return xDn}}let o=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return new RegExp(`^${o}\\b`)}_regExpLeadsToEndlessLoop(e){return e.source==="^"||e.source==="^$"||e.source==="$"||e.source==="^\\s*$"?!1:!!(e.exec("")&&e.lastIndex===0)}};p();var Ctt=class{constructor(e){this.cache=new Map;this.inner=e}static{a(this,"SnapshotTextDocumentProvider")}getByUri(e){let r=this.cache.get(e);return r||(r=this.inner.getByUri(e),this.cache.set(e,r)),r}};p();var btt=class{constructor(e){this.ctx=e}static{a(this,"DefaultTextDocumentProvider")}async getByUri(e){return await this.ctx.get(si).getOrReadTextDocument({uri:e})}};p();p();p();p();p();p();var Stt=class{constructor(e,r,n,o,s){this.event=e;this.hook=r;this.exitCode=n;this.stdout=o;this.stderr=s;this.type="command";this.output=Ncs(this.stdout)}static{a(this,"CommandHookResult")}};function Ncs(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(Ncs,"parseOutput");var jzt=require("child_process");var Ttt=new pe("HookExecutor"),Itt=class{constructor(){this.handlers=[new Qzt,new qzt]}static{a(this,"HookExecutor")}async execute(e,r,n,o){if(!e.get(up).isTrusted(r.source)){Ttt.warn(e,`Refusing to execute hook from untrusted workspace folder: ${r.source}`);return}for(let s of this.handlers)if(s.isAcceptable(n))try{return await s.handle(e,r,n,o)}catch(c){Ttt.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}Ttt.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},xtt=class{static{a(this,"CommandHookHandler")}async handle(e,r,n,o){o.cwd=n.cwd??o.cwd??process.cwd();let s=this.spawnProcess(n,o);if(!s.stdout||!s.stderr||!s.stdin)throw new Error("Failed to create child process with stdio pipes");let{stdout:c,stderr:l,stdin:u}=s,d="",f="",h=10*1024*1024;c.on("data",g=>{if(d+=g.toString(),d.length>h)throw s.kill(),new Error("Command output exceeded maximum size")}),l.on("data",g=>{if(f+=g.toString(),f.length>h)throw s.kill(),new Error("Command error output exceeded maximum size")}),u.on("error",g=>{g.code!=="EPIPE"&&Ttt.warn(e,`stdin error: ${g instanceof Error?g.message:String(g)}`)});let m=JSON.stringify(o);return u.write(m),u.end(),new Promise((g,A)=>{let y=n.timeoutSec??30,_=setTimeout(()=>{s.kill("SIGTERM"),A(new Error(`Command timed out after ${y} seconds`))},y*1e3),E=a(()=>{clearTimeout(_)},"cleanup");s.on("error",v=>{E(),A(new Error(`Failed to execute command: ${v.message}`))}),s.on("close",v=>{E(),g(new Stt(r,n,v??0,d,f))})})}buildSpawnOptions(e,r){return{cwd:r.cwd,env:e.env?{...process.env,...e.env}:process.env,stdio:["pipe","pipe","pipe"]}}},Qzt=class extends xtt{static{a(this,"BashCommandHookHandler")}isAcceptable(e){return process.platform!=="win32"&&e.type==="command"&&e.bash!==void 0}spawnProcess(e,r){let n={...this.buildSpawnOptions(e,r),shell:!0};return(0,jzt.spawn)(e.bash,[],n)}},qzt=class extends xtt{static{a(this,"PowerShellCommandHookHandler")}isAcceptable(e){return process.platform==="win32"&&e.type==="command"&&e.powershell!==void 0}spawnProcess(e,r){let n=this.buildSpawnOptions(e,r);return(0,jzt.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var Mcs=new Itt,D_=class{constructor(e,r,n=[]){this.source=e;this.eventType=r;this.hooks=n}static{a(this,"HookEvent")}async fire(e,r){let n=this.hooks.map(async o=>await Mcs.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var uke=class extends D_{static{a(this,"AgentStopEvent")}constructor(e,r=[]){super(e,"agentStop",r)}};p();var GF=class extends D_{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var D2=class extends D_{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var Jde={allow:"allow",deny:"deny",ask:"ask"},N2=class extends D_{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var $F=class extends D_{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var VF=class extends D_{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var M2=class extends D_{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var cZ=class{constructor(e,r,n){this.conversation=e;this.turn=r;this.conversationProgress=n}static{a(this,"HookProgress")}async reportPlanned(e){let r=[];for(let n of e)for(let o of n.hooks)r.push({eventType:n.eventType,source:n.source,status:"planned"});r.length>0&&await this.conversationProgress.report(this.conversation,this.turn,{hookExecutions:r})}async reportResults(e){if(e.length===0)return;let r=e.map(n=>n.type!=="command"?{eventType:n.event.eventType,source:n.event.source,status:"failure"}:{eventType:n.event.eventType,source:n.event.source,status:n.exitCode===0?"success":"failure",result:{exitCode:n.exitCode,stdout:n.stdout,stderr:n.stderr}});await this.conversationProgress.report(this.conversation,this.turn,{hookExecutions:r})}};p();p();function WF(t){try{return!(!kt(t,ze.EnableHooks)||t.get(eu).getPolicyValue("customHook.enabled")===!1)}catch{return!1}}a(WF,"hooksEnabled");var Ocs=".github/hooks/**/*.json",Lcs=[".claude/settings.json",".claude/settings.local.json","~/.claude/settings.json"],wDn="agentHook.execution",Bcs={sessionStart:VF,sessionEnd:$F,agentStop:uke,userPromptSubmitted:M2,preToolUse:N2,postToolUse:D2,errorOccurred:GF},N0=class{constructor(e){this.logger=new pe("HookService");this.gateSubscriptions=[];this.ctx=e;let r=this.ctx.get(QA);this.registrations=[r.register("hook",[Ocs],{metadata:{hookSource:"copilot",providers:["LOCAL","BACKGROUND"]}}),r.register("hook",Lcs,{metadata:{hookSource:"claude",providers:["CLAUDE"]}})],this.subscribeToGateChanges()}static{a(this,"HookService")}dispose(){for(let e of this.registrations)e.dispose();for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}async hook(e,r,n,o,s){if(!this.areHooksEnabled())return[];let c=await this.collect(e,r,o);s&&await s(c),c.length>0&&(ft(e,wDn),sr(e,wDn,{eventType:c[0].eventType,eventCount:c.length.toString(),hookCount:c.reduce((u,d)=>u+d.hooks.length,0).toString()}));let l=c.map(async u=>await u.fire(e,n));return(await Promise.all(l)).flat()}async listHooks(e){return this.areHooksEnabled()?(await this.ctx.get(_0).collect(this.ctx,"hook",e)).filter(n=>{let o=yJ(n.promptPath.metadata);return o==="copilot"?!0:o==="claude"?Object.values(n.parsedPromptFile.hooks).some(s=>(s?.length??0)>0):!1}):[]}areHooksEnabled(){let e=WF(this.ctx);return e||this.logger.debug(this.ctx,"Hooks are disabled by configuration or customHook.enabled policy."),e}subscribeToGateChanges(){try{let e=this.ctx.get(Qo);this.lastEnableHooks=kt(this.ctx,ze.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=kt(this.ctx,ze.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(eu);this.lastCustomHookPolicyEnabled=e.getPolicyValue("customHook.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customHook.enabled");r!==this.lastCustomHookPolicyEnabled&&(this.lastCustomHookPolicyEnabled=r,this.notifyHookListChanged())}))}catch{}}notifyHookListChanged(){try{this.ctx.get(Eg).notify("hook").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(hook) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(hook) failed:",e)}}async collect(e,r,n){let o=Object.entries(Bcs).find(([,l])=>l===r)?.[0];if(!o)return this.logger.warn(this.ctx,`Unknown hook event constructor: ${r.name}`),[];let s=await this.ctx.get(_0).collect(e,"hook",[n]),c=[];for(let l of s){if(yJ(l.promptPath.metadata)!=="copilot")continue;let u=l.parsedPromptFile,d=u.hooks[o];d!==void 0&&c.push(new r(u.uri,[...d]))}return c}};p();function YA(t){return`[${ro(t)}](${t})`}a(YA,"formatUriForFileWidget");function md(t,e){let r=Fcs(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(md,"resolvePathInput");function Fcs(t,e){let r=e?.resolveFromCache(t);if(r)return r;let n=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):\/\//);if(n){let s=n[1].toLowerCase();return qz.has(s)||ga.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(ga.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||RDn()&&Qcs(t)||RDn()&&t.startsWith("\\\\"))return Ko(t)}a(Fcs,"resolveFsUri");function RDn(){return process.platform==="win32"}a(RDn,"isWindows");function Ucs(t){return t>=65&&t<=90||t>=97&&t<=122}a(Ucs,"isWindowsDriveLetter");function Qcs(t){return Ucs(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(Qcs,"hasDriveLetter");function I5(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof Lr?r.value:r instanceof EJ?"":r instanceof Mq?JSON.stringify(r.value):"").join(` +`)),e===""?"(empty)":e}a(I5,"parseToolResultToString");function wtt(t){let{content:e}=t;return{message:I5(e)}}a(wtt,"formatToolErrorResult");function kDn(t){let{content:e}=t,r={data:e.map(n=>n instanceof Lr?{type:"text",value:n.value}:n instanceof EJ?{type:"text",value:""}:n instanceof Mq?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof Oq&&(t.toolResultMessage!==void 0&&(r.toolResultMessage=t.toolResultMessage),t.toolResultDetails!==void 0&&(r.toolResultDetails=t.toolResultDetails),t.toolSpecificData!==void 0&&(r.toolSpecificData=t.toolSpecificData)),r}a(kDn,"formatToolSuccessResult");function lZ(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(lZ,"extractShellFromToolDescription");var Rtt=new pe("HookTrigger"),Zde=class{constructor(e,r,n){this.ctx=e;this.conversation=r;this.workspaceFolders=n}static{a(this,"HookTrigger")}async firePreToolUseHook(e,r,n,o){try{let s=this.ctx.get(N0),c=o?new cZ(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,N2,{timestamp:Date.now(),cwd:un(u.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r)},u,c?async f=>{u===this.workspaceFolders[0]&&await c.reportPlanned(f)}:void 0);l.push(...d)}return c&&await c.reportResults(l),this.checkPreToolUseHookResults(l)}catch(s){return Rtt.error(this.ctx,`Failed to execute PreToolUse hook for tool ${e.name}`,s),{denied:!1}}}async firePostToolUseHook(e,r,n,o,s){try{let c=this.ctx.get(N0),l=s?new cZ(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,D2,{timestamp:Date.now(),cwd:un(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:I5(n.content)}},d,l?async h=>{d===this.workspaceFolders[0]&&await l.reportPlanned(h)}:void 0);u.push(...f)}l&&await l.reportResults(u)}catch(c){Rtt.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(N0),o=this.extractPromptFromMessage(e),s=r?new cZ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,M2,{timestamp:Date.now(),cwd:un(l.uri),prompt:o},l,s?async d=>{l===this.workspaceFolders[0]&&await s.reportPlanned(d)}:void 0);c.push(...u)}s&&await s.reportResults(c)}catch(n){Rtt.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(N0),o=kt(this.ctx,ze.HookErrorOccurredStackTrace),s=r?new cZ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,GF,{timestamp:Date.now(),cwd:un(l.uri),error:{message:e.message,name:e.name,stack:o?e.stack:void 0}},l,s?async d=>{l===this.workspaceFolders[0]&&await s.reportPlanned(d)}:void 0);c.push(...u)}s&&await s.reportResults(c)}catch(n){Rtt.error(this.ctx,"Failed to execute ErrorOccurred hook",n)}}extractPromptFromMessage(e){return typeof e=="string"?e:Array.isArray(e)?e.map(r=>typeof r=="string"?r:typeof r=="object"&&r!==null&&"content"in r&&typeof r.content=="string"?r.content:typeof r=="object"&&r!==null&&"text"in r&&typeof r.text=="string"?r.text:"").filter(Boolean).join(" "):""}checkPreToolUseHookResults(e){for(let r of e){let n=r.output;if(n&&n.permissionDecision===Jde.deny)return{denied:!0,reason:n.permissionDecisionReason||"Tool execution denied by hook"}}return{denied:!1}}toToolResultType(e){switch(e){case"success":return"success";case"error":return"failure";case"cancelled":return"denied";default:return"failure"}}};p();p();var Hzt=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},dke=class extends Hzt{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var uZ=fe(wo());var Wn=class t extends uZ.PromptElement{static{a(this,"Tag")}static{this._regex=/^[a-zA-Z_][\w.-]*$/}render(){let{name:e,children:r,attrs:n={}}=this.props;if(!t._regex.test(e))throw new Error(`Invalid tag name: ${this.props.name}. Tag names must start with a letter or underscore, and can contain letters, digits, underscores, hyphens, or periods.`);let o="";for(let[c,l]of Object.entries(n))l!==void 0&&(o+=` ${c}=${JSON.stringify(l)}`);if(r?.length===0)return o?vscpp(uZ.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,uZ.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> +`)),vscpp(Gzt,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},Gzt=class extends uZ.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function PDn(){return vscpp(Wn,{name:"modeInstructions"},'You are currently running in "Ask" mode. Below are your instructions for this mode, they must take precedence over any instructions above.',vscpp("br",null),vscpp("br",null),"You are an ASK AGENT \u2014 a knowledgeable assistant that answers questions, explains code, and provides information.",vscpp("br",null),vscpp("br",null),"You are strictly read-only: NEVER modify files or run commands that change state.",vscpp("br",null),vscpp("br",null),vscpp(Wn,{name:"rules"},"- NEVER use file editing tools, terminal commands that modify state, or any write operations",vscpp("br",null),"- Focus on answering questions, explaining concepts, and providing information",vscpp("br",null),"- Use search and read tools to gather context from the codebase when needed",vscpp("br",null),"- Provide code examples in your responses when helpful, but do NOT apply them",vscpp("br",null),"- When the user's question is about code, reference specific files and symbols",vscpp("br",null),"- If a question would require making changes, explain what changes would be needed but do NOT make them",vscpp("br",null),"- SKIP a plan when: The task is simple and direct. Breaking it down would only produce literal or trivial steps.",vscpp("br",null),"- Keep your response focused and proportional to the question. Don't over-explain simple concepts unless the user asks for more detail."),vscpp("br",null),vscpp(Wn,{name:"capabilities"},"You can help with:",vscpp("br",null),"- **Code explanation**: How does this code work? What does this function do?",vscpp("br",null),"- **Architecture questions**: How is the project structured? How do components interact?",vscpp("br",null),"- **Debugging guidance**: Why might this error occur? What could cause this behavior?",vscpp("br",null),"- **Best practices**: What's the recommended approach for X? How should I structure Y?",vscpp("br",null),"- **API and library questions**: How do I use this API? What does this method expect?",vscpp("br",null),"- **Codebase navigation**: Where is X defined? Where is Y used?",vscpp("br",null),"- **General programming**: Language features, algorithms, design patterns, etc."),vscpp("br",null),vscpp(Wn,{name:"workflow"},"1. **Understand** the question \u2014 identify what the user needs to know",vscpp("br",null),"2. **Research** the codebase if needed \u2014 use search and read tools to find relevant code",vscpp("br",null),"3. **Answer** clearly \u2014 provide a well-structured response with references to relevant code"))}a(PDn,"renderAskModeInstructionBody");p();p();var Ij=class extends fr{static{a(this,"UserOSPrompt")}renderCopilot(e,r,n,o){let s=process.platform;return vscpp(vscppf,null,"The user's current OS is: ",s==="win32"?"Windows":s==="darwin"?"macOS":s==="linux"?"Linux":"Unknown")}};p();var ktt=class extends fr{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var DDn=require("path");var Ptt=class extends fr{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,DDn.basename)(s),l=c==="powershell.exe"?" (Windows PowerShell v5.1)":"",u="";return c==="powershell.exe"&&(u=" Use the `;` character if joining commands on a single line is needed."),vscpp(vscppf,null,`The user's default shell is: "`,c,'"',l,". When you generate terminal commands, please generate them correctly for this shell.",u)}getUserShell(){let n=this.props.ctx.get(vs).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=lZ(n.description);if(o)return o}if(process.env.SHELL)return process.env.SHELL;switch(process.platform){case"win32":return process.env.ComSpec||"cmd.exe";case"darwin":case"linux":return"/bin/bash";default:return"sh"}}};p();var xj=class extends fr{static{a(this,"WorkspaceFoldersHint")}renderCopilot(e,r,n,o){if(this.props.workspaceFolders&&this.props.workspaceFolders.length>0){let s=this.props.workspaceFolders.map(c=>{let l=oo(c.uri);return` - ${ga.isRegisteredScheme(l.scheme)?c.uri:ys(c.uri)}`}).join(` +`);return vscpp(vscppf,null,"I am working in a workspace with the following folders:",vscpp("br",null),s)}else return vscpp(vscppf,null,"There is no workspace currently open.")}};p();p();p();function NDn(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(NDn,"partsLength");async function ODn(t,e=1/0,r){let n=MDn(0,t,e),o=e-NDn(n);for(;;){let s=!1,c=[];for(let l of n)if(l.type==="text")c.push(l);else if(l.type==="dir"){c.push({type:"text",uri:l.uri,value:l.value});let u=await l.getChildren();if(r?.isCancellationRequested)return qcs();let d=MDn(l.level+1,u,o-1);d.length&&(s=!0,o-=NDn(d)+1,c.push(...d))}if(n=c,!s)break}return{files:n.map(s=>s.uri).filter(s=>s!==void 0),tree:n.map(s=>s.value).join(` +`)}}a(ODn,"visualFileTree");function MDn(t,e,r){let n=" ".repeat(t),o=[],s=r;for(let c=0;cs){let d=n+"...";for(;d.length>s&&o.length>0;)s+=o.pop().value.length+1;d.length<=s&&o.push({type:"text",uri:void 0,value:d});break}l.type===2?o.push({type:"dir",uri:l.uri,level:t,value:u,getChildren:l.getChildren}):o.push({type:"text",uri:l.uri,value:u}),s-=u.length,c!==e.length-1&&(s-=1)}return o}a(MDn,"toParts");var qcs=a(()=>({tree:"",files:[]}),"emptyTree");p();async function Dtt(t,e){let r=oo(e);return ga.isRegisteredScheme(r.scheme)?(await t.get(ga).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get(Go).readDirectory(e)}a(Dtt,"readDirectory");var jcs=new pe("fileReferencesPrompt");async function LDn(t,e,r,n){let o=await BDn(t,e,r,n);if(!o.length)return"";let s="";for(let{label:l,uri:u,tree:d}of o){let f=oo(u),h=ga.isRegisteredScheme(f.scheme)?u:un(u);s+=`${l} (Absolute Path: ${h})/ `;for(let m of d.tree.split(` `))s+=` ${m} `}let c=GA(s);return["I am working in a workspace that has the following structure:",c,s,c,"This view of the workspace structure may be truncated. You can use tools to collect more context if needed."].join(` -`)}a(ODn,"generateWorkspaceStructurePrompt");async function LDn(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await MDn(await BDn(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(LDn,"generateWorkspaceStructure");async function BDn(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await Dtt(t,e)}catch{return[]}return n.isCancellationRequested?[]:(o.sort((s,c)=>s[1]===c[1]?s[0].localeCompare(c[0]):s[1]&2?1:-1),Promise.all(o.map(([s,c])=>{let l=Oa(e,s);return!ga.isRegisteredScheme(oo(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||Hcs(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>BDn(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(BDn,"buildFileList");var qcs=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],jcs=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function Hcs(t){return!!(jcs.includes(ro(t).toLowerCase())||ys(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>qcs.includes(r)))}a(Hcs,"shouldAlwaysIgnoreFile");async function Ntt(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:ro(c.uri)})),o=await LDn(t,n,{maxLength:2e3,excludeDotFiles:!0},e),s=[];for(let{label:c,uri:l,tree:u}of o)s.push(""),s.push(`Directory: ${c} (${un(l)})`),s.push(u.tree),s.push("");return s}catch(n){return Qcs.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(Ntt,"processDirectoryReferences");var Zde=class extends fr{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await ODn(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||jn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var FDn=fe(wo());var fke=class extends fr{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(FDn.UserMessage,null,vscpp(Wn,{name:"environment_info"},vscpp(Ij,{ctx:this.props.ctx}),vscpp(Ptt,{ctx:this.props.ctx})),vscpp(Wn,{name:"workspace_info"},vscpp(xj,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(Zde,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(ktt,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var Mtt=fe(require("path"));function $zt(t){let e=kt(t,ze.EnableSkills),r=t.get(eu).getPolicyValue("customSkill.enabled")!==!1;return e&&r}a($zt,"isSkillsEnabled");var Gzt=class{constructor(e){this.promptFileEntry=e}static{a(this,"CustomSkill")}get id(){return this.promptFileEntry.promptPath.uri}get uri(){return this.promptFileEntry.promptPath.uri}get name(){return this.promptFileEntry.parsedPromptFile.header?.name||ro(Cf(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}get pluginUri(){return Dq(this.promptFileEntry.promptPath)}get providers(){return c2(this.promptFileEntry.promptPath.metadata)}},Ig=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.registrySkillPatterns=[];this.skillFileLocationsPatterns=[];this.logger=new pe("CustomSkillService");this._onDidChangeSkillsEnabled=new Lc;this.onDidChangeSkillsEnabled=this._onDidChangeSkillsEnabled.event;this.gateSubscriptions=[];this.lastSkillsEnabled=!1;this.syncRegistry(),this.configProvider.onDidChangeCopilotSettings(this.skipIfSkillsEnabledUnchanged(()=>{this.syncRegistry(),this.fireSkillsEnabledIfChanged()})),this.subscribeToGateChanges(),this.lastSkillsEnabled=this.isSkillsEnabled()}static{a(this,"CustomSkillService")}static{this.WORKSPACE_AGENTS_SKILLS=".agents/skills/**/SKILL.md"}static{this.WORKSPACE_GITHUB_SKILLS=".github/skills/**/SKILL.md"}static{this.GLOBAL_AGENTS_SKILLS="~/.agents/skills/**/SKILL.md"}static{this.GLOBAL_COPILOT_SKILLS="~/.copilot/skills/**/SKILL.md"}static{this.CLAUDE_SKILL_PATTERNS=[".claude/skills/**/SKILL.md","~/.claude/skills/**/SKILL.md"]}static{this.SKILL_PATTERNS_BY_PROVIDER={LOCAL:[t.WORKSPACE_AGENTS_SKILLS,t.WORKSPACE_GITHUB_SKILLS,t.GLOBAL_AGENTS_SKILLS,t.GLOBAL_COPILOT_SKILLS,...t.CLAUDE_SKILL_PATTERNS],BACKGROUND:[t.WORKSPACE_AGENTS_SKILLS,t.WORKSPACE_GITHUB_SKILLS,t.GLOBAL_AGENTS_SKILLS,t.GLOBAL_COPILOT_SKILLS,...t.CLAUDE_SKILL_PATTERNS],CLAUDE:t.CLAUDE_SKILL_PATTERNS,CODEX:[t.WORKSPACE_AGENTS_SKILLS,t.GLOBAL_AGENTS_SKILLS]}}static{this.SKILL_GLOB_SUFFIX="**/SKILL.md"}fireSkillsEnabledIfChanged(){let e=this.isSkillsEnabled();e!==this.lastSkillsEnabled&&(this.lastSkillsEnabled=e,this._onDidChangeSkillsEnabled.fire(e))}subscribeToGateChanges(){try{let e=this.ctx.get(eu);this.lastCustomSkillPolicyEnabled=e.getPolicyValue("customSkill.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customSkill.enabled");r!==this.lastCustomSkillPolicyEnabled&&(this.lastCustomSkillPolicyEnabled=r,this.notifySkillListChanged(),this.fireSkillsEnabledIfChanged())}))}catch{}}notifySkillListChanged(){try{this.ctx.get(_g).notify("skill").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(skill) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(skill) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0,this.disposeSkillPatterns(),this._onDidChangeSkillsEnabled.dispose()}disposeSkillPatterns(){for(let e of this.registrySkillPatterns)try{e.dispose()}catch{}this.registrySkillPatterns=[]}skipIfSkillsEnabledUnchanged(e){let r=kt(this.ctx,ze.EnableSkills);return()=>{let n=kt(this.ctx,ze.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){return $zt(this.ctx)}syncRegistry(){if(this.disposeSkillPatterns(),!kt(this.ctx,ze.EnableSkills))return;let e=new Map;for(let r of Object.keys(t.SKILL_PATTERNS_BY_PROVIDER))for(let n of t.SKILL_PATTERNS_BY_PROVIDER[r]){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(r)}for(let[r,n]of e)this.registrySkillPatterns.push(this.promptFileLocationRegistry.register("skill",[r],{metadata:{providers:[...n]}}));this.skillFileLocationsPatterns.length>0&&this.registrySkillPatterns.push(this.promptFileLocationRegistry.register("skill",[...this.skillFileLocationsPatterns],{metadata:{providers:["LOCAL","BACKGROUND"]}}))}setSkillFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(un(n.uri)):n.type==="location"&&r.add(Mtt.default.posix.join(n.path,t.SKILL_GLOB_SUFFIX));this.skillFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listSkills(e,r){return this.isSkillsEnabled()?(await this.ctx.get(y0).collect(this.ctx,"skill",e,{includePlugins:r?.includePlugins})).map(s=>new Gzt(s)):[]}getSkillDirectories(e){if(!this.isSkillsEnabled())return[];let r=this.promptFileLocationRegistry.resolvePatterns("skill",[e]),n=new Set;for(let{pattern:o}of r){let s=t.extractDirectoryFromResolvedPattern(o);s&&n.add(s)}return Array.from(n)}static extractDirectoryFromResolvedPattern(e){let r=e;if(r.endsWith(t.SKILL_GLOB_SUFFIX)?(r=r.slice(0,-t.SKILL_GLOB_SUFFIX.length),r.endsWith("/")&&(r=r.slice(0,-1))):r.endsWith("SKILL.md")&&(r=Mtt.default.dirname(r)),!!r)return Mtt.default.normalize(r)}};var Ott=class extends fr{static{a(this,"SkillListPrompt")}async renderCopilot(){if(this.props.turnContext.cachedSkillListPrompt!==void 0)return this.props.turnContext.cachedSkillListPrompt??vscpp(vscppf,null);let e=this.props.workspaceFolders?this.props.workspaceFolders.map(c=>({uri:c.uri})):[];if(e.length===0)return this.props.turnContext.cachedSkillListPrompt=null,vscpp(vscppf,null);let n=await this.props.turnContext.ctx.get(Ig).listSkills(e);if($c(this.props.turnContext.ctx,"skills.list_in_prompt",void 0,{count:n.length}),n.length===0)return this.props.turnContext.cachedSkillListPrompt=null,vscpp(vscppf,null);let o=n.map(c=>` +`)}a(LDn,"generateWorkspaceStructurePrompt");async function BDn(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await ODn(await FDn(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(BDn,"generateWorkspaceStructure");async function FDn(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await Dtt(t,e)}catch{return[]}return n.isCancellationRequested?[]:(o.sort((s,c)=>s[1]===c[1]?s[0].localeCompare(c[0]):s[1]&2?1:-1),Promise.all(o.map(([s,c])=>{let l=Oa(e,s);return!ga.isRegisteredScheme(oo(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||$cs(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>FDn(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(FDn,"buildFileList");var Hcs=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],Gcs=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function $cs(t){return!!(Gcs.includes(ro(t).toLowerCase())||ys(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>Hcs.includes(r)))}a($cs,"shouldAlwaysIgnoreFile");async function Ntt(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:ro(c.uri)})),o=await BDn(t,n,{maxLength:2e3,excludeDotFiles:!0},e),s=[];for(let{label:c,uri:l,tree:u}of o)s.push(""),s.push(`Directory: ${c} (${un(l)})`),s.push(u.tree),s.push("");return s}catch(n){return jcs.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(Ntt,"processDirectoryReferences");var Xde=class extends fr{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await LDn(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||jn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var UDn=fe(wo());var fke=class extends fr{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(UDn.UserMessage,null,vscpp(Wn,{name:"environment_info"},vscpp(Ij,{ctx:this.props.ctx}),vscpp(Ptt,{ctx:this.props.ctx})),vscpp(Wn,{name:"workspace_info"},vscpp(xj,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(Xde,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(ktt,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var Mtt=fe(require("path"));function Vzt(t){let e=kt(t,ze.EnableSkills),r=t.get(eu).getPolicyValue("customSkill.enabled")!==!1;return e&&r}a(Vzt,"isSkillsEnabled");var $zt=class{constructor(e){this.promptFileEntry=e}static{a(this,"CustomSkill")}get id(){return this.promptFileEntry.promptPath.uri}get uri(){return this.promptFileEntry.promptPath.uri}get name(){return this.promptFileEntry.parsedPromptFile.header?.name||ro(Cf(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}get pluginUri(){return Dq(this.promptFileEntry.promptPath)}get providers(){return c2(this.promptFileEntry.promptPath.metadata)}},xg=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.registrySkillPatterns=[];this.skillFileLocationsPatterns=[];this.logger=new pe("CustomSkillService");this._onDidChangeSkillsEnabled=new Lc;this.onDidChangeSkillsEnabled=this._onDidChangeSkillsEnabled.event;this.gateSubscriptions=[];this.lastSkillsEnabled=!1;this.syncRegistry(),this.configProvider.onDidChangeCopilotSettings(this.skipIfSkillsEnabledUnchanged(()=>{this.syncRegistry(),this.fireSkillsEnabledIfChanged()})),this.subscribeToGateChanges(),this.lastSkillsEnabled=this.isSkillsEnabled()}static{a(this,"CustomSkillService")}static{this.WORKSPACE_AGENTS_SKILLS=".agents/skills/**/SKILL.md"}static{this.WORKSPACE_GITHUB_SKILLS=".github/skills/**/SKILL.md"}static{this.GLOBAL_AGENTS_SKILLS="~/.agents/skills/**/SKILL.md"}static{this.GLOBAL_COPILOT_SKILLS="~/.copilot/skills/**/SKILL.md"}static{this.CLAUDE_SKILL_PATTERNS=[".claude/skills/**/SKILL.md","~/.claude/skills/**/SKILL.md"]}static{this.SKILL_PATTERNS_BY_PROVIDER={LOCAL:[t.WORKSPACE_AGENTS_SKILLS,t.WORKSPACE_GITHUB_SKILLS,t.GLOBAL_AGENTS_SKILLS,t.GLOBAL_COPILOT_SKILLS,...t.CLAUDE_SKILL_PATTERNS],BACKGROUND:[t.WORKSPACE_AGENTS_SKILLS,t.WORKSPACE_GITHUB_SKILLS,t.GLOBAL_AGENTS_SKILLS,t.GLOBAL_COPILOT_SKILLS,...t.CLAUDE_SKILL_PATTERNS],CLAUDE:t.CLAUDE_SKILL_PATTERNS,CODEX:[t.WORKSPACE_AGENTS_SKILLS,t.GLOBAL_AGENTS_SKILLS]}}static{this.SKILL_GLOB_SUFFIX="**/SKILL.md"}fireSkillsEnabledIfChanged(){let e=this.isSkillsEnabled();e!==this.lastSkillsEnabled&&(this.lastSkillsEnabled=e,this._onDidChangeSkillsEnabled.fire(e))}subscribeToGateChanges(){try{let e=this.ctx.get(eu);this.lastCustomSkillPolicyEnabled=e.getPolicyValue("customSkill.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customSkill.enabled");r!==this.lastCustomSkillPolicyEnabled&&(this.lastCustomSkillPolicyEnabled=r,this.notifySkillListChanged(),this.fireSkillsEnabledIfChanged())}))}catch{}}notifySkillListChanged(){try{this.ctx.get(Eg).notify("skill").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(skill) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(skill) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0,this.disposeSkillPatterns(),this._onDidChangeSkillsEnabled.dispose()}disposeSkillPatterns(){for(let e of this.registrySkillPatterns)try{e.dispose()}catch{}this.registrySkillPatterns=[]}skipIfSkillsEnabledUnchanged(e){let r=kt(this.ctx,ze.EnableSkills);return()=>{let n=kt(this.ctx,ze.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){return Vzt(this.ctx)}syncRegistry(){if(this.disposeSkillPatterns(),!kt(this.ctx,ze.EnableSkills))return;let e=new Map;for(let r of Object.keys(t.SKILL_PATTERNS_BY_PROVIDER))for(let n of t.SKILL_PATTERNS_BY_PROVIDER[r]){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(r)}for(let[r,n]of e)this.registrySkillPatterns.push(this.promptFileLocationRegistry.register("skill",[r],{metadata:{providers:[...n]}}));this.skillFileLocationsPatterns.length>0&&this.registrySkillPatterns.push(this.promptFileLocationRegistry.register("skill",[...this.skillFileLocationsPatterns],{metadata:{providers:["LOCAL","BACKGROUND"]}}))}setSkillFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(un(n.uri)):n.type==="location"&&r.add(Mtt.default.posix.join(n.path,t.SKILL_GLOB_SUFFIX));this.skillFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listSkills(e,r){return this.isSkillsEnabled()?(await this.ctx.get(_0).collect(this.ctx,"skill",e,{includePlugins:r?.includePlugins})).map(s=>new $zt(s)):[]}getSkillDirectories(e){if(!this.isSkillsEnabled())return[];let r=this.promptFileLocationRegistry.resolvePatterns("skill",[e]),n=new Set;for(let{pattern:o}of r){let s=t.extractDirectoryFromResolvedPattern(o);s&&n.add(s)}return Array.from(n)}static extractDirectoryFromResolvedPattern(e){let r=e;if(r.endsWith(t.SKILL_GLOB_SUFFIX)?(r=r.slice(0,-t.SKILL_GLOB_SUFFIX.length),r.endsWith("/")&&(r=r.slice(0,-1))):r.endsWith("SKILL.md")&&(r=Mtt.default.dirname(r)),!!r)return Mtt.default.normalize(r)}};var Ott=class extends fr{static{a(this,"SkillListPrompt")}async renderCopilot(){if(this.props.turnContext.cachedSkillListPrompt!==void 0)return this.props.turnContext.cachedSkillListPrompt??vscpp(vscppf,null);let e=this.props.workspaceFolders?this.props.workspaceFolders.map(c=>({uri:c.uri})):[];if(e.length===0)return this.props.turnContext.cachedSkillListPrompt=null,vscpp(vscppf,null);let n=await this.props.turnContext.ctx.get(xg).listSkills(e);if($c(this.props.turnContext.ctx,"skills.list_in_prompt",void 0,{count:n.length}),n.length===0)return this.props.turnContext.cachedSkillListPrompt=null,vscpp(vscppf,null);let o=n.map(c=>` ${c.name} ${c.description??""} ${c.uri} - `).join(""),s=vscpp(vscppf,null,vscpp(Wn,{name:"skills"},"Here is a list of skills that contain domain specific knowledge on a variety of topics. Each skill comes with a description of the topic and a file path that contains the detailed instructions. When a user asks you to perform a task that falls within the domain of a skill, use the 'read_file' tool to acquire the full instructions from the file URI.",o));return this.props.turnContext.cachedSkillListPrompt=s,s}};p();p();var UDn={id:"builtin:search",name:"Search",description:"Launch an autonomous search agent to find relevant code in the workspace. The search agent can use grep search, file search, and read files to locate code. Use this when you need to find code but aren't sure exactly where to look.",invokePolicy:["model"],isReadonly:!0,isBuiltIn:!0},Xde=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await HWe(e.ctx)&&r.set(UDn.name,UDn);let o=await e.ctx.get(Yd).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&&sr(e.ctx,"customAgent.shadowsBuiltIn",{builtInAgentName:s.name}),r.set(s.name,s);return r}async getAgentsForModelDispatch(e){let r=await this.getAgents(e),n=new Map;for(let[o,s]of r)s.invokePolicy.includes("model")&&n.set(o,s);return n}async getAgent(e,r){return(await this.getAgents(e)).get(r)}};p();var Gcs=new Map([["run_in_terminal","terminal"],["insert_edit_into_file","file_write"],["create_file","file_write"],["replace_string_in_file","file_write"],["apply_patch","file_write"],["read_file","file_read"],["list_dir","file_read"],["semantic_search","safe_tool"],["get_errors","safe_tool"],["file_search","safe_tool"],["grep_search","safe_tool"],["update_user_preferences","safe_tool"],["run_subagent","safe_tool"],["validate_cves","safe_tool"],["manage_todo_list","safe_tool"]]);function QDn(t){return Gcs.get(t)??"unknown"}a(QDn,"getToolFunctionalType");var $cs=new Map([["copilot_semanticSearch","semantic_search"],["copilot_readFile","read_file"],["copilot_listDir","list_dir"],["copilot_getErrors","get_errors"],["copilot_runInTerminal","run_in_terminal"],["copilot_insertEdit","insert_edit_into_file"],["copilot_createFile","create_file"],["copilot_replaceString","replace_string_in_file"],["copilot_applyPatch","apply_patch"],["copilot_updateUserPreferences","update_user_preferences"],["copilot_fileSearch","file_search"],["copilot_findTextInFiles","grep_search"],["copilot_runSubagent","run_subagent"],["copilot_validateCves","validate_cves"],["copilot_manageTodoList","manage_todo_list"]]),Vcs=new Map;for(let[t,e]of $cs)Vcs.set(e,t);var qDn=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),jDn=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var Ltt=class extends fr{static{a(this,"SubagentListPrompt")}async renderCopilot(){if(this.props.turnContext.cachedSubagentListPrompt!==void 0)return this.props.turnContext.cachedSubagentListPrompt??vscpp(vscppf,null);let r=await new Xde().getAgentsForModelDispatch(this.props.turnContext);if(r.size===0)return this.props.turnContext.cachedSubagentListPrompt=null,vscpp(vscppf,null);let n=Array.from(r.entries()).map(([s,c])=>`- **${c.name}**: ${c.description}`).join(` -`),o=vscpp(vscppf,null,vscpp(Wn,{name:"subagent-instructions"},"You should ALWAYS use the `","run_subagent","` tool to delegate tasks to specialized agents when the task you are working on matches the agent's description.",vscpp("br",null),"Available Agents:",vscpp("br",null),n,vscpp("br",null),"IMPORTANT: The `agentName` parameter MUST be one of the exact agent names listed above. Do NOT use any other name."));return this.props.turnContext.cachedSubagentListPrompt=o,o}};p();p();p();var efe=class extends fr{static{a(this,"AskModeKeepGoingReminder")}renderCopilot(){return vscpp(vscppf,null,"You are an agent \u2014 keep going until the user's query is completely resolved before ending your turn. ONLY stop if solved or genuinely blocked.",vscpp("br",null),"Avoid repetition across turns: don't restate unchanged context or plans verbatim; provide only what changed.",vscpp("br",null))}};p();var Wcs=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],x5=class extends fr{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&&Wcs.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var HDn=fe(wo());var Btt=class extends fr{static{a(this,"AskAgentPrompt")}renderCopilot(){let e=a(s=>this.props.tools.some(c=>c.name===s),"hasTool"),r=e("semantic_search"),n=e("read_file"),o=e("run_in_terminal");return vscpp(HDn.SystemMessage,null,vscpp(Wn,{name:"instructions"},"You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.",vscpp("br",null),"The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.",vscpp("br",null),"If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when answering questions.",vscpp("br",null),vscpp(efe,null)),vscpp(Wn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","read_file",` tool, say "I'll read the file".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",r&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"but do not parallelize dependent steps.",vscpp("br",null),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),!o&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(Wn,{name:"contextGathering"},r&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then answer the question. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"Unless it is clear that the user's question relates to the current workspace, you should avoid using search tools and instead prefer to answer the user's question directly.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(Wn,{name:"codesearchModeInstructions"},"These instructions apply when answering questions about the user's codebase.",vscpp("br",null),"First, analyze the user's request to determine how complicated their task is. Leverage any of the tools available to you to gather the context needed to provide a complete and accurate response. Keep your search focused on the user's request, and don't run extra tools if the user's request clearly can be satisfied by just one.",vscpp("br",null),"Think step by step:",vscpp("br",null),"1. Read the provided relevant workspace information (code excerpts, file names, and symbols) to understand the user's workspace.",vscpp("br",null),"2. Consider how to answer the user's prompt based on the provided information and your specialized coding knowledge. Always assume that the user is asking about the code in their workspace instead of asking a general programming question.",vscpp("br",null),"3. Generate a response that clearly and accurately answers the user's question. In your response, add fully qualified links for referenced symbols and links for files so that the user can open them.",vscpp("br",null),"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can print a codeblock with the suggested changes."),vscpp(Wn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),e("manage_todo_list")&&vscpp(Wn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex research into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple questions or conversational requests."),vscpp(x5,{languageOverride:this.props.languageOverride}))}};p();var GDn=fe(wo());var Ftt=class extends fr{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp(GDn.SystemMessage,null,"You are a coding agent based on GPT-5-Codex.",vscpp("br",null),vscpp("br",null),"## Editing constraints",vscpp("br",null),vscpp("br",null),"- Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.",vscpp("br",null),'- Add succinct code comments that explain what is going on if code is not self-explanatory. You should not add comments like "Assigns the value to the variable", but a brief comment might be useful ahead of a complex code block that the user would otherwise have to spend time parsing out. Usage of these comments should be rare.',vscpp("br",null),"- You may be in a dirty git worktree.",vscpp("br",null),"* NEVER revert existing changes you did not make unless explicitly requested, since these changes were made by the user.",vscpp("br",null),"* If asked to make a commit or code edits and there are unrelated changes to your work or changes that you didn't make in those files, don't revert those changes.",vscpp("br",null),"* If the changes are in files you've touched recently, you should read carefully and understand how you can work with the changes rather than reverting them.",vscpp("br",null),"* If the changes are in unrelated files, just ignore them and don't revert them.",vscpp("br",null),"- While you are working, you might notice unexpected changes that you didn't make. If this happens, STOP IMMEDIATELY and ask the user how they would like to proceed.",vscpp("br",null),vscpp("br",null),"## Tool use",vscpp("br",null),"- You have access to many tools. If a tool exists to perform a specific task, you MUST use that tool instead of running a terminal command to perform that task.",vscpp("br",null),this.props.hasSearchSubagent&&vscpp(vscppf,null,"- For broader codebase exploration that would require more than 3 search tool calls, use"," ","run_subagent",' with the "Search" agent. The search agent runs in an isolated context, keeping verbose search results out of your main context window. For simple, directed searches (e.g. a specific file or class), use ',"semantic_search",", ","file_search",", or"," ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),"- When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),vscpp("br",null),"## Special user requests",vscpp("br",null),vscpp("br",null),"- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as `date`), you should do so.",vscpp("br",null),'- If the user asks for a "review", default to a code review mindset: prioritise identifying bugs, risks, behavioural regressions, and missing tests. Findings must be the primary focus of the response - keep summaries or overviews brief and only after enumerating the issues. Present findings first (ordered by severity with file/line references), follow with open questions or assumptions, and offer a change-summary only as a secondary detail. If no findings are discovered, state that explicitly and mention any residual risks or testing gaps.',vscpp("br",null),vscpp("br",null),"## Presenting your work and final message",vscpp("br",null),vscpp("br",null),"You are producing text that will be rendered as markdown by the VS Code UI. Follow these rules exactly. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value.",vscpp("br",null),vscpp("br",null),"- Default: be very concise; friendly coding teammate tone.",vscpp("br",null),"- Ask only when needed; suggest ideas; mirror the user's style.",vscpp("br",null),"- For substantial work, summarize clearly; follow final-answer formatting.",vscpp("br",null),"- Skip heavy formatting for simple confirmations.",vscpp("br",null),"- Don't dump large files you've written; reference paths only.",vscpp("br",null),'- No "save/copy this file" - User is on the same machine.',vscpp("br",null),"- Offer logical next steps (tests, commits, build) briefly; add verify steps if you couldn't do something.",vscpp("br",null),"- For code changes:",vscpp("br",null),'* Lead with a quick explanation of the change, and then give more details on the context covering where and why a change was made. Do not start this explanation with "summary", just jump right in.',vscpp("br",null),"* If there are natural next steps the user may want to take, suggest them at the end of your response. Do not make suggestions if there are no natural next steps.",vscpp("br",null),"* When suggesting multiple options, use numeric lists for the suggestions so the user can quickly respond with a single number.",vscpp("br",null),"- The user does not command execution outputs. When asked to show the output of a command (e.g. `git show`), relay the important details in your answer or summarize the key lines so the user understands the result.",vscpp("br",null),"- Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null),vscpp("br",null),"### Final answer structure and style guidelines",vscpp("br",null),vscpp("br",null),"- Markdown text. Use structure only when it helps scannability.",vscpp("br",null),"- Headers: optional; short Title Case (1-3 words) wrapped in **\u2026**; no blank line before the first bullet; add only if they truly help.",vscpp("br",null),"- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.",vscpp("br",null),"- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **.",vscpp("br",null),"- Code samples or multi-line snippets should be wrapped in fenced code blocks; add a language hint whenever obvious.",vscpp("br",null),"- Structure: group related bullets; order sections general \u2192 specific \u2192 supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.",vscpp("br",null),'- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.',vscpp("br",null),"- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short\u2014wrap/reformat if long; avoid naming formatting styles in answers.",vscpp("br",null),"- Adaptation: code explanations \u2192 precise, structured with code refs; simple tasks \u2192 lead with outcome; big changes \u2192 logical walkthrough + rationale + next actions; casual one-offs \u2192 plain sentences, no headers/bullets.",vscpp("br",null),"- File References: When referencing files in your response, always follow the below rules:",vscpp("br",null),"* Use inline code to make file paths clickable.",vscpp("br",null),"* Each reference should have a stand alone path. Even if it's the same file.",vscpp("br",null),"* Accepted: absolute, workspace-relative, a/ or b/ diff prefixes, or bare filename/suffix.",vscpp("br",null),"* Do not use URIs like file://, vscode://, or https://.",vscpp("br",null),"* Examples: src/app.ts, C:\\repo\\project\\main.rs",vscpp("br",null),vscpp(x5,{languageOverride:this.props.languageOverride}))}};p();p();var $Dn="filepath:",KA="...existing code...";p();var Utt=class extends fr{static{a(this,"ApplyPatchFormatInstructions")}renderCopilot(){return vscpp(vscppf,null,"*** Update File: [file_path]",vscpp("br",null),"[context_before] -> See below for further instructions on context.",vscpp("br",null),"-[old_code] -> Precede each line in the old code with a minus sign.",vscpp("br",null),"+[new_code] -> Precede each line in the new, replacement code with a plus sign.",vscpp("br",null),"[context_after] -> See below for further instructions on context.",vscpp("br",null),vscpp("br",null),"For instructions on [context_before] and [context_after]:",vscpp("br",null),"- By default, show 3 lines of code immediately above and 3 lines immediately below each change. If a change is within 3 lines of a previous change, do NOT duplicate the first change's [context_after] lines in the second change's [context_before] lines.",vscpp("br",null),"- If 3 lines of context is insufficient to uniquely identify the snippet of code within the file, use the @@ operator to indicate the class or function to which the snippet belongs.",vscpp("br",null),"- If a code block is repeated so many times in a class or function such that even a single @@ statement and 3 lines of context cannot uniquely identify the snippet of code, you can use multiple `@@` statements to jump to the right context.",vscpp("br",null),vscpp("br",null),"You must use the same indentation style as the original code. If the original code uses tabs, you must use tabs. If the original code uses spaces, you must use spaces. Be sure to use a proper UNESCAPED tab character.",vscpp("br",null),vscpp("br",null),"See below for an example of the patch format. If you propose changes to multiple regions in the same file, you should repeat the *** Update File header for each snippet of code to change:",vscpp("br",null),vscpp("br",null),"*** Begin Patch",vscpp("br",null),"*** Update File: /Users/someone/pygorithm/searching/binary_search.py",vscpp("br",null),"@@ class BaseClass",vscpp("br",null),"@@"," ","def method():",vscpp("br",null),"[3 lines of pre-context]",vscpp("br",null),"-[old_code]",vscpp("br",null),"+[new_code]",vscpp("br",null),"+[new_code]",vscpp("br",null),"[3 lines of post-context]",vscpp("br",null),"*** End Patch",vscpp("br",null))}};p();var wj=class extends fr{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!eJe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===kn.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(kn.Gpt5)?vscpp(vscppf,null,"You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user.",vscpp("br",null),"Your thinking should be thorough and so it's fine if it's very long. However, avoid unnecessary repetition and verbosity. You should be concise, but thorough.",vscpp("br",null),"You MUST iterate and keep going until the problem is solved.",vscpp("br",null),"You have everything you need to resolve this problem. I want you to fully solve this autonomously before coming back to me.",vscpp("br",null),"Only terminate your turn when you are sure that the problem is solved and all items have been checked off. Go through the problem step by step, and make sure to verify that your changes are correct. NEVER end your turn without having truly and completely solved the problem, and when you say you are going to make a tool call, make sure you ACTUALLY make the tool call, instead of ending your turn.",vscpp("br",null),"Take your time and think through every step - remember to check your solution rigorously and watch out for boundary cases, especially with the changes you made. Your solution must be perfect. If not, continue working on it. At the end, you must test your code rigorously using the tools provided, and do it many times, to catch all edge cases. If it is not robust, iterate more and make it perfect. Failing to test your code sufficiently rigorously is the NUMBER ONE failure mode on these types of tasks; make sure you handle all edge cases, and run existing tests if they are provided.",vscpp("br",null),"You MUST plan extensively before each function call, and reflect extensively on the outcomes of the previous function calls. DO NOT do this entire process by making function calls only, as this can impair your ability to solve the problem and think insightfully.",vscpp("br",null),"You are a highly capable and autonomous agent, and you can definitely solve this problem without needing to ask the user for further input.",vscpp("br",null)):vscpp(vscppf,null,"You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user. ONLY terminate your turn when you are sure that the problem is solved, or you absolutely cannot continue.",vscpp("br",null),"You take action when possible- the user is expecting YOU to take action and go to work for them. Don't ask unnecessary questions about the details if you can simply DO something useful instead.",vscpp("br",null))}};p();function VDn(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(VDn,"modelSupportsReplaceString");function WDn(t){return t?t.startsWith("gpt-5"):!1}a(WDn,"isGpt5PlusFamily");function zcs(t){return t?t==="gpt-5.2-codex":!1}a(zcs,"isGpt52CodexFamily");function Ycs(t){return t?t==="gpt-5.2":!1}a(Ycs,"isGpt52Family");function zDn(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||zcs(e)||Ycs(e))}a(zDn,"modelSupportsApplyPatch");var YDn=fe(wo());var Qtt=class extends fr{static{a(this,"DefaultAgentPrompt")}renderCopilot(){let e=a(g=>this.props.tools.some(A=>A.name===g),"hasTool"),r=e("get_errors"),n=e("run_in_terminal"),o=e("read_file"),s=e("replace_string_in_file"),c=e("semantic_search"),l=e("apply_patch"),u=e("insert_edit_into_file"),d=l||s||u,f=e("manage_todo_list"),h=e("run_subagent"),m=WDn(this.props.modelConfiguration.modelFamily);return vscpp(YDn.SystemMessage,null,vscpp(Wn,{name:"instructions"},"You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.",vscpp("br",null),"The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.",vscpp("br",null),vscpp(wj,{modelConfiguration:this.props.modelConfiguration}),"If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.",vscpp("br",null),"If the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept."),vscpp(Wn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission. If you make a plan, immediately follow it - do not wait for the user to confirm.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","run_in_terminal",` tool, say "I'll run the command in a terminal".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",c&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"and do not parallelize edits or dependent steps.",vscpp("br",null),n&&vscpp(vscppf,null,"Don't call the ","run_in_terminal"," tool multiple times in parallel. Instead, run one command and wait for the output before running the next command.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),h&&vscpp(vscppf,null,"Use the ","run_subagent"," tool with specialized agents when the task at hand matches the agent's description. Subagents are valuable for parallelizing independent queries or for protecting the main context window from excessive results, but they should not be used excessively when not needed. Importantly, avoid duplicating work that subagents are already doing - if you delegate research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),!d&&vscpp(vscppf,null,"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can ask the user to enable editing tools or print a codeblock with the suggested changes.",vscpp("br",null)),!n&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(Wn,{name:"contextGathering"},"Be THOROUGH when gathering information - make sure you have the FULL picture before making any changes. TRACE every symbol back to its definitions and usages so you fully understand it. Look past the first seemingly relevant result and EXPLORE alternative implementations and edge cases.",vscpp("br",null),this.props.hasSearchSubagent?vscpp(vscppf,null,"For broader or complex codebase exploration that would require more than 3 search tool calls, use the ","run_subagent",' tool with the "Search" agent instead. The search agent runs in an isolated context, keeping verbose search results out of your main context window.',vscpp("br",null),"Only skip for simple, directed codebase searches, use ","semantic_search",","," ","file_search",", or ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)):c&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then perform the task. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(Wn,{name:"makingCodeChanges"},"NEVER output code to the user unless requested. Use the appropriate tool to implement changes directly.",vscpp("br",null),"NEVER generate an extremely long hash or any non-textual code, such as binary. These are not helpful to the user and are very expensive.",vscpp("br",null),"Add all necessary import statements, dependencies, and endpoints required to run the code.",vscpp("br",null),"Think creatively and explore the workspace in order to make a complete fix.",vscpp("br",null),"Before editing an existing file, make sure you have it in context",o&&vscpp(vscppf,null," or read it with ","read_file")," first. If you fail to edit a file, read it again before retrying - the user may have edited it.",vscpp("br",null),l?vscpp(vscppf,null,"To edit files in the workspace, use the ","apply_patch"," tool. If you have issues with it, you should first try to fix your patch and continue using ","apply_patch","."," ",u&&vscpp(vscppf,null,"If you are stuck, you can fall back on the ","insert_edit_into_file"," tool, but"," ","apply_patch"," is much faster and is the preferred tool."),vscpp("br",null),"IMPORTANT: Each ","apply_patch"," call can only operate on ONE file. If you need to modify multiple files, use separate ","apply_patch"," tool calls for each file. Delete file operation is NOT supported - use other methods if you need to delete files.",vscpp("br",null),m&&vscpp(vscppf,null,"Prefer the smallest set of changes needed to satisfy the task. Avoid reformatting unrelated code; preserve existing style and public APIs unless the task requires changes. When practical, complete all edits for a file within a single message.",vscpp("br",null)),"The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following:",vscpp("br",null),vscpp(Utt,null),vscpp("br",null),"NEVER print the patch out to the user, instead call the tool and the edits will be applied and shown to the user.",vscpp("br",null)):s?vscpp(vscppf,null,"Use ","replace_string_in_file"," to edit files, paying attention to context to ensure your replacement is unique. Group related edits into batches instead of making many separate calls. Use ","insert_edit_into_file"," only if ","replace_string_in_file"," has failed.",vscpp("br",null)):u?vscpp(vscppf,null,"Use ","insert_edit_into_file"," to edit files. When editing files, group your changes by file.",vscpp("br",null)):vscpp(vscppf,null),"For each file, give a short description of what needs to be changed, then use the tool. You can use tools multiple times in a response and keep writing text after using a tool.",vscpp("br",null),"Follow best practices when editing files. If a popular external library exists to solve a problem, use it and properly install the package e.g. ",n?'with "npm install" or ':"",'creating a "requirements.txt".',vscpp("br",null),r&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited (not a wide scope). Fix relevant errors, but don't loop more than 3 times on the same file - ask the user if still failing.",vscpp("br",null)),!l&&u&&vscpp(vscppf,null,"The ","insert_edit_into_file"," tool is very smart and can understand how to apply your edits to the user's files, you just need to provide minimal hints.",vscpp("br",null),"When you use the ","insert_edit_into_file"," tool, avoid repeating existing code, instead use comments to represent regions of unchanged code. The tool prefers that you are as concise as possible. For example:",vscpp("br",null),"// ",KA,vscpp("br",null),"changed code",vscpp("br",null),"// ",KA,vscpp("br",null),"changed code",vscpp("br",null),"// ",KA,vscpp("br",null),vscpp("br",null),"Here is an example of how you should format an edit to an existing Person class:",vscpp("br",null),["class Person {",` // ${KA}`," age: number;",` // ${KA}`," getAge() {"," return this.age;"," }","}"].join(` -`))),vscpp(Wn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),f&&vscpp(Wn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex tasks into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple tasks or conversational requests."),vscpp(x5,{languageOverride:this.props.languageOverride}))}};p();var qtt=class extends fr{static{a(this,"CopilotIdentityRules")}renderCopilot(){return vscpp(vscppf,null,'When asked for your name, you must respond with "GitHub Copilot".',vscpp("br",null),"Follow the user's requirements carefully & to the letter.")}},jtt=class extends fr{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var tfe=class extends fr{static{a(this,"SafetyRules")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, or violent, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null))}},Htt=class extends fr{static{a(this,"Gpt5SafetyRule")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, or violent, only respond with "Sorry, I can't assist with that."`,vscpp("br",null))}},Gtt=class extends fr{static{a(this,"LegacySafetyRules")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null))}};p();var KDn=fe(wo());var $tt=class extends fr{static{a(this,"InlineCodeEditPrompt")}renderCopilot(){let e=a(c=>this.props.tools.some(l=>l.name===c),"hasTool"),r=e("apply_patch"),n=e("replace_string_in_file"),o=e("insert_edit_into_file"),s=e("get_errors");return vscpp(KDn.SystemMessage,{priority:1e3},vscpp(Wn,{name:"instructions"},"You are an AI coding assistant that is used for quick, inline code changes. Changes are scoped to the selected code in a single file. You can ONLY edit that file and MUST use a tool to make these edits.",vscpp("br",null),vscpp(wj,{modelConfiguration:this.props.modelConfiguration}),"The user is interested in code changes grounded in the user's prompt. Focus on coding, no wordy explanations, and do not ask back for clarifications.",vscpp("br",null),"Do NOT make code changes that are not directly and logically related to the user's prompt.",vscpp("br",null),"ONLY change the current file. Focus on the selection and try to make changes to the selected code and its immediate context. Do NOT modify code outside the user's selection unless absolutely necessary for correctness.",vscpp("br",null),"Keep changes minimal and focused on exactly what the user asked for.",vscpp("br",null)),vscpp(Wn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"NEVER output code to the user unless requested. Use the appropriate tool to implement changes directly.",vscpp("br",null),r?vscpp(vscppf,null,"Use ","apply_patch"," to make targeted edits to the selected code. If you have issues, first try to fix your patch and continue using ","apply_patch",".",o&&vscpp(vscppf,null," ","If you are stuck, you can fall back on ","insert_edit_into_file",", but"," ","apply_patch"," is the preferred tool."),vscpp("br",null)):n?vscpp(vscppf,null,"Use ","replace_string_in_file"," to make targeted edits to the selected code, paying attention to context to ensure your replacement is unique.",o&&vscpp(vscppf,null," ","Use ","insert_edit_into_file"," only if ","replace_string_in_file"," has failed."),vscpp("br",null)):o?vscpp(vscppf,null,"Use ","insert_edit_into_file"," to edit files. When editing, avoid repeating existing code, instead use a line comment with `",KA,"` to represent regions of unchanged code.",vscpp("br",null)):vscpp(vscppf,null,"You do not have edit tools available. Describe the code changes to the user instead.",vscpp("br",null)),s&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited. Fix relevant errors, but don't loop more than 3 times on the same file.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null)),vscpp(x5,{languageOverride:this.props.languageOverride}))}},Vtt=class extends fr{static{a(this,"InlineEditingReminder")}renderCopilot(){return vscpp(vscppf,null,"Focus on the selection and try to make changes to the selected code and its context. Do NOT edit code outside the selection unless absolutely necessary for correctness. ONLY change the current file, and change NO other file.")}};var Wtt=fe(wo());var ztt=class extends fr{static{a(this,"SystemInstructionsPrompt")}getAgentPrompt(){let e=this.props.turnContext.conversation.userLanguage,{tools:r,modelConfiguration:n,turnContext:o,hasSearchSubagent:s}=this.props,c=o.turn.chatMode?.kind==="Ask",l=o.turn.chatMode?.kind==="InlineAgent",u=kt(this.props.turnContext.ctx,ze.UseAgentsMd);return eJe(n.modelFamily)?vscpp(Ftt,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(Btt,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp($tt,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(Qtt,{tools:r,modelConfiguration:n,languageOverride:e,enableAgentsMdUpdate:u,hasSearchSubagent:s})}renderCopilot(){let e=this.props.turnContext.ctx,r=e.get(Ir).getEditorInfo().name,n=e.get(Nn).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(Wtt.SystemMessage,null,"You are an expert AI programming assistant, working with a user in the ",r," editor.",vscpp("br",null),this.props.modelConfiguration.modelFamily.startsWith(kn.Gpt5)?vscpp(vscppf,null,vscpp(jtt,null),vscpp(Htt,null)):vscpp(vscppf,null,vscpp(qtt,null),vscpp(tfe,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(Wtt.SystemMessage,null,vscpp(vscppf,null,"When you complete your task, provide a clear, concise summary of what you accomplished.")),n.subAgent&&o&&!this.props.turnContext.turn.isSubagent()&&this.props.turnContext.turn.chatMode?.id==="Agent"&&vscpp(Wtt.SystemMessage,null,vscpp(vscppf,null,"You should ALWAYS check available agent descriptions first to see if any agent can be used with the `","run_subagent","` tool. DO NOT attempt to implement tasks yourself when a relevant agent exists. Delegating to specialized agents produces better results.")))}};p();var JDn=fe(wo());var Ytt=class extends fr{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=ZO(this.props.currentTurn.response?.message,!0),r=d5(e,{ctx:this.props.turnContext.ctx,identifier:`Turn ID: ${this.props.currentTurn.id}`,enableWarnings:!0});if(r.length===0)return vscpp(vscppf,null);let n=(0,JDn.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},vscpp(Rw,{assistantRounds:r,ctx:this.props.turnContext.ctx,truncateAt:this.props.truncateAt,modelConfiguration:this.props.modelConfiguration,isHistorical:!1,identifier:String(this.props.currentTurn.id)})))}};p();p();var Ktt=class extends fr{static{a(this,"CurrentDatePrompt")}renderCopilot(){let e=this.props.date?.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})||new Date().toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"});return vscpp(vscppf,null,"The current date is ",e,".")}};p();var Jtt=class extends fr{static{a(this,"CurrentEditorContext")}renderCopilot(){let e,r=this.props.turnContext.turn.request.activeEditor;return r&&(e=this.renderActiveTextEditor(r)),e===void 0?vscpp(vscppf,null):vscpp(Wn,{name:"editorContext"},vscpp(vscppf,null,e))}renderActiveTextEditor(e){let r=e.selection,n=r&&Kcs(r)?vscpp(vscppf,null,"The current selection is from line ",r.start.line+1," to line ",r.end.line+1,"."):void 0;return vscpp(vscppf,null,"The user's current file is ",un(e.uri),". ",n)}};function Kcs(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(Kcs,"notEmptySelection");p();var Ztt=class extends fr{static{a(this,"EditingReminder")}renderCopilot(){if(!(this.props.tools&&!this.props.tools.some(e=>e.name==="insert_edit_into_file")))return vscpp(vscppf,null,"When using the ","insert_edit_into_file"," tool, avoid repeating existing code, instead use a line comment with `",KA,"` to represent regions of unchanged code.")}};p();var Xtt=class extends fr{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(kn.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(kn.Gpt5Mini);return vscpp(vscppf,null,`Skip filler acknowledgements like "Sounds good" or "Okay, I will\u2026". Open with a purposeful one-liner about what you're doing next.`,vscpp("br",null),"When sharing setup or run steps, present terminal commands in fenced code blocks with the correct language tag. Keep commands copyable and on separate lines.",vscpp("br",null),"Avoid definitive claims about the build or runtime setup unless verified from the provided context (or quick tool checks). If uncertain, state what's known from attachments and proceed with minimal steps you can adapt later.",vscpp("br",null),"When you create or edit runnable code, run a test yourself to confirm it works; then share optional fenced commands for more advanced runs.",vscpp("br",null),'For non-trivial code generation, produce a complete, runnable solution: necessary source files, a tiny runner or test/benchmark harness, a minimal `README.md`, and updated dependency manifests (e.g., `package.json`, `requirements.txt`, `pyproject.toml`). Offer quick "try it" commands and optional platform-specific speed-ups when relevant.',vscpp("br",null),"Your goal is to act like a pair programmer: be friendly and helpful. If you can do more, do more. Be proactive with your solutions, think about what the user needs and what they want, and implement it proactively.",vscpp("br",null),vscpp(Wn,{name:"importantReminders"},!e&&vscpp(vscppf,null,"Start your response with a brief acknowledgement, followed by a concise high-level plan outlining your approach.",vscpp("br",null)),"DO NOT state your identity or model name unless the user explicitly asks you to. ",vscpp("br",null),this.props.hasTodoTool&&vscpp(vscppf,null,"You MUST use the todo list tool to plan and track your progress. NEVER skip this step, and START with this step whenever the task is multi-step. This is essential for maintaining visibility and proper execution of large tasks. Follow the todoListToolInstructions strictly.",vscpp("br",null)),!this.props.hasTodoTool&&vscpp(vscppf,null,"Break down the request into clear, actionable steps and present them as a checklist at the beginning of your response before proceeding with implementation. This helps maintain visibility and ensures all requirements are addressed systematically. Skip this for simple questions or single-step tasks.",vscpp("br",null)),"When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null)))}}};p();p();p();p();p();var w5=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=GA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${$Dn} ${un(this.params.uri)}`);let n=this.params.shouldTrim?this.params.code.trim():this.params.code;if(this.params.lineNumberStart!==void 0){let o=n.split(` + `).join(""),s=vscpp(vscppf,null,vscpp(Wn,{name:"skills"},"Here is a list of skills that contain domain specific knowledge on a variety of topics. Each skill comes with a description of the topic and a file path that contains the detailed instructions. When a user asks you to perform a task that falls within the domain of a skill, use the 'read_file' tool to acquire the full instructions from the file URI.",o));return this.props.turnContext.cachedSkillListPrompt=s,s}};p();p();var QDn={id:"builtin:search",name:"Search",description:"Launch an autonomous search agent to find relevant code in the workspace. The search agent can use grep search, file search, and read files to locate code. Use this when you need to find code but aren't sure exactly where to look.",invokePolicy:["model"],isReadonly:!0,isBuiltIn:!0},efe=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await HWe(e.ctx)&&r.set(QDn.name,QDn);let o=await e.ctx.get(Kd).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&&sr(e.ctx,"customAgent.shadowsBuiltIn",{builtInAgentName:s.name}),r.set(s.name,s);return r}async getAgentsForModelDispatch(e){let r=await this.getAgents(e),n=new Map;for(let[o,s]of r)s.invokePolicy.includes("model")&&n.set(o,s);return n}async getAgent(e,r){return(await this.getAgents(e)).get(r)}};p();var Vcs=new Map([["run_in_terminal","terminal"],["insert_edit_into_file","file_write"],["create_file","file_write"],["replace_string_in_file","file_write"],["apply_patch","file_write"],["read_file","file_read"],["list_dir","file_read"],["semantic_search","safe_tool"],["get_errors","safe_tool"],["file_search","safe_tool"],["grep_search","safe_tool"],["update_user_preferences","safe_tool"],["run_subagent","safe_tool"],["validate_cves","safe_tool"],["manage_todo_list","safe_tool"]]);function qDn(t){return Vcs.get(t)??"unknown"}a(qDn,"getToolFunctionalType");var Wcs=new Map([["copilot_semanticSearch","semantic_search"],["copilot_readFile","read_file"],["copilot_listDir","list_dir"],["copilot_getErrors","get_errors"],["copilot_runInTerminal","run_in_terminal"],["copilot_insertEdit","insert_edit_into_file"],["copilot_createFile","create_file"],["copilot_replaceString","replace_string_in_file"],["copilot_applyPatch","apply_patch"],["copilot_updateUserPreferences","update_user_preferences"],["copilot_fileSearch","file_search"],["copilot_findTextInFiles","grep_search"],["copilot_runSubagent","run_subagent"],["copilot_validateCves","validate_cves"],["copilot_manageTodoList","manage_todo_list"]]),zcs=new Map;for(let[t,e]of Wcs)zcs.set(e,t);var jDn=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),HDn=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var Ltt=class extends fr{static{a(this,"SubagentListPrompt")}async renderCopilot(){if(this.props.turnContext.cachedSubagentListPrompt!==void 0)return this.props.turnContext.cachedSubagentListPrompt??vscpp(vscppf,null);let r=await new efe().getAgentsForModelDispatch(this.props.turnContext);if(r.size===0)return this.props.turnContext.cachedSubagentListPrompt=null,vscpp(vscppf,null);let n=Array.from(r.entries()).map(([s,c])=>`- **${c.name}**: ${c.description}`).join(` +`),o=vscpp(vscppf,null,vscpp(Wn,{name:"subagent-instructions"},"You should ALWAYS use the `","run_subagent","` tool to delegate tasks to specialized agents when the task you are working on matches the agent's description.",vscpp("br",null),"Available Agents:",vscpp("br",null),n,vscpp("br",null),"IMPORTANT: The `agentName` parameter MUST be one of the exact agent names listed above. Do NOT use any other name."));return this.props.turnContext.cachedSubagentListPrompt=o,o}};p();p();p();var tfe=class extends fr{static{a(this,"AskModeKeepGoingReminder")}renderCopilot(){return vscpp(vscppf,null,"You are an agent \u2014 keep going until the user's query is completely resolved before ending your turn. ONLY stop if solved or genuinely blocked.",vscpp("br",null),"Avoid repetition across turns: don't restate unchanged context or plans verbatim; provide only what changed.",vscpp("br",null))}};p();var Ycs=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],x5=class extends fr{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&&Ycs.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var GDn=fe(wo());var Btt=class extends fr{static{a(this,"AskAgentPrompt")}renderCopilot(){let e=a(s=>this.props.tools.some(c=>c.name===s),"hasTool"),r=e("semantic_search"),n=e("read_file"),o=e("run_in_terminal");return vscpp(GDn.SystemMessage,null,vscpp(Wn,{name:"instructions"},"You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.",vscpp("br",null),"The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.",vscpp("br",null),"If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when answering questions.",vscpp("br",null),vscpp(tfe,null)),vscpp(Wn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","read_file",` tool, say "I'll read the file".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",r&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"but do not parallelize dependent steps.",vscpp("br",null),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),!o&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(Wn,{name:"contextGathering"},r&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then answer the question. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"Unless it is clear that the user's question relates to the current workspace, you should avoid using search tools and instead prefer to answer the user's question directly.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(Wn,{name:"codesearchModeInstructions"},"These instructions apply when answering questions about the user's codebase.",vscpp("br",null),"First, analyze the user's request to determine how complicated their task is. Leverage any of the tools available to you to gather the context needed to provide a complete and accurate response. Keep your search focused on the user's request, and don't run extra tools if the user's request clearly can be satisfied by just one.",vscpp("br",null),"Think step by step:",vscpp("br",null),"1. Read the provided relevant workspace information (code excerpts, file names, and symbols) to understand the user's workspace.",vscpp("br",null),"2. Consider how to answer the user's prompt based on the provided information and your specialized coding knowledge. Always assume that the user is asking about the code in their workspace instead of asking a general programming question.",vscpp("br",null),"3. Generate a response that clearly and accurately answers the user's question. In your response, add fully qualified links for referenced symbols and links for files so that the user can open them.",vscpp("br",null),"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can print a codeblock with the suggested changes."),vscpp(Wn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),e("manage_todo_list")&&vscpp(Wn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex research into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple questions or conversational requests."),vscpp(x5,{languageOverride:this.props.languageOverride}))}};p();var $Dn=fe(wo());var Ftt=class extends fr{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp($Dn.SystemMessage,null,"You are a coding agent based on GPT-5-Codex.",vscpp("br",null),vscpp("br",null),"## Editing constraints",vscpp("br",null),vscpp("br",null),"- Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.",vscpp("br",null),'- Add succinct code comments that explain what is going on if code is not self-explanatory. You should not add comments like "Assigns the value to the variable", but a brief comment might be useful ahead of a complex code block that the user would otherwise have to spend time parsing out. Usage of these comments should be rare.',vscpp("br",null),"- You may be in a dirty git worktree.",vscpp("br",null),"* NEVER revert existing changes you did not make unless explicitly requested, since these changes were made by the user.",vscpp("br",null),"* If asked to make a commit or code edits and there are unrelated changes to your work or changes that you didn't make in those files, don't revert those changes.",vscpp("br",null),"* If the changes are in files you've touched recently, you should read carefully and understand how you can work with the changes rather than reverting them.",vscpp("br",null),"* If the changes are in unrelated files, just ignore them and don't revert them.",vscpp("br",null),"- While you are working, you might notice unexpected changes that you didn't make. If this happens, STOP IMMEDIATELY and ask the user how they would like to proceed.",vscpp("br",null),vscpp("br",null),"## Tool use",vscpp("br",null),"- You have access to many tools. If a tool exists to perform a specific task, you MUST use that tool instead of running a terminal command to perform that task.",vscpp("br",null),this.props.hasSearchSubagent&&vscpp(vscppf,null,"- For broader codebase exploration that would require more than 3 search tool calls, use"," ","run_subagent",' with the "Search" agent. The search agent runs in an isolated context, keeping verbose search results out of your main context window. For simple, directed searches (e.g. a specific file or class), use ',"semantic_search",", ","file_search",", or"," ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),"- When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),vscpp("br",null),"## Special user requests",vscpp("br",null),vscpp("br",null),"- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as `date`), you should do so.",vscpp("br",null),'- If the user asks for a "review", default to a code review mindset: prioritise identifying bugs, risks, behavioural regressions, and missing tests. Findings must be the primary focus of the response - keep summaries or overviews brief and only after enumerating the issues. Present findings first (ordered by severity with file/line references), follow with open questions or assumptions, and offer a change-summary only as a secondary detail. If no findings are discovered, state that explicitly and mention any residual risks or testing gaps.',vscpp("br",null),vscpp("br",null),"## Presenting your work and final message",vscpp("br",null),vscpp("br",null),"You are producing text that will be rendered as markdown by the VS Code UI. Follow these rules exactly. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value.",vscpp("br",null),vscpp("br",null),"- Default: be very concise; friendly coding teammate tone.",vscpp("br",null),"- Ask only when needed; suggest ideas; mirror the user's style.",vscpp("br",null),"- For substantial work, summarize clearly; follow final-answer formatting.",vscpp("br",null),"- Skip heavy formatting for simple confirmations.",vscpp("br",null),"- Don't dump large files you've written; reference paths only.",vscpp("br",null),'- No "save/copy this file" - User is on the same machine.',vscpp("br",null),"- Offer logical next steps (tests, commits, build) briefly; add verify steps if you couldn't do something.",vscpp("br",null),"- For code changes:",vscpp("br",null),'* Lead with a quick explanation of the change, and then give more details on the context covering where and why a change was made. Do not start this explanation with "summary", just jump right in.',vscpp("br",null),"* If there are natural next steps the user may want to take, suggest them at the end of your response. Do not make suggestions if there are no natural next steps.",vscpp("br",null),"* When suggesting multiple options, use numeric lists for the suggestions so the user can quickly respond with a single number.",vscpp("br",null),"- The user does not command execution outputs. When asked to show the output of a command (e.g. `git show`), relay the important details in your answer or summarize the key lines so the user understands the result.",vscpp("br",null),"- Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null),vscpp("br",null),"### Final answer structure and style guidelines",vscpp("br",null),vscpp("br",null),"- Markdown text. Use structure only when it helps scannability.",vscpp("br",null),"- Headers: optional; short Title Case (1-3 words) wrapped in **\u2026**; no blank line before the first bullet; add only if they truly help.",vscpp("br",null),"- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.",vscpp("br",null),"- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **.",vscpp("br",null),"- Code samples or multi-line snippets should be wrapped in fenced code blocks; add a language hint whenever obvious.",vscpp("br",null),"- Structure: group related bullets; order sections general \u2192 specific \u2192 supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.",vscpp("br",null),'- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.',vscpp("br",null),"- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short\u2014wrap/reformat if long; avoid naming formatting styles in answers.",vscpp("br",null),"- Adaptation: code explanations \u2192 precise, structured with code refs; simple tasks \u2192 lead with outcome; big changes \u2192 logical walkthrough + rationale + next actions; casual one-offs \u2192 plain sentences, no headers/bullets.",vscpp("br",null),"- File References: When referencing files in your response, always follow the below rules:",vscpp("br",null),"* Use inline code to make file paths clickable.",vscpp("br",null),"* Each reference should have a stand alone path. Even if it's the same file.",vscpp("br",null),"* Accepted: absolute, workspace-relative, a/ or b/ diff prefixes, or bare filename/suffix.",vscpp("br",null),"* Do not use URIs like file://, vscode://, or https://.",vscpp("br",null),"* Examples: src/app.ts, C:\\repo\\project\\main.rs",vscpp("br",null),vscpp(x5,{languageOverride:this.props.languageOverride}))}};p();p();var VDn="filepath:",KA="...existing code...";p();var Utt=class extends fr{static{a(this,"ApplyPatchFormatInstructions")}renderCopilot(){return vscpp(vscppf,null,"*** Update File: [file_path]",vscpp("br",null),"[context_before] -> See below for further instructions on context.",vscpp("br",null),"-[old_code] -> Precede each line in the old code with a minus sign.",vscpp("br",null),"+[new_code] -> Precede each line in the new, replacement code with a plus sign.",vscpp("br",null),"[context_after] -> See below for further instructions on context.",vscpp("br",null),vscpp("br",null),"For instructions on [context_before] and [context_after]:",vscpp("br",null),"- By default, show 3 lines of code immediately above and 3 lines immediately below each change. If a change is within 3 lines of a previous change, do NOT duplicate the first change's [context_after] lines in the second change's [context_before] lines.",vscpp("br",null),"- If 3 lines of context is insufficient to uniquely identify the snippet of code within the file, use the @@ operator to indicate the class or function to which the snippet belongs.",vscpp("br",null),"- If a code block is repeated so many times in a class or function such that even a single @@ statement and 3 lines of context cannot uniquely identify the snippet of code, you can use multiple `@@` statements to jump to the right context.",vscpp("br",null),vscpp("br",null),"You must use the same indentation style as the original code. If the original code uses tabs, you must use tabs. If the original code uses spaces, you must use spaces. Be sure to use a proper UNESCAPED tab character.",vscpp("br",null),vscpp("br",null),"See below for an example of the patch format. If you propose changes to multiple regions in the same file, you should repeat the *** Update File header for each snippet of code to change:",vscpp("br",null),vscpp("br",null),"*** Begin Patch",vscpp("br",null),"*** Update File: /Users/someone/pygorithm/searching/binary_search.py",vscpp("br",null),"@@ class BaseClass",vscpp("br",null),"@@"," ","def method():",vscpp("br",null),"[3 lines of pre-context]",vscpp("br",null),"-[old_code]",vscpp("br",null),"+[new_code]",vscpp("br",null),"+[new_code]",vscpp("br",null),"[3 lines of post-context]",vscpp("br",null),"*** End Patch",vscpp("br",null))}};p();var wj=class extends fr{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!eJe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===kn.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(kn.Gpt5)?vscpp(vscppf,null,"You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user.",vscpp("br",null),"Your thinking should be thorough and so it's fine if it's very long. However, avoid unnecessary repetition and verbosity. You should be concise, but thorough.",vscpp("br",null),"You MUST iterate and keep going until the problem is solved.",vscpp("br",null),"You have everything you need to resolve this problem. I want you to fully solve this autonomously before coming back to me.",vscpp("br",null),"Only terminate your turn when you are sure that the problem is solved and all items have been checked off. Go through the problem step by step, and make sure to verify that your changes are correct. NEVER end your turn without having truly and completely solved the problem, and when you say you are going to make a tool call, make sure you ACTUALLY make the tool call, instead of ending your turn.",vscpp("br",null),"Take your time and think through every step - remember to check your solution rigorously and watch out for boundary cases, especially with the changes you made. Your solution must be perfect. If not, continue working on it. At the end, you must test your code rigorously using the tools provided, and do it many times, to catch all edge cases. If it is not robust, iterate more and make it perfect. Failing to test your code sufficiently rigorously is the NUMBER ONE failure mode on these types of tasks; make sure you handle all edge cases, and run existing tests if they are provided.",vscpp("br",null),"You MUST plan extensively before each function call, and reflect extensively on the outcomes of the previous function calls. DO NOT do this entire process by making function calls only, as this can impair your ability to solve the problem and think insightfully.",vscpp("br",null),"You are a highly capable and autonomous agent, and you can definitely solve this problem without needing to ask the user for further input.",vscpp("br",null)):vscpp(vscppf,null,"You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user. ONLY terminate your turn when you are sure that the problem is solved, or you absolutely cannot continue.",vscpp("br",null),"You take action when possible- the user is expecting YOU to take action and go to work for them. Don't ask unnecessary questions about the details if you can simply DO something useful instead.",vscpp("br",null))}};p();function WDn(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(WDn,"modelSupportsReplaceString");function zDn(t){return t?t.startsWith("gpt-5"):!1}a(zDn,"isGpt5PlusFamily");function Kcs(t){return t?t==="gpt-5.2-codex":!1}a(Kcs,"isGpt52CodexFamily");function Jcs(t){return t?t==="gpt-5.2":!1}a(Jcs,"isGpt52Family");function YDn(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||Kcs(e)||Jcs(e))}a(YDn,"modelSupportsApplyPatch");var KDn=fe(wo());var Qtt=class extends fr{static{a(this,"DefaultAgentPrompt")}renderCopilot(){let e=a(g=>this.props.tools.some(A=>A.name===g),"hasTool"),r=e("get_errors"),n=e("run_in_terminal"),o=e("read_file"),s=e("replace_string_in_file"),c=e("semantic_search"),l=e("apply_patch"),u=e("insert_edit_into_file"),d=l||s||u,f=e("manage_todo_list"),h=e("run_subagent"),m=zDn(this.props.modelConfiguration.modelFamily);return vscpp(KDn.SystemMessage,null,vscpp(Wn,{name:"instructions"},"You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.",vscpp("br",null),"The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.",vscpp("br",null),vscpp(wj,{modelConfiguration:this.props.modelConfiguration}),"If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.",vscpp("br",null),"If the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept."),vscpp(Wn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission. If you make a plan, immediately follow it - do not wait for the user to confirm.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","run_in_terminal",` tool, say "I'll run the command in a terminal".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",c&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"and do not parallelize edits or dependent steps.",vscpp("br",null),n&&vscpp(vscppf,null,"Don't call the ","run_in_terminal"," tool multiple times in parallel. Instead, run one command and wait for the output before running the next command.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),h&&vscpp(vscppf,null,"Use the ","run_subagent"," tool with specialized agents when the task at hand matches the agent's description. Subagents are valuable for parallelizing independent queries or for protecting the main context window from excessive results, but they should not be used excessively when not needed. Importantly, avoid duplicating work that subagents are already doing - if you delegate research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),!d&&vscpp(vscppf,null,"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can ask the user to enable editing tools or print a codeblock with the suggested changes.",vscpp("br",null)),!n&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(Wn,{name:"contextGathering"},"Be THOROUGH when gathering information - make sure you have the FULL picture before making any changes. TRACE every symbol back to its definitions and usages so you fully understand it. Look past the first seemingly relevant result and EXPLORE alternative implementations and edge cases.",vscpp("br",null),this.props.hasSearchSubagent?vscpp(vscppf,null,"For broader or complex codebase exploration that would require more than 3 search tool calls, use the ","run_subagent",' tool with the "Search" agent instead. The search agent runs in an isolated context, keeping verbose search results out of your main context window.',vscpp("br",null),"Only skip for simple, directed codebase searches, use ","semantic_search",","," ","file_search",", or ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)):c&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then perform the task. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(Wn,{name:"makingCodeChanges"},"NEVER output code to the user unless requested. Use the appropriate tool to implement changes directly.",vscpp("br",null),"NEVER generate an extremely long hash or any non-textual code, such as binary. These are not helpful to the user and are very expensive.",vscpp("br",null),"Add all necessary import statements, dependencies, and endpoints required to run the code.",vscpp("br",null),"Think creatively and explore the workspace in order to make a complete fix.",vscpp("br",null),"Before editing an existing file, make sure you have it in context",o&&vscpp(vscppf,null," or read it with ","read_file")," first. If you fail to edit a file, read it again before retrying - the user may have edited it.",vscpp("br",null),l?vscpp(vscppf,null,"To edit files in the workspace, use the ","apply_patch"," tool. If you have issues with it, you should first try to fix your patch and continue using ","apply_patch","."," ",u&&vscpp(vscppf,null,"If you are stuck, you can fall back on the ","insert_edit_into_file"," tool, but"," ","apply_patch"," is much faster and is the preferred tool."),vscpp("br",null),"IMPORTANT: Each ","apply_patch"," call can only operate on ONE file. If you need to modify multiple files, use separate ","apply_patch"," tool calls for each file. Delete file operation is NOT supported - use other methods if you need to delete files.",vscpp("br",null),m&&vscpp(vscppf,null,"Prefer the smallest set of changes needed to satisfy the task. Avoid reformatting unrelated code; preserve existing style and public APIs unless the task requires changes. When practical, complete all edits for a file within a single message.",vscpp("br",null)),"The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following:",vscpp("br",null),vscpp(Utt,null),vscpp("br",null),"NEVER print the patch out to the user, instead call the tool and the edits will be applied and shown to the user.",vscpp("br",null)):s?vscpp(vscppf,null,"Use ","replace_string_in_file"," to edit files, paying attention to context to ensure your replacement is unique. Group related edits into batches instead of making many separate calls. Use ","insert_edit_into_file"," only if ","replace_string_in_file"," has failed.",vscpp("br",null)):u?vscpp(vscppf,null,"Use ","insert_edit_into_file"," to edit files. When editing files, group your changes by file.",vscpp("br",null)):vscpp(vscppf,null),"For each file, give a short description of what needs to be changed, then use the tool. You can use tools multiple times in a response and keep writing text after using a tool.",vscpp("br",null),"Follow best practices when editing files. If a popular external library exists to solve a problem, use it and properly install the package e.g. ",n?'with "npm install" or ':"",'creating a "requirements.txt".',vscpp("br",null),r&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited (not a wide scope). Fix relevant errors, but don't loop more than 3 times on the same file - ask the user if still failing.",vscpp("br",null)),!l&&u&&vscpp(vscppf,null,"The ","insert_edit_into_file"," tool is very smart and can understand how to apply your edits to the user's files, you just need to provide minimal hints.",vscpp("br",null),"When you use the ","insert_edit_into_file"," tool, avoid repeating existing code, instead use comments to represent regions of unchanged code. The tool prefers that you are as concise as possible. For example:",vscpp("br",null),"// ",KA,vscpp("br",null),"changed code",vscpp("br",null),"// ",KA,vscpp("br",null),"changed code",vscpp("br",null),"// ",KA,vscpp("br",null),vscpp("br",null),"Here is an example of how you should format an edit to an existing Person class:",vscpp("br",null),["class Person {",` // ${KA}`," age: number;",` // ${KA}`," getAge() {"," return this.age;"," }","}"].join(` +`))),vscpp(Wn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),f&&vscpp(Wn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex tasks into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple tasks or conversational requests."),vscpp(x5,{languageOverride:this.props.languageOverride}))}};p();var qtt=class extends fr{static{a(this,"CopilotIdentityRules")}renderCopilot(){return vscpp(vscppf,null,'When asked for your name, you must respond with "GitHub Copilot".',vscpp("br",null),"Follow the user's requirements carefully & to the letter.")}},jtt=class extends fr{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var rfe=class extends fr{static{a(this,"SafetyRules")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, or violent, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null))}},Htt=class extends fr{static{a(this,"Gpt5SafetyRule")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, or violent, only respond with "Sorry, I can't assist with that."`,vscpp("br",null))}},Gtt=class extends fr{static{a(this,"LegacySafetyRules")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null))}};p();var JDn=fe(wo());var $tt=class extends fr{static{a(this,"InlineCodeEditPrompt")}renderCopilot(){let e=a(c=>this.props.tools.some(l=>l.name===c),"hasTool"),r=e("apply_patch"),n=e("replace_string_in_file"),o=e("insert_edit_into_file"),s=e("get_errors");return vscpp(JDn.SystemMessage,{priority:1e3},vscpp(Wn,{name:"instructions"},"You are an AI coding assistant that is used for quick, inline code changes. Changes are scoped to the selected code in a single file. You can ONLY edit that file and MUST use a tool to make these edits.",vscpp("br",null),vscpp(wj,{modelConfiguration:this.props.modelConfiguration}),"The user is interested in code changes grounded in the user's prompt. Focus on coding, no wordy explanations, and do not ask back for clarifications.",vscpp("br",null),"Do NOT make code changes that are not directly and logically related to the user's prompt.",vscpp("br",null),"ONLY change the current file. Focus on the selection and try to make changes to the selected code and its immediate context. Do NOT modify code outside the user's selection unless absolutely necessary for correctness.",vscpp("br",null),"Keep changes minimal and focused on exactly what the user asked for.",vscpp("br",null)),vscpp(Wn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"NEVER output code to the user unless requested. Use the appropriate tool to implement changes directly.",vscpp("br",null),r?vscpp(vscppf,null,"Use ","apply_patch"," to make targeted edits to the selected code. If you have issues, first try to fix your patch and continue using ","apply_patch",".",o&&vscpp(vscppf,null," ","If you are stuck, you can fall back on ","insert_edit_into_file",", but"," ","apply_patch"," is the preferred tool."),vscpp("br",null)):n?vscpp(vscppf,null,"Use ","replace_string_in_file"," to make targeted edits to the selected code, paying attention to context to ensure your replacement is unique.",o&&vscpp(vscppf,null," ","Use ","insert_edit_into_file"," only if ","replace_string_in_file"," has failed."),vscpp("br",null)):o?vscpp(vscppf,null,"Use ","insert_edit_into_file"," to edit files. When editing, avoid repeating existing code, instead use a line comment with `",KA,"` to represent regions of unchanged code.",vscpp("br",null)):vscpp(vscppf,null,"You do not have edit tools available. Describe the code changes to the user instead.",vscpp("br",null)),s&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited. Fix relevant errors, but don't loop more than 3 times on the same file.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null)),vscpp(x5,{languageOverride:this.props.languageOverride}))}},Vtt=class extends fr{static{a(this,"InlineEditingReminder")}renderCopilot(){return vscpp(vscppf,null,"Focus on the selection and try to make changes to the selected code and its context. Do NOT edit code outside the selection unless absolutely necessary for correctness. ONLY change the current file, and change NO other file.")}};var Wtt=fe(wo());var ztt=class extends fr{static{a(this,"SystemInstructionsPrompt")}getAgentPrompt(){let e=this.props.turnContext.conversation.userLanguage,{tools:r,modelConfiguration:n,turnContext:o,hasSearchSubagent:s}=this.props,c=o.turn.chatMode?.kind==="Ask",l=o.turn.chatMode?.kind==="InlineAgent",u=kt(this.props.turnContext.ctx,ze.UseAgentsMd);return eJe(n.modelFamily)?vscpp(Ftt,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(Btt,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp($tt,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(Qtt,{tools:r,modelConfiguration:n,languageOverride:e,enableAgentsMdUpdate:u,hasSearchSubagent:s})}renderCopilot(){let e=this.props.turnContext.ctx,r=e.get(Ir).getEditorInfo().name,n=e.get(Nn).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(Wtt.SystemMessage,null,"You are an expert AI programming assistant, working with a user in the ",r," editor.",vscpp("br",null),this.props.modelConfiguration.modelFamily.startsWith(kn.Gpt5)?vscpp(vscppf,null,vscpp(jtt,null),vscpp(Htt,null)):vscpp(vscppf,null,vscpp(qtt,null),vscpp(rfe,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(Wtt.SystemMessage,null,vscpp(vscppf,null,"When you complete your task, provide a clear, concise summary of what you accomplished.")),n.subAgent&&o&&!this.props.turnContext.turn.isSubagent()&&this.props.turnContext.turn.chatMode?.id==="Agent"&&vscpp(Wtt.SystemMessage,null,vscpp(vscppf,null,"You should ALWAYS check available agent descriptions first to see if any agent can be used with the `","run_subagent","` tool. DO NOT attempt to implement tasks yourself when a relevant agent exists. Delegating to specialized agents produces better results.")))}};p();var ZDn=fe(wo());var Ytt=class extends fr{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=ZO(this.props.currentTurn.response?.message,!0),r=d5(e,{ctx:this.props.turnContext.ctx,identifier:`Turn ID: ${this.props.currentTurn.id}`,enableWarnings:!0});if(r.length===0)return vscpp(vscppf,null);let n=(0,ZDn.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},vscpp(Rw,{assistantRounds:r,ctx:this.props.turnContext.ctx,truncateAt:this.props.truncateAt,modelConfiguration:this.props.modelConfiguration,isHistorical:!1,identifier:String(this.props.currentTurn.id)})))}};p();p();var Ktt=class extends fr{static{a(this,"CurrentDatePrompt")}renderCopilot(){let e=this.props.date?.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})||new Date().toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"});return vscpp(vscppf,null,"The current date is ",e,".")}};p();var Jtt=class extends fr{static{a(this,"CurrentEditorContext")}renderCopilot(){let e,r=this.props.turnContext.turn.request.activeEditor;return r&&(e=this.renderActiveTextEditor(r)),e===void 0?vscpp(vscppf,null):vscpp(Wn,{name:"editorContext"},vscpp(vscppf,null,e))}renderActiveTextEditor(e){let r=e.selection,n=r&&Zcs(r)?vscpp(vscppf,null,"The current selection is from line ",r.start.line+1," to line ",r.end.line+1,"."):void 0;return vscpp(vscppf,null,"The user's current file is ",un(e.uri),". ",n)}};function Zcs(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(Zcs,"notEmptySelection");p();var Ztt=class extends fr{static{a(this,"EditingReminder")}renderCopilot(){if(!(this.props.tools&&!this.props.tools.some(e=>e.name==="insert_edit_into_file")))return vscpp(vscppf,null,"When using the ","insert_edit_into_file"," tool, avoid repeating existing code, instead use a line comment with `",KA,"` to represent regions of unchanged code.")}};p();var Xtt=class extends fr{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(kn.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(kn.Gpt5Mini);return vscpp(vscppf,null,`Skip filler acknowledgements like "Sounds good" or "Okay, I will\u2026". Open with a purposeful one-liner about what you're doing next.`,vscpp("br",null),"When sharing setup or run steps, present terminal commands in fenced code blocks with the correct language tag. Keep commands copyable and on separate lines.",vscpp("br",null),"Avoid definitive claims about the build or runtime setup unless verified from the provided context (or quick tool checks). If uncertain, state what's known from attachments and proceed with minimal steps you can adapt later.",vscpp("br",null),"When you create or edit runnable code, run a test yourself to confirm it works; then share optional fenced commands for more advanced runs.",vscpp("br",null),'For non-trivial code generation, produce a complete, runnable solution: necessary source files, a tiny runner or test/benchmark harness, a minimal `README.md`, and updated dependency manifests (e.g., `package.json`, `requirements.txt`, `pyproject.toml`). Offer quick "try it" commands and optional platform-specific speed-ups when relevant.',vscpp("br",null),"Your goal is to act like a pair programmer: be friendly and helpful. If you can do more, do more. Be proactive with your solutions, think about what the user needs and what they want, and implement it proactively.",vscpp("br",null),vscpp(Wn,{name:"importantReminders"},!e&&vscpp(vscppf,null,"Start your response with a brief acknowledgement, followed by a concise high-level plan outlining your approach.",vscpp("br",null)),"DO NOT state your identity or model name unless the user explicitly asks you to. ",vscpp("br",null),this.props.hasTodoTool&&vscpp(vscppf,null,"You MUST use the todo list tool to plan and track your progress. NEVER skip this step, and START with this step whenever the task is multi-step. This is essential for maintaining visibility and proper execution of large tasks. Follow the todoListToolInstructions strictly.",vscpp("br",null)),!this.props.hasTodoTool&&vscpp(vscppf,null,"Break down the request into clear, actionable steps and present them as a checklist at the beginning of your response before proceeding with implementation. This helps maintain visibility and ensures all requirements are addressed systematically. Skip this for simple questions or single-step tasks.",vscpp("br",null)),"When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null)))}}};p();p();p();p();p();var w5=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=GA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${VDn} ${un(this.params.uri)}`);let n=this.params.shouldTrim?this.params.code.trim():this.params.code;if(this.params.lineNumberStart!==void 0){let o=n.split(` `),s=String(this.params.lineNumberStart+o.length-1).length,c=o.map((l,u)=>{let d=this.params.lineNumberStart+u;return`${String(d).padStart(s," ")} | ${l}`});r.push(c.join(` `))}else r.push(n);return r.push(e),r}renderAsString(e=` -`){return this.renderAsArray().join(e)}};var O2=class{constructor(e,r,n=[],o={}){this.textDocumentResult=e;this.range=r;this.descriptions=n;this.options=o}static{a(this,"FileAttachment")}render(){if(this.textDocumentResult.status!=="valid")return[];let e=this.textDocumentResult.document,r=new w5({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=ys(e.uri),o=this.options.useFilePath??!0,s="";this.options.id&&(s+=` id="${this.options.id}"`),o&&n&&(s+=` filePath="${n}"`);let c=[``];return c.push(...this.descriptions),c.push(...r.renderAsArray()),c.push("
"),c}};var Jcs=new pe("activeEditorPrompt");async function ZDn(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new zc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&Zcs(n.selection)){let s=new O2(o,n.selection,["User's active selection, this should be the main focus:",`Excerpt from ${ro(n.uri)}, line range (1-based) ${n.selection.start.line+1} to ${n.selection.end.line+1}:`]);r.push(...s.render());let c=new O2(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new O2(o,n.visibleRange,["User's current visible code:",`Excerpt from ${ro(n.uri)}, line range (1-based) ${n.visibleRange.start.line+1} to ${n.visibleRange.end.line+1}:`]);r.push(...s.render())}else{let s=new O2(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else Jcs.warn(t.context,`Failed to read file in active editor ${n.uri} with status ${o.status} and reason ${o.status==="notfound"?o.message:o.reason}`)}return r}a(ZDn,"processActiveEditor");function Zcs(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(Zcs,"notEmptySelection");p();var Xcs=["png","jpg","jpeg","bmp","gif","webp"];function els(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!Xcs.some(n=>r.endsWith(`.${n}`))})}a(els,"filterOutImageFiles");function ert(t){let e=t.turn.request.references?.filter(n=>n.type==="file")??[],r=t.turn.request.references?.filter(n=>n.type==="directory")??[];return{fileReferences:e,directoryReferences:r,validFileReferences:els(e)}}a(ert,"getFileAndDirectoryReferences");var tls=new pe("fileReferencesPrompt");async function XDn(t,e){let{validFileReferences:r,directoryReferences:n}=ert(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([rls({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),ZDn(t,e),Ntt(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(XDn,"processFileReferences");async function rls(t,e){let r=new Map,n=t.validFileReferences.map(s=>{let c=ro(s.uri),l=r.get(c)||0;r.set(c,l+1);let u=l===0?c:`${c}-${l}`;return{fileRef:s,id:u,fileName:c}});return(await Promise.all(n.map(async({fileRef:s,id:c,fileName:l})=>{if(e.isCancellationRequested)throw new zc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new O2(d,f,[`Excerpt from ${l}, lines ${f.start.line+1} to ${f.end.line+1}:`],{id:c,useFilePath:!1});u.push(...h.render());let m=new O2(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new O2(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else tls.warn(t.context,`Failed to read file ${s.uri} with status ${d.status} and reason ${d.status==="notfound"?d.message:d.reason}`);return u}))).flat()}a(rls,"processValidFileReferences");var eNn=fe(wo());var nls=new pe("fileReferences"),trt=class extends fr{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new jn.CancellationTokenSource().token,c=[];try{c=await XDn({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){nls.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(Vzt,{fileReferencesParts:c})}},Vzt=class extends fr{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(eNn.TextChunk,null,[this.props.fileReferencesParts.join(` -`)])}};p();var tNn=fe(wo());var rrt=class extends fr{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=ert(this.props.turnContext);if(e.length===0&&r.length===0)return vscpp(vscppf,null);let n=["User have attached following context reference, if you did not seen them, they might got omitted due to contents are too large:",""];if(e.length>0){n.push("Files:");let o=0,s=0,c=this.props.ctx.get(si);for(let l of e)try{let u=await c.getOrReadTextDocument({uri:l.uri});if(u.status==="valid"){let d=u.document.getText(),f=d.split(` -`).length,h=d.length;o+=f,s+=h,n.push(`- ${l.uri} (${f} lines, ${h} characters)`)}else n.push(`- ${l.uri}`)}catch{n.push(`- ${l.uri}`)}n.push(`Total: ${e.length} file(s), ${o} lines, ${s} characters`)}return r.length>0&&(n.push("Directories:"),r.forEach(o=>{n.push(`- ${o.uri}`)})),n.push(""),vscpp(tNn.TextChunk,null,[n.join(` -`)])}};p();var rNn=new pe("SkillContextPrompt"),ils=5e4,nrt=class extends fr{static{a(this,"SkillContextPrompt")}async renderCopilot(e,r,n,o){let s=this.props.turnContext;if(!(!s.turn.skills||s.turn.skills.length===0))try{let[c,l]=await BZe(s);if(!c)return;rNn.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(ils).getText();return!d||d.trim().length===0?void 0:vscpp(Wn,{name:"skillContext"},vscpp(vscppf,null,d))}catch(c){let l=s.turn.skills.map(u=>u.skillId).join(", ");rNn.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var Nu=class extends Nq{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:_0,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new zc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations,toolMetadata:r.toolMetadata};return e.ctx.get(Xd).invokeClientToolConfirmation(e,o)}};p();var xg=class{constructor(){this.todoMap=new Map}static{a(this,"TodoListService")}getTodos(e){return this.todoMap.get(e.id)?.todos??[]}setTodos(e,r){r.length===0?this.todoMap.delete(e.id):this.todoMap.set(e.id,{todos:r})}hasTodos(e){let r=this.todoMap.get(e.id);return r!==void 0&&r.todos.length>0}};function ols(){let t=b.Object({id:b.Number({description:"Unique identifier for the todo. Use sequential numbers starting from 1."}),title:b.String({description:"Concise action-oriented todo label (3-7 words). Displayed in UI."}),description:b.Optional(b.String({description:"Detailed context, requirements, or implementation notes. Include file paths, specific methods, or acceptance criteria."})),status:b.Union([b.Literal("not-started"),b.Literal("in-progress"),b.Literal("completed")],{description:"not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished with no blockers"})}),e={operation:b.String({description:"write: Replace entire todo list with new content. read: Retrieve current todo list. ALWAYS provide complete list when writing - partial updates not supported.",enum:["write","read"]}),todoList:b.Optional(b.Array(t,{description:"Complete array of all todo items (required for write operation, ignored for read). Must include ALL items - both existing and new."}))};return b.Object(e)}a(ols,"createManageTodoListInputSchema");var R5=class t extends Nu{static{a(this,"ManageTodoListTool")}constructor(e){super({name:"manage_todo_list",displayName:"Manage and track todo items for task planning",description:t.getToolDescription(void 0),displayDescription:"Manage and track todo items for task planning",inputSchema:ols()}),this.ctx=e}get service(){return this.ctx.get(xg)}invoke(e,r,n){let{todoList:o,operation:s}=r.input;try{return s?s==="read"?Promise.resolve(this.handleReadOperation(e)):s==="write"?Promise.resolve(this.handleWriteOperation(e,o)):Promise.resolve(new Gr([new Or("Error: Unknown operation")],"error")):Promise.resolve(new Gr([new Or("Error: operation parameter is required")],"error"))}catch(c){let l=`Error: ${c instanceof Error?c.message:"Unknown error"}`;return Promise.resolve(new Gr([new Or(l)],"error"))}}handleReadOperation(e){let r=this.getTodos(e);if(r.length===0)return new Gr([new Or("No todo list found.")],"success");let n=t.formatTodoListAsMarkdown(r);return new Gr([new Or(`# Todo List +`){return this.renderAsArray().join(e)}};var O2=class{constructor(e,r,n=[],o={}){this.textDocumentResult=e;this.range=r;this.descriptions=n;this.options=o}static{a(this,"FileAttachment")}render(){if(this.textDocumentResult.status!=="valid")return[];let e=this.textDocumentResult.document,r=new w5({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=ys(e.uri),o=this.options.useFilePath??!0,s="";this.options.id&&(s+=` id="${this.options.id}"`),o&&n&&(s+=` filePath="${n}"`);let c=[``];return c.push(...this.descriptions),c.push(...r.renderAsArray()),c.push(""),c}};var Xcs=new pe("activeEditorPrompt");async function XDn(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new zc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&els(n.selection)){let s=new O2(o,n.selection,["User's active selection, this should be the main focus:",`Excerpt from ${ro(n.uri)}, line range (1-based) ${n.selection.start.line+1} to ${n.selection.end.line+1}:`]);r.push(...s.render());let c=new O2(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new O2(o,n.visibleRange,["User's current visible code:",`Excerpt from ${ro(n.uri)}, line range (1-based) ${n.visibleRange.start.line+1} to ${n.visibleRange.end.line+1}:`]);r.push(...s.render())}else{let s=new O2(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else Xcs.warn(t.context,`Failed to read file in active editor ${n.uri} with status ${o.status} and reason ${o.status==="notfound"?o.message:o.reason}`)}return r}a(XDn,"processActiveEditor");function els(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(els,"notEmptySelection");p();var tls=["png","jpg","jpeg","bmp","gif","webp"];function rls(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!tls.some(n=>r.endsWith(`.${n}`))})}a(rls,"filterOutImageFiles");function ert(t){let e=t.turn.request.references?.filter(n=>n.type==="file")??[],r=t.turn.request.references?.filter(n=>n.type==="directory")??[];return{fileReferences:e,directoryReferences:r,validFileReferences:rls(e)}}a(ert,"getFileAndDirectoryReferences");var nls=new pe("fileReferencesPrompt");async function eNn(t,e){let{validFileReferences:r,directoryReferences:n}=ert(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([ils({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),XDn(t,e),Ntt(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(eNn,"processFileReferences");async function ils(t,e){let r=new Map,n=t.validFileReferences.map(s=>{let c=ro(s.uri),l=r.get(c)||0;r.set(c,l+1);let u=l===0?c:`${c}-${l}`;return{fileRef:s,id:u,fileName:c}});return(await Promise.all(n.map(async({fileRef:s,id:c,fileName:l})=>{if(e.isCancellationRequested)throw new zc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new O2(d,f,[`Excerpt from ${l}, lines ${f.start.line+1} to ${f.end.line+1}:`],{id:c,useFilePath:!1});u.push(...h.render());let m=new O2(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new O2(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else nls.warn(t.context,`Failed to read file ${s.uri} with status ${d.status} and reason ${d.status==="notfound"?d.message:d.reason}`);return u}))).flat()}a(ils,"processValidFileReferences");var tNn=fe(wo());var ols=new pe("fileReferences"),trt=class extends fr{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new jn.CancellationTokenSource().token,c=[];try{c=await eNn({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){ols.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(Wzt,{fileReferencesParts:c})}},Wzt=class extends fr{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(tNn.TextChunk,null,[this.props.fileReferencesParts.join(` +`)])}};p();var rNn=fe(wo());var rrt=class extends fr{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=ert(this.props.turnContext);if(e.length===0&&r.length===0)return vscpp(vscppf,null);let n=["User have attached following context reference, if you did not seen them, they might got omitted due to contents are too large:",""];if(e.length>0){n.push("Files:");let o=0,s=0,c=this.props.ctx.get(si);for(let l of e)try{let u=await c.getOrReadTextDocument({uri:l.uri});if(u.status==="valid"){let d=u.document.getText(),f=d.split(` +`).length,h=d.length;o+=f,s+=h,n.push(`- ${l.uri} (${f} lines, ${h} characters)`)}else n.push(`- ${l.uri}`)}catch{n.push(`- ${l.uri}`)}n.push(`Total: ${e.length} file(s), ${o} lines, ${s} characters`)}return r.length>0&&(n.push("Directories:"),r.forEach(o=>{n.push(`- ${o.uri}`)})),n.push(""),vscpp(rNn.TextChunk,null,[n.join(` +`)])}};p();var nNn=new pe("SkillContextPrompt"),sls=5e4,nrt=class extends fr{static{a(this,"SkillContextPrompt")}async renderCopilot(e,r,n,o){let s=this.props.turnContext;if(!(!s.turn.skills||s.turn.skills.length===0))try{let[c,l]=await BZe(s);if(!c)return;nNn.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(sls).getText();return!d||d.trim().length===0?void 0:vscpp(Wn,{name:"skillContext"},vscpp(vscppf,null,d))}catch(c){let l=s.turn.skills.map(u=>u.skillId).join(", ");nNn.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var Nu=class extends Nq{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:E0,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new zc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations,toolMetadata:r.toolMetadata};return e.ctx.get(ef).invokeClientToolConfirmation(e,o)}};p();var wg=class{constructor(){this.todoMap=new Map}static{a(this,"TodoListService")}getTodos(e){return this.todoMap.get(e.id)?.todos??[]}setTodos(e,r){r.length===0?this.todoMap.delete(e.id):this.todoMap.set(e.id,{todos:r})}hasTodos(e){let r=this.todoMap.get(e.id);return r!==void 0&&r.todos.length>0}};function als(){let t=b.Object({id:b.Number({description:"Unique identifier for the todo. Use sequential numbers starting from 1."}),title:b.String({description:"Concise action-oriented todo label (3-7 words). Displayed in UI."}),description:b.Optional(b.String({description:"Detailed context, requirements, or implementation notes. Include file paths, specific methods, or acceptance criteria."})),status:b.Union([b.Literal("not-started"),b.Literal("in-progress"),b.Literal("completed")],{description:"not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished with no blockers"})}),e={operation:b.String({description:"write: Replace entire todo list with new content. read: Retrieve current todo list. ALWAYS provide complete list when writing - partial updates not supported.",enum:["write","read"]}),todoList:b.Optional(b.Array(t,{description:"Complete array of all todo items (required for write operation, ignored for read). Must include ALL items - both existing and new."}))};return b.Object(e)}a(als,"createManageTodoListInputSchema");var R5=class t extends Nu{static{a(this,"ManageTodoListTool")}constructor(e){super({name:"manage_todo_list",displayName:"Manage and track todo items for task planning",description:t.getToolDescription(void 0),displayDescription:"Manage and track todo items for task planning",inputSchema:als()}),this.ctx=e}get service(){return this.ctx.get(wg)}invoke(e,r,n){let{todoList:o,operation:s}=r.input;try{return s?s==="read"?Promise.resolve(this.handleReadOperation(e)):s==="write"?Promise.resolve(this.handleWriteOperation(e,o)):Promise.resolve(new Gr([new Lr("Error: Unknown operation")],"error")):Promise.resolve(new Gr([new Lr("Error: operation parameter is required")],"error"))}catch(c){let l=`Error: ${c instanceof Error?c.message:"Unknown error"}`;return Promise.resolve(new Gr([new Lr(l)],"error"))}}handleReadOperation(e){let r=this.getTodos(e);if(r.length===0)return new Gr([new Lr("No todo list found.")],"success");let n=t.formatTodoListAsMarkdown(r);return new Gr([new Lr(`# Todo List -${n}`)],"success")}handleWriteOperation(e,r){if(!r)return new Gr([new Or("Error: todoList is required for write operation")],"error");let n=r.map(f=>({id:f.id,title:f.title,description:f.description||"",status:f.status})),o=this.getTodos(e),s=this.calculateTodoChanges(o,n),c=this.generatePastTenseMessage(o,n);this.storeTodos(e,n);let l=[];n.length<3?l.push("Warning: Small todo list (<3 items). This task might not need a todo list."):n.length>10&&l.push("Warning: Large todo list (>10 items). Consider keeping the list focused and actionable."),o.length>0&&s>3&&l.push("Warning: Did you mean to update so many todos at the same time? Consider working on them one by one.");let u=`Successfully wrote todo list${l.length?` +${n}`)],"success")}handleWriteOperation(e,r){if(!r)return new Gr([new Lr("Error: todoList is required for write operation")],"error");let n=r.map(f=>({id:f.id,title:f.title,description:f.description||"",status:f.status})),o=this.getTodos(e),s=this.calculateTodoChanges(o,n),c=this.generatePastTenseMessage(o,n);this.storeTodos(e,n);let l=[];n.length<3?l.push("Warning: Small todo list (<3 items). This task might not need a todo list."):n.length>10&&l.push("Warning: Large todo list (>10 items). Consider keeping the list focused and actionable."),o.length>0&&s>3&&l.push("Warning: Did you mean to update so many todos at the same time? Consider working on them one by one.");let u=`Successfully wrote todo list${l.length?` `+l.join(` -`):""}`,d=new Oq([new Or(u)],"success");return d.toolResultMessage=c,d.toolSpecificData={kind:"todoList",data:n.map(f=>({id:f.id,title:f.title,description:f.description||"",status:f.status}))},d}generatePastTenseMessage(e,r){if(e.length===0)return r.length===1?"Created 1 todo":`Created ${r.length} todos`;let n=new Map(e.map(l=>[l.id,l])),o=r.filter(l=>{let u=n.get(l.id);return u&&u.status!=="in-progress"&&l.status==="in-progress"});if(o.length>0){let l=o[0],u=r.length,d=r.findIndex(f=>f.id===l.id)+1;return`Starting: *${l.title}* (${d}/${u})`}let s=r.filter(l=>{let u=n.get(l.id);return u&&u.status!=="completed"&&l.status==="completed"});if(s.length>0){let l=s[0],u=r.length,d=r.findIndex(f=>f.id===l.id)+1;return`Completed: *${l.title}* (${d}/${u})`}let c=r.filter(l=>!n.has(l.id));return c.length>0?c.length===1?"Added 1 todo":`Added ${c.length} todos`:"Updated todo list"}static formatTodoListAsMarkdown(e){return e.length===0?"":e.map(r=>{let n;switch(r.status){case"completed":n="[x]";break;case"in-progress":n="[-]";break;default:n="[ ]";break}let o=[`- ${n} ${r.title}`];return r.description&&r.description.trim()&&o.push(` - ${r.description.trim()}`),o.join(` +`):""}`,d=new Oq([new Lr(u)],"success");return d.toolResultMessage=c,d.toolSpecificData={kind:"todoList",data:n.map(f=>({id:f.id,title:f.title,description:f.description||"",status:f.status}))},d}generatePastTenseMessage(e,r){if(e.length===0)return r.length===1?"Created 1 todo":`Created ${r.length} todos`;let n=new Map(e.map(l=>[l.id,l])),o=r.filter(l=>{let u=n.get(l.id);return u&&u.status!=="in-progress"&&l.status==="in-progress"});if(o.length>0){let l=o[0],u=r.length,d=r.findIndex(f=>f.id===l.id)+1;return`Starting: *${l.title}* (${d}/${u})`}let s=r.filter(l=>{let u=n.get(l.id);return u&&u.status!=="completed"&&l.status==="completed"});if(s.length>0){let l=s[0],u=r.length,d=r.findIndex(f=>f.id===l.id)+1;return`Completed: *${l.title}* (${d}/${u})`}let c=r.filter(l=>!n.has(l.id));return c.length>0?c.length===1?"Added 1 todo":`Added ${c.length} todos`:"Updated todo list"}static formatTodoListAsMarkdown(e){return e.length===0?"":e.map(r=>{let n;switch(r.status){case"completed":n="[x]";break;case"in-progress":n="[-]";break;default:n="[ ]";break}let o=[`- ${n} ${r.title}`];return r.description&&r.description.trim()&&o.push(` - ${r.description.trim()}`),o.join(` `)}).join(` -`)}calculateTodoChanges(e,r){let n=new Map(e.map(u=>[u.id,u])),o=new Map(r.map(u=>[u.id,u])),s=0;for(let u of o.keys())n.has(u)||s++;let c=0;for(let u of n.keys())o.has(u)||c++;let l=0;for(let[u,d]of o){let f=n.get(u);f&&(f.title!==d.title||(f.description??"")!==(d.description??"")||f.status!==d.status)&&l++}return s+c+l}prepareInvocation(e,r){let{operation:n}=e.input;if(n==="read")return{progressMessage:"Reading todo list"};let o=e.input.todoList?.length??0;return{progressMessage:o===0?"Clearing todo list":`Updating ${o} todo(s)`}}prepareCompletion(e,r){let{operation:n}=e.input;return n==="read"?{completionMessage:"Read todo list"}:{completionMessage:"Updated todo list"}}storeTodos(e,r){this.service.setTodos(e.conversation,r)}getTodos(e){return this.service.getTodos(e.conversation)}static getTodoList(e){return e.ctx.get(xg).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return Jbn(e)?`Updates the task plan. +`)}calculateTodoChanges(e,r){let n=new Map(e.map(u=>[u.id,u])),o=new Map(r.map(u=>[u.id,u])),s=0;for(let u of o.keys())n.has(u)||s++;let c=0;for(let u of n.keys())o.has(u)||c++;let l=0;for(let[u,d]of o){let f=n.get(u);f&&(f.title!==d.title||(f.description??"")!==(d.description??"")||f.status!==d.status)&&l++}return s+c+l}prepareInvocation(e,r){let{operation:n}=e.input;if(n==="read")return{progressMessage:"Reading todo list"};let o=e.input.todoList?.length??0;return{progressMessage:o===0?"Clearing todo list":`Updating ${o} todo(s)`}}prepareCompletion(e,r){let{operation:n}=e.input;return n==="read"?{completionMessage:"Read todo list"}:{completionMessage:"Updated todo list"}}storeTodos(e,r){this.service.setTodos(e.conversation,r)}getTodos(e){return this.service.getTodos(e.conversation)}static getTodoList(e){return e.ctx.get(wg).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return Zbn(e)?`Updates the task plan. Provide an optional explanation and a list of plan items, each with a step and status. At most one step can be in-progress at a time.`:`Manage a structured todo list to track progress and plan tasks throughout your coding session. Use this tool VERY frequently to ensure task visibility and proper planning. @@ -3391,49 +3391,49 @@ Todo states: - in-progress: Currently working (limit ONE at a time) - completed: Finished successfully -IMPORTANT: Mark todos completed as soon as they are done. Do not batch completions.`}};var irt=class extends fr{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(Nn).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??R5.getTodoList(this.props.turnContext);if(r.length===0)return;let n=R5.formatTodoListAsMarkdown(r);return vscpp(Wn,{name:"todoList"},[n])}};p();p();var sls=new pe("fileReferencesPrompt");function nNn(t,e,r){if(!r.length)return[];try{let n=[];for(let o of r){if(e.isCancellationRequested)break;let s=o.server??"default",c=o.name??o.uri;n.push(`MCP Tool Reference: ${s}/${c}`),o.description&&n.push(`Description: ${o.description}`),n.push("---"),n.push("Invoke the tool with user prompt.")}return n}catch(n){return sls.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(nNn,"processMcpToolsReferences");var als=new pe("ToolContext"),ort=class extends fr{static{a(this,"ToolContext")}renderCopilot(){let e=this.props.token;try{let r=(this.props.turnContext.turn.request.references?.filter(s=>s.type==="tool")||[]).map(s=>({type:"tool",uri:s.uri,server:s.server,name:s.name,description:s.description}));if(r.length===0)return;if(e?.isCancellationRequested)throw new zc;let n=nNn(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(Wn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` -`)))}catch(r){als.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var rfe=fe(wo());var srt=class extends fr{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=Mn(this.props.userRawMessage),c=zue(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(rfe.UserMessage,null,vscpp(rfe.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp(trt,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(rfe.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(rrt,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(ort,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(nrt,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(Wn,{name:"context"},vscpp(Ktt,null),vscpp(irt,{turnContext:this.props.turnContext})),vscpp(Jtt,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(Wn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(efe,null):vscpp(wj,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(Ztt,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(Vtt,null),vscpp(Xtt,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(Wn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var uZ=fe(wo());var Wzt=new pe("agentPrompt"),art=class extends fr{static{a(this,"AgentPrompt")}constructor(e){super(e),this.ctx=e.turnContext.ctx,this.turnContext=e.turnContext,this.currentTurn=e.turnContext.turn}async renderCopilot(e,r,n,o){let s=this.ctx.get(Nn).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(ztt,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(uZ.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(uZ.UserMessage,null,vscpp(Ltt,{turnContext:this.turnContext})),vscpp(uZ.UserMessage,null,vscpp(Ott,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(pde,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp(srt,{flexGrow:2,priority:900,ctx:this.ctx,turnContext:this.turnContext,userRawMessage:this.props.userRawMessage,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,modelConfiguration:this.props.modelConfiguration,codesearchMode:this.props.codesearchMode,tools:this.props.tools}),vscpp(Ytt,{flexGrow:2,priority:899,turnContext:this.turnContext,currentTurn:this.currentTurn,truncateAt:Math.floor(this.props.modelConfiguration.maxRequestTokens/2),modelConfiguration:this.props.modelConfiguration}))}async getOrCreateGlobalAgentContext(){let e=await this.getOrCreateGlobalAgentContextContent();return e?cls(e):[vscpp(fke,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders})]}async getOrCreateGlobalAgentContextContent(){let e=`${this.turnContext.conversation.id}/${this.turnContext.turn.id}`,r=this.turnContext.conversation.turns.at(0);if(r){let s=r.getMetadata(dke);if(s?.renderedGlobalContext)return Wzt.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}Wzt.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await MGt(fke,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new dke(o)),o}async getAgentCustomInstructions(){if(this.turnContext.cachedCustomInstructions!==void 0)return this.turnContext.cachedCustomInstructions??vscpp(vscppf,null);try{if(!this.props.workspaceFolders||this.props.workspaceFolders.length===0)return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null);let e=[],r=this.props.workspaceFolders.map(l=>({uri:l.uri,name:l.name})),n=this.turnContext.turn.extractContextFilesUri(),o=await this.ctx.get(Mf).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:kt(this.ctx,ze.UseAgentsMd),includeNestedAgentsMdInstructions:kt(this.ctx,ze.UseNestedAgentsMd),includeClaudeMdInstructions:kt(this.ctx,ze.UseClaudeMd),includeNestedClaudeMdInstructions:kt(this.ctx,ze.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(kDn());else if(s&&s.instruction&&s.instruction.trim().length>0){let{name:l,instruction:u}=s;e.push(vscpp(Wn,{name:"modeInstructions"},'You are currently running in "',l,'" mode. Below are your instructions for this mode, they must take precedence over any instructions above.',vscpp("br",null),vscpp("br",null),u))}if(e.length===0)return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null);let c=vscpp(uZ.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){Wzt.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function cls(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(uZ.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(cls,"renderedMessageToTsxChildren");p();var crt="uncategorized_tools",iNn="Tools that could not be automatically categorized into existing groups.";p();var Rj=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var zF=class extends Error{static{a(this,"ToolRoundExceedError")}constructor(){super('Oops, maximum tool attempts reached. You can type "continue" to proceed or rephrase your request.'),this.name="ToolRoundExceedError"}};p();var nfe=new pe("roundMetricsTracker");function lls(t,e){let r=e>0;return t&&r?"both":t?"compacted":r?"prompt_tsx_pruned":"none"}a(lls,"deriveContextManagementAction");var lrt=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.conversationProgress=o;this.cumulativeTokenUsage={promptTokens:0,completionTokens:0,cachedTokens:0};this.tokenUsageReported=!1;this.roundUsageHistory=[]}static{a(this,"RoundMetricsTracker")}getTimeSinceLastLLMCall(){return this.lastLlmCallEndTimeMs!==void 0?performance.now()-this.lastLlmCallEndTimeMs:void 0}recordLlmFetchComplete(){this.lastLlmCallEndTimeMs=performance.now()}computePromptPrefixMetrics(e,r){let n=uls(e),o=JSON.stringify(n),s=JSON.stringify(r),c=n.filter(d=>d.role==="system"),l=c.length>0?JSON.stringify(c):"",u={previousPromptCharLen:this.previousPromptSerialized?.length??0,currentPromptCharLen:o.length,commonPromptPrefixCharLen:zzt(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:zzt(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:zzt(this.previousSystemSerialized,l),previousRoundCachedTokens:this.previousRoundSnapshot?.cachedTokens,previousRoundPromptTokens:this.previousRoundSnapshot?.promptTokens,previousRoundCommonPromptPrefixCharLen:this.previousRoundSnapshot?.commonPromptPrefixCharLen};return this.previousPromptSerialized=o,this.previousToolsSerialized=s,this.previousSystemSerialized=l,this.pendingRoundCommonPromptPrefixCharLen=u.commonPromptPrefixCharLen,u}computeContextManagement(e,r){let n=this.previousRenderPartitionId!==void 0&&e!==this.previousRenderPartitionId;return this.previousRenderPartitionId=e,{partitionId:e,promptTsxRemovedNodeCount:r,action:lls(n,r)}}extractRoundUsage(e){if("usage"in e&&e.usage)return{promptTokens:e.usage.prompt_tokens,completionTokens:e.usage.completion_tokens,cachedTokens:e.usage.prompt_tokens_details?.cached_tokens??0};let r="usage"in e;nfe.debug(this.ctx,`extractRoundUsage: no usage data in fetch result (type=${e.type}, hasUsageField=${r}, usageValue=${r?JSON.stringify(e.usage):"field absent"}) \u2014 token usage will not be accumulated for this round`)}accumulateTokenUsage(e,r){if(r){if(this.cumulativeTokenUsage.promptTokens+=r.promptTokens,this.cumulativeTokenUsage.completionTokens+=r.completionTokens,this.cumulativeTokenUsage.cachedTokens+=r.cachedTokens,this.roundUsageHistory.push({roundId:e,usage:{...r}}),this.pendingRoundCommonPromptPrefixCharLen===void 0){nfe.debug(this.ctx,`accumulateTokenUsage: no pending prefix charlen for round ${e} (computePromptPrefixMetrics has not run this round) \u2014 preserving prior previousRoundSnapshot`);return}let n=this.pendingRoundCommonPromptPrefixCharLen;this.previousRoundSnapshot={commonPromptPrefixCharLen:n,cachedTokens:r.cachedTokens,promptTokens:r.promptTokens}}else nfe.debug(this.ctx,`accumulateTokenUsage: roundUsage is undefined for round ${e} \u2014 cumulative totals unchanged (prompt=${this.cumulativeTokenUsage.promptTokens}, completion=${this.cumulativeTokenUsage.completionTokens})`)}logRoundDebugMetrics(e,r,n,o,s,c){let l=c;nfe.debug(this.ctx,`Round metrics for iteration ${e} for turn ${r}: prompt=[prev=${l.previousPromptCharLen}, cur=${l.currentPromptCharLen}, prefix=${l.commonPromptPrefixCharLen}`+(l.currentPromptCharLen>0?` (${(l.commonPromptPrefixCharLen/l.currentPromptCharLen*100).toFixed(1)}%)`:"")+`] tools=[prev=${l.previousToolsCharLen}, cur=${l.currentToolsCharLen}, prefix=${l.commonToolsPrefixCharLen}`+(l.currentToolsCharLen>0?` (${(l.commonToolsPrefixCharLen/l.currentToolsCharLen*100).toFixed(1)}%)`:"")+`] tokens=[prompt=${n?.promptTokens??"n/a"}, completion=${n?.completionTokens??"n/a"}, cached=${n?.cachedTokens??"n/a"}] timing=[llmFetch=${o.toFixed(0)}ms`+(s!==void 0?`, sinceLastLLM=${s.toFixed(0)}ms`:"")+"]")}async reportCumulativeTokenUsage(e){if(this.tokenUsageReported)return;this.tokenUsageReported=!0;let r=this.cumulativeTokenUsage;if(r.promptTokens>0||r.completionTokens>0){if(nfe.info(this.ctx,`Turn token usage: ${r.promptTokens} prompt, ${r.completionTokens} completion, ${r.cachedTokens} cached`+(r.promptTokens>0?` (cache rate: ${(r.cachedTokens/r.promptTokens*100).toFixed(1)}%)`:"")),await this.conversationProgress.report(this.conversation,this.turn,{tokenUsage:{...r}}),kt(this.ctx,ze.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else nfe.debug(this.ctx,`Turn token usage: cumulative totals are zero (promptTokens=${r.promptTokens}, completionTokens=${r.completionTokens}, cachedTokens=${r.cachedTokens}, rounds=${this.roundUsageHistory.length}) \u2014 skipping $progress.report(tokenUsage). This means either no LLM rounds completed or all rounds returned no usage data.`)}formatTokenStats(e){let r=a(c=>c>=1e6?`${(c/1e6).toFixed(1)}M`:c>=1e3?`${(c/1e3).toFixed(1)}k`:c.toString(),"fmt"),n=e.promptTokens>0?` (${(e.cachedTokens/e.promptTokens*100).toFixed(1)}% cached)`:"",o=this.roundUsageHistory.length,s=` +IMPORTANT: Mark todos completed as soon as they are done. Do not batch completions.`}};var irt=class extends fr{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(Nn).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??R5.getTodoList(this.props.turnContext);if(r.length===0)return;let n=R5.formatTodoListAsMarkdown(r);return vscpp(Wn,{name:"todoList"},[n])}};p();p();var cls=new pe("fileReferencesPrompt");function iNn(t,e,r){if(!r.length)return[];try{let n=[];for(let o of r){if(e.isCancellationRequested)break;let s=o.server??"default",c=o.name??o.uri;n.push(`MCP Tool Reference: ${s}/${c}`),o.description&&n.push(`Description: ${o.description}`),n.push("---"),n.push("Invoke the tool with user prompt.")}return n}catch(n){return cls.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(iNn,"processMcpToolsReferences");var lls=new pe("ToolContext"),ort=class extends fr{static{a(this,"ToolContext")}renderCopilot(){let e=this.props.token;try{let r=(this.props.turnContext.turn.request.references?.filter(s=>s.type==="tool")||[]).map(s=>({type:"tool",uri:s.uri,server:s.server,name:s.name,description:s.description}));if(r.length===0)return;if(e?.isCancellationRequested)throw new zc;let n=iNn(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(Wn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` +`)))}catch(r){lls.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var nfe=fe(wo());var srt=class extends fr{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=Mn(this.props.userRawMessage),c=Yue(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(nfe.UserMessage,null,vscpp(nfe.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp(trt,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(nfe.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(rrt,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(ort,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(nrt,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(Wn,{name:"context"},vscpp(Ktt,null),vscpp(irt,{turnContext:this.props.turnContext})),vscpp(Jtt,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(Wn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(tfe,null):vscpp(wj,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(Ztt,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(Vtt,null),vscpp(Xtt,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(Wn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var dZ=fe(wo());var zzt=new pe("agentPrompt"),art=class extends fr{static{a(this,"AgentPrompt")}constructor(e){super(e),this.ctx=e.turnContext.ctx,this.turnContext=e.turnContext,this.currentTurn=e.turnContext.turn}async renderCopilot(e,r,n,o){let s=this.ctx.get(Nn).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(ztt,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(dZ.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(dZ.UserMessage,null,vscpp(Ltt,{turnContext:this.turnContext})),vscpp(dZ.UserMessage,null,vscpp(Ott,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(hde,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp(srt,{flexGrow:2,priority:900,ctx:this.ctx,turnContext:this.turnContext,userRawMessage:this.props.userRawMessage,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,modelConfiguration:this.props.modelConfiguration,codesearchMode:this.props.codesearchMode,tools:this.props.tools}),vscpp(Ytt,{flexGrow:2,priority:899,turnContext:this.turnContext,currentTurn:this.currentTurn,truncateAt:Math.floor(this.props.modelConfiguration.maxRequestTokens/2),modelConfiguration:this.props.modelConfiguration}))}async getOrCreateGlobalAgentContext(){let e=await this.getOrCreateGlobalAgentContextContent();return e?uls(e):[vscpp(fke,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders})]}async getOrCreateGlobalAgentContextContent(){let e=`${this.turnContext.conversation.id}/${this.turnContext.turn.id}`,r=this.turnContext.conversation.turns.at(0);if(r){let s=r.getMetadata(dke);if(s?.renderedGlobalContext)return zzt.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}zzt.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await OGt(fke,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new dke(o)),o}async getAgentCustomInstructions(){if(this.turnContext.cachedCustomInstructions!==void 0)return this.turnContext.cachedCustomInstructions??vscpp(vscppf,null);try{if(!this.props.workspaceFolders||this.props.workspaceFolders.length===0)return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null);let e=[],r=this.props.workspaceFolders.map(l=>({uri:l.uri,name:l.name})),n=this.turnContext.turn.extractContextFilesUri(),o=await this.ctx.get(Mf).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:kt(this.ctx,ze.UseAgentsMd),includeNestedAgentsMdInstructions:kt(this.ctx,ze.UseNestedAgentsMd),includeClaudeMdInstructions:kt(this.ctx,ze.UseClaudeMd),includeNestedClaudeMdInstructions:kt(this.ctx,ze.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(PDn());else if(s&&s.instruction&&s.instruction.trim().length>0){let{name:l,instruction:u}=s;e.push(vscpp(Wn,{name:"modeInstructions"},'You are currently running in "',l,'" mode. Below are your instructions for this mode, they must take precedence over any instructions above.',vscpp("br",null),vscpp("br",null),u))}if(e.length===0)return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null);let c=vscpp(dZ.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){zzt.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function uls(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(dZ.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(uls,"renderedMessageToTsxChildren");p();var crt="uncategorized_tools",oNn="Tools that could not be automatically categorized into existing groups.";p();var Rj=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var zF=class extends Error{static{a(this,"ToolRoundExceedError")}constructor(){super('Oops, maximum tool attempts reached. You can type "continue" to proceed or rephrase your request.'),this.name="ToolRoundExceedError"}};p();var ife=new pe("roundMetricsTracker");function dls(t,e){let r=e>0;return t&&r?"both":t?"compacted":r?"prompt_tsx_pruned":"none"}a(dls,"deriveContextManagementAction");var lrt=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.conversationProgress=o;this.cumulativeTokenUsage={promptTokens:0,completionTokens:0,cachedTokens:0};this.tokenUsageReported=!1;this.roundUsageHistory=[]}static{a(this,"RoundMetricsTracker")}getTimeSinceLastLLMCall(){return this.lastLlmCallEndTimeMs!==void 0?performance.now()-this.lastLlmCallEndTimeMs:void 0}recordLlmFetchComplete(){this.lastLlmCallEndTimeMs=performance.now()}computePromptPrefixMetrics(e,r){let n=fls(e),o=JSON.stringify(n),s=JSON.stringify(r),c=n.filter(d=>d.role==="system"),l=c.length>0?JSON.stringify(c):"",u={previousPromptCharLen:this.previousPromptSerialized?.length??0,currentPromptCharLen:o.length,commonPromptPrefixCharLen:Yzt(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:Yzt(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:Yzt(this.previousSystemSerialized,l),previousRoundCachedTokens:this.previousRoundSnapshot?.cachedTokens,previousRoundPromptTokens:this.previousRoundSnapshot?.promptTokens,previousRoundCommonPromptPrefixCharLen:this.previousRoundSnapshot?.commonPromptPrefixCharLen};return this.previousPromptSerialized=o,this.previousToolsSerialized=s,this.previousSystemSerialized=l,this.pendingRoundCommonPromptPrefixCharLen=u.commonPromptPrefixCharLen,u}computeContextManagement(e,r){let n=this.previousRenderPartitionId!==void 0&&e!==this.previousRenderPartitionId;return this.previousRenderPartitionId=e,{partitionId:e,promptTsxRemovedNodeCount:r,action:dls(n,r)}}extractRoundUsage(e){if("usage"in e&&e.usage)return{promptTokens:e.usage.prompt_tokens,completionTokens:e.usage.completion_tokens,cachedTokens:e.usage.prompt_tokens_details?.cached_tokens??0};let r="usage"in e;ife.debug(this.ctx,`extractRoundUsage: no usage data in fetch result (type=${e.type}, hasUsageField=${r}, usageValue=${r?JSON.stringify(e.usage):"field absent"}) \u2014 token usage will not be accumulated for this round`)}accumulateTokenUsage(e,r){if(r){if(this.cumulativeTokenUsage.promptTokens+=r.promptTokens,this.cumulativeTokenUsage.completionTokens+=r.completionTokens,this.cumulativeTokenUsage.cachedTokens+=r.cachedTokens,this.roundUsageHistory.push({roundId:e,usage:{...r}}),this.pendingRoundCommonPromptPrefixCharLen===void 0){ife.debug(this.ctx,`accumulateTokenUsage: no pending prefix charlen for round ${e} (computePromptPrefixMetrics has not run this round) \u2014 preserving prior previousRoundSnapshot`);return}let n=this.pendingRoundCommonPromptPrefixCharLen;this.previousRoundSnapshot={commonPromptPrefixCharLen:n,cachedTokens:r.cachedTokens,promptTokens:r.promptTokens}}else ife.debug(this.ctx,`accumulateTokenUsage: roundUsage is undefined for round ${e} \u2014 cumulative totals unchanged (prompt=${this.cumulativeTokenUsage.promptTokens}, completion=${this.cumulativeTokenUsage.completionTokens})`)}logRoundDebugMetrics(e,r,n,o,s,c){let l=c;ife.debug(this.ctx,`Round metrics for iteration ${e} for turn ${r}: prompt=[prev=${l.previousPromptCharLen}, cur=${l.currentPromptCharLen}, prefix=${l.commonPromptPrefixCharLen}`+(l.currentPromptCharLen>0?` (${(l.commonPromptPrefixCharLen/l.currentPromptCharLen*100).toFixed(1)}%)`:"")+`] tools=[prev=${l.previousToolsCharLen}, cur=${l.currentToolsCharLen}, prefix=${l.commonToolsPrefixCharLen}`+(l.currentToolsCharLen>0?` (${(l.commonToolsPrefixCharLen/l.currentToolsCharLen*100).toFixed(1)}%)`:"")+`] tokens=[prompt=${n?.promptTokens??"n/a"}, completion=${n?.completionTokens??"n/a"}, cached=${n?.cachedTokens??"n/a"}] timing=[llmFetch=${o.toFixed(0)}ms`+(s!==void 0?`, sinceLastLLM=${s.toFixed(0)}ms`:"")+"]")}async reportCumulativeTokenUsage(e){if(this.tokenUsageReported)return;this.tokenUsageReported=!0;let r=this.cumulativeTokenUsage;if(r.promptTokens>0||r.completionTokens>0){if(ife.info(this.ctx,`Turn token usage: ${r.promptTokens} prompt, ${r.completionTokens} completion, ${r.cachedTokens} cached`+(r.promptTokens>0?` (cache rate: ${(r.cachedTokens/r.promptTokens*100).toFixed(1)}%)`:"")),await this.conversationProgress.report(this.conversation,this.turn,{tokenUsage:{...r}}),kt(this.ctx,ze.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else ife.debug(this.ctx,`Turn token usage: cumulative totals are zero (promptTokens=${r.promptTokens}, completionTokens=${r.completionTokens}, cachedTokens=${r.cachedTokens}, rounds=${this.roundUsageHistory.length}) \u2014 skipping $progress.report(tokenUsage). This means either no LLM rounds completed or all rounds returned no usage data.`)}formatTokenStats(e){let r=a(c=>c>=1e6?`${(c/1e6).toFixed(1)}M`:c>=1e3?`${(c/1e3).toFixed(1)}k`:c.toString(),"fmt"),n=e.promptTokens>0?` (${(e.cachedTokens/e.promptTokens*100).toFixed(1)}% cached)`:"",o=this.roundUsageHistory.length,s=` \`\`\` --- Prompt token stats: ${r(e.promptTokens)} in, ${r(e.completionTokens)} out, ${r(e.cachedTokens)} cached${n} with ${o} HTTP request${o!==1?"s":""} `;if(this.roundUsageHistory.length>1){s+=` Per-round breakdown: `;for(let c of this.roundUsageHistory){let l=c.usage,u=l.promptTokens>0?` (${(l.cachedTokens/l.promptTokens*100).toFixed(1)}%)`:"";s+=` #${c.roundId}: ${r(l.promptTokens)} in, ${r(l.completionTokens)} out, ${r(l.cachedTokens)} cached${u} -`}}return s+="```\n",s}};function zzt(t,e){if(!t)return 0;let r=Math.min(t.length,e.length),n=0;for(;ne.copilot_cache_control!==void 0)?t.map(e=>{if(e.copilot_cache_control===void 0)return e;let{copilot_cache_control:r,...n}=e;return n}):t}a(uls,"stripDriftingFields");p();p();var urt=new pe("agentModePolicy");function oNn(t){try{let e=Dx(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(urt.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(eu).getPolicyValue("agentMode.autoApproval.enabled")===!1?(urt.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(urt.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return urt.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(oNn,"isAutoApprovalEnabled");p();var drt=new pe("McpAutoApproveService"),YF=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){drt.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return drt.warn(this.ctx,"Invalid McpAutoApproveService config item: ignored because it is not an object",r),!1;let n=r,o=typeof n.serverName=="string"&&typeof n.isServerAllowed=="boolean"&&Array.isArray(n.allowedTools)&&n.allowedTools.every(s=>typeof s=="string");return o||drt.warn(this.ctx,"Invalid McpAutoApproveService config item: ignored due to schema validation failure",r),o}).map(r=>({serverName:r.serverName,isServerAllowed:r.isServerAllowed,allowedTools:r.allowedTools})),drt.debug(this.ctx,"Updated McpAutoApproveService config",this._config)}isApproved(e,r){let n=this._config.find(o=>o.serverName===e);return n?n.isServerAllowed?!0:n.allowedTools.includes(r):!1}};p();p();var dZ=fe(require("path"));var qw=class t{constructor(e){this.ctx=e;this.rules=void 0;this.defaultRules=[{pattern:"**/github-copilot/**/*",requiresConfirmation:!0,description:"Github Copilot settings and token files"},{pattern:"**/.github/instructions/*",requiresConfirmation:!0,description:"Github instructions files"}]}static{a(this,"FileSafetyRulesService")}static{this.logger=new pe("FileSafetyRulesService")}ensureInitialized(){this.rules===void 0&&(this.rules=[...this.defaultRules])}getMatchingRule(e,r,n=!0,o=!1){let s=e.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(s&&ga.isRegisteredScheme(s[1].toLowerCase()))return;let c=s?.[1]?.toLowerCase()==="file"?un(e):e,l=Ko(c);if(!this.isPathInCurrentWorkspace(l,r))return{rule:{pattern:"outside-workspace",requiresConfirmation:!0,description:"files outside workspace"},isOutsideWorkspace:!0};if(!n)return;o||this.ensureInitialized();let d=o?this.defaultRules:this.rules;for(let f of d)if(this.matchesPattern(c,f.pattern))return{rule:f,isOutsideWorkspace:!1}}isPathInCurrentWorkspace(e,r){if(!r||r.length===0)return!1;try{let n=un(e);return r.some(o=>{try{let s=un(o),c=dZ.normalize(s),l=dZ.normalize(n),u=dZ.relative(c,l);return!u.startsWith("..")&&!dZ.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return Df(e,r,{nocase:!0,matchBase:!1,nobrace:!0,noext:!0,nonegate:!0,windowsPathsNoEscape:!0})}getDefaultRules(){return[...this.defaultRules]}extractFileSafetyRules(e){try{let r=e?.autoApprove;return Array.isArray(r)?r.filter(n=>n&&typeof n.pattern=="string"&&typeof n.autoApprove=="boolean").map(n=>({pattern:n.pattern,requiresConfirmation:!n.autoApprove,description:n.description})):Array.isArray(e)?e.filter(o=>o&&typeof o.pattern=="string"&&typeof o.autoApprove=="boolean").map(o=>({pattern:o.pattern,requiresConfirmation:!o.autoApprove,description:o.description})):void 0}catch(r){t.logger.error(this.ctx,"Error extracting configuration:",r);return}}updateRulesFromConfiguration(e){let r=this.extractFileSafetyRules(e);if(!(!r||r.length===0))try{this.ensureInitialized();let n=new Map;for(let o of this.defaultRules)n.set(o.pattern,o);for(let o of r)n.set(o.pattern,o);this.rules=Array.from(n.values())}catch(n){t.logger.error(this.ctx,"FileSafetyRulesService.updateRulesFromConfiguration: Failed to parse configuration, using defaults only",n),this.rules===void 0&&(this.rules=[...this.defaultRules])}}};p();var cNn=`*** Begin Patch -`,ife=` -*** End Patch`,ofe="*** Add File: ",kj="*** Delete File: ",sfe="*** Update File: ",dls="*** Move to: ",Yzt="*** End of File";var fls=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var vm=class extends Error{static{a(this,"DiffError")}},afe=class extends vm{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},k5=class extends vm{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function sNn(t,e,r){let n=0,o=0;for(let s of t)s.startsWith(" ")?o++:(s.startsWith(" ")||s.startsWith(" "))&&n++;if(o>n)return{tabSize:e,insertSpaces:!1};if(n>o){let s=0,c=0;for(let u of t){let d=u.match(/^( +)/);if(d){let f=d[1].length;f%4===0&&c++,f%2===0&&s++}}return{tabSize:c>s?4:2,insertSpaces:!0}}return{tabSize:e,insertSpaces:r}}a(sNn,"guessIndentation");function aNn(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a(aNn,"computeIndentLevel");function pls(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(pls,"getIndentationChar");function hls(t,e,r){if(e.insertSpaces===r.insertSpaces&&e.tabSize===r.tabSize)return t;let n=t.match(/^(\s*)/);if(!n)return t;let o=n[1],s=t.slice(o.length),c=0;for(let u of o)u===" "?c+=e.tabSize:u===" "&&c++;return(r.insertSpaces?" ".repeat(c):" ".repeat(Math.floor(c/r.tabSize))+" ".repeat(c%r.tabSize))+s}a(hls,"transformIndentation");function mls(t){return!t||!t.trim()}a(mls,"isFalsyOrWhitespace");function gls(t,e){let r=0;for(let n of t)n===e&&r++;return r}a(gls,"countOccurrences");function Als(t,e){let r=t.length,n=e.length,o=Array.from({length:r+1},()=>Array(n+1).fill(0));for(let s=0;s<=r;s++)o[s][0]=s;for(let s=0;s<=n;s++)o[0][s]=s;for(let s=1;s<=r;s++)for(let c=1;c<=n;c++)t[s-1]===e[c-1]?o[s][c]=o[s-1][c-1]:o[s][c]=Math.min(o[s-1][c]+1,o[s][c-1]+1,o[s-1][c-1]+1);return o[r][n]}a(Als,"computeLevenshteinDistance");function pke(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(pke,"replaceExplicitTabs");function frt(t){return pke(t.replaceAll("\\n",` -`))}a(frt,"replaceExplicitNl");var Kzt=class{constructor(e,r){this.indentStyles={};this.index=0;this.patch={actions:{}};this.fuzz=0;this.currentFiles=e,this.lines=r;for(let[n,o]of Object.entries(e)){let s=o.getText();this.indentStyles[n]=sNn(s.split(` -`),4,!1)}}static{a(this,"Parser")}isDone(e){if(this.index>=this.lines.length)return!0;let r=this.lines[this.index];return!!(e&&r&&e.some(n=>r.startsWith(n.trim())))}startswith(e){let r=Array.isArray(e)?e:[e],n=this.lines[this.index];return n!==void 0&&r.some(o=>n.startsWith(o))}readStr(e="",r=!1){if(this.index>=this.lines.length)throw new vm(`Index: ${this.index} >= ${this.lines.length}`);let n=this.lines[this.index];if(n!==void 0&&n.startsWith(e)){let o=r?n:n.slice(e.length);return this.index+=1,o??""}return""}parse(){for(;!this.isDone([ife]);){let e=this.readStr(sfe);if(e){if(this.patch.actions[e])throw new vm(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(dls);if(!(e in this.currentFiles))throw new vm(`Update File Error: Missing File: ${e}`);let n=this.currentFiles[e],o=this.indentStyles[e],s=n.getText(),c=this.getFilepathComment(n.languageId,e),l=this.parseUpdateFile(c,s??"",o);l.movePath=r||void 0,this.patch.actions[e]=l;continue}if(e=this.readStr(kj),e){if(this.patch.actions[e])throw new vm(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new vm(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(ofe),e){if(this.patch.actions[e])throw new vm(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new vm(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new vm(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(ife.trim()))throw new k5("Missing End Patch","missingEndPatch");this.index+=1}getFilepathComment(e,r){let n=r.split(".").pop()?.toLowerCase()??"",o=["sh","bash","zsh","py","rb","pl","yaml","yml"].includes(n),s=["html","htm","xml","svg"].includes(n);return o?`# ${r}`:s?``:`// ${r}`}parseUpdateFile(e,r,n){let o={type:"update",chunks:[]},s=r.split(` -`),c=!fls.test(e.trimEnd()),l=0;for(;!this.isDone([ife,sfe,kj,ofe,Yzt]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new vm(`Invalid line. Consider splitting each change into individual apply_patch tool calls: +`}}return s+="```\n",s}};function Yzt(t,e){if(!t)return 0;let r=Math.min(t.length,e.length),n=0;for(;ne.copilot_cache_control!==void 0)?t.map(e=>{if(e.copilot_cache_control===void 0)return e;let{copilot_cache_control:r,...n}=e;return n}):t}a(fls,"stripDriftingFields");p();p();var urt=new pe("agentModePolicy");function sNn(t){try{let e=Dx(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(urt.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(eu).getPolicyValue("agentMode.autoApproval.enabled")===!1?(urt.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(urt.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return urt.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(sNn,"isAutoApprovalEnabled");p();var drt=new pe("McpAutoApproveService"),YF=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){drt.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return drt.warn(this.ctx,"Invalid McpAutoApproveService config item: ignored because it is not an object",r),!1;let n=r,o=typeof n.serverName=="string"&&typeof n.isServerAllowed=="boolean"&&Array.isArray(n.allowedTools)&&n.allowedTools.every(s=>typeof s=="string");return o||drt.warn(this.ctx,"Invalid McpAutoApproveService config item: ignored due to schema validation failure",r),o}).map(r=>({serverName:r.serverName,isServerAllowed:r.isServerAllowed,allowedTools:r.allowedTools})),drt.debug(this.ctx,"Updated McpAutoApproveService config",this._config)}isApproved(e,r){let n=this._config.find(o=>o.serverName===e);return n?n.isServerAllowed?!0:n.allowedTools.includes(r):!1}};p();p();var fZ=fe(require("path"));var qw=class t{constructor(e){this.ctx=e;this.rules=void 0;this.defaultRules=[{pattern:"**/github-copilot/**/*",requiresConfirmation:!0,description:"Github Copilot settings and token files"},{pattern:"**/.github/instructions/*",requiresConfirmation:!0,description:"Github instructions files"}]}static{a(this,"FileSafetyRulesService")}static{this.logger=new pe("FileSafetyRulesService")}ensureInitialized(){this.rules===void 0&&(this.rules=[...this.defaultRules])}getMatchingRule(e,r,n=!0,o=!1){let s=e.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(s&&ga.isRegisteredScheme(s[1].toLowerCase()))return;let c=s?.[1]?.toLowerCase()==="file"?un(e):e,l=Ko(c);if(!this.isPathInCurrentWorkspace(l,r))return{rule:{pattern:"outside-workspace",requiresConfirmation:!0,description:"files outside workspace"},isOutsideWorkspace:!0};if(!n)return;o||this.ensureInitialized();let d=o?this.defaultRules:this.rules;for(let f of d)if(this.matchesPattern(c,f.pattern))return{rule:f,isOutsideWorkspace:!1}}isPathInCurrentWorkspace(e,r){if(!r||r.length===0)return!1;try{let n=un(e);return r.some(o=>{try{let s=un(o),c=fZ.normalize(s),l=fZ.normalize(n),u=fZ.relative(c,l);return!u.startsWith("..")&&!fZ.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return Df(e,r,{nocase:!0,matchBase:!1,nobrace:!0,noext:!0,nonegate:!0,windowsPathsNoEscape:!0})}getDefaultRules(){return[...this.defaultRules]}extractFileSafetyRules(e){try{let r=e?.autoApprove;return Array.isArray(r)?r.filter(n=>n&&typeof n.pattern=="string"&&typeof n.autoApprove=="boolean").map(n=>({pattern:n.pattern,requiresConfirmation:!n.autoApprove,description:n.description})):Array.isArray(e)?e.filter(o=>o&&typeof o.pattern=="string"&&typeof o.autoApprove=="boolean").map(o=>({pattern:o.pattern,requiresConfirmation:!o.autoApprove,description:o.description})):void 0}catch(r){t.logger.error(this.ctx,"Error extracting configuration:",r);return}}updateRulesFromConfiguration(e){let r=this.extractFileSafetyRules(e);if(!(!r||r.length===0))try{this.ensureInitialized();let n=new Map;for(let o of this.defaultRules)n.set(o.pattern,o);for(let o of r)n.set(o.pattern,o);this.rules=Array.from(n.values())}catch(n){t.logger.error(this.ctx,"FileSafetyRulesService.updateRulesFromConfiguration: Failed to parse configuration, using defaults only",n),this.rules===void 0&&(this.rules=[...this.defaultRules])}}};p();var lNn=`*** Begin Patch +`,ofe=` +*** End Patch`,sfe="*** Add File: ",kj="*** Delete File: ",afe="*** Update File: ",pls="*** Move to: ",Kzt="*** End of File";var hls=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var vm=class extends Error{static{a(this,"DiffError")}},cfe=class extends vm{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},k5=class extends vm{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function aNn(t,e,r){let n=0,o=0;for(let s of t)s.startsWith(" ")?o++:(s.startsWith(" ")||s.startsWith(" "))&&n++;if(o>n)return{tabSize:e,insertSpaces:!1};if(n>o){let s=0,c=0;for(let u of t){let d=u.match(/^( +)/);if(d){let f=d[1].length;f%4===0&&c++,f%2===0&&s++}}return{tabSize:c>s?4:2,insertSpaces:!0}}return{tabSize:e,insertSpaces:r}}a(aNn,"guessIndentation");function cNn(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a(cNn,"computeIndentLevel");function mls(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(mls,"getIndentationChar");function gls(t,e,r){if(e.insertSpaces===r.insertSpaces&&e.tabSize===r.tabSize)return t;let n=t.match(/^(\s*)/);if(!n)return t;let o=n[1],s=t.slice(o.length),c=0;for(let u of o)u===" "?c+=e.tabSize:u===" "&&c++;return(r.insertSpaces?" ".repeat(c):" ".repeat(Math.floor(c/r.tabSize))+" ".repeat(c%r.tabSize))+s}a(gls,"transformIndentation");function Als(t){return!t||!t.trim()}a(Als,"isFalsyOrWhitespace");function yls(t,e){let r=0;for(let n of t)n===e&&r++;return r}a(yls,"countOccurrences");function _ls(t,e){let r=t.length,n=e.length,o=Array.from({length:r+1},()=>Array(n+1).fill(0));for(let s=0;s<=r;s++)o[s][0]=s;for(let s=0;s<=n;s++)o[0][s]=s;for(let s=1;s<=r;s++)for(let c=1;c<=n;c++)t[s-1]===e[c-1]?o[s][c]=o[s-1][c-1]:o[s][c]=Math.min(o[s-1][c]+1,o[s][c-1]+1,o[s-1][c-1]+1);return o[r][n]}a(_ls,"computeLevenshteinDistance");function pke(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(pke,"replaceExplicitTabs");function frt(t){return pke(t.replaceAll("\\n",` +`))}a(frt,"replaceExplicitNl");var Jzt=class{constructor(e,r){this.indentStyles={};this.index=0;this.patch={actions:{}};this.fuzz=0;this.currentFiles=e,this.lines=r;for(let[n,o]of Object.entries(e)){let s=o.getText();this.indentStyles[n]=aNn(s.split(` +`),4,!1)}}static{a(this,"Parser")}isDone(e){if(this.index>=this.lines.length)return!0;let r=this.lines[this.index];return!!(e&&r&&e.some(n=>r.startsWith(n.trim())))}startswith(e){let r=Array.isArray(e)?e:[e],n=this.lines[this.index];return n!==void 0&&r.some(o=>n.startsWith(o))}readStr(e="",r=!1){if(this.index>=this.lines.length)throw new vm(`Index: ${this.index} >= ${this.lines.length}`);let n=this.lines[this.index];if(n!==void 0&&n.startsWith(e)){let o=r?n:n.slice(e.length);return this.index+=1,o??""}return""}parse(){for(;!this.isDone([ofe]);){let e=this.readStr(afe);if(e){if(this.patch.actions[e])throw new vm(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(pls);if(!(e in this.currentFiles))throw new vm(`Update File Error: Missing File: ${e}`);let n=this.currentFiles[e],o=this.indentStyles[e],s=n.getText(),c=this.getFilepathComment(n.languageId,e),l=this.parseUpdateFile(c,s??"",o);l.movePath=r||void 0,this.patch.actions[e]=l;continue}if(e=this.readStr(kj),e){if(this.patch.actions[e])throw new vm(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new vm(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(sfe),e){if(this.patch.actions[e])throw new vm(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new vm(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new vm(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(ofe.trim()))throw new k5("Missing End Patch","missingEndPatch");this.index+=1}getFilepathComment(e,r){let n=r.split(".").pop()?.toLowerCase()??"",o=["sh","bash","zsh","py","rb","pl","yaml","yml"].includes(n),s=["html","htm","xml","svg"].includes(n);return o?`# ${r}`:s?``:`// ${r}`}parseUpdateFile(e,r,n){let o={type:"update",chunks:[]},s=r.split(` +`),c=!hls.test(e.trimEnd()),l=0;for(;!this.isDone([ofe,afe,kj,sfe,Kzt]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new vm(`Invalid line. Consider splitting each change into individual apply_patch tool calls: ${this.lines[this.index]}`);if(d){let E=!1,v=a(S=>this.canonicalize(S),"canonLocal");if(!s.slice(0,l).some(S=>v(S)===v(d)))for(let S=l;Sv(S.trim())===v(d)))for(let S=l;S0&&(f=this.peekNextSection(this.lines,this.index,E)),h=this.findContext(e,s,f.nextChunkContext,l,f.eof),h||(h=this.findContext(e,s,f.nextChunkContext,0,f.eof)),E>0&&h&&(h.fuzz|=64);if(!h){let E=f.nextChunkContext.join(` -`);if(f.eof)throw new afe(`Invalid EOF context at character ${l}: -${E}`,r,"invalidContext-eof");{let v=E.match(/^\\t/)?"invalidContext-maybeInvalidTab":E.match(/^\\\t/)?"invalidContext-maybeEscapedTab":"invalidContext";throw new afe(`Invalid context at character ${l}: -${E}`,r,v)}}this.fuzz+=h.fuzz;let m=sNn(f.chunks.flatMap(E=>E.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=aNn(s[h.line]??"",n.tabSize),A=h.fuzz&4?pke(f.nextChunkContext[0]??""):h.fuzz&128?frt(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?aNn(A,m.tabSize):0,_=pls(n).repeat(Math.max(0,g-y));for(let E of f.chunks)E.origIndex+=h.line,h.fuzz&128&&(E.insLines=E.insLines.map(frt),E.delLines=E.delLines.map(frt)),(c||h.fuzz&4)&&(E.insLines=E.insLines.map(pke)),E.insLines=E.insLines.map(v=>mls(v)?v:_+hls(v,m,n)),h.fuzz&4&&(E.delLines=E.delLines.map(pke)),o.chunks.push(E);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([ife,sfe,kj,ofe]);){let r=this.readStr();if(!r.startsWith("+"))throw new k5(`Invalid Add File Line: ${r}`,"invalidAddFileLine");e.push(r.slice(1))}return{type:"add",newFile:e.join(` +`);if(f.eof)throw new cfe(`Invalid EOF context at character ${l}: +${E}`,r,"invalidContext-eof");{let v=E.match(/^\\t/)?"invalidContext-maybeInvalidTab":E.match(/^\\\t/)?"invalidContext-maybeEscapedTab":"invalidContext";throw new cfe(`Invalid context at character ${l}: +${E}`,r,v)}}this.fuzz+=h.fuzz;let m=aNn(f.chunks.flatMap(E=>E.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=cNn(s[h.line]??"",n.tabSize),A=h.fuzz&4?pke(f.nextChunkContext[0]??""):h.fuzz&128?frt(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?cNn(A,m.tabSize):0,_=mls(n).repeat(Math.max(0,g-y));for(let E of f.chunks)E.origIndex+=h.line,h.fuzz&128&&(E.insLines=E.insLines.map(frt),E.delLines=E.delLines.map(frt)),(c||h.fuzz&4)&&(E.insLines=E.insLines.map(pke)),E.insLines=E.insLines.map(v=>Als(v)?v:_+gls(v,m,n)),h.fuzz&4&&(E.delLines=E.delLines.map(pke)),o.chunks.push(E);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([ofe,afe,kj,sfe]);){let r=this.readStr();if(!r.startsWith("+"))throw new k5(`Invalid Add File Line: ${r}`,"invalidAddFileLine");e.push(r.slice(1))}return{type:"add",newFile:e.join(` `),chunks:[]}}canonicalize(e){let r={"-":"-","\u2010":"-","\u2011":"-","\u2012":"-","\u2013":"-","\u2014":"-","\u2212":"-",'"':'"',"\u201C":'"',"\u201D":'"',"\u201E":'"',"\xAB":'"',"\xBB":'"',"'":"'","\u2018":"'","\u2019":"'","\u201B":"'","\xA0":" ","\u202F":" "};return e.normalize("NFC").replace(/./gu,n=>r[n]??n)}findContextCore(e,r,n){if(r.length===0)return{line:n,fuzz:0};let o=a(m=>this.canonicalize(m),"canon"),s=o(r.join(` `)),c=e.map(o);for(let m=n;mm.trimEnd()).join(` `),u=2;for(let m=n;mm.trim()).join(` `);u|=8;for(let m=n;m0){let m=f.split(` -`);for(let g=n;g(y[y.Add=0]="Add",y[y.Delete=1]="Delete",y[y.Keep=2]="Keep"))(o||={});let s=r,c=[],l=[],u=[],d=[],f=2,h=0;for(;sm.startsWith(y.trim()))){f===2&&c.length&&!/\S/.test(c[c.length-1]??"")&&c.pop();break}if(m==="***")break;if(m.startsWith("***"))throw new k5(`Invalid Line: ${m}`,"invalidLine");s+=1;let g=f,A=m;if(A[0]==="+")f=0;else if(A[0]==="-")f=1;else if(A[0]===" ")f=2;else{let y=e[s],_=y?.[0]==="+"?0:y?.[0]==="-"?1:2,E=f!==2&&_===f;f=2,A=" "+A,E&&(h++,n===h&&(f=_))}A=A.slice(1),f===2&&g!==f&&((u.length||l.length)&&d.push({origIndex:c.length-l.length,delLines:l,insLines:u}),l=[],u=[]),f===1?(l.push(A),c.push(A)):f===0?u.push(A):c.push(A)}return(u.length||l.length)&&d.push({origIndex:c.length-l.length,delLines:l,insLines:u}),s(y[y.Add=0]="Add",y[y.Delete=1]="Delete",y[y.Keep=2]="Keep"))(o||={});let s=r,c=[],l=[],u=[],d=[],f=2,h=0;for(;sm.startsWith(y.trim()))){f===2&&c.length&&!/\S/.test(c[c.length-1]??"")&&c.pop();break}if(m==="***")break;if(m.startsWith("***"))throw new k5(`Invalid Line: ${m}`,"invalidLine");s+=1;let g=f,A=m;if(A[0]==="+")f=0;else if(A[0]==="-")f=1;else if(A[0]===" ")f=2;else{let y=e[s],_=y?.[0]==="+"?0:y?.[0]==="-"?1:2,E=f!==2&&_===f;f=2,A=" "+A,E&&(h++,n===h&&(f=_))}A=A.slice(1),f===2&&g!==f&&((u.length||l.length)&&d.push({origIndex:c.length-l.length,delLines:l,insLines:u}),l=[],u=[]),f===1?(l.push(A),c.push(A)):f===0?u.push(A):c.push(A)}return(u.length||l.length)&&d.push({origIndex:c.length-l.length,delLines:l,insLines:u}),sn.length)throw new vm(`${r}: chunk.origIndex ${c.origIndex} > len(lines) ${n.length}`);if(s>c.origIndex)throw new vm(`${r}: origIndex ${s} > chunk.origIndex ${c.origIndex}`);o.push(...n.slice(s,c.origIndex));let l=c.origIndex-s;if(s+=l,c.insLines.length)for(let u of c.insLines)o.push(u);s+=c.delLines.length}return o.push(...n.slice(s)),o.join(` -`)}a(_ls,"getUpdatedFile");function Els(t,e){let r={changes:{}};for(let[n,o]of Object.entries(t.actions))if(o.type==="delete")r.changes[n]={type:"delete",oldContent:e[n].getText()};else if(o.type==="add")r.changes[n]={type:"add",newContent:o.newFile??""};else if(o.type==="update"){let s=e[n]?.getText(),c=_ls(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(Els,"patchToCommit");async function vls(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new vm(`File not found: ${n}`)}return r}a(vls,"loadFiles");async function uNn(t,e){if(!t.startsWith(cNn))throw new k5("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=fZ(t),n=await vls(r,e),[o]=yls(t,n);return Els(o,n)}a(uNn,"processPatch");var P5=class{static{a(this,"SensitiveToolsService")}static{this.SENSITIVE_TOOL_TEXT={create_file:{title:"Allow creating sensitive files?",operation:"create"},read_file:{title:"Allow reading sensitive files?",operation:"read"},list_dir:{title:"Allow reading sensitive directories?",operation:"read"},replace_string_in_file:{title:"Allow replacing strings in sensitive files?",operation:"replace strings in"},insert_edit_into_file:{title:"Allow editing sensitive files?",operation:"edit"},apply_patch:{title:"Allow editing sensitive files?",operation:"edit"}}}static{this.POTENTIALLY_SENSITIVE_TOOLS=new Set(["insert_edit_into_file","create_file","read_file","list_dir","replace_string_in_file","apply_patch"])}static isPotentiallySensitiveTool(e){let r=typeof e=="string"?e:e.name;return this.POTENTIALLY_SENSITIVE_TOOLS.has(r)}static getPotentiallySensitiveTools(){return this.POTENTIALLY_SENSITIVE_TOOLS}static generateSensitiveConfirmationTitle(e){return this.SENSITIVE_TOOL_TEXT[e.name]?.title??"Allow operating on sensitive files?"}static generateSensitiveOperation(e){return this.SENSITIVE_TOOL_TEXT[e.name]?.operation??"operate on"}static extractFilePath(e,r){if(e.name==="apply_patch"){let s=r.input;if(!s)return;let c=fZ(s),l=cfe(s);return c.length>0?{filePath:c[0],isNewFile:!1}:l.length>0?{filePath:l[0],isNewFile:!0}:void 0}if(e.name==="list_dir"){let s=r.path;return s?{filePath:s,isNewFile:!1}:void 0}let n=r.filePath;if(!n)return;let o=e.name==="create_file";return{filePath:n,isNewFile:o}}static extractFilePathForMetadata(e,r){return this.extractFilePath(e,r)}static{this.sensitiveInfoCache=new WeakMap}static generateSensitiveConfirmationMessage(e,r,n){if(this.sensitiveInfoCache.has(r))return this.sensitiveInfoCache.get(r)??void 0;let o=this.computeSensitiveConfirmationMessage(e,r,n);return this.sensitiveInfoCache.set(r,o??null),o}static getMatchingRuleForToolCall(e,r,n,o=!1){let s=this.extractFilePath(e,r);if(!s)return;let{filePath:c,isNewFile:l}=s,u=n.turn.workspaceFolders?.map(h=>h.uri),d=n.ctx.get(qw),f=!l;return d.getMatchingRule(c,u,f,o)}static computeSensitiveConfirmationMessage(e,r,n){if(!this.isPotentiallySensitiveTool(e))return;let o=this.extractFilePath(e,r);if(!o)return;let{filePath:s,isNewFile:c}=o,l=n.turn.workspaceFolders?.map(g=>g.uri),u=n.ctx.get(qw),d=!c,f=u.getMatchingRule(s,l,d);if(f&&!f.rule.requiresConfirmation)return;let h=this.generateSensitiveConfirmationTitle(e),m=this.generateSensitiveOperation(e);if(f){let g=f.rule.description||"Sensitive files";return{title:h,message:`${g} needs confirmation. +`)}a(vls,"getUpdatedFile");function Cls(t,e){let r={changes:{}};for(let[n,o]of Object.entries(t.actions))if(o.type==="delete")r.changes[n]={type:"delete",oldContent:e[n].getText()};else if(o.type==="add")r.changes[n]={type:"add",newContent:o.newFile??""};else if(o.type==="update"){let s=e[n]?.getText(),c=vls(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(Cls,"patchToCommit");async function bls(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new vm(`File not found: ${n}`)}return r}a(bls,"loadFiles");async function dNn(t,e){if(!t.startsWith(lNn))throw new k5("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=pZ(t),n=await bls(r,e),[o]=Els(t,n);return Cls(o,n)}a(dNn,"processPatch");var P5=class{static{a(this,"SensitiveToolsService")}static{this.SENSITIVE_TOOL_TEXT={create_file:{title:"Allow creating sensitive files?",operation:"create"},read_file:{title:"Allow reading sensitive files?",operation:"read"},list_dir:{title:"Allow reading sensitive directories?",operation:"read"},replace_string_in_file:{title:"Allow replacing strings in sensitive files?",operation:"replace strings in"},insert_edit_into_file:{title:"Allow editing sensitive files?",operation:"edit"},apply_patch:{title:"Allow editing sensitive files?",operation:"edit"}}}static{this.POTENTIALLY_SENSITIVE_TOOLS=new Set(["insert_edit_into_file","create_file","read_file","list_dir","replace_string_in_file","apply_patch"])}static isPotentiallySensitiveTool(e){let r=typeof e=="string"?e:e.name;return this.POTENTIALLY_SENSITIVE_TOOLS.has(r)}static getPotentiallySensitiveTools(){return this.POTENTIALLY_SENSITIVE_TOOLS}static generateSensitiveConfirmationTitle(e){return this.SENSITIVE_TOOL_TEXT[e.name]?.title??"Allow operating on sensitive files?"}static generateSensitiveOperation(e){return this.SENSITIVE_TOOL_TEXT[e.name]?.operation??"operate on"}static extractFilePath(e,r){if(e.name==="apply_patch"){let s=r.input;if(!s)return;let c=pZ(s),l=lfe(s);return c.length>0?{filePath:c[0],isNewFile:!1}:l.length>0?{filePath:l[0],isNewFile:!0}:void 0}if(e.name==="list_dir"){let s=r.path;return s?{filePath:s,isNewFile:!1}:void 0}let n=r.filePath;if(!n)return;let o=e.name==="create_file";return{filePath:n,isNewFile:o}}static extractFilePathForMetadata(e,r){return this.extractFilePath(e,r)}static{this.sensitiveInfoCache=new WeakMap}static generateSensitiveConfirmationMessage(e,r,n){if(this.sensitiveInfoCache.has(r))return this.sensitiveInfoCache.get(r)??void 0;let o=this.computeSensitiveConfirmationMessage(e,r,n);return this.sensitiveInfoCache.set(r,o??null),o}static getMatchingRuleForToolCall(e,r,n,o=!1){let s=this.extractFilePath(e,r);if(!s)return;let{filePath:c,isNewFile:l}=s,u=n.turn.workspaceFolders?.map(h=>h.uri),d=n.ctx.get(qw),f=!l;return d.getMatchingRule(c,u,f,o)}static computeSensitiveConfirmationMessage(e,r,n){if(!this.isPotentiallySensitiveTool(e))return;let o=this.extractFilePath(e,r);if(!o)return;let{filePath:s,isNewFile:c}=o,l=n.turn.workspaceFolders?.map(g=>g.uri),u=n.ctx.get(qw),d=!c,f=u.getMatchingRule(s,l,d);if(f&&!f.rule.requiresConfirmation)return;let h=this.generateSensitiveConfirmationTitle(e),m=this.generateSensitiveOperation(e);if(f){let g=f.rule.description||"Sensitive files";return{title:h,message:`${g} needs confirmation. The model wants to ${m} sensitive files (${s})${f.rule.pattern?` matching pattern \`${f.rule.pattern}\``:""}. -Do you want to allow this?`,matchingRuleInfo:f}}return{title:h,message:`The model wants to ${m} file (${s}). Do you want to allow this?`,matchingRuleInfo:void 0}}};var lfe=new pe("AutoApproveService"),pZ=class{constructor(e){this.ctx=e}static{a(this,"AutoApproveService")}async checkApproval(e,r,n){if(n3()&&process.env.HMAC_SECRET)return{needConfirm:!1};if(kt(e.ctx,ze.EditorHandlesAllConfirmation)===!0)return{needConfirm:!0};let o=this.classifyTool(r);if(o==="other")return lfe.debug(this.ctx,"Auto approve check for build-in safe tool decided: approve (always auto-approved)"),{needConfirm:!1};if(!oNn(this.ctx)){if(o==="file-operation"){let u=this.checkSensitiveFileApproval(r,n,e,!0),d=u.action==="confirm";return lfe.debug(this.ctx,`Auto approve check (policy disabled, file-operation, default rules only) decided: ${u.action}`),{needConfirm:d}}return lfe.info(this.ctx,"Tool confirmation required: auto-approval disabled by policy"),{needConfirm:!0}}if(kt(e.ctx,ze.AutoApproveYoloMode)===!0)return lfe.info(this.ctx,`Auto approve yolo mode: auto-approving ${o} tool call`),{needConfirm:!1};let s=kt(e.ctx,ze.ToolConfirmAutoApprove)===!0,c;switch(o){case"mcp":c=this.checkMcpApproval(r),c.action==="continue"&&(c=s?{action:"approve"}:{action:"confirm"});break;case"terminal":{if(c=await this.checkTerminalApproval(r,n),c.action==="continue"){let u=kt(e.ctx,ze.AutoApproveUnmatchedTerminal);u!==void 0?c=u?{action:"approve"}:{action:"confirm"}:c=s?{action:"approve"}:{action:"confirm"}}break}case"file-operation":{if(c=this.checkSensitiveFileApproval(r,n,e),c.action==="continue"){let u=kt(e.ctx,ze.AutoApproveUnmatchedFileOp);u!==void 0?c=u?{action:"approve"}:{action:"confirm"}:c={action:"approve"}}break}}let l=c.action==="confirm";return lfe.debug(this.ctx,`Auto approve check (${o}) decided: ${c.action}`),{needConfirm:l}}classifyTool(e){return e.type==="mcp"?"mcp":e.id.includes("run_in_terminal")?"terminal":P5.isPotentiallySensitiveTool(e)?"file-operation":"other"}checkMcpApproval(e){if(this.ctx.get(YF).isApproved(e.toolProvider.id,e.name))return{action:"approve"};if(kt(this.ctx,ze.TrustToolAnnotations)){let o=this.ctx.get(vs).getToolById(e.id);if(o?.annotations?.readOnlyHint&&!o.annotations.openWorldHint)return{action:"approve"}}return{action:"continue"}}async checkTerminalApproval(e,r){let n=r.command,o=this.ctx.get(wT),c=cZ(e.description)||"sh";lfe.info(this.ctx,`Extracted shell '${c}' from run_in_terminal tool description.`);let l=await o.isTerminalCommandApprovalRequired(n,c);return l.result==="approved"?{action:"approve"}:l.result==="denied"?{action:"confirm"}:{action:"continue"}}checkSensitiveFileApproval(e,r,n,o=!1){let s=P5.getMatchingRuleForToolCall(e,r,n,o);return s?s.rule.requiresConfirmation?{action:"confirm"}:{action:"approve"}:{action:"continue"}}};p();p();p();function hke(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n"u"}a(bls,"isUndefined");function Jzt(t){return Buffer.from(t,"base64").toString("utf-8")}a(Jzt,"decodeBase64");function pNn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(pNn,"isObject");p();var Pj="activate_",Av=class t{constructor(e,r,n,o,s=[]){this.name=e;this.description=r;this.lastUsedOnTurn=n;this.metadata=o;this.contents=s;this.isExpanded=!1;if(!e.startsWith(Pj))throw new Error(`Virtual tool name must start with '${Pj}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(Pj+e+this.name.slice(Pj.length),this.description,this.lastUsedOnTurn,{...this.metadata,possiblePrefix:void 0},this.contents)}find(e){if(this.name===e)return{tool:this,path:[]};for(let r of this.contents)if(r instanceof t){let n=r.find(e);if(n)return n.path.unshift(this),n}else if(r.nameForModel===e)return{tool:r,path:[this]}}getLowestExpandedTool(){let e;for(let r of this.all())r instanceof t&&r.isExpanded&&(!e||r.lastUsedOnTurn${e.description}`,vscpp("br",null))}},Zzt=class extends fr{static{a(this,"ExistingGroupInformation")}renderCopilot(){let{group:e}=this.props;return vscpp(vscppf,null,``,vscpp("br",null),`${e.summary}`,vscpp("br",null),e.tools.map(r=>` -`),"",vscpp("br",null))}},prt=class extends fr{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Dj.SystemMessage,null,"Context: There are many tools available for a user. However, the number of tools can be large, and it is not always practical to present all of them at once. We need to create a summary of them that accurately reflects the capabilities they provide.",vscpp("br",null),vscpp("br",null),"The user present you with the tools available to them, and you must create a summary of the tools that is accurate and comprehensive. The summary should include the capabilities of the tools and when they should be used.",vscpp("br",null)),vscpp(Dj.UserMessage,null,this.props.tools.map(e=>vscpp(mke,{tool:e})),vscpp("br",null),vscpp("br",null),"Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"object",required:["name","summary"],properties:{summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'},name:{type:"string",description:"A short name for the group. It may only contain the characters a-z, A-Z, 0-9, and underscores.",example:"foo_language_tools"}}},null,2)))}},hrt=class extends fr{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Dj.SystemMessage,null,"Context: There are many tools available for a user. However, the number of tools can be large, and it is not always practical to present all of them at once. We need to create logical groups for the user to pick from at a glance.",vscpp("br",null),vscpp("br",null),"The user present you with the tools available to them, and you must group them into logical categories and provide a summary of each one. The summary should include the capabilities of the tools and when they should be used. Every tool MUST be a part of EXACTLY one category. Category names in your response MUST be unique\u2014do not reuse the same name for different categories. If two categories would share a base name, append a short, descriptive suffix to disambiguate (e.g., python_tools_testing vs python_tools_packaging).",vscpp("br",null)),vscpp(Dj.UserMessage,null,this.props.tools.map(e=>vscpp(mke,{tool:e})),vscpp("br",null),vscpp("br",null),"You MUST make sure every tool is part of a category. Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"array",items:{type:"object",required:["name","tools","summary"],properties:{name:{type:"string",description:"A short, unique name for the category across this response. It may only contain the characters a-z, A-Z, 0-9, and underscores. If a potential collision exists, add a short suffix to keep names unique (e.g., _testing, _packaging).",example:"foo_language_tools"},tools:{type:"array",description:"The tool names that are part of this category.",items:{type:"string"}},summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'}}}},null,2)))}},mrt=class extends fr{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Dj.SystemMessage,null,"Context: There are existing tool categories that have been previously established. New tools have become available and need to be categorized. You must decide whether each new tool fits into an existing category or requires a new category to be created.",vscpp("br",null),vscpp("br",null),"The user will provide you with the existing categories and their current tools, as well as the new tools that need to be categorized. You must assign each new tool to either an existing category (if it fits well) or create new categories as needed. You should also return all existing tools in their current categories unless there's a compelling reason to reorganize them.",vscpp("br",null),vscpp("br",null),"Every tool (both existing and new) MUST be part of EXACTLY one category in your response. Category names MUST be unique within the response. If a new category would conflict with an existing category name, choose a distinct, disambiguating name.",vscpp("br",null)),vscpp(Dj.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(Zzt,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(mke,{tool:e})),vscpp("br",null),vscpp("br",null),"Instructions:",vscpp("br",null),"1. For each new tool, determine if it fits well into an existing category or if it needs a new category",vscpp("br",null),"2. Keep existing tools in their current categories unless there's a strong reason to move them",vscpp("br",null),"3. Create new categories only when new tools don't fit well into existing ones",vscpp("br",null),"4. Every tool (existing + new) MUST appear in exactly one category",vscpp("br",null),vscpp("br",null),"Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"array",items:{type:"object",required:["name","tools","summary"],properties:{name:{type:"string",description:"A short, unique name for the category across this response. It may only contain the characters a-z, A-Z, 0-9, and underscores. Do not reuse names; add a short suffix if needed to avoid collisions.",example:"foo_language_tools"},tools:{type:"array",description:"The tool names that are part of this category.",items:{type:"string"}},summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'}}}},null,2)))}};p();p();p();var aYt={};Ti(aYt,{arrayReplaceAt:()=>sYt,asciiTrim:()=>yZ,assign:()=>pfe,escapeHtml:()=>JF,escapeRE:()=>ous,fromCodePoint:()=>hfe,has:()=>zls,isMdAsciiPunct:()=>gZ,isPunctChar:()=>MNn,isPunctCharCode:()=>mZ,isSpace:()=>na,isString:()=>xrt,isValidEntityCode:()=>wrt,isWhiteSpace:()=>hZ,lib:()=>sus,normalizeReference:()=>AZ,unescapeAll:()=>KF,unescapeMd:()=>Xls});p();var Ert={};Ti(Ert,{decode:()=>gke,encode:()=>yrt,format:()=>ufe,parse:()=>Ake});p();p();var hNn={};function Sls(t){let e=hNn[t];if(e)return e;e=hNn[t]=[];for(let r=0;r<128;r++){let n=String.fromCharCode(r);e.push(n)}for(let r=0;r=55296&&f<=57343?o+="\uFFFD\uFFFD\uFFFD":o+=String.fromCharCode(f),s+=6;continue}}if((l&248)===240&&s+91114111?o+="\uFFFD\uFFFD\uFFFD\uFFFD":(h-=65536,o+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),s+=9;continue}}o+="\uFFFD"}return o})}a(grt,"decode");grt.defaultChars=";/?:@&=+$,#";grt.componentChars="";var gke=grt;p();var mNn={};function Tls(t){let e=mNn[t];if(e)return e;e=mNn[t]=[];for(let r=0;r<128;r++){let n=String.fromCharCode(r);/^[0-9a-z]$/i.test(n)?e.push(n):e.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2))}for(let r=0;r"u"&&(r=!0);let n=Tls(e),o="";for(let s=0,c=t.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&u<=57343){o+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(t[s])}return o}a(Art,"encode");Art.defaultChars=";/?:@&=+$,-_.!~*'()#";Art.componentChars="-_.!~*'()";var yrt=Art;p();function ufe(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}a(ufe,"format");p();function _rt(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}a(_rt,"Url");var Ils=/^([a-z0-9.+-]+:)/i,xls=/:[0-9]*$/,wls=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Rls=["<",">",'"',"`"," ","\r",` -`," "],kls=["{","}","|","\\","^","`"].concat(Rls),Pls=["'"].concat(kls),gNn=["%","/","?",";","#"].concat(Pls),ANn=["/","?","#"],Dls=255,yNn=/^[+a-z0-9A-Z_-]{0,63}$/,Nls=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_Nn={javascript:!0,"javascript:":!0},ENn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Mls(t,e){if(t&&t instanceof _rt)return t;let r=new _rt;return r.parse(t,e),r}a(Mls,"urlParse");_rt.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=wls.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=Ils.exec(s);if(c&&(c=c[0],r=c.toLowerCase(),this.protocol=c,s=s.substr(c.length)),(e||c||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(c&&_Nn[c])&&(s=s.substr(2),this.slashes=!0)),!_Nn[c]&&(o||c&&!ENn[c])){let d=-1;for(let A=0;A127?v+="x":v+=E[S];if(!v.match(yNn)){let S=A.slice(0,y),T=A.slice(y+1),w=E.match(Nls);w&&(S.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=S.join(".");break}}}}this.hostname.length>Dls&&(this.hostname=""),g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));let u=s.indexOf("?");return u!==-1&&(this.search=s.substr(u),s=s.slice(0,u)),s&&(this.pathname=s),ENn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};_rt.prototype.parseHost=function(t){let e=xls.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var Ake=Mls;var Xzt={};Ti(Xzt,{Any:()=>vrt,Cc:()=>Crt,Cf:()=>vNn,P:()=>dfe,S:()=>brt,Z:()=>Srt});p();p();var vrt=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var Crt=/[\0-\x1F\x7F-\x9F]/;p();var vNn=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;p();var dfe=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;p();var brt=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/;p();var Srt=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var CNn=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(t=>t.charCodeAt(0)));p();var bNn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var eYt,Ols=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),tYt=(eYt=String.fromCodePoint)!==null&&eYt!==void 0?eYt:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function rYt(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=Ols.get(t))!==null&&e!==void 0?e:t}a(rYt,"replaceCodePoint");var O0;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(O0||(O0={}));var Lls=32,Nj;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Nj||(Nj={}));function nYt(t){return t>=O0.ZERO&&t<=O0.NINE}a(nYt,"isNumber");function Bls(t){return t>=O0.UPPER_A&&t<=O0.UPPER_F||t>=O0.LOWER_A&&t<=O0.LOWER_F}a(Bls,"isHexadecimalCharacter");function Fls(t){return t>=O0.UPPER_A&&t<=O0.UPPER_Z||t>=O0.LOWER_A&&t<=O0.LOWER_Z||nYt(t)}a(Fls,"isAsciiAlphaNumeric");function Uls(t){return t===O0.EQUALS||Fls(t)}a(Uls,"isEntityInAttributeInvalidEnd");var M0;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(M0||(M0={}));var L2;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(L2||(L2={}));var Trt=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=M0.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=L2.Strict}startEntity(e){this.decodeMode=e,this.state=M0.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case M0.EntityStart:return e.charCodeAt(r)===O0.NUM?(this.state=M0.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=M0.NamedEntity,this.stateNamedEntity(e,r));case M0.NumericStart:return this.stateNumericStart(e,r);case M0.NumericDecimal:return this.stateNumericDecimal(e,r);case M0.NumericHex:return this.stateNumericHex(e,r);case M0.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|Lls)===O0.LOWER_X?(this.state=M0.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=M0.NumericDecimal,this.stateNumericDecimal(e,r))}addToNumericResult(e,r,n,o){if(r!==n){let s=n-r;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(r,s),o),this.consumed+=s}}stateNumericHex(e,r){let n=r;for(;r>14;for(;r>14,s!==0){if(c===O0.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==L2.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:r,decodeTree:n}=this,o=(n[r]&Nj.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,r,n){let{decodeTree:o}=this;return this.emitCodePoint(r===1?o[e]&~Nj.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case M0.NamedEntity:return this.result!==0&&(this.decodeMode!==L2.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case M0.NumericDecimal:return this.emitNumericEntity(0,2);case M0.NumericHex:return this.emitNumericEntity(0,3);case M0.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case M0.EntityStart:return 0}}};function SNn(t){let e="",r=new Trt(t,n=>e+=tYt(n));return a(function(o,s){let c=0,l=0;for(;(l=o.indexOf("&",l))>=0;){e+=o.slice(c,l),r.startEntity(s);let d=r.write(o,l+1);if(d<0){c=l+r.end();break}c=l+d,l=d===0?c+1:c}let u=e+o.slice(c);return e="",u},"decodeWithTrie")}a(SNn,"getDecoder");function Qls(t,e,r,n){let o=(e&Nj.BRANCH_LENGTH)>>7,s=e&Nj.JUMP_TABLE;if(o===0)return s!==0&&n===s?r:-1;if(s){let u=n-s;return u<0||u>=o?-1:t[r+u]-1}let c=r,l=c+o-1;for(;c<=l;){let u=c+l>>>1,d=t[u];if(dn)l=u-1;else return t[u+o]}return-1}a(Qls,"determineBranch");var TNn=SNn(CNn),Q9d=SNn(bNn);function ffe(t,e=L2.Legacy){return TNn(t,e)}a(ffe,"decodeHTML");function yke(t){return TNn(t,L2.Strict)}a(yke,"decodeHTMLStrict");p();p();function Irt(t){for(let e=1;et.codePointAt(e):(t,e)=>(t.charCodeAt(e)&64512)===55296?(t.charCodeAt(e)-55296)*1024+t.charCodeAt(e+1)-56320+65536:t.charCodeAt(e);function iYt(t,e){return a(function(n){let o,s=0,c="";for(;o=t.exec(n);)s!==o.index&&(c+=n.substring(s,o.index)),c+=e.get(o[0].charCodeAt(0)),s=o.index+1;return c+n.substring(s)},"escape")}a(iYt,"getEscaper");var INn=iYt(/[&<>'"]/g,jls),xNn=iYt(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),wNn=iYt(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var RNn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(RNn||(RNn={}));var kNn;(function(t){t[t.UTF8=0]="UTF8",t[t.ASCII=1]="ASCII",t[t.Extensive=2]="Extensive",t[t.Attribute=3]="Attribute",t[t.Text=4]="Text"})(kNn||(kNn={}));function Vls(t){return Object.prototype.toString.call(t)}a(Vls,"_class");function xrt(t){return Vls(t)==="[object String]"}a(xrt,"isString");var Wls=Object.prototype.hasOwnProperty;function zls(t,e){return Wls.call(t,e)}a(zls,"has");function pfe(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){if(r){if(typeof r!="object")throw new TypeError(r+"must be object");Object.keys(r).forEach(function(n){t[n]=r[n]})}}),t}a(pfe,"assign");function sYt(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(sYt,"arrayReplaceAt");function wrt(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}a(wrt,"isValidEntityCode");function hfe(t){if(t>65535){t-=65536;let e=55296+(t>>10),r=56320+(t&1023);return String.fromCharCode(e,r)}return String.fromCharCode(t)}a(hfe,"fromCodePoint");var NNn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Yls=/&([a-z#][a-z0-9]{1,31});/gi,Kls=new RegExp(NNn.source+"|"+Yls.source,"gi"),Jls=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Zls(t,e){if(e.charCodeAt(0)===35&&Jls.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return wrt(n)?hfe(n):t}let r=ffe(t);return r!==t?r:t}a(Zls,"replaceEntityPattern");function Xls(t){return t.indexOf("\\")<0?t:t.replace(NNn,"$1")}a(Xls,"unescapeMd");function KF(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Kls,function(e,r,n){return r||Zls(e,n)})}a(KF,"unescapeAll");var eus=/[&<>"]/,tus=/[&<>"]/g,rus={"&":"&","<":"<",">":">",'"':"""};function nus(t){return rus[t]}a(nus,"replaceUnsafeChar");function JF(t){return eus.test(t)?t.replace(tus,nus):t}a(JF,"escapeHtml");var ius=/[.?*+^$[\]\\(){}|-]/g;function ous(t){return t.replace(ius,"\\$&")}a(ous,"escapeRE");function na(t){switch(t){case 9:case 32:return!0}return!1}a(na,"isSpace");function hZ(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}a(hZ,"isWhiteSpace");function MNn(t){return dfe.test(t)||brt.test(t)}a(MNn,"isPunctChar");function mZ(t){return MNn(hfe(t))}a(mZ,"isPunctCharCode");function gZ(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}a(gZ,"isMdAsciiPunct");function AZ(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(AZ,"normalizeReference");function DNn(t){return t===32||t===9||t===10||t===13}a(DNn,"isAsciiTrimmable");function yZ(t){let e=0;for(;e=e&&DNn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(yZ,"asciiTrim");var sus={mdurl:Ert,ucmicro:Xzt};var dYt={};Ti(dYt,{parseLinkDestination:()=>lYt,parseLinkLabel:()=>cYt,parseLinkTitle:()=>uYt});p();p();function cYt(t,e,r){let n,o,s,c,l=t.posMax,u=t.pos;for(t.pos=e+1,n=1;t.pos32))return s;if(n===41){if(c===0)break;c--}o++}return e===o||c!==0||(s.str=KF(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(lYt,"parseLinkDestination");p();function uYt(t,e,r,n){let o,s=e,c={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)c.str=n.str,c.marker=n.marker;else{if(s>=r)return c;let l=t.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return c;e++,s++,l===40&&(l=41),c.marker=l}for(;s"+JF(s.content)+""};D5.code_block=function(t,e,r,n,o){let s=t[e];return""+JF(t[e].content)+` +Do you want to allow this?`,matchingRuleInfo:f}}return{title:h,message:`The model wants to ${m} file (${s}). Do you want to allow this?`,matchingRuleInfo:void 0}}};var ufe=new pe("AutoApproveService"),hZ=class{constructor(e){this.ctx=e}static{a(this,"AutoApproveService")}async checkApproval(e,r,n){if(n3()&&process.env.HMAC_SECRET)return{needConfirm:!1};if(kt(e.ctx,ze.EditorHandlesAllConfirmation)===!0)return{needConfirm:!0};let o=this.classifyTool(r);if(o==="other")return ufe.debug(this.ctx,"Auto approve check for build-in safe tool decided: approve (always auto-approved)"),{needConfirm:!1};if(!sNn(this.ctx)){if(o==="file-operation"){let u=this.checkSensitiveFileApproval(r,n,e,!0),d=u.action==="confirm";return ufe.debug(this.ctx,`Auto approve check (policy disabled, file-operation, default rules only) decided: ${u.action}`),{needConfirm:d}}return ufe.info(this.ctx,"Tool confirmation required: auto-approval disabled by policy"),{needConfirm:!0}}if(kt(e.ctx,ze.AutoApproveYoloMode)===!0)return ufe.info(this.ctx,`Auto approve yolo mode: auto-approving ${o} tool call`),{needConfirm:!1};let s=kt(e.ctx,ze.ToolConfirmAutoApprove)===!0,c;switch(o){case"mcp":c=this.checkMcpApproval(r),c.action==="continue"&&(c=s?{action:"approve"}:{action:"confirm"});break;case"terminal":{if(c=await this.checkTerminalApproval(r,n),c.action==="continue"){let u=kt(e.ctx,ze.AutoApproveUnmatchedTerminal);u!==void 0?c=u?{action:"approve"}:{action:"confirm"}:c=s?{action:"approve"}:{action:"confirm"}}break}case"file-operation":{if(c=this.checkSensitiveFileApproval(r,n,e),c.action==="continue"){let u=kt(e.ctx,ze.AutoApproveUnmatchedFileOp);u!==void 0?c=u?{action:"approve"}:{action:"confirm"}:c={action:"approve"}}break}}let l=c.action==="confirm";return ufe.debug(this.ctx,`Auto approve check (${o}) decided: ${c.action}`),{needConfirm:l}}classifyTool(e){return e.type==="mcp"?"mcp":e.id.includes("run_in_terminal")?"terminal":P5.isPotentiallySensitiveTool(e)?"file-operation":"other"}checkMcpApproval(e){if(this.ctx.get(YF).isApproved(e.toolProvider.id,e.name))return{action:"approve"};if(kt(this.ctx,ze.TrustToolAnnotations)){let o=this.ctx.get(vs).getToolById(e.id);if(o?.annotations?.readOnlyHint&&!o.annotations.openWorldHint)return{action:"approve"}}return{action:"continue"}}async checkTerminalApproval(e,r){let n=r.command,o=this.ctx.get(wT),c=lZ(e.description)||"sh";ufe.info(this.ctx,`Extracted shell '${c}' from run_in_terminal tool description.`);let l=await o.isTerminalCommandApprovalRequired(n,c);return l.result==="approved"?{action:"approve"}:l.result==="denied"?{action:"confirm"}:{action:"continue"}}checkSensitiveFileApproval(e,r,n,o=!1){let s=P5.getMatchingRuleForToolCall(e,r,n,o);return s?s.rule.requiresConfirmation?{action:"confirm"}:{action:"approve"}:{action:"continue"}}};p();p();p();function hke(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n"u"}a(Tls,"isUndefined");function Zzt(t){return Buffer.from(t,"base64").toString("utf-8")}a(Zzt,"decodeBase64");function hNn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(hNn,"isObject");p();var Pj="activate_",Av=class t{constructor(e,r,n,o,s=[]){this.name=e;this.description=r;this.lastUsedOnTurn=n;this.metadata=o;this.contents=s;this.isExpanded=!1;if(!e.startsWith(Pj))throw new Error(`Virtual tool name must start with '${Pj}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(Pj+e+this.name.slice(Pj.length),this.description,this.lastUsedOnTurn,{...this.metadata,possiblePrefix:void 0},this.contents)}find(e){if(this.name===e)return{tool:this,path:[]};for(let r of this.contents)if(r instanceof t){let n=r.find(e);if(n)return n.path.unshift(this),n}else if(r.nameForModel===e)return{tool:r,path:[this]}}getLowestExpandedTool(){let e;for(let r of this.all())r instanceof t&&r.isExpanded&&(!e||r.lastUsedOnTurn${e.description}`,vscpp("br",null))}},Xzt=class extends fr{static{a(this,"ExistingGroupInformation")}renderCopilot(){let{group:e}=this.props;return vscpp(vscppf,null,``,vscpp("br",null),`${e.summary}`,vscpp("br",null),e.tools.map(r=>` +`),"",vscpp("br",null))}},prt=class extends fr{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Dj.SystemMessage,null,"Context: There are many tools available for a user. However, the number of tools can be large, and it is not always practical to present all of them at once. We need to create a summary of them that accurately reflects the capabilities they provide.",vscpp("br",null),vscpp("br",null),"The user present you with the tools available to them, and you must create a summary of the tools that is accurate and comprehensive. The summary should include the capabilities of the tools and when they should be used.",vscpp("br",null)),vscpp(Dj.UserMessage,null,this.props.tools.map(e=>vscpp(mke,{tool:e})),vscpp("br",null),vscpp("br",null),"Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"object",required:["name","summary"],properties:{summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'},name:{type:"string",description:"A short name for the group. It may only contain the characters a-z, A-Z, 0-9, and underscores.",example:"foo_language_tools"}}},null,2)))}},hrt=class extends fr{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Dj.SystemMessage,null,"Context: There are many tools available for a user. However, the number of tools can be large, and it is not always practical to present all of them at once. We need to create logical groups for the user to pick from at a glance.",vscpp("br",null),vscpp("br",null),"The user present you with the tools available to them, and you must group them into logical categories and provide a summary of each one. The summary should include the capabilities of the tools and when they should be used. Every tool MUST be a part of EXACTLY one category. Category names in your response MUST be unique\u2014do not reuse the same name for different categories. If two categories would share a base name, append a short, descriptive suffix to disambiguate (e.g., python_tools_testing vs python_tools_packaging).",vscpp("br",null)),vscpp(Dj.UserMessage,null,this.props.tools.map(e=>vscpp(mke,{tool:e})),vscpp("br",null),vscpp("br",null),"You MUST make sure every tool is part of a category. Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"array",items:{type:"object",required:["name","tools","summary"],properties:{name:{type:"string",description:"A short, unique name for the category across this response. It may only contain the characters a-z, A-Z, 0-9, and underscores. If a potential collision exists, add a short suffix to keep names unique (e.g., _testing, _packaging).",example:"foo_language_tools"},tools:{type:"array",description:"The tool names that are part of this category.",items:{type:"string"}},summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'}}}},null,2)))}},mrt=class extends fr{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Dj.SystemMessage,null,"Context: There are existing tool categories that have been previously established. New tools have become available and need to be categorized. You must decide whether each new tool fits into an existing category or requires a new category to be created.",vscpp("br",null),vscpp("br",null),"The user will provide you with the existing categories and their current tools, as well as the new tools that need to be categorized. You must assign each new tool to either an existing category (if it fits well) or create new categories as needed. You should also return all existing tools in their current categories unless there's a compelling reason to reorganize them.",vscpp("br",null),vscpp("br",null),"Every tool (both existing and new) MUST be part of EXACTLY one category in your response. Category names MUST be unique within the response. If a new category would conflict with an existing category name, choose a distinct, disambiguating name.",vscpp("br",null)),vscpp(Dj.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(Xzt,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(mke,{tool:e})),vscpp("br",null),vscpp("br",null),"Instructions:",vscpp("br",null),"1. For each new tool, determine if it fits well into an existing category or if it needs a new category",vscpp("br",null),"2. Keep existing tools in their current categories unless there's a strong reason to move them",vscpp("br",null),"3. Create new categories only when new tools don't fit well into existing ones",vscpp("br",null),"4. Every tool (existing + new) MUST appear in exactly one category",vscpp("br",null),vscpp("br",null),"Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"array",items:{type:"object",required:["name","tools","summary"],properties:{name:{type:"string",description:"A short, unique name for the category across this response. It may only contain the characters a-z, A-Z, 0-9, and underscores. Do not reuse names; add a short suffix if needed to avoid collisions.",example:"foo_language_tools"},tools:{type:"array",description:"The tool names that are part of this category.",items:{type:"string"}},summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'}}}},null,2)))}};p();p();p();var cYt={};Ti(cYt,{arrayReplaceAt:()=>aYt,asciiTrim:()=>_Z,assign:()=>hfe,escapeHtml:()=>JF,escapeRE:()=>aus,fromCodePoint:()=>mfe,has:()=>Kls,isMdAsciiPunct:()=>AZ,isPunctChar:()=>ONn,isPunctCharCode:()=>gZ,isSpace:()=>na,isString:()=>xrt,isValidEntityCode:()=>wrt,isWhiteSpace:()=>mZ,lib:()=>cus,normalizeReference:()=>yZ,unescapeAll:()=>KF,unescapeMd:()=>tus});p();var Ert={};Ti(Ert,{decode:()=>gke,encode:()=>yrt,format:()=>dfe,parse:()=>Ake});p();p();var mNn={};function Ils(t){let e=mNn[t];if(e)return e;e=mNn[t]=[];for(let r=0;r<128;r++){let n=String.fromCharCode(r);e.push(n)}for(let r=0;r=55296&&f<=57343?o+="\uFFFD\uFFFD\uFFFD":o+=String.fromCharCode(f),s+=6;continue}}if((l&248)===240&&s+91114111?o+="\uFFFD\uFFFD\uFFFD\uFFFD":(h-=65536,o+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),s+=9;continue}}o+="\uFFFD"}return o})}a(grt,"decode");grt.defaultChars=";/?:@&=+$,#";grt.componentChars="";var gke=grt;p();var gNn={};function xls(t){let e=gNn[t];if(e)return e;e=gNn[t]=[];for(let r=0;r<128;r++){let n=String.fromCharCode(r);/^[0-9a-z]$/i.test(n)?e.push(n):e.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2))}for(let r=0;r"u"&&(r=!0);let n=xls(e),o="";for(let s=0,c=t.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&u<=57343){o+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(t[s])}return o}a(Art,"encode");Art.defaultChars=";/?:@&=+$,-_.!~*'()#";Art.componentChars="-_.!~*'()";var yrt=Art;p();function dfe(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}a(dfe,"format");p();function _rt(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}a(_rt,"Url");var wls=/^([a-z0-9.+-]+:)/i,Rls=/:[0-9]*$/,kls=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Pls=["<",">",'"',"`"," ","\r",` +`," "],Dls=["{","}","|","\\","^","`"].concat(Pls),Nls=["'"].concat(Dls),ANn=["%","/","?",";","#"].concat(Nls),yNn=["/","?","#"],Mls=255,_Nn=/^[+a-z0-9A-Z_-]{0,63}$/,Ols=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ENn={javascript:!0,"javascript:":!0},vNn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Lls(t,e){if(t&&t instanceof _rt)return t;let r=new _rt;return r.parse(t,e),r}a(Lls,"urlParse");_rt.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=kls.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=wls.exec(s);if(c&&(c=c[0],r=c.toLowerCase(),this.protocol=c,s=s.substr(c.length)),(e||c||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(c&&ENn[c])&&(s=s.substr(2),this.slashes=!0)),!ENn[c]&&(o||c&&!vNn[c])){let d=-1;for(let A=0;A127?v+="x":v+=E[S];if(!v.match(_Nn)){let S=A.slice(0,y),T=A.slice(y+1),w=E.match(Ols);w&&(S.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=S.join(".");break}}}}this.hostname.length>Mls&&(this.hostname=""),g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));let u=s.indexOf("?");return u!==-1&&(this.search=s.substr(u),s=s.slice(0,u)),s&&(this.pathname=s),vNn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};_rt.prototype.parseHost=function(t){let e=Rls.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var Ake=Lls;var eYt={};Ti(eYt,{Any:()=>vrt,Cc:()=>Crt,Cf:()=>CNn,P:()=>ffe,S:()=>brt,Z:()=>Srt});p();p();var vrt=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var Crt=/[\0-\x1F\x7F-\x9F]/;p();var CNn=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;p();var ffe=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;p();var brt=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/;p();var Srt=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var bNn=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(t=>t.charCodeAt(0)));p();var SNn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var tYt,Bls=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),rYt=(tYt=String.fromCodePoint)!==null&&tYt!==void 0?tYt:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function nYt(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=Bls.get(t))!==null&&e!==void 0?e:t}a(nYt,"replaceCodePoint");var L0;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(L0||(L0={}));var Fls=32,Nj;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Nj||(Nj={}));function iYt(t){return t>=L0.ZERO&&t<=L0.NINE}a(iYt,"isNumber");function Uls(t){return t>=L0.UPPER_A&&t<=L0.UPPER_F||t>=L0.LOWER_A&&t<=L0.LOWER_F}a(Uls,"isHexadecimalCharacter");function Qls(t){return t>=L0.UPPER_A&&t<=L0.UPPER_Z||t>=L0.LOWER_A&&t<=L0.LOWER_Z||iYt(t)}a(Qls,"isAsciiAlphaNumeric");function qls(t){return t===L0.EQUALS||Qls(t)}a(qls,"isEntityInAttributeInvalidEnd");var O0;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(O0||(O0={}));var L2;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(L2||(L2={}));var Trt=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=O0.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=L2.Strict}startEntity(e){this.decodeMode=e,this.state=O0.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case O0.EntityStart:return e.charCodeAt(r)===L0.NUM?(this.state=O0.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=O0.NamedEntity,this.stateNamedEntity(e,r));case O0.NumericStart:return this.stateNumericStart(e,r);case O0.NumericDecimal:return this.stateNumericDecimal(e,r);case O0.NumericHex:return this.stateNumericHex(e,r);case O0.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|Fls)===L0.LOWER_X?(this.state=O0.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=O0.NumericDecimal,this.stateNumericDecimal(e,r))}addToNumericResult(e,r,n,o){if(r!==n){let s=n-r;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(r,s),o),this.consumed+=s}}stateNumericHex(e,r){let n=r;for(;r>14;for(;r>14,s!==0){if(c===L0.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==L2.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:r,decodeTree:n}=this,o=(n[r]&Nj.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,r,n){let{decodeTree:o}=this;return this.emitCodePoint(r===1?o[e]&~Nj.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case O0.NamedEntity:return this.result!==0&&(this.decodeMode!==L2.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case O0.NumericDecimal:return this.emitNumericEntity(0,2);case O0.NumericHex:return this.emitNumericEntity(0,3);case O0.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case O0.EntityStart:return 0}}};function TNn(t){let e="",r=new Trt(t,n=>e+=rYt(n));return a(function(o,s){let c=0,l=0;for(;(l=o.indexOf("&",l))>=0;){e+=o.slice(c,l),r.startEntity(s);let d=r.write(o,l+1);if(d<0){c=l+r.end();break}c=l+d,l=d===0?c+1:c}let u=e+o.slice(c);return e="",u},"decodeWithTrie")}a(TNn,"getDecoder");function jls(t,e,r,n){let o=(e&Nj.BRANCH_LENGTH)>>7,s=e&Nj.JUMP_TABLE;if(o===0)return s!==0&&n===s?r:-1;if(s){let u=n-s;return u<0||u>=o?-1:t[r+u]-1}let c=r,l=c+o-1;for(;c<=l;){let u=c+l>>>1,d=t[u];if(dn)l=u-1;else return t[u+o]}return-1}a(jls,"determineBranch");var INn=TNn(bNn),j9d=TNn(SNn);function pfe(t,e=L2.Legacy){return INn(t,e)}a(pfe,"decodeHTML");function yke(t){return INn(t,L2.Strict)}a(yke,"decodeHTMLStrict");p();p();function Irt(t){for(let e=1;et.codePointAt(e):(t,e)=>(t.charCodeAt(e)&64512)===55296?(t.charCodeAt(e)-55296)*1024+t.charCodeAt(e+1)-56320+65536:t.charCodeAt(e);function oYt(t,e){return a(function(n){let o,s=0,c="";for(;o=t.exec(n);)s!==o.index&&(c+=n.substring(s,o.index)),c+=e.get(o[0].charCodeAt(0)),s=o.index+1;return c+n.substring(s)},"escape")}a(oYt,"getEscaper");var xNn=oYt(/[&<>'"]/g,Gls),wNn=oYt(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),RNn=oYt(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var kNn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(kNn||(kNn={}));var PNn;(function(t){t[t.UTF8=0]="UTF8",t[t.ASCII=1]="ASCII",t[t.Extensive=2]="Extensive",t[t.Attribute=3]="Attribute",t[t.Text=4]="Text"})(PNn||(PNn={}));function zls(t){return Object.prototype.toString.call(t)}a(zls,"_class");function xrt(t){return zls(t)==="[object String]"}a(xrt,"isString");var Yls=Object.prototype.hasOwnProperty;function Kls(t,e){return Yls.call(t,e)}a(Kls,"has");function hfe(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){if(r){if(typeof r!="object")throw new TypeError(r+"must be object");Object.keys(r).forEach(function(n){t[n]=r[n]})}}),t}a(hfe,"assign");function aYt(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(aYt,"arrayReplaceAt");function wrt(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}a(wrt,"isValidEntityCode");function mfe(t){if(t>65535){t-=65536;let e=55296+(t>>10),r=56320+(t&1023);return String.fromCharCode(e,r)}return String.fromCharCode(t)}a(mfe,"fromCodePoint");var MNn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Jls=/&([a-z#][a-z0-9]{1,31});/gi,Zls=new RegExp(MNn.source+"|"+Jls.source,"gi"),Xls=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function eus(t,e){if(e.charCodeAt(0)===35&&Xls.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return wrt(n)?mfe(n):t}let r=pfe(t);return r!==t?r:t}a(eus,"replaceEntityPattern");function tus(t){return t.indexOf("\\")<0?t:t.replace(MNn,"$1")}a(tus,"unescapeMd");function KF(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Zls,function(e,r,n){return r||eus(e,n)})}a(KF,"unescapeAll");var rus=/[&<>"]/,nus=/[&<>"]/g,ius={"&":"&","<":"<",">":">",'"':"""};function ous(t){return ius[t]}a(ous,"replaceUnsafeChar");function JF(t){return rus.test(t)?t.replace(nus,ous):t}a(JF,"escapeHtml");var sus=/[.?*+^$[\]\\(){}|-]/g;function aus(t){return t.replace(sus,"\\$&")}a(aus,"escapeRE");function na(t){switch(t){case 9:case 32:return!0}return!1}a(na,"isSpace");function mZ(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}a(mZ,"isWhiteSpace");function ONn(t){return ffe.test(t)||brt.test(t)}a(ONn,"isPunctChar");function gZ(t){return ONn(mfe(t))}a(gZ,"isPunctCharCode");function AZ(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}a(AZ,"isMdAsciiPunct");function yZ(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(yZ,"normalizeReference");function NNn(t){return t===32||t===9||t===10||t===13}a(NNn,"isAsciiTrimmable");function _Z(t){let e=0;for(;e=e&&NNn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(_Z,"asciiTrim");var cus={mdurl:Ert,ucmicro:eYt};var fYt={};Ti(fYt,{parseLinkDestination:()=>uYt,parseLinkLabel:()=>lYt,parseLinkTitle:()=>dYt});p();p();function lYt(t,e,r){let n,o,s,c,l=t.posMax,u=t.pos;for(t.pos=e+1,n=1;t.pos32))return s;if(n===41){if(c===0)break;c--}o++}return e===o||c!==0||(s.str=KF(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(uYt,"parseLinkDestination");p();function dYt(t,e,r,n){let o,s=e,c={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)c.str=n.str,c.marker=n.marker;else{if(s>=r)return c;let l=t.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return c;e++,s++,l===40&&(l=41),c.marker=l}for(;s"+JF(s.content)+""};D5.code_block=function(t,e,r,n,o){let s=t[e];return""+JF(t[e].content)+` `};D5.fence=function(t,e,r,n,o){let s=t[e],c=s.info?KF(s.info).trim():"",l="",u="";if(c){let f=c.split(/(\s+)/g);l=f[0],u=f.slice(2).join("")}let d;if(r.highlight?d=r.highlight(s.content,l,u)||JF(s.content):d=JF(s.content),d.indexOf("${d} `}return`
${d}
@@ -3442,22 +3442,22 @@ Do you want to allow this?`,matchingRuleInfo:f}}return{title:h,message:`The mode `};D5.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?`
`:`
`:` -`};D5.text=function(t,e){return JF(t[e].content)};D5.html_block=function(t,e){return t[e].content};D5.html_inline=function(t,e){return t[e].content};function mfe(){this.rules=pfe({},D5)}a(mfe,"Renderer");mfe.prototype.renderAttrs=a(function(e){let r,n,o;if(!e.attrs)return"";for(o="",r=0,n=e.attrs.length;r -`:">",s},"renderToken");mfe.prototype.renderInline=function(t,e,r){let n="",o=this.rules;for(let s=0,c=t.length;s=0&&(n=this.attrs[r][1]),n},"attrGet");gfe.prototype.attrJoin=a(function(e,r){let n=this.attrIndex(e);n<0?this.attrPush([e,r]):this.attrs[n][1]=this.attrs[n][1]+" "+r},"attrJoin");var ZF=gfe;function LNn(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(LNn,"StateCore");LNn.prototype.Token=ZF;var BNn=LNn;p();var aus=/\r\n?|\n/g,cus=/\0/g;function fYt(t){let e;e=t.src.replace(aus,` -`),e=e.replace(cus,"\uFFFD"),t.src=e}a(fYt,"normalize");p();function pYt(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}a(pYt,"block");p();function hYt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a(lus,"isLinkOpen");function uus(t){return/^<\/a\s*>/i.test(t)}a(uus,"isLinkClose");function mYt(t){let e=t.tokens;if(t.md.options.linkify)for(let r=0,n=e.length;r=0;c--){let l=o[c];if(l.type==="link_close"){for(c--;o[c].level!==l.level&&o[c].type!=="link_open";)c--;continue}if(l.type==="html_inline"&&(lus(l.content)&&s>0&&s--,uus(l.content)&&s++),!(s>0)&&l.type==="text"&&t.md.linkify.test(l.content)){let u=l.content,d=t.md.linkify.match(u),f=[],h=l.level,m=0;d.length>0&&d[0].index===0&&c>0&&o[c-1].type==="text_special"&&(d=d.slice(1));for(let g=0;gm){let w=new t.Token("text","",0);w.content=u.slice(m,E),w.level=h,f.push(w)}let v=new t.Token("link_open","a",1);v.attrs=[["href",y]],v.level=h++,v.markup="linkify",v.info="auto",f.push(v);let S=new t.Token("text","",0);S.content=_,S.level=h,f.push(S);let T=new t.Token("link_close","a",-1);T.level=--h,T.markup="linkify",T.info="auto",f.push(T),m=d[g].lastIndex}if(m=0;r--){let n=t[r];n.type==="text"&&!e&&(n.content=n.content.replace(fus,hus)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(mus,"replace_scoped");function gus(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&FNn.test(n.content)&&(n.content=n.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(gus,"replace_rare");function gYt(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(dus.test(t.tokens[e].content)&&mus(t.tokens[e].children),FNn.test(t.tokens[e].content)&&gus(t.tokens[e].children))}a(gYt,"replace");p();var Aus=/['"]/,UNn=/['"]/g,QNn="\u2019";function Rrt(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(Rrt,"addReplacement");function yus(t,e){let r="",n=0;e.sort((o,s)=>o.pos-s.pos);for(let o=0;o=0&&!(n[r].level<=l);r--);if(n.length=r+1,c.type!=="text")continue;let u=c.content,d=0,f=u.length;e:for(;d=0)y=u.charCodeAt(h.index-1);else for(r=s-1;r>=0&&!(t[r].type==="softbreak"||t[r].type==="hardbreak");r--)if(t[r].content){y=t[r].content.charCodeAt(t[r].content.length-1);break}let _=32;if(d=48&&y<=57&&(g=m=!1),m&&g&&(m=E,g=v),!m&&!g){A&&Rrt(o,s,h.index,QNn);continue}if(g)for(r=n.length-1;r>=0;r--){let w=n[r];if(n[r].level=0;e--)t.tokens[e].type!=="inline"||!Aus.test(t.tokens[e].content)||_us(t.tokens[e].children,t)}a(AYt,"smartquotes");p();function yYt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};N5.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");N5.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!na(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");N5.prototype.skipChars=a(function(e,r){for(let n=this.src.length;en;)if(r!==this.src.charCodeAt(--e))return e+1;return e},"skipCharsBack");N5.prototype.getLines=a(function(e,r,n,o){if(e>=r)return"";let s=new Array(r-e);for(let c=0,l=e;ln?s[c]=new Array(u-n+1).join(" ")+this.src.slice(f,h):s[c]=this.src.slice(f,h)}return s.join("")},"getLines");N5.prototype.Token=ZF;var jNn=N5;p();var Eus=65536;function vYt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(vYt,"getLine");function HNn(t){let e=[],r=t.length,n=0,o=t.charCodeAt(n),s=!1,c=0,l="";for(;nr)return!1;let o=e+1;if(t.sCount[o]=4)return!1;let s=t.bMarks[o]+t.tShift[o];if(s>=t.eMarks[o])return!1;let c=t.src.charCodeAt(s++);if(c!==124&&c!==45&&c!==58||s>=t.eMarks[o])return!1;let l=t.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!na(l)||c===45&&na(l))return!1;for(;s=4)return!1;d=HNn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();let h=d.length;if(h===0||h!==f.length)return!1;if(n)return!0;let m=t.parentType;t.parentType="table";let g=t.md.block.ruler.getRules("blockquote"),A=t.push("table_open","table",1),y=[e,0];A.map=y;let _=t.push("thead_open","thead",1);_.map=[e,e+1];let E=t.push("tr_open","tr",1);E.map=[e,e+1];for(let T=0;T=4||(d=HNn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),S+=h-d.length,S>Eus))break;if(o===e+2){let R=t.push("tbody_open","tbody",1);R.map=v=[e+2,0]}let w=t.push("tr_open","tr",1);w.map=[o,o+1];for(let R=0;R=4){n++,o=n;continue}break}t.line=o;let s=t.push("code_block","code",0);return s.content=t.getLines(e,o,4+t.blkIndent,!1)+` -`,s.map=[e,t.line],!0}a(bYt,"code");p();function SYt(t,e,r,n){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||o+3>s)return!1;let c=t.src.charCodeAt(o);if(c!==126&&c!==96)return!1;let l=o;o=t.skipChars(o,c);let u=o-l;if(u<3)return!1;let d=t.src.slice(l,o),f=t.src.slice(o,s);if(c===96&&f.indexOf(String.fromCharCode(c))>=0)return!1;if(n)return!0;let h=e,m=!1;for(;h++,!(h>=r||(o=l=t.bMarks[h]+t.tShift[h],s=t.eMarks[h],o=4)&&(o=t.skipChars(o,c),!(o-l=4||t.src.charCodeAt(o)!==62)return!1;if(n)return!0;let l=[],u=[],d=[],f=[],h=t.md.block.ruler.getRules("blockquote"),m=t.parentType;t.parentType="blockquote";let g=!1,A;for(A=e;A=s)break;if(t.src.charCodeAt(o++)===62&&!S){let w=t.sCount[A]+1,R,x;t.src.charCodeAt(o)===32?(o++,w++,x=!1,R=!0):t.src.charCodeAt(o)===9?(R=!0,(t.bsCount[A]+w)%4===3?(o++,w++,x=!1):x=!0):R=!1;let k=w;for(l.push(t.bMarks[A]),t.bMarks[A]=o;o=s,u.push(t.bsCount[A]),t.bsCount[A]=t.sCount[A]+1+(R?1:0),d.push(t.sCount[A]),t.sCount[A]=k-w,f.push(t.tShift[A]),t.tShift[A]=o-t.bMarks[A];continue}if(g)break;let T=!1;for(let w=0,R=h.length;w";let E=[e,0];_.map=E,t.md.block.tokenize(t,e,A);let v=t.push("blockquote_close","blockquote",-1);v.markup=">",t.lineMax=c,t.parentType=m,E[1]=t.line;for(let S=0;S=4)return!1;let s=t.bMarks[e]+t.tShift[e],c=t.src.charCodeAt(s++);if(c!==42&&c!==45&&c!==95)return!1;let l=1;for(;s=n)return-1;let s=t.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=n)return-1;if(s=t.src.charCodeAt(o++),s>=48&&s<=57){if(o-r>=10)return-1;continue}if(s===41||s===46)break;return-1}return o=4||t.listIndent>=0&&t.sCount[u]-t.listIndent>=4&&t.sCount[u]=t.blkIndent&&(f=!0);let h,m,g;if((g=$Nn(t,u))>=0){if(h=!0,c=t.bMarks[u]+t.tShift[u],m=Number(t.src.slice(c,g-1)),f&&m!==1)return!1}else if((g=GNn(t,u))>=0)h=!1;else return!1;if(f&&t.skipSpaces(g)>=t.eMarks[u])return!1;if(n)return!0;let A=t.src.charCodeAt(g-1),y=t.tokens.length;h?(l=t.push("ordered_list_open","ol",1),m!==1&&(l.attrs=[["start",m]])):l=t.push("bullet_list_open","ul",1);let _=[u,0];l.map=_,l.markup=String.fromCharCode(A);let E=!1,v=t.md.block.ruler.getRules("list"),S=t.parentType;for(t.parentType="list";u=o?x=1:x=w-T,x>4&&(x=1);let k=T+x;l=t.push("list_item_open","li",1),l.markup=String.fromCharCode(A);let D=[u,0];l.map=D,h&&(l.info=t.src.slice(c,g-1));let N=t.tight,O=t.tShift[u],B=t.sCount[u],q=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=k,t.tight=!0,t.tShift[u]=R-t.bMarks[u],t.sCount[u]=w,R>=o&&t.isEmpty(u+1)?t.line=Math.min(t.line+2,r):t.md.block.tokenize(t,u,r,!0),(!t.tight||E)&&(d=!1),E=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=q,t.tShift[u]=O,t.sCount[u]=B,t.tight=N,l=t.push("list_item_close","li",-1),l.markup=String.fromCharCode(A),u=t.line,D[1]=u,u>=r||t.sCount[u]=4)break;let M=!1;for(let L=0,U=v.length;L=4||t.src.charCodeAt(o)!==91)return!1;function l(v){let S=t.lineMax;if(v>=S||t.isEmpty(v))return null;let T=!1;if(t.sCount[v]-t.blkIndent>3&&(T=!0),t.sCount[v]<0&&(T=!0),!T){let x=t.md.block.ruler.getRules("reference"),k=t.parentType;t.parentType="reference";let D=!1;for(let N=0,O=x.length;N"u"&&(t.env.references={}),typeof t.env.references[E]>"u"&&(t.env.references[E]={title:_,href:h}),t.line=c),!0):!1}a(wYt,"reference");p();p();var VNn=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];p();var Cus="[a-zA-Z_:][a-zA-Z0-9:._-]*",bus="[^\"'=<>`\\x00-\\x20]+",Sus="'[^']*'",Tus='"[^"]*"',Ius="(?:"+bus+"|"+Sus+"|"+Tus+")",xus="(?:\\s+"+Cus+"(?:\\s*=\\s*"+Ius+")?)",WNn="<[A-Za-z][A-Za-z0-9\\-]*"+xus+"*\\s*\\/?>",zNn="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",wus="",Rus="<[?][\\s\\S]*?[?]>",kus="]*>",Pus="",YNn=new RegExp("^(?:"+WNn+"|"+zNn+"|"+wus+"|"+Rus+"|"+kus+"|"+Pus+")"),KNn=new RegExp("^(?:"+WNn+"|"+zNn+")");var EZ=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(KNn.source+"\\s*$"),/^$/,!1]];function RYt(t,e,r,n){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(o)!==60)return!1;let c=t.src.slice(o,s),l=0;for(;l=4)return!1;let c=t.src.charCodeAt(o);if(c!==35||o>=s)return!1;let l=1;for(c=t.src.charCodeAt(++o);c===35&&o6||oo&&na(t.src.charCodeAt(u-1))&&(s=u),t.line=e+1;let d=t.push("heading_open","h"+String(l),1);d.markup="########".slice(0,l),d.map=[e,t.line];let f=t.push("inline","",0);f.content=yZ(t.src.slice(o,s)),f.map=[e,t.line],f.children=[];let h=t.push("heading_close","h"+String(l),-1);return h.markup="########".slice(0,l),!0}a(kYt,"heading");p();function PYt(t,e,r){let n=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;let o=t.parentType;t.parentType="paragraph";let s=0,c,l=e+1;for(;l3)continue;if(t.sCount[l]>=t.blkIndent){let g=t.bMarks[l]+t.tShift[l],A=t.eMarks[l];if(g=A))){s=c===61?1:2;break}}if(t.sCount[l]<0)continue;let m=!1;for(let g=0,A=n.length;g3||t.sCount[s]<0)continue;let d=!1;for(let f=0,h=n.length;f=r||t.sCount[c]=s){t.line=r;break}let u=t.line,d=!1;for(let f=0;f=t.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");t.tight=!l,t.isEmpty(t.line-1)&&(l=!0),c=t.line,c0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(o),n};_ke.prototype.scanDelims=function(t,e){let r=this.posMax,n=this.src.charCodeAt(t),o;if(t===0)o=32;else if(t===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(t-1),(o&64512)===56320){let _=this.src.charCodeAt(t-2);o=(_&64512)===55296?65536+(_-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let s=t;for(;s0)return!1;let r=t.pos,n=t.posMax;if(r+3>n||t.src.charCodeAt(r)!==58||t.src.charCodeAt(r+1)!==47||t.src.charCodeAt(r+2)!==47)return!1;let o=t.pending.match(Nus);if(!o)return!1;let s=o[1],c=t.md.linkify.matchAtStart(t.src.slice(r-s.length));if(!c)return!1;let l=c.url;if(l.length<=s.length)return!1;let u=l.length;for(;u>0&&l.charCodeAt(u-1)===42;)u--;u!==l.length&&(l=l.slice(0,u));let d=t.md.normalizeLink(l);if(!t.md.validateLink(d))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);let f=t.push("link_open","a",1);f.attrs=[["href",d]],f.markup="linkify",f.info="auto";let h=t.push("text","",0);h.content=t.md.normalizeLinkText(l);let m=t.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return t.pos+=l.length-s.length,!0}a(MYt,"linkify");p();function OYt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==10)return!1;let n=t.pending.length-1,o=t.posMax;if(!e)if(n>=0&&t.pending.charCodeAt(n)===32)if(n>=1&&t.pending.charCodeAt(n-1)===32){let s=n-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(r++;r?@[]^_`{|}~-".split("").forEach(function(t){LYt[t.charCodeAt(0)]=1});function BYt(t,e){let r=t.pos,n=t.posMax;if(t.src.charCodeAt(r)!==92||(r++,r>=n))return!1;let o=t.src.charCodeAt(r);if(o===10){for(e||t.push("hardbreak","br",0),r++;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s+=t.src[r+1],r++)}let c="\\"+s;if(!e){let l=t.push("text_special","",0);o<256&&LYt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(BYt,"escape");p();function FYt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==96)return!1;let o=r;r++;let s=t.posMax;for(;r=0;n--){let o=e[n];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;let s=e[o.end],c=n>0&&e[n-1].end===o.end+1&&e[n-1].marker===o.marker&&e[n-1].token===o.token-1&&e[o.end+1].token===s.token+1,l=String.fromCharCode(o.marker),u=t.tokens[o.token];u.type=c?"strong_open":"em_open",u.tag=c?"strong":"em",u.nesting=1,u.markup=c?l+l:l,u.content="";let d=t.tokens[s.token];d.type=c?"strong_close":"em_close",d.tag=c?"strong":"em",d.nesting=-1,d.markup=c?l+l:l,d.content="",c&&(t.tokens[e[n-1].token].content="",t.tokens[e[o.end+1].token].content="",n--)}}a(eMn,"postProcess");function Bus(t){let e=t.tokens_meta,r=t.tokens_meta.length;eMn(t,t.delimiters);for(let n=0;n=h)return!1;if(u=A,o=t.md.helpers.parseLinkDestination(t.src,A,t.posMax),o.ok){for(c=t.md.normalizeLink(o.str),t.md.validateLink(c)?A=o.pos:c="",u=A;A=h||t.src.charCodeAt(A)!==41)&&(d=!0),A++}if(d){if(typeof t.env.references>"u")return!1;if(A=0?n=t.src.slice(u,A++):A=g+1):A=g+1,n||(n=t.src.slice(m,g)),s=t.env.references[AZ(n)],!s)return t.pos=f,!1;c=s.href,l=s.title}if(!e){t.pos=m,t.posMax=g;let y=t.push("link_open","a",1),_=[["href",c]];y.attrs=_,l&&_.push(["title",l]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=A,t.posMax=h,!0}a(qYt,"link");p();function jYt(t,e){let r,n,o,s,c,l,u,d,f="",h=t.pos,m=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;let g=t.pos+2,A=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(A<0)return!1;if(s=A+1,s=m)return!1;for(d=s,l=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),l.ok&&(f=t.md.normalizeLink(l.str),t.md.validateLink(f)?s=l.pos:f=""),d=s;s=m||t.src.charCodeAt(s)!==41)return t.pos=h,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s=0?o=t.src.slice(d,s++):s=A+1):s=A+1,o||(o=t.src.slice(g,A)),c=t.env.references[AZ(o)],!c)return t.pos=h,!1;f=c.href,u=c.title}if(!e){n=t.src.slice(g,A);let y=[];t.md.inline.parse(n,t.md,t.env,y);let _=t.push("image","img",0),E=[["src",f],["alt",""]];_.attrs=E,_.children=y,_.content=n,u&&E.push(["title",u])}return t.pos=s,t.posMax=m,!0}a(jYt,"image");p();var Fus=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Uus=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function HYt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==60)return!1;let n=t.pos,o=t.posMax;for(;;){if(++r>=o)return!1;let c=t.src.charCodeAt(r);if(c===60)return!1;if(c===62)break}let s=t.src.slice(n+1,r);if(Uus.test(s)){let c=t.md.normalizeLink(s);if(!t.md.validateLink(c))return!1;if(!e){let l=t.push("link_open","a",1);l.attrs=[["href",c]],l.markup="autolink",l.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);let d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}if(Fus.test(s)){let c=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(c))return!1;if(!e){let l=t.push("link_open","a",1);l.attrs=[["href",c]],l.markup="autolink",l.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);let d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}return!1}a(HYt,"autolink");p();function Qus(t){return/^\s]/i.test(t)}a(Qus,"isLinkOpen");function qus(t){return/^<\/a\s*>/i.test(t)}a(qus,"isLinkClose");function jus(t){let e=t|32;return e>=97&&e<=122}a(jus,"isLetter");function GYt(t,e){if(!t.md.options.html)return!1;let r=t.posMax,n=t.pos;if(t.src.charCodeAt(n)!==60||n+2>=r)return!1;let o=t.src.charCodeAt(n+1);if(o!==33&&o!==63&&o!==47&&!jus(o))return!1;let s=t.src.slice(n).match(YNn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],Qus(c.content)&&t.linkLevel++,qus(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a(GYt,"html_inline");p();var Hus=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Gus=/^&([a-z][a-z0-9]{1,31});/i;function $Yt(t,e){let r=t.pos,n=t.posMax;if(t.src.charCodeAt(r)!==38||r+1>=n)return!1;if(t.src.charCodeAt(r+1)===35){let s=t.src.slice(r).match(Hus);if(s){if(!e){let c=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),l=t.push("text_special","",0);l.content=wrt(c)?hfe(c):hfe(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(Gus);if(s){let c=yke(s[0]);if(c!==s[0]){if(!e){let l=t.push("text_special","",0);l.content=c,l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}}return!1}a($Yt,"entity");p();function tMn(t){let e={},r=t.length;if(!r)return;let n=0,o=-2,s=[];for(let c=0;cu;d-=s[d]+1){let h=t[d];if(h.marker===l.marker&&h.open&&h.end<0){let m=!1;if((h.close||l.open)&&(h.length+l.length)%3===0&&(h.length%3!==0||l.length%3!==0)&&(m=!0),!m){let g=d>0&&!t[d-1].open?s[d-1]+1:0;s[c]=c-d+g,s[d]=g,l.open=!1,h.end=c,h.close=!1,f=-1,o=-2;break}}}f!==-1&&(e[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}a(tMn,"processDelimiters");function VYt(t){let e=t.tokens_meta,r=t.tokens_meta.length;tMn(t.delimiters);for(let n=0;n0&&n++,o[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;c||t.pos++,s[e]=t.pos};Eke.prototype.tokenize=function(t){let e=this.ruler.getRules(""),r=e.length,n=t.posMax,o=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(c){if(t.pos>=n)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Eke.prototype.parse=function(t,e,r,n){let o=new this.State(t,e,r,n);this.tokenize(o);let s=this.ruler2.getRules(""),c=s.length;for(let l=0;l|$))`,e.tpl_email_fuzzy=`(^|${r}|"|\\(|${e.src_ZCc})(${e.src_email_name}@${e.tpl_host_fuzzy_strict})`,e.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${e.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${e.tpl_host_port_fuzzy_strict}${e.src_path})`,e.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${e.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${e.tpl_host_port_no_ip_fuzzy_strict}${e.src_path})`,e}a(KYt,"default");function JYt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(JYt,"assign");function Nrt(t){return Object.prototype.toString.call(t)}a(Nrt,"_class");function $us(t){return Nrt(t)==="[object String]"}a($us,"isString");function Vus(t){return Nrt(t)==="[object Object]"}a(Vus,"isObject");function Wus(t){return Nrt(t)==="[object RegExp]"}a(Wus,"isRegExp");function nMn(t){return Nrt(t)==="[object Function]"}a(nMn,"isFunction");function zus(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(zus,"escapeRE");var oMn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Yus(t){return Object.keys(t||{}).reduce(function(e,r){return e||oMn.hasOwnProperty(r)},!1)}a(Yus,"isOptionsObj");var Kus={"http:":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.http||(r.re.http=new RegExp(`^\\/\\/${r.re.src_auth}${r.re.src_host_port_strict}${r.re.src_path}`,"i")),r.re.http.test(n)?n.match(r.re.http)[0].length:0},"validate")},"https:":"http:","ftp:":"http:","//":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.no_http||(r.re.no_http=new RegExp("^"+r.re.src_auth+`(?:localhost|(?:(?:${r.re.src_domain})\\.)+${r.re.src_domain_root})`+r.re.src_port+r.re.src_host_terminator+r.re.src_path,"i")),r.re.no_http.test(n)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:n.match(r.re.no_http)[0].length:0},"validate")},"mailto:":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.mailto||(r.re.mailto=new RegExp(`^${r.re.src_email_name}@${r.re.src_host_strict}`,"i")),r.re.mailto.test(n)?n.match(r.re.mailto)[0].length:0},"validate")}},Jus="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",Zus="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function Xus(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a(Xus,"createValidator");function iMn(){return function(t,e){e.normalize(t)}}a(iMn,"createNormalizer");function Drt(t){let e=t.re=KYt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(Jus),r.push(e.src_xn),e.src_tlds=r.join("|");function n(l){return l.replace("%TLDS%",e.src_tlds)}a(n,"untpl"),e.email_fuzzy=RegExp(n(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(n(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(n(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(n(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(n(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(n(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(n(e.tpl_host_fuzzy_test),"i");let o=[];t.__compiled__={};function s(l,u){throw new Error(`(LinkifyIt) Invalid schema "${l}": ${u}`)}a(s,"schemaError"),Object.keys(t.__schemas__).forEach(function(l){let u=t.__schemas__[l];if(u===null)return;let d={validate:null,link:null};if(t.__compiled__[l]=d,Vus(u)){Wus(u.validate)?d.validate=Xus(u.validate):nMn(u.validate)?d.validate=u.validate:s(l,u),nMn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=iMn();return}if($us(u)){o.push(l);return}s(l,u)}),o.forEach(function(l){t.__compiled__[t.__schemas__[l]]&&(t.__compiled__[l].validate=t.__compiled__[t.__schemas__[l]].validate,t.__compiled__[l].normalize=t.__compiled__[t.__schemas__[l]].normalize)}),t.__compiled__[""]={validate:null,normalize:iMn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(zus).join("|");t.re.schema_test=RegExp(`(^|(?!_)(?:[><\uFF5C]|${e.src_ZPCc}))(${c})`,"i"),t.re.schema_search=RegExp(`(^|(?!_)(?:[><\uFF5C]|${e.src_ZPCc}))(${c})`,"ig"),t.re.schema_at_start=RegExp(`^${t.re.schema_search.source}`,"i"),t.re.pretest=RegExp(`(${t.re.schema_test.source})|(${t.re.host_fuzzy_test.source})|@`,"i")}a(Drt,"compile");function sMn(t,e,r,n){let o=t.slice(r,n);this.schema=e.toLowerCase(),this.index=r,this.lastIndex=n,this.raw=o,this.text=o,this.url=o}a(sMn,"Match");function RT(t,e){if(!(this instanceof RT))return new RT(t,e);e||Yus(t)&&(e=t,t={}),this.__opts__=JYt({},oMn,e),this.__schemas__=JYt({},Kus,t),this.__compiled__={},this.__tlds__=Zus,this.__tlds_replaced__=!1,this.re={},Drt(this)}a(RT,"LinkifyIt");RT.prototype.add=a(function(e,r){return this.__schemas__[e]=r,Drt(this),this},"add");RT.prototype.set=a(function(e){return this.__opts__=JYt(this.__opts__,e),this},"set");RT.prototype.test=a(function(e){if(!e.length)return!1;let r,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(r=n.exec(e))!==null;)if(this.testSchemaAt(e,r[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)},"test");RT.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");RT.prototype.testSchemaAt=a(function(e,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,n,this):0},"testSchemaAt");RT.prototype.match=a(function(e){let r=[],n=[],o=[],s=[],c,l,u;function d(m,g){return m?g?m.index!==g.index?m.index=g.lastIndex?m:g:m:g}if(a(d,"choose"),!e.length)return null;if(this.re.schema_test.test(e))for(u=this.re.schema_search,u.lastIndex=0;(c=u.exec(e))!==null;)l=this.testSchemaAt(e,c[2],u.lastIndex),l&&n.push({schema:c[2],index:c.index+c[1].length,lastIndex:c.index+c[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(u=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,u.lastIndex=0;(c=u.exec(e))!==null;)o.push({schema:"",index:c.index+c[1].length,lastIndex:c.index+c[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(u=this.re.email_fuzzy_global,u.lastIndex=0;(c=u.exec(e))!==null;)s.push({schema:"mailto:",index:c.index+c[1].length,lastIndex:c.index+c[0].length});let f=[0,0,0],h=0;for(;;){let m=[n[f[0]],s[f[1]],o[f[2]]],g=d(d(m[0],m[1]),m[2]);if(!g)break;if(g===m[0]?f[0]++:g===m[1]?f[1]++:f[2]++,g.index= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ZYt=35,M5=Math.floor,XYt=String.fromCharCode;function Mj(t){throw new RangeError(nds[t])}a(Mj,"error");function ids(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(ids,"map");function lMn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(rds,".");let o=t.split("."),s=ids(o,e).join(".");return n+s}a(lMn,"mapDomain");function uMn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),sds=a(function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:36},"basicToDigit"),cMn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),dMn=a(function(t,e,r){let n=0;for(t=r?M5(t/700):t>>1,t+=M5(t/e);t>ZYt*26>>1;n+=36)t=M5(t/ZYt);return M5(n+(ZYt+1)*t/(t+38))},"adapt"),fMn=a(function(t){let e=[],r=t.length,n=0,o=128,s=72,c=t.lastIndexOf("-");c<0&&(c=0);for(let l=0;l=128&&Mj("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&Mj("invalid-input");let m=sds(t.charCodeAt(l++));m>=36&&Mj("invalid-input"),m>M5((2147483647-n)/f)&&Mj("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(mM5(2147483647/A)&&Mj("overflow"),f*=A}let d=e.length+1;s=dMn(n-u,d,u==0),M5(n/d)>2147483647-o&&Mj("overflow"),o+=M5(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),pMn=a(function(t){let e=[];t=uMn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push(XYt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fM5((2147483647-o)/d)&&Mj("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&Mj("overflow"),f===n){let h=o;for(let m=36;;m+=36){let g=m<=s?1:m>=s+26?26:m-s;if(h=0))try{e.hostname=eKt.toASCII(e.hostname)}catch{}return yrt(ufe(e))}a(hds,"normalizeLink");function mds(t){let e=Ake(t,!0);if(e.hostname&&(!e.protocol||AMn.indexOf(e.protocol)>=0))try{e.hostname=eKt.toUnicode(e.hostname)}catch{}return gke(ufe(e),gke.defaultChars+"%")}a(mds,"normalizeLinkText");function jw(t,e){if(!(this instanceof jw))return new jw(t,e);e||xrt(t)||(e=t||{},t="default"),this.inline=new rMn,this.block=new JNn,this.core=new qNn,this.renderer=new ONn,this.linkify=new aMn,this.validateLink=pds,this.normalizeLink=hds,this.normalizeLinkText=mds,this.utils=aYt,this.helpers=pfe({},dYt),this.options={},this.configure(t),e&&this.set(e)}a(jw,"MarkdownIt");jw.prototype.set=function(t){return pfe(this.options,t),this};jw.prototype.configure=function(t){let e=this;if(xrt(t)){let r=t;if(t=uds[r],!t)throw new Error('Wrong `markdown-it` preset "'+r+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(r){t.components[r].rules&&e[r].ruler.enableOnly(t.components[r].rules),t.components[r].rules2&&e[r].ruler2.enableOnly(t.components[r].rules2)}),this};jw.prototype.enable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.enable(t,!0))},this),r=r.concat(this.inline.ruler2.enable(t,!0));let n=t.filter(function(o){return r.indexOf(o)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this};jw.prototype.disable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.disable(t,!0))},this),r=r.concat(this.inline.ruler2.disable(t,!0));let n=t.filter(function(o){return r.indexOf(o)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this};jw.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};jw.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");let r=new this.core.State(t,this,e);return this.core.process(r),r.tokens};jw.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};jw.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};jw.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var tKt=jw;function rKt(t){return Array.isArray(t)}a(rKt,"isArray");function gds(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||rKt(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a(gds,"isFenceToken");function*yMn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;rKt(r.children)&&(yield*yMn(r.children))}}a(yMn,"flattenTokensLists");function Ads(){return new tKt}a(Ads,"createMarkdownIt");function _Mn(t){let e=[],n=Ads().parse(t,{});if(!rKt(n))return e;for(let o of yMn(n)){if(!o||typeof o!="object")continue;let s=o;if(gds(s)&&s.map){let c=s.map;e.push({startMarkup:s.markup,code:s.content.replace(/\n$/,""),language:s.info.trim(),startLine:c[0],endLine:c[1]})}}return e}a(_Mn,"extractCodeBlocks");function nKt(t){let e=["script","style","iframe","object","embed","form","base","meta","link"],r=/(```[\s\S]*?```|`[^`\n]+?`)/g;return t.split(r).map((o,s)=>{if(s%2===1)return o;let l=new RegExp(`]*)?/?>`,"gi");return o.replace(l,u=>u.replace(//g,">"))}).join("")}a(nKt,"escapeProblematicHtmlTags");var oKt=kn.Gpt4oMini,EMn=new pe("virtualToolSummarizer"),vke=class extends Error{static{a(this,"SummarizerError")}};function vMn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(vMn,"isValidCategoryItem");function CMn(t,e){if(!Array.isArray(t))throw new vke(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(vMn))throw new vke(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(CMn,"validateCategoriesWithoutToolsResponse");function yds(t){return vMn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(yds,"isValidCategorizationItem");function bMn(t,e){if(CMn(t,e),!t.every(yds))throw new vke(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(bMn,"validateCategorizationResponse");function SMn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(SMn,"deduplicateTools");function _ds(t){let e=new Map;for(let r of t){let n=IMn(r.name),o=e.get(n);o?(r.summary&&r.summary!==o.summary&&(o.summary=`${o.summary} +`:">",s},"renderToken");gfe.prototype.renderInline=function(t,e,r){let n="",o=this.rules;for(let s=0,c=t.length;s=0&&(n=this.attrs[r][1]),n},"attrGet");Afe.prototype.attrJoin=a(function(e,r){let n=this.attrIndex(e);n<0?this.attrPush([e,r]):this.attrs[n][1]=this.attrs[n][1]+" "+r},"attrJoin");var ZF=Afe;function BNn(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(BNn,"StateCore");BNn.prototype.Token=ZF;var FNn=BNn;p();var lus=/\r\n?|\n/g,uus=/\0/g;function pYt(t){let e;e=t.src.replace(lus,` +`),e=e.replace(uus,"\uFFFD"),t.src=e}a(pYt,"normalize");p();function hYt(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}a(hYt,"block");p();function mYt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a(dus,"isLinkOpen");function fus(t){return/^<\/a\s*>/i.test(t)}a(fus,"isLinkClose");function gYt(t){let e=t.tokens;if(t.md.options.linkify)for(let r=0,n=e.length;r=0;c--){let l=o[c];if(l.type==="link_close"){for(c--;o[c].level!==l.level&&o[c].type!=="link_open";)c--;continue}if(l.type==="html_inline"&&(dus(l.content)&&s>0&&s--,fus(l.content)&&s++),!(s>0)&&l.type==="text"&&t.md.linkify.test(l.content)){let u=l.content,d=t.md.linkify.match(u),f=[],h=l.level,m=0;d.length>0&&d[0].index===0&&c>0&&o[c-1].type==="text_special"&&(d=d.slice(1));for(let g=0;gm){let w=new t.Token("text","",0);w.content=u.slice(m,E),w.level=h,f.push(w)}let v=new t.Token("link_open","a",1);v.attrs=[["href",y]],v.level=h++,v.markup="linkify",v.info="auto",f.push(v);let S=new t.Token("text","",0);S.content=_,S.level=h,f.push(S);let T=new t.Token("link_close","a",-1);T.level=--h,T.markup="linkify",T.info="auto",f.push(T),m=d[g].lastIndex}if(m=0;r--){let n=t[r];n.type==="text"&&!e&&(n.content=n.content.replace(hus,gus)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(Aus,"replace_scoped");function yus(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&UNn.test(n.content)&&(n.content=n.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(yus,"replace_rare");function AYt(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(pus.test(t.tokens[e].content)&&Aus(t.tokens[e].children),UNn.test(t.tokens[e].content)&&yus(t.tokens[e].children))}a(AYt,"replace");p();var _us=/['"]/,QNn=/['"]/g,qNn="\u2019";function Rrt(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(Rrt,"addReplacement");function Eus(t,e){let r="",n=0;e.sort((o,s)=>o.pos-s.pos);for(let o=0;o=0&&!(n[r].level<=l);r--);if(n.length=r+1,c.type!=="text")continue;let u=c.content,d=0,f=u.length;e:for(;d=0)y=u.charCodeAt(h.index-1);else for(r=s-1;r>=0&&!(t[r].type==="softbreak"||t[r].type==="hardbreak");r--)if(t[r].content){y=t[r].content.charCodeAt(t[r].content.length-1);break}let _=32;if(d=48&&y<=57&&(g=m=!1),m&&g&&(m=E,g=v),!m&&!g){A&&Rrt(o,s,h.index,qNn);continue}if(g)for(r=n.length-1;r>=0;r--){let w=n[r];if(n[r].level=0;e--)t.tokens[e].type!=="inline"||!_us.test(t.tokens[e].content)||vus(t.tokens[e].children,t)}a(yYt,"smartquotes");p();function _Yt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};N5.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");N5.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!na(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");N5.prototype.skipChars=a(function(e,r){for(let n=this.src.length;en;)if(r!==this.src.charCodeAt(--e))return e+1;return e},"skipCharsBack");N5.prototype.getLines=a(function(e,r,n,o){if(e>=r)return"";let s=new Array(r-e);for(let c=0,l=e;ln?s[c]=new Array(u-n+1).join(" ")+this.src.slice(f,h):s[c]=this.src.slice(f,h)}return s.join("")},"getLines");N5.prototype.Token=ZF;var HNn=N5;p();var Cus=65536;function CYt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(CYt,"getLine");function GNn(t){let e=[],r=t.length,n=0,o=t.charCodeAt(n),s=!1,c=0,l="";for(;nr)return!1;let o=e+1;if(t.sCount[o]=4)return!1;let s=t.bMarks[o]+t.tShift[o];if(s>=t.eMarks[o])return!1;let c=t.src.charCodeAt(s++);if(c!==124&&c!==45&&c!==58||s>=t.eMarks[o])return!1;let l=t.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!na(l)||c===45&&na(l))return!1;for(;s=4)return!1;d=GNn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();let h=d.length;if(h===0||h!==f.length)return!1;if(n)return!0;let m=t.parentType;t.parentType="table";let g=t.md.block.ruler.getRules("blockquote"),A=t.push("table_open","table",1),y=[e,0];A.map=y;let _=t.push("thead_open","thead",1);_.map=[e,e+1];let E=t.push("tr_open","tr",1);E.map=[e,e+1];for(let T=0;T=4||(d=GNn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),S+=h-d.length,S>Cus))break;if(o===e+2){let R=t.push("tbody_open","tbody",1);R.map=v=[e+2,0]}let w=t.push("tr_open","tr",1);w.map=[o,o+1];for(let R=0;R=4){n++,o=n;continue}break}t.line=o;let s=t.push("code_block","code",0);return s.content=t.getLines(e,o,4+t.blkIndent,!1)+` +`,s.map=[e,t.line],!0}a(SYt,"code");p();function TYt(t,e,r,n){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||o+3>s)return!1;let c=t.src.charCodeAt(o);if(c!==126&&c!==96)return!1;let l=o;o=t.skipChars(o,c);let u=o-l;if(u<3)return!1;let d=t.src.slice(l,o),f=t.src.slice(o,s);if(c===96&&f.indexOf(String.fromCharCode(c))>=0)return!1;if(n)return!0;let h=e,m=!1;for(;h++,!(h>=r||(o=l=t.bMarks[h]+t.tShift[h],s=t.eMarks[h],o=4)&&(o=t.skipChars(o,c),!(o-l=4||t.src.charCodeAt(o)!==62)return!1;if(n)return!0;let l=[],u=[],d=[],f=[],h=t.md.block.ruler.getRules("blockquote"),m=t.parentType;t.parentType="blockquote";let g=!1,A;for(A=e;A=s)break;if(t.src.charCodeAt(o++)===62&&!S){let w=t.sCount[A]+1,R,x;t.src.charCodeAt(o)===32?(o++,w++,x=!1,R=!0):t.src.charCodeAt(o)===9?(R=!0,(t.bsCount[A]+w)%4===3?(o++,w++,x=!1):x=!0):R=!1;let k=w;for(l.push(t.bMarks[A]),t.bMarks[A]=o;o=s,u.push(t.bsCount[A]),t.bsCount[A]=t.sCount[A]+1+(R?1:0),d.push(t.sCount[A]),t.sCount[A]=k-w,f.push(t.tShift[A]),t.tShift[A]=o-t.bMarks[A];continue}if(g)break;let T=!1;for(let w=0,R=h.length;w";let E=[e,0];_.map=E,t.md.block.tokenize(t,e,A);let v=t.push("blockquote_close","blockquote",-1);v.markup=">",t.lineMax=c,t.parentType=m,E[1]=t.line;for(let S=0;S=4)return!1;let s=t.bMarks[e]+t.tShift[e],c=t.src.charCodeAt(s++);if(c!==42&&c!==45&&c!==95)return!1;let l=1;for(;s=n)return-1;let s=t.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=n)return-1;if(s=t.src.charCodeAt(o++),s>=48&&s<=57){if(o-r>=10)return-1;continue}if(s===41||s===46)break;return-1}return o=4||t.listIndent>=0&&t.sCount[u]-t.listIndent>=4&&t.sCount[u]=t.blkIndent&&(f=!0);let h,m,g;if((g=VNn(t,u))>=0){if(h=!0,c=t.bMarks[u]+t.tShift[u],m=Number(t.src.slice(c,g-1)),f&&m!==1)return!1}else if((g=$Nn(t,u))>=0)h=!1;else return!1;if(f&&t.skipSpaces(g)>=t.eMarks[u])return!1;if(n)return!0;let A=t.src.charCodeAt(g-1),y=t.tokens.length;h?(l=t.push("ordered_list_open","ol",1),m!==1&&(l.attrs=[["start",m]])):l=t.push("bullet_list_open","ul",1);let _=[u,0];l.map=_,l.markup=String.fromCharCode(A);let E=!1,v=t.md.block.ruler.getRules("list"),S=t.parentType;for(t.parentType="list";u=o?x=1:x=w-T,x>4&&(x=1);let k=T+x;l=t.push("list_item_open","li",1),l.markup=String.fromCharCode(A);let D=[u,0];l.map=D,h&&(l.info=t.src.slice(c,g-1));let N=t.tight,O=t.tShift[u],B=t.sCount[u],q=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=k,t.tight=!0,t.tShift[u]=R-t.bMarks[u],t.sCount[u]=w,R>=o&&t.isEmpty(u+1)?t.line=Math.min(t.line+2,r):t.md.block.tokenize(t,u,r,!0),(!t.tight||E)&&(d=!1),E=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=q,t.tShift[u]=O,t.sCount[u]=B,t.tight=N,l=t.push("list_item_close","li",-1),l.markup=String.fromCharCode(A),u=t.line,D[1]=u,u>=r||t.sCount[u]=4)break;let M=!1;for(let L=0,U=v.length;L=4||t.src.charCodeAt(o)!==91)return!1;function l(v){let S=t.lineMax;if(v>=S||t.isEmpty(v))return null;let T=!1;if(t.sCount[v]-t.blkIndent>3&&(T=!0),t.sCount[v]<0&&(T=!0),!T){let x=t.md.block.ruler.getRules("reference"),k=t.parentType;t.parentType="reference";let D=!1;for(let N=0,O=x.length;N"u"&&(t.env.references={}),typeof t.env.references[E]>"u"&&(t.env.references[E]={title:_,href:h}),t.line=c),!0):!1}a(RYt,"reference");p();p();var WNn=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];p();var Sus="[a-zA-Z_:][a-zA-Z0-9:._-]*",Tus="[^\"'=<>`\\x00-\\x20]+",Ius="'[^']*'",xus='"[^"]*"',wus="(?:"+Tus+"|"+Ius+"|"+xus+")",Rus="(?:\\s+"+Sus+"(?:\\s*=\\s*"+wus+")?)",zNn="<[A-Za-z][A-Za-z0-9\\-]*"+Rus+"*\\s*\\/?>",YNn="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",kus="",Pus="<[?][\\s\\S]*?[?]>",Dus="]*>",Nus="",KNn=new RegExp("^(?:"+zNn+"|"+YNn+"|"+kus+"|"+Pus+"|"+Dus+"|"+Nus+")"),JNn=new RegExp("^(?:"+zNn+"|"+YNn+")");var vZ=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(JNn.source+"\\s*$"),/^$/,!1]];function kYt(t,e,r,n){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(o)!==60)return!1;let c=t.src.slice(o,s),l=0;for(;l=4)return!1;let c=t.src.charCodeAt(o);if(c!==35||o>=s)return!1;let l=1;for(c=t.src.charCodeAt(++o);c===35&&o6||oo&&na(t.src.charCodeAt(u-1))&&(s=u),t.line=e+1;let d=t.push("heading_open","h"+String(l),1);d.markup="########".slice(0,l),d.map=[e,t.line];let f=t.push("inline","",0);f.content=_Z(t.src.slice(o,s)),f.map=[e,t.line],f.children=[];let h=t.push("heading_close","h"+String(l),-1);return h.markup="########".slice(0,l),!0}a(PYt,"heading");p();function DYt(t,e,r){let n=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;let o=t.parentType;t.parentType="paragraph";let s=0,c,l=e+1;for(;l3)continue;if(t.sCount[l]>=t.blkIndent){let g=t.bMarks[l]+t.tShift[l],A=t.eMarks[l];if(g=A))){s=c===61?1:2;break}}if(t.sCount[l]<0)continue;let m=!1;for(let g=0,A=n.length;g3||t.sCount[s]<0)continue;let d=!1;for(let f=0,h=n.length;f=r||t.sCount[c]=s){t.line=r;break}let u=t.line,d=!1;for(let f=0;f=t.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");t.tight=!l,t.isEmpty(t.line-1)&&(l=!0),c=t.line,c0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(o),n};_ke.prototype.scanDelims=function(t,e){let r=this.posMax,n=this.src.charCodeAt(t),o;if(t===0)o=32;else if(t===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(t-1),(o&64512)===56320){let _=this.src.charCodeAt(t-2);o=(_&64512)===55296?65536+(_-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let s=t;for(;s0)return!1;let r=t.pos,n=t.posMax;if(r+3>n||t.src.charCodeAt(r)!==58||t.src.charCodeAt(r+1)!==47||t.src.charCodeAt(r+2)!==47)return!1;let o=t.pending.match(Ous);if(!o)return!1;let s=o[1],c=t.md.linkify.matchAtStart(t.src.slice(r-s.length));if(!c)return!1;let l=c.url;if(l.length<=s.length)return!1;let u=l.length;for(;u>0&&l.charCodeAt(u-1)===42;)u--;u!==l.length&&(l=l.slice(0,u));let d=t.md.normalizeLink(l);if(!t.md.validateLink(d))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);let f=t.push("link_open","a",1);f.attrs=[["href",d]],f.markup="linkify",f.info="auto";let h=t.push("text","",0);h.content=t.md.normalizeLinkText(l);let m=t.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return t.pos+=l.length-s.length,!0}a(OYt,"linkify");p();function LYt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==10)return!1;let n=t.pending.length-1,o=t.posMax;if(!e)if(n>=0&&t.pending.charCodeAt(n)===32)if(n>=1&&t.pending.charCodeAt(n-1)===32){let s=n-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(r++;r?@[]^_`{|}~-".split("").forEach(function(t){BYt[t.charCodeAt(0)]=1});function FYt(t,e){let r=t.pos,n=t.posMax;if(t.src.charCodeAt(r)!==92||(r++,r>=n))return!1;let o=t.src.charCodeAt(r);if(o===10){for(e||t.push("hardbreak","br",0),r++;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s+=t.src[r+1],r++)}let c="\\"+s;if(!e){let l=t.push("text_special","",0);o<256&&BYt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(FYt,"escape");p();function UYt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==96)return!1;let o=r;r++;let s=t.posMax;for(;r=0;n--){let o=e[n];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;let s=e[o.end],c=n>0&&e[n-1].end===o.end+1&&e[n-1].marker===o.marker&&e[n-1].token===o.token-1&&e[o.end+1].token===s.token+1,l=String.fromCharCode(o.marker),u=t.tokens[o.token];u.type=c?"strong_open":"em_open",u.tag=c?"strong":"em",u.nesting=1,u.markup=c?l+l:l,u.content="";let d=t.tokens[s.token];d.type=c?"strong_close":"em_close",d.tag=c?"strong":"em",d.nesting=-1,d.markup=c?l+l:l,d.content="",c&&(t.tokens[e[n-1].token].content="",t.tokens[e[o.end+1].token].content="",n--)}}a(tMn,"postProcess");function Uus(t){let e=t.tokens_meta,r=t.tokens_meta.length;tMn(t,t.delimiters);for(let n=0;n=h)return!1;if(u=A,o=t.md.helpers.parseLinkDestination(t.src,A,t.posMax),o.ok){for(c=t.md.normalizeLink(o.str),t.md.validateLink(c)?A=o.pos:c="",u=A;A=h||t.src.charCodeAt(A)!==41)&&(d=!0),A++}if(d){if(typeof t.env.references>"u")return!1;if(A=0?n=t.src.slice(u,A++):A=g+1):A=g+1,n||(n=t.src.slice(m,g)),s=t.env.references[yZ(n)],!s)return t.pos=f,!1;c=s.href,l=s.title}if(!e){t.pos=m,t.posMax=g;let y=t.push("link_open","a",1),_=[["href",c]];y.attrs=_,l&&_.push(["title",l]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=A,t.posMax=h,!0}a(jYt,"link");p();function HYt(t,e){let r,n,o,s,c,l,u,d,f="",h=t.pos,m=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;let g=t.pos+2,A=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(A<0)return!1;if(s=A+1,s=m)return!1;for(d=s,l=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),l.ok&&(f=t.md.normalizeLink(l.str),t.md.validateLink(f)?s=l.pos:f=""),d=s;s=m||t.src.charCodeAt(s)!==41)return t.pos=h,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s=0?o=t.src.slice(d,s++):s=A+1):s=A+1,o||(o=t.src.slice(g,A)),c=t.env.references[yZ(o)],!c)return t.pos=h,!1;f=c.href,u=c.title}if(!e){n=t.src.slice(g,A);let y=[];t.md.inline.parse(n,t.md,t.env,y);let _=t.push("image","img",0),E=[["src",f],["alt",""]];_.attrs=E,_.children=y,_.content=n,u&&E.push(["title",u])}return t.pos=s,t.posMax=m,!0}a(HYt,"image");p();var Qus=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,qus=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function GYt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==60)return!1;let n=t.pos,o=t.posMax;for(;;){if(++r>=o)return!1;let c=t.src.charCodeAt(r);if(c===60)return!1;if(c===62)break}let s=t.src.slice(n+1,r);if(qus.test(s)){let c=t.md.normalizeLink(s);if(!t.md.validateLink(c))return!1;if(!e){let l=t.push("link_open","a",1);l.attrs=[["href",c]],l.markup="autolink",l.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);let d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}if(Qus.test(s)){let c=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(c))return!1;if(!e){let l=t.push("link_open","a",1);l.attrs=[["href",c]],l.markup="autolink",l.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);let d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}return!1}a(GYt,"autolink");p();function jus(t){return/^\s]/i.test(t)}a(jus,"isLinkOpen");function Hus(t){return/^<\/a\s*>/i.test(t)}a(Hus,"isLinkClose");function Gus(t){let e=t|32;return e>=97&&e<=122}a(Gus,"isLetter");function $Yt(t,e){if(!t.md.options.html)return!1;let r=t.posMax,n=t.pos;if(t.src.charCodeAt(n)!==60||n+2>=r)return!1;let o=t.src.charCodeAt(n+1);if(o!==33&&o!==63&&o!==47&&!Gus(o))return!1;let s=t.src.slice(n).match(KNn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],jus(c.content)&&t.linkLevel++,Hus(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a($Yt,"html_inline");p();var $us=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Vus=/^&([a-z][a-z0-9]{1,31});/i;function VYt(t,e){let r=t.pos,n=t.posMax;if(t.src.charCodeAt(r)!==38||r+1>=n)return!1;if(t.src.charCodeAt(r+1)===35){let s=t.src.slice(r).match($us);if(s){if(!e){let c=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),l=t.push("text_special","",0);l.content=wrt(c)?mfe(c):mfe(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(Vus);if(s){let c=yke(s[0]);if(c!==s[0]){if(!e){let l=t.push("text_special","",0);l.content=c,l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}}return!1}a(VYt,"entity");p();function rMn(t){let e={},r=t.length;if(!r)return;let n=0,o=-2,s=[];for(let c=0;cu;d-=s[d]+1){let h=t[d];if(h.marker===l.marker&&h.open&&h.end<0){let m=!1;if((h.close||l.open)&&(h.length+l.length)%3===0&&(h.length%3!==0||l.length%3!==0)&&(m=!0),!m){let g=d>0&&!t[d-1].open?s[d-1]+1:0;s[c]=c-d+g,s[d]=g,l.open=!1,h.end=c,h.close=!1,f=-1,o=-2;break}}}f!==-1&&(e[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}a(rMn,"processDelimiters");function WYt(t){let e=t.tokens_meta,r=t.tokens_meta.length;rMn(t.delimiters);for(let n=0;n0&&n++,o[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;c||t.pos++,s[e]=t.pos};Eke.prototype.tokenize=function(t){let e=this.ruler.getRules(""),r=e.length,n=t.posMax,o=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(c){if(t.pos>=n)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Eke.prototype.parse=function(t,e,r,n){let o=new this.State(t,e,r,n);this.tokenize(o);let s=this.ruler2.getRules(""),c=s.length;for(let l=0;l|$))`,e.tpl_email_fuzzy=`(^|${r}|"|\\(|${e.src_ZCc})(${e.src_email_name}@${e.tpl_host_fuzzy_strict})`,e.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${e.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${e.tpl_host_port_fuzzy_strict}${e.src_path})`,e.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${e.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${e.tpl_host_port_no_ip_fuzzy_strict}${e.src_path})`,e}a(JYt,"default");function ZYt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(ZYt,"assign");function Nrt(t){return Object.prototype.toString.call(t)}a(Nrt,"_class");function Wus(t){return Nrt(t)==="[object String]"}a(Wus,"isString");function zus(t){return Nrt(t)==="[object Object]"}a(zus,"isObject");function Yus(t){return Nrt(t)==="[object RegExp]"}a(Yus,"isRegExp");function iMn(t){return Nrt(t)==="[object Function]"}a(iMn,"isFunction");function Kus(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(Kus,"escapeRE");var sMn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Jus(t){return Object.keys(t||{}).reduce(function(e,r){return e||sMn.hasOwnProperty(r)},!1)}a(Jus,"isOptionsObj");var Zus={"http:":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.http||(r.re.http=new RegExp(`^\\/\\/${r.re.src_auth}${r.re.src_host_port_strict}${r.re.src_path}`,"i")),r.re.http.test(n)?n.match(r.re.http)[0].length:0},"validate")},"https:":"http:","ftp:":"http:","//":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.no_http||(r.re.no_http=new RegExp("^"+r.re.src_auth+`(?:localhost|(?:(?:${r.re.src_domain})\\.)+${r.re.src_domain_root})`+r.re.src_port+r.re.src_host_terminator+r.re.src_path,"i")),r.re.no_http.test(n)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:n.match(r.re.no_http)[0].length:0},"validate")},"mailto:":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.mailto||(r.re.mailto=new RegExp(`^${r.re.src_email_name}@${r.re.src_host_strict}`,"i")),r.re.mailto.test(n)?n.match(r.re.mailto)[0].length:0},"validate")}},Xus="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",eds="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function tds(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a(tds,"createValidator");function oMn(){return function(t,e){e.normalize(t)}}a(oMn,"createNormalizer");function Drt(t){let e=t.re=JYt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(Xus),r.push(e.src_xn),e.src_tlds=r.join("|");function n(l){return l.replace("%TLDS%",e.src_tlds)}a(n,"untpl"),e.email_fuzzy=RegExp(n(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(n(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(n(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(n(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(n(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(n(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(n(e.tpl_host_fuzzy_test),"i");let o=[];t.__compiled__={};function s(l,u){throw new Error(`(LinkifyIt) Invalid schema "${l}": ${u}`)}a(s,"schemaError"),Object.keys(t.__schemas__).forEach(function(l){let u=t.__schemas__[l];if(u===null)return;let d={validate:null,link:null};if(t.__compiled__[l]=d,zus(u)){Yus(u.validate)?d.validate=tds(u.validate):iMn(u.validate)?d.validate=u.validate:s(l,u),iMn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=oMn();return}if(Wus(u)){o.push(l);return}s(l,u)}),o.forEach(function(l){t.__compiled__[t.__schemas__[l]]&&(t.__compiled__[l].validate=t.__compiled__[t.__schemas__[l]].validate,t.__compiled__[l].normalize=t.__compiled__[t.__schemas__[l]].normalize)}),t.__compiled__[""]={validate:null,normalize:oMn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(Kus).join("|");t.re.schema_test=RegExp(`(^|(?!_)(?:[><\uFF5C]|${e.src_ZPCc}))(${c})`,"i"),t.re.schema_search=RegExp(`(^|(?!_)(?:[><\uFF5C]|${e.src_ZPCc}))(${c})`,"ig"),t.re.schema_at_start=RegExp(`^${t.re.schema_search.source}`,"i"),t.re.pretest=RegExp(`(${t.re.schema_test.source})|(${t.re.host_fuzzy_test.source})|@`,"i")}a(Drt,"compile");function aMn(t,e,r,n){let o=t.slice(r,n);this.schema=e.toLowerCase(),this.index=r,this.lastIndex=n,this.raw=o,this.text=o,this.url=o}a(aMn,"Match");function RT(t,e){if(!(this instanceof RT))return new RT(t,e);e||Jus(t)&&(e=t,t={}),this.__opts__=ZYt({},sMn,e),this.__schemas__=ZYt({},Zus,t),this.__compiled__={},this.__tlds__=eds,this.__tlds_replaced__=!1,this.re={},Drt(this)}a(RT,"LinkifyIt");RT.prototype.add=a(function(e,r){return this.__schemas__[e]=r,Drt(this),this},"add");RT.prototype.set=a(function(e){return this.__opts__=ZYt(this.__opts__,e),this},"set");RT.prototype.test=a(function(e){if(!e.length)return!1;let r,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(r=n.exec(e))!==null;)if(this.testSchemaAt(e,r[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)},"test");RT.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");RT.prototype.testSchemaAt=a(function(e,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,n,this):0},"testSchemaAt");RT.prototype.match=a(function(e){let r=[],n=[],o=[],s=[],c,l,u;function d(m,g){return m?g?m.index!==g.index?m.index=g.lastIndex?m:g:m:g}if(a(d,"choose"),!e.length)return null;if(this.re.schema_test.test(e))for(u=this.re.schema_search,u.lastIndex=0;(c=u.exec(e))!==null;)l=this.testSchemaAt(e,c[2],u.lastIndex),l&&n.push({schema:c[2],index:c.index+c[1].length,lastIndex:c.index+c[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(u=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,u.lastIndex=0;(c=u.exec(e))!==null;)o.push({schema:"",index:c.index+c[1].length,lastIndex:c.index+c[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(u=this.re.email_fuzzy_global,u.lastIndex=0;(c=u.exec(e))!==null;)s.push({schema:"mailto:",index:c.index+c[1].length,lastIndex:c.index+c[0].length});let f=[0,0,0],h=0;for(;;){let m=[n[f[0]],s[f[1]],o[f[2]]],g=d(d(m[0],m[1]),m[2]);if(!g)break;if(g===m[0]?f[0]++:g===m[1]?f[1]++:f[2]++,g.index= 0x80 (not a basic code point)","invalid-input":"Invalid input"},XYt=35,M5=Math.floor,eKt=String.fromCharCode;function Mj(t){throw new RangeError(ods[t])}a(Mj,"error");function sds(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(sds,"map");function uMn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(ids,".");let o=t.split("."),s=sds(o,e).join(".");return n+s}a(uMn,"mapDomain");function dMn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),cds=a(function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:36},"basicToDigit"),lMn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),fMn=a(function(t,e,r){let n=0;for(t=r?M5(t/700):t>>1,t+=M5(t/e);t>XYt*26>>1;n+=36)t=M5(t/XYt);return M5(n+(XYt+1)*t/(t+38))},"adapt"),pMn=a(function(t){let e=[],r=t.length,n=0,o=128,s=72,c=t.lastIndexOf("-");c<0&&(c=0);for(let l=0;l=128&&Mj("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&Mj("invalid-input");let m=cds(t.charCodeAt(l++));m>=36&&Mj("invalid-input"),m>M5((2147483647-n)/f)&&Mj("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(mM5(2147483647/A)&&Mj("overflow"),f*=A}let d=e.length+1;s=fMn(n-u,d,u==0),M5(n/d)>2147483647-o&&Mj("overflow"),o+=M5(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),hMn=a(function(t){let e=[];t=dMn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push(eKt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fM5((2147483647-o)/d)&&Mj("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&Mj("overflow"),f===n){let h=o;for(let m=36;;m+=36){let g=m<=s?1:m>=s+26?26:m-s;if(h=0))try{e.hostname=tKt.toASCII(e.hostname)}catch{}return yrt(dfe(e))}a(gds,"normalizeLink");function Ads(t){let e=Ake(t,!0);if(e.hostname&&(!e.protocol||yMn.indexOf(e.protocol)>=0))try{e.hostname=tKt.toUnicode(e.hostname)}catch{}return gke(dfe(e),gke.defaultChars+"%")}a(Ads,"normalizeLinkText");function jw(t,e){if(!(this instanceof jw))return new jw(t,e);e||xrt(t)||(e=t||{},t="default"),this.inline=new nMn,this.block=new ZNn,this.core=new jNn,this.renderer=new LNn,this.linkify=new cMn,this.validateLink=mds,this.normalizeLink=gds,this.normalizeLinkText=Ads,this.utils=cYt,this.helpers=hfe({},fYt),this.options={},this.configure(t),e&&this.set(e)}a(jw,"MarkdownIt");jw.prototype.set=function(t){return hfe(this.options,t),this};jw.prototype.configure=function(t){let e=this;if(xrt(t)){let r=t;if(t=fds[r],!t)throw new Error('Wrong `markdown-it` preset "'+r+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(r){t.components[r].rules&&e[r].ruler.enableOnly(t.components[r].rules),t.components[r].rules2&&e[r].ruler2.enableOnly(t.components[r].rules2)}),this};jw.prototype.enable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.enable(t,!0))},this),r=r.concat(this.inline.ruler2.enable(t,!0));let n=t.filter(function(o){return r.indexOf(o)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this};jw.prototype.disable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.disable(t,!0))},this),r=r.concat(this.inline.ruler2.disable(t,!0));let n=t.filter(function(o){return r.indexOf(o)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this};jw.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};jw.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");let r=new this.core.State(t,this,e);return this.core.process(r),r.tokens};jw.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};jw.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};jw.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var rKt=jw;function nKt(t){return Array.isArray(t)}a(nKt,"isArray");function yds(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||nKt(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a(yds,"isFenceToken");function*_Mn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;nKt(r.children)&&(yield*_Mn(r.children))}}a(_Mn,"flattenTokensLists");function _ds(){return new rKt}a(_ds,"createMarkdownIt");function EMn(t){let e=[],n=_ds().parse(t,{});if(!nKt(n))return e;for(let o of _Mn(n)){if(!o||typeof o!="object")continue;let s=o;if(yds(s)&&s.map){let c=s.map;e.push({startMarkup:s.markup,code:s.content.replace(/\n$/,""),language:s.info.trim(),startLine:c[0],endLine:c[1]})}}return e}a(EMn,"extractCodeBlocks");function iKt(t){let e=["script","style","iframe","object","embed","form","base","meta","link"],r=/(```[\s\S]*?```|`[^`\n]+?`)/g;return t.split(r).map((o,s)=>{if(s%2===1)return o;let l=new RegExp(`]*)?/?>`,"gi");return o.replace(l,u=>u.replace(//g,">"))}).join("")}a(iKt,"escapeProblematicHtmlTags");var sKt=kn.Gpt4oMini,vMn=new pe("virtualToolSummarizer"),vke=class extends Error{static{a(this,"SummarizerError")}};function CMn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(CMn,"isValidCategoryItem");function bMn(t,e){if(!Array.isArray(t))throw new vke(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(CMn))throw new vke(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(bMn,"validateCategoriesWithoutToolsResponse");function Eds(t){return CMn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(Eds,"isValidCategorizationItem");function SMn(t,e){if(bMn(t,e),!t.every(Eds))throw new vke(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(SMn,"validateCategorizationResponse");function TMn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(TMn,"deduplicateTools");function vds(t){let e=new Map;for(let r of t){let n=xMn(r.name),o=e.get(n);o?(r.summary&&r.summary!==o.summary&&(o.summary=`${o.summary} -${r.summary}`),o.tools=o.tools.concat(r.tools)):e.set(r.name,{tools:r.tools,name:n,summary:r.summary})}for(let r of e.values())r.tools=SMn(r.tools);return[...e.values()]}a(_ds,"validateAndCleanupCategories");function TMn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(fNn)}));return _ds(r)}a(TMn,"processCategorizationResponse");function IMn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(IMn,"normalizeGroupName");function iKt(t,e){let r=new Map(e);for(let n of t)for(let o of n.tools)r.delete(o.name);return r.size>0&&t.push({name:crt,summary:iNn,tools:[...r.values()]}),t}a(iKt,"addUncategorizedToolsIfNeeded");async function sKt(t,e,r,n){if(n.isCancellationRequested)return EMn.debug(t.ctx,"Summarization cancelled"),null;let o=WA.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await fl(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new mc(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return EMn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of _Mn(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(sKt,"getResponse");async function xMn(t,e,r){let n=await t.ctx.get(dl).getBestChatModelConfig([oKt]),s=await gp.create(prt,{tools:e},n).renderPrompt(void 0,r),c=await sKt(t,s,n,r);if(!c)return;let l=[c];return CMn(l,"categorizer"),{...l[0],tools:SMn(e),name:IMn(l[0].name)}}a(xMn,"summarizeToolGroup");async function wMn(t,e,r){let n=await t.ctx.get(dl).getBestChatModelConfig([oKt]),s=await gp.create(hrt,{tools:e},n).renderPrompt(void 0,r),c=await sKt(t,s,n,r);if(!c)return;bMn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=TMn(c,l),d=new Set(u.flatMap(h=>h.tools.map(m=>m.name))),f=e.filter(h=>!d.has(h.name));if(f.length>0){let h=await aKt(t,u,f,r);h&&(u=h),u=iKt(u,l)}return u}a(wMn,"divideToolsIntoGroups");async function aKt(t,e,r,n){let o=await t.ctx.get(dl).getBestChatModelConfig([oKt]),c=await gp.create(mrt,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await sKt(t,c,o,n);if(!l)return;bMn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=TMn(l,d);return iKt(f,d)}a(aKt,"divideToolsIntoExistingGroups");var PMn=fe(require("crypto"));var cKt=new pe("virtualToolGrouper"),kMn="builtin",bds=`Call this tool when you need access to a new category of tools. The category of tools is described as follows: +${r.summary}`),o.tools=o.tools.concat(r.tools)):e.set(r.name,{tools:r.tools,name:n,summary:r.summary})}for(let r of e.values())r.tools=TMn(r.tools);return[...e.values()]}a(vds,"validateAndCleanupCategories");function IMn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(pNn)}));return vds(r)}a(IMn,"processCategorizationResponse");function xMn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(xMn,"normalizeGroupName");function oKt(t,e){let r=new Map(e);for(let n of t)for(let o of n.tools)r.delete(o.name);return r.size>0&&t.push({name:crt,summary:oNn,tools:[...r.values()]}),t}a(oKt,"addUncategorizedToolsIfNeeded");async function aKt(t,e,r,n){if(n.isCancellationRequested)return vMn.debug(t.ctx,"Summarization cancelled"),null;let o=WA.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await fl(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new mc(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return vMn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of EMn(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(aKt,"getResponse");async function wMn(t,e,r){let n=await t.ctx.get(dl).getBestChatModelConfig([sKt]),s=await gp.create(prt,{tools:e},n).renderPrompt(void 0,r),c=await aKt(t,s,n,r);if(!c)return;let l=[c];return bMn(l,"categorizer"),{...l[0],tools:TMn(e),name:xMn(l[0].name)}}a(wMn,"summarizeToolGroup");async function RMn(t,e,r){let n=await t.ctx.get(dl).getBestChatModelConfig([sKt]),s=await gp.create(hrt,{tools:e},n).renderPrompt(void 0,r),c=await aKt(t,s,n,r);if(!c)return;SMn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=IMn(c,l),d=new Set(u.flatMap(h=>h.tools.map(m=>m.name))),f=e.filter(h=>!d.has(h.name));if(f.length>0){let h=await cKt(t,u,f,r);h&&(u=h),u=oKt(u,l)}return u}a(RMn,"divideToolsIntoGroups");async function cKt(t,e,r,n){let o=await t.ctx.get(dl).getBestChatModelConfig([sKt]),c=await gp.create(mrt,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await aKt(t,c,o,n);if(!l)return;SMn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=IMn(l,d);return oKt(f,d)}a(cKt,"divideToolsIntoExistingGroups");var DMn=fe(require("crypto"));var lKt=new pe("virtualToolGrouper"),PMn="builtin",Tds=`Call this tool when you need access to a new category of tools. The category of tools is described as follows: -`,Sds=` +`,Ids=` -Be sure to call this tool if you need a capability related to the above.`,Mrt=class{static{a(this,"VirtualToolGrouper")}constructor(e){this.turnContext=e}async addGroups(e,r,n){if(r.lengthu.type==="mcp"?"mcp_"+u.toolProvider.id:u.type==="client"||u.type==="shared"?kMn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof Av&&(s.set(u.name,u),u.metadata.toolsetKey&&c.set(u.metadata.toolsetKey,u.metadata.groups));if(n.isCancellationRequested)return;let l=await Promise.all(Object.entries(o).map(([u,d])=>{if(u===kMn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof yJ);if(this.getKey(h)===this.getKey(d))return f}return this._generateGroupsFromToolset(u,d,c.get(u),n)}}));e.contents=this._deduplicateGroups(l.flat());for(let u of e.all())if(u instanceof Av){let d=s.get(u.name);d&&(u.isExpanded=d.isExpanded,u.metadata.preExpanded=d.metadata.preExpanded,u.lastUsedOnTurn=d.lastUsedOnTurn)}this._reExpandToolsToHitBudget(e)}async _generateGroupsFromToolset(e,r,n,o){if(r.length<=2)return r;let s=0,c;for(;!c&&s<3;s++){if(o.isCancellationRequested)return[];try{c=await(r.length<=16?this._summarizeToolGroup(r,o):this._divideToolsIntoGroups(r,n,o))}catch(d){cKt.error(this.turnContext.ctx,`Failed to categorize tools: ${ld(d)}`)}}cKt.info(this.turnContext.ctx,`Tool categorization completed after ${s} attempt(s).`);let l=[];if(!c)l=r;else{let d=c.findIndex(f=>f.name===crt);d>=0&&(l=c[d].tools,c.splice(d,1))}return(c?.map(d=>{let f=r[0].toolProvider,h=f.displayNamePrefix??f.id;return new Av(Pj+d.name,bds+d.summary+Sds,0,{toolsetKey:e,groups:c,possiblePrefix:h?.replaceAll(/[^a-zA-Z0-9]/g,"_").slice(0,10)+"_"},d.tools)})||[]).concat(l)}_reExpandToolsToHitBudget(e){let r=e.tools().length;if(r>64)return;let n=e.contents.filter(o=>o instanceof Av&&!o.isExpanded).sort((o,s)=>o.contents.length-s.contents.length);for(let o of n){let s=r-1+o.contents.length;if(s>128||(o.isExpanded=!0,o.metadata.preExpanded=!0,r=s,r>64))break}}async _summarizeToolGroup(e,r){let n=await xMn(this.turnContext,e,r);return n&&[n]}async _divideToolsIntoGroups(e,r,n){if(r){let s=new Set(e.map(c=>c.name));r=r.map(c=>({...c,tools:c.tools.filter(l=>s.has(l.name))})).filter(c=>c.tools.length>0)}let o=r?.length?await aKt(this.turnContext,r,e,n):await wMn(this.turnContext,e,n);if(o)return o}_deduplicateGroups(e){let r=new Map;for(let n of e){let o=r.get(n.name);if(!o){r.set(n.name,n);continue}if(o instanceof Av&&o.metadata.possiblePrefix){r.delete(o.name);let s=o.cloneWithPrefix(o.metadata.possiblePrefix);r.set(s.name,s),r.set(n.name,n)}else if(n instanceof Av&&n.metadata.possiblePrefix){let s=n.cloneWithPrefix(n.metadata.possiblePrefix);r.set(s.name,s)}}return[...r.values()]}getKey(e){let r=e.map(n=>n.name+"\0"+n.description).sort().join(",");return PMn.createHash("sha256").update(r).digest("hex")}};var Ort=class{constructor(e){this._root=new Av(Pj,"",1/0,{groups:[],toolsetKey:"",preExpanded:!0});this._didToolsChange=!0;this._turnNo=0;this._trimOnNextCompute=!1;this._tools=e,this._root.isExpanded=!0}static{a(this,"ToolGrouping")}get tools(){return this._tools}get isEnabled(){return this._tools.length>128}get root(){return this._root}set tools(e){hke(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new Mrt(e).addGroups(this._root,this._tools.slice(),r),this._didToolsChange=!1),this._expandOnNext){for(let o of this._expandOnNext)this._root.find(o)?.path.forEach(s=>{s.isExpanded=!0,s.lastUsedOnTurn=this._turnNo});this._expandOnNext=void 0}let n=128;for(this._trimOnNextCompute&&(n=96,this._trimOnNextCompute=!1),this._root.lastUsedOnTurn=1/0;this._root.tools().length>n;){let o=this._root.getLowestExpandedTool();if(!o||o===this._root)break;o.isExpanded=!1,o.metadata.preExpanded=!1}return this._trimOnNextCompute=!1,[...this._root.tools()]}ensureExpanded(e){this._expandOnNext??=new Set,this._expandOnNext.add(e)}didInvalidateCache(){this._trimOnNextCompute=!0}didTakeTurn(){this._turnNo++}didCall(e){let r=this._root.find(e);if(!r)return;let{path:n,tool:o}=r;for(let s of n)s.lastUsedOnTurn=this._turnNo;if(o instanceof Av)return o.isExpanded=!0,new Gr([new Or(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var O5=class{constructor(){this._groups=new Map}static{a(this,"ToolGroupingService")}get groups(){return[...this._groups.values()]}getGroupKey(e){let r=e.turn.chatMode;return r===void 0||r===Nl.Agent?"_global_":r.id}getGroup(e){let r=this.getGroupKey(e);return this._groups.get(r)}create(e,r){let n=this.getGroupKey(e),o=this._groups.get(n);return o?o.tools=r:(o=new Ort(r),this._groups.set(n,o)),o}didTakeTurn(e){this.getGroup(e)?.didTakeTurn()}didCall(e,r){return this.getGroup(e)?.didCall(r)}isEnabled(e){return this.getGroup(e)?.isEnabled??!1}compute(e,r){return this.getGroup(e)?.compute(e,r)}findTool(e,r){return this.getGroup(e)?.root.find(r)?.tool??null}};p();function DMn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(DMn,"calculateReducedMaxRequestTokens");Fo();var wds=500,Lrt=3,L0=new pe("toolCallingLoop"),Rds="internal.tool_calling_loop_continue_confirmation",Afe=class t{constructor(e,r,n,o,s){this.turnContext=e;this.chatFetcher=r;this.modelConfiguration=n;this.baseTelemetryWithExp=o;this.subagentConfig=s;this.nextTrajectoryOrder=0;this.usedToolCallIds=new Set;this.toolCallRounds=[];this.maxOutputTokenRecoveryCount=0;this.conversationProgress=e.ctx.get(Bc),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(vs),this.transcriptPersistence=new Tg(e.ctx),this.llmRequestPersistence=hue(()=>{if(!zJe(e.ctx))return;let d=e.subagentInfo;return new WJe(e.ctx,void 0,"ToolCallingLoop",e.conversation.id.toString(),e.turn.id.toString(),void 0,e.turn.parentTurnId?.toString(),d?.name)},void 0),this.hookTrigger=new Jde(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new lrt(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=DMn(c),u=c-l;L0.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=Dt(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(wds,kt(e.ctx,ze.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new Ctt(new btt(e.ctx))}static{a(this,"ToolCallingLoop")}static{this.NextToolCallId=Date.now()}async run(e){this.abortIfCanceled(e);let r=0,n;this.turnContext.todoListSnapshot=this.turnContext.ctx.get(xg).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=XKe(this.turnContext.ctx,this.modelConfiguration);let o=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode).some(s=>s.name==="run_subagent");for(this.cachedHasSearchSubagent=o&&await HWe(this.turnContext.ctx);;)try{r++,this.abortIfCanceled(e),await this.validateIteration(r,n,e),this.turnContext.clearCopilotEditsSessionHeader();let s=performance.now(),c=await this.runOne(r,e),l=this.metricsTracker.extractRoundUsage(c.response);if(dSn(this.turnContext.ctx,this.turnContext,r,performance.now()-s,this.baseTelemetryWithExp,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics,c.routeForTelemetry,c.contextManagement),this.metricsTracker.logRoundDebugMetrics(r,this.turn.id,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics),this.metricsTracker.accumulateTokenUsage(r,l),n={...c},this.toolCallRounds.push(c.round),await this.checkCompressionAfterToolCall(e),!c.round.toolCalls.length||c.response.type!=="success"&&c.response.type!=="tool_calls"){this.turn.status==="in-progress"&&(this.turn.status="success"),this.turnContext.subagentInfo&&(r++,await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:r,reply:`\u2726\uFE0E **${this.turnContext.subagentInfo.name}** completed +Be sure to call this tool if you need a capability related to the above.`,Mrt=class{static{a(this,"VirtualToolGrouper")}constructor(e){this.turnContext=e}async addGroups(e,r,n){if(r.lengthu.type==="mcp"?"mcp_"+u.toolProvider.id:u.type==="client"||u.type==="shared"?PMn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof Av&&(s.set(u.name,u),u.metadata.toolsetKey&&c.set(u.metadata.toolsetKey,u.metadata.groups));if(n.isCancellationRequested)return;let l=await Promise.all(Object.entries(o).map(([u,d])=>{if(u===PMn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof _J);if(this.getKey(h)===this.getKey(d))return f}return this._generateGroupsFromToolset(u,d,c.get(u),n)}}));e.contents=this._deduplicateGroups(l.flat());for(let u of e.all())if(u instanceof Av){let d=s.get(u.name);d&&(u.isExpanded=d.isExpanded,u.metadata.preExpanded=d.metadata.preExpanded,u.lastUsedOnTurn=d.lastUsedOnTurn)}this._reExpandToolsToHitBudget(e)}async _generateGroupsFromToolset(e,r,n,o){if(r.length<=2)return r;let s=0,c;for(;!c&&s<3;s++){if(o.isCancellationRequested)return[];try{c=await(r.length<=16?this._summarizeToolGroup(r,o):this._divideToolsIntoGroups(r,n,o))}catch(d){lKt.error(this.turnContext.ctx,`Failed to categorize tools: ${ld(d)}`)}}lKt.info(this.turnContext.ctx,`Tool categorization completed after ${s} attempt(s).`);let l=[];if(!c)l=r;else{let d=c.findIndex(f=>f.name===crt);d>=0&&(l=c[d].tools,c.splice(d,1))}return(c?.map(d=>{let f=r[0].toolProvider,h=f.displayNamePrefix??f.id;return new Av(Pj+d.name,Tds+d.summary+Ids,0,{toolsetKey:e,groups:c,possiblePrefix:h?.replaceAll(/[^a-zA-Z0-9]/g,"_").slice(0,10)+"_"},d.tools)})||[]).concat(l)}_reExpandToolsToHitBudget(e){let r=e.tools().length;if(r>64)return;let n=e.contents.filter(o=>o instanceof Av&&!o.isExpanded).sort((o,s)=>o.contents.length-s.contents.length);for(let o of n){let s=r-1+o.contents.length;if(s>128||(o.isExpanded=!0,o.metadata.preExpanded=!0,r=s,r>64))break}}async _summarizeToolGroup(e,r){let n=await wMn(this.turnContext,e,r);return n&&[n]}async _divideToolsIntoGroups(e,r,n){if(r){let s=new Set(e.map(c=>c.name));r=r.map(c=>({...c,tools:c.tools.filter(l=>s.has(l.name))})).filter(c=>c.tools.length>0)}let o=r?.length?await cKt(this.turnContext,r,e,n):await RMn(this.turnContext,e,n);if(o)return o}_deduplicateGroups(e){let r=new Map;for(let n of e){let o=r.get(n.name);if(!o){r.set(n.name,n);continue}if(o instanceof Av&&o.metadata.possiblePrefix){r.delete(o.name);let s=o.cloneWithPrefix(o.metadata.possiblePrefix);r.set(s.name,s),r.set(n.name,n)}else if(n instanceof Av&&n.metadata.possiblePrefix){let s=n.cloneWithPrefix(n.metadata.possiblePrefix);r.set(s.name,s)}}return[...r.values()]}getKey(e){let r=e.map(n=>n.name+"\0"+n.description).sort().join(",");return DMn.createHash("sha256").update(r).digest("hex")}};var Ort=class{constructor(e){this._root=new Av(Pj,"",1/0,{groups:[],toolsetKey:"",preExpanded:!0});this._didToolsChange=!0;this._turnNo=0;this._trimOnNextCompute=!1;this._tools=e,this._root.isExpanded=!0}static{a(this,"ToolGrouping")}get tools(){return this._tools}get isEnabled(){return this._tools.length>128}get root(){return this._root}set tools(e){hke(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new Mrt(e).addGroups(this._root,this._tools.slice(),r),this._didToolsChange=!1),this._expandOnNext){for(let o of this._expandOnNext)this._root.find(o)?.path.forEach(s=>{s.isExpanded=!0,s.lastUsedOnTurn=this._turnNo});this._expandOnNext=void 0}let n=128;for(this._trimOnNextCompute&&(n=96,this._trimOnNextCompute=!1),this._root.lastUsedOnTurn=1/0;this._root.tools().length>n;){let o=this._root.getLowestExpandedTool();if(!o||o===this._root)break;o.isExpanded=!1,o.metadata.preExpanded=!1}return this._trimOnNextCompute=!1,[...this._root.tools()]}ensureExpanded(e){this._expandOnNext??=new Set,this._expandOnNext.add(e)}didInvalidateCache(){this._trimOnNextCompute=!0}didTakeTurn(){this._turnNo++}didCall(e){let r=this._root.find(e);if(!r)return;let{path:n,tool:o}=r;for(let s of n)s.lastUsedOnTurn=this._turnNo;if(o instanceof Av)return o.isExpanded=!0,new Gr([new Lr(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var O5=class{constructor(){this._groups=new Map}static{a(this,"ToolGroupingService")}get groups(){return[...this._groups.values()]}getGroupKey(e){let r=e.turn.chatMode;return r===void 0||r===Nl.Agent?"_global_":r.id}getGroup(e){let r=this.getGroupKey(e);return this._groups.get(r)}create(e,r){let n=this.getGroupKey(e),o=this._groups.get(n);return o?o.tools=r:(o=new Ort(r),this._groups.set(n,o)),o}didTakeTurn(e){this.getGroup(e)?.didTakeTurn()}didCall(e,r){return this.getGroup(e)?.didCall(r)}isEnabled(e){return this.getGroup(e)?.isEnabled??!1}compute(e,r){return this.getGroup(e)?.compute(e,r)}findTool(e,r){return this.getGroup(e)?.root.find(r)?.tool??null}};p();function NMn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(NMn,"calculateReducedMaxRequestTokens");Fo();var kds=500,Lrt=3,B0=new pe("toolCallingLoop"),Pds="internal.tool_calling_loop_continue_confirmation",yfe=class t{constructor(e,r,n,o,s){this.turnContext=e;this.chatFetcher=r;this.modelConfiguration=n;this.baseTelemetryWithExp=o;this.subagentConfig=s;this.nextTrajectoryOrder=0;this.usedToolCallIds=new Set;this.toolCallRounds=[];this.maxOutputTokenRecoveryCount=0;this.conversationProgress=e.ctx.get(Bc),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(vs),this.transcriptPersistence=new Ig(e.ctx),this.llmRequestPersistence=mue(()=>{if(!zJe(e.ctx))return;let d=e.subagentInfo;return new WJe(e.ctx,void 0,"ToolCallingLoop",e.conversation.id.toString(),e.turn.id.toString(),void 0,e.turn.parentTurnId?.toString(),d?.name)},void 0),this.hookTrigger=new Zde(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new lrt(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=NMn(c),u=c-l;B0.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=Dt(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(kds,kt(e.ctx,ze.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new Ctt(new btt(e.ctx))}static{a(this,"ToolCallingLoop")}static{this.NextToolCallId=Date.now()}async run(e){this.abortIfCanceled(e);let r=0,n;this.turnContext.todoListSnapshot=this.turnContext.ctx.get(wg).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=XKe(this.turnContext.ctx,this.modelConfiguration);let o=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode).some(s=>s.name==="run_subagent");for(this.cachedHasSearchSubagent=o&&await HWe(this.turnContext.ctx);;)try{r++,this.abortIfCanceled(e),await this.validateIteration(r,n,e),this.turnContext.clearCopilotEditsSessionHeader();let s=performance.now(),c=await this.runOne(r,e),l=this.metricsTracker.extractRoundUsage(c.response);if(fSn(this.turnContext.ctx,this.turnContext,r,performance.now()-s,this.baseTelemetryWithExp,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics,c.routeForTelemetry,c.contextManagement),this.metricsTracker.logRoundDebugMetrics(r,this.turn.id,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics),this.metricsTracker.accumulateTokenUsage(r,l),n={...c},this.toolCallRounds.push(c.round),await this.checkCompressionAfterToolCall(e),!c.round.toolCalls.length||c.response.type!=="success"&&c.response.type!=="tool_calls"){this.turn.status==="in-progress"&&(this.turn.status="success"),this.turnContext.subagentInfo&&(r++,await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:r,reply:`\u2726\uFE0E **${this.turnContext.subagentInfo.name}** completed `}]}));try{await this.metricsTracker.reportCumulativeTokenUsage(r)}catch{}return}}catch(s){try{await this.metricsTracker.reportCumulativeTokenUsage(r)}catch{}if(this.turnContext.subagentInfo){r++;let c="";s instanceof zF?c="maximum tool attempts reached":c=s instanceof Error?s.message:String(s),await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:r,reply:`\u2726\uFE0E **${this.turnContext.subagentInfo.name}** stopped due to ${c} -`}]})}throw s}}async runOne(e,r){this.abortIfCanceled(r);let n=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode),o=this.getAvailableLanguageModelTools(n),s;if(this.subagentConfig){let D=this.subagentConfig.filterTools?.(o);D!==void 0&&(o=D),s=this.subagentConfig.createPromptRenderer(this.turnContext,o,this.modelConfiguration,{oneBasedIterationNum:e,maxRounds:this.maxToolCallingLoop})}else{let D=this.createAgentPromptProps(o);s=gp.create(art,D,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=ZKe(this.modelConfiguration,c),u=await s.renderPrompt(void 0,r,{collapseSystemMessages:!0,enableCacheBreakpoints:c}),d=u.messages,f=u.promptTsxRemovedNodeCount??0;if(e===1&&!this.turn.renderedUserMessage)for(let D=d.length-1;D>=0;D--){let N=d[D];if(N.role==="user"&&N.content){this.turn.renderedUserMessage=N.content,this.recordRenderedUserMessageTranscript(N.content);break}}let h="",m=new uj((D,N,O,B,q,M)=>{let L=D.trim(),j=L.match(vRe)!==null&&L.endsWith("-->")||!!this.subagentConfig?.hideReplyText;this.conversationProgress.report(this.conversation,this.turn,{annotations:N,references:O,hideText:j,notifications:B.map(Q=>({severity:"warning",message:Q.message})),thinking:M,editAgentRounds:[{roundId:e,reply:j?"":D}]}),this.turn.annotations.push(...N??[]),h+=D});this.abortIfCanceled(r);let g=await this.getAvailableChatTools(o,r);this.abortIfCanceled(r);let A=this.metricsTracker.computePromptPrefixMetrics(d,g),y=this.metricsTracker.computeContextManagement(this.conversation.currentPartitionId,f),_={messages:d,modelConfiguration:this.modelConfiguration,uiKind:"agentPanel",chatModeKind:this.turnContext.turn.chatMode?.kind,tools:g,intentParams:{intent:!0},llmInteraction:this.turnContext.toLlmInteraction(),endpoint:l,turnId:String(this.turn.id)};this.checkChatPayload(_),L0.debug(this.turnContext.ctx,`Send request for iteration ${e} for turn ${this.turn.id} with: ${JSON.stringify(_,null,2)}`);let E,v=this.metricsTracker.getTimeSinceLastLLMCall(),S=performance.now(),T=30,w={shouldRetry:a(D=>D.type==="failed"&&D.code===429&&D.retryAfter!==void 0&&D.retryAfter>=0&&D.retryAfter<=T,"shouldRetry"),onRetry:a(async D=>{let N=D.type==="failed"?D.retryAfter:void 0;N!==void 0&&(L0.info(this.turnContext.ctx,`Rate limited in iteration ${e} for turn ${this.turn.id}, retrying in ${N}s`),await this.turnContext.warn("Service is busy. Retrying shortly \u2014 you can cancel anytime."))},"onRetry"),maxRetryAttempts:3},R=await this.chatFetcher.fetchResponse(_,r,this.baseTelemetryWithExp,(D,N)=>(N.phase&&(E=N.phase),m.isFinishedAfter(D,N)),this.llmRequestPersistence,w),x=performance.now()-S;if(this.metricsTracker.recordLlmFetchComplete(),R.type==="length"){if(this.addToolCallModelResponseToTurn(h,[],R.thinking,E),this.recordAssistantRoundTranscript(h,e,R.thinking),this.maxOutputTokenRecoveryCount0?await this.handleToolCalls({type:"tool_calls",requestId:r.requestId,toolCalls:r.toolCalls,copilotEditsSessionHeader:r.copilotEditsSessionHeader,thinking:r.thinking,usage:r.usage},n,o,e,s,c):(this.turn.status="success",this.addToolCallModelResponseToTurn(n,[],r.thinking,c),this.recordAssistantRoundTranscript(n,e,r.thinking),{response:r,round:{response:r.value,toolInputRetry:0,toolCalls:[],phase:c}});case"offTopic":throw this.turn.status="off-topic",new zA({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new zc;case"failed":throw this.turn.status="error",L0.error(this.turnContext.ctx,"Fetch failed:",r),new zA({message:cv.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===lv,copilotPlan:Dx(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new zA({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new zA({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new zA({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new zA({message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"no_finish_reason":throw this.turn.status="error",new zA({message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"model_not_supported":{this.turn.status="error";let{modelName:l,modelProviderName:u}=Ro.parseModelNotSupportedReason(r.reason);throw new zA({message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:l,modelProviderName:u})}case"model_max_prompt_tokens_exceeded":throw this.turn.status="error",new zA({message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",responseIsFiltered:!1});case"tool_calls":return await this.handleToolCalls(r,n,o,e,s,c);default:throw this.turn.status="error",new zA({message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1})}}async handleToolCalls(e,r,n,o,s,c){if(e.type!=="tool_calls")throw new Error(`Expected tool_calls type but got ${e.type}`);if(!e.toolCalls)throw new Error("Tool calls are required but were not provided");this.turnContext.setCopilotEditsSessionHeader(e.copilotEditsSessionHeader);let l=e.toolCalls.map(u=>((!u.id||this.usedToolCallIds.has(u.id))&&(u.id=`cls_${t.NextToolCallId++}`),this.usedToolCallIds.add(u.id),u));this.addToolCallModelResponseToTurn(r,l,e.thinking,c),this.recordAssistantRoundTranscript(r,o,e.thinking),this.recordTrajectorySteps(e);for(let u of l)await this.handleSingleToolCall(u,n,o,s,e.usage);return{response:e,round:{response:r,toolInputRetry:0,toolCalls:l.map(u=>({id:u.id,name:u.function.name,arguments:JSON.stringify(u.function.arguments)})),phase:c}}}async handleSingleToolCall(e,r,n,o,s){if(!e.id)throw new Error(`Tool call id is required but was not provided for function ${e.function.name}`);let c=this.findToolByName(r,e.function.name);if(c instanceof Av)this.handleVirtualToolCall(c,e,n);else if(c instanceof yJ)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;L0.error(this.turnContext.ctx,l);let u=new Gr([new Or(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=wtt(u);await this.turnContext.agentToolCalls.error(n,e.id,d.message)}}handleVirtualToolCall(e,r,n){if(!r.id)throw new Error(`Tool call id is required but was not provided for function ${r.function.name}`);let o=performance.now(),s=this.turnContext.ctx.get(O5).didCall(this.turnContext,e.name),c,l;s?(l=s,c=s.status):(c="error",l=new Gr([new Or(`Failed to activate virtual tool group ${e.name}`)],"error")),this.addToolCallResultToTurn(l,r.id);let u=performance.now()-o;mjt(this.turnContext.ctx,this.turnContext,{name:e.name,type:"virtual",toolProvider:{id:e.metadata.toolsetKey||"virtual"}},r.id,n,u,c,this.baseTelemetryWithExp)}async handleLanguageModelToolCall(e,r,n,o,s){let c=performance.now(),l="success";try{let u=AF(r);this.turnContext.agentToolCalls.init(n,r.id,e.name,e.type,u,this.formatInputForDisplay(u));let d=this.toolsService.prepareInvocation(e.id,{input:u,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o),{needConfirm:f}=await this.prepareToolConfirmation(e,u);await this.requestToolInvocationApproval(d,f,e,u,n,r.id,o),this.abortIfCanceled(o);let h=await this.hookTrigger.firePreToolUseHook(e,u,o,{turn:this.turn,conversationProgress:this.conversationProgress});if(h.denied){L0.info(this.turnContext.ctx,`Tool execution denied by hook: ${h.reason||"No reason provided"}`),l="cancelled";let A=new Gr([new Or(h.reason||"Tool execution denied by hook")],"cancelled");this.addToolCallResultToTurn(A,r.id),await this.turnContext.agentToolCalls.cancel(n,r.id);return}let m=d.progressMessage||`Running ${e.displayName} tool`;await this.turnContext.agentToolCalls.running(n,r.id,m),this.recordToolExecutionStartTranscript(r.id,e.name,u);let g=await this.toolsService.invokeTool(this.turnContext,e.id,{toolInvocationToken:r.id,input:u,roundId:n,toolCallId:r.id},o);if(this.abortIfCanceled(o),await this.updateCompletionMessage(e,r,n,o),g.status==="success"){let A=RDn(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=wtt(g);await this.turnContext.agentToolCalls.error(n,r.id,A.message)}else await this.turnContext.agentToolCalls.cancel(n,r.id);await this.hookTrigger.firePostToolUseHook(e,u,g,o,{turn:this.turn,conversationProgress:this.conversationProgress}),this.addToolCallResultToTurn(g,r.id),this.recordSubagentTrajectoryLink(e,g,r.id),this.recordToolInOut(r,u,g,c)}catch(u){if(await this.updateCompletionMessage(e,r,n,o),u instanceof Rj||u instanceof zc)this.turn.status="cancelled",l="cancelled",this.addToolCallResultToTurn(new Gr([new Or("The user chose to skip the tool call, they want to proceed without running it")],"cancelled"),r.id),await this.turnContext.agentToolCalls.cancel(n,r.id);else{L0.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${ld(u)}`,u),l="error";let d=new Gr([new Or(ld(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=wtt(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),mjt(this.turnContext.ctx,this.turnContext,e,r.id,n,u,l,this.baseTelemetryWithExp)}}async updateCompletionMessage(e,r,n,o){let s=`Ran ${e.displayName} tool`;try{let c=AF(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){L0.debug(this.turnContext.ctx,`Failed to prepare completion message for tool ${e.id}: ${ld(c)}, using default message`)}await this.turnContext.agentToolCalls.updateProgressMessage(n,r.id,s)}async getAvailableChatTools(e,r){let n=(await Promise.all(e.map(async c=>this.shouldIncludeTool(c)&&await c.isEnabled(this.turnContext)?c:null))).filter(c=>c!==null),o=this.turnContext.ctx.get(O5);if(o.create(this.turnContext,n),!o.isEnabled(this.turnContext))return n.map(c=>({type:"function",function:{name:c.nameForModel,description:this.getToolDescription(c),parameters:c.inputSchema}}));let s=n;try{s=await o.compute(this.turnContext,r)||[]}catch(c){return L0.error(this.turnContext.ctx,`Error while computing tool grouping: ${ld(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof Av?{type:"function",function:{name:c.name,description:c.description}}:{type:"function",function:{name:c.nameForModel,description:this.getToolDescription(c),parameters:c.inputSchema}})}getAvailableLanguageModelTools(e){return e.filter(r=>this.shouldIncludeTool(r))}shouldIncludeTool(e){return e.name==="replace_string_in_file"?VDn(this.modelConfiguration):e.name==="apply_patch"?zDn(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?R5.getToolDescription(this.modelConfiguration.modelFamily):e.description}createAgentPromptProps(e){return{turnContext:this.turnContext,userRawMessage:this.turnContext.turn.request.message,workspaceFolders:this.turnContext.turn.workspaceFolders,snapshotTextDocumentProvider:this.snapshotTextDocumentProvider,tools:e,modelConfiguration:this.modelConfiguration,codesearchMode:this.turnContext.turn.chatMode?.kind==="Ask",hasSearchSubagent:this.cachedHasSearchSubagent??!1}}addToolCallModelResponseToTurn(e,r,n,o){let s={role:"assistant",content:e,tool_calls:r.length?r:void 0,thinking:n,phase:o,modelId:this.modelConfiguration.modelId};this.turn.response?this.turn.response.message=Hq(this.turn.response.message,s):this.turn.response={message:[s],type:"model"}}addToolCallResultToTurn(e,r){let n="";switch(e.status){case"error":n="Tool call failed with error: ";break;case"cancelled":n="Tool call is cancelled with result: ";break;default:case"success":n=""}let o=n+I5(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(bJ(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){L0.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=Hq(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get(O5).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(pZ).checkApproval(this.turnContext,e,r)}async buildTerminalCommandData(e,r){if(!e.id.includes("run_in_terminal"))return;let n=r.command,o=this.turnContext.ctx.get(wT),c=cZ(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!P5.isPotentiallySensitiveTool(e))return;let n=P5.getMatchingRuleForToolCall(e,r,this.turnContext),o=P5.extractFilePathForMetadata(e,r);if(o)return{filePath:o.filePath,matchingRule:n?.rule.pattern,ruleDescription:n?.rule.description,isGlobal:n?n.isOutsideWorkspace:void 0}}abortIfCanceled(e){if(e.isCancellationRequested)throw this.turn.status="cancelled",new zc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){L0.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=P5.generateSensitiveConfirmationMessage(n,o,this.turnContext);u&&(e.confirmationMessages={title:u.title,message:u.message});let d=e.confirmationMessages??{title:`Run ${n.id}`,message:`Do you want to allow "${n.id}" to run?`},f=await this.buildTerminalCommandData(n,o),h=this.buildSensitiveFileData(n,o),m=f||h?{terminalCommandData:f,sensitiveFileData:h}:void 0,g=QDn(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?cZ(n.description)||"sh":void 0,_=await this.toolsService.invokeToolConfirmation(this.turnContext,n.id,{title:d.title,message:d.message,input:{...o,toolType:A,...h?.filePath?{filePath:h.filePath}:{},...y?{commandLineType:y}:{},...n.type==="mcp"?{mcpServerName:n.toolProvider.id,mcpToolName:n.name,mcpType:"tool"}:{}},roundId:s,toolCallId:c,annotations:n.annotations,toolMetadata:m},l);switch(_.result){case"dismiss":throw this.turn.status="cancelled",new Rj("Cancelled by user");case"accept":return Promise.resolve();default:throw new Rj(`Invalid confirmation result ${_.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(L0.debug(this.turnContext.ctx,`Tool calling loop exceeds configured max iterations ${this.maxToolCallingLoop} for turn ${this.turn.id}`),this.turn.isSubagent()&&this.subagentConfig?.allowIterationExtension!==!1&&await this.requestAdditionalToolIterations(e,n)){let s=this.maxToolCallingLoop;this.maxToolCallingLoop=this.maxToolCallingLoop+this.requestLimitIncrement,L0.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new zF}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(Xd)}catch(s){return L0.error(this.turnContext.ctx,`Tool confirmation invoker unavailable: ${ld(s)}, stopping tool calling loop.`),!1}let o=`cls_${t.NextToolCallId++}`;try{let s=await n.invokeClientToolConfirmation(this.turnContext,{name:Rds,title:"Continue to iterate?",message:"Copilot has been working on this problem for a while. Do you want it to continue to iterate? You can also set the maximum request limit in settings.",input:void 0,conversationId:this.conversation.id,turnId:this.turn.id,roundId:e,toolCallId:o});return this.abortIfCanceled(r),s.result==="accept"}catch(s){return L0.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${ld(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new zA({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new zA({message:`You may not include more than ${128} tools in your request.`,responseIsFiltered:!1})}formatInputForDisplay(e){try{return JSON.stringify(e,null,2)}catch{return}}async checkCompressionAfterToolCall(e){try{await this.turnContext.ctx.get(Cb).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){L0.error(this.turnContext.ctx,`Post-tool-call compression check failed: ${ld(r)}`)}}recordAssistantRoundTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o={text:e,iterationNumber:r};n&&(o.thinking={id:n.id,text:Array.isArray(n.text)?n.text.join(""):n.text});let s=ctt(e,String(this.turn.id),null,o);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,s).catch(c=>{ot.error(this.turnContext.ctx,`Failed to record assistant round transcript: ${c instanceof Error?c.message:String(c)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create assistant round transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordRenderedUserMessageTranscript(e){if(this.transcriptPersistence.isEnabled())try{let r=eDn(String(this.turn.id),e);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r).catch(n=>{ot.error(this.turnContext.ctx,`Failed to record rendered user message transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.turnContext.ctx,`Failed to create rendered user message transcript event: ${r instanceof Error?r.message:String(r)}`)}}recordToolExecutionStartTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o=tDn(e,r,n);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,o).catch(s=>{ot.error(this.turnContext.ctx,`Failed to record tool execution start transcript: ${s instanceof Error?s.message:String(s)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create tool execution start transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordToolExecutionCompleteTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o=this.turnContext.agentToolCalls.getToolCallById(e),s=o?{result:o.result,error:o.error,resultDetails:o.resultDetails,toolSpecificData:o.toolSpecificData,progressMessage:o.progressMessage}:void 0,c=rDn(e,r,s,null,{status:n.toString()});this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,c).catch(l=>{ot.error(this.turnContext.ctx,`Failed to record tool execution complete transcript: ${l instanceof Error?l.message:String(l)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create tool execution complete transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordTrajectorySteps(e){if(!this.llmRequestPersistence?.isEnabled()||e.type!=="tool_calls"||!e.toolCalls)return;let r=this.turnContext.subagentInfo,n=e.toolCalls.map(o=>({tool:o.function.name,tool_call_id:o.id}));pue(()=>this.llmRequestPersistence?.appendTrajectoryStep({tool_calls:n,input_tokens:e.usage?.prompt_tokens,output_tokens:e.usage?.completion_tokens,cached_input_tokens:e.usage?.prompt_tokens_details?.cached_tokens,loop_type:r?"subagent":"parent",subagent_name:r?.name,loop_order:this.nextTrajectoryOrder++,conversationId:this.conversation.id.toString(),turnId:this.turn.id.toString()}),o=>ot.debug(this.turnContext.ctx,"Failed to record trajectory step",o))}recordSubagentTrajectoryLink(e,r,n){if(e.name!=="run_subagent"||!this.llmRequestPersistence?.isEnabled()||!n)return;let o=r.subagentConversationId,s=r.subagentTurnId;!o||!s||pue(()=>this.llmRequestPersistence?.appendSubagentLink({type:"subagent_link",tool_call_id:n,subagent_conversationId:o,subagent_turnId:s,conversationId:this.conversation.id.toString(),turnId:this.turn.id.toString()}),c=>ot.debug(this.turnContext.ctx,"Failed to record subagent link",c))}recordToolInOut(e,r,n,o){if(!this.llmRequestPersistence?.isEnabled()||!e.id)return;let s=I5(n.content),c=Math.round(performance.now()-o);pue(()=>this.llmRequestPersistence?.appendToolInOut({tool_call_id:e.id,tool:e.function.name,input:r,output:s,status:n.status,timestamp:new Date().toISOString(),duration_ms:c}),l=>ot.debug(this.turnContext.ctx,"Failed to record tool-in-out entry",l))}};var lKt=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},uKt=class{constructor(e,r){this.handler=e;this.parentTurnId=r}static{a(this,"SubagentProgressHandler")}async begin(e,r,n,o){await this.handler.begin(e,r,n,{...o,parentTurnId:this.parentTurnId})}async report(e,r,n,o){await this.handler.report(e,r,n,{...o,parentTurnId:this.parentTurnId})}async end(e,r,n,o){await this.handler.end(e,r,n,o)}async cancel(e,r,n,o){await this.handler.cancel(e,r,n,o)}};function _Ht(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(_Ht,"parseModelString");var Brt=class{static{a(this,"CustomAgentExecutor")}constructor(e,r){this.config=e,this.subagentConfig=r}async invoke(e,r,n,o){let s=r.task,c=new lp({message:s,type:"user"}),l=this.config.model||e.turn.userRequestedModel;c.userRequestedModel=l,c.needToolCallConfirmation=r.needToolCallConfirmation,c.workspaceFolder=e.turn.workspaceFolder,c.workspaceFolders=e.turn.workspaceFolders,c.parentTurnId=e.turn.id,c.chatMode=new Rwe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new cJ([c],e.conversation.source,e.conversation.userLanguage),f=new Qw(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let S=_Ht(this.config.model),T=S.modelName.toLowerCase(),w=S.provider.toLowerCase()||"copilot";if(w==="copilot"){let k=(await f.ctx.get(Ns).getMetadata()).find(D=>D.name.toLowerCase()===T);if(k)h=await Ro.getModelConfigurationById(e.ctx,k.id);else if(T===XJe.toLowerCase())m=!0,h=await Ro.getModelConfigurationById(e.ctx,lv,d.id.toString(),jq(d.turns));else throw new Error(`Model "${S.modelName}" not found in available models`)}else{let k=(await new as(f.ctx.get(Un)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(k)h=await zO(f.ctx,k.provider,k.name);else throw new Error(`BYOK model "${S.modelName}" with provider "${S.provider}" not found`)}}else this.subagentConfig.resolveModelFamily&&e.turn.resolvedModelConfiguration?.providerName===void 0?h=await kds(e,S=>this.subagentConfig.resolveModelFamily(S)):h=e.turn.resolvedModelConfiguration;f.setResolvedModelConfiguration(h),f.subagentInfo={name:this.config.name,model:m?h.uiName:h.uiName||l,isAutoModel:m};let g=new mc(e.ctx),A=await fl(e.ctx,f,{languageId:""}),y=n||new lKt,_=new uKt(y,e.turn.id);await e.ctx.get(Bc).begin(d,c,_),await new Afe(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(Ru).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?Mn(c.response.message):"";return this.subagentConfig.postProcess&&(v=await this.subagentConfig.postProcess(f,v)),{response:v,conversationId:d.id.toString(),turnId:c.id.toString()}}};async function kds(t,e){let r=t.turn.resolvedModelConfiguration,n=e(r.modelFamily);if(!n||n.length===0)return r;let o=r.originalBillingMultiplier;for(let s of n)try{let c=await Ro.resolveModelIdFromFamily(t.ctx,s);if(!c)continue;let l=await Ro.getModelConfigurationById(t.ctx,c);if(o!==void 0&&l.originalBillingMultiplier!==void 0&&l.originalBillingMultiplier>o)continue;return l}catch{continue}return r}a(kds,"resolvePreferredSubagentModel");p();p();p();var Oj=fe(wo());var Frt=class extends fr{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=Mn(r.request.message),c=ZO(r.response?.message,!0),l=d5(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,Oj.useKeepWith)();return vscpp(vscppf,null,vscpp(Oj.SystemMessage,{priority:1e3},"You are a codebase exploration specialist focused exclusively on searching and analyzing existing code. Your main goal is to explore the codebase based on a query provided by the user.",vscpp("br",null),vscpp("br",null),"Your strengths:",vscpp("br",null),"- Rapidly finding files using file search patterns",vscpp("br",null),"- Searching code and text with powerful text search",vscpp("br",null),"- Reading and analyzing file contents",vscpp("br",null),vscpp("br",null),"## Guidelines",vscpp("br",null),vscpp("br",null),"- For file searches: search broadly when you don't know where something lives. Use read file when you know the specific file path.",vscpp("br",null),"- For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.",vscpp("br",null),"- Be thorough: Check multiple locations, consider different naming conventions, look for related files.",vscpp("br",null),vscpp("br",null),"IMPORTANT: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:",vscpp("br",null),"- Make efficient use of the tools at your disposal: be smart about how you search for files and implementations.",vscpp("br",null),"- Wherever possible you should try to spawn multiple parallel tool calls for searching and reading files.",vscpp("br",null),"- Maximum of ",this.props.maxSearchTurns," tool-calling rounds is allowed to complete the task.",vscpp("br",null),vscpp("br",null),"## Required Output",vscpp("br",null),vscpp("br",null),"End your response with an optional brief explanation of your findings (3 sentences max), followed by a tag containing absolute file paths and line ranges of relevant code snippets.",vscpp("br",null),vscpp("br",null),"Output Example:",vscpp("br",null),"The core routing logic lives in two files.",vscpp("br",null),vscpp("br",null),"",vscpp("br",null),"/absolute/path/to/file.py:10-20 (Optional Brief Reason)",vscpp("br",null),"/absolute/path/to/another/file.cc:100-120",vscpp("br",null),""),vscpp(Oj.UserMessage,{priority:950},vscpp(Wn,{name:"environment_info"},vscpp(Ij,{ctx:e.ctx})),vscpp(Wn,{name:"workspace_info"},vscpp(xj,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(Zde,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(Oj.UserMessage,{priority:900},vscpp(vscppf,null,s)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(Rw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`SearchSubagent-${r.id}`})),o&&vscpp(Oj.UserMessage,{priority:900},vscpp(vscppf,null,"CRITICAL: Your allotted iterations are finished. Do NOT make any more tool calls. You MUST immediately output your final results using the format described above. If you call any tool instead of responding, your results will be lost and the caller will receive an error. If you are not confident in your results, state what was unclear or incomplete so the caller can narrow down the search or continue from where you left off.")))}};var dKt=10,Pds=new Set(["file_search","grep_search","read_file"]),Urt=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[kn.ClaudeHaiku45,kn.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:dKt,isLastTurn:o.oneBasedIterationNum>dKt};return gp.create(Frt,s,n)}filterTools(e){return e.filter(r=>Pds.has(r.name))}getMaxRounds(){return dKt+1}};p();var CZ=fe(wo());var Qrt=class extends fr{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=ZO(r.response?.message,!0),l=d5(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,CZ.useKeepWith)(),d=Mn(r.request.message);return vscpp(vscppf,null,vscpp(CZ.SystemMessage,{priority:1e3},vscpp(tfe,null),vscpp("br",null),vscpp("br",null),'You are "',o,'", a specialized agent. Follow your instructions carefully and complete the assigned task.',s&&vscpp(vscppf,null,vscpp("br",null),vscpp("br",null),s),vscpp("br",null),vscpp("br",null),"When you complete your task, provide a clear, concise summary of what you accomplished. Do not include unnecessary preamble."),vscpp(CZ.UserMessage,{priority:950},vscpp(Wn,{name:"environment_info"},vscpp(Ij,{ctx:e.ctx})),vscpp(Wn,{name:"workspace_info"},vscpp(xj,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(CZ.UserMessage,{priority:900},vscpp(vscppf,null,d)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(Rw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`Subagent-${o}-${r.id}`})))}};var fKt=class{constructor(e){this.agentConfig=e}static{a(this,"DefaultSubagentConfig")}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,agentName:this.agentConfig.name,agentInstruction:this.agentConfig.instruction};return gp.create(Qrt,s,n)}};function NMn(t){return t.isBuiltIn&&t.name==="Search"?new Urt:new fKt(t)}a(NMn,"resolveSubagentConfig");var yfe=class extends Nu{constructor(){super({name:"run_subagent",displayName:"Run Sub Agent",description:`Launch a new agent to handle complex, multi-step tasks autonomously. +`}]})}throw s}}async runOne(e,r){this.abortIfCanceled(r);let n=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode),o=this.getAvailableLanguageModelTools(n),s;if(this.subagentConfig){let D=this.subagentConfig.filterTools?.(o);D!==void 0&&(o=D),s=this.subagentConfig.createPromptRenderer(this.turnContext,o,this.modelConfiguration,{oneBasedIterationNum:e,maxRounds:this.maxToolCallingLoop})}else{let D=this.createAgentPromptProps(o);s=gp.create(art,D,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=ZKe(this.modelConfiguration,c),u=await s.renderPrompt(void 0,r,{collapseSystemMessages:!0,enableCacheBreakpoints:c}),d=u.messages,f=u.promptTsxRemovedNodeCount??0;if(e===1&&!this.turn.renderedUserMessage)for(let D=d.length-1;D>=0;D--){let N=d[D];if(N.role==="user"&&N.content){this.turn.renderedUserMessage=N.content,this.recordRenderedUserMessageTranscript(N.content);break}}let h="",m=new uj((D,N,O,B,q,M)=>{let L=D.trim(),j=L.match(vRe)!==null&&L.endsWith("-->")||!!this.subagentConfig?.hideReplyText;this.conversationProgress.report(this.conversation,this.turn,{annotations:N,references:O,hideText:j,notifications:B.map(Q=>({severity:"warning",message:Q.message})),thinking:M,editAgentRounds:[{roundId:e,reply:j?"":D}]}),this.turn.annotations.push(...N??[]),h+=D});this.abortIfCanceled(r);let g=await this.getAvailableChatTools(o,r);this.abortIfCanceled(r);let A=this.metricsTracker.computePromptPrefixMetrics(d,g),y=this.metricsTracker.computeContextManagement(this.conversation.currentPartitionId,f),_={messages:d,modelConfiguration:this.modelConfiguration,uiKind:"agentPanel",chatModeKind:this.turnContext.turn.chatMode?.kind,tools:g,intentParams:{intent:!0},llmInteraction:this.turnContext.toLlmInteraction(),endpoint:l,turnId:String(this.turn.id)};this.checkChatPayload(_),B0.debug(this.turnContext.ctx,`Send request for iteration ${e} for turn ${this.turn.id} with: ${JSON.stringify(_,null,2)}`);let E,v=this.metricsTracker.getTimeSinceLastLLMCall(),S=performance.now(),T=30,w={shouldRetry:a(D=>D.type==="failed"&&D.code===429&&D.retryAfter!==void 0&&D.retryAfter>=0&&D.retryAfter<=T,"shouldRetry"),onRetry:a(async D=>{let N=D.type==="failed"?D.retryAfter:void 0;N!==void 0&&(B0.info(this.turnContext.ctx,`Rate limited in iteration ${e} for turn ${this.turn.id}, retrying in ${N}s`),await this.turnContext.warn("Service is busy. Retrying shortly \u2014 you can cancel anytime."))},"onRetry"),maxRetryAttempts:3},R=await this.chatFetcher.fetchResponse(_,r,this.baseTelemetryWithExp,(D,N)=>(N.phase&&(E=N.phase),m.isFinishedAfter(D,N)),this.llmRequestPersistence,w),x=performance.now()-S;if(this.metricsTracker.recordLlmFetchComplete(),R.type==="length"){if(this.addToolCallModelResponseToTurn(h,[],R.thinking,E),this.recordAssistantRoundTranscript(h,e,R.thinking),this.maxOutputTokenRecoveryCount0?await this.handleToolCalls({type:"tool_calls",requestId:r.requestId,toolCalls:r.toolCalls,copilotEditsSessionHeader:r.copilotEditsSessionHeader,thinking:r.thinking,usage:r.usage},n,o,e,s,c):(this.turn.status="success",this.addToolCallModelResponseToTurn(n,[],r.thinking,c),this.recordAssistantRoundTranscript(n,e,r.thinking),{response:r,round:{response:r.value,toolInputRetry:0,toolCalls:[],phase:c}});case"offTopic":throw this.turn.status="off-topic",new zA({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new zc;case"failed":throw this.turn.status="error",B0.error(this.turnContext.ctx,"Fetch failed:",r),new zA({message:cv.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===lv,copilotPlan:Dx(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new zA({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new zA({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new zA({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new zA({message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"no_finish_reason":throw this.turn.status="error",new zA({message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"model_not_supported":{this.turn.status="error";let{modelName:l,modelProviderName:u}=Ro.parseModelNotSupportedReason(r.reason);throw new zA({message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:l,modelProviderName:u})}case"model_max_prompt_tokens_exceeded":throw this.turn.status="error",new zA({message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",responseIsFiltered:!1});case"tool_calls":return await this.handleToolCalls(r,n,o,e,s,c);default:throw this.turn.status="error",new zA({message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1})}}async handleToolCalls(e,r,n,o,s,c){if(e.type!=="tool_calls")throw new Error(`Expected tool_calls type but got ${e.type}`);if(!e.toolCalls)throw new Error("Tool calls are required but were not provided");this.turnContext.setCopilotEditsSessionHeader(e.copilotEditsSessionHeader);let l=e.toolCalls.map(u=>((!u.id||this.usedToolCallIds.has(u.id))&&(u.id=`cls_${t.NextToolCallId++}`),this.usedToolCallIds.add(u.id),u));this.addToolCallModelResponseToTurn(r,l,e.thinking,c),this.recordAssistantRoundTranscript(r,o,e.thinking),this.recordTrajectorySteps(e);for(let u of l)await this.handleSingleToolCall(u,n,o,s,e.usage);return{response:e,round:{response:r,toolInputRetry:0,toolCalls:l.map(u=>({id:u.id,name:u.function.name,arguments:JSON.stringify(u.function.arguments)})),phase:c}}}async handleSingleToolCall(e,r,n,o,s){if(!e.id)throw new Error(`Tool call id is required but was not provided for function ${e.function.name}`);let c=this.findToolByName(r,e.function.name);if(c instanceof Av)this.handleVirtualToolCall(c,e,n);else if(c instanceof _J)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;B0.error(this.turnContext.ctx,l);let u=new Gr([new Lr(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=wtt(u);await this.turnContext.agentToolCalls.error(n,e.id,d.message)}}handleVirtualToolCall(e,r,n){if(!r.id)throw new Error(`Tool call id is required but was not provided for function ${r.function.name}`);let o=performance.now(),s=this.turnContext.ctx.get(O5).didCall(this.turnContext,e.name),c,l;s?(l=s,c=s.status):(c="error",l=new Gr([new Lr(`Failed to activate virtual tool group ${e.name}`)],"error")),this.addToolCallResultToTurn(l,r.id);let u=performance.now()-o;gjt(this.turnContext.ctx,this.turnContext,{name:e.name,type:"virtual",toolProvider:{id:e.metadata.toolsetKey||"virtual"}},r.id,n,u,c,this.baseTelemetryWithExp)}async handleLanguageModelToolCall(e,r,n,o,s){let c=performance.now(),l="success";try{let u=AF(r);this.turnContext.agentToolCalls.init(n,r.id,e.name,e.type,u,this.formatInputForDisplay(u));let d=this.toolsService.prepareInvocation(e.id,{input:u,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o),{needConfirm:f}=await this.prepareToolConfirmation(e,u);await this.requestToolInvocationApproval(d,f,e,u,n,r.id,o),this.abortIfCanceled(o);let h=await this.hookTrigger.firePreToolUseHook(e,u,o,{turn:this.turn,conversationProgress:this.conversationProgress});if(h.denied){B0.info(this.turnContext.ctx,`Tool execution denied by hook: ${h.reason||"No reason provided"}`),l="cancelled";let A=new Gr([new Lr(h.reason||"Tool execution denied by hook")],"cancelled");this.addToolCallResultToTurn(A,r.id),await this.turnContext.agentToolCalls.cancel(n,r.id);return}let m=d.progressMessage||`Running ${e.displayName} tool`;await this.turnContext.agentToolCalls.running(n,r.id,m),this.recordToolExecutionStartTranscript(r.id,e.name,u);let g=await this.toolsService.invokeTool(this.turnContext,e.id,{toolInvocationToken:r.id,input:u,roundId:n,toolCallId:r.id},o);if(this.abortIfCanceled(o),await this.updateCompletionMessage(e,r,n,o),g.status==="success"){let A=kDn(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=wtt(g);await this.turnContext.agentToolCalls.error(n,r.id,A.message)}else await this.turnContext.agentToolCalls.cancel(n,r.id);await this.hookTrigger.firePostToolUseHook(e,u,g,o,{turn:this.turn,conversationProgress:this.conversationProgress}),this.addToolCallResultToTurn(g,r.id),this.recordSubagentTrajectoryLink(e,g,r.id),this.recordToolInOut(r,u,g,c)}catch(u){if(await this.updateCompletionMessage(e,r,n,o),u instanceof Rj||u instanceof zc)this.turn.status="cancelled",l="cancelled",this.addToolCallResultToTurn(new Gr([new Lr("The user chose to skip the tool call, they want to proceed without running it")],"cancelled"),r.id),await this.turnContext.agentToolCalls.cancel(n,r.id);else{B0.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${ld(u)}`,u),l="error";let d=new Gr([new Lr(ld(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=wtt(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),gjt(this.turnContext.ctx,this.turnContext,e,r.id,n,u,l,this.baseTelemetryWithExp)}}async updateCompletionMessage(e,r,n,o){let s=`Ran ${e.displayName} tool`;try{let c=AF(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){B0.debug(this.turnContext.ctx,`Failed to prepare completion message for tool ${e.id}: ${ld(c)}, using default message`)}await this.turnContext.agentToolCalls.updateProgressMessage(n,r.id,s)}async getAvailableChatTools(e,r){let n=(await Promise.all(e.map(async c=>this.shouldIncludeTool(c)&&await c.isEnabled(this.turnContext)?c:null))).filter(c=>c!==null),o=this.turnContext.ctx.get(O5);if(o.create(this.turnContext,n),!o.isEnabled(this.turnContext))return n.map(c=>({type:"function",function:{name:c.nameForModel,description:this.getToolDescription(c),parameters:c.inputSchema}}));let s=n;try{s=await o.compute(this.turnContext,r)||[]}catch(c){return B0.error(this.turnContext.ctx,`Error while computing tool grouping: ${ld(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof Av?{type:"function",function:{name:c.name,description:c.description}}:{type:"function",function:{name:c.nameForModel,description:this.getToolDescription(c),parameters:c.inputSchema}})}getAvailableLanguageModelTools(e){return e.filter(r=>this.shouldIncludeTool(r))}shouldIncludeTool(e){return e.name==="replace_string_in_file"?WDn(this.modelConfiguration):e.name==="apply_patch"?YDn(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?R5.getToolDescription(this.modelConfiguration.modelFamily):e.description}createAgentPromptProps(e){return{turnContext:this.turnContext,userRawMessage:this.turnContext.turn.request.message,workspaceFolders:this.turnContext.turn.workspaceFolders,snapshotTextDocumentProvider:this.snapshotTextDocumentProvider,tools:e,modelConfiguration:this.modelConfiguration,codesearchMode:this.turnContext.turn.chatMode?.kind==="Ask",hasSearchSubagent:this.cachedHasSearchSubagent??!1}}addToolCallModelResponseToTurn(e,r,n,o){let s={role:"assistant",content:e,tool_calls:r.length?r:void 0,thinking:n,phase:o,modelId:this.modelConfiguration.modelId};this.turn.response?this.turn.response.message=Hq(this.turn.response.message,s):this.turn.response={message:[s],type:"model"}}addToolCallResultToTurn(e,r){let n="";switch(e.status){case"error":n="Tool call failed with error: ";break;case"cancelled":n="Tool call is cancelled with result: ";break;default:case"success":n=""}let o=n+I5(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(SJ(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){B0.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=Hq(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get(O5).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(hZ).checkApproval(this.turnContext,e,r)}async buildTerminalCommandData(e,r){if(!e.id.includes("run_in_terminal"))return;let n=r.command,o=this.turnContext.ctx.get(wT),c=lZ(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!P5.isPotentiallySensitiveTool(e))return;let n=P5.getMatchingRuleForToolCall(e,r,this.turnContext),o=P5.extractFilePathForMetadata(e,r);if(o)return{filePath:o.filePath,matchingRule:n?.rule.pattern,ruleDescription:n?.rule.description,isGlobal:n?n.isOutsideWorkspace:void 0}}abortIfCanceled(e){if(e.isCancellationRequested)throw this.turn.status="cancelled",new zc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){B0.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=P5.generateSensitiveConfirmationMessage(n,o,this.turnContext);u&&(e.confirmationMessages={title:u.title,message:u.message});let d=e.confirmationMessages??{title:`Run ${n.id}`,message:`Do you want to allow "${n.id}" to run?`},f=await this.buildTerminalCommandData(n,o),h=this.buildSensitiveFileData(n,o),m=f||h?{terminalCommandData:f,sensitiveFileData:h}:void 0,g=qDn(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?lZ(n.description)||"sh":void 0,_=await this.toolsService.invokeToolConfirmation(this.turnContext,n.id,{title:d.title,message:d.message,input:{...o,toolType:A,...h?.filePath?{filePath:h.filePath}:{},...y?{commandLineType:y}:{},...n.type==="mcp"?{mcpServerName:n.toolProvider.id,mcpToolName:n.name,mcpType:"tool"}:{}},roundId:s,toolCallId:c,annotations:n.annotations,toolMetadata:m},l);switch(_.result){case"dismiss":throw this.turn.status="cancelled",new Rj("Cancelled by user");case"accept":return Promise.resolve();default:throw new Rj(`Invalid confirmation result ${_.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(B0.debug(this.turnContext.ctx,`Tool calling loop exceeds configured max iterations ${this.maxToolCallingLoop} for turn ${this.turn.id}`),this.turn.isSubagent()&&this.subagentConfig?.allowIterationExtension!==!1&&await this.requestAdditionalToolIterations(e,n)){let s=this.maxToolCallingLoop;this.maxToolCallingLoop=this.maxToolCallingLoop+this.requestLimitIncrement,B0.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new zF}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(ef)}catch(s){return B0.error(this.turnContext.ctx,`Tool confirmation invoker unavailable: ${ld(s)}, stopping tool calling loop.`),!1}let o=`cls_${t.NextToolCallId++}`;try{let s=await n.invokeClientToolConfirmation(this.turnContext,{name:Pds,title:"Continue to iterate?",message:"Copilot has been working on this problem for a while. Do you want it to continue to iterate? You can also set the maximum request limit in settings.",input:void 0,conversationId:this.conversation.id,turnId:this.turn.id,roundId:e,toolCallId:o});return this.abortIfCanceled(r),s.result==="accept"}catch(s){return B0.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${ld(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new zA({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new zA({message:`You may not include more than ${128} tools in your request.`,responseIsFiltered:!1})}formatInputForDisplay(e){try{return JSON.stringify(e,null,2)}catch{return}}async checkCompressionAfterToolCall(e){try{await this.turnContext.ctx.get(Cb).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){B0.error(this.turnContext.ctx,`Post-tool-call compression check failed: ${ld(r)}`)}}recordAssistantRoundTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o={text:e,iterationNumber:r};n&&(o.thinking={id:n.id,text:Array.isArray(n.text)?n.text.join(""):n.text});let s=ctt(e,String(this.turn.id),null,o);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,s).catch(c=>{ot.error(this.turnContext.ctx,`Failed to record assistant round transcript: ${c instanceof Error?c.message:String(c)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create assistant round transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordRenderedUserMessageTranscript(e){if(this.transcriptPersistence.isEnabled())try{let r=tDn(String(this.turn.id),e);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r).catch(n=>{ot.error(this.turnContext.ctx,`Failed to record rendered user message transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.turnContext.ctx,`Failed to create rendered user message transcript event: ${r instanceof Error?r.message:String(r)}`)}}recordToolExecutionStartTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o=rDn(e,r,n);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,o).catch(s=>{ot.error(this.turnContext.ctx,`Failed to record tool execution start transcript: ${s instanceof Error?s.message:String(s)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create tool execution start transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordToolExecutionCompleteTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o=this.turnContext.agentToolCalls.getToolCallById(e),s=o?{result:o.result,error:o.error,resultDetails:o.resultDetails,toolSpecificData:o.toolSpecificData,progressMessage:o.progressMessage}:void 0,c=nDn(e,r,s,null,{status:n.toString()});this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,c).catch(l=>{ot.error(this.turnContext.ctx,`Failed to record tool execution complete transcript: ${l instanceof Error?l.message:String(l)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create tool execution complete transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordTrajectorySteps(e){if(!this.llmRequestPersistence?.isEnabled()||e.type!=="tool_calls"||!e.toolCalls)return;let r=this.turnContext.subagentInfo,n=e.toolCalls.map(o=>({tool:o.function.name,tool_call_id:o.id}));hue(()=>this.llmRequestPersistence?.appendTrajectoryStep({tool_calls:n,input_tokens:e.usage?.prompt_tokens,output_tokens:e.usage?.completion_tokens,cached_input_tokens:e.usage?.prompt_tokens_details?.cached_tokens,loop_type:r?"subagent":"parent",subagent_name:r?.name,loop_order:this.nextTrajectoryOrder++,conversationId:this.conversation.id.toString(),turnId:this.turn.id.toString()}),o=>ot.debug(this.turnContext.ctx,"Failed to record trajectory step",o))}recordSubagentTrajectoryLink(e,r,n){if(e.name!=="run_subagent"||!this.llmRequestPersistence?.isEnabled()||!n)return;let o=r.subagentConversationId,s=r.subagentTurnId;!o||!s||hue(()=>this.llmRequestPersistence?.appendSubagentLink({type:"subagent_link",tool_call_id:n,subagent_conversationId:o,subagent_turnId:s,conversationId:this.conversation.id.toString(),turnId:this.turn.id.toString()}),c=>ot.debug(this.turnContext.ctx,"Failed to record subagent link",c))}recordToolInOut(e,r,n,o){if(!this.llmRequestPersistence?.isEnabled()||!e.id)return;let s=I5(n.content),c=Math.round(performance.now()-o);hue(()=>this.llmRequestPersistence?.appendToolInOut({tool_call_id:e.id,tool:e.function.name,input:r,output:s,status:n.status,timestamp:new Date().toISOString(),duration_ms:c}),l=>ot.debug(this.turnContext.ctx,"Failed to record tool-in-out entry",l))}};var uKt=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},dKt=class{constructor(e,r){this.handler=e;this.parentTurnId=r}static{a(this,"SubagentProgressHandler")}async begin(e,r,n,o){await this.handler.begin(e,r,n,{...o,parentTurnId:this.parentTurnId})}async report(e,r,n,o){await this.handler.report(e,r,n,{...o,parentTurnId:this.parentTurnId})}async end(e,r,n,o){await this.handler.end(e,r,n,o)}async cancel(e,r,n,o){await this.handler.cancel(e,r,n,o)}};function EHt(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(EHt,"parseModelString");var Brt=class{static{a(this,"CustomAgentExecutor")}constructor(e,r){this.config=e,this.subagentConfig=r}async invoke(e,r,n,o){let s=r.task,c=new lp({message:s,type:"user"}),l=this.config.model||e.turn.userRequestedModel;c.userRequestedModel=l,c.needToolCallConfirmation=r.needToolCallConfirmation,c.workspaceFolder=e.turn.workspaceFolder,c.workspaceFolders=e.turn.workspaceFolders,c.parentTurnId=e.turn.id,c.chatMode=new Rwe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new lJ([c],e.conversation.source,e.conversation.userLanguage),f=new Qw(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let S=EHt(this.config.model),T=S.modelName.toLowerCase(),w=S.provider.toLowerCase()||"copilot";if(w==="copilot"){let k=(await f.ctx.get(Ns).getMetadata()).find(D=>D.name.toLowerCase()===T);if(k)h=await Ro.getModelConfigurationById(e.ctx,k.id);else if(T===XJe.toLowerCase())m=!0,h=await Ro.getModelConfigurationById(e.ctx,lv,d.id.toString(),jq(d.turns));else throw new Error(`Model "${S.modelName}" not found in available models`)}else{let k=(await new as(f.ctx.get(Un)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(k)h=await zO(f.ctx,k.provider,k.name);else throw new Error(`BYOK model "${S.modelName}" with provider "${S.provider}" not found`)}}else this.subagentConfig.resolveModelFamily&&e.turn.resolvedModelConfiguration?.providerName===void 0?h=await Dds(e,S=>this.subagentConfig.resolveModelFamily(S)):h=e.turn.resolvedModelConfiguration;f.setResolvedModelConfiguration(h),f.subagentInfo={name:this.config.name,model:m?h.uiName:h.uiName||l,isAutoModel:m};let g=new mc(e.ctx),A=await fl(e.ctx,f,{languageId:""}),y=n||new uKt,_=new dKt(y,e.turn.id);await e.ctx.get(Bc).begin(d,c,_),await new yfe(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(Ru).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?Mn(c.response.message):"";return this.subagentConfig.postProcess&&(v=await this.subagentConfig.postProcess(f,v)),{response:v,conversationId:d.id.toString(),turnId:c.id.toString()}}};async function Dds(t,e){let r=t.turn.resolvedModelConfiguration,n=e(r.modelFamily);if(!n||n.length===0)return r;let o=r.originalBillingMultiplier;for(let s of n)try{let c=await Ro.resolveModelIdFromFamily(t.ctx,s);if(!c)continue;let l=await Ro.getModelConfigurationById(t.ctx,c);if(o!==void 0&&l.originalBillingMultiplier!==void 0&&l.originalBillingMultiplier>o)continue;return l}catch{continue}return r}a(Dds,"resolvePreferredSubagentModel");p();p();p();var Oj=fe(wo());var Frt=class extends fr{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=Mn(r.request.message),c=ZO(r.response?.message,!0),l=d5(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,Oj.useKeepWith)();return vscpp(vscppf,null,vscpp(Oj.SystemMessage,{priority:1e3},"You are a codebase exploration specialist focused exclusively on searching and analyzing existing code. Your main goal is to explore the codebase based on a query provided by the user.",vscpp("br",null),vscpp("br",null),"Your strengths:",vscpp("br",null),"- Rapidly finding files using file search patterns",vscpp("br",null),"- Searching code and text with powerful text search",vscpp("br",null),"- Reading and analyzing file contents",vscpp("br",null),vscpp("br",null),"## Guidelines",vscpp("br",null),vscpp("br",null),"- For file searches: search broadly when you don't know where something lives. Use read file when you know the specific file path.",vscpp("br",null),"- For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.",vscpp("br",null),"- Be thorough: Check multiple locations, consider different naming conventions, look for related files.",vscpp("br",null),vscpp("br",null),"IMPORTANT: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:",vscpp("br",null),"- Make efficient use of the tools at your disposal: be smart about how you search for files and implementations.",vscpp("br",null),"- Wherever possible you should try to spawn multiple parallel tool calls for searching and reading files.",vscpp("br",null),"- Maximum of ",this.props.maxSearchTurns," tool-calling rounds is allowed to complete the task.",vscpp("br",null),vscpp("br",null),"## Required Output",vscpp("br",null),vscpp("br",null),"End your response with an optional brief explanation of your findings (3 sentences max), followed by a tag containing absolute file paths and line ranges of relevant code snippets.",vscpp("br",null),vscpp("br",null),"Output Example:",vscpp("br",null),"The core routing logic lives in two files.",vscpp("br",null),vscpp("br",null),"",vscpp("br",null),"/absolute/path/to/file.py:10-20 (Optional Brief Reason)",vscpp("br",null),"/absolute/path/to/another/file.cc:100-120",vscpp("br",null),""),vscpp(Oj.UserMessage,{priority:950},vscpp(Wn,{name:"environment_info"},vscpp(Ij,{ctx:e.ctx})),vscpp(Wn,{name:"workspace_info"},vscpp(xj,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(Xde,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(Oj.UserMessage,{priority:900},vscpp(vscppf,null,s)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(Rw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`SearchSubagent-${r.id}`})),o&&vscpp(Oj.UserMessage,{priority:900},vscpp(vscppf,null,"CRITICAL: Your allotted iterations are finished. Do NOT make any more tool calls. You MUST immediately output your final results using the format described above. If you call any tool instead of responding, your results will be lost and the caller will receive an error. If you are not confident in your results, state what was unclear or incomplete so the caller can narrow down the search or continue from where you left off.")))}};var fKt=10,Nds=new Set(["file_search","grep_search","read_file"]),Urt=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[kn.ClaudeHaiku45,kn.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:fKt,isLastTurn:o.oneBasedIterationNum>fKt};return gp.create(Frt,s,n)}filterTools(e){return e.filter(r=>Nds.has(r.name))}getMaxRounds(){return fKt+1}};p();var bZ=fe(wo());var Qrt=class extends fr{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=ZO(r.response?.message,!0),l=d5(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,bZ.useKeepWith)(),d=Mn(r.request.message);return vscpp(vscppf,null,vscpp(bZ.SystemMessage,{priority:1e3},vscpp(rfe,null),vscpp("br",null),vscpp("br",null),'You are "',o,'", a specialized agent. Follow your instructions carefully and complete the assigned task.',s&&vscpp(vscppf,null,vscpp("br",null),vscpp("br",null),s),vscpp("br",null),vscpp("br",null),"When you complete your task, provide a clear, concise summary of what you accomplished. Do not include unnecessary preamble."),vscpp(bZ.UserMessage,{priority:950},vscpp(Wn,{name:"environment_info"},vscpp(Ij,{ctx:e.ctx})),vscpp(Wn,{name:"workspace_info"},vscpp(xj,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(bZ.UserMessage,{priority:900},vscpp(vscppf,null,d)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(Rw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`Subagent-${o}-${r.id}`})))}};var pKt=class{constructor(e){this.agentConfig=e}static{a(this,"DefaultSubagentConfig")}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,agentName:this.agentConfig.name,agentInstruction:this.agentConfig.instruction};return gp.create(Qrt,s,n)}};function MMn(t){return t.isBuiltIn&&t.name==="Search"?new Urt:new pKt(t)}a(MMn,"resolveSubagentConfig");var _fe=class extends Nu{constructor(){super({name:"run_subagent",displayName:"Run Sub Agent",description:`Launch a new agent to handle complex, multi-step tasks autonomously. The run_subagent tool launches specialized agents that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it. @@ -3474,9 +3474,9 @@ Usage notes: - Always include a short description (3-5 words) summarizing what the agent will do. - Provide clear, detailed prompts so the agent can work autonomously and return exactly the information you need. - Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, etc.), since it is not aware of the user's intent. -- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.`,displayDescription:"Delegate work to a specialized agent.",inputSchema:b.Object({task:b.String({description:"A detailed description of the task for the agent to perform. Should be clear and specific about what the agent should accomplish."}),agentName:b.String({description:"The name of the agent to invoke. Must be one of the exact agent names from the available agents list. Do not make up agent names."}),description:b.Optional(b.String({description:"A short (3-5 word) summary of what the agent will do, shown to the user as a progress message."}))})});this.registry=new Xde}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await fl(r.ctx,r),u;try{let d=await this.registry.getAgent(r,c);if(d?.isBuiltIn?l.properties.mode=d.name:l.properties.mode="custom",!d)return l.properties.message="Custom agent not found",l0(r.ctx,"runSubagentTool.error",l),Ix(r.ctx,"runSubagentTool.error",l),new Gr([new Or(`Custom agent '${c}' not found`)],"error");if(!d.invokePolicy.includes("model"))return l.properties.message="Agent model invocation disabled",l0(r.ctx,"runSubagentTool.error",l),Ix(r.ctx,"runSubagentTool.error",l),new Gr([new Or(`Agent '${c}' is not available for model invocation`)],"error");u=NMn(d);let f=new Brt(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(Bc).getCurrentHandler(r.conversation),A=await f.invoke(r,h,g,o),y=l.extendedBy({modelId:r.turn.getResolvedModelId()??"unknown",modelFamily:r.turn.getResolvedModelFamily()??"unknown"});ft(r.ctx,"runSubagentTool.success",y),Ix(r.ctx,"runSubagentTool.success",y);let _=`This is what has been accomplished by Custom Agent "${c}": +- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.`,displayDescription:"Delegate work to a specialized agent.",inputSchema:b.Object({task:b.String({description:"A detailed description of the task for the agent to perform. Should be clear and specific about what the agent should accomplish."}),agentName:b.String({description:"The name of the agent to invoke. Must be one of the exact agent names from the available agents list. Do not make up agent names."}),description:b.Optional(b.String({description:"A short (3-5 word) summary of what the agent will do, shown to the user as a progress message."}))})});this.registry=new efe}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await fl(r.ctx,r),u;try{let d=await this.registry.getAgent(r,c);if(d?.isBuiltIn?l.properties.mode=d.name:l.properties.mode="custom",!d)return l.properties.message="Custom agent not found",u0(r.ctx,"runSubagentTool.error",l),Ix(r.ctx,"runSubagentTool.error",l),new Gr([new Lr(`Custom agent '${c}' not found`)],"error");if(!d.invokePolicy.includes("model"))return l.properties.message="Agent model invocation disabled",u0(r.ctx,"runSubagentTool.error",l),Ix(r.ctx,"runSubagentTool.error",l),new Gr([new Lr(`Agent '${c}' is not available for model invocation`)],"error");u=MMn(d);let f=new Brt(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(Bc).getCurrentHandler(r.conversation),A=await f.invoke(r,h,g,o),y=l.extendedBy({modelId:r.turn.getResolvedModelId()??"unknown",modelFamily:r.turn.getResolvedModelFamily()??"unknown"});ft(r.ctx,"runSubagentTool.success",y),Ix(r.ctx,"runSubagentTool.success",y);let _=`This is what has been accomplished by Custom Agent "${c}": -${A.response}`,E=new Gr([new Or(_)],"success");return E.subagentConversationId=A.conversationId,E.subagentTurnId=A.turnId,E}catch(d){let f="";return d instanceof zF?(l.properties.message="Tool call round exceed",l0(r.ctx,"runSubagentTool.error",l),u?.allowIterationExtension===!1?f=`Agent "${c}" reached its iteration limit and may have returned partial results. Use whatever information was gathered and continue the task yourself.`:f=`Custom Agent "${c}" reached the maximum number of tool calls. The agent may have made partial progress. Break down the task into smaller steps or rephrase your request and try again before you finish the task by yourself. Explain this error and suggest the user to increase the tool request limit in settings before continue.`):f=d instanceof Error?`Error invoking custom agent: ${d.message}`:"An unknown error occurred while invoking the custom agent",zQe(r.ctx,"runSubagentTool.error",d,l.extendedBy({message:f})),new Gr([new Or(f)],"error")}}prepareInvocation(r,n){let{agentName:o,task:s,description:c}=r.input,l=c||`${s.substring(0,50)}${s.length>50?"...":""}`;return{progressMessage:`${o}: ${l}`}}prepareCompletion(r,n){let{agentName:o}=r.input;return{completionMessage:`Custom agent "${o}" finished execution`}}};p();var bZ=new pe("applyPatchTool"),Dds=`Use the \`apply_patch\` tool to edit files. +${A.response}`,E=new Gr([new Lr(_)],"success");return E.subagentConversationId=A.conversationId,E.subagentTurnId=A.turnId,E}catch(d){let f="";return d instanceof zF?(l.properties.message="Tool call round exceed",u0(r.ctx,"runSubagentTool.error",l),u?.allowIterationExtension===!1?f=`Agent "${c}" reached its iteration limit and may have returned partial results. Use whatever information was gathered and continue the task yourself.`:f=`Custom Agent "${c}" reached the maximum number of tool calls. The agent may have made partial progress. Break down the task into smaller steps or rephrase your request and try again before you finish the task by yourself. Explain this error and suggest the user to increase the tool request limit in settings before continue.`):f=d instanceof Error?`Error invoking custom agent: ${d.message}`:"An unknown error occurred while invoking the custom agent",zQe(r.ctx,"runSubagentTool.error",d,l.extendedBy({message:f})),new Gr([new Lr(f)],"error")}}prepareInvocation(r,n){let{agentName:o,task:s,description:c}=r.input,l=c||`${s.substring(0,50)}${s.length>50?"...":""}`;return{progressMessage:`${o}: ${l}`}}prepareCompletion(r,n){let{agentName:o}=r.input;return{completionMessage:`Custom agent "${o}" finished execution`}}};p();var SZ=new pe("applyPatchTool"),Mds=`Use the \`apply_patch\` tool to edit files. Your patch language is a stripped-down, file-oriented diff format designed to be easy to parse and safe to apply. You can think of it as a high-level envelope: *** Begin Patch @@ -3545,7 +3545,7 @@ It is important to remember: - Delete File is NOT supported. - You must include a header with your intended action (Add/Update) - You must prefix new lines with \`+\` even when creating a new file -- File references must be ABSOLUTE, NEVER RELATIVE.`,qrt=class extends Nu{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:Dds,displayDescription:"Apply a patch to edit a single file in the workspace.",inputSchema:b.Object({input:b.String({description:"The patch content following the apply_patch format specification."}),explanation:b.String({description:"A brief explanation of what the patch accomplishes."}),filePath:b.String({description:"The absolute path of the file for apply_patch tool to edit."})})})}async invoke(e,r,n){let{input:o,explanation:s}=r.input;if(!o)return new Gr([new Or("Missing patch text")],"error");let c=lNn(o);if(c.length>0){let h=`Delete file operation is not supported. Files attempted to delete: ${c.join(", ")}. Please use other methods to delete files.`;return bZ.warn(e.ctx,h),new Gr([new Or(h)],"error")}let l=fZ(o),u=cfe(o),d=[...new Set([...l,...u])];if(d.length>1){let h=`Each apply_patch call can only operate on one file. Found ${d.length} files: ${d.join(", ")}. Please use separate apply_patch tool calls for each file.`;return bZ.warn(e.ctx,h),new Gr([new Or(h)],"error")}let f={};try{bZ.debug(e.ctx,`Start to process apply_patch with explanation: ${s}`);let h=await this.buildCommit(o,f,e,n);return await this.applyCommit(e,r,h,n)}catch(h){if(h instanceof afe)return bZ.warn(e.ctx,`Apply patch failed with InvalidContextError: ${h.message}, kind: ${h.kindForTelemetry}`),new Gr([new Or(`Applying patch failed: ${h.message}`)],"error");if(h instanceof k5)return bZ.warn(e.ctx,`Apply patch failed with InvalidPatchFormatError: ${h.message}, kind: ${h.kindForTelemetry}`),new Gr([new Or(`Invalid patch format: ${h.message}`)],"error");if(h instanceof vm)return bZ.warn(e.ctx,`Apply patch failed with DiffError: ${h.message}`),new Gr([new Or(`Applying patch failed: ${h.message}`)],"error");let m=h instanceof Error?h.message:"An unknown error occurred";return bZ.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Gr([new Or(m)],"error")}}async buildCommit(e,r,n,o){return uNn(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=md(c,n.uriSchemeCache),d=await n.ctx.get(si).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new vm(`File not found: ${c}`);if(d.status==="invalid")throw new vm(`Invalid file: ${c}. Reason: ${d.reason}`);let f=d.document.getText();return r[c]={text:f},{getText:a(()=>f,"getText"),languageId:d.document.detectedLanguageId}},"openFn"))}async applyCommit(e,r,n,o){let s=[],c=[],l=[];for(let[f,h]of Object.entries(n.changes)){if(o.isCancellationRequested)throw new Error("Operation cancelled");switch(h.type){case"add":{let m=await this.invokeClientCreateFileTool(e,r,f,h.newContent??"",o);if(m.status!=="success")return m;c.push(f);break}case"delete":{l.push(f);break}case"update":{let m=h.movePath??f,g=await this.invokeClientEditFileTool(e,r,m,h.newContent??"",r.input.explanation,o);if(g.status!=="success")return g;s.push(m);break}}}let u=[];s.length>0&&u.push(`Edited files: +- File references must be ABSOLUTE, NEVER RELATIVE.`,qrt=class extends Nu{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:Mds,displayDescription:"Apply a patch to edit a single file in the workspace.",inputSchema:b.Object({input:b.String({description:"The patch content following the apply_patch format specification."}),explanation:b.String({description:"A brief explanation of what the patch accomplishes."}),filePath:b.String({description:"The absolute path of the file for apply_patch tool to edit."})})})}async invoke(e,r,n){let{input:o,explanation:s}=r.input;if(!o)return new Gr([new Lr("Missing patch text")],"error");let c=uNn(o);if(c.length>0){let h=`Delete file operation is not supported. Files attempted to delete: ${c.join(", ")}. Please use other methods to delete files.`;return SZ.warn(e.ctx,h),new Gr([new Lr(h)],"error")}let l=pZ(o),u=lfe(o),d=[...new Set([...l,...u])];if(d.length>1){let h=`Each apply_patch call can only operate on one file. Found ${d.length} files: ${d.join(", ")}. Please use separate apply_patch tool calls for each file.`;return SZ.warn(e.ctx,h),new Gr([new Lr(h)],"error")}let f={};try{SZ.debug(e.ctx,`Start to process apply_patch with explanation: ${s}`);let h=await this.buildCommit(o,f,e,n);return await this.applyCommit(e,r,h,n)}catch(h){if(h instanceof cfe)return SZ.warn(e.ctx,`Apply patch failed with InvalidContextError: ${h.message}, kind: ${h.kindForTelemetry}`),new Gr([new Lr(`Applying patch failed: ${h.message}`)],"error");if(h instanceof k5)return SZ.warn(e.ctx,`Apply patch failed with InvalidPatchFormatError: ${h.message}, kind: ${h.kindForTelemetry}`),new Gr([new Lr(`Invalid patch format: ${h.message}`)],"error");if(h instanceof vm)return SZ.warn(e.ctx,`Apply patch failed with DiffError: ${h.message}`),new Gr([new Lr(`Applying patch failed: ${h.message}`)],"error");let m=h instanceof Error?h.message:"An unknown error occurred";return SZ.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Gr([new Lr(m)],"error")}}async buildCommit(e,r,n,o){return dNn(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=md(c,n.uriSchemeCache),d=await n.ctx.get(si).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new vm(`File not found: ${c}`);if(d.status==="invalid")throw new vm(`Invalid file: ${c}. Reason: ${d.reason}`);let f=d.document.getText();return r[c]={text:f},{getText:a(()=>f,"getText"),languageId:d.document.detectedLanguageId}},"openFn"))}async applyCommit(e,r,n,o){let s=[],c=[],l=[];for(let[f,h]of Object.entries(n.changes)){if(o.isCancellationRequested)throw new Error("Operation cancelled");switch(h.type){case"add":{let m=await this.invokeClientCreateFileTool(e,r,f,h.newContent??"",o);if(m.status!=="success")return m;c.push(f);break}case"delete":{l.push(f);break}case"update":{let m=h.movePath??f,g=await this.invokeClientEditFileTool(e,r,m,h.newContent??"",r.input.explanation,o);if(g.status!=="success")return g;s.push(m);break}}}let u=[];s.length>0&&u.push(`Edited files: ${s.map(f=>` - ${f}`).join(` `)}`),c.length>0&&u.push(`Created files: ${c.map(f=>` - ${f}`).join(` @@ -3553,7 +3553,7 @@ ${c.map(f=>` - ${f}`).join(` ${l.map(f=>` - ${f}`).join(` `)}`);let d=u.length>0?u.join(` -`):"No changes were applied.";return new Gr([new Or(d)],"success")}async invokeClientEditFileTool(e,r,n,o,s,c){let l=e.ctx.get(vs).getToolByNameAndProvider("insert_edit_into_file",dp);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(vs).invokeTool(e,l.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:n,code:o,explanation:s},roundId:r.roundId,toolCallId:r.toolCallId},c)}async invokeClientCreateFileTool(e,r,n,o,s){let c=e.ctx.get(vs).getToolByNameAndProvider("create_file",dp);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(vs).invokeTool(e,c.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:n,content:o},roundId:r.roundId,toolCallId:r.toolCallId},s)}prepareInvocation(e,r){let{input:n}=e;if(!n.input||!n.input.length)return{progressMessage:"Running apply_patch tool"};let o=fZ(n.input),s=cfe(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=md(u,e.uriSchemeCache);return YA(d)}).join(", ")} with apply_patch tool`}:{progressMessage:"Running apply_patch tool"}}prepareCompletion(e,r){let{input:n}=e;if(!n.input||!n.input.length)return{completionMessage:"Ran apply_patch tool"};let o=fZ(n.input),s=cfe(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=md(u,e.uriSchemeCache);return YA(d)}).join(", ")} with apply_patch tool`}:{completionMessage:"Ran apply_patch tool"}}static toApplyPatchParams(e){if(typeof e.input!="string")throw new Error("input must be a string");if(typeof e.explanation!="string")throw new Error("explanation must be a string");if(typeof e.filePath!="string")throw new Error("filePath must be a string");return{input:e.input,explanation:e.explanation,filePath:e.filePath}}};p();var MMn=require("path");var Nds=16,Cke=class extends Nu{static{a(this,"CodebaseTool")}constructor(){super({name:"semantic_search",displayName:"Codebase",description:`Semantic search that finds code by meaning, not exact text. Returns relevant code snippets from the user's workspace. +`):"No changes were applied.";return new Gr([new Lr(d)],"success")}async invokeClientEditFileTool(e,r,n,o,s,c){let l=e.ctx.get(vs).getToolByNameAndProvider("insert_edit_into_file",dp);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(vs).invokeTool(e,l.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:n,code:o,explanation:s},roundId:r.roundId,toolCallId:r.toolCallId},c)}async invokeClientCreateFileTool(e,r,n,o,s){let c=e.ctx.get(vs).getToolByNameAndProvider("create_file",dp);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(vs).invokeTool(e,c.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:n,content:o},roundId:r.roundId,toolCallId:r.toolCallId},s)}prepareInvocation(e,r){let{input:n}=e;if(!n.input||!n.input.length)return{progressMessage:"Running apply_patch tool"};let o=pZ(n.input),s=lfe(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=md(u,e.uriSchemeCache);return YA(d)}).join(", ")} with apply_patch tool`}:{progressMessage:"Running apply_patch tool"}}prepareCompletion(e,r){let{input:n}=e;if(!n.input||!n.input.length)return{completionMessage:"Ran apply_patch tool"};let o=pZ(n.input),s=lfe(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=md(u,e.uriSchemeCache);return YA(d)}).join(", ")} with apply_patch tool`}:{completionMessage:"Ran apply_patch tool"}}static toApplyPatchParams(e){if(typeof e.input!="string")throw new Error("input must be a string");if(typeof e.explanation!="string")throw new Error("explanation must be a string");if(typeof e.filePath!="string")throw new Error("filePath must be a string");return{input:e.input,explanation:e.explanation,filePath:e.filePath}}};p();var OMn=require("path");var Ods=16,Cke=class extends Nu{static{a(this,"CodebaseTool")}constructor(){super({name:"semantic_search",displayName:"Codebase",description:`Semantic search that finds code by meaning, not exact text. Returns relevant code snippets from the user's workspace. When to Use: - Explore unfamiliar codebases @@ -3572,37 +3572,37 @@ Search Strategy: Query Guidelines: - Use keywords that likely appear in code: function names, class names, variable names, error types, package names -- AVOID generic words like "return", "code", "function", "method"`,displayDescription:"Find relevant file chunks, symbols, and other information in your codebase",inputSchema:b.Object({query:b.String({description:'The query keywords to search the codebase for, each keyword separated with space, like: "email message DNS_NAME". IMPORTANT: Use keywords that likely appear in code, such as: exact function names, class names, variable names, error types, package names, or domain-specific technical terms. AVOID generic words like "return", "code", "function", "method" and so on. The more specific your keywords, the better the search results.'}),maxResults:b.Optional(b.Number({description:"Maximum number of code chunks to return. Default is 16. Usually no need to change. Only increase when initial results are insufficient and broader context is required.",minimum:1,maximum:128}))})})}async invoke(e,r,n){if(!r.input.query)throw new Error("Invalid input");let o=e.ctx.get(R2),s=[];if(e.turn.workspaceFolder&&s.push(e.turn.workspaceFolder.uri),e.turn.workspaceFolders)for(let f of e.turn.workspaceFolders)s.includes(f.uri)||s.push(f.uri);let c=r.input.query,l=await o.searchWorkspace({rawQuery:c,resolveQueryAndKeywords:a(async()=>Promise.resolve({rephrasedQuery:c,keywords:this.getKeywordsForContent(c)}),"resolveQueryAndKeywords"),resolveQuery:a(async()=>Promise.resolve(c),"resolveQuery")},{tokenBudget:Lxn,maxResults:r.input.maxResults??Nds,workspaceFolders:s,source:"codebaseTool"},n);if(l.chunks.length===0)return new Gr([new Or("No relevant code found")],"success");let u=l.chunks.map(f=>{let h=un(f.chunk.file),m=GA(f.chunk.text);return new Or(`Here is a potentially relevant text excerpt in \`${h}\` starting at line ${f.chunk.range.startLineNumber-1}: +- AVOID generic words like "return", "code", "function", "method"`,displayDescription:"Find relevant file chunks, symbols, and other information in your codebase",inputSchema:b.Object({query:b.String({description:'The query keywords to search the codebase for, each keyword separated with space, like: "email message DNS_NAME". IMPORTANT: Use keywords that likely appear in code, such as: exact function names, class names, variable names, error types, package names, or domain-specific technical terms. AVOID generic words like "return", "code", "function", "method" and so on. The more specific your keywords, the better the search results.'}),maxResults:b.Optional(b.Number({description:"Maximum number of code chunks to return. Default is 16. Usually no need to change. Only increase when initial results are insufficient and broader context is required.",minimum:1,maximum:128}))})})}async invoke(e,r,n){if(!r.input.query)throw new Error("Invalid input");let o=e.ctx.get(R2),s=[];if(e.turn.workspaceFolder&&s.push(e.turn.workspaceFolder.uri),e.turn.workspaceFolders)for(let f of e.turn.workspaceFolders)s.includes(f.uri)||s.push(f.uri);let c=r.input.query,l=await o.searchWorkspace({rawQuery:c,resolveQueryAndKeywords:a(async()=>Promise.resolve({rephrasedQuery:c,keywords:this.getKeywordsForContent(c)}),"resolveQueryAndKeywords"),resolveQuery:a(async()=>Promise.resolve(c),"resolveQuery")},{tokenBudget:Bxn,maxResults:r.input.maxResults??Ods,workspaceFolders:s,source:"codebaseTool"},n);if(l.chunks.length===0)return new Gr([new Lr("No relevant code found")],"success");let u=l.chunks.map(f=>{let h=un(f.chunk.file),m=GA(f.chunk.text);return new Lr(`Here is a potentially relevant text excerpt in \`${h}\` starting at line ${f.chunk.range.startLineNumber-1}: ${m} ${f.chunk.text} -${m}`)}),d=new Oq(u,"success");return d.toolResultMessage=u.length===0?`Searched ${this.getDisplaySearchTarget(r.input)} for "${r.input.query}", no results`:u.length===1?`Searched ${this.getDisplaySearchTarget(r.input)} for "${r.input.query}", 1 result`:`Searched ${this.getDisplaySearchTarget(r.input)} for "${r.input.query}", ${u.length} results`,d.toolResultDetails=l.chunks.map(f=>({type:"fileLocation",value:{uri:f.chunk.file,range:{start:{line:f.chunk.range.startLineNumber,character:f.chunk.range.startColumn},end:{line:f.chunk.range.endLineNumber,character:f.chunk.range.endColumn}}}})),d}prepareInvocation(e,r){return{progressMessage:`Searching ${this.getDisplaySearchTarget(e.input)} for "${e.input.query}"`}}getDisplaySearchTarget(e){let r;return e.scopedDirectories&&e.scopedDirectories.length===1?r=`${(0,MMn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(!XE(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(Nn).getCapabilities();return Promise.resolve(!!r.watchedFiles)}getKeywordsForContent(e){let r=new Set;for(let n of e.matchAll(/(-?\d*\.\d\w*)|([^`~!@#%^&*()\-=+[{\]}\\|;:'",.<>/?\s]+)/g))r.add(n[0]);return Array.from(r.values(),n=>({keyword:n,variations:[]}))}};p();var jrt=class extends Nu{static{a(this,"CreateFileTool")}constructor(){super({name:"create_file",displayName:"Create File",description:"Create a new file in the workspace with the specified content. Use this tool to create new files.",displayDescription:"Create a new file in the workspace.",inputSchema:b.Object({filePath:b.String({description:"The absolute path of the file to create."}),content:b.String({description:"The content to write to the new file."})})})}async invoke(e,r,n){try{let o=await this.invokeClientCreateFileTool(e,r,n);return this.getFinalCreateFileResult(e,r,o)}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Gr([new Or(s)],"error")}}async invokeClientCreateFileTool(e,r,n){let o=e.ctx.get(vs).getToolByNameAndProvider("create_file",dp);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(vs).invokeTool(e,o.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,content:r.input.content},roundId:r.roundId,toolCallId:r.toolCallId},n)}getFinalCreateFileResult(e,r,n){if(n.status!=="success")return n;let o=OO({uri:md(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=I5(n.content),c=[];c.push(``),c.push("This is the new file that was created. You can reference this file in future operations.");let l=new w5({code:s,languageId:o,noFilePath:!0});return c.push(...l.renderAsArray()),c.push(""),new Gr([new Or(c.join(` -`))],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running create_file tool"};let o=md(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${YA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Xd),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran create_file tool"};let o=md(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${YA(o)}`}}static toCreateFileParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.content!="string")throw new Error("content must be a string");return{filePath:e.filePath,content:e.content}}};p();p();p();Fo();function SZ(){return Dt()}a(SZ,"uuidV4");p();var mh={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function BMn(t){let e=[],r=[],n=[],o,s;for(let c of Mds(t))switch(c.marker){case void 0:r=c.content;break;case mh.FILEPATH:o=c.content.join(` -`).trim();break;case mh.FIND:s=OMn(c.content);break;case mh.REPLACE:if(o&&s){let l=OMn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case mh.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(BMn,"parsePatchResponse");function OMn(t){if(t.length===0)return[""];let e=[],r=!1,n=0,o=!1,s=/^(`{3,})/;for(let c of t){let l=c.match(s);if(l&&!r)n=l[1].length,r=!0;else if(r){let u=c.match(s);if(u&&u[1].length>=n){o=!0;break}e.push(c)}}return o?e:t}a(OMn,"extractCodeBlock");function*Mds(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(mh.FILEPATH)?s=mh.FILEPATH:o.startsWith(mh.FIND)?s=mh.FIND:o.startsWith(mh.REPLACE)?s=mh.REPLACE:o.startsWith(mh.COMPLETE)?s=mh.COMPLETE:s=o,yield{marker:r,content:n},n=[o.substring(s.length)],r=s;continue}n.push(o)}yield{marker:r,content:n}}a(Mds,"iterateSections");function Ods(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=Lds(r,n);if(s===void 0)return;let{startIndex:c,endIndex:l,indentLevel:u,indentCharCount:d}=s,f="";if(d>0)for(let _=c;_<=l;_++){let E=r[_],v=bke(E);if(v===d&&v0&&v=0&&o>=r&&t.charCodeAt(n)===e.charCodeAt(o);)n--,o--;if(o>=r)return!1;for(;n>=0&&FMn(t.charCodeAt(n));)n--;return n<0}a(LMn,"endsWith");function Bds(t,e,r,n=4){let o=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,c=0;for(let l=e;l<=r;l++){let u=t[l],{level:d,length:f}=UMn(u,n),h=f;if(hs&&Hrt(t[c-1]);)c--;if(s===c)return[];let l=Number.MAX_SAFE_INTEGER,u=[];for(let f=s;f0)if(m===l)y=r;else{let _=m-l;n?y=r+" ".repeat(_):y=r+" ".repeat(o*_)}else n?y=" ".repeat(A):y=" ".repeat(o*A);d.push(y+h.substring(g))}}return d}a(Fds,"adjustIndentation");function QMn(t,e){let r=t;for(let n of e){let o=Ods(r,n);o!==void 0&&(r=o)}return r}a(QMn,"applyPatches");p();var Uds="InstantApplyChat";function Qds(t){return typeof t=="object"&&t!==null&&typeof t.serviceType=="string"&&typeof t.name=="string"&&typeof t.provider=="string"&&typeof t.capabilities=="object"&&t.capabilities!==null&&typeof t.capabilities.promptStrategy=="string"}a(Qds,"isProxyModel");function qds(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(Qds):[]}a(qds,"parseProxyModels");var Lj=class{constructor(e){this.ctx=e;this.logger=new pe("ProxyModelService");this.models=[];ws(e,n=>{this.fetchModels(n)});let r=e.get(Qt).getLastToken();r&&this.fetchModels(r)}static{a(this,"ProxyModelService")}get instantApplyModels(){return this.models.filter(e=>e.serviceType===Uds)}async fetchModels(e){try{let r=Px(this.ctx,e,"proxy","models"),n=await this.ctx.get(Jt).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...s_(this.ctx)}});if(!n.ok){this.logger.error(this.ctx,`Failed to fetch proxy models: ${n.status} ${n.statusText}`);return}let o=await n.json();this.logger.debug(this.ctx,`Proxy models response body: ${JSON.stringify(o)}`);let s=qds(o);this.models=s,this.logger.debug(this.ctx,`Fetched ${s.length} proxy models, ${this.instantApplyModels.length} instant-apply`)}catch(r){this.logger.exception(this.ctx,r,"Failed to fetch proxy models")}}};p();var Grt=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var N_=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var TZ=fe(wo());var _fe=class extends fr{static{a(this,"CodeMapperFullRewritePrompt")}renderCopilot(e,r){let{existingDocument:n,codeBlock:o,markdownBeforeBlock:s,inProgressRewriteContent:c}=this.props;if(n.status!=="valid")return vscpp(vscppf,null);let l=n.document,u=l.detectedLanguageId,d=l.getText(),f=l.lineCount,h=d.trim().length>0,m=GA(d),g=GA(o);return vscpp(vscppf,null,vscpp(TZ.SystemMessage,{priority:1e3},"You are an AI programming assistant that is specialized in applying code changes to an existing document.",vscpp("br",null),"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null),"The user has a code block that represents a suggestion for a code change and a ",u," file opened in a code editor.",vscpp("br",null),"Rewrite the existing document to fully incorporate the code changes in the provided code block.",vscpp("br",null),"For the response, always follow these instructions:",vscpp("br",null),"1. Analyze the code block and the existing document to decide if the code block should replace existing code or should be inserted.",vscpp("br",null),"2. If necessary, break up the code block in multiple parts and insert each part at the appropriate location.",vscpp("br",null),"3. Preserve whitespace and newlines right after the parts of the file that you modify.",vscpp("br",null),"4. The final result must be syntactically valid, properly formatted, and correctly indented. It should not contain any ",KA," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(TZ.UserMessage,{priority:700},h?vscpp(vscppf,null,"I have the following code open in the editor, starting from line 1 to line ",f,".",vscpp("br",null),vscpp(vscppf,null,m,u,vscpp("br",null),d,vscpp("br",null),m),vscpp("br",null)):vscpp(vscppf,null,"I am in an empty editor.",vscpp("br",null)),s&&vscpp(vscppf,null,"This is the description of what the code block changes:",vscpp("br",null),vscpp(Wn,{name:"changeDescription"},vscpp(vscppf,null,s)),vscpp("br",null)),"This is the code block that represents the suggested code change:",vscpp("br",null),vscpp(vscppf,null,g,u,vscpp("br",null),o,vscpp("br",null),g),vscpp("br",null),vscpp(Wn,{name:"userPrompt"},vscpp(vscppf,null,"Provide the fully rewritten file, incorporating the suggested code change. You must produce the complete file."))),c&&vscpp(vscppf,null,vscpp(TZ.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(TZ.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var Vrt=fe(wo());var pKt=class extends fr{static{a(this,"PatchEditRules")}renderCopilot(){return vscpp(vscppf,null,"When proposing a code change, provide one or more modifications in the following format:",vscpp("br",null),"Each modification consist of three sections headed by `",mh.FILEPATH,"`, `",mh.FIND,"` and `",mh.REPLACE,"`.",vscpp("br",null),"After ",mh.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",mh.FIND," add a code block containing a section of the program that will be replaced.",vscpp("br",null),"Add multiple lines so that a find tool can find and identify a section of the program. Start and end with a line that will not be modified. ",vscpp("br",null),"Include all comments and empty lines exactly as they appear in the original source code. Do not abbreviate any line or summarize the code with `...`. ",vscpp("br",null),"After ",mh.REPLACE," add a code block with the updated version of the original code in the find section. Maintain the same indentation and code style as in the original code.",vscpp("br",null),"After all modifications, add ",mh.COMPLETE,".",vscpp("br",null))}},$rt=class extends fr{static{a(this,"CodeMapperPatchRewritePrompt")}renderCopilot(e,r){let{existingDocument:n,codeBlock:o,markdownBeforeBlock:s}=this.props;if(n.status!=="valid")return vscpp(vscppf,null);let c=n.document,l=c.detectedLanguageId,u=c.getText(),d=c.lineCount,f=GA(u),h=GA(o),m=ys(this.props.uri);return vscpp(vscppf,null,vscpp(Vrt.SystemMessage,{priority:1e3},"You are an AI programming assistant that is specialized in applying code changes to an existing document.",vscpp("br",null),"I have a code block that represents a suggestion for a code change and I have a ",l," ","file opened in a code editor.",vscpp("br",null),"I expect you to come up with code changes that apply the code block to the editor.",vscpp("br",null),"I want the changes to be applied in a way that is safe and does not break the existing code, is correctly indented and matching the code style.",vscpp("br",null),"For the response, always follow these instructions:",vscpp("br",null),"1. Analyze the code block, the content of the editor and the current selection to decide if the code block should replace existing code or is to be inserted.",vscpp("br",null),"2. A line comment with `",KA,"` indicates a section of code that has not changed.",vscpp("br",null),"3. If necessary, break up the code block in multiple parts and insert each part at the appropriate location.",vscpp("br",null),"4. If necessary, make changes to other parts in the editor so that the final result is valid, properly formatted and indented.",vscpp("br",null),"5. Finally, provide the code modifications",vscpp("br",null),vscpp(pKt,null),vscpp("br",null),vscpp(Gtt,null),vscpp(Wn,{name:"example"},vscpp(Wn,{name:"user"},vscpp(vscppf,null,"I have the following code open in the editor.",vscpp("br",null),"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"```typescript",vscpp("br",null),"import ","{ readFileSync }"," from 'fs';",vscpp("br",null),vscpp("br",null),"class C ","{ }",vscpp("br",null),"```",vscpp("br",null),"This is the code block that represents a suggestion for a code change:",vscpp("br",null),"```typescript",vscpp("br",null),"private _stream: Stream;",vscpp("br",null),"```",vscpp("br",null),"Please find out how the code block can be applied to the editor.")),vscpp(Wn,{name:"assistant"},vscpp(vscppf,null,"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"---FIND",vscpp("br",null),"```",vscpp("br",null),"import { readFileSync } from 'fs';",vscpp("br",null),"```",vscpp("br",null),"---REPLACE",vscpp("br",null),"```",vscpp("br",null),"import { readFileSync } from 'fs';",vscpp("br",null),"import { Stream } from 'stream';",vscpp("br",null),"```",vscpp("br",null),"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"---FIND",vscpp("br",null),"```",vscpp("br",null),"class C ","{ }",vscpp("br",null),"```",vscpp("br",null),"---REPLACE",vscpp("br",null),"```",vscpp("br",null),'class C {"{"}',vscpp("br",null)," private _stream: Stream;",vscpp("br",null),"}",vscpp("br",null),"```",vscpp("br",null),"---COMPLETE"))),vscpp("br",null)),vscpp(Vrt.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${mh.FILEPATH} ${m}`:"",vscpp("br",null),vscpp(vscppf,null,f,l,vscpp("br",null),u,vscpp("br",null),f),vscpp("br",null),s&&vscpp(vscppf,null,"This is the description of what the code block changes:",vscpp("br",null),vscpp(Wn,{name:"changeDescription"},vscpp(vscppf,null,s)),vscpp("br",null)),"This is the code block that represents the suggested code change:",vscpp("br",null),vscpp(vscppf,null,h,l,vscpp("br",null),o,vscpp("br",null),h),vscpp("br",null),vscpp(Wn,{name:"userPrompt"},vscpp(vscppf,null,"Please find out how the code block can be applied to the editor. Provide the code changes in the format as described above."))))}};p();p();p();p();p();p();var wc=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Yc(`Invalid range: ${this.toString()}`)}static{a(this,"OffsetRange")}static fromTo(e,r){return new t(e,r)}static addRange(e,r){let n=0;for(;nr))return new t(e,r)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,r){return new t(e,e+r)}static emptyAt(e){return new t(e,e)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Yc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Yc(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let r=[];for(let n=this.start;ne.startLineNumber,Uue)}static subtract(e,r){return r?e.startLineNumberr)throw new Yc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=EJ(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)this._normalizedRanges.splice(r,0,e);else if(r===n-1){let o=this._normalizedRanges[r];this._normalizedRanges[r]=o.join(e)}else{let o=this._normalizedRanges[r].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(r,n-r,o)}}contains(e){let r=jqt(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=jqt(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let r=[],n=0,o=0,s=null;for(;n=c.startLineNumber?s=new nu(s.startLineNumber,Math.max(s.endLineNumberExclusive,c.endLineNumberExclusive)):(r.push(s),s=c)}return s!==null&&r.push(s),new t(r)}subtractFrom(e){let r=jKe(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=EJ(this._normalizedRanges,c=>c.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)return new t([e]);let o=[],s=e.startLineNumber;for(let c=r;cs&&o.push(new nu(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var L5=class t{constructor(e,r){this.lineCount=e;this.columnCount=r}static{a(this,"TextLength")}static{this.zero=new t(0,0)}static lengthDiffNonNegative(e,r){return r.isLessThan(e)?t.zero:e.lineCount===r.lineCount?new t(0,r.columnCount-e.columnCount):new t(r.lineCount-e.lineCount,r.columnCount)}static betweenPositions(e,r){return e.lineNumber===r.lineNumber?new t(0,r.column-e.column):new t(r.lineNumber-e.lineNumber,r.column-1)}static fromPosition(e){return new t(e.lineNumber-1,e.column-1)}static ofRange(e){return t.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let r=0,n=0;for(let o of e)o===` +${m}`)}),d=new Oq(u,"success");return d.toolResultMessage=u.length===0?`Searched ${this.getDisplaySearchTarget(r.input)} for "${r.input.query}", no results`:u.length===1?`Searched ${this.getDisplaySearchTarget(r.input)} for "${r.input.query}", 1 result`:`Searched ${this.getDisplaySearchTarget(r.input)} for "${r.input.query}", ${u.length} results`,d.toolResultDetails=l.chunks.map(f=>({type:"fileLocation",value:{uri:f.chunk.file,range:{start:{line:f.chunk.range.startLineNumber,character:f.chunk.range.startColumn},end:{line:f.chunk.range.endLineNumber,character:f.chunk.range.endColumn}}}})),d}prepareInvocation(e,r){return{progressMessage:`Searching ${this.getDisplaySearchTarget(e.input)} for "${e.input.query}"`}}getDisplaySearchTarget(e){let r;return e.scopedDirectories&&e.scopedDirectories.length===1?r=`${(0,OMn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(!XE(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(Nn).getCapabilities();return Promise.resolve(!!r.watchedFiles)}getKeywordsForContent(e){let r=new Set;for(let n of e.matchAll(/(-?\d*\.\d\w*)|([^`~!@#%^&*()\-=+[{\]}\\|;:'",.<>/?\s]+)/g))r.add(n[0]);return Array.from(r.values(),n=>({keyword:n,variations:[]}))}};p();var jrt=class extends Nu{static{a(this,"CreateFileTool")}constructor(){super({name:"create_file",displayName:"Create File",description:"Create a new file in the workspace with the specified content. Use this tool to create new files.",displayDescription:"Create a new file in the workspace.",inputSchema:b.Object({filePath:b.String({description:"The absolute path of the file to create."}),content:b.String({description:"The content to write to the new file."})})})}async invoke(e,r,n){try{let o=await this.invokeClientCreateFileTool(e,r,n);return this.getFinalCreateFileResult(e,r,o)}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Gr([new Lr(s)],"error")}}async invokeClientCreateFileTool(e,r,n){let o=e.ctx.get(vs).getToolByNameAndProvider("create_file",dp);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(vs).invokeTool(e,o.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,content:r.input.content},roundId:r.roundId,toolCallId:r.toolCallId},n)}getFinalCreateFileResult(e,r,n){if(n.status!=="success")return n;let o=OO({uri:md(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=I5(n.content),c=[];c.push(``),c.push("This is the new file that was created. You can reference this file in future operations.");let l=new w5({code:s,languageId:o,noFilePath:!0});return c.push(...l.renderAsArray()),c.push(""),new Gr([new Lr(c.join(` +`))],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running create_file tool"};let o=md(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${YA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(ef),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran create_file tool"};let o=md(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${YA(o)}`}}static toCreateFileParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.content!="string")throw new Error("content must be a string");return{filePath:e.filePath,content:e.content}}};p();p();p();Fo();function TZ(){return Dt()}a(TZ,"uuidV4");p();var mh={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function FMn(t){let e=[],r=[],n=[],o,s;for(let c of Lds(t))switch(c.marker){case void 0:r=c.content;break;case mh.FILEPATH:o=c.content.join(` +`).trim();break;case mh.FIND:s=LMn(c.content);break;case mh.REPLACE:if(o&&s){let l=LMn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case mh.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(FMn,"parsePatchResponse");function LMn(t){if(t.length===0)return[""];let e=[],r=!1,n=0,o=!1,s=/^(`{3,})/;for(let c of t){let l=c.match(s);if(l&&!r)n=l[1].length,r=!0;else if(r){let u=c.match(s);if(u&&u[1].length>=n){o=!0;break}e.push(c)}}return o?e:t}a(LMn,"extractCodeBlock");function*Lds(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(mh.FILEPATH)?s=mh.FILEPATH:o.startsWith(mh.FIND)?s=mh.FIND:o.startsWith(mh.REPLACE)?s=mh.REPLACE:o.startsWith(mh.COMPLETE)?s=mh.COMPLETE:s=o,yield{marker:r,content:n},n=[o.substring(s.length)],r=s;continue}n.push(o)}yield{marker:r,content:n}}a(Lds,"iterateSections");function Bds(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=Fds(r,n);if(s===void 0)return;let{startIndex:c,endIndex:l,indentLevel:u,indentCharCount:d}=s,f="";if(d>0)for(let _=c;_<=l;_++){let E=r[_],v=bke(E);if(v===d&&v0&&v=0&&o>=r&&t.charCodeAt(n)===e.charCodeAt(o);)n--,o--;if(o>=r)return!1;for(;n>=0&&UMn(t.charCodeAt(n));)n--;return n<0}a(BMn,"endsWith");function Uds(t,e,r,n=4){let o=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,c=0;for(let l=e;l<=r;l++){let u=t[l],{level:d,length:f}=QMn(u,n),h=f;if(hs&&Hrt(t[c-1]);)c--;if(s===c)return[];let l=Number.MAX_SAFE_INTEGER,u=[];for(let f=s;f0)if(m===l)y=r;else{let _=m-l;n?y=r+" ".repeat(_):y=r+" ".repeat(o*_)}else n?y=" ".repeat(A):y=" ".repeat(o*A);d.push(y+h.substring(g))}}return d}a(Qds,"adjustIndentation");function qMn(t,e){let r=t;for(let n of e){let o=Bds(r,n);o!==void 0&&(r=o)}return r}a(qMn,"applyPatches");p();var qds="InstantApplyChat";function jds(t){return typeof t=="object"&&t!==null&&typeof t.serviceType=="string"&&typeof t.name=="string"&&typeof t.provider=="string"&&typeof t.capabilities=="object"&&t.capabilities!==null&&typeof t.capabilities.promptStrategy=="string"}a(jds,"isProxyModel");function Hds(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(jds):[]}a(Hds,"parseProxyModels");var Lj=class{constructor(e){this.ctx=e;this.logger=new pe("ProxyModelService");this.models=[];ws(e,n=>{this.fetchModels(n)});let r=e.get(Qt).getLastToken();r&&this.fetchModels(r)}static{a(this,"ProxyModelService")}get instantApplyModels(){return this.models.filter(e=>e.serviceType===qds)}async fetchModels(e){try{let r=Px(this.ctx,e,"proxy","models"),n=await this.ctx.get(Jt).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...s_(this.ctx)}});if(!n.ok){this.logger.error(this.ctx,`Failed to fetch proxy models: ${n.status} ${n.statusText}`);return}let o=await n.json();this.logger.debug(this.ctx,`Proxy models response body: ${JSON.stringify(o)}`);let s=Hds(o);this.models=s,this.logger.debug(this.ctx,`Fetched ${s.length} proxy models, ${this.instantApplyModels.length} instant-apply`)}catch(r){this.logger.exception(this.ctx,r,"Failed to fetch proxy models")}}};p();var Grt=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var N_=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var IZ=fe(wo());var Efe=class extends fr{static{a(this,"CodeMapperFullRewritePrompt")}renderCopilot(e,r){let{existingDocument:n,codeBlock:o,markdownBeforeBlock:s,inProgressRewriteContent:c}=this.props;if(n.status!=="valid")return vscpp(vscppf,null);let l=n.document,u=l.detectedLanguageId,d=l.getText(),f=l.lineCount,h=d.trim().length>0,m=GA(d),g=GA(o);return vscpp(vscppf,null,vscpp(IZ.SystemMessage,{priority:1e3},"You are an AI programming assistant that is specialized in applying code changes to an existing document.",vscpp("br",null),"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null),"The user has a code block that represents a suggestion for a code change and a ",u," file opened in a code editor.",vscpp("br",null),"Rewrite the existing document to fully incorporate the code changes in the provided code block.",vscpp("br",null),"For the response, always follow these instructions:",vscpp("br",null),"1. Analyze the code block and the existing document to decide if the code block should replace existing code or should be inserted.",vscpp("br",null),"2. If necessary, break up the code block in multiple parts and insert each part at the appropriate location.",vscpp("br",null),"3. Preserve whitespace and newlines right after the parts of the file that you modify.",vscpp("br",null),"4. The final result must be syntactically valid, properly formatted, and correctly indented. It should not contain any ",KA," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(IZ.UserMessage,{priority:700},h?vscpp(vscppf,null,"I have the following code open in the editor, starting from line 1 to line ",f,".",vscpp("br",null),vscpp(vscppf,null,m,u,vscpp("br",null),d,vscpp("br",null),m),vscpp("br",null)):vscpp(vscppf,null,"I am in an empty editor.",vscpp("br",null)),s&&vscpp(vscppf,null,"This is the description of what the code block changes:",vscpp("br",null),vscpp(Wn,{name:"changeDescription"},vscpp(vscppf,null,s)),vscpp("br",null)),"This is the code block that represents the suggested code change:",vscpp("br",null),vscpp(vscppf,null,g,u,vscpp("br",null),o,vscpp("br",null),g),vscpp("br",null),vscpp(Wn,{name:"userPrompt"},vscpp(vscppf,null,"Provide the fully rewritten file, incorporating the suggested code change. You must produce the complete file."))),c&&vscpp(vscppf,null,vscpp(IZ.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(IZ.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var Vrt=fe(wo());var hKt=class extends fr{static{a(this,"PatchEditRules")}renderCopilot(){return vscpp(vscppf,null,"When proposing a code change, provide one or more modifications in the following format:",vscpp("br",null),"Each modification consist of three sections headed by `",mh.FILEPATH,"`, `",mh.FIND,"` and `",mh.REPLACE,"`.",vscpp("br",null),"After ",mh.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",mh.FIND," add a code block containing a section of the program that will be replaced.",vscpp("br",null),"Add multiple lines so that a find tool can find and identify a section of the program. Start and end with a line that will not be modified. ",vscpp("br",null),"Include all comments and empty lines exactly as they appear in the original source code. Do not abbreviate any line or summarize the code with `...`. ",vscpp("br",null),"After ",mh.REPLACE," add a code block with the updated version of the original code in the find section. Maintain the same indentation and code style as in the original code.",vscpp("br",null),"After all modifications, add ",mh.COMPLETE,".",vscpp("br",null))}},$rt=class extends fr{static{a(this,"CodeMapperPatchRewritePrompt")}renderCopilot(e,r){let{existingDocument:n,codeBlock:o,markdownBeforeBlock:s}=this.props;if(n.status!=="valid")return vscpp(vscppf,null);let c=n.document,l=c.detectedLanguageId,u=c.getText(),d=c.lineCount,f=GA(u),h=GA(o),m=ys(this.props.uri);return vscpp(vscppf,null,vscpp(Vrt.SystemMessage,{priority:1e3},"You are an AI programming assistant that is specialized in applying code changes to an existing document.",vscpp("br",null),"I have a code block that represents a suggestion for a code change and I have a ",l," ","file opened in a code editor.",vscpp("br",null),"I expect you to come up with code changes that apply the code block to the editor.",vscpp("br",null),"I want the changes to be applied in a way that is safe and does not break the existing code, is correctly indented and matching the code style.",vscpp("br",null),"For the response, always follow these instructions:",vscpp("br",null),"1. Analyze the code block, the content of the editor and the current selection to decide if the code block should replace existing code or is to be inserted.",vscpp("br",null),"2. A line comment with `",KA,"` indicates a section of code that has not changed.",vscpp("br",null),"3. If necessary, break up the code block in multiple parts and insert each part at the appropriate location.",vscpp("br",null),"4. If necessary, make changes to other parts in the editor so that the final result is valid, properly formatted and indented.",vscpp("br",null),"5. Finally, provide the code modifications",vscpp("br",null),vscpp(hKt,null),vscpp("br",null),vscpp(Gtt,null),vscpp(Wn,{name:"example"},vscpp(Wn,{name:"user"},vscpp(vscppf,null,"I have the following code open in the editor.",vscpp("br",null),"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"```typescript",vscpp("br",null),"import ","{ readFileSync }"," from 'fs';",vscpp("br",null),vscpp("br",null),"class C ","{ }",vscpp("br",null),"```",vscpp("br",null),"This is the code block that represents a suggestion for a code change:",vscpp("br",null),"```typescript",vscpp("br",null),"private _stream: Stream;",vscpp("br",null),"```",vscpp("br",null),"Please find out how the code block can be applied to the editor.")),vscpp(Wn,{name:"assistant"},vscpp(vscppf,null,"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"---FIND",vscpp("br",null),"```",vscpp("br",null),"import { readFileSync } from 'fs';",vscpp("br",null),"```",vscpp("br",null),"---REPLACE",vscpp("br",null),"```",vscpp("br",null),"import { readFileSync } from 'fs';",vscpp("br",null),"import { Stream } from 'stream';",vscpp("br",null),"```",vscpp("br",null),"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"---FIND",vscpp("br",null),"```",vscpp("br",null),"class C ","{ }",vscpp("br",null),"```",vscpp("br",null),"---REPLACE",vscpp("br",null),"```",vscpp("br",null),'class C {"{"}',vscpp("br",null)," private _stream: Stream;",vscpp("br",null),"}",vscpp("br",null),"```",vscpp("br",null),"---COMPLETE"))),vscpp("br",null)),vscpp(Vrt.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${mh.FILEPATH} ${m}`:"",vscpp("br",null),vscpp(vscppf,null,f,l,vscpp("br",null),u,vscpp("br",null),f),vscpp("br",null),s&&vscpp(vscppf,null,"This is the description of what the code block changes:",vscpp("br",null),vscpp(Wn,{name:"changeDescription"},vscpp(vscppf,null,s)),vscpp("br",null)),"This is the code block that represents the suggested code change:",vscpp("br",null),vscpp(vscppf,null,h,l,vscpp("br",null),o,vscpp("br",null),h),vscpp("br",null),vscpp(Wn,{name:"userPrompt"},vscpp(vscppf,null,"Please find out how the code block can be applied to the editor. Provide the code changes in the format as described above."))))}};p();p();p();p();p();p();var wc=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Yc(`Invalid range: ${this.toString()}`)}static{a(this,"OffsetRange")}static fromTo(e,r){return new t(e,r)}static addRange(e,r){let n=0;for(;nr))return new t(e,r)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,r){return new t(e,e+r)}static emptyAt(e){return new t(e,e)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Yc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Yc(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let r=[];for(let n=this.start;ne.startLineNumber,Que)}static subtract(e,r){return r?e.startLineNumberr)throw new Yc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=vJ(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)this._normalizedRanges.splice(r,0,e);else if(r===n-1){let o=this._normalizedRanges[r];this._normalizedRanges[r]=o.join(e)}else{let o=this._normalizedRanges[r].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(r,n-r,o)}}contains(e){let r=Hqt(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=Hqt(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let r=[],n=0,o=0,s=null;for(;n=c.startLineNumber?s=new nu(s.startLineNumber,Math.max(s.endLineNumberExclusive,c.endLineNumberExclusive)):(r.push(s),s=c)}return s!==null&&r.push(s),new t(r)}subtractFrom(e){let r=jKe(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=vJ(this._normalizedRanges,c=>c.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)return new t([e]);let o=[],s=e.startLineNumber;for(let c=r;cs&&o.push(new nu(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var L5=class t{constructor(e,r){this.lineCount=e;this.columnCount=r}static{a(this,"TextLength")}static{this.zero=new t(0,0)}static lengthDiffNonNegative(e,r){return r.isLessThan(e)?t.zero:e.lineCount===r.lineCount?new t(0,r.columnCount-e.columnCount):new t(r.lineCount-e.lineCount,r.columnCount)}static betweenPositions(e,r){return e.lineNumber===r.lineNumber?new t(0,r.column-e.column):new t(r.lineNumber-e.lineNumber,r.column-1)}static fromPosition(e){return new t(e.lineNumber-1,e.column-1)}static ofRange(e){return t.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let r=0,n=0;for(let o of e)o===` `?(r++,n=0):n++;return new t(r,n)}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new t(this.lineCount,this.columnCount+e.columnCount):new t(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new ji(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new ji(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new ji(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return nu.ofLength(1,this.lineCount)}addToPosition(e){return this.lineCount===0?new es(e.lineNumber,e.column+this.columnCount):new es(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return ji.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};var Ske=class{constructor(e){this.text=e;this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let r=0;r0&&e.charAt(r-1)==="\r"?this.lineEndOffsetByLineIdx.push(r-1):this.lineEndOffsetByLineIdx.push(r));this.lineEndOffsetByLineIdx.push(e.length)}static{a(this,"PositionOffsetTransformer")}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}getOffsetRange(e){return new wc(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=EJ(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new es(n,o)}getRange(e){return ji.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return L5.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new L5(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var hKt=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new es(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getLineLength(e){return this.getValueOfRange(new ji(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Ske(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new ji(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return iZe(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var XF=class extends hKt{constructor(r){super();this.value=r;this._t=new Ske(this.value)}static{a(this,"StringText")}getValueOfRange(r){return this._t.getOffsetRange(r).substring(this.value)}get length(){return this._t.textLength}};p();p();p();var Tke=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Yc(`Edits must be disjoint and sorted. Found ${n} after ${r}`);r=n.replaceRange.endExclusive}}static{a(this,"BaseEdit")}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let r=0;rr.toString()).join(", ")}]`}normalize(){let e=[],r;for(let n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(r&&r.replaceRange.endExclusive===n.replaceRange.start){let o=r.tryJoinTouching(n);if(o){r=o;continue}}r&&e.push(r),r=n}return r&&e.push(r),this._createNew(e)}compose(e){let r=this.normalize(),n=e.normalize();if(r.isEmpty())return n;if(n.isEmpty())return r;let o=[...r.replacements],s=[],c=0;for(let l of n.replacements){for(;;){let h=o[0];if(!h||h.replaceRange.start+c+h.getNewLength()>=l.replaceRange.start)break;o.shift(),s.push(h),c+=h.getNewLength()-h.replaceRange.length}let u=c,d,f;for(;;){let h=o[0];if(!h||h.replaceRange.start+c>l.replaceRange.endExclusive)break;d||(d=h),f=h,o.shift(),c+=h.getNewLength()-h.replaceRange.length}if(!d)s.push(l.delta(-c));else{let h=Math.min(d.replaceRange.start,l.replaceRange.start-u),m=l.replaceRange.start-(d.replaceRange.start+u);if(m>0){let _=d.slice(wc.emptyAt(h),new wc(0,m));s.push(_)}if(!f)throw new Yc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let _=f.slice(wc.ofStartAndLength(f.replaceRange.endExclusive,0),new wc(f.getNewLength()-g,f.getNewLength()));o.unshift(_),c-=_.getNewLength()-_.replaceRange.length}let A=new wc(h,l.replaceRange.endExclusive-c),y=l.slice(A,new wc(0,l.getNewLength()));s.push(y)}}for(;;){let l=o.shift();if(!l)break;s.push(l)}return this._createNew(s).normalize()}decomposeSplit(e){let r=[],n=[],o=0;for(let s of this.replacements)e(s)?(r.push(s),o+=s.getNewLength()-s.replaceRange.length):n.push(s.slice(s.replaceRange.delta(o),new wc(0,s.getNewLength())));return{e1:this._createNew(r),e2:this._createNew(n)}}getNewRanges(){let e=[],r=0;for(let n of this.replacements)e.push(wc.ofStartAndLength(n.replaceRange.start+r,n.getNewLength())),r+=n.getLengthDelta();return e}getJoinedReplaceRange(){if(this.replacements.length!==0)return this.replacements[0].replaceRange.join(this.replacements.at(-1).replaceRange)}isEmpty(){return this.replacements.length===0}getLengthDelta(){return Owe(this.replacements,e=>e.getLengthDelta())}getNewDataLength(e){return e+this.getLengthDelta()}applyToOffset(e){let r=0;for(let n of this.replacements)if(n.replaceRange.start<=e){if(e ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new wc(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},qMn=class t extends Tke{static{a(this,"Edit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}_createNew(e){return new t(e)}};var Yrt=class extends Tke{static{a(this,"BaseStringEdit")}get TReplacement(){throw new Error("TReplacement is not defined for BaseStringEdit")}static composeOrUndefined(e){if(e.length===0)return;let r=e[0];for(let n=1;n" ".repeat(l-c)),o=r.tryRebase(n);if(!o)return;let s=e.tryRebase(o);if(s)return{e1:o,e2:s}}apply(e){let r=[],n=0;for(let o of this.replacements)r.push(e.substring(n,o.replaceRange.start)),r.push(o.newText),n=o.replaceRange.endExclusive;return r.push(e.substring(n)),r.join("")}inverseOnSlice(e){let r=[],n=0;for(let o of this.replacements)r.push(JA.replace(wc.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new yv(r)}inverse(e){return this.inverseOnSlice((r,n)=>e.substring(r,n))}tryRebase(e,r=!0){let n=[],o=0,s=0,c=0;for(;s({txt:e.newText,pos:e.replaceRange.start,len:e.replaceRange.length}))}isNeutralOn(e){return this.replacements.every(r=>r.isNeutralOn(e))}removeCommonSuffixPrefix(e){let r=[];for(let n of this.replacements){let o=n.removeCommonSuffixPrefix(e);o.isEmpty||r.push(o)}return new yv(r)}normalizeEOL(e){return new yv(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=JA.replace(wc.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?yv.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new XF(this.apply(e.value))}mapData(e){return new mKt(this.replacements.map(r=>new Efe(r.replaceRange,r.newText,e(r))))}},Krt=class extends zrt{constructor(r,n){super(r);this.newText=n}static{a(this,"BaseStringReplacement")}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(r){return r.substring(0,this.replaceRange.start)+this.newText+r.substring(this.replaceRange.endExclusive)}isNeutralOn(r){return this.newText===r.substring(this.replaceRange.start,this.replaceRange.endExclusive)}removeCommonSuffixPrefix(r){let n=r.substring(this.replaceRange.start,this.replaceRange.endExclusive),o=nde(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,sRe(n,this.newText)),c=new wc(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new JA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new JA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=nde(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new wc(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=sRe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new wc(0,this.newText.length-o))}toEdit(){return new yv([this])}},yv=class t extends Yrt{static{a(this,"StringEdit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r){return new t([new JA(e,r)])}static insert(e,r){return new t([new JA(wc.emptyAt(e),r)])}static delete(e){return new t([new JA(e,"")])}static fromJson(e){return new t(e.map(JA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew JA(e.replaceRange,e.newText)))}},Efe=class t extends Krt{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(wc.emptyAt(r),n,o)}static replace(r,n,o){return new t(r,n,o)}static delete(r,n){return new t(r,"",n)}equals(r){return this.replaceRange.equals(r.replaceRange)&&this.newText===r.newText&&this.data===r.data}tryJoinTouching(r){let n=this.data.join(r.data);if(n!==void 0)return new t(this.replaceRange.joinRightTouching(r.replaceRange),this.newText+r.newText,n)}slice(r,n){return new t(r,n?n.substring(this.newText):this.newText,this.data)}};p();var Ike=class t{constructor(e){this.replacements=e;FHt(()=>uRe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>M_.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new M_(e,r)])}static insert(e,r){return new t([new M_(ji.fromPositions(e,e),r)])}normalize(){let e=[];for(let r of this.replacements)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(r.range.getStartPosition())){let n=e[e.length-1];e[e.length-1]=new M_(n.range.plusRange(r.range),n.text+r.text)}else r.isEmpty||e.push(r);return new t(e)}mapPosition(e){let r=0,n=0,o=0;for(let s of this.replacements){let c=s.range.getStartPosition();if(e.isBeforeOrEqual(c))break;let l=s.range.getEndPosition(),u=L5.ofText(s.text);if(e.isBefore(l)){let d=new es(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return Jrt(d,f)}c.lineNumber+r!==n&&(o=0),r+=u.lineCount-(s.range.endLineNumber-s.range.startLineNumber),u.lineCount===0?l.lineNumber!==c.lineNumber?o+=u.columnCount-(l.column-1):o+=u.columnCount-(l.column-c.column):o=u.columnCount,n=l.lineNumber+r}return new es(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof es?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof es?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return Jrt(o,s)}inverseMapPosition(e,r){return this.inverse(r).mapPosition(e)}inverseMapRange(e,r){return this.inverse(r).mapRange(e)}apply(e){let r="",n=new es(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=Jrt(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=Jrt(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new XF(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new M_(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=L5.ofText(s.text),l=es.lift({lineNumber:s.range.startLineNumber+n,column:s.range.startColumn+(s.range.startLineNumber===r?o:0)}),u=c.createRange(l);e.push(u),n=u.endLineNumber-s.range.endLineNumber,o=u.endColumn-s.range.endColumn,r=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Yc;if(this.replacements.length===1)return this.replacements[0];let r=this.replacements[0].range.getStartPosition(),n=this.replacements[this.replacements.length-1].range.getEndPosition(),o="";for(let s=0;sr.equals(n))}toString(e){return e===void 0?this.replacements.map(r=>r.toString()).join(` +`&&(this.lineStartOffsetByLineIdx.push(r+1),r>0&&e.charAt(r-1)==="\r"?this.lineEndOffsetByLineIdx.push(r-1):this.lineEndOffsetByLineIdx.push(r));this.lineEndOffsetByLineIdx.push(e.length)}static{a(this,"PositionOffsetTransformer")}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}getOffsetRange(e){return new wc(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=vJ(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new es(n,o)}getRange(e){return ji.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return L5.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new L5(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var mKt=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new es(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getLineLength(e){return this.getValueOfRange(new ji(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Ske(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new ji(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return iZe(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var XF=class extends mKt{constructor(r){super();this.value=r;this._t=new Ske(this.value)}static{a(this,"StringText")}getValueOfRange(r){return this._t.getOffsetRange(r).substring(this.value)}get length(){return this._t.textLength}};p();p();p();var Tke=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Yc(`Edits must be disjoint and sorted. Found ${n} after ${r}`);r=n.replaceRange.endExclusive}}static{a(this,"BaseEdit")}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let r=0;rr.toString()).join(", ")}]`}normalize(){let e=[],r;for(let n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(r&&r.replaceRange.endExclusive===n.replaceRange.start){let o=r.tryJoinTouching(n);if(o){r=o;continue}}r&&e.push(r),r=n}return r&&e.push(r),this._createNew(e)}compose(e){let r=this.normalize(),n=e.normalize();if(r.isEmpty())return n;if(n.isEmpty())return r;let o=[...r.replacements],s=[],c=0;for(let l of n.replacements){for(;;){let h=o[0];if(!h||h.replaceRange.start+c+h.getNewLength()>=l.replaceRange.start)break;o.shift(),s.push(h),c+=h.getNewLength()-h.replaceRange.length}let u=c,d,f;for(;;){let h=o[0];if(!h||h.replaceRange.start+c>l.replaceRange.endExclusive)break;d||(d=h),f=h,o.shift(),c+=h.getNewLength()-h.replaceRange.length}if(!d)s.push(l.delta(-c));else{let h=Math.min(d.replaceRange.start,l.replaceRange.start-u),m=l.replaceRange.start-(d.replaceRange.start+u);if(m>0){let _=d.slice(wc.emptyAt(h),new wc(0,m));s.push(_)}if(!f)throw new Yc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let _=f.slice(wc.ofStartAndLength(f.replaceRange.endExclusive,0),new wc(f.getNewLength()-g,f.getNewLength()));o.unshift(_),c-=_.getNewLength()-_.replaceRange.length}let A=new wc(h,l.replaceRange.endExclusive-c),y=l.slice(A,new wc(0,l.getNewLength()));s.push(y)}}for(;;){let l=o.shift();if(!l)break;s.push(l)}return this._createNew(s).normalize()}decomposeSplit(e){let r=[],n=[],o=0;for(let s of this.replacements)e(s)?(r.push(s),o+=s.getNewLength()-s.replaceRange.length):n.push(s.slice(s.replaceRange.delta(o),new wc(0,s.getNewLength())));return{e1:this._createNew(r),e2:this._createNew(n)}}getNewRanges(){let e=[],r=0;for(let n of this.replacements)e.push(wc.ofStartAndLength(n.replaceRange.start+r,n.getNewLength())),r+=n.getLengthDelta();return e}getJoinedReplaceRange(){if(this.replacements.length!==0)return this.replacements[0].replaceRange.join(this.replacements.at(-1).replaceRange)}isEmpty(){return this.replacements.length===0}getLengthDelta(){return Owe(this.replacements,e=>e.getLengthDelta())}getNewDataLength(e){return e+this.getLengthDelta()}applyToOffset(e){let r=0;for(let n of this.replacements)if(n.replaceRange.start<=e){if(e ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new wc(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},jMn=class t extends Tke{static{a(this,"Edit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}_createNew(e){return new t(e)}};var Yrt=class extends Tke{static{a(this,"BaseStringEdit")}get TReplacement(){throw new Error("TReplacement is not defined for BaseStringEdit")}static composeOrUndefined(e){if(e.length===0)return;let r=e[0];for(let n=1;n" ".repeat(l-c)),o=r.tryRebase(n);if(!o)return;let s=e.tryRebase(o);if(s)return{e1:o,e2:s}}apply(e){let r=[],n=0;for(let o of this.replacements)r.push(e.substring(n,o.replaceRange.start)),r.push(o.newText),n=o.replaceRange.endExclusive;return r.push(e.substring(n)),r.join("")}inverseOnSlice(e){let r=[],n=0;for(let o of this.replacements)r.push(JA.replace(wc.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new yv(r)}inverse(e){return this.inverseOnSlice((r,n)=>e.substring(r,n))}tryRebase(e,r=!0){let n=[],o=0,s=0,c=0;for(;s({txt:e.newText,pos:e.replaceRange.start,len:e.replaceRange.length}))}isNeutralOn(e){return this.replacements.every(r=>r.isNeutralOn(e))}removeCommonSuffixPrefix(e){let r=[];for(let n of this.replacements){let o=n.removeCommonSuffixPrefix(e);o.isEmpty||r.push(o)}return new yv(r)}normalizeEOL(e){return new yv(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=JA.replace(wc.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?yv.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new XF(this.apply(e.value))}mapData(e){return new gKt(this.replacements.map(r=>new vfe(r.replaceRange,r.newText,e(r))))}},Krt=class extends zrt{constructor(r,n){super(r);this.newText=n}static{a(this,"BaseStringReplacement")}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(r){return r.substring(0,this.replaceRange.start)+this.newText+r.substring(this.replaceRange.endExclusive)}isNeutralOn(r){return this.newText===r.substring(this.replaceRange.start,this.replaceRange.endExclusive)}removeCommonSuffixPrefix(r){let n=r.substring(this.replaceRange.start,this.replaceRange.endExclusive),o=ide(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,sRe(n,this.newText)),c=new wc(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new JA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new JA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=ide(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new wc(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=sRe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new wc(0,this.newText.length-o))}toEdit(){return new yv([this])}},yv=class t extends Yrt{static{a(this,"StringEdit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r){return new t([new JA(e,r)])}static insert(e,r){return new t([new JA(wc.emptyAt(e),r)])}static delete(e){return new t([new JA(e,"")])}static fromJson(e){return new t(e.map(JA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew JA(e.replaceRange,e.newText)))}},vfe=class t extends Krt{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(wc.emptyAt(r),n,o)}static replace(r,n,o){return new t(r,n,o)}static delete(r,n){return new t(r,"",n)}equals(r){return this.replaceRange.equals(r.replaceRange)&&this.newText===r.newText&&this.data===r.data}tryJoinTouching(r){let n=this.data.join(r.data);if(n!==void 0)return new t(this.replaceRange.joinRightTouching(r.replaceRange),this.newText+r.newText,n)}slice(r,n){return new t(r,n?n.substring(this.newText):this.newText,this.data)}};p();var Ike=class t{constructor(e){this.replacements=e;UHt(()=>uRe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>M_.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new M_(e,r)])}static insert(e,r){return new t([new M_(ji.fromPositions(e,e),r)])}normalize(){let e=[];for(let r of this.replacements)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(r.range.getStartPosition())){let n=e[e.length-1];e[e.length-1]=new M_(n.range.plusRange(r.range),n.text+r.text)}else r.isEmpty||e.push(r);return new t(e)}mapPosition(e){let r=0,n=0,o=0;for(let s of this.replacements){let c=s.range.getStartPosition();if(e.isBeforeOrEqual(c))break;let l=s.range.getEndPosition(),u=L5.ofText(s.text);if(e.isBefore(l)){let d=new es(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return Jrt(d,f)}c.lineNumber+r!==n&&(o=0),r+=u.lineCount-(s.range.endLineNumber-s.range.startLineNumber),u.lineCount===0?l.lineNumber!==c.lineNumber?o+=u.columnCount-(l.column-1):o+=u.columnCount-(l.column-c.column):o=u.columnCount,n=l.lineNumber+r}return new es(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof es?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof es?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return Jrt(o,s)}inverseMapPosition(e,r){return this.inverse(r).mapPosition(e)}inverseMapRange(e,r){return this.inverse(r).mapRange(e)}apply(e){let r="",n=new es(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=Jrt(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=Jrt(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new XF(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new M_(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=L5.ofText(s.text),l=es.lift({lineNumber:s.range.startLineNumber+n,column:s.range.startColumn+(s.range.startLineNumber===r?o:0)}),u=c.createRange(l);e.push(u),n=u.endLineNumber-s.range.endLineNumber,o=u.endColumn-s.range.endColumn,r=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Yc;if(this.replacements.length===1)return this.replacements[0];let r=this.replacements[0].range.getStartPosition(),n=this.replacements[this.replacements.length-1].range.getEndPosition(),o="";for(let s=0;sr.equals(n))}toString(e){return e===void 0?this.replacements.map(r=>r.toString()).join(` `):typeof e=="string"?this.toString(new XF(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=ji.fromPositions(new es(Math.max(1,r.range.startLineNumber-1),1),r.range.getStartPosition()),c=e.getValueOfRange(s);c.length>10&&(c="..."+c.substring(c.length-10));let l=ji.fromPositions(r.range.getEndPosition(),new es(r.range.endLineNumber+1,1)),u=e.getValueOfRange(l);u.length>10&&(u=u.substring(0,10)+"...");let d=o;if(d.length>10){let h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}let f=r.text;if(f.length>10){let h=Math.floor(5);f=f.substring(0,h)+"..."+f.substring(f.length-h)}return d.length===0?`${c}\u2770${f}\u2771${u}`:`${c}\u2770${d}\u21A6${f}\u2771${u}`}).join(` `)}},M_=class t{constructor(e,r){this.range=e;this.text=r}static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new Yc;if(e.length===1)return e[0];let n=e[0].range.getStartPosition(),o=e[e.length-1].range.getEndPosition(),s="";for(let c=0;cr.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>vfe.deserialize(r)))}static fromEdit(e,r){let n=Ike.fromStringEdit(e,r);return t.fromTextEdit(n,r)}static fromTextEdit(e,r){let n=e.replacements,o=[],s=[];for(let c=0;cn.lineRange.startLineNumber,Uue)),new t(r)}isEmpty(){return this.replacements.length===0}toEdit(e){let r=[];for(let n of this.replacements){let o=n.toSingleEdit(e);r.push(o)}return new yv(r)}toString(){return this.replacements.map(e=>e.toString()).join(",")}serialize(){return this.replacements.map(e=>e.serialize())}getNewLineRanges(){let e=[],r=0;for(let n of this.replacements)e.push(nu.ofLength(n.lineRange.startLineNumber+r,n.newLines.length)),r+=n.newLines.length-n.lineRange.length;return e}mapLineNumber(e){let r=0;for(let n of this.replacements){if(n.lineRange.endLineNumberExclusive>e)break;r+=n.newLines.length-n.lineRange.length}return e+r}mapLineRange(e){return new nu(this.mapLineNumber(e.startLineNumber),this.mapLineNumber(e.endLineNumberExclusive))}mapBackLineRange(e,r){return this.inverse(r).mapLineRange(e)}touches(e){return this.replacements.some(r=>e.replacements.some(n=>r.lineRange.intersect(n.lineRange)))}rebase(e){return new t(this.replacements.map(r=>new vfe(e.mapLineRange(r.lineRange),r.newLines)))}humanReadablePatch(e){let r=[];function n(l,u,d,f){let h=d==="unmodified"?" ":d==="deleted"?"-":"+";f===void 0&&(f="[[[[[ WARNING: LINE DOES NOT EXIST ]]]]]");let m=l===-1?" ":l.toString().padStart(3," "),g=u===-1?" ":u.toString().padStart(3," ");r.push(`${h} ${m} ${g} ${f}`)}a(n,"pushLine");function o(){r.push("---")}a(o,"pushSeperator");let s=0,c=!0;for(let l of Vqt(this.replacements,(u,d)=>u.lineRange.distanceToRange(d.lineRange)<=5)){c?c=!1:o();let u=l[0].lineRange.startLineNumber-2;for(let d of l){for(let m=Math.max(1,u);mg)){let g=e[m-1];n(m,-1,"deleted",g)}for(let m=0;mnew vfe(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},vfe=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t(nu.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=iZe(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(ji.fromPositions(new es(e.range.startLineNumber,1),e.range.getStartPosition()));n[0]=s+n[0];let c=e.range.endLineNumber+1,l=r.getTransformer().getLineLength(e.range.endLineNumber)+1,u=r.getValueOfRange(ji.fromPositions(e.range.getEndPosition(),new es(e.range.endLineNumber,l)));n[n.length-1]=n[n.length-1]+u;let d=e.range.startColumn===r.getTransformer().getLineLength(e.range.startLineNumber)+1,f=e.range.endColumn===1;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o1){let s=this.lineRange.startLineNumber-1,c=e.getTransformer().getLineLength(s)+1;n=new es(s,c)}else n=new es(1,1);let o=r.addToPosition(new es(1,1));return new M_(ji.fromPositions(n,o),"")}else return new M_(new ji(this.lineRange.startLineNumber,1,this.lineRange.endLineNumberExclusive,1),"")}else if(this.lineRange.isEmpty){let r,n,o,s=this.lineRange.startLineNumber;return s===e.getTransformer().textLength.lineCount+2?(r=s-1,n=e.getTransformer().getLineLength(r)+1,o=this.newLines.map(c=>` +`),o=ide(r,n);r=r.substring(o),n=n.substring(o);let s=sRe(r,n);return r=r.substring(0,r.length-s),n=n.substring(0,n.length-s),r===""}};function Jrt(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return ji.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Yc("start must be before end");return new ji(t.lineNumber,t.column,e.lineNumber,e.column)}a(Jrt,"rangeFromPositions");var xke=class t{constructor(e){this.replacements=e;FJ(uRe(e,(r,n)=>r.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>Cfe.deserialize(r)))}static fromEdit(e,r){let n=Ike.fromStringEdit(e,r);return t.fromTextEdit(n,r)}static fromTextEdit(e,r){let n=e.replacements,o=[],s=[];for(let c=0;cn.lineRange.startLineNumber,Que)),new t(r)}isEmpty(){return this.replacements.length===0}toEdit(e){let r=[];for(let n of this.replacements){let o=n.toSingleEdit(e);r.push(o)}return new yv(r)}toString(){return this.replacements.map(e=>e.toString()).join(",")}serialize(){return this.replacements.map(e=>e.serialize())}getNewLineRanges(){let e=[],r=0;for(let n of this.replacements)e.push(nu.ofLength(n.lineRange.startLineNumber+r,n.newLines.length)),r+=n.newLines.length-n.lineRange.length;return e}mapLineNumber(e){let r=0;for(let n of this.replacements){if(n.lineRange.endLineNumberExclusive>e)break;r+=n.newLines.length-n.lineRange.length}return e+r}mapLineRange(e){return new nu(this.mapLineNumber(e.startLineNumber),this.mapLineNumber(e.endLineNumberExclusive))}mapBackLineRange(e,r){return this.inverse(r).mapLineRange(e)}touches(e){return this.replacements.some(r=>e.replacements.some(n=>r.lineRange.intersect(n.lineRange)))}rebase(e){return new t(this.replacements.map(r=>new Cfe(e.mapLineRange(r.lineRange),r.newLines)))}humanReadablePatch(e){let r=[];function n(l,u,d,f){let h=d==="unmodified"?" ":d==="deleted"?"-":"+";f===void 0&&(f="[[[[[ WARNING: LINE DOES NOT EXIST ]]]]]");let m=l===-1?" ":l.toString().padStart(3," "),g=u===-1?" ":u.toString().padStart(3," ");r.push(`${h} ${m} ${g} ${f}`)}a(n,"pushLine");function o(){r.push("---")}a(o,"pushSeperator");let s=0,c=!0;for(let l of Wqt(this.replacements,(u,d)=>u.lineRange.distanceToRange(d.lineRange)<=5)){c?c=!1:o();let u=l[0].lineRange.startLineNumber-2;for(let d of l){for(let m=Math.max(1,u);mg)){let g=e[m-1];n(m,-1,"deleted",g)}for(let m=0;mnew Cfe(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},Cfe=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t(nu.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=iZe(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(ji.fromPositions(new es(e.range.startLineNumber,1),e.range.getStartPosition()));n[0]=s+n[0];let c=e.range.endLineNumber+1,l=r.getTransformer().getLineLength(e.range.endLineNumber)+1,u=r.getValueOfRange(ji.fromPositions(e.range.getEndPosition(),new es(e.range.endLineNumber,l)));n[n.length-1]=n[n.length-1]+u;let d=e.range.startColumn===r.getTransformer().getLineLength(e.range.startLineNumber)+1,f=e.range.endColumn===1;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o1){let s=this.lineRange.startLineNumber-1,c=e.getTransformer().getLineLength(s)+1;n=new es(s,c)}else n=new es(1,1);let o=r.addToPosition(new es(1,1));return new M_(ji.fromPositions(n,o),"")}else return new M_(new ji(this.lineRange.startLineNumber,1,this.lineRange.endLineNumberExclusive,1),"")}else if(this.lineRange.isEmpty){let r,n,o,s=this.lineRange.startLineNumber;return s===e.getTransformer().textLength.lineCount+2?(r=s-1,n=e.getTransformer().getLineLength(r)+1,o=this.newLines.map(c=>` `+c).join("")):(r=s,n=1,o=this.newLines.map(c=>c+` `).join("")),new M_(ji.fromPositions(new es(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new ji(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` -`);return new M_(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new JA(n,r.text)}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}serialize(){return[this.lineRange.startLineNumber,this.lineRange.endLineNumberExclusive,this.newLines]}removeCommonSuffixPrefixLines(e){let r=this.lineRange.startLineNumber,n=this.lineRange.endLineNumberExclusive,o=0;for(;r{function t(r){return Array.isArray(r)&&r.length===3&&typeof r[0]=="number"&&typeof r[1]=="number"&&Array.isArray(r[2])&&r[2].every(n=>typeof n=="string")}e.is=t,a(t,"is")})(jds||={});var Cfe=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new Zrt(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new Zrt(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return jMn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return jMn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=xke.fromEdit(e,new XF(this.originalText)),n=Owe(r.replacements,s=>s.lineRange.length),o=Owe(r.getNewLineRanges(),s=>s.length);return{deletedLineCounts:n,insertedLineCounts:o}}getDebugState(){return{edits:this._updatedTrackedEdit.replacements.map(e=>({range:e.replaceRange.toString(),newText:e.newText,isTrackedEdit:e.data.isTrackedEdit}))}}},Zrt=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function jMn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(jMn,"sum");p();var bfe=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=yv.empty;this._debugLog=[];this._text=r.apply(this.originalText),this._textAfterTrackedEdits=this._text,this._originalEdits=r,this._debugLog.push(`[INIT] Original: "${this.originalText}"`),this._debugLog.push(`[INIT] TrackedEdits(${r.replacements.length}): ${this._formatEditsCompact(r,this.originalText)}`),this._debugLog.push(`[INIT] Result: "${this._text}"`),this._debugLog.push("")}static{a(this,"EditSurvivalTracker")}_formatEditsCompact(e,r){return e.replacements.length===0?"[]":e.replacements.map(n=>{let o=r.substring(n.replaceRange.start,n.replaceRange.endExclusive);return`[${n.replaceRange.start}:${n.replaceRange.endExclusive}]"${o}"->"${n.newText}"`}).join(", ")}handleEdits(e){let r=this._text,n=e.apply(this._text),o=this._combinedEditsSinceStart.compose(e);o=o.removeCommonSuffixPrefix(this._textAfterTrackedEdits),this._combinedEditsSinceStart=o,this._text=n,this._debugLog.push(`[EDIT] Input(${e.replacements.length}): ${this._formatEditsCompact(e,r)} -> "${n}"`),this._debugLog.push(`[EDIT] Accumulated(${this._combinedEditsSinceStart.replacements.length}): ${this._formatEditsCompact(this._combinedEditsSinceStart,this._textAfterTrackedEdits)}`)}getCurrentText(){return this._text}getTextAfterMarkedEdits(){return this._textAfterTrackedEdits}getOriginalText(){return this.originalText}getDebugLog(){return this._debugLog.join(` -`)}computeTrackedEditsSurvivalScore(){this._debugLog.push(`[CALC] Current: "${this._text}" | Original: "${this.originalText}"`);let e=0,r=0,n=0,o=0,s=this._originalEdits.getNewRanges(),c=Hds(s,this._combinedEditsSinceStart);this._debugLog.push(`[CALC] Processing ${s.length} edits:`);for(let d=0;d"${m}"->"${A}" | 4gram:${y.toFixed(2)} noRevert:(${_.toFixed(2)},${E.toFixed(2)})`),_!==1){let v=1-Math.max(E-_,0)/(1-_);n+=f.replaceRange.length*v,o+=f.replaceRange.length}e+=f.newText.length*y,r+=f.newText.length}let l=r===0?1:e/r,u=o===0?1:n/o;return this._debugLog.push(`[RESULT] fourGram: ${l.toFixed(3)} (${e.toFixed(1)}/${r.toFixed(1)}) | noRevert: ${u.toFixed(3)} (${n.toFixed(1)}/${o.toFixed(1)})`),{fourGram:l,noRevert:u}}};function gKt(t,e){if(t.length<4||e.length<4)return t===e?1:0;let n=new Map;for(let l=0;l<=t.length-4;l++){let u=t.substring(l,l+4),d=n.get(u)||0;n.set(u,d+1)}for(let l=0;l<=e.length-4;l++){let u=e.substring(l,l+4),d=n.get(u)||0;n.set(u,d-1)}let o=t.length-4+1+e.length-4+1,s=0;for(let l of n.values())s+=Math.abs(l);return(o-s)/o}a(gKt,"compute4GramTextSimilarity");function Hds(t,e){t=t.slice();let r=[],n=0;for(let o of e.replacements){for(;;){let c=t[0];if(!c||c.endExclusive>=o.replaceRange.start)break;t.shift(),r.push(c.delta(n))}let s=[];for(;;){let c=t[0];if(!c||!c.intersectsOrTouches(o.replaceRange))break;t.shift(),s.push(c)}for(let c=s.length-1;c>=0;c--){let l=s[c],u=l.intersect(o.replaceRange).length;l=l.deltaEnd(-u+(c===0?o.newText.length:0));let d=l.start-o.replaceRange.start;d>0&&(l=l.delta(-d)),c!==0&&(l=l.delta(o.newText.length)),l=l.delta(-(o.newText.length-o.replaceRange.length)),t.unshift(l)}n+=o.newText.length-o.replaceRange.length}for(;;){let o=t[0];if(!o)break;t.shift(),r.push(o.delta(n))}return r}a(Hds,"applyEditsToRanges");p();p();var wke=class{static{a(this,"OffsetLineColumnConverter")}get lines(){return this._lineStartOffsets.length}constructor(e){this._lineStartOffsets=[0];let r=0;for(;re);r++);let n=e-this._lineStartOffsets[r-1];return new es(r,n+1)}startOffsetOfLineContaining(e){let r=1;for(;re);r++);return this._lineStartOffsets[r-1]}positionToOffset(e){return e.lineNumber>=this._lineStartOffsets.length?this._lineStartOffsets[this._lineStartOffsets.length-1]+e.column-1:this._lineStartOffsets[e.lineNumber-1]+e.column-1}};async function Xrt(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new wke(t),c=new wke(e),l=[];for(let u of o.changes)for(let d of u.innerChanges??[]){let f=c.positionToOffset(d.modifiedRange.getStartPosition()),h=c.positionToOffset(d.modifiedRange.getEndPosition()),m=e.substring(f,h),g=s.positionToOffset(d.originalRange.getStartPosition()),A=s.positionToOffset(d.originalRange.getEndPosition()),y=new wc(g,A);l.push(new JA(y,m))}return new yv(l)}a(Xrt,"stringEditFromDiff");p();p();var HMn=fe(require("path")),GMn=require("worker_threads");var AKt=class{constructor(){this.nextId=1;this.handlers=new Map}static{a(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function Gds(t){let e={get:a((r,n)=>(typeof n=="string"&&!r[n]&&(r[n]=(...o)=>t(n,o)),r[n]),"get")};return new Proxy(Object.create(null),e)}a(Gds,"createRpcProxy");var ent=class{constructor(e,r,n){this.responseHandler=new AKt;this.worker=new GMn.Worker(e,r),Xxe(this.worker,HMn.basename(e,".js")),this.worker.on("message",async o=>{if("fn"in o)try{let s=await n?.[o.fn].apply(n,o.args);this.worker.postMessage({id:o.id,res:s})}catch(s){let c=s instanceof Error?s:new Error(String(s));this.worker.postMessage({id:o.id,err:c})}else this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=Gds((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}static{a(this,"WorkerWithRpcProxy")}async terminate(){this.worker.removeAllListeners(),await this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};p();var tnt=class t{static{a(this,"MovedText")}constructor(e,r){this.lineRangeMapping=e,this.changes=r}flip(){return new t(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}};p();var Rke=class t{static{a(this,"LineRangeMapping")}static inverse(e,r,n){let o=[],s=1,c=1;for(let u of e){let d=new t(new nu(s,u.original.startLineNumber),new nu(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new nu(s,r+1),new nu(c,n+1));return l.modified.isEmpty||o.push(l),o}static clip(e,r,n){let o=[];for(let s of e){let c=s.original.intersect(r),l=s.modified.intersect(n);c&&!c.isEmpty&&l&&!l.isEmpty&&o.push(new t(c,l))}return o}constructor(e,r){this.original=e,this.modified=r}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new t(this.modified,this.original)}join(e){return new t(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),r=this.modified.toInclusiveRange();if(e&&r)return new B5(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Yc("not a valid diff");return new B5(new ji(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new ji(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new B5(new ji(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new ji(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if($Mn(this.original.endLineNumberExclusive,e)&&$Mn(this.modified.endLineNumberExclusive,r))return new B5(new ji(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new ji(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new B5(ji.fromPositions(new es(this.original.startLineNumber,1),Sfe(new es(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),ji.fromPositions(new es(this.modified.startLineNumber,1),Sfe(new es(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new B5(ji.fromPositions(Sfe(new es(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Sfe(new es(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),ji.fromPositions(Sfe(new es(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),Sfe(new es(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Yc}};function Sfe(t,e){if(t.lineNumber<1)return new es(1,1);if(t.lineNumber>e.length)return new es(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new es(t.lineNumber,r.length+1):t}a(Sfe,"normalizePosition");function $Mn(t,e){return t>=1&&t<=e.length}a($Mn,"isValidLineNumber");var rnt=class t extends Rke{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=nu.join(e.map(o=>nu.fromRangeInclusive(o.originalRange))),n=nu.join(e.map(o=>nu.fromRangeInclusive(o.modifiedRange)));return new t(r,n,e)}constructor(e,r,n){super(e,r),this.innerChanges=n}flip(){return new t(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new t(this.original,this.modified,[this.toRangeMapping()])}},B5=class t{static{a(this,"RangeMapping")}static fromEdit(e){let r=e.getNewRanges();return e.replacements.map((o,s)=>new t(o.range,r[s]))}static fromEditJoin(e){let r=e.getNewRanges(),n=e.replacements.map((o,s)=>new t(o.range,r[s]));return t.join(n)}static join(e){if(e.length===0)throw new Yc("Cannot join an empty list of range mappings");let r=e[0];for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new t(this.modifiedRange,this.originalRange)}toTextEdit(e){let r=e.getValueOfRange(this.modifiedRange);return new M_(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var WMn=require("fs");var Hw=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new tj(()=>{let e=$ds([fZe(__dirname,"diffWorker.js"),fZe(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new ent(e,{name:"Diff worker"})})}dispose(){this._worker.rawValue?.terminate()}async computeDiff(e,r,n){let o=await this._worker.value.proxy.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:VMn(o.changes),moves:o.moves.map(c=>new tnt(new Rke(new nu(c[0],c[1]),new nu(c[2],c[3])),VMn(c[4])))}}};function VMn(t){return t.map(e=>new rnt(new nu(e[0],e[1]),new nu(e[2],e[3]),e[4]?.map(r=>new B5(new ji(r[0],r[1],r[2],r[3]),new ji(r[4],r[5],r[6],r[7])))))}a(VMn,"toLineRangeMappings");function $ds(t){for(let e of t)if((0,WMn.existsSync)(e))return e}a($ds,"firstExistingPath");var nnt=new pe("editSurvivalReporter"),yKt=class{constructor(e,r,n,o,s,c,l){this.ctx=e;this._document=r;this._documentTextBeforeMarkedEdits=n;this._documentTextAfterMarkedEdits=o;this._markedEdits=s;this._sendTelemetryEvent=c;this._customTimeouts=l;this._store=new Fq;this._editSurvivalTracker=new bfe(this._documentTextBeforeMarkedEdits,this._markedEdits),this.captureInitialBranchInfo().then(()=>{this.setupTimeouts()}).catch(()=>{this.setupTimeouts()})}static{a(this,"BaseEditSurvivalReporter")}setupTimeouts(){if(this._store.isDisposed)return;let e=this._customTimeouts||[30*1e3,120*1e3,300*1e3,600*1e3];for(let r=0;rthis._store.dispose():void 0,r===0)}}async report(e){let r=await this.createEditSurvivalResult(this._editSurvivalTracker,e,this._readDocumentTimeMs,this._diffComputationTimeMs,this._arcTracker);this._sendTelemetryEvent(r)}_getLineCountInfo(){if(this._arcTracker)return this._arcTracker.getTrackedEditLineMetrics()}async triggerReport(e){await this.report(e)}get editSurvivalTracker(){return this._editSurvivalTracker}getInitializationTimings(){return{readDocumentTimeMs:this._readDocumentTimeMs,diffComputationTimeMs:this._diffComputationTimeMs}}async readCurrentDocument(){let e=await this.readCurrentDocumentWithTiming(this.ctx,this._document);return this._readDocumentTimeMs=e.readDocumentTimeMs,e.text}async captureInitialBranchInfo(){try{let e=Cf(this._document.uri),r=this.ctx.get(kw);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){nnt.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=Cf(this._document.uri),n=await this.ctx.get(kw).getBranchInfo(this.ctx,e);if(!this._initialBranchInfo||!n)return 0;let o=this._initialBranchInfo.currentBranch,s=n.currentBranch,c=this._initialBranchInfo.isDetachedHead,l=n.isDetachedHead;return o!==s||c!==l?1:0}catch(e){return nnt.warn(this.ctx,"Failed to check branch change",e),0}}async createEditSurvivalResult(e,r,n,o,s){let c=e.computeTrackedEditsSurvivalScore(),l=await this.checkBranchChange(),u=this._getLineCountInfo(),d={fourGram:c.fourGram,noRevert:c.noRevert,timeDelayMs:r,didBranchChange:l,arc:s?.getAcceptedRetainedCharactersCount(),originalCharCount:s?.getOriginalCharacterCount(),currentLineCount:u?.insertedLineCounts,currentDeletedLineCount:u?.deletedLineCounts,originalLineCount:this._initialLineCounts?.insertedLineCounts,originalDeletedLineCount:this._initialLineCounts?.deletedLineCounts,currentFileContent:e.getCurrentText(),originalFileText:e.getOriginalText(),textAfterMarkedEdits:e.getTextAfterMarkedEdits(),debugLog:e.getDebugLog(),readDocumentTimeMs:n,diffComputationTimeMs:o};return{...d,currentLineCount:d.currentLineCount&&d.originalLineCount&&d.currentLineCount>d.originalLineCount?d.originalLineCount:d.currentLineCount,currentDeletedLineCount:d.currentDeletedLineCount&&d.originalDeletedLineCount&&d.currentDeletedLineCount>d.originalDeletedLineCount?d.originalDeletedLineCount:d.currentDeletedLineCount}}async readCurrentDocumentWithTiming(e,r){let n=performance.now(),o=await e.get(si).getOrReadTextDocument({uri:r.uri}),s=performance.now()-n;if(o.status!=="valid")throw new Yc(`Document ${r.uri} is not valid, details ${JSON.stringify(o)}`);return{text:o.document.getText(),readDocumentTimeMs:s}}async computeDiffWithTiming(e,r,n){let o=performance.now(),s=await Xrt(r,n,e.get(Hw)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var int=class extends yKt{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new Cfe(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new sZe(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{nnt.error(this.ctx,`DiffBasedEditSurvivalReporter: Failed to update and report at ${e}ms`,o),n.dispose(),r&&r()})},e);this._store.add(n)}cancel(){this._store.dispose()}async updateAndReport(e){try{let r=await this.readCurrentDocument();if(r!==this._documentTextAfterMarkedEdits){let n=await this.computeDiffWithTiming(this.ctx,this._documentTextAfterMarkedEdits,r);this._diffComputationTimeMs=n.diffComputationTimeMs,this._editSurvivalTracker=new bfe(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new Cfe(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new bfe(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new Cfe(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw nnt.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var zMn=new pe("editSurvivalTrackerService"),Vds=[0,30*1e3,120*1e3,300*1e3,600*1e3],kT=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n,o){zMn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let s=o?.timeouts??Vds,c;return{startReporter:a(l=>{(async()=>{try{let u=await Xrt(r,n,this.ctx.get(Hw));c=new int(this.ctx,e,r,n,u,l,s)}catch(u){zMn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${ld(u)}`,u)}})()},"startReporter"),cancel:a(()=>{c?.cancel()},"cancel")}}};var Wds=1e3,YMn=256e3,KMn=64e3;function zds(t){return{modelId:t,uiName:t,modelFamily:t,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1}}a(zds,"makeProxyInstantApplyModelConfiguration");var Yds=8e3,JMn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:kn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},Kds={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:kn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},ont=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new pe("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new N_("No uri found in code block");if(o.isCancellationRequested)throw new Grt;e.code.includes(KA)||this.logger.debug(this.ctx,`Code block for uri ${e.resource} does not contain existing code marker`);let u=await this.ctx.get(si).getOrReadTextDocument({uri:e.resource});if(u.status==="notfound")return s&&await this.reportCodeBlock(e,s),{code:e.code};if(u.status==="invalid"){let g=`Failed to find file ${e.resource} with status ${u.status} and reason ${u.reason}`,A=new N_(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(KA))return s&&await this.reportCodeBlock(e,s),{code:e.code};s&&await s({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:ro(e.resource),editDescription:e.markdownBeforeBlock});let f=await this.ctx.get(Qt).getToken(),h=await this.ctx.get(tr).updateExPValuesAndAssignments(f),m=this.ctx.get(tr).instantApplyModelMigration(h);try{return await this.mapCodeUsingFastEdit(e,u,r,n,o,h,s,c,l)}catch(g){if(this.logger.exception(this.ctx,g,`Fast Edit failed for ${e.resource}. Error: ${ld(g)}`),ft(this.ctx,"codeMapper.fastEditFailed"),Hs(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(Lj).instantApplyModels[0]?.name??"unknown":"default"}),kt(this.ctx,ze.EnableMapCodeFallback)==="enabled")return await this.codeMapperUsingSlowEdit(e,u,d,r,n,o,s,c,l);throw g}}async codeMapperUsingSlowEdit(e,r,n,o,s,c,l,u,d){let h=Ms("o200k_base").tokenLength(n),g=h<3072;return this.logger.info(this.ctx,`Document has ${h} tokens. Falling back to ${g?"Full Rewrite":"Patch mode"} for ${e.resource}`),g?await this.mapCodeUsingFullRewrite(e,r,o,s,c,l,u,d):await this.mapCodeUsingPatch(e,r,o,s,c,l,u,d)}async mapCodeUsingFastEdit(e,r,n,o,s,c,l,u=!1,d){if(r.status!=="valid")throw new N_("Invalid document result in mapCodeUsingFastEdit");let f=r.document.getText(),h=await this.buildPromptAndSelectEndpoint(e,r,s,c),m=h.messages,g=h.modelConfiguration,A=h.tokenCount;this.logger.info(this.ctx,`Selected model: ${g.modelId}, Token count: ${A} for ${e.resource}`);let y=this.ctx.get(kT),_=SZ(),E=[],v=0,S=0,T=f.length+e.code.length+Wds;for(;;){let w={copilotApiProvider:"proxy",modelConfiguration:g,messages:m,uiKind:"agentPanel",temperature:0,llmInteraction:n.cloneAsAgentInteraction(),prediction:{type:"content",content:f},copilotEditsSessionHeader:d};this.logger.debug(this.ctx,`Send map code request ${_} in iteration ${S} with params: ${JSON.stringify(w,null,2)}`);let x=await this.ctx.get(mc).fetchResponse(w,s,c);if(this.logger.debug(this.ctx,`Received map code response ${_} in iteration ${S} with result: ${JSON.stringify(x,null,2)}`),v=this.calculateResponseLength(x,E,v),x.type==="length"){if(v>T)throw new N_(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await gp.create(_fe,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:x.truncatedValue},g).renderPrompt(void 0,s)).messages}else if(x.type==="success"){let k=E.join("");if(k){l&&await l({fileGenerationStatus:"updated-code-generated",uri:e.resource,basename:ro(e.resource),partialText:k,languageId:r.document.detectedLanguageId,markdownCodeFence:GA(k)});let D=y.initialize(r.document,f,k);return{code:k,editSurvivalTrackingSession:D,telemetry:{requestSource:o.chatRequestSource,chatRequestModel:o.chatRequestModel,mapper:g.modelId,headerRequestId:x.requestId}}}else{let D=`No valid completion found for uri ${e.resource}`;throw new N_(D)}}else{if(x.type==="canceled")throw new zc;{let k=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,k,x),new N_(k)}}S+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",_fe,e,r,n,o,s,c,l,u,d=>Jds(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",$rt,e,r,n,o,s,c,l,u,(d,f)=>{this.logger.info(this.ctx,`Patch response for uri ${e.resource}: ${d.substring(0,500)}...`);let h=BMn(d);if(h.patches.length===0)throw new N_(`Patch mode failed: no valid patches found in response for uri ${e.resource}`);this.logger.info(this.ctx,`Parsed ${h.patches.length} patch(es) for uri ${e.resource}`);let m=QMn(f,h.patches);if(m===void 0)throw new N_(`Patch mode failed: could not apply patches to document for uri ${e.resource}`);return this.logger.info(this.ctx,`Patch mode succeeded for uri ${e.resource}`),m})}async mapCodeUsingCAPI(e,r,n,o,s,c,l,u,d,f,h){if(o.status!=="valid")throw new N_(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await Ro.getModelConfiguration(this.ctx,"codeMapper");this.logger.info(this.ctx,`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} fallback using model: ${g.modelId} for ${n.resource}`);let A={codeBlock:n.code,uri:n.resource,existingDocument:o,markdownBeforeBlock:n.markdownBeforeBlock,...e==="full-rewrite"?{inProgressRewriteContent:void 0}:{}},E=(await gp.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(kT),S=await this.ctx.get(Qt).getToken(),T=await this.ctx.get(tr).updateExPValuesAndAssignments(S),w=SZ(),R={copilotApiProvider:"api",modelConfiguration:g,messages:E,uiKind:"agentPanel",temperature:0,llmInteraction:s.cloneAsAgentInteraction(),copilotEditsSessionHeader:f};this.logger.debug(this.ctx,`Send ${e} request ${w} with params: ${JSON.stringify(R,null,2)}`);let k=await this.ctx.get(mc).fetchResponse(R,l,T);if(this.logger.debug(this.ctx,`Received ${e} response ${w} with result: ${JSON.stringify(k,null,2)}`),k.type==="success"){let D=k.value;if(!D)throw new N_(`No valid completion found for uri ${n.resource}`);let N=h(D,m);u&&await u({fileGenerationStatus:"updated-code-generated",uri:n.resource,basename:ro(n.resource),partialText:N,languageId:o.document.detectedLanguageId,markdownCodeFence:GA(N)});let O=v.initialize(o.document,m,N);return{code:N,editSurvivalTrackingSession:O,telemetry:{requestSource:c.chatRequestSource,chatRequestModel:c.chatRequestModel,mapper:`${g.modelId}-${e}`,headerRequestId:k.requestId}}}else{if(k.type==="canceled")throw new zc;{let D=`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} failed for uri ${n.resource} with result type ${k.type}`;throw this.logger.error(this.ctx,D,k),new N_(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>YMn)throw new N_(`Document too large: ${l} characters (limit: ${YMn})`);let u=this.ctx.get(Lj).instantApplyModels[0],d=u?zds(u.name):void 0,h=await gp.create(_fe,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??JMn).renderPrompt(void 0,n),m=h.tokenCount;if(m>KMn)throw new N_(`Prompt too large: ${m} tokens (limit: ${KMn})`);let g=h.messages.map(E=>typeof E.content=="string"?E.content:JSON.stringify(E.content)).join(` -`),A=this.ctx.get(tr).instantApplyModelMigration(o),y;return A&&d?y=d:y=g.length{let o=Mn(n.content);return n.role==="system"?`${r} +`);return new M_(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new JA(n,r.text)}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}serialize(){return[this.lineRange.startLineNumber,this.lineRange.endLineNumberExclusive,this.newLines]}removeCommonSuffixPrefixLines(e){let r=this.lineRange.startLineNumber,n=this.lineRange.endLineNumberExclusive,o=0;for(;r{function t(r){return Array.isArray(r)&&r.length===3&&typeof r[0]=="number"&&typeof r[1]=="number"&&Array.isArray(r[2])&&r[2].every(n=>typeof n=="string")}e.is=t,a(t,"is")})(Gds||={});var bfe=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new Zrt(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new Zrt(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return HMn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return HMn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=xke.fromEdit(e,new XF(this.originalText)),n=Owe(r.replacements,s=>s.lineRange.length),o=Owe(r.getNewLineRanges(),s=>s.length);return{deletedLineCounts:n,insertedLineCounts:o}}getDebugState(){return{edits:this._updatedTrackedEdit.replacements.map(e=>({range:e.replaceRange.toString(),newText:e.newText,isTrackedEdit:e.data.isTrackedEdit}))}}},Zrt=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function HMn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(HMn,"sum");p();var Sfe=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=yv.empty;this._debugLog=[];this._text=r.apply(this.originalText),this._textAfterTrackedEdits=this._text,this._originalEdits=r,this._debugLog.push(`[INIT] Original: "${this.originalText}"`),this._debugLog.push(`[INIT] TrackedEdits(${r.replacements.length}): ${this._formatEditsCompact(r,this.originalText)}`),this._debugLog.push(`[INIT] Result: "${this._text}"`),this._debugLog.push("")}static{a(this,"EditSurvivalTracker")}_formatEditsCompact(e,r){return e.replacements.length===0?"[]":e.replacements.map(n=>{let o=r.substring(n.replaceRange.start,n.replaceRange.endExclusive);return`[${n.replaceRange.start}:${n.replaceRange.endExclusive}]"${o}"->"${n.newText}"`}).join(", ")}handleEdits(e){let r=this._text,n=e.apply(this._text),o=this._combinedEditsSinceStart.compose(e);o=o.removeCommonSuffixPrefix(this._textAfterTrackedEdits),this._combinedEditsSinceStart=o,this._text=n,this._debugLog.push(`[EDIT] Input(${e.replacements.length}): ${this._formatEditsCompact(e,r)} -> "${n}"`),this._debugLog.push(`[EDIT] Accumulated(${this._combinedEditsSinceStart.replacements.length}): ${this._formatEditsCompact(this._combinedEditsSinceStart,this._textAfterTrackedEdits)}`)}getCurrentText(){return this._text}getTextAfterMarkedEdits(){return this._textAfterTrackedEdits}getOriginalText(){return this.originalText}getDebugLog(){return this._debugLog.join(` +`)}computeTrackedEditsSurvivalScore(){this._debugLog.push(`[CALC] Current: "${this._text}" | Original: "${this.originalText}"`);let e=0,r=0,n=0,o=0,s=this._originalEdits.getNewRanges(),c=$ds(s,this._combinedEditsSinceStart);this._debugLog.push(`[CALC] Processing ${s.length} edits:`);for(let d=0;d"${m}"->"${A}" | 4gram:${y.toFixed(2)} noRevert:(${_.toFixed(2)},${E.toFixed(2)})`),_!==1){let v=1-Math.max(E-_,0)/(1-_);n+=f.replaceRange.length*v,o+=f.replaceRange.length}e+=f.newText.length*y,r+=f.newText.length}let l=r===0?1:e/r,u=o===0?1:n/o;return this._debugLog.push(`[RESULT] fourGram: ${l.toFixed(3)} (${e.toFixed(1)}/${r.toFixed(1)}) | noRevert: ${u.toFixed(3)} (${n.toFixed(1)}/${o.toFixed(1)})`),{fourGram:l,noRevert:u}}};function AKt(t,e){if(t.length<4||e.length<4)return t===e?1:0;let n=new Map;for(let l=0;l<=t.length-4;l++){let u=t.substring(l,l+4),d=n.get(u)||0;n.set(u,d+1)}for(let l=0;l<=e.length-4;l++){let u=e.substring(l,l+4),d=n.get(u)||0;n.set(u,d-1)}let o=t.length-4+1+e.length-4+1,s=0;for(let l of n.values())s+=Math.abs(l);return(o-s)/o}a(AKt,"compute4GramTextSimilarity");function $ds(t,e){t=t.slice();let r=[],n=0;for(let o of e.replacements){for(;;){let c=t[0];if(!c||c.endExclusive>=o.replaceRange.start)break;t.shift(),r.push(c.delta(n))}let s=[];for(;;){let c=t[0];if(!c||!c.intersectsOrTouches(o.replaceRange))break;t.shift(),s.push(c)}for(let c=s.length-1;c>=0;c--){let l=s[c],u=l.intersect(o.replaceRange).length;l=l.deltaEnd(-u+(c===0?o.newText.length:0));let d=l.start-o.replaceRange.start;d>0&&(l=l.delta(-d)),c!==0&&(l=l.delta(o.newText.length)),l=l.delta(-(o.newText.length-o.replaceRange.length)),t.unshift(l)}n+=o.newText.length-o.replaceRange.length}for(;;){let o=t[0];if(!o)break;t.shift(),r.push(o.delta(n))}return r}a($ds,"applyEditsToRanges");p();p();var wke=class{static{a(this,"OffsetLineColumnConverter")}get lines(){return this._lineStartOffsets.length}constructor(e){this._lineStartOffsets=[0];let r=0;for(;re);r++);let n=e-this._lineStartOffsets[r-1];return new es(r,n+1)}startOffsetOfLineContaining(e){let r=1;for(;re);r++);return this._lineStartOffsets[r-1]}positionToOffset(e){return e.lineNumber>=this._lineStartOffsets.length?this._lineStartOffsets[this._lineStartOffsets.length-1]+e.column-1:this._lineStartOffsets[e.lineNumber-1]+e.column-1}};async function Xrt(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new wke(t),c=new wke(e),l=[];for(let u of o.changes)for(let d of u.innerChanges??[]){let f=c.positionToOffset(d.modifiedRange.getStartPosition()),h=c.positionToOffset(d.modifiedRange.getEndPosition()),m=e.substring(f,h),g=s.positionToOffset(d.originalRange.getStartPosition()),A=s.positionToOffset(d.originalRange.getEndPosition()),y=new wc(g,A);l.push(new JA(y,m))}return new yv(l)}a(Xrt,"stringEditFromDiff");p();p();var GMn=fe(require("path")),$Mn=require("worker_threads");var yKt=class{constructor(){this.nextId=1;this.handlers=new Map}static{a(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function Vds(t){let e={get:a((r,n)=>(typeof n=="string"&&!r[n]&&(r[n]=(...o)=>t(n,o)),r[n]),"get")};return new Proxy(Object.create(null),e)}a(Vds,"createRpcProxy");var ent=class{constructor(e,r,n){this.responseHandler=new yKt;this.worker=new $Mn.Worker(e,r),Xxe(this.worker,GMn.basename(e,".js")),this.worker.on("message",async o=>{if("fn"in o)try{let s=await n?.[o.fn].apply(n,o.args);this.worker.postMessage({id:o.id,res:s})}catch(s){let c=s instanceof Error?s:new Error(String(s));this.worker.postMessage({id:o.id,err:c})}else this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=Vds((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}static{a(this,"WorkerWithRpcProxy")}async terminate(){this.worker.removeAllListeners(),await this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};p();var tnt=class t{static{a(this,"MovedText")}constructor(e,r){this.lineRangeMapping=e,this.changes=r}flip(){return new t(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}};p();var Rke=class t{static{a(this,"LineRangeMapping")}static inverse(e,r,n){let o=[],s=1,c=1;for(let u of e){let d=new t(new nu(s,u.original.startLineNumber),new nu(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new nu(s,r+1),new nu(c,n+1));return l.modified.isEmpty||o.push(l),o}static clip(e,r,n){let o=[];for(let s of e){let c=s.original.intersect(r),l=s.modified.intersect(n);c&&!c.isEmpty&&l&&!l.isEmpty&&o.push(new t(c,l))}return o}constructor(e,r){this.original=e,this.modified=r}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new t(this.modified,this.original)}join(e){return new t(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),r=this.modified.toInclusiveRange();if(e&&r)return new B5(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Yc("not a valid diff");return new B5(new ji(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new ji(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new B5(new ji(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new ji(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(VMn(this.original.endLineNumberExclusive,e)&&VMn(this.modified.endLineNumberExclusive,r))return new B5(new ji(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new ji(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new B5(ji.fromPositions(new es(this.original.startLineNumber,1),Tfe(new es(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),ji.fromPositions(new es(this.modified.startLineNumber,1),Tfe(new es(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new B5(ji.fromPositions(Tfe(new es(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Tfe(new es(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),ji.fromPositions(Tfe(new es(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),Tfe(new es(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Yc}};function Tfe(t,e){if(t.lineNumber<1)return new es(1,1);if(t.lineNumber>e.length)return new es(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new es(t.lineNumber,r.length+1):t}a(Tfe,"normalizePosition");function VMn(t,e){return t>=1&&t<=e.length}a(VMn,"isValidLineNumber");var rnt=class t extends Rke{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=nu.join(e.map(o=>nu.fromRangeInclusive(o.originalRange))),n=nu.join(e.map(o=>nu.fromRangeInclusive(o.modifiedRange)));return new t(r,n,e)}constructor(e,r,n){super(e,r),this.innerChanges=n}flip(){return new t(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new t(this.original,this.modified,[this.toRangeMapping()])}},B5=class t{static{a(this,"RangeMapping")}static fromEdit(e){let r=e.getNewRanges();return e.replacements.map((o,s)=>new t(o.range,r[s]))}static fromEditJoin(e){let r=e.getNewRanges(),n=e.replacements.map((o,s)=>new t(o.range,r[s]));return t.join(n)}static join(e){if(e.length===0)throw new Yc("Cannot join an empty list of range mappings");let r=e[0];for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new t(this.modifiedRange,this.originalRange)}toTextEdit(e){let r=e.getValueOfRange(this.modifiedRange);return new M_(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var zMn=require("fs");var Hw=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new tj(()=>{let e=Wds([fZe(__dirname,"diffWorker.js"),fZe(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new ent(e,{name:"Diff worker"})})}dispose(){this._worker.rawValue?.terminate()}async computeDiff(e,r,n){let o=await this._worker.value.proxy.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:WMn(o.changes),moves:o.moves.map(c=>new tnt(new Rke(new nu(c[0],c[1]),new nu(c[2],c[3])),WMn(c[4])))}}};function WMn(t){return t.map(e=>new rnt(new nu(e[0],e[1]),new nu(e[2],e[3]),e[4]?.map(r=>new B5(new ji(r[0],r[1],r[2],r[3]),new ji(r[4],r[5],r[6],r[7])))))}a(WMn,"toLineRangeMappings");function Wds(t){for(let e of t)if((0,zMn.existsSync)(e))return e}a(Wds,"firstExistingPath");var nnt=new pe("editSurvivalReporter"),_Kt=class{constructor(e,r,n,o,s,c,l){this.ctx=e;this._document=r;this._documentTextBeforeMarkedEdits=n;this._documentTextAfterMarkedEdits=o;this._markedEdits=s;this._sendTelemetryEvent=c;this._customTimeouts=l;this._store=new Fq;this._editSurvivalTracker=new Sfe(this._documentTextBeforeMarkedEdits,this._markedEdits),this.captureInitialBranchInfo().then(()=>{this.setupTimeouts()}).catch(()=>{this.setupTimeouts()})}static{a(this,"BaseEditSurvivalReporter")}setupTimeouts(){if(this._store.isDisposed)return;let e=this._customTimeouts||[30*1e3,120*1e3,300*1e3,600*1e3];for(let r=0;rthis._store.dispose():void 0,r===0)}}async report(e){let r=await this.createEditSurvivalResult(this._editSurvivalTracker,e,this._readDocumentTimeMs,this._diffComputationTimeMs,this._arcTracker);this._sendTelemetryEvent(r)}_getLineCountInfo(){if(this._arcTracker)return this._arcTracker.getTrackedEditLineMetrics()}async triggerReport(e){await this.report(e)}get editSurvivalTracker(){return this._editSurvivalTracker}getInitializationTimings(){return{readDocumentTimeMs:this._readDocumentTimeMs,diffComputationTimeMs:this._diffComputationTimeMs}}async readCurrentDocument(){let e=await this.readCurrentDocumentWithTiming(this.ctx,this._document);return this._readDocumentTimeMs=e.readDocumentTimeMs,e.text}async captureInitialBranchInfo(){try{let e=Cf(this._document.uri),r=this.ctx.get(kw);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){nnt.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=Cf(this._document.uri),n=await this.ctx.get(kw).getBranchInfo(this.ctx,e);if(!this._initialBranchInfo||!n)return 0;let o=this._initialBranchInfo.currentBranch,s=n.currentBranch,c=this._initialBranchInfo.isDetachedHead,l=n.isDetachedHead;return o!==s||c!==l?1:0}catch(e){return nnt.warn(this.ctx,"Failed to check branch change",e),0}}async createEditSurvivalResult(e,r,n,o,s){let c=e.computeTrackedEditsSurvivalScore(),l=await this.checkBranchChange(),u=this._getLineCountInfo(),d={fourGram:c.fourGram,noRevert:c.noRevert,timeDelayMs:r,didBranchChange:l,arc:s?.getAcceptedRetainedCharactersCount(),originalCharCount:s?.getOriginalCharacterCount(),currentLineCount:u?.insertedLineCounts,currentDeletedLineCount:u?.deletedLineCounts,originalLineCount:this._initialLineCounts?.insertedLineCounts,originalDeletedLineCount:this._initialLineCounts?.deletedLineCounts,currentFileContent:e.getCurrentText(),originalFileText:e.getOriginalText(),textAfterMarkedEdits:e.getTextAfterMarkedEdits(),debugLog:e.getDebugLog(),readDocumentTimeMs:n,diffComputationTimeMs:o};return{...d,currentLineCount:d.currentLineCount&&d.originalLineCount&&d.currentLineCount>d.originalLineCount?d.originalLineCount:d.currentLineCount,currentDeletedLineCount:d.currentDeletedLineCount&&d.originalDeletedLineCount&&d.currentDeletedLineCount>d.originalDeletedLineCount?d.originalDeletedLineCount:d.currentDeletedLineCount}}async readCurrentDocumentWithTiming(e,r){let n=performance.now(),o=await e.get(si).getOrReadTextDocument({uri:r.uri}),s=performance.now()-n;if(o.status!=="valid")throw new Yc(`Document ${r.uri} is not valid, details ${JSON.stringify(o)}`);return{text:o.document.getText(),readDocumentTimeMs:s}}async computeDiffWithTiming(e,r,n){let o=performance.now(),s=await Xrt(r,n,e.get(Hw)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var int=class extends _Kt{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new bfe(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new sZe(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{nnt.error(this.ctx,`DiffBasedEditSurvivalReporter: Failed to update and report at ${e}ms`,o),n.dispose(),r&&r()})},e);this._store.add(n)}cancel(){this._store.dispose()}async updateAndReport(e){try{let r=await this.readCurrentDocument();if(r!==this._documentTextAfterMarkedEdits){let n=await this.computeDiffWithTiming(this.ctx,this._documentTextAfterMarkedEdits,r);this._diffComputationTimeMs=n.diffComputationTimeMs,this._editSurvivalTracker=new Sfe(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new bfe(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new Sfe(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new bfe(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw nnt.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var YMn=new pe("editSurvivalTrackerService"),zds=[0,30*1e3,120*1e3,300*1e3,600*1e3],kT=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n,o){YMn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let s=o?.timeouts??zds,c;return{startReporter:a(l=>{(async()=>{try{let u=await Xrt(r,n,this.ctx.get(Hw));c=new int(this.ctx,e,r,n,u,l,s)}catch(u){YMn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${ld(u)}`,u)}})()},"startReporter"),cancel:a(()=>{c?.cancel()},"cancel")}}};var Yds=1e3,KMn=256e3,JMn=64e3;function Kds(t){return{modelId:t,uiName:t,modelFamily:t,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1}}a(Kds,"makeProxyInstantApplyModelConfiguration");var Jds=8e3,ZMn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:kn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},Zds={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:kn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},ont=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new pe("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new N_("No uri found in code block");if(o.isCancellationRequested)throw new Grt;e.code.includes(KA)||this.logger.debug(this.ctx,`Code block for uri ${e.resource} does not contain existing code marker`);let u=await this.ctx.get(si).getOrReadTextDocument({uri:e.resource});if(u.status==="notfound")return s&&await this.reportCodeBlock(e,s),{code:e.code};if(u.status==="invalid"){let g=`Failed to find file ${e.resource} with status ${u.status} and reason ${u.reason}`,A=new N_(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(KA))return s&&await this.reportCodeBlock(e,s),{code:e.code};s&&await s({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:ro(e.resource),editDescription:e.markdownBeforeBlock});let f=await this.ctx.get(Qt).getToken(),h=await this.ctx.get(tr).updateExPValuesAndAssignments(f),m=this.ctx.get(tr).instantApplyModelMigration(h);try{return await this.mapCodeUsingFastEdit(e,u,r,n,o,h,s,c,l)}catch(g){if(this.logger.exception(this.ctx,g,`Fast Edit failed for ${e.resource}. Error: ${ld(g)}`),ft(this.ctx,"codeMapper.fastEditFailed"),Hs(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(Lj).instantApplyModels[0]?.name??"unknown":"default"}),kt(this.ctx,ze.EnableMapCodeFallback)==="enabled")return await this.codeMapperUsingSlowEdit(e,u,d,r,n,o,s,c,l);throw g}}async codeMapperUsingSlowEdit(e,r,n,o,s,c,l,u,d){let h=Ms("o200k_base").tokenLength(n),g=h<3072;return this.logger.info(this.ctx,`Document has ${h} tokens. Falling back to ${g?"Full Rewrite":"Patch mode"} for ${e.resource}`),g?await this.mapCodeUsingFullRewrite(e,r,o,s,c,l,u,d):await this.mapCodeUsingPatch(e,r,o,s,c,l,u,d)}async mapCodeUsingFastEdit(e,r,n,o,s,c,l,u=!1,d){if(r.status!=="valid")throw new N_("Invalid document result in mapCodeUsingFastEdit");let f=r.document.getText(),h=await this.buildPromptAndSelectEndpoint(e,r,s,c),m=h.messages,g=h.modelConfiguration,A=h.tokenCount;this.logger.info(this.ctx,`Selected model: ${g.modelId}, Token count: ${A} for ${e.resource}`);let y=this.ctx.get(kT),_=TZ(),E=[],v=0,S=0,T=f.length+e.code.length+Yds;for(;;){let w={copilotApiProvider:"proxy",modelConfiguration:g,messages:m,uiKind:"agentPanel",temperature:0,llmInteraction:n.cloneAsAgentInteraction(),prediction:{type:"content",content:f},copilotEditsSessionHeader:d};this.logger.debug(this.ctx,`Send map code request ${_} in iteration ${S} with params: ${JSON.stringify(w,null,2)}`);let x=await this.ctx.get(mc).fetchResponse(w,s,c);if(this.logger.debug(this.ctx,`Received map code response ${_} in iteration ${S} with result: ${JSON.stringify(x,null,2)}`),v=this.calculateResponseLength(x,E,v),x.type==="length"){if(v>T)throw new N_(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await gp.create(Efe,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:x.truncatedValue},g).renderPrompt(void 0,s)).messages}else if(x.type==="success"){let k=E.join("");if(k){l&&await l({fileGenerationStatus:"updated-code-generated",uri:e.resource,basename:ro(e.resource),partialText:k,languageId:r.document.detectedLanguageId,markdownCodeFence:GA(k)});let D=y.initialize(r.document,f,k);return{code:k,editSurvivalTrackingSession:D,telemetry:{requestSource:o.chatRequestSource,chatRequestModel:o.chatRequestModel,mapper:g.modelId,headerRequestId:x.requestId}}}else{let D=`No valid completion found for uri ${e.resource}`;throw new N_(D)}}else{if(x.type==="canceled")throw new zc;{let k=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,k,x),new N_(k)}}S+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",Efe,e,r,n,o,s,c,l,u,d=>Xds(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",$rt,e,r,n,o,s,c,l,u,(d,f)=>{this.logger.info(this.ctx,`Patch response for uri ${e.resource}: ${d.substring(0,500)}...`);let h=FMn(d);if(h.patches.length===0)throw new N_(`Patch mode failed: no valid patches found in response for uri ${e.resource}`);this.logger.info(this.ctx,`Parsed ${h.patches.length} patch(es) for uri ${e.resource}`);let m=qMn(f,h.patches);if(m===void 0)throw new N_(`Patch mode failed: could not apply patches to document for uri ${e.resource}`);return this.logger.info(this.ctx,`Patch mode succeeded for uri ${e.resource}`),m})}async mapCodeUsingCAPI(e,r,n,o,s,c,l,u,d,f,h){if(o.status!=="valid")throw new N_(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await Ro.getModelConfiguration(this.ctx,"codeMapper");this.logger.info(this.ctx,`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} fallback using model: ${g.modelId} for ${n.resource}`);let A={codeBlock:n.code,uri:n.resource,existingDocument:o,markdownBeforeBlock:n.markdownBeforeBlock,...e==="full-rewrite"?{inProgressRewriteContent:void 0}:{}},E=(await gp.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(kT),S=await this.ctx.get(Qt).getToken(),T=await this.ctx.get(tr).updateExPValuesAndAssignments(S),w=TZ(),R={copilotApiProvider:"api",modelConfiguration:g,messages:E,uiKind:"agentPanel",temperature:0,llmInteraction:s.cloneAsAgentInteraction(),copilotEditsSessionHeader:f};this.logger.debug(this.ctx,`Send ${e} request ${w} with params: ${JSON.stringify(R,null,2)}`);let k=await this.ctx.get(mc).fetchResponse(R,l,T);if(this.logger.debug(this.ctx,`Received ${e} response ${w} with result: ${JSON.stringify(k,null,2)}`),k.type==="success"){let D=k.value;if(!D)throw new N_(`No valid completion found for uri ${n.resource}`);let N=h(D,m);u&&await u({fileGenerationStatus:"updated-code-generated",uri:n.resource,basename:ro(n.resource),partialText:N,languageId:o.document.detectedLanguageId,markdownCodeFence:GA(N)});let O=v.initialize(o.document,m,N);return{code:N,editSurvivalTrackingSession:O,telemetry:{requestSource:c.chatRequestSource,chatRequestModel:c.chatRequestModel,mapper:`${g.modelId}-${e}`,headerRequestId:k.requestId}}}else{if(k.type==="canceled")throw new zc;{let D=`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} failed for uri ${n.resource} with result type ${k.type}`;throw this.logger.error(this.ctx,D,k),new N_(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>KMn)throw new N_(`Document too large: ${l} characters (limit: ${KMn})`);let u=this.ctx.get(Lj).instantApplyModels[0],d=u?Kds(u.name):void 0,h=await gp.create(Efe,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??ZMn).renderPrompt(void 0,n),m=h.tokenCount;if(m>JMn)throw new N_(`Prompt too large: ${m} tokens (limit: ${JMn})`);let g=h.messages.map(E=>typeof E.content=="string"?E.content:JSON.stringify(E.content)).join(` +`),A=this.ctx.get(tr).instantApplyModelMigration(o),y;return A&&d?y=d:y=g.length{let o=Mn(n.content);return n.role==="system"?`${r} ${o} -`:r+o},"")}]}calculateResponseLength(e,r,n){return e.type==="success"?(r.push(e.value),n+=e.value.length):e.type==="length"&&(r.push(e.truncatedValue),n+=e.truncatedValue.length),n}async reportCodeBlock(e,r){await r({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:ro(e.resource),editDescription:e.markdownBeforeBlock}),await r({fileGenerationStatus:"updated-code-generated",partialText:e.code,uri:e.resource,basename:ro(e.resource)})}};function Jds(t){let e=t.split(/\r?\n/),r=/^(`{3,})/,n=!1,o=0,s=!1,c=[];for(let l of e){let u=l.match(r);if(u&&!n)o=u[1].length,n=!0;else if(n){let d=l.match(r);if(d&&d[1].length>=o){s=!0;break}c.push(l)}}return s?c.join(` -`):t}a(Jds,"extractCodeBlock");var snt=class extends Nu{static{a(this,"EditFileTool")}constructor(){super({name:"insert_edit_into_file",displayName:"Edit File",description:`Edit a file in the workspace. Use this tool once per file that needs to be modified, even if there are multiple changes for a file. Generate the "explanation" property first. +`:r+o},"")}]}calculateResponseLength(e,r,n){return e.type==="success"?(r.push(e.value),n+=e.value.length):e.type==="length"&&(r.push(e.truncatedValue),n+=e.truncatedValue.length),n}async reportCodeBlock(e,r){await r({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:ro(e.resource),editDescription:e.markdownBeforeBlock}),await r({fileGenerationStatus:"updated-code-generated",partialText:e.code,uri:e.resource,basename:ro(e.resource)})}};function Xds(t){let e=t.split(/\r?\n/),r=/^(`{3,})/,n=!1,o=0,s=!1,c=[];for(let l of e){let u=l.match(r);if(u&&!n)o=u[1].length,n=!0;else if(n){let d=l.match(r);if(d&&d[1].length>=o){s=!0;break}c.push(l)}}return s?c.join(` +`):t}a(Xds,"extractCodeBlock");var snt=class extends Nu{static{a(this,"EditFileTool")}constructor(){super({name:"insert_edit_into_file",displayName:"Edit File",description:`Edit a file in the workspace. Use this tool once per file that needs to be modified, even if there are multiple changes for a file. Generate the "explanation" property first. The system is very smart and can understand how to apply your edits to the files, you just need to provide minimal hints. Avoid repeating existing code, instead use comments to represent regions of unchanged code. Be as concise as possible. For example: // ...existing code... @@ -3636,9 +3636,9 @@ class Person { getAge() { return this.age; } -}`}),explanation:b.String({description:"A short explanation of the edit being made."})})})}async invoke(e,r,n){try{let o=await this.mapCode(r.input,e,n),s=o.code,c=await this.invokeClientEditFileTool(e,r,s,n);return await this.getFinalEditFileResult(e,r,c,o.editSurvivalTrackingSession,o.telemetry)}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Gr([new Or(s)],"error")}}async mapCode(e,r,n){let{filePath:o}=e,s=md(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new ont(r.ctx).mapCode({code:e.code,resource:s,markdownBeforeBlock:e.explanation},r.toLlmInteraction(),{chatRequestSource:r.conversation.source,chatRequestModel:r.turn.resolvedModelConfiguration?.modelFamily??r.turn.userRequestedModel},n,void 0,!0,r.copilotEditsSessionHeader)}async invokeClientEditFileTool(e,r,n,o){let s=e.ctx.get(vs).getToolByNameAndProvider("insert_edit_into_file",dp);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(vs).invokeTool(e,s.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,code:n,explanation:r.input.explanation},roundId:r.roundId,toolCallId:r.toolCallId},o)}async getFinalEditFileResult(e,r,n,o,s){if(n.status!=="success")return n;let c=OO({uri:md(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await fl(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=I5(n.content),u=[];u.push(``),u.push("This is the new state of the file after the edit. Base future edits off of this file, no need to read it again, unless a terminal command may have changed it.");let d=new w5({code:l,languageId:c,noFilePath:!0});return u.push(...d.renderAsArray()),u.push(""),new Gr([new Or(u.join(` -`))],"success")}handleEditSurvivalTelemetry(e,r,n,o,s){pSn(e.ctx,"agentPanel",{requestSource:s?.requestSource??"",chatRequestModel:s?.chatRequestModel??"",mapper:s?.mapper??"",headerRequestId:s?.headerRequestId??"",mode:e.turn.getChatModeForTelemetry(),modelId:e.turn.getResolvedModelId()??"unknown",languageId:o},{survivalRateFourGram:r.fourGram,survivalRateNoRevert:r.noRevert,timeDelayMs:r.timeDelayMs,didBranchChange:r.didBranchChange,readDocumentTimeMs:r.readDocumentTimeMs??-1,diffComputationTimeMs:r.diffComputationTimeMs??-1,arc:r.arc??-1,originalCharCount:r.originalCharCount??-1,currentLineCount:r.currentLineCount??-1,currentDeletedLineCount:r.currentDeletedLineCount??-1,originalLineCount:r.originalLineCount??-1,originalDeletedLineCount:r.originalDeletedLineCount??-1},{currentFileContent:r.currentFileContent},n,"codeMapper.trackEditSurvival")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running insert_edit_into_file tool"};let o=md(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${YA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Xd),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran insert_edit_into_file tool"};let o=md(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${YA(o)} with insert_edit_into_file tool`}}static toEditFileParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.code!="string")throw new Error("code must be a string");if(typeof e.explanation!="string")throw new Error("explanation must be a string");return{filePath:e.filePath,code:e.code,explanation:e.explanation}}};p();p();p();var ZMn=require("crypto"),U5=fe(require("fs/promises")),XMn=require("os"),F5=fe(require("path"));var e8=class{constructor(e){this.ctx=e;this.logger=new pe("ripgrep");this.resolvePath()}static{a(this,"RipgrepPathResolver")}async resolvePath(){if(this.rgPath)return this.rgPath;let e=process.platform,r=process.arch;return this.rgPath=await this.resolvePathByOs(e,r),process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE?this.logger.info(this.ctx,`GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE already set to: ${process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE}`):(process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE=this.rgPath,this.logger.info(this.ctx,`Set GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE=${this.rgPath}`)),this.rgPath}async resolvePathByOs(e,r){this.logger.debug(this.ctx,`Start resolving ripgrep path for platform: ${e} and architecture: ${r}`);let n=process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE;if(n)return this.logger.info(this.ctx,`Using ripgrep from GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE: ${n}`),n;if(r!=="arm64"&&r!=="x64")throw new Error(`Unsupported architecture: ${r}`);let o=e==="win32"?"rg.exe":"rg";this.logger.debug(this.ctx,`__filename is ${__filename}, __dirname is ${__dirname}`);let s=F5.extname(__filename)===".ts"?F5.resolve(__dirname,"../../../packages/ripgrep/bin"):F5.resolve(__dirname,"./bin"),c=F5.resolve(s,e,r,o);if("pkg"in process){this.logger.debug(this.ctx,"Running inside pkg binary, start to copy ripgrep to a temporary location");let l=await U5.readFile(c),u=(0,ZMn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||F5.join((0,XMn.homedir)(),".cache"),f=F5.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await U5.mkdir(f,{recursive:!0});let h=ro(Ko(c)),m=F5.join(f,h);try{await U5.stat(m)}catch{await U5.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await U5.chmod(c,493).catch(g=>{this.logger.error(this.ctx,`Failed to set executable permission for ${c}: ${g}`)})}return this.logger.info(this.ctx,`Resolved ripgrep path: ${c}`),c}};p();var eOn=require("child_process"),_Kt=require("perf_hooks");var t8=new pe("ripgrepProcessManager"),r8=class{constructor(e,r,n){this.ctx=e;this.defaultTimeoutInMs=30*1e3;this.maxProcesses=4;this.maxPendingTasks=20;this.taskQueue=[];this.activeProcesses=new Set;this.maxProcesses=r??this.maxProcesses,this.maxPendingTasks=n??this.maxPendingTasks,t8.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){t8.debug(this.ctx,`Disposing ripgrep process manager with ${this.activeProcesses.size} active processes`),this.activeProcesses.forEach(e=>{if(!e.killed)try{e.kill()}catch(r){t8.error(this.ctx,"Failed to kill process. ",r)}}),this.activeProcesses.clear()}execute(e,r,n,o,s){return new Promise((c,l)=>{if(this.taskQueue.length>=this.maxPendingTasks){t8.error(this.ctx,`Task queue limit reached: ${this.maxPendingTasks}`),l(new Error(`Task queue limit of ${this.maxPendingTasks} reached`));return}if(s!==void 0&&s<=0){t8.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}t8.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:SZ(),command:e,args:r,options:o,resolve:c,reject:l,timeoutInMs:s??this.defaultTimeoutInMs,token:n});let u=this.taskQueue.map(d=>this.getTaskSimpleInfo(d)).join(` -`);t8.debug(this.ctx,`Current task queue length: ${this.taskQueue.length}, task list: ${u}`),this.runNextTask()})}runNextTask(){if(this.taskQueue.length===0||this.activeProcesses.size>=this.maxProcesses)return;let e=this.taskQueue.shift(),r=_Kt.performance.now();t8.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,eOn.spawn)(e.command,e.args,e.options);this.activeProcesses.add(n);let o="",s="",c,l=a(()=>{c&&clearTimeout(c),this.activeProcesses.delete(n),n.stdout?.removeAllListeners(),n.stderr?.removeAllListeners(),n.removeAllListeners()},"cleanup");e.timeoutInMs&&(c=setTimeout(()=>{n.killed||(n.kill(),e.reject(new Error(`Process timed out after ${e.timeoutInMs} ms. Partial output: ${o}`))),l(),this.runNextTask()},e.timeoutInMs)),e.token&&e.token.onCancellationRequested(()=>{n.killed||(n.kill(),e.reject(new Error("Process was cancelled. Partial output: "+o))),l(),this.runNextTask()}),n.stdout?.on("data",u=>{o+=u.toString()}),n.stderr?.on("data",u=>{s+=u.toString()}),n.on("close",u=>{let f=_Kt.performance.now()-r;t8.debug(this.ctx,`Task ${e.id} completed in ${f} ms`),l(),u===0?e.resolve(o):u===1?e.resolve(""):e.reject(new Error(`Process exited with code ${u}: ${s}`)),this.runNextTask()}),n.on("error",u=>{l(),e.reject(new Error(`Failed to start process: ${u.message}`)),this.runNextTask()})}catch(n){e.reject(new Error(`Error spawning process: ${n.message}`)),this.runNextTask()}}getTaskSimpleInfo(e){return`${e.id} - ${e.command} ${e.args.join(" ")}`}};function ant(t){return t.some(e=>!ga.isRegisteredScheme(oo(e.uri).scheme))}a(ant,"hasRipgrepWorkspaceFolder");async function cnt(t,e){try{return{rgPath:await t.ctx.get(e8).resolvePath(),ripgrepManager:t.ctx.get(r8)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(cnt,"resolveRipgrepResources");var tOn=new pe("findFilesTool"),lnt=class t extends Nu{static{a(this,"FindFilesTool")}static{this.timeOutInSeconds=15}constructor(){super({name:"file_search",displayName:"Find Files",description:`Search for files in the workspace by glob pattern. Returns matching file paths sorted by modification time. +}`}),explanation:b.String({description:"A short explanation of the edit being made."})})})}async invoke(e,r,n){try{let o=await this.mapCode(r.input,e,n),s=o.code,c=await this.invokeClientEditFileTool(e,r,s,n);return await this.getFinalEditFileResult(e,r,c,o.editSurvivalTrackingSession,o.telemetry)}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Gr([new Lr(s)],"error")}}async mapCode(e,r,n){let{filePath:o}=e,s=md(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new ont(r.ctx).mapCode({code:e.code,resource:s,markdownBeforeBlock:e.explanation},r.toLlmInteraction(),{chatRequestSource:r.conversation.source,chatRequestModel:r.turn.resolvedModelConfiguration?.modelFamily??r.turn.userRequestedModel},n,void 0,!0,r.copilotEditsSessionHeader)}async invokeClientEditFileTool(e,r,n,o){let s=e.ctx.get(vs).getToolByNameAndProvider("insert_edit_into_file",dp);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(vs).invokeTool(e,s.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,code:n,explanation:r.input.explanation},roundId:r.roundId,toolCallId:r.toolCallId},o)}async getFinalEditFileResult(e,r,n,o,s){if(n.status!=="success")return n;let c=OO({uri:md(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await fl(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=I5(n.content),u=[];u.push(``),u.push("This is the new state of the file after the edit. Base future edits off of this file, no need to read it again, unless a terminal command may have changed it.");let d=new w5({code:l,languageId:c,noFilePath:!0});return u.push(...d.renderAsArray()),u.push(""),new Gr([new Lr(u.join(` +`))],"success")}handleEditSurvivalTelemetry(e,r,n,o,s){hSn(e.ctx,"agentPanel",{requestSource:s?.requestSource??"",chatRequestModel:s?.chatRequestModel??"",mapper:s?.mapper??"",headerRequestId:s?.headerRequestId??"",mode:e.turn.getChatModeForTelemetry(),modelId:e.turn.getResolvedModelId()??"unknown",languageId:o},{survivalRateFourGram:r.fourGram,survivalRateNoRevert:r.noRevert,timeDelayMs:r.timeDelayMs,didBranchChange:r.didBranchChange,readDocumentTimeMs:r.readDocumentTimeMs??-1,diffComputationTimeMs:r.diffComputationTimeMs??-1,arc:r.arc??-1,originalCharCount:r.originalCharCount??-1,currentLineCount:r.currentLineCount??-1,currentDeletedLineCount:r.currentDeletedLineCount??-1,originalLineCount:r.originalLineCount??-1,originalDeletedLineCount:r.originalDeletedLineCount??-1},{currentFileContent:r.currentFileContent},n,"codeMapper.trackEditSurvival")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running insert_edit_into_file tool"};let o=md(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${YA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(ef),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran insert_edit_into_file tool"};let o=md(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${YA(o)} with insert_edit_into_file tool`}}static toEditFileParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.code!="string")throw new Error("code must be a string");if(typeof e.explanation!="string")throw new Error("explanation must be a string");return{filePath:e.filePath,code:e.code,explanation:e.explanation}}};p();p();p();var XMn=require("crypto"),U5=fe(require("fs/promises")),eOn=require("os"),F5=fe(require("path"));var e8=class{constructor(e){this.ctx=e;this.logger=new pe("ripgrep");this.resolvePath()}static{a(this,"RipgrepPathResolver")}async resolvePath(){if(this.rgPath)return this.rgPath;let e=process.platform,r=process.arch;return this.rgPath=await this.resolvePathByOs(e,r),process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE?this.logger.info(this.ctx,`GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE already set to: ${process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE}`):(process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE=this.rgPath,this.logger.info(this.ctx,`Set GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE=${this.rgPath}`)),this.rgPath}async resolvePathByOs(e,r){this.logger.debug(this.ctx,`Start resolving ripgrep path for platform: ${e} and architecture: ${r}`);let n=process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE;if(n)return this.logger.info(this.ctx,`Using ripgrep from GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE: ${n}`),n;if(r!=="arm64"&&r!=="x64")throw new Error(`Unsupported architecture: ${r}`);let o=e==="win32"?"rg.exe":"rg";this.logger.debug(this.ctx,`__filename is ${__filename}, __dirname is ${__dirname}`);let s=F5.extname(__filename)===".ts"?F5.resolve(__dirname,"../../../packages/ripgrep/bin"):F5.resolve(__dirname,"./bin"),c=F5.resolve(s,e,r,o);if("pkg"in process){this.logger.debug(this.ctx,"Running inside pkg binary, start to copy ripgrep to a temporary location");let l=await U5.readFile(c),u=(0,XMn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||F5.join((0,eOn.homedir)(),".cache"),f=F5.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await U5.mkdir(f,{recursive:!0});let h=ro(Ko(c)),m=F5.join(f,h);try{await U5.stat(m)}catch{await U5.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await U5.chmod(c,493).catch(g=>{this.logger.error(this.ctx,`Failed to set executable permission for ${c}: ${g}`)})}return this.logger.info(this.ctx,`Resolved ripgrep path: ${c}`),c}};p();var tOn=require("child_process"),EKt=require("perf_hooks");var t8=new pe("ripgrepProcessManager"),r8=class{constructor(e,r,n){this.ctx=e;this.defaultTimeoutInMs=30*1e3;this.maxProcesses=4;this.maxPendingTasks=20;this.taskQueue=[];this.activeProcesses=new Set;this.maxProcesses=r??this.maxProcesses,this.maxPendingTasks=n??this.maxPendingTasks,t8.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){t8.debug(this.ctx,`Disposing ripgrep process manager with ${this.activeProcesses.size} active processes`),this.activeProcesses.forEach(e=>{if(!e.killed)try{e.kill()}catch(r){t8.error(this.ctx,"Failed to kill process. ",r)}}),this.activeProcesses.clear()}execute(e,r,n,o,s){return new Promise((c,l)=>{if(this.taskQueue.length>=this.maxPendingTasks){t8.error(this.ctx,`Task queue limit reached: ${this.maxPendingTasks}`),l(new Error(`Task queue limit of ${this.maxPendingTasks} reached`));return}if(s!==void 0&&s<=0){t8.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}t8.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:TZ(),command:e,args:r,options:o,resolve:c,reject:l,timeoutInMs:s??this.defaultTimeoutInMs,token:n});let u=this.taskQueue.map(d=>this.getTaskSimpleInfo(d)).join(` +`);t8.debug(this.ctx,`Current task queue length: ${this.taskQueue.length}, task list: ${u}`),this.runNextTask()})}runNextTask(){if(this.taskQueue.length===0||this.activeProcesses.size>=this.maxProcesses)return;let e=this.taskQueue.shift(),r=EKt.performance.now();t8.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,tOn.spawn)(e.command,e.args,e.options);this.activeProcesses.add(n);let o="",s="",c,l=a(()=>{c&&clearTimeout(c),this.activeProcesses.delete(n),n.stdout?.removeAllListeners(),n.stderr?.removeAllListeners(),n.removeAllListeners()},"cleanup");e.timeoutInMs&&(c=setTimeout(()=>{n.killed||(n.kill(),e.reject(new Error(`Process timed out after ${e.timeoutInMs} ms. Partial output: ${o}`))),l(),this.runNextTask()},e.timeoutInMs)),e.token&&e.token.onCancellationRequested(()=>{n.killed||(n.kill(),e.reject(new Error("Process was cancelled. Partial output: "+o))),l(),this.runNextTask()}),n.stdout?.on("data",u=>{o+=u.toString()}),n.stderr?.on("data",u=>{s+=u.toString()}),n.on("close",u=>{let f=EKt.performance.now()-r;t8.debug(this.ctx,`Task ${e.id} completed in ${f} ms`),l(),u===0?e.resolve(o):u===1?e.resolve(""):e.reject(new Error(`Process exited with code ${u}: ${s}`)),this.runNextTask()}),n.on("error",u=>{l(),e.reject(new Error(`Failed to start process: ${u.message}`)),this.runNextTask()})}catch(n){e.reject(new Error(`Error spawning process: ${n.message}`)),this.runNextTask()}}getTaskSimpleInfo(e){return`${e.id} - ${e.command} ${e.args.join(" ")}`}};function ant(t){return t.some(e=>!ga.isRegisteredScheme(oo(e.uri).scheme))}a(ant,"hasRipgrepWorkspaceFolder");async function cnt(t,e){try{return{rgPath:await t.ctx.get(e8).resolvePath(),ripgrepManager:t.ctx.get(r8)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(cnt,"resolveRipgrepResources");var rOn=new pe("findFilesTool"),lnt=class t extends Nu{static{a(this,"FindFilesTool")}static{this.timeOutInSeconds=15}constructor(){super({name:"file_search",displayName:"Find Files",description:`Search for files in the workspace by glob pattern. Returns matching file paths sorted by modification time. When to Use: - Find files by name or extension pattern @@ -3654,12 +3654,12 @@ Usage: Glob pattern examples: - **/*.{js,ts} to match all js/ts files in the workspace - src/** to match all files under the top-level src folder -- **/foo/**/*.js to match all js files under any foo folder`,displayDescription:"Search for files in the workspace by glob pattern.",inputSchema:b.Object({query:b.String({description:"Search for files with names or paths matching this glob pattern."}),maxResults:b.Optional(b.Number({description:"The maximum number of results to return. Do not use this unless necessary, it can slow things down. By default, only some matches are returned. If you use this and don't see what you're looking for, you can try again with a more specific query or a larger maxResults."}))})})}async invoke(e,r,n){try{let{query:o,maxResults:s=20}=r.input,c=e.turn.workspaceFolders;if(!c?.length)return new Gr([new Or("Failed to invoke tool file_search since no workspace folders found")],"error");let l,u;if(ant(c)){if(n.isCancellationRequested)return new Gr([new Or("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await cnt(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{tOn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),ga.isRegisteredScheme(oo(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),tOn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` -`)}`)}catch(_){if(_ instanceof Ic){d[y]=[];return}let E=_ instanceof Error?_.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${y}: ${E}`)}});try{await Promise.all(f)}catch(A){let y=A instanceof Error?A.message:"An unknown error occurred";return new Gr([new Or(y)],"error")}let h=[],m=s;for(;m>0;){let A=!1;for(let y in d)d[y].length>0&&m>0&&(h.push(d[y].shift()),m--,A=!0);if(!A)break}let g=h.length===0?`No files found matching query: ${o}`:h.length===1?`Found 1 file matching query: ${o} +- **/foo/**/*.js to match all js files under any foo folder`,displayDescription:"Search for files in the workspace by glob pattern.",inputSchema:b.Object({query:b.String({description:"Search for files with names or paths matching this glob pattern."}),maxResults:b.Optional(b.Number({description:"The maximum number of results to return. Do not use this unless necessary, it can slow things down. By default, only some matches are returned. If you use this and don't see what you're looking for, you can try again with a more specific query or a larger maxResults."}))})})}async invoke(e,r,n){try{let{query:o,maxResults:s=20}=r.input,c=e.turn.workspaceFolders;if(!c?.length)return new Gr([new Lr("Failed to invoke tool file_search since no workspace folders found")],"error");let l,u;if(ant(c)){if(n.isCancellationRequested)return new Gr([new Lr("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await cnt(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{rOn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),ga.isRegisteredScheme(oo(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),rOn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` +`)}`)}catch(_){if(_ instanceof Ic){d[y]=[];return}let E=_ instanceof Error?_.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${y}: ${E}`)}});try{await Promise.all(f)}catch(A){let y=A instanceof Error?A.message:"An unknown error occurred";return new Gr([new Lr(y)],"error")}let h=[],m=s;for(;m>0;){let A=!1;for(let y in d)d[y].length>0&&m>0&&(h.push(d[y].shift()),m--,A=!0);if(!A)break}let g=h.length===0?`No files found matching query: ${o}`:h.length===1?`Found 1 file matching query: ${o} ${h[0]}`:`Found ${h.length} files matching query: ${o} ${h.join(` -`)}`;return new Gr([new Or(g)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Gr([new Or(s)],"error")}}async searchViaContentProvider(e,r,n,o){return(await e.ctx.get(ga).findFiles({baseUri:r.uri.toString(),pattern:n,maxResults:o})).uris.slice()}async searchViaRipgrep(e,r,n,o,s){return(await e.execute(r,["--files","-g",o],s,{cwd:un(n.uri)},t.timeOutInSeconds*1e3)).split(` -`).map(l=>l.trim()).filter(l=>l.length>0).map(l=>`${un(Oa(n.uri,l))}`)}prepareInvocation(e,r){let{input:n}=e;return n.query.length?{progressMessage:`Searching for files matching query: ${n.query}`}:{progressMessage:"Running file_search tool"}}prepareCompletion(e,r){let{input:n}=e;return n.query.length?{completionMessage:`Searched for files matching query: ${n.query}`}:{completionMessage:"Ran file_search tool"}}static toFindFilesParams(e){if(typeof e.query!="string")throw new Error("query must be a string");if(e.maxResults!=null&&(typeof e.maxResults!="number"||e.maxResults<0))throw new Error("maxResults must be a positive number or undefined");return{query:e.query,maxResults:typeof e.maxResults=="number"?e.maxResults:void 0}}};p();var rOn=new pe("findTextInFilesTool"),unt=class t extends Nu{static{a(this,"FindTextInFilesTool")}static{this.timeOutInSeconds=15}constructor(){super({name:"grep_search",displayName:"Find Text In Files",description:`A text search tool for finding exact text or regex patterns in files. +`)}`;return new Gr([new Lr(g)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Gr([new Lr(s)],"error")}}async searchViaContentProvider(e,r,n,o){return(await e.ctx.get(ga).findFiles({baseUri:r.uri.toString(),pattern:n,maxResults:o})).uris.slice()}async searchViaRipgrep(e,r,n,o,s){return(await e.execute(r,["--files","-g",o],s,{cwd:un(n.uri)},t.timeOutInSeconds*1e3)).split(` +`).map(l=>l.trim()).filter(l=>l.length>0).map(l=>`${un(Oa(n.uri,l))}`)}prepareInvocation(e,r){let{input:n}=e;return n.query.length?{progressMessage:`Searching for files matching query: ${n.query}`}:{progressMessage:"Running file_search tool"}}prepareCompletion(e,r){let{input:n}=e;return n.query.length?{completionMessage:`Searched for files matching query: ${n.query}`}:{completionMessage:"Ran file_search tool"}}static toFindFilesParams(e){if(typeof e.query!="string")throw new Error("query must be a string");if(e.maxResults!=null&&(typeof e.maxResults!="number"||e.maxResults<0))throw new Error("maxResults must be a positive number or undefined");return{query:e.query,maxResults:typeof e.maxResults=="number"?e.maxResults:void 0}}};p();var nOn=new pe("findTextInFilesTool"),unt=class t extends Nu{static{a(this,"FindTextInFilesTool")}static{this.timeOutInSeconds=15}constructor(){super({name:"grep_search",displayName:"Find Text In Files",description:`A text search tool for finding exact text or regex patterns in files. When to Use: - Exact text or symbol searches (function names, variable names, imports) @@ -3672,12 +3672,12 @@ When NOT to Use: Usage: - Supports regex syntax when isRegexp is true (e.g., "log.*Error", "function\\s+\\w+") -- Use includePattern to filter by file type (e.g., "*.js", "*.{ts,tsx}")`,displayDescription:"Do a text search in the workspace.",inputSchema:b.Object({query:b.String({description:"The pattern to search for in files in the workspace. Can be a regex or plain text pattern"}),isRegexp:b.Optional(b.Boolean({description:"Whether the pattern is a regex. False by default."})),includePattern:b.Optional(b.String({description:"Search files matching this glob pattern. Will be applied to the relative path of files within the workspace."}))})})}async invoke(e,r,n){try{let{query:o,isRegexp:s=!1,includePattern:c}=r.input,l=20,u=e.turn.workspaceFolders;if(!u?.length)return new Gr([new Or("Failed to invoke tool grep_search since no workspace folders found")],"error");let d,f;if(ant(u)){if(n.isCancellationRequested)return new Gr([new Or("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await cnt(e,"grep_search"))}let h={},m=u.map(async _=>{if(n.isCancellationRequested)throw new Error("Canceled");let E=_.uri.toString();try{rOn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${E}`),ga.isRegisteredScheme(oo(_.uri).scheme)?h[E]=await this.searchViaContentProvider(e,_,o,s,c,l):h[E]=await this.searchViaRipgrep(f,d,_,o,s,c,n),rOn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${E} with results: ${h[E].join(` -`)}`)}catch(v){if(v instanceof Ic){h[E]=[];return}let S=v instanceof Error?v.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${E}: ${S}`)}});try{await Promise.all(m)}catch(_){let E=_ instanceof Error?_.message:"An unknown error occurred";return new Gr([new Or(E)],"error")}let g=[],A=l;for(;A>0;){let _=!1;for(let E in h)h[E].length>0&&A>0&&(g.push(h[E].shift()),A--,_=!0);if(!_)break}let y=g.length===0?`Searched text for ${o}, no results`:g.length===1?`Searched text for: ${o}, 1 result +- Use includePattern to filter by file type (e.g., "*.js", "*.{ts,tsx}")`,displayDescription:"Do a text search in the workspace.",inputSchema:b.Object({query:b.String({description:"The pattern to search for in files in the workspace. Can be a regex or plain text pattern"}),isRegexp:b.Optional(b.Boolean({description:"Whether the pattern is a regex. False by default."})),includePattern:b.Optional(b.String({description:"Search files matching this glob pattern. Will be applied to the relative path of files within the workspace."}))})})}async invoke(e,r,n){try{let{query:o,isRegexp:s=!1,includePattern:c}=r.input,l=20,u=e.turn.workspaceFolders;if(!u?.length)return new Gr([new Lr("Failed to invoke tool grep_search since no workspace folders found")],"error");let d,f;if(ant(u)){if(n.isCancellationRequested)return new Gr([new Lr("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await cnt(e,"grep_search"))}let h={},m=u.map(async _=>{if(n.isCancellationRequested)throw new Error("Canceled");let E=_.uri.toString();try{nOn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${E}`),ga.isRegisteredScheme(oo(_.uri).scheme)?h[E]=await this.searchViaContentProvider(e,_,o,s,c,l):h[E]=await this.searchViaRipgrep(f,d,_,o,s,c,n),nOn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${E} with results: ${h[E].join(` +`)}`)}catch(v){if(v instanceof Ic){h[E]=[];return}let S=v instanceof Error?v.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${E}: ${S}`)}});try{await Promise.all(m)}catch(_){let E=_ instanceof Error?_.message:"An unknown error occurred";return new Gr([new Lr(E)],"error")}let g=[],A=l;for(;A>0;){let _=!1;for(let E in h)h[E].length>0&&A>0&&(g.push(h[E].shift()),A--,_=!0);if(!_)break}let y=g.length===0?`Searched text for ${o}, no results`:g.length===1?`Searched text for: ${o}, 1 result ${g[0]}`:`Searched text for: ${o}, ${g.length} results ${g.join(` -`)}`;return new Gr([new Or(y)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Gr([new Or(s)],"error")}}async searchViaContentProvider(e,r,n,o,s,c){return(await e.ctx.get(ga).findTextInFiles({baseUri:r.uri.toString(),query:n,isRegexp:o,includePattern:s,maxResults:c})).matches.map(d=>`${d.uri}:${d.lineNumber}:${d.lineText}`)}async searchViaRipgrep(e,r,n,o,s,c,l){let u=[s?"--regexp":"--fixed-strings",o,...c?["-g",c]:[],"--no-heading","--line-number","--color","never",un(n.uri)];return(await e.execute(r,u,l,{cwd:un(n.uri)},t.timeOutInSeconds*1e3)).split(` -`).map(f=>f.trim()).filter(f=>f.length>0)}prepareInvocation(e,r){let{input:n}=e;return n.query.length?{progressMessage:`Searching for text in files matching query: ${n.query}`}:{progressMessage:"Running grep_search tool"}}prepareCompletion(e,r){let{input:n}=e;return n.query.length?{completionMessage:`Searched for text in files matching query: ${n.query}`}:{completionMessage:"Ran grep_search tool"}}static toFindTextInFilesParams(e){if(typeof e.query!="string")throw new Error("query must be a string");if(e.isRegexp!==void 0&&typeof e.isRegexp!="boolean")throw new Error("isRegexp must be a boolean");if(e.includePattern!==void 0&&typeof e.includePattern!="string")throw new Error("includePattern must be a string");return{query:e.query,isRegexp:e.isRegexp??!1,includePattern:e.includePattern}}};p();var dnt=class extends Nu{static{a(this,"ListDirTool")}constructor(){super({name:"list_dir",displayName:"List Directory",description:"List the contents of a directory. Result will have the name of the child. If the name ends in /, it's a folder, otherwise a file",displayDescription:"List the contents of a directory",inputSchema:b.Object({path:b.String({description:"The absolute path to the directory to list."})})})}async invoke(e,r,n){let{path:o}=r.input,s=md(o,e.uriSchemeCache),c=await Dtt(e.ctx,s.toString());return c.length===0?new Gr([new Or("Folder is empty")],"success"):new Gr([new Or(c.map(([l,u])=>`${l}${u&2?"/":""}`).join(` +`)}`;return new Gr([new Lr(y)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Gr([new Lr(s)],"error")}}async searchViaContentProvider(e,r,n,o,s,c){return(await e.ctx.get(ga).findTextInFiles({baseUri:r.uri.toString(),query:n,isRegexp:o,includePattern:s,maxResults:c})).matches.map(d=>`${d.uri}:${d.lineNumber}:${d.lineText}`)}async searchViaRipgrep(e,r,n,o,s,c,l){let u=[s?"--regexp":"--fixed-strings",o,...c?["-g",c]:[],"--no-heading","--line-number","--color","never",un(n.uri)];return(await e.execute(r,u,l,{cwd:un(n.uri)},t.timeOutInSeconds*1e3)).split(` +`).map(f=>f.trim()).filter(f=>f.length>0)}prepareInvocation(e,r){let{input:n}=e;return n.query.length?{progressMessage:`Searching for text in files matching query: ${n.query}`}:{progressMessage:"Running grep_search tool"}}prepareCompletion(e,r){let{input:n}=e;return n.query.length?{completionMessage:`Searched for text in files matching query: ${n.query}`}:{completionMessage:"Ran grep_search tool"}}static toFindTextInFilesParams(e){if(typeof e.query!="string")throw new Error("query must be a string");if(e.isRegexp!==void 0&&typeof e.isRegexp!="boolean")throw new Error("isRegexp must be a boolean");if(e.includePattern!==void 0&&typeof e.includePattern!="string")throw new Error("includePattern must be a string");return{query:e.query,isRegexp:e.isRegexp??!1,includePattern:e.includePattern}}};p();var dnt=class extends Nu{static{a(this,"ListDirTool")}constructor(){super({name:"list_dir",displayName:"List Directory",description:"List the contents of a directory. Result will have the name of the child. If the name ends in /, it's a folder, otherwise a file",displayDescription:"List the contents of a directory",inputSchema:b.Object({path:b.String({description:"The absolute path to the directory to list."})})})}async invoke(e,r,n){let{path:o}=r.input,s=md(o,e.uriSchemeCache),c=await Dtt(e.ctx,s.toString());return c.length===0?new Gr([new Lr("Folder is empty")],"success"):new Gr([new Lr(c.map(([l,u])=>`${l}${u&2?"/":""}`).join(` `))],"success")}prepareInvocation(e,r){let n=md(e.input.path,e.uriSchemeCache);return{progressMessage:`Reading directory ${YA(n)}`}}prepareCompletion(e,r){let n=md(e.input.path,e.uriSchemeCache);return{completionMessage:`Read directory ${YA(n)}`}}static toListDirParams(e){if(typeof e.path!="string")throw new Error("path must be a string");return{path:e.path}}};p();var fnt=2e3,pnt=class t extends Nu{static{a(this,"ReadFileTool")}constructor(){super({name:"read_file",displayName:"Read File",description:`Read the contents of a file from the local filesystem. When to Use: @@ -3689,33 +3689,33 @@ Usage: - Prefer reading larger meaningful chunks over doing many small reads - You can call this tool again if initial contents are insufficient - It is always better to speculatively read multiple files as a batch that are potentially useful -- You don't need to read a file if it's already provided in context`,displayDescription:"Read a file in the workspace.",inputSchema:b.Object({filePath:b.String({description:"The absolute path of the file to read."}),offset:b.Optional(b.Number({description:"Optional: the 1-based line number to start reading from. Only use this if the file is too large to read at once. If not specified, the file will be read from the beginning."})),limit:b.Optional(b.Number({description:"Optional: the maximum number of lines to read. Only use this together with `offset` if the file is too large to read at once."}))})})}async invoke(e,r,n){try{let{filePath:o,offset:s,limit:c}=t.toReadFileParams(r.input),l=Math.min(Math.max(1,c??fnt),fnt),u=Math.max(1,s??1),d=u+l-1,f=md(o,e.uriSchemeCache);if(!f)throw new Error(`Invalid file path: ${o}`);let m=await e.ctx.get(si).getOrReadTextDocument({uri:f});if(m.status==="valid"){let g=m.document.getText();if(g.length===0)return new Gr([new Or(`The file \`${o}\` exists, but is empty.`)],"success");if(g.trim().length===0)return new Gr([new Or(`The file \`${o}\` exists, but contains only whitespace.`)],"success");let A=m.document.lineCount,y=Math.min(d,A),_=l!==c&&y= 1), received: ${n}`)}if(o!==void 0){if(typeof o!="number")throw new Error(`limit must be a number, received: ${typeof o}`);if(o<1)throw new Error(`limit must be positive (>= 1), received: ${o}`)}return{filePath:r,offset:n,limit:o}}};p();p();var kke=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},hnt=class extends kke{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},mnt=class extends kke{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},gnt=class extends kke{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function Zds(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Zds,"escapeRegex");function Xds(t,e){if(t===e)return 1;if(t.length===0||e.length===0)return 0;let r=[];for(let s=0;s<=t.length;s++)r[s]=[s];for(let s=0;s<=e.length;s++)r[0][s]=s;for(let s=1;s<=t.length;s++)for(let c=1;c<=e.length;c++){let l=t[s-1]===e[c-1]?0:1;r[s][c]=Math.min(r[s-1][c]+1,r[s][c-1]+1,r[s-1][c-1]+l)}let n=r[t.length][e.length],o=Math.max(t.length,e.length);return 1-n/o}a(Xds,"calculateSimilarity");function EKt(t,e,r,n){let o=r.replace(/\r\n/g,` -`).replace(/\n/g,n),s=efs(t,e,o);if(s.type!=="none")return s;let c=tfs(t,e,o,n);if(c.type!=="none")return c;let l=rfs(t,e,o,n);if(l.type!=="none")return l;let u=nfs(t,e,o,n,.8);return u.type!=="none"?u:{text:t,type:"none",editPosition:[],suggestion:"Try making your search string more specific or checking for whitespace/formatting differences."}}a(EKt,"findAndReplaceOne");function efs(t,e,r){if(e.length===0)return{text:t,editPosition:[],type:"none"};let n=[];for(let c=0;;){let l=t.indexOf(e,c);if(l===-1)break;n.push(l),c=l+e.length}if(n.length===0)return{text:t,editPosition:[],type:"none"};if(n.length>1)return{text:t,type:"multiple",editPosition:n.map(c=>[c,c+e.length]),strategy:"exact",matchPositions:n,suggestion:"Multiple exact matches found. Make your search string more specific."};let o=n[0];return{text:t.slice(0,o)+r+t.slice(o+e.length),type:"exact",editPosition:[[o,o+e.length]]}}a(efs,"tryExactMatch");function tfs(t,e,r,n){let o=t.split(n),s=e.split(n),c=o.map(m=>m.trim()),l=s.map(m=>m.trim()),u=[];for(let m=0;m<=c.length-l.length;m++){let g=!0;for(let A=0;A1)return{text:t,type:"multiple",editPosition:[],matchPositions:u,suggestion:"Multiple matches found with flexible whitespace. Make your search string more unique.",strategy:"whitespace"};let d=u[0],f=d+l.length;return{text:[...o.slice(0,d),r,...o.slice(f)].join(n),editPosition:[[d,f]],type:"whitespace"}}a(tfs,"tryWhitespaceFlexibleMatch");function rfs(t,e,r,n){if(!e.trim())return{text:t,editPosition:[],type:"none",suggestion:"Cannot perform fuzzy match with empty search string."};let o=t.replace(/\r\n/g,` +`);return new Gr([new Lr(T)],"success")}else return new Gr([new Lr(`Failed to read file ${o} with result ${JSON.stringify(m)}`)],"error")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Gr([new Lr(s)],"error")}}prepareInvocation(e,r){let{filePath:n,offset:o,limit:s}=e.input;if(!n.length)return{progressMessage:"Running read_file tool"};let c=md(n,e.uriSchemeCache);return{progressMessage:this.formatFileMessage(c,o,s,"Reading")}}async invokeConfirmation(e,r,n){let o=e.ctx.get(ef),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{filePath:n,offset:o,limit:s}=e.input;if(!n.length)return{completionMessage:"Ran read_file tool"};let c=md(n,e.uriSchemeCache);return{completionMessage:this.formatFileMessage(c,o,s,"Read file")}}formatFileMessage(e,r,n,o){let s=YA(e),c=Math.max(1,r??1),l=Math.min(Math.max(1,n??fnt),fnt),u=c+l-1;return r===void 0&&n===void 0?`${o} ${s}`:`${o} ${s}, lines ${c} to ${u}`}static toReadFileParams(e){let{filePath:r,offset:n,limit:o}=e;if(typeof r!="string")throw new Error(`filePath must be a string, received: ${typeof r}`);if(n!==void 0){if(typeof n!="number")throw new Error(`offset must be a number, received: ${typeof n}`);if(n<1)throw new Error(`offset must be positive (>= 1), received: ${n}`)}if(o!==void 0){if(typeof o!="number")throw new Error(`limit must be a number, received: ${typeof o}`);if(o<1)throw new Error(`limit must be positive (>= 1), received: ${o}`)}return{filePath:r,offset:n,limit:o}}};p();p();var kke=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},hnt=class extends kke{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},mnt=class extends kke{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},gnt=class extends kke{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function efs(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(efs,"escapeRegex");function tfs(t,e){if(t===e)return 1;if(t.length===0||e.length===0)return 0;let r=[];for(let s=0;s<=t.length;s++)r[s]=[s];for(let s=0;s<=e.length;s++)r[0][s]=s;for(let s=1;s<=t.length;s++)for(let c=1;c<=e.length;c++){let l=t[s-1]===e[c-1]?0:1;r[s][c]=Math.min(r[s-1][c]+1,r[s][c-1]+1,r[s-1][c-1]+l)}let n=r[t.length][e.length],o=Math.max(t.length,e.length);return 1-n/o}a(tfs,"calculateSimilarity");function vKt(t,e,r,n){let o=r.replace(/\r\n/g,` +`).replace(/\n/g,n),s=rfs(t,e,o);if(s.type!=="none")return s;let c=nfs(t,e,o,n);if(c.type!=="none")return c;let l=ifs(t,e,o,n);if(l.type!=="none")return l;let u=ofs(t,e,o,n,.8);return u.type!=="none"?u:{text:t,type:"none",editPosition:[],suggestion:"Try making your search string more specific or checking for whitespace/formatting differences."}}a(vKt,"findAndReplaceOne");function rfs(t,e,r){if(e.length===0)return{text:t,editPosition:[],type:"none"};let n=[];for(let c=0;;){let l=t.indexOf(e,c);if(l===-1)break;n.push(l),c=l+e.length}if(n.length===0)return{text:t,editPosition:[],type:"none"};if(n.length>1)return{text:t,type:"multiple",editPosition:n.map(c=>[c,c+e.length]),strategy:"exact",matchPositions:n,suggestion:"Multiple exact matches found. Make your search string more specific."};let o=n[0];return{text:t.slice(0,o)+r+t.slice(o+e.length),type:"exact",editPosition:[[o,o+e.length]]}}a(rfs,"tryExactMatch");function nfs(t,e,r,n){let o=t.split(n),s=e.split(n),c=o.map(m=>m.trim()),l=s.map(m=>m.trim()),u=[];for(let m=0;m<=c.length-l.length;m++){let g=!0;for(let A=0;A1)return{text:t,type:"multiple",editPosition:[],matchPositions:u,suggestion:"Multiple matches found with flexible whitespace. Make your search string more unique.",strategy:"whitespace"};let d=u[0],f=d+l.length;return{text:[...o.slice(0,d),r,...o.slice(f)].join(n),editPosition:[[d,f]],type:"whitespace"}}a(nfs,"tryWhitespaceFlexibleMatch");function ifs(t,e,r,n){if(!e.trim())return{text:t,editPosition:[],type:"none",suggestion:"Cannot perform fuzzy match with empty search string."};let o=t.replace(/\r\n/g,` `).replace(/\r/g,` `),s=e.replace(/\r\n/g,` `).replace(/\r/g,` `);if(o.includes(s)){let _=o.indexOf(s),E=0,v=0;for(let x=0;x0;x++)t[x]==="\r"&&t[x+1]===` -`?(x++,T--,S=x+1):(T--,S=x+1);let w=t.substring(0,E),R=t.substring(S);return{text:w+r+R,editPosition:[[E,S]],type:"fuzzy"}}let c=e.endsWith(n),l=e;c&&(l=e.slice(0,-n.length));let u=l.split(n),d=u.map((_,E)=>{let v=Zds(_);return E1)return{text:t,type:"multiple",editPosition:[],suggestion:"Multiple fuzzy matches found. Try including more context in your search string.",strategy:"fuzzy",matchPositions:h.map(_=>_.index||0)};let m=h[0],g=m.index||0,A=g+m[0].length;return{text:t.slice(0,g)+r+t.slice(A),type:"fuzzy",editPosition:[[g,A]]}}a(rfs,"tryFuzzyMatch");function nfs(t,e,r,n,o=.95){if(e.length>1e3||e.split(n).length>20)return{text:t,editPosition:[],type:"none"};let s=t.split(n),c=e.split(n);if(s.length>1e3)return{text:t,editPosition:[],type:"none"};let l={index:-1,similarity:0,length:0};for(let u=0;u<=s.length-c.length;u++){let d=0;for(let h=0;ho&&f>l.similarity&&(l={index:u,similarity:f,length:c.length})}if(l.index!==-1){let u=l.index,d=[...s];return d.splice(u,l.length,...r.split(n)),{text:d.join(n),type:"similarity",editPosition:[[u,u+l.length]],similarity:l.similarity,suggestion:`Used similarity matching (${(l.similarity*100).toFixed(1)}% similar). Verify the replacement.`}}return{text:t,editPosition:[],type:"none"}}a(nfs,"trySimilarityMatch");var nOn=new pe("replaceStringTool"),Ant=class extends Nu{static{a(this,"ReplaceStringTool")}constructor(){super({name:"replace_string_in_file",displayName:"Replace String",description:"Replace a specific string in a file with new content. Use this tool when you need to make precise text replacements. For best results, include sufficient context (3-5 lines before and after) to make the old string unique. The system will try multiple matching strategies if exact matching fails.",displayDescription:"Replace a specific string in a file.",inputSchema:b.Object({filePath:b.String({description:"The absolute path of the file to edit."}),oldString:b.String({description:"The exact literal text to replace. Must uniquely identify the single instance to change. Include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely."}),newString:b.String({description:"The exact literal text to replace oldString with."}),explanation:b.Optional(b.String({description:"A short explanation of the string replacement being made."}))})})}async invoke(e,r,n){let{filePath:o,oldString:s,newString:c}=r.input;try{nOn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=md(o,e.uriSchemeCache);if(s===c)throw new gnt("Input and output are identical",o);let u=await this.readFileContent(e,l,n),d=u.includes(`\r +`?(x++,T--,S=x+1):(T--,S=x+1);let w=t.substring(0,E),R=t.substring(S);return{text:w+r+R,editPosition:[[E,S]],type:"fuzzy"}}let c=e.endsWith(n),l=e;c&&(l=e.slice(0,-n.length));let u=l.split(n),d=u.map((_,E)=>{let v=efs(_);return E1)return{text:t,type:"multiple",editPosition:[],suggestion:"Multiple fuzzy matches found. Try including more context in your search string.",strategy:"fuzzy",matchPositions:h.map(_=>_.index||0)};let m=h[0],g=m.index||0,A=g+m[0].length;return{text:t.slice(0,g)+r+t.slice(A),type:"fuzzy",editPosition:[[g,A]]}}a(ifs,"tryFuzzyMatch");function ofs(t,e,r,n,o=.95){if(e.length>1e3||e.split(n).length>20)return{text:t,editPosition:[],type:"none"};let s=t.split(n),c=e.split(n);if(s.length>1e3)return{text:t,editPosition:[],type:"none"};let l={index:-1,similarity:0,length:0};for(let u=0;u<=s.length-c.length;u++){let d=0;for(let h=0;ho&&f>l.similarity&&(l={index:u,similarity:f,length:c.length})}if(l.index!==-1){let u=l.index,d=[...s];return d.splice(u,l.length,...r.split(n)),{text:d.join(n),type:"similarity",editPosition:[[u,u+l.length]],similarity:l.similarity,suggestion:`Used similarity matching (${(l.similarity*100).toFixed(1)}% similar). Verify the replacement.`}}return{text:t,editPosition:[],type:"none"}}a(ofs,"trySimilarityMatch");var iOn=new pe("replaceStringTool"),Ant=class extends Nu{static{a(this,"ReplaceStringTool")}constructor(){super({name:"replace_string_in_file",displayName:"Replace String",description:"Replace a specific string in a file with new content. Use this tool when you need to make precise text replacements. For best results, include sufficient context (3-5 lines before and after) to make the old string unique. The system will try multiple matching strategies if exact matching fails.",displayDescription:"Replace a specific string in a file.",inputSchema:b.Object({filePath:b.String({description:"The absolute path of the file to edit."}),oldString:b.String({description:"The exact literal text to replace. Must uniquely identify the single instance to change. Include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely."}),newString:b.String({description:"The exact literal text to replace oldString with."}),explanation:b.Optional(b.String({description:"A short explanation of the string replacement being made."}))})})}async invoke(e,r,n){let{filePath:o,oldString:s,newString:c}=r.input;try{iOn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=md(o,e.uriSchemeCache);if(s===c)throw new gnt("Input and output are identical",o);let u=await this.readFileContent(e,l,n),d=u.includes(`\r `)?`\r `:` -`,f=EKt(u,s,c,d);if(f.type==="none"&&s.endsWith(` +`,f=vKt(u,s,c,d);if(f.type==="none"&&s.endsWith(` `)){let m=s.endsWith(`\r `)?`\r `:` -`,g=s.substring(0,s.length-m.length);u.endsWith(g)&&(nOn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=EKt(u,g,c,d))}if(f.type==="none")throw new hnt(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new mnt(`Found multiple matches for the specified text. ${f.suggestion||""}`,o);if(n.isCancellationRequested)throw new Error(`Cancellation token triggered when replace string for file ${o}`);let h=await this.invokeClientEditFileTool(e,r,f.text,n);return this.getFinalReplaceStringResult(o,h)}catch(l){let u=l instanceof Error?l.message:`An unknown error occurred when updating file ${o} with oldString '${s}' to newString '${c}'`;return new Gr([new Or(u)],"error")}}async readFileContent(e,r,n){let s=await e.ctx.get(si).getOrReadTextDocument({uri:r});if(s.status==="notfound")throw new Error(`File not found: ${r}. Details: ${s.message}`);if(s.status==="invalid")throw new Error(`Invalid file: ${r}. Reason: ${s.reason}`);return s.document.getText()}async invokeClientEditFileTool(e,r,n,o){let s=e.ctx.get(vs).getToolByNameAndProvider("insert_edit_into_file",dp);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(vs).invokeTool(e,s.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,code:n,explanation:r.input.explanation??""},roundId:r.roundId,toolCallId:r.toolCallId},o)}getFinalReplaceStringResult(e,r){if(r.status!=="success")return r;let n=`The following files were successfully edited: -${e}`;return new Gr([new Or(n)],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running replace_string_in_file tool"};let o=md(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${YA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Xd),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran replace_string_in_file tool"};let o=md(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${YA(o)} with replace_string_in_file tool`}}static toReplaceStringParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.oldString!="string")throw new Error("oldString must be a string");if(typeof e.newString!="string")throw new Error("newString must be a string");if(e.explanation!==void 0&&typeof e.explanation!="string")throw new Error("explanation must be a string");return{filePath:e.filePath,oldString:e.oldString,newString:e.newString,explanation:e.explanation}}};p();var _nt=fe(WP());var _p=new pe("validateCvesTool"),ynt=class t extends Nu{static{a(this,"ValidateCvesTool")}static{this.COORDINATE_BATCH_SIZE=30}static{this.ADVISORY_PAGE_SIZE=100}constructor(){super({name:"validate_cves",displayName:"Validate CVEs",description:"Validates dependencies for known security vulnerabilities (CVEs). Returns CVE details for each affected dependency and the minimum version that resolves all known vulnerabilities.",displayDescription:"Check dependencies for CVEs",inputSchema:b.Object({dependencies:b.Array(b.String({description:'Dependencies to check for CVEs. Format: package@version (Maven uses groupId:artifactId@version, e.g., "org.springframework:spring-core@5.3.20"; others use package@version, e.g., "django@3.2.0")'})),ecosystem:b.Enum(AGt,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return _p.debug(e.ctx,"CVE validation cancelled at start"),new Gr([new Or("CVE validation cancelled")],"cancelled");let{dependencies:o,ecosystem:s}=r.input;try{if(!o?.length)return _p.debug(e.ctx,"No dependencies provided to validate"),new Gr([new Or("validate_cves: No dependencies to validate. Please provide a list of dependencies to check for CVEs.")],"success");if(_p.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return _p.debug(e.ctx,"CVE validation cancelled before GitHub API calls"),new Gr([new Or("CVE validation cancelled")],"cancelled");let c=await this.batchGetCVEs(e,o,s,n),l=this.formatCVEResults(c);if(_p.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");_p.debug(e.ctx,`CVE summary: ${u}`)}return new Gr([new Or(l)],"success")}catch(c){if(r2(c))return _p.debug(e.ctx,"CVE validation cancelled"),new Gr([new Or("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return _p.exception(e.ctx,c,".invoke"),new Gr([new Or(`validate_cves: Error validating CVEs: ${l}`)],"error")}}prepareInvocation(e,r){let{dependencies:n,ecosystem:o}=e.input;return{progressMessage:`validate_cves: Validating ${n.length} ${o} dependencies for CVEs...`}}prepareCompletion(e,r){let{dependencies:n,ecosystem:o}=e.input;return{completionMessage:`validate_cves: Validated ${n.length} ${o} dependencies for CVEs`}}async batchGetCVEs(e,r,n,o){_p.debug(e.ctx,`Fetching CVEs for ${r.length} dependencies in batches`);let s=[];for(let c=0;c!u.withdrawn_at?.trim()).map(u=>({id:u.cve_id||u.ghsa_id,ghsa_id:u.ghsa_id,severity:u.severity,summary:u.summary,description:u.description||u.summary,html_url:u.html_url,affectedDeps:(u.vulnerabilities??[]).map(d=>({name:d.package?.name,vulVersions:d.vulnerable_version_range,patchedVersion:d.first_patched_version}))})),l=s.length-c.length;return _p.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw _p.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){_p.debug(e.ctx,`Grouping CVEs by dependency for ${n.length} dependencies`);let o=[];for(let s of n){let c=s.lastIndexOf("@"),l=c>0?s.substring(0,c):s,u=r.filter(h=>h.affectedDeps.some(m=>m.name===l));if(u.length<1)continue;let d=null,f=[];for(let h of u){let m=h.affectedDeps.find(A=>A.name===l)?.patchedVersion;if(!m){f.push(h.id),_p.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=_nt.coerce(m);if(!g){f.push(h.id),_p.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}_p.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||_nt.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return _p.debug(e.ctx,`Grouped into ${o.length} dependencies with CVEs`),o}formatCVEResults(e){return e.length===0?"No known CVEs are found for the given dependencies.":`The following dependencies have known CVEs: -${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${nKt(f.summary)} +`,g=s.substring(0,s.length-m.length);u.endsWith(g)&&(iOn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=vKt(u,g,c,d))}if(f.type==="none")throw new hnt(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new mnt(`Found multiple matches for the specified text. ${f.suggestion||""}`,o);if(n.isCancellationRequested)throw new Error(`Cancellation token triggered when replace string for file ${o}`);let h=await this.invokeClientEditFileTool(e,r,f.text,n);return this.getFinalReplaceStringResult(o,h)}catch(l){let u=l instanceof Error?l.message:`An unknown error occurred when updating file ${o} with oldString '${s}' to newString '${c}'`;return new Gr([new Lr(u)],"error")}}async readFileContent(e,r,n){let s=await e.ctx.get(si).getOrReadTextDocument({uri:r});if(s.status==="notfound")throw new Error(`File not found: ${r}. Details: ${s.message}`);if(s.status==="invalid")throw new Error(`Invalid file: ${r}. Reason: ${s.reason}`);return s.document.getText()}async invokeClientEditFileTool(e,r,n,o){let s=e.ctx.get(vs).getToolByNameAndProvider("insert_edit_into_file",dp);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(vs).invokeTool(e,s.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,code:n,explanation:r.input.explanation??""},roundId:r.roundId,toolCallId:r.toolCallId},o)}getFinalReplaceStringResult(e,r){if(r.status!=="success")return r;let n=`The following files were successfully edited: +${e}`;return new Gr([new Lr(n)],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running replace_string_in_file tool"};let o=md(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${YA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(ef),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran replace_string_in_file tool"};let o=md(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${YA(o)} with replace_string_in_file tool`}}static toReplaceStringParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.oldString!="string")throw new Error("oldString must be a string");if(typeof e.newString!="string")throw new Error("newString must be a string");if(e.explanation!==void 0&&typeof e.explanation!="string")throw new Error("explanation must be a string");return{filePath:e.filePath,oldString:e.oldString,newString:e.newString,explanation:e.explanation}}};p();var _nt=fe(WP());var _p=new pe("validateCvesTool"),ynt=class t extends Nu{static{a(this,"ValidateCvesTool")}static{this.COORDINATE_BATCH_SIZE=30}static{this.ADVISORY_PAGE_SIZE=100}constructor(){super({name:"validate_cves",displayName:"Validate CVEs",description:"Validates dependencies for known security vulnerabilities (CVEs). Returns CVE details for each affected dependency and the minimum version that resolves all known vulnerabilities.",displayDescription:"Check dependencies for CVEs",inputSchema:b.Object({dependencies:b.Array(b.String({description:'Dependencies to check for CVEs. Format: package@version (Maven uses groupId:artifactId@version, e.g., "org.springframework:spring-core@5.3.20"; others use package@version, e.g., "django@3.2.0")'})),ecosystem:b.Enum(yGt,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return _p.debug(e.ctx,"CVE validation cancelled at start"),new Gr([new Lr("CVE validation cancelled")],"cancelled");let{dependencies:o,ecosystem:s}=r.input;try{if(!o?.length)return _p.debug(e.ctx,"No dependencies provided to validate"),new Gr([new Lr("validate_cves: No dependencies to validate. Please provide a list of dependencies to check for CVEs.")],"success");if(_p.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return _p.debug(e.ctx,"CVE validation cancelled before GitHub API calls"),new Gr([new Lr("CVE validation cancelled")],"cancelled");let c=await this.batchGetCVEs(e,o,s,n),l=this.formatCVEResults(c);if(_p.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");_p.debug(e.ctx,`CVE summary: ${u}`)}return new Gr([new Lr(l)],"success")}catch(c){if(r2(c))return _p.debug(e.ctx,"CVE validation cancelled"),new Gr([new Lr("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return _p.exception(e.ctx,c,".invoke"),new Gr([new Lr(`validate_cves: Error validating CVEs: ${l}`)],"error")}}prepareInvocation(e,r){let{dependencies:n,ecosystem:o}=e.input;return{progressMessage:`validate_cves: Validating ${n.length} ${o} dependencies for CVEs...`}}prepareCompletion(e,r){let{dependencies:n,ecosystem:o}=e.input;return{completionMessage:`validate_cves: Validated ${n.length} ${o} dependencies for CVEs`}}async batchGetCVEs(e,r,n,o){_p.debug(e.ctx,`Fetching CVEs for ${r.length} dependencies in batches`);let s=[];for(let c=0;c!u.withdrawn_at?.trim()).map(u=>({id:u.cve_id||u.ghsa_id,ghsa_id:u.ghsa_id,severity:u.severity,summary:u.summary,description:u.description||u.summary,html_url:u.html_url,affectedDeps:(u.vulnerabilities??[]).map(d=>({name:d.package?.name,vulVersions:d.vulnerable_version_range,patchedVersion:d.first_patched_version}))})),l=s.length-c.length;return _p.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw _p.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){_p.debug(e.ctx,`Grouping CVEs by dependency for ${n.length} dependencies`);let o=[];for(let s of n){let c=s.lastIndexOf("@"),l=c>0?s.substring(0,c):s,u=r.filter(h=>h.affectedDeps.some(m=>m.name===l));if(u.length<1)continue;let d=null,f=[];for(let h of u){let m=h.affectedDeps.find(A=>A.name===l)?.patchedVersion;if(!m){f.push(h.id),_p.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=_nt.coerce(m);if(!g){f.push(h.id),_p.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}_p.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||_nt.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return _p.debug(e.ctx,`Grouped into ${o.length} dependencies with CVEs`),o}formatCVEResults(e){return e.length===0?"No known CVEs are found for the given dependencies.":`The following dependencies have known CVEs: +${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${iKt(f.summary)} `;return h+=` - **Severity**: **${f.severity.toUpperCase()}** -`,h+=` - **Details**: ${nKt(f.description)}`,h}).join(` +`,h+=` - **Details**: ${iKt(f.description)}`,h}).join(` - `),s=`- Dependency \`${n.dep}\` has **${n.cves.length}** known CVEs`,c=n.cves.filter(f=>!n.unfixableCves.includes(f.id)),l=c.map(f=>f.id).join(", "),u=n.unfixableCves.join(", "),d;return n.unfixableCves.length===0?d=`Upgrade to **${n.minVersion}** or higher to fix all CVEs: [${l}]`:c.length===0?d=`[${u}] cannot be fixed yet because patched versions are not available`:d=`Upgrade to **${n.minVersion}** or higher to fix [${l}]; however, [${u}] cannot be fixed yet because patched versions are not available`,`${s}: ${d} - ${o}`}).join(` -`)}`}};function ifs(t){return[new dnt,new pnt,new snt,new Ant,new qrt,new jrt,new lnt,new unt,new ynt]}a(ifs,"getAllClsTools");function iOn(t,e){ifs(t).forEach(e.registerTool.bind(e)),t.get(Nn).onDidSetCapabilities(r=>{t.get(eu).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new yfe):r.subAgent?e.registerTool(new yfe):e.unregisterTool(new yfe),r.manageTodoListTool?e.registerTool(new R5(t)):e.unregisterTool(new R5(t)),r.watchedFiles&&XE(t)?e.registerTool(new Cke):e.unregisterTool(new Cke)})}a(iOn,"registerAllClsTools");var vs=class{constructor(e){this.ctx=e;this._toolRegistry=new FKe;iOn(e,this)}static{a(this,"ToolsService")}registerTool(e){this._toolRegistry.registerTool(e)}unregisterTool(e){return typeof e=="string"?this._toolRegistry.unregisterTool(e):this._toolRegistry.unregisterTool(e.id)}prepareInvocation(e,r,n){let o=this._toolRegistry.getTool(e);if(!o)throw new Error(`Tool with id '${e}' is undefined`);return o.prepareInvocation?.(r,n)??{}}prepareCompletion(e,r,n){let o=this._toolRegistry.getTool(e);if(!o)throw new Error(`Tool with id '${e}' is undefined`);return o.prepareCompletion?.(r,n)??{}}async invokeTool(e,r,n,o){if(o.isCancellationRequested)throw new zc;let s=this._toolRegistry.getTool(r);if(!s)throw new Error(`Tool with id '${r}' is undefined`);return await s.invoke?.(e,n,o)??new Gr([],"success")}async invokeToolConfirmation(e,r,n,o){if(o.isCancellationRequested)throw new zc;let s=this._toolRegistry.getTool(r);if(!s)throw new Error(`Tool with id '${r}' is undefined`);return await s.invokeConfirmation?.(e,n,o)??{result:"dismiss"}}getToolById(e){return this._toolRegistry.getTool(e)}getToolByNameAndProvider(e,r){return this._toolRegistry.listTools().find(n=>n.name===e&&n.toolProvider.id===r.id)}getToolsForModel(e){if(e&&e.customTools!==void 0){if(e.customTools.length===0)return[];let r=new Set(e.customTools);return Array.from(this.getToolMapForModel().values()).filter(n=>r.has(n.configurationKey))}return e?.kind==="Ask"?Array.from(this.getToolMapForModel().values()).filter(r=>qDn.has(r.name)):e?.kind==="InlineAgent"?Array.from(this.getToolMapForModel().values()).filter(r=>jDn.has(r.name)):Array.from(this.getToolMapForModel().values()).filter(r=>r.status==="enabled")}getToolMapForModel(){let e=new Map;for(let m of this._toolRegistry.listTools())e.has(m.toolProvider.id)||e.set(m.toolProvider.id,[]),e.get(m.toolProvider.id)?.push(m);let r=e.get(_0.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(_0.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(_0.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(_0.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get(dp.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get(dp.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(_0.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(_0.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get(dp.id)?.find(m=>m.name==="create_file");if(c){let m=e.get(dp.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(_0.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(_0.id),g=m?.indexOf(l)??-1;g>=0&&m?.splice(g,1)}let u=new Map;r&&o&&u.set(r.nameForModel,r),n&&o&&u.set(n.nameForModel,n),s&&c&&u.set(s.nameForModel,s),l&&o&&c&&u.set(l.nameForModel,l);let d=e.get(dp.id)??[],f=e.get(_0.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==_0.id&&m!==dp.id).flatMap(([,m])=>m);return d.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),f.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),h.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),u}async updateToolStatusByName(e,r,n){let o=this.guessTool(e,r);o.length!==0&&await this.doUpdateToolStatus(e,o,n)}async updateToolStatus(e,r,n){let o=this.getToolsToUpdate(r);o.length!==0&&await this.doUpdateToolStatus(e,o,n)}async doUpdateToolStatus(e,r,n){let o;Array.isArray(r)?o=r:o=[r],await this.doUpdateToolsStatus(e,o.map(s=>({tool:s,status:n})))}async updateToolsStatusByName(e,r){let n=r.flatMap(({toolName:o,status:s})=>this.guessTool(e,o).map(l=>({tool:l,status:s})));await this.doUpdateToolsStatus(e,n)}async updateToolsStatus(e,r){let n=r.flatMap(({toolId:o,status:s})=>this.getToolsToUpdate(o).map(l=>({tool:l,status:s})));await this.doUpdateToolsStatus(e,n)}async doUpdateToolsStatus(e,r){let n=r.map(({tool:c,status:l})=>this.prepareUpdateToolStatus(e,c,l)).flat();function o(c){return c.shouldUpdate?c.shouldUpdate():!0}a(o,"shouldUpdate");let s=new Map;for(let c of n)!c||!o(c)||(c.type==="memory"?c.tool.status=c.status:c.type==="customAgent"&&(s.has(c.customAgent.id)||s.set(c.customAgent.id,{agent:c.customAgent,options:[]}),s.get(c.customAgent.id).options.push({toolConfigurationKey:c.tool.configurationKey,status:c.status})));if(s.size>0){let c=this.ctx.get(Yd);for(let[l,{agent:u,options:d}]of s)await c.updateCustomAgent(u,{updateToolOptions:d})}}guessTool(e,r){let n=this._toolRegistry.listTools().filter(o=>o.name===r);if(!kwe(e)){let o=new Set,s=[];for(let c of n)o.has(c.configurationKey)||(o.add(c.configurationKey),s.push(c));return s}if(r==="insert_edit_into_file"||r==="replace_string_in_file"){let o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===_0.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===dp.id&&c.name==="insert_edit_into_file");return o&&s?[o,s]:[]}return n.length===0?[]:n.length===1||n.length===2&&n.every(o=>o.toolProvider.id===_0.id||o.toolProvider.id===dp.id)?n:[]}getToolsToUpdate(e){let r=this._toolRegistry.getTool(e);if(!r)return[];if((r.name==="insert_edit_into_file"||r.name==="replace_string_in_file")&&r.toolProvider.id===_0.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===dp.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(kwe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===dp.id?[this.prepareUpdateEditorEditFileToolStatus(r,n)]:[{type:"memory",tool:r,status:n}];if(e.source&&!e.source.isReadonly){let o=e.source;return!o.tools||(o.tools.some(c=>c==r?.configurationKey)?"enabled":"disabled")===n?void 0:[{type:"customAgent",customAgent:o,tool:r,status:n}]}}prepareUpdateEditorEditFileToolStatus(e,r){if(r==="enabled")return{type:"memory",tool:e,status:"enabled"};let n=this._toolRegistry.listTools().find(c=>c.toolProvider.id===_0.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===_0.id&&c.name==="replace_string_in_file");function s(c){return!c||c.status==="disabled"}return a(s,"isToolDisabled"),{type:"memory",tool:e,status:"disabled",shouldUpdate:a(()=>s(n)&&s(o),"shouldUpdate")}}};p();var Bj=class extends Nq{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:dp,type:"client"}),this.confirmationMessages=e.confirmationMessages}prepareInvocation(e,r){return{progressMessage:`Running ${this.name} tool`,confirmationMessages:this.confirmationMessages}}prepareCompletion(e,r){return{completionMessage:`Ran ${this.name} tool`}}async invoke(e,r,n){let o={name:this.name,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId};try{return await e.ctx.get(tv).invokeClientTool(e,o)}catch(s){throw new Error(`Failed to invoke client tool ${this.name}: ${String(s)}`)}}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new zc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations,toolMetadata:r.toolMetadata};try{return await e.ctx.get(Xd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var P={};Ti(P,{$brand:()=>vKt,$input:()=>OXt,$output:()=>MXt,NEVER:()=>Pke,TimePrecision:()=>UXt,ZodAny:()=>Ttr,ZodArray:()=>Rtr,ZodBase64:()=>jit,ZodBase64URL:()=>Hit,ZodBigInt:()=>tpe,ZodBigIntFormat:()=>Vit,ZodBoolean:()=>epe,ZodCIDRv4:()=>Qit,ZodCIDRv6:()=>qit,ZodCUID:()=>Nit,ZodCUID2:()=>Mit,ZodCatch:()=>Ytr,ZodCodec:()=>hPe,ZodCustom:()=>mPe,ZodCustomStringFormat:()=>Zfe,ZodDate:()=>lPe,ZodDefault:()=>Htr,ZodDiscriminatedUnion:()=>Ptr,ZodE164:()=>Git,ZodEmail:()=>Rit,ZodEmoji:()=>Pit,ZodEnum:()=>Kfe,ZodError:()=>xhs,ZodExactOptional:()=>Qtr,ZodFile:()=>Ftr,ZodFirstPartyTypeKind:()=>lrr,ZodFunction:()=>srr,ZodGUID:()=>iPe,ZodIPv4:()=>Fit,ZodIPv6:()=>Uit,ZodISODate:()=>bit,ZodISODateTime:()=>Cit,ZodISODuration:()=>Tit,ZodISOTime:()=>Sit,ZodIntersection:()=>Dtr,ZodIssueCode:()=>urr,ZodJWT:()=>$it,ZodKSUID:()=>Bit,ZodLazy:()=>nrr,ZodLiteral:()=>Btr,ZodMAC:()=>vtr,ZodMap:()=>Otr,ZodNaN:()=>Jtr,ZodNanoID:()=>Dit,ZodNever:()=>xtr,ZodNonOptional:()=>Jit,ZodNull:()=>Str,ZodNullable:()=>jtr,ZodNumber:()=>Xfe,ZodNumberFormat:()=>NZ,ZodObject:()=>uPe,ZodOptional:()=>Kit,ZodPipe:()=>pPe,ZodPrefault:()=>$tr,ZodPreprocess:()=>Ztr,ZodPromise:()=>orr,ZodReadonly:()=>Xtr,ZodRealError:()=>Tb,ZodRecord:()=>Yfe,ZodSet:()=>Ltr,ZodString:()=>Jfe,ZodStringFormat:()=>Bl,ZodSuccess:()=>ztr,ZodSymbol:()=>Ctr,ZodTemplateLiteral:()=>rrr,ZodTransform:()=>Utr,ZodTuple:()=>Ntr,ZodType:()=>rs,ZodULID:()=>Oit,ZodURL:()=>aPe,ZodUUID:()=>H5,ZodUndefined:()=>btr,ZodUnion:()=>dPe,ZodUnknown:()=>Itr,ZodVoid:()=>wtr,ZodXID:()=>Lit,ZodXor:()=>ktr,_ZodString:()=>wit,_default:()=>Gtr,_function:()=>X5n,any:()=>Wit,array:()=>Qr,base64:()=>y5n,base64url:()=>_5n,bigint:()=>k5n,boolean:()=>Zc,catch:()=>Ktr,check:()=>e4n,cidrv4:()=>g5n,cidrv6:()=>A5n,clone:()=>_v,codec:()=>Y5n,coerce:()=>APe,config:()=>Ep,core:()=>o8,cuid:()=>c5n,cuid2:()=>l5n,custom:()=>Zit,date:()=>L5n,decode:()=>htr,decodeAsync:()=>gtr,describe:()=>t4n,discriminatedUnion:()=>fPe,e164:()=>E5n,email:()=>XOn,emoji:()=>s5n,encode:()=>ptr,encodeAsync:()=>mtr,endsWith:()=>Qfe,enum:()=>XA,exactOptional:()=>qtr,file:()=>$5n,flattenError:()=>Uke,float32:()=>I5n,float64:()=>x5n,formatError:()=>Qke,fromJSONSchema:()=>a4n,function:()=>X5n,getErrorMap:()=>khs,globalRegistry:()=>ZA,gt:()=>q5,gte:()=>vv,guid:()=>e5n,hash:()=>T5n,hex:()=>S5n,hostname:()=>b5n,httpUrl:()=>o5n,includes:()=>Ffe,instanceof:()=>n4n,int:()=>Iit,int32:()=>w5n,int64:()=>P5n,intersection:()=>rpe,invertCodec:()=>K5n,ipv4:()=>p5n,ipv6:()=>m5n,iso:()=>zj,json:()=>o4n,jwt:()=>v5n,keyof:()=>B5n,ksuid:()=>f5n,lazy:()=>irr,length:()=>DZ,literal:()=>zn,locales:()=>ePe,looseObject:()=>gh,looseRecord:()=>q5n,lowercase:()=>Lfe,lt:()=>Q5,lte:()=>DT,mac:()=>h5n,map:()=>j5n,maxLength:()=>PZ,maxSize:()=>Gj,meta:()=>r4n,mime:()=>qfe,minLength:()=>i8,minSize:()=>j5,multipleOf:()=>Hj,nan:()=>z5n,nanoid:()=>a5n,nativeEnum:()=>G5n,negative:()=>fit,never:()=>zit,nonnegative:()=>hit,nonoptional:()=>Wtr,nonpositive:()=>pit,normalize:()=>jfe,null:()=>cPe,nullable:()=>oPe,nullish:()=>V5n,number:()=>ya,object:()=>Yr,optional:()=>ou,overwrite:()=>U2,parse:()=>ltr,parseAsync:()=>utr,partialRecord:()=>Q5n,pipe:()=>xit,positive:()=>dit,prefault:()=>Vtr,preprocess:()=>gPe,prettifyError:()=>MKt,promise:()=>Z5n,property:()=>mit,readonly:()=>trr,record:()=>ml,refine:()=>arr,regex:()=>Ofe,regexes:()=>PT,registry:()=>Gnt,safeDecode:()=>ytr,safeDecodeAsync:()=>Etr,safeEncode:()=>Atr,safeEncodeAsync:()=>_tr,safeParse:()=>dtr,safeParseAsync:()=>ftr,set:()=>H5n,setErrorMap:()=>Rhs,size:()=>kZ,slugify:()=>Vfe,startsWith:()=>Ufe,strictObject:()=>F5n,string:()=>Xe,stringFormat:()=>C5n,stringbool:()=>i4n,success:()=>W5n,superRefine:()=>crr,symbol:()=>N5n,templateLiteral:()=>J5n,toJSONSchema:()=>_it,toLowerCase:()=>Gfe,toUpperCase:()=>$fe,transform:()=>Yit,treeifyError:()=>NKt,trim:()=>Hfe,tuple:()=>Mtr,uint32:()=>R5n,uint64:()=>D5n,ulid:()=>u5n,undefined:()=>M5n,union:()=>Ul,unknown:()=>Fl,uppercase:()=>Bfe,url:()=>kit,util:()=>lr,uuid:()=>t5n,uuidv4:()=>r5n,uuidv6:()=>n5n,uuidv7:()=>i5n,void:()=>O5n,xid:()=>d5n,xor:()=>U5n});p();var o8={};Ti(o8,{$ZodAny:()=>aZt,$ZodArray:()=>fZt,$ZodAsyncError:()=>F2,$ZodBase64:()=>JJt,$ZodBase64URL:()=>ZJt,$ZodBigInt:()=>Unt,$ZodBigIntFormat:()=>nZt,$ZodBoolean:()=>Wke,$ZodCIDRv4:()=>zJt,$ZodCIDRv6:()=>YJt,$ZodCUID:()=>LJt,$ZodCUID2:()=>BJt,$ZodCatch:()=>kZt,$ZodCheck:()=>iu,$ZodCheckBigIntFormat:()=>fJt,$ZodCheckEndsWith:()=>SJt,$ZodCheckGreaterThan:()=>Nnt,$ZodCheckIncludes:()=>CJt,$ZodCheckLengthEquals:()=>yJt,$ZodCheckLessThan:()=>Dnt,$ZodCheckLowerCase:()=>EJt,$ZodCheckMaxLength:()=>gJt,$ZodCheckMaxSize:()=>pJt,$ZodCheckMimeType:()=>IJt,$ZodCheckMinLength:()=>AJt,$ZodCheckMinSize:()=>hJt,$ZodCheckMultipleOf:()=>uJt,$ZodCheckNumberFormat:()=>dJt,$ZodCheckOverwrite:()=>xJt,$ZodCheckProperty:()=>TJt,$ZodCheckRegex:()=>_Jt,$ZodCheckSizeEquals:()=>mJt,$ZodCheckStartsWith:()=>bJt,$ZodCheckStringFormat:()=>Nfe,$ZodCheckUpperCase:()=>vJt,$ZodCodec:()=>Yke,$ZodCustom:()=>FZt,$ZodCustomStringFormat:()=>tZt,$ZodDate:()=>dZt,$ZodDefault:()=>IZt,$ZodDiscriminatedUnion:()=>mZt,$ZodE164:()=>XJt,$ZodEmail:()=>DJt,$ZodEmoji:()=>MJt,$ZodEncodeError:()=>Fj,$ZodEnum:()=>EZt,$ZodError:()=>Fke,$ZodExactOptional:()=>SZt,$ZodFile:()=>CZt,$ZodFunction:()=>OZt,$ZodGUID:()=>kJt,$ZodIPv4:()=>$Jt,$ZodIPv6:()=>VJt,$ZodISODate:()=>jJt,$ZodISODateTime:()=>qJt,$ZodISODuration:()=>GJt,$ZodISOTime:()=>HJt,$ZodIntersection:()=>gZt,$ZodJWT:()=>eZt,$ZodKSUID:()=>QJt,$ZodLazy:()=>BZt,$ZodLiteral:()=>vZt,$ZodMAC:()=>WJt,$ZodMap:()=>yZt,$ZodNaN:()=>PZt,$ZodNanoID:()=>OJt,$ZodNever:()=>lZt,$ZodNonOptional:()=>wZt,$ZodNull:()=>sZt,$ZodNullable:()=>TZt,$ZodNumber:()=>Fnt,$ZodNumberFormat:()=>rZt,$ZodObject:()=>HOn,$ZodObjectJIT:()=>pZt,$ZodOptional:()=>qnt,$ZodPipe:()=>jnt,$ZodPrefault:()=>xZt,$ZodPreprocess:()=>DZt,$ZodPromise:()=>LZt,$ZodReadonly:()=>NZt,$ZodRealError:()=>Sb,$ZodRecord:()=>AZt,$ZodRegistry:()=>Hnt,$ZodSet:()=>_Zt,$ZodString:()=>RZ,$ZodStringFormat:()=>Ll,$ZodSuccess:()=>RZt,$ZodSymbol:()=>iZt,$ZodTemplateLiteral:()=>MZt,$ZodTransform:()=>bZt,$ZodTuple:()=>Qnt,$ZodType:()=>po,$ZodULID:()=>FJt,$ZodURL:()=>NJt,$ZodUUID:()=>PJt,$ZodUndefined:()=>oZt,$ZodUnion:()=>zke,$ZodUnknown:()=>cZt,$ZodVoid:()=>uZt,$ZodXID:()=>UJt,$ZodXor:()=>hZt,$brand:()=>vKt,$constructor:()=>ct,$input:()=>OXt,$output:()=>MXt,Doc:()=>Vke,JSONSchema:()=>KOn,JSONSchemaGenerator:()=>Eit,NEVER:()=>Pke,TimePrecision:()=>UXt,_any:()=>ser,_array:()=>per,_base64:()=>ait,_base64url:()=>cit,_bigint:()=>XXt,_boolean:()=>JXt,_catch:()=>_hs,_check:()=>YOn,_cidrv4:()=>oit,_cidrv6:()=>sit,_coercedBigint:()=>eer,_coercedBoolean:()=>ZXt,_coercedDate:()=>der,_coercedNumber:()=>$Xt,_coercedString:()=>BXt,_cuid:()=>Znt,_cuid2:()=>Xnt,_custom:()=>mer,_date:()=>uer,_decode:()=>bnt,_decodeAsync:()=>Tnt,_default:()=>ghs,_discriminatedUnion:()=>ihs,_e164:()=>lit,_email:()=>$nt,_emoji:()=>Knt,_encode:()=>Cnt,_encodeAsync:()=>Snt,_endsWith:()=>Qfe,_enum:()=>uhs,_file:()=>her,_float32:()=>WXt,_float64:()=>zXt,_gt:()=>q5,_gte:()=>vv,_guid:()=>tPe,_includes:()=>Ffe,_int:()=>VXt,_int32:()=>YXt,_int64:()=>ter,_intersection:()=>ohs,_ipv4:()=>nit,_ipv6:()=>iit,_isoDate:()=>qXt,_isoDateTime:()=>QXt,_isoDuration:()=>HXt,_isoTime:()=>jXt,_jwt:()=>uit,_ksuid:()=>rit,_lazy:()=>bhs,_length:()=>DZ,_literal:()=>fhs,_lowercase:()=>Lfe,_lt:()=>Q5,_lte:()=>DT,_mac:()=>FXt,_map:()=>chs,_max:()=>DT,_maxLength:()=>PZ,_maxSize:()=>Gj,_mime:()=>qfe,_min:()=>vv,_minLength:()=>i8,_minSize:()=>j5,_multipleOf:()=>Hj,_nan:()=>fer,_nanoid:()=>Jnt,_nativeEnum:()=>dhs,_negative:()=>fit,_never:()=>cer,_nonnegative:()=>hit,_nonoptional:()=>Ahs,_nonpositive:()=>pit,_normalize:()=>jfe,_null:()=>oer,_nullable:()=>mhs,_number:()=>GXt,_optional:()=>hhs,_overwrite:()=>U2,_parse:()=>wfe,_parseAsync:()=>Rfe,_pipe:()=>Ehs,_positive:()=>dit,_promise:()=>Shs,_property:()=>mit,_readonly:()=>vhs,_record:()=>ahs,_refine:()=>ger,_regex:()=>Ofe,_safeDecode:()=>xnt,_safeDecodeAsync:()=>Rnt,_safeEncode:()=>Int,_safeEncodeAsync:()=>wnt,_safeParse:()=>kfe,_safeParseAsync:()=>Dfe,_set:()=>lhs,_size:()=>kZ,_slugify:()=>Vfe,_startsWith:()=>Ufe,_string:()=>LXt,_stringFormat:()=>Wfe,_stringbool:()=>Eer,_success:()=>yhs,_superRefine:()=>Aer,_symbol:()=>ner,_templateLiteral:()=>Chs,_toLowerCase:()=>Gfe,_toUpperCase:()=>$fe,_transform:()=>phs,_trim:()=>Hfe,_tuple:()=>shs,_uint32:()=>KXt,_uint64:()=>rer,_ulid:()=>eit,_undefined:()=>ier,_union:()=>rhs,_unknown:()=>aer,_uppercase:()=>Bfe,_url:()=>rPe,_uuid:()=>Vnt,_uuidv4:()=>Wnt,_uuidv6:()=>znt,_uuidv7:()=>Ynt,_void:()=>ler,_xid:()=>tit,_xor:()=>nhs,clone:()=>_v,config:()=>Ep,createStandardJSONSchemaMethod:()=>zfe,createToJSONSchemaMethod:()=>ver,decode:()=>fOn,decodeAsync:()=>hOn,describe:()=>yer,encode:()=>dOn,encodeAsync:()=>pOn,extractDefs:()=>Vj,finalize:()=>Wj,flattenError:()=>Uke,formatError:()=>Qke,globalConfig:()=>IZ,globalRegistry:()=>ZA,initializeContext:()=>$j,isValidBase64:()=>KJt,isValidBase64URL:()=>UOn,isValidJWT:()=>QOn,locales:()=>ePe,meta:()=>_er,parse:()=>qke,parseAsync:()=>jke,prettifyError:()=>MKt,process:()=>Jc,regexes:()=>PT,registry:()=>Gnt,safeDecode:()=>gOn,safeDecodeAsync:()=>yOn,safeEncode:()=>mOn,safeEncodeAsync:()=>AOn,safeParse:()=>Pfe,safeParseAsync:()=>Hke,toDotPath:()=>uOn,toJSONSchema:()=>_it,treeifyError:()=>NKt,util:()=>lr,version:()=>wJt});p();p();var oOn,Pke=Object.freeze({status:"aborted"});function ct(t,e,r){function n(l,u){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:u,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(t))return;l._zod.traits.add(t),e(l,u);let d=c.prototype,f=Object.keys(d);for(let h=0;hr?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}a(ct,"$constructor");var vKt=Symbol("zod_brand"),F2=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Fj=class extends Error{static{a(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(oOn=globalThis).__zod_globalConfig??(oOn.__zod_globalConfig={});var IZ=globalThis.__zod_globalConfig;function Ep(t){return t&&Object.assign(IZ,t),IZ}a(Ep,"config");p();p();var lr={};Ti(lr,{BIGINT_FORMAT_RANGES:()=>PKt,Class:()=>bKt,NUMBER_FORMAT_RANGES:()=>kKt,aborted:()=>jj,allowsEval:()=>IKt,assert:()=>lfs,assertEqual:()=>ofs,assertIs:()=>afs,assertNever:()=>cfs,assertNotEqual:()=>sfs,assignProp:()=>Qj,base64ToUint8Array:()=>aOn,base64urlToUint8Array:()=>Ifs,cached:()=>Ife,captureStackTrace:()=>vnt,cleanEnum:()=>Tfs,cleanRegex:()=>Mke,clone:()=>_v,cloneDef:()=>dfs,createTransparentProxy:()=>Afs,defineLazy:()=>Ls,esc:()=>Ent,escapeRegex:()=>Gw,explicitlyAborted:()=>DKt,extend:()=>Efs,finalizeIssue:()=>Ev,floatSafeRemainder:()=>SKt,getElementAtPath:()=>ffs,getEnumValues:()=>Nke,getLengthableOrigin:()=>Bke,getParsedType:()=>gfs,getSizableOrigin:()=>Lke,hexToUint8Array:()=>wfs,isObject:()=>xZ,isPlainObject:()=>qj,issue:()=>xfe,joinValues:()=>_t,jsonStringifyReplacer:()=>Tfe,merge:()=>Cfs,mergeDefs:()=>n8,normalizeParams:()=>br,nullish:()=>Uj,numKeys:()=>mfs,objectClone:()=>ufs,omit:()=>_fs,optionalKeys:()=>RKt,parsedType:()=>nr,partial:()=>bfs,pick:()=>yfs,prefixIssues:()=>bb,primitiveTypes:()=>wKt,promiseAllObject:()=>pfs,propertyKeyTypes:()=>Oke,randomString:()=>hfs,required:()=>Sfs,safeExtend:()=>vfs,shallowClone:()=>xKt,slugify:()=>TKt,stringifyPrimitive:()=>Zt,uint8ArrayToBase64:()=>cOn,uint8ArrayToBase64url:()=>xfs,uint8ArrayToHex:()=>Rfs,unwrapMessage:()=>Dke});p();function ofs(t){return t}a(ofs,"assertEqual");function sfs(t){return t}a(sfs,"assertNotEqual");function afs(t){}a(afs,"assertIs");function cfs(t){throw new Error("Unexpected value in exhaustive check")}a(cfs,"assertNever");function lfs(t){}a(lfs,"assert");function Nke(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}a(Nke,"getEnumValues");function _t(t,e="|"){return t.map(r=>Zt(r)).join(e)}a(_t,"joinValues");function Tfe(t,e){return typeof e=="bigint"?e.toString():e}a(Tfe,"jsonStringifyReplacer");function Ife(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Ife,"cached");function Uj(t){return t==null}a(Uj,"nullish");function Mke(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(Mke,"cleanRegex");function SKt(t,e){let r=t/e,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)r?.[n],t):t}a(ffs,"getElementAtPath");function pfs(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s{};function xZ(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(xZ,"isObject");var IKt=Ife(()=>{if(IZ.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function qj(t){if(xZ(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(xZ(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(qj,"isPlainObject");function xKt(t){return qj(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}a(xKt,"shallowClone");function mfs(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(mfs,"numKeys");var gfs=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},"getParsedType"),Oke=new Set(["string","number","symbol"]),wKt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Gw(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Gw,"escapeRegex");function _v(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(_v,"clone");function br(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:a(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}a(br,"normalizeParams");function Afs(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}a(Afs,"createTransparentProxy");function Zt(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Zt,"stringifyPrimitive");function RKt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(RKt,"optionalKeys");var kKt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},PKt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function yfs(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=n8(t._zod.def,{get shape(){let c={};for(let l in e){if(!(l in r.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&(c[l]=r.shape[l])}return Qj(this,"shape",c),c},checks:[]});return _v(t,s)}a(yfs,"pick");function _fs(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=n8(t._zod.def,{get shape(){let c={...t._zod.def.shape};for(let l in e){if(!(l in r.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&delete c[l]}return Qj(this,"shape",c),c},checks:[]});return _v(t,s)}a(_fs,"omit");function Efs(t,e){if(!qj(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let s=t._zod.def.shape;for(let c in e)if(Object.getOwnPropertyDescriptor(s,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=n8(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return Qj(this,"shape",s),s}});return _v(t,o)}a(Efs,"extend");function vfs(t,e){if(!qj(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=n8(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return Qj(this,"shape",n),n}});return _v(t,r)}a(vfs,"safeExtend");function Cfs(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=n8(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return Qj(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return _v(t,r)}a(Cfs,"merge");function bfs(t,e,r){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let c=n8(e._zod.def,{get shape(){let l=e._zod.def.shape,u={...l};if(r)for(let d in r){if(!(d in l))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(u[d]=t?new t({type:"optional",innerType:l[d]}):l[d])}else for(let d in l)u[d]=t?new t({type:"optional",innerType:l[d]}):l[d];return Qj(this,"shape",u),u},checks:[]});return _v(e,c)}a(bfs,"partial");function Sfs(t,e,r){let n=n8(e._zod.def,{get shape(){let o=e._zod.def.shape,s={...o};if(r)for(let c in r){if(!(c in s))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(s[c]=new t({type:"nonoptional",innerType:o[c]}))}else for(let c in o)s[c]=new t({type:"nonoptional",innerType:o[c]});return Qj(this,"shape",s),s}});return _v(e,n)}a(Sfs,"required");function jj(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(bb,"prefixIssues");function Dke(t){return typeof t=="string"?t:t?.message}a(Dke,"unwrapMessage");function Ev(t,e,r){let n=t.message?t.message:Dke(t.inst?._zod.def?.error?.(t))??Dke(e?.error?.(t))??Dke(r.customError?.(t))??Dke(r.localeError?.(t))??"Invalid input",{inst:o,continue:s,input:c,...l}=t;return l.path??(l.path=[]),l.message=n,e?.reportInput&&(l.input=c),l}a(Ev,"finalizeIssue");function Lke(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(Lke,"getSizableOrigin");function Bke(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(Bke,"getLengthableOrigin");function nr(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}a(nr,"parsedType");function xfe(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(xfe,"issue");function Tfs(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(Tfs,"cleanEnum");function aOn(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;ne.toString(16).padStart(2,"0")).join("")}a(Rfs,"uint8ArrayToHex");var bKt=class{static{a(this,"Class")}constructor(...e){}};var lOn=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Tfe,2),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),Fke=ct("$ZodError",lOn),Sb=ct("$ZodError",lOn,{Parent:Error});function Uke(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}a(Uke,"flattenError");function Qke(t,e=r=>r.message){let r={_errors:[]},n=a((o,s=[])=>{for(let c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>n({issues:l},[...s,...c.path]));else if(c.code==="invalid_key")n({issues:c.issues},[...s,...c.path]);else if(c.code==="invalid_element")n({issues:c.issues},[...s,...c.path]);else{let l=[...s,...c.path];if(l.length===0)r._errors.push(e(c));else{let u=r,d=0;for(;dr.message){let r={errors:[]},n=a((o,s=[])=>{var c,l;for(let u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>n({issues:d},[...s,...u.path]));else if(u.code==="invalid_key")n({issues:u.issues},[...s,...u.path]);else if(u.code==="invalid_element")n({issues:u.issues},[...s,...u.path]);else{let d=[...s,...u.path];if(d.length===0){r.errors.push(e(u));continue}let f=r,h=0;for(;htypeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}a(uOn,"toDotPath");function MKt(t){let e=[],r=[...t.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${uOn(n.path)}`);return e.join(` -`)}a(MKt,"prettifyError");var wfe=a(t=>(e,r,n,o)=>{let s=n?{...n,async:!1}:{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new F2;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>Ev(u,s,Ep())));throw vnt(l,o?.callee),l}return c.value},"_parse"),qke=wfe(Sb),Rfe=a(t=>async(e,r,n,o)=>{let s=n?{...n,async:!0}:{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>Ev(u,s,Ep())));throw vnt(l,o?.callee),l}return c.value},"_parseAsync"),jke=Rfe(Sb),kfe=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new F2;return s.issues.length?{success:!1,error:new(t??Fke)(s.issues.map(c=>Ev(c,o,Ep())))}:{success:!0,data:s.value}},"_safeParse"),Pfe=kfe(Sb),Dfe=a(t=>async(e,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>Ev(c,o,Ep())))}:{success:!0,data:s.value}},"_safeParseAsync"),Hke=Dfe(Sb),Cnt=a(t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return wfe(t)(e,r,o)},"_encode"),dOn=Cnt(Sb),bnt=a(t=>(e,r,n)=>wfe(t)(e,r,n),"_decode"),fOn=bnt(Sb),Snt=a(t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Rfe(t)(e,r,o)},"_encodeAsync"),pOn=Snt(Sb),Tnt=a(t=>async(e,r,n)=>Rfe(t)(e,r,n),"_decodeAsync"),hOn=Tnt(Sb),Int=a(t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return kfe(t)(e,r,o)},"_safeEncode"),mOn=Int(Sb),xnt=a(t=>(e,r,n)=>kfe(t)(e,r,n),"_safeDecode"),gOn=xnt(Sb),wnt=a(t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Dfe(t)(e,r,o)},"_safeEncodeAsync"),AOn=wnt(Sb),Rnt=a(t=>async(e,r,n)=>Dfe(t)(e,r,n),"_safeDecodeAsync"),yOn=Rnt(Sb);p();p();var PT={};Ti(PT,{base64:()=>KKt,base64url:()=>knt,bigint:()=>nJt,boolean:()=>oJt,browserEmail:()=>Ffs,cidrv4:()=>zKt,cidrv6:()=>YKt,cuid:()=>OKt,cuid2:()=>LKt,date:()=>XKt,datetime:()=>tJt,domain:()=>qfs,duration:()=>qKt,e164:()=>ZKt,email:()=>HKt,emoji:()=>GKt,extendedDuration:()=>Pfs,guid:()=>jKt,hex:()=>jfs,hostname:()=>Qfs,html5Email:()=>Ofs,httpProtocol:()=>JKt,idnEmail:()=>Bfs,integer:()=>iJt,ipv4:()=>$Kt,ipv6:()=>VKt,ksuid:()=>UKt,lowercase:()=>cJt,mac:()=>WKt,md5_base64:()=>Gfs,md5_base64url:()=>$fs,md5_hex:()=>Hfs,nanoid:()=>QKt,null:()=>sJt,number:()=>Pnt,rfc5322Email:()=>Lfs,sha1_base64:()=>Wfs,sha1_base64url:()=>zfs,sha1_hex:()=>Vfs,sha256_base64:()=>Kfs,sha256_base64url:()=>Jfs,sha256_hex:()=>Yfs,sha384_base64:()=>Xfs,sha384_base64url:()=>eps,sha384_hex:()=>Zfs,sha512_base64:()=>rps,sha512_base64url:()=>nps,sha512_hex:()=>tps,string:()=>rJt,time:()=>eJt,ulid:()=>BKt,undefined:()=>aJt,unicodeEmail:()=>_On,uppercase:()=>lJt,uuid:()=>wZ,uuid4:()=>Dfs,uuid6:()=>Nfs,uuid7:()=>Mfs,xid:()=>FKt});p();var OKt=/^[cC][0-9a-z]{6,}$/,LKt=/^[0-9a-z]+$/,BKt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,FKt=/^[0-9a-vA-V]{20}$/,UKt=/^[A-Za-z0-9]{27}$/,QKt=/^[a-zA-Z0-9_-]{21}$/,qKt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Pfs=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,jKt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,wZ=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),Dfs=wZ(4),Nfs=wZ(6),Mfs=wZ(7),HKt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ofs=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Lfs=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,_On=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Bfs=_On,Ffs=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ufs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function GKt(){return new RegExp(Ufs,"u")}a(GKt,"emoji");var $Kt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,VKt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,WKt=a(t=>{let e=Gw(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},"mac"),zKt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,YKt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,KKt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,knt=/^[A-Za-z0-9_-]*$/,Qfs=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,qfs=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,JKt=/^https?$/,ZKt=/^\+[1-9]\d{6,14}$/,EOn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",XKt=new RegExp(`^${EOn}$`);function vOn(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(vOn,"timeSource");function eJt(t){return new RegExp(`^${vOn(t)}$`)}a(eJt,"time");function tJt(t){let e=vOn({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${EOn}T(?:${n})$`)}a(tJt,"datetime");var rJt=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),nJt=/^-?\d+n?$/,iJt=/^-?\d+$/,Pnt=/^-?\d+(?:\.\d+)?$/,oJt=/^(?:true|false)$/i,sJt=/^null$/i;var aJt=/^undefined$/i;var cJt=/^[^A-Z]*$/,lJt=/^[^a-z]*$/,jfs=/^[0-9a-fA-F]*$/;function Gke(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}a(Gke,"fixedBase64");function $ke(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}a($ke,"fixedBase64url");var Hfs=/^[0-9a-fA-F]{32}$/,Gfs=Gke(22,"=="),$fs=$ke(22),Vfs=/^[0-9a-fA-F]{40}$/,Wfs=Gke(27,"="),zfs=$ke(27),Yfs=/^[0-9a-fA-F]{64}$/,Kfs=Gke(43,"="),Jfs=$ke(43),Zfs=/^[0-9a-fA-F]{96}$/,Xfs=Gke(64,""),eps=$ke(64),tps=/^[0-9a-fA-F]{128}$/,rps=Gke(86,"=="),nps=$ke(86);var iu=ct("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),bOn={number:"number",bigint:"bigint",object:"date"},Dnt=ct("$ZodCheckLessThan",(t,e)=>{iu.init(t,e);let r=bOn[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{iu.init(t,e);let r=bOn[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),uJt=ct("$ZodCheckMultipleOf",(t,e)=>{iu.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):SKt(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),dJt=ct("$ZodCheckNumberFormat",(t,e)=>{iu.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=kKt[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=o,l.maximum=s,r&&(l.pattern=iJt)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}ls&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}}),fJt=ct("$ZodCheckBigIntFormat",(t,e)=>{iu.init(t,e);let[r,n]=PKt[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=r,s.maximum=n}),t._zod.check=o=>{let s=o.value;sn&&o.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inclusive:!0,inst:t,continue:!e.abort})}}),pJt=ct("$ZodCheckMaxSize",(t,e)=>{var r;iu.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uj(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;o.size<=e.maximum||n.issues.push({origin:Lke(o),code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),hJt=ct("$ZodCheckMinSize",(t,e)=>{var r;iu.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uj(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;o.size>=e.minimum||n.issues.push({origin:Lke(o),code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),mJt=ct("$ZodCheckSizeEquals",(t,e)=>{var r;iu.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uj(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.size,o.maximum=e.size,o.size=e.size}),t._zod.check=n=>{let o=n.value,s=o.size;if(s===e.size)return;let c=s>e.size;n.issues.push({origin:Lke(o),...c?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),gJt=ct("$ZodCheckMaxLength",(t,e)=>{var r;iu.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uj(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;if(o.length<=e.maximum)return;let c=Bke(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),AJt=ct("$ZodCheckMinLength",(t,e)=>{var r;iu.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uj(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let c=Bke(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),yJt=ct("$ZodCheckLengthEquals",(t,e)=>{var r;iu.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uj(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let c=Bke(o),l=s>e.length;n.issues.push({origin:c,...l?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),Nfe=ct("$ZodCheckStringFormat",(t,e)=>{var r,n;iu.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),_Jt=ct("$ZodCheckRegex",(t,e)=>{Nfe.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),EJt=ct("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=cJt),Nfe.init(t,e)}),vJt=ct("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=lJt),Nfe.init(t,e)}),CJt=ct("$ZodCheckIncludes",(t,e)=>{iu.init(t,e);let r=Gw(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),bJt=ct("$ZodCheckStartsWith",(t,e)=>{iu.init(t,e);let r=new RegExp(`^${Gw(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),SJt=ct("$ZodCheckEndsWith",(t,e)=>{iu.init(t,e);let r=new RegExp(`.*${Gw(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});function COn(t,e,r){t.issues.length&&e.issues.push(...bb(r,t.issues))}a(COn,"handleCheckPropertyResult");var TJt=ct("$ZodCheckProperty",(t,e)=>{iu.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>COn(o,r,e.property));COn(n,r,e.property)}}),IJt=ct("$ZodCheckMimeType",(t,e)=>{iu.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t,continue:!e.abort})}}),xJt=ct("$ZodCheckOverwrite",(t,e)=>{iu.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var Vke=class{static{a(this,"Doc")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(` +`)}`}};function sfs(t){return[new dnt,new pnt,new snt,new Ant,new qrt,new jrt,new lnt,new unt,new ynt]}a(sfs,"getAllClsTools");function oOn(t,e){sfs(t).forEach(e.registerTool.bind(e)),t.get(Nn).onDidSetCapabilities(r=>{t.get(eu).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new _fe):r.subAgent?e.registerTool(new _fe):e.unregisterTool(new _fe),r.manageTodoListTool?e.registerTool(new R5(t)):e.unregisterTool(new R5(t)),r.watchedFiles&&XE(t)?e.registerTool(new Cke):e.unregisterTool(new Cke)})}a(oOn,"registerAllClsTools");var vs=class{constructor(e){this.ctx=e;this._toolRegistry=new FKe;oOn(e,this)}static{a(this,"ToolsService")}registerTool(e){this._toolRegistry.registerTool(e)}unregisterTool(e){return typeof e=="string"?this._toolRegistry.unregisterTool(e):this._toolRegistry.unregisterTool(e.id)}prepareInvocation(e,r,n){let o=this._toolRegistry.getTool(e);if(!o)throw new Error(`Tool with id '${e}' is undefined`);return o.prepareInvocation?.(r,n)??{}}prepareCompletion(e,r,n){let o=this._toolRegistry.getTool(e);if(!o)throw new Error(`Tool with id '${e}' is undefined`);return o.prepareCompletion?.(r,n)??{}}async invokeTool(e,r,n,o){if(o.isCancellationRequested)throw new zc;let s=this._toolRegistry.getTool(r);if(!s)throw new Error(`Tool with id '${r}' is undefined`);return await s.invoke?.(e,n,o)??new Gr([],"success")}async invokeToolConfirmation(e,r,n,o){if(o.isCancellationRequested)throw new zc;let s=this._toolRegistry.getTool(r);if(!s)throw new Error(`Tool with id '${r}' is undefined`);return await s.invokeConfirmation?.(e,n,o)??{result:"dismiss"}}getToolById(e){return this._toolRegistry.getTool(e)}getToolByNameAndProvider(e,r){return this._toolRegistry.listTools().find(n=>n.name===e&&n.toolProvider.id===r.id)}getToolsForModel(e){if(e&&e.customTools!==void 0){if(e.customTools.length===0)return[];let r=new Set(e.customTools);return Array.from(this.getToolMapForModel().values()).filter(n=>r.has(n.configurationKey))}return e?.kind==="Ask"?Array.from(this.getToolMapForModel().values()).filter(r=>jDn.has(r.name)):e?.kind==="InlineAgent"?Array.from(this.getToolMapForModel().values()).filter(r=>HDn.has(r.name)):Array.from(this.getToolMapForModel().values()).filter(r=>r.status==="enabled")}getToolMapForModel(){let e=new Map;for(let m of this._toolRegistry.listTools())e.has(m.toolProvider.id)||e.set(m.toolProvider.id,[]),e.get(m.toolProvider.id)?.push(m);let r=e.get(E0.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(E0.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(E0.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(E0.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get(dp.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get(dp.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(E0.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(E0.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get(dp.id)?.find(m=>m.name==="create_file");if(c){let m=e.get(dp.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(E0.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(E0.id),g=m?.indexOf(l)??-1;g>=0&&m?.splice(g,1)}let u=new Map;r&&o&&u.set(r.nameForModel,r),n&&o&&u.set(n.nameForModel,n),s&&c&&u.set(s.nameForModel,s),l&&o&&c&&u.set(l.nameForModel,l);let d=e.get(dp.id)??[],f=e.get(E0.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==E0.id&&m!==dp.id).flatMap(([,m])=>m);return d.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),f.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),h.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),u}async updateToolStatusByName(e,r,n){let o=this.guessTool(e,r);o.length!==0&&await this.doUpdateToolStatus(e,o,n)}async updateToolStatus(e,r,n){let o=this.getToolsToUpdate(r);o.length!==0&&await this.doUpdateToolStatus(e,o,n)}async doUpdateToolStatus(e,r,n){let o;Array.isArray(r)?o=r:o=[r],await this.doUpdateToolsStatus(e,o.map(s=>({tool:s,status:n})))}async updateToolsStatusByName(e,r){let n=r.flatMap(({toolName:o,status:s})=>this.guessTool(e,o).map(l=>({tool:l,status:s})));await this.doUpdateToolsStatus(e,n)}async updateToolsStatus(e,r){let n=r.flatMap(({toolId:o,status:s})=>this.getToolsToUpdate(o).map(l=>({tool:l,status:s})));await this.doUpdateToolsStatus(e,n)}async doUpdateToolsStatus(e,r){let n=r.map(({tool:c,status:l})=>this.prepareUpdateToolStatus(e,c,l)).flat();function o(c){return c.shouldUpdate?c.shouldUpdate():!0}a(o,"shouldUpdate");let s=new Map;for(let c of n)!c||!o(c)||(c.type==="memory"?c.tool.status=c.status:c.type==="customAgent"&&(s.has(c.customAgent.id)||s.set(c.customAgent.id,{agent:c.customAgent,options:[]}),s.get(c.customAgent.id).options.push({toolConfigurationKey:c.tool.configurationKey,status:c.status})));if(s.size>0){let c=this.ctx.get(Kd);for(let[l,{agent:u,options:d}]of s)await c.updateCustomAgent(u,{updateToolOptions:d})}}guessTool(e,r){let n=this._toolRegistry.listTools().filter(o=>o.name===r);if(!kwe(e)){let o=new Set,s=[];for(let c of n)o.has(c.configurationKey)||(o.add(c.configurationKey),s.push(c));return s}if(r==="insert_edit_into_file"||r==="replace_string_in_file"){let o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===E0.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===dp.id&&c.name==="insert_edit_into_file");return o&&s?[o,s]:[]}return n.length===0?[]:n.length===1||n.length===2&&n.every(o=>o.toolProvider.id===E0.id||o.toolProvider.id===dp.id)?n:[]}getToolsToUpdate(e){let r=this._toolRegistry.getTool(e);if(!r)return[];if((r.name==="insert_edit_into_file"||r.name==="replace_string_in_file")&&r.toolProvider.id===E0.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===dp.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(kwe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===dp.id?[this.prepareUpdateEditorEditFileToolStatus(r,n)]:[{type:"memory",tool:r,status:n}];if(e.source&&!e.source.isReadonly){let o=e.source;return!o.tools||(o.tools.some(c=>c==r?.configurationKey)?"enabled":"disabled")===n?void 0:[{type:"customAgent",customAgent:o,tool:r,status:n}]}}prepareUpdateEditorEditFileToolStatus(e,r){if(r==="enabled")return{type:"memory",tool:e,status:"enabled"};let n=this._toolRegistry.listTools().find(c=>c.toolProvider.id===E0.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===E0.id&&c.name==="replace_string_in_file");function s(c){return!c||c.status==="disabled"}return a(s,"isToolDisabled"),{type:"memory",tool:e,status:"disabled",shouldUpdate:a(()=>s(n)&&s(o),"shouldUpdate")}}};p();var Bj=class extends Nq{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:dp,type:"client"}),this.confirmationMessages=e.confirmationMessages}prepareInvocation(e,r){return{progressMessage:`Running ${this.name} tool`,confirmationMessages:this.confirmationMessages}}prepareCompletion(e,r){return{completionMessage:`Ran ${this.name} tool`}}async invoke(e,r,n){let o={name:this.name,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId};try{return await e.ctx.get(tv).invokeClientTool(e,o)}catch(s){throw new Error(`Failed to invoke client tool ${this.name}: ${String(s)}`)}}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new zc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations,toolMetadata:r.toolMetadata};try{return await e.ctx.get(ef).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var P={};Ti(P,{$brand:()=>CKt,$input:()=>LXt,$output:()=>OXt,NEVER:()=>Pke,TimePrecision:()=>QXt,ZodAny:()=>Itr,ZodArray:()=>ktr,ZodBase64:()=>jit,ZodBase64URL:()=>Hit,ZodBigInt:()=>rpe,ZodBigIntFormat:()=>Vit,ZodBoolean:()=>tpe,ZodCIDRv4:()=>Qit,ZodCIDRv6:()=>qit,ZodCUID:()=>Nit,ZodCUID2:()=>Mit,ZodCatch:()=>Ktr,ZodCodec:()=>hPe,ZodCustom:()=>mPe,ZodCustomStringFormat:()=>Xfe,ZodDate:()=>lPe,ZodDefault:()=>Gtr,ZodDiscriminatedUnion:()=>Dtr,ZodE164:()=>Git,ZodEmail:()=>Rit,ZodEmoji:()=>Pit,ZodEnum:()=>Jfe,ZodError:()=>Rhs,ZodExactOptional:()=>qtr,ZodFile:()=>Utr,ZodFirstPartyTypeKind:()=>urr,ZodFunction:()=>arr,ZodGUID:()=>iPe,ZodIPv4:()=>Fit,ZodIPv6:()=>Uit,ZodISODate:()=>bit,ZodISODateTime:()=>Cit,ZodISODuration:()=>Tit,ZodISOTime:()=>Sit,ZodIntersection:()=>Ntr,ZodIssueCode:()=>drr,ZodJWT:()=>$it,ZodKSUID:()=>Bit,ZodLazy:()=>irr,ZodLiteral:()=>Ftr,ZodMAC:()=>Ctr,ZodMap:()=>Ltr,ZodNaN:()=>Ztr,ZodNanoID:()=>Dit,ZodNever:()=>wtr,ZodNonOptional:()=>Jit,ZodNull:()=>Ttr,ZodNullable:()=>Htr,ZodNumber:()=>epe,ZodNumberFormat:()=>MZ,ZodObject:()=>uPe,ZodOptional:()=>Kit,ZodPipe:()=>pPe,ZodPrefault:()=>Vtr,ZodPreprocess:()=>Xtr,ZodPromise:()=>srr,ZodReadonly:()=>trr,ZodRealError:()=>Tb,ZodRecord:()=>Kfe,ZodSet:()=>Btr,ZodString:()=>Zfe,ZodStringFormat:()=>Bl,ZodSuccess:()=>Ytr,ZodSymbol:()=>btr,ZodTemplateLiteral:()=>nrr,ZodTransform:()=>Qtr,ZodTuple:()=>Mtr,ZodType:()=>rs,ZodULID:()=>Oit,ZodURL:()=>aPe,ZodUUID:()=>H5,ZodUndefined:()=>Str,ZodUnion:()=>dPe,ZodUnknown:()=>xtr,ZodVoid:()=>Rtr,ZodXID:()=>Lit,ZodXor:()=>Ptr,_ZodString:()=>wit,_default:()=>$tr,_function:()=>e4n,any:()=>Wit,array:()=>Qr,base64:()=>_5n,base64url:()=>E5n,bigint:()=>P5n,boolean:()=>Zc,catch:()=>Jtr,check:()=>t4n,cidrv4:()=>A5n,cidrv6:()=>y5n,clone:()=>_v,codec:()=>K5n,coerce:()=>APe,config:()=>Ep,core:()=>o8,cuid:()=>l5n,cuid2:()=>u5n,custom:()=>Zit,date:()=>B5n,decode:()=>mtr,decodeAsync:()=>Atr,describe:()=>r4n,discriminatedUnion:()=>fPe,e164:()=>v5n,email:()=>e5n,emoji:()=>a5n,encode:()=>htr,encodeAsync:()=>gtr,endsWith:()=>qfe,enum:()=>XA,exactOptional:()=>jtr,file:()=>V5n,flattenError:()=>Uke,float32:()=>x5n,float64:()=>w5n,formatError:()=>Qke,fromJSONSchema:()=>c4n,function:()=>e4n,getErrorMap:()=>Dhs,globalRegistry:()=>ZA,gt:()=>q5,gte:()=>vv,guid:()=>t5n,hash:()=>I5n,hex:()=>T5n,hostname:()=>S5n,httpUrl:()=>s5n,includes:()=>Ufe,instanceof:()=>i4n,int:()=>Iit,int32:()=>R5n,int64:()=>D5n,intersection:()=>npe,invertCodec:()=>J5n,ipv4:()=>h5n,ipv6:()=>g5n,iso:()=>zj,json:()=>s4n,jwt:()=>C5n,keyof:()=>F5n,ksuid:()=>p5n,lazy:()=>orr,length:()=>NZ,literal:()=>zn,locales:()=>ePe,looseObject:()=>gh,looseRecord:()=>j5n,lowercase:()=>Bfe,lt:()=>Q5,lte:()=>DT,mac:()=>m5n,map:()=>H5n,maxLength:()=>DZ,maxSize:()=>Gj,meta:()=>n4n,mime:()=>jfe,minLength:()=>i8,minSize:()=>j5,multipleOf:()=>Hj,nan:()=>Y5n,nanoid:()=>c5n,nativeEnum:()=>$5n,negative:()=>fit,never:()=>zit,nonnegative:()=>hit,nonoptional:()=>ztr,nonpositive:()=>pit,normalize:()=>Hfe,null:()=>cPe,nullable:()=>oPe,nullish:()=>W5n,number:()=>ya,object:()=>Yr,optional:()=>ou,overwrite:()=>U2,parse:()=>utr,parseAsync:()=>dtr,partialRecord:()=>q5n,pipe:()=>xit,positive:()=>dit,prefault:()=>Wtr,preprocess:()=>gPe,prettifyError:()=>OKt,promise:()=>X5n,property:()=>mit,readonly:()=>rrr,record:()=>ml,refine:()=>crr,regex:()=>Lfe,regexes:()=>PT,registry:()=>Gnt,safeDecode:()=>_tr,safeDecodeAsync:()=>vtr,safeEncode:()=>ytr,safeEncodeAsync:()=>Etr,safeParse:()=>ftr,safeParseAsync:()=>ptr,set:()=>G5n,setErrorMap:()=>Phs,size:()=>PZ,slugify:()=>Wfe,startsWith:()=>Qfe,strictObject:()=>U5n,string:()=>Xe,stringFormat:()=>b5n,stringbool:()=>o4n,success:()=>z5n,superRefine:()=>lrr,symbol:()=>M5n,templateLiteral:()=>Z5n,toJSONSchema:()=>_it,toLowerCase:()=>$fe,toUpperCase:()=>Vfe,transform:()=>Yit,treeifyError:()=>MKt,trim:()=>Gfe,tuple:()=>Otr,uint32:()=>k5n,uint64:()=>N5n,ulid:()=>d5n,undefined:()=>O5n,union:()=>Ul,unknown:()=>Fl,uppercase:()=>Ffe,url:()=>kit,util:()=>lr,uuid:()=>r5n,uuidv4:()=>n5n,uuidv6:()=>i5n,uuidv7:()=>o5n,void:()=>L5n,xid:()=>f5n,xor:()=>Q5n});p();var o8={};Ti(o8,{$ZodAny:()=>cZt,$ZodArray:()=>pZt,$ZodAsyncError:()=>F2,$ZodBase64:()=>ZJt,$ZodBase64URL:()=>XJt,$ZodBigInt:()=>Unt,$ZodBigIntFormat:()=>iZt,$ZodBoolean:()=>Wke,$ZodCIDRv4:()=>YJt,$ZodCIDRv6:()=>KJt,$ZodCUID:()=>BJt,$ZodCUID2:()=>FJt,$ZodCatch:()=>PZt,$ZodCheck:()=>iu,$ZodCheckBigIntFormat:()=>pJt,$ZodCheckEndsWith:()=>TJt,$ZodCheckGreaterThan:()=>Nnt,$ZodCheckIncludes:()=>bJt,$ZodCheckLengthEquals:()=>_Jt,$ZodCheckLessThan:()=>Dnt,$ZodCheckLowerCase:()=>vJt,$ZodCheckMaxLength:()=>AJt,$ZodCheckMaxSize:()=>hJt,$ZodCheckMimeType:()=>xJt,$ZodCheckMinLength:()=>yJt,$ZodCheckMinSize:()=>mJt,$ZodCheckMultipleOf:()=>dJt,$ZodCheckNumberFormat:()=>fJt,$ZodCheckOverwrite:()=>wJt,$ZodCheckProperty:()=>IJt,$ZodCheckRegex:()=>EJt,$ZodCheckSizeEquals:()=>gJt,$ZodCheckStartsWith:()=>SJt,$ZodCheckStringFormat:()=>Mfe,$ZodCheckUpperCase:()=>CJt,$ZodCodec:()=>Yke,$ZodCustom:()=>UZt,$ZodCustomStringFormat:()=>rZt,$ZodDate:()=>fZt,$ZodDefault:()=>xZt,$ZodDiscriminatedUnion:()=>gZt,$ZodE164:()=>eZt,$ZodEmail:()=>NJt,$ZodEmoji:()=>OJt,$ZodEncodeError:()=>Fj,$ZodEnum:()=>vZt,$ZodError:()=>Fke,$ZodExactOptional:()=>TZt,$ZodFile:()=>bZt,$ZodFunction:()=>LZt,$ZodGUID:()=>PJt,$ZodIPv4:()=>VJt,$ZodIPv6:()=>WJt,$ZodISODate:()=>HJt,$ZodISODateTime:()=>jJt,$ZodISODuration:()=>$Jt,$ZodISOTime:()=>GJt,$ZodIntersection:()=>AZt,$ZodJWT:()=>tZt,$ZodKSUID:()=>qJt,$ZodLazy:()=>FZt,$ZodLiteral:()=>CZt,$ZodMAC:()=>zJt,$ZodMap:()=>_Zt,$ZodNaN:()=>DZt,$ZodNanoID:()=>LJt,$ZodNever:()=>uZt,$ZodNonOptional:()=>RZt,$ZodNull:()=>aZt,$ZodNullable:()=>IZt,$ZodNumber:()=>Fnt,$ZodNumberFormat:()=>nZt,$ZodObject:()=>GOn,$ZodObjectJIT:()=>hZt,$ZodOptional:()=>qnt,$ZodPipe:()=>jnt,$ZodPrefault:()=>wZt,$ZodPreprocess:()=>NZt,$ZodPromise:()=>BZt,$ZodReadonly:()=>MZt,$ZodRealError:()=>Sb,$ZodRecord:()=>yZt,$ZodRegistry:()=>Hnt,$ZodSet:()=>EZt,$ZodString:()=>kZ,$ZodStringFormat:()=>Ll,$ZodSuccess:()=>kZt,$ZodSymbol:()=>oZt,$ZodTemplateLiteral:()=>OZt,$ZodTransform:()=>SZt,$ZodTuple:()=>Qnt,$ZodType:()=>po,$ZodULID:()=>UJt,$ZodURL:()=>MJt,$ZodUUID:()=>DJt,$ZodUndefined:()=>sZt,$ZodUnion:()=>zke,$ZodUnknown:()=>lZt,$ZodVoid:()=>dZt,$ZodXID:()=>QJt,$ZodXor:()=>mZt,$brand:()=>CKt,$constructor:()=>ct,$input:()=>LXt,$output:()=>OXt,Doc:()=>Vke,JSONSchema:()=>JOn,JSONSchemaGenerator:()=>Eit,NEVER:()=>Pke,TimePrecision:()=>QXt,_any:()=>aer,_array:()=>her,_base64:()=>ait,_base64url:()=>cit,_bigint:()=>eer,_boolean:()=>ZXt,_catch:()=>vhs,_check:()=>KOn,_cidrv4:()=>oit,_cidrv6:()=>sit,_coercedBigint:()=>ter,_coercedBoolean:()=>XXt,_coercedDate:()=>fer,_coercedNumber:()=>VXt,_coercedString:()=>FXt,_cuid:()=>Znt,_cuid2:()=>Xnt,_custom:()=>ger,_date:()=>der,_decode:()=>bnt,_decodeAsync:()=>Tnt,_default:()=>yhs,_discriminatedUnion:()=>shs,_e164:()=>lit,_email:()=>$nt,_emoji:()=>Knt,_encode:()=>Cnt,_encodeAsync:()=>Snt,_endsWith:()=>qfe,_enum:()=>fhs,_file:()=>mer,_float32:()=>zXt,_float64:()=>YXt,_gt:()=>q5,_gte:()=>vv,_guid:()=>tPe,_includes:()=>Ufe,_int:()=>WXt,_int32:()=>KXt,_int64:()=>rer,_intersection:()=>ahs,_ipv4:()=>nit,_ipv6:()=>iit,_isoDate:()=>jXt,_isoDateTime:()=>qXt,_isoDuration:()=>GXt,_isoTime:()=>HXt,_jwt:()=>uit,_ksuid:()=>rit,_lazy:()=>Ths,_length:()=>NZ,_literal:()=>hhs,_lowercase:()=>Bfe,_lt:()=>Q5,_lte:()=>DT,_mac:()=>UXt,_map:()=>uhs,_max:()=>DT,_maxLength:()=>DZ,_maxSize:()=>Gj,_mime:()=>jfe,_min:()=>vv,_minLength:()=>i8,_minSize:()=>j5,_multipleOf:()=>Hj,_nan:()=>per,_nanoid:()=>Jnt,_nativeEnum:()=>phs,_negative:()=>fit,_never:()=>ler,_nonnegative:()=>hit,_nonoptional:()=>_hs,_nonpositive:()=>pit,_normalize:()=>Hfe,_null:()=>ser,_nullable:()=>Ahs,_number:()=>$Xt,_optional:()=>ghs,_overwrite:()=>U2,_parse:()=>Rfe,_parseAsync:()=>kfe,_pipe:()=>Chs,_positive:()=>dit,_promise:()=>Ihs,_property:()=>mit,_readonly:()=>bhs,_record:()=>lhs,_refine:()=>Aer,_regex:()=>Lfe,_safeDecode:()=>xnt,_safeDecodeAsync:()=>Rnt,_safeEncode:()=>Int,_safeEncodeAsync:()=>wnt,_safeParse:()=>Pfe,_safeParseAsync:()=>Nfe,_set:()=>dhs,_size:()=>PZ,_slugify:()=>Wfe,_startsWith:()=>Qfe,_string:()=>BXt,_stringFormat:()=>zfe,_stringbool:()=>ver,_success:()=>Ehs,_superRefine:()=>yer,_symbol:()=>ier,_templateLiteral:()=>Shs,_toLowerCase:()=>$fe,_toUpperCase:()=>Vfe,_transform:()=>mhs,_trim:()=>Gfe,_tuple:()=>chs,_uint32:()=>JXt,_uint64:()=>ner,_ulid:()=>eit,_undefined:()=>oer,_union:()=>ihs,_unknown:()=>cer,_uppercase:()=>Ffe,_url:()=>rPe,_uuid:()=>Vnt,_uuidv4:()=>Wnt,_uuidv6:()=>znt,_uuidv7:()=>Ynt,_void:()=>uer,_xid:()=>tit,_xor:()=>ohs,clone:()=>_v,config:()=>Ep,createStandardJSONSchemaMethod:()=>Yfe,createToJSONSchemaMethod:()=>Cer,decode:()=>pOn,decodeAsync:()=>mOn,describe:()=>_er,encode:()=>fOn,encodeAsync:()=>hOn,extractDefs:()=>Vj,finalize:()=>Wj,flattenError:()=>Uke,formatError:()=>Qke,globalConfig:()=>xZ,globalRegistry:()=>ZA,initializeContext:()=>$j,isValidBase64:()=>JJt,isValidBase64URL:()=>QOn,isValidJWT:()=>qOn,locales:()=>ePe,meta:()=>Eer,parse:()=>qke,parseAsync:()=>jke,prettifyError:()=>OKt,process:()=>Jc,regexes:()=>PT,registry:()=>Gnt,safeDecode:()=>AOn,safeDecodeAsync:()=>_On,safeEncode:()=>gOn,safeEncodeAsync:()=>yOn,safeParse:()=>Dfe,safeParseAsync:()=>Hke,toDotPath:()=>dOn,toJSONSchema:()=>_it,treeifyError:()=>MKt,util:()=>lr,version:()=>RJt});p();p();var sOn,Pke=Object.freeze({status:"aborted"});function ct(t,e,r){function n(l,u){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:u,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(t))return;l._zod.traits.add(t),e(l,u);let d=c.prototype,f=Object.keys(d);for(let h=0;hr?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}a(ct,"$constructor");var CKt=Symbol("zod_brand"),F2=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Fj=class extends Error{static{a(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(sOn=globalThis).__zod_globalConfig??(sOn.__zod_globalConfig={});var xZ=globalThis.__zod_globalConfig;function Ep(t){return t&&Object.assign(xZ,t),xZ}a(Ep,"config");p();p();var lr={};Ti(lr,{BIGINT_FORMAT_RANGES:()=>DKt,Class:()=>SKt,NUMBER_FORMAT_RANGES:()=>PKt,aborted:()=>jj,allowsEval:()=>xKt,assert:()=>dfs,assertEqual:()=>afs,assertIs:()=>lfs,assertNever:()=>ufs,assertNotEqual:()=>cfs,assignProp:()=>Qj,base64ToUint8Array:()=>cOn,base64urlToUint8Array:()=>wfs,cached:()=>xfe,captureStackTrace:()=>vnt,cleanEnum:()=>xfs,cleanRegex:()=>Mke,clone:()=>_v,cloneDef:()=>pfs,createTransparentProxy:()=>_fs,defineLazy:()=>Ls,esc:()=>Ent,escapeRegex:()=>Gw,explicitlyAborted:()=>NKt,extend:()=>Cfs,finalizeIssue:()=>Ev,floatSafeRemainder:()=>TKt,getElementAtPath:()=>hfs,getEnumValues:()=>Nke,getLengthableOrigin:()=>Bke,getParsedType:()=>yfs,getSizableOrigin:()=>Lke,hexToUint8Array:()=>kfs,isObject:()=>wZ,isPlainObject:()=>qj,issue:()=>wfe,joinValues:()=>_t,jsonStringifyReplacer:()=>Ife,merge:()=>Sfs,mergeDefs:()=>n8,normalizeParams:()=>br,nullish:()=>Uj,numKeys:()=>Afs,objectClone:()=>ffs,omit:()=>vfs,optionalKeys:()=>kKt,parsedType:()=>nr,partial:()=>Tfs,pick:()=>Efs,prefixIssues:()=>bb,primitiveTypes:()=>RKt,promiseAllObject:()=>mfs,propertyKeyTypes:()=>Oke,randomString:()=>gfs,required:()=>Ifs,safeExtend:()=>bfs,shallowClone:()=>wKt,slugify:()=>IKt,stringifyPrimitive:()=>Zt,uint8ArrayToBase64:()=>lOn,uint8ArrayToBase64url:()=>Rfs,uint8ArrayToHex:()=>Pfs,unwrapMessage:()=>Dke});p();function afs(t){return t}a(afs,"assertEqual");function cfs(t){return t}a(cfs,"assertNotEqual");function lfs(t){}a(lfs,"assertIs");function ufs(t){throw new Error("Unexpected value in exhaustive check")}a(ufs,"assertNever");function dfs(t){}a(dfs,"assert");function Nke(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}a(Nke,"getEnumValues");function _t(t,e="|"){return t.map(r=>Zt(r)).join(e)}a(_t,"joinValues");function Ife(t,e){return typeof e=="bigint"?e.toString():e}a(Ife,"jsonStringifyReplacer");function xfe(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(xfe,"cached");function Uj(t){return t==null}a(Uj,"nullish");function Mke(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(Mke,"cleanRegex");function TKt(t,e){let r=t/e,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)r?.[n],t):t}a(hfs,"getElementAtPath");function mfs(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s{};function wZ(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(wZ,"isObject");var xKt=xfe(()=>{if(xZ.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function qj(t){if(wZ(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(wZ(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(qj,"isPlainObject");function wKt(t){return qj(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}a(wKt,"shallowClone");function Afs(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(Afs,"numKeys");var yfs=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},"getParsedType"),Oke=new Set(["string","number","symbol"]),RKt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Gw(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Gw,"escapeRegex");function _v(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(_v,"clone");function br(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:a(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}a(br,"normalizeParams");function _fs(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}a(_fs,"createTransparentProxy");function Zt(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Zt,"stringifyPrimitive");function kKt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(kKt,"optionalKeys");var PKt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},DKt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Efs(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=n8(t._zod.def,{get shape(){let c={};for(let l in e){if(!(l in r.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&(c[l]=r.shape[l])}return Qj(this,"shape",c),c},checks:[]});return _v(t,s)}a(Efs,"pick");function vfs(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=n8(t._zod.def,{get shape(){let c={...t._zod.def.shape};for(let l in e){if(!(l in r.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&delete c[l]}return Qj(this,"shape",c),c},checks:[]});return _v(t,s)}a(vfs,"omit");function Cfs(t,e){if(!qj(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let s=t._zod.def.shape;for(let c in e)if(Object.getOwnPropertyDescriptor(s,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=n8(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return Qj(this,"shape",s),s}});return _v(t,o)}a(Cfs,"extend");function bfs(t,e){if(!qj(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=n8(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return Qj(this,"shape",n),n}});return _v(t,r)}a(bfs,"safeExtend");function Sfs(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=n8(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return Qj(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return _v(t,r)}a(Sfs,"merge");function Tfs(t,e,r){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let c=n8(e._zod.def,{get shape(){let l=e._zod.def.shape,u={...l};if(r)for(let d in r){if(!(d in l))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(u[d]=t?new t({type:"optional",innerType:l[d]}):l[d])}else for(let d in l)u[d]=t?new t({type:"optional",innerType:l[d]}):l[d];return Qj(this,"shape",u),u},checks:[]});return _v(e,c)}a(Tfs,"partial");function Ifs(t,e,r){let n=n8(e._zod.def,{get shape(){let o=e._zod.def.shape,s={...o};if(r)for(let c in r){if(!(c in s))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(s[c]=new t({type:"nonoptional",innerType:o[c]}))}else for(let c in o)s[c]=new t({type:"nonoptional",innerType:o[c]});return Qj(this,"shape",s),s}});return _v(e,n)}a(Ifs,"required");function jj(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(bb,"prefixIssues");function Dke(t){return typeof t=="string"?t:t?.message}a(Dke,"unwrapMessage");function Ev(t,e,r){let n=t.message?t.message:Dke(t.inst?._zod.def?.error?.(t))??Dke(e?.error?.(t))??Dke(r.customError?.(t))??Dke(r.localeError?.(t))??"Invalid input",{inst:o,continue:s,input:c,...l}=t;return l.path??(l.path=[]),l.message=n,e?.reportInput&&(l.input=c),l}a(Ev,"finalizeIssue");function Lke(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(Lke,"getSizableOrigin");function Bke(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(Bke,"getLengthableOrigin");function nr(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}a(nr,"parsedType");function wfe(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(wfe,"issue");function xfs(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(xfs,"cleanEnum");function cOn(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;ne.toString(16).padStart(2,"0")).join("")}a(Pfs,"uint8ArrayToHex");var SKt=class{static{a(this,"Class")}constructor(...e){}};var uOn=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Ife,2),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),Fke=ct("$ZodError",uOn),Sb=ct("$ZodError",uOn,{Parent:Error});function Uke(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}a(Uke,"flattenError");function Qke(t,e=r=>r.message){let r={_errors:[]},n=a((o,s=[])=>{for(let c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>n({issues:l},[...s,...c.path]));else if(c.code==="invalid_key")n({issues:c.issues},[...s,...c.path]);else if(c.code==="invalid_element")n({issues:c.issues},[...s,...c.path]);else{let l=[...s,...c.path];if(l.length===0)r._errors.push(e(c));else{let u=r,d=0;for(;dr.message){let r={errors:[]},n=a((o,s=[])=>{var c,l;for(let u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>n({issues:d},[...s,...u.path]));else if(u.code==="invalid_key")n({issues:u.issues},[...s,...u.path]);else if(u.code==="invalid_element")n({issues:u.issues},[...s,...u.path]);else{let d=[...s,...u.path];if(d.length===0){r.errors.push(e(u));continue}let f=r,h=0;for(;htypeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}a(dOn,"toDotPath");function OKt(t){let e=[],r=[...t.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${dOn(n.path)}`);return e.join(` +`)}a(OKt,"prettifyError");var Rfe=a(t=>(e,r,n,o)=>{let s=n?{...n,async:!1}:{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new F2;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>Ev(u,s,Ep())));throw vnt(l,o?.callee),l}return c.value},"_parse"),qke=Rfe(Sb),kfe=a(t=>async(e,r,n,o)=>{let s=n?{...n,async:!0}:{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>Ev(u,s,Ep())));throw vnt(l,o?.callee),l}return c.value},"_parseAsync"),jke=kfe(Sb),Pfe=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new F2;return s.issues.length?{success:!1,error:new(t??Fke)(s.issues.map(c=>Ev(c,o,Ep())))}:{success:!0,data:s.value}},"_safeParse"),Dfe=Pfe(Sb),Nfe=a(t=>async(e,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>Ev(c,o,Ep())))}:{success:!0,data:s.value}},"_safeParseAsync"),Hke=Nfe(Sb),Cnt=a(t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Rfe(t)(e,r,o)},"_encode"),fOn=Cnt(Sb),bnt=a(t=>(e,r,n)=>Rfe(t)(e,r,n),"_decode"),pOn=bnt(Sb),Snt=a(t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return kfe(t)(e,r,o)},"_encodeAsync"),hOn=Snt(Sb),Tnt=a(t=>async(e,r,n)=>kfe(t)(e,r,n),"_decodeAsync"),mOn=Tnt(Sb),Int=a(t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Pfe(t)(e,r,o)},"_safeEncode"),gOn=Int(Sb),xnt=a(t=>(e,r,n)=>Pfe(t)(e,r,n),"_safeDecode"),AOn=xnt(Sb),wnt=a(t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Nfe(t)(e,r,o)},"_safeEncodeAsync"),yOn=wnt(Sb),Rnt=a(t=>async(e,r,n)=>Nfe(t)(e,r,n),"_safeDecodeAsync"),_On=Rnt(Sb);p();p();var PT={};Ti(PT,{base64:()=>JKt,base64url:()=>knt,bigint:()=>iJt,boolean:()=>sJt,browserEmail:()=>Qfs,cidrv4:()=>YKt,cidrv6:()=>KKt,cuid:()=>LKt,cuid2:()=>BKt,date:()=>eJt,datetime:()=>rJt,domain:()=>Hfs,duration:()=>jKt,e164:()=>XKt,email:()=>GKt,emoji:()=>$Kt,extendedDuration:()=>Nfs,guid:()=>HKt,hex:()=>Gfs,hostname:()=>jfs,html5Email:()=>Bfs,httpProtocol:()=>ZKt,idnEmail:()=>Ufs,integer:()=>oJt,ipv4:()=>VKt,ipv6:()=>WKt,ksuid:()=>QKt,lowercase:()=>lJt,mac:()=>zKt,md5_base64:()=>Vfs,md5_base64url:()=>Wfs,md5_hex:()=>$fs,nanoid:()=>qKt,null:()=>aJt,number:()=>Pnt,rfc5322Email:()=>Ffs,sha1_base64:()=>Yfs,sha1_base64url:()=>Kfs,sha1_hex:()=>zfs,sha256_base64:()=>Zfs,sha256_base64url:()=>Xfs,sha256_hex:()=>Jfs,sha384_base64:()=>tps,sha384_base64url:()=>rps,sha384_hex:()=>eps,sha512_base64:()=>ips,sha512_base64url:()=>ops,sha512_hex:()=>nps,string:()=>nJt,time:()=>tJt,ulid:()=>FKt,undefined:()=>cJt,unicodeEmail:()=>EOn,uppercase:()=>uJt,uuid:()=>RZ,uuid4:()=>Mfs,uuid6:()=>Ofs,uuid7:()=>Lfs,xid:()=>UKt});p();var LKt=/^[cC][0-9a-z]{6,}$/,BKt=/^[0-9a-z]+$/,FKt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,UKt=/^[0-9a-vA-V]{20}$/,QKt=/^[A-Za-z0-9]{27}$/,qKt=/^[a-zA-Z0-9_-]{21}$/,jKt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Nfs=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,HKt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,RZ=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),Mfs=RZ(4),Ofs=RZ(6),Lfs=RZ(7),GKt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Bfs=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ffs=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,EOn=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Ufs=EOn,Qfs=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,qfs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function $Kt(){return new RegExp(qfs,"u")}a($Kt,"emoji");var VKt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,WKt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,zKt=a(t=>{let e=Gw(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},"mac"),YKt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,KKt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,JKt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,knt=/^[A-Za-z0-9_-]*$/,jfs=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Hfs=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ZKt=/^https?$/,XKt=/^\+[1-9]\d{6,14}$/,vOn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",eJt=new RegExp(`^${vOn}$`);function COn(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(COn,"timeSource");function tJt(t){return new RegExp(`^${COn(t)}$`)}a(tJt,"time");function rJt(t){let e=COn({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${vOn}T(?:${n})$`)}a(rJt,"datetime");var nJt=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),iJt=/^-?\d+n?$/,oJt=/^-?\d+$/,Pnt=/^-?\d+(?:\.\d+)?$/,sJt=/^(?:true|false)$/i,aJt=/^null$/i;var cJt=/^undefined$/i;var lJt=/^[^A-Z]*$/,uJt=/^[^a-z]*$/,Gfs=/^[0-9a-fA-F]*$/;function Gke(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}a(Gke,"fixedBase64");function $ke(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}a($ke,"fixedBase64url");var $fs=/^[0-9a-fA-F]{32}$/,Vfs=Gke(22,"=="),Wfs=$ke(22),zfs=/^[0-9a-fA-F]{40}$/,Yfs=Gke(27,"="),Kfs=$ke(27),Jfs=/^[0-9a-fA-F]{64}$/,Zfs=Gke(43,"="),Xfs=$ke(43),eps=/^[0-9a-fA-F]{96}$/,tps=Gke(64,""),rps=$ke(64),nps=/^[0-9a-fA-F]{128}$/,ips=Gke(86,"=="),ops=$ke(86);var iu=ct("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),SOn={number:"number",bigint:"bigint",object:"date"},Dnt=ct("$ZodCheckLessThan",(t,e)=>{iu.init(t,e);let r=SOn[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{iu.init(t,e);let r=SOn[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),dJt=ct("$ZodCheckMultipleOf",(t,e)=>{iu.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):TKt(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),fJt=ct("$ZodCheckNumberFormat",(t,e)=>{iu.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=PKt[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=o,l.maximum=s,r&&(l.pattern=oJt)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}ls&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}}),pJt=ct("$ZodCheckBigIntFormat",(t,e)=>{iu.init(t,e);let[r,n]=DKt[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=r,s.maximum=n}),t._zod.check=o=>{let s=o.value;sn&&o.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inclusive:!0,inst:t,continue:!e.abort})}}),hJt=ct("$ZodCheckMaxSize",(t,e)=>{var r;iu.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uj(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;o.size<=e.maximum||n.issues.push({origin:Lke(o),code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),mJt=ct("$ZodCheckMinSize",(t,e)=>{var r;iu.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uj(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;o.size>=e.minimum||n.issues.push({origin:Lke(o),code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),gJt=ct("$ZodCheckSizeEquals",(t,e)=>{var r;iu.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uj(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.size,o.maximum=e.size,o.size=e.size}),t._zod.check=n=>{let o=n.value,s=o.size;if(s===e.size)return;let c=s>e.size;n.issues.push({origin:Lke(o),...c?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),AJt=ct("$ZodCheckMaxLength",(t,e)=>{var r;iu.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uj(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;if(o.length<=e.maximum)return;let c=Bke(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),yJt=ct("$ZodCheckMinLength",(t,e)=>{var r;iu.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uj(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let c=Bke(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),_Jt=ct("$ZodCheckLengthEquals",(t,e)=>{var r;iu.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uj(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let c=Bke(o),l=s>e.length;n.issues.push({origin:c,...l?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),Mfe=ct("$ZodCheckStringFormat",(t,e)=>{var r,n;iu.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),EJt=ct("$ZodCheckRegex",(t,e)=>{Mfe.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),vJt=ct("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=lJt),Mfe.init(t,e)}),CJt=ct("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=uJt),Mfe.init(t,e)}),bJt=ct("$ZodCheckIncludes",(t,e)=>{iu.init(t,e);let r=Gw(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),SJt=ct("$ZodCheckStartsWith",(t,e)=>{iu.init(t,e);let r=new RegExp(`^${Gw(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),TJt=ct("$ZodCheckEndsWith",(t,e)=>{iu.init(t,e);let r=new RegExp(`.*${Gw(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});function bOn(t,e,r){t.issues.length&&e.issues.push(...bb(r,t.issues))}a(bOn,"handleCheckPropertyResult");var IJt=ct("$ZodCheckProperty",(t,e)=>{iu.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>bOn(o,r,e.property));bOn(n,r,e.property)}}),xJt=ct("$ZodCheckMimeType",(t,e)=>{iu.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t,continue:!e.abort})}}),wJt=ct("$ZodCheckOverwrite",(t,e)=>{iu.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var Vke=class{static{a(this,"Doc")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(` `).filter(c=>c),o=Math.min(...n.map(c=>c.length-c.trimStart().length)),s=n.map(c=>c.slice(o)).map(c=>" ".repeat(this.indent*2)+c);for(let c of s)this.content.push(c)}compile(){let e=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...r,o.join(` -`))}};p();var wJt={major:4,minor:4,patch:3};var po=ct("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=wJt;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((c,l,u)=>{let d=jj(c),f;for(let h of l){if(h._zod.def.when){if(DKt(c)||!h._zod.def.when(c))continue}else if(d)continue;let m=c.issues.length,g=h._zod.check(c);if(g instanceof Promise&&u?.async===!1)throw new F2;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,c.issues.length!==m&&(d||(d=jj(c,m)))});else{if(c.issues.length===m)continue;d||(d=jj(c,m))}}return f?f.then(()=>c):c},"runChecks"),s=a((c,l,u)=>{if(jj(c))return c.aborted=!0,c;let d=o(l,n,u);if(d instanceof Promise){if(u.async===!1)throw new F2;return d.then(f=>t._zod.parse(f,u))}return t._zod.parse(d,u)},"handleCanaryResult");t._zod.run=(c,l)=>{if(l.skipChecks)return t._zod.parse(c,l);if(l.direction==="backward"){let d=t._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return d instanceof Promise?d.then(f=>s(f,c,l)):s(d,c,l)}let u=t._zod.parse(c,l);if(u instanceof Promise){if(l.async===!1)throw new F2;return u.then(d=>o(d,n,l))}return o(u,n,l)}}Ls(t,"~standard",()=>({validate:a(o=>{try{let s=Pfe(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Hke(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),RZ=ct("$ZodString",(t,e)=>{po.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??rJt(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Ll=ct("$ZodStringFormat",(t,e)=>{Nfe.init(t,e),RZ.init(t,e)}),kJt=ct("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=jKt),Ll.init(t,e)}),PJt=ct("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=wZ(n))}else e.pattern??(e.pattern=wZ());Ll.init(t,e)}),DJt=ct("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=HKt),Ll.init(t,e)}),NJt=ct("$ZodURL",(t,e)=>{Ll.init(t,e),t._zod.check=r=>{try{let n=r.value.trim();if(!e.normalize&&e.protocol?.source===JKt.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let o=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),MJt=ct("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=GKt()),Ll.init(t,e)}),OJt=ct("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=QKt),Ll.init(t,e)}),LJt=ct("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=OKt),Ll.init(t,e)}),BJt=ct("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=LKt),Ll.init(t,e)}),FJt=ct("$ZodULID",(t,e)=>{e.pattern??(e.pattern=BKt),Ll.init(t,e)}),UJt=ct("$ZodXID",(t,e)=>{e.pattern??(e.pattern=FKt),Ll.init(t,e)}),QJt=ct("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=UKt),Ll.init(t,e)}),qJt=ct("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=tJt(e)),Ll.init(t,e)}),jJt=ct("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=XKt),Ll.init(t,e)}),HJt=ct("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=eJt(e)),Ll.init(t,e)}),GJt=ct("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=qKt),Ll.init(t,e)}),$Jt=ct("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=$Kt),Ll.init(t,e),t._zod.bag.format="ipv4"}),VJt=ct("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=VKt),Ll.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),WJt=ct("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=WKt(e.delimiter)),Ll.init(t,e),t._zod.bag.format="mac"}),zJt=ct("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=zKt),Ll.init(t,e)}),YJt=ct("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=YKt),Ll.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[o,s]=n;if(!s)throw new Error;let c=Number(s);if(`${c}`!==s)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function KJt(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(KJt,"isValidBase64");var JJt=ct("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=KKt),Ll.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{KJt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function UOn(t){if(!knt.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return KJt(r)}a(UOn,"isValidBase64URL");var ZJt=ct("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=knt),Ll.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{UOn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),XJt=ct("$ZodE164",(t,e)=>{e.pattern??(e.pattern=ZKt),Ll.init(t,e)});function QOn(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}a(QOn,"isValidJWT");var eZt=ct("$ZodJWT",(t,e)=>{Ll.init(t,e),t._zod.check=r=>{QOn(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),tZt=ct("$ZodCustomStringFormat",(t,e)=>{Ll.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),Fnt=ct("$ZodNumber",(t,e)=>{po.init(t,e),t._zod.pattern=t._zod.bag.pattern??Pnt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),rZt=ct("$ZodNumberFormat",(t,e)=>{dJt.init(t,e),Fnt.init(t,e)}),Wke=ct("$ZodBoolean",(t,e)=>{po.init(t,e),t._zod.pattern=oJt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),Unt=ct("$ZodBigInt",(t,e)=>{po.init(t,e),t._zod.pattern=nJt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),nZt=ct("$ZodBigIntFormat",(t,e)=>{fJt.init(t,e),Unt.init(t,e)}),iZt=ct("$ZodSymbol",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),oZt=ct("$ZodUndefined",(t,e)=>{po.init(t,e),t._zod.pattern=aJt,t._zod.values=new Set([void 0]),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),sZt=ct("$ZodNull",(t,e)=>{po.init(t,e),t._zod.pattern=sJt,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),aZt=ct("$ZodAny",(t,e)=>{po.init(t,e),t._zod.parse=r=>r}),cZt=ct("$ZodUnknown",(t,e)=>{po.init(t,e),t._zod.parse=r=>r}),lZt=ct("$ZodNever",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),uZt=ct("$ZodVoid",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),dZt=ct("$ZodDate",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});function TOn(t,e,r){t.issues.length&&e.issues.push(...bb(r,t.issues)),e.value[r]=t.value}a(TOn,"handleArrayResult");var fZt=ct("$ZodArray",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let c=0;cTOn(d,r,c))):TOn(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Bnt(t,e,r,n,o,s){let c=r in n;if(t.issues.length){if(o&&s&&!c)return;e.issues.push(...bb(r,t.issues))}if(!c&&!o){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?c&&(e.value[r]=void 0):e.value[r]=t.value}a(Bnt,"handlePropertyResult");function qOn(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=RKt(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}a(qOn,"normalizeDef");function jOn(t,e,r,n,o,s){let c=[],l=o.keySet,u=o.catchall._zod,d=u.def.type,f=u.optin==="optional",h=u.optout==="optional";for(let m in e){if(m==="__proto__"||l.has(m))continue;if(d==="never"){c.push(m);continue}let g=u.run({value:e[m],issues:[]},n);g instanceof Promise?t.push(g.then(A=>Bnt(A,r,m,e,f,h))):Bnt(g,r,m,e,f,h)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}a(jOn,"handleCatchall");var HOn=ct("$ZodObject",(t,e)=>{if(po.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let l=e.shape;Object.defineProperty(e,"shape",{get:a(()=>{let u={...l};return Object.defineProperty(e,"shape",{value:u}),u},"get")})}let n=Ife(()=>qOn(e));Ls(t._zod,"propValues",()=>{let l=e.shape,u={};for(let d in l){let f=l[d]._zod;if(f.values){u[d]??(u[d]=new Set);for(let h of f.values)u[d].add(h)}}return u});let o=xZ,s=e.catchall,c;t._zod.parse=(l,u)=>{c??(c=n.value);let d=l.value;if(!o(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),l;l.value={};let f=[],h=c.shape;for(let m of c.keys){let g=h[m],A=g._zod.optin==="optional",y=g._zod.optout==="optional",_=g._zod.run({value:d[m],issues:[]},u);_ instanceof Promise?f.push(_.then(E=>Bnt(E,l,m,d,A,y))):Bnt(_,l,m,d,A,y)}return s?jOn(f,d,l,u,n.value,t):f.length?Promise.all(f).then(()=>l):l}}),pZt=ct("$ZodObjectJIT",(t,e)=>{HOn.init(t,e);let r=t._zod.parse,n=Ife(()=>qOn(e)),o=a(m=>{let g=new Vke(["shape","payload","ctx"]),A=n.value,y=a(S=>{let T=Ent(S);return`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`},"parseStr");g.write("const input = payload.value;");let _=Object.create(null),E=0;for(let S of A.keys)_[S]=`key_${E++}`;g.write("const newResult = {};");for(let S of A.keys){let T=_[S],w=Ent(S),R=m[S],x=R?._zod?.optin==="optional",k=R?._zod?.optout==="optional";g.write(`const ${T} = ${y(S)};`),x&&k?g.write(` +`))}};p();var RJt={major:4,minor:4,patch:3};var po=ct("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=RJt;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((c,l,u)=>{let d=jj(c),f;for(let h of l){if(h._zod.def.when){if(NKt(c)||!h._zod.def.when(c))continue}else if(d)continue;let m=c.issues.length,g=h._zod.check(c);if(g instanceof Promise&&u?.async===!1)throw new F2;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,c.issues.length!==m&&(d||(d=jj(c,m)))});else{if(c.issues.length===m)continue;d||(d=jj(c,m))}}return f?f.then(()=>c):c},"runChecks"),s=a((c,l,u)=>{if(jj(c))return c.aborted=!0,c;let d=o(l,n,u);if(d instanceof Promise){if(u.async===!1)throw new F2;return d.then(f=>t._zod.parse(f,u))}return t._zod.parse(d,u)},"handleCanaryResult");t._zod.run=(c,l)=>{if(l.skipChecks)return t._zod.parse(c,l);if(l.direction==="backward"){let d=t._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return d instanceof Promise?d.then(f=>s(f,c,l)):s(d,c,l)}let u=t._zod.parse(c,l);if(u instanceof Promise){if(l.async===!1)throw new F2;return u.then(d=>o(d,n,l))}return o(u,n,l)}}Ls(t,"~standard",()=>({validate:a(o=>{try{let s=Dfe(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Hke(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),kZ=ct("$ZodString",(t,e)=>{po.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??nJt(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Ll=ct("$ZodStringFormat",(t,e)=>{Mfe.init(t,e),kZ.init(t,e)}),PJt=ct("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=HKt),Ll.init(t,e)}),DJt=ct("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=RZ(n))}else e.pattern??(e.pattern=RZ());Ll.init(t,e)}),NJt=ct("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=GKt),Ll.init(t,e)}),MJt=ct("$ZodURL",(t,e)=>{Ll.init(t,e),t._zod.check=r=>{try{let n=r.value.trim();if(!e.normalize&&e.protocol?.source===ZKt.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let o=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),OJt=ct("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=$Kt()),Ll.init(t,e)}),LJt=ct("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=qKt),Ll.init(t,e)}),BJt=ct("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=LKt),Ll.init(t,e)}),FJt=ct("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=BKt),Ll.init(t,e)}),UJt=ct("$ZodULID",(t,e)=>{e.pattern??(e.pattern=FKt),Ll.init(t,e)}),QJt=ct("$ZodXID",(t,e)=>{e.pattern??(e.pattern=UKt),Ll.init(t,e)}),qJt=ct("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=QKt),Ll.init(t,e)}),jJt=ct("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=rJt(e)),Ll.init(t,e)}),HJt=ct("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=eJt),Ll.init(t,e)}),GJt=ct("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=tJt(e)),Ll.init(t,e)}),$Jt=ct("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=jKt),Ll.init(t,e)}),VJt=ct("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=VKt),Ll.init(t,e),t._zod.bag.format="ipv4"}),WJt=ct("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=WKt),Ll.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),zJt=ct("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=zKt(e.delimiter)),Ll.init(t,e),t._zod.bag.format="mac"}),YJt=ct("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=YKt),Ll.init(t,e)}),KJt=ct("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=KKt),Ll.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[o,s]=n;if(!s)throw new Error;let c=Number(s);if(`${c}`!==s)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function JJt(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(JJt,"isValidBase64");var ZJt=ct("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=JKt),Ll.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{JJt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function QOn(t){if(!knt.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return JJt(r)}a(QOn,"isValidBase64URL");var XJt=ct("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=knt),Ll.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{QOn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),eZt=ct("$ZodE164",(t,e)=>{e.pattern??(e.pattern=XKt),Ll.init(t,e)});function qOn(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}a(qOn,"isValidJWT");var tZt=ct("$ZodJWT",(t,e)=>{Ll.init(t,e),t._zod.check=r=>{qOn(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),rZt=ct("$ZodCustomStringFormat",(t,e)=>{Ll.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),Fnt=ct("$ZodNumber",(t,e)=>{po.init(t,e),t._zod.pattern=t._zod.bag.pattern??Pnt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),nZt=ct("$ZodNumberFormat",(t,e)=>{fJt.init(t,e),Fnt.init(t,e)}),Wke=ct("$ZodBoolean",(t,e)=>{po.init(t,e),t._zod.pattern=sJt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),Unt=ct("$ZodBigInt",(t,e)=>{po.init(t,e),t._zod.pattern=iJt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),iZt=ct("$ZodBigIntFormat",(t,e)=>{pJt.init(t,e),Unt.init(t,e)}),oZt=ct("$ZodSymbol",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),sZt=ct("$ZodUndefined",(t,e)=>{po.init(t,e),t._zod.pattern=cJt,t._zod.values=new Set([void 0]),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),aZt=ct("$ZodNull",(t,e)=>{po.init(t,e),t._zod.pattern=aJt,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),cZt=ct("$ZodAny",(t,e)=>{po.init(t,e),t._zod.parse=r=>r}),lZt=ct("$ZodUnknown",(t,e)=>{po.init(t,e),t._zod.parse=r=>r}),uZt=ct("$ZodNever",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),dZt=ct("$ZodVoid",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),fZt=ct("$ZodDate",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});function IOn(t,e,r){t.issues.length&&e.issues.push(...bb(r,t.issues)),e.value[r]=t.value}a(IOn,"handleArrayResult");var pZt=ct("$ZodArray",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let c=0;cIOn(d,r,c))):IOn(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Bnt(t,e,r,n,o,s){let c=r in n;if(t.issues.length){if(o&&s&&!c)return;e.issues.push(...bb(r,t.issues))}if(!c&&!o){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?c&&(e.value[r]=void 0):e.value[r]=t.value}a(Bnt,"handlePropertyResult");function jOn(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=kKt(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}a(jOn,"normalizeDef");function HOn(t,e,r,n,o,s){let c=[],l=o.keySet,u=o.catchall._zod,d=u.def.type,f=u.optin==="optional",h=u.optout==="optional";for(let m in e){if(m==="__proto__"||l.has(m))continue;if(d==="never"){c.push(m);continue}let g=u.run({value:e[m],issues:[]},n);g instanceof Promise?t.push(g.then(A=>Bnt(A,r,m,e,f,h))):Bnt(g,r,m,e,f,h)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}a(HOn,"handleCatchall");var GOn=ct("$ZodObject",(t,e)=>{if(po.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let l=e.shape;Object.defineProperty(e,"shape",{get:a(()=>{let u={...l};return Object.defineProperty(e,"shape",{value:u}),u},"get")})}let n=xfe(()=>jOn(e));Ls(t._zod,"propValues",()=>{let l=e.shape,u={};for(let d in l){let f=l[d]._zod;if(f.values){u[d]??(u[d]=new Set);for(let h of f.values)u[d].add(h)}}return u});let o=wZ,s=e.catchall,c;t._zod.parse=(l,u)=>{c??(c=n.value);let d=l.value;if(!o(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),l;l.value={};let f=[],h=c.shape;for(let m of c.keys){let g=h[m],A=g._zod.optin==="optional",y=g._zod.optout==="optional",_=g._zod.run({value:d[m],issues:[]},u);_ instanceof Promise?f.push(_.then(E=>Bnt(E,l,m,d,A,y))):Bnt(_,l,m,d,A,y)}return s?HOn(f,d,l,u,n.value,t):f.length?Promise.all(f).then(()=>l):l}}),hZt=ct("$ZodObjectJIT",(t,e)=>{GOn.init(t,e);let r=t._zod.parse,n=xfe(()=>jOn(e)),o=a(m=>{let g=new Vke(["shape","payload","ctx"]),A=n.value,y=a(S=>{let T=Ent(S);return`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`},"parseStr");g.write("const input = payload.value;");let _=Object.create(null),E=0;for(let S of A.keys)_[S]=`key_${E++}`;g.write("const newResult = {};");for(let S of A.keys){let T=_[S],w=Ent(S),R=m[S],x=R?._zod?.optin==="optional",k=R?._zod?.optout==="optional";g.write(`const ${T} = ${y(S)};`),x&&k?g.write(` if (${T}.issues.length) { if (${w} in input) { payload.issues = payload.issues.concat(${T}.issues.map(iss => ({ @@ -3774,42 +3774,42 @@ ${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${nKt(f.summar } } - `)}g.write("payload.value = newResult;"),g.write("return payload;");let v=g.compile();return(S,T)=>v(m,S,T)},"generateFastpass"),s,c=xZ,l=!IZ.jitless,d=l&&IKt.value,f=e.catchall,h;t._zod.parse=(m,g)=>{h??(h=n.value);let A=m.value;return c(A)?l&&d&&g?.async===!1&&g.jitless!==!0?(s||(s=o(e.shape)),m=s(m,g),f?jOn([],A,m,g,h,t):m):r(m,g):(m.issues.push({expected:"object",code:"invalid_type",input:A,inst:t}),m)}});function IOn(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let o=t.filter(s=>!jj(s));return o.length===1?(e.value=o[0].value,o[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>Ev(c,n,Ep())))}),e)}a(IOn,"handleUnionResults");var zke=ct("$ZodUnion",(t,e)=>{po.init(t,e),Ls(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Ls(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Ls(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),Ls(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>Mke(o.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,c=[];for(let l of e.options){let u=l._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)c.push(u),s=!0;else{if(u.issues.length===0)return u;c.push(u)}}return s?Promise.all(c).then(l=>IOn(l,n,t,o)):IOn(c,n,t,o)}});function xOn(t,e,r,n){let o=t.filter(s=>s.issues.length===0);return o.length===1?(e.value=o[0].value,e):(o.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>Ev(c,n,Ep())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}a(xOn,"handleExclusiveUnionResults");var hZt=ct("$ZodXor",(t,e)=>{zke.init(t,e),e.inclusive=!1;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,c=[];for(let l of e.options){let u=l._zod.run({value:n.value,issues:[]},o);u instanceof Promise?(c.push(u),s=!0):c.push(u)}return s?Promise.all(c).then(l=>xOn(l,n,t,o)):xOn(c,n,t,o)}}),mZt=ct("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,zke.init(t,e);let r=t._zod.parse;Ls(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=Ife(()=>{let o=e.options,s=new Map;for(let c of o){let l=c._zod.propValues?.[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let u of l){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,c)}}return s});t._zod.parse=(o,s)=>{let c=o.value;if(!xZ(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),o;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(o,s):e.unionFallback||s.direction==="backward"?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:c,path:[e.discriminator],inst:t}),o)}}),gZt=ct("$ZodIntersection",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),c=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([u,d])=>wOn(r,u,d)):wOn(r,s,c)}});function RJt(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(qj(t)&&qj(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let c=RJt(t[s],e[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;nl.l&&l.r).map(([l])=>l);if(s.length&&o&&t.issues.push({...o,keys:s}),jj(t))return t;let c=RJt(e.value,r.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return t.value=c.data,t}a(wOn,"handleIntersectionResults");var Qnt=ct("$ZodTuple",(t,e)=>{po.init(t,e);let r=e.items;t._zod.parse=(n,o)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({input:s,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let c=[],l=ROn(r,"optin"),u=ROn(r,"optout");if(!e.rest){if(s.lengthr.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:s,inst:t,origin:"array"})}let d=new Array(r.length);for(let f=0;f{d[f]=m})):d[f]=h}if(e.rest){let f=r.length-1,h=s.slice(r.length);for(let m of h){f++;let g=e.rest._zod.run({value:m,issues:[]},o);g instanceof Promise?c.push(g.then(A=>kOn(A,n,f))):kOn(g,n,f)}}return c.length?Promise.all(c).then(()=>POn(d,n,r,s,u)):POn(d,n,r,s,u)}});function ROn(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}a(ROn,"getTupleOptStart");function kOn(t,e,r){t.issues.length&&e.issues.push(...bb(r,t.issues)),e.value[r]=t.value}a(kOn,"handleTupleResult");function POn(t,e,r,n,o){for(let s=0;s=o){e.value.length=s;break}e.issues.push(...bb(s,c.issues))}e.value[s]=c.value}for(let s=e.value.length-1;s>=n.length&&(r[s]._zod.optout==="optional"&&e.value[s]===void 0);s--)e.value.length=s;return e}a(POn,"handleTupleResults");var AZt=ct("$ZodRecord",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!qj(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[],c=e.keyType._zod.values;if(c){r.value={};let l=new Set;for(let d of c)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){l.add(typeof d=="number"?d.toString():d);let f=e.keyType._zod.run({value:d,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(g=>Ev(g,n,Ep())),input:d,path:[d],inst:t});continue}let h=f.value,m=e.valueType._zod.run({value:o[d],issues:[]},n);m instanceof Promise?s.push(m.then(g=>{g.issues.length&&r.issues.push(...bb(d,g.issues)),r.value[h]=g.value})):(m.issues.length&&r.issues.push(...bb(d,m.issues)),r.value[h]=m.value)}let u;for(let d in o)l.has(d)||(u=u??[],u.push(d));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:u})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,l))continue;let u=e.keyType._zod.run({value:l,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Pnt.test(l)&&u.issues.length){let h=e.keyType._zod.run({value:Number(l),issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(u=h)}if(u.issues.length){e.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(h=>Ev(h,n,Ep())),input:l,path:[l],inst:t});continue}let f=e.valueType._zod.run({value:o[l],issues:[]},n);f instanceof Promise?s.push(f.then(h=>{h.issues.length&&r.issues.push(...bb(l,h.issues)),r.value[u.value]=h.value})):(f.issues.length&&r.issues.push(...bb(l,f.issues)),r.value[u.value]=f.value)}}return s.length?Promise.all(s).then(()=>r):r}}),yZt=ct("$ZodMap",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let s=[];r.value=new Map;for(let[c,l]of o){let u=e.keyType._zod.run({value:c,issues:[]},n),d=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise||d instanceof Promise?s.push(Promise.all([u,d]).then(([f,h])=>{DOn(f,h,r,c,o,t,n)})):DOn(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function DOn(t,e,r,n,o,s,c){t.issues.length&&(Oke.has(typeof n)?r.issues.push(...bb(n,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:s,issues:t.issues.map(l=>Ev(l,c,Ep()))})),e.issues.length&&(Oke.has(typeof n)?r.issues.push(...bb(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>Ev(l,c,Ep()))})),r.value.set(t.value,e.value)}a(DOn,"handleMapResult");var _Zt=ct("$ZodSet",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let c of o){let l=e.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(u=>NOn(u,r))):NOn(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function NOn(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(NOn,"handleSetResult");var EZt=ct("$ZodEnum",(t,e)=>{po.init(t,e);let r=Nke(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>Oke.has(typeof o)).map(o=>typeof o=="string"?Gw(o):o.toString()).join("|")})$`),t._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:t}),o}}),vZt=ct("$ZodLiteral",(t,e)=>{if(po.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Gw(n):n?Gw(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}}),CZt=ct("$ZodFile",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),bZt=ct("$ZodTransform",(t,e)=>{po.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Fj(t.constructor.name);let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r.fallback=!0,r));if(o instanceof Promise)throw new F2;return r.value=o,r.fallback=!0,r}});function MOn(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}a(MOn,"handleOptionalResult");var qnt=ct("$ZodOptional",(t,e)=>{po.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Ls(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Ls(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Mke(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let o=r.value,s=e.innerType._zod.run(r,n);return s instanceof Promise?s.then(c=>MOn(c,o)):MOn(s,o)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),SZt=ct("$ZodExactOptional",(t,e)=>{qnt.init(t,e),Ls(t._zod,"values",()=>e.innerType._zod.values),Ls(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),TZt=ct("$ZodNullable",(t,e)=>{po.init(t,e),Ls(t._zod,"optin",()=>e.innerType._zod.optin),Ls(t._zod,"optout",()=>e.innerType._zod.optout),Ls(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Mke(r.source)}|null)$`):void 0}),Ls(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),IZt=ct("$ZodDefault",(t,e)=>{po.init(t,e),t._zod.optin="optional",Ls(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>OOn(s,e)):OOn(o,e)}});function OOn(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(OOn,"handleDefaultResult");var xZt=ct("$ZodPrefault",(t,e)=>{po.init(t,e),t._zod.optin="optional",Ls(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),wZt=ct("$ZodNonOptional",(t,e)=>{po.init(t,e),Ls(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>LOn(s,t)):LOn(o,t)}});function LOn(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}a(LOn,"handleNonOptionalResult");var RZt=ct("$ZodSuccess",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Fj("ZodSuccess");let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),kZt=ct("$ZodCatch",(t,e)=>{po.init(t,e),t._zod.optin="optional",Ls(t._zod,"optout",()=>e.innerType._zod.optout),Ls(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>Ev(c,n,Ep()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>Ev(s,n,Ep()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),PZt=ct("$ZodNaN",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),jnt=ct("$ZodPipe",(t,e)=>{po.init(t,e),Ls(t._zod,"values",()=>e.in._zod.values),Ls(t._zod,"optin",()=>e.in._zod.optin),Ls(t._zod,"optout",()=>e.out._zod.optout),Ls(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Mnt(c,e.in,n)):Mnt(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Mnt(s,e.out,n)):Mnt(o,e.out,n)}});function Mnt(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}a(Mnt,"handlePipeResult");var Yke=ct("$ZodCodec",(t,e)=>{po.init(t,e),Ls(t._zod,"values",()=>e.in._zod.values),Ls(t._zod,"optin",()=>e.in._zod.optin),Ls(t._zod,"optout",()=>e.out._zod.optout),Ls(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let s=e.in._zod.run(r,n);return s instanceof Promise?s.then(c=>Ont(c,e,n)):Ont(s,e,n)}else{let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Ont(c,e,n)):Ont(s,e,n)}}});function Ont(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let o=e.transform(t.value,t);return o instanceof Promise?o.then(s=>Lnt(t,s,e.out,r)):Lnt(t,o,e.out,r)}else{let o=e.reverseTransform(t.value,t);return o instanceof Promise?o.then(s=>Lnt(t,s,e.in,r)):Lnt(t,o,e.in,r)}}a(Ont,"handleCodecAResult");function Lnt(t,e,r,n){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},n)}a(Lnt,"handleCodecTxResult");var DZt=ct("$ZodPreprocess",(t,e)=>{jnt.init(t,e)}),NZt=ct("$ZodReadonly",(t,e)=>{po.init(t,e),Ls(t._zod,"propValues",()=>e.innerType._zod.propValues),Ls(t._zod,"values",()=>e.innerType._zod.values),Ls(t._zod,"optin",()=>e.innerType?._zod?.optin),Ls(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(BOn):BOn(o)}});function BOn(t){return t.value=Object.freeze(t.value),t}a(BOn,"handleReadonlyResult");var MZt=ct("$ZodTemplateLiteral",(t,e)=>{po.init(t,e);let r=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let s=o.startsWith("^")?1:0,c=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(s,c))}else if(n===null||wKt.has(typeof n))r.push(Gw(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"string",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),n)}),OZt=ct("$ZodFunction",(t,e)=>(po.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let o=t._def.input?qke(t._def.input,n):n,s=Reflect.apply(r,this,o);return t._def.output?qke(t._def.output,s):s}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let o=t._def.input?await jke(t._def.input,n):n,s=await Reflect.apply(r,this,o);return t._def.output?await jke(t._def.output,s):s}},t._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let n=t.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Qnt({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new n({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let n=t.constructor;return new n({type:"function",input:t._def.input,output:r})},t)),LZt=ct("$ZodPromise",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),BZt=ct("$ZodLazy",(t,e)=>{po.init(t,e),Ls(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),Ls(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),Ls(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),Ls(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),Ls(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),FZt=ct("$ZodCustom",(t,e)=>{iu.init(t,e),po.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>FOn(s,r,n,t));FOn(o,r,n,t)}});function FOn(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(xfe(o))}}a(FOn,"handleRefineResult");var ePe={};Ti(ePe,{ar:()=>UZt,az:()=>QZt,be:()=>qZt,bg:()=>jZt,ca:()=>HZt,cs:()=>GZt,da:()=>$Zt,de:()=>VZt,el:()=>WZt,en:()=>Kke,eo:()=>zZt,es:()=>YZt,fa:()=>KZt,fi:()=>JZt,fr:()=>ZZt,frCA:()=>XZt,he:()=>eXt,hr:()=>tXt,hu:()=>rXt,hy:()=>nXt,id:()=>iXt,is:()=>oXt,it:()=>sXt,ja:()=>aXt,ka:()=>cXt,kh:()=>lXt,km:()=>Jke,ko:()=>uXt,lt:()=>dXt,mk:()=>fXt,ms:()=>pXt,nl:()=>hXt,no:()=>mXt,ota:()=>gXt,pl:()=>yXt,ps:()=>AXt,pt:()=>_Xt,ro:()=>EXt,ru:()=>vXt,sl:()=>CXt,sv:()=>bXt,ta:()=>SXt,th:()=>TXt,tr:()=>IXt,ua:()=>xXt,uk:()=>Xke,ur:()=>wXt,uz:()=>RXt,vi:()=>kXt,yo:()=>NXt,zhCN:()=>PXt,zhTW:()=>DXt});p();p();var ops=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${l}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${s}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${l}`}case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${Zt(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${r[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${_t(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function UZt(){return{localeError:ops()}}a(UZt,"default");p();var sps=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${o.expected}, daxil olan ${l}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${s}, daxil olan ${l}`}case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${Zt(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function QZt(){return{localeError:sps()}}a(QZt,"default");p();function GOn(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}a(GOn,"getBelarusianPlural");var aps=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},n={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${l}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${s}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${l}`}case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${Zt(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=GOn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=GOn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function qZt(){return{localeError:aps()}}a(qZt,"default");p();var cps=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${l}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${s}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${l}`}case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${Zt(o.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;if(s.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${s.prefix}"`;if(s.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${s.suffix}"`;if(s.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${s.includes}"`;if(s.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${s.pattern}`;let c="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return s.format==="emoji"&&(c="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="datetime"&&(c="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="date"&&(c="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),s.format==="time"&&(c="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="duration"&&(c="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${c} ${r[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${o.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u043E\u0432\u0435":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},"error");function jZt(){return{localeError:cps()}}a(jZt,"default");p();var lps=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${o.expected}, s'ha rebut ${l}`:`Tipus inv\xE0lid: s'esperava ${s}, s'ha rebut ${l}`}case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${Zt(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${_t(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${r[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function HZt(){return{localeError:lps()}}a(HZt,"default");p();var ups=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${o.expected}, obdr\u017Eeno ${l}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${s}, obdr\u017Eeno ${l}`}case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${Zt(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${r[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${_t(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function GZt(){return{localeError:ups()}}a(GZt,"default");p();var dps=a(()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Ugyldigt input: forventede instanceof ${o.expected}, fik ${l}`:`Ugyldigt input: forventede ${s}, fik ${l}`}case"invalid_value":return o.values.length===1?`Ugyldig v\xE6rdi: forventede ${Zt(o.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin),l=n[o.origin]??o.origin;return c?`For stor: forventede ${l??"value"} ${c.verb} ${s} ${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor: forventede ${l??"value"} havde ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin),l=n[o.origin]??o.origin;return c?`For lille: forventede ${l} ${c.verb} ${s} ${o.minimum.toString()} ${c.unit}`:`For lille: forventede ${l} havde ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: skal starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: skal ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: skal indeholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${r[s.format]??o.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${o.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${o.origin}`;default:return"Ugyldigt input"}}},"error");function $Zt(){return{localeError:dps()}}a($Zt,"default");p();var fps=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${o.expected}, erhalten ${l}`:`Ung\xFCltige Eingabe: erwartet ${s}, erhalten ${l}`}case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${Zt(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${r[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function VZt(){return{localeError:fps()}}a(VZt,"default");p();var pps=a(()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return typeof o.expected=="string"&&/^[A-Z]/.test(o.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${o.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${l}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${s}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${l}`}case"invalid_value":return o.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${Zt(o.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${s}${o.maximum.toString()} ${c.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${s}${o.minimum.toString()} ${c.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${s.prefix}"`:s.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${s.suffix}"`:s.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${s.includes}"`:s.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${s.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[s.format]??o.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${o.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${o.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${o.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${o.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${o.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}},"error");function WZt(){return{localeError:pps()}}a(WZt,"default");p();var hps=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return`Invalid input: expected ${s}, received ${l}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${Zt(o.values[0])}`:`Invalid option: expected one of ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${c.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(c=>`'${c}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}},"error");function Kke(){return{localeError:hps()}}a(Kke,"default");p();var mps=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${o.expected}, ricevi\u011Dis ${l}`:`Nevalida enigo: atendi\u011Dis ${s}, ricevi\u011Dis ${l}`}case"invalid_value":return o.values.length===1?`Nevalida enigo: atendi\u011Dis ${Zt(o.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${s}${o.maximum.toString()} ${c.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Tro malgranda: atendi\u011Dis ke ${o.origin} havu ${s}${o.minimum.toString()} ${c.unit}`:`Tro malgranda: atendi\u011Dis ke ${o.origin} estu ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${s.prefix}"`:s.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${s.suffix}"`:s.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${s.includes}"`:s.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${s.pattern}`:`Nevalida ${r[s.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} \u015Dlosilo${o.keys.length>1?"j":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}},"error");function zZt(){return{localeError:mps()}}a(zZt,"default");p();var gps=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${o.expected}, recibido ${l}`:`Entrada inv\xE1lida: se esperaba ${s}, recibido ${l}`}case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${Zt(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin),l=n[o.origin]??o.origin;return c?`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${l??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin),l=n[o.origin]??o.origin;return c?`Demasiado peque\xF1o: se esperaba que ${l} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${l} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${r[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n[o.origin]??o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n[o.origin]??o.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function YZt(){return{localeError:gps()}}a(YZt,"default");p();var Aps=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${l} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${s} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${l} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${Zt(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${_t(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${_t(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function KZt(){return{localeError:Aps()}}a(KZt,"default");p();var yps=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Virheellinen tyyppi: odotettiin instanceof ${o.expected}, oli ${l}`:`Virheellinen tyyppi: odotettiin ${s}, oli ${l}`}case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${Zt(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${r[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${_t(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function JZt(){return{localeError:yps()}}a(JZt,"default");p();var _ps=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Entr\xE9e invalide : instanceof ${o.expected} attendu, ${l} re\xE7u`:`Entr\xE9e invalide : ${s} attendu, ${l} re\xE7u`}case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${Zt(o.values[0])} attendu`:`Option invalide : une valeur parmi ${_t(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${n[o.origin]??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n[o.origin]??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${n[o.origin]??"valeur"} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${n[o.origin]??"valeur"} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${r[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${_t(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function ZZt(){return{localeError:_ps()}}a(ZZt,"default");p();var Eps=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Entr\xE9e invalide : attendu instanceof ${o.expected}, re\xE7u ${l}`:`Entr\xE9e invalide : attendu ${s}, re\xE7u ${l}`}case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${Zt(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${r[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${_t(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function XZt(){return{localeError:Eps()}}a(XZt,"default");p();var vps=a(()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=a(d=>d?t[d]:void 0,"typeEntry"),n=a(d=>{let f=r(d);return f?f.label:d??t.unknown.label},"typeLabel"),o=a(d=>`\u05D4${n(d)}`,"withDefinite"),s=a(d=>(r(d)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA","verbFor"),c=a(d=>d?e[d]??null:null,"getSizing"),l={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return d=>{switch(d.code){case"invalid_type":{let f=d.expected,h=u[f??""]??n(f),m=nr(d.input),g=u[m]??t[m]?.label??m;return/^[A-Z]/.test(d.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${d.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`}case"invalid_value":{if(d.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${Zt(d.values[0])}`;let f=d.values.map(g=>Zt(g));if(d.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${f[0]} \u05D0\u05D5 ${f[1]}`;let h=f[f.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${f.slice(0,-1).join(", ")} \u05D0\u05D5 ${h}`}case"too_big":{let f=c(d.origin),h=o(d.origin??"value");if(d.origin==="string")return`${f?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.maximum.toString()} ${f?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(d.origin==="number"){let A=d.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${d.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${A}`}if(d.origin==="array"||d.origin==="set"){let A=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=d.inclusive?`${d.maximum} ${f?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${d.maximum} ${f?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} ${A} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=d.inclusive?"<=":"<",g=s(d.origin??"value");return f?.unit?`${f.longLabel} \u05DE\u05D3\u05D9: ${h} ${g} ${m}${d.maximum.toString()} ${f.unit}`:`${f?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${h} ${g} ${m}${d.maximum.toString()}`}case"too_small":{let f=c(d.origin),h=o(d.origin??"value");if(d.origin==="string")return`${f?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.minimum.toString()} ${f?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(d.origin==="number"){let A=d.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${d.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${A}`}if(d.origin==="array"||d.origin==="set"){let A=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(d.minimum===1&&d.inclusive){let _=(d.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${A} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`}let y=d.inclusive?`${d.minimum} ${f?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${d.minimum} ${f?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${A} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=d.inclusive?">=":">",g=s(d.origin??"value");return f?.unit?`${f.shortLabel} \u05DE\u05D3\u05D9: ${h} ${g} ${m}${d.minimum.toString()} ${f.unit}`:`${f?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${h} ${g} ${m}${d.minimum.toString()}`}case"invalid_format":{let f=d;if(f.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${f.prefix}"`;if(f.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${f.suffix}"`;if(f.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${f.includes}"`;if(f.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${f.pattern}`;let h=l[f.format],m=h?.label??f.format,A=(h?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${A}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${d.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${d.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${d.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${_t(d.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o(d.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function eXt(){return{localeError:vps()}}a(eXt,"default");p();var Cps=a(()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},n={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${o.expected}, a primljeno je ${l}`:`Neispravan unos: o\u010Dekuje se ${s}, a primljeno je ${l}`}case"invalid_value":return o.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${Zt(o.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin),l=n[o.origin]??o.origin;return c?`Preveliko: o\u010Dekivano da ${l??"vrijednost"} ima ${s}${o.maximum.toString()} ${c.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${l??"vrijednost"} bude ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin),l=n[o.origin]??o.origin;return c?`Premalo: o\u010Dekivano da ${l} ima ${s}${o.minimum.toString()} ${c.unit}`:`Premalo: o\u010Dekivano da ${l} bude ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${s.prefix}"`:s.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${s.suffix}"`:s.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${s.includes}"`:s.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${s.pattern}`:`Neispravna ${r[s.format]??o.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${o.divisor}`;case"unrecognized_keys":return`Neprepoznat${o.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${n[o.origin]??o.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${n[o.origin]??o.origin}`;default:return"Neispravan unos"}}},"error");function tXt(){return{localeError:Cps()}}a(tXt,"default");p();var bps=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${o.expected}, a kapott \xE9rt\xE9k ${l}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${s}, a kapott \xE9rt\xE9k ${l}`}case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${Zt(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function rXt(){return{localeError:bps()}}a(rXt,"default");p();function $On(t,e,r){return Math.abs(t)===1?e:r}a($On,"getArmenianPlural");function Mfe(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}a(Mfe,"withDefiniteArticle");var Sps=a(()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},n={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${o.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${l}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${s}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${l}`}case"invalid_value":return o.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${Zt(o.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=$On(l,c.unit.one,c.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Mfe(o.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${s}${o.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Mfe(o.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=$On(l,c.unit.one,c.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Mfe(o.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${s}${o.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Mfe(o.origin)} \u056C\u056B\u0576\u056B ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${s.prefix}"-\u0578\u057E`:s.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${s.suffix}"-\u0578\u057E`:s.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${s.includes}"`:s.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${s.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[s.format]??o.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${o.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${o.keys.length>1?"\u0576\u0565\u0580":""}. ${_t(o.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Mfe(o.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Mfe(o.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function nXt(){return{localeError:Sps()}}a(nXt,"default");p();var Tps=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Input tidak valid: diharapkan instanceof ${o.expected}, diterima ${l}`:`Input tidak valid: diharapkan ${s}, diterima ${l}`}case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${Zt(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${r[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"error");function iXt(){return{localeError:Tps()}}a(iXt,"default");p();var Ips=a(()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},n={nan:"NaN",number:"n\xFAmer",array:"fylki"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${l} \xFEar sem \xE1 a\xF0 vera instanceof ${o.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${l} \xFEar sem \xE1 a\xF0 vera ${s}`}case"invalid_value":return o.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${Zt(o.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} hafi ${s}${o.maximum.toString()} ${c.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} s\xE9 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} hafi ${s}${o.minimum.toString()} ${c.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} s\xE9 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${s.prefix}"`:s.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${s.suffix}"`:s.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${s.includes}"`:s.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${s.pattern}`:`Rangt ${r[s.format]??o.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${o.origin}`;default:return"Rangt gildi"}}},"error");function oXt(){return{localeError:Ips()}}a(oXt,"default");p();var xps=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Input non valido: atteso instanceof ${o.expected}, ricevuto ${l}`:`Input non valido: atteso ${s}, ricevuto ${l}`}case"invalid_value":return o.values.length===1?`Input non valido: atteso ${Zt(o.values[0])}`:`Opzione non valida: atteso uno tra ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Input non valido: ${r[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"error");function sXt(){return{localeError:xps()}}a(sXt,"default");p();var wps=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},n={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${l}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${s}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${l}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${Zt(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${_t(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${_t(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function aXt(){return{localeError:wps()}}a(aXt,"default");p();var Rps=a(()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},n={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${o.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${l}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${s}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${l}`}case"invalid_value":return o.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${Zt(o.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${_t(o.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin} \u10D8\u10E7\u10DD\u10E1 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${s.prefix}"-\u10D8\u10D7`:s.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${s.suffix}"-\u10D8\u10D7`:s.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${s.includes}"-\u10E1`:s.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${s.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${o.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${o.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${o.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${o.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},"error");function cXt(){return{localeError:Rps()}}a(cXt,"default");p();p();var kps=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},n={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${l}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${s} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${l}`}case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Zt(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${_t(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function Jke(){return{localeError:kps()}}a(Jke,"default");function lXt(){return Jke()}a(lXt,"default");p();var Pps=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${l}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${s}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${l}\uC785\uB2C8\uB2E4`}case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${Zt(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${_t(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${_t(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function uXt(){return{localeError:Pps()}}a(uXt,"default");p();var Zke=a(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalizeFirstCharacter");function VOn(t){let e=Math.abs(t),r=e%10,n=e%100;return n>=11&&n<=19||r===0?"many":r===1?"one":"few"}a(VOn,"getUnitTypeFromNumber");var Dps=a(()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(o,s,c,l){let u=t[o]??null;return u===null?u:{unit:u.unit[s],verb:u.verb[l][c?"inclusive":"notInclusive"]}}a(e,"getSizing");let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},n={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Gautas tipas ${l}, o tik\u0117tasi - instanceof ${o.expected}`:`Gautas tipas ${l}, o tik\u0117tasi - ${s}`}case"invalid_value":return o.values.length===1?`Privalo b\u016Bti ${Zt(o.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${_t(o.values,"|")} pasirinkim\u0173`;case"too_big":{let s=n[o.origin]??o.origin,c=e(o.origin,VOn(Number(o.maximum)),o.inclusive??!1,"smaller");if(c?.verb)return`${Zke(s??o.origin??"reik\u0161m\u0117")} ${c.verb} ${o.maximum.toString()} ${c.unit??"element\u0173"}`;let l=o.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Zke(s??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${l} ${o.maximum.toString()} ${c?.unit}`}case"too_small":{let s=n[o.origin]??o.origin,c=e(o.origin,VOn(Number(o.minimum)),o.inclusive??!1,"bigger");if(c?.verb)return`${Zke(s??o.origin??"reik\u0161m\u0117")} ${c.verb} ${o.minimum.toString()} ${c.unit??"element\u0173"}`;let l=o.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Zke(s??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${l} ${o.minimum.toString()} ${c?.unit}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${s.prefix}"`:s.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${s.suffix}"`:s.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${s.includes}"`:s.format==="regex"?`Eilut\u0117 privalo atitikti ${s.pattern}`:`Neteisingas ${r[s.format]??o.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${_t(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let s=n[o.origin]??o.origin;return`${Zke(s??o.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function dXt(){return{localeError:Dps()}}a(dXt,"default");p();var Nps=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},n={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${l}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${s}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${l}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${Zt(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${r[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function fXt(){return{localeError:Nps()}}a(fXt,"default");p();var Mps=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Input tidak sah: dijangka instanceof ${o.expected}, diterima ${l}`:`Input tidak sah: dijangka ${s}, diterima ${l}`}case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${Zt(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${r[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${_t(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"error");function pXt(){return{localeError:Mps()}}a(pXt,"default");p();var Ops=a(()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Ongeldige invoer: verwacht instanceof ${o.expected}, ontving ${l}`:`Ongeldige invoer: verwacht ${s}, ontving ${l}`}case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${Zt(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin),l=o.origin==="date"?"laat":o.origin==="string"?"lang":"groot";return c?`Te ${l}: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} ${c.verb}`:`Te ${l}: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin),l=o.origin==="date"?"vroeg":o.origin==="string"?"kort":"klein";return c?`Te ${l}: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} ${c.verb}`:`Te ${l}: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${r[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"error");function hXt(){return{localeError:Ops()}}a(hXt,"default");p();var Lps=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Ugyldig input: forventet instanceof ${o.expected}, fikk ${l}`:`Ugyldig input: forventet ${s}, fikk ${l}`}case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${Zt(o.values[0])}`:`Ugyldig valg: forventet en av ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${r[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"error");function mXt(){return{localeError:Lps()}}a(mXt,"default");p();var Bps=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`F\xE2sit giren: umulan instanceof ${o.expected}, al\u0131nan ${l}`:`F\xE2sit giren: umulan ${s}, al\u0131nan ${l}`}case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${Zt(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function gXt(){return{localeError:Bps()}}a(gXt,"default");p();var Fps=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${l} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${s} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${l} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${Zt(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${_t(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function AXt(){return{localeError:Fps()}}a(AXt,"default");p();var Ups=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},n={nan:"NaN",number:"liczba",array:"tablica"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${o.expected}, otrzymano ${l}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${s}, otrzymano ${l}`}case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Zt(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function yXt(){return{localeError:Ups()}}a(yXt,"default");p();var Qps=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"n\xFAmero",null:"nulo"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Tipo inv\xE1lido: esperado instanceof ${o.expected}, recebido ${l}`:`Tipo inv\xE1lido: esperado ${s}, recebido ${l}`}case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${Zt(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${r[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"error");function _Xt(){return{localeError:Qps()}}a(_Xt,"default");p();var qps=a(()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},n={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return`Intrare invalid\u0103: a\u0219teptat ${s}, primit ${l}`}case"invalid_value":return o.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${Zt(o.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Prea mare: a\u0219teptat ca ${o.origin??"valoarea"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${o.origin??"valoarea"} s\u0103 fie ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Prea mic: a\u0219teptat ca ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Prea mic: a\u0219teptat ca ${o.origin} s\u0103 fie ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${s.prefix}"`:s.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${s.suffix}"`:s.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${s.includes}"`:s.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${s.pattern}`:`Format invalid: ${r[s.format]??o.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${o.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${_t(o.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${o.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${o.origin}`;default:return"Intrare invalid\u0103"}}},"error");function EXt(){return{localeError:qps()}}a(EXt,"default");p();function WOn(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}a(WOn,"getRussianPlural");var jps=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${l}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${s}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${l}`}case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Zt(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=WOn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=WOn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function vXt(){return{localeError:jps()}}a(vXt,"default");p();var Hps=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${o.expected}, prejeto ${l}`:`Neveljaven vnos: pri\u010Dakovano ${s}, prejeto ${l}`}case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${Zt(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${r[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"error");function CXt(){return{localeError:Hps()}}a(CXt,"default");p();var Gps=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${o.expected}, fick ${l}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${s}, fick ${l}`}case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${Zt(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${r[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function bXt(){return{localeError:Gps()}}a(bXt,"default");p();var $ps=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${l}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${l}`}case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Zt(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${_t(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function SXt(){return{localeError:$ps()}}a(SXt,"default");p();var Vps=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},n={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${l}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${s} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${l}`}case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${Zt(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${_t(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function TXt(){return{localeError:Vps()}}a(TXt,"default");p();var Wps=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${o.expected}, al\u0131nan ${l}`:`Ge\xE7ersiz de\u011Fer: beklenen ${s}, al\u0131nan ${l}`}case"invalid_value":return o.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Zt(o.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${s}${o.maximum.toString()} ${c.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ge\xE7ersiz metin: "${s.prefix}" ile ba\u015Flamal\u0131`:s.format==="ends_with"?`Ge\xE7ersiz metin: "${s.suffix}" ile bitmeli`:s.format==="includes"?`Ge\xE7ersiz metin: "${s.includes}" i\xE7ermeli`:s.format==="regex"?`Ge\xE7ersiz metin: ${s.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[s.format]??o.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${o.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${o.keys.length>1?"lar":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${o.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function IXt(){return{localeError:Wps()}}a(IXt,"default");p();p();var zps=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${l}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${s}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${l}`}case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Zt(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function Xke(){return{localeError:zps()}}a(Xke,"default");function xXt(){return Xke()}a(xXt,"default");p();var Yps=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},n={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${l} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${s} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${l} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${Zt(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${_t(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${_t(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function wXt(){return{localeError:Yps()}}a(wXt,"default");p();var Kps=a(()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${o.expected}, qabul qilingan ${l}`:`Noto\u2018g\u2018ri kirish: kutilgan ${s}, qabul qilingan ${l}`}case"invalid_value":return o.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${Zt(o.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Juda katta: kutilgan ${o.origin??"qiymat"} ${s}${o.maximum.toString()} ${c.unit} ${c.verb}`:`Juda katta: kutilgan ${o.origin??"qiymat"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Juda kichik: kutilgan ${o.origin} ${s}${o.minimum.toString()} ${c.unit} ${c.verb}`:`Juda kichik: kutilgan ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${s.prefix}" bilan boshlanishi kerak`:s.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${s.suffix}" bilan tugashi kerak`:s.format==="includes"?`Noto\u2018g\u2018ri satr: "${s.includes}" ni o\u2018z ichiga olishi kerak`:s.format==="regex"?`Noto\u2018g\u2018ri satr: ${s.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[s.format]??o.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${o.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${o.keys.length>1?"lar":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`${o.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${o.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}},"error");function RXt(){return{localeError:Kps()}}a(RXt,"default");p();var Jps=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},n={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${l}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${s}, nh\u1EADn \u0111\u01B0\u1EE3c ${l}`}case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Zt(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${r[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${_t(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function kXt(){return{localeError:Jps()}}a(kXt,"default");p();var Zps=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},n={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${l}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${s}\uFF0C\u5B9E\u9645\u63A5\u6536 ${l}`}case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Zt(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${r[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${_t(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function PXt(){return{localeError:Zps()}}a(PXt,"default");p();var Xps=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${o.expected}\uFF0C\u4F46\u6536\u5230 ${l}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${s}\uFF0C\u4F46\u6536\u5230 ${l}`}case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${Zt(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${_t(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function DXt(){return{localeError:Xps()}}a(DXt,"default");p();var ehs=a(()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},n={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${o.expected}, \xE0m\u1ECD\u0300 a r\xED ${l}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${s}, \xE0m\u1ECD\u0300 a r\xED ${l}`}case"invalid_value":return o.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${Zt(o.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${o.origin??"iye"} ${c.verb} ${s}${o.maximum} ${c.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${s}${o.maximum}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${o.origin} ${c.verb} ${s}${o.minimum} ${c.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${s}${o.minimum}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${s.prefix}"`:s.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${s.suffix}"`:s.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${s.includes}"`:s.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${s.pattern}`:`A\u1E63\xEC\u1E63e: ${r[s.format]??o.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${o.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${_t(o.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${o.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${o.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},"error");function NXt(){return{localeError:ehs()}}a(NXt,"default");p();var zOn,MXt=Symbol("ZodOutput"),OXt=Symbol("ZodInput"),Hnt=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Gnt(){return new Hnt}a(Gnt,"registry");(zOn=globalThis).__zod_globalRegistry??(zOn.__zod_globalRegistry=Gnt());var ZA=globalThis.__zod_globalRegistry;p();function LXt(t,e){return new t({type:"string",...br(e)})}a(LXt,"_string");function BXt(t,e){return new t({type:"string",coerce:!0,...br(e)})}a(BXt,"_coercedString");function $nt(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...br(e)})}a($nt,"_email");function tPe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...br(e)})}a(tPe,"_guid");function Vnt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...br(e)})}a(Vnt,"_uuid");function Wnt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...br(e)})}a(Wnt,"_uuidv4");function znt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...br(e)})}a(znt,"_uuidv6");function Ynt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...br(e)})}a(Ynt,"_uuidv7");function rPe(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...br(e)})}a(rPe,"_url");function Knt(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...br(e)})}a(Knt,"_emoji");function Jnt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...br(e)})}a(Jnt,"_nanoid");function Znt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...br(e)})}a(Znt,"_cuid");function Xnt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...br(e)})}a(Xnt,"_cuid2");function eit(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...br(e)})}a(eit,"_ulid");function tit(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...br(e)})}a(tit,"_xid");function rit(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...br(e)})}a(rit,"_ksuid");function nit(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...br(e)})}a(nit,"_ipv4");function iit(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...br(e)})}a(iit,"_ipv6");function FXt(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...br(e)})}a(FXt,"_mac");function oit(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...br(e)})}a(oit,"_cidrv4");function sit(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...br(e)})}a(sit,"_cidrv6");function ait(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...br(e)})}a(ait,"_base64");function cit(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...br(e)})}a(cit,"_base64url");function lit(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...br(e)})}a(lit,"_e164");function uit(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...br(e)})}a(uit,"_jwt");var UXt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function QXt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...br(e)})}a(QXt,"_isoDateTime");function qXt(t,e){return new t({type:"string",format:"date",check:"string_format",...br(e)})}a(qXt,"_isoDate");function jXt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...br(e)})}a(jXt,"_isoTime");function HXt(t,e){return new t({type:"string",format:"duration",check:"string_format",...br(e)})}a(HXt,"_isoDuration");function GXt(t,e){return new t({type:"number",checks:[],...br(e)})}a(GXt,"_number");function $Xt(t,e){return new t({type:"number",coerce:!0,checks:[],...br(e)})}a($Xt,"_coercedNumber");function VXt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...br(e)})}a(VXt,"_int");function WXt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...br(e)})}a(WXt,"_float32");function zXt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...br(e)})}a(zXt,"_float64");function YXt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...br(e)})}a(YXt,"_int32");function KXt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...br(e)})}a(KXt,"_uint32");function JXt(t,e){return new t({type:"boolean",...br(e)})}a(JXt,"_boolean");function ZXt(t,e){return new t({type:"boolean",coerce:!0,...br(e)})}a(ZXt,"_coercedBoolean");function XXt(t,e){return new t({type:"bigint",...br(e)})}a(XXt,"_bigint");function eer(t,e){return new t({type:"bigint",coerce:!0,...br(e)})}a(eer,"_coercedBigint");function ter(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...br(e)})}a(ter,"_int64");function rer(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...br(e)})}a(rer,"_uint64");function ner(t,e){return new t({type:"symbol",...br(e)})}a(ner,"_symbol");function ier(t,e){return new t({type:"undefined",...br(e)})}a(ier,"_undefined");function oer(t,e){return new t({type:"null",...br(e)})}a(oer,"_null");function ser(t){return new t({type:"any"})}a(ser,"_any");function aer(t){return new t({type:"unknown"})}a(aer,"_unknown");function cer(t,e){return new t({type:"never",...br(e)})}a(cer,"_never");function ler(t,e){return new t({type:"void",...br(e)})}a(ler,"_void");function uer(t,e){return new t({type:"date",...br(e)})}a(uer,"_date");function der(t,e){return new t({type:"date",coerce:!0,...br(e)})}a(der,"_coercedDate");function fer(t,e){return new t({type:"nan",...br(e)})}a(fer,"_nan");function Q5(t,e){return new Dnt({check:"less_than",...br(e),value:t,inclusive:!1})}a(Q5,"_lt");function DT(t,e){return new Dnt({check:"less_than",...br(e),value:t,inclusive:!0})}a(DT,"_lte");function q5(t,e){return new Nnt({check:"greater_than",...br(e),value:t,inclusive:!1})}a(q5,"_gt");function vv(t,e){return new Nnt({check:"greater_than",...br(e),value:t,inclusive:!0})}a(vv,"_gte");function dit(t){return q5(0,t)}a(dit,"_positive");function fit(t){return Q5(0,t)}a(fit,"_negative");function pit(t){return DT(0,t)}a(pit,"_nonpositive");function hit(t){return vv(0,t)}a(hit,"_nonnegative");function Hj(t,e){return new uJt({check:"multiple_of",...br(e),value:t})}a(Hj,"_multipleOf");function Gj(t,e){return new pJt({check:"max_size",...br(e),maximum:t})}a(Gj,"_maxSize");function j5(t,e){return new hJt({check:"min_size",...br(e),minimum:t})}a(j5,"_minSize");function kZ(t,e){return new mJt({check:"size_equals",...br(e),size:t})}a(kZ,"_size");function PZ(t,e){return new gJt({check:"max_length",...br(e),maximum:t})}a(PZ,"_maxLength");function i8(t,e){return new AJt({check:"min_length",...br(e),minimum:t})}a(i8,"_minLength");function DZ(t,e){return new yJt({check:"length_equals",...br(e),length:t})}a(DZ,"_length");function Ofe(t,e){return new _Jt({check:"string_format",format:"regex",...br(e),pattern:t})}a(Ofe,"_regex");function Lfe(t){return new EJt({check:"string_format",format:"lowercase",...br(t)})}a(Lfe,"_lowercase");function Bfe(t){return new vJt({check:"string_format",format:"uppercase",...br(t)})}a(Bfe,"_uppercase");function Ffe(t,e){return new CJt({check:"string_format",format:"includes",...br(e),includes:t})}a(Ffe,"_includes");function Ufe(t,e){return new bJt({check:"string_format",format:"starts_with",...br(e),prefix:t})}a(Ufe,"_startsWith");function Qfe(t,e){return new SJt({check:"string_format",format:"ends_with",...br(e),suffix:t})}a(Qfe,"_endsWith");function mit(t,e,r){return new TJt({check:"property",property:t,schema:e,...br(r)})}a(mit,"_property");function qfe(t,e){return new IJt({check:"mime_type",mime:t,...br(e)})}a(qfe,"_mime");function U2(t){return new xJt({check:"overwrite",tx:t})}a(U2,"_overwrite");function jfe(t){return U2(e=>e.normalize(t))}a(jfe,"_normalize");function Hfe(){return U2(t=>t.trim())}a(Hfe,"_trim");function Gfe(){return U2(t=>t.toLowerCase())}a(Gfe,"_toLowerCase");function $fe(){return U2(t=>t.toUpperCase())}a($fe,"_toUpperCase");function Vfe(){return U2(t=>TKt(t))}a(Vfe,"_slugify");function per(t,e,r){return new t({type:"array",element:e,...br(r)})}a(per,"_array");function rhs(t,e,r){return new t({type:"union",options:e,...br(r)})}a(rhs,"_union");function nhs(t,e,r){return new t({type:"union",options:e,inclusive:!1,...br(r)})}a(nhs,"_xor");function ihs(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...br(n)})}a(ihs,"_discriminatedUnion");function ohs(t,e,r){return new t({type:"intersection",left:e,right:r})}a(ohs,"_intersection");function shs(t,e,r,n){let o=r instanceof po,s=o?n:r,c=o?r:null;return new t({type:"tuple",items:e,rest:c,...br(s)})}a(shs,"_tuple");function ahs(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...br(n)})}a(ahs,"_record");function chs(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...br(n)})}a(chs,"_map");function lhs(t,e,r){return new t({type:"set",valueType:e,...br(r)})}a(lhs,"_set");function uhs(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...br(r)})}a(uhs,"_enum");function dhs(t,e,r){return new t({type:"enum",entries:e,...br(r)})}a(dhs,"_nativeEnum");function fhs(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...br(r)})}a(fhs,"_literal");function her(t,e){return new t({type:"file",...br(e)})}a(her,"_file");function phs(t,e){return new t({type:"transform",transform:e})}a(phs,"_transform");function hhs(t,e){return new t({type:"optional",innerType:e})}a(hhs,"_optional");function mhs(t,e){return new t({type:"nullable",innerType:e})}a(mhs,"_nullable");function ghs(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():xKt(r)}})}a(ghs,"_default");function Ahs(t,e,r){return new t({type:"nonoptional",innerType:e,...br(r)})}a(Ahs,"_nonoptional");function yhs(t,e){return new t({type:"success",innerType:e})}a(yhs,"_success");function _hs(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(_hs,"_catch");function Ehs(t,e,r){return new t({type:"pipe",in:e,out:r})}a(Ehs,"_pipe");function vhs(t,e){return new t({type:"readonly",innerType:e})}a(vhs,"_readonly");function Chs(t,e,r){return new t({type:"template_literal",parts:e,...br(r)})}a(Chs,"_templateLiteral");function bhs(t,e){return new t({type:"lazy",getter:e})}a(bhs,"_lazy");function Shs(t,e){return new t({type:"promise",innerType:e})}a(Shs,"_promise");function mer(t,e,r){let n=br(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a(mer,"_custom");function ger(t,e,r){return new t({type:"custom",check:"custom",fn:e,...br(r)})}a(ger,"_refine");function Aer(t,e){let r=YOn(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(xfe(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(xfe(s))}},t(n.value,n)),e);return r}a(Aer,"_superRefine");function YOn(t,e){let r=new iu({check:"custom",...br(e)});return r._zod.check=t,r}a(YOn,"_check");function yer(t){let e=new iu({check:"describe"});return e._zod.onattach=[r=>{let n=ZA.get(r)??{};ZA.add(r,{...n,description:t})}],e._zod.check=()=>{},e}a(yer,"describe");function _er(t){let e=new iu({check:"meta"});return e._zod.onattach=[r=>{let n=ZA.get(r)??{};ZA.add(r,{...n,...t})}],e._zod.check=()=>{},e}a(_er,"meta");function Eer(t,e){let r=br(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(g=>typeof g=="string"?g.toLowerCase():g),o=o.map(g=>typeof g=="string"?g.toLowerCase():g));let s=new Set(n),c=new Set(o),l=t.Codec??Yke,u=t.Boolean??Wke,d=t.String??RZ,f=new d({type:"string",error:r.error}),h=new u({type:"boolean",error:r.error}),m=new l({type:"pipe",in:f,out:h,transform:a(((g,A)=>{let y=g;return r.case!=="sensitive"&&(y=y.toLowerCase()),s.has(y)?!0:c.has(y)?!1:(A.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:A.value,inst:m,continue:!1}),{})}),"transform"),reverseTransform:a(((g,A)=>g===!0?n[0]||"true":o[0]||"false"),"reverseTransform"),error:r.error});return m}a(Eer,"_stringbool");function Wfe(t,e,r,n={}){let o=br(n),s={...br(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:l=>r.test(l),...o};return r instanceof RegExp&&(s.pattern=r),new t(s)}a(Wfe,"_stringFormat");p();function $j(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??ZA,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}a($j,"initializeContext");function Jc(t,e,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let c={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,c);let l=t._zod.toJSONSchema?.();if(l)c.schema=l;else{let f={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,c.schema,f);else{let m=c.schema,g=e.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(t,e,m,f)}let h=t._zod.parent;h&&(c.ref||(c.ref=h),Jc(h,e,f),e.seen.get(h).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(c.schema,u),e.io==="input"&&Cv(t)&&(delete c.schema.examples,delete c.schema.default),e.io==="input"&&"_prefault"in c.schema&&((n=c.schema).default??(n.default=c.schema._prefault)),delete c.schema._prefault,e.seen.get(t).schema}a(Jc,"process");function Vj(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let c of t.seen.entries()){let l=t.metadataRegistry.get(c[0])?.id;if(l){let u=n.get(l);if(u&&u!==c[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(l,c[0])}}let o=a(c=>{let l=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let h=t.external.registry.get(c[0])?.id,m=t.external.uri??(A=>A);if(h)return{ref:m(h)};let g=c[1].defId??c[1].schema.id??`schema${t.counter++}`;return c[1].defId=g,{defId:g,ref:`${m("__shared")}#/${l}/${g}`}}if(c[1]===r)return{ref:"#"};let d=`#/${l}/`,f=c[1].schema.id??`__schema${t.counter++}`;return{defId:f,ref:d+f}},"makeURI"),s=a(c=>{if(c[1].schema.$ref)return;let l=c[1],{ref:u,defId:d}=o(c);l.def={...l.schema},d&&(l.defId=d);let f=l.schema;for(let h in f)delete f[h];f.$ref=u},"extractToDef");if(t.cycles==="throw")for(let c of t.seen.entries()){let l=c[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ + `)}g.write("payload.value = newResult;"),g.write("return payload;");let v=g.compile();return(S,T)=>v(m,S,T)},"generateFastpass"),s,c=wZ,l=!xZ.jitless,d=l&&xKt.value,f=e.catchall,h;t._zod.parse=(m,g)=>{h??(h=n.value);let A=m.value;return c(A)?l&&d&&g?.async===!1&&g.jitless!==!0?(s||(s=o(e.shape)),m=s(m,g),f?HOn([],A,m,g,h,t):m):r(m,g):(m.issues.push({expected:"object",code:"invalid_type",input:A,inst:t}),m)}});function xOn(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let o=t.filter(s=>!jj(s));return o.length===1?(e.value=o[0].value,o[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>Ev(c,n,Ep())))}),e)}a(xOn,"handleUnionResults");var zke=ct("$ZodUnion",(t,e)=>{po.init(t,e),Ls(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Ls(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Ls(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),Ls(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>Mke(o.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,c=[];for(let l of e.options){let u=l._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)c.push(u),s=!0;else{if(u.issues.length===0)return u;c.push(u)}}return s?Promise.all(c).then(l=>xOn(l,n,t,o)):xOn(c,n,t,o)}});function wOn(t,e,r,n){let o=t.filter(s=>s.issues.length===0);return o.length===1?(e.value=o[0].value,e):(o.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>Ev(c,n,Ep())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}a(wOn,"handleExclusiveUnionResults");var mZt=ct("$ZodXor",(t,e)=>{zke.init(t,e),e.inclusive=!1;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,c=[];for(let l of e.options){let u=l._zod.run({value:n.value,issues:[]},o);u instanceof Promise?(c.push(u),s=!0):c.push(u)}return s?Promise.all(c).then(l=>wOn(l,n,t,o)):wOn(c,n,t,o)}}),gZt=ct("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,zke.init(t,e);let r=t._zod.parse;Ls(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=xfe(()=>{let o=e.options,s=new Map;for(let c of o){let l=c._zod.propValues?.[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let u of l){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,c)}}return s});t._zod.parse=(o,s)=>{let c=o.value;if(!wZ(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),o;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(o,s):e.unionFallback||s.direction==="backward"?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:c,path:[e.discriminator],inst:t}),o)}}),AZt=ct("$ZodIntersection",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),c=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([u,d])=>ROn(r,u,d)):ROn(r,s,c)}});function kJt(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(qj(t)&&qj(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let c=kJt(t[s],e[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;nl.l&&l.r).map(([l])=>l);if(s.length&&o&&t.issues.push({...o,keys:s}),jj(t))return t;let c=kJt(e.value,r.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return t.value=c.data,t}a(ROn,"handleIntersectionResults");var Qnt=ct("$ZodTuple",(t,e)=>{po.init(t,e);let r=e.items;t._zod.parse=(n,o)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({input:s,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let c=[],l=kOn(r,"optin"),u=kOn(r,"optout");if(!e.rest){if(s.lengthr.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:s,inst:t,origin:"array"})}let d=new Array(r.length);for(let f=0;f{d[f]=m})):d[f]=h}if(e.rest){let f=r.length-1,h=s.slice(r.length);for(let m of h){f++;let g=e.rest._zod.run({value:m,issues:[]},o);g instanceof Promise?c.push(g.then(A=>POn(A,n,f))):POn(g,n,f)}}return c.length?Promise.all(c).then(()=>DOn(d,n,r,s,u)):DOn(d,n,r,s,u)}});function kOn(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}a(kOn,"getTupleOptStart");function POn(t,e,r){t.issues.length&&e.issues.push(...bb(r,t.issues)),e.value[r]=t.value}a(POn,"handleTupleResult");function DOn(t,e,r,n,o){for(let s=0;s=o){e.value.length=s;break}e.issues.push(...bb(s,c.issues))}e.value[s]=c.value}for(let s=e.value.length-1;s>=n.length&&(r[s]._zod.optout==="optional"&&e.value[s]===void 0);s--)e.value.length=s;return e}a(DOn,"handleTupleResults");var yZt=ct("$ZodRecord",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!qj(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[],c=e.keyType._zod.values;if(c){r.value={};let l=new Set;for(let d of c)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){l.add(typeof d=="number"?d.toString():d);let f=e.keyType._zod.run({value:d,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(g=>Ev(g,n,Ep())),input:d,path:[d],inst:t});continue}let h=f.value,m=e.valueType._zod.run({value:o[d],issues:[]},n);m instanceof Promise?s.push(m.then(g=>{g.issues.length&&r.issues.push(...bb(d,g.issues)),r.value[h]=g.value})):(m.issues.length&&r.issues.push(...bb(d,m.issues)),r.value[h]=m.value)}let u;for(let d in o)l.has(d)||(u=u??[],u.push(d));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:u})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,l))continue;let u=e.keyType._zod.run({value:l,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Pnt.test(l)&&u.issues.length){let h=e.keyType._zod.run({value:Number(l),issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(u=h)}if(u.issues.length){e.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(h=>Ev(h,n,Ep())),input:l,path:[l],inst:t});continue}let f=e.valueType._zod.run({value:o[l],issues:[]},n);f instanceof Promise?s.push(f.then(h=>{h.issues.length&&r.issues.push(...bb(l,h.issues)),r.value[u.value]=h.value})):(f.issues.length&&r.issues.push(...bb(l,f.issues)),r.value[u.value]=f.value)}}return s.length?Promise.all(s).then(()=>r):r}}),_Zt=ct("$ZodMap",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let s=[];r.value=new Map;for(let[c,l]of o){let u=e.keyType._zod.run({value:c,issues:[]},n),d=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise||d instanceof Promise?s.push(Promise.all([u,d]).then(([f,h])=>{NOn(f,h,r,c,o,t,n)})):NOn(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function NOn(t,e,r,n,o,s,c){t.issues.length&&(Oke.has(typeof n)?r.issues.push(...bb(n,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:s,issues:t.issues.map(l=>Ev(l,c,Ep()))})),e.issues.length&&(Oke.has(typeof n)?r.issues.push(...bb(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>Ev(l,c,Ep()))})),r.value.set(t.value,e.value)}a(NOn,"handleMapResult");var EZt=ct("$ZodSet",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let c of o){let l=e.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(u=>MOn(u,r))):MOn(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function MOn(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(MOn,"handleSetResult");var vZt=ct("$ZodEnum",(t,e)=>{po.init(t,e);let r=Nke(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>Oke.has(typeof o)).map(o=>typeof o=="string"?Gw(o):o.toString()).join("|")})$`),t._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:t}),o}}),CZt=ct("$ZodLiteral",(t,e)=>{if(po.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Gw(n):n?Gw(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}}),bZt=ct("$ZodFile",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),SZt=ct("$ZodTransform",(t,e)=>{po.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Fj(t.constructor.name);let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r.fallback=!0,r));if(o instanceof Promise)throw new F2;return r.value=o,r.fallback=!0,r}});function OOn(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}a(OOn,"handleOptionalResult");var qnt=ct("$ZodOptional",(t,e)=>{po.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Ls(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Ls(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Mke(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let o=r.value,s=e.innerType._zod.run(r,n);return s instanceof Promise?s.then(c=>OOn(c,o)):OOn(s,o)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),TZt=ct("$ZodExactOptional",(t,e)=>{qnt.init(t,e),Ls(t._zod,"values",()=>e.innerType._zod.values),Ls(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),IZt=ct("$ZodNullable",(t,e)=>{po.init(t,e),Ls(t._zod,"optin",()=>e.innerType._zod.optin),Ls(t._zod,"optout",()=>e.innerType._zod.optout),Ls(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Mke(r.source)}|null)$`):void 0}),Ls(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),xZt=ct("$ZodDefault",(t,e)=>{po.init(t,e),t._zod.optin="optional",Ls(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>LOn(s,e)):LOn(o,e)}});function LOn(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(LOn,"handleDefaultResult");var wZt=ct("$ZodPrefault",(t,e)=>{po.init(t,e),t._zod.optin="optional",Ls(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),RZt=ct("$ZodNonOptional",(t,e)=>{po.init(t,e),Ls(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>BOn(s,t)):BOn(o,t)}});function BOn(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}a(BOn,"handleNonOptionalResult");var kZt=ct("$ZodSuccess",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Fj("ZodSuccess");let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),PZt=ct("$ZodCatch",(t,e)=>{po.init(t,e),t._zod.optin="optional",Ls(t._zod,"optout",()=>e.innerType._zod.optout),Ls(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>Ev(c,n,Ep()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>Ev(s,n,Ep()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),DZt=ct("$ZodNaN",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),jnt=ct("$ZodPipe",(t,e)=>{po.init(t,e),Ls(t._zod,"values",()=>e.in._zod.values),Ls(t._zod,"optin",()=>e.in._zod.optin),Ls(t._zod,"optout",()=>e.out._zod.optout),Ls(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Mnt(c,e.in,n)):Mnt(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Mnt(s,e.out,n)):Mnt(o,e.out,n)}});function Mnt(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}a(Mnt,"handlePipeResult");var Yke=ct("$ZodCodec",(t,e)=>{po.init(t,e),Ls(t._zod,"values",()=>e.in._zod.values),Ls(t._zod,"optin",()=>e.in._zod.optin),Ls(t._zod,"optout",()=>e.out._zod.optout),Ls(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let s=e.in._zod.run(r,n);return s instanceof Promise?s.then(c=>Ont(c,e,n)):Ont(s,e,n)}else{let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Ont(c,e,n)):Ont(s,e,n)}}});function Ont(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let o=e.transform(t.value,t);return o instanceof Promise?o.then(s=>Lnt(t,s,e.out,r)):Lnt(t,o,e.out,r)}else{let o=e.reverseTransform(t.value,t);return o instanceof Promise?o.then(s=>Lnt(t,s,e.in,r)):Lnt(t,o,e.in,r)}}a(Ont,"handleCodecAResult");function Lnt(t,e,r,n){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},n)}a(Lnt,"handleCodecTxResult");var NZt=ct("$ZodPreprocess",(t,e)=>{jnt.init(t,e)}),MZt=ct("$ZodReadonly",(t,e)=>{po.init(t,e),Ls(t._zod,"propValues",()=>e.innerType._zod.propValues),Ls(t._zod,"values",()=>e.innerType._zod.values),Ls(t._zod,"optin",()=>e.innerType?._zod?.optin),Ls(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(FOn):FOn(o)}});function FOn(t){return t.value=Object.freeze(t.value),t}a(FOn,"handleReadonlyResult");var OZt=ct("$ZodTemplateLiteral",(t,e)=>{po.init(t,e);let r=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let s=o.startsWith("^")?1:0,c=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(s,c))}else if(n===null||RKt.has(typeof n))r.push(Gw(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"string",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),n)}),LZt=ct("$ZodFunction",(t,e)=>(po.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let o=t._def.input?qke(t._def.input,n):n,s=Reflect.apply(r,this,o);return t._def.output?qke(t._def.output,s):s}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let o=t._def.input?await jke(t._def.input,n):n,s=await Reflect.apply(r,this,o);return t._def.output?await jke(t._def.output,s):s}},t._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let n=t.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Qnt({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new n({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let n=t.constructor;return new n({type:"function",input:t._def.input,output:r})},t)),BZt=ct("$ZodPromise",(t,e)=>{po.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),FZt=ct("$ZodLazy",(t,e)=>{po.init(t,e),Ls(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),Ls(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),Ls(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),Ls(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),Ls(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),UZt=ct("$ZodCustom",(t,e)=>{iu.init(t,e),po.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>UOn(s,r,n,t));UOn(o,r,n,t)}});function UOn(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(wfe(o))}}a(UOn,"handleRefineResult");var ePe={};Ti(ePe,{ar:()=>QZt,az:()=>qZt,be:()=>jZt,bg:()=>HZt,ca:()=>GZt,cs:()=>$Zt,da:()=>VZt,de:()=>WZt,el:()=>zZt,en:()=>Kke,eo:()=>YZt,es:()=>KZt,fa:()=>JZt,fi:()=>ZZt,fr:()=>XZt,frCA:()=>eXt,he:()=>tXt,hr:()=>rXt,hu:()=>nXt,hy:()=>iXt,id:()=>oXt,is:()=>sXt,it:()=>aXt,ja:()=>cXt,ka:()=>lXt,kh:()=>uXt,km:()=>Jke,ko:()=>dXt,lt:()=>fXt,mk:()=>pXt,ms:()=>hXt,nl:()=>mXt,no:()=>gXt,ota:()=>AXt,pl:()=>_Xt,ps:()=>yXt,pt:()=>EXt,ro:()=>vXt,ru:()=>CXt,sl:()=>bXt,sv:()=>SXt,ta:()=>TXt,th:()=>IXt,tr:()=>xXt,ua:()=>wXt,uk:()=>Xke,ur:()=>RXt,uz:()=>kXt,vi:()=>PXt,yo:()=>MXt,zhCN:()=>DXt,zhTW:()=>NXt});p();p();var aps=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${l}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${s}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${l}`}case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${Zt(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${r[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${_t(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function QZt(){return{localeError:aps()}}a(QZt,"default");p();var cps=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${o.expected}, daxil olan ${l}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${s}, daxil olan ${l}`}case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${Zt(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function qZt(){return{localeError:cps()}}a(qZt,"default");p();function $On(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}a($On,"getBelarusianPlural");var lps=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},n={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${l}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${s}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${l}`}case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${Zt(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=$On(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=$On(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function jZt(){return{localeError:lps()}}a(jZt,"default");p();var ups=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${l}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${s}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${l}`}case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${Zt(o.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;if(s.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${s.prefix}"`;if(s.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${s.suffix}"`;if(s.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${s.includes}"`;if(s.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${s.pattern}`;let c="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return s.format==="emoji"&&(c="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="datetime"&&(c="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="date"&&(c="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),s.format==="time"&&(c="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="duration"&&(c="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${c} ${r[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${o.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u043E\u0432\u0435":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},"error");function HZt(){return{localeError:ups()}}a(HZt,"default");p();var dps=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${o.expected}, s'ha rebut ${l}`:`Tipus inv\xE0lid: s'esperava ${s}, s'ha rebut ${l}`}case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${Zt(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${_t(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${r[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function GZt(){return{localeError:dps()}}a(GZt,"default");p();var fps=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${o.expected}, obdr\u017Eeno ${l}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${s}, obdr\u017Eeno ${l}`}case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${Zt(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${r[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${_t(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function $Zt(){return{localeError:fps()}}a($Zt,"default");p();var pps=a(()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Ugyldigt input: forventede instanceof ${o.expected}, fik ${l}`:`Ugyldigt input: forventede ${s}, fik ${l}`}case"invalid_value":return o.values.length===1?`Ugyldig v\xE6rdi: forventede ${Zt(o.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin),l=n[o.origin]??o.origin;return c?`For stor: forventede ${l??"value"} ${c.verb} ${s} ${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor: forventede ${l??"value"} havde ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin),l=n[o.origin]??o.origin;return c?`For lille: forventede ${l} ${c.verb} ${s} ${o.minimum.toString()} ${c.unit}`:`For lille: forventede ${l} havde ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: skal starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: skal ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: skal indeholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${r[s.format]??o.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${o.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${o.origin}`;default:return"Ugyldigt input"}}},"error");function VZt(){return{localeError:pps()}}a(VZt,"default");p();var hps=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${o.expected}, erhalten ${l}`:`Ung\xFCltige Eingabe: erwartet ${s}, erhalten ${l}`}case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${Zt(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${r[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function WZt(){return{localeError:hps()}}a(WZt,"default");p();var mps=a(()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return typeof o.expected=="string"&&/^[A-Z]/.test(o.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${o.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${l}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${s}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${l}`}case"invalid_value":return o.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${Zt(o.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${s}${o.maximum.toString()} ${c.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${s}${o.minimum.toString()} ${c.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${s.prefix}"`:s.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${s.suffix}"`:s.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${s.includes}"`:s.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${s.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[s.format]??o.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${o.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${o.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${o.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${o.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${o.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}},"error");function zZt(){return{localeError:mps()}}a(zZt,"default");p();var gps=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return`Invalid input: expected ${s}, received ${l}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${Zt(o.values[0])}`:`Invalid option: expected one of ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${c.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(c=>`'${c}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}},"error");function Kke(){return{localeError:gps()}}a(Kke,"default");p();var Aps=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${o.expected}, ricevi\u011Dis ${l}`:`Nevalida enigo: atendi\u011Dis ${s}, ricevi\u011Dis ${l}`}case"invalid_value":return o.values.length===1?`Nevalida enigo: atendi\u011Dis ${Zt(o.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${s}${o.maximum.toString()} ${c.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Tro malgranda: atendi\u011Dis ke ${o.origin} havu ${s}${o.minimum.toString()} ${c.unit}`:`Tro malgranda: atendi\u011Dis ke ${o.origin} estu ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${s.prefix}"`:s.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${s.suffix}"`:s.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${s.includes}"`:s.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${s.pattern}`:`Nevalida ${r[s.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} \u015Dlosilo${o.keys.length>1?"j":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}},"error");function YZt(){return{localeError:Aps()}}a(YZt,"default");p();var yps=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${o.expected}, recibido ${l}`:`Entrada inv\xE1lida: se esperaba ${s}, recibido ${l}`}case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${Zt(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin),l=n[o.origin]??o.origin;return c?`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${l??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin),l=n[o.origin]??o.origin;return c?`Demasiado peque\xF1o: se esperaba que ${l} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${l} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${r[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n[o.origin]??o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n[o.origin]??o.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function KZt(){return{localeError:yps()}}a(KZt,"default");p();var _ps=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${l} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${s} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${l} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${Zt(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${_t(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${_t(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function JZt(){return{localeError:_ps()}}a(JZt,"default");p();var Eps=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Virheellinen tyyppi: odotettiin instanceof ${o.expected}, oli ${l}`:`Virheellinen tyyppi: odotettiin ${s}, oli ${l}`}case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${Zt(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${r[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${_t(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function ZZt(){return{localeError:Eps()}}a(ZZt,"default");p();var vps=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Entr\xE9e invalide : instanceof ${o.expected} attendu, ${l} re\xE7u`:`Entr\xE9e invalide : ${s} attendu, ${l} re\xE7u`}case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${Zt(o.values[0])} attendu`:`Option invalide : une valeur parmi ${_t(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${n[o.origin]??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n[o.origin]??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${n[o.origin]??"valeur"} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${n[o.origin]??"valeur"} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${r[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${_t(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function XZt(){return{localeError:vps()}}a(XZt,"default");p();var Cps=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Entr\xE9e invalide : attendu instanceof ${o.expected}, re\xE7u ${l}`:`Entr\xE9e invalide : attendu ${s}, re\xE7u ${l}`}case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${Zt(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${r[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${_t(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function eXt(){return{localeError:Cps()}}a(eXt,"default");p();var bps=a(()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=a(d=>d?t[d]:void 0,"typeEntry"),n=a(d=>{let f=r(d);return f?f.label:d??t.unknown.label},"typeLabel"),o=a(d=>`\u05D4${n(d)}`,"withDefinite"),s=a(d=>(r(d)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA","verbFor"),c=a(d=>d?e[d]??null:null,"getSizing"),l={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return d=>{switch(d.code){case"invalid_type":{let f=d.expected,h=u[f??""]??n(f),m=nr(d.input),g=u[m]??t[m]?.label??m;return/^[A-Z]/.test(d.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${d.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`}case"invalid_value":{if(d.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${Zt(d.values[0])}`;let f=d.values.map(g=>Zt(g));if(d.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${f[0]} \u05D0\u05D5 ${f[1]}`;let h=f[f.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${f.slice(0,-1).join(", ")} \u05D0\u05D5 ${h}`}case"too_big":{let f=c(d.origin),h=o(d.origin??"value");if(d.origin==="string")return`${f?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.maximum.toString()} ${f?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(d.origin==="number"){let A=d.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${d.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${A}`}if(d.origin==="array"||d.origin==="set"){let A=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=d.inclusive?`${d.maximum} ${f?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${d.maximum} ${f?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} ${A} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=d.inclusive?"<=":"<",g=s(d.origin??"value");return f?.unit?`${f.longLabel} \u05DE\u05D3\u05D9: ${h} ${g} ${m}${d.maximum.toString()} ${f.unit}`:`${f?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${h} ${g} ${m}${d.maximum.toString()}`}case"too_small":{let f=c(d.origin),h=o(d.origin??"value");if(d.origin==="string")return`${f?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.minimum.toString()} ${f?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(d.origin==="number"){let A=d.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${d.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${A}`}if(d.origin==="array"||d.origin==="set"){let A=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(d.minimum===1&&d.inclusive){let _=(d.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${A} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`}let y=d.inclusive?`${d.minimum} ${f?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${d.minimum} ${f?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${A} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=d.inclusive?">=":">",g=s(d.origin??"value");return f?.unit?`${f.shortLabel} \u05DE\u05D3\u05D9: ${h} ${g} ${m}${d.minimum.toString()} ${f.unit}`:`${f?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${h} ${g} ${m}${d.minimum.toString()}`}case"invalid_format":{let f=d;if(f.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${f.prefix}"`;if(f.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${f.suffix}"`;if(f.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${f.includes}"`;if(f.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${f.pattern}`;let h=l[f.format],m=h?.label??f.format,A=(h?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${A}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${d.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${d.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${d.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${_t(d.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o(d.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function tXt(){return{localeError:bps()}}a(tXt,"default");p();var Sps=a(()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},n={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${o.expected}, a primljeno je ${l}`:`Neispravan unos: o\u010Dekuje se ${s}, a primljeno je ${l}`}case"invalid_value":return o.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${Zt(o.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin),l=n[o.origin]??o.origin;return c?`Preveliko: o\u010Dekivano da ${l??"vrijednost"} ima ${s}${o.maximum.toString()} ${c.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${l??"vrijednost"} bude ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin),l=n[o.origin]??o.origin;return c?`Premalo: o\u010Dekivano da ${l} ima ${s}${o.minimum.toString()} ${c.unit}`:`Premalo: o\u010Dekivano da ${l} bude ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${s.prefix}"`:s.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${s.suffix}"`:s.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${s.includes}"`:s.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${s.pattern}`:`Neispravna ${r[s.format]??o.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${o.divisor}`;case"unrecognized_keys":return`Neprepoznat${o.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${n[o.origin]??o.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${n[o.origin]??o.origin}`;default:return"Neispravan unos"}}},"error");function rXt(){return{localeError:Sps()}}a(rXt,"default");p();var Tps=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${o.expected}, a kapott \xE9rt\xE9k ${l}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${s}, a kapott \xE9rt\xE9k ${l}`}case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${Zt(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function nXt(){return{localeError:Tps()}}a(nXt,"default");p();function VOn(t,e,r){return Math.abs(t)===1?e:r}a(VOn,"getArmenianPlural");function Ofe(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}a(Ofe,"withDefiniteArticle");var Ips=a(()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},n={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${o.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${l}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${s}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${l}`}case"invalid_value":return o.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${Zt(o.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=VOn(l,c.unit.one,c.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ofe(o.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${s}${o.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ofe(o.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=VOn(l,c.unit.one,c.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ofe(o.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${s}${o.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ofe(o.origin)} \u056C\u056B\u0576\u056B ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${s.prefix}"-\u0578\u057E`:s.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${s.suffix}"-\u0578\u057E`:s.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${s.includes}"`:s.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${s.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[s.format]??o.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${o.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${o.keys.length>1?"\u0576\u0565\u0580":""}. ${_t(o.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Ofe(o.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Ofe(o.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function iXt(){return{localeError:Ips()}}a(iXt,"default");p();var xps=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Input tidak valid: diharapkan instanceof ${o.expected}, diterima ${l}`:`Input tidak valid: diharapkan ${s}, diterima ${l}`}case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${Zt(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${r[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"error");function oXt(){return{localeError:xps()}}a(oXt,"default");p();var wps=a(()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},n={nan:"NaN",number:"n\xFAmer",array:"fylki"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${l} \xFEar sem \xE1 a\xF0 vera instanceof ${o.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${l} \xFEar sem \xE1 a\xF0 vera ${s}`}case"invalid_value":return o.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${Zt(o.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} hafi ${s}${o.maximum.toString()} ${c.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} s\xE9 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} hafi ${s}${o.minimum.toString()} ${c.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} s\xE9 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${s.prefix}"`:s.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${s.suffix}"`:s.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${s.includes}"`:s.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${s.pattern}`:`Rangt ${r[s.format]??o.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${o.origin}`;default:return"Rangt gildi"}}},"error");function sXt(){return{localeError:wps()}}a(sXt,"default");p();var Rps=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Input non valido: atteso instanceof ${o.expected}, ricevuto ${l}`:`Input non valido: atteso ${s}, ricevuto ${l}`}case"invalid_value":return o.values.length===1?`Input non valido: atteso ${Zt(o.values[0])}`:`Opzione non valida: atteso uno tra ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Input non valido: ${r[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"error");function aXt(){return{localeError:Rps()}}a(aXt,"default");p();var kps=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},n={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${l}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${s}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${l}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${Zt(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${_t(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${_t(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function cXt(){return{localeError:kps()}}a(cXt,"default");p();var Pps=a(()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},n={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${o.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${l}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${s}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${l}`}case"invalid_value":return o.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${Zt(o.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${_t(o.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin} \u10D8\u10E7\u10DD\u10E1 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${s.prefix}"-\u10D8\u10D7`:s.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${s.suffix}"-\u10D8\u10D7`:s.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${s.includes}"-\u10E1`:s.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${s.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${o.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${o.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${o.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${o.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},"error");function lXt(){return{localeError:Pps()}}a(lXt,"default");p();p();var Dps=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},n={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${l}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${s} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${l}`}case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Zt(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${_t(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function Jke(){return{localeError:Dps()}}a(Jke,"default");function uXt(){return Jke()}a(uXt,"default");p();var Nps=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${l}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${s}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${l}\uC785\uB2C8\uB2E4`}case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${Zt(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${_t(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${_t(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function dXt(){return{localeError:Nps()}}a(dXt,"default");p();var Zke=a(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalizeFirstCharacter");function WOn(t){let e=Math.abs(t),r=e%10,n=e%100;return n>=11&&n<=19||r===0?"many":r===1?"one":"few"}a(WOn,"getUnitTypeFromNumber");var Mps=a(()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(o,s,c,l){let u=t[o]??null;return u===null?u:{unit:u.unit[s],verb:u.verb[l][c?"inclusive":"notInclusive"]}}a(e,"getSizing");let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},n={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Gautas tipas ${l}, o tik\u0117tasi - instanceof ${o.expected}`:`Gautas tipas ${l}, o tik\u0117tasi - ${s}`}case"invalid_value":return o.values.length===1?`Privalo b\u016Bti ${Zt(o.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${_t(o.values,"|")} pasirinkim\u0173`;case"too_big":{let s=n[o.origin]??o.origin,c=e(o.origin,WOn(Number(o.maximum)),o.inclusive??!1,"smaller");if(c?.verb)return`${Zke(s??o.origin??"reik\u0161m\u0117")} ${c.verb} ${o.maximum.toString()} ${c.unit??"element\u0173"}`;let l=o.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Zke(s??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${l} ${o.maximum.toString()} ${c?.unit}`}case"too_small":{let s=n[o.origin]??o.origin,c=e(o.origin,WOn(Number(o.minimum)),o.inclusive??!1,"bigger");if(c?.verb)return`${Zke(s??o.origin??"reik\u0161m\u0117")} ${c.verb} ${o.minimum.toString()} ${c.unit??"element\u0173"}`;let l=o.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Zke(s??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${l} ${o.minimum.toString()} ${c?.unit}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${s.prefix}"`:s.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${s.suffix}"`:s.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${s.includes}"`:s.format==="regex"?`Eilut\u0117 privalo atitikti ${s.pattern}`:`Neteisingas ${r[s.format]??o.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${_t(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let s=n[o.origin]??o.origin;return`${Zke(s??o.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function fXt(){return{localeError:Mps()}}a(fXt,"default");p();var Ops=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},n={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${l}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${s}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${l}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${Zt(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${r[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function pXt(){return{localeError:Ops()}}a(pXt,"default");p();var Lps=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Input tidak sah: dijangka instanceof ${o.expected}, diterima ${l}`:`Input tidak sah: dijangka ${s}, diterima ${l}`}case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${Zt(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${r[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${_t(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"error");function hXt(){return{localeError:Lps()}}a(hXt,"default");p();var Bps=a(()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Ongeldige invoer: verwacht instanceof ${o.expected}, ontving ${l}`:`Ongeldige invoer: verwacht ${s}, ontving ${l}`}case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${Zt(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin),l=o.origin==="date"?"laat":o.origin==="string"?"lang":"groot";return c?`Te ${l}: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} ${c.verb}`:`Te ${l}: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin),l=o.origin==="date"?"vroeg":o.origin==="string"?"kort":"klein";return c?`Te ${l}: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} ${c.verb}`:`Te ${l}: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${r[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"error");function mXt(){return{localeError:Bps()}}a(mXt,"default");p();var Fps=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Ugyldig input: forventet instanceof ${o.expected}, fikk ${l}`:`Ugyldig input: forventet ${s}, fikk ${l}`}case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${Zt(o.values[0])}`:`Ugyldig valg: forventet en av ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${r[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"error");function gXt(){return{localeError:Fps()}}a(gXt,"default");p();var Ups=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`F\xE2sit giren: umulan instanceof ${o.expected}, al\u0131nan ${l}`:`F\xE2sit giren: umulan ${s}, al\u0131nan ${l}`}case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${Zt(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function AXt(){return{localeError:Ups()}}a(AXt,"default");p();var Qps=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${l} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${s} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${l} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${Zt(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${_t(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function yXt(){return{localeError:Qps()}}a(yXt,"default");p();var qps=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},n={nan:"NaN",number:"liczba",array:"tablica"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${o.expected}, otrzymano ${l}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${s}, otrzymano ${l}`}case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Zt(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function _Xt(){return{localeError:qps()}}a(_Xt,"default");p();var jps=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"n\xFAmero",null:"nulo"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Tipo inv\xE1lido: esperado instanceof ${o.expected}, recebido ${l}`:`Tipo inv\xE1lido: esperado ${s}, recebido ${l}`}case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${Zt(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${r[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"error");function EXt(){return{localeError:jps()}}a(EXt,"default");p();var Hps=a(()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},n={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return`Intrare invalid\u0103: a\u0219teptat ${s}, primit ${l}`}case"invalid_value":return o.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${Zt(o.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Prea mare: a\u0219teptat ca ${o.origin??"valoarea"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${o.origin??"valoarea"} s\u0103 fie ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Prea mic: a\u0219teptat ca ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Prea mic: a\u0219teptat ca ${o.origin} s\u0103 fie ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${s.prefix}"`:s.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${s.suffix}"`:s.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${s.includes}"`:s.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${s.pattern}`:`Format invalid: ${r[s.format]??o.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${o.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${_t(o.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${o.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${o.origin}`;default:return"Intrare invalid\u0103"}}},"error");function vXt(){return{localeError:Hps()}}a(vXt,"default");p();function zOn(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}a(zOn,"getRussianPlural");var Gps=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${l}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${s}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${l}`}case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Zt(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=zOn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=zOn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function CXt(){return{localeError:Gps()}}a(CXt,"default");p();var $ps=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${o.expected}, prejeto ${l}`:`Neveljaven vnos: pri\u010Dakovano ${s}, prejeto ${l}`}case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${Zt(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${r[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"error");function bXt(){return{localeError:$ps()}}a(bXt,"default");p();var Vps=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${o.expected}, fick ${l}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${s}, fick ${l}`}case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${Zt(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${r[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${_t(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function SXt(){return{localeError:Vps()}}a(SXt,"default");p();var Wps=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${l}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${l}`}case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Zt(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${_t(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function TXt(){return{localeError:Wps()}}a(TXt,"default");p();var zps=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},n={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${l}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${s} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${l}`}case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${Zt(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${_t(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function IXt(){return{localeError:zps()}}a(IXt,"default");p();var Yps=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${o.expected}, al\u0131nan ${l}`:`Ge\xE7ersiz de\u011Fer: beklenen ${s}, al\u0131nan ${l}`}case"invalid_value":return o.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Zt(o.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${s}${o.maximum.toString()} ${c.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ge\xE7ersiz metin: "${s.prefix}" ile ba\u015Flamal\u0131`:s.format==="ends_with"?`Ge\xE7ersiz metin: "${s.suffix}" ile bitmeli`:s.format==="includes"?`Ge\xE7ersiz metin: "${s.includes}" i\xE7ermeli`:s.format==="regex"?`Ge\xE7ersiz metin: ${s.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[s.format]??o.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${o.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${o.keys.length>1?"lar":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${o.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function xXt(){return{localeError:Yps()}}a(xXt,"default");p();p();var Kps=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${l}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${s}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${l}`}case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Zt(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function Xke(){return{localeError:Kps()}}a(Xke,"default");function wXt(){return Xke()}a(wXt,"default");p();var Jps=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},n={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${l} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${s} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${l} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${Zt(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${_t(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${_t(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function RXt(){return{localeError:Jps()}}a(RXt,"default");p();var Zps=a(()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${o.expected}, qabul qilingan ${l}`:`Noto\u2018g\u2018ri kirish: kutilgan ${s}, qabul qilingan ${l}`}case"invalid_value":return o.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${Zt(o.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Juda katta: kutilgan ${o.origin??"qiymat"} ${s}${o.maximum.toString()} ${c.unit} ${c.verb}`:`Juda katta: kutilgan ${o.origin??"qiymat"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Juda kichik: kutilgan ${o.origin} ${s}${o.minimum.toString()} ${c.unit} ${c.verb}`:`Juda kichik: kutilgan ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${s.prefix}" bilan boshlanishi kerak`:s.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${s.suffix}" bilan tugashi kerak`:s.format==="includes"?`Noto\u2018g\u2018ri satr: "${s.includes}" ni o\u2018z ichiga olishi kerak`:s.format==="regex"?`Noto\u2018g\u2018ri satr: ${s.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[s.format]??o.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${o.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${o.keys.length>1?"lar":""}: ${_t(o.keys,", ")}`;case"invalid_key":return`${o.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${o.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}},"error");function kXt(){return{localeError:Zps()}}a(kXt,"default");p();var Xps=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},n={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${l}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${s}, nh\u1EADn \u0111\u01B0\u1EE3c ${l}`}case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Zt(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${r[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${_t(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function PXt(){return{localeError:Xps()}}a(PXt,"default");p();var ehs=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},n={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${l}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${s}\uFF0C\u5B9E\u9645\u63A5\u6536 ${l}`}case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Zt(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${r[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${_t(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function DXt(){return{localeError:ehs()}}a(DXt,"default");p();var ths=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${o.expected}\uFF0C\u4F46\u6536\u5230 ${l}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${s}\uFF0C\u4F46\u6536\u5230 ${l}`}case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${Zt(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${r[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${_t(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function NXt(){return{localeError:ths()}}a(NXt,"default");p();var rhs=a(()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},n={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,c=nr(o.input),l=n[c]??c;return/^[A-Z]/.test(o.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${o.expected}, \xE0m\u1ECD\u0300 a r\xED ${l}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${s}, \xE0m\u1ECD\u0300 a r\xED ${l}`}case"invalid_value":return o.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${Zt(o.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${_t(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${o.origin??"iye"} ${c.verb} ${s}${o.maximum} ${c.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${s}${o.maximum}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${o.origin} ${c.verb} ${s}${o.minimum} ${c.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${s}${o.minimum}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${s.prefix}"`:s.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${s.suffix}"`:s.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${s.includes}"`:s.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${s.pattern}`:`A\u1E63\xEC\u1E63e: ${r[s.format]??o.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${o.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${_t(o.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${o.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${o.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},"error");function MXt(){return{localeError:rhs()}}a(MXt,"default");p();var YOn,OXt=Symbol("ZodOutput"),LXt=Symbol("ZodInput"),Hnt=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Gnt(){return new Hnt}a(Gnt,"registry");(YOn=globalThis).__zod_globalRegistry??(YOn.__zod_globalRegistry=Gnt());var ZA=globalThis.__zod_globalRegistry;p();function BXt(t,e){return new t({type:"string",...br(e)})}a(BXt,"_string");function FXt(t,e){return new t({type:"string",coerce:!0,...br(e)})}a(FXt,"_coercedString");function $nt(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...br(e)})}a($nt,"_email");function tPe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...br(e)})}a(tPe,"_guid");function Vnt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...br(e)})}a(Vnt,"_uuid");function Wnt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...br(e)})}a(Wnt,"_uuidv4");function znt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...br(e)})}a(znt,"_uuidv6");function Ynt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...br(e)})}a(Ynt,"_uuidv7");function rPe(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...br(e)})}a(rPe,"_url");function Knt(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...br(e)})}a(Knt,"_emoji");function Jnt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...br(e)})}a(Jnt,"_nanoid");function Znt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...br(e)})}a(Znt,"_cuid");function Xnt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...br(e)})}a(Xnt,"_cuid2");function eit(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...br(e)})}a(eit,"_ulid");function tit(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...br(e)})}a(tit,"_xid");function rit(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...br(e)})}a(rit,"_ksuid");function nit(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...br(e)})}a(nit,"_ipv4");function iit(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...br(e)})}a(iit,"_ipv6");function UXt(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...br(e)})}a(UXt,"_mac");function oit(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...br(e)})}a(oit,"_cidrv4");function sit(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...br(e)})}a(sit,"_cidrv6");function ait(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...br(e)})}a(ait,"_base64");function cit(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...br(e)})}a(cit,"_base64url");function lit(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...br(e)})}a(lit,"_e164");function uit(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...br(e)})}a(uit,"_jwt");var QXt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function qXt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...br(e)})}a(qXt,"_isoDateTime");function jXt(t,e){return new t({type:"string",format:"date",check:"string_format",...br(e)})}a(jXt,"_isoDate");function HXt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...br(e)})}a(HXt,"_isoTime");function GXt(t,e){return new t({type:"string",format:"duration",check:"string_format",...br(e)})}a(GXt,"_isoDuration");function $Xt(t,e){return new t({type:"number",checks:[],...br(e)})}a($Xt,"_number");function VXt(t,e){return new t({type:"number",coerce:!0,checks:[],...br(e)})}a(VXt,"_coercedNumber");function WXt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...br(e)})}a(WXt,"_int");function zXt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...br(e)})}a(zXt,"_float32");function YXt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...br(e)})}a(YXt,"_float64");function KXt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...br(e)})}a(KXt,"_int32");function JXt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...br(e)})}a(JXt,"_uint32");function ZXt(t,e){return new t({type:"boolean",...br(e)})}a(ZXt,"_boolean");function XXt(t,e){return new t({type:"boolean",coerce:!0,...br(e)})}a(XXt,"_coercedBoolean");function eer(t,e){return new t({type:"bigint",...br(e)})}a(eer,"_bigint");function ter(t,e){return new t({type:"bigint",coerce:!0,...br(e)})}a(ter,"_coercedBigint");function rer(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...br(e)})}a(rer,"_int64");function ner(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...br(e)})}a(ner,"_uint64");function ier(t,e){return new t({type:"symbol",...br(e)})}a(ier,"_symbol");function oer(t,e){return new t({type:"undefined",...br(e)})}a(oer,"_undefined");function ser(t,e){return new t({type:"null",...br(e)})}a(ser,"_null");function aer(t){return new t({type:"any"})}a(aer,"_any");function cer(t){return new t({type:"unknown"})}a(cer,"_unknown");function ler(t,e){return new t({type:"never",...br(e)})}a(ler,"_never");function uer(t,e){return new t({type:"void",...br(e)})}a(uer,"_void");function der(t,e){return new t({type:"date",...br(e)})}a(der,"_date");function fer(t,e){return new t({type:"date",coerce:!0,...br(e)})}a(fer,"_coercedDate");function per(t,e){return new t({type:"nan",...br(e)})}a(per,"_nan");function Q5(t,e){return new Dnt({check:"less_than",...br(e),value:t,inclusive:!1})}a(Q5,"_lt");function DT(t,e){return new Dnt({check:"less_than",...br(e),value:t,inclusive:!0})}a(DT,"_lte");function q5(t,e){return new Nnt({check:"greater_than",...br(e),value:t,inclusive:!1})}a(q5,"_gt");function vv(t,e){return new Nnt({check:"greater_than",...br(e),value:t,inclusive:!0})}a(vv,"_gte");function dit(t){return q5(0,t)}a(dit,"_positive");function fit(t){return Q5(0,t)}a(fit,"_negative");function pit(t){return DT(0,t)}a(pit,"_nonpositive");function hit(t){return vv(0,t)}a(hit,"_nonnegative");function Hj(t,e){return new dJt({check:"multiple_of",...br(e),value:t})}a(Hj,"_multipleOf");function Gj(t,e){return new hJt({check:"max_size",...br(e),maximum:t})}a(Gj,"_maxSize");function j5(t,e){return new mJt({check:"min_size",...br(e),minimum:t})}a(j5,"_minSize");function PZ(t,e){return new gJt({check:"size_equals",...br(e),size:t})}a(PZ,"_size");function DZ(t,e){return new AJt({check:"max_length",...br(e),maximum:t})}a(DZ,"_maxLength");function i8(t,e){return new yJt({check:"min_length",...br(e),minimum:t})}a(i8,"_minLength");function NZ(t,e){return new _Jt({check:"length_equals",...br(e),length:t})}a(NZ,"_length");function Lfe(t,e){return new EJt({check:"string_format",format:"regex",...br(e),pattern:t})}a(Lfe,"_regex");function Bfe(t){return new vJt({check:"string_format",format:"lowercase",...br(t)})}a(Bfe,"_lowercase");function Ffe(t){return new CJt({check:"string_format",format:"uppercase",...br(t)})}a(Ffe,"_uppercase");function Ufe(t,e){return new bJt({check:"string_format",format:"includes",...br(e),includes:t})}a(Ufe,"_includes");function Qfe(t,e){return new SJt({check:"string_format",format:"starts_with",...br(e),prefix:t})}a(Qfe,"_startsWith");function qfe(t,e){return new TJt({check:"string_format",format:"ends_with",...br(e),suffix:t})}a(qfe,"_endsWith");function mit(t,e,r){return new IJt({check:"property",property:t,schema:e,...br(r)})}a(mit,"_property");function jfe(t,e){return new xJt({check:"mime_type",mime:t,...br(e)})}a(jfe,"_mime");function U2(t){return new wJt({check:"overwrite",tx:t})}a(U2,"_overwrite");function Hfe(t){return U2(e=>e.normalize(t))}a(Hfe,"_normalize");function Gfe(){return U2(t=>t.trim())}a(Gfe,"_trim");function $fe(){return U2(t=>t.toLowerCase())}a($fe,"_toLowerCase");function Vfe(){return U2(t=>t.toUpperCase())}a(Vfe,"_toUpperCase");function Wfe(){return U2(t=>IKt(t))}a(Wfe,"_slugify");function her(t,e,r){return new t({type:"array",element:e,...br(r)})}a(her,"_array");function ihs(t,e,r){return new t({type:"union",options:e,...br(r)})}a(ihs,"_union");function ohs(t,e,r){return new t({type:"union",options:e,inclusive:!1,...br(r)})}a(ohs,"_xor");function shs(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...br(n)})}a(shs,"_discriminatedUnion");function ahs(t,e,r){return new t({type:"intersection",left:e,right:r})}a(ahs,"_intersection");function chs(t,e,r,n){let o=r instanceof po,s=o?n:r,c=o?r:null;return new t({type:"tuple",items:e,rest:c,...br(s)})}a(chs,"_tuple");function lhs(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...br(n)})}a(lhs,"_record");function uhs(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...br(n)})}a(uhs,"_map");function dhs(t,e,r){return new t({type:"set",valueType:e,...br(r)})}a(dhs,"_set");function fhs(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...br(r)})}a(fhs,"_enum");function phs(t,e,r){return new t({type:"enum",entries:e,...br(r)})}a(phs,"_nativeEnum");function hhs(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...br(r)})}a(hhs,"_literal");function mer(t,e){return new t({type:"file",...br(e)})}a(mer,"_file");function mhs(t,e){return new t({type:"transform",transform:e})}a(mhs,"_transform");function ghs(t,e){return new t({type:"optional",innerType:e})}a(ghs,"_optional");function Ahs(t,e){return new t({type:"nullable",innerType:e})}a(Ahs,"_nullable");function yhs(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():wKt(r)}})}a(yhs,"_default");function _hs(t,e,r){return new t({type:"nonoptional",innerType:e,...br(r)})}a(_hs,"_nonoptional");function Ehs(t,e){return new t({type:"success",innerType:e})}a(Ehs,"_success");function vhs(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(vhs,"_catch");function Chs(t,e,r){return new t({type:"pipe",in:e,out:r})}a(Chs,"_pipe");function bhs(t,e){return new t({type:"readonly",innerType:e})}a(bhs,"_readonly");function Shs(t,e,r){return new t({type:"template_literal",parts:e,...br(r)})}a(Shs,"_templateLiteral");function Ths(t,e){return new t({type:"lazy",getter:e})}a(Ths,"_lazy");function Ihs(t,e){return new t({type:"promise",innerType:e})}a(Ihs,"_promise");function ger(t,e,r){let n=br(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a(ger,"_custom");function Aer(t,e,r){return new t({type:"custom",check:"custom",fn:e,...br(r)})}a(Aer,"_refine");function yer(t,e){let r=KOn(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(wfe(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(wfe(s))}},t(n.value,n)),e);return r}a(yer,"_superRefine");function KOn(t,e){let r=new iu({check:"custom",...br(e)});return r._zod.check=t,r}a(KOn,"_check");function _er(t){let e=new iu({check:"describe"});return e._zod.onattach=[r=>{let n=ZA.get(r)??{};ZA.add(r,{...n,description:t})}],e._zod.check=()=>{},e}a(_er,"describe");function Eer(t){let e=new iu({check:"meta"});return e._zod.onattach=[r=>{let n=ZA.get(r)??{};ZA.add(r,{...n,...t})}],e._zod.check=()=>{},e}a(Eer,"meta");function ver(t,e){let r=br(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(g=>typeof g=="string"?g.toLowerCase():g),o=o.map(g=>typeof g=="string"?g.toLowerCase():g));let s=new Set(n),c=new Set(o),l=t.Codec??Yke,u=t.Boolean??Wke,d=t.String??kZ,f=new d({type:"string",error:r.error}),h=new u({type:"boolean",error:r.error}),m=new l({type:"pipe",in:f,out:h,transform:a(((g,A)=>{let y=g;return r.case!=="sensitive"&&(y=y.toLowerCase()),s.has(y)?!0:c.has(y)?!1:(A.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:A.value,inst:m,continue:!1}),{})}),"transform"),reverseTransform:a(((g,A)=>g===!0?n[0]||"true":o[0]||"false"),"reverseTransform"),error:r.error});return m}a(ver,"_stringbool");function zfe(t,e,r,n={}){let o=br(n),s={...br(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:l=>r.test(l),...o};return r instanceof RegExp&&(s.pattern=r),new t(s)}a(zfe,"_stringFormat");p();function $j(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??ZA,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}a($j,"initializeContext");function Jc(t,e,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let c={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,c);let l=t._zod.toJSONSchema?.();if(l)c.schema=l;else{let f={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,c.schema,f);else{let m=c.schema,g=e.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(t,e,m,f)}let h=t._zod.parent;h&&(c.ref||(c.ref=h),Jc(h,e,f),e.seen.get(h).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(c.schema,u),e.io==="input"&&Cv(t)&&(delete c.schema.examples,delete c.schema.default),e.io==="input"&&"_prefault"in c.schema&&((n=c.schema).default??(n.default=c.schema._prefault)),delete c.schema._prefault,e.seen.get(t).schema}a(Jc,"process");function Vj(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let c of t.seen.entries()){let l=t.metadataRegistry.get(c[0])?.id;if(l){let u=n.get(l);if(u&&u!==c[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(l,c[0])}}let o=a(c=>{let l=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let h=t.external.registry.get(c[0])?.id,m=t.external.uri??(A=>A);if(h)return{ref:m(h)};let g=c[1].defId??c[1].schema.id??`schema${t.counter++}`;return c[1].defId=g,{defId:g,ref:`${m("__shared")}#/${l}/${g}`}}if(c[1]===r)return{ref:"#"};let d=`#/${l}/`,f=c[1].schema.id??`__schema${t.counter++}`;return{defId:f,ref:d+f}},"makeURI"),s=a(c=>{if(c[1].schema.$ref)return;let l=c[1],{ref:u,defId:d}=o(c);l.def={...l.schema},d&&(l.defId=d);let f=l.schema;for(let h in f)delete f[h];f.$ref=u},"extractToDef");if(t.cycles==="throw")for(let c of t.seen.entries()){let l=c[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let c of t.seen.entries()){let l=c[1];if(e===c[0]){s(c);continue}if(t.external){let d=t.external.registry.get(c[0])?.id;if(e!==c[0]&&d){s(c);continue}}if(t.metadataRegistry.get(c[0])?.id){s(c);continue}if(l.cycle){s(c);continue}if(l.count>1&&t.reused==="ref"){s(c);continue}}}a(Vj,"extractDefs");function Wj(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a(l=>{let u=t.seen.get(l);if(u.ref===null)return;let d=u.def??u.schema,f={...d},h=u.ref;if(u.ref=null,h){n(h);let g=t.seen.get(h),A=g.schema;if(A.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(A)):Object.assign(d,A),Object.assign(d,f),l._zod.parent===h)for(let _ in d)_==="$ref"||_==="allOf"||_ in f||delete d[_];if(A.$ref&&g.def)for(let _ in d)_==="$ref"||_==="allOf"||_ in g.def&&JSON.stringify(d[_])===JSON.stringify(g.def[_])&&delete d[_]}let m=l._zod.parent;if(m&&m!==h){n(m);let g=t.seen.get(m);if(g?.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(let A in d)A==="$ref"||A==="allOf"||A in g.def&&JSON.stringify(d[A])===JSON.stringify(g.def[A])&&delete d[A]}t.override({zodSchema:l,jsonSchema:d,path:u.path??[]})},"flattenRef");for(let l of[...t.seen.entries()].reverse())n(l[0]);let o={};if(t.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let l=t.external.registry.get(e)?.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=t.external.uri(l)}Object.assign(o,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&o.id===s&&delete o.id;let c=t.external?.defs??{};for(let l of t.seen.entries()){let u=l[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,c[u.defId]=u.def)}t.external||Object.keys(c).length>0&&(t.target==="draft-2020-12"?o.$defs=c:o.definitions=c);try{let l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...e["~standard"],jsonSchema:{input:zfe(e,"input",t.processors),output:zfe(e,"output",t.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}a(Wj,"finalize");function Cv(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Cv(n.element,r);if(n.type==="set")return Cv(n.valueType,r);if(n.type==="lazy")return Cv(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Cv(n.innerType,r);if(n.type==="intersection")return Cv(n.left,r)||Cv(n.right,r);if(n.type==="record"||n.type==="map")return Cv(n.keyType,r)||Cv(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Cv(n.in,r)||Cv(n.out,r);if(n.type==="object"){for(let o in n.shape)if(Cv(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(Cv(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(Cv(o,r))return!0;return!!(n.rest&&Cv(n.rest,r))}return!1}a(Cv,"isTransforming");var ver=a((t,e={})=>r=>{let n=$j({...r,processors:e});return Jc(t,n),Vj(n,t),Wj(n,t)},"createToJSONSchemaMethod"),zfe=a((t,e,r={})=>n=>{let{libraryOptions:o,target:s}=n??{},c=$j({...o??{},target:s,io:e,processors:r});return Jc(t,c),Vj(c,t),Wj(c,t)},"createStandardJSONSchemaMethod");p();var Ths={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cer=a((t,e,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:c,format:l,patterns:u,contentEncoding:d}=t._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof c=="number"&&(o.maxLength=c),l&&(o.format=Ths[l]??l,o.format===""&&delete o.format,l==="time"&&delete o.format),d&&(o.contentEncoding=d),u&&u.size>0){let f=[...u];f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(h=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},"stringProcessor"),ber=a((t,e,r,n)=>{let o=r,{minimum:s,maximum:c,format:l,multipleOf:u,exclusiveMaximum:d,exclusiveMinimum:f}=t._zod.bag;typeof l=="string"&&l.includes("int")?o.type="integer":o.type="number";let h=typeof f=="number"&&f>=(s??Number.NEGATIVE_INFINITY),m=typeof d=="number"&&d<=(c??Number.POSITIVE_INFINITY),g=e.target==="draft-04"||e.target==="openapi-3.0";h?g?(o.minimum=f,o.exclusiveMinimum=!0):o.exclusiveMinimum=f:typeof s=="number"&&(o.minimum=s),m?g?(o.maximum=d,o.exclusiveMaximum=!0):o.exclusiveMaximum=d:typeof c=="number"&&(o.maximum=c),typeof u=="number"&&(o.multipleOf=u)},"numberProcessor"),Ser=a((t,e,r,n)=>{r.type="boolean"},"booleanProcessor"),Ter=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),Ier=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),xer=a((t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),wer=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),Rer=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),ker=a((t,e,r,n)=>{r.not={}},"neverProcessor"),Per=a((t,e,r,n)=>{},"anyProcessor"),Der=a((t,e,r,n)=>{},"unknownProcessor"),Ner=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),Mer=a((t,e,r,n)=>{let o=t._zod.def,s=Nke(o.entries);s.every(c=>typeof c=="number")&&(r.type="number"),s.every(c=>typeof c=="string")&&(r.type="string"),r.enum=s},"enumProcessor"),Oer=a((t,e,r,n)=>{let o=t._zod.def,s=[];for(let c of o.values)if(c===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(c))}else s.push(c);if(s.length!==0)if(s.length===1){let c=s[0];r.type=c===null?"null":typeof c,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[c]:r.const=c}else s.every(c=>typeof c=="number")&&(r.type="number"),s.every(c=>typeof c=="string")&&(r.type="string"),s.every(c=>typeof c=="boolean")&&(r.type="boolean"),s.every(c=>c===null)&&(r.type="null"),r.enum=s},"literalProcessor"),Ler=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),Ber=a((t,e,r,n)=>{let o=r,s=t._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=s.source},"templateLiteralProcessor"),Fer=a((t,e,r,n)=>{let o=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:c,maximum:l,mime:u}=t._zod.bag;c!==void 0&&(s.minLength=c),l!==void 0&&(s.maxLength=l),u?u.length===1?(s.contentMediaType=u[0],Object.assign(o,s)):(Object.assign(o,s),o.anyOf=u.map(d=>({contentMediaType:d}))):Object.assign(o,s)},"fileProcessor"),Uer=a((t,e,r,n)=>{r.type="boolean"},"successProcessor"),Qer=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),qer=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),jer=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),Her=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),Ger=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),$er=a((t,e,r,n)=>{let o=r,s=t._zod.def,{minimum:c,maximum:l}=t._zod.bag;typeof c=="number"&&(o.minItems=c),typeof l=="number"&&(o.maxItems=l),o.type="array",o.items=Jc(s.element,e,{...n,path:[...n.path,"items"]})},"arrayProcessor"),Ver=a((t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object",o.properties={};let c=s.shape;for(let d in c)o.properties[d]=Jc(c[d],e,{...n,path:[...n.path,"properties",d]});let l=new Set(Object.keys(c)),u=new Set([...l].filter(d=>{let f=s.shape[d]._zod;return e.io==="input"?f.optin===void 0:f.optout===void 0}));u.size>0&&(o.required=Array.from(u)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Jc(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},"objectProcessor"),Ait=a((t,e,r,n)=>{let o=t._zod.def,s=o.inclusive===!1,c=o.options.map((l,u)=>Jc(l,e,{...n,path:[...n.path,s?"oneOf":"anyOf",u]}));s?r.oneOf=c:r.anyOf=c},"unionProcessor"),Wer=a((t,e,r,n)=>{let o=t._zod.def,s=Jc(o.left,e,{...n,path:[...n.path,"allOf",0]}),c=Jc(o.right,e,{...n,path:[...n.path,"allOf",1]}),l=a(d=>"allOf"in d&&Object.keys(d).length===1,"isSimpleIntersection"),u=[...l(s)?s.allOf:[s],...l(c)?c.allOf:[c]];r.allOf=u},"intersectionProcessor"),zer=a((t,e,r,n)=>{let o=r,s=t._zod.def;o.type="array";let c=e.target==="draft-2020-12"?"prefixItems":"items",l=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=s.items.map((m,g)=>Jc(m,e,{...n,path:[...n.path,c,g]})),d=s.rest?Jc(s.rest,e,{...n,path:[...n.path,l,...e.target==="openapi-3.0"?[s.items.length]:[]]}):null;e.target==="draft-2020-12"?(o.prefixItems=u,d&&(o.items=d)):e.target==="openapi-3.0"?(o.items={anyOf:u},d&&o.items.anyOf.push(d),o.minItems=u.length,d||(o.maxItems=u.length)):(o.items=u,d&&(o.additionalItems=d));let{minimum:f,maximum:h}=t._zod.bag;typeof f=="number"&&(o.minItems=f),typeof h=="number"&&(o.maxItems=h)},"tupleProcessor"),Yer=a((t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object";let c=s.keyType,u=c._zod.bag?.patterns;if(s.mode==="loose"&&u&&u.size>0){let f=Jc(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let h of u)o.patternProperties[h.source]=f}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(o.propertyNames=Jc(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=Jc(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let d=c._zod.values;if(d){let f=[...d].filter(h=>typeof h=="string"||typeof h=="number");f.length>0&&(o.required=f)}},"recordProcessor"),Ker=a((t,e,r,n)=>{let o=t._zod.def,s=Jc(o.innerType,e,n),c=e.seen.get(t);e.target==="openapi-3.0"?(c.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},"nullableProcessor"),Jer=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},"nonoptionalProcessor"),Zer=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},"defaultProcessor"),Xer=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},"prefaultProcessor"),etr=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType;let c;try{c=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=c},"catchProcessor"),ttr=a((t,e,r,n)=>{let o=t._zod.def,s=o.in._zod.traits.has("$ZodTransform"),c=e.io==="input"?s?o.out:o.in:o.out;Jc(c,e,n);let l=e.seen.get(t);l.ref=c},"pipeProcessor"),rtr=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.readOnly=!0},"readonlyProcessor"),ntr=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},"promiseProcessor"),yit=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},"optionalProcessor"),itr=a((t,e,r,n)=>{let o=t._zod.innerType;Jc(o,e,n);let s=e.seen.get(t);s.ref=o},"lazyProcessor"),git={string:Cer,number:ber,boolean:Ser,bigint:Ter,symbol:Ier,null:xer,undefined:wer,void:Rer,never:ker,any:Per,unknown:Der,date:Ner,enum:Mer,literal:Oer,nan:Ler,template_literal:Ber,file:Fer,success:Uer,custom:Qer,function:qer,transform:jer,map:Her,set:Ger,array:$er,object:Ver,union:Ait,intersection:Wer,tuple:zer,record:Yer,nullable:Ker,nonoptional:Jer,default:Zer,prefault:Xer,catch:etr,pipe:ttr,readonly:rtr,promise:ntr,optional:yit,lazy:itr};function _it(t,e){if("_idmap"in t){let n=t,o=$j({...e,processors:git}),s={};for(let u of n._idmap.entries()){let[d,f]=u;Jc(f,o)}let c={},l={registry:n,uri:e?.uri,defs:s};o.external=l;for(let u of n._idmap.entries()){let[d,f]=u;Vj(o,f),c[d]=Wj(o,f)}if(Object.keys(s).length>0){let u=o.target==="draft-2020-12"?"$defs":"definitions";c.__shared={[u]:s}}return{schemas:c}}let r=$j({...e,processors:git});return Jc(t,r),Vj(r,t),Wj(r,t)}a(_it,"toJSONSchema");p();var Eit=class{static{a(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=$j({processors:git,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return Jc(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Vj(this.ctx,e);let n=Wj(this.ctx,e),{"~standard":o,...s}=n;return s}};var KOn={};p();var nPe={};Ti(nPe,{ZodAny:()=>Ttr,ZodArray:()=>Rtr,ZodBase64:()=>jit,ZodBase64URL:()=>Hit,ZodBigInt:()=>tpe,ZodBigIntFormat:()=>Vit,ZodBoolean:()=>epe,ZodCIDRv4:()=>Qit,ZodCIDRv6:()=>qit,ZodCUID:()=>Nit,ZodCUID2:()=>Mit,ZodCatch:()=>Ytr,ZodCodec:()=>hPe,ZodCustom:()=>mPe,ZodCustomStringFormat:()=>Zfe,ZodDate:()=>lPe,ZodDefault:()=>Htr,ZodDiscriminatedUnion:()=>Ptr,ZodE164:()=>Git,ZodEmail:()=>Rit,ZodEmoji:()=>Pit,ZodEnum:()=>Kfe,ZodExactOptional:()=>Qtr,ZodFile:()=>Ftr,ZodFunction:()=>srr,ZodGUID:()=>iPe,ZodIPv4:()=>Fit,ZodIPv6:()=>Uit,ZodIntersection:()=>Dtr,ZodJWT:()=>$it,ZodKSUID:()=>Bit,ZodLazy:()=>nrr,ZodLiteral:()=>Btr,ZodMAC:()=>vtr,ZodMap:()=>Otr,ZodNaN:()=>Jtr,ZodNanoID:()=>Dit,ZodNever:()=>xtr,ZodNonOptional:()=>Jit,ZodNull:()=>Str,ZodNullable:()=>jtr,ZodNumber:()=>Xfe,ZodNumberFormat:()=>NZ,ZodObject:()=>uPe,ZodOptional:()=>Kit,ZodPipe:()=>pPe,ZodPrefault:()=>$tr,ZodPreprocess:()=>Ztr,ZodPromise:()=>orr,ZodReadonly:()=>Xtr,ZodRecord:()=>Yfe,ZodSet:()=>Ltr,ZodString:()=>Jfe,ZodStringFormat:()=>Bl,ZodSuccess:()=>ztr,ZodSymbol:()=>Ctr,ZodTemplateLiteral:()=>rrr,ZodTransform:()=>Utr,ZodTuple:()=>Ntr,ZodType:()=>rs,ZodULID:()=>Oit,ZodURL:()=>aPe,ZodUUID:()=>H5,ZodUndefined:()=>btr,ZodUnion:()=>dPe,ZodUnknown:()=>Itr,ZodVoid:()=>wtr,ZodXID:()=>Lit,ZodXor:()=>ktr,_ZodString:()=>wit,_default:()=>Gtr,_function:()=>X5n,any:()=>Wit,array:()=>Qr,base64:()=>y5n,base64url:()=>_5n,bigint:()=>k5n,boolean:()=>Zc,catch:()=>Ktr,check:()=>e4n,cidrv4:()=>g5n,cidrv6:()=>A5n,codec:()=>Y5n,cuid:()=>c5n,cuid2:()=>l5n,custom:()=>Zit,date:()=>L5n,describe:()=>t4n,discriminatedUnion:()=>fPe,e164:()=>E5n,email:()=>XOn,emoji:()=>s5n,enum:()=>XA,exactOptional:()=>qtr,file:()=>$5n,float32:()=>I5n,float64:()=>x5n,function:()=>X5n,guid:()=>e5n,hash:()=>T5n,hex:()=>S5n,hostname:()=>b5n,httpUrl:()=>o5n,instanceof:()=>n4n,int:()=>Iit,int32:()=>w5n,int64:()=>P5n,intersection:()=>rpe,invertCodec:()=>K5n,ipv4:()=>p5n,ipv6:()=>m5n,json:()=>o4n,jwt:()=>v5n,keyof:()=>B5n,ksuid:()=>f5n,lazy:()=>irr,literal:()=>zn,looseObject:()=>gh,looseRecord:()=>q5n,mac:()=>h5n,map:()=>j5n,meta:()=>r4n,nan:()=>z5n,nanoid:()=>a5n,nativeEnum:()=>G5n,never:()=>zit,nonoptional:()=>Wtr,null:()=>cPe,nullable:()=>oPe,nullish:()=>V5n,number:()=>ya,object:()=>Yr,optional:()=>ou,partialRecord:()=>Q5n,pipe:()=>xit,prefault:()=>Vtr,preprocess:()=>gPe,promise:()=>Z5n,readonly:()=>trr,record:()=>ml,refine:()=>arr,set:()=>H5n,strictObject:()=>F5n,string:()=>Xe,stringFormat:()=>C5n,stringbool:()=>i4n,success:()=>W5n,superRefine:()=>crr,symbol:()=>N5n,templateLiteral:()=>J5n,transform:()=>Yit,tuple:()=>Mtr,uint32:()=>R5n,uint64:()=>D5n,ulid:()=>u5n,undefined:()=>M5n,union:()=>Ul,unknown:()=>Fl,url:()=>kit,uuid:()=>t5n,uuidv4:()=>r5n,uuidv6:()=>n5n,uuidv7:()=>i5n,void:()=>O5n,xid:()=>d5n,xor:()=>U5n});p();var vit={};Ti(vit,{endsWith:()=>Qfe,gt:()=>q5,gte:()=>vv,includes:()=>Ffe,length:()=>DZ,lowercase:()=>Lfe,lt:()=>Q5,lte:()=>DT,maxLength:()=>PZ,maxSize:()=>Gj,mime:()=>qfe,minLength:()=>i8,minSize:()=>j5,multipleOf:()=>Hj,negative:()=>fit,nonnegative:()=>hit,nonpositive:()=>pit,normalize:()=>jfe,overwrite:()=>U2,positive:()=>dit,property:()=>mit,regex:()=>Ofe,size:()=>kZ,slugify:()=>Vfe,startsWith:()=>Ufe,toLowerCase:()=>Gfe,toUpperCase:()=>$fe,trim:()=>Hfe,uppercase:()=>Bfe});p();var zj={};Ti(zj,{ZodISODate:()=>bit,ZodISODateTime:()=>Cit,ZodISODuration:()=>Tit,ZodISOTime:()=>Sit,date:()=>str,datetime:()=>otr,duration:()=>ctr,time:()=>atr});p();var Cit=ct("ZodISODateTime",(t,e)=>{qJt.init(t,e),Bl.init(t,e)});function otr(t){return QXt(Cit,t)}a(otr,"datetime");var bit=ct("ZodISODate",(t,e)=>{jJt.init(t,e),Bl.init(t,e)});function str(t){return qXt(bit,t)}a(str,"date");var Sit=ct("ZodISOTime",(t,e)=>{HJt.init(t,e),Bl.init(t,e)});function atr(t){return jXt(Sit,t)}a(atr,"time");var Tit=ct("ZodISODuration",(t,e)=>{GJt.init(t,e),Bl.init(t,e)});function ctr(t){return HXt(Tit,t)}a(ctr,"duration");p();p();var JOn=a((t,e)=>{Fke.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>Qke(t,r),"value")},flatten:{value:a(r=>Uke(t,r),"value")},addIssue:{value:a(r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Tfe,2)},"value")},addIssues:{value:a(r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Tfe,2)},"value")},isEmpty:{get(){return t.issues.length===0}}})},"initializer"),xhs=ct("ZodError",JOn),Tb=ct("ZodError",JOn,{Parent:Error});var ltr=wfe(Tb),utr=Rfe(Tb),dtr=kfe(Tb),ftr=Dfe(Tb),ptr=Cnt(Tb),htr=bnt(Tb),mtr=Snt(Tb),gtr=Tnt(Tb),Atr=Int(Tb),ytr=xnt(Tb),_tr=wnt(Tb),Etr=Rnt(Tb);var ZOn=new WeakMap;function sPe(t,e,r){let n=Object.getPrototypeOf(t),o=ZOn.get(n);if(o||(o=new Set,ZOn.set(n,o)),!o.has(e)){o.add(e);for(let s in r){let c=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){let l=c.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:l}),l},set(l){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:l})}})}}}a(sPe,"_installLazyMethods");var rs=ct("ZodType",(t,e)=>(po.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:zfe(t,"input"),output:zfe(t,"output")}}),t.toJSONSchema=ver(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>ltr(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>dtr(t,r,n),t.parseAsync=async(r,n)=>utr(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>ftr(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>ptr(t,r,n),t.decode=(r,n)=>htr(t,r,n),t.encodeAsync=async(r,n)=>mtr(t,r,n),t.decodeAsync=async(r,n)=>gtr(t,r,n),t.safeEncode=(r,n)=>Atr(t,r,n),t.safeDecode=(r,n)=>ytr(t,r,n),t.safeEncodeAsync=async(r,n)=>_tr(t,r,n),t.safeDecodeAsync=async(r,n)=>Etr(t,r,n),sPe(t,"ZodType",{check(...r){let n=this.def;return this.clone(lr.mergeDefs(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return _v(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(arr(r,n))},superRefine(r,n){return this.check(crr(r,n))},overwrite(r){return this.check(U2(r))},optional(){return ou(this)},exactOptional(){return qtr(this)},nullable(){return oPe(this)},nullish(){return ou(oPe(this))},nonoptional(r){return Wtr(this,r)},array(){return Qr(this)},or(r){return Ul([this,r])},and(r){return rpe(this,r)},transform(r){return xit(this,Yit(r))},default(r){return Gtr(this,r)},prefault(r){return Vtr(this,r)},catch(r){return Ktr(this,r)},pipe(r){return xit(this,r)},readonly(){return trr(this)},describe(r){let n=this.clone();return ZA.add(n,{description:r}),n},meta(...r){if(r.length===0)return ZA.get(this);let n=this.clone();return ZA.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return ZA.get(t)?.description},configurable:!0}),t)),wit=ct("_ZodString",(t,e)=>{RZ.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Cer(t,n,o,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,sPe(t,"_ZodString",{regex(...n){return this.check(Ofe(...n))},includes(...n){return this.check(Ffe(...n))},startsWith(...n){return this.check(Ufe(...n))},endsWith(...n){return this.check(Qfe(...n))},min(...n){return this.check(i8(...n))},max(...n){return this.check(PZ(...n))},length(...n){return this.check(DZ(...n))},nonempty(...n){return this.check(i8(1,...n))},lowercase(n){return this.check(Lfe(n))},uppercase(n){return this.check(Bfe(n))},trim(){return this.check(Hfe())},normalize(...n){return this.check(jfe(...n))},toLowerCase(){return this.check(Gfe())},toUpperCase(){return this.check($fe())},slugify(){return this.check(Vfe())}})}),Jfe=ct("ZodString",(t,e)=>{RZ.init(t,e),wit.init(t,e),t.email=r=>t.check($nt(Rit,r)),t.url=r=>t.check(rPe(aPe,r)),t.jwt=r=>t.check(uit($it,r)),t.emoji=r=>t.check(Knt(Pit,r)),t.guid=r=>t.check(tPe(iPe,r)),t.uuid=r=>t.check(Vnt(H5,r)),t.uuidv4=r=>t.check(Wnt(H5,r)),t.uuidv6=r=>t.check(znt(H5,r)),t.uuidv7=r=>t.check(Ynt(H5,r)),t.nanoid=r=>t.check(Jnt(Dit,r)),t.guid=r=>t.check(tPe(iPe,r)),t.cuid=r=>t.check(Znt(Nit,r)),t.cuid2=r=>t.check(Xnt(Mit,r)),t.ulid=r=>t.check(eit(Oit,r)),t.base64=r=>t.check(ait(jit,r)),t.base64url=r=>t.check(cit(Hit,r)),t.xid=r=>t.check(tit(Lit,r)),t.ksuid=r=>t.check(rit(Bit,r)),t.ipv4=r=>t.check(nit(Fit,r)),t.ipv6=r=>t.check(iit(Uit,r)),t.cidrv4=r=>t.check(oit(Qit,r)),t.cidrv6=r=>t.check(sit(qit,r)),t.e164=r=>t.check(lit(Git,r)),t.datetime=r=>t.check(otr(r)),t.date=r=>t.check(str(r)),t.time=r=>t.check(atr(r)),t.duration=r=>t.check(ctr(r))});function Xe(t){return LXt(Jfe,t)}a(Xe,"string");var Bl=ct("ZodStringFormat",(t,e)=>{Ll.init(t,e),wit.init(t,e)}),Rit=ct("ZodEmail",(t,e)=>{DJt.init(t,e),Bl.init(t,e)});function XOn(t){return $nt(Rit,t)}a(XOn,"email");var iPe=ct("ZodGUID",(t,e)=>{kJt.init(t,e),Bl.init(t,e)});function e5n(t){return tPe(iPe,t)}a(e5n,"guid");var H5=ct("ZodUUID",(t,e)=>{PJt.init(t,e),Bl.init(t,e)});function t5n(t){return Vnt(H5,t)}a(t5n,"uuid");function r5n(t){return Wnt(H5,t)}a(r5n,"uuidv4");function n5n(t){return znt(H5,t)}a(n5n,"uuidv6");function i5n(t){return Ynt(H5,t)}a(i5n,"uuidv7");var aPe=ct("ZodURL",(t,e)=>{NJt.init(t,e),Bl.init(t,e)});function kit(t){return rPe(aPe,t)}a(kit,"url");function o5n(t){return rPe(aPe,{protocol:PT.httpProtocol,hostname:PT.domain,...lr.normalizeParams(t)})}a(o5n,"httpUrl");var Pit=ct("ZodEmoji",(t,e)=>{MJt.init(t,e),Bl.init(t,e)});function s5n(t){return Knt(Pit,t)}a(s5n,"emoji");var Dit=ct("ZodNanoID",(t,e)=>{OJt.init(t,e),Bl.init(t,e)});function a5n(t){return Jnt(Dit,t)}a(a5n,"nanoid");var Nit=ct("ZodCUID",(t,e)=>{LJt.init(t,e),Bl.init(t,e)});function c5n(t){return Znt(Nit,t)}a(c5n,"cuid");var Mit=ct("ZodCUID2",(t,e)=>{BJt.init(t,e),Bl.init(t,e)});function l5n(t){return Xnt(Mit,t)}a(l5n,"cuid2");var Oit=ct("ZodULID",(t,e)=>{FJt.init(t,e),Bl.init(t,e)});function u5n(t){return eit(Oit,t)}a(u5n,"ulid");var Lit=ct("ZodXID",(t,e)=>{UJt.init(t,e),Bl.init(t,e)});function d5n(t){return tit(Lit,t)}a(d5n,"xid");var Bit=ct("ZodKSUID",(t,e)=>{QJt.init(t,e),Bl.init(t,e)});function f5n(t){return rit(Bit,t)}a(f5n,"ksuid");var Fit=ct("ZodIPv4",(t,e)=>{$Jt.init(t,e),Bl.init(t,e)});function p5n(t){return nit(Fit,t)}a(p5n,"ipv4");var vtr=ct("ZodMAC",(t,e)=>{WJt.init(t,e),Bl.init(t,e)});function h5n(t){return FXt(vtr,t)}a(h5n,"mac");var Uit=ct("ZodIPv6",(t,e)=>{VJt.init(t,e),Bl.init(t,e)});function m5n(t){return iit(Uit,t)}a(m5n,"ipv6");var Qit=ct("ZodCIDRv4",(t,e)=>{zJt.init(t,e),Bl.init(t,e)});function g5n(t){return oit(Qit,t)}a(g5n,"cidrv4");var qit=ct("ZodCIDRv6",(t,e)=>{YJt.init(t,e),Bl.init(t,e)});function A5n(t){return sit(qit,t)}a(A5n,"cidrv6");var jit=ct("ZodBase64",(t,e)=>{JJt.init(t,e),Bl.init(t,e)});function y5n(t){return ait(jit,t)}a(y5n,"base64");var Hit=ct("ZodBase64URL",(t,e)=>{ZJt.init(t,e),Bl.init(t,e)});function _5n(t){return cit(Hit,t)}a(_5n,"base64url");var Git=ct("ZodE164",(t,e)=>{XJt.init(t,e),Bl.init(t,e)});function E5n(t){return lit(Git,t)}a(E5n,"e164");var $it=ct("ZodJWT",(t,e)=>{eZt.init(t,e),Bl.init(t,e)});function v5n(t){return uit($it,t)}a(v5n,"jwt");var Zfe=ct("ZodCustomStringFormat",(t,e)=>{tZt.init(t,e),Bl.init(t,e)});function C5n(t,e,r={}){return Wfe(Zfe,t,e,r)}a(C5n,"stringFormat");function b5n(t){return Wfe(Zfe,"hostname",PT.hostname,t)}a(b5n,"hostname");function S5n(t){return Wfe(Zfe,"hex",PT.hex,t)}a(S5n,"hex");function T5n(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,o=PT[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return Wfe(Zfe,n,o,e)}a(T5n,"hash");var Xfe=ct("ZodNumber",(t,e)=>{Fnt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(n,o,s)=>ber(t,n,o,s),sPe(t,"ZodNumber",{gt(n,o){return this.check(q5(n,o))},gte(n,o){return this.check(vv(n,o))},min(n,o){return this.check(vv(n,o))},lt(n,o){return this.check(Q5(n,o))},lte(n,o){return this.check(DT(n,o))},max(n,o){return this.check(DT(n,o))},int(n){return this.check(Iit(n))},safe(n){return this.check(Iit(n))},positive(n){return this.check(q5(0,n))},nonnegative(n){return this.check(vv(0,n))},negative(n){return this.check(Q5(0,n))},nonpositive(n){return this.check(DT(0,n))},multipleOf(n,o){return this.check(Hj(n,o))},step(n,o){return this.check(Hj(n,o))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function ya(t){return GXt(Xfe,t)}a(ya,"number");var NZ=ct("ZodNumberFormat",(t,e)=>{rZt.init(t,e),Xfe.init(t,e)});function Iit(t){return VXt(NZ,t)}a(Iit,"int");function I5n(t){return WXt(NZ,t)}a(I5n,"float32");function x5n(t){return zXt(NZ,t)}a(x5n,"float64");function w5n(t){return YXt(NZ,t)}a(w5n,"int32");function R5n(t){return KXt(NZ,t)}a(R5n,"uint32");var epe=ct("ZodBoolean",(t,e)=>{Wke.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ser(t,r,n,o)});function Zc(t){return JXt(epe,t)}a(Zc,"boolean");var tpe=ct("ZodBigInt",(t,e)=>{Unt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Ter(t,n,o,s),t.gte=(n,o)=>t.check(vv(n,o)),t.min=(n,o)=>t.check(vv(n,o)),t.gt=(n,o)=>t.check(q5(n,o)),t.gte=(n,o)=>t.check(vv(n,o)),t.min=(n,o)=>t.check(vv(n,o)),t.lt=(n,o)=>t.check(Q5(n,o)),t.lte=(n,o)=>t.check(DT(n,o)),t.max=(n,o)=>t.check(DT(n,o)),t.positive=n=>t.check(q5(BigInt(0),n)),t.negative=n=>t.check(Q5(BigInt(0),n)),t.nonpositive=n=>t.check(DT(BigInt(0),n)),t.nonnegative=n=>t.check(vv(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(Hj(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function k5n(t){return XXt(tpe,t)}a(k5n,"bigint");var Vit=ct("ZodBigIntFormat",(t,e)=>{nZt.init(t,e),tpe.init(t,e)});function P5n(t){return ter(Vit,t)}a(P5n,"int64");function D5n(t){return rer(Vit,t)}a(D5n,"uint64");var Ctr=ct("ZodSymbol",(t,e)=>{iZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ier(t,r,n,o)});function N5n(t){return ner(Ctr,t)}a(N5n,"symbol");var btr=ct("ZodUndefined",(t,e)=>{oZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>wer(t,r,n,o)});function M5n(t){return ier(btr,t)}a(M5n,"_undefined");var Str=ct("ZodNull",(t,e)=>{sZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>xer(t,r,n,o)});function cPe(t){return oer(Str,t)}a(cPe,"_null");var Ttr=ct("ZodAny",(t,e)=>{aZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Per(t,r,n,o)});function Wit(){return ser(Ttr)}a(Wit,"any");var Itr=ct("ZodUnknown",(t,e)=>{cZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Der(t,r,n,o)});function Fl(){return aer(Itr)}a(Fl,"unknown");var xtr=ct("ZodNever",(t,e)=>{lZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ker(t,r,n,o)});function zit(t){return cer(xtr,t)}a(zit,"never");var wtr=ct("ZodVoid",(t,e)=>{uZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Rer(t,r,n,o)});function O5n(t){return ler(wtr,t)}a(O5n,"_void");var lPe=ct("ZodDate",(t,e)=>{dZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Ner(t,n,o,s),t.min=(n,o)=>t.check(vv(n,o)),t.max=(n,o)=>t.check(DT(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function L5n(t){return uer(lPe,t)}a(L5n,"date");var Rtr=ct("ZodArray",(t,e)=>{fZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>$er(t,r,n,o),t.element=e.element,sPe(t,"ZodArray",{min(r,n){return this.check(i8(r,n))},nonempty(r){return this.check(i8(1,r))},max(r,n){return this.check(PZ(r,n))},length(r,n){return this.check(DZ(r,n))},unwrap(){return this.element}})});function Qr(t,e){return per(Rtr,t,e)}a(Qr,"array");function B5n(t){let e=t._zod.def.shape;return XA(Object.keys(e))}a(B5n,"keyof");var uPe=ct("ZodObject",(t,e)=>{pZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ver(t,r,n,o),lr.defineLazy(t,"shape",()=>e.shape),sPe(t,"ZodObject",{keyof(){return XA(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Fl()})},loose(){return this.clone({...this._zod.def,catchall:Fl()})},strict(){return this.clone({...this._zod.def,catchall:zit()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return lr.extend(this,r)},safeExtend(r){return lr.safeExtend(this,r)},merge(r){return lr.merge(this,r)},pick(r){return lr.pick(this,r)},omit(r){return lr.omit(this,r)},partial(...r){return lr.partial(Kit,this,r[0])},required(...r){return lr.required(Jit,this,r[0])}})});function Yr(t,e){let r={type:"object",shape:t??{},...lr.normalizeParams(e)};return new uPe(r)}a(Yr,"object");function F5n(t,e){return new uPe({type:"object",shape:t,catchall:zit(),...lr.normalizeParams(e)})}a(F5n,"strictObject");function gh(t,e){return new uPe({type:"object",shape:t,catchall:Fl(),...lr.normalizeParams(e)})}a(gh,"looseObject");var dPe=ct("ZodUnion",(t,e)=>{zke.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ait(t,r,n,o),t.options=e.options});function Ul(t,e){return new dPe({type:"union",options:t,...lr.normalizeParams(e)})}a(Ul,"union");var ktr=ct("ZodXor",(t,e)=>{dPe.init(t,e),hZt.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ait(t,r,n,o),t.options=e.options});function U5n(t,e){return new ktr({type:"union",options:t,inclusive:!1,...lr.normalizeParams(e)})}a(U5n,"xor");var Ptr=ct("ZodDiscriminatedUnion",(t,e)=>{dPe.init(t,e),mZt.init(t,e)});function fPe(t,e,r){return new Ptr({type:"union",options:e,discriminator:t,...lr.normalizeParams(r)})}a(fPe,"discriminatedUnion");var Dtr=ct("ZodIntersection",(t,e)=>{gZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Wer(t,r,n,o)});function rpe(t,e){return new Dtr({type:"intersection",left:t,right:e})}a(rpe,"intersection");var Ntr=ct("ZodTuple",(t,e)=>{Qnt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>zer(t,r,n,o),t.rest=r=>t.clone({...t._zod.def,rest:r})});function Mtr(t,e,r){let n=e instanceof po,o=n?r:e,s=n?e:null;return new Ntr({type:"tuple",items:t,rest:s,...lr.normalizeParams(o)})}a(Mtr,"tuple");var Yfe=ct("ZodRecord",(t,e)=>{AZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Yer(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType});function ml(t,e,r){return!e||!e._zod?new Yfe({type:"record",keyType:Xe(),valueType:t,...lr.normalizeParams(e)}):new Yfe({type:"record",keyType:t,valueType:e,...lr.normalizeParams(r)})}a(ml,"record");function Q5n(t,e,r){let n=_v(t);return n._zod.values=void 0,new Yfe({type:"record",keyType:n,valueType:e,...lr.normalizeParams(r)})}a(Q5n,"partialRecord");function q5n(t,e,r){return new Yfe({type:"record",keyType:t,valueType:e,mode:"loose",...lr.normalizeParams(r)})}a(q5n,"looseRecord");var Otr=ct("ZodMap",(t,e)=>{yZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Her(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(j5(...r)),t.nonempty=r=>t.check(j5(1,r)),t.max=(...r)=>t.check(Gj(...r)),t.size=(...r)=>t.check(kZ(...r))});function j5n(t,e,r){return new Otr({type:"map",keyType:t,valueType:e,...lr.normalizeParams(r)})}a(j5n,"map");var Ltr=ct("ZodSet",(t,e)=>{_Zt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ger(t,r,n,o),t.min=(...r)=>t.check(j5(...r)),t.nonempty=r=>t.check(j5(1,r)),t.max=(...r)=>t.check(Gj(...r)),t.size=(...r)=>t.check(kZ(...r))});function H5n(t,e){return new Ltr({type:"set",valueType:t,...lr.normalizeParams(e)})}a(H5n,"set");var Kfe=ct("ZodEnum",(t,e)=>{EZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Mer(t,n,o,s),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let c of n)if(r.has(c))s[c]=e.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Kfe({...e,checks:[],...lr.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let c of n)if(r.has(c))delete s[c];else throw new Error(`Key ${c} not found in enum`);return new Kfe({...e,checks:[],...lr.normalizeParams(o),entries:s})}});function XA(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Kfe({type:"enum",entries:r,...lr.normalizeParams(e)})}a(XA,"_enum");function G5n(t,e){return new Kfe({type:"enum",entries:t,...lr.normalizeParams(e)})}a(G5n,"nativeEnum");var Btr=ct("ZodLiteral",(t,e)=>{vZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Oer(t,r,n,o),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function zn(t,e){return new Btr({type:"literal",values:Array.isArray(t)?t:[t],...lr.normalizeParams(e)})}a(zn,"literal");var Ftr=ct("ZodFile",(t,e)=>{CZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Fer(t,r,n,o),t.min=(r,n)=>t.check(j5(r,n)),t.max=(r,n)=>t.check(Gj(r,n)),t.mime=(r,n)=>t.check(qfe(Array.isArray(r)?r:[r],n))});function $5n(t){return her(Ftr,t)}a($5n,"file");var Utr=ct("ZodTransform",(t,e)=>{bZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>jer(t,r,n,o),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Fj(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(lr.issue(s,r.value,e));else{let c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=t),r.issues.push(lr.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function Yit(t){return new Utr({type:"transform",transform:t})}a(Yit,"transform");var Kit=ct("ZodOptional",(t,e)=>{qnt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>yit(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function ou(t){return new Kit({type:"optional",innerType:t})}a(ou,"optional");var Qtr=ct("ZodExactOptional",(t,e)=>{SZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>yit(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function qtr(t){return new Qtr({type:"optional",innerType:t})}a(qtr,"exactOptional");var jtr=ct("ZodNullable",(t,e)=>{TZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ker(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function oPe(t){return new jtr({type:"nullable",innerType:t})}a(oPe,"nullable");function V5n(t){return ou(oPe(t))}a(V5n,"nullish");var Htr=ct("ZodDefault",(t,e)=>{IZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Zer(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Gtr(t,e){return new Htr({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():lr.shallowClone(e)}})}a(Gtr,"_default");var $tr=ct("ZodPrefault",(t,e)=>{xZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Xer(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function Vtr(t,e){return new $tr({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():lr.shallowClone(e)}})}a(Vtr,"prefault");var Jit=ct("ZodNonOptional",(t,e)=>{wZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Jer(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function Wtr(t,e){return new Jit({type:"nonoptional",innerType:t,...lr.normalizeParams(e)})}a(Wtr,"nonoptional");var ztr=ct("ZodSuccess",(t,e)=>{RZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Uer(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function W5n(t){return new ztr({type:"success",innerType:t})}a(W5n,"success");var Ytr=ct("ZodCatch",(t,e)=>{kZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>etr(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Ktr(t,e){return new Ytr({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(Ktr,"_catch");var Jtr=ct("ZodNaN",(t,e)=>{PZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ler(t,r,n,o)});function z5n(t){return fer(Jtr,t)}a(z5n,"nan");var pPe=ct("ZodPipe",(t,e)=>{jnt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ttr(t,r,n,o),t.in=e.in,t.out=e.out});function xit(t,e){return new pPe({type:"pipe",in:t,out:e})}a(xit,"pipe");var hPe=ct("ZodCodec",(t,e)=>{pPe.init(t,e),Yke.init(t,e)});function Y5n(t,e,r){return new hPe({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}a(Y5n,"codec");function K5n(t){let e=t._zod.def;return new hPe({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}a(K5n,"invertCodec");var Ztr=ct("ZodPreprocess",(t,e)=>{pPe.init(t,e),DZt.init(t,e)}),Xtr=ct("ZodReadonly",(t,e)=>{NZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>rtr(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function trr(t){return new Xtr({type:"readonly",innerType:t})}a(trr,"readonly");var rrr=ct("ZodTemplateLiteral",(t,e)=>{MZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ber(t,r,n,o)});function J5n(t,e){return new rrr({type:"template_literal",parts:t,...lr.normalizeParams(e)})}a(J5n,"templateLiteral");var nrr=ct("ZodLazy",(t,e)=>{BZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>itr(t,r,n,o),t.unwrap=()=>t._zod.def.getter()});function irr(t){return new nrr({type:"lazy",getter:t})}a(irr,"lazy");var orr=ct("ZodPromise",(t,e)=>{LZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ntr(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function Z5n(t){return new orr({type:"promise",innerType:t})}a(Z5n,"promise");var srr=ct("ZodFunction",(t,e)=>{OZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>qer(t,r,n,o)});function X5n(t){return new srr({type:"function",input:Array.isArray(t?.input)?Mtr(t?.input):t?.input??Qr(Fl()),output:t?.output??Fl()})}a(X5n,"_function");var mPe=ct("ZodCustom",(t,e)=>{FZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Qer(t,r,n,o)});function e4n(t){let e=new iu({check:"custom"});return e._zod.check=t,e}a(e4n,"check");function Zit(t,e){return mer(mPe,t??(()=>!0),e)}a(Zit,"custom");function arr(t,e={}){return ger(mPe,t,e)}a(arr,"refine");function crr(t,e){return Aer(t,e)}a(crr,"superRefine");var t4n=yer,r4n=_er;function n4n(t,e={}){let r=new mPe({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...lr.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}a(n4n,"_instanceof");var i4n=a((...t)=>Eer({Codec:hPe,Boolean:epe,String:Jfe},...t),"stringbool");function o4n(t){let e=irr(()=>Ul([Xe(t),ya(),Zc(),cPe(),Qr(e),ml(Xe(),e)]));return e}a(o4n,"json");function gPe(t,e){return new Ztr({type:"pipe",in:Yit(t),out:e})}a(gPe,"preprocess");p();var urr={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Rhs(t){Ep({customError:t})}a(Rhs,"setErrorMap");function khs(){return Ep().customError}a(khs,"getErrorMap");var lrr;lrr||(lrr={});p();var fn={...nPe,...vit,iso:zj},Phs=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Dhs(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}a(Dhs,"detectVersion");function Nhs(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let o=r[1];if(!o||!e.defs[o])throw new Error(`Reference not found: ${t}`);return e.defs[o]}throw new Error(`Reference not found: ${t}`)}a(Nhs,"resolveRef");function s4n(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return fn.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let o=t.$ref;if(e.refs.has(o))return e.refs.get(o);if(e.processing.has(o))return fn.lazy(()=>{if(!e.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return e.refs.get(o)});e.processing.add(o);let s=Nhs(o,e),c=O_(s,e);return e.refs.set(o,c),e.processing.delete(o),c}if(t.enum!==void 0){let o=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&o.length===1&&o[0]===null)return fn.null();if(o.length===0)return fn.never();if(o.length===1)return fn.literal(o[0]);if(o.every(c=>typeof c=="string"))return fn.enum(o);let s=o.map(c=>fn.literal(c));return s.length<2?s[0]:fn.union([s[0],s[1],...s.slice(2)])}if(t.const!==void 0)return fn.literal(t.const);let r=t.type;if(Array.isArray(r)){let o=r.map(s=>{let c={...t,type:s};return s4n(c,e)});return o.length===0?fn.never():o.length===1?o[0]:fn.union(o)}if(!r)return fn.any();let n;switch(r){case"string":{let o=fn.string();if(t.format){let s=t.format;s==="email"?o=o.check(fn.email()):s==="uri"||s==="uri-reference"?o=o.check(fn.url()):s==="uuid"||s==="guid"?o=o.check(fn.uuid()):s==="date-time"?o=o.check(fn.iso.datetime()):s==="date"?o=o.check(fn.iso.date()):s==="time"?o=o.check(fn.iso.time()):s==="duration"?o=o.check(fn.iso.duration()):s==="ipv4"?o=o.check(fn.ipv4()):s==="ipv6"?o=o.check(fn.ipv6()):s==="mac"?o=o.check(fn.mac()):s==="cidr"?o=o.check(fn.cidrv4()):s==="cidr-v6"?o=o.check(fn.cidrv6()):s==="base64"?o=o.check(fn.base64()):s==="base64url"?o=o.check(fn.base64url()):s==="e164"?o=o.check(fn.e164()):s==="jwt"?o=o.check(fn.jwt()):s==="emoji"?o=o.check(fn.emoji()):s==="nanoid"?o=o.check(fn.nanoid()):s==="cuid"?o=o.check(fn.cuid()):s==="cuid2"?o=o.check(fn.cuid2()):s==="ulid"?o=o.check(fn.ulid()):s==="xid"?o=o.check(fn.xid()):s==="ksuid"&&(o=o.check(fn.ksuid()))}typeof t.minLength=="number"&&(o=o.min(t.minLength)),typeof t.maxLength=="number"&&(o=o.max(t.maxLength)),t.pattern&&(o=o.regex(new RegExp(t.pattern))),n=o;break}case"number":case"integer":{let o=r==="integer"?fn.number().int():fn.number();typeof t.minimum=="number"&&(o=o.min(t.minimum)),typeof t.maximum=="number"&&(o=o.max(t.maximum)),typeof t.exclusiveMinimum=="number"?o=o.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(o=o.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?o=o.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(o=o.lt(t.maximum)),typeof t.multipleOf=="number"&&(o=o.multipleOf(t.multipleOf)),n=o;break}case"boolean":{n=fn.boolean();break}case"null":{n=fn.null();break}case"object":{let o={},s=t.properties||{},c=new Set(t.required||[]);for(let[u,d]of Object.entries(s)){let f=O_(d,e);o[u]=c.has(u)?f:f.optional()}if(t.propertyNames){let u=O_(t.propertyNames,e),d=t.additionalProperties&&typeof t.additionalProperties=="object"?O_(t.additionalProperties,e):fn.any();if(Object.keys(o).length===0){n=fn.record(u,d);break}let f=fn.object(o).passthrough(),h=fn.looseRecord(u,d);n=fn.intersection(f,h);break}if(t.patternProperties){let u=t.patternProperties,d=Object.keys(u),f=[];for(let m of d){let g=O_(u[m],e),A=fn.string().regex(new RegExp(m));f.push(fn.looseRecord(A,g))}let h=[];if(Object.keys(o).length>0&&h.push(fn.object(o).passthrough()),h.push(...f),h.length===0)n=fn.object({}).passthrough();else if(h.length===1)n=h[0];else{let m=fn.intersection(h[0],h[1]);for(let g=2;gO_(u,e)),l=s&&typeof s=="object"&&!Array.isArray(s)?O_(s,e):void 0;l?n=fn.tuple(c).rest(l):n=fn.tuple(c),typeof t.minItems=="number"&&(n=n.check(fn.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(fn.maxLength(t.maxItems)))}else if(Array.isArray(s)){let c=s.map(u=>O_(u,e)),l=t.additionalItems&&typeof t.additionalItems=="object"?O_(t.additionalItems,e):void 0;l?n=fn.tuple(c).rest(l):n=fn.tuple(c),typeof t.minItems=="number"&&(n=n.check(fn.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(fn.maxLength(t.maxItems)))}else if(s!==void 0){let c=O_(s,e),l=fn.array(c);typeof t.minItems=="number"&&(l=l.min(t.minItems)),typeof t.maxItems=="number"&&(l=l.max(t.maxItems)),n=l}else n=fn.array(fn.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}a(s4n,"convertBaseSchema");function O_(t,e){if(typeof t=="boolean")return t?fn.any():fn.never();let r=s4n(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let l=t.anyOf.map(d=>O_(d,e)),u=fn.union(l);r=n?fn.intersection(r,u):u}if(t.oneOf&&Array.isArray(t.oneOf)){let l=t.oneOf.map(d=>O_(d,e)),u=fn.xor(l);r=n?fn.intersection(r,u):u}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:fn.any();else{let l=n?r:O_(t.allOf[0],e),u=n?0:1;for(let d=u;d0&&e.registry.add(r,o),t.description&&(r=r.describe(t.description)),r}a(O_,"convertSchema");function a4n(t,e){if(typeof t=="boolean")return t?fn.any():fn.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=Dhs(r,e?.defaultTarget),o=r.$defs||r.definitions||{},s={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??ZA};return O_(r,s)}a(a4n,"fromJSONSchema");var APe={};Ti(APe,{bigint:()=>Bhs,boolean:()=>Lhs,date:()=>Fhs,number:()=>Ohs,string:()=>Mhs});p();function Mhs(t){return BXt(Jfe,t)}a(Mhs,"string");function Ohs(t){return $Xt(Xfe,t)}a(Ohs,"number");function Lhs(t){return ZXt(epe,t)}a(Lhs,"boolean");function Bhs(t){return eer(tpe,t)}a(Bhs,"bigint");function Fhs(t){return der(lPe,t)}a(Fhs,"date");Ep(Kke());p();var di={authenticate:"authenticate",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_focus:"document/didFocus",document_did_open:"document/didOpen",document_did_save:"document/didSave",initialize:"initialize",logout:"logout",mcp_message:"mcp/message",nes_accept:"nes/accept",nes_close:"nes/close",nes_reject:"nes/reject",nes_start:"nes/start",nes_suggest:"nes/suggest",providers_disable:"providers/disable",providers_list:"providers/list",providers_set:"providers/set",session_cancel:"session/cancel",session_close:"session/close",session_delete:"session/delete",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},Lf={elicitation_complete:"elicitation/complete",elicitation_create:"elicitation/create",fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",mcp_connect:"mcp/connect",mcp_disconnect:"mcp/disconnect",mcp_message:"mcp/message",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},Xit=1;p();var Qhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),terminal:P.boolean().optional().default(!1)}),qhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),label:P.string().nullish(),name:P.string(),optional:P.boolean().optional().default(!1),secret:P.boolean().optional().default(!0)}),jhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),id:P.string(),name:P.string()}),Hhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),id:P.string(),link:P.string().nullish(),name:P.string(),vars:P.array(qhs)}),Ghs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),args:P.array(P.string()).optional(),description:P.string().nullish(),env:P.record(P.string(),P.string()).optional(),id:P.string(),name:P.string()}),$hs=P.union([Hhs.and(P.object({type:P.literal("env_var")})),Ghs.and(P.object({type:P.literal("terminal")})),jhs]),frr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),methodId:P.string()}),Vhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Whs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),blob:P.string(),mimeType:P.string().nullish(),uri:P.string()}),zhs=P.object({default:P.boolean().nullish(),description:P.string().nullish(),title:P.string().nullish()}),Yhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Khs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Jhs=P.object({amount:P.number(),currency:P.string()}),Zhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),terminalId:P.string()}),Xhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),ems=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),newText:P.string(),oldText:P.string().nullish(),path:P.string()}),prr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:P.string()}),tms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),rms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),nms=P.union([P.string(),P.number(),P.number(),P.boolean(),P.array(P.string())]),ims=P.object({content:P.record(P.string(),nms).nullish()}),oms=P.intersection(P.union([ims.and(P.object({action:P.literal("accept")})),P.object({action:P.literal("decline")}),P.object({action:P.literal("cancel")})]),P.object({_meta:P.record(P.string(),P.unknown()).nullish()})),sms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),c4n=P.string(),hrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),elicitationId:c4n}),ams=P.literal("object"),cms=P.literal("string"),lms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),ums=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),form:sms.nullish(),url:lms.nullish()}),l4n=P.object({const:P.string(),title:P.string()}),u4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),name:P.string(),value:P.string()}),dms=P.union([P.literal(-32700),P.literal(-32600),P.literal(-32601),P.literal(-32602),P.literal(-32603),P.literal(-32800),P.literal(-32e3),P.literal(-32002),P.literal(-32042),P.number().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),d4n=P.object({code:dms,data:P.unknown().optional(),message:P.string()}),f4n=P.unknown(),p4n=P.unknown(),h4n=P.unknown(),fms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),readTextFile:P.boolean().optional().default(!1),writeTextFile:P.boolean().optional().default(!1)}),m4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),name:P.string(),value:P.string()}),g4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),name:P.string(),title:P.string().nullish(),version:P.string()}),pms=P.object({default:P.number().nullish(),description:P.string().nullish(),maximum:P.number().nullish(),minimum:P.number().nullish(),title:P.string().nullish()}),hms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),mrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),grr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),cursor:P.string().nullish(),cwd:P.string().nullish()}),Arr=P.union([P.literal("anthropic"),P.literal("openai"),P.literal("azure"),P.literal("vertex"),P.literal("bedrock"),P.string()]),mms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),gms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),logout:mms.nullish()}),yrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Ams=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),yms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),acp:P.boolean().optional().default(!1),http:P.boolean().optional().default(!1),sse:P.boolean().optional().default(!1)}),eot=P.string(),_ms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:eot}),Ems=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:eot}),A4n=P.string(),vms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),acpId:A4n}),Cms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:A4n,name:P.string()}),bms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),headers:P.array(m4n),name:P.string(),url:P.string()}),Sms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),headers:P.array(m4n),name:P.string(),url:P.string()}),Tms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),args:P.array(P.string()),command:P.string(),env:P.array(u4n),name:P.string()}),tot=P.union([bms.and(P.object({type:P.literal("http")})),Sms.and(P.object({type:P.literal("sse")})),Cms.and(P.object({type:P.literal("acp")})),Tms]),y4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:eot,method:P.string(),params:P.record(P.string(),P.unknown()).nullish()}),_4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:eot,method:P.string(),params:P.record(P.string(),P.unknown()).nullish()}),E4n=P.unknown(),_rr=P.string(),Ims=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),modelId:_rr,name:P.string()}),xms=P.union([P.literal("error"),P.literal("warning"),P.literal("information"),P.literal("hint")]),wms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Rms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),kms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Pms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Dms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Nms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),maxCount:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Mms=P.object({diff:P.string(),uri:P.string()}),Oms=P.object({endLine:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:P.string()}),Lms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Bms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Fms=P.object({languageId:P.string(),text:P.string(),uri:P.string()}),Ums=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),maxCount:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Qms=P.union([P.literal("rejected"),P.literal("ignored"),P.literal("replaced"),P.literal("cancelled")]),qms=P.object({excerpts:P.array(Oms),uri:P.string()}),jms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Hms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Gms=P.object({name:P.string(),owner:P.string(),remoteUrl:P.string()}),$ms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Vms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),jump:Lms.nullish(),rename:Hms.nullish(),searchAndReplace:$ms.nullish()}),Wms=P.object({id:P.string(),isRegex:P.boolean().nullish(),replace:P.string(),search:P.string(),uri:P.string()}),zms=P.union([P.literal("automatic"),P.literal("diagnostic"),P.literal("manual")]),Yms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),maxCount:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Kms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),diagnostics:wms.nullish(),editHistory:Nms.nullish(),openFiles:Bms.nullish(),recentFiles:Ums.nullish(),relatedSnippets:jms.nullish(),userActions:Yms.nullish()}),Err=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(tot)}),Jms=P.object({default:P.number().nullish(),description:P.string().nullish(),maximum:P.number().nullish(),minimum:P.number().nullish(),title:P.string().nullish()}),v4n=P.string(),Zms=P.union([P.literal("allow_once"),P.literal("allow_always"),P.literal("reject_once"),P.literal("reject_always")]),Xms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),kind:Zms,name:P.string(),optionId:v4n}),egs=P.union([P.literal("high"),P.literal("medium"),P.literal("low")]),tgs=P.union([P.literal("pending"),P.literal("in_progress"),P.literal("completed")]),rgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.string(),priority:egs,status:tgs}),ngs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),entries:P.array(rgs)}),Yj=P.object({character:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),igs=P.object({id:P.string(),position:Yj,uri:P.string()}),ogs=P.object({id:P.string(),newName:P.string(),position:Yj,uri:P.string()}),sgs=P.object({action:P.string(),position:Yj,timestampMs:P.number(),uri:P.string()}),C4n=P.union([P.literal("utf-16"),P.literal("utf-32"),P.literal("utf-8")]),ags=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),auth:Qhs.optional().default({terminal:!1}),elicitation:ums.nullish(),fs:fms.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Vms.nullish(),positionEncodings:P.array(C4n).optional(),terminal:P.boolean().optional().default(!1)}),cgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),audio:P.boolean().optional().default(!1),embeddedContext:P.boolean().optional().default(!1),image:P.boolean().optional().default(!1)}),b4n=P.number().int().gte(0).lte(65535),vrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),clientCapabilities:ags.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:g4n.nullish(),protocolVersion:b4n}),lgs=P.object({apiType:Arr,baseUrl:P.string()}),ugs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),current:lgs.nullish(),id:P.string(),required:P.boolean(),supported:P.array(Arr)}),dgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),providers:P.array(ugs)}),fgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),npe=P.object({end:Yj,start:Yj}),pgs=P.object({message:P.string(),range:npe,severity:xms,uri:P.string()}),hgs=P.object({languageId:P.string(),lastFocusedMs:P.number().nullish(),uri:P.string(),visibleRange:npe.nullish()}),mgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),diagnostics:P.array(pgs).nullish(),editHistory:P.array(Mms).nullish(),openFiles:P.array(hgs).nullish(),recentFiles:P.array(Fms).nullish(),relatedSnippets:P.array(qms).nullish(),userActions:P.array(sgs).nullish()}),ggs=P.object({newText:P.string(),range:npe}),Ags=P.object({cursorPosition:Yj.nullish(),edits:P.array(ggs),id:P.string(),uri:P.string()}),ygs=P.union([Ags.and(P.object({kind:P.literal("edit")})),igs.and(P.object({kind:P.literal("jump")})),ogs.and(P.object({kind:P.literal("rename")})),Wms.and(P.object({kind:P.literal("searchAndReplace")}))]),_gs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.string()}),Egs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Kj=P.union([P.number(),P.string()]).nullable(),Scf=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),requestId:Kj}),S4n=P.object({requestId:Kj}),vgs=P.enum(["assistant","user"]),yPe=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),audience:P.array(vgs).nullish(),lastModified:P.string().nullish(),priority:P.number().nullish()}),Cgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:yPe.nullish(),data:P.string(),mimeType:P.string()}),bgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:yPe.nullish(),data:P.string(),mimeType:P.string(),uri:P.string().nullish()}),Sgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:yPe.nullish(),description:P.string().nullish(),mimeType:P.string().nullish(),name:P.string(),size:P.number().nullish(),title:P.string().nullish(),uri:P.string()}),Tgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),optionId:v4n}),Igs=P.union([P.object({outcome:P.literal("cancelled")}),Tgs.and(P.object({outcome:P.literal("selected")}))]),xgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),outcome:Igs}),wgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Rgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),kgs=P.object({currentValue:P.boolean()}),Pgs=P.string(),T4n=P.string(),Dgs=P.union([P.literal("mode"),P.literal("model"),P.literal("thought_level"),P.string()]),Crr=P.string(),I4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),name:P.string(),value:Crr}),Ngs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),group:Pgs,name:P.string(),options:P.array(I4n)}),Mgs=P.union([P.array(I4n),P.array(Ngs)]),Ogs=P.object({currentValue:Crr,options:Mgs}),ipe=P.intersection(P.union([Ogs.and(P.object({type:P.literal("select")})),kgs.and(P.object({type:P.literal("boolean")}))]),P.object({_meta:P.record(P.string(),P.unknown()).nullish(),category:Dgs.nullish(),description:P.string().nullish(),id:T4n,name:P.string()})),Lgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(ipe)}),Bgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Fgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),gc=P.string(),brr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:P.string(),sessionId:gc}),Srr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc}),Trr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc}),Irr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc}),xrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),args:P.array(P.string()).optional(),command:P.string(),cwd:P.string().nullish(),env:P.array(u4n).optional(),outputByteLimit:P.number().nullish(),sessionId:gc}),wrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc}),Rrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,uri:P.string()}),krr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),position:Yj,sessionId:gc,uri:P.string(),version:P.number(),visibleRange:npe}),Prr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),languageId:P.string(),sessionId:gc,text:P.string(),uri:P.string(),version:P.number()}),Drr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,uri:P.string()}),Nrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(tot).optional(),sessionId:gc}),Mrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,terminalId:P.string()}),Orr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(tot),sessionId:gc}),Lrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),limit:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:P.string(),sessionId:gc}),Brr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:P.string(),reason:Qms.nullish(),sessionId:gc}),Frr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,terminalId:P.string()}),Urr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(tot).optional(),sessionId:gc}),Ugs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),sessionId:gc,title:P.string().nullish(),updatedAt:P.string().nullish()}),Qgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),nextCursor:P.string().nullish(),sessions:P.array(Ugs)}),qgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),title:P.string().nullish(),updatedAt:P.string().nullish()}),jgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),rot=P.string(),Hgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),currentModeId:rot}),Ggs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),id:rot,name:P.string()}),not=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),availableModes:P.array(Ggs),currentModeId:rot}),iot=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),availableModels:P.array(Ims),currentModelId:_rr}),$gs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(ipe).nullish(),models:iot.nullish(),modes:not.nullish(),sessionId:gc}),Vgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(ipe).nullish(),models:iot.nullish(),modes:not.nullish()}),Wgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(ipe).nullish(),models:iot.nullish(),modes:not.nullish(),sessionId:gc}),zgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(ipe).nullish(),models:iot.nullish(),modes:not.nullish()}),Ygs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Kgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:wgs.nullish(),close:Rgs.nullish(),delete:Bgs.nullish(),fork:Fgs.nullish(),list:jgs.nullish(),resume:Ygs.nullish()}),Qrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),apiType:Arr,baseUrl:P.string(),headers:P.record(P.string(),P.string()).optional(),id:P.string()}),Jgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),qrr=P.intersection(P.union([P.object({type:P.literal("boolean"),value:P.boolean()}),P.object({value:Crr})]),P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configId:T4n,sessionId:gc})),Zgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(ipe)}),jrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),modeId:rot,sessionId:gc}),Xgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Hrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),modelId:_rr,sessionId:gc}),e0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),t0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc}),r0s=P.union([P.literal("end_turn"),P.literal("max_tokens"),P.literal("max_turn_requests"),P.literal("refusal"),P.literal("cancelled")]),n0s=P.union([P.literal("email"),P.literal("uri"),P.literal("date"),P.literal("date-time")]),i0s=P.object({default:P.string().nullish(),description:P.string().nullish(),enum:P.array(P.string()).nullish(),format:n0s.nullish(),maxLength:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:P.array(l4n).nullish(),pattern:P.string().nullish(),title:P.string().nullish()}),Grr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),context:mgs.nullish(),position:Yj,selection:npe.nullish(),sessionId:gc,triggerKind:zms,uri:P.string(),version:P.number()}),o0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),suggestions:P.array(ygs)}),s0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),terminalId:P.string()}),a0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),exitCode:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:P.string().nullish()}),$rr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,terminalId:P.string()}),c0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),exitStatus:a0s.nullish(),output:P.string(),truncated:P.boolean()}),l0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:yPe.nullish(),text:P.string()}),u0s=P.object({range:npe.nullish(),text:P.string()}),Vrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),contentChanges:P.array(u0s),sessionId:gc,uri:P.string(),version:P.number()}),Tcf=P.object({method:P.string(),params:P.union([Srr,Prr,Vrr,Rrr,Drr,krr,brr,Brr,y4n,f4n]).nullish()}),d0s=P.union([P.literal("full"),P.literal("incremental")]),f0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),syncKind:d0s}),p0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),didChange:f0s.nullish(),didClose:Rms.nullish(),didFocus:kms.nullish(),didOpen:Pms.nullish(),didSave:Dms.nullish()}),h0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),document:p0s.nullish()}),m0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),context:Kms.nullish(),events:h0s.nullish()}),g0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),auth:gms.optional().default({}),loadSession:P.boolean().optional().default(!1),mcpCapabilities:yms.optional().default({acp:!1,http:!1,sse:!1}),nes:m0s.nullish(),positionEncoding:C4n.nullish(),promptCapabilities:cgs.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:fgs.nullish(),sessionCapabilities:Kgs.optional().default({})}),A0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),agentCapabilities:g0s.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:g4n.nullish(),authMethods:P.array($hs).optional().default([]),protocolVersion:b4n}),y0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),mimeType:P.string().nullish(),text:P.string(),uri:P.string()}),_0s=P.union([y0s,Whs]),E0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:yPe.nullish(),resource:_0s}),Wrr=P.union([l0s.and(P.object({type:P.literal("text")})),bgs.and(P.object({type:P.literal("image")})),Cgs.and(P.object({type:P.literal("audio")})),Sgs.and(P.object({type:P.literal("resource_link")})),E0s.and(P.object({type:P.literal("resource")}))]),v0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:Wrr}),drr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:Wrr,messageId:P.string().nullish()}),zrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),messageId:P.string().nullish(),prompt:P.array(Wrr),sessionId:gc}),C0s=P.object({anyOf:P.array(l4n)}),x4n=P.union([v0s.and(P.object({type:P.literal("content")})),ems.and(P.object({type:P.literal("diff")})),s0s.and(P.object({type:P.literal("terminal")}))]),Yrr=P.string(),w4n=P.object({sessionId:gc,toolCallId:Yrr.nullish()}),b0s=P.intersection(P.union([w4n,S4n]),P.object({elicitationId:c4n,url:P.string().url()})),R4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),line:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:P.string()}),k4n=P.union([P.literal("pending"),P.literal("in_progress"),P.literal("completed"),P.literal("failed")]),P4n=P.union([P.literal("read"),P.literal("edit"),P.literal("delete"),P.literal("move"),P.literal("search"),P.literal("execute"),P.literal("think"),P.literal("fetch"),P.literal("switch_mode"),P.literal("other")]),S0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.array(x4n).optional(),kind:P4n.optional(),locations:P.array(R4n).optional(),rawInput:P.unknown().optional(),rawOutput:P.unknown().optional(),status:k4n.optional(),title:P.string(),toolCallId:Yrr}),D4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.array(x4n).nullish(),kind:P4n.nullish(),locations:P.array(R4n).nullish(),rawInput:P.unknown().optional(),rawOutput:P.unknown().optional(),status:k4n.nullish(),title:P.string().nullish(),toolCallId:Yrr}),Krr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),options:P.array(Xms),sessionId:gc,toolCall:D4n}),T0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),hint:P.string()}),I0s=T0s,x0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string(),input:I0s.nullish(),name:P.string()}),w0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),availableCommands:P.array(x0s)}),R0s=P.object({enum:P.array(P.string()),type:cms}),k0s=P.union([R0s,C0s]),P0s=P.object({default:P.array(P.string()).nullish(),description:P.string().nullish(),items:k0s,maxItems:P.number().nullish(),minItems:P.number().nullish(),title:P.string().nullish()}),D0s=P.union([i0s.and(P.object({type:P.literal("string")})),Jms.and(P.object({type:P.literal("number")})),pms.and(P.object({type:P.literal("integer")})),zhs.and(P.object({type:P.literal("boolean")})),P0s.and(P.object({type:P.literal("array")}))]),N0s=P.object({description:P.string().nullish(),properties:P.record(P.string(),D0s).optional().default({}),required:P.array(P.string()).nullish(),title:P.string().nullish(),type:ams.optional().default("object")}),M0s=P.intersection(P.union([w4n,S4n]),P.object({requestedSchema:N0s})),Jrr=P.intersection(P.union([M0s.and(P.object({mode:P.literal("form")})),b0s.and(P.object({mode:P.literal("url")}))]),P.object({_meta:P.record(P.string(),P.unknown()).nullish(),message:P.string()})),O0s=P.object({cachedReadTokens:P.number().nullish(),cachedWriteTokens:P.number().nullish(),inputTokens:P.number(),outputTokens:P.number(),thoughtTokens:P.number().nullish(),totalTokens:P.number()}),L0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),stopReason:r0s,usage:O0s.nullish(),userMessageId:P.string().nullish()}),Icf=P.union([P.object({id:Kj,result:P.union([A0s,Vhs,dgs,Jgs,tms,Ams,Wgs,Vgs,Qgs,Xhs,$gs,zgs,Khs,Xgs,Zgs,L0s,e0s,t0s,o0s,Yhs,h4n,E4n])}),P.object({error:d4n,id:Kj})]),B0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),cost:Jhs.nullish(),size:P.number(),used:P.number()}),F0s=P.union([drr.and(P.object({sessionUpdate:P.literal("user_message_chunk")})),drr.and(P.object({sessionUpdate:P.literal("agent_message_chunk")})),drr.and(P.object({sessionUpdate:P.literal("agent_thought_chunk")})),S0s.and(P.object({sessionUpdate:P.literal("tool_call")})),D4n.and(P.object({sessionUpdate:P.literal("tool_call_update")})),ngs.and(P.object({sessionUpdate:P.literal("plan")})),w0s.and(P.object({sessionUpdate:P.literal("available_commands_update")})),Hgs.and(P.object({sessionUpdate:P.literal("current_mode_update")})),Lgs.and(P.object({sessionUpdate:P.literal("config_option_update")})),qgs.and(P.object({sessionUpdate:P.literal("session_info_update")})),B0s.and(P.object({sessionUpdate:P.literal("usage_update")}))]),Zrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,update:F0s}),xcf=P.object({method:P.string(),params:P.union([Zrr,hrr,y4n,f4n]).nullish()}),Xrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,terminalId:P.string()}),U0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),exitCode:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:P.string().nullish()}),Q0s=P.object({name:P.string(),uri:P.string()}),enr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),repository:Gms.nullish(),workspaceFolders:P.array(Q0s).nullish(),workspaceUri:P.string().nullish()}),wcf=P.object({id:Kj,method:P.string(),params:P.union([vrr,frr,mrr,Qrr,prr,yrr,Err,Orr,grr,wrr,Nrr,Urr,Irr,jrr,qrr,zrr,Hrr,enr,Grr,Trr,_4n,p4n]).nullish()}),tnr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.string(),path:P.string(),sessionId:gc}),Rcf=P.object({id:Kj,method:P.string(),params:P.union([tnr,Lrr,Krr,xrr,$rr,Frr,Xrr,Mrr,Jrr,vms,_4n,Ems,p4n]).nullish()}),q0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),kcf=P.union([P.object({id:Kj,result:P.union([q0s,_gs,xgs,Zhs,c0s,Egs,U0s,hms,oms,_ms,rms,h4n,E4n])}),P.object({error:d4n,id:Kj})]);p();function _Pe(t,e){let r=new TextEncoder,n=new TextDecoder,o=new ReadableStream({async start(c){let l="",u=e.getReader();try{for(;;){let{value:f,done:h}=await u.read();if(h){l+=n.decode();break}if(!f)continue;l+=n.decode(f,{stream:!0});let m=l.split(` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let c of t.seen.entries()){let l=c[1];if(e===c[0]){s(c);continue}if(t.external){let d=t.external.registry.get(c[0])?.id;if(e!==c[0]&&d){s(c);continue}}if(t.metadataRegistry.get(c[0])?.id){s(c);continue}if(l.cycle){s(c);continue}if(l.count>1&&t.reused==="ref"){s(c);continue}}}a(Vj,"extractDefs");function Wj(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a(l=>{let u=t.seen.get(l);if(u.ref===null)return;let d=u.def??u.schema,f={...d},h=u.ref;if(u.ref=null,h){n(h);let g=t.seen.get(h),A=g.schema;if(A.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(A)):Object.assign(d,A),Object.assign(d,f),l._zod.parent===h)for(let _ in d)_==="$ref"||_==="allOf"||_ in f||delete d[_];if(A.$ref&&g.def)for(let _ in d)_==="$ref"||_==="allOf"||_ in g.def&&JSON.stringify(d[_])===JSON.stringify(g.def[_])&&delete d[_]}let m=l._zod.parent;if(m&&m!==h){n(m);let g=t.seen.get(m);if(g?.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(let A in d)A==="$ref"||A==="allOf"||A in g.def&&JSON.stringify(d[A])===JSON.stringify(g.def[A])&&delete d[A]}t.override({zodSchema:l,jsonSchema:d,path:u.path??[]})},"flattenRef");for(let l of[...t.seen.entries()].reverse())n(l[0]);let o={};if(t.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let l=t.external.registry.get(e)?.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=t.external.uri(l)}Object.assign(o,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&o.id===s&&delete o.id;let c=t.external?.defs??{};for(let l of t.seen.entries()){let u=l[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,c[u.defId]=u.def)}t.external||Object.keys(c).length>0&&(t.target==="draft-2020-12"?o.$defs=c:o.definitions=c);try{let l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...e["~standard"],jsonSchema:{input:Yfe(e,"input",t.processors),output:Yfe(e,"output",t.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}a(Wj,"finalize");function Cv(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Cv(n.element,r);if(n.type==="set")return Cv(n.valueType,r);if(n.type==="lazy")return Cv(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Cv(n.innerType,r);if(n.type==="intersection")return Cv(n.left,r)||Cv(n.right,r);if(n.type==="record"||n.type==="map")return Cv(n.keyType,r)||Cv(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Cv(n.in,r)||Cv(n.out,r);if(n.type==="object"){for(let o in n.shape)if(Cv(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(Cv(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(Cv(o,r))return!0;return!!(n.rest&&Cv(n.rest,r))}return!1}a(Cv,"isTransforming");var Cer=a((t,e={})=>r=>{let n=$j({...r,processors:e});return Jc(t,n),Vj(n,t),Wj(n,t)},"createToJSONSchemaMethod"),Yfe=a((t,e,r={})=>n=>{let{libraryOptions:o,target:s}=n??{},c=$j({...o??{},target:s,io:e,processors:r});return Jc(t,c),Vj(c,t),Wj(c,t)},"createStandardJSONSchemaMethod");p();var xhs={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ber=a((t,e,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:c,format:l,patterns:u,contentEncoding:d}=t._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof c=="number"&&(o.maxLength=c),l&&(o.format=xhs[l]??l,o.format===""&&delete o.format,l==="time"&&delete o.format),d&&(o.contentEncoding=d),u&&u.size>0){let f=[...u];f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(h=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},"stringProcessor"),Ser=a((t,e,r,n)=>{let o=r,{minimum:s,maximum:c,format:l,multipleOf:u,exclusiveMaximum:d,exclusiveMinimum:f}=t._zod.bag;typeof l=="string"&&l.includes("int")?o.type="integer":o.type="number";let h=typeof f=="number"&&f>=(s??Number.NEGATIVE_INFINITY),m=typeof d=="number"&&d<=(c??Number.POSITIVE_INFINITY),g=e.target==="draft-04"||e.target==="openapi-3.0";h?g?(o.minimum=f,o.exclusiveMinimum=!0):o.exclusiveMinimum=f:typeof s=="number"&&(o.minimum=s),m?g?(o.maximum=d,o.exclusiveMaximum=!0):o.exclusiveMaximum=d:typeof c=="number"&&(o.maximum=c),typeof u=="number"&&(o.multipleOf=u)},"numberProcessor"),Ter=a((t,e,r,n)=>{r.type="boolean"},"booleanProcessor"),Ier=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),xer=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),wer=a((t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),Rer=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),ker=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),Per=a((t,e,r,n)=>{r.not={}},"neverProcessor"),Der=a((t,e,r,n)=>{},"anyProcessor"),Ner=a((t,e,r,n)=>{},"unknownProcessor"),Mer=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),Oer=a((t,e,r,n)=>{let o=t._zod.def,s=Nke(o.entries);s.every(c=>typeof c=="number")&&(r.type="number"),s.every(c=>typeof c=="string")&&(r.type="string"),r.enum=s},"enumProcessor"),Ler=a((t,e,r,n)=>{let o=t._zod.def,s=[];for(let c of o.values)if(c===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(c))}else s.push(c);if(s.length!==0)if(s.length===1){let c=s[0];r.type=c===null?"null":typeof c,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[c]:r.const=c}else s.every(c=>typeof c=="number")&&(r.type="number"),s.every(c=>typeof c=="string")&&(r.type="string"),s.every(c=>typeof c=="boolean")&&(r.type="boolean"),s.every(c=>c===null)&&(r.type="null"),r.enum=s},"literalProcessor"),Ber=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),Fer=a((t,e,r,n)=>{let o=r,s=t._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=s.source},"templateLiteralProcessor"),Uer=a((t,e,r,n)=>{let o=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:c,maximum:l,mime:u}=t._zod.bag;c!==void 0&&(s.minLength=c),l!==void 0&&(s.maxLength=l),u?u.length===1?(s.contentMediaType=u[0],Object.assign(o,s)):(Object.assign(o,s),o.anyOf=u.map(d=>({contentMediaType:d}))):Object.assign(o,s)},"fileProcessor"),Qer=a((t,e,r,n)=>{r.type="boolean"},"successProcessor"),qer=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),jer=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),Her=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),Ger=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),$er=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),Ver=a((t,e,r,n)=>{let o=r,s=t._zod.def,{minimum:c,maximum:l}=t._zod.bag;typeof c=="number"&&(o.minItems=c),typeof l=="number"&&(o.maxItems=l),o.type="array",o.items=Jc(s.element,e,{...n,path:[...n.path,"items"]})},"arrayProcessor"),Wer=a((t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object",o.properties={};let c=s.shape;for(let d in c)o.properties[d]=Jc(c[d],e,{...n,path:[...n.path,"properties",d]});let l=new Set(Object.keys(c)),u=new Set([...l].filter(d=>{let f=s.shape[d]._zod;return e.io==="input"?f.optin===void 0:f.optout===void 0}));u.size>0&&(o.required=Array.from(u)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Jc(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},"objectProcessor"),Ait=a((t,e,r,n)=>{let o=t._zod.def,s=o.inclusive===!1,c=o.options.map((l,u)=>Jc(l,e,{...n,path:[...n.path,s?"oneOf":"anyOf",u]}));s?r.oneOf=c:r.anyOf=c},"unionProcessor"),zer=a((t,e,r,n)=>{let o=t._zod.def,s=Jc(o.left,e,{...n,path:[...n.path,"allOf",0]}),c=Jc(o.right,e,{...n,path:[...n.path,"allOf",1]}),l=a(d=>"allOf"in d&&Object.keys(d).length===1,"isSimpleIntersection"),u=[...l(s)?s.allOf:[s],...l(c)?c.allOf:[c]];r.allOf=u},"intersectionProcessor"),Yer=a((t,e,r,n)=>{let o=r,s=t._zod.def;o.type="array";let c=e.target==="draft-2020-12"?"prefixItems":"items",l=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=s.items.map((m,g)=>Jc(m,e,{...n,path:[...n.path,c,g]})),d=s.rest?Jc(s.rest,e,{...n,path:[...n.path,l,...e.target==="openapi-3.0"?[s.items.length]:[]]}):null;e.target==="draft-2020-12"?(o.prefixItems=u,d&&(o.items=d)):e.target==="openapi-3.0"?(o.items={anyOf:u},d&&o.items.anyOf.push(d),o.minItems=u.length,d||(o.maxItems=u.length)):(o.items=u,d&&(o.additionalItems=d));let{minimum:f,maximum:h}=t._zod.bag;typeof f=="number"&&(o.minItems=f),typeof h=="number"&&(o.maxItems=h)},"tupleProcessor"),Ker=a((t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object";let c=s.keyType,u=c._zod.bag?.patterns;if(s.mode==="loose"&&u&&u.size>0){let f=Jc(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let h of u)o.patternProperties[h.source]=f}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(o.propertyNames=Jc(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=Jc(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let d=c._zod.values;if(d){let f=[...d].filter(h=>typeof h=="string"||typeof h=="number");f.length>0&&(o.required=f)}},"recordProcessor"),Jer=a((t,e,r,n)=>{let o=t._zod.def,s=Jc(o.innerType,e,n),c=e.seen.get(t);e.target==="openapi-3.0"?(c.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},"nullableProcessor"),Zer=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},"nonoptionalProcessor"),Xer=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},"defaultProcessor"),etr=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},"prefaultProcessor"),ttr=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType;let c;try{c=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=c},"catchProcessor"),rtr=a((t,e,r,n)=>{let o=t._zod.def,s=o.in._zod.traits.has("$ZodTransform"),c=e.io==="input"?s?o.out:o.in:o.out;Jc(c,e,n);let l=e.seen.get(t);l.ref=c},"pipeProcessor"),ntr=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.readOnly=!0},"readonlyProcessor"),itr=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},"promiseProcessor"),yit=a((t,e,r,n)=>{let o=t._zod.def;Jc(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},"optionalProcessor"),otr=a((t,e,r,n)=>{let o=t._zod.innerType;Jc(o,e,n);let s=e.seen.get(t);s.ref=o},"lazyProcessor"),git={string:ber,number:Ser,boolean:Ter,bigint:Ier,symbol:xer,null:wer,undefined:Rer,void:ker,never:Per,any:Der,unknown:Ner,date:Mer,enum:Oer,literal:Ler,nan:Ber,template_literal:Fer,file:Uer,success:Qer,custom:qer,function:jer,transform:Her,map:Ger,set:$er,array:Ver,object:Wer,union:Ait,intersection:zer,tuple:Yer,record:Ker,nullable:Jer,nonoptional:Zer,default:Xer,prefault:etr,catch:ttr,pipe:rtr,readonly:ntr,promise:itr,optional:yit,lazy:otr};function _it(t,e){if("_idmap"in t){let n=t,o=$j({...e,processors:git}),s={};for(let u of n._idmap.entries()){let[d,f]=u;Jc(f,o)}let c={},l={registry:n,uri:e?.uri,defs:s};o.external=l;for(let u of n._idmap.entries()){let[d,f]=u;Vj(o,f),c[d]=Wj(o,f)}if(Object.keys(s).length>0){let u=o.target==="draft-2020-12"?"$defs":"definitions";c.__shared={[u]:s}}return{schemas:c}}let r=$j({...e,processors:git});return Jc(t,r),Vj(r,t),Wj(r,t)}a(_it,"toJSONSchema");p();var Eit=class{static{a(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=$j({processors:git,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return Jc(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Vj(this.ctx,e);let n=Wj(this.ctx,e),{"~standard":o,...s}=n;return s}};var JOn={};p();var nPe={};Ti(nPe,{ZodAny:()=>Itr,ZodArray:()=>ktr,ZodBase64:()=>jit,ZodBase64URL:()=>Hit,ZodBigInt:()=>rpe,ZodBigIntFormat:()=>Vit,ZodBoolean:()=>tpe,ZodCIDRv4:()=>Qit,ZodCIDRv6:()=>qit,ZodCUID:()=>Nit,ZodCUID2:()=>Mit,ZodCatch:()=>Ktr,ZodCodec:()=>hPe,ZodCustom:()=>mPe,ZodCustomStringFormat:()=>Xfe,ZodDate:()=>lPe,ZodDefault:()=>Gtr,ZodDiscriminatedUnion:()=>Dtr,ZodE164:()=>Git,ZodEmail:()=>Rit,ZodEmoji:()=>Pit,ZodEnum:()=>Jfe,ZodExactOptional:()=>qtr,ZodFile:()=>Utr,ZodFunction:()=>arr,ZodGUID:()=>iPe,ZodIPv4:()=>Fit,ZodIPv6:()=>Uit,ZodIntersection:()=>Ntr,ZodJWT:()=>$it,ZodKSUID:()=>Bit,ZodLazy:()=>irr,ZodLiteral:()=>Ftr,ZodMAC:()=>Ctr,ZodMap:()=>Ltr,ZodNaN:()=>Ztr,ZodNanoID:()=>Dit,ZodNever:()=>wtr,ZodNonOptional:()=>Jit,ZodNull:()=>Ttr,ZodNullable:()=>Htr,ZodNumber:()=>epe,ZodNumberFormat:()=>MZ,ZodObject:()=>uPe,ZodOptional:()=>Kit,ZodPipe:()=>pPe,ZodPrefault:()=>Vtr,ZodPreprocess:()=>Xtr,ZodPromise:()=>srr,ZodReadonly:()=>trr,ZodRecord:()=>Kfe,ZodSet:()=>Btr,ZodString:()=>Zfe,ZodStringFormat:()=>Bl,ZodSuccess:()=>Ytr,ZodSymbol:()=>btr,ZodTemplateLiteral:()=>nrr,ZodTransform:()=>Qtr,ZodTuple:()=>Mtr,ZodType:()=>rs,ZodULID:()=>Oit,ZodURL:()=>aPe,ZodUUID:()=>H5,ZodUndefined:()=>Str,ZodUnion:()=>dPe,ZodUnknown:()=>xtr,ZodVoid:()=>Rtr,ZodXID:()=>Lit,ZodXor:()=>Ptr,_ZodString:()=>wit,_default:()=>$tr,_function:()=>e4n,any:()=>Wit,array:()=>Qr,base64:()=>_5n,base64url:()=>E5n,bigint:()=>P5n,boolean:()=>Zc,catch:()=>Jtr,check:()=>t4n,cidrv4:()=>A5n,cidrv6:()=>y5n,codec:()=>K5n,cuid:()=>l5n,cuid2:()=>u5n,custom:()=>Zit,date:()=>B5n,describe:()=>r4n,discriminatedUnion:()=>fPe,e164:()=>v5n,email:()=>e5n,emoji:()=>a5n,enum:()=>XA,exactOptional:()=>jtr,file:()=>V5n,float32:()=>x5n,float64:()=>w5n,function:()=>e4n,guid:()=>t5n,hash:()=>I5n,hex:()=>T5n,hostname:()=>S5n,httpUrl:()=>s5n,instanceof:()=>i4n,int:()=>Iit,int32:()=>R5n,int64:()=>D5n,intersection:()=>npe,invertCodec:()=>J5n,ipv4:()=>h5n,ipv6:()=>g5n,json:()=>s4n,jwt:()=>C5n,keyof:()=>F5n,ksuid:()=>p5n,lazy:()=>orr,literal:()=>zn,looseObject:()=>gh,looseRecord:()=>j5n,mac:()=>m5n,map:()=>H5n,meta:()=>n4n,nan:()=>Y5n,nanoid:()=>c5n,nativeEnum:()=>$5n,never:()=>zit,nonoptional:()=>ztr,null:()=>cPe,nullable:()=>oPe,nullish:()=>W5n,number:()=>ya,object:()=>Yr,optional:()=>ou,partialRecord:()=>q5n,pipe:()=>xit,prefault:()=>Wtr,preprocess:()=>gPe,promise:()=>X5n,readonly:()=>rrr,record:()=>ml,refine:()=>crr,set:()=>G5n,strictObject:()=>U5n,string:()=>Xe,stringFormat:()=>b5n,stringbool:()=>o4n,success:()=>z5n,superRefine:()=>lrr,symbol:()=>M5n,templateLiteral:()=>Z5n,transform:()=>Yit,tuple:()=>Otr,uint32:()=>k5n,uint64:()=>N5n,ulid:()=>d5n,undefined:()=>O5n,union:()=>Ul,unknown:()=>Fl,url:()=>kit,uuid:()=>r5n,uuidv4:()=>n5n,uuidv6:()=>i5n,uuidv7:()=>o5n,void:()=>L5n,xid:()=>f5n,xor:()=>Q5n});p();var vit={};Ti(vit,{endsWith:()=>qfe,gt:()=>q5,gte:()=>vv,includes:()=>Ufe,length:()=>NZ,lowercase:()=>Bfe,lt:()=>Q5,lte:()=>DT,maxLength:()=>DZ,maxSize:()=>Gj,mime:()=>jfe,minLength:()=>i8,minSize:()=>j5,multipleOf:()=>Hj,negative:()=>fit,nonnegative:()=>hit,nonpositive:()=>pit,normalize:()=>Hfe,overwrite:()=>U2,positive:()=>dit,property:()=>mit,regex:()=>Lfe,size:()=>PZ,slugify:()=>Wfe,startsWith:()=>Qfe,toLowerCase:()=>$fe,toUpperCase:()=>Vfe,trim:()=>Gfe,uppercase:()=>Ffe});p();var zj={};Ti(zj,{ZodISODate:()=>bit,ZodISODateTime:()=>Cit,ZodISODuration:()=>Tit,ZodISOTime:()=>Sit,date:()=>atr,datetime:()=>str,duration:()=>ltr,time:()=>ctr});p();var Cit=ct("ZodISODateTime",(t,e)=>{jJt.init(t,e),Bl.init(t,e)});function str(t){return qXt(Cit,t)}a(str,"datetime");var bit=ct("ZodISODate",(t,e)=>{HJt.init(t,e),Bl.init(t,e)});function atr(t){return jXt(bit,t)}a(atr,"date");var Sit=ct("ZodISOTime",(t,e)=>{GJt.init(t,e),Bl.init(t,e)});function ctr(t){return HXt(Sit,t)}a(ctr,"time");var Tit=ct("ZodISODuration",(t,e)=>{$Jt.init(t,e),Bl.init(t,e)});function ltr(t){return GXt(Tit,t)}a(ltr,"duration");p();p();var ZOn=a((t,e)=>{Fke.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>Qke(t,r),"value")},flatten:{value:a(r=>Uke(t,r),"value")},addIssue:{value:a(r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Ife,2)},"value")},addIssues:{value:a(r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Ife,2)},"value")},isEmpty:{get(){return t.issues.length===0}}})},"initializer"),Rhs=ct("ZodError",ZOn),Tb=ct("ZodError",ZOn,{Parent:Error});var utr=Rfe(Tb),dtr=kfe(Tb),ftr=Pfe(Tb),ptr=Nfe(Tb),htr=Cnt(Tb),mtr=bnt(Tb),gtr=Snt(Tb),Atr=Tnt(Tb),ytr=Int(Tb),_tr=xnt(Tb),Etr=wnt(Tb),vtr=Rnt(Tb);var XOn=new WeakMap;function sPe(t,e,r){let n=Object.getPrototypeOf(t),o=XOn.get(n);if(o||(o=new Set,XOn.set(n,o)),!o.has(e)){o.add(e);for(let s in r){let c=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){let l=c.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:l}),l},set(l){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:l})}})}}}a(sPe,"_installLazyMethods");var rs=ct("ZodType",(t,e)=>(po.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Yfe(t,"input"),output:Yfe(t,"output")}}),t.toJSONSchema=Cer(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>utr(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>ftr(t,r,n),t.parseAsync=async(r,n)=>dtr(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>ptr(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>htr(t,r,n),t.decode=(r,n)=>mtr(t,r,n),t.encodeAsync=async(r,n)=>gtr(t,r,n),t.decodeAsync=async(r,n)=>Atr(t,r,n),t.safeEncode=(r,n)=>ytr(t,r,n),t.safeDecode=(r,n)=>_tr(t,r,n),t.safeEncodeAsync=async(r,n)=>Etr(t,r,n),t.safeDecodeAsync=async(r,n)=>vtr(t,r,n),sPe(t,"ZodType",{check(...r){let n=this.def;return this.clone(lr.mergeDefs(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return _v(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(crr(r,n))},superRefine(r,n){return this.check(lrr(r,n))},overwrite(r){return this.check(U2(r))},optional(){return ou(this)},exactOptional(){return jtr(this)},nullable(){return oPe(this)},nullish(){return ou(oPe(this))},nonoptional(r){return ztr(this,r)},array(){return Qr(this)},or(r){return Ul([this,r])},and(r){return npe(this,r)},transform(r){return xit(this,Yit(r))},default(r){return $tr(this,r)},prefault(r){return Wtr(this,r)},catch(r){return Jtr(this,r)},pipe(r){return xit(this,r)},readonly(){return rrr(this)},describe(r){let n=this.clone();return ZA.add(n,{description:r}),n},meta(...r){if(r.length===0)return ZA.get(this);let n=this.clone();return ZA.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return ZA.get(t)?.description},configurable:!0}),t)),wit=ct("_ZodString",(t,e)=>{kZ.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(n,o,s)=>ber(t,n,o,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,sPe(t,"_ZodString",{regex(...n){return this.check(Lfe(...n))},includes(...n){return this.check(Ufe(...n))},startsWith(...n){return this.check(Qfe(...n))},endsWith(...n){return this.check(qfe(...n))},min(...n){return this.check(i8(...n))},max(...n){return this.check(DZ(...n))},length(...n){return this.check(NZ(...n))},nonempty(...n){return this.check(i8(1,...n))},lowercase(n){return this.check(Bfe(n))},uppercase(n){return this.check(Ffe(n))},trim(){return this.check(Gfe())},normalize(...n){return this.check(Hfe(...n))},toLowerCase(){return this.check($fe())},toUpperCase(){return this.check(Vfe())},slugify(){return this.check(Wfe())}})}),Zfe=ct("ZodString",(t,e)=>{kZ.init(t,e),wit.init(t,e),t.email=r=>t.check($nt(Rit,r)),t.url=r=>t.check(rPe(aPe,r)),t.jwt=r=>t.check(uit($it,r)),t.emoji=r=>t.check(Knt(Pit,r)),t.guid=r=>t.check(tPe(iPe,r)),t.uuid=r=>t.check(Vnt(H5,r)),t.uuidv4=r=>t.check(Wnt(H5,r)),t.uuidv6=r=>t.check(znt(H5,r)),t.uuidv7=r=>t.check(Ynt(H5,r)),t.nanoid=r=>t.check(Jnt(Dit,r)),t.guid=r=>t.check(tPe(iPe,r)),t.cuid=r=>t.check(Znt(Nit,r)),t.cuid2=r=>t.check(Xnt(Mit,r)),t.ulid=r=>t.check(eit(Oit,r)),t.base64=r=>t.check(ait(jit,r)),t.base64url=r=>t.check(cit(Hit,r)),t.xid=r=>t.check(tit(Lit,r)),t.ksuid=r=>t.check(rit(Bit,r)),t.ipv4=r=>t.check(nit(Fit,r)),t.ipv6=r=>t.check(iit(Uit,r)),t.cidrv4=r=>t.check(oit(Qit,r)),t.cidrv6=r=>t.check(sit(qit,r)),t.e164=r=>t.check(lit(Git,r)),t.datetime=r=>t.check(str(r)),t.date=r=>t.check(atr(r)),t.time=r=>t.check(ctr(r)),t.duration=r=>t.check(ltr(r))});function Xe(t){return BXt(Zfe,t)}a(Xe,"string");var Bl=ct("ZodStringFormat",(t,e)=>{Ll.init(t,e),wit.init(t,e)}),Rit=ct("ZodEmail",(t,e)=>{NJt.init(t,e),Bl.init(t,e)});function e5n(t){return $nt(Rit,t)}a(e5n,"email");var iPe=ct("ZodGUID",(t,e)=>{PJt.init(t,e),Bl.init(t,e)});function t5n(t){return tPe(iPe,t)}a(t5n,"guid");var H5=ct("ZodUUID",(t,e)=>{DJt.init(t,e),Bl.init(t,e)});function r5n(t){return Vnt(H5,t)}a(r5n,"uuid");function n5n(t){return Wnt(H5,t)}a(n5n,"uuidv4");function i5n(t){return znt(H5,t)}a(i5n,"uuidv6");function o5n(t){return Ynt(H5,t)}a(o5n,"uuidv7");var aPe=ct("ZodURL",(t,e)=>{MJt.init(t,e),Bl.init(t,e)});function kit(t){return rPe(aPe,t)}a(kit,"url");function s5n(t){return rPe(aPe,{protocol:PT.httpProtocol,hostname:PT.domain,...lr.normalizeParams(t)})}a(s5n,"httpUrl");var Pit=ct("ZodEmoji",(t,e)=>{OJt.init(t,e),Bl.init(t,e)});function a5n(t){return Knt(Pit,t)}a(a5n,"emoji");var Dit=ct("ZodNanoID",(t,e)=>{LJt.init(t,e),Bl.init(t,e)});function c5n(t){return Jnt(Dit,t)}a(c5n,"nanoid");var Nit=ct("ZodCUID",(t,e)=>{BJt.init(t,e),Bl.init(t,e)});function l5n(t){return Znt(Nit,t)}a(l5n,"cuid");var Mit=ct("ZodCUID2",(t,e)=>{FJt.init(t,e),Bl.init(t,e)});function u5n(t){return Xnt(Mit,t)}a(u5n,"cuid2");var Oit=ct("ZodULID",(t,e)=>{UJt.init(t,e),Bl.init(t,e)});function d5n(t){return eit(Oit,t)}a(d5n,"ulid");var Lit=ct("ZodXID",(t,e)=>{QJt.init(t,e),Bl.init(t,e)});function f5n(t){return tit(Lit,t)}a(f5n,"xid");var Bit=ct("ZodKSUID",(t,e)=>{qJt.init(t,e),Bl.init(t,e)});function p5n(t){return rit(Bit,t)}a(p5n,"ksuid");var Fit=ct("ZodIPv4",(t,e)=>{VJt.init(t,e),Bl.init(t,e)});function h5n(t){return nit(Fit,t)}a(h5n,"ipv4");var Ctr=ct("ZodMAC",(t,e)=>{zJt.init(t,e),Bl.init(t,e)});function m5n(t){return UXt(Ctr,t)}a(m5n,"mac");var Uit=ct("ZodIPv6",(t,e)=>{WJt.init(t,e),Bl.init(t,e)});function g5n(t){return iit(Uit,t)}a(g5n,"ipv6");var Qit=ct("ZodCIDRv4",(t,e)=>{YJt.init(t,e),Bl.init(t,e)});function A5n(t){return oit(Qit,t)}a(A5n,"cidrv4");var qit=ct("ZodCIDRv6",(t,e)=>{KJt.init(t,e),Bl.init(t,e)});function y5n(t){return sit(qit,t)}a(y5n,"cidrv6");var jit=ct("ZodBase64",(t,e)=>{ZJt.init(t,e),Bl.init(t,e)});function _5n(t){return ait(jit,t)}a(_5n,"base64");var Hit=ct("ZodBase64URL",(t,e)=>{XJt.init(t,e),Bl.init(t,e)});function E5n(t){return cit(Hit,t)}a(E5n,"base64url");var Git=ct("ZodE164",(t,e)=>{eZt.init(t,e),Bl.init(t,e)});function v5n(t){return lit(Git,t)}a(v5n,"e164");var $it=ct("ZodJWT",(t,e)=>{tZt.init(t,e),Bl.init(t,e)});function C5n(t){return uit($it,t)}a(C5n,"jwt");var Xfe=ct("ZodCustomStringFormat",(t,e)=>{rZt.init(t,e),Bl.init(t,e)});function b5n(t,e,r={}){return zfe(Xfe,t,e,r)}a(b5n,"stringFormat");function S5n(t){return zfe(Xfe,"hostname",PT.hostname,t)}a(S5n,"hostname");function T5n(t){return zfe(Xfe,"hex",PT.hex,t)}a(T5n,"hex");function I5n(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,o=PT[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return zfe(Xfe,n,o,e)}a(I5n,"hash");var epe=ct("ZodNumber",(t,e)=>{Fnt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Ser(t,n,o,s),sPe(t,"ZodNumber",{gt(n,o){return this.check(q5(n,o))},gte(n,o){return this.check(vv(n,o))},min(n,o){return this.check(vv(n,o))},lt(n,o){return this.check(Q5(n,o))},lte(n,o){return this.check(DT(n,o))},max(n,o){return this.check(DT(n,o))},int(n){return this.check(Iit(n))},safe(n){return this.check(Iit(n))},positive(n){return this.check(q5(0,n))},nonnegative(n){return this.check(vv(0,n))},negative(n){return this.check(Q5(0,n))},nonpositive(n){return this.check(DT(0,n))},multipleOf(n,o){return this.check(Hj(n,o))},step(n,o){return this.check(Hj(n,o))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function ya(t){return $Xt(epe,t)}a(ya,"number");var MZ=ct("ZodNumberFormat",(t,e)=>{nZt.init(t,e),epe.init(t,e)});function Iit(t){return WXt(MZ,t)}a(Iit,"int");function x5n(t){return zXt(MZ,t)}a(x5n,"float32");function w5n(t){return YXt(MZ,t)}a(w5n,"float64");function R5n(t){return KXt(MZ,t)}a(R5n,"int32");function k5n(t){return JXt(MZ,t)}a(k5n,"uint32");var tpe=ct("ZodBoolean",(t,e)=>{Wke.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ter(t,r,n,o)});function Zc(t){return ZXt(tpe,t)}a(Zc,"boolean");var rpe=ct("ZodBigInt",(t,e)=>{Unt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Ier(t,n,o,s),t.gte=(n,o)=>t.check(vv(n,o)),t.min=(n,o)=>t.check(vv(n,o)),t.gt=(n,o)=>t.check(q5(n,o)),t.gte=(n,o)=>t.check(vv(n,o)),t.min=(n,o)=>t.check(vv(n,o)),t.lt=(n,o)=>t.check(Q5(n,o)),t.lte=(n,o)=>t.check(DT(n,o)),t.max=(n,o)=>t.check(DT(n,o)),t.positive=n=>t.check(q5(BigInt(0),n)),t.negative=n=>t.check(Q5(BigInt(0),n)),t.nonpositive=n=>t.check(DT(BigInt(0),n)),t.nonnegative=n=>t.check(vv(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(Hj(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function P5n(t){return eer(rpe,t)}a(P5n,"bigint");var Vit=ct("ZodBigIntFormat",(t,e)=>{iZt.init(t,e),rpe.init(t,e)});function D5n(t){return rer(Vit,t)}a(D5n,"int64");function N5n(t){return ner(Vit,t)}a(N5n,"uint64");var btr=ct("ZodSymbol",(t,e)=>{oZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>xer(t,r,n,o)});function M5n(t){return ier(btr,t)}a(M5n,"symbol");var Str=ct("ZodUndefined",(t,e)=>{sZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Rer(t,r,n,o)});function O5n(t){return oer(Str,t)}a(O5n,"_undefined");var Ttr=ct("ZodNull",(t,e)=>{aZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>wer(t,r,n,o)});function cPe(t){return ser(Ttr,t)}a(cPe,"_null");var Itr=ct("ZodAny",(t,e)=>{cZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Der(t,r,n,o)});function Wit(){return aer(Itr)}a(Wit,"any");var xtr=ct("ZodUnknown",(t,e)=>{lZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ner(t,r,n,o)});function Fl(){return cer(xtr)}a(Fl,"unknown");var wtr=ct("ZodNever",(t,e)=>{uZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Per(t,r,n,o)});function zit(t){return ler(wtr,t)}a(zit,"never");var Rtr=ct("ZodVoid",(t,e)=>{dZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ker(t,r,n,o)});function L5n(t){return uer(Rtr,t)}a(L5n,"_void");var lPe=ct("ZodDate",(t,e)=>{fZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Mer(t,n,o,s),t.min=(n,o)=>t.check(vv(n,o)),t.max=(n,o)=>t.check(DT(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function B5n(t){return der(lPe,t)}a(B5n,"date");var ktr=ct("ZodArray",(t,e)=>{pZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ver(t,r,n,o),t.element=e.element,sPe(t,"ZodArray",{min(r,n){return this.check(i8(r,n))},nonempty(r){return this.check(i8(1,r))},max(r,n){return this.check(DZ(r,n))},length(r,n){return this.check(NZ(r,n))},unwrap(){return this.element}})});function Qr(t,e){return her(ktr,t,e)}a(Qr,"array");function F5n(t){let e=t._zod.def.shape;return XA(Object.keys(e))}a(F5n,"keyof");var uPe=ct("ZodObject",(t,e)=>{hZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Wer(t,r,n,o),lr.defineLazy(t,"shape",()=>e.shape),sPe(t,"ZodObject",{keyof(){return XA(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Fl()})},loose(){return this.clone({...this._zod.def,catchall:Fl()})},strict(){return this.clone({...this._zod.def,catchall:zit()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return lr.extend(this,r)},safeExtend(r){return lr.safeExtend(this,r)},merge(r){return lr.merge(this,r)},pick(r){return lr.pick(this,r)},omit(r){return lr.omit(this,r)},partial(...r){return lr.partial(Kit,this,r[0])},required(...r){return lr.required(Jit,this,r[0])}})});function Yr(t,e){let r={type:"object",shape:t??{},...lr.normalizeParams(e)};return new uPe(r)}a(Yr,"object");function U5n(t,e){return new uPe({type:"object",shape:t,catchall:zit(),...lr.normalizeParams(e)})}a(U5n,"strictObject");function gh(t,e){return new uPe({type:"object",shape:t,catchall:Fl(),...lr.normalizeParams(e)})}a(gh,"looseObject");var dPe=ct("ZodUnion",(t,e)=>{zke.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ait(t,r,n,o),t.options=e.options});function Ul(t,e){return new dPe({type:"union",options:t,...lr.normalizeParams(e)})}a(Ul,"union");var Ptr=ct("ZodXor",(t,e)=>{dPe.init(t,e),mZt.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ait(t,r,n,o),t.options=e.options});function Q5n(t,e){return new Ptr({type:"union",options:t,inclusive:!1,...lr.normalizeParams(e)})}a(Q5n,"xor");var Dtr=ct("ZodDiscriminatedUnion",(t,e)=>{dPe.init(t,e),gZt.init(t,e)});function fPe(t,e,r){return new Dtr({type:"union",options:e,discriminator:t,...lr.normalizeParams(r)})}a(fPe,"discriminatedUnion");var Ntr=ct("ZodIntersection",(t,e)=>{AZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>zer(t,r,n,o)});function npe(t,e){return new Ntr({type:"intersection",left:t,right:e})}a(npe,"intersection");var Mtr=ct("ZodTuple",(t,e)=>{Qnt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Yer(t,r,n,o),t.rest=r=>t.clone({...t._zod.def,rest:r})});function Otr(t,e,r){let n=e instanceof po,o=n?r:e,s=n?e:null;return new Mtr({type:"tuple",items:t,rest:s,...lr.normalizeParams(o)})}a(Otr,"tuple");var Kfe=ct("ZodRecord",(t,e)=>{yZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ker(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType});function ml(t,e,r){return!e||!e._zod?new Kfe({type:"record",keyType:Xe(),valueType:t,...lr.normalizeParams(e)}):new Kfe({type:"record",keyType:t,valueType:e,...lr.normalizeParams(r)})}a(ml,"record");function q5n(t,e,r){let n=_v(t);return n._zod.values=void 0,new Kfe({type:"record",keyType:n,valueType:e,...lr.normalizeParams(r)})}a(q5n,"partialRecord");function j5n(t,e,r){return new Kfe({type:"record",keyType:t,valueType:e,mode:"loose",...lr.normalizeParams(r)})}a(j5n,"looseRecord");var Ltr=ct("ZodMap",(t,e)=>{_Zt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ger(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(j5(...r)),t.nonempty=r=>t.check(j5(1,r)),t.max=(...r)=>t.check(Gj(...r)),t.size=(...r)=>t.check(PZ(...r))});function H5n(t,e,r){return new Ltr({type:"map",keyType:t,valueType:e,...lr.normalizeParams(r)})}a(H5n,"map");var Btr=ct("ZodSet",(t,e)=>{EZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>$er(t,r,n,o),t.min=(...r)=>t.check(j5(...r)),t.nonempty=r=>t.check(j5(1,r)),t.max=(...r)=>t.check(Gj(...r)),t.size=(...r)=>t.check(PZ(...r))});function G5n(t,e){return new Btr({type:"set",valueType:t,...lr.normalizeParams(e)})}a(G5n,"set");var Jfe=ct("ZodEnum",(t,e)=>{vZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Oer(t,n,o,s),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let c of n)if(r.has(c))s[c]=e.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Jfe({...e,checks:[],...lr.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let c of n)if(r.has(c))delete s[c];else throw new Error(`Key ${c} not found in enum`);return new Jfe({...e,checks:[],...lr.normalizeParams(o),entries:s})}});function XA(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Jfe({type:"enum",entries:r,...lr.normalizeParams(e)})}a(XA,"_enum");function $5n(t,e){return new Jfe({type:"enum",entries:t,...lr.normalizeParams(e)})}a($5n,"nativeEnum");var Ftr=ct("ZodLiteral",(t,e)=>{CZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ler(t,r,n,o),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function zn(t,e){return new Ftr({type:"literal",values:Array.isArray(t)?t:[t],...lr.normalizeParams(e)})}a(zn,"literal");var Utr=ct("ZodFile",(t,e)=>{bZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Uer(t,r,n,o),t.min=(r,n)=>t.check(j5(r,n)),t.max=(r,n)=>t.check(Gj(r,n)),t.mime=(r,n)=>t.check(jfe(Array.isArray(r)?r:[r],n))});function V5n(t){return mer(Utr,t)}a(V5n,"file");var Qtr=ct("ZodTransform",(t,e)=>{SZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Her(t,r,n,o),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Fj(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(lr.issue(s,r.value,e));else{let c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=t),r.issues.push(lr.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function Yit(t){return new Qtr({type:"transform",transform:t})}a(Yit,"transform");var Kit=ct("ZodOptional",(t,e)=>{qnt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>yit(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function ou(t){return new Kit({type:"optional",innerType:t})}a(ou,"optional");var qtr=ct("ZodExactOptional",(t,e)=>{TZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>yit(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function jtr(t){return new qtr({type:"optional",innerType:t})}a(jtr,"exactOptional");var Htr=ct("ZodNullable",(t,e)=>{IZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Jer(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function oPe(t){return new Htr({type:"nullable",innerType:t})}a(oPe,"nullable");function W5n(t){return ou(oPe(t))}a(W5n,"nullish");var Gtr=ct("ZodDefault",(t,e)=>{xZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Xer(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function $tr(t,e){return new Gtr({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():lr.shallowClone(e)}})}a($tr,"_default");var Vtr=ct("ZodPrefault",(t,e)=>{wZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>etr(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function Wtr(t,e){return new Vtr({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():lr.shallowClone(e)}})}a(Wtr,"prefault");var Jit=ct("ZodNonOptional",(t,e)=>{RZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Zer(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function ztr(t,e){return new Jit({type:"nonoptional",innerType:t,...lr.normalizeParams(e)})}a(ztr,"nonoptional");var Ytr=ct("ZodSuccess",(t,e)=>{kZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Qer(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function z5n(t){return new Ytr({type:"success",innerType:t})}a(z5n,"success");var Ktr=ct("ZodCatch",(t,e)=>{PZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ttr(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Jtr(t,e){return new Ktr({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(Jtr,"_catch");var Ztr=ct("ZodNaN",(t,e)=>{DZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ber(t,r,n,o)});function Y5n(t){return per(Ztr,t)}a(Y5n,"nan");var pPe=ct("ZodPipe",(t,e)=>{jnt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>rtr(t,r,n,o),t.in=e.in,t.out=e.out});function xit(t,e){return new pPe({type:"pipe",in:t,out:e})}a(xit,"pipe");var hPe=ct("ZodCodec",(t,e)=>{pPe.init(t,e),Yke.init(t,e)});function K5n(t,e,r){return new hPe({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}a(K5n,"codec");function J5n(t){let e=t._zod.def;return new hPe({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}a(J5n,"invertCodec");var Xtr=ct("ZodPreprocess",(t,e)=>{pPe.init(t,e),NZt.init(t,e)}),trr=ct("ZodReadonly",(t,e)=>{MZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ntr(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function rrr(t){return new trr({type:"readonly",innerType:t})}a(rrr,"readonly");var nrr=ct("ZodTemplateLiteral",(t,e)=>{OZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Fer(t,r,n,o)});function Z5n(t,e){return new nrr({type:"template_literal",parts:t,...lr.normalizeParams(e)})}a(Z5n,"templateLiteral");var irr=ct("ZodLazy",(t,e)=>{FZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>otr(t,r,n,o),t.unwrap=()=>t._zod.def.getter()});function orr(t){return new irr({type:"lazy",getter:t})}a(orr,"lazy");var srr=ct("ZodPromise",(t,e)=>{BZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>itr(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function X5n(t){return new srr({type:"promise",innerType:t})}a(X5n,"promise");var arr=ct("ZodFunction",(t,e)=>{LZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>jer(t,r,n,o)});function e4n(t){return new arr({type:"function",input:Array.isArray(t?.input)?Otr(t?.input):t?.input??Qr(Fl()),output:t?.output??Fl()})}a(e4n,"_function");var mPe=ct("ZodCustom",(t,e)=>{UZt.init(t,e),rs.init(t,e),t._zod.processJSONSchema=(r,n,o)=>qer(t,r,n,o)});function t4n(t){let e=new iu({check:"custom"});return e._zod.check=t,e}a(t4n,"check");function Zit(t,e){return ger(mPe,t??(()=>!0),e)}a(Zit,"custom");function crr(t,e={}){return Aer(mPe,t,e)}a(crr,"refine");function lrr(t,e){return yer(t,e)}a(lrr,"superRefine");var r4n=_er,n4n=Eer;function i4n(t,e={}){let r=new mPe({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...lr.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}a(i4n,"_instanceof");var o4n=a((...t)=>ver({Codec:hPe,Boolean:tpe,String:Zfe},...t),"stringbool");function s4n(t){let e=orr(()=>Ul([Xe(t),ya(),Zc(),cPe(),Qr(e),ml(Xe(),e)]));return e}a(s4n,"json");function gPe(t,e){return new Xtr({type:"pipe",in:Yit(t),out:e})}a(gPe,"preprocess");p();var drr={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Phs(t){Ep({customError:t})}a(Phs,"setErrorMap");function Dhs(){return Ep().customError}a(Dhs,"getErrorMap");var urr;urr||(urr={});p();var fn={...nPe,...vit,iso:zj},Nhs=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Mhs(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}a(Mhs,"detectVersion");function Ohs(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let o=r[1];if(!o||!e.defs[o])throw new Error(`Reference not found: ${t}`);return e.defs[o]}throw new Error(`Reference not found: ${t}`)}a(Ohs,"resolveRef");function a4n(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return fn.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let o=t.$ref;if(e.refs.has(o))return e.refs.get(o);if(e.processing.has(o))return fn.lazy(()=>{if(!e.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return e.refs.get(o)});e.processing.add(o);let s=Ohs(o,e),c=O_(s,e);return e.refs.set(o,c),e.processing.delete(o),c}if(t.enum!==void 0){let o=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&o.length===1&&o[0]===null)return fn.null();if(o.length===0)return fn.never();if(o.length===1)return fn.literal(o[0]);if(o.every(c=>typeof c=="string"))return fn.enum(o);let s=o.map(c=>fn.literal(c));return s.length<2?s[0]:fn.union([s[0],s[1],...s.slice(2)])}if(t.const!==void 0)return fn.literal(t.const);let r=t.type;if(Array.isArray(r)){let o=r.map(s=>{let c={...t,type:s};return a4n(c,e)});return o.length===0?fn.never():o.length===1?o[0]:fn.union(o)}if(!r)return fn.any();let n;switch(r){case"string":{let o=fn.string();if(t.format){let s=t.format;s==="email"?o=o.check(fn.email()):s==="uri"||s==="uri-reference"?o=o.check(fn.url()):s==="uuid"||s==="guid"?o=o.check(fn.uuid()):s==="date-time"?o=o.check(fn.iso.datetime()):s==="date"?o=o.check(fn.iso.date()):s==="time"?o=o.check(fn.iso.time()):s==="duration"?o=o.check(fn.iso.duration()):s==="ipv4"?o=o.check(fn.ipv4()):s==="ipv6"?o=o.check(fn.ipv6()):s==="mac"?o=o.check(fn.mac()):s==="cidr"?o=o.check(fn.cidrv4()):s==="cidr-v6"?o=o.check(fn.cidrv6()):s==="base64"?o=o.check(fn.base64()):s==="base64url"?o=o.check(fn.base64url()):s==="e164"?o=o.check(fn.e164()):s==="jwt"?o=o.check(fn.jwt()):s==="emoji"?o=o.check(fn.emoji()):s==="nanoid"?o=o.check(fn.nanoid()):s==="cuid"?o=o.check(fn.cuid()):s==="cuid2"?o=o.check(fn.cuid2()):s==="ulid"?o=o.check(fn.ulid()):s==="xid"?o=o.check(fn.xid()):s==="ksuid"&&(o=o.check(fn.ksuid()))}typeof t.minLength=="number"&&(o=o.min(t.minLength)),typeof t.maxLength=="number"&&(o=o.max(t.maxLength)),t.pattern&&(o=o.regex(new RegExp(t.pattern))),n=o;break}case"number":case"integer":{let o=r==="integer"?fn.number().int():fn.number();typeof t.minimum=="number"&&(o=o.min(t.minimum)),typeof t.maximum=="number"&&(o=o.max(t.maximum)),typeof t.exclusiveMinimum=="number"?o=o.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(o=o.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?o=o.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(o=o.lt(t.maximum)),typeof t.multipleOf=="number"&&(o=o.multipleOf(t.multipleOf)),n=o;break}case"boolean":{n=fn.boolean();break}case"null":{n=fn.null();break}case"object":{let o={},s=t.properties||{},c=new Set(t.required||[]);for(let[u,d]of Object.entries(s)){let f=O_(d,e);o[u]=c.has(u)?f:f.optional()}if(t.propertyNames){let u=O_(t.propertyNames,e),d=t.additionalProperties&&typeof t.additionalProperties=="object"?O_(t.additionalProperties,e):fn.any();if(Object.keys(o).length===0){n=fn.record(u,d);break}let f=fn.object(o).passthrough(),h=fn.looseRecord(u,d);n=fn.intersection(f,h);break}if(t.patternProperties){let u=t.patternProperties,d=Object.keys(u),f=[];for(let m of d){let g=O_(u[m],e),A=fn.string().regex(new RegExp(m));f.push(fn.looseRecord(A,g))}let h=[];if(Object.keys(o).length>0&&h.push(fn.object(o).passthrough()),h.push(...f),h.length===0)n=fn.object({}).passthrough();else if(h.length===1)n=h[0];else{let m=fn.intersection(h[0],h[1]);for(let g=2;gO_(u,e)),l=s&&typeof s=="object"&&!Array.isArray(s)?O_(s,e):void 0;l?n=fn.tuple(c).rest(l):n=fn.tuple(c),typeof t.minItems=="number"&&(n=n.check(fn.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(fn.maxLength(t.maxItems)))}else if(Array.isArray(s)){let c=s.map(u=>O_(u,e)),l=t.additionalItems&&typeof t.additionalItems=="object"?O_(t.additionalItems,e):void 0;l?n=fn.tuple(c).rest(l):n=fn.tuple(c),typeof t.minItems=="number"&&(n=n.check(fn.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(fn.maxLength(t.maxItems)))}else if(s!==void 0){let c=O_(s,e),l=fn.array(c);typeof t.minItems=="number"&&(l=l.min(t.minItems)),typeof t.maxItems=="number"&&(l=l.max(t.maxItems)),n=l}else n=fn.array(fn.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}a(a4n,"convertBaseSchema");function O_(t,e){if(typeof t=="boolean")return t?fn.any():fn.never();let r=a4n(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let l=t.anyOf.map(d=>O_(d,e)),u=fn.union(l);r=n?fn.intersection(r,u):u}if(t.oneOf&&Array.isArray(t.oneOf)){let l=t.oneOf.map(d=>O_(d,e)),u=fn.xor(l);r=n?fn.intersection(r,u):u}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:fn.any();else{let l=n?r:O_(t.allOf[0],e),u=n?0:1;for(let d=u;d0&&e.registry.add(r,o),t.description&&(r=r.describe(t.description)),r}a(O_,"convertSchema");function c4n(t,e){if(typeof t=="boolean")return t?fn.any():fn.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=Mhs(r,e?.defaultTarget),o=r.$defs||r.definitions||{},s={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??ZA};return O_(r,s)}a(c4n,"fromJSONSchema");var APe={};Ti(APe,{bigint:()=>Uhs,boolean:()=>Fhs,date:()=>Qhs,number:()=>Bhs,string:()=>Lhs});p();function Lhs(t){return FXt(Zfe,t)}a(Lhs,"string");function Bhs(t){return VXt(epe,t)}a(Bhs,"number");function Fhs(t){return XXt(tpe,t)}a(Fhs,"boolean");function Uhs(t){return ter(rpe,t)}a(Uhs,"bigint");function Qhs(t){return fer(lPe,t)}a(Qhs,"date");Ep(Kke());p();var di={authenticate:"authenticate",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_focus:"document/didFocus",document_did_open:"document/didOpen",document_did_save:"document/didSave",initialize:"initialize",logout:"logout",mcp_message:"mcp/message",nes_accept:"nes/accept",nes_close:"nes/close",nes_reject:"nes/reject",nes_start:"nes/start",nes_suggest:"nes/suggest",providers_disable:"providers/disable",providers_list:"providers/list",providers_set:"providers/set",session_cancel:"session/cancel",session_close:"session/close",session_delete:"session/delete",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},Lf={elicitation_complete:"elicitation/complete",elicitation_create:"elicitation/create",fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",mcp_connect:"mcp/connect",mcp_disconnect:"mcp/disconnect",mcp_message:"mcp/message",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},Xit=1;p();var jhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),terminal:P.boolean().optional().default(!1)}),Hhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),label:P.string().nullish(),name:P.string(),optional:P.boolean().optional().default(!1),secret:P.boolean().optional().default(!0)}),Ghs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),id:P.string(),name:P.string()}),$hs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),id:P.string(),link:P.string().nullish(),name:P.string(),vars:P.array(Hhs)}),Vhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),args:P.array(P.string()).optional(),description:P.string().nullish(),env:P.record(P.string(),P.string()).optional(),id:P.string(),name:P.string()}),Whs=P.union([$hs.and(P.object({type:P.literal("env_var")})),Vhs.and(P.object({type:P.literal("terminal")})),Ghs]),prr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),methodId:P.string()}),zhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Yhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),blob:P.string(),mimeType:P.string().nullish(),uri:P.string()}),Khs=P.object({default:P.boolean().nullish(),description:P.string().nullish(),title:P.string().nullish()}),Jhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Zhs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Xhs=P.object({amount:P.number(),currency:P.string()}),ems=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),terminalId:P.string()}),tms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),rms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),newText:P.string(),oldText:P.string().nullish(),path:P.string()}),hrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:P.string()}),nms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),ims=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),oms=P.union([P.string(),P.number(),P.number(),P.boolean(),P.array(P.string())]),sms=P.object({content:P.record(P.string(),oms).nullish()}),ams=P.intersection(P.union([sms.and(P.object({action:P.literal("accept")})),P.object({action:P.literal("decline")}),P.object({action:P.literal("cancel")})]),P.object({_meta:P.record(P.string(),P.unknown()).nullish()})),cms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),l4n=P.string(),mrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),elicitationId:l4n}),lms=P.literal("object"),ums=P.literal("string"),dms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),fms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),form:cms.nullish(),url:dms.nullish()}),u4n=P.object({const:P.string(),title:P.string()}),d4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),name:P.string(),value:P.string()}),pms=P.union([P.literal(-32700),P.literal(-32600),P.literal(-32601),P.literal(-32602),P.literal(-32603),P.literal(-32800),P.literal(-32e3),P.literal(-32002),P.literal(-32042),P.number().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),f4n=P.object({code:pms,data:P.unknown().optional(),message:P.string()}),p4n=P.unknown(),h4n=P.unknown(),m4n=P.unknown(),hms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),readTextFile:P.boolean().optional().default(!1),writeTextFile:P.boolean().optional().default(!1)}),g4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),name:P.string(),value:P.string()}),A4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),name:P.string(),title:P.string().nullish(),version:P.string()}),mms=P.object({default:P.number().nullish(),description:P.string().nullish(),maximum:P.number().nullish(),minimum:P.number().nullish(),title:P.string().nullish()}),gms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),grr=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Arr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),cursor:P.string().nullish(),cwd:P.string().nullish()}),yrr=P.union([P.literal("anthropic"),P.literal("openai"),P.literal("azure"),P.literal("vertex"),P.literal("bedrock"),P.string()]),Ams=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),yms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),logout:Ams.nullish()}),_rr=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),_ms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Ems=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),acp:P.boolean().optional().default(!1),http:P.boolean().optional().default(!1),sse:P.boolean().optional().default(!1)}),eot=P.string(),vms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:eot}),Cms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:eot}),y4n=P.string(),bms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),acpId:y4n}),Sms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:y4n,name:P.string()}),Tms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),headers:P.array(g4n),name:P.string(),url:P.string()}),Ims=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),headers:P.array(g4n),name:P.string(),url:P.string()}),xms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),args:P.array(P.string()),command:P.string(),env:P.array(d4n),name:P.string()}),tot=P.union([Tms.and(P.object({type:P.literal("http")})),Ims.and(P.object({type:P.literal("sse")})),Sms.and(P.object({type:P.literal("acp")})),xms]),_4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:eot,method:P.string(),params:P.record(P.string(),P.unknown()).nullish()}),E4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:eot,method:P.string(),params:P.record(P.string(),P.unknown()).nullish()}),v4n=P.unknown(),Err=P.string(),wms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),modelId:Err,name:P.string()}),Rms=P.union([P.literal("error"),P.literal("warning"),P.literal("information"),P.literal("hint")]),kms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Pms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Dms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Nms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Mms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Oms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),maxCount:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Lms=P.object({diff:P.string(),uri:P.string()}),Bms=P.object({endLine:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:P.string()}),Fms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Ums=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Qms=P.object({languageId:P.string(),text:P.string(),uri:P.string()}),qms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),maxCount:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),jms=P.union([P.literal("rejected"),P.literal("ignored"),P.literal("replaced"),P.literal("cancelled")]),Hms=P.object({excerpts:P.array(Bms),uri:P.string()}),Gms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),$ms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Vms=P.object({name:P.string(),owner:P.string(),remoteUrl:P.string()}),Wms=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),zms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),jump:Fms.nullish(),rename:$ms.nullish(),searchAndReplace:Wms.nullish()}),Yms=P.object({id:P.string(),isRegex:P.boolean().nullish(),replace:P.string(),search:P.string(),uri:P.string()}),Kms=P.union([P.literal("automatic"),P.literal("diagnostic"),P.literal("manual")]),Jms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),maxCount:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Zms=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),diagnostics:kms.nullish(),editHistory:Oms.nullish(),openFiles:Ums.nullish(),recentFiles:qms.nullish(),relatedSnippets:Gms.nullish(),userActions:Jms.nullish()}),vrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(tot)}),Xms=P.object({default:P.number().nullish(),description:P.string().nullish(),maximum:P.number().nullish(),minimum:P.number().nullish(),title:P.string().nullish()}),C4n=P.string(),egs=P.union([P.literal("allow_once"),P.literal("allow_always"),P.literal("reject_once"),P.literal("reject_always")]),tgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),kind:egs,name:P.string(),optionId:C4n}),rgs=P.union([P.literal("high"),P.literal("medium"),P.literal("low")]),ngs=P.union([P.literal("pending"),P.literal("in_progress"),P.literal("completed")]),igs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.string(),priority:rgs,status:ngs}),ogs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),entries:P.array(igs)}),Yj=P.object({character:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),sgs=P.object({id:P.string(),position:Yj,uri:P.string()}),ags=P.object({id:P.string(),newName:P.string(),position:Yj,uri:P.string()}),cgs=P.object({action:P.string(),position:Yj,timestampMs:P.number(),uri:P.string()}),b4n=P.union([P.literal("utf-16"),P.literal("utf-32"),P.literal("utf-8")]),lgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),auth:jhs.optional().default({terminal:!1}),elicitation:fms.nullish(),fs:hms.optional().default({readTextFile:!1,writeTextFile:!1}),nes:zms.nullish(),positionEncodings:P.array(b4n).optional(),terminal:P.boolean().optional().default(!1)}),ugs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),audio:P.boolean().optional().default(!1),embeddedContext:P.boolean().optional().default(!1),image:P.boolean().optional().default(!1)}),S4n=P.number().int().gte(0).lte(65535),Crr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),clientCapabilities:lgs.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:A4n.nullish(),protocolVersion:S4n}),dgs=P.object({apiType:yrr,baseUrl:P.string()}),fgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),current:dgs.nullish(),id:P.string(),required:P.boolean(),supported:P.array(yrr)}),pgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),providers:P.array(fgs)}),hgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),ipe=P.object({end:Yj,start:Yj}),mgs=P.object({message:P.string(),range:ipe,severity:Rms,uri:P.string()}),ggs=P.object({languageId:P.string(),lastFocusedMs:P.number().nullish(),uri:P.string(),visibleRange:ipe.nullish()}),Ags=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),diagnostics:P.array(mgs).nullish(),editHistory:P.array(Lms).nullish(),openFiles:P.array(ggs).nullish(),recentFiles:P.array(Qms).nullish(),relatedSnippets:P.array(Hms).nullish(),userActions:P.array(cgs).nullish()}),ygs=P.object({newText:P.string(),range:ipe}),_gs=P.object({cursorPosition:Yj.nullish(),edits:P.array(ygs),id:P.string(),uri:P.string()}),Egs=P.union([_gs.and(P.object({kind:P.literal("edit")})),sgs.and(P.object({kind:P.literal("jump")})),ags.and(P.object({kind:P.literal("rename")})),Yms.and(P.object({kind:P.literal("searchAndReplace")}))]),vgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.string()}),Cgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Kj=P.union([P.number(),P.string()]).nullable(),Icf=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),requestId:Kj}),T4n=P.object({requestId:Kj}),bgs=P.enum(["assistant","user"]),yPe=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),audience:P.array(bgs).nullish(),lastModified:P.string().nullish(),priority:P.number().nullish()}),Sgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:yPe.nullish(),data:P.string(),mimeType:P.string()}),Tgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:yPe.nullish(),data:P.string(),mimeType:P.string(),uri:P.string().nullish()}),Igs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:yPe.nullish(),description:P.string().nullish(),mimeType:P.string().nullish(),name:P.string(),size:P.number().nullish(),title:P.string().nullish(),uri:P.string()}),xgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),optionId:C4n}),wgs=P.union([P.object({outcome:P.literal("cancelled")}),xgs.and(P.object({outcome:P.literal("selected")}))]),Rgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),outcome:wgs}),kgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Pgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Dgs=P.object({currentValue:P.boolean()}),Ngs=P.string(),I4n=P.string(),Mgs=P.union([P.literal("mode"),P.literal("model"),P.literal("thought_level"),P.string()]),brr=P.string(),x4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),name:P.string(),value:brr}),Ogs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),group:Ngs,name:P.string(),options:P.array(x4n)}),Lgs=P.union([P.array(x4n),P.array(Ogs)]),Bgs=P.object({currentValue:brr,options:Lgs}),ope=P.intersection(P.union([Bgs.and(P.object({type:P.literal("select")})),Dgs.and(P.object({type:P.literal("boolean")}))]),P.object({_meta:P.record(P.string(),P.unknown()).nullish(),category:Mgs.nullish(),description:P.string().nullish(),id:I4n,name:P.string()})),Fgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(ope)}),Ugs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Qgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),gc=P.string(),Srr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:P.string(),sessionId:gc}),Trr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc}),Irr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc}),xrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc}),wrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),args:P.array(P.string()).optional(),command:P.string(),cwd:P.string().nullish(),env:P.array(d4n).optional(),outputByteLimit:P.number().nullish(),sessionId:gc}),Rrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc}),krr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,uri:P.string()}),Prr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),position:Yj,sessionId:gc,uri:P.string(),version:P.number(),visibleRange:ipe}),Drr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),languageId:P.string(),sessionId:gc,text:P.string(),uri:P.string(),version:P.number()}),Nrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,uri:P.string()}),Mrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(tot).optional(),sessionId:gc}),Orr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,terminalId:P.string()}),Lrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(tot),sessionId:gc}),Brr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),limit:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:P.string(),sessionId:gc}),Frr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:P.string(),reason:jms.nullish(),sessionId:gc}),Urr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,terminalId:P.string()}),Qrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(tot).optional(),sessionId:gc}),qgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),sessionId:gc,title:P.string().nullish(),updatedAt:P.string().nullish()}),jgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),nextCursor:P.string().nullish(),sessions:P.array(qgs)}),Hgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),title:P.string().nullish(),updatedAt:P.string().nullish()}),Ggs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),rot=P.string(),$gs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),currentModeId:rot}),Vgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),id:rot,name:P.string()}),not=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),availableModes:P.array(Vgs),currentModeId:rot}),iot=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),availableModels:P.array(wms),currentModelId:Err}),Wgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(ope).nullish(),models:iot.nullish(),modes:not.nullish(),sessionId:gc}),zgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(ope).nullish(),models:iot.nullish(),modes:not.nullish()}),Ygs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(ope).nullish(),models:iot.nullish(),modes:not.nullish(),sessionId:gc}),Kgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(ope).nullish(),models:iot.nullish(),modes:not.nullish()}),Jgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Zgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:kgs.nullish(),close:Pgs.nullish(),delete:Ugs.nullish(),fork:Qgs.nullish(),list:Ggs.nullish(),resume:Jgs.nullish()}),qrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),apiType:yrr,baseUrl:P.string(),headers:P.record(P.string(),P.string()).optional(),id:P.string()}),Xgs=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),jrr=P.intersection(P.union([P.object({type:P.literal("boolean"),value:P.boolean()}),P.object({value:brr})]),P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configId:I4n,sessionId:gc})),e0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(ope)}),Hrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),modeId:rot,sessionId:gc}),t0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Grr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),modelId:Err,sessionId:gc}),r0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),n0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc}),i0s=P.union([P.literal("end_turn"),P.literal("max_tokens"),P.literal("max_turn_requests"),P.literal("refusal"),P.literal("cancelled")]),o0s=P.union([P.literal("email"),P.literal("uri"),P.literal("date"),P.literal("date-time")]),s0s=P.object({default:P.string().nullish(),description:P.string().nullish(),enum:P.array(P.string()).nullish(),format:o0s.nullish(),maxLength:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:P.array(u4n).nullish(),pattern:P.string().nullish(),title:P.string().nullish()}),$rr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),context:Ags.nullish(),position:Yj,selection:ipe.nullish(),sessionId:gc,triggerKind:Kms,uri:P.string(),version:P.number()}),a0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),suggestions:P.array(Egs)}),c0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),terminalId:P.string()}),l0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),exitCode:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:P.string().nullish()}),Vrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,terminalId:P.string()}),u0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),exitStatus:l0s.nullish(),output:P.string(),truncated:P.boolean()}),d0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:yPe.nullish(),text:P.string()}),f0s=P.object({range:ipe.nullish(),text:P.string()}),Wrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),contentChanges:P.array(f0s),sessionId:gc,uri:P.string(),version:P.number()}),xcf=P.object({method:P.string(),params:P.union([Trr,Drr,Wrr,krr,Nrr,Prr,Srr,Frr,_4n,p4n]).nullish()}),p0s=P.union([P.literal("full"),P.literal("incremental")]),h0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),syncKind:p0s}),m0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),didChange:h0s.nullish(),didClose:Pms.nullish(),didFocus:Dms.nullish(),didOpen:Nms.nullish(),didSave:Mms.nullish()}),g0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),document:m0s.nullish()}),A0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),context:Zms.nullish(),events:g0s.nullish()}),y0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),auth:yms.optional().default({}),loadSession:P.boolean().optional().default(!1),mcpCapabilities:Ems.optional().default({acp:!1,http:!1,sse:!1}),nes:A0s.nullish(),positionEncoding:b4n.nullish(),promptCapabilities:ugs.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:hgs.nullish(),sessionCapabilities:Zgs.optional().default({})}),_0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),agentCapabilities:y0s.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:A4n.nullish(),authMethods:P.array(Whs).optional().default([]),protocolVersion:S4n}),E0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),mimeType:P.string().nullish(),text:P.string(),uri:P.string()}),v0s=P.union([E0s,Yhs]),C0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:yPe.nullish(),resource:v0s}),zrr=P.union([d0s.and(P.object({type:P.literal("text")})),Tgs.and(P.object({type:P.literal("image")})),Sgs.and(P.object({type:P.literal("audio")})),Igs.and(P.object({type:P.literal("resource_link")})),C0s.and(P.object({type:P.literal("resource")}))]),b0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:zrr}),frr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:zrr,messageId:P.string().nullish()}),Yrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),messageId:P.string().nullish(),prompt:P.array(zrr),sessionId:gc}),S0s=P.object({anyOf:P.array(u4n)}),w4n=P.union([b0s.and(P.object({type:P.literal("content")})),rms.and(P.object({type:P.literal("diff")})),c0s.and(P.object({type:P.literal("terminal")}))]),Krr=P.string(),R4n=P.object({sessionId:gc,toolCallId:Krr.nullish()}),T0s=P.intersection(P.union([R4n,T4n]),P.object({elicitationId:l4n,url:P.string().url()})),k4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),line:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:P.string()}),P4n=P.union([P.literal("pending"),P.literal("in_progress"),P.literal("completed"),P.literal("failed")]),D4n=P.union([P.literal("read"),P.literal("edit"),P.literal("delete"),P.literal("move"),P.literal("search"),P.literal("execute"),P.literal("think"),P.literal("fetch"),P.literal("switch_mode"),P.literal("other")]),I0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.array(w4n).optional(),kind:D4n.optional(),locations:P.array(k4n).optional(),rawInput:P.unknown().optional(),rawOutput:P.unknown().optional(),status:P4n.optional(),title:P.string(),toolCallId:Krr}),N4n=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.array(w4n).nullish(),kind:D4n.nullish(),locations:P.array(k4n).nullish(),rawInput:P.unknown().optional(),rawOutput:P.unknown().optional(),status:P4n.nullish(),title:P.string().nullish(),toolCallId:Krr}),Jrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),options:P.array(tgs),sessionId:gc,toolCall:N4n}),x0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),hint:P.string()}),w0s=x0s,R0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string(),input:w0s.nullish(),name:P.string()}),k0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),availableCommands:P.array(R0s)}),P0s=P.object({enum:P.array(P.string()),type:ums}),D0s=P.union([P0s,S0s]),N0s=P.object({default:P.array(P.string()).nullish(),description:P.string().nullish(),items:D0s,maxItems:P.number().nullish(),minItems:P.number().nullish(),title:P.string().nullish()}),M0s=P.union([s0s.and(P.object({type:P.literal("string")})),Xms.and(P.object({type:P.literal("number")})),mms.and(P.object({type:P.literal("integer")})),Khs.and(P.object({type:P.literal("boolean")})),N0s.and(P.object({type:P.literal("array")}))]),O0s=P.object({description:P.string().nullish(),properties:P.record(P.string(),M0s).optional().default({}),required:P.array(P.string()).nullish(),title:P.string().nullish(),type:lms.optional().default("object")}),L0s=P.intersection(P.union([R4n,T4n]),P.object({requestedSchema:O0s})),Zrr=P.intersection(P.union([L0s.and(P.object({mode:P.literal("form")})),T0s.and(P.object({mode:P.literal("url")}))]),P.object({_meta:P.record(P.string(),P.unknown()).nullish(),message:P.string()})),B0s=P.object({cachedReadTokens:P.number().nullish(),cachedWriteTokens:P.number().nullish(),inputTokens:P.number(),outputTokens:P.number(),thoughtTokens:P.number().nullish(),totalTokens:P.number()}),F0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),stopReason:i0s,usage:B0s.nullish(),userMessageId:P.string().nullish()}),wcf=P.union([P.object({id:Kj,result:P.union([_0s,zhs,pgs,Xgs,nms,_ms,Ygs,zgs,jgs,tms,Wgs,Kgs,Zhs,t0s,e0s,F0s,r0s,n0s,a0s,Jhs,m4n,v4n])}),P.object({error:f4n,id:Kj})]),U0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),cost:Xhs.nullish(),size:P.number(),used:P.number()}),Q0s=P.union([frr.and(P.object({sessionUpdate:P.literal("user_message_chunk")})),frr.and(P.object({sessionUpdate:P.literal("agent_message_chunk")})),frr.and(P.object({sessionUpdate:P.literal("agent_thought_chunk")})),I0s.and(P.object({sessionUpdate:P.literal("tool_call")})),N4n.and(P.object({sessionUpdate:P.literal("tool_call_update")})),ogs.and(P.object({sessionUpdate:P.literal("plan")})),k0s.and(P.object({sessionUpdate:P.literal("available_commands_update")})),$gs.and(P.object({sessionUpdate:P.literal("current_mode_update")})),Fgs.and(P.object({sessionUpdate:P.literal("config_option_update")})),Hgs.and(P.object({sessionUpdate:P.literal("session_info_update")})),U0s.and(P.object({sessionUpdate:P.literal("usage_update")}))]),Xrr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,update:Q0s}),Rcf=P.object({method:P.string(),params:P.union([Xrr,mrr,_4n,p4n]).nullish()}),enr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:gc,terminalId:P.string()}),q0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),exitCode:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:P.string().nullish()}),j0s=P.object({name:P.string(),uri:P.string()}),tnr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),repository:Vms.nullish(),workspaceFolders:P.array(j0s).nullish(),workspaceUri:P.string().nullish()}),kcf=P.object({id:Kj,method:P.string(),params:P.union([Crr,prr,grr,qrr,hrr,_rr,vrr,Lrr,Arr,Rrr,Mrr,Qrr,xrr,Hrr,jrr,Yrr,Grr,tnr,$rr,Irr,E4n,h4n]).nullish()}),rnr=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.string(),path:P.string(),sessionId:gc}),Pcf=P.object({id:Kj,method:P.string(),params:P.union([rnr,Brr,Jrr,wrr,Vrr,Urr,enr,Orr,Zrr,bms,E4n,Cms,h4n]).nullish()}),H0s=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Dcf=P.union([P.object({id:Kj,result:P.union([H0s,vgs,Rgs,ems,u0s,Cgs,q0s,gms,ams,vms,ims,m4n,v4n])}),P.object({error:f4n,id:Kj})]);p();function _Pe(t,e){let r=new TextEncoder,n=new TextDecoder,o=new ReadableStream({async start(c){let l="",u=e.getReader();try{for(;;){let{value:f,done:h}=await u.read();if(h){l+=n.decode();break}if(!f)continue;l+=n.decode(f,{stream:!0});let m=l.split(` `);l=m.pop()||"";for(let g of m){let A=g.trim();if(A)try{let y=JSON.parse(A);c.enqueue(y)}catch(y){console.error("Failed to parse JSON message:",A,y)}}}let d=l.trim();if(d)try{let f=JSON.parse(d);c.enqueue(f)}catch(f){console.error("Failed to parse JSON message:",d,f)}}catch(d){c.error(d);return}finally{u.releaseLock()}c.close()}}),s=new WritableStream({async write(c){let l=JSON.stringify(c)+` -`,u=t.getWriter();try{await u.write(r.encode(l))}finally{u.releaseLock()}}});return{readable:o,writable:s}}a(_Pe,"ndJsonStream");function $w(t){return t??{}}a($w,"emptyObjectResponse");function N4n(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(N4n,"rejectedPromise");var EPe=class{static{a(this,"AgentSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case di.initialize:{let u=vrr.parse(l);return n.initialize(u)}case di.session_new:{let u=Err.parse(l);return n.newSession(u)}case di.session_load:{if(!n.loadSession)throw ho.methodNotFound(c);let u=Orr.parse(l);return n.loadSession(u)}case di.session_list:{if(!n.listSessions)throw ho.methodNotFound(c);let u=grr.parse(l);return n.listSessions(u)}case di.session_delete:{if(!n.unstable_deleteSession)throw ho.methodNotFound(c);let u=wrr.parse(l);return await n.unstable_deleteSession(u)??{}}case di.session_fork:{if(!n.unstable_forkSession)throw ho.methodNotFound(c);let u=Nrr.parse(l);return n.unstable_forkSession(u)}case di.session_resume:{if(!n.resumeSession)throw ho.methodNotFound(c);let u=Urr.parse(l);return n.resumeSession(u)}case di.session_close:{if(!n.closeSession)throw ho.methodNotFound(c);let u=Irr.parse(l);return await n.closeSession(u)??{}}case di.session_set_mode:{if(!n.setSessionMode)throw ho.methodNotFound(c);let u=jrr.parse(l);return await n.setSessionMode(u)??{}}case di.authenticate:{let u=frr.parse(l);return await n.authenticate(u)??{}}case di.providers_list:{if(!n.unstable_listProviders)throw ho.methodNotFound(c);let u=mrr.parse(l);return n.unstable_listProviders(u)}case di.providers_set:{if(!n.unstable_setProvider)throw ho.methodNotFound(c);let u=Qrr.parse(l);return await n.unstable_setProvider(u)??{}}case di.providers_disable:{if(!n.unstable_disableProvider)throw ho.methodNotFound(c);let u=prr.parse(l);return await n.unstable_disableProvider(u)??{}}case di.logout:{if(!n.unstable_logout)throw ho.methodNotFound(c);let u=yrr.parse(l);return await n.unstable_logout(u)??{}}case di.session_prompt:{let u=zrr.parse(l);return n.prompt(u)}case di.session_set_model:{if(!n.unstable_setSessionModel)throw ho.methodNotFound(c);let u=Hrr.parse(l);return await n.unstable_setSessionModel(u)??{}}case di.session_set_config_option:{if(!n.setSessionConfigOption)throw ho.methodNotFound(c);let u=qrr.parse(l);return n.setSessionConfigOption(u)}case di.nes_start:{if(!n.unstable_startNes)throw ho.methodNotFound(c);let u=enr.parse(l);return n.unstable_startNes(u)}case di.nes_suggest:{if(!n.unstable_suggestNes)throw ho.methodNotFound(c);let u=Grr.parse(l);return n.unstable_suggestNes(u)}case di.nes_close:{if(!n.unstable_closeNes)throw ho.methodNotFound(c);let u=Trr.parse(l);return await n.unstable_closeNes(u)??{}}default:if(n.extMethod)return n.extMethod(c,l);throw ho.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case di.session_cancel:{let u=Srr.parse(l);return n.cancel(u)}case di.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=Prr.parse(l);return n.unstable_didOpenDocument(u)}case di.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=Vrr.parse(l);return n.unstable_didChangeDocument(u)}case di.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=Rrr.parse(l);return n.unstable_didCloseDocument(u)}case di.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=Drr.parse(l);return n.unstable_didSaveDocument(u)}case di.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=krr.parse(l);return n.unstable_didFocusDocument(u)}case di.nes_accept:{if(!n.unstable_acceptNes)return;let u=brr.parse(l);return n.unstable_acceptNes(u)}case di.nes_reject:{if(!n.unstable_rejectNes)return;let u=Brr.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw ho.methodNotFound(c)}},"notificationHandler");this.connection=new sot(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(Lf.session_update,e)}requestPermission(e){return this.connection.sendRequest(Lf.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(Lf.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(Lf.fs_write_text_file,e,$w)}createTerminal(e){return this.connection.sendRequest(Lf.terminal_create,e,r=>new rnr(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(Lf.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(Lf.elicitation_complete,e)}extMethod(e,r){return this.connection.sendRequest(e,r)}extNotification(e,r){return this.connection.sendNotification(e,r)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},rnr=class{static{a(this,"TerminalHandle")}id;sessionId;connection;constructor(e,r,n){this.id=e,this.sessionId=r,this.connection=n}currentOutput(){return this.connection.sendRequest(Lf.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(Lf.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(Lf.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},$w)}release(){return this.connection.sendRequest(Lf.terminal_release,{sessionId:this.sessionId,terminalId:this.id},$w)}async[Symbol.asyncDispose](){await this.release()}},oot=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case Lf.fs_write_text_file:{let u=tnr.parse(l);return await n.writeTextFile?.(u)??{}}case Lf.fs_read_text_file:{let u=Lrr.parse(l);return n.readTextFile?.(u)}case Lf.session_request_permission:{let u=Krr.parse(l);return n.requestPermission(u)}case Lf.terminal_create:{let u=xrr.parse(l);return n.createTerminal?.(u)}case Lf.terminal_output:{let u=$rr.parse(l);return n.terminalOutput?.(u)}case Lf.terminal_release:{let u=Frr.parse(l);return await n.releaseTerminal?.(u)??{}}case Lf.terminal_wait_for_exit:{let u=Xrr.parse(l);return n.waitForTerminalExit?.(u)}case Lf.terminal_kill:{let u=Mrr.parse(l);return await n.killTerminal?.(u)??{}}case Lf.elicitation_create:{if(!n.unstable_createElicitation)throw ho.methodNotFound(c);let u=Jrr.parse(l);return n.unstable_createElicitation(u)}default:if(n.extMethod)return n.extMethod(c,l);throw ho.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case Lf.session_update:{let u=Zrr.parse(l);return n.sessionUpdate(u)}case Lf.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=hrr.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw ho.methodNotFound(c)}},"notificationHandler");this.connection=new sot(o,s,r)}initialize(e){return this.connection.sendRequest(di.initialize,e)}newSession(e){return this.connection.sendRequest(di.session_new,e)}loadSession(e){return this.connection.sendRequest(di.session_load,e,$w)}unstable_forkSession(e){return this.connection.sendRequest(di.session_fork,e)}listSessions(e){return this.connection.sendRequest(di.session_list,e)}unstable_deleteSession(e){return this.connection.sendRequest(di.session_delete,e,$w)}resumeSession(e){return this.connection.sendRequest(di.session_resume,e)}closeSession(e){return this.connection.sendRequest(di.session_close,e)}setSessionMode(e){return this.connection.sendRequest(di.session_set_mode,e,$w)}unstable_setSessionModel(e){return this.connection.sendRequest(di.session_set_model,e,$w)}setSessionConfigOption(e){return this.connection.sendRequest(di.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(di.authenticate,e,$w)}unstable_listProviders(e){return this.connection.sendRequest(di.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(di.providers_set,e,$w)}unstable_disableProvider(e){return this.connection.sendRequest(di.providers_disable,e,$w)}unstable_logout(e){return this.connection.sendRequest(di.logout,e,$w)}prompt(e){return this.connection.sendRequest(di.session_prompt,e)}cancel(e){return this.connection.sendNotification(di.session_cancel,e)}unstable_startNes(e){return this.connection.sendRequest(di.nes_start,e)}unstable_suggestNes(e){return this.connection.sendRequest(di.nes_suggest,e)}unstable_closeNes(e){return this.connection.sendRequest(di.nes_close,e,$w)}unstable_didOpenDocument(e){return this.connection.sendNotification(di.document_did_open,e)}unstable_didChangeDocument(e){return this.connection.sendNotification(di.document_did_change,e)}unstable_didCloseDocument(e){return this.connection.sendNotification(di.document_did_close,e)}unstable_didSaveDocument(e){return this.connection.sendNotification(di.document_did_save,e)}unstable_didFocusDocument(e){return this.connection.sendNotification(di.document_did_focus,e)}unstable_acceptNes(e){return this.connection.sendNotification(di.nes_accept,e)}unstable_rejectNes(e){return this.connection.sendNotification(di.nes_reject,e)}extMethod(e,r){return this.connection.sendRequest(e,r)}extNotification(e,r){return this.connection.sendNotification(e,r)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},sot=class{static{a(this,"Connection")}pendingResponses=new Map;nextRequestId=0;requestHandler;notificationHandler;stream;writeQueue=Promise.resolve();abortController=new AbortController;closedPromise;constructor(e,r,n){this.requestHandler=e,this.notificationHandler=r,this.stream=n,this.closedPromise=new Promise(o=>{this.abortController.signal.addEventListener("abort",()=>o())}),this.receive()}get signal(){return this.abortController.signal}get closed(){return this.closedPromise}async receive(){let e;try{let r=this.stream.readable.getReader();try{for(;!this.abortController.signal.aborted;){let{value:n,done:o}=await r.read();if(o)break;if(n)try{this.processMessage(n)}catch(s){console.error("Unexpected error during message processing:",n,s),"id"in n&&n.id!==void 0&&this.sendMessage({jsonrpc:"2.0",id:n.id,error:{code:-32700,message:"Parse error"}})}}}finally{r.releaseLock()}}catch(r){e=r}finally{this.close(e)}}close(e){if(this.abortController.signal.aborted)return;let r=e??new Error("ACP connection closed");for(let n of this.pendingResponses.values())n.reject(r);this.pendingResponses.clear(),this.abortController.abort(r)}async processMessage(e){if("method"in e&&"id"in e){let r=await this.tryCallRequestHandler(e.method,e.params);"error"in r&&console.error("Error handling request",e,r.error),await this.sendMessage({jsonrpc:"2.0",id:e.id,...r})}else if("method"in e){let r=await this.tryCallNotificationHandler(e.method,e.params);"error"in r&&console.error("Error handling notification",e,r.error)}else"id"in e?this.handleResponse(e):console.error("Invalid message",{message:e})}async tryCallRequestHandler(e,r){try{return{result:await this.requestHandler(e,r)??null}}catch(n){if(n instanceof ho)return n.toResult();if(n instanceof P.ZodError)return ho.invalidParams(n.format()).toResult();let o;(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")&&(o=n.message);try{return ho.internalError(o?JSON.parse(o):{}).toResult()}catch{return ho.internalError({details:o}).toResult()}}}async tryCallNotificationHandler(e,r){try{return await this.notificationHandler(e,r),{result:null}}catch(n){if(n instanceof ho)return n.toResult();if(n instanceof P.ZodError)return ho.invalidParams(n.format()).toResult();let o;(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")&&(o=n.message);try{return ho.internalError(o?JSON.parse(o):{}).toResult()}catch{return ho.internalError({details:o}).toResult()}}}handleResponse(e){let r=this.pendingResponses.get(e.id);if(r){if("result"in e)r.resolve(e.result);else if("error"in e){let{code:n,message:o,data:s}=e.error;r.reject(new ho(n,o,s))}this.pendingResponses.delete(e.id)}else console.error("Got response to unknown request",e.id)}sendRequest(e,r,n){if(this.abortController.signal.aborted)return N4n(this.closedReason());let o=this.nextRequestId++,s=new Promise((c,l)=>{this.pendingResponses.set(o,{resolve:a(u=>{try{c(n?n(u):u)}catch(d){l(d)}},"resolve"),reject:l})});return s.catch(()=>{}),this.sendMessage({jsonrpc:"2.0",id:o,method:e,params:r}),s}sendNotification(e,r){return this.abortController.signal.aborted?N4n(this.closedReason()):this.sendMessage({jsonrpc:"2.0",method:e,params:r})}closedReason(){return this.abortController.signal.reason??new Error("ACP connection closed")}async sendMessage(e){return this.writeQueue=this.writeQueue.then(async()=>{let r=this.stream.writable.getWriter();try{await r.write(e)}finally{r.releaseLock()}}).catch(r=>{this.close(r)}),this.writeQueue}},ho=class t extends Error{static{a(this,"RequestError")}code;data;constructor(e,r,n){super(r),this.code=e,this.name="RequestError",this.data=n}static parseError(e,r){return new t(-32700,`Parse error${r?`: ${r}`:""}`,e)}static invalidRequest(e,r){return new t(-32600,`Invalid request${r?`: ${r}`:""}`,e)}static methodNotFound(e){return new t(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,r){return new t(-32602,`Invalid params${r?`: ${r}`:""}`,e)}static internalError(e,r){return new t(-32603,`Internal error${r?`: ${r}`:""}`,e)}static authRequired(e,r){return new t(-32e3,`Authentication required${r?`: ${r}`:""}`,e)}static resourceNotFound(e){return new t(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};var Fbe=require("node:stream");p();Fo();p();var Ib=class extends PK{constructor(r){super(new oue,new Map);this.envSettings=new Map;this.env={...r};let n;this.#e=new Promise(s=>{n=s}),this.markReady=n,["DebugOverrideEngine","DebugOverrideProxyUrl","DebugOverrideCapiUrl","DebugUseEditorFetcher","UseSubsetMatching","UseChatLibCompletions","AppendPromptTokenCache","PromptPersistBasePath","AnthropicMessagesEndpoint","EnableMapCodeFallback","SearchAgent","UseHelixFetcher","PerfEnabled","AuthTokenEncryption","EnableWorkspaceIndex"].forEach(s=>{for(let c of["AGENT_DEBUG_","GITHUB_COPILOT_","GH_COPILOT_"]){let l=`${c}${H0s(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(ze[s],this.env[l])}})}static{a(this,"AgentConfigProvider")}#e;async requireReady(){await this.#e}getOptionalOverride(r){return super.getOptionalOverride(r)??this.envSettings.get(r)}};function H0s(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a(H0s,"camelCaseToSnakeCaseAllCaps");var G0s="unknown-editor",M4n="unknown-editor-plugin",Jj=class extends Ir{static{a(this,"AgentEditorInfo")}setEditorAndPluginInfo(e,r,n=[]){this._editorInfo=r,this._editorPluginInfo=e,this._relatedPluginInfo=n}setCopilotIntegrationId(e){this._copilotIntegrationId=e}getEditorInfo(){return this._editorInfo?this._editorInfo:{name:G0s,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:M4n,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}isEditorPluginInfoKnown(){return this._editorPluginInfo!==void 0&&this._editorPluginInfo.name!==M4n}};p();p();var aot=new pe("agenticTurnProcessor"),CPe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Bc),this.chatFetcher=this.chatFetcher??new mc(e.ctx),this.turnSuggestions=new aj(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new Tg(e.ctx),this.hookTrigger=new Jde(e.ctx,e.conversation,e.turn.workspaceFolders||[])}static{a(this,"AgenticTurnProcessor")}async process(e,r,n,o,s){try{await this.processWithModelAndToolCall(e,r,this.turnContext,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c);let l=c instanceof Error?c.message:String(c);this.turn.status="error",this.updateTurnResponseWithError(l),c instanceof Error?await this.fireErrorOccurredHook(c):await this.fireErrorOccurredHook(new Error(String(c))),await this.endProgress({error:{message:l,code:Lq.Unknown,responseIsIncomplete:!0}})}}async processWithModelAndToolCall(e,r,n,o,s,c){if(r.isCancellationRequested)return;await this.conversationProgress.begin(this.conversation,this.turn,e),await this.fireUserPromptSubmittedHook(this.turn.request.message),await this.recordAssistantTurnStart();let l=await fl(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!Rbn(this.turn.chatMode)){let h=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});ft(this.turnContext.ctx,"customAgent.turn",h),Ix(this.turnContext.ctx,"customAgent.turn",h)}r.onCancellationRequested(async()=>{aot.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let u=P2().find(h=>h.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let f=(await Iw(this.turnContext.ctx)).find(h=>h.slug===this.turn.agent?.agentSlug);await this.collectContext(n,r,l,u,f);try{let h=c?.id,m=c?.providerName,g=m&&h?await zO(this.turnContext.ctx,m,h):await Ro.getModelConfigurationById(this.turnContext.ctx,h,this.conversation.id.toString(),jq(this.conversation.turns));Ro.applyModelConfigurationOverrides(this.turnContext.ctx,g,c),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(Cb).checkAndCompress(this.conversation,g,"pre-turn",r,String(this.turn.id))}catch(_){ot.exception(this.turnContext.ctx,_,"Pre-turn automatic compression check failed")}await new Afe(this.turnContext,this.chatFetcher,g,l).run(r);let y={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let _=await this.fetchSuggestedTitle(r,l.extendedBy({messageSource:"chat.user"},{}));typeof _=="string"&&_!==""&&(y.suggestedTitle=_)}await this.endProgress(y)}catch(h){if(h instanceof Rj)aot.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,h),this.turn.status="cancelled",await this.cancelProgress();else if(h instanceof zc)aot.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,h),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(h instanceof zF)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:{message:h.message,code:Lq.ToolRoundExceedError,responseIsIncomplete:!0}});else if(h instanceof zA)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:h.conversationError});else throw aot.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,h),h}}async collectContext(e,r,n,o,s){let c=!!s&&typeof s.additionalSkills=="function",l=!!o&&typeof o.requiredSkills=="function";if(!c&&!l)return;let d=await new sde(this.turnContext.ctx,this.chatFetcher).collectContext(e,r,n,this.strategy.uiKind,o,s);this.turn.skills=d.skillIds.map(f=>({skillId:f}))}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return ot.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=Hq(this.turn.response?.message,{role:"assistant",content:e}):this.turn.response={message:e,type:"meta"}}async endProgress(e){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.recordAssistantTurnEnd(),await this.turnContext.agentToolCalls.finishAll("cancelled"),await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}async handleTemplateResponse(e,r,n){if(!e.response)return;let o=await e.response(this.turnContext,r,n);this.turn.response={type:"meta",message:o.message},this.turn.status=o.error?.responseIsFiltered?"filtered":o.error?.responseIsIncomplete?"error":"success",o.error?.responseIsFiltered||o.error?.responseIsIncomplete?(await this.conversationProgress.report(this.conversation,this.turn,{reply:"Sure, I can definitely do that!",annotations:o.annotations,notifications:o.notifications,references:o.references}),await this.turnContext.steps.finishAll(),await this.endProgress({error:{message:o.message,code:o.error?.code||0,responseIsIncomplete:o.error?.responseIsIncomplete,responseIsFiltered:o.error?.responseIsFiltered}})):(await this.conversationProgress.report(this.conversation,this.turn,{reply:o.message,annotations:o.annotations,notifications:o.notifications,references:o.references,confirmationRequest:o.confirmationRequest}),await this.endProgress())}async recordAssistantTurnStart(){if(this.transcriptPersistence.isEnabled())try{let e=ltt(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn start transcript: ${e instanceof Error?e.message:String(e)}`)}}async recordAssistantTurnEnd(){if(this.transcriptPersistence.isEnabled())try{let e=this.turn.status==="error"?"error":this.turn.status==="cancelled"?"cancelled":"success",r=zde(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}async fireUserPromptSubmittedHook(e){let r=e??this.turn.request.message;await this.hookTrigger.fireUserPromptSubmittedHook(r,{turn:this.turn,conversationProgress:this.conversationProgress})}async fireErrorOccurredHook(e){await this.hookTrigger.fireErrorOccurredHook(e,{turn:this.turn,conversationProgress:this.conversationProgress})}};p();var nnr="collect-context",inr="generate-response",cot=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Bc),this.chatFetcher=this.chatFetcher??new mc(e.ctx),this.postProcessor=new mde(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new Tg(e.ctx)}static{a(this,"ModelTurnProcessor")}async process(e,r,n,o,s){try{await this.processWithModel(e,r,this.turnContext,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c);let l=c instanceof Error?c.message:String(c);this.turn.status="error",this.turn.response={message:l,type:"meta"},await this.endProgress({error:{message:l,code:Lq.Unknown,responseIsIncomplete:!0}})}}async processWithModel(e,r,n,o,s,c){await this.conversationProgress.begin(this.conversation,this.turn,e),await this.recordAssistantTurnStart();let l=await fl(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(l=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),...this.turn.userRequestedModel&&{modelId:this.turn.userRequestedModel}}),r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let u=P2().find(A=>A.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let d=(await Iw(this.turnContext.ctx)).find(A=>A.slug===this.turn.agent?.agentSlug);if(d){let A=await this.checkAgentPreconditions(d);if(A){await this.endProgress(A);return}}await n.steps.start(nnr,"Collecting context"),await this.collectContext(n,r,l,this.strategy.uiKind,u,d);let f=c?.id,h=c?.providerName,m;h?m="customized":f?m=(await Ro.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),jq(this.conversation.turns))).uiName:m=void 0;let g=await this.strategy.buildConversationPrompt(n,s?.detectedLanguageId??"",void 0,m);if(!g)await n.steps.error(nnr,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(nnr),await n.steps.start(inr,"Generating response");let A=this.augmentTelemetry(g,l,u,o,s);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let y=await this.fetchConversationResponse(g.messages,r,l.extendedBy({messageSource:"chat.user"},{promptTokenLen:g.tokens}),A,s,c),_=await this.strategy.processResponse(this.turn);this.turn.status==="cancelled"&&this.turn.response?.type==="user"?await this.cancelProgress():(await this.finishGenerateResponseStep(y,n),await this.endProgress({error:y.error,followUp:y.followup,suggestedTitle:y.suggestedTitle,skillResolutions:g.skillResolutions,updatedDocuments:_}))}}async checkAgentPreconditions(e){try{let r=e.checkPreconditions?await e.checkPreconditions(this.turnContext.ctx,this.turn):void 0;if(r&&r.type==="authorizationRequired")return{unauthorized:{...r,agentName:e.name,agentSlug:e.slug}}}catch(r){ot.error(this.turnContext.ctx,`Error checking preconditions for agent ${e.slug}`,r);let n=r instanceof Error?r.message:String(r);return this.turn.status="error",this.turn.response={message:n,type:"meta"},{error:{message:n,responseIsIncomplete:!0}}}}async endTurnWithResponse(e,r){this.turn.response={type:"meta",message:e},this.turn.status=r,await this.conversationProgress.report(this.conversation,this.turn,{reply:e}),await this.endProgress()}async handleTemplateResponse(e,r,n){if(!e.response)return;let o=await e.response(this.turnContext,r,n);this.turn.response={type:"meta",message:o.message},this.turn.status=o.error?.responseIsFiltered?"filtered":o.error?.responseIsIncomplete?"error":"success",o.error?.responseIsFiltered||o.error?.responseIsIncomplete?(await this.conversationProgress.report(this.conversation,this.turn,{reply:"Sure, I can definitely do that!",annotations:o.annotations,notifications:o.notifications,references:o.references}),await this.turnContext.steps.finishAll(),await this.endProgress({error:{message:o.message,code:o.error?.code||0,responseIsIncomplete:o.error?.responseIsIncomplete,responseIsFiltered:o.error?.responseIsFiltered}})):(await this.conversationProgress.report(this.conversation,this.turn,{reply:o.message,annotations:o.annotations,notifications:o.notifications,references:o.references,confirmationRequest:o.confirmationRequest}),await this.endProgress())}async collectContext(e,r,n,o,s,c){let u=await new sde(this.turnContext.ctx,this.chatFetcher).collectContext(e,r,n,o,s,c);return this.turn.skills=u.skillIds.map(d=>({skillId:d})),u}async fetchConversationResponse(e,r,n,o,s,c){r.onCancellationRequested(async()=>{await this.cancelProgress()});let l="",u=0,d=new uj((_,E,v,S,T,w)=>{let R=_.trim(),x=R.match(vRe)!==null&&R.endsWith("-->");if(this.conversationProgress.report(this.conversation,this.turn,{reply:_,annotations:E,references:v,hideText:x,notifications:S.map(k=>({severity:"warning",message:k.message})),thinking:w}),this.turn.response?this.turn.response.message=fXe(this.turn.response.message,_):this.turn.response={message:_,type:"model"},this.turn.annotations.push(...E??[]),l+=_,this.strategy.currentDocument){let k=this.strategy.extractEditsFromResponse(l,this.strategy.currentDocument);k&&k.length>0&&(l="",this.conversationProgress.report(this.conversation,this.turn,{codeEdits:k}),u+=k.length)}}),f=c?.id,h=c?.providerName,m=h&&f?await zO(this.turnContext.ctx,h,f):await Ro.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),hSn(e));Ro.applyModelConfigurationOverrides(this.turnContext.ctx,m,c),e=Ro.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(Cb).checkAndCompress(this.conversation,m,"pre-turn",r,String(this.turn.id))}catch(_){ot.exception(this.turnContext.ctx,_,"Pre-turn automatic compression check failed")}let g=this.turn.getResolvedModelId();g&&(o=o.extendedBy({modelId:g}));let A={modelConfiguration:m,messages:e,uiKind:this.strategy.uiKind,intentParams:{intent:!0,intent_threshold:.7,intent_content:Mn(this.turn.request.message)},llmInteraction:this.turnContext.toLlmInteraction(),turnId:String(this.turn.id)},y=await this.chatFetcher.fetchResponse(A,r,n,(_,E)=>d.isFinishedAfter(_,E));return o=o.extendedBy(void 0,{numCodeEdits:u}),await this.postProcessor.postProcess(y,r,d.appliedText,n,o,Mn(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",aSn(this.turnContext.ctx,this.conversation,this.strategy.uiKind,Mn(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=qwe(this.conversation,this.strategy.uiKind,Mn(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=qwe(this.conversation,this.strategy.uiKind,Mn(this.turn.request.message).length,e.tokens,n?.id,void 0,r,e.skillResolutions),c}async finishGenerateResponseStep(e,r){e.error?await r.steps.error(inr,e.error.message):await r.steps.finish(inr)}async endProgress(e){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}async recordAssistantTurnStart(){if(this.transcriptPersistence.isEnabled())try{let e=ltt(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn start transcript: ${e instanceof Error?e.message:String(e)}`)}}async recordAssistantTurnEnd(){if(this.transcriptPersistence.isEnabled())try{let e=this.turn.status==="error"?"error":this.turn.status==="cancelled"?"cancelled":"success",r=zde(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}};p();Fo();p();var yno=fe(Wc()),_no=fe(s2());p();p();var Ze={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,ServerNotInitialized:-32002,RequestCancelled:-32800,ContentModified:-32801,ServerCancelled:-32802,NoCopilotToken:1e3,DeviceFlowFailed:1001,CopilotNotAvailable:1002,NoGitHubToken:1003,CodeFlowFailed:1004,NoBrowserAvailable:1005,AuthEnvVarConflict:1006,NoGitHubRepository:1007};var ey=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(O4n(e))}};function we(t,e){let r=Zu.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=O4n(r.Errors(s));return[null,{code:Ze.InvalidParams,message:c}]}return e(n,o,s)}}a(we,"addMethodHandlerValidation");function O4n(t){return`Schema validation failed with the following errors: +`,u=t.getWriter();try{await u.write(r.encode(l))}finally{u.releaseLock()}}});return{readable:o,writable:s}}a(_Pe,"ndJsonStream");function $w(t){return t??{}}a($w,"emptyObjectResponse");function M4n(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(M4n,"rejectedPromise");var EPe=class{static{a(this,"AgentSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case di.initialize:{let u=Crr.parse(l);return n.initialize(u)}case di.session_new:{let u=vrr.parse(l);return n.newSession(u)}case di.session_load:{if(!n.loadSession)throw ho.methodNotFound(c);let u=Lrr.parse(l);return n.loadSession(u)}case di.session_list:{if(!n.listSessions)throw ho.methodNotFound(c);let u=Arr.parse(l);return n.listSessions(u)}case di.session_delete:{if(!n.unstable_deleteSession)throw ho.methodNotFound(c);let u=Rrr.parse(l);return await n.unstable_deleteSession(u)??{}}case di.session_fork:{if(!n.unstable_forkSession)throw ho.methodNotFound(c);let u=Mrr.parse(l);return n.unstable_forkSession(u)}case di.session_resume:{if(!n.resumeSession)throw ho.methodNotFound(c);let u=Qrr.parse(l);return n.resumeSession(u)}case di.session_close:{if(!n.closeSession)throw ho.methodNotFound(c);let u=xrr.parse(l);return await n.closeSession(u)??{}}case di.session_set_mode:{if(!n.setSessionMode)throw ho.methodNotFound(c);let u=Hrr.parse(l);return await n.setSessionMode(u)??{}}case di.authenticate:{let u=prr.parse(l);return await n.authenticate(u)??{}}case di.providers_list:{if(!n.unstable_listProviders)throw ho.methodNotFound(c);let u=grr.parse(l);return n.unstable_listProviders(u)}case di.providers_set:{if(!n.unstable_setProvider)throw ho.methodNotFound(c);let u=qrr.parse(l);return await n.unstable_setProvider(u)??{}}case di.providers_disable:{if(!n.unstable_disableProvider)throw ho.methodNotFound(c);let u=hrr.parse(l);return await n.unstable_disableProvider(u)??{}}case di.logout:{if(!n.unstable_logout)throw ho.methodNotFound(c);let u=_rr.parse(l);return await n.unstable_logout(u)??{}}case di.session_prompt:{let u=Yrr.parse(l);return n.prompt(u)}case di.session_set_model:{if(!n.unstable_setSessionModel)throw ho.methodNotFound(c);let u=Grr.parse(l);return await n.unstable_setSessionModel(u)??{}}case di.session_set_config_option:{if(!n.setSessionConfigOption)throw ho.methodNotFound(c);let u=jrr.parse(l);return n.setSessionConfigOption(u)}case di.nes_start:{if(!n.unstable_startNes)throw ho.methodNotFound(c);let u=tnr.parse(l);return n.unstable_startNes(u)}case di.nes_suggest:{if(!n.unstable_suggestNes)throw ho.methodNotFound(c);let u=$rr.parse(l);return n.unstable_suggestNes(u)}case di.nes_close:{if(!n.unstable_closeNes)throw ho.methodNotFound(c);let u=Irr.parse(l);return await n.unstable_closeNes(u)??{}}default:if(n.extMethod)return n.extMethod(c,l);throw ho.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case di.session_cancel:{let u=Trr.parse(l);return n.cancel(u)}case di.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=Drr.parse(l);return n.unstable_didOpenDocument(u)}case di.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=Wrr.parse(l);return n.unstable_didChangeDocument(u)}case di.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=krr.parse(l);return n.unstable_didCloseDocument(u)}case di.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=Nrr.parse(l);return n.unstable_didSaveDocument(u)}case di.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=Prr.parse(l);return n.unstable_didFocusDocument(u)}case di.nes_accept:{if(!n.unstable_acceptNes)return;let u=Srr.parse(l);return n.unstable_acceptNes(u)}case di.nes_reject:{if(!n.unstable_rejectNes)return;let u=Frr.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw ho.methodNotFound(c)}},"notificationHandler");this.connection=new sot(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(Lf.session_update,e)}requestPermission(e){return this.connection.sendRequest(Lf.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(Lf.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(Lf.fs_write_text_file,e,$w)}createTerminal(e){return this.connection.sendRequest(Lf.terminal_create,e,r=>new nnr(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(Lf.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(Lf.elicitation_complete,e)}extMethod(e,r){return this.connection.sendRequest(e,r)}extNotification(e,r){return this.connection.sendNotification(e,r)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},nnr=class{static{a(this,"TerminalHandle")}id;sessionId;connection;constructor(e,r,n){this.id=e,this.sessionId=r,this.connection=n}currentOutput(){return this.connection.sendRequest(Lf.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(Lf.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(Lf.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},$w)}release(){return this.connection.sendRequest(Lf.terminal_release,{sessionId:this.sessionId,terminalId:this.id},$w)}async[Symbol.asyncDispose](){await this.release()}},oot=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case Lf.fs_write_text_file:{let u=rnr.parse(l);return await n.writeTextFile?.(u)??{}}case Lf.fs_read_text_file:{let u=Brr.parse(l);return n.readTextFile?.(u)}case Lf.session_request_permission:{let u=Jrr.parse(l);return n.requestPermission(u)}case Lf.terminal_create:{let u=wrr.parse(l);return n.createTerminal?.(u)}case Lf.terminal_output:{let u=Vrr.parse(l);return n.terminalOutput?.(u)}case Lf.terminal_release:{let u=Urr.parse(l);return await n.releaseTerminal?.(u)??{}}case Lf.terminal_wait_for_exit:{let u=enr.parse(l);return n.waitForTerminalExit?.(u)}case Lf.terminal_kill:{let u=Orr.parse(l);return await n.killTerminal?.(u)??{}}case Lf.elicitation_create:{if(!n.unstable_createElicitation)throw ho.methodNotFound(c);let u=Zrr.parse(l);return n.unstable_createElicitation(u)}default:if(n.extMethod)return n.extMethod(c,l);throw ho.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case Lf.session_update:{let u=Xrr.parse(l);return n.sessionUpdate(u)}case Lf.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=mrr.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw ho.methodNotFound(c)}},"notificationHandler");this.connection=new sot(o,s,r)}initialize(e){return this.connection.sendRequest(di.initialize,e)}newSession(e){return this.connection.sendRequest(di.session_new,e)}loadSession(e){return this.connection.sendRequest(di.session_load,e,$w)}unstable_forkSession(e){return this.connection.sendRequest(di.session_fork,e)}listSessions(e){return this.connection.sendRequest(di.session_list,e)}unstable_deleteSession(e){return this.connection.sendRequest(di.session_delete,e,$w)}resumeSession(e){return this.connection.sendRequest(di.session_resume,e)}closeSession(e){return this.connection.sendRequest(di.session_close,e)}setSessionMode(e){return this.connection.sendRequest(di.session_set_mode,e,$w)}unstable_setSessionModel(e){return this.connection.sendRequest(di.session_set_model,e,$w)}setSessionConfigOption(e){return this.connection.sendRequest(di.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(di.authenticate,e,$w)}unstable_listProviders(e){return this.connection.sendRequest(di.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(di.providers_set,e,$w)}unstable_disableProvider(e){return this.connection.sendRequest(di.providers_disable,e,$w)}unstable_logout(e){return this.connection.sendRequest(di.logout,e,$w)}prompt(e){return this.connection.sendRequest(di.session_prompt,e)}cancel(e){return this.connection.sendNotification(di.session_cancel,e)}unstable_startNes(e){return this.connection.sendRequest(di.nes_start,e)}unstable_suggestNes(e){return this.connection.sendRequest(di.nes_suggest,e)}unstable_closeNes(e){return this.connection.sendRequest(di.nes_close,e,$w)}unstable_didOpenDocument(e){return this.connection.sendNotification(di.document_did_open,e)}unstable_didChangeDocument(e){return this.connection.sendNotification(di.document_did_change,e)}unstable_didCloseDocument(e){return this.connection.sendNotification(di.document_did_close,e)}unstable_didSaveDocument(e){return this.connection.sendNotification(di.document_did_save,e)}unstable_didFocusDocument(e){return this.connection.sendNotification(di.document_did_focus,e)}unstable_acceptNes(e){return this.connection.sendNotification(di.nes_accept,e)}unstable_rejectNes(e){return this.connection.sendNotification(di.nes_reject,e)}extMethod(e,r){return this.connection.sendRequest(e,r)}extNotification(e,r){return this.connection.sendNotification(e,r)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},sot=class{static{a(this,"Connection")}pendingResponses=new Map;nextRequestId=0;requestHandler;notificationHandler;stream;writeQueue=Promise.resolve();abortController=new AbortController;closedPromise;constructor(e,r,n){this.requestHandler=e,this.notificationHandler=r,this.stream=n,this.closedPromise=new Promise(o=>{this.abortController.signal.addEventListener("abort",()=>o())}),this.receive()}get signal(){return this.abortController.signal}get closed(){return this.closedPromise}async receive(){let e;try{let r=this.stream.readable.getReader();try{for(;!this.abortController.signal.aborted;){let{value:n,done:o}=await r.read();if(o)break;if(n)try{this.processMessage(n)}catch(s){console.error("Unexpected error during message processing:",n,s),"id"in n&&n.id!==void 0&&this.sendMessage({jsonrpc:"2.0",id:n.id,error:{code:-32700,message:"Parse error"}})}}}finally{r.releaseLock()}}catch(r){e=r}finally{this.close(e)}}close(e){if(this.abortController.signal.aborted)return;let r=e??new Error("ACP connection closed");for(let n of this.pendingResponses.values())n.reject(r);this.pendingResponses.clear(),this.abortController.abort(r)}async processMessage(e){if("method"in e&&"id"in e){let r=await this.tryCallRequestHandler(e.method,e.params);"error"in r&&console.error("Error handling request",e,r.error),await this.sendMessage({jsonrpc:"2.0",id:e.id,...r})}else if("method"in e){let r=await this.tryCallNotificationHandler(e.method,e.params);"error"in r&&console.error("Error handling notification",e,r.error)}else"id"in e?this.handleResponse(e):console.error("Invalid message",{message:e})}async tryCallRequestHandler(e,r){try{return{result:await this.requestHandler(e,r)??null}}catch(n){if(n instanceof ho)return n.toResult();if(n instanceof P.ZodError)return ho.invalidParams(n.format()).toResult();let o;(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")&&(o=n.message);try{return ho.internalError(o?JSON.parse(o):{}).toResult()}catch{return ho.internalError({details:o}).toResult()}}}async tryCallNotificationHandler(e,r){try{return await this.notificationHandler(e,r),{result:null}}catch(n){if(n instanceof ho)return n.toResult();if(n instanceof P.ZodError)return ho.invalidParams(n.format()).toResult();let o;(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")&&(o=n.message);try{return ho.internalError(o?JSON.parse(o):{}).toResult()}catch{return ho.internalError({details:o}).toResult()}}}handleResponse(e){let r=this.pendingResponses.get(e.id);if(r){if("result"in e)r.resolve(e.result);else if("error"in e){let{code:n,message:o,data:s}=e.error;r.reject(new ho(n,o,s))}this.pendingResponses.delete(e.id)}else console.error("Got response to unknown request",e.id)}sendRequest(e,r,n){if(this.abortController.signal.aborted)return M4n(this.closedReason());let o=this.nextRequestId++,s=new Promise((c,l)=>{this.pendingResponses.set(o,{resolve:a(u=>{try{c(n?n(u):u)}catch(d){l(d)}},"resolve"),reject:l})});return s.catch(()=>{}),this.sendMessage({jsonrpc:"2.0",id:o,method:e,params:r}),s}sendNotification(e,r){return this.abortController.signal.aborted?M4n(this.closedReason()):this.sendMessage({jsonrpc:"2.0",method:e,params:r})}closedReason(){return this.abortController.signal.reason??new Error("ACP connection closed")}async sendMessage(e){return this.writeQueue=this.writeQueue.then(async()=>{let r=this.stream.writable.getWriter();try{await r.write(e)}finally{r.releaseLock()}}).catch(r=>{this.close(r)}),this.writeQueue}},ho=class t extends Error{static{a(this,"RequestError")}code;data;constructor(e,r,n){super(r),this.code=e,this.name="RequestError",this.data=n}static parseError(e,r){return new t(-32700,`Parse error${r?`: ${r}`:""}`,e)}static invalidRequest(e,r){return new t(-32600,`Invalid request${r?`: ${r}`:""}`,e)}static methodNotFound(e){return new t(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,r){return new t(-32602,`Invalid params${r?`: ${r}`:""}`,e)}static internalError(e,r){return new t(-32603,`Internal error${r?`: ${r}`:""}`,e)}static authRequired(e,r){return new t(-32e3,`Authentication required${r?`: ${r}`:""}`,e)}static resourceNotFound(e){return new t(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};var Fbe=require("node:stream");p();Fo();p();var Ib=class extends DK{constructor(r){super(new sue,new Map);this.envSettings=new Map;this.env={...r};let n;this.#e=new Promise(s=>{n=s}),this.markReady=n,["DebugOverrideEngine","DebugOverrideProxyUrl","DebugOverrideCapiUrl","DebugUseEditorFetcher","UseSubsetMatching","UseChatLibCompletions","AppendPromptTokenCache","PromptPersistBasePath","AnthropicMessagesEndpoint","EnableMapCodeFallback","SearchAgent","UseHelixFetcher","PerfEnabled","AuthTokenEncryption","EnableWorkspaceIndex"].forEach(s=>{for(let c of["AGENT_DEBUG_","GITHUB_COPILOT_","GH_COPILOT_"]){let l=`${c}${$0s(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(ze[s],this.env[l])}})}static{a(this,"AgentConfigProvider")}#e;async requireReady(){await this.#e}getOptionalOverride(r){return super.getOptionalOverride(r)??this.envSettings.get(r)}};function $0s(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a($0s,"camelCaseToSnakeCaseAllCaps");var V0s="unknown-editor",O4n="unknown-editor-plugin",Jj=class extends Ir{static{a(this,"AgentEditorInfo")}setEditorAndPluginInfo(e,r,n=[]){this._editorInfo=r,this._editorPluginInfo=e,this._relatedPluginInfo=n}setCopilotIntegrationId(e){this._copilotIntegrationId=e}getEditorInfo(){return this._editorInfo?this._editorInfo:{name:V0s,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:O4n,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}isEditorPluginInfoKnown(){return this._editorPluginInfo!==void 0&&this._editorPluginInfo.name!==O4n}};p();p();var aot=new pe("agenticTurnProcessor"),CPe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Bc),this.chatFetcher=this.chatFetcher??new mc(e.ctx),this.turnSuggestions=new aj(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new Ig(e.ctx),this.hookTrigger=new Zde(e.ctx,e.conversation,e.turn.workspaceFolders||[])}static{a(this,"AgenticTurnProcessor")}async process(e,r,n,o,s){try{await this.processWithModelAndToolCall(e,r,this.turnContext,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c);let l=c instanceof Error?c.message:String(c);this.turn.status="error",this.updateTurnResponseWithError(l),c instanceof Error?await this.fireErrorOccurredHook(c):await this.fireErrorOccurredHook(new Error(String(c))),await this.endProgress({error:{message:l,code:Lq.Unknown,responseIsIncomplete:!0}})}}async processWithModelAndToolCall(e,r,n,o,s,c){if(r.isCancellationRequested)return;await this.conversationProgress.begin(this.conversation,this.turn,e),await this.fireUserPromptSubmittedHook(this.turn.request.message),await this.recordAssistantTurnStart();let l=await fl(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!kbn(this.turn.chatMode)){let h=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});ft(this.turnContext.ctx,"customAgent.turn",h),Ix(this.turnContext.ctx,"customAgent.turn",h)}r.onCancellationRequested(async()=>{aot.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let u=P2().find(h=>h.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let f=(await Iw(this.turnContext.ctx)).find(h=>h.slug===this.turn.agent?.agentSlug);await this.collectContext(n,r,l,u,f);try{let h=c?.id,m=c?.providerName,g=m&&h?await zO(this.turnContext.ctx,m,h):await Ro.getModelConfigurationById(this.turnContext.ctx,h,this.conversation.id.toString(),jq(this.conversation.turns));Ro.applyModelConfigurationOverrides(this.turnContext.ctx,g,c),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(Cb).checkAndCompress(this.conversation,g,"pre-turn",r,String(this.turn.id))}catch(_){ot.exception(this.turnContext.ctx,_,"Pre-turn automatic compression check failed")}await new yfe(this.turnContext,this.chatFetcher,g,l).run(r);let y={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let _=await this.fetchSuggestedTitle(r,l.extendedBy({messageSource:"chat.user"},{}));typeof _=="string"&&_!==""&&(y.suggestedTitle=_)}await this.endProgress(y)}catch(h){if(h instanceof Rj)aot.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,h),this.turn.status="cancelled",await this.cancelProgress();else if(h instanceof zc)aot.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,h),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(h instanceof zF)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:{message:h.message,code:Lq.ToolRoundExceedError,responseIsIncomplete:!0}});else if(h instanceof zA)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:h.conversationError});else throw aot.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,h),h}}async collectContext(e,r,n,o,s){let c=!!s&&typeof s.additionalSkills=="function",l=!!o&&typeof o.requiredSkills=="function";if(!c&&!l)return;let d=await new ade(this.turnContext.ctx,this.chatFetcher).collectContext(e,r,n,this.strategy.uiKind,o,s);this.turn.skills=d.skillIds.map(f=>({skillId:f}))}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return ot.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=Hq(this.turn.response?.message,{role:"assistant",content:e}):this.turn.response={message:e,type:"meta"}}async endProgress(e){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.recordAssistantTurnEnd(),await this.turnContext.agentToolCalls.finishAll("cancelled"),await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}async handleTemplateResponse(e,r,n){if(!e.response)return;let o=await e.response(this.turnContext,r,n);this.turn.response={type:"meta",message:o.message},this.turn.status=o.error?.responseIsFiltered?"filtered":o.error?.responseIsIncomplete?"error":"success",o.error?.responseIsFiltered||o.error?.responseIsIncomplete?(await this.conversationProgress.report(this.conversation,this.turn,{reply:"Sure, I can definitely do that!",annotations:o.annotations,notifications:o.notifications,references:o.references}),await this.turnContext.steps.finishAll(),await this.endProgress({error:{message:o.message,code:o.error?.code||0,responseIsIncomplete:o.error?.responseIsIncomplete,responseIsFiltered:o.error?.responseIsFiltered}})):(await this.conversationProgress.report(this.conversation,this.turn,{reply:o.message,annotations:o.annotations,notifications:o.notifications,references:o.references,confirmationRequest:o.confirmationRequest}),await this.endProgress())}async recordAssistantTurnStart(){if(this.transcriptPersistence.isEnabled())try{let e=ltt(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn start transcript: ${e instanceof Error?e.message:String(e)}`)}}async recordAssistantTurnEnd(){if(this.transcriptPersistence.isEnabled())try{let e=this.turn.status==="error"?"error":this.turn.status==="cancelled"?"cancelled":"success",r=Yde(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}async fireUserPromptSubmittedHook(e){let r=e??this.turn.request.message;await this.hookTrigger.fireUserPromptSubmittedHook(r,{turn:this.turn,conversationProgress:this.conversationProgress})}async fireErrorOccurredHook(e){await this.hookTrigger.fireErrorOccurredHook(e,{turn:this.turn,conversationProgress:this.conversationProgress})}};p();var inr="collect-context",onr="generate-response",cot=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Bc),this.chatFetcher=this.chatFetcher??new mc(e.ctx),this.postProcessor=new gde(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new Ig(e.ctx)}static{a(this,"ModelTurnProcessor")}async process(e,r,n,o,s){try{await this.processWithModel(e,r,this.turnContext,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c);let l=c instanceof Error?c.message:String(c);this.turn.status="error",this.turn.response={message:l,type:"meta"},await this.endProgress({error:{message:l,code:Lq.Unknown,responseIsIncomplete:!0}})}}async processWithModel(e,r,n,o,s,c){await this.conversationProgress.begin(this.conversation,this.turn,e),await this.recordAssistantTurnStart();let l=await fl(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(l=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),...this.turn.userRequestedModel&&{modelId:this.turn.userRequestedModel}}),r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let u=P2().find(A=>A.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let d=(await Iw(this.turnContext.ctx)).find(A=>A.slug===this.turn.agent?.agentSlug);if(d){let A=await this.checkAgentPreconditions(d);if(A){await this.endProgress(A);return}}await n.steps.start(inr,"Collecting context"),await this.collectContext(n,r,l,this.strategy.uiKind,u,d);let f=c?.id,h=c?.providerName,m;h?m="customized":f?m=(await Ro.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),jq(this.conversation.turns))).uiName:m=void 0;let g=await this.strategy.buildConversationPrompt(n,s?.detectedLanguageId??"",void 0,m);if(!g)await n.steps.error(inr,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(inr),await n.steps.start(onr,"Generating response");let A=this.augmentTelemetry(g,l,u,o,s);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let y=await this.fetchConversationResponse(g.messages,r,l.extendedBy({messageSource:"chat.user"},{promptTokenLen:g.tokens}),A,s,c),_=await this.strategy.processResponse(this.turn);this.turn.status==="cancelled"&&this.turn.response?.type==="user"?await this.cancelProgress():(await this.finishGenerateResponseStep(y,n),await this.endProgress({error:y.error,followUp:y.followup,suggestedTitle:y.suggestedTitle,skillResolutions:g.skillResolutions,updatedDocuments:_}))}}async checkAgentPreconditions(e){try{let r=e.checkPreconditions?await e.checkPreconditions(this.turnContext.ctx,this.turn):void 0;if(r&&r.type==="authorizationRequired")return{unauthorized:{...r,agentName:e.name,agentSlug:e.slug}}}catch(r){ot.error(this.turnContext.ctx,`Error checking preconditions for agent ${e.slug}`,r);let n=r instanceof Error?r.message:String(r);return this.turn.status="error",this.turn.response={message:n,type:"meta"},{error:{message:n,responseIsIncomplete:!0}}}}async endTurnWithResponse(e,r){this.turn.response={type:"meta",message:e},this.turn.status=r,await this.conversationProgress.report(this.conversation,this.turn,{reply:e}),await this.endProgress()}async handleTemplateResponse(e,r,n){if(!e.response)return;let o=await e.response(this.turnContext,r,n);this.turn.response={type:"meta",message:o.message},this.turn.status=o.error?.responseIsFiltered?"filtered":o.error?.responseIsIncomplete?"error":"success",o.error?.responseIsFiltered||o.error?.responseIsIncomplete?(await this.conversationProgress.report(this.conversation,this.turn,{reply:"Sure, I can definitely do that!",annotations:o.annotations,notifications:o.notifications,references:o.references}),await this.turnContext.steps.finishAll(),await this.endProgress({error:{message:o.message,code:o.error?.code||0,responseIsIncomplete:o.error?.responseIsIncomplete,responseIsFiltered:o.error?.responseIsFiltered}})):(await this.conversationProgress.report(this.conversation,this.turn,{reply:o.message,annotations:o.annotations,notifications:o.notifications,references:o.references,confirmationRequest:o.confirmationRequest}),await this.endProgress())}async collectContext(e,r,n,o,s,c){let u=await new ade(this.turnContext.ctx,this.chatFetcher).collectContext(e,r,n,o,s,c);return this.turn.skills=u.skillIds.map(d=>({skillId:d})),u}async fetchConversationResponse(e,r,n,o,s,c){r.onCancellationRequested(async()=>{await this.cancelProgress()});let l="",u=0,d=new uj((_,E,v,S,T,w)=>{let R=_.trim(),x=R.match(vRe)!==null&&R.endsWith("-->");if(this.conversationProgress.report(this.conversation,this.turn,{reply:_,annotations:E,references:v,hideText:x,notifications:S.map(k=>({severity:"warning",message:k.message})),thinking:w}),this.turn.response?this.turn.response.message=fXe(this.turn.response.message,_):this.turn.response={message:_,type:"model"},this.turn.annotations.push(...E??[]),l+=_,this.strategy.currentDocument){let k=this.strategy.extractEditsFromResponse(l,this.strategy.currentDocument);k&&k.length>0&&(l="",this.conversationProgress.report(this.conversation,this.turn,{codeEdits:k}),u+=k.length)}}),f=c?.id,h=c?.providerName,m=h&&f?await zO(this.turnContext.ctx,h,f):await Ro.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),mSn(e));Ro.applyModelConfigurationOverrides(this.turnContext.ctx,m,c),e=Ro.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(Cb).checkAndCompress(this.conversation,m,"pre-turn",r,String(this.turn.id))}catch(_){ot.exception(this.turnContext.ctx,_,"Pre-turn automatic compression check failed")}let g=this.turn.getResolvedModelId();g&&(o=o.extendedBy({modelId:g}));let A={modelConfiguration:m,messages:e,uiKind:this.strategy.uiKind,intentParams:{intent:!0,intent_threshold:.7,intent_content:Mn(this.turn.request.message)},llmInteraction:this.turnContext.toLlmInteraction(),turnId:String(this.turn.id)},y=await this.chatFetcher.fetchResponse(A,r,n,(_,E)=>d.isFinishedAfter(_,E));return o=o.extendedBy(void 0,{numCodeEdits:u}),await this.postProcessor.postProcess(y,r,d.appliedText,n,o,Mn(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",cSn(this.turnContext.ctx,this.conversation,this.strategy.uiKind,Mn(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=qwe(this.conversation,this.strategy.uiKind,Mn(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=qwe(this.conversation,this.strategy.uiKind,Mn(this.turn.request.message).length,e.tokens,n?.id,void 0,r,e.skillResolutions),c}async finishGenerateResponseStep(e,r){e.error?await r.steps.error(onr,e.error.message):await r.steps.finish(onr)}async endProgress(e){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}async recordAssistantTurnStart(){if(this.transcriptPersistence.isEnabled())try{let e=ltt(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn start transcript: ${e instanceof Error?e.message:String(e)}`)}}async recordAssistantTurnEnd(){if(this.transcriptPersistence.isEnabled())try{let e=this.turn.status==="error"?"error":this.turn.status==="cancelled"?"cancelled":"success",r=Yde(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}};p();Fo();p();var Eno=fe(Wc()),vno=fe(s2());p();p();var Ze={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,ServerNotInitialized:-32002,RequestCancelled:-32800,ContentModified:-32801,ServerCancelled:-32802,NoCopilotToken:1e3,DeviceFlowFailed:1001,CopilotNotAvailable:1002,NoGitHubToken:1003,CodeFlowFailed:1004,NoBrowserAvailable:1005,AuthEnvVarConflict:1006,NoGitHubRepository:1007};var ey=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(L4n(e))}};function we(t,e){let r=Zu.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=L4n(r.Errors(s));return[null,{code:Ze.InvalidParams,message:c}]}return e(n,o,s)}}a(we,"addMethodHandlerValidation");function L4n(t){return`Schema validation failed with the following errors: ${Array.from(t).map(r=>`- ${r.path}: ${r.message}`).join(` -`)}`}a(O4n,"createErrorMessage");p();p();p();p();function ope(t){let e=t.capabilities.supports?.reasoning_effort,r=!!e&&e.length>0,n=t.capabilities.supports,o=t.capabilities.limits,s=t.billing,c=s&&{...s.multiplier!==void 0?{multiplier:s.multiplier}:{},...s.token_prices!==void 0?{token_prices:s.token_prices}:{},...s.promo!==void 0?{promo:s.promo}:{}},l=!!c&&Object.keys(c).length>0;return{id:t.id,name:t.name,...t.preview!==void 0?{preview:t.preview}:{},...t.vendor!==void 0?{vendor:t.vendor}:{},...t.model_picker_category!==void 0?{model_picker_category:t.model_picker_category}:{},...t.model_picker_price_category!==void 0?{model_picker_price_category:t.model_picker_price_category}:{},...t.supported_endpoints!==void 0?{supported_endpoints:t.supported_endpoints}:{},...t.policy!==void 0?{policy:t.policy}:{},...l?{billing:c}:{},...t.custom_model!==void 0?{custom_model:t.custom_model}:{},...t.warning_messages!==void 0?{warning_messages:t.warning_messages}:{},capabilities:{family:t.capabilities.family,supports:{...n?.streaming!==void 0?{streaming:n.streaming}:{},...n?.tool_calls!==void 0?{tool_calls:n.tool_calls}:{},...n?.vision!==void 0?{vision:n.vision}:{},...e!==void 0?{reasoning_effort:e}:{},reasoningEffort:r},limits:{...o?.max_prompt_tokens!==void 0?{max_prompt_tokens:o.max_prompt_tokens}:{},...o?.max_output_tokens!==void 0?{max_output_tokens:o.max_output_tokens}:{},max_context_window_tokens:o?.max_context_window_tokens??0}},...e!==void 0?{supportedReasoningEfforts:e}:{},...r?{defaultReasoningEffort:YO(e)}:{}}}a(ope,"toAgentModelInfo");p();var $0s=new pe("BackgroundAgent.AuthBinding"),lot=class{constructor(e){this.ctx=e}static{a(this,"AuthBinding")}async buildAuthInfo(){let e=await this.ctx.get(Fr).resolveSession();if(!e)throw new Error("Not authenticated. Please sign in first.");return{githubToken:e.accessToken}}async detectIdentityChange(){let e;try{e=(await this.ctx.get(Fr).resolveSession())?.accessToken}catch(o){return $0s.warn(this.ctx,"Failed to read GitHub session on auth change; skipping cache invalidation",{error:o instanceof Error?o.message:String(o)}),{changed:!1,hadPrevious:this.lastAccessToken!==void 0,hasCurrent:!1}}let r=this.lastAccessToken!==void 0,n=e!==void 0;return this.lastAccessToken===e?{changed:!1,hadPrevious:r,hasCurrent:n}:(this.lastAccessToken=e,{changed:!0,hadPrevious:r,hasCurrent:n})}setObservedAccessTokenForTesting(e){this.lastAccessToken=e}getLastAccessTokenForTesting(){return this.lastAccessToken}};p();var V0s=new pe("BackgroundAgent.Attachments");function L4n(t,e){let r=[];for(let n of t){let o=W0s(n);o?r.push(o):V0s.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(L4n,"convertReferencesToAttachments");function W0s(t){switch(t.type){case"file":{let e=oo(t.uri).fsPath;return t.selection?{type:"selection",filePath:e,displayName:e,text:"",selection:{start:{line:t.selection.start.line,character:t.selection.start.character},end:{line:t.selection.end.line,character:t.selection.end.character}}}:{type:"file",path:e,displayName:e}}case"directory":{let e=oo(t.uri).fsPath;return{type:"directory",path:e,displayName:e}}default:return null}}a(W0s,"convertReferenceToAttachment");p();var MZ=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}};function onr(t,e=100){if(!(t instanceof Error))return;let r=[],n=new Set,o=t.cause,s=0;for(;o instanceof Error&&!n.has(o)&&s0?r.join(": "):void 0}a(onr,"describeCauseChain");function uot(t){let e=t instanceof Error?t.message:String(t),r=onr(t);return r?`${e} (cause: ${r})`:e}a(uot,"formatErrorWithCause");var bPe=class extends MZ{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},SPe=class extends MZ{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();async function B4n(t,e){switch(e.type){case"permission":return{success:await t.respondToPermission(e.requestId,e.result)};case"user_input":return{success:await t.respondToUserInput(e.requestId,e.response)};case"elicitation":return{success:await t.respondToElicitation(e.requestId,e.response)};case"exit_plan_mode":return{success:await t.respondToExitPlanMode(e.requestId,e.response)};case"queued_command":return{success:await t.respondToQueuedCommand(e.requestId,e.result)};case"external_tool":return{success:await t.respondToExternalTool(e.requestId,e.result)};default:throw new Error(`Unknown interaction type: ${e.type}`)}}a(B4n,"routeInteraction");p();var F4n=new pe("BackgroundAgent.McpSync"),dot=class{constructor(e,r){this.ctx=e;this.registry=r}static{a(this,"BackgroundAgentMcpSyncTarget")}async syncToActiveSessions(e){this.registry.size()!==0&&(F4n.info(this.ctx,"Syncing MCP servers to active sessions",{sessionCount:this.registry.size()}),await Promise.all([...this.registry.entries()].map(async([r,n])=>{let o=this.registry.getMcpDirectory(r)??this.registry.getWorkspaceFolderUri(r),s=e.buildMcpServers(o);try{await n.reloadMcpServers({mcpServers:s})}catch(c){F4n.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:c instanceof Error?c.message:String(c)})}})))}};p();p();var Nqn=fe(require("crypto")),Mqn=fe(require("fs")),qat=fe(Pqn()),Oqn=require("tls"),Lqn=fe(Dqn());var ghe=new pe("certificates"),bp=class{static{a(this,"RootCertificateReader")}};function jat(t,e=process.platform){return new Nar(t,[new Mar,new Oar,V2s(t,e)])}a(jat,"getRootCertificateReader");function V2s(t,e){switch(e){case"linux":return new Lar(t);case"darwin":return new Bar(t);case"win32":return new Far(t);default:return new Uar}}a(V2s,"createPlatformReader");var Dar=class extends bp{constructor(r,n){super();this.ctx=r;this.delegate=n}static{a(this,"ErrorHandlingCertificateReader")}async getAllRootCAs(){try{return await this.delegate.getAllRootCAs()}catch(r){return ghe.warn(this.ctx,"Failed to read root certificates:",r),[]}}},Nar=class extends bp{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new Dar(r,o))}static{a(this,"CachingRootCertificateReader")}async getAllRootCAs(){return this.certificates||(this.certificates=this.removeExpiredCertificates((await Promise.all(this.delegates.map(r=>r.getAllRootCAs()))).flat())),this.certificates}removeExpiredCertificates(r){let n=Date.now(),o=r.filter(s=>{try{let c=new Nqn.X509Certificate(s),l=Date.parse(c.validTo);return isNaN(l)||l>n}catch(c){return ghe.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&ghe.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},Mar=class extends bp{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return Oqn.rootCertificates}},Oar=class extends bp{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await Bqn(e):[]}},Lar=class extends bp{constructor(r){super();this.ctx=r}static{a(this,"LinuxRootCertificateReader")}async getAllRootCAs(){let r=[];for(let n of["/etc/ssl/certs/ca-certificates.crt","/etc/ssl/certs/ca-bundle.crt"]){let o=await Bqn(n);ghe.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},Bar=class extends bp{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=qat.get({excludeBundled:!1,format:qat.Format.pem});return ghe.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},Far=class extends bp{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=Lqn.all();return ghe.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},Uar=class extends bp{static{a(this,"UnsupportedPlatformRootCertificateReader")}getAllRootCAs(){return Promise.reject(new Error("No certificate reader available for unsupported platform"))}};async function Bqn(t){let e;try{e=await Mqn.promises.readFile(t,{encoding:"utf8"})}catch{return[]}let r=e.match(/-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/g);if(!r)return[];let n=r.filter(s=>s.length>0),o=new Set(n);return Array.from(o)}a(Bqn,"readCertsFromFile");var XH=fe(Sfr());var Ifr=new pe("BackgroundAgent.ProxyEnv"),xfr=new Map,wfr=new Set,YDe;function Rfr(){for(let t of wfr){let e=xfr.get(t);e===void 0?delete process.env[t]:process.env[t]=e}wfr.clear(),YDe&&((0,XH.setGlobalDispatcher)(YDe),YDe=void 0)}a(Rfr,"restoreProxyEnvironment");function Tfr(t,e,r){process.env[t]||process.env[e]||(xfr.has(t)||xfr.set(t,process.env[t]),process.env[t]=r,wfr.add(t))}a(Tfr,"setEnvIfAbsent");function _qs(t,e){if(!e)return t;try{let r=new URL(t),n=e.indexOf(":"),o=n===-1?e:e.slice(0,n),s=n===-1?"":e.slice(n+1);return o&&(r.username=encodeURIComponent(o),s&&(r.password=encodeURIComponent(s))),r.toString()}catch{return t}}a(_qs,"buildProxyUrl");async function Eqs(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(bp).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{Ifr.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(Eqs,"buildTlsOptions");async function qlt(t){try{Rfr();let e=t.get(Qo).getHttpSettings();if(!e.proxy)return;let r=_qs(e.proxy,e.proxyAuthorization);Tfr("HTTPS_PROXY","https_proxy",r),Tfr("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&Tfr("NO_PROXY","no_proxy",n),YDe||(YDe=(0,XH.getGlobalDispatcher)());let o=await Eqs(t,e.proxyStrictSSL);(0,XH.setGlobalDispatcher)(new XH.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),Ifr.info(t,"Applied proxy settings to environment for SDK",{hasProxy:!0,hasAuth:!!e.proxyAuthorization,hasNoProxy:!!n,proxyStrictSSL:e.proxyStrictSSL!==!1,hasTlsCa:!!o.requestTls,dispatcherType:(0,XH.getGlobalDispatcher)().constructor.name})}catch(e){Ifr.warn(t,"Failed to apply proxy settings to environment:",e)}}a(qlt,"applyProxyToEnvironment");p();var IJn=fe(TJn());var Sqs=new pe("BackgroundAgent.Todos");async function Tqs(t){let{rows:e,dependencies:r}=await t.plan.readSqlTodosWithDependencies();return Iqs(e,r)}a(Tqs,"readSessionTodos");function Iqs(t,e){let r=a(c=>({id:c.id,title:c.title,status:c.status}),"toItem"),n=a(()=>t.map(r),"unsorted");if(t.length===0||e.length===0)return n();let o=new Map;for(let c=0;cr(t[l]))}catch{return n()}}a(Iqs,"orderTodosByDependency");async function jlt(t,e,r,n){try{let o=await Tqs(n);await e.sendBackgroundAgentTodosChanged({sessionId:r,todos:o}),sr(t,"backgroundAgent.todoList.changed",void 0,{todoCount:o.length})}catch(o){Sqs.warn(t,"Failed to read/emit session todos",{sessionId:r,error:o instanceof Error?o.message:String(o)})}}a(jlt,"emitTodosChanged");p();var xqs=["read_file","view","grep_search","file_search","semantic_search","grep","rg","glob","tool_search_tool_regex","fetch_copilot_cli_documentation","think"],Hlt=["get_errors"],Pfr=[...Hlt,"edit","str_replace_editor","apply_patch"],wqs=["ask","inline-ask","inline"];function Glt(t){return t!==void 0&&wqs.includes(t)}a(Glt,"isClampedChatMode");var Rqs={ask:xqs,inline:Pfr,"inline-ask":Hlt};async function xJn(t,e,r){let n,o,s;e==="agent"?(n=null,o=new Set(await r.getPolicyDisabledSkillNames()),s=await r.getMcpServers()):(n=[...Rqs[e]],o=new Set(await r.getAllLoadedSkillNames()),s={});let c={availableTools:n,disabledSkills:o,mcpServers:s};await t.updateOptions(c)}a(xJn,"applyChatMode");p();var tI=fe(require("node:path"));var kJn="copilot-language-server:inline-chat",kqs=["file","path","filePath","file_path"],Pqs=new Set(["edit","create","str_replace_editor","write"]),Dqs=new Set(["git_apply_patch"]),wJn=/^\*\*\* (?:Add File|Delete File|Update File|Move to): (.+)$/gm;function Nqs(t){let e=tI.dirname(t);return{confinedFsPath:t,confinedName:tI.basename(t),baseDir:e,confinedComparable:Dfr(t,e)}}a(Nqs,"buildContext");function Mqs(t){if(typeof t=="string")try{let e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}return t&&typeof t=="object"?t:{}}a(Mqs,"parseToolArgs");function Oqs(t){if(typeof t=="string")return t;if(t&&typeof t=="object"){let e=t;if(typeof e.input=="string")return e.input;if(typeof e.patch=="string")return e.patch}}a(Oqs,"extractApplyPatchBody");function Lqs(t){if(!t.includes("*** Begin Patch"))return;let e=[];wJn.lastIndex=0;for(let r of t.matchAll(wJn)){let n=r[1].trim();n.length>0&&e.push(n)}return e}a(Lqs,"extractApplyPatchPaths");function Bqs(t){for(let e of kqs){let r=t[e];if(typeof r=="string"&&r.trim().length>0)return r}}a(Bqs,"extractTargetPath");function Dfr(t,e){let r=t.startsWith("file:")?un(t):t,n=tI.isAbsolute(r)?tI.normalize(r):tI.resolve(e,r);return process.platform==="win32"||process.platform==="darwin"?n.toLowerCase():n}a(Dfr,"toComparablePath");function RJn(t,e){return tI.isAbsolute(t)?tI.normalize(t):tI.resolve(e,t)}a(RJn,"resolveTargetPath");function Fqs(t,e,r){if(Dqs.has(t))return{allowed:!1,reason:`Inline chat may only edit ${r.confinedName}. The ${t} tool cannot be confined to a single file and is not available in inline chat.`};if(t==="apply_patch"){let o=Oqs(e);if(o===void 0)return{allowed:!1,reason:`Inline chat denied an apply_patch call with no readable patch body. Only ${r.confinedName} may be edited.`};let s=Lqs(o);if(s===void 0)return{allowed:!1,reason:`Inline chat denied an apply_patch call whose body could not be parsed. Only ${r.confinedName} may be edited.`};if(s.length===0)return{allowed:!1,reason:`Inline chat denied an apply_patch call with no file headers. Only ${r.confinedName} may be edited.`};for(let c of s)if(Dfr(c,r.baseDir)!==r.confinedComparable)return{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${RJn(c,r.baseDir)} (apply_patch header: ${c}).`};return{allowed:!0}}if(!Pqs.has(t))return{allowed:!0};let n=Bqs(Mqs(e));return n?Dfr(n,r.baseDir)!==r.confinedComparable?{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${RJn(n,r.baseDir)} (${t} arg: ${n}).`}:{allowed:!0}:{allowed:!1,reason:`Inline chat denied a ${t} call with no resolvable file path. Only ${r.confinedName} may be edited.`}}a(Fqs,"evaluateWithContext");function PJn(t){let e=0;return{hook:{source:kJn,handler:a(()=>e>t?Promise.resolve({permissionDecision:"deny",permissionDecisionReason:`Inline chat is limited to ${t} tool-calling turns. No further tool calls are allowed.`}):Promise.resolve(),"handler")},onTurnStart(){e++},reset(){e=0}}}a(PJn,"createInlineTurnLimitHook");function DJn(t){let e=t.startsWith("file:")?un(t):t,r=Nqs(e);return{source:kJn,handler:a(n=>{let o=Fqs(n.toolName,n.toolArgs,r);return o.allowed?Promise.resolve():Promise.resolve({permissionDecision:"deny",permissionDecisionReason:o.reason??"Edit denied: inline chat is confined to the active file."})},"handler")}}a(DJn,"createInlineEditConfinementHook");p();var Nfr=fe(require("fs"));var sme=new pe("BackgroundAgent.InlineFileContext"),Uqs=50*1024,$lt=100,Qqs=.4,NJn=25;async function MJn(t,e,r){let n;try{n=oo(t).fsPath}catch{return sme.debug(r,`buildInlineFileContext: failed to parse URI ${t}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let o;try{o=await Nfr.promises.stat(n)}catch{return sme.debug(r,`buildInlineFileContext: failed to stat ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let s=o.size>Uqs,c;try{c=await Nfr.promises.readFile(n,"utf-8")}catch{return sme.debug(r,`buildInlineFileContext: failed to read ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:s}}let l=e?.selection,u=e?.position,d="",f=!1;if(!s)d=` +`)}`}a(L4n,"createErrorMessage");p();p();p();p();function spe(t){let e=t.capabilities.supports?.reasoning_effort,r=!!e&&e.length>0,n=t.capabilities.supports,o=t.capabilities.limits,s=t.billing,c=s&&{...s.multiplier!==void 0?{multiplier:s.multiplier}:{},...s.token_prices!==void 0?{token_prices:s.token_prices}:{},...s.promo!==void 0?{promo:s.promo}:{}},l=!!c&&Object.keys(c).length>0;return{id:t.id,name:t.name,...t.preview!==void 0?{preview:t.preview}:{},...t.vendor!==void 0?{vendor:t.vendor}:{},...t.model_picker_category!==void 0?{model_picker_category:t.model_picker_category}:{},...t.model_picker_price_category!==void 0?{model_picker_price_category:t.model_picker_price_category}:{},...t.supported_endpoints!==void 0?{supported_endpoints:t.supported_endpoints}:{},...t.policy!==void 0?{policy:t.policy}:{},...l?{billing:c}:{},...t.custom_model!==void 0?{custom_model:t.custom_model}:{},...t.warning_messages!==void 0?{warning_messages:t.warning_messages}:{},capabilities:{family:t.capabilities.family,supports:{...n?.streaming!==void 0?{streaming:n.streaming}:{},...n?.tool_calls!==void 0?{tool_calls:n.tool_calls}:{},...n?.vision!==void 0?{vision:n.vision}:{},...e!==void 0?{reasoning_effort:e}:{},reasoningEffort:r},limits:{...o?.max_prompt_tokens!==void 0?{max_prompt_tokens:o.max_prompt_tokens}:{},...o?.max_output_tokens!==void 0?{max_output_tokens:o.max_output_tokens}:{},max_context_window_tokens:o?.max_context_window_tokens??0}},...e!==void 0?{supportedReasoningEfforts:e}:{},...r?{defaultReasoningEffort:YO(e)}:{}}}a(spe,"toAgentModelInfo");p();var W0s=new pe("BackgroundAgent.AuthBinding");function B4n(t){let e=new URL(t).host;return e==="github.com"?void 0:e}a(B4n,"toRuntimeGitHubHost");var lot=class{constructor(e){this.ctx=e}static{a(this,"AuthBinding")}async buildAuthInfo(){let e=await this.ctx.get(Or).resolveSession();if(!e)throw new Error("Not authenticated. Please sign in first.");return{githubToken:e.accessToken}}async resolveRuntimeGitHubHost(){let e=await this.ctx.get(Or).resolveSession();return e?B4n(e.serverUrl):void 0}async detectIdentityChange(){let e;try{let s=await this.ctx.get(Or).resolveSession();e=s?{accessToken:s.accessToken,githubHost:B4n(s.serverUrl)}:void 0}catch(s){return W0s.warn(this.ctx,"Failed to read GitHub session on auth change; skipping cache invalidation",{error:s instanceof Error?s.message:String(s)}),{changed:!1,hadPrevious:this.lastIdentity!==void 0,hasCurrent:!1,githubHost:void 0}}let r=this.lastIdentity!==void 0,n=e!==void 0;return this.lastIdentity?.accessToken!==e?.accessToken||this.lastIdentity?.githubHost!==e?.githubHost?(this.lastIdentity=e,{changed:!0,hadPrevious:r,hasCurrent:n,githubHost:e?.githubHost}):{changed:!1,hadPrevious:r,hasCurrent:n,githubHost:e?.githubHost}}setObservedAccessTokenForTesting(e,r){this.lastIdentity=e===void 0?void 0:{accessToken:e,githubHost:r}}getLastAccessTokenForTesting(){return this.lastIdentity?.accessToken}};p();var z0s=new pe("BackgroundAgent.Attachments");function F4n(t,e){let r=[];for(let n of t){let o=Y0s(n);o?r.push(o):z0s.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(F4n,"convertReferencesToAttachments");function Y0s(t){switch(t.type){case"file":{let e=oo(t.uri).fsPath;return t.selection?{type:"selection",filePath:e,displayName:e,text:"",selection:{start:{line:t.selection.start.line,character:t.selection.start.character},end:{line:t.selection.end.line,character:t.selection.end.character}}}:{type:"file",path:e,displayName:e}}case"directory":{let e=oo(t.uri).fsPath;return{type:"directory",path:e,displayName:e}}default:return null}}a(Y0s,"convertReferenceToAttachment");p();var OZ=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}};function snr(t,e=100){if(!(t instanceof Error))return;let r=[],n=new Set,o=t.cause,s=0;for(;o instanceof Error&&!n.has(o)&&s0?r.join(": "):void 0}a(snr,"describeCauseChain");function uot(t){let e=t instanceof Error?t.message:String(t),r=snr(t);return r?`${e} (cause: ${r})`:e}a(uot,"formatErrorWithCause");var bPe=class extends OZ{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},SPe=class extends OZ{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();async function U4n(t,e){switch(e.type){case"permission":return{success:await t.respondToPermission(e.requestId,e.result)};case"user_input":return{success:await t.respondToUserInput(e.requestId,e.response)};case"elicitation":return{success:await t.respondToElicitation(e.requestId,e.response)};case"exit_plan_mode":return{success:await t.respondToExitPlanMode(e.requestId,e.response)};case"queued_command":return{success:await t.respondToQueuedCommand(e.requestId,e.result)};case"external_tool":return{success:await t.respondToExternalTool(e.requestId,e.result)};default:throw new Error(`Unknown interaction type: ${e.type}`)}}a(U4n,"routeInteraction");p();var Q4n=new pe("BackgroundAgent.McpSync"),dot=class{constructor(e,r){this.ctx=e;this.registry=r}static{a(this,"BackgroundAgentMcpSyncTarget")}async syncToActiveSessions(e){this.registry.size()!==0&&(Q4n.info(this.ctx,"Syncing MCP servers to active sessions",{sessionCount:this.registry.size()}),await Promise.all([...this.registry.entries()].map(async([r,n])=>{let o=this.registry.getMcpDirectory(r)??this.registry.getWorkspaceFolderUri(r),s=e.buildMcpServers(o);try{await n.reloadMcpServers({mcpServers:s})}catch(c){Q4n.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:c instanceof Error?c.message:String(c)})}})))}};p();p();var Oqn=fe(require("crypto")),Lqn=fe(require("fs")),qat=fe(Nqn()),Bqn=require("tls"),Fqn=fe(Mqn());var Ahe=new pe("certificates"),bp=class{static{a(this,"RootCertificateReader")}};function jat(t,e=process.platform){return new Mar(t,[new Oar,new Lar,z2s(t,e)])}a(jat,"getRootCertificateReader");function z2s(t,e){switch(e){case"linux":return new Bar(t);case"darwin":return new Far(t);case"win32":return new Uar(t);default:return new Qar}}a(z2s,"createPlatformReader");var Nar=class extends bp{constructor(r,n){super();this.ctx=r;this.delegate=n}static{a(this,"ErrorHandlingCertificateReader")}async getAllRootCAs(){try{return await this.delegate.getAllRootCAs()}catch(r){return Ahe.warn(this.ctx,"Failed to read root certificates:",r),[]}}},Mar=class extends bp{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new Nar(r,o))}static{a(this,"CachingRootCertificateReader")}async getAllRootCAs(){return this.certificates||(this.certificates=this.removeExpiredCertificates((await Promise.all(this.delegates.map(r=>r.getAllRootCAs()))).flat())),this.certificates}removeExpiredCertificates(r){let n=Date.now(),o=r.filter(s=>{try{let c=new Oqn.X509Certificate(s),l=Date.parse(c.validTo);return isNaN(l)||l>n}catch(c){return Ahe.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&Ahe.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},Oar=class extends bp{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return Bqn.rootCertificates}},Lar=class extends bp{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await Uqn(e):[]}},Bar=class extends bp{constructor(r){super();this.ctx=r}static{a(this,"LinuxRootCertificateReader")}async getAllRootCAs(){let r=[];for(let n of["/etc/ssl/certs/ca-certificates.crt","/etc/ssl/certs/ca-bundle.crt"]){let o=await Uqn(n);Ahe.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},Far=class extends bp{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=qat.get({excludeBundled:!1,format:qat.Format.pem});return Ahe.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},Uar=class extends bp{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=Fqn.all();return Ahe.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},Qar=class extends bp{static{a(this,"UnsupportedPlatformRootCertificateReader")}getAllRootCAs(){return Promise.reject(new Error("No certificate reader available for unsupported platform"))}};async function Uqn(t){let e;try{e=await Lqn.promises.readFile(t,{encoding:"utf8"})}catch{return[]}let r=e.match(/-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/g);if(!r)return[];let n=r.filter(s=>s.length>0),o=new Set(n);return Array.from(o)}a(Uqn,"readCertsFromFile");var XH=fe(Tfr());var xfr=new pe("BackgroundAgent.ProxyEnv"),wfr=new Map,Rfr=new Set,YDe;function kfr(){for(let t of Rfr){let e=wfr.get(t);e===void 0?delete process.env[t]:process.env[t]=e}Rfr.clear(),YDe&&((0,XH.setGlobalDispatcher)(YDe),YDe=void 0)}a(kfr,"restoreProxyEnvironment");function Ifr(t,e,r){process.env[t]||process.env[e]||(wfr.has(t)||wfr.set(t,process.env[t]),process.env[t]=r,Rfr.add(t))}a(Ifr,"setEnvIfAbsent");function vqs(t,e){if(!e)return t;try{let r=new URL(t),n=e.indexOf(":"),o=n===-1?e:e.slice(0,n),s=n===-1?"":e.slice(n+1);return o&&(r.username=encodeURIComponent(o),s&&(r.password=encodeURIComponent(s))),r.toString()}catch{return t}}a(vqs,"buildProxyUrl");async function Cqs(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(bp).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{xfr.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(Cqs,"buildTlsOptions");async function qlt(t){try{kfr();let e=t.get(Qo).getHttpSettings();if(!e.proxy)return;let r=vqs(e.proxy,e.proxyAuthorization);Ifr("HTTPS_PROXY","https_proxy",r),Ifr("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&Ifr("NO_PROXY","no_proxy",n),YDe||(YDe=(0,XH.getGlobalDispatcher)());let o=await Cqs(t,e.proxyStrictSSL);(0,XH.setGlobalDispatcher)(new XH.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),xfr.info(t,"Applied proxy settings to environment for SDK",{hasProxy:!0,hasAuth:!!e.proxyAuthorization,hasNoProxy:!!n,proxyStrictSSL:e.proxyStrictSSL!==!1,hasTlsCa:!!o.requestTls,dispatcherType:(0,XH.getGlobalDispatcher)().constructor.name})}catch(e){xfr.warn(t,"Failed to apply proxy settings to environment:",e)}}a(qlt,"applyProxyToEnvironment");p();var wJn=fe(xJn());var Iqs=new pe("BackgroundAgent.Todos");async function xqs(t){let{rows:e,dependencies:r}=await t.plan.readSqlTodosWithDependencies();return wqs(e,r)}a(xqs,"readSessionTodos");function wqs(t,e){let r=a(c=>({id:c.id,title:c.title,status:c.status}),"toItem"),n=a(()=>t.map(r),"unsorted");if(t.length===0||e.length===0)return n();let o=new Map;for(let c=0;cr(t[l]))}catch{return n()}}a(wqs,"orderTodosByDependency");async function jlt(t,e,r,n){try{let o=await xqs(n);await e.sendBackgroundAgentTodosChanged({sessionId:r,todos:o}),sr(t,"backgroundAgent.todoList.changed",void 0,{todoCount:o.length})}catch(o){Iqs.warn(t,"Failed to read/emit session todos",{sessionId:r,error:o instanceof Error?o.message:String(o)})}}a(jlt,"emitTodosChanged");p();var Rqs=["read_file","view","grep_search","file_search","semantic_search","grep","rg","glob","tool_search_tool_regex","fetch_copilot_cli_documentation","think"],Hlt=["get_errors"],Dfr=[...Hlt,"edit","str_replace_editor","apply_patch"],kqs=["ask","inline-ask","inline"];function Glt(t){return t!==void 0&&kqs.includes(t)}a(Glt,"isClampedChatMode");var Pqs={ask:Rqs,inline:Dfr,"inline-ask":Hlt};async function RJn(t,e,r){let n,o,s;e==="agent"?(n=null,o=new Set(await r.getPolicyDisabledSkillNames()),s=await r.getMcpServers()):(n=[...Pqs[e]],o=new Set(await r.getAllLoadedSkillNames()),s={});let c={availableTools:n,disabledSkills:o,mcpServers:s};await t.updateOptions(c)}a(RJn,"applyChatMode");p();var tI=fe(require("node:path"));var DJn="copilot-language-server:inline-chat",Dqs=["file","path","filePath","file_path"],Nqs=new Set(["edit","create","str_replace_editor","write"]),Mqs=new Set(["git_apply_patch"]),kJn=/^\*\*\* (?:Add File|Delete File|Update File|Move to): (.+)$/gm;function Oqs(t){let e=tI.dirname(t);return{confinedFsPath:t,confinedName:tI.basename(t),baseDir:e,confinedComparable:Nfr(t,e)}}a(Oqs,"buildContext");function Lqs(t){if(typeof t=="string")try{let e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}return t&&typeof t=="object"?t:{}}a(Lqs,"parseToolArgs");function Bqs(t){if(typeof t=="string")return t;if(t&&typeof t=="object"){let e=t;if(typeof e.input=="string")return e.input;if(typeof e.patch=="string")return e.patch}}a(Bqs,"extractApplyPatchBody");function Fqs(t){if(!t.includes("*** Begin Patch"))return;let e=[];kJn.lastIndex=0;for(let r of t.matchAll(kJn)){let n=r[1].trim();n.length>0&&e.push(n)}return e}a(Fqs,"extractApplyPatchPaths");function Uqs(t){for(let e of Dqs){let r=t[e];if(typeof r=="string"&&r.trim().length>0)return r}}a(Uqs,"extractTargetPath");function Nfr(t,e){let r=t.startsWith("file:")?un(t):t,n=tI.isAbsolute(r)?tI.normalize(r):tI.resolve(e,r);return process.platform==="win32"||process.platform==="darwin"?n.toLowerCase():n}a(Nfr,"toComparablePath");function PJn(t,e){return tI.isAbsolute(t)?tI.normalize(t):tI.resolve(e,t)}a(PJn,"resolveTargetPath");function Qqs(t,e,r){if(Mqs.has(t))return{allowed:!1,reason:`Inline chat may only edit ${r.confinedName}. The ${t} tool cannot be confined to a single file and is not available in inline chat.`};if(t==="apply_patch"){let o=Bqs(e);if(o===void 0)return{allowed:!1,reason:`Inline chat denied an apply_patch call with no readable patch body. Only ${r.confinedName} may be edited.`};let s=Fqs(o);if(s===void 0)return{allowed:!1,reason:`Inline chat denied an apply_patch call whose body could not be parsed. Only ${r.confinedName} may be edited.`};if(s.length===0)return{allowed:!1,reason:`Inline chat denied an apply_patch call with no file headers. Only ${r.confinedName} may be edited.`};for(let c of s)if(Nfr(c,r.baseDir)!==r.confinedComparable)return{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${PJn(c,r.baseDir)} (apply_patch header: ${c}).`};return{allowed:!0}}if(!Nqs.has(t))return{allowed:!0};let n=Uqs(Lqs(e));return n?Nfr(n,r.baseDir)!==r.confinedComparable?{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${PJn(n,r.baseDir)} (${t} arg: ${n}).`}:{allowed:!0}:{allowed:!1,reason:`Inline chat denied a ${t} call with no resolvable file path. Only ${r.confinedName} may be edited.`}}a(Qqs,"evaluateWithContext");function NJn(t){let e=0;return{hook:{source:DJn,handler:a(()=>e>t?Promise.resolve({permissionDecision:"deny",permissionDecisionReason:`Inline chat is limited to ${t} tool-calling turns. No further tool calls are allowed.`}):Promise.resolve(),"handler")},onTurnStart(){e++},reset(){e=0}}}a(NJn,"createInlineTurnLimitHook");function MJn(t){let e=t.startsWith("file:")?un(t):t,r=Oqs(e);return{source:DJn,handler:a(n=>{let o=Qqs(n.toolName,n.toolArgs,r);return o.allowed?Promise.resolve():Promise.resolve({permissionDecision:"deny",permissionDecisionReason:o.reason??"Edit denied: inline chat is confined to the active file."})},"handler")}}a(MJn,"createInlineEditConfinementHook");p();var Mfr=fe(require("fs"));var ame=new pe("BackgroundAgent.InlineFileContext"),qqs=50*1024,$lt=100,jqs=.4,OJn=25;async function LJn(t,e,r){let n;try{n=oo(t).fsPath}catch{return ame.debug(r,`buildInlineFileContext: failed to parse URI ${t}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let o;try{o=await Mfr.promises.stat(n)}catch{return ame.debug(r,`buildInlineFileContext: failed to stat ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let s=o.size>qqs,c;try{c=await Mfr.promises.readFile(n,"utf-8")}catch{return ame.debug(r,`buildInlineFileContext: failed to read ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:s}}let l=e?.selection,u=e?.position,d="",f=!1;if(!s)d=` Here is the current content of \`${n}\`: \`\`\` ${c} -\`\`\``,f=!0;else if(l)d=jqs(c,n,l),sme.debug(r,`buildInlineFileContext: cropped large file around selection: ${n}`);else if(u)d=Hqs(c,n,u),sme.debug(r,`buildInlineFileContext: cropped large file around cursor: ${n}`);else return sme.debug(r,`buildInlineFileContext: large file (${o.size} bytes), no cursor or selection: ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!0};if(l)d+=qqs(c,n,l);else if(u){let h=Math.min(u.line,c.split(` +\`\`\``,f=!0;else if(l)d=Gqs(c,n,l),ame.debug(r,`buildInlineFileContext: cropped large file around selection: ${n}`);else if(u)d=$qs(c,n,u),ame.debug(r,`buildInlineFileContext: cropped large file around cursor: ${n}`);else return ame.debug(r,`buildInlineFileContext: large file (${o.size} bytes), no cursor or selection: ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!0};if(l)d+=Hqs(c,n,l);else if(u){let h=Math.min(u.line,c.split(` `).length-1);d+=` -The cursor is at 1-based line ${h+1}.`}return{promptFragment:d,isFullContent:f,isLargeFile:s}}a(MJn,"buildInlineFileContext");function qqs(t,e,r){let n=t.split(` +The cursor is at 1-based line ${h+1}.`}return{promptFragment:d,isFullContent:f,isLargeFile:s}}a(LJn,"buildInlineFileContext");function Hqs(t,e,r){let n=t.split(` `),o=n.length,s=Math.max(0,r.start.line),c=Math.min(o-1,r.end.line),u=n.slice(s,c+1).map((d,f)=>`${s+f+1} | ${d}`).join(` `);return` Here is the selected code in \`${e}\` (1-based lines ${s+1}-${c+1} of ${o}): \`\`\` ${u} -\`\`\``}a(qqs,"buildSelectionFragment");function jqs(t,e,r){let n=t.split(` -`),o=n.length,s=Math.max(0,r.start.line),c=Math.min(o-1,r.end.line),l=Math.max(0,s-NJn),u=Math.min(o-1,c+NJn),f=n.slice(l,u+1).map((h,m)=>`${l+m+1} | ${h}`).join(` +\`\`\``}a(Hqs,"buildSelectionFragment");function Gqs(t,e,r){let n=t.split(` +`),o=n.length,s=Math.max(0,r.start.line),c=Math.min(o-1,r.end.line),l=Math.max(0,s-OJn),u=Math.min(o-1,c+OJn),f=n.slice(l,u+1).map((h,m)=>`${l+m+1} | ${h}`).join(` `);return` Here is a portion of \`${e}\` (1-based lines ${l+1}-${u+1} of ${o}): \`\`\` ${f} -\`\`\``}a(jqs,"buildCropAroundSelectionFragment");function Hqs(t,e,r){let n=t.split(` -`),o=n.length,s=Math.min(r.line,o-1),c=Math.floor($lt*Qqs),l=$lt-c,u=Math.max(0,s-c),d=Math.min(o,s+l);u===0?d=Math.min(o,$lt):d>=o&&(u=Math.max(0,o-$lt));let h=n.slice(u,d).map((m,g)=>`${u+g+1} | ${m}`).join(` +\`\`\``}a(Gqs,"buildCropAroundSelectionFragment");function $qs(t,e,r){let n=t.split(` +`),o=n.length,s=Math.min(r.line,o-1),c=Math.floor($lt*jqs),l=$lt-c,u=Math.max(0,s-c),d=Math.min(o,s+l);u===0?d=Math.min(o,$lt):d>=o&&(u=Math.max(0,o-$lt));let h=n.slice(u,d).map((m,g)=>`${u+g+1} | ${m}`).join(` `);return` Here is a portion of \`${e}\` (1-based lines ${u+1}-${d} of ${o}, cursor at line ${s+1}): \`\`\` ${h} -\`\`\``}a(Hqs,"buildCursorCropFragment");p();p();var UJn=require("node:crypto"),au=fe(require("node:fs")),QJn=require("node:os"),Mo=fe(require("node:path"));var Gqs="@github/copilot-runtime",qJn="CLS_COPILOT_RUNTIME_ASSETS_ROOT",OJn=".extraction-complete",Mfr=".copilot-runtime-loader.cjs",LJn=`const {pathToFileURL} = require('node:url'); +\`\`\``}a($qs,"buildCursorCropFragment");p();p();var qJn=require("node:crypto"),au=fe(require("node:fs")),jJn=require("node:os"),Mo=fe(require("node:path"));var Vqs="@github/copilot-runtime",HJn="CLS_COPILOT_RUNTIME_ASSETS_ROOT",BJn=".extraction-complete",Ofr=".copilot-runtime-loader.cjs",FJn=`const {pathToFileURL} = require('node:url'); const runtimeEntrypoint = process.argv[2]; if (!runtimeEntrypoint) { @@ -3823,113 +3823,113 @@ import(pathToFileURL(runtimeEntrypoint).href).catch(error => { console.error(error instanceof Error ? error.stack || error.message : String(error)); process.exit(1); }); -`;function $qs(t=GJn()){return{shared:Gqs,platform:`@github/copilot-${t.platform}-${t.arch}`}}a($qs,"getCopilotRuntimePackageNames");function jJn(t=__dirname,e=GJn()){let r=$qs(e),n=Wqs(t);for(let o of n){let s=Mo.join(o,r.shared),c=Mo.join(o,r.platform),l=Mo.join(s,"index.js");if(!eG(l)||!eG(Mo.join(c,"package.json"))){let u=Mo.join(c,"index.js");if(eG(u)&&eG(Mo.join(c,"package.json")))return{entrypoint:u,assetsRoot:c};continue}return"pkg"in process&&(FJn(s)||FJn(c))?Vqs(s,c):{entrypoint:l,assetsRoot:c}}throw new Error(`Unable to locate Copilot runtime packages. Ensure optional dependencies are installed. Tried: ${r.shared} + ${r.platform}, or complete ${r.platform}`)}a(jJn,"resolveCopilotRuntime");function HJn(t,e={}){return e.isPkg??"pkg"in process?{path:e.execPath??process.execPath,args:[Mo.join(Mo.dirname(t),Mfr),t]}:{path:t}}a(HJn,"getCopilotRuntimeStdioConnectionOptions");function BJn(t){let e=JSON.parse(t.toString());return e.type="module",`${JSON.stringify(e,void 0,2)} -`}a(BJn,"normalizeRuntimePackageJsonForExtraction");function Vqs(t,e){let r=Mo.basename(e),n=BJn(au.readFileSync(Mo.join(t,"package.json"))),o=BJn(au.readFileSync(Mo.join(e,"package.json"))),s=(0,UJn.createHash)("sha256").update(n).update(o).update(au.readFileSync(Mo.join(t,"index.js"))).update(au.readFileSync(Mo.join(t,"app.js"))).update(LJn).digest("hex").slice(0,16),c=process.env.PKG_NATIVE_CACHE_PATH||Mo.join((0,QJn.homedir)(),".cache"),l=Mo.join(c,"pkg",`copilot-runtime-${r}-${s}`),u=Mo.join(l,Mo.basename(t)),d=Mo.join(l,r),f=Mo.join(l,OJn),h=Mo.join(u,"index.js"),m=Mo.join(u,Mfr),g=r.slice(8),A=Mo.join(d,"prebuilds",g,"runtime.node");if(eG(f)&&eG(h)&&eG(m)&&eG(A))return{entrypoint:h,assetsRoot:d};let y=`${l}.${process.pid}.${Date.now()}.tmp`,_=Mo.join(y,Mo.basename(t)),E=Mo.join(y,r);au.rmSync(y,{recursive:!0,force:!0}),au.mkdirSync(Mo.dirname(y),{recursive:!0});try{Ofr(t,_),Ofr(e,E),au.writeFileSync(Mo.join(_,"package.json"),n),au.writeFileSync(Mo.join(E,"package.json"),o),au.writeFileSync(Mo.join(_,Mfr),LJn),au.writeFileSync(Mo.join(y,OJn),""),au.rmSync(l,{recursive:!0,force:!0}),au.renameSync(y,l)}catch(v){throw au.rmSync(y,{recursive:!0,force:!0}),v}return{entrypoint:h,assetsRoot:d}}a(Vqs,"materializePkgRuntimePackages");function Ofr(t,e){au.mkdirSync(e,{recursive:!0});for(let r of au.readdirSync(t,{withFileTypes:!0})){let n=Mo.join(t,r.name),o=Mo.join(e,r.name);if(r.isDirectory()){Ofr(n,o);continue}r.isFile()&&(au.copyFileSync(n,o),process.platform!=="win32"&&au.chmodSync(o,493))}}a(Ofr,"copyDirectorySync");function FJn(t){let e=t.replace(/\\/g,"/");return e.startsWith("/snapshot/")||/^[A-Za-z]:\/snapshot\//.test(e)}a(FJn,"isPkgVirtualPath");function Wqs(t){let e=new Set,r=Mo.resolve(t);for(;;){e.add(Mo.join(r,"node_modules"));let n=Mo.dirname(r);if(n===r)break;r=n}return e.add(Mo.resolve(process.cwd(),"node_modules")),"pkg"in process&&(e.add(Mo.join(Mo.dirname(process.execPath),"node_modules")),e.add(Mo.join(Mo.dirname(process.execPath),"dist","node_modules"))),[...e]}a(Wqs,"getNodeModulesRoots");function GJn(){let t=process.arch==="arm64"?"arm64":"x64";if(process.platform==="darwin"||process.platform==="linux"||process.platform==="win32")return{platform:process.platform,arch:t};throw new Error(`Unsupported Copilot runtime platform: ${process.platform}-${process.arch}`)}a(GJn,"currentRuntimeTarget");function eG(t){try{return au.statSync(t).isFile()}catch{return!1}}a(eG,"isFile");p();var zqs=["user_input.requested","exit_plan_mode.requested"],Yqs=new Set(["assistant.usage","assistant.message","tool.execution_start","tool.execution_complete"]),Vlt=class{constructor(e){this.client=e;this.sessions=new Map}static{a(this,"CopilotSdkSessionManager")}async createSession(e){let r=VJn(),n=$Jn(e,r),o=await this.client.createSession(n.config),s=await Wlt.create(o,n.postCreatePatch,r);return this.sessions.set(s.sessionId,s),s}async getSession(e,r=!0){let n=this.sessions.get(e.sessionId);if(n)return n;if(!r)return;let o=VJn(),s=$Jn(e,o),c=await this.client.resumeSession(e.sessionId,s.config),l=await Wlt.create(c,s.postCreatePatch,o);return this.sessions.set(l.sessionId,l),l}async closeSession(e,r){let n=this.sessions.get(e);r!==void 0&&n!==r||(this.sessions.delete(e),await n?.disconnect())}async closeAllSessions(){let e=[...this.sessions.values()];this.sessions.clear();let r=await Promise.allSettled(e.map(o=>o.disconnect())),n=[];for(let o of r)o.status==="rejected"&&n.push(o.reason);if(n.length>0)throw new AggregateError(n,"Failed to disconnect one or more Copilot runtime sessions")}async deleteSession(e){this.sessions.delete(e),await this.client.deleteSession(e)}async listSessions(){return(await this.client.listSessions()).map(WJn)}async getSessionMetadata(e){let r=await this.client.getSessionMetadata(e.sessionId);return r?WJn(r):void 0}forkSession(e,r){return this.client.rpc.sessions.fork({sessionId:e,...r})}async dispose(){this.sessions.clear();let e=await this.client.stop();if(e.length>0)throw e[0]}},Wlt=class t{constructor(e){this.inner=e;this.usage={getMetrics:a(()=>this.inner.rpc.usage.getMetrics(),"getMetrics")};this.history={truncate:a(e=>this.inner.rpc.history.truncate(e),"truncate")};this.agent={select:a(e=>this.inner.rpc.agent.select(e),"select"),deselect:a(()=>this.inner.rpc.agent.deselect(),"deselect")};this.mode={set:a(e=>this.inner.rpc.mode.set(e),"set")};this.plan={readSqlTodosWithDependencies:a(()=>this.inner.rpc.plan.readSqlTodosWithDependencies(),"readSqlTodosWithDependencies")};this.commands={invoke:a(e=>this.inner.rpc.commands.invoke(e),"invoke")};this.events=[];this.eventInterestHandles=[];this.subagentParentToolCallIds=new Map;this.loadedSkills=[]}static{a(this,"CopilotSdkLocalSession")}static async create(e,r,n){let o=new t(e);try{n?n.attach(l=>o.rememberEvent(l)):o.eventListenerDispose=e.on(l=>o.rememberEvent(l));let s=await e.getEvents().catch(()=>[]);if(o.mergeHistoricalEvents(s),await o.registerInteractiveEventInterests(),Object.keys(r).length>0&&await o.updateOptions(r),!(await e.rpc.permissions.setRequired({required:!0})).success)throw new Error("Copilot runtime rejected permission event bridging");return o}catch(s){throw o.eventListenerDispose?.(),await o.releaseEventInterests().catch(()=>{}),await e.disconnect().catch(()=>{}),s}}get sessionId(){return this.inner.sessionId}get workspacePath(){return this.inner.workspacePath}on(e,r){return typeof e=="function"?this.inner.on(n=>e(this.toLocalSessionEvent(n))):e==="*"?this.inner.on(n=>r?.(this.toLocalSessionEvent(n))):this.inner.on(e,n=>r?.(this.toLocalSessionEvent(n)))}async send(e){return this.inner.send(e)}getEvents(){return[...this.events]}async notifyRemoteSteerableChanged(e){await this.inner.rpc.remote.notifySteerableChanged({remoteSteerable:e})}async updateOptions(e){let{mcpServers:r,disabledSkills:n,...o}=e,s={...o,...n!==void 0?{disabledSkills:Lfr(n)}:{}};if(Object.keys(s).length>0&&!(await this.inner.rpc.options.update(s)).success)throw new Error("Copilot runtime rejected the session option update");r!==void 0&&await this.reloadMcpServers({mcpServers:r})}async reloadMcpServers(e){await Kqs(this.inner).sendRequest("session.mcp.reloadWithConfig",{sessionId:this.inner.sessionId,config:{mcpServers:e.mcpServers??{}}})}compactHistory(){return this.inner.rpc.history.compact()}async abortManualCompaction(){return!!(await this.inner.rpc.history.abortManualCompaction()).aborted}clearPendingItems(){return this.inner.rpc.queue.clear()}async ensureSkillsLoaded(){await this.inner.rpc.skills.ensureLoaded();let e=await this.inner.rpc.skills.list();this.loadedSkills=e.skills.map(r=>({name:r.name,userInvocable:r.userInvocable,pluginName:r.pluginName}))}getLoadedSkills(){return[...this.loadedSkills]}async getPlanPath(){return(await this.inner.rpc.plan.read()).path}abort(){return this.inner.abort()}async disconnect(){this.eventListenerDispose?.(),this.eventListenerDispose=void 0;try{await this.releaseEventInterests()}finally{await this.inner.disconnect()}}async respondToPermission(e,r){return(await this.inner.rpc.permissions.handlePendingPermissionRequest({requestId:e,result:r})).success}async respondToUserInput(e,r){return(await this.inner.rpc.ui.handlePendingUserInput({requestId:e,response:r})).success}async respondToElicitation(e,r){return(await this.inner.rpc.ui.handlePendingElicitation({requestId:e,result:r})).success}async respondToExitPlanMode(e,r){return(await this.inner.rpc.ui.handlePendingExitPlanMode({requestId:e,response:r})).success}async respondToQueuedCommand(e,r){return(await this.inner.rpc.commands.respondToQueuedCommand({requestId:e,result:r})).success}async respondToExternalTool(e,r){return(await this.inner.rpc.tools.handlePendingToolCall({requestId:e,result:r})).success}rememberEvent(e){let r=this.toLocalSessionEvent(e);this.events.some(n=>n.id===r.id)||this.events.push(r)}mergeHistoricalEvents(e){let r=new Set(e.map(o=>o.id)),n=this.events.filter(o=>!r.has(o.id));this.events.length=0,this.subagentParentToolCallIds.clear();for(let o of[...e,...n])this.rememberEvent(o)}toLocalSessionEvent(e){let r=e,n=typeof r.agentId=="string"?r.agentId:void 0;if(r.type==="subagent.started"&&n){let s=r.data.toolCallId;return typeof s=="string"&&this.subagentParentToolCallIds.set(n,s),r}if(r.type==="session.idle"||r.type==="session.error")return this.subagentParentToolCallIds.clear(),r;if(!n||!Yqs.has(r.type)||typeof r.data.parentToolCallId=="string")return r;let o=this.subagentParentToolCallIds.get(n);return o?{...r,data:{...r.data,parentToolCallId:o}}:r}async registerInteractiveEventInterests(){for(let e of zqs){let{handle:r}=await this.inner.rpc.eventLog.registerInterest({eventType:e});this.eventInterestHandles.push(r)}}async releaseEventInterests(){let e=this.eventInterestHandles.splice(0);await Promise.all(e.map(r=>this.inner.rpc.eventLog.releaseInterest({handle:r})))}};function Kqs(t){let e=t.connection;if(typeof e?.sendRequest!="function")throw new Error("Copilot SDK session does not expose the internal RPC connection required for MCP reloadWithConfig");return e}a(Kqs,"getInternalRpcConnection");function $Jn(t,e){let{authInfo:r,enableStreaming:n,externalToolDefinitions:o,disabledInstructionSources:s,disabledSkills:c,hooks:l,sandboxConfig:u,tools:d,...f}=t,h={...f,gitHubToken:f.gitHubToken??r?.githubToken,streaming:n,disabledSkills:Lfr(c),hooks:l?Jqs(l):void 0,tools:[...d??[],...o??[]],onEvent:e.onEvent},m={};n!==void 0&&(m.enableStreaming=n),u!==void 0&&(m.sandboxConfig=u);let g=Lfr(s);return g!==void 0&&(m.disabledInstructionSources=g),{config:h,postCreatePatch:m}}a($Jn,"normalizeSessionOptions");function VJn(){let t=[],e;return{onEvent:a(r=>{e?e(r):t.push(r)},"onEvent"),attach:a(r=>{if(e)throw new Error("Copilot SDK session event bridge is already attached");e=r;for(let n of t.splice(0))e(n)},"attach")}}a(VJn,"createSessionEventBridge");function Jqs(t){return{onPreToolUse:t.preToolUse?ame(t.preToolUse):void 0,onPostToolUse:t.postToolUse?ame(t.postToolUse):void 0,onUserPromptSubmitted:t.userPromptSubmitted?ame(t.userPromptSubmitted):void 0,onSessionStart:t.sessionStart?ame(t.sessionStart):void 0,onSessionEnd:t.sessionEnd?ame(t.sessionEnd):void 0,onErrorOccurred:t.errorOccurred?ame(t.errorOccurred):void 0}}a(Jqs,"toSessionHooks");function ame(t){return async(e,r)=>{for(let n of t){let o=await n.handler(e);if(o!==void 0)return o}}}a(ame,"composeHookList");function Lfr(t){if(t!==void 0)return Array.isArray(t)?t:[...t]}a(Lfr,"normalizeArray");function WJn(t){return{...t,context:t.context?{...t.context,cwd:t.context.workingDirectory}:void 0}}a(WJn,"normalizeSessionMetadata");p();var zJn=require("node:crypto"),KDe=fe(require("node:fs")),gR=fe(require("node:fs/promises")),YJn=require("node:os"),mR=fe(require("node:path"));var eee=new pe("BackgroundAgent.SandboxBinaryResolver");async function KJn(t){if(!process.env.MXC_BIN_DIR)try{let e=mR.join(__dirname,"node_modules","@microsoft","mxc-sdk","bin");if(!KDe.existsSync(e)){eee.debug(t,`MXC sandbox helpers not found at ${e}`);return}if(!("pkg"in process)){process.env.MXC_BIN_DIR=e,eee.debug(t,`MXC sandbox helpers located; MXC_BIN_DIR=${e}`);return}let r=await Xqs(t,e);r&&(process.env.MXC_BIN_DIR=r,eee.debug(t,`MXC sandbox helpers extracted; MXC_BIN_DIR=${r}`))}catch(e){eee.warn(t,"Failed to resolve MXC_BIN_DIR for the local sandbox",{error:e instanceof Error?e.message:String(e)})}}a(KJn,"ensureSandboxBinDirEnv");function Zqs(){switch(process.platform){case"win32":return"wxc-exec.exe";case"darwin":return"mxc-exec-mac";default:return"lxc-exec"}}a(Zqs,"sandboxMainBinaryName");async function Xqs(t,e){if(process.arch!=="x64"&&process.arch!=="arm64"){eee.debug(t,`Local sandbox unsupported on architecture ${process.arch}; sandbox will be unavailable`);return}let r=process.arch,n=mR.join(e,r),o=Zqs(),s=mR.join(n,o);if(!KDe.existsSync(s)){eee.debug(t,`MXC sandbox helper ${r}/${o} is not available for this platform`);return}let c=(await gR.readdir(n,{withFileTypes:!0})).filter(g=>g.isFile()).sort((g,A)=>g.name.localeCompare(A.name)),l=(0,zJn.createHash)("sha256");for(let g of c)l.update(g.name).update(await gR.readFile(mR.join(n,g.name)));let u=l.digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||mR.join((0,YJn.homedir)(),".cache"),f=mR.join(d,"pkg",`mxc-sdk-${u}`),h=mR.join(f,r),m=mR.join(h,".extraction-complete");if(KDe.existsSync(m)&&KDe.existsSync(mR.join(h,o)))return f;await gR.mkdir(h,{recursive:!0});for(let g of c){let A=mR.join(h,g.name);await gR.copyFile(mR.join(n,g.name),A),process.platform!=="win32"&&await gR.chmod(A,493).catch(y=>eee.warn(t,`Failed to set executable permission for ${A}`,{error:y instanceof Error?y.message:String(y)}))}return await gR.writeFile(m,""),f}a(Xqs,"extractSandboxBinDirFromPkg");p();p();p();var tee=require("node:util");var ejs=new Map([["",{strategy:"merge-properties"}],["allowedMcpServers",{strategy:"allowlist-intersection"}],["deniedMcpServers",{strategy:"deny-wins"}],["model",{strategy:"enum-order-wins",order:["auto"]}],["permissions",{strategy:"merge-properties"}],["permissions.disableBypassPermissionsMode",{strategy:"enum-order-wins",order:["disable"]}],["remoteControl",{strategy:"enum-order-wins",order:["enabled","disabled","requireSSO"],valueKey:"mode"}],["remoteControl.mode",{strategy:"enum-order-wins",order:["enabled","disabled","requireSSO"]}],["enabledPlugins",{strategy:"deny-wins"}],["extraKnownMarketplaces",{strategy:"allowlist-intersection"}],["strictKnownMarketplaces",{strategy:"allowlist-intersection"}],["telemetry",{strategy:"most-restrictive-wins",restrictiveBooleans:{enabled:!0,lockCaptureContent:!0}}]]),JJn=new Set(["__proto__","constructor","prototype"]);function tG(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(tG,"isObject");function Bfr(t){let e=new Set;for(let r of t)if(tG(r))for(let n of Object.keys(r))JJn.has(n)||e.add(n);return e}a(Bfr,"safeKeys");function Ffr(t,e){return t.map(r=>tG(r)&&Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0)}a(Ffr,"childValues");function tjs(t,e,r){for(let n of e){let o=t.find(s=>r&&tG(s)?(0,tee.isDeepStrictEqual)(s[r],n):(0,tee.isDeepStrictEqual)(s,n));if(o!==void 0)return o}return t[0]}a(tjs,"composeEnumOrder");function rjs(t,e){if(!t.every(tG))return t[0];let r=[];for(let n of Bfr(t)){let o=e?`${e}.${n}`:n,s=Ufr(Ffr(t,n),o);s!==void 0&&r.push([n,s])}return Object.fromEntries(r)}a(rjs,"composeProperties");function njs(t){let e=t[0];if(Array.isArray(e)){if(!t.every(Array.isArray))return e;let n=[];for(let o of t)for(let s of o)n.some(c=>(0,tee.isDeepStrictEqual)(c,s))||n.push(s);return n}if(!t.every(tG))return e;let r=[];for(let n of Bfr(t)){let o=Ffr(t,n).filter(s=>typeof s=="boolean");o.includes(!1)?r.push([n,!1]):o.includes(!0)&&r.push([n,!0])}return Object.fromEntries(r)}a(njs,"composeDenyWins");function ijs(t){let e=t[0];if(Array.isArray(e)){if(!t.every(Array.isArray))return[];let r=[];for(let n of e)t.slice(1).every(o=>o.some(s=>(0,tee.isDeepStrictEqual)(s,n)))&&!r.some(o=>(0,tee.isDeepStrictEqual)(o,n))&&r.push(n);return r}if(tG(e)){if(!t.every(tG))return{};let r=[];for(let[n,o]of Object.entries(e))!JJn.has(n)&&t.slice(1).every(s=>Object.prototype.hasOwnProperty.call(s,n)&&(0,tee.isDeepStrictEqual)(s[n],o))&&r.push([n,o]);return Object.fromEntries(r)}return e}a(ijs,"composeAllowlistIntersection");function ojs(t,e,r){if(!t.every(tG))return t[0];let n=[];for(let o of Bfr(t)){let s=Ffr(t,o),c=Object.prototype.hasOwnProperty.call(r,o)?r[o]:void 0,l;if(c!==void 0){let u=s.filter(d=>typeof d=="boolean");l=u.includes(c)?c:u[0]}else l=Ufr(s,`${e}.${o}`);l!==void 0&&n.push([o,l])}return Object.fromEntries(n)}a(ojs,"composeMostRestrictive");function sjs(t,e,r){switch(t.strategy){case"merge-properties":return rjs(e,r);case"enum-order-wins":return tjs(e,t.order,t.valueKey);case"deny-wins":return njs(e);case"allowlist-intersection":return ijs(e);case"most-restrictive-wins":return ojs(e,r,t.restrictiveBooleans)}}a(sjs,"applyCompositionRule");function Ufr(t,e){let r=t.filter(s=>s!==void 0),n=r[0];if(n===void 0)return;let o=ejs.get(e);return o?sjs(o,r,e):n}a(Ufr,"mergeManagedValues");function ZJn(t){return Ufr(t,"")??{}}a(ZJn,"mergeManagedSettingsByComposition");p();var XJn=["nativeMdm","server","file"];var Qfr=require("node:util");var ay=class{constructor(e){this.sources=e;this.didChangeEmitter=new Lc;this.disposed=!1;this.current=this.mergeSources(),this.sourceSubscriptions=e.map(r=>r.onDidChange(()=>this.recompute()))}static{a(this,"ManagedSettingsService")}get(){return this.current}observe(e,r){let n=r?e:c=>c,o=r??e,s=n(this.current);return o(s),this.didChangeEmitter.event(c=>{let l=n(c);(0,Qfr.isDeepStrictEqual)(s,l)||(s=l,o(l))})}async refresh(e){return await Promise.allSettled(this.sources.map(r=>r.refresh(e))),this.recompute(),this.current}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.sourceSubscriptions)e.dispose();this.didChangeEmitter.dispose();for(let e of this.sources)e.dispose()}}recompute(){let e=this.mergeSources();(0,Qfr.isDeepStrictEqual)(this.current,e)||(this.current=e,this.didChangeEmitter.fire(e))}mergeSources(){let e=XJn.flatMap(r=>this.sources.flatMap(n=>n.channel===r&&n.current?[n.current]:[]));return ZJn(e)}};p();function T4(t){return t.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)[^/@\s]*@/g,"$1")}a(T4,"redactUrlCredentials");var I4=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredPluginError"}static{a(this,"StructuredPluginError")}},zlt=class extends I4{static{a(this,"PluginSourceNotSupportedError")}constructor(e){let r={kind:"pluginSourceNotSupported",sourceKind:e};super(`Plugin source kind '${e}' is not supported in this environment`,r),this.name="PluginSourceNotSupportedError"}},cme=class extends I4{static{a(this,"PluginCloneError")}constructor(e,r){let n=T4(e),o=T4(r instanceof Error?r.message:String(r)),s={kind:"pluginCloneFailed",cloneUrl:n,cause:o};super(o,s),this.name="PluginCloneError"}},lme=class extends I4{static{a(this,"LocalMarketplaceMissingError")}constructor(e){let r={kind:"localMarketplaceMissing",repositoryPath:e};super(`Local marketplace repository does not exist: ${e}`,r),this.name="LocalMarketplaceMissingError"}},ume=class extends I4{static{a(this,"InvalidPluginSourceError")}constructor(e,r="plugin source"){let n=T4(e),o={kind:"invalidPluginSource",source:n};super(`Invalid ${r}: ${n}`,o),this.name="InvalidPluginSourceError"}},Ylt=class extends I4{static{a(this,"MarketplaceBlockedByPolicyError")}constructor(e,r){let n=T4(r),o={kind:"marketplaceBlockedByPolicy",canonicalId:e,reference:n};super(`Marketplace is not permitted by your organization's policy: ${n}`,o),this.name="MarketplaceBlockedByPolicyError"}},Klt=class extends I4{static{a(this,"PluginBlockedByPolicyError")}constructor(e){let r={kind:"pluginBlockedByPolicy",...e&&{policyId:e}};super("Plugin has been disabled by your organization's policy and cannot be enabled",r),this.name="PluginBlockedByPolicyError"}};var ZDe=new pe("AgentOTelConfig");function nZn(t){let e=t.OTEL_EXPORTER_OTLP_ENDPOINT,r=t.OTEL_EXPORTER_OTLP_HEADERS;return e===void 0&&r===void 0?t:{...t,...e!==void 0&&{OTEL_EXPORTER_OTLP_ENDPOINT:T4(e)},...r!==void 0&&{OTEL_EXPORTER_OTLP_HEADERS:"[REDACTED]"}}}a(nZn,"redactEnvForLog");function ajs(t){return Object.fromEntries(Object.keys(t).map(e=>[e,"[REDACTED]"]))}a(ajs,"redactHeadersForLog");var cjs="http://localhost:4318";function ljs(t,e){if(!t)return;let r=t.trim().replace(/^["']|["']$/g,"");if(r)try{let n=new URL(r);return e==="grpc"?n.origin:n.href}catch{return}}a(ljs,"parseOtlpEndpoint");function eZn(t){if(t===void 0)return;let e=t.trim().toLowerCase();if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1}a(eZn,"envBool");function JDe(t){let e=t?.trim();return e||void 0}a(JDe,"normalizeOptionalString");function tZn(t){let e={};if(!t)return e;for(let r of t.split(",")){let n=r.indexOf("=");if(n<=0)continue;let o=r.slice(0,n).trim(),s=r.slice(n+1).trim();o&&(e[o]=s)}return e}a(tZn,"parseStringRecordEnv");function iZn(t){let e=Object.entries(t);return e.length>0?e.map(([r,n])=>`${r}=${n}`).join(","):void 0}a(iZn,"formatStringRecordEnv");function rZn(t){if(t==="otlp-http"||t==="otlp-grpc"||t==="console"||t==="file")return t}a(rZn,"normalizeExporterType");function ujs(t){try{return t.get(ay).get().telemetry}catch(e){if(e instanceof Ic&&e.ctor===ay)return;throw e}}a(ujs,"getManagedTelemetry");function djs(t){return t.managedEnabled!==void 0?t.managedEnabled:t.envEnabled!==void 0?t.envEnabled:t.settingEnabled===!0||t.hasManagedOtlpEndpoint||t.hasEndpointEnv}a(djs,"resolveEnabled");function fjs(t){if(t.managedOtlpEndpoint===void 0)return t.envFileExporterPath||t.settingOutfile||void 0}a(fjs,"resolveFileExporterPath");function Jlt(t,e=process.env){let r=ujs(t),n=JDe(r?.endpoint),o=JDe(r?.protocol),s=kt(t,ze.OtelEnabled),c=kt(t,ze.OtelEndpoint),l=kt(t,ze.OtelCaptureContent),u=kt(t,ze.OtelExporterType),d=kt(t,ze.OtelProtocol),f=kt(t,ze.OtelOutfile),h=kt(t,ze.OtelServiceName),m=kt(t,ze.OtelResourceAttributes),g=eZn(e.COPILOT_OTEL_ENABLED),A=!!e.COPILOT_OTEL_ENDPOINT||!!e.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||!!e.OTEL_EXPORTER_OTLP_ENDPOINT,y=djs({managedEnabled:r?.enabled,envEnabled:g,settingEnabled:s,hasManagedOtlpEndpoint:n!==void 0,hasEndpointEnv:A}),_=e.COPILOT_OTEL_FILE_EXPORTER_PATH||void 0,E=fjs({managedOtlpEndpoint:n,envFileExporterPath:_,settingOutfile:f}),v=o??e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL??(u==="otlp-grpc"?"grpc":d||void 0),S=v==="grpc"?"grpc":"http",T=S==="grpc"?"grpc":v==="http/protobuf"?"http/protobuf":"http/json",w=rZn(e.COPILOT_OTEL_EXPORTER_TYPE),R=rZn(u),x;n!==void 0?x=S==="grpc"?"otlp-grpc":"otlp-http":w?x=w:_||f&&R!=="console"?x="file":R?x=R:x=S==="grpc"?"otlp-grpc":"otlp-http";let k=n||e.COPILOT_OTEL_ENDPOINT||e.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||e.OTEL_EXPORTER_OTLP_ENDPOINT||c||cjs,D=ljs(k,S)??"",N=(r?.lockCaptureContent===!0?r.captureContent:void 0)??eZn(e.OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT)??l??!1,O=JDe(r?.serviceName)??JDe(e.OTEL_SERVICE_NAME)??JDe(h),B=r?.resourceAttributes??(e.OTEL_RESOURCE_ATTRIBUTES!==void 0?tZn(e.OTEL_RESOURCE_ATTRIBUTES):m)??{},q={...tZn(e.OTEL_EXPORTER_OTLP_HEADERS),...r?.headers??{}},M={enabled:!!y,exporterType:x,otlpEndpoint:D,otlpProtocol:T,captureContent:!!N,...O!==void 0&&{serviceName:O},resourceAttributes:B,headers:q,managedOtlpEndpoint:n!==void 0,fileExporterPath:x==="file"?E:void 0};return ZDe.debug(t,"Resolved agent OTel configuration",{config:{...M,otlpEndpoint:T4(M.otlpEndpoint),headers:ajs(M.headers)}}),M}a(Jlt,"resolveAgentOTelConfig");function oZn(t,e,r=process.env){if(!e.enabled)return{};let n={COPILOT_OTEL_ENABLED:"true"};e.captureContent&&(n.OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT="true"),e.serviceName&&(n.OTEL_SERVICE_NAME=e.serviceName);let o=iZn(e.resourceAttributes);return o&&(n.OTEL_RESOURCE_ATTRIBUTES=o),e.exporterType==="file"&&e.fileExporterPath?(n.COPILOT_OTEL_EXPORTER_TYPE="file",n.COPILOT_OTEL_FILE_EXPORTER_PATH=e.fileExporterPath):e.otlpEndpoint&&(n.OTEL_EXPORTER_OTLP_ENDPOINT=e.otlpEndpoint,e.otlpProtocol!=="grpc"&&(n.OTEL_EXPORTER_OTLP_PROTOCOL=e.otlpProtocol)),ZDe.debug(t,"Copilot CLI OTel env",{env:nZn(n)}),n}a(oZn,"deriveCopilotCliOTelEnv");function sZn(t,e,r=process.env){if(!e.enabled)return{};if(!e.otlpEndpoint)return ZDe.warn(t,"Claude OTel: no valid OTLP endpoint; skipping telemetry env"),{};(e.exporterType==="file"||e.exporterType==="console")&&ZDe.debug(t,`Claude OTel: exporterType='${e.exporterType}' is not supported by Claude; exporting over OTLP to ${T4(e.otlpEndpoint)} instead`);let n={CLAUDE_CODE_ENABLE_TELEMETRY:"1",OTEL_METRICS_EXPORTER:"otlp",OTEL_LOGS_EXPORTER:"otlp",OTEL_EXPORTER_OTLP_ENDPOINT:e.otlpEndpoint,OTEL_EXPORTER_OTLP_PROTOCOL:e.otlpProtocol};e.serviceName&&(n.OTEL_SERVICE_NAME=e.serviceName);let o=iZn(e.resourceAttributes);return o&&(n.OTEL_RESOURCE_ATTRIBUTES=o),e.captureContent&&(n.OTEL_LOG_USER_PROMPTS="1",n.OTEL_LOG_TOOL_DETAILS="1"),ZDe.debug(t,"Claude OTel env",{env:nZn(n)}),n}a(sZn,"deriveClaudeOTelEnv");var aZn=require("node:module");var Zlt=new pe("BackgroundAgent.ManagerLifecycle"),pjs=["COPILOT_OTEL_ENABLED","COPILOT_OTEL_EXPORTER_TYPE","COPILOT_OTEL_FILE_EXPORTER_PATH","COPILOT_OTEL_ENDPOINT","OTEL_EXPORTER_OTLP_ENDPOINT","OTEL_EXPORTER_OTLP_TRACES_ENDPOINT","OTEL_EXPORTER_OTLP_PROTOCOL","OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT","OTEL_SERVICE_NAME","OTEL_RESOURCE_ATTRIBUTES"];function hjs(){return(0,aZn.createRequire)(__filename)("@github/copilot-sdk")}a(hjs,"importSdk");function mjs(t,e,r){let n=Jlt(t,e),o={...e,COPILOT_CLI_RUN_AS_NODE:"1",GITHUB_COPILOT_INTEGRATION_ID:AWe(t.get(Ir))??"jetbrains-chat",[qJn]:r};for(let s of pjs)delete o[s];return Object.assign(o,oZn(t,n,e)),n.enabled&&n.managedOtlpEndpoint&&delete o.OTEL_EXPORTER_OTLP_HEADERS,delete o.COPILOT_RUNTIME_OOP,delete o.NAPI_OOP_SOCKET,o}a(mjs,"buildCopilotRuntimeEnvironment");var Xlt=class{constructor(e){this.ctx=e}static{a(this,"ManagerLifecycle")}async ensureManager(){if(this.manager)return this.manager;this.managerInitPromise||(this.managerInitPromise=this.initManager());try{await this.managerInitPromise}catch(e){throw this.managerInitPromise=void 0,e}if(!this.manager)throw new Error("Copilot SDK initialization succeeded but manager is undefined");return this.manager}getSdk(){return this.sdk}async closeSession(e,r){await this.manager?.closeSession(e,r)}async closeAllSessions(){if(this.manager)try{await this.manager.closeAllSessions()}catch(e){Zlt.warn(this.ctx,"Failed to disconnect one or more runtime sessions during user-state cleanup",{error:String(e)})}}async dispose(){this.manager?(await this.manager.dispose(),this.manager=void 0):this.client&&await this.client.stop(),this.client=void 0,this.sdk=void 0,this.managerInitPromise=void 0}setStubManagerForTesting(e){this.manager=e}setStubSdkForTesting(e){this.sdk={AUTO_MODEL_ID:"auto",...e}}async initManager(){Zlt.info(this.ctx,"Initializing CopilotClient (runtime SDK)...");let e=performance.now(),r;try{r=hjs(),this.sdk={...r,AUTO_MODEL_ID:"auto"},sr(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-e})}catch(c){throw Hs(this.ctx,"backgroundAgent.importSdk",c,{status_text:"failure"},{duration_ms:performance.now()-e}),c}await KJn(this.ctx),await qlt(this.ctx);let n=jJn();Zlt.info(this.ctx,"Resolved Copilot runtime packages",n);let o=HJn(n.entrypoint),s=new r.CopilotClient({connection:r.RuntimeConnection.forStdio(o),useLoggedInUser:!1,env:mjs(this.ctx,process.env,n.assetsRoot)});try{await s.start()}catch(c){throw await s.stop(),c}this.client=s,this.manager=new Vlt(s),Zlt.info(this.ctx,"CopilotClient initialized.")}};p();p();var eut="/agents/sessions",tut=class{constructor(e,r,n){this.ctx=e;this.logger=r;this.opts=n;this.fetchImpl=n.fetch??fetch}static{a(this,"MissionControlApiClient")}async createSession(e,r,n){let o=await this.buildUrl(eut),s=await this.buildHeaders();s["Content-Type"]="application/json";let c=Date.now();this.logger.info(this.ctx,`MissionControl POST ${o}`,{ownerId:e,repoId:r,agentTaskId:n,integrationId:this.opts.integrationId});let l=await this.fetchWithTimeout(o,{method:"POST",headers:s,body:JSON.stringify({owner_id:e,repo_id:r,agent_task_id:n})});if(!l.ok){let f=await cZn(l);throw this.logger.warn(this.ctx,`MissionControl createSession \u2190 ${l.status} ${l.statusText}`,{durationMs:Date.now()-c,body:f.slice(0,500)}),new Error(`MissionControl createSession failed: ${l.status} ${l.statusText} ${f}`)}let u=await l.json();if(typeof u.id!="string")throw new Error("MissionControl createSession: response missing id");let d=typeof u.task_id=="string"?u.task_id:u.id;return this.logger.info(this.ctx,"MissionControl createSession \u2190 200",{durationMs:Date.now()-c,mcSessionId:u.id,mcTaskId:d}),{id:u.id,taskId:d}}async submitEvents(e,r,n){let o=await this.buildUrl(`${eut}/${encodeURIComponent(e)}/events`),s=Date.now();this.logger.info(this.ctx,`MissionControl POST ${o}`,{eventCount:r.length,ackCount:n.length,eventTypes:r.slice(0,10).map(c=>c.type)});try{let c=await this.buildHeaders();c["Content-Type"]="application/json";let l={events:r};n.length>0&&(l.completed_command_ids=n);let u=await this.fetchWithTimeout(o,{method:"POST",headers:c,body:JSON.stringify(l)});if(!u.ok){let d=await cZn(u);return this.logger.warn(this.ctx,`MissionControl submitEvents \u2190 ${u.status} ${u.statusText}`,{durationMs:Date.now()-s,body:d.slice(0,500)}),!1}return this.logger.info(this.ctx,"MissionControl submitEvents \u2190 200",{durationMs:Date.now()-s,eventCount:r.length,ackCount:n.length}),!0}catch(c){return this.logger.warn(this.ctx,`MissionControl submitEvents error: ${c instanceof Error?c.message:String(c)}`,{durationMs:Date.now()-s}),!1}}async getPendingCommands(e){let r=await this.buildUrl(`${eut}/${encodeURIComponent(e)}/commands`),n=Date.now();try{let o=await this.buildHeaders(),s=await this.fetchWithTimeout(r,{method:"GET",headers:o});if(!s.ok)return this.logger.warn(this.ctx,`MissionControl GET ${r} \u2190 ${s.status} ${s.statusText}`,{durationMs:Date.now()-n}),[];let c=await s.json(),l=Array.isArray(c.commands)?c.commands:[];return l.length>0?this.logger.info(this.ctx,`MissionControl GET ${r} \u2190 200`,{durationMs:Date.now()-n,commandCount:l.length,commandIds:l.map(u=>u.id)}):this.logger.debug(this.ctx,`MissionControl GET ${r} \u2190 200 (no commands)`,{durationMs:Date.now()-n}),l}catch(o){return this.logger.warn(this.ctx,`MissionControl getPendingCommands error: ${o instanceof Error?o.message:String(o)}`,{durationMs:Date.now()-n}),[]}}async deleteSession(e){let r=await this.buildUrl(`${eut}/${encodeURIComponent(e)}/`),n=Date.now();this.logger.info(this.ctx,`MissionControl DELETE ${r}`);try{let o=await this.buildHeaders(),s=await this.fetchWithTimeout(r,{method:"DELETE",headers:o});this.logger.info(this.ctx,`MissionControl DELETE ${r} \u2190 ${s.status}`,{durationMs:Date.now()-n})}catch(o){this.logger.warn(this.ctx,`MissionControl deleteSession error: ${o instanceof Error?o.message:String(o)}`,{durationMs:Date.now()-n})}}async buildUrl(e){return`${(await this.opts.getApiBase()).replace(/\/+$/,"")}${e.startsWith("/")?e:`/${e}`}`}async buildHeaders(){return{Authorization:`Bearer ${await this.opts.getAuthToken()}`,"Copilot-Integration-Id":this.opts.integrationId,Accept:"application/json","User-Agent":"GitHubCopilotChat/0.0.0"}}async fetchWithTimeout(e,r){let n=new AbortController,o=setTimeout(()=>n.abort(),1e4);try{return await this.fetchImpl(e,{...r,signal:n.signal})}finally{clearTimeout(o)}}};async function cZn(t){try{return await t.text()}catch{return""}}a(cZn,"safeReadText");p();p();var rut=class{constructor(e){this.opts=e;this.failureCount=0;this.state=0;this.nextRetryAt=0;this.currentTimeoutMs=e.resetTimeoutMs}static{a(this,"CircuitBreaker")}canRequest(){return this.state===0?!0:this.state===1&&Date.now()>=this.nextRetryAt?(this.state=2,!0):this.state===2}recordSuccess(){this.failureCount=0,this.state=0,this.currentTimeoutMs=this.opts.resetTimeoutMs}recordFailure(){this.failureCount++,(this.state===2||this.failureCount>=this.opts.failureThreshold)&&(this.state=1,this.nextRetryAt=Date.now()+this.currentTimeoutMs,this.currentTimeoutMs=Math.min(this.currentTimeoutMs*2,this.opts.maxResetTimeoutMs))}getState(){return this.state}getFailureCount(){return this.failureCount}get name(){return this.opts.name}};p();var gjs=new Set(["assistant.message_delta","assistant.streaming_delta","session.shutdown","session.error","session.usage_info","assistant.usage","pending_messages.modified","session.mcp_server_status_changed","session.mcp_servers_loaded","session.skills_loaded","session.tools_updated"]);function lZn(t){return!(!t.type||gjs.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(lZn,"shouldForwardMissionControlEvent");function qfr(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a(qfr,"getMissionControlEventData");var fZn=require("node:crypto");var Ajs=500,yjs=3e3,_js=1e4,Ejs=500,XDe=2e3;function vjs(t){return t.approved?{kind:t.scope==="session"?"approve-for-session":"approve-once"}:{kind:"denied-interactively-by-user",...t.feedback?{feedback:t.feedback}:{}}}a(vjs,"toPermissionResponseResult");var Cjs=256,uZn=80,nut=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new rut({failureThreshold:5,resetTimeoutMs:1e3,maxResetTimeoutMs:3e4,name:"mc-events"})}static{a(this,"MissionControlRemoteDelegate")}async enable(){if(this.state&&!this.state.disposed)return{url:this.state.frontendUrl,remoteSteerable:!0};let{workingDir:e,getGithubToken:r,client:n,logger:o,ctx:s}=this.remoteCtx,c=await svn(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await avn(c,l);if(!u)throw new Error("Mission Control: repo_id_resolution_failed");let d=`${Date.now()}-${Math.random().toString(36).slice(2,10)}`,f=await n.createSession(u.ownerId,u.repoId,d),h={mcSessionId:f.id,mcTaskId:f.taskId,nwo:c,frontendUrl:`https://github.com/${c.owner}/${c.repo}/tasks/${f.taskId}`,eventBuffer:[],completedCommandIds:[],toolCallIdToRequestId:new Map,lastEventId:null,lastSubmitAttemptTimeMs:Date.now(),processedCommandIds:new Set,disposed:!1,titleSent:!!this.remoteCtx.sessionTitle,flushInFlight:!1,pollInFlight:!1};this.state=h;let m=Sjs(e);h.eventBuffer.push(this.createEvent(h,"session.start",{sessionId:h.mcSessionId,version:1,producer:"copilot-developer-cli",copilotVersion:"1.0.0",startTime:new Date().toISOString(),remoteSteerable:!0,context:{cwd:m,gitRoot:m,repository:`${c.owner}/${c.repo}`}}));let g=new Set(["user.message","assistant.message","assistant.turn_start","assistant.turn_end","tool.execution_start","tool.execution_complete"]);try{let A=Array.from(this.sdkSession.getEvents()),y=0;for(let _ of A)_.type&&g.has(_.type)&&(this.bufferEvent(h,_),y++);o.info(s,`Mission Control replayed ${y}/${A.length} historical events`)}catch(A){o.warn(s,`Mission Control history replay failed: ${ree(A)}`)}try{let A=this.sdkSession.on("*",y=>{!this.state||this.state.disposed||this.bufferEvent(this.state,y)});h.eventListenerDispose=typeof A=="function"?A:void 0,o.info(s,"Mission Control listener attached")}catch(A){o.warn(s,`Mission Control session.on('*') failed: ${ree(A)}`)}try{await this.sdkSession.notifyRemoteSteerableChanged(!0)}catch(A){o.warn(s,`runtime remote steerable notification failed: ${ree(A)}`)}return this.remoteCtx.sessionTitle&&h.eventBuffer.push(this.createEvent(h,"session.title_changed",{title:this.remoteCtx.sessionTitle},!0)),await this.flush(),h.flushInterval=setInterval(()=>{this.flush().catch(A=>o.warn(s,`mc flush err: ${A}`))},Ajs),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},yjs),o.info(s,`Mission Control enabled for session ${this.sessionId}`,{mcSessionId:f.id,mcTaskId:f.taskId,url:h.frontendUrl}),{url:h.frontendUrl,remoteSteerable:!0}}async disable(){let e=this.state;if(!(!e||e.disposed)){e.pollInterval&&clearInterval(e.pollInterval),e.flushInterval&&clearInterval(e.flushInterval),e.eventListenerDispose?.(),e.eventListenerDispose=void 0,e.toolCallIdToRequestId.clear();try{await this.sdkSession.notifyRemoteSteerableChanged(!1)}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`runtime remote steerable notification failed: ${ree(r)}`)}e.eventBuffer.push(this.createEvent(e,"session.remote_steerable_changed",{remoteSteerable:!1})),e.eventBuffer.push(this.createEvent(e,"session.idle",{})),await this.flush(),e.disposed=!0,this.remoteCtx.logger.info(this.remoteCtx.ctx,`Mission Control disabled for session ${this.sessionId}`)}}getMcSessionId(){return this.state?.mcSessionId}async deleteRemote(){let e=this.state?.mcSessionId;e&&await this.remoteCtx.client.deleteSession(e)}getStatus(){let e=this.state;return!e||e.disposed?{remoteSteerable:!1}:{url:e.frontendUrl,remoteSteerable:!0}}createEvent(e,r,n,o){let s=(0,fZn.randomUUID)(),c={id:s,timestamp:new Date().toISOString(),parentId:e.lastEventId??null,type:r,data:n,...o!==void 0?{ephemeral:o}:{}};return e.lastEventId=s,c}bufferEvent(e,r){if(!lZn(r))return;this.trackInteractionRequestId(e,r),this.maybeAutoDeriveTitle(e,r);let n=r.id,o=r.timestamp,s=r.parentId,c=r.ephemeral;typeof n=="string"&&typeof o=="string"?(e.eventBuffer.push({id:n,timestamp:o,parentId:typeof s=="string"?s:e.lastEventId??null,...typeof c=="boolean"?{ephemeral:c}:{},type:r.type??"unknown",data:qfr(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",qfr(r))),e.eventBuffer.length>XDe&&e.eventBuffer.splice(0,e.eventBuffer.length-XDe)}maybeAutoDeriveTitle(e,r){if(e.titleSent)return;if(r.type==="session.title_changed"){e.titleSent=!0;return}if(r.type!=="user.message")return;let n=r.data?.content,o=bjs(typeof n=="string"?n:"");o&&(e.eventBuffer.push(this.createEvent(e,"session.title_changed",{title:o},!0)),e.titleSent=!0)}trackInteractionRequestId(e,r){let n=r.data;if(n)switch(r.type){case"permission.requested":{let o=n.requestId,s=n.permissionRequest?.toolCallId;typeof o=="string"&&typeof s=="string"&&this.registerInteractionMapping(e,s,o);return}case"user_input.requested":{let o=n.requestId,s=n.toolCallId;typeof o=="string"&&typeof s=="string"&&this.registerInteractionMapping(e,s,o);return}case"permission.completed":{let o=n.toolCallId;typeof o=="string"&&e.toolCallIdToRequestId.delete(o);return}case"user_input.completed":{let o=n.requestId;if(typeof o=="string"){for(let[s,c]of e.toolCallIdToRequestId)if(c===o){e.toolCallIdToRequestId.delete(s);break}}return}}}registerInteractionMapping(e,r,n){if(e.toolCallIdToRequestId.size>=Cjs){let o=e.toolCallIdToRequestId.keys().next().value;o!==void 0&&e.toolCallIdToRequestId.delete(o)}e.toolCallIdToRequestId.set(r,n)}async flush(){let e=this.state;if(!e||e.disposed||e.flushInFlight)return;if(!this.circuitBreaker.canRequest()){e.eventBuffer.length>XDe&&e.eventBuffer.splice(0,e.eventBuffer.length-XDe);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=_js;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,Ejs);e.lastSubmitAttemptTimeMs=Date.now();try{await this.remoteCtx.client.submitEvents(e.mcSessionId,c,s)?this.circuitBreaker.recordSuccess():(this.circuitBreaker.recordFailure(),e.eventBuffer.length+c.length<=XDe&&e.eventBuffer.unshift(...c),e.completedCommandIds.unshift(...s))}finally{e.flushInFlight=!1}}async poll(){let e=this.state;if(!(!e||e.disposed)&&!e.pollInFlight){e.pollInFlight=!0;try{let r=await this.remoteCtx.client.getPendingCommands(e.mcSessionId),n=new Set(r.map(o=>o.id));for(let o of e.processedCommandIds)n.has(o)||e.processedCommandIds.delete(o);for(let o of r){if(o.state!=="in_progress"||e.processedCommandIds.has(o.id))continue;e.processedCommandIds.add(o.id);let s=typeof o.content=="string"?o.content.length>120?o.content.slice(0,120)+"\u2026":o.content:"";this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch start: id=${o.id} type=${o.type??""} preview=${JSON.stringify(s)}`);let c=!1;try{await this.dispatchCommand(e,o),c=o.type===void 0||o.type===""||o.type==="user_message",this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch ok: id=${o.id} type=${o.type??""}`)}catch(l){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc dispatch ${o.type??"user_message"} failed: ${ree(l)}`)}(c||o.type!==void 0&&o.type!==""&&o.type!=="user_message")&&e.completedCommandIds.push(o.id)}}finally{e.pollInFlight=!1}}}async dispatchCommand(e,r){switch(r.type){case"abort":{await this.sdkSession.abort?.();return}case"permission_response":{let n=dZn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s=vjs(n);try{await this.sdkSession.respondToPermission(o,s)||this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc permission_response did not match a pending request (promptId=${n.promptId}, requestId=${o})`)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc permission_response forward failed (promptId=${n.promptId}, requestId=${o}): ${ree(c)}`)}return}case"ask_user_response":{let n=dZn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s={answer:typeof n.answer=="string"?n.answer:"",wasFreeform:n.wasFreeform===!0};try{await this.sdkSession.respondToUserInput(o,s)||this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc ask_user_response did not match a pending request (promptId=${n.promptId}, requestId=${o})`)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc ask_user_response forward failed (promptId=${n.promptId}, requestId=${o}): ${ree(c)}`)}return}case"mode_switch":{this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc mode_switch ignored (cmd ${r.id})`);return}default:{await this.remoteCtx.injectUserMessage(this.sessionId,r.content);return}}}};function dZn(t){try{return JSON.parse(t)}catch{return}}a(dZn,"safeJsonParse");function ree(t){return t instanceof Error?t.message:String(t)}a(ree,"errMsg");function bjs(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>uZn?e.slice(0,uZn-1).trimEnd()+"\u2026":e:""}a(bjs,"deriveTitleFromMessage");function Sjs(t){if(/^[a-zA-Z]:[\\/]/.test(t)){let r=t[0],n=t.slice(2).replace(/\\/g,"/").replace(/^\/+/,""),o=`/${r.toLowerCase()}:/${n}`,s=`file:///${r.toLowerCase()}%3A/${encodeURI(n).replace(/%2F/g,"/")}`;return{$mid:1,fsPath:t,_sep:1,external:s,path:o,scheme:"file"}}return{$mid:1,fsPath:t,external:`file://${encodeURI(t).replace(/%2F/g,"/")}`,path:t,scheme:"file"}}a(Sjs,"toVscodeUriShape");var jfr=new pe("BackgroundAgent.RemoteController"),iut=class{constructor(e,r){this.ctx=e;this.deps=r;this.delegates=new Map;this.remoteStatuses=new Map;this.registeredStatusCleanups=new Set}static{a(this,"RemoteController")}attachLazy(e,r){let n=this.delegates.get(e);if(n)return n;let o=this.deps.registry.getWorkingDir(e);if(!o)throw new Error(`Mission Control: working directory unknown for session ${e}; cannot attach delegate.`);let s=new tut(this.ctx,jfr,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new nut(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:jfr,ctx:this.ctx,injectUserMessage:a((l,u)=>this.deps.injectUserMessage(l,u),"injectUserMessage")});return this.delegates.set(e,c),this.deps.registry.registerChild(e,{dispose:a(()=>this.fireAndForgetTearDown(e),"dispose")}),c}async enableForSession(e,r){let o=await this.attachLazy(e,r).enable();return this.remoteStatuses.set(e,o),this.registerStatusCleanup(e),o}async disableForSession(e){let r=this.delegates.get(e.sessionId);r&&(await r.disable(),this.remoteStatuses.set(e.sessionId,{remoteSteerable:!1}))}getStatus(e){let r=this.remoteStatuses.get(e);if(r)return r;let n=this.delegates.get(e);return n?n.getStatus():{remoteSteerable:!1}}delegateCount(){return this.delegates.size}fireAndForgetTearDown(e){let r=this.delegates.get(e);r&&(this.delegates.delete(e),this.remoteStatuses.delete(e),r.disable().catch(()=>{}))}async tearDownForDestroy(e){let r=this.delegates.get(e);if(r){try{await r.disable()}catch{}try{await r.deleteRemote()}catch(n){jfr.warn(this.ctx,"Mission Control deleteSession failed during destroySession",{sessionId:e,error:n instanceof Error?n.message:String(n)})}this.delegates.delete(e),this.remoteStatuses.delete(e)}}registerStatusCleanup(e){this.registeredStatusCleanups.has(e)||(this.registeredStatusCleanups.add(e),this.deps.registry.registerChild(e,{dispose:a(()=>{this.remoteStatuses.delete(e),this.registeredStatusCleanups.delete(e)},"dispose")}))}async getMissionControlApiBase(){let n=(await this.ctx.get(Qt).getToken()).endpoints.api;if(!n)throw new Error("Copilot API endpoint not available");return n}async getGithubAccessToken(){let e=await this.ctx.get(Fr).resolveSession();if(!e?.accessToken)throw new Error("Not authenticated");return e.accessToken}getCopilotIntegrationId(){return"vscode-chat"}addDelegateForTesting(e,r){this.delegates.set(e,r),this.deps.registry.registerChild(e,{dispose:a(()=>this.fireAndForgetTearDown(e),"dispose")})}delegatesForTesting(){return this.delegates}};p();p();var Hfr=new pe("BackgroundAgent.CustomAgents");async function pZn(t,e){try{if(kt(t,ze.EnableCustomAgents)===!1)return Hfr.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get(Yd).listCustomAgents([e],{includePlugins:!0});return o.length>0&&Hfr.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>Tjs(s))}catch(r){return Hfr.warn(t,"Failed to load custom agents:",r),[]}}a(pZn,"loadCustomAgents");function Tjs(t){let e=t.instruction??"";return{name:t.name,displayName:t.name,description:t.description??"",tools:xjs(t.tools),prompt:e,infer:!0,model:t.model}}a(Tjs,"toSweCustomAgent");var Ijs=new Map([["semantic_search",["grep","rg","glob","view"]],["read_file",["view"]],["list_dir",["glob"]],["file_search",["glob"]],["grep_search",["grep","rg"]],["insert_edit_into_file",["edit","str_replace_editor","apply_patch"]],["replace_string_in_file",["edit","str_replace_editor","apply_patch"]],["create_file",["create"]],["run_in_terminal",["bash","powershell"]],["get_terminal_output",["read_bash","read_powershell"]],["run_subagent",["task"]],["manage_todo_list",["update_todo"]],["validate_cves",["gh-advisory-database"]],["ask_questions",["ask_user"]]]);function xjs(t){if(t===void 0)return null;let e=[],r=new Set;for(let n of t){let s=Ijs.get(n)??[n];for(let c of s)r.has(c)||(r.add(c),e.push(c))}return e}a(xjs,"mapCustomAgentTools");p();var eNe=new pe("BackgroundAgent.Hooks"),tNe="copilot-language-server";function hZn(t,e){return{sessionStart:[wjs(t,e)],sessionEnd:[Rjs(t,e)],preToolUse:[kjs(t,e)],postToolUse:[Pjs(t,e)],userPromptSubmitted:[Djs(t,e)]}}a(hZn,"buildSessionHooks");function wjs(t,e){return{source:tNe,handler:a(async r=>{try{await t.get(D0).hook(t,VF,{timestamp:nNe(r.timestamp),cwd:r.workingDirectory,source:r.source,...r.initialPrompt!==void 0&&{initialPrompt:r.initialPrompt}},e)}catch(n){eNe.error(t,"Failed to execute SessionStart hook",n)}},"handler")}}a(wjs,"createSessionStartHandler");function Rjs(t,e){return{source:tNe,handler:a(async r=>{try{await t.get(D0).hook(t,$F,{timestamp:nNe(r.timestamp),cwd:r.workingDirectory,reason:r.reason},e)}catch(n){eNe.error(t,"Failed to execute SessionEnd hook",n)}},"handler")}}a(Rjs,"createSessionEndHandler");function kjs(t,e){return{source:tNe,handler:a(async r=>{try{let o=await t.get(D0).hook(t,N2,{timestamp:nNe(r.timestamp),cwd:un(e.uri),toolName:r.toolName,toolArgs:rNe(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===Kde.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){eNe.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(kjs,"createPreToolUseHandler");function Pjs(t,e){return{source:tNe,handler:a(async r=>{try{await t.get(D0).hook(t,D2,{timestamp:nNe(r.timestamp),cwd:un(e.uri),toolName:r.toolName,toolArgs:rNe(r.toolArgs),toolResult:{resultType:Gfr(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){eNe.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(Pjs,"createPostToolUseHandler");function Djs(t,e){return{source:tNe,handler:a(async r=>{try{await t.get(D0).hook(t,M2,{timestamp:nNe(r.timestamp),cwd:un(e.uri),prompt:r.prompt},e);return}catch(n){eNe.error(t,"Failed to execute UserPromptSubmitted hook",n);return}},"handler")}}a(Djs,"createUserPromptSubmittedHandler");function rNe(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(rNe,"safeStringifyToolArgs");function Gfr(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a(Gfr,"toClsToolResultType");function nNe(t){return t instanceof Date?t.getTime():t}a(nNe,"toHookTimestamp");p();var Njs=["model-agents-md","cwd-model-agents-md"],Mjs=["model-claude-md","cwd-model-claude-md"],Ojs="nested-agents";function mZn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of Njs)e.add(r);if(t.useClaudeMdFile===!1)for(let r of Mjs)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(Ojs),e}a(mZn,"computeDisabledInstructionSources");var Ljs=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),Bjs=2,Fjs="CLAUDE.md",Ujs="AGENTS.md";function Qjs(t,e){if(e.length===0)return t;let r=t.includes("\\")&&!t.includes("/")?"\\":"/";return[t.endsWith("/")||t.endsWith("\\")?t.slice(0,-1):t,...e].join(r)}a(Qjs,"joinPath");async function qjs(t,e,r){let n=[],o=a(async(s,c)=>{let l;try{l=await t(Qjs(e,s))}catch{return}for(let[u,d]of l){let f=(d&1)!==0,h=(d&2)!==0;f&&u===r&&s.length>0?n.push([...s,r].join("/")):h&&co.content.trim().length>0);if(r.length===0)return;let n=r.map(o=>[`<${e}-instructions path="${o.relativePath}">`,o.content.trim(),``].join(` +`;function Wqs(t=VJn()){return{shared:Vqs,platform:`@github/copilot-${t.platform}-${t.arch}`}}a(Wqs,"getCopilotRuntimePackageNames");function GJn(t=__dirname,e=VJn()){let r=Wqs(e),n=Yqs(t);for(let o of n){let s=Mo.join(o,r.shared),c=Mo.join(o,r.platform),l=Mo.join(s,"index.js");if(!eG(l)||!eG(Mo.join(c,"package.json"))){let u=Mo.join(c,"index.js");if(eG(u)&&eG(Mo.join(c,"package.json")))return{entrypoint:u,assetsRoot:c};continue}return"pkg"in process&&(QJn(s)||QJn(c))?zqs(s,c):{entrypoint:l,assetsRoot:c}}throw new Error(`Unable to locate Copilot runtime packages. Ensure optional dependencies are installed. Tried: ${r.shared} + ${r.platform}, or complete ${r.platform}`)}a(GJn,"resolveCopilotRuntime");function $Jn(t,e={}){return e.isPkg??"pkg"in process?{path:e.execPath??process.execPath,args:[Mo.join(Mo.dirname(t),Ofr),t]}:{path:t}}a($Jn,"getCopilotRuntimeStdioConnectionOptions");function UJn(t){let e=JSON.parse(t.toString());return e.type="module",`${JSON.stringify(e,void 0,2)} +`}a(UJn,"normalizeRuntimePackageJsonForExtraction");function zqs(t,e){let r=Mo.basename(e),n=UJn(au.readFileSync(Mo.join(t,"package.json"))),o=UJn(au.readFileSync(Mo.join(e,"package.json"))),s=(0,qJn.createHash)("sha256").update(n).update(o).update(au.readFileSync(Mo.join(t,"index.js"))).update(au.readFileSync(Mo.join(t,"app.js"))).update(FJn).digest("hex").slice(0,16),c=process.env.PKG_NATIVE_CACHE_PATH||Mo.join((0,jJn.homedir)(),".cache"),l=Mo.join(c,"pkg",`copilot-runtime-${r}-${s}`),u=Mo.join(l,Mo.basename(t)),d=Mo.join(l,r),f=Mo.join(l,BJn),h=Mo.join(u,"index.js"),m=Mo.join(u,Ofr),g=r.slice(8),A=Mo.join(d,"prebuilds",g,"runtime.node");if(eG(f)&&eG(h)&&eG(m)&&eG(A))return{entrypoint:h,assetsRoot:d};let y=`${l}.${process.pid}.${Date.now()}.tmp`,_=Mo.join(y,Mo.basename(t)),E=Mo.join(y,r);au.rmSync(y,{recursive:!0,force:!0}),au.mkdirSync(Mo.dirname(y),{recursive:!0});try{Lfr(t,_),Lfr(e,E),au.writeFileSync(Mo.join(_,"package.json"),n),au.writeFileSync(Mo.join(E,"package.json"),o),au.writeFileSync(Mo.join(_,Ofr),FJn),au.writeFileSync(Mo.join(y,BJn),""),au.rmSync(l,{recursive:!0,force:!0}),au.renameSync(y,l)}catch(v){throw au.rmSync(y,{recursive:!0,force:!0}),v}return{entrypoint:h,assetsRoot:d}}a(zqs,"materializePkgRuntimePackages");function Lfr(t,e){au.mkdirSync(e,{recursive:!0});for(let r of au.readdirSync(t,{withFileTypes:!0})){let n=Mo.join(t,r.name),o=Mo.join(e,r.name);if(r.isDirectory()){Lfr(n,o);continue}r.isFile()&&(au.copyFileSync(n,o),process.platform!=="win32"&&au.chmodSync(o,493))}}a(Lfr,"copyDirectorySync");function QJn(t){let e=t.replace(/\\/g,"/");return e.startsWith("/snapshot/")||/^[A-Za-z]:\/snapshot\//.test(e)}a(QJn,"isPkgVirtualPath");function Yqs(t){let e=new Set,r=Mo.resolve(t);for(;;){e.add(Mo.join(r,"node_modules"));let n=Mo.dirname(r);if(n===r)break;r=n}return e.add(Mo.resolve(process.cwd(),"node_modules")),"pkg"in process&&(e.add(Mo.join(Mo.dirname(process.execPath),"node_modules")),e.add(Mo.join(Mo.dirname(process.execPath),"dist","node_modules"))),[...e]}a(Yqs,"getNodeModulesRoots");function VJn(){let t=process.arch==="arm64"?"arm64":"x64";if(process.platform==="darwin"||process.platform==="linux"||process.platform==="win32")return{platform:process.platform,arch:t};throw new Error(`Unsupported Copilot runtime platform: ${process.platform}-${process.arch}`)}a(VJn,"currentRuntimeTarget");function eG(t){try{return au.statSync(t).isFile()}catch{return!1}}a(eG,"isFile");p();var Kqs=["user_input.requested","exit_plan_mode.requested"],Jqs=new Set(["assistant.usage","assistant.message","tool.execution_start","tool.execution_complete"]),Vlt=class{constructor(e){this.client=e;this.sessions=new Map}static{a(this,"CopilotSdkSessionManager")}async createSession(e){let r=zJn(),n=WJn(e,r),o=await this.client.createSession(n.config),s=await Wlt.create(o,n.postCreatePatch,r);return this.sessions.set(s.sessionId,s),s}async getSession(e,r=!0){let n=this.sessions.get(e.sessionId);if(n)return n;if(!r)return;let o=zJn(),s=WJn(e,o),c=await this.client.resumeSession(e.sessionId,s.config),l=await Wlt.create(c,s.postCreatePatch,o);return this.sessions.set(l.sessionId,l),l}async closeSession(e,r){let n=this.sessions.get(e);r!==void 0&&n!==r||(this.sessions.delete(e),await n?.disconnect())}async closeAllSessions(){let e=[...this.sessions.values()];this.sessions.clear();let r=await Promise.allSettled(e.map(o=>o.disconnect())),n=[];for(let o of r)o.status==="rejected"&&n.push(o.reason);if(n.length>0)throw new AggregateError(n,"Failed to disconnect one or more Copilot runtime sessions")}async deleteSession(e){this.sessions.delete(e),await this.client.deleteSession(e)}async listSessions(){return(await this.client.listSessions()).map(YJn)}async getSessionMetadata(e){let r=await this.client.getSessionMetadata(e.sessionId);return r?YJn(r):void 0}forkSession(e,r){return this.client.rpc.sessions.fork({sessionId:e,...r})}async dispose(){this.sessions.clear();let e=await this.client.stop();if(e.length>0)throw e[0]}},Wlt=class t{constructor(e){this.inner=e;this.usage={getMetrics:a(()=>this.inner.rpc.usage.getMetrics(),"getMetrics")};this.history={truncate:a(e=>this.inner.rpc.history.truncate(e),"truncate")};this.agent={select:a(e=>this.inner.rpc.agent.select(e),"select"),deselect:a(()=>this.inner.rpc.agent.deselect(),"deselect")};this.mode={set:a(e=>this.inner.rpc.mode.set(e),"set")};this.plan={readSqlTodosWithDependencies:a(()=>this.inner.rpc.plan.readSqlTodosWithDependencies(),"readSqlTodosWithDependencies")};this.commands={invoke:a(e=>this.inner.rpc.commands.invoke(e),"invoke")};this.events=[];this.eventInterestHandles=[];this.subagentParentToolCallIds=new Map;this.loadedSkills=[]}static{a(this,"CopilotSdkLocalSession")}static async create(e,r,n){let o=new t(e);try{n?n.attach(l=>o.rememberEvent(l)):o.eventListenerDispose=e.on(l=>o.rememberEvent(l));let s=await e.getEvents().catch(()=>[]);if(o.mergeHistoricalEvents(s),await o.registerInteractiveEventInterests(),Object.keys(r).length>0&&await o.updateOptions(r),!(await e.rpc.permissions.setRequired({required:!0})).success)throw new Error("Copilot runtime rejected permission event bridging");return o}catch(s){throw o.eventListenerDispose?.(),await o.releaseEventInterests().catch(()=>{}),await e.disconnect().catch(()=>{}),s}}get sessionId(){return this.inner.sessionId}get workspacePath(){return this.inner.workspacePath}on(e,r){return typeof e=="function"?this.inner.on(n=>e(this.toLocalSessionEvent(n))):e==="*"?this.inner.on(n=>r?.(this.toLocalSessionEvent(n))):this.inner.on(e,n=>r?.(this.toLocalSessionEvent(n)))}async send(e){return this.inner.send(e)}getEvents(){return[...this.events]}async notifyRemoteSteerableChanged(e){await this.inner.rpc.remote.notifySteerableChanged({remoteSteerable:e})}async updateOptions(e){let{mcpServers:r,disabledSkills:n,...o}=e,s={...o,...n!==void 0?{disabledSkills:Bfr(n)}:{}};if(Object.keys(s).length>0&&!(await this.inner.rpc.options.update(s)).success)throw new Error("Copilot runtime rejected the session option update");r!==void 0&&await this.reloadMcpServers({mcpServers:r})}async reloadMcpServers(e){await Zqs(this.inner).sendRequest("session.mcp.reloadWithConfig",{sessionId:this.inner.sessionId,config:{mcpServers:e.mcpServers??{}}})}compactHistory(){return this.inner.rpc.history.compact()}async abortManualCompaction(){return!!(await this.inner.rpc.history.abortManualCompaction()).aborted}clearPendingItems(){return this.inner.rpc.queue.clear()}async ensureSkillsLoaded(){await this.inner.rpc.skills.ensureLoaded();let e=await this.inner.rpc.skills.list();this.loadedSkills=e.skills.map(r=>({name:r.name,userInvocable:r.userInvocable,pluginName:r.pluginName}))}getLoadedSkills(){return[...this.loadedSkills]}async getPlanPath(){return(await this.inner.rpc.plan.read()).path}abort(){return this.inner.abort()}async disconnect(){this.eventListenerDispose?.(),this.eventListenerDispose=void 0;try{await this.releaseEventInterests()}finally{await this.inner.disconnect()}}async respondToPermission(e,r){return(await this.inner.rpc.permissions.handlePendingPermissionRequest({requestId:e,result:r})).success}async respondToUserInput(e,r){return(await this.inner.rpc.ui.handlePendingUserInput({requestId:e,response:r})).success}async respondToElicitation(e,r){return(await this.inner.rpc.ui.handlePendingElicitation({requestId:e,result:r})).success}async respondToExitPlanMode(e,r){return(await this.inner.rpc.ui.handlePendingExitPlanMode({requestId:e,response:r})).success}async respondToQueuedCommand(e,r){return(await this.inner.rpc.commands.respondToQueuedCommand({requestId:e,result:r})).success}async respondToExternalTool(e,r){return(await this.inner.rpc.tools.handlePendingToolCall({requestId:e,result:r})).success}rememberEvent(e){let r=this.toLocalSessionEvent(e);this.events.some(n=>n.id===r.id)||this.events.push(r)}mergeHistoricalEvents(e){let r=new Set(e.map(o=>o.id)),n=this.events.filter(o=>!r.has(o.id));this.events.length=0,this.subagentParentToolCallIds.clear();for(let o of[...e,...n])this.rememberEvent(o)}toLocalSessionEvent(e){let r=e,n=typeof r.agentId=="string"?r.agentId:void 0;if(r.type==="subagent.started"&&n){let s=r.data.toolCallId;return typeof s=="string"&&this.subagentParentToolCallIds.set(n,s),r}if(r.type==="session.idle"||r.type==="session.error")return this.subagentParentToolCallIds.clear(),r;if(!n||!Jqs.has(r.type)||typeof r.data.parentToolCallId=="string")return r;let o=this.subagentParentToolCallIds.get(n);return o?{...r,data:{...r.data,parentToolCallId:o}}:r}async registerInteractiveEventInterests(){for(let e of Kqs){let{handle:r}=await this.inner.rpc.eventLog.registerInterest({eventType:e});this.eventInterestHandles.push(r)}}async releaseEventInterests(){let e=this.eventInterestHandles.splice(0);await Promise.all(e.map(r=>this.inner.rpc.eventLog.releaseInterest({handle:r})))}};function Zqs(t){let e=t.connection;if(typeof e?.sendRequest!="function")throw new Error("Copilot SDK session does not expose the internal RPC connection required for MCP reloadWithConfig");return e}a(Zqs,"getInternalRpcConnection");function WJn(t,e){let{authInfo:r,enableStreaming:n,externalToolDefinitions:o,disabledInstructionSources:s,disabledSkills:c,hooks:l,sandboxConfig:u,tools:d,...f}=t,h={...f,gitHubToken:f.gitHubToken??r?.githubToken,streaming:n,disabledSkills:Bfr(c),hooks:l?Xqs(l):void 0,tools:[...d??[],...o??[]],onEvent:e.onEvent},m={};n!==void 0&&(m.enableStreaming=n),u!==void 0&&(m.sandboxConfig=u);let g=Bfr(s);return g!==void 0&&(m.disabledInstructionSources=g),{config:h,postCreatePatch:m}}a(WJn,"normalizeSessionOptions");function zJn(){let t=[],e;return{onEvent:a(r=>{e?e(r):t.push(r)},"onEvent"),attach:a(r=>{if(e)throw new Error("Copilot SDK session event bridge is already attached");e=r;for(let n of t.splice(0))e(n)},"attach")}}a(zJn,"createSessionEventBridge");function Xqs(t){return{onPreToolUse:t.preToolUse?cme(t.preToolUse):void 0,onPostToolUse:t.postToolUse?cme(t.postToolUse):void 0,onUserPromptSubmitted:t.userPromptSubmitted?cme(t.userPromptSubmitted):void 0,onSessionStart:t.sessionStart?cme(t.sessionStart):void 0,onSessionEnd:t.sessionEnd?cme(t.sessionEnd):void 0,onErrorOccurred:t.errorOccurred?cme(t.errorOccurred):void 0}}a(Xqs,"toSessionHooks");function cme(t){return async(e,r)=>{for(let n of t){let o=await n.handler(e);if(o!==void 0)return o}}}a(cme,"composeHookList");function Bfr(t){if(t!==void 0)return Array.isArray(t)?t:[...t]}a(Bfr,"normalizeArray");function YJn(t){return{...t,context:t.context?{...t.context,cwd:t.context.workingDirectory}:void 0}}a(YJn,"normalizeSessionMetadata");p();var KJn=require("node:crypto"),KDe=fe(require("node:fs")),gR=fe(require("node:fs/promises")),JJn=require("node:os"),mR=fe(require("node:path"));var tee=new pe("BackgroundAgent.SandboxBinaryResolver");async function ZJn(t){if(!process.env.MXC_BIN_DIR)try{let e=mR.join(__dirname,"node_modules","@microsoft","mxc-sdk","bin");if(!KDe.existsSync(e)){tee.debug(t,`MXC sandbox helpers not found at ${e}`);return}if(!("pkg"in process)){process.env.MXC_BIN_DIR=e,tee.debug(t,`MXC sandbox helpers located; MXC_BIN_DIR=${e}`);return}let r=await tjs(t,e);r&&(process.env.MXC_BIN_DIR=r,tee.debug(t,`MXC sandbox helpers extracted; MXC_BIN_DIR=${r}`))}catch(e){tee.warn(t,"Failed to resolve MXC_BIN_DIR for the local sandbox",{error:e instanceof Error?e.message:String(e)})}}a(ZJn,"ensureSandboxBinDirEnv");function ejs(){switch(process.platform){case"win32":return"wxc-exec.exe";case"darwin":return"mxc-exec-mac";default:return"lxc-exec"}}a(ejs,"sandboxMainBinaryName");async function tjs(t,e){if(process.arch!=="x64"&&process.arch!=="arm64"){tee.debug(t,`Local sandbox unsupported on architecture ${process.arch}; sandbox will be unavailable`);return}let r=process.arch,n=mR.join(e,r),o=ejs(),s=mR.join(n,o);if(!KDe.existsSync(s)){tee.debug(t,`MXC sandbox helper ${r}/${o} is not available for this platform`);return}let c=(await gR.readdir(n,{withFileTypes:!0})).filter(g=>g.isFile()).sort((g,A)=>g.name.localeCompare(A.name)),l=(0,KJn.createHash)("sha256");for(let g of c)l.update(g.name).update(await gR.readFile(mR.join(n,g.name)));let u=l.digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||mR.join((0,JJn.homedir)(),".cache"),f=mR.join(d,"pkg",`mxc-sdk-${u}`),h=mR.join(f,r),m=mR.join(h,".extraction-complete");if(KDe.existsSync(m)&&KDe.existsSync(mR.join(h,o)))return f;await gR.mkdir(h,{recursive:!0});for(let g of c){let A=mR.join(h,g.name);await gR.copyFile(mR.join(n,g.name),A),process.platform!=="win32"&&await gR.chmod(A,493).catch(y=>tee.warn(t,`Failed to set executable permission for ${A}`,{error:y instanceof Error?y.message:String(y)}))}return await gR.writeFile(m,""),f}a(tjs,"extractSandboxBinDirFromPkg");p();p();p();var ree=require("node:util");var rjs=new Map([["",{strategy:"merge-properties"}],["allowedMcpServers",{strategy:"allowlist-intersection"}],["deniedMcpServers",{strategy:"deny-wins"}],["model",{strategy:"enum-order-wins",order:["auto"]}],["permissions",{strategy:"merge-properties"}],["permissions.disableBypassPermissionsMode",{strategy:"enum-order-wins",order:["disable"]}],["remoteControl",{strategy:"enum-order-wins",order:["enabled","disabled","requireSSO"],valueKey:"mode"}],["remoteControl.mode",{strategy:"enum-order-wins",order:["enabled","disabled","requireSSO"]}],["enabledPlugins",{strategy:"deny-wins"}],["extraKnownMarketplaces",{strategy:"allowlist-intersection"}],["strictKnownMarketplaces",{strategy:"allowlist-intersection"}],["telemetry",{strategy:"most-restrictive-wins",restrictiveBooleans:{enabled:!0,lockCaptureContent:!0}}]]),XJn=new Set(["__proto__","constructor","prototype"]);function tG(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(tG,"isObject");function Ffr(t){let e=new Set;for(let r of t)if(tG(r))for(let n of Object.keys(r))XJn.has(n)||e.add(n);return e}a(Ffr,"safeKeys");function Ufr(t,e){return t.map(r=>tG(r)&&Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0)}a(Ufr,"childValues");function njs(t,e,r){for(let n of e){let o=t.find(s=>r&&tG(s)?(0,ree.isDeepStrictEqual)(s[r],n):(0,ree.isDeepStrictEqual)(s,n));if(o!==void 0)return o}return t[0]}a(njs,"composeEnumOrder");function ijs(t,e){if(!t.every(tG))return t[0];let r=[];for(let n of Ffr(t)){let o=e?`${e}.${n}`:n,s=Qfr(Ufr(t,n),o);s!==void 0&&r.push([n,s])}return Object.fromEntries(r)}a(ijs,"composeProperties");function ojs(t){let e=t[0];if(Array.isArray(e)){if(!t.every(Array.isArray))return e;let n=[];for(let o of t)for(let s of o)n.some(c=>(0,ree.isDeepStrictEqual)(c,s))||n.push(s);return n}if(!t.every(tG))return e;let r=[];for(let n of Ffr(t)){let o=Ufr(t,n).filter(s=>typeof s=="boolean");o.includes(!1)?r.push([n,!1]):o.includes(!0)&&r.push([n,!0])}return Object.fromEntries(r)}a(ojs,"composeDenyWins");function sjs(t){let e=t[0];if(Array.isArray(e)){if(!t.every(Array.isArray))return[];let r=[];for(let n of e)t.slice(1).every(o=>o.some(s=>(0,ree.isDeepStrictEqual)(s,n)))&&!r.some(o=>(0,ree.isDeepStrictEqual)(o,n))&&r.push(n);return r}if(tG(e)){if(!t.every(tG))return{};let r=[];for(let[n,o]of Object.entries(e))!XJn.has(n)&&t.slice(1).every(s=>Object.prototype.hasOwnProperty.call(s,n)&&(0,ree.isDeepStrictEqual)(s[n],o))&&r.push([n,o]);return Object.fromEntries(r)}return e}a(sjs,"composeAllowlistIntersection");function ajs(t,e,r){if(!t.every(tG))return t[0];let n=[];for(let o of Ffr(t)){let s=Ufr(t,o),c=Object.prototype.hasOwnProperty.call(r,o)?r[o]:void 0,l;if(c!==void 0){let u=s.filter(d=>typeof d=="boolean");l=u.includes(c)?c:u[0]}else l=Qfr(s,`${e}.${o}`);l!==void 0&&n.push([o,l])}return Object.fromEntries(n)}a(ajs,"composeMostRestrictive");function cjs(t,e,r){switch(t.strategy){case"merge-properties":return ijs(e,r);case"enum-order-wins":return njs(e,t.order,t.valueKey);case"deny-wins":return ojs(e);case"allowlist-intersection":return sjs(e);case"most-restrictive-wins":return ajs(e,r,t.restrictiveBooleans)}}a(cjs,"applyCompositionRule");function Qfr(t,e){let r=t.filter(s=>s!==void 0),n=r[0];if(n===void 0)return;let o=rjs.get(e);return o?cjs(o,r,e):n}a(Qfr,"mergeManagedValues");function eZn(t){return Qfr(t,"")??{}}a(eZn,"mergeManagedSettingsByComposition");p();var tZn=["nativeMdm","server","file"];var qfr=require("node:util");var ay=class{constructor(e){this.sources=e;this.didChangeEmitter=new Lc;this.disposed=!1;this.current=this.mergeSources(),this.sourceSubscriptions=e.map(r=>r.onDidChange(()=>this.recompute()))}static{a(this,"ManagedSettingsService")}get(){return this.current}observe(e,r){let n=r?e:c=>c,o=r??e,s=n(this.current);return o(s),this.didChangeEmitter.event(c=>{let l=n(c);(0,qfr.isDeepStrictEqual)(s,l)||(s=l,o(l))})}async refresh(e){return await Promise.allSettled(this.sources.map(r=>r.refresh(e))),this.recompute(),this.current}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.sourceSubscriptions)e.dispose();this.didChangeEmitter.dispose();for(let e of this.sources)e.dispose()}}recompute(){let e=this.mergeSources();(0,qfr.isDeepStrictEqual)(this.current,e)||(this.current=e,this.didChangeEmitter.fire(e))}mergeSources(){let e=tZn.flatMap(r=>this.sources.flatMap(n=>n.channel===r&&n.current?[n.current]:[]));return eZn(e)}};p();function T4(t){return t.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)[^/@\s]*@/g,"$1")}a(T4,"redactUrlCredentials");var I4=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredPluginError"}static{a(this,"StructuredPluginError")}},zlt=class extends I4{static{a(this,"PluginSourceNotSupportedError")}constructor(e){let r={kind:"pluginSourceNotSupported",sourceKind:e};super(`Plugin source kind '${e}' is not supported in this environment`,r),this.name="PluginSourceNotSupportedError"}},rG=class extends I4{static{a(this,"PluginCloneError")}constructor(e,r){let n=T4(e),o=T4(r instanceof Error?r.message:String(r)),s={kind:"pluginCloneFailed",cloneUrl:n,cause:o};super(o,s),this.name="PluginCloneError"}},lme=class extends I4{static{a(this,"LocalMarketplaceMissingError")}constructor(e){let r={kind:"localMarketplaceMissing",repositoryPath:e};super(`Local marketplace repository does not exist: ${e}`,r),this.name="LocalMarketplaceMissingError"}},ume=class extends I4{static{a(this,"InvalidPluginSourceError")}constructor(e,r="plugin source"){let n=T4(e),o={kind:"invalidPluginSource",source:n};super(`Invalid ${r}: ${n}`,o),this.name="InvalidPluginSourceError"}},Ylt=class extends I4{static{a(this,"MarketplaceBlockedByPolicyError")}constructor(e,r){let n=T4(r),o={kind:"marketplaceBlockedByPolicy",canonicalId:e,reference:n};super(`Marketplace is not permitted by your organization's policy: ${n}`,o),this.name="MarketplaceBlockedByPolicyError"}},Klt=class extends I4{static{a(this,"PluginBlockedByPolicyError")}constructor(e){let r={kind:"pluginBlockedByPolicy",...e&&{policyId:e}};super("Plugin has been disabled by your organization's policy and cannot be enabled",r),this.name="PluginBlockedByPolicyError"}};var ZDe=new pe("AgentOTelConfig");function oZn(t){let e=t.OTEL_EXPORTER_OTLP_ENDPOINT,r=t.OTEL_EXPORTER_OTLP_HEADERS;return e===void 0&&r===void 0?t:{...t,...e!==void 0&&{OTEL_EXPORTER_OTLP_ENDPOINT:T4(e)},...r!==void 0&&{OTEL_EXPORTER_OTLP_HEADERS:"[REDACTED]"}}}a(oZn,"redactEnvForLog");function ljs(t){return Object.fromEntries(Object.keys(t).map(e=>[e,"[REDACTED]"]))}a(ljs,"redactHeadersForLog");var ujs="http://localhost:4318";function djs(t,e){if(!t)return;let r=t.trim().replace(/^["']|["']$/g,"");if(r)try{let n=new URL(r);return e==="grpc"?n.origin:n.href}catch{return}}a(djs,"parseOtlpEndpoint");function rZn(t){if(t===void 0)return;let e=t.trim().toLowerCase();if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1}a(rZn,"envBool");function JDe(t){let e=t?.trim();return e||void 0}a(JDe,"normalizeOptionalString");function nZn(t){let e={};if(!t)return e;for(let r of t.split(",")){let n=r.indexOf("=");if(n<=0)continue;let o=r.slice(0,n).trim(),s=r.slice(n+1).trim();o&&(e[o]=s)}return e}a(nZn,"parseStringRecordEnv");function sZn(t){let e=Object.entries(t);return e.length>0?e.map(([r,n])=>`${r}=${n}`).join(","):void 0}a(sZn,"formatStringRecordEnv");function iZn(t){if(t==="otlp-http"||t==="otlp-grpc"||t==="console"||t==="file")return t}a(iZn,"normalizeExporterType");function fjs(t){try{return t.get(ay).get().telemetry}catch(e){if(e instanceof Ic&&e.ctor===ay)return;throw e}}a(fjs,"getManagedTelemetry");function pjs(t){return t.managedEnabled!==void 0?t.managedEnabled:t.envEnabled!==void 0?t.envEnabled:t.settingEnabled===!0||t.hasManagedOtlpEndpoint||t.hasEndpointEnv}a(pjs,"resolveEnabled");function hjs(t){if(t.managedOtlpEndpoint===void 0)return t.envFileExporterPath||t.settingOutfile||void 0}a(hjs,"resolveFileExporterPath");function Jlt(t,e=process.env){let r=fjs(t),n=JDe(r?.endpoint),o=JDe(r?.protocol),s=kt(t,ze.OtelEnabled),c=kt(t,ze.OtelEndpoint),l=kt(t,ze.OtelCaptureContent),u=kt(t,ze.OtelExporterType),d=kt(t,ze.OtelProtocol),f=kt(t,ze.OtelOutfile),h=kt(t,ze.OtelServiceName),m=kt(t,ze.OtelResourceAttributes),g=rZn(e.COPILOT_OTEL_ENABLED),A=!!e.COPILOT_OTEL_ENDPOINT||!!e.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||!!e.OTEL_EXPORTER_OTLP_ENDPOINT,y=pjs({managedEnabled:r?.enabled,envEnabled:g,settingEnabled:s,hasManagedOtlpEndpoint:n!==void 0,hasEndpointEnv:A}),_=e.COPILOT_OTEL_FILE_EXPORTER_PATH||void 0,E=hjs({managedOtlpEndpoint:n,envFileExporterPath:_,settingOutfile:f}),v=o??e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL??(u==="otlp-grpc"?"grpc":d||void 0),S=v==="grpc"?"grpc":"http",T=S==="grpc"?"grpc":v==="http/protobuf"?"http/protobuf":"http/json",w=iZn(e.COPILOT_OTEL_EXPORTER_TYPE),R=iZn(u),x;n!==void 0?x=S==="grpc"?"otlp-grpc":"otlp-http":w?x=w:_||f&&R!=="console"?x="file":R?x=R:x=S==="grpc"?"otlp-grpc":"otlp-http";let k=n||e.COPILOT_OTEL_ENDPOINT||e.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||e.OTEL_EXPORTER_OTLP_ENDPOINT||c||ujs,D=djs(k,S)??"",N=(r?.lockCaptureContent===!0?r.captureContent:void 0)??rZn(e.OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT)??l??!1,O=JDe(r?.serviceName)??JDe(e.OTEL_SERVICE_NAME)??JDe(h),B=r?.resourceAttributes??(e.OTEL_RESOURCE_ATTRIBUTES!==void 0?nZn(e.OTEL_RESOURCE_ATTRIBUTES):m)??{},q={...nZn(e.OTEL_EXPORTER_OTLP_HEADERS),...r?.headers??{}},M={enabled:!!y,exporterType:x,otlpEndpoint:D,otlpProtocol:T,captureContent:!!N,...O!==void 0&&{serviceName:O},resourceAttributes:B,headers:q,managedOtlpEndpoint:n!==void 0,fileExporterPath:x==="file"?E:void 0};return ZDe.debug(t,"Resolved agent OTel configuration",{config:{...M,otlpEndpoint:T4(M.otlpEndpoint),headers:ljs(M.headers)}}),M}a(Jlt,"resolveAgentOTelConfig");function aZn(t,e,r=process.env){if(!e.enabled)return{};let n={COPILOT_OTEL_ENABLED:"true"};e.captureContent&&(n.OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT="true"),e.serviceName&&(n.OTEL_SERVICE_NAME=e.serviceName);let o=sZn(e.resourceAttributes);return o&&(n.OTEL_RESOURCE_ATTRIBUTES=o),e.exporterType==="file"&&e.fileExporterPath?(n.COPILOT_OTEL_EXPORTER_TYPE="file",n.COPILOT_OTEL_FILE_EXPORTER_PATH=e.fileExporterPath):e.otlpEndpoint&&(n.OTEL_EXPORTER_OTLP_ENDPOINT=e.otlpEndpoint,e.otlpProtocol!=="grpc"&&(n.OTEL_EXPORTER_OTLP_PROTOCOL=e.otlpProtocol)),ZDe.debug(t,"Copilot CLI OTel env",{env:oZn(n)}),n}a(aZn,"deriveCopilotCliOTelEnv");function cZn(t,e,r=process.env){if(!e.enabled)return{};if(!e.otlpEndpoint)return ZDe.warn(t,"Claude OTel: no valid OTLP endpoint; skipping telemetry env"),{};(e.exporterType==="file"||e.exporterType==="console")&&ZDe.debug(t,`Claude OTel: exporterType='${e.exporterType}' is not supported by Claude; exporting over OTLP to ${T4(e.otlpEndpoint)} instead`);let n={CLAUDE_CODE_ENABLE_TELEMETRY:"1",OTEL_METRICS_EXPORTER:"otlp",OTEL_LOGS_EXPORTER:"otlp",OTEL_EXPORTER_OTLP_ENDPOINT:e.otlpEndpoint,OTEL_EXPORTER_OTLP_PROTOCOL:e.otlpProtocol};e.serviceName&&(n.OTEL_SERVICE_NAME=e.serviceName);let o=sZn(e.resourceAttributes);return o&&(n.OTEL_RESOURCE_ATTRIBUTES=o),e.captureContent&&(n.OTEL_LOG_USER_PROMPTS="1",n.OTEL_LOG_TOOL_DETAILS="1"),ZDe.debug(t,"Claude OTel env",{env:oZn(n)}),n}a(cZn,"deriveClaudeOTelEnv");var lZn=require("node:module");var Zlt=new pe("BackgroundAgent.ManagerLifecycle"),mjs=["COPILOT_OTEL_ENABLED","COPILOT_OTEL_EXPORTER_TYPE","COPILOT_OTEL_FILE_EXPORTER_PATH","COPILOT_OTEL_ENDPOINT","OTEL_EXPORTER_OTLP_ENDPOINT","OTEL_EXPORTER_OTLP_TRACES_ENDPOINT","OTEL_EXPORTER_OTLP_PROTOCOL","OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT","OTEL_SERVICE_NAME","OTEL_RESOURCE_ATTRIBUTES"];function gjs(){return(0,lZn.createRequire)(__filename)("@github/copilot-sdk")}a(gjs,"importSdk");function Ajs(t,e,r,n){let o=Jlt(t,e),s={...e,COPILOT_CLI_RUN_AS_NODE:"1",GITHUB_COPILOT_INTEGRATION_ID:AWe(t.get(Ir))??"jetbrains-chat",[HJn]:r};for(let c of mjs)delete s[c];return Object.assign(s,aZn(t,o,e)),o.enabled&&o.managedOtlpEndpoint&&delete s.OTEL_EXPORTER_OTLP_HEADERS,delete s.COPILOT_GH_HOST,n&&(s.COPILOT_GH_HOST=n),delete s.COPILOT_RUNTIME_OOP,delete s.NAPI_OOP_SOCKET,s}a(Ajs,"buildCopilotRuntimeEnvironment");var Xlt=class{constructor(e){this.ctx=e}static{a(this,"ManagerLifecycle")}async ensureManager(e){if(this.requiresGitHubHostRestart(e))throw new Error("Copilot runtime GitHub host changed before the existing client was disposed");if(this.manager)return this.manager;this.managerInitPromise||(this.managerInitGitHubHost=e,this.managerInitPromise=this.initManager(e));try{await this.managerInitPromise}catch(r){throw this.managerInitPromise=void 0,this.managerInitGitHubHost=void 0,r}if(!this.manager)throw new Error("Copilot SDK initialization succeeded but manager is undefined");return this.manager}requiresGitHubHostRestart(e){return!this.manager&&!this.client&&!this.managerInitPromise?!1:(this.managerInitPromise?this.managerInitGitHubHost:this.clientGitHubHost)!==e}async disposeIfGitHubHostChanged(e){return this.requiresGitHubHostRestart(e)?(await this.dispose(),!0):!1}getSdk(){return this.sdk}async closeSession(e,r){await this.manager?.closeSession(e,r)}async closeAllSessions(){if(this.manager)try{await this.manager.closeAllSessions()}catch(e){Zlt.warn(this.ctx,"Failed to disconnect one or more runtime sessions during user-state cleanup",{error:String(e)})}}async dispose(){if(this.managerInitPromise&&!this.manager&&!this.client)try{await this.managerInitPromise}catch{}this.manager?(await this.manager.dispose(),this.manager=void 0):this.client&&await this.client.stop(),this.client=void 0,this.sdk=void 0,this.managerInitPromise=void 0,this.managerInitGitHubHost=void 0,this.clientGitHubHost=void 0}setStubManagerForTesting(e){this.manager=e}setStubSdkForTesting(e){this.sdk={AUTO_MODEL_ID:"auto",...e}}setRuntimeGitHubHostForTesting(e){this.clientGitHubHost=e}async initManager(e){Zlt.info(this.ctx,"Initializing CopilotClient (runtime SDK)...");let r=performance.now(),n;try{n=gjs(),this.sdk={...n,AUTO_MODEL_ID:"auto"},sr(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-r})}catch(l){throw Hs(this.ctx,"backgroundAgent.importSdk",l,{status_text:"failure"},{duration_ms:performance.now()-r}),l}await ZJn(this.ctx),await qlt(this.ctx);let o=GJn();Zlt.info(this.ctx,"Resolved Copilot runtime packages",o);let s=$Jn(o.entrypoint),c=new n.CopilotClient({connection:n.RuntimeConnection.forStdio(s),useLoggedInUser:!1,env:Ajs(this.ctx,process.env,o.assetsRoot,e)});try{await c.start()}catch(l){throw await c.stop(),l}this.client=c,this.clientGitHubHost=e,this.manager=new Vlt(c),Zlt.info(this.ctx,"CopilotClient initialized.")}};p();p();var eut="/agents/sessions",tut=class{constructor(e,r,n){this.ctx=e;this.logger=r;this.opts=n;this.fetchImpl=n.fetch??fetch}static{a(this,"MissionControlApiClient")}async createSession(e,r,n){let o=await this.buildUrl(eut),s=await this.buildHeaders();s["Content-Type"]="application/json";let c=Date.now();this.logger.info(this.ctx,`MissionControl POST ${o}`,{ownerId:e,repoId:r,agentTaskId:n,integrationId:this.opts.integrationId});let l=await this.fetchWithTimeout(o,{method:"POST",headers:s,body:JSON.stringify({owner_id:e,repo_id:r,agent_task_id:n})});if(!l.ok){let f=await uZn(l);throw this.logger.warn(this.ctx,`MissionControl createSession \u2190 ${l.status} ${l.statusText}`,{durationMs:Date.now()-c,body:f.slice(0,500)}),new Error(`MissionControl createSession failed: ${l.status} ${l.statusText} ${f}`)}let u=await l.json();if(typeof u.id!="string")throw new Error("MissionControl createSession: response missing id");let d=typeof u.task_id=="string"?u.task_id:u.id;return this.logger.info(this.ctx,"MissionControl createSession \u2190 200",{durationMs:Date.now()-c,mcSessionId:u.id,mcTaskId:d}),{id:u.id,taskId:d}}async submitEvents(e,r,n){let o=await this.buildUrl(`${eut}/${encodeURIComponent(e)}/events`),s=Date.now();this.logger.info(this.ctx,`MissionControl POST ${o}`,{eventCount:r.length,ackCount:n.length,eventTypes:r.slice(0,10).map(c=>c.type)});try{let c=await this.buildHeaders();c["Content-Type"]="application/json";let l={events:r};n.length>0&&(l.completed_command_ids=n);let u=await this.fetchWithTimeout(o,{method:"POST",headers:c,body:JSON.stringify(l)});if(!u.ok){let d=await uZn(u);return this.logger.warn(this.ctx,`MissionControl submitEvents \u2190 ${u.status} ${u.statusText}`,{durationMs:Date.now()-s,body:d.slice(0,500)}),!1}return this.logger.info(this.ctx,"MissionControl submitEvents \u2190 200",{durationMs:Date.now()-s,eventCount:r.length,ackCount:n.length}),!0}catch(c){return this.logger.warn(this.ctx,`MissionControl submitEvents error: ${c instanceof Error?c.message:String(c)}`,{durationMs:Date.now()-s}),!1}}async getPendingCommands(e){let r=await this.buildUrl(`${eut}/${encodeURIComponent(e)}/commands`),n=Date.now();try{let o=await this.buildHeaders(),s=await this.fetchWithTimeout(r,{method:"GET",headers:o});if(!s.ok)return this.logger.warn(this.ctx,`MissionControl GET ${r} \u2190 ${s.status} ${s.statusText}`,{durationMs:Date.now()-n}),[];let c=await s.json(),l=Array.isArray(c.commands)?c.commands:[];return l.length>0?this.logger.info(this.ctx,`MissionControl GET ${r} \u2190 200`,{durationMs:Date.now()-n,commandCount:l.length,commandIds:l.map(u=>u.id)}):this.logger.debug(this.ctx,`MissionControl GET ${r} \u2190 200 (no commands)`,{durationMs:Date.now()-n}),l}catch(o){return this.logger.warn(this.ctx,`MissionControl getPendingCommands error: ${o instanceof Error?o.message:String(o)}`,{durationMs:Date.now()-n}),[]}}async deleteSession(e){let r=await this.buildUrl(`${eut}/${encodeURIComponent(e)}/`),n=Date.now();this.logger.info(this.ctx,`MissionControl DELETE ${r}`);try{let o=await this.buildHeaders(),s=await this.fetchWithTimeout(r,{method:"DELETE",headers:o});this.logger.info(this.ctx,`MissionControl DELETE ${r} \u2190 ${s.status}`,{durationMs:Date.now()-n})}catch(o){this.logger.warn(this.ctx,`MissionControl deleteSession error: ${o instanceof Error?o.message:String(o)}`,{durationMs:Date.now()-n})}}async buildUrl(e){return`${(await this.opts.getApiBase()).replace(/\/+$/,"")}${e.startsWith("/")?e:`/${e}`}`}async buildHeaders(){return{Authorization:`Bearer ${await this.opts.getAuthToken()}`,"Copilot-Integration-Id":this.opts.integrationId,Accept:"application/json","User-Agent":"GitHubCopilotChat/0.0.0"}}async fetchWithTimeout(e,r){let n=new AbortController,o=setTimeout(()=>n.abort(),1e4);try{return await this.fetchImpl(e,{...r,signal:n.signal})}finally{clearTimeout(o)}}};async function uZn(t){try{return await t.text()}catch{return""}}a(uZn,"safeReadText");p();p();var rut=class{constructor(e){this.opts=e;this.failureCount=0;this.state=0;this.nextRetryAt=0;this.currentTimeoutMs=e.resetTimeoutMs}static{a(this,"CircuitBreaker")}canRequest(){return this.state===0?!0:this.state===1&&Date.now()>=this.nextRetryAt?(this.state=2,!0):this.state===2}recordSuccess(){this.failureCount=0,this.state=0,this.currentTimeoutMs=this.opts.resetTimeoutMs}recordFailure(){this.failureCount++,(this.state===2||this.failureCount>=this.opts.failureThreshold)&&(this.state=1,this.nextRetryAt=Date.now()+this.currentTimeoutMs,this.currentTimeoutMs=Math.min(this.currentTimeoutMs*2,this.opts.maxResetTimeoutMs))}getState(){return this.state}getFailureCount(){return this.failureCount}get name(){return this.opts.name}};p();var yjs=new Set(["assistant.message_delta","assistant.streaming_delta","session.shutdown","session.error","session.usage_info","assistant.usage","pending_messages.modified","session.mcp_server_status_changed","session.mcp_servers_loaded","session.skills_loaded","session.tools_updated"]);function dZn(t){return!(!t.type||yjs.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(dZn,"shouldForwardMissionControlEvent");function jfr(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a(jfr,"getMissionControlEventData");var hZn=require("node:crypto");var _js=500,Ejs=3e3,vjs=1e4,Cjs=500,XDe=2e3;function bjs(t){return t.approved?{kind:t.scope==="session"?"approve-for-session":"approve-once"}:{kind:"denied-interactively-by-user",...t.feedback?{feedback:t.feedback}:{}}}a(bjs,"toPermissionResponseResult");var Sjs=256,fZn=80,nut=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new rut({failureThreshold:5,resetTimeoutMs:1e3,maxResetTimeoutMs:3e4,name:"mc-events"})}static{a(this,"MissionControlRemoteDelegate")}async enable(){if(this.state&&!this.state.disposed)return{url:this.state.frontendUrl,remoteSteerable:!0};let{workingDir:e,getGithubToken:r,client:n,logger:o,ctx:s}=this.remoteCtx,c=await avn(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await cvn(c,l);if(!u)throw new Error("Mission Control: repo_id_resolution_failed");let d=`${Date.now()}-${Math.random().toString(36).slice(2,10)}`,f=await n.createSession(u.ownerId,u.repoId,d),h={mcSessionId:f.id,mcTaskId:f.taskId,nwo:c,frontendUrl:`https://github.com/${c.owner}/${c.repo}/tasks/${f.taskId}`,eventBuffer:[],completedCommandIds:[],toolCallIdToRequestId:new Map,lastEventId:null,lastSubmitAttemptTimeMs:Date.now(),processedCommandIds:new Set,disposed:!1,titleSent:!!this.remoteCtx.sessionTitle,flushInFlight:!1,pollInFlight:!1};this.state=h;let m=Ijs(e);h.eventBuffer.push(this.createEvent(h,"session.start",{sessionId:h.mcSessionId,version:1,producer:"copilot-developer-cli",copilotVersion:"1.0.0",startTime:new Date().toISOString(),remoteSteerable:!0,context:{cwd:m,gitRoot:m,repository:`${c.owner}/${c.repo}`}}));let g=new Set(["user.message","assistant.message","assistant.turn_start","assistant.turn_end","tool.execution_start","tool.execution_complete"]);try{let A=Array.from(this.sdkSession.getEvents()),y=0;for(let _ of A)_.type&&g.has(_.type)&&(this.bufferEvent(h,_),y++);o.info(s,`Mission Control replayed ${y}/${A.length} historical events`)}catch(A){o.warn(s,`Mission Control history replay failed: ${nee(A)}`)}try{let A=this.sdkSession.on("*",y=>{!this.state||this.state.disposed||this.bufferEvent(this.state,y)});h.eventListenerDispose=typeof A=="function"?A:void 0,o.info(s,"Mission Control listener attached")}catch(A){o.warn(s,`Mission Control session.on('*') failed: ${nee(A)}`)}try{await this.sdkSession.notifyRemoteSteerableChanged(!0)}catch(A){o.warn(s,`runtime remote steerable notification failed: ${nee(A)}`)}return this.remoteCtx.sessionTitle&&h.eventBuffer.push(this.createEvent(h,"session.title_changed",{title:this.remoteCtx.sessionTitle},!0)),await this.flush(),h.flushInterval=setInterval(()=>{this.flush().catch(A=>o.warn(s,`mc flush err: ${A}`))},_js),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},Ejs),o.info(s,`Mission Control enabled for session ${this.sessionId}`,{mcSessionId:f.id,mcTaskId:f.taskId,url:h.frontendUrl}),{url:h.frontendUrl,remoteSteerable:!0}}async disable(){let e=this.state;if(!(!e||e.disposed)){e.pollInterval&&clearInterval(e.pollInterval),e.flushInterval&&clearInterval(e.flushInterval),e.eventListenerDispose?.(),e.eventListenerDispose=void 0,e.toolCallIdToRequestId.clear();try{await this.sdkSession.notifyRemoteSteerableChanged(!1)}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`runtime remote steerable notification failed: ${nee(r)}`)}e.eventBuffer.push(this.createEvent(e,"session.remote_steerable_changed",{remoteSteerable:!1})),e.eventBuffer.push(this.createEvent(e,"session.idle",{})),await this.flush(),e.disposed=!0,this.remoteCtx.logger.info(this.remoteCtx.ctx,`Mission Control disabled for session ${this.sessionId}`)}}getMcSessionId(){return this.state?.mcSessionId}async deleteRemote(){let e=this.state?.mcSessionId;e&&await this.remoteCtx.client.deleteSession(e)}getStatus(){let e=this.state;return!e||e.disposed?{remoteSteerable:!1}:{url:e.frontendUrl,remoteSteerable:!0}}createEvent(e,r,n,o){let s=(0,hZn.randomUUID)(),c={id:s,timestamp:new Date().toISOString(),parentId:e.lastEventId??null,type:r,data:n,...o!==void 0?{ephemeral:o}:{}};return e.lastEventId=s,c}bufferEvent(e,r){if(!dZn(r))return;this.trackInteractionRequestId(e,r),this.maybeAutoDeriveTitle(e,r);let n=r.id,o=r.timestamp,s=r.parentId,c=r.ephemeral;typeof n=="string"&&typeof o=="string"?(e.eventBuffer.push({id:n,timestamp:o,parentId:typeof s=="string"?s:e.lastEventId??null,...typeof c=="boolean"?{ephemeral:c}:{},type:r.type??"unknown",data:jfr(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",jfr(r))),e.eventBuffer.length>XDe&&e.eventBuffer.splice(0,e.eventBuffer.length-XDe)}maybeAutoDeriveTitle(e,r){if(e.titleSent)return;if(r.type==="session.title_changed"){e.titleSent=!0;return}if(r.type!=="user.message")return;let n=r.data?.content,o=Tjs(typeof n=="string"?n:"");o&&(e.eventBuffer.push(this.createEvent(e,"session.title_changed",{title:o},!0)),e.titleSent=!0)}trackInteractionRequestId(e,r){let n=r.data;if(n)switch(r.type){case"permission.requested":{let o=n.requestId,s=n.permissionRequest?.toolCallId;typeof o=="string"&&typeof s=="string"&&this.registerInteractionMapping(e,s,o);return}case"user_input.requested":{let o=n.requestId,s=n.toolCallId;typeof o=="string"&&typeof s=="string"&&this.registerInteractionMapping(e,s,o);return}case"permission.completed":{let o=n.toolCallId;typeof o=="string"&&e.toolCallIdToRequestId.delete(o);return}case"user_input.completed":{let o=n.requestId;if(typeof o=="string"){for(let[s,c]of e.toolCallIdToRequestId)if(c===o){e.toolCallIdToRequestId.delete(s);break}}return}}}registerInteractionMapping(e,r,n){if(e.toolCallIdToRequestId.size>=Sjs){let o=e.toolCallIdToRequestId.keys().next().value;o!==void 0&&e.toolCallIdToRequestId.delete(o)}e.toolCallIdToRequestId.set(r,n)}async flush(){let e=this.state;if(!e||e.disposed||e.flushInFlight)return;if(!this.circuitBreaker.canRequest()){e.eventBuffer.length>XDe&&e.eventBuffer.splice(0,e.eventBuffer.length-XDe);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=vjs;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,Cjs);e.lastSubmitAttemptTimeMs=Date.now();try{await this.remoteCtx.client.submitEvents(e.mcSessionId,c,s)?this.circuitBreaker.recordSuccess():(this.circuitBreaker.recordFailure(),e.eventBuffer.length+c.length<=XDe&&e.eventBuffer.unshift(...c),e.completedCommandIds.unshift(...s))}finally{e.flushInFlight=!1}}async poll(){let e=this.state;if(!(!e||e.disposed)&&!e.pollInFlight){e.pollInFlight=!0;try{let r=await this.remoteCtx.client.getPendingCommands(e.mcSessionId),n=new Set(r.map(o=>o.id));for(let o of e.processedCommandIds)n.has(o)||e.processedCommandIds.delete(o);for(let o of r){if(o.state!=="in_progress"||e.processedCommandIds.has(o.id))continue;e.processedCommandIds.add(o.id);let s=typeof o.content=="string"?o.content.length>120?o.content.slice(0,120)+"\u2026":o.content:"";this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch start: id=${o.id} type=${o.type??""} preview=${JSON.stringify(s)}`);let c=!1;try{await this.dispatchCommand(e,o),c=o.type===void 0||o.type===""||o.type==="user_message",this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch ok: id=${o.id} type=${o.type??""}`)}catch(l){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc dispatch ${o.type??"user_message"} failed: ${nee(l)}`)}(c||o.type!==void 0&&o.type!==""&&o.type!=="user_message")&&e.completedCommandIds.push(o.id)}}finally{e.pollInFlight=!1}}}async dispatchCommand(e,r){switch(r.type){case"abort":{await this.sdkSession.abort?.();return}case"permission_response":{let n=pZn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s=bjs(n);try{await this.sdkSession.respondToPermission(o,s)||this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc permission_response did not match a pending request (promptId=${n.promptId}, requestId=${o})`)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc permission_response forward failed (promptId=${n.promptId}, requestId=${o}): ${nee(c)}`)}return}case"ask_user_response":{let n=pZn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s={answer:typeof n.answer=="string"?n.answer:"",wasFreeform:n.wasFreeform===!0};try{await this.sdkSession.respondToUserInput(o,s)||this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc ask_user_response did not match a pending request (promptId=${n.promptId}, requestId=${o})`)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc ask_user_response forward failed (promptId=${n.promptId}, requestId=${o}): ${nee(c)}`)}return}case"mode_switch":{this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc mode_switch ignored (cmd ${r.id})`);return}default:{await this.remoteCtx.injectUserMessage(this.sessionId,r.content);return}}}};function pZn(t){try{return JSON.parse(t)}catch{return}}a(pZn,"safeJsonParse");function nee(t){return t instanceof Error?t.message:String(t)}a(nee,"errMsg");function Tjs(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>fZn?e.slice(0,fZn-1).trimEnd()+"\u2026":e:""}a(Tjs,"deriveTitleFromMessage");function Ijs(t){if(/^[a-zA-Z]:[\\/]/.test(t)){let r=t[0],n=t.slice(2).replace(/\\/g,"/").replace(/^\/+/,""),o=`/${r.toLowerCase()}:/${n}`,s=`file:///${r.toLowerCase()}%3A/${encodeURI(n).replace(/%2F/g,"/")}`;return{$mid:1,fsPath:t,_sep:1,external:s,path:o,scheme:"file"}}return{$mid:1,fsPath:t,external:`file://${encodeURI(t).replace(/%2F/g,"/")}`,path:t,scheme:"file"}}a(Ijs,"toVscodeUriShape");var Hfr=new pe("BackgroundAgent.RemoteController"),iut=class{constructor(e,r){this.ctx=e;this.deps=r;this.delegates=new Map;this.remoteStatuses=new Map;this.registeredStatusCleanups=new Set}static{a(this,"RemoteController")}attachLazy(e,r){let n=this.delegates.get(e);if(n)return n;let o=this.deps.registry.getWorkingDir(e);if(!o)throw new Error(`Mission Control: working directory unknown for session ${e}; cannot attach delegate.`);let s=new tut(this.ctx,Hfr,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new nut(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:Hfr,ctx:this.ctx,injectUserMessage:a((l,u)=>this.deps.injectUserMessage(l,u),"injectUserMessage")});return this.delegates.set(e,c),this.deps.registry.registerChild(e,{dispose:a(()=>this.fireAndForgetTearDown(e),"dispose")}),c}async enableForSession(e,r){let o=await this.attachLazy(e,r).enable();return this.remoteStatuses.set(e,o),this.registerStatusCleanup(e),o}async disableForSession(e){let r=this.delegates.get(e.sessionId);r&&(await r.disable(),this.remoteStatuses.set(e.sessionId,{remoteSteerable:!1}))}getStatus(e){let r=this.remoteStatuses.get(e);if(r)return r;let n=this.delegates.get(e);return n?n.getStatus():{remoteSteerable:!1}}delegateCount(){return this.delegates.size}fireAndForgetTearDown(e){let r=this.delegates.get(e);r&&(this.delegates.delete(e),this.remoteStatuses.delete(e),r.disable().catch(()=>{}))}async tearDownForDestroy(e){let r=this.delegates.get(e);if(r){try{await r.disable()}catch{}try{await r.deleteRemote()}catch(n){Hfr.warn(this.ctx,"Mission Control deleteSession failed during destroySession",{sessionId:e,error:n instanceof Error?n.message:String(n)})}this.delegates.delete(e),this.remoteStatuses.delete(e)}}registerStatusCleanup(e){this.registeredStatusCleanups.has(e)||(this.registeredStatusCleanups.add(e),this.deps.registry.registerChild(e,{dispose:a(()=>{this.remoteStatuses.delete(e),this.registeredStatusCleanups.delete(e)},"dispose")}))}async getMissionControlApiBase(){let n=(await this.ctx.get(Qt).getToken()).endpoints.api;if(!n)throw new Error("Copilot API endpoint not available");return n}async getGithubAccessToken(){let e=await this.ctx.get(Or).resolveSession();if(!e?.accessToken)throw new Error("Not authenticated");return e.accessToken}getCopilotIntegrationId(){return"vscode-chat"}addDelegateForTesting(e,r){this.delegates.set(e,r),this.deps.registry.registerChild(e,{dispose:a(()=>this.fireAndForgetTearDown(e),"dispose")})}delegatesForTesting(){return this.delegates}};p();p();var Gfr=new pe("BackgroundAgent.CustomAgents");async function mZn(t,e){try{if(kt(t,ze.EnableCustomAgents)===!1)return Gfr.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get(Kd).listCustomAgents([e],{includePlugins:!0});return o.length>0&&Gfr.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>xjs(s))}catch(r){return Gfr.warn(t,"Failed to load custom agents:",r),[]}}a(mZn,"loadCustomAgents");function xjs(t){let e=t.instruction??"";return{name:t.name,displayName:t.name,description:t.description??"",tools:Rjs(t.tools),prompt:e,infer:!0,model:t.model}}a(xjs,"toSweCustomAgent");var wjs=new Map([["semantic_search",["grep","rg","glob","view"]],["read_file",["view"]],["list_dir",["glob"]],["file_search",["glob"]],["grep_search",["grep","rg"]],["insert_edit_into_file",["edit","str_replace_editor","apply_patch"]],["replace_string_in_file",["edit","str_replace_editor","apply_patch"]],["create_file",["create"]],["run_in_terminal",["bash","powershell"]],["get_terminal_output",["read_bash","read_powershell"]],["run_subagent",["task"]],["manage_todo_list",["update_todo"]],["validate_cves",["gh-advisory-database"]],["ask_questions",["ask_user"]]]);function Rjs(t){if(t===void 0)return null;let e=[],r=new Set;for(let n of t){let s=wjs.get(n)??[n];for(let c of s)r.has(c)||(r.add(c),e.push(c))}return e}a(Rjs,"mapCustomAgentTools");p();var eNe=new pe("BackgroundAgent.Hooks"),tNe="copilot-language-server";function gZn(t,e){return{sessionStart:[kjs(t,e)],sessionEnd:[Pjs(t,e)],preToolUse:[Djs(t,e)],postToolUse:[Njs(t,e)],userPromptSubmitted:[Mjs(t,e)]}}a(gZn,"buildSessionHooks");function kjs(t,e){return{source:tNe,handler:a(async r=>{try{await t.get(N0).hook(t,VF,{timestamp:nNe(r.timestamp),cwd:r.workingDirectory,source:r.source,...r.initialPrompt!==void 0&&{initialPrompt:r.initialPrompt}},e)}catch(n){eNe.error(t,"Failed to execute SessionStart hook",n)}},"handler")}}a(kjs,"createSessionStartHandler");function Pjs(t,e){return{source:tNe,handler:a(async r=>{try{await t.get(N0).hook(t,$F,{timestamp:nNe(r.timestamp),cwd:r.workingDirectory,reason:r.reason},e)}catch(n){eNe.error(t,"Failed to execute SessionEnd hook",n)}},"handler")}}a(Pjs,"createSessionEndHandler");function Djs(t,e){return{source:tNe,handler:a(async r=>{try{let o=await t.get(N0).hook(t,N2,{timestamp:nNe(r.timestamp),cwd:un(e.uri),toolName:r.toolName,toolArgs:rNe(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===Jde.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){eNe.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(Djs,"createPreToolUseHandler");function Njs(t,e){return{source:tNe,handler:a(async r=>{try{await t.get(N0).hook(t,D2,{timestamp:nNe(r.timestamp),cwd:un(e.uri),toolName:r.toolName,toolArgs:rNe(r.toolArgs),toolResult:{resultType:$fr(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){eNe.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(Njs,"createPostToolUseHandler");function Mjs(t,e){return{source:tNe,handler:a(async r=>{try{await t.get(N0).hook(t,M2,{timestamp:nNe(r.timestamp),cwd:un(e.uri),prompt:r.prompt},e);return}catch(n){eNe.error(t,"Failed to execute UserPromptSubmitted hook",n);return}},"handler")}}a(Mjs,"createUserPromptSubmittedHandler");function rNe(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(rNe,"safeStringifyToolArgs");function $fr(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a($fr,"toClsToolResultType");function nNe(t){return t instanceof Date?t.getTime():t}a(nNe,"toHookTimestamp");p();var Ojs=["model-agents-md","cwd-model-agents-md"],Ljs=["model-claude-md","cwd-model-claude-md"],Bjs="nested-agents";function AZn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of Ojs)e.add(r);if(t.useClaudeMdFile===!1)for(let r of Ljs)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(Bjs),e}a(AZn,"computeDisabledInstructionSources");var Fjs=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),Ujs=2,Qjs="CLAUDE.md",qjs="AGENTS.md";function jjs(t,e){if(e.length===0)return t;let r=t.includes("\\")&&!t.includes("/")?"\\":"/";return[t.endsWith("/")||t.endsWith("\\")?t.slice(0,-1):t,...e].join(r)}a(jjs,"joinPath");async function Hjs(t,e,r){let n=[],o=a(async(s,c)=>{let l;try{l=await t(jjs(e,s))}catch{return}for(let[u,d]of l){let f=(d&1)!==0,h=(d&2)!==0;f&&u===r&&s.length>0?n.push([...s,r].join("/")):h&&co.content.trim().length>0);if(r.length===0)return;let n=r.map(o=>[`<${e}-instructions path="${o.relativePath}">`,o.content.trim(),``].join(` `));return[`Here are nested ${e} files that contain additional agent instructions.`,...n].join(` -`)}a(jjs,"buildNestedInstructionsSection");async function gZn(t,e,r,n){let o=await qjs(t,r,n),s=await Promise.all(o.map(async c=>({relativePath:c,content:await e(c)??""})));return jjs(s,n)}a(gZn,"scanNestedInstructionsSection");function AZn(t,e,r){return gZn(t,e,r,Fjs)}a(AZn,"scanNestedClaudeInstructions");function yZn(t,e,r){return gZn(t,e,r,Ujs)}a(yZn,"scanNestedAgentsInstructions");function _Zn(t){let e=[];if(t.gitCommitInstructions&&e.push(t.gitCommitInstructions),t.globalAgentsMdInstructions&&e.push(t.globalAgentsMdInstructions),t.nestedAgentsInstructions&&e.push(t.nestedAgentsInstructions),t.globalClaudeMdInstructions&&e.push(t.globalClaudeMdInstructions),t.nestedClaudeInstructions&&e.push(t.nestedClaudeInstructions),e.length!==0)return e.join(` +`)}a(Gjs,"buildNestedInstructionsSection");async function yZn(t,e,r,n){let o=await Hjs(t,r,n),s=await Promise.all(o.map(async c=>({relativePath:c,content:await e(c)??""})));return Gjs(s,n)}a(yZn,"scanNestedInstructionsSection");function _Zn(t,e,r){return yZn(t,e,r,Qjs)}a(_Zn,"scanNestedClaudeInstructions");function EZn(t,e,r){return yZn(t,e,r,qjs)}a(EZn,"scanNestedAgentsInstructions");function vZn(t){let e=[];if(t.gitCommitInstructions&&e.push(t.gitCommitInstructions),t.globalAgentsMdInstructions&&e.push(t.globalAgentsMdInstructions),t.nestedAgentsInstructions&&e.push(t.nestedAgentsInstructions),t.globalClaudeMdInstructions&&e.push(t.globalClaudeMdInstructions),t.nestedClaudeInstructions&&e.push(t.nestedClaudeInstructions),e.length!==0)return e.join(` -`)}a(_Zn,"composeBackgroundAgentSystemMessage");p();p();p();p();var iNe=(n=>(n.Copilot="copilot",n.Claude="claude",n.OpenPlugin="openPlugin",n))(iNe||{});var rG=(n=>(n.GitHubShorthand="githubShorthand",n.GitUri="gitUri",n.LocalFileUri="localFileUri",n))(rG||{}),sut=(r=>(r.User="user",r.Policy="policy",r))(sut||{});p();p();var nee=require("fs"),dme=fe(require("path"));var Hjs=32,Gjs=5e3,$js=5*1024*1024,Vjs=32,Wjs=k0n(Vjs);async function rI(t,e){return Wjs.run(()=>LO(t(),Gjs,e))}a(rI,"boundedFsOp");async function $fr(t){let e=await rI(()=>nee.promises.stat(t),void 0);if(e)return{path:t,isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:!1}}a($fr,"statEntry");async function oNe(t){let e=await rI(()=>nee.promises.readdir(t,{withFileTypes:!0}),void 0);return e?ZC(e,Hjs,async r=>{let n=dme.join(t,r.name);if(r.isSymbolicLink()){let o=await $fr(n);return{path:n,isFile:o?.isFile??!1,isDirectory:o?.isDirectory??!1,isSymlink:!0}}return{path:n,isFile:r.isFile(),isDirectory:r.isDirectory(),isSymlink:!1}}):[]}a(oNe,"readChildren");var EZn=process.platform==="linux";function cy(t,e){let r=EZn?t:t.toLowerCase(),n=EZn?e:e.toLowerCase(),o=dme.relative(r,n);return o===""||!o.startsWith("..")&&!dme.isAbsolute(o)}a(cy,"isAtOrUnder");async function AR(t,e){if(t===void 0)return!0;let r=await rI(()=>nee.promises.realpath(e),void 0);return r!==void 0&&cy(t,r)}a(AR,"withinRealBoundary");async function iee(t){if(t!==void 0)return rI(()=>nee.promises.realpath(t),t)}a(iee,"resolveRealBoundary");async function sNe(t){let e=await rI(()=>nee.promises.stat(t),void 0);if(!(!e||!e.isFile()||e.size>$js))return rI(()=>nee.promises.readFile(t,"utf8"),void 0)}a(sNe,"readTextFileCapped");var vZn=require("fs"),Vfr=fe(require("path"));function nI(t){let e=t.replace(/[\\/:*?"<>|]/g,"_");return/^\.+$/.test(e)?e.replace(/\./g,"_"):e}a(nI,"sanitizeCacheSegment");function fme(t){return t?[`ref_${encodeURIComponent(t)}`]:[]}a(fme,"refCacheSegment");function aut(t,e){return e?[`sha_${encodeURIComponent(e)}`]:fme(t)}a(aut,"gitRevisionCacheSuffix");function CZn(t,e,r){try{let n=new URL(t),o=nI((n.host||"unknown").toLowerCase()),s=n.pathname.replace(/\/+/g,"/").replace(/^\/+/,"").replace(/\/+$/g,"").replace(/\.git$/i,""),c=s?s.split("/").map(nI):[];return[o,...c,...aut(e,r)]}catch{return["git",nI(t),...aut(e,r)]}}a(CZn,"gitUrlToCacheSegments");async function of(t){return rI(()=>vZn.promises.stat(t).then(()=>!0,()=>!1),!1)}a(of,"exists");function aNe(t,e){let r=Vfr.join(t,...e);if(!cy(t,r))throw new Error(`plugin cache path escapes the cache root: ${e.join("/")}`);return r}a(aNe,"joinCacheSegments");function cNe(t,e){if(!e)return t;let r=e.trim().replace(/^\.?\/+|\/+$/g,"");if(!r)return t;let n=Vfr.join(t,r);return cy(t,n)?n:t}a(cNe,"joinContained");var cut=require("node:url");function bZn(t){let e=new Map;for(let r of t){let n=$0(r);n&&!e.has(n.canonicalId)&&e.set(n.canonicalId,n)}return[...e.values()]}a(bZn,"parseMarketplaceReferences");function $0(t){let e=t.trim();if(e)return Yjs(e)??Kjs(e)??zjs(e)}a($0,"parseMarketplaceReference");function zjs(t){let e=/^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)(?:#(.+))?$/.exec(t);if(!e)return;let[,r,n,o]=e;return{rawValue:t,displayLabel:t,cloneUrl:`https://github.com/${r}/${n}.git`,canonicalId:TZn(r,n,o),cacheSegments:["github.com",nI(r),nI(n),...fme(o)],kind:"githubShorthand",ref:o,githubRepo:`${r}/${n}`}}a(zjs,"parseShorthandMarketplaceReference");function Yjs(t){let e;try{e=new URL(t)}catch{return}let r=e.protocol.replace(/:$/,"").toLowerCase();if(r==="file"&&/^file:\/\//i.test(t)){if(e.hash)return;let y;try{y=(0,cut.fileURLToPath)(e)}catch{return}return{rawValue:t,displayLabel:y,cloneUrl:t,canonicalId:`file:${(0,cut.pathToFileURL)(y).toString().toLowerCase()}`,cacheSegments:[],kind:"localFileUri",localRepositoryUri:y}}if(r!=="http"&&r!=="https"&&r!=="ssh"||!e.host)return;let n=e.hash?e.hash.slice(1):void 0,o=Jjs(e),s=e.host.toLowerCase(),c=nI(s),l=e.pathname.replace(/\/+/g,"/").replace(/\/+$/g,"").replace(/^\/+/,"");if(!l)return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:Wfr(`git:${s}/`,n),cacheSegments:[c,...fme(n)],kind:"gitUri",ref:n};let u=".git",d=l.toLowerCase().endsWith(u),f=d?l.slice(0,-u.length):l,h=f.split("/").map(nI),m=d?l.toLowerCase():`${l.toLowerCase()}${u}`,g=SZn(s,f),A=IZn(g,n,`git:${s}/${m}`);return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:A,cacheSegments:[c,...h,...fme(n)],kind:"gitUri",ref:n,githubRepo:g}}a(Yjs,"parseUriMarketplaceReference");function Kjs(t){let e=/^([^@\s]+)@([^:\s]+):(.+?\.git)(?:#(.+))?$/i.exec(t);if(!e)return;let r=".git",[,n,o,s,c]=e,l=s.replace(/^\/+/,"");if(!l.toLowerCase().endsWith(r))return;let u=l.slice(0,-r.length),d=u.split("/").map(nI),f=SZn(o,u),h=IZn(f,c,`git:${o.toLowerCase()}/${l.toLowerCase()}`);return{rawValue:t,displayLabel:t,cloneUrl:`${n}@${o}:${l}`,canonicalId:h,cacheSegments:[nI(o.toLowerCase()),...d,...fme(c)],kind:"gitUri",ref:c,githubRepo:f}}a(Kjs,"parseScpMarketplaceReference");function Jjs(t){if(!t.hash)return t.toString();let e=new URL(t.toString());return e.hash="",e.toString()}a(Jjs,"refStrippedUrl");function SZn(t,e){if(t.toLowerCase()!=="github.com")return;let r=e.split("/");if(r.length>=2&&r[0]&&r[1])return`${r[0]}/${r[1]}`}a(SZn,"extractGitHubRepo");function TZn(t,e,r){return Wfr(`github:${t.toLowerCase()}/${e.toLowerCase()}`,r)}a(TZn,"getGitHubCanonicalId");function IZn(t,e,r){if(t){let[n,o]=t.split("/");return TZn(n,o,e)}return Wfr(r,e)}a(IZn,"gitCanonicalId");function Wfr(t,e){return e?`${t}#${encodeURIComponent(e)}`:t}a(Wfr,"appendRefSuffix");p();p();p();p();function xZn(t,e){return/^~(?=$|[/\\])/.test(t)?e+t.slice(1):t}a(xZn,"untildify");var Zjs=200;function lut(t,e){return zfr(t,e,new Set,0)}a(lut,"cloneAndChange");function zfr(t,e,r,n){if(t==null)return t;let o=e(t);if(o!==void 0)return o;if(n>=Zjs)throw new Error("Cannot clone: structure nested too deeply");if(Array.isArray(t))return t.map(s=>zfr(s,e,r,n+1));if(typeof t=="object"){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let s={};for(let c of Object.keys(t))s[c]=zfr(t[c],e,r,n+1);return r.delete(t),s}return t}a(zfr,"cloneAndChangeInner");function lNe(t,e=!1){if(!t||typeof t!="object")return;let r={};for(let[n,o]of Object.entries(t))typeof o=="string"?r[n]=o:e&&typeof o=="number"&&(r[n]=String(o));return Object.keys(r).length>0?r:void 0}a(lNe,"toStringRecord");var uut=fe(require("path"));var eHs=/[\s&|<>()^;!`"'$]/;function tHs(t){return t.replace(/(\\*)("|$)/g,(e,r,n)=>r+r+(n?'\\"':""))}a(tHs,"escapeWindowsDoubleQuoted");function rHs(t,e,r){if(!t.includes(r))return t;if(!eHs.test(e))return t.replaceAll(r,e);let n=process.platform==="win32",o=new RegExp(`(["']?)${Ese(r)}([\\w./\\\\~:@-]*)`,"g");return t.replace(o,(s,c,l)=>{let u=e+l;if(c==="'")return c+u.replace(/'/g,"'\\''");let d=n?tHs(u):u.replace(/([\\"$`])/g,"\\$&");return c?c+d:'"'+d+'"'})}a(rHs,"shellQuotePluginRootInCommand");var nHs={SessionStart:"SessionStart",SessionEnd:"SessionEnd",UserPromptSubmit:"UserPromptSubmit",PreToolUse:"PreToolUse",PostToolUse:"PostToolUse",PreCompact:"PreCompact",SubagentStart:"SubagentStart",SubagentStop:"SubagentStop",Stop:"Stop",ErrorOccurred:"ErrorOccurred",sessionStart:"SessionStart",sessionEnd:"SessionEnd",userPromptSubmitted:"UserPromptSubmit",preToolUse:"PreToolUse",postToolUse:"PostToolUse",agentStop:"Stop",subagentStop:"SubagentStop",errorOccurred:"ErrorOccurred"};function iHs(t){if(t.type!==void 0&&t.type!=="command")return;let e=a(f=>typeof f=="string"&&f.length>0?f:void 0,"str"),r=e(t.command),n=e(t.bash),o=e(t.powershell),s=e(t.windows)??o,c=e(t.linux)??n,l=e(t.osx)??n;if(!r&&!s&&!c&&!l)return;let u=typeof t.timeout=="number"?t.timeout:typeof t.timeoutSec=="number"?t.timeoutSec:void 0,d=lNe(t.env,!0);return{...r&&{command:r},...s&&{windows:s},...c&&{linux:c},...l&&{osx:l},...d&&{env:d},...u!==void 0&&{timeout:u}}}a(iHs,"normalizeHookCommand");function wZn(t,e){let r=iHs(t);if(!r)return;let n,o=typeof t.cwd=="string"?t.cwd:void 0;if(o){let s=xZn(o,e);n=uut.isAbsolute(s)?uut.normalize(s):s}return{...r,...n!==void 0&&{cwd:n}}}a(wZn,"resolveHookCommand");function oHs(t,e){if(!t||typeof t!="object")return[];let r=t,n=[],o=r.hooks;if(Array.isArray(o)){for(let s of o)if(s&&typeof s=="object"){let c=wZn(s,e);c&&n.push(c)}}else{let s=wZn(r,e);s&&n.push(s)}return n}a(oHs,"extractHookCommands");function Kfr(t,e,r){if(!e||typeof e!="object")return[];let n=e;if(n.disableAllHooks===!0)return[];let o=n.hooks;if(!o||typeof o!="object")return[];let s=o,c=[];for(let l of Object.keys(s)){let u=nHs[l];if(!u)continue;let d=s[l];if(!Array.isArray(d))continue;let f=[];for(let h of d)f.push(...oHs(h,r));f.length>0&&c.push({type:u,hooks:f,uri:t,originalId:l})}return c}a(Kfr,"parseHooksJson");function Yfr(t,e,r){if(Array.isArray(t)){let n=t;for(let o=0;o{for(let d of["command","windows","linux","osx"]){let f=u[d];typeof f=="string"&&(u[d]=rHs(f,c,o))}(!u.env||typeof u.env!="object")&&(u.env={}),u.env[s]=c},"mutateHookCommand");try{let u=lut(e,()=>{});for(let d of Object.values(u.hooks??{}))if(Array.isArray(d))for(let f of d){if(!f||typeof f!="object")continue;let h=f;if(Array.isArray(h.hooks))for(let m of h.hooks)m&&typeof m=="object"&&l(m);else l(h)}return Yfr(u,o,c),Kfr(t,u,n)}catch{return[]}}a(Jfr,"interpolateHookPluginRoot");p();var lpr=require("fs");cpr();function mNe(t){try{return apr(t)}catch{return}}a(mNe,"parseJsonc");async function gme(t,e){let r=await rI(()=>lpr.promises.stat(t),void 0);if(!r||!r.isFile()||e!==void 0&&r.size>e)return;let n=await rI(()=>lpr.promises.readFile(t,"utf8"),void 0);if(n!==void 0)return mNe(n)}a(gme,"readJsoncFile");var nG=fe(require("path"));var IHs={format:0,manifestPath:"plugin.json",altManifestPaths:[".github/plugin/plugin.json"],hookConfigPath:"hooks.json",altHookConfigPaths:["hooks/hooks.json"],pluginRootToken:void 0,pluginRootEnvVar:void 0,parseHooks(t,e,r,n){return Kfr(t,e,n)}},xHs={format:1,manifestPath:".claude-plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${CLAUDE_PLUGIN_ROOT}",pluginRootEnvVar:"CLAUDE_PLUGIN_ROOT",parseHooks(t,e,r,n){return Jfr(t,e,r,n,"${CLAUDE_PLUGIN_ROOT}","CLAUDE_PLUGIN_ROOT")}},wHs={format:2,manifestPath:".plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${PLUGIN_ROOT}",pluginRootEnvVar:"PLUGIN_ROOT",parseHooks(t,e,r,n){return Jfr(t,e,r,n,"${PLUGIN_ROOT}","PLUGIN_ROOT")}};async function QZn(t){return await of(nG.join(t,".plugin","plugin.json"))?wHs:t.split(/[/\\]/).includes(".claude")||await of(nG.join(t,".claude-plugin","plugin.json"))?xHs:IHs}a(QZn,"detectPluginFormat");async function qZn(t,e,r){let n=await iee(r);for(let o of[e.manifestPath,...e.altManifestPaths??[]]){let s=nG.join(t,o);if(!await AR(n,s))continue;let c=await sNe(s),l=c===void 0?void 0:mNe(c);if(l&&typeof l=="object"&&!Array.isArray(l))return{manifest:l,manifestUri:s}}}a(qZn,"readPluginManifest");function jZn(t){return[t.hookConfigPath,...t.altHookConfigPaths??[]]}a(jZn,"defaultHookConfigPaths");var upr={paths:[],exclusive:!1};function Ame(t){if(t==null)return upr;if(typeof t=="string"){let e=t.trim();return e?{paths:[e],exclusive:!1}:upr}if(Array.isArray(t))return{paths:UZn(t),exclusive:!1};if(typeof t=="object"){let e=t;if(Array.isArray(e.paths))return{paths:UZn(e.paths),exclusive:e.exclusive===!0}}return upr}a(Ame,"parseComponentPathConfig");function UZn(t){return t.filter(e=>typeof e=="string").map(e=>e.trim()).filter(e=>e.length>0)}a(UZn,"cleanPaths");function gut(t,e,r,n){let o=n&&cy(n,t)?n:t,s=[];r.exclusive||s.push(nG.join(t,e));for(let c of r.paths){let l=nG.normalize(nG.join(t,c));cy(o,l)&&s.push(l)}return s}a(gut,"resolveComponentDirs");p();p();var oI=fe(require("path"));var GZn=new GO,gNe=16,HZn=".md",RHs=[".instructions.md",".mdc",".md"];async function kHs(t){let e=oI.basename(t).replace(/(\.agent)?\.md$/i,"");return $Zn(t,e)}a(kHs,"parseAgentFile");async function PHs(t){return $Zn(t,oI.basename(oI.dirname(t)))}a(PHs,"parseSkillFile");async function $Zn(t,e){let r=await sNe(t);if(r===void 0)return{name:e};try{let n=GZn.parse(t,r).header,o=n?.name?.trim()||e,s=n?.description?.trim();return{name:o,...s&&{description:s}}}catch{return{name:e}}}a($Zn,"readNameDescription");async function DHs(t){let e=await sNe(t);if(e!==void 0)try{return GZn.parse(t,e).header?.description?.trim()||void 0}catch{return}}a(DHs,"parseCommandDescription");async function VZn(t,e,r){let n=await iee(r),s=(await ZC(e,gNe,async d=>{if(!await AR(n,d))return[];let f=oI.join(d,"SKILL.md");if(await of(f)&&await AR(n,f))return[f];let h=(await oNe(d)).filter(g=>g.isDirectory);return h.sort((g,A)=>g.path.localeCompare(A.path)),(await ZC(h,gNe,async g=>{if(g.isSymlink&&!await AR(n,g.path))return;let A=oI.join(g.path,"SKILL.md");if(!(!await of(A)||!await AR(n,A)))return A})).filter(g=>g!==void 0)})).flat();if(s.length===0){let d=oI.join(t,"SKILL.md");await of(d)&&await AR(n,d)&&s.push(d)}let c=await ZC(s,gNe,async d=>({uri:d,...await PHs(d)})),l=new Set,u=[];for(let{uri:d,name:f,description:h}of c)l.has(d)||(l.add(d),u.push({uri:d,name:f,...h&&{description:h}}));return u.sort((d,f)=>d.name.localeCompare(f.name)),u}a(VZn,"readSkills");async function WZn(t,e,r){let n=await iee(r),o=new Set,s=[],c=a(l=>{let u=e(l);u&&!o.has(u)&&(o.add(u),s.push({uri:l,name:u}))},"addItem");for(let l of t){if(!await AR(n,l))continue;let u=await $fr(l);if(!u)continue;if(u.isFile){c(l);continue}if(!u.isDirectory)continue;let d=await oNe(l);d.sort((f,h)=>f.path.localeCompare(h.path));for(let f of d)f.isFile&&(f.isSymlink&&!await AR(n,f.path)||c(f.path))}return s.sort((l,u)=>l.name.localeCompare(u.name)),s}a(WZn,"scanComponentFiles");function NHs(t){return oI.extname(t).toLowerCase()===HZn?oI.basename(t).slice(0,-HZn.length):void 0}a(NHs,"getMarkdownComponentName");function zZn(t,e){return WZn(t,NHs,e)}a(zZn,"readMarkdownComponents");async function YZn(t,e){let r=await zZn(t,e);return ZC(r,gNe,async n=>{let o=await DHs(n.uri);return{...n,...o&&{description:o}}})}a(YZn,"readCommandComponents");async function KZn(t,e){let r=await zZn(t,e);if(r.length===0)return r;let n=await ZC(r,gNe,async c=>{let{name:l,description:u}=await kHs(c.uri);return{uri:c.uri,name:l||c.name,...u&&{description:u}}}),o=new Set,s=n.filter(c=>o.has(c.name)?!1:(o.add(c.name),!0));return s.sort((c,l)=>c.name.localeCompare(l.name)),s}a(KZn,"readAgentComponents");function MHs(t){let e=oI.basename(t),r=e.toLowerCase(),n=RHs.find(o=>r.endsWith(o));return n?e.slice(0,-n.length):void 0}a(MHs,"getInstructionFileName");function JZn(t,e){return WZn(t,MHs,e)}a(JZn,"readInstructionComponents");p();function OHs(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(Object.hasOwn(e,"mcpServers")){let r=e.mcpServers;return!r||typeof r!="object"||Array.isArray(r)?void 0:r}return e}a(OHs,"resolveMcpServersMap");function LHs(t){if(!t||typeof t!="object")return;let e=t,r=a(h=>typeof h=="string"&&h.trim()?h.trim():void 0,"str"),n=r(e.type),o=r(e.command),s=r(e.url),c=Array.isArray(e.args)?e.args.filter(h=>typeof h=="string"):void 0,l=lNe(e.env,!0),u=r(e.envFile),d=r(e.cwd),f=lNe(e.headers);if(n!=="ws"){if(n==="stdio"||!n&&o)return o?{type:"stdio",command:o,...c&&{args:c},...l&&{env:l},...d!==void 0&&{cwd:d},...u!==void 0&&{envFile:u}}:void 0;if(n==="http"||n==="sse"||!n&&s)return s?{type:"http",url:s,...f&&{headers:f}}:void 0}}a(LHs,"normalizeMcpServerConfiguration");function BHs(t,e,r,n){let o=a(l=>l.replaceAll(r,()=>e),"replace"),s=t.configuration,c;if(s.type==="stdio"){let l={};for(let[u,d]of Object.entries(s.env??{}))l[u]=o(d);l[n]=e,c={type:"stdio",command:o(s.command),...s.args&&{args:s.args.map(o)},env:l,...s.cwd!==void 0&&{cwd:o(s.cwd)},...s.envFile!==void 0&&{envFile:o(s.envFile)}}}else c={type:"http",url:o(s.url),...s.headers&&{headers:Object.fromEntries(Object.entries(s.headers).map(([l,u])=>[l,o(u)]))}};return{name:t.name,configuration:c,uri:t.uri}}a(BHs,"interpolateMcpPluginRoot");var FHs=/\$\{(?![A-Za-z]+:)([A-Z_][A-Z0-9_]*)\}/g;function UHs(t){return lut(t,e=>{if(typeof e=="string"){let r=e.replace(FHs,"${env:$1}");return r!==e?r:void 0}})}a(UHs,"convertBareEnvVarsToVsCodeSyntax");function dpr(t,e,r,n){let o=OHs(e);if(!o)return[];let s=[];for(let[c,l]of Object.entries(o)){let u=LHs(l);if(!u)continue;let d={name:c,configuration:u,uri:t};n.pluginRootToken&&n.pluginRootEnvVar&&(d=BHs(d,r,n.pluginRootToken,n.pluginRootEnvVar)),d=UHs(d),s.push(d)}return s}a(dpr,"parseMcpServerDefinitionMap");p();var iG=require("fs"),j_=fe(require("path"));var ppr=".copilot",Aut="installed-plugins",ZZn=j_.join(ppr,Aut),XZn="config.json",ANe=5e3,yNe=16,hpr=5*1024*1024;async function aee(t){return rI(()=>t().then(e=>({ok:!0,value:e}),e=>({ok:!1,code:e.code??"error"})),{ok:!1,code:"timeout"})}a(aee,"boundedFsResult");function fpr(t){return t==="ENOENT"||t==="ENOTDIR"}a(fpr,"isAbsentCode");async function eXn(t){let e=await aee(()=>iG.promises.stat(j_.dirname(t)));return e.ok&&e.value.isDirectory()}a(eXn,"parentDirSurvives");async function mpr(t){let e=await aee(()=>iG.promises.stat(t));return e.ok||e.code!=="ENOENT"?!1:eXn(t)}a(mpr,"isDefinitivelyGone");var QHs={name:"marketplace",discover:HHs},qHs={name:"copilotCli",discover:GHs,changeSignal:{dir:a(t=>t.copilotHome,"dir"),files:new Set([XZn]),createDir:!1,listing:a(t=>zHs(t.copilotHome),"listing")}},jHs={name:"enterprise",discover:WHs},yme=[QHs,qHs,jHs];async function tXn(t){let e=await Promise.all(yme.map(o=>o.discover(t))),r=new Set,n=[];for(let o of e)for(let s of o){let c=Eg(s.fsPath);r.has(c)||(r.add(c),n.push(s))}return n}a(tXn,"discoverPlugins");async function HHs(t){return(await ZC(t.installed,yNe,async r=>{let n;if(j_.isAbsolute(r.pluginUri))n=r.pluginUri;else{let u=j_.resolve(t.sharedContentDir,r.pluginUri);if(!cy(t.sharedContentDir,u))return;n=u}let o=await aee(()=>iG.promises.stat(n));if(o.ok){if(!o.value.isDirectory())return}else if(o.code==="ENOENT"&&await eXn(n))return;let s=$0(r.marketplace),c;if(s)try{c=t.getRepositoryUri(s)}catch{c=void 0}let l=await t.resolveMarketplace(r);return{uri:r.pluginUri,fsPath:n,displayName:r.name,readOnly:yut(n,t.copilotHome),...l&&{fromMarketplace:l},...c!==void 0&&{repositoryBoundary:c}}})).filter(r=>r!==void 0)}a(HHs,"discoverMarketplace");async function GHs(t){return(await rXn(t.copilotHome)??[]).map(r=>({uri:r.fsPath,fsPath:r.fsPath,readOnly:!0,...r.displayName!==void 0&&{displayName:r.displayName}}))}a(GHs,"discoverCopilotCli");var $Hs=/^([^@/\\~]+)@([^@/\\~]+)$/;function VHs(t,e){let r=$Hs.exec(t.trim());if(!r)return;let[,n,o]=r;if(n==="."||n===".."||o==="."||o==="..")return;let s=j_.resolve(e,Aut),c=j_.resolve(s,o,n);return cy(s,c)?c:void 0}a(VHs,"resolveForceEnabledPluginPath");async function WHs(t){return t.forceEnabledIds.length===0?[]:(await ZC(t.forceEnabledIds,yNe,async r=>{let n=VHs(r,t.copilotHome);if(n===void 0)return;let o=await aee(()=>iG.promises.stat(n));if(!(!o.ok||!o.value.isDirectory()))return{uri:n,fsPath:n,readOnly:yut(n,t.copilotHome)}})).filter(r=>r!==void 0)}a(WHs,"discoverEnterprise");async function rXn(t){return LO(YHs(t),ANe,void 0)}a(rXn,"listCopilotCliInstalls");async function zHs(t){return(await rXn(t))?.map(e=>e.fsPath)}a(zHs,"listCopilotCliPluginDirs");async function YHs(t){let e=j_.join(t,Aut),[r,n]=await Promise.all([KHs(t),JHs(e)]);if(r===void 0&&n===void 0)return;let o=[];for(let u of r??[]){let f=(u.cachePath!==void 0&&j_.isAbsolute(u.cachePath)?u.cachePath:void 0)??(u.name!==void 0&&u.marketplace!==void 0?j_.join(e,u.marketplace,u.name):void 0);f!==void 0&&o.push({fsPath:f,...u.name!==void 0&&{displayName:u.name}})}let s=await ZC(o,yNe,async u=>await mpr(u.fsPath)?void 0:u),c=[],l=new Set;for(let u of s){if(u===void 0)continue;let d=Eg(u.fsPath);l.has(d)||(l.add(d),c.push({fsPath:u.fsPath,...u.displayName!==void 0&&{displayName:u.displayName}}))}for(let u of n??[]){let d=Eg(u);l.has(d)||(l.add(d),c.push({fsPath:u}))}return c}a(YHs,"collectCopilotCliInstalls");async function KHs(t){let e=j_.join(t,XZn),r=await aee(()=>iG.promises.stat(e));if(!r.ok)return fpr(r.code)?[]:void 0;if(!r.value.isFile()||r.value.size>hpr)return;let n=await aee(()=>iG.promises.readFile(e,"utf8"));if(!n.ok)return fpr(n.code)?[]:void 0;let o=n.value,s;try{s=JSON.parse(o)}catch{return}let c=s?.installedPlugins;if(!Array.isArray(c))return[];let l=[];for(let u of c){if(u===null||typeof u!="object")continue;let d=u;l.push({name:typeof d.name=="string"?d.name:void 0,marketplace:typeof d.marketplace=="string"?d.marketplace:void 0,cachePath:typeof d.cache_path=="string"?d.cache_path:void 0})}return l}a(KHs,"readCliInstalledPlugins");async function JHs(t){let e=await aee(()=>iG.promises.readdir(t,{withFileTypes:!0}));if(!e.ok)return fpr(e.code)?[]:void 0;let r=e.value,n=[];for(let o of r)if(o.isDirectory())for(let s of await oNe(j_.join(t,o.name)))s.isDirectory&&n.push(s.path);return n}a(JHs,"scanCopilotCliPluginDirs");function yut(t,e){return cy(j_.join(e,Aut),t)}a(yut,"isCopilotCliPath");var gpr=fe(require("path"));var ZHs="commands",XHs="skills",eGs="agents",tGs="rules",rGs=".mcp.json";async function iXn(t,e,r){let n=r.repositoryBoundary,o=n&&cy(n,t)?n:t,s=await iee(o),c=await qZn(t,e,s),l=c?.manifest,u=c?.manifestUri??gpr.join(t,e.manifestPath),d=a((v,S)=>gut(t,S,Ame(l?.[v]),n),"dirsFor"),[f,h,m,g,A,y]=await Promise.all([YZn(d("commands",ZHs),s),VZn(t,d("skills",XHs),s),KZn(d("agents",eGs),s),JZn(d("rules",tGs),s),nGs(t,l,u,e,n,s,r),oGs(t,l,u,e,n,s)]),_=l?.name,E=typeof _=="string"&&_.trim()?_.trim():void 0;return{hooks:A,commands:f,skills:h,agents:m,instructions:g,mcpServerDefinitions:y,...E&&{manifestName:E}}}a(iXn,"readPluginContributions");function _ut(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&!Object.hasOwn(t,"paths")}a(_ut,"isEmbeddedSection");async function oXn(t,e){if(await AR(e,t))return gme(t,hpr)}a(oXn,"readJsoncWithinBoundary");async function nGs(t,e,r,n,o,s,c){let l=e?.hooks;if(_ut(l)){let h=Object.hasOwn(l,"hooks")||Object.hasOwn(l,"disableAllHooks")?l:{hooks:l},m=nXn(n,r,h,t,c);if(m.length>0)return m}let u=_ut(l)?Ame(void 0):Ame(l),d=iGs(t,n,u,o);for(let f of d){let h=await oXn(f,s);if(h)return nXn(n,f,h,t,c)}return[]}a(nGs,"readHooks");function nXn(t,e,r,n,o){try{return t.parseHooks(e,r,n,o.userHome)}catch{return[]}}a(nXn,"parseHooksSafely");function iGs(t,e,r,n){let o=[];if(!r.exclusive)for(let s of jZn(e))o.push(gpr.join(t,s));for(let s of gut(t,"",{paths:r.paths,exclusive:!0},n))o.includes(s)||o.push(s);return o}a(iGs,"resolveHookConfigPaths");async function oGs(t,e,r,n,o,s){let c=new Map,l=a(d=>{for(let f of d)c.has(f.name)||c.set(f.name,f)},"add"),u=e?.mcpServers;if(_ut(u)&&l(dpr(r,{mcpServers:u},t,n)),c.size===0){let d=_ut(u)?Ame(void 0):Ame(u),f=gut(t,rGs,d,o);for(let h of f){let m=await oXn(h,s);m&&l(dpr(h,m,t,n))}}return[...c.values()].sort((d,f)=>d.name.localeCompare(f.name))}a(oGs,"readMcpServers");p();var sXn=require("fs"),Apr=fe(require("path"));var sGs=new Set(["installed.json","enablement.json"]);function ypr(t){return(e,r)=>{let n=Eg(e.path);return Apr.posix.dirname(n)===r&&t.has(Apr.posix.basename(n))}}a(ypr,"matchNamedFiles");var aXn=ypr(sGs),_Ne=class{constructor(e,r,n,o,s=50){this.ctx=e;this.dir=r;this.debounceMs=s;this.logger=new pe("PluginFileWatcher");this._onDidChange=new Lc;this.onDidChange=this._onDidChange.event;this._disposed=!1;this._dirKey=Eg(r),this._recursive=n.recursive??!1,this._createDir=n.createDir??!0,this._matches=n.matches,this._watcher=o??kKe(e),this._ownsWatcher=o===void 0}static{a(this,"PluginFileWatcher")}async start(){if(!this._disposed)try{if(this._createDir)await sXn.promises.mkdir(this.dir,{recursive:!0,mode:448});else if(!await of(this.dir))return;if(this._disposed)return;this._changeSubscription=this._watcher.onDidChange(e=>this.onEvents(e)),this._watchHandle=this._watcher.watch({path:this.dir,recursive:this._recursive})}catch(e){this.logger.warn(this.ctx,"failed to start watching plugin dir",{dir:this.dir,err:String(e)})}}onEvents(e){this._disposed||e.some(r=>this._matches(r,this._dirKey))&&this.scheduleFire()}scheduleFire(){this._debounceTimer===void 0&&(this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this._disposed||this._onDidChange.fire()},this.debounceMs))}dispose(){this._disposed||(this._disposed=!0,this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),this._watchHandle?.dispose(),this._changeSubscription?.dispose(),this._ownsWatcher&&this._watcher.dispose(),this._onDidChange.dispose())}};p();var cXn=require("fs"),lXn=fe(require("path"));var aGs=new pe("plugins.git"),cGs=12e4,Eut=class{constructor(e){this.ctx=e;this.gitInstances=new Map}static{a(this,"PluginGitService")}async cloneRepository(e,r,n){try{let o=lXn.dirname(r);await cXn.promises.mkdir(o,{recursive:!0,mode:448}),await(await this.instanceFor(o)).clone(e,r)}catch(o){throw aGs.warn(this.ctx,`clone failed for ${T4(e)}`,o),new cme(e,o)}}async checkout(e,r,n){await(await this.instanceFor(e)).checkout(n?["--detach",r]:[r])}async pull(e){if(!await this.isOnBranch(e))return!1;let r=await this.instanceFor(e),n=await this.revParse(e,"HEAD").catch(()=>{});await r.pull();let o=await this.revParse(e,"HEAD").catch(()=>{});return n!==o}async isOnBranch(e){let n=(await(await this.instanceFor(e)).raw(["rev-parse","--abbrev-ref","HEAD"])).trim();return n!==""&&n!=="HEAD"}async revParse(e,r){return(await(await this.instanceFor(e)).revparse([r])).trim()}async fetch(e){await(await this.instanceFor(e)).fetch()}async revListCount(e,r,n){let s=(await(await this.instanceFor(e)).raw(["rev-list","--count",`${r}..${n}`])).trim(),c=Number.parseInt(s,10);return Number.isFinite(c)?c:0}async instanceFor(e){let r=this.gitInstances.get(e);return r||(this._binary===void 0&&(this._binary=(await jO()).path),r=Qde({baseDir:e,binary:this._binary,unsafe:{allowUnsafeCustomBinary:!0},timeout:{block:cGs}}),this.gitInstances.set(e,r)),r}forget(e){this.gitInstances.delete(e)}dispose(){this.gitInstances.clear()}};p();var vut=class{constructor(e,r){this.repository=e;this.marketplace=r}static{a(this,"PluginInstallService")}async acquirePlugin(e){let r=await this.repository.ensurePluginSource(e);if(!await of(r))throw new cme(e.marketplaceReference.cloneUrl,"plugin content not found after acquisition");return r}async resolveFromSource(e){let r=await this.repository.ensureRepository(e),n=await this.marketplace.readPluginsFromDirectory(r,e);if(n.length>0)return{reference:e,plugins:n,isSinglePluginRepo:!1};let o=await this.marketplace.readSinglePluginManifest(r,e);return o?{reference:e,plugins:[o],isSinglePluginRepo:!0}:{reference:e,plugins:[],isSinglePluginRepo:!1}}async resolveInstalled(e){let r=$0(e.marketplace);if(!r)return;let n=this.repository.getRepositoryUri(r);if(await of(n)){let s=(await this.marketplace.readPluginsFromDirectory(n,r)).find(l=>l.name===e.name);if(s)return s;let c=await this.marketplace.readSinglePluginManifest(n,r);if(c)return c}if(r.kind==="githubShorthand"&&r.githubRepo)return uXn({kind:"github",repo:r.githubRepo},r,e.name);if(r.kind==="gitUri")return uXn({kind:"url",url:r.cloneUrl},r,e.name)}};function uXn(t,e,r){return{name:r,description:"",version:"",sourceDescriptor:t,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:"openPlugin"}}a(uXn,"synthesizePlugin");p();p();var lGs=new pe("plugins.catalog");function _pr(t,e,r,n){return Array.isArray(t.plugins)?t.plugins.filter(s=>s!=null&&typeof s.name=="string"&&s.name.length>0).flatMap(s=>{let c=s.name,l=uGs(s.source,t.metadata?.pluginRoot,c,n);return l?[{name:c,description:typeof s.description=="string"?s.description:"",version:typeof s.version=="string"?s.version:"",sourceDescriptor:l,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:r}]:[]}):[]}a(_pr,"parseMarketplaceCatalog");function uGs(t,e,r,n){let o=a(s=>{n&&lGs.warn(n,`skipping plugin '${r}': ${s}`)},"skip");if(t==null||typeof t=="string"){let c=dGs(typeof e=="string"?e:void 0,t??"");return c===void 0?o("could not resolve relative source path"):{kind:"relativePath",path:c}}if(typeof t!="object"||typeof t.source!="string")return o("source object is missing a 'source' discriminant");switch(t.source){case"github":return typeof t.repo!="string"||!t.repo?o("github source is missing required 'repo' field"):pGs(t.repo)?!_me(t.ref)||!_me(t.path)?o("github source 'ref'/'path' must be strings when provided"):fXn(t.sha)?{kind:"github",repo:t.repo,ref:t.ref,sha:t.sha,path:t.path}:o("github source 'sha' must be a 40-character commit hash when provided"):o("github source 'repo' must be in 'owner/repo' format");case"url":case"git-subdir":return typeof t.url!="string"||!t.url?o(`${t.source} source is missing required 'url' field`):t.source==="url"&&!t.url.toLowerCase().endsWith(".git")?o("url source must end with '.git'"):_me(t.ref)?fXn(t.sha)?t.source==="git-subdir"&&(typeof t.path!="string"||!t.path)?o("git-subdir source is missing required 'path' field"):t.source==="url"&&!_me(t.path)?o("url source 'path' must be a string when provided"):{kind:"url",url:t.url,ref:t.ref,sha:t.sha,path:t.path}:o(`${t.source} source 'sha' must be a 40-character commit hash when provided`):o(`${t.source} source 'ref' must be a string when provided`);case"npm":case"pip":return typeof t.package!="string"||!t.package?o(`${t.source} source is missing required 'package' field`):!_me(t.version)||!_me(t.registry)?o(`${t.source} source 'version'/'registry' must be strings when provided`):{kind:t.source==="npm"?"npm":"pip",package:t.package,version:t.version,registry:t.registry};default:return o(`unknown source kind '${t.source}'`)}}a(uGs,"parsePluginSource");function dGs(t,e){let r=dXn(t??""),n=dXn(e);return r&&(n===r||n.startsWith(`${r}/`))?n:fGs(`/${r}/${n}`).replace(/^\/+/,"")}a(dGs,"resolvePluginSource");function dXn(t){return t.trim().replace(/\\/g,"/").replace(/^\.?\/+/,"").replace(/\/+$/g,"")}a(dXn,"normalizeMarketplacePath");function fGs(t){let e=[];for(let r of t.split("/"))r===""||r==="."||(r===".."?e.pop():e.push(r));return`/${e.join("/")}`}a(fGs,"posixNormalize");function _me(t){return t===void 0||typeof t=="string"}a(_me,"isOptionalString");function fXn(t){return t===void 0||typeof t=="string"&&/^[0-9a-fA-F]{40}$/.test(t)}a(fXn,"isOptionalGitSha");function pGs(t){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(t)}a(pGs,"isValidGitHubRepo");var vNe=fe(require("path"));var Eme=new pe("plugins.marketplace"),hGs=480*60*1e3,mGs=3e4,gGs=15e4,pXn=[{type:"openPlugin",path:"marketplace.json"},{type:"openPlugin",path:".plugin/marketplace.json"},{type:"copilot",path:".github/plugin/marketplace.json"},{type:"claude",path:".claude-plugin/marketplace.json"}],AGs=[{type:"openPlugin",path:".plugin/plugin.json"},{type:"claude",path:".claude-plugin/plugin.json"},{type:"copilot",path:"plugin.json"}],Cut=class{constructor(e,r){this.ctx=e;this.repository=r;this.githubCatalogCache=new Map}static{a(this,"PluginMarketplaceService")}async fetchMarketplacePlugins(e,r){let n=await Promise.all(e.map(o=>this.fetchOneBounded(o,r)));return{plugins:n.flatMap(o=>o.plugins),errors:n.flatMap(o=>o.error?[o.error]:[])}}fetchOneBounded(e,r){let n=e.kind==="githubShorthand"&&e.githubRepo?this.fetchFromGitHubRepo(e,e.githubRepo,r):this.fetchFromClonedRepo(e,r);return this.withReferenceDeadline(n,e,r)}withReferenceDeadline(e,r,n){return new Promise(o=>{let s=!1,c=a(d=>{s||(s=!0,clearTimeout(l),u?.dispose(),o(d))},"finish"),l=setTimeout(()=>{Eme.debug(this.ctx,"marketplace fetch exceeded deadline",{reference:r.rawValue}),c({plugins:[],error:_Gs(r)})},gGs);l.unref?.();let u=n?.onCancellationRequested(()=>c({plugins:[]}));n?.isCancellationRequested&&c({plugins:[]}),e.then(c,d=>c({plugins:[],error:hXn(r,d)}))})}async readPluginsFromDirectory(e,r,n){return this.readPluginsFromDefinitions(r,async o=>{if(!n?.isCancellationRequested)return gme(vNe.join(e,o))},e)}async readAllPluginsFromDirectory(e,r,n){let o=new Map;for(let s of pXn){if(n?.isCancellationRequested)return[];let c=await gme(vNe.join(e,s.path));if(!(!c?.plugins||!Array.isArray(c.plugins)))for(let l of _pr(c,r,s.type,this.ctx))o.has(l.name)||o.set(l.name,mXn(l,e))}return[...o.values()]}async readSinglePluginManifest(e,r){if(!(r.kind!=="githubShorthand"&&r.kind!=="gitUri")){for(let n of AGs){let o=await gme(vNe.join(e,n.path));if(!o||typeof o!="object"||Array.isArray(o))continue;let s=r.kind==="githubShorthand"?{kind:"github",repo:r.githubRepo}:{kind:"url",url:r.cloneUrl};return{name:typeof o.name=="string"&&o.name?o.name:r.displayLabel,description:typeof o.description=="string"?o.description:"",version:typeof o.version=="string"?o.version:"",sourceDescriptor:s,marketplace:r.displayLabel,marketplaceReference:r,marketplaceType:n.type,readmeUri:r.githubRepo?yXn(r.githubRepo,""):AXn(e,"")}}Eme.debug(this.ctx,"no single-plugin manifest found",{reference:r.rawValue})}}clearCache(){this.githubCatalogCache.clear()}async fetchFromGitHubRepo(e,r,n){let o=this.getCachedCatalog(e.canonicalId);if(o)return{plugins:o.map(d=>EGs(d,e))};let s=!0,c,l=encodeURIComponent(e.ref??"main"),u=await this.readPluginsFromDefinitions(e,async d=>{if(n?.isCancellationRequested)return;let f=`https://raw.githubusercontent.com/${r}/${l}/${d}`,h=yGs(n);try{let m=await this.ctx.get(Jt).fetch(f,{method:"GET",timeout:mGs,signal:h.signal});if(m.status!==200){m.status>=500&&(c=m.status),s&&=m.status>=400&&m.status<500;return}return mNe(await m.text())}catch(m){Eme.debug(this.ctx,"raw marketplace fetch failed",{url:f,err:String(m)});return}finally{h.dispose()}});return u.length>0?(this.setCachedCatalog(e.canonicalId,u),{plugins:u}):s?(Eme.debug(this.ctx,"repo may be private; falling back to clone",{repo:r}),this.fetchFromClonedRepo(e,n)):c!==void 0?{plugins:[],error:{reference:e.displayLabel,canonicalId:e.canonicalId,kind:"unavailable",status:c,message:`Marketplace '${e.displayLabel}' is temporarily unavailable (HTTP ${c})`}}:{plugins:[]}}async fetchFromClonedRepo(e,r){if(r?.isCancellationRequested)return{plugins:[]};let n;try{n=await this.repository.ensureRepository(e)}catch(o){return Eme.debug(this.ctx,"failed to prepare marketplace repository",{reference:e.rawValue,err:String(o)}),{plugins:[],error:hXn(e,o)}}return{plugins:await this.readPluginsFromDirectory(n,e,r)}}async readPluginsFromDefinitions(e,r,n){for(let o of pXn){let s=await r(o.path);if(!(!s?.plugins||!Array.isArray(s.plugins)))return _pr(s,e,o.type,this.ctx).map(c=>mXn(c,n))}return Eme.debug(this.ctx,"no marketplace catalog found",{reference:e.rawValue}),[]}now(){return this.ctx.get(HC).now().getTime()}getCachedCatalog(e){let r=this.githubCatalogCache.get(e);if(r){if(r.expiresAt<=this.now()){this.githubCatalogCache.delete(e);return}return r.plugins}}setCachedCatalog(e,r){this.githubCatalogCache.set(e,{plugins:r,expiresAt:this.now()+hGs})}};function yGs(t){let e={dispose(){}};if(!t)return e;let r=new AbortController;if(t.isCancellationRequested)return r.abort(),{signal:r.signal,...e};let n=t.onCancellationRequested(()=>r.abort());return{signal:r.signal,dispose:a(()=>n.dispose(),"dispose")}}a(yGs,"abortSignalFor");function _Gs(t){return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:"unavailable",message:`Marketplace '${t.displayLabel}' did not respond in time`}}a(_Gs,"deadlineError");function hXn(t,e){let r=e instanceof Error?e.message:String(e),n=e instanceof lme?"localMissing":"cloneFailed";return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:n,message:r}}a(hXn,"toFetchError");function EGs(t,e){return{...t,marketplace:e.displayLabel,marketplaceReference:e}}a(EGs,"restamp");function mXn(t,e){let r=t.sourceDescriptor.kind==="relativePath"?t.sourceDescriptor.path:"",n=e?AXn(e,r):yXn(t.marketplaceReference.githubRepo??"",r);return{...t,readmeUri:n}}a(mXn,"withReadme");function gXn(t){let e=t.trim().replace(/^\.?\/+|\/+$/g,"");return e?`${e}/README.md`:"README.md"}a(gXn,"readmeRelPath");function AXn(t,e){return vNe.join(t,gXn(e))}a(AXn,"fileReadmeUri");function yXn(t,e){return`https://github.com/${t}/blob/main/${gXn(e)}`}a(yXn,"githubBlobReadmeUri");p();var vXn=require("node:url");var _Xn=`/${ZZn.replace(/\\/g,"/")}/`,vGs="_direct";function Cpr(t,e){let r=t.fromMarketplace;if(r){let u=e?.(r.marketplaceReference.canonicalId)??r.marketplace;return`${r.name}@${u}`}let n=t.uri.replace(/\\/g,"/"),o=n.indexOf(_Xn);if(o===-1)return;let s=n.slice(o+_Xn.length).split("/").filter(u=>u.length>0);if(s.length!==2||s[0]===vGs)return;let[c,l]=s;return`${l}@${c}`}a(Cpr,"getPluginPolicyId");function CXn(t){let e=new Map;for(let[r,n]of Object.entries(t??{})){let o=IXn(n.source);o&&e.set(o.canonicalId,r)}return e}a(CXn,"managedMarketplaceLabels");function bXn(t,e){return t!==void 0&&e?.[t]===!1}a(bXn,"isPluginBlockedByPolicy");function vme(t){return t.enabled&&t.policyBlocked!==!0}a(vme,"isEffectivelyEnabled");function SXn(t){return Object.entries(t??{}).filter(([,e])=>e===!0).map(([e])=>e)}a(SXn,"managedForceEnabledIds");function TXn(t,e){let r=new Map;for(let n of t)r.has(n.canonicalId)||r.set(n.canonicalId,{...n,origin:"user"});for(let[n,o]of Object.entries(e??{})){let s=IXn(o.source);s&&r.set(s.canonicalId,{...s,displayLabel:n,origin:"policy"})}return[...r.values()]}a(TXn,"composeKnownMarketplaces");function bpr(t,e){return t===void 0?!0:t.some(r=>CGs(r,e))}a(bpr,"isMarketplaceAllowed");function CGs(t,e){switch(t.source){case"github":return t.path===void 0&&Epr(xXn(t.repo,t.ref),e);case"git":return t.path===void 0&&Epr(Spr(t.url,t.ref),e);case"url":return Epr(t.url,e);case"file":case"directory":return e.kind==="localFileUri"&&e.localRepositoryUri!==void 0&&vpr(e.localRepositoryUri)===vpr(t.path);case"hostPattern":return EXn(t.hostPattern,bGs(e));case"pathPattern":return e.kind==="localFileUri"&&e.localRepositoryUri!==void 0?EXn(t.pathPattern,e.localRepositoryUri):!1;case"npm":return!1}}a(CGs,"matchesStrictEntry");function Epr(t,e){return $0(t)?.canonicalId===e.canonicalId}a(Epr,"matchesByCanonicalId");function EXn(t,e){if(e===void 0)return!1;try{return new RegExp(t).test(e)}catch{return!1}}a(EXn,"matchesPattern");function IXn(t){switch(t.source){case"github":return $0(xXn(t.repo,t.ref));case"git":return $0(Spr(t.url,t.ref));case"directory":return $0(vpr(t.path))}}a(IXn,"managedSourceToReference");function xXn(t,e){return Spr(t,e)}a(xXn,"githubRawRef");function Spr(t,e){return e?`${t}#${e}`:t}a(Spr,"withRef");function vpr(t){return(0,vXn.pathToFileURL)(t).toString()}a(vpr,"pathToFileUrl");function bGs(t){if(t.kind==="githubShorthand")return"github.com";if(t.kind!=="gitUri")return;let e=/^[\w._-]+@([\w.-]+):/.exec(t.cloneUrl);if(e)return e[1].toLowerCase();try{return new URL(t.cloneUrl).hostname.toLowerCase()||void 0}catch{return}}a(bGs,"refHost");p();p();var Cme=require("fs"),wXn=fe(require("path"));var SGs=1e4,TGs=3e4,IGs=25;async function bme(t,e){await Cme.promises.mkdir(wXn.dirname(t),{recursive:!0,mode:448});let r=Date.now()+TGs;for(;;)try{await Cme.promises.writeFile(t,`${process.pid} -`,{flag:"wx",mode:384});break}catch(n){if(n.code!=="EEXIST")throw n;if(Date.now()>r)throw new Error(`withFileLock: timed out acquiring lock ${JSON.stringify(t)}`);await xGs(t)>SGs&&await Cme.promises.rm(t,{force:!0}).catch(()=>{}),await JC(IGs)}try{return await e()}finally{await Cme.promises.rm(t,{force:!0}).catch(()=>{})}}a(bme,"withFileLock");async function xGs(t){try{let e=await Cme.promises.stat(t);return Date.now()-e.mtimeMs}catch{return 1/0}}a(xGs,"lockAgeMs");p();var Sme=require("fs"),cee=fe(require("path"));var wGs=new pe("plugins.source"),RGs=0,RXn=".clone-tmp";function kGs(t){try{return process.kill(t,0),!0}catch(e){return e.code==="EPERM"}}a(kGs,"isProcessAlive");async function PGs(t){let e=cee.dirname(t),r=`${cee.basename(t)}.`,n;try{n=await Sme.promises.readdir(e)}catch{return}await Promise.all(n.map(async o=>{if(!o.startsWith(r)||!o.endsWith(RXn))return;let s=Number.parseInt(o.slice(r.length).split(".")[0],10);!Number.isInteger(s)||s<=0||s===process.pid||kGs(s)||await Sme.promises.rm(cee.join(e,o),{recursive:!0,force:!0}).catch(()=>{})}))}a(PGs,"sweepOrphanedCloneTemps");async function Tpr(t,e,r,n,o){if(await of(r))return;await PGs(r);let s=`${r}.${process.pid}.${RGs++}${RXn}`;try{await t.git.cloneRepository(e,s,n),o?await t.git.checkout(s,o,!0):n&&await t.git.checkout(s,n),await bme(`${r}.lock`,async()=>{await of(r)||(await Sme.promises.mkdir(cee.dirname(r),{recursive:!0,mode:448}),await Sme.promises.rename(s,r))})}finally{t.git.forget(s),await Sme.promises.rm(s,{recursive:!0,force:!0}).catch(()=>{})}}a(Tpr,"cloneIntoPlace");var but=class{constructor(){this.kind="relativePath"}static{a(this,"RelativePathPluginSource")}getInstallUri(){throw new Error("Use PluginRepositoryService.getPluginInstallUri() for relative-path sources")}ensure(){throw new Error("Use PluginRepositoryService.ensureRepository() for relative-path sources")}update(){throw new Error("Use PluginRepositoryService.pullRepository() for relative-path sources")}getCleanupTarget(){}getLabel(e){return e.path||"."}},Sut=class{constructor(e){this.deps=e}static{a(this,"AbstractGitPluginSource")}getCleanupTarget(e,r){return this.getRepoDir(e,r)}async ensure(e,r){let n=r.sourceDescriptor,o=this.getRepoDir(e,n);return await of(o)?await this.checkoutRevision(o,n):await Tpr(this.deps,this.cloneUrl(n),o,n.ref,n.sha),this.getInstallUri(e,n)}async update(e,r){let n=r.sourceDescriptor,o=this.getRepoDir(e,n);if(!await of(o))return wGs.warn(this.deps.ctx,`cannot update '${r.name}': source repository not cloned`,{repoDir:o}),!1;if(!n.sha&&await this.deps.git.isOnBranch(o)){let l=await this.deps.git.pull(o);return await this.checkoutRevision(o,n),l}let s=await this.deps.git.revParse(o,"HEAD").catch(()=>{});await this.deps.git.fetch(o),await this.checkoutRevision(o,n);let c=await this.deps.git.revParse(o,"HEAD").catch(()=>{});return s!==c}async checkoutRevision(e,r){r.sha?await this.deps.git.checkout(e,r.sha,!0):r.ref&&await this.deps.git.checkout(e,r.ref)}},Tut=class extends Sut{constructor(){super(...arguments);this.kind="github"}static{a(this,"GitHubPluginSource")}getInstallUri(r,n){let o=n;return cNe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n,[s,c]=o.repo.split("/");return aNe(r,["github.com",nI(s),nI(c),...aut(o.ref,o.sha)])}getLabel(r){let n=r;return n.path?`${n.repo}/${n.path}`:n.repo}cloneUrl(r){return`https://github.com/${r.repo}.git`}},Iut=class extends Sut{constructor(){super(...arguments);this.kind="url"}static{a(this,"GitUrlPluginSource")}getInstallUri(r,n){let o=n;return cNe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n;return aNe(r,CZn(o.url,o.ref,o.sha))}getLabel(r){let n=r;return n.path?`${n.url}/${n.path}`:n.url}cloneUrl(r){return r.url}};var CNe=require("fs"),lee=fe(require("path"));var DGs=0,xut=class{constructor(e,r,n){this.ctx=e;this.store=r;this.git=n;this.logger=new pe("plugins.repository");this.cloneSequencer=new _w;this.cacheRoot=r.sharedContentDir;let o={ctx:e,git:n};this.sources=new Map([["relativePath",new but],["github",new Tut(o)],["url",new Iut(o)]])}static{a(this,"PluginRepositoryService")}getPluginSource(e){let r=this.sources.get(e);if(!r)throw new zlt(e);return r}getRepositoryUri(e){return e.kind==="localFileUri"&&e.localRepositoryUri?e.localRepositoryUri:aNe(this.cacheRoot,e.cacheSegments)}getPluginInstallUri(e){let r=e.sourceDescriptor;if(r.kind!=="relativePath")return this.getPluginSourceInstallUri(r);let n=this.getRepositoryUri(e.marketplaceReference);return cNe(n,r.path)}getPluginSourceInstallUri(e){return this.getPluginSource(e.kind).getInstallUri(this.cacheRoot,e)}async ensureRepository(e){let r=this.getRepositoryUri(e);return this.cloneSequencer.queue(r,async()=>{if(await of(r))return r;if(e.kind==="localFileUri")throw new lme(r);return await Tpr({ctx:this.ctx,git:this.git},e.cloneUrl,r,e.ref),r})}async ensurePluginSource(e){return e.sourceDescriptor.kind==="relativePath"?(await this.ensureRepository(e.marketplaceReference),this.getPluginInstallUri(e)):this.getPluginSource(e.sourceDescriptor.kind).ensure(this.cacheRoot,e)}async updatePluginSource(e){return e.sourceDescriptor.kind==="relativePath"?this.pullRepository(e.marketplaceReference):this.getPluginSource(e.sourceDescriptor.kind).update(this.cacheRoot,e)}async pullRepository(e){if(e.kind==="localFileUri")return!1;let r=this.getRepositoryUri(e);return await of(r)?this.git.pull(r):(this.logger.warn(this.ctx,"cannot pull: repository not cloned",{repoDir:r}),!1)}async fetchRepository(e){if(e.kind==="localFileUri")return!1;let r=this.getRepositoryUri(e);if(!await of(r))return!1;try{return await this.git.fetch(r),await this.git.revListCount(r,"HEAD","@{u}")>0}catch(n){return this.logger.debug(this.ctx,"silent fetch failed",{repoDir:r,err:String(n)}),!1}}async cleanupPluginSource(e){let r=this.sources.get(e.sourceDescriptor.kind);if(!r)return;let n=r.getCleanupTarget(this.cacheRoot,e.sourceDescriptor);if(!n||!cy(this.cacheRoot,n))return;let o=!1,s=`${n}.gc-${process.pid}-${DGs++}`;if(await bme(`${n}.lock`,async()=>{if(await this.isCloneReferenced(n)){this.logger.info(this.ctx,"skipping cleanup: clone still referenced by another editor",{cleanupDir:n});return}try{await of(n)&&await CNe.promises.rename(n,s),o=!0}catch(c){this.logger.warn(this.ctx,"failed to vacate plugin clone",{cleanupDir:n,err:String(c)})}}),!!o){try{await CNe.promises.rm(s,{recursive:!0,force:!0}),this.logger.info(this.ctx,"removed plugin clone",{cleanupDir:n})}catch(c){this.logger.warn(this.ctx,"failed to remove vacated plugin clone",{tombstone:s,err:String(c)})}await this.pruneEmptyParents(n).catch(c=>this.logger.warn(this.ctx,"failed to prune empty parents",{cleanupDir:n,err:String(c)}))}}async isCloneReferenced(e){return(await this.store.readInstalledForAllEditors()).some(n=>{let o=lee.isAbsolute(n.pluginUri)?n.pluginUri:lee.resolve(this.cacheRoot,n.pluginUri);return cy(e,o)})}async pruneEmptyParents(e){let r=lee.dirname(e);for(;cy(this.cacheRoot,r)&&r!==this.cacheRoot;){try{if((await CNe.promises.readdir(r)).length>0)break;await CNe.promises.rmdir(r)}catch{break}r=lee.dirname(r)}}};p();p();function kXn(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.pluginUri=="string"&&typeof e.name=="string"&&typeof e.marketplace=="string"}a(kXn,"isInstalledEntry");var oG=require("fs"),sD=fe(require("path"));var PXn="plugins",LGs="plugins",BGs="installed.json",FGs="enablement.json",UGs="marketplaces.json",QGs=".lock",qGs=0,DXn=a(t=>typeof t=="string","isString"),bNe=class t{constructor(e){this.rootDir=e}static{a(this,"PluginStore")}get sharedContentDir(){return sD.join(this.rootDir,PXn)}editorPluginsDir(e){return sD.join(this.rootDir,this.safeEditorSegment(e),LGs)}installedJsonPath(e){return sD.join(this.editorPluginsDir(e),BGs)}enablementJsonPath(e){return sD.join(this.editorPluginsDir(e),FGs)}marketplacesJsonPath(e){return sD.join(this.editorPluginsDir(e),UGs)}async readInstalled(e){let{version:r,items:n}=await this.readManifest(this.installedJsonPath(e),"installed",1,kXn);return{version:r,installed:n}}async readEnablement(e){let{version:r,items:n}=await this.readManifest(this.enablementJsonPath(e),"disabled",1,DXn);return{version:r,disabled:n}}async readMarketplaces(e){let{version:r,items:n}=await this.readManifest(this.marketplacesJsonPath(e),"marketplaces",1,DXn);return{version:r,marketplaces:n}}async readManifest(e,r,n,o){let s=await this.readJson(e),c=s?.[r];return Array.isArray(c)?{version:typeof s?.version=="number"?s.version:n,items:c.filter(o)}:{version:n,items:[]}}async writeInstalled(e,r){await this.writeJsonAtomic(this.installedJsonPath(e),r)}async writeEnablement(e,r){await this.writeJsonAtomic(this.enablementJsonPath(e),r)}async writeMarketplaces(e,r){await this.writeJsonAtomic(this.marketplacesJsonPath(e),r)}async withLock(e,r){let n=sD.join(this.editorPluginsDir(e),QGs);return bme(n,r)}async listEditorIds(){let e;try{e=await oG.promises.readdir(this.rootDir,{withFileTypes:!0})}catch{return[]}let r=e.filter(o=>(o.isDirectory()||o.isSymbolicLink())&&t.isSafeEditorId(o.name)),n=await Promise.all(r.map(o=>oG.promises.stat(this.installedJsonPath(o.name)).then(s=>s.isFile(),()=>!1)));return r.filter((o,s)=>n[s]).map(o=>o.name)}async readInstalledForAllEditors(){let e=await this.listEditorIds();return(await Promise.all(e.map(n=>this.readInstalled(n)))).flatMap(n=>n.installed)}static isSafeEditorId(e){return!(!e||e==="."||e===".."||e.toLowerCase()===PXn||e!==sD.basename(e)||/[/\\]/.test(e)||process.platform==="win32"&&/[<>:"|?*]/.test(e))}safeEditorSegment(e){if(!t.isSafeEditorId(e))throw new Error(`PluginStore: unsafe editorId ${JSON.stringify(e)}`);return e}async readJson(e){try{let r=await oG.promises.readFile(e,{encoding:"utf8"});return JSON.parse(r)}catch{return}}async writeJsonAtomic(e,r){let n=sD.dirname(e);await oG.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${qGs++}.tmp`,s=JSON.stringify(r,null,2)+` -`;try{await oG.promises.writeFile(o,s,{encoding:"utf8",mode:384}),await oG.promises.rename(o,e)}catch(c){throw await oG.promises.rm(o,{force:!0}).catch(()=>{}),c}}};var MXn=require("os"),U8=fe(require("path"));function Ipr(t){let e=t.source?`source:${t.source}`:`path:${lF(t.path)}`;return`${t.provider}\0${e}`}a(Ipr,"runtimePluginIdentity");var NXn={hooks:[],commands:[],skills:[],agents:[],instructions:[],mcpServerDefinitions:[]},xpr=new Set,jGs=new Set(yme.filter(t=>t.changeSignal).map(t=>t.name)),Ca=class{constructor(e,r={}){this.ctx=e;this.logger=new pe("AgentPluginService");this._onDidChangePlugins=new Lc;this.onDidChangePlugins=a((e,r,n)=>(this.ensureWatching(),this._onDidChangePlugins.event(e,r,n)),"onDidChangePlugins");this._onDidChangeRuntimePlugins=new Lc;this.onDidChangeRuntimePlugins=this._onDidChangeRuntimePlugins.event;this.runtimeSourceRegistrations=[];this.mutationSequencer=new _w;this._sourceWatchers=[];this._sourceSubscriptions=[];this._watchStarted=!1;this._disposed=!1;this._lastSourceListings=new Map;this._injectedWatcher=r.watcher,this.watchDebounceMs=r.watchDebounceMs??50,this.userHome=r.userHome??(0,MXn.homedir)(),this.copilotHome=r.copilotHome??(process.env.COPILOT_HOME||U8.join(this.userHome,ppr)),this.ensureWatching()}static{a(this,"AgentPluginService")}registerRuntimePluginSource(e){let r={source:e,subscription:e.onDidChange(()=>this._onDidChangeRuntimePlugins.fire())};return this.runtimeSourceRegistrations.push(r),{dispose:a(()=>{let n=this.runtimeSourceRegistrations.indexOf(r);n<0||(this.runtimeSourceRegistrations.splice(n,1),r.subscription.dispose(),this._onDidChangeRuntimePlugins.fire())},"dispose")}}async listRuntimePlugins(e){let n=(await Promise.all(this.runtimeSourceRegistrations.map(async({source:s})=>{try{let c=s.listPlugins(e).catch(u=>(this.logger.warn(this.ctx,"runtime plugin source listing failed",{provider:s.provider,error:u instanceof Error?u.message:String(u)}),[])),l=await LO(c,ANe,void 0);return l===void 0?(this.logger.warn(this.ctx,"runtime plugin source listing timed out",{provider:s.provider}),[]):l.map(u=>({...u,provider:s.provider}))}catch(c){return this.logger.warn(this.ctx,"runtime plugin source listing failed",{provider:s.provider,error:c instanceof Error?c.message:String(c)}),[]}}))).flat().filter(s=>typeof s.name=="string"&&s.name.length>0&&typeof s.path=="string"&&s.path.length>0&&U8.isAbsolute(s.path)).map(s=>{let{source:c,...l}=s;return{...l,path:U8.normalize(s.path),...typeof c=="string"&&c.length>0?{source:c}:{}}}).sort((s,c)=>s.provider.localeCompare(c.provider)||Ipr(s).localeCompare(Ipr(c))||s.name.localeCompare(c.name)||lF(s.path).localeCompare(lF(c.path))||s.path.localeCompare(c.path)),o=new Map;for(let s of n){let c=Ipr(s);o.has(c)||o.set(c,s)}return[...o.values()]}get store(){return this._store||(this._store=new bNe(this.ctx.get(Un).directory)),this._store}get managedSettings(){try{return this.ctx.get(ay)}catch(e){if(e instanceof Ic&&e.ctor===ay)return;throw e}}get repository(){return this._repository||(this._git??=new Eut(this.ctx),this._repository=new xut(this.ctx,this.store,this._git)),this._repository}get marketplace(){return this._marketplace||(this._marketplace=new Cut(this.ctx,this.repository)),this._marketplace}get install(){return this._install||(this._install=new vut(this.repository,this.marketplace)),this._install}get editorId(){return this.ctx.get(Ir).getEditorIdentity().editorId}guardEditorId(e){let r=this.editorId;if(bNe.isSafeEditorId(r))return r;this.logger.warn(this.ctx,`${e} skipped: unsafe editorId`,{editorId:r})}async listPlugins(){this.ensureWatching();let e=this.guardEditorId("listPlugins");if(e===void 0)return[];let[{installed:r},{disabled:n}]=await Promise.all([this.store.readInstalled(e),this.store.readEnablement(e)]),o=new Set(n),s=await tXn(this.discoveryDeps(r)),c=this.pluginPolicyView(),l=await ZC(s,yNe,u=>this.toPlugin(u,o,c));return l.sort((u,d)=>u.uri.localeCompare(d.uri)),l}pluginPolicyView(){let e=this.managedSettings?.get(),r=CXn(e?.extraKnownMarketplaces);return{enabledPlugins:e?.enabledPlugins,marketplaceLabelFor:a(n=>r.get(n),"marketplaceLabelFor")}}async toPlugin(e,r,n){let o=await this.readContributionsSafely(e),s=e.fromMarketplace?.name||o.manifestName||e.displayName||U8.basename(e.fsPath),c=bXn(Cpr({uri:e.uri,fromMarketplace:e.fromMarketplace},n.marketplaceLabelFor),n.enabledPlugins);return{uri:e.uri,label:s,enabled:!r.has(e.uri),hooks:o.hooks,commands:o.commands,skills:o.skills,agents:o.agents,instructions:o.instructions,mcpServerDefinitions:o.mcpServerDefinitions,...c&&{policyBlocked:!0},...e.fromMarketplace&&{fromMarketplace:e.fromMarketplace}}}readContributionsSafely(e){let r=(async()=>{let n=await QZn(e.fsPath);return iXn(e.fsPath,n,{userHome:this.userHome,...e.repositoryBoundary!==void 0&&{repositoryBoundary:e.repositoryBoundary}})})().catch(n=>(this.logger.debug(this.ctx,"listPlugins: reading contributions failed",{uri:e.uri,err:String(n)}),NXn));return LO(r,ANe,NXn)}discoveryRoots(){return{sharedContentDir:this.store.sharedContentDir,copilotHome:this.copilotHome}}isReadOnlyPlugin(e){return yut(e,this.copilotHome)}discoveryDeps(e){let r=new Map,n=SXn(this.managedSettings?.get()?.enabledPlugins);return{...this.discoveryRoots(),installed:e,forceEnabledIds:n,getRepositoryUri:a(o=>this.repository.getRepositoryUri(o),"getRepositoryUri"),resolveMarketplace:a(o=>this.resolveMarketplaceForList(o,r),"resolveMarketplace")}}resolveMarketplaceForList(e,r){let n=$0(e.marketplace);if(!n)return Promise.resolve(void 0);let o=(async()=>{let s=this.repository.getRepositoryUri(n),c=await this.readMarketplacePluginFromDir(s,n,e.name,r);if(c)return c;if(e.pluginUri&&e.pluginUri!==s)return await this.readMarketplacePluginFromDir(e.pluginUri,n,e.name)})().catch(s=>{this.logger.debug(this.ctx,"listPlugins: resolving marketplace metadata failed",{pluginUri:e.pluginUri,err:String(s)})});return LO(o,ANe,void 0)}async readMarketplacePluginFromDir(e,r,n,o){if(!await of(e))return;let s=o?.get(e);s||(s=this.marketplace.readAllPluginsFromDirectory(e,r),o?.set(e,s));let l=(await s).find(u=>u.name===n);return l||(await this.marketplace.readSinglePluginManifest(e,r)??void 0)}async enablePlugin(e){let r=(await this.listPlugins()).find(n=>n.uri===e);if(r?.policyBlocked)throw new Klt(Cpr(r,this.pluginPolicyView().marketplaceLabelFor));await this.setPluginEnabled(e,!0)}async disablePlugin(e){await this.setPluginEnabled(e,!1)}async setPluginEnabled(e,r){this.ensureWatching(),await this.mutate(async n=>{let o=await this.store.readEnablement(n),s=o.disabled.includes(e);if(r===!s)return!1;let c=r?o.disabled.filter(l=>l!==e):[...o.disabled,e];return await this.store.writeEnablement(n,{...o,disabled:c}),this.logger.info(this.ctx,`${r?"enabled":"disabled"} plugin`,{pluginUri:e}),!0})}async mutate(e){let r=this.guardEditorId("mutation");if(r===void 0)return;await this.mutationSequencer.queue(r,()=>this.store.withLock(r,()=>e(r)))&&await this.refreshAndMaybeFire(xpr)}async reconcile(){this.ensureWatching();let e=this.guardEditorId("reconcile");if(e===void 0)return;let r=await this.store.readInstalled(e),n=await Promise.all(r.installed.map(s=>this.shouldDrop(s))),o=new Set(r.installed.filter((s,c)=>n[c]).map(s=>s.pluginUri));o.size!==0&&await this.mutate(async s=>{let c=await this.store.readInstalled(s),l=await Promise.all(c.installed.map(f=>o.has(f.pluginUri)?this.shouldDrop(f):Promise.resolve(!1))),u=c.installed.filter((f,h)=>!l[h]),d=c.installed.filter((f,h)=>l[h]);for(let f of d)this.logger.info(this.ctx,"reconcile dropped missing plugin",{name:f.name,pluginUri:f.pluginUri});return d.length===0?!1:(await this.store.writeInstalled(s,{...c,installed:u}),await this.pruneEnablement(s,d.map(f=>f.pluginUri)),!0)})}async pruneEnablement(e,r){let n=new Set(r),o=await this.store.readEnablement(e),s=o.disabled.filter(c=>!n.has(c));s.length!==o.disabled.length&&await this.store.writeEnablement(e,{...o,disabled:s})}async shouldDrop(e){return U8.isAbsolute(e.pluginUri)?mpr(e.pluginUri):!1}ensureWatching(){if(this._watchStarted||this._disposed||!this.ctx.get(Ir).isEditorPluginInfoKnown())return;this._watchStarted=!0;let e=this.guardEditorId("plugin watch");if(e===void 0)return;let r=this.store.editorPluginsDir(e);this._fileWatcher=new _Ne(this.ctx,r,{matches:aXn},this._injectedWatcher,this.watchDebounceMs),this._watchSubscription=this._fileWatcher.onDidChange(()=>{this.refreshAndMaybeFire(xpr)});let n=this.discoveryRoots();for(let s of yme){let c=s.changeSignal;if(!c)continue;let l=new _Ne(this.ctx,c.dir(n),{createDir:c.createDir,matches:ypr(c.files)},this._injectedWatcher,this.watchDebounceMs);this._sourceSubscriptions.push(l.onDidChange(()=>{this.refreshAndMaybeFire(new Set([s.name]))})),this._sourceWatchers.push(l)}let o=!1;this._policySubscription=this.managedSettings?.observe(s=>({enabledPlugins:s.enabledPlugins,extraKnownMarketplaces:s.extraKnownMarketplaces}),()=>{if(!o){o=!0;return}this.refreshAndMaybeFire(xpr)}),this.seedAndStart()}async seedAndStart(){await this.mutationSequencer.queue(this.editorId,async()=>{if(this._lastStateKey===void 0)try{this._lastStateKey=await this.stateKey(jGs)}catch{}}),!this._disposed&&await Promise.all([this._fileWatcher?.start(),...this._sourceWatchers.map(e=>e.start())])}refreshAndMaybeFire(e){return this.mutationSequencer.queue(this.editorId,async()=>{if(this._disposed)return;let r;try{r=await this.stateKey(e)}catch(n){this.logger.warn(this.ctx,"plugin refresh failed",{err:String(n)});return}r!==this._lastStateKey&&(this._lastStateKey=r,this._onDidChangePlugins.fire())})}async stateKey(e){let r=this.editorId,[{installed:n},{disabled:o}]=await Promise.all([this.store.readInstalled(r),this.store.readEnablement(r)]),s=this.discoveryRoots();for(let u of yme){let d=u.changeSignal;if(!d||!e.has(u.name)&&this._lastSourceListings.has(u.name))continue;let f=await d.listing(s);f!==void 0&&this._lastSourceListings.set(u.name,f)}let c={};for(let u of yme)u.changeSignal&&(c[u.name]=[...this._lastSourceListings.get(u.name)??[]].sort());let l=this.managedSettings?.get();return JSON.stringify({installed:n.map(u=>[u.pluginUri,u.name]).sort((u,d)=>u[0].localeCompare(d[0])||u[1].localeCompare(d[1])),disabled:[...o].sort(),sources:c,enabledPlugins:Object.entries(l?.enabledPlugins??{}).sort((u,d)=>u[0].localeCompare(d[0])),extraKnownMarketplaces:Object.entries(l?.extraKnownMarketplaces??{}).sort((u,d)=>u[0].localeCompare(d[0]))})}async installPlugin(e){this.assertMarketplaceAllowed(e.marketplaceReference);let r=await this.install.acquirePlugin(e);return await this.mutate(async n=>{let o=await this.store.readInstalled(n),s={pluginUri:r,marketplace:e.marketplaceReference.rawValue,name:e.name},c=o.installed.find(u=>u.pluginUri===r);if(c&&c.name===s.name&&c.marketplace===s.marketplace)return!1;let l=c?o.installed.map(u=>u.pluginUri===r?s:u):[...o.installed,s];return await this.store.writeInstalled(n,{...o,installed:l}),this.logger.info(this.ctx,"installed plugin",{pluginUri:r,name:s.name}),!0}),r}async uninstallPlugin(e){let r;if(await this.mutate(async o=>{let s=await this.store.readInstalled(o),c=s.installed.findIndex(u=>u.pluginUri===e);if(c<0)return!1;r=s.installed[c];let l=s.installed.filter((u,d)=>d!==c);return await this.store.writeInstalled(o,{...s,installed:l}),await this.pruneEnablement(o,[e]),this.logger.info(this.ctx,"uninstalled plugin",{pluginUri:e,name:r.name}),!0}),!r)return;let n;try{n=await this.install.resolveInstalled(r)}catch(o){this.logger.warn(this.ctx,"skip clone GC: resolving installed plugin source failed",{pluginUri:e,err:String(o)});return}if(!n){this.logger.debug(this.ctx,"skip clone GC: could not resolve installed plugin source",{pluginUri:e});return}await this.repository.cleanupPluginSource(n).catch(o=>this.logger.warn(this.ctx,"plugin clone cleanup failed",{pluginUri:e,err:String(o)}))}async installPluginFromSource(e,r){let n=$0(e);if(!n)throw new ume(e);this.assertMarketplaceAllowed(n);let o=await this.install.resolveFromSource(n);if(o.plugins.length===0)return{installed:!1,candidates:[]};let s;if(r!==void 0){if(s=o.plugins.find(l=>l.name===r),!s)return{installed:!1,candidates:o.plugins}}else if(o.plugins.length===1)s=o.plugins[0];else return{installed:!1,candidates:o.plugins};return o.isSinglePluginRepo||await this.addMarketplaceReference(n),{installed:!0,pluginUri:await this.installPlugin(s),plugin:s}}async updatePlugin(e){let r=this.guardEditorId("updatePlugin");if(r===void 0)return!1;let{installed:n}=await this.store.readInstalled(r),o=n.find(l=>l.pluginUri===e);if(!o)return this.logger.warn(this.ctx,"updatePlugin: not installed for this editor",{pluginUri:e}),!1;let s;try{s=await this.install.resolveInstalled(o)}catch(l){return this.logger.warn(this.ctx,"updatePlugin: resolving plugin source failed",{pluginUri:e,err:String(l)}),!1}if(!s)return this.logger.warn(this.ctx,"updatePlugin: could not resolve plugin source",{pluginUri:e}),!1;let c=!1;try{c=await this.repository.updatePluginSource(s)}catch(l){return this.logger.warn(this.ctx,"updatePlugin: pulling latest content failed",{pluginUri:e,err:String(l)}),!1}return c&&this.logger.info(this.ctx,"updated plugin",{pluginUri:e,name:o.name}),c}assertMarketplaceAllowed(e){let r=this.managedSettings?.get().strictKnownMarketplaces;if(!bpr(r,e))throw new Ylt(e.canonicalId,e.rawValue)}async addMarketplaceReference(e){this.assertMarketplaceAllowed(e),await this.mutate(async r=>{let n=await this.store.readMarketplaces(r);return n.marketplaces.some(s=>$0(s)?.canonicalId===e.canonicalId)?!1:(await this.store.writeMarketplaces(r,{...n,marketplaces:[...n.marketplaces,e.rawValue]}),this.logger.info(this.ctx,"registered marketplace",{reference:e.rawValue}),!0)})}async listMarketplaces(){let e=this.guardEditorId("listMarketplaces");if(e===void 0)return[];let{marketplaces:r}=await this.store.readMarketplaces(e),n=bZn(r),o=this.managedSettings?.get();return TXn(n,o?.extraKnownMarketplaces).filter(c=>bpr(o?.strictKnownMarketplaces,c))}async addMarketplace(e){let r=$0(e);if(!r)throw new ume(e,"marketplace source");await this.addMarketplaceReference(r)}async removeMarketplace(e){let r=$0(e);await this.mutate(async n=>{let o=await this.store.readMarketplaces(n),s=o.marketplaces.filter(c=>c===e?!1:r?$0(c)?.canonicalId!==r.canonicalId:!0);return s.length===o.marketplaces.length?!1:(await this.store.writeMarketplaces(n,{...o,marketplaces:s}),this.logger.info(this.ctx,"removed marketplace",{source:e}),!0)})}async browseMarketplace(e){let r;if(e!==void 0){let n=$0(e);if(!n)throw new ume(e,"marketplace source");this.assertMarketplaceAllowed(n),r=[n]}else r=await this.listMarketplaces();return this.marketplace.fetchMarketplacePlugins(r)}dispose(){if(!this._disposed){this._disposed=!0,this._watchSubscription?.dispose(),this._policySubscription?.dispose(),this._fileWatcher?.dispose();for(let e of this._sourceSubscriptions)e.dispose();for(let e of this._sourceWatchers)e.dispose();this._git?.dispose();for(let e of this.runtimeSourceRegistrations)e.subscription.dispose();this.runtimeSourceRegistrations.length=0,this._onDidChangeRuntimePlugins.dispose(),this._onDidChangePlugins.dispose()}}};p();function sG(t){try{return kt(t,ze.EnablePlugins)===!0}catch{return!1}}a(sG,"pluginsEnabled");var wut=fe(require("path"));var uee=new pe("BackgroundAgent.PluginHooks"),Tme="copilot-plugin",wpr={SessionStart:"sessionStart",SessionEnd:"sessionEnd",UserPromptSubmit:"userPromptSubmitted",PreToolUse:"preToolUse",PostToolUse:"postToolUse",ErrorOccurred:"errorOccurred"};function HGs(t,e){let r={};for(let o of t)for(let s of o.hooks){let c=wpr[s.type];if(c!==void 0)for(let l of s.hooks){let u=Rpr(l,e);if(!u)continue;let d=r[c]??=new Map,f=d.get(s.uri);f?f.push(u):d.set(s.uri,[u])}}let n={};for(let[o,s]of Object.entries(r))n[o]=[...s].map(([c,l])=>({source:c,hooks:l}));return n}a(HGs,"groupPluginHooksBySource");async function OXn(t,e){if(!sG(t)||!WF(t))return{};let r;try{r=(await t.get(Ca).listPlugins()).filter(vme)}catch(c){return c instanceof Ic?{}:(uee.warn(t,"failed to list plugins for hook injection",{err:String(c)}),{})}if(r.length===0)return{};let n=un(e.uri),o=HGs(r,n),s={};return o.preToolUse&&(s.preToolUse=[$Gs(t,n,o.preToolUse)]),o.postToolUse&&(s.postToolUse=[VGs(t,n,o.postToolUse)]),o.userPromptSubmitted&&(s.userPromptSubmitted=[WGs(t,n,o.userPromptSubmitted)]),o.sessionStart&&(s.sessionStart=[zGs(t,n,o.sessionStart)]),o.sessionEnd&&(s.sessionEnd=[YGs(t,n,o.sessionEnd)]),o.errorOccurred&&(s.errorOccurred=[KGs(t,n,o.errorOccurred)]),s}a(OXn,"buildPluginHookHandlers");function LXn(t,e){let r={...t};return e.preToolUse?.length&&(r.preToolUse=[...t.preToolUse??[],...e.preToolUse]),e.postToolUse?.length&&(r.postToolUse=[...t.postToolUse??[],...e.postToolUse]),e.userPromptSubmitted?.length&&(r.userPromptSubmitted=[...t.userPromptSubmitted??[],...e.userPromptSubmitted]),e.sessionStart?.length&&(r.sessionStart=[...t.sessionStart??[],...e.sessionStart]),e.sessionEnd?.length&&(r.sessionEnd=[...t.sessionEnd??[],...e.sessionEnd]),e.errorOccurred?.length&&(r.errorOccurred=[...t.errorOccurred??[],...e.errorOccurred]),r}a(LXn,"mergePluginHooks");function Rpr(t,e){let r=process.platform==="darwin"?t.osx:process.platform==="linux"?t.linux:void 0,n=t.command??r??t.linux??t.osx,o=t.windows??t.command;if(n===void 0&&o===void 0)return;let s=GGs(t.cwd,e);return{type:"command",...n!==void 0&&{bash:n},...o!==void 0&&{powershell:o},...s!==void 0&&{cwd:s},...t.env&&{env:t.env},...t.timeout!==void 0&&{timeoutSec:t.timeout}}}a(Rpr,"toCommandHook");function GGs(t,e){if(t!==void 0)return wut.isAbsolute(t)?t:wut.join(e,t)}a(GGs,"resolveHookCwd");function Ime(t,e){return async r=>{if(WF(t))return e(r)}}a(Ime,"gated");function $Gs(t,e,r){return{source:Tme,handler:Ime(t,async n=>{try{let o={timestamp:xme(n.timestamp),cwd:e,toolName:n.toolName,toolArgs:rNe(n.toolArgs)};for(let s of r){let c=await new N2(s.source,s.hooks).fire(t,o);for(let l of c){let u=l.output;if(u&&u.permissionDecision===Kde.deny)return{permissionDecision:"deny",permissionDecisionReason:u.permissionDecisionReason||"Tool execution denied by plugin hook"}}}return}catch(o){uee.error(t,`Failed to execute plugin PreToolUse hook for tool ${n.toolName}`,o);return}})}}a($Gs,"pluginPreToolUseHandler");function VGs(t,e,r){return{source:Tme,handler:Ime(t,async n=>{try{let o={timestamp:xme(n.timestamp),cwd:e,toolName:n.toolName,toolArgs:rNe(n.toolArgs),toolResult:{resultType:Gfr(n.toolResult.resultType),textResultForLlm:n.toolResult.textResultForLlm}};for(let s of r)await new D2(s.source,s.hooks).fire(t,o)}catch(o){uee.error(t,`Failed to execute plugin PostToolUse hook for tool ${n.toolName}`,o)}})}}a(VGs,"pluginPostToolUseHandler");function WGs(t,e,r){return{source:Tme,handler:Ime(t,async n=>{try{let o={timestamp:xme(n.timestamp),cwd:e,prompt:n.prompt};for(let s of r)await new M2(s.source,s.hooks).fire(t,o)}catch(o){uee.error(t,"Failed to execute plugin UserPromptSubmitted hook",o)}})}}a(WGs,"pluginUserPromptSubmittedHandler");function zGs(t,e,r){return{source:Tme,handler:Ime(t,async n=>{try{let o={timestamp:xme(n.timestamp),cwd:e,source:n.source,...n.initialPrompt!==void 0&&{initialPrompt:n.initialPrompt}};for(let s of r)await new VF(s.source,s.hooks).fire(t,o)}catch(o){uee.error(t,"Failed to execute plugin SessionStart hook",o)}})}}a(zGs,"pluginSessionStartHandler");function YGs(t,e,r){return{source:Tme,handler:Ime(t,async n=>{try{let o={timestamp:xme(n.timestamp),cwd:e,reason:n.reason};for(let s of r)await new $F(s.source,s.hooks).fire(t,o)}catch(o){uee.error(t,"Failed to execute plugin SessionEnd hook",o)}})}}a(YGs,"pluginSessionEndHandler");function KGs(t,e,r){return{source:Tme,handler:Ime(t,async n=>{try{let o={timestamp:xme(n.timestamp),cwd:e,error:{message:n.error,name:"Error"}};for(let s of r)await new GF(s.source,s.hooks).fire(t,o)}catch(o){uee.error(t,"Failed to execute plugin ErrorOccurred hook",o)}})}}a(KGs,"pluginErrorOccurredHandler");function xme(t){return t instanceof Date?t.getTime():t}a(xme,"toHookTimestamp");p();var BXn=fe(require("node:path"));function FXn(t){let e="";for(let r of t){let n=r.codePointAt(0)??0;n>=32&&n!==127&&(e+=r)}return e.trim()}a(FXn,"sanitizeForPrompt");function JGs(t){let e=t.startsWith("file:")?un(t):t;return FXn(BXn.basename(e))}a(JGs,"confinedBasename");function ZGs(t){let e=t.startsWith("file:")?un(t):t;return FXn(e)}a(ZGs,"confinedAbsolutePath");function UXn(t){let e=JGs(t),r=ZGs(t);return[`You are operating in inline mode for quick, focused code changes. Regardless of any other instructions, you are confined to a single file \u2014 \`${e}\` (absolute path: \`${r}\`) \u2014 and MUST NOT read, create, or modify any other file.`,"Focus on the user's selected code and its immediate context. Make changes grounded directly in the user's prompt: do NOT make changes that are not directly and logically related to it, and do NOT modify code outside the selection unless absolutely necessary for correctness. Keep changes minimal and focused on exactly what was asked.","Be concise: NO wordy explanations, NO progress messages about what you are doing or about to do. Do not ask the user for clarification \u2014 make your best effort.","Note that you may be in inline-ask mode and do not have any edit tools available \u2014 show the code snippet that needs to be changed in a code block. Do not claim to have made edits.",`For edit turns, make all changes in a single invocation of the edit tool \u2014 there is no tool calling loop. Use whichever edit tool you have available (\`edit\`, \`str_replace_editor\`, or \`apply_patch\`) to apply changes to \`${e}\`; follow its schema carefully, include all required properties, and match the existing code exactly. Always use the ABSOLUTE PATH \`${r}\` when supplying a file path or patch header \u2014 never a relative path or bare basename, because the working directory may differ from the project root and a relative path will be denied. If you use \`apply_patch\`, every \`*** Add File\`, \`*** Delete File\`, \`*** Update File\`, and \`*** Move to\` header must spell out the full \`${r}\` \u2014 any patch touching another path will be denied. Never output code to the user instead of editing. Don't repeat yourself after a tool call \u2014 pick up where you left off.`,`You have at most 2 tool-calling turns total. If you need to read the file or check diagnostics, do so in the first turn (e.g. call \`view\` or \`get_errors\` on \`${r}\`). Use the second turn to apply your edit. Do NOT spend additional turns validating or re-reading after editing \u2014 make your best effort in one shot. If you already have the file content and diagnostics in the conversation, skip the first turn and edit immediately. Any tool call beyond the 2-turn limit will be rejected with an error.`,"When the file content is provided in the conversation (in full or as a portion around the cursor), use it directly for your edit \u2014 do NOT re-read it with `view`. If only a portion is shown, line numbers indicate exact positions in the file; use them for your edits. If the user's request targets code outside the shown portion, use `view` to read that part first."].join(` +`)}a(vZn,"composeBackgroundAgentSystemMessage");p();p();p();p();var iNe=(n=>(n.Copilot="copilot",n.Claude="claude",n.OpenPlugin="openPlugin",n))(iNe||{});var nG=(n=>(n.GitHubShorthand="githubShorthand",n.GitUri="gitUri",n.LocalFileUri="localFileUri",n))(nG||{}),sut=(r=>(r.User="user",r.Policy="policy",r))(sut||{});p();p();var iee=require("fs"),dme=fe(require("path"));var $js=32,Vjs=5e3,Wjs=5*1024*1024,zjs=32,Yjs=P0n(zjs);async function rI(t,e){return Yjs.run(()=>LO(t(),Vjs,e))}a(rI,"boundedFsOp");async function Vfr(t){let e=await rI(()=>iee.promises.stat(t),void 0);if(e)return{path:t,isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:!1}}a(Vfr,"statEntry");async function oNe(t){let e=await rI(()=>iee.promises.readdir(t,{withFileTypes:!0}),void 0);return e?ZC(e,$js,async r=>{let n=dme.join(t,r.name);if(r.isSymbolicLink()){let o=await Vfr(n);return{path:n,isFile:o?.isFile??!1,isDirectory:o?.isDirectory??!1,isSymlink:!0}}return{path:n,isFile:r.isFile(),isDirectory:r.isDirectory(),isSymlink:!1}}):[]}a(oNe,"readChildren");var CZn=process.platform==="linux";function cy(t,e){let r=CZn?t:t.toLowerCase(),n=CZn?e:e.toLowerCase(),o=dme.relative(r,n);return o===""||!o.startsWith("..")&&!dme.isAbsolute(o)}a(cy,"isAtOrUnder");async function AR(t,e){if(t===void 0)return!0;let r=await rI(()=>iee.promises.realpath(e),void 0);return r!==void 0&&cy(t,r)}a(AR,"withinRealBoundary");async function oee(t){if(t!==void 0)return rI(()=>iee.promises.realpath(t),t)}a(oee,"resolveRealBoundary");async function sNe(t){let e=await rI(()=>iee.promises.stat(t),void 0);if(!(!e||!e.isFile()||e.size>Wjs))return rI(()=>iee.promises.readFile(t,"utf8"),void 0)}a(sNe,"readTextFileCapped");var bZn=require("fs"),Wfr=fe(require("path"));function nI(t){let e=t.replace(/[\\/:*?"<>|]/g,"_");return/^\.+$/.test(e)?e.replace(/\./g,"_"):e}a(nI,"sanitizeCacheSegment");function fme(t){return t?[`ref_${encodeURIComponent(t)}`]:[]}a(fme,"refCacheSegment");function aut(t,e){return e?[`sha_${encodeURIComponent(e)}`]:fme(t)}a(aut,"gitRevisionCacheSuffix");function SZn(t,e,r){try{let n=new URL(t),o=nI((n.host||"unknown").toLowerCase()),s=n.pathname.replace(/\/+/g,"/").replace(/^\/+/,"").replace(/\/+$/g,"").replace(/\.git$/i,""),c=s?s.split("/").map(nI):[];return[o,...c,...aut(e,r)]}catch{return["git",nI(t),...aut(e,r)]}}a(SZn,"gitUrlToCacheSegments");async function Cd(t){return rI(()=>bZn.promises.stat(t).then(()=>!0,()=>!1),!1)}a(Cd,"exists");function aNe(t,e){let r=Wfr.join(t,...e);if(!cy(t,r))throw new Error(`plugin cache path escapes the cache root: ${e.join("/")}`);return r}a(aNe,"joinCacheSegments");function cNe(t,e){if(!e)return t;let r=e.trim().replace(/^\.?\/+|\/+$/g,"");if(!r)return t;let n=Wfr.join(t,r);return cy(t,n)?n:t}a(cNe,"joinContained");var cut=require("node:url");function TZn(t){let e=new Map;for(let r of t){let n=V0(r);n&&!e.has(n.canonicalId)&&e.set(n.canonicalId,n)}return[...e.values()]}a(TZn,"parseMarketplaceReferences");function V0(t){let e=t.trim();if(e)return Jjs(e)??Zjs(e)??Kjs(e)}a(V0,"parseMarketplaceReference");function Kjs(t){let e=/^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)(?:#(.+))?$/.exec(t);if(!e)return;let[,r,n,o]=e;return{rawValue:t,displayLabel:t,cloneUrl:`https://github.com/${r}/${n}.git`,canonicalId:xZn(r,n,o),cacheSegments:["github.com",nI(r),nI(n),...fme(o)],kind:"githubShorthand",ref:o,githubRepo:`${r}/${n}`}}a(Kjs,"parseShorthandMarketplaceReference");function Jjs(t){let e;try{e=new URL(t)}catch{return}let r=e.protocol.replace(/:$/,"").toLowerCase();if(r==="file"&&/^file:\/\//i.test(t)){if(e.hash)return;let y;try{y=(0,cut.fileURLToPath)(e)}catch{return}return{rawValue:t,displayLabel:y,cloneUrl:t,canonicalId:`file:${(0,cut.pathToFileURL)(y).toString().toLowerCase()}`,cacheSegments:[],kind:"localFileUri",localRepositoryUri:y}}if(r!=="http"&&r!=="https"&&r!=="ssh"||!e.host)return;let n=e.hash?e.hash.slice(1):void 0,o=Xjs(e),s=e.host.toLowerCase(),c=nI(s),l=e.pathname.replace(/\/+/g,"/").replace(/\/+$/g,"").replace(/^\/+/,"");if(!l)return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:zfr(`git:${s}/`,n),cacheSegments:[c,...fme(n)],kind:"gitUri",ref:n};let u=".git",d=l.toLowerCase().endsWith(u),f=d?l.slice(0,-u.length):l,h=f.split("/").map(nI),m=d?l.toLowerCase():`${l.toLowerCase()}${u}`,g=IZn(s,f),A=wZn(g,n,`git:${s}/${m}`);return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:A,cacheSegments:[c,...h,...fme(n)],kind:"gitUri",ref:n,githubRepo:g}}a(Jjs,"parseUriMarketplaceReference");function Zjs(t){let e=/^([^@\s]+)@([^:\s]+):(.+?\.git)(?:#(.+))?$/i.exec(t);if(!e)return;let r=".git",[,n,o,s,c]=e,l=s.replace(/^\/+/,"");if(!l.toLowerCase().endsWith(r))return;let u=l.slice(0,-r.length),d=u.split("/").map(nI),f=IZn(o,u),h=wZn(f,c,`git:${o.toLowerCase()}/${l.toLowerCase()}`);return{rawValue:t,displayLabel:t,cloneUrl:`${n}@${o}:${l}`,canonicalId:h,cacheSegments:[nI(o.toLowerCase()),...d,...fme(c)],kind:"gitUri",ref:c,githubRepo:f}}a(Zjs,"parseScpMarketplaceReference");function Xjs(t){if(!t.hash)return t.toString();let e=new URL(t.toString());return e.hash="",e.toString()}a(Xjs,"refStrippedUrl");function IZn(t,e){if(t.toLowerCase()!=="github.com")return;let r=e.split("/");if(r.length>=2&&r[0]&&r[1])return`${r[0]}/${r[1]}`}a(IZn,"extractGitHubRepo");function xZn(t,e,r){return zfr(`github:${t.toLowerCase()}/${e.toLowerCase()}`,r)}a(xZn,"getGitHubCanonicalId");function wZn(t,e,r){if(t){let[n,o]=t.split("/");return xZn(n,o,e)}return zfr(r,e)}a(wZn,"gitCanonicalId");function zfr(t,e){return e?`${t}#${encodeURIComponent(e)}`:t}a(zfr,"appendRefSuffix");p();p();p();p();function RZn(t,e){return/^~(?=$|[/\\])/.test(t)?e+t.slice(1):t}a(RZn,"untildify");var eHs=200;function lut(t,e){return Yfr(t,e,new Set,0)}a(lut,"cloneAndChange");function Yfr(t,e,r,n){if(t==null)return t;let o=e(t);if(o!==void 0)return o;if(n>=eHs)throw new Error("Cannot clone: structure nested too deeply");if(Array.isArray(t))return t.map(s=>Yfr(s,e,r,n+1));if(typeof t=="object"){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let s={};for(let c of Object.keys(t))s[c]=Yfr(t[c],e,r,n+1);return r.delete(t),s}return t}a(Yfr,"cloneAndChangeInner");function lNe(t,e=!1){if(!t||typeof t!="object")return;let r={};for(let[n,o]of Object.entries(t))typeof o=="string"?r[n]=o:e&&typeof o=="number"&&(r[n]=String(o));return Object.keys(r).length>0?r:void 0}a(lNe,"toStringRecord");var uut=fe(require("path"));var rHs=/[\s&|<>()^;!`"'$]/;function nHs(t){return t.replace(/(\\*)("|$)/g,(e,r,n)=>r+r+(n?'\\"':""))}a(nHs,"escapeWindowsDoubleQuoted");function iHs(t,e,r){if(!t.includes(r))return t;if(!rHs.test(e))return t.replaceAll(r,e);let n=process.platform==="win32",o=new RegExp(`(["']?)${vse(r)}([\\w./\\\\~:@-]*)`,"g");return t.replace(o,(s,c,l)=>{let u=e+l;if(c==="'")return c+u.replace(/'/g,"'\\''");let d=n?nHs(u):u.replace(/([\\"$`])/g,"\\$&");return c?c+d:'"'+d+'"'})}a(iHs,"shellQuotePluginRootInCommand");var oHs={SessionStart:"SessionStart",SessionEnd:"SessionEnd",UserPromptSubmit:"UserPromptSubmit",PreToolUse:"PreToolUse",PostToolUse:"PostToolUse",PreCompact:"PreCompact",SubagentStart:"SubagentStart",SubagentStop:"SubagentStop",Stop:"Stop",ErrorOccurred:"ErrorOccurred",sessionStart:"SessionStart",sessionEnd:"SessionEnd",userPromptSubmitted:"UserPromptSubmit",preToolUse:"PreToolUse",postToolUse:"PostToolUse",agentStop:"Stop",subagentStop:"SubagentStop",errorOccurred:"ErrorOccurred"};function sHs(t){if(t.type!==void 0&&t.type!=="command")return;let e=a(f=>typeof f=="string"&&f.length>0?f:void 0,"str"),r=e(t.command),n=e(t.bash),o=e(t.powershell),s=e(t.windows)??o,c=e(t.linux)??n,l=e(t.osx)??n;if(!r&&!s&&!c&&!l)return;let u=typeof t.timeout=="number"?t.timeout:typeof t.timeoutSec=="number"?t.timeoutSec:void 0,d=lNe(t.env,!0);return{...r&&{command:r},...s&&{windows:s},...c&&{linux:c},...l&&{osx:l},...d&&{env:d},...u!==void 0&&{timeout:u}}}a(sHs,"normalizeHookCommand");function kZn(t,e){let r=sHs(t);if(!r)return;let n,o=typeof t.cwd=="string"?t.cwd:void 0;if(o){let s=RZn(o,e);n=uut.isAbsolute(s)?uut.normalize(s):s}return{...r,...n!==void 0&&{cwd:n}}}a(kZn,"resolveHookCommand");function aHs(t,e){if(!t||typeof t!="object")return[];let r=t,n=[],o=r.hooks;if(Array.isArray(o)){for(let s of o)if(s&&typeof s=="object"){let c=kZn(s,e);c&&n.push(c)}}else{let s=kZn(r,e);s&&n.push(s)}return n}a(aHs,"extractHookCommands");function Jfr(t,e,r){if(!e||typeof e!="object")return[];let n=e;if(n.disableAllHooks===!0)return[];let o=n.hooks;if(!o||typeof o!="object")return[];let s=o,c=[];for(let l of Object.keys(s)){let u=oHs[l];if(!u)continue;let d=s[l];if(!Array.isArray(d))continue;let f=[];for(let h of d)f.push(...aHs(h,r));f.length>0&&c.push({type:u,hooks:f,uri:t,originalId:l})}return c}a(Jfr,"parseHooksJson");function Kfr(t,e,r){if(Array.isArray(t)){let n=t;for(let o=0;o{for(let d of["command","windows","linux","osx"]){let f=u[d];typeof f=="string"&&(u[d]=iHs(f,c,o))}(!u.env||typeof u.env!="object")&&(u.env={}),u.env[s]=c},"mutateHookCommand");try{let u=lut(e,()=>{});for(let d of Object.values(u.hooks??{}))if(Array.isArray(d))for(let f of d){if(!f||typeof f!="object")continue;let h=f;if(Array.isArray(h.hooks))for(let m of h.hooks)m&&typeof m=="object"&&l(m);else l(h)}return Kfr(u,o,c),Jfr(t,u,n)}catch{return[]}}a(Zfr,"interpolateHookPluginRoot");p();var upr=require("fs");lpr();function mNe(t){try{return cpr(t)}catch{return}}a(mNe,"parseJsonc");async function gme(t,e){let r=await rI(()=>upr.promises.stat(t),void 0);if(!r||!r.isFile()||e!==void 0&&r.size>e)return;let n=await rI(()=>upr.promises.readFile(t,"utf8"),void 0);if(n!==void 0)return mNe(n)}a(gme,"readJsoncFile");var iG=fe(require("path"));var wHs={format:0,manifestPath:"plugin.json",altManifestPaths:[".github/plugin/plugin.json"],hookConfigPath:"hooks.json",altHookConfigPaths:["hooks/hooks.json"],pluginRootToken:void 0,pluginRootEnvVar:void 0,parseHooks(t,e,r,n){return Jfr(t,e,n)}},RHs={format:1,manifestPath:".claude-plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${CLAUDE_PLUGIN_ROOT}",pluginRootEnvVar:"CLAUDE_PLUGIN_ROOT",parseHooks(t,e,r,n){return Zfr(t,e,r,n,"${CLAUDE_PLUGIN_ROOT}","CLAUDE_PLUGIN_ROOT")}},kHs={format:2,manifestPath:".plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${PLUGIN_ROOT}",pluginRootEnvVar:"PLUGIN_ROOT",parseHooks(t,e,r,n){return Zfr(t,e,r,n,"${PLUGIN_ROOT}","PLUGIN_ROOT")}};async function jZn(t){return await Cd(iG.join(t,".plugin","plugin.json"))?kHs:t.split(/[/\\]/).includes(".claude")||await Cd(iG.join(t,".claude-plugin","plugin.json"))?RHs:wHs}a(jZn,"detectPluginFormat");async function HZn(t,e,r){let n=await oee(r);for(let o of[e.manifestPath,...e.altManifestPaths??[]]){let s=iG.join(t,o);if(!await AR(n,s))continue;let c=await sNe(s),l=c===void 0?void 0:mNe(c);if(l&&typeof l=="object"&&!Array.isArray(l))return{manifest:l,manifestUri:s}}}a(HZn,"readPluginManifest");function GZn(t){return[t.hookConfigPath,...t.altHookConfigPaths??[]]}a(GZn,"defaultHookConfigPaths");var dpr={paths:[],exclusive:!1};function Ame(t){if(t==null)return dpr;if(typeof t=="string"){let e=t.trim();return e?{paths:[e],exclusive:!1}:dpr}if(Array.isArray(t))return{paths:qZn(t),exclusive:!1};if(typeof t=="object"){let e=t;if(Array.isArray(e.paths))return{paths:qZn(e.paths),exclusive:e.exclusive===!0}}return dpr}a(Ame,"parseComponentPathConfig");function qZn(t){return t.filter(e=>typeof e=="string").map(e=>e.trim()).filter(e=>e.length>0)}a(qZn,"cleanPaths");function gut(t,e,r,n){let o=n&&cy(n,t)?n:t,s=[];r.exclusive||s.push(iG.join(t,e));for(let c of r.paths){let l=iG.normalize(iG.join(t,c));cy(o,l)&&s.push(l)}return s}a(gut,"resolveComponentDirs");p();p();var oI=fe(require("path"));var VZn=new GO,gNe=16,$Zn=".md",PHs=[".instructions.md",".mdc",".md"];async function DHs(t){let e=oI.basename(t).replace(/(\.agent)?\.md$/i,"");return WZn(t,e)}a(DHs,"parseAgentFile");async function NHs(t){return WZn(t,oI.basename(oI.dirname(t)))}a(NHs,"parseSkillFile");async function WZn(t,e){let r=await sNe(t);if(r===void 0)return{name:e};try{let n=VZn.parse(t,r).header,o=n?.name?.trim()||e,s=n?.description?.trim();return{name:o,...s&&{description:s}}}catch{return{name:e}}}a(WZn,"readNameDescription");async function MHs(t){let e=await sNe(t);if(e!==void 0)try{return VZn.parse(t,e).header?.description?.trim()||void 0}catch{return}}a(MHs,"parseCommandDescription");async function zZn(t,e,r){let n=await oee(r),s=(await ZC(e,gNe,async d=>{if(!await AR(n,d))return[];let f=oI.join(d,"SKILL.md");if(await Cd(f)&&await AR(n,f))return[f];let h=(await oNe(d)).filter(g=>g.isDirectory);return h.sort((g,A)=>g.path.localeCompare(A.path)),(await ZC(h,gNe,async g=>{if(g.isSymlink&&!await AR(n,g.path))return;let A=oI.join(g.path,"SKILL.md");if(!(!await Cd(A)||!await AR(n,A)))return A})).filter(g=>g!==void 0)})).flat();if(s.length===0){let d=oI.join(t,"SKILL.md");await Cd(d)&&await AR(n,d)&&s.push(d)}let c=await ZC(s,gNe,async d=>({uri:d,...await NHs(d)})),l=new Set,u=[];for(let{uri:d,name:f,description:h}of c)l.has(d)||(l.add(d),u.push({uri:d,name:f,...h&&{description:h}}));return u.sort((d,f)=>d.name.localeCompare(f.name)),u}a(zZn,"readSkills");async function YZn(t,e,r){let n=await oee(r),o=new Set,s=[],c=a(l=>{let u=e(l);u&&!o.has(u)&&(o.add(u),s.push({uri:l,name:u}))},"addItem");for(let l of t){if(!await AR(n,l))continue;let u=await Vfr(l);if(!u)continue;if(u.isFile){c(l);continue}if(!u.isDirectory)continue;let d=await oNe(l);d.sort((f,h)=>f.path.localeCompare(h.path));for(let f of d)f.isFile&&(f.isSymlink&&!await AR(n,f.path)||c(f.path))}return s.sort((l,u)=>l.name.localeCompare(u.name)),s}a(YZn,"scanComponentFiles");function OHs(t){return oI.extname(t).toLowerCase()===$Zn?oI.basename(t).slice(0,-$Zn.length):void 0}a(OHs,"getMarkdownComponentName");function KZn(t,e){return YZn(t,OHs,e)}a(KZn,"readMarkdownComponents");async function JZn(t,e){let r=await KZn(t,e);return ZC(r,gNe,async n=>{let o=await MHs(n.uri);return{...n,...o&&{description:o}}})}a(JZn,"readCommandComponents");async function ZZn(t,e){let r=await KZn(t,e);if(r.length===0)return r;let n=await ZC(r,gNe,async c=>{let{name:l,description:u}=await DHs(c.uri);return{uri:c.uri,name:l||c.name,...u&&{description:u}}}),o=new Set,s=n.filter(c=>o.has(c.name)?!1:(o.add(c.name),!0));return s.sort((c,l)=>c.name.localeCompare(l.name)),s}a(ZZn,"readAgentComponents");function LHs(t){let e=oI.basename(t),r=e.toLowerCase(),n=PHs.find(o=>r.endsWith(o));return n?e.slice(0,-n.length):void 0}a(LHs,"getInstructionFileName");function XZn(t,e){return YZn(t,LHs,e)}a(XZn,"readInstructionComponents");p();function BHs(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(Object.hasOwn(e,"mcpServers")){let r=e.mcpServers;return!r||typeof r!="object"||Array.isArray(r)?void 0:r}return e}a(BHs,"resolveMcpServersMap");function FHs(t){if(!t||typeof t!="object")return;let e=t,r=a(h=>typeof h=="string"&&h.trim()?h.trim():void 0,"str"),n=r(e.type),o=r(e.command),s=r(e.url),c=Array.isArray(e.args)?e.args.filter(h=>typeof h=="string"):void 0,l=lNe(e.env,!0),u=r(e.envFile),d=r(e.cwd),f=lNe(e.headers);if(n!=="ws"){if(n==="stdio"||!n&&o)return o?{type:"stdio",command:o,...c&&{args:c},...l&&{env:l},...d!==void 0&&{cwd:d},...u!==void 0&&{envFile:u}}:void 0;if(n==="http"||n==="sse"||!n&&s)return s?{type:"http",url:s,...f&&{headers:f}}:void 0}}a(FHs,"normalizeMcpServerConfiguration");function UHs(t,e,r,n){let o=a(l=>l.replaceAll(r,()=>e),"replace"),s=t.configuration,c;if(s.type==="stdio"){let l={};for(let[u,d]of Object.entries(s.env??{}))l[u]=o(d);l[n]=e,c={type:"stdio",command:o(s.command),...s.args&&{args:s.args.map(o)},env:l,...s.cwd!==void 0&&{cwd:o(s.cwd)},...s.envFile!==void 0&&{envFile:o(s.envFile)}}}else c={type:"http",url:o(s.url),...s.headers&&{headers:Object.fromEntries(Object.entries(s.headers).map(([l,u])=>[l,o(u)]))}};return{name:t.name,configuration:c,uri:t.uri}}a(UHs,"interpolateMcpPluginRoot");var QHs=/\$\{(?![A-Za-z]+:)([A-Z_][A-Z0-9_]*)\}/g;function qHs(t){return lut(t,e=>{if(typeof e=="string"){let r=e.replace(QHs,"${env:$1}");return r!==e?r:void 0}})}a(qHs,"convertBareEnvVarsToVsCodeSyntax");function fpr(t,e,r,n){let o=BHs(e);if(!o)return[];let s=[];for(let[c,l]of Object.entries(o)){let u=FHs(l);if(!u)continue;let d={name:c,configuration:u,uri:t};n.pluginRootToken&&n.pluginRootEnvVar&&(d=UHs(d,r,n.pluginRootToken,n.pluginRootEnvVar)),d=qHs(d),s.push(d)}return s}a(fpr,"parseMcpServerDefinitionMap");p();var oG=require("fs"),j_=fe(require("path"));var hpr=".copilot",Aut="installed-plugins",eXn=j_.join(hpr,Aut),tXn="config.json",ANe=5e3,yNe=16,mpr=5*1024*1024;async function cee(t){return rI(()=>t().then(e=>({ok:!0,value:e}),e=>({ok:!1,code:e.code??"error"})),{ok:!1,code:"timeout"})}a(cee,"boundedFsResult");function ppr(t){return t==="ENOENT"||t==="ENOTDIR"}a(ppr,"isAbsentCode");async function rXn(t){let e=await cee(()=>oG.promises.stat(j_.dirname(t)));return e.ok&&e.value.isDirectory()}a(rXn,"parentDirSurvives");async function gpr(t){let e=await cee(()=>oG.promises.stat(t));return e.ok||e.code!=="ENOENT"?!1:rXn(t)}a(gpr,"isDefinitivelyGone");var jHs={name:"marketplace",discover:$Hs},HHs={name:"copilotCli",discover:VHs,changeSignal:{dir:a(t=>t.copilotHome,"dir"),files:new Set([tXn]),createDir:!1,listing:a(t=>KHs(t.copilotHome),"listing")}},GHs={name:"enterprise",discover:YHs},yme=[jHs,HHs,GHs];async function nXn(t){let e=await Promise.all(yme.map(o=>o.discover(t))),r=new Set,n=[];for(let o of e)for(let s of o){let c=vg(s.fsPath);r.has(c)||(r.add(c),n.push(s))}return n}a(nXn,"discoverPlugins");async function $Hs(t){return(await ZC(t.installed,yNe,async r=>{let n;if(j_.isAbsolute(r.pluginUri))n=r.pluginUri;else{let u=j_.resolve(t.sharedContentDir,r.pluginUri);if(!cy(t.sharedContentDir,u))return;n=u}let o=await cee(()=>oG.promises.stat(n));if(o.ok){if(!o.value.isDirectory())return}else if(o.code==="ENOENT"&&await rXn(n))return;let s=V0(r.marketplace),c;if(s)try{c=t.getRepositoryUri(s)}catch{c=void 0}let l=await t.resolveMarketplace(r);return{uri:r.pluginUri,fsPath:n,displayName:r.name,readOnly:yut(n,t.copilotHome),...l&&{fromMarketplace:l},...c!==void 0&&{repositoryBoundary:c}}})).filter(r=>r!==void 0)}a($Hs,"discoverMarketplace");async function VHs(t){return(await iXn(t.copilotHome)??[]).map(r=>({uri:r.fsPath,fsPath:r.fsPath,readOnly:!0,...r.displayName!==void 0&&{displayName:r.displayName}}))}a(VHs,"discoverCopilotCli");var WHs=/^([^@/\\~]+)@([^@/\\~]+)$/;function zHs(t,e){let r=WHs.exec(t.trim());if(!r)return;let[,n,o]=r;if(n==="."||n===".."||o==="."||o==="..")return;let s=j_.resolve(e,Aut),c=j_.resolve(s,o,n);return cy(s,c)?c:void 0}a(zHs,"resolveForceEnabledPluginPath");async function YHs(t){return t.forceEnabledIds.length===0?[]:(await ZC(t.forceEnabledIds,yNe,async r=>{let n=zHs(r,t.copilotHome);if(n===void 0)return;let o=await cee(()=>oG.promises.stat(n));if(!(!o.ok||!o.value.isDirectory()))return{uri:n,fsPath:n,readOnly:yut(n,t.copilotHome)}})).filter(r=>r!==void 0)}a(YHs,"discoverEnterprise");async function iXn(t){return LO(JHs(t),ANe,void 0)}a(iXn,"listCopilotCliInstalls");async function KHs(t){return(await iXn(t))?.map(e=>e.fsPath)}a(KHs,"listCopilotCliPluginDirs");async function JHs(t){let e=j_.join(t,Aut),[r,n]=await Promise.all([ZHs(t),XHs(e)]);if(r===void 0&&n===void 0)return;let o=[];for(let u of r??[]){let f=(u.cachePath!==void 0&&j_.isAbsolute(u.cachePath)?u.cachePath:void 0)??(u.name!==void 0&&u.marketplace!==void 0?j_.join(e,u.marketplace,u.name):void 0);f!==void 0&&o.push({fsPath:f,...u.name!==void 0&&{displayName:u.name}})}let s=await ZC(o,yNe,async u=>await gpr(u.fsPath)?void 0:u),c=[],l=new Set;for(let u of s){if(u===void 0)continue;let d=vg(u.fsPath);l.has(d)||(l.add(d),c.push({fsPath:u.fsPath,...u.displayName!==void 0&&{displayName:u.displayName}}))}for(let u of n??[]){let d=vg(u);l.has(d)||(l.add(d),c.push({fsPath:u}))}return c}a(JHs,"collectCopilotCliInstalls");async function ZHs(t){let e=j_.join(t,tXn),r=await cee(()=>oG.promises.stat(e));if(!r.ok)return ppr(r.code)?[]:void 0;if(!r.value.isFile()||r.value.size>mpr)return;let n=await cee(()=>oG.promises.readFile(e,"utf8"));if(!n.ok)return ppr(n.code)?[]:void 0;let o=n.value,s;try{s=JSON.parse(o)}catch{return}let c=s?.installedPlugins;if(!Array.isArray(c))return[];let l=[];for(let u of c){if(u===null||typeof u!="object")continue;let d=u;l.push({name:typeof d.name=="string"?d.name:void 0,marketplace:typeof d.marketplace=="string"?d.marketplace:void 0,cachePath:typeof d.cache_path=="string"?d.cache_path:void 0})}return l}a(ZHs,"readCliInstalledPlugins");async function XHs(t){let e=await cee(()=>oG.promises.readdir(t,{withFileTypes:!0}));if(!e.ok)return ppr(e.code)?[]:void 0;let r=e.value,n=[];for(let o of r)if(o.isDirectory())for(let s of await oNe(j_.join(t,o.name)))s.isDirectory&&n.push(s.path);return n}a(XHs,"scanCopilotCliPluginDirs");function yut(t,e){return cy(j_.join(e,Aut),t)}a(yut,"isCopilotCliPath");var Apr=fe(require("path"));var eGs="commands",tGs="skills",rGs="agents",nGs="rules",iGs=".mcp.json";async function sXn(t,e,r){let n=r.repositoryBoundary,o=n&&cy(n,t)?n:t,s=await oee(o),c=await HZn(t,e,s),l=c?.manifest,u=c?.manifestUri??Apr.join(t,e.manifestPath),d=a((v,S)=>gut(t,S,Ame(l?.[v]),n),"dirsFor"),[f,h,m,g,A,y]=await Promise.all([JZn(d("commands",eGs),s),zZn(t,d("skills",tGs),s),ZZn(d("agents",rGs),s),XZn(d("rules",nGs),s),oGs(t,l,u,e,n,s,r),aGs(t,l,u,e,n,s)]),_=l?.name,E=typeof _=="string"&&_.trim()?_.trim():void 0;return{hooks:A,commands:f,skills:h,agents:m,instructions:g,mcpServerDefinitions:y,...E&&{manifestName:E}}}a(sXn,"readPluginContributions");function _ut(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&!Object.hasOwn(t,"paths")}a(_ut,"isEmbeddedSection");async function aXn(t,e){if(await AR(e,t))return gme(t,mpr)}a(aXn,"readJsoncWithinBoundary");async function oGs(t,e,r,n,o,s,c){let l=e?.hooks;if(_ut(l)){let h=Object.hasOwn(l,"hooks")||Object.hasOwn(l,"disableAllHooks")?l:{hooks:l},m=oXn(n,r,h,t,c);if(m.length>0)return m}let u=_ut(l)?Ame(void 0):Ame(l),d=sGs(t,n,u,o);for(let f of d){let h=await aXn(f,s);if(h)return oXn(n,f,h,t,c)}return[]}a(oGs,"readHooks");function oXn(t,e,r,n,o){try{return t.parseHooks(e,r,n,o.userHome)}catch{return[]}}a(oXn,"parseHooksSafely");function sGs(t,e,r,n){let o=[];if(!r.exclusive)for(let s of GZn(e))o.push(Apr.join(t,s));for(let s of gut(t,"",{paths:r.paths,exclusive:!0},n))o.includes(s)||o.push(s);return o}a(sGs,"resolveHookConfigPaths");async function aGs(t,e,r,n,o,s){let c=new Map,l=a(d=>{for(let f of d)c.has(f.name)||c.set(f.name,f)},"add"),u=e?.mcpServers;if(_ut(u)&&l(fpr(r,{mcpServers:u},t,n)),c.size===0){let d=_ut(u)?Ame(void 0):Ame(u),f=gut(t,iGs,d,o);for(let h of f){let m=await aXn(h,s);m&&l(fpr(h,m,t,n))}}return[...c.values()].sort((d,f)=>d.name.localeCompare(f.name))}a(aGs,"readMcpServers");p();var cXn=require("fs"),ypr=fe(require("path"));var cGs=new Set(["installed.json","enablement.json"]);function _pr(t){return(e,r)=>{let n=vg(e.path);return ypr.posix.dirname(n)===r&&t.has(ypr.posix.basename(n))}}a(_pr,"matchNamedFiles");var lXn=_pr(cGs),_Ne=class{constructor(e,r,n,o,s=50){this.ctx=e;this.dir=r;this.debounceMs=s;this.logger=new pe("PluginFileWatcher");this._onDidChange=new Lc;this.onDidChange=this._onDidChange.event;this._disposed=!1;this._dirKey=vg(r),this._recursive=n.recursive??!1,this._createDir=n.createDir??!0,this._matches=n.matches,this._watcher=o??kKe(e),this._ownsWatcher=o===void 0}static{a(this,"PluginFileWatcher")}async start(){if(!this._disposed)try{if(this._createDir)await cXn.promises.mkdir(this.dir,{recursive:!0,mode:448});else if(!await Cd(this.dir))return;if(this._disposed)return;this._changeSubscription=this._watcher.onDidChange(e=>this.onEvents(e)),this._watchHandle=this._watcher.watch({path:this.dir,recursive:this._recursive})}catch(e){this.logger.warn(this.ctx,"failed to start watching plugin dir",{dir:this.dir,err:String(e)})}}onEvents(e){this._disposed||e.some(r=>this._matches(r,this._dirKey))&&this.scheduleFire()}scheduleFire(){this._debounceTimer===void 0&&(this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this._disposed||this._onDidChange.fire()},this.debounceMs))}dispose(){this._disposed||(this._disposed=!0,this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),this._watchHandle?.dispose(),this._changeSubscription?.dispose(),this._ownsWatcher&&this._watcher.dispose(),this._onDidChange.dispose())}};p();var uXn=require("fs"),dXn=fe(require("path"));var lGs=new pe("plugins.git"),uGs=12e4,Eut=class{constructor(e){this.ctx=e;this.gitInstances=new Map}static{a(this,"PluginGitService")}async cloneRepository(e,r,n){try{let o=dXn.dirname(r);await uXn.promises.mkdir(o,{recursive:!0,mode:448}),await(await this.instanceFor(o)).clone(e,r)}catch(o){throw lGs.warn(this.ctx,`clone failed for ${T4(e)}`,o),new rG(e,o)}}async checkout(e,r,n){await(await this.instanceFor(e)).checkout(n?["--detach",r]:[r])}async pull(e){if(!await this.isOnBranch(e))return!1;let r=await this.instanceFor(e),n=await this.revParse(e,"HEAD").catch(()=>{});await r.pull();let o=await this.revParse(e,"HEAD").catch(()=>{});return n!==o}async isOnBranch(e){let n=(await(await this.instanceFor(e)).raw(["rev-parse","--abbrev-ref","HEAD"])).trim();return n!==""&&n!=="HEAD"}async revParse(e,r){return(await(await this.instanceFor(e)).revparse([r])).trim()}async fetch(e){await(await this.instanceFor(e)).fetch()}async revListCount(e,r,n){let s=(await(await this.instanceFor(e)).raw(["rev-list","--count",`${r}..${n}`])).trim(),c=Number.parseInt(s,10);return Number.isFinite(c)?c:0}async instanceFor(e){let r=this.gitInstances.get(e);return r||(this._binary===void 0&&(this._binary=(await jO()).path),r=qde({baseDir:e,binary:this._binary,unsafe:{allowUnsafeCustomBinary:!0},timeout:{block:uGs}}),this.gitInstances.set(e,r)),r}forget(e){this.gitInstances.delete(e)}dispose(){this.gitInstances.clear()}};p();var vut=class{constructor(e,r){this.repository=e;this.marketplace=r}static{a(this,"PluginInstallService")}async acquirePlugin(e){let r=await this.repository.ensurePluginSource(e);if(!await Cd(r))throw new rG(e.marketplaceReference.cloneUrl,"plugin content not found after acquisition");return r}async resolveFromSource(e){let r=await this.repository.ensureRepository(e),n=await this.marketplace.readPluginsFromDirectory(r,e);if(n.length>0)return{reference:e,plugins:n,isSinglePluginRepo:!1};let o=await this.marketplace.readSinglePluginManifest(r,e);return o?{reference:e,plugins:[o],isSinglePluginRepo:!0}:{reference:e,plugins:[],isSinglePluginRepo:!1}}async resolveInstalled(e){let r=V0(e.marketplace);if(!r)return;let n=this.repository.getRepositoryUri(r);if(await Cd(n)){let s=(await this.marketplace.readPluginsFromDirectory(n,r)).find(l=>l.name===e.name);if(s)return s;let c=await this.marketplace.readSinglePluginManifest(n,r);if(c)return c}if(r.kind==="githubShorthand"&&r.githubRepo)return fXn({kind:"github",repo:r.githubRepo},r,e.name);if(r.kind==="gitUri")return fXn({kind:"url",url:r.cloneUrl},r,e.name)}};function fXn(t,e,r){return{name:r,description:"",version:"",sourceDescriptor:t,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:"openPlugin"}}a(fXn,"synthesizePlugin");p();p();var dGs=new pe("plugins.catalog");function Epr(t,e,r,n){return Array.isArray(t.plugins)?t.plugins.filter(s=>s!=null&&typeof s.name=="string"&&s.name.length>0).flatMap(s=>{let c=s.name,l=fGs(s.source,t.metadata?.pluginRoot,c,n);return l?[{name:c,description:typeof s.description=="string"?s.description:"",version:typeof s.version=="string"?s.version:"",sourceDescriptor:l,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:r}]:[]}):[]}a(Epr,"parseMarketplaceCatalog");function fGs(t,e,r,n){let o=a(s=>{n&&dGs.warn(n,`skipping plugin '${r}': ${s}`)},"skip");if(t==null||typeof t=="string"){let c=pGs(typeof e=="string"?e:void 0,t??"");return c===void 0?o("could not resolve relative source path"):{kind:"relativePath",path:c}}if(typeof t!="object"||typeof t.source!="string")return o("source object is missing a 'source' discriminant");switch(t.source){case"github":return typeof t.repo!="string"||!t.repo?o("github source is missing required 'repo' field"):mGs(t.repo)?!_me(t.ref)||!_me(t.path)?o("github source 'ref'/'path' must be strings when provided"):hXn(t.sha)?{kind:"github",repo:t.repo,ref:t.ref,sha:t.sha,path:t.path}:o("github source 'sha' must be a 40-character commit hash when provided"):o("github source 'repo' must be in 'owner/repo' format");case"url":case"git-subdir":return typeof t.url!="string"||!t.url?o(`${t.source} source is missing required 'url' field`):t.source==="url"&&!t.url.toLowerCase().endsWith(".git")?o("url source must end with '.git'"):_me(t.ref)?hXn(t.sha)?t.source==="git-subdir"&&(typeof t.path!="string"||!t.path)?o("git-subdir source is missing required 'path' field"):t.source==="url"&&!_me(t.path)?o("url source 'path' must be a string when provided"):{kind:"url",url:t.url,ref:t.ref,sha:t.sha,path:t.path}:o(`${t.source} source 'sha' must be a 40-character commit hash when provided`):o(`${t.source} source 'ref' must be a string when provided`);case"npm":case"pip":return typeof t.package!="string"||!t.package?o(`${t.source} source is missing required 'package' field`):!_me(t.version)||!_me(t.registry)?o(`${t.source} source 'version'/'registry' must be strings when provided`):{kind:t.source==="npm"?"npm":"pip",package:t.package,version:t.version,registry:t.registry};default:return o(`unknown source kind '${t.source}'`)}}a(fGs,"parsePluginSource");function pGs(t,e){let r=pXn(t??""),n=pXn(e);return r&&(n===r||n.startsWith(`${r}/`))?n:hGs(`/${r}/${n}`).replace(/^\/+/,"")}a(pGs,"resolvePluginSource");function pXn(t){return t.trim().replace(/\\/g,"/").replace(/^\.?\/+/,"").replace(/\/+$/g,"")}a(pXn,"normalizeMarketplacePath");function hGs(t){let e=[];for(let r of t.split("/"))r===""||r==="."||(r===".."?e.pop():e.push(r));return`/${e.join("/")}`}a(hGs,"posixNormalize");function _me(t){return t===void 0||typeof t=="string"}a(_me,"isOptionalString");function hXn(t){return t===void 0||typeof t=="string"&&/^[0-9a-fA-F]{40}$/.test(t)}a(hXn,"isOptionalGitSha");function mGs(t){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(t)}a(mGs,"isValidGitHubRepo");var vNe=fe(require("path"));var Eme=new pe("plugins.marketplace"),gGs=480*60*1e3,AGs=3e4,yGs=15e4,mXn=[{type:"openPlugin",path:"marketplace.json"},{type:"openPlugin",path:".plugin/marketplace.json"},{type:"copilot",path:".github/plugin/marketplace.json"},{type:"claude",path:".claude-plugin/marketplace.json"}],_Gs=[{type:"openPlugin",path:".plugin/plugin.json"},{type:"claude",path:".claude-plugin/plugin.json"},{type:"copilot",path:"plugin.json"}],Cut=class{constructor(e,r){this.ctx=e;this.repository=r;this.githubCatalogCache=new Map}static{a(this,"PluginMarketplaceService")}async fetchMarketplacePlugins(e,r){let n=await Promise.all(e.map(o=>this.fetchOneBounded(o,r)));return{plugins:n.flatMap(o=>o.plugins),errors:n.flatMap(o=>o.error?[o.error]:[])}}fetchOneBounded(e,r){let n=e.kind==="githubShorthand"&&e.githubRepo?this.fetchFromGitHubRepo(e,e.githubRepo,r):this.fetchFromClonedRepo(e,r);return this.withReferenceDeadline(n,e,r)}withReferenceDeadline(e,r,n){return new Promise(o=>{let s=!1,c=a(d=>{s||(s=!0,clearTimeout(l),u?.dispose(),o(d))},"finish"),l=setTimeout(()=>{Eme.debug(this.ctx,"marketplace fetch exceeded deadline",{reference:r.rawValue}),c({plugins:[],error:vGs(r)})},yGs);l.unref?.();let u=n?.onCancellationRequested(()=>c({plugins:[]}));n?.isCancellationRequested&&c({plugins:[]}),e.then(c,d=>c({plugins:[],error:gXn(r,d)}))})}async readPluginsFromDirectory(e,r,n){return this.readPluginsFromDefinitions(r,async o=>{if(!n?.isCancellationRequested)return gme(vNe.join(e,o))},e)}async readAllPluginsFromDirectory(e,r,n){let o=new Map;for(let s of mXn){if(n?.isCancellationRequested)return[];let c=await gme(vNe.join(e,s.path));if(!(!c?.plugins||!Array.isArray(c.plugins)))for(let l of Epr(c,r,s.type,this.ctx))o.has(l.name)||o.set(l.name,AXn(l,e))}return[...o.values()]}async readSinglePluginManifest(e,r){if(!(r.kind!=="githubShorthand"&&r.kind!=="gitUri")){for(let n of _Gs){let o=await gme(vNe.join(e,n.path));if(!o||typeof o!="object"||Array.isArray(o))continue;let s=r.kind==="githubShorthand"?{kind:"github",repo:r.githubRepo}:{kind:"url",url:r.cloneUrl};return{name:typeof o.name=="string"&&o.name?o.name:r.displayLabel,description:typeof o.description=="string"?o.description:"",version:typeof o.version=="string"?o.version:"",sourceDescriptor:s,marketplace:r.displayLabel,marketplaceReference:r,marketplaceType:n.type,readmeUri:r.githubRepo?EXn(r.githubRepo,""):_Xn(e,"")}}Eme.debug(this.ctx,"no single-plugin manifest found",{reference:r.rawValue})}}clearCache(){this.githubCatalogCache.clear()}async fetchFromGitHubRepo(e,r,n){let o=this.getCachedCatalog(e.canonicalId);if(o)return{plugins:o.map(d=>CGs(d,e))};let s=!0,c,l=encodeURIComponent(e.ref??"main"),u=await this.readPluginsFromDefinitions(e,async d=>{if(n?.isCancellationRequested)return;let f=`https://raw.githubusercontent.com/${r}/${l}/${d}`,h=EGs(n);try{let m=await this.ctx.get(Jt).fetch(f,{method:"GET",timeout:AGs,signal:h.signal});if(m.status!==200){m.status>=500&&(c=m.status),s&&=m.status>=400&&m.status<500;return}return mNe(await m.text())}catch(m){Eme.debug(this.ctx,"raw marketplace fetch failed",{url:f,err:String(m)});return}finally{h.dispose()}});return u.length>0?(this.setCachedCatalog(e.canonicalId,u),{plugins:u}):s?(Eme.debug(this.ctx,"repo may be private; falling back to clone",{repo:r}),this.fetchFromClonedRepo(e,n)):c!==void 0?{plugins:[],error:{reference:e.displayLabel,canonicalId:e.canonicalId,kind:"unavailable",status:c,message:`Marketplace '${e.displayLabel}' is temporarily unavailable (HTTP ${c})`}}:{plugins:[]}}async fetchFromClonedRepo(e,r){if(r?.isCancellationRequested)return{plugins:[]};let n;try{n=await this.repository.ensureRepository(e)}catch(o){return Eme.debug(this.ctx,"failed to prepare marketplace repository",{reference:e.rawValue,err:String(o)}),{plugins:[],error:gXn(e,o)}}return{plugins:await this.readPluginsFromDirectory(n,e,r)}}async readPluginsFromDefinitions(e,r,n){for(let o of mXn){let s=await r(o.path);if(!(!s?.plugins||!Array.isArray(s.plugins)))return Epr(s,e,o.type,this.ctx).map(c=>AXn(c,n))}return Eme.debug(this.ctx,"no marketplace catalog found",{reference:e.rawValue}),[]}now(){return this.ctx.get(HC).now().getTime()}getCachedCatalog(e){let r=this.githubCatalogCache.get(e);if(r){if(r.expiresAt<=this.now()){this.githubCatalogCache.delete(e);return}return r.plugins}}setCachedCatalog(e,r){this.githubCatalogCache.set(e,{plugins:r,expiresAt:this.now()+gGs})}};function EGs(t){let e={dispose(){}};if(!t)return e;let r=new AbortController;if(t.isCancellationRequested)return r.abort(),{signal:r.signal,...e};let n=t.onCancellationRequested(()=>r.abort());return{signal:r.signal,dispose:a(()=>n.dispose(),"dispose")}}a(EGs,"abortSignalFor");function vGs(t){return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:"unavailable",message:`Marketplace '${t.displayLabel}' did not respond in time`}}a(vGs,"deadlineError");function gXn(t,e){let r=e instanceof Error?e.message:String(e),n=e instanceof lme?"localMissing":"cloneFailed";return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:n,message:r}}a(gXn,"toFetchError");function CGs(t,e){return{...t,marketplace:e.displayLabel,marketplaceReference:e}}a(CGs,"restamp");function AXn(t,e){let r=t.sourceDescriptor.kind==="relativePath"?t.sourceDescriptor.path:"",n=e?_Xn(e,r):EXn(t.marketplaceReference.githubRepo??"",r);return{...t,readmeUri:n}}a(AXn,"withReadme");function yXn(t){let e=t.trim().replace(/^\.?\/+|\/+$/g,"");return e?`${e}/README.md`:"README.md"}a(yXn,"readmeRelPath");function _Xn(t,e){return vNe.join(t,yXn(e))}a(_Xn,"fileReadmeUri");function EXn(t,e){return`https://github.com/${t}/blob/main/${yXn(e)}`}a(EXn,"githubBlobReadmeUri");p();var bXn=require("node:url");var vXn=`/${eXn.replace(/\\/g,"/")}/`,bGs="_direct";function bpr(t,e){let r=t.fromMarketplace;if(r){let u=e?.(r.marketplaceReference.canonicalId)??r.marketplace;return`${r.name}@${u}`}let n=t.uri.replace(/\\/g,"/"),o=n.indexOf(vXn);if(o===-1)return;let s=n.slice(o+vXn.length).split("/").filter(u=>u.length>0);if(s.length!==2||s[0]===bGs)return;let[c,l]=s;return`${l}@${c}`}a(bpr,"getPluginPolicyId");function SXn(t){let e=new Map;for(let[r,n]of Object.entries(t??{})){let o=wXn(n.source);o&&e.set(o.canonicalId,r)}return e}a(SXn,"managedMarketplaceLabels");function TXn(t,e){return t!==void 0&&e?.[t]===!1}a(TXn,"isPluginBlockedByPolicy");function vme(t){return t.enabled&&t.policyBlocked!==!0}a(vme,"isEffectivelyEnabled");function IXn(t){return Object.entries(t??{}).filter(([,e])=>e===!0).map(([e])=>e)}a(IXn,"managedForceEnabledIds");function xXn(t,e){let r=new Map;for(let n of t)r.has(n.canonicalId)||r.set(n.canonicalId,{...n,origin:"user"});for(let[n,o]of Object.entries(e??{})){let s=wXn(o.source);s&&r.set(s.canonicalId,{...s,displayLabel:n,origin:"policy"})}return[...r.values()]}a(xXn,"composeKnownMarketplaces");function Spr(t,e){return t===void 0?!0:t.some(r=>SGs(r,e))}a(Spr,"isMarketplaceAllowed");function SGs(t,e){switch(t.source){case"github":return t.path===void 0&&vpr(RXn(t.repo,t.ref),e);case"git":return t.path===void 0&&vpr(Tpr(t.url,t.ref),e);case"url":return vpr(t.url,e);case"file":case"directory":return e.kind==="localFileUri"&&e.localRepositoryUri!==void 0&&Cpr(e.localRepositoryUri)===Cpr(t.path);case"hostPattern":return CXn(t.hostPattern,TGs(e));case"pathPattern":return e.kind==="localFileUri"&&e.localRepositoryUri!==void 0?CXn(t.pathPattern,e.localRepositoryUri):!1;case"npm":return!1}}a(SGs,"matchesStrictEntry");function vpr(t,e){return V0(t)?.canonicalId===e.canonicalId}a(vpr,"matchesByCanonicalId");function CXn(t,e){if(e===void 0)return!1;try{return new RegExp(t).test(e)}catch{return!1}}a(CXn,"matchesPattern");function wXn(t){switch(t.source){case"github":return V0(RXn(t.repo,t.ref));case"git":return V0(Tpr(t.url,t.ref));case"directory":return V0(Cpr(t.path))}}a(wXn,"managedSourceToReference");function RXn(t,e){return Tpr(t,e)}a(RXn,"githubRawRef");function Tpr(t,e){return e?`${t}#${e}`:t}a(Tpr,"withRef");function Cpr(t){return(0,bXn.pathToFileURL)(t).toString()}a(Cpr,"pathToFileUrl");function TGs(t){if(t.kind==="githubShorthand")return"github.com";if(t.kind!=="gitUri")return;let e=/^[\w._-]+@([\w.-]+):/.exec(t.cloneUrl);if(e)return e[1].toLowerCase();try{return new URL(t.cloneUrl).hostname.toLowerCase()||void 0}catch{return}}a(TGs,"refHost");p();p();var Cme=require("fs"),kXn=fe(require("path"));var IGs=1e4,xGs=3e4,wGs=25;async function bme(t,e){await Cme.promises.mkdir(kXn.dirname(t),{recursive:!0,mode:448});let r=Date.now()+xGs;for(;;)try{await Cme.promises.writeFile(t,`${process.pid} +`,{flag:"wx",mode:384});break}catch(n){if(n.code!=="EEXIST")throw n;if(Date.now()>r)throw new Error(`withFileLock: timed out acquiring lock ${JSON.stringify(t)}`);await RGs(t)>IGs&&await Cme.promises.rm(t,{force:!0}).catch(()=>{}),await JC(wGs)}try{return await e()}finally{await Cme.promises.rm(t,{force:!0}).catch(()=>{})}}a(bme,"withFileLock");async function RGs(t){try{let e=await Cme.promises.stat(t);return Date.now()-e.mtimeMs}catch{return 1/0}}a(RGs,"lockAgeMs");p();var Sme=require("fs"),lee=fe(require("path"));var kGs=new pe("plugins.source"),PGs=0,PXn=".clone-tmp";function DGs(t){try{return process.kill(t,0),!0}catch(e){return e.code==="EPERM"}}a(DGs,"isProcessAlive");async function NGs(t){let e=lee.dirname(t),r=`${lee.basename(t)}.`,n;try{n=await Sme.promises.readdir(e)}catch{return}await Promise.all(n.map(async o=>{if(!o.startsWith(r)||!o.endsWith(PXn))return;let s=Number.parseInt(o.slice(r.length).split(".")[0],10);!Number.isInteger(s)||s<=0||s===process.pid||DGs(s)||await Sme.promises.rm(lee.join(e,o),{recursive:!0,force:!0}).catch(()=>{})}))}a(NGs,"sweepOrphanedCloneTemps");async function Ipr(t,e,r,n,o){if(await Cd(r))return;await NGs(r);let s=`${r}.${process.pid}.${PGs++}${PXn}`;try{await t.git.cloneRepository(e,s,n),o?await t.git.checkout(s,o,!0):n&&await t.git.checkout(s,n),await bme(`${r}.lock`,async()=>{await Cd(r)||(await Sme.promises.mkdir(lee.dirname(r),{recursive:!0,mode:448}),await Sme.promises.rename(s,r))})}finally{t.git.forget(s),await Sme.promises.rm(s,{recursive:!0,force:!0}).catch(()=>{})}}a(Ipr,"cloneIntoPlace");var but=class{constructor(){this.kind="relativePath"}static{a(this,"RelativePathPluginSource")}getInstallUri(){throw new Error("Use PluginRepositoryService.getPluginInstallUri() for relative-path sources")}ensure(){throw new Error("Use PluginRepositoryService.ensureRepository() for relative-path sources")}update(){throw new Error("Use PluginRepositoryService.pullRepository() for relative-path sources")}getCleanupTarget(){}getLabel(e){return e.path||"."}},Sut=class{constructor(e){this.deps=e}static{a(this,"AbstractGitPluginSource")}getCleanupTarget(e,r){return this.getRepoDir(e,r)}async ensure(e,r){let n=r.sourceDescriptor,o=this.getRepoDir(e,n);return await Cd(o)?await this.checkoutRevision(o,n):await Ipr(this.deps,this.cloneUrl(n),o,n.ref,n.sha),this.getInstallUri(e,n)}async update(e,r){let n=r.sourceDescriptor,o=this.getRepoDir(e,n);if(!await Cd(o))return kGs.warn(this.deps.ctx,`cannot update '${r.name}': source repository not cloned`,{repoDir:o}),!1;if(!n.sha&&await this.deps.git.isOnBranch(o)){let l=await this.deps.git.pull(o);return await this.checkoutRevision(o,n),l}let s=await this.deps.git.revParse(o,"HEAD").catch(()=>{});await this.deps.git.fetch(o),await this.checkoutRevision(o,n);let c=await this.deps.git.revParse(o,"HEAD").catch(()=>{});return s!==c}async checkoutRevision(e,r){r.sha?await this.deps.git.checkout(e,r.sha,!0):r.ref&&await this.deps.git.checkout(e,r.ref)}},Tut=class extends Sut{constructor(){super(...arguments);this.kind="github"}static{a(this,"GitHubPluginSource")}getInstallUri(r,n){let o=n;return cNe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n,[s,c]=o.repo.split("/");return aNe(r,["github.com",nI(s),nI(c),...aut(o.ref,o.sha)])}getLabel(r){let n=r;return n.path?`${n.repo}/${n.path}`:n.repo}cloneUrl(r){return`https://github.com/${r.repo}.git`}},Iut=class extends Sut{constructor(){super(...arguments);this.kind="url"}static{a(this,"GitUrlPluginSource")}getInstallUri(r,n){let o=n;return cNe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n;return aNe(r,SZn(o.url,o.ref,o.sha))}getLabel(r){let n=r;return n.path?`${n.url}/${n.path}`:n.url}cloneUrl(r){return r.url}};var CNe=require("fs"),uee=fe(require("path"));var MGs=0,xut=class{constructor(e,r,n){this.ctx=e;this.store=r;this.git=n;this.logger=new pe("plugins.repository");this.cloneSequencer=new _w;this.cacheRoot=r.sharedContentDir;let o={ctx:e,git:n};this.sources=new Map([["relativePath",new but],["github",new Tut(o)],["url",new Iut(o)]])}static{a(this,"PluginRepositoryService")}getPluginSource(e){let r=this.sources.get(e);if(!r)throw new zlt(e);return r}getRepositoryUri(e){return e.kind==="localFileUri"&&e.localRepositoryUri?e.localRepositoryUri:aNe(this.cacheRoot,e.cacheSegments)}getPluginInstallUri(e){let r=e.sourceDescriptor;if(r.kind!=="relativePath")return this.getPluginSourceInstallUri(r);let n=this.getRepositoryUri(e.marketplaceReference);return cNe(n,r.path)}getPluginSourceInstallUri(e){return this.getPluginSource(e.kind).getInstallUri(this.cacheRoot,e)}async ensureRepository(e){let r=this.getRepositoryUri(e);return this.cloneSequencer.queue(r,()=>this.ensureRepositoryUnsequenced(e,r))}async ensurePluginSource(e){if(e.sourceDescriptor.kind==="relativePath"){let r=e.marketplaceReference,n=this.getRepositoryUri(r);return this.cloneSequencer.queue(n,async()=>{await this.ensureRepositoryUnsequenced(r,n);let o=this.getPluginInstallUri(e);if(r.kind!=="localFileUri"&&!await Cd(o))try{await this.git.pull(n)}catch(s){throw new rG(r.cloneUrl,s)}return o})}return this.getPluginSource(e.sourceDescriptor.kind).ensure(this.cacheRoot,e)}async ensureRepositoryUnsequenced(e,r){if(await Cd(r))return r;if(e.kind==="localFileUri")throw new lme(r);return await Ipr({ctx:this.ctx,git:this.git},e.cloneUrl,r,e.ref),r}async updatePluginSource(e){return e.sourceDescriptor.kind==="relativePath"?this.pullRepository(e.marketplaceReference):this.getPluginSource(e.sourceDescriptor.kind).update(this.cacheRoot,e)}async pullRepository(e){if(e.kind==="localFileUri")return!1;let r=this.getRepositoryUri(e);return await Cd(r)?this.git.pull(r):(this.logger.warn(this.ctx,"cannot pull: repository not cloned",{repoDir:r}),!1)}async fetchRepository(e){if(e.kind==="localFileUri")return!1;let r=this.getRepositoryUri(e);if(!await Cd(r))return!1;try{return await this.git.fetch(r),await this.git.revListCount(r,"HEAD","@{u}")>0}catch(n){return this.logger.debug(this.ctx,"silent fetch failed",{repoDir:r,err:String(n)}),!1}}async cleanupPluginSource(e){let r=this.sources.get(e.sourceDescriptor.kind);if(!r)return;let n=r.getCleanupTarget(this.cacheRoot,e.sourceDescriptor);if(!n||!cy(this.cacheRoot,n))return;let o=!1,s=`${n}.gc-${process.pid}-${MGs++}`;if(await bme(`${n}.lock`,async()=>{if(await this.isCloneReferenced(n)){this.logger.info(this.ctx,"skipping cleanup: clone still referenced by another editor",{cleanupDir:n});return}try{await Cd(n)&&await CNe.promises.rename(n,s),o=!0}catch(c){this.logger.warn(this.ctx,"failed to vacate plugin clone",{cleanupDir:n,err:String(c)})}}),!!o){try{await CNe.promises.rm(s,{recursive:!0,force:!0}),this.logger.info(this.ctx,"removed plugin clone",{cleanupDir:n})}catch(c){this.logger.warn(this.ctx,"failed to remove vacated plugin clone",{tombstone:s,err:String(c)})}await this.pruneEmptyParents(n).catch(c=>this.logger.warn(this.ctx,"failed to prune empty parents",{cleanupDir:n,err:String(c)}))}}async isCloneReferenced(e){return(await this.store.readInstalledForAllEditors()).some(n=>{let o=uee.isAbsolute(n.pluginUri)?n.pluginUri:uee.resolve(this.cacheRoot,n.pluginUri);return cy(e,o)})}async pruneEmptyParents(e){let r=uee.dirname(e);for(;cy(this.cacheRoot,r)&&r!==this.cacheRoot;){try{if((await CNe.promises.readdir(r)).length>0)break;await CNe.promises.rmdir(r)}catch{break}r=uee.dirname(r)}}};p();p();function DXn(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.pluginUri=="string"&&typeof e.name=="string"&&typeof e.marketplace=="string"}a(DXn,"isInstalledEntry");var sG=require("fs"),sD=fe(require("path"));var NXn="plugins",FGs="plugins",UGs="installed.json",QGs="enablement.json",qGs="marketplaces.json",jGs=".lock",HGs=0,MXn=a(t=>typeof t=="string","isString"),bNe=class t{constructor(e){this.rootDir=e}static{a(this,"PluginStore")}get sharedContentDir(){return sD.join(this.rootDir,NXn)}editorPluginsDir(e){return sD.join(this.rootDir,this.safeEditorSegment(e),FGs)}installedJsonPath(e){return sD.join(this.editorPluginsDir(e),UGs)}enablementJsonPath(e){return sD.join(this.editorPluginsDir(e),QGs)}marketplacesJsonPath(e){return sD.join(this.editorPluginsDir(e),qGs)}async readInstalled(e){let{version:r,items:n}=await this.readManifest(this.installedJsonPath(e),"installed",1,DXn);return{version:r,installed:n}}async readEnablement(e){let{version:r,items:n}=await this.readManifest(this.enablementJsonPath(e),"disabled",1,MXn);return{version:r,disabled:n}}async readMarketplaces(e){let{version:r,items:n}=await this.readManifest(this.marketplacesJsonPath(e),"marketplaces",1,MXn);return{version:r,marketplaces:n}}async readManifest(e,r,n,o){let s=await this.readJson(e),c=s?.[r];return Array.isArray(c)?{version:typeof s?.version=="number"?s.version:n,items:c.filter(o)}:{version:n,items:[]}}async writeInstalled(e,r){await this.writeJsonAtomic(this.installedJsonPath(e),r)}async writeEnablement(e,r){await this.writeJsonAtomic(this.enablementJsonPath(e),r)}async writeMarketplaces(e,r){await this.writeJsonAtomic(this.marketplacesJsonPath(e),r)}async withLock(e,r){let n=sD.join(this.editorPluginsDir(e),jGs);return bme(n,r)}async listEditorIds(){let e;try{e=await sG.promises.readdir(this.rootDir,{withFileTypes:!0})}catch{return[]}let r=e.filter(o=>(o.isDirectory()||o.isSymbolicLink())&&t.isSafeEditorId(o.name)),n=await Promise.all(r.map(o=>sG.promises.stat(this.installedJsonPath(o.name)).then(s=>s.isFile(),()=>!1)));return r.filter((o,s)=>n[s]).map(o=>o.name)}async readInstalledForAllEditors(){let e=await this.listEditorIds();return(await Promise.all(e.map(n=>this.readInstalled(n)))).flatMap(n=>n.installed)}static isSafeEditorId(e){return!(!e||e==="."||e===".."||e.toLowerCase()===NXn||e!==sD.basename(e)||/[/\\]/.test(e)||process.platform==="win32"&&/[<>:"|?*]/.test(e))}safeEditorSegment(e){if(!t.isSafeEditorId(e))throw new Error(`PluginStore: unsafe editorId ${JSON.stringify(e)}`);return e}async readJson(e){try{let r=await sG.promises.readFile(e,{encoding:"utf8"});return JSON.parse(r)}catch{return}}async writeJsonAtomic(e,r){let n=sD.dirname(e);await sG.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${HGs++}.tmp`,s=JSON.stringify(r,null,2)+` +`;try{await sG.promises.writeFile(o,s,{encoding:"utf8",mode:384}),await sG.promises.rename(o,e)}catch(c){throw await sG.promises.rm(o,{force:!0}).catch(()=>{}),c}}};var LXn=require("os"),U8=fe(require("path"));function xpr(t){let e=t.source?`source:${t.source}`:`path:${lF(t.path)}`;return`${t.provider}\0${e}`}a(xpr,"runtimePluginIdentity");var OXn={hooks:[],commands:[],skills:[],agents:[],instructions:[],mcpServerDefinitions:[]},wpr=new Set,GGs=new Set(yme.filter(t=>t.changeSignal).map(t=>t.name)),Ca=class{constructor(e,r={}){this.ctx=e;this.logger=new pe("AgentPluginService");this._onDidChangePlugins=new Lc;this.onDidChangePlugins=a((e,r,n)=>(this.ensureWatching(),this._onDidChangePlugins.event(e,r,n)),"onDidChangePlugins");this._onDidChangeRuntimePlugins=new Lc;this.onDidChangeRuntimePlugins=this._onDidChangeRuntimePlugins.event;this.runtimeSourceRegistrations=[];this.mutationSequencer=new _w;this._sourceWatchers=[];this._sourceSubscriptions=[];this._watchStarted=!1;this._disposed=!1;this._lastSourceListings=new Map;this._injectedWatcher=r.watcher,this.watchDebounceMs=r.watchDebounceMs??50,this.userHome=r.userHome??(0,LXn.homedir)(),this.copilotHome=r.copilotHome??(process.env.COPILOT_HOME||U8.join(this.userHome,hpr)),this.ensureWatching()}static{a(this,"AgentPluginService")}registerRuntimePluginSource(e){let r={source:e,subscription:e.onDidChange(()=>this._onDidChangeRuntimePlugins.fire())};return this.runtimeSourceRegistrations.push(r),{dispose:a(()=>{let n=this.runtimeSourceRegistrations.indexOf(r);n<0||(this.runtimeSourceRegistrations.splice(n,1),r.subscription.dispose(),this._onDidChangeRuntimePlugins.fire())},"dispose")}}async listRuntimePlugins(e){let n=(await Promise.all(this.runtimeSourceRegistrations.map(async({source:s})=>{try{let c=s.listPlugins(e).catch(u=>(this.logger.warn(this.ctx,"runtime plugin source listing failed",{provider:s.provider,error:u instanceof Error?u.message:String(u)}),[])),l=await LO(c,ANe,void 0);return l===void 0?(this.logger.warn(this.ctx,"runtime plugin source listing timed out",{provider:s.provider}),[]):l.map(u=>({...u,provider:s.provider}))}catch(c){return this.logger.warn(this.ctx,"runtime plugin source listing failed",{provider:s.provider,error:c instanceof Error?c.message:String(c)}),[]}}))).flat().filter(s=>typeof s.name=="string"&&s.name.length>0&&typeof s.path=="string"&&s.path.length>0&&U8.isAbsolute(s.path)).map(s=>{let{source:c,...l}=s;return{...l,path:U8.normalize(s.path),...typeof c=="string"&&c.length>0?{source:c}:{}}}).sort((s,c)=>s.provider.localeCompare(c.provider)||xpr(s).localeCompare(xpr(c))||s.name.localeCompare(c.name)||lF(s.path).localeCompare(lF(c.path))||s.path.localeCompare(c.path)),o=new Map;for(let s of n){let c=xpr(s);o.has(c)||o.set(c,s)}return[...o.values()]}get store(){return this._store||(this._store=new bNe(this.ctx.get(Un).directory)),this._store}get managedSettings(){try{return this.ctx.get(ay)}catch(e){if(e instanceof Ic&&e.ctor===ay)return;throw e}}get repository(){return this._repository||(this._git??=new Eut(this.ctx),this._repository=new xut(this.ctx,this.store,this._git)),this._repository}get marketplace(){return this._marketplace||(this._marketplace=new Cut(this.ctx,this.repository)),this._marketplace}get install(){return this._install||(this._install=new vut(this.repository,this.marketplace)),this._install}get editorId(){return this.ctx.get(Ir).getEditorIdentity().editorId}guardEditorId(e){let r=this.editorId;if(bNe.isSafeEditorId(r))return r;this.logger.warn(this.ctx,`${e} skipped: unsafe editorId`,{editorId:r})}async listPlugins(){this.ensureWatching();let e=this.guardEditorId("listPlugins");if(e===void 0)return[];let[{installed:r},{disabled:n}]=await Promise.all([this.store.readInstalled(e),this.store.readEnablement(e)]),o=new Set(n),s=await nXn(this.discoveryDeps(r)),c=this.pluginPolicyView(),l=await ZC(s,yNe,u=>this.toPlugin(u,o,c));return l.sort((u,d)=>u.uri.localeCompare(d.uri)),l}pluginPolicyView(){let e=this.managedSettings?.get(),r=SXn(e?.extraKnownMarketplaces);return{enabledPlugins:e?.enabledPlugins,marketplaceLabelFor:a(n=>r.get(n),"marketplaceLabelFor")}}async toPlugin(e,r,n){let o=await this.readContributionsSafely(e),s=e.fromMarketplace?.name||o.manifestName||e.displayName||U8.basename(e.fsPath),c=TXn(bpr({uri:e.uri,fromMarketplace:e.fromMarketplace},n.marketplaceLabelFor),n.enabledPlugins);return{uri:e.uri,label:s,enabled:!r.has(e.uri),hooks:o.hooks,commands:o.commands,skills:o.skills,agents:o.agents,instructions:o.instructions,mcpServerDefinitions:o.mcpServerDefinitions,...c&&{policyBlocked:!0},...e.fromMarketplace&&{fromMarketplace:e.fromMarketplace}}}readContributionsSafely(e){let r=(async()=>{let n=await jZn(e.fsPath);return sXn(e.fsPath,n,{userHome:this.userHome,...e.repositoryBoundary!==void 0&&{repositoryBoundary:e.repositoryBoundary}})})().catch(n=>(this.logger.debug(this.ctx,"listPlugins: reading contributions failed",{uri:e.uri,err:String(n)}),OXn));return LO(r,ANe,OXn)}discoveryRoots(){return{sharedContentDir:this.store.sharedContentDir,copilotHome:this.copilotHome}}isReadOnlyPlugin(e){return yut(e,this.copilotHome)}discoveryDeps(e){let r=new Map,n=IXn(this.managedSettings?.get()?.enabledPlugins);return{...this.discoveryRoots(),installed:e,forceEnabledIds:n,getRepositoryUri:a(o=>this.repository.getRepositoryUri(o),"getRepositoryUri"),resolveMarketplace:a(o=>this.resolveMarketplaceForList(o,r),"resolveMarketplace")}}resolveMarketplaceForList(e,r){let n=V0(e.marketplace);if(!n)return Promise.resolve(void 0);let o=(async()=>{let s=this.repository.getRepositoryUri(n),c=await this.readMarketplacePluginFromDir(s,n,e.name,r);if(c)return c;if(e.pluginUri&&e.pluginUri!==s)return await this.readMarketplacePluginFromDir(e.pluginUri,n,e.name)})().catch(s=>{this.logger.debug(this.ctx,"listPlugins: resolving marketplace metadata failed",{pluginUri:e.pluginUri,err:String(s)})});return LO(o,ANe,void 0)}async readMarketplacePluginFromDir(e,r,n,o){if(!await Cd(e))return;let s=o?.get(e);s||(s=this.marketplace.readAllPluginsFromDirectory(e,r),o?.set(e,s));let l=(await s).find(u=>u.name===n);return l||(await this.marketplace.readSinglePluginManifest(e,r)??void 0)}async enablePlugin(e){let r=(await this.listPlugins()).find(n=>n.uri===e);if(r?.policyBlocked)throw new Klt(bpr(r,this.pluginPolicyView().marketplaceLabelFor));await this.setPluginEnabled(e,!0)}async disablePlugin(e){await this.setPluginEnabled(e,!1)}async setPluginEnabled(e,r){this.ensureWatching(),await this.mutate(async n=>{let o=await this.store.readEnablement(n),s=o.disabled.includes(e);if(r===!s)return!1;let c=r?o.disabled.filter(l=>l!==e):[...o.disabled,e];return await this.store.writeEnablement(n,{...o,disabled:c}),this.logger.info(this.ctx,`${r?"enabled":"disabled"} plugin`,{pluginUri:e}),!0})}async mutate(e){let r=this.guardEditorId("mutation");if(r===void 0)return;await this.mutationSequencer.queue(r,()=>this.store.withLock(r,()=>e(r)))&&await this.refreshAndMaybeFire(wpr)}async reconcile(){this.ensureWatching();let e=this.guardEditorId("reconcile");if(e===void 0)return;let r=await this.store.readInstalled(e),n=await Promise.all(r.installed.map(s=>this.shouldDrop(s))),o=new Set(r.installed.filter((s,c)=>n[c]).map(s=>s.pluginUri));o.size!==0&&await this.mutate(async s=>{let c=await this.store.readInstalled(s),l=await Promise.all(c.installed.map(f=>o.has(f.pluginUri)?this.shouldDrop(f):Promise.resolve(!1))),u=c.installed.filter((f,h)=>!l[h]),d=c.installed.filter((f,h)=>l[h]);for(let f of d)this.logger.info(this.ctx,"reconcile dropped missing plugin",{name:f.name,pluginUri:f.pluginUri});return d.length===0?!1:(await this.store.writeInstalled(s,{...c,installed:u}),await this.pruneEnablement(s,d.map(f=>f.pluginUri)),!0)})}async pruneEnablement(e,r){let n=new Set(r),o=await this.store.readEnablement(e),s=o.disabled.filter(c=>!n.has(c));s.length!==o.disabled.length&&await this.store.writeEnablement(e,{...o,disabled:s})}async shouldDrop(e){return U8.isAbsolute(e.pluginUri)?gpr(e.pluginUri):!1}ensureWatching(){if(this._watchStarted||this._disposed||!this.ctx.get(Ir).isEditorPluginInfoKnown())return;this._watchStarted=!0;let e=this.guardEditorId("plugin watch");if(e===void 0)return;let r=this.store.editorPluginsDir(e);this._fileWatcher=new _Ne(this.ctx,r,{matches:lXn},this._injectedWatcher,this.watchDebounceMs),this._watchSubscription=this._fileWatcher.onDidChange(()=>{this.refreshAndMaybeFire(wpr)});let n=this.discoveryRoots();for(let s of yme){let c=s.changeSignal;if(!c)continue;let l=new _Ne(this.ctx,c.dir(n),{createDir:c.createDir,matches:_pr(c.files)},this._injectedWatcher,this.watchDebounceMs);this._sourceSubscriptions.push(l.onDidChange(()=>{this.refreshAndMaybeFire(new Set([s.name]))})),this._sourceWatchers.push(l)}let o=!1;this._policySubscription=this.managedSettings?.observe(s=>({enabledPlugins:s.enabledPlugins,extraKnownMarketplaces:s.extraKnownMarketplaces}),()=>{if(!o){o=!0;return}this.refreshAndMaybeFire(wpr)}),this.seedAndStart()}async seedAndStart(){await this.mutationSequencer.queue(this.editorId,async()=>{if(this._lastStateKey===void 0)try{this._lastStateKey=await this.stateKey(GGs)}catch{}}),!this._disposed&&await Promise.all([this._fileWatcher?.start(),...this._sourceWatchers.map(e=>e.start())])}refreshAndMaybeFire(e){return this.mutationSequencer.queue(this.editorId,async()=>{if(this._disposed)return;let r;try{r=await this.stateKey(e)}catch(n){this.logger.warn(this.ctx,"plugin refresh failed",{err:String(n)});return}r!==this._lastStateKey&&(this._lastStateKey=r,this._onDidChangePlugins.fire())})}async stateKey(e){let r=this.editorId,[{installed:n},{disabled:o}]=await Promise.all([this.store.readInstalled(r),this.store.readEnablement(r)]),s=this.discoveryRoots();for(let u of yme){let d=u.changeSignal;if(!d||!e.has(u.name)&&this._lastSourceListings.has(u.name))continue;let f=await d.listing(s);f!==void 0&&this._lastSourceListings.set(u.name,f)}let c={};for(let u of yme)u.changeSignal&&(c[u.name]=[...this._lastSourceListings.get(u.name)??[]].sort());let l=this.managedSettings?.get();return JSON.stringify({installed:n.map(u=>[u.pluginUri,u.name]).sort((u,d)=>u[0].localeCompare(d[0])||u[1].localeCompare(d[1])),disabled:[...o].sort(),sources:c,enabledPlugins:Object.entries(l?.enabledPlugins??{}).sort((u,d)=>u[0].localeCompare(d[0])),extraKnownMarketplaces:Object.entries(l?.extraKnownMarketplaces??{}).sort((u,d)=>u[0].localeCompare(d[0]))})}async installPlugin(e){this.assertMarketplaceAllowed(e.marketplaceReference);let r=await this.install.acquirePlugin(e);return await this.mutate(async n=>{let o=await this.store.readInstalled(n),s={pluginUri:r,marketplace:e.marketplaceReference.rawValue,name:e.name},c=o.installed.find(u=>u.pluginUri===r);if(c&&c.name===s.name&&c.marketplace===s.marketplace)return!1;let l=c?o.installed.map(u=>u.pluginUri===r?s:u):[...o.installed,s];return await this.store.writeInstalled(n,{...o,installed:l}),this.logger.info(this.ctx,"installed plugin",{pluginUri:r,name:s.name}),!0}),r}async uninstallPlugin(e){let r;if(await this.mutate(async o=>{let s=await this.store.readInstalled(o),c=s.installed.findIndex(u=>u.pluginUri===e);if(c<0)return!1;r=s.installed[c];let l=s.installed.filter((u,d)=>d!==c);return await this.store.writeInstalled(o,{...s,installed:l}),await this.pruneEnablement(o,[e]),this.logger.info(this.ctx,"uninstalled plugin",{pluginUri:e,name:r.name}),!0}),!r)return;let n;try{n=await this.install.resolveInstalled(r)}catch(o){this.logger.warn(this.ctx,"skip clone GC: resolving installed plugin source failed",{pluginUri:e,err:String(o)});return}if(!n){this.logger.debug(this.ctx,"skip clone GC: could not resolve installed plugin source",{pluginUri:e});return}await this.repository.cleanupPluginSource(n).catch(o=>this.logger.warn(this.ctx,"plugin clone cleanup failed",{pluginUri:e,err:String(o)}))}async installPluginFromSource(e,r){let n=V0(e);if(!n)throw new ume(e);this.assertMarketplaceAllowed(n);let o=await this.install.resolveFromSource(n);if(o.plugins.length===0)return{installed:!1,candidates:[]};let s;if(r!==void 0){if(s=o.plugins.find(l=>l.name===r),!s)return{installed:!1,candidates:o.plugins}}else if(o.plugins.length===1)s=o.plugins[0];else return{installed:!1,candidates:o.plugins};return o.isSinglePluginRepo||await this.addMarketplaceReference(n),{installed:!0,pluginUri:await this.installPlugin(s),plugin:s}}async updatePlugin(e){let r=this.guardEditorId("updatePlugin");if(r===void 0)return!1;let{installed:n}=await this.store.readInstalled(r),o=n.find(l=>l.pluginUri===e);if(!o)return this.logger.warn(this.ctx,"updatePlugin: not installed for this editor",{pluginUri:e}),!1;let s;try{s=await this.install.resolveInstalled(o)}catch(l){return this.logger.warn(this.ctx,"updatePlugin: resolving plugin source failed",{pluginUri:e,err:String(l)}),!1}if(!s)return this.logger.warn(this.ctx,"updatePlugin: could not resolve plugin source",{pluginUri:e}),!1;let c=!1;try{c=await this.repository.updatePluginSource(s)}catch(l){return this.logger.warn(this.ctx,"updatePlugin: pulling latest content failed",{pluginUri:e,err:String(l)}),!1}return c&&this.logger.info(this.ctx,"updated plugin",{pluginUri:e,name:o.name}),c}assertMarketplaceAllowed(e){let r=this.managedSettings?.get().strictKnownMarketplaces;if(!Spr(r,e))throw new Ylt(e.canonicalId,e.rawValue)}async addMarketplaceReference(e){this.assertMarketplaceAllowed(e),await this.mutate(async r=>{let n=await this.store.readMarketplaces(r);return n.marketplaces.some(s=>V0(s)?.canonicalId===e.canonicalId)?!1:(await this.store.writeMarketplaces(r,{...n,marketplaces:[...n.marketplaces,e.rawValue]}),this.logger.info(this.ctx,"registered marketplace",{reference:e.rawValue}),!0)})}async listMarketplaces(){let e=this.guardEditorId("listMarketplaces");if(e===void 0)return[];let{marketplaces:r}=await this.store.readMarketplaces(e),n=TZn(r),o=this.managedSettings?.get();return xXn(n,o?.extraKnownMarketplaces).filter(c=>Spr(o?.strictKnownMarketplaces,c))}async addMarketplace(e){let r=V0(e);if(!r)throw new ume(e,"marketplace source");await this.addMarketplaceReference(r)}async removeMarketplace(e){let r=V0(e);await this.mutate(async n=>{let o=await this.store.readMarketplaces(n),s=o.marketplaces.filter(c=>c===e?!1:r?V0(c)?.canonicalId!==r.canonicalId:!0);return s.length===o.marketplaces.length?!1:(await this.store.writeMarketplaces(n,{...o,marketplaces:s}),this.logger.info(this.ctx,"removed marketplace",{source:e}),!0)})}async browseMarketplace(e){let r;if(e!==void 0){let n=V0(e);if(!n)throw new ume(e,"marketplace source");this.assertMarketplaceAllowed(n),r=[n]}else r=await this.listMarketplaces();return this.marketplace.fetchMarketplacePlugins(r)}dispose(){if(!this._disposed){this._disposed=!0,this._watchSubscription?.dispose(),this._policySubscription?.dispose(),this._fileWatcher?.dispose();for(let e of this._sourceSubscriptions)e.dispose();for(let e of this._sourceWatchers)e.dispose();this._git?.dispose();for(let e of this.runtimeSourceRegistrations)e.subscription.dispose();this.runtimeSourceRegistrations.length=0,this._onDidChangeRuntimePlugins.dispose(),this._onDidChangePlugins.dispose()}}};p();function aG(t){try{return kt(t,ze.EnablePlugins)===!0}catch{return!1}}a(aG,"pluginsEnabled");var wut=fe(require("path"));var dee=new pe("BackgroundAgent.PluginHooks"),Tme="copilot-plugin",Rpr={SessionStart:"sessionStart",SessionEnd:"sessionEnd",UserPromptSubmit:"userPromptSubmitted",PreToolUse:"preToolUse",PostToolUse:"postToolUse",ErrorOccurred:"errorOccurred"};function $Gs(t,e){let r={};for(let o of t)for(let s of o.hooks){let c=Rpr[s.type];if(c!==void 0)for(let l of s.hooks){let u=kpr(l,e);if(!u)continue;let d=r[c]??=new Map,f=d.get(s.uri);f?f.push(u):d.set(s.uri,[u])}}let n={};for(let[o,s]of Object.entries(r))n[o]=[...s].map(([c,l])=>({source:c,hooks:l}));return n}a($Gs,"groupPluginHooksBySource");async function BXn(t,e){if(!aG(t)||!WF(t))return{};let r;try{r=(await t.get(Ca).listPlugins()).filter(vme)}catch(c){return c instanceof Ic?{}:(dee.warn(t,"failed to list plugins for hook injection",{err:String(c)}),{})}if(r.length===0)return{};let n=un(e.uri),o=$Gs(r,n),s={};return o.preToolUse&&(s.preToolUse=[WGs(t,n,o.preToolUse)]),o.postToolUse&&(s.postToolUse=[zGs(t,n,o.postToolUse)]),o.userPromptSubmitted&&(s.userPromptSubmitted=[YGs(t,n,o.userPromptSubmitted)]),o.sessionStart&&(s.sessionStart=[KGs(t,n,o.sessionStart)]),o.sessionEnd&&(s.sessionEnd=[JGs(t,n,o.sessionEnd)]),o.errorOccurred&&(s.errorOccurred=[ZGs(t,n,o.errorOccurred)]),s}a(BXn,"buildPluginHookHandlers");function FXn(t,e){let r={...t};return e.preToolUse?.length&&(r.preToolUse=[...t.preToolUse??[],...e.preToolUse]),e.postToolUse?.length&&(r.postToolUse=[...t.postToolUse??[],...e.postToolUse]),e.userPromptSubmitted?.length&&(r.userPromptSubmitted=[...t.userPromptSubmitted??[],...e.userPromptSubmitted]),e.sessionStart?.length&&(r.sessionStart=[...t.sessionStart??[],...e.sessionStart]),e.sessionEnd?.length&&(r.sessionEnd=[...t.sessionEnd??[],...e.sessionEnd]),e.errorOccurred?.length&&(r.errorOccurred=[...t.errorOccurred??[],...e.errorOccurred]),r}a(FXn,"mergePluginHooks");function kpr(t,e){let r=process.platform==="darwin"?t.osx:process.platform==="linux"?t.linux:void 0,n=t.command??r??t.linux??t.osx,o=t.windows??t.command;if(n===void 0&&o===void 0)return;let s=VGs(t.cwd,e);return{type:"command",...n!==void 0&&{bash:n},...o!==void 0&&{powershell:o},...s!==void 0&&{cwd:s},...t.env&&{env:t.env},...t.timeout!==void 0&&{timeoutSec:t.timeout}}}a(kpr,"toCommandHook");function VGs(t,e){if(t!==void 0)return wut.isAbsolute(t)?t:wut.join(e,t)}a(VGs,"resolveHookCwd");function Ime(t,e){return async r=>{if(WF(t))return e(r)}}a(Ime,"gated");function WGs(t,e,r){return{source:Tme,handler:Ime(t,async n=>{try{let o={timestamp:xme(n.timestamp),cwd:e,toolName:n.toolName,toolArgs:rNe(n.toolArgs)};for(let s of r){let c=await new N2(s.source,s.hooks).fire(t,o);for(let l of c){let u=l.output;if(u&&u.permissionDecision===Jde.deny)return{permissionDecision:"deny",permissionDecisionReason:u.permissionDecisionReason||"Tool execution denied by plugin hook"}}}return}catch(o){dee.error(t,`Failed to execute plugin PreToolUse hook for tool ${n.toolName}`,o);return}})}}a(WGs,"pluginPreToolUseHandler");function zGs(t,e,r){return{source:Tme,handler:Ime(t,async n=>{try{let o={timestamp:xme(n.timestamp),cwd:e,toolName:n.toolName,toolArgs:rNe(n.toolArgs),toolResult:{resultType:$fr(n.toolResult.resultType),textResultForLlm:n.toolResult.textResultForLlm}};for(let s of r)await new D2(s.source,s.hooks).fire(t,o)}catch(o){dee.error(t,`Failed to execute plugin PostToolUse hook for tool ${n.toolName}`,o)}})}}a(zGs,"pluginPostToolUseHandler");function YGs(t,e,r){return{source:Tme,handler:Ime(t,async n=>{try{let o={timestamp:xme(n.timestamp),cwd:e,prompt:n.prompt};for(let s of r)await new M2(s.source,s.hooks).fire(t,o)}catch(o){dee.error(t,"Failed to execute plugin UserPromptSubmitted hook",o)}})}}a(YGs,"pluginUserPromptSubmittedHandler");function KGs(t,e,r){return{source:Tme,handler:Ime(t,async n=>{try{let o={timestamp:xme(n.timestamp),cwd:e,source:n.source,...n.initialPrompt!==void 0&&{initialPrompt:n.initialPrompt}};for(let s of r)await new VF(s.source,s.hooks).fire(t,o)}catch(o){dee.error(t,"Failed to execute plugin SessionStart hook",o)}})}}a(KGs,"pluginSessionStartHandler");function JGs(t,e,r){return{source:Tme,handler:Ime(t,async n=>{try{let o={timestamp:xme(n.timestamp),cwd:e,reason:n.reason};for(let s of r)await new $F(s.source,s.hooks).fire(t,o)}catch(o){dee.error(t,"Failed to execute plugin SessionEnd hook",o)}})}}a(JGs,"pluginSessionEndHandler");function ZGs(t,e,r){return{source:Tme,handler:Ime(t,async n=>{try{let o={timestamp:xme(n.timestamp),cwd:e,error:{message:n.error,name:"Error"}};for(let s of r)await new GF(s.source,s.hooks).fire(t,o)}catch(o){dee.error(t,"Failed to execute plugin ErrorOccurred hook",o)}})}}a(ZGs,"pluginErrorOccurredHandler");function xme(t){return t instanceof Date?t.getTime():t}a(xme,"toHookTimestamp");p();var UXn=fe(require("node:path"));function QXn(t){let e="";for(let r of t){let n=r.codePointAt(0)??0;n>=32&&n!==127&&(e+=r)}return e.trim()}a(QXn,"sanitizeForPrompt");function XGs(t){let e=t.startsWith("file:")?un(t):t;return QXn(UXn.basename(e))}a(XGs,"confinedBasename");function e$s(t){let e=t.startsWith("file:")?un(t):t;return QXn(e)}a(e$s,"confinedAbsolutePath");function qXn(t){let e=XGs(t),r=e$s(t);return[`You are operating in inline mode for quick, focused code changes. Regardless of any other instructions, you are confined to a single file \u2014 \`${e}\` (absolute path: \`${r}\`) \u2014 and MUST NOT read, create, or modify any other file.`,"Focus on the user's selected code and its immediate context. Make changes grounded directly in the user's prompt: do NOT make changes that are not directly and logically related to it, and do NOT modify code outside the selection unless absolutely necessary for correctness. Keep changes minimal and focused on exactly what was asked.","Be concise: NO wordy explanations, NO progress messages about what you are doing or about to do. Do not ask the user for clarification \u2014 make your best effort.","Note that you may be in inline-ask mode and do not have any edit tools available \u2014 show the code snippet that needs to be changed in a code block. Do not claim to have made edits.",`For edit turns, make all changes in a single invocation of the edit tool \u2014 there is no tool calling loop. Use whichever edit tool you have available (\`edit\`, \`str_replace_editor\`, or \`apply_patch\`) to apply changes to \`${e}\`; follow its schema carefully, include all required properties, and match the existing code exactly. Always use the ABSOLUTE PATH \`${r}\` when supplying a file path or patch header \u2014 never a relative path or bare basename, because the working directory may differ from the project root and a relative path will be denied. If you use \`apply_patch\`, every \`*** Add File\`, \`*** Delete File\`, \`*** Update File\`, and \`*** Move to\` header must spell out the full \`${r}\` \u2014 any patch touching another path will be denied. Never output code to the user instead of editing. Don't repeat yourself after a tool call \u2014 pick up where you left off.`,`You have at most 2 tool-calling turns total. If you need to read the file or check diagnostics, do so in the first turn (e.g. call \`view\` or \`get_errors\` on \`${r}\`). Use the second turn to apply your edit. Do NOT spend additional turns validating or re-reading after editing \u2014 make your best effort in one shot. If you already have the file content and diagnostics in the conversation, skip the first turn and edit immediately. Any tool call beyond the 2-turn limit will be rejected with an error.`,"When the file content is provided in the conversation (in full or as a portion around the cursor), use it directly for your edit \u2014 do NOT re-read it with `view`. If only a portion is shown, line numbers indicate exact positions in the file; use them for your edits. If the user's request targets code outside the shown portion, use `view` to read that part first."].join(` -`)}a(UXn,"buildInlineSystemPrompt");p();function XGs(t){return kt(t,ze.EnableSandbox)===!0}a(XGs,"isSandboxEnabled");function Rut(t){if(!XGs(t))return;let e={enabled:!0},r=kt(t,ze.SandboxAddCurrentWorkingDirectory);typeof r=="boolean"&&(e.addCurrentWorkingDirectory=r);let n=kt(t,ze.SandboxUserPolicy);return typeof n=="object"&&n!==null&&!Array.isArray(n)&&(e.userPolicy=n),e}a(Rut,"getSandboxConfig");p();Fo();var e$s={includeCopilotInstructions:!1,includeGitCommitInstructions:!0,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!1,customIntroduction:"When generating the commit message, please use the following custom instructions provided by the user."};async function kpr(t,e){return t.get(Mf).getInstructions(t,e,e$s)}a(kpr,"getGitCommitInstructions");var dee=class{constructor(){this.lastChanges=[];this.attemptCount=0;this.DEFAULT_TEMPERATURE=.1}static{a(this,"GitCommitGenerateService")}buildSystemMessage(e,r){let n=["You are an AI programming assistant, helping a software developer to come up with the best git commit message for their code changes.","You excel in interpreting the purpose behind code changes to craft succinct, clear commit messages that adhere to the repository's guidelines.","","# First, think step-by-step:","1. Analyze the CODE CHANGES thoroughly to understand what's been modified.","2. Identify the purpose of the changes to answer the *why* for the commit messages, also considering the optionally provided RECENT USER COMMITS.","3. Review the provided RECENT REPOSITORY COMMITS to identify established commit message conventions. Focus on the format and style, ignoring commit-specific details like refs, tags, and authors.","4. Generate a thoughtful and succinct commit message for the given CODE CHANGES. It MUST follow the established writing conventions.","5. Remove any meta information like issue references, tags, or author names from the commit message. The developer will add them.","6. Now only show your message, wrapped with a single markdown ```text codeblock! Do not provide any explanations or details"];return r&&n.push(` +`)}a(qXn,"buildInlineSystemPrompt");p();function t$s(t){return kt(t,ze.EnableSandbox)===!0}a(t$s,"isSandboxEnabled");function Rut(t){if(!t$s(t))return;let e={enabled:!0},r=kt(t,ze.SandboxAddCurrentWorkingDirectory);typeof r=="boolean"&&(e.addCurrentWorkingDirectory=r);let n=kt(t,ze.SandboxUserPolicy);return typeof n=="object"&&n!==null&&!Array.isArray(n)&&(e.userPolicy=n),e}a(Rut,"getSandboxConfig");p();Fo();var r$s={includeCopilotInstructions:!1,includeGitCommitInstructions:!0,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!1,customIntroduction:"When generating the commit message, please use the following custom instructions provided by the user."};async function Ppr(t,e){return t.get(Mf).getInstructions(t,e,r$s)}a(Ppr,"getGitCommitInstructions");var fee=class{constructor(){this.lastChanges=[];this.attemptCount=0;this.DEFAULT_TEMPERATURE=.1}static{a(this,"GitCommitGenerateService")}buildSystemMessage(e,r){let n=["You are an AI programming assistant, helping a software developer to come up with the best git commit message for their code changes.","You excel in interpreting the purpose behind code changes to craft succinct, clear commit messages that adhere to the repository's guidelines.","","# First, think step-by-step:","1. Analyze the CODE CHANGES thoroughly to understand what's been modified.","2. Identify the purpose of the changes to answer the *why* for the commit messages, also considering the optionally provided RECENT USER COMMITS.","3. Review the provided RECENT REPOSITORY COMMITS to identify established commit message conventions. Focus on the format and style, ignoring commit-specific details like refs, tags, and authors.","4. Generate a thoughtful and succinct commit message for the given CODE CHANGES. It MUST follow the established writing conventions.","5. Remove any meta information like issue references, tags, or author names from the commit message. The developer will add them.","6. Now only show your message, wrapped with a single markdown ```text codeblock! Do not provide any explanations or details"];return r&&n.push(` Current git branch name: ${r}`),e&&n.push(` Respond in the following locale: ${e}`),n.join(` `)}buildUserMessage(e,r){let n=[];return e.userCommits.length>0&&n.push("# RECENT USER COMMITS (For reference only, do not copy!):",e.userCommits.map(o=>`- ${o}`).join(` `),""),e.recentCommits.length>0&&n.push("# RECENT REPOSITORY COMMITS (For reference only, do not copy!):",e.recentCommits.map(o=>`- ${o}`).join(` `),""),n.push("# CODE CHANGES:",e.changes.join(` `),"","","Now generate a commit message that describes the CODE CHANGES.","DO NOT COPY commits from RECENT COMMITS, but use them as reference for the commit style.","ONLY return a single markdown code block, NO OTHER PROSE!","```text","commit message goes here","```",""),r&&n.push("",r,""),n.join(` -`)}updateAttemptCount(e){if(e.length!==this.lastChanges.length){this.attemptCount=0;return}for(let r=0;rt.webcrypto);async function r$s(t){return(await Ppr).getRandomValues(new Uint8Array(t))}a(r$s,"getRandomValues");async function n$s(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await r$s(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await i$s(t),r=await o$s(e);return{code_verifier:e,code_challenge:r}}a(Dpr,"pkceChallenge");p();var _R="2025-11-25";var Dut=[_R,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],aG="io.modelcontextprotocol/related-task",Nut="2.0",Rg=Zit(t=>t!==null&&(typeof t=="object"||typeof t=="function")),QXn=Ul([Xe(),ya().int()]),qXn=Xe(),MRf=gh({ttl:ya().optional(),pollInterval:ya().optional()}),a$s=Yr({ttl:ya().optional()}),c$s=Yr({taskId:Xe()}),Mpr=gh({progressToken:QXn.optional(),[aG]:c$s.optional()}),sI=Yr({_meta:Mpr.optional()}),SNe=sI.extend({task:a$s.optional()}),jXn=a(t=>SNe.safeParse(t).success,"isTaskAugmentedRequestParams"),ly=Yr({method:Xe(),params:sI.loose().optional()}),ER=Yr({_meta:Mpr.optional()}),vR=Yr({method:Xe(),params:ER.loose().optional()}),uy=gh({_meta:Mpr.optional()}),Mut=Ul([Xe(),ya().int()]),HXn=Yr({jsonrpc:zn(Nut),id:Mut,...ly.shape}).strict(),TNe=a(t=>HXn.safeParse(t).success,"isJSONRPCRequest"),GXn=Yr({jsonrpc:zn(Nut),...vR.shape}).strict(),$Xn=a(t=>GXn.safeParse(t).success,"isJSONRPCNotification"),Opr=Yr({jsonrpc:zn(Nut),id:Mut,result:uy}).strict(),fee=a(t=>Opr.safeParse(t).success,"isJSONRPCResultResponse");var ri;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ri||(ri={}));var Lpr=Yr({jsonrpc:zn(Nut),id:Mut.optional(),error:Yr({code:ya().int(),message:Xe(),data:Fl().optional()})}).strict();var VXn=a(t=>Lpr.safeParse(t).success,"isJSONRPCErrorResponse");var cG=Ul([HXn,GXn,Opr,Lpr]),ORf=Ul([Opr,Lpr]),pee=uy.strict(),l$s=ER.extend({requestId:Mut.optional(),reason:Xe().optional()}),Out=vR.extend({method:zn("notifications/cancelled"),params:l$s}),u$s=Yr({src:Xe(),mimeType:Xe().optional(),sizes:Qr(Xe()).optional(),theme:XA(["light","dark"]).optional()}),INe=Yr({icons:Qr(u$s).optional()}),wme=Yr({name:Xe(),title:Xe().optional()}),WXn=wme.extend({...wme.shape,...INe.shape,version:Xe(),websiteUrl:Xe().optional(),description:Xe().optional()}),d$s=rpe(Yr({applyDefaults:Zc().optional()}),ml(Xe(),Fl())),f$s=gPe(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,rpe(Yr({form:d$s.optional(),url:Rg.optional()}),ml(Xe(),Fl()).optional())),p$s=gh({list:Rg.optional(),cancel:Rg.optional(),requests:gh({sampling:gh({createMessage:Rg.optional()}).optional(),elicitation:gh({create:Rg.optional()}).optional()}).optional()}),h$s=gh({list:Rg.optional(),cancel:Rg.optional(),requests:gh({tools:gh({call:Rg.optional()}).optional()}).optional()}),m$s=Yr({experimental:ml(Xe(),Rg).optional(),sampling:Yr({context:Rg.optional(),tools:Rg.optional()}).optional(),elicitation:f$s.optional(),roots:Yr({listChanged:Zc().optional()}).optional(),tasks:p$s.optional(),extensions:ml(Xe(),Rg).optional()}),g$s=sI.extend({protocolVersion:Xe(),capabilities:m$s,clientInfo:WXn}),A$s=ly.extend({method:zn("initialize"),params:g$s});var y$s=Yr({experimental:ml(Xe(),Rg).optional(),logging:Rg.optional(),completions:Rg.optional(),prompts:Yr({listChanged:Zc().optional()}).optional(),resources:Yr({subscribe:Zc().optional(),listChanged:Zc().optional()}).optional(),tools:Yr({listChanged:Zc().optional()}).optional(),tasks:h$s.optional(),extensions:ml(Xe(),Rg).optional()}),Bpr=uy.extend({protocolVersion:Xe(),capabilities:y$s,serverInfo:WXn,instructions:Xe().optional()}),zXn=vR.extend({method:zn("notifications/initialized"),params:ER.optional()}),YXn=a(t=>zXn.safeParse(t).success,"isInitializedNotification"),Lut=ly.extend({method:zn("ping"),params:sI.optional()}),_$s=Yr({progress:ya(),total:ou(ya()),message:ou(Xe())}),E$s=Yr({...ER.shape,..._$s.shape,progressToken:QXn}),But=vR.extend({method:zn("notifications/progress"),params:E$s}),v$s=sI.extend({cursor:qXn.optional()}),xNe=ly.extend({params:v$s.optional()}),wNe=uy.extend({nextCursor:qXn.optional()}),C$s=XA(["working","input_required","completed","failed","cancelled"]),RNe=Yr({taskId:Xe(),status:C$s,ttl:Ul([ya(),cPe()]),createdAt:Xe(),lastUpdatedAt:Xe(),pollInterval:ou(ya()),statusMessage:ou(Xe())}),hee=uy.extend({task:RNe}),b$s=ER.merge(RNe),kNe=vR.extend({method:zn("notifications/tasks/status"),params:b$s}),Fut=ly.extend({method:zn("tasks/get"),params:sI.extend({taskId:Xe()})}),Uut=uy.merge(RNe),Qut=ly.extend({method:zn("tasks/result"),params:sI.extend({taskId:Xe()})}),LRf=uy.loose(),qut=xNe.extend({method:zn("tasks/list")}),jut=wNe.extend({tasks:Qr(RNe)}),Hut=ly.extend({method:zn("tasks/cancel"),params:sI.extend({taskId:Xe()})}),KXn=uy.merge(RNe),JXn=Yr({uri:Xe(),mimeType:ou(Xe()),_meta:ml(Xe(),Fl()).optional()}),ZXn=JXn.extend({text:Xe()}),Fpr=Xe().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),XXn=JXn.extend({blob:Fpr}),PNe=XA(["user","assistant"]),Rme=Yr({audience:Qr(PNe).optional(),priority:ya().min(0).max(1).optional(),lastModified:zj.datetime({offset:!0}).optional()}),eei=Yr({...wme.shape,...INe.shape,uri:Xe(),description:ou(Xe()),mimeType:ou(Xe()),size:ou(ya()),annotations:Rme.optional(),_meta:ou(gh({}))}),S$s=Yr({...wme.shape,...INe.shape,uriTemplate:Xe(),description:ou(Xe()),mimeType:ou(Xe()),annotations:Rme.optional(),_meta:ou(gh({}))}),T$s=xNe.extend({method:zn("resources/list")}),Upr=wNe.extend({resources:Qr(eei)}),I$s=xNe.extend({method:zn("resources/templates/list")}),Qpr=wNe.extend({resourceTemplates:Qr(S$s)}),qpr=sI.extend({uri:Xe()}),x$s=qpr,w$s=ly.extend({method:zn("resources/read"),params:x$s}),jpr=uy.extend({contents:Qr(Ul([ZXn,XXn]))}),Q8=vR.extend({method:zn("notifications/resources/list_changed"),params:ER.optional()}),R$s=qpr,k$s=ly.extend({method:zn("resources/subscribe"),params:R$s}),P$s=qpr,D$s=ly.extend({method:zn("resources/unsubscribe"),params:P$s}),N$s=ER.extend({uri:Xe()}),Hpr=vR.extend({method:zn("notifications/resources/updated"),params:N$s}),M$s=Yr({name:Xe(),description:ou(Xe()),required:ou(Zc())}),O$s=Yr({...wme.shape,...INe.shape,description:ou(Xe()),arguments:ou(Qr(M$s)),_meta:ou(gh({}))}),L$s=xNe.extend({method:zn("prompts/list")}),Gpr=wNe.extend({prompts:Qr(O$s)}),B$s=sI.extend({name:Xe(),arguments:ml(Xe(),Xe()).optional()}),F$s=ly.extend({method:zn("prompts/get"),params:B$s}),$pr=Yr({type:zn("text"),text:Xe(),annotations:Rme.optional(),_meta:ml(Xe(),Fl()).optional()}),Vpr=Yr({type:zn("image"),data:Fpr,mimeType:Xe(),annotations:Rme.optional(),_meta:ml(Xe(),Fl()).optional()}),Wpr=Yr({type:zn("audio"),data:Fpr,mimeType:Xe(),annotations:Rme.optional(),_meta:ml(Xe(),Fl()).optional()}),U$s=Yr({type:zn("tool_use"),name:Xe(),id:Xe(),input:ml(Xe(),Fl()),_meta:ml(Xe(),Fl()).optional()}),Q$s=Yr({type:zn("resource"),resource:Ul([ZXn,XXn]),annotations:Rme.optional(),_meta:ml(Xe(),Fl()).optional()}),q$s=eei.extend({type:zn("resource_link")}),zpr=Ul([$pr,Vpr,Wpr,q$s,Q$s]),j$s=Yr({role:PNe,content:zpr}),Ypr=uy.extend({description:Xe().optional(),messages:Qr(j$s)}),q8=vR.extend({method:zn("notifications/prompts/list_changed"),params:ER.optional()}),H$s=Yr({title:Xe().optional(),readOnlyHint:Zc().optional(),destructiveHint:Zc().optional(),idempotentHint:Zc().optional(),openWorldHint:Zc().optional()}),G$s=Yr({taskSupport:XA(["required","optional","forbidden"]).optional()}),tei=Yr({...wme.shape,...INe.shape,description:Xe().optional(),inputSchema:Yr({type:zn("object"),properties:ml(Xe(),Rg).optional(),required:Qr(Xe()).optional()}).catchall(Fl()),outputSchema:Yr({type:zn("object"),properties:ml(Xe(),Rg).optional(),required:Qr(Xe()).optional()}).catchall(Fl()).optional(),annotations:H$s.optional(),execution:G$s.optional(),_meta:ml(Xe(),Fl()).optional()}),$$s=xNe.extend({method:zn("tools/list")}),Kpr=wNe.extend({tools:Qr(tei)}),CR=uy.extend({content:Qr(zpr).default([]),structuredContent:ml(Xe(),Fl()).optional(),isError:Zc().optional()}),BRf=CR.or(uy.extend({toolResult:Fl()})),V$s=SNe.extend({name:Xe(),arguments:ml(Xe(),Fl()).optional()}),W$s=ly.extend({method:zn("tools/call"),params:V$s}),j8=vR.extend({method:zn("notifications/tools/list_changed"),params:ER.optional()}),rei=Yr({autoRefresh:Zc().default(!0),debounceMs:ya().int().nonnegative().default(300)}),nei=XA(["debug","info","notice","warning","error","critical","alert","emergency"]),z$s=sI.extend({level:nei}),Y$s=ly.extend({method:zn("logging/setLevel"),params:z$s}),K$s=ER.extend({level:nei,logger:Xe().optional(),data:Fl()}),mee=vR.extend({method:zn("notifications/message"),params:K$s}),J$s=Yr({name:Xe().optional()}),Z$s=Yr({hints:Qr(J$s).optional(),costPriority:ya().min(0).max(1).optional(),speedPriority:ya().min(0).max(1).optional(),intelligencePriority:ya().min(0).max(1).optional()}),X$s=Yr({mode:XA(["auto","required","none"]).optional()}),eVs=Yr({type:zn("tool_result"),toolUseId:Xe().describe("The unique identifier for the corresponding tool call."),content:Qr(zpr).default([]),structuredContent:Yr({}).loose().optional(),isError:Zc().optional(),_meta:ml(Xe(),Fl()).optional()}),tVs=fPe("type",[$pr,Vpr,Wpr]),Put=fPe("type",[$pr,Vpr,Wpr,U$s,eVs]),rVs=Yr({role:PNe,content:Ul([Put,Qr(Put)]),_meta:ml(Xe(),Fl()).optional()}),nVs=SNe.extend({messages:Qr(rVs),modelPreferences:Z$s.optional(),systemPrompt:Xe().optional(),includeContext:XA(["none","thisServer","allServers"]).optional(),temperature:ya().optional(),maxTokens:ya().int(),stopSequences:Qr(Xe()).optional(),metadata:Rg.optional(),tools:Qr(tei).optional(),toolChoice:X$s.optional()}),DNe=ly.extend({method:zn("sampling/createMessage"),params:nVs}),Jpr=uy.extend({model:Xe(),stopReason:ou(XA(["endTurn","stopSequence","maxTokens"]).or(Xe())),role:PNe,content:tVs}),Zpr=uy.extend({model:Xe(),stopReason:ou(XA(["endTurn","stopSequence","maxTokens","toolUse"]).or(Xe())),role:PNe,content:Ul([Put,Qr(Put)])}),iVs=Yr({type:zn("boolean"),title:Xe().optional(),description:Xe().optional(),default:Zc().optional()}),oVs=Yr({type:zn("string"),title:Xe().optional(),description:Xe().optional(),minLength:ya().optional(),maxLength:ya().optional(),format:XA(["email","uri","date","date-time"]).optional(),default:Xe().optional()}),sVs=Yr({type:XA(["number","integer"]),title:Xe().optional(),description:Xe().optional(),minimum:ya().optional(),maximum:ya().optional(),default:ya().optional()}),aVs=Yr({type:zn("string"),title:Xe().optional(),description:Xe().optional(),enum:Qr(Xe()),default:Xe().optional()}),cVs=Yr({type:zn("string"),title:Xe().optional(),description:Xe().optional(),oneOf:Qr(Yr({const:Xe(),title:Xe()})),default:Xe().optional()}),lVs=Yr({type:zn("string"),title:Xe().optional(),description:Xe().optional(),enum:Qr(Xe()),enumNames:Qr(Xe()).optional(),default:Xe().optional()}),uVs=Ul([aVs,cVs]),dVs=Yr({type:zn("array"),title:Xe().optional(),description:Xe().optional(),minItems:ya().optional(),maxItems:ya().optional(),items:Yr({type:zn("string"),enum:Qr(Xe())}),default:Qr(Xe()).optional()}),fVs=Yr({type:zn("array"),title:Xe().optional(),description:Xe().optional(),minItems:ya().optional(),maxItems:ya().optional(),items:Yr({anyOf:Qr(Yr({const:Xe(),title:Xe()}))}),default:Qr(Xe()).optional()}),pVs=Ul([dVs,fVs]),hVs=Ul([lVs,uVs,pVs]),mVs=Ul([hVs,iVs,oVs,sVs]),gVs=SNe.extend({mode:zn("form").optional(),message:Xe(),requestedSchema:Yr({type:zn("object"),properties:ml(Xe(),mVs),required:Qr(Xe()).optional()})}),AVs=SNe.extend({mode:zn("url"),message:Xe(),elicitationId:Xe(),url:Xe().url()}),yVs=Ul([gVs,AVs]),NNe=ly.extend({method:zn("elicitation/create"),params:yVs}),_Vs=ER.extend({elicitationId:Xe()}),EVs=vR.extend({method:zn("notifications/elicitation/complete"),params:_Vs}),Xpr=uy.extend({action:XA(["accept","decline","cancel"]),content:gPe(t=>t===null?void 0:t,ml(Xe(),Ul([Xe(),ya(),Zc(),Qr(Xe())])).optional())}),vVs=Yr({type:zn("ref/resource"),uri:Xe()});var CVs=Yr({type:zn("ref/prompt"),name:Xe()}),bVs=sI.extend({ref:Ul([CVs,vVs]),argument:Yr({name:Xe(),value:Xe()}),context:Yr({arguments:ml(Xe(),Xe()).optional()}).optional()}),SVs=ly.extend({method:zn("completion/complete"),params:bVs});var ehr=uy.extend({completion:gh({values:Qr(Xe()).max(100),total:ou(ya().int()),hasMore:ou(Zc())})}),TVs=Yr({uri:Xe().startsWith("file://"),name:Xe().optional(),_meta:ml(Xe(),Fl()).optional()}),thr=ly.extend({method:zn("roots/list"),params:sI.optional()}),IVs=uy.extend({roots:Qr(TVs)}),xVs=vR.extend({method:zn("notifications/roots/list_changed"),params:ER.optional()}),FRf=Ul([Lut,A$s,SVs,Y$s,F$s,L$s,T$s,I$s,w$s,k$s,D$s,W$s,$$s,Fut,Qut,qut,Hut]),URf=Ul([Out,But,zXn,xVs,kNe]),QRf=Ul([pee,Jpr,Zpr,Xpr,IVs,Uut,jut,hee]),qRf=Ul([Lut,DNe,NNe,thr,Fut,Qut,qut,Hut]),jRf=Ul([Out,But,mee,Hpr,Q8,j8,q8,kNe,EVs]),HRf=Ul([pee,Bpr,ehr,Ypr,Gpr,Upr,Qpr,jpr,CR,Kpr,Uut,jut,hee]),Hn=class t extends Error{static{a(this,"McpError")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===ri.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Npr(o.elicitations,r)}return new t(e,r,n)}},Npr=class extends Hn{static{a(this,"UrlElicitationRequiredError")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(ri.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};p();var dy=kit().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:urr.custom,message:"URL must be parseable",fatal:!0}),Pke}).refine(t=>{let e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),oei=gh({resource:Xe().url(),authorization_servers:Qr(dy).optional(),jwks_uri:Xe().url().optional(),scopes_supported:Qr(Xe()).optional(),bearer_methods_supported:Qr(Xe()).optional(),resource_signing_alg_values_supported:Qr(Xe()).optional(),resource_name:Xe().optional(),resource_documentation:Xe().optional(),resource_policy_uri:Xe().url().optional(),resource_tos_uri:Xe().url().optional(),tls_client_certificate_bound_access_tokens:Zc().optional(),authorization_details_types_supported:Qr(Xe()).optional(),dpop_signing_alg_values_supported:Qr(Xe()).optional(),dpop_bound_access_tokens_required:Zc().optional()}),rhr=gh({issuer:Xe(),authorization_endpoint:dy,token_endpoint:dy,registration_endpoint:dy.optional(),scopes_supported:Qr(Xe()).optional(),response_types_supported:Qr(Xe()),response_modes_supported:Qr(Xe()).optional(),grant_types_supported:Qr(Xe()).optional(),token_endpoint_auth_methods_supported:Qr(Xe()).optional(),token_endpoint_auth_signing_alg_values_supported:Qr(Xe()).optional(),service_documentation:dy.optional(),revocation_endpoint:dy.optional(),revocation_endpoint_auth_methods_supported:Qr(Xe()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Qr(Xe()).optional(),introspection_endpoint:Xe().optional(),introspection_endpoint_auth_methods_supported:Qr(Xe()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Qr(Xe()).optional(),code_challenge_methods_supported:Qr(Xe()).optional(),client_id_metadata_document_supported:Zc().optional()}),wVs=gh({issuer:Xe(),authorization_endpoint:dy,token_endpoint:dy,userinfo_endpoint:dy.optional(),jwks_uri:dy,registration_endpoint:dy.optional(),scopes_supported:Qr(Xe()).optional(),response_types_supported:Qr(Xe()),response_modes_supported:Qr(Xe()).optional(),grant_types_supported:Qr(Xe()).optional(),acr_values_supported:Qr(Xe()).optional(),subject_types_supported:Qr(Xe()),id_token_signing_alg_values_supported:Qr(Xe()),id_token_encryption_alg_values_supported:Qr(Xe()).optional(),id_token_encryption_enc_values_supported:Qr(Xe()).optional(),userinfo_signing_alg_values_supported:Qr(Xe()).optional(),userinfo_encryption_alg_values_supported:Qr(Xe()).optional(),userinfo_encryption_enc_values_supported:Qr(Xe()).optional(),request_object_signing_alg_values_supported:Qr(Xe()).optional(),request_object_encryption_alg_values_supported:Qr(Xe()).optional(),request_object_encryption_enc_values_supported:Qr(Xe()).optional(),token_endpoint_auth_methods_supported:Qr(Xe()).optional(),token_endpoint_auth_signing_alg_values_supported:Qr(Xe()).optional(),display_values_supported:Qr(Xe()).optional(),claim_types_supported:Qr(Xe()).optional(),claims_supported:Qr(Xe()).optional(),service_documentation:Xe().optional(),claims_locales_supported:Qr(Xe()).optional(),ui_locales_supported:Qr(Xe()).optional(),claims_parameter_supported:Zc().optional(),request_parameter_supported:Zc().optional(),request_uri_parameter_supported:Zc().optional(),require_request_uri_registration:Zc().optional(),op_policy_uri:dy.optional(),op_tos_uri:dy.optional(),client_id_metadata_document_supported:Zc().optional()}),sei=Yr({...wVs.shape,...rhr.pick({code_challenge_methods_supported:!0}).shape}),aei=Yr({access_token:Xe(),id_token:Xe().optional(),token_type:Xe(),expires_in:APe.number().optional(),scope:Xe().optional(),refresh_token:Xe().optional()}).strip(),cei=Yr({error:Xe(),error_description:Xe().optional(),error_uri:Xe().optional()}),iei=dy.optional().or(zn("").transform(()=>{})),RVs=Yr({redirect_uris:Qr(dy),token_endpoint_auth_method:Xe().optional(),grant_types:Qr(Xe()).optional(),response_types:Qr(Xe()).optional(),client_name:Xe().optional(),client_uri:dy.optional(),logo_uri:iei,scope:Xe().optional(),contacts:Qr(Xe()).optional(),tos_uri:iei,policy_uri:Xe().optional(),jwks_uri:dy.optional(),jwks:Wit().optional(),software_id:Xe().optional(),software_version:Xe().optional(),software_statement:Xe().optional()}).strip(),kVs=Yr({client_id:Xe(),client_secret:Xe().optional(),client_id_issued_at:ya().optional(),client_secret_expires_at:ya().optional()}).strip(),lei=RVs.merge(kVs),WRf=Yr({error:Xe(),error_description:Xe().optional()}).strip(),zRf=Yr({token:Xe(),token_type_hint:Xe().optional()}).strip();p();function uei(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(uei,"resourceUrlFromServerUrl");function dei({requestedResource:t,configuredResource:e}){let r=typeof t=="string"?new URL(t):new URL(t.href),n=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==n.origin||r.pathname.length=400&&t.status<500&&e!=="/"}a(QVs,"shouldAttemptFallback");async function qVs(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??_R,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let u=UVs(e,o.pathname);c=new URL(u,n?.metadataServerUrl??o),c.search=o.search}let l=await pei(c,s,r);if(!n?.metadataUrl&&QVs(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await pei(u,s,r)}return l}a(qVs,"discoverMetadataWithFallback");function jVs(t){let e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),n;let o=e.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,e.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,e.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,e.origin),type:"oidc"}),n}a(jVs,"buildDiscoveryUrls");async function gei(t,{fetchFn:e=fetch,protocolVersion:r=_R}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=jVs(t);for(let{url:s,type:c}of o){let l=await ahr(s,n,e);if(l){if(!l.ok){if(await l.body?.cancel(),l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${c==="oauth"?"OAuth":"OpenID provider"} metadata from ${s}`)}return c==="oauth"?rhr.parse(await l.json()):sei.parse(await l.json())}}}a(gei,"discoverAuthorizationServerMetadata");async function HVs(t,e){let r,n;try{r=await mei(t,{resourceMetadataUrl:e?.resourceMetadataUrl},e?.fetchFn),r.authorization_servers&&r.authorization_servers.length>0&&(n=r.authorization_servers[0])}catch{}n||(n=String(new URL("/",t)));let o=await gei(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a(HVs,"discoverOAuthServerInfo");async function GVs(t,{metadata:e,clientInformation:r,redirectUrl:n,scope:o,state:s,resource:c}){let l;if(e){if(l=new URL(e.authorization_endpoint),!e.response_types_supported.includes(nhr))throw new Error(`Incompatible auth server: does not support response type ${nhr}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(ihr))throw new Error(`Incompatible auth server: does not support code challenge method ${ihr}`)}else l=new URL("/authorize",t);let u=await Dpr(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",nhr),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",ihr),l.searchParams.set("redirect_uri",String(n)),s&&l.searchParams.set("state",s),o&&l.searchParams.set("scope",o),o?.includes("offline_access")&&l.searchParams.append("prompt","consent"),c&&l.searchParams.set("resource",c.href),{authorizationUrl:l,codeVerifier:d}}a(GVs,"startAuthorization");function $Vs(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a($Vs,"prepareAuthorizationCodeRequest");async function Aei(t,{metadata:e,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c}){let l=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",t),u=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(s&&r.set("resource",s.href),o)await o(u,r,l,e);else if(n){let f=e?.token_endpoint_auth_methods_supported??[],h=DVs(n,f);NVs(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await hei(d);return aei.parse(await d.json())}a(Aei,"executeTokenRequest");async function VVs(t,{metadata:e,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:s,fetchFn:c}){let l=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),u=await Aei(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(VVs,"refreshAuthorization");async function WVs(t,e,{metadata:r,resource:n,authorizationCode:o,fetchFn:s}={}){let c=t.clientMetadata.scope,l;if(t.prepareTokenRequest&&(l=await t.prepareTokenRequest(c)),!l){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!t.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let d=await t.codeVerifier();l=$Vs(o,d,t.redirectUrl)}let u=await t.clientInformation();return Aei(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(WVs,"fetchToken");async function zVs(t,{metadata:e,clientMetadata:r,scope:n,fetchFn:o}){let s;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");s=new URL(e.registration_endpoint)}else s=new URL("/register",t);let c=await(o??fetch)(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r,...n!==void 0?{scope:n}:{}})});if(!c.ok)throw await hei(c);return lei.parse(await c.json())}a(zVs,"registerClient");p();p();p();p();function Pme(t){return!!t._zod}a(Pme,"isZ4Schema");function aD(t,e){return Pme(t)?Pfe(t,e):t.safeParse(e)}a(aD,"safeParse");function Gut(t){if(!t)return;let e;if(Pme(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(Gut,"getObjectShape");function yei(t){if(Pme(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}a(yei,"getLiteralValue");p();function lG(t){return t==="completed"||t==="failed"||t==="cancelled"}a(lG,"isTerminal");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();var PPf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function chr(t){let r=Gut(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=yei(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(chr,"getMethodLiteral");function lhr(t,e){let r=aD(t,e);if(!r.success)throw r.error;return r.data}a(lhr,"parseWithCompat");var eWs=6e4,$ut=class{static{a(this,"Protocol")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Out,r=>{this._oncancel(r)}),this.setNotificationHandler(But,r=>{this._onprogress(r)}),this.setRequestHandler(Lut,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Fut,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Hn(ri.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Qut,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new Hn(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new Hn(ri.InvalidParams,`Task not found: ${s}`);if(!lG(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(lG(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[aG]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(qut,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new Hn(ri.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Hut,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Hn(ri.InvalidParams,`Task not found: ${r.params.taskId}`);if(lG(o.status))throw new Hn(ri.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new Hn(ri.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Hn?o:new Hn(ri.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),Hn.fromError(ri.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,c)=>{o?.(s,c),fee(s)||VXn(s)?this._onresponse(s):TNe(s)?this._onrequest(s,c):$Xn(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=Hn.fromError(ri.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[aG]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:ri.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let l=jXn(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,d={signal:c.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:a(async f=>{if(c.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},"sendNotification"),sendRequest:a(async(f,h,m)=>{if(c.signal.aborted)throw new Hn(ri.ConnectionClosed,"Request was cancelled");let g={...m,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let A=g.relatedTask?.taskId??s;return A&&u&&await u.updateTaskStatus(A,"input_required"),await this.request(f,h,g)},"sendRequest"),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:l?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,d)).then(async f=>{if(c.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(c.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:ri.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===c&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let c=this._responseHandlers.get(o),l=this._timeoutInfo.get(o);if(l&&c&&l.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),c(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),fee(e))n(e);else{let c=new Hn(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(fee(e)&&e.result&&typeof e.result=="object"){let c=e.result;if(c.task&&typeof c.task=="object"){let l=c.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,r))}}if(s||this._progressHandlers.delete(r),fee(e))o(e);else{let c=Hn.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof Hn?c:new Hn(ri.InternalError,String(c))}}return}let s;try{let c=await this.request(e,hee,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Hn(ri.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},lG(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Hn(ri.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Hn(ri.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=l.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),n?.signal?.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof Hn?c:new Hn(ri.InternalError,String(c))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c,task:l,relatedTask:u}=n??{};return new Promise((d,f)=>{let h=a(v=>{f(v)},"earlyReject");if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),l&&this.assertTaskCapability(e.method)}catch(v){h(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),l&&(g.params={...g.params,task:l}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[aG]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(new Error(`Failed to send cancellation: ${T}`)));let S=v instanceof Hn?v:new Hn(ri.RequestTimeout,String(v));f(S)},"cancel");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let S=aD(r,v.result);S.success?d(S.data):f(S.error)}catch(S){f(S)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??eWs,_=a(()=>A(Hn.fromError(ri.RequestTimeout,"Request timed out",{timeout:y})),"timeoutHandler");this._setupTimeout(m,y,n?.maxTotalTimeout,_,n?.resetTimeoutOnProgress??!1);let E=u?.taskId;if(E){let v=a(S=>{let T=this._responseHandlers.get(m);T?T(S):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))},"responseResolver");this._requestResolvers.set(m,v),this._enqueueTaskMessage(E,{type:"request",message:g,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(m),f(S)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(v=>{this._cleanupTimeout(m),f(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Uut,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},jut,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},KXn,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let l={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[aG]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:l,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let l={...e,jsonrpc:"2.0"};r?.relatedTask&&(l={...l,params:{...l.params,_meta:{...l.params?._meta||{},[aG]:r.relatedTask}}}),this._transport?.send(l,r).catch(u=>this._onerror(u))});return}let c={...e,jsonrpc:"2.0"};r?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[aG]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=chr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=lhr(e,o);return Promise.resolve(r(c,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=chr(e);this._notificationHandlers.set(n,o=>{let s=lhr(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&TNe(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Hn(ri.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new Hn(ri.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Hn(ri.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:a(async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},"createTask"),getTask:a(async o=>{let s=await n.getTask(o,r);if(!s)throw new Hn(ri.InvalidParams,"Failed to retrieve task: Task not found");return s},"getTask"),storeTaskResult:a(async(o,s,c)=>{await n.storeTaskResult(o,s,c,r);let l=await n.getTask(o,r);if(l){let u=kNe.parse({method:"notifications/tasks/status",params:l});await this.notification(u),lG(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new Hn(ri.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(lG(l.status))throw new Hn(ri.InvalidParams,`Cannot update task "${o}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,c,r);let u=await n.getTask(o,r);if(u){let d=kNe.parse({method:"notifications/tasks/status",params:u});await this.notification(d),lG(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function _ei(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(_ei,"isPlainObject");function Eei(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let c=r[o];_ei(c)&&_ei(s)?r[o]={...c,...s}:r[o]=s}return r}a(Eei,"mergeCapabilities");p();var dni=fe(Ymr(),1),fni=fe(uni(),1);function iXs(){let t=new dni.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,fni.default)(t),t}a(iXs,"createDefaultAjvInstance");var Idt=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??iXs()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};p();var xdt=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=CR,n){let o=this._client,s={...n,task:n?.task??(o.isToolTask(e.name)?{}:void 0)},c=o.requestStream({method:"tools/call",params:e},r,s),l=o.getToolOutputValidator(e.name);for await(let u of c){if(u.type==="result"&&l){let d=u.result;if(!d.structuredContent&&!d.isError){yield{type:"error",error:new Hn(ri.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(d.structuredContent)try{let f=l(d.structuredContent);if(!f.valid){yield{type:"error",error:new Hn(ri.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Hn){yield{type:"error",error:f};return}yield{type:"error",error:new Hn(ri.InvalidParams,`Failed to validate structured content: ${f instanceof Error?f.message:String(f)}`)};return}}yield u}}async getTask(e,r){return this._client.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._client.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._client.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._client.cancelTask({taskId:e},r)}requestStream(e,r,n){return this._client.requestStream(e,r,n)}};p();function pni(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}a(pni,"assertToolsCallTaskCapability");function hni(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}a(hni,"assertClientRequestTaskCapability");function wdt(t,e){if(!(!t||e===null||typeof e!="object")){if(t.type==="object"&&t.properties&&typeof t.properties=="object"){let r=e,n=t.properties;for(let o of Object.keys(n)){let s=n[o];r[o]===void 0&&Object.prototype.hasOwnProperty.call(s,"default")&&(r[o]=s.default),r[o]!==void 0&&wdt(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&wdt(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&wdt(r,e)}}a(wdt,"applyElicitationDefaults");function oXs(t){if(!t)return{supportsFormMode:!1,supportsUrlMode:!1};let e=t.form!==void 0,r=t.url!==void 0;return{supportsFormMode:e||!e&&!r,supportsUrlMode:r}}a(oXs,"getSupportedElicitationModes");var yG=class extends $ut{static{a(this,"Client")}constructor(e,r){super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new Idt,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",j8,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",q8,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Q8,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new xdt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Eei(this._capabilities,e)}setRequestHandler(e,r){let o=Gut(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Pme(o)){let l=o;s=l._zod?.def?.value??l.value}else{let l=o;s=l._def?.value??l.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");let c=s;if(c==="elicitation/create"){let l=a(async(u,d)=>{let f=aD(NNe,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Hn(ri.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=oXs(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Hn(ri.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Hn(ri.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=aD(hee,A);if(!v.success){let S=v.error instanceof Error?v.error.message:String(v.error);throw new Hn(ri.InvalidParams,`Invalid task creation result: ${S}`)}return v.data}let y=aD(Xpr,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Hn(ri.InvalidParams,`Invalid elicitation result: ${v}`)}let _=y.data,E=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&_.action==="accept"&&_.content&&E&&this._capabilities.elicitation?.form?.applyDefaults)try{wdt(E,_.content)}catch{}return _},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=aD(DNe,u);if(!f.success){let _=f.error instanceof Error?f.error.message:String(f.error);throw new Hn(ri.InvalidParams,`Invalid sampling request: ${_}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let _=aD(hee,m);if(!_.success){let E=_.error instanceof Error?_.error.message:String(_.error);throw new Hn(ri.InvalidParams,`Invalid task creation result: ${E}`)}return _.data}let A=h.tools||h.toolChoice?Zpr:Jpr,y=aD(A,m);if(!y.success){let _=y.error instanceof Error?y.error.message:String(y.error);throw new Hn(ri.InvalidParams,`Invalid sampling result: ${_}`)}return y.data},"wrappedHandler");return super.setRequestHandler(e,l)}return super.setRequestHandler(e,r)}assertCapability(e,r){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{let n=await this.request({method:"initialize",params:{protocolVersion:_R,capabilities:this._capabilities,clientInfo:this._clientInfo}},Bpr,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!Dut.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break;case"ping":break}}assertTaskCapability(e){pni(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&hni(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},pee,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},ehr,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},pee,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},Ypr,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Gpr,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},Upr,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},Qpr,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},jpr,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},pee,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},pee,r)}async callTool(e,r=CR,n){if(this.isToolTaskRequired(e.name))throw new Hn(ri.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let o=await this.request({method:"tools/call",params:e},r,n),s=this.getToolOutputValidator(e.name);if(s){if(!o.structuredContent&&!o.isError)throw new Hn(ri.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{let c=s(o.structuredContent);if(!c.valid)throw new Hn(ri.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Hn?c:new Hn(ri.InvalidParams,`Failed to validate structured content: ${c instanceof Error?c.message:String(c)}`)}}return o}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of e){if(r.outputSchema){let o=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,o)}let n=r.execution?.taskSupport;(n==="required"||n==="optional")&&this._cachedKnownTaskTools.add(r.name),n==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){let n=await this.request({method:"tools/list",params:e},Kpr,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=rei.safeParse(n);if(!s.success)throw new Error(`Invalid ${e} listChanged options: ${s.error.message}`);if(typeof n.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:c,debounceMs:l}=s.data,{onChanged:u}=n,d=a(async()=>{if(!c){u(null,null);return}try{let h=await o();u(null,h)}catch(h){let m=h instanceof Error?h:new Error(String(h));u(m,null)}},"refresh"),f=a(()=>{if(l){let h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);let m=setTimeout(d,l);this._listChangedDebounceTimers.set(e,m)}else d()},"handler");this.setNotificationHandler(r,f)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};p();p();p();var Rdt=class extends Error{static{a(this,"ParseError")}constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}};function ngr(t){}a(ngr,"noop");function kdt(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=ngr,onError:r=ngr,onRetry:n=ngr,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let _=c?y.replace(/^\xEF\xBB\xBF/,""):y,[E,v]=sXs(`${s}${_}`);for(let S of E)h(S);s=v,c=!1}a(f,"feed");function h(y){if(y===""){g();return}if(y.startsWith(":")){o&&o(y.slice(y.startsWith(": ")?2:1));return}let _=y.indexOf(":");if(_!==-1){let E=y.slice(0,_),v=y[_+1]===" "?2:1,S=y.slice(_+v);m(E,S,y);return}m(y,"",y)}a(h,"parseLine");function m(y,_,E){switch(y){case"event":d=_;break;case"data":u=`${u}${_} +`)}updateAttemptCount(e){if(e.length!==this.lastChanges.length){this.attemptCount=0;return}for(let r=0;rt.webcrypto);async function i$s(t){return(await Dpr).getRandomValues(new Uint8Array(t))}a(i$s,"getRandomValues");async function o$s(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await i$s(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await s$s(t),r=await a$s(e);return{code_verifier:e,code_challenge:r}}a(Npr,"pkceChallenge");p();var _R="2025-11-25";var Dut=[_R,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],cG="io.modelcontextprotocol/related-task",Nut="2.0",kg=Zit(t=>t!==null&&(typeof t=="object"||typeof t=="function")),jXn=Ul([Xe(),ya().int()]),HXn=Xe(),LRf=gh({ttl:ya().optional(),pollInterval:ya().optional()}),l$s=Yr({ttl:ya().optional()}),u$s=Yr({taskId:Xe()}),Opr=gh({progressToken:jXn.optional(),[cG]:u$s.optional()}),sI=Yr({_meta:Opr.optional()}),SNe=sI.extend({task:l$s.optional()}),GXn=a(t=>SNe.safeParse(t).success,"isTaskAugmentedRequestParams"),ly=Yr({method:Xe(),params:sI.loose().optional()}),ER=Yr({_meta:Opr.optional()}),vR=Yr({method:Xe(),params:ER.loose().optional()}),uy=gh({_meta:Opr.optional()}),Mut=Ul([Xe(),ya().int()]),$Xn=Yr({jsonrpc:zn(Nut),id:Mut,...ly.shape}).strict(),TNe=a(t=>$Xn.safeParse(t).success,"isJSONRPCRequest"),VXn=Yr({jsonrpc:zn(Nut),...vR.shape}).strict(),WXn=a(t=>VXn.safeParse(t).success,"isJSONRPCNotification"),Lpr=Yr({jsonrpc:zn(Nut),id:Mut,result:uy}).strict(),pee=a(t=>Lpr.safeParse(t).success,"isJSONRPCResultResponse");var ri;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ri||(ri={}));var Bpr=Yr({jsonrpc:zn(Nut),id:Mut.optional(),error:Yr({code:ya().int(),message:Xe(),data:Fl().optional()})}).strict();var zXn=a(t=>Bpr.safeParse(t).success,"isJSONRPCErrorResponse");var lG=Ul([$Xn,VXn,Lpr,Bpr]),BRf=Ul([Lpr,Bpr]),hee=uy.strict(),d$s=ER.extend({requestId:Mut.optional(),reason:Xe().optional()}),Out=vR.extend({method:zn("notifications/cancelled"),params:d$s}),f$s=Yr({src:Xe(),mimeType:Xe().optional(),sizes:Qr(Xe()).optional(),theme:XA(["light","dark"]).optional()}),INe=Yr({icons:Qr(f$s).optional()}),wme=Yr({name:Xe(),title:Xe().optional()}),YXn=wme.extend({...wme.shape,...INe.shape,version:Xe(),websiteUrl:Xe().optional(),description:Xe().optional()}),p$s=npe(Yr({applyDefaults:Zc().optional()}),ml(Xe(),Fl())),h$s=gPe(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,npe(Yr({form:p$s.optional(),url:kg.optional()}),ml(Xe(),Fl()).optional())),m$s=gh({list:kg.optional(),cancel:kg.optional(),requests:gh({sampling:gh({createMessage:kg.optional()}).optional(),elicitation:gh({create:kg.optional()}).optional()}).optional()}),g$s=gh({list:kg.optional(),cancel:kg.optional(),requests:gh({tools:gh({call:kg.optional()}).optional()}).optional()}),A$s=Yr({experimental:ml(Xe(),kg).optional(),sampling:Yr({context:kg.optional(),tools:kg.optional()}).optional(),elicitation:h$s.optional(),roots:Yr({listChanged:Zc().optional()}).optional(),tasks:m$s.optional(),extensions:ml(Xe(),kg).optional()}),y$s=sI.extend({protocolVersion:Xe(),capabilities:A$s,clientInfo:YXn}),_$s=ly.extend({method:zn("initialize"),params:y$s});var E$s=Yr({experimental:ml(Xe(),kg).optional(),logging:kg.optional(),completions:kg.optional(),prompts:Yr({listChanged:Zc().optional()}).optional(),resources:Yr({subscribe:Zc().optional(),listChanged:Zc().optional()}).optional(),tools:Yr({listChanged:Zc().optional()}).optional(),tasks:g$s.optional(),extensions:ml(Xe(),kg).optional()}),Fpr=uy.extend({protocolVersion:Xe(),capabilities:E$s,serverInfo:YXn,instructions:Xe().optional()}),KXn=vR.extend({method:zn("notifications/initialized"),params:ER.optional()}),JXn=a(t=>KXn.safeParse(t).success,"isInitializedNotification"),Lut=ly.extend({method:zn("ping"),params:sI.optional()}),v$s=Yr({progress:ya(),total:ou(ya()),message:ou(Xe())}),C$s=Yr({...ER.shape,...v$s.shape,progressToken:jXn}),But=vR.extend({method:zn("notifications/progress"),params:C$s}),b$s=sI.extend({cursor:HXn.optional()}),xNe=ly.extend({params:b$s.optional()}),wNe=uy.extend({nextCursor:HXn.optional()}),S$s=XA(["working","input_required","completed","failed","cancelled"]),RNe=Yr({taskId:Xe(),status:S$s,ttl:Ul([ya(),cPe()]),createdAt:Xe(),lastUpdatedAt:Xe(),pollInterval:ou(ya()),statusMessage:ou(Xe())}),mee=uy.extend({task:RNe}),T$s=ER.merge(RNe),kNe=vR.extend({method:zn("notifications/tasks/status"),params:T$s}),Fut=ly.extend({method:zn("tasks/get"),params:sI.extend({taskId:Xe()})}),Uut=uy.merge(RNe),Qut=ly.extend({method:zn("tasks/result"),params:sI.extend({taskId:Xe()})}),FRf=uy.loose(),qut=xNe.extend({method:zn("tasks/list")}),jut=wNe.extend({tasks:Qr(RNe)}),Hut=ly.extend({method:zn("tasks/cancel"),params:sI.extend({taskId:Xe()})}),ZXn=uy.merge(RNe),XXn=Yr({uri:Xe(),mimeType:ou(Xe()),_meta:ml(Xe(),Fl()).optional()}),eei=XXn.extend({text:Xe()}),Upr=Xe().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),tei=XXn.extend({blob:Upr}),PNe=XA(["user","assistant"]),Rme=Yr({audience:Qr(PNe).optional(),priority:ya().min(0).max(1).optional(),lastModified:zj.datetime({offset:!0}).optional()}),rei=Yr({...wme.shape,...INe.shape,uri:Xe(),description:ou(Xe()),mimeType:ou(Xe()),size:ou(ya()),annotations:Rme.optional(),_meta:ou(gh({}))}),I$s=Yr({...wme.shape,...INe.shape,uriTemplate:Xe(),description:ou(Xe()),mimeType:ou(Xe()),annotations:Rme.optional(),_meta:ou(gh({}))}),x$s=xNe.extend({method:zn("resources/list")}),Qpr=wNe.extend({resources:Qr(rei)}),w$s=xNe.extend({method:zn("resources/templates/list")}),qpr=wNe.extend({resourceTemplates:Qr(I$s)}),jpr=sI.extend({uri:Xe()}),R$s=jpr,k$s=ly.extend({method:zn("resources/read"),params:R$s}),Hpr=uy.extend({contents:Qr(Ul([eei,tei]))}),Q8=vR.extend({method:zn("notifications/resources/list_changed"),params:ER.optional()}),P$s=jpr,D$s=ly.extend({method:zn("resources/subscribe"),params:P$s}),N$s=jpr,M$s=ly.extend({method:zn("resources/unsubscribe"),params:N$s}),O$s=ER.extend({uri:Xe()}),Gpr=vR.extend({method:zn("notifications/resources/updated"),params:O$s}),L$s=Yr({name:Xe(),description:ou(Xe()),required:ou(Zc())}),B$s=Yr({...wme.shape,...INe.shape,description:ou(Xe()),arguments:ou(Qr(L$s)),_meta:ou(gh({}))}),F$s=xNe.extend({method:zn("prompts/list")}),$pr=wNe.extend({prompts:Qr(B$s)}),U$s=sI.extend({name:Xe(),arguments:ml(Xe(),Xe()).optional()}),Q$s=ly.extend({method:zn("prompts/get"),params:U$s}),Vpr=Yr({type:zn("text"),text:Xe(),annotations:Rme.optional(),_meta:ml(Xe(),Fl()).optional()}),Wpr=Yr({type:zn("image"),data:Upr,mimeType:Xe(),annotations:Rme.optional(),_meta:ml(Xe(),Fl()).optional()}),zpr=Yr({type:zn("audio"),data:Upr,mimeType:Xe(),annotations:Rme.optional(),_meta:ml(Xe(),Fl()).optional()}),q$s=Yr({type:zn("tool_use"),name:Xe(),id:Xe(),input:ml(Xe(),Fl()),_meta:ml(Xe(),Fl()).optional()}),j$s=Yr({type:zn("resource"),resource:Ul([eei,tei]),annotations:Rme.optional(),_meta:ml(Xe(),Fl()).optional()}),H$s=rei.extend({type:zn("resource_link")}),Ypr=Ul([Vpr,Wpr,zpr,H$s,j$s]),G$s=Yr({role:PNe,content:Ypr}),Kpr=uy.extend({description:Xe().optional(),messages:Qr(G$s)}),q8=vR.extend({method:zn("notifications/prompts/list_changed"),params:ER.optional()}),$$s=Yr({title:Xe().optional(),readOnlyHint:Zc().optional(),destructiveHint:Zc().optional(),idempotentHint:Zc().optional(),openWorldHint:Zc().optional()}),V$s=Yr({taskSupport:XA(["required","optional","forbidden"]).optional()}),nei=Yr({...wme.shape,...INe.shape,description:Xe().optional(),inputSchema:Yr({type:zn("object"),properties:ml(Xe(),kg).optional(),required:Qr(Xe()).optional()}).catchall(Fl()),outputSchema:Yr({type:zn("object"),properties:ml(Xe(),kg).optional(),required:Qr(Xe()).optional()}).catchall(Fl()).optional(),annotations:$$s.optional(),execution:V$s.optional(),_meta:ml(Xe(),Fl()).optional()}),W$s=xNe.extend({method:zn("tools/list")}),Jpr=wNe.extend({tools:Qr(nei)}),CR=uy.extend({content:Qr(Ypr).default([]),structuredContent:ml(Xe(),Fl()).optional(),isError:Zc().optional()}),URf=CR.or(uy.extend({toolResult:Fl()})),z$s=SNe.extend({name:Xe(),arguments:ml(Xe(),Fl()).optional()}),Y$s=ly.extend({method:zn("tools/call"),params:z$s}),j8=vR.extend({method:zn("notifications/tools/list_changed"),params:ER.optional()}),iei=Yr({autoRefresh:Zc().default(!0),debounceMs:ya().int().nonnegative().default(300)}),oei=XA(["debug","info","notice","warning","error","critical","alert","emergency"]),K$s=sI.extend({level:oei}),J$s=ly.extend({method:zn("logging/setLevel"),params:K$s}),Z$s=ER.extend({level:oei,logger:Xe().optional(),data:Fl()}),gee=vR.extend({method:zn("notifications/message"),params:Z$s}),X$s=Yr({name:Xe().optional()}),eVs=Yr({hints:Qr(X$s).optional(),costPriority:ya().min(0).max(1).optional(),speedPriority:ya().min(0).max(1).optional(),intelligencePriority:ya().min(0).max(1).optional()}),tVs=Yr({mode:XA(["auto","required","none"]).optional()}),rVs=Yr({type:zn("tool_result"),toolUseId:Xe().describe("The unique identifier for the corresponding tool call."),content:Qr(Ypr).default([]),structuredContent:Yr({}).loose().optional(),isError:Zc().optional(),_meta:ml(Xe(),Fl()).optional()}),nVs=fPe("type",[Vpr,Wpr,zpr]),Put=fPe("type",[Vpr,Wpr,zpr,q$s,rVs]),iVs=Yr({role:PNe,content:Ul([Put,Qr(Put)]),_meta:ml(Xe(),Fl()).optional()}),oVs=SNe.extend({messages:Qr(iVs),modelPreferences:eVs.optional(),systemPrompt:Xe().optional(),includeContext:XA(["none","thisServer","allServers"]).optional(),temperature:ya().optional(),maxTokens:ya().int(),stopSequences:Qr(Xe()).optional(),metadata:kg.optional(),tools:Qr(nei).optional(),toolChoice:tVs.optional()}),DNe=ly.extend({method:zn("sampling/createMessage"),params:oVs}),Zpr=uy.extend({model:Xe(),stopReason:ou(XA(["endTurn","stopSequence","maxTokens"]).or(Xe())),role:PNe,content:nVs}),Xpr=uy.extend({model:Xe(),stopReason:ou(XA(["endTurn","stopSequence","maxTokens","toolUse"]).or(Xe())),role:PNe,content:Ul([Put,Qr(Put)])}),sVs=Yr({type:zn("boolean"),title:Xe().optional(),description:Xe().optional(),default:Zc().optional()}),aVs=Yr({type:zn("string"),title:Xe().optional(),description:Xe().optional(),minLength:ya().optional(),maxLength:ya().optional(),format:XA(["email","uri","date","date-time"]).optional(),default:Xe().optional()}),cVs=Yr({type:XA(["number","integer"]),title:Xe().optional(),description:Xe().optional(),minimum:ya().optional(),maximum:ya().optional(),default:ya().optional()}),lVs=Yr({type:zn("string"),title:Xe().optional(),description:Xe().optional(),enum:Qr(Xe()),default:Xe().optional()}),uVs=Yr({type:zn("string"),title:Xe().optional(),description:Xe().optional(),oneOf:Qr(Yr({const:Xe(),title:Xe()})),default:Xe().optional()}),dVs=Yr({type:zn("string"),title:Xe().optional(),description:Xe().optional(),enum:Qr(Xe()),enumNames:Qr(Xe()).optional(),default:Xe().optional()}),fVs=Ul([lVs,uVs]),pVs=Yr({type:zn("array"),title:Xe().optional(),description:Xe().optional(),minItems:ya().optional(),maxItems:ya().optional(),items:Yr({type:zn("string"),enum:Qr(Xe())}),default:Qr(Xe()).optional()}),hVs=Yr({type:zn("array"),title:Xe().optional(),description:Xe().optional(),minItems:ya().optional(),maxItems:ya().optional(),items:Yr({anyOf:Qr(Yr({const:Xe(),title:Xe()}))}),default:Qr(Xe()).optional()}),mVs=Ul([pVs,hVs]),gVs=Ul([dVs,fVs,mVs]),AVs=Ul([gVs,sVs,aVs,cVs]),yVs=SNe.extend({mode:zn("form").optional(),message:Xe(),requestedSchema:Yr({type:zn("object"),properties:ml(Xe(),AVs),required:Qr(Xe()).optional()})}),_Vs=SNe.extend({mode:zn("url"),message:Xe(),elicitationId:Xe(),url:Xe().url()}),EVs=Ul([yVs,_Vs]),NNe=ly.extend({method:zn("elicitation/create"),params:EVs}),vVs=ER.extend({elicitationId:Xe()}),CVs=vR.extend({method:zn("notifications/elicitation/complete"),params:vVs}),ehr=uy.extend({action:XA(["accept","decline","cancel"]),content:gPe(t=>t===null?void 0:t,ml(Xe(),Ul([Xe(),ya(),Zc(),Qr(Xe())])).optional())}),bVs=Yr({type:zn("ref/resource"),uri:Xe()});var SVs=Yr({type:zn("ref/prompt"),name:Xe()}),TVs=sI.extend({ref:Ul([SVs,bVs]),argument:Yr({name:Xe(),value:Xe()}),context:Yr({arguments:ml(Xe(),Xe()).optional()}).optional()}),IVs=ly.extend({method:zn("completion/complete"),params:TVs});var thr=uy.extend({completion:gh({values:Qr(Xe()).max(100),total:ou(ya().int()),hasMore:ou(Zc())})}),xVs=Yr({uri:Xe().startsWith("file://"),name:Xe().optional(),_meta:ml(Xe(),Fl()).optional()}),rhr=ly.extend({method:zn("roots/list"),params:sI.optional()}),wVs=uy.extend({roots:Qr(xVs)}),RVs=vR.extend({method:zn("notifications/roots/list_changed"),params:ER.optional()}),QRf=Ul([Lut,_$s,IVs,J$s,Q$s,F$s,x$s,w$s,k$s,D$s,M$s,Y$s,W$s,Fut,Qut,qut,Hut]),qRf=Ul([Out,But,KXn,RVs,kNe]),jRf=Ul([hee,Zpr,Xpr,ehr,wVs,Uut,jut,mee]),HRf=Ul([Lut,DNe,NNe,rhr,Fut,Qut,qut,Hut]),GRf=Ul([Out,But,gee,Gpr,Q8,j8,q8,kNe,CVs]),$Rf=Ul([hee,Fpr,thr,Kpr,$pr,Qpr,qpr,Hpr,CR,Jpr,Uut,jut,mee]),Hn=class t extends Error{static{a(this,"McpError")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===ri.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Mpr(o.elicitations,r)}return new t(e,r,n)}},Mpr=class extends Hn{static{a(this,"UrlElicitationRequiredError")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(ri.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};p();var dy=kit().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:drr.custom,message:"URL must be parseable",fatal:!0}),Pke}).refine(t=>{let e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),aei=gh({resource:Xe().url(),authorization_servers:Qr(dy).optional(),jwks_uri:Xe().url().optional(),scopes_supported:Qr(Xe()).optional(),bearer_methods_supported:Qr(Xe()).optional(),resource_signing_alg_values_supported:Qr(Xe()).optional(),resource_name:Xe().optional(),resource_documentation:Xe().optional(),resource_policy_uri:Xe().url().optional(),resource_tos_uri:Xe().url().optional(),tls_client_certificate_bound_access_tokens:Zc().optional(),authorization_details_types_supported:Qr(Xe()).optional(),dpop_signing_alg_values_supported:Qr(Xe()).optional(),dpop_bound_access_tokens_required:Zc().optional()}),nhr=gh({issuer:Xe(),authorization_endpoint:dy,token_endpoint:dy,registration_endpoint:dy.optional(),scopes_supported:Qr(Xe()).optional(),response_types_supported:Qr(Xe()),response_modes_supported:Qr(Xe()).optional(),grant_types_supported:Qr(Xe()).optional(),token_endpoint_auth_methods_supported:Qr(Xe()).optional(),token_endpoint_auth_signing_alg_values_supported:Qr(Xe()).optional(),service_documentation:dy.optional(),revocation_endpoint:dy.optional(),revocation_endpoint_auth_methods_supported:Qr(Xe()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Qr(Xe()).optional(),introspection_endpoint:Xe().optional(),introspection_endpoint_auth_methods_supported:Qr(Xe()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Qr(Xe()).optional(),code_challenge_methods_supported:Qr(Xe()).optional(),client_id_metadata_document_supported:Zc().optional()}),kVs=gh({issuer:Xe(),authorization_endpoint:dy,token_endpoint:dy,userinfo_endpoint:dy.optional(),jwks_uri:dy,registration_endpoint:dy.optional(),scopes_supported:Qr(Xe()).optional(),response_types_supported:Qr(Xe()),response_modes_supported:Qr(Xe()).optional(),grant_types_supported:Qr(Xe()).optional(),acr_values_supported:Qr(Xe()).optional(),subject_types_supported:Qr(Xe()),id_token_signing_alg_values_supported:Qr(Xe()),id_token_encryption_alg_values_supported:Qr(Xe()).optional(),id_token_encryption_enc_values_supported:Qr(Xe()).optional(),userinfo_signing_alg_values_supported:Qr(Xe()).optional(),userinfo_encryption_alg_values_supported:Qr(Xe()).optional(),userinfo_encryption_enc_values_supported:Qr(Xe()).optional(),request_object_signing_alg_values_supported:Qr(Xe()).optional(),request_object_encryption_alg_values_supported:Qr(Xe()).optional(),request_object_encryption_enc_values_supported:Qr(Xe()).optional(),token_endpoint_auth_methods_supported:Qr(Xe()).optional(),token_endpoint_auth_signing_alg_values_supported:Qr(Xe()).optional(),display_values_supported:Qr(Xe()).optional(),claim_types_supported:Qr(Xe()).optional(),claims_supported:Qr(Xe()).optional(),service_documentation:Xe().optional(),claims_locales_supported:Qr(Xe()).optional(),ui_locales_supported:Qr(Xe()).optional(),claims_parameter_supported:Zc().optional(),request_parameter_supported:Zc().optional(),request_uri_parameter_supported:Zc().optional(),require_request_uri_registration:Zc().optional(),op_policy_uri:dy.optional(),op_tos_uri:dy.optional(),client_id_metadata_document_supported:Zc().optional()}),cei=Yr({...kVs.shape,...nhr.pick({code_challenge_methods_supported:!0}).shape}),lei=Yr({access_token:Xe(),id_token:Xe().optional(),token_type:Xe(),expires_in:APe.number().optional(),scope:Xe().optional(),refresh_token:Xe().optional()}).strip(),uei=Yr({error:Xe(),error_description:Xe().optional(),error_uri:Xe().optional()}),sei=dy.optional().or(zn("").transform(()=>{})),PVs=Yr({redirect_uris:Qr(dy),token_endpoint_auth_method:Xe().optional(),grant_types:Qr(Xe()).optional(),response_types:Qr(Xe()).optional(),client_name:Xe().optional(),client_uri:dy.optional(),logo_uri:sei,scope:Xe().optional(),contacts:Qr(Xe()).optional(),tos_uri:sei,policy_uri:Xe().optional(),jwks_uri:dy.optional(),jwks:Wit().optional(),software_id:Xe().optional(),software_version:Xe().optional(),software_statement:Xe().optional()}).strip(),DVs=Yr({client_id:Xe(),client_secret:Xe().optional(),client_id_issued_at:ya().optional(),client_secret_expires_at:ya().optional()}).strip(),dei=PVs.merge(DVs),YRf=Yr({error:Xe(),error_description:Xe().optional()}).strip(),KRf=Yr({token:Xe(),token_type_hint:Xe().optional()}).strip();p();function fei(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(fei,"resourceUrlFromServerUrl");function pei({requestedResource:t,configuredResource:e}){let r=typeof t=="string"?new URL(t):new URL(t.href),n=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==n.origin||r.pathname.length=400&&t.status<500&&e!=="/"}a(jVs,"shouldAttemptFallback");async function HVs(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??_R,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let u=qVs(e,o.pathname);c=new URL(u,n?.metadataServerUrl??o),c.search=o.search}let l=await mei(c,s,r);if(!n?.metadataUrl&&jVs(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await mei(u,s,r)}return l}a(HVs,"discoverMetadataWithFallback");function GVs(t){let e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),n;let o=e.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,e.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,e.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,e.origin),type:"oidc"}),n}a(GVs,"buildDiscoveryUrls");async function yei(t,{fetchFn:e=fetch,protocolVersion:r=_R}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=GVs(t);for(let{url:s,type:c}of o){let l=await chr(s,n,e);if(l){if(!l.ok){if(await l.body?.cancel(),l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${c==="oauth"?"OAuth":"OpenID provider"} metadata from ${s}`)}return c==="oauth"?nhr.parse(await l.json()):cei.parse(await l.json())}}}a(yei,"discoverAuthorizationServerMetadata");async function $Vs(t,e){let r,n;try{r=await Aei(t,{resourceMetadataUrl:e?.resourceMetadataUrl},e?.fetchFn),r.authorization_servers&&r.authorization_servers.length>0&&(n=r.authorization_servers[0])}catch{}n||(n=String(new URL("/",t)));let o=await yei(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a($Vs,"discoverOAuthServerInfo");async function VVs(t,{metadata:e,clientInformation:r,redirectUrl:n,scope:o,state:s,resource:c}){let l;if(e){if(l=new URL(e.authorization_endpoint),!e.response_types_supported.includes(ihr))throw new Error(`Incompatible auth server: does not support response type ${ihr}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(ohr))throw new Error(`Incompatible auth server: does not support code challenge method ${ohr}`)}else l=new URL("/authorize",t);let u=await Npr(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",ihr),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",ohr),l.searchParams.set("redirect_uri",String(n)),s&&l.searchParams.set("state",s),o&&l.searchParams.set("scope",o),o?.includes("offline_access")&&l.searchParams.append("prompt","consent"),c&&l.searchParams.set("resource",c.href),{authorizationUrl:l,codeVerifier:d}}a(VVs,"startAuthorization");function WVs(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a(WVs,"prepareAuthorizationCodeRequest");async function _ei(t,{metadata:e,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c}){let l=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",t),u=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(s&&r.set("resource",s.href),o)await o(u,r,l,e);else if(n){let f=e?.token_endpoint_auth_methods_supported??[],h=MVs(n,f);OVs(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await gei(d);return lei.parse(await d.json())}a(_ei,"executeTokenRequest");async function zVs(t,{metadata:e,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:s,fetchFn:c}){let l=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),u=await _ei(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(zVs,"refreshAuthorization");async function YVs(t,e,{metadata:r,resource:n,authorizationCode:o,fetchFn:s}={}){let c=t.clientMetadata.scope,l;if(t.prepareTokenRequest&&(l=await t.prepareTokenRequest(c)),!l){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!t.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let d=await t.codeVerifier();l=WVs(o,d,t.redirectUrl)}let u=await t.clientInformation();return _ei(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(YVs,"fetchToken");async function KVs(t,{metadata:e,clientMetadata:r,scope:n,fetchFn:o}){let s;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");s=new URL(e.registration_endpoint)}else s=new URL("/register",t);let c=await(o??fetch)(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r,...n!==void 0?{scope:n}:{}})});if(!c.ok)throw await gei(c);return dei.parse(await c.json())}a(KVs,"registerClient");p();p();p();p();function Pme(t){return!!t._zod}a(Pme,"isZ4Schema");function aD(t,e){return Pme(t)?Dfe(t,e):t.safeParse(e)}a(aD,"safeParse");function Gut(t){if(!t)return;let e;if(Pme(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(Gut,"getObjectShape");function Eei(t){if(Pme(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}a(Eei,"getLiteralValue");p();function uG(t){return t==="completed"||t==="failed"||t==="cancelled"}a(uG,"isTerminal");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();var NPf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function lhr(t){let r=Gut(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Eei(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(lhr,"getMethodLiteral");function uhr(t,e){let r=aD(t,e);if(!r.success)throw r.error;return r.data}a(uhr,"parseWithCompat");var rWs=6e4,$ut=class{static{a(this,"Protocol")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Out,r=>{this._oncancel(r)}),this.setNotificationHandler(But,r=>{this._onprogress(r)}),this.setRequestHandler(Lut,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Fut,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Hn(ri.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Qut,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new Hn(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new Hn(ri.InvalidParams,`Task not found: ${s}`);if(!uG(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(uG(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[cG]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(qut,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new Hn(ri.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Hut,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Hn(ri.InvalidParams,`Task not found: ${r.params.taskId}`);if(uG(o.status))throw new Hn(ri.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new Hn(ri.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Hn?o:new Hn(ri.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),Hn.fromError(ri.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,c)=>{o?.(s,c),pee(s)||zXn(s)?this._onresponse(s):TNe(s)?this._onrequest(s,c):WXn(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=Hn.fromError(ri.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[cG]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:ri.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let l=GXn(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,d={signal:c.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:a(async f=>{if(c.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},"sendNotification"),sendRequest:a(async(f,h,m)=>{if(c.signal.aborted)throw new Hn(ri.ConnectionClosed,"Request was cancelled");let g={...m,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let A=g.relatedTask?.taskId??s;return A&&u&&await u.updateTaskStatus(A,"input_required"),await this.request(f,h,g)},"sendRequest"),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:l?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,d)).then(async f=>{if(c.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(c.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:ri.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===c&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let c=this._responseHandlers.get(o),l=this._timeoutInfo.get(o);if(l&&c&&l.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),c(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),pee(e))n(e);else{let c=new Hn(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(pee(e)&&e.result&&typeof e.result=="object"){let c=e.result;if(c.task&&typeof c.task=="object"){let l=c.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,r))}}if(s||this._progressHandlers.delete(r),pee(e))o(e);else{let c=Hn.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof Hn?c:new Hn(ri.InternalError,String(c))}}return}let s;try{let c=await this.request(e,mee,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Hn(ri.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},uG(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Hn(ri.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Hn(ri.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=l.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),n?.signal?.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof Hn?c:new Hn(ri.InternalError,String(c))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c,task:l,relatedTask:u}=n??{};return new Promise((d,f)=>{let h=a(v=>{f(v)},"earlyReject");if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),l&&this.assertTaskCapability(e.method)}catch(v){h(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),l&&(g.params={...g.params,task:l}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[cG]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(new Error(`Failed to send cancellation: ${T}`)));let S=v instanceof Hn?v:new Hn(ri.RequestTimeout,String(v));f(S)},"cancel");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let S=aD(r,v.result);S.success?d(S.data):f(S.error)}catch(S){f(S)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??rWs,_=a(()=>A(Hn.fromError(ri.RequestTimeout,"Request timed out",{timeout:y})),"timeoutHandler");this._setupTimeout(m,y,n?.maxTotalTimeout,_,n?.resetTimeoutOnProgress??!1);let E=u?.taskId;if(E){let v=a(S=>{let T=this._responseHandlers.get(m);T?T(S):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))},"responseResolver");this._requestResolvers.set(m,v),this._enqueueTaskMessage(E,{type:"request",message:g,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(m),f(S)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(v=>{this._cleanupTimeout(m),f(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Uut,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},jut,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},ZXn,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let l={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[cG]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:l,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let l={...e,jsonrpc:"2.0"};r?.relatedTask&&(l={...l,params:{...l.params,_meta:{...l.params?._meta||{},[cG]:r.relatedTask}}}),this._transport?.send(l,r).catch(u=>this._onerror(u))});return}let c={...e,jsonrpc:"2.0"};r?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[cG]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=lhr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=uhr(e,o);return Promise.resolve(r(c,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=lhr(e);this._notificationHandlers.set(n,o=>{let s=uhr(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&TNe(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Hn(ri.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new Hn(ri.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Hn(ri.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:a(async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},"createTask"),getTask:a(async o=>{let s=await n.getTask(o,r);if(!s)throw new Hn(ri.InvalidParams,"Failed to retrieve task: Task not found");return s},"getTask"),storeTaskResult:a(async(o,s,c)=>{await n.storeTaskResult(o,s,c,r);let l=await n.getTask(o,r);if(l){let u=kNe.parse({method:"notifications/tasks/status",params:l});await this.notification(u),uG(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new Hn(ri.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(uG(l.status))throw new Hn(ri.InvalidParams,`Cannot update task "${o}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,c,r);let u=await n.getTask(o,r);if(u){let d=kNe.parse({method:"notifications/tasks/status",params:u});await this.notification(d),uG(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function vei(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(vei,"isPlainObject");function Cei(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let c=r[o];vei(c)&&vei(s)?r[o]={...c,...s}:r[o]=s}return r}a(Cei,"mergeCapabilities");p();var pni=fe(Kmr(),1),hni=fe(fni(),1);function sXs(){let t=new pni.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,hni.default)(t),t}a(sXs,"createDefaultAjvInstance");var Idt=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??sXs()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};p();var xdt=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=CR,n){let o=this._client,s={...n,task:n?.task??(o.isToolTask(e.name)?{}:void 0)},c=o.requestStream({method:"tools/call",params:e},r,s),l=o.getToolOutputValidator(e.name);for await(let u of c){if(u.type==="result"&&l){let d=u.result;if(!d.structuredContent&&!d.isError){yield{type:"error",error:new Hn(ri.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(d.structuredContent)try{let f=l(d.structuredContent);if(!f.valid){yield{type:"error",error:new Hn(ri.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Hn){yield{type:"error",error:f};return}yield{type:"error",error:new Hn(ri.InvalidParams,`Failed to validate structured content: ${f instanceof Error?f.message:String(f)}`)};return}}yield u}}async getTask(e,r){return this._client.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._client.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._client.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._client.cancelTask({taskId:e},r)}requestStream(e,r,n){return this._client.requestStream(e,r,n)}};p();function mni(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}a(mni,"assertToolsCallTaskCapability");function gni(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}a(gni,"assertClientRequestTaskCapability");function wdt(t,e){if(!(!t||e===null||typeof e!="object")){if(t.type==="object"&&t.properties&&typeof t.properties=="object"){let r=e,n=t.properties;for(let o of Object.keys(n)){let s=n[o];r[o]===void 0&&Object.prototype.hasOwnProperty.call(s,"default")&&(r[o]=s.default),r[o]!==void 0&&wdt(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&wdt(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&wdt(r,e)}}a(wdt,"applyElicitationDefaults");function aXs(t){if(!t)return{supportsFormMode:!1,supportsUrlMode:!1};let e=t.form!==void 0,r=t.url!==void 0;return{supportsFormMode:e||!e&&!r,supportsUrlMode:r}}a(aXs,"getSupportedElicitationModes");var _G=class extends $ut{static{a(this,"Client")}constructor(e,r){super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new Idt,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",j8,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",q8,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Q8,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new xdt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Cei(this._capabilities,e)}setRequestHandler(e,r){let o=Gut(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Pme(o)){let l=o;s=l._zod?.def?.value??l.value}else{let l=o;s=l._def?.value??l.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");let c=s;if(c==="elicitation/create"){let l=a(async(u,d)=>{let f=aD(NNe,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Hn(ri.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=aXs(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Hn(ri.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Hn(ri.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=aD(mee,A);if(!v.success){let S=v.error instanceof Error?v.error.message:String(v.error);throw new Hn(ri.InvalidParams,`Invalid task creation result: ${S}`)}return v.data}let y=aD(ehr,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Hn(ri.InvalidParams,`Invalid elicitation result: ${v}`)}let _=y.data,E=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&_.action==="accept"&&_.content&&E&&this._capabilities.elicitation?.form?.applyDefaults)try{wdt(E,_.content)}catch{}return _},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=aD(DNe,u);if(!f.success){let _=f.error instanceof Error?f.error.message:String(f.error);throw new Hn(ri.InvalidParams,`Invalid sampling request: ${_}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let _=aD(mee,m);if(!_.success){let E=_.error instanceof Error?_.error.message:String(_.error);throw new Hn(ri.InvalidParams,`Invalid task creation result: ${E}`)}return _.data}let A=h.tools||h.toolChoice?Xpr:Zpr,y=aD(A,m);if(!y.success){let _=y.error instanceof Error?y.error.message:String(y.error);throw new Hn(ri.InvalidParams,`Invalid sampling result: ${_}`)}return y.data},"wrappedHandler");return super.setRequestHandler(e,l)}return super.setRequestHandler(e,r)}assertCapability(e,r){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{let n=await this.request({method:"initialize",params:{protocolVersion:_R,capabilities:this._capabilities,clientInfo:this._clientInfo}},Fpr,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!Dut.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break;case"ping":break}}assertTaskCapability(e){mni(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&gni(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},hee,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},thr,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},hee,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},Kpr,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},$pr,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},Qpr,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},qpr,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},Hpr,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},hee,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},hee,r)}async callTool(e,r=CR,n){if(this.isToolTaskRequired(e.name))throw new Hn(ri.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let o=await this.request({method:"tools/call",params:e},r,n),s=this.getToolOutputValidator(e.name);if(s){if(!o.structuredContent&&!o.isError)throw new Hn(ri.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{let c=s(o.structuredContent);if(!c.valid)throw new Hn(ri.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Hn?c:new Hn(ri.InvalidParams,`Failed to validate structured content: ${c instanceof Error?c.message:String(c)}`)}}return o}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of e){if(r.outputSchema){let o=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,o)}let n=r.execution?.taskSupport;(n==="required"||n==="optional")&&this._cachedKnownTaskTools.add(r.name),n==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){let n=await this.request({method:"tools/list",params:e},Jpr,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=iei.safeParse(n);if(!s.success)throw new Error(`Invalid ${e} listChanged options: ${s.error.message}`);if(typeof n.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:c,debounceMs:l}=s.data,{onChanged:u}=n,d=a(async()=>{if(!c){u(null,null);return}try{let h=await o();u(null,h)}catch(h){let m=h instanceof Error?h:new Error(String(h));u(m,null)}},"refresh"),f=a(()=>{if(l){let h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);let m=setTimeout(d,l);this._listChangedDebounceTimers.set(e,m)}else d()},"handler");this.setNotificationHandler(r,f)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};p();p();p();var Rdt=class extends Error{static{a(this,"ParseError")}constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}};function igr(t){}a(igr,"noop");function kdt(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=igr,onError:r=igr,onRetry:n=igr,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let _=c?y.replace(/^\xEF\xBB\xBF/,""):y,[E,v]=cXs(`${s}${_}`);for(let S of E)h(S);s=v,c=!1}a(f,"feed");function h(y){if(y===""){g();return}if(y.startsWith(":")){o&&o(y.slice(y.startsWith(": ")?2:1));return}let _=y.indexOf(":");if(_!==-1){let E=y.slice(0,_),v=y[_+1]===" "?2:1,S=y.slice(_+v);m(E,S,y);return}m(y,"",y)}a(h,"parseLine");function m(y,_,E){switch(y){case"event":d=_;break;case"data":u=`${u}${_} `;break;case"id":l=_.includes("\0")?void 0:_;break;case"retry":/^\d+$/.test(_)?n(parseInt(_,10)):r(new Rdt(`Invalid \`retry\` value: "${_}"`,{type:"invalid-retry",value:_,line:E}));break;default:r(new Rdt(`Unknown field "${y.length>20?`${y.slice(0,20)}\u2026`:y}"`,{type:"unknown-field",field:y,value:_,line:E}));break}}a(m,"processField");function g(){u.length>0&&e({id:l,event:d||void 0,data:u.endsWith(` -`)?u.slice(0,-1):u}),l=void 0,u="",d=""}a(g,"dispatchEvent");function A(y={}){s&&y.consume&&h(s),c=!0,l=void 0,u="",d="",s=""}return a(A,"reset"),{feed:f,reset:A}}a(kdt,"createParser");function sXs(t){let e=[],r="",n=0;for(;n{throw TypeError(t)},"__typeError"),fgr=a((t,e,r)=>e.has(t)||Ani("Cannot "+r),"__accessCheck"),ca=a((t,e,r)=>(fgr(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),kg=a((t,e,r)=>e.has(t)?Ani("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),sf=a((t,e,r,n)=>(fgr(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),K8=a((t,e,r)=>(fgr(t,e,"access private method"),r),"__privateMethod"),zb,Pee,Kme,Pdt,Ndt,SMe,Xme,TMe,_G,Jme,ege,Zme,CMe,pD,ogr,sgr,agr,gni,cgr,lgr,bMe,ugr,dgr,Dee=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),kg(this,pD),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,kg(this,zb),kg(this,Pee),kg(this,Kme),kg(this,Pdt),kg(this,Ndt),kg(this,SMe),kg(this,Xme),kg(this,TMe,null),kg(this,_G),kg(this,Jme),kg(this,ege,null),kg(this,Zme,null),kg(this,CMe,null),kg(this,sgr,async s=>{var c;ca(this,Jme).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){K8(this,pD,bMe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?sf(this,Kme,new URL(s.url)):sf(this,Kme,void 0),d!==200){K8(this,pD,bMe).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){K8(this,pD,bMe).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(ca(this,zb)===this.CLOSED)return;sf(this,zb,this.OPEN);let h=new Event("open");if((c=ca(this,CMe))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){K8(this,pD,bMe).call(this,"Invalid response body, expected a web ReadableStream",d),this.close();return}let m=new TextDecoder,g=l.getReader(),A=!0;do{let{done:y,value:_}=await g.read();_&&ca(this,Jme).feed(m.decode(_,{stream:!y})),y&&(A=!1,ca(this,Jme).reset(),K8(this,pD,ugr).call(this))}while(A)}),kg(this,agr,s=>{sf(this,_G,void 0),!(s.name==="AbortError"||s.type==="aborted")&&K8(this,pD,ugr).call(this,igr(s))}),kg(this,cgr,s=>{typeof s.id=="string"&&sf(this,TMe,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:ca(this,Kme)?ca(this,Kme).origin:ca(this,Pee).origin,lastEventId:s.id||""});ca(this,Zme)&&(!s.event||s.event==="message")&&ca(this,Zme).call(this,c),this.dispatchEvent(c)}),kg(this,lgr,s=>{sf(this,SMe,s)}),kg(this,dgr,()=>{sf(this,Xme,void 0),ca(this,zb)===this.CONNECTING&&K8(this,pD,ogr).call(this)});try{if(e instanceof URL)sf(this,Pee,e);else if(typeof e=="string")sf(this,Pee,new URL(e,cXs()));else throw new Error("Invalid URL")}catch{throw aXs("An invalid or illegal string was specified")}sf(this,Jme,kdt({onEvent:ca(this,cgr),onRetry:ca(this,lgr)})),sf(this,zb,this.CONNECTING),sf(this,SMe,3e3),sf(this,Ndt,(n=r?.fetch)!=null?n:globalThis.fetch),sf(this,Pdt,(o=r?.withCredentials)!=null?o:!1),K8(this,pD,ogr).call(this)}get readyState(){return ca(this,zb)}get url(){return ca(this,Pee).href}get withCredentials(){return ca(this,Pdt)}get onerror(){return ca(this,ege)}set onerror(e){sf(this,ege,e)}get onmessage(){return ca(this,Zme)}set onmessage(e){sf(this,Zme,e)}get onopen(){return ca(this,CMe)}set onopen(e){sf(this,CMe,e)}addEventListener(e,r,n){let o=r;super.addEventListener(e,o,n)}removeEventListener(e,r,n){let o=r;super.removeEventListener(e,o,n)}close(){ca(this,Xme)&&clearTimeout(ca(this,Xme)),ca(this,zb)!==this.CLOSED&&(ca(this,_G)&&ca(this,_G).abort(),sf(this,zb,this.CLOSED),sf(this,_G,void 0))}};zb=new WeakMap,Pee=new WeakMap,Kme=new WeakMap,Pdt=new WeakMap,Ndt=new WeakMap,SMe=new WeakMap,Xme=new WeakMap,TMe=new WeakMap,_G=new WeakMap,Jme=new WeakMap,ege=new WeakMap,Zme=new WeakMap,CMe=new WeakMap,pD=new WeakSet,ogr=a(function(){sf(this,zb,this.CONNECTING),sf(this,_G,new AbortController),ca(this,Ndt)(ca(this,Pee),K8(this,pD,gni).call(this)).then(ca(this,sgr)).catch(ca(this,agr))},"connect_fn"),sgr=new WeakMap,agr=new WeakMap,gni=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...ca(this,TMe)?{"Last-Event-ID":ca(this,TMe)}:void 0},cache:"no-store",signal:(t=ca(this,_G))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),cgr=new WeakMap,lgr=new WeakMap,bMe=a(function(t,e){var r;ca(this,zb)!==this.CLOSED&&sf(this,zb,this.CLOSED);let n=new Ddt("error",{code:e,message:t});(r=ca(this,ege))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),ugr=a(function(t,e){var r;if(ca(this,zb)===this.CLOSED)return;sf(this,zb,this.CONNECTING);let n=new Ddt("error",{code:e,message:t});(r=ca(this,ege))==null||r.call(this,n),this.dispatchEvent(n),sf(this,Xme,setTimeout(ca(this,dgr),ca(this,SMe)))},"scheduleReconnect_fn"),dgr=new WeakMap,Dee.CONNECTING=0,Dee.OPEN=1,Dee.CLOSED=2;function cXs(){let t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}a(cXs,"getBaseURL");p();function tge(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(tge,"normalizeHeaders");function Mdt(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{...tge(e.headers),...tge(n.headers)}:e.headers};return t(r,o)}:t}a(Mdt,"createFetchWithInit");var IMe=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},rge=class{static{a(this,"SSEClientTransport")}constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=Mdt(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fy("No auth provider");let e;try{e=await G8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new fy;return await this._startOrAuth()}async _commonHeaders(){let e={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=tge(this._requestInit?.headers);return new Headers({...e,...r})}_startOrAuth(){let e=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((r,n)=>{this._eventSource=new Dee(this._url.href,{...this._eventSourceInit,fetch:a(async(o,s)=>{let c=await this._commonHeaders();c.set("Accept","text/event-stream");let l=await e(o,{...s,headers:c});if(l.status===401&&l.headers.has("www-authenticate")){let{resourceMetadataUrl:u,scope:d}=kme(l);this._resourceMetadataUrl=u,this._scope=d}return l},"fetch")}),this._abortController=new AbortController,this._eventSource.onerror=o=>{if(o.code===401&&this._authProvider){this._authThenStart().then(r,n);return}let s=new IMe(o.code,o.message,o);n(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",o=>{let s=o;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(c){n(c),this.onerror?.(c),this.close();return}r()}),this._eventSource.onmessage=o=>{let s=o,c;try{c=cG.parse(JSON.parse(s.data))}catch(l){this.onerror?.(l);return}this.onmessage?.(c)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new fy("No auth provider");if(await G8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fy("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(e){if(!this._endpoint)throw new Error("Not connected");try{let r=await this._commonHeaders();r.set("content-type","application/json");let n={...this._requestInit,method:"POST",headers:r,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._endpoint,n);if(!o.ok){let s=await o.text().catch(()=>null);if(o.status===401&&this._authProvider){let{resourceMetadataUrl:c,scope:l}=kme(o);if(this._resourceMetadataUrl=c,this._scope=l,await G8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fy;return this.send(e)}throw new Error(`Error POSTing to endpoint (HTTP ${o.status}): ${s}`)}await o.body?.cancel()}catch(r){throw this.onerror?.(r),r}}setProtocolVersion(e){this._protocolVersion=e}};p();p();var Odt=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=kdt({onEvent:a(c=>{s.enqueue(c)},"onEvent"),onError(c){e==="terminate"?s.error(c):typeof e=="function"&&e(c)},onRetry:r,onComment:n})},transform(s){o.feed(s)}})}};var lXs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},xR=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},nge=class{static{a(this,"StreamableHTTPClientTransport")}constructor(e,r){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=Mdt(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??lXs}async _authThenStart(){if(!this._authProvider)throw new fy("No auth provider");let e;try{e=await G8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new fy;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=tge(this._requestInit?.headers);return new Headers({...e,...r})}async _startOrAuthSse(e){let{resumptionToken:r}=e;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new xR(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,e,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,e),o)}_scheduleReconnection(e,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(s=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${s instanceof Error?s.message:String(s)}`)),this._scheduleReconnection(e,r+1)})},o)}_handleSseStream(e,r,n){if(!e)return;let{onresumptiontoken:o,replayMessageId:s}=r,c,l=!1,u=!1;a(async()=>{try{let f=e.pipeThrough(new TextDecoderStream).pipeThrough(new Odt({onRetry:a(g=>{this._serverRetryMs=g},"onRetry")})).getReader();for(;;){let{value:g,done:A}=await f.read();if(A)break;if(g.id&&(c=g.id,l=!0,o?.(g.id)),!!g.data&&(!g.event||g.event==="message"))try{let y=cG.parse(JSON.parse(g.data));fee(y)&&(u=!0,s!==void 0&&(y.id=s)),this.onmessage?.(y)}catch(y){this.onerror?.(y)}}(n||l)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:c,onresumptiontoken:o,replayMessageId:s},0)}catch(f){if(this.onerror?.(new Error(`SSE stream disconnected: ${f}`)),(n||l)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:c,onresumptiontoken:o,replayMessageId:s},0)}catch(g){this.onerror?.(new Error(`Failed to reconnect: ${g instanceof Error?g.message:String(g)}`))}}},"processStream")()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new fy("No auth provider");if(await G8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fy("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:TNe(e)?e.id:void 0}).catch(m=>this.onerror?.(m));return}let s=await this._commonHeaders();s.set("content-type","application/json"),s.set("accept","application/json, text/event-stream");let c={...this._requestInit,method:"POST",headers:s,body:JSON.stringify(e),signal:this._abortController?.signal},l=await(this._fetch??fetch)(this._url,c),u=l.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!l.ok){let m=await l.text().catch(()=>null);if(l.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new xR(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=kme(l);if(this._resourceMetadataUrl=g,this._scope=A,await G8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fy;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=kme(l);if(y==="insufficient_scope"){let _=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===_)throw new xR(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=_??void 0,await G8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new fy;return this.send(e)}}throw new xR(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),YXn(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(m=>this.onerror?.(m));return}let f=(Array.isArray(e)?e:[e]).filter(m=>"method"in m&&"id"in m&&m.id!==void 0).length>0,h=l.headers.get("content-type");if(f)if(h?.includes("text/event-stream"))this._handleSseStream(l.body,{onresumptiontoken:o},!1);else if(h?.includes("application/json")){let m=await l.json(),g=Array.isArray(m)?m.map(A=>cG.parse(A)):[cG.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new xR(-1,`Unexpected content type: ${h}`);else await l.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new xR(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,r){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:r?.onresumptiontoken})}};var Eni=require("events");var ige=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},xMe=class{constructor(e){this._transport=null;this._emitter=new Eni.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._effectiveType=e.type,this._emitter.setMaxListeners(0),this._client=new yG({name:e.clientInfo.name,version:e.clientInfo.version},{capabilities:{}})}static{a(this,"HttpInvoker")}get isConnected(){return this._connected}async start(){if(this._connected)return;this._effectiveType=this._options.type;let e=!1,r=this._options.authProvider?["none","silent","interactive"]:["none"],n;for(let o=0;o{}),this._transport=null,!e&&s==="none"&&this._effectiveType==="http"){let u=uXs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!yni(l))throw l}}throw yni(n)?new ige:n instanceof Error?n:new Error("HttpInvoker.start exhausted retries without a recoverable error")}async _connectOnce(e){let r=new URL(this._options.url),n=this._effectiveType==="sse"?new rge(r,_ni(this._options.sseOptions,e)):new nge(r,_ni(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(j8,()=>{this._emitter.emit(El.ToolsListChanged)}),this._client.setNotificationHandler(Q8,()=>{this._emitter.emit(El.ResourcesListChanged)}),this._client.setNotificationHandler(q8,()=>{this._emitter.emit(El.PromptsListChanged)}),this._client.setNotificationHandler(mee,o=>{this._emitter.emit(El.LoggingMessage,o)}),await this._client.connect(n)}async stop(){if(!this._transport){this._connected=!1;return}this._transport=null,await this._client.close().catch(()=>{}),this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r,n){return this._client.callTool({name:e,arguments:r},CR,{...n,timeout:this._options.toolCallTimeoutMs,resetTimeoutOnProgress:n?.onprogress!==void 0})}listResources(){return this._client.listResources()}readResource(e){return this._client.readResource({uri:e})}listResourceTemplates(){return this._client.listResourceTemplates()}listPrompts(){return this._client.listPrompts()}getPrompt(e,r){return this._client.getPrompt({name:e,arguments:r})}async setLoggingLevel(e){await this._client.setLoggingLevel(e.level)}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}};function yni(t){if(t instanceof fy)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(yni,"isUnauthorized");function uXs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof xR||e.name==="StreamableHTTPError"))return;let n=typeof e.code=="number"?e.code:typeof e.status=="number"?e.status:void 0;if(!(n===void 0||n===401||n<400||n>=500))return n}a(uXs,"httpFallbackCode");function _ni(t,e){if(!e)return t;let r={...t?.requestInit??{}},n=new Headers(r.headers);return n.set("Authorization",`Bearer ${e}`),r.headers=Object.fromEntries(n.entries()),{...t,requestInit:r}}a(_ni,"withBearer");p();function Ldt(t){if(typeof t!="object"||t===null||t.jsonrpc!=="2.0"||typeof t.method!="string"||!("id"in t))return!1;let e=t.id;return typeof e=="string"||typeof e=="number"}a(Ldt,"isJsonRpcRequest");function vni(t){return typeof t=="object"&&t!==null&&t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}a(vni,"isJsonRpcNotification");var Kb={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603},Yb=class extends Error{constructor(r,n,o){super(n);this.code=r;this.data=o;this.name="JsonRpcError"}static{a(this,"JsonRpcError")}};p();var oge="Blocked by your organization's MCP allowlist";function pgr(t,e){let r=e?.denied;return r!==void 0&&r.length>0&&fXs(t,r)?{allowed:!1,reason:`${oge}: the server matches your organization's MCP denylist.`}:dXs(t,e?.allowed)}a(pgr,"evaluateMcpAllowlist");function dXs(t,e){if(e===void 0)return{allowed:!0};if(e.length===0)return{allowed:!1,reason:`${oge}: the allowlist permits no servers.`};let r=bni(t,e);return r.matched?{allowed:!0}:{allowed:!1,reason:pXs(t,r.failure)}}a(dXs,"evaluateAllow");function fXs(t,e){return bni(t,e).matched}a(fXs,"matchesAnyEntry");function bni(t,e){let r=t.transport;if(r.kind==="stdio"){let o=e.filter(mXs);return o.length>0?o.some(s=>AXs(r.command,s.serverCommand))?{matched:!0}:{matched:!1,failure:"command-mismatch"}:Cni(t.name,e)}let n=e.filter(hXs);return n.length>0?n.some(o=>vXs(r.url,o.serverUrl))?{matched:!0}:{matched:!1,failure:"url-mismatch"}:Cni(t.name,e)}a(bni,"classifyMatch");function Cni(t,e){let r=e.filter(gXs);return r.length===0?{matched:!1,failure:"no-applicable-rules"}:r.some(n=>n.serverName===t)?{matched:!0}:{matched:!1,failure:"name-mismatch"}}a(Cni,"classifyNameFallback");function pXs(t,e){switch(e){case"command-mismatch":return`${oge}: the server command does not match any allowed server command.`;case"url-mismatch":{let{transport:r}=t,n=r.kind==="stdio"?t.name:r.url;return`${oge}: "${n}" does not match any allowed server URL.`}case"name-mismatch":return`${oge}: "${t.name}" does not match any allowed server name.`;case"no-applicable-rules":return`${oge}: the allowlist has no rules that apply to "${t.name}".`}}a(pXs,"allowFailureReason");function hXs(t){return"serverUrl"in t}a(hXs,"isUrlEntry");function mXs(t){return"serverCommand"in t}a(mXs,"isCommandEntry");function gXs(t){return"serverName"in t}a(gXs,"isNameEntry");function AXs(t,e){return t.length===e.length&&t.every((r,n)=>r===e[n])}a(AXs,"commandsEqual");function yXs(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(yXs,"escapeRegExp");function Sni(t){return t.toLowerCase().replace(/\.$/,"")}a(Sni,"normalizeHost");function wMe(t,e){let r=t.split("*").map(yXs).join(".*");return new RegExp(`^${r}$`).test(e)}a(wMe,"componentMatches");function _Xs(t){let e;try{e=new URL(t)}catch{return}return{scheme:e.protocol.replace(/:$/,"").toLowerCase(),host:Sni(e.hostname),port:e.port,path:e.pathname||"/",search:e.search}}a(_Xs,"parseUrlParts");function EXs(t){let e=t.indexOf("://");if(e<0)return;let r=t.slice(0,e).toLowerCase(),n=t.slice(e+3),o=n.search(/[/?#]/),s=o<0?n:n.slice(0,o),c=o<0?"":n.slice(o),l=s,u="",d=s.lastIndexOf(":");d>=0&&(l=s.slice(0,d),u=s.slice(d+1));let f=c.split("#",1)[0],h=f.indexOf("?"),m=h<0?f:f.slice(0,h),g=h<0?"":f.slice(h);return{scheme:r,host:Sni(l),port:u,path:m,search:g}}a(EXs,"parsePatternParts");function vXs(t,e){let r=_Xs(t),n=EXs(e);if(!n)return r===void 0?!1:wMe(e,t);if(!r||!wMe(n.scheme,r.scheme)||!wMe(n.host,r.host))return!1;if(n.port===""){if(r.port!=="")return!1}else if(!wMe(n.port,r.port))return!1;return!(n.path!==""&&!wMe(n.path,r.path)||n.search!==""&&n.search!==r.search)}a(vXs,"urlMatchesPattern");p();p();p();var hD=class{static{a(this,"McpRuntimeNotifier")}},Bdt=class extends hD{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var ur=new pe("CopilotMCP");async function hgr(t,e){await t.get(hD).notifyLog(e)}a(hgr,"notifyMCPRuntimeLog");async function Sd(t,e){await hgr(t,{...e,level:"error"})}a(Sd,"notifyMCPRuntimeError");async function mD(t,e){await hgr(t,{...e,level:"warning"})}a(mD,"notifyMCPRuntimeWarning");async function la(t,e){await hgr(t,{...e,level:"info"})}a(la,"notifyMCPRuntimeInfo");p();p();p();async function Nee(t,e,r,n,o){return await t.get(Jt).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(Nee,"fetchOauthServer");async function mgr(t){try{return await t.text()}catch{return t.statusText}}a(mgr,"getErrText");p();var Tni="/.well-known",ggr=`${Tni}/oauth-protected-resource`,Ini=`${Tni}/oauth-authorization-server`,xni=" ";function wni(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a(wni,"isAuthorizationProtectedResourceMetadata");function Rni(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(Rni,"isAuthorizationServerMetadata");function Fdt(t){let e=t.split(" "),r=e[0],n={};return e.length>1&&e.slice(1).join(" ").split(",").forEach(s=>{let[c,l]=s.split("=").map(u=>u.trim().replace(/"/g,""));n[c]=l}),{scheme:r,params:n}}a(Fdt,"parseWWWAuthenticateHeader");function kni(t){let e=new URL(t.issuer);return{...t,authorization_endpoint:t.authorization_endpoint??new URL("/authorize",e).toString(),token_endpoint:t.token_endpoint??new URL("/token",e).toString(),registration_endpoint:t.registration_endpoint??new URL("/register",e).toString()}}a(kni,"getMetadataWithDefaultValues");function Pni(t){return{issuer:t.toString(),authorization_endpoint:new URL("/authorize",t).toString(),token_endpoint:new URL("/token",t).toString(),registration_endpoint:new URL("/register",t).toString(),response_types_supported:["code","id_token","id_token token"]}}a(Pni,"getDefaultMetadataForUrl");function Dni(t){let e=new URL(t);if(!e.pathname.startsWith(ggr))throw new Error(`Invalid discovery URL: expected path to start with ${ggr}`);let r=e.pathname.substring(ggr.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(Dni,"getResourceServerBaseUrlFromDiscoveryUrl");function Nni(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(Nni,"isAuthorizationDynamicClientRegistrationResponse");function Udt(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a(Udt,"isAuthorizationTokenResponse");function Agr(t){let e=t.split(".");if(e.length!==3)throw new Error("Invalid JWT token format: token must have three parts separated by dots");let[r,n,o]=e;try{if(typeof JSON.parse(Jzt(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(Jzt(n));if(typeof c!="object")throw new Error("Invalid JWT token format: payload is not a JSON object");return c}catch(s){throw s instanceof Error?new Error(`Failed to parse JWT token: ${s.message}`):new Error("Failed to parse JWT token")}}a(Agr,"getClaimsFromJWT");var ygr=class{static{a(this,"AuthMetadata")}},sge=class extends ygr{static{a(this,"MCPAuthMetadata")}constructor(e){super(),this.ctx=e}async getMetadataFromOriginalUrl(e,r){let n=await this.getResourceMetadataChallenge(e),o,s,c,l=await this.getResourceMetadata(n,{url:e,headers:r??{}});l.resource&&(o=l.authorization_servers?.[0],s=l.scopes_supported,c=l);let u=new URL(e).origin,d={};o||(o=u,d=r??{});let f;try{let m=await this.getAuthorizationServerMetadata(o,d),g=kni(m);return f={authorizationServer:o,serverMetadata:g,resourceMetadata:c},ur.info(this.ctx,"authMetadata",f),f}catch(m){ur.warn(this.ctx,`Error populating auth metadata: ${String(m)}`)}let h=Pni(new URL(u));return h.scopes_supported=s??h.scopes_supported??[],f={authorizationServer:o,serverMetadata:h,resourceMetadata:c},f}async getResourceMetadataChallenge(e){let r=await Nee(this.ctx,e,"POST"),n;if(r.status===401&&r.headers.has("WWW-Authenticate")){let o=r.headers.get("WWW-Authenticate"),{scheme:s,params:c}=Fdt(o);s==="Bearer"&&c.resource_metadata&&(n=c.resource_metadata)}return n}async getResourceMetadata(e,r){if(!e)return{resource:""};let n=new URL(e),o=new URL(r.url),s={};n.origin===o.origin&&(s=r.headers);let c=await Nee(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":_R});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await mgr(c)}`);let l=await c.json();if(wni(l)){let u=Dni(e),d=new URL(l.resource).toString(),f=new URL(u).toString();if(d!==f)throw new Error(`Protected Resource Metadata resource "${d}" does not match MCP server resolved resource "${f}". The MCP server must follow OAuth spec https://datatracker.ietf.org/doc/html/rfc9728#PRConfigurationValidation`);return l}else throw new Error(`Invalid resource metadata: ${JSON.stringify(l)}`)}async getAuthorizationServerMetadata(e,r){let n=new URL(e),o=n.pathname==="/"?"":n.pathname,s=new URL(Ini,e).toString()+o,c=await Nee(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":_R});if(c.status!==200&&(c=await Nee(this.ctx,Oa(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":_R}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await mgr(c)}`);let l=await c.json();if(Rni(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var Jb=class{static{a(this,"McpAuthService")}};var D4=new pe("mcpGateway");async function Mni(t,e,r){D4.info(t,`OAuth discovery: probing ${e}`);try{let n=await new sge(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return D4.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),sr(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){D4.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),Hs(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(Mni,"discoverAuthMetadata");async function Qdt(t,e,r,n){let o=e.getOrActivateProviderIdForServer(r.authorizationServer);if(!o){let l=e.createAuthenticationProvider(r.authorizationServer,r.serverMetadata,r.resourceMetadata);if(l||(l=await e.createDynamicAuthenticationProvider(r.authorizationServer,r.serverMetadata,r.resourceMetadata)),!l)throw new Error(`Failed to create auth provider for ${r.authorizationServer}`);o=l.id}let s=await e.getSessions(o,r.scopes,{authorizationServer:r.authorizationServer},!0),c=Lni(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return sr(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return sr(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(Qdt,"acquireSilent");async function Oni(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=CXs(t),d=Lni(t);if(c.length>0&&u){let f="Sign in to another account";try{let h=c.map(g=>({title:g.account.label}));h.push({title:f}),h.push({title:"Cancel"});let m=await u.showInformationModal(`The MCP server ${o} wants to access a ${l.label} account. Select an account for ${o} to use.`,...h);if(!m||m.title==="Cancel"){D4.warn(t,`mount '${o}': user cancelled the account selection`),sr(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){D4.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),sr(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}sr(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){D4.error(t,`mount '${o}': failed during account selection`,h),Hs(t,"mcpGateway.oauth.picker",h,{result:"failed"});return}}else if(c.length===0&&u)try{if((await u.showInformationModal(`The MCP Server Definition '${s}' wants to authenticate to ${l.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){D4.warn(t,`mount '${o}': user declined OAuth confirmation`),sr(t,"mcpGateway.oauth.interactive",{result:"declined"});return}sr(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){D4.error(t,`mount '${o}': failed to show auth confirmation`,f),Hs(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||D4.debug(t,`mount '${o}': no NotificationSender, skipping UI gates`);try{let f=await l.createSession(r.scopes,{});return d?.updateAccountPreference(o,n,f.account),u&&u.showInformationMessageOnlyOnce(`mcpGateway:auth-success:${n}`,`You have authenticated with ${l.label}.`),sr(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){D4.error(t,`Interactive OAuth failed for ${r.authorizationServer}`,f),u&&u.showWarningMessageOnlyOnce(`mcpGateway:auth-fail:${n}`,`Authentication failed. You need to restart the IDE to authenticate the MCP server again. ${f instanceof Error?f.message:String(f)}`),Hs(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(Oni,"acquireInteractive");function CXs(t){try{return t.get(ss)}catch{return}}a(CXs,"tryGetNotificationSender");function Lni(t){try{return t.get(Jb)}catch{return}}a(Lni,"tryGetMcpAuthService");p();var gD=new pe("mcpGateway"),kMe="Copilot MCP Gateway",PMe="0.1.0",RMe=class{constructor(e,r,n,o){this.id=e;this._ctx=r;this._invoker=n;this._onDidDispose=o;this._sseClients=new Set;this._inFlightToolCalls=new Map;this._lastEventId=0;this._isInitialized=!1;this._disposed=!1;this._onToolsListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/tools/list_changed"}),this._onResourcesListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/resources/list_changed"}),this._onPromptsListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/prompts/list_changed"}),this._onLoggingMessage=s=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/message",params:s.params}),this._invoker.on(El.ToolsListChanged,this._onToolsListChanged),this._invoker.on(El.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(El.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(El.LoggingMessage,this._onLoggingMessage)}static{a(this,"McpGatewaySession")}attachSseClient(e){if(this._disposed){e.writeHead(410),e.end();return}e.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}),e.write(`: connected +`&&n++}}return[e,r]}a(cXs,"splitLines");var Ddt=class extends Event{static{a(this,"ErrorEvent")}constructor(e,r){var n,o;super(e),this.code=(n=r?.code)!=null?n:void 0,this.message=(o=r?.message)!=null?o:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,r,n){return n(Ani(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e(Ani(this),r)}};function lXs(t){let e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}a(lXs,"syntaxError");function ogr(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(ogr).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${ogr(t.cause)}`:t.message:`${t}`}a(ogr,"flattenError");function Ani(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}a(Ani,"inspectableError");var _ni=a(t=>{throw TypeError(t)},"__typeError"),pgr=a((t,e,r)=>e.has(t)||_ni("Cannot "+r),"__accessCheck"),ca=a((t,e,r)=>(pgr(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),Pg=a((t,e,r)=>e.has(t)?_ni("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),sf=a((t,e,r,n)=>(pgr(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),K8=a((t,e,r)=>(pgr(t,e,"access private method"),r),"__privateMethod"),zb,Dee,Kme,Pdt,Ndt,SMe,Xme,TMe,EG,Jme,ege,Zme,CMe,pD,sgr,agr,cgr,yni,lgr,ugr,bMe,dgr,fgr,Nee=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),Pg(this,pD),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Pg(this,zb),Pg(this,Dee),Pg(this,Kme),Pg(this,Pdt),Pg(this,Ndt),Pg(this,SMe),Pg(this,Xme),Pg(this,TMe,null),Pg(this,EG),Pg(this,Jme),Pg(this,ege,null),Pg(this,Zme,null),Pg(this,CMe,null),Pg(this,agr,async s=>{var c;ca(this,Jme).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){K8(this,pD,bMe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?sf(this,Kme,new URL(s.url)):sf(this,Kme,void 0),d!==200){K8(this,pD,bMe).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){K8(this,pD,bMe).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(ca(this,zb)===this.CLOSED)return;sf(this,zb,this.OPEN);let h=new Event("open");if((c=ca(this,CMe))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){K8(this,pD,bMe).call(this,"Invalid response body, expected a web ReadableStream",d),this.close();return}let m=new TextDecoder,g=l.getReader(),A=!0;do{let{done:y,value:_}=await g.read();_&&ca(this,Jme).feed(m.decode(_,{stream:!y})),y&&(A=!1,ca(this,Jme).reset(),K8(this,pD,dgr).call(this))}while(A)}),Pg(this,cgr,s=>{sf(this,EG,void 0),!(s.name==="AbortError"||s.type==="aborted")&&K8(this,pD,dgr).call(this,ogr(s))}),Pg(this,lgr,s=>{typeof s.id=="string"&&sf(this,TMe,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:ca(this,Kme)?ca(this,Kme).origin:ca(this,Dee).origin,lastEventId:s.id||""});ca(this,Zme)&&(!s.event||s.event==="message")&&ca(this,Zme).call(this,c),this.dispatchEvent(c)}),Pg(this,ugr,s=>{sf(this,SMe,s)}),Pg(this,fgr,()=>{sf(this,Xme,void 0),ca(this,zb)===this.CONNECTING&&K8(this,pD,sgr).call(this)});try{if(e instanceof URL)sf(this,Dee,e);else if(typeof e=="string")sf(this,Dee,new URL(e,uXs()));else throw new Error("Invalid URL")}catch{throw lXs("An invalid or illegal string was specified")}sf(this,Jme,kdt({onEvent:ca(this,lgr),onRetry:ca(this,ugr)})),sf(this,zb,this.CONNECTING),sf(this,SMe,3e3),sf(this,Ndt,(n=r?.fetch)!=null?n:globalThis.fetch),sf(this,Pdt,(o=r?.withCredentials)!=null?o:!1),K8(this,pD,sgr).call(this)}get readyState(){return ca(this,zb)}get url(){return ca(this,Dee).href}get withCredentials(){return ca(this,Pdt)}get onerror(){return ca(this,ege)}set onerror(e){sf(this,ege,e)}get onmessage(){return ca(this,Zme)}set onmessage(e){sf(this,Zme,e)}get onopen(){return ca(this,CMe)}set onopen(e){sf(this,CMe,e)}addEventListener(e,r,n){let o=r;super.addEventListener(e,o,n)}removeEventListener(e,r,n){let o=r;super.removeEventListener(e,o,n)}close(){ca(this,Xme)&&clearTimeout(ca(this,Xme)),ca(this,zb)!==this.CLOSED&&(ca(this,EG)&&ca(this,EG).abort(),sf(this,zb,this.CLOSED),sf(this,EG,void 0))}};zb=new WeakMap,Dee=new WeakMap,Kme=new WeakMap,Pdt=new WeakMap,Ndt=new WeakMap,SMe=new WeakMap,Xme=new WeakMap,TMe=new WeakMap,EG=new WeakMap,Jme=new WeakMap,ege=new WeakMap,Zme=new WeakMap,CMe=new WeakMap,pD=new WeakSet,sgr=a(function(){sf(this,zb,this.CONNECTING),sf(this,EG,new AbortController),ca(this,Ndt)(ca(this,Dee),K8(this,pD,yni).call(this)).then(ca(this,agr)).catch(ca(this,cgr))},"connect_fn"),agr=new WeakMap,cgr=new WeakMap,yni=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...ca(this,TMe)?{"Last-Event-ID":ca(this,TMe)}:void 0},cache:"no-store",signal:(t=ca(this,EG))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),lgr=new WeakMap,ugr=new WeakMap,bMe=a(function(t,e){var r;ca(this,zb)!==this.CLOSED&&sf(this,zb,this.CLOSED);let n=new Ddt("error",{code:e,message:t});(r=ca(this,ege))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),dgr=a(function(t,e){var r;if(ca(this,zb)===this.CLOSED)return;sf(this,zb,this.CONNECTING);let n=new Ddt("error",{code:e,message:t});(r=ca(this,ege))==null||r.call(this,n),this.dispatchEvent(n),sf(this,Xme,setTimeout(ca(this,fgr),ca(this,SMe)))},"scheduleReconnect_fn"),fgr=new WeakMap,Nee.CONNECTING=0,Nee.OPEN=1,Nee.CLOSED=2;function uXs(){let t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}a(uXs,"getBaseURL");p();function tge(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(tge,"normalizeHeaders");function Mdt(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{...tge(e.headers),...tge(n.headers)}:e.headers};return t(r,o)}:t}a(Mdt,"createFetchWithInit");var IMe=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},rge=class{static{a(this,"SSEClientTransport")}constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=Mdt(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fy("No auth provider");let e;try{e=await G8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new fy;return await this._startOrAuth()}async _commonHeaders(){let e={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=tge(this._requestInit?.headers);return new Headers({...e,...r})}_startOrAuth(){let e=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((r,n)=>{this._eventSource=new Nee(this._url.href,{...this._eventSourceInit,fetch:a(async(o,s)=>{let c=await this._commonHeaders();c.set("Accept","text/event-stream");let l=await e(o,{...s,headers:c});if(l.status===401&&l.headers.has("www-authenticate")){let{resourceMetadataUrl:u,scope:d}=kme(l);this._resourceMetadataUrl=u,this._scope=d}return l},"fetch")}),this._abortController=new AbortController,this._eventSource.onerror=o=>{if(o.code===401&&this._authProvider){this._authThenStart().then(r,n);return}let s=new IMe(o.code,o.message,o);n(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",o=>{let s=o;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(c){n(c),this.onerror?.(c),this.close();return}r()}),this._eventSource.onmessage=o=>{let s=o,c;try{c=lG.parse(JSON.parse(s.data))}catch(l){this.onerror?.(l);return}this.onmessage?.(c)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new fy("No auth provider");if(await G8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fy("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(e){if(!this._endpoint)throw new Error("Not connected");try{let r=await this._commonHeaders();r.set("content-type","application/json");let n={...this._requestInit,method:"POST",headers:r,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._endpoint,n);if(!o.ok){let s=await o.text().catch(()=>null);if(o.status===401&&this._authProvider){let{resourceMetadataUrl:c,scope:l}=kme(o);if(this._resourceMetadataUrl=c,this._scope=l,await G8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fy;return this.send(e)}throw new Error(`Error POSTing to endpoint (HTTP ${o.status}): ${s}`)}await o.body?.cancel()}catch(r){throw this.onerror?.(r),r}}setProtocolVersion(e){this._protocolVersion=e}};p();p();var Odt=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=kdt({onEvent:a(c=>{s.enqueue(c)},"onEvent"),onError(c){e==="terminate"?s.error(c):typeof e=="function"&&e(c)},onRetry:r,onComment:n})},transform(s){o.feed(s)}})}};var dXs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},xR=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},nge=class{static{a(this,"StreamableHTTPClientTransport")}constructor(e,r){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=Mdt(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??dXs}async _authThenStart(){if(!this._authProvider)throw new fy("No auth provider");let e;try{e=await G8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new fy;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=tge(this._requestInit?.headers);return new Headers({...e,...r})}async _startOrAuthSse(e){let{resumptionToken:r}=e;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new xR(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,e,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,e),o)}_scheduleReconnection(e,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(s=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${s instanceof Error?s.message:String(s)}`)),this._scheduleReconnection(e,r+1)})},o)}_handleSseStream(e,r,n){if(!e)return;let{onresumptiontoken:o,replayMessageId:s}=r,c,l=!1,u=!1;a(async()=>{try{let f=e.pipeThrough(new TextDecoderStream).pipeThrough(new Odt({onRetry:a(g=>{this._serverRetryMs=g},"onRetry")})).getReader();for(;;){let{value:g,done:A}=await f.read();if(A)break;if(g.id&&(c=g.id,l=!0,o?.(g.id)),!!g.data&&(!g.event||g.event==="message"))try{let y=lG.parse(JSON.parse(g.data));pee(y)&&(u=!0,s!==void 0&&(y.id=s)),this.onmessage?.(y)}catch(y){this.onerror?.(y)}}(n||l)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:c,onresumptiontoken:o,replayMessageId:s},0)}catch(f){if(this.onerror?.(new Error(`SSE stream disconnected: ${f}`)),(n||l)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:c,onresumptiontoken:o,replayMessageId:s},0)}catch(g){this.onerror?.(new Error(`Failed to reconnect: ${g instanceof Error?g.message:String(g)}`))}}},"processStream")()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new fy("No auth provider");if(await G8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fy("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:TNe(e)?e.id:void 0}).catch(m=>this.onerror?.(m));return}let s=await this._commonHeaders();s.set("content-type","application/json"),s.set("accept","application/json, text/event-stream");let c={...this._requestInit,method:"POST",headers:s,body:JSON.stringify(e),signal:this._abortController?.signal},l=await(this._fetch??fetch)(this._url,c),u=l.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!l.ok){let m=await l.text().catch(()=>null);if(l.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new xR(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=kme(l);if(this._resourceMetadataUrl=g,this._scope=A,await G8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fy;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=kme(l);if(y==="insufficient_scope"){let _=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===_)throw new xR(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=_??void 0,await G8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new fy;return this.send(e)}}throw new xR(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),JXn(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(m=>this.onerror?.(m));return}let f=(Array.isArray(e)?e:[e]).filter(m=>"method"in m&&"id"in m&&m.id!==void 0).length>0,h=l.headers.get("content-type");if(f)if(h?.includes("text/event-stream"))this._handleSseStream(l.body,{onresumptiontoken:o},!1);else if(h?.includes("application/json")){let m=await l.json(),g=Array.isArray(m)?m.map(A=>lG.parse(A)):[lG.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new xR(-1,`Unexpected content type: ${h}`);else await l.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new xR(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,r){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:r?.onresumptiontoken})}};var Cni=require("events");var ige=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},xMe=class{constructor(e){this._transport=null;this._emitter=new Cni.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._effectiveType=e.type,this._emitter.setMaxListeners(0),this._client=new _G({name:e.clientInfo.name,version:e.clientInfo.version},{capabilities:{}})}static{a(this,"HttpInvoker")}get isConnected(){return this._connected}async start(){if(this._connected)return;this._effectiveType=this._options.type;let e=!1,r=this._options.authProvider?["none","silent","interactive"]:["none"],n;for(let o=0;o{}),this._transport=null,!e&&s==="none"&&this._effectiveType==="http"){let u=fXs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!Eni(l))throw l}}throw Eni(n)?new ige:n instanceof Error?n:new Error("HttpInvoker.start exhausted retries without a recoverable error")}async _connectOnce(e){let r=new URL(this._options.url),n=this._effectiveType==="sse"?new rge(r,vni(this._options.sseOptions,e)):new nge(r,vni(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(j8,()=>{this._emitter.emit(El.ToolsListChanged)}),this._client.setNotificationHandler(Q8,()=>{this._emitter.emit(El.ResourcesListChanged)}),this._client.setNotificationHandler(q8,()=>{this._emitter.emit(El.PromptsListChanged)}),this._client.setNotificationHandler(gee,o=>{this._emitter.emit(El.LoggingMessage,o)}),await this._client.connect(n)}async stop(){if(!this._transport){this._connected=!1;return}this._transport=null,await this._client.close().catch(()=>{}),this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r,n){return this._client.callTool({name:e,arguments:r},CR,{...n,timeout:this._options.toolCallTimeoutMs,resetTimeoutOnProgress:n?.onprogress!==void 0})}listResources(){return this._client.listResources()}readResource(e){return this._client.readResource({uri:e})}listResourceTemplates(){return this._client.listResourceTemplates()}listPrompts(){return this._client.listPrompts()}getPrompt(e,r){return this._client.getPrompt({name:e,arguments:r})}async setLoggingLevel(e){await this._client.setLoggingLevel(e.level)}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}};function Eni(t){if(t instanceof fy)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(Eni,"isUnauthorized");function fXs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof xR||e.name==="StreamableHTTPError"))return;let n=typeof e.code=="number"?e.code:typeof e.status=="number"?e.status:void 0;if(!(n===void 0||n===401||n<400||n>=500))return n}a(fXs,"httpFallbackCode");function vni(t,e){if(!e)return t;let r={...t?.requestInit??{}},n=new Headers(r.headers);return n.set("Authorization",`Bearer ${e}`),r.headers=Object.fromEntries(n.entries()),{...t,requestInit:r}}a(vni,"withBearer");p();function Ldt(t){if(typeof t!="object"||t===null||t.jsonrpc!=="2.0"||typeof t.method!="string"||!("id"in t))return!1;let e=t.id;return typeof e=="string"||typeof e=="number"}a(Ldt,"isJsonRpcRequest");function bni(t){return typeof t=="object"&&t!==null&&t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}a(bni,"isJsonRpcNotification");var Kb={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603},Yb=class extends Error{constructor(r,n,o){super(n);this.code=r;this.data=o;this.name="JsonRpcError"}static{a(this,"JsonRpcError")}};p();var oge="Blocked by your organization's MCP allowlist";function hgr(t,e){let r=e?.denied;return r!==void 0&&r.length>0&&hXs(t,r)?{allowed:!1,reason:`${oge}: the server matches your organization's MCP denylist.`}:pXs(t,e?.allowed)}a(hgr,"evaluateMcpAllowlist");function pXs(t,e){if(e===void 0)return{allowed:!0};if(e.length===0)return{allowed:!1,reason:`${oge}: the allowlist permits no servers.`};let r=Tni(t,e);return r.matched?{allowed:!0}:{allowed:!1,reason:mXs(t,r.failure)}}a(pXs,"evaluateAllow");function hXs(t,e){return Tni(t,e).matched}a(hXs,"matchesAnyEntry");function Tni(t,e){let r=t.transport;if(r.kind==="stdio"){let o=e.filter(AXs);return o.length>0?o.some(s=>_Xs(r.command,s.serverCommand))?{matched:!0}:{matched:!1,failure:"command-mismatch"}:Sni(t.name,e)}let n=e.filter(gXs);return n.length>0?n.some(o=>bXs(r.url,o.serverUrl))?{matched:!0}:{matched:!1,failure:"url-mismatch"}:Sni(t.name,e)}a(Tni,"classifyMatch");function Sni(t,e){let r=e.filter(yXs);return r.length===0?{matched:!1,failure:"no-applicable-rules"}:r.some(n=>n.serverName===t)?{matched:!0}:{matched:!1,failure:"name-mismatch"}}a(Sni,"classifyNameFallback");function mXs(t,e){switch(e){case"command-mismatch":return`${oge}: the server command does not match any allowed server command.`;case"url-mismatch":{let{transport:r}=t,n=r.kind==="stdio"?t.name:r.url;return`${oge}: "${n}" does not match any allowed server URL.`}case"name-mismatch":return`${oge}: "${t.name}" does not match any allowed server name.`;case"no-applicable-rules":return`${oge}: the allowlist has no rules that apply to "${t.name}".`}}a(mXs,"allowFailureReason");function gXs(t){return"serverUrl"in t}a(gXs,"isUrlEntry");function AXs(t){return"serverCommand"in t}a(AXs,"isCommandEntry");function yXs(t){return"serverName"in t}a(yXs,"isNameEntry");function _Xs(t,e){return t.length===e.length&&t.every((r,n)=>r===e[n])}a(_Xs,"commandsEqual");function EXs(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(EXs,"escapeRegExp");function Ini(t){return t.toLowerCase().replace(/\.$/,"")}a(Ini,"normalizeHost");function wMe(t,e){let r=t.split("*").map(EXs).join(".*");return new RegExp(`^${r}$`).test(e)}a(wMe,"componentMatches");function vXs(t){let e;try{e=new URL(t)}catch{return}return{scheme:e.protocol.replace(/:$/,"").toLowerCase(),host:Ini(e.hostname),port:e.port,path:e.pathname||"/",search:e.search}}a(vXs,"parseUrlParts");function CXs(t){let e=t.indexOf("://");if(e<0)return;let r=t.slice(0,e).toLowerCase(),n=t.slice(e+3),o=n.search(/[/?#]/),s=o<0?n:n.slice(0,o),c=o<0?"":n.slice(o),l=s,u="",d=s.lastIndexOf(":");d>=0&&(l=s.slice(0,d),u=s.slice(d+1));let f=c.split("#",1)[0],h=f.indexOf("?"),m=h<0?f:f.slice(0,h),g=h<0?"":f.slice(h);return{scheme:r,host:Ini(l),port:u,path:m,search:g}}a(CXs,"parsePatternParts");function bXs(t,e){let r=vXs(t),n=CXs(e);if(!n)return r===void 0?!1:wMe(e,t);if(!r||!wMe(n.scheme,r.scheme)||!wMe(n.host,r.host))return!1;if(n.port===""){if(r.port!=="")return!1}else if(!wMe(n.port,r.port))return!1;return!(n.path!==""&&!wMe(n.path,r.path)||n.search!==""&&n.search!==r.search)}a(bXs,"urlMatchesPattern");p();p();p();var hD=class{static{a(this,"McpRuntimeNotifier")}},Bdt=class extends hD{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var ur=new pe("CopilotMCP");async function mgr(t,e){await t.get(hD).notifyLog(e)}a(mgr,"notifyMCPRuntimeLog");async function Td(t,e){await mgr(t,{...e,level:"error"})}a(Td,"notifyMCPRuntimeError");async function mD(t,e){await mgr(t,{...e,level:"warning"})}a(mD,"notifyMCPRuntimeWarning");async function la(t,e){await mgr(t,{...e,level:"info"})}a(la,"notifyMCPRuntimeInfo");p();p();p();async function Mee(t,e,r,n,o){return await t.get(Jt).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(Mee,"fetchOauthServer");async function ggr(t){try{return await t.text()}catch{return t.statusText}}a(ggr,"getErrText");p();var xni="/.well-known",Agr=`${xni}/oauth-protected-resource`,wni=`${xni}/oauth-authorization-server`,Rni=" ";function kni(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a(kni,"isAuthorizationProtectedResourceMetadata");function Pni(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(Pni,"isAuthorizationServerMetadata");function Fdt(t){let e=t.split(" "),r=e[0],n={};return e.length>1&&e.slice(1).join(" ").split(",").forEach(s=>{let[c,l]=s.split("=").map(u=>u.trim().replace(/"/g,""));n[c]=l}),{scheme:r,params:n}}a(Fdt,"parseWWWAuthenticateHeader");function Dni(t){let e=new URL(t.issuer);return{...t,authorization_endpoint:t.authorization_endpoint??new URL("/authorize",e).toString(),token_endpoint:t.token_endpoint??new URL("/token",e).toString(),registration_endpoint:t.registration_endpoint??new URL("/register",e).toString()}}a(Dni,"getMetadataWithDefaultValues");function Nni(t){return{issuer:t.toString(),authorization_endpoint:new URL("/authorize",t).toString(),token_endpoint:new URL("/token",t).toString(),registration_endpoint:new URL("/register",t).toString(),response_types_supported:["code","id_token","id_token token"]}}a(Nni,"getDefaultMetadataForUrl");function Mni(t){let e=new URL(t);if(!e.pathname.startsWith(Agr))throw new Error(`Invalid discovery URL: expected path to start with ${Agr}`);let r=e.pathname.substring(Agr.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(Mni,"getResourceServerBaseUrlFromDiscoveryUrl");function Oni(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(Oni,"isAuthorizationDynamicClientRegistrationResponse");function Udt(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a(Udt,"isAuthorizationTokenResponse");function ygr(t){let e=t.split(".");if(e.length!==3)throw new Error("Invalid JWT token format: token must have three parts separated by dots");let[r,n,o]=e;try{if(typeof JSON.parse(Zzt(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(Zzt(n));if(typeof c!="object")throw new Error("Invalid JWT token format: payload is not a JSON object");return c}catch(s){throw s instanceof Error?new Error(`Failed to parse JWT token: ${s.message}`):new Error("Failed to parse JWT token")}}a(ygr,"getClaimsFromJWT");var _gr=class{static{a(this,"AuthMetadata")}},sge=class extends _gr{static{a(this,"MCPAuthMetadata")}constructor(e){super(),this.ctx=e}async getMetadataFromOriginalUrl(e,r){let n=await this.getResourceMetadataChallenge(e),o,s,c,l=await this.getResourceMetadata(n,{url:e,headers:r??{}});l.resource&&(o=l.authorization_servers?.[0],s=l.scopes_supported,c=l);let u=new URL(e).origin,d={};o||(o=u,d=r??{});let f;try{let m=await this.getAuthorizationServerMetadata(o,d),g=Dni(m);return f={authorizationServer:o,serverMetadata:g,resourceMetadata:c},ur.info(this.ctx,"authMetadata",f),f}catch(m){ur.warn(this.ctx,`Error populating auth metadata: ${String(m)}`)}let h=Nni(new URL(u));return h.scopes_supported=s??h.scopes_supported??[],f={authorizationServer:o,serverMetadata:h,resourceMetadata:c},f}async getResourceMetadataChallenge(e){let r=await Mee(this.ctx,e,"POST"),n;if(r.status===401&&r.headers.has("WWW-Authenticate")){let o=r.headers.get("WWW-Authenticate"),{scheme:s,params:c}=Fdt(o);s==="Bearer"&&c.resource_metadata&&(n=c.resource_metadata)}return n}async getResourceMetadata(e,r){if(!e)return{resource:""};let n=new URL(e),o=new URL(r.url),s={};n.origin===o.origin&&(s=r.headers);let c=await Mee(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":_R});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await ggr(c)}`);let l=await c.json();if(kni(l)){let u=Mni(e),d=new URL(l.resource).toString(),f=new URL(u).toString();if(d!==f)throw new Error(`Protected Resource Metadata resource "${d}" does not match MCP server resolved resource "${f}". The MCP server must follow OAuth spec https://datatracker.ietf.org/doc/html/rfc9728#PRConfigurationValidation`);return l}else throw new Error(`Invalid resource metadata: ${JSON.stringify(l)}`)}async getAuthorizationServerMetadata(e,r){let n=new URL(e),o=n.pathname==="/"?"":n.pathname,s=new URL(wni,e).toString()+o,c=await Mee(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":_R});if(c.status!==200&&(c=await Mee(this.ctx,Oa(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":_R}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await ggr(c)}`);let l=await c.json();if(Pni(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var Jb=class{static{a(this,"McpAuthService")}};var D4=new pe("mcpGateway");async function Lni(t,e,r){D4.info(t,`OAuth discovery: probing ${e}`);try{let n=await new sge(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return D4.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),sr(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){D4.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),Hs(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(Lni,"discoverAuthMetadata");async function Qdt(t,e,r,n){let o=e.getOrActivateProviderIdForServer(r.authorizationServer);if(!o){let l=e.createAuthenticationProvider(r.authorizationServer,r.serverMetadata,r.resourceMetadata);if(l||(l=await e.createDynamicAuthenticationProvider(r.authorizationServer,r.serverMetadata,r.resourceMetadata)),!l)throw new Error(`Failed to create auth provider for ${r.authorizationServer}`);o=l.id}let s=await e.getSessions(o,r.scopes,{authorizationServer:r.authorizationServer},!0),c=Fni(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return sr(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return sr(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(Qdt,"acquireSilent");async function Bni(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=SXs(t),d=Fni(t);if(c.length>0&&u){let f="Sign in to another account";try{let h=c.map(g=>({title:g.account.label}));h.push({title:f}),h.push({title:"Cancel"});let m=await u.showInformationModal(`The MCP server ${o} wants to access a ${l.label} account. Select an account for ${o} to use.`,...h);if(!m||m.title==="Cancel"){D4.warn(t,`mount '${o}': user cancelled the account selection`),sr(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){D4.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),sr(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}sr(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){D4.error(t,`mount '${o}': failed during account selection`,h),Hs(t,"mcpGateway.oauth.picker",h,{result:"failed"});return}}else if(c.length===0&&u)try{if((await u.showInformationModal(`The MCP Server Definition '${s}' wants to authenticate to ${l.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){D4.warn(t,`mount '${o}': user declined OAuth confirmation`),sr(t,"mcpGateway.oauth.interactive",{result:"declined"});return}sr(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){D4.error(t,`mount '${o}': failed to show auth confirmation`,f),Hs(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||D4.debug(t,`mount '${o}': no NotificationSender, skipping UI gates`);try{let f=await l.createSession(r.scopes,{});return d?.updateAccountPreference(o,n,f.account),u&&u.showInformationMessageOnlyOnce(`mcpGateway:auth-success:${n}`,`You have authenticated with ${l.label}.`),sr(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){D4.error(t,`Interactive OAuth failed for ${r.authorizationServer}`,f),u&&u.showWarningMessageOnlyOnce(`mcpGateway:auth-fail:${n}`,`Authentication failed. You need to restart the IDE to authenticate the MCP server again. ${f instanceof Error?f.message:String(f)}`),Hs(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(Bni,"acquireInteractive");function SXs(t){try{return t.get(ss)}catch{return}}a(SXs,"tryGetNotificationSender");function Fni(t){try{return t.get(Jb)}catch{return}}a(Fni,"tryGetMcpAuthService");p();var gD=new pe("mcpGateway"),kMe="Copilot MCP Gateway",PMe="0.1.0",RMe=class{constructor(e,r,n,o){this.id=e;this._ctx=r;this._invoker=n;this._onDidDispose=o;this._sseClients=new Set;this._inFlightToolCalls=new Map;this._lastEventId=0;this._isInitialized=!1;this._disposed=!1;this._onToolsListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/tools/list_changed"}),this._onResourcesListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/resources/list_changed"}),this._onPromptsListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/prompts/list_changed"}),this._onLoggingMessage=s=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/message",params:s.params}),this._invoker.on(El.ToolsListChanged,this._onToolsListChanged),this._invoker.on(El.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(El.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(El.LoggingMessage,this._onLoggingMessage)}static{a(this,"McpGatewaySession")}attachSseClient(e){if(this._disposed){e.writeHead(410),e.end();return}e.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}),e.write(`: connected -`),this._sseClients.add(e),gD.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),gD.debug(this._ctx,`[session ${this.id}] SSE client detached (total: ${this._sseClients.size})`)})}async handleIncoming(e){let r=Array.isArray(e)?e:[e],n=[];for(let o of r)Ldt(o)?n.push(await this._dispatchRequest(o)):vni(o)?this._dispatchNotification(o):gD.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0;for(let e of this._inFlightToolCalls.values())e.abort("MCP gateway session disposed");this._inFlightToolCalls.clear(),gD.info(this._ctx,`[session ${this.id}] disposing (SSE clients: ${this._sseClients.size})`);for(let e of this._sseClients)e.destroyed||e.end();this._sseClients.clear(),this._invoker.off(El.ToolsListChanged,this._onToolsListChanged),this._invoker.off(El.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(El.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(El.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){gD.debug(this._ctx,`[session ${this.id}] <-- request: ${e.method} (id=${String(e.id)})`);try{let r=await this._handleRequest(e);return{jsonrpc:"2.0",id:e.id,result:r}}catch(r){return r instanceof Yb?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(gD.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:Kb.InternalError,message:r instanceof Error?r.message:String(r)}})}}async _handleRequest(e){if(this._disposed)throw new Yb(Kb.InvalidRequest,"Session is disposed");if(e.method==="initialize")return this._handleInitialize(e);if(!this._isInitialized)throw new Yb(Kb.InvalidRequest,"Session is not initialized");switch(e.method){case"ping":return{};case"tools/list":return this._invoker.listTools();case"tools/call":return this._handleCallTool(e);case"resources/list":return this._invoker.listResources();case"resources/read":return this._handleReadResource(e);case"resources/templates/list":return this._invoker.listResourceTemplates();case"prompts/list":return this._invoker.listPrompts();case"prompts/get":return this._handleGetPrompt(e);case"logging/setLevel":return this._handleSetLoggingLevel(e);default:throw new Yb(Kb.MethodNotFound,`Method not found: ${e.method}`)}}_handleInitialize(e){let r=e.params&&typeof e.params=="object"?e.params:void 0,n=typeof r?.protocolVersion=="string"?r.protocolVersion:void 0,o=r?.clientInfo,s=n&&Dut.includes(n)?n:_R;return gD.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&gD.warn(this._ctx,`[session ${this.id}] unsupported client protocol version '${n}', falling back to '${s}'`),{protocolVersion:s,capabilities:{tools:{listChanged:!0},resources:{listChanged:!0},prompts:{listChanged:!0},logging:{}},serverInfo:{name:kMe,version:PMe}}}async _handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Yb(Kb.InvalidParams,"Missing tool name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{},o=r._meta&&typeof r._meta=="object"?r._meta:{},s=typeof o.progressToken=="string"||typeof o.progressToken=="number"?o.progressToken:void 0;if(this._inFlightToolCalls.has(e.id))throw new Yb(Kb.InvalidRequest,`Duplicate in-flight request id: ${String(e.id)}`);let c=new AbortController;this._inFlightToolCalls.set(e.id,c);try{return await this._invoker.callTool(r.name,n,{signal:c.signal,...s===void 0?{}:{onprogress:a(l=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/progress",params:{...l,progressToken:s}}),"onprogress")}})}catch(l){throw c.signal.aborted||Sd(this._ctx,{message:`Error calling tool ${r.name}: ${l instanceof Error?l.message:String(l)}`,server:this._invoker.label}),l}finally{this._inFlightToolCalls.get(e.id)===c&&this._inFlightToolCalls.delete(e.id)}}_handleReadResource(e){let r=this._requireObjectParams(e);if(typeof r.uri!="string")throw new Yb(Kb.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Yb(Kb.InvalidParams,"Missing prompt name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};return this._invoker.getPrompt(r.name,n)}async _handleSetLoggingLevel(e){let r=this._requireObjectParams(e);if(typeof r.level!="string")throw new Yb(Kb.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new Yb(Kb.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){if(gD.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized")this._isInitialized=!0,gD.info(this._ctx,`[session ${this.id}] initialized`);else if(e.method==="notifications/cancelled"){let r=e.params&&typeof e.params=="object"?e.params:{},n=r.requestId;if(typeof n=="string"||typeof n=="number"){let o=this._inFlightToolCalls.get(n);o&&!o.signal.aborted&&o.abort(typeof r.reason=="string"?r.reason:void 0)}}}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){gD.debug(this._ctx,`[session ${this.id}] no SSE clients, dropping ${e.method}`);return}let r=JSON.stringify(e),n=String(++this._lastEventId),o=r.split(/\r?\n/g),s=[`id: ${n}`,"event: message",...o.map(c=>`data: ${c}`),"",""].join(` -`);for(let c of[...this._sseClients]){if(c.destroyed||c.writableEnded){this._sseClients.delete(c);continue}c.write(s)}}};function Bni(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(Bni,"isInitializeMessage");p();p();var xii=fe(Tii(),1),Hdt=fe(require("node:process"),1),wii=require("node:stream");p();var jdt=class{static{a(this,"ReadBuffer")}append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(` -`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),YXs(r)}clear(){this._buffer=void 0}};function YXs(t){return cG.parse(JSON.parse(t))}a(YXs,"deserializeMessage");function Iii(t){return JSON.stringify(t)+` -`}a(Iii,"serializeMessage");var KXs=Hdt.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function JXs(){let t={};for(let e of KXs){let r=Hdt.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(JXs,"getDefaultEnvironment");var lge=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new jdt,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new wii.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{this._process=(0,xii.default)(this._serverParams.command,this._serverParams.args??[],{env:{...JXs(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:Hdt.default.platform==="win32",cwd:this._serverParams.cwd}),this._process.on("error",n=>{r(n),this.onerror?.(n)}),this._process.on("spawn",()=>{e()}),this._process.on("close",n=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",n=>{this.onerror?.(n)}),this._process.stdout?.on("data",n=>{this._readBuffer.append(n),this.processReadBuffer()}),this._process.stdout?.on("error",n=>{this.onerror?.(n)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._process){let e=this._process;this._process=void 0;let r=new Promise(n=>{e.once("close",()=>{n()})});try{e.stdin?.end()}catch{}if(await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())]),e.exitCode===null){try{e.kill("SIGTERM")}catch{}await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())])}if(e.exitCode===null)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(r=>{if(!this._process?.stdin)throw new Error("Not connected");let n=Iii(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var Rii=require("child_process"),kii=require("events"),Pii=require("util");var wgr=1e4,ZXs=(0,Pii.promisify)(Rii.exec),DMe=class{constructor(e){this._transport=null;this._emitter=new kii.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new yG({name:e.clientInfo.name,version:e.clientInfo.version},{capabilities:{}})}static{a(this,"StdioInvoker")}get isConnected(){return this._connected}async start(){if(this._connected)return;let e={...this._options.params,stderr:"pipe"},r=new lge(e);this._transport=r,this._client.onerror=n=>this._options.onError?.(n),this._client.onclose=()=>{this._connected=!1},r.stderr&&r.stderr.on("data",n=>{this._options.onStderr?.(n.toString())}),this._client.setNotificationHandler(j8,()=>{this._emitter.emit(El.ToolsListChanged)}),this._client.setNotificationHandler(Q8,()=>{this._emitter.emit(El.ResourcesListChanged)}),this._client.setNotificationHandler(q8,()=>{this._emitter.emit(El.PromptsListChanged)}),this._client.setNotificationHandler(mee,n=>{this._emitter.emit(El.LoggingMessage,n)}),await this._client.connect(r),this._connected=!0}async stop(){if(!this._transport){this._connected=!1;return}let e=this._transport;this._transport=null;let r=this._client.close().catch(()=>{}),n=await Promise.race([r.then(()=>!0),new Promise(s=>setTimeout(()=>s(!1),wgr))]),o;if("pid"in e&&typeof e.pid=="number"&&(o=e.pid),!n&&o===void 0&&this._options.onError?.(new Error(`stdio transport exposed no pid; cannot force-kill '${this.id}'`)),!n&&o!==void 0&&process.platform==="win32")try{await ZXs(`taskkill /pid ${o} /t /f`,{timeout:wgr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,wgr));try{process.kill(o,"SIGKILL")}catch{}}this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r,n){return this._client.callTool({name:e,arguments:r},CR,{...n,timeout:this._options.toolCallTimeoutMs,resetTimeoutOnProgress:n?.onprogress!==void 0})}listResources(){return this._client.listResources()}readResource(e){return this._client.readResource({uri:e})}listResourceTemplates(){return this._client.listResourceTemplates()}listPrompts(){return this._client.listPrompts()}getPrompt(e,r){return this._client.getPrompt({name:e,arguments:r})}async setLoggingLevel(e){await this._client.setLoggingLevel(e.level)}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}};p();var xm=class{static{a(this,"AuthenticationService")}};var aI=new pe("mcpGateway.manager");function Dii(t){if(!(t.allowedMcpServers===void 0&&t.deniedMcpServers===void 0))return{allowed:t.allowedMcpServers,denied:t.deniedMcpServers}}a(Dii,"selectManagedMcpSettings");var vG=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},XXs={tools:[],resources:[],resourceTemplates:[],prompts:[]},gy=class{constructor(e,r,n){this._entries=new Map;this._disposed=!1;this._applyChain=Promise.resolve();this._oauthChain=Promise.resolve();this._actionChains=new Map;this._ctx=e,this._service=r,this._sender=n,this._unregister=n,this._managedSettings=this._tryGetManagedSettings(),this._managedSettingsSub=this._managedSettings?.observe(Dii,()=>this._onMcpSettingsChanged())}static{a(this,"McpServerManager")}listServers(e){let r=[];for(let n of this._entries.values())rea(n.key.source,e)&&r.push({name:n.key.name,source:n.key.source,status:n.status,error:n.error,authInfo:n.authInfo,registryInfo:n.registryInfo});return r}getServerDetails(e){let r=this._entries.get(EG(e));return r?{tools:r.contents.tools,resources:r.contents.resources,resourceTemplates:r.contents.resourceTemplates,prompts:r.contents.prompts}:null}listReadyEntries(){let e=[];for(let r of this._entries.values()){if(r.status!=="running"||!this._evaluateAllowlist(r).allowed)continue;let n=EG(r.key),o=this._service.listMounts().find(s=>s.id===n);e.push({key:r.key,url:o?.url??null,toolCallTimeoutMs:r.classified.toolCallTimeoutMs})}return e}async applyConfig(e){if(this._disposed)throw new Error("McpServerManager is disposed");let r=this._applyChain.then(()=>this._applyConfigLocked(e));return this._applyChain=r.catch(()=>{}),r}async removeProject(e){if(this._disposed)return;let r=this._applyChain.then(()=>this._removeProjectLocked(e));return this._applyChain=r.catch(()=>{}),r}async applyPluginServers(e,r){if(this._disposed)throw new Error("McpServerManager is disposed");let n=this._applyChain.then(()=>this._applyScope({kind:"plugin",pluginId:e},r));return this._applyChain=n.catch(()=>{}),n}async removePluginServers(e){return this.applyPluginServers(e,{})}async _applyConfigLocked(e){let{workspaceFolder:r,user:n,project:o}=e,s=eea(n),c=s!==this._lastUserHash;c&&(await this._applyScope({kind:"user"},n),this._lastUserHash=s),await this._applyScope({kind:"project",workspaceFolder:r},o),sr(this._ctx,"mcpGateway.applyConfig",{userChanged:String(c),hasProject:String(Object.keys(o).length>0)},{userServerCount:Object.keys(n).length,projectServerCount:Object.keys(o).length})}async _applyScope(e,r){let n=new Map,o=[];for(let[l,u]of Object.entries(r)){let d=iea(l,u);if(!d){o.push(l);continue}n.set(EG({source:e,name:l}),{classified:d,hash:Nii(u)})}o.length>0&&aI.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries in ${nea(e)}: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)tea(u.key.source,e)&&!n.has(l)&&s.push(l);for(let l of s)await this._removeEntry(l);let c=!1;for(let[l,{classified:u,hash:d}]of n){let f=this._entries.get(l);f?f.entryHash!==d&&(await this._stopInvoker(f,"starting"),f.classified=u,f.entryHash=d,f.error=void 0,c=!0,this._beginStart(l)):(this._createEntry({source:e,name:u.name},u,d),c=!0)}c&&this._sender.serversChanged(N4(e))}async _removeProjectLocked(e){let r=[];for(let[n,o]of this._entries)o.key.source.kind==="project"&&o.key.source.workspaceFolder===e&&r.push(n);if(r.length!==0)for(let n of r)await this._removeEntry(n)}serverAction(e,r){let n=EG(e),o=this._entries.get(n);if(!o)throw new vG("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new vG("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new vG("noAuth",`Server '${e.name}' has no auth state to clear`);break}let c=(this._actionChains.get(n)??Promise.resolve()).then(()=>this._runAction(n,r));return this._actionChains.set(n,c.catch(()=>{})),Promise.resolve()}async _runAction(e,r){let n=this._entries.get(e);if(n)switch(r){case"start":if(n.status==="running"||n.status==="starting")return;await this._beginStart(e);return;case"stop":if(n.status==="stopped")return;await this._stopInvoker(n,"stopped"),this._sender.serversChanged(N4(n.key.source));return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(N4(n.key.source)),await this._beginStart(e);return;case"logout":await this._performLogout(n,!1);return;case"clearOAuth":await this._performLogout(n,!0),await this._beginStart(e);return}}async dispose(){if(this._disposed)return;this._disposed=!0,this._managedSettingsSub?.dispose(),this._managedSettingsSub=void 0;let e=[...this._entries.values()].map(r=>this._stopInvoker(r,"stopped").catch(()=>{}));this._entries.clear(),await Promise.all(e)}_toEvalServer(e){let r=e.classified;if(r.kind==="stdio"){let{command:n,args:o}=r.params;return{name:e.key.name,transport:{kind:"stdio",command:[n,...o??[]]}}}return{name:e.key.name,transport:{kind:r.type,url:r.url}}}_evaluateAllowlist(e){let r=this._managedSettings?Dii(this._managedSettings.get()):void 0;return pgr(this._toEvalServer(e),r)}async _markBlocked(e,r){e.error=r,$c(this._ctx,"mcpGateway.allowlist.blocked",{transport:e.classified.kind==="stdio"?"stdio":e.classified.type,source:e.key.source.kind}),await this._stopInvoker(e,"blocked")}_onMcpSettingsChanged(){if(this._disposed)return;let e=this._applyChain.then(()=>this._reEnforceAllowlistLocked());this._applyChain=e.catch(()=>{})}async _reEnforceAllowlistLocked(){for(let[e,r]of this._entries){let n=this._evaluateAllowlist(r);!n.allowed&&r.status!=="blocked"?await this._markBlocked(r,n.reason):n.allowed&&r.status==="blocked"&&(r.error=void 0,this._beginStart(e))}}_createEntry(e,r,n){let o={key:e,classified:r,entryHash:n,invoker:null,status:"stopped",contents:{...XXs},listeners:null};return this._entries.set(EG(e),o),o}async _removeEntry(e){let r=this._entries.get(e);if(!r)return;let n=N4(r.key.source);await this._stopInvoker(r,"stopped").catch(()=>{}),this._entries.delete(e),this._sender.serversChanged(n)}async _beginStart(e){let r=this._entries.get(e);if(!r)return;let n=this._evaluateAllowlist(r);if(!n.allowed){await this._markBlocked(r,n.reason);return}r.invoker?await this._stopInvoker(r,"starting"):(r.status="starting",r.error=void 0,this._sender.serversChanged(N4(r.key.source)));let o=this._buildInvoker(r);r.invoker=o,this._wireInvokerEvents(r);try{if(await o.start(),r.invoker!==o){await o.stop().catch(()=>{});return}r.status="running",r.error=void 0;try{await this._service.registerMount(o,r.key.name)}catch(s){throw aI.error(this._ctx,`failed to register mount for '${r.key.name}'`,s),s}if(r.invoker!==o){this._service.unregisterMount(EG(r.key)),await o.stop().catch(()=>{});return}if(await this._refreshContents(r).catch(s=>{aI.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(s)}`)}),r.invoker!==o)return;this._sender.serversChanged(N4(r.key.source)),this._sender.serverDetailsChanged(r.key),la(this._ctx,{message:"Connection state: Running",server:r.key.name})}catch(s){if(r.invoker!==o){await o.stop().catch(()=>{});return}s instanceof ige?(r.status="unauthorized",r.error=void 0,aI.warn(this._ctx,`server '${r.key.name}' requires authorization`),mD(this._ctx,{message:"Connection state: Unauthorized (authorization required)",server:r.key.name})):(r.status="error",r.error=s instanceof Error?s.message:String(s),aI.error(this._ctx,`server '${r.key.name}' failed to start`,s),Sd(this._ctx,{message:`Connection state: Error: ${r.error}`,server:r.key.name})),await o.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged(N4(r.key.source))}}async _stopInvoker(e,r){let n=e.invoker;this._unwireInvokerEvents(e),e.invoker=null,e.status=r,r!=="error"&&r!=="blocked"&&(e.error=void 0),this._service.unregisterMount(EG(e.key)),this._sender.serversChanged(N4(e.key.source)),n&&(r==="stopped"&&la(this._ctx,{message:"Connection state: Stopped",server:e.key.name}),await n.stop().catch(o=>{aI.warn(this._ctx,`failed to stop invoker '${e.key.name}': ${String(o)}`)}))}_wireInvokerEvents(e){let r=e.invoker;if(!r)return;let n={toolsChanged:a(()=>{this._onUpstreamListChanged(e,"tools")},"toolsChanged"),resourcesChanged:a(()=>{this._onUpstreamListChanged(e,"resources")},"resourcesChanged"),promptsChanged:a(()=>{this._onUpstreamListChanged(e,"prompts")},"promptsChanged"),loggingMessage:a(o=>this._onUpstreamLog(e,o),"loggingMessage")};r.on(El.ToolsListChanged,n.toolsChanged),r.on(El.ResourcesListChanged,n.resourcesChanged),r.on(El.PromptsListChanged,n.promptsChanged),r.on(El.LoggingMessage,n.loggingMessage),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(El.ToolsListChanged,n.toolsChanged),r.off(El.ResourcesListChanged,n.resourcesChanged),r.off(El.PromptsListChanged,n.promptsChanged),r.off(El.LoggingMessage,n.loggingMessage)),e.listeners=null}_onUpstreamLog(e,r){let n=r.params.data,o=typeof n=="string"?n:JSON.stringify(n),s=r.params.logger?`${r.params.logger}: ${o}`:o,c=e.key.name;switch(r.params.level){case"warning":mD(this._ctx,{message:s,server:c});break;case"error":case"critical":case"alert":case"emergency":Sd(this._ctx,{message:s,server:c});break;default:la(this._ctx,{message:s,server:c})}}async _onUpstreamListChanged(e,r){if(e.invoker)try{if(r==="tools"){let n=await e.invoker.listTools();e.contents.tools=n.tools}else if(r==="resources"){let[n,o]=await Promise.all([e.invoker.listResources(),e.invoker.listResourceTemplates()]);e.contents.resources=n.resources,e.contents.resourceTemplates=o.resourceTemplates}else{let n=await e.invoker.listPrompts();e.contents.prompts=n.prompts}this._sender.serverDetailsChanged(e.key)}catch(n){aI.warn(this._ctx,`failed to refresh ${r} for '${e.key.name}': ${String(n)}`)}}async _refreshContents(e){if(!e.invoker)return;let r=await Promise.allSettled([e.invoker.listTools(),e.invoker.listResources(),e.invoker.listResourceTemplates(),e.invoker.listPrompts()]);e.contents={tools:r[0].status==="fulfilled"?r[0].value.tools:[],resources:r[1].status==="fulfilled"?r[1].value.resources:[],resourceTemplates:r[2].status==="fulfilled"?r[2].value.resourceTemplates:[],prompts:r[3].status==="fulfilled"?r[3].value.prompts:[]}}_buildInvoker(e){let r=e.classified,n=EG(e.key),o=e.key.name,s=a(c=>{Sd(this._ctx,{message:`Connection state: Error: ${c.message}`,server:o})},"onError");return r.kind==="stdio"?new DMe({id:n,label:o,params:r.params,toolCallTimeoutMs:r.toolCallTimeoutMs,clientInfo:{name:kMe,version:PMe},onStderr:a(c=>{mD(this._ctx,{message:`[server stderr] ${c.trimEnd()}`,server:o})},"onStderr"),onError:s}):new xMe({id:n,label:o,url:r.url,type:r.type,httpOptions:r.type==="http"?r.httpOptions:void 0,sseOptions:r.type==="sse"?r.sseOptions:void 0,toolCallTimeoutMs:r.toolCallTimeoutMs,clientInfo:{name:kMe,version:PMe},onError:s,authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:c})=>{aI.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${c}, falling back to legacy SSE`),sr(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(c)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(xm)}catch{return}}_tryGetManagedSettings(){try{return this._ctx.get(ay)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await Mni(this._ctx,r,n);if(!s){aI.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await Qdt(this._ctx,c,s,e.key.name);if(e.authDiscovery={discovery:s,providerId:l.providerId},l.token){let u=l.sessions.find(d=>d.accessToken===l.token);u&&this._setAuthInfo(e,{providerId:l.providerId,accountName:u.account.label})}return e.authDiscovery}catch(c){aI.error(this._ctx,`'${e.key.name}': dynamic provider setup failed`,c);return}},"ensureDiscovery");return async s=>{let c=this._tryGetAuthSvc();if(!c)return;let l=await o();if(!l)return;if(s==="silent"){let f=await Qdt(this._ctx,c,l.discovery,e.key.name);if(f.token){let h=f.sessions.find(m=>m.accessToken===f.token);h&&this._setAuthInfo(e,{providerId:l.providerId,accountName:h.account.label})}return f.token}let u,d=this._oauthChain.then(async()=>{let f=await Qdt(this._ctx,c,l.discovery,e.key.name);if(f.token){u=f.token;let h=f.sessions.find(m=>m.accessToken===u);h&&this._setAuthInfo(e,{providerId:l.providerId,accountName:h.account.label});return}if(u=await Oni(this._ctx,c,l.discovery,l.providerId,e.key.name,r,f.sessions),u){let m=(await c.getSessions(l.providerId,l.discovery.scopes,{authorizationServer:l.discovery.authorizationServer},!0)).find(g=>g.accessToken===u);m&&this._setAuthInfo(e,{providerId:l.providerId,accountName:m.account.label})}});return this._oauthChain=d.catch(()=>{}),await d,u}}_setAuthInfo(e,r){e.authInfo?.providerId===r.providerId&&e.authInfo?.accountName===r.accountName||(e.authInfo=r,this._sender.serversChanged(N4(e.key.source)))}async _performLogout(e,r){await this._stopInvoker(e,"stopped").catch(()=>{});let n=this._tryGetAuthSvc(),o=e.authInfo?.providerId??e.authDiscovery?.providerId;if(n&&o)try{let s=n.getProvider(o),c=await n.getSessions(o,e.authDiscovery?.discovery.scopes??[],e.authDiscovery?{authorizationServer:e.authDiscovery.discovery.authorizationServer}:void 0,!0);for(let l of c)await s.removeSession(l.id).catch(u=>aI.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){aI.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){aI.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged(N4(e.key.source))}};function EG(t){switch(t.source.kind){case"user":return`user::${t.name}`;case"project":return`project::${t.source.workspaceFolder}::${t.name}`;case"plugin":return`plugin::${t.source.pluginId}::${t.name}`}}a(EG,"serializeKey");function Nii(t){if(!t||typeof t!="object")return JSON.stringify(t);let e=t,r=Object.keys(e).sort(),n={};for(let o of r)n[o]=e[o];return JSON.stringify(n)}a(Nii,"canonicalEntryHash");function eea(t){let e=Object.keys(t).sort(),r={};for(let n of e)r[n]=Nii(t[n]);return JSON.stringify(r)}a(eea,"canonicalConfigHash");function N4(t){return t.kind==="project"?{kind:"project",workspaceFolder:t.workspaceFolder}:{kind:"user"}}a(N4,"notificationScopeFor");function tea(t,e){return t.kind!==e.kind?!1:t.kind==="project"&&e.kind==="project"?t.workspaceFolder===e.workspaceFolder:t.kind==="plugin"&&e.kind==="plugin"?t.pluginId===e.pluginId:t.kind==="user"&&e.kind==="user"}a(tea,"sameScope");function rea(t,e){return e===void 0||t.kind==="user"||t.kind==="plugin"?!0:t.kind==="project"&&e.kind==="project"?t.workspaceFolder===e.workspaceFolder:!1}a(rea,"entryInScope");function nea(t){switch(t.kind){case"user":return"user";case"project":return`project<${t.workspaceFolder}>`;case"plugin":return`plugin<${t.pluginId}>`}}a(nea,"describeScope");function iea(t,e){if(!e||typeof e!="object")return;let r=e,n=typeof r.timeout=="number"?r.timeout:void 0,o={...r};if(delete o.timeout,typeof r.command=="string")return{kind:"stdio",name:t,params:o,toolCallTimeoutMs:n};if(typeof r.url=="string"){let c=(typeof r.type=="string"?r.type:void 0)==="sse"?"sse":"http";return{kind:"http",name:t,url:r.url,type:c,httpOptions:c==="http"?o:void 0,sseOptions:c==="sse"?o:void 0,toolCallTimeoutMs:n}}}a(iea,"classifyEntry");p();var Rgr=require("crypto"),Mii=require("events"),Oii=fe(require("http"));var CG=new pe("mcpGateway"),oea="mcp-session-id",sea=1024*1024,aea=5e3,Lii={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},Mee={MountsChanged:"mountsChanged"},bG=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new Mii.EventEmitter;this._connections=new Set;this._ctx=e,this._host=r.host??"127.0.0.1"}static{a(this,"McpGatewayService")}get port(){return this._port}get origin(){return this._port===void 0?void 0:`http://${this._host}:${this._port}`}listMounts(){let e=[];for(let[r,n]of this._routes)e.push(this._buildMountInfo(n.invoker.id,n.label,r,n.status));return e}setMountStatus(e,r){let n=this._idToRouteId.get(e);if(!n)return;let o=this._routes.get(n);if(!o||o.status===r)return;let s=o.status;o.status=r,CG.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),sr(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(Mee.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=Lii.Ready){if(await this._ensureServer(),this._port===void 0)throw new Error("Gateway server failed to start");if(this._idToRouteId.get(e.id))throw new Error(`Mount already registered for id '${e.id}'`);let s=(0,Rgr.randomUUID)(),c=r??e.label;this._routes.set(s,{invoker:e,label:c,sessions:new Map,status:n}),this._idToRouteId.set(e.id,s);let l=this._buildMountInfo(e.id,c,s,n);return CG.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),sr(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(Mee.MountsChanged,this.listMounts()),l}unregisterMount(e){let r=this._idToRouteId.get(e);if(!r)return;let n=this._routes.get(r);if(n){for(let o of n.sessions.values())o.dispose();n.sessions.clear(),this._routes.delete(r),this._idToRouteId.delete(e),CG.info(this._ctx,`unregistered mount '${n.label}' (${e})`),sr(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(Mee.MountsChanged,this.listMounts())}}dispose(){for(let e of this._routes.values()){for(let r of e.sessions.values())r.dispose();e.sessions.clear()}this._routes.clear(),this._idToRouteId.clear(),this._stopServer()}async _ensureServer(){if(!this._server?.listening){if(this._startPromise)return this._startPromise;this._startPromise=this._startServer();try{await this._startPromise}finally{this._startPromise=void 0}}}_startServer(){return new Promise((e,r)=>{let n=Oii.createServer((s,c)=>this._handleRequest(s,c));n.requestTimeout=0,this._server=n,n.on("connection",s=>{this._connections.add(s),s.on("close",()=>this._connections.delete(s))});let o=setTimeout(()=>r(new Error("Gateway listen timeout")),aea);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),CG.info(this._ctx,`listening on http://${this._host}:${this._port}`),e()}),n.on("error",s=>{if(s.code==="EADDRINUSE"){n.listen(0,this._host);return}clearTimeout(o),r(s)}),n.listen(0,this._host)})}_stopServer(){if(this._server){CG.info(this._ctx,"stopping HTTP server");for(let e of this._connections)e.destroy();this._connections.clear(),this._server.close(),this._server=void 0,this._port=void 0}}_handleRequest(e,r){let o=new URL(e.url??"/",`http://${e.headers.host??"127.0.0.1"}`).pathname.split("/").filter(Boolean);if(o.length<2||o[1]!=="mcp"){this._respondHttpError(r,404,"Not found");return}let s=o[0],c=this._routes.get(s);if(!c){this._respondHttpError(r,404,"Mount not found");return}if(e.method==="POST"){this._handlePost(c,e,r);return}if(e.method==="GET"){this._handleGet(c,e,r);return}if(e.method==="DELETE"){this._handleDelete(c,e,r);return}this._respondHttpError(r,405,"Method not allowed")}async _handlePost(e,r,n){let o=await this._readBody(r);if(o===void 0){this._respondHttpError(n,413,"Payload too large");return}let s;try{s=JSON.parse(o)}catch(u){let d={jsonrpc:"2.0",id:null,error:{code:Kb.ParseError,message:u instanceof Error?u.message:String(u)}};n.writeHead(400,{"Content-Type":"application/json"}),n.end(JSON.stringify(d));return}let c=this._getSessionId(r),l=this._resolveSession(e,c,s,n);if(l)try{let u=await l.handleIncoming(s),d={"Content-Type":"application/json","Mcp-Session-Id":l.id};if(u.length===0||!this._hasRequest(s)){n.writeHead(202,d),n.end();return}let f=JSON.stringify(Array.isArray(s)?u:u[0]);n.writeHead(200,d),n.end(f)}catch(u){CG.error(this._ctx,"POST handler failed",u),this._respondHttpError(n,500,"Internal server error")}}_handleGet(e,r,n){let o=this._getSessionId(r);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let s=e.sessions.get(o);if(!s){this._respondHttpError(n,404,"Session not found");return}s.attachSseClient(n)}_handleDelete(e,r,n){let o=this._getSessionId(r);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let s=e.sessions.get(o);if(!s){this._respondHttpError(n,404,"Session not found");return}s.dispose(),n.writeHead(204),n.end()}_resolveSession(e,r,n,o){if(r){let l=e.sessions.get(r);if(!l){this._respondHttpError(o,404,"Session not found");return}return l}if(!Bni(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,Rgr.randomUUID)(),c=new RMe(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&CG.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),CG.info(this._ctx,`mount '${e.label}' session attached (sid=${s}, active sessions: ${e.sessions.size})`),c}_hasRequest(e){return(Array.isArray(e)?e:[e]).some(Ldt)}_getSessionId(e){let r=e.headers[oea];return Array.isArray(r)?r[0]:r}async _readBody(e){let r=[],n=0;for await(let o of e){let s=Buffer.isBuffer(o)?o:Buffer.from(o);if(n+=s.byteLength,n>sea)return;r.push(s)}return Buffer.concat(r).toString("utf8")}_respondHttpError(e,r,n){e.writeHead(r,{"Content-Type":"application/json"});let o={jsonrpc:"2.0",id:null,error:{code:r,message:n}};e.end(JSON.stringify(o))}_buildMountInfo(e,r,n,o){return{id:e,label:r,routeId:n,url:`${this.origin}/${n}/mcp`,status:o}}};p();var Bii=[{type:"skill",pick:a(t=>t.skills,"pick")},{type:"agent",pick:a(t=>t.agents,"pick")},{type:"instructions",pick:a(t=>t.instructions,"pick")},{type:"prompt",pick:a(t=>t.commands,"pick")}],J8=class{constructor(e,r){this.ctx=e;this.service=r;this.logger=new pe("PluginContributionInjector");this.registered=new Map;this.disposed=!1;this.syncChain=Promise.resolve();this.changeSubscription=this.service.onDidChangePlugins(()=>this.scheduleSync()),this.gateSubscription=this.subscribeToGateChanges()}static{a(this,"PluginContributionInjector")}subscribeToGateChanges(){try{let e=this.ctx.get(Qo);return this.lastPluginsEnabled=sG(this.ctx),e.onDidChangeCopilotSettings(()=>{let r=sG(this.ctx);r!==this.lastPluginsEnabled&&(this.lastPluginsEnabled=r,this.initialSyncPromise=void 0,this.scheduleSync())})}catch{return}}async ensureInitialSync(){if(this.disposed)return;if(this.initialSyncPromise)return this.initialSyncPromise;if(!this.isEditorIdentityKnown())return;let e,r=new Promise(n=>e=n);return this.initialSyncPromise=r,this.syncChain=this.syncChain.then(()=>this.sync()).then(n=>{n||(this.initialSyncPromise=void 0)}).catch(n=>{this.initialSyncPromise=void 0,this.logger.warn(this.ctx,"plugin contribution initial sync failed",{err:String(n)})}).finally(()=>e()),r}isEditorIdentityKnown(){try{return this.ctx.get(Ir).isEditorPluginInfoKnown()}catch{return!0}}scheduleSync(){this.syncChain=this.syncChain.then(()=>this.sync()).then(()=>{}).catch(e=>{this.logger.warn(this.ctx,"plugin contribution sync failed",{err:String(e)})})}syncedForTesting(){return this.syncChain}async sync(){if(this.disposed)return!0;if(!sG(this.ctx))return this.teardownAll(),!0;let e;try{e=(await this.service.listPlugins()).filter(vme)}catch(n){return this.logger.warn(this.ctx,"listPlugins failed during sync",{err:String(n)}),!1}if(this.disposed)return!0;let r=new Map(e.map(n=>[n.uri,n]));for(let n of[...this.registered.keys()])r.has(n)||this.teardownPlugin(n);for(let[n,o]of r)if(await this.reconcilePlugin(n,o),this.disposed)return!0;return!0}async reconcilePlugin(e,r){let n=this.registered.get(e),o=cea(r),s=lea(r),c=n?.disposables??[];if(!n||n.fileHash!==o){for(let u of c)u.dispose();c=this.registerFiles(e,r)}let l=n?.mcpApplied??!1;if((!n||n.mcpHash!==s||!n.mcpApplied)&&(l=await this.applyMcp(e,r,n)),this.disposed){for(let u of c)u.dispose();l&&this.tryManager()?.removePluginServers(e).catch(d=>this.logger.warn(this.ctx,"removePluginServers failed",{uri:e,err:String(d)}));return}this.registered.set(e,{fileHash:o,mcpHash:s,mcpApplied:l,disposables:c})}registerFiles(e,r){let n=this.tryRegistry();if(!n)return[];let o=[];for(let{type:s,pick:c}of Bii)for(let l of c(r))o.push(n.register(s,[uea(l.uri)],{watchable:!1,classification:{storage:"plugin",pluginInfo:{name:l.name,description:l.description??"",pluginUri:e}}}));return o}async applyMcp(e,r,n){let o=this.tryManager();if(!o)return!0;let s=dea(r.mcpServerDefinitions);if(Object.keys(s).length===0&&!n?.mcpApplied)return!0;try{return await o.applyPluginServers(e,s),!0}catch(c){return this.logger.warn(this.ctx,"applyPluginServers failed",{uri:e,err:String(c)}),!1}}teardownPlugin(e){let r=this.registered.get(e);if(!r)return;for(let o of r.disposables)o.dispose();let n=this.tryManager();n&&n.removePluginServers(e).catch(o=>this.logger.warn(this.ctx,"removePluginServers failed",{uri:e,err:String(o)})),this.registered.delete(e)}teardownAll(){for(let e of[...this.registered.keys()])this.teardownPlugin(e)}tryRegistry(){return this.tryGet(QA)}tryManager(){return this.tryGet(gy)}tryGet(e){try{return this.ctx.get(e)}catch(r){if(r instanceof Ic)return;throw r}}dispose(){this.disposed||(this.disposed=!0,this.changeSubscription.dispose(),this.gateSubscription?.dispose(),this.teardownAll())}};function cea(t){let e=Bii.flatMap(({pick:r})=>r(t).map(n=>JSON.stringify([n.uri,n.name,n.description??""]))).sort();return JSON.stringify(e)}a(cea,"fileContentHash");function lea(t){let e=t.mcpServerDefinitions.map(r=>JSON.stringify([r.name,r.configuration])).sort();return JSON.stringify(e)}a(lea,"mcpContentHash");function uea(t){return t.includes("://")?un(t):t}a(uea,"toPathPattern");function dea(t){let e={};for(let{name:r,configuration:n}of t)n.type==="stdio"?e[r]={command:n.command,...n.args&&{args:[...n.args]},...n.env&&{env:{...n.env}},...n.cwd&&{cwd:n.cwd}}:e[r]={url:n.url,...n.headers&&{headers:{...n.headers}}};return e}a(dea,"toMcpServersConfig");var Fii=fe(require("node:path"));var Gdt=new pe("BackgroundAgent.SessionOptionsBuilder"),fea=5e3;async function Uii(t,e,r,n){let o=LO((async()=>{try{await t.get(J8).ensureInitialSync()}catch(A){if(!(A instanceof Ic))throw A}})(),fea,void 0),s=await n.buildAuthInfo(),c=oo(r.workspaceFolder.uri).fsPath;await o;let l;try{l=t.get(Ig).getSkillDirectories(c),l.length===0&&(l=void 0)}catch{}let u={clientName:t.get(Ir).getEditorPluginInfo().name,sessionId:e,authInfo:s,model:r.model,reasoningEffort:r.reasoningEffort,enableStreaming:r.enableStreaming??!0,excludedTools:r.excludedTools,skillDirectories:l,disabledSkills:r.disabledSkills?new Set(r.disabledSkills):void 0,workingDirectory:c,infiniteSessions:{enabled:!0}};try{await t.get(aF)._handleWorkspaceAdded({uri:r.workspaceFolder.uri,name:r.workspaceFolder.name??""})}catch{}let d=await pZn(t,r.workspaceFolder);d.length>0&&(u.customAgents=d);let f=r.mcpDirectory??r.workspaceFolder.uri;try{let A=t.get(yR).buildMcpServers(f);Gdt.info(t,"Built MCP gateway servers for SDK options",{sessionId:e,gatewayServers:A}),Object.keys(A).length>0&&(u.mcpServers=A)}catch(A){if(!(A instanceof Ic))throw A}u.hooks=hZn(t,r.workspaceFolder);let h=await OXn(t,r.workspaceFolder);if(u.hooks=LXn(u.hooks,h),r.inlineConfinedFile){let A=[...u.hooks.preToolUse??[]];r.inlineConfinementHook&&A.unshift(r.inlineConfinementHook),r.inlineTurnLimiter&&A.unshift(r.inlineTurnLimiter.hook),u.hooks={...u.hooks,preToolUse:A},u.systemMessage={mode:"append",content:UXn(r.inlineConfinedFile)}}else{let A=await kpr(t,[r.workspaceFolder]).catch(v=>{Gdt.warn(t,"Failed to load git commit instructions for systemMessage",v)}),y=r.useNestedAgentsMdFiles===!0?await hea(t,c):void 0,_=r.useNestedClaudeMdFiles===!0?await pea(t,c):void 0,E=_Zn({gitCommitInstructions:A,globalAgentsMdInstructions:r.globalAgentsMdInstructions,nestedAgentsInstructions:y,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:_});E!==void 0&&(u.systemMessage={mode:"append",content:E})}r.externalToolDefinitions?.length&&(u.externalToolDefinitions=r.externalToolDefinitions);let m=mZn(r);m.size>0&&(u.disabledInstructionSources=m);let g=Rut(t);return g&&(u.sandboxConfig=g),u}a(Uii,"buildSessionOptions");async function pea(t,e){let r;try{r=t.get(Go)}catch{return}try{return await AZn(async n=>r.readDirectory(Ko(n)),async n=>Qii(r,e,n),e)}catch(n){Gdt.warn(t,"Failed to scan nested CLAUDE.md files",n);return}}a(pea,"scanNestedClaudeSection");async function hea(t,e){let r;try{r=t.get(Go)}catch{return}try{return await yZn(async n=>r.readDirectory(Ko(n)),async n=>Qii(r,e,n),e)}catch(n){Gdt.warn(t,"Failed to scan nested AGENTS.md files",n);return}}a(hea,"scanNestedAgentsSection");async function Qii(t,e,r){try{return await t.readFileString(Ko(Fii.join(e,r)))}catch{return}}a(Qii,"readNestedFile");p();var mea=20,$dt=new pe("BackgroundAgent.SessionRegistry"),Vdt=class{constructor(e,r){this.ctx=e;this.onSessionEvicted=r;this.sessions=new Map;this.resumeOptions=new Map;this.workingDirs=new Map;this.workspaceFolderUris=new Map;this.mcpDirectories=new Map;this.turnIndexes=new Map;this.chatModes=new Map;this.providerModels=new Map;this.appliedSandboxConfig=new Map;this.confinedFiles=new Map;this.turnLimiters=new Map;this.children=new Map}static{a(this,"SessionRegistry")}set(e,r){if(this.sessions.has(e)&&this.sessions.delete(e),this.sessions.set(e,r),this.sessions.size>mea){let n=this.sessions.keys().next().value;if(n!==void 0&&n!==e){let o=this.sessions.get(n);if(!o)return;$dt.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.sessions.delete(n);let s=Promise.resolve();try{s=this.onSessionEvicted?.(n,o)??s}catch(c){s=Promise.reject(c instanceof Error?c:new Error(String(c)))}Promise.all([this.removeExpected(n,o),s]).catch(c=>$dt.warn(this.ctx,`Failed to evict session ${n}`,{error:c instanceof Error?c.message:String(c)}))}}}get(e){return this.sessions.get(e)}has(e){return this.sessions.has(e)}size(){return this.sessions.size}entries(){return this.sessions.entries()}forgetSession(e){this.sessions.delete(e)}setResumeOptions(e,r){this.resumeOptions.set(e,r)}getResumeOptions(e){return this.resumeOptions.get(e)}setWorkingDir(e,r){this.workingDirs.set(e,r)}getWorkingDir(e){return this.workingDirs.get(e)}workingDirEntries(){return this.workingDirs}setWorkspaceFolderUri(e,r){this.workspaceFolderUris.set(e,r)}getWorkspaceFolderUri(e){return this.workspaceFolderUris.get(e)}setMcpDirectory(e,r){this.mcpDirectories.set(e,r)}getMcpDirectory(e){return this.mcpDirectories.get(e)}incrementTurnIndex(e){let r=(this.turnIndexes.get(e)??-1)+1;return this.turnIndexes.set(e,r),r}seedTurnIndexIfAbsent(e,r){this.turnIndexes.has(e)||this.turnIndexes.set(e,r)}setChatMode(e,r){this.chatModes.set(e,r)}getChatMode(e){return this.chatModes.get(e)}deleteChatMode(e){this.chatModes.delete(e)}clearChatMode(){this.chatModes.clear()}chatModeEntries(){return this.chatModes}setProviderModel(e,r){this.providerModels.set(e,r)}getProviderModel(e){return this.providerModels.get(e)}deleteProviderModel(e){this.providerModels.delete(e)}setAppliedSandboxConfig(e,r){this.appliedSandboxConfig.set(e,r)}getAppliedSandboxConfig(e){return this.appliedSandboxConfig.get(e)}deleteAppliedSandboxConfig(e){this.appliedSandboxConfig.delete(e)}setConfinedFile(e,r){this.confinedFiles.set(e,r)}getConfinedFile(e){return this.confinedFiles.get(e)}hasConfinedFile(e){return this.confinedFiles.has(e)}setTurnLimiter(e,r){this.turnLimiters.set(e,r)}getTurnLimiter(e){return this.turnLimiters.get(e)}registerChild(e,r){let n=this.children.get(e);n||(n=[],this.children.set(e,n)),n.push(r)}async remove(e){let r=this.sessions.get(e);await this.removeExpected(e,r)}async removeExpected(e,r){let n=this.children.get(e);this.children.delete(e),n&&await Promise.all(n.map(async s=>{try{await Promise.resolve(s.dispose())}catch(c){$dt.warn(this.ctx,"Child Disposable failed during session removal",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}));let o=this.sessions.get(e);if(r!==void 0&&o!==void 0&&o!==r){$dt.debug(this.ctx,`Skipping map clear for session ${e}: re-cached during removal`);return}this.sessions.delete(e),this.resumeOptions.delete(e),this.workingDirs.delete(e),this.workspaceFolderUris.delete(e),this.mcpDirectories.delete(e),this.turnIndexes.delete(e),this.chatModes.delete(e),this.providerModels.delete(e),this.appliedSandboxConfig.delete(e),this.confinedFiles.delete(e),this.turnLimiters.delete(e)}async removeAll(){let e=[...this.sessions.keys(),...this.children.keys()],r=Array.from(new Set(e));await Promise.all(r.map(n=>this.remove(n))),this.sessions.clear(),this.resumeOptions.clear(),this.workingDirs.clear(),this.workspaceFolderUris.clear(),this.mcpDirectories.clear(),this.turnIndexes.clear(),this.chatModes.clear(),this.providerModels.clear(),this.appliedSandboxConfig.clear(),this.confinedFiles.clear(),this.turnLimiters.clear(),this.children.clear()}};p();p();var kgr=require("node:fs"),Oee=fe(require("node:path"));function qii(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(qii,"sanitizePathSegment");function zdt(t){return typeof t=="string"?t:void 0}a(zdt,"asString");function Wdt(t){return typeof t=="number"?t:void 0}a(Wdt,"asNumber");function gea(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:zdt(r.toolCallId),tool:zdt(r.name)}}):[]}a(gea,"asToolCallArray");function Aea(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(Aea,"toToolResultText");function yea(t){try{return JSON.stringify(t)}catch{return}}a(yea,"safeStringify");var Pgr=class{constructor(e,r,n){this.sessionId=r;this.usageByKey=new Map;this.pendingTools=new Map;this.appendQueues=new Map;this.activeTurnId=n;let o=gHt(new Date),s=qii(r);this.sessionDir=Oee.join(e,`pid-${process.pid}_${o}_bgagent`,"sessions",s)}static{a(this,"BackgroundAgentPersistence")}persistEvent(e){if(e.type==="assistant.turn_start"){this.activeTurnId=e.data.turnId;return}switch(e.type){case"assistant.usage":this.handleUsage(e);break;case"assistant.message":this.handleMessage(e);break;case"tool.execution_start":this.handleToolStart(e);break;case"tool.execution_complete":this.handleToolComplete(e);break;default:break}}outputDir(e){return e?Oee.join(this.sessionDir,"runSubAgent",qii(e)):this.sessionDir}appendJsonl(e,r){let n=yea(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await kgr.promises.mkdir(Oee.dirname(e),{recursive:!0}),await kgr.promises.appendFile(e,`${n} -`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:Wdt(e.data.inputTokens),outputTokens:Wdt(e.data.outputTokens),cacheReadTokens:Wdt(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=gea(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl(Oee.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:Wdt(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=zdt(e.data.toolCallId);r&&this.pendingTools.set(r,{toolCallId:r,toolName:e.data.toolName,arguments:e.data.arguments,parentToolCallId:e.data.parentToolCallId,startTimestamp:e.timestamp})}handleToolComplete(e){let r=zdt(e.data.toolCallId);if(!r)return;let n=this.pendingTools.get(r);this.pendingTools.delete(r);let o=this.outputDir(n?.parentToolCallId),s=n?.startTimestamp?new Date(n.startTimestamp).getTime():void 0,c=new Date(e.timestamp).getTime(),l=s?c-s:void 0;this.appendJsonl(Oee.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:Aea(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function jii(t,e,r){let n=kt(t,ze.PromptPersistBasePath)?.trim()||void 0;if(n)return new Pgr(n,e,r)}a(jii,"createBackgroundAgentPersistence");p();var Ydt=class{constructor(){this.pendingWaits=new Map;this.data={permission:{totalMs:0,count:0},user_input:{totalMs:0,count:0},exit_plan_mode:{totalMs:0,count:0}}}static{a(this,"UserWaitTracker")}trackEvent(e){let r=e.type,n=e.data;if(r==="permission.requested"||r==="user_input.requested"||r==="exit_plan_mode.requested"){let o=typeof n?.requestId=="string"?n.requestId:void 0;if(!o)return;let s=r.replace(".requested","");this.pendingWaits.set(o,{waitType:s,startTimeMs:performance.now()})}else if(r==="permission.completed"||r==="user_input.completed"||r==="exit_plan_mode.completed"){let o=typeof n?.requestId=="string"?n.requestId:void 0;if(!o)return;let s=this.pendingWaits.get(o);if(s){let c=performance.now()-s.startTimeMs;this.pendingWaits.delete(o);let l=this.data[s.waitType];l.totalMs+=c,l.count+=1}}}};p();p();var uge={INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool"},Pn={OPERATION_NAME:"gen_ai.operation.name",AGENT_NAME:"gen_ai.agent.name",SYSTEM:"gen_ai.system",REQUEST_MODEL:"gen_ai.request.model",RESPONSE_MODEL:"gen_ai.response.model",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",CONVERSATION_ID:"gen_ai.conversation.id",USAGE_INPUT_TOKENS:"gen_ai.usage.input_tokens",USAGE_OUTPUT_TOKENS:"gen_ai.usage.output_tokens",USAGE_CACHE_READ_INPUT_TOKENS:"gen_ai.usage.cache_read.input_tokens",USAGE_CACHE_CREATION_INPUT_TOKENS:"gen_ai.usage.cache_creation.input_tokens",TURN_COUNT:"gen_ai.turn_count",TOTAL_COST_USD:"gen_ai.total_cost_usd",TOOL_NAME:"gen_ai.tool.name",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result"};function Z8(t,e){return JSON.stringify([{role:t,parts:[{type:"text",content:e}]}])}a(Z8,"genAiMessagesJson");p();var NMe=require("fs"),dge=fe(require("path"));var Dgr=new pe("OtelSpanFilePersistence"),_ea="debug.jsonl",cI=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=kt(this.ctx,ze.AgentDebugLogsDirectory);return typeof e=="string"&&e.length>0?e:void 0}async appendSpans(e){if(!this.isEnabled()||e.length===0)return;let r=new Map;for(let n of e){let o=Eea(n);if(!o){Dgr.warn(this.ctx,`Dropping span without gen_ai.conversation.id (traceId=${n.traceId})`);continue}let s=r.get(o);s?s.push(n):r.set(o,[n])}for(let[n,o]of r)try{let s=this.getFilePath(n);await NMe.promises.mkdir(dge.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` +`),this._sseClients.add(e),gD.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),gD.debug(this._ctx,`[session ${this.id}] SSE client detached (total: ${this._sseClients.size})`)})}async handleIncoming(e){let r=Array.isArray(e)?e:[e],n=[];for(let o of r)Ldt(o)?n.push(await this._dispatchRequest(o)):bni(o)?this._dispatchNotification(o):gD.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0;for(let e of this._inFlightToolCalls.values())e.abort("MCP gateway session disposed");this._inFlightToolCalls.clear(),gD.info(this._ctx,`[session ${this.id}] disposing (SSE clients: ${this._sseClients.size})`);for(let e of this._sseClients)e.destroyed||e.end();this._sseClients.clear(),this._invoker.off(El.ToolsListChanged,this._onToolsListChanged),this._invoker.off(El.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(El.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(El.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){gD.debug(this._ctx,`[session ${this.id}] <-- request: ${e.method} (id=${String(e.id)})`);try{let r=await this._handleRequest(e);return{jsonrpc:"2.0",id:e.id,result:r}}catch(r){return r instanceof Yb?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(gD.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:Kb.InternalError,message:r instanceof Error?r.message:String(r)}})}}async _handleRequest(e){if(this._disposed)throw new Yb(Kb.InvalidRequest,"Session is disposed");if(e.method==="initialize")return this._handleInitialize(e);if(!this._isInitialized)throw new Yb(Kb.InvalidRequest,"Session is not initialized");switch(e.method){case"ping":return{};case"tools/list":return this._invoker.listTools();case"tools/call":return this._handleCallTool(e);case"resources/list":return this._invoker.listResources();case"resources/read":return this._handleReadResource(e);case"resources/templates/list":return this._invoker.listResourceTemplates();case"prompts/list":return this._invoker.listPrompts();case"prompts/get":return this._handleGetPrompt(e);case"logging/setLevel":return this._handleSetLoggingLevel(e);default:throw new Yb(Kb.MethodNotFound,`Method not found: ${e.method}`)}}_handleInitialize(e){let r=e.params&&typeof e.params=="object"?e.params:void 0,n=typeof r?.protocolVersion=="string"?r.protocolVersion:void 0,o=r?.clientInfo,s=n&&Dut.includes(n)?n:_R;return gD.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&gD.warn(this._ctx,`[session ${this.id}] unsupported client protocol version '${n}', falling back to '${s}'`),{protocolVersion:s,capabilities:{tools:{listChanged:!0},resources:{listChanged:!0},prompts:{listChanged:!0},logging:{}},serverInfo:{name:kMe,version:PMe}}}async _handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Yb(Kb.InvalidParams,"Missing tool name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{},o=r._meta&&typeof r._meta=="object"?r._meta:{},s=typeof o.progressToken=="string"||typeof o.progressToken=="number"?o.progressToken:void 0;if(this._inFlightToolCalls.has(e.id))throw new Yb(Kb.InvalidRequest,`Duplicate in-flight request id: ${String(e.id)}`);let c=new AbortController;this._inFlightToolCalls.set(e.id,c);try{return await this._invoker.callTool(r.name,n,{signal:c.signal,...s===void 0?{}:{onprogress:a(l=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/progress",params:{...l,progressToken:s}}),"onprogress")}})}catch(l){throw c.signal.aborted||Td(this._ctx,{message:`Error calling tool ${r.name}: ${l instanceof Error?l.message:String(l)}`,server:this._invoker.label}),l}finally{this._inFlightToolCalls.get(e.id)===c&&this._inFlightToolCalls.delete(e.id)}}_handleReadResource(e){let r=this._requireObjectParams(e);if(typeof r.uri!="string")throw new Yb(Kb.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Yb(Kb.InvalidParams,"Missing prompt name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};return this._invoker.getPrompt(r.name,n)}async _handleSetLoggingLevel(e){let r=this._requireObjectParams(e);if(typeof r.level!="string")throw new Yb(Kb.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new Yb(Kb.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){if(gD.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized")this._isInitialized=!0,gD.info(this._ctx,`[session ${this.id}] initialized`);else if(e.method==="notifications/cancelled"){let r=e.params&&typeof e.params=="object"?e.params:{},n=r.requestId;if(typeof n=="string"||typeof n=="number"){let o=this._inFlightToolCalls.get(n);o&&!o.signal.aborted&&o.abort(typeof r.reason=="string"?r.reason:void 0)}}}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){gD.debug(this._ctx,`[session ${this.id}] no SSE clients, dropping ${e.method}`);return}let r=JSON.stringify(e),n=String(++this._lastEventId),o=r.split(/\r?\n/g),s=[`id: ${n}`,"event: message",...o.map(c=>`data: ${c}`),"",""].join(` +`);for(let c of[...this._sseClients]){if(c.destroyed||c.writableEnded){this._sseClients.delete(c);continue}c.write(s)}}};function Uni(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(Uni,"isInitializeMessage");p();p();var Rii=fe(xii(),1),Hdt=fe(require("node:process"),1),kii=require("node:stream");p();var jdt=class{static{a(this,"ReadBuffer")}append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(` +`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),JXs(r)}clear(){this._buffer=void 0}};function JXs(t){return lG.parse(JSON.parse(t))}a(JXs,"deserializeMessage");function wii(t){return JSON.stringify(t)+` +`}a(wii,"serializeMessage");var ZXs=Hdt.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function XXs(){let t={};for(let e of ZXs){let r=Hdt.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(XXs,"getDefaultEnvironment");var lge=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new jdt,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new kii.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{this._process=(0,Rii.default)(this._serverParams.command,this._serverParams.args??[],{env:{...XXs(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:Hdt.default.platform==="win32",cwd:this._serverParams.cwd}),this._process.on("error",n=>{r(n),this.onerror?.(n)}),this._process.on("spawn",()=>{e()}),this._process.on("close",n=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",n=>{this.onerror?.(n)}),this._process.stdout?.on("data",n=>{this._readBuffer.append(n),this.processReadBuffer()}),this._process.stdout?.on("error",n=>{this.onerror?.(n)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._process){let e=this._process;this._process=void 0;let r=new Promise(n=>{e.once("close",()=>{n()})});try{e.stdin?.end()}catch{}if(await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())]),e.exitCode===null){try{e.kill("SIGTERM")}catch{}await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())])}if(e.exitCode===null)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(r=>{if(!this._process?.stdin)throw new Error("Not connected");let n=wii(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var Pii=require("child_process"),Dii=require("events"),Nii=require("util");var Rgr=1e4,eea=(0,Nii.promisify)(Pii.exec),DMe=class{constructor(e){this._transport=null;this._emitter=new Dii.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new _G({name:e.clientInfo.name,version:e.clientInfo.version},{capabilities:{}})}static{a(this,"StdioInvoker")}get isConnected(){return this._connected}async start(){if(this._connected)return;let e={...this._options.params,stderr:"pipe"},r=new lge(e);this._transport=r,this._client.onerror=n=>this._options.onError?.(n),this._client.onclose=()=>{this._connected=!1},r.stderr&&r.stderr.on("data",n=>{this._options.onStderr?.(n.toString())}),this._client.setNotificationHandler(j8,()=>{this._emitter.emit(El.ToolsListChanged)}),this._client.setNotificationHandler(Q8,()=>{this._emitter.emit(El.ResourcesListChanged)}),this._client.setNotificationHandler(q8,()=>{this._emitter.emit(El.PromptsListChanged)}),this._client.setNotificationHandler(gee,n=>{this._emitter.emit(El.LoggingMessage,n)}),await this._client.connect(r),this._connected=!0}async stop(){if(!this._transport){this._connected=!1;return}let e=this._transport;this._transport=null;let r=this._client.close().catch(()=>{}),n=await Promise.race([r.then(()=>!0),new Promise(s=>setTimeout(()=>s(!1),Rgr))]),o;if("pid"in e&&typeof e.pid=="number"&&(o=e.pid),!n&&o===void 0&&this._options.onError?.(new Error(`stdio transport exposed no pid; cannot force-kill '${this.id}'`)),!n&&o!==void 0&&process.platform==="win32")try{await eea(`taskkill /pid ${o} /t /f`,{timeout:Rgr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,Rgr));try{process.kill(o,"SIGKILL")}catch{}}this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r,n){return this._client.callTool({name:e,arguments:r},CR,{...n,timeout:this._options.toolCallTimeoutMs,resetTimeoutOnProgress:n?.onprogress!==void 0})}listResources(){return this._client.listResources()}readResource(e){return this._client.readResource({uri:e})}listResourceTemplates(){return this._client.listResourceTemplates()}listPrompts(){return this._client.listPrompts()}getPrompt(e,r){return this._client.getPrompt({name:e,arguments:r})}async setLoggingLevel(e){await this._client.setLoggingLevel(e.level)}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}};p();var xm=class{static{a(this,"AuthenticationService")}};var aI=new pe("mcpGateway.manager");function Mii(t){if(!(t.allowedMcpServers===void 0&&t.deniedMcpServers===void 0))return{allowed:t.allowedMcpServers,denied:t.deniedMcpServers}}a(Mii,"selectManagedMcpSettings");var CG=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},tea={tools:[],resources:[],resourceTemplates:[],prompts:[]},gy=class{constructor(e,r,n){this._entries=new Map;this._disposed=!1;this._applyChain=Promise.resolve();this._oauthChain=Promise.resolve();this._actionChains=new Map;this._ctx=e,this._service=r,this._sender=n,this._unregister=n,this._managedSettings=this._tryGetManagedSettings(),this._managedSettingsSub=this._managedSettings?.observe(Mii,()=>this._onMcpSettingsChanged())}static{a(this,"McpServerManager")}listServers(e){let r=[];for(let n of this._entries.values())iea(n.key.source,e)&&r.push({name:n.key.name,source:n.key.source,status:n.status,error:n.error,authInfo:n.authInfo,registryInfo:n.registryInfo});return r}getServerDetails(e){let r=this._entries.get(vG(e));return r?{tools:r.contents.tools,resources:r.contents.resources,resourceTemplates:r.contents.resourceTemplates,prompts:r.contents.prompts}:null}listReadyEntries(){let e=[];for(let r of this._entries.values()){if(r.status!=="running"||!this._evaluateAllowlist(r).allowed)continue;let n=vG(r.key),o=this._service.listMounts().find(s=>s.id===n);e.push({key:r.key,url:o?.url??null,toolCallTimeoutMs:r.classified.toolCallTimeoutMs})}return e}async applyConfig(e){if(this._disposed)throw new Error("McpServerManager is disposed");let r=this._applyChain.then(()=>this._applyConfigLocked(e));return this._applyChain=r.catch(()=>{}),r}async removeProject(e){if(this._disposed)return;let r=this._applyChain.then(()=>this._removeProjectLocked(e));return this._applyChain=r.catch(()=>{}),r}async applyPluginServers(e,r){if(this._disposed)throw new Error("McpServerManager is disposed");let n=this._applyChain.then(()=>this._applyScope({kind:"plugin",pluginId:e},r));return this._applyChain=n.catch(()=>{}),n}async removePluginServers(e){return this.applyPluginServers(e,{})}async _applyConfigLocked(e){let{workspaceFolder:r,user:n,project:o}=e,s=rea(n),c=s!==this._lastUserHash;c&&(await this._applyScope({kind:"user"},n),this._lastUserHash=s),await this._applyScope({kind:"project",workspaceFolder:r},o),sr(this._ctx,"mcpGateway.applyConfig",{userChanged:String(c),hasProject:String(Object.keys(o).length>0)},{userServerCount:Object.keys(n).length,projectServerCount:Object.keys(o).length})}async _applyScope(e,r){let n=new Map,o=[];for(let[l,u]of Object.entries(r)){let d=sea(l,u);if(!d){o.push(l);continue}n.set(vG({source:e,name:l}),{classified:d,hash:Oii(u)})}o.length>0&&aI.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries in ${oea(e)}: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)nea(u.key.source,e)&&!n.has(l)&&s.push(l);for(let l of s)await this._removeEntry(l);let c=!1;for(let[l,{classified:u,hash:d}]of n){let f=this._entries.get(l);f?f.entryHash!==d&&(await this._stopInvoker(f,"starting"),f.classified=u,f.entryHash=d,f.error=void 0,c=!0,this._beginStart(l)):(this._createEntry({source:e,name:u.name},u,d),c=!0)}c&&this._sender.serversChanged(N4(e))}async _removeProjectLocked(e){let r=[];for(let[n,o]of this._entries)o.key.source.kind==="project"&&o.key.source.workspaceFolder===e&&r.push(n);if(r.length!==0)for(let n of r)await this._removeEntry(n)}serverAction(e,r){let n=vG(e),o=this._entries.get(n);if(!o)throw new CG("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new CG("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new CG("noAuth",`Server '${e.name}' has no auth state to clear`);break}let c=(this._actionChains.get(n)??Promise.resolve()).then(()=>this._runAction(n,r));return this._actionChains.set(n,c.catch(()=>{})),Promise.resolve()}async _runAction(e,r){let n=this._entries.get(e);if(n)switch(r){case"start":if(n.status==="running"||n.status==="starting")return;await this._beginStart(e);return;case"stop":if(n.status==="stopped")return;await this._stopInvoker(n,"stopped"),this._sender.serversChanged(N4(n.key.source));return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(N4(n.key.source)),await this._beginStart(e);return;case"logout":await this._performLogout(n,!1);return;case"clearOAuth":await this._performLogout(n,!0),await this._beginStart(e);return}}async dispose(){if(this._disposed)return;this._disposed=!0,this._managedSettingsSub?.dispose(),this._managedSettingsSub=void 0;let e=[...this._entries.values()].map(r=>this._stopInvoker(r,"stopped").catch(()=>{}));this._entries.clear(),await Promise.all(e)}_toEvalServer(e){let r=e.classified;if(r.kind==="stdio"){let{command:n,args:o}=r.params;return{name:e.key.name,transport:{kind:"stdio",command:[n,...o??[]]}}}return{name:e.key.name,transport:{kind:r.type,url:r.url}}}_evaluateAllowlist(e){let r=this._managedSettings?Mii(this._managedSettings.get()):void 0;return hgr(this._toEvalServer(e),r)}async _markBlocked(e,r){e.error=r,$c(this._ctx,"mcpGateway.allowlist.blocked",{transport:e.classified.kind==="stdio"?"stdio":e.classified.type,source:e.key.source.kind}),await this._stopInvoker(e,"blocked")}_onMcpSettingsChanged(){if(this._disposed)return;let e=this._applyChain.then(()=>this._reEnforceAllowlistLocked());this._applyChain=e.catch(()=>{})}async _reEnforceAllowlistLocked(){for(let[e,r]of this._entries){let n=this._evaluateAllowlist(r);!n.allowed&&r.status!=="blocked"?await this._markBlocked(r,n.reason):n.allowed&&r.status==="blocked"&&(r.error=void 0,this._beginStart(e))}}_createEntry(e,r,n){let o={key:e,classified:r,entryHash:n,invoker:null,status:"stopped",contents:{...tea},listeners:null};return this._entries.set(vG(e),o),o}async _removeEntry(e){let r=this._entries.get(e);if(!r)return;let n=N4(r.key.source);await this._stopInvoker(r,"stopped").catch(()=>{}),this._entries.delete(e),this._sender.serversChanged(n)}async _beginStart(e){let r=this._entries.get(e);if(!r)return;let n=this._evaluateAllowlist(r);if(!n.allowed){await this._markBlocked(r,n.reason);return}r.invoker?await this._stopInvoker(r,"starting"):(r.status="starting",r.error=void 0,this._sender.serversChanged(N4(r.key.source)));let o=this._buildInvoker(r);r.invoker=o,this._wireInvokerEvents(r);try{if(await o.start(),r.invoker!==o){await o.stop().catch(()=>{});return}r.status="running",r.error=void 0;try{await this._service.registerMount(o,r.key.name)}catch(s){throw aI.error(this._ctx,`failed to register mount for '${r.key.name}'`,s),s}if(r.invoker!==o){this._service.unregisterMount(vG(r.key)),await o.stop().catch(()=>{});return}if(await this._refreshContents(r).catch(s=>{aI.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(s)}`)}),r.invoker!==o)return;this._sender.serversChanged(N4(r.key.source)),this._sender.serverDetailsChanged(r.key),la(this._ctx,{message:"Connection state: Running",server:r.key.name})}catch(s){if(r.invoker!==o){await o.stop().catch(()=>{});return}s instanceof ige?(r.status="unauthorized",r.error=void 0,aI.warn(this._ctx,`server '${r.key.name}' requires authorization`),mD(this._ctx,{message:"Connection state: Unauthorized (authorization required)",server:r.key.name})):(r.status="error",r.error=s instanceof Error?s.message:String(s),aI.error(this._ctx,`server '${r.key.name}' failed to start`,s),Td(this._ctx,{message:`Connection state: Error: ${r.error}`,server:r.key.name})),await o.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged(N4(r.key.source))}}async _stopInvoker(e,r){let n=e.invoker;this._unwireInvokerEvents(e),e.invoker=null,e.status=r,r!=="error"&&r!=="blocked"&&(e.error=void 0),this._service.unregisterMount(vG(e.key)),this._sender.serversChanged(N4(e.key.source)),n&&(r==="stopped"&&la(this._ctx,{message:"Connection state: Stopped",server:e.key.name}),await n.stop().catch(o=>{aI.warn(this._ctx,`failed to stop invoker '${e.key.name}': ${String(o)}`)}))}_wireInvokerEvents(e){let r=e.invoker;if(!r)return;let n={toolsChanged:a(()=>{this._onUpstreamListChanged(e,"tools")},"toolsChanged"),resourcesChanged:a(()=>{this._onUpstreamListChanged(e,"resources")},"resourcesChanged"),promptsChanged:a(()=>{this._onUpstreamListChanged(e,"prompts")},"promptsChanged"),loggingMessage:a(o=>this._onUpstreamLog(e,o),"loggingMessage")};r.on(El.ToolsListChanged,n.toolsChanged),r.on(El.ResourcesListChanged,n.resourcesChanged),r.on(El.PromptsListChanged,n.promptsChanged),r.on(El.LoggingMessage,n.loggingMessage),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(El.ToolsListChanged,n.toolsChanged),r.off(El.ResourcesListChanged,n.resourcesChanged),r.off(El.PromptsListChanged,n.promptsChanged),r.off(El.LoggingMessage,n.loggingMessage)),e.listeners=null}_onUpstreamLog(e,r){let n=r.params.data,o=typeof n=="string"?n:JSON.stringify(n),s=r.params.logger?`${r.params.logger}: ${o}`:o,c=e.key.name;switch(r.params.level){case"warning":mD(this._ctx,{message:s,server:c});break;case"error":case"critical":case"alert":case"emergency":Td(this._ctx,{message:s,server:c});break;default:la(this._ctx,{message:s,server:c})}}async _onUpstreamListChanged(e,r){if(e.invoker)try{if(r==="tools"){let n=await e.invoker.listTools();e.contents.tools=n.tools}else if(r==="resources"){let[n,o]=await Promise.all([e.invoker.listResources(),e.invoker.listResourceTemplates()]);e.contents.resources=n.resources,e.contents.resourceTemplates=o.resourceTemplates}else{let n=await e.invoker.listPrompts();e.contents.prompts=n.prompts}this._sender.serverDetailsChanged(e.key)}catch(n){aI.warn(this._ctx,`failed to refresh ${r} for '${e.key.name}': ${String(n)}`)}}async _refreshContents(e){if(!e.invoker)return;let r=await Promise.allSettled([e.invoker.listTools(),e.invoker.listResources(),e.invoker.listResourceTemplates(),e.invoker.listPrompts()]);e.contents={tools:r[0].status==="fulfilled"?r[0].value.tools:[],resources:r[1].status==="fulfilled"?r[1].value.resources:[],resourceTemplates:r[2].status==="fulfilled"?r[2].value.resourceTemplates:[],prompts:r[3].status==="fulfilled"?r[3].value.prompts:[]}}_buildInvoker(e){let r=e.classified,n=vG(e.key),o=e.key.name,s=a(c=>{Td(this._ctx,{message:`Connection state: Error: ${c.message}`,server:o})},"onError");return r.kind==="stdio"?new DMe({id:n,label:o,params:r.params,toolCallTimeoutMs:r.toolCallTimeoutMs,clientInfo:{name:kMe,version:PMe},onStderr:a(c=>{mD(this._ctx,{message:`[server stderr] ${c.trimEnd()}`,server:o})},"onStderr"),onError:s}):new xMe({id:n,label:o,url:r.url,type:r.type,httpOptions:r.type==="http"?r.httpOptions:void 0,sseOptions:r.type==="sse"?r.sseOptions:void 0,toolCallTimeoutMs:r.toolCallTimeoutMs,clientInfo:{name:kMe,version:PMe},onError:s,authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:c})=>{aI.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${c}, falling back to legacy SSE`),sr(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(c)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(xm)}catch{return}}_tryGetManagedSettings(){try{return this._ctx.get(ay)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await Lni(this._ctx,r,n);if(!s){aI.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await Qdt(this._ctx,c,s,e.key.name);if(e.authDiscovery={discovery:s,providerId:l.providerId},l.token){let u=l.sessions.find(d=>d.accessToken===l.token);u&&this._setAuthInfo(e,{providerId:l.providerId,accountName:u.account.label})}return e.authDiscovery}catch(c){aI.error(this._ctx,`'${e.key.name}': dynamic provider setup failed`,c);return}},"ensureDiscovery");return async s=>{let c=this._tryGetAuthSvc();if(!c)return;let l=await o();if(!l)return;if(s==="silent"){let f=await Qdt(this._ctx,c,l.discovery,e.key.name);if(f.token){let h=f.sessions.find(m=>m.accessToken===f.token);h&&this._setAuthInfo(e,{providerId:l.providerId,accountName:h.account.label})}return f.token}let u,d=this._oauthChain.then(async()=>{let f=await Qdt(this._ctx,c,l.discovery,e.key.name);if(f.token){u=f.token;let h=f.sessions.find(m=>m.accessToken===u);h&&this._setAuthInfo(e,{providerId:l.providerId,accountName:h.account.label});return}if(u=await Bni(this._ctx,c,l.discovery,l.providerId,e.key.name,r,f.sessions),u){let m=(await c.getSessions(l.providerId,l.discovery.scopes,{authorizationServer:l.discovery.authorizationServer},!0)).find(g=>g.accessToken===u);m&&this._setAuthInfo(e,{providerId:l.providerId,accountName:m.account.label})}});return this._oauthChain=d.catch(()=>{}),await d,u}}_setAuthInfo(e,r){e.authInfo?.providerId===r.providerId&&e.authInfo?.accountName===r.accountName||(e.authInfo=r,this._sender.serversChanged(N4(e.key.source)))}async _performLogout(e,r){await this._stopInvoker(e,"stopped").catch(()=>{});let n=this._tryGetAuthSvc(),o=e.authInfo?.providerId??e.authDiscovery?.providerId;if(n&&o)try{let s=n.getProvider(o),c=await n.getSessions(o,e.authDiscovery?.discovery.scopes??[],e.authDiscovery?{authorizationServer:e.authDiscovery.discovery.authorizationServer}:void 0,!0);for(let l of c)await s.removeSession(l.id).catch(u=>aI.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){aI.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){aI.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged(N4(e.key.source))}};function vG(t){switch(t.source.kind){case"user":return`user::${t.name}`;case"project":return`project::${t.source.workspaceFolder}::${t.name}`;case"plugin":return`plugin::${t.source.pluginId}::${t.name}`}}a(vG,"serializeKey");function Oii(t){if(!t||typeof t!="object")return JSON.stringify(t);let e=t,r=Object.keys(e).sort(),n={};for(let o of r)n[o]=e[o];return JSON.stringify(n)}a(Oii,"canonicalEntryHash");function rea(t){let e=Object.keys(t).sort(),r={};for(let n of e)r[n]=Oii(t[n]);return JSON.stringify(r)}a(rea,"canonicalConfigHash");function N4(t){return t.kind==="project"?{kind:"project",workspaceFolder:t.workspaceFolder}:{kind:"user"}}a(N4,"notificationScopeFor");function nea(t,e){return t.kind!==e.kind?!1:t.kind==="project"&&e.kind==="project"?t.workspaceFolder===e.workspaceFolder:t.kind==="plugin"&&e.kind==="plugin"?t.pluginId===e.pluginId:t.kind==="user"&&e.kind==="user"}a(nea,"sameScope");function iea(t,e){return e===void 0||t.kind==="user"||t.kind==="plugin"?!0:t.kind==="project"&&e.kind==="project"?t.workspaceFolder===e.workspaceFolder:!1}a(iea,"entryInScope");function oea(t){switch(t.kind){case"user":return"user";case"project":return`project<${t.workspaceFolder}>`;case"plugin":return`plugin<${t.pluginId}>`}}a(oea,"describeScope");function sea(t,e){if(!e||typeof e!="object")return;let r=e,n=typeof r.timeout=="number"?r.timeout:void 0,o={...r};if(delete o.timeout,typeof r.command=="string")return{kind:"stdio",name:t,params:o,toolCallTimeoutMs:n};if(typeof r.url=="string"){let c=(typeof r.type=="string"?r.type:void 0)==="sse"?"sse":"http";return{kind:"http",name:t,url:r.url,type:c,httpOptions:c==="http"?o:void 0,sseOptions:c==="sse"?o:void 0,toolCallTimeoutMs:n}}}a(sea,"classifyEntry");p();var kgr=require("crypto"),Lii=require("events"),Bii=fe(require("http"));var bG=new pe("mcpGateway"),aea="mcp-session-id",cea=1024*1024,lea=5e3,Fii={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},Oee={MountsChanged:"mountsChanged"},SG=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new Lii.EventEmitter;this._connections=new Set;this._ctx=e,this._host=r.host??"127.0.0.1"}static{a(this,"McpGatewayService")}get port(){return this._port}get origin(){return this._port===void 0?void 0:`http://${this._host}:${this._port}`}listMounts(){let e=[];for(let[r,n]of this._routes)e.push(this._buildMountInfo(n.invoker.id,n.label,r,n.status));return e}setMountStatus(e,r){let n=this._idToRouteId.get(e);if(!n)return;let o=this._routes.get(n);if(!o||o.status===r)return;let s=o.status;o.status=r,bG.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),sr(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(Oee.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=Fii.Ready){if(await this._ensureServer(),this._port===void 0)throw new Error("Gateway server failed to start");if(this._idToRouteId.get(e.id))throw new Error(`Mount already registered for id '${e.id}'`);let s=(0,kgr.randomUUID)(),c=r??e.label;this._routes.set(s,{invoker:e,label:c,sessions:new Map,status:n}),this._idToRouteId.set(e.id,s);let l=this._buildMountInfo(e.id,c,s,n);return bG.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),sr(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(Oee.MountsChanged,this.listMounts()),l}unregisterMount(e){let r=this._idToRouteId.get(e);if(!r)return;let n=this._routes.get(r);if(n){for(let o of n.sessions.values())o.dispose();n.sessions.clear(),this._routes.delete(r),this._idToRouteId.delete(e),bG.info(this._ctx,`unregistered mount '${n.label}' (${e})`),sr(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(Oee.MountsChanged,this.listMounts())}}dispose(){for(let e of this._routes.values()){for(let r of e.sessions.values())r.dispose();e.sessions.clear()}this._routes.clear(),this._idToRouteId.clear(),this._stopServer()}async _ensureServer(){if(!this._server?.listening){if(this._startPromise)return this._startPromise;this._startPromise=this._startServer();try{await this._startPromise}finally{this._startPromise=void 0}}}_startServer(){return new Promise((e,r)=>{let n=Bii.createServer((s,c)=>this._handleRequest(s,c));n.requestTimeout=0,this._server=n,n.on("connection",s=>{this._connections.add(s),s.on("close",()=>this._connections.delete(s))});let o=setTimeout(()=>r(new Error("Gateway listen timeout")),lea);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),bG.info(this._ctx,`listening on http://${this._host}:${this._port}`),e()}),n.on("error",s=>{if(s.code==="EADDRINUSE"){n.listen(0,this._host);return}clearTimeout(o),r(s)}),n.listen(0,this._host)})}_stopServer(){if(this._server){bG.info(this._ctx,"stopping HTTP server");for(let e of this._connections)e.destroy();this._connections.clear(),this._server.close(),this._server=void 0,this._port=void 0}}_handleRequest(e,r){let o=new URL(e.url??"/",`http://${e.headers.host??"127.0.0.1"}`).pathname.split("/").filter(Boolean);if(o.length<2||o[1]!=="mcp"){this._respondHttpError(r,404,"Not found");return}let s=o[0],c=this._routes.get(s);if(!c){this._respondHttpError(r,404,"Mount not found");return}if(e.method==="POST"){this._handlePost(c,e,r);return}if(e.method==="GET"){this._handleGet(c,e,r);return}if(e.method==="DELETE"){this._handleDelete(c,e,r);return}this._respondHttpError(r,405,"Method not allowed")}async _handlePost(e,r,n){let o=await this._readBody(r);if(o===void 0){this._respondHttpError(n,413,"Payload too large");return}let s;try{s=JSON.parse(o)}catch(u){let d={jsonrpc:"2.0",id:null,error:{code:Kb.ParseError,message:u instanceof Error?u.message:String(u)}};n.writeHead(400,{"Content-Type":"application/json"}),n.end(JSON.stringify(d));return}let c=this._getSessionId(r),l=this._resolveSession(e,c,s,n);if(l)try{let u=await l.handleIncoming(s),d={"Content-Type":"application/json","Mcp-Session-Id":l.id};if(u.length===0||!this._hasRequest(s)){n.writeHead(202,d),n.end();return}let f=JSON.stringify(Array.isArray(s)?u:u[0]);n.writeHead(200,d),n.end(f)}catch(u){bG.error(this._ctx,"POST handler failed",u),this._respondHttpError(n,500,"Internal server error")}}_handleGet(e,r,n){let o=this._getSessionId(r);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let s=e.sessions.get(o);if(!s){this._respondHttpError(n,404,"Session not found");return}s.attachSseClient(n)}_handleDelete(e,r,n){let o=this._getSessionId(r);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let s=e.sessions.get(o);if(!s){this._respondHttpError(n,404,"Session not found");return}s.dispose(),n.writeHead(204),n.end()}_resolveSession(e,r,n,o){if(r){let l=e.sessions.get(r);if(!l){this._respondHttpError(o,404,"Session not found");return}return l}if(!Uni(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,kgr.randomUUID)(),c=new RMe(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&bG.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),bG.info(this._ctx,`mount '${e.label}' session attached (sid=${s}, active sessions: ${e.sessions.size})`),c}_hasRequest(e){return(Array.isArray(e)?e:[e]).some(Ldt)}_getSessionId(e){let r=e.headers[aea];return Array.isArray(r)?r[0]:r}async _readBody(e){let r=[],n=0;for await(let o of e){let s=Buffer.isBuffer(o)?o:Buffer.from(o);if(n+=s.byteLength,n>cea)return;r.push(s)}return Buffer.concat(r).toString("utf8")}_respondHttpError(e,r,n){e.writeHead(r,{"Content-Type":"application/json"});let o={jsonrpc:"2.0",id:null,error:{code:r,message:n}};e.end(JSON.stringify(o))}_buildMountInfo(e,r,n,o){return{id:e,label:r,routeId:n,url:`${this.origin}/${n}/mcp`,status:o}}};p();var Uii=[{type:"skill",pick:a(t=>t.skills,"pick")},{type:"agent",pick:a(t=>t.agents,"pick")},{type:"instructions",pick:a(t=>t.instructions,"pick")},{type:"prompt",pick:a(t=>t.commands,"pick")}],J8=class{constructor(e,r){this.ctx=e;this.service=r;this.logger=new pe("PluginContributionInjector");this.registered=new Map;this.disposed=!1;this.syncChain=Promise.resolve();this.changeSubscription=this.service.onDidChangePlugins(()=>this.scheduleSync()),this.gateSubscription=this.subscribeToGateChanges()}static{a(this,"PluginContributionInjector")}subscribeToGateChanges(){try{let e=this.ctx.get(Qo);return this.lastPluginsEnabled=aG(this.ctx),e.onDidChangeCopilotSettings(()=>{let r=aG(this.ctx);r!==this.lastPluginsEnabled&&(this.lastPluginsEnabled=r,this.initialSyncPromise=void 0,this.scheduleSync())})}catch{return}}async ensureInitialSync(){if(this.disposed)return;if(this.initialSyncPromise)return this.initialSyncPromise;if(!this.isEditorIdentityKnown())return;let e,r=new Promise(n=>e=n);return this.initialSyncPromise=r,this.syncChain=this.syncChain.then(()=>this.sync()).then(n=>{n||(this.initialSyncPromise=void 0)}).catch(n=>{this.initialSyncPromise=void 0,this.logger.warn(this.ctx,"plugin contribution initial sync failed",{err:String(n)})}).finally(()=>e()),r}isEditorIdentityKnown(){try{return this.ctx.get(Ir).isEditorPluginInfoKnown()}catch{return!0}}scheduleSync(){this.syncChain=this.syncChain.then(()=>this.sync()).then(()=>{}).catch(e=>{this.logger.warn(this.ctx,"plugin contribution sync failed",{err:String(e)})})}syncedForTesting(){return this.syncChain}async sync(){if(this.disposed)return!0;if(!aG(this.ctx))return this.teardownAll(),!0;let e;try{e=(await this.service.listPlugins()).filter(vme)}catch(n){return this.logger.warn(this.ctx,"listPlugins failed during sync",{err:String(n)}),!1}if(this.disposed)return!0;let r=new Map(e.map(n=>[n.uri,n]));for(let n of[...this.registered.keys()])r.has(n)||this.teardownPlugin(n);for(let[n,o]of r)if(await this.reconcilePlugin(n,o),this.disposed)return!0;return!0}async reconcilePlugin(e,r){let n=this.registered.get(e),o=uea(r),s=dea(r),c=n?.disposables??[];if(!n||n.fileHash!==o){for(let u of c)u.dispose();c=this.registerFiles(e,r)}let l=n?.mcpApplied??!1;if((!n||n.mcpHash!==s||!n.mcpApplied)&&(l=await this.applyMcp(e,r,n)),this.disposed){for(let u of c)u.dispose();l&&this.tryManager()?.removePluginServers(e).catch(d=>this.logger.warn(this.ctx,"removePluginServers failed",{uri:e,err:String(d)}));return}this.registered.set(e,{fileHash:o,mcpHash:s,mcpApplied:l,disposables:c})}registerFiles(e,r){let n=this.tryRegistry();if(!n)return[];let o=[];for(let{type:s,pick:c}of Uii)for(let l of c(r))o.push(n.register(s,[fea(l.uri)],{watchable:!1,classification:{storage:"plugin",pluginInfo:{name:l.name,description:l.description??"",pluginUri:e}}}));return o}async applyMcp(e,r,n){let o=this.tryManager();if(!o)return!0;let s=pea(r.mcpServerDefinitions);if(Object.keys(s).length===0&&!n?.mcpApplied)return!0;try{return await o.applyPluginServers(e,s),!0}catch(c){return this.logger.warn(this.ctx,"applyPluginServers failed",{uri:e,err:String(c)}),!1}}teardownPlugin(e){let r=this.registered.get(e);if(!r)return;for(let o of r.disposables)o.dispose();let n=this.tryManager();n&&n.removePluginServers(e).catch(o=>this.logger.warn(this.ctx,"removePluginServers failed",{uri:e,err:String(o)})),this.registered.delete(e)}teardownAll(){for(let e of[...this.registered.keys()])this.teardownPlugin(e)}tryRegistry(){return this.tryGet(QA)}tryManager(){return this.tryGet(gy)}tryGet(e){try{return this.ctx.get(e)}catch(r){if(r instanceof Ic)return;throw r}}dispose(){this.disposed||(this.disposed=!0,this.changeSubscription.dispose(),this.gateSubscription?.dispose(),this.teardownAll())}};function uea(t){let e=Uii.flatMap(({pick:r})=>r(t).map(n=>JSON.stringify([n.uri,n.name,n.description??""]))).sort();return JSON.stringify(e)}a(uea,"fileContentHash");function dea(t){let e=t.mcpServerDefinitions.map(r=>JSON.stringify([r.name,r.configuration])).sort();return JSON.stringify(e)}a(dea,"mcpContentHash");function fea(t){return t.includes("://")?un(t):t}a(fea,"toPathPattern");function pea(t){let e={};for(let{name:r,configuration:n}of t)n.type==="stdio"?e[r]={command:n.command,...n.args&&{args:[...n.args]},...n.env&&{env:{...n.env}},...n.cwd&&{cwd:n.cwd}}:e[r]={url:n.url,...n.headers&&{headers:{...n.headers}}};return e}a(pea,"toMcpServersConfig");var Qii=fe(require("node:path"));var Gdt=new pe("BackgroundAgent.SessionOptionsBuilder"),hea=5e3;async function qii(t,e,r,n){let o=LO((async()=>{try{await t.get(J8).ensureInitialSync()}catch(A){if(!(A instanceof Ic))throw A}})(),hea,void 0),s=await n.buildAuthInfo(),c=oo(r.workspaceFolder.uri).fsPath;await o;let l;try{l=t.get(xg).getSkillDirectories(c),l.length===0&&(l=void 0)}catch{}let u={clientName:t.get(Ir).getEditorPluginInfo().name,sessionId:e,authInfo:s,model:r.model,reasoningEffort:r.reasoningEffort,enableStreaming:r.enableStreaming??!0,excludedTools:r.excludedTools,skillDirectories:l,disabledSkills:r.disabledSkills?new Set(r.disabledSkills):void 0,workingDirectory:c,infiniteSessions:{enabled:!0},memory:{enabled:!0}};try{await t.get(aF)._handleWorkspaceAdded({uri:r.workspaceFolder.uri,name:r.workspaceFolder.name??""})}catch{}let d=await mZn(t,r.workspaceFolder);d.length>0&&(u.customAgents=d);let f=r.mcpDirectory??r.workspaceFolder.uri;try{let A=t.get(yR).buildMcpServers(f);Gdt.info(t,"Built MCP gateway servers for SDK options",{sessionId:e,gatewayServers:A}),Object.keys(A).length>0&&(u.mcpServers=A)}catch(A){if(!(A instanceof Ic))throw A}u.hooks=gZn(t,r.workspaceFolder);let h=await BXn(t,r.workspaceFolder);if(u.hooks=FXn(u.hooks,h),r.inlineConfinedFile){let A=[...u.hooks.preToolUse??[]];r.inlineConfinementHook&&A.unshift(r.inlineConfinementHook),r.inlineTurnLimiter&&A.unshift(r.inlineTurnLimiter.hook),u.hooks={...u.hooks,preToolUse:A},u.systemMessage={mode:"append",content:qXn(r.inlineConfinedFile)}}else{let A=await Ppr(t,[r.workspaceFolder]).catch(v=>{Gdt.warn(t,"Failed to load git commit instructions for systemMessage",v)}),y=r.useNestedAgentsMdFiles===!0?await gea(t,c):void 0,_=r.useNestedClaudeMdFiles===!0?await mea(t,c):void 0,E=vZn({gitCommitInstructions:A,globalAgentsMdInstructions:r.globalAgentsMdInstructions,nestedAgentsInstructions:y,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:_});E!==void 0&&(u.systemMessage={mode:"append",content:E})}r.externalToolDefinitions?.length&&(u.externalToolDefinitions=r.externalToolDefinitions);let m=AZn(r);m.size>0&&(u.disabledInstructionSources=m);let g=Rut(t);return g&&(u.sandboxConfig=g),u}a(qii,"buildSessionOptions");async function mea(t,e){let r;try{r=t.get(Go)}catch{return}try{return await _Zn(async n=>r.readDirectory(Ko(n)),async n=>jii(r,e,n),e)}catch(n){Gdt.warn(t,"Failed to scan nested CLAUDE.md files",n);return}}a(mea,"scanNestedClaudeSection");async function gea(t,e){let r;try{r=t.get(Go)}catch{return}try{return await EZn(async n=>r.readDirectory(Ko(n)),async n=>jii(r,e,n),e)}catch(n){Gdt.warn(t,"Failed to scan nested AGENTS.md files",n);return}}a(gea,"scanNestedAgentsSection");async function jii(t,e,r){try{return await t.readFileString(Ko(Qii.join(e,r)))}catch{return}}a(jii,"readNestedFile");p();var Aea=20,$dt=new pe("BackgroundAgent.SessionRegistry"),Vdt=class{constructor(e,r){this.ctx=e;this.onSessionEvicted=r;this.sessions=new Map;this.resumeOptions=new Map;this.workingDirs=new Map;this.workspaceFolderUris=new Map;this.mcpDirectories=new Map;this.turnIndexes=new Map;this.chatModes=new Map;this.providerModels=new Map;this.appliedSandboxConfig=new Map;this.confinedFiles=new Map;this.turnLimiters=new Map;this.children=new Map}static{a(this,"SessionRegistry")}set(e,r){if(this.sessions.has(e)&&this.sessions.delete(e),this.sessions.set(e,r),this.sessions.size>Aea){let n=this.sessions.keys().next().value;if(n!==void 0&&n!==e){let o=this.sessions.get(n);if(!o)return;$dt.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.sessions.delete(n);let s=Promise.resolve();try{s=this.onSessionEvicted?.(n,o)??s}catch(c){s=Promise.reject(c instanceof Error?c:new Error(String(c)))}Promise.all([this.removeExpected(n,o),s]).catch(c=>$dt.warn(this.ctx,`Failed to evict session ${n}`,{error:c instanceof Error?c.message:String(c)}))}}}get(e){return this.sessions.get(e)}has(e){return this.sessions.has(e)}size(){return this.sessions.size}entries(){return this.sessions.entries()}forgetSession(e){this.sessions.delete(e)}setResumeOptions(e,r){this.resumeOptions.set(e,r)}getResumeOptions(e){return this.resumeOptions.get(e)}setWorkingDir(e,r){this.workingDirs.set(e,r)}getWorkingDir(e){return this.workingDirs.get(e)}workingDirEntries(){return this.workingDirs}setWorkspaceFolderUri(e,r){this.workspaceFolderUris.set(e,r)}getWorkspaceFolderUri(e){return this.workspaceFolderUris.get(e)}setMcpDirectory(e,r){this.mcpDirectories.set(e,r)}getMcpDirectory(e){return this.mcpDirectories.get(e)}incrementTurnIndex(e){let r=(this.turnIndexes.get(e)??-1)+1;return this.turnIndexes.set(e,r),r}seedTurnIndexIfAbsent(e,r){this.turnIndexes.has(e)||this.turnIndexes.set(e,r)}setChatMode(e,r){this.chatModes.set(e,r)}getChatMode(e){return this.chatModes.get(e)}deleteChatMode(e){this.chatModes.delete(e)}clearChatMode(){this.chatModes.clear()}chatModeEntries(){return this.chatModes}setProviderModel(e,r){this.providerModels.set(e,r)}getProviderModel(e){return this.providerModels.get(e)}deleteProviderModel(e){this.providerModels.delete(e)}setAppliedSandboxConfig(e,r){this.appliedSandboxConfig.set(e,r)}getAppliedSandboxConfig(e){return this.appliedSandboxConfig.get(e)}deleteAppliedSandboxConfig(e){this.appliedSandboxConfig.delete(e)}setConfinedFile(e,r){this.confinedFiles.set(e,r)}getConfinedFile(e){return this.confinedFiles.get(e)}hasConfinedFile(e){return this.confinedFiles.has(e)}setTurnLimiter(e,r){this.turnLimiters.set(e,r)}getTurnLimiter(e){return this.turnLimiters.get(e)}registerChild(e,r){let n=this.children.get(e);n||(n=[],this.children.set(e,n)),n.push(r)}async remove(e){let r=this.sessions.get(e);await this.removeExpected(e,r)}async removeExpected(e,r){let n=this.children.get(e);this.children.delete(e),n&&await Promise.all(n.map(async s=>{try{await Promise.resolve(s.dispose())}catch(c){$dt.warn(this.ctx,"Child Disposable failed during session removal",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}));let o=this.sessions.get(e);if(r!==void 0&&o!==void 0&&o!==r){$dt.debug(this.ctx,`Skipping map clear for session ${e}: re-cached during removal`);return}this.sessions.delete(e),this.resumeOptions.delete(e),this.workingDirs.delete(e),this.workspaceFolderUris.delete(e),this.mcpDirectories.delete(e),this.turnIndexes.delete(e),this.chatModes.delete(e),this.providerModels.delete(e),this.appliedSandboxConfig.delete(e),this.confinedFiles.delete(e),this.turnLimiters.delete(e)}async removeAll(){let e=[...this.sessions.keys(),...this.children.keys()],r=Array.from(new Set(e));await Promise.all(r.map(n=>this.remove(n))),this.sessions.clear(),this.resumeOptions.clear(),this.workingDirs.clear(),this.workspaceFolderUris.clear(),this.mcpDirectories.clear(),this.turnIndexes.clear(),this.chatModes.clear(),this.providerModels.clear(),this.appliedSandboxConfig.clear(),this.confinedFiles.clear(),this.turnLimiters.clear(),this.children.clear()}};p();p();var Pgr=require("node:fs"),Lee=fe(require("node:path"));function Hii(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(Hii,"sanitizePathSegment");function zdt(t){return typeof t=="string"?t:void 0}a(zdt,"asString");function Wdt(t){return typeof t=="number"?t:void 0}a(Wdt,"asNumber");function yea(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:zdt(r.toolCallId),tool:zdt(r.name)}}):[]}a(yea,"asToolCallArray");function _ea(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(_ea,"toToolResultText");function Eea(t){try{return JSON.stringify(t)}catch{return}}a(Eea,"safeStringify");var Dgr=class{constructor(e,r,n){this.sessionId=r;this.usageByKey=new Map;this.pendingTools=new Map;this.appendQueues=new Map;this.activeTurnId=n;let o=AHt(new Date),s=Hii(r);this.sessionDir=Lee.join(e,`pid-${process.pid}_${o}_bgagent`,"sessions",s)}static{a(this,"BackgroundAgentPersistence")}persistEvent(e){if(e.type==="assistant.turn_start"){this.activeTurnId=e.data.turnId;return}switch(e.type){case"assistant.usage":this.handleUsage(e);break;case"assistant.message":this.handleMessage(e);break;case"tool.execution_start":this.handleToolStart(e);break;case"tool.execution_complete":this.handleToolComplete(e);break;default:break}}outputDir(e){return e?Lee.join(this.sessionDir,"runSubAgent",Hii(e)):this.sessionDir}appendJsonl(e,r){let n=Eea(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await Pgr.promises.mkdir(Lee.dirname(e),{recursive:!0}),await Pgr.promises.appendFile(e,`${n} +`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:Wdt(e.data.inputTokens),outputTokens:Wdt(e.data.outputTokens),cacheReadTokens:Wdt(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=yea(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl(Lee.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:Wdt(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=zdt(e.data.toolCallId);r&&this.pendingTools.set(r,{toolCallId:r,toolName:e.data.toolName,arguments:e.data.arguments,parentToolCallId:e.data.parentToolCallId,startTimestamp:e.timestamp})}handleToolComplete(e){let r=zdt(e.data.toolCallId);if(!r)return;let n=this.pendingTools.get(r);this.pendingTools.delete(r);let o=this.outputDir(n?.parentToolCallId),s=n?.startTimestamp?new Date(n.startTimestamp).getTime():void 0,c=new Date(e.timestamp).getTime(),l=s?c-s:void 0;this.appendJsonl(Lee.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:_ea(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function Gii(t,e,r){let n=kt(t,ze.PromptPersistBasePath)?.trim()||void 0;if(n)return new Dgr(n,e,r)}a(Gii,"createBackgroundAgentPersistence");p();var Ydt=class{constructor(){this.pendingWaits=new Map;this.data={permission:{totalMs:0,count:0},user_input:{totalMs:0,count:0},exit_plan_mode:{totalMs:0,count:0}}}static{a(this,"UserWaitTracker")}trackEvent(e){let r=e.type,n=e.data;if(r==="permission.requested"||r==="user_input.requested"||r==="exit_plan_mode.requested"){let o=typeof n?.requestId=="string"?n.requestId:void 0;if(!o)return;let s=r.replace(".requested","");this.pendingWaits.set(o,{waitType:s,startTimeMs:performance.now()})}else if(r==="permission.completed"||r==="user_input.completed"||r==="exit_plan_mode.completed"){let o=typeof n?.requestId=="string"?n.requestId:void 0;if(!o)return;let s=this.pendingWaits.get(o);if(s){let c=performance.now()-s.startTimeMs;this.pendingWaits.delete(o);let l=this.data[s.waitType];l.totalMs+=c,l.count+=1}}}};p();p();var uge={INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool"},Pn={OPERATION_NAME:"gen_ai.operation.name",AGENT_NAME:"gen_ai.agent.name",SYSTEM:"gen_ai.system",REQUEST_MODEL:"gen_ai.request.model",RESPONSE_MODEL:"gen_ai.response.model",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",CONVERSATION_ID:"gen_ai.conversation.id",USAGE_INPUT_TOKENS:"gen_ai.usage.input_tokens",USAGE_OUTPUT_TOKENS:"gen_ai.usage.output_tokens",USAGE_CACHE_READ_INPUT_TOKENS:"gen_ai.usage.cache_read.input_tokens",USAGE_CACHE_CREATION_INPUT_TOKENS:"gen_ai.usage.cache_creation.input_tokens",TURN_COUNT:"gen_ai.turn_count",TOTAL_COST_USD:"gen_ai.total_cost_usd",TOOL_NAME:"gen_ai.tool.name",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result"};function Z8(t,e){return JSON.stringify([{role:t,parts:[{type:"text",content:e}]}])}a(Z8,"genAiMessagesJson");p();var NMe=require("fs"),dge=fe(require("path"));var Ngr=new pe("OtelSpanFilePersistence"),vea="debug.jsonl",cI=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=kt(this.ctx,ze.AgentDebugLogsDirectory);return typeof e=="string"&&e.length>0?e:void 0}async appendSpans(e){if(!this.isEnabled()||e.length===0)return;let r=new Map;for(let n of e){let o=Cea(n);if(!o){Ngr.warn(this.ctx,`Dropping span without gen_ai.conversation.id (traceId=${n.traceId})`);continue}let s=r.get(o);s?s.push(n):r.set(o,[n])}for(let[n,o]of r)try{let s=this.getFilePath(n);await NMe.promises.mkdir(dge.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` `)+` -`;await NMe.promises.appendFile(s,c,{encoding:"utf8",mode:384})}catch(s){Dgr.warn(this.ctx,`Failed to persist spans for conversation=${n}: ${s instanceof Error?s.message:String(s)}`)}}async readSpans(e){if(!this.isEnabled())return[];try{let r=await NMe.promises.readFile(this.getFilePath(e),"utf8"),n=[];for(let o of r.split(` -`))if(o.trim())try{n.push(JSON.parse(o))}catch{}return n}catch(r){return r.code==="ENOENT"?[]:(Dgr.warn(this.ctx,`Failed to read spans for conversation=${e}: ${r instanceof Error?r.message:String(r)}`),[])}}getFilePath(e){let r=this.getDirectory();if(!r)throw new Error("Agent debug logs directory not configured");return dge.join(r,vea(e),_ea)}async getLogFilePath(e){if(!this.isEnabled())return null;let r=dge.resolve(this.getFilePath(e));try{return await NMe.promises.access(r),r}catch{return null}}};function Eea(t){for(let e of t.attributes??[])if(e.key==="gen_ai.conversation.id"){let r=e.value.stringValue;if(r&&r.length>0)return r}}a(Eea,"conversationIdOf");function vea(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(vea,"sanitizeForPath");p();function Hii(t){if(t!=null)return typeof t=="string"?{stringValue:t}:typeof t=="boolean"?{boolValue:t}:typeof t=="number"?Number.isInteger(t)?{intValue:String(t)}:{doubleValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(r=>Hii(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a(Hii,"encodeAnyValue");function wR(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=Hii(n);o!==void 0&&e.push({key:r,value:o})}return e}a(wR,"encodeAttributes");function Cea(t,e){return{resourceSpans:[{resource:{attributes:Object.entries(e).map(([r,n])=>({key:r,value:{stringValue:n}}))},scopeSpans:[{scope:{name:"copilot-chat"},spans:t}]}]}}a(Cea,"wrapInResourceSpans");function Gii(t,e){let r=Cea(t,{"service.name":"copilot-chat","session.id":e.conversationId});return r.copilotChat={exportedAt:new Date().toISOString(),exporterVersion:"",sessionId:e.conversationId,...e.sessionTitle?{sessionTitle:e.sessionTitle}:{}},r}a(Gii,"buildChatDebugLogExport");var Vii=require("crypto");var Ngr=new pe("BackgroundAgent.CliOTelTracker"),bea={USER_REQUEST:"copilot_chat.user_request"},Mgr="main";function fge(t){return(0,Vii.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(fge,"generateHexId");function Wii(){return BigInt(Date.now())*1000000n}a(Wii,"nowNano");function pge(t){if(t){let e=Date.parse(t);if(!Number.isNaN(e))return BigInt(e)*1000000n}return Wii()}a(pge,"isoToNano");function $ii(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a($ii,"toAttributeString");function zii(t,e,r){if(!t.get(Nn).getCapabilities().agentDebugLog)return;let n=t.get(cI);if(n.isEnabled())return new Ogr(t,e,r,n)}a(zii,"createCliOTelTracker");var Ogr=class{constructor(e,r,n,o){this._ctx=e;this._sessionId=r;this._session=n;this._persistence=o;this._pendingTools=new Map}static{a(this,"CliOTelTracker")}onEvent(e){switch(e.type){case"user.message":this._pendingUserRequest=e.data.content;break;case"assistant.turn_start":this._ensureRequest(pge(e.timestamp));break;case"assistant.usage":this._onUsage(e);break;case"assistant.message":this._onAssistantMessage(e);break;case"tool.execution_start":this._onToolStart(e);break;case"tool.execution_complete":this._onToolComplete(e);break;case"session.idle":case"session.error":this._flushRequest().catch(r=>{Ngr.warn(this._ctx,`Failed to flush debug spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)});break;default:break}}_ensureRequest(e){return this._request||(this._request={traceId:fge(16),invokeAgentSpanId:fge(8),startNano:e,userRequest:this._pendingUserRequest,usages:[],responseByAgent:new Map,toolSpanIds:new Map,pendingReads:[]},this._pendingUserRequest=void 0),this._request}_onUsage(e){let r=this._ensureRequest(pge(e.timestamp)),n={data:e.data,endNano:pge(e.timestamp),agentKey:e.data.parentToolCallId??Mgr,parentToolCallId:e.data.parentToolCallId};r.usages.push(n),r.pendingReads.push(this._readAssembled().then(({inputMessagesJson:o,systemInstructions:s})=>{n.inputMessagesJson=o,n.systemInstructions=s}))}_onAssistantMessage(e){let r=this._request;if(!r)return;let n=e.data.content;if(!n)return;let o=e.data.parentToolCallId??Mgr;r.responseByAgent.set(o,(r.responseByAgent.get(o)??"")+n)}_onToolStart(e){let r=e.data.toolCallId;if(!r)return;let n=this._ensureRequest(pge(e.timestamp)),o=e.data.parentToolCallId,s=(o?n.toolSpanIds.get(o):void 0)??n.invokeAgentSpanId,c=fge(8);this._pendingTools.set(r,{traceId:n.traceId,spanId:c,parentSpanId:s,toolName:e.data.toolName??"unknown",arguments:e.data.arguments,startNano:pge(e.timestamp)}),n.toolSpanIds.set(r,c)}_onToolComplete(e){let r=e.data.toolCallId;if(!r)return;let n=this._pendingTools.get(r);if(!n)return;this._pendingTools.delete(r);let o=pge(e.timestamp),s=e.data.success===!1,c=e.data.error?.message,l={[Pn.OPERATION_NAME]:"execute_tool",[Pn.CONVERSATION_ID]:this._sessionId,[Pn.TOOL_NAME]:n.toolName,[Pn.TOOL_CALL_ID]:r},u=$ii(n.arguments);u!==void 0&&(l[Pn.TOOL_CALL_ARGUMENTS]=u);let d=e.data.result??e.data.error,f=$ii(d);f!==void 0&&(l[Pn.TOOL_CALL_RESULT]=f),this._appendSpans([{traceId:n.traceId,spanId:n.spanId,parentSpanId:n.parentSpanId,name:`execute_tool ${n.toolName}`,kind:1,startTimeUnixNano:n.startNano.toString(),endTimeUnixNano:o.toString(),attributes:wR(l),events:[],status:s?{code:2,message:c??"Tool execution error"}:{code:1}}])}async _flushRequest(){let e=this._request;if(!e)return;this._request=void 0,await Promise.allSettled(e.pendingReads);let r=Wii(),n=[this._buildInvokeAgentSpan(e,r)],o=this._buildUserMessageSpan(e);o&&n.push(o);let s=new Map;e.usages.forEach((c,l)=>{c.data.model&&s.set(c.agentKey,l)}),e.usages.forEach((c,l)=>{let u=s.get(c.agentKey)===l,d=this._buildChatSpan(e,c,u);d&&n.push(d)}),n.push(...this._buildAgentResponseSpans(e)),this._appendSpans(n)}_buildInvokeAgentSpan(e,r){return{traceId:e.traceId,spanId:e.invokeAgentSpanId,name:"invoke_agent copilotcli",kind:1,startTimeUnixNano:e.startNano.toString(),endTimeUnixNano:r.toString(),attributes:wR({[Pn.OPERATION_NAME]:"invoke_agent",[Pn.AGENT_NAME]:"copilotcli",[Pn.CONVERSATION_ID]:this._sessionId}),events:[],status:{code:1}}}_buildUserMessageSpan(e){if(!e.userRequest)return;let r=e.startNano.toString();return{traceId:e.traceId,spanId:fge(8),parentSpanId:e.invokeAgentSpanId,name:"user_message",kind:1,startTimeUnixNano:r,endTimeUnixNano:r,attributes:wR({[Pn.OPERATION_NAME]:"user_message",[Pn.CONVERSATION_ID]:this._sessionId,[bea.USER_REQUEST]:e.userRequest}),events:[{name:"user_message",timeUnixNano:r,attributes:wR({content:e.userRequest})}],status:{code:1}}}_buildAgentResponseSpans(e){let r=new Map;for(let o of e.usages)o.data.model&&r.set(o.agentKey,o.endNano);let n=[];for(let[o,s]of e.responseByAgent){if(!s)continue;let c=o===Mgr?e.invokeAgentSpanId:e.toolSpanIds.get(o)??e.invokeAgentSpanId,l=(r.get(o)??e.startNano).toString();n.push({traceId:e.traceId,spanId:fge(8),parentSpanId:c,name:"agent_response",kind:1,startTimeUnixNano:l,endTimeUnixNano:l,attributes:wR({[Pn.OPERATION_NAME]:"agent_response",[Pn.CONVERSATION_ID]:this._sessionId,[Pn.OUTPUT_MESSAGES]:Z8("assistant",s)}),events:[],status:{code:1}})}return n}_buildChatSpan(e,r,n){let o=r.data.model;if(!o)return;let s=(r.parentToolCallId?e.toolSpanIds.get(r.parentToolCallId):void 0)??e.invokeAgentSpanId,c={[Pn.OPERATION_NAME]:"chat",[Pn.CONVERSATION_ID]:this._sessionId,[Pn.RESPONSE_MODEL]:o},l=r.data.inputTokens,u=r.data.outputTokens,d=r.data.cacheReadTokens,f=r.data.cacheWriteTokens;typeof l=="number"&&(c[Pn.USAGE_INPUT_TOKENS]=l),typeof u=="number"&&(c[Pn.USAGE_OUTPUT_TOKENS]=u),typeof d=="number"&&(c[Pn.USAGE_CACHE_READ_INPUT_TOKENS]=d),typeof f=="number"&&(c[Pn.USAGE_CACHE_CREATION_INPUT_TOKENS]=f),r.systemInstructions&&(c[Pn.SYSTEM_INSTRUCTIONS]=r.systemInstructions),r.inputMessagesJson&&(c[Pn.INPUT_MESSAGES]=r.inputMessagesJson);let h=n?e.responseByAgent.get(r.agentKey):void 0;h&&(c[Pn.OUTPUT_MESSAGES]=Z8("assistant",h));let m=r.endNano,g=r.data.duration,A=typeof g=="number"&&g>=0?m-BigInt(Math.round(g))*1000000n:m;return{traceId:e.traceId,spanId:fge(8),parentSpanId:s,name:`chat ${o}`,kind:1,startTimeUnixNano:A.toString(),endTimeUnixNano:m.toString(),attributes:wR(c),events:[],status:{code:1}}}async _readAssembled(){try{if(!this._session.getChatContextMessages||!this._session.getCurrentSystemMessage)return{};let e=await this._session.getChatContextMessages(),r=this._session.getCurrentSystemMessage();return{inputMessagesJson:e.length>0?JSON.stringify(e):void 0,systemInstructions:typeof r=="string"?r:void 0}}catch(e){return Ngr.warn(this._ctx,`Failed to read assembled messages for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`),{}}}_appendSpans(e){if(e.length!==0)try{this._persistence.appendSpans(e).catch(r=>this._warnPersistFailure(r))}catch(r){this._warnPersistFailure(r)}}_warnPersistFailure(e){Ngr.warn(this._ctx,`Failed to persist debug spans for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`)}};Fo();var X8=new pe("BackgroundAgent.TurnDriver"),Lgr="backgroundAgent",Kdt=class{constructor(e,r,n){this.ctx=e;this.registry=r;this.notificationSender=n;this.processedEventIds=new Map;this.registeredBackstops=new Set;this.lastNanoAiu=new Map}static{a(this,"TurnDriver")}wireAndSend(e,r,n,o,s,c){let l=performance.now(),u=jii(this.ctx,e,`bg-turn-${Dt()}`),d=zii(this.ctx,e,r);this.processedEventIds.set(e,new Set),this.registeredBackstops.has(e)||(this.registeredBackstops.add(e),this.registry.registerChild(e,{dispose:a(()=>{this.registeredBackstops.delete(e),this.lastNanoAiu.delete(e),this.forget(e)},"dispose")}));let f=new Ydt,h=r.on("*",_=>{if(_.type==="assistant.turn_start"&&this.registry.getTurnLimiter(e)?.onTurnStart(),u)try{u.persistEvent(_)}catch(E){X8.warn(this.ctx,"Failed to persist background-agent event",{eventType:_.type,error:E instanceof Error?E.message:String(E)})}if(f.trackEvent(_),d)try{d.onEvent(_)}catch(E){X8.warn(this.ctx,"Failed to synthesize debug span",{eventType:_.type,error:E instanceof Error?E.message:String(E)})}this.handleSessionEvent(e,_,o),_.type==="session.todos_changed"&&jlt(this.ctx,this.notificationSender,e,r),(_.type==="session.idle"||_.type==="session.error")&&g()}),m=!1,g=a(()=>{m||(m=!0,this.emitTurnCompleteTelemetry(e,r,l,f.data,o),this.emitSessionMetricsTelemetry(e,r,o,c)),A?.dispose(),h(),this.forget(e)},"cleanup"),A;s&&(A=s.onCancellationRequested(()=>{X8.info(this.ctx,"Cancellation requested, aborting session:",e),r.clearPendingItems(),r.abort()}));let y=r.send(n);return y.catch(_=>{g();let E=uot(_);s?.isCancellationRequested?X8.info(this.ctx,"session.send aborted by cancellation",{sessionId:e,turnIndex:o}):(X8.error(this.ctx,"session.send failed",{sessionId:e,turnIndex:o,error:E,stack:_ instanceof Error?_.stack:void 0}),this.emitTurnFailedTelemetry(e,o,"SendMessageError"));let v={type:"session.error",id:Dt(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:E}};this.sendSessionUpdateNotification(e,v,o)}),y}forget(e){this.processedEventIds.delete(e)}processedEventIdsForTesting(){return this.processedEventIds}seedProcessedEventIdsForTesting(e){this.processedEventIds.set(e,new Set),this.registeredBackstops.has(e)||(this.registeredBackstops.add(e),this.registry.registerChild(e,{dispose:a(()=>{this.registeredBackstops.delete(e),this.lastNanoAiu.delete(e),this.forget(e)},"dispose")}))}async handleSessionEvent(e,r,n){let o=r.id,s=this.processedEventIds.get(e);if(s?.has(o)){X8.debug(this.ctx,`Skipping duplicate SDK event: ${r.type} (id=${o})`);return}s?.add(o),await this.sendSessionUpdateNotification(e,r,n)}async sendSessionUpdateNotification(e,r,n){try{await this.notificationSender.sendBackgroundAgentSessionUpdate(e,r,void 0,n)}catch(o){X8.error(this.ctx,"Failed to send session update notification:",o)}}async emitTurnCompleteTelemetry(e,r,n,o,s){try{let c=performance.now()-n,l=this.registry.getChatMode(e)??"agent",d=(await r.usage.getMetrics()).totalNanoAiu,f=this.lastNanoAiu.get(e)??0,h=typeof d=="number"&&Number.isFinite(d),m=h?Math.min(f,d):f;h&&this.lastNanoAiu.set(e,d);let g=h?(d-m)/1e9:0;sr(this.ctx,"backgroundAgent.turn.complete",{requestSource:Lgr,sessionId:e,chatMode:l,agentProvider:"BACKGROUND",turnIndex:s!=null?String(s):""},{totalDurationMs:c,totalUserWaitMs:o?o.permission.totalMs+o.user_input.totalMs+o.exit_plan_mode.totalMs:0,permissionWaitMs:o?.permission.totalMs??0,permissionWaitCount:o?.permission.count??0,userInputWaitMs:o?.user_input.totalMs??0,userInputWaitCount:o?.user_input.count??0,exitPlanModeWaitMs:o?.exit_plan_mode.totalMs??0,exitPlanModeWaitCount:o?.exit_plan_mode.count??0,credits:g})}catch(c){X8.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}emitTurnFailedTelemetry(e,r,n){sr(this.ctx,"backgroundAgent.turn.failed",{requestSource:Lgr,sessionId:e,agentProvider:"BACKGROUND",errorType:n,turnIndex:r!=null?String(r):""})}async emitSessionMetricsTelemetry(e,r,n,o){try{let s=await r.usage.getMetrics(),c=0,l=0,u=0,d=0,f=0,h=0,m=[];for(let[g,A]of Object.entries(s.modelMetrics))A&&(c+=A.usage.inputTokens,l+=A.usage.outputTokens,u+=A.usage.cacheReadTokens,d+=A.usage.cacheWriteTokens,f+=A.usage.reasoningTokens??0,h+=A.requests.count,m.push(o?"byok models":g));sr(this.ctx,"backgroundAgent.session.metrics",{requestSource:Lgr,sessionId:e,agentProvider:"BACKGROUND",modelNames:m.join(","),turnIndex:n!=null?String(n):""},{totalApiDurationMs:s.totalApiDurationMs,totalInputTokens:c,totalOutputTokens:l,totalCacheReadTokens:u,totalCacheWriteTokens:d,totalReasoningTokens:f,llmCallCount:h,totalPremiumRequestCost:s.totalPremiumRequestCost})}catch(s){X8.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}};p();async function Yii(t,e){let r=e.agentMode??(e.chatMode!==void 0?"interactive":void 0);r&&await t.mode.set({mode:r})}a(Yii,"applyAgentModeOverride");p();async function Kii(t,e,r,n,o){let s=n.chatMode??"agent",c=Glt(s)?s:"agent";if((c==="inline"||c==="inline-ask")&&!o.hasConfinedFile(e))throw new Error(`Cannot apply chatMode '${c}' for session ${e}: no confined file registered (session was not created with inlineConfinedFile)`);if(o.getChatMode(e)===c)return;if(!o.getWorkingDir(e))throw new Error(`Cannot apply chatMode for session ${e}: working directory is not cached`);o.deleteChatMode(e),await xJn(r,c,{getAllLoadedSkillNames:a(async()=>(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(d=>d.name)),"getAllLoadedSkillNames"),getPolicyDisabledSkillNames:a(async()=>{let d;try{d=t.get(Ig)}catch{return[]}return d.isSkillsEnabled()?[]:(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(f=>f.name))},"getPolicyDisabledSkillNames"),getMcpServers:a(()=>{let d=o.getMcpDirectory(e)??o.getWorkspaceFolderUri(e);try{return Promise.resolve(t.get(yR).buildMcpServers(d))}catch(f){if(f instanceof Ic)return Promise.resolve({});throw f}},"getMcpServers")}),o.setChatMode(e,c)}a(Kii,"applyChatModeOverride");p();var Jii=new pe("BackgroundAgent.applyChatModeSelection");async function Zii(t,e,r){if(r.chatMode===void 0&&r.agentMode===void 0)return;let n=r.chatMode!==void 0&&r.chatMode!=="agent"&&!Glt(r.chatMode)?r.chatMode:void 0;try{n===void 0?(await e.agent.deselect(),Jii.info(t,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:n}),Jii.info(t,`Applied custom agent '${n}' for session ${r.sessionId}`))}catch(o){let s=o instanceof Error?o.message:String(o);throw n===void 0?new Error(`Failed to clear custom agent selection on session ${r.sessionId}: ${s}`):new Error(`Failed to select custom agent '${n}' on session ${r.sessionId}: ${s}. Verify the agent is registered via a workspace .agent.md file.`)}}a(Zii,"applyChatModeSelection");p();var Xii=require("node:util");async function eoi(t,e,r,n){let o=Rut(t)??{enabled:!1},s=n.getAppliedSandboxConfig(e);s!==void 0&&(0,Xii.isDeepStrictEqual)(s,o)||(await r.updateOptions({sandboxConfig:o}),n.setAppliedSandboxConfig(e,o))}a(eoi,"applySandboxOverride");p();p();var SG=new pe("BackgroundAgent.ProviderConfig");async function toi(t,e,r){if(!e)return;let n=await QKe(t,e,r);if(!n&&!ob(e)){SG.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let f=await new as(t.get(Un)).getStoredModelConfigs(e),h=r?f[r]:void 0;o=h?.deploymentUrl,s=h?.modelCapabilities?.maxInputTokens,c=h?.modelCapabilities?.maxOutputTokens}catch(d){SG.warn(t,"Failed to load BYOK model config; using defaults",{providerName:e,modelId:r,error:d instanceof Error?d.message:String(d)})}let l=Dwe(e),u={maxPromptTokens:s??l.maxInputTokens,maxOutputTokens:c??l.maxOutputTokens};if(ob(e)){let d;try{d=(await new as(t.get(Un)).getProviderConfig(e))?.url}catch(f){SG.warn(t,"Failed to load Ollama provider config; using default endpoint",{providerName:e,modelId:r,error:f instanceof Error?f.message:String(f)})}return{type:"openai",wireApi:"completions",baseUrl:UKe(d),modelId:r,wireModel:r,...u}}if(n){if(e===Ii.Anthropic)return{type:"anthropic",baseUrl:Nwe(o??jue[e],"messages"),apiKey:n,modelId:r,wireModel:r,...u};if(e===Ii.Azure){if(!o){SG.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return Tea(t,o,n,r,u)}if(Lue(e))return{type:"openai",baseUrl:o??jue[e],apiKey:n,modelId:r,wireModel:r,...u};if(VO(e))return Sea(t,e,n,r,o,u);SG.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}}a(toi,"buildProviderConfig");async function Sea(t,e,r,n,o,s){if(!o){SG.warn(t,`Custom endpoint '${e}' has no configured URL; skipping provider config.`);return}let u=(await new as(t.get(Un)).getProviderConfig(e))?.apiType,d=u==="chatCompletions"||u==="responses"||u==="messages"?u:Pwe,f=Nwe(o,d);return d==="messages"?{type:"anthropic",baseUrl:f,apiKey:r,modelId:n,wireModel:n,...s}:{type:"openai",wireApi:d==="responses"?"responses":"completions",baseUrl:f,apiKey:r,modelId:n,wireModel:n,...s}}a(Sea,"buildCustomEndpointProviderConfig");function Tea(t,e,r,n,o){let s;try{s=new URL(e)}catch{SG.warn(t,`Invalid Azure deployment URL: ${e}`);return}let c=`${s.protocol}//${s.hostname}`;if(s.hostname.endsWith(".openai.azure.com"))return{type:"azure",baseUrl:c,apiKey:r,modelId:n,wireModel:n,azure:{apiVersion:"2025-01-01-preview"},...o};if(s.hostname.endsWith(".models.ai.azure.com")||s.hostname.endsWith(".inference.ml.azure.com"))return{type:"openai",baseUrl:`${c}/v1`,apiKey:r,modelId:n,wireModel:n,...o};SG.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(Tea,"buildAzureProviderConfig");var Bgr=new pe("BackgroundAgent.applyTurnOverrides");async function roi(t,e,r,n){let o=r.providerName?r.providerName:void 0;if(o!==void 0&&!Bq(await t.get(Qt).getToken()))throw new SPe(`BYOK is disabled for this account. Provider '${o}' cannot be used for model '${r.model??""}'.`,o,r.model);let s=await toi(t,o,r.model);if(o!==void 0&&s===void 0)throw new bPe(`BYOK provider '${o}' is misconfigured for model '${r.model??""}'. Verify the API key`+(o===Ii.Azure?" and per-model deployment URL":"")+" is configured for this provider/model.",o,r.model);let c=n.registry.getProviderModel(r.sessionId),l=r.model,u=l!==void 0&&c?.model!==l,d=c!==void 0&&c.provider!==o,f=c!==void 0&&(d||u),h=e,m=!1;if(f){Bgr.info(t,`Provider/model changed for session ${r.sessionId} (${c?.provider??"(built-in)"}/${c?.model??"(unchanged)"} \u2192 ${o??"(built-in)"}/${l??"(unchanged)"}); forcing close+resume cycle to strip provider-bound reasoning state.`);let g=await n.managerLifecycle.ensureManager();n.registry.forgetSession(r.sessionId),n.registry.deleteChatMode(r.sessionId);try{await g.closeSession(r.sessionId),m=!0,h=await n.getOrResumeSession(r.sessionId)}catch(A){if(m)throw n.registry.deleteProviderModel(r.sessionId),new Error(`Failed to resume session ${r.sessionId} after provider/model change: `+(A instanceof Error?A.message:String(A)));Bgr.warn(t,`Failed to close session ${r.sessionId} for provider/model change; continuing with existing session: `+(A instanceof Error?A.message:String(A))),h=e}}try{await h.updateOptions({provider:s??null,...l?{model:l}:{},...r.reasoningEffort?{reasoningEffort:r.reasoningEffort}:{},...r.contextTier?{contextTier:r.contextTier}:{}})}catch(g){throw new Error(`Failed to bind BYOK provider '${o??"(built-in)"}' to session ${r.sessionId}: ${g instanceof Error?g.message:String(g)}`)}return n.registry.setProviderModel(r.sessionId,{provider:o,model:l??c?.model}),Bgr.info(t,`Rebound session ${r.sessionId} for this turn: provider=${o??"(built-in)"}, model=${l??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),h}a(roi,"applyTurnOverrides");p();async function noi(t,e,r,n,o){let s=xea(e,n),c=o==="inline"||o==="inline-ask";await t.get(P0).applyPromptTemplateToRequest(r,s?[s]:[],c,{includePlugins:!0})||Iea(t,r)}a(noi,"expandPromptTemplate");function Iea(t,e){let r=e.message.trim();if(!r.startsWith("/"))return!1;let[n,...o]=r.split(" "),s=n.slice(1);if(!EDn.has(s))return!1;let c=P2().find(l=>l.id===s);return c?.instructions?(e.message=c.instructions(t,o.join(" ")),!0):!1}a(Iea,"applyBuiltinCreateTemplate");function xea(t,e){let r=e.getWorkingDir(t);return r?{uri:Ko(r)}:void 0}a(xea,"getWorkspaceFolderForSession");p();var hge=class{constructor(e,r,n){this.ctx=e;this.target=n;this.syncScheduled=!1;this.logger=new pe(r);let o=kut(e);o&&(this.host=o,this.mountsChangedListener=()=>this.schedule(),o.service.on(Mee.MountsChanged,this.mountsChangedListener))}static{a(this,"GatewayMountsSync")}dispose(){this.host&&this.mountsChangedListener&&(this.host.service.off(Mee.MountsChanged,this.mountsChangedListener),this.mountsChangedListener=void 0,this.host=void 0)}schedule(){this.syncScheduled||(this.syncScheduled=!0,queueMicrotask(()=>{this.syncScheduled=!1;let e=this.host;e&&this.target.syncToActiveSessions(e).catch(r=>this.onSyncError(r))}))}onSyncError(e){this.logger.warn(this.ctx,"MCP active-session sync failed",{error:e instanceof Error?e.message:String(e)})}};var mge=fe(require("node:path"));Fo();var V0=new pe("BackgroundAgent"),e6="backgroundAgent",wea="backgroundAgent.remote",Rea=new Set(["system.message","hook.start","hook.end"]),kea=new Set(["gpt-41-copilot","gpt-4.1","gpt-4.1-2025-04-14","gpt-5.4-nano","gemini-2.5-pro","grok-code-fast-1"]);function ioi(t,e){let r=a(n=>/^[A-Za-z]:[\\/]/.test(n)||/^\\\\/.test(n),"isWindowsPath");return r(t)&&r(e)?mge.win32.normalize(t).toLowerCase()===mge.win32.normalize(e).toLowerCase():mge.posix.normalize(t)===mge.posix.normalize(e)}a(ioi,"sessionPathsEqual");var Ys=class{constructor(e){this.ctx=e;this.pendingExternalToolDefs=new Map;this.notificationSender=e.get(ss),this.managerLifecycle=new Xlt(e),this.authBinding=new lot(e),this.registry=new Vdt(e,(o,s)=>this.managerLifecycle.closeSession(o,s)),this.remoteController=new iut(e,{registry:this.registry,injectUserMessage:a((o,s)=>this.injectRemoteUserMessage(o,s),"injectUserMessage")}),this.turnDriver=new Kdt(e,this.registry,this.notificationSender);let r=new dot(e,this.registry);this._mcpSync=new hge(e,"BackgroundAgent.McpSync",r),e.get(Qo).onDidChangeHttpSettings(()=>{qlt(this.ctx)}),ws(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(Ig).onDidChangeSkillsEnabled(()=>{this.registry.clearChatMode()})}catch(o){if(!(o instanceof Ic))throw o}}static{a(this,"BackgroundAgentService")}async handleAuthStateChange(){let{changed:e,hadPrevious:r,hasCurrent:n}=await this.authBinding.detectIdentityChange();e&&(V0.info(this.ctx,"GitHub identity changed, clearing cached sessions",{hadPrevious:r,hasCurrent:n,cachedSessionCount:this.registry.size(),remoteDelegateCount:this.remoteController.delegateCount()}),await this.clearUserScopedState())}async clearUserScopedState(){this.pendingExternalToolDefs.clear(),await this.registry.removeAll(),await this.managerLifecycle.closeAllSessions()}ensureManager(){return this.managerLifecycle.ensureManager()}get sdk(){return this.managerLifecycle.getSdk()}async handleInteraction(e){let r=performance.now(),n=await this.getOrResumeSession(e.sessionId),o=await B4n(n,e);return xx(this.ctx,"backgroundAgent.interaction",{requestSource:e6,sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type,resultKind:e.type==="permission"?e.result.kind:""},{totalTimeMs:performance.now()-r}),o}buildAuthInfo(){return this.authBinding.buildAuthInfo()}applyTurnOverrides(e,r){return roi(this.ctx,e,r,{registry:this.registry,managerLifecycle:this.managerLifecycle,getOrResumeSession:a(n=>this.getOrResumeSession(n),"getOrResumeSession")})}applyChatModeSelection(e,r){return Zii(this.ctx,e,r)}buildSessionOptions(e,r){return Uii(this.ctx,e,r,{buildAuthInfo:a(()=>this.buildAuthInfo(),"buildAuthInfo")})}async createSession(e){let r=performance.now();V0.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??Dt(),s=e.inlineConfinedFile?PJn(2):void 0,c=e.inlineConfinedFile?DJn(e.inlineConfinedFile):void 0,l=await this.buildSessionOptions(o,{...e,inlineTurnLimiter:s,inlineConfinementHook:c}),u=await n.createSession(l);return s&&this.registry.setTurnLimiter(o,s),V0.info(this.ctx,"Session created:",o),xx(this.ctx,"backgroundAgent.create",{requestSource:e6,reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.registry.set(o,u),this.registry.setResumeOptions(o,l),this.registry.setWorkingDir(o,oo(e.workspaceFolder.uri).fsPath),this.registry.setWorkspaceFolderUri(o,e.workspaceFolder.uri),e.mcpDirectory&&this.registry.setMcpDirectory(o,e.mcpDirectory),e.inlineConfinedFile&&this.registry.setConfinedFile(o,e.inlineConfinedFile),{sessionId:o,workspacePath:u.workspacePath}}registerExternalTools(e,r){r?.length&&(this.pendingExternalToolDefs.set(e,r),V0.info(this.ctx,"Stored pending external tool definitions",{sessionId:e,toolCount:r.length}))}async getOrResumeSession(e,r={}){let n=this.registry.get(e);if(n){let m=this.pendingExternalToolDefs.get(e);if(m){let g=await this.ensureManager();return this.registry.forgetSession(e),this.registry.deleteChatMode(e),await g.closeSession(e),V0.info(this.ctx,"Reopening cached session with pending external tool definitions",{sessionId:e,toolCount:m.length}),this.getOrResumeSession(e,r)}return n}let o=await this.ensureManager(),s=this.pendingExternalToolDefs.get(e),c=this.registry.getResumeOptions(e),l=r.workspaceFolder,u;if(!l&&c){let m=this.registry.getWorkspaceFolderUri(e);if(!m)throw new Error(`Cannot resume session ${e}: cached connection options have no workspace URI`);l={uri:m},u={...c,sessionId:e,externalToolDefinitions:r.externalToolDefinitions??s??c.externalToolDefinitions}}else{if(!l){let m=await o.getSessionMetadata({sessionId:e});if(!m)throw new Error(`Session not found: ${e}`);let g=m.context?.cwd;if(!g)throw new Error(`Cannot resume session ${e} from disk: persisted metadata is missing working-directory context`);l={uri:Ko(g)},V0.info(this.ctx,"Resuming session from disk via metadata fallback",{sessionId:e})}u=await this.buildSessionOptions(e,{...r,externalToolDefinitions:r.externalToolDefinitions??s,workspaceFolder:l})}let d=await o.getSession(u,!0);if(!d)throw new Error(`Session not found: ${e}`);s&&this.pendingExternalToolDefs.get(e)===s&&this.pendingExternalToolDefs.delete(e),this.registry.set(e,d),this.registry.setResumeOptions(e,u);let f=Array.from(d.getEvents()).filter(m=>m.type==="user.message").length;f>0&&this.registry.seedTurnIndexIfAbsent(e,f-1),this.registry.deleteChatMode(e),this.registry.deleteAppliedSandboxConfig(e);let h=l?.uri?oo(l.uri).fsPath:void 0;return h&&this.registry.setWorkingDir(e,h),l?.uri&&this.registry.setWorkspaceFolderUri(e,l.uri),r.mcpDirectory&&this.registry.setMcpDirectory(e,r.mcpDirectory),d}async resolveRubberDuckPrompt(e,r){return this.resolveBuiltinSlashPrompt(e,"rubber-duck",r)}async resolveInitPrompt(e,r){return this.resolveBuiltinSlashPrompt(e,"init",r)}async resolveBuiltinSlashPrompt(e,r,n){let o=n.slice(`/${r}`.length).trimStart(),s=await e.commands.invoke({name:r,input:o});if(s.kind!=="agent-prompt")throw V0.error(this.ctx,"Slash command returned an unexpected result",{command:r,resultKind:s.kind}),new Error(`Unable to run /${r}.`);return s.prompt}async sendMessage(e,r){let n=await this.getOrResumeSession(e.sessionId),o=await this.applyTurnOverrides(n,e);await this.applyChatModeOverride(e.sessionId,o,e),await this.applySandboxOverride(e.sessionId,o);let s=e.message;s==="/rubber-duck"||s.startsWith("/rubber-duck ")?e.message=await this.resolveRubberDuckPrompt(o,s):(s==="/init"||s.startsWith("/init "))&&(e.message=await this.resolveInitPrompt(o,s)),await this.expandPromptTemplate(e.sessionId,e,e.chatMode),await this.applyChatModeSelection(o,e);let c={prompt:e.message,displayPrompt:s,...e.sendMode?{mode:e.sendMode}:{}};await this.applyAgentModeOverride(o,e);let l=e.chatMode==="inline-ask"||e.chatMode==="inline";if(e.references?.length&&!l){let m=L4n(e.references,this.ctx);m.length>0&&(c.attachments=m)}if(l){let m=this.registry.getConfinedFile(e.sessionId);if(m){let g=e.references?.find(y=>y.type==="file"&&y.uri===m),A=await MJn(m,g,this.ctx);if(A.promptFragment&&(c.prompt=`${c.prompt}${A.promptFragment}`),A.isLargeFile){let y=e.chatMode==="inline-ask"?Hlt:Pfr;await o.updateOptions({availableTools:[...y,"view"]})}}}this.registry.getTurnLimiter(e.sessionId)?.reset();let u=performance.now(),d=this.registry.incrementTurnIndex(e.sessionId);this.turnDriver.wireAndSend(e.sessionId,o,c,d,r,!!e.providerName);let f={requestSource:e6,chatMode:this.registry.getChatMode(e.sessionId)??"agent",sessionId:e.sessionId,safeModelId:Pea(e.model,e.providerName),providerName:e.providerName??"",reasoningEffort:e.reasoningEffort??"",contextTier:e.contextTier??"",hasReferences:String((e.references?.length??0)>0),turnIndex:String(d)},h={totalTimeMs:performance.now()-u,messageCharLen:e.message.length,referenceCount:e.references?.length??0};return xx(this.ctx,"backgroundAgent.send",f,h),{}}async truncateHistory(e){let r=performance.now(),o=await(await this.getOrResumeSession(e.sessionId)).history.truncate({eventId:e.eventId});return xx(this.ctx,"backgroundAgent.truncateHistory",{requestSource:e6,providerName:e.providerName,sessionId:e.sessionId,eventId:e.eventId},{totalTimeMs:performance.now()-r,eventsRemoved:o.eventsRemoved}),{eventId:e.eventId,eventsRemoved:o.eventsRemoved}}async forkSession(e){let r=performance.now(),o=await(await this.ensureManager()).forkSession(e.sessionId,{toEventId:e.toEventId,name:e.name});return xx(this.ctx,"backgroundAgent.fork",{requestSource:e6,providerName:e.providerName},{totalTimeMs:performance.now()-r}),{sessionId:o.sessionId}}applyChatModeOverride(e,r,n){return Kii(this.ctx,e,r,n,this.registry)}applySandboxOverride(e,r){return eoi(this.ctx,e,r,this.registry)}applyAgentModeOverride(e,r){return Yii(e,r)}async injectRemoteUserMessage(e,r){let n=await this.getOrResumeSession(e),o={message:r};await this.expandPromptTemplate(e,o);let s={prompt:o.message,displayPrompt:r},c=performance.now(),l=this.registry.incrementTurnIndex(e);await this.turnDriver.wireAndSend(e,n,s,l),xx(this.ctx,"backgroundAgent.send",{requestSource:wea,sessionId:e,safeModelId:"",providerName:"",reasoningEffort:"",contextTier:"",hasReferences:"false",turnIndex:String(l)},{totalTimeMs:performance.now()-c,messageCharLen:o.message.length,referenceCount:0})}expandPromptTemplate(e,r,n){return noi(this.ctx,e,r,this.registry,n)}async destroySession(e){try{return await this.remoteController.tearDownForDestroy(e.sessionId),this.pendingExternalToolDefs.delete(e.sessionId),await this.registry.remove(e.sessionId),await(await this.ensureManager()).deleteSession(e.sessionId),{success:!0}}catch(r){return V0.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);V0.info(this.ctx,"Stopping session via abort:",e),await n.abortManualCompaction()&&V0.info(this.ctx,"Aborted in-progress manual compaction:",e),await n.clearPendingItems(),await n.abort(),xx(this.ctx,"backgroundAgent.stop",{requestSource:e6,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);V0.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return xx(this.ctx,"backgroundAgent.compactHistory",{requestSource:e6,sessionId:e},{totalTimeMs:performance.now()-r,tokensRemoved:o.tokensRemoved,messagesRemoved:o.messagesRemoved}),{success:o.success,tokensRemoved:o.tokensRemoved,messagesRemoved:o.messagesRemoved,summaryContent:o.summaryContent,contextWindow:o.contextWindow}}async stopCompactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);V0.info(this.ctx,"Aborting manual compaction for session:",e);let o=await n.abortManualCompaction();return xx(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:e6,sessionId:e,aborted:String(o)},{totalTimeMs:performance.now()-r}),{aborted:o}}async getPlanPath(e){return await(await this.getOrResumeSession(e)).getPlanPath()}async resumeSession(e){let r=performance.now();V0.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());jlt(this.ctx,this.notificationSender,e.sessionId,n),xx(this.ctx,"backgroundAgent.resume",{requestSource:e6,reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!Rea.has(c.type));return{sessionId:e.sessionId,workspacePath:n.workspacePath,events:s}}async listSessions(e){let n=await(await this.ensureManager()).listSessions(),o=n;return e&&(o=n.filter(s=>!(e.cwd&&(!s.context?.cwd||!ioi(s.context.cwd,e.cwd))||e.gitRoot&&(!s.context?.gitRoot||!ioi(s.context.gitRoot,e.gitRoot))||e.repository&&s.context?.repository!==e.repository||e.branch&&s.context?.branch!==e.branch))),{sessions:o.map(s=>({sessionId:s.sessionId,startTime:s.startTime instanceof Date?s.startTime.toISOString():String(s.startTime),modifiedTime:s.modifiedTime instanceof Date?s.modifiedTime.toISOString():String(s.modifiedTime),summary:s.summary,isRemote:s.isRemote,context:s.context}))}}async listModels(e){V0.info(this.ctx,"listModels called",{forceRefresh:e}),await this.managerLifecycle.ensureManager();let r=performance.now();try{let o=(await this.ctx.get(Ns).getMetadata(e)).filter(l=>l.model_picker_enabled===!0).filter(l=>l.capabilities.type==="chat").filter(l=>!kea.has(l.id)).map(ope);o.length===0?V0.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):V0.info(this.ctx,`Successfully retrieved ${o.length} models`);let s=[];this.ctx.get(eu).getPolicyValue("autoModel.enabled")!==!1&&s.push(this.buildAutoModelEntry());let c=[...s,...o];return V0.debug(this.ctx,"Models retrieved:",c.map(l=>l.id)),xx(this.ctx,"backgroundAgent.listModels",{status_text:"success"},{duration_ms:performance.now()-r,model_count:c.length}),{models:c}}catch(n){let o=n instanceof Error?n.message:String(n),s=onr(n);throw V0.error(this.ctx,"listModels failed",{error:o,cause:s,stack:n instanceof Error?n.stack:void 0}),zp(this.ctx,"backgroundAgent.listModels",n,{status_text:"failure",...s?{errorCause:s}:{}},{duration_ms:performance.now()-r}),new Error("Failed to retrieve models",{cause:n})}}buildAutoModelEntry(){return{id:this.sdk.AUTO_MODEL_ID,name:"Auto",preview:!1,capabilities:{family:this.sdk.AUTO_MODEL_ID,supports:{vision:!0},limits:{max_context_window_tokens:0}}}}async enableRemote(e){let r=await this.getOrResumeSession(e);return this.remoteController.enableForSession(e,r)}async disableRemote(e){let r=await this.getOrResumeSession(e);await this.remoteController.disableForSession(r)}getRemoteStatus(e){return this.remoteController.getStatus(e)}async shutdown(){this._mcpSync.dispose(),this._skillsEnabledListener?.dispose(),this._skillsEnabledListener=void 0,await this.clearUserScopedState(),Rfr(),await this.managerLifecycle.dispose()}};function Pea(t,e){return e?"byok models":t??""}a(Pea,"safeModelId");p();p();var Ff=(o=>(o.Background="BACKGROUND",o.Claude="CLAUDE",o.Codex="CODEX",o.Cloud="CLOUD",o))(Ff||{});p();async function Ch(t,e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return ooi(t,e,n,o),s}catch(s){throw o.error??=s,ooi(t,e,n,o),s}}a(Ch,"runWithTelemetry");function ooi(t,e,r,n){let s={success:n.error?"false":n.ok??!0?"true":"false",...n.properties},c={totalTimeMs:performance.now()-r,...n.measurements};n.error!==void 0?zp(t,`${e}.failure`,n.error,s,c):$c(t,e,s,c)}a(ooi,"flushTelemetry");p();var soi=fe(require("path"));p();var Fgr=["default","acceptEdits","bypassPermissions","plan","auto"];function Lee(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(Lee,"assertClaudeProvider");function gge(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(gge,"assertNonEmptyString");function Dea(t,e,r){if(r===void 0)throw new Error(`${t}: ${e} is required`);try{oo(r)}catch(n){throw new Error(`${t}: ${e} is not a valid URI: ${r}`,{cause:n})}}a(Dea,"assertFsUri");function Nea(t,e,r){if(!soi.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(Nea,"assertAbsolutePath");function Mea(t,e){if(e!==void 0&&!Fgr.includes(e))throw new Error(`${t}: agentMode must be one of ${Fgr.join(", ")}, got '${e}'`)}a(Mea,"assertAllowedAgentMode");async function MMe(t,e){if(e===void 0)return;let n=(await t.get(Ns).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!vWe(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a(MMe,"validateClaudeModel");async function aoi(t,e){Lee("createSession",e.agentProvider),Dea("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await MMe(t,e.model)}a(aoi,"validateAgentCreate");async function coi(t,e){Lee("resumeSession",e.agentProvider),gge("resumeSession","sessionId",e.sessionId),await MMe(t,e.model)}a(coi,"validateAgentResume");async function loi(t,e){Lee("sendMessage",e.agentProvider),gge("sendMessage","sessionId",e.sessionId),gge("sendMessage","message",e.message),Mea("sendMessage",e.agentMode),await MMe(t,e.model)}a(loi,"validateAgentSend");function uoi(t,e){Lee("stopSession",e.agentProvider),gge("stopSession","sessionId",e.sessionId)}a(uoi,"validateAgentStop");function doi(t,e){Lee("destroySession",e.agentProvider),gge("destroySession","sessionId",e.sessionId)}a(doi,"validateAgentDestroy");function foi(t,e){Lee("listSessions",e.agentProvider),gge("listSessions","cwd",e.cwd),Nea("listSessions","cwd",e.cwd)}a(foi,"validateAgentListSessions");function poi(t,e){Lee("listModels",e.agentProvider)}a(poi,"validateAgentListModels");p();p();p();var Aoi=require("child_process"),Age=fe(require("path")),yoi=fe(WP()),_oi=require("util");var hoi=5e3,moi=200,yge=class{constructor(e){this.execFile=(0,_oi.promisify)(Aoi.execFile);this.cache=new Map;this.config=e}static{a(this,"BaseCliVersionChecker")}check(e){if(!e)return Promise.resolve({severity:"error",message:this.config.notConfiguredMessage});let r=Age.resolve(e),n=this.cache.get(r);if(n)return n;let o=this.computeStatus(r).then(s=>(s.severity==="error"&&this.cache.delete(r),s));return this.cache.set(r,o),o}clearCache(e){if(e){this.cache.delete(Age.resolve(e));return}this.cache.clear()}async computeStatus(e){let r=this.validateBasename(e);if(r)return{severity:"error",message:r};let n;try{n=(await this.execFile(e,["--version"],{timeout:hoi,windowsHide:!0})).stdout}catch(c){return{severity:"error",message:this.formatSpawnError(e,c)}}let o=yoi.coerce(n);if(!o)return{severity:"error",message:`Could not parse ${this.config.displayName} version from the input path --version output: "${goi(n)}". Cannot verify compatibility.`};let s=this.config.validateVersion(o,e);return s||{severity:"ok"}}validateBasename(e){let r=this.config.allowedBasenames;if(!r||r.length===0)return;let n=Age.basename(e).toLowerCase();if(!r.includes(n))return`${this.config.displayName} at the input path must point at the "${r[0]}" executable, but the basename is "${Age.basename(e)}".`}formatSpawnError(e,r){let n=r;if(n?.code==="ENOENT")return`${this.config.displayName} not found at the input path. Check that the file exists and is executable.`;if(n?.killed&&n?.signal==="SIGTERM")return`${this.config.displayName} at the input path did not respond to --version within ${hoi/1e3}s.`;let o=typeof n?.stderr=="string"?goi(n.stderr):"",s="";switch(typeof n?.code){case"number":s=` (exit code ${n.code})`;break;case"string":s=` (error code ${n.code})`;break}let c=o?` stderr: "${o}"`:"",l=n?.message?`: ${n.message}`:"";return`Failed to run "the input path --version"${s}${l}${c}`}};function goi(t){let e=t.trim();return e.length<=moi?e:`${e.slice(0,moi)}\u2026`}a(goi,"truncate");var Jdt=fe(WP());function Oea(){let t=Oxe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(Oea,"getExpectedVersionRaw");var Ugr=class extends yge{static{a(this,"ClaudeCliVersionChecker")}constructor(){super({displayName:"Claude Code CLI",allowedBasenames:process.platform==="win32"?["claude.exe"]:["claude"],notConfiguredMessage:"Claude Code CLI path is not configured. Install @anthropic-ai/claude-code (e.g. `npm install -g @anthropic-ai/claude-code`), then open your editor's Copilot settings and set the Claude Code CLI Path field to the absolute path of the `claude` executable.",validateVersion(e){let r=Oea(),n=Jdt.coerce(r);if(!n)return{severity:"error",message:`Could not parse expected Claude Code CLI version "${r}" from packaged metadata. This is an internal error; please report it.`};if(!Jdt.satisfies(e,`~${n.major}.${n.minor}.0`))return{severity:"warning",message:`Claude Code CLI at the input path reports version ${e.version}, but this language server was built against ${n.version}. The session will still start, but SDK behavior may be unstable on protocol drift. Run \`npm install -g @anthropic-ai/claude-code@${n.version}\` to align versions.`}}})}},_ge=new Ugr;p();var Ege=class{constructor(){this._entries=new Map}static{a(this,"PendingRequestRegistry")}register(e){if(this._entries.has(e))throw new Error(`PendingRequestRegistry: duplicate key ${e}`);return{promise:new Promise((n,o)=>{this._entries.set(e,{resolve:n,reject:o})}),isSettled:a(()=>!this._entries.has(e),"isSettled")}}respond(e,r){let n=this._entries.get(e);return n?(this._entries.delete(e),n.resolve(r),!0):!1}rejectOne(e,r){let n=this._entries.get(e);return n?(this._entries.delete(e),n.reject(r),!0):!1}has(e){return this._entries.has(e)}respondAll(e){let r=[...this._entries.values()];this._entries.clear();for(let n of r)n.resolve(e)}rejectAll(e){let r=[...this._entries.values()];this._entries.clear();for(let n of r)n.reject(e)}};p();function Eoi(t,e,r){let n=r.toolUseID,s={intention:r.title??`${t} tool call`,...n!==void 0&&{toolCallId:n}},c=a(l=>typeof l=="string"?l:void 0,"str");switch(t){case"Bash":return{...s,kind:"shell",fullCommandText:c(e.command)??""};case"Write":case"Edit":case"MultiEdit":case"NotebookEdit":return{...s,kind:"write",fileName:c(r.blockedPath)??c(e.file_path)??c(e.notebook_path)??""};case"Read":return{...s,kind:"read",path:c(r.blockedPath)??c(e.file_path)??""};case"WebFetch":return{...s,kind:"url",url:c(e.url)??""};default:{if(t.startsWith("mcp__")){let l=t.split("__");return{...s,kind:"mcp",serverName:l[1]??"",toolName:l.slice(2).join("__"),args:e}}return{...s,kind:"custom-tool",toolName:t,args:e}}}}a(Eoi,"buildPermissionRequest");function voi(t,e){return t.kind==="approve-once"?{behavior:"allow",updatedInput:e}:{behavior:"deny",message:Lea(t)}}a(voi,"translatePermissionResult");function Lea(t){switch(t.kind){case"denied-by-rules":return"Permission denied by approval rules";case"denied-no-approval-rule-and-could-not-request-from-user":return"Permission denied: no approval rule and user prompt unavailable";case"denied-interactively-by-user":return t.feedback?`Permission denied by user: ${t.feedback}`:"Permission denied by user";case"denied-by-content-exclusion-policy":return`Permission denied by content-exclusion policy: ${t.message}`;default:return`Permission denied: ${t.kind}`}}a(Lea,"formatDenyMessage");function Coi(t){let e=t;if(!Array.isArray(e.questions))return null;let r=[];for(let n of e.questions){if(typeof n?.question!="string"||n.question.length===0)return null;r.push({questionText:n.question,header:typeof n.header=="string"&&n.header.length>0?n.header:void 0,choices:Array.isArray(n.options)?n.options.map(o=>o?.label).filter(o=>typeof o=="string"):void 0})}return r}a(Coi,"buildPreparedQuestions");function boi(t,e){return{question:t.header?`${t.header} -${t.questionText}`:t.questionText,...t.choices!==void 0&&{choices:t.choices},allowFreeform:!0,...e!==void 0&&{toolCallId:e}}}a(boi,"buildUserInputRequest");p();function Soi(t,e){let r=t.buildMcpServers(Ko(e),!1),n=Object.create(null);for(let[o,s]of Object.entries(r))n[o]={type:"http",url:s.url};return{servers:n,names:new Set(Object.keys(n))}}a(Soi,"buildInjectedMcpServers");function Toi(t,e){if(Object.keys(e).length===0)return;let r=t.service.origin;if(r)return[{serverUrl:`${r}/*`}]}a(Toi,"buildAllowedMcpServers");p();var Ioi=require("crypto");var Bea=new pe("ClaudeOTelTracker");function xoi(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a(xoi,"toAttributeString");function Fea(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>{if(typeof r!="object"||r===null)return!1;let n=r;return n.type==="text"&&typeof n.text=="string"}).map(r=>r.text);if(e.length===t.length&&e.length>0)return e.join("")}return xoi(t)}a(Fea,"stringifyToolResult");function Qgr(t){return(0,Ioi.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(Qgr,"generateHexId");function Zdt(){return BigInt(Date.now())*1000000n}a(Zdt,"nowNano");var Xdt=class{constructor(e,r,n){this._ctx=e;this._sessionId=r;this._persistence=n;this._toolSpans=new Map;this._responseText="";this._inputTokens=0;this._outputTokens=0;this._cacheReadTokens=0;this._cacheCreationTokens=0}static{a(this,"ClaudeOTelTracker")}startRequest(e,r){this._rootSpan&&this._endRootSpan(2,"New request started before previous ended");let n=Qgr(16),o=Qgr(8);this._rootSpan={traceId:n,spanId:o,name:"invoke_agent claude",startNano:Zdt(),attributes:{[Pn.OPERATION_NAME]:uge.INVOKE_AGENT,[Pn.AGENT_NAME]:"claude",[Pn.SYSTEM]:"anthropic",[Pn.CONVERSATION_ID]:this._sessionId,...e?{[Pn.REQUEST_MODEL]:e,[Pn.RESPONSE_MODEL]:e}:{[Pn.RESPONSE_MODEL]:"unknown"},...r?{[Pn.INPUT_MESSAGES]:Z8("user",r)}:{}}},this._inputTokens=0,this._outputTokens=0,this._cacheReadTokens=0,this._cacheCreationTokens=0,this._responseText="",this._toolSpans.clear()}onMessage(e){if(this._rootSpan)switch(e.type){case"assistant":this._onAssistantMessage(e);break;case"user":this._onUserMessage(e);break;case"result":this._onResultMessage(e);break}}endRequest(){this._endRootSpan(1)}endRequestWithError(e){this._endRootSpan(2,e)}_onAssistantMessage(e){if(e.parent_tool_use_id!=null)return;let r=e.message?.content;if(Array.isArray(r))for(let n of r)n.type==="tool_use"?this._startToolSpan(n.id,n.name,n.input):n.type==="text"&&typeof n.text=="string"&&(this._responseText+=n.text)}_onUserMessage(e){let r=e.message?.content;if(Array.isArray(r)){for(let n of r)if(n.type==="tool_result"&&typeof n.tool_use_id=="string"){let o=n.is_error===!0;this._endToolSpan(n.tool_use_id,o,n.content)}}}_onResultMessage(e){if(!this._rootSpan)return;let r=e.usage;r&&(this._inputTokens=r.input_tokens??0,this._outputTokens=r.output_tokens??0,this._cacheReadTokens=r.cache_read_input_tokens??0,this._cacheCreationTokens=r.cache_creation_input_tokens??0),typeof e.num_turns=="number"&&(this._rootSpan.attributes[Pn.TURN_COUNT]=e.num_turns),typeof e.total_cost_usd=="number"&&(this._rootSpan.attributes[Pn.TOTAL_COST_USD]=e.total_cost_usd)}_startToolSpan(e,r,n){if(!this._rootSpan||this._toolSpans.has(e))return;let o={[Pn.OPERATION_NAME]:uge.EXECUTE_TOOL,[Pn.TOOL_NAME]:r,[Pn.TOOL_CALL_ID]:e,[Pn.CONVERSATION_ID]:this._sessionId},s=xoi(n);s!==void 0&&(o[Pn.TOOL_CALL_ARGUMENTS]=s),this._toolSpans.set(e,{traceId:this._rootSpan.traceId,spanId:Qgr(8),parentSpanId:this._rootSpan.spanId,name:`execute_tool ${r}`,startNano:Zdt(),attributes:o})}_endToolSpan(e,r,n){let o=this._toolSpans.get(e);if(!o)return;this._toolSpans.delete(e);let s=Fea(n);s!==void 0&&(o.attributes[Pn.TOOL_CALL_RESULT]=s);let c=Zdt(),l=this._buildOtlpSpan(o,c,r?2:1,r?"Tool execution error":void 0);this._flush([l])}_endRootSpan(e,r){let n=this._rootSpan;if(!n)return;this._rootSpan=void 0,this._inputTokens>0&&(n.attributes[Pn.USAGE_INPUT_TOKENS]=this._inputTokens),this._outputTokens>0&&(n.attributes[Pn.USAGE_OUTPUT_TOKENS]=this._outputTokens),this._cacheReadTokens>0&&(n.attributes[Pn.USAGE_CACHE_READ_INPUT_TOKENS]=this._cacheReadTokens),this._cacheCreationTokens>0&&(n.attributes[Pn.USAGE_CACHE_CREATION_INPUT_TOKENS]=this._cacheCreationTokens);let o=Zdt(),s=[];for(let[,l]of this._toolSpans)s.push(this._buildOtlpSpan(l,o,2,"Tool span orphaned at turn end"));this._toolSpans.clear(),this._responseText&&(n.attributes[Pn.OUTPUT_MESSAGES]=Z8("assistant",this._responseText)),this._responseText="";let c=this._buildOtlpSpan(n,o,e,r);this._flush([...s,c])}_buildOtlpSpan(e,r,n,o){let s={traceId:e.traceId,spanId:e.spanId,name:e.name,kind:1,startTimeUnixNano:e.startNano.toString(),endTimeUnixNano:r.toString(),attributes:wR(e.attributes),events:[],status:o?{code:n,message:o}:{code:n}};return e.parentSpanId&&(s.parentSpanId=e.parentSpanId),s}_flush(e){e.length!==0&&this._persistence.appendSpans(e).catch(r=>{Bea.warn(this._ctx,`Failed to persist OTel spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)})}};p();var qgr=require("fs"),Roi=fe(require("path"));var OMe=new pe("ClaudeCode.ReferenceFormatter"),Uea={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},woi=5*1024*1024;async function koi(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=ys(s.uri);if(!c){OMe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=qea(c);if(l){let u=await Qea(c,l,e);u&&r.push(u)}else{let u=s.selection?`:L${s.selection.start.line+1}-L${s.selection.end.line+1}`:"";n.push(`- ${c}${u}`)}break}case"directory":{let c=ys(s.uri);if(!c){OMe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:OMe.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:jea(n)}),o}a(koi,"buildReferences");async function Qea(t,e,r){try{let n=await qgr.promises.stat(t);if(n.size>woi){OMe.debug(r,`Skipping oversize image reference (${n.size} > ${woi} bytes): ${t}`);return}let o=(await qgr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){OMe.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(Qea,"tryReadImageBlock");function qea(t){return Uea[Roi.extname(t).toLowerCase()]}a(qea,"imageMediaTypeForPath");function jea(t){return` +`;await NMe.promises.appendFile(s,c,{encoding:"utf8",mode:384})}catch(s){Ngr.warn(this.ctx,`Failed to persist spans for conversation=${n}: ${s instanceof Error?s.message:String(s)}`)}}async readSpans(e){if(!this.isEnabled())return[];try{let r=await NMe.promises.readFile(this.getFilePath(e),"utf8"),n=[];for(let o of r.split(` +`))if(o.trim())try{n.push(JSON.parse(o))}catch{}return n}catch(r){return r.code==="ENOENT"?[]:(Ngr.warn(this.ctx,`Failed to read spans for conversation=${e}: ${r instanceof Error?r.message:String(r)}`),[])}}getFilePath(e){let r=this.getDirectory();if(!r)throw new Error("Agent debug logs directory not configured");return dge.join(r,bea(e),vea)}async getLogFilePath(e){if(!this.isEnabled())return null;let r=dge.resolve(this.getFilePath(e));try{return await NMe.promises.access(r),r}catch{return null}}};function Cea(t){for(let e of t.attributes??[])if(e.key==="gen_ai.conversation.id"){let r=e.value.stringValue;if(r&&r.length>0)return r}}a(Cea,"conversationIdOf");function bea(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(bea,"sanitizeForPath");p();function $ii(t){if(t!=null)return typeof t=="string"?{stringValue:t}:typeof t=="boolean"?{boolValue:t}:typeof t=="number"?Number.isInteger(t)?{intValue:String(t)}:{doubleValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(r=>$ii(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a($ii,"encodeAnyValue");function wR(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=$ii(n);o!==void 0&&e.push({key:r,value:o})}return e}a(wR,"encodeAttributes");function Sea(t,e){return{resourceSpans:[{resource:{attributes:Object.entries(e).map(([r,n])=>({key:r,value:{stringValue:n}}))},scopeSpans:[{scope:{name:"copilot-chat"},spans:t}]}]}}a(Sea,"wrapInResourceSpans");function Vii(t,e){let r=Sea(t,{"service.name":"copilot-chat","session.id":e.conversationId});return r.copilotChat={exportedAt:new Date().toISOString(),exporterVersion:"",sessionId:e.conversationId,...e.sessionTitle?{sessionTitle:e.sessionTitle}:{}},r}a(Vii,"buildChatDebugLogExport");var zii=require("crypto");var Mgr=new pe("BackgroundAgent.CliOTelTracker"),Tea={USER_REQUEST:"copilot_chat.user_request"},Ogr="main";function fge(t){return(0,zii.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(fge,"generateHexId");function Yii(){return BigInt(Date.now())*1000000n}a(Yii,"nowNano");function pge(t){if(t){let e=Date.parse(t);if(!Number.isNaN(e))return BigInt(e)*1000000n}return Yii()}a(pge,"isoToNano");function Wii(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a(Wii,"toAttributeString");function Kii(t,e,r){if(!t.get(Nn).getCapabilities().agentDebugLog)return;let n=t.get(cI);if(n.isEnabled())return new Lgr(t,e,r,n)}a(Kii,"createCliOTelTracker");var Lgr=class{constructor(e,r,n,o){this._ctx=e;this._sessionId=r;this._session=n;this._persistence=o;this._pendingTools=new Map}static{a(this,"CliOTelTracker")}onEvent(e){switch(e.type){case"user.message":this._pendingUserRequest=e.data.content;break;case"assistant.turn_start":this._ensureRequest(pge(e.timestamp));break;case"assistant.usage":this._onUsage(e);break;case"assistant.message":this._onAssistantMessage(e);break;case"tool.execution_start":this._onToolStart(e);break;case"tool.execution_complete":this._onToolComplete(e);break;case"session.idle":case"session.error":this._flushRequest().catch(r=>{Mgr.warn(this._ctx,`Failed to flush debug spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)});break;default:break}}_ensureRequest(e){return this._request||(this._request={traceId:fge(16),invokeAgentSpanId:fge(8),startNano:e,userRequest:this._pendingUserRequest,usages:[],responseByAgent:new Map,toolSpanIds:new Map,pendingReads:[]},this._pendingUserRequest=void 0),this._request}_onUsage(e){let r=this._ensureRequest(pge(e.timestamp)),n={data:e.data,endNano:pge(e.timestamp),agentKey:e.data.parentToolCallId??Ogr,parentToolCallId:e.data.parentToolCallId};r.usages.push(n),r.pendingReads.push(this._readAssembled().then(({inputMessagesJson:o,systemInstructions:s})=>{n.inputMessagesJson=o,n.systemInstructions=s}))}_onAssistantMessage(e){let r=this._request;if(!r)return;let n=e.data.content;if(!n)return;let o=e.data.parentToolCallId??Ogr;r.responseByAgent.set(o,(r.responseByAgent.get(o)??"")+n)}_onToolStart(e){let r=e.data.toolCallId;if(!r)return;let n=this._ensureRequest(pge(e.timestamp)),o=e.data.parentToolCallId,s=(o?n.toolSpanIds.get(o):void 0)??n.invokeAgentSpanId,c=fge(8);this._pendingTools.set(r,{traceId:n.traceId,spanId:c,parentSpanId:s,toolName:e.data.toolName??"unknown",arguments:e.data.arguments,startNano:pge(e.timestamp)}),n.toolSpanIds.set(r,c)}_onToolComplete(e){let r=e.data.toolCallId;if(!r)return;let n=this._pendingTools.get(r);if(!n)return;this._pendingTools.delete(r);let o=pge(e.timestamp),s=e.data.success===!1,c=e.data.error?.message,l={[Pn.OPERATION_NAME]:"execute_tool",[Pn.CONVERSATION_ID]:this._sessionId,[Pn.TOOL_NAME]:n.toolName,[Pn.TOOL_CALL_ID]:r},u=Wii(n.arguments);u!==void 0&&(l[Pn.TOOL_CALL_ARGUMENTS]=u);let d=e.data.result??e.data.error,f=Wii(d);f!==void 0&&(l[Pn.TOOL_CALL_RESULT]=f),this._appendSpans([{traceId:n.traceId,spanId:n.spanId,parentSpanId:n.parentSpanId,name:`execute_tool ${n.toolName}`,kind:1,startTimeUnixNano:n.startNano.toString(),endTimeUnixNano:o.toString(),attributes:wR(l),events:[],status:s?{code:2,message:c??"Tool execution error"}:{code:1}}])}async _flushRequest(){let e=this._request;if(!e)return;this._request=void 0,await Promise.allSettled(e.pendingReads);let r=Yii(),n=[this._buildInvokeAgentSpan(e,r)],o=this._buildUserMessageSpan(e);o&&n.push(o);let s=new Map;e.usages.forEach((c,l)=>{c.data.model&&s.set(c.agentKey,l)}),e.usages.forEach((c,l)=>{let u=s.get(c.agentKey)===l,d=this._buildChatSpan(e,c,u);d&&n.push(d)}),n.push(...this._buildAgentResponseSpans(e)),this._appendSpans(n)}_buildInvokeAgentSpan(e,r){return{traceId:e.traceId,spanId:e.invokeAgentSpanId,name:"invoke_agent copilotcli",kind:1,startTimeUnixNano:e.startNano.toString(),endTimeUnixNano:r.toString(),attributes:wR({[Pn.OPERATION_NAME]:"invoke_agent",[Pn.AGENT_NAME]:"copilotcli",[Pn.CONVERSATION_ID]:this._sessionId}),events:[],status:{code:1}}}_buildUserMessageSpan(e){if(!e.userRequest)return;let r=e.startNano.toString();return{traceId:e.traceId,spanId:fge(8),parentSpanId:e.invokeAgentSpanId,name:"user_message",kind:1,startTimeUnixNano:r,endTimeUnixNano:r,attributes:wR({[Pn.OPERATION_NAME]:"user_message",[Pn.CONVERSATION_ID]:this._sessionId,[Tea.USER_REQUEST]:e.userRequest}),events:[{name:"user_message",timeUnixNano:r,attributes:wR({content:e.userRequest})}],status:{code:1}}}_buildAgentResponseSpans(e){let r=new Map;for(let o of e.usages)o.data.model&&r.set(o.agentKey,o.endNano);let n=[];for(let[o,s]of e.responseByAgent){if(!s)continue;let c=o===Ogr?e.invokeAgentSpanId:e.toolSpanIds.get(o)??e.invokeAgentSpanId,l=(r.get(o)??e.startNano).toString();n.push({traceId:e.traceId,spanId:fge(8),parentSpanId:c,name:"agent_response",kind:1,startTimeUnixNano:l,endTimeUnixNano:l,attributes:wR({[Pn.OPERATION_NAME]:"agent_response",[Pn.CONVERSATION_ID]:this._sessionId,[Pn.OUTPUT_MESSAGES]:Z8("assistant",s)}),events:[],status:{code:1}})}return n}_buildChatSpan(e,r,n){let o=r.data.model;if(!o)return;let s=(r.parentToolCallId?e.toolSpanIds.get(r.parentToolCallId):void 0)??e.invokeAgentSpanId,c={[Pn.OPERATION_NAME]:"chat",[Pn.CONVERSATION_ID]:this._sessionId,[Pn.RESPONSE_MODEL]:o},l=r.data.inputTokens,u=r.data.outputTokens,d=r.data.cacheReadTokens,f=r.data.cacheWriteTokens;typeof l=="number"&&(c[Pn.USAGE_INPUT_TOKENS]=l),typeof u=="number"&&(c[Pn.USAGE_OUTPUT_TOKENS]=u),typeof d=="number"&&(c[Pn.USAGE_CACHE_READ_INPUT_TOKENS]=d),typeof f=="number"&&(c[Pn.USAGE_CACHE_CREATION_INPUT_TOKENS]=f),r.systemInstructions&&(c[Pn.SYSTEM_INSTRUCTIONS]=r.systemInstructions),r.inputMessagesJson&&(c[Pn.INPUT_MESSAGES]=r.inputMessagesJson);let h=n?e.responseByAgent.get(r.agentKey):void 0;h&&(c[Pn.OUTPUT_MESSAGES]=Z8("assistant",h));let m=r.endNano,g=r.data.duration,A=typeof g=="number"&&g>=0?m-BigInt(Math.round(g))*1000000n:m;return{traceId:e.traceId,spanId:fge(8),parentSpanId:s,name:`chat ${o}`,kind:1,startTimeUnixNano:A.toString(),endTimeUnixNano:m.toString(),attributes:wR(c),events:[],status:{code:1}}}async _readAssembled(){try{if(!this._session.getChatContextMessages||!this._session.getCurrentSystemMessage)return{};let e=await this._session.getChatContextMessages(),r=this._session.getCurrentSystemMessage();return{inputMessagesJson:e.length>0?JSON.stringify(e):void 0,systemInstructions:typeof r=="string"?r:void 0}}catch(e){return Mgr.warn(this._ctx,`Failed to read assembled messages for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`),{}}}_appendSpans(e){if(e.length!==0)try{this._persistence.appendSpans(e).catch(r=>this._warnPersistFailure(r))}catch(r){this._warnPersistFailure(r)}}_warnPersistFailure(e){Mgr.warn(this._ctx,`Failed to persist debug spans for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`)}};Fo();var X8=new pe("BackgroundAgent.TurnDriver"),Bgr="backgroundAgent",Kdt=class{constructor(e,r,n){this.ctx=e;this.registry=r;this.notificationSender=n;this.processedEventIds=new Map;this.registeredBackstops=new Set;this.lastNanoAiu=new Map}static{a(this,"TurnDriver")}wireAndSend(e,r,n,o,s,c){let l=performance.now(),u=Gii(this.ctx,e,`bg-turn-${Dt()}`),d=Kii(this.ctx,e,r);this.processedEventIds.set(e,new Set),this.registeredBackstops.has(e)||(this.registeredBackstops.add(e),this.registry.registerChild(e,{dispose:a(()=>{this.registeredBackstops.delete(e),this.lastNanoAiu.delete(e),this.forget(e)},"dispose")}));let f=new Ydt,h=r.on("*",_=>{if(_.type==="assistant.turn_start"&&this.registry.getTurnLimiter(e)?.onTurnStart(),u)try{u.persistEvent(_)}catch(E){X8.warn(this.ctx,"Failed to persist background-agent event",{eventType:_.type,error:E instanceof Error?E.message:String(E)})}if(f.trackEvent(_),d)try{d.onEvent(_)}catch(E){X8.warn(this.ctx,"Failed to synthesize debug span",{eventType:_.type,error:E instanceof Error?E.message:String(E)})}this.handleSessionEvent(e,_,o),_.type==="session.todos_changed"&&jlt(this.ctx,this.notificationSender,e,r),(_.type==="session.idle"||_.type==="session.error")&&g()}),m=!1,g=a(()=>{m||(m=!0,this.emitTurnCompleteTelemetry(e,r,l,f.data,o),this.emitSessionMetricsTelemetry(e,r,o,c)),A?.dispose(),h(),this.forget(e)},"cleanup"),A;s&&(A=s.onCancellationRequested(()=>{X8.info(this.ctx,"Cancellation requested, aborting session:",e),r.clearPendingItems(),r.abort()}));let y=r.send(n);return y.catch(_=>{g();let E=uot(_);s?.isCancellationRequested?X8.info(this.ctx,"session.send aborted by cancellation",{sessionId:e,turnIndex:o}):(X8.error(this.ctx,"session.send failed",{sessionId:e,turnIndex:o,error:E,stack:_ instanceof Error?_.stack:void 0}),this.emitTurnFailedTelemetry(e,o,"SendMessageError"));let v={type:"session.error",id:Dt(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:E}};this.sendSessionUpdateNotification(e,v,o)}),y}forget(e){this.processedEventIds.delete(e)}processedEventIdsForTesting(){return this.processedEventIds}seedProcessedEventIdsForTesting(e){this.processedEventIds.set(e,new Set),this.registeredBackstops.has(e)||(this.registeredBackstops.add(e),this.registry.registerChild(e,{dispose:a(()=>{this.registeredBackstops.delete(e),this.lastNanoAiu.delete(e),this.forget(e)},"dispose")}))}async handleSessionEvent(e,r,n){let o=r.id,s=this.processedEventIds.get(e);if(s?.has(o)){X8.debug(this.ctx,`Skipping duplicate SDK event: ${r.type} (id=${o})`);return}s?.add(o),await this.sendSessionUpdateNotification(e,r,n)}async sendSessionUpdateNotification(e,r,n){try{await this.notificationSender.sendBackgroundAgentSessionUpdate(e,r,void 0,n)}catch(o){X8.error(this.ctx,"Failed to send session update notification:",o)}}async emitTurnCompleteTelemetry(e,r,n,o,s){try{let c=performance.now()-n,l=this.registry.getChatMode(e)??"agent",d=(await r.usage.getMetrics()).totalNanoAiu,f=this.lastNanoAiu.get(e)??0,h=typeof d=="number"&&Number.isFinite(d),m=h?Math.min(f,d):f;h&&this.lastNanoAiu.set(e,d);let g=h?(d-m)/1e9:0;sr(this.ctx,"backgroundAgent.turn.complete",{requestSource:Bgr,sessionId:e,chatMode:l,agentProvider:"BACKGROUND",turnIndex:s!=null?String(s):""},{totalDurationMs:c,totalUserWaitMs:o?o.permission.totalMs+o.user_input.totalMs+o.exit_plan_mode.totalMs:0,permissionWaitMs:o?.permission.totalMs??0,permissionWaitCount:o?.permission.count??0,userInputWaitMs:o?.user_input.totalMs??0,userInputWaitCount:o?.user_input.count??0,exitPlanModeWaitMs:o?.exit_plan_mode.totalMs??0,exitPlanModeWaitCount:o?.exit_plan_mode.count??0,credits:g})}catch(c){X8.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}emitTurnFailedTelemetry(e,r,n){sr(this.ctx,"backgroundAgent.turn.failed",{requestSource:Bgr,sessionId:e,agentProvider:"BACKGROUND",errorType:n,turnIndex:r!=null?String(r):""})}async emitSessionMetricsTelemetry(e,r,n,o){try{let s=await r.usage.getMetrics(),c=0,l=0,u=0,d=0,f=0,h=0,m=[];for(let[g,A]of Object.entries(s.modelMetrics))A&&(c+=A.usage.inputTokens,l+=A.usage.outputTokens,u+=A.usage.cacheReadTokens,d+=A.usage.cacheWriteTokens,f+=A.usage.reasoningTokens??0,h+=A.requests.count,m.push(o?"byok models":g));sr(this.ctx,"backgroundAgent.session.metrics",{requestSource:Bgr,sessionId:e,agentProvider:"BACKGROUND",modelNames:m.join(","),turnIndex:n!=null?String(n):""},{totalApiDurationMs:s.totalApiDurationMs,totalInputTokens:c,totalOutputTokens:l,totalCacheReadTokens:u,totalCacheWriteTokens:d,totalReasoningTokens:f,llmCallCount:h,totalPremiumRequestCost:s.totalPremiumRequestCost})}catch(s){X8.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}};p();async function Jii(t,e){let r=e.agentMode??(e.chatMode!==void 0?"interactive":void 0);r&&await t.mode.set({mode:r})}a(Jii,"applyAgentModeOverride");p();async function Zii(t,e,r,n,o){let s=n.chatMode??"agent",c=Glt(s)?s:"agent";if((c==="inline"||c==="inline-ask")&&!o.hasConfinedFile(e))throw new Error(`Cannot apply chatMode '${c}' for session ${e}: no confined file registered (session was not created with inlineConfinedFile)`);if(o.getChatMode(e)===c)return;if(!o.getWorkingDir(e))throw new Error(`Cannot apply chatMode for session ${e}: working directory is not cached`);o.deleteChatMode(e),await RJn(r,c,{getAllLoadedSkillNames:a(async()=>(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(d=>d.name)),"getAllLoadedSkillNames"),getPolicyDisabledSkillNames:a(async()=>{let d;try{d=t.get(xg)}catch{return[]}return d.isSkillsEnabled()?[]:(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(f=>f.name))},"getPolicyDisabledSkillNames"),getMcpServers:a(()=>{let d=o.getMcpDirectory(e)??o.getWorkspaceFolderUri(e);try{return Promise.resolve(t.get(yR).buildMcpServers(d))}catch(f){if(f instanceof Ic)return Promise.resolve({});throw f}},"getMcpServers")}),o.setChatMode(e,c)}a(Zii,"applyChatModeOverride");p();var Xii=new pe("BackgroundAgent.applyChatModeSelection");async function eoi(t,e,r){if(r.chatMode===void 0&&r.agentMode===void 0)return;let n=r.chatMode!==void 0&&r.chatMode!=="agent"&&!Glt(r.chatMode)?r.chatMode:void 0;try{n===void 0?(await e.agent.deselect(),Xii.info(t,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:n}),Xii.info(t,`Applied custom agent '${n}' for session ${r.sessionId}`))}catch(o){let s=o instanceof Error?o.message:String(o);throw n===void 0?new Error(`Failed to clear custom agent selection on session ${r.sessionId}: ${s}`):new Error(`Failed to select custom agent '${n}' on session ${r.sessionId}: ${s}. Verify the agent is registered via a workspace .agent.md file.`)}}a(eoi,"applyChatModeSelection");p();var toi=require("node:util");async function roi(t,e,r,n){let o=Rut(t)??{enabled:!1},s=n.getAppliedSandboxConfig(e);s!==void 0&&(0,toi.isDeepStrictEqual)(s,o)||(await r.updateOptions({sandboxConfig:o}),n.setAppliedSandboxConfig(e,o))}a(roi,"applySandboxOverride");p();p();var TG=new pe("BackgroundAgent.ProviderConfig");async function noi(t,e,r){if(!e)return;let n=await QKe(t,e,r);if(!n&&!ob(e)){TG.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let f=await new as(t.get(Un)).getStoredModelConfigs(e),h=r?f[r]:void 0;o=h?.deploymentUrl,s=h?.modelCapabilities?.maxInputTokens,c=h?.modelCapabilities?.maxOutputTokens}catch(d){TG.warn(t,"Failed to load BYOK model config; using defaults",{providerName:e,modelId:r,error:d instanceof Error?d.message:String(d)})}let l=Dwe(e),u={maxPromptTokens:s??l.maxInputTokens,maxOutputTokens:c??l.maxOutputTokens};if(ob(e)){let d;try{d=(await new as(t.get(Un)).getProviderConfig(e))?.url}catch(f){TG.warn(t,"Failed to load Ollama provider config; using default endpoint",{providerName:e,modelId:r,error:f instanceof Error?f.message:String(f)})}return{type:"openai",wireApi:"completions",baseUrl:UKe(d),modelId:r,wireModel:r,...u}}if(n){if(e===Ii.Anthropic)return{type:"anthropic",baseUrl:Nwe(o??Hue[e],"messages"),apiKey:n,modelId:r,wireModel:r,...u};if(e===Ii.Azure){if(!o){TG.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return xea(t,o,n,r,u)}if(Bue(e))return{type:"openai",baseUrl:o??Hue[e],apiKey:n,modelId:r,wireModel:r,...u};if(VO(e))return Iea(t,e,n,r,o,u);TG.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}}a(noi,"buildProviderConfig");async function Iea(t,e,r,n,o,s){if(!o){TG.warn(t,`Custom endpoint '${e}' has no configured URL; skipping provider config.`);return}let u=(await new as(t.get(Un)).getProviderConfig(e))?.apiType,d=u==="chatCompletions"||u==="responses"||u==="messages"?u:Pwe,f=Nwe(o,d);return d==="messages"?{type:"anthropic",baseUrl:f,apiKey:r,modelId:n,wireModel:n,...s}:{type:"openai",wireApi:d==="responses"?"responses":"completions",baseUrl:f,apiKey:r,modelId:n,wireModel:n,...s}}a(Iea,"buildCustomEndpointProviderConfig");function xea(t,e,r,n,o){let s;try{s=new URL(e)}catch{TG.warn(t,`Invalid Azure deployment URL: ${e}`);return}let c=`${s.protocol}//${s.hostname}`;if(s.hostname.endsWith(".openai.azure.com"))return{type:"azure",baseUrl:c,apiKey:r,modelId:n,wireModel:n,azure:{apiVersion:"2025-01-01-preview"},...o};if(s.hostname.endsWith(".models.ai.azure.com")||s.hostname.endsWith(".inference.ml.azure.com"))return{type:"openai",baseUrl:`${c}/v1`,apiKey:r,modelId:n,wireModel:n,...o};TG.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(xea,"buildAzureProviderConfig");var Fgr=new pe("BackgroundAgent.applyTurnOverrides");async function ioi(t,e,r,n){let o=r.providerName?r.providerName:void 0;if(o!==void 0&&!Bq(await t.get(Qt).getToken()))throw new SPe(`BYOK is disabled for this account. Provider '${o}' cannot be used for model '${r.model??""}'.`,o,r.model);let s=await noi(t,o,r.model);if(o!==void 0&&s===void 0)throw new bPe(`BYOK provider '${o}' is misconfigured for model '${r.model??""}'. Verify the API key`+(o===Ii.Azure?" and per-model deployment URL":"")+" is configured for this provider/model.",o,r.model);let c=n.registry.getProviderModel(r.sessionId),l=r.model,u=l!==void 0&&c?.model!==l,d=c!==void 0&&c.provider!==o,f=c!==void 0&&(d||u),h=e,m=!1;if(f){Fgr.info(t,`Provider/model changed for session ${r.sessionId} (${c?.provider??"(built-in)"}/${c?.model??"(unchanged)"} \u2192 ${o??"(built-in)"}/${l??"(unchanged)"}); forcing close+resume cycle to strip provider-bound reasoning state.`);let g=await n.ensureManager();n.registry.forgetSession(r.sessionId),n.registry.deleteChatMode(r.sessionId);try{await g.closeSession(r.sessionId),m=!0,h=await n.getOrResumeSession(r.sessionId)}catch(A){if(m)throw n.registry.deleteProviderModel(r.sessionId),new Error(`Failed to resume session ${r.sessionId} after provider/model change: `+(A instanceof Error?A.message:String(A)));Fgr.warn(t,`Failed to close session ${r.sessionId} for provider/model change; continuing with existing session: `+(A instanceof Error?A.message:String(A))),h=e}}try{await h.updateOptions({provider:s??null,...l?{model:l}:{},...r.reasoningEffort?{reasoningEffort:r.reasoningEffort}:{},...r.contextTier?{contextTier:r.contextTier}:{}})}catch(g){throw new Error(`Failed to bind BYOK provider '${o??"(built-in)"}' to session ${r.sessionId}: ${g instanceof Error?g.message:String(g)}`)}return n.registry.setProviderModel(r.sessionId,{provider:o,model:l??c?.model}),Fgr.info(t,`Rebound session ${r.sessionId} for this turn: provider=${o??"(built-in)"}, model=${l??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),h}a(ioi,"applyTurnOverrides");p();async function ooi(t,e,r,n,o){let s=Rea(e,n),c=o==="inline"||o==="inline-ask";await t.get(D0).applyPromptTemplateToRequest(r,s?[s]:[],c,{includePlugins:!0})||wea(t,r)}a(ooi,"expandPromptTemplate");function wea(t,e){let r=e.message.trim();if(!r.startsWith("/"))return!1;let[n,...o]=r.split(" "),s=n.slice(1);if(!vDn.has(s))return!1;let c=P2().find(l=>l.id===s);return c?.instructions?(e.message=c.instructions(t,o.join(" ")),!0):!1}a(wea,"applyBuiltinCreateTemplate");function Rea(t,e){let r=e.getWorkingDir(t);return r?{uri:Ko(r)}:void 0}a(Rea,"getWorkspaceFolderForSession");p();var hge=class{constructor(e,r,n){this.ctx=e;this.target=n;this.syncScheduled=!1;this.logger=new pe(r);let o=kut(e);o&&(this.host=o,this.mountsChangedListener=()=>this.schedule(),o.service.on(Oee.MountsChanged,this.mountsChangedListener))}static{a(this,"GatewayMountsSync")}dispose(){this.host&&this.mountsChangedListener&&(this.host.service.off(Oee.MountsChanged,this.mountsChangedListener),this.mountsChangedListener=void 0,this.host=void 0)}schedule(){this.syncScheduled||(this.syncScheduled=!0,queueMicrotask(()=>{this.syncScheduled=!1;let e=this.host;e&&this.target.syncToActiveSessions(e).catch(r=>this.onSyncError(r))}))}onSyncError(e){this.logger.warn(this.ctx,"MCP active-session sync failed",{error:e instanceof Error?e.message:String(e)})}};var mge=fe(require("node:path"));Fo();var wm=new pe("BackgroundAgent"),e6="backgroundAgent",kea="backgroundAgent.remote",Pea=new Set(["system.message","hook.start","hook.end"]),Dea=new Set(["gpt-41-copilot","gpt-4.1","gpt-4.1-2025-04-14","gpt-5.4-nano","gemini-2.5-pro","grok-code-fast-1"]);function soi(t,e){let r=a(n=>/^[A-Za-z]:[\\/]/.test(n)||/^\\\\/.test(n),"isWindowsPath");return r(t)&&r(e)?mge.win32.normalize(t).toLowerCase()===mge.win32.normalize(e).toLowerCase():mge.posix.normalize(t)===mge.posix.normalize(e)}a(soi,"sessionPathsEqual");var Ys=class{constructor(e){this.ctx=e;this.pendingExternalToolDefs=new Map;this.notificationSender=e.get(ss),this.managerLifecycle=new Xlt(e),this.authBinding=new lot(e),this.registry=new Vdt(e,(o,s)=>this.managerLifecycle.closeSession(o,s)),this.remoteController=new iut(e,{registry:this.registry,injectUserMessage:a((o,s)=>this.injectRemoteUserMessage(o,s),"injectUserMessage")}),this.turnDriver=new Kdt(e,this.registry,this.notificationSender);let r=new dot(e,this.registry);this._mcpSync=new hge(e,"BackgroundAgent.McpSync",r),e.get(Qo).onDidChangeHttpSettings(()=>{qlt(this.ctx)}),ws(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(xg).onDidChangeSkillsEnabled(()=>{this.registry.clearChatMode()})}catch(o){if(!(o instanceof Ic))throw o}}static{a(this,"BackgroundAgentService")}async handleAuthStateChange(){let{changed:e,hadPrevious:r,hasCurrent:n,githubHost:o}=await this.authBinding.detectIdentityChange();e&&(wm.info(this.ctx,"GitHub identity changed, clearing cached sessions",{hadPrevious:r,hasCurrent:n,cachedSessionCount:this.registry.size(),remoteDelegateCount:this.remoteController.delegateCount()}),await this.clearUserScopedState(),await this.managerLifecycle.disposeIfGitHubHostChanged(o)&&wm.info(this.ctx,"Restarting Copilot runtime for GitHub host change",{githubHost:o}))}async clearUserScopedState(){this.pendingExternalToolDefs.clear(),await this.registry.removeAll(),await this.managerLifecycle.closeAllSessions()}async ensureManager(){let e=await this.authBinding.resolveRuntimeGitHubHost();return this.managerLifecycle.requiresGitHubHostRestart(e)&&(wm.info(this.ctx,"GitHub host changed before manager use, clearing cached sessions",{githubHost:e}),await this.clearUserScopedState(),await this.managerLifecycle.disposeIfGitHubHostChanged(e)),this.managerLifecycle.ensureManager(e)}get sdk(){return this.managerLifecycle.getSdk()}async handleInteraction(e){let r=performance.now(),n=await this.getOrResumeSession(e.sessionId),o=await U4n(n,e);return xx(this.ctx,"backgroundAgent.interaction",{requestSource:e6,sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type,resultKind:e.type==="permission"?e.result.kind:""},{totalTimeMs:performance.now()-r}),o}buildAuthInfo(){return this.authBinding.buildAuthInfo()}applyTurnOverrides(e,r){return ioi(this.ctx,e,r,{registry:this.registry,ensureManager:a(()=>this.ensureManager(),"ensureManager"),getOrResumeSession:a(n=>this.getOrResumeSession(n),"getOrResumeSession")})}applyChatModeSelection(e,r){return eoi(this.ctx,e,r)}buildSessionOptions(e,r){return qii(this.ctx,e,r,{buildAuthInfo:a(()=>this.buildAuthInfo(),"buildAuthInfo")})}async createSession(e){let r=performance.now();wm.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??Dt(),s=e.inlineConfinedFile?NJn(2):void 0,c=e.inlineConfinedFile?MJn(e.inlineConfinedFile):void 0,l=await this.buildSessionOptions(o,{...e,inlineTurnLimiter:s,inlineConfinementHook:c}),u=await n.createSession(l);return s&&this.registry.setTurnLimiter(o,s),wm.info(this.ctx,"Session created:",o),xx(this.ctx,"backgroundAgent.create",{requestSource:e6,reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.registry.set(o,u),this.registry.setResumeOptions(o,l),this.registry.setWorkingDir(o,oo(e.workspaceFolder.uri).fsPath),this.registry.setWorkspaceFolderUri(o,e.workspaceFolder.uri),e.mcpDirectory&&this.registry.setMcpDirectory(o,e.mcpDirectory),e.inlineConfinedFile&&this.registry.setConfinedFile(o,e.inlineConfinedFile),{sessionId:o,workspacePath:u.workspacePath}}registerExternalTools(e,r){r?.length&&(this.pendingExternalToolDefs.set(e,r),wm.info(this.ctx,"Stored pending external tool definitions",{sessionId:e,toolCount:r.length}))}async getOrResumeSession(e,r={}){let n=this.registry.get(e);if(n){let m=this.pendingExternalToolDefs.get(e);if(m){let g=await this.ensureManager();return this.registry.forgetSession(e),this.registry.deleteChatMode(e),await g.closeSession(e),wm.info(this.ctx,"Reopening cached session with pending external tool definitions",{sessionId:e,toolCount:m.length}),this.getOrResumeSession(e,r)}return n}let o=await this.ensureManager(),s=this.pendingExternalToolDefs.get(e),c=this.registry.getResumeOptions(e),l=r.workspaceFolder,u;if(!l&&c){let m=this.registry.getWorkspaceFolderUri(e);if(!m)throw new Error(`Cannot resume session ${e}: cached connection options have no workspace URI`);l={uri:m},u={...c,sessionId:e,externalToolDefinitions:r.externalToolDefinitions??s??c.externalToolDefinitions}}else{if(!l){let m=await o.getSessionMetadata({sessionId:e});if(!m)throw new Error(`Session not found: ${e}`);let g=m.context?.cwd;if(!g)throw new Error(`Cannot resume session ${e} from disk: persisted metadata is missing working-directory context`);l={uri:Ko(g)},wm.info(this.ctx,"Resuming session from disk via metadata fallback",{sessionId:e})}u=await this.buildSessionOptions(e,{...r,externalToolDefinitions:r.externalToolDefinitions??s,workspaceFolder:l})}let d=await o.getSession(u,!0);if(!d)throw new Error(`Session not found: ${e}`);s&&this.pendingExternalToolDefs.get(e)===s&&this.pendingExternalToolDefs.delete(e),this.registry.set(e,d),this.registry.setResumeOptions(e,u);let f=Array.from(d.getEvents()).filter(m=>m.type==="user.message").length;f>0&&this.registry.seedTurnIndexIfAbsent(e,f-1),this.registry.deleteChatMode(e),this.registry.deleteAppliedSandboxConfig(e);let h=l?.uri?oo(l.uri).fsPath:void 0;return h&&this.registry.setWorkingDir(e,h),l?.uri&&this.registry.setWorkspaceFolderUri(e,l.uri),r.mcpDirectory&&this.registry.setMcpDirectory(e,r.mcpDirectory),d}async resolveRubberDuckPrompt(e,r){return this.resolveBuiltinSlashPrompt(e,"rubber-duck",r)}async resolveInitPrompt(e,r){return this.resolveBuiltinSlashPrompt(e,"init",r)}async resolveBuiltinSlashPrompt(e,r,n){let o=n.slice(`/${r}`.length).trimStart(),s=await e.commands.invoke({name:r,input:o});if(s.kind!=="agent-prompt")throw wm.error(this.ctx,"Slash command returned an unexpected result",{command:r,resultKind:s.kind}),new Error(`Unable to run /${r}.`);return s.prompt}async sendMessage(e,r){let n=await this.getOrResumeSession(e.sessionId),o=await this.applyTurnOverrides(n,e);await this.applyChatModeOverride(e.sessionId,o,e),await this.applySandboxOverride(e.sessionId,o);let s=e.message;s==="/rubber-duck"||s.startsWith("/rubber-duck ")?e.message=await this.resolveRubberDuckPrompt(o,s):(s==="/init"||s.startsWith("/init "))&&(e.message=await this.resolveInitPrompt(o,s)),await this.expandPromptTemplate(e.sessionId,e,e.chatMode),await this.applyChatModeSelection(o,e);let c={prompt:e.message,displayPrompt:s,...e.sendMode?{mode:e.sendMode}:{}};await this.applyAgentModeOverride(o,e);let l=e.chatMode==="inline-ask"||e.chatMode==="inline";if(e.references?.length&&!l){let m=F4n(e.references,this.ctx);m.length>0&&(c.attachments=m)}if(l){let m=this.registry.getConfinedFile(e.sessionId);if(m){let g=e.references?.find(y=>y.type==="file"&&y.uri===m),A=await LJn(m,g,this.ctx);if(A.promptFragment&&(c.prompt=`${c.prompt}${A.promptFragment}`),A.isLargeFile){let y=e.chatMode==="inline-ask"?Hlt:Dfr;await o.updateOptions({availableTools:[...y,"view"]})}}}this.registry.getTurnLimiter(e.sessionId)?.reset();let u=performance.now(),d=this.registry.incrementTurnIndex(e.sessionId);this.turnDriver.wireAndSend(e.sessionId,o,c,d,r,!!e.providerName);let f={requestSource:e6,chatMode:this.registry.getChatMode(e.sessionId)??"agent",sessionId:e.sessionId,safeModelId:Nea(e.model,e.providerName),providerName:e.providerName??"",reasoningEffort:e.reasoningEffort??"",contextTier:e.contextTier??"",hasReferences:String((e.references?.length??0)>0),turnIndex:String(d)},h={totalTimeMs:performance.now()-u,messageCharLen:e.message.length,referenceCount:e.references?.length??0};return xx(this.ctx,"backgroundAgent.send",f,h),{}}async truncateHistory(e){let r=performance.now(),o=await(await this.getOrResumeSession(e.sessionId)).history.truncate({eventId:e.eventId});return xx(this.ctx,"backgroundAgent.truncateHistory",{requestSource:e6,providerName:e.providerName,sessionId:e.sessionId,eventId:e.eventId},{totalTimeMs:performance.now()-r,eventsRemoved:o.eventsRemoved}),{eventId:e.eventId,eventsRemoved:o.eventsRemoved}}async forkSession(e){let r=performance.now(),o=await(await this.ensureManager()).forkSession(e.sessionId,{toEventId:e.toEventId,name:e.name});return xx(this.ctx,"backgroundAgent.fork",{requestSource:e6,providerName:e.providerName},{totalTimeMs:performance.now()-r}),{sessionId:o.sessionId}}applyChatModeOverride(e,r,n){return Zii(this.ctx,e,r,n,this.registry)}applySandboxOverride(e,r){return roi(this.ctx,e,r,this.registry)}applyAgentModeOverride(e,r){return Jii(e,r)}async injectRemoteUserMessage(e,r){let n=await this.getOrResumeSession(e),o={message:r};await this.expandPromptTemplate(e,o);let s={prompt:o.message,displayPrompt:r},c=performance.now(),l=this.registry.incrementTurnIndex(e);await this.turnDriver.wireAndSend(e,n,s,l),xx(this.ctx,"backgroundAgent.send",{requestSource:kea,sessionId:e,safeModelId:"",providerName:"",reasoningEffort:"",contextTier:"",hasReferences:"false",turnIndex:String(l)},{totalTimeMs:performance.now()-c,messageCharLen:o.message.length,referenceCount:0})}expandPromptTemplate(e,r,n){return ooi(this.ctx,e,r,this.registry,n)}async destroySession(e){try{return await this.remoteController.tearDownForDestroy(e.sessionId),this.pendingExternalToolDefs.delete(e.sessionId),await this.registry.remove(e.sessionId),await(await this.ensureManager()).deleteSession(e.sessionId),{success:!0}}catch(r){return wm.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);wm.info(this.ctx,"Stopping session via abort:",e),await n.abortManualCompaction()&&wm.info(this.ctx,"Aborted in-progress manual compaction:",e),await n.clearPendingItems(),await n.abort(),xx(this.ctx,"backgroundAgent.stop",{requestSource:e6,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);wm.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return xx(this.ctx,"backgroundAgent.compactHistory",{requestSource:e6,sessionId:e},{totalTimeMs:performance.now()-r,tokensRemoved:o.tokensRemoved,messagesRemoved:o.messagesRemoved}),{success:o.success,tokensRemoved:o.tokensRemoved,messagesRemoved:o.messagesRemoved,summaryContent:o.summaryContent,contextWindow:o.contextWindow}}async stopCompactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);wm.info(this.ctx,"Aborting manual compaction for session:",e);let o=await n.abortManualCompaction();return xx(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:e6,sessionId:e,aborted:String(o)},{totalTimeMs:performance.now()-r}),{aborted:o}}async getPlanPath(e){return await(await this.getOrResumeSession(e)).getPlanPath()}async resumeSession(e){let r=performance.now();wm.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());jlt(this.ctx,this.notificationSender,e.sessionId,n),xx(this.ctx,"backgroundAgent.resume",{requestSource:e6,reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!Pea.has(c.type));return{sessionId:e.sessionId,workspacePath:n.workspacePath,events:s}}async listSessions(e){let n=await(await this.ensureManager()).listSessions(),o=n;return e&&(o=n.filter(s=>!(e.cwd&&(!s.context?.cwd||!soi(s.context.cwd,e.cwd))||e.gitRoot&&(!s.context?.gitRoot||!soi(s.context.gitRoot,e.gitRoot))||e.repository&&s.context?.repository!==e.repository||e.branch&&s.context?.branch!==e.branch))),{sessions:o.map(s=>({sessionId:s.sessionId,startTime:s.startTime instanceof Date?s.startTime.toISOString():String(s.startTime),modifiedTime:s.modifiedTime instanceof Date?s.modifiedTime.toISOString():String(s.modifiedTime),summary:s.summary,isRemote:s.isRemote,context:s.context}))}}async listModels(e){wm.info(this.ctx,"listModels called",{forceRefresh:e}),await this.ensureManager();let r=performance.now();try{let o=(await this.ctx.get(Ns).getMetadata(e)).filter(l=>l.model_picker_enabled===!0).filter(l=>l.capabilities.type==="chat").filter(l=>!Dea.has(l.id)).map(spe);o.length===0?wm.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):wm.info(this.ctx,`Successfully retrieved ${o.length} models`);let s=[];this.ctx.get(eu).getPolicyValue("autoModel.enabled")!==!1&&s.push(this.buildAutoModelEntry());let c=[...s,...o];return wm.debug(this.ctx,"Models retrieved:",c.map(l=>l.id)),xx(this.ctx,"backgroundAgent.listModels",{status_text:"success"},{duration_ms:performance.now()-r,model_count:c.length}),{models:c}}catch(n){let o=n instanceof Error?n.message:String(n),s=snr(n);throw wm.error(this.ctx,"listModels failed",{error:o,cause:s,stack:n instanceof Error?n.stack:void 0}),zp(this.ctx,"backgroundAgent.listModels",n,{status_text:"failure",...s?{errorCause:s}:{}},{duration_ms:performance.now()-r}),new Error("Failed to retrieve models",{cause:n})}}buildAutoModelEntry(){return{id:this.sdk.AUTO_MODEL_ID,name:"Auto",preview:!1,capabilities:{family:this.sdk.AUTO_MODEL_ID,supports:{vision:!0},limits:{max_context_window_tokens:0}}}}async enableRemote(e){let r=await this.getOrResumeSession(e);return this.remoteController.enableForSession(e,r)}async disableRemote(e){let r=await this.getOrResumeSession(e);await this.remoteController.disableForSession(r)}getRemoteStatus(e){return this.remoteController.getStatus(e)}async shutdown(){this._mcpSync.dispose(),this._skillsEnabledListener?.dispose(),this._skillsEnabledListener=void 0,await this.clearUserScopedState(),kfr(),await this.managerLifecycle.dispose()}};function Nea(t,e){return e?"byok models":t??""}a(Nea,"safeModelId");p();p();var Ff=(o=>(o.Background="BACKGROUND",o.Claude="CLAUDE",o.Codex="CODEX",o.Cloud="CLOUD",o))(Ff||{});p();async function Ch(t,e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return aoi(t,e,n,o),s}catch(s){throw o.error??=s,aoi(t,e,n,o),s}}a(Ch,"runWithTelemetry");function aoi(t,e,r,n){let s={success:n.error?"false":n.ok??!0?"true":"false",...n.properties},c={totalTimeMs:performance.now()-r,...n.measurements};n.error!==void 0?zp(t,`${e}.failure`,n.error,s,c):$c(t,e,s,c)}a(aoi,"flushTelemetry");p();var coi=fe(require("path"));p();var Ugr=["default","acceptEdits","bypassPermissions","plan","auto"];function Bee(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(Bee,"assertClaudeProvider");function gge(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(gge,"assertNonEmptyString");function Mea(t,e,r){if(r===void 0)throw new Error(`${t}: ${e} is required`);try{oo(r)}catch(n){throw new Error(`${t}: ${e} is not a valid URI: ${r}`,{cause:n})}}a(Mea,"assertFsUri");function Oea(t,e,r){if(!coi.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(Oea,"assertAbsolutePath");function Lea(t,e){if(e!==void 0&&!Ugr.includes(e))throw new Error(`${t}: agentMode must be one of ${Ugr.join(", ")}, got '${e}'`)}a(Lea,"assertAllowedAgentMode");async function MMe(t,e){if(e===void 0)return;let n=(await t.get(Ns).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!vWe(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a(MMe,"validateClaudeModel");async function loi(t,e){Bee("createSession",e.agentProvider),Mea("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await MMe(t,e.model)}a(loi,"validateAgentCreate");async function uoi(t,e){Bee("resumeSession",e.agentProvider),gge("resumeSession","sessionId",e.sessionId),await MMe(t,e.model)}a(uoi,"validateAgentResume");async function doi(t,e){Bee("sendMessage",e.agentProvider),gge("sendMessage","sessionId",e.sessionId),gge("sendMessage","message",e.message),Lea("sendMessage",e.agentMode),await MMe(t,e.model)}a(doi,"validateAgentSend");function foi(t,e){Bee("stopSession",e.agentProvider),gge("stopSession","sessionId",e.sessionId)}a(foi,"validateAgentStop");function poi(t,e){Bee("destroySession",e.agentProvider),gge("destroySession","sessionId",e.sessionId)}a(poi,"validateAgentDestroy");function hoi(t,e){Bee("listSessions",e.agentProvider),gge("listSessions","cwd",e.cwd),Oea("listSessions","cwd",e.cwd)}a(hoi,"validateAgentListSessions");function moi(t,e){Bee("listModels",e.agentProvider)}a(moi,"validateAgentListModels");p();p();p();var _oi=require("child_process"),Age=fe(require("path")),Eoi=fe(WP()),voi=require("util");var goi=5e3,Aoi=200,yge=class{constructor(e){this.execFile=(0,voi.promisify)(_oi.execFile);this.cache=new Map;this.config=e}static{a(this,"BaseCliVersionChecker")}check(e){if(!e)return Promise.resolve({severity:"error",message:this.config.notConfiguredMessage});let r=Age.resolve(e),n=this.cache.get(r);if(n)return n;let o=this.computeStatus(r).then(s=>(s.severity==="error"&&this.cache.delete(r),s));return this.cache.set(r,o),o}clearCache(e){if(e){this.cache.delete(Age.resolve(e));return}this.cache.clear()}async computeStatus(e){let r=this.validateBasename(e);if(r)return{severity:"error",message:r};let n;try{n=(await this.execFile(e,["--version"],{timeout:goi,windowsHide:!0})).stdout}catch(c){return{severity:"error",message:this.formatSpawnError(e,c)}}let o=Eoi.coerce(n);if(!o)return{severity:"error",message:`Could not parse ${this.config.displayName} version from the input path --version output: "${yoi(n)}". Cannot verify compatibility.`};let s=this.config.validateVersion(o,e);return s||{severity:"ok"}}validateBasename(e){let r=this.config.allowedBasenames;if(!r||r.length===0)return;let n=Age.basename(e).toLowerCase();if(!r.includes(n))return`${this.config.displayName} at the input path must point at the "${r[0]}" executable, but the basename is "${Age.basename(e)}".`}formatSpawnError(e,r){let n=r;if(n?.code==="ENOENT")return`${this.config.displayName} not found at the input path. Check that the file exists and is executable.`;if(n?.killed&&n?.signal==="SIGTERM")return`${this.config.displayName} at the input path did not respond to --version within ${goi/1e3}s.`;let o=typeof n?.stderr=="string"?yoi(n.stderr):"",s="";switch(typeof n?.code){case"number":s=` (exit code ${n.code})`;break;case"string":s=` (error code ${n.code})`;break}let c=o?` stderr: "${o}"`:"",l=n?.message?`: ${n.message}`:"";return`Failed to run "the input path --version"${s}${l}${c}`}};function yoi(t){let e=t.trim();return e.length<=Aoi?e:`${e.slice(0,Aoi)}\u2026`}a(yoi,"truncate");var Jdt=fe(WP());function Bea(){let t=Oxe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(Bea,"getExpectedVersionRaw");var Qgr=class extends yge{static{a(this,"ClaudeCliVersionChecker")}constructor(){super({displayName:"Claude Code CLI",allowedBasenames:process.platform==="win32"?["claude.exe"]:["claude"],notConfiguredMessage:"Claude Code CLI path is not configured. Install @anthropic-ai/claude-code (e.g. `npm install -g @anthropic-ai/claude-code`), then open your editor's Copilot settings and set the Claude Code CLI Path field to the absolute path of the `claude` executable.",validateVersion(e){let r=Bea(),n=Jdt.coerce(r);if(!n)return{severity:"error",message:`Could not parse expected Claude Code CLI version "${r}" from packaged metadata. This is an internal error; please report it.`};if(!Jdt.satisfies(e,`~${n.major}.${n.minor}.0`))return{severity:"warning",message:`Claude Code CLI at the input path reports version ${e.version}, but this language server was built against ${n.version}. The session will still start, but SDK behavior may be unstable on protocol drift. Run \`npm install -g @anthropic-ai/claude-code@${n.version}\` to align versions.`}}})}},_ge=new Qgr;p();var Ege=class{constructor(){this._entries=new Map}static{a(this,"PendingRequestRegistry")}register(e){if(this._entries.has(e))throw new Error(`PendingRequestRegistry: duplicate key ${e}`);return{promise:new Promise((n,o)=>{this._entries.set(e,{resolve:n,reject:o})}),isSettled:a(()=>!this._entries.has(e),"isSettled")}}respond(e,r){let n=this._entries.get(e);return n?(this._entries.delete(e),n.resolve(r),!0):!1}rejectOne(e,r){let n=this._entries.get(e);return n?(this._entries.delete(e),n.reject(r),!0):!1}has(e){return this._entries.has(e)}respondAll(e){let r=[...this._entries.values()];this._entries.clear();for(let n of r)n.resolve(e)}rejectAll(e){let r=[...this._entries.values()];this._entries.clear();for(let n of r)n.reject(e)}};p();p();function Zdt(t){if(!t.startsWith("mcp__"))return;let[e,...r]=t.slice(5).split("__"),n=r.join("__");if(!(!e||!n))return{serverName:e,toolName:n}}a(Zdt,"parseClaudeMcpToolName");function Coi(t,e){let r=t.buildMcpServers(Ko(e),!1),n=Object.create(null);for(let[o,s]of Object.entries(r))n[o]={type:"http",url:s.url};return{servers:n,names:new Set(Object.keys(n))}}a(Coi,"buildInjectedMcpServers");function boi(t,e){if(Object.keys(e).length===0)return;let r=t.service.origin;if(r)return[{serverUrl:`${r}/*`}]}a(boi,"buildAllowedMcpServers");function Soi(t,e,r){let n=r.toolUseID,s={intention:r.title??`${t} tool call`,...n!==void 0&&{toolCallId:n}},c=a(l=>typeof l=="string"?l:void 0,"str");switch(t){case"Bash":return{...s,kind:"shell",fullCommandText:c(e.command)??""};case"Write":case"Edit":case"MultiEdit":case"NotebookEdit":return{...s,kind:"write",fileName:c(r.blockedPath)??c(e.file_path)??c(e.notebook_path)??""};case"Read":return{...s,kind:"read",path:c(r.blockedPath)??c(e.file_path)??""};case"WebFetch":return{...s,kind:"url",url:c(e.url)??""};default:{let l=Zdt(t);return l?{...s,kind:"mcp",serverName:l.serverName,toolName:l.toolName,args:e}:{...s,kind:"custom-tool",toolName:t,args:e}}}}a(Soi,"buildPermissionRequest");function Toi(t,e){return t.kind==="approve-once"?{behavior:"allow",updatedInput:e}:{behavior:"deny",message:Fea(t)}}a(Toi,"translatePermissionResult");function Fea(t){switch(t.kind){case"denied-by-rules":return"Permission denied by approval rules";case"denied-no-approval-rule-and-could-not-request-from-user":return"Permission denied: no approval rule and user prompt unavailable";case"denied-interactively-by-user":return t.feedback?`Permission denied by user: ${t.feedback}`:"Permission denied by user";case"denied-by-content-exclusion-policy":return`Permission denied by content-exclusion policy: ${t.message}`;default:return`Permission denied: ${t.kind}`}}a(Fea,"formatDenyMessage");function Ioi(t){let e=t;if(!Array.isArray(e.questions))return null;let r=[];for(let n of e.questions){if(typeof n?.question!="string"||n.question.length===0)return null;r.push({questionText:n.question,header:typeof n.header=="string"&&n.header.length>0?n.header:void 0,choices:Array.isArray(n.options)?n.options.map(o=>o?.label).filter(o=>typeof o=="string"):void 0})}return r}a(Ioi,"buildPreparedQuestions");function xoi(t,e){return{question:t.header?`${t.header} +${t.questionText}`:t.questionText,...t.choices!==void 0&&{choices:t.choices},allowFreeform:!0,...e!==void 0&&{toolCallId:e}}}a(xoi,"buildUserInputRequest");p();var woi=require("crypto");var Uea=new pe("ClaudeOTelTracker");function Roi(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a(Roi,"toAttributeString");function Qea(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>{if(typeof r!="object"||r===null)return!1;let n=r;return n.type==="text"&&typeof n.text=="string"}).map(r=>r.text);if(e.length===t.length&&e.length>0)return e.join("")}return Roi(t)}a(Qea,"stringifyToolResult");function qgr(t){return(0,woi.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(qgr,"generateHexId");function Xdt(){return BigInt(Date.now())*1000000n}a(Xdt,"nowNano");var eft=class{constructor(e,r,n){this._ctx=e;this._sessionId=r;this._persistence=n;this._toolSpans=new Map;this._responseText="";this._inputTokens=0;this._outputTokens=0;this._cacheReadTokens=0;this._cacheCreationTokens=0}static{a(this,"ClaudeOTelTracker")}startRequest(e,r){this._rootSpan&&this._endRootSpan(2,"New request started before previous ended");let n=qgr(16),o=qgr(8);this._rootSpan={traceId:n,spanId:o,name:"invoke_agent claude",startNano:Xdt(),attributes:{[Pn.OPERATION_NAME]:uge.INVOKE_AGENT,[Pn.AGENT_NAME]:"claude",[Pn.SYSTEM]:"anthropic",[Pn.CONVERSATION_ID]:this._sessionId,...e?{[Pn.REQUEST_MODEL]:e,[Pn.RESPONSE_MODEL]:e}:{[Pn.RESPONSE_MODEL]:"unknown"},...r?{[Pn.INPUT_MESSAGES]:Z8("user",r)}:{}}},this._inputTokens=0,this._outputTokens=0,this._cacheReadTokens=0,this._cacheCreationTokens=0,this._responseText="",this._toolSpans.clear()}onMessage(e){if(this._rootSpan)switch(e.type){case"assistant":this._onAssistantMessage(e);break;case"user":this._onUserMessage(e);break;case"result":this._onResultMessage(e);break}}endRequest(){this._endRootSpan(1)}endRequestWithError(e){this._endRootSpan(2,e)}_onAssistantMessage(e){if(e.parent_tool_use_id!=null)return;let r=e.message?.content;if(Array.isArray(r))for(let n of r)n.type==="tool_use"?this._startToolSpan(n.id,n.name,n.input):n.type==="text"&&typeof n.text=="string"&&(this._responseText+=n.text)}_onUserMessage(e){let r=e.message?.content;if(Array.isArray(r)){for(let n of r)if(n.type==="tool_result"&&typeof n.tool_use_id=="string"){let o=n.is_error===!0;this._endToolSpan(n.tool_use_id,o,n.content)}}}_onResultMessage(e){if(!this._rootSpan)return;let r=e.usage;r&&(this._inputTokens=r.input_tokens??0,this._outputTokens=r.output_tokens??0,this._cacheReadTokens=r.cache_read_input_tokens??0,this._cacheCreationTokens=r.cache_creation_input_tokens??0),typeof e.num_turns=="number"&&(this._rootSpan.attributes[Pn.TURN_COUNT]=e.num_turns),typeof e.total_cost_usd=="number"&&(this._rootSpan.attributes[Pn.TOTAL_COST_USD]=e.total_cost_usd)}_startToolSpan(e,r,n){if(!this._rootSpan||this._toolSpans.has(e))return;let o={[Pn.OPERATION_NAME]:uge.EXECUTE_TOOL,[Pn.TOOL_NAME]:r,[Pn.TOOL_CALL_ID]:e,[Pn.CONVERSATION_ID]:this._sessionId},s=Roi(n);s!==void 0&&(o[Pn.TOOL_CALL_ARGUMENTS]=s),this._toolSpans.set(e,{traceId:this._rootSpan.traceId,spanId:qgr(8),parentSpanId:this._rootSpan.spanId,name:`execute_tool ${r}`,startNano:Xdt(),attributes:o})}_endToolSpan(e,r,n){let o=this._toolSpans.get(e);if(!o)return;this._toolSpans.delete(e);let s=Qea(n);s!==void 0&&(o.attributes[Pn.TOOL_CALL_RESULT]=s);let c=Xdt(),l=this._buildOtlpSpan(o,c,r?2:1,r?"Tool execution error":void 0);this._flush([l])}_endRootSpan(e,r){let n=this._rootSpan;if(!n)return;this._rootSpan=void 0,this._inputTokens>0&&(n.attributes[Pn.USAGE_INPUT_TOKENS]=this._inputTokens),this._outputTokens>0&&(n.attributes[Pn.USAGE_OUTPUT_TOKENS]=this._outputTokens),this._cacheReadTokens>0&&(n.attributes[Pn.USAGE_CACHE_READ_INPUT_TOKENS]=this._cacheReadTokens),this._cacheCreationTokens>0&&(n.attributes[Pn.USAGE_CACHE_CREATION_INPUT_TOKENS]=this._cacheCreationTokens);let o=Xdt(),s=[];for(let[,l]of this._toolSpans)s.push(this._buildOtlpSpan(l,o,2,"Tool span orphaned at turn end"));this._toolSpans.clear(),this._responseText&&(n.attributes[Pn.OUTPUT_MESSAGES]=Z8("assistant",this._responseText)),this._responseText="";let c=this._buildOtlpSpan(n,o,e,r);this._flush([...s,c])}_buildOtlpSpan(e,r,n,o){let s={traceId:e.traceId,spanId:e.spanId,name:e.name,kind:1,startTimeUnixNano:e.startNano.toString(),endTimeUnixNano:r.toString(),attributes:wR(e.attributes),events:[],status:o?{code:n,message:o}:{code:n}};return e.parentSpanId&&(s.parentSpanId=e.parentSpanId),s}_flush(e){e.length!==0&&this._persistence.appendSpans(e).catch(r=>{Uea.warn(this._ctx,`Failed to persist OTel spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)})}};p();var jgr=require("fs"),Poi=fe(require("path"));var OMe=new pe("ClaudeCode.ReferenceFormatter"),qea={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},koi=5*1024*1024;async function Doi(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=ys(s.uri);if(!c){OMe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=Hea(c);if(l){let u=await jea(c,l,e);u&&r.push(u)}else{let u=s.selection?`:L${s.selection.start.line+1}-L${s.selection.end.line+1}`:"";n.push(`- ${c}${u}`)}break}case"directory":{let c=ys(s.uri);if(!c){OMe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:OMe.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:Gea(n)}),o}a(Doi,"buildReferences");async function jea(t,e,r){try{let n=await jgr.promises.stat(t);if(n.size>koi){OMe.debug(r,`Skipping oversize image reference (${n.size} > ${koi} bytes): ${t}`);return}let o=(await jgr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){OMe.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(jea,"tryReadImageBlock");function Hea(t){return qea[Poi.extname(t).toLowerCase()]}a(Hea,"imageMediaTypeForPath");function Gea(t){return` The user provided the following references: `+t.join(` `)+` IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task. -`}a(jea,"wrapInSystemReminder");p();var Noi=require("crypto");var Hea=new Set(["ExitPlanMode"]);function jgr(t,e={}){let r=e.timestamp??new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[Loi(r,"synthetic",t.error)];switch(t.type){case"system":return Gea(t,r);case"assistant":return Poi($ea(t,r,e.streamingEnabled===!0,e.blockCursor,e.interactionId,e.mapModelId),e.suppressedToolUseIds);case"user":return Poi(e.includeUserText===!0?Wea(t,r):Vea(t,r),e.suppressedToolUseIds);case"result":return Kea(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(jgr,"translate");function Poi(t,e){return e?t.filter(r=>{if(r.type==="tool.execution_start"){let{toolName:n,toolCallId:o}=r.data;if(typeof o=="string"&&n!==void 0&&Hea.has(n))return e.add(o),!1}if(r.type==="tool.execution_complete"){let{toolCallId:n}=r.data;if(typeof n=="string"&&e.has(n))return e.delete(n),!1}return!0}):t}a(Poi,"dropDedicatedChannelToolEvents");function Moi(t,e,r){if(t.parent_tool_use_id!==null)return[];let n=t.event,o=new Date().toISOString();switch(n.type){case"message_start":return[{id:e,timestamp:o,parentId:null,type:"assistant.turn_start",data:{turnId:e,interactionId:r??e}}];case"content_block_delta":{let s=n.delta;switch(s.type){case"text_delta":return[{id:W0(),timestamp:o,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${n.index}`,deltaContent:s.text}}];case"thinking_delta":return[{id:W0(),timestamp:o,parentId:null,type:"assistant.reasoning_delta",ephemeral:!0,data:{reasoningId:`${e}:${n.index}`,deltaContent:s.thinking}}];default:return[]}}case"content_block_start":case"content_block_stop":case"message_delta":case"message_stop":return[];default:return[]}}a(Moi,"translatePartial");function Gea(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:W0(),timestamp:e,parentId:null,type:"session.start",data:{sessionId:n.session_id,version:1,producer:"claude-code-sdk",copilotVersion:"",startTime:e,selectedModel:n.model,context:n.cwd?{cwd:n.cwd}:void 0}}]}return r==="compact_boundary"?[{id:W0(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:W0(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(Gea,"translateSystem");function $ea(t,e,r,n,o,s){let c=t.message?.id??W0(),l=[],u=t.message?.model,d=u;if(typeof u=="string"&&s)try{d=s(u)}catch{d=u}r||l.push({id:c,timestamp:e,parentId:null,type:"assistant.turn_start",data:{turnId:c,interactionId:o??c}});let f=t.message?.content??[],h=n??new Map,m=h.get(c)??0;return f.forEach(g=>{let A=m++;switch(g.type){case"text":{let y=g.text;typeof y=="string"&&y.length>0&&l.push({id:W0(),timestamp:e,parentId:null,type:"assistant.message",data:{messageId:`${c}:${A}`,content:y,model:d}});break}case"thinking":{let y=g.thinking;typeof y=="string"&&y.length>0&&l.push({id:W0(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${c}:${A}`,content:y}});break}case"tool_use":{let y=g;l.push({id:W0(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof y.id=="string"?y.id:W0(),toolName:typeof y.name=="string"?y.name:"unknown",arguments:y.input}});break}default:break}}),h.set(c,m),l}a($ea,"translateAssistant");function Vea(t,e){let r=t.message?.content;if(!Array.isArray(r))return[];let n=[];for(let o of r)o.type==="tool_result"&&n.push(Ooi(o,e));return n}a(Vea,"translateUserLive");function Wea(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=eft(n);return o.length>0&&r.push(Doi(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(Ooi(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=eft(s);c.length>0&&r.push(Doi(e,c))}}}return r}a(Wea,"translateUserHistory");function Ooi(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=Jea(t.content);return{id:W0(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:W0(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(Ooi,"buildToolExecutionComplete");function Doi(t,e){return{id:W0(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(Doi,"buildUserMessage");function zea(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(zea,"stripSystemReminders");var Yea=/^\[Request interrupted by user[^\]]*\]$/;function eft(t){let e=zea(t);return Yea.test(e)?"":e}a(eft,"sanitizeUserText");function Kea(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:W0(),timestamp:e,parentId:null,type:"assistant.usage",ephemeral:!0,data:{model:r??"unknown",inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheWriteTokens:s.cache_creation_input_tokens,cacheReadTokens:s.cache_read_input_tokens,...n!==void 0&&n>0?{copilotUsage:{totalNanoAiu:n}}:{}}}),t.is_error===!0){let l=t.subtype,u=t.errors,d=t.result,f=Array.isArray(u)&&u.find(h=>typeof h=="string"&&h.length>0)||(typeof d=="string"&&d.length>0?d:void 0)||"Claude turn ended with error";o.push(Loi(e,typeof l=="string"?l:"error",f))}return o.push({id:W0(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(Kea,"translateResult");function Loi(t,e,r){return{id:W0(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(Loi,"buildSessionError");function Jea(t){if(t!=null){if(typeof t=="string")return t;if(Array.isArray(t)){let e=[];for(let n of t)if(n&&typeof n=="object"){let o=n.text;typeof o=="string"&&e.push(o)}let r=e.join(` -`);return r.length>0?r:void 0}try{return JSON.stringify(t)}catch{return}}}a(Jea,"flattenToolResultContent");function W0(){return(0,Noi.randomUUID)()}a(W0,"newId");function Boi(t,e){let r=[],n=new Map,o=new Set,s;for(let c of t){let l=Xea(c);if(!l)continue;(l.type==="user"&&Zea(l)||l.type==="assistant"&&s===void 0)&&(s=W0());let u=l.type==="assistant"?s:void 0,d=c.timestamp,f=typeof d=="string"?d:void 0;try{r.push(...jgr(l,{streamingEnabled:!1,includeUserText:!0,blockCursor:n,suppressedToolUseIds:o,timestamp:f,interactionId:u,mapModelId:e}))}catch{}}return r}a(Boi,"translateHistory");function Zea(t){let e=(t.message??{}).content;if(typeof e=="string")return eft(e).length>0;if(!Array.isArray(e))return!1;for(let r of e)if(r.type==="text"&&typeof r.text=="string"&&eft(r.text).length>0)return!0;return!1}a(Zea,"userMessageStartsInteraction");function Xea(t){if(!(!t||typeof t!="object"||!t.message||typeof t.message!="object")&&(t.type==="user"||t.type==="assistant"))return t.type==="user"&&eta(t)?void 0:{type:t.type,message:t.message,parent_tool_use_id:t.parent_tool_use_id,uuid:t.uuid,session_id:t.session_id}}a(Xea,"adaptHistoryMessage");function eta(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a(eta,"isSyntheticReplayUserMessage");p();p();var Foi=require("node:stream"),Uoi=require("node:string_decoder");function LMe(t){let e=new Uoi.StringDecoder("utf8"),r="",n=0,o=a(l=>{if(typeof l!="number"||!Number.isFinite(l)||l<=n)return;let u=l-n;n=l;try{t(u)}catch{}},"consider"),s=a(l=>{if(l.includes("copilot_usage"))try{let u=JSON.parse(l);o(u.copilot_usage?.total_nano_aiu)}catch{}},"inspectPayload"),c=a(l=>{if(!l.startsWith("data:"))return;let u=l.slice(5).trimStart();!u||u==="[DONE]"||s(u)},"inspectLine");return new Foi.Transform({transform(l,u,d){try{r+=e.write(l);let f=r.indexOf(` +`}a(Gea,"wrapInSystemReminder");p();var Ooi=require("crypto");var $ea=new Set(["ExitPlanMode"]);function Hgr(t,e={}){let r=e.timestamp??new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[Foi(r,"synthetic",t.error)];switch(t.type){case"system":return Vea(t,r);case"assistant":return Noi(Wea(t,r,e.streamingEnabled===!0,e.blockCursor,e.interactionId,e.mapModelId),e.suppressedToolUseIds);case"user":return Noi(e.includeUserText===!0?Yea(t,r):zea(t,r),e.suppressedToolUseIds);case"result":return Zea(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(Hgr,"translate");function Noi(t,e){return e?t.filter(r=>{if(r.type==="tool.execution_start"){let{toolName:n,toolCallId:o}=r.data;if(typeof o=="string"&&n!==void 0&&$ea.has(n))return e.add(o),!1}if(r.type==="tool.execution_complete"){let{toolCallId:n}=r.data;if(typeof n=="string"&&e.has(n))return e.delete(n),!1}return!0}):t}a(Noi,"dropDedicatedChannelToolEvents");function Loi(t,e,r){if(t.parent_tool_use_id!==null)return[];let n=t.event,o=new Date().toISOString();switch(n.type){case"message_start":return[{id:e,timestamp:o,parentId:null,type:"assistant.turn_start",data:{turnId:e,interactionId:r??e}}];case"content_block_delta":{let s=n.delta;switch(s.type){case"text_delta":return[{id:W0(),timestamp:o,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${n.index}`,deltaContent:s.text}}];case"thinking_delta":return[{id:W0(),timestamp:o,parentId:null,type:"assistant.reasoning_delta",ephemeral:!0,data:{reasoningId:`${e}:${n.index}`,deltaContent:s.thinking}}];default:return[]}}case"content_block_start":case"content_block_stop":case"message_delta":case"message_stop":return[];default:return[]}}a(Loi,"translatePartial");function Vea(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:W0(),timestamp:e,parentId:null,type:"session.start",data:{sessionId:n.session_id,version:1,producer:"claude-code-sdk",copilotVersion:"",startTime:e,selectedModel:n.model,context:n.cwd?{cwd:n.cwd}:void 0}}]}return r==="compact_boundary"?[{id:W0(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:W0(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(Vea,"translateSystem");function Wea(t,e,r,n,o,s){let c=t.message?.id??W0(),l=[],u=t.message?.model,d=u;if(typeof u=="string"&&s)try{d=s(u)}catch{d=u}r||l.push({id:c,timestamp:e,parentId:null,type:"assistant.turn_start",data:{turnId:c,interactionId:o??c}});let f=t.message?.content??[],h=n??new Map,m=h.get(c)??0;return f.forEach(g=>{let A=m++;switch(g.type){case"text":{let y=g.text;typeof y=="string"&&y.length>0&&l.push({id:W0(),timestamp:e,parentId:null,type:"assistant.message",data:{messageId:`${c}:${A}`,content:y,model:d}});break}case"thinking":{let y=g.thinking;typeof y=="string"&&y.length>0&&l.push({id:W0(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${c}:${A}`,content:y}});break}case"tool_use":{let y=g,_=typeof y.name=="string"?y.name:"unknown",E=Zdt(_);l.push({id:W0(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof y.id=="string"?y.id:W0(),toolName:_,arguments:y.input,...E&&{mcpServerName:E.serverName,mcpToolName:E.toolName}}});break}default:break}}),h.set(c,m),l}a(Wea,"translateAssistant");function zea(t,e){let r=t.message?.content;if(!Array.isArray(r))return[];let n=[];for(let o of r)o.type==="tool_result"&&n.push(Boi(o,e));return n}a(zea,"translateUserLive");function Yea(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=tft(n);return o.length>0&&r.push(Moi(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(Boi(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=tft(s);c.length>0&&r.push(Moi(e,c))}}}return r}a(Yea,"translateUserHistory");function Boi(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=Xea(t.content);return{id:W0(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:W0(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(Boi,"buildToolExecutionComplete");function Moi(t,e){return{id:W0(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(Moi,"buildUserMessage");function Kea(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(Kea,"stripSystemReminders");var Jea=/^\[Request interrupted by user[^\]]*\]$/;function tft(t){let e=Kea(t);return Jea.test(e)?"":e}a(tft,"sanitizeUserText");function Zea(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:W0(),timestamp:e,parentId:null,type:"assistant.usage",ephemeral:!0,data:{model:r??"unknown",inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheWriteTokens:s.cache_creation_input_tokens,cacheReadTokens:s.cache_read_input_tokens,...n!==void 0&&n>0?{copilotUsage:{totalNanoAiu:n}}:{}}}),t.is_error===!0){let l=t.subtype,u=t.errors,d=t.result,f=Array.isArray(u)&&u.find(h=>typeof h=="string"&&h.length>0)||(typeof d=="string"&&d.length>0?d:void 0)||"Claude turn ended with error";o.push(Foi(e,typeof l=="string"?l:"error",f))}return o.push({id:W0(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(Zea,"translateResult");function Foi(t,e,r){return{id:W0(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(Foi,"buildSessionError");function Xea(t){if(t!=null){if(typeof t=="string")return t;if(Array.isArray(t)){let e=[];for(let n of t)if(n&&typeof n=="object"){let o=n.text;typeof o=="string"&&e.push(o)}let r=e.join(` +`);return r.length>0?r:void 0}try{return JSON.stringify(t)}catch{return}}}a(Xea,"flattenToolResultContent");function W0(){return(0,Ooi.randomUUID)()}a(W0,"newId");function Uoi(t,e){let r=[],n=new Map,o=new Set,s;for(let c of t){let l=tta(c);if(!l)continue;(l.type==="user"&&eta(l)||l.type==="assistant"&&s===void 0)&&(s=W0());let u=l.type==="assistant"?s:void 0,d=c.timestamp,f=typeof d=="string"?d:void 0;try{r.push(...Hgr(l,{streamingEnabled:!1,includeUserText:!0,blockCursor:n,suppressedToolUseIds:o,timestamp:f,interactionId:u,mapModelId:e}))}catch{}}return r}a(Uoi,"translateHistory");function eta(t){let e=(t.message??{}).content;if(typeof e=="string")return tft(e).length>0;if(!Array.isArray(e))return!1;for(let r of e)if(r.type==="text"&&typeof r.text=="string"&&tft(r.text).length>0)return!0;return!1}a(eta,"userMessageStartsInteraction");function tta(t){if(!(!t||typeof t!="object"||!t.message||typeof t.message!="object")&&(t.type==="user"||t.type==="assistant"))return t.type==="user"&&rta(t)?void 0:{type:t.type,message:t.message,parent_tool_use_id:t.parent_tool_use_id,uuid:t.uuid,session_id:t.session_id}}a(tta,"adaptHistoryMessage");function rta(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a(rta,"isSyntheticReplayUserMessage");p();p();var Qoi=require("node:stream"),qoi=require("node:string_decoder");function LMe(t){let e=new qoi.StringDecoder("utf8"),r="",n=0,o=a(l=>{if(typeof l!="number"||!Number.isFinite(l)||l<=n)return;let u=l-n;n=l;try{t(u)}catch{}},"consider"),s=a(l=>{if(l.includes("copilot_usage"))try{let u=JSON.parse(l);o(u.copilot_usage?.total_nano_aiu)}catch{}},"inspectPayload"),c=a(l=>{if(!l.startsWith("data:"))return;let u=l.slice(5).trimStart();!u||u==="[DONE]"||s(u)},"inspectLine");return new Qoi.Transform({transform(l,u,d){try{r+=e.write(l);let f=r.indexOf(` `);for(;f!==-1;){let h=r.slice(0,f).replace(/\r$/,"");r=r.slice(f+1),c(h),f=r.indexOf(` -`)}}catch{}d(null,l)},flush(l){try{if(r+=e.end(),!r){l();return}let u=r.replace(/\r$/,"");c(u),n===0&&s(u)}catch{}l()}})}a(LMe,"createCopilotUsageSniffer");var vge=class{constructor(){this._byKey=new Map}static{a(this,"CopilotUsageAccumulator")}add(e,r){if(!Number.isFinite(r)||r<=0)return;let n=this._byKey.get(e)??0;this._byKey.set(e,n+r)}take(e){let r=this._byKey.get(e);return this._byKey.delete(e),r}clear(e){this._byKey.delete(e)}};var wm=class{constructor(){this._modelBySession=new Map;this._permissionModeBySession=new Map;this._reasoningEffortBySession=new Map;this._copilotUsage=new vge}static{a(this,"ClaudeSessionStateService")}setModelForSession(e,r){if(r===void 0){this._modelBySession.delete(e);return}this._modelBySession.set(e,r)}getModelForSession(e){return this._modelBySession.get(e)}setPermissionModeForSession(e,r){if(r===void 0){this._permissionModeBySession.delete(e);return}this._permissionModeBySession.set(e,r)}getPermissionModeForSession(e){return this._permissionModeBySession.get(e)}setReasoningEffortForSession(e,r){if(r===void 0){this._reasoningEffortBySession.delete(e);return}this._reasoningEffortBySession.set(e,r)}getReasoningEffortForSession(e){return this._reasoningEffortBySession.get(e)}addCopilotUsageNanoAiuForSession(e,r){this._copilotUsage.add(e,r)}takeCopilotUsageNanoAiuForSession(e){return this._copilotUsage.take(e)}clear(e){this._modelBySession.delete(e),this._permissionModeBySession.delete(e),this._reasoningEffortBySession.delete(e),this._copilotUsage.clear(e)}};var tft=fe(require("path"));Fo();var _c=new pe("ClaudeCodeAgent.session"),Ec="ClaudeCodeSession",BMe=class{constructor(e,r,n,o){this.ctx=e;this.sdkWrapper=r;this.notificationSender=n;this._plugins=[];this._onPluginSnapshot=new Lc;this.onPluginSnapshot=this._onPluginSnapshot.event;this._terminalErrorEmittedForTurn=!1;this._assistantBlockCursor=new Map;this._suppressedToolUseIds=new Set;this._abortController=new AbortController;this._isResumed=!1;this._isProcessing=!1;this._disposed=!1;this._permissionRegistry=new Ege;this._userInputRegistry=new Ege;this._exitPlanModeRegistry=new Ege;this._injectedServerNames=new Set;this._handleCanUseTool=a((e,r,n)=>this._disposed?Promise.resolve({behavior:"deny",message:`Session ${this.sessionId} disposed`}):e==="AskUserQuestion"?this._handleAskUserQuestion(r,n):e==="ExitPlanMode"?this._handleExitPlanMode(r,n):e==="ToolSearch"?Promise.resolve({behavior:"allow",updatedInput:r}):this._handlePermissionRequest(e,r,n),"_handleCanUseTool");this.sessionId=o.sessionId,this._cwd=o.cwd,this._model=o.model,this._permissionMode=o.permissionMode,this._isResumed=!(o.isNewSession??!0),this._proxyConfig=o.proxyConfig;let s=this.ctx.get(wm);if(s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode),this.ctx.get(Nn).getCapabilities().agentDebugLog){let c=new cI(this.ctx);c.isEnabled()&&(this._otelTracker=new Xdt(this.ctx,this.sessionId,c))}}static{a(this,"ClaudeCodeSession")}get cwd(){return this._cwd}async invoke(e){if(this._disposed){let r=`Session ${this.sessionId} has been disposed`;throw await this._sendSessionUpdate({type:"error",error:r}),new Error(r)}if(this._isProcessing){let r=`Session ${this.sessionId} is busy: a previous invoke is still streaming. Wait for the terminal sessionUpdate before sending another prompt.`;throw await this._sendSessionUpdate({type:"error",error:r}),new Error(r)}this._isProcessing=!0;try{await this._runInvoke(e)}finally{this._isProcessing=!1}}async setModel(e){if(e!==this._model&&(this._model=e,this.ctx.get(wm).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){_c.warn(this.ctx,`${Ec}: setModel on active query failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async supportedAgents(){if(!this._query)return[];try{return await this._query.supportedAgents()}catch(e){return _c.warn(this.ctx,`${Ec}: supportedAgents query failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),[]}}supportedPlugins(){return this._plugins}_capturePlugins(e){if(e.type!=="system"||e.subtype!=="init")return;let r=e.plugins;r!==void 0&&!Array.isArray(r)&&_c.warn(this.ctx,`${Ec}: ignored malformed plugin snapshot`,{sessionId:this.sessionId});let n=Array.isArray(r)?r:[];this._setPlugins([...n]),this._onPluginSnapshot.fire(this._plugins)}_setPlugins(e){this._plugins=e}_notifyAgentListChanged(){try{this.ctx.get(_g).notify("agent").catch(e=>{_c.warn(this.ctx,`${Ec}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})})}catch(e){_c.warn(this.ctx,`${Ec}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})}}async setPermissionMode(e){if(e===void 0&&this._permissionMode!==void 0){_c.info(this.ctx,`${Ec}: setPermissionMode skipped (undefined preserves existing)`,{sessionId:this.sessionId,existingMode:this._permissionMode});return}let r=e??"default";if(this._permissionMode=r,this.ctx.get(wm).setPermissionModeForSession(this.sessionId,r),this._query)try{await this._query.setPermissionMode(r),_c.info(this.ctx,`${Ec}: setPermissionMode propagated to live Query`,{sessionId:this.sessionId,effectiveMode:r})}catch(n){_c.warn(this.ctx,`${Ec}: setPermissionMode on active query failed`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)})}}async interrupt(){let e=this._query;if(e)try{await e.interrupt()}catch(r){_c.warn(this.ctx,`${Ec}: interrupt() failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}dispose(){if(this._disposed)return;this._disposed=!0,this._setPlugins([]),this._onPluginSnapshot.dispose(),this._dropAllPending("disposed"),this._abortController.abort(),this.ctx.get(wm).clear(this.sessionId);let e=this._promptWaiter;this._promptWaiter=void 0,e?.resolve();let r=this._currentInvokeDone;this._currentInvokeDone=void 0,r?.reject(new Error(`Session ${this.sessionId} disposed`));let n=this._query;n&&n.interrupt().catch(o=>{_c.warn(this.ctx,`${Ec}: interrupt during dispose failed`,{sessionId:this.sessionId,error:o instanceof Error?o.message:String(o)})})}async _runInvoke(e){e.model!==void 0&&e.model!==this._model&&await this.setModel(e.model),e.permissionMode!==void 0&&await this.setPermissionMode(e.permissionMode),this.ctx.get(wm).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(wm).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new UA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1,this._currentTurnInteractionId=Dt();let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{_c.info(this.ctx,`${Ec}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),_c.info(this.ctx,`${Ec}.invoke`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,messageCharLen:e.message.length,referenceCount:e.references?.length??0});let s=await koi(e.references,this.ctx),l={type:"user",message:{role:"user",content:[{type:"text",text:e.message},...s]},parent_tool_use_id:null,session_id:this.sessionId,uuid:e.messageId??Dt()};this._otelTracker?.startRequest(this._model,e.message),this._pendingPromptInput=l;let u=this._promptWaiter;this._promptWaiter=void 0,u?.resolve(),await r.promise}catch(o){throw await this._emitTerminalError(o),o}finally{n?.dispose(),this._currentInvokeDone===r&&(this._currentInvokeDone=void 0)}}async _startQuery(){let e=this._proxyConfig,r=this._isResumed,n=kt(this.ctx,ze.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await _ge.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(_c.warn(this.ctx,`${Ec}: ${o.message}`,{sessionId:this.sessionId}),this.notificationSender.showWarningMessageOnlyOnce("claude.cliVersionMismatch",o.message));let s=kut(this.ctx),c=this._buildInjectedMcpServers(s),l=this._buildAllowedMcpServers(s,c),u={cwd:this._cwd,executable:process.execPath,pathToClaudeCodeExecutable:n,abortController:this._abortController,settings:{env:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${e.port}`,ANTHROPIC_AUTH_TOKEN:`${e.nonce}.${this.sessionId}`,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1",USE_BUILTIN_RIPGREP:"0",PATH:await this._buildPathWithBundledRipgrep(),...this._deriveClaudeOTelEnv()},...l&&{allowedMcpServers:l},...!WF(this.ctx)&&{disableAllHooks:!0}},systemPrompt:{type:"preset",preset:"claude_code"},settingSources:["user","project","local"],...$zt(this.ctx)?{}:{skills:[]},disallowedTools:["WebSearch"],canUseTool:this._handleCanUseTool,...Object.keys(c).length>0&&{mcpServers:c},thinking:{type:"adaptive"},includePartialMessages:!0,allowDangerouslySkipPermissions:!0,...this._model&&{model:this._model},...this._permissionMode&&{permissionMode:this._permissionMode},...r?{resume:this.sessionId}:{sessionId:this.sessionId}},d=await this.sdkWrapper.query({prompt:this._createPromptIterable(),options:u});this._query=d,this._isResumed=!0,this._notifyAgentListChanged(),_c.info(this.ctx,`${Ec}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(d).catch(f=>{_c.error(this.ctx,`${Ec}: consume loop crashed`,{sessionId:this.sessionId,error:f instanceof Error?f.message:String(f)})})}_buildInjectedMcpServers(e){if(!e)return this._injectedServerNames=new Set,{};let{servers:r,names:n}=Soi(e,this._cwd);return this._injectedServerNames=n,r}_buildAllowedMcpServers(e,r){return e?Toi(e,r):void 0}async reloadInjectedMcpServers(e){let r=this._query;if(!r||this._disposed)return;let n=this._buildInjectedMcpServers(e);try{await r.setMcpServers(n),await r.applyFlagSettings({allowedMcpServers:this._buildAllowedMcpServers(e,n)??null}),_c.info(this.ctx,`${Ec}: reloaded injected MCP servers`,{sessionId:this.sessionId,count:Object.keys(n).length})}catch(o){_c.warn(this.ctx,`${Ec}: reloadInjectedMcpServers failed`,{sessionId:this.sessionId,error:o instanceof Error?o.message:String(o)})}}get injectedServerNames(){return this._injectedServerNames}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(e8).resolvePath();return`${tft.dirname(e)}${tft.delimiter}${process.env.PATH??""}`}catch(e){return _c.warn(this.ctx,`${Ec}: bundled ripgrep unavailable, falling back to process PATH`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),process.env.PATH??""}}_deriveClaudeOTelEnv(){let e=Jlt(this.ctx);return sZn(this.ctx,e)}async*_createPromptIterable(){for(;!this._disposed;){if(this._pendingPromptInput){let r=this._pendingPromptInput;this._pendingPromptInput=void 0,yield r;continue}let e=new UA;this._promptWaiter=e,await e.promise}}async _processMessages(e){let r;try{for await(let n of e){if(this._checkSessionIdConsistency(n),this._capturePlugins(n),this._isPartialAssistantMessage(n)){let o=n.event;o.type==="message_start"&&(r=o.message.id),r!==void 0&&await this._sendPartialUpdate(n,r),o.type==="message_stop"&&(r=void 0)}else await this._sendSessionUpdate(n);if(this._isTerminalTurnMessage(n)){n.type==="result"?this._otelTracker?.endRequest():this._otelTracker?.endRequestWithError(n.error??"Turn ended with error"),this._assistantBlockCursor.clear(),this._suppressedToolUseIds.clear(),this._currentTurnInteractionId=void 0;let s=this._currentInvokeDone;this._currentInvokeDone=void 0,s?.resolve()}}this._otelTracker?.endRequestWithError("SDK Query ended unexpectedly"),this._currentInvokeDone&&await this._emitTerminalError(new Error("SDK Query ended unexpectedly")),this._cleanupLiveQuery(e,new Error("SDK Query ended unexpectedly"))}catch(n){_c.error(this.ctx,`${Ec}: query error`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)}),this._otelTracker?.endRequestWithError(n instanceof Error?n.message:String(n)),await this._emitTerminalError(n),this._cleanupLiveQuery(e,n instanceof Error?n:new Error(String(n)))}}_isPartialAssistantMessage(e){return typeof e=="object"&&e!==null&&e.type==="stream_event"}_isTerminalTurnMessage(e){if(typeof e!="object"||e===null)return!1;let r=e.type;return r==="result"||r==="error"}_cleanupLiveQuery(e,r){this._query===e&&(this._query=void 0,this._setPlugins([])),this._dropAllPending("query ended",r.message),this._assistantBlockCursor.clear(),this._suppressedToolUseIds.clear(),this._currentTurnInteractionId=void 0;let n=this._currentInvokeDone;this._currentInvokeDone=void 0,n?.reject(r)}_checkSessionIdConsistency(e){if(typeof e!="object"||e===null)return;let r=e.session_id;typeof r=="string"&&r!==this.sessionId&&_c.error(this.ctx,`${Ec}: SDK reported session_id mismatch`,{expected:this.sessionId,reported:r})}async _sendSessionUpdate(e){try{this._otelTracker?.onMessage(e);let n=e?.type==="result"?this.ctx.get(wm).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=jgr(e,{streamingEnabled:!0,sessionModel:this._model,copilotUsageNanoAiu:n,blockCursor:this._assistantBlockCursor,suppressedToolUseIds:this._suppressedToolUseIds,interactionId:this._currentTurnInteractionId});for(let s of o)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,s,"CLAUDE")}catch(r){_c.error(this.ctx,`${Ec}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=Moi(e,r,this._currentTurnInteractionId);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){_c.error(this.ctx,`${Ec}: failed to send partial agent/sessionUpdate`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)})}}async _emitTerminalError(e){if(this._terminalErrorEmittedForTurn)return;this._terminalErrorEmittedForTurn=!0;let r=e instanceof Error?e.message:String(e);await this._sendSessionUpdate({type:"error",error:r})}respondToInteraction(e){if(e.sessionId!==this.sessionId)return _c.warn(this.ctx,`${Ec}: respondToInteraction sessionId mismatch`,{ownSessionId:this.sessionId,paramSessionId:e.sessionId,requestId:e.requestId}),!1;switch(e.type){case"permission":return this._respondFromRegistry(this._permissionRegistry,e.type,e.requestId,e.result);case"user_input":return this._respondFromRegistry(this._userInputRegistry,e.type,e.requestId,e.response);case"exit_plan_mode":return this._respondFromRegistry(this._exitPlanModeRegistry,e.type,e.requestId,e.response);default:return _c.warn(this.ctx,`${Ec}: unsupported interaction type`,{sessionId:this.sessionId,requestId:e.requestId,interactionType:e.type}),!1}}_respondFromRegistry(e,r,n,o){let s=e.respond(n,o);return s||_c.warn(this.ctx,`${Ec}: respondToInteraction for unknown ${r} requestId`,{sessionId:this.sessionId,requestId:n}),s}_dropAllPending(e,r){let n=r?`: ${r}`:"";this._permissionRegistry.respondAll({kind:"denied-interactively-by-user",feedback:`Session ${this.sessionId} ${e} before permission resolved${n}`}),this._userInputRegistry.rejectAll(new Error(`Session ${this.sessionId} ${e} before user_input resolved${n}`)),this._exitPlanModeRegistry.respondAll({approved:!1,feedback:`Session ${this.sessionId} ${e} before exit_plan_mode resolved${n}`})}_handlePermissionRequest(e,r,n){let o=n.toolUseID??Dt();if(n.signal.aborted)return Promise.resolve({behavior:"deny",message:"Permission request aborted"});let s=Eoi(e,r,n);return this._requestPermissionFromIde(o,e,r,s,n)}async _handleAskUserQuestion(e,r){if(r.signal.aborted)return{behavior:"deny",message:"AskUserQuestion aborted"};let n=Coi(e);if(!n)return{behavior:"deny",message:"AskUserQuestion: invalid input"};try{let o=await Promise.all(n.map(async c=>{let l=Dt(),u=await this._requestUserInputFromIde(l,boi(c,r.toolUseID),r.signal);return{questionText:c.questionText,answer:u.answer}})),s={};for(let{questionText:c,answer:l}of o)s[c]=l;return{behavior:"allow",updatedInput:{...e,answers:s}}}catch(o){return{behavior:"deny",message:o instanceof Error?o.message:`AskUserQuestion failed: ${String(o)}`}}}_handleExitPlanMode(e,r){let n=r.toolUseID??Dt();return r.signal.aborted?Promise.resolve({behavior:"deny",message:"ExitPlanMode request aborted"}):this._requestExitPlanModeFromIde(n,e,r)}async _requestExitPlanModeFromIde(e,r,n){let{promise:o,isSettled:s}=this._exitPlanModeRegistry.register(e),c=a(()=>{this._exitPlanModeRegistry.respond(e,{approved:!1,feedback:"ExitPlanMode request aborted"})},"onAbort"),l=a(()=>n.signal.removeEventListener("abort",c),"cleanupAbort");n.signal.addEventListener("abort",c,{once:!0});let u=typeof r.plan=="string"?r.plan:"",d=this._emitExitPlanModeRequested(e,{planContent:u,summary:u,actions:["exit_only","interactive"],recommendedAction:"interactive",toolCallId:n.toolUseID});d.catch(m=>{s()||(_c.error(this.ctx,`${Ec}: failed to emit exit_plan_mode.requested, denying`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)}),l(),this._exitPlanModeRegistry.respond(e,{approved:!1,feedback:"Failed to deliver exit_plan_mode request to client"}))});let f;try{f=await o}finally{l()}let h=this._translateExitPlanModeResponse(f,r);return _c.info(this.ctx,`${Ec}: exit_plan_mode resolved`,{sessionId:this.sessionId,requestId:e,behavior:h.behavior,selectedAction:f.selectedAction,autoApproveEdits:f.autoApproveEdits}),d.catch(()=>{}).then(()=>this._emitExitPlanModeCompleted(e,f)).catch(m=>{_c.warn(this.ctx,`${Ec}: failed to emit exit_plan_mode.completed`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)})}),h}_translateExitPlanModeResponse(e,r){if(!e.approved){let c=e.feedback?.trim();return{behavior:"deny",message:c?`Plan not approved: ${c}`:"Plan not approved by user"}}if(e.selectedAction==="exit_only")return{behavior:"deny",message:"The user approved the plan but will implement it themselves. Do not make any code changes or take any further action. Stop and wait for the user."};let o=e.autoApproveEdits===!0?"acceptEdits":"default";return this._permissionMode=o,this.ctx.get(wm).setPermissionModeForSession(this.sessionId,o),{behavior:"allow",updatedInput:r,updatedPermissions:[{type:"setMode",mode:o,destination:"session"}]}}async _requestPermissionFromIde(e,r,n,o,s){let{promise:c,isSettled:l}=this._permissionRegistry.register(e),u=a(()=>{this._permissionRegistry.respond(e,{kind:"denied-interactively-by-user",feedback:"Permission request aborted"})},"onAbort"),d=a(()=>s.signal.removeEventListener("abort",u),"cleanupAbort");s.signal.addEventListener("abort",u,{once:!0});let f=this._emitPermissionRequested(e,o);f.catch(A=>{l()||(_c.error(this.ctx,`${Ec}: failed to emit permission.requested, denying`,{sessionId:this.sessionId,requestId:e,toolName:r,error:A instanceof Error?A.message:String(A)}),d(),this._permissionRegistry.respond(e,{kind:"denied-interactively-by-user",feedback:"Failed to deliver permission request to client"}))});let h;try{h=await c}finally{d()}let m=voi(h,n);_c.info(this.ctx,`${Ec}: permission resolved`,{sessionId:this.sessionId,requestId:e,toolName:r,behavior:m.behavior});let g=m.behavior==="allow"?"approved":"denied";return f.catch(()=>{}).then(()=>this._emitPermissionCompleted(e,g,s.toolUseID)).catch(A=>{_c.warn(this.ctx,`${Ec}: failed to emit permission.completed`,{sessionId:this.sessionId,requestId:e,error:A instanceof Error?A.message:String(A)})}),m}async _requestUserInputFromIde(e,r,n){let{promise:o,isSettled:s}=this._userInputRegistry.register(e),c=a(()=>{this._userInputRegistry.rejectOne(e,new Error("AskUserQuestion aborted"))},"onAbort"),l=a(()=>n.removeEventListener("abort",c),"cleanupAbort");n.addEventListener("abort",c,{once:!0});let u=this._emitUserInputRequested(e,r);u.catch(m=>{s()||(_c.error(this.ctx,`${Ec}: failed to emit user_input.requested, rejecting`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)}),l(),this._userInputRegistry.rejectOne(e,m instanceof Error?m:new Error(String(m))))});let d,f;try{d=await o}catch(m){f=m instanceof Error?m:new Error(String(m))}finally{l()}let h=d??{answer:"",wasFreeform:!1};if(u.catch(()=>{}).then(()=>this._emitUserInputCompleted(e,h)).catch(m=>{_c.warn(this.ctx,`${Ec}: failed to emit user_input.completed`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)})}),f!==void 0)throw f;return d}async _emitPermissionRequested(e,r){let n={id:Dt(),timestamp:new Date().toISOString(),parentId:null,type:"permission.requested",data:{requestId:e,permissionRequest:r}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitPermissionCompleted(e,r,n){let o={id:Dt(),timestamp:new Date().toISOString(),parentId:null,type:"permission.completed",data:{requestId:e,result:{kind:r},...n!==void 0?{toolCallId:n}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}async _emitUserInputRequested(e,r){let n={id:Dt(),timestamp:new Date().toISOString(),parentId:null,type:"user_input.requested",data:{requestId:e,question:r.question,...r.choices!==void 0?{choices:r.choices}:{},...r.allowFreeform!==void 0?{allowFreeform:r.allowFreeform}:{},...r.toolCallId!==void 0?{toolCallId:r.toolCallId}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitUserInputCompleted(e,r){let n={id:Dt(),timestamp:new Date().toISOString(),parentId:null,type:"user_input.completed",data:{requestId:e,answer:r.answer,wasFreeform:r.wasFreeform}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitExitPlanModeRequested(e,r){let n={id:Dt(),timestamp:new Date().toISOString(),parentId:null,type:"exit_plan_mode.requested",data:{requestId:e,planContent:r.planContent,summary:r.summary,actions:r.actions,recommendedAction:r.recommendedAction,...r.toolCallId!==void 0?{toolCallId:r.toolCallId}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitExitPlanModeCompleted(e,r){let n={id:Dt(),timestamp:new Date().toISOString(),parentId:null,type:"exit_plan_mode.completed",data:{requestId:e,approved:r.approved,...r.selectedAction!==void 0?{selectedAction:r.selectedAction}:{},...r.autoApproveEdits!==void 0?{autoApproveEdits:r.autoApproveEdits}:{},...r.feedback!==void 0?{feedback:r.feedback}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}};p();var rft=class{constructor(e){this.getSessions=e}static{a(this,"ClaudeMcpSyncTarget")}async syncToActiveSessions(e){await Promise.all(this.getSessions().map(r=>r.reloadInjectedMcpServers(e)))}};p();var joi=fe(require("http")),Ggr=require("node:stream/promises");Fo();var z0=new pe("ClaudeMessagesProxyServer"),tta=["interleaved-thinking","context-management","advanced-tool-use"],Hgr="cls_claude_agent",Y0={InvalidRequest:"invalid_request_error",Authentication:"authentication_error",Permission:"permission_error",NotFound:"not_found_error",RequestTooLarge:"request_too_large",RateLimit:"rate_limit_error",Api:"api_error",Overloaded:"overloaded_error"},rta=new Map([[400,Y0.InvalidRequest],[401,Y0.Authentication],[402,Y0.Permission],[403,Y0.Permission],[404,Y0.NotFound],[413,Y0.RequestTooLarge],[424,Y0.InvalidRequest],[429,Y0.RateLimit],[466,Y0.InvalidRequest],[529,Y0.Overloaded]]),Qoi=1024,nta=32e3,Bee=class{constructor(e){this.ctx=e}static{a(this,"ClaudeMessagesProxyServer")}async start(){if(this._startPromise)return this._startPromise;let e=this._startInternal().catch(r=>{throw this._startPromise===e&&(this._startPromise=void 0),r});return this._startPromise=e,e}async stop(){let e=this._server;e&&(e.closeAllConnections(),await new Promise(r=>e.close(()=>r())),this._server=void 0,this._startPromise=void 0,this._config=void 0)}getConfig(){if(!this._config)throw new Error("ClaudeMessagesProxyServer: start() has not completed yet");return this._config}async _startInternal(){let e=`cls-claude-${Dt()}`,r=joi.createServer((n,o)=>{this._handleRequest(n,o,e)});return new Promise((n,o)=>{r.once("error",o),r.listen(0,"127.0.0.1",()=>{let s=r.address();if(!s||typeof s!="object"){o(new Error("ClaudeMessagesProxyServer: failed to obtain bound address"));return}this._server=r,this._config={port:s.port,nonce:e},z0.info(this.ctx,`proxy listening on http://127.0.0.1:${s.port}`),r.removeListener("error",o),n(this._config)})})}async _handleRequest(e,r,n){try{if(z0.debug(this.ctx,`incoming request: ${e.method} ${e.url}`),e.method==="OPTIONS"){r.writeHead(200),r.end();return}if(e.method==="GET"&&e.url==="/"){r.writeHead(200,{"Content-Type":"text/plain"}),r.end("Hello from ClaudeMessagesProxyServer");return}if(e.method==="POST"&&this._isMessagesPath(e.url)){await this._handleMessagesRequest(e,r,n);return}this._sendErrorResponse(r,404,Y0.NotFound,"Not found")}catch(o){z0.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,Y0.Api,"Internal proxy error")}}_isMessagesPath(e){if(!e)return!1;let r=e.startsWith("//")?e.slice(1):e,n;try{n=new URL(r,"http://127.0.0.1").pathname}catch{return!1}return n==="/v1/messages"||n==="/messages"}async _handleMessagesRequest(e,r,n){let o=ita(e.headers,n);if(!o.valid){z0.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,Y0.Authentication,"Invalid authentication");return}o.sessionId&&z0.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await hta(e),c;try{c=JSON.parse(s)}catch(l){z0.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,Y0.InvalidRequest,"Request body is not valid JSON");return}await this._forwardToCAPI(c,s,e.headers,r,o.sessionId)}async _forwardToCAPI(e,r,n,o,s){let c=this.ctx.get(Qt),l=this.ctx.get(Jt),u;try{u=await c.getToken()}catch(E){z0.exception(this.ctx,E,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,Y0.Authentication,"Failed to acquire Copilot token");return}let d=await this._lookupModelMetadata(e),f=this._maybeStripCacheControl(e,r),h=this._maybeRewriteThinking(e,f,d,s),m=Jle(this.ctx,u,"v1/messages"),g=sta(this.ctx,n,d),A;try{({headers:A}=await Kle(this.ctx,g,u.token))}catch(E){z0.exception(this.ctx,E,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,Y0.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,_=a(()=>{y.signal.aborted||(z0.debug(this.ctx,"client disconnected \u2014 aborting upstream request"),y.abort())},"onClose");o.on("close",_);try{let E=await l.fetch(m,{method:"POST",headers:A,body:h,signal:y.signal});if(Zle(this.ctx,E,"v1/messages"),!E.ok){let w=await E.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";z0.error(this.ctx,`upstream CAPI returned ${E.status} ${E.statusText}: ${R}`),this._sendErrorResponse(o,E.status,mta(E.status),this._buildTranslatedErrorMessage(E,w,u));return}let v=E.headers.get("content-type")??"text/event-stream";o.writeHead(E.status,{"Content-Type":v,"Cache-Control":"no-cache",Connection:"keep-alive"});let S=E.body();if(!S){o.end();return}let T=v.toLowerCase().includes("text/event-stream");if(s&&T){let w=this.ctx.get(wm),R=LMe(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,Ggr.pipeline)(S,R,o)}else await(0,Ggr.pipeline)(S,o)}catch(E){if(y.signal.aborted){z0.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(z0.exception(this.ctx,E,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,Y0.Api,"Upstream request failed")}finally{o.removeListener("close",_)}}async _lookupModelMetadata(e){let r=typeof e.model=="string"?e.model:void 0;if(r)try{return(await this.ctx.get(Ns).getMetadata()).find(s=>s.id===r)}catch(n){z0.debug(this.ctx,`model metadata lookup failed for "${r}": ${n instanceof Error?n.message:String(n)}`);return}}_maybeRewriteThinking(e,r,n,o){if(!n)return $gr(e)?(z0.debug(this.ctx,"stripped output_config.effort for request with unresolved model metadata"),JSON.stringify(e)):r;let s=o?this.ctx.get(wm).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&z0.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return lta(e,n,s)?(z0.debug(this.ctx,`normalized thinking field for model ${n.id} to ${n.capabilities?.supports?.adaptive_thinking?"adaptive":"legacy"} shape`),JSON.stringify(e)):r}_maybeStripCacheControl(e,r){return cta(e)?(z0.debug(this.ctx,"stripped unknown sub-fields from cache_control.ephemeral before forwarding to CAPI"),JSON.stringify(e)):r}_buildTranslatedErrorMessage(e,r,n){let o=e.status,s=this._buildReasonForStatus(e,r,n),c=o===429?{capiErrorCode:gta(r),copilotPlan:n.userInfo?.copilotPlan,suggestSwitchToAuto:!1}:void 0;return cv.translateErrorMessage(o,s,void 0,UM(e),void 0,c)}_buildReasonForStatus(e,r,n){let o=e.status;if(o===402)try{let s=this.ctx.get(Ru).overageEnabled;return cv.translate402Reason(r,{retryAfterHeader:e.headers.get("retry-after")??void 0,retryAfterSeconds:UM(e),copilotPlan:n.userInfo?.copilotPlan,isTBBEnabled:n.userInfo?.isTBBEnabled,canUpgradePlan:n.userInfo?.canUpgradePlan,overageEnabled:s})}catch(s){return z0.exception(this.ctx,s,"._buildReasonForStatus/402"),qoi(r)??"Quota Exceeded."}if(o===400){let s=cv.translate400Reason(r);if(s!==void 0)return s}return qoi(r)}_sendErrorResponse(e,r,n,o){let s={type:"error",error:{type:n,message:o}};e.writeHead(r,{"Content-Type":"application/json"}),e.end(JSON.stringify(s))}};function ita(t,e){let r=t.authorization;if(typeof r!="string"||!r.startsWith("Bearer "))return{valid:!1,sessionId:void 0};let n=r.slice(7),o=n.indexOf(".");if(o===-1)return{valid:n===e,sessionId:void 0};let s=n.slice(0,o),c=n.slice(o+1).trim();return s===e?{valid:!0,sessionId:c.length>0?c:void 0}:{valid:!1,sessionId:void 0}}a(ita,"extractSessionId");function ota(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&tta.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(ota,"filterSupportedBetas");function sta(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...om(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?ota(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=ata(u,d?KKe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Hgr}/${h}`:`${Hgr}${h.substring(m)}`}else s["User-Agent"]=Hgr;return s}a(sta,"buildUpstreamHeaders");function ata(t,e){let r=new Set;for(let n of[t,e])if(n)for(let o of n.split(",")){let s=o.trim();s&&r.add(s)}return r.size>0?[...r].join(","):void 0}a(ata,"mergeBetas");function cta(t){let e=!1,r=a(c=>!!c&&typeof c=="object","isObject"),n=a(c=>{if(!r(c))return;let l=c.cache_control;if(r(l)&&l.type==="ephemeral")for(let u of Object.keys(l))u!=="type"&&(delete l[u],e=!0)},"stripBlock"),o=a(c=>{if(Array.isArray(c))for(let l of c)n(l)},"stripBlocks");o(t.system);let s=t.messages;if(Array.isArray(s))for(let c of s){if(!r(c))continue;let l=c.content;if(Array.isArray(l))for(let u of l)n(u),r(u)&&o(u.content)}return o(t.tools),e}a(cta,"sanitizeCacheControl");function lta(t,e,r){if(!e)return!1;let n=t.thinking,o=n&&typeof n=="object"?n.type:void 0;return o==="adaptive"||o==="enabled"?e.capabilities?.supports?.adaptive_thinking?uta(t,n,e,r):pta(t,n):dta(t,e)}a(lta,"normalizeThinkingForModel");function uta(t,e,r,n){let o=r.capabilities?.supports?.reasoning_effort,s=!!o&&o.length>0,c=e.type==="adaptive"&&Object.keys(e).length===1,l=t.output_config;if(!s){let h=!!l&&typeof l=="object"&&"effort"in l;return c&&!h?!1:(t.thinking={type:"adaptive"},$gr(t),!0)}let u=fta(n,o),d=YO(o,u)??"medium",f=typeof l?.effort=="string"&&l.effort===d;return c&&f?!1:(t.thinking={type:"adaptive"},t.output_config={...l??{},effort:d},!0)}a(uta,"_writeAdaptiveShape");function $gr(t){let e=t.output_config;if(!e||typeof e!="object")return!1;let r=e;return"effort"in r?(delete r.effort,Object.keys(r).length===0&&delete t.output_config,!0):!1}a($gr,"_deleteEffortKey");function dta(t,e){let r=e.capabilities?.supports?.reasoning_effort;return!!r&&r.length>0?!1:$gr(t)}a(dta,"_stripUnsupportedThinkingEffort");function fta(t,e){if(t&&!(!e||!e.includes(t)))return t}a(fta,"_normaliseUserEffortForCapi");function pta(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:Qoi,o=Math.min(nta,Math.max(Qoi,n)),s=e.type==="enabled"&&e.budget_tokens===o,c=t.output_config!==void 0;return s&&!c?!1:(t.thinking={type:"enabled",budget_tokens:o},c&&delete t.output_config,!0)}a(pta,"_writeLegacyShape");function hta(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{n.push(typeof o=="string"?Buffer.from(o,"utf8"):o)}),t.on("end",()=>e(Buffer.concat(n).toString("utf8"))),t.on("error",r)})}a(hta,"readRequestBody");function mta(t){return rta.get(t)??Y0.Api}a(mta,"mapStatusToAnthropicErrorType");function qoi(t){if(t)try{let e=JSON.parse(t),r=e.error;if(r&&typeof r=="object"&&"message"in r){let n=r.message;if(typeof n=="string")return n}if(typeof e.message=="string")return e.message}catch{}}a(qoi,"extractErrorMessage");function gta(t){if(t)try{let e=JSON.parse(t),r=e.error;if(r&&typeof r=="object"&&"code"in r){let n=r.code;if(typeof n=="string")return n}if(typeof e.code=="string")return e.code}catch{}}a(gta,"extractErrorCode");p();function Hoi(t){return t.replace(/[-.]/g,"").toLowerCase()}a(Hoi,"normalizeModelId");function Goi(t,e){if(!t||e.some(s=>s.id===t))return t;let r=t.replace(/-\d{8}$/,""),n=Hoi(r);return e.find(s=>Hoi(s.id)===n)?.id??t}a(Goi,"mapCapiModelIdToPickerId");Fo();var K0=new pe("ClaudeCodeAgent"),J0="ClaudeCodeAgentService";function Ata(t){return{id:`claude-code:/agents/${encodeURIComponent(t.name)}`,name:t.name,description:t.description,providers:["CLAUDE"],invokePolicy:Fqt,isReadonly:!0,isBuiltIn:!0}}a(Ata,"toRuntimeClaudeAgent");var t6=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this._onRuntimePluginsChanged=new Lc;this.sessionPluginSubscriptions=new Map;this.workspacePluginSnapshots=new Map;this.notificationSender=e.get(ss);try{this.runtimeSourceRegistration=e.get(Yd).registerRuntimeAgentSource({provider:"CLAUDE",getAgents:a(async o=>(await this.getSupportedAgentsForWorkspace(o)).map(Ata),"getAgents")})}catch(o){if(!(o instanceof Ic&&o.ctor===Yd))throw o}try{this.runtimePluginSourceRegistration=e.get(Ca).registerRuntimePluginSource({provider:"CLAUDE",onDidChange:this._onRuntimePluginsChanged.event,listPlugins:a(o=>Promise.resolve(this.getSupportedPluginsForWorkspace(o)),"listPlugins")})}catch(o){if(!(o instanceof Ic&&o.ctor===Ca))throw o}let n=new rft(()=>[...this._sessions.values()]);this._mcpSync=new hge(this.ctx,"ClaudeCode.McpSync",n)}static{a(this,"ClaudeCodeAgentService")}async getSupportedAgentsForWorkspace(e){let r=new Set(e.map(c=>lF(un(c.uri)))),n=[...this._sessions.values()].filter(c=>r.has(lF(c.cwd)));if(n.length===0)return[];let o=await Promise.all(n.map(c=>c.supportedAgents())),s=new Map;for(let c of o)for(let l of c){let u=l.name.toLowerCase();s.has(u)||s.set(u,l)}return[...s.values()]}getSupportedPluginsForWorkspace(e){return e.flatMap(r=>this.workspacePluginSnapshots.get(lF(un(r.uri)))??[])}registerSession(e){this.sessionPluginSubscriptions.get(e.sessionId)?.dispose(),this._sessions.set(e.sessionId,e),this.sessionPluginSubscriptions.set(e.sessionId,e.onPluginSnapshot(r=>{this.workspacePluginSnapshots.set(lF(e.cwd),r),this._onRuntimePluginsChanged.fire()}))}removeSession(e){let r=this._sessions.get(e);if(r)return this.sessionPluginSubscriptions.get(e)?.dispose(),this.sessionPluginSubscriptions.delete(e),this._sessions.delete(e),r}async createSession(e){return Ch(this.ctx,"claudeCodeAgent.createSession",async r=>{await aoi(this.ctx,e);let n=e.sessionId??Dt(),o=this._sessions.get(n);if(o)return K0.info(this.ctx,`${J0}.createSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="idempotentHit",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:o.cwd};let s=un(e.workspaceFolder.uri),c=await this._ensureProxyConfig(),l=new BMe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,isNewSession:!0,proxyConfig:c});return this.registerSession(l),K0.info(this.ctx,`${J0}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return Ch(this.ctx,"claudeCodeAgent.resumeSession",async r=>{await coi(this.ctx,e);let{sessionId:n}=e,o,s,c=this._sessions.get(n);if(c)K0.info(this.ctx,`${J0}.resumeSession: returning existing in-memory session`,{sessionId:n}),o=c.cwd,s="memory";else{let u=await this.sdkWrapper.getSessionInfo(n);if(!u?.cwd)throw new Error(`Session not found: ${n}`);let d=u.cwd,f=await this._ensureProxyConfig(),h=new BMe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:d,model:e.model,isNewSession:!1,proxyConfig:f});this.registerSession(h),K0.info(this.ctx,`${J0}.resumeSession: resumed from SDK transcript`,{sessionId:n,cwd:d}),o=d,s="disk"}let l;try{let u=this.sdkWrapper.getSessionMessages(n,{includeSystemMessages:!0}),d=this.ctx.get(Ns).getMetadata().catch(m=>(K0.debug(this.ctx,`${J0}.resumeSession: model metadata unavailable for id mapping`,{sessionId:n,error:m instanceof Error?m.message:String(m)}),[])),[f,h]=await Promise.all([u,d]);l=Boi(f,m=>Goi(m,h)),r.properties.transcriptOk="true"}catch(u){K0.warn(this.ctx,`${J0}.resumeSession: failed to translate on-disk transcript`,{sessionId:n,error:u instanceof Error?u.message:String(u)}),r.properties.transcriptOk="false",r.properties.transcriptErrorName=u instanceof Error?u.name:"Unknown"}return r.properties.reason=s,r.properties.modelId=e.model??"",r.measurements.eventCount=l?.length??0,{sessionId:n,workspacePath:o,events:l}})}async sendMessage(e,r){return Ch(this.ctx,"claudeCodeAgent.sendMessage",async n=>{await loi(this.ctx,e);let o=e.sessionId,s=this._sessions.get(o);if(!s)throw new Error(`Session not found: ${o} \u2014 call createSession or resumeSession before sendMessage`);let c={uri:Ko(s.cwd)};await this.ctx.get(P0).applyPromptTemplateToRequest(e,[c]);let l=Dt(),u=performance.now();return s.invoke({message:e.message,references:e.references,model:e.model,permissionMode:e.agentMode,reasoningEffort:e.reasoningEffort,messageId:l,token:r}).catch(d=>{K0.warn(this.ctx,`${J0}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),zp(this.ctx,"claudeCodeAgent.sendMessage.failure",d,{success:"false",reason:"invoke"},{totalTimeMs:performance.now()-u})}),n.properties.reason="dispatched",n.properties.modelId=e.model??"",n.properties.hasReferences=String((e.references?.length??0)>0),n.measurements.messageCharLen=e.message.length,n.measurements.referenceCount=e.references?.length??0,{messageId:l}})}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}forkSession(e){return Promise.reject(this.unsupported("forkSession"))}async listSessions(e){return Ch(this.ctx,"claudeCodeAgent.listSessions",async r=>{foi(this.ctx,e),K0.info(this.ctx,`${J0}.listSessions`,e);let o=(await this.sdkWrapper.listSessions({dir:e.cwd})).map(s=>({sessionId:s.sessionId,summary:s.summary,startTime:new Date(s.createdAt??s.lastModified).toISOString(),modifiedTime:new Date(s.lastModified).toISOString(),isRemote:!1,context:s.cwd!==void 0?{cwd:s.cwd,branch:s.gitBranch}:void 0}));return K0.info(this.ctx,`${J0}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return Ch(this.ctx,"claudeCodeAgent.listModels",async r=>{poi(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),K0.info(this.ctx,`${J0}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(Ns).getMetadata(e)).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>vWe(c.capabilities.family)).map(ope);return K0.info(this.ctx,`${J0}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await Ch(this.ctx,"claudeCodeAgent.stopSession",async r=>{uoi(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){K0.info(this.ctx,`${J0}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return Ch(this.ctx,"claudeCodeAgent.destroySession",r=>{doi(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this.removeSession(n),K0.info(this.ctx,`${J0}.destroySession`,{sessionId:n}),{success:!0}):(K0.info(this.ctx,`${J0}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return K0.error(this.ctx,`${J0}.destroySession: failed`,{sessionId:n,error:o instanceof Error?o.message:String(o)}),r.error=o,r.properties.reason="exception",{success:!1}}})}async setModel(e,r){await Ch(this.ctx,"claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){K0.info(this.ctx,`${J0}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await MMe(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await Ch(this.ctx,"claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){K0.info(this.ctx,`${J0}.setPermissionMode: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await o.setPermissionMode(r),n.properties.permissionMode=r??""})}get sessionCount(){return this._sessions.size}unsupported(e){return new Error(`${e} is not supported by ClaudeCodeAgentService`)}handleInteraction(e){let r=this._sessions.get(e.sessionId);if(!r)return K0.warn(this.ctx,`${J0}.handleInteraction: unknown session`,{sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type}),Promise.resolve({success:!1});let n=r.respondToInteraction(e);return Promise.resolve({success:n})}getPlanPath(){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(){throw this.unsupported("getRemoteStatus")}compactHistory(){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(){return Promise.reject(this.unsupported("stopCompactHistory"))}dispose(){this.runtimeSourceRegistration?.dispose(),this.runtimeSourceRegistration=void 0,this.runtimePluginSourceRegistration?.dispose(),this.runtimePluginSourceRegistration=void 0;for(let e of this.sessionPluginSubscriptions.values())e.dispose();this.sessionPluginSubscriptions.clear(),this._mcpSync.dispose();for(let e of this._sessions.values())e.dispose();this._sessions.clear(),this.workspacePluginSnapshots.clear(),this._onRuntimePluginsChanged.dispose()}async _ensureProxyConfig(){return this.ctx.get(Bee).start()}};p();var Vgr=new Sn;function $oi(t){return[...t].sort((e,r)=>{let n=Vgr.get(e.uri)??0;return(Vgr.get(r.uri)??0)-n})}a($oi,"sortByAccessTimes");var Voi=a(t=>t.get($r).onDidFocusTextDocument(e=>{e.document&&Vgr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var Woi=fe(require("events"));var nft="CompletionRequested",M4=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new Woi.default;notifyRequest(e,r,n,o,s){return this.#e.emit(nft,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=n0(this.ctx,e,`event.${nft}`);return this.#e.on(nft,r),jn.Disposable.create(()=>this.#e.off(nft,r))}};p();p();var Wgr=class{constructor(){this.observers=new Set}static{a(this,"Subject")}subscribe(e){return this.observers.add(e),()=>this.observers.delete(e)}next(e){for(let r of this.observers)r.next(e)}error(e){for(let r of this.observers)r.error?.(e)}complete(){for(let e of this.observers)e.complete?.()}},ift=class extends Wgr{static{a(this,"ReplaySubject")}subscribe(e){let r=super.subscribe(e);return this._value!==void 0&&e.next(this._value),r}next(e){this._value=e,super.next(e)}};var Zb=class{constructor(e){this.ctx=e;this.#e=new pe("AsyncCompletionManager");this.requests=new Sn(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(zgr(e,r,o))return!0;return!1}updateCompletion(e,r){let n=this.requests.get(e);n!==void 0&&(n.partialCompletionText=r,n.subject.next(n))}queueCompletionRequest(e,r,n,o,s){this.#e.debug(this.ctx,`[${e}] Queueing async completion request:`,r.substring(r.lastIndexOf(` -`)+1));let c=new ift;return this.requests.set(e,{state:2,cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c}),s.then(l=>{if(this.requests.delete(e),l.type!=="success"){this.#e.debug(this.ctx,`[${e}] Request failed with`,l.reason),c.error(l.reason);return}let u={cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c,choice:l.value[0],result:l,state:0,allChoicesPromise:l.value[1]};this.requests.set(e,u),c.next(u),c.complete()}).catch(l=>{this.#e.error(this.ctx,`[${e}] Request errored with`,l),this.requests.delete(e),c.error(l)})}getFirstMatchingRequestWithTimeout(e,r,n,o,s){let c=this.ctx.get(tr).asyncCompletionsTimeout(s);return c<0?(this.#e.debug(this.ctx,`[${e}] Waiting for completions without timeout`),this.getFirstMatchingRequest(e,r,n,o)):(this.#e.debug(this.ctx,`[${e}] Waiting for completions with timeout of ${c}ms`),Promise.race([this.getFirstMatchingRequest(e,r,n,o),new Promise(l=>setTimeout(()=>l(null),c))]).then(l=>{if(l===null){this.#e.debug(this.ctx,`[${e}] Timed out waiting for completion`);return}return l}))}async getFirstMatchingRequest(e,r,n,o){o||(this.mostRecentRequestId=e);let s=!1,c=new UA,l=new Map,u=a(f=>()=>{let h=l.get(f);h!==void 0&&(h(),l.delete(f),!s&&l.size===0&&(s=!0,this.#e.debug(this.ctx,`[${e}] No matching completions found`),c.resolve(void 0)))},"finishRequest"),d=a(f=>{if(zgr(r,n,f)){if(f.state===0){let h=r.substring(f.prefix.length),{completionText:m}=f.choice;if(!m.startsWith(h)||m.length<=h.length){u(f.headerRequestId)();return}m=m.substring(h.length),f.choice.telemetryData.measurements.foundOffset=h.length,this.#e.debug(this.ctx,`[${e}] Found completion at offset ${h.length}: ${JSON.stringify(m)}`),c.resolve([{...f.choice,completionText:m},f.allChoicesPromise]),s=!0}}else this.cancelRequest(e,f),u(f.headerRequestId)()},"next");for(let[f,h]of this.requests)zgr(r,n,h)?l.set(f,h.subject.subscribe({next:d,error:u(f),complete:u(f)})):this.cancelRequest(e,h);return c.promise.finally(()=>{for(let f of l.values())f()})}cancelRequest(e,r){e===this.mostRecentRequestId&&r.state!==0&&(this.#e.debug(this.ctx,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};function zgr(t,e,r){if(r.prompt.suffix!==e.suffix||!t.startsWith(r.prefix))return!1;let n=t.substring(r.prefix.length);return r.state===0?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(zgr,"isCandidate");p();p();var UMe=class{constructor(e){this.maxSize=e;this.root=new FMe;this.leafNodes=new Set}static{a(this,"LRURadixTrie")}set(e,r){let{node:n,remainingKey:o}=this.findClosestNode(e);if(o.length>0){for(let[s,c]of n.children)if(s.startsWith(o)){let l=s.slice(0,o.length),u=new FMe;n.removeChild(s),n.addChild(l,u),u.addChild(s.slice(l.length),c),n=u,o=o.slice(l.length);break}if(o.length>0){let s=new FMe;n.addChild(o,s),n=s}}n.value=r,this.leafNodes.add(n),this.leafNodes.size>this.maxSize&&this.evictLeastRecentlyUsed()}findAll(e){return this.findClosestNode(e).stack.map(({node:r,remainingKey:n})=>r.value!==void 0?{remainingKey:n,value:r.value}:void 0).filter(r=>r!==void 0)}delete(e){let{node:r,remainingKey:n}=this.findClosestNode(e);n.length>0||this.deleteNode(r)}findClosestNode(e){let r=!0,n=this.root,o=[{node:n,remainingKey:e}];for(;e.length>0&&r;){r=!1;for(let[s,c]of n.children)if(e.startsWith(s)){e=e.slice(s.length),o.unshift({node:c,remainingKey:e}),n=c,r=!0;break}}return{node:n,remainingKey:e,stack:o}}deleteNode(e){if(e.value=void 0,this.leafNodes.delete(e),e.parent===void 0||e.childCount>1)return;let{node:r,edge:n}=e.parent;if(e.childCount===1){let[s,c]=Array.from(e.children)[0];e.removeChild(s),r.removeChild(n),r.addChild(n+s,c);return}if(r.removeChild(n),r.parent===void 0)return;let o=r.parent;if(r.value===void 0&&r.childCount===1){let[s,c]=Array.from(r.children)[0],l=o.edge+s;r.removeChild(s),o.node.removeChild(o.edge),o.node.addChild(l,c)}}evictLeastRecentlyUsed(){let e=this.findLeastRecentlyUsed();e&&this.deleteNode(e)}findLeastRecentlyUsed(){let e;for(let r of this.leafNodes)(e===void 0||r.touchedo.content.filter(s=>s.suffix===r&&s.choice.completionText.startsWith(n)&&s.choice.completionText.length>n.length).map(s=>({...s.choice,completionText:s.choice.completionText.slice(n.length),telemetryData:s.choice.telemetryData.extendedBy({},{foundOffset:n.length})})))}append(e,r,n){let o=this.cache.findAll(e);if(o.length>0&&o[0].remainingKey===""){let s=o[0].value.content;this.cache.set(e,{content:[...s,{suffix:r,choice:n}]})}else this.cache.set(e,{content:[{suffix:r,choice:n}]})}clear(){this.cache=new UMe(100)}};p();var Xb=class{constructor(){this.choices=[]}static{a(this,"CurrentGhostText")}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==2&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&zoi(this.choices[0].completionText,n))return yta(this.choices,n)}hasAcceptedCurrentCompletion(e,r){let n=this.getRemainingPrefix(e,r);if(n===void 0)return!1;let o=n===this.choices?.[0].completionText,s=this.choices?.[0].finishReason;return o&&s==="stop"}getRemainingPrefix(e,r){if(!(this.prefix===void 0||this.suffix===void 0||this.choices.length===0)&&this.suffix===r&&e.startsWith(this.prefix))return e.substring(this.prefix.length)}};function yta(t,e){return t.filter(r=>zoi(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(yta,"adjustChoicesStart");function zoi(t,e){return t.startsWith(e)&&t.length>e.length}a(zoi,"startsWithAndExceeds");p();p();var r6={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95};p();function Yoi(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let _;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?_=.003325460510319164:_=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?_=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?_=.0697359767152808:t[230]>1e-35?_=.06513506845651572:_=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?_=.013616385013146277:_=.04171540100223404:_=-.04360396575094823:t[212]>1e-35?_=.025945477945627522:_=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?_=-.07856453318384411:_=-.014803893522351739:t[39]>1e-35?_=-.09185452630751932:t[149]>1e-35?_=-.07122426086157027:t[134]>1e-35?_=-.04231052091434186:t[227]>1e-35?_=-.029815824273994197:t[50]>1e-35?_=-.15736496271211153:t[222]>1e-35?_=-.02360285356956629:t[128]>1e-35?_=-.03922080193836443:t[136]>1e-35?_=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?_=-.0029736170756835783:_=-.06482902102259112:t[84]>1e-35?_=-.11340924635708383:t[94]>1e-35?_=-.03635703457792193:t[118]>1e-35?_=-.058181913914186034:t[126]>1e-35?_=-.062030576241517366:t[116]>1e-35?_=-.045086301850604006:t[25]>1e-35?_=-.031665223656767286:t[203]>1e-35?_=-.009444685731407691:_=.0112265153772187;let E;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?E=.022717227245241684:E=-.049700413274686266:E=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?E=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?E=-.12263724050601095:E=.0070743478891288035:t[288]>1e-35?E=-.050439138582109:E=.0255701593657891:E=-.005812703740580558:t[6]>49.50000000000001?E=-.008542694147899113:E=.035147383686665:E=-.0960461939274094:t[32]>1e-35?E=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?E=-.01800870272656664:E=-.07817304234604389:t[30]>1e-35?E=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?E=.08778416018479411:E=-.026563982720830256:E=-.05296139548112329:t[50]>1e-35?E=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?E=-.036572140520852024:t[183]>1e-35?E=-.10766853736801459:E=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?E=.09513215942486053:E=-.03641865277445567:t[10]>59.50000000000001?E=.03177172388687933:t[39]>1e-35?E=-.10234241303898953:t[243]>1e-35?E=-.02966738115984321:t[190]>1e-35?E=-.04312785336449181:t[118]>1e-35?E=-.05808521194081524:E=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let S;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?S=-.0024117174588695603:S=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?S=.04575380761203418:S=-.10025595041353463:t[15]>1e-35?S=.17705790384964004:S=.0073813837628615014:S=.07676373681392407:S=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?S=.07078572910026419:t[4]>23.500000000000004?S=.005513918674164821:S=.0206586476926392:t[0]>5269.500000000001?S=.07706773525822633:S=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?S=-.03204783603215824:S=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?S=-.0930246911392012:S=.011173087289703683:t[3]>24.500000000000004?S=.03281421918878597:S=.12449335091369843:t[204]>1e-35?S=.06634531187326123:S=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?S=-.041196758517013515:t[4]>7.500000000000001?S=-2942718111029724e-20:t[4]>6.500000000000001?S=.11953909558532852:S=.03188615019450534:t[122]>1e-35?S=-.0616037324662157:t[101]>1e-35?S=.027230889593349412:t[8]>4968.500000000001?S=-.1113986516540856:t[3]>2.5000000000000004?S=-.002045140426885727:t[129]>1e-35?S=.12641163374304432:S=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let k;t[306]>1e-35?t[149]>1e-35?k=-.1389218965136736:k=-.032218642644416894:t[13]>1e-35?k=.006465035217331847:t[50]>1e-35?k=-.1381687930130022:t[179]>1e-35?k=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?k=-.03262719498763048:k=.023342916702125613:t[191]>1e-35?k=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?k=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?k=-.09989343595668776:k=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?k=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?k=-.09165257825246746:t[9]>32.50000000000001?k=.02484870392366004:k=-.008499493096971395:t[8]>24.500000000000004?k=.02459679192828244:k=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?k=.0015644546318714849:k=-.06579524865022705:k=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?k=.03331853632960164:k=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?k=-.019091477207111116:k=.037878468575478504:t[94]>1e-35?k=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?k=.16919658785098224:t[243]>1e-35?k=-.06580584936754524:k=.01567555159935563:t[129]>1e-35?k=.06721746994993226:t[10]>32.50000000000001?k=-.046394462507797975:k=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let O;t[308]>1e-35?O=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?O=.023223358334607133:O=-.04383410185346742:O=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?O=.023406489302867494:O=-.085521220804058:O=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?O=.028120059780969632:O=-.04211009474298743:t[294]>1e-35?O=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?O=-.0993035220737934:O=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?O=.029770210551187937:O=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?O=.06421359317599738:O=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?O=.024368404612215164:O=-.04045232374803373:t[131]>1e-35?O=.017372701982485795:t[120]>1e-35?O=.08812710275150198:t[18]>1e-35?t[90]>1e-35?O=.18451364351180236:t[7]>33.50000000000001?O=-.03850813130183531:t[195]>1e-35?O=.06966114053446336:t[3]>16.500000000000004?O=-.0012869181693341211:t[0]>4242.500000000001?O=-.054625548611291035:O=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?O=.006302103427145562:O=.13967622319898698:t[121]>1e-35?O=-.038798585213145644:t[5]>4544.500000000001?O=-.08050498033009466:O=-.002986974112681435;let B;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?B=-.03461119351456781:B=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?B=-.12404435523286539:B=-.0034376913880382956:B=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?B=.0037507103585310234:B=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?B=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?B=-.04832024079663151:t[37]>1e-35?B=-.037103393468366934:B=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?B=.032539071163832034:t[5]>1643.5000000000002?B=.036408625378035665:t[0]>1500.5000000000002?B=-.1346358322854993:B=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?B=-.1133991164577881:t[9]>52.50000000000001?B=-.024478640359723122:B=.03673777861098756:B=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?B=.002583438691776944:B=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?B=-.02141222346712401:B=.06392462314316179:t[4]>12.500000000000002?B=.08700122294434816:t[8]>267.50000000000006?B=.056923170082743224:B=-.07716309825583327:t[32]>1e-35?B=-.03961343943752142:B=.002674914122888783:t[1]>42.50000000000001?B=-.05217539654421676:t[145]>1e-35?B=.09553630282946368:B=-.009424791262477729;let q;t[183]>1e-35?q=-.05753337139158443:t[308]>1e-35?q=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?q=-.10477869875380448:q=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?q=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?q=-.04442302951713574:q=.00012409888451734224:q=-.092199119633697:t[225]>1e-35?q=.13773072450201831:t[0]>2882.5000000000005?q=.0028540012229920533:t[298]>1e-35?q=.07134486044361629:q=.014297412329837425:t[145]>1e-35?q=.05608385321902638:t[92]>1e-35?q=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?q=-.0039957800609801315:q=.0776927564241081:t[203]>1e-35?q=-.05502900859432093:t[105]>1e-35?q=.06062892720841595:q=-.009574839629252128:t[31]>1e-35?q=.009488858841144216:t[23]>1e-35?t[20]>1e-35?q=.08818126313644752:t[8]>161.50000000000003?q=.014353968957885408:q=-.022240738532827903:t[210]>1e-35?q=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?q=-.043902062079383485:q=-.014741559220396223:q=-.00934935734853194:t[6]>32.50000000000001?q=.1514593126307404:q=.010771222510801532:t[10]>22.500000000000004?q=.01412495209334078:q=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let L;t[294]>1e-35?L=-.042529778074638265:t[266]>1e-35?L=-.1180276669679798:t[134]>1e-35?L=-.026818144353279623:t[183]>1e-35?L=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?L=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?L=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?L=-.03049646619610203:t[1]>50.50000000000001?L=.20634590755061122:L=.06956378103625731:t[0]>3770.5000000000005?L=-.07946414366134913:t[19]>1e-35?L=.17083312065604694:t[2]>21.500000000000004?L=-.02327981978127724:L=.129717297518715:t[145]>1e-35?L=.006891245076133524:L=-.0789123467863741:t[3]>99.50000000000001?L=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?L=.06447639919732716:L=-.05457561977645972:t[306]>1e-35?L=-.029995903305383882:t[191]>1e-35?L=.030596508110850414:t[242]>1e-35?L=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?L=.09518584795377832:L=-.018197744600833596:t[13]>1e-35?L=.006751790086127549:t[148]>1e-35?L=.01904174573618417:t[99]>1e-35?L=.025287735102561926:t[4]>14.500000000000002?L=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?L=-.09467943982430241:t[243]>1e-35?L=-.02521824751996268:L=.005437570718352172:L=-.022476214821960674;let U;t[0]>384.50000000000006?t[84]>1e-35?U=-.06088131453064195:t[147]>1e-35?U=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?U=.04219361472548491:U=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?U=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?U=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?U=-.11431764534511478:U=.013549717238356157:U=-.020987333767091276:t[6]>2.5000000000000004?U=-.02914877855133127:U=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?U=-.10087072787978416:t[37]>1e-35?U=-.030467397753331196:t[229]>1e-35?U=-.1017559811057469:t[4]>20.500000000000004?U=-.00413177742240167:t[20]>1e-35?U=.05213315982685969:U=.0037921635866823133:t[8]>51.50000000000001?U=.07327913092421544:t[6]>49.50000000000001?U=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?U=.02744420891894289:U=.11288946357194463:U=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?U=-.012329314369909049:U=.026816658655600168:U=-.0872405354618811:U=.007872673500247845:t[1]>42.50000000000001?U=-.04309044198258254:t[145]>1e-35?U=.07572529147860785:t[7]>5.500000000000001?U=-.013837187093264945:t[1]>17.500000000000004?U=.04208698439539668:U=-.06284346769019863;let j;t[294]>1e-35?j=-.0384794324818203:t[266]>1e-35?j=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?j=.07432960094940501:j=-.035248735855751855:t[134]>1e-35?j=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?j=-.01706896375068821:j=.08212247914968074:t[2]>59.50000000000001?j=-.09546478958824225:t[6]>53.50000000000001?j=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?j=.02816463285971267:j=.15449139016588445:j=-.10199787406123524:j=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?j=-.13924786681478077:j=-.0072772442570213335:t[39]>1e-35?j=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?j=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?j=-.11174465335620831:j=.00013144040097180107:j=-.08493919336681105:t[42]>1e-35?j=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?j=-.015540659878839153:j=-.14442609417300142:t[21]>1e-35?j=-.025251979447574083:j=.0023698372645272847:t[18]>1e-35?j=.07269739695712212:t[8]>2592.5000000000005?j=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?j=-.01835130329646532:t[9]>45.50000000000001?j=.02023047454629885:j=.16469378262221102:j=-.042975030085836426;let Q;t[8]>2915.5000000000005?t[297]>1e-35?Q=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?Q=-.01034964686484714:Q=-.07357437440667927:Q=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?Q=-.09476398869062203:t[9]>72.50000000000001?Q=-.0757383854264379:Q=.02806542779508718:Q=-.05147742568418084:Q=.10212721564444344:Q=.0518263760642861:Q=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?Q=-.10669213185972036:Q=.027050434286384796:t[302]>1e-35?Q=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?Q=.06354599160071946:t[1]>67.50000000000001?Q=.05317447949011187:Q=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?Q=-.09369289448773599:t[0]>2215.5000000000005?Q=.04077965380363924:t[0]>807.5000000000001?Q=-.0591771776458298:Q=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?Q=-.016323380219241672:Q=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?Q=.03720704290087811:Q=-.008730548158766654:t[4]>80.50000000000001?Q=-.05346644687473197:Q=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?Q=.019984510398089086:Q=-.03917825025861855:t[9]>170.50000000000003?Q=-.09759719821334525:Q=-.0023586682752856298;let Y;t[183]>1e-35?t[17]>1e-35?Y=.030100940443356424:t[10]>1.5000000000000002?Y=-.10861112216742408:Y=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?Y=-.032062878390325456:Y=-.10808232631806887:t[8]>1641.5000000000002?Y=-.06147013392655731:t[4]>12.500000000000002?Y=.03324767551088266:t[145]>1e-35?Y=.028851633810612017:Y=-.054871239091792784:t[134]>1e-35?Y=-.023813968121342108:t[266]>1e-35?Y=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?Y=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?Y=-.025350325484720576:Y=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?Y=.056817276537534815:Y=-.07674158463557636:Y=-.06335553143454145:t[1]>56.50000000000001?Y=.16390494217299284:Y=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?Y=.041717597065890205:Y=-.10357913492269129:t[10]>29.500000000000004?Y=.1365512866715726:Y=.020600048310575665:Y=.09708785634773187:Y=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?Y=-.03146213719547347:Y=.11784024316238083:Y=-.050940520532045355:Y=-.047988344143075616:t[191]>1e-35?Y=.028764654731460032:Y=.0011911575567860023;let W;t[294]>1e-35?t[10]>50.50000000000001?W=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?W=-.05103908560370243:W=.05002066201169583:W=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?W=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?W=.127983140816313:W=-.05436534163636867:W=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?W=-.009504203657088933:t[8]>819.5000000000001?W=.18689664822602375:W=.03635576744011826:W=-.029862411809998525:t[223]>1e-35?W=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?W=-.09405026597863717:t[0]>4153.500000000001?W=.053577663326799765:W=-.05062127873995668:W=.06512222894425874:t[39]>1e-35?W=-.04985311717827547:t[51]>1e-35?W=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?W=-.02860634573675884:W=.08863753005590103:W=.11158892111063744:t[0]>655.5000000000001?W=-.031005736641654926:W=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?W=-.00843386136334982:W=-.05273594615999777:W=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?W=-.015774115523598486:W=.10147367091236065:W=-.048307000563071016:W=.002118376117677254;let V;t[8]>1014.5000000000001?t[9]>137.50000000000003?V=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?V=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?V=.07211107542565391:V=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?V=-.0751486415451188:t[1]>59.50000000000001?V=.13459005084554104:V=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?V=.06715575425741895:V=-.005895690393702183:t[8]>2915.5000000000005?V=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?V=-.00029068886245881074:V=.0613467393188786:t[148]>1e-35?V=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?V=.003887223773199377:V=-.08553893131979015:V=.025654192706396767:V=-.05651733979610658:V=-.02039913645229667:t[2]>7.500000000000001?V=-.1058450646728524:V=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?V=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?V=.1283258201586378:V=-.01718135372229775:V=-.07702452408491414:t[125]>1e-35?V=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?V=.04273051857848212:V=-.04533122948101463:t[2]>196.50000000000003?V=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?V=.0231032972703664:V=-.04807386814498683:V=.002729435991332102;let z;t[179]>1e-35?z=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?z=.026484626664041125:t[10]>1.5000000000000002?z=-.10187000872941615:z=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?z=.09574540795390041:z=-.06454986703691233:z=-.11411849349353141:t[266]>1e-35?z=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?z=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?z=-.04403391373512386:z=.1132928075412222:t[2]>47.50000000000001?z=-.09700191391838056:z=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?z=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?z=-.001668912999010927:z=-.02363511102970245:t[8]>58.50000000000001?z=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?z=.0911011436534449:t[1]>28.500000000000004?z=-.07192390493729035:z=.06913818091291246:z=-.012312625373699222:z=.06784496312307986:z=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?z=.0026564453057705273:z=-.025425772389361445:t[122]>1e-35?z=-.12046786388602149:t[0]>3183.5000000000005?z=.01162092842804907:t[91]>1e-35?z=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?z=-.0001647792543020228:z=-.023664538532907665:z=.01609078206180752;let ie;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ie=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ie=-.017696526862422682:ie=.1450050954613223:ie=-.05406930069823832:ie=-.08308700260259043:t[120]>1e-35?ie=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ie=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ie=.038431826961746934:ie=-.05937462906539856:t[9]>65.50000000000001?ie=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ie=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ie=-.09579030954062734:ie=.025064711572811746:ie=.02579440518821548:ie=.1044440128091862:ie=-.058348633139536844:ie=.07766788227934436:ie=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ie=.07463684068207214:ie=.18244269035484484:t[6]>39.50000000000001?ie=-.06050050067471004:ie=.05787759066913493:ie=.010783225857972171:ie=.1674891243602606:t[4]>9.500000000000002?ie=-.004814132027475892:ie=-.14543299413454813:ie=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ie=-.07634466313617769:ie=.0287825335169114:ie=-.06894721943300268:ie=-.00023988459059521937;let H;t[131]>1e-35?t[1]>93.50000000000001?H=-.05706887458825395:t[2]>1.5000000000000002?H=.011446637886629108:H=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?H=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?H=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?H=.026278724448495064:H=.17053138400480508:t[0]>4463.500000000001?H=-.06482289890096041:H=.03026516489536295:H=-.031785170717683144:H=.1312690622980455:t[13]>1e-35?H=.14336922540461444:H=.03523850945454039:H=-.015407465968975714:t[39]>1e-35?H=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?H=-.0659975068798723:H=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?H=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?H=.057409156184759516:H=.2024322059866388:H=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?H=.010648654146284154:t[308]>1e-35?H=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?H=.12364025998551711:H=-.02247495081065243:t[1]>22.500000000000004?H=-.0726295464624251:H=.03481895086048152:t[0]>4331.500000000001?H=-.04775443357020673:H=.07172377425057568:t[2]>89.50000000000001?H=-.11782645274716962:H=.00010092665257989378;let re;t[147]>1e-35?re=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?re=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?re=-.016101990375700172:t[0]>2579.5000000000005?re=-.13045089661551845:re=-.02874367814784938:re=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?re=.17084176915326055:re=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?re=.10591712319944074:re=-.024082167264285:re=.16497698867036126:re=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?re=-.021012910475524206:re=-.13058422554298485:t[0]>1102.5000000000002?re=.10955864175201457:re=-.03566689354348996:t[1]>11.500000000000002?re=-.02093884208606101:re=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?re=-.013861861436128482:re=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?re=.10163873449625677:re=-.02779270277623805:t[1]>26.500000000000004?re=-.08035058228527389:re=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?re=-.007028075523033826:re=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?re=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?re=-.0032075580718124892:re=-.04442829143298883:re=-.06597073245775804:re=.0015594090939337751;let le;t[223]>1e-35?t[8]>668.5000000000001?le=-.12803889879260094:le=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?le=.08967966612917375:t[1]>39.50000000000001?le=-.059791671514498074:le=.05648934961902822:t[2]>59.50000000000001?le=-.08633234097449628:t[6]>53.50000000000001?le=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?le=.025606129643140924:le=.13835395886271978:le=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?le=-.09975506556937946:t[10]>36.50000000000001?le=-.09427724661655643:t[10]>24.500000000000004?le=.07329330653410447:le=-.02271182965807972:le=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?le=-.05082091374050816:le=.1687114435254966:t[0]>2314.5000000000005?le=-.06422664016383926:le=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?le=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?le=-.1274167728754332:le=.01308079126447365:t[4]>73.50000000000001?le=.13854015371106546:t[4]>48.50000000000001?le=-.03684255740123261:t[6]>45.50000000000001?le=.10329912215813097:t[10]>77.50000000000001?le=-.08630788656925215:le=.031022006843800853:t[1]>25.500000000000004?le=-.08278381528048026:le=.06664374548141594:t[84]>1e-35?le=-.05624227409079396:le=.00012184182357340415;let Le;t[179]>1e-35?Le=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Le=-.07595415373151816:Le=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Le=.022822510448266862:Le=.17491569312933697:Le=-.058362287133533565:t[2]>2.5000000000000004?Le=-.03633895806364428:Le=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Le=-.07294848747514579:Le=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Le=-.07009535282685533:t[8]>2640.0000000000005?Le=-.051761240111316276:t[131]>1e-35?Le=-.06245774419231631:Le=.03495606662854905:Le=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Le=.0015036626973581122:Le=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Le=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Le=.022343994371919224:Le=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Le=.07724450228328664:t[0]>3853.5000000000005?Le=-.15671707454435677:t[10]>28.500000000000004?Le=-.10179090671841723:Le=.014878216919760927:Le=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Le=.14054154485273487:Le=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Le=-.08632985141410315:Le=.005524157938954954:Le=-.08802502622523681:Le=-.0004649168897260341;let me;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?me=-.007458687464321174:me=-.09444966249102484:t[1]>23.500000000000004?me=.08564129697360716:me=-.07105002902845851:me=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?me=-.10326216566705966:t[1]>26.500000000000004?me=.0050539832484585365:me=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?me=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?me=.05783632021087773:t[10]>17.500000000000004?me=-.06720598671764105:t[1]>47.50000000000001?me=.097495825172558:me=-.013372242800584872:me=-.06463226787713715:t[42]>1e-35?me=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?me=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?me=.11051270080118503:me=.027719462817590454:t[8]>597.5000000000001?me=-.08441503592016869:me=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?me=-.12190088985091102:me=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?me=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?me=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?me=.016585157185448045:me=-.11032043771149425:me=.01586986028570486:t[8]>388.50000000000006?me=-.10592413013261853:me=.04930703248769364:t[13]>1e-35?me=.003621937787920821:me=-.0013786331198611841;let Oe;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Oe=.009769895322846493:Oe=-.10620052926943656:t[9]>19.500000000000004?Oe=.03781202525403449:t[9]>14.500000000000002?Oe=-.11485785321365344:t[9]>6.500000000000001?Oe=.07677177833073881:t[0]>4342.500000000001?Oe=-.07079285609687631:t[49]>1e-35?Oe=.06156814809246001:Oe=-.014788509042554625:Oe=-.032659201618470655:t[5]>5207.500000000001?Oe=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Oe=-.03094160322187924:t[1]>29.500000000000004?Oe=.09474646043921069:Oe=.023445783928231618:Oe=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Oe=-.07164443768784848:t[1]>29.500000000000004?Oe=.089473622509272:t[8]>597.5000000000001?Oe=-.08155349903101317:Oe=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Oe=-.004003900679358653:t[190]>1e-35?Oe=-.09236113461485262:t[8]>3198.5000000000005?Oe=-.0124130160451179:Oe=.018453070064009328:t[15]>1e-35?Oe=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Oe=-.0009580759587680961:Oe=-.03227283036698222:Oe=.01369287669536875:t[1]>50.50000000000001?Oe=-.04213060332500437:t[35]>1e-35?Oe=-.11508095777767471:t[190]>1e-35?Oe=-.08611884672400155:t[297]>1e-35?Oe=.05723551879433584:Oe=-.004829340082311461;let Te;t[183]>1e-35?Te=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Te=-.11753465135886734:Te=-.007515490299047085:Te=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Te=-.12371142493530439:t[1]>36.50000000000001?Te=.032189417575190435:Te=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Te=-.0784518658439288:t[2]>54.50000000000001?Te=.12477882322370665:Te=.000313468482399738:Te=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Te=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Te=.0353146070135579:Te=-.06327619611098285:Te=.02813577701641991:Te=-.12354390728506215:t[34]>1e-35?Te=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Te=-.01245803535276381:Te=-.07169472553475001:t[1]>11.500000000000002?Te=.12989984824561698:Te=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Te=.010390226893521422:t[10]>14.500000000000002?Te=.16790888126487719:Te=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Te=-.043398307129729134:Te=.09963544907820426:t[9]>30.500000000000004?Te=-.13540713124984502:t[9]>17.500000000000004?Te=.0509435850590757:Te=-.04761897852404613:t[4]>78.50000000000001?Te=.09197086656470652:Te=.0006771050176682337;let te;t[122]>1e-35?t[6]>36.50000000000001?te=.05686884451670743:te=-.05334759543084309:t[266]>1e-35?te=-.08603579519816038:t[157]>1e-35?te=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?te=-.0499592651503952:t[0]>725.5000000000001?te=.11780353905132664:te=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?te=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?te=-.03190157229022304:te=.07985197845805492:te=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?te=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?te=-.027174047777029083:te=.057117284879796476:t[3]>43.50000000000001?te=-.0016147040913107311:te=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?te=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?te=-.01466076988151239:te=.13375695925484857:te=-.04885873081899647:t[0]>5566.500000000001?te=.11086813028591343:t[8]>992.5000000000001?te=-.07622304217072383:te=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?te=.03285858361708423:te=-.12354858211764992:te=.0672788301823281:t[15]>1e-35?te=.08658836986585006:te=-.02741484278509758:t[290]>1e-35?te=-.08161310335133287:t[135]>1e-35?te=-.04824156054814152:te=.0009156904299554183;let ee;t[3]>7.500000000000001?ee=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ee=.03642374718166293:ee=.16379973756366603:ee=-.03946685266127979:t[186]>1e-35?ee=.07618896623420895:t[96]>1e-35?ee=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?ee=-.022822371600847505:ee=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?ee=.044416424920571296:ee=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?ee=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?ee=.1061937286809567:t[7]>54.50000000000001?ee=.11487507743121311:t[8]>819.5000000000001?ee=-.07181278009001418:t[10]>25.500000000000004?ee=.13499019430369633:t[1]>31.500000000000004?ee=.09032979489780704:ee=-.12754166393372374:t[9]>37.50000000000001?ee=-.05093963635361407:ee=-.005026651151683848:t[9]>2.5000000000000004?ee=.07619735785573735:ee=.012363301341532136:t[26]>1e-35?ee=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?ee=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?ee=-.10764172927882483:ee=.01890760098464703:ee=.06573095405846417:t[8]>634.5000000000001?ee=-.00783575973273707:ee=-.050612689680229306:t[1]>22.500000000000004?ee=-.0016842490401359626:ee=.0738227088444087:ee=-.02663970950432175;let K;t[31]>1e-35?t[8]>17.500000000000004?K=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?K=.007191286124908192:K=-.09347881647636902:t[10]>1.5000000000000002?K=.07938758708008091:K=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?K=.12321804057595996:K=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?K=-.04644244754790671:K=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?K=.0706108609273337:t[2]>40.50000000000001?K=-.028046629962303716:K=-.06497613993109329:K=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?K=-.03056331974267756:K=-.11886389712497057:K=.053364962175658184:t[8]>2233.5000000000005?K=-.0448152521157682:K=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?K=.03818796510453344:K=.23673992112982362:K=.02858814226507374:t[10]>44.50000000000001?K=-.1125863771551199:K=.009129996952394916:t[1]>7.500000000000001?K=-.004374525302461639:K=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?K=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?K=-.13677189943034931:t[10]>2.5000000000000004?K=.039591891437078086:K=-.09312596849507347:K=-.02423172142089822:K=.0009836986075266283;let he;t[189]>1e-35?t[0]>5269.500000000001?he=-.103183298350443:t[2]>51.50000000000001?he=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?he=-.05186168947388339:he=.0496996365539082:t[10]>23.500000000000004?he=.1404445738719:t[93]>1e-35?he=.0027146310074558505:t[5]>3821.5000000000005?he=.002153033152069652:t[4]>2.5000000000000004?he=.007663539551317215:he=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?he=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?he=-.021479467709980358:he=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?he=.021660293256233334:he=-.0927396152303864:he=.0665074081601698:t[0]>1550.5000000000002?he=.08972407105958534:he=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?he=.06761927942466854:he=-.015762168112653286:t[17]>1e-35?he=.10311304131145381:he=-.017672785252336027:he=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?he=-.10638321435298535:he=.0007073011744385905:t[18]>1e-35?he=-.027056185501334325:t[145]>1e-35?he=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?he=.09762140519655171:t[9]>110.50000000000001?he=-.06581942957595835:t[6]>54.50000000000001?he=.04959634035251596:he=.0022616298654554207:he=-.007437620924990854;let X;t[179]>1e-35?X=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?X=.1470294450403005:X=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?X=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?X=.07965955447707423:t[10]>10.500000000000002?X=-.09236156404262426:X=.03396273196231458:X=-.13246465021467432:X=.07092822261735353:X=-.08753829085942:X=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?X=.004705878789890202:X=.13775378964952867:X=-.04770928980587811:t[10]>29.500000000000004?X=.011221519891071544:t[0]>3853.5000000000005?X=.06365381191628273:X=.15506252245336827:t[1]>37.50000000000001?X=-.07254777021042061:X=.026514587757252385:t[308]>1e-35?X=.04115804816617256:t[10]>26.500000000000004?X=.02077721353011946:t[5]>3548.5000000000005?X=-.1280907116663952:X=-.021974774274438:t[306]>1e-35?X=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?X=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?X=-.005710865560475598:t[94]>1e-35?X=-.06751507982853555:X=.027250040757588703:t[9]>52.50000000000001?X=.07060357924595577:X=-.030297760713011795:X=-.0006005400085266517;let de;t[113]>1e-35?de=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?de=-.06996356565314456:de=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?de=-.08317707559926495:t[21]>1e-35?de=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?de=-.010538203005984922:de=.08454819465349446:t[9]>124.50000000000001?de=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?de=-.08542251249346582:t[9]>50.50000000000001?de=-.023428882537657472:de=.010042500833979073:de=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?de=.03006025206979096:t[9]>108.50000000000001?de=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?de=.04222035773042132:de=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?de=-.07209095448054853:de=.028065954981903313:de=.08714651929917122:de=-.006678820669279169:t[10]>40.50000000000001?de=.006982396294941626:de=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?de=-.09351114982645548:t[4]>3.5000000000000004?de=-.004837550129223451:de=-.08324141237464677:t[303]>1e-35?de=.10703037493990825:t[9]>156.50000000000003?de=-.10803018621648303:t[116]>1e-35?de=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?de=.10261721665006701:de=.018994509090668264:de=.0011244262442038839;let Be;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?Be=-.08404263465005328:t[0]>3682.5000000000005?Be=.041259223920298876:t[1]>29.500000000000004?Be=-.09541257493441671:Be=.001482192721625409:Be=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?Be=-.08268996098437432:t[230]>1e-35?Be=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?Be=-913218977737457e-19:t[4]>10.500000000000002?Be=-.056334165674005156:t[127]>1e-35?Be=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?Be=-.04231200150318989:t[10]>42.50000000000001?Be=.10182973257894812:Be=.015934763950068445:Be=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?Be=-.041117068322885315:Be=.1167767830037126:Be=.13611206992387337:t[10]>41.50000000000001?Be=-.07120286010564107:Be=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?Be=-.07702290997669524:t[198]>1e-35?Be=.08776558554437136:Be=-.008290740324975692:t[2]>32.50000000000001?Be=.07198457624219955:Be=.005463113714361629:Be=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Be=.03295785445437507:Be=.15140250150674536:Be=-.035613213948910254:t[186]>1e-35?Be=.06849425535860769:t[96]>1e-35?Be=.06028225812727254:Be=-.007582543288662308;let ne;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ne=.08396556264106572:ne=-.0562516995099192:ne=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ne=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ne=.0052017514017035915:ne=-.11194119432743639:ne=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ne=-.025692451287403446:ne=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ne=-.11892250746801664:t[10]>22.500000000000004?ne=.07548493166973796:ne=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ne=.13750699058082427:t[18]>1e-35?ne=.06535408879552801:ne=-.054118179035040674:ne=.1344282838979622:t[0]>3982.5000000000005?ne=-.10409582202467015:t[19]>1e-35?ne=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ne=.012705935670766466:ne=.14149359442527545:ne=-.047977876173706004:t[20]>1e-35?ne=.057945228080337946:t[0]>3642.5000000000005?ne=-.008726535792122467:ne=-.08424769891378858:t[34]>1e-35?ne=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ne=.01196849566739346:ne=.1614642278429876:ne=-.043022338150701625:t[3]>5.500000000000001?ne=-.03907848255033881:ne=.018280601026175593:ne=.0006654540402589085;let ue;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ue=-.01386103677247845:ue=.11386694333005128:t[4]>27.500000000000004?ue=-.021862617610091336:t[2]>31.500000000000004?ue=.0828858469030438:ue=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ue=.11303635767048735:ue=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ue=-.04238798044549342:ue=.022091190130494303:t[5]>5082.500000000001?ue=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ue=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ue=-.04291104140431434:t[17]>1e-35?ue=.11256797532342613:ue=-.017206916368289193:ue=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ue=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ue=.03581712466863222:ue=.14770264307668884:t[8]>73.50000000000001?ue=-.13093289429740068:ue=.042461737442702936:t[52]>1e-35?ue=.0501831919044939:ue=-.010450249720465756:ue=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ue=.0005381332165438493:ue=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ue=.04849637311285226:ue=-.036671377119808564:t[0]>421.50000000000006?ue=.00020968499911058945:ue=.11636422423182405:ue=-.12687837788222575:ue=.0012774367867215346;let Ne;t[120]>1e-35?Ne=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ne=-.042799574885345304:Ne=.07412430171193245:Ne=-.11248270469336048:t[193]>1e-35?Ne=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ne=.028911612178122104:Ne=.12326369727728437:t[0]>4091.5000000000005?Ne=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ne=.1159839898100149:Ne=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ne=-.0216343737351583:Ne=-.1220272260878369:t[2]>18.500000000000004?Ne=.09152924475072398:t[8]>55.50000000000001?Ne=.039508716651005665:Ne=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ne=.06793009902674053:Ne=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ne=-.04391068849624096:Ne=.04009967593394672:t[8]>1085.5000000000002?Ne=-.024773826356034825:Ne=-.13919707884246582:Ne=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ne=-.11567917501901476:Ne=-.006813640337684114:t[3]>7.500000000000001?Ne=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ne=-.001754586408351048:Ne=-.055422422450722056:Ne=-.06090032532532226:t[0]>5269.500000000001?Ne=.11787981735983527:Ne=-.00198119768540783:Ne=.00210412924303036;let xe;t[294]>1e-35?t[10]>50.50000000000001?xe=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?xe=-.06063239096209816:xe=.03317022411417386:xe=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?xe=-.013608609329298802:xe=.09078000157330264:t[99]>1e-35?xe=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?xe=-.07536137260189814:xe=.006253266595455118:t[10]>28.500000000000004?xe=-.006106041147592768:t[9]>156.50000000000003?xe=-.11828932797811101:t[94]>1e-35?xe=-.02566078479505714:t[303]>1e-35?xe=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?xe=-.08401252789168523:t[5]>4244.500000000001?xe=.026372887658499107:t[1]>16.500000000000004?xe=-.027836756345634026:xe=.09205362097909099:xe=.00934612788718244:t[203]>1e-35?xe=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?xe=-.09580979052540028:t[1]>50.50000000000001?xe=-.06402211827281554:xe=.08342858760095972:t[2]>36.50000000000001?xe=.008114897658204584:t[92]>1e-35?xe=.09541587072672864:xe=-.022342147210555434:xe=-.01660492519175128:xe=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?xe=.15846731118501817:xe=.039498507912023195:t[245]>1e-35?xe=.07008718676813333:xe=.0019806389728814727;let Fe;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Fe=-.01192072916082109:Fe=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Fe=.06874032717466054:t[4]>40.50000000000001?Fe=-.07752510020707537:t[1]>76.50000000000001?Fe=-.09944032260703917:t[8]>1381.5000000000002?Fe=-.054466635810800745:t[1]>32.50000000000001?Fe=.05974084520839573:Fe=-.0384718740755954:Fe=-.11374190719134032:t[0]>2151.5000000000005?Fe=-.13703645155803298:Fe=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Fe=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Fe=.013539805885738608:Fe=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Fe=.09941880179344399:Fe=-.01608127391210995:Fe=.08025226531247417:t[9]>67.50000000000001?Fe=.13525448212444113:t[6]>61.50000000000001?Fe=-.05511099182158894:t[94]>1e-35?Fe=-.06821509831783572:t[128]>1e-35?Fe=.11361314817714643:Fe=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Fe=-.09954181329804547:t[197]>1e-35?Fe=.10102833149755386:t[188]>1e-35?Fe=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Fe=-.03781554214742005:Fe=.09927933385592314:Fe=-.020006000056720083:Fe=-.10520473615957895:Fe=-.12006990846253787:Fe=-.00026111570975317574;let tt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[0]>1725.5000000000002?t[7]>14.500000000000002?t[2]>38.50000000000001?tt=-.019188245509744628:tt=-.13354864350075848:t[0]>2461.5000000000005?tt=.051885477468354396:tt=-.0833581968852119:tt=.08233441701532287:tt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?tt=.09926337893072812:tt=-.027753610497327715:t[0]>1972.5000000000002?tt=-.09780045823152517:tt=.032380915168504935:tt=.11502632261226381:t[17]>1e-35?tt=-.06094965899579662:t[10]>40.50000000000001?tt=-.07500475582440802:tt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?tt=-.09584538995220808:tt=-.00908705814304442:tt=.03203281520813893:t[10]>49.50000000000001?tt=-.03146271513986384:t[2]>63.50000000000001?tt=.13172001315536286:t[224]>1e-35?tt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?tt=.09521549382082259:tt=-.04414925613522197:t[0]>1847.5000000000002?tt=-.09118580379557353:tt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?tt=.03525144509943896:tt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?tt=-.04766112322938157:t[2]>10.500000000000002?tt=.0728516504357201:tt=-.05049625965272536:tt=-.10868663055825774:tt=.0005382613419948969;let st;t[147]>1e-35?t[1]>53.50000000000001?st=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?st=-.030504020655417463:st=.07102458639110094:st=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?st=.055304563442710876:t[1]>53.50000000000001?st=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?st=-.1568835288372895:st=-.0279829124400056:st=.04493843959601833:st=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?st=-.054133834303687026:t[9]>48.50000000000001?st=.11263810289007213:t[9]>9.500000000000002?st=-.02202034562838259:t[4]>45.50000000000001?st=-.03410927569045158:st=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?st=-.029687297407295893:st=.10673602850001934:t[4]>42.50000000000001?st=.0036275562945108117:st=-.0760789221330622:st=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?st=.08274426793676076:st=-.07076234425516396:st=.13890177606150175:st=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?st=-.09250637750836187:st=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?st=-.01897867921812603:st=.04890781705365262:st=-.11569892307597907:t[2]>106.50000000000001?st=.09032697440623969:st=.00047935919155035045;let vt;t[115]>1e-35?vt=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?vt=-.10131179514695865:t[8]>938.5000000000001?vt=.10203729808015481:vt=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?vt=.03574015165562999:vt=-.07763042506449493:vt=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?vt=.0665706259130275:vt=-.06586817559309924:vt=.11925564412287476:vt=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?vt=.046017146627455346:vt=-.08623321630086885:t[8]>1765.5000000000002?vt=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?vt=.11143827902215087:vt=-.01817808730473413:vt=.16980985030210127:vt=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?vt=.010168994879727824:vt=-.09099594488792513:t[9]>1.5000000000000002?vt=.0533459678147928:vt=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?vt=-.062346959148773695:t[1]>47.50000000000001?vt=-.0021578343835599316:t[2]>27.500000000000004?vt=.19567373210166172:vt=.07851555379116423:t[18]>1e-35?vt=.03711549097804649:t[8]>359.50000000000006?vt=.012492346746905587:t[4]>20.500000000000004?vt=.047511695735697544:vt=-.07999269063948773:vt=6802045404471004e-20;let Pt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Pt=.0011484728213539738:Pt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Pt=-.09828874964938798:t[8]>1586.5000000000002?Pt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Pt=.011938269926919522:Pt=.17541983715953954:t[19]>1e-35?Pt=.023002786011088672:Pt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Pt=.06508934844183291:Pt=-.10168553534835639:Pt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Pt=.021140806225203937:Pt=-.1167833342453639:t[2]>33.50000000000001?Pt=.13163585734056618:Pt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Pt=.06314479201263888:Pt=-.09639088327091713:t[10]>29.500000000000004?Pt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Pt=40577156464836036e-21:Pt=.12322387121810757:Pt=-.03697224045046014:t[1]>22.500000000000004?Pt=.016474835887320276:Pt=.16919298733903063:Pt=.07633203630214054:Pt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Pt=.14150493354700563:Pt=-.01831155354975749:t[1]>28.500000000000004?Pt=-.07952557178685365:t[10]>28.500000000000004?Pt=.0665695554984927:Pt=-.053640139319277094:Pt=.0004754840665898665;let Ht;t[76]>1e-35?Ht=-.06814884255939921:t[179]>1e-35?Ht=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?Ht=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?Ht=.004193658608848433:Ht=-.1066968975983452:t[8]>302.50000000000006?Ht=.05476730110440451:Ht=-.06382970920394895:t[218]>1e-35?t[2]>3.5000000000000004?t[6]>13.500000000000002?t[2]>19.500000000000004?t[0]>3200.5000000000005?t[4]>91.50000000000001?Ht=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?Ht=.013555772109446666:Ht=-.09856116699770784:Ht=.0284329611813383:t[2]>52.50000000000001?Ht=.04008708444763762:t[9]>29.500000000000004?Ht=-.1289599546008197:Ht=-.018566534248335896:t[8]>747.5000000000001?Ht=.02236484980076122:Ht=.1148871655157582:t[8]>3084.0000000000005?Ht=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?Ht=.03164751204281298:Ht=.11752140436184891:t[9]>42.50000000000001?Ht=-.07180559595410106:t[22]>1e-35?Ht=.09325040416256854:Ht=-.016041122807939914:Ht=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?Ht=-.010718250133458515:Ht=.09818827994853763:Ht=.010180038981174032:Ht=-.039472162599295535:t[9]>170.50000000000003?Ht=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?Ht=-.08674788057474031:Ht=.02077653508548371:Ht=-.0003536561382007414;let F;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?F=.018337297491457794:F=-.05926206443180149:F=.024026520855881126:t[288]>1e-35?t[184]>1e-35?F=.10747078482128616:t[126]>1e-35?F=-.10550625192391357:t[7]>71.50000000000001?F=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?F=.1317396472229434:F=-.025035791351328947:F=-.0728334305864372:t[8]>963.5000000000001?F=.023642201723096064:F=.183010326734258:t[128]>1e-35?F=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?F=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?F=-.1088876900335281:F=.02758317023002635:F=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?F=-.01928020117446408:F=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?F=.07893723375925096:F=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?F=-.10301657587280551:F=.005787463140224318:F=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?F=-.019296977889522397:F=-.07274529751752634:t[1]>30.500000000000004?F=-.050368901143148286:F=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?F=.0015332402792773946:F=.09930153676749967:F=-.06370844564357069:F=.00042272155209927616;let se;t[71]>1e-35?t[4]>17.500000000000004?se=.12586844370423247:se=-.006791999603126354:t[222]>1e-35?t[1]>10.500000000000002?t[30]>1e-35?t[1]>36.50000000000001?t[9]>1.5000000000000002?t[10]>25.500000000000004?se=-.08474891624263797:t[8]>125.50000000000001?se=.08125086980439704:se=-.04082085238068532:t[0]>3863.5000000000005?se=.020481535807469208:se=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?se=-.019110200161573936:se=-.12387719685855114:t[0]>1102.5000000000002?se=.08376595701957407:se=-.031821919580524834:t[9]>4.500000000000001?se=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?se=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?se=.1349841206807871:se=.011864053595560297:t[1]>41.50000000000001?se=-.08203662486612544:t[2]>18.500000000000004?se=-.009541865642346947:se=.08345043168501759:t[2]>10.500000000000002?se=-.09585031818030947:se=.019432330487099865:se=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?se=.11951517733981365:se=-.016651014735738538:t[1]>28.500000000000004?se=-.07410922545030711:t[10]>28.500000000000004?se=.05886430683844788:se=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?se=.04802269879144705:se=-.026208212831796737:t[4]>45.50000000000001?se=-.03227476944664786:se=.05124575625622705:se=.00020506696916003137;let be;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?be=-.03042091758483443:t[10]>14.500000000000002?be=.09816619204768777:be=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?be=-.02381165060401718:be=-.10950361804974783:be=.03538211665111128:t[212]>1e-35?t[19]>1e-35?be=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?be=-.06371052144380579:be=.0835500621252692:be=-.10408255929333915:t[1]>74.50000000000001?be=.13208968122712403:t[1]>64.50000000000001?be=-.04778844603644965:t[8]>51.50000000000001?t[8]>201.50000000000003?t[8]>660.5000000000001?t[6]>4.500000000000001?t[9]>5.500000000000001?t[1]>29.500000000000004?t[0]>3830.5000000000005?be=.09922816902423433:be=.016366955328796718:be=.1592412560903584:t[1]>39.50000000000001?be=.05409467990258923:be=-.08260633210459611:be=-.06307205775247567:t[9]>36.50000000000001?be=.040253940015648144:be=.14202568969471283:be=-.028761848341594044:be=.08994073058773508:t[0]>807.5000000000001?be=-.043427848826323195:be=.04573516446846493:t[20]>1e-35?t[188]>1e-35?be=-.0758877731600639:t[23]>1e-35?be=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?be=.08124700978741987:be=.013296063087086852:t[7]>5.500000000000001?be=-.01640196088612987:be=-.12685498840146067:be=-.0004940792382459551;let Ue;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Ue=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?Ue=.08513773825688947:Ue=-.1184664832315282:Ue=.05676963535893477:Ue=.14263843210340613:Ue=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?Ue=-.10669720555606924:Ue=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?Ue=.0664744575868955:Ue=-.08469256188890871:Ue=-.026746678040592144:t[281]>1e-35?Ue=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Ue=.012131807587207655:Ue=-.12776015795398743:Ue=.04320472481083551:Ue=.08390980661550446:t[10]>227.50000000000003?Ue=-.09771783809101153:t[10]>130.50000000000003?Ue=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?Ue=-.07610698254064358:t[8]>902.5000000000001?Ue=-.03136381213599649:t[131]>1e-35?Ue=.0704821739127936:t[224]>1e-35?Ue=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?Ue=.10431473040024908:t[8]>841.5000000000001?Ue=.07304745320500514:Ue=-.038011541882439825:Ue=-.01679746695007364:t[0]>3129.5000000000005?Ue=.05589952587431965:t[210]>1e-35?Ue=.06227198085800842:Ue=-.0011341890997947812:t[8]>740.5000000000001?Ue=.04817300084412584:Ue=-.000577001010789238;let Qe;t[187]>1e-35?t[6]>12.500000000000002?t[10]>8.500000000000002?t[10]>16.500000000000004?t[8]>234.50000000000003?t[4]>43.50000000000001?t[0]>4476.500000000001?Qe=-.10504730480402079:t[5]>3341.5000000000005?Qe=.11087894671081754:Qe=-.0406668834674614:Qe=.03308382165616109:t[8]>104.50000000000001?Qe=-.10431436764549162:Qe=.0073928337244891455:t[4]>34.50000000000001?Qe=-.10571751512748416:Qe=-.006081128814142983:t[13]>1e-35?Qe=.1299673566095023:t[4]>60.50000000000001?Qe=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Qe=.04857126072645073:Qe=-.03431365358104773:t[4]>16.500000000000004?Qe=.04101865986596709:Qe=.16480274980378218:t[10]>26.500000000000004?Qe=.03673978504199255:t[10]>9.500000000000002?Qe=-.10996402743800027:t[308]>1e-35?Qe=.0553693735082498:Qe=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Qe=.010902983761213922:Qe=.1325118659895645:Qe=-.064362945508595:t[1]>66.50000000000001?Qe=.033416767779331176:Qe=-.054080316225040496:t[42]>1e-35?Qe=-.07762364337810815:t[10]>1089.5000000000002?Qe=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Qe=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Qe=.0220102041325908:Qe=-.06516708740003069:Qe=.012833498905748267:t[224]>1e-35?Qe=-.007038418272997865:Qe=.00037666304316290967;let ge;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ge=.07554189644995735:ge=-.052089349455904946:ge=-.10148206848169845:t[113]>1e-35?ge=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?ge=.07172653627995676:ge=-.07602959317610998:ge=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?ge=-.0399322883690891:ge=.06523495517476098:ge=-.10358715295743802:t[193]>1e-35?ge=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?ge=.015928764772252406:ge=.1341513061552287:ge=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?ge=-.033592997607280156:ge=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?ge=-.08402551858097379:ge=.017401984506038796:t[1]>25.500000000000004?ge=.13337205393591278:ge=-.01160208350090984:ge=.06708317942315471:t[8]>227.50000000000003?ge=-.08486943882418681:ge=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?ge=-.10496268177586783:ge=-.020921489532370493:ge=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?ge=.11639296062157028:ge=-.004275784356569115:t[32]>1e-35?ge=-.07297384970166025:ge=.006026841626381599:ge=.002034611134960428;let Z;t[248]>1e-35?Z=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Z=-.06455513326540585:t[1]>29.500000000000004?Z=.07718474591552532:t[4]>7.500000000000001?Z=.040139336931404826:Z=-.09685734690563386:Z=.00015327283570347363:t[9]>88.50000000000001?Z=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Z=-.04077257804338707:Z=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Z=.03778141591008941:Z=-.06459919920634845:Z=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Z=.14063930759326346:t[0]>179.50000000000003?Z=.07287482250668585:t[8]>1180.5000000000002?Z=-.14419393112726253:t[10]>28.500000000000004?Z=-.07993142770099469:t[17]>1e-35?Z=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Z=.05527969663610186:Z=-.10824385941441346:t[3]>11.500000000000002?Z=.12358502961047915:Z=-.017509147119622873:t[0]>74.50000000000001?Z=-.014907705458730486:t[8]>95.50000000000001?Z=-.02225118168342062:Z=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Z=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Z=.04962819555610421:Z=-.07213577821855309:Z=.09139529824708481:t[19]>1e-35?Z=.013439401088345224:Z=-.049274647207292056:Z=.10531673719686951;let ve;t[40]>1e-35?t[0]>1937.5000000000002?ve=-.06421671152073961:ve=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?ve=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?ve=-.03520420769287065:t[8]>1085.5000000000002?ve=-.019817352506127633:ve=.11444439424520964:ve=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?ve=-.010490117519863269:ve=.08104430117757461:t[121]>1e-35?t[243]>1e-35?ve=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?ve=.06619344145920268:t[0]>4091.5000000000005?ve=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?ve=.10016091391222309:ve=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?ve=-.019511460451434884:ve=-.11643672465055221:t[2]>18.500000000000004?ve=.07848228087333317:t[8]>55.50000000000001?ve=.032583027899956235:ve=-.11209832692153521:t[11]>1e-35?ve=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?ve=-.09996887746328006:t[9]>2.5000000000000004?ve=.02157682011863397:ve=-.05247727848991843:ve=.07409150201483244:t[1]>38.50000000000001?ve=-.11378466075449625:t[224]>1e-35?ve=-.10741749127732923:t[1]>26.500000000000004?ve=.07343136534146562:ve=-.07013573628594773:t[25]>1e-35?ve=-.04626669734164317:ve=.05518333197956482:ve=.00032434010867555516;let Ge;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?Ge=.026313251010808853:Ge=-.08997339150292381:Ge=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?Ge=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?Ge=.0905155504503746:t[8]>1049.5000000000002?Ge=-.062312558183394054:t[8]>719.5000000000001?Ge=.09583836191410239:t[0]>3719.5000000000005?Ge=-.0778097309430818:Ge=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?Ge=-.12920865648544927:t[0]>2699.5000000000005?Ge=-.07086587879041864:Ge=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?Ge=-.11377786322600797:Ge=-.009486325820117998:t[1]>55.50000000000001?Ge=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?Ge=-.07938291201004219:t[2]>36.50000000000001?Ge=.01520046732530246:Ge=.13649854049662832:Ge=-.07145015938528873:t[8]>407.50000000000006?Ge=-.00350257360822279:Ge=.11332047082193297:Ge=-.10060624458629897:Ge=.05429496612497562:t[8]>1446.5000000000002?Ge=.006073419197482838:Ge=-.08718676350883998:Ge=-.11532497988252638:Ge=.10766270463068293:t[34]>1e-35?Ge=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?Ge=-.0004109812623829506:Ge=.021601073497455662:Ge=-7343540098965853e-20;let qe;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?qe=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?qe=.05995640200798119:t[0]>3443.5000000000005?qe=-.14698883458733583:qe=-.030039164579240187:t[189]>1e-35?qe=-.06086763220538141:t[1]>86.50000000000001?qe=-.05096727866142538:t[4]>64.50000000000001?qe=.11240554253834577:t[4]>45.50000000000001?qe=-.030279760168394117:t[6]>45.50000000000001?qe=.10161088917815142:t[10]>77.50000000000001?qe=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?qe=-.06672020005240323:qe=.08831457502630258:t[8]>2592.5000000000005?qe=-.052617701047376654:t[10]>29.500000000000004?qe=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?qe=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?qe=-.064099222705728:qe=.044332487521538365:t[0]>2882.5000000000005?qe=.031099546885005065:qe=.12938467051623853:t[0]>4221.500000000001?qe=-.0928676413498701:t[9]>30.500000000000004?qe=-.05781824812803708:qe=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?qe=-.06648105454098469:qe=.05985487552383097:qe=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?qe=.05282385499619401:t[1]>66.50000000000001?qe=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?qe=.027885690791379255:qe=-.08407126408362446:qe=.014432924125571093:qe=-9903435845205118e-20;let je;t[76]>1e-35?je=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?je=.013633653464240465:je=-.10164319411983509:je=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?je=.00632864847804078:je=-.08393000368134668:je=.07870508617440916:t[284]>1e-35?je=.1092302727710421:je=-.0025505047582483234:t[248]>1e-35?je=.07101822393621864:t[274]>1e-35?je=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?je=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?je=.025081789181021243:je=-.014813325803582618:t[9]>33.50000000000001?je=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?je=.11926990418060353:je=.01852125513565268:je=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?je=-.1178464984373743:t[283]>1e-35?je=.043370859226927405:t[5]>4320.500000000001?je=-.01103141226366587:t[8]>1104.5000000000002?je=-.023053423988095886:je=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?je=.000579145585864887:je=.03389152834202143:t[128]>1e-35?je=-.14527722052568462:t[210]>1e-35?je=-.08915971541902741:t[7]>9.500000000000002?je=-.03307314577076116:t[18]>1e-35?je=-.05521712302023565:je=.009315605032770029:je=.0036332551852289933;let J;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?J=-.07583539600416284:t[188]>1e-35?J=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?J=-.011038193049597113:J=.08154028164397753:t[1]>85.50000000000001?J=.10259361975201933:J=.011640408330521594:J=-.00023319159023748508:t[92]>1e-35?J=.13771692859530546:J=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?J=.09967230141007705:t[30]>1e-35?J=-.08888529037551285:J=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?J=.08284665960761373:J=-.029292565021289504:t[7]>7.500000000000001?J=-.09945093355204493:J=-.008381393701708593:t[20]>1e-35?J=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?J=.07585582641438211:t[8]>284.50000000000006?J=-.029387993239886723:J=.07716738177321587:t[1]>18.500000000000004?J=.026745348497993746:J=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?J=.02337306890530338:J=-.10390355904767366:J=.07390521199638532:J=-.06788247515155237:J=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?J=-.06360325615644084:J=.04342192339836601:J=-.10598779152030145:J=.05253384605768211;let ae;t[3]>7.500000000000001?t[157]>1e-35?ae=-.07514182877923786:ae=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ae=.028692053800951845:ae=.14081686716133598:ae=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?ae=.0037139292567243084:ae=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?ae=.01202688580305612:ae=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?ae=.043935495082738626:ae=-.05639305759669704:t[247]>1e-35?ae=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?ae=.10331836202616368:ae=.0006926658459781341:t[96]>1e-35?ae=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?ae=-.0741403257305367:ae=.022900127535540854:t[7]>3.5000000000000004?ae=.038110741403836294:ae=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?ae=-.09552842289807008:t[1]>27.500000000000004?ae=.012505935885798007:ae=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?ae=-.1046104767723845:ae=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?ae=.023466328488582572:ae=.11730925774586994:ae=-.04771965631104874:ae=.17059689880751394:ae=-.08181850955999449:t[26]>1e-35?ae=-.12727482696678769:ae=-.014343123272734182;let Ce;t[147]>1e-35?t[1]>53.50000000000001?Ce=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Ce=-.02763546051134888:Ce=.06423344777499343:Ce=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?Ce=.049825139823021586:t[7]>22.500000000000004?Ce=-.01131680751379858:t[0]>2579.5000000000005?Ce=-.10673674485369694:Ce=-.015387212937189957:Ce=.04347325151148724:t[179]>1e-35?Ce=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Ce=.0650355590939066:Ce=-.0473332870892226:Ce=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?Ce=.11139543329789044:t[126]>1e-35?Ce=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?Ce=.06370903833231022:t[10]>29.500000000000004?Ce=.03415223859607161:t[10]>3.5000000000000004?Ce=-.07415518117873297:Ce=-.0014119203473324082:Ce=.12617652343819508:t[9]>41.50000000000001?Ce=-.10311145857176976:t[8]>2757.5000000000005?Ce=-.08106484219011428:t[7]>71.50000000000001?Ce=-.09783384432091176:t[1]>88.50000000000001?Ce=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?Ce=-.008884084501608536:Ce=.061339437777743616:Ce=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?Ce=.01526664064166223:Ce=.13534828515415498:Ce=-.06985484465894776:Ce=.0005758961943178744;let Re;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Re=-.029152732370514342:Re=.07173628916139178:t[1]>36.50000000000001?Re=-.08859111297255318:Re=.0018030071815630785:Re=.13652461563759322:Re=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Re=-.07145140450454163:t[21]>1e-35?Re=-.07422841663493233:Re=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Re=.11864240653986852:t[3]>33.50000000000001?Re=-.08821209591953476:Re=.05706392280054726:Re=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Re=.01953613016837112:Re=-.059781039130025006:t[148]>1e-35?Re=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Re=.07207826841738371:t[202]>1e-35?Re=.08163917539410503:Re=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Re=-.06858280496900336:Re=-.1781828899516648:Re=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Re=.018232649414147116:Re=-.04419781124222661:Re=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Re=.11452368095776105:Re=-.036496437259924026:Re=-.040445338739465486:Re=.0816572651001145:Re=-.08968914517368663:Re=.0002826343082585516;let $e;t[189]>1e-35?t[0]>5269.500000000001?$e=-.08839493050459957:t[10]>85.50000000000001?$e=.10046908365702462:t[8]>2592.5000000000005?$e=-.09632233975926387:t[8]>2000.5000000000002?$e=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?$e=.035504970430426296:t[1]>31.500000000000004?$e=-.1133764813142531:$e=-.01138280942244812:t[8]>1125.5000000000002?$e=.09800530246229806:$e=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?$e=.07316772160107896:$e=-.059095014819051765:$e=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?$e=-.09150209066166894:t[8]>3084.0000000000005?$e=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?$e=-.04449234460408263:$e=.05568837973347338:$e=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?$e=.12741077850267066:$e=.007372371864985329:t[2]>39.50000000000001?$e=.02295917234617787:$e=.14966532083907075:t[1]>39.50000000000001?$e=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?$e=-.02511861881285652:t[1]>27.500000000000004?$e=.08683660011672288:$e=.02956214835267301:t[9]>15.500000000000002?$e=-.016538805462996232:$e=.04352738094981517:$e=-.05561856645643868:t[9]>170.50000000000003?$e=-.07996752635874248:t[179]>1e-35?$e=-.09065975936933919:$e=-.00042817975060427177;let Ye;t[39]>1e-35?t[4]>25.500000000000004?Ye=.03443173196222934:Ye=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?Ye=-.0013415395759330318:Ye=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?Ye=.002297618040307216:Ye=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?Ye=-.015297257305397608:Ye=.09651828834062742:Ye=-.06636003334371929:t[10]>11.500000000000002?Ye=.17631616138309397:t[0]>1639.5000000000002?Ye=3804386478092585e-20:Ye=-.09099296398683193:Ye=-.06874415876172972:t[0]>2151.5000000000005?Ye=-.1311264883406766:Ye=.00809052010141122:t[253]>1e-35?Ye=-.06338558211939296:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?t[10]>10.500000000000002?t[0]>3615.5000000000005?Ye=.045038497754638605:Ye=-.07770167665661752:Ye=-.08596294280650517:Ye=.08538655727027213:Ye=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?Ye=.054627956617973275:t[1]>61.50000000000001?Ye=-.11994465088415499:t[4]>8.500000000000002?Ye=.06676200239406452:Ye=-.027503148069376867:t[8]>676.5000000000001?Ye=-.10363964928357075:t[4]>8.500000000000002?Ye=-.07589816227175682:Ye=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?Ye=.009093153189012338:Ye=-.06119765876605404:Ye=.0004668642103528348;let ut;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?ut=-.10100794502567233:ut=.08000205636470442:ut=-.11945419826856896:t[113]>1e-35?ut=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?ut=.1224302423880318:ut=-.01875566982911468:t[222]>1e-35?t[1]>8.500000000000002?t[1]>24.500000000000004?t[4]>3.5000000000000004?t[0]>725.5000000000001?t[0]>1682.5000000000002?t[0]>2860.5000000000005?ut=.0019277012166729114:t[1]>28.500000000000004?ut=-.054445821715687494:ut=.045645722976713245:t[30]>1e-35?ut=.13402660155331655:ut=.008921176001777645:ut=-.058547426505451076:ut=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?ut=-.13526418192218206:ut=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?ut=.0007263224246135398:ut=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?ut=-.11575657261278308:ut=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?ut=-.01995960178292952:ut=.11216586049153021:ut=-.10050961087149474:ut=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?ut=.10303451081526649:ut=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?ut=-.043799548968209395:ut=-.12451444314954115:t[4]>12.500000000000002?ut=-.03838117361958468:ut=.06504990789767144:t[57]>1e-35?ut=.06890006938293915:ut=.0003914274695562949;let yt;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?yt=.004271749009686975:yt=-.10523878297127605:yt=.04633982158107851:yt=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?yt=-.08655730561951676:t[8]>919.5000000000001?yt=-.0676453705610183:t[7]>18.500000000000004?yt=-.027787974193650575:yt=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?yt=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?yt=-.03473877164537313:t[8]>719.5000000000001?yt=.10471053866934404:yt=.008236107678382981:t[4]>57.50000000000001?yt=.09412219478825269:t[10]>66.50000000000001?yt=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?yt=-.040681323751002293:yt=.06374650297561021:yt=.12884615227401788:t[10]>5.500000000000001?yt=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?yt=-.05474068967150784:yt=.03744700650806603:yt=-.07846396348680855:t[1]>42.50000000000001?yt=.018972315810821302:yt=.10953621007604744:t[5]>4439.500000000001?yt=.010999776705494586:t[1]>40.50000000000001?yt=-.12394200059775967:t[10]>2.5000000000000004?yt=.013528093962849453:yt=-.09222088417048682:yt=-.12662967149701485:yt=.09327296405849603:t[3]>99.50000000000001?yt=-.013581954439986752:yt=.0005526498251862075;let $t;t[187]>1e-35?t[243]>1e-35?$t=-.08392792551692502:t[10]>68.50000000000001?$t=.07871769409454053:t[10]>8.500000000000002?t[10]>16.500000000000004?t[2]>17.500000000000004?t[3]>31.500000000000004?t[91]>1e-35?t[10]>21.500000000000004?t[10]>33.50000000000001?t[10]>48.50000000000001?$t=-.0825306209711224:$t=.049559996084532945:$t=-.1064938580886302:$t=.03353240732240275:$t=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?$t=.16966001471529374:t[1]>57.50000000000001?$t=-.005772777673676247:$t=.09383677041525058:t[8]>747.5000000000001?$t=.054068175469351235:$t=-.049968216310277036:t[8]>753.5000000000001?$t=-.0679383555784074:t[4]>8.500000000000002?$t=-.059757341189735386:$t=.05701083682780414:$t=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?$t=.05820296128730006:$t=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?$t=.15340611616954566:$t=.04385036188666874:t[0]>4449.500000000001?$t=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?$t=.004840354641006495:$t=.09967827580276283:$t=.11605363537391578:t[9]>19.500000000000004?$t=-.0735831692725717:$t=.019973331823355176:t[306]>1e-35?t[149]>1e-35?$t=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?$t=-.02442182361342386:$t=.10334853004243093:$t=-.030431948680167104:$t=-956078595250818e-19;let Tt;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?Tt=-.040232505718244854:t[0]>3030.5000000000005?Tt=.0634109586813073:Tt=-.04043617034245621:Tt=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?Tt=-.007859096946435131:Tt=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?Tt=.05515771679628051:Tt=-.04214471312668263:Tt=-.09589322222261765:t[193]>1e-35?Tt=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?Tt=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?Tt=-.08152604001147906:t[11]>1e-35?Tt=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?Tt=.13100930780107503:t[10]>25.500000000000004?Tt=.05921074710011526:Tt=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?Tt=.0009447118243153454:Tt=-.09820565036865991:Tt=.057146909749745546:t[0]>2115.5000000000005?Tt=-.12331216726611678:Tt=.007281983677694285:t[2]>56.50000000000001?Tt=.012310154675612615:Tt=-.08873665774670461:t[6]>25.500000000000004?Tt=.134708740821879:t[9]>5.500000000000001?Tt=-.0805901581148979:t[224]>1e-35?Tt=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?Tt=.10842593386554122:t[2]>13.500000000000002?Tt=.06466798320378395:Tt=-.08578130788886655:Tt=-.03590892078300114:Tt=.0003499894043880708;let We;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?We=.10839808814624702:We=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?We=-.007478368069393829:We=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?We=.04035247751736232:t[0]>4255.500000000001?We=-.1310865624507367:t[0]>4004.5000000000005?We=.06647367311982634:We=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?We=-.011618902907510411:We=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?We=.09356028223727986:We=-.03811765057032162:We=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?We=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?We=.1146142460964847:t[1]>62.50000000000001?We=-.09679869865322362:t[9]>71.50000000000001?We=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?We=-.039046426387852974:We=.04558778688367152:We=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?We=.03261697816211156:t[15]>1e-35?We=.02586252542264368:t[2]>14.500000000000002?We=-.016420452667484604:We=-.1011799626006976:We=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?We=.010193588102560583:We=.11748729525930773:We=-.04468162226743652:We=-.028365274393617957:t[71]>1e-35?We=.05115139346588793:We=-.0001510425316936658;let ce;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ce=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ce=.020637047900190317:ce=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?ce=-.04632587527094407:ce=.08603684785510396:ce=-.05101401015448496:ce=.025466432054358498:ce=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ce=.020385355430046367:ce=.12032592051335252:ce=-.012387370292173013:t[2]>23.500000000000004?ce=-.12568545484492677:ce=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ce=.043528764484784536:ce=.14352071657196003:ce=-.009332833816977268:ce=.11186782227735846:ce=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ce=-.05649104643152564:ce=.03884200719305747:t[42]>1e-35?ce=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ce=-.04103416502526736:ce=.04881823954656287:t[4]>15.500000000000002?ce=.009342724662897898:t[0]>3969.5000000000005?ce=-.025637309961309498:ce=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ce=-.08185697075265091:t[0]>2215.5000000000005?ce=.030063975892297354:t[0]>807.5000000000001?ce=-.03924325550733229:ce=.0415330999189793:ce=-.00024374664461674863;let Pe;t[3]>7.500000000000001?Pe=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Pe=.025798416259686565:Pe=.13251610353146012:Pe=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Pe=-.11098564237775424:Pe=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Pe=.15347826616466054:t[3]>4.500000000000001?Pe=.10379320730958941:Pe=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Pe=.03159791088468647:Pe=-.10612873364104258:Pe=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Pe=-.02335760775001469:Pe=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Pe=-.011164334474672973:Pe=-.06594044410501655:t[207]>1e-35?Pe=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Pe=-.01725821503981916:Pe=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Pe=-.04226531631656534:Pe=-.14409800530171432:Pe=-.03245576341206398:t[8]>4214.500000000001?Pe=.0895409165534886:t[247]>1e-35?Pe=-.06506383629143335:t[118]>1e-35?Pe=-.07214270121257443:t[8]>546.5000000000001?Pe=-.004385020865473831:Pe=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Pe=.046278501133958524:Pe=-.030835570926968044:t[0]>493.50000000000006?Pe=-.12794504651610425:Pe=.009415039807550776;let Me;t[304]>1e-35?Me=-.04717777269217453:t[76]>1e-35?Me=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Me=-.09648224457374217:t[132]>1e-35?Me=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Me=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Me=.10838431695638147:t[230]>1e-35?Me=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Me=.050071316251979:Me=-.006356941111525215:t[6]>8.500000000000002?Me=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Me=.10217402850540398:Me=-.048840949025349197:Me=-.03668313197909846:t[7]>39.50000000000001?Me=-.0562642841496003:t[10]>2.5000000000000004?Me=.09749777369987417:Me=-.04848223121417616:t[0]>5453.500000000001?Me=.08316648226133942:Me=-.0261979698267618:t[212]>1e-35?Me=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Me=.04837009746506856:Me=-.09184360565631328:Me=.0032411047845613606:t[0]>4733.500000000001?Me=.0977378556864798:Me=.010776545559325588:Me=-.012483310473120218:Me=-.049284121449103935:Me=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Me=-.08380361910948711:Me=.07375088778585813:Me=-.1084864186071348:Me=.0007819503469605476;let ye;t[7]>17.500000000000004?t[115]>1e-35?ye=.08741852531696623:t[167]>1e-35?ye=.10078975495600809:ye=-.0018324767784017562:t[290]>1e-35?ye=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ye=.1379733311640402:ye=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ye=-.09360083033774169:ye=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ye=-.015599362579530679:t[0]>4593.500000000001?ye=-.12029549262691491:ye=-.018917032256501397:ye=.04632831686576592:ye=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ye=-.05894883236412263:ye=.05213944998315824:ye=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ye=.07577412405680808:ye=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ye=-.0277076900736147:t[1]>65.50000000000001?ye=-.023587471585763506:ye=.10184896592433082:ye=-.057699270527916825:ye=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ye=.06566902102799584:t[10]>25.500000000000004?ye=-.07033633753181047:ye=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ye=-.08108035861059537:ye=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ye=-.12431182772561139:ye=.01886235886984271:ye=.0025579594894418116;let oe;t[8]>2915.5000000000005?t[101]>1e-35?oe=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?oe=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?oe=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?oe=.0687641681341721:t[10]>102.50000000000001?oe=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?oe=-.06762578396473291:t[10]>65.50000000000001?oe=-.05226727783610509:t[282]>1e-35?oe=.09911438410640917:t[19]>1e-35?oe=.06915156336429933:oe=-.006565637886508241:oe=-.08344300251849307:oe=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?oe=.19428463865406298:oe=.016073883020956765:t[13]>1e-35?oe=.06864077097923665:oe=-.01388867527034731:t[0]>1847.5000000000002?oe=.004655280608161356:t[1]>40.50000000000001?oe=.031406054057765996:oe=.12798062439212832:oe=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?oe=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?oe=-.0706095614785733:oe=.04227164041372561:oe=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?oe=-.07139533369873902:oe=.008952586782921625:oe=.06086212582180936:oe=-.0816938490403437:oe=-.051224901945956025:oe=-.10525399124186095:oe=.000270924147208224;let Ke;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?Ke=.029186512383291244:t[7]>1.5000000000000002?Ke=-.14984127276725573:t[1]>40.50000000000001?Ke=.032757060730648144:Ke=-.07675575422749602:t[6]>8.500000000000002?Ke=.10599766037117893:Ke=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Ke=-.051394622947855385:Ke=.03237141302699347:Ke=.12526173027943244:Ke=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Ke=-.07383912482657777:t[0]>5147.500000000001?Ke=.07008813937042091:t[10]>38.50000000000001?Ke=-.06779203808365307:Ke=-.013782769999524498:Ke=.0880038869117715:Ke=-.12846294176070952:t[281]>1e-35?Ke=-.06810806903850834:t[10]>227.50000000000003?Ke=-.08937977001661111:t[10]>130.50000000000003?Ke=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Ke=.011036530162093841:Ke=-.11500797478569702:Ke=.03702229366129399:Ke=.07242026683784307:t[189]>1e-35?Ke=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?Ke=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?Ke=-.02608892716555304:Ke=.09609599320761308:t[9]>105.50000000000001?Ke=-.06848127135991534:Ke=.0023675721254089715:t[86]>1e-35?Ke=-.11049635625500497:Ke=-.004847764219432233;let lt;t[125]>1e-35?t[0]>3969.5000000000005?lt=-.09462233499115416:lt=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?lt=-.030700661288166148:lt=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?lt=.03149547314036763:lt=-.08166208257451366:t[0]>5850.500000000001?lt=-.10228136324773157:t[102]>1e-35?lt=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?lt=.01782894842128785:t[13]>1e-35?lt=.002680190260979968:lt=.1773965720476949:t[2]>72.50000000000001?lt=.09090831938627947:t[1]>59.50000000000001?lt=-.12297206702816128:t[0]>4977.500000000001?lt=.09899015653118268:lt=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?lt=-.0675900954187773:lt=.012336403425364092:lt=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?lt=-.02671721777458802:lt=-.09242452991958029:t[284]>1e-35?lt=-.08585691288582491:lt=.013332890564324447:t[4]>14.500000000000002?lt=-.005245022074799553:t[23]>1e-35?lt=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?lt=-.09289852307936758:t[116]>1e-35?lt=-.09686573010015055:t[8]>804.5000000000001?lt=.03812547148215318:lt=.005162744968176633:t[9]>43.50000000000001?lt=-.059246106396159376:lt=.050370113808135275:lt=.000794041852811028;let Gt;t[3]>7.500000000000001?Gt=.0004981426543104341:t[9]>114.50000000000001?Gt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Gt=-.019061766497948867:Gt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Gt=-.006044199577160493:Gt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Gt=.11486607015912494:t[9]>16.500000000000004?Gt=-.08686820858087294:Gt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Gt=-.022230207980026437:Gt=.1056683690528792:Gt=-.05859530800943035:Gt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Gt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Gt=-.05177544573528314:Gt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Gt=.15159657923771555:Gt=-.0060542654587671055:t[9]>5.500000000000001?Gt=-.042808028205051786:t[1]>48.50000000000001?Gt=-.010449538258110742:Gt=.10026907521968294:Gt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Gt=-.02272452389409874:Gt=-.11202691218244319:t[5]>1809.5000000000002?Gt=-.04460413584255906:Gt=.08196329474205256:t[10]>69.50000000000001?Gt=.10221481166238167:Gt=.0004063052701699382:t[243]>1e-35?Gt=-.07563941678849846:t[18]>1e-35?Gt=.02563513231103432:Gt=-.004740081147303786;let Er;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Er=.057446442918106:Er=-.04404018270156349:Er=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Er=-.05930486238817954:t[1]>29.500000000000004?Er=.06955866121256543:t[8]>597.5000000000001?Er=-.06538593556505168:Er=.06212512595497445:Er=.00021102929959182257:t[9]>90.50000000000001?Er=.0958061289119631:t[102]>1e-35?Er=.07172059675638813:t[1]>47.50000000000001?Er=-.03879798603977766:t[297]>1e-35?Er=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?Er=.003805910996312012:Er=.09304295674749524:t[11]>1e-35?t[18]>1e-35?Er=.11252376801858695:t[288]>1e-35?Er=-.10293901912180432:Er=.014669268837893872:t[1]>42.50000000000001?Er=-.05988274123836837:t[145]>1e-35?Er=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?Er=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?Er=-.03366718308159971:Er=.11936550608549797:t[1]>31.500000000000004?Er=-.07454716789539667:Er=.027859650621164217:t[10]>10.500000000000002?Er=-.11806374092321247:Er=-.03506042229223101:Er=-.0007080765837654515:t[10]>6.500000000000001?Er=-.028077713664996503:t[2]>7.500000000000001?Er=.15803724124216814:Er=.0351381284833169:Er=-.07877953381054767;let dr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?dr=.14144941521975005:dr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?dr=.10514088112381886:t[7]>18.500000000000004?dr=-.10370643555956745:dr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?dr=-.0508129468802936:t[224]>1e-35?dr=-.037816066368733595:t[10]>43.50000000000001?dr=.07793408602607932:dr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?dr=.036972453794202324:dr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?dr=.09475302525132188:dr=-.03580104945898193:dr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?dr=-.1282448778804823:dr=-.014395808269207212:dr=-.008940927190750592:dr=-.1459118815453748:t[0]>4897.500000000001?dr=-.09733068457286576:t[1]>57.50000000000001?dr=.06575271409540207:dr=-.019556422817450115:dr=-.10623959222984136:t[18]>1e-35?dr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?dr=.008125645893104896:dr=-.11084368630465868:dr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?dr=-.05854904579626861:t[4]>5.500000000000001?dr=.02985784951394175:dr=-.03247600140149334:dr=-.11152899295304973:dr=-.00035424577714215764;let Ur;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Ur=-.06563670567578264:Ur=.067656954313663:Ur=-.10388217548685377:t[8]>2302.5000000000005?Ur=.07190621943790435:t[4]>67.50000000000001?Ur=.060020507643618604:t[4]>38.50000000000001?Ur=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Ur=-.06568134366461277:t[8]>1075.5000000000002?Ur=-.004768057709758692:Ur=.11785959165999467:Ur=-.05080221682879267:Ur=.14814206127494542:Ur=-.07241946332311736:t[253]>1e-35?Ur=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Ur=-.02471195342450034:Ur=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Ur=-.10741850739482771:Ur=.010051635824944:Ur=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Ur=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Ur=-.08992396138178163:Ur=.010944365997007212:Ur=.06221307021813793:Ur=.1286024087559141:t[127]>1e-35?Ur=.06568148624531012:t[10]>40.50000000000001?Ur=-.07567979134643352:t[5]>5647.500000000001?Ur=.07594672895572069:Ur=-.018158016446439187:t[6]>55.50000000000001?Ur=.009293422430111872:t[4]>45.50000000000001?Ur=-.017749818406964022:t[2]>46.50000000000001?Ur=.01714136511113982:Ur=-724762291423549e-19;let Wr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Wr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Wr=.07084726276890757:Wr=-.11232323677722932:Wr=.04812773089510436:Wr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Wr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Wr=.0879462816013881:Wr=-.002966662093626573:t[306]>1e-35?Wr=-.04588085188342676:Wr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Wr=-.006600332774461143:Wr=.1272481351557754:Wr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Wr=.011884312066620044:Wr=.11678751052403374:t[4]>8.500000000000002?Wr=.03627129613273813:Wr=-.12132783497902287:Wr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Wr=-.06830131718398992:t[0]>5147.500000000001?Wr=.062360406249609306:t[4]>4.500000000000001?Wr=-.013162203864592055:Wr=-.07153029184927609:Wr=.07628618062271557:Wr=-.12085065687320373:t[190]>1e-35?Wr=-.045816889524231186:t[137]>1e-35?Wr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Wr=.025895337822752502:Wr=-.06503949350616421:t[10]>227.50000000000003?Wr=-.09989456525790491:t[10]>130.50000000000003?Wr=.08616651057030683:Wr=.0001234981796706021;let zr;t[8]>1014.5000000000001?t[9]>137.50000000000003?zr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?zr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?zr=-.141732381961068:zr=-.0317152307496497:zr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?zr=.12191801556691254:zr=-.0003444689085397977:zr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?zr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?zr=-.05676033995381961:zr=.10933961076803381:t[4]>26.500000000000004?zr=-.11667582544549814:t[8]>1765.5000000000002?zr=.032174455312047705:zr=-.0755016390126608:t[293]>1e-35?zr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?zr=.026571311956824436:t[15]>1e-35?zr=.06175459479851121:zr=-.018778084411148754:t[9]>40.50000000000001?zr=-.09420232889965811:zr=-.004578248021263184:t[2]>1.5000000000000002?zr=.005453714644971445:zr=-.03907138175699279:zr=-.055296364182154736:t[23]>1e-35?zr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?zr=-.09358146510580179:zr=.060524657996178094:zr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?zr=-.12698331085931538:zr=.006059605604079918:t[2]>196.50000000000003?zr=-.09451315810804783:zr=.0011390147031687425;let zt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?zt=.05517359070460923:zt=-.04758751221404857:zt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?zt=.1040436595565776:t[9]>21.500000000000004?zt=.04032250517675179:t[107]>1e-35?zt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?zt=.1192453009230486:t[1]>51.50000000000001?zt=.0443376336292195:zt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?zt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?zt=-.08999822408398037:zt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?zt=-.061850439226075:zt=.08849196353361093:zt=.10536348167793089:t[92]>1e-35?zt=.04894947712119185:t[9]>16.500000000000004?zt=.05900227903883853:t[9]>5.500000000000001?zt=-.11946594348916476:zt=-.03652096348071964:t[1]>41.50000000000001?zt=-.07411603110840567:zt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?zt=.08493634342741495:t[11]>1e-35?zt=-.10899097825564363:zt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?zt=.08356655906359918:t[7]>25.500000000000004?zt=-.09475076526194888:t[10]>5.500000000000001?zt=-.01999406228763778:zt=.06696212545889428:t[6]>20.500000000000004?zt=.14713592661393468:zt=.0459917279002218:zt=.00027445928493734093;let Tr;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?Tr=-.06904501553217077:Tr=.05696231672035904:Tr=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?Tr=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?Tr=-.011419256378538392:t[0]>3830.5000000000005?Tr=.140315841503076:Tr=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?Tr=-.04027822909411164:Tr=.03176085103667189:Tr=.06779515865838849:t[4]>15.500000000000002?Tr=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?Tr=.06124039747298539:Tr=-.04312732764434027:Tr=.09161522761808062:Tr=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?Tr=.11211681010488772:t[13]>1e-35?Tr=.06725735814960367:Tr=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?Tr=.11743605068905603:Tr=-.011309033539148687:Tr=-.07896094707523052:Tr=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?Tr=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?Tr=.02836295848998302:Tr=.12210680366745175:Tr=-.058302317470509096:t[5]>4144.500000000001?Tr=.06123341960495106:Tr=-.03840046906926525:Tr=-.05221474543453495:Tr=.03988215485860711:Tr=-.00033074684693083496;let e0=_ta(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+_+E+v+S+T+w+R+x+k+D+N+O+B+q+M+L+U+j+Q+Y+W+V+z+ie+H+re+le+Le+me+Oe+Te+te+ee+K+he+X+de+Be+ne+ue+Ne+xe+Fe+tt+st+vt+Pt+Ht+F+se+be+Ue+Qe+ge+Z+ve+Ge+qe+je+J+ae+Ce+Re+$e+Ye+ut+yt+$t+Tt+We+ce+Pe+Me+ye+oe+Ke+lt+Gt+Er+dr+Ur+Wr+zr+zt+Tr);return[1-e0,e0]}a(Yoi,"multilineModelPredict");function _ta(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(_ta,"sigmoid");var Eta={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},Koi={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function Joi(t,e,r,n=!0){let o=t.split(` -`);if(n&&(o=o.filter(l=>l.trim().length>0)),Math.abs(e)>o.length||e>=o.length)return!1;e<0&&(e=o.length+e);let s=o[e];return(Eta[r]??[]).some(l=>s.includes(l))}a(Joi,"hasComment");var oft=class{static{a(this,"PromptFeatures")}constructor(e,r){let[n,o]=this.firstAndLast(e),s=this.firstAndLast(e.trimEnd());this.language=r,this.length=e.length,this.firstLineLength=n.length,this.lastLineLength=o.length,this.lastLineRstripLength=o.trimEnd().length,this.lastLineStripLength=o.trim().length,this.rstripLength=e.trimEnd().length,this.stripLength=e.trim().length,this.rstripLastLineLength=s[1].length,this.rstripLastLineStripLength=s[1].trim().length,this.secondToLastLineHasComment=Joi(e,-2,r),this.rstripSecondToLastLineHasComment=Joi(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` +`)}}catch{}d(null,l)},flush(l){try{if(r+=e.end(),!r){l();return}let u=r.replace(/\r$/,"");c(u),n===0&&s(u)}catch{}l()}})}a(LMe,"createCopilotUsageSniffer");var vge=class{constructor(){this._byKey=new Map}static{a(this,"CopilotUsageAccumulator")}add(e,r){if(!Number.isFinite(r)||r<=0)return;let n=this._byKey.get(e)??0;this._byKey.set(e,n+r)}take(e){let r=this._byKey.get(e);return this._byKey.delete(e),r}clear(e){this._byKey.delete(e)}};var Rm=class{constructor(){this._modelBySession=new Map;this._permissionModeBySession=new Map;this._reasoningEffortBySession=new Map;this._copilotUsage=new vge}static{a(this,"ClaudeSessionStateService")}setModelForSession(e,r){if(r===void 0){this._modelBySession.delete(e);return}this._modelBySession.set(e,r)}getModelForSession(e){return this._modelBySession.get(e)}setPermissionModeForSession(e,r){if(r===void 0){this._permissionModeBySession.delete(e);return}this._permissionModeBySession.set(e,r)}getPermissionModeForSession(e){return this._permissionModeBySession.get(e)}setReasoningEffortForSession(e,r){if(r===void 0){this._reasoningEffortBySession.delete(e);return}this._reasoningEffortBySession.set(e,r)}getReasoningEffortForSession(e){return this._reasoningEffortBySession.get(e)}addCopilotUsageNanoAiuForSession(e,r){this._copilotUsage.add(e,r)}takeCopilotUsageNanoAiuForSession(e){return this._copilotUsage.take(e)}clear(e){this._modelBySession.delete(e),this._permissionModeBySession.delete(e),this._reasoningEffortBySession.delete(e),this._copilotUsage.clear(e)}};var rft=fe(require("path"));Fo();var _c=new pe("ClaudeCodeAgent.session"),Ec="ClaudeCodeSession",BMe=class{constructor(e,r,n,o){this.ctx=e;this.sdkWrapper=r;this.notificationSender=n;this._plugins=[];this._onPluginSnapshot=new Lc;this.onPluginSnapshot=this._onPluginSnapshot.event;this._terminalErrorEmittedForTurn=!1;this._assistantBlockCursor=new Map;this._suppressedToolUseIds=new Set;this._abortController=new AbortController;this._isResumed=!1;this._isProcessing=!1;this._disposed=!1;this._permissionRegistry=new Ege;this._userInputRegistry=new Ege;this._exitPlanModeRegistry=new Ege;this._injectedServerNames=new Set;this._handleCanUseTool=a((e,r,n)=>this._disposed?Promise.resolve({behavior:"deny",message:`Session ${this.sessionId} disposed`}):e==="AskUserQuestion"?this._handleAskUserQuestion(r,n):e==="ExitPlanMode"?this._handleExitPlanMode(r,n):e==="ToolSearch"?Promise.resolve({behavior:"allow",updatedInput:r}):this._handlePermissionRequest(e,r,n),"_handleCanUseTool");this.sessionId=o.sessionId,this._cwd=o.cwd,this._model=o.model,this._permissionMode=o.permissionMode,this._isResumed=!(o.isNewSession??!0),this._proxyConfig=o.proxyConfig;let s=this.ctx.get(Rm);if(s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode),this.ctx.get(Nn).getCapabilities().agentDebugLog){let c=new cI(this.ctx);c.isEnabled()&&(this._otelTracker=new eft(this.ctx,this.sessionId,c))}}static{a(this,"ClaudeCodeSession")}get cwd(){return this._cwd}async invoke(e){if(this._disposed){let r=`Session ${this.sessionId} has been disposed`;throw await this._sendSessionUpdate({type:"error",error:r}),new Error(r)}if(this._isProcessing){let r=`Session ${this.sessionId} is busy: a previous invoke is still streaming. Wait for the terminal sessionUpdate before sending another prompt.`;throw await this._sendSessionUpdate({type:"error",error:r}),new Error(r)}this._isProcessing=!0;try{await this._runInvoke(e)}finally{this._isProcessing=!1}}async setModel(e){if(e!==this._model&&(this._model=e,this.ctx.get(Rm).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){_c.warn(this.ctx,`${Ec}: setModel on active query failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async supportedAgents(){if(!this._query)return[];try{return await this._query.supportedAgents()}catch(e){return _c.warn(this.ctx,`${Ec}: supportedAgents query failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),[]}}supportedPlugins(){return this._plugins}_capturePlugins(e){if(e.type!=="system"||e.subtype!=="init")return;let r=e.plugins;r!==void 0&&!Array.isArray(r)&&_c.warn(this.ctx,`${Ec}: ignored malformed plugin snapshot`,{sessionId:this.sessionId});let n=Array.isArray(r)?r:[];this._setPlugins([...n]),this._onPluginSnapshot.fire(this._plugins)}_setPlugins(e){this._plugins=e}_notifyAgentListChanged(){try{this.ctx.get(Eg).notify("agent").catch(e=>{_c.warn(this.ctx,`${Ec}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})})}catch(e){_c.warn(this.ctx,`${Ec}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})}}async setPermissionMode(e){if(e===void 0&&this._permissionMode!==void 0){_c.info(this.ctx,`${Ec}: setPermissionMode skipped (undefined preserves existing)`,{sessionId:this.sessionId,existingMode:this._permissionMode});return}let r=e??"default";if(this._permissionMode=r,this.ctx.get(Rm).setPermissionModeForSession(this.sessionId,r),this._query)try{await this._query.setPermissionMode(r),_c.info(this.ctx,`${Ec}: setPermissionMode propagated to live Query`,{sessionId:this.sessionId,effectiveMode:r})}catch(n){_c.warn(this.ctx,`${Ec}: setPermissionMode on active query failed`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)})}}async interrupt(){let e=this._query;if(e)try{await e.interrupt()}catch(r){_c.warn(this.ctx,`${Ec}: interrupt() failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}dispose(){if(this._disposed)return;this._disposed=!0,this._setPlugins([]),this._onPluginSnapshot.dispose(),this._dropAllPending("disposed"),this._abortController.abort(),this.ctx.get(Rm).clear(this.sessionId);let e=this._promptWaiter;this._promptWaiter=void 0,e?.resolve();let r=this._currentInvokeDone;this._currentInvokeDone=void 0,r?.reject(new Error(`Session ${this.sessionId} disposed`));let n=this._query;n&&n.interrupt().catch(o=>{_c.warn(this.ctx,`${Ec}: interrupt during dispose failed`,{sessionId:this.sessionId,error:o instanceof Error?o.message:String(o)})})}async _runInvoke(e){e.model!==void 0&&e.model!==this._model&&await this.setModel(e.model),e.permissionMode!==void 0&&await this.setPermissionMode(e.permissionMode),this.ctx.get(Rm).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(Rm).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new UA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1,this._currentTurnInteractionId=Dt();let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{_c.info(this.ctx,`${Ec}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),_c.info(this.ctx,`${Ec}.invoke`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,messageCharLen:e.message.length,referenceCount:e.references?.length??0});let s=await Doi(e.references,this.ctx),l={type:"user",message:{role:"user",content:[{type:"text",text:e.message},...s]},parent_tool_use_id:null,session_id:this.sessionId,uuid:e.messageId??Dt()};this._otelTracker?.startRequest(this._model,e.message),this._pendingPromptInput=l;let u=this._promptWaiter;this._promptWaiter=void 0,u?.resolve(),await r.promise}catch(o){throw await this._emitTerminalError(o),o}finally{n?.dispose(),this._currentInvokeDone===r&&(this._currentInvokeDone=void 0)}}async _startQuery(){let e=this._proxyConfig,r=this._isResumed,n=kt(this.ctx,ze.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await _ge.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(_c.warn(this.ctx,`${Ec}: ${o.message}`,{sessionId:this.sessionId}),this.notificationSender.showWarningMessageOnlyOnce("claude.cliVersionMismatch",o.message));let s=kut(this.ctx),c=this._buildInjectedMcpServers(s),l=this._buildAllowedMcpServers(s,c),u={cwd:this._cwd,executable:process.execPath,pathToClaudeCodeExecutable:n,abortController:this._abortController,settings:{env:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${e.port}`,ANTHROPIC_AUTH_TOKEN:`${e.nonce}.${this.sessionId}`,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1",USE_BUILTIN_RIPGREP:"0",PATH:await this._buildPathWithBundledRipgrep(),...this._deriveClaudeOTelEnv()},...l&&{allowedMcpServers:l},...!WF(this.ctx)&&{disableAllHooks:!0}},systemPrompt:{type:"preset",preset:"claude_code"},settingSources:["user","project","local"],...Vzt(this.ctx)?{}:{skills:[]},disallowedTools:["WebSearch"],canUseTool:this._handleCanUseTool,...Object.keys(c).length>0&&{mcpServers:c},thinking:{type:"adaptive"},includePartialMessages:!0,allowDangerouslySkipPermissions:!0,...this._model&&{model:this._model},...this._permissionMode&&{permissionMode:this._permissionMode},...r?{resume:this.sessionId}:{sessionId:this.sessionId}},d=await this.sdkWrapper.query({prompt:this._createPromptIterable(),options:u});this._query=d,this._isResumed=!0,this._notifyAgentListChanged(),_c.info(this.ctx,`${Ec}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(d).catch(f=>{_c.error(this.ctx,`${Ec}: consume loop crashed`,{sessionId:this.sessionId,error:f instanceof Error?f.message:String(f)})})}_buildInjectedMcpServers(e){if(!e)return this._injectedServerNames=new Set,{};let{servers:r,names:n}=Coi(e,this._cwd);return this._injectedServerNames=n,r}_buildAllowedMcpServers(e,r){return e?boi(e,r):void 0}async reloadInjectedMcpServers(e){let r=this._query;if(!r||this._disposed)return;let n=this._buildInjectedMcpServers(e);try{await r.setMcpServers(n),await r.applyFlagSettings({allowedMcpServers:this._buildAllowedMcpServers(e,n)??null}),_c.info(this.ctx,`${Ec}: reloaded injected MCP servers`,{sessionId:this.sessionId,count:Object.keys(n).length})}catch(o){_c.warn(this.ctx,`${Ec}: reloadInjectedMcpServers failed`,{sessionId:this.sessionId,error:o instanceof Error?o.message:String(o)})}}get injectedServerNames(){return this._injectedServerNames}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(e8).resolvePath();return`${rft.dirname(e)}${rft.delimiter}${process.env.PATH??""}`}catch(e){return _c.warn(this.ctx,`${Ec}: bundled ripgrep unavailable, falling back to process PATH`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),process.env.PATH??""}}_deriveClaudeOTelEnv(){let e=Jlt(this.ctx);return cZn(this.ctx,e)}async*_createPromptIterable(){for(;!this._disposed;){if(this._pendingPromptInput){let r=this._pendingPromptInput;this._pendingPromptInput=void 0,yield r;continue}let e=new UA;this._promptWaiter=e,await e.promise}}async _processMessages(e){let r;try{for await(let n of e){if(this._checkSessionIdConsistency(n),this._capturePlugins(n),this._isPartialAssistantMessage(n)){let o=n.event;o.type==="message_start"&&(r=o.message.id),r!==void 0&&await this._sendPartialUpdate(n,r),o.type==="message_stop"&&(r=void 0)}else await this._sendSessionUpdate(n);if(this._isTerminalTurnMessage(n)){n.type==="result"?this._otelTracker?.endRequest():this._otelTracker?.endRequestWithError(n.error??"Turn ended with error"),this._assistantBlockCursor.clear(),this._suppressedToolUseIds.clear(),this._currentTurnInteractionId=void 0;let s=this._currentInvokeDone;this._currentInvokeDone=void 0,s?.resolve()}}this._otelTracker?.endRequestWithError("SDK Query ended unexpectedly"),this._currentInvokeDone&&await this._emitTerminalError(new Error("SDK Query ended unexpectedly")),this._cleanupLiveQuery(e,new Error("SDK Query ended unexpectedly"))}catch(n){_c.error(this.ctx,`${Ec}: query error`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)}),this._otelTracker?.endRequestWithError(n instanceof Error?n.message:String(n)),await this._emitTerminalError(n),this._cleanupLiveQuery(e,n instanceof Error?n:new Error(String(n)))}}_isPartialAssistantMessage(e){return typeof e=="object"&&e!==null&&e.type==="stream_event"}_isTerminalTurnMessage(e){if(typeof e!="object"||e===null)return!1;let r=e.type;return r==="result"||r==="error"}_cleanupLiveQuery(e,r){this._query===e&&(this._query=void 0,this._setPlugins([])),this._dropAllPending("query ended",r.message),this._assistantBlockCursor.clear(),this._suppressedToolUseIds.clear(),this._currentTurnInteractionId=void 0;let n=this._currentInvokeDone;this._currentInvokeDone=void 0,n?.reject(r)}_checkSessionIdConsistency(e){if(typeof e!="object"||e===null)return;let r=e.session_id;typeof r=="string"&&r!==this.sessionId&&_c.error(this.ctx,`${Ec}: SDK reported session_id mismatch`,{expected:this.sessionId,reported:r})}async _sendSessionUpdate(e){try{this._otelTracker?.onMessage(e);let n=e?.type==="result"?this.ctx.get(Rm).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=Hgr(e,{streamingEnabled:!0,sessionModel:this._model,copilotUsageNanoAiu:n,blockCursor:this._assistantBlockCursor,suppressedToolUseIds:this._suppressedToolUseIds,interactionId:this._currentTurnInteractionId});for(let s of o)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,s,"CLAUDE")}catch(r){_c.error(this.ctx,`${Ec}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=Loi(e,r,this._currentTurnInteractionId);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){_c.error(this.ctx,`${Ec}: failed to send partial agent/sessionUpdate`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)})}}async _emitTerminalError(e){if(this._terminalErrorEmittedForTurn)return;this._terminalErrorEmittedForTurn=!0;let r=e instanceof Error?e.message:String(e);await this._sendSessionUpdate({type:"error",error:r})}respondToInteraction(e){if(e.sessionId!==this.sessionId)return _c.warn(this.ctx,`${Ec}: respondToInteraction sessionId mismatch`,{ownSessionId:this.sessionId,paramSessionId:e.sessionId,requestId:e.requestId}),!1;switch(e.type){case"permission":return this._respondFromRegistry(this._permissionRegistry,e.type,e.requestId,e.result);case"user_input":return this._respondFromRegistry(this._userInputRegistry,e.type,e.requestId,e.response);case"exit_plan_mode":return this._respondFromRegistry(this._exitPlanModeRegistry,e.type,e.requestId,e.response);default:return _c.warn(this.ctx,`${Ec}: unsupported interaction type`,{sessionId:this.sessionId,requestId:e.requestId,interactionType:e.type}),!1}}_respondFromRegistry(e,r,n,o){let s=e.respond(n,o);return s||_c.warn(this.ctx,`${Ec}: respondToInteraction for unknown ${r} requestId`,{sessionId:this.sessionId,requestId:n}),s}_dropAllPending(e,r){let n=r?`: ${r}`:"";this._permissionRegistry.respondAll({kind:"denied-interactively-by-user",feedback:`Session ${this.sessionId} ${e} before permission resolved${n}`}),this._userInputRegistry.rejectAll(new Error(`Session ${this.sessionId} ${e} before user_input resolved${n}`)),this._exitPlanModeRegistry.respondAll({approved:!1,feedback:`Session ${this.sessionId} ${e} before exit_plan_mode resolved${n}`})}_handlePermissionRequest(e,r,n){let o=n.toolUseID??Dt();if(n.signal.aborted)return Promise.resolve({behavior:"deny",message:"Permission request aborted"});let s=Soi(e,r,n);return this._requestPermissionFromIde(o,e,r,s,n)}async _handleAskUserQuestion(e,r){if(r.signal.aborted)return{behavior:"deny",message:"AskUserQuestion aborted"};let n=Ioi(e);if(!n)return{behavior:"deny",message:"AskUserQuestion: invalid input"};try{let o=await Promise.all(n.map(async c=>{let l=Dt(),u=await this._requestUserInputFromIde(l,xoi(c,r.toolUseID),r.signal);return{questionText:c.questionText,answer:u.answer}})),s={};for(let{questionText:c,answer:l}of o)s[c]=l;return{behavior:"allow",updatedInput:{...e,answers:s}}}catch(o){return{behavior:"deny",message:o instanceof Error?o.message:`AskUserQuestion failed: ${String(o)}`}}}_handleExitPlanMode(e,r){let n=r.toolUseID??Dt();return r.signal.aborted?Promise.resolve({behavior:"deny",message:"ExitPlanMode request aborted"}):this._requestExitPlanModeFromIde(n,e,r)}async _requestExitPlanModeFromIde(e,r,n){let{promise:o,isSettled:s}=this._exitPlanModeRegistry.register(e),c=a(()=>{this._exitPlanModeRegistry.respond(e,{approved:!1,feedback:"ExitPlanMode request aborted"})},"onAbort"),l=a(()=>n.signal.removeEventListener("abort",c),"cleanupAbort");n.signal.addEventListener("abort",c,{once:!0});let u=typeof r.plan=="string"?r.plan:"",d=this._emitExitPlanModeRequested(e,{planContent:u,summary:u,actions:["exit_only","interactive"],recommendedAction:"interactive",toolCallId:n.toolUseID});d.catch(m=>{s()||(_c.error(this.ctx,`${Ec}: failed to emit exit_plan_mode.requested, denying`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)}),l(),this._exitPlanModeRegistry.respond(e,{approved:!1,feedback:"Failed to deliver exit_plan_mode request to client"}))});let f;try{f=await o}finally{l()}let h=this._translateExitPlanModeResponse(f,r);return _c.info(this.ctx,`${Ec}: exit_plan_mode resolved`,{sessionId:this.sessionId,requestId:e,behavior:h.behavior,selectedAction:f.selectedAction,autoApproveEdits:f.autoApproveEdits}),d.catch(()=>{}).then(()=>this._emitExitPlanModeCompleted(e,f)).catch(m=>{_c.warn(this.ctx,`${Ec}: failed to emit exit_plan_mode.completed`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)})}),h}_translateExitPlanModeResponse(e,r){if(!e.approved){let c=e.feedback?.trim();return{behavior:"deny",message:c?`Plan not approved: ${c}`:"Plan not approved by user"}}if(e.selectedAction==="exit_only")return{behavior:"deny",message:"The user approved the plan but will implement it themselves. Do not make any code changes or take any further action. Stop and wait for the user."};let o=e.autoApproveEdits===!0?"acceptEdits":"default";return this._permissionMode=o,this.ctx.get(Rm).setPermissionModeForSession(this.sessionId,o),{behavior:"allow",updatedInput:r,updatedPermissions:[{type:"setMode",mode:o,destination:"session"}]}}async _requestPermissionFromIde(e,r,n,o,s){let{promise:c,isSettled:l}=this._permissionRegistry.register(e),u=a(()=>{this._permissionRegistry.respond(e,{kind:"denied-interactively-by-user",feedback:"Permission request aborted"})},"onAbort"),d=a(()=>s.signal.removeEventListener("abort",u),"cleanupAbort");s.signal.addEventListener("abort",u,{once:!0});let f=this._emitPermissionRequested(e,o);f.catch(A=>{l()||(_c.error(this.ctx,`${Ec}: failed to emit permission.requested, denying`,{sessionId:this.sessionId,requestId:e,toolName:r,error:A instanceof Error?A.message:String(A)}),d(),this._permissionRegistry.respond(e,{kind:"denied-interactively-by-user",feedback:"Failed to deliver permission request to client"}))});let h;try{h=await c}finally{d()}let m=Toi(h,n);_c.info(this.ctx,`${Ec}: permission resolved`,{sessionId:this.sessionId,requestId:e,toolName:r,behavior:m.behavior});let g=m.behavior==="allow"?"approved":"denied";return f.catch(()=>{}).then(()=>this._emitPermissionCompleted(e,g,s.toolUseID)).catch(A=>{_c.warn(this.ctx,`${Ec}: failed to emit permission.completed`,{sessionId:this.sessionId,requestId:e,error:A instanceof Error?A.message:String(A)})}),m}async _requestUserInputFromIde(e,r,n){let{promise:o,isSettled:s}=this._userInputRegistry.register(e),c=a(()=>{this._userInputRegistry.rejectOne(e,new Error("AskUserQuestion aborted"))},"onAbort"),l=a(()=>n.removeEventListener("abort",c),"cleanupAbort");n.addEventListener("abort",c,{once:!0});let u=this._emitUserInputRequested(e,r);u.catch(m=>{s()||(_c.error(this.ctx,`${Ec}: failed to emit user_input.requested, rejecting`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)}),l(),this._userInputRegistry.rejectOne(e,m instanceof Error?m:new Error(String(m))))});let d,f;try{d=await o}catch(m){f=m instanceof Error?m:new Error(String(m))}finally{l()}let h=d??{answer:"",wasFreeform:!1};if(u.catch(()=>{}).then(()=>this._emitUserInputCompleted(e,h)).catch(m=>{_c.warn(this.ctx,`${Ec}: failed to emit user_input.completed`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)})}),f!==void 0)throw f;return d}async _emitPermissionRequested(e,r){let n={id:Dt(),timestamp:new Date().toISOString(),parentId:null,type:"permission.requested",data:{requestId:e,permissionRequest:r}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitPermissionCompleted(e,r,n){let o={id:Dt(),timestamp:new Date().toISOString(),parentId:null,type:"permission.completed",data:{requestId:e,result:{kind:r},...n!==void 0?{toolCallId:n}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}async _emitUserInputRequested(e,r){let n={id:Dt(),timestamp:new Date().toISOString(),parentId:null,type:"user_input.requested",data:{requestId:e,question:r.question,...r.choices!==void 0?{choices:r.choices}:{},...r.allowFreeform!==void 0?{allowFreeform:r.allowFreeform}:{},...r.toolCallId!==void 0?{toolCallId:r.toolCallId}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitUserInputCompleted(e,r){let n={id:Dt(),timestamp:new Date().toISOString(),parentId:null,type:"user_input.completed",data:{requestId:e,answer:r.answer,wasFreeform:r.wasFreeform}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitExitPlanModeRequested(e,r){let n={id:Dt(),timestamp:new Date().toISOString(),parentId:null,type:"exit_plan_mode.requested",data:{requestId:e,planContent:r.planContent,summary:r.summary,actions:r.actions,recommendedAction:r.recommendedAction,...r.toolCallId!==void 0?{toolCallId:r.toolCallId}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitExitPlanModeCompleted(e,r){let n={id:Dt(),timestamp:new Date().toISOString(),parentId:null,type:"exit_plan_mode.completed",data:{requestId:e,approved:r.approved,...r.selectedAction!==void 0?{selectedAction:r.selectedAction}:{},...r.autoApproveEdits!==void 0?{autoApproveEdits:r.autoApproveEdits}:{},...r.feedback!==void 0?{feedback:r.feedback}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}};p();var nft=class{constructor(e){this.getSessions=e}static{a(this,"ClaudeMcpSyncTarget")}async syncToActiveSessions(e){await Promise.all(this.getSessions().map(r=>r.reloadInjectedMcpServers(e)))}};p();var Goi=fe(require("http")),$gr=require("node:stream/promises");Fo();var z0=new pe("ClaudeMessagesProxyServer"),nta=["interleaved-thinking","context-management","advanced-tool-use"],Ggr="cls_claude_agent",Y0={InvalidRequest:"invalid_request_error",Authentication:"authentication_error",Permission:"permission_error",NotFound:"not_found_error",RequestTooLarge:"request_too_large",RateLimit:"rate_limit_error",Api:"api_error",Overloaded:"overloaded_error"},ita=new Map([[400,Y0.InvalidRequest],[401,Y0.Authentication],[402,Y0.Permission],[403,Y0.Permission],[404,Y0.NotFound],[413,Y0.RequestTooLarge],[424,Y0.InvalidRequest],[429,Y0.RateLimit],[466,Y0.InvalidRequest],[529,Y0.Overloaded]]),joi=1024,ota=32e3,Fee=class{constructor(e){this.ctx=e}static{a(this,"ClaudeMessagesProxyServer")}async start(){if(this._startPromise)return this._startPromise;let e=this._startInternal().catch(r=>{throw this._startPromise===e&&(this._startPromise=void 0),r});return this._startPromise=e,e}async stop(){let e=this._server;e&&(e.closeAllConnections(),await new Promise(r=>e.close(()=>r())),this._server=void 0,this._startPromise=void 0,this._config=void 0)}getConfig(){if(!this._config)throw new Error("ClaudeMessagesProxyServer: start() has not completed yet");return this._config}async _startInternal(){let e=`cls-claude-${Dt()}`,r=Goi.createServer((n,o)=>{this._handleRequest(n,o,e)});return new Promise((n,o)=>{r.once("error",o),r.listen(0,"127.0.0.1",()=>{let s=r.address();if(!s||typeof s!="object"){o(new Error("ClaudeMessagesProxyServer: failed to obtain bound address"));return}this._server=r,this._config={port:s.port,nonce:e},z0.info(this.ctx,`proxy listening on http://127.0.0.1:${s.port}`),r.removeListener("error",o),n(this._config)})})}async _handleRequest(e,r,n){try{if(z0.debug(this.ctx,`incoming request: ${e.method} ${e.url}`),e.method==="OPTIONS"){r.writeHead(200),r.end();return}if(e.method==="GET"&&e.url==="/"){r.writeHead(200,{"Content-Type":"text/plain"}),r.end("Hello from ClaudeMessagesProxyServer");return}if(e.method==="POST"&&this._isMessagesPath(e.url)){await this._handleMessagesRequest(e,r,n);return}this._sendErrorResponse(r,404,Y0.NotFound,"Not found")}catch(o){z0.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,Y0.Api,"Internal proxy error")}}_isMessagesPath(e){if(!e)return!1;let r=e.startsWith("//")?e.slice(1):e,n;try{n=new URL(r,"http://127.0.0.1").pathname}catch{return!1}return n==="/v1/messages"||n==="/messages"}async _handleMessagesRequest(e,r,n){let o=sta(e.headers,n);if(!o.valid){z0.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,Y0.Authentication,"Invalid authentication");return}o.sessionId&&z0.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await gta(e),c;try{c=JSON.parse(s)}catch(l){z0.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,Y0.InvalidRequest,"Request body is not valid JSON");return}await this._forwardToCAPI(c,s,e.headers,r,o.sessionId)}async _forwardToCAPI(e,r,n,o,s){let c=this.ctx.get(Qt),l=this.ctx.get(Jt),u;try{u=await c.getToken()}catch(E){z0.exception(this.ctx,E,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,Y0.Authentication,"Failed to acquire Copilot token");return}let d=await this._lookupModelMetadata(e),f=this._maybeStripCacheControl(e,r),h=this._maybeRewriteThinking(e,f,d,s),m=Zle(this.ctx,u,"v1/messages"),g=cta(this.ctx,n,d),A;try{({headers:A}=await Jle(this.ctx,g,u.token))}catch(E){z0.exception(this.ctx,E,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,Y0.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,_=a(()=>{y.signal.aborted||(z0.debug(this.ctx,"client disconnected \u2014 aborting upstream request"),y.abort())},"onClose");o.on("close",_);try{let E=await l.fetch(m,{method:"POST",headers:A,body:h,signal:y.signal});if(Xle(this.ctx,E,"v1/messages"),!E.ok){let w=await E.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";z0.error(this.ctx,`upstream CAPI returned ${E.status} ${E.statusText}: ${R}`),this._sendErrorResponse(o,E.status,Ata(E.status),this._buildTranslatedErrorMessage(E,w,u));return}let v=E.headers.get("content-type")??"text/event-stream";o.writeHead(E.status,{"Content-Type":v,"Cache-Control":"no-cache",Connection:"keep-alive"});let S=E.body();if(!S){o.end();return}let T=v.toLowerCase().includes("text/event-stream");if(s&&T){let w=this.ctx.get(Rm),R=LMe(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,$gr.pipeline)(S,R,o)}else await(0,$gr.pipeline)(S,o)}catch(E){if(y.signal.aborted){z0.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(z0.exception(this.ctx,E,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,Y0.Api,"Upstream request failed")}finally{o.removeListener("close",_)}}async _lookupModelMetadata(e){let r=typeof e.model=="string"?e.model:void 0;if(r)try{return(await this.ctx.get(Ns).getMetadata()).find(s=>s.id===r)}catch(n){z0.debug(this.ctx,`model metadata lookup failed for "${r}": ${n instanceof Error?n.message:String(n)}`);return}}_maybeRewriteThinking(e,r,n,o){if(!n)return Vgr(e)?(z0.debug(this.ctx,"stripped output_config.effort for request with unresolved model metadata"),JSON.stringify(e)):r;let s=o?this.ctx.get(Rm).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&z0.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return dta(e,n,s)?(z0.debug(this.ctx,`normalized thinking field for model ${n.id} to ${n.capabilities?.supports?.adaptive_thinking?"adaptive":"legacy"} shape`),JSON.stringify(e)):r}_maybeStripCacheControl(e,r){return uta(e)?(z0.debug(this.ctx,"stripped unknown sub-fields from cache_control.ephemeral before forwarding to CAPI"),JSON.stringify(e)):r}_buildTranslatedErrorMessage(e,r,n){let o=e.status,s=this._buildReasonForStatus(e,r,n),c=o===429?{capiErrorCode:yta(r),copilotPlan:n.userInfo?.copilotPlan,suggestSwitchToAuto:!1}:void 0;return cv.translateErrorMessage(o,s,void 0,UM(e),void 0,c)}_buildReasonForStatus(e,r,n){let o=e.status;if(o===402)try{let s=this.ctx.get(Ru).overageEnabled;return cv.translate402Reason(r,{retryAfterHeader:e.headers.get("retry-after")??void 0,retryAfterSeconds:UM(e),copilotPlan:n.userInfo?.copilotPlan,isTBBEnabled:n.userInfo?.isTBBEnabled,canUpgradePlan:n.userInfo?.canUpgradePlan,overageEnabled:s})}catch(s){return z0.exception(this.ctx,s,"._buildReasonForStatus/402"),Hoi(r)??"Quota Exceeded."}if(o===400){let s=cv.translate400Reason(r);if(s!==void 0)return s}return Hoi(r)}_sendErrorResponse(e,r,n,o){let s={type:"error",error:{type:n,message:o}};e.writeHead(r,{"Content-Type":"application/json"}),e.end(JSON.stringify(s))}};function sta(t,e){let r=t.authorization;if(typeof r!="string"||!r.startsWith("Bearer "))return{valid:!1,sessionId:void 0};let n=r.slice(7),o=n.indexOf(".");if(o===-1)return{valid:n===e,sessionId:void 0};let s=n.slice(0,o),c=n.slice(o+1).trim();return s===e?{valid:!0,sessionId:c.length>0?c:void 0}:{valid:!1,sessionId:void 0}}a(sta,"extractSessionId");function ata(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&nta.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(ata,"filterSupportedBetas");function cta(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...om(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?ata(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=lta(u,d?KKe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Ggr}/${h}`:`${Ggr}${h.substring(m)}`}else s["User-Agent"]=Ggr;return s}a(cta,"buildUpstreamHeaders");function lta(t,e){let r=new Set;for(let n of[t,e])if(n)for(let o of n.split(",")){let s=o.trim();s&&r.add(s)}return r.size>0?[...r].join(","):void 0}a(lta,"mergeBetas");function uta(t){let e=!1,r=a(c=>!!c&&typeof c=="object","isObject"),n=a(c=>{if(!r(c))return;let l=c.cache_control;if(r(l)&&l.type==="ephemeral")for(let u of Object.keys(l))u!=="type"&&(delete l[u],e=!0)},"stripBlock"),o=a(c=>{if(Array.isArray(c))for(let l of c)n(l)},"stripBlocks");o(t.system);let s=t.messages;if(Array.isArray(s))for(let c of s){if(!r(c))continue;let l=c.content;if(Array.isArray(l))for(let u of l)n(u),r(u)&&o(u.content)}return o(t.tools),e}a(uta,"sanitizeCacheControl");function dta(t,e,r){if(!e)return!1;let n=t.thinking,o=n&&typeof n=="object"?n.type:void 0;return o==="adaptive"||o==="enabled"?e.capabilities?.supports?.adaptive_thinking?fta(t,n,e,r):mta(t,n):pta(t,e)}a(dta,"normalizeThinkingForModel");function fta(t,e,r,n){let o=r.capabilities?.supports?.reasoning_effort,s=!!o&&o.length>0,c=e.type==="adaptive"&&Object.keys(e).length===1,l=t.output_config;if(!s){let h=!!l&&typeof l=="object"&&"effort"in l;return c&&!h?!1:(t.thinking={type:"adaptive"},Vgr(t),!0)}let u=hta(n,o),d=YO(o,u)??"medium",f=typeof l?.effort=="string"&&l.effort===d;return c&&f?!1:(t.thinking={type:"adaptive"},t.output_config={...l??{},effort:d},!0)}a(fta,"_writeAdaptiveShape");function Vgr(t){let e=t.output_config;if(!e||typeof e!="object")return!1;let r=e;return"effort"in r?(delete r.effort,Object.keys(r).length===0&&delete t.output_config,!0):!1}a(Vgr,"_deleteEffortKey");function pta(t,e){let r=e.capabilities?.supports?.reasoning_effort;return!!r&&r.length>0?!1:Vgr(t)}a(pta,"_stripUnsupportedThinkingEffort");function hta(t,e){if(t&&!(!e||!e.includes(t)))return t}a(hta,"_normaliseUserEffortForCapi");function mta(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:joi,o=Math.min(ota,Math.max(joi,n)),s=e.type==="enabled"&&e.budget_tokens===o,c=t.output_config!==void 0;return s&&!c?!1:(t.thinking={type:"enabled",budget_tokens:o},c&&delete t.output_config,!0)}a(mta,"_writeLegacyShape");function gta(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{n.push(typeof o=="string"?Buffer.from(o,"utf8"):o)}),t.on("end",()=>e(Buffer.concat(n).toString("utf8"))),t.on("error",r)})}a(gta,"readRequestBody");function Ata(t){return ita.get(t)??Y0.Api}a(Ata,"mapStatusToAnthropicErrorType");function Hoi(t){if(t)try{let e=JSON.parse(t),r=e.error;if(r&&typeof r=="object"&&"message"in r){let n=r.message;if(typeof n=="string")return n}if(typeof e.message=="string")return e.message}catch{}}a(Hoi,"extractErrorMessage");function yta(t){if(t)try{let e=JSON.parse(t),r=e.error;if(r&&typeof r=="object"&&"code"in r){let n=r.code;if(typeof n=="string")return n}if(typeof e.code=="string")return e.code}catch{}}a(yta,"extractErrorCode");p();function $oi(t){return t.replace(/[-.]/g,"").toLowerCase()}a($oi,"normalizeModelId");function Voi(t,e){if(!t||e.some(s=>s.id===t))return t;let r=t.replace(/-\d{8}$/,""),n=$oi(r);return e.find(s=>$oi(s.id)===n)?.id??t}a(Voi,"mapCapiModelIdToPickerId");Fo();var K0=new pe("ClaudeCodeAgent"),J0="ClaudeCodeAgentService";function _ta(t){return{id:`claude-code:/agents/${encodeURIComponent(t.name)}`,name:t.name,description:t.description,providers:["CLAUDE"],invokePolicy:Uqt,isReadonly:!0,isBuiltIn:!0}}a(_ta,"toRuntimeClaudeAgent");var t6=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this._onRuntimePluginsChanged=new Lc;this.sessionPluginSubscriptions=new Map;this.workspacePluginSnapshots=new Map;this.notificationSender=e.get(ss);try{this.runtimeSourceRegistration=e.get(Kd).registerRuntimeAgentSource({provider:"CLAUDE",getAgents:a(async o=>(await this.getSupportedAgentsForWorkspace(o)).map(_ta),"getAgents")})}catch(o){if(!(o instanceof Ic&&o.ctor===Kd))throw o}try{this.runtimePluginSourceRegistration=e.get(Ca).registerRuntimePluginSource({provider:"CLAUDE",onDidChange:this._onRuntimePluginsChanged.event,listPlugins:a(o=>Promise.resolve(this.getSupportedPluginsForWorkspace(o)),"listPlugins")})}catch(o){if(!(o instanceof Ic&&o.ctor===Ca))throw o}let n=new nft(()=>[...this._sessions.values()]);this._mcpSync=new hge(this.ctx,"ClaudeCode.McpSync",n)}static{a(this,"ClaudeCodeAgentService")}async getSupportedAgentsForWorkspace(e){let r=new Set(e.map(c=>lF(un(c.uri)))),n=[...this._sessions.values()].filter(c=>r.has(lF(c.cwd)));if(n.length===0)return[];let o=await Promise.all(n.map(c=>c.supportedAgents())),s=new Map;for(let c of o)for(let l of c){let u=l.name.toLowerCase();s.has(u)||s.set(u,l)}return[...s.values()]}getSupportedPluginsForWorkspace(e){return e.flatMap(r=>this.workspacePluginSnapshots.get(lF(un(r.uri)))??[])}registerSession(e){this.sessionPluginSubscriptions.get(e.sessionId)?.dispose(),this._sessions.set(e.sessionId,e),this.sessionPluginSubscriptions.set(e.sessionId,e.onPluginSnapshot(r=>{this.workspacePluginSnapshots.set(lF(e.cwd),r),this._onRuntimePluginsChanged.fire()}))}removeSession(e){let r=this._sessions.get(e);if(r)return this.sessionPluginSubscriptions.get(e)?.dispose(),this.sessionPluginSubscriptions.delete(e),this._sessions.delete(e),r}async createSession(e){return Ch(this.ctx,"claudeCodeAgent.createSession",async r=>{await loi(this.ctx,e);let n=e.sessionId??Dt(),o=this._sessions.get(n);if(o)return K0.info(this.ctx,`${J0}.createSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="idempotentHit",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:o.cwd};let s=un(e.workspaceFolder.uri),c=await this._ensureProxyConfig(),l=new BMe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,isNewSession:!0,proxyConfig:c});return this.registerSession(l),K0.info(this.ctx,`${J0}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return Ch(this.ctx,"claudeCodeAgent.resumeSession",async r=>{await uoi(this.ctx,e);let{sessionId:n}=e,o,s,c=this._sessions.get(n);if(c)K0.info(this.ctx,`${J0}.resumeSession: returning existing in-memory session`,{sessionId:n}),o=c.cwd,s="memory";else{let u=await this.sdkWrapper.getSessionInfo(n);if(!u?.cwd)throw new Error(`Session not found: ${n}`);let d=u.cwd,f=await this._ensureProxyConfig(),h=new BMe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:d,model:e.model,isNewSession:!1,proxyConfig:f});this.registerSession(h),K0.info(this.ctx,`${J0}.resumeSession: resumed from SDK transcript`,{sessionId:n,cwd:d}),o=d,s="disk"}let l;try{let u=this.sdkWrapper.getSessionMessages(n,{includeSystemMessages:!0}),d=this.ctx.get(Ns).getMetadata().catch(m=>(K0.debug(this.ctx,`${J0}.resumeSession: model metadata unavailable for id mapping`,{sessionId:n,error:m instanceof Error?m.message:String(m)}),[])),[f,h]=await Promise.all([u,d]);l=Uoi(f,m=>Voi(m,h)),r.properties.transcriptOk="true"}catch(u){K0.warn(this.ctx,`${J0}.resumeSession: failed to translate on-disk transcript`,{sessionId:n,error:u instanceof Error?u.message:String(u)}),r.properties.transcriptOk="false",r.properties.transcriptErrorName=u instanceof Error?u.name:"Unknown"}return r.properties.reason=s,r.properties.modelId=e.model??"",r.measurements.eventCount=l?.length??0,{sessionId:n,workspacePath:o,events:l}})}async sendMessage(e,r){return Ch(this.ctx,"claudeCodeAgent.sendMessage",async n=>{await doi(this.ctx,e);let o=e.sessionId,s=this._sessions.get(o);if(!s)throw new Error(`Session not found: ${o} \u2014 call createSession or resumeSession before sendMessage`);let c={uri:Ko(s.cwd)};await this.ctx.get(D0).applyPromptTemplateToRequest(e,[c]);let l=Dt(),u=performance.now();return s.invoke({message:e.message,references:e.references,model:e.model,permissionMode:e.agentMode,reasoningEffort:e.reasoningEffort,messageId:l,token:r}).catch(d=>{K0.warn(this.ctx,`${J0}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),zp(this.ctx,"claudeCodeAgent.sendMessage.failure",d,{success:"false",reason:"invoke"},{totalTimeMs:performance.now()-u})}),n.properties.reason="dispatched",n.properties.modelId=e.model??"",n.properties.hasReferences=String((e.references?.length??0)>0),n.measurements.messageCharLen=e.message.length,n.measurements.referenceCount=e.references?.length??0,{messageId:l}})}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}forkSession(e){return Promise.reject(this.unsupported("forkSession"))}async listSessions(e){return Ch(this.ctx,"claudeCodeAgent.listSessions",async r=>{hoi(this.ctx,e),K0.info(this.ctx,`${J0}.listSessions`,e);let o=(await this.sdkWrapper.listSessions({dir:e.cwd})).map(s=>({sessionId:s.sessionId,summary:s.summary,startTime:new Date(s.createdAt??s.lastModified).toISOString(),modifiedTime:new Date(s.lastModified).toISOString(),isRemote:!1,context:s.cwd!==void 0?{cwd:s.cwd,branch:s.gitBranch}:void 0}));return K0.info(this.ctx,`${J0}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return Ch(this.ctx,"claudeCodeAgent.listModels",async r=>{moi(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),K0.info(this.ctx,`${J0}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(Ns).getMetadata(e)).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>vWe(c.capabilities.family)).map(spe);return K0.info(this.ctx,`${J0}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await Ch(this.ctx,"claudeCodeAgent.stopSession",async r=>{foi(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){K0.info(this.ctx,`${J0}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return Ch(this.ctx,"claudeCodeAgent.destroySession",r=>{poi(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this.removeSession(n),K0.info(this.ctx,`${J0}.destroySession`,{sessionId:n}),{success:!0}):(K0.info(this.ctx,`${J0}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return K0.error(this.ctx,`${J0}.destroySession: failed`,{sessionId:n,error:o instanceof Error?o.message:String(o)}),r.error=o,r.properties.reason="exception",{success:!1}}})}async setModel(e,r){await Ch(this.ctx,"claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){K0.info(this.ctx,`${J0}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await MMe(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await Ch(this.ctx,"claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){K0.info(this.ctx,`${J0}.setPermissionMode: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await o.setPermissionMode(r),n.properties.permissionMode=r??""})}get sessionCount(){return this._sessions.size}unsupported(e){return new Error(`${e} is not supported by ClaudeCodeAgentService`)}handleInteraction(e){let r=this._sessions.get(e.sessionId);if(!r)return K0.warn(this.ctx,`${J0}.handleInteraction: unknown session`,{sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type}),Promise.resolve({success:!1});let n=r.respondToInteraction(e);return Promise.resolve({success:n})}getPlanPath(){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(){throw this.unsupported("getRemoteStatus")}compactHistory(){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(){return Promise.reject(this.unsupported("stopCompactHistory"))}dispose(){this.runtimeSourceRegistration?.dispose(),this.runtimeSourceRegistration=void 0,this.runtimePluginSourceRegistration?.dispose(),this.runtimePluginSourceRegistration=void 0;for(let e of this.sessionPluginSubscriptions.values())e.dispose();this.sessionPluginSubscriptions.clear(),this._mcpSync.dispose();for(let e of this._sessions.values())e.dispose();this._sessions.clear(),this.workspacePluginSnapshots.clear(),this._onRuntimePluginsChanged.dispose()}async _ensureProxyConfig(){return this.ctx.get(Fee).start()}};p();var Wgr=new Sn;function Woi(t){return[...t].sort((e,r)=>{let n=Wgr.get(e.uri)??0;return(Wgr.get(r.uri)??0)-n})}a(Woi,"sortByAccessTimes");var zoi=a(t=>t.get($r).onDidFocusTextDocument(e=>{e.document&&Wgr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var Yoi=fe(require("events"));var ift="CompletionRequested",M4=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new Yoi.default;notifyRequest(e,r,n,o,s){return this.#e.emit(ift,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=i0(this.ctx,e,`event.${ift}`);return this.#e.on(ift,r),jn.Disposable.create(()=>this.#e.off(ift,r))}};p();p();var zgr=class{constructor(){this.observers=new Set}static{a(this,"Subject")}subscribe(e){return this.observers.add(e),()=>this.observers.delete(e)}next(e){for(let r of this.observers)r.next(e)}error(e){for(let r of this.observers)r.error?.(e)}complete(){for(let e of this.observers)e.complete?.()}},oft=class extends zgr{static{a(this,"ReplaySubject")}subscribe(e){let r=super.subscribe(e);return this._value!==void 0&&e.next(this._value),r}next(e){this._value=e,super.next(e)}};var Zb=class{constructor(e){this.ctx=e;this.#e=new pe("AsyncCompletionManager");this.requests=new Sn(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(Ygr(e,r,o))return!0;return!1}updateCompletion(e,r){let n=this.requests.get(e);n!==void 0&&(n.partialCompletionText=r,n.subject.next(n))}queueCompletionRequest(e,r,n,o,s){this.#e.debug(this.ctx,`[${e}] Queueing async completion request:`,r.substring(r.lastIndexOf(` +`)+1));let c=new oft;return this.requests.set(e,{state:2,cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c}),s.then(l=>{if(this.requests.delete(e),l.type!=="success"){this.#e.debug(this.ctx,`[${e}] Request failed with`,l.reason),c.error(l.reason);return}let u={cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c,choice:l.value[0],result:l,state:0,allChoicesPromise:l.value[1]};this.requests.set(e,u),c.next(u),c.complete()}).catch(l=>{this.#e.error(this.ctx,`[${e}] Request errored with`,l),this.requests.delete(e),c.error(l)})}getFirstMatchingRequestWithTimeout(e,r,n,o,s){let c=this.ctx.get(tr).asyncCompletionsTimeout(s);return c<0?(this.#e.debug(this.ctx,`[${e}] Waiting for completions without timeout`),this.getFirstMatchingRequest(e,r,n,o)):(this.#e.debug(this.ctx,`[${e}] Waiting for completions with timeout of ${c}ms`),Promise.race([this.getFirstMatchingRequest(e,r,n,o),new Promise(l=>setTimeout(()=>l(null),c))]).then(l=>{if(l===null){this.#e.debug(this.ctx,`[${e}] Timed out waiting for completion`);return}return l}))}async getFirstMatchingRequest(e,r,n,o){o||(this.mostRecentRequestId=e);let s=!1,c=new UA,l=new Map,u=a(f=>()=>{let h=l.get(f);h!==void 0&&(h(),l.delete(f),!s&&l.size===0&&(s=!0,this.#e.debug(this.ctx,`[${e}] No matching completions found`),c.resolve(void 0)))},"finishRequest"),d=a(f=>{if(Ygr(r,n,f)){if(f.state===0){let h=r.substring(f.prefix.length),{completionText:m}=f.choice;if(!m.startsWith(h)||m.length<=h.length){u(f.headerRequestId)();return}m=m.substring(h.length),f.choice.telemetryData.measurements.foundOffset=h.length,this.#e.debug(this.ctx,`[${e}] Found completion at offset ${h.length}: ${JSON.stringify(m)}`),c.resolve([{...f.choice,completionText:m},f.allChoicesPromise]),s=!0}}else this.cancelRequest(e,f),u(f.headerRequestId)()},"next");for(let[f,h]of this.requests)Ygr(r,n,h)?l.set(f,h.subject.subscribe({next:d,error:u(f),complete:u(f)})):this.cancelRequest(e,h);return c.promise.finally(()=>{for(let f of l.values())f()})}cancelRequest(e,r){e===this.mostRecentRequestId&&r.state!==0&&(this.#e.debug(this.ctx,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};function Ygr(t,e,r){if(r.prompt.suffix!==e.suffix||!t.startsWith(r.prefix))return!1;let n=t.substring(r.prefix.length);return r.state===0?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(Ygr,"isCandidate");p();p();var UMe=class{constructor(e){this.maxSize=e;this.root=new FMe;this.leafNodes=new Set}static{a(this,"LRURadixTrie")}set(e,r){let{node:n,remainingKey:o}=this.findClosestNode(e);if(o.length>0){for(let[s,c]of n.children)if(s.startsWith(o)){let l=s.slice(0,o.length),u=new FMe;n.removeChild(s),n.addChild(l,u),u.addChild(s.slice(l.length),c),n=u,o=o.slice(l.length);break}if(o.length>0){let s=new FMe;n.addChild(o,s),n=s}}n.value=r,this.leafNodes.add(n),this.leafNodes.size>this.maxSize&&this.evictLeastRecentlyUsed()}findAll(e){return this.findClosestNode(e).stack.map(({node:r,remainingKey:n})=>r.value!==void 0?{remainingKey:n,value:r.value}:void 0).filter(r=>r!==void 0)}delete(e){let{node:r,remainingKey:n}=this.findClosestNode(e);n.length>0||this.deleteNode(r)}findClosestNode(e){let r=!0,n=this.root,o=[{node:n,remainingKey:e}];for(;e.length>0&&r;){r=!1;for(let[s,c]of n.children)if(e.startsWith(s)){e=e.slice(s.length),o.unshift({node:c,remainingKey:e}),n=c,r=!0;break}}return{node:n,remainingKey:e,stack:o}}deleteNode(e){if(e.value=void 0,this.leafNodes.delete(e),e.parent===void 0||e.childCount>1)return;let{node:r,edge:n}=e.parent;if(e.childCount===1){let[s,c]=Array.from(e.children)[0];e.removeChild(s),r.removeChild(n),r.addChild(n+s,c);return}if(r.removeChild(n),r.parent===void 0)return;let o=r.parent;if(r.value===void 0&&r.childCount===1){let[s,c]=Array.from(r.children)[0],l=o.edge+s;r.removeChild(s),o.node.removeChild(o.edge),o.node.addChild(l,c)}}evictLeastRecentlyUsed(){let e=this.findLeastRecentlyUsed();e&&this.deleteNode(e)}findLeastRecentlyUsed(){let e;for(let r of this.leafNodes)(e===void 0||r.touchedo.content.filter(s=>s.suffix===r&&s.choice.completionText.startsWith(n)&&s.choice.completionText.length>n.length).map(s=>({...s.choice,completionText:s.choice.completionText.slice(n.length),telemetryData:s.choice.telemetryData.extendedBy({},{foundOffset:n.length})})))}append(e,r,n){let o=this.cache.findAll(e);if(o.length>0&&o[0].remainingKey===""){let s=o[0].value.content;this.cache.set(e,{content:[...s,{suffix:r,choice:n}]})}else this.cache.set(e,{content:[{suffix:r,choice:n}]})}clear(){this.cache=new UMe(100)}};p();var Xb=class{constructor(){this.choices=[]}static{a(this,"CurrentGhostText")}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==2&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&Koi(this.choices[0].completionText,n))return Eta(this.choices,n)}hasAcceptedCurrentCompletion(e,r){let n=this.getRemainingPrefix(e,r);if(n===void 0)return!1;let o=n===this.choices?.[0].completionText,s=this.choices?.[0].finishReason;return o&&s==="stop"}getRemainingPrefix(e,r){if(!(this.prefix===void 0||this.suffix===void 0||this.choices.length===0)&&this.suffix===r&&e.startsWith(this.prefix))return e.substring(this.prefix.length)}};function Eta(t,e){return t.filter(r=>Koi(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(Eta,"adjustChoicesStart");function Koi(t,e){return t.startsWith(e)&&t.length>e.length}a(Koi,"startsWithAndExceeds");p();p();var r6={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95};p();function Joi(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let _;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?_=.003325460510319164:_=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?_=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?_=.0697359767152808:t[230]>1e-35?_=.06513506845651572:_=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?_=.013616385013146277:_=.04171540100223404:_=-.04360396575094823:t[212]>1e-35?_=.025945477945627522:_=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?_=-.07856453318384411:_=-.014803893522351739:t[39]>1e-35?_=-.09185452630751932:t[149]>1e-35?_=-.07122426086157027:t[134]>1e-35?_=-.04231052091434186:t[227]>1e-35?_=-.029815824273994197:t[50]>1e-35?_=-.15736496271211153:t[222]>1e-35?_=-.02360285356956629:t[128]>1e-35?_=-.03922080193836443:t[136]>1e-35?_=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?_=-.0029736170756835783:_=-.06482902102259112:t[84]>1e-35?_=-.11340924635708383:t[94]>1e-35?_=-.03635703457792193:t[118]>1e-35?_=-.058181913914186034:t[126]>1e-35?_=-.062030576241517366:t[116]>1e-35?_=-.045086301850604006:t[25]>1e-35?_=-.031665223656767286:t[203]>1e-35?_=-.009444685731407691:_=.0112265153772187;let E;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?E=.022717227245241684:E=-.049700413274686266:E=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?E=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?E=-.12263724050601095:E=.0070743478891288035:t[288]>1e-35?E=-.050439138582109:E=.0255701593657891:E=-.005812703740580558:t[6]>49.50000000000001?E=-.008542694147899113:E=.035147383686665:E=-.0960461939274094:t[32]>1e-35?E=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?E=-.01800870272656664:E=-.07817304234604389:t[30]>1e-35?E=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?E=.08778416018479411:E=-.026563982720830256:E=-.05296139548112329:t[50]>1e-35?E=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?E=-.036572140520852024:t[183]>1e-35?E=-.10766853736801459:E=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?E=.09513215942486053:E=-.03641865277445567:t[10]>59.50000000000001?E=.03177172388687933:t[39]>1e-35?E=-.10234241303898953:t[243]>1e-35?E=-.02966738115984321:t[190]>1e-35?E=-.04312785336449181:t[118]>1e-35?E=-.05808521194081524:E=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let S;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?S=-.0024117174588695603:S=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?S=.04575380761203418:S=-.10025595041353463:t[15]>1e-35?S=.17705790384964004:S=.0073813837628615014:S=.07676373681392407:S=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?S=.07078572910026419:t[4]>23.500000000000004?S=.005513918674164821:S=.0206586476926392:t[0]>5269.500000000001?S=.07706773525822633:S=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?S=-.03204783603215824:S=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?S=-.0930246911392012:S=.011173087289703683:t[3]>24.500000000000004?S=.03281421918878597:S=.12449335091369843:t[204]>1e-35?S=.06634531187326123:S=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?S=-.041196758517013515:t[4]>7.500000000000001?S=-2942718111029724e-20:t[4]>6.500000000000001?S=.11953909558532852:S=.03188615019450534:t[122]>1e-35?S=-.0616037324662157:t[101]>1e-35?S=.027230889593349412:t[8]>4968.500000000001?S=-.1113986516540856:t[3]>2.5000000000000004?S=-.002045140426885727:t[129]>1e-35?S=.12641163374304432:S=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let k;t[306]>1e-35?t[149]>1e-35?k=-.1389218965136736:k=-.032218642644416894:t[13]>1e-35?k=.006465035217331847:t[50]>1e-35?k=-.1381687930130022:t[179]>1e-35?k=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?k=-.03262719498763048:k=.023342916702125613:t[191]>1e-35?k=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?k=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?k=-.09989343595668776:k=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?k=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?k=-.09165257825246746:t[9]>32.50000000000001?k=.02484870392366004:k=-.008499493096971395:t[8]>24.500000000000004?k=.02459679192828244:k=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?k=.0015644546318714849:k=-.06579524865022705:k=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?k=.03331853632960164:k=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?k=-.019091477207111116:k=.037878468575478504:t[94]>1e-35?k=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?k=.16919658785098224:t[243]>1e-35?k=-.06580584936754524:k=.01567555159935563:t[129]>1e-35?k=.06721746994993226:t[10]>32.50000000000001?k=-.046394462507797975:k=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let O;t[308]>1e-35?O=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?O=.023223358334607133:O=-.04383410185346742:O=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?O=.023406489302867494:O=-.085521220804058:O=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?O=.028120059780969632:O=-.04211009474298743:t[294]>1e-35?O=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?O=-.0993035220737934:O=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?O=.029770210551187937:O=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?O=.06421359317599738:O=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?O=.024368404612215164:O=-.04045232374803373:t[131]>1e-35?O=.017372701982485795:t[120]>1e-35?O=.08812710275150198:t[18]>1e-35?t[90]>1e-35?O=.18451364351180236:t[7]>33.50000000000001?O=-.03850813130183531:t[195]>1e-35?O=.06966114053446336:t[3]>16.500000000000004?O=-.0012869181693341211:t[0]>4242.500000000001?O=-.054625548611291035:O=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?O=.006302103427145562:O=.13967622319898698:t[121]>1e-35?O=-.038798585213145644:t[5]>4544.500000000001?O=-.08050498033009466:O=-.002986974112681435;let B;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?B=-.03461119351456781:B=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?B=-.12404435523286539:B=-.0034376913880382956:B=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?B=.0037507103585310234:B=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?B=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?B=-.04832024079663151:t[37]>1e-35?B=-.037103393468366934:B=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?B=.032539071163832034:t[5]>1643.5000000000002?B=.036408625378035665:t[0]>1500.5000000000002?B=-.1346358322854993:B=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?B=-.1133991164577881:t[9]>52.50000000000001?B=-.024478640359723122:B=.03673777861098756:B=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?B=.002583438691776944:B=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?B=-.02141222346712401:B=.06392462314316179:t[4]>12.500000000000002?B=.08700122294434816:t[8]>267.50000000000006?B=.056923170082743224:B=-.07716309825583327:t[32]>1e-35?B=-.03961343943752142:B=.002674914122888783:t[1]>42.50000000000001?B=-.05217539654421676:t[145]>1e-35?B=.09553630282946368:B=-.009424791262477729;let q;t[183]>1e-35?q=-.05753337139158443:t[308]>1e-35?q=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?q=-.10477869875380448:q=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?q=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?q=-.04442302951713574:q=.00012409888451734224:q=-.092199119633697:t[225]>1e-35?q=.13773072450201831:t[0]>2882.5000000000005?q=.0028540012229920533:t[298]>1e-35?q=.07134486044361629:q=.014297412329837425:t[145]>1e-35?q=.05608385321902638:t[92]>1e-35?q=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?q=-.0039957800609801315:q=.0776927564241081:t[203]>1e-35?q=-.05502900859432093:t[105]>1e-35?q=.06062892720841595:q=-.009574839629252128:t[31]>1e-35?q=.009488858841144216:t[23]>1e-35?t[20]>1e-35?q=.08818126313644752:t[8]>161.50000000000003?q=.014353968957885408:q=-.022240738532827903:t[210]>1e-35?q=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?q=-.043902062079383485:q=-.014741559220396223:q=-.00934935734853194:t[6]>32.50000000000001?q=.1514593126307404:q=.010771222510801532:t[10]>22.500000000000004?q=.01412495209334078:q=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let L;t[294]>1e-35?L=-.042529778074638265:t[266]>1e-35?L=-.1180276669679798:t[134]>1e-35?L=-.026818144353279623:t[183]>1e-35?L=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?L=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?L=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?L=-.03049646619610203:t[1]>50.50000000000001?L=.20634590755061122:L=.06956378103625731:t[0]>3770.5000000000005?L=-.07946414366134913:t[19]>1e-35?L=.17083312065604694:t[2]>21.500000000000004?L=-.02327981978127724:L=.129717297518715:t[145]>1e-35?L=.006891245076133524:L=-.0789123467863741:t[3]>99.50000000000001?L=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?L=.06447639919732716:L=-.05457561977645972:t[306]>1e-35?L=-.029995903305383882:t[191]>1e-35?L=.030596508110850414:t[242]>1e-35?L=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?L=.09518584795377832:L=-.018197744600833596:t[13]>1e-35?L=.006751790086127549:t[148]>1e-35?L=.01904174573618417:t[99]>1e-35?L=.025287735102561926:t[4]>14.500000000000002?L=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?L=-.09467943982430241:t[243]>1e-35?L=-.02521824751996268:L=.005437570718352172:L=-.022476214821960674;let U;t[0]>384.50000000000006?t[84]>1e-35?U=-.06088131453064195:t[147]>1e-35?U=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?U=.04219361472548491:U=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?U=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?U=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?U=-.11431764534511478:U=.013549717238356157:U=-.020987333767091276:t[6]>2.5000000000000004?U=-.02914877855133127:U=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?U=-.10087072787978416:t[37]>1e-35?U=-.030467397753331196:t[229]>1e-35?U=-.1017559811057469:t[4]>20.500000000000004?U=-.00413177742240167:t[20]>1e-35?U=.05213315982685969:U=.0037921635866823133:t[8]>51.50000000000001?U=.07327913092421544:t[6]>49.50000000000001?U=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?U=.02744420891894289:U=.11288946357194463:U=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?U=-.012329314369909049:U=.026816658655600168:U=-.0872405354618811:U=.007872673500247845:t[1]>42.50000000000001?U=-.04309044198258254:t[145]>1e-35?U=.07572529147860785:t[7]>5.500000000000001?U=-.013837187093264945:t[1]>17.500000000000004?U=.04208698439539668:U=-.06284346769019863;let j;t[294]>1e-35?j=-.0384794324818203:t[266]>1e-35?j=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?j=.07432960094940501:j=-.035248735855751855:t[134]>1e-35?j=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?j=-.01706896375068821:j=.08212247914968074:t[2]>59.50000000000001?j=-.09546478958824225:t[6]>53.50000000000001?j=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?j=.02816463285971267:j=.15449139016588445:j=-.10199787406123524:j=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?j=-.13924786681478077:j=-.0072772442570213335:t[39]>1e-35?j=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?j=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?j=-.11174465335620831:j=.00013144040097180107:j=-.08493919336681105:t[42]>1e-35?j=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?j=-.015540659878839153:j=-.14442609417300142:t[21]>1e-35?j=-.025251979447574083:j=.0023698372645272847:t[18]>1e-35?j=.07269739695712212:t[8]>2592.5000000000005?j=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?j=-.01835130329646532:t[9]>45.50000000000001?j=.02023047454629885:j=.16469378262221102:j=-.042975030085836426;let Q;t[8]>2915.5000000000005?t[297]>1e-35?Q=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?Q=-.01034964686484714:Q=-.07357437440667927:Q=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?Q=-.09476398869062203:t[9]>72.50000000000001?Q=-.0757383854264379:Q=.02806542779508718:Q=-.05147742568418084:Q=.10212721564444344:Q=.0518263760642861:Q=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?Q=-.10669213185972036:Q=.027050434286384796:t[302]>1e-35?Q=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?Q=.06354599160071946:t[1]>67.50000000000001?Q=.05317447949011187:Q=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?Q=-.09369289448773599:t[0]>2215.5000000000005?Q=.04077965380363924:t[0]>807.5000000000001?Q=-.0591771776458298:Q=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?Q=-.016323380219241672:Q=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?Q=.03720704290087811:Q=-.008730548158766654:t[4]>80.50000000000001?Q=-.05346644687473197:Q=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?Q=.019984510398089086:Q=-.03917825025861855:t[9]>170.50000000000003?Q=-.09759719821334525:Q=-.0023586682752856298;let Y;t[183]>1e-35?t[17]>1e-35?Y=.030100940443356424:t[10]>1.5000000000000002?Y=-.10861112216742408:Y=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?Y=-.032062878390325456:Y=-.10808232631806887:t[8]>1641.5000000000002?Y=-.06147013392655731:t[4]>12.500000000000002?Y=.03324767551088266:t[145]>1e-35?Y=.028851633810612017:Y=-.054871239091792784:t[134]>1e-35?Y=-.023813968121342108:t[266]>1e-35?Y=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?Y=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?Y=-.025350325484720576:Y=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?Y=.056817276537534815:Y=-.07674158463557636:Y=-.06335553143454145:t[1]>56.50000000000001?Y=.16390494217299284:Y=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?Y=.041717597065890205:Y=-.10357913492269129:t[10]>29.500000000000004?Y=.1365512866715726:Y=.020600048310575665:Y=.09708785634773187:Y=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?Y=-.03146213719547347:Y=.11784024316238083:Y=-.050940520532045355:Y=-.047988344143075616:t[191]>1e-35?Y=.028764654731460032:Y=.0011911575567860023;let W;t[294]>1e-35?t[10]>50.50000000000001?W=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?W=-.05103908560370243:W=.05002066201169583:W=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?W=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?W=.127983140816313:W=-.05436534163636867:W=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?W=-.009504203657088933:t[8]>819.5000000000001?W=.18689664822602375:W=.03635576744011826:W=-.029862411809998525:t[223]>1e-35?W=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?W=-.09405026597863717:t[0]>4153.500000000001?W=.053577663326799765:W=-.05062127873995668:W=.06512222894425874:t[39]>1e-35?W=-.04985311717827547:t[51]>1e-35?W=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?W=-.02860634573675884:W=.08863753005590103:W=.11158892111063744:t[0]>655.5000000000001?W=-.031005736641654926:W=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?W=-.00843386136334982:W=-.05273594615999777:W=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?W=-.015774115523598486:W=.10147367091236065:W=-.048307000563071016:W=.002118376117677254;let V;t[8]>1014.5000000000001?t[9]>137.50000000000003?V=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?V=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?V=.07211107542565391:V=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?V=-.0751486415451188:t[1]>59.50000000000001?V=.13459005084554104:V=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?V=.06715575425741895:V=-.005895690393702183:t[8]>2915.5000000000005?V=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?V=-.00029068886245881074:V=.0613467393188786:t[148]>1e-35?V=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?V=.003887223773199377:V=-.08553893131979015:V=.025654192706396767:V=-.05651733979610658:V=-.02039913645229667:t[2]>7.500000000000001?V=-.1058450646728524:V=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?V=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?V=.1283258201586378:V=-.01718135372229775:V=-.07702452408491414:t[125]>1e-35?V=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?V=.04273051857848212:V=-.04533122948101463:t[2]>196.50000000000003?V=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?V=.0231032972703664:V=-.04807386814498683:V=.002729435991332102;let z;t[179]>1e-35?z=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?z=.026484626664041125:t[10]>1.5000000000000002?z=-.10187000872941615:z=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?z=.09574540795390041:z=-.06454986703691233:z=-.11411849349353141:t[266]>1e-35?z=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?z=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?z=-.04403391373512386:z=.1132928075412222:t[2]>47.50000000000001?z=-.09700191391838056:z=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?z=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?z=-.001668912999010927:z=-.02363511102970245:t[8]>58.50000000000001?z=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?z=.0911011436534449:t[1]>28.500000000000004?z=-.07192390493729035:z=.06913818091291246:z=-.012312625373699222:z=.06784496312307986:z=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?z=.0026564453057705273:z=-.025425772389361445:t[122]>1e-35?z=-.12046786388602149:t[0]>3183.5000000000005?z=.01162092842804907:t[91]>1e-35?z=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?z=-.0001647792543020228:z=-.023664538532907665:z=.01609078206180752;let ie;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ie=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ie=-.017696526862422682:ie=.1450050954613223:ie=-.05406930069823832:ie=-.08308700260259043:t[120]>1e-35?ie=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ie=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ie=.038431826961746934:ie=-.05937462906539856:t[9]>65.50000000000001?ie=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ie=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ie=-.09579030954062734:ie=.025064711572811746:ie=.02579440518821548:ie=.1044440128091862:ie=-.058348633139536844:ie=.07766788227934436:ie=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ie=.07463684068207214:ie=.18244269035484484:t[6]>39.50000000000001?ie=-.06050050067471004:ie=.05787759066913493:ie=.010783225857972171:ie=.1674891243602606:t[4]>9.500000000000002?ie=-.004814132027475892:ie=-.14543299413454813:ie=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ie=-.07634466313617769:ie=.0287825335169114:ie=-.06894721943300268:ie=-.00023988459059521937;let H;t[131]>1e-35?t[1]>93.50000000000001?H=-.05706887458825395:t[2]>1.5000000000000002?H=.011446637886629108:H=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?H=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?H=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?H=.026278724448495064:H=.17053138400480508:t[0]>4463.500000000001?H=-.06482289890096041:H=.03026516489536295:H=-.031785170717683144:H=.1312690622980455:t[13]>1e-35?H=.14336922540461444:H=.03523850945454039:H=-.015407465968975714:t[39]>1e-35?H=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?H=-.0659975068798723:H=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?H=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?H=.057409156184759516:H=.2024322059866388:H=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?H=.010648654146284154:t[308]>1e-35?H=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?H=.12364025998551711:H=-.02247495081065243:t[1]>22.500000000000004?H=-.0726295464624251:H=.03481895086048152:t[0]>4331.500000000001?H=-.04775443357020673:H=.07172377425057568:t[2]>89.50000000000001?H=-.11782645274716962:H=.00010092665257989378;let re;t[147]>1e-35?re=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?re=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?re=-.016101990375700172:t[0]>2579.5000000000005?re=-.13045089661551845:re=-.02874367814784938:re=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?re=.17084176915326055:re=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?re=.10591712319944074:re=-.024082167264285:re=.16497698867036126:re=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?re=-.021012910475524206:re=-.13058422554298485:t[0]>1102.5000000000002?re=.10955864175201457:re=-.03566689354348996:t[1]>11.500000000000002?re=-.02093884208606101:re=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?re=-.013861861436128482:re=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?re=.10163873449625677:re=-.02779270277623805:t[1]>26.500000000000004?re=-.08035058228527389:re=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?re=-.007028075523033826:re=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?re=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?re=-.0032075580718124892:re=-.04442829143298883:re=-.06597073245775804:re=.0015594090939337751;let le;t[223]>1e-35?t[8]>668.5000000000001?le=-.12803889879260094:le=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?le=.08967966612917375:t[1]>39.50000000000001?le=-.059791671514498074:le=.05648934961902822:t[2]>59.50000000000001?le=-.08633234097449628:t[6]>53.50000000000001?le=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?le=.025606129643140924:le=.13835395886271978:le=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?le=-.09975506556937946:t[10]>36.50000000000001?le=-.09427724661655643:t[10]>24.500000000000004?le=.07329330653410447:le=-.02271182965807972:le=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?le=-.05082091374050816:le=.1687114435254966:t[0]>2314.5000000000005?le=-.06422664016383926:le=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?le=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?le=-.1274167728754332:le=.01308079126447365:t[4]>73.50000000000001?le=.13854015371106546:t[4]>48.50000000000001?le=-.03684255740123261:t[6]>45.50000000000001?le=.10329912215813097:t[10]>77.50000000000001?le=-.08630788656925215:le=.031022006843800853:t[1]>25.500000000000004?le=-.08278381528048026:le=.06664374548141594:t[84]>1e-35?le=-.05624227409079396:le=.00012184182357340415;let Le;t[179]>1e-35?Le=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Le=-.07595415373151816:Le=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Le=.022822510448266862:Le=.17491569312933697:Le=-.058362287133533565:t[2]>2.5000000000000004?Le=-.03633895806364428:Le=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Le=-.07294848747514579:Le=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Le=-.07009535282685533:t[8]>2640.0000000000005?Le=-.051761240111316276:t[131]>1e-35?Le=-.06245774419231631:Le=.03495606662854905:Le=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Le=.0015036626973581122:Le=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Le=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Le=.022343994371919224:Le=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Le=.07724450228328664:t[0]>3853.5000000000005?Le=-.15671707454435677:t[10]>28.500000000000004?Le=-.10179090671841723:Le=.014878216919760927:Le=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Le=.14054154485273487:Le=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Le=-.08632985141410315:Le=.005524157938954954:Le=-.08802502622523681:Le=-.0004649168897260341;let me;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?me=-.007458687464321174:me=-.09444966249102484:t[1]>23.500000000000004?me=.08564129697360716:me=-.07105002902845851:me=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?me=-.10326216566705966:t[1]>26.500000000000004?me=.0050539832484585365:me=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?me=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?me=.05783632021087773:t[10]>17.500000000000004?me=-.06720598671764105:t[1]>47.50000000000001?me=.097495825172558:me=-.013372242800584872:me=-.06463226787713715:t[42]>1e-35?me=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?me=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?me=.11051270080118503:me=.027719462817590454:t[8]>597.5000000000001?me=-.08441503592016869:me=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?me=-.12190088985091102:me=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?me=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?me=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?me=.016585157185448045:me=-.11032043771149425:me=.01586986028570486:t[8]>388.50000000000006?me=-.10592413013261853:me=.04930703248769364:t[13]>1e-35?me=.003621937787920821:me=-.0013786331198611841;let Oe;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Oe=.009769895322846493:Oe=-.10620052926943656:t[9]>19.500000000000004?Oe=.03781202525403449:t[9]>14.500000000000002?Oe=-.11485785321365344:t[9]>6.500000000000001?Oe=.07677177833073881:t[0]>4342.500000000001?Oe=-.07079285609687631:t[49]>1e-35?Oe=.06156814809246001:Oe=-.014788509042554625:Oe=-.032659201618470655:t[5]>5207.500000000001?Oe=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Oe=-.03094160322187924:t[1]>29.500000000000004?Oe=.09474646043921069:Oe=.023445783928231618:Oe=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Oe=-.07164443768784848:t[1]>29.500000000000004?Oe=.089473622509272:t[8]>597.5000000000001?Oe=-.08155349903101317:Oe=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Oe=-.004003900679358653:t[190]>1e-35?Oe=-.09236113461485262:t[8]>3198.5000000000005?Oe=-.0124130160451179:Oe=.018453070064009328:t[15]>1e-35?Oe=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Oe=-.0009580759587680961:Oe=-.03227283036698222:Oe=.01369287669536875:t[1]>50.50000000000001?Oe=-.04213060332500437:t[35]>1e-35?Oe=-.11508095777767471:t[190]>1e-35?Oe=-.08611884672400155:t[297]>1e-35?Oe=.05723551879433584:Oe=-.004829340082311461;let Te;t[183]>1e-35?Te=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Te=-.11753465135886734:Te=-.007515490299047085:Te=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Te=-.12371142493530439:t[1]>36.50000000000001?Te=.032189417575190435:Te=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Te=-.0784518658439288:t[2]>54.50000000000001?Te=.12477882322370665:Te=.000313468482399738:Te=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Te=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Te=.0353146070135579:Te=-.06327619611098285:Te=.02813577701641991:Te=-.12354390728506215:t[34]>1e-35?Te=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Te=-.01245803535276381:Te=-.07169472553475001:t[1]>11.500000000000002?Te=.12989984824561698:Te=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Te=.010390226893521422:t[10]>14.500000000000002?Te=.16790888126487719:Te=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Te=-.043398307129729134:Te=.09963544907820426:t[9]>30.500000000000004?Te=-.13540713124984502:t[9]>17.500000000000004?Te=.0509435850590757:Te=-.04761897852404613:t[4]>78.50000000000001?Te=.09197086656470652:Te=.0006771050176682337;let te;t[122]>1e-35?t[6]>36.50000000000001?te=.05686884451670743:te=-.05334759543084309:t[266]>1e-35?te=-.08603579519816038:t[157]>1e-35?te=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?te=-.0499592651503952:t[0]>725.5000000000001?te=.11780353905132664:te=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?te=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?te=-.03190157229022304:te=.07985197845805492:te=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?te=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?te=-.027174047777029083:te=.057117284879796476:t[3]>43.50000000000001?te=-.0016147040913107311:te=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?te=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?te=-.01466076988151239:te=.13375695925484857:te=-.04885873081899647:t[0]>5566.500000000001?te=.11086813028591343:t[8]>992.5000000000001?te=-.07622304217072383:te=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?te=.03285858361708423:te=-.12354858211764992:te=.0672788301823281:t[15]>1e-35?te=.08658836986585006:te=-.02741484278509758:t[290]>1e-35?te=-.08161310335133287:t[135]>1e-35?te=-.04824156054814152:te=.0009156904299554183;let ee;t[3]>7.500000000000001?ee=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ee=.03642374718166293:ee=.16379973756366603:ee=-.03946685266127979:t[186]>1e-35?ee=.07618896623420895:t[96]>1e-35?ee=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?ee=-.022822371600847505:ee=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?ee=.044416424920571296:ee=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?ee=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?ee=.1061937286809567:t[7]>54.50000000000001?ee=.11487507743121311:t[8]>819.5000000000001?ee=-.07181278009001418:t[10]>25.500000000000004?ee=.13499019430369633:t[1]>31.500000000000004?ee=.09032979489780704:ee=-.12754166393372374:t[9]>37.50000000000001?ee=-.05093963635361407:ee=-.005026651151683848:t[9]>2.5000000000000004?ee=.07619735785573735:ee=.012363301341532136:t[26]>1e-35?ee=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?ee=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?ee=-.10764172927882483:ee=.01890760098464703:ee=.06573095405846417:t[8]>634.5000000000001?ee=-.00783575973273707:ee=-.050612689680229306:t[1]>22.500000000000004?ee=-.0016842490401359626:ee=.0738227088444087:ee=-.02663970950432175;let K;t[31]>1e-35?t[8]>17.500000000000004?K=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?K=.007191286124908192:K=-.09347881647636902:t[10]>1.5000000000000002?K=.07938758708008091:K=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?K=.12321804057595996:K=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?K=-.04644244754790671:K=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?K=.0706108609273337:t[2]>40.50000000000001?K=-.028046629962303716:K=-.06497613993109329:K=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?K=-.03056331974267756:K=-.11886389712497057:K=.053364962175658184:t[8]>2233.5000000000005?K=-.0448152521157682:K=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?K=.03818796510453344:K=.23673992112982362:K=.02858814226507374:t[10]>44.50000000000001?K=-.1125863771551199:K=.009129996952394916:t[1]>7.500000000000001?K=-.004374525302461639:K=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?K=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?K=-.13677189943034931:t[10]>2.5000000000000004?K=.039591891437078086:K=-.09312596849507347:K=-.02423172142089822:K=.0009836986075266283;let he;t[189]>1e-35?t[0]>5269.500000000001?he=-.103183298350443:t[2]>51.50000000000001?he=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?he=-.05186168947388339:he=.0496996365539082:t[10]>23.500000000000004?he=.1404445738719:t[93]>1e-35?he=.0027146310074558505:t[5]>3821.5000000000005?he=.002153033152069652:t[4]>2.5000000000000004?he=.007663539551317215:he=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?he=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?he=-.021479467709980358:he=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?he=.021660293256233334:he=-.0927396152303864:he=.0665074081601698:t[0]>1550.5000000000002?he=.08972407105958534:he=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?he=.06761927942466854:he=-.015762168112653286:t[17]>1e-35?he=.10311304131145381:he=-.017672785252336027:he=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?he=-.10638321435298535:he=.0007073011744385905:t[18]>1e-35?he=-.027056185501334325:t[145]>1e-35?he=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?he=.09762140519655171:t[9]>110.50000000000001?he=-.06581942957595835:t[6]>54.50000000000001?he=.04959634035251596:he=.0022616298654554207:he=-.007437620924990854;let X;t[179]>1e-35?X=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?X=.1470294450403005:X=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?X=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?X=.07965955447707423:t[10]>10.500000000000002?X=-.09236156404262426:X=.03396273196231458:X=-.13246465021467432:X=.07092822261735353:X=-.08753829085942:X=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?X=.004705878789890202:X=.13775378964952867:X=-.04770928980587811:t[10]>29.500000000000004?X=.011221519891071544:t[0]>3853.5000000000005?X=.06365381191628273:X=.15506252245336827:t[1]>37.50000000000001?X=-.07254777021042061:X=.026514587757252385:t[308]>1e-35?X=.04115804816617256:t[10]>26.500000000000004?X=.02077721353011946:t[5]>3548.5000000000005?X=-.1280907116663952:X=-.021974774274438:t[306]>1e-35?X=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?X=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?X=-.005710865560475598:t[94]>1e-35?X=-.06751507982853555:X=.027250040757588703:t[9]>52.50000000000001?X=.07060357924595577:X=-.030297760713011795:X=-.0006005400085266517;let de;t[113]>1e-35?de=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?de=-.06996356565314456:de=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?de=-.08317707559926495:t[21]>1e-35?de=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?de=-.010538203005984922:de=.08454819465349446:t[9]>124.50000000000001?de=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?de=-.08542251249346582:t[9]>50.50000000000001?de=-.023428882537657472:de=.010042500833979073:de=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?de=.03006025206979096:t[9]>108.50000000000001?de=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?de=.04222035773042132:de=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?de=-.07209095448054853:de=.028065954981903313:de=.08714651929917122:de=-.006678820669279169:t[10]>40.50000000000001?de=.006982396294941626:de=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?de=-.09351114982645548:t[4]>3.5000000000000004?de=-.004837550129223451:de=-.08324141237464677:t[303]>1e-35?de=.10703037493990825:t[9]>156.50000000000003?de=-.10803018621648303:t[116]>1e-35?de=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?de=.10261721665006701:de=.018994509090668264:de=.0011244262442038839;let Be;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?Be=-.08404263465005328:t[0]>3682.5000000000005?Be=.041259223920298876:t[1]>29.500000000000004?Be=-.09541257493441671:Be=.001482192721625409:Be=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?Be=-.08268996098437432:t[230]>1e-35?Be=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?Be=-913218977737457e-19:t[4]>10.500000000000002?Be=-.056334165674005156:t[127]>1e-35?Be=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?Be=-.04231200150318989:t[10]>42.50000000000001?Be=.10182973257894812:Be=.015934763950068445:Be=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?Be=-.041117068322885315:Be=.1167767830037126:Be=.13611206992387337:t[10]>41.50000000000001?Be=-.07120286010564107:Be=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?Be=-.07702290997669524:t[198]>1e-35?Be=.08776558554437136:Be=-.008290740324975692:t[2]>32.50000000000001?Be=.07198457624219955:Be=.005463113714361629:Be=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Be=.03295785445437507:Be=.15140250150674536:Be=-.035613213948910254:t[186]>1e-35?Be=.06849425535860769:t[96]>1e-35?Be=.06028225812727254:Be=-.007582543288662308;let ne;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ne=.08396556264106572:ne=-.0562516995099192:ne=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ne=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ne=.0052017514017035915:ne=-.11194119432743639:ne=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ne=-.025692451287403446:ne=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ne=-.11892250746801664:t[10]>22.500000000000004?ne=.07548493166973796:ne=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ne=.13750699058082427:t[18]>1e-35?ne=.06535408879552801:ne=-.054118179035040674:ne=.1344282838979622:t[0]>3982.5000000000005?ne=-.10409582202467015:t[19]>1e-35?ne=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ne=.012705935670766466:ne=.14149359442527545:ne=-.047977876173706004:t[20]>1e-35?ne=.057945228080337946:t[0]>3642.5000000000005?ne=-.008726535792122467:ne=-.08424769891378858:t[34]>1e-35?ne=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ne=.01196849566739346:ne=.1614642278429876:ne=-.043022338150701625:t[3]>5.500000000000001?ne=-.03907848255033881:ne=.018280601026175593:ne=.0006654540402589085;let ue;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ue=-.01386103677247845:ue=.11386694333005128:t[4]>27.500000000000004?ue=-.021862617610091336:t[2]>31.500000000000004?ue=.0828858469030438:ue=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ue=.11303635767048735:ue=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ue=-.04238798044549342:ue=.022091190130494303:t[5]>5082.500000000001?ue=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ue=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ue=-.04291104140431434:t[17]>1e-35?ue=.11256797532342613:ue=-.017206916368289193:ue=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ue=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ue=.03581712466863222:ue=.14770264307668884:t[8]>73.50000000000001?ue=-.13093289429740068:ue=.042461737442702936:t[52]>1e-35?ue=.0501831919044939:ue=-.010450249720465756:ue=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ue=.0005381332165438493:ue=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ue=.04849637311285226:ue=-.036671377119808564:t[0]>421.50000000000006?ue=.00020968499911058945:ue=.11636422423182405:ue=-.12687837788222575:ue=.0012774367867215346;let Ne;t[120]>1e-35?Ne=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ne=-.042799574885345304:Ne=.07412430171193245:Ne=-.11248270469336048:t[193]>1e-35?Ne=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ne=.028911612178122104:Ne=.12326369727728437:t[0]>4091.5000000000005?Ne=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ne=.1159839898100149:Ne=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ne=-.0216343737351583:Ne=-.1220272260878369:t[2]>18.500000000000004?Ne=.09152924475072398:t[8]>55.50000000000001?Ne=.039508716651005665:Ne=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ne=.06793009902674053:Ne=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ne=-.04391068849624096:Ne=.04009967593394672:t[8]>1085.5000000000002?Ne=-.024773826356034825:Ne=-.13919707884246582:Ne=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ne=-.11567917501901476:Ne=-.006813640337684114:t[3]>7.500000000000001?Ne=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ne=-.001754586408351048:Ne=-.055422422450722056:Ne=-.06090032532532226:t[0]>5269.500000000001?Ne=.11787981735983527:Ne=-.00198119768540783:Ne=.00210412924303036;let xe;t[294]>1e-35?t[10]>50.50000000000001?xe=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?xe=-.06063239096209816:xe=.03317022411417386:xe=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?xe=-.013608609329298802:xe=.09078000157330264:t[99]>1e-35?xe=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?xe=-.07536137260189814:xe=.006253266595455118:t[10]>28.500000000000004?xe=-.006106041147592768:t[9]>156.50000000000003?xe=-.11828932797811101:t[94]>1e-35?xe=-.02566078479505714:t[303]>1e-35?xe=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?xe=-.08401252789168523:t[5]>4244.500000000001?xe=.026372887658499107:t[1]>16.500000000000004?xe=-.027836756345634026:xe=.09205362097909099:xe=.00934612788718244:t[203]>1e-35?xe=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?xe=-.09580979052540028:t[1]>50.50000000000001?xe=-.06402211827281554:xe=.08342858760095972:t[2]>36.50000000000001?xe=.008114897658204584:t[92]>1e-35?xe=.09541587072672864:xe=-.022342147210555434:xe=-.01660492519175128:xe=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?xe=.15846731118501817:xe=.039498507912023195:t[245]>1e-35?xe=.07008718676813333:xe=.0019806389728814727;let Fe;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Fe=-.01192072916082109:Fe=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Fe=.06874032717466054:t[4]>40.50000000000001?Fe=-.07752510020707537:t[1]>76.50000000000001?Fe=-.09944032260703917:t[8]>1381.5000000000002?Fe=-.054466635810800745:t[1]>32.50000000000001?Fe=.05974084520839573:Fe=-.0384718740755954:Fe=-.11374190719134032:t[0]>2151.5000000000005?Fe=-.13703645155803298:Fe=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Fe=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Fe=.013539805885738608:Fe=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Fe=.09941880179344399:Fe=-.01608127391210995:Fe=.08025226531247417:t[9]>67.50000000000001?Fe=.13525448212444113:t[6]>61.50000000000001?Fe=-.05511099182158894:t[94]>1e-35?Fe=-.06821509831783572:t[128]>1e-35?Fe=.11361314817714643:Fe=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Fe=-.09954181329804547:t[197]>1e-35?Fe=.10102833149755386:t[188]>1e-35?Fe=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Fe=-.03781554214742005:Fe=.09927933385592314:Fe=-.020006000056720083:Fe=-.10520473615957895:Fe=-.12006990846253787:Fe=-.00026111570975317574;let tt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[0]>1725.5000000000002?t[7]>14.500000000000002?t[2]>38.50000000000001?tt=-.019188245509744628:tt=-.13354864350075848:t[0]>2461.5000000000005?tt=.051885477468354396:tt=-.0833581968852119:tt=.08233441701532287:tt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?tt=.09926337893072812:tt=-.027753610497327715:t[0]>1972.5000000000002?tt=-.09780045823152517:tt=.032380915168504935:tt=.11502632261226381:t[17]>1e-35?tt=-.06094965899579662:t[10]>40.50000000000001?tt=-.07500475582440802:tt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?tt=-.09584538995220808:tt=-.00908705814304442:tt=.03203281520813893:t[10]>49.50000000000001?tt=-.03146271513986384:t[2]>63.50000000000001?tt=.13172001315536286:t[224]>1e-35?tt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?tt=.09521549382082259:tt=-.04414925613522197:t[0]>1847.5000000000002?tt=-.09118580379557353:tt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?tt=.03525144509943896:tt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?tt=-.04766112322938157:t[2]>10.500000000000002?tt=.0728516504357201:tt=-.05049625965272536:tt=-.10868663055825774:tt=.0005382613419948969;let st;t[147]>1e-35?t[1]>53.50000000000001?st=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?st=-.030504020655417463:st=.07102458639110094:st=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?st=.055304563442710876:t[1]>53.50000000000001?st=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?st=-.1568835288372895:st=-.0279829124400056:st=.04493843959601833:st=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?st=-.054133834303687026:t[9]>48.50000000000001?st=.11263810289007213:t[9]>9.500000000000002?st=-.02202034562838259:t[4]>45.50000000000001?st=-.03410927569045158:st=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?st=-.029687297407295893:st=.10673602850001934:t[4]>42.50000000000001?st=.0036275562945108117:st=-.0760789221330622:st=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?st=.08274426793676076:st=-.07076234425516396:st=.13890177606150175:st=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?st=-.09250637750836187:st=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?st=-.01897867921812603:st=.04890781705365262:st=-.11569892307597907:t[2]>106.50000000000001?st=.09032697440623969:st=.00047935919155035045;let vt;t[115]>1e-35?vt=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?vt=-.10131179514695865:t[8]>938.5000000000001?vt=.10203729808015481:vt=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?vt=.03574015165562999:vt=-.07763042506449493:vt=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?vt=.0665706259130275:vt=-.06586817559309924:vt=.11925564412287476:vt=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?vt=.046017146627455346:vt=-.08623321630086885:t[8]>1765.5000000000002?vt=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?vt=.11143827902215087:vt=-.01817808730473413:vt=.16980985030210127:vt=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?vt=.010168994879727824:vt=-.09099594488792513:t[9]>1.5000000000000002?vt=.0533459678147928:vt=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?vt=-.062346959148773695:t[1]>47.50000000000001?vt=-.0021578343835599316:t[2]>27.500000000000004?vt=.19567373210166172:vt=.07851555379116423:t[18]>1e-35?vt=.03711549097804649:t[8]>359.50000000000006?vt=.012492346746905587:t[4]>20.500000000000004?vt=.047511695735697544:vt=-.07999269063948773:vt=6802045404471004e-20;let Pt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Pt=.0011484728213539738:Pt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Pt=-.09828874964938798:t[8]>1586.5000000000002?Pt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Pt=.011938269926919522:Pt=.17541983715953954:t[19]>1e-35?Pt=.023002786011088672:Pt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Pt=.06508934844183291:Pt=-.10168553534835639:Pt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Pt=.021140806225203937:Pt=-.1167833342453639:t[2]>33.50000000000001?Pt=.13163585734056618:Pt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Pt=.06314479201263888:Pt=-.09639088327091713:t[10]>29.500000000000004?Pt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Pt=40577156464836036e-21:Pt=.12322387121810757:Pt=-.03697224045046014:t[1]>22.500000000000004?Pt=.016474835887320276:Pt=.16919298733903063:Pt=.07633203630214054:Pt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Pt=.14150493354700563:Pt=-.01831155354975749:t[1]>28.500000000000004?Pt=-.07952557178685365:t[10]>28.500000000000004?Pt=.0665695554984927:Pt=-.053640139319277094:Pt=.0004754840665898665;let Ht;t[76]>1e-35?Ht=-.06814884255939921:t[179]>1e-35?Ht=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?Ht=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?Ht=.004193658608848433:Ht=-.1066968975983452:t[8]>302.50000000000006?Ht=.05476730110440451:Ht=-.06382970920394895:t[218]>1e-35?t[2]>3.5000000000000004?t[6]>13.500000000000002?t[2]>19.500000000000004?t[0]>3200.5000000000005?t[4]>91.50000000000001?Ht=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?Ht=.013555772109446666:Ht=-.09856116699770784:Ht=.0284329611813383:t[2]>52.50000000000001?Ht=.04008708444763762:t[9]>29.500000000000004?Ht=-.1289599546008197:Ht=-.018566534248335896:t[8]>747.5000000000001?Ht=.02236484980076122:Ht=.1148871655157582:t[8]>3084.0000000000005?Ht=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?Ht=.03164751204281298:Ht=.11752140436184891:t[9]>42.50000000000001?Ht=-.07180559595410106:t[22]>1e-35?Ht=.09325040416256854:Ht=-.016041122807939914:Ht=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?Ht=-.010718250133458515:Ht=.09818827994853763:Ht=.010180038981174032:Ht=-.039472162599295535:t[9]>170.50000000000003?Ht=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?Ht=-.08674788057474031:Ht=.02077653508548371:Ht=-.0003536561382007414;let F;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?F=.018337297491457794:F=-.05926206443180149:F=.024026520855881126:t[288]>1e-35?t[184]>1e-35?F=.10747078482128616:t[126]>1e-35?F=-.10550625192391357:t[7]>71.50000000000001?F=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?F=.1317396472229434:F=-.025035791351328947:F=-.0728334305864372:t[8]>963.5000000000001?F=.023642201723096064:F=.183010326734258:t[128]>1e-35?F=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?F=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?F=-.1088876900335281:F=.02758317023002635:F=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?F=-.01928020117446408:F=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?F=.07893723375925096:F=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?F=-.10301657587280551:F=.005787463140224318:F=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?F=-.019296977889522397:F=-.07274529751752634:t[1]>30.500000000000004?F=-.050368901143148286:F=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?F=.0015332402792773946:F=.09930153676749967:F=-.06370844564357069:F=.00042272155209927616;let se;t[71]>1e-35?t[4]>17.500000000000004?se=.12586844370423247:se=-.006791999603126354:t[222]>1e-35?t[1]>10.500000000000002?t[30]>1e-35?t[1]>36.50000000000001?t[9]>1.5000000000000002?t[10]>25.500000000000004?se=-.08474891624263797:t[8]>125.50000000000001?se=.08125086980439704:se=-.04082085238068532:t[0]>3863.5000000000005?se=.020481535807469208:se=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?se=-.019110200161573936:se=-.12387719685855114:t[0]>1102.5000000000002?se=.08376595701957407:se=-.031821919580524834:t[9]>4.500000000000001?se=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?se=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?se=.1349841206807871:se=.011864053595560297:t[1]>41.50000000000001?se=-.08203662486612544:t[2]>18.500000000000004?se=-.009541865642346947:se=.08345043168501759:t[2]>10.500000000000002?se=-.09585031818030947:se=.019432330487099865:se=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?se=.11951517733981365:se=-.016651014735738538:t[1]>28.500000000000004?se=-.07410922545030711:t[10]>28.500000000000004?se=.05886430683844788:se=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?se=.04802269879144705:se=-.026208212831796737:t[4]>45.50000000000001?se=-.03227476944664786:se=.05124575625622705:se=.00020506696916003137;let be;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?be=-.03042091758483443:t[10]>14.500000000000002?be=.09816619204768777:be=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?be=-.02381165060401718:be=-.10950361804974783:be=.03538211665111128:t[212]>1e-35?t[19]>1e-35?be=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?be=-.06371052144380579:be=.0835500621252692:be=-.10408255929333915:t[1]>74.50000000000001?be=.13208968122712403:t[1]>64.50000000000001?be=-.04778844603644965:t[8]>51.50000000000001?t[8]>201.50000000000003?t[8]>660.5000000000001?t[6]>4.500000000000001?t[9]>5.500000000000001?t[1]>29.500000000000004?t[0]>3830.5000000000005?be=.09922816902423433:be=.016366955328796718:be=.1592412560903584:t[1]>39.50000000000001?be=.05409467990258923:be=-.08260633210459611:be=-.06307205775247567:t[9]>36.50000000000001?be=.040253940015648144:be=.14202568969471283:be=-.028761848341594044:be=.08994073058773508:t[0]>807.5000000000001?be=-.043427848826323195:be=.04573516446846493:t[20]>1e-35?t[188]>1e-35?be=-.0758877731600639:t[23]>1e-35?be=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?be=.08124700978741987:be=.013296063087086852:t[7]>5.500000000000001?be=-.01640196088612987:be=-.12685498840146067:be=-.0004940792382459551;let Ue;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Ue=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?Ue=.08513773825688947:Ue=-.1184664832315282:Ue=.05676963535893477:Ue=.14263843210340613:Ue=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?Ue=-.10669720555606924:Ue=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?Ue=.0664744575868955:Ue=-.08469256188890871:Ue=-.026746678040592144:t[281]>1e-35?Ue=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Ue=.012131807587207655:Ue=-.12776015795398743:Ue=.04320472481083551:Ue=.08390980661550446:t[10]>227.50000000000003?Ue=-.09771783809101153:t[10]>130.50000000000003?Ue=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?Ue=-.07610698254064358:t[8]>902.5000000000001?Ue=-.03136381213599649:t[131]>1e-35?Ue=.0704821739127936:t[224]>1e-35?Ue=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?Ue=.10431473040024908:t[8]>841.5000000000001?Ue=.07304745320500514:Ue=-.038011541882439825:Ue=-.01679746695007364:t[0]>3129.5000000000005?Ue=.05589952587431965:t[210]>1e-35?Ue=.06227198085800842:Ue=-.0011341890997947812:t[8]>740.5000000000001?Ue=.04817300084412584:Ue=-.000577001010789238;let Qe;t[187]>1e-35?t[6]>12.500000000000002?t[10]>8.500000000000002?t[10]>16.500000000000004?t[8]>234.50000000000003?t[4]>43.50000000000001?t[0]>4476.500000000001?Qe=-.10504730480402079:t[5]>3341.5000000000005?Qe=.11087894671081754:Qe=-.0406668834674614:Qe=.03308382165616109:t[8]>104.50000000000001?Qe=-.10431436764549162:Qe=.0073928337244891455:t[4]>34.50000000000001?Qe=-.10571751512748416:Qe=-.006081128814142983:t[13]>1e-35?Qe=.1299673566095023:t[4]>60.50000000000001?Qe=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Qe=.04857126072645073:Qe=-.03431365358104773:t[4]>16.500000000000004?Qe=.04101865986596709:Qe=.16480274980378218:t[10]>26.500000000000004?Qe=.03673978504199255:t[10]>9.500000000000002?Qe=-.10996402743800027:t[308]>1e-35?Qe=.0553693735082498:Qe=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Qe=.010902983761213922:Qe=.1325118659895645:Qe=-.064362945508595:t[1]>66.50000000000001?Qe=.033416767779331176:Qe=-.054080316225040496:t[42]>1e-35?Qe=-.07762364337810815:t[10]>1089.5000000000002?Qe=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Qe=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Qe=.0220102041325908:Qe=-.06516708740003069:Qe=.012833498905748267:t[224]>1e-35?Qe=-.007038418272997865:Qe=.00037666304316290967;let ge;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ge=.07554189644995735:ge=-.052089349455904946:ge=-.10148206848169845:t[113]>1e-35?ge=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?ge=.07172653627995676:ge=-.07602959317610998:ge=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?ge=-.0399322883690891:ge=.06523495517476098:ge=-.10358715295743802:t[193]>1e-35?ge=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?ge=.015928764772252406:ge=.1341513061552287:ge=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?ge=-.033592997607280156:ge=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?ge=-.08402551858097379:ge=.017401984506038796:t[1]>25.500000000000004?ge=.13337205393591278:ge=-.01160208350090984:ge=.06708317942315471:t[8]>227.50000000000003?ge=-.08486943882418681:ge=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?ge=-.10496268177586783:ge=-.020921489532370493:ge=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?ge=.11639296062157028:ge=-.004275784356569115:t[32]>1e-35?ge=-.07297384970166025:ge=.006026841626381599:ge=.002034611134960428;let Z;t[248]>1e-35?Z=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Z=-.06455513326540585:t[1]>29.500000000000004?Z=.07718474591552532:t[4]>7.500000000000001?Z=.040139336931404826:Z=-.09685734690563386:Z=.00015327283570347363:t[9]>88.50000000000001?Z=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Z=-.04077257804338707:Z=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Z=.03778141591008941:Z=-.06459919920634845:Z=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Z=.14063930759326346:t[0]>179.50000000000003?Z=.07287482250668585:t[8]>1180.5000000000002?Z=-.14419393112726253:t[10]>28.500000000000004?Z=-.07993142770099469:t[17]>1e-35?Z=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Z=.05527969663610186:Z=-.10824385941441346:t[3]>11.500000000000002?Z=.12358502961047915:Z=-.017509147119622873:t[0]>74.50000000000001?Z=-.014907705458730486:t[8]>95.50000000000001?Z=-.02225118168342062:Z=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Z=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Z=.04962819555610421:Z=-.07213577821855309:Z=.09139529824708481:t[19]>1e-35?Z=.013439401088345224:Z=-.049274647207292056:Z=.10531673719686951;let ve;t[40]>1e-35?t[0]>1937.5000000000002?ve=-.06421671152073961:ve=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?ve=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?ve=-.03520420769287065:t[8]>1085.5000000000002?ve=-.019817352506127633:ve=.11444439424520964:ve=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?ve=-.010490117519863269:ve=.08104430117757461:t[121]>1e-35?t[243]>1e-35?ve=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?ve=.06619344145920268:t[0]>4091.5000000000005?ve=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?ve=.10016091391222309:ve=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?ve=-.019511460451434884:ve=-.11643672465055221:t[2]>18.500000000000004?ve=.07848228087333317:t[8]>55.50000000000001?ve=.032583027899956235:ve=-.11209832692153521:t[11]>1e-35?ve=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?ve=-.09996887746328006:t[9]>2.5000000000000004?ve=.02157682011863397:ve=-.05247727848991843:ve=.07409150201483244:t[1]>38.50000000000001?ve=-.11378466075449625:t[224]>1e-35?ve=-.10741749127732923:t[1]>26.500000000000004?ve=.07343136534146562:ve=-.07013573628594773:t[25]>1e-35?ve=-.04626669734164317:ve=.05518333197956482:ve=.00032434010867555516;let Ge;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?Ge=.026313251010808853:Ge=-.08997339150292381:Ge=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?Ge=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?Ge=.0905155504503746:t[8]>1049.5000000000002?Ge=-.062312558183394054:t[8]>719.5000000000001?Ge=.09583836191410239:t[0]>3719.5000000000005?Ge=-.0778097309430818:Ge=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?Ge=-.12920865648544927:t[0]>2699.5000000000005?Ge=-.07086587879041864:Ge=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?Ge=-.11377786322600797:Ge=-.009486325820117998:t[1]>55.50000000000001?Ge=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?Ge=-.07938291201004219:t[2]>36.50000000000001?Ge=.01520046732530246:Ge=.13649854049662832:Ge=-.07145015938528873:t[8]>407.50000000000006?Ge=-.00350257360822279:Ge=.11332047082193297:Ge=-.10060624458629897:Ge=.05429496612497562:t[8]>1446.5000000000002?Ge=.006073419197482838:Ge=-.08718676350883998:Ge=-.11532497988252638:Ge=.10766270463068293:t[34]>1e-35?Ge=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?Ge=-.0004109812623829506:Ge=.021601073497455662:Ge=-7343540098965853e-20;let qe;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?qe=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?qe=.05995640200798119:t[0]>3443.5000000000005?qe=-.14698883458733583:qe=-.030039164579240187:t[189]>1e-35?qe=-.06086763220538141:t[1]>86.50000000000001?qe=-.05096727866142538:t[4]>64.50000000000001?qe=.11240554253834577:t[4]>45.50000000000001?qe=-.030279760168394117:t[6]>45.50000000000001?qe=.10161088917815142:t[10]>77.50000000000001?qe=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?qe=-.06672020005240323:qe=.08831457502630258:t[8]>2592.5000000000005?qe=-.052617701047376654:t[10]>29.500000000000004?qe=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?qe=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?qe=-.064099222705728:qe=.044332487521538365:t[0]>2882.5000000000005?qe=.031099546885005065:qe=.12938467051623853:t[0]>4221.500000000001?qe=-.0928676413498701:t[9]>30.500000000000004?qe=-.05781824812803708:qe=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?qe=-.06648105454098469:qe=.05985487552383097:qe=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?qe=.05282385499619401:t[1]>66.50000000000001?qe=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?qe=.027885690791379255:qe=-.08407126408362446:qe=.014432924125571093:qe=-9903435845205118e-20;let je;t[76]>1e-35?je=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?je=.013633653464240465:je=-.10164319411983509:je=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?je=.00632864847804078:je=-.08393000368134668:je=.07870508617440916:t[284]>1e-35?je=.1092302727710421:je=-.0025505047582483234:t[248]>1e-35?je=.07101822393621864:t[274]>1e-35?je=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?je=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?je=.025081789181021243:je=-.014813325803582618:t[9]>33.50000000000001?je=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?je=.11926990418060353:je=.01852125513565268:je=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?je=-.1178464984373743:t[283]>1e-35?je=.043370859226927405:t[5]>4320.500000000001?je=-.01103141226366587:t[8]>1104.5000000000002?je=-.023053423988095886:je=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?je=.000579145585864887:je=.03389152834202143:t[128]>1e-35?je=-.14527722052568462:t[210]>1e-35?je=-.08915971541902741:t[7]>9.500000000000002?je=-.03307314577076116:t[18]>1e-35?je=-.05521712302023565:je=.009315605032770029:je=.0036332551852289933;let J;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?J=-.07583539600416284:t[188]>1e-35?J=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?J=-.011038193049597113:J=.08154028164397753:t[1]>85.50000000000001?J=.10259361975201933:J=.011640408330521594:J=-.00023319159023748508:t[92]>1e-35?J=.13771692859530546:J=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?J=.09967230141007705:t[30]>1e-35?J=-.08888529037551285:J=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?J=.08284665960761373:J=-.029292565021289504:t[7]>7.500000000000001?J=-.09945093355204493:J=-.008381393701708593:t[20]>1e-35?J=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?J=.07585582641438211:t[8]>284.50000000000006?J=-.029387993239886723:J=.07716738177321587:t[1]>18.500000000000004?J=.026745348497993746:J=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?J=.02337306890530338:J=-.10390355904767366:J=.07390521199638532:J=-.06788247515155237:J=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?J=-.06360325615644084:J=.04342192339836601:J=-.10598779152030145:J=.05253384605768211;let ae;t[3]>7.500000000000001?t[157]>1e-35?ae=-.07514182877923786:ae=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ae=.028692053800951845:ae=.14081686716133598:ae=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?ae=.0037139292567243084:ae=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?ae=.01202688580305612:ae=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?ae=.043935495082738626:ae=-.05639305759669704:t[247]>1e-35?ae=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?ae=.10331836202616368:ae=.0006926658459781341:t[96]>1e-35?ae=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?ae=-.0741403257305367:ae=.022900127535540854:t[7]>3.5000000000000004?ae=.038110741403836294:ae=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?ae=-.09552842289807008:t[1]>27.500000000000004?ae=.012505935885798007:ae=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?ae=-.1046104767723845:ae=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?ae=.023466328488582572:ae=.11730925774586994:ae=-.04771965631104874:ae=.17059689880751394:ae=-.08181850955999449:t[26]>1e-35?ae=-.12727482696678769:ae=-.014343123272734182;let Ce;t[147]>1e-35?t[1]>53.50000000000001?Ce=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Ce=-.02763546051134888:Ce=.06423344777499343:Ce=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?Ce=.049825139823021586:t[7]>22.500000000000004?Ce=-.01131680751379858:t[0]>2579.5000000000005?Ce=-.10673674485369694:Ce=-.015387212937189957:Ce=.04347325151148724:t[179]>1e-35?Ce=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Ce=.0650355590939066:Ce=-.0473332870892226:Ce=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?Ce=.11139543329789044:t[126]>1e-35?Ce=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?Ce=.06370903833231022:t[10]>29.500000000000004?Ce=.03415223859607161:t[10]>3.5000000000000004?Ce=-.07415518117873297:Ce=-.0014119203473324082:Ce=.12617652343819508:t[9]>41.50000000000001?Ce=-.10311145857176976:t[8]>2757.5000000000005?Ce=-.08106484219011428:t[7]>71.50000000000001?Ce=-.09783384432091176:t[1]>88.50000000000001?Ce=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?Ce=-.008884084501608536:Ce=.061339437777743616:Ce=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?Ce=.01526664064166223:Ce=.13534828515415498:Ce=-.06985484465894776:Ce=.0005758961943178744;let Re;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Re=-.029152732370514342:Re=.07173628916139178:t[1]>36.50000000000001?Re=-.08859111297255318:Re=.0018030071815630785:Re=.13652461563759322:Re=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Re=-.07145140450454163:t[21]>1e-35?Re=-.07422841663493233:Re=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Re=.11864240653986852:t[3]>33.50000000000001?Re=-.08821209591953476:Re=.05706392280054726:Re=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Re=.01953613016837112:Re=-.059781039130025006:t[148]>1e-35?Re=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Re=.07207826841738371:t[202]>1e-35?Re=.08163917539410503:Re=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Re=-.06858280496900336:Re=-.1781828899516648:Re=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Re=.018232649414147116:Re=-.04419781124222661:Re=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Re=.11452368095776105:Re=-.036496437259924026:Re=-.040445338739465486:Re=.0816572651001145:Re=-.08968914517368663:Re=.0002826343082585516;let $e;t[189]>1e-35?t[0]>5269.500000000001?$e=-.08839493050459957:t[10]>85.50000000000001?$e=.10046908365702462:t[8]>2592.5000000000005?$e=-.09632233975926387:t[8]>2000.5000000000002?$e=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?$e=.035504970430426296:t[1]>31.500000000000004?$e=-.1133764813142531:$e=-.01138280942244812:t[8]>1125.5000000000002?$e=.09800530246229806:$e=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?$e=.07316772160107896:$e=-.059095014819051765:$e=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?$e=-.09150209066166894:t[8]>3084.0000000000005?$e=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?$e=-.04449234460408263:$e=.05568837973347338:$e=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?$e=.12741077850267066:$e=.007372371864985329:t[2]>39.50000000000001?$e=.02295917234617787:$e=.14966532083907075:t[1]>39.50000000000001?$e=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?$e=-.02511861881285652:t[1]>27.500000000000004?$e=.08683660011672288:$e=.02956214835267301:t[9]>15.500000000000002?$e=-.016538805462996232:$e=.04352738094981517:$e=-.05561856645643868:t[9]>170.50000000000003?$e=-.07996752635874248:t[179]>1e-35?$e=-.09065975936933919:$e=-.00042817975060427177;let Ye;t[39]>1e-35?t[4]>25.500000000000004?Ye=.03443173196222934:Ye=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?Ye=-.0013415395759330318:Ye=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?Ye=.002297618040307216:Ye=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?Ye=-.015297257305397608:Ye=.09651828834062742:Ye=-.06636003334371929:t[10]>11.500000000000002?Ye=.17631616138309397:t[0]>1639.5000000000002?Ye=3804386478092585e-20:Ye=-.09099296398683193:Ye=-.06874415876172972:t[0]>2151.5000000000005?Ye=-.1311264883406766:Ye=.00809052010141122:t[253]>1e-35?Ye=-.06338558211939296:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?t[10]>10.500000000000002?t[0]>3615.5000000000005?Ye=.045038497754638605:Ye=-.07770167665661752:Ye=-.08596294280650517:Ye=.08538655727027213:Ye=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?Ye=.054627956617973275:t[1]>61.50000000000001?Ye=-.11994465088415499:t[4]>8.500000000000002?Ye=.06676200239406452:Ye=-.027503148069376867:t[8]>676.5000000000001?Ye=-.10363964928357075:t[4]>8.500000000000002?Ye=-.07589816227175682:Ye=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?Ye=.009093153189012338:Ye=-.06119765876605404:Ye=.0004668642103528348;let ut;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?ut=-.10100794502567233:ut=.08000205636470442:ut=-.11945419826856896:t[113]>1e-35?ut=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?ut=.1224302423880318:ut=-.01875566982911468:t[222]>1e-35?t[1]>8.500000000000002?t[1]>24.500000000000004?t[4]>3.5000000000000004?t[0]>725.5000000000001?t[0]>1682.5000000000002?t[0]>2860.5000000000005?ut=.0019277012166729114:t[1]>28.500000000000004?ut=-.054445821715687494:ut=.045645722976713245:t[30]>1e-35?ut=.13402660155331655:ut=.008921176001777645:ut=-.058547426505451076:ut=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?ut=-.13526418192218206:ut=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?ut=.0007263224246135398:ut=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?ut=-.11575657261278308:ut=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?ut=-.01995960178292952:ut=.11216586049153021:ut=-.10050961087149474:ut=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?ut=.10303451081526649:ut=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?ut=-.043799548968209395:ut=-.12451444314954115:t[4]>12.500000000000002?ut=-.03838117361958468:ut=.06504990789767144:t[57]>1e-35?ut=.06890006938293915:ut=.0003914274695562949;let yt;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?yt=.004271749009686975:yt=-.10523878297127605:yt=.04633982158107851:yt=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?yt=-.08655730561951676:t[8]>919.5000000000001?yt=-.0676453705610183:t[7]>18.500000000000004?yt=-.027787974193650575:yt=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?yt=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?yt=-.03473877164537313:t[8]>719.5000000000001?yt=.10471053866934404:yt=.008236107678382981:t[4]>57.50000000000001?yt=.09412219478825269:t[10]>66.50000000000001?yt=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?yt=-.040681323751002293:yt=.06374650297561021:yt=.12884615227401788:t[10]>5.500000000000001?yt=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?yt=-.05474068967150784:yt=.03744700650806603:yt=-.07846396348680855:t[1]>42.50000000000001?yt=.018972315810821302:yt=.10953621007604744:t[5]>4439.500000000001?yt=.010999776705494586:t[1]>40.50000000000001?yt=-.12394200059775967:t[10]>2.5000000000000004?yt=.013528093962849453:yt=-.09222088417048682:yt=-.12662967149701485:yt=.09327296405849603:t[3]>99.50000000000001?yt=-.013581954439986752:yt=.0005526498251862075;let $t;t[187]>1e-35?t[243]>1e-35?$t=-.08392792551692502:t[10]>68.50000000000001?$t=.07871769409454053:t[10]>8.500000000000002?t[10]>16.500000000000004?t[2]>17.500000000000004?t[3]>31.500000000000004?t[91]>1e-35?t[10]>21.500000000000004?t[10]>33.50000000000001?t[10]>48.50000000000001?$t=-.0825306209711224:$t=.049559996084532945:$t=-.1064938580886302:$t=.03353240732240275:$t=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?$t=.16966001471529374:t[1]>57.50000000000001?$t=-.005772777673676247:$t=.09383677041525058:t[8]>747.5000000000001?$t=.054068175469351235:$t=-.049968216310277036:t[8]>753.5000000000001?$t=-.0679383555784074:t[4]>8.500000000000002?$t=-.059757341189735386:$t=.05701083682780414:$t=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?$t=.05820296128730006:$t=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?$t=.15340611616954566:$t=.04385036188666874:t[0]>4449.500000000001?$t=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?$t=.004840354641006495:$t=.09967827580276283:$t=.11605363537391578:t[9]>19.500000000000004?$t=-.0735831692725717:$t=.019973331823355176:t[306]>1e-35?t[149]>1e-35?$t=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?$t=-.02442182361342386:$t=.10334853004243093:$t=-.030431948680167104:$t=-956078595250818e-19;let Tt;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?Tt=-.040232505718244854:t[0]>3030.5000000000005?Tt=.0634109586813073:Tt=-.04043617034245621:Tt=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?Tt=-.007859096946435131:Tt=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?Tt=.05515771679628051:Tt=-.04214471312668263:Tt=-.09589322222261765:t[193]>1e-35?Tt=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?Tt=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?Tt=-.08152604001147906:t[11]>1e-35?Tt=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?Tt=.13100930780107503:t[10]>25.500000000000004?Tt=.05921074710011526:Tt=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?Tt=.0009447118243153454:Tt=-.09820565036865991:Tt=.057146909749745546:t[0]>2115.5000000000005?Tt=-.12331216726611678:Tt=.007281983677694285:t[2]>56.50000000000001?Tt=.012310154675612615:Tt=-.08873665774670461:t[6]>25.500000000000004?Tt=.134708740821879:t[9]>5.500000000000001?Tt=-.0805901581148979:t[224]>1e-35?Tt=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?Tt=.10842593386554122:t[2]>13.500000000000002?Tt=.06466798320378395:Tt=-.08578130788886655:Tt=-.03590892078300114:Tt=.0003499894043880708;let We;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?We=.10839808814624702:We=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?We=-.007478368069393829:We=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?We=.04035247751736232:t[0]>4255.500000000001?We=-.1310865624507367:t[0]>4004.5000000000005?We=.06647367311982634:We=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?We=-.011618902907510411:We=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?We=.09356028223727986:We=-.03811765057032162:We=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?We=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?We=.1146142460964847:t[1]>62.50000000000001?We=-.09679869865322362:t[9]>71.50000000000001?We=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?We=-.039046426387852974:We=.04558778688367152:We=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?We=.03261697816211156:t[15]>1e-35?We=.02586252542264368:t[2]>14.500000000000002?We=-.016420452667484604:We=-.1011799626006976:We=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?We=.010193588102560583:We=.11748729525930773:We=-.04468162226743652:We=-.028365274393617957:t[71]>1e-35?We=.05115139346588793:We=-.0001510425316936658;let ce;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ce=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ce=.020637047900190317:ce=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?ce=-.04632587527094407:ce=.08603684785510396:ce=-.05101401015448496:ce=.025466432054358498:ce=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ce=.020385355430046367:ce=.12032592051335252:ce=-.012387370292173013:t[2]>23.500000000000004?ce=-.12568545484492677:ce=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ce=.043528764484784536:ce=.14352071657196003:ce=-.009332833816977268:ce=.11186782227735846:ce=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ce=-.05649104643152564:ce=.03884200719305747:t[42]>1e-35?ce=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ce=-.04103416502526736:ce=.04881823954656287:t[4]>15.500000000000002?ce=.009342724662897898:t[0]>3969.5000000000005?ce=-.025637309961309498:ce=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ce=-.08185697075265091:t[0]>2215.5000000000005?ce=.030063975892297354:t[0]>807.5000000000001?ce=-.03924325550733229:ce=.0415330999189793:ce=-.00024374664461674863;let Pe;t[3]>7.500000000000001?Pe=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Pe=.025798416259686565:Pe=.13251610353146012:Pe=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Pe=-.11098564237775424:Pe=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Pe=.15347826616466054:t[3]>4.500000000000001?Pe=.10379320730958941:Pe=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Pe=.03159791088468647:Pe=-.10612873364104258:Pe=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Pe=-.02335760775001469:Pe=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Pe=-.011164334474672973:Pe=-.06594044410501655:t[207]>1e-35?Pe=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Pe=-.01725821503981916:Pe=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Pe=-.04226531631656534:Pe=-.14409800530171432:Pe=-.03245576341206398:t[8]>4214.500000000001?Pe=.0895409165534886:t[247]>1e-35?Pe=-.06506383629143335:t[118]>1e-35?Pe=-.07214270121257443:t[8]>546.5000000000001?Pe=-.004385020865473831:Pe=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Pe=.046278501133958524:Pe=-.030835570926968044:t[0]>493.50000000000006?Pe=-.12794504651610425:Pe=.009415039807550776;let Me;t[304]>1e-35?Me=-.04717777269217453:t[76]>1e-35?Me=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Me=-.09648224457374217:t[132]>1e-35?Me=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Me=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Me=.10838431695638147:t[230]>1e-35?Me=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Me=.050071316251979:Me=-.006356941111525215:t[6]>8.500000000000002?Me=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Me=.10217402850540398:Me=-.048840949025349197:Me=-.03668313197909846:t[7]>39.50000000000001?Me=-.0562642841496003:t[10]>2.5000000000000004?Me=.09749777369987417:Me=-.04848223121417616:t[0]>5453.500000000001?Me=.08316648226133942:Me=-.0261979698267618:t[212]>1e-35?Me=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Me=.04837009746506856:Me=-.09184360565631328:Me=.0032411047845613606:t[0]>4733.500000000001?Me=.0977378556864798:Me=.010776545559325588:Me=-.012483310473120218:Me=-.049284121449103935:Me=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Me=-.08380361910948711:Me=.07375088778585813:Me=-.1084864186071348:Me=.0007819503469605476;let ye;t[7]>17.500000000000004?t[115]>1e-35?ye=.08741852531696623:t[167]>1e-35?ye=.10078975495600809:ye=-.0018324767784017562:t[290]>1e-35?ye=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ye=.1379733311640402:ye=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ye=-.09360083033774169:ye=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ye=-.015599362579530679:t[0]>4593.500000000001?ye=-.12029549262691491:ye=-.018917032256501397:ye=.04632831686576592:ye=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ye=-.05894883236412263:ye=.05213944998315824:ye=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ye=.07577412405680808:ye=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ye=-.0277076900736147:t[1]>65.50000000000001?ye=-.023587471585763506:ye=.10184896592433082:ye=-.057699270527916825:ye=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ye=.06566902102799584:t[10]>25.500000000000004?ye=-.07033633753181047:ye=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ye=-.08108035861059537:ye=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ye=-.12431182772561139:ye=.01886235886984271:ye=.0025579594894418116;let oe;t[8]>2915.5000000000005?t[101]>1e-35?oe=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?oe=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?oe=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?oe=.0687641681341721:t[10]>102.50000000000001?oe=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?oe=-.06762578396473291:t[10]>65.50000000000001?oe=-.05226727783610509:t[282]>1e-35?oe=.09911438410640917:t[19]>1e-35?oe=.06915156336429933:oe=-.006565637886508241:oe=-.08344300251849307:oe=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?oe=.19428463865406298:oe=.016073883020956765:t[13]>1e-35?oe=.06864077097923665:oe=-.01388867527034731:t[0]>1847.5000000000002?oe=.004655280608161356:t[1]>40.50000000000001?oe=.031406054057765996:oe=.12798062439212832:oe=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?oe=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?oe=-.0706095614785733:oe=.04227164041372561:oe=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?oe=-.07139533369873902:oe=.008952586782921625:oe=.06086212582180936:oe=-.0816938490403437:oe=-.051224901945956025:oe=-.10525399124186095:oe=.000270924147208224;let Ke;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?Ke=.029186512383291244:t[7]>1.5000000000000002?Ke=-.14984127276725573:t[1]>40.50000000000001?Ke=.032757060730648144:Ke=-.07675575422749602:t[6]>8.500000000000002?Ke=.10599766037117893:Ke=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Ke=-.051394622947855385:Ke=.03237141302699347:Ke=.12526173027943244:Ke=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Ke=-.07383912482657777:t[0]>5147.500000000001?Ke=.07008813937042091:t[10]>38.50000000000001?Ke=-.06779203808365307:Ke=-.013782769999524498:Ke=.0880038869117715:Ke=-.12846294176070952:t[281]>1e-35?Ke=-.06810806903850834:t[10]>227.50000000000003?Ke=-.08937977001661111:t[10]>130.50000000000003?Ke=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Ke=.011036530162093841:Ke=-.11500797478569702:Ke=.03702229366129399:Ke=.07242026683784307:t[189]>1e-35?Ke=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?Ke=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?Ke=-.02608892716555304:Ke=.09609599320761308:t[9]>105.50000000000001?Ke=-.06848127135991534:Ke=.0023675721254089715:t[86]>1e-35?Ke=-.11049635625500497:Ke=-.004847764219432233;let lt;t[125]>1e-35?t[0]>3969.5000000000005?lt=-.09462233499115416:lt=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?lt=-.030700661288166148:lt=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?lt=.03149547314036763:lt=-.08166208257451366:t[0]>5850.500000000001?lt=-.10228136324773157:t[102]>1e-35?lt=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?lt=.01782894842128785:t[13]>1e-35?lt=.002680190260979968:lt=.1773965720476949:t[2]>72.50000000000001?lt=.09090831938627947:t[1]>59.50000000000001?lt=-.12297206702816128:t[0]>4977.500000000001?lt=.09899015653118268:lt=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?lt=-.0675900954187773:lt=.012336403425364092:lt=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?lt=-.02671721777458802:lt=-.09242452991958029:t[284]>1e-35?lt=-.08585691288582491:lt=.013332890564324447:t[4]>14.500000000000002?lt=-.005245022074799553:t[23]>1e-35?lt=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?lt=-.09289852307936758:t[116]>1e-35?lt=-.09686573010015055:t[8]>804.5000000000001?lt=.03812547148215318:lt=.005162744968176633:t[9]>43.50000000000001?lt=-.059246106396159376:lt=.050370113808135275:lt=.000794041852811028;let Gt;t[3]>7.500000000000001?Gt=.0004981426543104341:t[9]>114.50000000000001?Gt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Gt=-.019061766497948867:Gt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Gt=-.006044199577160493:Gt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Gt=.11486607015912494:t[9]>16.500000000000004?Gt=-.08686820858087294:Gt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Gt=-.022230207980026437:Gt=.1056683690528792:Gt=-.05859530800943035:Gt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Gt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Gt=-.05177544573528314:Gt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Gt=.15159657923771555:Gt=-.0060542654587671055:t[9]>5.500000000000001?Gt=-.042808028205051786:t[1]>48.50000000000001?Gt=-.010449538258110742:Gt=.10026907521968294:Gt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Gt=-.02272452389409874:Gt=-.11202691218244319:t[5]>1809.5000000000002?Gt=-.04460413584255906:Gt=.08196329474205256:t[10]>69.50000000000001?Gt=.10221481166238167:Gt=.0004063052701699382:t[243]>1e-35?Gt=-.07563941678849846:t[18]>1e-35?Gt=.02563513231103432:Gt=-.004740081147303786;let Er;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Er=.057446442918106:Er=-.04404018270156349:Er=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Er=-.05930486238817954:t[1]>29.500000000000004?Er=.06955866121256543:t[8]>597.5000000000001?Er=-.06538593556505168:Er=.06212512595497445:Er=.00021102929959182257:t[9]>90.50000000000001?Er=.0958061289119631:t[102]>1e-35?Er=.07172059675638813:t[1]>47.50000000000001?Er=-.03879798603977766:t[297]>1e-35?Er=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?Er=.003805910996312012:Er=.09304295674749524:t[11]>1e-35?t[18]>1e-35?Er=.11252376801858695:t[288]>1e-35?Er=-.10293901912180432:Er=.014669268837893872:t[1]>42.50000000000001?Er=-.05988274123836837:t[145]>1e-35?Er=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?Er=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?Er=-.03366718308159971:Er=.11936550608549797:t[1]>31.500000000000004?Er=-.07454716789539667:Er=.027859650621164217:t[10]>10.500000000000002?Er=-.11806374092321247:Er=-.03506042229223101:Er=-.0007080765837654515:t[10]>6.500000000000001?Er=-.028077713664996503:t[2]>7.500000000000001?Er=.15803724124216814:Er=.0351381284833169:Er=-.07877953381054767;let dr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?dr=.14144941521975005:dr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?dr=.10514088112381886:t[7]>18.500000000000004?dr=-.10370643555956745:dr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?dr=-.0508129468802936:t[224]>1e-35?dr=-.037816066368733595:t[10]>43.50000000000001?dr=.07793408602607932:dr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?dr=.036972453794202324:dr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?dr=.09475302525132188:dr=-.03580104945898193:dr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?dr=-.1282448778804823:dr=-.014395808269207212:dr=-.008940927190750592:dr=-.1459118815453748:t[0]>4897.500000000001?dr=-.09733068457286576:t[1]>57.50000000000001?dr=.06575271409540207:dr=-.019556422817450115:dr=-.10623959222984136:t[18]>1e-35?dr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?dr=.008125645893104896:dr=-.11084368630465868:dr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?dr=-.05854904579626861:t[4]>5.500000000000001?dr=.02985784951394175:dr=-.03247600140149334:dr=-.11152899295304973:dr=-.00035424577714215764;let Ur;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Ur=-.06563670567578264:Ur=.067656954313663:Ur=-.10388217548685377:t[8]>2302.5000000000005?Ur=.07190621943790435:t[4]>67.50000000000001?Ur=.060020507643618604:t[4]>38.50000000000001?Ur=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Ur=-.06568134366461277:t[8]>1075.5000000000002?Ur=-.004768057709758692:Ur=.11785959165999467:Ur=-.05080221682879267:Ur=.14814206127494542:Ur=-.07241946332311736:t[253]>1e-35?Ur=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Ur=-.02471195342450034:Ur=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Ur=-.10741850739482771:Ur=.010051635824944:Ur=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Ur=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Ur=-.08992396138178163:Ur=.010944365997007212:Ur=.06221307021813793:Ur=.1286024087559141:t[127]>1e-35?Ur=.06568148624531012:t[10]>40.50000000000001?Ur=-.07567979134643352:t[5]>5647.500000000001?Ur=.07594672895572069:Ur=-.018158016446439187:t[6]>55.50000000000001?Ur=.009293422430111872:t[4]>45.50000000000001?Ur=-.017749818406964022:t[2]>46.50000000000001?Ur=.01714136511113982:Ur=-724762291423549e-19;let Wr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Wr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Wr=.07084726276890757:Wr=-.11232323677722932:Wr=.04812773089510436:Wr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Wr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Wr=.0879462816013881:Wr=-.002966662093626573:t[306]>1e-35?Wr=-.04588085188342676:Wr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Wr=-.006600332774461143:Wr=.1272481351557754:Wr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Wr=.011884312066620044:Wr=.11678751052403374:t[4]>8.500000000000002?Wr=.03627129613273813:Wr=-.12132783497902287:Wr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Wr=-.06830131718398992:t[0]>5147.500000000001?Wr=.062360406249609306:t[4]>4.500000000000001?Wr=-.013162203864592055:Wr=-.07153029184927609:Wr=.07628618062271557:Wr=-.12085065687320373:t[190]>1e-35?Wr=-.045816889524231186:t[137]>1e-35?Wr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Wr=.025895337822752502:Wr=-.06503949350616421:t[10]>227.50000000000003?Wr=-.09989456525790491:t[10]>130.50000000000003?Wr=.08616651057030683:Wr=.0001234981796706021;let zr;t[8]>1014.5000000000001?t[9]>137.50000000000003?zr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?zr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?zr=-.141732381961068:zr=-.0317152307496497:zr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?zr=.12191801556691254:zr=-.0003444689085397977:zr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?zr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?zr=-.05676033995381961:zr=.10933961076803381:t[4]>26.500000000000004?zr=-.11667582544549814:t[8]>1765.5000000000002?zr=.032174455312047705:zr=-.0755016390126608:t[293]>1e-35?zr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?zr=.026571311956824436:t[15]>1e-35?zr=.06175459479851121:zr=-.018778084411148754:t[9]>40.50000000000001?zr=-.09420232889965811:zr=-.004578248021263184:t[2]>1.5000000000000002?zr=.005453714644971445:zr=-.03907138175699279:zr=-.055296364182154736:t[23]>1e-35?zr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?zr=-.09358146510580179:zr=.060524657996178094:zr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?zr=-.12698331085931538:zr=.006059605604079918:t[2]>196.50000000000003?zr=-.09451315810804783:zr=.0011390147031687425;let zt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?zt=.05517359070460923:zt=-.04758751221404857:zt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?zt=.1040436595565776:t[9]>21.500000000000004?zt=.04032250517675179:t[107]>1e-35?zt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?zt=.1192453009230486:t[1]>51.50000000000001?zt=.0443376336292195:zt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?zt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?zt=-.08999822408398037:zt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?zt=-.061850439226075:zt=.08849196353361093:zt=.10536348167793089:t[92]>1e-35?zt=.04894947712119185:t[9]>16.500000000000004?zt=.05900227903883853:t[9]>5.500000000000001?zt=-.11946594348916476:zt=-.03652096348071964:t[1]>41.50000000000001?zt=-.07411603110840567:zt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?zt=.08493634342741495:t[11]>1e-35?zt=-.10899097825564363:zt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?zt=.08356655906359918:t[7]>25.500000000000004?zt=-.09475076526194888:t[10]>5.500000000000001?zt=-.01999406228763778:zt=.06696212545889428:t[6]>20.500000000000004?zt=.14713592661393468:zt=.0459917279002218:zt=.00027445928493734093;let Tr;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?Tr=-.06904501553217077:Tr=.05696231672035904:Tr=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?Tr=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?Tr=-.011419256378538392:t[0]>3830.5000000000005?Tr=.140315841503076:Tr=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?Tr=-.04027822909411164:Tr=.03176085103667189:Tr=.06779515865838849:t[4]>15.500000000000002?Tr=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?Tr=.06124039747298539:Tr=-.04312732764434027:Tr=.09161522761808062:Tr=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?Tr=.11211681010488772:t[13]>1e-35?Tr=.06725735814960367:Tr=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?Tr=.11743605068905603:Tr=-.011309033539148687:Tr=-.07896094707523052:Tr=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?Tr=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?Tr=.02836295848998302:Tr=.12210680366745175:Tr=-.058302317470509096:t[5]>4144.500000000001?Tr=.06123341960495106:Tr=-.03840046906926525:Tr=-.05221474543453495:Tr=.03988215485860711:Tr=-.00033074684693083496;let t0=vta(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+_+E+v+S+T+w+R+x+k+D+N+O+B+q+M+L+U+j+Q+Y+W+V+z+ie+H+re+le+Le+me+Oe+Te+te+ee+K+he+X+de+Be+ne+ue+Ne+xe+Fe+tt+st+vt+Pt+Ht+F+se+be+Ue+Qe+ge+Z+ve+Ge+qe+je+J+ae+Ce+Re+$e+Ye+ut+yt+$t+Tt+We+ce+Pe+Me+ye+oe+Ke+lt+Gt+Er+dr+Ur+Wr+zr+zt+Tr);return[1-t0,t0]}a(Joi,"multilineModelPredict");function vta(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(vta,"sigmoid");var Cta={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},Zoi={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function Xoi(t,e,r,n=!0){let o=t.split(` +`);if(n&&(o=o.filter(l=>l.trim().length>0)),Math.abs(e)>o.length||e>=o.length)return!1;e<0&&(e=o.length+e);let s=o[e];return(Cta[r]??[]).some(l=>s.includes(l))}a(Xoi,"hasComment");var sft=class{static{a(this,"PromptFeatures")}constructor(e,r){let[n,o]=this.firstAndLast(e),s=this.firstAndLast(e.trimEnd());this.language=r,this.length=e.length,this.firstLineLength=n.length,this.lastLineLength=o.length,this.lastLineRstripLength=o.trimEnd().length,this.lastLineStripLength=o.trim().length,this.rstripLength=e.trimEnd().length,this.stripLength=e.trim().length,this.rstripLastLineLength=s[1].length,this.rstripLastLineStripLength=s[1].trim().length,this.secondToLastLineHasComment=Xoi(e,-2,r),this.rstripSecondToLastLineHasComment=Xoi(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` `),this.lastChar=e.slice(-1),this.rstripLastChar=e.trimEnd().slice(-1),this.firstChar=e[0],this.lstripFirstChar=e.trimStart().slice(0,1)}firstAndLast(e){let r=e.split(` -`),n=r.length,o=r[0],s=r[n-1];return s==""&&n>1&&(s=r[n-2]),[o,s]}},Ygr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new oft(e,n),this.suffixFeatures=new oft(r,n)}constructFeatures(){let e=new Array(14).fill(0);e[0]=this.prefixFeatures.length,e[1]=this.prefixFeatures.firstLineLength,e[2]=this.prefixFeatures.lastLineLength,e[3]=this.prefixFeatures.lastLineRstripLength,e[4]=this.prefixFeatures.lastLineStripLength,e[5]=this.prefixFeatures.rstripLength,e[6]=this.prefixFeatures.rstripLastLineLength,e[7]=this.prefixFeatures.rstripLastLineStripLength,e[8]=this.suffixFeatures.length,e[9]=this.suffixFeatures.firstLineLength,e[10]=this.suffixFeatures.lastLineLength,e[11]=this.prefixFeatures.secondToLastLineHasComment?1:0,e[12]=this.prefixFeatures.rstripSecondToLastLineHasComment?1:0,e[13]=this.prefixFeatures.prefixEndsWithNewline?1:0;let r=new Array(Object.keys(Koi).length+1).fill(0);r[Koi[this.language]??0]=1;let n=new Array(Object.keys(r6).length+1).fill(0);n[r6[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(r6).length+1).fill(0);o[r6[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(r6).length+1).fill(0);s[r6[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(r6).length+1).fill(0);return c[r6[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function vta(t,e){return new Ygr(t.prefix,t.suffix,e)}a(vta,"constructMultilineFeatures");function Zoi(t,e){let r=vta(t,e).constructFeatures();return Yoi(r)[1]}a(Zoi,"requestMultilineScore");p();var Kgr=class t{constructor(e,r){this.index=e;this.documentPrefix=r;this.startOffset=0;this.text="";this.trimCount=0}static{a(this,"StreamingCompletion")}updateText(e){this.text=e}get addedToPrefix(){return this.text.substring(0,this.startOffset)}get effectivePrefix(){return this.documentPrefix+this.addedToPrefix}get effectiveText(){return this.text.substring(this.startOffset)}get isFirstCompletion(){return this.trimCount===0}get firstNewlineOffset(){let e=[...this.text.matchAll(/\r?\n/g)];return e.length>0&&e[0].index===0&&e.shift(),e.length>0?e[0].index:-1}trimAt(e){let r=new t(this.index,this.documentPrefix);return r.startOffset=this.startOffset,r.text=this.text.substring(0,this.startOffset+e),r.trimCount=this.trimCount,this.startOffset+=e,this.trimCount++,r}},sft=class{constructor(e,r,n,o,s,c){this.ctx=e;this.prefix=r;this.languageId=n;this.initialSingleLine=o;this.trimmerLookahead=s;this.cacheFunction=c;this.lineLimit=3;this.completions=new Map}static{a(this,"StreamedCompletionSplitter")}getFinishedCallback(){return async(e,r)=>{let n=r.index??0,o=this.getCompletion(n,e);if(o.isFirstCompletion&&this.initialSingleLine&&o.firstNewlineOffset>=0){let s={yieldSolution:!0,continueStreaming:!0,finishOffset:o.firstNewlineOffset};return o.trimAt(s.finishOffset),r.finished&&await this.trimAll(r,o),s}return r.finished?await this.trimAll(r,o):await this.trimOnce(r,o)}}getCompletion(e,r){let n=this.completions.get(e);return n||(n=new Kgr(e,this.prefix),this.completions.set(e,n)),n.updateText(r),n}async trimOnce(e,r){let n=await this.trim(r);return n===void 0?{yieldSolution:!1,continueStreaming:!0}:r.isFirstCompletion?(r.trimAt(n),{yieldSolution:!0,continueStreaming:!0,finishOffset:n}):(this.cacheCompletion(e,r,n),{yieldSolution:!1,continueStreaming:!0})}async trimAll(e,r){let n,o;do n=await this.trim(r),r.isFirstCompletion?(o=n,r.trimAt(n??r.effectiveText.length)):this.cacheCompletion(e,r,n);while(n!==void 0);return o!==void 0?{yieldSolution:!0,continueStreaming:!0,finishOffset:o}:{yieldSolution:!1,continueStreaming:!0}}async trim(e){return await new WWe(this.languageId,e.effectivePrefix,e.effectiveText,this.lineLimit,this.trimmerLookahead).getCompletionTrimOffset()}cacheCompletion(e,r,n){let o=r.trimAt(n??r.effectiveText.length);if(o.effectiveText.trim()==="")return;let s=rJe(this.ctx,o.effectiveText.trimEnd(),e.getAPIJsonData(),o.index,e.requestId,n!==void 0,e.telemetryData);s.copilotAnnotations=this.adjustedAnnotations(s,r,o),s.generatedChoiceIndex=o.trimCount,this.cacheFunction(o.addedToPrefix,s)}adjustedAnnotations(e,r,n){if(e.copilotAnnotations===void 0)return;let o=n.addedToPrefix.length,c=o+e.completionText.length>=r.text.length,l={};for(let[u,d]of Object.entries(e.copilotAnnotations)){let f=d.filter(h=>h.start_offset-o0).map(h=>{let m={...h};return m.start_offset-=o,m.stop_offset-=o,c||(m.stop_offset=Math.min(m.stop_offset,e.completionText.length)),m});f.length>0&&(l[u]=f)}return Object.keys(l).length>0?l:void 0}};p();p();var Ay=class{static{a(this,"InlineCompletionManager")}};var aft=new pe("getCompletions"),QMe="legacy",qMe=["activeDocumentLanguageId","afterAccept","afterCursorWhitespace","beforeCursorWhitespace","blockMode","cancelledNetworkRequest","choiceIndex","clientCompletionId","completionsImplementation","contextProviders","disposalReason","endpoint","engineChoiceSource","engineName","headerRequestId","isCycling","isMultiline","isSpeculative","languageId","modelName","n","neighborSource","opportunityId","performanceMetrics","promptMetadata","reason","request_option_code_annotations","request_option_extra","request_option_max_tokens","request_option_n","request_option_stream","request_option_temperature","request_option_top_p","status","temperature","uiKind","acceptance"];function cft(t,e,r){t.get(Ay).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=bge(r.resultType),n.properties.completionsImplementation??=QMe,ft(t,o,n),sr(t,o,K9(n.properties,qMe),n.measurements)}a(cft,"telemetryShown");function Xoi(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=QMe,ft(t,n,r),sr(t,n,K9(r.properties,qMe),r.measurements)}a(Xoi,"telemetryAccepted");function esi(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=QMe,ft(t,n,r),sr(t,n,K9(r.properties,qMe),r.measurements)}a(esi,"telemetryRejected");function TG(t,e={}){return t.properties.completionsImplementation??=QMe,{...e,telemetryBlob:t}}a(TG,"mkCanceledResultTelemetry");function xp(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??QMe};t.properties.sku!==void 0&&(r.sku=t.properties.sku),t.properties.opportunityId!==void 0&&(r.opportunityId=t.properties.opportunityId),t.properties.organizations_list!==void 0&&(r.organizations_list=t.properties.organizations_list),t.properties.enterprise_list!==void 0&&(r.enterprise_list=t.properties.enterprise_list),t.properties.clientCompletionId!==void 0&&(r.clientCompletionId=t.properties.clientCompletionId);let n=t.filtersAndExp.exp.assignmentContext;if(e){let s=e.get(sP).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(xp,"mkBasicResultTelemetry");function tsi(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=Rl()-e.telemetryBlob.issuedTime,n=bge(e.resultType),o=JSON.stringify(e.performanceMetrics),s={...e.telemetryData,reason:n,performanceMetrics:o},{foundOffset:c}=e.telemetryBlob.measurements,l=e.performanceMetrics?.map(([u,d])=>` -${d.toFixed(2)} ${u}`).join("")??"";return aft.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),gae(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(aft.debug(t,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){ft(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}gae(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(tsi,"handleGhostTextResultTelemetry");function bge(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(bge,"resultTypeToString");p();p();p();var Cta={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},bta="ms-vscode.cpptools",Sta="CppCompletionContextProvider";function rsi(t,e,r,n){(e.includes(Sta)||e.length===1&&e[0]==="*")&&isi(t,r,n)}a(rsi,"fillInCppVSActiveExperiments");function nsi(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(bta))&&isi(t,r,n)}a(nsi,"fillInCppVSCodeActiveExperiments");function isi(t,e,r){try{let n=Cta,o=t.get(tr).cppContextProviderParams(r);if(o)try{n=JSON.parse(o)}catch(s){Br.error(t,"Failed to parse cppContextProviderParams",s)}for(let[s,c]of Object.entries(n))e.set(s,c)}catch(n){Br.exception(t,n,"fillInCppActiveExperiments")}}a(isi,"addActiveExperiments");p();function lft(t,e,r){try{let n=t.get(tr).csharpContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Br.debug(t,"Failed to get the active C# experiments for the Context Provider API",n),!1}return!0}a(lft,"fillInCSharpActiveExperiments");p();var Jgr="fallbackContextProvider",Zgr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function osi(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Jgr))&&Tta(t,r,n)}a(osi,"fillInMultiLanguageActiveExperiments");function Tta(t,e,r){try{let n=Ita(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Br.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(Tta,"addActiveExperiments");function Ita(t,e){let r=Zgr,n=t.get(tr).multiLanguageContextProviderParams(e);if(n)try{r=JSON.parse(n)}catch(o){Br.error(t,"Failed to parse multiLanguageContextProviderParams",o)}return r}a(Ita,"getMultiLanguageContextProviderParamsFromExp");p();var xta="typescript-ai-context-provider";function ssi(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(xta)))return!1;try{let o=t.get(tr).tsContextProviderParams(n);if(o){let s=JSON.parse(o);for(let[c,l]of Object.entries(s))r.set(c,l)}}catch(o){return Br.debug(t,"Failed to get the active TypeScript experiments for the Context Provider API",o),!1}return!0}a(ssi,"fillInTsActiveExperiments");p();Fo();var asi=b.Object({importance:b.Optional(b.Integer({minimum:0,maximum:100})),id:b.Optional(b.String()),origin:b.Optional(b.Union([b.Literal("request"),b.Literal("update")]))}),csi=b.Intersect([b.Object({name:b.String(),value:b.String()}),asi]),lsi=b.Intersect([b.Object({uri:b.String(),value:b.String(),additionalUris:b.Optional(b.Array(b.String()))}),asi]),wta=[csi,lsi],Rta=b.Union(wta),kta=new Map([["Trait",Zu.Compile(csi)],["CodeSnippet",Zu.Compile(lsi)]]),Pta=a(t=>t,"ensureTypesAreEqual");Pta(!0);var Dta=b.Object({contextItems:b.Array(Rta)}),Nta=b.Object({selector:b.Array(b.Union([b.String(),b.Object({language:b.Optional(b.String()),scheme:b.Optional(b.String()),pattern:b.Optional(b.String())})]))}),Xgr=b.Object({id:b.String()}),Mta=b.Intersect([Xgr,Nta]),Ota=b.Intersect([Xgr,Dta]),usi=b.Object({providers:b.Array(Mta)}),dsi=b.Object({providers:b.Array(Xgr)}),e0r=b.Object({providers:b.Array(Ota),updating:b.Optional(b.Array(b.String()))}),fsi=b.Intersect([rIn,b.Object({contextItems:b.Optional(e0r)})]);function uft(t,e){return t.map(r=>{let n=r.data.filter(o=>o.type===e);return n.length>0?{...r,data:n}:void 0}).filter(r=>r!==void 0)}a(uft,"filterContextItemsByType");function psi(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of kta.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(psi,"filterSupportedContextItems");function Lta(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(Lta,"validateContextItemId");function hsi(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??Dt();if(!Lta(s)){let c=Dt();Br.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=Dt();Br.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a(hsi,"addOrValidateContextItemsIDs");p();var Rm=class{constructor(e=()=>new t0r){this.createStatistics=e;this.statistics=new Sn(25)}static{a(this,"ContextProviderStatistics")}getStatisticsForCompletion(e){let r=this.statistics.get(e);if(r)return r;let n=this.createStatistics();return this.statistics.set(e,n),n}getPreviousStatisticsForCompletion(e){let r=Array.from(this.statistics.keys());for(let n=r.length-1;n>=0;n--){let o=r[n];if(o!==e)return this.statistics.peek(o)}}},t0r=class{constructor(){this._expectations=new Map;this._lastResolution=new Map;this._statistics=new Map}static{a(this,"PerCompletionContextProviderStatistics")}addExpectations(e,r){let n=this._expectations.get(e)??[];this._expectations.set(e,[...n,...r])}clearExpectations(){this._expectations.clear()}setLastResolution(e,r){this._lastResolution.set(e,r)}get(e){return this._statistics.get(e)}computeMatch(e){try{for(let[r,n]of this._expectations){if(n.length===0)continue;let o=this._lastResolution.get(r)??"none";if(o==="none"||o==="error"){this._statistics.set(r,{usage:"none",resolution:o});continue}let s=[];for(let[d,f]of n){let h={id:d.id,type:d.type};if(d.origin&&(h.origin=d.origin),f==="content_excluded"){s.push({...h,usage:"none_content_excluded"});continue}let m=e.find(g=>g.source===d);m===void 0?s.push({...h,usage:"error"}):s.push({...h,usage:m.expectedTokens>0&&m.expectedTokens===m.actualTokens?"full":m.actualTokens>0?"partial":"none",expectedTokens:m.expectedTokens,actualTokens:m.actualTokens})}let l=s.reduce((d,f)=>f.usage==="full"?d+1:f.usage==="partial"?d+.5:d,0)/n.length,u=l===1?"full":l===0?"none":"partial";this._statistics.set(r,{resolution:o,usage:u,usageDetails:s})}}finally{this.clearExpectations(),this._lastResolution.clear()}}};function dft(t){return t.map(e=>{if(!(e.source===void 0||e.expectedTokens===void 0||e.actualTokens===void 0))return{source:e.source,expectedTokens:e.expectedTokens,actualTokens:e.actualTokens}}).filter(e=>e!==void 0)}a(dft,"componentStatisticsToPromptMatcher");var msi=fe(ii());var km=class{static{a(this,"ContextProviderRegistry")}},O4=class{static{a(this,"DefaultContextProviders")}},Sge=class extends O4{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},r0r=class extends km{constructor(r,n){super();this.ctx=r;this.match=n;this._providers=[]}static{a(this,"CoreContextProviderRegistry")}registerContextProvider(r){if(r.id.includes(",")||r.id.includes("*"))throw new Error(`A context provider id cannot contain a comma or an asterisk. The id ${r.id} is invalid.`);if(this._providers.find(n=>n.id===r.id))throw new Error(`A context provider with id ${r.id} has already been registered`);this._providers.push(r)}unregisterContextProvider(r){this._providers=this._providers.filter(n=>n.id!==r)}get providers(){return this._providers.slice()}async resolveAllProviders(r,n,o,s,c,l){if(c?.isCancellationRequested)return Br.debug(this.ctx,"Resolving context providers cancelled"),[];let u=new Map;lft(this.ctx,u,s);let d=[];if(this._providers.length===0)return d;let f=await this.matchProviders(o,s),h=f.filter(T=>T[1]>0);if(f.filter(T=>T[1]<=0).forEach(([T,w])=>{let R={providerId:T.id,matchScore:w,resolution:"none",resolutionTimeMs:0,data:[]};d.push(R)}),h.length===0)return d;if(c?.isCancellationRequested)return Br.debug(this.ctx,"Resolving context providers cancelled"),[];nsi(this.ctx,h.map(T=>T[0].id),u,s),osi(this.ctx,h.map(T=>T[0].id),u,s),ssi(this.ctx,h.map(T=>T[0].id),u,s);let g=new msi.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=aSe(this.ctx)&&!P7e(this.ctx)?0:Bta(this.ctx,s),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,_;A>0&&(_=setTimeout(()=>{g.cancel(),g.dispose()},A));let E=new Map,v={completionId:r,opportunityId:n,documentContext:o,activeExperiments:u,timeBudget:A,timeoutEnd:y,data:l};for(let[T]of h){let w=this.ctx.get(Rm).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);E.set(T.id,R)}let S=await D0n(E,g.token);_&&clearTimeout(_);for(let[T,w]of h){let R=S.get(T.id);if(R){if(R.status==="error")r2(R.reason)||Br.error(this.ctx,`Error resolving context from ${T.id}: `,R.reason),d.push({providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:[]});else{let x=[...R.value??[]];if((R.status==="none"||R.status==="partial")&&(Br.info(this.ctx,`Context provider ${T.id} exceeded time budget of ${A}ms`),T.resolver.resolveOnTimeout))try{let B=T.resolver.resolveOnTimeout(v);$9t(B)?x.push(...B):B&&x.push(B),x.length>0&&(R.status="partial")}catch(B){Br.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,B)}let[k,D]=psi(x);D&&Br.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=hsi(this.ctx,k),O={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(O)}this.ctx.get(Rm).getStatisticsForCompletion(r).setLastResolution(T.id,R.status)}else Br.error(this.ctx,`Context provider ${T.id} not found in results`)}return d.sort((T,w)=>w.matchScore-T.matchScore)}async matchProviders(r,n){let o=gsi(this.ctx,n),s=o.length===1&&o[0]==="*";return await Promise.all(this._providers.map(async l=>{if(!s&&!o.includes(l.id))return[l,0];let u=await this.match(this.ctx,l.selector,r);return[l,u]}))}get matchFunction(){return this.match}},n0r=class extends km{constructor(r){super();this.delegate=r;this._cachedContextItems=new Sn(5)}static{a(this,"CachedContextProviderRegistry")}registerContextProvider(r){this.delegate.registerContextProvider(r)}unregisterContextProvider(r){this.delegate.unregisterContextProvider(r)}get providers(){return this.delegate.providers}async resolveAllProviders(r,n,o,s,c,l){let u=this._cachedContextItems.get(r);if(r&&u&&u.length>0)return u;let d=await this.delegate.resolveAllProviders(r,n,o,s,c,l);return d.length>0&&r&&this._cachedContextItems.set(r,d),d}get matchFunction(){return this.delegate.matchFunction}};function fft(t,e){return new n0r(new r0r(t,e))}a(fft,"getContextProviderRegistry");function pft(t,e,r){let n=t.get(Rm).getStatisticsForCompletion(e);return r.map(s=>{let{providerId:c,resolution:l,resolutionTimeMs:u,matchScore:d,data:f}=s,h=n.get(c),m=h?.usage??"none";(d<=0||l==="none"||l==="error")&&(m="none");let g={providerId:c,resolution:l,resolutionTimeMs:u,usage:m,usageDetails:h?.usageDetails,matched:d>0,numResolvedItems:f.length},A=h?.usageDetails!==void 0?h?.usageDetails.filter(_=>_.usage==="full"||_.usage==="partial"||_.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(_=>_.usage==="partial"||_.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(pft,"telemetrizeContextItems");function hft(t){return t.matchScore>0&&t.resolution!=="error"}a(hft,"matchContextItems");function gsi(t,e){let r=i0r(t,e),n=kt(t,ze.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(O4).getIds();return Array.from(new Set([...o,...r,...n]))}a(gsi,"getActiveContextProviders");function i0r(t,e){return aSe(t)?["*"]:t.get(tr).contextProviders(e)}a(i0r,"getExpContextProviders");function Tge(t,e){return gsi(t,e).length>0}a(Tge,"useContextProviderAPI");function Bta(t,e){let r=kt(t,ze.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(tr).contextProviderTimeBudget(e)}a(Bta,"getContextProviderTimeBudget");var eS=class{constructor(e){this.ctx=e;this.scheduledResolutions=new Sn(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(km),{textDocument:u,originalPosition:d,originalOffset:f,originalVersion:h,editsWithPosition:m}=e,g=l.resolveAllProviders(r,n,{uri:u.uri,languageId:u.detectedLanguageId,version:h,offset:f,position:d,proposedEdits:m.length>0?m:void 0},o,s,c?.data);this.scheduledResolutions.set(r,g)}async resolution(e){let r=this.scheduledResolutions.get(e);return r?await r:[]}};p();p();var mft=class{constructor(e,r,n){this.languageId=e;this.nodeMatch=r;this.nodeTypesWithBlockOrStmtChild=n}static{a(this,"BaseBlockParser")}async getNodeMatchAtPosition(e,r,n){let o=await tq(this.languageId,e);try{let c=o.rootNode.descendantForIndex(r);for(;c;){let l=this.nodeMatch[c.type];if(l){if(!this.nodeTypesWithBlockOrStmtChild.has(c.type))break;let u=this.nodeTypesWithBlockOrStmtChild.get(c.type);if((u==""?c.namedChildren[0]:c.childForFieldName(u))?.type==l)break}c=c.parent}return c?n(c):void 0}finally{o.delete()}}getNextBlockAtPosition(e,r,n){return this.getNodeMatchAtPosition(e,r,o=>{let s=o.children.reverse().find(c=>c.type==this.nodeMatch[o.type]);if(s){if(this.languageId=="python"&&s.parent){let c=s.parent.type==":"?s.parent.parent:s.parent,l=c?.nextSibling;for(;l&&l.type=="comment";){let u=l.startPosition.row==s.endPosition.row&&l.startPosition.column>=s.endPosition.column,d=l.startPosition.row>c.endPosition.row&&l.startPosition.column>c.startPosition.column;if(u||d)s=l,l=l.nextSibling;else break}}if(!(s.endIndex>=s.tree.rootNode.endIndex-1&&(s.hasError||s.parent.hasError)))return n(s)}})}async isBlockBodyFinished(e,r,n){let o=(e+r).trimEnd(),s=await this.getNextBlockAtPosition(o,n,c=>c.endIndex);if(s!==void 0&&s0?c:void 0}}getNodeStart(e,r){let n=e.trimEnd();return this.getNodeMatchAtPosition(n,r,o=>o.startIndex)}},gft=class extends mft{constructor(r,n,o,s,c){super(r,s,c);this.blockEmptyMatch=n;this.lineMatch=o}static{a(this,"RegexBasedBlockParser")}isBlockStart(r){return this.lineMatch.test(r.trimStart())}async isBlockBodyEmpty(r,n){let o=await this.getNextBlockAtPosition(r,n,s=>{s.startIndex1&&(s=r[n-2]),[o,s]}},Kgr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new sft(e,n),this.suffixFeatures=new sft(r,n)}constructFeatures(){let e=new Array(14).fill(0);e[0]=this.prefixFeatures.length,e[1]=this.prefixFeatures.firstLineLength,e[2]=this.prefixFeatures.lastLineLength,e[3]=this.prefixFeatures.lastLineRstripLength,e[4]=this.prefixFeatures.lastLineStripLength,e[5]=this.prefixFeatures.rstripLength,e[6]=this.prefixFeatures.rstripLastLineLength,e[7]=this.prefixFeatures.rstripLastLineStripLength,e[8]=this.suffixFeatures.length,e[9]=this.suffixFeatures.firstLineLength,e[10]=this.suffixFeatures.lastLineLength,e[11]=this.prefixFeatures.secondToLastLineHasComment?1:0,e[12]=this.prefixFeatures.rstripSecondToLastLineHasComment?1:0,e[13]=this.prefixFeatures.prefixEndsWithNewline?1:0;let r=new Array(Object.keys(Zoi).length+1).fill(0);r[Zoi[this.language]??0]=1;let n=new Array(Object.keys(r6).length+1).fill(0);n[r6[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(r6).length+1).fill(0);o[r6[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(r6).length+1).fill(0);s[r6[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(r6).length+1).fill(0);return c[r6[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function bta(t,e){return new Kgr(t.prefix,t.suffix,e)}a(bta,"constructMultilineFeatures");function esi(t,e){let r=bta(t,e).constructFeatures();return Joi(r)[1]}a(esi,"requestMultilineScore");p();var Jgr=class t{constructor(e,r){this.index=e;this.documentPrefix=r;this.startOffset=0;this.text="";this.trimCount=0}static{a(this,"StreamingCompletion")}updateText(e){this.text=e}get addedToPrefix(){return this.text.substring(0,this.startOffset)}get effectivePrefix(){return this.documentPrefix+this.addedToPrefix}get effectiveText(){return this.text.substring(this.startOffset)}get isFirstCompletion(){return this.trimCount===0}get firstNewlineOffset(){let e=[...this.text.matchAll(/\r?\n/g)];return e.length>0&&e[0].index===0&&e.shift(),e.length>0?e[0].index:-1}trimAt(e){let r=new t(this.index,this.documentPrefix);return r.startOffset=this.startOffset,r.text=this.text.substring(0,this.startOffset+e),r.trimCount=this.trimCount,this.startOffset+=e,this.trimCount++,r}},aft=class{constructor(e,r,n,o,s,c){this.ctx=e;this.prefix=r;this.languageId=n;this.initialSingleLine=o;this.trimmerLookahead=s;this.cacheFunction=c;this.lineLimit=3;this.completions=new Map}static{a(this,"StreamedCompletionSplitter")}getFinishedCallback(){return async(e,r)=>{let n=r.index??0,o=this.getCompletion(n,e);if(o.isFirstCompletion&&this.initialSingleLine&&o.firstNewlineOffset>=0){let s={yieldSolution:!0,continueStreaming:!0,finishOffset:o.firstNewlineOffset};return o.trimAt(s.finishOffset),r.finished&&await this.trimAll(r,o),s}return r.finished?await this.trimAll(r,o):await this.trimOnce(r,o)}}getCompletion(e,r){let n=this.completions.get(e);return n||(n=new Jgr(e,this.prefix),this.completions.set(e,n)),n.updateText(r),n}async trimOnce(e,r){let n=await this.trim(r);return n===void 0?{yieldSolution:!1,continueStreaming:!0}:r.isFirstCompletion?(r.trimAt(n),{yieldSolution:!0,continueStreaming:!0,finishOffset:n}):(this.cacheCompletion(e,r,n),{yieldSolution:!1,continueStreaming:!0})}async trimAll(e,r){let n,o;do n=await this.trim(r),r.isFirstCompletion?(o=n,r.trimAt(n??r.effectiveText.length)):this.cacheCompletion(e,r,n);while(n!==void 0);return o!==void 0?{yieldSolution:!0,continueStreaming:!0,finishOffset:o}:{yieldSolution:!1,continueStreaming:!0}}async trim(e){return await new WWe(this.languageId,e.effectivePrefix,e.effectiveText,this.lineLimit,this.trimmerLookahead).getCompletionTrimOffset()}cacheCompletion(e,r,n){let o=r.trimAt(n??r.effectiveText.length);if(o.effectiveText.trim()==="")return;let s=rJe(this.ctx,o.effectiveText.trimEnd(),e.getAPIJsonData(),o.index,e.requestId,n!==void 0,e.telemetryData);s.copilotAnnotations=this.adjustedAnnotations(s,r,o),s.generatedChoiceIndex=o.trimCount,this.cacheFunction(o.addedToPrefix,s)}adjustedAnnotations(e,r,n){if(e.copilotAnnotations===void 0)return;let o=n.addedToPrefix.length,c=o+e.completionText.length>=r.text.length,l={};for(let[u,d]of Object.entries(e.copilotAnnotations)){let f=d.filter(h=>h.start_offset-o0).map(h=>{let m={...h};return m.start_offset-=o,m.stop_offset-=o,c||(m.stop_offset=Math.min(m.stop_offset,e.completionText.length)),m});f.length>0&&(l[u]=f)}return Object.keys(l).length>0?l:void 0}};p();p();var Ay=class{static{a(this,"InlineCompletionManager")}};var cft=new pe("getCompletions"),QMe="legacy",qMe=["activeDocumentLanguageId","afterAccept","afterCursorWhitespace","beforeCursorWhitespace","blockMode","cancelledNetworkRequest","choiceIndex","clientCompletionId","completionsImplementation","contextProviders","disposalReason","endpoint","engineChoiceSource","engineName","headerRequestId","isCycling","isMultiline","isSpeculative","languageId","modelName","n","neighborSource","opportunityId","performanceMetrics","promptMetadata","reason","request_option_code_annotations","request_option_extra","request_option_max_tokens","request_option_n","request_option_stream","request_option_temperature","request_option_top_p","status","temperature","uiKind","acceptance"];function lft(t,e,r){t.get(Ay).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=bge(r.resultType),n.properties.completionsImplementation??=QMe,ft(t,o,n),sr(t,o,K9(n.properties,qMe),n.measurements)}a(lft,"telemetryShown");function tsi(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=QMe,ft(t,n,r),sr(t,n,K9(r.properties,qMe),r.measurements)}a(tsi,"telemetryAccepted");function rsi(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=QMe,ft(t,n,r),sr(t,n,K9(r.properties,qMe),r.measurements)}a(rsi,"telemetryRejected");function IG(t,e={}){return t.properties.completionsImplementation??=QMe,{...e,telemetryBlob:t}}a(IG,"mkCanceledResultTelemetry");function xp(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??QMe};t.properties.sku!==void 0&&(r.sku=t.properties.sku),t.properties.opportunityId!==void 0&&(r.opportunityId=t.properties.opportunityId),t.properties.organizations_list!==void 0&&(r.organizations_list=t.properties.organizations_list),t.properties.enterprise_list!==void 0&&(r.enterprise_list=t.properties.enterprise_list),t.properties.clientCompletionId!==void 0&&(r.clientCompletionId=t.properties.clientCompletionId);let n=t.filtersAndExp.exp.assignmentContext;if(e){let s=e.get(sP).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(xp,"mkBasicResultTelemetry");function nsi(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=Rl()-e.telemetryBlob.issuedTime,n=bge(e.resultType),o=JSON.stringify(e.performanceMetrics),s={...e.telemetryData,reason:n,performanceMetrics:o},{foundOffset:c}=e.telemetryBlob.measurements,l=e.performanceMetrics?.map(([u,d])=>` +${d.toFixed(2)} ${u}`).join("")??"";return cft.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),Aae(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(cft.debug(t,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){ft(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}Aae(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(nsi,"handleGhostTextResultTelemetry");function bge(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(bge,"resultTypeToString");p();p();p();var Sta={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},Tta="ms-vscode.cpptools",Ita="CppCompletionContextProvider";function isi(t,e,r,n){(e.includes(Ita)||e.length===1&&e[0]==="*")&&ssi(t,r,n)}a(isi,"fillInCppVSActiveExperiments");function osi(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Tta))&&ssi(t,r,n)}a(osi,"fillInCppVSCodeActiveExperiments");function ssi(t,e,r){try{let n=Sta,o=t.get(tr).cppContextProviderParams(r);if(o)try{n=JSON.parse(o)}catch(s){Fr.error(t,"Failed to parse cppContextProviderParams",s)}for(let[s,c]of Object.entries(n))e.set(s,c)}catch(n){Fr.exception(t,n,"fillInCppActiveExperiments")}}a(ssi,"addActiveExperiments");p();function uft(t,e,r){try{let n=t.get(tr).csharpContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Fr.debug(t,"Failed to get the active C# experiments for the Context Provider API",n),!1}return!0}a(uft,"fillInCSharpActiveExperiments");p();var Zgr="fallbackContextProvider",Xgr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function asi(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Zgr))&&xta(t,r,n)}a(asi,"fillInMultiLanguageActiveExperiments");function xta(t,e,r){try{let n=wta(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Fr.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(xta,"addActiveExperiments");function wta(t,e){let r=Xgr,n=t.get(tr).multiLanguageContextProviderParams(e);if(n)try{r=JSON.parse(n)}catch(o){Fr.error(t,"Failed to parse multiLanguageContextProviderParams",o)}return r}a(wta,"getMultiLanguageContextProviderParamsFromExp");p();var Rta="typescript-ai-context-provider";function csi(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(Rta)))return!1;try{let o=t.get(tr).tsContextProviderParams(n);if(o){let s=JSON.parse(o);for(let[c,l]of Object.entries(s))r.set(c,l)}}catch(o){return Fr.debug(t,"Failed to get the active TypeScript experiments for the Context Provider API",o),!1}return!0}a(csi,"fillInTsActiveExperiments");p();Fo();var lsi=b.Object({importance:b.Optional(b.Integer({minimum:0,maximum:100})),id:b.Optional(b.String()),origin:b.Optional(b.Union([b.Literal("request"),b.Literal("update")]))}),usi=b.Intersect([b.Object({name:b.String(),value:b.String()}),lsi]),dsi=b.Intersect([b.Object({uri:b.String(),value:b.String(),additionalUris:b.Optional(b.Array(b.String()))}),lsi]),kta=[usi,dsi],Pta=b.Union(kta),Dta=new Map([["Trait",Zu.Compile(usi)],["CodeSnippet",Zu.Compile(dsi)]]),Nta=a(t=>t,"ensureTypesAreEqual");Nta(!0);var Mta=b.Object({contextItems:b.Array(Pta)}),Ota=b.Object({selector:b.Array(b.Union([b.String(),b.Object({language:b.Optional(b.String()),scheme:b.Optional(b.String()),pattern:b.Optional(b.String())})]))}),e0r=b.Object({id:b.String()}),Lta=b.Intersect([e0r,Ota]),Bta=b.Intersect([e0r,Mta]),fsi=b.Object({providers:b.Array(Lta)}),psi=b.Object({providers:b.Array(e0r)}),t0r=b.Object({providers:b.Array(Bta),updating:b.Optional(b.Array(b.String()))}),hsi=b.Intersect([nIn,b.Object({contextItems:b.Optional(t0r)})]);function dft(t,e){return t.map(r=>{let n=r.data.filter(o=>o.type===e);return n.length>0?{...r,data:n}:void 0}).filter(r=>r!==void 0)}a(dft,"filterContextItemsByType");function msi(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of Dta.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(msi,"filterSupportedContextItems");function Fta(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(Fta,"validateContextItemId");function gsi(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??Dt();if(!Fta(s)){let c=Dt();Fr.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=Dt();Fr.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a(gsi,"addOrValidateContextItemsIDs");p();var km=class{constructor(e=()=>new r0r){this.createStatistics=e;this.statistics=new Sn(25)}static{a(this,"ContextProviderStatistics")}getStatisticsForCompletion(e){let r=this.statistics.get(e);if(r)return r;let n=this.createStatistics();return this.statistics.set(e,n),n}getPreviousStatisticsForCompletion(e){let r=Array.from(this.statistics.keys());for(let n=r.length-1;n>=0;n--){let o=r[n];if(o!==e)return this.statistics.peek(o)}}},r0r=class{constructor(){this._expectations=new Map;this._lastResolution=new Map;this._statistics=new Map}static{a(this,"PerCompletionContextProviderStatistics")}addExpectations(e,r){let n=this._expectations.get(e)??[];this._expectations.set(e,[...n,...r])}clearExpectations(){this._expectations.clear()}setLastResolution(e,r){this._lastResolution.set(e,r)}get(e){return this._statistics.get(e)}computeMatch(e){try{for(let[r,n]of this._expectations){if(n.length===0)continue;let o=this._lastResolution.get(r)??"none";if(o==="none"||o==="error"){this._statistics.set(r,{usage:"none",resolution:o});continue}let s=[];for(let[d,f]of n){let h={id:d.id,type:d.type};if(d.origin&&(h.origin=d.origin),f==="content_excluded"){s.push({...h,usage:"none_content_excluded"});continue}let m=e.find(g=>g.source===d);m===void 0?s.push({...h,usage:"error"}):s.push({...h,usage:m.expectedTokens>0&&m.expectedTokens===m.actualTokens?"full":m.actualTokens>0?"partial":"none",expectedTokens:m.expectedTokens,actualTokens:m.actualTokens})}let l=s.reduce((d,f)=>f.usage==="full"?d+1:f.usage==="partial"?d+.5:d,0)/n.length,u=l===1?"full":l===0?"none":"partial";this._statistics.set(r,{resolution:o,usage:u,usageDetails:s})}}finally{this.clearExpectations(),this._lastResolution.clear()}}};function fft(t){return t.map(e=>{if(!(e.source===void 0||e.expectedTokens===void 0||e.actualTokens===void 0))return{source:e.source,expectedTokens:e.expectedTokens,actualTokens:e.actualTokens}}).filter(e=>e!==void 0)}a(fft,"componentStatisticsToPromptMatcher");var Asi=fe(ii());var Pm=class{static{a(this,"ContextProviderRegistry")}},O4=class{static{a(this,"DefaultContextProviders")}},Sge=class extends O4{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},n0r=class extends Pm{constructor(r,n){super();this.ctx=r;this.match=n;this._providers=[]}static{a(this,"CoreContextProviderRegistry")}registerContextProvider(r){if(r.id.includes(",")||r.id.includes("*"))throw new Error(`A context provider id cannot contain a comma or an asterisk. The id ${r.id} is invalid.`);if(this._providers.find(n=>n.id===r.id))throw new Error(`A context provider with id ${r.id} has already been registered`);this._providers.push(r)}unregisterContextProvider(r){this._providers=this._providers.filter(n=>n.id!==r)}get providers(){return this._providers.slice()}async resolveAllProviders(r,n,o,s,c,l){if(c?.isCancellationRequested)return Fr.debug(this.ctx,"Resolving context providers cancelled"),[];let u=new Map;uft(this.ctx,u,s);let d=[];if(this._providers.length===0)return d;let f=await this.matchProviders(o,s),h=f.filter(T=>T[1]>0);if(f.filter(T=>T[1]<=0).forEach(([T,w])=>{let R={providerId:T.id,matchScore:w,resolution:"none",resolutionTimeMs:0,data:[]};d.push(R)}),h.length===0)return d;if(c?.isCancellationRequested)return Fr.debug(this.ctx,"Resolving context providers cancelled"),[];osi(this.ctx,h.map(T=>T[0].id),u,s),asi(this.ctx,h.map(T=>T[0].id),u,s),csi(this.ctx,h.map(T=>T[0].id),u,s);let g=new Asi.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=aSe(this.ctx)&&!P7e(this.ctx)?0:Uta(this.ctx,s),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,_;A>0&&(_=setTimeout(()=>{g.cancel(),g.dispose()},A));let E=new Map,v={completionId:r,opportunityId:n,documentContext:o,activeExperiments:u,timeBudget:A,timeoutEnd:y,data:l};for(let[T]of h){let w=this.ctx.get(km).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);E.set(T.id,R)}let S=await N0n(E,g.token);_&&clearTimeout(_);for(let[T,w]of h){let R=S.get(T.id);if(R){if(R.status==="error")r2(R.reason)||Fr.error(this.ctx,`Error resolving context from ${T.id}: `,R.reason),d.push({providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:[]});else{let x=[...R.value??[]];if((R.status==="none"||R.status==="partial")&&(Fr.info(this.ctx,`Context provider ${T.id} exceeded time budget of ${A}ms`),T.resolver.resolveOnTimeout))try{let B=T.resolver.resolveOnTimeout(v);V9t(B)?x.push(...B):B&&x.push(B),x.length>0&&(R.status="partial")}catch(B){Fr.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,B)}let[k,D]=msi(x);D&&Fr.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=gsi(this.ctx,k),O={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(O)}this.ctx.get(km).getStatisticsForCompletion(r).setLastResolution(T.id,R.status)}else Fr.error(this.ctx,`Context provider ${T.id} not found in results`)}return d.sort((T,w)=>w.matchScore-T.matchScore)}async matchProviders(r,n){let o=ysi(this.ctx,n),s=o.length===1&&o[0]==="*";return await Promise.all(this._providers.map(async l=>{if(!s&&!o.includes(l.id))return[l,0];let u=await this.match(this.ctx,l.selector,r);return[l,u]}))}get matchFunction(){return this.match}},i0r=class extends Pm{constructor(r){super();this.delegate=r;this._cachedContextItems=new Sn(5)}static{a(this,"CachedContextProviderRegistry")}registerContextProvider(r){this.delegate.registerContextProvider(r)}unregisterContextProvider(r){this.delegate.unregisterContextProvider(r)}get providers(){return this.delegate.providers}async resolveAllProviders(r,n,o,s,c,l){let u=this._cachedContextItems.get(r);if(r&&u&&u.length>0)return u;let d=await this.delegate.resolveAllProviders(r,n,o,s,c,l);return d.length>0&&r&&this._cachedContextItems.set(r,d),d}get matchFunction(){return this.delegate.matchFunction}};function pft(t,e){return new i0r(new n0r(t,e))}a(pft,"getContextProviderRegistry");function hft(t,e,r){let n=t.get(km).getStatisticsForCompletion(e);return r.map(s=>{let{providerId:c,resolution:l,resolutionTimeMs:u,matchScore:d,data:f}=s,h=n.get(c),m=h?.usage??"none";(d<=0||l==="none"||l==="error")&&(m="none");let g={providerId:c,resolution:l,resolutionTimeMs:u,usage:m,usageDetails:h?.usageDetails,matched:d>0,numResolvedItems:f.length},A=h?.usageDetails!==void 0?h?.usageDetails.filter(_=>_.usage==="full"||_.usage==="partial"||_.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(_=>_.usage==="partial"||_.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(hft,"telemetrizeContextItems");function mft(t){return t.matchScore>0&&t.resolution!=="error"}a(mft,"matchContextItems");function ysi(t,e){let r=o0r(t,e),n=kt(t,ze.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(O4).getIds();return Array.from(new Set([...o,...r,...n]))}a(ysi,"getActiveContextProviders");function o0r(t,e){return aSe(t)?["*"]:t.get(tr).contextProviders(e)}a(o0r,"getExpContextProviders");function Tge(t,e){return ysi(t,e).length>0}a(Tge,"useContextProviderAPI");function Uta(t,e){let r=kt(t,ze.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(tr).contextProviderTimeBudget(e)}a(Uta,"getContextProviderTimeBudget");var eS=class{constructor(e){this.ctx=e;this.scheduledResolutions=new Sn(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(Pm),{textDocument:u,originalPosition:d,originalOffset:f,originalVersion:h,editsWithPosition:m}=e,g=l.resolveAllProviders(r,n,{uri:u.uri,languageId:u.detectedLanguageId,version:h,offset:f,position:d,proposedEdits:m.length>0?m:void 0},o,s,c?.data);this.scheduledResolutions.set(r,g)}async resolution(e){let r=this.scheduledResolutions.get(e);return r?await r:[]}};p();p();var gft=class{constructor(e,r,n){this.languageId=e;this.nodeMatch=r;this.nodeTypesWithBlockOrStmtChild=n}static{a(this,"BaseBlockParser")}async getNodeMatchAtPosition(e,r,n){let o=await tq(this.languageId,e);try{let c=o.rootNode.descendantForIndex(r);for(;c;){let l=this.nodeMatch[c.type];if(l){if(!this.nodeTypesWithBlockOrStmtChild.has(c.type))break;let u=this.nodeTypesWithBlockOrStmtChild.get(c.type);if((u==""?c.namedChildren[0]:c.childForFieldName(u))?.type==l)break}c=c.parent}return c?n(c):void 0}finally{o.delete()}}getNextBlockAtPosition(e,r,n){return this.getNodeMatchAtPosition(e,r,o=>{let s=o.children.reverse().find(c=>c.type==this.nodeMatch[o.type]);if(s){if(this.languageId=="python"&&s.parent){let c=s.parent.type==":"?s.parent.parent:s.parent,l=c?.nextSibling;for(;l&&l.type=="comment";){let u=l.startPosition.row==s.endPosition.row&&l.startPosition.column>=s.endPosition.column,d=l.startPosition.row>c.endPosition.row&&l.startPosition.column>c.startPosition.column;if(u||d)s=l,l=l.nextSibling;else break}}if(!(s.endIndex>=s.tree.rootNode.endIndex-1&&(s.hasError||s.parent.hasError)))return n(s)}})}async isBlockBodyFinished(e,r,n){let o=(e+r).trimEnd(),s=await this.getNextBlockAtPosition(o,n,c=>c.endIndex);if(s!==void 0&&s0?c:void 0}}getNodeStart(e,r){let n=e.trimEnd();return this.getNodeMatchAtPosition(n,r,o=>o.startIndex)}},Aft=class extends gft{constructor(r,n,o,s,c){super(r,s,c);this.blockEmptyMatch=n;this.lineMatch=o}static{a(this,"RegexBasedBlockParser")}isBlockStart(r){return this.lineMatch.test(r.trimStart())}async isBlockBodyEmpty(r,n){let o=await this.getNextBlockAtPosition(r,n,s=>{s.startIndex0&&/\s/.test(t.charAt(r-1));)r--;return r}a(ysi,"rewindToNearestNonWs");function Asi(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(Asi,"indent");function Uta(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=Asi(t,r),o=Asi(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(Uta,"outdented");var L4=class extends mft{constructor(r,n,o,s,c,l,u){super(r,n,o);this.startKeywords=s;this.blockNodeType=c;this.emptyStatementType=l;this.curlyBraceLanguage=u}static{a(this,"TreeSitterBasedBlockParser")}isBlockEmpty(r,n){let o=r.text.trim();return this.curlyBraceLanguage&&(o.startsWith("{")&&(o=o.slice(1)),o.endsWith("}")&&(o=o.slice(0,-1)),o=o.trim()),!!(o.length==0||this.languageId=="python"&&(r.parent?.type=="class_definition"||r.parent?.type=="function_definition")&&r.children.length==1&&Mgn(r.parent))}async isEmptyBlockStart(r,n){if(n>r.length)throw new RangeError("Invalid offset");for(let c=n;cA.type==";")&&h.endIndex<=n}h=h.parent}}let l=null,u=null,d=null,f=c;for(;f!=null;){if(f.type==this.blockNodeType){u=f;break}if(this.nodeMatch[f.type]){d=f;break}if(f.type=="ERROR"){l=f;break}f=f.parent}if(u!=null){if(!u.parent||!this.nodeMatch[u.parent.type])return!1;if(this.languageId=="python"){let h=u.previousSibling;if(h!=null&&h.hasError&&(h.text.startsWith('"""')||h.text.startsWith("'''")))return!0}return this.isBlockEmpty(u,n)}if(l!=null){if(l.previousSibling?.type=="module"||l.previousSibling?.type=="internal_module"||l.previousSibling?.type=="def")return!0;if(this.languageId==="python"&&s>=14&&l.hasError&&(l.text.startsWith('"')||l.text.startsWith("'"))){let A=l.parent?.type;if(A==="function_definition"||A==="class_definition"||A==="module")return!0}let h=[...l.children].reverse(),m=h.find(A=>this.startKeywords.includes(A.type)),g=h.find(A=>A.type==this.blockNodeType);if(m){switch(this.languageId){case"python":{m.type=="try"&&c.type=="identifier"&&c.text.length>4&&(g=h.find(_=>_.hasError)?.children.find(_=>_.type=="block"));let A,y=0;for(let _ of l.children){if(_.type==":"&&y==0){A=_;break}_.type=="("&&(y+=1),_.type==")"&&(y-=1)}if(A&&m.endIndex<=A.startIndex&&A.nextSibling){if(m.type=="def"){let _=A.nextSibling;if(_.type=='"'||_.type=="'"||_.type=="ERROR"&&(_.text=='"""'||_.text=="'''"))return!0}return!1}break}case"javascript":{if(m.type==="class")if(s<=13){if(h.find(E=>E.type==="formal_parameters"))return!0}else{let _=l.children;for(let E=0;E<_.length;E++)if(_[E].type==="formal_parameters")return E+1===_.length||_[E+1]?.type==="{"&&E+2===_.length}let A=h.find(_=>_.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(_=>_.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}case"typescript":{let A=h.find(_=>_.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(_=>_.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}}return g&&g.startIndex>m.endIndex?this.isBlockEmpty(g,n):!0}}if(d!=null){let h=this.nodeMatch[d.type],m=d.children.slice().reverse().find(g=>g.type==h);if(m)return this.isBlockEmpty(m,n);if(this.nodeTypesWithBlockOrStmtChild.has(d.type)){let g=this.nodeTypesWithBlockOrStmtChild.get(d.type),A=g==""?d.children[0]:d.childForFieldName(g);if(A&&A.type!=this.blockNodeType&&A.type!=this.emptyStatementType)return!1}return!0}return!1}finally{o.delete()}}},Qta={python:new L4("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new L4("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new L4("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),tsx:new L4("typescriptreact",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new gft("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new gft("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map),"c-sharp":new L4("csharp",{},new Map([]),[],"block",null,!0),java:new L4("java",{},new Map([]),[],"block",null,!0),php:new L4("php",{},new Map([]),[],"block",null,!0),cpp:new L4("cpp",{},new Map([]),[],"block",null,!0)};function o0r(t){if(!tT(t))throw new Error(`Language ${t} is not supported`);return Qta[$We(t)]}a(o0r,"getBlockParser");async function _si(t,e,r){return tT(t)?o0r(t).isEmptyBlockStart(e,r):!1}a(_si,"isEmptyBlockStart");async function Esi(t,e,r,n){if(tT(t))return o0r(t).isBlockBodyFinished(e,r,n)}a(Esi,"isBlockBodyFinished");async function vsi(t,e,r){if(tT(t))return o0r(t).getNodeStart(e,r)}a(vsi,"getNodeStart");var PHf=new pe("parseBlock");function jMe(t,e,r){let n=e.getText(wu.range(wu.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>Esi(s,n,c,o)}a(jMe,"parsingBlockFinished");function yft(t,e){return _si(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(yft,"isEmptyBlockStartUtil");async function Csi(t,e,r,n){let s=e.getText(wu.range(wu.position(0,0),r))+n,c=await vsi(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(Csi,"getNodeStartUtil");var qta=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),jta=new RegExp(`^(${qta.join("|")})`);function Hta(t){return jta.test(t.trimLeft().toLowerCase())}a(Hta,"isContinuationLine");function Aft(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(Aft,"indentationOfLine");function _ft(t,e){let r=t.getText(),n=t.offsetAt(e);return s0r(r,n,t.detectedLanguageId)}a(_ft,"contextIndentation");function s0r(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(Qta,"getLineAtOffset");function Esi(t,e){let r=e;for(;r>0&&/\s/.test(t.charAt(r-1));)r--;return r}a(Esi,"rewindToNearestNonWs");function _si(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(_si,"indent");function qta(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=_si(t,r),o=_si(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(qta,"outdented");var L4=class extends gft{constructor(r,n,o,s,c,l,u){super(r,n,o);this.startKeywords=s;this.blockNodeType=c;this.emptyStatementType=l;this.curlyBraceLanguage=u}static{a(this,"TreeSitterBasedBlockParser")}isBlockEmpty(r,n){let o=r.text.trim();return this.curlyBraceLanguage&&(o.startsWith("{")&&(o=o.slice(1)),o.endsWith("}")&&(o=o.slice(0,-1)),o=o.trim()),!!(o.length==0||this.languageId=="python"&&(r.parent?.type=="class_definition"||r.parent?.type=="function_definition")&&r.children.length==1&&Ogn(r.parent))}async isEmptyBlockStart(r,n){if(n>r.length)throw new RangeError("Invalid offset");for(let c=n;cA.type==";")&&h.endIndex<=n}h=h.parent}}let l=null,u=null,d=null,f=c;for(;f!=null;){if(f.type==this.blockNodeType){u=f;break}if(this.nodeMatch[f.type]){d=f;break}if(f.type=="ERROR"){l=f;break}f=f.parent}if(u!=null){if(!u.parent||!this.nodeMatch[u.parent.type])return!1;if(this.languageId=="python"){let h=u.previousSibling;if(h!=null&&h.hasError&&(h.text.startsWith('"""')||h.text.startsWith("'''")))return!0}return this.isBlockEmpty(u,n)}if(l!=null){if(l.previousSibling?.type=="module"||l.previousSibling?.type=="internal_module"||l.previousSibling?.type=="def")return!0;if(this.languageId==="python"&&s>=14&&l.hasError&&(l.text.startsWith('"')||l.text.startsWith("'"))){let A=l.parent?.type;if(A==="function_definition"||A==="class_definition"||A==="module")return!0}let h=[...l.children].reverse(),m=h.find(A=>this.startKeywords.includes(A.type)),g=h.find(A=>A.type==this.blockNodeType);if(m){switch(this.languageId){case"python":{m.type=="try"&&c.type=="identifier"&&c.text.length>4&&(g=h.find(_=>_.hasError)?.children.find(_=>_.type=="block"));let A,y=0;for(let _ of l.children){if(_.type==":"&&y==0){A=_;break}_.type=="("&&(y+=1),_.type==")"&&(y-=1)}if(A&&m.endIndex<=A.startIndex&&A.nextSibling){if(m.type=="def"){let _=A.nextSibling;if(_.type=='"'||_.type=="'"||_.type=="ERROR"&&(_.text=='"""'||_.text=="'''"))return!0}return!1}break}case"javascript":{if(m.type==="class")if(s<=13){if(h.find(E=>E.type==="formal_parameters"))return!0}else{let _=l.children;for(let E=0;E<_.length;E++)if(_[E].type==="formal_parameters")return E+1===_.length||_[E+1]?.type==="{"&&E+2===_.length}let A=h.find(_=>_.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(_=>_.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}case"typescript":{let A=h.find(_=>_.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(_=>_.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}}return g&&g.startIndex>m.endIndex?this.isBlockEmpty(g,n):!0}}if(d!=null){let h=this.nodeMatch[d.type],m=d.children.slice().reverse().find(g=>g.type==h);if(m)return this.isBlockEmpty(m,n);if(this.nodeTypesWithBlockOrStmtChild.has(d.type)){let g=this.nodeTypesWithBlockOrStmtChild.get(d.type),A=g==""?d.children[0]:d.childForFieldName(g);if(A&&A.type!=this.blockNodeType&&A.type!=this.emptyStatementType)return!1}return!0}return!1}finally{o.delete()}}},jta={python:new L4("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new L4("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new L4("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),tsx:new L4("typescriptreact",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new Aft("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new Aft("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map),"c-sharp":new L4("csharp",{},new Map([]),[],"block",null,!0),java:new L4("java",{},new Map([]),[],"block",null,!0),php:new L4("php",{},new Map([]),[],"block",null,!0),cpp:new L4("cpp",{},new Map([]),[],"block",null,!0)};function s0r(t){if(!tT(t))throw new Error(`Language ${t} is not supported`);return jta[$We(t)]}a(s0r,"getBlockParser");async function vsi(t,e,r){return tT(t)?s0r(t).isEmptyBlockStart(e,r):!1}a(vsi,"isEmptyBlockStart");async function Csi(t,e,r,n){if(tT(t))return s0r(t).isBlockBodyFinished(e,r,n)}a(Csi,"isBlockBodyFinished");async function bsi(t,e,r){if(tT(t))return s0r(t).getNodeStart(e,r)}a(bsi,"getNodeStart");var OHf=new pe("parseBlock");function jMe(t,e,r){let n=e.getText(wu.range(wu.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>Csi(s,n,c,o)}a(jMe,"parsingBlockFinished");function _ft(t,e){return vsi(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(_ft,"isEmptyBlockStartUtil");async function Ssi(t,e,r,n){let s=e.getText(wu.range(wu.position(0,0),r))+n,c=await bsi(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(Ssi,"getNodeStartUtil");var Hta=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),Gta=new RegExp(`^(${Hta.join("|")})`);function $ta(t){return Gta.test(t.trimLeft().toLowerCase())}a($ta,"isContinuationLine");function yft(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(yft,"indentationOfLine");function Eft(t,e){let r=t.getText(),n=t.offsetAt(e);return a0r(r,n,t.detectedLanguageId)}a(Eft,"contextIndentation");function a0r(t,e,r){let n=t.slice(0,e).split(` `),o=t.slice(e).split(` -`);function s(f,h,m){let g=h,A,y;for(;A===void 0&&g>=0&&g=0&&!f[g].trim().startsWith('"""');)g--;if(g>=0)for(A=void 0,g--;A===void 0&&g>=0;)A=Aft(f[g]),y=g,g--}}return[A,y]}a(s,"seekNonBlank");let[c,l]=s(n,n.length-1,-1),u=(()=>{if(!(c===void 0||l===void 0))for(let f=l-1;f>=0;f--){let h=Aft(n[f]);if(h!==void 0&&h=0&&g=0&&!f[g].trim().startsWith('"""');)g--;if(g>=0)for(A=void 0,g--;A===void 0&&g>=0;)A=yft(f[g]),y=g,g--}}return[A,y]}a(s,"seekNonBlank");let[c,l]=s(n,n.length-1,-1),u=(()=>{if(!(c===void 0||l===void 0))for(let f=l-1;f>=0;f--){let h=yft(n[f]);if(h!==void 0&&h{let n=$ta(r,t,e);return n==="continue"?void 0:n}}a(bsi,"indentationBlockFinished");p();p();p();p();p();p();var Vta={tokenizerName:"o200k_base"};function Wta(t){return{...Vta,...t}}a(Wta,"cursorContextOptions");function HMe(t,e={}){let r=Wta(e),n=Ms(r.tokenizerName);if(r.maxLineCount!==void 0&&r.maxLineCount<0)throw new Error("maxLineCount must be non-negative if defined");if(r.maxTokenLength!==void 0&&r.maxTokenLength<0)throw new Error("maxTokenLength must be non-negative if defined");if(r.maxLineCount===0||r.maxTokenLength===0)return{context:"",lineCount:0,tokenLength:0,tokenizerName:r.tokenizerName};let o=t.source.slice(0,t.offset);return r.maxLineCount!==void 0&&(o=o.split(` +`).pop(),c=0;if(o&&s?.trim()!=""&&n[0].trim()!==""&&c++,!o&&Vta&&n[0].trim()===""&&c++,o||c++,n.length===c)return"continue";let l=Math.max(e.current,e.next??0);for(let u=c;u{let n=Wta(r,t,e);return n==="continue"?void 0:n}}a(Tsi,"indentationBlockFinished");p();p();p();p();p();p();var zta={tokenizerName:"o200k_base"};function Yta(t){return{...zta,...t}}a(Yta,"cursorContextOptions");function HMe(t,e={}){let r=Yta(e),n=Ms(r.tokenizerName);if(r.maxLineCount!==void 0&&r.maxLineCount<0)throw new Error("maxLineCount must be non-negative if defined");if(r.maxTokenLength!==void 0&&r.maxTokenLength<0)throw new Error("maxTokenLength must be non-negative if defined");if(r.maxLineCount===0||r.maxTokenLength===0)return{context:"",lineCount:0,tokenLength:0,tokenizerName:r.tokenizerName};let o=t.source.slice(0,t.offset);return r.maxLineCount!==void 0&&(o=o.split(` `).slice(-r.maxLineCount).join(` `)),r.maxTokenLength!==void 0&&(o=n.takeLastLinesTokens(o,r.maxTokenLength)),{context:o,lineCount:o.split(` -`).length,tokenLength:n.tokenLength(o),tokenizerName:r.tokenizerName}}a(HMe,"getCursorContext");p();p();var zta={function:"function",snippet:"snippet",snippets:"snippets",variable:"variable",parameter:"parameter",method:"method",class:"class",module:"module",alias:"alias","enum member":"enum member",interface:"interface"};function Ssi(t){let e=zta[t.semantics],r=["snippets"].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(Ssi,"announceSnippet");var a0r=class{constructor(e){this.keys=[];this.cache={};this.size=e}static{a(this,"FifoCache")}put(e,r){if(this.cache[e]=r,this.keys.length>this.size){this.keys.push(e);let n=this.keys.shift()??"";delete this.cache[n]}}get(e){return this.cache[e]}};var c0r=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=Zta.get(e.languageId)??Jta}tokenize(e){return new Set(Yta(e).filter(r=>!this.stopsForLanguage.has(r)))}},Tsi=new a0r(20),Ige=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new c0r(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r="descending"){return r=="ascending"?e.sort((n,o)=>n.score>o.score?1:-1):r=="descending"?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r="descending"){let n=[];if(e.source.length===0||(await this.referenceTokens).size===0)return n;let o=e.source.split(` -`),s=this.id()+":"+e.source,c=Tsi.get(s)??[],l=c.length==0,u=l?o.map(d=>this.tokenizer.tokenize(d),this.tokenizer):[];for(let[d,[f,h]]of this.getWindowsDelineations(o).entries()){if(l){let A=new Set;u.slice(f,h).forEach(y=>y.forEach(_=>A.add(_),A)),c.push(A)}let m=c[d],g=this.similarityScore(m,await this.referenceTokens);if(n.length&&f>0&&n[n.length-1].endLine>f){n[n.length-1].scorethis.size){this.keys.push(e);let n=this.keys.shift()??"";delete this.cache[n]}}get(e){return this.cache[e]}};var l0r=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=era.get(e.languageId)??Xta}tokenize(e){return new Set(Jta(e).filter(r=>!this.stopsForLanguage.has(r)))}},xsi=new c0r(20),Ige=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new l0r(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r="descending"){return r=="ascending"?e.sort((n,o)=>n.score>o.score?1:-1):r=="descending"?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r="descending"){let n=[];if(e.source.length===0||(await this.referenceTokens).size===0)return n;let o=e.source.split(` +`),s=this.id()+":"+e.source,c=xsi.get(s)??[],l=c.length==0,u=l?o.map(d=>this.tokenizer.tokenize(d),this.tokenizer):[];for(let[d,[f,h]]of this.getWindowsDelineations(o).entries()){if(l){let A=new Set;u.slice(f,h).forEach(y=>y.forEach(_=>A.add(_),A)),c.push(A)}let m=c[d],g=this.similarityScore(m,await this.referenceTokens);if(n.length&&f>0&&n[n.length-1].endLine>f){n[n.length-1].scoree.length>0)}a(Yta,"splitIntoWords");var Kta=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),Jta=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...Kta]),Zta=new Map([]);p();function Eft(t,e){let r=[],n=e.length;if(n==0)return[];if(n({to:a(r=>new t(r,e),"to")}),"FACTORY")}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return Eft(this.windowLength,e)}_getCursorContextInfo(e){return HMe(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return Xta(e,r)}};function Xta(t,e){let r=new Set;return t.forEach(n=>{e.has(n)&&r.add(n)}),r.size/(t.size+e.size-r.size)}a(Xta,"computeScore");p();var Cft=class t extends Ige{static{a(this,"BlockTokenSubsetMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=a(e=>({to:a(r=>new t(r,e),"to")}),"FACTORY")}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return Eft(this.windowLength,e)}_getCursorContextInfo(e){return HMe(e,{maxLineCount:this.windowLength})}get referenceTokens(){return this.createReferenceTokensForLanguage()}async createReferenceTokensForLanguage(){return this.referenceTokensCache?this.referenceTokensCache:(this.referenceTokensCache=t.syntaxAwareSupportsLanguage(this.referenceDoc.languageId)?await this.syntaxAwareReferenceTokens():await super.referenceTokens,this.referenceTokensCache)}async syntaxAwareReferenceTokens(){let e=(await this.getEnclosingMemberStart(this.referenceDoc.source,this.referenceDoc.offset))?.startIndex,r=this.referenceDoc.offset,n=e?this.referenceDoc.source.slice(e,r):HMe(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return era(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await tq(this.referenceDoc.languageId,e);let o=n.rootNode.namedDescendantForIndex(r);for(;o&&!(t.isMember(o)||t.isBlock(o));)o=o.parent??void 0;return o}finally{n?.delete()}}static isMember(e){switch(e?.type){case"method_declaration":case"property_declaration":case"field_declaration":case"constructor_declaration":return!0;default:return!1}}static isBlock(e){switch(e?.type){case"class_declaration":case"struct_declaration":case"record_declaration":case"enum_declaration":case"interface_declaration":return!0;default:return!1}}};function era(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(era,"computeScore");var tra=0,rra=60,nra=4,ira=1,ora=20,sra=1e4,Isi={snippetLength:rra,threshold:tra,maxTopSnippets:nra,maxCharPerFile:sra,maxNumberOfFiles:ora,maxSnippetsPerFile:ira,useSubsetMatching:!1};var l0r={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function ara(t,e){return(e.useSubsetMatching?Cft.FACTORY(e.snippetLength):vft.FACTORY(e.snippetLength)).to(t)}a(ara,"getMatcher");async function xsi(t,e,r){let n=ara(t,r);return r.maxTopSnippets===0?[]:(await e.filter(s=>s.source.length0).slice(0,r.maxNumberOfFiles).reduce(async(s,c)=>(await s).concat((await n.findMatches(c,r.maxSnippetsPerFile)).map(l=>({relativePath:c.relativePath,...l}))),Promise.resolve([]))).filter(s=>s.score&&s.snippet&&s.score>r.threshold).sort((s,c)=>s.score-c.score).slice(-r.maxTopSnippets)}a(xsi,"getSimilarSnippets");function wsi(t,e){return{...l0r,useSubsetMatching:u0r(t,e)}}a(wsi,"getCppSimilarFilesOptions");function Rsi(t){return l0r.maxTopSnippets}a(Rsi,"getCppNumberOfSnippets");var cra=new Map([["cpp",wsi]]);function bft(t,e,r){let n=cra.get(r);return n?n(t,e):{...Isi,useSubsetMatching:u0r(t,e)}}a(bft,"getSimilarFilesOptions");var lra=new Map([["cpp",Rsi]]);function ksi(t,e){let r=lra.get(e);return r?r(t):Pgn}a(ksi,"getNumberOfSnippets");function u0r(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||kt(t,ze.UseSubsetMatching))??!1}a(u0r,"useSubsetMatching");p();p();p();p();var ura="content_excluded";async function Sft(t,e,r,n){let o=uft(r,"CodeSnippet");if(o.length===0)return[];let s=new Set,c=o.flatMap(f=>f.data.map(h=>(s.add(h.uri),h.additionalUris?.forEach(m=>s.add(m)),{providerId:f.providerId,data:h}))),l=t.get($r),u=new Map;await Promise.all(Array.from(s).map(async f=>{u.set(f,await l.getTextDocumentValidation({uri:f}))}));let d=t.get(Rm).getStatisticsForCompletion(e);return c.filter(f=>{let m=[f.data.uri,...f.data.additionalUris??[]].every(g=>u.get(g)?.status==="valid");return m?d.addExpectations(f.providerId,[[f.data,"included"]]):d.addExpectations(f.providerId,[[f.data,ura]]),m}).map(f=>f.data)}a(Sft,"getCodeSnippetsFromContextItems");function Psi(t,e){let r=t.get($r);return e.map(n=>({snippet:n,relativePath:r.getRelativePath(n)}))}a(Psi,"addRelativePathToCodeSnippets");p();function wp(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(wp,"Text");function IG(t){return t.children}a(IG,"Chunk");p();function Zn(t,e,r){let n=[];Array.isArray(e.children)?n=e.children:e.children&&(n=[e.children]);let o={...e,children:n};return r&&(o.key=r),{type:t,props:o}}a(Zn,"functionComponentFunction");function yD(t){return{type:"f",children:t}}a(yD,"fragmentFunction");yD.isFragmentFunction=!0;var Tft=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(tS,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=Psi(t.ctx,r),l=new Map;for(let d of c){let f=d.relativePath??d.snippet.uri,h=l.get(f);h===void 0&&(h=[],l.set(f,h)),h.push(d)}let u=[];for(let[d,f]of l.entries()){let h=f.filter(m=>m.snippet.value.length>0);h.length>0&&u.push({chunkElements:h.map(m=>m.snippet),importance:Math.max(...h.map(m=>m.snippet.importance??0)),uri:d})}if(u.length!==0)return u.sort((d,f)=>f.importance-d.importance),u.reverse(),u.map(d=>{let f=[];return f.push(Zn(wp,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push(Zn(wp,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&mArray.from({length:e.length}).map(()=>0));for(let n=0;n{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=h0r(c);return Zn(yD,{children:[Zn(Fee,{document:r,position:o,maxCharacters:m}),Zn(wft,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a($Me,"CurrentFile");function Fee(t){if(t.document===void 0||t.position===void 0)return Zn(wp,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),Zn(wp,{children:e})}a(Fee,"BeforeCursor");function wft(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return Zn(wp,{});let o=t.document.getText({start:t.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}});o.length>t.maxCharacters&&(o=o.slice(0,t.maxCharacters));let s=o.replace(/^.*/,"").trimStart();if(s==="")return Zn(wp,{});if(r===s)return Zn(wp,{children:r});let c=s;if(r!==""){let l=Ms(t.tokenizer),u=l.takeFirstTokens(s,GMe);u.tokens.length>0&&100*xft(u.tokens,l.takeFirstTokens(r,GMe).tokens)?.score<(t.suffixMatchThreshold??qWe)*u.tokens.length&&(c=r)}return c!==r&&n(c),Zn(wp,{children:c})}a(wft,"AfterCursor");function Dsi(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(tS,d=>{let f=d.document;(d.document.uri!==r?.uri||f.getText()!==r?.getText())&&n(f),d.position!==o&&s(d.position),d.maxPromptTokens!==c&&l(d.maxPromptTokens)});let u=h0r(c);return Zn(Fee,{document:r,position:o,maxCharacters:u})}a(Dsi,"DocumentPrefix");function Nsi(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(tS,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=h0r(c);return Zn(wft,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(Nsi,"DocumentSuffix");p();var Rft=class{static{a(this,"WishlistElision")}elide(e,r,n,o,s){if(r<=0)throw new Error("Prefix limit must be greater than 0");let[c,l]=this.preparePrefixBlocks(e,s),{elidedSuffix:u,adjustedPrefixTokenLimit:d}=this.elideSuffix(n,o,r,l,s),f=this.elidePrefix(c,d,l,s);return{blocks:[u,...f],cycles:1}}preparePrefixBlocks(e,r){let n=0,o=new Set;return[e.map((c,l)=>{let u=0,f=c.value.split(/([^\n]*\n+)/).filter(m=>m!=="").map(m=>{let g=r.tokenLength(m);return u+=g,n+=g,{line:m,componentPath:c.componentPath,tokens:g}}),h=c.componentPath;if(o.has(h))throw new Error(`Duplicate component path in prefix blocks: ${h}`);return o.add(h),{...c,tokens:u,markedForRemoval:!1,originalIndex:l,lines:f}}),n]}elideSuffix(e,r,n,o,s){let c=e.value;if(c.length===0||r<=0)return{elidedSuffix:{...e,tokens:0,elidedValue:"",elidedTokens:0},adjustedPrefixTokenLimit:n+Math.max(0,r)};o!f.markedForRemoval).flatMap(f=>f.lines);if(c.length===0)return[];let[l,u]=this.trimPrefixLinesToFit(c,r,o),d=u;return s.map(f=>{if(f.markedForRemoval)return d+f.tokens<=r&&!f.chunks?(d+=f.tokens,{...f,elidedValue:f.value,elidedTokens:f.tokens}):{...f,elidedValue:"",elidedTokens:0};let h=l.filter(g=>g.componentPath===f.componentPath&&g.line!=="").map(g=>g.line).join(""),m=f.tokens;return h!==f.value&&(m=h!==""?o.tokenLength(h):0),{...f,elidedValue:h,elidedTokens:m}})}removeLowWeightPrefixBlocks(e,r,n){let o=n;e.sort((s,c)=>s.weight-c.weight);for(let s of e){if(o<=r)break;if(s.weight!==1&&!(s.chunks&&s.markedForRemoval))if(s.chunks&&s.chunks.size>0)for(let c of e)!c.markedForRemoval&&c.chunks&&[...s.chunks].every(l=>c.chunks?.has(l))&&(c.markedForRemoval=!0,o-=c.tokens);else s.markedForRemoval=!0,o-=s.tokens}return e.sort((s,c)=>s.originalIndex-c.originalIndex)}trimPrefixLinesToFit(e,r,n){let o=0,s=[];for(let c=e.length-1;c>=0;c--){let l=e[c],u=l.tokens;if(o+u<=r)s.unshift(l),o+=u;else break}if(s.length===0){let c=e[e.length-1];if(c&&c.line.length>0){let u=n.takeLastTokens(c.line,r);return s.push({line:u.text,componentPath:c.componentPath,tokens:u.tokens.length}),[s,u.tokens.length]}let l=`Cannot fit prefix within limit of ${r} tokens`;throw new Error(l)}return[s,o]}};function Msi(t){return t.map(e=>e.elidedValue).join("")}a(Msi,"makePrompt");function Osi(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(Osi,"makePrefixPrompt");function Lsi(t){if(t.length===0)return[];let e=new Map;for(let o of t)if(o.type==="context"&&o.index!==void 0){e.has(o.index)||e.set(o.index,[]);let s=o.elidedValue.trim();s.length>0&&e.get(o.index).push(s)}let r=Math.max(...Array.from(e.keys()),-1),n=[];for(let o=0;o<=r;o++){let s=e.get(o);if(s&&s.length>0){let c=s.join(` -`).trim();n.push(c)}else n.push("")}return n}a(Lsi,"makeContextPrompt");p();var xge=class{constructor(e,r=m0r()){this.snapshot=e;this.transformers=r}static{a(this,"SnapshotWalker")}walkSnapshot(e){this.walkSnapshotNode(this.snapshot,void 0,e,{})}walkSnapshotNode(e,r,n,o){let s=this.transformers.reduce((l,u)=>u(e,r,l),{...o});if(n(e,r,s))for(let l of e.children??[])this.walkSnapshotNode(l,e,n,s)}};function m0r(){return[(t,e,r)=>{r.weight===void 0&&(r.weight=1);let n=t.props?.weight??1,o=typeof n=="number"?Math.max(0,Math.min(1,n)):1;return{...r,weight:o*r.weight}},(t,e,r)=>{if(t.name===IG.name){let n=r.chunks?new Set(r.chunks):new Set;return n.add(t.path),{...r,chunks:n}}return r},(t,e,r)=>t.props?.source!==void 0?{...r,source:t.props.source}:r]}a(m0r,"defaultTransformers");p();var g0r={abap:{lineComment:{start:'"',end:""},markdownLanguageIds:["abap","sap-abap"]},aspdotnet:{lineComment:{start:"<%--",end:"--%>"}},bat:{lineComment:{start:"REM",end:""}},bibtex:{lineComment:{start:"%",end:""},markdownLanguageIds:["bibtex"]},blade:{lineComment:{start:"#",end:""}},BluespecSystemVerilog:{lineComment:{start:"//",end:""}},c:{lineComment:{start:"//",end:""},markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";",end:""},markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["coffeescript","coffee","cson","iced"]},cpp:{lineComment:{start:"//",end:""},markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"]},csharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["csharp","cs"]},css:{lineComment:{start:"/*",end:"*/"}},cuda:{lineComment:{start:"//",end:""}},dart:{lineComment:{start:"//",end:""}},dockerfile:{lineComment:{start:"#",end:""},markdownLanguageIds:["dockerfile","docker"]},dotenv:{lineComment:{start:"#",end:""}},elixir:{lineComment:{start:"#",end:""}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%",end:""},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"]},go:{lineComment:{start:"//",end:""},markdownLanguageIds:["go","golang"]},graphql:{lineComment:{start:"#",end:""}},groovy:{lineComment:{start:"//",end:""}},haml:{lineComment:{start:"-#",end:""}},handlebars:{lineComment:{start:"{{!",end:"}}"},markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"]},haskell:{lineComment:{start:"--",end:""},markdownLanguageIds:["haskell","hs"]},hlsl:{lineComment:{start:"//",end:""}},html:{lineComment:{start:""},markdownLanguageIds:["html","xhtml"]},ini:{lineComment:{start:";",end:""}},java:{lineComment:{start:"//",end:""},markdownLanguageIds:["java","jsp"]},javascript:{lineComment:{start:"//",end:""},markdownLanguageIds:["javascript","js"]},javascriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},jsonc:{lineComment:{start:"//",end:""}},jsx:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#",end:""},markdownLanguageIds:["julia","jl"]},kotlin:{lineComment:{start:"//",end:""},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%",end:""},markdownLanguageIds:["tex"]},legend:{lineComment:{start:"//",end:""}},less:{lineComment:{start:"//",end:""}},lua:{lineComment:{start:"--",end:""},markdownLanguageIds:["lua","pluto"]},makefile:{lineComment:{start:"#",end:""},markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:"[]: #",end:""},markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec","mm","objc","obj-c"]},"objective-cpp":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#",end:""},markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//",end:""}},powershell:{lineComment:{start:"#",end:""},markdownLanguageIds:["powershell","ps","ps1"]},pug:{lineComment:{start:"//",end:""}},python:{lineComment:{start:"#",end:""},markdownLanguageIds:["python","py","gyp"]},ql:{lineComment:{start:"//",end:""}},r:{lineComment:{start:"#",end:""}},razor:{lineComment:{start:""},markdownLanguageIds:["cshtml","razor","razor-cshtml"]},ruby:{lineComment:{start:"#",end:""},markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"]},rust:{lineComment:{start:"//",end:""},markdownLanguageIds:["rust","rs"]},sass:{lineComment:{start:"//",end:""}},scala:{lineComment:{start:"//",end:""}},scss:{lineComment:{start:"//",end:""}},shellscript:{lineComment:{start:"#",end:""},markdownLanguageIds:["bash","sh","zsh"]},slang:{lineComment:{start:"//",end:""}},slim:{lineComment:{start:"/",end:""}},solidity:{lineComment:{start:"//",end:""},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--",end:""}},stylus:{lineComment:{start:"//",end:""}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//",end:""}},systemverilog:{lineComment:{start:"//",end:""}},terraform:{lineComment:{start:"#",end:""}},tex:{lineComment:{start:"%",end:""}},typescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["typescript","ts"]},typescriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["tsx"]},vb:{lineComment:{start:"'",end:""},markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//",end:""}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//",end:""}},xml:{lineComment:{start:""}},xsl:{lineComment:{start:""}},yaml:{lineComment:{start:"#",end:""},markdownLanguageIds:["yaml","yml"]}},Bsi={};for(let[t,e]of Object.entries(g0r))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)Bsi[r]=t;else Bsi[t]=t;var dra={start:"//",end:""},fra=["php","plaintext"],A0r={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function Fsi(t){return Object.values(A0r).includes(t.trim())}a(Fsi,"isShebangLine");function pra({source:t}){return t.startsWith("#!")||t.startsWith("e.length>0)}a(Jta,"splitIntoWords");var Zta=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),Xta=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...Zta]),era=new Map([]);p();function vft(t,e){let r=[],n=e.length;if(n==0)return[];if(n({to:a(r=>new t(r,e),"to")}),"FACTORY")}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return vft(this.windowLength,e)}_getCursorContextInfo(e){return HMe(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return tra(e,r)}};function tra(t,e){let r=new Set;return t.forEach(n=>{e.has(n)&&r.add(n)}),r.size/(t.size+e.size-r.size)}a(tra,"computeScore");p();var bft=class t extends Ige{static{a(this,"BlockTokenSubsetMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=a(e=>({to:a(r=>new t(r,e),"to")}),"FACTORY")}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return vft(this.windowLength,e)}_getCursorContextInfo(e){return HMe(e,{maxLineCount:this.windowLength})}get referenceTokens(){return this.createReferenceTokensForLanguage()}async createReferenceTokensForLanguage(){return this.referenceTokensCache?this.referenceTokensCache:(this.referenceTokensCache=t.syntaxAwareSupportsLanguage(this.referenceDoc.languageId)?await this.syntaxAwareReferenceTokens():await super.referenceTokens,this.referenceTokensCache)}async syntaxAwareReferenceTokens(){let e=(await this.getEnclosingMemberStart(this.referenceDoc.source,this.referenceDoc.offset))?.startIndex,r=this.referenceDoc.offset,n=e?this.referenceDoc.source.slice(e,r):HMe(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return rra(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await tq(this.referenceDoc.languageId,e);let o=n.rootNode.namedDescendantForIndex(r);for(;o&&!(t.isMember(o)||t.isBlock(o));)o=o.parent??void 0;return o}finally{n?.delete()}}static isMember(e){switch(e?.type){case"method_declaration":case"property_declaration":case"field_declaration":case"constructor_declaration":return!0;default:return!1}}static isBlock(e){switch(e?.type){case"class_declaration":case"struct_declaration":case"record_declaration":case"enum_declaration":case"interface_declaration":return!0;default:return!1}}};function rra(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(rra,"computeScore");var nra=0,ira=60,ora=4,sra=1,ara=20,cra=1e4,wsi={snippetLength:ira,threshold:nra,maxTopSnippets:ora,maxCharPerFile:cra,maxNumberOfFiles:ara,maxSnippetsPerFile:sra,useSubsetMatching:!1};var u0r={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function lra(t,e){return(e.useSubsetMatching?bft.FACTORY(e.snippetLength):Cft.FACTORY(e.snippetLength)).to(t)}a(lra,"getMatcher");async function Rsi(t,e,r){let n=lra(t,r);return r.maxTopSnippets===0?[]:(await e.filter(s=>s.source.length0).slice(0,r.maxNumberOfFiles).reduce(async(s,c)=>(await s).concat((await n.findMatches(c,r.maxSnippetsPerFile)).map(l=>({relativePath:c.relativePath,...l}))),Promise.resolve([]))).filter(s=>s.score&&s.snippet&&s.score>r.threshold).sort((s,c)=>s.score-c.score).slice(-r.maxTopSnippets)}a(Rsi,"getSimilarSnippets");function ksi(t,e){return{...u0r,useSubsetMatching:d0r(t,e)}}a(ksi,"getCppSimilarFilesOptions");function Psi(t){return u0r.maxTopSnippets}a(Psi,"getCppNumberOfSnippets");var ura=new Map([["cpp",ksi]]);function Sft(t,e,r){let n=ura.get(r);return n?n(t,e):{...wsi,useSubsetMatching:d0r(t,e)}}a(Sft,"getSimilarFilesOptions");var dra=new Map([["cpp",Psi]]);function Dsi(t,e){let r=dra.get(e);return r?r(t):Dgn}a(Dsi,"getNumberOfSnippets");function d0r(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||kt(t,ze.UseSubsetMatching))??!1}a(d0r,"useSubsetMatching");p();p();p();p();var fra="content_excluded";async function Tft(t,e,r,n){let o=dft(r,"CodeSnippet");if(o.length===0)return[];let s=new Set,c=o.flatMap(f=>f.data.map(h=>(s.add(h.uri),h.additionalUris?.forEach(m=>s.add(m)),{providerId:f.providerId,data:h}))),l=t.get($r),u=new Map;await Promise.all(Array.from(s).map(async f=>{u.set(f,await l.getTextDocumentValidation({uri:f}))}));let d=t.get(km).getStatisticsForCompletion(e);return c.filter(f=>{let m=[f.data.uri,...f.data.additionalUris??[]].every(g=>u.get(g)?.status==="valid");return m?d.addExpectations(f.providerId,[[f.data,"included"]]):d.addExpectations(f.providerId,[[f.data,fra]]),m}).map(f=>f.data)}a(Tft,"getCodeSnippetsFromContextItems");function Nsi(t,e){let r=t.get($r);return e.map(n=>({snippet:n,relativePath:r.getRelativePath(n)}))}a(Nsi,"addRelativePathToCodeSnippets");p();function wp(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(wp,"Text");function xG(t){return t.children}a(xG,"Chunk");p();function Zn(t,e,r){let n=[];Array.isArray(e.children)?n=e.children:e.children&&(n=[e.children]);let o={...e,children:n};return r&&(o.key=r),{type:t,props:o}}a(Zn,"functionComponentFunction");function yD(t){return{type:"f",children:t}}a(yD,"fragmentFunction");yD.isFragmentFunction=!0;var Ift=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(tS,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=Nsi(t.ctx,r),l=new Map;for(let d of c){let f=d.relativePath??d.snippet.uri,h=l.get(f);h===void 0&&(h=[],l.set(f,h)),h.push(d)}let u=[];for(let[d,f]of l.entries()){let h=f.filter(m=>m.snippet.value.length>0);h.length>0&&u.push({chunkElements:h.map(m=>m.snippet),importance:Math.max(...h.map(m=>m.snippet.importance??0)),uri:d})}if(u.length!==0)return u.sort((d,f)=>f.importance-d.importance),u.reverse(),u.map(d=>{let f=[];return f.push(Zn(wp,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push(Zn(wp,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&mArray.from({length:e.length}).map(()=>0));for(let n=0;n{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=m0r(c);return Zn(yD,{children:[Zn(Uee,{document:r,position:o,maxCharacters:m}),Zn(Rft,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a($Me,"CurrentFile");function Uee(t){if(t.document===void 0||t.position===void 0)return Zn(wp,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),Zn(wp,{children:e})}a(Uee,"BeforeCursor");function Rft(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return Zn(wp,{});let o=t.document.getText({start:t.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}});o.length>t.maxCharacters&&(o=o.slice(0,t.maxCharacters));let s=o.replace(/^.*/,"").trimStart();if(s==="")return Zn(wp,{});if(r===s)return Zn(wp,{children:r});let c=s;if(r!==""){let l=Ms(t.tokenizer),u=l.takeFirstTokens(s,GMe);u.tokens.length>0&&100*wft(u.tokens,l.takeFirstTokens(r,GMe).tokens)?.score<(t.suffixMatchThreshold??qWe)*u.tokens.length&&(c=r)}return c!==r&&n(c),Zn(wp,{children:c})}a(Rft,"AfterCursor");function Msi(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(tS,d=>{let f=d.document;(d.document.uri!==r?.uri||f.getText()!==r?.getText())&&n(f),d.position!==o&&s(d.position),d.maxPromptTokens!==c&&l(d.maxPromptTokens)});let u=m0r(c);return Zn(Uee,{document:r,position:o,maxCharacters:u})}a(Msi,"DocumentPrefix");function Osi(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(tS,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=m0r(c);return Zn(Rft,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(Osi,"DocumentSuffix");p();var kft=class{static{a(this,"WishlistElision")}elide(e,r,n,o,s){if(r<=0)throw new Error("Prefix limit must be greater than 0");let[c,l]=this.preparePrefixBlocks(e,s),{elidedSuffix:u,adjustedPrefixTokenLimit:d}=this.elideSuffix(n,o,r,l,s),f=this.elidePrefix(c,d,l,s);return{blocks:[u,...f],cycles:1}}preparePrefixBlocks(e,r){let n=0,o=new Set;return[e.map((c,l)=>{let u=0,f=c.value.split(/([^\n]*\n+)/).filter(m=>m!=="").map(m=>{let g=r.tokenLength(m);return u+=g,n+=g,{line:m,componentPath:c.componentPath,tokens:g}}),h=c.componentPath;if(o.has(h))throw new Error(`Duplicate component path in prefix blocks: ${h}`);return o.add(h),{...c,tokens:u,markedForRemoval:!1,originalIndex:l,lines:f}}),n]}elideSuffix(e,r,n,o,s){let c=e.value;if(c.length===0||r<=0)return{elidedSuffix:{...e,tokens:0,elidedValue:"",elidedTokens:0},adjustedPrefixTokenLimit:n+Math.max(0,r)};o!f.markedForRemoval).flatMap(f=>f.lines);if(c.length===0)return[];let[l,u]=this.trimPrefixLinesToFit(c,r,o),d=u;return s.map(f=>{if(f.markedForRemoval)return d+f.tokens<=r&&!f.chunks?(d+=f.tokens,{...f,elidedValue:f.value,elidedTokens:f.tokens}):{...f,elidedValue:"",elidedTokens:0};let h=l.filter(g=>g.componentPath===f.componentPath&&g.line!=="").map(g=>g.line).join(""),m=f.tokens;return h!==f.value&&(m=h!==""?o.tokenLength(h):0),{...f,elidedValue:h,elidedTokens:m}})}removeLowWeightPrefixBlocks(e,r,n){let o=n;e.sort((s,c)=>s.weight-c.weight);for(let s of e){if(o<=r)break;if(s.weight!==1&&!(s.chunks&&s.markedForRemoval))if(s.chunks&&s.chunks.size>0)for(let c of e)!c.markedForRemoval&&c.chunks&&[...s.chunks].every(l=>c.chunks?.has(l))&&(c.markedForRemoval=!0,o-=c.tokens);else s.markedForRemoval=!0,o-=s.tokens}return e.sort((s,c)=>s.originalIndex-c.originalIndex)}trimPrefixLinesToFit(e,r,n){let o=0,s=[];for(let c=e.length-1;c>=0;c--){let l=e[c],u=l.tokens;if(o+u<=r)s.unshift(l),o+=u;else break}if(s.length===0){let c=e[e.length-1];if(c&&c.line.length>0){let u=n.takeLastTokens(c.line,r);return s.push({line:u.text,componentPath:c.componentPath,tokens:u.tokens.length}),[s,u.tokens.length]}let l=`Cannot fit prefix within limit of ${r} tokens`;throw new Error(l)}return[s,o]}};function Lsi(t){return t.map(e=>e.elidedValue).join("")}a(Lsi,"makePrompt");function Bsi(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(Bsi,"makePrefixPrompt");function Fsi(t){if(t.length===0)return[];let e=new Map;for(let o of t)if(o.type==="context"&&o.index!==void 0){e.has(o.index)||e.set(o.index,[]);let s=o.elidedValue.trim();s.length>0&&e.get(o.index).push(s)}let r=Math.max(...Array.from(e.keys()),-1),n=[];for(let o=0;o<=r;o++){let s=e.get(o);if(s&&s.length>0){let c=s.join(` +`).trim();n.push(c)}else n.push("")}return n}a(Fsi,"makeContextPrompt");p();var xge=class{constructor(e,r=g0r()){this.snapshot=e;this.transformers=r}static{a(this,"SnapshotWalker")}walkSnapshot(e){this.walkSnapshotNode(this.snapshot,void 0,e,{})}walkSnapshotNode(e,r,n,o){let s=this.transformers.reduce((l,u)=>u(e,r,l),{...o});if(n(e,r,s))for(let l of e.children??[])this.walkSnapshotNode(l,e,n,s)}};function g0r(){return[(t,e,r)=>{r.weight===void 0&&(r.weight=1);let n=t.props?.weight??1,o=typeof n=="number"?Math.max(0,Math.min(1,n)):1;return{...r,weight:o*r.weight}},(t,e,r)=>{if(t.name===xG.name){let n=r.chunks?new Set(r.chunks):new Set;return n.add(t.path),{...r,chunks:n}}return r},(t,e,r)=>t.props?.source!==void 0?{...r,source:t.props.source}:r]}a(g0r,"defaultTransformers");p();var A0r={abap:{lineComment:{start:'"',end:""},markdownLanguageIds:["abap","sap-abap"]},aspdotnet:{lineComment:{start:"<%--",end:"--%>"}},bat:{lineComment:{start:"REM",end:""}},bibtex:{lineComment:{start:"%",end:""},markdownLanguageIds:["bibtex"]},blade:{lineComment:{start:"#",end:""}},BluespecSystemVerilog:{lineComment:{start:"//",end:""}},c:{lineComment:{start:"//",end:""},markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";",end:""},markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["coffeescript","coffee","cson","iced"]},cpp:{lineComment:{start:"//",end:""},markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"]},csharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["csharp","cs"]},css:{lineComment:{start:"/*",end:"*/"}},cuda:{lineComment:{start:"//",end:""}},dart:{lineComment:{start:"//",end:""}},dockerfile:{lineComment:{start:"#",end:""},markdownLanguageIds:["dockerfile","docker"]},dotenv:{lineComment:{start:"#",end:""}},elixir:{lineComment:{start:"#",end:""}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%",end:""},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"]},go:{lineComment:{start:"//",end:""},markdownLanguageIds:["go","golang"]},graphql:{lineComment:{start:"#",end:""}},groovy:{lineComment:{start:"//",end:""}},haml:{lineComment:{start:"-#",end:""}},handlebars:{lineComment:{start:"{{!",end:"}}"},markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"]},haskell:{lineComment:{start:"--",end:""},markdownLanguageIds:["haskell","hs"]},hlsl:{lineComment:{start:"//",end:""}},html:{lineComment:{start:""},markdownLanguageIds:["html","xhtml"]},ini:{lineComment:{start:";",end:""}},java:{lineComment:{start:"//",end:""},markdownLanguageIds:["java","jsp"]},javascript:{lineComment:{start:"//",end:""},markdownLanguageIds:["javascript","js"]},javascriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},jsonc:{lineComment:{start:"//",end:""}},jsx:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#",end:""},markdownLanguageIds:["julia","jl"]},kotlin:{lineComment:{start:"//",end:""},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%",end:""},markdownLanguageIds:["tex"]},legend:{lineComment:{start:"//",end:""}},less:{lineComment:{start:"//",end:""}},lua:{lineComment:{start:"--",end:""},markdownLanguageIds:["lua","pluto"]},makefile:{lineComment:{start:"#",end:""},markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:"[]: #",end:""},markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec","mm","objc","obj-c"]},"objective-cpp":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#",end:""},markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//",end:""}},powershell:{lineComment:{start:"#",end:""},markdownLanguageIds:["powershell","ps","ps1"]},pug:{lineComment:{start:"//",end:""}},python:{lineComment:{start:"#",end:""},markdownLanguageIds:["python","py","gyp"]},ql:{lineComment:{start:"//",end:""}},r:{lineComment:{start:"#",end:""}},razor:{lineComment:{start:""},markdownLanguageIds:["cshtml","razor","razor-cshtml"]},ruby:{lineComment:{start:"#",end:""},markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"]},rust:{lineComment:{start:"//",end:""},markdownLanguageIds:["rust","rs"]},sass:{lineComment:{start:"//",end:""}},scala:{lineComment:{start:"//",end:""}},scss:{lineComment:{start:"//",end:""}},shellscript:{lineComment:{start:"#",end:""},markdownLanguageIds:["bash","sh","zsh"]},slang:{lineComment:{start:"//",end:""}},slim:{lineComment:{start:"/",end:""}},solidity:{lineComment:{start:"//",end:""},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--",end:""}},stylus:{lineComment:{start:"//",end:""}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//",end:""}},systemverilog:{lineComment:{start:"//",end:""}},terraform:{lineComment:{start:"#",end:""}},tex:{lineComment:{start:"%",end:""}},typescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["typescript","ts"]},typescriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["tsx"]},vb:{lineComment:{start:"'",end:""},markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//",end:""}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//",end:""}},xml:{lineComment:{start:""}},xsl:{lineComment:{start:""}},yaml:{lineComment:{start:"#",end:""},markdownLanguageIds:["yaml","yml"]}},Usi={};for(let[t,e]of Object.entries(A0r))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)Usi[r]=t;else Usi[t]=t;var pra={start:"//",end:""},hra=["php","plaintext"],y0r={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function Qsi(t){return Object.values(y0r).includes(t.trim())}a(Qsi,"isShebangLine");function mra({source:t}){return t.startsWith("#!")||t.startsWith("hra(s,e)).join(` +`).map(s=>gra(s,e)).join(` `);return r?o+` -`:o}a(B4,"commentBlockAsSingles");function kft(t){let{languageId:e}=t;return fra.indexOf(e)===-1&&!pra(t)?e in A0r?A0r[e]:`Language: ${e}`:""}a(kft,"getLanguageMarker");function Pft(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(Pft,"getPathMarker");function VMe(t){return t===""||t.endsWith(` +`:o}a(B4,"commentBlockAsSingles");function Pft(t){let{languageId:e}=t;return hra.indexOf(e)===-1&&!mra(t)?e in y0r?y0r[e]:`Language: ${e}`:""}a(Pft,"getLanguageMarker");function Dft(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(Dft,"getPathMarker");function VMe(t){return t===""||t.endsWith(` `)?t:t+` -`}a(VMe,"newLineEnded");var mra=5,wge=class{constructor(){this.renderId=0;this.formatPrefix=Msi}static{a(this,"CompletionsPromptRenderer")}render(e,r,n){let o=this.renderId++,s=performance.now();try{if(n?.isCancellationRequested)return{status:"cancelled"};let c=r.delimiter??"",l=r.tokenizer??"o200k_base",{prefixBlocks:u,suffixBlock:d,componentStatistics:f}=this.processSnapshot(e,c,r.languageId),{prefixTokenLimit:h,suffixTokenLimit:m}=this.getPromptLimits(d,r),g=performance.now(),A=new Rft,{blocks:[y,..._]}=A.elide(u,h,d,m,Ms(l)),E=performance.now(),v=this.formatPrefix(_),S=this.formatContext?this.formatContext(_):void 0,T=y.elidedValue,w=_.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...gra([..._,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:S,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:E-g,renderTimeMs:performance.now()-s,componentStatistics:f,updateDataTimeMs:f.reduce((R,x)=>R+(x.updateDataTimeMs??0),0)}}}catch(c){return{status:"error",error:c}}}getPromptLimits(e,r){let n=e?.value??"",o=r.promptTokenLimit,s=r.suffixPercent;if(n.length==0||s==0)return{prefixTokenLimit:o,suffixTokenLimit:0};o=n.length>0?o-mra:o;let c=Math.ceil(o*(s/100));return{prefixTokenLimit:o-c,suffixTokenLimit:c}}processSnapshot(e,r,n){let o=[],s=[],c=[],l=!1;if(new xge(e,y0r).walkSnapshot((f,h,m)=>{if(f===e||(f.name===$Me.name&&(l=!0),f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.value===void 0||f.value===""))return!0;let g=m.chunks;if(m.type==="suffix")s.push({value:WMe(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let A=f.value.endsWith(r)?f.value:f.value+r,y=A;m.type==="prefix"?y=f.value:Fsi(f.value)?y=A:y=B4(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:WMe(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${$Me.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}},y0r=[...m0r(),(t,e,r)=>Ift(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===Fee.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===wft.name?{...r,type:"suffix"}:r];function gra(t){return t.map(e=>{let r={componentPath:e.componentPath};return e.tokens!==0&&(r.expectedTokens=e.tokens,r.actualTokens=e.elidedTokens),e.nodeStatistics.updateDataTimeMs!==void 0&&(r.updateDataTimeMs=e.nodeStatistics.updateDataTimeMs),e.source&&(r.source=e.source),r})}a(gra,"computeComponentStatistics");function WMe(t){return t.replace(/\r\n?/g,` -`)}a(WMe,"normalizeLineEndings");p();var Dft=a((t,e)=>{let[r,n]=e.useState();if(e.useData(tS,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.ctx.get($r),s=o.getRelativePath(r),c={uri:r.uri,source:r.getText(),relativePath:s,languageId:r.detectedLanguageId},l=o.findNotebook(r);return c.relativePath&&!l?Zn(Ara,{docInfo:c}):Zn(yra,{docInfo:c})}},"DocumentMarker"),Ara=a(t=>Zn(wp,{children:Pft(t.docInfo)}),"PathMarker"),yra=a(t=>Zn(wp,{children:kft(t.docInfo)}),"LanguageMarker");p();p();p();var yoa=fe(Jee()),_oa=fe(W4()),Rci=fe(Po()),Eoa=fe(Xft());var z4=class extends Rci.Disposable{static{a(this,"RecentEditsProvider")}};function voa(t,e=!1,r=void 0,n){if(e&&(r===void 0||n===void 0))throw new Error("cursorLine and activeDocDistanceLimitFromCursor are required when filterByCursorLine is true");let o=t.startLine-1,s=t.endLine-1;return!!(e&&(Math.abs(o-r)<=n||Math.abs(s-r)<=n))}a(voa,"editIsTooCloseToCursor");var Ipt=a((t,e)=>{let[r,n]=e.useState();return e.useData(tS,async o=>{if(!o.document)return;let s=t.ctx.get(z4);if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.ctx.get($r),f=[];for(let m=l.length-1;m>=0&&!(f.length>=c.maxEdits);m--){let g=l[m];if(!await d.getTextDocument({uri:g.file}))continue;let A=!u.has(g.file);if(u.size+(A?1:0)>c.maxFiles)break;let _=g.file===o.document?.uri,E=_?o.position.line:void 0;if(voa(g,_,E,c.activeDocDistanceLimitFromCursor))continue;let S=s.getEditSummary(g);if(S){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift(VMe(`File: ${T}`)+VMe(S))}}if(f.length===0){n(void 0);return}let h=VMe("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+VMe("End of recent edits");n(h)}),r?Zn(IG,{children:Zn(wp,{children:r})}):void 0},"RecentEdits");p();p();p();var xpt=class{constructor(e){this.docManager=e}static{a(this,"OpenTabFiles")}truncateDocs(e,r,n,o){let s=new Map,c=0;for(let l of e)if(!(c+l.getText().length>Xee.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&wpt(n,l.detectedLanguageId)&&(s.set(l.uri.toString(),{uri:l.uri.toString(),relativePath:this.docManager.getRelativePath(l),source:l.getText()}),c+=l.getText().length),s.size>=o))break;return s}async getNeighborFiles(e,r,n){let o=new Map,s=new Map;return o=this.truncateDocs($oi(await this.docManager.textDocuments()),e,r,n),s.set("opentabs",Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};p();p();function kci(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(kci,"shortCircuit");p();function boa(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(boa,"defaultHash");function vAr(t,e={}){let{hash:r=boa,cache:n=new Map}=e;return function(...o){let s=r.apply(this,o);if(n.has(s))return n.get(s);let c=t.apply(this,o);return c instanceof Promise&&(c=c.catch(l=>{throw n.delete(s),l})),n.set(s,c),c}}a(vAr,"memoize");var Pci={entries:[],traits:[]},Rpt={entries:new Map,traits:[]},CAr=class extends Sn{constructor(r,n=120*1e3){super(r);this.defaultEvictionTimeMs=n;this._cacheTimestamps=new Map}static{a(this,"PromiseExpirationCacheMap")}bumpRetryCount(r){let n=this._cacheTimestamps.get(r);return n?++n.retryCount:(this._cacheTimestamps.set(r,{timestamp:Date.now(),retryCount:0}),0)}has(r){return this.isValid(r)?super.has(r):(this.deleteExpiredEntry(r),!1)}get(r){let n=super.get(r);if(this.isValid(r))return n;this.deleteExpiredEntry(r)}set(r,n){let o=super.set(r,n);return this.isValid(r)||this._cacheTimestamps.set(r,{timestamp:Date.now(),retryCount:0}),o}clear(){super.clear(),this._cacheTimestamps.clear()}isValid(r){let n=this._cacheTimestamps.get(r);return n!==void 0&&Date.now()-n.timestamp=Toa?c=Rpt:c=void 0);let l=performance.now()-s;if(Pg.debug(t,c!==void 0?`Fetched ${[...c.entries.values()].map(u=>u.size).reduce((u,d)=>u+d,0)} related files for '${e.uri}' in ${l}ms.`:`Failing fetching files for '${e.uri}' in ${l}ms.`),c===void 0)throw new kpt;return c}a(Nci,"getRelatedFiles");var bAr=vAr(Nci,{cache:Dci,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});bAr=kci(bAr,200,Rpt);async function Ppt(t,e,r,n,o,s=!1){let c=t.get(ete),l=Rpt;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await Nci(t,u,r,n,c):await bAr(t,u,r,n,c)}catch(u){l=Rpt,u instanceof kpt&&ft(t,"getRelatedFilesList",r)}return Pg.debug(t,l!=null?`Fetched following traits ${l.traits.map(u=>`{${u.name} : ${u.value}}`).join("")} for '${e.uri}'`:`Failing fecthing traits for '${e.uri}'.`),l}a(Ppt,"getRelatedFilesAndTraits");function wpt(t,e){return xxe(t)===xxe(e)}a(wpt,"considerNeighborFile");var Xee=class t{static{a(this,"NeighborSource")}static{this.MAX_NEIGHBOR_AGGREGATE_LENGTH=2e5}static{this.MAX_NEIGHBOR_FILES=20}static{this.EXCLUDED_NEIGHBORS=["node_modules","dist","site-packages"]}static defaultEmptyResult(){return{docs:new Map,neighborSource:new Map,traits:[]}}static reset(){t.instance=void 0}static async getNeighborFilesAndTraits(e,r,n,o,s,c,l){let u=e.get($r);t.instance===void 0&&(t.instance=new xpt(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(Ioa(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return Pg.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: failed to get the document ${r}`),d;let h=u.getWorkspaceFolder(f);if(!h)return Pg.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await Ppt(e,f,o,s,c,l);return m.entries.size===0?(Pg.debug(e,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),d.traits.push(...m.traits),d):(m.entries.forEach((g,A)=>{let y=[];g.forEach((_,E)=>{let v=t.getRelativePath(E,h.uri);if(!v||d.docs.has(E))return;let S={relativePath:v,uri:E,source:_};y.unshift(S),d.docs.set(E,S)}),y.length>0&&d.neighborSource.set(A,y.map(_=>_.uri.toString()))}),d.traits.push(...m.traits),d)}static basename(e){return decodeURIComponent(e.replace(/[#?].*$/,"").replace(/^.*[/:]/,""))}static getRelativePath(e,r){let n=r.toString().replace(/[#?].*/,"").replace(/\/?$/,"/");return e.toString().startsWith(n)?e.toString().slice(n.length):t.basename(e)}};function Ioa(t,e){return t.get(tr).excludeRelatedFiles(e)||kt(t,ze.ExcludeRelatedFiles)}a(Ioa,"isExcludeRelatedFilesActive");function Mci(t,e){return t.get(tr).includeNeighboringFiles(e)||kt(t,ze.IncludeNeighboringFiles)}a(Mci,"isIncludeNeighborFilesActive");var Dpt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(tS,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=Xee.defaultEmptyResult();u.turnOffSimilarFiles||(d=await Xee.getNeighborFilesAndTraits(t.ctx,u.document.uri,u.document.detectedLanguageId,u.telemetryData,u.cancellationToken,u.data));let f=await c(u.telemetryData,u.document,u,d);s(f)});async function c(u,d,f,h){let m=zge(t.ctx,u,d.detectedLanguageId);return(await l(m,u,d,f,h)).filter(A=>A.snippet.length>0).sort((A,y)=>A.score-y.score).map(A=>({...Ssi(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||bft(t.ctx,d,f.detectedLanguageId),y=t.ctx.get($r).getRelativePath(f),_={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await xsi(_,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),Zn(yD,{children:[...o.map((u,d)=>Zn(xoa,{snippet:u}))]})},"SimilarFiles"),xoa=a((t,e)=>Zn(IG,{children:[Zn(wp,{children:t.snippet.headline}),Zn(wp,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var Npt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(tS,c=>{c.traits!==r&&n(c.traits);let l=xxe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return Zn(yD,{children:[Zn(wp,{children:`Consider this related information: -`}),...r.map(c=>Zn(wp,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function Oci(t,e){return kt(t,ze.UseSplitContextPrompt)??t.get(tr).enablePromptContextProxyField(e)}a(Oci,"shouldUseSplitContextPrompt");function Lci(t){return Zn(yD,{children:[Zn(f0r,{children:[Zn(Dft,{ctx:t,weight:.7}),Zn(Npt,{weight:.6}),Zn(Tft,{ctx:t,weight:.9}),Zn(Dpt,{ctx:t,weight:.8})]}),Zn(Nsi,{weight:1}),Zn(p0r,{children:Zn(Ipt,{ctx:t,weight:.99})}),Zn(Dsi,{weight:1})]})}a(Lci,"splitContextCompletionsPrompt");p();var Bci=0;function woa(){Bci=0}a(woa,"resetContextIndex");function Roa(){return Bci++}a(Roa,"getNextContextIndex");var Mpt=class extends wge{constructor(){super(...arguments);this.formatPrefix=Osi;this.formatContext=Lsi}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if(woa(),new xge(r,koa).walkSnapshot((f,h,m)=>{if(f===r||(f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.name===Fee.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:WMe(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let y=A==="prefix",_=y||f.value.endsWith(n)?f.value:f.value+n;o.push({type:y?"prefix":"context",value:WMe(_),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source,index:y?void 0:m.index})}return!0}),!l)throw new Error(`Node of type ${Fee.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}},koa=[...y0r,(t,e,r)=>Ift(t)?{...r,index:Roa()}:r];p();function Opt(t,e,r){let n=uft(r,"Trait");for(let s of n)Poa(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(Opt,"getTraitsFromContextItems");function Poa(t,e,r,n){let o=t.get(Rm).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(Poa,"setupExpectationsForTraits");var Doa=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Lpt(t,e,r,n,o,s){if(r.length>0){let c={};c.detectedLanguageId=n,c.languageId=o;for(let u of r){let d=Doa.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return ft(e,t,l)}}a(Lpt,"ReportTraitsTelemetry");p();p();p();var Bpt=class{constructor(e){this.states=e;this.currentIndex=0;this.stateChanged=!1}static{a(this,"UseState")}useState(e){let r=this.currentIndex;if(this.states[r]===void 0){let o=typeof e=="function"?e():e;this.states[r]=o}let n=a(o=>{let s=typeof o=="function"?o(this.states[r]):o;this.states[r]=s,this.stateChanged=!0},"setState");return this.currentIndex++,[this.states[r],n]}hasChanged(){return this.stateChanged}},Fpt=class{constructor(e){this.measureUpdateTime=e;this.consumers=[]}static{a(this,"UseData")}useData(e,r){this.consumers.push(n=>{if(e(n))return r(n)})}async updateData(e){if(this.consumers.length>0){let r=performance.now();for(let n of this.consumers)await n(e);this.measureUpdateTime(performance.now()-r)}}};var Upt=class{constructor(e){this.lifecycleData=new Map;this.vTree=this.virtualizeElement(e,"$",0)}static{a(this,"VirtualPromptReconciler")}reconcile(e){if(!this.vTree)throw new Error("No tree to reconcile, make sure to pass a valid prompt");return e?.isCancellationRequested?this.vTree:(this.vTree=this.reconcileNode(this.vTree,"$",0,e),this.vTree)}reconcileNode(e,r,n,o){if(!e.children&&!e.lifecycle)return e;let s=e;if(e.lifecycle?.isRemountRequired()){let l=this.collectChildPaths(e);s=this.virtualizeElement(e.component,r,n);let u=this.collectChildPaths(s);this.cleanupState(l,u)}else if(e.children){let l=[];for(let u=0;u"u")){if(typeof e=="string"||typeof e=="number")return{name:typeof e,path:`${r}[${n}]`,props:{value:e},component:e};if(Noa(e.type)){let o=e.type(e.props.children),s=r!=="$"?`[${n}]`:"",c=`${r}${s}.${o.type}`,l=o.children.map((u,d)=>this.virtualizeElement(u,c,d));return this.ensureUniqueKeys(l),{name:o.type,path:c,children:l.flat().filter(u=>u!==void 0),component:e}}return this.virtualizeFunctionComponent(r,n,e,e.type)}}virtualizeFunctionComponent(e,r,n,o){let s=n.props.key?`["${n.props.key}"]`:`[${r}]`,c=`${e}${s}.${o.name}`,l=new TAr(this.getOrCreateLifecycleData(c)),u=o(n.props,l),h=(Array.isArray(u)?u:[u]).map((m,g)=>this.virtualizeElement(m,c,g)).flat().filter(m=>m!==void 0);return this.ensureUniqueKeys(h),{name:o.name,path:c,props:n.props,children:h,component:n,lifecycle:l}}ensureUniqueKeys(e){let r=new Map;for(let o of e){if(!o)continue;let s=o.props?.key;s&&r.set(s,(r.get(s)||0)+1)}let n=Array.from(r.entries()).filter(([o,s])=>s>1).map(([o])=>o);if(n.length>0)throw new Error(`Duplicate keys found: ${n.join(", ")}`)}collectChildPaths(e){let r=[];if(e?.children)for(let n of e.children)n&&(r.push(n.path),r.push(...this.collectChildPaths(n)));return r}cleanupState(e,r){for(let n of e)r.includes(n)||this.lifecycleData.delete(n)}getOrCreateLifecycleData(e){return this.lifecycleData.has(e)||this.lifecycleData.set(e,new SAr([])),this.lifecycleData.get(e)}createPipe(){return{pump:a(async e=>{await this.pumpData(e)},"pump")}}async pumpData(e){if(!this.vTree)throw new Error("No tree to pump data into. Pumping data before initializing?");await this.recursivelyPumpData(e,this.vTree)}async recursivelyPumpData(e,r){if(!r)throw new Error("Can't pump data into undefined node.");await r.lifecycle?.dataHook.updateData(e);for(let n of r.children||[])await this.recursivelyPumpData(e,n)}},SAr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},TAr=class{constructor(e){this.lifecycleData=e;this.stateHook=new Bpt(e.state),this.dataHook=new Fpt(r=>{e._updateTimeMs=r})}static{a(this,"PromptElementLifecycle")}useState(e){return this.stateHook.useState(e)}useData(e,r){this.dataHook.useData(e,r)}isRemountRequired(){return this.stateHook.hasChanged()}};function Noa(t){return typeof t=="function"&&"isFragmentFunction"in t}a(Noa,"isFragmentFunction");var fOe=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new Upt(e)}snapshotNode(e,r){if(!e)return;if(r?.isCancellationRequested)return"cancelled";let n=[];for(let o of e.children??[]){let s=this.snapshotNode(o,r);if(s==="cancelled")return"cancelled";s!==void 0&&n.push(s)}return{value:e.props?.value?.toString(),name:e.name,path:e.path,props:e.props,children:n,statistics:{updateDataTimeMs:e.lifecycle?.lifecycleData.getUpdateTimeMsAndReset()}}}snapshot(e){try{let r=this.reconciler.reconcile(e);if(e?.isCancellationRequested)return{snapshot:void 0,status:"cancelled"};if(!r)throw new Error("Invalid virtual prompt tree");let n=this.snapshotNode(r,e);return n==="cancelled"||e?.isCancellationRequested?{snapshot:void 0,status:"cancelled"}:{snapshot:n,status:"ok"}}catch(r){return{snapshot:void 0,status:"error",error:r}}}createPipe(){return this.reconciler.createPipe()}};function tS(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.document||!e.position||e.position.line===void 0||e.position.character===void 0||!e.telemetryData)}a(tS,"isCompletionRequestData");var IAr={default:{promptFunction:Fci,renderer:wge},splitContext:{promptFunction:Lci,renderer:Mpt}};function Fci(t){return Zn(yD,{children:[Zn(d0r,{children:[Zn(Dft,{ctx:t,weight:.7}),Zn(Npt,{weight:.6}),Zn(Tft,{ctx:t,weight:.9}),Zn(Dpt,{ctx:t,weight:.8}),Zn(Ipt,{ctx:t,weight:.99})]}),Zn($Me,{weight:1})]})}a(Fci,"defaultCompletionsPrompt");var Qpt=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new fOe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe(),this.renderer=this.getRenderer()}static{a(this,"ComponentsCompletionsPromptFactory")}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}async createPromptUnsafe({completionId:e,completionState:r,telemetryData:n,promptOpts:o},s){let{maxPromptLength:c,suffixPercent:l,suffixMatchThreshold:u}=zge(this.ctx,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?"splitContext":"default";this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,turnOffSimilarFiles:A,resolvedContextItems:y}=await this.resolveContext(e,r,n,s,o);if(await this.updateComponentData(r.textDocument,r.position,m,g,n,A,c,s,o,u,o?.tokenizer),s?.isCancellationRequested)return a6;let _=this.virtualPrompt.snapshot(s),E=_.status;if(E==="cancelled")return a6;if(E==="error")return this.errorPrompt(_.error);let v=this.renderer.render(_.snapshot,{delimiter:` -`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(v.status==="cancelled")return a6;if(v.status==="error")return this.errorPrompt(v.error);let[S,T]=NG(v.prefix),w={...v,prefix:S},R;if(Tge(this.ctx,n)){let k=dft(v.metadata.componentStatistics);this.ctx.get(Rm).getStatisticsForCompletion(e).computeMatch(k),R=pft(this.ctx,e,y),Br.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(R)}'`)}let x=performance.now();return this.resetIfEmpty(v),this.successPrompt(w,x,h,T,R)}async updateComponentData(e,r,n,o,s,c,l,u,d={},f,h){let m=this.createRequestData(e,r,s,u,d,l,n,o,c,f,h);await this.pipe.pump(m)}async resolveContext(e,r,n,o,s={}){let c=[],l,u,d=!1;if(Tge(this.ctx,n)){c=await this.ctx.get(eS).resolution(e);let{textDocument:f}=r,h=c.filter(hft);Ooa(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=Opt(this.ctx,e,h),Lpt("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await Sft(this.ctx,e,h,f.detectedLanguageId)}return{traits:l,codeSnippets:u,turnOffSimilarFiles:d,resolvedContextItems:c}}async failFastPrompt(e,r,n,o){if(o?.isCancellationRequested)return a6;if((await this.ctx.get(pc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Hpt;if((n>0?e.getText().length:e.offsetAt(r))0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return Ma(this.ctx,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),Yge}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new fOe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(IAr[this.promptOrdering]?.promptFunction??Fci)(this.ctx)}getRenderer(){let e=IAr[this.promptOrdering]??IAr.default;return new e.renderer}};function Ooa(t,e,r,n){let o=["cpp","c"];return Mci(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(Ooa,"similarFilesEnabled");p();p();p();var jci=2e4,Uci=0,Qci=new Sn;function Hci(t,e,r,n){Uci++;let o=r.promptOpts?.tokenizer??"o200k_base",s=performance.now(),{root:c,mask:l,statistics:u}=t.snapshot(r,n),d=performance.now(),f=new Set(l),h=Qci?.get(c.id),m;if(h&&h.budget>=e&&h.render.cost<=e&&h.tokenizer===o&&f.size===h.mask.size&&[...f].every(v=>h.mask.has(v)))m=h.render;else{let v=Ms(o);m=L0n(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),Qci.set(c.id,{budget:e,mask:f,tokenizer:o,render:m})}let{text:g,cost:A,renderedNodes:y}=m,_=performance.now();for(let[v,S]of u?.entries()??[])S.actualTokens=y.get(v)?.cost??0;let E={renderId:Uci,rendererName:"renderNode",tokenizer:o,elisionTimeMs:_-d,renderTimeMs:d-s,updateDataTimeMs:0,componentStatistics:[{componentPath:t.name,actualTokens:A}]};return{root:c,renderedNodes:y,text:g,cost:A,metadata:E}}a(Hci,"renderWithMetadata");function Gci(t,e){return r=>{let n=r.text.join("")+` -`;return Ag(e,n,()=>t.tokenLength(n)+1)}}a(Gci,"cachedLineCostFunction");function $ci(t,e,r){let o=t.split(` +`}a(VMe,"newLineEnded");var Ara=5,wge=class{constructor(){this.renderId=0;this.formatPrefix=Lsi}static{a(this,"CompletionsPromptRenderer")}render(e,r,n){let o=this.renderId++,s=performance.now();try{if(n?.isCancellationRequested)return{status:"cancelled"};let c=r.delimiter??"",l=r.tokenizer??"o200k_base",{prefixBlocks:u,suffixBlock:d,componentStatistics:f}=this.processSnapshot(e,c,r.languageId),{prefixTokenLimit:h,suffixTokenLimit:m}=this.getPromptLimits(d,r),g=performance.now(),A=new kft,{blocks:[y,..._]}=A.elide(u,h,d,m,Ms(l)),E=performance.now(),v=this.formatPrefix(_),S=this.formatContext?this.formatContext(_):void 0,T=y.elidedValue,w=_.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...yra([..._,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:S,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:E-g,renderTimeMs:performance.now()-s,componentStatistics:f,updateDataTimeMs:f.reduce((R,x)=>R+(x.updateDataTimeMs??0),0)}}}catch(c){return{status:"error",error:c}}}getPromptLimits(e,r){let n=e?.value??"",o=r.promptTokenLimit,s=r.suffixPercent;if(n.length==0||s==0)return{prefixTokenLimit:o,suffixTokenLimit:0};o=n.length>0?o-Ara:o;let c=Math.ceil(o*(s/100));return{prefixTokenLimit:o-c,suffixTokenLimit:c}}processSnapshot(e,r,n){let o=[],s=[],c=[],l=!1;if(new xge(e,_0r).walkSnapshot((f,h,m)=>{if(f===e||(f.name===$Me.name&&(l=!0),f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.value===void 0||f.value===""))return!0;let g=m.chunks;if(m.type==="suffix")s.push({value:WMe(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let A=f.value.endsWith(r)?f.value:f.value+r,y=A;m.type==="prefix"?y=f.value:Qsi(f.value)?y=A:y=B4(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:WMe(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${$Me.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}},_0r=[...g0r(),(t,e,r)=>xft(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===Uee.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===Rft.name?{...r,type:"suffix"}:r];function yra(t){return t.map(e=>{let r={componentPath:e.componentPath};return e.tokens!==0&&(r.expectedTokens=e.tokens,r.actualTokens=e.elidedTokens),e.nodeStatistics.updateDataTimeMs!==void 0&&(r.updateDataTimeMs=e.nodeStatistics.updateDataTimeMs),e.source&&(r.source=e.source),r})}a(yra,"computeComponentStatistics");function WMe(t){return t.replace(/\r\n?/g,` +`)}a(WMe,"normalizeLineEndings");p();var Nft=a((t,e)=>{let[r,n]=e.useState();if(e.useData(tS,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.ctx.get($r),s=o.getRelativePath(r),c={uri:r.uri,source:r.getText(),relativePath:s,languageId:r.detectedLanguageId},l=o.findNotebook(r);return c.relativePath&&!l?Zn(_ra,{docInfo:c}):Zn(Era,{docInfo:c})}},"DocumentMarker"),_ra=a(t=>Zn(wp,{children:Dft(t.docInfo)}),"PathMarker"),Era=a(t=>Zn(wp,{children:Pft(t.docInfo)}),"LanguageMarker");p();p();p();var Eoa=fe(Zee()),voa=fe(W4()),Pci=fe(Po()),Coa=fe(ept());var z4=class extends Pci.Disposable{static{a(this,"RecentEditsProvider")}};function boa(t,e=!1,r=void 0,n){if(e&&(r===void 0||n===void 0))throw new Error("cursorLine and activeDocDistanceLimitFromCursor are required when filterByCursorLine is true");let o=t.startLine-1,s=t.endLine-1;return!!(e&&(Math.abs(o-r)<=n||Math.abs(s-r)<=n))}a(boa,"editIsTooCloseToCursor");var xpt=a((t,e)=>{let[r,n]=e.useState();return e.useData(tS,async o=>{if(!o.document)return;let s=t.ctx.get(z4);if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.ctx.get($r),f=[];for(let m=l.length-1;m>=0&&!(f.length>=c.maxEdits);m--){let g=l[m];if(!await d.getTextDocument({uri:g.file}))continue;let A=!u.has(g.file);if(u.size+(A?1:0)>c.maxFiles)break;let _=g.file===o.document?.uri,E=_?o.position.line:void 0;if(boa(g,_,E,c.activeDocDistanceLimitFromCursor))continue;let S=s.getEditSummary(g);if(S){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift(VMe(`File: ${T}`)+VMe(S))}}if(f.length===0){n(void 0);return}let h=VMe("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+VMe("End of recent edits");n(h)}),r?Zn(xG,{children:Zn(wp,{children:r})}):void 0},"RecentEdits");p();p();p();var wpt=class{constructor(e){this.docManager=e}static{a(this,"OpenTabFiles")}truncateDocs(e,r,n,o){let s=new Map,c=0;for(let l of e)if(!(c+l.getText().length>ete.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&Rpt(n,l.detectedLanguageId)&&(s.set(l.uri.toString(),{uri:l.uri.toString(),relativePath:this.docManager.getRelativePath(l),source:l.getText()}),c+=l.getText().length),s.size>=o))break;return s}async getNeighborFiles(e,r,n){let o=new Map,s=new Map;return o=this.truncateDocs(Woi(await this.docManager.textDocuments()),e,r,n),s.set("opentabs",Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};p();p();function Dci(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(Dci,"shortCircuit");p();function Toa(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(Toa,"defaultHash");function CAr(t,e={}){let{hash:r=Toa,cache:n=new Map}=e;return function(...o){let s=r.apply(this,o);if(n.has(s))return n.get(s);let c=t.apply(this,o);return c instanceof Promise&&(c=c.catch(l=>{throw n.delete(s),l})),n.set(s,c),c}}a(CAr,"memoize");var Nci={entries:[],traits:[]},kpt={entries:new Map,traits:[]},bAr=class extends Sn{constructor(r,n=120*1e3){super(r);this.defaultEvictionTimeMs=n;this._cacheTimestamps=new Map}static{a(this,"PromiseExpirationCacheMap")}bumpRetryCount(r){let n=this._cacheTimestamps.get(r);return n?++n.retryCount:(this._cacheTimestamps.set(r,{timestamp:Date.now(),retryCount:0}),0)}has(r){return this.isValid(r)?super.has(r):(this.deleteExpiredEntry(r),!1)}get(r){let n=super.get(r);if(this.isValid(r))return n;this.deleteExpiredEntry(r)}set(r,n){let o=super.set(r,n);return this.isValid(r)||this._cacheTimestamps.set(r,{timestamp:Date.now(),retryCount:0}),o}clear(){super.clear(),this._cacheTimestamps.clear()}isValid(r){let n=this._cacheTimestamps.get(r);return n!==void 0&&Date.now()-n.timestamp=xoa?c=kpt:c=void 0);let l=performance.now()-s;if(Dg.debug(t,c!==void 0?`Fetched ${[...c.entries.values()].map(u=>u.size).reduce((u,d)=>u+d,0)} related files for '${e.uri}' in ${l}ms.`:`Failing fetching files for '${e.uri}' in ${l}ms.`),c===void 0)throw new Ppt;return c}a(Oci,"getRelatedFiles");var SAr=CAr(Oci,{cache:Mci,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});SAr=Dci(SAr,200,kpt);async function Dpt(t,e,r,n,o,s=!1){let c=t.get(tte),l=kpt;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await Oci(t,u,r,n,c):await SAr(t,u,r,n,c)}catch(u){l=kpt,u instanceof Ppt&&ft(t,"getRelatedFilesList",r)}return Dg.debug(t,l!=null?`Fetched following traits ${l.traits.map(u=>`{${u.name} : ${u.value}}`).join("")} for '${e.uri}'`:`Failing fecthing traits for '${e.uri}'.`),l}a(Dpt,"getRelatedFilesAndTraits");function Rpt(t,e){return xxe(t)===xxe(e)}a(Rpt,"considerNeighborFile");var ete=class t{static{a(this,"NeighborSource")}static{this.MAX_NEIGHBOR_AGGREGATE_LENGTH=2e5}static{this.MAX_NEIGHBOR_FILES=20}static{this.EXCLUDED_NEIGHBORS=["node_modules","dist","site-packages"]}static defaultEmptyResult(){return{docs:new Map,neighborSource:new Map,traits:[]}}static reset(){t.instance=void 0}static async getNeighborFilesAndTraits(e,r,n,o,s,c,l){let u=e.get($r);t.instance===void 0&&(t.instance=new wpt(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(woa(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return Dg.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: failed to get the document ${r}`),d;let h=u.getWorkspaceFolder(f);if(!h)return Dg.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await Dpt(e,f,o,s,c,l);return m.entries.size===0?(Dg.debug(e,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),d.traits.push(...m.traits),d):(m.entries.forEach((g,A)=>{let y=[];g.forEach((_,E)=>{let v=t.getRelativePath(E,h.uri);if(!v||d.docs.has(E))return;let S={relativePath:v,uri:E,source:_};y.unshift(S),d.docs.set(E,S)}),y.length>0&&d.neighborSource.set(A,y.map(_=>_.uri.toString()))}),d.traits.push(...m.traits),d)}static basename(e){return decodeURIComponent(e.replace(/[#?].*$/,"").replace(/^.*[/:]/,""))}static getRelativePath(e,r){let n=r.toString().replace(/[#?].*/,"").replace(/\/?$/,"/");return e.toString().startsWith(n)?e.toString().slice(n.length):t.basename(e)}};function woa(t,e){return t.get(tr).excludeRelatedFiles(e)||kt(t,ze.ExcludeRelatedFiles)}a(woa,"isExcludeRelatedFilesActive");function Lci(t,e){return t.get(tr).includeNeighboringFiles(e)||kt(t,ze.IncludeNeighboringFiles)}a(Lci,"isIncludeNeighborFilesActive");var Npt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(tS,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=ete.defaultEmptyResult();u.turnOffSimilarFiles||(d=await ete.getNeighborFilesAndTraits(t.ctx,u.document.uri,u.document.detectedLanguageId,u.telemetryData,u.cancellationToken,u.data));let f=await c(u.telemetryData,u.document,u,d);s(f)});async function c(u,d,f,h){let m=zge(t.ctx,u,d.detectedLanguageId);return(await l(m,u,d,f,h)).filter(A=>A.snippet.length>0).sort((A,y)=>A.score-y.score).map(A=>({...Isi(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||Sft(t.ctx,d,f.detectedLanguageId),y=t.ctx.get($r).getRelativePath(f),_={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await Rsi(_,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),Zn(yD,{children:[...o.map((u,d)=>Zn(Roa,{snippet:u}))]})},"SimilarFiles"),Roa=a((t,e)=>Zn(xG,{children:[Zn(wp,{children:t.snippet.headline}),Zn(wp,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var Mpt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(tS,c=>{c.traits!==r&&n(c.traits);let l=xxe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return Zn(yD,{children:[Zn(wp,{children:`Consider this related information: +`}),...r.map(c=>Zn(wp,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function Bci(t,e){return kt(t,ze.UseSplitContextPrompt)??t.get(tr).enablePromptContextProxyField(e)}a(Bci,"shouldUseSplitContextPrompt");function Fci(t){return Zn(yD,{children:[Zn(p0r,{children:[Zn(Nft,{ctx:t,weight:.7}),Zn(Mpt,{weight:.6}),Zn(Ift,{ctx:t,weight:.9}),Zn(Npt,{ctx:t,weight:.8})]}),Zn(Osi,{weight:1}),Zn(h0r,{children:Zn(xpt,{ctx:t,weight:.99})}),Zn(Msi,{weight:1})]})}a(Fci,"splitContextCompletionsPrompt");p();var Uci=0;function koa(){Uci=0}a(koa,"resetContextIndex");function Poa(){return Uci++}a(Poa,"getNextContextIndex");var Opt=class extends wge{constructor(){super(...arguments);this.formatPrefix=Bsi;this.formatContext=Fsi}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if(koa(),new xge(r,Doa).walkSnapshot((f,h,m)=>{if(f===r||(f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.name===Uee.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:WMe(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let y=A==="prefix",_=y||f.value.endsWith(n)?f.value:f.value+n;o.push({type:y?"prefix":"context",value:WMe(_),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source,index:y?void 0:m.index})}return!0}),!l)throw new Error(`Node of type ${Uee.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}},Doa=[..._0r,(t,e,r)=>xft(t)?{...r,index:Poa()}:r];p();function Lpt(t,e,r){let n=dft(r,"Trait");for(let s of n)Noa(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(Lpt,"getTraitsFromContextItems");function Noa(t,e,r,n){let o=t.get(km).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(Noa,"setupExpectationsForTraits");var Moa=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Bpt(t,e,r,n,o,s){if(r.length>0){let c={};c.detectedLanguageId=n,c.languageId=o;for(let u of r){let d=Moa.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return ft(e,t,l)}}a(Bpt,"ReportTraitsTelemetry");p();p();p();var Fpt=class{constructor(e){this.states=e;this.currentIndex=0;this.stateChanged=!1}static{a(this,"UseState")}useState(e){let r=this.currentIndex;if(this.states[r]===void 0){let o=typeof e=="function"?e():e;this.states[r]=o}let n=a(o=>{let s=typeof o=="function"?o(this.states[r]):o;this.states[r]=s,this.stateChanged=!0},"setState");return this.currentIndex++,[this.states[r],n]}hasChanged(){return this.stateChanged}},Upt=class{constructor(e){this.measureUpdateTime=e;this.consumers=[]}static{a(this,"UseData")}useData(e,r){this.consumers.push(n=>{if(e(n))return r(n)})}async updateData(e){if(this.consumers.length>0){let r=performance.now();for(let n of this.consumers)await n(e);this.measureUpdateTime(performance.now()-r)}}};var Qpt=class{constructor(e){this.lifecycleData=new Map;this.vTree=this.virtualizeElement(e,"$",0)}static{a(this,"VirtualPromptReconciler")}reconcile(e){if(!this.vTree)throw new Error("No tree to reconcile, make sure to pass a valid prompt");return e?.isCancellationRequested?this.vTree:(this.vTree=this.reconcileNode(this.vTree,"$",0,e),this.vTree)}reconcileNode(e,r,n,o){if(!e.children&&!e.lifecycle)return e;let s=e;if(e.lifecycle?.isRemountRequired()){let l=this.collectChildPaths(e);s=this.virtualizeElement(e.component,r,n);let u=this.collectChildPaths(s);this.cleanupState(l,u)}else if(e.children){let l=[];for(let u=0;u"u")){if(typeof e=="string"||typeof e=="number")return{name:typeof e,path:`${r}[${n}]`,props:{value:e},component:e};if(Ooa(e.type)){let o=e.type(e.props.children),s=r!=="$"?`[${n}]`:"",c=`${r}${s}.${o.type}`,l=o.children.map((u,d)=>this.virtualizeElement(u,c,d));return this.ensureUniqueKeys(l),{name:o.type,path:c,children:l.flat().filter(u=>u!==void 0),component:e}}return this.virtualizeFunctionComponent(r,n,e,e.type)}}virtualizeFunctionComponent(e,r,n,o){let s=n.props.key?`["${n.props.key}"]`:`[${r}]`,c=`${e}${s}.${o.name}`,l=new IAr(this.getOrCreateLifecycleData(c)),u=o(n.props,l),h=(Array.isArray(u)?u:[u]).map((m,g)=>this.virtualizeElement(m,c,g)).flat().filter(m=>m!==void 0);return this.ensureUniqueKeys(h),{name:o.name,path:c,props:n.props,children:h,component:n,lifecycle:l}}ensureUniqueKeys(e){let r=new Map;for(let o of e){if(!o)continue;let s=o.props?.key;s&&r.set(s,(r.get(s)||0)+1)}let n=Array.from(r.entries()).filter(([o,s])=>s>1).map(([o])=>o);if(n.length>0)throw new Error(`Duplicate keys found: ${n.join(", ")}`)}collectChildPaths(e){let r=[];if(e?.children)for(let n of e.children)n&&(r.push(n.path),r.push(...this.collectChildPaths(n)));return r}cleanupState(e,r){for(let n of e)r.includes(n)||this.lifecycleData.delete(n)}getOrCreateLifecycleData(e){return this.lifecycleData.has(e)||this.lifecycleData.set(e,new TAr([])),this.lifecycleData.get(e)}createPipe(){return{pump:a(async e=>{await this.pumpData(e)},"pump")}}async pumpData(e){if(!this.vTree)throw new Error("No tree to pump data into. Pumping data before initializing?");await this.recursivelyPumpData(e,this.vTree)}async recursivelyPumpData(e,r){if(!r)throw new Error("Can't pump data into undefined node.");await r.lifecycle?.dataHook.updateData(e);for(let n of r.children||[])await this.recursivelyPumpData(e,n)}},TAr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},IAr=class{constructor(e){this.lifecycleData=e;this.stateHook=new Fpt(e.state),this.dataHook=new Upt(r=>{e._updateTimeMs=r})}static{a(this,"PromptElementLifecycle")}useState(e){return this.stateHook.useState(e)}useData(e,r){this.dataHook.useData(e,r)}isRemountRequired(){return this.stateHook.hasChanged()}};function Ooa(t){return typeof t=="function"&&"isFragmentFunction"in t}a(Ooa,"isFragmentFunction");var fOe=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new Qpt(e)}snapshotNode(e,r){if(!e)return;if(r?.isCancellationRequested)return"cancelled";let n=[];for(let o of e.children??[]){let s=this.snapshotNode(o,r);if(s==="cancelled")return"cancelled";s!==void 0&&n.push(s)}return{value:e.props?.value?.toString(),name:e.name,path:e.path,props:e.props,children:n,statistics:{updateDataTimeMs:e.lifecycle?.lifecycleData.getUpdateTimeMsAndReset()}}}snapshot(e){try{let r=this.reconciler.reconcile(e);if(e?.isCancellationRequested)return{snapshot:void 0,status:"cancelled"};if(!r)throw new Error("Invalid virtual prompt tree");let n=this.snapshotNode(r,e);return n==="cancelled"||e?.isCancellationRequested?{snapshot:void 0,status:"cancelled"}:{snapshot:n,status:"ok"}}catch(r){return{snapshot:void 0,status:"error",error:r}}}createPipe(){return this.reconciler.createPipe()}};function tS(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.document||!e.position||e.position.line===void 0||e.position.character===void 0||!e.telemetryData)}a(tS,"isCompletionRequestData");var xAr={default:{promptFunction:Qci,renderer:wge},splitContext:{promptFunction:Fci,renderer:Opt}};function Qci(t){return Zn(yD,{children:[Zn(f0r,{children:[Zn(Nft,{ctx:t,weight:.7}),Zn(Mpt,{weight:.6}),Zn(Ift,{ctx:t,weight:.9}),Zn(Npt,{ctx:t,weight:.8}),Zn(xpt,{ctx:t,weight:.99})]}),Zn($Me,{weight:1})]})}a(Qci,"defaultCompletionsPrompt");var qpt=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new fOe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe(),this.renderer=this.getRenderer()}static{a(this,"ComponentsCompletionsPromptFactory")}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}async createPromptUnsafe({completionId:e,completionState:r,telemetryData:n,promptOpts:o},s){let{maxPromptLength:c,suffixPercent:l,suffixMatchThreshold:u}=zge(this.ctx,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?"splitContext":"default";this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,turnOffSimilarFiles:A,resolvedContextItems:y}=await this.resolveContext(e,r,n,s,o);if(await this.updateComponentData(r.textDocument,r.position,m,g,n,A,c,s,o,u,o?.tokenizer),s?.isCancellationRequested)return a6;let _=this.virtualPrompt.snapshot(s),E=_.status;if(E==="cancelled")return a6;if(E==="error")return this.errorPrompt(_.error);let v=this.renderer.render(_.snapshot,{delimiter:` +`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(v.status==="cancelled")return a6;if(v.status==="error")return this.errorPrompt(v.error);let[S,T]=MG(v.prefix),w={...v,prefix:S},R;if(Tge(this.ctx,n)){let k=fft(v.metadata.componentStatistics);this.ctx.get(km).getStatisticsForCompletion(e).computeMatch(k),R=hft(this.ctx,e,y),Fr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(R)}'`)}let x=performance.now();return this.resetIfEmpty(v),this.successPrompt(w,x,h,T,R)}async updateComponentData(e,r,n,o,s,c,l,u,d={},f,h){let m=this.createRequestData(e,r,s,u,d,l,n,o,c,f,h);await this.pipe.pump(m)}async resolveContext(e,r,n,o,s={}){let c=[],l,u,d=!1;if(Tge(this.ctx,n)){c=await this.ctx.get(eS).resolution(e);let{textDocument:f}=r,h=c.filter(mft);Boa(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=Lpt(this.ctx,e,h),Bpt("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await Tft(this.ctx,e,h,f.detectedLanguageId)}return{traits:l,codeSnippets:u,turnOffSimilarFiles:d,resolvedContextItems:c}}async failFastPrompt(e,r,n,o){if(o?.isCancellationRequested)return a6;if((await this.ctx.get(pc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Gpt;if((n>0?e.getText().length:e.offsetAt(r))0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return Ma(this.ctx,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),Yge}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new fOe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(xAr[this.promptOrdering]?.promptFunction??Qci)(this.ctx)}getRenderer(){let e=xAr[this.promptOrdering]??xAr.default;return new e.renderer}};function Boa(t,e,r,n){let o=["cpp","c"];return Lci(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(Boa,"similarFilesEnabled");p();p();p();var Gci=2e4,qci=0,jci=new Sn;function $ci(t,e,r,n){qci++;let o=r.promptOpts?.tokenizer??"o200k_base",s=performance.now(),{root:c,mask:l,statistics:u}=t.snapshot(r,n),d=performance.now(),f=new Set(l),h=jci?.get(c.id),m;if(h&&h.budget>=e&&h.render.cost<=e&&h.tokenizer===o&&f.size===h.mask.size&&[...f].every(v=>h.mask.has(v)))m=h.render;else{let v=Ms(o);m=B0n(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),jci.set(c.id,{budget:e,mask:f,tokenizer:o,render:m})}let{text:g,cost:A,renderedNodes:y}=m,_=performance.now();for(let[v,S]of u?.entries()??[])S.actualTokens=y.get(v)?.cost??0;let E={renderId:qci,rendererName:"renderNode",tokenizer:o,elisionTimeMs:_-d,renderTimeMs:d-s,updateDataTimeMs:0,componentStatistics:[{componentPath:t.name,actualTokens:A}]};return{root:c,renderedNodes:y,text:g,cost:A,metadata:E}}a($ci,"renderWithMetadata");function Vci(t,e){return r=>{let n=r.text.join("")+` +`;return yg(e,n,()=>t.tokenLength(n)+1)}}a(Vci,"cachedLineCostFunction");function Wci(t,e,r){let o=t.split(` `).map(f=>({id:kf(),text:[f],children:[],canMerge:!0})),s=[""];o.length>=1&&s.push(...Array(o.length-1).fill(` -`),"");let c={id:kf(),text:s,children:o,canMerge:!0},u=Kxe(c,a(f=>f.id===c.id?0:e(f),"nodeCostFunction")),d=r?o.length:1;for(let f of u.children)f.weight=d*Math.max(1,f.cost),d+=r?-1:1;return u}a($ci,"getLinewiseNode");var Gpt=class{constructor(){this.name="basicPrefix";this.costCache=new Sn(jci)}static{a(this,"BasicPrefixComponent")}snapshot(e){let{completionState:r,promptOpts:n}=e,o=r.textDocument.getText({start:{line:0,character:0},end:r.position}),s=Ms(n?.tokenizer),c=Gci(s,this.costCache);return{root:$ci(o,c,!1)}}},qci={root:uq,text:"",cost:0},$pt=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new Sn(5);this.costCache=new Sn(jci)}static{a(this,"CachedSuffixComponent")}snapshot(e){return{root:this.getCachedSuffix(e).root}}estimatedCost(e,r){return this.getCachedSuffix(e).cost}getCachedSuffix(e){let{completionState:r,telemetryData:n,promptOpts:o}=e,c=r.textDocument.getText({start:r.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}}).replace(/^.*/,"").trimStart();if(c==="")return qci;let l=this.cache.get(r.textDocument.uri)||qci;if(l.text===c)return l;let u=this.ctx.get(tr).suffixMatchThreshold(n);if(l.text!==""){let g=new JQ,A=g.takeFirstTokens(c,GMe);if(A.tokens.length>0&&100*xft(A.tokens,g.takeFirstTokens(l.text,GMe).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},Vpt=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Ms(n?.tokenizer);if(!r||r.traits.length===0)return{root:uq};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=kf(),A=`${m.name}: ${m.value}`,y={id:g,text:[A],children:[],cost:o.tokenLength(A),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};l.push(y),u.set(g,{componentPath:m.id,source:m,expectedTokens:y.cost}),s.set(g,m.importance??0),c+=m.importance??0}c=Math.max(c,1);let f=[`Related context: +`),"");let c={id:kf(),text:s,children:o,canMerge:!0},u=Kxe(c,a(f=>f.id===c.id?0:e(f),"nodeCostFunction")),d=r?o.length:1;for(let f of u.children)f.weight=d*Math.max(1,f.cost),d+=r?-1:1;return u}a(Wci,"getLinewiseNode");var $pt=class{constructor(){this.name="basicPrefix";this.costCache=new Sn(Gci)}static{a(this,"BasicPrefixComponent")}snapshot(e){let{completionState:r,promptOpts:n}=e,o=r.textDocument.getText({start:{line:0,character:0},end:r.position}),s=Ms(n?.tokenizer),c=Vci(s,this.costCache);return{root:Wci(o,c,!1)}}},Hci={root:uq,text:"",cost:0},Vpt=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new Sn(5);this.costCache=new Sn(Gci)}static{a(this,"CachedSuffixComponent")}snapshot(e){return{root:this.getCachedSuffix(e).root}}estimatedCost(e,r){return this.getCachedSuffix(e).cost}getCachedSuffix(e){let{completionState:r,telemetryData:n,promptOpts:o}=e,c=r.textDocument.getText({start:r.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}}).replace(/^.*/,"").trimStart();if(c==="")return Hci;let l=this.cache.get(r.textDocument.uri)||Hci;if(l.text===c)return l;let u=this.ctx.get(tr).suffixMatchThreshold(n);if(l.text!==""){let g=new JQ,A=g.takeFirstTokens(c,GMe);if(A.tokens.length>0&&100*wft(A.tokens,g.takeFirstTokens(l.text,GMe).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},Wpt=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Ms(n?.tokenizer);if(!r||r.traits.length===0)return{root:uq};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=kf(),A=`${m.name}: ${m.value}`,y={id:g,text:[A],children:[],cost:o.tokenLength(A),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};l.push(y),u.set(g,{componentPath:m.id,source:m,expectedTokens:y.cost}),s.set(g,m.importance??0),c+=m.importance??0}c=Math.max(c,1);let f=[`Related context: `,...new Array(l.length).fill(` -`)],h={id:kf(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return Yxe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},Wpt=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Ms(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:uq};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;Ag(s,A,()=>[]).push(g)}let c=new Map,l=[],u=new Map,d=0,f=this.ctx.get($r);for(let[g,A]of s.entries()){let y=f.getRelativePath({uri:g})??g,E=[`Compare ${A.length>1?"these snippets":"this snippet"} from ${y}: +`)],h={id:kf(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return Yxe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},zpt=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Ms(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:uq};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;yg(s,A,()=>[]).push(g)}let c=new Map,l=[],u=new Map,d=0,f=this.ctx.get($r);for(let[g,A]of s.entries()){let y=f.getRelativePath({uri:g})??g,E=[`Compare ${A.length>1?"these snippets":"this snippet"} from ${y}: `,...new Array(A.length).fill(` -`)],v=[];for(let S of A){let T=kf();u.set(T,S.importance??0);let w={id:T,text:[S.value],children:[],cost:o.tokenLength(S.value),weight:S.importance??0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};v.push(w),d+=S.importance??0,c.set(T,{componentPath:S.id,source:S,expectedTokens:w.cost})}l.push({id:kf(),text:E,children:v,cost:o.tokenLength(E.join("")),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0})}d=Math.max(d,1);let h=new Array(l.length+1).fill(""),m={id:kf(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return Yxe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},zpt=class{constructor(e,r){this.name=e;this.components=r}static{a(this,"ConcatenatedContextComponent")}snapshot(e,r){let n=this.components.map(d=>d.snapshot(e,r)),o=n.map(d=>d.root).filter(d=>d.id!==uq.id);if(o.length===0)return{root:uq};let s=["",...Array(o.length-1).fill(` -`),""],c={id:kf(),text:s,children:o,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1},l=[],u=new Map;for(let d of n){for(let[f,h]of d.statistics?.entries()??[])u.set(f,h);d.mask&&l.push(...d.mask)}return{root:c,mask:l,statistics:u}}};var Loa=.8,Ypt=class{constructor(e,r){this.ctx=e;this.components=r;this.renderId=0}static{a(this,"CascadingPromptFactory")}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}getComponentAllocation(e){let r=this.ctx.get(tr).suffixPercent(e),n=this.ctx.get(tr).stableContextPercent(e),o=this.ctx.get(tr).volatileContextPercent(e);if(r<0||r>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${r}`);if(n<0||n>100)throw new Error(`stableContextPercent must be between 0 and 100, but was ${n}`);if(o<0||o>100)throw new Error(`volatileContextPercent must be between 0 and 100, but was ${o}`);let s=100-r-n-o;if(s<=1||s>100)throw new Error(`prefixPercent must be between 1 and 100, but was ${s}`);return{prefix:s/100,suffix:r/100,stableContext:n/100,volatileContext:o/100}}async createPromptUnsafe(e,r){this.renderId++;let{completionId:n,completionState:o,telemetryData:s,promptOpts:c}=e,l=await this.failFastPrompt(o.textDocument,r);if(l)return l;let u=performance.now(),d;Tge(this.ctx,s)&&(d=await this.resolveContext(n,o,s,r));let f=performance.now()-u,h={},m={renderId:this.renderId,rendererName:"w",tokenizer:c?.tokenizer??"o200k_base",elisionTimeMs:0,renderTimeMs:0,updateDataTimeMs:f,componentStatistics:[]},g=o.textDocument.detectedLanguageId,{maxPromptLength:A}=zge(this.ctx,s,g),y=this.getComponentAllocation(s),_=y.suffix*A,E=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];_>Loa*(E??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let S=0;for(let N of v){let O=S+A*y[N],B=Hci(this.components[N],O,e,d);S=O-B.cost,h[N]=B,Boa(m,B.metadata)}let[T,w]=NG(h.prefix.text),R=performance.now(),x=Tge(this.ctx,s)?this.telemetrizeContext(n,m.componentStatistics,d?.resolvedContextItems??[]):[],k=[h.stableContext.text.trim(),h.volatileContext.text.trim()];return{type:"prompt",prompt:{prefix:c?.separateContext?T:B4(k.join(` +`)],v=[];for(let S of A){let T=kf();u.set(T,S.importance??0);let w={id:T,text:[S.value],children:[],cost:o.tokenLength(S.value),weight:S.importance??0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};v.push(w),d+=S.importance??0,c.set(T,{componentPath:S.id,source:S,expectedTokens:w.cost})}l.push({id:kf(),text:E,children:v,cost:o.tokenLength(E.join("")),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0})}d=Math.max(d,1);let h=new Array(l.length+1).fill(""),m={id:kf(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return Yxe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},Ypt=class{constructor(e,r){this.name=e;this.components=r}static{a(this,"ConcatenatedContextComponent")}snapshot(e,r){let n=this.components.map(d=>d.snapshot(e,r)),o=n.map(d=>d.root).filter(d=>d.id!==uq.id);if(o.length===0)return{root:uq};let s=["",...Array(o.length-1).fill(` +`),""],c={id:kf(),text:s,children:o,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1},l=[],u=new Map;for(let d of n){for(let[f,h]of d.statistics?.entries()??[])u.set(f,h);d.mask&&l.push(...d.mask)}return{root:c,mask:l,statistics:u}}};var Foa=.8,Kpt=class{constructor(e,r){this.ctx=e;this.components=r;this.renderId=0}static{a(this,"CascadingPromptFactory")}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}getComponentAllocation(e){let r=this.ctx.get(tr).suffixPercent(e),n=this.ctx.get(tr).stableContextPercent(e),o=this.ctx.get(tr).volatileContextPercent(e);if(r<0||r>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${r}`);if(n<0||n>100)throw new Error(`stableContextPercent must be between 0 and 100, but was ${n}`);if(o<0||o>100)throw new Error(`volatileContextPercent must be between 0 and 100, but was ${o}`);let s=100-r-n-o;if(s<=1||s>100)throw new Error(`prefixPercent must be between 1 and 100, but was ${s}`);return{prefix:s/100,suffix:r/100,stableContext:n/100,volatileContext:o/100}}async createPromptUnsafe(e,r){this.renderId++;let{completionId:n,completionState:o,telemetryData:s,promptOpts:c}=e,l=await this.failFastPrompt(o.textDocument,r);if(l)return l;let u=performance.now(),d;Tge(this.ctx,s)&&(d=await this.resolveContext(n,o,s,r));let f=performance.now()-u,h={},m={renderId:this.renderId,rendererName:"w",tokenizer:c?.tokenizer??"o200k_base",elisionTimeMs:0,renderTimeMs:0,updateDataTimeMs:f,componentStatistics:[]},g=o.textDocument.detectedLanguageId,{maxPromptLength:A}=zge(this.ctx,s,g),y=this.getComponentAllocation(s),_=y.suffix*A,E=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];_>Foa*(E??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let S=0;for(let N of v){let O=S+A*y[N],B=$ci(this.components[N],O,e,d);S=O-B.cost,h[N]=B,Uoa(m,B.metadata)}let[T,w]=MG(h.prefix.text),R=performance.now(),x=Tge(this.ctx,s)?this.telemetrizeContext(n,m.componentStatistics,d?.resolvedContextItems??[]):[],k=[h.stableContext.text.trim(),h.volatileContext.text.trim()];return{type:"prompt",prompt:{prefix:c?.separateContext?T:B4(k.join(` `),g)+` -`+T,prefixTokens:h.prefix.cost+h.stableContext.cost+h.volatileContext.cost,suffix:h.suffix.text,suffixTokens:h.suffix.cost,context:c?.separateContext?k:void 0,isFimEnabled:h.suffix.text.length>0},computeTimeMs:R-u,trailingWs:w,neighborSource:new Map,metadata:m,contextProvidersTelemetry:x}}async resolveContext(e,r,n,o){let s=await this.ctx.get(eS).resolution(e),{textDocument:c}=r,l=s.filter(hft),u=Opt(this.ctx,e,l);Lpt("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await Sft(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=dft(r);this.ctx.get(Rm).getStatisticsForCompletion(e).computeMatch(o);let s=pft(this.ctx,e,n);return Br.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return a6;if((await this.ctx.get(pc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Hpt;if(e.getText().length{this.nextRequest.changedFiles===void 0&&(this.nextRequest.changedFiles=[]),this.nextRequest.changedFiles.push(r.document.uri)}),this.deferredStart.resolve(),this.loop())}dispose(){this.isActive()&&(this.didDispose=!0,this.emitter.emit(t.DisposeEventName),this.fileChangeDisposable?.dispose(),this.client?.exit())}pushWorkspaceContext(e,r){this.nextRequest.sources={...this.nextRequest.sources,[e]:r}}recordWorkspaceContextActivity(e,r,n){this.nextRequest.recentActivity===void 0&&(this.nextRequest.recentActivity=[]),this.nextRequest.recentActivity.push({sourceId:e,locations:r,timestamp:n})}getLastEvent(){return this.lastEvent}onUpdate(e){return this.emitter.on(t.UpdateEventName,e),jn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),jn.Disposable.create(()=>this.emitter.off(t.DisposeEventName,e))}setContextLanguages(e){this.nextRequest.languages=e}async loop(){let e=0;for(;this.isActive();){try{let r=this.nextRequest;this.nextRequest={},this.lastEvent=await this.client.updateContext(r),this.emitter.emit(t.UpdateEventName,this.lastEvent),e=0}catch(r){if(MK(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=Uoa){this.dispose();break}}await JC(this.config.UpdateInterval)}}};function Wci(t,e){let r=n0(t,e,"event.WorkspaceContextUpdate");return t.get(SD).onUpdate(r)}a(Wci,"onWorkspaceContextUpdate");p();var Kpt=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=uq;this.disposables=[];this.rootWithPathCache=new Sn;this.disposables.push(Wci(e,r=>{(this.nextUpdateTime===void 0||performance.now()>=this.nextUpdateTime)&&setTimeout(()=>{this.update(r)},0)}))}static{a(this,"WorkspaceContextPromptComponent")}snapshot(e){let{completionState:r,telemetryData:n}=e;this.nextUpdateTime=this.lastUpdateTime!==void 0?this.lastUpdateTime+this.ctx.get(tr).workspaceContextCacheTime(n):performance.now();let o=Ag(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:kf(),text:[`${c} -`,""],children:[this.root],cost:1,weight:1,elisionMarker:"",canMerge:!0,requireRenderedChild:!1}}),s=this.getMask(r.textDocument.uri);return{root:o,mask:s}}getRoot(){return this.root}getMask(e){let r=this.documents.get(e);return r===void 0?[]:[r.id]}getPathMarker(e){let r=e.textDocument,n=this.ctx.get($r),o=n.getRelativePath(e.textDocument),s={uri:r.uri,source:"",relativePath:o,languageId:r.detectedLanguageId},c=n.findNotebook(r);return s.relativePath&&!c?B4(Pft(s),s.languageId):B4(kft(s),s.languageId)}update(e){this.rootWithPathCache.clear(),this.documents.clear();for(let[r,n]of Object.entries(e.documents)){let o=this.createAnnotatedDocumentRoot(r,n);n.requireRenderedChild=n.children.length>0,this.documents.set(r,o)}this.root=this.createRootNode(),this.lastUpdateTime=performance.now()}createRootNode(){let e=new Array(this.documents.size+1).fill(""),r=[...this.documents.values()];return{id:kf(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=OO({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:kf(),text:[o,` +`+T,prefixTokens:h.prefix.cost+h.stableContext.cost+h.volatileContext.cost,suffix:h.suffix.text,suffixTokens:h.suffix.cost,context:c?.separateContext?k:void 0,isFimEnabled:h.suffix.text.length>0},computeTimeMs:R-u,trailingWs:w,neighborSource:new Map,metadata:m,contextProvidersTelemetry:x}}async resolveContext(e,r,n,o){let s=await this.ctx.get(eS).resolution(e),{textDocument:c}=r,l=s.filter(mft),u=Lpt(this.ctx,e,l);Bpt("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await Tft(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=fft(r);this.ctx.get(km).getStatisticsForCompletion(e).computeMatch(o);let s=hft(this.ctx,e,n);return Fr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return a6;if((await this.ctx.get(pc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Gpt;if(e.getText().length{this.nextRequest.changedFiles===void 0&&(this.nextRequest.changedFiles=[]),this.nextRequest.changedFiles.push(r.document.uri)}),this.deferredStart.resolve(),this.loop())}dispose(){this.isActive()&&(this.didDispose=!0,this.emitter.emit(t.DisposeEventName),this.fileChangeDisposable?.dispose(),this.client?.exit())}pushWorkspaceContext(e,r){this.nextRequest.sources={...this.nextRequest.sources,[e]:r}}recordWorkspaceContextActivity(e,r,n){this.nextRequest.recentActivity===void 0&&(this.nextRequest.recentActivity=[]),this.nextRequest.recentActivity.push({sourceId:e,locations:r,timestamp:n})}getLastEvent(){return this.lastEvent}onUpdate(e){return this.emitter.on(t.UpdateEventName,e),jn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),jn.Disposable.create(()=>this.emitter.off(t.DisposeEventName,e))}setContextLanguages(e){this.nextRequest.languages=e}async loop(){let e=0;for(;this.isActive();){try{let r=this.nextRequest;this.nextRequest={},this.lastEvent=await this.client.updateContext(r),this.emitter.emit(t.UpdateEventName,this.lastEvent),e=0}catch(r){if(OK(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=qoa){this.dispose();break}}await JC(this.config.UpdateInterval)}}};function Yci(t,e){let r=i0(t,e,"event.WorkspaceContextUpdate");return t.get(SD).onUpdate(r)}a(Yci,"onWorkspaceContextUpdate");p();var Jpt=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=uq;this.disposables=[];this.rootWithPathCache=new Sn;this.disposables.push(Yci(e,r=>{(this.nextUpdateTime===void 0||performance.now()>=this.nextUpdateTime)&&setTimeout(()=>{this.update(r)},0)}))}static{a(this,"WorkspaceContextPromptComponent")}snapshot(e){let{completionState:r,telemetryData:n}=e;this.nextUpdateTime=this.lastUpdateTime!==void 0?this.lastUpdateTime+this.ctx.get(tr).workspaceContextCacheTime(n):performance.now();let o=yg(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:kf(),text:[`${c} +`,""],children:[this.root],cost:1,weight:1,elisionMarker:"",canMerge:!0,requireRenderedChild:!1}}),s=this.getMask(r.textDocument.uri);return{root:o,mask:s}}getRoot(){return this.root}getMask(e){let r=this.documents.get(e);return r===void 0?[]:[r.id]}getPathMarker(e){let r=e.textDocument,n=this.ctx.get($r),o=n.getRelativePath(e.textDocument),s={uri:r.uri,source:"",relativePath:o,languageId:r.detectedLanguageId},c=n.findNotebook(r);return s.relativePath&&!c?B4(Dft(s),s.languageId):B4(Pft(s),s.languageId)}update(e){this.rootWithPathCache.clear(),this.documents.clear();for(let[r,n]of Object.entries(e.documents)){let o=this.createAnnotatedDocumentRoot(r,n);n.requireRenderedChild=n.children.length>0,this.documents.set(r,o)}this.root=this.createRootNode(),this.lastUpdateTime=performance.now()}createRootNode(){let e=new Array(this.documents.size+1).fill(""),r=[...this.documents.values()];return{id:kf(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=OO({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:kf(),text:[o,` `],children:[r],cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}getDocumentAnnotation(e,r){let o=this.ctx.get($r).getRelativePath({uri:e});return B4(`Related portions of ${o??e}: -`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var Jpt=class extends Ypt{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new Kpt(e),prefix:new Gpt,suffix:new $pt(e),volatileContext:new zpt("volatileContext",[new Vpt,new Wpt(e)])};super(e,r)}};var zci=fe(ii());var c6=class{static{a(this,"CompletionsPromptFactory")}};function Zpt(t,e,r){return new xAr(new wAr(new RAr(t,new Qpt(t,e,r),new Jpt(t),qoa)))}a(Zpt,"createCompletionsPromptFactory");var xAr=class extends c6{constructor(r){super();this.delegate=r}static{a(this,"SequentialCompletionsPromptFactory")}async prompt(r,n){return this.lastPromise=this.promptAsync(r,n),this.lastPromise}async promptAsync(r,n){if(await this.lastPromise,n?.isCancellationRequested)return a6;try{return await this.delegate.prompt(r,n)}catch{return Yge}}},Qoa=1200,wAr=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new zci.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(Yci)},Qoa)})])}},RAr=class{constructor(e,r,n,o){this.ctx=e;this.defaultDelegate=r;this.experimentalDelegate=n;this.fn=o}static{a(this,"ExperimentalCompletionsPromptFactory")}async prompt(e,r){return this.fn(this.ctx,e.telemetryData)?this.experimentalDelegate.prompt(e,r):this.defaultDelegate.prompt(e,r)}};function qoa(t,e){let r=t.get(SD);return r.isEnabled(e)&&r.isActive()}a(qoa,"workspaceContextEnabledAndActive");var qpt=10,jpt={type:"contextTooShort"},Hpt={type:"copilotContentExclusion"},Yge={type:"promptError"},a6={type:"promptCancelled"},Yci={type:"promptTimeout"};function NG(t){let e=t.split(` -`),r=e[e.length-1],n=r.length-r.trimEnd().length,o=t.slice(0,t.length-n),s=t.slice(o.length);return[r.length==n?o:t,s]}a(NG,"trimLastLine");function Kge(t,e,r,n,o,s={}){let l=t.get($r).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=Hoa(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=Oci(t,n);return t.get(c6).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(Kge,"extractPrompt");function joa(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:B4(n,e)}a(joa,"addNeighboringCellsToPrompt");function Hoa(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>joa(l,r.document.detectedLanguageId)).join(` +`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var Zpt=class extends Kpt{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new Jpt(e),prefix:new $pt,suffix:new Vpt(e),volatileContext:new Ypt("volatileContext",[new Wpt,new zpt(e)])};super(e,r)}};var Kci=fe(ii());var c6=class{static{a(this,"CompletionsPromptFactory")}};function Xpt(t,e,r){return new wAr(new RAr(new kAr(t,new qpt(t,e,r),new Zpt(t),Hoa)))}a(Xpt,"createCompletionsPromptFactory");var wAr=class extends c6{constructor(r){super();this.delegate=r}static{a(this,"SequentialCompletionsPromptFactory")}async prompt(r,n){return this.lastPromise=this.promptAsync(r,n),this.lastPromise}async promptAsync(r,n){if(await this.lastPromise,n?.isCancellationRequested)return a6;try{return await this.delegate.prompt(r,n)}catch{return Yge}}},joa=1200,RAr=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new Kci.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(Jci)},joa)})])}},kAr=class{constructor(e,r,n,o){this.ctx=e;this.defaultDelegate=r;this.experimentalDelegate=n;this.fn=o}static{a(this,"ExperimentalCompletionsPromptFactory")}async prompt(e,r){return this.fn(this.ctx,e.telemetryData)?this.experimentalDelegate.prompt(e,r):this.defaultDelegate.prompt(e,r)}};function Hoa(t,e){let r=t.get(SD);return r.isEnabled(e)&&r.isActive()}a(Hoa,"workspaceContextEnabledAndActive");var jpt=10,Hpt={type:"contextTooShort"},Gpt={type:"copilotContentExclusion"},Yge={type:"promptError"},a6={type:"promptCancelled"},Jci={type:"promptTimeout"};function MG(t){let e=t.split(` +`),r=e[e.length-1],n=r.length-r.trimEnd().length,o=t.slice(0,t.length-n),s=t.slice(o.length);return[r.length==n?o:t,s]}a(MG,"trimLastLine");function Kge(t,e,r,n,o,s={}){let l=t.get($r).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=$oa(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=Bci(t,n);return t.get(c6).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(Kge,"extractPrompt");function Goa(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:B4(n,e)}a(Goa,"addNeighboringCellsToPrompt");function $oa(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>Goa(l,r.document.detectedLanguageId)).join(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(Hoa,"applyEditsForNotebook");function zge(t,e,r){let o=t.get(tr).maxPromptCompletionTokens(e)-nJe(t),s=ksi(e,r),c=bft(t,e,r),l=t.get(tr).suffixPercent(e),u=t.get(tr).suffixMatchThreshold(e);if(l<0||l>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${l}`);if(u<0||u>100)throw new Error(`suffixMatchThreshold must be between 0 and 100, but was ${u}`);return{maxPromptLength:o,similarFilesOptions:c,numberOfSnippets:s,suffixPercent:l,suffixMatchThreshold:u}}a(zge,"getPromptOptions");p();p();var Kci=2.98410452738298,Jci=-.838732736843507,Zci=1.50314646255716,Xci=-.237798634012662,Xpt={python:.314368072478742},eli={"0.01":.225800751784931,"0.02":.290204307767402,"0.03":.333153496466045,"0.05":.404516749849559,"0.1":.513216040545626,"0.2":.626904979128674,"0.3":.694880719658273,"0.4":.743100684947291,"0.5":.782524520571946,"0.6":.816856186092243,"0.7":.84922977716585,"0.8":.883694877241999,"0.9":.921859050950077,"0.95":.944571268106974,"0.99":.969535563141733};var Goa={link:a(t=>Math.exp(t)/(1+Math.exp(t)),"link"),unlink:a(t=>Math.log(t/(1-t)),"unlink")};function $oa(t,e){let r=Math.min(...Array.from(e.keys()).filter(c=>c>=t)),n=Math.max(...Array.from(e.keys()).filter(c=>co)}contribution(e){return this.coefficient*this.transformation(e)}},kAr=class{constructor(e,r,n){this.link=Goa;if(this.intercept=e,this.coefficients=r,this.logitsToQuantiles=new Map,this.logitsToQuantiles.set(0,0),this.logitsToQuantiles.set(1,1),n)for(let o in n)this.logitsToQuantiles.set(n[o],Number(o))}static{a(this,"LogisticRegression")}predict(e,r){let n=this.intercept;for(let o of this.coefficients){let s=r[o.name];if(s===void 0)return NaN;n+=o.contribution(s)}return this.link.link(n)}quantile(e,r){let n=this.predict(e,r);return $oa(n,this.logitsToQuantiles)}},tli=new kAr(Kci,[new Jge("compCharLen",Jci,t=>Math.log(1+t)),new Jge("meanLogProb",Zci),new Jge("meanAlternativeLogProb",Xci)].concat(Object.entries(Xpt).map(t=>new Jge(t[0],t[1]))),eli);function rli(t,e){let r={...e.measurements};return Object.keys(Xpt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),tli.predict(t,r)}a(rli,"ghostTextScoreConfidence");function nli(t,e){let r={...e.measurements};return Object.keys(Xpt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),tli.quantile(t,r)}a(nli,"ghostTextScoreQuantile");p();function Voa(t,e,r,n){let o="}";try{o=Ngn(e.detectedLanguageId)??"}"}catch{}return Woa({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(Voa,"maybeSnipCompletion");function Woa(t,e,r,n){let o=zoa(r),s=o.lines;if(s.length===1)return r;for(let c=1;c=t.getLineCount()?void 0:t.getLineText(y),h!==void 0&&h.trim()==="")u++;else break}let m,g;for(;m=c+f+d,g=m>=s.length?void 0:s[m],g!==void 0&&g.trim()==="";)d++;let A=m===s.length-1;if(!g||!(h&&(A?h.startsWith(g)||g.startsWith(h):h===g&&g.trim()===n))){l=!1;break}}if(l)return s.slice(0,c).join(o.newLineCharacter)}return r}a(Woa,"maybeSnipCompletionImpl");function zoa(t){let e=t.includes(`\r +`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a($oa,"applyEditsForNotebook");function zge(t,e,r){let o=t.get(tr).maxPromptCompletionTokens(e)-nJe(t),s=Dsi(e,r),c=Sft(t,e,r),l=t.get(tr).suffixPercent(e),u=t.get(tr).suffixMatchThreshold(e);if(l<0||l>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${l}`);if(u<0||u>100)throw new Error(`suffixMatchThreshold must be between 0 and 100, but was ${u}`);return{maxPromptLength:o,similarFilesOptions:c,numberOfSnippets:s,suffixPercent:l,suffixMatchThreshold:u}}a(zge,"getPromptOptions");p();p();var Zci=2.98410452738298,Xci=-.838732736843507,eli=1.50314646255716,tli=-.237798634012662,eht={python:.314368072478742},rli={"0.01":.225800751784931,"0.02":.290204307767402,"0.03":.333153496466045,"0.05":.404516749849559,"0.1":.513216040545626,"0.2":.626904979128674,"0.3":.694880719658273,"0.4":.743100684947291,"0.5":.782524520571946,"0.6":.816856186092243,"0.7":.84922977716585,"0.8":.883694877241999,"0.9":.921859050950077,"0.95":.944571268106974,"0.99":.969535563141733};var Voa={link:a(t=>Math.exp(t)/(1+Math.exp(t)),"link"),unlink:a(t=>Math.log(t/(1-t)),"unlink")};function Woa(t,e){let r=Math.min(...Array.from(e.keys()).filter(c=>c>=t)),n=Math.max(...Array.from(e.keys()).filter(c=>co)}contribution(e){return this.coefficient*this.transformation(e)}},PAr=class{constructor(e,r,n){this.link=Voa;if(this.intercept=e,this.coefficients=r,this.logitsToQuantiles=new Map,this.logitsToQuantiles.set(0,0),this.logitsToQuantiles.set(1,1),n)for(let o in n)this.logitsToQuantiles.set(n[o],Number(o))}static{a(this,"LogisticRegression")}predict(e,r){let n=this.intercept;for(let o of this.coefficients){let s=r[o.name];if(s===void 0)return NaN;n+=o.contribution(s)}return this.link.link(n)}quantile(e,r){let n=this.predict(e,r);return Woa(n,this.logitsToQuantiles)}},nli=new PAr(Zci,[new Jge("compCharLen",Xci,t=>Math.log(1+t)),new Jge("meanLogProb",eli),new Jge("meanAlternativeLogProb",tli)].concat(Object.entries(eht).map(t=>new Jge(t[0],t[1]))),rli);function ili(t,e){let r={...e.measurements};return Object.keys(eht).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),nli.predict(t,r)}a(ili,"ghostTextScoreConfidence");function oli(t,e){let r={...e.measurements};return Object.keys(eht).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),nli.quantile(t,r)}a(oli,"ghostTextScoreQuantile");p();function zoa(t,e,r,n){let o="}";try{o=Mgn(e.detectedLanguageId)??"}"}catch{}return Yoa({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(zoa,"maybeSnipCompletion");function Yoa(t,e,r,n){let o=Koa(r),s=o.lines;if(s.length===1)return r;for(let c=1;c=t.getLineCount()?void 0:t.getLineText(y),h!==void 0&&h.trim()==="")u++;else break}let m,g;for(;m=c+f+d,g=m>=s.length?void 0:s[m],g!==void 0&&g.trim()==="";)d++;let A=m===s.length-1;if(!g||!(h&&(A?h.startsWith(g)||g.startsWith(h):h===g&&g.trim()===n))){l=!1;break}}if(l)return s.slice(0,c).join(o.newLineCharacter)}return r}a(Yoa,"maybeSnipCompletionImpl");function Koa(t){let e=t.includes(`\r `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(zoa,"splitByNewLine");function Yoa(t,e,r,n){let o="",s=e.line+1,c=n?r.trim():r;for(;o===""&&s0){if(r.completionText.indexOf(o)!==-1)return o.length;{let s=-1,c=0;for(let l of o){let u=r.completionText.indexOf(l,s+1);if(u>s)c++,s=u;else break}return c}}return 0}a(ili,"checkSuffix");var cli=fe(Y9());Fo();var vl=new pe("ghostText");var oli=20;async function lli(t,e,r,n,o,s,c){vl.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=Gue(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:Fgn(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},f={n:l,temperature:u,code_annotations:!1},h=kt(t,ze.ModelAlwaysTerminatesSingleline)??t.get(tr).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&MO.isSupported(e.languageId)&&!h;!e.multiline&&!m?f.stop=[` -`]:e.stop&&(f.stop=e.stop),e.maxTokens!==void 0&&(f.max_tokens=e.maxTokens);let g=Date.now(),A={endpoint:"completions",uiKind:"ghostText",temperature:JSON.stringify(u),n:JSON.stringify(l),stop:JSON.stringify(f.stop)??"unset",logit_bias:JSON.stringify(null)};Object.assign(r.properties,A);try{let y={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:l,uiKind:"ghostText",postOptions:f,headers:e.headers,extra:d},_=await t.get(JO).fetchAndStreamCompletions(t,y,r,o,n);return _.type==="failed"?{type:"failed",reason:_.reason,telemetryData:xp(r,t)}:_.type==="canceled"?(vl.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:TG(r)}):c(g,_.getProcessingTime(),_.choices)}catch(y){if(ng(y))return{type:"canceled",reason:"network request aborted",telemetryData:TG(r,{cancelledNetworkRequest:!0})};if(vl.exception(t,y,"Error on ghost text request"),t.get(jC).notifyUser(t,y),sSe(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:xp(r,t)}}}a(lli,"genericGetCompletionsFromNetwork");function PAr(t,e,r){if(r||(r=[]),t.completionText=t.completionText.trimEnd(),!!t.completionText&&r.findIndex(n=>n.completionText.trim()===t.completionText.trim())===-1)return t}a(PAr,"postProcessChoices");async function Joa(t,e,r,n,o){return lli(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return vl.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:xp(r,t)};if(n?.isCancellationRequested)return vl.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:TG(r)};let f=d.value;if(f===void 0)return vl.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:xp(r,t)};dli(t,"performance",f,s,c),vl.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=PAr(f,e);h&&(eht(t,e,h),vl.debug(t,`GhostText first completion (index ${h?.choiceIndex}): ${JSON.stringify(h?.completionText)}`));let m=(async()=>{let g=h!==void 0?[h]:[];for await(let A of l){if(A===void 0)continue;vl.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=PAr(A,e,g);y&&(g.push(y),eht(t,e,y))}})();return s1(t)&&await m,h?{type:"success",value:[DAr(h,{forceSingleLine:!1}),m],telemetryData:xp(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:xp(r,t)}})}a(Joa,"getCompletionsFromNetwork");async function Zoa(t,e,r,n,o){return lli(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return vl.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:TG(r)};let f=PAr(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)eht(t,e,d);dli(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:xp(r,t),telemetryBlob:r,resultType:3}})}a(Zoa,"getAllCompletionsFromNetwork");function DAr(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` +`;return{lines:t.split(e),newLineCharacter:e}}a(Koa,"splitByNewLine");function Joa(t,e,r,n){let o="",s=e.line+1,c=n?r.trim():r;for(;o===""&&s0){if(r.completionText.indexOf(o)!==-1)return o.length;{let s=-1,c=0;for(let l of o){let u=r.completionText.indexOf(l,s+1);if(u>s)c++,s=u;else break}return c}}return 0}a(sli,"checkSuffix");var uli=fe(Y9());Fo();var vl=new pe("ghostText");var ali=20;async function dli(t,e,r,n,o,s,c){vl.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=$ue(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:Ugn(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},f={n:l,temperature:u,code_annotations:!1},h=kt(t,ze.ModelAlwaysTerminatesSingleline)??t.get(tr).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&MO.isSupported(e.languageId)&&!h;!e.multiline&&!m?f.stop=[` +`]:e.stop&&(f.stop=e.stop),e.maxTokens!==void 0&&(f.max_tokens=e.maxTokens);let g=Date.now(),A={endpoint:"completions",uiKind:"ghostText",temperature:JSON.stringify(u),n:JSON.stringify(l),stop:JSON.stringify(f.stop)??"unset",logit_bias:JSON.stringify(null)};Object.assign(r.properties,A);try{let y={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:l,uiKind:"ghostText",postOptions:f,headers:e.headers,extra:d},_=await t.get(JO).fetchAndStreamCompletions(t,y,r,o,n);return _.type==="failed"?{type:"failed",reason:_.reason,telemetryData:xp(r,t)}:_.type==="canceled"?(vl.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:IG(r)}):c(g,_.getProcessingTime(),_.choices)}catch(y){if(ig(y))return{type:"canceled",reason:"network request aborted",telemetryData:IG(r,{cancelledNetworkRequest:!0})};if(vl.exception(t,y,"Error on ghost text request"),t.get(jC).notifyUser(t,y),sSe(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:xp(r,t)}}}a(dli,"genericGetCompletionsFromNetwork");function DAr(t,e,r){if(r||(r=[]),t.completionText=t.completionText.trimEnd(),!!t.completionText&&r.findIndex(n=>n.completionText.trim()===t.completionText.trim())===-1)return t}a(DAr,"postProcessChoices");async function Xoa(t,e,r,n,o){return dli(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return vl.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:xp(r,t)};if(n?.isCancellationRequested)return vl.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:IG(r)};let f=d.value;if(f===void 0)return vl.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:xp(r,t)};pli(t,"performance",f,s,c),vl.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=DAr(f,e);h&&(tht(t,e,h),vl.debug(t,`GhostText first completion (index ${h?.choiceIndex}): ${JSON.stringify(h?.completionText)}`));let m=(async()=>{let g=h!==void 0?[h]:[];for await(let A of l){if(A===void 0)continue;vl.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=DAr(A,e,g);y&&(g.push(y),tht(t,e,y))}})();return s1(t)&&await m,h?{type:"success",value:[NAr(h,{forceSingleLine:!1}),m],telemetryData:xp(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:xp(r,t)}})}a(Xoa,"getCompletionsFromNetwork");async function esa(t,e,r,n,o){return dli(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return vl.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:IG(r)};let f=DAr(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)tht(t,e,d);pli(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:xp(r,t),telemetryBlob:r,resultType:3}})}a(esa,"getAllCompletionsFromNetwork");function NAr(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` `)[1]:r.completionText=n.split(` -`)[0]}return r}a(DAr,"makeGhostAPIChoice");function sli(t){return e=>{let r=e?.split(` +`)[0]}return r}a(NAr,"makeGhostAPIChoice");function cli(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(sli,"takeNLines");async function Xoa(t,e,r,n,o,s,c,l){let u=t.get(tr).multilineAfterAcceptLines(l),d=t.get(t2).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:sli(u),stop:[` +`).length}}a(cli,"takeNLines");async function tsa(t,e,r,n,o,s,c,l){let u=t.get(tr).multilineAfterAcceptLines(l),d=t.get(t2).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:cli(u),stop:[` -`],maxTokens:oli*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await csa(t,d,e.textDocument,e.position,s,c,n)}catch{f={requestMultiline:!1}}if(!c&&f.requestMultiline&&t.get(tr).singleLineUnlessAccepted(l)&&(f.requestMultiline=!1),f.requestMultiline){let h;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?h=wu.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):h=e.position,{blockMode:d,requestMultiline:!0,...ali(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:sli(u),stop:[` +`],maxTokens:ali*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await usa(t,d,e.textDocument,e.position,s,c,n)}catch{f={requestMultiline:!1}}if(!c&&f.requestMultiline&&t.get(tr).singleLineUnlessAccepted(l)&&(f.requestMultiline=!1),f.requestMultiline){let h;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?h=wu.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):h=e.position,{blockMode:d,requestMultiline:!0,...lli(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:cli(u),stop:[` -`],maxTokens:oli*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...ali(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a(Xoa,"getGhostTextStrategy");function ali(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&MO.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(tr).longLookaheadSize(u):t.get(tr).shortLookaheadSize(u);return{finishedCb:new sft(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};eht(t,g,m)}).getFinishedCallback(),maxTokens:t.get(tr).maxMultilineTokens(u)}}return{finishedCb:c?jMe(t,r,n):d=>{}}}a(ali,"buildFinishedCallback");var esa={isCycling:!1,promptOnly:!1,isSpeculative:!1};function tsa(t,e,r){let n=kt(t,ze.CompletionsDebounce)??t.get(tr).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=Rl()-r.issuedTime;return Math.max(0,n-o)}a(tsa,"getRemainingDebounceMs");function hOe(t,e,r){return r?.isCancellationRequested||e!==t.get(Xb).currentRequestId}a(hOe,"inlineCompletionRequestCancelled");async function rsa(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(_){let E=Rl();l.push([_,E-c]),c=E}a(u,"recordPerformance"),u("telemetry");let d=t.get(tr);if(hOe(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:xp(n,t)};let f=isa(e.textDocument,e.position);if(f===void 0)return vl.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:xp(n,t)};let h=XQ(t,n),m={...esa,...s,tokenizer:h.tokenizer},g=await Kge(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return vl.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:xp(n,t)};if(g.type==="contextTooShort")return vl.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:xp(n,t)};if(g.type==="promptError")return vl.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:xp(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return vl.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:xp(n,t)};if(g.type==="promptTimeout")return vl.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:xp(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return vl.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:xp(n,t)};let A=tsa(t,m,n);return A>0&&(vl.debug(t,`Debouncing ghost text request for ${A}ms`),await JC(A),hOe(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:xp(n,t)}:t.get(ks).trackCompletionJob(async()=>{let[_]=NG(e.textDocument.getText(wu.range(wu.position(0,0),e.position))),E=t.get(Xb).hasAcceptedCurrentCompletion(_,g.prompt.suffix),v=g.prompt,S=await Xoa(t,e,_,g,m.isCycling,f,E,n);u("strategy");let T=nsa(t,_,v,S.requestMultiline);u("cache");let w=eq(t,e.textDocument.uri),R={blockMode:S.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:w,engineModelId:h.modelId,ourRequestId:r,prefix:_,prompt:g.prompt,multiline:S.requestMultiline,indentation:_ft(e.textDocument,e.position),isCycling:m.isCycling,headers:h.headers,stop:S.stop,maxTokens:S.maxTokens,afterAccept:E};R.headers={...R.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":m.isSpeculative?"true":"false"};let x=psa(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(Zb).shouldWaitForAsyncCompletions(_,g.prompt)){let U=await t.get(Zb).getFirstMatchingRequestWithTimeout(r,_,g.prompt,m.isSpeculative,x);if(u("asyncWait"),U){let j=!S.requestMultiline;T=[[DAr(U[0],{forceSingleLine:j})],4]}if(hOe(t,r,o))return vl.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:xp(x,t)}}let k=S.blockMode==="moremultiline"&&MO.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(U=>pOe(t,e.textDocument,e.position,U,k,vl)).filter(U=>U!==void 0)),T!==void 0&&T[0].length===0)return vl.debug(t,`Found empty inline suggestions locally via ${bge(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:xp(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))vl.debug(t,`Found inline suggestions locally via ${bge(T[1])}`);else{if(m.isCycling){let U=await Zoa(t,R,x,o,S.finishedCb);if(U.type==="success"){let j=T?.[0]??[];U.value[0].forEach(Q=>{j.findIndex(Y=>Y.completionText.trim()===Q.completionText.trim())===-1&&j.push(Q)}),T=[j,3]}else if(T===void 0)return U}else{let U=a((W,V)=>(t.get(Zb).updateCompletion(r,W),S.finishedCb(W,V)),"finishedCb"),j=new jn.CancellationTokenSource,Q=Joa(t,R,x,j.token,U);t.get(Zb).queueCompletionRequest(r,_,g.prompt,j,Q);let Y=await t.get(Zb).getFirstMatchingRequest(r,_,g.prompt,m.isSpeculative);if(Y===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:xp(x,t)};T=[[Y[0]],4]}u("network")}if(T===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:xp(x,t)};let[D,N]=T,O=D.map(U=>pOe(t,e.textDocument,e.position,U,k,vl)).filter(U=>U!==void 0),B=kt(t,ze.CompletionsDelay)??d.completionsDelay(n),q=Rl()-n.issuedTime,M=Math.max(B-q,0);if(N!==2&&!m.isCycling&&M>0&&(vl.debug(t,`Waiting ${M}ms before returning completion`),await JC(M),hOe(t,r,o)))return vl.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:TG(x)};let L=[];for(let U of O){let j=fsa(t,e.textDocument,R,U,x),Q=f?ili(e.textDocument,e.position,U):0,W={completion:lsa(U.choiceIndex,U.completionText,g.trailingWs),telemetry:j,isMiddleOfTheLine:f,suffixCoverage:Q,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};L.push(W)}return x.properties.clientCompletionId=L[0]?.clientCompletionId,x.measurements.foundOffset=L?.[0]?.telemetry?.measurements?.foundOffset??-1,vl.debug(t,`Produced ${L.length} results from ${bge(N)} at ${x.measurements.foundOffset} offset`),hOe(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:TG(x)}:(m.isSpeculative||t.get(Xb).setGhostText(_,g.prompt.suffix,O,N),u("complete"),{type:"success",value:[L,N],telemetryData:xp(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(rsa,"getGhostTextWithoutAbortHandling");async function NAr(t,e,r,n){let o=Dt();t.get(Xb).currentRequestId=o;let s=await dsa(t,e.textDocument,o,n);await ZQ().catch(()=>{});try{return t.get(eS).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(M4).notifyRequest(e,o,s,r,n),await rsa(t,e,o,s,r,n)}catch(c){if(ng(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:TG(s,{cancelledNetworkRequest:!0})};throw c}}a(NAr,"getGhostText");function nsa(t,e,r,n){let o=t.get(Xb).getCompletionsForUserTyping(e,r.suffix),s=usa(t,e,r.suffix,n);if(o&&o.length>0){let c=(s??[]).filter(l=>!o.some(u=>u.completionText===l.completionText));return[o.concat(c),2]}if(s&&s.length>0)return[s,1]}a(nsa,"getLocalInlineSuggestion");function isa(t,e){let r=osa(e,t),n=ssa(e,t);return r&&!n?void 0:r&&n}a(isa,"isInlineSuggestion");function osa(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(osa,"isMiddleOfTheLine");function ssa(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(ssa,"isValidMiddleOfTheLinePosition");function asa(t,e){return e.lineAt(t).text.trim().length===0}a(asa,"isNewLine");var l6=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function csa(t,e,r,n,o,s,c){if(t.get(l6).requestMultilineOverride)return{requestMultiline:!0};if(r.lineCount>=8e3)ft(t,"ghostText.longFileMultilineSkip",Vt.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e=="moremultiline"&&MO.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await Ogn(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&asa(n,r))return{requestMultiline:!0};let u=!1;return!o&&tT(r.detectedLanguageId)?u=await yft(r,n):o&&tT(r.detectedLanguageId)&&(u=await yft(r,n)||await yft(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=Zoi(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(csa,"shouldRequestMultiline");function eht(t,e,r){t.get(AD).append(e.prefix,e.prompt.suffix,r)}a(eht,"appendToCache");function lsa(t,e,r){if(r.length>0){if(e.startsWith(r))return{completionIndex:t,completionText:e,displayText:e.substring(r.length),displayNeedsWsOffset:!1};{let n=e.substring(0,e.length-e.trimStart().length);return r.startsWith(n)?{completionIndex:t,completionText:e,displayText:e.trimStart(),displayNeedsWsOffset:!0}:{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}}else return{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}a(lsa,"adjustLeadingWhitespace");function usa(t,e,r,n){let o=t.get(AD).findAll(e,r);return o.length===0?(vl.debug(t,"Found no completions in cache"),[]):(vl.debug(t,`Found ${o.length} completions in cache`),o.map(s=>DAr(s,{forceSingleLine:!n})))}a(usa,"getCompletionsFromCache");async function dsa(t,e,r,n){let o={headerRequestId:r};n?.opportunityId&&(o.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(o.completionsActive="true"),n?.isSpeculative&&(o.reason="speculative");let s=Vt.createAndMarkAsIssued(o);return await t.get(tr).fetchTokenAndUpdateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},s)}a(dsa,"createTelemetryWithExp");function fsa(t,e,r,n,o){let s=n.requestId,c={choiceIndex:n.choiceIndex.toString(),clientCompletionId:n.clientCompletionId};n.generatedChoiceIndex!==void 0&&(c.originalChoiceIndex=c.choiceIndex,c.choiceIndex=(1e4*(n.generatedChoiceIndex+1)+n.choiceIndex).toString());let l={compCharLen:n.completionText.length,numLines:n.completionText.trim().split(` -`).length};n.meanLogProb&&(l.meanLogProb=n.meanLogProb),n.meanAlternativeLogProb&&(l.meanAlternativeLogProb=n.meanAlternativeLogProb);let u=n.telemetryData.extendedBy(c,l);return u.issuedTime=o.issuedTime,u.measurements.timeToProduceMs=performance.now()-o.issuedTime,uli(u,e),u.extendWithRequestId(s),u.measurements.confidence=rli(t,u),u.measurements.quantile=nli(t,u),vl.debug(t,`Extended telemetry for ${n.telemetryData.properties.headerRequestId} with retention confidence ${u.measurements.confidence} (expected as good or better than about ${u.measurements.quantile} of all suggestions)`),u}a(fsa,"telemetryWithAddData");function psa(t,e,r,n,o,s,c,l){let u={languageId:e.detectedLanguageId};u.afterAccept=r.afterAccept.toString(),u.isSpeculative=l.isSpeculative.toString();let d=s.extendedBy(u);uli(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===0?"pending":"available",f!==void 0&&f!==0&&(d.properties.gitRepoUrl=f.url,d.properties.gitRepoHost=f.hostname,d.properties.gitRepoOwner=f.owner,d.properties.gitRepoName=f.repo,d.properties.gitRepoPath=f.pathname),d.properties.engineName=c.modelId,d.properties.engineChoiceSource=c.engineChoiceSource,d.properties.isMultiline=JSON.stringify(r.multiline),d.properties.isCycling=JSON.stringify(r.isCycling);let h=e.lineAt(n.line),m=e.getText(wu.range(h.range.start,n)),g=e.getText(wu.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(S=>(0,cli.SHA256)(S).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},_={...hae(o.prompt),promptEndPos:e.offsetAt(n),promptComputeTimeMs:o.computeTimeMs};o.metadata&&(y.promptMetadata=JSON.stringify(o.metadata)),o.contextProvidersTelemetry&&(y.contextProviders=JSON.stringify(o.contextProvidersTelemetry));let E=d.extendedBy(y,_);return ft(t,"ghostText.issued",E),d}a(psa,"telemetryIssued");function uli(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(uli,"addDocumentTelemetry");function dli(t,e,r,n,o){let s=Date.now()-n,c=s-o,l=r.telemetryData.extendedBy({},{completionCharLen:r.completionText.length,requestTimeMs:s,processingTimeMs:o,deltaMs:c,meanLogProb:r.meanLogProb||NaN,meanAlternativeLogProb:r.meanAlternativeLogProb||NaN});l.extendWithRequestId(r.requestId),ft(t,`ghostText.${e}`,l)}a(dli,"telemetryPerformance");p();p();var tte=class{constructor(e,r,n){this._referenceCount=0;this._isDisposed=!1;this._offset=n;let o=e.get($r);this._tracker=o.onDidChangeTextDocument(s=>{if(s.document.uri===r){for(let c of s.contentChanges)if(c.rangeOffset+c.rangeLength<=this.offset){let l=c.text.length-c.rangeLength;this._offset=this._offset+l}}})}static{a(this,"ChangeTracker")}get offset(){return this._offset}push(e,r){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout(()=>{e(),this._referenceCount--,this._referenceCount===0&&(this._tracker.dispose(),this._isDisposed=!0)},r)}};p();var fI=class{static{a(this,"CitationManager")}},tht=class extends fI{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var MAr=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??jn.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}static{a(this,"CompletionState")}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{let v=nht.indexOf(E);v!==-1&&nht.splice(v,1)}}a(t,"subscribe");function e(){for(let E of nht)E()}a(e,"afterUpdateConnection");function r(E){TD.connection!==E&&(TD.connection=E,e())}a(r,"updateConnection");function n(){return TD.connection==="connected"}a(n,"isConnected");function o(){return TD.connection==="disconnected"}a(o,"isDisconnected");function s(){return TD.connection==="retry"}a(s,"isRetrying");function c(){return TD.connection==="disabled"}a(c,"isDisabled");function l(){r("connected"),h(!1)}a(l,"setConnected");function u(){r("disconnected")}a(u,"setDisconnected");function d(){r("retry")}a(d,"setRetrying");function f(){r("disabled")}a(f,"setDisabled");function h(E){TD.initialWait!==E&&(TD.initialWait=E)}a(h,"setInitialWait");function m(E,v=hsa){s()||(d(),h(!0),A(E,v))}a(m,"enableRetry");function g(){return TD.initialWait}a(g,"isInitialWait");async function A(E,v){rS.info(E,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let S=E.get(Jt);function T(w,R){if(w>pli){rS.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{TD.retryAttempts=Math.min(TD.retryAttempts+1,hli);try{rS.info(R,`Pinging service after ${w} second(s)`);let k=await S.fetch(new URL("_ping",i3(R)["origin-tracker"]).href,{method:"GET",headers:{"content-type":"application/json"}});if(k.status!==200||!k.ok)T(w**2,R);else{rS.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),rS.info(E,"Attempting to reconnect."),T(OAr,E)}a(A,"attemptToPing");let y=a(E=>new Promise(v=>setTimeout(v,E)),"timeout");function _(E){return{dispose:t(E)}}return a(_,"listen"),rht={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:_,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},rht}a(msa,"registerConnectionState");var nte=msa();p();var Z0={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},mOe={[Z0.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[Z0.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[Z0.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function LAr(t){return t===401?Z0.Unauthorized:t===400?Z0.BadArguments:t===404?Z0.NotFound:t===429?Z0.RateLimit:t>=500&&t<600?Z0.InternalError:t>=600?Z0.ConnectionError:Z0.Unknown}a(LAr,"getErrorType");function Y4(t,e,r={}){return{kind:"failure",reason:LAr(Number(t)),code:Number(t),msg:e,meta:r}}a(Y4,"createErrorResponse");p();var gsa=/^[1-6][0-9][0-9]$/,Asa=/([A-Z][a-z]+)/,ysa="code_referencing",gOe=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[ysa,this.baseKey,...e].join(".")}},BAr=class extends gOe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({context:e}){let r=this.buildKey("open","count"),n=Vt.createAndMarkAsIssued();ft(e,r,n)}handleFocus({context:e}){let r=Vt.createAndMarkAsIssued(),n=this.buildKey("focus","count");ft(e,n,r)}handleWrite({context:e}){let r=Vt.createAndMarkAsIssued(),n=this.buildKey("write","count");ft(e,n,r)}},xtp=new BAr,FAr=class extends gOe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({context:e,actor:r}){let n=Vt.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");ft(e,o,n)}handleDismiss({context:e,actor:r}){let n=Vt.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");ft(e,o,n)}},wtp=new FAr,UAr=class extends gOe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=Vt.createAndMarkAsIssued({origin:r,reason:n});l0(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=Vt.createAndMarkAsIssued({origin:r,reason:n});l0(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match(gsa)){rS.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(Asa).filter(l=>!!l).join("_").toLowerCase(),c=Vt.createAndMarkAsIssued({message:o});l0(e,this.buildKey(s,r),c)}},iht=new UAr;var _sa="twirp/github.snippy.v1.SnippyAPI";async function QAr(t,e,r,n){let o;try{o=await t.get(Qt).getToken()}catch{return nte.setDisconnected(),Y4(401,mOe[Z0.Unauthorized])}if(rS.info(t,`Calling ${e}`),nte.isRetrying())return Y4(600,"Attempting to reconnect to the public code matching service.");if(nte.isDisconnected())return Y4(601,"The public code matching service is offline.");let s;try{s=await t.get(Jt).fetch(Px(t,o,"origin-tracker",`${_sa}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...s_(t)},signal:n})}catch{return nte.enableRetry(t),Y4(602,"Network error detected. Check your internet connection.")}!s.ok&&(s.status===401||s.status===403)&&t.get(Qt).resetToken("snippy",s.status);let c;try{c=await s.json()}catch(A){let y=A.message;throw iht.handleUnexpectedError({context:t,origin:"snippyNetwork",reason:y}),A}if(s.ok)return{kind:"success",...c};let l={...c,code:Number(s.status)},{code:u,msg:d,meta:f}=l,h=Number(u),m=LAr(h),g=d||"unknown error";switch(m){case Z0.Unauthorized:return Y4(u,mOe[Z0.Unauthorized],f);case Z0.BadArguments:return Y4(u,g,f);case Z0.RateLimit:return nte.enableRetry(t,60*1e3),Y4(u,mOe.RateLimitError,f);case Z0.InternalError:return nte.enableRetry(t),Y4(u,mOe[Z0.InternalError],f);default:return Y4(u,g,f)}}a(QAr,"call");p();var oht=b.Object({kind:b.Literal("failure"),reason:b.String(),code:b.Number(),msg:b.String(),meta:b.Optional(b.Any())}),vsa=b.Object({matched_source:b.String(),occurrences:b.String(),capped:b.Boolean(),cursor:b.String(),github_url:b.String()}),mli=b.Object({source:b.String()}),Csa=b.Object({snippets:b.Array(vsa)}),gli=b.Union([Csa,oht]),Ali=b.Object({cursor:b.String()}),bsa=b.Object({commit_id:b.String(),license:b.String(),nwo:b.String(),path:b.String(),url:b.String()}),Ssa=b.Object({has_next_page:b.Boolean(),cursor:b.String()}),Tsa=b.Object({count:b.Record(b.String(),b.String())}),Isa=b.Object({file_matches:b.Array(bsa),page_info:Ssa,license_stats:Tsa}),yli=b.Union([Isa,oht]);async function _li(t,e,r){let n=await QAr(t,"Match",{method:"POST",body:pJ(mli,{source:e})},r);return pJ(gli,n)}a(_li,"Match");async function Eli(t,{cursor:e},r){let n=await QAr(t,"FilesForMatch",{method:"POST",body:pJ(Ali,{cursor:e})},r);return pJ(yli,n)}a(Eli,"FilesForMatch");p();var AOe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),sht=65;function Rsa(t){let e=0,r;AOe.lastIndex=0;do if(r=AOe.exec(t),r&&(e+=1),e>=sht)break;while(r);return e}a(Rsa,"lexemeLength");function ksa(t,e){let r=0,n;AOe.lastIndex=0;do if(n=AOe.exec(t),n&&(r+=1,r>=e))return AOe.lastIndex;while(n);return t.length}a(ksa,"offsetFirstLexemes");function vli(t,e){let r=t.split("").reverse().join(""),n=ksa(r,e);return r.length-n}a(vli,"offsetLastLexemes");function yOe(t){return Rsa(t)>=sht}a(yOe,"hasMinLexemeLength");function Dsa(t){return DO.Check(oht,t)}a(Dsa,"isError");async function Cli(t,e){let r=await e();if(Dsa(r)){iht.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(Cli,"snippyRequest");function bli(t){return"kind"in t&&t.kind==="failure"}a(bli,"isMatchError");async function Sli(t,e,r,n){let s=await t.get($r).getTextDocument({uri:e});if(!s){rS.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!yOe(c)||!yOe(c))return;let l=r;if(!yOe(r)){let g=c.slice(0,n),A=vli(g,sht);l=c.slice(A,n+r.length)}if(!yOe(l))return;let u=await Cli(t,()=>_li(t,l));if(!u||bli(u)||!u.snippets.length){rS.info(t,"No match found");return}rS.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await Cli(t,()=>Eli(t,{cursor:g.cursor}));if(!A||bli(A))return;let y=A.file_matches,_=A.license_stats;return{match:g,files:y,licenseStats:_}}),m=(await Promise.all(f)).filter(g=>g!==void 0);if(m.length)for(let g of m){let A=new Set(Object.keys(g.licenseStats?.count??{}));A.has("NOASSERTION")&&(A.delete("NOASSERTION"),A.add("unknown"));let y=Array.from(A).sort(),_=n,E=n+g.match.matched_source.length,v=s.positionAt(_),S=s.positionAt(E);await t.get(fI).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:_,offsetEnd:E,version:s.version,location:{start:v,end:S},matchingText:l,details:y.map(T=>({license:T,url:g.match.github_url}))})}}a(Sli,"fetchCitations");p();function qAr(t,e,r=(n,o)=>n===o?0:1){if(e.length===0||t.length===0)return{distance:e.length,startOffset:0,endOffset:0};let n=new Array(e.length+1).fill(0),o=new Array(e.length+1).fill(0),s=new Array(t.length+1).fill(0),c=new Array(t.length+1).fill(0),l=e[0];for(let d=0;d0?d-1:0;for(let d=1;d(l[l.Word=0]="Word",l[l.Space=1]="Space",l[l.Other=2]="Other"))(r||={});let n=0;for(let o of t){let s;new RegExp("(\\p{L}|\\p{Nd}|_)","u").test(o)?s=0:o===" "?s=1:s=2,s===n&&s!==2?e+=o:(e.length>0&&(yield e),e=o,n=s)}e.length>0&&(yield e)}a(Osa,"lexGeneratorWords");function Tli(t,e,r,n){let o=[],s=0;for(let c of r(t))n(c)&&(e.has(c)||e.set(c,e.size),o.push([e.get(c),s])),s+=c.length;return[o,e]}a(Tli,"lexicalAnalyzer");function Ili(t){return t!==" "}a(Ili,"notSingleSpace");function xli(t,e,r=Osa){let[n,o]=Tli(t,Nsa(),r,Ili),[s,c]=Tli(e,o,r,Ili);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=Msa(c),u=s.length,d=l[s[0][0]],f=l[s[u-1][0]];function h(y,_,E,v){if(v===0||v===u-1){let S=l[n[E][0]];return v==0&&S.endsWith(d)||v==u-1&&S.startsWith(f)?0:1}else return y===_?0:1}a(h,"compare");let m=qAr(n.map(y=>y[0]),s.map(y=>y[0]),h),g=n[m.startOffset][1],A=m.endOffset0&&t[A-1]===" "&&--A,{lexDistance:m.distance,startOffset:g,endOffset:A,haystackLexLength:n.length,needleLexLength:s.length}}a(xli,"lexEditDistance");p();function MG(t){return t.length===0?0:t.split(` -`).length}a(MG,"countLines");function wli(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(wli,"computeCompletionText");var OG=new pe("postInsertion"),Rli=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}],kli=50,Lsa=1500,Bsa=.5,Fsa=500,jAr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function Pli(t,e,r,n,o){let s=await t.get(si).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(s.status!=="valid")return OG.info(t,`Could not get document for ${e}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1},capturedCode:"",terminationOffset:0};let c=s.document,l=c.getText(),u=l.substring(0,n),d=c.positionAt(n),f=await Kge(t,r.properties.headerRequestId,rte(c,d),r),h=f.type==="prompt"?f.prompt:{prefix:u,suffix:"",isFimEnabled:!1};if(h.isFimEnabled&&o!==void 0){let m=l.substring(n,o);return h.suffix=l.substring(o),{prompt:h,capturedCode:m,terminationOffset:0}}else{let m=l.substring(n),g=s0r(u,n,c.detectedLanguageId),y=bsi(g,void 0)(m),_=Math.min(l.length,n+(y?y*2:Fsa)),E=l.substring(n,_);return{prompt:h,capturedCode:E,terminationOffset:y??-1}}}a(Pli,"captureCode");function aht(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{OG.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),esi(t,e,d)});let s=new tte(t,n,r-1),c=new tte(t,n,r),l=a(async u=>{OG.debug(t,`Original offset: ${r}, Tracked offset: ${s.offset}`);let{completionTelemetryData:d}=o[0],{prompt:f,capturedCode:h,terminationOffset:m}=await Pli(t,n,d,s.offset+1,c.offset),g={hypotheticalPromptJson:JSON.stringify({prefix:f.prefix,context:f.context}),hypotheticalPromptSuffixJson:JSON.stringify(f.suffix)},A=d.extendedBy({...g,capturedCodeJson:JSON.stringify(h)},{timeout:u.seconds,insertionOffset:r,trackedOffset:s.offset,terminationOffsetInCapturedCode:m});OG.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),ft(t,e+".capturedAfterRejected",A,1)},"checkInCode");Rli.filter(u=>u.captureRejection).map(u=>s.push(n0(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(aht,"postRejectionTasks");function _Oe(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});OG.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),Xoi(t,e,u);let d=r;r=wli(r,c);let f=r.trim(),h=new tte(t,o,n),m=new tte(t,o,n+r.length),g=a(async A=>{await jsa(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(jAr.triggerPostInsertionSynchroneously&&s1(t)){let A=g({seconds:0,captureCode:jAr.captureCode,captureRejection:jAr.captureRejection});t.get(Ud).register(A)}else Rli.map(A=>h.push(n0(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));n0(t,Usa,"post insertion citation check")(t,o,d,r,n,l)}a(_Oe,"postInsertionTasks");async function Usa(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(Dx(t)?.getTokenValue("sn")==="1")return;await Sli(t,e,n,o);return}let c=await t.get($r).getTextDocument({uri:e});if(c){let l=HAr(c.getText(),n,kli,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=Qsa(r.length,n.length,l.start_offset);if(u===void 0){OG.info(t,`Full completion for ${e} contains a reference matching public code, but the partially inserted text did not include the match.`);continue}let d=o+u,f=c?.positionAt(d),h=o+qsa(r.length,n.length,l.stop_offset),m=c?.positionAt(h),g=f&&m?c?.getText({start:f,end:m}):"";await t.get(fI).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:d,offsetEnd:h,version:c?.version,location:f&&m?{start:f,end:m}:void 0,matchingText:g,details:l.details.citations})}}a(Usa,"citationCheck");function Qsa(t,e,r){if(!(ee))return r}a(Qsa,"computeCitationStart");function qsa(t,e,r){return e{if(r.displayText&&r.telemetry){let n,o;t.partiallyAcceptedLength?(n=r.displayText.substring(t.partiallyAcceptedLength-1),o=r.telemetry.extendedBy({compType:"partial"},{compCharLen:n.length})):(n=r.displayText,o=r.telemetry);let s={completionText:n,completionTelemetryData:o,offset:r.offset};e.push(s)}}),e}a($sa,"computeRejectedCompletions");function GAr(t,e){let r=t.get(_y);if(!r.position||!r.uri)return;let n=$sa(r);n.length>0&&aht(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(GAr,"rejectLastShown");function Dli(t,e,r,n){let o=t.get(_y);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&GAr(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(Dli,"setLastShown");function Nli(t,e){let r=t.get(_y);if(r.index=e.index,!r.shownCompletions.find(n=>n.index===e.index)&&(e.uri===r.uri&&r.position?.line===e.position.line&&r.position?.character==e.position.character&&r.shownCompletions.push(e),e.displayText)){let n=e.resultType!==0;Gsa.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,cft(t,"ghostText",e)}}a(Nli,"handleGhostTextShown");function Vsa(t,e,r){let n=t.get(_y);n.linesLeft===void 0&&(n.linesAccepted=MG(e.insertText.substring(0,r)),n.linesLeft=MG(e.displayText));let o=MG(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(Vsa,"handleLineAcceptance");function Zge(t,e,r="ghostText"){let n=t.get(_y),o;return n.partiallyAcceptedLength?o={compType:"full",acceptedLength:(n.partiallyAcceptedLength||0)+e.displayText.length,acceptedLines:n.linesAccepted+(n.linesLeft??0)}:o={compType:"full",acceptedLength:e.displayText.length,acceptedLines:MG(e.displayText)},n.resetState(),_Oe(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Zge,"handleGhostTextPostInsert");function cht(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(_y),l;return s==="cumulative"?(Wsa(t,e,r),l={compType:c.totalLength!=null?"full":"partial",acceptedLength:c.totalLength??(c.partiallyAcceptedLength||0),acceptedLines:c.linesAccepted},l.compType==="full"&&c.resetState()):(Vsa(t,e,r),l={compType:"partial",acceptedLength:c.partiallyAcceptedLength||0,acceptedLines:c.linesAccepted}),_Oe(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a(cht,"handlePartialGhostTextPostInsert");function Wsa(t,e,r){let n=t.get(_y);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=MG(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(Wsa,"handleCumulativeAcceptance");p();var K4=new Map;K4.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});K4.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});K4.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});K4.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});K4.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});K4.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var zsa=new pe("sdk");function lht(t,e){K4.has(t.get(Ir).getEditorPluginInfo().name)||zsa.warn(t,...e)}a(lht,"deprecationWarning");var Ano=fe(WP()),ZI=fe(s2());p();p();p();p();var uht={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function Xge(t,e){let r=Vt.createAndMarkAsIssued({authType:e});ft(t,uht.NewGitHubLogin,r),sr(t,uht.NewGitHubLogin,{authType:e})}a(Xge,"telemetryNewGitHubLogin");function ID(t,e,r,n,o){Hs(t,uht.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a(ID,"telemetryGitHubLoginResult");function EOe(t,e,r){Hs(t,uht.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(EOe,"telemetryCodeFlowError");var Mli=["repo","workflow"],$Ar=class extends Ei{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function Ysa(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...s_(t)},json:{client_id:e,scope:Mli.join(" ")},timeout:3e4},o,s=new URL("login/device/code",r).href;try{o=await t.get(Jt).fetch(s,n)}catch(c){throw c instanceof Error&&wx(c)?new Ei(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new Ei(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(Ysa,"requestDeviceFlowStage1");async function Ksa(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...s_(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s=await t.get(Jt).fetch(new URL("login/oauth/access_token",n).href,o),c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new $Ar(c):new Ei(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(Ksa,"requestDeviceFlowStage2");async function Jsa(t,e){let n=await(await Gd(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new Ei(`Error retrieving user information: ${String(n.errors)}`);return n}a(Jsa,"requestUserInfo");var pI=class{constructor(e){this.ctx=e;this.pendingSignIn=void 0}static{a(this,"GitHubDeviceFlow")}get authManager(){return this.ctx.get(Fr)}async save(e){let r=new URL(e.serverUrl).hostname;return await this.authManager.signInEditor({accessToken:e.accessToken,user:e.login,githubAppId:e.githubAppId,authAuthority:r,scopes:e.scopes})}async initiate(e,r){let n=e?.githubAppId??this.ctx.get(ih).findAppIdToAuthenticate();r??=this.authManager.getConfiguredUrls();let o=performance.now(),s=a(()=>performance.now()-o,"getElapsedTimeMs");try{let c=await this.getTokenUnguarded(n,r),l=c.waitForAuth.then(async u=>{this.ctx.get(ih).githubAppId=n;let d=await this.save(u);return ID(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{ID(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw ID(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(jC).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;Xge(n,"deviceFlow");let o=await Ysa(n,e,r),s=(async()=>{let c=o.expires_in,l=o.interval,u;do{await new Promise(f=>setTimeout(f,1e3*l)),u=await Ksa(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await Jsa(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):Mli;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new Ei(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var VAr=fe(ii());p();var LR=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var dht="github.copilot.finishDeviceFlow",WAr=class extends LR{constructor(){super(...arguments);this.name=dht;this.arguments=b.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get(pI),s=o.pendingSignIn;if(!s)throw new VAr.ResponseError(Ze.InvalidRequest,"No pending sign in");try{await this.ctx.get(og).open(s.verificationUri)}catch(c){DC.warn(this.ctx,"Failed to open",s.verificationUri),DC.exception(this.ctx,c,dht)}try{return await s.status}catch(c){throw new VAr.ResponseError(Ze.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},Oli=[WAr];p();p();var Fu=class extends Sn{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var vOe="github.copilot.didAcceptCompletionItem",zAr=class extends LR{constructor(){super(...arguments);this.name=vOe;this.arguments=b.Tuple([b.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(Fu).get(n);return s?(Zge(this.ctx,s),!0):!1}},Lli=[zAr];p();p();p();var zTt=fe(WTt()),YWi=fe($V());function H4c(t){switch(t){case zTt.TokenizerName.cl100k:return"cl100k_base";case zTt.TokenizerName.o200k:return"o200k_base";case zTt.TokenizerName.mock:return"mock"}}a(H4c,"toClsTokenizerName");var KWi={getTokenizer:a(t=>Ms(H4c(t)),"getTokenizer"),ensureLoaded:a(()=>qmn(),"ensureLoaded")},G4c=new JQ,$4c={encode:a(t=>G4c.tokenize(t),"encode")},YTt=class extends YWi.TokenizerProvider{constructor(){super(!1,void 0);this.rewired=new WeakSet}static{a(this,"ApproximateNesTokenizerProvider")}acquireTokenizer(r){let n=super.acquireTokenizer(r);return this.useApproximateEncoder(n),n}useApproximateEncoder(r){if(this.rewired.has(r))return;this.rewired.add(r);let n=r;n.doInitTokenizer=()=>Promise.resolve($4c)}};p();p();p();p();function JWi(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` +`],maxTokens:ali*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...lli(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a(tsa,"getGhostTextStrategy");function lli(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&MO.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(tr).longLookaheadSize(u):t.get(tr).shortLookaheadSize(u);return{finishedCb:new aft(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};tht(t,g,m)}).getFinishedCallback(),maxTokens:t.get(tr).maxMultilineTokens(u)}}return{finishedCb:c?jMe(t,r,n):d=>{}}}a(lli,"buildFinishedCallback");var rsa={isCycling:!1,promptOnly:!1,isSpeculative:!1};function nsa(t,e,r){let n=kt(t,ze.CompletionsDebounce)??t.get(tr).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=Rl()-r.issuedTime;return Math.max(0,n-o)}a(nsa,"getRemainingDebounceMs");function hOe(t,e,r){return r?.isCancellationRequested||e!==t.get(Xb).currentRequestId}a(hOe,"inlineCompletionRequestCancelled");async function isa(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(_){let E=Rl();l.push([_,E-c]),c=E}a(u,"recordPerformance"),u("telemetry");let d=t.get(tr);if(hOe(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:xp(n,t)};let f=ssa(e.textDocument,e.position);if(f===void 0)return vl.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:xp(n,t)};let h=XQ(t,n),m={...rsa,...s,tokenizer:h.tokenizer},g=await Kge(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return vl.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:xp(n,t)};if(g.type==="contextTooShort")return vl.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:xp(n,t)};if(g.type==="promptError")return vl.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:xp(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return vl.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:xp(n,t)};if(g.type==="promptTimeout")return vl.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:xp(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return vl.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:xp(n,t)};let A=nsa(t,m,n);return A>0&&(vl.debug(t,`Debouncing ghost text request for ${A}ms`),await JC(A),hOe(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:xp(n,t)}:t.get(ks).trackCompletionJob(async()=>{let[_]=MG(e.textDocument.getText(wu.range(wu.position(0,0),e.position))),E=t.get(Xb).hasAcceptedCurrentCompletion(_,g.prompt.suffix),v=g.prompt,S=await tsa(t,e,_,g,m.isCycling,f,E,n);u("strategy");let T=osa(t,_,v,S.requestMultiline);u("cache");let w=eq(t,e.textDocument.uri),R={blockMode:S.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:w,engineModelId:h.modelId,ourRequestId:r,prefix:_,prompt:g.prompt,multiline:S.requestMultiline,indentation:Eft(e.textDocument,e.position),isCycling:m.isCycling,headers:h.headers,stop:S.stop,maxTokens:S.maxTokens,afterAccept:E};R.headers={...R.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":m.isSpeculative?"true":"false"};let x=msa(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(Zb).shouldWaitForAsyncCompletions(_,g.prompt)){let U=await t.get(Zb).getFirstMatchingRequestWithTimeout(r,_,g.prompt,m.isSpeculative,x);if(u("asyncWait"),U){let j=!S.requestMultiline;T=[[NAr(U[0],{forceSingleLine:j})],4]}if(hOe(t,r,o))return vl.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:xp(x,t)}}let k=S.blockMode==="moremultiline"&&MO.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(U=>pOe(t,e.textDocument,e.position,U,k,vl)).filter(U=>U!==void 0)),T!==void 0&&T[0].length===0)return vl.debug(t,`Found empty inline suggestions locally via ${bge(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:xp(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))vl.debug(t,`Found inline suggestions locally via ${bge(T[1])}`);else{if(m.isCycling){let U=await esa(t,R,x,o,S.finishedCb);if(U.type==="success"){let j=T?.[0]??[];U.value[0].forEach(Q=>{j.findIndex(Y=>Y.completionText.trim()===Q.completionText.trim())===-1&&j.push(Q)}),T=[j,3]}else if(T===void 0)return U}else{let U=a((W,V)=>(t.get(Zb).updateCompletion(r,W),S.finishedCb(W,V)),"finishedCb"),j=new jn.CancellationTokenSource,Q=Xoa(t,R,x,j.token,U);t.get(Zb).queueCompletionRequest(r,_,g.prompt,j,Q);let Y=await t.get(Zb).getFirstMatchingRequest(r,_,g.prompt,m.isSpeculative);if(Y===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:xp(x,t)};T=[[Y[0]],4]}u("network")}if(T===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:xp(x,t)};let[D,N]=T,O=D.map(U=>pOe(t,e.textDocument,e.position,U,k,vl)).filter(U=>U!==void 0),B=kt(t,ze.CompletionsDelay)??d.completionsDelay(n),q=Rl()-n.issuedTime,M=Math.max(B-q,0);if(N!==2&&!m.isCycling&&M>0&&(vl.debug(t,`Waiting ${M}ms before returning completion`),await JC(M),hOe(t,r,o)))return vl.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:IG(x)};let L=[];for(let U of O){let j=hsa(t,e.textDocument,R,U,x),Q=f?sli(e.textDocument,e.position,U):0,W={completion:dsa(U.choiceIndex,U.completionText,g.trailingWs),telemetry:j,isMiddleOfTheLine:f,suffixCoverage:Q,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};L.push(W)}return x.properties.clientCompletionId=L[0]?.clientCompletionId,x.measurements.foundOffset=L?.[0]?.telemetry?.measurements?.foundOffset??-1,vl.debug(t,`Produced ${L.length} results from ${bge(N)} at ${x.measurements.foundOffset} offset`),hOe(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:IG(x)}:(m.isSpeculative||t.get(Xb).setGhostText(_,g.prompt.suffix,O,N),u("complete"),{type:"success",value:[L,N],telemetryData:xp(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(isa,"getGhostTextWithoutAbortHandling");async function MAr(t,e,r,n){let o=Dt();t.get(Xb).currentRequestId=o;let s=await psa(t,e.textDocument,o,n);await ZQ().catch(()=>{});try{return t.get(eS).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(M4).notifyRequest(e,o,s,r,n),await isa(t,e,o,s,r,n)}catch(c){if(ig(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:IG(s,{cancelledNetworkRequest:!0})};throw c}}a(MAr,"getGhostText");function osa(t,e,r,n){let o=t.get(Xb).getCompletionsForUserTyping(e,r.suffix),s=fsa(t,e,r.suffix,n);if(o&&o.length>0){let c=(s??[]).filter(l=>!o.some(u=>u.completionText===l.completionText));return[o.concat(c),2]}if(s&&s.length>0)return[s,1]}a(osa,"getLocalInlineSuggestion");function ssa(t,e){let r=asa(e,t),n=csa(e,t);return r&&!n?void 0:r&&n}a(ssa,"isInlineSuggestion");function asa(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(asa,"isMiddleOfTheLine");function csa(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(csa,"isValidMiddleOfTheLinePosition");function lsa(t,e){return e.lineAt(t).text.trim().length===0}a(lsa,"isNewLine");var l6=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function usa(t,e,r,n,o,s,c){if(t.get(l6).requestMultilineOverride)return{requestMultiline:!0};if(r.lineCount>=8e3)ft(t,"ghostText.longFileMultilineSkip",Vt.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e=="moremultiline"&&MO.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await Lgn(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&lsa(n,r))return{requestMultiline:!0};let u=!1;return!o&&tT(r.detectedLanguageId)?u=await _ft(r,n):o&&tT(r.detectedLanguageId)&&(u=await _ft(r,n)||await _ft(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=esi(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(usa,"shouldRequestMultiline");function tht(t,e,r){t.get(AD).append(e.prefix,e.prompt.suffix,r)}a(tht,"appendToCache");function dsa(t,e,r){if(r.length>0){if(e.startsWith(r))return{completionIndex:t,completionText:e,displayText:e.substring(r.length),displayNeedsWsOffset:!1};{let n=e.substring(0,e.length-e.trimStart().length);return r.startsWith(n)?{completionIndex:t,completionText:e,displayText:e.trimStart(),displayNeedsWsOffset:!0}:{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}}else return{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}a(dsa,"adjustLeadingWhitespace");function fsa(t,e,r,n){let o=t.get(AD).findAll(e,r);return o.length===0?(vl.debug(t,"Found no completions in cache"),[]):(vl.debug(t,`Found ${o.length} completions in cache`),o.map(s=>NAr(s,{forceSingleLine:!n})))}a(fsa,"getCompletionsFromCache");async function psa(t,e,r,n){let o={headerRequestId:r};n?.opportunityId&&(o.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(o.completionsActive="true"),n?.isSpeculative&&(o.reason="speculative");let s=Vt.createAndMarkAsIssued(o);return await t.get(tr).fetchTokenAndUpdateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},s)}a(psa,"createTelemetryWithExp");function hsa(t,e,r,n,o){let s=n.requestId,c={choiceIndex:n.choiceIndex.toString(),clientCompletionId:n.clientCompletionId};n.generatedChoiceIndex!==void 0&&(c.originalChoiceIndex=c.choiceIndex,c.choiceIndex=(1e4*(n.generatedChoiceIndex+1)+n.choiceIndex).toString());let l={compCharLen:n.completionText.length,numLines:n.completionText.trim().split(` +`).length};n.meanLogProb&&(l.meanLogProb=n.meanLogProb),n.meanAlternativeLogProb&&(l.meanAlternativeLogProb=n.meanAlternativeLogProb);let u=n.telemetryData.extendedBy(c,l);return u.issuedTime=o.issuedTime,u.measurements.timeToProduceMs=performance.now()-o.issuedTime,fli(u,e),u.extendWithRequestId(s),u.measurements.confidence=ili(t,u),u.measurements.quantile=oli(t,u),vl.debug(t,`Extended telemetry for ${n.telemetryData.properties.headerRequestId} with retention confidence ${u.measurements.confidence} (expected as good or better than about ${u.measurements.quantile} of all suggestions)`),u}a(hsa,"telemetryWithAddData");function msa(t,e,r,n,o,s,c,l){let u={languageId:e.detectedLanguageId};u.afterAccept=r.afterAccept.toString(),u.isSpeculative=l.isSpeculative.toString();let d=s.extendedBy(u);fli(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===0?"pending":"available",f!==void 0&&f!==0&&(d.properties.gitRepoUrl=f.url,d.properties.gitRepoHost=f.hostname,d.properties.gitRepoOwner=f.owner,d.properties.gitRepoName=f.repo,d.properties.gitRepoPath=f.pathname),d.properties.engineName=c.modelId,d.properties.engineChoiceSource=c.engineChoiceSource,d.properties.isMultiline=JSON.stringify(r.multiline),d.properties.isCycling=JSON.stringify(r.isCycling);let h=e.lineAt(n.line),m=e.getText(wu.range(h.range.start,n)),g=e.getText(wu.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(S=>(0,uli.SHA256)(S).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},_={...mae(o.prompt),promptEndPos:e.offsetAt(n),promptComputeTimeMs:o.computeTimeMs};o.metadata&&(y.promptMetadata=JSON.stringify(o.metadata)),o.contextProvidersTelemetry&&(y.contextProviders=JSON.stringify(o.contextProvidersTelemetry));let E=d.extendedBy(y,_);return ft(t,"ghostText.issued",E),d}a(msa,"telemetryIssued");function fli(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(fli,"addDocumentTelemetry");function pli(t,e,r,n,o){let s=Date.now()-n,c=s-o,l=r.telemetryData.extendedBy({},{completionCharLen:r.completionText.length,requestTimeMs:s,processingTimeMs:o,deltaMs:c,meanLogProb:r.meanLogProb||NaN,meanAlternativeLogProb:r.meanAlternativeLogProb||NaN});l.extendWithRequestId(r.requestId),ft(t,`ghostText.${e}`,l)}a(pli,"telemetryPerformance");p();p();var rte=class{constructor(e,r,n){this._referenceCount=0;this._isDisposed=!1;this._offset=n;let o=e.get($r);this._tracker=o.onDidChangeTextDocument(s=>{if(s.document.uri===r){for(let c of s.contentChanges)if(c.rangeOffset+c.rangeLength<=this.offset){let l=c.text.length-c.rangeLength;this._offset=this._offset+l}}})}static{a(this,"ChangeTracker")}get offset(){return this._offset}push(e,r){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout(()=>{e(),this._referenceCount--,this._referenceCount===0&&(this._tracker.dispose(),this._isDisposed=!0)},r)}};p();var fI=class{static{a(this,"CitationManager")}},rht=class extends fI{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var OAr=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??jn.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}static{a(this,"CompletionState")}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{let v=iht.indexOf(E);v!==-1&&iht.splice(v,1)}}a(t,"subscribe");function e(){for(let E of iht)E()}a(e,"afterUpdateConnection");function r(E){TD.connection!==E&&(TD.connection=E,e())}a(r,"updateConnection");function n(){return TD.connection==="connected"}a(n,"isConnected");function o(){return TD.connection==="disconnected"}a(o,"isDisconnected");function s(){return TD.connection==="retry"}a(s,"isRetrying");function c(){return TD.connection==="disabled"}a(c,"isDisabled");function l(){r("connected"),h(!1)}a(l,"setConnected");function u(){r("disconnected")}a(u,"setDisconnected");function d(){r("retry")}a(d,"setRetrying");function f(){r("disabled")}a(f,"setDisabled");function h(E){TD.initialWait!==E&&(TD.initialWait=E)}a(h,"setInitialWait");function m(E,v=gsa){s()||(d(),h(!0),A(E,v))}a(m,"enableRetry");function g(){return TD.initialWait}a(g,"isInitialWait");async function A(E,v){rS.info(E,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let S=E.get(Jt);function T(w,R){if(w>mli){rS.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{TD.retryAttempts=Math.min(TD.retryAttempts+1,gli);try{rS.info(R,`Pinging service after ${w} second(s)`);let k=await S.fetch(new URL("_ping",i3(R)["origin-tracker"]).href,{method:"GET",headers:{"content-type":"application/json"}});if(k.status!==200||!k.ok)T(w**2,R);else{rS.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),rS.info(E,"Attempting to reconnect."),T(LAr,E)}a(A,"attemptToPing");let y=a(E=>new Promise(v=>setTimeout(v,E)),"timeout");function _(E){return{dispose:t(E)}}return a(_,"listen"),nht={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:_,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},nht}a(Asa,"registerConnectionState");var ite=Asa();p();var Z0={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},mOe={[Z0.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[Z0.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[Z0.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function BAr(t){return t===401?Z0.Unauthorized:t===400?Z0.BadArguments:t===404?Z0.NotFound:t===429?Z0.RateLimit:t>=500&&t<600?Z0.InternalError:t>=600?Z0.ConnectionError:Z0.Unknown}a(BAr,"getErrorType");function Y4(t,e,r={}){return{kind:"failure",reason:BAr(Number(t)),code:Number(t),msg:e,meta:r}}a(Y4,"createErrorResponse");p();var ysa=/^[1-6][0-9][0-9]$/,_sa=/([A-Z][a-z]+)/,Esa="code_referencing",gOe=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[Esa,this.baseKey,...e].join(".")}},FAr=class extends gOe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({context:e}){let r=this.buildKey("open","count"),n=Vt.createAndMarkAsIssued();ft(e,r,n)}handleFocus({context:e}){let r=Vt.createAndMarkAsIssued(),n=this.buildKey("focus","count");ft(e,n,r)}handleWrite({context:e}){let r=Vt.createAndMarkAsIssued(),n=this.buildKey("write","count");ft(e,n,r)}},Ptp=new FAr,UAr=class extends gOe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({context:e,actor:r}){let n=Vt.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");ft(e,o,n)}handleDismiss({context:e,actor:r}){let n=Vt.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");ft(e,o,n)}},Dtp=new UAr,QAr=class extends gOe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=Vt.createAndMarkAsIssued({origin:r,reason:n});u0(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=Vt.createAndMarkAsIssued({origin:r,reason:n});u0(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match(ysa)){rS.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(_sa).filter(l=>!!l).join("_").toLowerCase(),c=Vt.createAndMarkAsIssued({message:o});u0(e,this.buildKey(s,r),c)}},oht=new QAr;var vsa="twirp/github.snippy.v1.SnippyAPI";async function qAr(t,e,r,n){let o;try{o=await t.get(Qt).getToken()}catch{return ite.setDisconnected(),Y4(401,mOe[Z0.Unauthorized])}if(rS.info(t,`Calling ${e}`),ite.isRetrying())return Y4(600,"Attempting to reconnect to the public code matching service.");if(ite.isDisconnected())return Y4(601,"The public code matching service is offline.");let s;try{s=await t.get(Jt).fetch(Px(t,o,"origin-tracker",`${vsa}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...s_(t)},signal:n})}catch{return ite.enableRetry(t),Y4(602,"Network error detected. Check your internet connection.")}!s.ok&&(s.status===401||s.status===403)&&t.get(Qt).resetToken("snippy",s.status);let c;try{c=await s.json()}catch(A){let y=A.message;throw oht.handleUnexpectedError({context:t,origin:"snippyNetwork",reason:y}),A}if(s.ok)return{kind:"success",...c};let l={...c,code:Number(s.status)},{code:u,msg:d,meta:f}=l,h=Number(u),m=BAr(h),g=d||"unknown error";switch(m){case Z0.Unauthorized:return Y4(u,mOe[Z0.Unauthorized],f);case Z0.BadArguments:return Y4(u,g,f);case Z0.RateLimit:return ite.enableRetry(t,60*1e3),Y4(u,mOe.RateLimitError,f);case Z0.InternalError:return ite.enableRetry(t),Y4(u,mOe[Z0.InternalError],f);default:return Y4(u,g,f)}}a(qAr,"call");p();var sht=b.Object({kind:b.Literal("failure"),reason:b.String(),code:b.Number(),msg:b.String(),meta:b.Optional(b.Any())}),bsa=b.Object({matched_source:b.String(),occurrences:b.String(),capped:b.Boolean(),cursor:b.String(),github_url:b.String()}),Ali=b.Object({source:b.String()}),Ssa=b.Object({snippets:b.Array(bsa)}),yli=b.Union([Ssa,sht]),_li=b.Object({cursor:b.String()}),Tsa=b.Object({commit_id:b.String(),license:b.String(),nwo:b.String(),path:b.String(),url:b.String()}),Isa=b.Object({has_next_page:b.Boolean(),cursor:b.String()}),xsa=b.Object({count:b.Record(b.String(),b.String())}),wsa=b.Object({file_matches:b.Array(Tsa),page_info:Isa,license_stats:xsa}),Eli=b.Union([wsa,sht]);async function vli(t,e,r){let n=await qAr(t,"Match",{method:"POST",body:hJ(Ali,{source:e})},r);return hJ(yli,n)}a(vli,"Match");async function Cli(t,{cursor:e},r){let n=await qAr(t,"FilesForMatch",{method:"POST",body:hJ(_li,{cursor:e})},r);return hJ(Eli,n)}a(Cli,"FilesForMatch");p();var AOe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),aht=65;function Psa(t){let e=0,r;AOe.lastIndex=0;do if(r=AOe.exec(t),r&&(e+=1),e>=aht)break;while(r);return e}a(Psa,"lexemeLength");function Dsa(t,e){let r=0,n;AOe.lastIndex=0;do if(n=AOe.exec(t),n&&(r+=1,r>=e))return AOe.lastIndex;while(n);return t.length}a(Dsa,"offsetFirstLexemes");function bli(t,e){let r=t.split("").reverse().join(""),n=Dsa(r,e);return r.length-n}a(bli,"offsetLastLexemes");function yOe(t){return Psa(t)>=aht}a(yOe,"hasMinLexemeLength");function Msa(t){return DO.Check(sht,t)}a(Msa,"isError");async function Sli(t,e){let r=await e();if(Msa(r)){oht.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(Sli,"snippyRequest");function Tli(t){return"kind"in t&&t.kind==="failure"}a(Tli,"isMatchError");async function Ili(t,e,r,n){let s=await t.get($r).getTextDocument({uri:e});if(!s){rS.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!yOe(c)||!yOe(c))return;let l=r;if(!yOe(r)){let g=c.slice(0,n),A=bli(g,aht);l=c.slice(A,n+r.length)}if(!yOe(l))return;let u=await Sli(t,()=>vli(t,l));if(!u||Tli(u)||!u.snippets.length){rS.info(t,"No match found");return}rS.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await Sli(t,()=>Cli(t,{cursor:g.cursor}));if(!A||Tli(A))return;let y=A.file_matches,_=A.license_stats;return{match:g,files:y,licenseStats:_}}),m=(await Promise.all(f)).filter(g=>g!==void 0);if(m.length)for(let g of m){let A=new Set(Object.keys(g.licenseStats?.count??{}));A.has("NOASSERTION")&&(A.delete("NOASSERTION"),A.add("unknown"));let y=Array.from(A).sort(),_=n,E=n+g.match.matched_source.length,v=s.positionAt(_),S=s.positionAt(E);await t.get(fI).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:_,offsetEnd:E,version:s.version,location:{start:v,end:S},matchingText:l,details:y.map(T=>({license:T,url:g.match.github_url}))})}}a(Ili,"fetchCitations");p();function jAr(t,e,r=(n,o)=>n===o?0:1){if(e.length===0||t.length===0)return{distance:e.length,startOffset:0,endOffset:0};let n=new Array(e.length+1).fill(0),o=new Array(e.length+1).fill(0),s=new Array(t.length+1).fill(0),c=new Array(t.length+1).fill(0),l=e[0];for(let d=0;d0?d-1:0;for(let d=1;d(l[l.Word=0]="Word",l[l.Space=1]="Space",l[l.Other=2]="Other"))(r||={});let n=0;for(let o of t){let s;new RegExp("(\\p{L}|\\p{Nd}|_)","u").test(o)?s=0:o===" "?s=1:s=2,s===n&&s!==2?e+=o:(e.length>0&&(yield e),e=o,n=s)}e.length>0&&(yield e)}a(Bsa,"lexGeneratorWords");function xli(t,e,r,n){let o=[],s=0;for(let c of r(t))n(c)&&(e.has(c)||e.set(c,e.size),o.push([e.get(c),s])),s+=c.length;return[o,e]}a(xli,"lexicalAnalyzer");function wli(t){return t!==" "}a(wli,"notSingleSpace");function Rli(t,e,r=Bsa){let[n,o]=xli(t,Osa(),r,wli),[s,c]=xli(e,o,r,wli);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=Lsa(c),u=s.length,d=l[s[0][0]],f=l[s[u-1][0]];function h(y,_,E,v){if(v===0||v===u-1){let S=l[n[E][0]];return v==0&&S.endsWith(d)||v==u-1&&S.startsWith(f)?0:1}else return y===_?0:1}a(h,"compare");let m=jAr(n.map(y=>y[0]),s.map(y=>y[0]),h),g=n[m.startOffset][1],A=m.endOffset0&&t[A-1]===" "&&--A,{lexDistance:m.distance,startOffset:g,endOffset:A,haystackLexLength:n.length,needleLexLength:s.length}}a(Rli,"lexEditDistance");p();function OG(t){return t.length===0?0:t.split(` +`).length}a(OG,"countLines");function kli(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(kli,"computeCompletionText");var LG=new pe("postInsertion"),Pli=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}],Dli=50,Fsa=1500,Usa=.5,Qsa=500,HAr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function Nli(t,e,r,n,o){let s=await t.get(si).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(s.status!=="valid")return LG.info(t,`Could not get document for ${e}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1},capturedCode:"",terminationOffset:0};let c=s.document,l=c.getText(),u=l.substring(0,n),d=c.positionAt(n),f=await Kge(t,r.properties.headerRequestId,nte(c,d),r),h=f.type==="prompt"?f.prompt:{prefix:u,suffix:"",isFimEnabled:!1};if(h.isFimEnabled&&o!==void 0){let m=l.substring(n,o);return h.suffix=l.substring(o),{prompt:h,capturedCode:m,terminationOffset:0}}else{let m=l.substring(n),g=a0r(u,n,c.detectedLanguageId),y=Tsi(g,void 0)(m),_=Math.min(l.length,n+(y?y*2:Qsa)),E=l.substring(n,_);return{prompt:h,capturedCode:E,terminationOffset:y??-1}}}a(Nli,"captureCode");function cht(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{LG.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),rsi(t,e,d)});let s=new rte(t,n,r-1),c=new rte(t,n,r),l=a(async u=>{LG.debug(t,`Original offset: ${r}, Tracked offset: ${s.offset}`);let{completionTelemetryData:d}=o[0],{prompt:f,capturedCode:h,terminationOffset:m}=await Nli(t,n,d,s.offset+1,c.offset),g={hypotheticalPromptJson:JSON.stringify({prefix:f.prefix,context:f.context}),hypotheticalPromptSuffixJson:JSON.stringify(f.suffix)},A=d.extendedBy({...g,capturedCodeJson:JSON.stringify(h)},{timeout:u.seconds,insertionOffset:r,trackedOffset:s.offset,terminationOffsetInCapturedCode:m});LG.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),ft(t,e+".capturedAfterRejected",A,1)},"checkInCode");Pli.filter(u=>u.captureRejection).map(u=>s.push(i0(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(cht,"postRejectionTasks");function _Oe(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});LG.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),tsi(t,e,u);let d=r;r=kli(r,c);let f=r.trim(),h=new rte(t,o,n),m=new rte(t,o,n+r.length),g=a(async A=>{await Gsa(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(HAr.triggerPostInsertionSynchroneously&&s1(t)){let A=g({seconds:0,captureCode:HAr.captureCode,captureRejection:HAr.captureRejection});t.get(Qd).register(A)}else Pli.map(A=>h.push(i0(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));i0(t,qsa,"post insertion citation check")(t,o,d,r,n,l)}a(_Oe,"postInsertionTasks");async function qsa(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(Dx(t)?.getTokenValue("sn")==="1")return;await Ili(t,e,n,o);return}let c=await t.get($r).getTextDocument({uri:e});if(c){let l=GAr(c.getText(),n,Dli,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=jsa(r.length,n.length,l.start_offset);if(u===void 0){LG.info(t,`Full completion for ${e} contains a reference matching public code, but the partially inserted text did not include the match.`);continue}let d=o+u,f=c?.positionAt(d),h=o+Hsa(r.length,n.length,l.stop_offset),m=c?.positionAt(h),g=f&&m?c?.getText({start:f,end:m}):"";await t.get(fI).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:d,offsetEnd:h,version:c?.version,location:f&&m?{start:f,end:m}:void 0,matchingText:g,details:l.details.citations})}}a(qsa,"citationCheck");function jsa(t,e,r){if(!(ee))return r}a(jsa,"computeCitationStart");function Hsa(t,e,r){return e{if(r.displayText&&r.telemetry){let n,o;t.partiallyAcceptedLength?(n=r.displayText.substring(t.partiallyAcceptedLength-1),o=r.telemetry.extendedBy({compType:"partial"},{compCharLen:n.length})):(n=r.displayText,o=r.telemetry);let s={completionText:n,completionTelemetryData:o,offset:r.offset};e.push(s)}}),e}a(Wsa,"computeRejectedCompletions");function $Ar(t,e){let r=t.get(_y);if(!r.position||!r.uri)return;let n=Wsa(r);n.length>0&&cht(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a($Ar,"rejectLastShown");function Mli(t,e,r,n){let o=t.get(_y);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&$Ar(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(Mli,"setLastShown");function Oli(t,e){let r=t.get(_y);if(r.index=e.index,!r.shownCompletions.find(n=>n.index===e.index)&&(e.uri===r.uri&&r.position?.line===e.position.line&&r.position?.character==e.position.character&&r.shownCompletions.push(e),e.displayText)){let n=e.resultType!==0;Vsa.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,lft(t,"ghostText",e)}}a(Oli,"handleGhostTextShown");function zsa(t,e,r){let n=t.get(_y);n.linesLeft===void 0&&(n.linesAccepted=OG(e.insertText.substring(0,r)),n.linesLeft=OG(e.displayText));let o=OG(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(zsa,"handleLineAcceptance");function Zge(t,e,r="ghostText"){let n=t.get(_y),o;return n.partiallyAcceptedLength?o={compType:"full",acceptedLength:(n.partiallyAcceptedLength||0)+e.displayText.length,acceptedLines:n.linesAccepted+(n.linesLeft??0)}:o={compType:"full",acceptedLength:e.displayText.length,acceptedLines:OG(e.displayText)},n.resetState(),_Oe(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Zge,"handleGhostTextPostInsert");function lht(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(_y),l;return s==="cumulative"?(Ysa(t,e,r),l={compType:c.totalLength!=null?"full":"partial",acceptedLength:c.totalLength??(c.partiallyAcceptedLength||0),acceptedLines:c.linesAccepted},l.compType==="full"&&c.resetState()):(zsa(t,e,r),l={compType:"partial",acceptedLength:c.partiallyAcceptedLength||0,acceptedLines:c.linesAccepted}),_Oe(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a(lht,"handlePartialGhostTextPostInsert");function Ysa(t,e,r){let n=t.get(_y);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=OG(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(Ysa,"handleCumulativeAcceptance");p();var K4=new Map;K4.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});K4.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});K4.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});K4.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});K4.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});K4.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var Ksa=new pe("sdk");function uht(t,e){K4.has(t.get(Ir).getEditorPluginInfo().name)||Ksa.warn(t,...e)}a(uht,"deprecationWarning");var _no=fe(WP()),ZI=fe(s2());p();p();p();p();var dht={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function Xge(t,e){let r=Vt.createAndMarkAsIssued({authType:e});ft(t,dht.NewGitHubLogin,r),sr(t,dht.NewGitHubLogin,{authType:e})}a(Xge,"telemetryNewGitHubLogin");function ID(t,e,r,n,o){Hs(t,dht.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a(ID,"telemetryGitHubLoginResult");function EOe(t,e,r){Hs(t,dht.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(EOe,"telemetryCodeFlowError");var Lli=["repo","workflow"],VAr=class extends Ei{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function Jsa(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...s_(t)},json:{client_id:e,scope:Lli.join(" ")},timeout:3e4},o,s=new URL("login/device/code",r).href;try{o=await t.get(Jt).fetch(s,n)}catch(c){throw c instanceof Error&&wx(c)?new Ei(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new Ei(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(Jsa,"requestDeviceFlowStage1");async function Zsa(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...s_(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s=await t.get(Jt).fetch(new URL("login/oauth/access_token",n).href,o),c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new VAr(c):new Ei(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(Zsa,"requestDeviceFlowStage2");async function Xsa(t,e){let n=await(await $d(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new Ei(`Error retrieving user information: ${String(n.errors)}`);return n}a(Xsa,"requestUserInfo");var pI=class{constructor(e){this.ctx=e;this.pendingSignIn=void 0}static{a(this,"GitHubDeviceFlow")}get authManager(){return this.ctx.get(Or)}async save(e){let r=new URL(e.serverUrl).hostname;return await this.authManager.signInEditor({accessToken:e.accessToken,user:e.login,githubAppId:e.githubAppId,authAuthority:r,scopes:e.scopes})}async initiate(e,r){let n=e?.githubAppId??this.ctx.get(ih).findAppIdToAuthenticate();r??=this.authManager.getConfiguredUrls();let o=performance.now(),s=a(()=>performance.now()-o,"getElapsedTimeMs");try{let c=await this.getTokenUnguarded(n,r),l=c.waitForAuth.then(async u=>{this.ctx.get(ih).githubAppId=n;let d=await this.save(u);return ID(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{ID(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw ID(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(jC).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;Xge(n,"deviceFlow");let o=await Jsa(n,e,r),s=(async()=>{let c=o.expires_in,l=o.interval,u;do{await new Promise(f=>setTimeout(f,1e3*l)),u=await Zsa(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await Xsa(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):Lli;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new Ei(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var WAr=fe(ii());p();var LR=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var fht="github.copilot.finishDeviceFlow",zAr=class extends LR{constructor(){super(...arguments);this.name=fht;this.arguments=b.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get(pI),s=o.pendingSignIn;if(!s)throw new WAr.ResponseError(Ze.InvalidRequest,"No pending sign in");try{await this.ctx.get(sg).open(s.verificationUri)}catch(c){DC.warn(this.ctx,"Failed to open",s.verificationUri),DC.exception(this.ctx,c,fht)}try{return await s.status}catch(c){throw new WAr.ResponseError(Ze.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},Bli=[zAr];p();p();var Fu=class extends Sn{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var vOe="github.copilot.didAcceptCompletionItem",YAr=class extends LR{constructor(){super(...arguments);this.name=vOe;this.arguments=b.Tuple([b.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(Fu).get(n);return s?(Zge(this.ctx,s),!0):!1}},Fli=[YAr];p();p();p();var YTt=fe(zTt()),JWi=fe(VV());function $4c(t){switch(t){case YTt.TokenizerName.cl100k:return"cl100k_base";case YTt.TokenizerName.o200k:return"o200k_base";case YTt.TokenizerName.mock:return"mock"}}a($4c,"toClsTokenizerName");var ZWi={getTokenizer:a(t=>Ms($4c(t)),"getTokenizer"),ensureLoaded:a(()=>jmn(),"ensureLoaded")},V4c=new JQ,W4c={encode:a(t=>V4c.tokenize(t),"encode")},KTt=class extends JWi.TokenizerProvider{constructor(){super(!1,void 0);this.rewired=new WeakSet}static{a(this,"ApproximateNesTokenizerProvider")}acquireTokenizer(r){let n=super.acquireTokenizer(r);return this.useApproximateEncoder(n),n}useApproximateEncoder(r){if(this.rewired.has(r))return;this.rewired.add(r);let n=r;n.doInitTokenizer=()=>Promise.resolve(W4c)}};p();p();p();p();function XWi(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` `).map(d=>{let f=d.replace(u,""),h=d.length-f.length;return l(h)+f}).join(` `)}a(n,"replace");let o;if(t.tabSize===void 0||typeof t.tabSize=="string"?o=4:o=t.tabSize,t.insertSpaces===!1){let s=a(c=>n(c," ",l=>" ".repeat(Math.floor(l/o))+" ".repeat(l%o)),"r");e.displayText=s(e.displayText),e.completionText=s(e.completionText)}else if(t.insertSpaces===!0){let s=a(c=>n(c," ",l=>" ".repeat(l*o)),"r");if(e.displayText=s(e.displayText),e.completionText=s(e.completionText),r){let c=a(l=>{if(l==="")return l;let u=l.split(` -`)[0],d=u.length-u.trimStart().length,f=d%o;if(f!==0&&d>0){let h=" ".repeat(f);return n(l,h,m=>" ".repeat((Math.floor(m/o)+1)*o))}else return l},"re");e.displayText=c(e.displayText),e.completionText=c(e.completionText)}}return e}a(JWi,"normalizeIndentCharacter");Fo();function ZWi(t,e,r,n,o,s,c){let l=n.lineAt(o),u=e.map(d=>{let f=wu.range(wu.position(o.line,0),wu.position(o.line,o.character+d.suffixCoverage)),h="";if(s&&(d.completion=JWi(s,d.completion,l.isEmptyOrWhitespace)),l.isEmptyOrWhitespace&&(d.completion.displayNeedsWsOffset||d.completion.completionText.startsWith(l.text)))h=d.completion.completionText;else{let g=wu.range(f.start,o);h=n.getText(g)+d.completion.displayText}return{uuid:Dt(),insertText:h,range:f,uri:n.uri,index:d.completion.completionIndex,telemetry:d.telemetry,displayText:d.completion.displayText,position:o,offset:n.offsetAt(o),resultType:r,copilotAnnotations:d.copilotAnnotations,clientCompletionId:d.clientCompletionId}});if(r===2&&c!==void 0){let d=u.find(f=>f.index===c);if(d){let f=u.filter(h=>h.index!==c);u=[d,...f]}}return u}a(ZWi,"completionsFromGhostTextResults");p();var XN=class{constructor(){this.cache=new Sn(100)}static{a(this,"SpeculativeRequestCache")}set(e,r){this.cache.set(e,r)}async request(e){let r=this.cache.get(e);r!==void 0&&(this.cache.delete(e),await r())}};var FEe=class extends Ay{constructor(r){super();this.ctx=r}static{a(this,"GhostTextInlineCompletionManager")}async getInlineCompletionsResult(r,n,o={}){let s=this.ctx,c=0;o.selectedCompletionInfo?.text&&!o.selectedCompletionInfo.text.includes(")")&&(r=r.addSelectedCompletionInfo(o.selectedCompletionInfo),c=r.position.character-o.selectedCompletionInfo.range.end.character);let l=await NAr(s,r,n,o);if(l.type!=="success")return l;let[u,d]=l.value;if(n?.isCancellationRequested)return{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:l.telemetryBlob}};let f=Dli(s,r.textDocument,r.position,d),h=ZWi(s,u,d,r.textDocument,r.position,o.formattingOptions,f);if(h.length===0)return{type:"empty",reason:"no completions in final result",telemetryData:l.telemetryData};if(d!==2){r=r.applyEdits([{newText:h[0].insertText,range:h[0].range}]);let g={isSpeculative:!0,opportunityId:o.opportunityId},A=a(()=>NAr(s,r,void 0,g),"fn");s.get(XN).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,_=jn.Range.create(A,jn.Position.create(y.line,y.character-c));return{...g,range:_}});return{...l,value:m}}async getPrompt(r,n,o,s={}){let c=await this.getInlineCompletionsResult(rte(r,n),o,{...s,promptOnly:!0});if(c.type!=="promptOnly")throw new Error(`Unexpected result type ${c.type}`);return c.prompt}async getCompletions(r,n,o,s={}){this.logCompletionLocation(r,n);let c=await this.getInlineCompletionsResult(rte(r,n),o,s);return tsi(this.ctx,c)}logCompletionLocation(r,n){let o=r.getText({start:{line:Math.max(n.line-1,0),character:0},end:n}),s=r.getText({start:n,end:{line:Math.min(n.line+2,r.lineCount-1),character:r.lineCount-1>n.line?0:n.character}});aft.debug(this.ctx,`Requesting for ${r.uri} at ${n.line}:${n.character}`,`between ${JSON.stringify(o)} and ${JSON.stringify(s)}.`)}triggerSpeculativeRequests(r){return this.ctx.get(XN).request(r.clientCompletionId)}};p();var UEe=fe(Uie()),XWi=fe(ON()),n8r=fe(bpt()),ZTt=fe(Jee()),ezi=fe(Os()),tzi=fe(bD()),HFe=fe(W_()),JTt=fe(iv()),i8r=fe(Td()),rzi=fe(dI()),nzi=fe(ii());p();var KTt=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new Ji;this._onDidChangeTextDocument=new Ji;this._onDidCloseTextDocument=new Ji;this._onDidSelectTextDocument=new Ji;this.onDidOpenTextDocument=this._onDidOpenTextDocument.event;this.onDidChangeTextDocument=this._onDidChangeTextDocument.event;this.onDidCloseTextDocument=this._onDidCloseTextDocument.event;this.onDidSelectTextDocument=this._onDidSelectTextDocument.event;this.bufferedEvents=[];this.forwardedAsOpen=new Set;this.started=!1;this.documentManager=this.ctx.get($r)}static{a(this,"DocumentChangeFilter")}start(){if(!this.started){this.started=!0;for(let e of this.documentManager.getTextDocumentsUnsafe())this.bufferedEvents.push({type:"addition",event:{document:{uri:e.uri,languageId:e.clientLanguageId,version:e.version,text:e.getText()}}});this.documentManager.onDidOpenTextDocument(e=>{this.bufferedEvents.push({type:"addition",event:e})}),this.documentManager.onDidChangeTextDocument(e=>{this.bufferedEvents.push({type:"change",event:e})}),this.documentManager.onDidCloseTextDocument(e=>{this.bufferedEvents.push({type:"removal",event:e})})}}addSelectionEvent(e){this.bufferedEvents.push({type:"selection",event:e})}async syncSafeDocuments(){let e=[...this.bufferedEvents];this.bufferedEvents.length=0;for(let r of e){let n=r.type==="selection"?r.event.uri:r.event.document.uri;if(r.type==="removal"){this.forwardedAsOpen.has(n)&&(this.forwardedAsOpen.delete(n),this._onDidCloseTextDocument.fire(r.event));continue}let o=await this.documentManager.getTextDocument({uri:n});if(o===void 0){this.forwardedAsOpen.has(n)&&(this.forwardedAsOpen.delete(n),this._onDidCloseTextDocument.fire({document:{uri:n}}));continue}r.type==="addition"?(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire(r.event)):r.type==="change"?this.forwardedAsOpen.has(n)?this._onDidChangeTextDocument.fire(r.event):(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire({document:{uri:o.clientUri,languageId:o.clientLanguageId,version:o.version,text:o.getText()}})):r.type==="selection"&&(this.forwardedAsOpen.has(n)||(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire({document:{uri:o.clientUri,languageId:o.clientLanguageId,version:o.version,text:o.getText()}})),this._onDidSelectTextDocument.fire(r.event))}}};var AW=class extends ZTt.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,tzi.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new KTt(r)),this._started=!1,o||this.start()}static{a(this,"ObservableLspWorkspace")}start(){if(this._started)return;this._started=!0;let r=this.ctx.get($r);if(this.documentChangeFilter)this.documentChangeFilter.start();else for(let o of r.getTextDocumentsUnsafe())this.addLspDocument(o.uri,o.clientLanguageId,o.getText());let n=this.documentChangeFilter??r;n.onDidOpenTextDocument(o=>{this.addLspDocument(o.document.uri,o.document.languageId,o.document.text)}),n.onDidCloseTextDocument(o=>{this.removeClosedLspDocument(o.document.uri)}),n.onDidChangeTextDocument(o=>{this.onDidChangeLspDocument(o.document.uri,o.contentChanges)}),this.documentChangeFilter?.onDidSelectTextDocument(o=>{let s=UEe.DocumentId.create(Gs(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=UEe.DocumentId.create(Gs(Gs(r)));return this.addDocument({id:s,initialValue:o,languageId:n8r.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=UEe.DocumentId.create(Gs(Gs(r))),s=this._documents.get(o);s&&s.applyLspContentChanges(n)}onUserPositionChange(r,n){if(this.documentChangeFilter)this.documentChangeFilter.addSelectionEvent({uri:r,position:n});else{let o=UEe.DocumentId.create(Gs(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=UEe.DocumentId.create(Gs(r));this._documents.get(n)?.dispose()}addDocument(r,n=void 0){let o=this._documents.get(r.id);if(o)return o;let s=new o8r(r.id,new rzi.StringText(r.initialValue??""),[],r.languageId??n8r.LanguageId.PlainText,()=>{this._documents.delete(r.id);let c=this._openDocuments.get(),l=c.filter(u=>u.id!==s.id);l.length!==c.length&&this._openDocuments.set(l,n,{added:[],removed:[s]})},r.workspaceRoot);return this._documents.set(r.id,s),this._openDocuments.set([...this._openDocuments.get(),s],n,{added:[s],removed:[]}),s}getDocument(r){return this._documents.get(r)}clear(){this._openDocuments.set([],void 0,{added:[],removed:this._openDocuments.get()});for(let r of this._documents.values())r.dispose();this._documents.clear()}getWorkspaceRoot(r){return this._documents.get(r)?.workspaceRoot}async syncSafeDocuments(){this.start(),await this.documentChangeFilter?.syncSafeDocuments()}},o8r=class extends ZTt.MutableObservableDocument{static{a(this,"MutableObservableLspDocument")}constructor(e,r,n,o,s,c){super(e,r,n,o,s,0,c)}applyLspContentChanges(e){let r=this.editFromLspContentChanges(e);this.applyEdit(r.compose(),void 0)}updateSelectionFromLspPosition(e){let r=this.value.get().getTransformer().getOffset(new JTt.Position(e.lineNumber+1,e.column+1));this.updateSelection([new i8r.OffsetRange(r,r)])}editFromLspContentChanges(e){return new XWi.Edits(HFe.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(nzi.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new JTt.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new JTt.Position(e.range.end.line+1,e.range.end.character+1));if(o>s){let c=this.value.get().value,l=c.split(/\r\n|\n/).length,u=c.split(/\r\n|\r|\n/).length,d=new ezi.BugIndicatingError(`Invalid range: [${o}, ${s}) from ${JSON.stringify(e.range)}. Line counts: nes=${l}, lsp=${u}`);throw lu?d.code="ObservableWorkspace_TooManyLines":d.code="ObservableWorkspace_InvalidRange",d.code+=r>0?"_SubsequentChange":"_FirstChange",d}return HFe.StringEdit.single(new HFe.StringReplacement(new i8r.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var izi=fe(WTt()),ozi=fe(Yyt()),s8r=fe(Jee()),QEe=fe(Fc()),f8r=fe(Po());var a8r=class extends f8r.Disposable{constructor(r){super();this.ctx=r;this.isMinimalMode=!0;this.permissiveGitHubSession=void 0;this.hasCopilotTokenSource=!0;this._tokenChangedEverFired=!1;this._onDidAuthenticationChange=this._register(new QEe.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new QEe.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidCopilotTokenChange=this._register(new QEe.Emitter);this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new QEe.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(ws(r,()=>{this.fireTokenChanged()}))}static{a(this,"AuthServiceAdapter")}fireTokenChanged(){this._tokenChangedEverFired=!0,this._onDidAccessTokenChange.fire(),this._onDidCopilotTokenChange.fire(),this._onDidAuthenticationChange.fire()}ensureTokenChangedFired(){this._tokenChangedEverFired||this.fireTokenChanged()}async getAnyGitHubSession(r){let n=await this.ctx.get(Fr).resolveSession();if(n!==void 0)return{id:n.login,accessToken:n.accessToken,account:{id:n.login,label:n.serverUrl},scopes:[]}}async getGitHubSession(r,n){if(r!=="permissive")return this.getAnyGitHubSession(n)}getPermissiveGitHubSession(r){return Promise.resolve(void 0)}get copilotToken(){let r=this.ctx.get(Qt).getLastToken();if(r!==void 0)return this.ensureTokenChangedFired(),XTt(r,this.ctx)}async getCopilotToken(r){let n=this.ctx.get(Qt);r&&n.resetToken("inline_completion_force_refresh");let o=await n.getToken();this.ensureTokenChangedFired();let s=await this.ctx.get(Fr).resolveSession();return XTt(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Qt).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function XTt(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new ozi.CopilotToken({token:t.envelope.token,expires_at:t.envelope.expires_at,refresh_in:n,organization_list:t.envelope.organization_list,code_quote_enabled:t.envelope.code_quote_enabled??!1,copilotignore_enabled:t.envelope.copilotignore_enabled??!1,endpoints:t.envelope.endpoints,limited_user_quotas:t.envelope.limited_user_quotas,enterprise_list:t.envelope.enterprise_list?t.envelope.enterprise_list.map(Number):void 0,sku:t.getTokenValue("sku")??"",individual:t.userInfo.isIndividualUser,blackbird_clientside_indexing:!1,code_review_enabled:t.isCopilotCodeReviewEnabled,codesearch:t.envelope.codesearch??!1,public_suggestions:"unconfigured",telemetry:e.get(op).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(XTt,"asChatLibCopilotToken");var c8r=class extends f8r.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new QEe.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(ws(r,()=>{this.models=void 0}))}static{a(this,"EndpointProviderAdapter")}async getAllModels(r=!1){if(this.models===void 0||r)try{let n=this.ctx.get(cw),o=await this.ctx.get(Qt).getToken();this.models=await n.fetchModels(o)??[],this._onDidModelsRefresh.fire()}catch(n){Ma(this.ctx,n,"AvailableModelsManager.fetchModels"),this.models=[]}return this.models}async getAllCompletionModels(r){return(await this.getAllModels(r)).filter(o=>o.capabilities.type==="completion")}getAllChatEndpoints(){throw new Error("getAllChatEndpoints is not supported.")}getChatEndpoint(r){throw new Error("getChatEndpoint is not supported.")}getEmbeddingsEndpoint(r){throw new Error("getEmbeddingsEndpoint is not supported.")}},l8r=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(pc).enabled}get isRegexExclusionsEnabled(){return!0}dispose(){}init(){return Promise.resolve()}async isCopilotIgnored(e,r){let n=e.toString();return(await this.ctx.get($r).getTextDocumentValidation({uri:n})).status==="invalid"}asMinimatchPattern(){return Promise.resolve(void 0)}},u8r=class{constructor(e){this.statusReporter=e}static{a(this,"StatusHandlerAdapter")}didChange(e){switch(this.statusReporter.didChangeV1(e),e.kind){case"Inactive":{this.statusReporter.forceNormalV2("cls",{message:e.message??"",inactive:!0});break}case"Error":{this.statusReporter.setErrorV2("cls",{message:e.message??""});break}case"Warning":{this.statusReporter.setWarningV2("cls",{message:e.message??""});break}case"Normal":{this.statusReporter.forceNormalV2("cls",{inactive:!1});break}}}},d8r=class extends Ay{constructor(r){super();this.ctx=r;this._telemetrySender=new GFe(this.ctx)}static{a(this,"ChatLibInlineCompletionManager")}get completionProvider(){return this._completionProvider||(this._completionProvider=this.createCompletionProvider()),this._completionProvider}createCompletionProvider(){let r=this.ctx,n=r.get(km).matchFunction,o=new VFe(this.ctx.get(Jt)),s=Lxe(r),c={fetcher:o,authService:new a8r(r),telemetrySender:this._telemetrySender,logTarget:new $Fe(r),isRunningInTest:s1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new u8r(r.get(ks)),documentManager:r.get($r),workspace:r.get(s8r.ObservableWorkspace),urlOpener:r.get(og),editorInfo:r.get(Ir).getEditorInfo(),editorPluginInfo:r.get(Ir).getEditorPluginInfo(),relatedPluginInfo:r.get(Ir).getRelatedPluginInfo(),editorSession:r.get(za),notificationSender:r.get(ss),ignoreService:new l8r(r),waitForTreatmentVariables:!1,endpointProvider:new c8r(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s,tokenizerProvider:KWi},l=(0,izi.createInlineCompletionsProvider)(c);return this.ctx.get(Qo).onDidChangeCopilotSettings(()=>{let u=Lxe(this.ctx);l.setConfigs(u).catch(d=>{Ma(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=this.completionProvider,l=this.ctx.get(s8r.ObservableWorkspace);l instanceof AW&&await l.syncSafeDocuments();let u=await this.ctx.get(tr).fetchTokenAndUpdateExPValuesAndAssignments();return this._telemetrySender.updateExpConfig(u.filtersAndExp.exp),c.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.asLocalResult(await c.getInlineCompletions(r,n,o,s),u)}asLocalResult(r,n){if(r!==void 0)return r.map(o=>({uuid:o.uuid,insertText:o.insertText,range:o.range,uri:o.uri,telemetry:new Tx({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new QB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new px(o.telemetry.filtersAndExp.exp.variables,n.filtersAndExp.exp.assignmentContext,o.telemetry.filtersAndExp.exp.features)}),displayText:o.displayText,position:o.position,offset:o.offset,index:o.index,resultType:o.resultType,copilotAnnotations:o.copilotAnnotations,clientCompletionId:o.clientCompletionId}))}triggerSpeculativeRequests(r){return this.completionProvider.inlineCompletionShown(r.clientCompletionId)}},eIt=class extends Ay{constructor(r){super();this.ctx=r}static{a(this,"ConfigurableInlineCompletionManager")}get ghostTextImpl(){return this._ghostTextImpl||(this._ghostTextImpl=new FEe(this.ctx)),this._ghostTextImpl}get chatLibImpl(){return this._chatLibImpl||(this._chatLibImpl=new d8r(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(tr).fetchTokenAndUpdateExPValuesAndAssignments();return kt(this.ctx,ze.UseChatLibCompletions)??this.ctx.get(tr).useChatLibCompletions(r)}async getCompletions(r,n,o,s={}){return await this.isChatLibEnabled()?this.chatLibImpl.getCompletions(r,n,o,s):this.ghostTextImpl.getCompletions(r,n,o,s)}async triggerSpeculativeRequests(r){return await this.isChatLibEnabled()?this.chatLibImpl.triggerSpeculativeRequests(r):this.ghostTextImpl.triggerSpeculativeRequests(r)}},GFe=class{constructor(e){this.ctx=e;this.ctx=e}static{a(this,"TelemetrySender")}updateExpConfig(e){this._expConfig=e}sendTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),gae(this.ctx,e,o.properties,o.measurements,0),sr(this.ctx,e,K9(o.properties,qMe),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),gae(this.ctx,e,o.properties,o.measurements,1)}asTelemetryData(e,r){let n=Object.fromEntries(Object.entries(e??{}).filter(([s,c])=>c!==void 0)),o=Object.fromEntries(Object.entries(r??{}).filter(([s,c])=>c!==void 0));return n["abexp.assignmentcontext"]===void 0&&this._expConfig?.assignmentContext!==void 0&&(n["abexp.assignmentcontext"]=this._expConfig.assignmentContext),n.completionsImplementation="chat-lib",Vt.createAndMarkAsIssued(n,o)}};p();var szi=fe(CV()),azi=fe(Fc()),WFe=fe(bPr()),czi=fe(BL());var V4c=16,t9=class extends szi.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new Sn(V4c);this._onDidChangeDiagnostics=new azi.Emitter;this.onDidChangeDiagnostics=this._onDidChangeDiagnostics.event}static{a(this,"LspLanguageDiagnosticsService")}getDiagnostics(r){return this._map.get(r.toString())?.diagnostics??[]}getAllDiagnostics(){return Array.from(this._map.values()).map(r=>[r.uri,r.diagnostics])}setForRequest(r,n){let o=n.map(W4c);this._map.set(r.toString(),{uri:r,diagnostics:o}),this._onDidChangeDiagnostics.fire({uris:[r]})}clear(r){this._map.delete(r.toString())&&this._onDidChangeDiagnostics.fire({uris:[r]})}clearAll(){let r=Array.from(this._map.values()).map(n=>n.uri);this._map.clear(),r.length>0&&this._onDidChangeDiagnostics.fire({uris:r})}};function W4c(t){let e=new czi.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?WFe.DiagnosticSeverity.Error:WFe.DiagnosticSeverity.Warning,n=new WFe.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(W4c,"toVscodeDiagnostic");p();var z4c="nes.reportInlineEditArc";function lzi(t,e){if(e.originalCharCount===void 0||e.originalCharCount===0)return;let r={opportunityId:e.opportunityId,languageId:e.languageId??""},n={arc:e.arc??0,originalCharCount:e.originalCharCount,originalLineCount:e.originalLineCount??0,originalDeletedLineCount:e.originalDeletedLineCount??0,currentLineCount:e.currentLineCount??0,currentDeletedLineCount:e.currentDeletedLineCount??0,didBranchChange:e.didBranchChange,timeDelayMs:e.timeDelayMs};sr(t,z4c,r,n)}a(lzi,"emitNESArcTelemetry");var r9=fe(WTt()),dzi=fe(Uie()),p8r=fe(Jee()),fzi=fe(Oy()),pzi=fe($1t()),hzi=fe(Fc()),h8r=require("node:stream");Fo();var uzi=10,Y4c=[0,30*1e3,120*1e3,300*1e3,600*1e3,900*1e3],zFe=new pe("nextEditSuggestions"),K4c={[r9.LogLevel.Off]:4,[r9.LogLevel.Trace]:4,[r9.LogLevel.Debug]:4,[r9.LogLevel.Info]:3,[r9.LogLevel.Warning]:2,[r9.LogLevel.Error]:1},$Fe=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(Jf).logIt(this.ctx,K4c[e],r,...n)}},J4c={},fC=class t{constructor(e){this.lastResultsById=new Sn(uzi);this.lastResultsByUri=new Sn(uzi);this.lastAppliedNesKeys=new Set;this.ctx=e,this.telemetrySender=new GFe(this.ctx)}static{a(this,"NextEditSuggestionsManager")}static{this.modelConfigurationStringKey="chat.advanced.inlineEdits.xtabProvider.modelConfigurationString"}static{this.defaultModelConfigurationStringKey="chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString"}static{this.stringValuedNesKeys=new Set([t.modelConfigurationStringKey,t.defaultModelConfigurationStringKey])}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(p8r.ObservableWorkspace);if(s instanceof AW&&await s.syncSafeDocuments(),!this.shouldUseExplicitRejection()){let A=this.lastResultsByUri.get(e);A&&(this.lastResultsByUri.delete(e),this.lastResultsById.delete(A.resultId),A.isShown&&o.handleRejection(A.nextEditResult))}let c=Gs(e),l=dzi.DocumentId.create(c),u=await this.ctx.get(tr).fetchTokenAndUpdateExPValuesAndAssignments();if(o.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.telemetrySender.updateExpConfig(u.filtersAndExp.exp),!s.getDocument(l))return;let d=await o.getNextEdit(l.toUri(),n);if(d.result==null)return;let f=await X4c({textDocumentManager:this.ctx.get($r)},d.result,{normalizedUri:c,version:r});if(!f)return;f.isCrossFile&&zFe.debug(this.ctx,`Cross-file NES: edit requested for ${l.uri} targets ${f.document.uri}`);let h=Z4c(d)??Dt(),m={resultId:h,nextEditResult:d,documentId:l,targetUri:f.document.uri,isShown:!1,originalText:f.document.getText(),languageId:f.document.detectedLanguageId};return this.lastResultsById.set(h,m),this.lastResultsByUri.set(e,m),[{edit:{text:d.result.newText,range:f.range,textDocument:f.textDocument},id:h}]}async handleAcceptance(e){let r=await this.nextEditProvider,n=this.lastResultsById.get(e);!r||!n||(this.lastResultsByUri.delete(n.documentId.uri),this.lastResultsById.delete(n.resultId),this.startNESArcTelemetry(n),await r.handleAcceptance(n.nextEditResult))}startNESArcTelemetry(e){try{let r=e.nextEditResult.result;if(!r)return;let n=e.originalText.slice(0,r.range.start)+r.newText+e.originalText.slice(r.range.endExclusive);this.ctx.get($r).getTextDocument({uri:e.targetUri}).then(o=>{if(!o)return;this.ctx.get(kT).initialize(o,e.originalText,n,{timeouts:Y4c}).startReporter(c=>{lzi(this.ctx,{...c,opportunityId:e.resultId,languageId:e.languageId})})}).catch(o=>{zFe.warn(this.ctx,"Failed to start NES ARC telemetry",o)})}catch(r){zFe.warn(this.ctx,"Failed to start NES ARC telemetry",r)}}async handleRejection(e,r){await this.doHandleDismiss(e,!0,r)}async handleIgnored(e){await this.doHandleDismiss(e,!1)}async doHandleDismiss(e,r,n){let o=await this.nextEditProvider,s=this.lastResultsById.get(e);!o||!s||(this.lastResultsByUri.delete(s.documentId.uri),this.lastResultsById.delete(s.resultId),s.isShown&&(r?(n&&eLc(this.ctx,s.nextEditResult,n),o.handleRejection(s.nextEditResult)):o.handleIgnored(s.nextEditResult,void 0)))}async handleShown(e){let r=await this.nextEditProvider,n=this.lastResultsById.get(e);!r||!n||(n.isShown=!0,r.handleShown(n.nextEditResult))}async createNextEditProvider(){let e=this.ctx.get(p8r.ObservableWorkspace),r=new VFe(this.ctx.get(Jt)),n=new m8r(this.ctx),o=this.ctx.get(Ir),s=await(0,r9.createNESProvider)({configOverrides:this.nesConfigOverrides(),workspace:e,fetcher:r,copilotTokenManager:n,editorInfo:o.getEditorInfo(),editorPluginInfo:o.getEditorPluginInfo(),terminalService:pzi.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new $Fe(this.ctx),languageDiagnosticsService:this.ctx.get(t9),tokenizerProvider:new YTt});return this.ctx.get(Qo).onDidChangeCopilotSettings(()=>{s.setConfigs(this.nesConfigOverrides()).catch(c=>{Ma(this.ctx,c,"nesProvider.setConfigs")})}),s}nesConfigOverrides(){let e=this.withNesModelConfiguration(Lxe(this.ctx));for(let[r,n]of Object.entries(J4c))e.set(r,n),zFe.warn(this.ctx,`local NES config override active: ${r}=${JSON.stringify(n)}`);return e}withNesModelConfiguration(e){let r=t.modelConfigurationStringKey,n=e.get(ze.NESModelConfiguration),o=new Set;if(typeof n=="string"&&n.length>0){let s;try{s=JSON.parse(n)}catch{zFe.warn(this.ctx,"ignoring malformed nesModelConfiguration"),s=void 0}if(s!==null&&typeof s=="object"){let c=s,l="modelName"in c?{[r]:c}:c;for(let[u,d]of Object.entries(l)){let f=t.stringValuedNesKeys.has(u)&&d!==null&&typeof d=="object"?JSON.stringify(d):d;e.set(u,f),o.add(u)}}}for(let s of this.lastAppliedNesKeys)!o.has(s)&&!e.has(s)&&e.set(s,void 0);return this.lastAppliedNesKeys=o,e}shouldUseExplicitRejection(){return kt(this.ctx,ze.NESUseExplicitRejection)}};function Z4c(t){let e=t.requestUuid;return typeof e=="string"&&e.length>0?e:void 0}a(Z4c,"readOpportunityId");async function X4c(t,e,r){let n=r.normalizedUri,o=e.targetDocumentUri,s=o!==void 0&&Gs(o)!==n,c=s?o:n,l=await t.textDocumentManager.getTextDocument({uri:c});if(!l)return;let u=l.positionAt(e.range.start),d=l.positionAt(e.range.endExclusive);return{textDocument:{uri:l.uri,version:s?l.version:r.version},range:{start:u,end:d},document:l,isCrossFile:s}}a(X4c,"resolveNextEditTarget");function eLc(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){Ma(t,o,"nesProvider.setDisposalReason")}}a(eLc,"trySetChatLibDisposalReason");var m8r=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new hzi.Emitter;this.onDidCopilotTokenRefresh=this.didChangeTokenResult.event;this._ctx.get(Qt).onDidChangeTokenResult(()=>{this.didChangeTokenResult.fire()})}static{a(this,"CopilotTokenManagerAdapter")}async getCopilotToken(e){let r=this._ctx.get(Qt);e&&r.resetToken("nes_force_refresh");let n=await r.getToken(),o=await this._ctx.get(Fr).resolveSession();return XTt(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Qt).resetToken("nes",e)}},VFe=class{constructor(e){this._delegate=e}static{a(this,"FetcherAdapter")}getUserAgentLibrary(){return this._delegate.name}async fetch(e,r){let n={headers:r.headers,body:r.body,timeout:r.timeout,json:r.json,method:r.method,signal:r.signal},o=await this._delegate.fetch(e,n),s=o.body(),c=null;return s&&(s instanceof h8r.Readable?c=h8r.Readable.toWeb(s):c=s),new fzi.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},Dt(),new URL(e).hostname)}fetcherId(){switch(this._delegate.name){case"EditorFetcher":case"ElectronFetcher":return"electron-fetch";case"FetchFetcher":case"NodeFetchFetcher":return"node-fetch";case"FakeFetcher":return"test-stub";default:return"helix-fetch"}}async disconnectAll(){return this._delegate.disconnectAll()}makeAbortController(){return new AbortController}isAbortError(e){return e&&e.name==="AbortError"}isInternetDisconnectedError(e){return!1}isFetcherError(e){return wx(e)}isNetworkProcessCrashedError(e){return!1}getUserMessageForFetcherError(e){return`Fetcher error: ${e.message}`}async fetchWithPagination(e,r){let n=[],o=r.pageSize??20,s=r.startPage??1,c=!1;do{let l=r.buildUrl(e,o,s),u=await this.fetch(l,r);if(!u.ok)return n;let d=await u.json(),f=r.getItemsFromResponse(d);n.push(...f),c=f.length===o,s++}while(c);return n}};var tLc="github.copilot.didAcceptNextEditSuggestionItem",g8r=class extends LR{constructor(){super(...arguments);this.name=tLc;this.arguments=b.Tuple([b.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(fC).handleAcceptance(n),!0}},rLc="github.copilot.didRejectNextEditSuggestionItem",A8r=class extends LR{constructor(){super(...arguments);this.name=rLc;this.arguments=b.Tuple([b.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(fC).handleRejection(n),!0}},nLc="github.copilot.didIgnoreNextEditSuggestionItem",y8r=class extends LR{constructor(){super(...arguments);this.name=nLc;this.arguments=b.Tuple([b.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(fC).handleIgnored(n),!0}},mzi=[g8r,A8r,y8r];p();var E8r="github.copilot.didAcceptPanelCompletionItem",_8r=class extends LR{constructor(){super(...arguments);this.name=E8r;this.arguments=b.Tuple([b.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(Fu).get(o);return c?(_Oe(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:MG(c.displayText)},c.copilotAnnotations),!0):!1}},gzi=[_8r];var iLc=[...Oli,...Lli,...mzi,...gzi];function Azi(t,e){let r=new Map;for(let n of iLc){let o=new n(t),s=Zu.Compile(o.arguments);r.set(o.name,{typeCheck:s,command:o})}return e.onExecuteCommand((n,o)=>{let s=r.get(n.command);if(!s)throw new Error(`Unknown command: ${n.command}`);let c=n9(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Ir).getEditorPluginInfo();await e.get(Un).update("versions",r.name,r.version)}wasPreviouslyInstalled(e){return Promise.resolve(!1)}async isNewUpgrade(e){try{let r=e.get(Ir).getEditorPluginInfo(),n=await e.get(Un).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,YFe.gt)((0,YFe.coerce)(r.version),(0,YFe.coerce)(n))}catch{return!1}}async markUpgraded(e){await this.markInstalled(e)}async uninstall(e){await super.uninstall(e);let r=e.get(Ir).getEditorPluginInfo();await e.get(Un).delete("versions",r.name),(await e.get(Un).listKeys("versions")).length===0&&await e.get(Un).deleteSetting("versions")}};p();var Czi=fe(pl()),bzi=require("crypto"),oIt=fe(require("path")),jEe=fe(Wc());var aLc={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},cLc=new jEe.ProgressType,eM=class t{constructor(e){this.ctx=e;this.#e=new Ji;this._changeHandlerLimiter=new Czi.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new jEe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(er).connection}init(){this.ctx.get(Nn).getCapabilities().watchedFiles&&this.connection.onNotification(jEe.DidChangeWatchedFilesNotification.type,r=>{if("workspaceUri"in r&&typeof r.workspaceUri=="string"){let n=r;this._changeHandlerLimiter.queue(()=>this.didChangeWatchedFilesHandler(n))}})}async getWatchedFiles(e){if(!this.ctx.get(Nn).getCapabilities().watchedFiles)return aLc;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(Nn).getCapabilities().watchedFiles)return[];let n=await this.fetchWatchedFileEntries(e),o=[],s=new Set;for(let c of n){let l=typeof c=="string"?c:c?.uri;if(!l||s.has(l))continue;s.add(l);let u=oIt.extname(l).toLowerCase();nq.includes(u)&&o.push({uri:l})}return o}async didChangeWatchedFilesHandler(e){let r=[],n=[],o=[];for(let s of e.changes){let c=s.uri,l={uri:c,isRestricted:!1,isUnknownFileExtension:!1},u=oIt.extname(s.uri).toLowerCase();if(!nq.includes(u))l.isUnknownFileExtension=!0;else{let d=await this.resolveWatchedDocument(c);d===void 0?l.isRestricted=!0:l.document=d}switch(s.type){case 1:n.push(l);break;case 2:r.push(l);break;case 3:o.push(l);break}}this.#e.fire({workspaceFolder:{uri:e.workspaceUri},created:n,changed:r,deleted:o})}async resolveWatchedDocument(e){return this.ctx.get(pc).enabled?this.getValidDocument(e):iT.create(e,"UNKNOWN",-1,"")}async getValidDocument(e){let n=await this.ctx.get(si).getOrReadTextDocument({uri:e});return n.status==="valid"?n.document:void 0}async fetchWatchedFileEntries(e){let r=e.partialResultToken??(0,bzi.randomUUID)(),n=[],o=this.connection.onProgress(cLc,r,s=>{s?.files?.length&&n.push(...s.files)});try{let s=await this.connection.sendRequest(t.requestType,{...e,partialResultToken:r});Array.isArray(s.files)&&n.push(...s.files)}finally{o.dispose()}return n}async buildWatchedFilesResponse(e){let r=[],n=[],o=[],s=new Set;for(let c of e){let l=typeof c=="string"?c:c?.uri;if(!l||s.has(l))continue;s.add(l);let u=oIt.extname(l).toLowerCase();if(!nq.includes(u)){o.push({uri:l});continue}let d=await this.getValidDocument(l);if(d===void 0){n.push({uri:l});continue}r.push(d)}return{watchedFiles:r,contentRestrictedFiles:n,unknownFileExtensions:o}}};p();var lLc=new pe("mcpGateway.projectCleanup"),Jie=class{constructor(e){this._dispose=e}static{a(this,"McpProjectCleanupSubscription")}dispose(){this._dispose()}};function Szi(t){let e=t.get($r),r=t.get(gy),n=e.onDidChangeWorkspaceFolders(o=>{if(o.removed.length!==0)for(let s of o.removed)r.removeProject(s.uri).catch(c=>{lLc.warn(t,"removeProject failed during workspace-folder cleanup",{workspaceFolder:s.uri,error:c instanceof Error?c.message:String(c)})})});return new Jie(()=>n.dispose())}a(Szi,"installMcpProjectCleanup");p();p();p();p();p();var Izi=require("crypto");var uLc=new pe("CloudAgentLogParser"),dLc=new Set(["run_setup","run_custom_setup_step"]),sIt=class{constructor(){this.counter=0}static{a(this,"CloudAgentIdSource")}next(){return++this.counter}};function tM(t){if(t!=null)return typeof t=="string"?t:JSON.stringify(t)}a(tM,"asString");function fLc(t){return typeof t=="number"&&Number.isFinite(t)?new Date(t*1e3).toISOString():new Date().toISOString()}a(fLc,"chunkTimestamp");function HEe(t,e,r){return{id:(0,Izi.randomUUID)(),timestamp:r,parentId:null,type:t,data:e}}a(HEe,"event");function aIt(t,e,r){if(!e||e.trim().length===0)return[];let n=[];return gLc(t,e,o=>{let s=fLc(o.created),c=o.choices;if(Array.isArray(c))for(let l of c){if(!l||typeof l!="object")continue;let u=l,d=u.delta;!d||typeof d!="object"||tM(d.role)==="assistant"&&pLc(d,u,n,r,s)}}),n}a(aIt,"parseCloudAgentLogs");function pLc(t,e,r,n,o){let s=t.tool_calls,c=Array.isArray(s)&&s.length>0?s:void 0,l=tM(t.content),u=tM(e.finish_reason);if(u==="tool_calls"&&c){let m=c[0],g=m.function,A=tM(g?.name);if(A&&dLc.has(A)){if(l&&l.trim().length>0){let y=Tzi(tM(g?.arguments)),_=tM(y?.name)??l,E=tM(m.id)??`setup-${_}`;xzi(r,E,A,{name:_},_,o)}return}}let d=l?.trimStart(),f=d?.startsWith("")===!0,h=d&&!d.startsWith("")&&!d.startsWith("")?d.trim():"";if(c){for(let m of c){let g=m,A=g.function,y=tM(A?.name);if(!y)continue;let _=Tzi(tM(A?.arguments));hLc(r,g,y,l,_,n,o)}if(f){let m=(l??"").replace(/^\s*\s*/i,"").replace(/\s*<\/error>\s*$/i,"").trim(),g=`command-error-${n.next()}`;r.push(HEe("tool.execution_start",{toolCallId:g,toolName:"command",arguments:{}},o)),r.push(HEe("tool.execution_complete",{toolCallId:g,success:!1,error:{message:m.length>0?m:"Command failed"}},o))}return}h.length>0&&(u==="stop"?r.push(mLc(h,n,o)):r.push(wzi(h,n,o)))}a(pLc,"processAssistantDelta");function hLc(t,e,r,n,o,s,c){if(r==="reply_to_comment")return;let l=tM(e.id);if(!l)return;if(r==="think"){let d=tM(o?.thought)??n;d&&d.trim().length>0&&t.push(wzi(d,s,c));return}let u=n?.trim();xzi(t,l,r,o,u&&u.length>0?u:void 0,c)}a(hLc,"appendToolPart");function xzi(t,e,r,n,o,s){t.push(HEe("tool.execution_start",{toolCallId:e,toolName:r,arguments:n??{}},s)),t.push(HEe("tool.execution_complete",{toolCallId:e,success:!0,result:{content:o??""}},s))}a(xzi,"pushToolCall");function mLc(t,e,r){return HEe("assistant.message",{messageId:`cloud-text-${e.next()}`,content:t},r)}a(mLc,"textEvent");function wzi(t,e,r){return HEe("assistant.reasoning",{reasoningId:`cloud-reasoning-${e.next()}`,content:t},r)}a(wzi,"reasoningEvent");function Tzi(t){if(!(!t||t.trim().length===0))try{let e=JSON.parse(t);return e&&typeof e=="object"?e:void 0}catch{return}}a(Tzi,"parseArguments");function gLc(t,e,r){for(let n of e.split(/\r?\n/)){let o=n.trimStart();if(!o.startsWith("data:"))continue;let s=o.slice(5).trim();if(s.length===0)continue;let c;try{c=JSON.parse(s)}catch{uLc.debug(t,"parseCloudAgentLogs: skipping malformed SSE data chunk",{data:s});continue}c&&typeof c=="object"&&r(c)}}a(gLc,"forEachDataChunk");p();var cIt=require("crypto");var Zie=new pe("CloudAgentSession"),Xie="CloudAgentSession",C8r="cloud:",ALc="github.pull_request_card";function b8r(t,e){let r=e?new Date(e):null,n=r&&!isNaN(r.getTime())?r.toISOString():new Date().toISOString();return{id:(0,cIt.randomUUID)(),timestamp:n,parentId:null,type:ALc,data:{number:t.number,title:t.title?.trim()||`Pull request #${t.number}`,body:t.body?.trim()||null,htmlUrl:t.html_url}}}a(b8r,"buildCloudPullRequestCardEvent");function S8r(t,e,r){return`${C8r}${t}/${e}#${r}`}a(S8r,"buildCloudSessionId");function T8r(t){if(!t.startsWith(C8r))return;let e=t.slice(C8r.length),r=e.lastIndexOf("#");if(r<=0||r===e.length-1)return;let n=e.slice(0,r),o=e.slice(r+1),s=n.indexOf("/");if(s<=0||s===n.length-1)return;let c=n.slice(0,s),l=n.slice(s+1),u=Number(o);if(Number.isInteger(u)&&u>0)return{owner:c,repo:l,pullRequestNumber:u}}a(T8r,"parseCloudSessionId");var pB={InProgress:"in_progress",Queued:"queued",Completed:"completed",Failed:"failed"},v8r=3e3,yLc=120*1e3,_Lc=300*1e3,Rzi=10,lIt=class{constructor(e,r,n,o){this.ctx=e;this.notificationSender=r;this.client=n;this._ids=new sIt;this.localSessionId=o.localSessionId,this.workspaceFolder=o.workspaceFolder,this._cwd=un(o.workspaceFolder.uri),this._pullRequest=o.pullRequest}static{a(this,"CloudAgentSession")}get cwd(){return this._cwd}get pullRequest(){return this._pullRequest}get idSource(){return this._ids}get hasPullRequest(){return this._pullRequest!==void 0}updatePullRequest(e){this._pullRequest=e}async startInitialJob(e){let n=this.resetCancellation().token;try{let{owner:o,name:s,baseRef:c}=await this.resolveRepo(n),l=ude(e),u=await this.client.createCodingTask(l,e,o,s,c,n);if(n.isCancellationRequested)return{stream:Promise.resolve()};let d=u.pullRequest;return this._pullRequest=d,this.emit(b8r(d)),Zie.info(this.ctx,`${Xie}.startInitialJob: job created`,{localSessionId:this.localSessionId,pullRequestNumber:d.number,cloudSessionId:u.sessionId}),{stream:this.streamSessionSafe(u.sessionId,0,void 0,n)}}catch(o){if(n.isCancellationRequested||Mwe(o))return{stream:Promise.resolve()};throw o}}async submitFollowUp(e){let r=this._pullRequest;if(!r)throw new Error("submitFollowUp called before a pull request was created");let o=this.resetCancellation().token,s=await this.snapshotSessionIds(r.id,o);if(o.isCancellationRequested)return{stream:Promise.resolve()};await new gm(this.ctx).addPullRequestComment(r.repository.owner.login,r.repository.name,r.number,`@copilot ${e}`);let l=await this.waitForNewSession(r.id,s,o);return o.isCancellationRequested?{stream:Promise.resolve()}:l?{stream:this.streamSessionSafe(l,0,void 0,o)}:(this.emitError("Timed out waiting for the cloud agent to start a new session."),{stream:Promise.resolve()})}resumeStreaming(e){let r=this.resetCancellation();return{stream:this.streamSessionSafe(e.cloudSessionId,e.initialLogLength,e.state,r.token)}}async streamSessionSafe(e,r,n,o){try{await this.streamSession(e,r,n,o)}catch(s){if(o.isCancellationRequested)return;this.emitError(this.errorMessage(s)||"Cloud agent session stream failed")}}stop(){this._cts?.cancel(),this._cts?.dispose(),this._cts=void 0}stopByUser(){this.stop(),this.emitIdle()}async streamSession(e,r,n,o){if(this.emit(this.event("assistant.turn_start",{turnId:(0,cIt.randomUUID)(),interactionId:this.localSessionId})),n!==pB.InProgress){let s=await this.waitForInProgress(e,o);if(o.isCancellationRequested)return;switch(s?.state){case pB.InProgress:break;case pB.Failed:this.emitError(s.error?.message??"The cloud agent session failed.");return;case pB.Completed:this.emitIdle();return;default:this.emitError("The cloud agent session did not start in time.");return}}await this.streamSessionLogs(e,r,o)}async waitForInProgress(e,r){let n=Date.now()+yLc;for(;!r.isCancellationRequested&&Date.now()=Rzi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}if(!c){Zie.warn(this.ctx,`${Xie}.streamSessionLogs: session no longer in list; stopping`,{cloudSessionId:e}),this.emitIdle();return}let l;try{l=await this.client.getSessionLogs(e,n)}catch(f){if(Zie.warn(this.ctx,`${Xie}.streamSessionLogs: log fetch failed; will retry`,{cloudSessionId:e,error:this.errorMessage(f)}),++s>=Rzi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}s=0;let u=c.state,d=u!==pB.InProgress&&u!==pB.Queued;if(l.length>o){let f=l.slice(o);o=l.length;let h=aIt(this.ctx,f,this._ids);for(let m of h)this.emit(m)}if(d){u===pB.Failed?this.emitError(c.error?.message??"The cloud agent session failed."):this.emitIdle();return}}}async waitForNewSession(e,r,n){let o=Date.now()+_Lc;for(;!n.isCancellationRequested&&Date.now()!r.has(l.id)).sort((l,u)=>new Date(u.created_at).getTime()-new Date(l.created_at).getTime())[0];if(c)return c.id}await this.delay(v8r,n)}}async snapshotSessionIds(e,r){let n=await this.client.getAllSessions(e,r);return new Set((n??[]).map(o=>o.id))}async getSessionInfo(e,r){let n=this._pullRequest;return n?(await this.client.getAllSessions(n.id,r)??[]).find(s=>s.id===e):void 0}async resolveRepo(e){let r={uri:this.workspaceFolder.uri},o=await new Pf(this.ctx).getRepo(r);if(!o||!o.isGitHub())throw new Error("No GitHub repository found in the workspace folder.");if(!o.owner||!o.name)throw new Error("Could not determine repository owner and name.");let c=await new f5([new p5,new h5]).getBranchInfo(this.ctx,r);if(!c?.currentBranch||c.isDetachedHead)throw new Error("No current branch found or detached HEAD state \u2014 cannot create a cloud agent job.");if(e.isCancellationRequested)throw new Error("Request was cancelled");return{owner:o.owner,name:o.name,baseRef:c.currentBranch}}emit(e){this.notificationSender.sendBackgroundAgentSessionUpdate(this.localSessionId,e,"CLOUD").catch(r=>{Zie.warn(this.ctx,`${Xie}.emit: failed to send session update`,{localSessionId:this.localSessionId,error:this.errorMessage(r)})})}emitIdle(){this.emit(this.event("session.idle",{}))}emitError(e){this.emit(this.event("session.error",{errorType:"cloudAgent",message:e})),this.emitIdle()}event(e,r){return{id:(0,cIt.randomUUID)(),timestamp:new Date().toISOString(),parentId:null,type:e,data:r}}resetCancellation(){this.stop();let e=new jn.CancellationTokenSource;return this._cts=e,e}delay(e,r){return new Promise(n=>{let o=setTimeout(()=>{s?.dispose(),n()},e),s=r.onCancellationRequested(()=>{clearTimeout(o),s?.dispose(),n()})})}errorMessage(e){return e instanceof Error?e.message:String(e)}};p();var GEe=new pe("GitHubGraphQLClient"),$Ee=class{constructor(e){this.ctx=e;this.graphqlClient=null}static{a(this,"GitHubGraphQLClient")}async getGraphQLClient(){if(this.graphqlClient)return this.graphqlClient;let e=await this.getApiSession(),r=this.ctx.get(Jt);return this.graphqlClient=txn.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){GEe.debug(this.ctx,`Searching pull requests with query: ${e}`);let r=await this.getGraphQLClient();try{let n=[],o=null,s=!0,c=0;for(;s;){c++,GEe.debug(this.ctx,`Fetching page ${c} of pull requests search results`);let u=await r(` +`)[0],d=u.length-u.trimStart().length,f=d%o;if(f!==0&&d>0){let h=" ".repeat(f);return n(l,h,m=>" ".repeat((Math.floor(m/o)+1)*o))}else return l},"re");e.displayText=c(e.displayText),e.completionText=c(e.completionText)}}return e}a(XWi,"normalizeIndentCharacter");Fo();function ezi(t,e,r,n,o,s,c){let l=n.lineAt(o),u=e.map(d=>{let f=wu.range(wu.position(o.line,0),wu.position(o.line,o.character+d.suffixCoverage)),h="";if(s&&(d.completion=XWi(s,d.completion,l.isEmptyOrWhitespace)),l.isEmptyOrWhitespace&&(d.completion.displayNeedsWsOffset||d.completion.completionText.startsWith(l.text)))h=d.completion.completionText;else{let g=wu.range(f.start,o);h=n.getText(g)+d.completion.displayText}return{uuid:Dt(),insertText:h,range:f,uri:n.uri,index:d.completion.completionIndex,telemetry:d.telemetry,displayText:d.completion.displayText,position:o,offset:n.offsetAt(o),resultType:r,copilotAnnotations:d.copilotAnnotations,clientCompletionId:d.clientCompletionId}});if(r===2&&c!==void 0){let d=u.find(f=>f.index===c);if(d){let f=u.filter(h=>h.index!==c);u=[d,...f]}}return u}a(ezi,"completionsFromGhostTextResults");p();var XN=class{constructor(){this.cache=new Sn(100)}static{a(this,"SpeculativeRequestCache")}set(e,r){this.cache.set(e,r)}async request(e){let r=this.cache.get(e);r!==void 0&&(this.cache.delete(e),await r())}};var FEe=class extends Ay{constructor(r){super();this.ctx=r}static{a(this,"GhostTextInlineCompletionManager")}async getInlineCompletionsResult(r,n,o={}){let s=this.ctx,c=0;o.selectedCompletionInfo?.text&&!o.selectedCompletionInfo.text.includes(")")&&(r=r.addSelectedCompletionInfo(o.selectedCompletionInfo),c=r.position.character-o.selectedCompletionInfo.range.end.character);let l=await MAr(s,r,n,o);if(l.type!=="success")return l;let[u,d]=l.value;if(n?.isCancellationRequested)return{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:l.telemetryBlob}};let f=Mli(s,r.textDocument,r.position,d),h=ezi(s,u,d,r.textDocument,r.position,o.formattingOptions,f);if(h.length===0)return{type:"empty",reason:"no completions in final result",telemetryData:l.telemetryData};if(d!==2){r=r.applyEdits([{newText:h[0].insertText,range:h[0].range}]);let g={isSpeculative:!0,opportunityId:o.opportunityId},A=a(()=>MAr(s,r,void 0,g),"fn");s.get(XN).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,_=jn.Range.create(A,jn.Position.create(y.line,y.character-c));return{...g,range:_}});return{...l,value:m}}async getPrompt(r,n,o,s={}){let c=await this.getInlineCompletionsResult(nte(r,n),o,{...s,promptOnly:!0});if(c.type!=="promptOnly")throw new Error(`Unexpected result type ${c.type}`);return c.prompt}async getCompletions(r,n,o,s={}){this.logCompletionLocation(r,n);let c=await this.getInlineCompletionsResult(nte(r,n),o,s);return nsi(this.ctx,c)}logCompletionLocation(r,n){let o=r.getText({start:{line:Math.max(n.line-1,0),character:0},end:n}),s=r.getText({start:n,end:{line:Math.min(n.line+2,r.lineCount-1),character:r.lineCount-1>n.line?0:n.character}});cft.debug(this.ctx,`Requesting for ${r.uri} at ${n.line}:${n.character}`,`between ${JSON.stringify(o)} and ${JSON.stringify(s)}.`)}triggerSpeculativeRequests(r){return this.ctx.get(XN).request(r.clientCompletionId)}};p();var UEe=fe(Qie()),tzi=fe(ON()),i8r=fe(Spt()),XTt=fe(Zee()),rzi=fe(Os()),nzi=fe(bD()),HFe=fe(W_()),ZTt=fe(iv()),o8r=fe(Id()),izi=fe(dI()),ozi=fe(ii());p();var JTt=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new Ji;this._onDidChangeTextDocument=new Ji;this._onDidCloseTextDocument=new Ji;this._onDidSelectTextDocument=new Ji;this.onDidOpenTextDocument=this._onDidOpenTextDocument.event;this.onDidChangeTextDocument=this._onDidChangeTextDocument.event;this.onDidCloseTextDocument=this._onDidCloseTextDocument.event;this.onDidSelectTextDocument=this._onDidSelectTextDocument.event;this.bufferedEvents=[];this.forwardedAsOpen=new Set;this.started=!1;this.documentManager=this.ctx.get($r)}static{a(this,"DocumentChangeFilter")}start(){if(!this.started){this.started=!0;for(let e of this.documentManager.getTextDocumentsUnsafe())this.bufferedEvents.push({type:"addition",event:{document:{uri:e.uri,languageId:e.clientLanguageId,version:e.version,text:e.getText()}}});this.documentManager.onDidOpenTextDocument(e=>{this.bufferedEvents.push({type:"addition",event:e})}),this.documentManager.onDidChangeTextDocument(e=>{this.bufferedEvents.push({type:"change",event:e})}),this.documentManager.onDidCloseTextDocument(e=>{this.bufferedEvents.push({type:"removal",event:e})})}}addSelectionEvent(e){this.bufferedEvents.push({type:"selection",event:e})}async syncSafeDocuments(){let e=[...this.bufferedEvents];this.bufferedEvents.length=0;for(let r of e){let n=r.type==="selection"?r.event.uri:r.event.document.uri;if(r.type==="removal"){this.forwardedAsOpen.has(n)&&(this.forwardedAsOpen.delete(n),this._onDidCloseTextDocument.fire(r.event));continue}let o=await this.documentManager.getTextDocument({uri:n});if(o===void 0){this.forwardedAsOpen.has(n)&&(this.forwardedAsOpen.delete(n),this._onDidCloseTextDocument.fire({document:{uri:n}}));continue}r.type==="addition"?(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire(r.event)):r.type==="change"?this.forwardedAsOpen.has(n)?this._onDidChangeTextDocument.fire(r.event):(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire({document:{uri:o.clientUri,languageId:o.clientLanguageId,version:o.version,text:o.getText()}})):r.type==="selection"&&(this.forwardedAsOpen.has(n)||(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire({document:{uri:o.clientUri,languageId:o.clientLanguageId,version:o.version,text:o.getText()}})),this._onDidSelectTextDocument.fire(r.event))}}};var yW=class extends XTt.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,nzi.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new JTt(r)),this._started=!1,o||this.start()}static{a(this,"ObservableLspWorkspace")}start(){if(this._started)return;this._started=!0;let r=this.ctx.get($r);if(this.documentChangeFilter)this.documentChangeFilter.start();else for(let o of r.getTextDocumentsUnsafe())this.addLspDocument(o.uri,o.clientLanguageId,o.getText());let n=this.documentChangeFilter??r;n.onDidOpenTextDocument(o=>{this.addLspDocument(o.document.uri,o.document.languageId,o.document.text)}),n.onDidCloseTextDocument(o=>{this.removeClosedLspDocument(o.document.uri)}),n.onDidChangeTextDocument(o=>{this.onDidChangeLspDocument(o.document.uri,o.contentChanges)}),this.documentChangeFilter?.onDidSelectTextDocument(o=>{let s=UEe.DocumentId.create(Gs(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=UEe.DocumentId.create(Gs(Gs(r)));return this.addDocument({id:s,initialValue:o,languageId:i8r.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=UEe.DocumentId.create(Gs(Gs(r))),s=this._documents.get(o);s&&s.applyLspContentChanges(n)}onUserPositionChange(r,n){if(this.documentChangeFilter)this.documentChangeFilter.addSelectionEvent({uri:r,position:n});else{let o=UEe.DocumentId.create(Gs(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=UEe.DocumentId.create(Gs(r));this._documents.get(n)?.dispose()}addDocument(r,n=void 0){let o=this._documents.get(r.id);if(o)return o;let s=new s8r(r.id,new izi.StringText(r.initialValue??""),[],r.languageId??i8r.LanguageId.PlainText,()=>{this._documents.delete(r.id);let c=this._openDocuments.get(),l=c.filter(u=>u.id!==s.id);l.length!==c.length&&this._openDocuments.set(l,n,{added:[],removed:[s]})},r.workspaceRoot);return this._documents.set(r.id,s),this._openDocuments.set([...this._openDocuments.get(),s],n,{added:[s],removed:[]}),s}getDocument(r){return this._documents.get(r)}clear(){this._openDocuments.set([],void 0,{added:[],removed:this._openDocuments.get()});for(let r of this._documents.values())r.dispose();this._documents.clear()}getWorkspaceRoot(r){return this._documents.get(r)?.workspaceRoot}async syncSafeDocuments(){this.start(),await this.documentChangeFilter?.syncSafeDocuments()}},s8r=class extends XTt.MutableObservableDocument{static{a(this,"MutableObservableLspDocument")}constructor(e,r,n,o,s,c){super(e,r,n,o,s,0,c)}applyLspContentChanges(e){let r=this.editFromLspContentChanges(e);this.applyEdit(r.compose(),void 0)}updateSelectionFromLspPosition(e){let r=this.value.get().getTransformer().getOffset(new ZTt.Position(e.lineNumber+1,e.column+1));this.updateSelection([new o8r.OffsetRange(r,r)])}editFromLspContentChanges(e){return new tzi.Edits(HFe.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(ozi.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new ZTt.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new ZTt.Position(e.range.end.line+1,e.range.end.character+1));if(o>s){let c=this.value.get().value,l=c.split(/\r\n|\n/).length,u=c.split(/\r\n|\r|\n/).length,d=new rzi.BugIndicatingError(`Invalid range: [${o}, ${s}) from ${JSON.stringify(e.range)}. Line counts: nes=${l}, lsp=${u}`);throw lu?d.code="ObservableWorkspace_TooManyLines":d.code="ObservableWorkspace_InvalidRange",d.code+=r>0?"_SubsequentChange":"_FirstChange",d}return HFe.StringEdit.single(new HFe.StringReplacement(new o8r.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var szi=fe(zTt()),azi=fe(Kyt()),a8r=fe(Zee()),QEe=fe(Fc()),p8r=fe(Po());var c8r=class extends p8r.Disposable{constructor(r){super();this.ctx=r;this.isMinimalMode=!0;this.permissiveGitHubSession=void 0;this.hasCopilotTokenSource=!0;this._tokenChangedEverFired=!1;this._onDidAuthenticationChange=this._register(new QEe.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new QEe.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidCopilotTokenChange=this._register(new QEe.Emitter);this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new QEe.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(ws(r,()=>{this.fireTokenChanged()}))}static{a(this,"AuthServiceAdapter")}fireTokenChanged(){this._tokenChangedEverFired=!0,this._onDidAccessTokenChange.fire(),this._onDidCopilotTokenChange.fire(),this._onDidAuthenticationChange.fire()}ensureTokenChangedFired(){this._tokenChangedEverFired||this.fireTokenChanged()}async getAnyGitHubSession(r){let n=await this.ctx.get(Or).resolveSession();if(n!==void 0)return{id:n.login,accessToken:n.accessToken,account:{id:n.login,label:n.serverUrl},scopes:[]}}async getGitHubSession(r,n){if(r!=="permissive")return this.getAnyGitHubSession(n)}getPermissiveGitHubSession(r){return Promise.resolve(void 0)}get copilotToken(){let r=this.ctx.get(Qt).getLastToken();if(r!==void 0)return this.ensureTokenChangedFired(),eIt(r,this.ctx)}async getCopilotToken(r){let n=this.ctx.get(Qt);r&&n.resetToken("inline_completion_force_refresh");let o=await n.getToken();this.ensureTokenChangedFired();let s=await this.ctx.get(Or).resolveSession();return eIt(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Qt).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function eIt(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new azi.CopilotToken({token:t.envelope.token,expires_at:t.envelope.expires_at,refresh_in:n,organization_list:t.envelope.organization_list,code_quote_enabled:t.envelope.code_quote_enabled??!1,copilotignore_enabled:t.envelope.copilotignore_enabled??!1,endpoints:t.envelope.endpoints,limited_user_quotas:t.envelope.limited_user_quotas,enterprise_list:t.envelope.enterprise_list?t.envelope.enterprise_list.map(Number):void 0,sku:t.getTokenValue("sku")??"",individual:t.userInfo.isIndividualUser,blackbird_clientside_indexing:!1,code_review_enabled:t.isCopilotCodeReviewEnabled,codesearch:t.envelope.codesearch??!1,public_suggestions:"unconfigured",telemetry:e.get(op).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(eIt,"asChatLibCopilotToken");var l8r=class extends p8r.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new QEe.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(ws(r,()=>{this.models=void 0}))}static{a(this,"EndpointProviderAdapter")}async getAllModels(r=!1){if(this.models===void 0||r)try{let n=this.ctx.get(cw),o=await this.ctx.get(Qt).getToken();this.models=await n.fetchModels(o)??[],this._onDidModelsRefresh.fire()}catch(n){Ma(this.ctx,n,"AvailableModelsManager.fetchModels"),this.models=[]}return this.models}async getAllCompletionModels(r){return(await this.getAllModels(r)).filter(o=>o.capabilities.type==="completion")}getAllChatEndpoints(){throw new Error("getAllChatEndpoints is not supported.")}getChatEndpoint(r){throw new Error("getChatEndpoint is not supported.")}getEmbeddingsEndpoint(r){throw new Error("getEmbeddingsEndpoint is not supported.")}},u8r=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(pc).enabled}get isRegexExclusionsEnabled(){return!0}dispose(){}init(){return Promise.resolve()}async isCopilotIgnored(e,r){let n=e.toString();return(await this.ctx.get($r).getTextDocumentValidation({uri:n})).status==="invalid"}asMinimatchPattern(){return Promise.resolve(void 0)}},d8r=class{constructor(e){this.statusReporter=e}static{a(this,"StatusHandlerAdapter")}didChange(e){switch(this.statusReporter.didChangeV1(e),e.kind){case"Inactive":{this.statusReporter.forceNormalV2("cls",{message:e.message??"",inactive:!0});break}case"Error":{this.statusReporter.setErrorV2("cls",{message:e.message??""});break}case"Warning":{this.statusReporter.setWarningV2("cls",{message:e.message??""});break}case"Normal":{this.statusReporter.forceNormalV2("cls",{inactive:!1});break}}}},f8r=class extends Ay{constructor(r){super();this.ctx=r;this._telemetrySender=new GFe(this.ctx)}static{a(this,"ChatLibInlineCompletionManager")}get completionProvider(){return this._completionProvider||(this._completionProvider=this.createCompletionProvider()),this._completionProvider}createCompletionProvider(){let r=this.ctx,n=r.get(Pm).matchFunction,o=new VFe(this.ctx.get(Jt)),s=Lxe(r),c={fetcher:o,authService:new c8r(r),telemetrySender:this._telemetrySender,logTarget:new $Fe(r),isRunningInTest:s1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new d8r(r.get(ks)),documentManager:r.get($r),workspace:r.get(a8r.ObservableWorkspace),urlOpener:r.get(sg),editorInfo:r.get(Ir).getEditorInfo(),editorPluginInfo:r.get(Ir).getEditorPluginInfo(),relatedPluginInfo:r.get(Ir).getRelatedPluginInfo(),editorSession:r.get(za),notificationSender:r.get(ss),ignoreService:new u8r(r),waitForTreatmentVariables:!1,endpointProvider:new l8r(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s,tokenizerProvider:ZWi},l=(0,szi.createInlineCompletionsProvider)(c);return this.ctx.get(Qo).onDidChangeCopilotSettings(()=>{let u=Lxe(this.ctx);l.setConfigs(u).catch(d=>{Ma(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=this.completionProvider,l=this.ctx.get(a8r.ObservableWorkspace);l instanceof yW&&await l.syncSafeDocuments();let u=await this.ctx.get(tr).fetchTokenAndUpdateExPValuesAndAssignments();return this._telemetrySender.updateExpConfig(u.filtersAndExp.exp),c.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.asLocalResult(await c.getInlineCompletions(r,n,o,s),u)}asLocalResult(r,n){if(r!==void 0)return r.map(o=>({uuid:o.uuid,insertText:o.insertText,range:o.range,uri:o.uri,telemetry:new Tx({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new QB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new px(o.telemetry.filtersAndExp.exp.variables,n.filtersAndExp.exp.assignmentContext,o.telemetry.filtersAndExp.exp.features)}),displayText:o.displayText,position:o.position,offset:o.offset,index:o.index,resultType:o.resultType,copilotAnnotations:o.copilotAnnotations,clientCompletionId:o.clientCompletionId}))}triggerSpeculativeRequests(r){return this.completionProvider.inlineCompletionShown(r.clientCompletionId)}},tIt=class extends Ay{constructor(r){super();this.ctx=r}static{a(this,"ConfigurableInlineCompletionManager")}get ghostTextImpl(){return this._ghostTextImpl||(this._ghostTextImpl=new FEe(this.ctx)),this._ghostTextImpl}get chatLibImpl(){return this._chatLibImpl||(this._chatLibImpl=new f8r(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(tr).fetchTokenAndUpdateExPValuesAndAssignments();return kt(this.ctx,ze.UseChatLibCompletions)??this.ctx.get(tr).useChatLibCompletions(r)}async getCompletions(r,n,o,s={}){return await this.isChatLibEnabled()?this.chatLibImpl.getCompletions(r,n,o,s):this.ghostTextImpl.getCompletions(r,n,o,s)}async triggerSpeculativeRequests(r){return await this.isChatLibEnabled()?this.chatLibImpl.triggerSpeculativeRequests(r):this.ghostTextImpl.triggerSpeculativeRequests(r)}},GFe=class{constructor(e){this.ctx=e;this.ctx=e}static{a(this,"TelemetrySender")}updateExpConfig(e){this._expConfig=e}sendTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),Aae(this.ctx,e,o.properties,o.measurements,0),sr(this.ctx,e,K9(o.properties,qMe),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),Aae(this.ctx,e,o.properties,o.measurements,1)}asTelemetryData(e,r){let n=Object.fromEntries(Object.entries(e??{}).filter(([s,c])=>c!==void 0)),o=Object.fromEntries(Object.entries(r??{}).filter(([s,c])=>c!==void 0));return n["abexp.assignmentcontext"]===void 0&&this._expConfig?.assignmentContext!==void 0&&(n["abexp.assignmentcontext"]=this._expConfig.assignmentContext),n.completionsImplementation="chat-lib",Vt.createAndMarkAsIssued(n,o)}};p();var czi=fe(bV()),lzi=fe(Fc()),WFe=fe(SPr()),uzi=fe(BL());var z4c=16,t9=class extends czi.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new Sn(z4c);this._onDidChangeDiagnostics=new lzi.Emitter;this.onDidChangeDiagnostics=this._onDidChangeDiagnostics.event}static{a(this,"LspLanguageDiagnosticsService")}getDiagnostics(r){return this._map.get(r.toString())?.diagnostics??[]}getAllDiagnostics(){return Array.from(this._map.values()).map(r=>[r.uri,r.diagnostics])}setForRequest(r,n){let o=n.map(Y4c);this._map.set(r.toString(),{uri:r,diagnostics:o}),this._onDidChangeDiagnostics.fire({uris:[r]})}clear(r){this._map.delete(r.toString())&&this._onDidChangeDiagnostics.fire({uris:[r]})}clearAll(){let r=Array.from(this._map.values()).map(n=>n.uri);this._map.clear(),r.length>0&&this._onDidChangeDiagnostics.fire({uris:r})}};function Y4c(t){let e=new uzi.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?WFe.DiagnosticSeverity.Error:WFe.DiagnosticSeverity.Warning,n=new WFe.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(Y4c,"toVscodeDiagnostic");p();var K4c="nes.reportInlineEditArc";function dzi(t,e){if(e.originalCharCount===void 0||e.originalCharCount===0)return;let r={opportunityId:e.opportunityId,languageId:e.languageId??""},n={arc:e.arc??0,originalCharCount:e.originalCharCount,originalLineCount:e.originalLineCount??0,originalDeletedLineCount:e.originalDeletedLineCount??0,currentLineCount:e.currentLineCount??0,currentDeletedLineCount:e.currentDeletedLineCount??0,didBranchChange:e.didBranchChange,timeDelayMs:e.timeDelayMs};sr(t,K4c,r,n)}a(dzi,"emitNESArcTelemetry");var r9=fe(zTt()),pzi=fe(Qie()),h8r=fe(Zee()),hzi=fe(Oy()),mzi=fe(V1t()),gzi=fe(Fc()),m8r=require("node:stream");Fo();var fzi=10,J4c=[0,30*1e3,120*1e3,300*1e3,600*1e3,900*1e3],zFe=new pe("nextEditSuggestions"),Z4c={[r9.LogLevel.Off]:4,[r9.LogLevel.Trace]:4,[r9.LogLevel.Debug]:4,[r9.LogLevel.Info]:3,[r9.LogLevel.Warning]:2,[r9.LogLevel.Error]:1},$Fe=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(Jf).logIt(this.ctx,Z4c[e],r,...n)}},X4c={},fC=class t{constructor(e){this.lastResultsById=new Sn(fzi);this.lastResultsByUri=new Sn(fzi);this.lastAppliedNesKeys=new Set;this.ctx=e,this.telemetrySender=new GFe(this.ctx)}static{a(this,"NextEditSuggestionsManager")}static{this.modelConfigurationStringKey="chat.advanced.inlineEdits.xtabProvider.modelConfigurationString"}static{this.defaultModelConfigurationStringKey="chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString"}static{this.stringValuedNesKeys=new Set([t.modelConfigurationStringKey,t.defaultModelConfigurationStringKey])}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(h8r.ObservableWorkspace);if(s instanceof yW&&await s.syncSafeDocuments(),!this.shouldUseExplicitRejection()){let A=this.lastResultsByUri.get(e);A&&(this.lastResultsByUri.delete(e),this.lastResultsById.delete(A.resultId),A.isShown&&o.handleRejection(A.nextEditResult))}let c=Gs(e),l=pzi.DocumentId.create(c),u=await this.ctx.get(tr).fetchTokenAndUpdateExPValuesAndAssignments();if(o.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.telemetrySender.updateExpConfig(u.filtersAndExp.exp),!s.getDocument(l))return;let d=await o.getNextEdit(l.toUri(),n);if(d.result==null)return;let f=await tLc({textDocumentManager:this.ctx.get($r)},d.result,{normalizedUri:c,version:r});if(!f)return;f.isCrossFile&&zFe.debug(this.ctx,`Cross-file NES: edit requested for ${l.uri} targets ${f.document.uri}`);let h=eLc(d)??Dt(),m={resultId:h,nextEditResult:d,documentId:l,targetUri:f.document.uri,isShown:!1,originalText:f.document.getText(),languageId:f.document.detectedLanguageId};return this.lastResultsById.set(h,m),this.lastResultsByUri.set(e,m),[{edit:{text:d.result.newText,range:f.range,textDocument:f.textDocument},id:h}]}async handleAcceptance(e){let r=await this.nextEditProvider,n=this.lastResultsById.get(e);!r||!n||(this.lastResultsByUri.delete(n.documentId.uri),this.lastResultsById.delete(n.resultId),this.startNESArcTelemetry(n),await r.handleAcceptance(n.nextEditResult))}startNESArcTelemetry(e){try{let r=e.nextEditResult.result;if(!r)return;let n=e.originalText.slice(0,r.range.start)+r.newText+e.originalText.slice(r.range.endExclusive);this.ctx.get($r).getTextDocument({uri:e.targetUri}).then(o=>{if(!o)return;this.ctx.get(kT).initialize(o,e.originalText,n,{timeouts:J4c}).startReporter(c=>{dzi(this.ctx,{...c,opportunityId:e.resultId,languageId:e.languageId})})}).catch(o=>{zFe.warn(this.ctx,"Failed to start NES ARC telemetry",o)})}catch(r){zFe.warn(this.ctx,"Failed to start NES ARC telemetry",r)}}async handleRejection(e,r){await this.doHandleDismiss(e,!0,r)}async handleIgnored(e){await this.doHandleDismiss(e,!1)}async doHandleDismiss(e,r,n){let o=await this.nextEditProvider,s=this.lastResultsById.get(e);!o||!s||(this.lastResultsByUri.delete(s.documentId.uri),this.lastResultsById.delete(s.resultId),s.isShown&&(r?(n&&rLc(this.ctx,s.nextEditResult,n),o.handleRejection(s.nextEditResult)):o.handleIgnored(s.nextEditResult,void 0)))}async handleShown(e){let r=await this.nextEditProvider,n=this.lastResultsById.get(e);!r||!n||(n.isShown=!0,r.handleShown(n.nextEditResult))}async createNextEditProvider(){let e=this.ctx.get(h8r.ObservableWorkspace),r=new VFe(this.ctx.get(Jt)),n=new g8r(this.ctx),o=this.ctx.get(Ir),s=await(0,r9.createNESProvider)({configOverrides:this.nesConfigOverrides(),workspace:e,fetcher:r,copilotTokenManager:n,editorInfo:o.getEditorInfo(),editorPluginInfo:o.getEditorPluginInfo(),terminalService:mzi.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new $Fe(this.ctx),languageDiagnosticsService:this.ctx.get(t9),tokenizerProvider:new KTt});return this.ctx.get(Qo).onDidChangeCopilotSettings(()=>{s.setConfigs(this.nesConfigOverrides()).catch(c=>{Ma(this.ctx,c,"nesProvider.setConfigs")})}),s}nesConfigOverrides(){let e=this.withNesModelConfiguration(Lxe(this.ctx));for(let[r,n]of Object.entries(X4c))e.set(r,n),zFe.warn(this.ctx,`local NES config override active: ${r}=${JSON.stringify(n)}`);return e}withNesModelConfiguration(e){let r=t.modelConfigurationStringKey,n=e.get(ze.NESModelConfiguration),o=new Set;if(typeof n=="string"&&n.length>0){let s;try{s=JSON.parse(n)}catch{zFe.warn(this.ctx,"ignoring malformed nesModelConfiguration"),s=void 0}if(s!==null&&typeof s=="object"){let c=s,l="modelName"in c?{[r]:c}:c;for(let[u,d]of Object.entries(l)){let f=t.stringValuedNesKeys.has(u)&&d!==null&&typeof d=="object"?JSON.stringify(d):d;e.set(u,f),o.add(u)}}}for(let s of this.lastAppliedNesKeys)!o.has(s)&&!e.has(s)&&e.set(s,void 0);return this.lastAppliedNesKeys=o,e}shouldUseExplicitRejection(){return kt(this.ctx,ze.NESUseExplicitRejection)}};function eLc(t){let e=t.requestUuid;return typeof e=="string"&&e.length>0?e:void 0}a(eLc,"readOpportunityId");async function tLc(t,e,r){let n=r.normalizedUri,o=e.targetDocumentUri,s=o!==void 0&&Gs(o)!==n,c=s?o:n,l=await t.textDocumentManager.getTextDocument({uri:c});if(!l)return;let u=l.positionAt(e.range.start),d=l.positionAt(e.range.endExclusive);return{textDocument:{uri:l.uri,version:s?l.version:r.version},range:{start:u,end:d},document:l,isCrossFile:s}}a(tLc,"resolveNextEditTarget");function rLc(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){Ma(t,o,"nesProvider.setDisposalReason")}}a(rLc,"trySetChatLibDisposalReason");var g8r=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new gzi.Emitter;this.onDidCopilotTokenRefresh=this.didChangeTokenResult.event;this._ctx.get(Qt).onDidChangeTokenResult(()=>{this.didChangeTokenResult.fire()})}static{a(this,"CopilotTokenManagerAdapter")}async getCopilotToken(e){let r=this._ctx.get(Qt);e&&r.resetToken("nes_force_refresh");let n=await r.getToken(),o=await this._ctx.get(Or).resolveSession();return eIt(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Qt).resetToken("nes",e)}},VFe=class{constructor(e){this._delegate=e}static{a(this,"FetcherAdapter")}getUserAgentLibrary(){return this._delegate.name}async fetch(e,r){let n={headers:r.headers,body:r.body,timeout:r.timeout,json:r.json,method:r.method,signal:r.signal},o=await this._delegate.fetch(e,n),s=o.body(),c=null;return s&&(s instanceof m8r.Readable?c=m8r.Readable.toWeb(s):c=s),new hzi.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},Dt(),new URL(e).hostname)}fetcherId(){switch(this._delegate.name){case"EditorFetcher":case"ElectronFetcher":return"electron-fetch";case"FetchFetcher":case"NodeFetchFetcher":return"node-fetch";case"FakeFetcher":return"test-stub";default:return"helix-fetch"}}async disconnectAll(){return this._delegate.disconnectAll()}makeAbortController(){return new AbortController}isAbortError(e){return e&&e.name==="AbortError"}isInternetDisconnectedError(e){return!1}isFetcherError(e){return wx(e)}isNetworkProcessCrashedError(e){return!1}getUserMessageForFetcherError(e){return`Fetcher error: ${e.message}`}async fetchWithPagination(e,r){let n=[],o=r.pageSize??20,s=r.startPage??1,c=!1;do{let l=r.buildUrl(e,o,s),u=await this.fetch(l,r);if(!u.ok)return n;let d=await u.json(),f=r.getItemsFromResponse(d);n.push(...f),c=f.length===o,s++}while(c);return n}};var nLc="github.copilot.didAcceptNextEditSuggestionItem",A8r=class extends LR{constructor(){super(...arguments);this.name=nLc;this.arguments=b.Tuple([b.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(fC).handleAcceptance(n),!0}},iLc="github.copilot.didRejectNextEditSuggestionItem",y8r=class extends LR{constructor(){super(...arguments);this.name=iLc;this.arguments=b.Tuple([b.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(fC).handleRejection(n),!0}},oLc="github.copilot.didIgnoreNextEditSuggestionItem",_8r=class extends LR{constructor(){super(...arguments);this.name=oLc;this.arguments=b.Tuple([b.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(fC).handleIgnored(n),!0}},Azi=[A8r,y8r,_8r];p();var v8r="github.copilot.didAcceptPanelCompletionItem",E8r=class extends LR{constructor(){super(...arguments);this.name=v8r;this.arguments=b.Tuple([b.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(Fu).get(o);return c?(_Oe(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:OG(c.displayText)},c.copilotAnnotations),!0):!1}},yzi=[E8r];var sLc=[...Bli,...Fli,...Azi,...yzi];function _zi(t,e){let r=new Map;for(let n of sLc){let o=new n(t),s=Zu.Compile(o.arguments);r.set(o.name,{typeCheck:s,command:o})}return e.onExecuteCommand((n,o)=>{let s=r.get(n.command);if(!s)throw new Error(`Unknown command: ${n.command}`);let c=n9(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Ir).getEditorPluginInfo();await e.get(Un).update("versions",r.name,r.version)}wasPreviouslyInstalled(e){return Promise.resolve(!1)}async isNewUpgrade(e){try{let r=e.get(Ir).getEditorPluginInfo(),n=await e.get(Un).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,YFe.gt)((0,YFe.coerce)(r.version),(0,YFe.coerce)(n))}catch{return!1}}async markUpgraded(e){await this.markInstalled(e)}async uninstall(e){await super.uninstall(e);let r=e.get(Ir).getEditorPluginInfo();await e.get(Un).delete("versions",r.name),(await e.get(Un).listKeys("versions")).length===0&&await e.get(Un).deleteSetting("versions")}};p();var Szi=fe(pl()),Tzi=require("crypto"),sIt=fe(require("path")),jEe=fe(Wc());var lLc={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},uLc=new jEe.ProgressType,eM=class t{constructor(e){this.ctx=e;this.#e=new Ji;this._changeHandlerLimiter=new Szi.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new jEe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(er).connection}init(){this.ctx.get(Nn).getCapabilities().watchedFiles&&this.connection.onNotification(jEe.DidChangeWatchedFilesNotification.type,r=>{if("workspaceUri"in r&&typeof r.workspaceUri=="string"){let n=r;this._changeHandlerLimiter.queue(()=>this.didChangeWatchedFilesHandler(n))}})}async getWatchedFiles(e){if(!this.ctx.get(Nn).getCapabilities().watchedFiles)return lLc;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(Nn).getCapabilities().watchedFiles)return[];let n=await this.fetchWatchedFileEntries(e),o=[],s=new Set;for(let c of n){let l=typeof c=="string"?c:c?.uri;if(!l||s.has(l))continue;s.add(l);let u=sIt.extname(l).toLowerCase();nq.includes(u)&&o.push({uri:l})}return o}async didChangeWatchedFilesHandler(e){let r=[],n=[],o=[];for(let s of e.changes){let c=s.uri,l={uri:c,isRestricted:!1,isUnknownFileExtension:!1},u=sIt.extname(s.uri).toLowerCase();if(!nq.includes(u))l.isUnknownFileExtension=!0;else{let d=await this.resolveWatchedDocument(c);d===void 0?l.isRestricted=!0:l.document=d}switch(s.type){case 1:n.push(l);break;case 2:r.push(l);break;case 3:o.push(l);break}}this.#e.fire({workspaceFolder:{uri:e.workspaceUri},created:n,changed:r,deleted:o})}async resolveWatchedDocument(e){return this.ctx.get(pc).enabled?this.getValidDocument(e):iT.create(e,"UNKNOWN",-1,"")}async getValidDocument(e){let n=await this.ctx.get(si).getOrReadTextDocument({uri:e});return n.status==="valid"?n.document:void 0}async fetchWatchedFileEntries(e){let r=e.partialResultToken??(0,Tzi.randomUUID)(),n=[],o=this.connection.onProgress(uLc,r,s=>{s?.files?.length&&n.push(...s.files)});try{let s=await this.connection.sendRequest(t.requestType,{...e,partialResultToken:r});Array.isArray(s.files)&&n.push(...s.files)}finally{o.dispose()}return n}async buildWatchedFilesResponse(e){let r=[],n=[],o=[],s=new Set;for(let c of e){let l=typeof c=="string"?c:c?.uri;if(!l||s.has(l))continue;s.add(l);let u=sIt.extname(l).toLowerCase();if(!nq.includes(u)){o.push({uri:l});continue}let d=await this.getValidDocument(l);if(d===void 0){n.push({uri:l});continue}r.push(d)}return{watchedFiles:r,contentRestrictedFiles:n,unknownFileExtensions:o}}};p();var dLc=new pe("mcpGateway.projectCleanup"),Zie=class{constructor(e){this._dispose=e}static{a(this,"McpProjectCleanupSubscription")}dispose(){this._dispose()}};function Izi(t){let e=t.get($r),r=t.get(gy),n=e.onDidChangeWorkspaceFolders(o=>{if(o.removed.length!==0)for(let s of o.removed)r.removeProject(s.uri).catch(c=>{dLc.warn(t,"removeProject failed during workspace-folder cleanup",{workspaceFolder:s.uri,error:c instanceof Error?c.message:String(c)})})});return new Zie(()=>n.dispose())}a(Izi,"installMcpProjectCleanup");p();p();p();p();p();var wzi=require("crypto");var fLc=new pe("CloudAgentLogParser"),pLc=new Set(["run_setup","run_custom_setup_step"]),aIt=class{constructor(){this.counter=0}static{a(this,"CloudAgentIdSource")}next(){return++this.counter}};function tM(t){if(t!=null)return typeof t=="string"?t:JSON.stringify(t)}a(tM,"asString");function hLc(t){return typeof t=="number"&&Number.isFinite(t)?new Date(t*1e3).toISOString():new Date().toISOString()}a(hLc,"chunkTimestamp");function HEe(t,e,r){return{id:(0,wzi.randomUUID)(),timestamp:r,parentId:null,type:t,data:e}}a(HEe,"event");function cIt(t,e,r){if(!e||e.trim().length===0)return[];let n=[];return yLc(t,e,o=>{let s=hLc(o.created),c=o.choices;if(Array.isArray(c))for(let l of c){if(!l||typeof l!="object")continue;let u=l,d=u.delta;!d||typeof d!="object"||tM(d.role)==="assistant"&&mLc(d,u,n,r,s)}}),n}a(cIt,"parseCloudAgentLogs");function mLc(t,e,r,n,o){let s=t.tool_calls,c=Array.isArray(s)&&s.length>0?s:void 0,l=tM(t.content),u=tM(e.finish_reason);if(u==="tool_calls"&&c){let m=c[0],g=m.function,A=tM(g?.name);if(A&&pLc.has(A)){if(l&&l.trim().length>0){let y=xzi(tM(g?.arguments)),_=tM(y?.name)??l,E=tM(m.id)??`setup-${_}`;Rzi(r,E,A,{name:_},_,o)}return}}let d=l?.trimStart(),f=d?.startsWith("")===!0,h=d&&!d.startsWith("")&&!d.startsWith("")?d.trim():"";if(c){for(let m of c){let g=m,A=g.function,y=tM(A?.name);if(!y)continue;let _=xzi(tM(A?.arguments));gLc(r,g,y,l,_,n,o)}if(f){let m=(l??"").replace(/^\s*\s*/i,"").replace(/\s*<\/error>\s*$/i,"").trim(),g=`command-error-${n.next()}`;r.push(HEe("tool.execution_start",{toolCallId:g,toolName:"command",arguments:{}},o)),r.push(HEe("tool.execution_complete",{toolCallId:g,success:!1,error:{message:m.length>0?m:"Command failed"}},o))}return}h.length>0&&(u==="stop"?r.push(ALc(h,n,o)):r.push(kzi(h,n,o)))}a(mLc,"processAssistantDelta");function gLc(t,e,r,n,o,s,c){if(r==="reply_to_comment")return;let l=tM(e.id);if(!l)return;if(r==="think"){let d=tM(o?.thought)??n;d&&d.trim().length>0&&t.push(kzi(d,s,c));return}let u=n?.trim();Rzi(t,l,r,o,u&&u.length>0?u:void 0,c)}a(gLc,"appendToolPart");function Rzi(t,e,r,n,o,s){t.push(HEe("tool.execution_start",{toolCallId:e,toolName:r,arguments:n??{}},s)),t.push(HEe("tool.execution_complete",{toolCallId:e,success:!0,result:{content:o??""}},s))}a(Rzi,"pushToolCall");function ALc(t,e,r){return HEe("assistant.message",{messageId:`cloud-text-${e.next()}`,content:t},r)}a(ALc,"textEvent");function kzi(t,e,r){return HEe("assistant.reasoning",{reasoningId:`cloud-reasoning-${e.next()}`,content:t},r)}a(kzi,"reasoningEvent");function xzi(t){if(!(!t||t.trim().length===0))try{let e=JSON.parse(t);return e&&typeof e=="object"?e:void 0}catch{return}}a(xzi,"parseArguments");function yLc(t,e,r){for(let n of e.split(/\r?\n/)){let o=n.trimStart();if(!o.startsWith("data:"))continue;let s=o.slice(5).trim();if(s.length===0)continue;let c;try{c=JSON.parse(s)}catch{fLc.debug(t,"parseCloudAgentLogs: skipping malformed SSE data chunk",{data:s});continue}c&&typeof c=="object"&&r(c)}}a(yLc,"forEachDataChunk");p();var lIt=require("crypto");var Xie=new pe("CloudAgentSession"),eoe="CloudAgentSession",b8r="cloud:",_Lc="github.pull_request_card";function S8r(t,e){let r=e?new Date(e):null,n=r&&!isNaN(r.getTime())?r.toISOString():new Date().toISOString();return{id:(0,lIt.randomUUID)(),timestamp:n,parentId:null,type:_Lc,data:{number:t.number,title:t.title?.trim()||`Pull request #${t.number}`,body:t.body?.trim()||null,htmlUrl:t.html_url}}}a(S8r,"buildCloudPullRequestCardEvent");function T8r(t,e,r){return`${b8r}${t}/${e}#${r}`}a(T8r,"buildCloudSessionId");function I8r(t){if(!t.startsWith(b8r))return;let e=t.slice(b8r.length),r=e.lastIndexOf("#");if(r<=0||r===e.length-1)return;let n=e.slice(0,r),o=e.slice(r+1),s=n.indexOf("/");if(s<=0||s===n.length-1)return;let c=n.slice(0,s),l=n.slice(s+1),u=Number(o);if(Number.isInteger(u)&&u>0)return{owner:c,repo:l,pullRequestNumber:u}}a(I8r,"parseCloudSessionId");var pB={InProgress:"in_progress",Queued:"queued",Completed:"completed",Failed:"failed"},C8r=3e3,ELc=120*1e3,vLc=300*1e3,Pzi=10,uIt=class{constructor(e,r,n,o){this.ctx=e;this.notificationSender=r;this.client=n;this._ids=new aIt;this.localSessionId=o.localSessionId,this.workspaceFolder=o.workspaceFolder,this._cwd=un(o.workspaceFolder.uri),this._pullRequest=o.pullRequest}static{a(this,"CloudAgentSession")}get cwd(){return this._cwd}get pullRequest(){return this._pullRequest}get idSource(){return this._ids}get hasPullRequest(){return this._pullRequest!==void 0}updatePullRequest(e){this._pullRequest=e}async startInitialJob(e){let n=this.resetCancellation().token;try{let{owner:o,name:s,baseRef:c}=await this.resolveRepo(n),l=dde(e),u=await this.client.createCodingTask(l,e,o,s,c,n);if(n.isCancellationRequested)return{stream:Promise.resolve()};let d=u.pullRequest;return this._pullRequest=d,this.emit(S8r(d)),Xie.info(this.ctx,`${eoe}.startInitialJob: job created`,{localSessionId:this.localSessionId,pullRequestNumber:d.number,cloudSessionId:u.sessionId}),{stream:this.streamSessionSafe(u.sessionId,0,void 0,n)}}catch(o){if(n.isCancellationRequested||Mwe(o))return{stream:Promise.resolve()};throw o}}async submitFollowUp(e){let r=this._pullRequest;if(!r)throw new Error("submitFollowUp called before a pull request was created");let o=this.resetCancellation().token,s=await this.snapshotSessionIds(r.id,o);if(o.isCancellationRequested)return{stream:Promise.resolve()};await new gm(this.ctx).addPullRequestComment(r.repository.owner.login,r.repository.name,r.number,`@copilot ${e}`);let l=await this.waitForNewSession(r.id,s,o);return o.isCancellationRequested?{stream:Promise.resolve()}:l?{stream:this.streamSessionSafe(l,0,void 0,o)}:(this.emitError("Timed out waiting for the cloud agent to start a new session."),{stream:Promise.resolve()})}resumeStreaming(e){let r=this.resetCancellation();return{stream:this.streamSessionSafe(e.cloudSessionId,e.initialLogLength,e.state,r.token)}}async streamSessionSafe(e,r,n,o){try{await this.streamSession(e,r,n,o)}catch(s){if(o.isCancellationRequested)return;this.emitError(this.errorMessage(s)||"Cloud agent session stream failed")}}stop(){this._cts?.cancel(),this._cts?.dispose(),this._cts=void 0}stopByUser(){this.stop(),this.emitIdle()}async streamSession(e,r,n,o){if(this.emit(this.event("assistant.turn_start",{turnId:(0,lIt.randomUUID)(),interactionId:this.localSessionId})),n!==pB.InProgress){let s=await this.waitForInProgress(e,o);if(o.isCancellationRequested)return;switch(s?.state){case pB.InProgress:break;case pB.Failed:this.emitError(s.error?.message??"The cloud agent session failed.");return;case pB.Completed:this.emitIdle();return;default:this.emitError("The cloud agent session did not start in time.");return}}await this.streamSessionLogs(e,r,o)}async waitForInProgress(e,r){let n=Date.now()+ELc;for(;!r.isCancellationRequested&&Date.now()=Pzi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}if(!c){Xie.warn(this.ctx,`${eoe}.streamSessionLogs: session no longer in list; stopping`,{cloudSessionId:e}),this.emitIdle();return}let l;try{l=await this.client.getSessionLogs(e,n)}catch(f){if(Xie.warn(this.ctx,`${eoe}.streamSessionLogs: log fetch failed; will retry`,{cloudSessionId:e,error:this.errorMessage(f)}),++s>=Pzi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}s=0;let u=c.state,d=u!==pB.InProgress&&u!==pB.Queued;if(l.length>o){let f=l.slice(o);o=l.length;let h=cIt(this.ctx,f,this._ids);for(let m of h)this.emit(m)}if(d){u===pB.Failed?this.emitError(c.error?.message??"The cloud agent session failed."):this.emitIdle();return}}}async waitForNewSession(e,r,n){let o=Date.now()+vLc;for(;!n.isCancellationRequested&&Date.now()!r.has(l.id)).sort((l,u)=>new Date(u.created_at).getTime()-new Date(l.created_at).getTime())[0];if(c)return c.id}await this.delay(C8r,n)}}async snapshotSessionIds(e,r){let n=await this.client.getAllSessions(e,r);return new Set((n??[]).map(o=>o.id))}async getSessionInfo(e,r){let n=this._pullRequest;return n?(await this.client.getAllSessions(n.id,r)??[]).find(s=>s.id===e):void 0}async resolveRepo(e){let r={uri:this.workspaceFolder.uri},o=await new Pf(this.ctx).getRepo(r);if(!o||!o.isGitHub())throw new Error("No GitHub repository found in the workspace folder.");if(!o.owner||!o.name)throw new Error("Could not determine repository owner and name.");let c=await new f5([new p5,new h5]).getBranchInfo(this.ctx,r);if(!c?.currentBranch||c.isDetachedHead)throw new Error("No current branch found or detached HEAD state \u2014 cannot create a cloud agent job.");if(e.isCancellationRequested)throw new Error("Request was cancelled");return{owner:o.owner,name:o.name,baseRef:c.currentBranch}}emit(e){this.notificationSender.sendBackgroundAgentSessionUpdate(this.localSessionId,e,"CLOUD").catch(r=>{Xie.warn(this.ctx,`${eoe}.emit: failed to send session update`,{localSessionId:this.localSessionId,error:this.errorMessage(r)})})}emitIdle(){this.emit(this.event("session.idle",{}))}emitError(e){this.emit(this.event("session.error",{errorType:"cloudAgent",message:e})),this.emitIdle()}event(e,r){return{id:(0,lIt.randomUUID)(),timestamp:new Date().toISOString(),parentId:null,type:e,data:r}}resetCancellation(){this.stop();let e=new jn.CancellationTokenSource;return this._cts=e,e}delay(e,r){return new Promise(n=>{let o=setTimeout(()=>{s?.dispose(),n()},e),s=r.onCancellationRequested(()=>{clearTimeout(o),s?.dispose(),n()})})}errorMessage(e){return e instanceof Error?e.message:String(e)}};p();var GEe=new pe("GitHubGraphQLClient"),$Ee=class{constructor(e){this.ctx=e;this.graphqlClient=null}static{a(this,"GitHubGraphQLClient")}async getGraphQLClient(){if(this.graphqlClient)return this.graphqlClient;let e=await this.getApiSession(),r=this.ctx.get(Jt);return this.graphqlClient=rxn.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){GEe.debug(this.ctx,`Searching pull requests with query: ${e}`);let r=await this.getGraphQLClient();try{let n=[],o=null,s=!0,c=0;for(;s;){c++,GEe.debug(this.ctx,`Fetching page ${c} of pull requests search results`);let u=await r(` query searchPullRequests($searchQuery: String!, $cursor: String) { search(query: $searchQuery, type: ISSUE, first: 100, after: $cursor) { nodes { @@ -3982,25 +3982,25 @@ ${d.toFixed(2)} ${u}`).join("")??"";return aft.debug(t,`ghostText produced from } } } - `,{ids:l});for(let f of d.nodes)!f||typeof f.number!="number"||!f.id||r.set(f.id,this.toPullRequestItem(f))}return r}catch(c){if(GEe.error(this.ctx,"Failed to fetch pull requests by global ids:",c),c&&typeof c=="object"&&"status"in c){let l=c;throw new fd(l.status,l.message||"GitHub GraphQL API failed")}throw c}}toPullRequestItem(e){return{id:e.fullDatabaseId,number:e.number,title:e.title,user:e.author,html_url:e.url,draft:e.isDraft,body:e.body,updated_at:e.updatedAt,repository:e.repository}}async getApiSession(){let e=await this.ctx.get(Fr).resolveSession();if(!e)throw new x_;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var kzi=require("crypto");Fo();var $S=new pe("CloudAgent"),VS="CloudAgentService";function ELc(){return{id:"cloud-agent-auto",name:"Auto",preview:!1,capabilities:{family:"auto",supports:{vision:!0},limits:{max_context_window_tokens:0}}}}a(ELc,"buildCloudAutoModel");var eoe=class{constructor(e){this.ctx=e;this._sessions=new Map;this._pullRequestSessionId=new Map;this.notificationSender=e.get(ss),this.client=new fb(e)}static{a(this,"CloudAgentService")}async createSession(e){return Ch(this.ctx,"cloudAgent.createSession",async r=>{let n=e.sessionId??Dt(),o=this._sessions.has(n),s=await this.getOrCreateSession(n,e.workspaceFolder);return r.properties.reason=o?"cached":"created",{sessionId:n,workspacePath:s.cwd}})}async resumeSession(e){return Ch(this.ctx,"cloudAgent.resumeSession",async r=>{r.measurements.eventCount=0;let n=this.findReusableSession(e.sessionId);r.properties.reason=n?"cached":"resolved",r.properties.hasPullRequest="false";let o=n??await this.createAndCacheSession(e.sessionId,e.workspaceFolder),s=o.localSessionId;if(r.properties.hasPullRequest=String(!!o.pullRequest),!o.pullRequest)return{sessionId:s,workspacePath:o.cwd,events:[]};let{events:c,streamStatus:l}=await this.loadSessionHistory(o.pullRequest,o.idSource);if(l&&(r.properties.streamState=l.state),r.measurements.eventCount=c.length,l&&(l.state==="in_progress"||l.state==="queued")){let{stream:u}=o.resumeStreaming(l),d=performance.now();u.catch(f=>{$S.warn(this.ctx,`${VS}.resumeSession: stream failed`,{sessionId:s,error:f instanceof Error?f.message:String(f)}),zp(this.ctx,"cloudAgent.resumeSession.failure",f,{success:"false",reason:"stream",hasPullRequest:"true",streamState:l.state},{totalTimeMs:performance.now()-d,eventCount:c.length})})}return $S.info(this.ctx,`${VS}.resumeSession`,{sessionId:s,pullRequestNumber:o.pullRequest.number,events:c.length}),{sessionId:s,workspacePath:o.cwd,events:c,status:l?.state}})}async sendMessage(e,r){return Ch(this.ctx,"cloudAgent.sendMessage",async n=>{n.measurements.messageCharLen=e.message.length;let o=this._sessions.get(e.sessionId);if(!o)throw n.properties.reason="unknownSession",new Error(`Cannot start cloud session ${e.sessionId}: session was not created or resumed first.`);let s=Dt(),c=o.hasPullRequest;n.properties.reason=c?"followUp":"initial";let{stream:l}=c?await o.submitFollowUp(e.message):await o.startInitialJob(e.message);o.pullRequest&&this._pullRequestSessionId.set(this.sessionIdForPullRequest(o.pullRequest),o.localSessionId);let u=performance.now();return l.catch(d=>{$S.warn(this.ctx,`${VS}.sendMessage: turn failed`,{sessionId:e.sessionId,isFollowUp:c,error:d instanceof Error?d.message:String(d)}),zp(this.ctx,"cloudAgent.sendMessage.failure",d,{success:"false",reason:"stream"},{totalTimeMs:performance.now()-u,messageCharLen:e.message.length})}),{messageId:s}})}async stopSession(e){await Ch(this.ctx,"cloudAgent.stopSession",r=>{let n=this._sessions.get(e);if(!n){$S.warn(this.ctx,`${VS}.stopSession: unknown session`,{sessionId:e}),r.ok=!1,r.properties.reason="unknownSession";return}n.stopByUser(),r.properties.reason="stopped",$S.info(this.ctx,`${VS}.stopSession`,{sessionId:e})})}destroySession(e){return Promise.reject(this.unsupported("destroySession"))}async listSessions(e){return Ch(this.ctx,"cloudAgent.listSessions",async r=>{r.measurements.cloudSessionCount=0;let n=e?.cwd;if(!n)return $S.warn(this.ctx,`${VS}.listSessions: missing cwd in params`),r.ok=!1,r.properties.reason="missingCwd",r.measurements.count=0,{sessions:[]};try{let o=await this.ctx.get(Pf).getRepo({uri:this.toWorkspaceUri(n)});if(!o||!o.isGitHub()||!o.owner||!o.name)return $S.warn(this.ctx,`${VS}.listSessions: workspace is not a GitHub repo`),r.ok=!1,r.properties.reason="notGitHubRepo",r.measurements.count=0,{sessions:[]};let s=`${o.owner}/${o.name}`,c=await this.client.getRepoSessions(s);r.measurements.cloudSessionCount=c.length;let l=new Map;for(let h of c){let m=l.get(h.resource_id);(!m||new Date(h.created_at).getTime()>new Date(m.created_at).getTime())&&l.set(h.resource_id,h)}let u=Array.from(new Set(Array.from(l.values()).map(h=>h.resource_global_id).filter(h=>!!h))),d=await new $Ee(this.ctx).getPullRequestsFromGlobalIds(u),f=[];for(let h of l.values()){if(!h.resource_global_id){$S.warn(this.ctx,`${VS}.listSessions: session has no resource_global_id`,{cloudSessionId:h.id,resourceId:h.resource_id});continue}let m=d.get(h.resource_global_id);if(!m){$S.warn(this.ctx,`${VS}.listSessions: pull request not found`,{cloudSessionId:h.id,resourceId:h.resource_id});continue}let g=this.ensurePullRequestSession(m,n);f.push({sessionId:g,summary:m.title,startTime:this.toIsoString(h.created_at),modifiedTime:this.toIsoString(h.last_updated_at),status:h.state,isRemote:!1})}return $S.info(this.ctx,`${VS}.listSessions: success`,{nwo:s,count:f.length}),r.properties.reason="listed",r.measurements.count=f.length,{sessions:f}}catch(o){return $S.warn(this.ctx,`${VS}.listSessions: failed`,{error:o instanceof Error?o.message:String(o)}),r.error=o,r.properties.reason="exception",r.measurements.count=0,{sessions:[]}}})}listModels(e){return Ch(this.ctx,"cloudAgent.listModels",r=>{let n=[ELc()];return r.measurements.count=n.length,{models:n}})}toWorkspaceUri(e){return/^[A-Za-z][A-Za-z0-9+.-]+:/.test(e)?e:Ko(e)}createCloudSession(e,r,n){return new lIt(this.ctx,this.notificationSender,this.client,{localSessionId:e,workspaceFolder:r,pullRequest:n})}ensurePullRequestSession(e,r){let n=this.sessionIdForPullRequest(e),o=this.cachedSessionForCanonicalId(n);if(o)return o.updatePullRequest(e),o.localSessionId;let s=this.createCloudSession(n,{uri:r},e);return this._sessions.set(n,s),this._pullRequestSessionId.set(n,n),n}cachedSessionForCanonicalId(e){let r=this._pullRequestSessionId.get(e)??e;return this._sessions.get(r)}findReusableSession(e){let r=this._sessions.get(e);if(r)return r;let n=T8r(e);if(n)return this.cachedSessionForCanonicalId(S8r(n.owner,n.repo,n.pullRequestNumber))}sessionIdForPullRequest(e){return S8r(e.repository.owner.login,e.repository.name,e.number)}async getOrCreateSession(e,r){return this._sessions.get(e)??await this.createAndCacheSession(e,r)}async createAndCacheSession(e,r){let n=await this.resolvePullRequest(e),o=this.createCloudSession(e,r,n);return this._sessions.set(e,o),n&&this._pullRequestSessionId.set(this.sessionIdForPullRequest(n),e),o}async loadSessionHistory(e,r){let o=(await this.client.getAllSessions(e.id)??[]).slice().sort((u,d)=>new Date(u.created_at).getTime()-new Date(d.created_at).getTime()),s=[],c,l=0;for(let u of o){let d=u.event_content?.trim()||u.name?.trim()||e.title;d?s.push(this.userMessageEvent(d,u.created_at)):$S.warn(this.ctx,`${VS}.loadSessionHistory: session has no prompt`,{cloudSessionId:u.id,pullRequestNumber:e.number}),l===0&&s.push(b8r(e,u.created_at)),l++;let f;try{f=await this.client.getSessionLogs(u.id)}catch(h){$S.warn(this.ctx,`${VS}.loadSessionHistory: log fetch failed`,{cloudSessionId:u.id,error:h instanceof Error?h.message:String(h)});continue}s.push(...aIt(this.ctx,f,r)),c={cloudSessionId:u.id,initialLogLength:f.length,state:u.state}}return{events:s,streamStatus:c}}userMessageEvent(e,r){let n=new Date(r),o=isNaN(n.getTime())?new Date().toISOString():n.toISOString();return{id:(0,kzi.randomUUID)(),timestamp:o,parentId:null,type:"user.message",data:{content:e}}}toIsoString(e){let r=new Date(e);return isNaN(r.getTime())?new Date().toISOString():r.toISOString()}async resolvePullRequest(e){let r=T8r(e);if(r)try{return await new gm(this.ctx).getPullRequest(r.owner,r.repo,r.pullRequestNumber)}catch(n){$S.warn(this.ctx,`${VS}.resolvePullRequest: failed`,{sessionId:e,error:n instanceof Error?n.message:String(n)});return}}unsupported(e){return new Error(`${e} is not supported by CloudAgentService`)}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}forkSession(e){return Promise.reject(this.unsupported("forkSession"))}handleInteraction(e){return Promise.resolve({success:!1})}getPlanPath(e){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(e){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(e){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(e){throw this.unsupported("getRemoteStatus")}compactHistory(e){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(e){return Promise.reject(this.unsupported("stopCompactHistory"))}};p();p();var Pzi=require("node:child_process"),Dzi=require("node:events"),I8r=fe(require("node:readline"));var HI=new pe("CodexProcessManager"),uIt=class extends Dzi.EventEmitter{constructor(r,n,o,s){super();this.ctx=r;this.codexPath=n;this.proxyPort=o;this.cwd=s;this.rpcId=0;this.pendingRequests=new Map;this.notificationHandlers=[];this.serverRequestHandlers=new Map;this.stopping=!1}static{a(this,"CodexProcessManager")}start(){if(this.process)return;this.stopping=!1;let r=this.codexPath,n=["app-server","-c",'model_provider="copilot"',"-c",'model_providers.copilot.name="copilot"',"-c",`model_providers.copilot.base_url="http://127.0.0.1:${this.proxyPort}/v1"`,"-c",'model_providers.copilot.wire_api="responses"',"-c",'sandbox_permissions=["disk-full-read-access","disk-write-cwd","disk-write-platform-user-temp","network-full-access"]',"-c","features.default_mode_request_user_input = true"];HI.debug(this.ctx,`start: cmd=${r} args=${JSON.stringify(n)} cwd=${this.cwd}`);try{this.process=(0,Pzi.spawn)(r,n,{env:{...process.env,OPENAI_API_KEY:"copilot-proxy"},stdio:["pipe","pipe","pipe"],cwd:this.cwd||void 0}),HI.debug(this.ctx,`start: spawn succeeded, pid=${this.process.pid}`)}catch(o){let s=o instanceof Error?o.message:String(o);throw HI.error(this.ctx,`start: spawn failed: ${s}`),new Error(`Failed to spawn codex app-server: ${s}`)}this.process.on("error",o=>{HI.error(this.ctx,`process error event: ${o.message}`),this.handleProcessExit(-1)}),this.process.on("exit",o=>{HI.debug(this.ctx,`process exit event: code=${o}`),this.handleProcessExit(o??-1)}),this.process.stdout&&(this.rl=I8r.default.createInterface({input:this.process.stdout}),this.rl.on("line",o=>this.handleLine(o))),this.process.stderr&&I8r.default.createInterface({input:this.process.stderr}).on("line",s=>{HI.debug(this.ctx,`CodexProcessManager [stderr]: ${s}`)})}async stop(){if(this.stopping=!0,!this.process)return;this.rejectAllPending(new Error("Process stopping")),this.process.kill("SIGTERM");let r=setTimeout(()=>{this.process&&!this.process.killed&&this.process.kill("SIGKILL")},5e3);await new Promise(n=>{if(!this.process){n();return}this.process.on("exit",()=>{clearTimeout(r),n()})}),this.process=void 0,this.rl=void 0}sendRequest(r,n){if(!this.process?.stdin)return Promise.reject(new Error("Codex process not running"));let o=++this.rpcId,s=JSON.stringify({jsonrpc:"2.0",id:o,method:r,params:n??{}});return this.process.stdin.write(s+` + `,{ids:l});for(let f of d.nodes)!f||typeof f.number!="number"||!f.id||r.set(f.id,this.toPullRequestItem(f))}return r}catch(c){if(GEe.error(this.ctx,"Failed to fetch pull requests by global ids:",c),c&&typeof c=="object"&&"status"in c){let l=c;throw new fd(l.status,l.message||"GitHub GraphQL API failed")}throw c}}toPullRequestItem(e){return{id:e.fullDatabaseId,number:e.number,title:e.title,user:e.author,html_url:e.url,draft:e.isDraft,body:e.body,updated_at:e.updatedAt,repository:e.repository}}async getApiSession(){let e=await this.ctx.get(Or).resolveSession();if(!e)throw new x_;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var Dzi=require("crypto");Fo();var $S=new pe("CloudAgent"),VS="CloudAgentService";function CLc(){return{id:"cloud-agent-auto",name:"Auto",preview:!1,capabilities:{family:"auto",supports:{vision:!0},limits:{max_context_window_tokens:0}}}}a(CLc,"buildCloudAutoModel");var toe=class{constructor(e){this.ctx=e;this._sessions=new Map;this._pullRequestSessionId=new Map;this.notificationSender=e.get(ss),this.client=new fb(e)}static{a(this,"CloudAgentService")}async createSession(e){return Ch(this.ctx,"cloudAgent.createSession",async r=>{let n=e.sessionId??Dt(),o=this._sessions.has(n),s=await this.getOrCreateSession(n,e.workspaceFolder);return r.properties.reason=o?"cached":"created",{sessionId:n,workspacePath:s.cwd}})}async resumeSession(e){return Ch(this.ctx,"cloudAgent.resumeSession",async r=>{r.measurements.eventCount=0;let n=this.findReusableSession(e.sessionId);r.properties.reason=n?"cached":"resolved",r.properties.hasPullRequest="false";let o=n??await this.createAndCacheSession(e.sessionId,e.workspaceFolder),s=o.localSessionId;if(r.properties.hasPullRequest=String(!!o.pullRequest),!o.pullRequest)return{sessionId:s,workspacePath:o.cwd,events:[]};let{events:c,streamStatus:l}=await this.loadSessionHistory(o.pullRequest,o.idSource);if(l&&(r.properties.streamState=l.state),r.measurements.eventCount=c.length,l&&(l.state==="in_progress"||l.state==="queued")){let{stream:u}=o.resumeStreaming(l),d=performance.now();u.catch(f=>{$S.warn(this.ctx,`${VS}.resumeSession: stream failed`,{sessionId:s,error:f instanceof Error?f.message:String(f)}),zp(this.ctx,"cloudAgent.resumeSession.failure",f,{success:"false",reason:"stream",hasPullRequest:"true",streamState:l.state},{totalTimeMs:performance.now()-d,eventCount:c.length})})}return $S.info(this.ctx,`${VS}.resumeSession`,{sessionId:s,pullRequestNumber:o.pullRequest.number,events:c.length}),{sessionId:s,workspacePath:o.cwd,events:c,status:l?.state}})}async sendMessage(e,r){return Ch(this.ctx,"cloudAgent.sendMessage",async n=>{n.measurements.messageCharLen=e.message.length;let o=this._sessions.get(e.sessionId);if(!o)throw n.properties.reason="unknownSession",new Error(`Cannot start cloud session ${e.sessionId}: session was not created or resumed first.`);let s=Dt(),c=o.hasPullRequest;n.properties.reason=c?"followUp":"initial";let{stream:l}=c?await o.submitFollowUp(e.message):await o.startInitialJob(e.message);o.pullRequest&&this._pullRequestSessionId.set(this.sessionIdForPullRequest(o.pullRequest),o.localSessionId);let u=performance.now();return l.catch(d=>{$S.warn(this.ctx,`${VS}.sendMessage: turn failed`,{sessionId:e.sessionId,isFollowUp:c,error:d instanceof Error?d.message:String(d)}),zp(this.ctx,"cloudAgent.sendMessage.failure",d,{success:"false",reason:"stream"},{totalTimeMs:performance.now()-u,messageCharLen:e.message.length})}),{messageId:s}})}async stopSession(e){await Ch(this.ctx,"cloudAgent.stopSession",r=>{let n=this._sessions.get(e);if(!n){$S.warn(this.ctx,`${VS}.stopSession: unknown session`,{sessionId:e}),r.ok=!1,r.properties.reason="unknownSession";return}n.stopByUser(),r.properties.reason="stopped",$S.info(this.ctx,`${VS}.stopSession`,{sessionId:e})})}destroySession(e){return Promise.reject(this.unsupported("destroySession"))}async listSessions(e){return Ch(this.ctx,"cloudAgent.listSessions",async r=>{r.measurements.cloudSessionCount=0;let n=e?.cwd;if(!n)return $S.warn(this.ctx,`${VS}.listSessions: missing cwd in params`),r.ok=!1,r.properties.reason="missingCwd",r.measurements.count=0,{sessions:[]};try{let o=await this.ctx.get(Pf).getRepo({uri:this.toWorkspaceUri(n)});if(!o||!o.isGitHub()||!o.owner||!o.name)return $S.warn(this.ctx,`${VS}.listSessions: workspace is not a GitHub repo`),r.ok=!1,r.properties.reason="notGitHubRepo",r.measurements.count=0,{sessions:[]};let s=`${o.owner}/${o.name}`,c=await this.client.getRepoSessions(s);r.measurements.cloudSessionCount=c.length;let l=new Map;for(let h of c){let m=l.get(h.resource_id);(!m||new Date(h.created_at).getTime()>new Date(m.created_at).getTime())&&l.set(h.resource_id,h)}let u=Array.from(new Set(Array.from(l.values()).map(h=>h.resource_global_id).filter(h=>!!h))),d=await new $Ee(this.ctx).getPullRequestsFromGlobalIds(u),f=[];for(let h of l.values()){if(!h.resource_global_id){$S.warn(this.ctx,`${VS}.listSessions: session has no resource_global_id`,{cloudSessionId:h.id,resourceId:h.resource_id});continue}let m=d.get(h.resource_global_id);if(!m){$S.warn(this.ctx,`${VS}.listSessions: pull request not found`,{cloudSessionId:h.id,resourceId:h.resource_id});continue}let g=this.ensurePullRequestSession(m,n);f.push({sessionId:g,summary:m.title,startTime:this.toIsoString(h.created_at),modifiedTime:this.toIsoString(h.last_updated_at),status:h.state,isRemote:!1})}return $S.info(this.ctx,`${VS}.listSessions: success`,{nwo:s,count:f.length}),r.properties.reason="listed",r.measurements.count=f.length,{sessions:f}}catch(o){return $S.warn(this.ctx,`${VS}.listSessions: failed`,{error:o instanceof Error?o.message:String(o)}),r.error=o,r.properties.reason="exception",r.measurements.count=0,{sessions:[]}}})}listModels(e){return Ch(this.ctx,"cloudAgent.listModels",r=>{let n=[CLc()];return r.measurements.count=n.length,{models:n}})}toWorkspaceUri(e){return/^[A-Za-z][A-Za-z0-9+.-]+:/.test(e)?e:Ko(e)}createCloudSession(e,r,n){return new uIt(this.ctx,this.notificationSender,this.client,{localSessionId:e,workspaceFolder:r,pullRequest:n})}ensurePullRequestSession(e,r){let n=this.sessionIdForPullRequest(e),o=this.cachedSessionForCanonicalId(n);if(o)return o.updatePullRequest(e),o.localSessionId;let s=this.createCloudSession(n,{uri:r},e);return this._sessions.set(n,s),this._pullRequestSessionId.set(n,n),n}cachedSessionForCanonicalId(e){let r=this._pullRequestSessionId.get(e)??e;return this._sessions.get(r)}findReusableSession(e){let r=this._sessions.get(e);if(r)return r;let n=I8r(e);if(n)return this.cachedSessionForCanonicalId(T8r(n.owner,n.repo,n.pullRequestNumber))}sessionIdForPullRequest(e){return T8r(e.repository.owner.login,e.repository.name,e.number)}async getOrCreateSession(e,r){return this._sessions.get(e)??await this.createAndCacheSession(e,r)}async createAndCacheSession(e,r){let n=await this.resolvePullRequest(e),o=this.createCloudSession(e,r,n);return this._sessions.set(e,o),n&&this._pullRequestSessionId.set(this.sessionIdForPullRequest(n),e),o}async loadSessionHistory(e,r){let o=(await this.client.getAllSessions(e.id)??[]).slice().sort((u,d)=>new Date(u.created_at).getTime()-new Date(d.created_at).getTime()),s=[],c,l=0;for(let u of o){let d=u.event_content?.trim()||u.name?.trim()||e.title;d?s.push(this.userMessageEvent(d,u.created_at)):$S.warn(this.ctx,`${VS}.loadSessionHistory: session has no prompt`,{cloudSessionId:u.id,pullRequestNumber:e.number}),l===0&&s.push(S8r(e,u.created_at)),l++;let f;try{f=await this.client.getSessionLogs(u.id)}catch(h){$S.warn(this.ctx,`${VS}.loadSessionHistory: log fetch failed`,{cloudSessionId:u.id,error:h instanceof Error?h.message:String(h)});continue}s.push(...cIt(this.ctx,f,r)),c={cloudSessionId:u.id,initialLogLength:f.length,state:u.state}}return{events:s,streamStatus:c}}userMessageEvent(e,r){let n=new Date(r),o=isNaN(n.getTime())?new Date().toISOString():n.toISOString();return{id:(0,Dzi.randomUUID)(),timestamp:o,parentId:null,type:"user.message",data:{content:e}}}toIsoString(e){let r=new Date(e);return isNaN(r.getTime())?new Date().toISOString():r.toISOString()}async resolvePullRequest(e){let r=I8r(e);if(r)try{return await new gm(this.ctx).getPullRequest(r.owner,r.repo,r.pullRequestNumber)}catch(n){$S.warn(this.ctx,`${VS}.resolvePullRequest: failed`,{sessionId:e,error:n instanceof Error?n.message:String(n)});return}}unsupported(e){return new Error(`${e} is not supported by CloudAgentService`)}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}forkSession(e){return Promise.reject(this.unsupported("forkSession"))}handleInteraction(e){return Promise.resolve({success:!1})}getPlanPath(e){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(e){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(e){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(e){throw this.unsupported("getRemoteStatus")}compactHistory(e){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(e){return Promise.reject(this.unsupported("stopCompactHistory"))}};p();p();var Nzi=require("node:child_process"),Mzi=require("node:events"),x8r=fe(require("node:readline"));var HI=new pe("CodexProcessManager"),dIt=class extends Mzi.EventEmitter{constructor(r,n,o,s){super();this.ctx=r;this.codexPath=n;this.proxyPort=o;this.cwd=s;this.rpcId=0;this.pendingRequests=new Map;this.notificationHandlers=[];this.serverRequestHandlers=new Map;this.stopping=!1}static{a(this,"CodexProcessManager")}start(){if(this.process)return;this.stopping=!1;let r=this.codexPath,n=["app-server","-c",'model_provider="copilot"',"-c",'model_providers.copilot.name="copilot"',"-c",`model_providers.copilot.base_url="http://127.0.0.1:${this.proxyPort}/v1"`,"-c",'model_providers.copilot.wire_api="responses"',"-c",'sandbox_permissions=["disk-full-read-access","disk-write-cwd","disk-write-platform-user-temp","network-full-access"]',"-c","features.default_mode_request_user_input = true"];HI.debug(this.ctx,`start: cmd=${r} args=${JSON.stringify(n)} cwd=${this.cwd}`);try{this.process=(0,Nzi.spawn)(r,n,{env:{...process.env,OPENAI_API_KEY:"copilot-proxy"},stdio:["pipe","pipe","pipe"],cwd:this.cwd||void 0}),HI.debug(this.ctx,`start: spawn succeeded, pid=${this.process.pid}`)}catch(o){let s=o instanceof Error?o.message:String(o);throw HI.error(this.ctx,`start: spawn failed: ${s}`),new Error(`Failed to spawn codex app-server: ${s}`)}this.process.on("error",o=>{HI.error(this.ctx,`process error event: ${o.message}`),this.handleProcessExit(-1)}),this.process.on("exit",o=>{HI.debug(this.ctx,`process exit event: code=${o}`),this.handleProcessExit(o??-1)}),this.process.stdout&&(this.rl=x8r.default.createInterface({input:this.process.stdout}),this.rl.on("line",o=>this.handleLine(o))),this.process.stderr&&x8r.default.createInterface({input:this.process.stderr}).on("line",s=>{HI.debug(this.ctx,`CodexProcessManager [stderr]: ${s}`)})}async stop(){if(this.stopping=!0,!this.process)return;this.rejectAllPending(new Error("Process stopping")),this.process.kill("SIGTERM");let r=setTimeout(()=>{this.process&&!this.process.killed&&this.process.kill("SIGKILL")},5e3);await new Promise(n=>{if(!this.process){n();return}this.process.on("exit",()=>{clearTimeout(r),n()})}),this.process=void 0,this.rl=void 0}sendRequest(r,n){if(!this.process?.stdin)return Promise.reject(new Error("Codex process not running"));let o=++this.rpcId,s=JSON.stringify({jsonrpc:"2.0",id:o,method:r,params:n??{}});return this.process.stdin.write(s+` `),new Promise((c,l)=>{let u=setTimeout(()=>{this.pendingRequests.delete(o),l(new Error(`Timeout waiting for response to ${r} (id=${o})`))},3e4);this.pendingRequests.set(o,{resolve:c,reject:l,timer:u})})}sendNotification(r,n){if(!this.process?.stdin||!this.process.stdin.writable)return HI.warn(this.ctx,`sendNotification: stdin unavailable, dropping ${r}`),!1;let o=JSON.stringify({jsonrpc:"2.0",method:r,params:n??{}});try{return this.process.stdin.write(o+` `),!0}catch(s){let c=s instanceof Error?s.message:String(s);return HI.warn(this.ctx,`sendNotification: write failed for ${r}: ${c}`),!1}}onNotification(r){this.notificationHandlers.push(r)}onServerRequest(r,n){this.serverRequestHandlers.set(r,n)}sendRawResponse(r,n){if(!this.process?.stdin||!this.process.stdin.writable)return HI.warn(this.ctx,`sendRawResponse: stdin unavailable, dropping response id=${r}`),!1;let o=JSON.stringify({jsonrpc:"2.0",id:r,result:n});try{return this.process.stdin.write(o+` -`),!0}catch(s){let c=s instanceof Error?s.message:String(s);return HI.warn(this.ctx,`sendRawResponse: write failed for id=${r}: ${c}`),!1}}isRunning(){return this.process!==void 0&&!this.process.killed}handleLine(r){if(r.trim())try{let n=JSON.parse(r),o=typeof n.id=="number"||typeof n.id=="string";if(o&&this.pendingRequests.has(n.id)){let s=this.pendingRequests.get(n.id);this.pendingRequests.delete(n.id),clearTimeout(s.timer),n.error?s.reject(new Error(JSON.stringify(n.error))):s.resolve(n.result)}else if(o&&n.method)HI.info(this.ctx,`CodexProcessManager: \u2190 REQUEST ${n.method} (id=${JSON.stringify(n.id)}) params=${JSON.stringify(n.params).slice(0,500)}`),this.handleServerRequest(n.id,n.method,n.params);else if(n.method)for(let s of this.notificationHandlers)s(n.method,n.params);else n.id===null&&HI.warn(this.ctx,`CodexProcessManager: dropped frame with null id: ${r.slice(0,500)}`)}catch{}}handleServerRequest(r,n,o){HI.debug(this.ctx,`CodexProcessManager: server request ${n} (id=${JSON.stringify(r)})`);let s=this.serverRequestHandlers.get(n);if(s){s(o,r);return}this.sendRawResponse(r,{decision:"accept"});for(let c of this.notificationHandlers)c(n,o)}handleProcessExit(r){if(this.process=void 0,this.rl=void 0,this.stopping)return;let n=new Error(`Codex process exited unexpectedly (code: ${r})`);this.rejectAllPending(n),this.emit("error",n)}rejectAllPending(r){for(let[,n]of this.pendingRequests)clearTimeout(n.timer),n.reject(r);this.pendingRequests.clear()}};p();p();var VEe=class{constructor(){this._copilotUsage=new vge;this._pendingPermissions=new Map}static{a(this,"CodexSessionStateService")}setActiveThread(e){this._activeThreadId=e}getActiveThread(){return this._activeThreadId}addCopilotUsageNanoAiuForThread(e,r){this._copilotUsage.add(e,r)}takeCopilotUsageNanoAiuForThread(e){return this._copilotUsage.take(e)}clear(e){this._copilotUsage.clear(e),this._activeThreadId===e&&(this._activeThreadId=void 0)}setPendingPermission(e,r,n){let o=this._pendingPermissions.get(e);o||(o=new Map,this._pendingPermissions.set(e,o)),o.set(r,n)}takePendingPermission(e,r){let n=this._pendingPermissions.get(e);if(!n)return;let o=n.get(r);if(o)return n.delete(r),n.size===0&&this._pendingPermissions.delete(e),o}takeAllPendingPermissionsForSession(e){let r=this._pendingPermissions.get(e);if(!r)return[];let n=Array.from(r.entries());return this._pendingPermissions.delete(e),n}takeAllPendingPermissions(){let e=[];for(let[r,n]of this._pendingPermissions)for(let[o,s]of n)e.push([r,o,s]);return this._pendingPermissions.clear(),e}};var Nzi=fe(require("node:http")),x8r=require("node:stream/promises");var o9=new pe("CodexResponsesProxyServer"),vLc=16*1024*1024,dIt=class{constructor(e,r=new VEe){this.ctx=e;this.stateService=r;this.port=0}static{a(this,"CodexResponsesProxyServer")}async start(){if(this.server)return this.port;let e=Nzi.createServer((r,n)=>{this.handleRequest(r,n)});return this.server=e,new Promise((r,n)=>{e.once("error",n),e.listen(0,"127.0.0.1",()=>{let o=e.address();o&&typeof o=="object"?(this.port=o.port,o9.info(this.ctx,`CodexResponsesProxyServer listening on port ${o.port}`),e.removeListener("error",n),r(this.port)):n(new Error("Failed to get server address"))})})}async stop(){let e=this.server;e&&(await new Promise(r=>{e.close(()=>r())}),this.server=void 0,this.port=0)}getPort(){return this.port}async handleRequest(e,r){try{if(o9.info(this.ctx,`handleRequest: ${e.method} ${e.url}`),e.method==="POST"&&e.url?.includes("/responses")){let n=await this.readBody(e);o9.info(this.ctx,`proxyToCapiResponses: forwarding ${n.length} bytes`),await this.proxyToCapiResponses(n,r),o9.info(this.ctx,"proxyToCapiResponses: completed")}else o9.debug(this.ctx,`CodexResponsesProxyServer: unhandled ${e.method} ${e.url}`),r.writeHead(404),r.end("{}")}catch(n){o9.exception(this.ctx,n,".handleRequest"),r.headersSent||r.writeHead(500,{"Content-Type":"application/json"}),r.writableEnded||r.end(JSON.stringify({error:{message:"Internal proxy error"}}))}}async proxyToCapiResponses(e,r){let n=this.ctx.get(Qt),o=this.ctx.get(Jt),s;try{s=await n.getToken()}catch(h){o9.exception(this.ctx,h,".proxyToCapiResponses/getToken"),r.writeHead(401,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Failed to acquire Copilot token"}}));return}let c=Jle(this.ctx,s,"v1/responses"),l={...om(this.ctx),"Content-Type":"application/json"},{headers:u}=await Kle(this.ctx,l,s.token),d=new AbortController,f=a(()=>{d.signal.aborted||d.abort()},"onClose");r.on("close",f);try{let h=await o.fetch(c,{method:"POST",headers:u,body:e,signal:d.signal});Zle(this.ctx,h,"v1/responses");let m=h.headers.get("content-type")||"application/json";r.writeHead(h.status,{"Content-Type":m});let g=h.body();if(!g){r.end();return}let A=m.toLowerCase().includes("text/event-stream"),y=this.stateService.getActiveThread();if(A&&y){let _=LMe(E=>{this.stateService.addCopilotUsageNanoAiuForThread(y,E)});await(0,x8r.pipeline)(g,_,r)}else await(0,x8r.pipeline)(g,r)}catch(h){if(d.signal.aborted){o9.debug(this.ctx,"upstream fetch aborted by client disconnect"),r.writableEnded||r.end();return}if(o9.exception(this.ctx,h,".proxyToCapiResponses"),r.headersSent||r.writableEnded){r.destroy();return}r.writeHead(500,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Upstream request failed"}}))}finally{r.removeListener("close",f)}}readBody(e){return new Promise((r,n)=>{let o=[],s=0;e.on("data",c=>{if(s+=c.length,s>vLc){n(new Error("Request body exceeds maximum allowed size")),e.destroy();return}o.push(c)}),e.on("end",()=>r(Buffer.concat(o).toString("utf8"))),e.on("error",n)})}};p();var w8r=require("node:fs"),Mzi=fe(require("node:os")),fIt=fe(require("node:path"));Fo();function CLc(){let t=process.env.CODEX_HOME;return t||fIt.join(Mzi.homedir(),".codex")}a(CLc,"codexHome");async function pIt(t){let e=fIt.join(CLc(),"sessions");try{return await Ozi(e,t)}catch{return null}}a(pIt,"findRolloutFile");async function Ozi(t,e){let r;try{r=await w8r.promises.readdir(t,{withFileTypes:!0})}catch{return null}for(let n of r){let o=fIt.join(t,n.name);if(n.isDirectory()){let s=await Ozi(o,e);if(s)return s}else if(n.isFile()&&n.name.endsWith(".jsonl")&&n.name.includes(e))return o}return null}a(Ozi,"searchForRollout");async function hIt(t){let e;try{e=await w8r.promises.readFile(t,"utf8")}catch{return null}let r=e.split(` -`).filter(c=>c.trim().length>0),n=[];for(let c of r)try{n.push(JSON.parse(c))}catch{}let o=[],s={sessionStarted:!1,currentTurnId:void 0,currentModel:void 0,eventMsgCompletionCallIds:bLc(n),sealedCallIds:new Set};for(let c of n){let l=SLc(c,s);l&&(Array.isArray(l)?o.push(...l):o.push(l))}return o}a(hIt,"readAndTranslateRollout");function bLc(t){let e=new Set;for(let r of t){if(r.type!=="event_msg")continue;let n=r.payload.type;if(n!=="patch_apply_end"&&n!=="web_search_end")continue;let o=r.payload.call_id;typeof o=="string"&&o.length>0&&e.add(o)}return e}a(bLc,"collectEventMsgCompletionCallIds");function SLc(t,e){switch(t.type){case"event_msg":return TLc(t.timestamp,t.payload,e);case"response_item":return ILc(t.timestamp,t.payload,e);case"turn_context":{let r=t.payload.model;return typeof r=="string"&&r.length>0&&(e.currentModel=r),null}default:return null}}a(SLc,"translateRolloutLine");function TLc(t,e,r){switch(e.type){case"task_started":return r.currentTurnId=e.turn_id||void 0,r.sessionStarted?null:(r.sessionStarted=!0,{id:Dt(),timestamp:t,type:"session.start",data:{producer:"codex",startTime:t}});case"user_message":{let o=e.message||"",{content:s,attachments:c}=OLc(o),l={content:s};return c.length>0&&(l.attachments=c),{id:Dt(),timestamp:t,type:"user.message",data:l}}case"agent_message":{let o=e.message||"",s=Dt(),c=r.currentTurnId||s;return[{id:Dt(),timestamp:t,type:"assistant.turn_start",data:{turnId:s,interactionId:c}},{id:s,timestamp:t,type:"assistant.message",data:{content:o,messageId:s,model:r.currentModel}}]}case"token_count":{let s=e.info?.last_token_usage;return s?{id:Dt(),timestamp:t,type:"assistant.usage",data:{inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheReadTokens:s.cached_input_tokens}}:null}case"task_complete":return r.currentTurnId=void 0,{id:Dt(),timestamp:t,type:"session.idle"};case"patch_apply_end":{let o=e.call_id||"";if(!o||r.sealedCallIds.has(o))return null;r.sealedCallIds.add(o);let s=e.success===!0,c=e.changes,l=typeof e.stderr=="string"?e.stderr:"",u=typeof e.status=="string"?e.status:"failed";return{id:Dt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:s,result:s?{changes:c}:void 0,error:s?void 0:{message:l||`Patch apply ${u}`}}}}case"web_search_end":{let o=e.call_id||"";return!o||r.sealedCallIds.has(o)?null:(r.sealedCallIds.add(o),[{id:Dt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:o,toolName:"web_search",arguments:{query:e.query,action:e.action}}},{id:Dt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:!0}}])}default:return null}}a(TLc,"translateEventMsg");function ILc(t,e,r){switch(e.type){case"message":return null;case"reasoning":return xLc(t,e);case"function_call":return RLc(t,e,r);case"function_call_output":return kLc(t,e,r);case"custom_tool_call":return PLc(t,e,r);case"custom_tool_call_output":return DLc(t,e,r);case"web_search_call":return null;default:return null}}a(ILc,"translateResponseItem");function xLc(t,e){let r=wLc(e);if(!r)return null;let n=e.id||Dt();return{id:Dt(),timestamp:t,type:"assistant.reasoning",data:{reasoningId:n,content:r}}}a(xLc,"translateReasoningItem");function wLc(t){let e=[];for(let r of["summary","content"]){let n=t[r];if(Array.isArray(n)){for(let o of n)if(typeof o=="string")o.length>0&&e.push(o);else if(o&&typeof o=="object"){let s=o.text;typeof s=="string"&&s.length>0&&e.push(s)}}}return e.join(` -`).trim()}a(wLc,"extractReasoningText");function RLc(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let o=e.name||"unknown",s=o==="shell_command"?"shell":o,c=NLc(e.arguments);return{id:Dt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:c??{}}}}a(RLc,"translateFunctionCall");function kLc(t,e,r){let n=e.call_id||"";if(!n||r.sealedCallIds.has(n))return null;r.sealedCallIds.add(n);let o=typeof e.output=="string"?e.output:"";return{id:Dt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(kLc,"translateFunctionCallOutput");function PLc(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let s=e.name||"unknown";return{id:Dt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:{input:e.input}}}}a(PLc,"translateCustomToolCall");function DLc(t,e,r){let n=e.call_id||"";if(!n||r.eventMsgCompletionCallIds.has(n)||r.sealedCallIds.has(n))return null;r.sealedCallIds.add(n);let o=typeof e.output=="string"?e.output:"";return{id:Dt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(DLc,"translateCustomToolCallOutput");function NLc(t){if(typeof t!="string")return null;try{let e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}a(NLc,"parseJsonSafe");var MLc=/^\[Referenced files:([^\]]*)\]\r?\n\r?\n/;function OLc(t){let e=MLc.exec(t);if(!e)return{content:t,attachments:[]};let r=e[1].split(",").map(n=>n.trim()).filter(n=>n.length>0).map(n=>({type:"file",path:n,displayName:LLc(n)}));return{content:t.slice(e[0].length),attachments:r}}a(OLc,"extractReferencedFiles");function LLc(t){let e=t.replace(/\\/g,"/"),r=e.lastIndexOf("/");return r===-1?e:e.slice(r+1)}a(LLc,"basename");p();Fo();function Bh(t,e,r){return{id:Dt(),timestamp:new Date().toISOString(),type:t,...e!==void 0?{data:e}:{},...r?{ephemeral:r}:{}}}a(Bh,"envelope");function WEe(){return{turnStreamCtx:new Map,pendingUserInputs:new Map,pendingUserInputAggregates:new Map,pendingApprovalSubjects:new Map}}a(WEe,"createCodexTranslatorState");function k8r(t,e){return`${t}:${e}`}a(k8r,"composeUserInputRequestId");function P8r(t,e){let r=t.turnStreamCtx.get(e);return r||(r={agentMessageIds:[],reasoningIds:[],tokenUsageSum:{inputTokens:0,outputTokens:0,cachedInputTokens:0},tokenUsageObserved:!1},t.turnStreamCtx.set(e,r)),r}a(P8r,"ctxFor");function Lzi(t,e,r,n,o){switch(t){case"turn/started":return BLc(e);case"turn/completed":return FLc(e,r,o);case"item/started":return ULc(e,r);case"item/completed":return QLc(e,r);case"thread/tokenUsage/updated":return qLc(e,r);case"item/agentMessage/delta":return HLc(e);case"item/reasoning/summaryTextDelta":return aBc(e,r);case"item/commandExecution/outputDelta":return zLc(e);case"item/tool/requestUserInput":return uBc(e,r,n);case"item/commandExecution/requestApproval":case"item/fileChange/requestApproval":case"item/permissions/requestApproval":return dBc(t,e,r);default:return null}}a(Lzi,"translateCodexNotification");function BLc(t){return null}a(BLc,"translateTurnStarted");function FLc(t,e,r){let n=[],o=t.turn?.id,s=o?e.turnStreamCtx.get(o):void 0,c=s?.tokenUsageObserved?s.tokenUsageSum:void 0,l=r?.copilotUsageNanoAiu;return n.push(Bh("assistant.usage",{model:"codex",duration:t.turn?.durationMs??void 0,...c?{inputTokens:c.inputTokens,outputTokens:c.outputTokens,cacheReadTokens:c.cachedInputTokens}:{},...l!==void 0&&l>0?{copilotUsage:{totalNanoAiu:l}}:{}},!0)),n.push(Bh("session.idle",{},!0)),o&&e.turnStreamCtx.delete(o),n}a(FLc,"translateTurnCompleted");function ULc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return jLc(e,t.turnId,r);case"commandExecution":return e.pendingApprovalSubjects.set(r.id,r),VLc(r);case"fileChange":return e.pendingApprovalSubjects.set(r.id,r),YLc(r);case"mcpToolCall":return JLc(r);case"webSearch":return eBc(r);case"imageView":return rBc(r);case"dynamicToolCall":return iBc(r);case"reasoning":return sBc(e,t.turnId,r);default:return null}}a(ULc,"translateItemStarted");function QLc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return GLc(e,t.turnId,r);case"commandExecution":return e.pendingApprovalSubjects.delete(r.id),WLc(r);case"fileChange":return e.pendingApprovalSubjects.delete(r.id),KLc(r);case"mcpToolCall":return ZLc(r);case"webSearch":return tBc(r);case"imageView":return nBc(r);case"dynamicToolCall":return oBc(r);case"reasoning":return cBc(e,t.turnId,r);default:return null}}a(QLc,"translateItemCompleted");function qLc(t,e){let r=P8r(e,t.turnId),n=t.tokenUsage?.last;return n&&(typeof n.inputTokens=="number"&&Number.isFinite(n.inputTokens)&&(r.tokenUsageSum.inputTokens+=n.inputTokens),typeof n.outputTokens=="number"&&Number.isFinite(n.outputTokens)&&(r.tokenUsageSum.outputTokens+=n.outputTokens),typeof n.cachedInputTokens=="number"&&Number.isFinite(n.cachedInputTokens)&&(r.tokenUsageSum.cachedInputTokens+=n.cachedInputTokens),r.tokenUsageObserved=!0),null}a(qLc,"translateTokenUsageUpdated");function jLc(t,e,r){return P8r(t,e).agentMessageIds.push(r.id),Bh("assistant.turn_start",{turnId:r.id,interactionId:e})}a(jLc,"translateAgentMessageItemStarted");function HLc(t){return Bh("assistant.message_delta",{messageId:t.itemId||t.turnId,deltaContent:t.delta},!0)}a(HLc,"translateAgentMessageDelta");function GLc(t,e,r){let n=r.text??"";if(n.length===0)return null;let o=t.turnStreamCtx.get(e)?.agentMessageIds.shift()??r.id;return Bh("assistant.message",{messageId:o,content:n})}a(GLc,"translateAgentMessageItemCompleted");function zEe(t){return t==="failed"||t==="cancelled"||t==="declined"}a(zEe,"isFailedStatus");var R8r=4096;function $Lc(t){return t.length<=R8r?t:`${t.slice(0,R8r)} -\u2026 [truncated ${t.length-R8r} chars]`}a($Lc,"truncateForError");function VLc(t){return Bh("tool.execution_start",{toolCallId:t.id,toolName:"shell",arguments:{command:t.command,cwd:t.cwd,commandActions:t.commandActions}})}a(VLc,"translateCommandExecutionItemStarted");function WLc(t){let e=!zEe(t.status),r=t.aggregatedOutput??"";return Bh("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:r}:void 0,error:e?void 0:{message:r.length>0?$Lc(r):`Command ${t.status??"failed"} with exit code ${t.exitCode??"unknown"}`},durationMs:t.durationMs??void 0,exitCode:t.exitCode??void 0})}a(WLc,"translateCommandExecutionItemCompleted");function zLc(t){return null}a(zLc,"translateCommandExecutionOutputDelta");function YLc(t){return t.changes.map(e=>Bh("tool.execution_start",{toolCallId:Bzi(t.id,e),toolName:"file_change",arguments:{...e}}))}a(YLc,"translateFileChangeItemStarted");function KLc(t){let e=!zEe(t.status);return t.changes.map(r=>Bh("tool.execution_complete",{toolCallId:Bzi(t.id,r),success:e,result:e?{...r}:void 0,error:e?void 0:{message:`File change ${t.status??"failed"}`},durationMs:t.durationMs??void 0}))}a(KLc,"translateFileChangeItemCompleted");function Bzi(t,e){return`${t}:${e.kind}:${encodeURIComponent(e.path)}`}a(Bzi,"fileChangeToolCallId");function JLc(t){return Bh("tool.execution_start",{toolCallId:t.id,toolName:`mcp:${t.server}.${t.tool}`,arguments:t.arguments??{}})}a(JLc,"translateMcpToolCallItemStarted");function ZLc(t){let e=!zEe(t.status)&&!t.error;return Bh("tool.execution_complete",{toolCallId:t.id,success:e,result:e?XLc(t.result):void 0,error:e?void 0:{message:t.error??`MCP tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(ZLc,"translateMcpToolCallItemCompleted");function XLc(t){return t&&typeof t=="object"&&!Array.isArray(t)&&"content"in t?t:{content:t}}a(XLc,"wrapMcpResult");function eBc(t){return null}a(eBc,"translateWebSearchItemStarted");function tBc(t){let e=!zEe(t.status),r=t.query?.trim()?t.query:t.action?.query??t.action?.queries?.join(", "),n=t.results!==void 0&&t.results!==null;return[Bh("tool.execution_start",{toolCallId:t.id,toolName:"web_search",arguments:{query:r,action:t.action}}),Bh("tool.execution_complete",{toolCallId:t.id,success:e,result:e&&n?{content:t.results}:void 0,error:e?void 0:{message:`Web search ${t.status??"failed"}`},durationMs:t.durationMs??void 0})]}a(tBc,"translateWebSearchItemCompleted");function rBc(t){return Bh("tool.execution_start",{toolCallId:t.id,toolName:"view_image",arguments:{path:t.path}})}a(rBc,"translateImageViewItemStarted");function nBc(t){let e=!zEe(t.status);return Bh("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{path:t.path}:void 0,error:e?void 0:{message:`Image view ${t.status??"failed"}`}})}a(nBc,"translateImageViewItemCompleted");function iBc(t){return Bh("tool.execution_start",{toolCallId:t.id,toolName:t.tool,arguments:t.arguments??{}})}a(iBc,"translateDynamicToolCallItemStarted");function oBc(t){let e=t.success!==void 0?t.success:!zEe(t.status)&&!t.error;return Bh("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:t.contentItems}:void 0,error:e?void 0:{message:t.error??`Tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(oBc,"translateDynamicToolCallItemCompleted");function sBc(t,e,r){return P8r(t,e).reasoningIds.push(r.id),null}a(sBc,"translateReasoningItemStarted");function aBc(t,e){let r=e.turnStreamCtx.get(t.turnId)?.reasoningIds,n=r&&r.length>0?r[r.length-1]:void 0;return Bh("assistant.reasoning_delta",{reasoningId:t.itemId||t.reasoningId||n||`codex-reasoning:${t.turnId}`,deltaContent:t.delta},!0)}a(aBc,"translateReasoningDelta");function cBc(t,e,r){let n=t.turnStreamCtx.get(e)?.reasoningIds.shift()??r.id,o=lBc(r);return o?Bh("assistant.reasoning",{reasoningId:n,content:o}):null}a(cBc,"translateReasoningItemCompleted");function lBc(t){let e=[];for(let r of[t.summary,t.content])if(Array.isArray(r))for(let n of r)typeof n=="string"?n.length>0&&e.push(n):n&&typeof n.text=="string"&&n.text.length>0&&e.push(n.text);return e.join(` -`).trim()}a(lBc,"extractReasoningText");function uBc(t,e,r){if(!t?.itemId||!t.threadId||r===void 0)return null;let n=t.questions??[];if(n.length===0)return null;let o=t.autoResolutionMs??void 0,s=new Set,c=[];for(let l of n){if(typeof l?.id!="string"||l.id.length===0||s.has(l.id)||typeof l.question!="string"||l.question.length===0)continue;let u=k8r(t.itemId,l.id);e.pendingUserInputs.set(u,{itemId:t.itemId,questionId:l.id}),s.add(l.id);let d=l.options&&l.options.length>0?l.options.map(f=>f.label):void 0;c.push(Bh("user_input.requested",{requestId:u,question:l.header?`${l.header} -${l.question}`:l.question,...d!==void 0?{choices:d}:{},allowFreeform:!0,...o!==void 0?{autoResolutionMs:o}:{}}))}return c.length===0?null:(e.pendingUserInputAggregates.set(t.itemId,{requestJsonRpcId:r,expectedQuestionIds:s,answers:new Map}),c)}a(uBc,"translateRequestUserInput");function D8r(t){return t.includes("commandExecution")?"shell":t.includes("fileChange")?"write":t.includes("permissions")?"permissions":"unknown"}a(D8r,"codexApprovalKind");function N8r(t,e){return`codex-perm:${t}:${e}`}a(N8r,"composePermissionRequestId");function dBc(t,e,r){if(!e?.itemId)return null;let n=D8r(t),o=N8r(e.itemId,n),s=r.pendingApprovalSubjects.get(e.itemId);return Bh("permission.requested",{requestId:o,permissionRequest:fBc(n,t,e,s)})}a(dBc,"translateRequestApproval");function fBc(t,e,r,n){let o={kind:t,method:e,toolCallId:r.itemId,payload:r};switch(t){case"shell":return{...o,...mBc(r,ABc(n)?n:void 0)};case"write":return{...o,...gBc(r,yBc(n)?n:void 0)};case"permissions":return{...o,...pBc(r)};default:return{...o,intention:Qy(r.reason)}}}a(fBc,"buildCodexPermissionRequest");function pBc(t){let e=Array.isArray(t.grants)?t.grants:[],r=e.find(l=>!!l&&typeof l=="object"),n=r?Qy(r.kind):void 0,o=r?Qy(r.url)??Qy(r.host):void 0,s=r?Qy(r.path)??Qy(r.root):void 0,c=mIt([s]);return{intention:Qy(t.reason)??hBc(n,o??s),...o!==void 0?{url:o}:{},...c.length>0?{possiblePaths:c}:{},...e.length>1?{grantCount:e.length}:{}}}a(pBc,"buildPermissionsPermissionRequest");function hBc(t,e){return t&&e?`Grant ${t} access to ${e}`:e?`Grant access to ${e}`:t?`Grant ${t} access`:"Grant additional permission"}a(hBc,"describePermissionsIntention");function mBc(t,e){let r=Qy(t.command)??e?.command,n=Qy(t.cwd)??e?.cwd,o=_Bc(t.commandActions,e?.commandActions,r),s=mIt([n]);return{intention:Qy(t.reason)??EBc(r,n),...r!==void 0?{fullCommandText:r}:{},...o.length>0?{commands:o}:{},...s.length>0?{possiblePaths:s}:{}}}a(mBc,"buildShellPermissionRequest");function gBc(t,e){let r=vBc(e,t),n=r[0]?.path??Qy(t.grantRoot),o=mIt([...r.map(c=>c.path),Qy(t.grantRoot)]),s=CBc(r);return{intention:Qy(t.reason)??bBc(r,n),...n!==void 0?{fileName:n}:{},...s!==void 0?{diff:s}:{},...o.length>0?{possiblePaths:o}:{}}}a(gBc,"buildWritePermissionRequest");function Qy(t){return typeof t=="string"&&t.length>0?t:void 0}a(Qy,"stringOrUndefined");function ABc(t){return t?.type==="commandExecution"}a(ABc,"isCodexCommandExecutionItem");function yBc(t){return t?.type==="fileChange"}a(yBc,"isCodexFileChangeItem");function _Bc(t,e,r){let o=(Array.isArray(t)?t:e??[]).map(s=>s&&typeof s=="object"?Qy(s.command):void 0).filter(s=>s!==void 0);return o.length===0&&r!==void 0&&o.push(r),mIt(o).map(s=>({identifier:s,readOnly:!1}))}a(_Bc,"buildShellPermissionCommands");function mIt(t){return[...new Set(t.filter(e=>e!==void 0&&e.length>0))]}a(mIt,"distinctNonEmptyStrings");function EBc(t,e){return t&&e?`Run shell command in ${e}: ${t}`:t?`Run shell command: ${t}`:e?`Run shell command in ${e}`:"Run shell command"}a(EBc,"describeShellIntention");function vBc(t,e){if(t?.changes)return t.changes;let r=e.changes;return Array.isArray(r)?r.map(n=>{if(!n||typeof n!="object")return;let o=Qy(n.path),s=Qy(n.kind);if(!o||!s)return;let c=Qy(n.diff);return c!==void 0?{path:o,kind:s,diff:c}:{path:o,kind:s}}).filter(n=>n!==void 0):[]}a(vBc,"extractFileChanges");function CBc(t){let e=t.filter(r=>typeof r.diff=="string");if(e.length!==0)return e.length===1?e[0].diff:e.map(r=>`# ${r.path} +`),!0}catch(s){let c=s instanceof Error?s.message:String(s);return HI.warn(this.ctx,`sendRawResponse: write failed for id=${r}: ${c}`),!1}}isRunning(){return this.process!==void 0&&!this.process.killed}handleLine(r){if(r.trim())try{let n=JSON.parse(r),o=typeof n.id=="number"||typeof n.id=="string";if(o&&this.pendingRequests.has(n.id)){let s=this.pendingRequests.get(n.id);this.pendingRequests.delete(n.id),clearTimeout(s.timer),n.error?s.reject(new Error(JSON.stringify(n.error))):s.resolve(n.result)}else if(o&&n.method)HI.info(this.ctx,`CodexProcessManager: \u2190 REQUEST ${n.method} (id=${JSON.stringify(n.id)}) params=${JSON.stringify(n.params).slice(0,500)}`),this.handleServerRequest(n.id,n.method,n.params);else if(n.method)for(let s of this.notificationHandlers)s(n.method,n.params);else n.id===null&&HI.warn(this.ctx,`CodexProcessManager: dropped frame with null id: ${r.slice(0,500)}`)}catch{}}handleServerRequest(r,n,o){HI.debug(this.ctx,`CodexProcessManager: server request ${n} (id=${JSON.stringify(r)})`);let s=this.serverRequestHandlers.get(n);if(s){s(o,r);return}this.sendRawResponse(r,{decision:"accept"});for(let c of this.notificationHandlers)c(n,o)}handleProcessExit(r){if(this.process=void 0,this.rl=void 0,this.stopping)return;let n=new Error(`Codex process exited unexpectedly (code: ${r})`);this.rejectAllPending(n),this.emit("error",n)}rejectAllPending(r){for(let[,n]of this.pendingRequests)clearTimeout(n.timer),n.reject(r);this.pendingRequests.clear()}};p();p();var VEe=class{constructor(){this._copilotUsage=new vge;this._pendingPermissions=new Map}static{a(this,"CodexSessionStateService")}setActiveThread(e){this._activeThreadId=e}getActiveThread(){return this._activeThreadId}addCopilotUsageNanoAiuForThread(e,r){this._copilotUsage.add(e,r)}takeCopilotUsageNanoAiuForThread(e){return this._copilotUsage.take(e)}clear(e){this._copilotUsage.clear(e),this._activeThreadId===e&&(this._activeThreadId=void 0)}setPendingPermission(e,r,n){let o=this._pendingPermissions.get(e);o||(o=new Map,this._pendingPermissions.set(e,o)),o.set(r,n)}takePendingPermission(e,r){let n=this._pendingPermissions.get(e);if(!n)return;let o=n.get(r);if(o)return n.delete(r),n.size===0&&this._pendingPermissions.delete(e),o}takeAllPendingPermissionsForSession(e){let r=this._pendingPermissions.get(e);if(!r)return[];let n=Array.from(r.entries());return this._pendingPermissions.delete(e),n}takeAllPendingPermissions(){let e=[];for(let[r,n]of this._pendingPermissions)for(let[o,s]of n)e.push([r,o,s]);return this._pendingPermissions.clear(),e}};var Ozi=fe(require("node:http")),w8r=require("node:stream/promises");var o9=new pe("CodexResponsesProxyServer"),bLc=16*1024*1024,fIt=class{constructor(e,r=new VEe){this.ctx=e;this.stateService=r;this.port=0}static{a(this,"CodexResponsesProxyServer")}async start(){if(this.server)return this.port;let e=Ozi.createServer((r,n)=>{this.handleRequest(r,n)});return this.server=e,new Promise((r,n)=>{e.once("error",n),e.listen(0,"127.0.0.1",()=>{let o=e.address();o&&typeof o=="object"?(this.port=o.port,o9.info(this.ctx,`CodexResponsesProxyServer listening on port ${o.port}`),e.removeListener("error",n),r(this.port)):n(new Error("Failed to get server address"))})})}async stop(){let e=this.server;e&&(await new Promise(r=>{e.close(()=>r())}),this.server=void 0,this.port=0)}getPort(){return this.port}async handleRequest(e,r){try{if(o9.info(this.ctx,`handleRequest: ${e.method} ${e.url}`),e.method==="POST"&&e.url?.includes("/responses")){let n=await this.readBody(e);o9.info(this.ctx,`proxyToCapiResponses: forwarding ${n.length} bytes`),await this.proxyToCapiResponses(n,r),o9.info(this.ctx,"proxyToCapiResponses: completed")}else o9.debug(this.ctx,`CodexResponsesProxyServer: unhandled ${e.method} ${e.url}`),r.writeHead(404),r.end("{}")}catch(n){o9.exception(this.ctx,n,".handleRequest"),r.headersSent||r.writeHead(500,{"Content-Type":"application/json"}),r.writableEnded||r.end(JSON.stringify({error:{message:"Internal proxy error"}}))}}async proxyToCapiResponses(e,r){let n=this.ctx.get(Qt),o=this.ctx.get(Jt),s;try{s=await n.getToken()}catch(h){o9.exception(this.ctx,h,".proxyToCapiResponses/getToken"),r.writeHead(401,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Failed to acquire Copilot token"}}));return}let c=Zle(this.ctx,s,"v1/responses"),l={...om(this.ctx),"Content-Type":"application/json"},{headers:u}=await Jle(this.ctx,l,s.token),d=new AbortController,f=a(()=>{d.signal.aborted||d.abort()},"onClose");r.on("close",f);try{let h=await o.fetch(c,{method:"POST",headers:u,body:e,signal:d.signal});Xle(this.ctx,h,"v1/responses");let m=h.headers.get("content-type")||"application/json";r.writeHead(h.status,{"Content-Type":m});let g=h.body();if(!g){r.end();return}let A=m.toLowerCase().includes("text/event-stream"),y=this.stateService.getActiveThread();if(A&&y){let _=LMe(E=>{this.stateService.addCopilotUsageNanoAiuForThread(y,E)});await(0,w8r.pipeline)(g,_,r)}else await(0,w8r.pipeline)(g,r)}catch(h){if(d.signal.aborted){o9.debug(this.ctx,"upstream fetch aborted by client disconnect"),r.writableEnded||r.end();return}if(o9.exception(this.ctx,h,".proxyToCapiResponses"),r.headersSent||r.writableEnded){r.destroy();return}r.writeHead(500,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Upstream request failed"}}))}finally{r.removeListener("close",f)}}readBody(e){return new Promise((r,n)=>{let o=[],s=0;e.on("data",c=>{if(s+=c.length,s>bLc){n(new Error("Request body exceeds maximum allowed size")),e.destroy();return}o.push(c)}),e.on("end",()=>r(Buffer.concat(o).toString("utf8"))),e.on("error",n)})}};p();var R8r=require("node:fs"),Lzi=fe(require("node:os")),pIt=fe(require("node:path"));Fo();function SLc(){let t=process.env.CODEX_HOME;return t||pIt.join(Lzi.homedir(),".codex")}a(SLc,"codexHome");async function hIt(t){let e=pIt.join(SLc(),"sessions");try{return await Bzi(e,t)}catch{return null}}a(hIt,"findRolloutFile");async function Bzi(t,e){let r;try{r=await R8r.promises.readdir(t,{withFileTypes:!0})}catch{return null}for(let n of r){let o=pIt.join(t,n.name);if(n.isDirectory()){let s=await Bzi(o,e);if(s)return s}else if(n.isFile()&&n.name.endsWith(".jsonl")&&n.name.includes(e))return o}return null}a(Bzi,"searchForRollout");async function mIt(t){let e;try{e=await R8r.promises.readFile(t,"utf8")}catch{return null}let r=e.split(` +`).filter(c=>c.trim().length>0),n=[];for(let c of r)try{n.push(JSON.parse(c))}catch{}let o=[],s={sessionStarted:!1,currentTurnId:void 0,currentModel:void 0,eventMsgCompletionCallIds:TLc(n),sealedCallIds:new Set};for(let c of n){let l=ILc(c,s);l&&(Array.isArray(l)?o.push(...l):o.push(l))}return o}a(mIt,"readAndTranslateRollout");function TLc(t){let e=new Set;for(let r of t){if(r.type!=="event_msg")continue;let n=r.payload.type;if(n!=="patch_apply_end"&&n!=="web_search_end")continue;let o=r.payload.call_id;typeof o=="string"&&o.length>0&&e.add(o)}return e}a(TLc,"collectEventMsgCompletionCallIds");function ILc(t,e){switch(t.type){case"event_msg":return xLc(t.timestamp,t.payload,e);case"response_item":return wLc(t.timestamp,t.payload,e);case"turn_context":{let r=t.payload.model;return typeof r=="string"&&r.length>0&&(e.currentModel=r),null}default:return null}}a(ILc,"translateRolloutLine");function xLc(t,e,r){switch(e.type){case"task_started":return r.currentTurnId=e.turn_id||void 0,r.sessionStarted?null:(r.sessionStarted=!0,{id:Dt(),timestamp:t,type:"session.start",data:{producer:"codex",startTime:t}});case"user_message":{let o=e.message||"",{content:s,attachments:c}=BLc(o),l={content:s};return c.length>0&&(l.attachments=c),{id:Dt(),timestamp:t,type:"user.message",data:l}}case"agent_message":{let o=e.message||"",s=Dt(),c=r.currentTurnId||s;return[{id:Dt(),timestamp:t,type:"assistant.turn_start",data:{turnId:s,interactionId:c}},{id:s,timestamp:t,type:"assistant.message",data:{content:o,messageId:s,model:r.currentModel}}]}case"token_count":{let s=e.info?.last_token_usage;return s?{id:Dt(),timestamp:t,type:"assistant.usage",data:{inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheReadTokens:s.cached_input_tokens}}:null}case"task_complete":return r.currentTurnId=void 0,{id:Dt(),timestamp:t,type:"session.idle"};case"patch_apply_end":{let o=e.call_id||"";if(!o||r.sealedCallIds.has(o))return null;r.sealedCallIds.add(o);let s=e.success===!0,c=e.changes,l=typeof e.stderr=="string"?e.stderr:"",u=typeof e.status=="string"?e.status:"failed";return{id:Dt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:s,result:s?{type:"text",content:JSON.stringify(c??{})}:void 0,error:s?void 0:{message:l||`Patch apply ${u}`}}}}case"web_search_end":{let o=e.call_id||"";return!o||r.sealedCallIds.has(o)?null:(r.sealedCallIds.add(o),[{id:Dt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:o,toolName:"web_search",arguments:{query:e.query,action:e.action}}},{id:Dt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:!0}}])}default:return null}}a(xLc,"translateEventMsg");function wLc(t,e,r){switch(e.type){case"message":return null;case"reasoning":return RLc(t,e);case"function_call":return PLc(t,e,r);case"function_call_output":return DLc(t,e,r);case"custom_tool_call":return NLc(t,e,r);case"custom_tool_call_output":return MLc(t,e,r);case"web_search_call":return null;default:return null}}a(wLc,"translateResponseItem");function RLc(t,e){let r=kLc(e);if(!r)return null;let n=e.id||Dt();return{id:Dt(),timestamp:t,type:"assistant.reasoning",data:{reasoningId:n,content:r}}}a(RLc,"translateReasoningItem");function kLc(t){let e=[];for(let r of["summary","content"]){let n=t[r];if(Array.isArray(n)){for(let o of n)if(typeof o=="string")o.length>0&&e.push(o);else if(o&&typeof o=="object"){let s=o.text;typeof s=="string"&&s.length>0&&e.push(s)}}}return e.join(` +`).trim()}a(kLc,"extractReasoningText");function PLc(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let o=e.name||"unknown",s=o==="shell_command"?"shell":o,c=OLc(e.arguments);return{id:Dt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:c??{}}}}a(PLc,"translateFunctionCall");function DLc(t,e,r){let n=e.call_id||"";if(!n||r.sealedCallIds.has(n))return null;r.sealedCallIds.add(n);let o=typeof e.output=="string"?e.output:"";return{id:Dt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(DLc,"translateFunctionCallOutput");function NLc(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let s=e.name||"unknown";return{id:Dt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:{input:e.input}}}}a(NLc,"translateCustomToolCall");function MLc(t,e,r){let n=e.call_id||"";if(!n||r.eventMsgCompletionCallIds.has(n)||r.sealedCallIds.has(n))return null;r.sealedCallIds.add(n);let o=typeof e.output=="string"?e.output:"";return{id:Dt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(MLc,"translateCustomToolCallOutput");function OLc(t){if(typeof t!="string")return null;try{let e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}a(OLc,"parseJsonSafe");var LLc=/^\[Referenced files:([^\]]*)\]\r?\n\r?\n/;function BLc(t){let e=LLc.exec(t);if(!e)return{content:t,attachments:[]};let r=e[1].split(",").map(n=>n.trim()).filter(n=>n.length>0).map(n=>({type:"file",path:n,displayName:FLc(n)}));return{content:t.slice(e[0].length),attachments:r}}a(BLc,"extractReferencedFiles");function FLc(t){let e=t.replace(/\\/g,"/"),r=e.lastIndexOf("/");return r===-1?e:e.slice(r+1)}a(FLc,"basename");p();Fo();function Bh(t,e,r){return{id:Dt(),timestamp:new Date().toISOString(),type:t,...e!==void 0?{data:e}:{},...r?{ephemeral:r}:{}}}a(Bh,"envelope");function WEe(){return{turnStreamCtx:new Map,pendingUserInputs:new Map,pendingUserInputAggregates:new Map,pendingApprovalSubjects:new Map}}a(WEe,"createCodexTranslatorState");function P8r(t,e){return`${t}:${e}`}a(P8r,"composeUserInputRequestId");function D8r(t,e){let r=t.turnStreamCtx.get(e);return r||(r={agentMessageIds:[],reasoningIds:[],tokenUsageSum:{inputTokens:0,outputTokens:0,cachedInputTokens:0},tokenUsageObserved:!1},t.turnStreamCtx.set(e,r)),r}a(D8r,"ctxFor");function Fzi(t,e,r,n,o){switch(t){case"turn/started":return ULc(e);case"turn/completed":return QLc(e,r,o);case"item/started":return qLc(e,r);case"item/completed":return jLc(e,r);case"thread/tokenUsage/updated":return HLc(e,r);case"item/agentMessage/delta":return $Lc(e);case"item/reasoning/summaryTextDelta":return lBc(e,r);case"item/commandExecution/outputDelta":return KLc(e);case"item/tool/requestUserInput":return fBc(e,r,n);case"item/commandExecution/requestApproval":case"item/fileChange/requestApproval":case"item/permissions/requestApproval":return pBc(t,e,r);default:return null}}a(Fzi,"translateCodexNotification");function ULc(t){return null}a(ULc,"translateTurnStarted");function QLc(t,e,r){let n=[],o=t.turn?.id,s=o?e.turnStreamCtx.get(o):void 0,c=s?.tokenUsageObserved?s.tokenUsageSum:void 0,l=r?.copilotUsageNanoAiu;return n.push(Bh("assistant.usage",{model:"codex",duration:t.turn?.durationMs??void 0,...c?{inputTokens:c.inputTokens,outputTokens:c.outputTokens,cacheReadTokens:c.cachedInputTokens}:{},...l!==void 0&&l>0?{copilotUsage:{totalNanoAiu:l}}:{}},!0)),n.push(Bh("session.idle",{},!0)),o&&e.turnStreamCtx.delete(o),n}a(QLc,"translateTurnCompleted");function qLc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return GLc(e,t.turnId,r);case"commandExecution":return e.pendingApprovalSubjects.set(r.id,r),zLc(r);case"fileChange":return e.pendingApprovalSubjects.set(r.id,r),JLc(r);case"mcpToolCall":return XLc(r);case"webSearch":return rBc(r);case"imageView":return iBc(r);case"dynamicToolCall":return sBc(r);case"reasoning":return cBc(e,t.turnId,r);default:return null}}a(qLc,"translateItemStarted");function jLc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return VLc(e,t.turnId,r);case"commandExecution":return e.pendingApprovalSubjects.delete(r.id),YLc(r);case"fileChange":return e.pendingApprovalSubjects.delete(r.id),ZLc(r);case"mcpToolCall":return eBc(r);case"webSearch":return nBc(r);case"imageView":return oBc(r);case"dynamicToolCall":return aBc(r);case"reasoning":return uBc(e,t.turnId,r);default:return null}}a(jLc,"translateItemCompleted");function HLc(t,e){let r=D8r(e,t.turnId),n=t.tokenUsage?.last;return n&&(typeof n.inputTokens=="number"&&Number.isFinite(n.inputTokens)&&(r.tokenUsageSum.inputTokens+=n.inputTokens),typeof n.outputTokens=="number"&&Number.isFinite(n.outputTokens)&&(r.tokenUsageSum.outputTokens+=n.outputTokens),typeof n.cachedInputTokens=="number"&&Number.isFinite(n.cachedInputTokens)&&(r.tokenUsageSum.cachedInputTokens+=n.cachedInputTokens),r.tokenUsageObserved=!0),null}a(HLc,"translateTokenUsageUpdated");function GLc(t,e,r){return D8r(t,e).agentMessageIds.push(r.id),Bh("assistant.turn_start",{turnId:r.id,interactionId:e})}a(GLc,"translateAgentMessageItemStarted");function $Lc(t){return Bh("assistant.message_delta",{messageId:t.itemId||t.turnId,deltaContent:t.delta},!0)}a($Lc,"translateAgentMessageDelta");function VLc(t,e,r){let n=r.text??"";if(n.length===0)return null;let o=t.turnStreamCtx.get(e)?.agentMessageIds.shift()??r.id;return Bh("assistant.message",{messageId:o,content:n})}a(VLc,"translateAgentMessageItemCompleted");function zEe(t){return t==="failed"||t==="cancelled"||t==="declined"}a(zEe,"isFailedStatus");var k8r=4096;function WLc(t){return t.length<=k8r?t:`${t.slice(0,k8r)} +\u2026 [truncated ${t.length-k8r} chars]`}a(WLc,"truncateForError");function zLc(t){return Bh("tool.execution_start",{toolCallId:t.id,toolName:"shell",arguments:{command:t.command,cwd:t.cwd,commandActions:t.commandActions}})}a(zLc,"translateCommandExecutionItemStarted");function YLc(t){let e=!zEe(t.status),r=t.aggregatedOutput??"";return Bh("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:r}:void 0,error:e?void 0:{message:r.length>0?WLc(r):`Command ${t.status??"failed"} with exit code ${t.exitCode??"unknown"}`},durationMs:t.durationMs??void 0,exitCode:t.exitCode??void 0})}a(YLc,"translateCommandExecutionItemCompleted");function KLc(t){return null}a(KLc,"translateCommandExecutionOutputDelta");function JLc(t){return t.changes.map(e=>Bh("tool.execution_start",{toolCallId:Uzi(t.id,e),toolName:"file_change",arguments:{...e}}))}a(JLc,"translateFileChangeItemStarted");function ZLc(t){let e=!zEe(t.status);return t.changes.map(r=>Bh("tool.execution_complete",{toolCallId:Uzi(t.id,r),success:e,result:e?{type:"text",content:JSON.stringify(r)}:void 0,error:e?void 0:{message:`File change ${t.status??"failed"}`},durationMs:t.durationMs??void 0}))}a(ZLc,"translateFileChangeItemCompleted");function Uzi(t,e){return`${t}:${e.kind}:${encodeURIComponent(e.path)}`}a(Uzi,"fileChangeToolCallId");function XLc(t){return Bh("tool.execution_start",{toolCallId:t.id,toolName:`mcp:${t.server}.${t.tool}`,arguments:t.arguments??{}})}a(XLc,"translateMcpToolCallItemStarted");function eBc(t){let e=!zEe(t.status)&&!t.error;return Bh("tool.execution_complete",{toolCallId:t.id,success:e,result:e?tBc(t.result):void 0,error:e?void 0:{message:t.error??`MCP tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(eBc,"translateMcpToolCallItemCompleted");function tBc(t){return t&&typeof t=="object"&&!Array.isArray(t)&&"content"in t?t:{content:t}}a(tBc,"wrapMcpResult");function rBc(t){return null}a(rBc,"translateWebSearchItemStarted");function nBc(t){let e=!zEe(t.status),r=t.query?.trim()?t.query:t.action?.query??t.action?.queries?.join(", "),n=t.results!==void 0&&t.results!==null;return[Bh("tool.execution_start",{toolCallId:t.id,toolName:"web_search",arguments:{query:r,action:t.action}}),Bh("tool.execution_complete",{toolCallId:t.id,success:e,result:e&&n?{content:t.results}:void 0,error:e?void 0:{message:`Web search ${t.status??"failed"}`},durationMs:t.durationMs??void 0})]}a(nBc,"translateWebSearchItemCompleted");function iBc(t){return Bh("tool.execution_start",{toolCallId:t.id,toolName:"view_image",arguments:{path:t.path}})}a(iBc,"translateImageViewItemStarted");function oBc(t){let e=!zEe(t.status);return Bh("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{path:t.path}:void 0,error:e?void 0:{message:`Image view ${t.status??"failed"}`}})}a(oBc,"translateImageViewItemCompleted");function sBc(t){return Bh("tool.execution_start",{toolCallId:t.id,toolName:t.tool,arguments:t.arguments??{}})}a(sBc,"translateDynamicToolCallItemStarted");function aBc(t){let e=t.success!==void 0?t.success:!zEe(t.status)&&!t.error;return Bh("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:t.contentItems}:void 0,error:e?void 0:{message:t.error??`Tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(aBc,"translateDynamicToolCallItemCompleted");function cBc(t,e,r){return D8r(t,e).reasoningIds.push(r.id),null}a(cBc,"translateReasoningItemStarted");function lBc(t,e){let r=e.turnStreamCtx.get(t.turnId)?.reasoningIds,n=r&&r.length>0?r[r.length-1]:void 0;return Bh("assistant.reasoning_delta",{reasoningId:t.itemId||t.reasoningId||n||`codex-reasoning:${t.turnId}`,deltaContent:t.delta},!0)}a(lBc,"translateReasoningDelta");function uBc(t,e,r){let n=t.turnStreamCtx.get(e)?.reasoningIds.shift()??r.id,o=dBc(r);return o?Bh("assistant.reasoning",{reasoningId:n,content:o}):null}a(uBc,"translateReasoningItemCompleted");function dBc(t){let e=[];for(let r of[t.summary,t.content])if(Array.isArray(r))for(let n of r)typeof n=="string"?n.length>0&&e.push(n):n&&typeof n.text=="string"&&n.text.length>0&&e.push(n.text);return e.join(` +`).trim()}a(dBc,"extractReasoningText");function fBc(t,e,r){if(!t?.itemId||!t.threadId||r===void 0)return null;let n=t.questions??[];if(n.length===0)return null;let o=t.autoResolutionMs??void 0,s=new Set,c=[];for(let l of n){if(typeof l?.id!="string"||l.id.length===0||s.has(l.id)||typeof l.question!="string"||l.question.length===0)continue;let u=P8r(t.itemId,l.id);e.pendingUserInputs.set(u,{itemId:t.itemId,questionId:l.id}),s.add(l.id);let d=l.options&&l.options.length>0?l.options.map(f=>f.label):void 0;c.push(Bh("user_input.requested",{requestId:u,question:l.header?`${l.header} +${l.question}`:l.question,...d!==void 0?{choices:d}:{},allowFreeform:!0,...o!==void 0?{autoResolutionMs:o}:{}}))}return c.length===0?null:(e.pendingUserInputAggregates.set(t.itemId,{requestJsonRpcId:r,expectedQuestionIds:s,answers:new Map}),c)}a(fBc,"translateRequestUserInput");function N8r(t){return t.includes("commandExecution")?"shell":t.includes("fileChange")?"write":t.includes("permissions")?"permissions":"unknown"}a(N8r,"codexApprovalKind");function M8r(t,e){return`codex-perm:${t}:${e}`}a(M8r,"composePermissionRequestId");function pBc(t,e,r){if(!e?.itemId)return null;let n=N8r(t),o=M8r(e.itemId,n),s=r.pendingApprovalSubjects.get(e.itemId);return Bh("permission.requested",{requestId:o,permissionRequest:hBc(n,t,e,s)})}a(pBc,"translateRequestApproval");function hBc(t,e,r,n){let o={kind:t,method:e,toolCallId:r.itemId,payload:r};switch(t){case"shell":return{...o,...ABc(r,_Bc(n)?n:void 0)};case"write":return{...o,...yBc(r,EBc(n)?n:void 0)};case"permissions":return{...o,...mBc(r)};default:return{...o,intention:Qy(r.reason)}}}a(hBc,"buildCodexPermissionRequest");function mBc(t){let e=Array.isArray(t.grants)?t.grants:[],r=e.find(l=>!!l&&typeof l=="object"),n=r?Qy(r.kind):void 0,o=r?Qy(r.url)??Qy(r.host):void 0,s=r?Qy(r.path)??Qy(r.root):void 0,c=gIt([s]);return{intention:Qy(t.reason)??gBc(n,o??s),...o!==void 0?{url:o}:{},...c.length>0?{possiblePaths:c}:{},...e.length>1?{grantCount:e.length}:{}}}a(mBc,"buildPermissionsPermissionRequest");function gBc(t,e){return t&&e?`Grant ${t} access to ${e}`:e?`Grant access to ${e}`:t?`Grant ${t} access`:"Grant additional permission"}a(gBc,"describePermissionsIntention");function ABc(t,e){let r=Qy(t.command)??e?.command,n=Qy(t.cwd)??e?.cwd,o=vBc(t.commandActions,e?.commandActions,r),s=gIt([n]);return{intention:Qy(t.reason)??CBc(r,n),...r!==void 0?{fullCommandText:r}:{},...o.length>0?{commands:o}:{},...s.length>0?{possiblePaths:s}:{}}}a(ABc,"buildShellPermissionRequest");function yBc(t,e){let r=bBc(e,t),n=r[0]?.path??Qy(t.grantRoot),o=gIt([...r.map(c=>c.path),Qy(t.grantRoot)]),s=SBc(r);return{intention:Qy(t.reason)??TBc(r,n),...n!==void 0?{fileName:n}:{},...s!==void 0?{diff:s}:{},...o.length>0?{possiblePaths:o}:{}}}a(yBc,"buildWritePermissionRequest");function Qy(t){return typeof t=="string"&&t.length>0?t:void 0}a(Qy,"stringOrUndefined");function _Bc(t){return t?.type==="commandExecution"}a(_Bc,"isCodexCommandExecutionItem");function EBc(t){return t?.type==="fileChange"}a(EBc,"isCodexFileChangeItem");function vBc(t,e,r){let o=(Array.isArray(t)?t:e??[]).map(s=>s&&typeof s=="object"?Qy(s.command):void 0).filter(s=>s!==void 0);return o.length===0&&r!==void 0&&o.push(r),gIt(o).map(s=>({identifier:s,readOnly:!1}))}a(vBc,"buildShellPermissionCommands");function gIt(t){return[...new Set(t.filter(e=>e!==void 0&&e.length>0))]}a(gIt,"distinctNonEmptyStrings");function CBc(t,e){return t&&e?`Run shell command in ${e}: ${t}`:t?`Run shell command: ${t}`:e?`Run shell command in ${e}`:"Run shell command"}a(CBc,"describeShellIntention");function bBc(t,e){if(t?.changes)return t.changes;let r=e.changes;return Array.isArray(r)?r.map(n=>{if(!n||typeof n!="object")return;let o=Qy(n.path),s=Qy(n.kind);if(!o||!s)return;let c=Qy(n.diff);return c!==void 0?{path:o,kind:s,diff:c}:{path:o,kind:s}}).filter(n=>n!==void 0):[]}a(bBc,"extractFileChanges");function SBc(t){let e=t.filter(r=>typeof r.diff=="string");if(e.length!==0)return e.length===1?e[0].diff:e.map(r=>`# ${r.path} ${r.diff}`).join(` -`)}a(CBc,"summarizeFileChangeDiff");function bBc(t,e){if(t.length===1){let r=t[0];switch(r.kind){case"add":return`Create file ${r.path}`;case"delete":return`Delete file ${r.path}`;default:return`Modify file ${r.path}`}}return t.length>1?`Apply file changes to ${t.length} files`:e!==void 0?`Modify file ${e}`:"Apply file changes"}a(bBc,"describeWriteIntention");p();var rM=fe(require("path"));function Fzi(t,e){let r=rM.relative(t,e);return r===""||!r.startsWith("..")&&!rM.isAbsolute(r)}a(Fzi,"isEqualOrChild");function Uzi(t,e,r){if(!e||!r||!rM.isAbsolute(t))return t;let n=rM.resolve(e),o=rM.resolve(r),s=rM.resolve(t);if(n===o||!Fzi(n,s))return t;let c=rM.resolve(o,rM.relative(n,s));return Fzi(o,c)?c:t}a(Uzi,"remapCodexReferencePath");var noe=fe(require("path"));Fo();var lc=new pe("CodexAgentService");function yW(t){if(!t)return;let e=ys(t);return e||(noe.isAbsolute(t)?noe.normalize(t):void 0)}a(yW,"resolveWorkspaceCwd");function toe(t,e){return yW(t.cwd??t.thread.cwd)??e}a(toe,"resolveThreadCwd");var roe=class{constructor(e){this.ctx=e;this.initialized=!1;this.processGeneration=0;this.sessions=new Map;this.stateService=new VEe,this.proxyServer=new dIt(e,this.stateService),this.notificationSender=e.get(ss),this.codexPath=this.resolveCodexPath()}static{a(this,"CodexAgentService")}async reattachSessionToCurrentProcess(e){try{let r=await this.processManager.sendRequest("thread/resume",{threadId:e.threadId,...e.cwd&&{cwd:e.cwd}});e.threadId=r.thread.id,e.cwd=toe(r,e.cwd)}catch(r){lc.warn(this.ctx,"Failed to reattach stale Codex session, creating fresh thread",{sessionId:e.sessionId,error:String(r)});let n=await this.processManager.sendRequest("thread/start",e.cwd?{cwd:e.cwd}:{});e.threadId=n.thread.id,e.cwd=toe(n,e.cwd)}e.processGeneration=this.processGeneration}resolveWorkspaceRootForCwd(e){if(e)try{return this.ctx.get($r).getWorkspaceFolders().map(n=>yW(n.uri)).filter(n=>n!==void 0).filter(n=>{let o=noe.relative(n,e);return o===""||!o.startsWith("..")&&!noe.isAbsolute(o)}).sort((n,o)=>o.length-n.length)[0]??e}catch(r){return lc.debug(this.ctx,"resolveWorkspaceRootForCwd: falling back to cwd",{cwd:e,error:String(r)}),e}}resolveCodexPath(){let e=kt(this.ctx,ze.CodexCliPath);if(e)return e;let r=process.env.CODEX_CLI_PATH;return r||(process.platform==="win32"?"codex.exe":"codex")}async ensureRunning(){if(this.processManager?.isRunning())return;if(this.codexPath=this.resolveCodexPath(),this.initialized=!1,!this.workspaceCwd)try{let r=this.ctx.get($r).getWorkspaceFolders();r.length>0&&(this.workspaceCwd=yW(r[0].uri))}catch{}let e=await this.proxyServer.start();this.processGeneration++,this.processManager=new uIt(this.ctx,this.codexPath,e,this.workspaceCwd),this.processManager.onNotification((r,n)=>{this.handleNotification(r,n)}),this.processManager.onServerRequest("item/tool/requestUserInput",(r,n)=>{this.handleNotification("item/tool/requestUserInput",r,n)});for(let r of Qzi)this.processManager.onServerRequest(r,(n,o)=>{this.handleNotification(r,n,o)});this.processManager.on("error",r=>{lc.error(this.ctx,"Codex process died",{error:r.message}),this.initialized=!1,this.emitErrorToAllSessions(r.message)}),this.processManager.start(),await new Promise(r=>setTimeout(r,1e3))}async ensureInitialized(){if(await this.ensureRunning(),!this.initialized)try{await this.processManager.sendRequest("initialize",{clientInfo:{name:"copilot-jetbrains",title:"GitHub Copilot for JetBrains",version:"1.0.0"},capabilities:{experimentalApi:!0}}),this.processManager.sendNotification("initialized",{}),this.initialized=!0,await new Promise(e=>setTimeout(e,300))}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to initialize Codex process: ${r}`)}}async createSession(e){return Ch(this.ctx,"codexAgent.createSession",async r=>{lc.info(this.ctx,"createSession",{clientSessionId:e.sessionId,model:e.model});let n=yW(e.workspaceFolder?.uri),o=yW(e.mcpDirectory);!this.workspaceCwd&&n&&(this.workspaceCwd=n),await this.ensureInitialized();let s=await this.processManager.sendRequest("thread/start",{...n&&{cwd:n}}),c=toe(s,n),l=s.thread.id,u=new Date().toISOString();return this.sessions.set(l,{sessionId:l,threadId:s.thread.id,workspacePath:e.workspaceFolder?.uri,workspaceRoot:n,originalProjectRoot:o,cwd:c,processGeneration:this.processGeneration,model:e.model,reasoningEffort:e.reasoningEffort,startTime:u,modifiedTime:u,translatorState:WEe()}),r.properties.sessionId=l,r.properties.modelId=e.model??"",{sessionId:l,workspacePath:e.workspaceFolder?.uri}})}async resumeSession(e){return Ch(this.ctx,"codexAgent.resumeSession",async r=>{let n=e.sessionId;lc.info(this.ctx,"resumeSession",{threadId:n}),r.properties.sessionId=n;let o=yW(e.workspaceFolder?.uri),s=yW(e.mcpDirectory),c=this.sessions.get(n);if(c){let d=!1;e.workspaceFolder?.uri&&(c.workspacePath=e.workspaceFolder.uri),s&&(c.originalProjectRoot=s),o&&Eg(o)!==Eg(c.workspaceRoot??"")&&(c.workspaceRoot=o,c.cwd=o,d=!0),!this.processManager?.isRunning()&&c.cwd&&(this.workspaceCwd=c.cwd),await this.ensureInitialized(),(c.processGeneration!==this.processGeneration||d)&&await this.reattachSessionToCurrentProcess(c),r.properties.reason="inMemory";let f=await this.loadHistoricalEvents(c.sessionId,r,e.model??c.model);return r.measurements.eventCount=f?.length??0,{sessionId:c.sessionId,workspacePath:c.workspacePath,events:f}}let l=o??this.workspaceCwd;!this.workspaceCwd&&l&&(this.workspaceCwd=l),await this.ensureInitialized();try{let d=await this.processManager.sendRequest("thread/resume",{threadId:n,...l&&{cwd:l}}),f=toe(d,l),h=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:d.thread.id,workspacePath:e.workspaceFolder?.uri,workspaceRoot:o??f,originalProjectRoot:s,cwd:f,processGeneration:this.processGeneration,model:e.model,reasoningEffort:e.reasoningEffort,startTime:h,modifiedTime:h,summary:"(resumed)",translatorState:WEe()})}catch(d){let f=d instanceof Error?d.message:String(d);lc.warn(this.ctx,"resumeSession: thread/resume failed, creating fresh thread",{threadId:n,error:f});let h=await this.processManager.sendRequest("thread/start",l?{cwd:l}:{}),m=toe(h,l),g=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:h.thread.id,workspacePath:e.workspaceFolder?.uri,workspaceRoot:o??m,originalProjectRoot:s,cwd:m,processGeneration:this.processGeneration,model:e.model,reasoningEffort:e.reasoningEffort,startTime:g,modifiedTime:g,summary:"(resumed - fresh)",translatorState:WEe()}),r.properties.freshThread="true"}let u=await this.loadHistoricalEvents(n,r,e.model);return r.measurements.eventCount=u?.length??0,{sessionId:n,workspacePath:e.workspaceFolder?.uri,events:u}})}async loadHistoricalEvents(e,r,n){try{let o=await pIt(e);if(!o){r.properties.rolloutMissing="true",lc.debug(this.ctx,"loadHistoricalEvents: rollout file not found",{threadId:e});return}let s=await hIt(o);if(!s){r.properties.rolloutReadFailed="true",lc.warn(this.ctx,"loadHistoricalEvents: rollout translation returned null",{threadId:e,rolloutPath:o});return}if(n)for(let c of s)c.type==="assistant.usage"&&c.data&&(c.data.model=n);return s}catch(o){let s=o instanceof Error?o.message:String(o);r.properties.rolloutReadFailed="true",lc.warn(this.ctx,"loadHistoricalEvents: error reading rollout",{threadId:e,error:s});return}}async sendMessage(e,r){return Ch(this.ctx,"codexAgent.sendMessage",async n=>{lc.info(this.ctx,"sendMessage",{sessionId:e.sessionId}),n.properties.sessionId=e.sessionId,n.properties.modelId=e.model??"";let o=this.sessions.get(e.sessionId);if(!this.processManager?.isRunning()&&o?.cwd&&(this.workspaceCwd=o.cwd),await this.ensureInitialized(),o&&o.processGeneration!==this.processGeneration&&await this.reattachSessionToCurrentProcess(o),!o){lc.info(this.ctx,"sendMessage: session not in memory, auto-recovering");try{let d=await this.processManager.sendRequest("thread/resume",{threadId:e.sessionId}),f=toe(d,this.workspaceCwd),h=this.resolveWorkspaceRootForCwd(f),m=new Date().toISOString();o={sessionId:e.sessionId,threadId:d.thread.id,workspacePath:h?Ko(h):void 0,workspaceRoot:h,cwd:f,processGeneration:this.processGeneration,model:e.model,reasoningEffort:e.reasoningEffort,startTime:m,modifiedTime:m,translatorState:WEe()},this.sessions.set(e.sessionId,o)}catch(d){lc.warn(this.ctx,"sendMessage: thread/resume failed, creating fresh thread",{error:String(d)});let f=await this.processManager.sendRequest("thread/start",this.workspaceCwd?{cwd:this.workspaceCwd}:{}),h=toe(f,this.workspaceCwd),m=this.resolveWorkspaceRootForCwd(h),g=new Date().toISOString();o={sessionId:e.sessionId,threadId:f.thread.id,workspacePath:m?Ko(m):void 0,workspaceRoot:m,cwd:h,processGeneration:this.processGeneration,model:e.model,reasoningEffort:e.reasoningEffort,startTime:g,modifiedTime:g,translatorState:WEe()},this.sessions.set(e.sessionId,o)}}let s=[];if(e.references?.length){let d=e.references.filter(f=>f.type==="file").map(f=>{let h=yW(f.uri)??f.uri;return Uzi(h,o.originalProjectRoot,o.workspaceRoot)});d.length>0&&s.push({type:"text",text:`[Referenced files: ${d.join(", ")}] +`)}a(SBc,"summarizeFileChangeDiff");function TBc(t,e){if(t.length===1){let r=t[0];switch(r.kind){case"add":return`Create file ${r.path}`;case"delete":return`Delete file ${r.path}`;default:return`Modify file ${r.path}`}}return t.length>1?`Apply file changes to ${t.length} files`:e!==void 0?`Modify file ${e}`:"Apply file changes"}a(TBc,"describeWriteIntention");p();var rM=fe(require("path"));function Qzi(t,e){let r=rM.relative(t,e);return r===""||!r.startsWith("..")&&!rM.isAbsolute(r)}a(Qzi,"isEqualOrChild");function qzi(t,e,r){if(!e||!r||!rM.isAbsolute(t))return t;let n=rM.resolve(e),o=rM.resolve(r),s=rM.resolve(t);if(n===o||!Qzi(n,s))return t;let c=rM.resolve(o,rM.relative(n,s));return Qzi(o,c)?c:t}a(qzi,"remapCodexReferencePath");var ioe=fe(require("path"));Fo();var lc=new pe("CodexAgentService");function _W(t){if(!t)return;let e=ys(t);return e||(ioe.isAbsolute(t)?ioe.normalize(t):void 0)}a(_W,"resolveWorkspaceCwd");function roe(t,e){return _W(t.cwd??t.thread.cwd)??e}a(roe,"resolveThreadCwd");var noe=class{constructor(e){this.ctx=e;this.initialized=!1;this.processGeneration=0;this.sessions=new Map;this.stateService=new VEe,this.proxyServer=new fIt(e,this.stateService),this.notificationSender=e.get(ss),this.codexPath=this.resolveCodexPath()}static{a(this,"CodexAgentService")}async reattachSessionToCurrentProcess(e){try{let r=await this.processManager.sendRequest("thread/resume",{threadId:e.threadId,...e.cwd&&{cwd:e.cwd}});e.threadId=r.thread.id,e.cwd=roe(r,e.cwd)}catch(r){lc.warn(this.ctx,"Failed to reattach stale Codex session, creating fresh thread",{sessionId:e.sessionId,error:String(r)});let n=await this.processManager.sendRequest("thread/start",e.cwd?{cwd:e.cwd}:{});e.threadId=n.thread.id,e.cwd=roe(n,e.cwd)}e.processGeneration=this.processGeneration}resolveWorkspaceRootForCwd(e){if(e)try{return this.ctx.get($r).getWorkspaceFolders().map(n=>_W(n.uri)).filter(n=>n!==void 0).filter(n=>{let o=ioe.relative(n,e);return o===""||!o.startsWith("..")&&!ioe.isAbsolute(o)}).sort((n,o)=>o.length-n.length)[0]??e}catch(r){return lc.debug(this.ctx,"resolveWorkspaceRootForCwd: falling back to cwd",{cwd:e,error:String(r)}),e}}resolveCodexPath(){let e=kt(this.ctx,ze.CodexCliPath);if(e)return e;let r=process.env.CODEX_CLI_PATH;return r||(process.platform==="win32"?"codex.exe":"codex")}async ensureRunning(){if(this.processManager?.isRunning())return;if(this.codexPath=this.resolveCodexPath(),this.initialized=!1,!this.workspaceCwd)try{let r=this.ctx.get($r).getWorkspaceFolders();r.length>0&&(this.workspaceCwd=_W(r[0].uri))}catch{}let e=await this.proxyServer.start();this.processGeneration++,this.processManager=new dIt(this.ctx,this.codexPath,e,this.workspaceCwd),this.processManager.onNotification((r,n)=>{this.handleNotification(r,n)}),this.processManager.onServerRequest("item/tool/requestUserInput",(r,n)=>{this.handleNotification("item/tool/requestUserInput",r,n)});for(let r of jzi)this.processManager.onServerRequest(r,(n,o)=>{this.handleNotification(r,n,o)});this.processManager.on("error",r=>{lc.error(this.ctx,"Codex process died",{error:r.message}),this.initialized=!1,this.emitErrorToAllSessions(r.message)}),this.processManager.start(),await new Promise(r=>setTimeout(r,1e3))}async ensureInitialized(){if(await this.ensureRunning(),!this.initialized)try{await this.processManager.sendRequest("initialize",{clientInfo:{name:"copilot-jetbrains",title:"GitHub Copilot for JetBrains",version:"1.0.0"},capabilities:{experimentalApi:!0}}),this.processManager.sendNotification("initialized",{}),this.initialized=!0,await new Promise(e=>setTimeout(e,300))}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to initialize Codex process: ${r}`)}}async createSession(e){return Ch(this.ctx,"codexAgent.createSession",async r=>{lc.info(this.ctx,"createSession",{clientSessionId:e.sessionId,model:e.model});let n=_W(e.workspaceFolder?.uri),o=_W(e.mcpDirectory);!this.workspaceCwd&&n&&(this.workspaceCwd=n),await this.ensureInitialized();let s=await this.processManager.sendRequest("thread/start",{...n&&{cwd:n}}),c=roe(s,n),l=s.thread.id,u=new Date().toISOString();return this.sessions.set(l,{sessionId:l,threadId:s.thread.id,workspacePath:e.workspaceFolder?.uri,workspaceRoot:n,originalProjectRoot:o,cwd:c,processGeneration:this.processGeneration,model:e.model,reasoningEffort:e.reasoningEffort,startTime:u,modifiedTime:u,translatorState:WEe()}),r.properties.sessionId=l,r.properties.modelId=e.model??"",{sessionId:l,workspacePath:e.workspaceFolder?.uri}})}async resumeSession(e){return Ch(this.ctx,"codexAgent.resumeSession",async r=>{let n=e.sessionId;lc.info(this.ctx,"resumeSession",{threadId:n}),r.properties.sessionId=n;let o=_W(e.workspaceFolder?.uri),s=_W(e.mcpDirectory),c=this.sessions.get(n);if(c){let d=!1;e.workspaceFolder?.uri&&(c.workspacePath=e.workspaceFolder.uri),s&&(c.originalProjectRoot=s),o&&vg(o)!==vg(c.workspaceRoot??"")&&(c.workspaceRoot=o,c.cwd=o,d=!0),!this.processManager?.isRunning()&&c.cwd&&(this.workspaceCwd=c.cwd),await this.ensureInitialized(),(c.processGeneration!==this.processGeneration||d)&&await this.reattachSessionToCurrentProcess(c),r.properties.reason="inMemory";let f=await this.loadHistoricalEvents(c.sessionId,r,e.model??c.model);return r.measurements.eventCount=f?.length??0,{sessionId:c.sessionId,workspacePath:c.workspacePath,events:f}}let l=o??this.workspaceCwd;!this.workspaceCwd&&l&&(this.workspaceCwd=l),await this.ensureInitialized();try{let d=await this.processManager.sendRequest("thread/resume",{threadId:n,...l&&{cwd:l}}),f=roe(d,l),h=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:d.thread.id,workspacePath:e.workspaceFolder?.uri,workspaceRoot:o??f,originalProjectRoot:s,cwd:f,processGeneration:this.processGeneration,model:e.model,reasoningEffort:e.reasoningEffort,startTime:h,modifiedTime:h,summary:"(resumed)",translatorState:WEe()})}catch(d){let f=d instanceof Error?d.message:String(d);lc.warn(this.ctx,"resumeSession: thread/resume failed, creating fresh thread",{threadId:n,error:f});let h=await this.processManager.sendRequest("thread/start",l?{cwd:l}:{}),m=roe(h,l),g=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:h.thread.id,workspacePath:e.workspaceFolder?.uri,workspaceRoot:o??m,originalProjectRoot:s,cwd:m,processGeneration:this.processGeneration,model:e.model,reasoningEffort:e.reasoningEffort,startTime:g,modifiedTime:g,summary:"(resumed - fresh)",translatorState:WEe()}),r.properties.freshThread="true"}let u=await this.loadHistoricalEvents(n,r,e.model);return r.measurements.eventCount=u?.length??0,{sessionId:n,workspacePath:e.workspaceFolder?.uri,events:u}})}async loadHistoricalEvents(e,r,n){try{let o=await hIt(e);if(!o){r.properties.rolloutMissing="true",lc.debug(this.ctx,"loadHistoricalEvents: rollout file not found",{threadId:e});return}let s=await mIt(o);if(!s){r.properties.rolloutReadFailed="true",lc.warn(this.ctx,"loadHistoricalEvents: rollout translation returned null",{threadId:e,rolloutPath:o});return}if(n)for(let c of s)c.type==="assistant.usage"&&c.data&&(c.data.model=n);return s}catch(o){let s=o instanceof Error?o.message:String(o);r.properties.rolloutReadFailed="true",lc.warn(this.ctx,"loadHistoricalEvents: error reading rollout",{threadId:e,error:s});return}}async sendMessage(e,r){return Ch(this.ctx,"codexAgent.sendMessage",async n=>{lc.info(this.ctx,"sendMessage",{sessionId:e.sessionId}),n.properties.sessionId=e.sessionId,n.properties.modelId=e.model??"";let o=this.sessions.get(e.sessionId);if(!this.processManager?.isRunning()&&o?.cwd&&(this.workspaceCwd=o.cwd),await this.ensureInitialized(),o&&o.processGeneration!==this.processGeneration&&await this.reattachSessionToCurrentProcess(o),!o){lc.info(this.ctx,"sendMessage: session not in memory, auto-recovering");try{let d=await this.processManager.sendRequest("thread/resume",{threadId:e.sessionId}),f=roe(d,this.workspaceCwd),h=this.resolveWorkspaceRootForCwd(f),m=new Date().toISOString();o={sessionId:e.sessionId,threadId:d.thread.id,workspacePath:h?Ko(h):void 0,workspaceRoot:h,cwd:f,processGeneration:this.processGeneration,model:e.model,reasoningEffort:e.reasoningEffort,startTime:m,modifiedTime:m,translatorState:WEe()},this.sessions.set(e.sessionId,o)}catch(d){lc.warn(this.ctx,"sendMessage: thread/resume failed, creating fresh thread",{error:String(d)});let f=await this.processManager.sendRequest("thread/start",this.workspaceCwd?{cwd:this.workspaceCwd}:{}),h=roe(f,this.workspaceCwd),m=this.resolveWorkspaceRootForCwd(h),g=new Date().toISOString();o={sessionId:e.sessionId,threadId:f.thread.id,workspacePath:m?Ko(m):void 0,workspaceRoot:m,cwd:h,processGeneration:this.processGeneration,model:e.model,reasoningEffort:e.reasoningEffort,startTime:g,modifiedTime:g,translatorState:WEe()},this.sessions.set(e.sessionId,o)}}let s=[];if(e.references?.length){let d=e.references.filter(f=>f.type==="file").map(f=>{let h=_W(f.uri)??f.uri;return qzi(h,o.originalProjectRoot,o.workspaceRoot)});d.length>0&&s.push({type:"text",text:`[Referenced files: ${d.join(", ")}] -`})}s.push({type:"text",text:e.message});let c=e.model||o.model,l=e.reasoningEffort??o.reasoningEffort;this.stateService.setActiveThread(o.threadId);let u=await this.processManager.sendRequest("turn/start",{...c?{model:c}:{},...l?{effort:l}:{},threadId:o.threadId,input:s});return o.turnId=u.turnId,e.model&&(o.model=e.model),e.reasoningEffort&&(o.reasoningEffort=e.reasoningEffort),o.modifiedTime=new Date().toISOString(),o.summary||(o.summary=e.message.slice(0,100)),n.measurements.messageCharLen=e.message.length,{messageId:u.turnId}})}truncateHistory(e){return Promise.reject(new Error("truncateHistory is not supported for Codex sessions"))}forkSession(e){return Promise.reject(new Error("forkSession is not supported for Codex sessions"))}async stopSession(e){let r=this.sessions.get(e);r&&(this.drainAndCloseUserInputs(r,!0),this.drainPendingPermissions(e,!0),r.turnId&&(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),lc.info(this.ctx,"CodexAgentService.stopSession",{sessionId:e})))}destroySession(e){let r=this.sessions.get(e.sessionId);return r&&(this.drainAndCloseUserInputs(r,!0),this.drainPendingPermissions(e.sessionId,!0),this.stateService.clear(r.threadId)),this.sessions.delete(e.sessionId),lc.info(this.ctx,"CodexAgentService.destroySession",{sessionId:e.sessionId}),Promise.resolve({success:!0})}listSessions(e){let r=Array.from(this.sessions.values()).map(n=>({sessionId:n.sessionId,startTime:n.startTime,modifiedTime:n.modifiedTime,summary:n.summary,isRemote:!1,context:n.cwd?{cwd:n.cwd}:void 0}));return r.sort((n,o)=>o.modifiedTime.localeCompare(n.modifiedTime)),lc.info(this.ctx,`CodexAgentService.listSessions: ${r.length} sessions`),Promise.resolve({sessions:r})}async listModels(e){try{let o=(await this.ctx.get(Ns).getMetadata(e)).filter(s=>s.supported_endpoints?.includes(EWe.Responses)&&s.model_picker_enabled&&s.capabilities.type==="chat");if(o.length>0){let s=o.map(ope);return s.forEach(SBc),lc.info(this.ctx,`CodexAgentService.listModels: ${s.length} responses-capable models from CAPI`),{models:s}}lc.warn(this.ctx,"CodexAgentService.listModels: no responses-capable models found in CAPI")}catch(r){let n=r instanceof Error?r.message:String(r);lc.warn(this.ctx,`CodexAgentService.listModels: CAPI query failed: ${n}, using fallback`)}return{models:[{id:"codex-default",name:"Codex (Default)",preview:!1,capabilities:{family:"codex",supports:{vision:!1},limits:{max_context_window_tokens:128e3}}}]}}handleInteraction(e){lc.info(this.ctx,"handleInteraction",{sessionId:e.sessionId,requestId:e.requestId,type:e.type});let r=this.sessions.get(e.sessionId);if(!r)return lc.warn(this.ctx,"handleInteraction: unknown session",{sessionId:e.sessionId}),Promise.resolve({success:!1});switch(e.type){case"user_input":return this.handleUserInputInteraction(r,e);case"permission":return this.handlePermissionInteraction(r,e);default:return lc.warn(this.ctx,"handleInteraction: unsupported type for Codex",{sessionId:e.sessionId,type:e.type}),Promise.resolve({success:!1})}}handleUserInputInteraction(e,r){let n=e.translatorState,o=n.pendingUserInputs.get(r.requestId);if(!o)return lc.warn(this.ctx,"handleInteraction: user_input for unknown requestId",{sessionId:r.sessionId,requestId:r.requestId}),Promise.resolve({success:!1});n.pendingUserInputs.delete(r.requestId),this.emitUserInputCompleted(e.sessionId,r.requestId,r.response);let s=n.pendingUserInputAggregates.get(o.itemId);if(!s)return lc.warn(this.ctx,"handleInteraction: user_input aggregate missing",{sessionId:r.sessionId,requestId:r.requestId,itemId:o.itemId}),Promise.resolve({success:!1});if(s.answers.set(o.questionId,{answer:r.response.answer,wasFreeform:r.response.wasFreeform}),s.answers.size0){let h=D8r(e),m=N8r(f,h);this.stateService.setPendingPermission(c.sessionId,m,{codexJsonRpcId:n,method:e})}else lc.warn(this.ctx,`handleNotification: approval ${e} missing itemId, cannot correlate reply`)}if(e==="turn/started"){let f=r;f.turn?.id&&(c.turnId=f.turn.id)}let l;e==="turn/completed"&&(l={copilotUsageNanoAiu:this.stateService.takeCopilotUsageNanoAiuForThread(s)},this.stateService.setActiveThread(void 0));let u=Lzi(e,r,c.translatorState,n,l);if(!u)return;let d=Array.isArray(u)?u:[u];for(let f of d)f.type==="assistant.usage"&&f.data&&c.model&&(f.data.model=c.model),this.notificationSender.sendBackgroundAgentSessionUpdate(c.sessionId,f,"CODEX")}findSessionByThreadId(e){for(let r of this.sessions.values())if(r.threadId===e)return r}emitUserInputCompleted(e,r,n){let o={id:Dt(),timestamp:new Date().toISOString(),type:"user_input.completed",data:{requestId:r,answer:n.answer,wasFreeform:n.wasFreeform}};this.notificationSender.sendBackgroundAgentSessionUpdate(e,o,"CODEX")}emitPermissionCompleted(e,r,n){let o={id:Dt(),timestamp:new Date().toISOString(),type:"permission.completed",data:{requestId:r,result:{kind:n}}};this.notificationSender.sendBackgroundAgentSessionUpdate(e,o,"CODEX")}emitSessionError(e,r,n){let o={id:Dt(),timestamp:new Date().toISOString(),type:"session.error",data:{errorType:r,message:n}};this.notificationSender.sendBackgroundAgentSessionUpdate(e,o,"CODEX");let s={id:Dt(),timestamp:new Date().toISOString(),type:"session.idle"};this.notificationSender.sendBackgroundAgentSessionUpdate(e,s,"CODEX")}drainAndCloseUserInputs(e,r){let n=e.translatorState;if(n.pendingUserInputAggregates.size===0){n.pendingUserInputs.clear();return}for(let[o,s]of n.pendingUserInputAggregates){if(r&&this.processManager?.isRunning()){let c={};for(let l of s.expectedQuestionIds)c[l]={answers:[]};try{this.processManager.sendRawResponse(s.requestJsonRpcId,{answers:c})}catch(l){let u=l instanceof Error?l.message:String(l);lc.warn(this.ctx,"drainAndCloseUserInputs: failed to notify Codex",{sessionId:e.sessionId,itemId:o,error:u})}}for(let c of s.expectedQuestionIds)this.emitUserInputCompleted(e.sessionId,k8r(o,c),{answer:"",wasFreeform:!1})}n.pendingUserInputs.clear(),n.pendingUserInputAggregates.clear()}drainPendingPermissions(e,r){let n=this.stateService.takeAllPendingPermissionsForSession(e);for(let[o,s]of n){if(r&&this.processManager?.isRunning()&&s.codexJsonRpcId!==void 0)try{this.processManager.sendRawResponse(s.codexJsonRpcId,qzi(s,!1))}catch(c){let l=c instanceof Error?c.message:String(c);lc.warn(this.ctx,"drainPendingPermissions: failed to notify Codex",{sessionId:e,requestId:o,error:l})}this.emitPermissionCompleted(e,o,"denied")}}emitErrorToAllSessions(e){for(let r of this.sessions.values())this.drainAndCloseUserInputs(r,!1),this.drainPendingPermissions(r.sessionId,!1),this.emitSessionError(r.sessionId,"process_crash",`Codex process terminated unexpectedly: ${e}. Send a new message to retry.`)}async dispose(){for(let e of this.sessions.values())this.drainAndCloseUserInputs(e,!1),this.drainPendingPermissions(e.sessionId,!1);await this.processManager?.stop(),await this.proxyServer.stop()}};function SBc(t){let e=t.billing?.token_prices;if(!e||!("long_context"in e))return;let{long_context:r,...n}=e;Object.keys(n).length>0?t.billing.token_prices=n:(delete t.billing.token_prices,Object.keys(t.billing).length===0&&delete t.billing)}a(SBc,"stripLongContextPricing");var Qzi=["item/commandExecution/requestApproval","item/fileChange/requestApproval","item/permissions/requestApproval"];function qzi(t,e){return{decision:e?"accept":"decline"}}a(qzi,"responseFor");var jzi=new pe("AgentRouter"),Hzi="AgentRouter";function GI(t){return t.agentProvider??"BACKGROUND"}a(GI,"resolveProvider");var Va=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(Ys);case"CLAUDE":return this.ctx.get(t6);case"CODEX":return this.ctx.get(roe);case"CLOUD":return this.ctx.get(eoe)}}logDispatch(e,r){jzi.debug(this.ctx,`${Hzi}.${e}`,r)}create(e){this.logDispatch("create",e);let r=GI(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=GI(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=GI(e);return this.serviceFor(n).sendMessage(e,r)}truncateHistory(e){this.logDispatch("truncateHistory",e);let r=e.providerName;return this.serviceFor(r).truncateHistory({sessionId:e.sessionId,eventId:e.eventId,providerName:e.providerName})}forkSession(e){this.logDispatch("forkSession",e);let r=e.providerName;return this.serviceFor(r).forkSession(e)}stop(e){this.logDispatch("stop",e);let r=GI(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=GI(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=GI(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=GI(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=GI(e);return this.serviceFor(r).handleInteraction(e)}async getPlanPath(e){this.logDispatch("getPlanPath",e);let r=GI(e);return{path:await this.serviceFor(r).getPlanPath(e.sessionId)}}enableRemote(e){this.logDispatch("enableRemote",e);let r=GI(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=GI(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=GI(e);try{return Promise.resolve(this.serviceFor(r).getRemoteStatus(e.sessionId))}catch(n){return Promise.reject(n instanceof Error?n:new Error(String(n)))}}async compactHistory(e,r){this.logDispatch("compactHistory",e);let n=GI(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{jzi.info(this.ctx,`${Hzi}.compactHistory: cancellation requested, aborting compaction`,{sessionId:e.sessionId}),o.stopCompactHistory(e.sessionId)});try{return await o.compactHistory(e.sessionId)}finally{s?.dispose()}}};p();p();var TBc=b.Union([b.String(),b.Number()]),Si=b.String(),YEe=b.Optional(b.String()),IBc=b.Object({name:b.String(),description:b.String(),title:b.Optional(b.String()),parameters:b.Optional(b.Record(b.String(),b.Unknown())),overridesBuiltInTool:b.Optional(b.Boolean()),skipPermission:b.Optional(b.Boolean())}),M8r=b.Array(IBc),KFe=b.Union([b.Literal("default"),b.Literal("long_context")]),KEe=b.Object({model:b.Optional(b.String()),reasoningEffort:YEe,workspaceFolder:b.Object({uri:b.String(),name:b.Optional(b.String())}),globalAgentsMdInstructions:b.Optional(b.String()),globalClaudeMdInstructions:b.Optional(b.String()),externalToolDefinitions:b.Optional(M8r),useAgentsMdFile:b.Optional(b.Boolean()),useNestedAgentsMdFiles:b.Optional(b.Boolean()),useClaudeMdFile:b.Optional(b.Boolean()),useNestedClaudeMdFiles:b.Optional(b.Boolean()),inlineConfinedFile:b.Optional(b.String()),mcpDirectory:b.Optional(b.String())});async function hi(t){try{return[await t(),null]}catch(e){let r=uot(e),n=e instanceof MZ?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(hi,"withServiceErrorHandling");var Gzi=new pe("BackgroundAgent.compactHistory"),xBc=b.Object({sessionId:Si});async function O8r(t,e,r){Gzi.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(Ys),o=e.onCancellationRequested(()=>{Gzi.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await hi(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(O8r,"handleBackgroundAgentCompactHistoryChecked");var qmh=we(xBc,O8r);p();var JFe=b.Union(Object.values(Ff).map(t=>b.Literal(t))),il=b.Optional(JFe),gIt=b.Intersect([KEe,b.Object({agentProvider:il})]);var $zi=new pe("BackgroundAgent.compactHistory"),wBc=b.Object({sessionId:Si,agentProvider:il});async function RBc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return O8r(t,e,r);$zi.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.compactHistory(s,e);return $zi.info(t,"compactHistory succeeded"),c})}a(RBc,"handleAgentCompactHistoryChecked");var Vzi=we(wBc,RBc);p();p();var Wzi=new pe("BackgroundAgent.create"),kBc=b.Intersect([b.Object({sessionId:b.Optional(b.String())}),KEe]);async function L8r(t,e,r){Wzi.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(Ys),o={sessionId:r.sessionId,model:r.model,reasoningEffort:r.reasoningEffort,workspaceFolder:r.workspaceFolder,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,externalToolDefinitions:r.externalToolDefinitions,useAgentsMdFile:r.useAgentsMdFile,useNestedAgentsMdFiles:r.useNestedAgentsMdFiles,useClaudeMdFile:r.useClaudeMdFile,useNestedClaudeMdFiles:r.useNestedClaudeMdFiles,inlineConfinedFile:r.inlineConfinedFile,mcpDirectory:r.mcpDirectory};return hi(async()=>{let s=await n.createSession(o);return Wzi.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(L8r,"handleBackgroundAgentCreateChecked");var mgh=we(kBc,L8r);var zzi=new pe("BackgroundAgent.create"),PBc=b.Intersect([b.Object({sessionId:b.Optional(b.String())}),gIt]);async function DBc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return L8r(t,e,r);zzi.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.create(s);return zzi.info(t,"create succeeded:",c.sessionId),c})}a(DBc,"handleAgentCreateChecked");var Yzi=we(PBc,DBc);p();p();var NBc=b.Object({sessionId:Si});async function B8r(t,e,r){let n=t.get(Ys);return hi(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a(B8r,"handleBackgroundAgentDestroyChecked");var Ogh=we(NBc,B8r);var MBc=new pe("BackgroundAgent.destroy"),OBc=b.Object({sessionId:Si,agentProvider:il});async function LBc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return B8r(t,e,r);MBc.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>o.destroy(s))}a(LBc,"handleAgentDestroyChecked");var Kzi=we(OBc,LBc);p();p();var BBc=new pe("BackgroundAgent.disableRemote"),FBc=b.Object({sessionId:Si});async function F8r(t,e,r){BBc.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(Ys);return hi(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(F8r,"handleBackgroundAgentDisableRemoteChecked");var r0h=we(FBc,F8r);var Jzi=new pe("BackgroundAgent.disableRemote"),UBc=b.Object({sessionId:Si,agentProvider:il});async function QBc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return F8r(t,e,r);Jzi.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.disableRemote(s);return Jzi.info(t,"disableRemote succeeded"),c})}a(QBc,"handleAgentDisableRemoteChecked");var Zzi=we(UBc,QBc);p();p();var qBc=new pe("BackgroundAgent.enableRemote"),jBc=b.Object({sessionId:Si});async function U8r(t,e,r){qBc.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(Ys);return hi(async()=>n.enableRemote(r.sessionId))}a(U8r,"handleBackgroundAgentEnableRemoteChecked");var b0h=we(jBc,U8r);var Xzi=new pe("BackgroundAgent.enableRemote"),HBc=b.Object({sessionId:Si,agentProvider:il});async function GBc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return U8r(t,e,r);Xzi.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.enableRemote(s);return Xzi.info(t,"enableRemote succeeded"),c})}a(GBc,"handleAgentEnableRemoteChecked");var eYi=we(HBc,GBc);p();var $Bc=b.Object({sessionId:Si,toEventId:b.Optional(b.String()),name:b.Optional(b.String()),agentProvider:JFe});async function VBc(t,e,r){let n=t.get(Va);return hi(async()=>n.forkSession({sessionId:r.sessionId,toEventId:r.toEventId,name:r.name,providerName:r.agentProvider}))}a(VBc,"handleAgentForkChecked");var tYi=we($Bc,VBc);p();p();var WBc=b.Object({sessionId:Si});async function Q8r(t,e,r){let n=t.get(Ys);return hi(async()=>({path:await n.getPlanPath(r.sessionId)}))}a(Q8r,"handleBackgroundAgentGetPlanPathChecked");var J0h=we(WBc,Q8r);var zBc=new pe("BackgroundAgent.getPlanPath"),YBc=b.Object({sessionId:Si,agentProvider:il});async function KBc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return Q8r(t,e,r);zBc.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>o.getPlanPath(s))}a(KBc,"handleAgentGetPlanPathChecked");var rYi=we(YBc,KBc);p();p();var JBc=new pe("BackgroundAgent.getRemoteStatus"),ZBc=b.Object({sessionId:Si});async function q8r(t,e,r){JBc.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(Ys);return hi(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a(q8r,"handleBackgroundAgentGetRemoteStatusChecked");var yAh=we(ZBc,q8r);var XBc=new pe("BackgroundAgent.getRemoteStatus"),e3c=b.Object({sessionId:Si,agentProvider:il});async function t3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return q8r(t,e,r);XBc.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>o.getRemoteStatus(s))}a(t3c,"handleAgentGetRemoteStatusChecked");var nYi=we(e3c,t3c);p();p();var r3c=new pe("BackgroundAgent.interaction"),n3c=b.Union([b.Object({kind:b.Literal("approve-once")}),b.Object({kind:b.Literal("denied-by-rules"),rules:b.Array(b.Unknown())}),b.Object({kind:b.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),b.Object({kind:b.Literal("denied-interactively-by-user"),feedback:b.Optional(b.String())}),b.Object({kind:b.Literal("denied-by-content-exclusion-policy"),path:b.String(),message:b.String()})]),i3c=b.Object({answer:b.String(),wasFreeform:b.Boolean()}),o3c=b.Object({action:b.Union([b.Literal("accept"),b.Literal("decline"),b.Literal("cancel")]),content:b.Optional(b.Record(b.String(),b.Union([b.String(),b.Number(),b.Boolean(),b.Array(b.String())])))}),s3c=b.Object({approved:b.Boolean(),selectedAction:b.Optional(b.Union([b.Literal("exit_only"),b.Literal("interactive"),b.Literal("autopilot"),b.Literal("autopilot_fleet")])),autoApproveEdits:b.Optional(b.Boolean()),feedback:b.Optional(b.String())}),a3c=b.Union([b.Object({handled:b.Literal(!0),stopProcessingQueue:b.Optional(b.Boolean())}),b.Object({handled:b.Literal(!1)})]),c3c=b.Union([b.String(),b.Object({textResultForLlm:b.String(),binaryResultsForLlm:b.Optional(b.Array(b.Object({data:b.String(),mimeType:b.String(),type:b.Union([b.Literal("resource"),b.Literal("image")]),description:b.Optional(b.String())}))),resultType:b.Union([b.Literal("success"),b.Literal("failure"),b.Literal("rejected"),b.Literal("denied")]),error:b.Optional(b.String())})]),l3c=b.Union([b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("permission"),result:n3c}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("user_input"),response:i3c}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("elicitation"),response:o3c}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("exit_plan_mode"),response:s3c}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("queued_command"),result:a3c}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("external_tool"),result:c3c})]);async function j8r(t,e,r){r3c.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(Ys);return hi(async()=>await n.handleInteraction(r))}a(j8r,"handleBackgroundAgentInteractionChecked");var UAh=we(l3c,j8r);var iYi=new pe("BackgroundAgent.interaction"),u3c=b.Union([b.Object({kind:b.Literal("approve-once")}),b.Object({kind:b.Literal("denied-by-rules"),rules:b.Array(b.Unknown())}),b.Object({kind:b.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),b.Object({kind:b.Literal("denied-interactively-by-user"),feedback:b.Optional(b.String())}),b.Object({kind:b.Literal("denied-by-content-exclusion-policy"),path:b.String(),message:b.String()})]),d3c=b.Object({answer:b.String(),wasFreeform:b.Boolean()}),f3c=b.Object({action:b.Union([b.Literal("accept"),b.Literal("decline"),b.Literal("cancel")]),content:b.Optional(b.Record(b.String(),b.Union([b.String(),b.Number(),b.Boolean(),b.Array(b.String())])))}),p3c=b.Object({approved:b.Boolean(),selectedAction:b.Optional(b.Union([b.Literal("exit_only"),b.Literal("interactive"),b.Literal("autopilot"),b.Literal("autopilot_fleet")])),autoApproveEdits:b.Optional(b.Boolean()),feedback:b.Optional(b.String())}),h3c=b.Union([b.Object({handled:b.Literal(!0),stopProcessingQueue:b.Optional(b.Boolean())}),b.Object({handled:b.Literal(!1)})]),m3c=b.Union([b.String(),b.Object({textResultForLlm:b.String(),binaryResultsForLlm:b.Optional(b.Array(b.Object({data:b.String(),mimeType:b.String(),type:b.Union([b.Literal("resource"),b.Literal("image")]),description:b.Optional(b.String())}))),resultType:b.Union([b.Literal("success"),b.Literal("failure"),b.Literal("rejected"),b.Literal("denied")]),error:b.Optional(b.String())})]),g3c=b.Union([b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("permission"),result:u3c,agentProvider:il}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("user_input"),response:d3c,agentProvider:il}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("elicitation"),response:f3c,agentProvider:il}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("exit_plan_mode"),response:p3c,agentProvider:il}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("queued_command"),result:h3c,agentProvider:il}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("external_tool"),result:m3c,agentProvider:il})]);async function A3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return j8r(t,e,r);iYi.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.interaction(s);return iYi.info(t,"interaction succeeded"),c})}a(A3c,"handleAgentInteractionChecked");var oYi=we(g3c,A3c);p();p();var sYi=new pe("BackgroundAgent.listSessions"),y3c=b.Object({cwd:b.Optional(b.String()),gitRoot:b.Optional(b.String()),repository:b.Optional(b.String()),branch:b.Optional(b.String())});async function H8r(t,e,r){sYi.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(Ys);return hi(async()=>{let o=await n.listSessions(r);return sYi.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(H8r,"handleBackgroundAgentSessionsListChecked");var ayh=we(y3c,H8r);var aYi=new pe("BackgroundAgent.listSessions"),_3c=b.Object({cwd:b.Optional(b.String()),gitRoot:b.Optional(b.String()),repository:b.Optional(b.String()),branch:b.Optional(b.String()),agentProvider:il});async function E3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return H8r(t,e,r);aYi.info(t,"handleAgentSessionsList called",r);let o=t.get(Va),s=r;return hi(async()=>{let c=await o.listSessions(s);return aYi.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(E3c,"handleAgentSessionsListChecked");var cYi=we(_3c,E3c);p();p();var lYi=new pe("BackgroundAgent.listModels"),v3c=b.Object({forceRefresh:b.Optional(b.Boolean())});async function G8r(t,e,r){lYi.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(Ys);return hi(async()=>{let o=await n.listModels(r.forceRefresh);return lYi.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a(G8r,"handleBackgroundAgentListModelsChecked");var Ryh=we(v3c,G8r);var uYi=new pe("BackgroundAgent.listModels"),C3c=b.Object({forceRefresh:b.Optional(b.Boolean()),agentProvider:il});async function b3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return G8r(t,e,r);uYi.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.listModels(s);return uYi.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(b3c,"handleAgentListModelsChecked");var dYi=we(C3c,b3c);p();p();var fYi=new pe("BackgroundAgent.resume"),S3c=b.Intersect([b.Object({sessionId:Si}),KEe]);async function $8r(t,e,r){fYi.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(Ys),o={sessionId:r.sessionId,model:r.model,reasoningEffort:r.reasoningEffort,workspaceFolder:r.workspaceFolder,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,externalToolDefinitions:r.externalToolDefinitions,useAgentsMdFile:r.useAgentsMdFile,useNestedAgentsMdFiles:r.useNestedAgentsMdFiles,useClaudeMdFile:r.useClaudeMdFile,useNestedClaudeMdFiles:r.useNestedClaudeMdFiles,mcpDirectory:r.mcpDirectory};return hi(async()=>{let s=await n.resumeSession(o);return fYi.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a($8r,"handleBackgroundAgentResumeChecked");var Kyh=we(S3c,$8r);var pYi=new pe("BackgroundAgent.resume"),T3c=b.Intersect([b.Object({sessionId:Si}),gIt]);async function I3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return $8r(t,e,r);pYi.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.resume(s);return pYi.info(t,"resume succeeded:",c.sessionId),c})}a(I3c,"handleAgentResumeChecked");var hYi=we(T3c,I3c);p();p();var x3c=b.String(),AIt=["interactive","plan","autopilot"],w3c=b.Union(AIt.map(t=>b.Literal(t))),R3c=b.String({minLength:1}),k3c=b.Object({sessionId:Si,message:b.String(),model:b.Optional(b.String()),providerName:b.Optional(x3c),reasoningEffort:YEe,references:b.Optional(b.Array(A5)),agentMode:b.Optional(w3c),chatMode:b.Optional(R3c),contextTier:b.Optional(KFe),sendMode:b.Optional(b.Union([b.Literal("enqueue"),b.Literal("immediate")]))});async function V8r(t,e,r){let n=t.get(Ys),o={sessionId:r.sessionId,message:r.message,model:r.model,providerName:r.providerName,reasoningEffort:r.reasoningEffort,references:r.references,agentMode:r.agentMode,chatMode:r.chatMode,contextTier:r.contextTier,sendMode:r.sendMode};return hi(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(V8r,"handleBackgroundAgentSendChecked");var y_h=we(k3c,V8r);var mYi=new pe("BackgroundAgent.send"),P3c=b.String(),D3c=b.String(),N3c=b.String({minLength:1}),M3c=b.Object({sessionId:Si,message:b.String(),model:b.Optional(b.String()),providerName:b.Optional(P3c),reasoningEffort:YEe,references:b.Optional(b.Array(A5)),agentMode:b.Optional(D3c),chatMode:b.Optional(N3c),contextTier:b.Optional(KFe),agentProvider:il});async function O3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return r.agentMode!==void 0&&!AIt.includes(r.agentMode)?[null,{code:Ze.InvalidParams,message:`Unknown agentMode for Background provider: ${JSON.stringify(r.agentMode)}. Expected one of ${AIt.join(", ")}.`}]:V8r(t,e,{...r,agentMode:r.agentMode});mYi.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.send(s,e);return mYi.info(t,"resume succeeded:",c.messageId),c})}a(O3c,"handleAgentSendChecked");var gYi=we(M3c,O3c);p();p();var L3c=new pe("BackgroundAgent.stop"),B3c=b.Object({sessionId:Si});async function W8r(t,e,r){L3c.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(Ys);return hi(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(W8r,"handleBackgroundAgentStopChecked");var q_h=we(B3c,W8r);var F3c=new pe("BackgroundAgent.stop"),U3c=b.Object({sessionId:Si,agentProvider:il});async function Q3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await W8r(t,e,r);return c?[null,c]:[void 0,null]}F3c.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>o.stop(s))}a(Q3c,"handleAgentStopChecked");var AYi=we(U3c,Q3c);p();var q3c=b.Object({sessionId:Si,eventId:b.String(),agentProvider:JFe});async function j3c(t,e,r){let n=t.get(Va),o={sessionId:r.sessionId,eventId:r.eventId,providerName:r.agentProvider};return hi(async()=>n.truncateHistory(o))}a(j3c,"handleAgentTruncateHistoryChecked");var yYi=we(q3c,j3c);p();var H3c=b.Object({});async function G3c(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Fr).listAvailableTokens()},null]}a(G3c,"handleListAvailableTokensChecked");var _Yi=we(H3c,G3c);p();var $3c=b.Object({tokenId:b.Number()});async function V3c(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:(await t.get(Fr).revokeTokenById(r.tokenId,"user_action"),[null,null])}a(V3c,"handleRemoveTokenChecked");var EYi=we($3c,V3c);p();var W3c=b.Object({tokenId:b.Number()});async function z3c(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Fr).useExistingToken(r.tokenId),null]}a(z3c,"handleUseExistingTokenChecked");var vYi=we(W3c,z3c);p();var Y3c=b.Object({providerName:b.String()});async function K3c(t,e,r){try{let{providerName:n}=r,o=WO(n);if(o!==0)return[null,{code:Ze.InvalidParams,message:`deleteApiKey is only supported for providers with GlobalApiKey auth type. Provider ${n} has auth type: ${o}`}];let s=new as(t.get(Un));return await s.removeAllModelConfigs(n),await s.deleteAPIKey(n,o),await s.deleteProviderConfig(n),[{success:!0,message:`API key and all model configurations deleted successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to delete API key: ${n instanceof Error?n.message:String(n)}`}]}}a(K3c,"handleBYOKDeleteApiKeyChecked");var CYi=we(Y3c,K3c);p();var J3c=b.Object({providerName:b.String(),modelId:b.String()});async function Z3c(t,e,r){try{let n=new as(t.get(Un)),{providerName:o,modelId:s}=r,c=WO(o);return await n.removeModelConfig(o,s),c===1&&await n.deleteAPIKey(o,c,s),[{success:!0,message:`Model ${s} deleted successfully for provider ${o}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to delete model: ${n instanceof Error?n.message:String(n)}`}]}}a(Z3c,"handleBYOKDeleteModelChecked");var bYi=we(J3c,Z3c);p();var X3c=b.Object({providerName:b.String()});async function eFc(t,e,r){try{let{providerName:n}=r;if(!n)return[null,{code:Ze.InvalidRequest,message:"Provider name must not be empty."}];if(!ob(n))return[null,{code:Ze.InvalidRequest,message:`Provider-level config deletion is not supported for the '${n}' provider.`}];let o=new as(t.get(Un));return await o.removeAllModelConfigs(n),await o.deleteProviderConfig(n),[{success:!0,message:`Provider config and all model configurations deleted successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to delete provider config: ${n instanceof Error?n.message:String(n)}`}]}}a(eFc,"handleBYOKDeleteProviderConfigChecked");var SYi=we(X3c,eFc);p();var tFc=b.Object({providerName:b.Optional(b.String()),modelId:b.Optional(b.String())}),TYi="-api-key";async function rFc(t,e){let r=await e.listKeys("byok"),n=new Set(await t.listCustomProviderNames()),o=new Set(Object.keys(await t.getStoredModelConfigs(Ii.Azure))),s=new Set(Object.values(Ii).filter(u=>u!==Ii.Azure)),c=`${Ii.Azure}-`,l=[];for(let u of r){if(!u.endsWith(TYi))continue;let d=await e.read("byok",u);if(!d)continue;let f=u.slice(0,-TYi.length),h=f.startsWith(c)?f.slice(c.length):void 0;if(h!==void 0&&o.has(h)&&!n.has(f)){l.push({providerName:Ii.Azure,modelId:h,apiKey:d});continue}(s.has(f)||n.has(f))&&l.push({providerName:f,apiKey:d})}return l}a(rFc,"listAllApiKeys");async function nFc(t,e,r){try{let n=new as(t.get(Un)),{providerName:o,modelId:s}=r;return o?[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]:[{apiKeys:await rFc(n,t.get(Un))},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(nFc,"handleBYOKListApiKeysChecked");var IYi=we(tFc,nFc);p();var iFc=b.Object({providerName:b.Optional(b.String())});async function oFc(t,e,r){try{let n=new as(t.get(Un)),o=r.providerName?VO(r.providerName)?[r.providerName]:[]:await n.listCustomProviderNames(),s=[];for(let c of o){let l=await n.getProviderConfig(c);s.push({providerName:c,groupName:l?.groupName,apiType:l?.apiType})}return[{providers:s},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to list provider configs: ${n instanceof Error?n.message:String(n)}`}]}}a(oFc,"handleBYOKListCustomProviderConfigsChecked");var xYi=we(iFc,oFc);p();p();p();B6r();var Txt=class extends sb{static{a(this,"AnthropicProvider")}constructor(e){super(Ii.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new as(this.ctx.get(Un)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new yB({apiKey:e,fetch:c6c(this.ctx.get(Jt))});try{let n=await r.models.list(),o=[];for(let s of n.data){let c=this._knownModels?.[s.id];c&&o.push({providerName:this.providerName,modelId:s.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:c})}return o}catch(n){throw YKe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function c6c(t){return async(e,r)=>{let n=l6c(e,r),o=d6c(r),s=await t.fetch(n,o);return p6c(s)}}a(c6c,"createAnthropicFetchAdapter");function l6c(t,e){return t instanceof Request?(u6c(t,e),t.url):t instanceof URL?t.toString():t}a(l6c,"convertInputToString");function u6c(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(u6c,"mergeRequestInit");function d6c(t){let e;return t?.headers&&(e=f6c(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(d6c,"convertToFetchOptions");function f6c(t){let e={};if(t instanceof Headers)for(let[r,n]of t.entries())e[r]=n;else if(Array.isArray(t))for(let[r,n]of t)e[r]=n;else return t;return e}a(f6c,"convertHeaders");async function p6c(t){let e=t.body(),r=null;if(e)r=h6c(e);else{let n=await t.text();r=g6c(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(p6c,"convertToWebResponse");function h6c(t){return new ReadableStream({start(e){let r=m6c(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(h6c,"createReadableStreamFromNodeStream");function m6c(t,e){let r=a(c=>{e.enqueue(new Uint8Array(c))},"onData"),n=a(()=>{e.close(),s()},"onEnd"),o=a(c=>{e.error(c),s()},"onError"),s=a(()=>{t.off("data",r),t.off("end",n),t.off("error",o)},"cleanup");return t.on("data",r),t.on("end",n),t.on("error",o),s}a(m6c,"setupStreamHandlers");function g6c(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(g6c,"createReadableStreamFromText");p();var Ixt=class extends sb{static{a(this,"GeminiProvider")}constructor(e){super(Ii.Gemini,e)}};p();var xxt=class extends sb{static{a(this,"GroqProvider")}constructor(e){super(Ii.Groq,e)}};p();var QUr=new pe("ollamaProvider"),qUr="0.6.4",A6c=32768,YJi=4096,wxt=class extends sb{constructor(r){super(Ii.Ollama,r);this._modelCache=new Map}static{a(this,"OllamaProvider")}async getAllModels(r){let n=qqt(r);await this._checkOllamaVersion(n);let o;try{let c=await this.ctx.get(Jt).fetch(`${n}/api/tags`,{method:"GET"});if(!c.ok)throw new Error(`Failed to fetch models: ${c.status} ${c.statusText}`);o=await c.json()}catch(c){throw QUr.error(this.ctx,`Error fetching models from Ollama at ${n}:`,c),new Error("Failed to fetch models from Ollama. Please ensure Ollama is running. If Ollama is on another host, configure the endpoint URL for the Ollama provider.")}return(await Promise.all((o.models??[]).map(c=>this._resolveModelInfo(n,c)))).filter(c=>c!==void 0)}async _resolveModelInfo(r,n){let o=n.model;if(!o)return;let s=`${r}/${o}`,c=this._modelCache.get(s),l=c!==void 0&&n.digest!==void 0&&c.digest===n.digest,u;if(l)u=c.capabilities;else{try{u=await this._getOllamaModelInfo(r,o)}catch(d){QUr.error(this.ctx,`Failed to fetch Ollama model info for '${o}':`,d);return}this._modelCache.set(s,{digest:n.digest,capabilities:u})}return{providerName:this.providerName,modelId:o,deploymentUrl:r,isRegistered:!1,isCustomModel:!1,modelCapabilities:u}}async _getOllamaModelInfo(r,n){let o=await this._fetchOllamaModelInformation(r,n),s=o.model_info?.["general.architecture"],c=(s?o.model_info?.[`${s}.context_length`]:void 0)??A6c,l=c{let l=s.trim().replace(/^v/i,"").split(/[+-]/,1)[0].split(".").map(u=>Number(u));return l.length>0&&l.every(u=>Number.isFinite(u))?l:void 0},"parseParts"),n=r(e),o=r(qUr);if(!n||!o)return!1;for(let s=0;sl)return!0;if(c{let _=`${y.providerName}_${y.modelId}`;m.set(_,y)});let g=await s.getStoredModelConfigs(n),A=[];for(let[y,_]of Object.entries(g)){if(l&&!m.has(`${n}_${y}`)){await s.removeModelConfig(n,y);continue}A.push({providerName:n,modelId:y,deploymentUrl:_.deploymentUrl,isRegistered:_.isRegistered,isCustomModel:_.isCustomModel,modelCapabilities:jUr(n,_.modelCapabilities)})}A.forEach(y=>{let _=`${y.providerName}_${y.modelId}`;m.set(_,y)}),c.push(...m.values())}}else{let l=await s.getStoredModelConfigs(n);Object.entries(l).forEach(([u,d])=>{c.push({providerName:n,modelId:u,deploymentUrl:d.deploymentUrl,isRegistered:d.isRegistered,isCustomModel:d.isCustomModel,modelCapabilities:jUr(n,d.modelCapabilities)})})}else{let l=await s.listAllProviderNames();for(let u of l){let d=await s.getStoredModelConfigs(u);Object.entries(d).forEach(([f,h])=>{c.push({providerName:u,modelId:f,deploymentUrl:h.deploymentUrl,isRegistered:h.isRegistered,isCustomModel:h.isCustomModel,modelCapabilities:jUr(u,h.modelCapabilities)})})}}return[{models:c},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to get models: ${n instanceof Error?n.message:String(n)}`}]}}a(E6c,"handleBYOKListModelsChecked");var JJi=we(_6c,E6c);p();var v6c=b.Object({providerName:b.Optional(b.String())}),C6c=[Ii.Ollama];async function b6c(t,e,r){try{let n=new as(t.get(Un)),o;r.providerName?o=ob(r.providerName)?[r.providerName]:[]:o=C6c;let s=[];for(let c of o){let l=await n.getProviderConfig(c);l&&s.push({providerName:c,url:l.url})}return[{providers:s},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to list provider configs: ${n instanceof Error?n.message:String(n)}`}]}}a(b6c,"handleBYOKListProviderConfigsChecked");var ZJi=we(v6c,b6c);p();var S6c=b.Object({providerName:b.String(),apiKey:b.String(),modelId:b.Optional(b.String())});async function T6c(t,e,r){try{let n=new as(t.get(Un)),{providerName:o,apiKey:s,modelId:c}=r,l=WO(o);if(l===1&&!c)return[null,{code:Ze.InvalidRequest,message:"modelId is required for PerModelDeployment auth type"}];await n.storeAPIKey(o,s,l,c);let u=`API key saved successfully for provider ${o}`;return[{success:!0,message:c?`${u} and model ${c}`:u},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save API key: ${n instanceof Error?n.message:String(n)}`}]}}a(T6c,"handleBYOKSaveApiKeyChecked");var XJi=we(S6c,T6c);p();var I6c=b.Object({providerName:b.String(),apiKey:b.String(),groupName:b.String(),apiType:b.Optional(b.Union([b.Literal("chatCompletions"),b.Literal("responses"),b.Literal("messages")]))});async function x6c(t,e,r){try{let n=r.providerName,{apiKey:o,groupName:s,apiType:c}=r;if(!n)return[null,{code:Ze.InvalidRequest,message:"Provider name must not be empty."}];if(!o)return[null,{code:Ze.InvalidRequest,message:"API key must not be empty."}];if(!VO(n))return[null,{code:Ze.InvalidRequest,message:`Provider '${n}' is a built-in provider; custom provider config is only supported for user-named providers.`}];let l=new as(t.get(Un));return await l.storeAPIKey(n,o,WO(n)),await l.saveProviderConfig(n,{groupName:s,apiType:c}),[{success:!0,message:`Provider config saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save provider config: ${n instanceof Error?n.message:String(n)}`}]}}a(x6c,"handleBYOKSaveCustomProviderConfigChecked");var eZi=we(I6c,x6c);p();var w6c=b.Object({providerName:b.String(),modelId:b.String(),isRegistered:b.Boolean(),isCustomModel:b.Boolean(),deploymentUrl:b.Optional(b.String()),apiKey:b.Optional(b.String()),modelCapabilities:b.Optional(b.Object({name:b.String(),maxInputTokens:b.Optional(b.Number()),maxOutputTokens:b.Optional(b.Number()),toolCalling:b.Boolean(),vision:b.Boolean(),thinking:b.Optional(b.Boolean())}))});async function R6c(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new as(t.get(Un)),h=WO(n);if(h===1&&!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];if(VO(n)){if(!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for custom endpoint provider '${n}'`}];if(!await f.getProviderConfig(n))return[null,{code:Ze.InvalidRequest,message:`Custom endpoint provider '${n}' must be configured via saveCustomProviderConfig before registering models.`}]}if(l||d){let m={deploymentUrl:l,isRegistered:s,isCustomModel:c,modelCapabilities:d};await f.saveModelConfig(n,o,m,u,h)}else u!==void 0&&await f.storeAPIKey(n,u,h,o);return[{success:!0,message:`Model ${o} saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save model: ${n instanceof Error?n.message:String(n)}`}]}}a(R6c,"handleBYOKSaveModelChecked");var tZi=we(w6c,R6c);p();var k6c=b.Object({providerName:b.String(),url:b.Optional(b.String())});async function P6c(t,e,r){try{let{providerName:n,url:o}=r;if(!n)return[null,{code:Ze.InvalidRequest,message:"Provider name must not be empty."}];if(!ob(n))return[null,{code:Ze.InvalidRequest,message:`Provider-level endpoint URL is not supported for the '${n}' provider.`}];let s=new as(t.get(Un)),c=await s.getProviderConfig(n);return await s.saveProviderConfig(n,{...c,groupName:c?.groupName??n,url:o}),[{success:!0,message:`Provider config saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save provider config: ${n instanceof Error?n.message:String(n)}`}]}}a(P6c,"handleBYOKSaveProviderConfigChecked");var rZi=we(k6c,P6c);p();var D6c=b.Object({cliPath:b.String()});async function N6c(t,e,r){return[await _ge.check(r.cliPath),null]}a(N6c,"handleCheckClaudeCliCompatibilityChecked");var nZi=we(D6c,N6c);p();p();var oZi=fe(WP()),iZi="0.135.0",Pxt=new yge({displayName:"Codex CLI",notConfiguredMessage:"Codex CLI path is not configured. Install the Codex CLI (e.g. `npm install -g @openai/codex`), then set the Codex CLI Path in your editor's Copilot settings to the absolute path of the `codex` binary.",validateVersion(t){if(oZi.lt(t,iZi))return{severity:"error",message:`Codex CLI at the input path reports version ${t.version}, but version ${iZi} or later is required. Run \`npm install -g @openai/codex\` to upgrade.`}}});var M6c=b.Object({cliPath:b.String()});async function O6c(t,e,r){return[await Pxt.check(r.cliPath),null]}a(O6c,"handleCheckCodexCliCompatibilityChecked");var sZi=we(M6c,O6c);p();var L6c=b.Object({uri:b.String({minLength:1})});async function B6c(t,e,r){let n=await t.get(si).getOrReadTextDocument(r);return[{status:dd(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(B6c,"handleCheckFileStatusChecked");var aZi=we(L6c,B6c);p();var F6c=b.Object({});function cZi(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(cZi,"calculatePercentRemaining");function HUr(t){return{percentRemaining:t?.percent_remaining??100,unlimited:t?.unlimited??!1,overagePermitted:t?.overage_permitted??!1,overageCount:t?.overage_count,overageEntitlement:t?.overage_entitlement,creditsUsed:t?.credits_used,entitlement:t?.entitlement,quotaRemaining:t?.quota_remaining,timeStamp:t?.timestamp_utc}}a(HUr,"buildQuotaSnapshot");async function U6c(t,e,r){let n=await t.get(Fr).resolveSession();if(!n)return[null,{code:Ze.InternalError,message:"Not signed in"}];let o=await USe(t,n);if(o.ok){let s=await o.json();return t.get(Ru).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:HUr(s.quota_snapshots?.chat),completions:HUr(s.quota_snapshots?.completions),premiumInteractions:HUr(s.quota_snapshots?.premium_interactions),resetDate:s.quota_reset_date??"",resetDateUtc:s.quota_reset_date_utc,copilotPlan:s.access_type_sku==="free_limited_copilot"?"free":s.copilot_plan,tokenBasedBillingEnabled:!0,canUpgradePlan:s.can_upgrade_plan},null]:s.access_type_sku==="free_limited_copilot"?[{chat:{percentRemaining:cZi(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:cZi(s.limited_user_quotas?.completions,s.monthly_quotas?.completions),unlimited:!1,overagePermitted:!1},premiumInteractions:{percentRemaining:0,unlimited:!1,overagePermitted:!1},resetDate:s.limited_user_reset_date??"",copilotPlan:"free",tokenBasedBillingEnabled:!1,canUpgradePlan:s.can_upgrade_plan},null]:[{chat:{percentRemaining:s.quota_snapshots?.chat?.percent_remaining??100,unlimited:s.quota_snapshots?.chat?.unlimited??!1,overagePermitted:s.quota_snapshots?.chat?.overage_permitted??!1},completions:{percentRemaining:s.quota_snapshots?.completions?.percent_remaining??100,unlimited:s.quota_snapshots?.completions?.unlimited??!1,overagePermitted:s.quota_snapshots?.completions?.overage_permitted??!1},premiumInteractions:{percentRemaining:s.quota_snapshots?.premium_interactions?.percent_remaining??100,unlimited:s.quota_snapshots?.premium_interactions?.unlimited??!1,overagePermitted:s.quota_snapshots?.premium_interactions?.overage_permitted??!1},resetDate:s.quota_reset_date??"",copilotPlan:s.copilot_plan,tokenBasedBillingEnabled:!1,canUpgradePlan:s.can_upgrade_plan},null]}return[null,{code:Ze.InternalError,message:"Failed to fetch quota info"}]}a(U6c,"handleCheckQuotaChecked");var lZi=we(F6c,U6c);p();var Q6c=b.Object({options:b.Optional(b.Object({localChecksOnly:b.Optional(b.Boolean()),forceRefresh:b.Optional(b.Boolean())}))});async function q6c(t,e,r){return[await t.get(Fr).checkAndUpdateStatus(r.options),null]}a(q6c,"handleCheckStatusChecked");var uZi=we(Q6c,q6c);p();var j6c=b.Object({pullRequestNumber:b.Integer({minimum:1}),repoOwner:b.String({minLength:1}),repoName:b.String({minLength:1}),body:b.String({minLength:1})});async function H6c(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await new gm(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return $c(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(zp(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof x_)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(H6c,"handleCloudAgentAddPullRequestCommentChecked");var dZi=we(j6c,H6c);p();var G6c=b.Object({pullRequestId:b.Number(),repoOwner:b.String({minLength:1}),repoName:b.String({minLength:1})});async function $6c(t,e,r){try{let o=await new fb(t).getAllSessions(r.pullRequestId,e);if(!o||o.length===0)return[null,{code:Ze.InvalidRequest,message:"No session found for this pull request"}];let s=o[0];return s.state==="completed"?(ft(t,"githubApi.cancelCodingAgent",Vt.createAndMarkAsIssued()),sr(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new gm(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),ft(t,"githubApi.cancelCodingAgent",Vt.createAndMarkAsIssued()),sr(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):[null,{code:Ze.InternalError,message:"No workflow run ID found in session"}]}catch(n){if(Ma(t,n,"githubApi.cancelCodingAgent"),Hs(t,"githubApi.cancelCodingAgent",n),n instanceof ww)return[null,{code:Ze.NoCopilotToken,message:n.message}];if(n instanceof mp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof mm)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof x_)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a($6c,"handleCancelCodingAgentChecked");var fZi=we(G6c,$6c);p();var V6c=b.Object({problemStatement:b.String({minLength:1}),workspaceFolder:b.Optional(b.String({minLength:1})),workspaceFolders:b.Optional(b.Array(Kc))});function W6c(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(W6c,"pickWorkspaceFolder");async function z6c(t,e,r){try{let n=W6c(r);if(!n)return[null,{code:Ze.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a cloud agent job."}];let s=await new Pf(t).getRepo(n);if(!s||!s.isGitHub())return[null,{code:Ze.InvalidRequest,message:"No GitHub repository found in the workspace folder."}];if(!s.owner||!s.name)return[null,{code:Ze.InvalidRequest,message:"Could not determine repository owner and name."}];let l=await new f5([new p5,new h5]).getBranchInfo(t,n);if(!l?.currentBranch||l.isDetachedHead)return[null,{code:Ze.InvalidRequest,message:"No current branch found or detached HEAD state \u2014 cannot create a cloud agent job."}];let u=l.currentBranch,d=ude(r.problemStatement);if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let h=await new fb(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return $c(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(zp(t,"cloudAgent.createJob",n,{result:"error"}),Mwe(n))return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(n instanceof ww)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof mp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof mm)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof x_)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(z6c,"handleCloudAgentCreateJobChecked");var pZi=we(V6c,z6c);p();var Y6c=b.Object({sessionId:b.String({minLength:1})});async function K6c(t,e,r){try{let o=await new fb(t).getSessionLogs(r.sessionId,e);return $c(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(zp(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof ww)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof mp||n instanceof mm)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(K6c,"handleCloudAgentGetSessionLogsChecked");var hZi=we(Y6c,K6c);p();var J6c=b.Object({pullRequestId:b.Integer()});async function Z6c(t,e,r){try{let o=await new fb(t).getAllSessions(r.pullRequestId,e);return $c(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(zp(t,"cloudAgent.listSessions",n),n instanceof ww)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof mp||n instanceof mm)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(Z6c,"handleCloudAgentListSessionsChecked");var mZi=we(J6c,Z6c);p();var X6c=b.Object({});async function eUc(t,e,r){return[(await Iw(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(eUc,"handleConversationAgentsChecked");var gZi=we(X6c,eUc);p();p();var B8e=fe(Wc());function tUc(t,e,r){let n=Vt.createAndMarkAsIssued({languageId:String(e.detectedLanguageId),requestedDocumentVersion:String(r),actualDocumentVersion:String(e.version)});return ft(t,"getCompletions.docVersionMismatch",n)}a(tUc,"telemetryVersionMismatch");async function g9(t,e,r){let o=t.get($r).getTextDocumentUnsafe(e);if(!o)throw new B8e.ResponseError(Ze.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await Pue(t,e,o.getText());if(s.status==="invalid")throw t.get(ks).setClsInactive(s.reason),new B8e.ResponseError(Ze.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(tUc(t,o,e.version),Yo.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new B8e.ResponseError(Ze.ContentModified,"Document Version Mismatch");return o}a(g9,"getTextDocument");async function _B(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await g9(t,n,r)}catch(o){if(o instanceof B8e.ResponseError){if(o.code===Ze.CopilotNotAvailable)return;if(o.code===Ze.InvalidParams){Yo.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(_B,"getTextDocumentIfAvailable");var rUc=b.Union([b.Literal("keyboard"),b.Literal("toolbar")]),nUc=b.Object({turnId:$J,codeBlockIndex:b.Number(),source:rUc,copiedCharacters:b.Number(),totalCharacters:b.Number(),copiedText:b.String(),doc:b.Optional(uXe),textDocument:b.Optional(db),position:b.Optional(vg),conversationSource:b.Optional(y5)});async function iUc(t,e,r){let n=await _B(t,r,e),o={totalCharacters:r.totalCharacters,copiedCharacters:r.copiedCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,currentLine:s.line});let c=qq(r.conversationSource),l=t.get(Xo).findByTurnId(r.turnId),u=await fl(t,l,{languageId:n?.detectedLanguageId??""});return mT(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${S_(c)}.acceptedCopy`,u),["OK",null]}a(iUc,"handleConversationCodeCopyChecked");var AZi=we(nUc,iUc);p();var oUc=b.Union([b.Literal("keyboard"),b.Literal("toolbar"),b.Literal("diff")]),sUc=b.Object({turnId:$J,source:oUc,codeBlockIndex:b.Number(),acceptedLength:b.Optional(b.Number()),totalCharacters:b.Number(),newFile:b.Optional(b.Boolean()),doc:b.Optional(uXe),textDocument:b.Optional(db),position:b.Optional(vg),conversationSource:b.Optional(y5)});async function aUc(t,e,r){let n=await _B(t,r,e),o={totalCharacters:r.totalCharacters,acceptedLength:r.acceptedLength??r.totalCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,insertionOffset:n.offsetAt(s),currentLine:s.line});let c=qq(r.conversationSource),l=t.get(Xo).findByTurnId(r.turnId),u=await fl(t,l,{languageId:n?.detectedLanguageId??""});return mT(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,compType:r.acceptedLength&&r.acceptedLength0&&(e+=` +`})}s.push({type:"text",text:e.message});let c=e.model||o.model,l=e.reasoningEffort??o.reasoningEffort;this.stateService.setActiveThread(o.threadId);let u=await this.processManager.sendRequest("turn/start",{...c?{model:c}:{},...l?{effort:l}:{},threadId:o.threadId,input:s});return o.turnId=u.turnId,e.model&&(o.model=e.model),e.reasoningEffort&&(o.reasoningEffort=e.reasoningEffort),o.modifiedTime=new Date().toISOString(),o.summary||(o.summary=e.message.slice(0,100)),n.measurements.messageCharLen=e.message.length,{messageId:u.turnId}})}truncateHistory(e){return Promise.reject(new Error("truncateHistory is not supported for Codex sessions"))}forkSession(e){return Promise.reject(new Error("forkSession is not supported for Codex sessions"))}async stopSession(e){let r=this.sessions.get(e);r&&(this.drainAndCloseUserInputs(r,!0),this.drainPendingPermissions(e,!0),r.turnId&&(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),lc.info(this.ctx,"CodexAgentService.stopSession",{sessionId:e})))}destroySession(e){let r=this.sessions.get(e.sessionId);return r&&(this.drainAndCloseUserInputs(r,!0),this.drainPendingPermissions(e.sessionId,!0),this.stateService.clear(r.threadId)),this.sessions.delete(e.sessionId),lc.info(this.ctx,"CodexAgentService.destroySession",{sessionId:e.sessionId}),Promise.resolve({success:!0})}listSessions(e){let r=Array.from(this.sessions.values()).map(n=>({sessionId:n.sessionId,startTime:n.startTime,modifiedTime:n.modifiedTime,summary:n.summary,isRemote:!1,context:n.cwd?{cwd:n.cwd}:void 0}));return r.sort((n,o)=>o.modifiedTime.localeCompare(n.modifiedTime)),lc.info(this.ctx,`CodexAgentService.listSessions: ${r.length} sessions`),Promise.resolve({sessions:r})}async listModels(e){try{let o=(await this.ctx.get(Ns).getMetadata(e)).filter(s=>s.supported_endpoints?.includes(EWe.Responses)&&s.model_picker_enabled&&s.capabilities.type==="chat");if(o.length>0){let s=o.map(spe);return s.forEach(IBc),lc.info(this.ctx,`CodexAgentService.listModels: ${s.length} responses-capable models from CAPI`),{models:s}}lc.warn(this.ctx,"CodexAgentService.listModels: no responses-capable models found in CAPI")}catch(r){let n=r instanceof Error?r.message:String(r);lc.warn(this.ctx,`CodexAgentService.listModels: CAPI query failed: ${n}, using fallback`)}return{models:[{id:"codex-default",name:"Codex (Default)",preview:!1,capabilities:{family:"codex",supports:{vision:!1},limits:{max_context_window_tokens:128e3}}}]}}handleInteraction(e){lc.info(this.ctx,"handleInteraction",{sessionId:e.sessionId,requestId:e.requestId,type:e.type});let r=this.sessions.get(e.sessionId);if(!r)return lc.warn(this.ctx,"handleInteraction: unknown session",{sessionId:e.sessionId}),Promise.resolve({success:!1});switch(e.type){case"user_input":return this.handleUserInputInteraction(r,e);case"permission":return this.handlePermissionInteraction(r,e);default:return lc.warn(this.ctx,"handleInteraction: unsupported type for Codex",{sessionId:e.sessionId,type:e.type}),Promise.resolve({success:!1})}}handleUserInputInteraction(e,r){let n=e.translatorState,o=n.pendingUserInputs.get(r.requestId);if(!o)return lc.warn(this.ctx,"handleInteraction: user_input for unknown requestId",{sessionId:r.sessionId,requestId:r.requestId}),Promise.resolve({success:!1});n.pendingUserInputs.delete(r.requestId),this.emitUserInputCompleted(e.sessionId,r.requestId,r.response);let s=n.pendingUserInputAggregates.get(o.itemId);if(!s)return lc.warn(this.ctx,"handleInteraction: user_input aggregate missing",{sessionId:r.sessionId,requestId:r.requestId,itemId:o.itemId}),Promise.resolve({success:!1});if(s.answers.set(o.questionId,{answer:r.response.answer,wasFreeform:r.response.wasFreeform}),s.answers.size0){let h=N8r(e),m=M8r(f,h);this.stateService.setPendingPermission(c.sessionId,m,{codexJsonRpcId:n,method:e})}else lc.warn(this.ctx,`handleNotification: approval ${e} missing itemId, cannot correlate reply`)}if(e==="turn/started"){let f=r;f.turn?.id&&(c.turnId=f.turn.id)}let l;e==="turn/completed"&&(l={copilotUsageNanoAiu:this.stateService.takeCopilotUsageNanoAiuForThread(s)},this.stateService.setActiveThread(void 0));let u=Fzi(e,r,c.translatorState,n,l);if(!u)return;let d=Array.isArray(u)?u:[u];for(let f of d)f.type==="assistant.usage"&&f.data&&c.model&&(f.data.model=c.model),this.notificationSender.sendBackgroundAgentSessionUpdate(c.sessionId,f,"CODEX")}findSessionByThreadId(e){for(let r of this.sessions.values())if(r.threadId===e)return r}emitUserInputCompleted(e,r,n){let o={id:Dt(),timestamp:new Date().toISOString(),type:"user_input.completed",data:{requestId:r,answer:n.answer,wasFreeform:n.wasFreeform}};this.notificationSender.sendBackgroundAgentSessionUpdate(e,o,"CODEX")}emitPermissionCompleted(e,r,n){let o={id:Dt(),timestamp:new Date().toISOString(),type:"permission.completed",data:{requestId:r,result:{kind:n}}};this.notificationSender.sendBackgroundAgentSessionUpdate(e,o,"CODEX")}emitSessionError(e,r,n){let o={id:Dt(),timestamp:new Date().toISOString(),type:"session.error",data:{errorType:r,message:n}};this.notificationSender.sendBackgroundAgentSessionUpdate(e,o,"CODEX");let s={id:Dt(),timestamp:new Date().toISOString(),type:"session.idle"};this.notificationSender.sendBackgroundAgentSessionUpdate(e,s,"CODEX")}drainAndCloseUserInputs(e,r){let n=e.translatorState;if(n.pendingUserInputAggregates.size===0){n.pendingUserInputs.clear();return}for(let[o,s]of n.pendingUserInputAggregates){if(r&&this.processManager?.isRunning()){let c={};for(let l of s.expectedQuestionIds)c[l]={answers:[]};try{this.processManager.sendRawResponse(s.requestJsonRpcId,{answers:c})}catch(l){let u=l instanceof Error?l.message:String(l);lc.warn(this.ctx,"drainAndCloseUserInputs: failed to notify Codex",{sessionId:e.sessionId,itemId:o,error:u})}}for(let c of s.expectedQuestionIds)this.emitUserInputCompleted(e.sessionId,P8r(o,c),{answer:"",wasFreeform:!1})}n.pendingUserInputs.clear(),n.pendingUserInputAggregates.clear()}drainPendingPermissions(e,r){let n=this.stateService.takeAllPendingPermissionsForSession(e);for(let[o,s]of n){if(r&&this.processManager?.isRunning()&&s.codexJsonRpcId!==void 0)try{this.processManager.sendRawResponse(s.codexJsonRpcId,Hzi(s,!1))}catch(c){let l=c instanceof Error?c.message:String(c);lc.warn(this.ctx,"drainPendingPermissions: failed to notify Codex",{sessionId:e,requestId:o,error:l})}this.emitPermissionCompleted(e,o,"denied")}}emitErrorToAllSessions(e){for(let r of this.sessions.values())this.drainAndCloseUserInputs(r,!1),this.drainPendingPermissions(r.sessionId,!1),this.emitSessionError(r.sessionId,"process_crash",`Codex process terminated unexpectedly: ${e}. Send a new message to retry.`)}async dispose(){for(let e of this.sessions.values())this.drainAndCloseUserInputs(e,!1),this.drainPendingPermissions(e.sessionId,!1);await this.processManager?.stop(),await this.proxyServer.stop()}};function IBc(t){let e=t.billing?.token_prices;if(!e||!("long_context"in e))return;let{long_context:r,...n}=e;Object.keys(n).length>0?t.billing.token_prices=n:(delete t.billing.token_prices,Object.keys(t.billing).length===0&&delete t.billing)}a(IBc,"stripLongContextPricing");var jzi=["item/commandExecution/requestApproval","item/fileChange/requestApproval","item/permissions/requestApproval"];function Hzi(t,e){return{decision:e?"accept":"decline"}}a(Hzi,"responseFor");var Gzi=new pe("AgentRouter"),$zi="AgentRouter";function GI(t){return t.agentProvider??"BACKGROUND"}a(GI,"resolveProvider");var Va=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(Ys);case"CLAUDE":return this.ctx.get(t6);case"CODEX":return this.ctx.get(noe);case"CLOUD":return this.ctx.get(toe)}}logDispatch(e,r){Gzi.debug(this.ctx,`${$zi}.${e}`,r)}create(e){this.logDispatch("create",e);let r=GI(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=GI(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=GI(e);return this.serviceFor(n).sendMessage(e,r)}truncateHistory(e){this.logDispatch("truncateHistory",e);let r=e.providerName;return this.serviceFor(r).truncateHistory({sessionId:e.sessionId,eventId:e.eventId,providerName:e.providerName})}forkSession(e){this.logDispatch("forkSession",e);let r=e.providerName;return this.serviceFor(r).forkSession(e)}stop(e){this.logDispatch("stop",e);let r=GI(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=GI(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=GI(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=GI(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=GI(e);return this.serviceFor(r).handleInteraction(e)}async getPlanPath(e){this.logDispatch("getPlanPath",e);let r=GI(e);return{path:await this.serviceFor(r).getPlanPath(e.sessionId)}}enableRemote(e){this.logDispatch("enableRemote",e);let r=GI(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=GI(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=GI(e);try{return Promise.resolve(this.serviceFor(r).getRemoteStatus(e.sessionId))}catch(n){return Promise.reject(n instanceof Error?n:new Error(String(n)))}}async compactHistory(e,r){this.logDispatch("compactHistory",e);let n=GI(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{Gzi.info(this.ctx,`${$zi}.compactHistory: cancellation requested, aborting compaction`,{sessionId:e.sessionId}),o.stopCompactHistory(e.sessionId)});try{return await o.compactHistory(e.sessionId)}finally{s?.dispose()}}};p();p();var xBc=b.Union([b.String(),b.Number()]),Si=b.String(),YEe=b.Optional(b.String()),wBc=b.Object({name:b.String(),description:b.String(),title:b.Optional(b.String()),parameters:b.Optional(b.Record(b.String(),b.Unknown())),overridesBuiltInTool:b.Optional(b.Boolean()),skipPermission:b.Optional(b.Boolean())}),O8r=b.Array(wBc),KFe=b.Union([b.Literal("default"),b.Literal("long_context")]),KEe=b.Object({model:b.Optional(b.String()),reasoningEffort:YEe,workspaceFolder:b.Object({uri:b.String(),name:b.Optional(b.String())}),globalAgentsMdInstructions:b.Optional(b.String()),globalClaudeMdInstructions:b.Optional(b.String()),externalToolDefinitions:b.Optional(O8r),useAgentsMdFile:b.Optional(b.Boolean()),useNestedAgentsMdFiles:b.Optional(b.Boolean()),useClaudeMdFile:b.Optional(b.Boolean()),useNestedClaudeMdFiles:b.Optional(b.Boolean()),inlineConfinedFile:b.Optional(b.String()),mcpDirectory:b.Optional(b.String())});async function hi(t){try{return[await t(),null]}catch(e){let r=uot(e),n=e instanceof OZ?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(hi,"withServiceErrorHandling");var Vzi=new pe("BackgroundAgent.compactHistory"),RBc=b.Object({sessionId:Si});async function L8r(t,e,r){Vzi.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(Ys),o=e.onCancellationRequested(()=>{Vzi.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await hi(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(L8r,"handleBackgroundAgentCompactHistoryChecked");var $mh=we(RBc,L8r);p();var JFe=b.Union(Object.values(Ff).map(t=>b.Literal(t))),il=b.Optional(JFe),AIt=b.Intersect([KEe,b.Object({agentProvider:il})]);var Wzi=new pe("BackgroundAgent.compactHistory"),kBc=b.Object({sessionId:Si,agentProvider:il});async function PBc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return L8r(t,e,r);Wzi.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.compactHistory(s,e);return Wzi.info(t,"compactHistory succeeded"),c})}a(PBc,"handleAgentCompactHistoryChecked");var zzi=we(kBc,PBc);p();p();var Yzi=new pe("BackgroundAgent.create"),DBc=b.Intersect([b.Object({sessionId:b.Optional(b.String())}),KEe]);async function B8r(t,e,r){Yzi.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(Ys),o={sessionId:r.sessionId,model:r.model,reasoningEffort:r.reasoningEffort,workspaceFolder:r.workspaceFolder,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,externalToolDefinitions:r.externalToolDefinitions,useAgentsMdFile:r.useAgentsMdFile,useNestedAgentsMdFiles:r.useNestedAgentsMdFiles,useClaudeMdFile:r.useClaudeMdFile,useNestedClaudeMdFiles:r.useNestedClaudeMdFiles,inlineConfinedFile:r.inlineConfinedFile,mcpDirectory:r.mcpDirectory};return hi(async()=>{let s=await n.createSession(o);return Yzi.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(B8r,"handleBackgroundAgentCreateChecked");var _gh=we(DBc,B8r);var Kzi=new pe("BackgroundAgent.create"),NBc=b.Intersect([b.Object({sessionId:b.Optional(b.String())}),AIt]);async function MBc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return B8r(t,e,r);Kzi.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.create(s);return Kzi.info(t,"create succeeded:",c.sessionId),c})}a(MBc,"handleAgentCreateChecked");var Jzi=we(NBc,MBc);p();p();var OBc=b.Object({sessionId:Si});async function F8r(t,e,r){let n=t.get(Ys);return hi(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a(F8r,"handleBackgroundAgentDestroyChecked");var Ugh=we(OBc,F8r);var LBc=new pe("BackgroundAgent.destroy"),BBc=b.Object({sessionId:Si,agentProvider:il});async function FBc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return F8r(t,e,r);LBc.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>o.destroy(s))}a(FBc,"handleAgentDestroyChecked");var Zzi=we(BBc,FBc);p();p();var UBc=new pe("BackgroundAgent.disableRemote"),QBc=b.Object({sessionId:Si});async function U8r(t,e,r){UBc.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(Ys);return hi(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(U8r,"handleBackgroundAgentDisableRemoteChecked");var s0h=we(QBc,U8r);var Xzi=new pe("BackgroundAgent.disableRemote"),qBc=b.Object({sessionId:Si,agentProvider:il});async function jBc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return U8r(t,e,r);Xzi.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.disableRemote(s);return Xzi.info(t,"disableRemote succeeded"),c})}a(jBc,"handleAgentDisableRemoteChecked");var eYi=we(qBc,jBc);p();p();var HBc=new pe("BackgroundAgent.enableRemote"),GBc=b.Object({sessionId:Si});async function Q8r(t,e,r){HBc.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(Ys);return hi(async()=>n.enableRemote(r.sessionId))}a(Q8r,"handleBackgroundAgentEnableRemoteChecked");var x0h=we(GBc,Q8r);var tYi=new pe("BackgroundAgent.enableRemote"),$Bc=b.Object({sessionId:Si,agentProvider:il});async function VBc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return Q8r(t,e,r);tYi.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.enableRemote(s);return tYi.info(t,"enableRemote succeeded"),c})}a(VBc,"handleAgentEnableRemoteChecked");var rYi=we($Bc,VBc);p();var WBc=b.Object({sessionId:Si,toEventId:b.Optional(b.String()),name:b.Optional(b.String()),agentProvider:JFe});async function zBc(t,e,r){let n=t.get(Va);return hi(async()=>n.forkSession({sessionId:r.sessionId,toEventId:r.toEventId,name:r.name,providerName:r.agentProvider}))}a(zBc,"handleAgentForkChecked");var nYi=we(WBc,zBc);p();p();var YBc=b.Object({sessionId:Si});async function q8r(t,e,r){let n=t.get(Ys);return hi(async()=>({path:await n.getPlanPath(r.sessionId)}))}a(q8r,"handleBackgroundAgentGetPlanPathChecked");var tAh=we(YBc,q8r);var KBc=new pe("BackgroundAgent.getPlanPath"),JBc=b.Object({sessionId:Si,agentProvider:il});async function ZBc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return q8r(t,e,r);KBc.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>o.getPlanPath(s))}a(ZBc,"handleAgentGetPlanPathChecked");var iYi=we(JBc,ZBc);p();p();var XBc=new pe("BackgroundAgent.getRemoteStatus"),e3c=b.Object({sessionId:Si});async function j8r(t,e,r){XBc.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(Ys);return hi(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a(j8r,"handleBackgroundAgentGetRemoteStatusChecked");var CAh=we(e3c,j8r);var t3c=new pe("BackgroundAgent.getRemoteStatus"),r3c=b.Object({sessionId:Si,agentProvider:il});async function n3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return j8r(t,e,r);t3c.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>o.getRemoteStatus(s))}a(n3c,"handleAgentGetRemoteStatusChecked");var oYi=we(r3c,n3c);p();p();var i3c=new pe("BackgroundAgent.interaction"),o3c=b.Union([b.Object({kind:b.Literal("approve-once")}),b.Object({kind:b.Literal("denied-by-rules"),rules:b.Array(b.Unknown())}),b.Object({kind:b.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),b.Object({kind:b.Literal("denied-interactively-by-user"),feedback:b.Optional(b.String())}),b.Object({kind:b.Literal("denied-by-content-exclusion-policy"),path:b.String(),message:b.String()})]),s3c=b.Object({answer:b.String(),wasFreeform:b.Boolean()}),a3c=b.Object({action:b.Union([b.Literal("accept"),b.Literal("decline"),b.Literal("cancel")]),content:b.Optional(b.Record(b.String(),b.Union([b.String(),b.Number(),b.Boolean(),b.Array(b.String())])))}),c3c=b.Object({approved:b.Boolean(),selectedAction:b.Optional(b.Union([b.Literal("exit_only"),b.Literal("interactive"),b.Literal("autopilot"),b.Literal("autopilot_fleet")])),autoApproveEdits:b.Optional(b.Boolean()),feedback:b.Optional(b.String())}),l3c=b.Union([b.Object({handled:b.Literal(!0),stopProcessingQueue:b.Optional(b.Boolean())}),b.Object({handled:b.Literal(!1)})]),u3c=b.Union([b.String(),b.Object({textResultForLlm:b.String(),binaryResultsForLlm:b.Optional(b.Array(b.Object({data:b.String(),mimeType:b.String(),type:b.Union([b.Literal("resource"),b.Literal("image")]),description:b.Optional(b.String())}))),resultType:b.Union([b.Literal("success"),b.Literal("failure"),b.Literal("rejected"),b.Literal("denied")]),error:b.Optional(b.String())})]),d3c=b.Union([b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("permission"),result:o3c}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("user_input"),response:s3c}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("elicitation"),response:a3c}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("exit_plan_mode"),response:c3c}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("queued_command"),result:l3c}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("external_tool"),result:u3c})]);async function H8r(t,e,r){i3c.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(Ys);return hi(async()=>await n.handleInteraction(r))}a(H8r,"handleBackgroundAgentInteractionChecked");var HAh=we(d3c,H8r);var sYi=new pe("BackgroundAgent.interaction"),f3c=b.Union([b.Object({kind:b.Literal("approve-once")}),b.Object({kind:b.Literal("denied-by-rules"),rules:b.Array(b.Unknown())}),b.Object({kind:b.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),b.Object({kind:b.Literal("denied-interactively-by-user"),feedback:b.Optional(b.String())}),b.Object({kind:b.Literal("denied-by-content-exclusion-policy"),path:b.String(),message:b.String()})]),p3c=b.Object({answer:b.String(),wasFreeform:b.Boolean()}),h3c=b.Object({action:b.Union([b.Literal("accept"),b.Literal("decline"),b.Literal("cancel")]),content:b.Optional(b.Record(b.String(),b.Union([b.String(),b.Number(),b.Boolean(),b.Array(b.String())])))}),m3c=b.Object({approved:b.Boolean(),selectedAction:b.Optional(b.Union([b.Literal("exit_only"),b.Literal("interactive"),b.Literal("autopilot"),b.Literal("autopilot_fleet")])),autoApproveEdits:b.Optional(b.Boolean()),feedback:b.Optional(b.String())}),g3c=b.Union([b.Object({handled:b.Literal(!0),stopProcessingQueue:b.Optional(b.Boolean())}),b.Object({handled:b.Literal(!1)})]),A3c=b.Union([b.String(),b.Object({textResultForLlm:b.String(),binaryResultsForLlm:b.Optional(b.Array(b.Object({data:b.String(),mimeType:b.String(),type:b.Union([b.Literal("resource"),b.Literal("image")]),description:b.Optional(b.String())}))),resultType:b.Union([b.Literal("success"),b.Literal("failure"),b.Literal("rejected"),b.Literal("denied")]),error:b.Optional(b.String())})]),y3c=b.Union([b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("permission"),result:f3c,agentProvider:il}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("user_input"),response:p3c,agentProvider:il}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("elicitation"),response:h3c,agentProvider:il}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("exit_plan_mode"),response:m3c,agentProvider:il}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("queued_command"),result:g3c,agentProvider:il}),b.Object({sessionId:Si,requestId:b.String(),type:b.Literal("external_tool"),result:A3c,agentProvider:il})]);async function _3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return H8r(t,e,r);sYi.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.interaction(s);return sYi.info(t,"interaction succeeded"),c})}a(_3c,"handleAgentInteractionChecked");var aYi=we(y3c,_3c);p();p();var cYi=new pe("BackgroundAgent.listSessions"),E3c=b.Object({cwd:b.Optional(b.String()),gitRoot:b.Optional(b.String()),repository:b.Optional(b.String()),branch:b.Optional(b.String())});async function G8r(t,e,r){cYi.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(Ys);return hi(async()=>{let o=await n.listSessions(r);return cYi.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(G8r,"handleBackgroundAgentSessionsListChecked");var dyh=we(E3c,G8r);var lYi=new pe("BackgroundAgent.listSessions"),v3c=b.Object({cwd:b.Optional(b.String()),gitRoot:b.Optional(b.String()),repository:b.Optional(b.String()),branch:b.Optional(b.String()),agentProvider:il});async function C3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return G8r(t,e,r);lYi.info(t,"handleAgentSessionsList called",r);let o=t.get(Va),s=r;return hi(async()=>{let c=await o.listSessions(s);return lYi.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(C3c,"handleAgentSessionsListChecked");var uYi=we(v3c,C3c);p();p();var dYi=new pe("BackgroundAgent.listModels"),b3c=b.Object({forceRefresh:b.Optional(b.Boolean())});async function $8r(t,e,r){dYi.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(Ys);return hi(async()=>{let o=await n.listModels(r.forceRefresh);return dYi.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a($8r,"handleBackgroundAgentListModelsChecked");var Nyh=we(b3c,$8r);var fYi=new pe("BackgroundAgent.listModels"),S3c=b.Object({forceRefresh:b.Optional(b.Boolean()),agentProvider:il});async function T3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return $8r(t,e,r);fYi.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.listModels(s);return fYi.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(T3c,"handleAgentListModelsChecked");var pYi=we(S3c,T3c);p();p();var hYi=new pe("BackgroundAgent.resume"),I3c=b.Intersect([b.Object({sessionId:Si}),KEe]);async function V8r(t,e,r){hYi.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(Ys),o={sessionId:r.sessionId,model:r.model,reasoningEffort:r.reasoningEffort,workspaceFolder:r.workspaceFolder,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,externalToolDefinitions:r.externalToolDefinitions,useAgentsMdFile:r.useAgentsMdFile,useNestedAgentsMdFiles:r.useNestedAgentsMdFiles,useClaudeMdFile:r.useClaudeMdFile,useNestedClaudeMdFiles:r.useNestedClaudeMdFiles,mcpDirectory:r.mcpDirectory};return hi(async()=>{let s=await n.resumeSession(o);return hYi.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a(V8r,"handleBackgroundAgentResumeChecked");var e_h=we(I3c,V8r);var mYi=new pe("BackgroundAgent.resume"),x3c=b.Intersect([b.Object({sessionId:Si}),AIt]);async function w3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return V8r(t,e,r);mYi.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.resume(s);return mYi.info(t,"resume succeeded:",c.sessionId),c})}a(w3c,"handleAgentResumeChecked");var gYi=we(x3c,w3c);p();p();var R3c=b.String(),yIt=["interactive","plan","autopilot"],k3c=b.Union(yIt.map(t=>b.Literal(t))),P3c=b.String({minLength:1}),D3c=b.Object({sessionId:Si,message:b.String(),model:b.Optional(b.String()),providerName:b.Optional(R3c),reasoningEffort:YEe,references:b.Optional(b.Array(A5)),agentMode:b.Optional(k3c),chatMode:b.Optional(P3c),contextTier:b.Optional(KFe),sendMode:b.Optional(b.Union([b.Literal("enqueue"),b.Literal("immediate")]))});async function W8r(t,e,r){let n=t.get(Ys),o={sessionId:r.sessionId,message:r.message,model:r.model,providerName:r.providerName,reasoningEffort:r.reasoningEffort,references:r.references,agentMode:r.agentMode,chatMode:r.chatMode,contextTier:r.contextTier,sendMode:r.sendMode};return hi(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(W8r,"handleBackgroundAgentSendChecked");var C_h=we(D3c,W8r);var AYi=new pe("BackgroundAgent.send"),N3c=b.String(),M3c=b.String(),O3c=b.String({minLength:1}),L3c=b.Object({sessionId:Si,message:b.String(),model:b.Optional(b.String()),providerName:b.Optional(N3c),reasoningEffort:YEe,references:b.Optional(b.Array(A5)),agentMode:b.Optional(M3c),chatMode:b.Optional(O3c),contextTier:b.Optional(KFe),agentProvider:il});async function B3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return r.agentMode!==void 0&&!yIt.includes(r.agentMode)?[null,{code:Ze.InvalidParams,message:`Unknown agentMode for Background provider: ${JSON.stringify(r.agentMode)}. Expected one of ${yIt.join(", ")}.`}]:W8r(t,e,{...r,agentMode:r.agentMode});AYi.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(Va),s=r;return hi(async()=>{let c=await o.send(s,e);return AYi.info(t,"resume succeeded:",c.messageId),c})}a(B3c,"handleAgentSendChecked");var yYi=we(L3c,B3c);p();p();var F3c=new pe("BackgroundAgent.stop"),U3c=b.Object({sessionId:Si});async function z8r(t,e,r){F3c.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(Ys);return hi(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(z8r,"handleBackgroundAgentStopChecked");var $_h=we(U3c,z8r);var Q3c=new pe("BackgroundAgent.stop"),q3c=b.Object({sessionId:Si,agentProvider:il});async function j3c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await z8r(t,e,r);return c?[null,c]:[void 0,null]}Q3c.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Va),s=r;return hi(async()=>o.stop(s))}a(j3c,"handleAgentStopChecked");var _Yi=we(q3c,j3c);p();var H3c=b.Object({sessionId:Si,eventId:b.String(),agentProvider:JFe});async function G3c(t,e,r){let n=t.get(Va),o={sessionId:r.sessionId,eventId:r.eventId,providerName:r.agentProvider};return hi(async()=>n.truncateHistory(o))}a(G3c,"handleAgentTruncateHistoryChecked");var EYi=we(H3c,G3c);p();var $3c=b.Object({});async function V3c(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Or).listAvailableTokens()},null]}a(V3c,"handleListAvailableTokensChecked");var vYi=we($3c,V3c);p();var W3c=b.Object({tokenId:b.Number()});async function z3c(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:(await t.get(Or).revokeTokenById(r.tokenId,"user_action"),[null,null])}a(z3c,"handleRemoveTokenChecked");var CYi=we(W3c,z3c);p();var Y3c=b.Object({tokenId:b.Number()});async function K3c(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Or).useExistingToken(r.tokenId),null]}a(K3c,"handleUseExistingTokenChecked");var bYi=we(Y3c,K3c);p();var J3c=b.Object({providerName:b.String()});async function Z3c(t,e,r){try{let{providerName:n}=r,o=WO(n);if(o!==0)return[null,{code:Ze.InvalidParams,message:`deleteApiKey is only supported for providers with GlobalApiKey auth type. Provider ${n} has auth type: ${o}`}];let s=new as(t.get(Un));return await s.removeAllModelConfigs(n),await s.deleteAPIKey(n,o),await s.deleteProviderConfig(n),[{success:!0,message:`API key and all model configurations deleted successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to delete API key: ${n instanceof Error?n.message:String(n)}`}]}}a(Z3c,"handleBYOKDeleteApiKeyChecked");var SYi=we(J3c,Z3c);p();var X3c=b.Object({providerName:b.String(),modelId:b.String()});async function eFc(t,e,r){try{let n=new as(t.get(Un)),{providerName:o,modelId:s}=r,c=WO(o);return await n.removeModelConfig(o,s),c===1&&await n.deleteAPIKey(o,c,s),[{success:!0,message:`Model ${s} deleted successfully for provider ${o}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to delete model: ${n instanceof Error?n.message:String(n)}`}]}}a(eFc,"handleBYOKDeleteModelChecked");var TYi=we(X3c,eFc);p();var tFc=b.Object({providerName:b.String()});async function rFc(t,e,r){try{let{providerName:n}=r;if(!n)return[null,{code:Ze.InvalidRequest,message:"Provider name must not be empty."}];if(!ob(n))return[null,{code:Ze.InvalidRequest,message:`Provider-level config deletion is not supported for the '${n}' provider.`}];let o=new as(t.get(Un));return await o.removeAllModelConfigs(n),await o.deleteProviderConfig(n),[{success:!0,message:`Provider config and all model configurations deleted successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to delete provider config: ${n instanceof Error?n.message:String(n)}`}]}}a(rFc,"handleBYOKDeleteProviderConfigChecked");var IYi=we(tFc,rFc);p();var nFc=b.Object({providerName:b.Optional(b.String()),modelId:b.Optional(b.String())}),xYi="-api-key";async function iFc(t,e){let r=await e.listKeys("byok"),n=new Set(await t.listCustomProviderNames()),o=new Set(Object.keys(await t.getStoredModelConfigs(Ii.Azure))),s=new Set(Object.values(Ii).filter(u=>u!==Ii.Azure)),c=`${Ii.Azure}-`,l=[];for(let u of r){if(!u.endsWith(xYi))continue;let d=await e.read("byok",u);if(!d)continue;let f=u.slice(0,-xYi.length),h=f.startsWith(c)?f.slice(c.length):void 0;if(h!==void 0&&o.has(h)&&!n.has(f)){l.push({providerName:Ii.Azure,modelId:h,apiKey:d});continue}(s.has(f)||n.has(f))&&l.push({providerName:f,apiKey:d})}return l}a(iFc,"listAllApiKeys");async function oFc(t,e,r){try{let n=new as(t.get(Un)),{providerName:o,modelId:s}=r;return o?[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]:[{apiKeys:await iFc(n,t.get(Un))},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(oFc,"handleBYOKListApiKeysChecked");var wYi=we(nFc,oFc);p();var sFc=b.Object({providerName:b.Optional(b.String())});async function aFc(t,e,r){try{let n=new as(t.get(Un)),o=r.providerName?VO(r.providerName)?[r.providerName]:[]:await n.listCustomProviderNames(),s=[];for(let c of o){let l=await n.getProviderConfig(c);s.push({providerName:c,groupName:l?.groupName,apiType:l?.apiType})}return[{providers:s},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to list provider configs: ${n instanceof Error?n.message:String(n)}`}]}}a(aFc,"handleBYOKListCustomProviderConfigsChecked");var RYi=we(sFc,aFc);p();p();p();F6r();var Ixt=class extends sb{static{a(this,"AnthropicProvider")}constructor(e){super(Ii.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new as(this.ctx.get(Un)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new yB({apiKey:e,fetch:u6c(this.ctx.get(Jt))});try{let n=await r.models.list(),o=[];for(let s of n.data){let c=this._knownModels?.[s.id];c&&o.push({providerName:this.providerName,modelId:s.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:c})}return o}catch(n){throw YKe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function u6c(t){return async(e,r)=>{let n=d6c(e,r),o=p6c(r),s=await t.fetch(n,o);return m6c(s)}}a(u6c,"createAnthropicFetchAdapter");function d6c(t,e){return t instanceof Request?(f6c(t,e),t.url):t instanceof URL?t.toString():t}a(d6c,"convertInputToString");function f6c(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(f6c,"mergeRequestInit");function p6c(t){let e;return t?.headers&&(e=h6c(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(p6c,"convertToFetchOptions");function h6c(t){let e={};if(t instanceof Headers)for(let[r,n]of t.entries())e[r]=n;else if(Array.isArray(t))for(let[r,n]of t)e[r]=n;else return t;return e}a(h6c,"convertHeaders");async function m6c(t){let e=t.body(),r=null;if(e)r=g6c(e);else{let n=await t.text();r=y6c(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(m6c,"convertToWebResponse");function g6c(t){return new ReadableStream({start(e){let r=A6c(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(g6c,"createReadableStreamFromNodeStream");function A6c(t,e){let r=a(c=>{e.enqueue(new Uint8Array(c))},"onData"),n=a(()=>{e.close(),s()},"onEnd"),o=a(c=>{e.error(c),s()},"onError"),s=a(()=>{t.off("data",r),t.off("end",n),t.off("error",o)},"cleanup");return t.on("data",r),t.on("end",n),t.on("error",o),s}a(A6c,"setupStreamHandlers");function y6c(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(y6c,"createReadableStreamFromText");p();var xxt=class extends sb{static{a(this,"GeminiProvider")}constructor(e){super(Ii.Gemini,e)}};p();var wxt=class extends sb{static{a(this,"GroqProvider")}constructor(e){super(Ii.Groq,e)}};p();var qUr=new pe("ollamaProvider"),jUr="0.6.4",_6c=32768,JJi=4096,Rxt=class extends sb{constructor(r){super(Ii.Ollama,r);this._modelCache=new Map}static{a(this,"OllamaProvider")}async getAllModels(r){let n=jqt(r);await this._checkOllamaVersion(n);let o;try{let c=await this.ctx.get(Jt).fetch(`${n}/api/tags`,{method:"GET"});if(!c.ok)throw new Error(`Failed to fetch models: ${c.status} ${c.statusText}`);o=await c.json()}catch(c){throw qUr.error(this.ctx,`Error fetching models from Ollama at ${n}:`,c),new Error("Failed to fetch models from Ollama. Please ensure Ollama is running. If Ollama is on another host, configure the endpoint URL for the Ollama provider.")}return(await Promise.all((o.models??[]).map(c=>this._resolveModelInfo(n,c)))).filter(c=>c!==void 0)}async _resolveModelInfo(r,n){let o=n.model;if(!o)return;let s=`${r}/${o}`,c=this._modelCache.get(s),l=c!==void 0&&n.digest!==void 0&&c.digest===n.digest,u;if(l)u=c.capabilities;else{try{u=await this._getOllamaModelInfo(r,o)}catch(d){qUr.error(this.ctx,`Failed to fetch Ollama model info for '${o}':`,d);return}this._modelCache.set(s,{digest:n.digest,capabilities:u})}return{providerName:this.providerName,modelId:o,deploymentUrl:r,isRegistered:!1,isCustomModel:!1,modelCapabilities:u}}async _getOllamaModelInfo(r,n){let o=await this._fetchOllamaModelInformation(r,n),s=o.model_info?.["general.architecture"],c=(s?o.model_info?.[`${s}.context_length`]:void 0)??_6c,l=c{let l=s.trim().replace(/^v/i,"").split(/[+-]/,1)[0].split(".").map(u=>Number(u));return l.length>0&&l.every(u=>Number.isFinite(u))?l:void 0},"parseParts"),n=r(e),o=r(jUr);if(!n||!o)return!1;for(let s=0;sl)return!0;if(c{let _=`${y.providerName}_${y.modelId}`;m.set(_,y)});let g=await s.getStoredModelConfigs(n),A=[];for(let[y,_]of Object.entries(g)){if(l&&!m.has(`${n}_${y}`)){await s.removeModelConfig(n,y);continue}A.push({providerName:n,modelId:y,deploymentUrl:_.deploymentUrl,isRegistered:_.isRegistered,isCustomModel:_.isCustomModel,modelCapabilities:HUr(n,_.modelCapabilities)})}A.forEach(y=>{let _=`${y.providerName}_${y.modelId}`;m.set(_,y)}),c.push(...m.values())}}else{let l=await s.getStoredModelConfigs(n);Object.entries(l).forEach(([u,d])=>{c.push({providerName:n,modelId:u,deploymentUrl:d.deploymentUrl,isRegistered:d.isRegistered,isCustomModel:d.isCustomModel,modelCapabilities:HUr(n,d.modelCapabilities)})})}else{let l=await s.listAllProviderNames();for(let u of l){let d=await s.getStoredModelConfigs(u);Object.entries(d).forEach(([f,h])=>{c.push({providerName:u,modelId:f,deploymentUrl:h.deploymentUrl,isRegistered:h.isRegistered,isCustomModel:h.isCustomModel,modelCapabilities:HUr(u,h.modelCapabilities)})})}}return[{models:c},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to get models: ${n instanceof Error?n.message:String(n)}`}]}}a(C6c,"handleBYOKListModelsChecked");var XJi=we(v6c,C6c);p();var b6c=b.Object({providerName:b.Optional(b.String())}),S6c=[Ii.Ollama];async function T6c(t,e,r){try{let n=new as(t.get(Un)),o;r.providerName?o=ob(r.providerName)?[r.providerName]:[]:o=S6c;let s=[];for(let c of o){let l=await n.getProviderConfig(c);l&&s.push({providerName:c,url:l.url})}return[{providers:s},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to list provider configs: ${n instanceof Error?n.message:String(n)}`}]}}a(T6c,"handleBYOKListProviderConfigsChecked");var eZi=we(b6c,T6c);p();var I6c=b.Object({providerName:b.String(),apiKey:b.String(),modelId:b.Optional(b.String())});async function x6c(t,e,r){try{let n=new as(t.get(Un)),{providerName:o,apiKey:s,modelId:c}=r,l=WO(o);if(l===1&&!c)return[null,{code:Ze.InvalidRequest,message:"modelId is required for PerModelDeployment auth type"}];await n.storeAPIKey(o,s,l,c);let u=`API key saved successfully for provider ${o}`;return[{success:!0,message:c?`${u} and model ${c}`:u},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save API key: ${n instanceof Error?n.message:String(n)}`}]}}a(x6c,"handleBYOKSaveApiKeyChecked");var tZi=we(I6c,x6c);p();var w6c=b.Object({providerName:b.String(),apiKey:b.String(),groupName:b.String(),apiType:b.Optional(b.Union([b.Literal("chatCompletions"),b.Literal("responses"),b.Literal("messages")]))});async function R6c(t,e,r){try{let n=r.providerName,{apiKey:o,groupName:s,apiType:c}=r;if(!n)return[null,{code:Ze.InvalidRequest,message:"Provider name must not be empty."}];if(!o)return[null,{code:Ze.InvalidRequest,message:"API key must not be empty."}];if(!VO(n))return[null,{code:Ze.InvalidRequest,message:`Provider '${n}' is a built-in provider; custom provider config is only supported for user-named providers.`}];let l=new as(t.get(Un));return await l.storeAPIKey(n,o,WO(n)),await l.saveProviderConfig(n,{groupName:s,apiType:c}),[{success:!0,message:`Provider config saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save provider config: ${n instanceof Error?n.message:String(n)}`}]}}a(R6c,"handleBYOKSaveCustomProviderConfigChecked");var rZi=we(w6c,R6c);p();var k6c=b.Object({providerName:b.String(),modelId:b.String(),isRegistered:b.Boolean(),isCustomModel:b.Boolean(),deploymentUrl:b.Optional(b.String()),apiKey:b.Optional(b.String()),modelCapabilities:b.Optional(b.Object({name:b.String(),maxInputTokens:b.Optional(b.Number()),maxOutputTokens:b.Optional(b.Number()),toolCalling:b.Boolean(),vision:b.Boolean(),thinking:b.Optional(b.Boolean())}))});async function P6c(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new as(t.get(Un)),h=WO(n);if(h===1&&!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];if(VO(n)){if(!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for custom endpoint provider '${n}'`}];if(!await f.getProviderConfig(n))return[null,{code:Ze.InvalidRequest,message:`Custom endpoint provider '${n}' must be configured via saveCustomProviderConfig before registering models.`}]}if(l||d){let m={deploymentUrl:l,isRegistered:s,isCustomModel:c,modelCapabilities:d};await f.saveModelConfig(n,o,m,u,h)}else u!==void 0&&await f.storeAPIKey(n,u,h,o);return[{success:!0,message:`Model ${o} saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save model: ${n instanceof Error?n.message:String(n)}`}]}}a(P6c,"handleBYOKSaveModelChecked");var nZi=we(k6c,P6c);p();var D6c=b.Object({providerName:b.String(),url:b.Optional(b.String())});async function N6c(t,e,r){try{let{providerName:n,url:o}=r;if(!n)return[null,{code:Ze.InvalidRequest,message:"Provider name must not be empty."}];if(!ob(n))return[null,{code:Ze.InvalidRequest,message:`Provider-level endpoint URL is not supported for the '${n}' provider.`}];let s=new as(t.get(Un)),c=await s.getProviderConfig(n);return await s.saveProviderConfig(n,{...c,groupName:c?.groupName??n,url:o}),[{success:!0,message:`Provider config saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save provider config: ${n instanceof Error?n.message:String(n)}`}]}}a(N6c,"handleBYOKSaveProviderConfigChecked");var iZi=we(D6c,N6c);p();var M6c=b.Object({cliPath:b.String()});async function O6c(t,e,r){return[await _ge.check(r.cliPath),null]}a(O6c,"handleCheckClaudeCliCompatibilityChecked");var oZi=we(M6c,O6c);p();p();var aZi=fe(WP()),sZi="0.135.0",Dxt=new yge({displayName:"Codex CLI",notConfiguredMessage:"Codex CLI path is not configured. Install the Codex CLI (e.g. `npm install -g @openai/codex`), then set the Codex CLI Path in your editor's Copilot settings to the absolute path of the `codex` binary.",validateVersion(t){if(aZi.lt(t,sZi))return{severity:"error",message:`Codex CLI at the input path reports version ${t.version}, but version ${sZi} or later is required. Run \`npm install -g @openai/codex\` to upgrade.`}}});var L6c=b.Object({cliPath:b.String()});async function B6c(t,e,r){return[await Dxt.check(r.cliPath),null]}a(B6c,"handleCheckCodexCliCompatibilityChecked");var cZi=we(L6c,B6c);p();var F6c=b.Object({uri:b.String({minLength:1})});async function U6c(t,e,r){let n=await t.get(si).getOrReadTextDocument(r);return[{status:dd(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(U6c,"handleCheckFileStatusChecked");var lZi=we(F6c,U6c);p();var Q6c=b.Object({});function uZi(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(uZi,"calculatePercentRemaining");function GUr(t){return{percentRemaining:t?.percent_remaining??100,unlimited:t?.unlimited??!1,overagePermitted:t?.overage_permitted??!1,overageCount:t?.overage_count,overageEntitlement:t?.overage_entitlement,creditsUsed:t?.credits_used,entitlement:t?.entitlement,quotaRemaining:t?.quota_remaining,timeStamp:t?.timestamp_utc}}a(GUr,"buildQuotaSnapshot");async function q6c(t,e,r){let n=await t.get(Or).resolveSession();if(!n)return[null,{code:Ze.InternalError,message:"Not signed in"}];let o=await USe(t,n);if(o.ok){let s=await o.json();return t.get(Ru).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:GUr(s.quota_snapshots?.chat),completions:GUr(s.quota_snapshots?.completions),premiumInteractions:GUr(s.quota_snapshots?.premium_interactions),resetDate:s.quota_reset_date??"",resetDateUtc:s.quota_reset_date_utc,copilotPlan:s.access_type_sku==="free_limited_copilot"?"free":s.copilot_plan,tokenBasedBillingEnabled:!0,canUpgradePlan:s.can_upgrade_plan},null]:s.access_type_sku==="free_limited_copilot"?[{chat:{percentRemaining:uZi(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:uZi(s.limited_user_quotas?.completions,s.monthly_quotas?.completions),unlimited:!1,overagePermitted:!1},premiumInteractions:{percentRemaining:0,unlimited:!1,overagePermitted:!1},resetDate:s.limited_user_reset_date??"",copilotPlan:"free",tokenBasedBillingEnabled:!1,canUpgradePlan:s.can_upgrade_plan},null]:[{chat:{percentRemaining:s.quota_snapshots?.chat?.percent_remaining??100,unlimited:s.quota_snapshots?.chat?.unlimited??!1,overagePermitted:s.quota_snapshots?.chat?.overage_permitted??!1},completions:{percentRemaining:s.quota_snapshots?.completions?.percent_remaining??100,unlimited:s.quota_snapshots?.completions?.unlimited??!1,overagePermitted:s.quota_snapshots?.completions?.overage_permitted??!1},premiumInteractions:{percentRemaining:s.quota_snapshots?.premium_interactions?.percent_remaining??100,unlimited:s.quota_snapshots?.premium_interactions?.unlimited??!1,overagePermitted:s.quota_snapshots?.premium_interactions?.overage_permitted??!1},resetDate:s.quota_reset_date??"",copilotPlan:s.copilot_plan,tokenBasedBillingEnabled:!1,canUpgradePlan:s.can_upgrade_plan},null]}return[null,{code:Ze.InternalError,message:"Failed to fetch quota info"}]}a(q6c,"handleCheckQuotaChecked");var dZi=we(Q6c,q6c);p();var j6c=b.Object({options:b.Optional(b.Object({localChecksOnly:b.Optional(b.Boolean()),forceRefresh:b.Optional(b.Boolean())}))});async function H6c(t,e,r){return[await t.get(Or).checkAndUpdateStatus(r.options),null]}a(H6c,"handleCheckStatusChecked");var fZi=we(j6c,H6c);p();var G6c=b.Object({pullRequestNumber:b.Integer({minimum:1}),repoOwner:b.String({minLength:1}),repoName:b.String({minLength:1}),body:b.String({minLength:1})});async function $6c(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await new gm(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return $c(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(zp(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof x_)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a($6c,"handleCloudAgentAddPullRequestCommentChecked");var pZi=we(G6c,$6c);p();var V6c=b.Object({pullRequestId:b.Number(),repoOwner:b.String({minLength:1}),repoName:b.String({minLength:1})});async function W6c(t,e,r){try{let o=await new fb(t).getAllSessions(r.pullRequestId,e);if(!o||o.length===0)return[null,{code:Ze.InvalidRequest,message:"No session found for this pull request"}];let s=o[0];return s.state==="completed"?(ft(t,"githubApi.cancelCodingAgent",Vt.createAndMarkAsIssued()),sr(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new gm(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),ft(t,"githubApi.cancelCodingAgent",Vt.createAndMarkAsIssued()),sr(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):[null,{code:Ze.InternalError,message:"No workflow run ID found in session"}]}catch(n){if(Ma(t,n,"githubApi.cancelCodingAgent"),Hs(t,"githubApi.cancelCodingAgent",n),n instanceof ww)return[null,{code:Ze.NoCopilotToken,message:n.message}];if(n instanceof mp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof mm)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof x_)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(W6c,"handleCancelCodingAgentChecked");var hZi=we(V6c,W6c);p();var z6c=b.Object({problemStatement:b.String({minLength:1}),workspaceFolder:b.Optional(b.String({minLength:1})),workspaceFolders:b.Optional(b.Array(Kc))});function Y6c(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(Y6c,"pickWorkspaceFolder");async function K6c(t,e,r){try{let n=Y6c(r);if(!n)return[null,{code:Ze.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a cloud agent job."}];let s=await new Pf(t).getRepo(n);if(!s||!s.isGitHub())return[null,{code:Ze.InvalidRequest,message:"No GitHub repository found in the workspace folder."}];if(!s.owner||!s.name)return[null,{code:Ze.InvalidRequest,message:"Could not determine repository owner and name."}];let l=await new f5([new p5,new h5]).getBranchInfo(t,n);if(!l?.currentBranch||l.isDetachedHead)return[null,{code:Ze.InvalidRequest,message:"No current branch found or detached HEAD state \u2014 cannot create a cloud agent job."}];let u=l.currentBranch,d=dde(r.problemStatement);if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let h=await new fb(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return $c(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(zp(t,"cloudAgent.createJob",n,{result:"error"}),Mwe(n))return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(n instanceof ww)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof mp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof mm)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof x_)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(K6c,"handleCloudAgentCreateJobChecked");var mZi=we(z6c,K6c);p();var J6c=b.Object({sessionId:b.String({minLength:1})});async function Z6c(t,e,r){try{let o=await new fb(t).getSessionLogs(r.sessionId,e);return $c(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(zp(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof ww)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof mp||n instanceof mm)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(Z6c,"handleCloudAgentGetSessionLogsChecked");var gZi=we(J6c,Z6c);p();var X6c=b.Object({pullRequestId:b.Integer()});async function eUc(t,e,r){try{let o=await new fb(t).getAllSessions(r.pullRequestId,e);return $c(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(zp(t,"cloudAgent.listSessions",n),n instanceof ww)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof mp||n instanceof mm)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(eUc,"handleCloudAgentListSessionsChecked");var AZi=we(X6c,eUc);p();var tUc=b.Object({});async function rUc(t,e,r){return[(await Iw(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(rUc,"handleConversationAgentsChecked");var yZi=we(tUc,rUc);p();p();var B8e=fe(Wc());function nUc(t,e,r){let n=Vt.createAndMarkAsIssued({languageId:String(e.detectedLanguageId),requestedDocumentVersion:String(r),actualDocumentVersion:String(e.version)});return ft(t,"getCompletions.docVersionMismatch",n)}a(nUc,"telemetryVersionMismatch");async function g9(t,e,r){let o=t.get($r).getTextDocumentUnsafe(e);if(!o)throw new B8e.ResponseError(Ze.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await Due(t,e,o.getText());if(s.status==="invalid")throw t.get(ks).setClsInactive(s.reason),new B8e.ResponseError(Ze.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(nUc(t,o,e.version),Yo.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new B8e.ResponseError(Ze.ContentModified,"Document Version Mismatch");return o}a(g9,"getTextDocument");async function _B(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await g9(t,n,r)}catch(o){if(o instanceof B8e.ResponseError){if(o.code===Ze.CopilotNotAvailable)return;if(o.code===Ze.InvalidParams){Yo.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(_B,"getTextDocumentIfAvailable");var iUc=b.Union([b.Literal("keyboard"),b.Literal("toolbar")]),oUc=b.Object({turnId:VJ,codeBlockIndex:b.Number(),source:iUc,copiedCharacters:b.Number(),totalCharacters:b.Number(),copiedText:b.String(),doc:b.Optional(uXe),textDocument:b.Optional(db),position:b.Optional(Cg),conversationSource:b.Optional(y5)});async function sUc(t,e,r){let n=await _B(t,r,e),o={totalCharacters:r.totalCharacters,copiedCharacters:r.copiedCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,currentLine:s.line});let c=qq(r.conversationSource),l=t.get(Xo).findByTurnId(r.turnId),u=await fl(t,l,{languageId:n?.detectedLanguageId??""});return mT(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${S_(c)}.acceptedCopy`,u),["OK",null]}a(sUc,"handleConversationCodeCopyChecked");var _Zi=we(oUc,sUc);p();var aUc=b.Union([b.Literal("keyboard"),b.Literal("toolbar"),b.Literal("diff")]),cUc=b.Object({turnId:VJ,source:aUc,codeBlockIndex:b.Number(),acceptedLength:b.Optional(b.Number()),totalCharacters:b.Number(),newFile:b.Optional(b.Boolean()),doc:b.Optional(uXe),textDocument:b.Optional(db),position:b.Optional(Cg),conversationSource:b.Optional(y5)});async function lUc(t,e,r){let n=await _B(t,r,e),o={totalCharacters:r.totalCharacters,acceptedLength:r.acceptedLength??r.totalCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,insertionOffset:n.offsetAt(s),currentLine:s.line});let c=qq(r.conversationSource),l=t.get(Xo).findByTurnId(r.turnId),u=await fl(t,l,{languageId:n?.detectedLanguageId??""});return mT(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,compType:r.acceptedLength&&r.acceptedLength0&&(e+=` ## Latest Todo List \`\`\`json ${JSON.stringify(o,null,2)} -\`\`\``),e}sendStartedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:s},{turnCount:n});ft(this.ctx,"conversationPartition.compression.started",c,0)}sendArchivedTelemetry(e,r,n,o){let s=Vt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{turnCount:n});ft(this.ctx,"conversationPartition.compression.archived",s,0)}sendSummarizedTelemetry(e,r,n,o){let s=Vt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{summaryLength:n});ft(this.ctx,"conversationPartition.compression.summarized",s,0)}sendCompletedTelemetry(e,r,n,o,s,c,l){let u=Vt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),newPartitionId:String(n),modelId:l},{archivedTurnCount:o,summaryLength:s,compressionTimeMs:c});ft(this.ctx,"conversationPartition.compression.completed",u,0)}sendFailedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),error:n,modelId:s},{compressionTimeMs:o});ft(this.ctx,"conversationPartition.compression.failed",c,0)}sendCancelledTelemetry(e,r,n,o){let s=Date.now()-n,c=Vt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:o},{compressionTimeMs:s});ft(this.ctx,"conversationPartition.compression.cancelled",c,0)}async recordPartitionTranscriptEvents(e,r,n,o,s){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.initializePartition(e,n,{compressedFrom:r,source:"compression",summary:o,turnId:s?String(s):void 0})}catch(c){ot.error(this.ctx,`Failed to initialize new partition transcript: ${c instanceof Error?c.message:String(c)}`)}}};p();p();var Mxt=fe(wo());var Nxt=class extends fr{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Mxt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(Mxt.UserMessage,{priority:90},vscpp(vscppf,null,this.renderFinalInstructions())))}renderSummarizationInstructions(){return`You are an expert at summarizing chat conversations for context compression. +\`\`\``),e}sendStartedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:s},{turnCount:n});ft(this.ctx,"conversationPartition.compression.started",c,0)}sendArchivedTelemetry(e,r,n,o){let s=Vt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{turnCount:n});ft(this.ctx,"conversationPartition.compression.archived",s,0)}sendSummarizedTelemetry(e,r,n,o){let s=Vt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{summaryLength:n});ft(this.ctx,"conversationPartition.compression.summarized",s,0)}sendCompletedTelemetry(e,r,n,o,s,c,l){let u=Vt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),newPartitionId:String(n),modelId:l},{archivedTurnCount:o,summaryLength:s,compressionTimeMs:c});ft(this.ctx,"conversationPartition.compression.completed",u,0)}sendFailedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),error:n,modelId:s},{compressionTimeMs:o});ft(this.ctx,"conversationPartition.compression.failed",c,0)}sendCancelledTelemetry(e,r,n,o){let s=Date.now()-n,c=Vt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:o},{compressionTimeMs:s});ft(this.ctx,"conversationPartition.compression.cancelled",c,0)}async recordPartitionTranscriptEvents(e,r,n,o,s){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.initializePartition(e,n,{compressedFrom:r,source:"compression",summary:o,turnId:s?String(s):void 0})}catch(c){ot.error(this.ctx,`Failed to initialize new partition transcript: ${c instanceof Error?c.message:String(c)}`)}}};p();p();var Oxt=fe(wo());var Mxt=class extends fr{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Oxt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(Oxt.UserMessage,{priority:90},vscpp(vscppf,null,this.renderFinalInstructions())))}renderSummarizationInstructions(){return`You are an expert at summarizing chat conversations for context compression. You will be provided with a series of user/assistant message pairs from a conversation partition that needs to be compressed. @@ -4109,7 +4109,7 @@ Summary: 1. **Analysis Section** = Chronological story for understanding flow 2. **Summary Section** = Structured lookup reference for key facts 3. **Redundancy is acceptable** - same info can appear in both sections -4. **Completeness over brevity** - better to include too much than too little`}renderPartitionTurns(){let{partition:e,ctx:r}=this.props,n=[];if(!e.turns||e.turns.length===0)return n;for(let o of e.turns)if(o.request&&n.push(tXe({role:"user",content:gT(o.request.message)})),o.response){let s=ZO(o.response.message,!0),c=d5(s,{ctx:r,identifier:"partition summary",enableWarnings:!1});c.length>0&&n.push(vscpp(Rw,{assistantRounds:c,ctx:r,isHistorical:!0,identifier:"partition-summary"}))}return n}renderFinalInstructions(){let{partition:e,ctx:r,userLanguage:n}=this.props,o=new Tg(r),s=o.isEnabled()?this.getTranscriptReferenceMessage(o.getTranscriptPath(e.conversationId,e.partitionId),n):"";return`The conversation above contains ${e.turnCount} turn(s) from partition ${e.partitionId}. +4. **Completeness over brevity** - better to include too much than too little`}renderPartitionTurns(){let{partition:e,ctx:r}=this.props,n=[];if(!e.turns||e.turns.length===0)return n;for(let o of e.turns)if(o.request&&n.push(tXe({role:"user",content:gT(o.request.message)})),o.response){let s=ZO(o.response.message,!0),c=d5(s,{ctx:r,identifier:"partition summary",enableWarnings:!1});c.length>0&&n.push(vscpp(Rw,{assistantRounds:c,ctx:r,isHistorical:!0,identifier:"partition-summary"}))}return n}renderFinalInstructions(){let{partition:e,ctx:r,userLanguage:n}=this.props,o=new Ig(r),s=o.isEnabled()?this.getTranscriptReferenceMessage(o.getTranscriptPath(e.conversationId,e.partitionId),n):"";return`The conversation above contains ${e.turnCount} turn(s) from partition ${e.partitionId}. Please create a comprehensive summary following the exact format specified in the system instructions. @@ -4127,7 +4127,7 @@ If you need specific details from before compaction (like exact code snippets, e \u5727\u7E2E\u524D\u306E\u5177\u4F53\u7684\u306A\u8A73\u7D30\uFF08\u6B63\u78BA\u306A\u30B3\u30FC\u30C9\u30B9\u30CB\u30DA\u30C3\u30C8\u3001\u30A8\u30E9\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8\u3001\u751F\u6210\u3055\u308C\u305F\u30B3\u30F3\u30C6\u30F3\u30C4\u306A\u3069\uFF09\u304C\u5FC5\u8981\u306A\u5834\u5408\u306F\u3001\u5B8C\u5168\u306A\u30C8\u30E9\u30F3\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u304A\u8AAD\u307F\u304F\u3060\u3055\u3044\uFF1A${e}`,es:` -Si necesita detalles espec\xEDficos de antes de la compactaci\xF3n (como fragmentos de c\xF3digo exactos, mensajes de error o contenido que gener\xF3), lea la transcripci\xF3n completa en: ${e}`},s=n.split("-")[0];return o[n]||o[s]||o.en}};Fo();var oM=class{constructor(e){this.ctx=e}static{a(this,"ConversationSummaryManager")}async generateSummary(e,r,n,o="conversation-other",s){let c=Date.now();try{if(this.sendStartedTelemetry(e,r),n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let u=await gp.create(Nxt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=WA.user(o,Dt()),f=Tx.createEmptyConfigForTesting(),h;try{h=this.ctx.get(mc)}catch{h=new mc(this.ctx)}let m={messages:u.messages,uiKind:"conversationPanel",llmInteraction:d,modelConfiguration:r,turnId:s},g=await h.fetchResponse(m,n,f,void 0);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";if(g.type==="success"){let A=g.value.trim();return this.sendSuccessTelemetry(e,c,A,r),ot.debug(this.ctx,`Generated partition summary: conversationId=${e.conversationId}, partitionId=${e.partitionId}, length=${A.length}`),A}else{let A="reason"in g?g.reason:"Unknown error";return ot.error(this.ctx,`Failed to generate partition summary: conversationId=${e.conversationId}, partitionId=${e.partitionId}, type=${g.type}, reason=${A}`),this.sendErrorTelemetry(e,c,g.type,r,A),""}}catch(l){let u=l instanceof Error?l.message:String(l);return ot.exception(this.ctx,l,`Error generating partition summary for conversationId=${e.conversationId}, partitionId=${e.partitionId}`),this.sendErrorTelemetry(e,c,"exception",r,u),""}}sendStartedTelemetry(e,r){let n=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:r.modelId},{turnCount:e.turnCount});ft(this.ctx,"partition.summary.started",n,0)}sendSuccessTelemetry(e,r,n,o){let s=Date.now()-r,c=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:o.modelId},{summaryLength:n.length,generationTimeMs:s,turnCount:e.turnCount});ft(this.ctx,"partition.summary.success",c,0)}sendErrorTelemetry(e,r,n,o,s){let c=Date.now()-r,l=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),errorType:n,errorMessage:s||"Unknown error",modelId:o.modelId},{generationTimeMs:c});ft(this.ctx,"partition.summary.error",l,0)}sendCancelledTelemetry(e,r,n){let o=Date.now()-r,s=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:n.modelId},{generationTimeMs:o});ft(this.ctx,"partition.summary.cancelled",s,0)}};var cUc=b.Object({conversationId:b.String()});async function lUc(t,e,r){let{conversationId:n}=r,o=Date.now();ot.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(KI);uUc(t,n,o);try{if(e.isCancellationRequested)return ot.debug(t,`Manual compression cancelled before start: ${n}`),[F8e(n,"Compression cancelled"),null];let c=t.get(Xo),l;try{l=c.get(n)}catch{return ot.warn(t,`Conversation not found: ${n}`),U8e(t,n,0,"Conversation not found",Date.now()-o),[F8e(n,`Conversation not found: ${n}`),null]}let u=l.turns.length;if(u===0)return ot.warn(t,`Cannot compress conversation with 0 turns: ${n}`),U8e(t,n,0,"No turns to compress",Date.now()-o),[F8e(n,`Cannot compress conversation with 0 turns: ${n}`),null];let d=l.turns.filter(v=>v.request.type!=="meta").length;if(l.currentPartitionId>1&&d===0)return ot.warn(t,`Cannot compress - no new turns since last compression: ${n}`),U8e(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[F8e(n,`Cannot compress - no new turns since last compression: ${n}`),null];let h=l.turns[l.turns.length-1],m=h?.resolvedModelConfiguration,g=h?.userRequestedModel;if(!m)if(g)m=await t.get(dl).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(oM),y=new Lk(A,t),_=l.currentPartitionId;await s.notifyCompressionStarted({conversationId:n,partitionId:_,reason:"manual"});let E=await y.compressCurrentPartition(l,m,e);if(E.success){let v=l.turns[0],S=typeof v?.request?.message=="string"?v.request.message:"",T=Date.now()-o;ot.debug(t,`Manual compression completed: conversationId=${n}, archivedPartitionId=${E.archivedPartitionId}, newPartitionId=${E.newPartitionId}, turnCount=${u}, summaryLength=${S.length}, durationMs=${T}`);let w;try{w=new Tj().calculateContextSize(t,l,m)}catch(R){ot.warn(t,`Failed to calculate context size after compression: ${R instanceof Error?R.message:String(R)}`)}return await s.notifyCompressionCompleted({conversationId:n,archivedPartitionId:E.archivedPartitionId,newPartitionId:E.newPartitionId,summaryLength:S.length,turnCount:u,durationMs:T,contextInfo:w}),dUc(t,n,E.archivedPartitionId,E.newPartitionId,u,S.length,T,m.modelId),[{success:!0,conversationId:n,archivedPartitionId:E.archivedPartitionId,newPartitionId:E.newPartitionId,summaryContent:S,summaryLength:S.length,turnCount:u,contextInfo:w},null]}else{let v=E.error||"Compression failed",S=Date.now()-o;return ot.warn(t,`Manual compression failed: conversationId=${n}, error=${v}`),U8e(t,n,E.archivedPartitionId,v,S,m.modelId),[{success:!1,conversationId:n,archivedPartitionId:E.archivedPartitionId,newPartitionId:E.newPartitionId,summaryContent:"",summaryLength:0,turnCount:u,error:v},null]}}catch(c){let l=c instanceof Error?c.message:String(c),u=Date.now()-o;return ot.exception(t,c,`Manual compression error: conversationId=${n}`),U8e(t,n,0,l,u),[F8e(n,`Compression failed: ${l}`),null]}}a(lUc,"handleConversationCompressChecked");function F8e(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(F8e,"createErrorResult");function uUc(t,e,r,n){let o=Vt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});ft(t,"conversationPartition.manualCompression.started",o,0)}a(uUc,"sendStartedTelemetry");function dUc(t,e,r,n,o,s,c,l){let u=Vt.createAndMarkAsIssued({conversationId:e,archivedPartitionId:String(r),newPartitionId:String(n),success:"true",...l?{modelId:l}:{}},{turnCount:o,summaryLength:s,durationMs:c});ft(t,"conversationPartition.manualCompression.completed",u,0)}a(dUc,"sendCompletedTelemetry");function U8e(t,e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:e,partitionId:String(r),success:"false",error:n,...s?{modelId:s}:{}},{durationMs:o});ft(t,"conversationPartition.manualCompression.failed",c,0)}a(U8e,"sendFailedTelemetry");var _Zi=we(cUc,lUc);p();p();var Oxt=b.Array(Of);function Lxt(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a(Lxt,"resolveAsActiveEditor");p();var EZi=fe(Wc());var Bxt=new EZi.ProgressType,GUr=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new Tj}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(er).connection.sendProgress(Bxt,this.progressToken,{kind:"begin",title:`Conversation ${r.id} Turn ${n.id}`,conversationId:r.id,turnId:n.id,agentSlug:n.agent?.agentSlug,...o})}async report(e,r,n,o){let s=o.contextSize;s||(s=this.calculateContextSize(e,r,n)),await e.get(er).connection.sendProgress(Bxt,this.progressToken,{kind:"report",conversationId:r.id,turnId:n.id,...o,contextSize:s})}async end(e,r,n,o){await e.get(er).connection.sendProgress(Bxt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(er).connection.sendProgress(Bxt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,cancellationReason:"CancelledByUser",error:o})}calculateContextSize(e,r,n){try{let o=n.resolvedModelConfiguration;return o?this.tokenBudgetEstimator.calculateContextSize(e,r,o):void 0}catch(o){ot.error(e,"Failed to calculate context size",o);return}}};function $ve(t){return new GUr(t.workDoneToken)}a($ve,"createProgressHandler");p();var vZi=fe(Wc());var Vve=class{static{a(this,"WorkspaceFoldersValidator")}static validate(e){if(!e)return;let r=new Set;for(let n of e){if(r.has(n.uri))throw new vZi.ResponseError(Ze.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function Fxt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:ro(t.uri)}]}a(Fxt,"resolveAsWorkspaceFolders");p();p();var fUc=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),vE=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?fUc(e,r):(this.handlers.push(e.bind(r)),{dispose:a(()=>{},"dispose")}),"onCancellationRequested");this.tokens=e,this._isCancelled=e.some(r=>r.isCancellationRequested),e.forEach(r=>{r.onCancellationRequested(n=>this.cancel(n))})}static{a(this,"MergedToken")}cancel(e){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach(r=>r(e)))}get isCancellationRequested(){return this.tokens.some(e=>e.isCancellationRequested)}};var sM=class{constructor(){this.tokens=new Sn(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new jn.CancellationTokenSource,o=new vE([r,n.token]);return this.tokens.set(e.toString(),n),o}cancel(e){let r=this.tokens.get(e.toString());r&&(r.cancel(),this.tokens.delete(e.toString()))}};p();p();function CZi(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a(CZi,"calculateBillingMultiplier");async function Uxt(t,e){let r=e,n=e.modelInfo?.id;if(!n&&r.model&&(n=r.modelProviderName?r.model:await Ro.resolveModelIdFromFamily(t,r.model)),!n)throw new Error("A model id is required: provide `modelInfo.id` or the deprecated `model` field.");return{...e.modelInfo,id:n,providerName:e.modelInfo?.providerName??r.modelProviderName}}a(Uxt,"resolveTurnModelInfo");function Qxt(t,e){let r=t.resolvedModelConfiguration;return{modelName:r?.uiName??e.id,modelProviderName:e.providerName,userRequestedModel:e.id,reasoningEffort:e.reasoningEffort,chatMode:t.chatMode?.kind,agentSlug:t.agent?.agentSlug,billingMultiplier:CZi(r)}}a(Qxt,"buildTurnSummary");p();function qxt(t,e,r,n,o,s){let{properties:c,measurements:l}=pUc(e,r,n,o,s);ft(t,"conversation.turnCompleted",Vt.createAndMarkAsIssued(c,l)),sr(t,"conversation.turnCompleted",c,l)}a(qxt,"sendTurnTelemetry");function pUc(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};EB(s,"modelName",n.modelName),EB(s,"modelProviderName",n.modelProviderName),EB(s,"userRequestedModel",n.userRequestedModel),EB(s,"reasoningEffort",n.reasoningEffort),EB(s,"chatMode",n.chatMode),EB(s,"agentSlug",n.agentSlug),EB(s,"conversationSource",o?.conversationSource);let c={};return EB(c,"billingMultiplier",n.billingMultiplier),EB(c,"credits",o?.credits),EB(c,"totalTimeMs",o?.totalTimeMs),{properties:s,measurements:c}}a(pUc,"buildTurnTelemetryData");function jxt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(jxt,"formatCredits");function EB(t,e,r){r!==void 0&&(t[e]=r)}a(EB,"assignDefined");var hUc=b.Object({conversationId:b.Optional(lXe),workDoneToken:b.Union([b.String(),b.Number()]),turns:b.Array(kxn,{minItems:1}),capabilities:b.Optional(b.Object({allSkills:b.Optional(b.Boolean()),skills:b.Optional(b.Array(b.String()))})),doc:b.Optional(db),textDocument:b.Optional(db),selection:b.Optional(Of),visibleRanges:b.Optional(Oxt),computeSuggestions:b.Optional(b.Boolean()),references:b.Optional(b.Array(A5)),source:b.Optional(y5),workspaceFolder:b.Optional(b.String()),workspaceFolders:b.Optional(b.Array(Kc)),ignoredSkills:b.Optional(b.Array(b.String())),userLanguage:b.Optional(b.String()),model:b.Optional(b.String()),modelProviderName:b.Optional(b.String()),modelInfo:b.Optional(b.Object({id:b.Optional(b.String()),providerName:b.Optional(b.String()),reasoningEffort:b.Optional(b.String()),contextSize:b.Optional(b.Number())})),chatMode:b.Optional(pXe),customChatModeId:b.Optional(b.String()),needToolCallConfirmation:b.Optional(b.Boolean()),todoList:b.Optional(b.Array(hXe)),restoreToTurnId:b.Optional(b.String())});async function mUc(t,e,r){Vve.validate(r.workspaceFolders);let n=await _B(t,r,e),o=await t.get(Xo).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(xg).setTodos(o,r.todoList);let s=await Uxt(t,r),c=o.turns.length>0?r.turns.slice(-1):r.turns;await gUc(t,o,{...r,turns:c},s.id,n);let l=o.turns[o.turns.length-1],u=$ve(r),d=t.get(sM).add(u.progressToken,e),f=new Qw(t,o,l,d),h=await t.get(aM).createProcessor(f,u.progressToken,r.computeSuggestions),m=t.get(Ru),g=String(l.id);m.resetTurnCredits(g);let A,y=performance.now();try{await h.process(u,d,void 0,n,s),A=m.getCreditsForTurn(g)}finally{m.resetTurnCredits(g)}let _=Math.round(performance.now()-y),E=Qxt(l,s);return qxt(t,"conversation/create",o,l,E,{totalTimeMs:_,credits:A,conversationSource:o.source}),[{conversationId:o.id,turnId:l.id,agentSlug:E.agentSlug,modelName:E.modelName,modelProviderName:E.modelProviderName,billingMultiplier:E.billingMultiplier,modelInfo:r.modelInfo,credits:jxt(A),preciseCredits:A},null]}a(mUc,"handleConversationCreateChecked");async function gUc(t,e,r,n,o){for(let s of r.turns){let c=dXe(s.request),l=new lp({message:c,type:"user"},s.turnId);s.response&&(l.response={message:s.response,type:"model"}),s.agentSlug&&(l.agent={agentSlug:s.agentSlug});let u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:Fxt(u),f=t.get(ov),h=Sq(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=s.model??n,l.needToolCallConfirmation=r.needToolCallConfirmation;let m=Lxt({textDocument:o,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(Xo).addTurn(e.id,l,r.references,m,u,d,r.ignoredSkills,void 0)}}a(gUc,"addTurns");var bZi=we(hUc,mUc);p();var AUc=b.Object({conversationId:b.String()});function yUc(t,e,r){return t.get(Xo).destroy(r.conversationId),["OK",null]}a(yUc,"handleConversationDestroyChecked");var SZi=we(AUc,yUc);p();var _Uc=b.Object({workspaceFolders:b.Optional(b.Array(Kc))});async function EUc(t,e,r){return[(await t.get(ov).listChatModes(r.workspaceFolders)).map(c=>({id:c.id,name:c.name,kind:c.kind,isBuiltIn:c.isBuiltIn,uri:c.uri,description:c.description,customTools:c.customTools,model:c.model,handOffs:c.handOffs})),null]}a(EUc,"handleConversationModesChecked");var TZi=we(_Uc,EUc);p();var vUc=b.Object({turnId:b.String(),acceptedFileCount:b.Number({minimum:0}),totalFileCount:b.Number({minimum:1})}),CUc=new pe("conversationNotifyCodeAcceptance");async function bUc(t,e,r){let n=t.get(Xo).findByTurnId(r.turnId);if(!n)return CUc.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await fl(t,n,{languageId:""});return mT(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${S_("agentPanel")}.codeAcceptance`,o),["OK",null]}a(bUc,"handleConversationNotifyCodeAcceptanceChecked");var IZi=we(vUc,bUc);p();var SUc=b.Object({});function TUc(t,e,r){return[{path:t.get(Un).directory},null]}a(TUc,"handleConversationPersistenceChecked");var xZi=we(SUc,TUc);p();p();var $Ur=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Fr).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},VUr=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Qt).getToken()).envelope.chat_enabled?"ok":"failed"}}},IUc=[new $Ur,new VUr],Bk=class{constructor(e,r=IUc){this.ctx=e;this.checks=r;this.emitter=new Ji;this.onChange=this.emitter.event;ws(e,async()=>{await this.check()})}static{a(this,"PreconditionsCheck")}check(e){return e&&(this.result=void 0),this.result===void 0&&(this.result=this.requestChecks()),this.result}async requestChecks(){let e=[];this.checks.length>0&&(e=await Promise.all(this.checks.map(o=>o.check(this.ctx))));let r=e.every(o=>o.status==="ok")?"ok":"failed",n={results:e,status:r};return this.emitter.fire(n),n}};var xUc=b.Object({forceCheck:b.Optional(b.Boolean())});async function wUc(t,e,r){let n=r.forceCheck??!1;return[await t.get(Bk).check(n),null]}a(wUc,"handleConversationPreconditionsChecked");var wZi=we(xUc,wUc);p();var RUc=b.Object({turnId:b.Optional(b.String()),rating:b.Number(),doc:b.Optional(db),textDocument:b.Optional(db),source:b.Optional(y5)});async function kUc(t,e,r){let n=await _B(t,r,e),o=qq(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await fl(t,r.turnId?t.get(Xo).findByTurnId(r.turnId):void 0,{languageId:n?.detectedLanguageId??""}),l=`${S_(o)}.messageRating`,u=mT(t,n,{rating:s,uiKind:o},{},l,c);return Ix(t,l,u),["OK",null]}a(kUc,"handleConversationRatingChecked");var RZi=we(RUc,kUc);p();var PUc=b.Object({tools:b.Array(Pxn)});function DUc(t,e,r){let n=t.get(vs);return r.tools.forEach(s=>{n.registerTool(new Bj({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(DUc,"conversationRegisterToolsChecked");var kZi=we(PUc,DUc);p();var NUc=b.Object({workspaceFolders:b.Optional(b.Array(Kc)),providers:b.Optional(b.Array(b.Enum(qO)))});async function MUc(t,e,r){let n=r.providers?.length?r.providers:void 0,o=n?.includes("BACKGROUND")===!0,s=a(h=>n===void 0||h.providers.some(m=>n.includes(m)),"appliesToRequest"),c=kzt(t).map(h=>({id:h.id,description:h.description,shortDescription:h.shortDescription,scopes:h.scopes,source:"builtin",providers:["LOCAL"]})).filter(s),l=t.get(P0),u=r.workspaceFolders??[],f=(await l.listCustomPrompts(u,{includePlugins:o})).map(h=>{let m=h.pluginUri!==void 0;return{id:h.uri,name:h.name,description:h.description||"",shortDescription:"",scopes:m?["agent-panel"]:OUc(h.mode),source:"prompt",mode:h.mode,model:h.model,providers:uT(m,h.providers)}}).filter(s);if(c.push(...f),r.workspaceFolders&&r.workspaceFolders.length>0){let g=(await t.get(Ig).listSkills(r.workspaceFolders,{includePlugins:o})).map(A=>({id:`skill:${ro(Cf(A.uri))}`,description:A.description||"",shortDescription:A.name,scopes:["agent-panel"],source:"skill",providers:uT(A.pluginUri!==void 0,A.providers)})).filter(s).filter(A=>!c.some(y=>y.id===A.id));c.push(...g)}return[c,null]}a(MUc,"handleConversationTemplatesChecked");function OUc(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a(OUc,"getCustomPromptScopes");var PZi=we(NUc,MUc);p();var LUc=b.Object({workDoneToken:b.Union([b.String(),b.Number()]),conversationId:lXe,turnId:b.Optional($J),message:QGt,followUp:b.Optional(b.Object({id:b.String(),type:b.String()})),doc:b.Optional(db),textDocument:b.Optional(db),selection:b.Optional(Of),visibleRanges:b.Optional(Oxt),computeSuggestions:b.Optional(b.Boolean()),references:b.Optional(b.Array(A5)),workspaceFolder:b.Optional(b.String()),workspaceFolders:b.Optional(b.Array(Kc)),ignoredSkills:b.Optional(b.Array(b.String())),confirmationResponse:gSn,model:b.Optional(b.String()),modelProviderName:b.Optional(b.String()),modelInfo:b.Optional(b.Object({id:b.Optional(b.String()),providerName:b.Optional(b.String()),reasoningEffort:b.Optional(b.String()),contextSize:b.Optional(b.Number())})),chatMode:b.Optional(pXe),customChatModeId:b.Optional(b.String()),needToolCallConfirmation:b.Optional(b.Boolean()),agentSlug:b.Optional(b.String()),todoList:b.Optional(b.Array(hXe))});async function BUc(t,e,r){Vve.validate(r.workspaceFolders);let n=await _B(t,r,e),o=t.get(Xo),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(xg).setTodos(s,r.todoList);let c=dXe(r.message),l=new lp({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:Fxt(u),f=await Uxt(t,r),h=t.get(ov),m=Sq(r.chatMode);l.chatMode=await h.getChatMode(m,r.customChatModeId,d),l.userRequestedModel=f.id,l.needToolCallConfirmation=r.needToolCallConfirmation,r.agentSlug&&(l.agent={agentSlug:r.agentSlug});let g=Lxt({textDocument:n,selection:r.selection,visibleRanges:r.visibleRanges});l=await o.addTurn(s.id,l,r.references,g,u,d,r.ignoredSkills,r.confirmationResponse);let A=$ve(r),y=t.get(sM).add(A.progressToken,e),_=new Qw(t,s,l,y),E=await t.get(aM).createProcessor(_,A.progressToken,r.computeSuggestions),v=t.get(Ru),S=String(l.id);v.resetTurnCredits(S);let T,w=performance.now();try{await E.process(A,y,r.followUp,n,f),T=v.getCreditsForTurn(S)}finally{v.resetTurnCredits(S)}let R=Math.round(performance.now()-w),x=Qxt(l,f);return qxt(t,"conversation/turn",s,l,x,{totalTimeMs:R,credits:T,conversationSource:s.source}),[{conversationId:s.id,turnId:l.id,agentSlug:x.agentSlug,modelName:x.modelName,modelProviderName:x.modelProviderName,billingMultiplier:x.billingMultiplier,modelInfo:r.modelInfo,credits:jxt(T),preciseCredits:T},null]}a(BUc,"handleConversationTurnChecked");var DZi=we(LUc,BUc);p();var FUc=b.Object({conversationId:b.String(),turnId:b.String(),source:b.Optional(y5)});async function UUc(t,e,r){t.get(Xo).deleteTurn(r.conversationId,r.turnId);let o=qq(r.source),s=await fl(t,t.get(Xo).findByTurnId(r.turnId),{languageId:""});return mT(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${S_(o)}.messageDelete`,s),["OK",null]}a(UUc,"handleConversationTurnDeleteChecked");var NZi=we(FUc,UUc);p();var QUc=b.Object({toolIds:b.Array(b.String())});function qUc(t,e,r){let n=t.get(vs);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(qUc,"conversationUnregisterToolsChecked");var MZi=we(QUc,qUc);p();var jUc=b.Object({chatModeKind:b.Optional(b.Literal("Agent")),customChatModeId:b.Optional(b.String()),workspaceFolders:b.Optional(b.Array(Kc)),tools:b.Array(b.Object({name:b.String(),status:b.Enum(dF)}))});async function HUc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(ov).getChatMode(n?Sq(n):"Agent",o,s),l=t.get(vs),u=r.tools.map(({name:f,status:h})=>({toolName:f,status:h}));return await l.updateToolsStatusByName(c,u),[l.getToolsForModel(c).filter(f=>f.type!=="mcp"),null]}a(HUc,"conversationUpdateToolsStatusChecked");var OZi=we(jUc,HUc);p();p();Fo();var GUc=5e3,Soe=class{static{a(this,"ThinkingTitleGenerateService")}buildPrompt(e){let r;return e.extractedTitles&&e.extractedTitles.length>0?r=e.extractedTitles.join(", "):r=(e.thinkingContent??"").substring(0,1e3),`Summarize the following content in a SINGLE sentence (under 10 words) using past tense. Follow these rules strictly: +Si necesita detalles espec\xEDficos de antes de la compactaci\xF3n (como fragmentos de c\xF3digo exactos, mensajes de error o contenido que gener\xF3), lea la transcripci\xF3n completa en: ${e}`},s=n.split("-")[0];return o[n]||o[s]||o.en}};Fo();var oM=class{constructor(e){this.ctx=e}static{a(this,"ConversationSummaryManager")}async generateSummary(e,r,n,o="conversation-other",s){let c=Date.now();try{if(this.sendStartedTelemetry(e,r),n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let u=await gp.create(Mxt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=WA.user(o,Dt()),f=Tx.createEmptyConfigForTesting(),h;try{h=this.ctx.get(mc)}catch{h=new mc(this.ctx)}let m={messages:u.messages,uiKind:"conversationPanel",llmInteraction:d,modelConfiguration:r,turnId:s},g=await h.fetchResponse(m,n,f,void 0);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";if(g.type==="success"){let A=g.value.trim();return this.sendSuccessTelemetry(e,c,A,r),ot.debug(this.ctx,`Generated partition summary: conversationId=${e.conversationId}, partitionId=${e.partitionId}, length=${A.length}`),A}else{let A="reason"in g?g.reason:"Unknown error";return ot.error(this.ctx,`Failed to generate partition summary: conversationId=${e.conversationId}, partitionId=${e.partitionId}, type=${g.type}, reason=${A}`),this.sendErrorTelemetry(e,c,g.type,r,A),""}}catch(l){let u=l instanceof Error?l.message:String(l);return ot.exception(this.ctx,l,`Error generating partition summary for conversationId=${e.conversationId}, partitionId=${e.partitionId}`),this.sendErrorTelemetry(e,c,"exception",r,u),""}}sendStartedTelemetry(e,r){let n=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:r.modelId},{turnCount:e.turnCount});ft(this.ctx,"partition.summary.started",n,0)}sendSuccessTelemetry(e,r,n,o){let s=Date.now()-r,c=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:o.modelId},{summaryLength:n.length,generationTimeMs:s,turnCount:e.turnCount});ft(this.ctx,"partition.summary.success",c,0)}sendErrorTelemetry(e,r,n,o,s){let c=Date.now()-r,l=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),errorType:n,errorMessage:s||"Unknown error",modelId:o.modelId},{generationTimeMs:c});ft(this.ctx,"partition.summary.error",l,0)}sendCancelledTelemetry(e,r,n){let o=Date.now()-r,s=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:n.modelId},{generationTimeMs:o});ft(this.ctx,"partition.summary.cancelled",s,0)}};var uUc=b.Object({conversationId:b.String()});async function dUc(t,e,r){let{conversationId:n}=r,o=Date.now();ot.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(KI);fUc(t,n,o);try{if(e.isCancellationRequested)return ot.debug(t,`Manual compression cancelled before start: ${n}`),[F8e(n,"Compression cancelled"),null];let c=t.get(Xo),l;try{l=c.get(n)}catch{return ot.warn(t,`Conversation not found: ${n}`),U8e(t,n,0,"Conversation not found",Date.now()-o),[F8e(n,`Conversation not found: ${n}`),null]}let u=l.turns.length;if(u===0)return ot.warn(t,`Cannot compress conversation with 0 turns: ${n}`),U8e(t,n,0,"No turns to compress",Date.now()-o),[F8e(n,`Cannot compress conversation with 0 turns: ${n}`),null];let d=l.turns.filter(v=>v.request.type!=="meta").length;if(l.currentPartitionId>1&&d===0)return ot.warn(t,`Cannot compress - no new turns since last compression: ${n}`),U8e(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[F8e(n,`Cannot compress - no new turns since last compression: ${n}`),null];let h=l.turns[l.turns.length-1],m=h?.resolvedModelConfiguration,g=h?.userRequestedModel;if(!m)if(g)m=await t.get(dl).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(oM),y=new Lk(A,t),_=l.currentPartitionId;await s.notifyCompressionStarted({conversationId:n,partitionId:_,reason:"manual"});let E=await y.compressCurrentPartition(l,m,e);if(E.success){let v=l.turns[0],S=typeof v?.request?.message=="string"?v.request.message:"",T=Date.now()-o;ot.debug(t,`Manual compression completed: conversationId=${n}, archivedPartitionId=${E.archivedPartitionId}, newPartitionId=${E.newPartitionId}, turnCount=${u}, summaryLength=${S.length}, durationMs=${T}`);let w;try{w=new Tj().calculateContextSize(t,l,m)}catch(R){ot.warn(t,`Failed to calculate context size after compression: ${R instanceof Error?R.message:String(R)}`)}return await s.notifyCompressionCompleted({conversationId:n,archivedPartitionId:E.archivedPartitionId,newPartitionId:E.newPartitionId,summaryLength:S.length,turnCount:u,durationMs:T,contextInfo:w}),pUc(t,n,E.archivedPartitionId,E.newPartitionId,u,S.length,T,m.modelId),[{success:!0,conversationId:n,archivedPartitionId:E.archivedPartitionId,newPartitionId:E.newPartitionId,summaryContent:S,summaryLength:S.length,turnCount:u,contextInfo:w},null]}else{let v=E.error||"Compression failed",S=Date.now()-o;return ot.warn(t,`Manual compression failed: conversationId=${n}, error=${v}`),U8e(t,n,E.archivedPartitionId,v,S,m.modelId),[{success:!1,conversationId:n,archivedPartitionId:E.archivedPartitionId,newPartitionId:E.newPartitionId,summaryContent:"",summaryLength:0,turnCount:u,error:v},null]}}catch(c){let l=c instanceof Error?c.message:String(c),u=Date.now()-o;return ot.exception(t,c,`Manual compression error: conversationId=${n}`),U8e(t,n,0,l,u),[F8e(n,`Compression failed: ${l}`),null]}}a(dUc,"handleConversationCompressChecked");function F8e(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(F8e,"createErrorResult");function fUc(t,e,r,n){let o=Vt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});ft(t,"conversationPartition.manualCompression.started",o,0)}a(fUc,"sendStartedTelemetry");function pUc(t,e,r,n,o,s,c,l){let u=Vt.createAndMarkAsIssued({conversationId:e,archivedPartitionId:String(r),newPartitionId:String(n),success:"true",...l?{modelId:l}:{}},{turnCount:o,summaryLength:s,durationMs:c});ft(t,"conversationPartition.manualCompression.completed",u,0)}a(pUc,"sendCompletedTelemetry");function U8e(t,e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:e,partitionId:String(r),success:"false",error:n,...s?{modelId:s}:{}},{durationMs:o});ft(t,"conversationPartition.manualCompression.failed",c,0)}a(U8e,"sendFailedTelemetry");var vZi=we(uUc,dUc);p();p();var Lxt=b.Array(Of);function Bxt(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a(Bxt,"resolveAsActiveEditor");p();var CZi=fe(Wc());var Fxt=new CZi.ProgressType,$Ur=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new Tj}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(er).connection.sendProgress(Fxt,this.progressToken,{kind:"begin",title:`Conversation ${r.id} Turn ${n.id}`,conversationId:r.id,turnId:n.id,agentSlug:n.agent?.agentSlug,...o})}async report(e,r,n,o){let s=o.contextSize;s||(s=this.calculateContextSize(e,r,n)),await e.get(er).connection.sendProgress(Fxt,this.progressToken,{kind:"report",conversationId:r.id,turnId:n.id,...o,contextSize:s})}async end(e,r,n,o){await e.get(er).connection.sendProgress(Fxt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(er).connection.sendProgress(Fxt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,cancellationReason:"CancelledByUser",error:o})}calculateContextSize(e,r,n){try{let o=n.resolvedModelConfiguration;return o?this.tokenBudgetEstimator.calculateContextSize(e,r,o):void 0}catch(o){ot.error(e,"Failed to calculate context size",o);return}}};function $ve(t){return new $Ur(t.workDoneToken)}a($ve,"createProgressHandler");p();var bZi=fe(Wc());var Vve=class{static{a(this,"WorkspaceFoldersValidator")}static validate(e){if(!e)return;let r=new Set;for(let n of e){if(r.has(n.uri))throw new bZi.ResponseError(Ze.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function Uxt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:ro(t.uri)}]}a(Uxt,"resolveAsWorkspaceFolders");p();p();var hUc=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),vE=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?hUc(e,r):(this.handlers.push(e.bind(r)),{dispose:a(()=>{},"dispose")}),"onCancellationRequested");this.tokens=e,this._isCancelled=e.some(r=>r.isCancellationRequested),e.forEach(r=>{r.onCancellationRequested(n=>this.cancel(n))})}static{a(this,"MergedToken")}cancel(e){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach(r=>r(e)))}get isCancellationRequested(){return this.tokens.some(e=>e.isCancellationRequested)}};var sM=class{constructor(){this.tokens=new Sn(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new jn.CancellationTokenSource,o=new vE([r,n.token]);return this.tokens.set(e.toString(),n),o}cancel(e){let r=this.tokens.get(e.toString());r&&(r.cancel(),this.tokens.delete(e.toString()))}};p();p();function SZi(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a(SZi,"calculateBillingMultiplier");async function Qxt(t,e){let r=e,n=e.modelInfo?.id;if(!n&&r.model&&(n=r.modelProviderName?r.model:await Ro.resolveModelIdFromFamily(t,r.model)),!n)throw new Error("A model id is required: provide `modelInfo.id` or the deprecated `model` field.");return{...e.modelInfo,id:n,providerName:e.modelInfo?.providerName??r.modelProviderName}}a(Qxt,"resolveTurnModelInfo");function qxt(t,e){let r=t.resolvedModelConfiguration;return{modelName:r?.uiName??e.id,modelProviderName:e.providerName,userRequestedModel:e.id,reasoningEffort:e.reasoningEffort,chatMode:t.chatMode?.kind,agentSlug:t.agent?.agentSlug,billingMultiplier:SZi(r)}}a(qxt,"buildTurnSummary");p();function jxt(t,e,r,n,o,s){let{properties:c,measurements:l}=mUc(e,r,n,o,s);ft(t,"conversation.turnCompleted",Vt.createAndMarkAsIssued(c,l)),sr(t,"conversation.turnCompleted",c,l)}a(jxt,"sendTurnTelemetry");function mUc(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};EB(s,"modelName",n.modelName),EB(s,"modelProviderName",n.modelProviderName),EB(s,"userRequestedModel",n.userRequestedModel),EB(s,"reasoningEffort",n.reasoningEffort),EB(s,"chatMode",n.chatMode),EB(s,"agentSlug",n.agentSlug),EB(s,"conversationSource",o?.conversationSource);let c={};return EB(c,"billingMultiplier",n.billingMultiplier),EB(c,"credits",o?.credits),EB(c,"totalTimeMs",o?.totalTimeMs),{properties:s,measurements:c}}a(mUc,"buildTurnTelemetryData");function Hxt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(Hxt,"formatCredits");function EB(t,e,r){r!==void 0&&(t[e]=r)}a(EB,"assignDefined");var gUc=b.Object({conversationId:b.Optional(lXe),workDoneToken:b.Union([b.String(),b.Number()]),turns:b.Array(Pxn,{minItems:1}),capabilities:b.Optional(b.Object({allSkills:b.Optional(b.Boolean()),skills:b.Optional(b.Array(b.String()))})),doc:b.Optional(db),textDocument:b.Optional(db),selection:b.Optional(Of),visibleRanges:b.Optional(Lxt),computeSuggestions:b.Optional(b.Boolean()),references:b.Optional(b.Array(A5)),source:b.Optional(y5),workspaceFolder:b.Optional(b.String()),workspaceFolders:b.Optional(b.Array(Kc)),ignoredSkills:b.Optional(b.Array(b.String())),userLanguage:b.Optional(b.String()),model:b.Optional(b.String()),modelProviderName:b.Optional(b.String()),modelInfo:b.Optional(b.Object({id:b.Optional(b.String()),providerName:b.Optional(b.String()),reasoningEffort:b.Optional(b.String()),contextSize:b.Optional(b.Number())})),chatMode:b.Optional(pXe),customChatModeId:b.Optional(b.String()),needToolCallConfirmation:b.Optional(b.Boolean()),todoList:b.Optional(b.Array(hXe)),restoreToTurnId:b.Optional(b.String())});async function AUc(t,e,r){Vve.validate(r.workspaceFolders);let n=await _B(t,r,e),o=await t.get(Xo).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(wg).setTodos(o,r.todoList);let s=await Qxt(t,r),c=o.turns.length>0?r.turns.slice(-1):r.turns;await yUc(t,o,{...r,turns:c},s.id,n);let l=o.turns[o.turns.length-1],u=$ve(r),d=t.get(sM).add(u.progressToken,e),f=new Qw(t,o,l,d),h=await t.get(aM).createProcessor(f,u.progressToken,r.computeSuggestions),m=t.get(Ru),g=String(l.id);m.resetTurnCredits(g);let A,y=performance.now();try{await h.process(u,d,void 0,n,s),A=m.getCreditsForTurn(g)}finally{m.resetTurnCredits(g)}let _=Math.round(performance.now()-y),E=qxt(l,s);return jxt(t,"conversation/create",o,l,E,{totalTimeMs:_,credits:A,conversationSource:o.source}),[{conversationId:o.id,turnId:l.id,agentSlug:E.agentSlug,modelName:E.modelName,modelProviderName:E.modelProviderName,billingMultiplier:E.billingMultiplier,modelInfo:r.modelInfo,credits:Hxt(A),preciseCredits:A},null]}a(AUc,"handleConversationCreateChecked");async function yUc(t,e,r,n,o){for(let s of r.turns){let c=dXe(s.request),l=new lp({message:c,type:"user"},s.turnId);s.response&&(l.response={message:s.response,type:"model"}),s.agentSlug&&(l.agent={agentSlug:s.agentSlug});let u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:Uxt(u),f=t.get(ov),h=Sq(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=s.model??n,l.needToolCallConfirmation=r.needToolCallConfirmation;let m=Bxt({textDocument:o,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(Xo).addTurn(e.id,l,r.references,m,u,d,r.ignoredSkills,void 0)}}a(yUc,"addTurns");var TZi=we(gUc,AUc);p();var _Uc=b.Object({conversationId:b.String()});function EUc(t,e,r){return t.get(Xo).destroy(r.conversationId),["OK",null]}a(EUc,"handleConversationDestroyChecked");var IZi=we(_Uc,EUc);p();var vUc=b.Object({workspaceFolders:b.Optional(b.Array(Kc))});async function CUc(t,e,r){return[(await t.get(ov).listChatModes(r.workspaceFolders)).map(c=>({id:c.id,name:c.name,kind:c.kind,isBuiltIn:c.isBuiltIn,uri:c.uri,description:c.description,customTools:c.customTools,model:c.model,handOffs:c.handOffs})),null]}a(CUc,"handleConversationModesChecked");var xZi=we(vUc,CUc);p();var bUc=b.Object({turnId:b.String(),acceptedFileCount:b.Number({minimum:0}),totalFileCount:b.Number({minimum:1})}),SUc=new pe("conversationNotifyCodeAcceptance");async function TUc(t,e,r){let n=t.get(Xo).findByTurnId(r.turnId);if(!n)return SUc.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await fl(t,n,{languageId:""});return mT(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${S_("agentPanel")}.codeAcceptance`,o),["OK",null]}a(TUc,"handleConversationNotifyCodeAcceptanceChecked");var wZi=we(bUc,TUc);p();var IUc=b.Object({});function xUc(t,e,r){return[{path:t.get(Un).directory},null]}a(xUc,"handleConversationPersistenceChecked");var RZi=we(IUc,xUc);p();p();var VUr=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Or).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},WUr=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Qt).getToken()).envelope.chat_enabled?"ok":"failed"}}},wUc=[new VUr,new WUr],Bk=class{constructor(e,r=wUc){this.ctx=e;this.checks=r;this.emitter=new Ji;this.onChange=this.emitter.event;ws(e,async()=>{await this.check()})}static{a(this,"PreconditionsCheck")}check(e){return e&&(this.result=void 0),this.result===void 0&&(this.result=this.requestChecks()),this.result}async requestChecks(){let e=[];this.checks.length>0&&(e=await Promise.all(this.checks.map(o=>o.check(this.ctx))));let r=e.every(o=>o.status==="ok")?"ok":"failed",n={results:e,status:r};return this.emitter.fire(n),n}};var RUc=b.Object({forceCheck:b.Optional(b.Boolean())});async function kUc(t,e,r){let n=r.forceCheck??!1;return[await t.get(Bk).check(n),null]}a(kUc,"handleConversationPreconditionsChecked");var kZi=we(RUc,kUc);p();var PUc=b.Object({turnId:b.Optional(b.String()),rating:b.Number(),doc:b.Optional(db),textDocument:b.Optional(db),source:b.Optional(y5)});async function DUc(t,e,r){let n=await _B(t,r,e),o=qq(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await fl(t,r.turnId?t.get(Xo).findByTurnId(r.turnId):void 0,{languageId:n?.detectedLanguageId??""}),l=`${S_(o)}.messageRating`,u=mT(t,n,{rating:s,uiKind:o},{},l,c);return Ix(t,l,u),["OK",null]}a(DUc,"handleConversationRatingChecked");var PZi=we(PUc,DUc);p();var NUc=b.Object({tools:b.Array(Dxn)});function MUc(t,e,r){let n=t.get(vs);return r.tools.forEach(s=>{n.registerTool(new Bj({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(MUc,"conversationRegisterToolsChecked");var DZi=we(NUc,MUc);p();var OUc=b.Object({workspaceFolders:b.Optional(b.Array(Kc)),providers:b.Optional(b.Array(b.Enum(qO)))});async function LUc(t,e,r){let n=r.providers?.length?r.providers:void 0,o=n?.includes("BACKGROUND")===!0,s=a(h=>n===void 0||h.providers.some(m=>n.includes(m)),"appliesToRequest"),c=Pzt(t).map(h=>({id:h.id,description:h.description,shortDescription:h.shortDescription,scopes:h.scopes,source:"builtin",providers:["LOCAL"]})).filter(s),l=t.get(D0),u=r.workspaceFolders??[],f=(await l.listCustomPrompts(u,{includePlugins:o})).map(h=>{let m=h.pluginUri!==void 0;return{id:h.uri,name:h.name,description:h.description||"",shortDescription:"",scopes:m?["agent-panel"]:BUc(h.mode),source:"prompt",mode:h.mode,model:h.model,providers:uT(m,h.providers)}}).filter(s);if(c.push(...f),r.workspaceFolders&&r.workspaceFolders.length>0){let g=(await t.get(xg).listSkills(r.workspaceFolders,{includePlugins:o})).map(A=>({id:`skill:${ro(Cf(A.uri))}`,description:A.description||"",shortDescription:A.name,scopes:["agent-panel"],source:"skill",providers:uT(A.pluginUri!==void 0,A.providers)})).filter(s).filter(A=>!c.some(y=>y.id===A.id));c.push(...g)}return[c,null]}a(LUc,"handleConversationTemplatesChecked");function BUc(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a(BUc,"getCustomPromptScopes");var NZi=we(OUc,LUc);p();var FUc=b.Object({workDoneToken:b.Union([b.String(),b.Number()]),conversationId:lXe,turnId:b.Optional(VJ),message:qGt,followUp:b.Optional(b.Object({id:b.String(),type:b.String()})),doc:b.Optional(db),textDocument:b.Optional(db),selection:b.Optional(Of),visibleRanges:b.Optional(Lxt),computeSuggestions:b.Optional(b.Boolean()),references:b.Optional(b.Array(A5)),workspaceFolder:b.Optional(b.String()),workspaceFolders:b.Optional(b.Array(Kc)),ignoredSkills:b.Optional(b.Array(b.String())),confirmationResponse:ASn,model:b.Optional(b.String()),modelProviderName:b.Optional(b.String()),modelInfo:b.Optional(b.Object({id:b.Optional(b.String()),providerName:b.Optional(b.String()),reasoningEffort:b.Optional(b.String()),contextSize:b.Optional(b.Number())})),chatMode:b.Optional(pXe),customChatModeId:b.Optional(b.String()),needToolCallConfirmation:b.Optional(b.Boolean()),agentSlug:b.Optional(b.String()),todoList:b.Optional(b.Array(hXe))});async function UUc(t,e,r){Vve.validate(r.workspaceFolders);let n=await _B(t,r,e),o=t.get(Xo),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(wg).setTodos(s,r.todoList);let c=dXe(r.message),l=new lp({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:Uxt(u),f=await Qxt(t,r),h=t.get(ov),m=Sq(r.chatMode);l.chatMode=await h.getChatMode(m,r.customChatModeId,d),l.userRequestedModel=f.id,l.needToolCallConfirmation=r.needToolCallConfirmation,r.agentSlug&&(l.agent={agentSlug:r.agentSlug});let g=Bxt({textDocument:n,selection:r.selection,visibleRanges:r.visibleRanges});l=await o.addTurn(s.id,l,r.references,g,u,d,r.ignoredSkills,r.confirmationResponse);let A=$ve(r),y=t.get(sM).add(A.progressToken,e),_=new Qw(t,s,l,y),E=await t.get(aM).createProcessor(_,A.progressToken,r.computeSuggestions),v=t.get(Ru),S=String(l.id);v.resetTurnCredits(S);let T,w=performance.now();try{await E.process(A,y,r.followUp,n,f),T=v.getCreditsForTurn(S)}finally{v.resetTurnCredits(S)}let R=Math.round(performance.now()-w),x=qxt(l,f);return jxt(t,"conversation/turn",s,l,x,{totalTimeMs:R,credits:T,conversationSource:s.source}),[{conversationId:s.id,turnId:l.id,agentSlug:x.agentSlug,modelName:x.modelName,modelProviderName:x.modelProviderName,billingMultiplier:x.billingMultiplier,modelInfo:r.modelInfo,credits:Hxt(T),preciseCredits:T},null]}a(UUc,"handleConversationTurnChecked");var MZi=we(FUc,UUc);p();var QUc=b.Object({conversationId:b.String(),turnId:b.String(),source:b.Optional(y5)});async function qUc(t,e,r){t.get(Xo).deleteTurn(r.conversationId,r.turnId);let o=qq(r.source),s=await fl(t,t.get(Xo).findByTurnId(r.turnId),{languageId:""});return mT(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${S_(o)}.messageDelete`,s),["OK",null]}a(qUc,"handleConversationTurnDeleteChecked");var OZi=we(QUc,qUc);p();var jUc=b.Object({toolIds:b.Array(b.String())});function HUc(t,e,r){let n=t.get(vs);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(HUc,"conversationUnregisterToolsChecked");var LZi=we(jUc,HUc);p();var GUc=b.Object({chatModeKind:b.Optional(b.Literal("Agent")),customChatModeId:b.Optional(b.String()),workspaceFolders:b.Optional(b.Array(Kc)),tools:b.Array(b.Object({name:b.String(),status:b.Enum(dF)}))});async function $Uc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(ov).getChatMode(n?Sq(n):"Agent",o,s),l=t.get(vs),u=r.tools.map(({name:f,status:h})=>({toolName:f,status:h}));return await l.updateToolsStatusByName(c,u),[l.getToolsForModel(c).filter(f=>f.type!=="mcp"),null]}a($Uc,"conversationUpdateToolsStatusChecked");var BZi=we(GUc,$Uc);p();p();Fo();var VUc=5e3,Toe=class{static{a(this,"ThinkingTitleGenerateService")}buildPrompt(e){let r;return e.extractedTitles&&e.extractedTitles.length>0?r=e.extractedTitles.join(", "):r=(e.thinkingContent??"").substring(0,1e3),`Summarize the following content in a SINGLE sentence (under 10 words) using past tense. Follow these rules strictly: OUTPUT FORMAT: - MUST be a single sentence @@ -4169,17 +4169,17 @@ EXAMPLES WITH RAW THINKING TEXT: - "The error seems to be coming from the database connection..." \u2192 "Investigated database connection issue" - "Looking at the UserService class, I see it handles..." \u2192 "Reviewed UserService implementation" -Content: ${r}`}async generateTitle(e,r,n){let o=new jn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),GUc),c=r.onCancellationRequested(()=>o.cancel());try{let l=new mc(e),u=await Ro.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Qt).getToken(),h=await e.get(tr).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:WA.user("conversation-panel",Dt())},o.token,h);if(m.type!=="success"){let A="reason"in m?m.reason:"unknown";this.reportFailure(e,m.type,A);return}let g=m.value.trim();if(g.includes("can't assist with that")){this.reportFailure(e,"refused","model refused to assist");return}return g}catch(l){let u=l instanceof Error?l.message:String(l);this.reportFailure(e,"exception",u);return}finally{clearTimeout(s),c.dispose(),o.dispose()}}reportFailure(e,r,n){let o=n.replace(/\n/g," ").substring(0,360);ot.debug(e,`Failed to generate thinking title: errorType='${r}', reason: ${o}`),$c(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var $Uc=b.Object({thinkingContent:b.Optional(b.String()),extractedTitles:b.Optional(b.Array(b.String()))});async function VUc(t,e,r){if(!r.thinkingContent&&(!r.extractedTitles||r.extractedTitles.length===0))return[null,{code:Ze.InvalidRequest,message:"No thinking content or extracted titles provided"}];if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await t.get(Soe).generateTitle(t,e,{thinkingContent:r.thinkingContent,extractedTitles:r.extractedTitles});return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:o?[{title:o},null]:[null,{code:Ze.InternalError,message:"Failed to generate thinking title"}]}a(VUc,"handleThinkingTitleGenerateChecked");var LZi=we($Uc,VUc);p();p();p();var Hxt=/```suggestion(\u0020*(\r\n|\n))((?[\s\S]*?)(\r\n|\n))?```/g;var Wve=class t{static{a(this,"CodeReviewResponseParser")}static findFirstNonWhitespaceCharacterIndex(e){let r=e.match(/\S/);return r?r.index:e.length}static removeSuggestion(e){return e.replaceAll(Hxt,"")}static extractSuggestionAndText(e){Hxt.lastIndex=0;let n=Hxt.exec(e)?.groups?.suggestion||null,o=t.removeSuggestion(e);return{suggestion:n,textWithoutSuggestion:o}}static ghCommentToReviewComment(e,r){let n=r.headContent.split(` +Content: ${r}`}async generateTitle(e,r,n){let o=new jn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),VUc),c=r.onCancellationRequested(()=>o.cancel());try{let l=new mc(e),u=await Ro.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Qt).getToken(),h=await e.get(tr).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:WA.user("conversation-panel",Dt())},o.token,h);if(m.type!=="success"){let A="reason"in m?m.reason:"unknown";this.reportFailure(e,m.type,A);return}let g=m.value.trim();if(g.includes("can't assist with that")){this.reportFailure(e,"refused","model refused to assist");return}return g}catch(l){let u=l instanceof Error?l.message:String(l);this.reportFailure(e,"exception",u);return}finally{clearTimeout(s),c.dispose(),o.dispose()}}reportFailure(e,r,n){let o=n.replace(/\n/g," ").substring(0,360);ot.debug(e,`Failed to generate thinking title: errorType='${r}', reason: ${o}`),$c(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var WUc=b.Object({thinkingContent:b.Optional(b.String()),extractedTitles:b.Optional(b.Array(b.String()))});async function zUc(t,e,r){if(!r.thinkingContent&&(!r.extractedTitles||r.extractedTitles.length===0))return[null,{code:Ze.InvalidRequest,message:"No thinking content or extracted titles provided"}];if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await t.get(Toe).generateTitle(t,e,{thinkingContent:r.thinkingContent,extractedTitles:r.extractedTitles});return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:o?[{title:o},null]:[null,{code:Ze.InternalError,message:"Failed to generate thinking title"}]}a(zUc,"handleThinkingTitleGenerateChecked");var FZi=we(WUc,zUc);p();p();p();var Gxt=/```suggestion(\u0020*(\r\n|\n))((?[\s\S]*?)(\r\n|\n))?```/g;var Wve=class t{static{a(this,"CodeReviewResponseParser")}static findFirstNonWhitespaceCharacterIndex(e){let r=e.match(/\S/);return r?r.index:e.length}static removeSuggestion(e){return e.replaceAll(Gxt,"")}static extractSuggestionAndText(e){Gxt.lastIndex=0;let n=Gxt.exec(e)?.groups?.suggestion||null,o=t.removeSuggestion(e);return{suggestion:n,textWithoutSuggestion:o}}static ghCommentToReviewComment(e,r){let n=r.headContent.split(` `),o=n[e.data.line-1],s=e.data.start_line?e.data.start_line-1:e.data.line-1,c=n[s],l=o.trimEnd().length,u={start:{line:e.data.start_line?e.data.start_line+r.startLineOffset-1:e.data.line+r.startLineOffset-1,character:t.findFirstNonWhitespaceCharacterIndex(c)},end:{line:e.data.line+r.startLineOffset-1,character:l}},d=e.data.body,{suggestion:f,textWithoutSuggestion:h}=t.extractSuggestionAndText(d);return{uri:r.uri,range:u,message:h,kind:e.data.problem_type,severity:"medium",suggestion:f}}static parseLine(e){if(e==="data: [DONE]")return[];if(e==="")return[];let r=JSON.parse(e.replace("data: ",""));return Array.isArray(r.copilot_references)&&r.copilot_references.length>0?r.copilot_references.filter(n=>n.type):[]}static parseReviewResponse(e,r){let n=e.split(` -`),o=[];for(let s of n){let c=t.parseLine(s);for(let l of c.filter(u=>u.type==="github.generated-pull-request-comment")){if(l.data.side!=="RIGHT")continue;let u=r.find(f=>f.path===l.data.path);if(!u)continue;let d=t.ghCommentToReviewComment(l,u);o.push(d)}}return o}};p();p();var Gxt=require("path");var zve=class t{constructor(e,r){this.ctx=e;this.workspaceFolders=r}static{a(this,"BaseReviewProvider")}static{this.DEFAULT_TIMEOUT=120*1e3}static{this.CODING_GUIDELINES_START_INDEX=2}static{this.CODE_REVIEW_ENDPOINT_SERVICE="api"}static{this.CODE_REVIEW_ENDPOINT_PATH="agents/github-code-review"}static{this.CODE_REVIEW_MODE_HEADER="X-Copilot-Code-Review-Mode"}static{this.CODE_REVIEW_MODE_VALUE="ide"}static{this.COPILOT_INTEGRATION_ID_HEADER="Copilot-Integration-Id"}static{this.GITHUB_CODING_GUIDELINE="github.coding_guideline"}static{this.CODING_GUIDELINE="coding-guideline"}static{this.UI_KIND="codeReview"}async fetchCodeReview(e,r){let n=await this.ctx.get(Qt).getToken(),o=Px(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=om(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=Rl();try{return await Uz(this.ctx,o,n.token,void 0,this.telemetryTracker.headerRequestId,e,r,{[t.CODE_REVIEW_MODE_HEADER]:t.CODE_REVIEW_MODE_VALUE,[t.COPILOT_INTEGRATION_ID_HEADER]:c},t.DEFAULT_TIMEOUT).then(d=>{let f=hF(d);this.telemetryTracker.telemetryData.extendWithRequestId(f);let h=Rl()-l;return this.telemetryTracker.telemetryData.measurements.totalTimeMs=h,this.telemetryTracker.telemetryResponse(),(d.status===401||d.status===403)&&this.ctx.get(Qt).resetToken("code_review_fetch",d.status),d}).catch(d=>{if(ng(d))throw d;let f=Rl()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{zKe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,Gxt.basename)(e,(0,Gxt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(Mf).collectAllInstructions(this.ctx,this.workspaceFolders.map(o=>({uri:o.uri})),{includeCopilotInstructions:!0,includeCustomInstructionFiles:!0},e)).map((o,s)=>({type:"github.coding_guideline",id:(s+t.CODING_GUIDELINES_START_INDEX).toString(),data:{id:s+t.CODING_GUIDELINES_START_INDEX,type:"coding-guideline",name:o.description??this.getCodingGuidelineName(o.uri),description:o.content,filePatterns:o.applyTo?[o.applyTo]:[]}}))}};p();Fo();var Yve=class t{constructor(e,r={}){this.ctx=e;this.id=Dt(),this.telemetryData=t.createTelemetryData(this.id).extendedBy(r)}static{a(this,"CopilotCodeReviewTelemetry")}static createTelemetryData(e){let r={headerRequestId:e};return Vt.createAndMarkAsIssued(r)}telemetrySent(){ft(this.ctx,"request.sent",this.telemetryData),sr(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){ft(this.ctx,"request.response",this.telemetryData),sr(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(um(e,"name")??""),this.telemetryData.properties.code=String(um(e,"code")??""),this.telemetryData.properties.errno=String(um(e,"errno")??""),this.telemetryData.properties.type=String(um(e,"type")??""),ft(this.ctx,"request.error",this.telemetryData),sr(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var $xt=class t extends zve{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new Yve(r,{mode:"reviewChanges",uiKind:t.UI_KIND})}static{a(this,"ReviewChangesProvider")}async fetchCodeReview(r,n){return super.fetchCodeReview(r,n)}async changesToReference(){let r=this.ctx.get(pc),n=[],o=await Promise.allSettled(this.changes.map(s=>r.evaluate(s.uri,s.headContent)));for(let s=0;s({path:s.path,content:s.headContent})),baseFileContents:n.map(s=>({path:s.path,content:s.baseContent}))}}}async buildCodingGuideline(){return super.buildCodingGuideline(this.changes.map(r=>r.uri))}async createReviewRequest(){return{messages:[{role:"user",copilot_references:[await this.changesToReference(),...await this.buildCodingGuideline()]}]}}};var WUc=b.Object({uri:b.String(),path:b.String(),baseContent:b.String(),headContent:b.String()}),zUc=b.Object({changes:b.Array(WUc),workspaceFolders:b.Optional(b.Array(Kc))}),Q8e;async function YUc(t,e,r){Q8e&&(Q8e.cancel(),Q8e.dispose()),Q8e=new jn.CancellationTokenSource;let n=new vE([e,Q8e.token]),o=new $xt(t,r.changes,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ze.InternalError,message:"GitHub Copilot Code Review is not enabled."}];let c=await o.createReviewRequest(),l=await o.fetchCodeReview(c,n),u=await l.text();if(!l.ok)return l.status===402?[null,{code:l.status,message:"You have reached your GitHub Copilot Code Review quota limit."}]:(Br.error(t,`Code review request failed: ${l.status}. Response: ${u}`),[null,{code:Ze.InternalError,message:"Failed to generate code review."}]);let d=r.changes.map(h=>({uri:h.uri,path:h.path,headContent:h.headContent,startLineOffset:0}));return[{comments:Wve.parseReviewResponse(u,d)},null]}a(YUc,"handleCopilotCodeReviewReviewChangesChecked");var BZi=we(zUc,YUc);p();p();var Vxt=class t extends zve{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new Yve(r,{mode:"reviewSnippets",uiKind:t.UI_KIND})}static{a(this,"ReviewSnippetsProvider")}static{this.SNIPPET_REVIEW_TYPE="snippet"}async fetchCodeReview(r,n){return super.fetchCodeReview(r,n)}async buildCodingGuideline(r){return super.buildCodingGuideline(r)}snippetsToReference(r){return{type:"github.pull_request",id:"1",data:{type:"pull-request",headFileContents:r.map(n=>({path:n.path,content:n.content})),baseFileContents:[]}}}static snippetsToSnippetFile(r){let n=r[0];return n?.startLine!==void 0&&n?.endLine!==void 0?{path:n.path,start_line:n.startLine,end_line:n.endLine}:void 0}async createReviewRequest(r){let n=this.ctx.get(pc),o=await Promise.allSettled(r.map(u=>n.evaluate(u.uri,u.content))),s=[];for(let u=0;uu.uri),l=await this.buildCodingGuideline(c);return{messages:[{role:"user",review_type:t.SNIPPET_REVIEW_TYPE,copilot_references:[this.snippetsToReference(s),...l],snippet_file:t.snippetsToSnippetFile(s)}]}}};var KUc=b.Object({uri:b.String(),path:b.String(),content:b.String(),startLine:b.Number(),endLine:b.Number()}),JUc=b.Object({snippets:b.Array(KUc),workspaceFolders:b.Optional(b.Array(Kc))}),q8e;async function ZUc(t,e,r){q8e&&(q8e.cancel(),q8e.dispose()),q8e=new jn.CancellationTokenSource;let n=new vE([e,q8e.token]),o=new Vxt(t,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ze.InternalError,message:"GitHub Copilot Code Review is not enabled."}];let c=await o.createReviewRequest(r.snippets),l=await o.fetchCodeReview(c,n);if(!l.ok)return l.status===402?[null,{code:l.status,message:"You have reached your GitHub Copilot Code Review quota limit."}]:[null,{code:Ze.InternalError,message:"Failed to generate code review."}];let u=await l.text(),d=r.snippets.map(h=>({uri:h.uri,path:h.path,headContent:h.content,startLineOffset:h.startLine-1}));return[{comments:Wve.parseReviewResponse(u,d)},null]}a(ZUc,"handleCopilotCodeReviewReviewSnippetsChecked");var FZi=we(JUc,ZUc);p();p();var Wxt=Symbol("onMCPToolsListChanged"),zxt=Symbol("onMCPResourcesListChanged"),Yxt=Symbol("onMCPPromptsListChanged"),UZi=Symbol("onMCPResourceUpdated"),DW=Symbol("onMCPCacheUpdated");function j8e(t){let e={};for(let[r,n]of Object.entries(t)){if(n===null||typeof n!="object"||!("url"in n)||n.headers===void 0){e[r]=n;continue}let{headers:o,...s}=n;e[r]={...s,requestInit:{...s.requestInit,headers:{...o,...s.requestInit?.headers}}}}return e}a(j8e,"normalizeMcpHeaders");var CE=class{static{a(this,"McpManager")}};var XUc=b.Object({}),e9c=b.Object({chatModeKind:b.Optional(b.Literal("Agent")),customChatModeId:b.Optional(b.String()),workspaceFolders:b.Optional(b.Array(Kc)),servers:b.Array(b.Object({name:b.String(),tools:b.Array(b.Object({name:b.String(),status:b.Enum(dF)}))}))}),t9c=b.Object({serverName:b.String(),promptName:b.String(),arguments:b.Optional(b.Record(b.String(),b.String()))}),r9c=b.Object({serverName:b.String(),promptName:b.String(),argumentName:b.String(),prefix:b.String(),alreadyResolved:b.Optional(b.Record(b.String(),b.String()))}),n9c=b.Object({serverName:b.String(),uri:b.String()}),i9c=b.Object({serverName:b.String(),action:b.Union([b.Literal("start"),b.Literal("stop"),b.Literal("restart"),b.Literal("logout"),b.Literal("clearOAuth")])});function o9c(t,e,r){return[t.get(CE).getAllContents(),null]}a(o9c,"handleGetMCPContentsChecked");async function s9c(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(ov).getChatMode(n?Sq(n):"Agent",o,s),l=r.servers.flatMap(({name:d,tools:f})=>f.map(({name:h,status:m})=>({serverName:d,toolName:h,status:m})));return await t.get(CE).updateMCPToolsStatus(c,l),[t.get(CE).getAllContents(c),null]}a(s9c,"handleUpdateMCPToolsStatusChecked");async function a9c(t,e,r){return[await t.get(CE).readResource(r.serverName,r.uri),null]}a(a9c,"handleReadResourceChecked");async function c9c(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(CE).getPrompt(n,o,s),null]}a(c9c,"handleGetPromptChecked");async function l9c(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(CE).completePrompt(n,o,s,c,l),null]}a(l9c,"handleCompletePromptChecked");async function u9c(t,e,r){let n=t.get(CE),{serverName:o,action:s}=r;switch(s){case"start":await n.startMCPServer(o);break;case"stop":await n.stopMCPServer(o);break;case"restart":await n.restartMCPServer(o);break;case"logout":await n.logoutMCPServer(o);break;case"clearOAuth":await n.clearOAuthMCPServer(o);break}return[null,null]}a(u9c,"handleMCPServerActionChecked");var QZi=we(XUc,o9c),qZi=we(e9c,s9c),jZi=we(n9c,a9c),HZi=we(t9c,c9c),GZi=we(r9c,l9c),$Zi=we(i9c,u9c);p();var d9c=b.Object({});async function f9c(t,e,r){let n=await t.get(Qt).getToken();return[g9c(t,await t.get(Ns).getMetadata(),n),null]}a(f9c,"handleCopilotModelsChecked");function p9c(t){return(t.capabilities.supports?.reasoning_effort?.length??0)<=1?!1:t.supported_endpoints?.includes(EWe.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!0}a(p9c,"supportReasoningEffortLevel");function h9c(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!Xle.has(t.capabilities.family)&&t.capabilities.supports?.tool_calls&&(t.capabilities.limits?.max_prompt_tokens??0)>4e4&&e.push("agent-panel"),e}else if(t.capabilities.type==="completion")return["completion"];return[]}a(h9c,"getModelScopes");function m9c(t){return t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(m9c,"shouldExposeModel");function g9c(t,e,r){let n=[];return e.forEach(o=>{m9c(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:h9c(o),id:o.id,vendor:o.vendor,preview:o.preview??!1,isChatDefault:o.is_chat_default??!1,isChatFallback:o.is_chat_fallback??!1,capabilities:{supports:{vision:o.capabilities.supports?.vision??!1,reasoningEfforts:o.capabilities.supports?.reasoning_effort,supportsReasoningEffortLevel:p9c(o)},limits:o.capabilities.limits?{maxContextWindowTokens:o.capabilities.limits.max_context_window_tokens,maxOutputTokens:o.capabilities.limits.max_output_tokens,maxInputTokens:o.capabilities.limits.max_prompt_tokens,maxNonStreamingOutputTokens:o.capabilities.limits.max_non_streaming_output_tokens}:void 0},billing:o.billing?{isPremium:o.billing?.is_premium??!0,multiplier:o.billing?.multiplier??0,tokenBasedBillingEnabled:r.userInfo?.isTBBEnabled,tokenPrices:o.billing?.token_prices?{batchSize:o.billing.token_prices.batch_size,default:o.billing.token_prices.default?{cachePrice:o.billing.token_prices.default.cache_price,cacheWritePrice:o.billing.token_prices.default.cache_write_price,inputPrice:o.billing.token_prices.default.input_price,outputPrice:o.billing.token_prices.default.output_price,maxContext:o.billing.token_prices.default.context_max}:void 0,longContext:o.billing.token_prices.long_context?{cachePrice:o.billing.token_prices.long_context.cache_price,cacheWritePrice:o.billing.token_prices.long_context.cache_write_price,inputPrice:o.billing.token_prices.long_context.input_price,outputPrice:o.billing.token_prices.long_context.output_price,maxContext:o.billing.token_prices.long_context.context_max}:void 0}:void 0,promo:o.billing?.promo?{id:o.billing.promo.id,discountPercent:o.billing.promo.discount_percent,endsAt:o.billing.promo.ends_at,message:o.billing.promo.message}:void 0}:void 0,customModel:o.custom_model?{keyName:o.custom_model.key_name,ownerName:o.custom_model.owner_name,ownerType:o.custom_model.owner_type,provider:o.custom_model.provider}:void 0,degradationReason:Dmn(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(eu).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:lv,modelName:XJe,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:lv,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(g9c,"filterModels");var VZi=we(d9c,f9c);p();var A9c=b.Object({});async function y9c(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(Ns).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(y9c,"handleCopilotModelsGetModelMetadataListChecked");var WZi=we(A9c,y9c);p();var _9c=b.Object({model:b.Optional(b.String()),status:b.Optional(b.String())});async function E9c(t,e,r){return r.model&&r.status==="enabled"?await t.get(Ns).acceptModelPolicy(r.model)?["OK",null]:[null,{code:Ze.InternalError,message:"Failed to accept model policy"}]:[null,{code:Ze.InvalidRequest,message:"Invalid model or status"}]}a(E9c,"handleCopilotModelsPolicyChecked");var zZi=we(_9c,E9c);p();p();p();p();Fo();function v9c(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a(v9c,"panelPositionForDocument");async function*YZi(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(YZi,"trimChoices");var Kve=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=v9c(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function WUr(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await WUr(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(WUr,"reportSolutions");async function zUr(t,e){if(t.isCancellationRequested)return{status:"FinishedWithError",error:"Cancelled"};let r=await e.next();return r.done===!0?{status:"FinishedNormally"}:{status:"Solution",solution:r.value,next:zUr(t,e)}}a(zUr,"generateSolutionsStream");function Kxt(t){return t.replace(/\s+/g,"")}a(Kxt,"normalizeCompletionText");async function KZi(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=eq(t,l.uri),d=Dt(),f=Vt.createAndMarkAsIssued({headerRequestId:d,languageId:l.detectedLanguageId,source:r},{});e.savedTelemetryData=await t.get(tr).fetchTokenAndUpdateExPValuesAndAssignments({uri:l.uri,languageId:l.detectedLanguageId},f),o&&(e.savedTelemetryData=e.savedTelemetryData.extendedBy({engineName:o})),s&&(e.savedTelemetryData=e.savedTelemetryData.extendedBy({comparisonRequestId:s}));let h=await Kge(t,d,rte(l,c),e.savedTelemetryData);if(h.type==="copilotContentExclusion")return{status:"FinishedNormally"};if(h.type==="contextTooShort")return{status:"FinishedWithError",error:"Context too short"};if(h.type==="promptCancelled")return{status:"FinishedWithError",error:"Prompt cancelled"};if(h.type==="promptTimeout")return{status:"FinishedWithError",error:"Prompt timeout"};if(h.type==="promptError")return{status:"FinishedWithError",error:"Prompt error"};let m=h.prompt,g=h.trailingWs;return g.length>0&&(e.startPosition=wu.position(e.startPosition.line,e.startPosition.character-g.length)),e.savedTelemetryData=e.savedTelemetryData.extendedBy({},{...hae(m),solutionCount:e.solutionCountTarget,promptEndPos:l.offsetAt(c)}),n.debug(t,"prompt:",m),ft(t,"solution.requested",e.savedTelemetryData),{prompt:m,trailingWs:g,telemetryData:e.savedTelemetryData,repoInfo:u,ourRequestId:d}}a(KZi,"setupPromptAndTelemetry");function JZi(t,e,r,n,o,s){let c=t.get(t2).forLanguage(t,e.detectedLanguageId,s),l=tT(e.detectedLanguageId),u=_ft(e,r),d={language:e.detectedLanguageId,next_indent:u.next??0,prompt_tokens:n.prefixTokens??0,suffix_tokens:n.suffixTokens??0},f={};c==="parsing"&&!l&&(f.stop=[` +`),o=[];for(let s of n){let c=t.parseLine(s);for(let l of c.filter(u=>u.type==="github.generated-pull-request-comment")){if(l.data.side!=="RIGHT")continue;let u=r.find(f=>f.path===l.data.path);if(!u)continue;let d=t.ghCommentToReviewComment(l,u);o.push(d)}}return o}};p();p();var $xt=require("path");var zve=class t{constructor(e,r){this.ctx=e;this.workspaceFolders=r}static{a(this,"BaseReviewProvider")}static{this.DEFAULT_TIMEOUT=120*1e3}static{this.CODING_GUIDELINES_START_INDEX=2}static{this.CODE_REVIEW_ENDPOINT_SERVICE="api"}static{this.CODE_REVIEW_ENDPOINT_PATH="agents/github-code-review"}static{this.CODE_REVIEW_MODE_HEADER="X-Copilot-Code-Review-Mode"}static{this.CODE_REVIEW_MODE_VALUE="ide"}static{this.COPILOT_INTEGRATION_ID_HEADER="Copilot-Integration-Id"}static{this.GITHUB_CODING_GUIDELINE="github.coding_guideline"}static{this.CODING_GUIDELINE="coding-guideline"}static{this.UI_KIND="codeReview"}async fetchCodeReview(e,r){let n=await this.ctx.get(Qt).getToken(),o=Px(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=om(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=Rl();try{return await Qz(this.ctx,o,n.token,void 0,this.telemetryTracker.headerRequestId,e,r,{[t.CODE_REVIEW_MODE_HEADER]:t.CODE_REVIEW_MODE_VALUE,[t.COPILOT_INTEGRATION_ID_HEADER]:c},t.DEFAULT_TIMEOUT).then(d=>{let f=hF(d);this.telemetryTracker.telemetryData.extendWithRequestId(f);let h=Rl()-l;return this.telemetryTracker.telemetryData.measurements.totalTimeMs=h,this.telemetryTracker.telemetryResponse(),(d.status===401||d.status===403)&&this.ctx.get(Qt).resetToken("code_review_fetch",d.status),d}).catch(d=>{if(ig(d))throw d;let f=Rl()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{zKe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,$xt.basename)(e,(0,$xt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(Mf).collectAllInstructions(this.ctx,this.workspaceFolders.map(o=>({uri:o.uri})),{includeCopilotInstructions:!0,includeCustomInstructionFiles:!0},e)).map((o,s)=>({type:"github.coding_guideline",id:(s+t.CODING_GUIDELINES_START_INDEX).toString(),data:{id:s+t.CODING_GUIDELINES_START_INDEX,type:"coding-guideline",name:o.description??this.getCodingGuidelineName(o.uri),description:o.content,filePatterns:o.applyTo?[o.applyTo]:[]}}))}};p();Fo();var Yve=class t{constructor(e,r={}){this.ctx=e;this.id=Dt(),this.telemetryData=t.createTelemetryData(this.id).extendedBy(r)}static{a(this,"CopilotCodeReviewTelemetry")}static createTelemetryData(e){let r={headerRequestId:e};return Vt.createAndMarkAsIssued(r)}telemetrySent(){ft(this.ctx,"request.sent",this.telemetryData),sr(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){ft(this.ctx,"request.response",this.telemetryData),sr(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(um(e,"name")??""),this.telemetryData.properties.code=String(um(e,"code")??""),this.telemetryData.properties.errno=String(um(e,"errno")??""),this.telemetryData.properties.type=String(um(e,"type")??""),ft(this.ctx,"request.error",this.telemetryData),sr(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var Vxt=class t extends zve{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new Yve(r,{mode:"reviewChanges",uiKind:t.UI_KIND})}static{a(this,"ReviewChangesProvider")}async fetchCodeReview(r,n){return super.fetchCodeReview(r,n)}async changesToReference(){let r=this.ctx.get(pc),n=[],o=await Promise.allSettled(this.changes.map(s=>r.evaluate(s.uri,s.headContent)));for(let s=0;s({path:s.path,content:s.headContent})),baseFileContents:n.map(s=>({path:s.path,content:s.baseContent}))}}}async buildCodingGuideline(){return super.buildCodingGuideline(this.changes.map(r=>r.uri))}async createReviewRequest(){return{messages:[{role:"user",copilot_references:[await this.changesToReference(),...await this.buildCodingGuideline()]}]}}};var YUc=b.Object({uri:b.String(),path:b.String(),baseContent:b.String(),headContent:b.String()}),KUc=b.Object({changes:b.Array(YUc),workspaceFolders:b.Optional(b.Array(Kc))}),Q8e;async function JUc(t,e,r){Q8e&&(Q8e.cancel(),Q8e.dispose()),Q8e=new jn.CancellationTokenSource;let n=new vE([e,Q8e.token]),o=new Vxt(t,r.changes,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ze.InternalError,message:"GitHub Copilot Code Review is not enabled."}];let c=await o.createReviewRequest(),l=await o.fetchCodeReview(c,n),u=await l.text();if(!l.ok)return l.status===402?[null,{code:l.status,message:"You have reached your GitHub Copilot Code Review quota limit."}]:(Fr.error(t,`Code review request failed: ${l.status}. Response: ${u}`),[null,{code:Ze.InternalError,message:"Failed to generate code review."}]);let d=r.changes.map(h=>({uri:h.uri,path:h.path,headContent:h.headContent,startLineOffset:0}));return[{comments:Wve.parseReviewResponse(u,d)},null]}a(JUc,"handleCopilotCodeReviewReviewChangesChecked");var UZi=we(KUc,JUc);p();p();var Wxt=class t extends zve{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new Yve(r,{mode:"reviewSnippets",uiKind:t.UI_KIND})}static{a(this,"ReviewSnippetsProvider")}static{this.SNIPPET_REVIEW_TYPE="snippet"}async fetchCodeReview(r,n){return super.fetchCodeReview(r,n)}async buildCodingGuideline(r){return super.buildCodingGuideline(r)}snippetsToReference(r){return{type:"github.pull_request",id:"1",data:{type:"pull-request",headFileContents:r.map(n=>({path:n.path,content:n.content})),baseFileContents:[]}}}static snippetsToSnippetFile(r){let n=r[0];return n?.startLine!==void 0&&n?.endLine!==void 0?{path:n.path,start_line:n.startLine,end_line:n.endLine}:void 0}async createReviewRequest(r){let n=this.ctx.get(pc),o=await Promise.allSettled(r.map(u=>n.evaluate(u.uri,u.content))),s=[];for(let u=0;uu.uri),l=await this.buildCodingGuideline(c);return{messages:[{role:"user",review_type:t.SNIPPET_REVIEW_TYPE,copilot_references:[this.snippetsToReference(s),...l],snippet_file:t.snippetsToSnippetFile(s)}]}}};var ZUc=b.Object({uri:b.String(),path:b.String(),content:b.String(),startLine:b.Number(),endLine:b.Number()}),XUc=b.Object({snippets:b.Array(ZUc),workspaceFolders:b.Optional(b.Array(Kc))}),q8e;async function e9c(t,e,r){q8e&&(q8e.cancel(),q8e.dispose()),q8e=new jn.CancellationTokenSource;let n=new vE([e,q8e.token]),o=new Wxt(t,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ze.InternalError,message:"GitHub Copilot Code Review is not enabled."}];let c=await o.createReviewRequest(r.snippets),l=await o.fetchCodeReview(c,n);if(!l.ok)return l.status===402?[null,{code:l.status,message:"You have reached your GitHub Copilot Code Review quota limit."}]:[null,{code:Ze.InternalError,message:"Failed to generate code review."}];let u=await l.text(),d=r.snippets.map(h=>({uri:h.uri,path:h.path,headContent:h.content,startLineOffset:h.startLine-1}));return[{comments:Wve.parseReviewResponse(u,d)},null]}a(e9c,"handleCopilotCodeReviewReviewSnippetsChecked");var QZi=we(XUc,e9c);p();p();var zxt=Symbol("onMCPToolsListChanged"),Yxt=Symbol("onMCPResourcesListChanged"),Kxt=Symbol("onMCPPromptsListChanged"),qZi=Symbol("onMCPResourceUpdated"),NW=Symbol("onMCPCacheUpdated");function j8e(t){let e={};for(let[r,n]of Object.entries(t)){if(n===null||typeof n!="object"||!("url"in n)||n.headers===void 0){e[r]=n;continue}let{headers:o,...s}=n;e[r]={...s,requestInit:{...s.requestInit,headers:{...o,...s.requestInit?.headers}}}}return e}a(j8e,"normalizeMcpHeaders");var CE=class{static{a(this,"McpManager")}};var t9c=b.Object({}),r9c=b.Object({chatModeKind:b.Optional(b.Literal("Agent")),customChatModeId:b.Optional(b.String()),workspaceFolders:b.Optional(b.Array(Kc)),servers:b.Array(b.Object({name:b.String(),tools:b.Array(b.Object({name:b.String(),status:b.Enum(dF)}))}))}),n9c=b.Object({serverName:b.String(),promptName:b.String(),arguments:b.Optional(b.Record(b.String(),b.String()))}),i9c=b.Object({serverName:b.String(),promptName:b.String(),argumentName:b.String(),prefix:b.String(),alreadyResolved:b.Optional(b.Record(b.String(),b.String()))}),o9c=b.Object({serverName:b.String(),uri:b.String()}),s9c=b.Object({serverName:b.String(),action:b.Union([b.Literal("start"),b.Literal("stop"),b.Literal("restart"),b.Literal("logout"),b.Literal("clearOAuth")])});function a9c(t,e,r){return[t.get(CE).getAllContents(),null]}a(a9c,"handleGetMCPContentsChecked");async function c9c(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(ov).getChatMode(n?Sq(n):"Agent",o,s),l=r.servers.flatMap(({name:d,tools:f})=>f.map(({name:h,status:m})=>({serverName:d,toolName:h,status:m})));return await t.get(CE).updateMCPToolsStatus(c,l),[t.get(CE).getAllContents(c),null]}a(c9c,"handleUpdateMCPToolsStatusChecked");async function l9c(t,e,r){return[await t.get(CE).readResource(r.serverName,r.uri),null]}a(l9c,"handleReadResourceChecked");async function u9c(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(CE).getPrompt(n,o,s),null]}a(u9c,"handleGetPromptChecked");async function d9c(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(CE).completePrompt(n,o,s,c,l),null]}a(d9c,"handleCompletePromptChecked");async function f9c(t,e,r){let n=t.get(CE),{serverName:o,action:s}=r;switch(s){case"start":await n.startMCPServer(o);break;case"stop":await n.stopMCPServer(o);break;case"restart":await n.restartMCPServer(o);break;case"logout":await n.logoutMCPServer(o);break;case"clearOAuth":await n.clearOAuthMCPServer(o);break}return[null,null]}a(f9c,"handleMCPServerActionChecked");var jZi=we(t9c,a9c),HZi=we(r9c,c9c),GZi=we(o9c,l9c),$Zi=we(n9c,u9c),VZi=we(i9c,d9c),WZi=we(s9c,f9c);p();var p9c=b.Object({});async function h9c(t,e,r){let n=await t.get(Qt).getToken();return[y9c(t,await t.get(Ns).getMetadata(),n),null]}a(h9c,"handleCopilotModelsChecked");function m9c(t){return(t.capabilities.supports?.reasoning_effort?.length??0)<=1?!1:t.supported_endpoints?.includes(EWe.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!0}a(m9c,"supportReasoningEffortLevel");function g9c(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!eue.has(t.capabilities.family)&&t.capabilities.supports?.tool_calls&&(t.capabilities.limits?.max_prompt_tokens??0)>4e4&&e.push("agent-panel"),e}else if(t.capabilities.type==="completion")return["completion"];return[]}a(g9c,"getModelScopes");function A9c(t){return t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(A9c,"shouldExposeModel");function y9c(t,e,r){let n=[];return e.forEach(o=>{A9c(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:g9c(o),id:o.id,vendor:o.vendor,preview:o.preview??!1,isChatDefault:o.is_chat_default??!1,isChatFallback:o.is_chat_fallback??!1,capabilities:{supports:{vision:o.capabilities.supports?.vision??!1,reasoningEfforts:o.capabilities.supports?.reasoning_effort,supportsReasoningEffortLevel:m9c(o)},limits:o.capabilities.limits?{maxContextWindowTokens:o.capabilities.limits.max_context_window_tokens,maxOutputTokens:o.capabilities.limits.max_output_tokens,maxInputTokens:o.capabilities.limits.max_prompt_tokens,maxNonStreamingOutputTokens:o.capabilities.limits.max_non_streaming_output_tokens}:void 0},billing:o.billing?{isPremium:o.billing?.is_premium??!0,multiplier:o.billing?.multiplier??0,tokenBasedBillingEnabled:r.userInfo?.isTBBEnabled,tokenPrices:o.billing?.token_prices?{batchSize:o.billing.token_prices.batch_size,default:o.billing.token_prices.default?{cachePrice:o.billing.token_prices.default.cache_price,cacheWritePrice:o.billing.token_prices.default.cache_write_price,inputPrice:o.billing.token_prices.default.input_price,outputPrice:o.billing.token_prices.default.output_price,maxContext:o.billing.token_prices.default.context_max}:void 0,longContext:o.billing.token_prices.long_context?{cachePrice:o.billing.token_prices.long_context.cache_price,cacheWritePrice:o.billing.token_prices.long_context.cache_write_price,inputPrice:o.billing.token_prices.long_context.input_price,outputPrice:o.billing.token_prices.long_context.output_price,maxContext:o.billing.token_prices.long_context.context_max}:void 0}:void 0,promo:o.billing?.promo?{id:o.billing.promo.id,discountPercent:o.billing.promo.discount_percent,endsAt:o.billing.promo.ends_at,message:o.billing.promo.message}:void 0}:void 0,customModel:o.custom_model?{keyName:o.custom_model.key_name,ownerName:o.custom_model.owner_name,ownerType:o.custom_model.owner_type,provider:o.custom_model.provider}:void 0,degradationReason:Nmn(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(eu).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:lv,modelName:XJe,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:lv,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(y9c,"filterModels");var zZi=we(p9c,h9c);p();var _9c=b.Object({});async function E9c(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(Ns).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(E9c,"handleCopilotModelsGetModelMetadataListChecked");var YZi=we(_9c,E9c);p();var v9c=b.Object({model:b.Optional(b.String()),status:b.Optional(b.String())});async function C9c(t,e,r){return r.model&&r.status==="enabled"?await t.get(Ns).acceptModelPolicy(r.model)?["OK",null]:[null,{code:Ze.InternalError,message:"Failed to accept model policy"}]:[null,{code:Ze.InvalidRequest,message:"Invalid model or status"}]}a(C9c,"handleCopilotModelsPolicyChecked");var KZi=we(v9c,C9c);p();p();p();p();Fo();function b9c(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a(b9c,"panelPositionForDocument");async function*JZi(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(JZi,"trimChoices");var Kve=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=b9c(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function zUr(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await zUr(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(zUr,"reportSolutions");async function YUr(t,e){if(t.isCancellationRequested)return{status:"FinishedWithError",error:"Cancelled"};let r=await e.next();return r.done===!0?{status:"FinishedNormally"}:{status:"Solution",solution:r.value,next:YUr(t,e)}}a(YUr,"generateSolutionsStream");function Jxt(t){return t.replace(/\s+/g,"")}a(Jxt,"normalizeCompletionText");async function ZZi(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=eq(t,l.uri),d=Dt(),f=Vt.createAndMarkAsIssued({headerRequestId:d,languageId:l.detectedLanguageId,source:r},{});e.savedTelemetryData=await t.get(tr).fetchTokenAndUpdateExPValuesAndAssignments({uri:l.uri,languageId:l.detectedLanguageId},f),o&&(e.savedTelemetryData=e.savedTelemetryData.extendedBy({engineName:o})),s&&(e.savedTelemetryData=e.savedTelemetryData.extendedBy({comparisonRequestId:s}));let h=await Kge(t,d,nte(l,c),e.savedTelemetryData);if(h.type==="copilotContentExclusion")return{status:"FinishedNormally"};if(h.type==="contextTooShort")return{status:"FinishedWithError",error:"Context too short"};if(h.type==="promptCancelled")return{status:"FinishedWithError",error:"Prompt cancelled"};if(h.type==="promptTimeout")return{status:"FinishedWithError",error:"Prompt timeout"};if(h.type==="promptError")return{status:"FinishedWithError",error:"Prompt error"};let m=h.prompt,g=h.trailingWs;return g.length>0&&(e.startPosition=wu.position(e.startPosition.line,e.startPosition.character-g.length)),e.savedTelemetryData=e.savedTelemetryData.extendedBy({},{...mae(m),solutionCount:e.solutionCountTarget,promptEndPos:l.offsetAt(c)}),n.debug(t,"prompt:",m),ft(t,"solution.requested",e.savedTelemetryData),{prompt:m,trailingWs:g,telemetryData:e.savedTelemetryData,repoInfo:u,ourRequestId:d}}a(ZZi,"setupPromptAndTelemetry");function XZi(t,e,r,n,o,s){let c=t.get(t2).forLanguage(t,e.detectedLanguageId,s),l=tT(e.detectedLanguageId),u=Eft(e,r),d={language:e.detectedLanguageId,next_indent:u.next??0,prompt_tokens:n.prefixTokens??0,suffix_tokens:n.suffixTokens??0},f={};c==="parsing"&&!l&&(f.stop=[` `,`\r \r -`]);let h=XQ(t,s),m;switch(c){case"server":m=a(()=>{},"finishedCb"),d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsingandserver":m=l?jMe(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?jMe(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a(JZi,"setupCompletionParams");var YUr=new pe("solutions");async function C9c(t,e){let r=e.targetPosition,n=e.textDocument,o=await KZi(t,e,"open copilot",YUr);if("status"in o)return o;let{prompt:s,trailingWs:c,telemetryData:l,repoInfo:u,ourRequestId:d}=o,{extra:f,postOptions:h,finishedCb:m,engineInfo:g}=JZi(t,n,r,s,e,l),A=e.cancellationToken,y={prompt:s,languageId:n.detectedLanguageId,repoInfo:u,ourRequestId:d,engineModelId:g.modelId,count:e.solutionCountTarget,uiKind:"synthesize",postOptions:h,headers:g.headers,extra:f},_=await t.get(JO).fetchAndStreamCompletions(t,y,l.extendedBy(),m,A);if(_.type==="failed"||_.type==="canceled")return{status:"FinishedWithError",error:`${_.type}: ${_.reason}`};let E=_.choices;E=YZi(E),E=Bwe(E,T=>pOe(t,n,r,T,!1,YUr));let v=Bwe(E,async T=>{let w=T.completionText;YUr.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await Csi(t,n,r,T.completionText)??wu.position(r.line,0),[x]=NG(n.getText(wu.range(R,r)));w=x+w;let k=T.completionText;c.length>0&&k.startsWith(c)&&(k=k.substring(c.length));let D=T.meanLogProb,N=D!==void 0?Math.exp(D):0,O=l.extendedBy({choiceIndex:T.choiceIndex.toString()});return{completionText:k,insertText:w,range:wu.range(R,r),meanProb:N,meanLogProb:D||0,requestId:T.requestId,choiceIndex:T.choiceIndex,telemetryData:O,copilotAnnotations:T.copilotAnnotations}});return zUr(A,v[Symbol.asyncIterator]())}a(C9c,"launchSolutions");async function Jxt(t,e,r){return t.get(ks).trackCompletionJob(async()=>{let o=C9c(t,e);return await WUr(o,r)})}a(Jxt,"runSolutions");var XZi=fe(Y9()),G8e=fe(Wc());p();Fo();p();function Zxt(t,e){let r=t.split(` -`),n=e,o=e,s=r[e.line],c=s.indexOf("%");c!==-1&&(s=s.substring(0,c)+s.substring(c+1),n={line:e.line,character:c});let l=s.indexOf("^");if(l!==-1){let u=s.indexOf("^",l+1);if(u===-1)throw new Error("Challenge document must contain zero or two ^ characters.");s=s.substring(0,l)+s.substring(l+1,u)+s.substring(u+1),n={line:e.line,character:e.character},o={line:e.line,character:e.character+u-l-1}}return{cursorLine:s,lines:r,start:n,end:o}}a(Zxt,"parseChallengeDoc");var b9c=b.Object({text:b.String(),score:b.Number()}),S9c=b.Object({documents:b.Array(b9c),options:b.Optional(b.Object({}))});async function Xxt(t,e,r){let n=Dt();for(let o=0;oh+m.length+1,0)+d.character,await r.onSolution({requestId:{headerRequestId:n,serverExperiments:"",deploymentId:""},completionText:f,insertText:f,range:{start:t,end:t},meanProb:c,meanLogProb:-1,choiceIndex:o,telemetryData:Tx.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(Xxt,"runTestSolutions");var cM=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function T9c(t,e,r){return t.forceSet(cM,new cM(r.documents)),["OK",null]}a(T9c,"handleTestingSetPanelCompletionDocumentsChecked");var ZZi=we(S9c,T9c);var eXi=_Ze.type;function I9c(t,e,r,n,o){let s=Kxt(n.completionText),c=(0,XZi.SHA256)(s).toString();return t.get(Fu).set(c,{displayText:n.completionText,insertText:n.insertText,offset:r,uuid:c,range:n.range,uri:e.textDocument.uri,telemetry:n.telemetryData.extendedBy({},{rank:o-1}),index:n.choiceIndex,position:e.position,resultType:0,triggerCategory:"solution",copilotAnnotations:n.copilotAnnotations,clientCompletionId:c}),{range:n.range,insertText:n.insertText,command:{command:E8r,title:`Accept completion ${o}`,arguments:[c]}}}a(I9c,"makeCompletion");function JUr(t,e){return`${t}/${e}`}a(JUr,"progressMessage");var KUr=class{constructor(e,r,n){this.ctx=e;this.params=r;this.onCompletion=n;this.offset=0;this.count=0;this.items=new Map}static{a(this,"SolutionHandler")}get service(){return this.ctx.get(er)}async onSolution(e){this.count+=1;let r=I9c(this.ctx,this.params,this.offset,e,this.items.size+1);this.items.has(r.command.arguments[0])||(this.items.set(r.command.arguments[0],r),await this.onCompletion(r)),this.params.workDoneToken!==void 0&&await this.service.connection.sendProgress(G8e.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:JUr(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return x9c(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(G8e.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function x9c(t,e,r=0){t!==void 0&&await e.connection.sendProgress(G8e.WorkDoneProgress.type,t,{kind:"end",message:JUr(r,10)})}a(x9c,"reportDone");var H8e;async function w9c(t,e,r){let n=await g9(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(er).connection.sendProgress(G8e.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:JUr(0,10),percentage:0});let s=[],c=a(f=>(s.push(f),Promise.resolve()),"onCompletion"),l=r.partialResultToken;l!==void 0&&(c=a(async f=>{await t.get(er).connection.sendProgress(_Ze.partialResult,l,{items:[f]})},"onCompletion"));let u=new KUr(t,r,c),d=t.get(cM);if(d.documents){let f=d.documents;await Xxt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new Kve(n,o,e,10);await Jxt(t,f,u)}return u.error!==void 0?[null,{code:Ze.InternalError,message:u.error}]:[{items:s},null]}a(w9c,"handleChecked");async function R9c(t,e,r){H8e&&(H8e.cancel(),H8e.dispose()),H8e=new jn.CancellationTokenSource;let n=H8e.token,o=new vE([e,n]);try{return await w9c(t,o,r)}catch(s){if(n.isCancellationRequested&&!e.isCancellationRequested)return[null,{code:Ze.ServerCancelled,message:"Request was superseded by a new request"}];throw s}}a(R9c,"handleCheckedWithAbort");var tXi=we(uIn,R9c);p();var P9c=b.Object({workspaceFolders:b.Optional(b.Array(Kc))});async function D9c(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Yd).listCustomAgents(n,{includePlugins:!0,includeRuntimeAgents:!0})).map(c=>{let l=c.promptFileEntry?.promptPath?.storage;return{id:c.id,name:c.name,description:c.description,extensionId:c.extensionId,pluginUri:c.pluginUri,invokePolicy:c.invokePolicy,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,uri:c.promptFileEntry?.promptPath?.uri??c.id,storage:l,providers:uT(c.pluginUri!==void 0,c.providers)}}),null]}a(D9c,"listCustomAgents");var rXi=we(P9c,D9c);p();var N9c=new pe("customAgent/registerExtensionAgents"),M9c=b.Object({uri:b.String(),name:b.String(),description:b.String()}),O9c=b.Object({extensionId:b.String(),agents:b.Array(M9c)});function L9c(t,e,r){try{t.get(Yd).registerExtensionAgent(r.extensionId,r.agents)}catch(n){N9c.warn(t,`Failed to register extension agents for ${r.extensionId}:`,n);let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to register extension agents: ${o}`}]}return[null,null]}a(L9c,"registerExtensionAgents");var nXi=we(O9c,L9c);p();var B9c=b.Object({extensionId:b.String()});function F9c(t,e,r){return t.get(Yd).unregisterExtensionAgents(r.extensionId),[null,null]}a(F9c,"unregisterExtensionAgents");var iXi=we(B9c,F9c);p();var U9c=b.Object({workspaceFolders:b.Optional(b.Array(Kc))});async function Q9c(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Mf).listCustomInstructions(n,{includePlugins:!0})).map(c=>({uri:c.uri,name:c.name,applyTo:c.applyTo,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,storage:c.promptFileEntry?.promptPath.storage,pluginUri:c.pluginUri,providers:uT(c.pluginUri!==void 0,c.providers)})),null]}a(Q9c,"listCustomInstructions");var oXi=we(U9c,Q9c);p();var q9c=b.Object({workspaceFolders:b.Optional(b.Array(Kc))});async function j9c(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(P0).listCustomPrompts(n,{includePlugins:!0})).map(c=>{let l=c.promptFileEntry?.promptPath.storage;return{uri:c.uri,name:c.name,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,storage:l,pluginUri:c.pluginUri,providers:uT(c.pluginUri!==void 0,c.providers)}}),null]}a(j9c,"listCustomPrompts");var sXi=we(q9c,j9c);p();var H9c=b.Object({workspaceFolders:b.Optional(b.Array(Kc))});async function G9c(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Ig).listSkills(n,{includePlugins:!0})).map(c=>({id:c.id,name:c.name,description:c.description,uri:c.uri,storage:c.storage,pluginUri:c.pluginUri,providers:uT(c.pluginUri!==void 0,c.providers)})),null]}a(G9c,"listCustomSkills");var aXi=we(H9c,G9c);p();p();p();function $9c(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get(ig).getConfiguredUrls(),s=new URL("login/device",o).href,c=new URL("_ping",e.proxy).href,l=new URL("_ping",e.api).href,u=new URL("_ping",e.telemetry).href;function d(f){return new URL(f).host}return a(d,"label"),[{label:d(s),url:s},{label:d(n),url:n,session:r},{label:d(c),url:c},{label:d(l),url:l,session:r},{label:d(u),url:u}]}a($9c,"urlsToCheck");async function cXi(t,e,r=i3(t),n,o){let s=$9c(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await V9c(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(cXi,"checkReachability");async function V9c(t,e,r,n){try{let o=new AbortController;n?.onCancellationRequested(()=>o.abort());let s=await t.fetch(e,{headers:r?{Authorization:`Bearer ${r.accessToken}`}:{},signal:o.signal}),c=s.status>=200&&s.status<400?"reachable":"unreachable";return{message:`HTTP ${s.status}`+(s.statusText?` - ${s.statusText}`:""),status:c}}catch(o){return{message:String(o),status:"unreachable"}}}a(V9c,"determineReachability");var JI=fe(require("os")),Jve=fe(require("tls"));async function uXi(t,e){let r=await t.get(Jt).getImplementation(),n=await t.get(Qt).getGitHubSession(),o=await t.get(Qt).getToken().catch(()=>{});return{sections:[z9c(t),W9c(t,n),Y9c(t,r),await K9c(t,r,o?.endpoints,n,e)]}}a(uXi,"collectDiagnostics");function dXi(t){return t.sections.map(J9c).join(JI.EOL+JI.EOL)+JI.EOL}a(dXi,"formatDiagnosticsAsMarkdown");function W9c(t,e){let r=e&&new URL(e.serverUrl).host,n;return e?r==="github.com"?n=e.login:n=`${e.login} (${r})`:n="not signed in",{name:"Copilot",items:{Version:A1(t),"GitHub Account":n,"Session ID":t.get(za).sessionId,"Send Restricted Telemetry":mae(t)?"enabled":"disabled","Content Exclusion":t.get(pc).enabled?"enabled":"unavailable"}}}a(W9c,"collectCopilotSection");function z9c(t){let e={Plugin:X9c(t),Editor:Z9c(t),"Operating System":`${JI.type()} ${JI.release()} (${JI.arch()})`};return vB(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(z9c,"collectEnvironmentSection");function Y9c(t,e){let r=t.get(Qo).getHttpSettings(),n={Proxy:r.proxy||void 0,"Proxy Authorization":r.proxyAuthorization?"present":void 0,"Proxy Kerberos SPN":r.proxyKerberosServicePrincipal,"Proxy Strict SSL":r.proxyStrictSSL===!1?"disabled":"enabled","No Proxy":r.noProxy?.join(",")||void 0,Fetcher:e.name.replace(/Fetcher$/,""),"Number of Root Certificates":Jve.rootCertificates.length,"TLS Default Min Version":Jve.DEFAULT_MIN_VERSION,"TLS Default Max Version":Jve.DEFAULT_MAX_VERSION};return vB(n,"http_proxy"),vB(n,"https_proxy"),vB(n,"no_proxy"),vB(n,"SSL_CERT_FILE"),vB(n,"SSL_CERT_DIR"),vB(n,"OPENSSL_CONF"),vB(n,"NODE_EXTRA_CA_CERTS"),vB(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(Y9c,"collectNetworkConfigSection");async function K9c(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await cXi(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(K9c,"collectReachabilitySection");function lXi(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(lXi,"quoteCode");function vB(t,e){let r=process.env[e];r&&(t[lXi(e)]=lXi(r)),r!==process.env[e.toUpperCase()]&&vB(t,e.toUpperCase())}a(vB,"addEnvironmentVariable");function J9c(t){return`## ${t.name}`+JI.EOL+JI.EOL+Object.keys(t.items).filter(e=>e!=="name").map(e=>`- ${e}: ${t.items[e]??"N/A"}`).join(JI.EOL)}a(J9c,"formatSectionAsMarkdown");function Z9c(t){let e=t.get(Ir).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(Z9c,"getEditorDisplayVersion");function X9c(t){let e=t.get(Ir).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(X9c,"getPluginDisplayVersion");var e7c=b.Object({});async function t7c(t,e){return[{report:dXi(await uXi(t,e))},null]}a(t7c,"handleDiagnosticsChecked");var fXi=we(e7c,t7c);p();p();var hXi=require("node:crypto");function $8e(t,e){return(0,hXi.createHash)("sha256").update(t).digest("hex").slice(0,e)}a($8e,"stableHex");function ewt(t){let e=Date.parse(t);return Number.isFinite(e)?String(BigInt(e)*1000000n):"0"}a(ewt,"timestampToNano");function ZUr(t){if(t!=null)return typeof t=="string"?t:JSON.stringify(t)}a(ZUr,"stringValue");function XUr(t){return typeof t=="number"&&Number.isFinite(t)?t:0}a(XUr,"numberValue");function pXi(t,e){let r=ewt(t);return{startNano:r,endNano:r,input:e,output:[],inputTokens:0,outputTokens:0,cacheReadTokens:0,tools:[],pendingTools:new Map}}a(pXi,"newTurn");function r7c(t,e,r,n,o){let s=o.data??{},c=s.success!==!1,l=c?s.result:s.error,u={[Pn.OPERATION_NAME]:uge.EXECUTE_TOOL,[Pn.AGENT_NAME]:"codex",[Pn.SYSTEM]:"openai",[Pn.CONVERSATION_ID]:t,[Pn.TOOL_NAME]:n.name,[Pn.TOOL_CALL_ID]:n.id,[Pn.TOOL_CALL_ARGUMENTS]:ZUr(n.arguments),[Pn.TOOL_CALL_RESULT]:ZUr(l)};return{traceId:r,spanId:$8e(`${t}:${e}:tool:${n.id}`,16),parentSpanId:$8e(`${t}:${e}:root`,16),name:`execute_tool ${n.name}`,kind:1,startTimeUnixNano:n.startNano,endTimeUnixNano:ewt(o.timestamp),attributes:wR(u),events:[],status:c?{code:1}:{code:2,message:ZUr(s.error)??"Tool execution failed"}}}a(r7c,"buildToolSpan");function n7c(t,e,r){if(!r.input&&r.output.length===0&&r.inputTokens===0&&r.outputTokens===0&&r.cacheReadTokens===0&&r.tools.length===0)return[];let n=$8e(`${t}:${e}`,32),o=r.model??"unknown",s={[Pn.OPERATION_NAME]:uge.INVOKE_AGENT,[Pn.AGENT_NAME]:"codex",[Pn.SYSTEM]:"openai",[Pn.CONVERSATION_ID]:t,[Pn.REQUEST_MODEL]:o,[Pn.RESPONSE_MODEL]:o,[Pn.TURN_COUNT]:e+1,[Pn.INPUT_MESSAGES]:r.input?Z8("user",r.input):void 0,[Pn.OUTPUT_MESSAGES]:r.output.length>0?Z8("assistant",r.output.join(` -`)):void 0,[Pn.USAGE_INPUT_TOKENS]:r.inputTokens||void 0,[Pn.USAGE_OUTPUT_TOKENS]:r.outputTokens||void 0,[Pn.USAGE_CACHE_READ_INPUT_TOKENS]:r.cacheReadTokens||void 0};return[{traceId:n,spanId:$8e(`${t}:${e}:root`,16),name:"invoke_agent codex",kind:1,startTimeUnixNano:r.startNano,endTimeUnixNano:r.endNano,attributes:wR(s),events:[],status:{code:1}},...r.tools]}a(n7c,"buildTurnSpans");function i7c(t,e){let r=[],n,o=0,s=a(l=>(n??=pXi(l.timestamp),n.endNano=ewt(l.timestamp),n),"ensureTurn"),c=a(()=>{n&&(r.push(...n7c(e,o++,n)),n=void 0)},"flushTurn");for(let l of t){let u=l.data??{};switch(l.type){case"user.message":c(),n=pXi(l.timestamp,typeof u.content=="string"?u.content:void 0);break;case"assistant.message":{let d=s(l);typeof u.content=="string"&&u.content.length>0&&d.output.push(u.content),typeof u.model=="string"&&u.model.length>0&&(d.model=u.model);break}case"assistant.usage":{let d=s(l);d.inputTokens+=XUr(u.inputTokens),d.outputTokens+=XUr(u.outputTokens),d.cacheReadTokens+=XUr(u.cacheReadTokens);break}case"tool.execution_start":{let d=s(l),f=typeof u.toolCallId=="string"?u.toolCallId:l.id;d.pendingTools.set(f,{id:f,name:typeof u.toolName=="string"?u.toolName:"unknown",arguments:u.arguments,startNano:ewt(l.timestamp)});break}case"tool.execution_complete":{let d=s(l),f=typeof u.toolCallId=="string"?u.toolCallId:l.id,h=d.pendingTools.get(f);if(h){let m=$8e(`${e}:${o}`,32);d.tools.push(r7c(e,o,m,h,l)),d.pendingTools.delete(f)}break}case"session.idle":s(l),c();break}}return c(),r}a(i7c,"codexSessionEventsToOtlpSpans");async function mXi(t){let e=await pIt(t);if(!e)return null;let r=await hIt(e);return r?i7c(r,t):null}a(mXi,"readCodexRolloutSpans");var gXi=require("fs"),AXi=fe(require("path"));var o7c=b.Object({conversationId:b.String(),targetPath:b.String(),sessionTitle:b.Optional(b.String()),agentProvider:il});async function s7c(t,e,r){if(!AXi.isAbsolute(r.targetPath))return[null,{code:Ze.InvalidParams,message:`targetPath must be an absolute path, got: ${r.targetPath}`}];let n;if(r.agentProvider==="CODEX"){let s=await mXi(r.conversationId);if(!s||s.length===0)return[null,{code:Ze.InternalError,message:`No Codex rollout data found for conversation ${r.conversationId}`}];n=s}else n=await t.get(cI).readSpans(r.conversationId);let o=Gii(n,{conversationId:r.conversationId,sessionTitle:r.sessionTitle});try{await gXi.promises.writeFile(r.targetPath,JSON.stringify(o,null,2),"utf8")}catch(s){return[null,{code:Ze.InternalError,message:`Failed to write export to ${r.targetPath}: ${s instanceof Error?s.message:String(s)}`}]}return[{exportFilePath:r.targetPath},null]}a(s7c,"handleExportAgentDebugLogToPathChecked");var yXi=we(o7c,s7c);p();var a7c=b.Object({conversationId:b.String()});async function c7c(t,e,r){return[{logFilePath:await t.get(cI).getLogFilePath(r.conversationId)},null]}a(c7c,"handleGetAgentDebugLogPathChecked");var _Xi=we(a7c,c7c);p();Fo();var TXi=fe(Wc());p();var EXi=require("crypto");var Zve=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new t9r(e,this.id)}},t9r=class{constructor(e,r){this.ctx=e;this.id=r;this.contextItems=[];this.update=!1}static{a(this,"LspClientContextResolver")}async resolve(e,r){let n=[];if(this.contextItems.length>0)n=this.contextItems;else if(this.update){let o=this.ctx.get(er),s=(0,EXi.randomUUID)(),c=o.connection.onProgress(AZe.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(AZe.type,{providerId:this.id,data:this.data,textDocument:{uri:e.documentContext.uri,languageId:e.documentContext.languageId,version:e.documentContext.version},position:e.documentContext.position,partialResultToken:s},r);n.push(...l)}finally{c?.dispose()}}return this.reset(),Promise.resolve(n)}setContextItems(e){this.contextItems=e}clearContextItems(){this.contextItems=[]}setUpdate(e){this.update=e}clearData(){this.data=void 0}reset(){this.clearContextItems(),this.clearData(),this.setUpdate(!1)}};function twt(t,e,r){try{let n=t.get(km),o=new Map;n.providers.forEach(s=>{o.set(s.id,s)}),e.providers.forEach(s=>{let c=o.get(s.id);c&&c instanceof Zve&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof Zve&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Br.error(t,"Failed to set context items on context providers",n)}}a(twt,"setContextItems");var e9r={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function vXi(t,e,r){return e.map(o=>{try{if(typeof o=="string")return Df(r.uri,o,e9r);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=Df(r.uri,o.scheme||"",e9r)),"pattern"in o&&(s&&=Df(r.uri,o.pattern||"",e9r)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(vXi,"match");p();var l7c=b.Object({documents:b.Array(b.String()),basename:b.Optional(b.String()),options:b.Optional(b.Object({}))}),MW=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function u7c(t,e,r){return t.forceSet(MW,new MW(r.documents,r.basename||"")),["OK",null]}a(u7c,"handleTestingSetCompletionDocumentsChecked");var CXi=new pe("setCompletionDocuments"),SXi=we(l7c,u7c);function rwt(t,e,r,n){let o=t.get(MW);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){CXi.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=d7c(o,r);return c&&c.length>0?bXi(c,s,e):void 0}else return CXi.debug(t,"Returning completions for all pre-set documents"),bXi(o.documents,s,e)}}a(rwt,"getTestCompletions");function bXi(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=Zxt(n,r);return{insertText:[o.slice(Math.min(c.character,r.character))].concat(s.slice(r.line+1)).join(` -`),range:{start:c,end:l}}})}a(bXi,"sliceAndMapCompletions");function d7c(t,e){return t.basename===ro(e)?t.documents||[]:[]}a(d7c,"getFilteredDocs");var IXi=b.Object({doc:b.Object({position:vg,insertSpaces:b.Optional(b.Boolean()),tabSize:b.Optional(b.Number()),uri:fRe,version:b.Number()}),contextItems:b.Optional(e0r)}),V8e;async function xXi(t,e,r,n){V8e&&(V8e.cancel(),V8e.dispose()),V8e=new jn.CancellationTokenSource;let o=new vE([e,V8e.token]);r.contextItems&&twt(t,r.contextItems);let s=rwt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:Dt(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await g9(t,r.doc,o)}catch(h){if(!(h instanceof TXi.ResponseError))throw h;switch(h.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return[{completions:[]},null]}throw h}let l=r.doc.position;if(l.line>=c.lineCount)return[{completions:[]},null];let u=await t.get(Ay).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(Fu);for(let h of u)d.set(h.uuid,{...h,triggerCategory:"ghostText"});return[{completions:u.map(h=>({uuid:h.uuid,text:h.insertText,range:h.range,displayText:h.displayText,position:h.position,docVersion:c.version}))},null]}a(xXi,"handleGetCompletionsHelper");var wXi=we(IXi,(t,e,r)=>xXi(t,e,r,!1)),RXi=we(IXi,(t,e,r)=>xXi(t,e,r,!0));p();var f7c=b.Object({});function p7c(t,e,r){return[{defaultRules:t.get(qw).getDefaultRules()},null]}a(p7c,"handleGetDefaultFileSafetyRulesChecked");var kXi=we(f7c,p7c);p();var PXi=fe(Y9()),Xve=fe(Wc());var h7c=b.Object({doc:b.Object({position:vg,uri:fRe,version:b.Number()}),panelId:b.String()});function m7c(t,e,r,n,o){let s=Kxt(o.completionText),c=(0,PXi.SHA256)(s).toString();return t.get(Fu).set(c,{displayText:o.insertText,insertText:o.completionText,offset:n,uuid:c,range:r,uri:e.doc.uri,telemetry:o.telemetryData,index:o.choiceIndex,position:r.end,resultType:0,triggerCategory:"solution",copilotAnnotations:o.copilotAnnotations,clientCompletionId:c}),{panelId:e.panelId,range:r,completionText:o.completionText,displayText:o.insertText,score:o.meanProb,solutionId:c}}a(m7c,"makeSolution");var r9r=class{constructor(e,r,n){this.ctx=e;this.params=r;this.range=n;this.offset=0}static{a(this,"SolutionHandler")}get service(){return this.ctx.get(er)}onSolution(e){return this.service.connection.sendNotification(new Xve.NotificationType("PanelSolution"),m7c(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return DXi(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new Xve.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function DXi(t,e){return e.connection.sendNotification(new Xve.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(DXi,"reportDone");var W8e;async function g7c(t,e,r){W8e&&(W8e.cancel(),W8e.dispose()),W8e=new jn.CancellationTokenSource;let n=new vE([e,W8e.token]),o=r.doc.position,s=wu.range(o,o),c=new r9r(t,r,s),l=t.get(cM);if(l.documents){let u=l.documents;Xxt(o,u,c)}else{let u;try{u=await g9(t,r.doc,n)}catch(f){if(!(f instanceof Xve.ResponseError))throw f;switch(f.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return A7c(t,r)}throw f}c.offset=u.offsetAt(o);let d=new Kve(u,o,n,10);Jxt(t,d,c)}return[{solutionCountTarget:10},null]}a(g7c,"handleGetPanelCompletionsChecked");async function A7c(t,e){return await DXi(e.panelId,t.get(er)),[{solutionCountTarget:0},null]}a(A7c,"produceEmptySolutions");var NXi=we(h7c,g7c);p();var y7c=b.Object({});async function _7c(t,e,r){let o=(await t.get(Qt).getToken()).userInfo,s=o.raw,l=(await t.get(Fr).resolveSession())?.login;return!s||!l?[null,null]:[{userName:l,copilotPlan:o.copilotPlan,rawUserInfo:s},null]}a(_7c,"handleGetUserInfoChecked");var MXi=we(y7c,_7c);p();var E7c=b.Object({});function v7c(t,e,r){return[{version:t.get(As).getDisplayVersion(),buildType:_7(t),runtimeVersion:`node/${process.versions.node}`},null]}a(v7c,"handleGetVersionChecked");var OXi=we(E7c,v7c);p();Fo();var C7c=b.Object({changes:b.Array(b.String()),userCommits:b.Array(b.String()),recentCommits:b.Array(b.String()),workspaceFolder:b.Optional(b.String()),userLanguage:b.Optional(b.String())});async function b7c(t,e,r){if(r.changes.length===0)return[null,{code:Ze.InvalidRequest,message:"No changes provided"}];let n=t.get(Xo),o=n.create({capabilities:{skills:[g5]}}),s=new lp({message:"",type:"user"});await n.addTurn(o.id,s);let c=$ve({workDoneToken:Dt()});await t.get(Bc).begin(o,s,c);let d=(await new Qw(t,o,s,e).skillResolver.resolve(g5))?.head?.name,h=await t.get(dee).generateCommitMessage(t,e,r,d);return h==null?[null,{code:Ze.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(b7c,"handleGitCommitGenerateChecked");var LXi=we(C7c,b7c);p();var S7c=b.Object({repoOwner:b.String({minLength:1}),repoName:b.String({minLength:1}),pullRequestNumber:b.Number()});async function T7c(t,e,r){try{let o=await new gm(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return ft(t,"githubApi.listPullRequestChangedFiles",Vt.createAndMarkAsIssued()),sr(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(Ma(t,n,"githubApi.listPullRequestChangedFiles"),Hs(t,"githubApi.listPullRequestChangedFiles",n),n instanceof x_)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(T7c,"handleListPullRequestChangedFilesChecked");var BXi=we(S7c,T7c);p();var I7c=b.Object({query:b.String(),workspaceFolder:b.Optional(b.String()),workspaceFolders:b.Optional(b.Array(Kc))}),FXi=4,eCe=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function x7c(t,e,r){try{let n=new $Ee(t),o=await R7c(t,r),s=await n.searchPullRequests(o);await w7c(t,s);let c=k7c(s);return ft(t,"githubApi.searchPR",Vt.createAndMarkAsIssued()),sr(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof eCe)return[null,{code:n.errorCode,message:n.message}];if(n instanceof x_)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(Ma(t,n,"githubApi.searchPR"),Hs(t,"githubApi.searchPR",n),n instanceof fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(x7c,"handleSearchPRChecked");async function w7c(t,e){let r=new gm(t);for(let n=0;n{try{c.copilotWorkStatus=await r.getCopilotWorkingStatus(c.repository.owner.login,c.repository.name,c.number,c.user?.login)}catch{c.copilotWorkStatus="not_copilot_issue"}});await Promise.all(s)}}a(w7c,"appendCopilotWorkStatus");async function R7c(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Fr).resolveSession();if(!n)throw new eCe("The user is not logged in.",Ze.NoGitHubToken);r=r.replace(/\$\{user\}/g,n.login)}if(r.includes("${owner}")||r.includes("${repository}")){let n;if(e.workspaceFolders&&e.workspaceFolders.length>0)n=e.workspaceFolders[0];else if(e.workspaceFolder)n={uri:e.workspaceFolder};else throw new eCe("No workspace folder provided",Ze.InvalidRequest);let s=await t.get(Pf).getRepo(n);if(s&&s.isGitHub()&&s.owner&&s.name)r=r.replace(/\$\{owner\}/g,s.owner),r=r.replace(/\$\{repository\}/g,s.name);else{let c;!s||!s.isGitHub()?c="The workspace folder is not a GitHub repository.":!s.owner&&!s.name?c="Git repository detected but both owner and repository name information are missing. Ensure the repository has a valid remote origin.":s.owner?s.name||(c="Git repository detected but repository name is missing. Ensure the repository has a valid remote origin."):c="Git repository detected but owner information is missing. Ensure the repository has a valid remote origin.";let l=`Cannot obtain GitHub information for workspace folder: ${n.uri}. Template variables \${owner} and \${repository} require a valid Git repository with remote GitHub origin configured: ${c}`;throw new eCe(l,Ze.NoGitHubRepository)}}return r}a(R7c,"replaceTemplateVariables");function k7c(t){let e=0,r=0,n=0,o=0;for(let s of t)switch(s.copilotWorkStatus){case"in_progress":e++;break;case"done":r++;break;case"error":n++;break;case"not_copilot_issue":default:o++;break}return{totalPRs:t.length,inProgressPRs:e,donePRs:r,errorPRs:n,notCopilotPRs:o}}a(k7c,"buildCopilotWorkStatusMeasurements");var UXi=we(I7c,x7c);p();var P7c=new pe("hook.list"),D7c=b.Object({workspaceFolders:b.Optional(b.Array(Kc))});function N7c(t){let e=[];for(let r of t){let n=new Map;for(let o of r.hooks){let s=wpr[o.type];if(s===void 0)continue;let c=o.hooks.map(u=>Rpr(u,"")).filter(u=>u!==void 0);if(c.length===0)continue;let l=n.get(o.uri);l===void 0&&(l={},n.set(o.uri,l)),(l[s]??=[]).push(...c)}for(let[o,s]of n)e.push({uri:o,source:"plugin",pluginUri:r.uri,providers:["BACKGROUND"],hooks:s})}return e}a(N7c,"pluginHookRows");async function M7c(t,e,r){let n=r.workspaceFolders??[],o=sG(t)&&WF(t)?(async()=>{try{let l=(await t.get(Ca).listPlugins()).filter(vme);return N7c(l)}catch(l){return l instanceof Ic||P7c.warn(t,"failed to list plugin hooks for hook/list",{err:String(l)}),[]}})():void 0,c=(await t.get(D0).listHooks(n)).map(l=>{let u={};for(let[d,f]of Object.entries(l.parsedPromptFile.hooks))f!==void 0&&(u[d]=[...f]);return{uri:l.promptPath.uri,storage:l.promptPath.storage,source:AJ(l.promptPath.metadata),providers:c2(l.promptPath.metadata),hooks:u}});return o&&c.push(...await o),[c,null]}a(M7c,"listHooks");var QXi=we(D7c,M7c);p();Fo();var jXi=tGt.type,z8e;function qXi(t){return{title:"Completion Accepted",command:vOe,arguments:[t]}}a(qXi,"makeCommand");async function O7c(t,e,r){z8e&&(z8e.cancel(),z8e.dispose());let n=r.context.triggerKind===1;z8e=new jn.CancellationTokenSource;let o=z8e.token,s=new vE([e,o]);r.contextItems&&twt(t,r.contextItems,r.data);let c=rwt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:qXi(Dt()),...g}))},null];let l=await g9(t,r.textDocument,s),u=r.position;if(u.line>=l.lineCount)return[{items:[]},null];let d=await t.get(Ay).getCompletions(l,u,s,{isCycling:n,selectedCompletionInfo:r.context.selectedCompletionInfo,formattingOptions:r.formattingOptions,data:r.data});if(!d)return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was canceled"}]:o.isCancellationRequested?[null,{code:Ze.ServerCancelled,message:"Request was superseded by a new request"}]:[{items:[]},null];let f=t.get(Fu);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:qXi(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(O7c,"handleChecked");var HXi=we(fsi,(t,e,r)=>O7c(t,e,r));p();p();function n9r(t){let e=t.indexOf("-----BEGIN CERTIFICATE-----")+27,r=t.indexOf("-----END CERTIFICATE-----"),n=30,o=t.substring(e,e+n)+"..."+t.substring(r-n,r-1);return tCe(o)}a(n9r,"asReadableCert");function tCe(t){return t.replace(/\s/g,"")}a(tCe,"normalizeNewlines");var B7c=b.Object({});async function F7c(t){return[{certificates:(await t.get(bp).getAllRootCAs()).map(tCe)},null]}a(F7c,"handleListCertificatesChecked");var GXi=we(B7c,F7c);p();var U7c=b.Object({forceRefresh:b.Optional(b.Boolean())});async function Q7c(t,e,r){let n=t.get(ay);return[r.forceRefresh?await n.refresh({force:!0}):await n.refresh(),null]}a(Q7c,"handleManagedSettingsGetChecked");var $Xi=we(U7c,Q7c);p();var WXi="mcpGateway/serversChanged",zXi="mcpGateway/serverDetailsChanged",YXi=b.Union([b.Object({kind:b.Literal("user")}),b.Object({kind:b.Literal("project"),workspaceFolder:b.String()}),b.Object({kind:b.Literal("plugin"),pluginId:b.String()})]),q7c=b.Object({source:YXi,name:b.String()}),j7c=b.Union([b.Object({kind:b.Literal("user")}),b.Object({kind:b.Literal("project"),workspaceFolder:b.String()})]),VXi=b.Record(b.String(),b.Unknown()),H7c=b.Object({workspaceFolder:b.String(),user:VXi,project:VXi});async function G7c(t,e,r){let n=j8e(r.user),o=j8e(r.project);return await t.get(gy).applyConfig({workspaceFolder:r.workspaceFolder,user:n,project:o}),[null,null]}a(G7c,"handleApplyConfigChecked");var KXi=we(H7c,G7c),$7c=b.Object({scope:j7c});function V7c(t,e,r){return[{servers:t.get(gy).listServers(r.scope).map(s=>({...s,providers:uT(s.source.kind==="plugin",void 0)}))},null]}a(V7c,"handleListServersChecked");var JXi=we($7c,V7c),W7c=q7c;function z7c(t,e,r){return[{details:t.get(gy).getServerDetails(r)},null]}a(z7c,"handleGetServerDetailsChecked");var ZXi=we(W7c,z7c),Y7c=b.Object({source:YXi,name:b.String(),action:b.Union([b.Literal("start"),b.Literal("stop"),b.Literal("restart"),b.Literal("logout"),b.Literal("clearOAuth")])});async function K7c(t,e,r){try{return await t.get(gy).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof vG)return[null,{code:Ze.InvalidRequest,message:n.message,data:{kind:n.code}}];let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:o}]}}a(K7c,"handleServerActionChecked");var XXi=we(Y7c,K7c);p();p();p();var eeo=fe(Wc());var i9r=class extends eeo.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=Ze.InternalError){super(o,e,{errorType:r,...n})}},Toe=class extends i9r{static{a(this,"HttpStatusError")}constructor(e,r,n,o=Ze.InternalError){super(e,r,{status:n},o)}},nwt=class extends Toe{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,Ze.NoCopilotToken)}},iwt=class extends Toe{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var owt=class extends Toe{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function teo(t){try{if(!("x-metadata"in t))return null;let e=t["x-metadata"];if(typeof e!="object"||e===null)return null;let r=e.registry;if(typeof r!="object"||r===null)return null;let n=r,o=n.api,s=n.mcpServer;if(typeof o!="object"||o===null||typeof s!="object"||s===null)return null;let c=o,l=s;return typeof c.baseUrl=="string"&&c.baseUrl.length>0&&typeof c.version=="string"&&c.version.length>0&&typeof l.name=="string"&&l.name.length>0&&typeof l.version=="string"&&l.version.length>0?{api:{baseUrl:c.baseUrl,version:c.version},mcpServer:{name:l.name,version:l.version},...Object.fromEntries(Object.entries(n).filter(([u])=>!["api","mcpServer"].includes(u)))}:null}catch{return null}}a(teo,"getRegistryMetadataFromConfig");function reo(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?J7c(t,r):!1}catch{return!1}}a(reo,"validateServerConfigurationMatch");function J7c(t,e){if(!e.remotes||e.remotes.length===0)return!1;let r=a(o=>o.replace(/\/+$/,""),"normalizeUrl"),n=r(t.url);return e.remotes.some(o=>r(o.url)===n)}a(J7c,"validateRemoteURL");var neo=300*1e3,lM=class{constructor(e){this.allowlistCache=null;this.serverCache=null;this.ctx=e}static{a(this,"McpRegistryService")}isAllowlistCacheValid(e,r){return Date.now()-e=500&&u<600?[null,new owt(u)]:[null,new Toe(`Failed to fetch MCP registry allowlist: HTTP ${u}`,"httpError",u)]}}try{let u=await s.text();c=JSON.parse(u)}catch(u){return[null,{code:Ze.InternalError,message:`Failed to parse MCP registry allowlist: ${u instanceof Error?u.message:String(u)}`}]}return!c.mcp_registries||!Array.isArray(c.mcp_registries)?[null,{code:Ze.InternalError,message:"Invalid allowlist format: expected mcp_registries array"}]:c.mcp_registries.some(u=>!u.url||!u.registry_access)?[null,{code:Ze.InternalError,message:"Invalid allowlist format: registry entries missing required fields"}]:(this.allowlistCache={timestamp:Date.now(),data:c,userLogin:r},[c,null])}catch(e){return[null,{code:Ze.InternalError,message:`Failed to fetch MCP registry allowlist: ${e instanceof Error?e.message:String(e)}`}]}}async validateServerConfig(e,r){try{let n=await this.getRegistryInfo();if(n.accessMode==="fallback")return{serverName:e,serverConfig:r,isBlocked:!1};let o=n.registryUrl,s=n.owner,c=await this.checkServerInRegistry(r,o);if(n.accessMode==="allow_all")return{serverName:e,serverConfig:r,isBlocked:!1,registryInfo:c.isFoundInRegistry?s?`Provided by ${s.login} organization`:"Provided by organization":void 0};{let l=!c.isFoundInRegistry;return{serverName:e,serverConfig:r,isBlocked:l,blockReason:l?c.validationError:void 0,registryInfo:l?s?`Blocked by ${s.login} organization registry policy`:"Blocked by organization registry policy":s?`Provided by ${s.login} organization`:"Provided by organization"}}}catch(n){return{serverName:e,serverConfig:r,isBlocked:!0,blockReason:`validation failed: ${n instanceof Error?n.message:String(n)}`,registryInfo:"Blocked by organization registry policy"}}}async checkServerInRegistry(e,r){let n=teo(e);if(!n)return{isFoundInRegistry:!1,validationError:"does not have valid registry config"};let o=n.mcpServer.name,s=n.mcpServer.version,c=n.api.baseUrl,l=n.api.version,u=a(m=>m.replace(/\/+$/,""),"normalizeUrl");if(u(c)!==u(r))return{isFoundInRegistry:!1,validationError:`does not match allowed registry Url, expected: ${r}, found: ${c}`};let d=`${c.replace(/\/+$/,"")}/${l}/servers`,[f,h]=await this.fetchServer(d,o,s);return f&&!h?reo(e,f)?{isFoundInRegistry:!0}:{isFoundInRegistry:!1,validationError:"url"in e?"remote server URL does not match any registry remote URL":"local configuration does not match registry server configuration"}:{isFoundInRegistry:!1,validationError:h?`Server validation failed: ${h.message}`:`Server not found in registry ${c}`}}async getRegistryInfo(){let[e,r]=await this.fetchMcpRegistryAllowlist();if(r)return{accessMode:"fallback",errorMessage:`Failed to fetch registry allowlist: ${r.message}`};if(!e?.mcp_registries?.length)return{accessMode:"fallback",errorMessage:"Registry allowlist is empty - allowlist feature is disabled"};let n=e.mcp_registries[0];return{accessMode:n.registry_access,registryUrl:n.url,owner:n.owner}}async fetchServer(e,r,n){let o=encodeURIComponent(r),s=encodeURIComponent(n),c=`${e}/${o}/versions/${s}`;if(this.serverCache&&this.isServerCacheValid(this.serverCache.timestamp)){let l=this.serverCache.data.get(c);if(l)return[l,null]}try{let u=await this.ctx.get(Jt).fetch(c,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(u.status===404)return[null,{code:Ze.InternalError,message:"Server not found"}];if(!u.ok)return[null,{code:Ze.InternalError,message:`Failed to fetch server from registry: HTTP ${u.status}`}];let d=await u.text(),f=JSON.parse(d);return(!this.serverCache||!this.isServerCacheValid(this.serverCache.timestamp))&&(this.serverCache={timestamp:Date.now(),data:new Map}),this.serverCache.data.set(c,f),[f,null]}catch(l){return[null,{code:Ze.InternalError,message:`Failed to fetch server from registry: ${l instanceof Error?l.message:String(l)}`}]}}};p();var Z7c=b.Object({url:b.String(),source:b.String(),id:b.String(),subfolder:b.Optional(b.String())}),ieo=b.Object({description:b.Optional(b.String()),isRequired:b.Optional(b.Boolean()),format:b.Optional(b.Union([b.Literal("string"),b.Literal("number"),b.Literal("boolean"),b.Literal("filepath")])),value:b.Optional(b.String()),isSecret:b.Optional(b.Boolean()),default:b.Optional(b.String()),placeholder:b.Optional(b.String()),choices:b.Optional(b.Array(b.String()))}),o9r=b.Intersect([ieo,b.Object({variables:b.Optional(b.Record(b.String(),ieo))})]),X7c=b.Intersect([o9r,b.Object({type:b.Literal("positional"),valueHint:b.Optional(b.String()),isRepeated:b.Optional(b.Boolean())})]),eQc=b.Intersect([o9r,b.Object({type:b.Literal("named"),name:b.String(),isRepeated:b.Optional(b.Boolean())})]),oeo=b.Union([X7c,eQc]),Y8e=b.Intersect([o9r,b.Object({name:b.String()})]),tQc=b.Object({registryType:b.String(),registryBaseUrl:b.Optional(b.String()),identifier:b.String(),version:b.Optional(b.String()),fileSha256:b.Optional(b.String()),runtimeHint:b.Optional(b.String()),transport:b.Optional(b.Union([b.Object({type:b.Literal("stdio")}),b.Object({type:b.Literal("streamable-http"),url:b.String(),headers:b.Optional(b.Array(Y8e))}),b.Object({type:b.Literal("sse"),url:b.String(),headers:b.Optional(b.Array(Y8e))})])),runtimeArguments:b.Optional(b.Array(oeo)),packageArguments:b.Optional(b.Array(oeo)),environmentVariables:b.Optional(b.Array(Y8e))}),rQc=b.Union([b.Object({type:b.Literal("streamable-http"),url:b.String(),headers:b.Optional(b.Array(Y8e))}),b.Object({type:b.Literal("sse"),url:b.String(),headers:b.Optional(b.Array(Y8e))})]),nQc=b.Object({src:b.String(),mimeType:b.Optional(b.Union([b.Literal("image/png"),b.Literal("image/jpeg"),b.Literal("image/jpg"),b.Literal("image/svg+xml"),b.Literal("image/webp")])),sizes:b.Optional(b.Array(b.String())),theme:b.Optional(b.Union([b.Literal("light"),b.Literal("dark")]))}),iQc=b.Object({status:b.Optional(b.Union([b.Literal("active"),b.Literal("deprecated"),b.Literal("deleted")])),publishedAt:b.Optional(b.String()),updatedAt:b.Optional(b.String()),isLatest:b.Optional(b.Boolean())},{additionalProperties:!1}),oQc=b.Object({"io.modelcontextprotocol.registry/publisher-provided":b.Optional(b.Object({tool:b.Optional(b.String()),version:b.Optional(b.String()),buildInfo:b.Optional(b.Object({commit:b.Optional(b.String()),timestamp:b.Optional(b.String()),pipelineId:b.Optional(b.String())}))},{additionalProperties:!0}))},{additionalProperties:!0}),sQc=b.Object({"io.modelcontextprotocol.registry/official":b.Optional(iQc)},{additionalProperties:!0}),aQc=b.Object({name:b.String(),description:b.String(),title:b.Optional(b.String()),repository:b.Optional(Z7c),version:b.String(),websiteUrl:b.Optional(b.String()),icons:b.Optional(b.Array(nQc)),$schema:b.Optional(b.String()),packages:b.Optional(b.Array(tQc)),remotes:b.Optional(b.Array(rQc)),_meta:b.Optional(oQc)}),cQc=b.Object({server:aQc,_meta:sQc}),ljh=b.Object({servers:b.Array(cQc),metadata:b.Optional(b.Object({nextCursor:b.Optional(b.String()),count:b.Optional(b.Number())}))}),seo=b.Object({baseUrl:b.String(),cursor:b.Optional(b.String()),limit:b.Optional(b.Number({minimum:1})),search:b.Optional(b.String()),updatedSince:b.Optional(b.String()),version:b.Optional(b.String())}),aeo=b.Object({baseUrl:b.String(),serverName:b.String(),version:b.String()});var K8e="mcp.registry.listServers",rCe="mcp.registry.getServer";async function lQc(t,e,r,n){return await t.get(lM).fetchServer(e,r,n)}a(lQc,"fetchServer");async function uQc(t,e,r){if(!r.baseUrl)return[null,{code:Ze.InvalidParams,message:"Base URL is required"}];let n=t.get(Jt),o=new URLSearchParams;r.limit!==void 0&&o.append("limit",r.limit.toString()),r.cursor!==void 0&&o.append("cursor",r.cursor),r.search!==void 0&&o.append("search",r.search),r.updatedSince!==void 0&&o.append("updated_since",r.updatedSince),r.version!==void 0&&o.append("version",r.version);let s=`${r.baseUrl}${o.toString()?`?${o.toString()}`:""}`;try{let c=await n.fetch(s,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!c.ok){let d=`MCP Registry API error: HTTP ${c.status}`;return l0(t,K8e,Vt.createAndMarkAsIssued({message:d})),[null,{code:Ze.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return ft(t,K8e,Vt.createAndMarkAsIssued()),sr(t,K8e),[u,null]}catch(c){Hs(t,K8e,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return l0(t,K8e,Vt.createAndMarkAsIssued({message:l})),[null,{code:Ze.InternalError,message:l}]}}a(uQc,"handleListServersChecked");async function dQc(t,e,r){if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(!r.baseUrl)return[null,{code:Ze.InvalidParams,message:"Base URL is required"}];if(!r.serverName)return[null,{code:Ze.InvalidParams,message:"Server name is required"}];if(!r.version)return[null,{code:Ze.InvalidParams,message:"Version is required"}];let[n,o]=await lQc(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return l0(t,rCe,Vt.createAndMarkAsIssued(s)),sr(t,rCe,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return l0(t,rCe,Vt.createAndMarkAsIssued(c)),sr(t,rCe,c),[null,{code:Ze.InternalError,message:s}]}return ft(t,rCe,Vt.createAndMarkAsIssued()),sr(t,rCe),[n,null]}a(dQc,"handleGetServerChecked");var ceo=we(seo,uQc),leo=we(aeo,dQc);p();p();var ueo=b.Object({}),fQc=b.Object({login:b.String(),id:b.Number(),type:b.String(),parent_login:b.Union([b.String(),b.Null()]),parent_id:b.Union([b.Number(),b.Null()])}),pQc=b.Object({url:b.String(),registry_access:b.Union([b.Literal("registry_only"),b.Literal("allow_all")]),owner:fQc}),Ijh=b.Object({mcp_registries:b.Array(pQc)});async function hQc(t){return await t.get(lM).fetchMcpRegistryAllowlist()}a(hQc,"fetchMcpRegistryAllowlist");async function mQc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await hQc(t);return o?[null,o]:n?n.mcp_registries.length===0?[n,null]:[n,null]:[null,{code:Ze.InternalError,message:"Failed to retrieve MCP registry allowlist data"}]}catch(n){return[null,{code:Ze.InternalError,message:`Unexpected error in MCP registry allowlist handler: ${n instanceof Error?n.message:String(n)}`}]}}a(mQc,"handleGetMcpRegistryAllowlistChecked");var deo=we(ueo,mQc);p();var heo=fe(Jee()),meo=fe(hd()),geo=fe(iv());p();Fo();var gQc=b.Object({edits:b.Array(b.Object({text:b.String(),range:b.Object({start:b.Object({line:b.Number(),character:b.Number()}),end:b.Object({line:b.Number(),character:b.Number()})}),predictedCursorPosition:b.Object({line:b.Number(),character:b.Number()})}))}),OW=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},s9r=new pe("setNextEditDocument");function AQc(t,e,r){return s9r.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet(OW,new OW(r.edits)),["OK",null]}a(AQc,"handleTestingSetNextEditDocumentChecked");var feo=we(gQc,AQc);function peo(t,e,r,n){let o=t.get(OW);if(o.edits&&o.edits.length>0){let s=o.edits.filter(c=>e.line===c.predictedCursorPosition.line&&e.character===c.predictedCursorPosition.character);return s.length===0?(s9r.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):(s9r.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>yQc(c,r,n)))}}a(peo,"getTestNextEditSuggestions");function yQc(t,e,r){return{text:t.text,textDocument:{uri:e,version:r},range:t.range,command:{title:"Accept inline edit",command:"github.copilot.didAcceptNextEditSuggestionItem",arguments:[Dt()]}}}a(yQc,"createNextEditSuggestion");async function _Qc(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=Gs(r.textDocument.uri);t.get(t9).setForRequest(meo.URI.parse(n),r.diagnostics??[]);let o=peo(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(fC);t.get(heo.ObservableWorkspace).onUserPositionChange(n,new geo.Position(r.position.line,r.position.character));let c=await s.handleNextEditRequest(n,r.textDocument.version,e);return c?[{edits:c.map(u=>({text:u.edit.text,textDocument:u.edit.textDocument,range:u.edit.range,command:{title:"Accept inline edit",command:vOe,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(_Qc,"handleChecked");var Aeo=we(cIn,_Qc);p();var vQc=b.Object({uuid:b.String({minLength:1}),acceptedLength:b.Optional(b.Number({minimum:1}))});function CQc(t,e,r){let n=t.get(Fu),o=n.get(r.uuid);return o&&(bQc(r,o)==="full"?(n.delete(r.uuid),Zge(t,o,o.triggerCategory)):cht(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(CQc,"notifyAcceptedChecked");function bQc(t,e){return t.acceptedLength===void 0?"full":t.acceptedLengthn.get(s)??[]);if(o.length>0){let s=o[0];for(let l of r.uuids)n.delete(l);let c=o.map(l=>({completionText:l.displayText,completionTelemetryData:l.telemetry}));aht(t,"ghostText",s.offset,s.uri,c),t.get(_y).resetState()}return["OK",null]}a(xQc,"notifyRejectedChecked");var Eeo=we(IQc,xQc);p();var wQc=b.Object({uuid:b.String({minLength:1})});function RQc(t,e,r){let o=t.get(Fu).get(r.uuid);return o&&cft(t,o.triggerCategory,o),["OK",null]}a(RQc,"notifyShownChecked");var veo=we(wQc,RQc);p();var kQc=b.Object({commandLine:b.String(),shell:b.Optional(b.String())});async function PQc(t,e,r){let n=t.get(wT),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(PQc,"handleParseTerminalCommandChecked");var Ceo=we(kQc,PQc);p();p();function a9r(t){return b.Union(Object.values(t).map(e=>b.Literal(e)))}a(a9r,"enumSchema");var DQc=b.Union([b.Object({kind:b.Literal("relativePath"),path:b.String()}),b.Object({kind:b.Literal("github"),repo:b.String(),ref:b.Optional(b.String()),sha:b.Optional(b.String()),path:b.Optional(b.String())}),b.Object({kind:b.Literal("url"),url:b.String(),ref:b.Optional(b.String()),sha:b.Optional(b.String()),path:b.Optional(b.String())}),b.Object({kind:b.Literal("npm"),package:b.String(),version:b.Optional(b.String()),registry:b.Optional(b.String())}),b.Object({kind:b.Literal("pip"),package:b.String(),version:b.Optional(b.String()),registry:b.Optional(b.String())})]),NQc=b.Object({rawValue:b.String(),displayLabel:b.String(),cloneUrl:b.String(),canonicalId:b.String(),cacheSegments:b.Array(b.String()),kind:a9r(rG),ref:b.Optional(b.String()),githubRepo:b.Optional(b.String()),localRepositoryUri:b.Optional(b.String()),origin:b.Optional(a9r(sut))}),beo=b.Object({name:b.String(),description:b.String(),version:b.String(),sourceDescriptor:DQc,marketplace:b.String(),marketplaceReference:NQc,marketplaceType:a9r(iNe),readmeUri:b.Optional(b.String())}),LW=b.Object({pluginUri:b.String()}),swt=b.Object({source:b.String()});p();var MQc="_direct";function Seo(t,e){let r=t.fromMarketplace,n=r?.name??t.label,o=r?.marketplaceReference.canonicalId??MQc;return{qualifiedId:`${n}@${o}`,name:n,label:t.label,pluginUri:t.uri,...r?.marketplace!==void 0&&{marketplace:r.marketplace},enabled:t.enabled,disabledByPolicy:t.policyBlocked===!0,readOnly:e(t.uri),...r?.description!==void 0&&{description:r.description},...r?.version!==void 0&&{version:r.version},...r?.readmeUri!==void 0&&{readmeUri:r.readmeUri},...r?.marketplaceType!==void 0&&{marketplaceType:r.marketplaceType},...r?.sourceDescriptor!==void 0&&{sourceDescriptor:r.sourceDescriptor},hooks:t.hooks,commands:t.commands,skills:t.skills,agents:t.agents,instructions:t.instructions,mcpServerDefinitions:t.mcpServerDefinitions}}a(Seo,"toPluginListRow");async function qp(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof I4?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(qp,"withPluginErrorHandling");async function OQc(t,e,r){return qp(()=>t.get(Ca).disablePlugin(r.pluginUri))}a(OQc,"handlePluginsDisableChecked");var Teo=we(LW,OQc);p();async function LQc(t,e,r){return qp(()=>t.get(Ca).enablePlugin(r.pluginUri))}a(LQc,"handlePluginsEnableChecked");var Ieo=we(LW,LQc);p();var BQc=b.Object({plugin:beo});async function FQc(t,e,r){return qp(async()=>({pluginUri:await t.get(Ca).installPlugin(r.plugin)}))}a(FQc,"handlePluginsInstallChecked");var xeo=we(BQc,FQc);p();var UQc=b.Object({source:b.String(),pluginName:b.Optional(b.String())});async function QQc(t,e,r){return qp(()=>t.get(Ca).installPluginFromSource(r.source,r.pluginName))}a(QQc,"handlePluginsInstallFromSourceChecked");var weo=we(UQc,QQc);p();var qQc=b.Object({});async function jQc(t,e,r){return qp(async()=>{let n=t.get(Ca);return(await n.listPlugins()).map(s=>Seo(s,c=>n.isReadOnlyPlugin(c)))})}a(jQc,"handlePluginsListChecked");var Reo=we(qQc,jQc);p();async function HQc(t,e,r){return qp(()=>t.get(Ca).addMarketplace(r.source))}a(HQc,"handleMarketplaceAddChecked");var keo=we(swt,HQc);p();var GQc=b.Object({source:b.Optional(b.String())});async function $Qc(t,e,r){return qp(()=>t.get(Ca).browseMarketplace(r.source))}a($Qc,"handleMarketplaceBrowseChecked");var Peo=we(GQc,$Qc);p();var VQc=b.Object({});async function WQc(t,e,r){return qp(async()=>[...await t.get(Ca).listMarketplaces()])}a(WQc,"handleMarketplaceListChecked");var Deo=we(VQc,WQc);p();async function zQc(t,e,r){return qp(()=>t.get(Ca).removeMarketplace(r.source))}a(zQc,"handleMarketplaceRemoveChecked");var Neo=we(swt,zQc);p();async function YQc(t,e,r){return qp(()=>t.get(Ca).uninstallPlugin(r.pluginUri))}a(YQc,"handlePluginsUninstallChecked");var Meo=we(LW,YQc);p();async function KQc(t,e,r){return qp(async()=>({updated:await t.get(Ca).updatePlugin(r.pluginUri)}))}a(KQc,"handlePluginsUpdateChecked");var Oeo=we(LW,KQc);p();var JQc=usi;function ZQc(t,e,r){let n=t.get(km),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new Zve(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a(ZQc,"registerContextProviders");var Leo=we(JQc,ZQc);p();p();var XQc=b.Object({uri:b.Optional(b.String())}),eqc=b.Object({showEditorCompletions:b.Optional(b.Boolean()),enableAutoCompletions:b.Optional(b.Boolean()),delayCompletions:b.Optional(b.Boolean()),filterCompletions:b.Optional(b.Boolean())}),Feo=b.Object({github:b.Optional(b.Object({copilot:b.Optional(b.Object({}))})),[v$r]:b.Optional(XQc),http:b.Optional(Lgn),telemetry:b.Optional(b.Object({telemetryLevel:b.Optional(b.String())}))}),J8e=Object.keys(Feo.properties).filter(t=>t!=="github"),tqc=b.Intersect([Feo,eqc]),rqc=b.Object({settings:b.Optional(b.Union([b.Object({}),b.Array(b.Unknown(),{maxItems:0})])),authProvider:b.Optional(b.Never())}),Beo=Zu.Compile(rqc),c9r=Zu.Compile(tqc);function CB(t){if(typeof t=="string")return{type:"content",content:t};if(t&&typeof t=="object"){let e=t;if(e.type==="file"&&typeof e.uri=="string")return{type:"file",uri:e.uri};if(e.type==="location"&&typeof e.path=="string")return{type:"location",path:e.path};if(e.type==="content"&&typeof e.content=="string")return{type:"content",content:e.content};if(typeof e.uri=="string")return{type:"file",uri:e.uri};if(typeof e.content=="string")return{type:"content",content:e.content}}return{type:"content",content:""}}a(CB,"normalizePromptSetting");async function cwt(t,e){if(!Beo.Check(e))throw awt(t),new ey(Beo.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&nqc(t,r),awt(t,r),Promise.resolve()}a(cwt,"notifyChangeConfiguration");function nqc(t,e){for(let n of c9r.Errors(e)){let o=n.path.split("/")?.[1];Yo.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!c9r.Check(e))throw new ey(c9r.Errors(e));e.http&&l9r(t,e.http);let r=e["github-enterprise"];r&&eqe(t,r.uri),e.github?.copilot&&iqc(t,e.github.copilot)}a(nqc,"applySettingsToConfiguration");function iqc(t,e){let r=t.get(Ib),n={};for(let o of Object.values(ze)){let s=Ugn(e,o);n[o]=s}r.setCopilotSettings(n),_ge.clearCache(),Pxt.clearCache(),typeof e.mcp=="string"&&yqc(t,e.mcp),e.agent&&typeof e.agent=="object"&&(_qc(t,e.agent),Eqc(t,e.agent),vqc(t,e.agent)),oqc(t,e.globalCopilotInstructions),sqc(t,e.globalGitCommitInstructions),aqc(t,e.globalAgentsMdInstructions),cqc(t,e.globalClaudeMdInstructions),lqc(t,e.globalInstructionFiles),uqc(t,e.globalPromptFiles),hqc(t,e.instructionFileLocations),mqc(t,e.promptFileLocations),gqc(t,e.agentFileLocations),Aqc(t,e.skillFileLocations)}a(iqc,"applyCopilotConfiguration");function oqc(t,e){try{let r=t.get(Mf),n=CB(e);r.setGlobalCopilotInstructions(n)}catch(r){Yo.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(oqc,"applyGlobalCopilotInstructionsConfiguration");function sqc(t,e){try{let r=t.get(Mf),n=CB(e);r.setGlobalGitCommitInstructions(n)}catch(r){Yo.error(t,"Failed to apply global Git commit instructions configuration",r)}}a(sqc,"applyGlobalGitCommitInstructionsConfiguration");function aqc(t,e){try{let r=t.get(Mf),n=CB(e);r.setGlobalAgentsMdInstructions(n)}catch(r){Yo.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(aqc,"applyGlobalAgentsMdInstructionsConfiguration");function cqc(t,e){try{let r=t.get(Mf),n=CB(e);r.setGlobalClaudeMdInstructions(n)}catch(r){Yo.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(cqc,"applyGlobalClaudeMdInstructionsConfiguration");function lqc(t,e){try{let r=t.get(Mf),n=(e||[]).map(CB);r.setGlobalInstructionFiles(n)}catch(r){Yo.error(t,"Failed to apply global instruction files configuration",r)}}a(lqc,"applyGlobalInstructionFilesConfiguration");function uqc(t,e){try{let r=t.get(P0),n=(e||[]).map(CB);r.setGlobalPromptFiles(n)}catch(r){Yo.error(t,"Failed to apply global prompt files configuration",r)}}a(uqc,"applyGlobalPromptFilesConfiguration");function dqc(t){return t?Array.isArray(t)?t.map(CB):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(dqc,"normalizeFileLocations");function fqc(t){let e=CB(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(fqc,"normalizeInstructionPromptSetting");function pqc(t){return t?Array.isArray(t)?t.map(fqc):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(pqc,"normalizeInstructionFileLocations");function hqc(t,e){try{let r=t.get(Mf);if(e===void 0)return;r.setInstructionFileLocations(pqc(e))}catch(r){Yo.error(t,"Failed to apply instruction file locations configuration",r)}}a(hqc,"applyInstructionFileLocationsConfiguration");function mqc(t,e){try{let r=t.get(P0);if(e===void 0)return;r.setPromptFileLocations(dqc(e))}catch(r){Yo.error(t,"Failed to apply prompt file locations configuration",r)}}a(mqc,"applyPromptFileLocationsConfiguration");function gqc(t,e){try{let r=t.get(Yd);if(e===void 0)return;let n=e.map(CB);r.setAgentFileLocations(n)}catch(r){Yo.error(t,"Failed to apply agent file locations configuration",r)}}a(gqc,"applyAgentFileLocationsConfiguration");function Aqc(t,e){try{let r=t.get(Ig);if(e===void 0)return;let n=e.map(CB);r.setSkillFileLocations(n)}catch(r){Yo.error(t,"Failed to apply skill file locations configuration",r)}}a(Aqc,"applySkillFileLocationsConfiguration");function l9r(t,e){let r=t.get(Ib);e.proxy===void 0&&(e=Bgn(r.env));try{r.setHttpSettings(Mxe(e))}catch(n){if(!(n instanceof TypeError))throw n;Yo.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(l9r,"applyHttpConfiguration");async function yqc(t,e){let r;try{r=j8e(JSON.parse(e||"{}"))}catch(n){Yo.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(CE).updateMCPServers(r)}catch(n){Yo.error(t,"Failed to apply MCP configuration to McpManager",n)}}a(yqc,"applyMCPConfiguration");function _qc(t,e){try{let r=e;t.get(wT).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){Yo.error(t,"Failed to apply settings configuration",r)}}a(_qc,"applyTerminalAutoApproveConfiguration");function Eqc(t,e){try{let r=e;t.get(qw).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){Yo.error(t,"Failed to apply edit auto approve configuration",r)}}a(Eqc,"applyEditAutoApproveConfiguration");function vqc(t,e){try{let r=e;t.get(YF).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){Yo.error(t,"Failed to apply MCP auto approve configuration",r)}}a(vqc,"applyMCPAutoApproveConfiguration");function awt(t,e){if(t.get(Ib).markReady(),!t.get(Nn).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(op).initialize(r)}}a(awt,"initializePostConfigurationDependencies");var Ueo=b.Object({name:b.String(),version:b.String(),readableName:b.Optional(b.String())}),Cqc=b.Object({editorInfo:Ueo,editorPluginInfo:Ueo,editorConfiguration:b.Optional(b.Object({}))});async function bqc(t,e,r){t.get(Ir).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),lht(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await cwt(t,{settings:r.editorConfiguration}),ft(t,"setEditorInfo");for(let n of["github",...J8e])r.editorConfiguration&&n in r.editorConfiguration&&ft(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(bqc,"handleSetEditorInfoChecked");var Qeo=we(Cqc,bqc);p();var Sqc=b.Object({options:b.Optional(b.Object({}))});async function Tqc(t,e,r){let n=t.get(pI),o=n.pendingSignIn?.status;if(o===void 0)return[null,{code:Ze.InvalidRequest,message:"No pending sign in"}];let s;try{return s=await o,[s,null]}catch(c){return[null,{code:Ze.DeviceFlowFailed,message:String(c)}]}finally{n.pendingSignIn=void 0}}a(Tqc,"handleSignInConfirmChecked");var qeo=we(Sqc,Tqc);p();var Iqc=b.Object({options:b.Optional(b.Object({})),githubAppId:b.Optional(b.String())});async function xqc(t,e,r){try{let o=await t.get(Fr).checkAndUpdateStatus({githubAppId:r.githubAppId});if(o.status==="OK")return[{status:"AlreadySignedIn",user:o.user},null];let c=await t.get(pI).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:dht,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof Ei))throw n;return[null,{code:Ze.DeviceFlowFailed,message:n.message}]}}a(xqc,"handleSignInInitiateChecked");var u9r=we(Iqc,xqc);p();p();p();var jeo=["google","apple"],lwt=b.Optional(b.Union(jeo.map(t=>b.Literal(t))));function Heo(t){return typeof t=="string"&&jeo.includes(t)}a(Heo,"isGitHubSocialProvider");function d9r(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(d9r,"isGitHubSocialProviderApplicableHostname");function Geo(t,e){if(!e)return t;try{let r=new URL(t);return d9r(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(Geo,"addGitHubSocialProviderToVerificationUri");p();function $eo(){return!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY||(process.platform==="linux"||process.platform==="freebsd"||process.platform==="openbsd")&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)}a($eo,"isBrowserAvailable");function wqc(t){let e=t.replace(/\/$/,"");return{issuer:e,authorization_endpoint:`${e}/login/oauth/authorize`,token_endpoint:`${e}/login/oauth/access_token`,response_types_supported:["code"],code_challenge_methods_supported:["S256"],grant_types_supported:["authorization_code"],scopes_supported:["repo","workflow","user","read:org"]}}a(wqc,"getGitHubOAuthServerMetadata");async function uwt(t,e,r={},n){let o=performance.now();Xge(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!$eo())throw new C7("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=b7(t,r.authAuthority),u=wqc(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=d9r(new URL(c).hostname)?r.socialProvider:void 0,m=await d.createSession(f,{cancellationToken:n,provider:h,loginHint:r.loginHint}),g=m.scopes||f,A=t.get(ih).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new Ei("Could not resolve GitHub username during sign-in. Please try again.");return s=await t.get(Fr).signInEditor({accessToken:m.accessToken,user:y,githubAppId:A,authAuthority:l,scopes:g?[...g]:void 0}),ID(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw ID(t,"codeFlow",s.status,performance.now()-o,c),c}}a(uwt,"performGitHubOAuthCodeFlow");p();p();p();sWe();var nCe=class extends og{constructor(r,n=new f9r){super();this.ctx=r;this.fallback=n}static{a(this,"AgentUrlOpener")}async open(r){let n=this.ctx.get(er);if(!(n.clientCapabilities?.window?.showDocument?.support&&(await Promise.race([n.connection.window.showDocument({uri:r,external:!0}),new Promise((s,c)=>setTimeout(()=>c(new Error("window/showDocument timed out")),15e3))])).success))return this.fallback.open(r)}},f9r=class extends og{static{a(this,"SpawnUrlOpener")}async open(e){await axe(e)}};p();var Veo=require("crypto"),Weo=fe(require("http"));p();var dwt=new pe("OAuth Code Flow");function p9r(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n{},"finishedCb"),d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsingandserver":m=l?jMe(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?jMe(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a(XZi,"setupCompletionParams");var KUr=new pe("solutions");async function S9c(t,e){let r=e.targetPosition,n=e.textDocument,o=await ZZi(t,e,"open copilot",KUr);if("status"in o)return o;let{prompt:s,trailingWs:c,telemetryData:l,repoInfo:u,ourRequestId:d}=o,{extra:f,postOptions:h,finishedCb:m,engineInfo:g}=XZi(t,n,r,s,e,l),A=e.cancellationToken,y={prompt:s,languageId:n.detectedLanguageId,repoInfo:u,ourRequestId:d,engineModelId:g.modelId,count:e.solutionCountTarget,uiKind:"synthesize",postOptions:h,headers:g.headers,extra:f},_=await t.get(JO).fetchAndStreamCompletions(t,y,l.extendedBy(),m,A);if(_.type==="failed"||_.type==="canceled")return{status:"FinishedWithError",error:`${_.type}: ${_.reason}`};let E=_.choices;E=JZi(E),E=Bwe(E,T=>pOe(t,n,r,T,!1,KUr));let v=Bwe(E,async T=>{let w=T.completionText;KUr.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await Ssi(t,n,r,T.completionText)??wu.position(r.line,0),[x]=MG(n.getText(wu.range(R,r)));w=x+w;let k=T.completionText;c.length>0&&k.startsWith(c)&&(k=k.substring(c.length));let D=T.meanLogProb,N=D!==void 0?Math.exp(D):0,O=l.extendedBy({choiceIndex:T.choiceIndex.toString()});return{completionText:k,insertText:w,range:wu.range(R,r),meanProb:N,meanLogProb:D||0,requestId:T.requestId,choiceIndex:T.choiceIndex,telemetryData:O,copilotAnnotations:T.copilotAnnotations}});return YUr(A,v[Symbol.asyncIterator]())}a(S9c,"launchSolutions");async function Zxt(t,e,r){return t.get(ks).trackCompletionJob(async()=>{let o=S9c(t,e);return await zUr(o,r)})}a(Zxt,"runSolutions");var tXi=fe(Y9()),G8e=fe(Wc());p();Fo();p();function Xxt(t,e){let r=t.split(` +`),n=e,o=e,s=r[e.line],c=s.indexOf("%");c!==-1&&(s=s.substring(0,c)+s.substring(c+1),n={line:e.line,character:c});let l=s.indexOf("^");if(l!==-1){let u=s.indexOf("^",l+1);if(u===-1)throw new Error("Challenge document must contain zero or two ^ characters.");s=s.substring(0,l)+s.substring(l+1,u)+s.substring(u+1),n={line:e.line,character:e.character},o={line:e.line,character:e.character+u-l-1}}return{cursorLine:s,lines:r,start:n,end:o}}a(Xxt,"parseChallengeDoc");var T9c=b.Object({text:b.String(),score:b.Number()}),I9c=b.Object({documents:b.Array(T9c),options:b.Optional(b.Object({}))});async function ewt(t,e,r){let n=Dt();for(let o=0;oh+m.length+1,0)+d.character,await r.onSolution({requestId:{headerRequestId:n,serverExperiments:"",deploymentId:""},completionText:f,insertText:f,range:{start:t,end:t},meanProb:c,meanLogProb:-1,choiceIndex:o,telemetryData:Tx.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(ewt,"runTestSolutions");var cM=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function x9c(t,e,r){return t.forceSet(cM,new cM(r.documents)),["OK",null]}a(x9c,"handleTestingSetPanelCompletionDocumentsChecked");var eXi=we(I9c,x9c);var rXi=_Ze.type;function w9c(t,e,r,n,o){let s=Jxt(n.completionText),c=(0,tXi.SHA256)(s).toString();return t.get(Fu).set(c,{displayText:n.completionText,insertText:n.insertText,offset:r,uuid:c,range:n.range,uri:e.textDocument.uri,telemetry:n.telemetryData.extendedBy({},{rank:o-1}),index:n.choiceIndex,position:e.position,resultType:0,triggerCategory:"solution",copilotAnnotations:n.copilotAnnotations,clientCompletionId:c}),{range:n.range,insertText:n.insertText,command:{command:v8r,title:`Accept completion ${o}`,arguments:[c]}}}a(w9c,"makeCompletion");function ZUr(t,e){return`${t}/${e}`}a(ZUr,"progressMessage");var JUr=class{constructor(e,r,n){this.ctx=e;this.params=r;this.onCompletion=n;this.offset=0;this.count=0;this.items=new Map}static{a(this,"SolutionHandler")}get service(){return this.ctx.get(er)}async onSolution(e){this.count+=1;let r=w9c(this.ctx,this.params,this.offset,e,this.items.size+1);this.items.has(r.command.arguments[0])||(this.items.set(r.command.arguments[0],r),await this.onCompletion(r)),this.params.workDoneToken!==void 0&&await this.service.connection.sendProgress(G8e.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:ZUr(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return R9c(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(G8e.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function R9c(t,e,r=0){t!==void 0&&await e.connection.sendProgress(G8e.WorkDoneProgress.type,t,{kind:"end",message:ZUr(r,10)})}a(R9c,"reportDone");var H8e;async function k9c(t,e,r){let n=await g9(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(er).connection.sendProgress(G8e.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:ZUr(0,10),percentage:0});let s=[],c=a(f=>(s.push(f),Promise.resolve()),"onCompletion"),l=r.partialResultToken;l!==void 0&&(c=a(async f=>{await t.get(er).connection.sendProgress(_Ze.partialResult,l,{items:[f]})},"onCompletion"));let u=new JUr(t,r,c),d=t.get(cM);if(d.documents){let f=d.documents;await ewt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new Kve(n,o,e,10);await Zxt(t,f,u)}return u.error!==void 0?[null,{code:Ze.InternalError,message:u.error}]:[{items:s},null]}a(k9c,"handleChecked");async function P9c(t,e,r){H8e&&(H8e.cancel(),H8e.dispose()),H8e=new jn.CancellationTokenSource;let n=H8e.token,o=new vE([e,n]);try{return await k9c(t,o,r)}catch(s){if(n.isCancellationRequested&&!e.isCancellationRequested)return[null,{code:Ze.ServerCancelled,message:"Request was superseded by a new request"}];throw s}}a(P9c,"handleCheckedWithAbort");var nXi=we(dIn,P9c);p();var N9c=b.Object({workspaceFolders:b.Optional(b.Array(Kc))});async function M9c(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Kd).listCustomAgents(n,{includePlugins:!0,includeRuntimeAgents:!0})).map(c=>{let l=c.promptFileEntry?.promptPath?.storage;return{id:c.id,name:c.name,description:c.description,extensionId:c.extensionId,pluginUri:c.pluginUri,invokePolicy:c.invokePolicy,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,uri:c.promptFileEntry?.promptPath?.uri??c.id,storage:l,providers:uT(c.pluginUri!==void 0,c.providers)}}),null]}a(M9c,"listCustomAgents");var iXi=we(N9c,M9c);p();var O9c=new pe("customAgent/registerExtensionAgents"),L9c=b.Object({uri:b.String(),name:b.String(),description:b.String()}),B9c=b.Object({extensionId:b.String(),agents:b.Array(L9c)});function F9c(t,e,r){try{t.get(Kd).registerExtensionAgent(r.extensionId,r.agents)}catch(n){O9c.warn(t,`Failed to register extension agents for ${r.extensionId}:`,n);let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to register extension agents: ${o}`}]}return[null,null]}a(F9c,"registerExtensionAgents");var oXi=we(B9c,F9c);p();var U9c=b.Object({extensionId:b.String()});function Q9c(t,e,r){return t.get(Kd).unregisterExtensionAgents(r.extensionId),[null,null]}a(Q9c,"unregisterExtensionAgents");var sXi=we(U9c,Q9c);p();var q9c=b.Object({workspaceFolders:b.Optional(b.Array(Kc))});async function j9c(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Mf).listCustomInstructions(n,{includePlugins:!0})).map(c=>({uri:c.uri,name:c.name,applyTo:c.applyTo,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,storage:c.promptFileEntry?.promptPath.storage,pluginUri:c.pluginUri,providers:uT(c.pluginUri!==void 0,c.providers)})),null]}a(j9c,"listCustomInstructions");var aXi=we(q9c,j9c);p();var H9c=b.Object({workspaceFolders:b.Optional(b.Array(Kc))});async function G9c(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(D0).listCustomPrompts(n,{includePlugins:!0})).map(c=>{let l=c.promptFileEntry?.promptPath.storage;return{uri:c.uri,name:c.name,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,storage:l,pluginUri:c.pluginUri,providers:uT(c.pluginUri!==void 0,c.providers)}}),null]}a(G9c,"listCustomPrompts");var cXi=we(H9c,G9c);p();var $9c=b.Object({workspaceFolders:b.Optional(b.Array(Kc))});async function V9c(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(xg).listSkills(n,{includePlugins:!0})).map(c=>({id:c.id,name:c.name,description:c.description,uri:c.uri,storage:c.storage,pluginUri:c.pluginUri,providers:uT(c.pluginUri!==void 0,c.providers)})),null]}a(V9c,"listCustomSkills");var lXi=we($9c,V9c);p();p();p();function W9c(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get(og).getConfiguredUrls(),s=new URL("login/device",o).href,c=new URL("_ping",e.proxy).href,l=new URL("_ping",e.api).href,u=new URL("_ping",e.telemetry).href;function d(f){return new URL(f).host}return a(d,"label"),[{label:d(s),url:s},{label:d(n),url:n,session:r},{label:d(c),url:c},{label:d(l),url:l,session:r},{label:d(u),url:u}]}a(W9c,"urlsToCheck");async function uXi(t,e,r=i3(t),n,o){let s=W9c(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await z9c(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(uXi,"checkReachability");async function z9c(t,e,r,n){try{let o=new AbortController;n?.onCancellationRequested(()=>o.abort());let s=await t.fetch(e,{headers:r?{Authorization:`Bearer ${r.accessToken}`}:{},signal:o.signal}),c=s.status>=200&&s.status<400?"reachable":"unreachable";return{message:`HTTP ${s.status}`+(s.statusText?` - ${s.statusText}`:""),status:c}}catch(o){return{message:String(o),status:"unreachable"}}}a(z9c,"determineReachability");var JI=fe(require("os")),Jve=fe(require("tls"));async function fXi(t,e){let r=await t.get(Jt).getImplementation(),n=await t.get(Qt).getGitHubSession(),o=await t.get(Qt).getToken().catch(()=>{});return{sections:[K9c(t),Y9c(t,n),J9c(t,r),await Z9c(t,r,o?.endpoints,n,e)]}}a(fXi,"collectDiagnostics");function pXi(t){return t.sections.map(X9c).join(JI.EOL+JI.EOL)+JI.EOL}a(pXi,"formatDiagnosticsAsMarkdown");function Y9c(t,e){let r=e&&new URL(e.serverUrl).host,n;return e?r==="github.com"?n=e.login:n=`${e.login} (${r})`:n="not signed in",{name:"Copilot",items:{Version:A1(t),"GitHub Account":n,"Session ID":t.get(za).sessionId,"Send Restricted Telemetry":gae(t)?"enabled":"disabled","Content Exclusion":t.get(pc).enabled?"enabled":"unavailable"}}}a(Y9c,"collectCopilotSection");function K9c(t){let e={Plugin:t7c(t),Editor:e7c(t),"Operating System":`${JI.type()} ${JI.release()} (${JI.arch()})`};return vB(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(K9c,"collectEnvironmentSection");function J9c(t,e){let r=t.get(Qo).getHttpSettings(),n={Proxy:r.proxy||void 0,"Proxy Authorization":r.proxyAuthorization?"present":void 0,"Proxy Kerberos SPN":r.proxyKerberosServicePrincipal,"Proxy Strict SSL":r.proxyStrictSSL===!1?"disabled":"enabled","No Proxy":r.noProxy?.join(",")||void 0,Fetcher:e.name.replace(/Fetcher$/,""),"Number of Root Certificates":Jve.rootCertificates.length,"TLS Default Min Version":Jve.DEFAULT_MIN_VERSION,"TLS Default Max Version":Jve.DEFAULT_MAX_VERSION};return vB(n,"http_proxy"),vB(n,"https_proxy"),vB(n,"no_proxy"),vB(n,"SSL_CERT_FILE"),vB(n,"SSL_CERT_DIR"),vB(n,"OPENSSL_CONF"),vB(n,"NODE_EXTRA_CA_CERTS"),vB(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(J9c,"collectNetworkConfigSection");async function Z9c(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await uXi(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(Z9c,"collectReachabilitySection");function dXi(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(dXi,"quoteCode");function vB(t,e){let r=process.env[e];r&&(t[dXi(e)]=dXi(r)),r!==process.env[e.toUpperCase()]&&vB(t,e.toUpperCase())}a(vB,"addEnvironmentVariable");function X9c(t){return`## ${t.name}`+JI.EOL+JI.EOL+Object.keys(t.items).filter(e=>e!=="name").map(e=>`- ${e}: ${t.items[e]??"N/A"}`).join(JI.EOL)}a(X9c,"formatSectionAsMarkdown");function e7c(t){let e=t.get(Ir).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(e7c,"getEditorDisplayVersion");function t7c(t){let e=t.get(Ir).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(t7c,"getPluginDisplayVersion");var r7c=b.Object({});async function n7c(t,e){return[{report:pXi(await fXi(t,e))},null]}a(n7c,"handleDiagnosticsChecked");var hXi=we(r7c,n7c);p();p();var gXi=require("node:crypto");function $8e(t,e){return(0,gXi.createHash)("sha256").update(t).digest("hex").slice(0,e)}a($8e,"stableHex");function twt(t){let e=Date.parse(t);return Number.isFinite(e)?String(BigInt(e)*1000000n):"0"}a(twt,"timestampToNano");function XUr(t){if(t!=null)return typeof t=="string"?t:JSON.stringify(t)}a(XUr,"stringValue");function e9r(t){return typeof t=="number"&&Number.isFinite(t)?t:0}a(e9r,"numberValue");function mXi(t,e){let r=twt(t);return{startNano:r,endNano:r,input:e,output:[],inputTokens:0,outputTokens:0,cacheReadTokens:0,tools:[],pendingTools:new Map}}a(mXi,"newTurn");function i7c(t,e,r,n,o){let s=o.data??{},c=s.success!==!1,l=c?s.result:s.error,u={[Pn.OPERATION_NAME]:uge.EXECUTE_TOOL,[Pn.AGENT_NAME]:"codex",[Pn.SYSTEM]:"openai",[Pn.CONVERSATION_ID]:t,[Pn.TOOL_NAME]:n.name,[Pn.TOOL_CALL_ID]:n.id,[Pn.TOOL_CALL_ARGUMENTS]:XUr(n.arguments),[Pn.TOOL_CALL_RESULT]:XUr(l)};return{traceId:r,spanId:$8e(`${t}:${e}:tool:${n.id}`,16),parentSpanId:$8e(`${t}:${e}:root`,16),name:`execute_tool ${n.name}`,kind:1,startTimeUnixNano:n.startNano,endTimeUnixNano:twt(o.timestamp),attributes:wR(u),events:[],status:c?{code:1}:{code:2,message:XUr(s.error)??"Tool execution failed"}}}a(i7c,"buildToolSpan");function o7c(t,e,r){if(!r.input&&r.output.length===0&&r.inputTokens===0&&r.outputTokens===0&&r.cacheReadTokens===0&&r.tools.length===0)return[];let n=$8e(`${t}:${e}`,32),o=r.model??"unknown",s={[Pn.OPERATION_NAME]:uge.INVOKE_AGENT,[Pn.AGENT_NAME]:"codex",[Pn.SYSTEM]:"openai",[Pn.CONVERSATION_ID]:t,[Pn.REQUEST_MODEL]:o,[Pn.RESPONSE_MODEL]:o,[Pn.TURN_COUNT]:e+1,[Pn.INPUT_MESSAGES]:r.input?Z8("user",r.input):void 0,[Pn.OUTPUT_MESSAGES]:r.output.length>0?Z8("assistant",r.output.join(` +`)):void 0,[Pn.USAGE_INPUT_TOKENS]:r.inputTokens||void 0,[Pn.USAGE_OUTPUT_TOKENS]:r.outputTokens||void 0,[Pn.USAGE_CACHE_READ_INPUT_TOKENS]:r.cacheReadTokens||void 0};return[{traceId:n,spanId:$8e(`${t}:${e}:root`,16),name:"invoke_agent codex",kind:1,startTimeUnixNano:r.startNano,endTimeUnixNano:r.endNano,attributes:wR(s),events:[],status:{code:1}},...r.tools]}a(o7c,"buildTurnSpans");function s7c(t,e){let r=[],n,o=0,s=a(l=>(n??=mXi(l.timestamp),n.endNano=twt(l.timestamp),n),"ensureTurn"),c=a(()=>{n&&(r.push(...o7c(e,o++,n)),n=void 0)},"flushTurn");for(let l of t){let u=l.data??{};switch(l.type){case"user.message":c(),n=mXi(l.timestamp,typeof u.content=="string"?u.content:void 0);break;case"assistant.message":{let d=s(l);typeof u.content=="string"&&u.content.length>0&&d.output.push(u.content),typeof u.model=="string"&&u.model.length>0&&(d.model=u.model);break}case"assistant.usage":{let d=s(l);d.inputTokens+=e9r(u.inputTokens),d.outputTokens+=e9r(u.outputTokens),d.cacheReadTokens+=e9r(u.cacheReadTokens);break}case"tool.execution_start":{let d=s(l),f=typeof u.toolCallId=="string"?u.toolCallId:l.id;d.pendingTools.set(f,{id:f,name:typeof u.toolName=="string"?u.toolName:"unknown",arguments:u.arguments,startNano:twt(l.timestamp)});break}case"tool.execution_complete":{let d=s(l),f=typeof u.toolCallId=="string"?u.toolCallId:l.id,h=d.pendingTools.get(f);if(h){let m=$8e(`${e}:${o}`,32);d.tools.push(i7c(e,o,m,h,l)),d.pendingTools.delete(f)}break}case"session.idle":s(l),c();break}}return c(),r}a(s7c,"codexSessionEventsToOtlpSpans");async function AXi(t){let e=await hIt(t);if(!e)return null;let r=await mIt(e);return r?s7c(r,t):null}a(AXi,"readCodexRolloutSpans");var yXi=require("fs"),_Xi=fe(require("path"));var a7c=b.Object({conversationId:b.String(),targetPath:b.String(),sessionTitle:b.Optional(b.String()),agentProvider:il});async function c7c(t,e,r){if(!_Xi.isAbsolute(r.targetPath))return[null,{code:Ze.InvalidParams,message:`targetPath must be an absolute path, got: ${r.targetPath}`}];let n;if(r.agentProvider==="CODEX"){let s=await AXi(r.conversationId);if(!s||s.length===0)return[null,{code:Ze.InternalError,message:`No Codex rollout data found for conversation ${r.conversationId}`}];n=s}else n=await t.get(cI).readSpans(r.conversationId);let o=Vii(n,{conversationId:r.conversationId,sessionTitle:r.sessionTitle});try{await yXi.promises.writeFile(r.targetPath,JSON.stringify(o,null,2),"utf8")}catch(s){return[null,{code:Ze.InternalError,message:`Failed to write export to ${r.targetPath}: ${s instanceof Error?s.message:String(s)}`}]}return[{exportFilePath:r.targetPath},null]}a(c7c,"handleExportAgentDebugLogToPathChecked");var EXi=we(a7c,c7c);p();var l7c=b.Object({conversationId:b.String()});async function u7c(t,e,r){return[{logFilePath:await t.get(cI).getLogFilePath(r.conversationId)},null]}a(u7c,"handleGetAgentDebugLogPathChecked");var vXi=we(l7c,u7c);p();Fo();var xXi=fe(Wc());p();var CXi=require("crypto");var Zve=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new r9r(e,this.id)}},r9r=class{constructor(e,r){this.ctx=e;this.id=r;this.contextItems=[];this.update=!1}static{a(this,"LspClientContextResolver")}async resolve(e,r){let n=[];if(this.contextItems.length>0)n=this.contextItems;else if(this.update){let o=this.ctx.get(er),s=(0,CXi.randomUUID)(),c=o.connection.onProgress(AZe.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(AZe.type,{providerId:this.id,data:this.data,textDocument:{uri:e.documentContext.uri,languageId:e.documentContext.languageId,version:e.documentContext.version},position:e.documentContext.position,partialResultToken:s},r);n.push(...l)}finally{c?.dispose()}}return this.reset(),Promise.resolve(n)}setContextItems(e){this.contextItems=e}clearContextItems(){this.contextItems=[]}setUpdate(e){this.update=e}clearData(){this.data=void 0}reset(){this.clearContextItems(),this.clearData(),this.setUpdate(!1)}};function rwt(t,e,r){try{let n=t.get(Pm),o=new Map;n.providers.forEach(s=>{o.set(s.id,s)}),e.providers.forEach(s=>{let c=o.get(s.id);c&&c instanceof Zve&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof Zve&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Fr.error(t,"Failed to set context items on context providers",n)}}a(rwt,"setContextItems");var t9r={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function bXi(t,e,r){return e.map(o=>{try{if(typeof o=="string")return Df(r.uri,o,t9r);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=Df(r.uri,o.scheme||"",t9r)),"pattern"in o&&(s&&=Df(r.uri,o.pattern||"",t9r)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(bXi,"match");p();var d7c=b.Object({documents:b.Array(b.String()),basename:b.Optional(b.String()),options:b.Optional(b.Object({}))}),OW=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function f7c(t,e,r){return t.forceSet(OW,new OW(r.documents,r.basename||"")),["OK",null]}a(f7c,"handleTestingSetCompletionDocumentsChecked");var SXi=new pe("setCompletionDocuments"),IXi=we(d7c,f7c);function nwt(t,e,r,n){let o=t.get(OW);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){SXi.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=p7c(o,r);return c&&c.length>0?TXi(c,s,e):void 0}else return SXi.debug(t,"Returning completions for all pre-set documents"),TXi(o.documents,s,e)}}a(nwt,"getTestCompletions");function TXi(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=Xxt(n,r);return{insertText:[o.slice(Math.min(c.character,r.character))].concat(s.slice(r.line+1)).join(` +`),range:{start:c,end:l}}})}a(TXi,"sliceAndMapCompletions");function p7c(t,e){return t.basename===ro(e)?t.documents||[]:[]}a(p7c,"getFilteredDocs");var wXi=b.Object({doc:b.Object({position:Cg,insertSpaces:b.Optional(b.Boolean()),tabSize:b.Optional(b.Number()),uri:fRe,version:b.Number()}),contextItems:b.Optional(t0r)}),V8e;async function RXi(t,e,r,n){V8e&&(V8e.cancel(),V8e.dispose()),V8e=new jn.CancellationTokenSource;let o=new vE([e,V8e.token]);r.contextItems&&rwt(t,r.contextItems);let s=nwt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:Dt(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await g9(t,r.doc,o)}catch(h){if(!(h instanceof xXi.ResponseError))throw h;switch(h.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return[{completions:[]},null]}throw h}let l=r.doc.position;if(l.line>=c.lineCount)return[{completions:[]},null];let u=await t.get(Ay).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(Fu);for(let h of u)d.set(h.uuid,{...h,triggerCategory:"ghostText"});return[{completions:u.map(h=>({uuid:h.uuid,text:h.insertText,range:h.range,displayText:h.displayText,position:h.position,docVersion:c.version}))},null]}a(RXi,"handleGetCompletionsHelper");var kXi=we(wXi,(t,e,r)=>RXi(t,e,r,!1)),PXi=we(wXi,(t,e,r)=>RXi(t,e,r,!0));p();var h7c=b.Object({});function m7c(t,e,r){return[{defaultRules:t.get(qw).getDefaultRules()},null]}a(m7c,"handleGetDefaultFileSafetyRulesChecked");var DXi=we(h7c,m7c);p();var NXi=fe(Y9()),Xve=fe(Wc());var g7c=b.Object({doc:b.Object({position:Cg,uri:fRe,version:b.Number()}),panelId:b.String()});function A7c(t,e,r,n,o){let s=Jxt(o.completionText),c=(0,NXi.SHA256)(s).toString();return t.get(Fu).set(c,{displayText:o.insertText,insertText:o.completionText,offset:n,uuid:c,range:r,uri:e.doc.uri,telemetry:o.telemetryData,index:o.choiceIndex,position:r.end,resultType:0,triggerCategory:"solution",copilotAnnotations:o.copilotAnnotations,clientCompletionId:c}),{panelId:e.panelId,range:r,completionText:o.completionText,displayText:o.insertText,score:o.meanProb,solutionId:c}}a(A7c,"makeSolution");var n9r=class{constructor(e,r,n){this.ctx=e;this.params=r;this.range=n;this.offset=0}static{a(this,"SolutionHandler")}get service(){return this.ctx.get(er)}onSolution(e){return this.service.connection.sendNotification(new Xve.NotificationType("PanelSolution"),A7c(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return MXi(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new Xve.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function MXi(t,e){return e.connection.sendNotification(new Xve.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(MXi,"reportDone");var W8e;async function y7c(t,e,r){W8e&&(W8e.cancel(),W8e.dispose()),W8e=new jn.CancellationTokenSource;let n=new vE([e,W8e.token]),o=r.doc.position,s=wu.range(o,o),c=new n9r(t,r,s),l=t.get(cM);if(l.documents){let u=l.documents;ewt(o,u,c)}else{let u;try{u=await g9(t,r.doc,n)}catch(f){if(!(f instanceof Xve.ResponseError))throw f;switch(f.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return _7c(t,r)}throw f}c.offset=u.offsetAt(o);let d=new Kve(u,o,n,10);Zxt(t,d,c)}return[{solutionCountTarget:10},null]}a(y7c,"handleGetPanelCompletionsChecked");async function _7c(t,e){return await MXi(e.panelId,t.get(er)),[{solutionCountTarget:0},null]}a(_7c,"produceEmptySolutions");var OXi=we(g7c,y7c);p();var E7c=b.Object({});async function v7c(t,e,r){let o=(await t.get(Qt).getToken()).userInfo,s=o.raw,l=(await t.get(Or).resolveSession())?.login;return!s||!l?[null,null]:[{userName:l,copilotPlan:o.copilotPlan,rawUserInfo:s},null]}a(v7c,"handleGetUserInfoChecked");var LXi=we(E7c,v7c);p();var C7c=b.Object({});function b7c(t,e,r){return[{version:t.get(As).getDisplayVersion(),buildType:_7(t),runtimeVersion:`node/${process.versions.node}`},null]}a(b7c,"handleGetVersionChecked");var BXi=we(C7c,b7c);p();Fo();var S7c=b.Object({changes:b.Array(b.String()),userCommits:b.Array(b.String()),recentCommits:b.Array(b.String()),workspaceFolder:b.Optional(b.String()),userLanguage:b.Optional(b.String())});async function T7c(t,e,r){if(r.changes.length===0)return[null,{code:Ze.InvalidRequest,message:"No changes provided"}];let n=t.get(Xo),o=n.create({capabilities:{skills:[g5]}}),s=new lp({message:"",type:"user"});await n.addTurn(o.id,s);let c=$ve({workDoneToken:Dt()});await t.get(Bc).begin(o,s,c);let d=(await new Qw(t,o,s,e).skillResolver.resolve(g5))?.head?.name,h=await t.get(fee).generateCommitMessage(t,e,r,d);return h==null?[null,{code:Ze.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(T7c,"handleGitCommitGenerateChecked");var FXi=we(S7c,T7c);p();var I7c=b.Object({repoOwner:b.String({minLength:1}),repoName:b.String({minLength:1}),pullRequestNumber:b.Number()});async function x7c(t,e,r){try{let o=await new gm(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return ft(t,"githubApi.listPullRequestChangedFiles",Vt.createAndMarkAsIssued()),sr(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(Ma(t,n,"githubApi.listPullRequestChangedFiles"),Hs(t,"githubApi.listPullRequestChangedFiles",n),n instanceof x_)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(x7c,"handleListPullRequestChangedFilesChecked");var UXi=we(I7c,x7c);p();var w7c=b.Object({query:b.String(),workspaceFolder:b.Optional(b.String()),workspaceFolders:b.Optional(b.Array(Kc))}),QXi=4,eCe=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function R7c(t,e,r){try{let n=new $Ee(t),o=await P7c(t,r),s=await n.searchPullRequests(o);await k7c(t,s);let c=D7c(s);return ft(t,"githubApi.searchPR",Vt.createAndMarkAsIssued()),sr(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof eCe)return[null,{code:n.errorCode,message:n.message}];if(n instanceof x_)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(Ma(t,n,"githubApi.searchPR"),Hs(t,"githubApi.searchPR",n),n instanceof fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(R7c,"handleSearchPRChecked");async function k7c(t,e){let r=new gm(t);for(let n=0;n{try{c.copilotWorkStatus=await r.getCopilotWorkingStatus(c.repository.owner.login,c.repository.name,c.number,c.user?.login)}catch{c.copilotWorkStatus="not_copilot_issue"}});await Promise.all(s)}}a(k7c,"appendCopilotWorkStatus");async function P7c(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Or).resolveSession();if(!n)throw new eCe("The user is not logged in.",Ze.NoGitHubToken);r=r.replace(/\$\{user\}/g,n.login)}if(r.includes("${owner}")||r.includes("${repository}")){let n;if(e.workspaceFolders&&e.workspaceFolders.length>0)n=e.workspaceFolders[0];else if(e.workspaceFolder)n={uri:e.workspaceFolder};else throw new eCe("No workspace folder provided",Ze.InvalidRequest);let s=await t.get(Pf).getRepo(n);if(s&&s.isGitHub()&&s.owner&&s.name)r=r.replace(/\$\{owner\}/g,s.owner),r=r.replace(/\$\{repository\}/g,s.name);else{let c;!s||!s.isGitHub()?c="The workspace folder is not a GitHub repository.":!s.owner&&!s.name?c="Git repository detected but both owner and repository name information are missing. Ensure the repository has a valid remote origin.":s.owner?s.name||(c="Git repository detected but repository name is missing. Ensure the repository has a valid remote origin."):c="Git repository detected but owner information is missing. Ensure the repository has a valid remote origin.";let l=`Cannot obtain GitHub information for workspace folder: ${n.uri}. Template variables \${owner} and \${repository} require a valid Git repository with remote GitHub origin configured: ${c}`;throw new eCe(l,Ze.NoGitHubRepository)}}return r}a(P7c,"replaceTemplateVariables");function D7c(t){let e=0,r=0,n=0,o=0;for(let s of t)switch(s.copilotWorkStatus){case"in_progress":e++;break;case"done":r++;break;case"error":n++;break;case"not_copilot_issue":default:o++;break}return{totalPRs:t.length,inProgressPRs:e,donePRs:r,errorPRs:n,notCopilotPRs:o}}a(D7c,"buildCopilotWorkStatusMeasurements");var qXi=we(w7c,R7c);p();var N7c=new pe("hook.list"),M7c=b.Object({workspaceFolders:b.Optional(b.Array(Kc))});function O7c(t){let e=[];for(let r of t){let n=new Map;for(let o of r.hooks){let s=Rpr[o.type];if(s===void 0)continue;let c=o.hooks.map(u=>kpr(u,"")).filter(u=>u!==void 0);if(c.length===0)continue;let l=n.get(o.uri);l===void 0&&(l={},n.set(o.uri,l)),(l[s]??=[]).push(...c)}for(let[o,s]of n)e.push({uri:o,source:"plugin",pluginUri:r.uri,providers:["BACKGROUND"],hooks:s})}return e}a(O7c,"pluginHookRows");async function L7c(t,e,r){let n=r.workspaceFolders??[],o=aG(t)&&WF(t)?(async()=>{try{let l=(await t.get(Ca).listPlugins()).filter(vme);return O7c(l)}catch(l){return l instanceof Ic||N7c.warn(t,"failed to list plugin hooks for hook/list",{err:String(l)}),[]}})():void 0,c=(await t.get(N0).listHooks(n)).map(l=>{let u={};for(let[d,f]of Object.entries(l.parsedPromptFile.hooks))f!==void 0&&(u[d]=[...f]);return{uri:l.promptPath.uri,storage:l.promptPath.storage,source:yJ(l.promptPath.metadata),providers:c2(l.promptPath.metadata),hooks:u}});return o&&c.push(...await o),[c,null]}a(L7c,"listHooks");var jXi=we(M7c,L7c);p();Fo();var GXi=rGt.type,z8e;function HXi(t){return{title:"Completion Accepted",command:vOe,arguments:[t]}}a(HXi,"makeCommand");async function B7c(t,e,r){z8e&&(z8e.cancel(),z8e.dispose());let n=r.context.triggerKind===1;z8e=new jn.CancellationTokenSource;let o=z8e.token,s=new vE([e,o]);r.contextItems&&rwt(t,r.contextItems,r.data);let c=nwt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:HXi(Dt()),...g}))},null];let l=await g9(t,r.textDocument,s),u=r.position;if(u.line>=l.lineCount)return[{items:[]},null];let d=await t.get(Ay).getCompletions(l,u,s,{isCycling:n,selectedCompletionInfo:r.context.selectedCompletionInfo,formattingOptions:r.formattingOptions,data:r.data});if(!d)return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was canceled"}]:o.isCancellationRequested?[null,{code:Ze.ServerCancelled,message:"Request was superseded by a new request"}]:[{items:[]},null];let f=t.get(Fu);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:HXi(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(B7c,"handleChecked");var $Xi=we(hsi,(t,e,r)=>B7c(t,e,r));p();p();function i9r(t){let e=t.indexOf("-----BEGIN CERTIFICATE-----")+27,r=t.indexOf("-----END CERTIFICATE-----"),n=30,o=t.substring(e,e+n)+"..."+t.substring(r-n,r-1);return tCe(o)}a(i9r,"asReadableCert");function tCe(t){return t.replace(/\s/g,"")}a(tCe,"normalizeNewlines");var U7c=b.Object({});async function Q7c(t){return[{certificates:(await t.get(bp).getAllRootCAs()).map(tCe)},null]}a(Q7c,"handleListCertificatesChecked");var VXi=we(U7c,Q7c);p();var q7c=b.Object({forceRefresh:b.Optional(b.Boolean())});async function j7c(t,e,r){let n=t.get(ay);return[r.forceRefresh?await n.refresh({force:!0}):await n.refresh(),null]}a(j7c,"handleManagedSettingsGetChecked");var WXi=we(q7c,j7c);p();var YXi="mcpGateway/serversChanged",KXi="mcpGateway/serverDetailsChanged",JXi=b.Union([b.Object({kind:b.Literal("user")}),b.Object({kind:b.Literal("project"),workspaceFolder:b.String()}),b.Object({kind:b.Literal("plugin"),pluginId:b.String()})]),H7c=b.Object({source:JXi,name:b.String()}),G7c=b.Union([b.Object({kind:b.Literal("user")}),b.Object({kind:b.Literal("project"),workspaceFolder:b.String()})]),zXi=b.Record(b.String(),b.Unknown()),$7c=b.Object({workspaceFolder:b.String(),user:zXi,project:zXi});async function V7c(t,e,r){let n=j8e(r.user),o=j8e(r.project);return await t.get(gy).applyConfig({workspaceFolder:r.workspaceFolder,user:n,project:o}),[null,null]}a(V7c,"handleApplyConfigChecked");var ZXi=we($7c,V7c),W7c=b.Object({scope:G7c});function z7c(t,e,r){return[{servers:t.get(gy).listServers(r.scope).map(s=>({...s,providers:uT(s.source.kind==="plugin",void 0)}))},null]}a(z7c,"handleListServersChecked");var XXi=we(W7c,z7c),Y7c=H7c;function K7c(t,e,r){return[{details:t.get(gy).getServerDetails(r)},null]}a(K7c,"handleGetServerDetailsChecked");var eeo=we(Y7c,K7c),J7c=b.Object({source:JXi,name:b.String(),action:b.Union([b.Literal("start"),b.Literal("stop"),b.Literal("restart"),b.Literal("logout"),b.Literal("clearOAuth")])});async function Z7c(t,e,r){try{return await t.get(gy).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof CG)return[null,{code:Ze.InvalidRequest,message:n.message,data:{kind:n.code}}];let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:o}]}}a(Z7c,"handleServerActionChecked");var teo=we(J7c,Z7c);p();p();p();var reo=fe(Wc());var o9r=class extends reo.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=Ze.InternalError){super(o,e,{errorType:r,...n})}},Ioe=class extends o9r{static{a(this,"HttpStatusError")}constructor(e,r,n,o=Ze.InternalError){super(e,r,{status:n},o)}},iwt=class extends Ioe{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,Ze.NoCopilotToken)}},owt=class extends Ioe{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var swt=class extends Ioe{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function neo(t){try{if(!("x-metadata"in t))return null;let e=t["x-metadata"];if(typeof e!="object"||e===null)return null;let r=e.registry;if(typeof r!="object"||r===null)return null;let n=r,o=n.api,s=n.mcpServer;if(typeof o!="object"||o===null||typeof s!="object"||s===null)return null;let c=o,l=s;return typeof c.baseUrl=="string"&&c.baseUrl.length>0&&typeof c.version=="string"&&c.version.length>0&&typeof l.name=="string"&&l.name.length>0&&typeof l.version=="string"&&l.version.length>0?{api:{baseUrl:c.baseUrl,version:c.version},mcpServer:{name:l.name,version:l.version},...Object.fromEntries(Object.entries(n).filter(([u])=>!["api","mcpServer"].includes(u)))}:null}catch{return null}}a(neo,"getRegistryMetadataFromConfig");function ieo(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?X7c(t,r):!1}catch{return!1}}a(ieo,"validateServerConfigurationMatch");function X7c(t,e){if(!e.remotes||e.remotes.length===0)return!1;let r=a(o=>o.replace(/\/+$/,""),"normalizeUrl"),n=r(t.url);return e.remotes.some(o=>r(o.url)===n)}a(X7c,"validateRemoteURL");var oeo=300*1e3,lM=class{constructor(e){this.allowlistCache=null;this.serverCache=null;this.ctx=e}static{a(this,"McpRegistryService")}isAllowlistCacheValid(e,r){return Date.now()-e=500&&u<600?[null,new swt(u)]:[null,new Ioe(`Failed to fetch MCP registry allowlist: HTTP ${u}`,"httpError",u)]}}try{let u=await s.text();c=JSON.parse(u)}catch(u){return[null,{code:Ze.InternalError,message:`Failed to parse MCP registry allowlist: ${u instanceof Error?u.message:String(u)}`}]}return!c.mcp_registries||!Array.isArray(c.mcp_registries)?[null,{code:Ze.InternalError,message:"Invalid allowlist format: expected mcp_registries array"}]:c.mcp_registries.some(u=>!u.url||!u.registry_access)?[null,{code:Ze.InternalError,message:"Invalid allowlist format: registry entries missing required fields"}]:(this.allowlistCache={timestamp:Date.now(),data:c,userLogin:r},[c,null])}catch(e){return[null,{code:Ze.InternalError,message:`Failed to fetch MCP registry allowlist: ${e instanceof Error?e.message:String(e)}`}]}}async validateServerConfig(e,r){try{let n=await this.getRegistryInfo();if(n.accessMode==="fallback")return{serverName:e,serverConfig:r,isBlocked:!1};let o=n.registryUrl,s=n.owner,c=await this.checkServerInRegistry(r,o);if(n.accessMode==="allow_all")return{serverName:e,serverConfig:r,isBlocked:!1,registryInfo:c.isFoundInRegistry?s?`Provided by ${s.login} organization`:"Provided by organization":void 0};{let l=!c.isFoundInRegistry;return{serverName:e,serverConfig:r,isBlocked:l,blockReason:l?c.validationError:void 0,registryInfo:l?s?`Blocked by ${s.login} organization registry policy`:"Blocked by organization registry policy":s?`Provided by ${s.login} organization`:"Provided by organization"}}}catch(n){return{serverName:e,serverConfig:r,isBlocked:!0,blockReason:`validation failed: ${n instanceof Error?n.message:String(n)}`,registryInfo:"Blocked by organization registry policy"}}}async checkServerInRegistry(e,r){let n=neo(e);if(!n)return{isFoundInRegistry:!1,validationError:"does not have valid registry config"};let o=n.mcpServer.name,s=n.mcpServer.version,c=n.api.baseUrl,l=n.api.version,u=a(m=>m.replace(/\/+$/,""),"normalizeUrl");if(u(c)!==u(r))return{isFoundInRegistry:!1,validationError:`does not match allowed registry Url, expected: ${r}, found: ${c}`};let d=`${c.replace(/\/+$/,"")}/${l}/servers`,[f,h]=await this.fetchServer(d,o,s);return f&&!h?ieo(e,f)?{isFoundInRegistry:!0}:{isFoundInRegistry:!1,validationError:"url"in e?"remote server URL does not match any registry remote URL":"local configuration does not match registry server configuration"}:{isFoundInRegistry:!1,validationError:h?`Server validation failed: ${h.message}`:`Server not found in registry ${c}`}}async getRegistryInfo(){let[e,r]=await this.fetchMcpRegistryAllowlist();if(r)return{accessMode:"fallback",errorMessage:`Failed to fetch registry allowlist: ${r.message}`};if(!e?.mcp_registries?.length)return{accessMode:"fallback",errorMessage:"Registry allowlist is empty - allowlist feature is disabled"};let n=e.mcp_registries[0];return{accessMode:n.registry_access,registryUrl:n.url,owner:n.owner}}async fetchServer(e,r,n){let o=encodeURIComponent(r),s=encodeURIComponent(n),c=`${e}/${o}/versions/${s}`;if(this.serverCache&&this.isServerCacheValid(this.serverCache.timestamp)){let l=this.serverCache.data.get(c);if(l)return[l,null]}try{let u=await this.ctx.get(Jt).fetch(c,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(u.status===404)return[null,{code:Ze.InternalError,message:"Server not found"}];if(!u.ok)return[null,{code:Ze.InternalError,message:`Failed to fetch server from registry: HTTP ${u.status}`}];let d=await u.text(),f=JSON.parse(d);return(!this.serverCache||!this.isServerCacheValid(this.serverCache.timestamp))&&(this.serverCache={timestamp:Date.now(),data:new Map}),this.serverCache.data.set(c,f),[f,null]}catch(l){return[null,{code:Ze.InternalError,message:`Failed to fetch server from registry: ${l instanceof Error?l.message:String(l)}`}]}}};p();var eQc=b.Object({url:b.String(),source:b.String(),id:b.String(),subfolder:b.Optional(b.String())}),seo=b.Object({description:b.Optional(b.String()),isRequired:b.Optional(b.Boolean()),format:b.Optional(b.Union([b.Literal("string"),b.Literal("number"),b.Literal("boolean"),b.Literal("filepath")])),value:b.Optional(b.String()),isSecret:b.Optional(b.Boolean()),default:b.Optional(b.String()),placeholder:b.Optional(b.String()),choices:b.Optional(b.Array(b.String()))}),s9r=b.Intersect([seo,b.Object({variables:b.Optional(b.Record(b.String(),seo))})]),tQc=b.Intersect([s9r,b.Object({type:b.Literal("positional"),valueHint:b.Optional(b.String()),isRepeated:b.Optional(b.Boolean())})]),rQc=b.Intersect([s9r,b.Object({type:b.Literal("named"),name:b.String(),isRepeated:b.Optional(b.Boolean())})]),aeo=b.Union([tQc,rQc]),Y8e=b.Intersect([s9r,b.Object({name:b.String()})]),nQc=b.Object({registryType:b.String(),registryBaseUrl:b.Optional(b.String()),identifier:b.String(),version:b.Optional(b.String()),fileSha256:b.Optional(b.String()),runtimeHint:b.Optional(b.String()),transport:b.Optional(b.Union([b.Object({type:b.Literal("stdio")}),b.Object({type:b.Literal("streamable-http"),url:b.String(),headers:b.Optional(b.Array(Y8e))}),b.Object({type:b.Literal("sse"),url:b.String(),headers:b.Optional(b.Array(Y8e))})])),runtimeArguments:b.Optional(b.Array(aeo)),packageArguments:b.Optional(b.Array(aeo)),environmentVariables:b.Optional(b.Array(Y8e))}),iQc=b.Union([b.Object({type:b.Literal("streamable-http"),url:b.String(),headers:b.Optional(b.Array(Y8e))}),b.Object({type:b.Literal("sse"),url:b.String(),headers:b.Optional(b.Array(Y8e))})]),oQc=b.Object({src:b.String(),mimeType:b.Optional(b.Union([b.Literal("image/png"),b.Literal("image/jpeg"),b.Literal("image/jpg"),b.Literal("image/svg+xml"),b.Literal("image/webp")])),sizes:b.Optional(b.Array(b.String())),theme:b.Optional(b.Union([b.Literal("light"),b.Literal("dark")]))}),sQc=b.Object({status:b.Optional(b.Union([b.Literal("active"),b.Literal("deprecated"),b.Literal("deleted")])),publishedAt:b.Optional(b.String()),updatedAt:b.Optional(b.String()),isLatest:b.Optional(b.Boolean())},{additionalProperties:!1}),aQc=b.Object({"io.modelcontextprotocol.registry/publisher-provided":b.Optional(b.Object({tool:b.Optional(b.String()),version:b.Optional(b.String()),buildInfo:b.Optional(b.Object({commit:b.Optional(b.String()),timestamp:b.Optional(b.String()),pipelineId:b.Optional(b.String())}))},{additionalProperties:!0}))},{additionalProperties:!0}),cQc=b.Object({"io.modelcontextprotocol.registry/official":b.Optional(sQc)},{additionalProperties:!0}),lQc=b.Object({name:b.String(),description:b.String(),title:b.Optional(b.String()),repository:b.Optional(eQc),version:b.String(),websiteUrl:b.Optional(b.String()),icons:b.Optional(b.Array(oQc)),$schema:b.Optional(b.String()),packages:b.Optional(b.Array(nQc)),remotes:b.Optional(b.Array(iQc)),_meta:b.Optional(aQc)}),uQc=b.Object({server:lQc,_meta:cQc}),pjh=b.Object({servers:b.Array(uQc),metadata:b.Optional(b.Object({nextCursor:b.Optional(b.String()),count:b.Optional(b.Number())}))}),ceo=b.Object({baseUrl:b.String(),cursor:b.Optional(b.String()),limit:b.Optional(b.Number({minimum:1})),search:b.Optional(b.String()),updatedSince:b.Optional(b.String()),version:b.Optional(b.String())}),leo=b.Object({baseUrl:b.String(),serverName:b.String(),version:b.String()});var K8e="mcp.registry.listServers",rCe="mcp.registry.getServer";async function dQc(t,e,r,n){return await t.get(lM).fetchServer(e,r,n)}a(dQc,"fetchServer");async function fQc(t,e,r){if(!r.baseUrl)return[null,{code:Ze.InvalidParams,message:"Base URL is required"}];let n=t.get(Jt),o=new URLSearchParams;r.limit!==void 0&&o.append("limit",r.limit.toString()),r.cursor!==void 0&&o.append("cursor",r.cursor),r.search!==void 0&&o.append("search",r.search),r.updatedSince!==void 0&&o.append("updated_since",r.updatedSince),r.version!==void 0&&o.append("version",r.version);let s=`${r.baseUrl}${o.toString()?`?${o.toString()}`:""}`;try{let c=await n.fetch(s,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!c.ok){let d=`MCP Registry API error: HTTP ${c.status}`;return u0(t,K8e,Vt.createAndMarkAsIssued({message:d})),[null,{code:Ze.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return ft(t,K8e,Vt.createAndMarkAsIssued()),sr(t,K8e),[u,null]}catch(c){Hs(t,K8e,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return u0(t,K8e,Vt.createAndMarkAsIssued({message:l})),[null,{code:Ze.InternalError,message:l}]}}a(fQc,"handleListServersChecked");async function pQc(t,e,r){if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(!r.baseUrl)return[null,{code:Ze.InvalidParams,message:"Base URL is required"}];if(!r.serverName)return[null,{code:Ze.InvalidParams,message:"Server name is required"}];if(!r.version)return[null,{code:Ze.InvalidParams,message:"Version is required"}];let[n,o]=await dQc(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return u0(t,rCe,Vt.createAndMarkAsIssued(s)),sr(t,rCe,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return u0(t,rCe,Vt.createAndMarkAsIssued(c)),sr(t,rCe,c),[null,{code:Ze.InternalError,message:s}]}return ft(t,rCe,Vt.createAndMarkAsIssued()),sr(t,rCe),[n,null]}a(pQc,"handleGetServerChecked");var ueo=we(ceo,fQc),deo=we(leo,pQc);p();p();var feo=b.Object({}),hQc=b.Object({login:b.String(),id:b.Number(),type:b.String(),parent_login:b.Union([b.String(),b.Null()]),parent_id:b.Union([b.Number(),b.Null()])}),mQc=b.Object({url:b.String(),registry_access:b.Union([b.Literal("registry_only"),b.Literal("allow_all")]),owner:hQc}),kjh=b.Object({mcp_registries:b.Array(mQc)});async function gQc(t){return await t.get(lM).fetchMcpRegistryAllowlist()}a(gQc,"fetchMcpRegistryAllowlist");async function AQc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await gQc(t);return o?[null,o]:n?n.mcp_registries.length===0?[n,null]:[n,null]:[null,{code:Ze.InternalError,message:"Failed to retrieve MCP registry allowlist data"}]}catch(n){return[null,{code:Ze.InternalError,message:`Unexpected error in MCP registry allowlist handler: ${n instanceof Error?n.message:String(n)}`}]}}a(AQc,"handleGetMcpRegistryAllowlistChecked");var peo=we(feo,AQc);p();var geo=fe(Zee()),Aeo=fe(hd()),yeo=fe(iv());p();Fo();var yQc=b.Object({edits:b.Array(b.Object({text:b.String(),range:b.Object({start:b.Object({line:b.Number(),character:b.Number()}),end:b.Object({line:b.Number(),character:b.Number()})}),predictedCursorPosition:b.Object({line:b.Number(),character:b.Number()})}))}),LW=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},a9r=new pe("setNextEditDocument");function _Qc(t,e,r){return a9r.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet(LW,new LW(r.edits)),["OK",null]}a(_Qc,"handleTestingSetNextEditDocumentChecked");var heo=we(yQc,_Qc);function meo(t,e,r,n){let o=t.get(LW);if(o.edits&&o.edits.length>0){let s=o.edits.filter(c=>e.line===c.predictedCursorPosition.line&&e.character===c.predictedCursorPosition.character);return s.length===0?(a9r.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):(a9r.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>EQc(c,r,n)))}}a(meo,"getTestNextEditSuggestions");function EQc(t,e,r){return{text:t.text,textDocument:{uri:e,version:r},range:t.range,command:{title:"Accept inline edit",command:"github.copilot.didAcceptNextEditSuggestionItem",arguments:[Dt()]}}}a(EQc,"createNextEditSuggestion");async function vQc(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=Gs(r.textDocument.uri);t.get(t9).setForRequest(Aeo.URI.parse(n),r.diagnostics??[]);let o=meo(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(fC);t.get(geo.ObservableWorkspace).onUserPositionChange(n,new yeo.Position(r.position.line,r.position.character));let c=await s.handleNextEditRequest(n,r.textDocument.version,e);return c?[{edits:c.map(u=>({text:u.edit.text,textDocument:u.edit.textDocument,range:u.edit.range,command:{title:"Accept inline edit",command:vOe,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(vQc,"handleChecked");var _eo=we(lIn,vQc);p();var bQc=b.Object({uuid:b.String({minLength:1}),acceptedLength:b.Optional(b.Number({minimum:1}))});function SQc(t,e,r){let n=t.get(Fu),o=n.get(r.uuid);return o&&(TQc(r,o)==="full"?(n.delete(r.uuid),Zge(t,o,o.triggerCategory)):lht(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(SQc,"notifyAcceptedChecked");function TQc(t,e){return t.acceptedLength===void 0?"full":t.acceptedLengthn.get(s)??[]);if(o.length>0){let s=o[0];for(let l of r.uuids)n.delete(l);let c=o.map(l=>({completionText:l.displayText,completionTelemetryData:l.telemetry}));cht(t,"ghostText",s.offset,s.uri,c),t.get(_y).resetState()}return["OK",null]}a(RQc,"notifyRejectedChecked");var Ceo=we(wQc,RQc);p();var kQc=b.Object({uuid:b.String({minLength:1})});function PQc(t,e,r){let o=t.get(Fu).get(r.uuid);return o&&lft(t,o.triggerCategory,o),["OK",null]}a(PQc,"notifyShownChecked");var beo=we(kQc,PQc);p();var DQc=b.Object({commandLine:b.String(),shell:b.Optional(b.String())});async function NQc(t,e,r){let n=t.get(wT),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(NQc,"handleParseTerminalCommandChecked");var Seo=we(DQc,NQc);p();p();function c9r(t){return b.Union(Object.values(t).map(e=>b.Literal(e)))}a(c9r,"enumSchema");var MQc=b.Union([b.Object({kind:b.Literal("relativePath"),path:b.String()}),b.Object({kind:b.Literal("github"),repo:b.String(),ref:b.Optional(b.String()),sha:b.Optional(b.String()),path:b.Optional(b.String())}),b.Object({kind:b.Literal("url"),url:b.String(),ref:b.Optional(b.String()),sha:b.Optional(b.String()),path:b.Optional(b.String())}),b.Object({kind:b.Literal("npm"),package:b.String(),version:b.Optional(b.String()),registry:b.Optional(b.String())}),b.Object({kind:b.Literal("pip"),package:b.String(),version:b.Optional(b.String()),registry:b.Optional(b.String())})]),OQc=b.Object({rawValue:b.String(),displayLabel:b.String(),cloneUrl:b.String(),canonicalId:b.String(),cacheSegments:b.Array(b.String()),kind:c9r(nG),ref:b.Optional(b.String()),githubRepo:b.Optional(b.String()),localRepositoryUri:b.Optional(b.String()),origin:b.Optional(c9r(sut))}),Teo=b.Object({name:b.String(),description:b.String(),version:b.String(),sourceDescriptor:MQc,marketplace:b.String(),marketplaceReference:OQc,marketplaceType:c9r(iNe),readmeUri:b.Optional(b.String())}),BW=b.Object({pluginUri:b.String()}),awt=b.Object({source:b.String()});p();var LQc="_direct";function Ieo(t,e){let r=t.fromMarketplace,n=r?.name??t.label,o=r?.marketplaceReference.canonicalId??LQc;return{qualifiedId:`${n}@${o}`,name:n,label:t.label,pluginUri:t.uri,...r?.marketplace!==void 0&&{marketplace:r.marketplace},enabled:t.enabled,disabledByPolicy:t.policyBlocked===!0,readOnly:e(t.uri),...r?.description!==void 0&&{description:r.description},...r?.version!==void 0&&{version:r.version},...r?.readmeUri!==void 0&&{readmeUri:r.readmeUri},...r?.marketplaceType!==void 0&&{marketplaceType:r.marketplaceType},...r?.sourceDescriptor!==void 0&&{sourceDescriptor:r.sourceDescriptor},hooks:t.hooks,commands:t.commands,skills:t.skills,agents:t.agents,instructions:t.instructions,mcpServerDefinitions:t.mcpServerDefinitions}}a(Ieo,"toPluginListRow");async function qp(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof I4?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(qp,"withPluginErrorHandling");async function BQc(t,e,r){return qp(()=>t.get(Ca).disablePlugin(r.pluginUri))}a(BQc,"handlePluginsDisableChecked");var xeo=we(BW,BQc);p();async function FQc(t,e,r){return qp(()=>t.get(Ca).enablePlugin(r.pluginUri))}a(FQc,"handlePluginsEnableChecked");var weo=we(BW,FQc);p();var UQc=b.Object({plugin:Teo});async function QQc(t,e,r){return qp(async()=>({pluginUri:await t.get(Ca).installPlugin(r.plugin)}))}a(QQc,"handlePluginsInstallChecked");var Reo=we(UQc,QQc);p();var qQc=b.Object({source:b.String(),pluginName:b.Optional(b.String())});async function jQc(t,e,r){return qp(()=>t.get(Ca).installPluginFromSource(r.source,r.pluginName))}a(jQc,"handlePluginsInstallFromSourceChecked");var keo=we(qQc,jQc);p();var HQc=b.Object({});async function GQc(t,e,r){return qp(async()=>{let n=t.get(Ca);return(await n.listPlugins()).map(s=>Ieo(s,c=>n.isReadOnlyPlugin(c)))})}a(GQc,"handlePluginsListChecked");var Peo=we(HQc,GQc);p();async function $Qc(t,e,r){return qp(()=>t.get(Ca).addMarketplace(r.source))}a($Qc,"handleMarketplaceAddChecked");var Deo=we(awt,$Qc);p();var VQc=b.Object({source:b.Optional(b.String())});async function WQc(t,e,r){return qp(()=>t.get(Ca).browseMarketplace(r.source))}a(WQc,"handleMarketplaceBrowseChecked");var Neo=we(VQc,WQc);p();var zQc=b.Object({});async function YQc(t,e,r){return qp(async()=>[...await t.get(Ca).listMarketplaces()])}a(YQc,"handleMarketplaceListChecked");var Meo=we(zQc,YQc);p();async function KQc(t,e,r){return qp(()=>t.get(Ca).removeMarketplace(r.source))}a(KQc,"handleMarketplaceRemoveChecked");var Oeo=we(awt,KQc);p();async function JQc(t,e,r){return qp(()=>t.get(Ca).uninstallPlugin(r.pluginUri))}a(JQc,"handlePluginsUninstallChecked");var Leo=we(BW,JQc);p();async function ZQc(t,e,r){return qp(async()=>({updated:await t.get(Ca).updatePlugin(r.pluginUri)}))}a(ZQc,"handlePluginsUpdateChecked");var Beo=we(BW,ZQc);p();var XQc=fsi;function eqc(t,e,r){let n=t.get(Pm),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new Zve(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a(eqc,"registerContextProviders");var Feo=we(XQc,eqc);p();p();var tqc=b.Object({uri:b.Optional(b.String())}),rqc=b.Object({showEditorCompletions:b.Optional(b.Boolean()),enableAutoCompletions:b.Optional(b.Boolean()),delayCompletions:b.Optional(b.Boolean()),filterCompletions:b.Optional(b.Boolean())}),Qeo=b.Object({github:b.Optional(b.Object({copilot:b.Optional(b.Object({}))})),[C$r]:b.Optional(tqc),http:b.Optional(Bgn),telemetry:b.Optional(b.Object({telemetryLevel:b.Optional(b.String())}))}),J8e=Object.keys(Qeo.properties).filter(t=>t!=="github"),nqc=b.Intersect([Qeo,rqc]),iqc=b.Object({settings:b.Optional(b.Union([b.Object({}),b.Array(b.Unknown(),{maxItems:0})])),authProvider:b.Optional(b.Never())}),Ueo=Zu.Compile(iqc),l9r=Zu.Compile(nqc);function CB(t){if(typeof t=="string")return{type:"content",content:t};if(t&&typeof t=="object"){let e=t;if(e.type==="file"&&typeof e.uri=="string")return{type:"file",uri:e.uri};if(e.type==="location"&&typeof e.path=="string")return{type:"location",path:e.path};if(e.type==="content"&&typeof e.content=="string")return{type:"content",content:e.content};if(typeof e.uri=="string")return{type:"file",uri:e.uri};if(typeof e.content=="string")return{type:"content",content:e.content}}return{type:"content",content:""}}a(CB,"normalizePromptSetting");async function lwt(t,e){if(!Ueo.Check(e))throw cwt(t),new ey(Ueo.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&oqc(t,r),cwt(t,r),Promise.resolve()}a(lwt,"notifyChangeConfiguration");function oqc(t,e){for(let n of l9r.Errors(e)){let o=n.path.split("/")?.[1];Yo.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!l9r.Check(e))throw new ey(l9r.Errors(e));e.http&&u9r(t,e.http);let r=e["github-enterprise"];r&&eqe(t,r.uri),e.github?.copilot&&sqc(t,e.github.copilot)}a(oqc,"applySettingsToConfiguration");function sqc(t,e){let r=t.get(Ib),n={};for(let o of Object.values(ze)){let s=Qgn(e,o);n[o]=s}r.setCopilotSettings(n),_ge.clearCache(),Dxt.clearCache(),typeof e.mcp=="string"&&Eqc(t,e.mcp),e.agent&&typeof e.agent=="object"&&(vqc(t,e.agent),Cqc(t,e.agent),bqc(t,e.agent)),aqc(t,e.globalCopilotInstructions),cqc(t,e.globalGitCommitInstructions),lqc(t,e.globalAgentsMdInstructions),uqc(t,e.globalClaudeMdInstructions),dqc(t,e.globalInstructionFiles),fqc(t,e.globalPromptFiles),gqc(t,e.instructionFileLocations),Aqc(t,e.promptFileLocations),yqc(t,e.agentFileLocations),_qc(t,e.skillFileLocations)}a(sqc,"applyCopilotConfiguration");function aqc(t,e){try{let r=t.get(Mf),n=CB(e);r.setGlobalCopilotInstructions(n)}catch(r){Yo.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(aqc,"applyGlobalCopilotInstructionsConfiguration");function cqc(t,e){try{let r=t.get(Mf),n=CB(e);r.setGlobalGitCommitInstructions(n)}catch(r){Yo.error(t,"Failed to apply global Git commit instructions configuration",r)}}a(cqc,"applyGlobalGitCommitInstructionsConfiguration");function lqc(t,e){try{let r=t.get(Mf),n=CB(e);r.setGlobalAgentsMdInstructions(n)}catch(r){Yo.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(lqc,"applyGlobalAgentsMdInstructionsConfiguration");function uqc(t,e){try{let r=t.get(Mf),n=CB(e);r.setGlobalClaudeMdInstructions(n)}catch(r){Yo.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(uqc,"applyGlobalClaudeMdInstructionsConfiguration");function dqc(t,e){try{let r=t.get(Mf),n=(e||[]).map(CB);r.setGlobalInstructionFiles(n)}catch(r){Yo.error(t,"Failed to apply global instruction files configuration",r)}}a(dqc,"applyGlobalInstructionFilesConfiguration");function fqc(t,e){try{let r=t.get(D0),n=(e||[]).map(CB);r.setGlobalPromptFiles(n)}catch(r){Yo.error(t,"Failed to apply global prompt files configuration",r)}}a(fqc,"applyGlobalPromptFilesConfiguration");function pqc(t){return t?Array.isArray(t)?t.map(CB):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(pqc,"normalizeFileLocations");function hqc(t){let e=CB(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(hqc,"normalizeInstructionPromptSetting");function mqc(t){return t?Array.isArray(t)?t.map(hqc):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(mqc,"normalizeInstructionFileLocations");function gqc(t,e){try{let r=t.get(Mf);if(e===void 0)return;r.setInstructionFileLocations(mqc(e))}catch(r){Yo.error(t,"Failed to apply instruction file locations configuration",r)}}a(gqc,"applyInstructionFileLocationsConfiguration");function Aqc(t,e){try{let r=t.get(D0);if(e===void 0)return;r.setPromptFileLocations(pqc(e))}catch(r){Yo.error(t,"Failed to apply prompt file locations configuration",r)}}a(Aqc,"applyPromptFileLocationsConfiguration");function yqc(t,e){try{let r=t.get(Kd);if(e===void 0)return;let n=e.map(CB);r.setAgentFileLocations(n)}catch(r){Yo.error(t,"Failed to apply agent file locations configuration",r)}}a(yqc,"applyAgentFileLocationsConfiguration");function _qc(t,e){try{let r=t.get(xg);if(e===void 0)return;let n=e.map(CB);r.setSkillFileLocations(n)}catch(r){Yo.error(t,"Failed to apply skill file locations configuration",r)}}a(_qc,"applySkillFileLocationsConfiguration");function u9r(t,e){let r=t.get(Ib);e.proxy===void 0&&(e=Fgn(r.env));try{r.setHttpSettings(Mxe(e))}catch(n){if(!(n instanceof TypeError))throw n;Yo.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(u9r,"applyHttpConfiguration");async function Eqc(t,e){let r;try{r=j8e(JSON.parse(e||"{}"))}catch(n){Yo.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(CE).updateMCPServers(r)}catch(n){Yo.error(t,"Failed to apply MCP configuration to McpManager",n)}}a(Eqc,"applyMCPConfiguration");function vqc(t,e){try{let r=e;t.get(wT).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){Yo.error(t,"Failed to apply settings configuration",r)}}a(vqc,"applyTerminalAutoApproveConfiguration");function Cqc(t,e){try{let r=e;t.get(qw).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){Yo.error(t,"Failed to apply edit auto approve configuration",r)}}a(Cqc,"applyEditAutoApproveConfiguration");function bqc(t,e){try{let r=e;t.get(YF).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){Yo.error(t,"Failed to apply MCP auto approve configuration",r)}}a(bqc,"applyMCPAutoApproveConfiguration");function cwt(t,e){if(t.get(Ib).markReady(),!t.get(Nn).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(op).initialize(r)}}a(cwt,"initializePostConfigurationDependencies");var qeo=b.Object({name:b.String(),version:b.String(),readableName:b.Optional(b.String())}),Sqc=b.Object({editorInfo:qeo,editorPluginInfo:qeo,editorConfiguration:b.Optional(b.Object({}))});async function Tqc(t,e,r){t.get(Ir).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),uht(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await lwt(t,{settings:r.editorConfiguration}),ft(t,"setEditorInfo");for(let n of["github",...J8e])r.editorConfiguration&&n in r.editorConfiguration&&ft(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(Tqc,"handleSetEditorInfoChecked");var jeo=we(Sqc,Tqc);p();var Iqc=b.Object({options:b.Optional(b.Object({}))});async function xqc(t,e,r){let n=t.get(pI),o=n.pendingSignIn?.status;if(o===void 0)return[null,{code:Ze.InvalidRequest,message:"No pending sign in"}];let s;try{return s=await o,[s,null]}catch(c){return[null,{code:Ze.DeviceFlowFailed,message:String(c)}]}finally{n.pendingSignIn=void 0}}a(xqc,"handleSignInConfirmChecked");var Heo=we(Iqc,xqc);p();var wqc=b.Object({options:b.Optional(b.Object({})),githubAppId:b.Optional(b.String())});async function Rqc(t,e,r){try{let o=await t.get(Or).checkAndUpdateStatus({githubAppId:r.githubAppId});if(o.status==="OK")return[{status:"AlreadySignedIn",user:o.user},null];let c=await t.get(pI).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:fht,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof Ei))throw n;return[null,{code:Ze.DeviceFlowFailed,message:n.message}]}}a(Rqc,"handleSignInInitiateChecked");var d9r=we(wqc,Rqc);p();p();p();var Geo=["google","apple"],uwt=b.Optional(b.Union(Geo.map(t=>b.Literal(t))));function $eo(t){return typeof t=="string"&&Geo.includes(t)}a($eo,"isGitHubSocialProvider");function f9r(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(f9r,"isGitHubSocialProviderApplicableHostname");function Veo(t,e){if(!e)return t;try{let r=new URL(t);return f9r(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(Veo,"addGitHubSocialProviderToVerificationUri");p();function Weo(){return!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY||(process.platform==="linux"||process.platform==="freebsd"||process.platform==="openbsd")&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)}a(Weo,"isBrowserAvailable");function kqc(t){let e=t.replace(/\/$/,"");return{issuer:e,authorization_endpoint:`${e}/login/oauth/authorize`,token_endpoint:`${e}/login/oauth/access_token`,response_types_supported:["code"],code_challenge_methods_supported:["S256"],grant_types_supported:["authorization_code"],scopes_supported:["repo","workflow","user","read:org"]}}a(kqc,"getGitHubOAuthServerMetadata");async function dwt(t,e,r={},n){let o=performance.now();Xge(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!Weo())throw new C7("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=b7(t,r.authAuthority),u=kqc(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=f9r(new URL(c).hostname)?r.socialProvider:void 0,m=await d.createSession(f,{cancellationToken:n,provider:h,loginHint:r.loginHint}),g=m.scopes||f,A=t.get(ih).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new Ei("Could not resolve GitHub username during sign-in. Please try again.");return s=await t.get(Or).signInEditor({accessToken:m.accessToken,user:y,githubAppId:A,authAuthority:l,scopes:g?[...g]:void 0}),ID(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw ID(t,"codeFlow",s.status,performance.now()-o,c),c}}a(dwt,"performGitHubOAuthCodeFlow");p();p();p();sWe();var nCe=class extends sg{constructor(r,n=new p9r){super();this.ctx=r;this.fallback=n}static{a(this,"AgentUrlOpener")}async open(r){let n=this.ctx.get(er);if(!(n.clientCapabilities?.window?.showDocument?.support&&(await Promise.race([n.connection.window.showDocument({uri:r,external:!0}),new Promise((s,c)=>setTimeout(()=>c(new Error("window/showDocument timed out")),15e3))])).success))return this.fallback.open(r)}},p9r=class extends sg{static{a(this,"SpawnUrlOpener")}async open(e){await axe(e)}};p();var zeo=require("crypto"),Yeo=fe(require("http"));p();var fwt=new pe("OAuth Code Flow");function h9r(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n @@ -4253,49 +4253,49 @@ Content: ${r}`}async generateTitle(e,r,n){let o=new jn.CancellationTokenSource,s } -`;var m9r=["authorization_code","refresh_token"],iCe=33428,fwt=class{constructor(e,r){this._logger=new pe("LoopbackAuthServer");this.nonce=(0,Veo.randomBytes)(16).toString("hex");if(!e)throw new Error("startingRedirect must be defined");this._startingRedirect=new URL(e),this._ctx=r;let n;this._resultPromise=new Promise((s,c)=>n={resolve:s,reject:c}),this._responseSentPromise=new Promise(s=>{this._resolveResponseSent=s});let o=`&app_name=${encodeURIComponent("GitHub Copilot")}`;this._server=Weo.createServer((s,c)=>{let l=new URL(s.url,`http://${s.headers.host}`);switch(l.pathname){case"/signin":{let u=(l.searchParams.get("nonce")??"").replace(/ /g,"+");if(u!==this.nonce){let d=new Ei("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),EOe(this._ctx,d,"/signin"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(d);return}this._startingRedirect.searchParams.set("redirect_uri",`http://127.0.0.1:${this.port}/callback`),this._logger.info(this._ctx,"Redirecting to auth server"),c.writeHead(302,{location:this._startingRedirect.toString()}),c.end();break}case"/callback":{let u=l.search||"",d=/[?&]code=([^&]+)/.exec(u),f=/[?&]state=([^&]+)/.exec(u),h=d&&d.length>1?decodeURIComponent(d[1]):void 0,m=f&&f.length>1?decodeURIComponent(f[1]):void 0,g=new URL(m||"").searchParams.get("nonce")??void 0;if(!h||!m||!g){let A="Missing required parameters, at least one from code, state, nonce is needed.",y=new Ei(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),EOe(this._ctx,y,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent(A)}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(y);return}if(this.state!==m){let A=new Ei("State does not match.");this._logger.warn(this._ctx,"OAuth callback state mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedState:m,expectedState:this.state}),EOe(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("State does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}if(this.nonce!==g){let A=new Ei("Nonce does not match.");this._logger.warn(this._ctx,"OAuth callback nonce mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedNonce:g,expectedNonce:this.nonce}),EOe(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}this._logger.info(this._ctx,"OAuth callback validation successful"),n.resolve({code:h,state:m}),c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(h9r,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(h9r)}})}static{a(this,"LoopbackAuthServer")}get redirectUri(){if(this.port===void 0)throw new Error("Server is not started yet");return`http://127.0.0.1:${this.port}/callback`}set state(e){e?this._startingRedirect.searchParams.set("state",e):this._startingRedirect.searchParams.delete("state")}get state(){return this._startingRedirect.searchParams.get("state")??void 0}start(){return new Promise((e,r)=>{if(this._server.listening)throw new Error("Server is already started");let n=setTimeout(()=>{r(new Error("Timeout waiting for port"))},5e3);this._server.on("listening",()=>{let o=this._server.address();if(typeof o=="string")this.port=parseInt(o);else if(o instanceof Object)this.port=o.port;else throw new Error("Unable to determine port");clearTimeout(n),this.state=`http://127.0.0.1:${this.port}/callback?nonce=${this.nonce}`,this._logger.info(this._ctx,"OAuth server started and state configured",{port:this.port,redirectUri:this.redirectUri}),e(this.port)}),this._server.on("error",o=>{if(o.code==="EADDRINUSE"){console.warn(`Port ${iCe} is in use, retrying with a random port...`),this._server.listen(0,"127.0.0.1");return}clearTimeout(n),r(new Error(`Error listening to server: ${o.message}`))}),this._server.on("close",()=>{clearTimeout(n),r(new Error("Server closed unexpectedly"))}),this._server.listen(iCe,"127.0.0.1")})}stop(){return new Promise((e,r)=>{if(!this._server.listening){e();return}let n,o=a(()=>{n&&(clearTimeout(n),n=void 0)},"cleanup");n=setTimeout(()=>{o(),r(new Error("Timeout waiting for server to close"))},5e3),this._server.close(s=>{o(),s?r(s):e()}),this._server.closeAllConnections()})}waitForOAuthResponse(){return this._resultPromise}waitForResponseSent(){return this._responseSentPromise}};p();var pwt=require("crypto");var Z8e=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,pwt.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,pwt.randomBytes)(e)}static base64UrlEncode(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static getSupportedMethods(){return[this.getCodeChallengeMethod()]}static isServerSupported(e){if(!e||e.length===0)return!1;let r=this.getSupportedMethods();return e.some(n=>r.includes(n))}static createPKCEParameters(){let e=this.generateCodeVerifier(),r=this.generateCodeChallenge(e),n=this.getCodeChallengeMethod();return{codeVerifier:e,codeChallenge:r,codeChallengeMethod:n}}};var Rqc="Timed out",zeo="Sign-in request was cancelled",g9r=class{static{a(this,"CodeFlow")}},oCe=class extends g9r{static{a(this,"CLSCodeFlow")}constructor(e){super(),this.ctx=e}async auth(e,r,n,o,s,c){let{clientId:l,clientSecret:u}=e,d=o?.resource,f=Z8e.isServerSupported(n.code_challenge_methods_supported),h=f?Z8e.createPKCEParameters():void 0;f?Br.info(this.ctx,`PKCE supported by server with methods: [${n.code_challenge_methods_supported?.join(", ")}], using ${h.codeChallengeMethod}`):Br.info(this.ctx,"PKCE not supported by server, falling back to standard OAuth flow");let m=this.buildAuthorizationParams({clientId:l,scope:r.join(" "),pkceParams:h,resource:d,...s??{}}),g=new URLSearchParams(m),A=n.authorization_endpoint+"?"+g.toString(),y=new fwt(A,this.ctx),E=`http://127.0.0.1:${await y.start()}/signin?nonce=${encodeURIComponent(y.nonce)}`;Br.info(this.ctx,"Auth URL created and opening browser for sign-in"),await new nCe(this.ctx).open(E);let v,S=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,k)=>{let D=setTimeout(()=>k(new Error(Rqc)),3e5);S.push({dispose:a(()=>clearTimeout(D),"dispose")})})];if(c){let x=c;w.push(new Promise((k,D)=>{if(x.isCancellationRequested){Br.info(this.ctx,"OAuth flow cancelled (already requested)"),D(new Error(zeo));return}let N=x.onCancellationRequested(()=>{Br.info(this.ctx,"OAuth flow cancelled"),D(new Error(zeo))});S.push(N)}))}v=(await Promise.race(w)).code,Br.info(this.ctx,"OAuth response received successfully")}catch(w){throw Br.error(this.ctx,"OAuth flow error",w),w}finally{for(let x of S)x.dispose();let w,R=new Promise(x=>w=setTimeout(x,5e3));await Promise.race([y.waitForResponseSent().finally(()=>clearTimeout(w)),R]).catch(()=>{}),await y.stop().catch(x=>{Br.warn(this.ctx,"Failed to stop loopback auth server",x)})}return await this.exchangeCodeForToken({endpointUri:n.token_endpoint,redirectUri:y.redirectUri,code:v,clientId:l,clientSecret:u,codeVerifier:h?.codeVerifier,resource:d})}async exchangeCodeForToken({endpointUri:e,redirectUri:r,code:n,clientId:o,clientSecret:s,codeVerifier:c,resource:l}){let u=[["grant_type","authorization_code"],["code",n],["client_id",o],["redirect_uri",r]];s&&u.push(["client_secret",s]),c&&u.push(["code_verifier",c]),l&&u.push(["resource",l]);let d=new URLSearchParams(u);Br.info(this.ctx,"Exchanging authorization code for token",{endpointUri:e,clientId:o,redirectUri:r});let f=await Nee(this.ctx,e,"POST",{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},d.toString());if(f.ok){let h=await f.json();return Br.info(this.ctx,"Token exchange successful"),h}else{let h=await f.text(),m=new Error(h);throw m.name="Token Exchange Error",m}}buildAuthorizationParams({clientId:e,scope:r,pkceParams:n,resource:o,...s}){let c=[["client_id",e],["response_type","code"],["scope",r]];n&&c.push(["code_challenge",n.codeChallenge],["code_challenge_method",n.codeChallengeMethod]),o&&c.push(["resource",o]);for(let[l,u]of Object.entries(s??{}))u!==void 0&&c.push([l,String(u)]);return c}};var uM=class t{constructor(e,r,n,o){this.id=t.providerId;this.label="GitHub";this.supportsMultipleAccounts=!1;this.authorizationServers=[t.providerId];this.ctx=e,this.serverMetadata=n,this.resourceMetadata=o,this._sessionsPromise=this.readSessions().then(s=>(setTimeout(()=>s.forEach(c=>{this.afterSessionLoad(c)}),1e3),s))}static{a(this,"GitHubAuthenticationProvider")}static{this.providerId="https://github.com/login/oauth"}async getSessions(e,r){await this.checkSessionsExpiration();let n=await this._sessionsPromise,o=e?.sort()||[];return o.length?n.filter(c=>p9r([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(Un).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(ih),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=Heo(r.provider)?r.provider:void 0,d=typeof r.loginHint=="string"?r.loginHint:void 0,f=d?{login:d,provider:u}:{prompt:"select_account",provider:u},h=await new oCe(this.ctx).auth({clientId:c,clientSecret:l},n,this.serverMetadata,this.resourceMetadata,f,r.cancellationToken),m=await this.tokenToSession(h.access_token,e);this.afterSessionLoad(m);let g=o.findIndex(y=>y.account.id===m.account.id&&p9r([...y.scopes].sort(),n)),A=new Array;return g>-1?A.push(...o.splice(g,1,m)):o.push(m),await this.storeSessions(o),m}async storeSessions(e){this._sessionsPromise=Promise.resolve(e),await this.ctx.get(Un).update("oauth",this.id,e)}async tokenToSession(e,r){let n=await this.getUserInfo(e);return{id:crypto.getRandomValues(new Uint32Array(2)).reduce((o,s)=>o+=s.toString(16),""),accessToken:e,account:{label:n.accountName,id:n.id},scopes:r}}buildGetUserInfoUrl(){try{let e=new URL(this.serverMetadata?.issuer);return e.hostname.toLowerCase()==="github.com"?"https://api.github.com/user":`${e.origin.replace(/\/+$/,"")}/api/v3/user`}catch{return"https://api.github.com/user"}}async getUserInfo(e){let r=this.buildGetUserInfoUrl(),n;try{n=await this.ctx.get(Jt).fetch(new URL(r).href,{method:"GET",headers:{Authorization:`token ${e}`}})}catch(o){return dwt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}if(n.ok)try{let o=await n.json();return{id:`${o.id}`,accountName:o.login}}catch(o){return dwt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}else{let o=n.statusText;try{let s=await n.json();s.message&&(o=s.message)}catch{}return dwt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}}async removeSession(e){let r=await this._sessionsPromise,n=r.findIndex(o=>o.id===e);if(n>-1)r.splice(n,1),await this.storeSessions(r);else throw new Error(`No session with id '${e}' found.`)}async checkSessionsExpiration(){let e=await this._sessionsPromise;if(e.length!==0)for(let r of e)await this.isSessionExpired(r)&&await this.removeSession(r.id)}async isSessionExpired(e){let{accessToken:r}=e,{id:n,accountName:o}=await this.getUserInfo(r);return!n||!o}};var kqc=b.Object({scopes:b.Optional(b.Array(b.String({minLength:1}),{minItems:1})),authServer:b.Optional(b.String({minLength:1})),socialProvider:lwt,loginHint:b.Optional(b.String({minLength:1})),skipSignedInEarlyReturn:b.Optional(b.Boolean())});async function Pqc(t,e,r){if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];try{let n=t.get(Fr);if(!r.skipSignedInEarlyReturn){let{status:c,user:l}=await n.checkAndUpdateStatus({authAuthority:r.authServer});if(c==="OK")return[{status:c,user:l},null]}let o=n.getAuthSourceEnvVar();if(o)return[null,{code:Ze.AuthEnvVarConflict,message:rqe(o)}];let s=await uwt(t,(c,l)=>new uM(c,uM.providerId,l,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider,loginHint:r.loginHint},e);if(!["OK","MaybeOK"].includes(s.status))throw new Ei("OAuth authentication failed for unknown reasons. Please try again later.");return[s,null]}catch(n){if(n instanceof C7)return[null,{code:Ze.NoBrowserAvailable,message:n.message}];if(!(n instanceof Ei))throw n;return[null,{code:Ze.CodeFlowFailed,message:n.message}]}}a(Pqc,"handleSignInWithCodeFlowChecked");var Yeo=we(kqc,Pqc);p();p();p();var A9=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},X8e=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function Keo(t,e,r){return e.isCancellationRequested?Promise.reject(new A9):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new A9))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new X8e))},r);t.then(u=>{s||(s=!0,clearTimeout(l),c.dispose(),n(u))},u=>{s||(s=!0,clearTimeout(l),c.dispose(),o(u instanceof Error?u:new Error(String(u))))})})}a(Keo,"raceWithCancellationAndTimeout");var Dqc=["repo","workflow"];async function Nqc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...s_(t)},json:{client_id:e,scope:n.join(" ")},timeout:3e4},s=new URL("login/device/code",r).href,c;try{c=await t.get(Jt).fetch(s,o)}catch(l){throw l instanceof Error&&wx(l)?new Ei(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new Ei(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(Nqc,"requestDeviceCode");async function Mqc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...s_(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s;try{s=await t.get(Jt).fetch(new URL("login/oauth/access_token",n).href,o)}catch(l){throw l instanceof Error&&wx(l)?new Ei(`Device flow token request failed on ${n}: ${l.message}`):l}let c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new Ei(c.error_description):new Ei(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(Mqc,"requestAccessToken");async function Oqc(t,e){let n=await(await Gd(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new Ei(`Error retrieving user information: ${String(n.errors)}`);return n}a(Oqc,"requestUserInfo");async function Lqc(t,e,r){let n=r?.githubAppId??t.get(ih).findAppIdToAuthenticate(),o=r?.scopes??Dqc,{serverUrl:s,apiUrl:c,authAuthority:l}=b7(t,r?.authAuthority),u=await Nqc(t,n,s,o),d=(async()=>{let f=Date.now()+u.expires_in*1e3,h=u.interval,m;do{if(await new Promise(A=>setTimeout(A,1e3*h)),e.isCancellationRequested)throw new A9("Sign-in request was cancelled");m=await Mqc(t,u.device_code,n,s);let g=m.access_token;if(g){let A=await Oqc(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new A9("Sign-in request was cancelled");let y=m.scope?m.scope.split(" ").filter(_=>_.length>0):o;return{authAuthority:l,githubAppId:n,username:A.login,accessToken:g,scopes:y}}h=m.interval??h}while(Date.now()performance.now()-n,"getElapsedTimeMs");try{let s=t.get(Fr);if(!r.skipSignedInEarlyReturn){let{status:h,user:m}=await s.checkAndUpdateStatus({authAuthority:r.authServer});if(h==="OK")return[{status:h,user:m},null]}let c=s.getAuthSourceEnvVar();if(c)return[null,{code:Ze.AuthEnvVarConflict,message:rqe(c)}];Xge(t,"deviceFlow");let l=t.get(Ioe),u=await l.initiate(e,{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider});await t.get(er).connection.sendNotification(Uqc,{userCode:u.userCode,verificationUri:u.verificationUri,expiresIn:u.expiresIn});let d=await Keo(u.waitForAuth,e,Qqc),f=await l.save(d);return ID(t,"deviceFlow",f.status,o()),[f,null]}catch(s){if(s instanceof A9)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof X8e)return ID(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:Ze.DeviceFlowFailed,message:"Sign-in request timed out"}];if(ID(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof Ei))throw s;return[null,{code:Ze.DeviceFlowFailed,message:s.message}]}}a(qqc,"handleSignInWithDeviceFlowChecked");var Zeo=we(Fqc,qqc);p();var jqc=b.Object({githubToken:b.String({minLength:1}),user:b.String({minLength:1}),githubAppId:b.Optional(b.String({minLength:1}))});async function Hqc(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Fr);return[await t.get(pI).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a(Hqc,"handleSignInWithGithubTokenChecked");var Xeo=we(jqc,Hqc);p();var Gqc=b.Object({options:b.Optional(b.Object({}))});async function $qc(t,e,r){return[await t.get(Fr).signOutEditor(),null]}a($qc,"handleSignOutChecked");var eto=we(Gqc,$qc);p();var Vqc=b.Object({transaction:b.Optional(b.String()),stacktrace:b.Optional(b.String()),properties:b.Optional(b.Record(b.String(),b.String())),platform:b.Optional(b.String()),exception_detail:b.Optional(b.Array(b.Object({type:b.Optional(b.String()),value:b.Optional(b.String()),stacktrace:b.Optional(b.Array(b.Object({filename:b.Optional(b.String()),lineno:b.Optional(b.Union([b.String(),b.Integer()])),colno:b.Optional(b.Union([b.String(),b.Integer()])),function:b.Optional(b.String()),in_app:b.Optional(b.Boolean())})))})))}),A9r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function Wqc(t,e,r){let n=t.get(As),o=t.get(Ir).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&K4.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:zDt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},K4.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new A9r(r.stacktrace??"N/A",o.name);return l.stack=void 0,Ma(t,l,r.transaction??"",s,c),["OK",null]}a(Wqc,"handleTelemetryExceptionChecked");var tto=we(Vqc,Wqc);p();p();p();Fo();function y9r(t,e){let r=Date.now()+((t?.refresh_in??0)+TOt)*1e3;return new Hz({token:`test token ${Dt()}`,refresh_in:0,expires_at:r,...t},e,r)}a(y9r,"createTestCopilotToken");var sCe=class extends $h{constructor(){super(...arguments);this.defaultToken=y9r({token:"tid=test;rt=1"})}static{a(this,"FakeCopilotTokenFetcherFromSession")}fetchTokenResult(r,n){switch(n.accessToken){case"":return{copilotToken:this.defaultToken};case"valid-github-token":return{copilotToken:y9r({token:"tid=valid-copilot-token"})};case void 0:return{failureKind:"NotSignedIn"};case"notauth-github-token":return{failureKind:"NotAuthorized",message:"notauth",canSignUpForLimited:!0};case"bogus-github-token":return{failureKind:"NotAuthorized",message:"bogus",canSignUpForLimited:!1};case"expired-github-token":return{failureKind:"HTTP401",message:"expired"};default:throw new Error("Don't have a valid GitHub token")}}};var hwt=class extends $h{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:y9r(await this.envelopeFn())}}};var zqc=b.Object({options:b.Optional(b.Object({}))});async function Yqc(t,e,r){let n=new sCe;return t.get(Fr).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet($h,n),t.get(ks).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(Yqc,"handleTestingAlwaysAuthChecked");var _9r=we(zqc,Yqc);p();Fo();var Kqc=b.Object({messages:b.Array(b.Object({role:b.Enum(hc),content:b.String(),name:b.Optional(b.String())})),modelFamily:b.Optional(b.Enum(kn)),stop:b.Optional(b.Array(b.String())),conversationOptions:b.Optional(b.Object({maxResponseTokens:b.Optional(b.Number()),temperature:b.Optional(b.Number())}))});async function Jqc(t,e,r){let n=new mc(t),s=await rj(t)?kn.Gpt35turbo:kn.CopilotBase,c=await t.get(dl).getBestChatModelConfig([r.modelFamily??s]),l=await Qwe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:WA.user("test",Dt())},e,l),null]}a(Jqc,"handleChatMLChecked");var rto=we(Kqc,Jqc);p();p();p();var dCe=fe(sro(),1),iJh={ALPN_HTTP2:dCe.default.ALPN_HTTP2,ALPN_HTTP2C:dCe.default.ALPN_HTTP2C,ALPN_HTTP1_1:dCe.default.ALPN_HTTP1_1,ALPN_HTTP1_0:dCe.default.ALPN_HTTP1_0},{fetch:oJh,context:aro,reset:sJh,noCache:aJh,h1:cJh,keepAlive:lJh,h1NoCache:uJh,keepAliveNoCache:dJh,cacheStats:fJh,clearCache:pJh,offPush:hJh,onPush:mJh,createUrl:gJh,timeoutSignal:AJh,Body:yJh,Headers:cro,Request:_Jh,Response:EJh,AbortController:vJh,AbortError:Pwt,AbortSignal:CJh,FetchBaseError:bJh,FetchError:SJh,ALPN_HTTP2:TJh,ALPN_HTTP2C:IJh,ALPN_HTTP1_1:xJh,ALPN_HTTP1_0:wJh}=dCe.default;var uro=require("crypto"),dro=require("http"),fro=require("stream"),pro=require("util"),pCe=fe(s2());var _Gc=6e5,EGc=new pCe.ProtocolRequestType("copilot/fetch"),vGc=new pCe.ProtocolRequestType("copilot/fetchCancel"),CGc=new pCe.ProgressType,bGc=new pCe.ProtocolRequestType("copilot/fetchDisconnectAll"),bB=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},fCe=class extends Jt{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(As).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(er).connection.sendRequest(bGc,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(er).connection,c=(0,uro.randomUUID)(),l=new jn.CancellationTokenSource,u=new fro.PassThrough,d=a(()=>{s.sendRequest(vGc,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new Pwt("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new bB("EditorFetcher received unexpected abort signal");if(o.aborted)throw new Pwt("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(CGc,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new bB(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??_Gc,y=setTimeout(()=>{sr(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new bB("Request timed out from lsp server"))},A),_=a(()=>{g(new Pwt("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",_),s.sendRequest(EGc,TGc(r,c,n),l.token).then(m).catch(E=>{let v="EditorFetcher request failed";E&&typeof E=="object"&&"message"in E&&(v+=`: ${String(E.message)}`),E&&typeof E=="object"&&"data"in E&&(v+=`: ${(0,pro.inspect)(E.data)}`),g(new bB(v))}).finally(()=>{o?.removeEventListener("abort",_),clearTimeout(y)})});if(!h.status)throw new bB("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new kx(h.status,dro.STATUS_CODES[h.status]??"",new cro(h.headers),()=>SGc(u),()=>u)}};function SGc(t){return new Promise((e,r)=>{let n="";t.on("error",r),t.on("end",()=>e(n)),t.on("data",o=>n+=String(o))})}a(SGc,"consumeStream");function TGc(t,e,r){let{timeout:n,method:o}=r,s=r.headers??{},c=r.json?JSON.stringify(r.json):r.body;return r.json&&(s["content-type"]="application/json"),{url:t,headers:s,body:c,timeout:n,method:o,workDoneToken:e}}a(TGc,"convertOptionsToParams");var IGc=b.Object({url:b.String(),headers:b.Optional(b.Record(b.String(),b.String())),body:b.Optional(b.String()),timeout:b.Optional(b.Number()),method:b.Optional(b.Union([b.Literal("GET"),b.Literal("POST"),b.Literal("DELETE")])),cancelBeforeRequest:b.Optional(b.Boolean()),cancelAfterRequest:b.Optional(b.Boolean()),cancelAfterFirstChunk:b.Optional(b.Boolean())});async function xGc(t,e,r){let n=new fCe(t),o=new AbortController,s=o.signal,{url:c,cancelBeforeRequest:l,cancelAfterRequest:u,cancelAfterFirstChunk:d,...f}=r;l&&o.abort();let h=n.fetch(c,{signal:s,...f});u&&o.abort();let m;try{m=await h}catch(y){return[{error:`Fetch stream error: ${y instanceof bB?y.message:String(y)}`},null]}let{status:g}=m,A=Object.fromEntries(Array.from(m.headers));try{if(d){let _=m.body();for await(let E of _){let v=E.toString();return o.abort(),[{status:g,headers:A,body:v},null]}}let y=await m.text();return[{status:g,headers:A,body:y},null]}catch(y){return[{error:`Fetch stream error: ${y instanceof bB?y.message:String(y)}`},null]}}a(xGc,"handleTestingFetchChecked");var hro=we(IGc,xGc);p();var wGc=b.Object({});async function RGc(t,e,r){return await t.get(Ud).flush(),["OK",null]}a(RGc,"handleTestingFlushPromiseQueueChecked");var mro=we(wGc,RGc);p();p();p();var UW=class{static{a(this,"FileSearch")}};p();p();p();var Dwt=class{constructor(e){this.maxDegreeOfParalellism=e;this.outstandingPromises=[],this.runningPromises=0}static{a(this,"PriorityLimiter")}queue(e,r=!1){return new Promise((n,o)=>{r?this.outstandingPromises.unshift({factory:e,c:n,e:o}):this.outstandingPromises.push({factory:e,c:n,e:o}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this.runningPromises--,this.outstandingPromises.length>0&&this.consume()}};var gro=fe(ii());var Nwt="main.js",Mwt=class{constructor(e,r,n=3){this.promiseResolvers=new Map;this.id=0;try{let o={cwd:process.cwd(),indexWorkspaceRoots:e,params:r};this.worker=lyn(Nwt,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new Dwt(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new Mze(this.id++),gro.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new Pze(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new Dze(this.id++,e),r)}getContext(e,r,n,o,s,c){return this.postMessageInQueue(new Nze(this.id++,e,r,n,o,s),c,!0)}tryCreateIndex(e,r,n){return this.postMessageInQueue(new Rze(this.id++,e,r),n)}async postMessageInQueue(e,r,n=!1){return this.postMessageQueue.queue(()=>this.postMessageAndWait(e,r),n)}tryRemoveIndex(e,r){return this.postMessageAndWait(new kze(this.id++,e),r)}async postMessageAndWait(e,r){if(this.fatalError)return Promise.reject(this.fatalError);let n=new Promise((s,c)=>{this.promiseResolvers.set(e.id,{resolve:s,reject:c})});this.worker.postMessage(e);let o=r.onCancellationRequested(()=>{this.worker.postMessage(new wze(e.id))});try{return await n}finally{o.dispose()}}handleWorkerMessage(e){if(e.operation!=="response")throw new Error("Unexpected message operation");let r=this.promiseResolvers.get(e.id);if(!r)throw new Error(`Received response for message that isn't in progress: ${e.id}`);this.promiseResolvers.delete(e.id),e.error?(e.error.code=e.code,r.reject(e.error)):r.resolve(e.data)}handleUnexpectedError(e){let r;if(e instanceof Error){r=e,r.code==="MODULE_NOT_FOUND"&&r.message?.endsWith(Nwt+"'")&&(r=new Error(`Failed to load ${Nwt}`),r.code="CopilotPromptLoadFailure");let n=new Error().stack;r.stack&&n?.match(/^Error\n/)&&(r.stack+=n.replace(/^Error/,""))}else e&&typeof e=="object"&&"name"in e&&"status"in e&&e.name==="ExitStatus"&&typeof e.status=="number"?(r=new Error(`${Nwt} exited with status ${e.status}`),r.code=`CopilotPromptWorkerExit${e.status}`):r=new Error(`Non-error thrown: ${JSON.stringify(e)}`);for(let n of this.promiseResolvers.values())n.reject(r);this.promiseResolvers.clear(),this.fatalError=r}};var a6e=fe(ii());var C9=new pe(Jgr),Owt=class{constructor(e,r,n,o,s){this.ctx=e;this.watcher=r;this.workspaceDatabasePersistenceManager=n;this.workspaceInit=new Map;this.watcher.onFileChange(async(c,l)=>{await this.indexFile(l,this.languageId(l)??"plaintext")}),this.watcher.onWorkspaceChange(async(c,l)=>{if(c===1){C9.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,a6e.CancellationToken.None);return}C9.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new Mwt(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{C9.debug(this.ctx,`workspace ${l} indexed`),this.workspaceInit.delete(l)}))}}static{a(this,"MultiLanguageContextIndexWatcher")}isInitializing(e){for(let[r]of this.workspaceInit)if(e.startsWith(r))return!0;return!1}dispose(){return this.indexClient.dispose()}async indexAddedWorkspace(e){let r=await kGc(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,a6e.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{C9.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){C9.debug(this.ctx,`indexing workspace ${e}`);let r=P9t.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${P9t.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get(UW),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,a6e.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));C9.debug(this.ctx,`found ${d.length} files to index in ${e}`),await Promise.all(d.map(async f=>{let h=this.languageId(f);h&&await this.indexFile(f.replace(/\/+$/,""),h)})),C9.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{C9.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,a6e.CancellationToken.None)}catch(n){C9.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return u0n(e)}};async function kGc(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(kGc,"createIndexableWorkspaceFolder");var PGc=b.Object({filePath:b.String(),code:b.String(),offset:b.Number(),languageId:b.String(),timeout:b.Optional(b.Number()),waitForContext:b.Optional(b.Boolean())});async function DGc(t,e,r){try{await t.get(dT).start();let n=t.get(Owt),o=r.timeout??1e3,s=Date.now(),c=[],l=!0;for(;l;)try{c=await n.indexClient.getContext(r.filePath,r.code,r.offset,r.languageId,Zgr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(LGc,"handleTestingNeverAuthChecked");var z9r=we(OGc,LGc);p();p();p();var Y9r=class extends bp{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},_ro=a(t=>new Y9r(t),"createTestCertificateReader");function J9r(t,e,r){let n=new K9r;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new kx(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(J9r,"createFakeResponse");function Ero(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),J9r(t,n,Object.assign({"content-type":"application/json"},r))}a(Ero,"createFakeJsonResponse");var c6e=class extends Jt{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var Lwt=class extends c6e{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var K9r=class{constructor(){this.headers=new Map}static{a(this,"FakeHeaders")}append(e,r){this.headers.set(e.toLowerCase(),r)}delete(e){this.headers.delete(e.toLowerCase())}get(e){return this.headers.get(e.toLowerCase())??null}has(e){return this.headers.has(e.toLowerCase())}set(e,r){this.headers.set(e.toLowerCase(),r)}entries(){return this.headers.entries()}keys(){return this.headers.keys()}values(){return this.headers.values()}[Symbol.iterator](){return this.headers.entries()}};var Z9r=class extends c6e{static{a(this,"ExpConfigFetcher")}constructor(e){super(),this.fullConfig={Features:[],Flights:{},Configs:[{Id:"vscode",Parameters:e.Parameters}],ParameterGroups:[],AssignmentContext:e.AssignmentContext}}fetch(e,r){return e.endsWith("telemetry")?Promise.resolve(Ero(200,this.fullConfig)):Promise.resolve(J9r(404,""))}},Bwt=class extends Z9r{constructor(r,n){super(r);this.delegate=n}static{a(this,"ExpConfigFetcherWithDelegate")}fetch(r,n){return r.endsWith("telemetry")?super.fetch(r,n):this.delegate.fetch(r,n)}};var BGc=b.Object({expFlags:b.Record(b.String(),b.Union([b.String(),b.Number(),b.Boolean()]))});function FGc(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(Jt,new Bwt(n,t.get(Jt)))}return["OK",null]}a(FGc,"handleTestingOverrideExpFlagsChecked");var vro=we(BGc,FGc);p();var UGc=b.Object({rules:dqt});function QGc(t,e,r){return t.get(pc).setTestingRules(r.rules),["OK",null]}a(QGc,"handleTestingSetContentExclusionRulesChecked");var Cro=we(UGc,QGc);p();var qGc=b.Object({workDoneToken:b.Union([b.String(),b.Number()]),chunks:b.Array(b.String()),followUp:b.Optional(b.String()),suggestedTitle:b.Optional(b.String()),skills:b.Optional(b.Array(b.String())),references:b.Optional(b.Array(A5)),options:b.Optional(b.Object({}))});function jGc(t,e,r){return t.get(b9).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(jGc,"handleTestingSetSyntheticTurnsChecked");var bro=we(qGc,jGc);p();var HGc=b.Object({});async function GGc(t,e,r){let n=t.get(ss),o=t.get(Jf);return await n.showWarningMessage("This is a test message",{title:"Some Action"}).then(c=>s(3,"response from message request",c?.title)).catch(c=>s(1,"error sending show message request",c)),["OK",null];function s(c,l,u){return o.logIt(t,c,"triggerShowMessage",`${l} (${String(u)})`)}a(s,"sendNotification")}a(GGc,"handleTriggerShowMessageChecked");var Sro=we(HGc,GGc);p();p();p();p();var Tro=fe(require("tls"));var hCe=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(bp)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=Tro.createSecureContext({_vscodeAdditionalCaCerts:e}),o=n.context;for(let s of e)o.addCACert(s);return{secureContext:n,certs:e}}async applyToRequestOptions(e){this.#e??=this.createSecureContext();let r=await this.#e;e.secureContext=r.secureContext,e.ca=r.certs,e.cert=r.certs}};p();var Bro=fe(require("http"));var m$c=407,Gy=new pe("proxySocketFactory"),Uk=class{static{a(this,"ProxySocketFactory")}},Poe=class extends Error{static{a(this,"ProxySocketError")}constructor(e,r,n){super(e),this.code=r?.code,this.syscall=r?.syscall,this.errno=r?.errno,/^Failed to establish a socket connection to proxies:/.test(r?.message??"")?this.code="ProxyFailedToEstablishSocketConnection":/^InitializeSecurityContext:/.test(r?.message??"")?this.code="ProxyInitializeSecurityContext":r?.message==="Miscellaneous failure (see text): Server not found in Kerberos database"?this.code="ProxyKerberosServerNotFound":/^Unspecified GSS failure. {2}Minor code may provide more information: No Kerberos credentials available/.test(r?.message??"")&&(this.code="ProxyGSSFailureNoKerberosCredentialsAvailable"),n!==void 0&&(this.code=n);let o=/^ProxyStatusCode(\d+)$/.exec(this.code??"");o&&(this.statusCode=Number(o[1]))}};function Fwt(t){return new t7r(t,new r7r(t))}a(Fwt,"getProxySocketFactory");var t7r=class extends Uk{constructor(r,n,o=new u6e,s=process.platform){super();this.ctx=r;this.delegate=n;this.kerberosLoader=o;this.platform=s;this.successfullyAuthorized=new Sn(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(Gy.debug(this.ctx,"Proxy authorization already successful once, skipping 407 round trip"),await this.reauthorize(r,n));try{return await this.delegate.createSocket(r,n)}catch(o){if(o instanceof Poe&&o.code===`ProxyStatusCode${m$c}`){Gy.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return Gy.debug(this.ctx,"Proxy authorization successful, caching result"),ft(this.ctx,"proxy.kerberosAuthorized"),this.successfullyAuthorized.set(this.getProxyCacheKey(n),!0),s}throw o}}async reauthorize(r,n){let o=await this.authorize(n);o&&(Gy.debug(this.ctx,"Proxy re-authorization successful, received token"),r.headers["Proxy-Authorization"]="Negotiate "+o)}async authorizeAndCreateSocket(r,n){let o=await this.authorize(n);if(Gy.debug(this.ctx,"Proxy authorization successful, received token"),o)return Gy.debug(this.ctx,"Trying to create socket with proxy authorization"),r.headers["Proxy-Authorization"]="Negotiate "+o,await this.delegate.createSocket(r,n)}async authorize(r){Gy.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);Gy.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);Gy.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return Gy.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return Gy.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return Gy.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},r7r=class extends Uk{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(As).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{Gy.debug(this.ctx,"Attempting to establish connection to proxy");let l=Bro.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{Gy.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new Poe(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new Poe(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(Gy.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{Gy.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new Poe(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{Gy.debug(this.ctx,"Proxy socket connection timeout"),c(new Poe(`tunneling socket could not be established, proxy socket connection timeout while connecting to ${o.hostname}:${o.port}`,void 0,"ProxyTimeout"))}),l.end()})}createConnectRequestOptions(r,n){let o=`${r.hostname}:${r.port}`,s={hostname:n.hostname,port:n.port,method:"CONNECT",path:o,agent:!1,headers:{host:o,"Proxy-Connection":"keep-alive","User-Agent":this.userAgent},timeout:r.timeout};return r.localAddress&&(s.localAddress=r.localAddress),this.configureProxyAuthorization(s,r,n.authorization),s}configureProxyAuthorization(r,n,o){r.headers["Proxy-Authorization"]=[],o&&r.headers["Proxy-Authorization"].push("Basic "+Buffer.from(o).toString("base64")),typeof n.headers?.["Proxy-Authorization"]=="string"&&r.headers["Proxy-Authorization"].push(n.headers["Proxy-Authorization"])}},u6e=class{static{a(this,"KerberosLoader")}load(){return Promise.resolve().then(()=>fe(Lro()))}};var Doe=class extends Jt{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new hCe(r),this.proxySocketFactory=r.get(Uk),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(Qo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(Qo).getHttpSettings()),this.updateNoProxy(r.get(Qo).getHttpSettings().noProxy),this.fetchApiByPass=this.createFetchApi(r,{proxy:""})}static{a(this,"HelixFetcher")}maybeCreateSocketFactory(r,n){if(!r?.proxy)return;let o=new URL(r.proxy);return async s=>(s.rejectUnauthorized=r.proxyStrictSSL,s.timeout=n,await this.certificateConfigurator.applyToRequestOptions(s),await this.proxySocketFactory.createSocket(s,{hostname:o.hostname,port:o.port,authorization:r.proxyAuthorization,kerberosServicePrincipal:r.proxyKerberosServicePrincipal}))}createFetchApi(r,n){let o=r.get(As),s=this.proxySocketTimeoutForTesting;return aro({userAgent:`GithubCopilot/${o.getVersion()}`,socketFactory:this.maybeCreateSocketFactory(n,s),rejectUnauthorized:n.proxyStrictSSL})}parseNoProxy(r){return r?.map(n=>n.trim()).filter(n=>n.length>0)||[]}updateNoProxy(r){if(this.noProxy=this.parseNoProxy(r),this.proxyExceptionFilters=void 0,!this.noProxy.length)return;if(this.noProxy.includes("*")){this.proxyExceptionFilters=[{regex:/.*/i}];return}let n=a(s=>{if(!s)return;s.startsWith(".")&&(s=`*${s}`);let c=s.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${c}$`,"i")}catch{return}},"toRegex"),o=[];for(let s of this.noProxy){let c=s,l;if(c.startsWith("[")){let d=c.indexOf("]");if(d!==-1){let f=c.slice(1,d),h=c.slice(d+1);h.startsWith(":")&&(l=h.slice(1)),c=f}}else{let d=c.split(":");d.length===2&&(c=d[0],l=d[1])}let u=n(c);u&&o.push({regex:u,port:l})}o.length&&(this.proxyExceptionFilters=o)}shouldBypassProxy(r){if(!this.proxyExceptionFilters||!this.proxyExceptionFilters.length)return!1;let n;try{n=new URL(r)}catch{return!1}let o=n.hostname;if(!o)return!1;let s=n.port||(n.protocol==="https:"?"443":"80"),c=o.toLowerCase();return this.proxyExceptionFilters.some(l=>l.regex.test(c)&&(!l.port||l.port===s))}async fetch(r,n){let o=n.signal,s=!1;if(n.timeout){let f=new AbortController;setTimeout(()=>{f.abort(),s=!0},n.timeout),n.signal?.addEventListener("abort",()=>f.abort()),n.signal?.aborted&&f.abort(),o=f.signal}let c={...n,body:n.body?n.body:n.json,signal:o},l=this.shouldBypassProxy(r);if(!l){await this.certificateConfigurator.applyToRequestOptions(c);let f=await this.certificateConfigurator.getCertificates();this.fetchApi.setCA(f)}let d=await(l?this.fetchApiByPass:this.fetchApi).fetch(r,c).catch(f=>{throw s?new Fz(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new kx(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var ACe=class extends ig{constructor(r,n={}){super();this.env=n;this.recalculateUrlDefaults(r,this.getDefaultUrls())}static{a(this,"DefaultNetworkConfiguration")}getAuthAuthority(){return this.baseUrlObject.hostname}getConfiguredUrls(){return{serverUrl:this.baseUrlObject.href,apiUrl:this.apiUrl}}setConfiguredUrls(r,n){let o=this.getConfiguredUrls();this.recalculateUrlDefaults(r,n);let s=this.getConfiguredUrls();(o.apiUrl!==s.apiUrl||o.serverUrl!==s.serverUrl)&&r.get(Qt).resetToken("config_urls_changed"),r.get(op).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=a_({serverUrl:XQe(r,n.serverUrl),apiUrl:XQe(r,n.apiUrl)});this.baseUrlObject=new URL(o),this.apiUrl=s}getDefaultUrls(){return this.env.CODESPACES==="true"&&this.env.GITHUB_TOKEN&&this.env.GITHUB_SERVER_URL&&this.env.GITHUB_API_URL&&!this.env.GITHUB_COPILOT_TOKEN&&!this.env.GH_COPILOT_TOKEN?{apiUrl:this.env.GITHUB_API_URL,serverUrl:this.env.GITHUB_SERVER_URL}:{}}};p();var g$c=new pe("expConfigManager"),A$c=3600*1e3,qW=class{constructor(e,r){this.ctx=e;this.fetchedAt=0;r.onDidChangeTokenResult(n=>{n.copilotToken&&this.refresh({force:!0})})}static{a(this,"ExpConfigManager")}getBoolean(e){let r=this.cached?.variables[e];return typeof r=="boolean"?r:void 0}getNumber(e){let r=this.cached?.variables[e];return typeof r=="number"?r:void 0}getString(e){let r=this.cached?.variables[e];return typeof r=="string"?r:void 0}getRaw(e){return this.cached?.variables[e]}refresh({force:e=!1}={}){return this.inflight?this.inflight:!e&&this.cached!==void 0&&Date.now()-this.fetchedAt{try{let{exp:r}=await this.ctx.get(tr).getFallbackExpAndFilters();this.cached=r,this.fetchedAt=Date.now()}catch(r){g$c.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};p();var yCe=class extends MB{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){Ma(e,r,n)}};p();var _Ce=class extends z4{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var Uwt=class extends C2{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var Qwt=class extends dm{constructor(){super(...arguments);this.prompts=[];this.fetchResults=[];this.diffs=[]}static{a(this,"TestConversationInspector")}shouldInspect(){return!0}inspectPrompt(r){this.shouldInspect()&&this.prompts.push(r)}inspectFetchResult(r){this.shouldInspect()&&this.fetchResults.push(r)}documentDiff(r){this.shouldInspect()&&this.diffs.push(r)}};p();var qwt=class extends UW{constructor(){super(...arguments);this.allowedFiles=[]}static{a(this,"TestingFileSearch")}addAllowedFiles(r){this.allowedFiles.push(...r)}findFiles(r,{uri:n},o){return Promise.resolve(this.allowedFiles)}};p();function Fro(t,e="cl100k_base"){return{modelId:"gpt-3.5-turbo",modelFamily:t,uiName:"Test GPT",maxRequestTokens:6144,maxResponseTokens:2048,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:e,isExperimental:!1,stream:!0,toolCalls:!0}}a(Fro,"fakeChatModelConfiguration");function y$c(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a(y$c,"fakeEmbeddingModelConfiguration");var jwt=class extends dl{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(Fro(r))}getModelConfigurationById(e){return Promise.resolve({...Fro(e),modelId:e})}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve(y$c(e))}};p();var Hwt=class extends og{constructor(){super(...arguments);this.openedUrls=[];this.opened=new UA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},Gwt=class extends ss{constructor(){super();this.sentMessages=[];this.warningPromises=[];this.informationPromises=[]}static{a(this,"TestNotificationSender")}performDismiss(){this.actionToPerform="DISMISS"}performAction(r){this.actionToPerform=r}showWarningMessage(r,...n){this.sentMessages.push(r);let o;if(this.actionToPerform)if(this.actionToPerform==="DISMISS")o=Promise.resolve(void 0);else{let s=n.find(c=>c.title===this.actionToPerform);o=s?Promise.resolve(s):Promise.resolve(void 0)}else o=n?Promise.resolve(n[0]):Promise.resolve(void 0);return this.warningPromises.push(o),o}showInformationMessage(r,...n){this.sentMessages.push(r);let o;if(this.actionToPerform)if(this.actionToPerform==="DISMISS")o=Promise.resolve(void 0);else{let s=n.find(c=>c.title===this.actionToPerform);o=s?Promise.resolve(s):Promise.resolve(void 0)}else o=n?Promise.resolve(n[0]):Promise.resolve(void 0);return this.informationPromises.push(o),o}showInformationModal(r,...n){return this.showInformationMessage(r,...n)}sendBackgroundAgentSessionUpdate(r,n,o,s){return Promise.resolve()}sendBackgroundAgentTodosChanged(r){return Promise.resolve()}async waitForMessages(){await Promise.all(this.warningPromises),await Promise.all(this.informationPromises)}};p();function Uro(t,e,r,n){return iT.create(ZQe(t),e,r,n,e)}a(Uro,"createTextDocument");var n7r=class extends $r{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new Ji;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new Ji;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new Ji;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new Ji;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new Ji;this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event}static{a(this,"SimpleTestTextDocumentManager")}init(r){this._workspaceFolders=r.map(n=>({uri:n.uri,name:n.name??ro(n.uri)}))}async readTextDocumentFromDisk(r){return super.readTextDocumentFromDisk(r)}getTextDocumentsUnsafe(){return this._openTextDocuments}setTextDocument(r,n,o){let s=Uro(r,n,0,o);return this._openTextDocuments.push(s),s}updateTextDocument(r,n){let o=this._openTextDocuments.findIndex(c=>c.uri===r.toString());if(o<0)throw new Error("Document not found");let s=this._openTextDocuments[o];this._openTextDocuments[o]=Uro(r,s.clientLanguageId,s.version+1,n)}setNotebookDocument(r,n){this._notebookDocuments.set(r.uri.replace(/#.*/,""),n)}findNotebook({uri:r}){return this._notebookDocuments.get(r.replace(/#.*/,""))}getWorkspaceFolders(){return this._workspaceFolders}},$wt=class extends n7r{constructor(r){super(r);this.contents=new Map}static{a(this,"TestTextDocumentManager")}readTextDocumentFromDisk(r){return Promise.resolve(this.contents.get(r))}setDiskContents(r,n){this.contents.set(r,n)}};var i7r=class extends Jf{static{a(this,"NullLog")}logIt(...e){}},o7r=class extends Fr{static{a(this,"TestAuthManager")}constructor(e,r){super(e,{}),this.transientSession=r&&Promise.resolve(r)}resolvePersistedSession(){return Promise.resolve(void 0)}signInEditor(e){return Promise.resolve({status:"OK",user:"test-user"})}signOutEditor(){return Promise.resolve({status:"NotSignedIn"})}revokeTokenById(){return Promise.resolve({affectedEditors:0})}useExistingToken(e){return Promise.resolve({status:"revoked"})}listAvailableTokens(){return Promise.resolve([])}};function _$c(t){let e=new tde;e.set(Qo,t),e.set(PK,t);let r=new o7r(e,{accessToken:"",login:"user"});e.set(Fr,r),e.set(As,new As),e.set(up,new up),e.set(hx,new hx({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(bp,_ro([])),e.set(Uk,Fwt(e)),e.set(HC,new HC),e.set(qP,new lGe);let n=new sCe;e.set($h,n);let o=new Qt(e,!0);e.set(Qt,o);let s=new Gp(e);return s.updateFromToken(n.defaultToken),e.set(Gp,s),e.set(c0,new c0),e.set(PM,new PM),e.set(ss,new Gwt),e.set(og,new Hwt),e.set(MB,new yCe),e.set(Jf,new i7r),e.set(jC,new jC),e.set(za,new za("test-session","test-machine","test-device")),e.set(fx,new fx(()=>Promise.resolve("test-device"))),e.set(ig,new ACe(e)),e.set(sP,new yse),e.set(op,new op(e,"copilot-test")),e.set(tr,new tr(e)),e.set(qW,new qW(e,o)),e.set(AD,new AD),e.set(t2,new iue),e.set(ks,new iGe),e.set(Ud,new Ud),e.set(M4,new M4(e)),e.set(UW,new qwt),e.set(SD,new SD(e)),e.set(c6,Zpt(e)),e.set(_y,new _y),e.set(Xb,new Xb),e.set(l6,l6.default),e.set(cw,new cw(e,!1)),e.set(ih,new ih),e.set(si,new si(e)),e.set(fI,new tht),e.set(Rm,new Rm),e.set(km,fft(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(eS,new eS(e)),E$c(e),e.set(Zb,new Zb(e)),e.set(Nn,new Nn),e.set(z4,new _Ce),e.set(XN,new XN),e.set(Hw,new Hw),e.set(kT,new kT(e)),e}a(_$c,"_createBaselineContext");function E$c(t){t.set(Xo,new Xo(t)),t.set(Bc,new Bc(t)),t.set(jA,new jA(t)),t.set(fm,new fm),t.set(I0,new I0),t.set(dm,new Qwt),t.set(Bk,new Bk(t,[])),t.set(dl,new jwt),t.set(C2,new Uwt),t.set(m5,new m5(t));let e=new oM(t);t.set(oM,e),t.set(Lk,new Lk(e,t)),t.set(T5,new T5(t)),t.set(KI,new Dxt),t.set(Cb,new Cb(t.get(Lk),t.get(KI),t)),t.set(xg,new xg)}a(E$c,"registerConversation");function Qro(){let t=_$c(new PK(new oue,new Map));return t.set(Jt,new Lwt),t.set(Ir,new s7r),t.set($r,new $wt(t)),t.set(Go,new aq),t.set(pc,new pc(t)),t.set(Ru,new Ru(t)),t.set(pT,new tJe),t.set(KO,new KO(t)),t.set(O4,new Sge),t.set(hD,new Bdt),t.set(eu,new BKe),t.set(QA,new QA(t)),t.set(_g,new CKe),t.set(wm,new wm),vKe(t),t.set(Ay,new FEe(t)),t}a(Qro,"createLibTestingContext");var s7r=class extends Ir{constructor(r={name:"lib-tests-plugin",version:"2"},n={name:"lib-tests-editor",version:"1"},o=[{name:"lib-tests-related-plugin",version:"3"}]){super();this.editorPluginInfo=r;this.editorInfo=n;this.relatedPluginInfo=o}static{a(this,"LibTestsEditorInfo")}getEditorInfo(){return this.editorInfo}getEditorPluginInfo(){return this.editorPluginInfo}getRelatedPluginInfo(){return this.relatedPluginInfo}};var jro=fe(require("fs"));var qro=`${process.env.HOME}/.copilot-testing-gh-token`,Vwt,Wwt;function Hro(t){let e=Gro(),r=new hwt(v$c);return t.forceSet($h,r),t.get(Fr).setTransientSession(e),r}a(Hro,"setIntegrationTokenManager");var v$c=a(async()=>{if(Wwt)return Wwt;let t=await Gro(),e=Qro(),r=new Doe(e);return e.forceSet(Jt,r),Wwt=IOt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new Ei('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),Wwt},"getEnvelope");async function Gro(){let{session:t}=cGe(process.env);if(t)return t;try{Vwt??=(await jro.promises.readFile(qro)).toString().trim()}catch{Vwt??=process.env.GITHUB_TOKEN??""}if(!Vwt)throw new Error(`Tests: either GH_COPILOT_TOKEN, GITHUB_COPILOT_TOKEN, or GITHUB_TOKEN must be set, or there must be a GitHub token from an app with access to Copilot in ${qro}. Run "npm run get_token" to get one.`);return{...a_({}),accessToken:Vwt,login:"copilot-client tests"}}a(Gro,"getTestingGitHubSession");var C$c=b.Object({options:b.Optional(b.Object({})),githubAppId:b.Optional(b.String())});async function b$c(t,e,r){return Hro(t),await t.get(Qt).primeToken(),["OK",null]}a(b$c,"handleTestingUseTestingTokenChecked");var $ro=we(C$c,b$c);p();var S$c=b.Object({});async function T$c(t,e,r){return await new qEe().uninstall(t),["OK",null]}a(T$c,"handleUninstallChecked");var Vro=we(S$c,T$c);p();var I$c=dsi;function x$c(t,e,r){let n=t.get(km),o={unregistered:[],notUnregistered:[]};return r.providers.forEach(s=>{try{n.unregisterContextProvider(s.id),o.unregistered.push(s.id)}catch{o.notUnregistered.push(s.id)}}),[o,null]}a(x$c,"unregisterContextProviders");var Wro=we(I$c,x$c);p();var a7r=fe(require("os"));var w$c=b.Object({expectedCertificate:b.String()});async function R$c(t,e,r){let o=(await jat(t).getAllRootCAs()).map(tCe),s=tCe(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${n9r(s)}. Only found those installed on the system:${a7r.EOL}${o.map(c=>"- "+n9r(c)).join(a7r.EOL)}`},null]}a(R$c,"handleVerifyCertificateChecked");var zro=we(w$c,R$c);p();var k$c=b.Object({});async function P$c(){return[{status:!!await new u6e().load()},null]}a(P$c,"handleVerifyKerberosChecked");var Yro=we(k$c,P$c);p();var D$c=b.Object({source:b.String(),version:b.Number(),uri:b.String()});async function N$c(t,e,r){let o=await t.get($r).getTextDocument(r);return o?o.getText()!==r.source?[{status:!1,message:`Source mismatch: [State] ${o.getText()} !== [Request] ${r.source}`},null]:o.version!==r.version?[{status:!1,message:`Version mismatch: [State] ${o.version} !== [Request] ${r.version}`},null]:[{status:!0,message:""},null]:[{status:!1,message:`Document not found: <${r.uri}>`},null]}a(N$c,"handleVerifyStateChecked");var Kro=we(D$c,N$c);p();var M$c=b.Object({});function O$c(t,e,r){return[t.get($r).getWorkspaceFolders().map(o=>{let s=new URL(o.uri),c=decodeURIComponent(s.pathname);return{...o,path:c}}),null]}a(O$c,"handleVerifyWorkspaceStateChecked");var Jro=we(M$c,O$c);p();p();var vCe=fe(require("fs/promises")),Zro=fe(require("os")),ff=fe(require("path"));var jp=new pe("GitWorktreeService"),L$c=20,ECe=class{constructor(e){this.ctx=e;this.gitInstances=new Sn(L$c)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=ff.resolve(e),n=this.gitInstances.get(r);return n||(n=Qde(r),this.gitInstances.set(r,n)),n}generateTimestamp(){return new Date().toISOString().replace(/[:.]/g,"-").slice(0,19)}async runGitOperation(e,r,n,o){let s=ff.resolve(e);jp.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return jp.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw jp.error(this.ctx,`[git] ${r} failed for ${s}: ${l}`),c}}async isGitRepository(e){try{return await this.runGitOperation(e,"checkIsRepo",r=>r.checkIsRepo(),r=>`isRepo=${r}`)}catch{return!1}}async getHeadCommit(e){return(await this.runGitOperation(e,"rev-parse HEAD",n=>n.raw(["rev-parse","HEAD"]),n=>`head=${n.trim()}`)).trim()}async commitWorktreeChanges(e,r,n){let o=await this.runGitOperation(e,"status",s=>s.status(),s=>`files=${s.files.length}`);return o.files.length===0?(jp.info(this.ctx,`Skipping checkpoint commit for ${ff.resolve(e)} because there are no changes`),!1):(await this.runGitOperation(e,"add -A -- .",s=>s.raw(["add","-A","--","."])),await this.runGitOperation(e,`commit ${r}`,s=>s.commit(r)),jp.info(this.ctx,`Created ${n} commit for ${ff.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){jp.info(this.ctx,`Snapshotting copied changes in ${ff.resolve(e)} to establish the apply baseline`),await this.commitWorktreeChanges(e,"chore: snapshot copied worktree changes","copied worktree changes");let r=await this.getHeadCommit(e);return jp.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await vCe.mkdtemp(ff.join(Zro.tmpdir(),"copilot-worktree-")),o=ff.join(n,"changes.patch");try{jp.info(this.ctx,`Writing temporary patch for ${ff.resolve(e)} to ${o} (${r.length} chars)`),await vCe.writeFile(o,r,"utf8"),await this.runGitOperation(e,`apply --check ${o}`,s=>s.raw(["apply","--check",o])),await this.runGitOperation(e,`apply ${o}`,s=>s.raw(["apply",o]))}finally{await vCe.rm(n,{recursive:!0,force:!0}),jp.info(this.ctx,`Removed temporary patch file ${o}`)}}async createWorktree(e){let{repositoryPath:r}=e;if(!await this.isGitRepository(r))throw new Error(`${r} is not a git repository`);let s=(await this.runGitOperation(r,"branch",g=>g.branch(),g=>`current=${g.current||"HEAD"}`)).current||"HEAD",c=await this.getHeadCommit(r),l=this.generateTimestamp(),u=`copilot/worktree-${l}`,d=`copilot-worktree-${l}`,f=ff.basename(r),h=ff.join(ff.dirname(r),`${f}.worktrees`),m=ff.join(h,d);return jp.info(this.ctx,`Preparing worktree creation for ${ff.resolve(r)} with branch ${u}, baseBranch ${s}, baseCommit ${c}`),await this.runGitOperation(r,`worktree add -b ${u} ${m} ${s}`,g=>g.raw(["worktree","add","-b",u,m,s])),jp.info(this.ctx,`Created worktree ${m} from ${ff.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){jp.info(this.ctx,`Preparing to remove worktree ${e} from ${ff.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),jp.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return jp.info(this.ctx,`Skipping status lookup for ${ff.resolve(e)} because it is not a git repository`),[];let r=await this.runGitOperation(e,"status",n=>n.status(),n=>`files=${n.files.length}`);return[...new Set(r.files.map(n=>n.path))]}async applyWorktreeChanges(e,r,n){jp.info(this.ctx,`Applying worktree changes from ${ff.resolve(e)} to ${ff.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");jp.info(this.ctx,o?`Committed pending worktree changes in ${ff.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${ff.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return jp.info(this.ctx,"No new commits to apply from worktree"),{baseCommit:s};let c=await this.runGitOperation(e,`diff --binary --full-index ${n}..${s}`,l=>l.raw(["diff","--binary","--full-index",`${n}..${s}`]),l=>`outputLength=${l.length}`);if(!c.trim())return jp.info(this.ctx,"No patch content to apply from worktree"),{baseCommit:s};try{await this.applyPatchToRepository(r,c)}catch(l){let u=l instanceof Error?l.message:String(l);throw new Error(`Failed to apply worktree patch: ${u}`)}return jp.info(this.ctx,`Applied worktree patch from ${n} to ${s}`),{baseCommit:s}}async stash(e){await this.runGitOperation(e,"stash push --include-untracked",r=>r.stash(["push","--include-untracked"])),jp.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),jp.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),jp.info(this.ctx,`Popped stash in ${e}`)}};p();var Xro=fe(ii());var ZS=new pe("WorktreeService");var B$c=new Xro.ProtocolRequestType("worktree/requestUserDecision"),d6e=class{constructor(e,r){this.ctx=e;this.gitService=r}static{a(this,"WorktreeService")}async requestUserDecision(e){let r=await this.gitService.getUncommittedChanges(e);if(r.length===0)return ZS.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";ZS.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(er).connection.sendRequest(B$c,{type:"uncommitted-changes",title:"Handle Uncommitted Changes",message:`You have ${r.length} uncommitted changes. How would you like to proceed?`,options:[{id:"copy",label:"Copy changes",description:"Copy uncommitted changes into the new worktree",recommended:!0},{id:"move",label:"Move changes",description:"Move uncommitted changes to the new worktree and clean the original"},{id:"skip",label:"Skip changes",description:"Create worktree from clean state, leave local changes untouched"},{id:"cancel",label:"Cancel",description:"Cancel worktree creation",destructive:!0}],defaultOption:"copy"});return o.cancelled?(ZS.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(ZS.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){ZS.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(ZS.info(this.ctx,`Stashing original repository changes before worktree creation for ${e}`),await this.gitService.stash(e));let o;try{o=await this.gitService.createWorktree({repositoryPath:e})}catch(s){throw n&&(ZS.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(ZS.info(this.ctx,`Migrating changes into worktree ${o.worktreePath} using strategy ${r}`),r==="copy"){await this.gitService.stashApply(o.worktreePath),await this.gitService.stashPop(e);let s=await this.gitService.snapshotCopiedChanges(o.worktreePath);o={...o,baseCommit:s},ZS.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);ZS.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw ZS.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return ZS.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){ZS.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return ZS.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var F$c="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",U$c=["already exists in working directory","patch does not apply","patch failed"];function Q$c(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&U$c.some(n=>e.includes(n))?F$c:`Failed to apply worktree changes: ${e}`}a(Q$c,"getWorktreeCompleteErrorMessage");var q$c=b.Object({repositoryPath:b.String()});async function j$c(t,e,r){try{let n=new ECe(t),o=new d6e(t,n),s=await o.requestUserDecision(r.repositoryPath);if(s==="cancel")return[{success:!1,error:"Worktree creation cancelled by user"},null];let c=await o.createWorktree(r.repositoryPath,s);return[{success:!0,worktreePath:c.worktreePath,worktreeDirName:c.worktreeDirName,branchName:c.branchName,baseBranchName:c.baseBranchName,baseCommit:c.baseCommit},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to create worktree: ${o}`}]}}a(j$c,"handleWorktreeCreateChecked");var eno=we(q$c,j$c),H$c=b.Object({repositoryPath:b.String(),worktreePath:b.String(),baseCommit:b.String()});async function G$c(t,e,r){try{let n=new ECe(t);return[{success:!0,baseCommit:(await new d6e(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:Ze.InternalError,message:Q$c(n)}]}}a(G$c,"handleWorktreeCompleteChecked");var tno=we(H$c,G$c),$$c=b.Object({worktreePath:b.String(),repositoryPath:b.String()});async function V$c(t,e,r){try{return await new ECe(t).removeWorktree(r.worktreePath,r.repositoryPath),[{success:!0},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to delete worktree: ${o}`}]}}a(V$c,"handleWorktreeDeleteChecked");var rno=we($$c,V$c);var Noe=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function nno(){let t=new Map;return t.set(jXi.method,HXi),t.set("getCompletions",wXi),t.set("getCompletionsCycling",RXi),t.set("getDefaultFileSafetyRules",kXi),t.set("copilot/parseTerminalCommand",Ceo),t.set("getPanelCompletions",NXi),t.set(eXi.method,tXi),t.set("getVersion",OXi),t.set("getUserInfo",MXi),t.set("setEditorInfo",Qeo),t.set("checkStatus",uZi),t.set("checkQuota",lZi),t.set("checkFileStatus",aZi),t.set("claude/checkCliCompatibility",nZi),t.set("codex/checkCliCompatibility",sZi),t.set("signInInitiate",u9r),t.set("signIn",u9r),t.set("signInWithCodeFlow",Yeo),t.set("signInWithDeviceFlow",Zeo),t.set("signInConfirm",qeo),t.set("signInWithGithubToken",Xeo),t.set("signOut",eto),t.set("auth/listAvailableTokens",_Yi),t.set("auth/removeToken",EYi),t.set("auth/useExistingToken",vYi),t.set("notifyShown",veo),t.set("notifyAccepted",yeo),t.set("notifyRejected",Eeo),t.set("notifyNextEditRejected",_eo),t.set("telemetry/exception",tto),t.set("textDocument/copilotInlineEdit",Aeo),t.set("testing/overrideExpFlags",vro),t.set("testing/alwaysAuth",_9r),t.set("testing/setAlwaysAuthed",_9r),t.set("testing/neverAuth",z9r),t.set("testing/setNeverAuthed",z9r),t.set("testing/useTestingToken",$ro),t.set("testing/setCompletionDocuments",SXi),t.set("testing/setPanelCompletionDocuments",ZZi),t.set("testing/setNextEditDocument",feo),t.set("testing/triggerShowMessageRequest",Sro),t.set("testing/flushPromiseQueue",mro),t.set("testing/getDocument",yro),t.set("testing/chatml",rto),t.set("testing/setSyntheticTurns",bro),t.set("testing/fetch",hro),t.set("testing/setContentExclusionRules",Cro),t.set("testing/getContext",Aro),t.set("uninstall",Vro),t.set("debug/diagnostics",fXi),t.set("debug/listCertificates",GXi),t.set("debug/verifyState",Kro),t.set("debug/verifyCertificate",zro),t.set("debug/verifyKerberos",Yro),t.set("debug/verifyWorkspaceState",Jro),t.set("debug/getAgentDebugLogPath",_Xi),t.set("debug/exportAgentDebugLogToPath",yXi),t.set("context/registerProviders",Leo),t.set("context/unregisterProviders",Wro),t.set("conversation/preconditions",wZi),t.set("conversation/persistence",xZi),t.set("conversation/create",bZi),t.set("conversation/turn",DZi),t.set("conversation/turnDelete",NZi),t.set("conversation/destroy",SZi),t.set("conversation/compress",_Zi),t.set("conversation/rating",RZi),t.set("conversation/copyCode",AZi),t.set("conversation/insertCode",yZi),t.set("conversation/templates",PZi),t.set("conversation/modes",TZi),t.set("conversation/agents",gZi),t.set("conversation/registerTools",kZi),t.set("conversation/unregisterTools",MZi),t.set("conversation/updateToolsStatus",OZi),t.set("conversation/notifyCodeAcceptance",IZi),t.set("customAgent/registerExtensionAgents",nXi),t.set("customAgent/unregisterExtensionAgents",iXi),t.set("copilot/customAgent/list",rXi),t.set("copilot/customSkill/list",aXi),t.set("copilot/customPrompt/list",sXi),t.set("copilot/customInstruction/list",oXi),t.set("copilot/hook/list",QXi),t.set("copilot/models",VZi),t.set("copilot/managedSettings/get",$Xi),t.set("copilot/models/getModelMetadataList",WZi),t.set("copilot/byok/saveModel",tZi),t.set("copilot/byok/deleteModel",bYi),t.set("copilot/byok/listModels",JJi),t.set("copilot/byok/saveApiKey",XJi),t.set("copilot/byok/deleteApiKey",CYi),t.set("copilot/byok/listApiKeys",IYi),t.set("copilot/byok/saveCustomProviderConfig",eZi),t.set("copilot/byok/listCustomProviderConfigs",xYi),t.set("copilot/byok/saveProviderConfig",rZi),t.set("copilot/byok/deleteProviderConfig",SYi),t.set("copilot/byok/listProviderConfigs",ZJi),t.set("copilot/setModelPolicy",zZi),t.set("copilot/codeReview/reviewChanges",BZi),t.set("copilot/codeReview/reviewSnippets",FZi),t.set("git/commitGenerate",LXi),t.set("thinking/generateTitle",LZi),t.set("mcp/getTools",QZi),t.set("mcp/updateToolsStatus",qZi),t.set("mcp/readResource",jZi),t.set("mcp/registry/listServers",ceo),t.set("mcp/registry/getServer",leo),t.set("mcp/registry/getAllowlist",deo),t.set("mcp/getPrompt",HZi),t.set("mcp/completePrompt",GZi),t.set("mcp/serverAction",$Zi),t.set("mcpGateway/listServers",JXi),t.set("mcpGateway/getServerDetails",ZXi),t.set("mcpGateway/serverAction",XXi),t.set("mcpGateway/applyConfig",KXi),t.set("plugins/list",Reo),t.set("plugins/install",xeo),t.set("plugins/installFromSource",weo),t.set("plugins/uninstall",Meo),t.set("plugins/enable",Ieo),t.set("plugins/disable",Teo),t.set("plugins/update",Oeo),t.set("plugins/marketplace/add",keo),t.set("plugins/marketplace/remove",Neo),t.set("plugins/marketplace/list",Deo),t.set("plugins/marketplace/browse",Peo),t.set("githubApi/searchPR",UXi),t.set("githubApi/cancelCodingAgent",fZi),t.set("cloudAgent/listSessions",mZi),t.set("cloudAgent/getSessionLogs",hZi),t.set("cloudAgent/createJob",pZi),t.set("cloudAgent/addPullRequestComment",dZi),t.set("githubApi/listPullRequestChangedFiles",BXi),t.set("worktree/create",eno),t.set("worktree/complete",tno),t.set("worktree/delete",rno),t.set("backgroundAgent/create",Yzi),t.set("backgroundAgent/send",gYi),t.set("backgroundAgent/truncateHistory",yYi),t.set("backgroundAgent/fork",tYi),t.set("backgroundAgent/destroy",Kzi),t.set("backgroundAgent/listModels",dYi),t.set("backgroundAgent/listSessions",cYi),t.set("backgroundAgent/resume",hYi),t.set("backgroundAgent/stop",AYi),t.set("backgroundAgent/interaction",oYi),t.set("backgroundAgent/enableRemote",eYi),t.set("backgroundAgent/disableRemote",Zzi),t.set("backgroundAgent/getRemoteStatus",nYi),t.set("backgroundAgent/getPlanPath",rYi),t.set("backgroundAgent/compactHistory",Vzi),new Noe(t)}a(nno,"getAllMethods");p();p();p();var ino=fe(s2());var $y=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new ino.NotificationType(this.name)}};var W$c=new pe("BackgroundAgent.notifications"),c7r=class extends $y{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=b.Object({sessionId:b.String(),event:b.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},l7r=class extends $y{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=b.Object({sessionId:b.String(),externalToolDefinitions:M8r})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){W$c.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(Ys).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},ono=[c7r,l7r];p();var u7r=class extends $y{constructor(){super(...arguments);this.name="copilot/didChangeToken";this.params=b.Unknown()}static{a(this,"DidChangeTokenNotificationHandler")}handle(){this.ctx.get(Qt).resetToken("did_change_token_notification")}},sno=[u7r];p();var z$c=new pe("agentCopilotTokenManager");function f7r(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(f7r,"tokenEndpointToApiUrl");function Y$c(t,e){if(!e.tokenEndpoint)return a_(e);let r=f7r(e.tokenEndpoint);return r||z$c.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),a_({apiUrl:r})}a(Y$c,"getUrlsFromParams");var d7r=class extends $y{constructor(){super(...arguments);this.name=KHt.method;this.params=KTn}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Fr),o=Y$c(this.ctx,r);this.ctx.get(ig).setConfiguredUrls(this.ctx,o);let s=r.handle||r.login;s&&r?.accessToken?n.setTransientSession({accessToken:r.accessToken,login:s,githubAppId:r.githubAppId,...o}):n.setTransientSession({githubAppId:r.githubAppId,...o})}},ano=[d7r];p();var p7r=class extends $y{constructor(){super(...arguments);this.name=rGt.method;this.params=iIn}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(Fu).get(n);s&&Nli(this.ctx,s)}},h7r=class extends $y{constructor(){super(...arguments);this.name=iGt.method;this.params=lIn}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(fC).handleShown(n)}},m7r=class extends $y{constructor(){super(...arguments);this.name=nGt.method;this.params=oIn}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(Fu),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),Zge(this.ctx,c)):cht(this.ctx,c,o,void 0,void 0,"cumulative"))}},cno=[p7r,h7r,m7r];p();var zwt=class extends $y{constructor(){super(...arguments);this.name="window/workDoneProgress/cancel";this.params=b.Object({token:b.Union([b.String(),b.Number()])})}static{a(this,"WorkDoneProgressCancelNotification")}handle(r){this.ctx.get(sM).cancel(r.token)}};p();var g7r=class extends $y{constructor(){super(...arguments);this.name="copilot/workspace/didChangeTrust";this.params=b.Object({items:b.Array(b.Object({folderUri:b.String(),trusted:b.Boolean()}))})}static{a(this,"WorkspaceDidChangeTrustNotificationHandler")}handle(r){let n=this.ctx.get(up);for(let o of r.items)n.setTrust(o.folderUri,o.trusted)}},lno=[g7r];var K$c=[...ono,...sno,...ano,...cno,...lno,zwt];function uno(t,e){for(let r of K$c){let n=new r(t),o=Zu.Compile(n.params);e.onNotification(n.type,n0(t,async s=>{n9(s),o.Check(s)?await n.handle(s):Yo.error(t,`Notification ${n.name}:`,new ey(o.Errors(s)))},`Notification ${n.name}`))}}a(uno,"registerNotifications");p();var dno=fe(Wc());p();var CCe=fe(Wc());var J$c=new CCe.ProtocolNotificationType("copilot/customAgent/didChange"),Z$c=new CCe.ProtocolNotificationType("copilot/customSkill/didChange"),X$c=new CCe.ProtocolNotificationType("copilot/customPrompt/didChange"),eVc=new CCe.ProtocolNotificationType("copilot/customInstruction/didChange"),A7r=new CCe.ProtocolNotificationType("copilot/hook/didChange");function tVc(t){switch(t){case"agent":return J$c;case"skill":return Z$c;case"prompt":return X$c;case"instructions":return eVc;case"hook":return A7r;default:return}}a(tVc,"notificationTypeFor");var Ywt=class extends _g{constructor(r){super();this.ctx=r;this.logger=new pe("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=tVc(r);if(!n){this.logger.debug(this.ctx,`No notification type mapped for PromptsType '${r}'; skipping.`);return}try{await this.ctx.get(er).connection.sendNotification(n,{})}catch(o){this.logger.debug(this.ctx,`Failed to send ${n.method}:`,o)}}};var rVc=new dno.ProtocolNotificationType("copilot/plugins/didChange"),Moe=class{constructor(e,r){this.ctx=e;this.logger=new pe("pluginChangeNotifier");this.subscription=r.onDidChangePlugins(()=>{this.notify()})}static{a(this,"CLSPluginChangeNotifier")}async notify(){let e;try{e=this.ctx.get(er).connection}catch(n){this.logger.debug(this.ctx,"Failed to resolve connection for copilot/plugins/didChange:",n);return}let r=await Promise.allSettled([e.sendNotification(rVc,{}),e.sendNotification(A7r,{})]);for(let n of r)n.status==="rejected"&&this.logger.debug(this.ctx,"Failed to send a plugin change notification:",n.reason)}dispose(){this.subscription.dispose()}};p();p();var fno=fe(require("crypto")),pno=require("os");Fo();var nVc=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function iVc(t){let e=t.replace(/-/g,":").toLowerCase();return!nVc.has(e)}a(iVc,"validateMacAddress");function oVc(){let t=(0,pno.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(iVc(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a(oVc,"getMac");var y7r;function sVc(){try{let t=oVc();return fno.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(sVc,"getMacMachineId");function _7r(){return y7r||(y7r=sVc()||Dt()),y7r}a(_7r,"getMachineId");Fo();function E7r(t){let e=t??Dt()+Date.now();return new za(e,_7r(),_7r())}a(E7r,"createEditorSession");var hno=E7r();p();var Kwt=fe(Wc());var v7r=new pe("AgentTextDocumentConfiguration"),C7r=class{constructor(e){this.ctx=e;this.#e=new Ji;this.onDidChange=this.#e.event}static{a(this,"AgentTextDocumentsConfiguration")}#e;create(e,r,n,o){try{return iT.create(e,r,n,o)}catch(s){throw v7r.exception(this.ctx,s,".create"),s}}update(e,r,n){try{let o=[],s=iT.withChanges(e,r,n);for(let l of r)if(Kwt.TextDocumentContentChangeEvent.isIncremental(l)){let u=e.offsetAt(l.range.start),d=e.offsetAt(l.range.end),f={start:e.positionAt(u),end:e.positionAt(d)};for(let m of["start","end"])if(f[m].line!==l.range[m].line||f[m].character!==l.range[m].character){let g=`invalid range ${m} position ${JSON.stringify(l.range[m])}. Assuming ${JSON.stringify(f[m])}.`;v7r.warn(this.ctx,`textDocument/didChange for ${e.uri} has ${g}`);let A=Vt.createAndMarkAsIssued({message:`Received ${g}`});ft(this.ctx,`invalidRange.${m}`,A)}let h={range:f,rangeOffset:u,rangeLength:d-u,text:l.text};o.push(h),e=e.applyEdits([{range:h.range,newText:h.text}])}else{let u=e.getText().length,f={range:{start:e.positionAt(0),end:e.positionAt(u)},rangeOffset:0,rangeLength:u,text:l.text};o.push(f),e=e.applyEdits([{range:f.range,newText:f.text}])}let c={document:{uri:e.uri,version:n},contentChanges:o};return this.#e.fire(c),s}catch(o){throw v7r.exception(this.ctx,o,".update"),o}}},jW=class extends $r{constructor(){super(...arguments);this.#e=new Ji;this.onDidOpenTextDocument=this.#e.event;this.#t=new Ji;this.onDidCloseTextDocument=this.#t.event;this.#r=new Ji;this.onDidFocusTextDocument=this.#r.event;this._textDocumentConfiguration=new C7r(this.ctx);this.onDidChangeTextDocument=this._textDocumentConfiguration.onDidChange;this._documents=new Map;this._notebookDocuments=new Kwt.NotebookDocuments(this._textDocumentConfiguration);this.workspaceFolders=[];this.#n=new Ji;this.onDidChangeWorkspaceFolders=this.#n.event}static{a(this,"AgentTextDocumentManager")}#e;#t;#r;#n;get connection(){return this.ctx.get(er).connection}init(r){this.connection.onDidOpenTextDocument(o=>{let s=o.textDocument,c=this._textDocumentConfiguration.create(s.uri,s.languageId,s.version,s.text);this._documents.set(Gs(s.uri),c),this.#e.fire({document:{...s,uri:c.uri}})}),this.connection.onDidChangeTextDocument(o=>{let s=o.textDocument,c=o.contentChanges,{version:l}=s;if(l==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let u=Gs(s.uri),d=this._documents.get(u);d!==void 0&&(d=this._textDocumentConfiguration.update(d,c,l),this._documents.set(u,d))}),this.connection.onDidCloseTextDocument(o=>{let s=Gs(o.textDocument.uri);this._documents.delete(s),this.#t.fire({document:{uri:s}})}),this.connection.onNotification(XHt.type,o=>{let s=("textDocument"in o?o.textDocument:o)??{};this.#r.fire("uri"in s?{document:s}:{})}),this._notebookDocuments.listen(this.connection),this.workspaceFolders.length=0;let n=this.ctx.get(up);for(let o of r){let s=o.trusted;typeof s=="boolean"&&n.setTrust(o.uri,s)}this.workspaceFolders.push(...r),r.length>0&&this.#n.fire({workspaceFolders:this.workspaceFolders,added:r,removed:[]})}didChangeWorkspaceFolders(r){r.added.forEach(n=>this.registerWorkspaceFolder(n)),r.removed.forEach(n=>this.unregisterWorkspaceFolder(n)),this.#n.fire({workspaceFolders:this.workspaceFolders,added:r.added,removed:r.removed})}unregisterWorkspaceFolder(r){let n=this.workspaceFolders.findIndex(o=>o.uri===r.uri);n>=0&&this.workspaceFolders.splice(n,1),this.ctx.get(up).forget(r.uri)}registerWorkspaceFolder(r){let n=r.trusted;typeof n=="boolean"&&this.ctx.get(up).setTrust(r.uri,n),!this.workspaceFolders.find(o=>o.uri===r.uri)&&this.workspaceFolders.push(r)}getTextDocumentsUnsafe(){return[...this._documents.values()]}getTextDocumentUnsafe(r){return this._documents.get(Gs(r.uri))}getWorkspaceFolders(){return this.workspaceFolders}findNotebook(r){let n=this._notebookDocuments.findNotebookDocumentForCell(r.uri);if(n)return{getCells:a(()=>n.cells.map((o,s)=>this.wrapCell(o,s)).filter(o=>!!o),"getCells"),getCellFor:a(({uri:o})=>{let s=n.cells.findIndex(c=>c.document===o);return s!==-1?this.wrapCell(n.cells[s],s):void 0},"getCellFor")}}wrapCell(r,n){let o=this._notebookDocuments.getCellTextDocument(r);if(o)return{kind:r.kind,metadata:r.metadata??{},index:n,document:o}}};var mno=Zu.Compile(tIn);function n9(t){if(t!==null){if(Array.isArray(t))for(let e=0;e{try{if(this.#r?.workspace?.configuration&&e&&typeof e=="object"&&!("settings"in e)){let n=await this.connection.workspace.getConfiguration(gno.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of J8e)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(i5).handleConfigurationChange(e.settings)}catch(n){Yo.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return cwt(this.ctx,n9(e))}catch(r){Yo.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(Jf)}static{a(this,"Service")}#e;#t;#r;#n;get clientCapabilities(){return this.#r}isWorkspaceTrustGateEnabled(){return this.#r?.experimental?.workspaceTrustGate===!0}listen(){let e=this.ctx,r=this.connection;r.onRequest(this.messageHandler.bind(this)),uno(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(As).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(jW).didChangeWorkspaceFolders(c)}catch(l){Yo.exception(e,l,"didChangeWorkspaceFolders")}}a(o,"didChangeWorkspaceFolders"),this.connection.onNotification("vs/didAddWorkspaceFolder",({name:c,uri:l})=>o({added:[{uri:l,name:c??l}],removed:[]})),this.connection.onNotification("vs/didRemoveWorkspaceFolder",({name:c,uri:l})=>o({added:[],removed:[{uri:l,name:c??l}]})),r.onInitialize(c=>{if(this.initialized)throw new Error("initialize request sent after initialized notification");this.#r=c.capabilities,e.get(up).setCapabilityEnabled(this.isWorkspaceTrustGateEnabled());let l=c.capabilities.copilot,u=n9(c.initializationOptions);if(u){if(!mno.Check(u))throw new ey(mno.Errors(u));let m=u,g=e.get(Ir);m.editorPluginInfo?g.setEditorAndPluginInfo({version:"unknown",...m.editorPluginInfo},m.editorInfo&&{version:"unknown",...m.editorInfo},m.relatedPluginInfo??[]):Yo.warn(e,"editorInfo and editorPluginInfo will soon be required in initializationOptions. This will replace setEditorInfo."),m.copilotIntegrationId&&g.setCopilotIntegrationId(m.copilotIntegrationId),m.githubAppId&&(e.get(ih).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(za,E7r(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(jW).init(c.workspaceFolders??[]),Voi(this.ctx),l&&(e.get(Nn).setCapabilities(l),l.contentProvider&&ga.registerSchemes(l.contentProvider),"openURL"in l&&lht(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,Yo.info(e,`${n.name} ${n.version} initialized`),e.get(Qt).primeToken().catch(m=>{e.get(ks).setErrorV2("auth",{message:`Failed while initializing: ${m}`,askToReSignin:!1,result:{status:"NotSignedIn"}})}),d&&r.workspace.onDidChangeWorkspaceFolders(o),c.capabilities.workspace?.didChangeConfiguration?.dynamicRegistration&&await r.client.register(ZI.DidChangeConfigurationNotification.type,{section:gno}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(Ib).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||awt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(ks).sendInitNonAuthStatus(),new qEe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(n0(e,h,"onInitialized")),e.get(eM).init(),l?.token&&e.get(Fr).setTransientSession({}),l?.redirectedTelemetry&&vzi(e),Ano.lt(process.versions.node,"22.0.0")&&Yo.warn(e,`Node.js ${process.versions.node} support is deprecated. Please upgrade to Node.js 22 or newer.`),{capabilities:{textDocumentSync:{openClose:!0,change:ZI.TextDocumentSyncKind.Incremental},notebookDocumentSync:{notebookSelector:[{notebook:"*"}]},workspace:{workspaceFolders:{supported:d,changeNotifications:d}},executeCommandProvider:{commands:Azi(e,r)},inlineCompletionProvider:{}},serverInfo:n}}),r.onShutdown(async()=>{await(this.#e??=this.deactivate())}),r.onExit(()=>{this.onExit()}),r.onDidChangeConfiguration(c=>{this.handleDidChangeConfiguration(c)}),r.listen();let s=new rIt;this.ctx.forceSet(Jf,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");zp(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(Noe).handlers.get(e);if(!o)return new ZI.ResponseError(Ze.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new ZI.ResponseError(Ze.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new ZI.ResponseError(Ze.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!this.ctx.get(Ir).isEditorPluginInfoKnown())throw new ZI.ResponseError(Ze.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),n9(r);try{let[s,c]=await o(this.ctx,n,r);return c?new ZI.ResponseError(c.code,c.message,c.data):s}catch(s){if(n.isCancellationRequested)return new ZI.ResponseError(Ze.RequestCancelled,"Request was canceled");if(s instanceof Ei)return this.telemetryMethodFailure(e,s),new ZI.ResponseError(Ze.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof ZI.ResponseError||Yo.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get(jK).stop()}catch(e){Yo.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(r8).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(J8).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose plugin contribution injector")}try{this.ctx.get(Moe).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose plugin change notifier")}try{this.ctx.get(Jie).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose MCP project cleanup subscription")}try{this.ctx.get(gy).dispose().catch(e=>{Yo.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){Yo.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(bG).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(R2).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(t6).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose Claude Code agent service")}try{this.ctx.get(Ca).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose agent plugin service")}this.ctx.get(Ys).shutdown().catch(e=>{Yo.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(y0).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(Jf,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(Ib).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),GAr(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(Ud).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(c0).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},Yo=new pe("lsp");var hC=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new yno.ProtocolRequestType("conversation/context");this.typeCheck=Zu.Compile(n)}static{a(this,"AgentSkillResolver")}async resolveSkill(e){let r=this.ctx.get(er).connection,n={conversationId:e.conversation.id,turnId:e.turn.id,skillId:this.skillId},o;try{let s=await r.sendRequest(this.requestType,n),[c,l]=s;if(l){let u=new _no.ResponseError(l.code,l.message,l.data);ot.error(this.ctx,`ResponseError while resolving skill ${this.skillId}`,u);return}o=c}catch(s){ot.error(this.ctx,`Error while resolving skill ${this.skillId}`,s);return}if(o!=null){if(!this.typeCheck.Check(o))throw new ey(this.typeCheck.Errors(o));return o}}};var b7r=class{constructor(e,r,n="",o="",s=[],c=[]){this.progressToken=e;this.chunks=r;this.followUp=n;this.suggestedTitle=o;this.skills=s;this.references=c}static{a(this,"SyntheticTurn")}},b9=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new b7r(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},Jwt=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(Bc)}static{a(this,"SyntheticTurnProcessor")}async process(e,r){try{await this.processWithSyntheticTurns(this.syntheticTurn,e,r)}catch(n){ot.error(this.turnContext.ctx,`Error processing turn ${this.turnContext.turn.id}`,n);let o=n.message;this.turnContext.turn.status="error",this.turnContext.turn.response={message:o,type:"meta"},await this.conversationProgress.end(this.turnContext.conversation,this.turnContext.turn,{error:{message:o,responseIsIncomplete:!0}})}}async processWithSyntheticTurns(e,r,n){await this.conversationProgress.begin(this.turnContext.conversation,this.turnContext.turn,r),await this.resolveSyntheticSkill(e,n),await this.processSyntheticChunks(e,n),await this.endSyntheticProgress(e,n),this.turnContext.turn.response={type:"model",message:e.chunks.join("")},this.turnContext.turn.status=n.isCancellationRequested?"cancelled":"success"}async resolveSyntheticSkill(e,r){let n=this.turnContext.ctx.get(Xo).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new hC(this.turnContext.ctx,s,b.Object({value:b.String()})).resolveSkill(this.turnContext);l&&!r.isCancellationRequested&&await this.conversationProgress.report(this.turnContext.conversation,this.turnContext.turn,{reply:l.value})}}async processSyntheticChunks(e,r){for(let n of e.chunks)r.isCancellationRequested||(await this.conversationProgress.report(this.turnContext.conversation,this.turnContext.turn,{reply:n}),await JC(1))}async endSyntheticProgress(e,r){r.isCancellationRequested?await this.conversationProgress.cancel(this.turnContext.conversation,this.turnContext.turn):await this.conversationProgress.end(this.turnContext.conversation,this.turnContext.turn,{followUp:{message:e.followUp,type:"followup",id:Dt()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var aM=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(b9).get(r);if(o)return new Jwt(e,o);let c=(await Iw(e.ctx)).find(u=>u.slug===e.turn.agent?.agentSlug);if(c?.turnProcessor)return c.turnProcessor(e);let l;return e.conversation.source==="inline"?l=new sXe(e.ctx):l=new hde(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new CPe(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new CPe(e,l):new cot(e,l)}};p();var HW=class extends tv{constructor(r){super(r);this.connection=null;this.capabilities={readTextFile:!1,writeTextFile:!1};this.currentSessionId=null}static{a(this,"ACPClientToolInvoker")}setACPContext(r,n,o){this.connection=r,this.capabilities=n,this.currentSessionId=o}clearACPContext(){this.currentSessionId=null}async invokeClientTool(r,n){if(!this.connection||!this.currentSessionId)return this.errorResult("ACP connection not available for tool invocation");switch(n.name){case"create_file":return this.handleCreateFile(n.input,n.toolCallId);case"insert_edit_into_file":return this.handleEditFile(n.input,n.toolCallId);default:return this.errorResult(`Tool ${n.name} is not supported in ACP mode`)}}async handleCreateFile(r,n){if(!this.capabilities.writeTextFile)return this.errorResult("Client does not support file writing");if(!r?.filePath||r.content===void 0)return this.errorResult("create_file requires filePath and content");try{let o=r.content;return await this.connection.writeTextFile({sessionId:this.currentSessionId,path:r.filePath,content:o}),await this.sendDiffUpdate(n,r.filePath,null,o),this.successResult(`Successfully created file: ${r.filePath}`)}catch(o){return this.errorResult(`Failed to create file ${r.filePath}: ${String(o)}`)}}async handleEditFile(r,n){if(!this.capabilities.writeTextFile)return this.errorResult("Client does not support file writing");if(!r?.filePath||r.code===void 0)return this.errorResult("insert_edit_into_file requires filePath and code");try{let o=null;if(this.capabilities.readTextFile)try{o=(await this.connection.readTextFile({sessionId:this.currentSessionId,path:r.filePath})).content}catch{}let s=r.code.replace(/\r\n/g,` -`);return await this.connection.writeTextFile({sessionId:this.currentSessionId,path:r.filePath,content:s}),await this.sendDiffUpdate(n,r.filePath,o,s),this.successResult(`Successfully edited file: ${r.filePath}`)}catch(o){return this.errorResult(`Failed to edit file ${r.filePath}: ${String(o)}`)}}async sendDiffUpdate(r,n,o,s){await this.connection.sessionUpdate({sessionId:this.currentSessionId,update:{sessionUpdate:"tool_call_update",toolCallId:r,content:[{type:"diff",path:n,oldText:o,newText:s}]}})}successResult(r){return new Gr([new Or(r)],"success")}errorResult(r){return new Gr([new Or(r)],"error")}};p();function aVc(t){switch(t){case"read_file":case"list_dir":case"get_errors":return"read";case"insert_edit_into_file":case"create_file":case"replace_string_in_file":return"edit";case"semantic_search":case"file_search":case"grep_search":return"search";case"run_in_terminal":case"run_subagent":return"execute";case"update_user_preferences":case"validate_cves":default:return"other"}}a(aVc,"mapToolNameToKind");function cVc(t,e){if(!e)return;let r=[];switch(t){case"read_file":case"insert_edit_into_file":case"create_file":case"replace_string_in_file":{let n=e.filePath;if(n){let o=e.startLine;r.push({path:n,line:o??void 0})}break}case"list_dir":{let n=e.path;n&&r.push({path:n});break}case"get_errors":{let n=e.filePaths;if(n&&Array.isArray(n))for(let o of n)r.push({path:o});break}}return r.length>0?r:void 0}a(cVc,"extractLocationsFromInput");function lVc(t){switch(t){case"not started":return"pending";case"running":return"in_progress";case"completed":return"completed";case"error":case"cancelled":return"failed";default:return"pending"}}a(lVc,"mapToolCallStatus");var Zwt=class{constructor(e,r){this.connection=e;this.sessionId=r;this.activeToolCalls=new Map;this.messageChunkBuffer=""}static{a(this,"ACPProgressReporter")}async begin(e,r,n,o){}async report(e,r,n,o){if(o.reply&&await this.reportTextChunk(o.reply),o.editAgentRounds){for(let s of o.editAgentRounds)if(s.reply&&await this.reportTextChunk(s.reply),s.toolCalls)for(let c of s.toolCalls){let l=lVc(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=cVc(c.name,c.input);await this.reportToolCallStart(c.id,c.name,aVc(c.name),l,c.input,d)}else c.status==="completed"?await this.reportToolCallComplete(c.id):c.status==="error"?await this.reportToolCallError(c.id,c.error||"Unknown error"):c.status==="cancelled"?await this.reportToolCallCancelled(c.id):u||await this.reportToolCallProgress(c.id,l)}}}async end(e,r,n,o){if(o?.error&&await this.reportTextChunk(` +`;var g9r=["authorization_code","refresh_token"],iCe=33428,pwt=class{constructor(e,r){this._logger=new pe("LoopbackAuthServer");this.nonce=(0,zeo.randomBytes)(16).toString("hex");if(!e)throw new Error("startingRedirect must be defined");this._startingRedirect=new URL(e),this._ctx=r;let n;this._resultPromise=new Promise((s,c)=>n={resolve:s,reject:c}),this._responseSentPromise=new Promise(s=>{this._resolveResponseSent=s});let o=`&app_name=${encodeURIComponent("GitHub Copilot")}`;this._server=Yeo.createServer((s,c)=>{let l=new URL(s.url,`http://${s.headers.host}`);switch(l.pathname){case"/signin":{let u=(l.searchParams.get("nonce")??"").replace(/ /g,"+");if(u!==this.nonce){let d=new Ei("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),EOe(this._ctx,d,"/signin"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(d);return}this._startingRedirect.searchParams.set("redirect_uri",`http://127.0.0.1:${this.port}/callback`),this._logger.info(this._ctx,"Redirecting to auth server"),c.writeHead(302,{location:this._startingRedirect.toString()}),c.end();break}case"/callback":{let u=l.search||"",d=/[?&]code=([^&]+)/.exec(u),f=/[?&]state=([^&]+)/.exec(u),h=d&&d.length>1?decodeURIComponent(d[1]):void 0,m=f&&f.length>1?decodeURIComponent(f[1]):void 0,g=new URL(m||"").searchParams.get("nonce")??void 0;if(!h||!m||!g){let A="Missing required parameters, at least one from code, state, nonce is needed.",y=new Ei(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),EOe(this._ctx,y,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent(A)}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(y);return}if(this.state!==m){let A=new Ei("State does not match.");this._logger.warn(this._ctx,"OAuth callback state mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedState:m,expectedState:this.state}),EOe(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("State does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}if(this.nonce!==g){let A=new Ei("Nonce does not match.");this._logger.warn(this._ctx,"OAuth callback nonce mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedNonce:g,expectedNonce:this.nonce}),EOe(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}this._logger.info(this._ctx,"OAuth callback validation successful"),n.resolve({code:h,state:m}),c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(m9r,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(m9r)}})}static{a(this,"LoopbackAuthServer")}get redirectUri(){if(this.port===void 0)throw new Error("Server is not started yet");return`http://127.0.0.1:${this.port}/callback`}set state(e){e?this._startingRedirect.searchParams.set("state",e):this._startingRedirect.searchParams.delete("state")}get state(){return this._startingRedirect.searchParams.get("state")??void 0}start(){return new Promise((e,r)=>{if(this._server.listening)throw new Error("Server is already started");let n=setTimeout(()=>{r(new Error("Timeout waiting for port"))},5e3);this._server.on("listening",()=>{let o=this._server.address();if(typeof o=="string")this.port=parseInt(o);else if(o instanceof Object)this.port=o.port;else throw new Error("Unable to determine port");clearTimeout(n),this.state=`http://127.0.0.1:${this.port}/callback?nonce=${this.nonce}`,this._logger.info(this._ctx,"OAuth server started and state configured",{port:this.port,redirectUri:this.redirectUri}),e(this.port)}),this._server.on("error",o=>{if(o.code==="EADDRINUSE"){console.warn(`Port ${iCe} is in use, retrying with a random port...`),this._server.listen(0,"127.0.0.1");return}clearTimeout(n),r(new Error(`Error listening to server: ${o.message}`))}),this._server.on("close",()=>{clearTimeout(n),r(new Error("Server closed unexpectedly"))}),this._server.listen(iCe,"127.0.0.1")})}stop(){return new Promise((e,r)=>{if(!this._server.listening){e();return}let n,o=a(()=>{n&&(clearTimeout(n),n=void 0)},"cleanup");n=setTimeout(()=>{o(),r(new Error("Timeout waiting for server to close"))},5e3),this._server.close(s=>{o(),s?r(s):e()}),this._server.closeAllConnections()})}waitForOAuthResponse(){return this._resultPromise}waitForResponseSent(){return this._responseSentPromise}};p();var hwt=require("crypto");var Z8e=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,hwt.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,hwt.randomBytes)(e)}static base64UrlEncode(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static getSupportedMethods(){return[this.getCodeChallengeMethod()]}static isServerSupported(e){if(!e||e.length===0)return!1;let r=this.getSupportedMethods();return e.some(n=>r.includes(n))}static createPKCEParameters(){let e=this.generateCodeVerifier(),r=this.generateCodeChallenge(e),n=this.getCodeChallengeMethod();return{codeVerifier:e,codeChallenge:r,codeChallengeMethod:n}}};var Pqc="Timed out",Keo="Sign-in request was cancelled",A9r=class{static{a(this,"CodeFlow")}},oCe=class extends A9r{static{a(this,"CLSCodeFlow")}constructor(e){super(),this.ctx=e}async auth(e,r,n,o,s,c){let{clientId:l,clientSecret:u}=e,d=o?.resource,f=Z8e.isServerSupported(n.code_challenge_methods_supported),h=f?Z8e.createPKCEParameters():void 0;f?Fr.info(this.ctx,`PKCE supported by server with methods: [${n.code_challenge_methods_supported?.join(", ")}], using ${h.codeChallengeMethod}`):Fr.info(this.ctx,"PKCE not supported by server, falling back to standard OAuth flow");let m=this.buildAuthorizationParams({clientId:l,scope:r.join(" "),pkceParams:h,resource:d,...s??{}}),g=new URLSearchParams(m),A=n.authorization_endpoint+"?"+g.toString(),y=new pwt(A,this.ctx),E=`http://127.0.0.1:${await y.start()}/signin?nonce=${encodeURIComponent(y.nonce)}`;Fr.info(this.ctx,"Auth URL created and opening browser for sign-in"),await new nCe(this.ctx).open(E);let v,S=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,k)=>{let D=setTimeout(()=>k(new Error(Pqc)),3e5);S.push({dispose:a(()=>clearTimeout(D),"dispose")})})];if(c){let x=c;w.push(new Promise((k,D)=>{if(x.isCancellationRequested){Fr.info(this.ctx,"OAuth flow cancelled (already requested)"),D(new Error(Keo));return}let N=x.onCancellationRequested(()=>{Fr.info(this.ctx,"OAuth flow cancelled"),D(new Error(Keo))});S.push(N)}))}v=(await Promise.race(w)).code,Fr.info(this.ctx,"OAuth response received successfully")}catch(w){throw Fr.error(this.ctx,"OAuth flow error",w),w}finally{for(let x of S)x.dispose();let w,R=new Promise(x=>w=setTimeout(x,5e3));await Promise.race([y.waitForResponseSent().finally(()=>clearTimeout(w)),R]).catch(()=>{}),await y.stop().catch(x=>{Fr.warn(this.ctx,"Failed to stop loopback auth server",x)})}return await this.exchangeCodeForToken({endpointUri:n.token_endpoint,redirectUri:y.redirectUri,code:v,clientId:l,clientSecret:u,codeVerifier:h?.codeVerifier,resource:d})}async exchangeCodeForToken({endpointUri:e,redirectUri:r,code:n,clientId:o,clientSecret:s,codeVerifier:c,resource:l}){let u=[["grant_type","authorization_code"],["code",n],["client_id",o],["redirect_uri",r]];s&&u.push(["client_secret",s]),c&&u.push(["code_verifier",c]),l&&u.push(["resource",l]);let d=new URLSearchParams(u);Fr.info(this.ctx,"Exchanging authorization code for token",{endpointUri:e,clientId:o,redirectUri:r});let f=await Mee(this.ctx,e,"POST",{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},d.toString());if(f.ok){let h=await f.json();return Fr.info(this.ctx,"Token exchange successful"),h}else{let h=await f.text(),m=new Error(h);throw m.name="Token Exchange Error",m}}buildAuthorizationParams({clientId:e,scope:r,pkceParams:n,resource:o,...s}){let c=[["client_id",e],["response_type","code"],["scope",r]];n&&c.push(["code_challenge",n.codeChallenge],["code_challenge_method",n.codeChallengeMethod]),o&&c.push(["resource",o]);for(let[l,u]of Object.entries(s??{}))u!==void 0&&c.push([l,String(u)]);return c}};var uM=class t{constructor(e,r,n,o){this.id=t.providerId;this.label="GitHub";this.supportsMultipleAccounts=!1;this.authorizationServers=[t.providerId];this.ctx=e,this.serverMetadata=n,this.resourceMetadata=o,this._sessionsPromise=this.readSessions().then(s=>(setTimeout(()=>s.forEach(c=>{this.afterSessionLoad(c)}),1e3),s))}static{a(this,"GitHubAuthenticationProvider")}static{this.providerId="https://github.com/login/oauth"}async getSessions(e,r){await this.checkSessionsExpiration();let n=await this._sessionsPromise,o=e?.sort()||[];return o.length?n.filter(c=>h9r([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(Un).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(ih),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=$eo(r.provider)?r.provider:void 0,d=typeof r.loginHint=="string"?r.loginHint:void 0,f=d?{login:d,provider:u}:{prompt:"select_account",provider:u},h=await new oCe(this.ctx).auth({clientId:c,clientSecret:l},n,this.serverMetadata,this.resourceMetadata,f,r.cancellationToken),m=await this.tokenToSession(h.access_token,e);this.afterSessionLoad(m);let g=o.findIndex(y=>y.account.id===m.account.id&&h9r([...y.scopes].sort(),n)),A=new Array;return g>-1?A.push(...o.splice(g,1,m)):o.push(m),await this.storeSessions(o),m}async storeSessions(e){this._sessionsPromise=Promise.resolve(e),await this.ctx.get(Un).update("oauth",this.id,e)}async tokenToSession(e,r){let n=await this.getUserInfo(e);return{id:crypto.getRandomValues(new Uint32Array(2)).reduce((o,s)=>o+=s.toString(16),""),accessToken:e,account:{label:n.accountName,id:n.id},scopes:r}}buildGetUserInfoUrl(){try{let e=new URL(this.serverMetadata?.issuer);return e.hostname.toLowerCase()==="github.com"?"https://api.github.com/user":`${e.origin.replace(/\/+$/,"")}/api/v3/user`}catch{return"https://api.github.com/user"}}async getUserInfo(e){let r=this.buildGetUserInfoUrl(),n;try{n=await this.ctx.get(Jt).fetch(new URL(r).href,{method:"GET",headers:{Authorization:`token ${e}`}})}catch(o){return fwt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}if(n.ok)try{let o=await n.json();return{id:`${o.id}`,accountName:o.login}}catch(o){return fwt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}else{let o=n.statusText;try{let s=await n.json();s.message&&(o=s.message)}catch{}return fwt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}}async removeSession(e){let r=await this._sessionsPromise,n=r.findIndex(o=>o.id===e);if(n>-1)r.splice(n,1),await this.storeSessions(r);else throw new Error(`No session with id '${e}' found.`)}async checkSessionsExpiration(){let e=await this._sessionsPromise;if(e.length!==0)for(let r of e)await this.isSessionExpired(r)&&await this.removeSession(r.id)}async isSessionExpired(e){let{accessToken:r}=e,{id:n,accountName:o}=await this.getUserInfo(r);return!n||!o}};var Dqc=b.Object({scopes:b.Optional(b.Array(b.String({minLength:1}),{minItems:1})),authServer:b.Optional(b.String({minLength:1})),socialProvider:uwt,loginHint:b.Optional(b.String({minLength:1})),skipSignedInEarlyReturn:b.Optional(b.Boolean())});async function Nqc(t,e,r){if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];try{let n=t.get(Or);if(!r.skipSignedInEarlyReturn){let{status:c,user:l}=await n.checkAndUpdateStatus({authAuthority:r.authServer});if(c==="OK")return[{status:c,user:l},null]}let o=n.getAuthSourceEnvVar();if(o)return[null,{code:Ze.AuthEnvVarConflict,message:rqe(o)}];let s=await dwt(t,(c,l)=>new uM(c,uM.providerId,l,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider,loginHint:r.loginHint},e);if(!["OK","MaybeOK"].includes(s.status))throw new Ei("OAuth authentication failed for unknown reasons. Please try again later.");return[s,null]}catch(n){if(n instanceof C7)return[null,{code:Ze.NoBrowserAvailable,message:n.message}];if(!(n instanceof Ei))throw n;return[null,{code:Ze.CodeFlowFailed,message:n.message}]}}a(Nqc,"handleSignInWithCodeFlowChecked");var Jeo=we(Dqc,Nqc);p();p();p();var A9=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},X8e=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function Zeo(t,e,r){return e.isCancellationRequested?Promise.reject(new A9):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new A9))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new X8e))},r);t.then(u=>{s||(s=!0,clearTimeout(l),c.dispose(),n(u))},u=>{s||(s=!0,clearTimeout(l),c.dispose(),o(u instanceof Error?u:new Error(String(u))))})})}a(Zeo,"raceWithCancellationAndTimeout");var Mqc=["repo","workflow"];async function Oqc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...s_(t)},json:{client_id:e,scope:n.join(" ")},timeout:3e4},s=new URL("login/device/code",r).href,c;try{c=await t.get(Jt).fetch(s,o)}catch(l){throw l instanceof Error&&wx(l)?new Ei(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new Ei(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(Oqc,"requestDeviceCode");async function Lqc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...s_(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s;try{s=await t.get(Jt).fetch(new URL("login/oauth/access_token",n).href,o)}catch(l){throw l instanceof Error&&wx(l)?new Ei(`Device flow token request failed on ${n}: ${l.message}`):l}let c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new Ei(c.error_description):new Ei(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(Lqc,"requestAccessToken");async function Bqc(t,e){let n=await(await $d(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new Ei(`Error retrieving user information: ${String(n.errors)}`);return n}a(Bqc,"requestUserInfo");async function Fqc(t,e,r){let n=r?.githubAppId??t.get(ih).findAppIdToAuthenticate(),o=r?.scopes??Mqc,{serverUrl:s,apiUrl:c,authAuthority:l}=b7(t,r?.authAuthority),u=await Oqc(t,n,s,o),d=(async()=>{let f=Date.now()+u.expires_in*1e3,h=u.interval,m;do{if(await new Promise(A=>setTimeout(A,1e3*h)),e.isCancellationRequested)throw new A9("Sign-in request was cancelled");m=await Lqc(t,u.device_code,n,s);let g=m.access_token;if(g){let A=await Bqc(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new A9("Sign-in request was cancelled");let y=m.scope?m.scope.split(" ").filter(_=>_.length>0):o;return{authAuthority:l,githubAppId:n,username:A.login,accessToken:g,scopes:y}}h=m.interval??h}while(Date.now()performance.now()-n,"getElapsedTimeMs");try{let s=t.get(Or);if(!r.skipSignedInEarlyReturn){let{status:h,user:m}=await s.checkAndUpdateStatus({authAuthority:r.authServer});if(h==="OK")return[{status:h,user:m},null]}let c=s.getAuthSourceEnvVar();if(c)return[null,{code:Ze.AuthEnvVarConflict,message:rqe(c)}];Xge(t,"deviceFlow");let l=t.get(xoe),u=await l.initiate(e,{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider});await t.get(er).connection.sendNotification(qqc,{userCode:u.userCode,verificationUri:u.verificationUri,expiresIn:u.expiresIn});let d=await Zeo(u.waitForAuth,e,jqc),f=await l.save(d);return ID(t,"deviceFlow",f.status,o()),[f,null]}catch(s){if(s instanceof A9)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof X8e)return ID(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:Ze.DeviceFlowFailed,message:"Sign-in request timed out"}];if(ID(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof Ei))throw s;return[null,{code:Ze.DeviceFlowFailed,message:s.message}]}}a(Hqc,"handleSignInWithDeviceFlowChecked");var eto=we(Qqc,Hqc);p();var Gqc=b.Object({githubToken:b.String({minLength:1}),user:b.String({minLength:1}),githubAppId:b.Optional(b.String({minLength:1}))});async function $qc(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Or);return[await t.get(pI).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a($qc,"handleSignInWithGithubTokenChecked");var tto=we(Gqc,$qc);p();var Vqc=b.Object({options:b.Optional(b.Object({}))});async function Wqc(t,e,r){return[await t.get(Or).signOutEditor(),null]}a(Wqc,"handleSignOutChecked");var rto=we(Vqc,Wqc);p();var zqc=b.Object({transaction:b.Optional(b.String()),stacktrace:b.Optional(b.String()),properties:b.Optional(b.Record(b.String(),b.String())),platform:b.Optional(b.String()),exception_detail:b.Optional(b.Array(b.Object({type:b.Optional(b.String()),value:b.Optional(b.String()),stacktrace:b.Optional(b.Array(b.Object({filename:b.Optional(b.String()),lineno:b.Optional(b.Union([b.String(),b.Integer()])),colno:b.Optional(b.Union([b.String(),b.Integer()])),function:b.Optional(b.String()),in_app:b.Optional(b.Boolean())})))})))}),y9r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function Yqc(t,e,r){let n=t.get(As),o=t.get(Ir).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&K4.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:YDt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},K4.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new y9r(r.stacktrace??"N/A",o.name);return l.stack=void 0,Ma(t,l,r.transaction??"",s,c),["OK",null]}a(Yqc,"handleTelemetryExceptionChecked");var nto=we(zqc,Yqc);p();p();p();Fo();function _9r(t,e){let r=Date.now()+((t?.refresh_in??0)+IOt)*1e3;return new Gz({token:`test token ${Dt()}`,refresh_in:0,expires_at:r,...t},e,r)}a(_9r,"createTestCopilotToken");var sCe=class extends $h{constructor(){super(...arguments);this.defaultToken=_9r({token:"tid=test;rt=1"})}static{a(this,"FakeCopilotTokenFetcherFromSession")}fetchTokenResult(r,n){switch(n.accessToken){case"":return{copilotToken:this.defaultToken};case"valid-github-token":return{copilotToken:_9r({token:"tid=valid-copilot-token"})};case void 0:return{failureKind:"NotSignedIn"};case"notauth-github-token":return{failureKind:"NotAuthorized",message:"notauth",canSignUpForLimited:!0};case"bogus-github-token":return{failureKind:"NotAuthorized",message:"bogus",canSignUpForLimited:!1};case"expired-github-token":return{failureKind:"HTTP401",message:"expired"};default:throw new Error("Don't have a valid GitHub token")}}};var mwt=class extends $h{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:_9r(await this.envelopeFn())}}};var Kqc=b.Object({options:b.Optional(b.Object({}))});async function Jqc(t,e,r){let n=new sCe;return t.get(Or).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet($h,n),t.get(ks).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(Jqc,"handleTestingAlwaysAuthChecked");var E9r=we(Kqc,Jqc);p();Fo();var Zqc=b.Object({messages:b.Array(b.Object({role:b.Enum(hc),content:b.String(),name:b.Optional(b.String())})),modelFamily:b.Optional(b.Enum(kn)),stop:b.Optional(b.Array(b.String())),conversationOptions:b.Optional(b.Object({maxResponseTokens:b.Optional(b.Number()),temperature:b.Optional(b.Number())}))});async function Xqc(t,e,r){let n=new mc(t),s=await rj(t)?kn.Gpt35turbo:kn.CopilotBase,c=await t.get(dl).getBestChatModelConfig([r.modelFamily??s]),l=await Qwe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:WA.user("test",Dt())},e,l),null]}a(Xqc,"handleChatMLChecked");var ito=we(Zqc,Xqc);p();p();p();var dCe=fe(cro(),1),cJh={ALPN_HTTP2:dCe.default.ALPN_HTTP2,ALPN_HTTP2C:dCe.default.ALPN_HTTP2C,ALPN_HTTP1_1:dCe.default.ALPN_HTTP1_1,ALPN_HTTP1_0:dCe.default.ALPN_HTTP1_0},{fetch:lJh,context:lro,reset:uJh,noCache:dJh,h1:fJh,keepAlive:pJh,h1NoCache:hJh,keepAliveNoCache:mJh,cacheStats:gJh,clearCache:AJh,offPush:yJh,onPush:_Jh,createUrl:EJh,timeoutSignal:vJh,Body:CJh,Headers:uro,Request:bJh,Response:SJh,AbortController:TJh,AbortError:Dwt,AbortSignal:IJh,FetchBaseError:xJh,FetchError:wJh,ALPN_HTTP2:RJh,ALPN_HTTP2C:kJh,ALPN_HTTP1_1:PJh,ALPN_HTTP1_0:DJh}=dCe.default;var fro=require("crypto"),pro=require("http"),hro=require("stream"),mro=require("util"),pCe=fe(s2());var vGc=6e5,CGc=new pCe.ProtocolRequestType("copilot/fetch"),bGc=new pCe.ProtocolRequestType("copilot/fetchCancel"),SGc=new pCe.ProgressType,TGc=new pCe.ProtocolRequestType("copilot/fetchDisconnectAll"),bB=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},fCe=class extends Jt{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(As).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(er).connection.sendRequest(TGc,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(er).connection,c=(0,fro.randomUUID)(),l=new jn.CancellationTokenSource,u=new hro.PassThrough,d=a(()=>{s.sendRequest(bGc,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new Dwt("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new bB("EditorFetcher received unexpected abort signal");if(o.aborted)throw new Dwt("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(SGc,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new bB(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??vGc,y=setTimeout(()=>{sr(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new bB("Request timed out from lsp server"))},A),_=a(()=>{g(new Dwt("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",_),s.sendRequest(CGc,xGc(r,c,n),l.token).then(m).catch(E=>{let v="EditorFetcher request failed";E&&typeof E=="object"&&"message"in E&&(v+=`: ${String(E.message)}`),E&&typeof E=="object"&&"data"in E&&(v+=`: ${(0,mro.inspect)(E.data)}`),g(new bB(v))}).finally(()=>{o?.removeEventListener("abort",_),clearTimeout(y)})});if(!h.status)throw new bB("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new kx(h.status,pro.STATUS_CODES[h.status]??"",new uro(h.headers),()=>IGc(u),()=>u)}};function IGc(t){return new Promise((e,r)=>{let n="";t.on("error",r),t.on("end",()=>e(n)),t.on("data",o=>n+=String(o))})}a(IGc,"consumeStream");function xGc(t,e,r){let{timeout:n,method:o}=r,s=r.headers??{},c=r.json?JSON.stringify(r.json):r.body;return r.json&&(s["content-type"]="application/json"),{url:t,headers:s,body:c,timeout:n,method:o,workDoneToken:e}}a(xGc,"convertOptionsToParams");var wGc=b.Object({url:b.String(),headers:b.Optional(b.Record(b.String(),b.String())),body:b.Optional(b.String()),timeout:b.Optional(b.Number()),method:b.Optional(b.Union([b.Literal("GET"),b.Literal("POST"),b.Literal("DELETE")])),cancelBeforeRequest:b.Optional(b.Boolean()),cancelAfterRequest:b.Optional(b.Boolean()),cancelAfterFirstChunk:b.Optional(b.Boolean())});async function RGc(t,e,r){let n=new fCe(t),o=new AbortController,s=o.signal,{url:c,cancelBeforeRequest:l,cancelAfterRequest:u,cancelAfterFirstChunk:d,...f}=r;l&&o.abort();let h=n.fetch(c,{signal:s,...f});u&&o.abort();let m;try{m=await h}catch(y){return[{error:`Fetch stream error: ${y instanceof bB?y.message:String(y)}`},null]}let{status:g}=m,A=Object.fromEntries(Array.from(m.headers));try{if(d){let _=m.body();for await(let E of _){let v=E.toString();return o.abort(),[{status:g,headers:A,body:v},null]}}let y=await m.text();return[{status:g,headers:A,body:y},null]}catch(y){return[{error:`Fetch stream error: ${y instanceof bB?y.message:String(y)}`},null]}}a(RGc,"handleTestingFetchChecked");var gro=we(wGc,RGc);p();var kGc=b.Object({});async function PGc(t,e,r){return await t.get(Qd).flush(),["OK",null]}a(PGc,"handleTestingFlushPromiseQueueChecked");var Aro=we(kGc,PGc);p();p();p();var QW=class{static{a(this,"FileSearch")}};p();p();p();var Nwt=class{constructor(e){this.maxDegreeOfParalellism=e;this.outstandingPromises=[],this.runningPromises=0}static{a(this,"PriorityLimiter")}queue(e,r=!1){return new Promise((n,o)=>{r?this.outstandingPromises.unshift({factory:e,c:n,e:o}):this.outstandingPromises.push({factory:e,c:n,e:o}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this.runningPromises--,this.outstandingPromises.length>0&&this.consume()}};var yro=fe(ii());var Mwt="main.js",Owt=class{constructor(e,r,n=3){this.promiseResolvers=new Map;this.id=0;try{let o={cwd:process.cwd(),indexWorkspaceRoots:e,params:r};this.worker=uyn(Mwt,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new Nwt(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new Mze(this.id++),yro.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new Pze(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new Dze(this.id++,e),r)}getContext(e,r,n,o,s,c){return this.postMessageInQueue(new Nze(this.id++,e,r,n,o,s),c,!0)}tryCreateIndex(e,r,n){return this.postMessageInQueue(new Rze(this.id++,e,r),n)}async postMessageInQueue(e,r,n=!1){return this.postMessageQueue.queue(()=>this.postMessageAndWait(e,r),n)}tryRemoveIndex(e,r){return this.postMessageAndWait(new kze(this.id++,e),r)}async postMessageAndWait(e,r){if(this.fatalError)return Promise.reject(this.fatalError);let n=new Promise((s,c)=>{this.promiseResolvers.set(e.id,{resolve:s,reject:c})});this.worker.postMessage(e);let o=r.onCancellationRequested(()=>{this.worker.postMessage(new wze(e.id))});try{return await n}finally{o.dispose()}}handleWorkerMessage(e){if(e.operation!=="response")throw new Error("Unexpected message operation");let r=this.promiseResolvers.get(e.id);if(!r)throw new Error(`Received response for message that isn't in progress: ${e.id}`);this.promiseResolvers.delete(e.id),e.error?(e.error.code=e.code,r.reject(e.error)):r.resolve(e.data)}handleUnexpectedError(e){let r;if(e instanceof Error){r=e,r.code==="MODULE_NOT_FOUND"&&r.message?.endsWith(Mwt+"'")&&(r=new Error(`Failed to load ${Mwt}`),r.code="CopilotPromptLoadFailure");let n=new Error().stack;r.stack&&n?.match(/^Error\n/)&&(r.stack+=n.replace(/^Error/,""))}else e&&typeof e=="object"&&"name"in e&&"status"in e&&e.name==="ExitStatus"&&typeof e.status=="number"?(r=new Error(`${Mwt} exited with status ${e.status}`),r.code=`CopilotPromptWorkerExit${e.status}`):r=new Error(`Non-error thrown: ${JSON.stringify(e)}`);for(let n of this.promiseResolvers.values())n.reject(r);this.promiseResolvers.clear(),this.fatalError=r}};var a6e=fe(ii());var C9=new pe(Zgr),Lwt=class{constructor(e,r,n,o,s){this.ctx=e;this.watcher=r;this.workspaceDatabasePersistenceManager=n;this.workspaceInit=new Map;this.watcher.onFileChange(async(c,l)=>{await this.indexFile(l,this.languageId(l)??"plaintext")}),this.watcher.onWorkspaceChange(async(c,l)=>{if(c===1){C9.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,a6e.CancellationToken.None);return}C9.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new Owt(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{C9.debug(this.ctx,`workspace ${l} indexed`),this.workspaceInit.delete(l)}))}}static{a(this,"MultiLanguageContextIndexWatcher")}isInitializing(e){for(let[r]of this.workspaceInit)if(e.startsWith(r))return!0;return!1}dispose(){return this.indexClient.dispose()}async indexAddedWorkspace(e){let r=await DGc(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,a6e.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{C9.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){C9.debug(this.ctx,`indexing workspace ${e}`);let r=D9t.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${D9t.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get(QW),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,a6e.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));C9.debug(this.ctx,`found ${d.length} files to index in ${e}`),await Promise.all(d.map(async f=>{let h=this.languageId(f);h&&await this.indexFile(f.replace(/\/+$/,""),h)})),C9.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{C9.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,a6e.CancellationToken.None)}catch(n){C9.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return d0n(e)}};async function DGc(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(DGc,"createIndexableWorkspaceFolder");var NGc=b.Object({filePath:b.String(),code:b.String(),offset:b.Number(),languageId:b.String(),timeout:b.Optional(b.Number()),waitForContext:b.Optional(b.Boolean())});async function MGc(t,e,r){try{await t.get(dT).start();let n=t.get(Lwt),o=r.timeout??1e3,s=Date.now(),c=[],l=!0;for(;l;)try{c=await n.indexClient.getContext(r.filePath,r.code,r.offset,r.languageId,Xgr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(FGc,"handleTestingNeverAuthChecked");var Y9r=we(BGc,FGc);p();p();p();var K9r=class extends bp{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},vro=a(t=>new K9r(t),"createTestCertificateReader");function Z9r(t,e,r){let n=new J9r;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new kx(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(Z9r,"createFakeResponse");function Cro(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),Z9r(t,n,Object.assign({"content-type":"application/json"},r))}a(Cro,"createFakeJsonResponse");var c6e=class extends Jt{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var Bwt=class extends c6e{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var J9r=class{constructor(){this.headers=new Map}static{a(this,"FakeHeaders")}append(e,r){this.headers.set(e.toLowerCase(),r)}delete(e){this.headers.delete(e.toLowerCase())}get(e){return this.headers.get(e.toLowerCase())??null}has(e){return this.headers.has(e.toLowerCase())}set(e,r){this.headers.set(e.toLowerCase(),r)}entries(){return this.headers.entries()}keys(){return this.headers.keys()}values(){return this.headers.values()}[Symbol.iterator](){return this.headers.entries()}};var X9r=class extends c6e{static{a(this,"ExpConfigFetcher")}constructor(e){super(),this.fullConfig={Features:[],Flights:{},Configs:[{Id:"vscode",Parameters:e.Parameters}],ParameterGroups:[],AssignmentContext:e.AssignmentContext}}fetch(e,r){return e.endsWith("telemetry")?Promise.resolve(Cro(200,this.fullConfig)):Promise.resolve(Z9r(404,""))}},Fwt=class extends X9r{constructor(r,n){super(r);this.delegate=n}static{a(this,"ExpConfigFetcherWithDelegate")}fetch(r,n){return r.endsWith("telemetry")?super.fetch(r,n):this.delegate.fetch(r,n)}};var UGc=b.Object({expFlags:b.Record(b.String(),b.Union([b.String(),b.Number(),b.Boolean()]))});function QGc(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(Jt,new Fwt(n,t.get(Jt)))}return["OK",null]}a(QGc,"handleTestingOverrideExpFlagsChecked");var bro=we(UGc,QGc);p();var qGc=b.Object({rules:fqt});function jGc(t,e,r){return t.get(pc).setTestingRules(r.rules),["OK",null]}a(jGc,"handleTestingSetContentExclusionRulesChecked");var Sro=we(qGc,jGc);p();var HGc=b.Object({workDoneToken:b.Union([b.String(),b.Number()]),chunks:b.Array(b.String()),followUp:b.Optional(b.String()),suggestedTitle:b.Optional(b.String()),skills:b.Optional(b.Array(b.String())),references:b.Optional(b.Array(A5)),options:b.Optional(b.Object({}))});function GGc(t,e,r){return t.get(b9).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(GGc,"handleTestingSetSyntheticTurnsChecked");var Tro=we(HGc,GGc);p();var $Gc=b.Object({});async function VGc(t,e,r){let n=t.get(ss),o=t.get(Jf);return await n.showWarningMessage("This is a test message",{title:"Some Action"}).then(c=>s(3,"response from message request",c?.title)).catch(c=>s(1,"error sending show message request",c)),["OK",null];function s(c,l,u){return o.logIt(t,c,"triggerShowMessage",`${l} (${String(u)})`)}a(s,"sendNotification")}a(VGc,"handleTriggerShowMessageChecked");var Iro=we($Gc,VGc);p();p();p();p();var xro=fe(require("tls"));var hCe=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(bp)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=xro.createSecureContext({_vscodeAdditionalCaCerts:e}),o=n.context;for(let s of e)o.addCACert(s);return{secureContext:n,certs:e}}async applyToRequestOptions(e){this.#e??=this.createSecureContext();let r=await this.#e;e.secureContext=r.secureContext,e.ca=r.certs,e.cert=r.certs}};p();var Uro=fe(require("http"));var A$c=407,Gy=new pe("proxySocketFactory"),Uk=class{static{a(this,"ProxySocketFactory")}},Doe=class extends Error{static{a(this,"ProxySocketError")}constructor(e,r,n){super(e),this.code=r?.code,this.syscall=r?.syscall,this.errno=r?.errno,/^Failed to establish a socket connection to proxies:/.test(r?.message??"")?this.code="ProxyFailedToEstablishSocketConnection":/^InitializeSecurityContext:/.test(r?.message??"")?this.code="ProxyInitializeSecurityContext":r?.message==="Miscellaneous failure (see text): Server not found in Kerberos database"?this.code="ProxyKerberosServerNotFound":/^Unspecified GSS failure. {2}Minor code may provide more information: No Kerberos credentials available/.test(r?.message??"")&&(this.code="ProxyGSSFailureNoKerberosCredentialsAvailable"),n!==void 0&&(this.code=n);let o=/^ProxyStatusCode(\d+)$/.exec(this.code??"");o&&(this.statusCode=Number(o[1]))}};function Uwt(t){return new r7r(t,new n7r(t))}a(Uwt,"getProxySocketFactory");var r7r=class extends Uk{constructor(r,n,o=new u6e,s=process.platform){super();this.ctx=r;this.delegate=n;this.kerberosLoader=o;this.platform=s;this.successfullyAuthorized=new Sn(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(Gy.debug(this.ctx,"Proxy authorization already successful once, skipping 407 round trip"),await this.reauthorize(r,n));try{return await this.delegate.createSocket(r,n)}catch(o){if(o instanceof Doe&&o.code===`ProxyStatusCode${A$c}`){Gy.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return Gy.debug(this.ctx,"Proxy authorization successful, caching result"),ft(this.ctx,"proxy.kerberosAuthorized"),this.successfullyAuthorized.set(this.getProxyCacheKey(n),!0),s}throw o}}async reauthorize(r,n){let o=await this.authorize(n);o&&(Gy.debug(this.ctx,"Proxy re-authorization successful, received token"),r.headers["Proxy-Authorization"]="Negotiate "+o)}async authorizeAndCreateSocket(r,n){let o=await this.authorize(n);if(Gy.debug(this.ctx,"Proxy authorization successful, received token"),o)return Gy.debug(this.ctx,"Trying to create socket with proxy authorization"),r.headers["Proxy-Authorization"]="Negotiate "+o,await this.delegate.createSocket(r,n)}async authorize(r){Gy.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);Gy.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);Gy.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return Gy.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return Gy.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return Gy.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},n7r=class extends Uk{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(As).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{Gy.debug(this.ctx,"Attempting to establish connection to proxy");let l=Uro.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{Gy.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new Doe(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new Doe(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(Gy.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{Gy.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new Doe(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{Gy.debug(this.ctx,"Proxy socket connection timeout"),c(new Doe(`tunneling socket could not be established, proxy socket connection timeout while connecting to ${o.hostname}:${o.port}`,void 0,"ProxyTimeout"))}),l.end()})}createConnectRequestOptions(r,n){let o=`${r.hostname}:${r.port}`,s={hostname:n.hostname,port:n.port,method:"CONNECT",path:o,agent:!1,headers:{host:o,"Proxy-Connection":"keep-alive","User-Agent":this.userAgent},timeout:r.timeout};return r.localAddress&&(s.localAddress=r.localAddress),this.configureProxyAuthorization(s,r,n.authorization),s}configureProxyAuthorization(r,n,o){r.headers["Proxy-Authorization"]=[],o&&r.headers["Proxy-Authorization"].push("Basic "+Buffer.from(o).toString("base64")),typeof n.headers?.["Proxy-Authorization"]=="string"&&r.headers["Proxy-Authorization"].push(n.headers["Proxy-Authorization"])}},u6e=class{static{a(this,"KerberosLoader")}load(){return Promise.resolve().then(()=>fe(Fro()))}};var Noe=class extends Jt{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new hCe(r),this.proxySocketFactory=r.get(Uk),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(Qo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(Qo).getHttpSettings()),this.updateNoProxy(r.get(Qo).getHttpSettings().noProxy),this.fetchApiByPass=this.createFetchApi(r,{proxy:""})}static{a(this,"HelixFetcher")}maybeCreateSocketFactory(r,n){if(!r?.proxy)return;let o=new URL(r.proxy);return async s=>(s.rejectUnauthorized=r.proxyStrictSSL,s.timeout=n,await this.certificateConfigurator.applyToRequestOptions(s),await this.proxySocketFactory.createSocket(s,{hostname:o.hostname,port:o.port,authorization:r.proxyAuthorization,kerberosServicePrincipal:r.proxyKerberosServicePrincipal}))}createFetchApi(r,n){let o=r.get(As),s=this.proxySocketTimeoutForTesting;return lro({userAgent:`GithubCopilot/${o.getVersion()}`,socketFactory:this.maybeCreateSocketFactory(n,s),rejectUnauthorized:n.proxyStrictSSL})}parseNoProxy(r){return r?.map(n=>n.trim()).filter(n=>n.length>0)||[]}updateNoProxy(r){if(this.noProxy=this.parseNoProxy(r),this.proxyExceptionFilters=void 0,!this.noProxy.length)return;if(this.noProxy.includes("*")){this.proxyExceptionFilters=[{regex:/.*/i}];return}let n=a(s=>{if(!s)return;s.startsWith(".")&&(s=`*${s}`);let c=s.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${c}$`,"i")}catch{return}},"toRegex"),o=[];for(let s of this.noProxy){let c=s,l;if(c.startsWith("[")){let d=c.indexOf("]");if(d!==-1){let f=c.slice(1,d),h=c.slice(d+1);h.startsWith(":")&&(l=h.slice(1)),c=f}}else{let d=c.split(":");d.length===2&&(c=d[0],l=d[1])}let u=n(c);u&&o.push({regex:u,port:l})}o.length&&(this.proxyExceptionFilters=o)}shouldBypassProxy(r){if(!this.proxyExceptionFilters||!this.proxyExceptionFilters.length)return!1;let n;try{n=new URL(r)}catch{return!1}let o=n.hostname;if(!o)return!1;let s=n.port||(n.protocol==="https:"?"443":"80"),c=o.toLowerCase();return this.proxyExceptionFilters.some(l=>l.regex.test(c)&&(!l.port||l.port===s))}async fetch(r,n){let o=n.signal,s=!1;if(n.timeout){let f=new AbortController;setTimeout(()=>{f.abort(),s=!0},n.timeout),n.signal?.addEventListener("abort",()=>f.abort()),n.signal?.aborted&&f.abort(),o=f.signal}let c={...n,body:n.body?n.body:n.json,signal:o},l=this.shouldBypassProxy(r);if(!l){await this.certificateConfigurator.applyToRequestOptions(c);let f=await this.certificateConfigurator.getCertificates();this.fetchApi.setCA(f)}let d=await(l?this.fetchApiByPass:this.fetchApi).fetch(r,c).catch(f=>{throw s?new Uz(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new kx(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var ACe=class extends og{constructor(r,n={}){super();this.env=n;this.recalculateUrlDefaults(r,this.getDefaultUrls())}static{a(this,"DefaultNetworkConfiguration")}getAuthAuthority(){return this.baseUrlObject.hostname}getConfiguredUrls(){return{serverUrl:this.baseUrlObject.href,apiUrl:this.apiUrl}}setConfiguredUrls(r,n){let o=this.getConfiguredUrls();this.recalculateUrlDefaults(r,n);let s=this.getConfiguredUrls();(o.apiUrl!==s.apiUrl||o.serverUrl!==s.serverUrl)&&r.get(Qt).resetToken("config_urls_changed"),r.get(op).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=a_({serverUrl:XQe(r,n.serverUrl),apiUrl:XQe(r,n.apiUrl)});this.baseUrlObject=new URL(o),this.apiUrl=s}getDefaultUrls(){return this.env.CODESPACES==="true"&&this.env.GITHUB_TOKEN&&this.env.GITHUB_SERVER_URL&&this.env.GITHUB_API_URL&&!this.env.GITHUB_COPILOT_TOKEN&&!this.env.GH_COPILOT_TOKEN?{apiUrl:this.env.GITHUB_API_URL,serverUrl:this.env.GITHUB_SERVER_URL}:{}}};p();var y$c=new pe("expConfigManager"),_$c=3600*1e3,jW=class{constructor(e,r){this.ctx=e;this.fetchedAt=0;r.onDidChangeTokenResult(n=>{n.copilotToken&&this.refresh({force:!0})})}static{a(this,"ExpConfigManager")}getBoolean(e){let r=this.cached?.variables[e];return typeof r=="boolean"?r:void 0}getNumber(e){let r=this.cached?.variables[e];return typeof r=="number"?r:void 0}getString(e){let r=this.cached?.variables[e];return typeof r=="string"?r:void 0}getRaw(e){return this.cached?.variables[e]}refresh({force:e=!1}={}){return this.inflight?this.inflight:!e&&this.cached!==void 0&&Date.now()-this.fetchedAt<_$c?Promise.resolve():(this.inflight=(async()=>{try{let{exp:r}=await this.ctx.get(tr).getFallbackExpAndFilters();this.cached=r,this.fetchedAt=Date.now()}catch(r){y$c.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};p();var yCe=class extends MB{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){Ma(e,r,n)}};p();var _Ce=class extends z4{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var Qwt=class extends C2{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var qwt=class extends dm{constructor(){super(...arguments);this.prompts=[];this.fetchResults=[];this.diffs=[]}static{a(this,"TestConversationInspector")}shouldInspect(){return!0}inspectPrompt(r){this.shouldInspect()&&this.prompts.push(r)}inspectFetchResult(r){this.shouldInspect()&&this.fetchResults.push(r)}documentDiff(r){this.shouldInspect()&&this.diffs.push(r)}};p();var jwt=class extends QW{constructor(){super(...arguments);this.allowedFiles=[]}static{a(this,"TestingFileSearch")}addAllowedFiles(r){this.allowedFiles.push(...r)}findFiles(r,{uri:n},o){return Promise.resolve(this.allowedFiles)}};p();function Qro(t,e="cl100k_base"){return{modelId:"gpt-3.5-turbo",modelFamily:t,uiName:"Test GPT",maxRequestTokens:6144,maxResponseTokens:2048,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:e,isExperimental:!1,stream:!0,toolCalls:!0}}a(Qro,"fakeChatModelConfiguration");function E$c(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a(E$c,"fakeEmbeddingModelConfiguration");var Hwt=class extends dl{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(Qro(r))}getModelConfigurationById(e){return Promise.resolve({...Qro(e),modelId:e})}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve(E$c(e))}};p();var Gwt=class extends sg{constructor(){super(...arguments);this.openedUrls=[];this.opened=new UA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},$wt=class extends ss{constructor(){super();this.sentMessages=[];this.warningPromises=[];this.informationPromises=[]}static{a(this,"TestNotificationSender")}performDismiss(){this.actionToPerform="DISMISS"}performAction(r){this.actionToPerform=r}showWarningMessage(r,...n){this.sentMessages.push(r);let o;if(this.actionToPerform)if(this.actionToPerform==="DISMISS")o=Promise.resolve(void 0);else{let s=n.find(c=>c.title===this.actionToPerform);o=s?Promise.resolve(s):Promise.resolve(void 0)}else o=n?Promise.resolve(n[0]):Promise.resolve(void 0);return this.warningPromises.push(o),o}showInformationMessage(r,...n){this.sentMessages.push(r);let o;if(this.actionToPerform)if(this.actionToPerform==="DISMISS")o=Promise.resolve(void 0);else{let s=n.find(c=>c.title===this.actionToPerform);o=s?Promise.resolve(s):Promise.resolve(void 0)}else o=n?Promise.resolve(n[0]):Promise.resolve(void 0);return this.informationPromises.push(o),o}showInformationModal(r,...n){return this.showInformationMessage(r,...n)}sendBackgroundAgentSessionUpdate(r,n,o,s){return Promise.resolve()}sendBackgroundAgentTodosChanged(r){return Promise.resolve()}async waitForMessages(){await Promise.all(this.warningPromises),await Promise.all(this.informationPromises)}};p();function qro(t,e,r,n){return iT.create(ZQe(t),e,r,n,e)}a(qro,"createTextDocument");var i7r=class extends $r{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new Ji;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new Ji;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new Ji;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new Ji;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new Ji;this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event}static{a(this,"SimpleTestTextDocumentManager")}init(r){this._workspaceFolders=r.map(n=>({uri:n.uri,name:n.name??ro(n.uri)}))}async readTextDocumentFromDisk(r){return super.readTextDocumentFromDisk(r)}getTextDocumentsUnsafe(){return this._openTextDocuments}setTextDocument(r,n,o){let s=qro(r,n,0,o);return this._openTextDocuments.push(s),s}updateTextDocument(r,n){let o=this._openTextDocuments.findIndex(c=>c.uri===r.toString());if(o<0)throw new Error("Document not found");let s=this._openTextDocuments[o];this._openTextDocuments[o]=qro(r,s.clientLanguageId,s.version+1,n)}setNotebookDocument(r,n){this._notebookDocuments.set(r.uri.replace(/#.*/,""),n)}findNotebook({uri:r}){return this._notebookDocuments.get(r.replace(/#.*/,""))}getWorkspaceFolders(){return this._workspaceFolders}},Vwt=class extends i7r{constructor(r){super(r);this.contents=new Map}static{a(this,"TestTextDocumentManager")}readTextDocumentFromDisk(r){return Promise.resolve(this.contents.get(r))}setDiskContents(r,n){this.contents.set(r,n)}};var o7r=class extends Jf{static{a(this,"NullLog")}logIt(...e){}},s7r=class extends Or{static{a(this,"TestAuthManager")}constructor(e,r){super(e,{}),this.transientSession=r&&Promise.resolve(r)}resolvePersistedSession(){return Promise.resolve(void 0)}signInEditor(e){return Promise.resolve({status:"OK",user:"test-user"})}signOutEditor(){return Promise.resolve({status:"NotSignedIn"})}revokeTokenById(){return Promise.resolve({affectedEditors:0})}useExistingToken(e){return Promise.resolve({status:"revoked"})}listAvailableTokens(){return Promise.resolve([])}};function v$c(t){let e=new rde;e.set(Qo,t),e.set(DK,t);let r=new s7r(e,{accessToken:"",login:"user"});e.set(Or,r),e.set(As,new As),e.set(up,new up),e.set(hx,new hx({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(bp,vro([])),e.set(Uk,Uwt(e)),e.set(HC,new HC),e.set(qP,new lGe);let n=new sCe;e.set($h,n);let o=new Qt(e,!0);e.set(Qt,o);let s=new Gp(e);return s.updateFromToken(n.defaultToken),e.set(Gp,s),e.set(l0,new l0),e.set(PM,new PM),e.set(ss,new $wt),e.set(sg,new Gwt),e.set(MB,new yCe),e.set(Jf,new o7r),e.set(jC,new jC),e.set(za,new za("test-session","test-machine","test-device")),e.set(fx,new fx(()=>Promise.resolve("test-device"))),e.set(og,new ACe(e)),e.set(sP,new _se),e.set(op,new op(e,"copilot-test")),e.set(tr,new tr(e)),e.set(jW,new jW(e,o)),e.set(AD,new AD),e.set(t2,new oue),e.set(ks,new iGe),e.set(Qd,new Qd),e.set(M4,new M4(e)),e.set(QW,new jwt),e.set(SD,new SD(e)),e.set(c6,Xpt(e)),e.set(_y,new _y),e.set(Xb,new Xb),e.set(l6,l6.default),e.set(cw,new cw(e,!1)),e.set(ih,new ih),e.set(si,new si(e)),e.set(fI,new rht),e.set(km,new km),e.set(Pm,pft(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(eS,new eS(e)),C$c(e),e.set(Zb,new Zb(e)),e.set(Nn,new Nn),e.set(z4,new _Ce),e.set(XN,new XN),e.set(Hw,new Hw),e.set(kT,new kT(e)),e}a(v$c,"_createBaselineContext");function C$c(t){t.set(Xo,new Xo(t)),t.set(Bc,new Bc(t)),t.set(jA,new jA(t)),t.set(fm,new fm),t.set(x0,new x0),t.set(dm,new qwt),t.set(Bk,new Bk(t,[])),t.set(dl,new Hwt),t.set(C2,new Qwt),t.set(m5,new m5(t));let e=new oM(t);t.set(oM,e),t.set(Lk,new Lk(e,t)),t.set(T5,new T5(t)),t.set(KI,new Nxt),t.set(Cb,new Cb(t.get(Lk),t.get(KI),t)),t.set(wg,new wg)}a(C$c,"registerConversation");function jro(){let t=v$c(new DK(new sue,new Map));return t.set(Jt,new Bwt),t.set(Ir,new a7r),t.set($r,new Vwt(t)),t.set(Go,new aq),t.set(pc,new pc(t)),t.set(Ru,new Ru(t)),t.set(pT,new tJe),t.set(KO,new KO(t)),t.set(O4,new Sge),t.set(hD,new Bdt),t.set(eu,new BKe),t.set(QA,new QA(t)),t.set(Eg,new CKe),t.set(Rm,new Rm),vKe(t),t.set(Ay,new FEe(t)),t}a(jro,"createLibTestingContext");var a7r=class extends Ir{constructor(r={name:"lib-tests-plugin",version:"2"},n={name:"lib-tests-editor",version:"1"},o=[{name:"lib-tests-related-plugin",version:"3"}]){super();this.editorPluginInfo=r;this.editorInfo=n;this.relatedPluginInfo=o}static{a(this,"LibTestsEditorInfo")}getEditorInfo(){return this.editorInfo}getEditorPluginInfo(){return this.editorPluginInfo}getRelatedPluginInfo(){return this.relatedPluginInfo}};var Gro=fe(require("fs"));var Hro=`${process.env.HOME}/.copilot-testing-gh-token`,Wwt,zwt;function $ro(t){let e=Vro(),r=new mwt(b$c);return t.forceSet($h,r),t.get(Or).setTransientSession(e),r}a($ro,"setIntegrationTokenManager");var b$c=a(async()=>{if(zwt)return zwt;let t=await Vro(),e=jro(),r=new Noe(e);return e.forceSet(Jt,r),zwt=xOt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new Ei('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),zwt},"getEnvelope");async function Vro(){let{session:t}=cGe(process.env);if(t)return t;try{Wwt??=(await Gro.promises.readFile(Hro)).toString().trim()}catch{Wwt??=process.env.GITHUB_TOKEN??""}if(!Wwt)throw new Error(`Tests: either GH_COPILOT_TOKEN, GITHUB_COPILOT_TOKEN, or GITHUB_TOKEN must be set, or there must be a GitHub token from an app with access to Copilot in ${Hro}. Run "npm run get_token" to get one.`);return{...a_({}),accessToken:Wwt,login:"copilot-client tests"}}a(Vro,"getTestingGitHubSession");var S$c=b.Object({options:b.Optional(b.Object({})),githubAppId:b.Optional(b.String())});async function T$c(t,e,r){return $ro(t),await t.get(Qt).primeToken(),["OK",null]}a(T$c,"handleTestingUseTestingTokenChecked");var Wro=we(S$c,T$c);p();var I$c=b.Object({});async function x$c(t,e,r){return await new qEe().uninstall(t),["OK",null]}a(x$c,"handleUninstallChecked");var zro=we(I$c,x$c);p();var w$c=psi;function R$c(t,e,r){let n=t.get(Pm),o={unregistered:[],notUnregistered:[]};return r.providers.forEach(s=>{try{n.unregisterContextProvider(s.id),o.unregistered.push(s.id)}catch{o.notUnregistered.push(s.id)}}),[o,null]}a(R$c,"unregisterContextProviders");var Yro=we(w$c,R$c);p();var c7r=fe(require("os"));var k$c=b.Object({expectedCertificate:b.String()});async function P$c(t,e,r){let o=(await jat(t).getAllRootCAs()).map(tCe),s=tCe(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${i9r(s)}. Only found those installed on the system:${c7r.EOL}${o.map(c=>"- "+i9r(c)).join(c7r.EOL)}`},null]}a(P$c,"handleVerifyCertificateChecked");var Kro=we(k$c,P$c);p();var D$c=b.Object({});async function N$c(){return[{status:!!await new u6e().load()},null]}a(N$c,"handleVerifyKerberosChecked");var Jro=we(D$c,N$c);p();var M$c=b.Object({source:b.String(),version:b.Number(),uri:b.String()});async function O$c(t,e,r){let o=await t.get($r).getTextDocument(r);return o?o.getText()!==r.source?[{status:!1,message:`Source mismatch: [State] ${o.getText()} !== [Request] ${r.source}`},null]:o.version!==r.version?[{status:!1,message:`Version mismatch: [State] ${o.version} !== [Request] ${r.version}`},null]:[{status:!0,message:""},null]:[{status:!1,message:`Document not found: <${r.uri}>`},null]}a(O$c,"handleVerifyStateChecked");var Zro=we(M$c,O$c);p();var L$c=b.Object({});function B$c(t,e,r){return[t.get($r).getWorkspaceFolders().map(o=>{let s=new URL(o.uri),c=decodeURIComponent(s.pathname);return{...o,path:c}}),null]}a(B$c,"handleVerifyWorkspaceStateChecked");var Xro=we(L$c,B$c);p();p();var vCe=fe(require("fs/promises")),eno=fe(require("os")),ff=fe(require("path"));var jp=new pe("GitWorktreeService"),F$c=20,ECe=class{constructor(e){this.ctx=e;this.gitInstances=new Sn(F$c)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=ff.resolve(e),n=this.gitInstances.get(r);return n||(n=qde(r),this.gitInstances.set(r,n)),n}generateTimestamp(){return new Date().toISOString().replace(/[:.]/g,"-").slice(0,19)}async runGitOperation(e,r,n,o){let s=ff.resolve(e);jp.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return jp.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw jp.error(this.ctx,`[git] ${r} failed for ${s}: ${l}`),c}}async isGitRepository(e){try{return await this.runGitOperation(e,"checkIsRepo",r=>r.checkIsRepo(),r=>`isRepo=${r}`)}catch{return!1}}async getHeadCommit(e){return(await this.runGitOperation(e,"rev-parse HEAD",n=>n.raw(["rev-parse","HEAD"]),n=>`head=${n.trim()}`)).trim()}async commitWorktreeChanges(e,r,n){let o=await this.runGitOperation(e,"status",s=>s.status(),s=>`files=${s.files.length}`);return o.files.length===0?(jp.info(this.ctx,`Skipping checkpoint commit for ${ff.resolve(e)} because there are no changes`),!1):(await this.runGitOperation(e,"add -A -- .",s=>s.raw(["add","-A","--","."])),await this.runGitOperation(e,`commit ${r}`,s=>s.commit(r)),jp.info(this.ctx,`Created ${n} commit for ${ff.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){jp.info(this.ctx,`Snapshotting copied changes in ${ff.resolve(e)} to establish the apply baseline`),await this.commitWorktreeChanges(e,"chore: snapshot copied worktree changes","copied worktree changes");let r=await this.getHeadCommit(e);return jp.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await vCe.mkdtemp(ff.join(eno.tmpdir(),"copilot-worktree-")),o=ff.join(n,"changes.patch");try{jp.info(this.ctx,`Writing temporary patch for ${ff.resolve(e)} to ${o} (${r.length} chars)`),await vCe.writeFile(o,r,"utf8"),await this.runGitOperation(e,`apply --check ${o}`,s=>s.raw(["apply","--check",o])),await this.runGitOperation(e,`apply ${o}`,s=>s.raw(["apply",o]))}finally{await vCe.rm(n,{recursive:!0,force:!0}),jp.info(this.ctx,`Removed temporary patch file ${o}`)}}async createWorktree(e){let{repositoryPath:r}=e;if(!await this.isGitRepository(r))throw new Error(`${r} is not a git repository`);let s=(await this.runGitOperation(r,"branch",g=>g.branch(),g=>`current=${g.current||"HEAD"}`)).current||"HEAD",c=await this.getHeadCommit(r),l=this.generateTimestamp(),u=`copilot/worktree-${l}`,d=`copilot-worktree-${l}`,f=ff.basename(r),h=ff.join(ff.dirname(r),`${f}.worktrees`),m=ff.join(h,d);return jp.info(this.ctx,`Preparing worktree creation for ${ff.resolve(r)} with branch ${u}, baseBranch ${s}, baseCommit ${c}`),await this.runGitOperation(r,`worktree add -b ${u} ${m} ${s}`,g=>g.raw(["worktree","add","-b",u,m,s])),jp.info(this.ctx,`Created worktree ${m} from ${ff.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){jp.info(this.ctx,`Preparing to remove worktree ${e} from ${ff.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),jp.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return jp.info(this.ctx,`Skipping status lookup for ${ff.resolve(e)} because it is not a git repository`),[];let r=await this.runGitOperation(e,"status",n=>n.status(),n=>`files=${n.files.length}`);return[...new Set(r.files.map(n=>n.path))]}async applyWorktreeChanges(e,r,n){jp.info(this.ctx,`Applying worktree changes from ${ff.resolve(e)} to ${ff.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");jp.info(this.ctx,o?`Committed pending worktree changes in ${ff.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${ff.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return jp.info(this.ctx,"No new commits to apply from worktree"),{baseCommit:s};let c=await this.runGitOperation(e,`diff --binary --full-index ${n}..${s}`,l=>l.raw(["diff","--binary","--full-index",`${n}..${s}`]),l=>`outputLength=${l.length}`);if(!c.trim())return jp.info(this.ctx,"No patch content to apply from worktree"),{baseCommit:s};try{await this.applyPatchToRepository(r,c)}catch(l){let u=l instanceof Error?l.message:String(l);throw new Error(`Failed to apply worktree patch: ${u}`)}return jp.info(this.ctx,`Applied worktree patch from ${n} to ${s}`),{baseCommit:s}}async stash(e){await this.runGitOperation(e,"stash push --include-untracked",r=>r.stash(["push","--include-untracked"])),jp.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),jp.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),jp.info(this.ctx,`Popped stash in ${e}`)}};p();var tno=fe(ii());var ZS=new pe("WorktreeService");var U$c=new tno.ProtocolRequestType("worktree/requestUserDecision"),d6e=class{constructor(e,r){this.ctx=e;this.gitService=r}static{a(this,"WorktreeService")}async requestUserDecision(e){let r=await this.gitService.getUncommittedChanges(e);if(r.length===0)return ZS.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";ZS.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(er).connection.sendRequest(U$c,{type:"uncommitted-changes",title:"Handle Uncommitted Changes",message:`You have ${r.length} uncommitted changes. How would you like to proceed?`,options:[{id:"copy",label:"Copy changes",description:"Copy uncommitted changes into the new worktree",recommended:!0},{id:"move",label:"Move changes",description:"Move uncommitted changes to the new worktree and clean the original"},{id:"skip",label:"Skip changes",description:"Create worktree from clean state, leave local changes untouched"},{id:"cancel",label:"Cancel",description:"Cancel worktree creation",destructive:!0}],defaultOption:"copy"});return o.cancelled?(ZS.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(ZS.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){ZS.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(ZS.info(this.ctx,`Stashing original repository changes before worktree creation for ${e}`),await this.gitService.stash(e));let o;try{o=await this.gitService.createWorktree({repositoryPath:e})}catch(s){throw n&&(ZS.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(ZS.info(this.ctx,`Migrating changes into worktree ${o.worktreePath} using strategy ${r}`),r==="copy"){await this.gitService.stashApply(o.worktreePath),await this.gitService.stashPop(e);let s=await this.gitService.snapshotCopiedChanges(o.worktreePath);o={...o,baseCommit:s},ZS.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);ZS.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw ZS.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return ZS.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){ZS.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return ZS.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var Q$c="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",q$c=["already exists in working directory","patch does not apply","patch failed"];function j$c(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&q$c.some(n=>e.includes(n))?Q$c:`Failed to apply worktree changes: ${e}`}a(j$c,"getWorktreeCompleteErrorMessage");var H$c=b.Object({repositoryPath:b.String()});async function G$c(t,e,r){try{let n=new ECe(t),o=new d6e(t,n),s=await o.requestUserDecision(r.repositoryPath);if(s==="cancel")return[{success:!1,error:"Worktree creation cancelled by user"},null];let c=await o.createWorktree(r.repositoryPath,s);return[{success:!0,worktreePath:c.worktreePath,worktreeDirName:c.worktreeDirName,branchName:c.branchName,baseBranchName:c.baseBranchName,baseCommit:c.baseCommit},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to create worktree: ${o}`}]}}a(G$c,"handleWorktreeCreateChecked");var rno=we(H$c,G$c),$$c=b.Object({repositoryPath:b.String(),worktreePath:b.String(),baseCommit:b.String()});async function V$c(t,e,r){try{let n=new ECe(t);return[{success:!0,baseCommit:(await new d6e(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:Ze.InternalError,message:j$c(n)}]}}a(V$c,"handleWorktreeCompleteChecked");var nno=we($$c,V$c),W$c=b.Object({worktreePath:b.String(),repositoryPath:b.String()});async function z$c(t,e,r){try{return await new ECe(t).removeWorktree(r.worktreePath,r.repositoryPath),[{success:!0},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to delete worktree: ${o}`}]}}a(z$c,"handleWorktreeDeleteChecked");var ino=we(W$c,z$c);var Moe=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function ono(){let t=new Map;return t.set(GXi.method,$Xi),t.set("getCompletions",kXi),t.set("getCompletionsCycling",PXi),t.set("getDefaultFileSafetyRules",DXi),t.set("copilot/parseTerminalCommand",Seo),t.set("getPanelCompletions",OXi),t.set(rXi.method,nXi),t.set("getVersion",BXi),t.set("getUserInfo",LXi),t.set("setEditorInfo",jeo),t.set("checkStatus",fZi),t.set("checkQuota",dZi),t.set("checkFileStatus",lZi),t.set("claude/checkCliCompatibility",oZi),t.set("codex/checkCliCompatibility",cZi),t.set("signInInitiate",d9r),t.set("signIn",d9r),t.set("signInWithCodeFlow",Jeo),t.set("signInWithDeviceFlow",eto),t.set("signInConfirm",Heo),t.set("signInWithGithubToken",tto),t.set("signOut",rto),t.set("auth/listAvailableTokens",vYi),t.set("auth/removeToken",CYi),t.set("auth/useExistingToken",bYi),t.set("notifyShown",beo),t.set("notifyAccepted",Eeo),t.set("notifyRejected",Ceo),t.set("notifyNextEditRejected",veo),t.set("telemetry/exception",nto),t.set("textDocument/copilotInlineEdit",_eo),t.set("testing/overrideExpFlags",bro),t.set("testing/alwaysAuth",E9r),t.set("testing/setAlwaysAuthed",E9r),t.set("testing/neverAuth",Y9r),t.set("testing/setNeverAuthed",Y9r),t.set("testing/useTestingToken",Wro),t.set("testing/setCompletionDocuments",IXi),t.set("testing/setPanelCompletionDocuments",eXi),t.set("testing/setNextEditDocument",heo),t.set("testing/triggerShowMessageRequest",Iro),t.set("testing/flushPromiseQueue",Aro),t.set("testing/getDocument",Ero),t.set("testing/chatml",ito),t.set("testing/setSyntheticTurns",Tro),t.set("testing/fetch",gro),t.set("testing/setContentExclusionRules",Sro),t.set("testing/getContext",_ro),t.set("uninstall",zro),t.set("debug/diagnostics",hXi),t.set("debug/listCertificates",VXi),t.set("debug/verifyState",Zro),t.set("debug/verifyCertificate",Kro),t.set("debug/verifyKerberos",Jro),t.set("debug/verifyWorkspaceState",Xro),t.set("debug/getAgentDebugLogPath",vXi),t.set("debug/exportAgentDebugLogToPath",EXi),t.set("context/registerProviders",Feo),t.set("context/unregisterProviders",Yro),t.set("conversation/preconditions",kZi),t.set("conversation/persistence",RZi),t.set("conversation/create",TZi),t.set("conversation/turn",MZi),t.set("conversation/turnDelete",OZi),t.set("conversation/destroy",IZi),t.set("conversation/compress",vZi),t.set("conversation/rating",PZi),t.set("conversation/copyCode",_Zi),t.set("conversation/insertCode",EZi),t.set("conversation/templates",NZi),t.set("conversation/modes",xZi),t.set("conversation/agents",yZi),t.set("conversation/registerTools",DZi),t.set("conversation/unregisterTools",LZi),t.set("conversation/updateToolsStatus",BZi),t.set("conversation/notifyCodeAcceptance",wZi),t.set("customAgent/registerExtensionAgents",oXi),t.set("customAgent/unregisterExtensionAgents",sXi),t.set("copilot/customAgent/list",iXi),t.set("copilot/customSkill/list",lXi),t.set("copilot/customPrompt/list",cXi),t.set("copilot/customInstruction/list",aXi),t.set("copilot/hook/list",jXi),t.set("copilot/models",zZi),t.set("copilot/managedSettings/get",WXi),t.set("copilot/models/getModelMetadataList",YZi),t.set("copilot/byok/saveModel",nZi),t.set("copilot/byok/deleteModel",TYi),t.set("copilot/byok/listModels",XJi),t.set("copilot/byok/saveApiKey",tZi),t.set("copilot/byok/deleteApiKey",SYi),t.set("copilot/byok/listApiKeys",wYi),t.set("copilot/byok/saveCustomProviderConfig",rZi),t.set("copilot/byok/listCustomProviderConfigs",RYi),t.set("copilot/byok/saveProviderConfig",iZi),t.set("copilot/byok/deleteProviderConfig",IYi),t.set("copilot/byok/listProviderConfigs",eZi),t.set("copilot/setModelPolicy",KZi),t.set("copilot/codeReview/reviewChanges",UZi),t.set("copilot/codeReview/reviewSnippets",QZi),t.set("git/commitGenerate",FXi),t.set("thinking/generateTitle",FZi),t.set("mcp/getTools",jZi),t.set("mcp/updateToolsStatus",HZi),t.set("mcp/readResource",GZi),t.set("mcp/registry/listServers",ueo),t.set("mcp/registry/getServer",deo),t.set("mcp/registry/getAllowlist",peo),t.set("mcp/getPrompt",$Zi),t.set("mcp/completePrompt",VZi),t.set("mcp/serverAction",WZi),t.set("mcpGateway/listServers",XXi),t.set("mcpGateway/getServerDetails",eeo),t.set("mcpGateway/serverAction",teo),t.set("mcpGateway/applyConfig",ZXi),t.set("plugins/list",Peo),t.set("plugins/install",Reo),t.set("plugins/installFromSource",keo),t.set("plugins/uninstall",Leo),t.set("plugins/enable",weo),t.set("plugins/disable",xeo),t.set("plugins/update",Beo),t.set("plugins/marketplace/add",Deo),t.set("plugins/marketplace/remove",Oeo),t.set("plugins/marketplace/list",Meo),t.set("plugins/marketplace/browse",Neo),t.set("githubApi/searchPR",qXi),t.set("githubApi/cancelCodingAgent",hZi),t.set("cloudAgent/listSessions",AZi),t.set("cloudAgent/getSessionLogs",gZi),t.set("cloudAgent/createJob",mZi),t.set("cloudAgent/addPullRequestComment",pZi),t.set("githubApi/listPullRequestChangedFiles",UXi),t.set("worktree/create",rno),t.set("worktree/complete",nno),t.set("worktree/delete",ino),t.set("backgroundAgent/create",Jzi),t.set("backgroundAgent/send",yYi),t.set("backgroundAgent/truncateHistory",EYi),t.set("backgroundAgent/fork",nYi),t.set("backgroundAgent/destroy",Zzi),t.set("backgroundAgent/listModels",pYi),t.set("backgroundAgent/listSessions",uYi),t.set("backgroundAgent/resume",gYi),t.set("backgroundAgent/stop",_Yi),t.set("backgroundAgent/interaction",aYi),t.set("backgroundAgent/enableRemote",rYi),t.set("backgroundAgent/disableRemote",eYi),t.set("backgroundAgent/getRemoteStatus",oYi),t.set("backgroundAgent/getPlanPath",iYi),t.set("backgroundAgent/compactHistory",zzi),new Moe(t)}a(ono,"getAllMethods");p();p();p();var sno=fe(s2());var $y=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new sno.NotificationType(this.name)}};var Y$c=new pe("BackgroundAgent.notifications"),l7r=class extends $y{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=b.Object({sessionId:b.String(),event:b.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},u7r=class extends $y{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=b.Object({sessionId:b.String(),externalToolDefinitions:O8r})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){Y$c.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(Ys).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},ano=[l7r,u7r];p();var d7r=class extends $y{constructor(){super(...arguments);this.name="copilot/didChangeToken";this.params=b.Unknown()}static{a(this,"DidChangeTokenNotificationHandler")}handle(){this.ctx.get(Qt).resetToken("did_change_token_notification")}},cno=[d7r];p();var K$c=new pe("agentCopilotTokenManager");function p7r(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(p7r,"tokenEndpointToApiUrl");function J$c(t,e){if(!e.tokenEndpoint)return a_(e);let r=p7r(e.tokenEndpoint);return r||K$c.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),a_({apiUrl:r})}a(J$c,"getUrlsFromParams");var f7r=class extends $y{constructor(){super(...arguments);this.name=JHt.method;this.params=JTn}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Or),o=J$c(this.ctx,r);this.ctx.get(og).setConfiguredUrls(this.ctx,o);let s=r.handle||r.login;s&&r?.accessToken?n.setTransientSession({accessToken:r.accessToken,login:s,githubAppId:r.githubAppId,...o}):n.setTransientSession({githubAppId:r.githubAppId,...o})}},lno=[f7r];p();var h7r=class extends $y{constructor(){super(...arguments);this.name=nGt.method;this.params=oIn}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(Fu).get(n);s&&Oli(this.ctx,s)}},m7r=class extends $y{constructor(){super(...arguments);this.name=oGt.method;this.params=uIn}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(fC).handleShown(n)}},g7r=class extends $y{constructor(){super(...arguments);this.name=iGt.method;this.params=sIn}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(Fu),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),Zge(this.ctx,c)):lht(this.ctx,c,o,void 0,void 0,"cumulative"))}},uno=[h7r,m7r,g7r];p();var Ywt=class extends $y{constructor(){super(...arguments);this.name="window/workDoneProgress/cancel";this.params=b.Object({token:b.Union([b.String(),b.Number()])})}static{a(this,"WorkDoneProgressCancelNotification")}handle(r){this.ctx.get(sM).cancel(r.token)}};p();var A7r=class extends $y{constructor(){super(...arguments);this.name="copilot/workspace/didChangeTrust";this.params=b.Object({items:b.Array(b.Object({folderUri:b.String(),trusted:b.Boolean()}))})}static{a(this,"WorkspaceDidChangeTrustNotificationHandler")}handle(r){let n=this.ctx.get(up);for(let o of r.items)n.setTrust(o.folderUri,o.trusted)}},dno=[A7r];var Z$c=[...ano,...cno,...lno,...uno,...dno,Ywt];function fno(t,e){for(let r of Z$c){let n=new r(t),o=Zu.Compile(n.params);e.onNotification(n.type,i0(t,async s=>{n9(s),o.Check(s)?await n.handle(s):Yo.error(t,`Notification ${n.name}:`,new ey(o.Errors(s)))},`Notification ${n.name}`))}}a(fno,"registerNotifications");p();var pno=fe(Wc());p();var CCe=fe(Wc());var X$c=new CCe.ProtocolNotificationType("copilot/customAgent/didChange"),eVc=new CCe.ProtocolNotificationType("copilot/customSkill/didChange"),tVc=new CCe.ProtocolNotificationType("copilot/customPrompt/didChange"),rVc=new CCe.ProtocolNotificationType("copilot/customInstruction/didChange"),y7r=new CCe.ProtocolNotificationType("copilot/hook/didChange");function nVc(t){switch(t){case"agent":return X$c;case"skill":return eVc;case"prompt":return tVc;case"instructions":return rVc;case"hook":return y7r;default:return}}a(nVc,"notificationTypeFor");var Kwt=class extends Eg{constructor(r){super();this.ctx=r;this.logger=new pe("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=nVc(r);if(!n){this.logger.debug(this.ctx,`No notification type mapped for PromptsType '${r}'; skipping.`);return}try{await this.ctx.get(er).connection.sendNotification(n,{})}catch(o){this.logger.debug(this.ctx,`Failed to send ${n.method}:`,o)}}};var iVc=new pno.ProtocolNotificationType("copilot/plugins/didChange"),Ooe=class{constructor(e,r){this.ctx=e;this.logger=new pe("pluginChangeNotifier");this.subscription=r.onDidChangePlugins(()=>{this.notify()})}static{a(this,"CLSPluginChangeNotifier")}async notify(){let e;try{e=this.ctx.get(er).connection}catch(n){this.logger.debug(this.ctx,"Failed to resolve connection for copilot/plugins/didChange:",n);return}let r=await Promise.allSettled([e.sendNotification(iVc,{}),e.sendNotification(y7r,{})]);for(let n of r)n.status==="rejected"&&this.logger.debug(this.ctx,"Failed to send a plugin change notification:",n.reason)}dispose(){this.subscription.dispose()}};p();p();var hno=fe(require("crypto")),mno=require("os");Fo();var oVc=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function sVc(t){let e=t.replace(/-/g,":").toLowerCase();return!oVc.has(e)}a(sVc,"validateMacAddress");function aVc(){let t=(0,mno.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(sVc(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a(aVc,"getMac");var _7r;function cVc(){try{let t=aVc();return hno.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(cVc,"getMacMachineId");function E7r(){return _7r||(_7r=cVc()||Dt()),_7r}a(E7r,"getMachineId");Fo();function v7r(t){let e=t??Dt()+Date.now();return new za(e,E7r(),E7r())}a(v7r,"createEditorSession");var gno=v7r();p();var Jwt=fe(Wc());var C7r=new pe("AgentTextDocumentConfiguration"),b7r=class{constructor(e){this.ctx=e;this.#e=new Ji;this.onDidChange=this.#e.event}static{a(this,"AgentTextDocumentsConfiguration")}#e;create(e,r,n,o){try{return iT.create(e,r,n,o)}catch(s){throw C7r.exception(this.ctx,s,".create"),s}}update(e,r,n){try{let o=[],s=iT.withChanges(e,r,n);for(let l of r)if(Jwt.TextDocumentContentChangeEvent.isIncremental(l)){let u=e.offsetAt(l.range.start),d=e.offsetAt(l.range.end),f={start:e.positionAt(u),end:e.positionAt(d)};for(let m of["start","end"])if(f[m].line!==l.range[m].line||f[m].character!==l.range[m].character){let g=`invalid range ${m} position ${JSON.stringify(l.range[m])}. Assuming ${JSON.stringify(f[m])}.`;C7r.warn(this.ctx,`textDocument/didChange for ${e.uri} has ${g}`);let A=Vt.createAndMarkAsIssued({message:`Received ${g}`});ft(this.ctx,`invalidRange.${m}`,A)}let h={range:f,rangeOffset:u,rangeLength:d-u,text:l.text};o.push(h),e=e.applyEdits([{range:h.range,newText:h.text}])}else{let u=e.getText().length,f={range:{start:e.positionAt(0),end:e.positionAt(u)},rangeOffset:0,rangeLength:u,text:l.text};o.push(f),e=e.applyEdits([{range:f.range,newText:f.text}])}let c={document:{uri:e.uri,version:n},contentChanges:o};return this.#e.fire(c),s}catch(o){throw C7r.exception(this.ctx,o,".update"),o}}},HW=class extends $r{constructor(){super(...arguments);this.#e=new Ji;this.onDidOpenTextDocument=this.#e.event;this.#t=new Ji;this.onDidCloseTextDocument=this.#t.event;this.#r=new Ji;this.onDidFocusTextDocument=this.#r.event;this._textDocumentConfiguration=new b7r(this.ctx);this.onDidChangeTextDocument=this._textDocumentConfiguration.onDidChange;this._documents=new Map;this._notebookDocuments=new Jwt.NotebookDocuments(this._textDocumentConfiguration);this.workspaceFolders=[];this.#n=new Ji;this.onDidChangeWorkspaceFolders=this.#n.event}static{a(this,"AgentTextDocumentManager")}#e;#t;#r;#n;get connection(){return this.ctx.get(er).connection}init(r){this.connection.onDidOpenTextDocument(o=>{let s=o.textDocument,c=this._textDocumentConfiguration.create(s.uri,s.languageId,s.version,s.text);this._documents.set(Gs(s.uri),c),this.#e.fire({document:{...s,uri:c.uri}})}),this.connection.onDidChangeTextDocument(o=>{let s=o.textDocument,c=o.contentChanges,{version:l}=s;if(l==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let u=Gs(s.uri),d=this._documents.get(u);d!==void 0&&(d=this._textDocumentConfiguration.update(d,c,l),this._documents.set(u,d))}),this.connection.onDidCloseTextDocument(o=>{let s=Gs(o.textDocument.uri);this._documents.delete(s),this.#t.fire({document:{uri:s}})}),this.connection.onNotification(eGt.type,o=>{let s=("textDocument"in o?o.textDocument:o)??{};this.#r.fire("uri"in s?{document:s}:{})}),this._notebookDocuments.listen(this.connection),this.workspaceFolders.length=0;let n=this.ctx.get(up);for(let o of r){let s=o.trusted;typeof s=="boolean"&&n.setTrust(o.uri,s)}this.workspaceFolders.push(...r),r.length>0&&this.#n.fire({workspaceFolders:this.workspaceFolders,added:r,removed:[]})}didChangeWorkspaceFolders(r){r.added.forEach(n=>this.registerWorkspaceFolder(n)),r.removed.forEach(n=>this.unregisterWorkspaceFolder(n)),this.#n.fire({workspaceFolders:this.workspaceFolders,added:r.added,removed:r.removed})}unregisterWorkspaceFolder(r){let n=this.workspaceFolders.findIndex(o=>o.uri===r.uri);n>=0&&this.workspaceFolders.splice(n,1),this.ctx.get(up).forget(r.uri)}registerWorkspaceFolder(r){let n=r.trusted;typeof n=="boolean"&&this.ctx.get(up).setTrust(r.uri,n),!this.workspaceFolders.find(o=>o.uri===r.uri)&&this.workspaceFolders.push(r)}getTextDocumentsUnsafe(){return[...this._documents.values()]}getTextDocumentUnsafe(r){return this._documents.get(Gs(r.uri))}getWorkspaceFolders(){return this.workspaceFolders}findNotebook(r){let n=this._notebookDocuments.findNotebookDocumentForCell(r.uri);if(n)return{getCells:a(()=>n.cells.map((o,s)=>this.wrapCell(o,s)).filter(o=>!!o),"getCells"),getCellFor:a(({uri:o})=>{let s=n.cells.findIndex(c=>c.document===o);return s!==-1?this.wrapCell(n.cells[s],s):void 0},"getCellFor")}}wrapCell(r,n){let o=this._notebookDocuments.getCellTextDocument(r);if(o)return{kind:r.kind,metadata:r.metadata??{},index:n,document:o}}};var Ano=Zu.Compile(rIn);function n9(t){if(t!==null){if(Array.isArray(t))for(let e=0;e{try{if(this.#r?.workspace?.configuration&&e&&typeof e=="object"&&!("settings"in e)){let n=await this.connection.workspace.getConfiguration(yno.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of J8e)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(i5).handleConfigurationChange(e.settings)}catch(n){Yo.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return lwt(this.ctx,n9(e))}catch(r){Yo.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(Jf)}static{a(this,"Service")}#e;#t;#r;#n;get clientCapabilities(){return this.#r}isWorkspaceTrustGateEnabled(){return this.#r?.experimental?.workspaceTrustGate===!0}listen(){let e=this.ctx,r=this.connection;r.onRequest(this.messageHandler.bind(this)),fno(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(As).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(HW).didChangeWorkspaceFolders(c)}catch(l){Yo.exception(e,l,"didChangeWorkspaceFolders")}}a(o,"didChangeWorkspaceFolders"),this.connection.onNotification("vs/didAddWorkspaceFolder",({name:c,uri:l})=>o({added:[{uri:l,name:c??l}],removed:[]})),this.connection.onNotification("vs/didRemoveWorkspaceFolder",({name:c,uri:l})=>o({added:[],removed:[{uri:l,name:c??l}]})),r.onInitialize(c=>{if(this.initialized)throw new Error("initialize request sent after initialized notification");this.#r=c.capabilities,e.get(up).setCapabilityEnabled(this.isWorkspaceTrustGateEnabled());let l=c.capabilities.copilot,u=n9(c.initializationOptions);if(u){if(!Ano.Check(u))throw new ey(Ano.Errors(u));let m=u,g=e.get(Ir);m.editorPluginInfo?g.setEditorAndPluginInfo({version:"unknown",...m.editorPluginInfo},m.editorInfo&&{version:"unknown",...m.editorInfo},m.relatedPluginInfo??[]):Yo.warn(e,"editorInfo and editorPluginInfo will soon be required in initializationOptions. This will replace setEditorInfo."),m.copilotIntegrationId&&g.setCopilotIntegrationId(m.copilotIntegrationId),m.githubAppId&&(e.get(ih).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(za,v7r(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(HW).init(c.workspaceFolders??[]),zoi(this.ctx),l&&(e.get(Nn).setCapabilities(l),l.contentProvider&&ga.registerSchemes(l.contentProvider),"openURL"in l&&uht(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,Yo.info(e,`${n.name} ${n.version} initialized`),e.get(Qt).primeToken().catch(m=>{e.get(ks).setErrorV2("auth",{message:`Failed while initializing: ${m}`,askToReSignin:!1,result:{status:"NotSignedIn"}})}),d&&r.workspace.onDidChangeWorkspaceFolders(o),c.capabilities.workspace?.didChangeConfiguration?.dynamicRegistration&&await r.client.register(ZI.DidChangeConfigurationNotification.type,{section:yno}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(Ib).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||cwt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(ks).sendInitNonAuthStatus(),new qEe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(i0(e,h,"onInitialized")),e.get(eM).init(),l?.token&&e.get(Or).setTransientSession({}),l?.redirectedTelemetry&&bzi(e),_no.lt(process.versions.node,"22.0.0")&&Yo.warn(e,`Node.js ${process.versions.node} support is deprecated. Please upgrade to Node.js 22 or newer.`),{capabilities:{textDocumentSync:{openClose:!0,change:ZI.TextDocumentSyncKind.Incremental},notebookDocumentSync:{notebookSelector:[{notebook:"*"}]},workspace:{workspaceFolders:{supported:d,changeNotifications:d}},executeCommandProvider:{commands:_zi(e,r)},inlineCompletionProvider:{}},serverInfo:n}}),r.onShutdown(async()=>{await(this.#e??=this.deactivate())}),r.onExit(()=>{this.onExit()}),r.onDidChangeConfiguration(c=>{this.handleDidChangeConfiguration(c)}),r.listen();let s=new nIt;this.ctx.forceSet(Jf,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");zp(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(Moe).handlers.get(e);if(!o)return new ZI.ResponseError(Ze.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new ZI.ResponseError(Ze.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new ZI.ResponseError(Ze.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!this.ctx.get(Ir).isEditorPluginInfoKnown())throw new ZI.ResponseError(Ze.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),n9(r);try{let[s,c]=await o(this.ctx,n,r);return c?new ZI.ResponseError(c.code,c.message,c.data):s}catch(s){if(n.isCancellationRequested)return new ZI.ResponseError(Ze.RequestCancelled,"Request was canceled");if(s instanceof Ei)return this.telemetryMethodFailure(e,s),new ZI.ResponseError(Ze.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof ZI.ResponseError||Yo.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get(HK).stop()}catch(e){Yo.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(r8).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(J8).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose plugin contribution injector")}try{this.ctx.get(Ooe).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose plugin change notifier")}try{this.ctx.get(Zie).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose MCP project cleanup subscription")}try{this.ctx.get(gy).dispose().catch(e=>{Yo.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){Yo.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(SG).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(R2).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(t6).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose Claude Code agent service")}try{this.ctx.get(Ca).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose agent plugin service")}this.ctx.get(Ys).shutdown().catch(e=>{Yo.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(_0).dispose()}catch(e){Yo.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(Jf,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(Ib).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),$Ar(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(Qd).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(l0).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},Yo=new pe("lsp");var hC=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new Eno.ProtocolRequestType("conversation/context");this.typeCheck=Zu.Compile(n)}static{a(this,"AgentSkillResolver")}async resolveSkill(e){let r=this.ctx.get(er).connection,n={conversationId:e.conversation.id,turnId:e.turn.id,skillId:this.skillId},o;try{let s=await r.sendRequest(this.requestType,n),[c,l]=s;if(l){let u=new vno.ResponseError(l.code,l.message,l.data);ot.error(this.ctx,`ResponseError while resolving skill ${this.skillId}`,u);return}o=c}catch(s){ot.error(this.ctx,`Error while resolving skill ${this.skillId}`,s);return}if(o!=null){if(!this.typeCheck.Check(o))throw new ey(this.typeCheck.Errors(o));return o}}};var S7r=class{constructor(e,r,n="",o="",s=[],c=[]){this.progressToken=e;this.chunks=r;this.followUp=n;this.suggestedTitle=o;this.skills=s;this.references=c}static{a(this,"SyntheticTurn")}},b9=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new S7r(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},Zwt=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(Bc)}static{a(this,"SyntheticTurnProcessor")}async process(e,r){try{await this.processWithSyntheticTurns(this.syntheticTurn,e,r)}catch(n){ot.error(this.turnContext.ctx,`Error processing turn ${this.turnContext.turn.id}`,n);let o=n.message;this.turnContext.turn.status="error",this.turnContext.turn.response={message:o,type:"meta"},await this.conversationProgress.end(this.turnContext.conversation,this.turnContext.turn,{error:{message:o,responseIsIncomplete:!0}})}}async processWithSyntheticTurns(e,r,n){await this.conversationProgress.begin(this.turnContext.conversation,this.turnContext.turn,r),await this.resolveSyntheticSkill(e,n),await this.processSyntheticChunks(e,n),await this.endSyntheticProgress(e,n),this.turnContext.turn.response={type:"model",message:e.chunks.join("")},this.turnContext.turn.status=n.isCancellationRequested?"cancelled":"success"}async resolveSyntheticSkill(e,r){let n=this.turnContext.ctx.get(Xo).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new hC(this.turnContext.ctx,s,b.Object({value:b.String()})).resolveSkill(this.turnContext);l&&!r.isCancellationRequested&&await this.conversationProgress.report(this.turnContext.conversation,this.turnContext.turn,{reply:l.value})}}async processSyntheticChunks(e,r){for(let n of e.chunks)r.isCancellationRequested||(await this.conversationProgress.report(this.turnContext.conversation,this.turnContext.turn,{reply:n}),await JC(1))}async endSyntheticProgress(e,r){r.isCancellationRequested?await this.conversationProgress.cancel(this.turnContext.conversation,this.turnContext.turn):await this.conversationProgress.end(this.turnContext.conversation,this.turnContext.turn,{followUp:{message:e.followUp,type:"followup",id:Dt()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var aM=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(b9).get(r);if(o)return new Zwt(e,o);let c=(await Iw(e.ctx)).find(u=>u.slug===e.turn.agent?.agentSlug);if(c?.turnProcessor)return c.turnProcessor(e);let l;return e.conversation.source==="inline"?l=new sXe(e.ctx):l=new mde(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new CPe(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new CPe(e,l):new cot(e,l)}};p();var GW=class extends tv{constructor(r){super(r);this.connection=null;this.capabilities={readTextFile:!1,writeTextFile:!1};this.currentSessionId=null}static{a(this,"ACPClientToolInvoker")}setACPContext(r,n,o){this.connection=r,this.capabilities=n,this.currentSessionId=o}clearACPContext(){this.currentSessionId=null}async invokeClientTool(r,n){if(!this.connection||!this.currentSessionId)return this.errorResult("ACP connection not available for tool invocation");switch(n.name){case"create_file":return this.handleCreateFile(n.input,n.toolCallId);case"insert_edit_into_file":return this.handleEditFile(n.input,n.toolCallId);default:return this.errorResult(`Tool ${n.name} is not supported in ACP mode`)}}async handleCreateFile(r,n){if(!this.capabilities.writeTextFile)return this.errorResult("Client does not support file writing");if(!r?.filePath||r.content===void 0)return this.errorResult("create_file requires filePath and content");try{let o=r.content;return await this.connection.writeTextFile({sessionId:this.currentSessionId,path:r.filePath,content:o}),await this.sendDiffUpdate(n,r.filePath,null,o),this.successResult(`Successfully created file: ${r.filePath}`)}catch(o){return this.errorResult(`Failed to create file ${r.filePath}: ${String(o)}`)}}async handleEditFile(r,n){if(!this.capabilities.writeTextFile)return this.errorResult("Client does not support file writing");if(!r?.filePath||r.code===void 0)return this.errorResult("insert_edit_into_file requires filePath and code");try{let o=null;if(this.capabilities.readTextFile)try{o=(await this.connection.readTextFile({sessionId:this.currentSessionId,path:r.filePath})).content}catch{}let s=r.code.replace(/\r\n/g,` +`);return await this.connection.writeTextFile({sessionId:this.currentSessionId,path:r.filePath,content:s}),await this.sendDiffUpdate(n,r.filePath,o,s),this.successResult(`Successfully edited file: ${r.filePath}`)}catch(o){return this.errorResult(`Failed to edit file ${r.filePath}: ${String(o)}`)}}async sendDiffUpdate(r,n,o,s){await this.connection.sessionUpdate({sessionId:this.currentSessionId,update:{sessionUpdate:"tool_call_update",toolCallId:r,content:[{type:"diff",path:n,oldText:o,newText:s}]}})}successResult(r){return new Gr([new Lr(r)],"success")}errorResult(r){return new Gr([new Lr(r)],"error")}};p();function lVc(t){switch(t){case"read_file":case"list_dir":case"get_errors":return"read";case"insert_edit_into_file":case"create_file":case"replace_string_in_file":return"edit";case"semantic_search":case"file_search":case"grep_search":return"search";case"run_in_terminal":case"run_subagent":return"execute";case"update_user_preferences":case"validate_cves":default:return"other"}}a(lVc,"mapToolNameToKind");function uVc(t,e){if(!e)return;let r=[];switch(t){case"read_file":case"insert_edit_into_file":case"create_file":case"replace_string_in_file":{let n=e.filePath;if(n){let o=e.startLine;r.push({path:n,line:o??void 0})}break}case"list_dir":{let n=e.path;n&&r.push({path:n});break}case"get_errors":{let n=e.filePaths;if(n&&Array.isArray(n))for(let o of n)r.push({path:o});break}}return r.length>0?r:void 0}a(uVc,"extractLocationsFromInput");function dVc(t){switch(t){case"not started":return"pending";case"running":return"in_progress";case"completed":return"completed";case"error":case"cancelled":return"failed";default:return"pending"}}a(dVc,"mapToolCallStatus");var Xwt=class{constructor(e,r){this.connection=e;this.sessionId=r;this.activeToolCalls=new Map;this.messageChunkBuffer=""}static{a(this,"ACPProgressReporter")}async begin(e,r,n,o){}async report(e,r,n,o){if(o.reply&&await this.reportTextChunk(o.reply),o.editAgentRounds){for(let s of o.editAgentRounds)if(s.reply&&await this.reportTextChunk(s.reply),s.toolCalls)for(let c of s.toolCalls){let l=dVc(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=uVc(c.name,c.input);await this.reportToolCallStart(c.id,c.name,lVc(c.name),l,c.input,d)}else c.status==="completed"?await this.reportToolCallComplete(c.id):c.status==="error"?await this.reportToolCallError(c.id,c.error||"Unknown error"):c.status==="cancelled"?await this.reportToolCallCancelled(c.id):u||await this.reportToolCallProgress(c.id,l)}}}async end(e,r,n,o){if(o?.error&&await this.reportTextChunk(` Error: ${o.error.message}`),this.messageChunkBuffer===""&&n.response?.message){let s=typeof n.response.message=="string"?n.response.message:JSON.stringify(n.response.message);await this.reportTextChunk(s)}await this.complete()}async cancel(e,r,n,o){o&&await this.reportTextChunk(` -Cancelled: ${o.message}`),await this.complete()}async reportTextChunk(e){this.messageChunkBuffer+=e,await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"agent_message_chunk",content:{type:"text",text:e}}})}async reportToolCallStart(e,r,n="other",o="pending",s,c){let l={toolCallId:e,title:r,kind:n,status:o};this.activeToolCalls.set(e,l),await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call",toolCallId:e,title:r,kind:n,status:o,rawInput:s,locations:c}})}async reportToolCallProgress(e,r="in_progress",n){let o=this.activeToolCalls.get(e);o&&(o.status=r,await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call_update",toolCallId:e,status:r,content:n}}))}async reportToolCallComplete(e,r){let n=this.activeToolCalls.get(e);n&&(n.status="completed",await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call_update",toolCallId:e,status:"completed",content:r}}),this.activeToolCalls.delete(e))}async reportToolCallError(e,r){let n=this.activeToolCalls.get(e);n&&(n.status="failed",await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call_update",toolCallId:e,status:"failed",content:[{type:"content",content:{type:"text",text:r}}]}}),this.activeToolCalls.delete(e))}async reportToolCallCancelled(e){let r=this.activeToolCalls.get(e);r&&(r.status="failed",await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call_update",toolCallId:e,status:"failed",content:[{type:"content",content:{type:"text",text:"Cancelled"}}]}}),this.activeToolCalls.delete(e))}async complete(){for(let[e]of this.activeToolCalls)await this.reportToolCallComplete(e)}};p();async function Xwt(t){try{if((await t.get(Fr).checkAndUpdateStatus()).status==="OK")return;let n=await uwt(t,(o,s)=>new uM(o,uM.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new ho(Ze.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof C7?new ho(Ze.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof Ei?new ho(Ze.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(Xwt,"performACPGitHubOAuth");function eRt(t){if(t!=="github_oauth")throw new ho(Ze.InvalidParams,`Unknown authentication method: ${t}`)}a(eRt,"validateAuthMethodId");async function tRt(t){let r=await t.get(Fr).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw ho.authRequired()}a(tRt,"requireACPAuthenticated");p();function Vu(t,e,r,n){$c(t,e,r,n)}a(Vu,"telemetryAcp");function bCe(t,e,r,n,o){zp(t,e,r,n,o)}a(bCe,"telemetryAcpWithError");var Eno=[{id:Nl.Ask.id,name:Nl.Ask.name,description:Nl.Ask.description},{id:Nl.Agent.id,name:Nl.Agent.name,description:Nl.Agent.description}],rRt=class{constructor(e,r){this.connection=e;this.ctx=r;this.sessions=new Map;this.clientCapabilities={readTextFile:!1,writeTextFile:!1}}static{a(this,"CopilotACPAgent")}initialize(e){if(e.clientInfo){let o=this.ctx.get(Ir);o instanceof Jj&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}Vu(this.ctx,"acp.initialize");let r=e.clientCapabilities?.fs;r&&(this.clientCapabilities={readTextFile:r.readTextFile??!1,writeTextFile:r.writeTextFile??!1});let n=[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}];return Promise.resolve({protocolVersion:Xit,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:A1(this.ctx)},authMethods:n})}async newSession(e){Vu(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=Dt(),n=Dt(),s=this.ctx.get(Xo).create({source:"panel",conversationId:n}),c=e.cwd?{uri:Ko(e.cwd)}:null,l=this.getAvailableModes(),u=this.getDefaultModeId(),{availableModels:d,defaultModelId:f}=await this.getAvailableModels(),h=f;return this.sessions.set(r,{conversationId:n,conversation:s,pendingPrompt:null,cancellationTokenSource:null,workspaceFolder:c,currentModeId:u,currentModelId:h}),{sessionId:r,modes:{currentModeId:u,availableModes:l},models:{currentModelId:h,availableModels:d}}}async authenticate(e){return Vu(this.ctx,"acp.authenticate"),eRt(e.methodId),await Xwt(this.ctx),{}}async requireAuthenticated(){await tRt(this.ctx)}async prompt(e){Vu(this.ctx,"acp.prompt"),await this.requireAuthenticated();let r=this.sessions.get(e.sessionId);if(!r)throw new Error(`Session ${e.sessionId} not found`);let n=process.env.GITHUB_COPILOT_ACP_MODEL_ID??r.currentModelId;r.pendingPrompt?.abort(),r.cancellationTokenSource?.cancel(),r.pendingPrompt=new AbortController,r.cancellationTokenSource=new jn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=Dt(),l=new lp(s,c),u=r.currentModeId===Nl.Ask.id?Nl.Ask:Nl.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(Xo),h=r.workspaceFolder?[{uri:r.workspaceFolder.uri,name:""}]:void 0;await f.addTurn(r.conversation.id,l,d,void 0,r.workspaceFolder??void 0,h);let m=new Zwt(this.connection,e.sessionId),g=new Qw(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(tv);A instanceof HW&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let _=await this.ctx.get(aM).createProcessor(g,e.sessionId);try{await _.process(m,r.cancellationTokenSource.token,void 0,void 0,{id:n})}finally{A instanceof HW&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(tv);if(s instanceof HW&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){Vu(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){Vu(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new ho(Ze.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new ho(Ze.InvalidParams,`Mode '${e.modeId}' is not available. Available modes: ${n.map(s=>s.id).join(", ")}`);return r.currentModeId=e.modeId,Promise.resolve({})}async unstable_setSessionModel(e){Vu(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new ho(Ze.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new ho(Ze.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return Dx(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?Eno:Eno.filter(e=>e.id===Nl.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?Nl.Agent.id:Nl.Ask.id}async getAvailableModels(){let e=await this.ctx.get(Ns).getMetadata(),r=[],n=lv;r.push({modelId:lv,name:"Auto",description:"Automatically selects the best model for the task"});for(let o of e)o.model_picker_enabled&&o.capabilities.type==="chat"&&this.isModelCompatibleWithAgentMode(o)&&r.push({modelId:o.id,name:o.name,description:this.getModelDescription(o)});return{availableModels:r,defaultModelId:n}}isModelCompatibleWithAgentMode(e){return!(Xle.has(e.capabilities.family)||!e.capabilities.supports?.tool_calls||(e.capabilities.limits?.max_prompt_tokens??0)<4e4)}getModelDescription(e){let r=e.billing?.multiplier;if(r!==void 0)return`${r}x`}extractTextFromPrompt(e){return e.filter(r=>r.type==="text").map(r=>r.text).join(` -`)}extractReferencesFromPrompt(e){let r=[];for(let n of e)if(n.type==="resource_link"){let o=n;r.push({type:"file",uri:o.uri})}else if(n.type==="resource"){let o=n;o.resource?.uri&&r.push({type:"file",uri:o.resource.uri})}return r}getFileSystemCapabilities(){return this.clientCapabilities}getConnection(){return this.connection}};p();var vno=require("node:child_process"),iRt=require("node:stream");var nRt=class{constructor(e,r){this.cliInfo=e;this.ctx=r;this.cliProcess=null;this._cliConnection=null;this.disposed=!1}static{a(this,"CLIProcessManager")}start(e,r){if(this.disposed)throw new Error("CLIProcessManager has been disposed");if(this.cliProcess)throw new Error("CLI process is already running");let n={...process.env,COPILOT_AUTO_UPDATE:"false"};r&&(n.GH_TOKEN=r);let o=[...this.cliInfo.args,"--acp","--stdio"];if(this.cliProcess=(0,vno.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:IQt}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{bCe(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||Vu(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=iRt.Writable.toWeb(this.cliProcess.stdin),c=iRt.Readable.toWeb(this.cliProcess.stdout),l=_Pe(s,c);return this._cliConnection=new oot(e,l),this._cliConnection}get connection(){return this._cliConnection}get isRunning(){return this.cliProcess!==null&&this.cliProcess.exitCode===null}async kill(){await this.terminateProcess()}async dispose(){this.disposed=!0,await this.terminateProcess()}async terminateProcess(){if(this.cliProcess){try{this.cliProcess.stdin?.end(),this.cliProcess.kill("SIGTERM")}catch{}await new Promise(e=>{if(!this.cliProcess){e();return}let r=setTimeout(()=>{this.cliProcess?.kill("SIGKILL"),e()},3e3);this.cliProcess.once("exit",()=>{clearTimeout(r),e()})}),this.cliProcess=null}this._cliConnection=null}};p();var oRt=class{constructor(e,r,n){this.externalConnection=e;this.ctx=r;this.cliProcessManager=n;this.cliConnection=null;this.initParams=null;this.ensureCLIPromise=null}static{a(this,"CLIProxyAgent")}initialize(e){if(e.clientInfo){let r=this.ctx.get(Ir);r instanceof Jj&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return Vu(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:Xit,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:A1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return Vu(this.ctx,"acp.cli.authenticate"),eRt(e.methodId),await Xwt(this.ctx),{}}async newSession(e){return Vu(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return Vu(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return Vu(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return Vu(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return Vu(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return Vu(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return Vu(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return Vu(this.ctx,"acp.cli.listSessions"),await this.requireAuthenticated(),(await this.ensureCLI()).listSessions(e)}async ensureCLI(){if(this.cliConnection)return this.cliConnection;if(!this.initParams)throw new ho(Ze.InternalError,"CLI connection not initialized. Call initialize() first.");if(this.ensureCLIPromise)return this.ensureCLIPromise;this.ensureCLIPromise=this.spawnAndInitializeCLI();try{return await this.ensureCLIPromise}finally{this.ensureCLIPromise=null}}async spawnAndInitializeCLI(){try{let r=(await this.ctx.get(Qt).getGitHubSession())?.accessToken;this.cliConnection=this.cliProcessManager.start(u=>this.createCLIClientHandler(),r);let n=this.initParams.clientInfo,o={name:"GitHub Copilot Language Server",version:A1(this.ctx)},s=n?{...n,_meta:{...n._meta??{},proxyClientInfo:o}}:o,c=this.cliConnection.initialize({protocolVersion:this.initParams.protocolVersion,clientCapabilities:this.initParams.clientCapabilities,clientInfo:s}),l=this.cliConnection.closed.then(()=>{throw new Error("CLI connection closed before initialize response was received")});l.catch(()=>{}),await Promise.race([c,l]),Vu(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw bCe(this.ctx,"acp.cli.handshake.error",e,{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source}),this.cliConnection=null,await this.cliProcessManager.kill(),new ho(Ze.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await tRt(this.ctx)}createCLIClientHandler(){return{sessionUpdate:a(async e=>{await this.externalConnection.sessionUpdate(e)},"sessionUpdate"),requestPermission:a(async e=>this.externalConnection.requestPermission(e),"requestPermission"),readTextFile:a(async e=>this.externalConnection.readTextFile(e),"readTextFile"),writeTextFile:a(async e=>this.externalConnection.writeTextFile(e),"writeTextFile"),createTerminal:a(async e=>({terminalId:(await this.externalConnection.createTerminal(e)).id}),"createTerminal"),extMethod:a(async(e,r)=>this.externalConnection.extMethod(e,r),"extMethod"),extNotification:a(async(e,r)=>this.externalConnection.extNotification(e,r),"extNotification")}}async dispose(){await this.cliProcessManager.dispose()}};p();p();var UPt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(upo(),lpo)),this._sdkPromise}async query(e){return(await this._loadSdk()).query(e)}async listSessions(e){return(await this._loadSdk()).listSessions(e)}async getSessionInfo(e,r){return(await this._loadSdk()).getSessionInfo(e,r)}async getSessionMessages(e,r){return(await this._loadSdk()).getSessionMessages(e,r)}async forkSession(e,r){return(await this._loadSdk()).forkSession(e,r)}};p();p();function dpo(t){let e=new tde;e.set(Qo,t),e.set(HC,new HC),e.set(As,new As),e.set(AD,new AD);let r=new Qt(e);return e.set(Qt,r),e.set(tr,new tr(e)),e.set(qW,new qW(e,r)),e.set(PM,new PM),e.set(Gp,new Gp(e)),e.set(c0,new c0),e.set(jC,new jC),e.set(JO,new Fwe),e.set(t2,new iue),e.set(qP,new BTe),e.set(Ud,new Ud),e.set(M4,new M4(e)),e.set(si,new si(e)),e.set(SD,new SD(e)),e.set(c6,Zpt(e)),e.set(_y,new _y),e.set(Xb,new Xb),e.set(l6,l6.default),e.set(Pf,new Pf(e)),e.set(cw,new cw(e)),e.set(ih,new ih),e.set(Zb,new Zb(e)),e.set(Nn,new Nn),e.set(Ru,new Ru(e)),e.set(KO,new KO(e)),e.set(XN,new XN),e.set(MJ,new MJ(e)),e}a(dpo,"createCommonContext");p();var QPt=class extends Jf{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||tIt(r))&&this.console.warn(`[${o}]`,...s)}};p();var mpo=require("node:os");var Hfl=new pe("repository"),ose="\\\\",gpo="(?:[#;].*)",Tbe=`(?:[^"${ose}]|${ose}.)`,Gfl="[0-9A-Za-z-]",fpo=`[A-Za-z]${Gfl}*`,Apo=`\\s*${gpo}?$`,ypo=`(?:[^"${ose};#]|${ose}.)`,$fl=`(?:"${Tbe}*"|"${Tbe}*(?${ose})$)`,Vfl=`(?:${ypo}|${$fl})+`,Wfl=`(?:(?${ose})$)`,_po=`(?${Vfl})${Wfl}?${Apo}`,ppo=new RegExp(`^${_po}`),zfl=new RegExp(`^(?${Tbe}*(?:(?${ose})$|(?")))`),Yfl=new RegExp(`^\\s*(?:(?${fpo})\\s*=\\s*${_po}|(?${fpo})${Apo})`),Kfl=new RegExp(`(?${ypo}+)|"(?${Tbe}*)"`,"g"),hpo="[-.0-9A-Za-z]+",Jfl=`\\s+"(?${Tbe}*)"`,Zfl=`\\s+"(?${Tbe}*)"`,Xfl=new RegExp(`^\\s*\\[(?:(?${hpo})${Jfl}|${Zfl}|(?${hpo}))\\]`),epl=new RegExp(`^\\s*${gpo}$`),dGr=class{constructor(e){this.content=e;this.stopped=!1;this.section="";this.line="";this.lineNum=0;this.lines=[];this.linesWithErrors=[]}static{a(this,"GitConfigParser")}parse(e){for(this.stopped=!1,this.section="",this.line="",this.linesWithErrors=[],this.configValueHandler=e,this.lines=this.content.split(/\r?\n/),this.lineNum=0;!this.stopped&&this.lineNum0}errorAt(e){this.linesWithErrors.push(e)}parseSectionStart(){let e=this.line.match(Xfl);e&&(e.groups?.simple?this.section=e.groups.simple.toLowerCase()+"."+this.unescapeBaseValue(e.groups.ext):e.groups?.extOnly?this.section="."+this.unescapeBaseValue(e.groups.extOnly):this.section=e.groups.simpleOnly.toLowerCase(),this.line=this.line.slice(e[0].length))}unescapeBaseValue(e){return e.replace(/\\(.)/g,"$1")}parseConfigPair(){let e=this.line.match(Yfl);if(e){if(e.groups?.key){let r=this.handleContinued(e);this.configValueHandler?.(this.nameWithSection(e.groups.key.toLowerCase()),r)}else e.groups?.soloKey&&this.configValueHandler?.(this.nameWithSection(e.groups.soloKey.toLowerCase()),"");this.line=""}}handleContinued(e){let r=e,n=[this.matchedValue(r)];for(;r?.groups?.cont||r?.groups?.strCont;){if(this.line=this.lines[++this.lineNum],this.lineNum>=this.lines.length){this.errorAt(this.lineNum);break}r.groups.strCont?(r=this.line.match(zfl),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(ppo),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(ppo),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))}return this.normalizeValue(n.join(""))}matchedValue(e){return e.groups.strCont?e.groups.value.slice(0,-1):e.groups.value}normalizeValue(e){let r=!1,n=[...e.matchAll(Kfl)].map(o=>o.groups?.value?(r=!0,this.unescapeValue(o.groups.value.replace(/\s/g," "))):(r=!1,this.unescapeValue(o.groups.string))).join("");return r?n.trimEnd():n}unescapeValue(e){let r={n:` -`,t:" ",b:"\b"};return e.replace(/\\(.)/g,(n,o)=>r[o]||o)}nameWithSection(e){return this.section?this.section+"."+e:e}parseComment(){epl.test(this.line)&&(this.line="")}},qPt=class extends l2{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await Pf.getRepoConfigLocation(e,r);if(!n)return;let o=await this.getParsedConfig(e,n);if(o)return this.mergeConfig(await this.baseConfig(e,n),o)}mergeConfig(...e){return e.filter(r=>r!==void 0).reduce((r,n)=>r.concat(n),new fJ)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new dGr(o),c=new fJ;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get(Go).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&Hfl.warn(e,`Failed to load git config from ${JSON.stringify(r)}:`,o);return}}async baseConfig(e,r){let n=await this.commondirConfigUri(e,r),o=Oa(this.xdgConfigUri(),"git","config"),s=Oa(this.homeUri(),".gitconfig");return this.mergeConfig(await this.getParsedConfig(e,o,!1),await this.getParsedConfig(e,s,!1),n?await this.getParsedConfig(e,n,!1):void 0)}async commondirConfigUri(e,r){if(ro(r).toLowerCase()!=="config.worktree")return;let n=Cf(r),o=Oa(n,"commondir");try{let s=(await e.get(Go).readFileString(o)).trimEnd();return Oa(qz(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?Ko(process.env.XDG_CONFIG_HOME):Oa(this.homeUri(),".config")}homeUri(){return Ko((0,mpo.homedir)())}};p();var Epo=require("child_process");var jPt=class extends l2{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,Epo.execFile)(r,n,{cwd:e},(c,l)=>{c?s(c):o(l)})})}async tryRunCommand(e,r,n,o){try{return await this.runCommand(r,n,o)}catch(s){eqt.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=ys(r);if(n===void 0)return;let o;try{o=(await jO()).path}catch(c){eqt.info(e,`Skipping git config lookup: ${c.message}`);return}let s=await this.tryRunCommand(e,n,o,["-c","safe.directory=*","config","--list","--null",...this.extraArgs()]);return s?this.extractConfig(s):void 0}extractConfig(e){let r=new fJ;for(let n of e.split("\0").filter(o=>o)){let o=n.split(` -`,1)[0],s=n.slice(o.length+1);r.add(o,s)}return r}extraArgs(){return[]}};function vpo(t){let e=dpo(t);return tpl(e),e.set(bp,jat(e)),e.set(Uk,Fwt(e)),e.set(l2,new fKe([new jPt,new qPt])),e}a(vpo,"createProductionContext");function tpl(t){t.set(hx,hx.fromEnvironment(!1)),t.set(MB,new yCe),t.set(Jf,new QPt(console))}a(tpl,"setupRudimentaryLogging");var nmm=new pe("context");p();var Kpo=require("fs");p();p();var $po=require("node:url");p();p();var Ibe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,bpo=new Set,fGr=typeof process=="object"&&process?process:{},Spo=a((t,e,r,n)=>{typeof fGr.emitWarning=="function"?fGr.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),HPt=globalThis.AbortController,Cpo=globalThis.AbortSignal;if(typeof HPt>"u"){Cpo=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},HPt=class{static{a(this,"AbortController")}constructor(){e()}signal=new Cpo;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let o of this.signal._onabort)o(n);this.signal.onabort?.(n)}}};let t=fGr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,Spo("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var rpl=a(t=>!bpo.has(t),"shouldWarn");var dz=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),Tpo=a(t=>dz(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?xbe:null:null,"getUintArray"),xbe=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},pGr=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=Tpo(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},QUe=class t{static{a(this,"LRUCache")}#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#c;#u;#l;#p;#g;#A;#h;#v;#m;#b;#T;#_;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#_,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#l,next:e.#p,prev:e.#g,get head(){return e.#A},get tail(){return e.#h},free:e.#v,isBackgroundFetch:a(r=>e.#f(r),"isBackgroundFetch"),backgroundFetch:a((r,n,o,s)=>e.#U(r,n,o,s),"backgroundFetch"),moveToTail:a(r=>e.#O(r),"moveToTail"),indexes:a(r=>e.#I(r),"indexes"),rindexes:a(r=>e.#x(r),"rindexes"),isStale:a(r=>e.#E(r),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:_,memoMethod:E,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!dz(r))throw new TypeError("max option must be a nonnegative integer");let x=r?Tpo(r):Array;if(!x)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=g,this.maxEntrySize=A||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=E,_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#i=_,this.#S=!!_,this.#c=new Map,this.#u=new Array(r).fill(void 0),this.#l=new Array(r).fill(void 0),this.#p=new x(r),this.#g=new x(r),this.#A=0,this.#h=0,this.#v=pGr.create(r),this.#s=0,this.#a=0,typeof d=="function"&&(this.#r=d),typeof f=="function"?(this.#n=f,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#C=!!this.#r,this.#y=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!dz(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!dz(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=dz(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!dz(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let k="LRU_CACHE_UNBOUNDED";rpl(k)&&(bpo.add(k),Spo("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",k,t))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new xbe(this.#e),r=new xbe(this.#e);this.#_=e,this.#T=r,this.#L=(s,c,l=Ibe.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#E(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?Ibe.now():0},this.#d=(s,c)=>{if(e[c]){let l=e[c],u=r[c];if(!l||!u)return;s.ttl=l,s.start=u,s.now=n||o();let d=s.now-u;s.remainingTTL=l-d}};let n=0,o=a(()=>{let s=Ibe.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"getNow");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#E=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#updateItemAge");#d=a(()=>{},"#statusTTL");#L=a(()=>{},"#setItemTTL");#E=a(()=>!1,"#isStale");#D(){let e=new xbe(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#B=(r,n,o,s)=>{if(this.#f(n))return 0;if(!dz(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!dz(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#P=a(e=>{},"#removeItemSize");#N=a((e,r,n)=>{},"#addItemSize");#B=a((e,r,n,o)=>{if(n||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#E(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#E(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#E(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#_&&this.#T){let c=this.#_[r],l=this.#T[r];if(c&&l){let u=c-(Ibe.now()-l);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let e=[];for(let r of this.#I({allowStale:!0})){let n=this.#u[r],o=this.#l[r],s=this.#f(o)?o.__staleWhileFetching:o;if(s===void 0||n===void 0)continue;let c={value:s};if(this.#_&&this.#T){c.ttl=this.#_[r];let l=Ibe.now()-this.#T[r];c.start=Math.floor(Date.now()-l)}this.#b&&(c.size=this.#b[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=Ibe.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#B(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#v.length!==0?this.#v.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#C&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#C&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#P(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#_&&this.#k(),this.#_&&(d||this.#L(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(new Error("evicted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#P(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#v.push(r)),this.#s===1?(this.#A=this.#h=0,this.#v.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#E(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#E(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new HPt,{signal:l}=n;l?.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let u={signal:c.signal,options:n,context:o},d=a((y,_=!1)=>{let{aborted:E}=c.signal,v=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(E&&!_?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),E&&!v&&!_)return h(c.signal.reason);let S=g;return this.#l[r]===g&&(y===void 0?S.__staleWhileFetching?this.#l[r]=S.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,u.options))),y},"cb"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),h(y)),"eb"),h=a(y=>{let{aborted:_}=c.signal,E=_&&n.allowStaleOnFetchAbort,v=E||n.allowStaleOnFetchRejection,S=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!S||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):E||(this.#l[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},"fetchFail"),m=a((y,_)=>{let E=this.#i?.(e,s,u);E&&E instanceof Promise&&E.then(v=>y(v===void 0?void 0:v),_),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(v=>d(v,!0),"res")))})},"pcall");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,f),A=Object.assign(g,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,A,{...u.options,status:void 0}),r=this.#c.get(e)):this.#l[r]=A,A}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof HPt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:_=!1,status:E,signal:v}=r;if(!this.#S)return E&&(E.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:E});let S={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:E,signal:v},T=this.#c.get(e);if(T===void 0){E&&(E.fetch="miss");let w=this.#U(e,T,S,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let N=n&&w.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",N&&(E.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#E(T);if(!_&&!R)return E&&(E.fetch="hit"),this.#O(T),o&&this.#R(T),E&&this.#d(E,T),w;let x=this.#U(e,T,S,y),D=x.__staleWhileFetching!==void 0&&n;return E&&(E.fetch=R?"stale":"refresh",D&&R&&(E.returnedStale=!0)),D?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#E(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#P(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(new Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#v.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(new Error("deleted"));else{let o=this.#u[r];this.#C&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#_&&this.#T&&(this.#_.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#v.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};var kbe=require("node:path"),Opo=require("node:url"),DB=require("fs"),fpl=fe(require("node:fs"),1),hz=require("node:fs/promises");p();var KPt=require("node:events"),EGr=fe(require("node:stream"),1),kpo=require("node:string_decoder");var Ipo=typeof process=="object"&&process?process:{stdout:null,stderr:null},npl=a(t=>!!t&&typeof t=="object"&&(t instanceof pz||t instanceof EGr.default||ipl(t)||opl(t)),"isStream"),ipl=a(t=>!!t&&typeof t=="object"&&t instanceof KPt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==EGr.default.Writable.prototype.pipe,"isReadable"),opl=a(t=>!!t&&typeof t=="object"&&t instanceof KPt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),L9=Symbol("EOF"),B9=Symbol("maybeEmitEnd"),fz=Symbol("emittedEnd"),GPt=Symbol("emittingEnd"),qUe=Symbol("emittedError"),$Pt=Symbol("closed"),xpo=Symbol("read"),VPt=Symbol("flush"),wpo=Symbol("flushChunk"),SM=Symbol("encoding"),wbe=Symbol("decoder"),_A=Symbol("flowing"),jUe=Symbol("paused"),Rbe=Symbol("resume"),EA=Symbol("buffer"),EC=Symbol("pipes"),vA=Symbol("bufferLength"),hGr=Symbol("bufferPush"),WPt=Symbol("bufferShift"),xE=Symbol("objectMode"),qh=Symbol("destroyed"),mGr=Symbol("error"),gGr=Symbol("emitData"),Rpo=Symbol("emitEnd"),AGr=Symbol("emitEnd2"),kB=Symbol("async"),yGr=Symbol("abort"),zPt=Symbol("aborted"),HUe=Symbol("signal"),sse=Symbol("dataListeners"),cx=Symbol("discarded"),GUe=a(t=>Promise.resolve().then(t),"defer"),spl=a(t=>t(),"nodefer"),apl=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),cpl=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),lpl=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),YPt=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[Rbe](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},_Gr=class extends YPt{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=o=>r.emit("error",o),e.on("error",this.proxyErrors)}},upl=a(t=>!!t.objectMode,"isObjectModeOptions"),dpl=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),pz=class extends KPt.EventEmitter{static{a(this,"Minipass")}[_A]=!1;[jUe]=!1;[EC]=[];[EA]=[];[xE];[SM];[kB];[wbe];[L9]=!1;[fz]=!1;[GPt]=!1;[$Pt]=!1;[qUe]=null;[vA]=0;[qh]=!1;[HUe];[zPt]=!1;[sse]=0;[cx]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");upl(r)?(this[xE]=!0,this[SM]=null):dpl(r)?(this[SM]=r.encoding,this[xE]=!1):(this[xE]=!1,this[SM]=null),this[kB]=!!r.async,this[wbe]=this[SM]?new kpo.StringDecoder(this[SM]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[EA],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[EC],"get")});let{signal:n}=r;n&&(this[HUe]=n,n.aborted?this[yGr]():n.addEventListener("abort",()=>this[yGr]()))}get bufferLength(){return this[vA]}get encoding(){return this[SM]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[xE]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[kB]}set async(e){this[kB]=this[kB]||!!e}[yGr](){this[zPt]=!0,this.emit("abort",this[HUe]?.reason),this.destroy(this[HUe]?.reason)}get aborted(){return this[zPt]}set aborted(e){}write(e,r,n){if(this[zPt])return!1;if(this[L9])throw new Error("write after end");if(this[qh])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let o=this[kB]?GUe:spl;if(!this[xE]&&!Buffer.isBuffer(e)){if(lpl(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(cpl(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[xE]?(this[_A]&&this[vA]!==0&&this[VPt](!0),this[_A]?this.emit("data",e):this[hGr](e),this[vA]!==0&&this.emit("readable"),n&&o(n),this[_A]):e.length?(typeof e=="string"&&!(r===this[SM]&&!this[wbe]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[SM]&&(e=this[wbe].write(e)),this[_A]&&this[vA]!==0&&this[VPt](!0),this[_A]?this.emit("data",e):this[hGr](e),this[vA]!==0&&this.emit("readable"),n&&o(n),this[_A]):(this[vA]!==0&&this.emit("readable"),n&&o(n),this[_A])}read(e){if(this[qh])return null;if(this[cx]=!1,this[vA]===0||e===0||e&&e>this[vA])return this[B9](),null;this[xE]&&(e=null),this[EA].length>1&&!this[xE]&&(this[EA]=[this[SM]?this[EA].join(""):Buffer.concat(this[EA],this[vA])]);let r=this[xpo](e||null,this[EA][0]);return this[B9](),r}[xpo](e,r){if(this[xE])this[WPt]();else{let n=r;e===n.length||e===null?this[WPt]():typeof n=="string"?(this[EA][0]=n.slice(e),r=n.slice(0,e),this[vA]-=e):(this[EA][0]=n.subarray(e),r=n.subarray(0,e),this[vA]-=e)}return this.emit("data",r),!this[EA].length&&!this[L9]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[L9]=!0,this.writable=!1,(this[_A]||!this[jUe])&&this[B9](),this}[Rbe](){this[qh]||(!this[sse]&&!this[EC].length&&(this[cx]=!0),this[jUe]=!1,this[_A]=!0,this.emit("resume"),this[EA].length?this[VPt]():this[L9]?this[B9]():this.emit("drain"))}resume(){return this[Rbe]()}pause(){this[_A]=!1,this[jUe]=!0,this[cx]=!1}get destroyed(){return this[qh]}get flowing(){return this[_A]}get paused(){return this[jUe]}[hGr](e){this[xE]?this[vA]+=1:this[vA]+=e.length,this[EA].push(e)}[WPt](){return this[xE]?this[vA]-=1:this[vA]-=this[EA][0].length,this[EA].shift()}[VPt](e=!1){do;while(this[wpo](this[WPt]())&&this[EA].length);!e&&!this[EA].length&&!this[L9]&&this.emit("drain")}[wpo](e){return this.emit("data",e),this[_A]}pipe(e,r){if(this[qh])return e;this[cx]=!1;let n=this[fz];return r=r||{},e===Ipo.stdout||e===Ipo.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[EC].push(r.proxyErrors?new _Gr(this,e,r):new YPt(this,e,r)),this[kB]?GUe(()=>this[Rbe]()):this[Rbe]()),e}unpipe(e){let r=this[EC].find(n=>n.dest===e);r&&(this[EC].length===1?(this[_A]&&this[sse]===0&&(this[_A]=!1),this[EC]=[]):this[EC].splice(this[EC].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[cx]=!1,this[sse]++,!this[EC].length&&!this[_A]&&this[Rbe]();else if(e==="readable"&&this[vA]!==0)super.emit("readable");else if(apl(e)&&this[fz])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[qUe]){let o=r;this[kB]?GUe(()=>o.call(this,this[qUe])):o.call(this,this[qUe])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[sse]=this.listeners("data").length,this[sse]===0&&!this[cx]&&!this[EC].length&&(this[_A]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[sse]=0,!this[cx]&&!this[EC].length&&(this[_A]=!1)),r}get emittedEnd(){return this[fz]}[B9](){!this[GPt]&&!this[fz]&&!this[qh]&&this[EA].length===0&&this[L9]&&(this[GPt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[$Pt]&&this.emit("close"),this[GPt]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==qh&&this[qh])return!1;if(e==="data")return!this[xE]&&!n?!1:this[kB]?(GUe(()=>this[gGr](n)),!0):this[gGr](n);if(e==="end")return this[Rpo]();if(e==="close"){if(this[$Pt]=!0,!this[fz]&&!this[qh])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[qUe]=n,super.emit(mGr,n);let s=!this[HUe]||this.listeners("error").length?super.emit("error",n):!1;return this[B9](),s}else if(e==="resume"){let s=super.emit("resume");return this[B9](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let o=super.emit(e,...r);return this[B9](),o}[gGr](e){for(let n of this[EC])n.dest.write(e)===!1&&this.pause();let r=this[cx]?!1:super.emit("data",e);return this[B9](),r}[Rpo](){return this[fz]?!1:(this[fz]=!0,this.readable=!1,this[kB]?(GUe(()=>this[AGr]()),!0):this[AGr]())}[AGr](){if(this[wbe]){let r=this[wbe].end();if(r){for(let n of this[EC])n.dest.write(r);this[cx]||super.emit("data",r)}}for(let r of this[EC])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[xE]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[xE]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[xE])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[SM]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(qh,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[cx]=!1;let e=!1,r=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return r();let o=this.read();if(o!==null)return Promise.resolve({done:!1,value:o});if(this[L9])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(qh,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(qh,f),this.pause(),s({value:h,done:!!this[L9]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(qh,f),r(),s({done:!0,value:void 0})},"onend"),f=a(()=>l(new Error("stream destroyed")),"ondestroy");return new Promise((h,m)=>{c=m,s=h,this.once(qh,f),this.once("error",l),this.once("end",d),this.once("data",u)})},"next"),throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[cx]=!1;let e=!1,r=a(()=>(this.pause(),this.off(mGr,r),this.off(qh,r),this.off("end",r),e=!0,{done:!0,value:void 0}),"stop"),n=a(()=>{if(e)return r();let o=this.read();return o===null?r():{done:!1,value:o}},"next");return this.once("end",r),this.once(mGr,r),this.once(qh,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[qh])return e?this.emit("error",e):this.emit(qh),this;this[qh]=!0,this[cx]=!0,this[EA].length=0,this[vA]=0;let r=this;return typeof r.close=="function"&&!this[$Pt]&&r.close(),e?this.emit("error",e):this.emit(qh),this}static get isStream(){return npl}};var ppl=DB.realpathSync.native,VUe={lstatSync:DB.lstatSync,readdir:DB.readdir,readdirSync:DB.readdirSync,readlinkSync:DB.readlinkSync,realpathSync:ppl,promises:{lstat:hz.lstat,readdir:hz.readdir,readlink:hz.readlink,realpath:hz.realpath}},Lpo=a(t=>!t||t===VUe||t===fpl?VUe:{...VUe,...t,promises:{...VUe.promises,...t.promises||{}}},"fsFromOption"),Bpo=/^\\\\\?\\([a-z]:)\\?$/i,hpl=a(t=>t.replace(/\//g,"\\").replace(Bpo,"$1\\"),"uncToDrive"),mpl=/[\\\/]/,eP=0,Fpo=1,Upo=2,PB=4,Qpo=6,qpo=8,ase=10,jpo=12,Xk=15,$Ue=~Xk,vGr=16,Ppo=32,WUe=64,TM=128,JPt=256,XPt=512,Dpo=WUe|TM|XPt,gpl=1023,CGr=a(t=>t.isFile()?qpo:t.isDirectory()?PB:t.isSymbolicLink()?ase:t.isCharacterDevice()?Upo:t.isBlockDevice()?Qpo:t.isSocket()?jpo:t.isFIFO()?Fpo:eP,"entToType"),Npo=new Map,zUe=a(t=>{let e=Npo.get(t);if(e)return e;let r=t.normalize("NFKD");return Npo.set(t,r),r},"normalize"),Mpo=new Map,ZPt=a(t=>{let e=Mpo.get(t);if(e)return e;let r=zUe(t.toLowerCase());return Mpo.set(t,r),r},"normalizeNocase"),e2t=class extends QUe{static{a(this,"ResolveCache")}constructor(){super({max:256})}},bGr=class extends QUe{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},Hpo=Symbol("PathScurry setAsCwd"),wE=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#n;get nlink(){return this.#n}#i;get uid(){return this.#i}#o;get gid(){return this.#o}#s;get rdev(){return this.#s}#a;get blksize(){return this.#a}#c;get ino(){return this.#c}#u;get size(){return this.#u}#l;get blocks(){return this.#l}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#A;get ctimeMs(){return this.#A}#h;get birthtimeMs(){return this.#h}#v;get atime(){return this.#v}#m;get mtime(){return this.#m}#b;get ctime(){return this.#b}#T;get birthtime(){return this.#T}#_;#C;#S;#y;#k;#R;#d;#L;#E;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=eP,n,o,s,c,l){this.name=e,this.#_=s?ZPt(e):zUe(e),this.#d=r&gpl,this.nocase=s,this.roots=o,this.root=n||this,this.#L=c,this.#S=l.fullpath,this.#k=l.relative,this.#R=l.relativePosix,this.parent=l.parent,this.parent?this.#e=this.parent.#e:this.#e=Lpo(l.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#L}resolve(e){if(!e)return this;let r=this.getRootString(e),o=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#P(o):this.#P(o)}#P(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#L.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#L.set(this,r),this.#d&=~vGr,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?ZPt(e):zUe(e);for(let u of n)if(u.#_===o)return u;let s=this.parent?this.sep:"",c=this.#S?this.#S+s+e:void 0,l=this.newChild(e,eP,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=TM),n.push(l),l}relative(){if(this.isCWD)return"";if(this.#k!==void 0)return this.#k;let e=this.name,r=this.parent;if(!r)return this.#k=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,r=this.parent;if(!r)return this.#R=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let o=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=o}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let o=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(o)?this.#y=`//?/${o}`:this.#y=o}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#y=n}isUnknown(){return(this.#d&Xk)===eP}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#d&Xk)===qpo}isDirectory(){return(this.#d&Xk)===PB}isCharacterDevice(){return(this.#d&Xk)===Upo}isBlockDevice(){return(this.#d&Xk)===Qpo}isFIFO(){return(this.#d&Xk)===Fpo}isSocket(){return(this.#d&Xk)===jpo}isSymbolicLink(){return(this.#d&ase)===ase}lstatCached(){return this.#d&Ppo?this:void 0}readlinkCached(){return this.#E}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#E)return!0;if(!this.parent)return!1;let e=this.#d&Xk;return!(e!==eP&&e!==ase||this.#d&JPt||this.#d&TM)}calledReaddir(){return!!(this.#d&vGr)}isENOENT(){return!!(this.#d&TM)}isNamed(e){return this.nocase?this.#_===ZPt(e):this.#_===zUe(e)}async readlink(){let e=this.#E;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#E=n}catch(r){this.#f(r.code);return}}readlinkSync(){let e=this.#E;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#E=n}catch(r){this.#f(r.code);return}}#N(e){this.#d|=vGr;for(let r=e.provisional;rn(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#H.push(e),this.#G)return;this.#G=!0;let o=this.fullpath();this.#e.readdir(o,{withFileTypes:!0},(s,c)=>{if(s)this.#M(s.code),n.provisional=0;else{for(let l of c)this.#Q(l,n);this.#N(n)}this.#V(n.slice(0,n.provisional))})}#j;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#j)await this.#j;else{let n=a(()=>{},"resolve");this.#j=new Promise(o=>n=o);try{for(let o of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#Q(o,e);this.#N(e)}catch(o){this.#M(o.code),e.provisional=0}this.#j=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let n of this.#e.readdirSync(r,{withFileTypes:!0}))this.#Q(n,e);this.#N(e)}catch(n){this.#M(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#d&Dpo)return!1;let e=Xk&this.#d;return e===eP||e===PB||e===ase}shouldWalk(e,r){return(this.#d&PB)===PB&&!(this.#d&Dpo)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((XPt|JPt|TM)&this.#d))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}realpathSync(){if(this.#D)return this.#D;if(!((XPt|JPt|TM)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[Hpo](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],o=this;for(;o&&o.parent;)r.add(o),o.#k=n.join(this.sep),o.#R=n.join("/"),o=o.parent,n.push("..");for(o=e;o&&o.parent&&!r.has(o);)o.#k=void 0,o.#R=void 0,o=o.parent}},t2t=class t extends wE{static{a(this,"PathWin32")}sep="\\";splitSep=mpl;constructor(e,r=eP,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=eP,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return kbe.win32.parse(e).root}getRoot(e){if(e=hpl(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new Pbe(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Bpo,"$1\\"),e===r}},r2t=class t extends wE{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=eP,n,o,s,c,l){super(e,r,n,o,s,c,l)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=eP,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},n2t=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#r;nocase;#n;constructor(e=process.cwd(),r,n,{nocase:o,childrenCacheSize:s=16*1024,fs:c=VUe}={}){this.#n=Lpo(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,Opo.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new e2t,this.#t=new e2t,this.#r=new bGr(s);let u=l.substring(this.rootPath.length).split(n);if(u.length===1&&!u[0]&&u.pop(),o===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=o,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let d=this.root,f=u.length-1,h=r.sep,m=this.rootPath,g=!1;for(let A of u){let y=f--;d=d.child(A,{relative:new Array(y).fill("..").join(h),relativePosix:new Array(y).fill("..").join("/"),fullpath:m+=(g?"":h)+A}),g=!0}this.cwd=d}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let c=e[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=this.#e.get(r);if(n!==void 0)return n;let o=this.cwd.resolve(r).fullpath();return this.#e.set(r,o),o}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let c=e[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=this.#t.get(r);if(n!==void 0)return n;let o=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,o),o}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let o=await e.readdir();return n?o:o.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(o=>o.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(e))&&l.push(n?e:e.fullpath());let u=new Set,d=a((h,m)=>{u.add(h),h.readdirCB((g,A)=>{if(g)return m(g);let y=A.length;if(!y)return m();let _=a(()=>{--y===0&&m()},"next");for(let E of A)(!s||s(E))&&l.push(n?E:E.fullpath()),o&&E.isSymbolicLink()?E.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(u,c)?d(v,_):_()):E.shouldWalk(u,c)?d(E,_):_()},!0)},"walk"),f=e;return new Promise((h,m)=>{d(f,g=>{if(g)return m(g);h(l)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(e))&&l.push(n?e:e.fullpath());let u=new Set([e]);for(let d of u){let f=d.readdirSync();for(let h of f){(!s||s(h))&&l.push(n?h:h.fullpath());let m=h;if(h.isSymbolicLink()){if(!(o&&(m=h.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(u,c)&&u.add(m)}}return l}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r;(!s||s(e))&&(yield n?e:e.fullpath());let l=new Set([e]);for(let u of l){let d=u.readdirSync();for(let f of d){(!s||s(f))&&(yield n?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(o&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(l,c)&&l.add(h)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new pz({objectMode:!0});(!s||s(e))&&l.write(n?e:e.fullpath());let u=new Set,d=[e],f=0,h=a(()=>{let m=!1;for(;!m;){let g=d.shift();if(!g){f===0&&l.end();return}f++,u.add(g);let A=a((_,E,v=!1)=>{if(_)return l.emit("error",_);if(o&&!v){let S=[];for(let T of E)T.isSymbolicLink()&&S.push(T.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(S.length){Promise.all(S).then(()=>A(null,E,!0));return}}for(let S of E)S&&(!s||s(S))&&(l.write(n?S:S.fullpath())||(m=!0));f--;for(let S of E){let T=S.realpathCached()||S;T.shouldWalk(u,c)&&d.push(T)}m&&!l.flowing?l.once("drain",h):y||h()},"onReaddir"),y=!0;g.readdirCB(A,!0),y=!1}},"process");return h(),l}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new pz({objectMode:!0}),u=new Set;(!s||s(e))&&l.write(n?e:e.fullpath());let d=[e],f=0,h=a(()=>{let m=!1;for(;!m;){let g=d.shift();if(!g){f===0&&l.end();return}f++,u.add(g);let A=g.readdirSync();for(let y of A)(!s||s(y))&&(l.write(n?y:y.fullpath())||(m=!0));f--;for(let y of A){let _=y;if(y.isSymbolicLink()){if(!(o&&(_=y.realpathSync())))continue;_.isUnknown()&&_.lstatSync()}_.shouldWalk(u,c)&&d.push(_)}}m&&!l.flowing&&l.once("drain",h)},"process");return h(),l}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[Hpo](r)}},Pbe=class extends n2t{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,kbe.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return kbe.win32.parse(e).root.toUpperCase()}newRoot(e){return new t2t(this.rootPath,PB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Dbe=class extends n2t{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,kbe.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new r2t(this.rootPath,PB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},YUe=class extends Dbe{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},Amm=process.platform==="win32"?t2t:r2t,Gpo=process.platform==="win32"?Pbe:process.platform==="darwin"?YUe:Dbe;p();var Apl=a(t=>t.length>=1,"isPatternList"),ypl=a(t=>t.length>=1,"isGlobList"),Nbe=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!Apl(e))throw new TypeError("empty pattern list");if(!ypl(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=r,this.#r=n,this.#n=o,this.#r===0){if(this.isUNC()){let[s,c,l,u,...d]=this.#e,[f,h,m,g,...A]=this.#t;d[0]===""&&(d.shift(),A.shift());let y=[s,c,l,u,""].join("/"),_=[f,h,m,g,""].join("/");this.#e=[y,...d],this.#t=[_,...A],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...c]=this.#e,[l,...u]=this.#t;c[0]===""&&(c.shift(),u.shift());let d=s+"/",f=l+"/";this.#e=[d,...c],this.#t=[f,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===ah}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#o=this.#o||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new t(this.#e,this.#t,this.#r+1,this.#n),this.#i.#c=this.#c,this.#i.#a=this.#a,this.#i.#s=this.#s,this.#i):this.#i=null}isUNC(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#n==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#s!==void 0?this.#s:this.#s=this.#n==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};p();p();var _pl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Mbe=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=_pl}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=c,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:o,noglobstar:s,optimizationLevel:2,platform:c,nocomment:!0,nonegate:!0};for(let l of e)this.add(l)}add(e){let r=new nv(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},IGr=class{static{a(this,"SubWalks")}store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(o=>o.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},KUe=class t{static{a(this,"Processor")}hasWalkedCache;matches=new TGr;subwalks=new IGr;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new SGr}processPatterns(e,r){this.patterns=r;let n=r.map(o=>[e,o]);for(let[o,s]of n){this.hasWalkedCache.storeWalked(o,s);let c=s.root(),l=s.isAbsolute()&&this.opts.absolute!==!1;if(c){o=o.resolve(c==="/"&&this.opts.root!==void 0?this.opts.root:c);let h=s.rest();if(h)s=h;else{this.matches.add(o,!0,!1);continue}}if(o.isENOENT())continue;let u,d,f=!1;for(;typeof(u=s.pattern())=="string"&&(d=s.rest());)o=o.resolve(u),s=d,f=!0;if(u=s.pattern(),d=s.rest(),f){if(this.hasWalkedCache.hasWalked(o,s))continue;this.hasWalkedCache.storeWalked(o,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(o.resolve(u),l,h);continue}else if(u===ah){(!o.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(o,s);let h=d?.pattern(),m=d?.rest();if(!d||(h===""||h===".")&&!m)this.matches.add(o,l,h===""||h===".");else if(h===".."){let g=o.parent||o;m?this.hasWalkedCache.hasWalked(g,m)||this.subwalks.add(g,m):this.matches.add(g,l,!0)}}else u instanceof RegExp&&this.subwalks.add(o,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),o=this.child();for(let s of r)for(let c of n){let l=c.isAbsolute(),u=c.pattern(),d=c.rest();u===ah?o.testGlobstar(s,c,d,l):u instanceof RegExp?o.testRegExp(s,u,d,l):o.testString(s,u,d,l)}return o}testGlobstar(e,r,n,o){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,o,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),o);else if(s===".."){let c=e.parent||e;this.subwalks.add(c,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),o)}}testRegExp(e,r,n,o){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,o,!1))}testString(e,r,n,o){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,o,!1))}};var Epl=a((t,e)=>typeof t=="string"?new Mbe([t],e):Array.isArray(t)?new Mbe(t,e):t,"makeIgnore"),i2t=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=Epl(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let o="cannot ignore child matches, ignore lacks add() method.";throw new Error(o)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let c=await s.realpath();c&&(c.isUnknown()||this.opts.stat)&&await c.lstat()}return this.matchCheckTest(s,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let c=s.realpathSync();c&&(c?.isUnknown()||this.opts.stat)&&c.lstatSync()}return this.matchCheckTest(s,r)}matchFinish(e,r){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let o=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+o)}else{let s=this.opts.posix?e.relativePosix():e.relative(),c=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?c+s+o:"."+o)}}async match(e,r,n){let o=await this.matchCheck(e,n);o&&this.matchFinish(o,r)}matchSync(e,r,n){let o=this.matchCheckSync(e,n);o&&this.matchFinish(o,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new KUe(this.opts),n)}walkCB2(e,r,n,o){if(this.#i(e))return o();if(this.signal?.aborted&&o(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,o));return}n.processPatterns(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||(s++,this.match(l,u,d).then(()=>c()));for(let l of n.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirCached();l.calledReaddir()?this.walkCB3(l,u,n,c):l.readdirCB((d,f)=>this.walkCB3(l,f,n,c),!0)}c()}walkCB3(e,r,n,o){n=n.filterEntries(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||(s++,this.match(l,u,d).then(()=>c()));for(let[l,u]of n.subwalks.entries())s++,this.walkCB2(l,u,n.child(),c);c()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new KUe(this.opts),n)}walkCB2Sync(e,r,n,o){if(this.#i(e))return o();if(this.signal?.aborted&&o(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,o));return}n.processPatterns(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||this.matchSync(l,u,d);for(let l of n.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirSync();this.walkCB3Sync(l,u,n,c)}c()}walkCB3Sync(e,r,n,o){n=n.filterEntries(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||this.matchSync(l,u,d);for(let[l,u]of n.subwalks.entries())s++,this.walkCB2Sync(l,u,n.child(),c);c()}},JUe=class extends i2t{static{a(this,"GlobWalker")}matches=new Set;constructor(e,r,n){super(e,r,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},ZUe=class extends i2t{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new pz({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var vpl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",IM=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,$po.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=r.platform||vpl,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=r.platform==="win32"?Pbe:r.platform==="darwin"?YUe:r.platform?Dbe:Gpo;this.scurry=new u(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",o={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new nv(u,o)),[c,l]=s.reduce((u,d)=>(u[0].push(...d.set),u[1].push(...d.globParts),u),[[],[]]);this.patterns=c.map((u,d)=>{let f=l[d];if(!f)throw new Error("invalid pattern object");return new Nbe(u,f,0,this.platform)})}async walk(){return[...await new JUe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new JUe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new ZUe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new ZUe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};p();var xGr=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new nv(r,e).hasMagic())return!0;return!1},"hasMagic");function s2t(t,e={}){return new IM(t,e).streamSync()}a(s2t,"globStreamSync");function Wpo(t,e={}){return new IM(t,e).stream()}a(Wpo,"globStream");function zpo(t,e={}){return new IM(t,e).walkSync()}a(zpo,"globSync");async function Vpo(t,e={}){return new IM(t,e).walk()}a(Vpo,"glob_");function a2t(t,e={}){return new IM(t,e).iterateSync()}a(a2t,"globIterateSync");function Ypo(t,e={}){return new IM(t,e).iterate()}a(Ypo,"globIterate");var Cpl=s2t,bpl=Object.assign(Wpo,{sync:s2t}),Spl=a2t,Tpl=Object.assign(Ypo,{sync:a2t}),Ipl=Object.assign(zpo,{stream:s2t,iterate:a2t}),o2t=Object.assign(Vpo,{glob:Vpo,globSync:zpo,sync:Ipl,globStream:Wpo,stream:bpl,globStreamSync:s2t,streamSync:Cpl,globIterate:Ypo,iterate:Tpl,globIterateSync:a2t,iterateSync:Spl,Glob:IM,hasMagic:xGr,escape:kue,unescape:u2});o2t.glob=o2t;var XUe=class t{constructor(){this.logger=new pe("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(QA),s=r.map(d=>un(d.uri)),l=o.resolvePatterns(n,s).map(async d=>{let f=d.metadata?[d.metadata]:void 0,h=a((m,g)=>({uri:m,watchable:d.watchable,cacheable:d.cacheable,metadata:f,classification:d.classification,timestamp:g}),"build");if(d.isGlob)return(await this.globFiles(d.pattern,e)).map(g=>h(Ko(g.path),g.timestamp));{let m=await this.getExactFile(e,d.pattern);return m?[h(m.uri,m.timestamp)]:[]}}),u=await Promise.all(l);return this.deduplicateFiles(u.flat())}async globFiles(e,r){let n;try{n=await o2t(e,{dot:!0,nodir:!0,absolute:!0})}catch{return[]}return this.statGlobMatches(r,n)}async statGlobMatches(e,r){let n=[];for(let o=0;o{try{let u=await Kpo.promises.stat(l);return u.isFile()?{path:l,timestamp:u.mtimeMs}:void 0}catch(u){this.logger.warn(e,`Skipping prompt file ${l} because it could not be stat'd:`,u);return}}));n.push(...c.filter(l=>l!==void 0))}return n}async getExactFile(e,r){let n=Ko(r);try{let o=await e.get(Go).stat(n);return(o.type&1)!==0?{uri:n,timestamp:o.mtime}:void 0}catch{return}}deduplicateFiles(e){let r=new Map;for(let n of e){let o=r.get(n.uri);if(!o){r.set(n.uri,n);continue}let s=o.watchable||n.watchable,c=o.cacheable||n.cacheable,l=n.metadata?.length?[...o.metadata??[],...n.metadata]:o.metadata,u=Math.max(o.timestamp,n.timestamp);(s!==o.watchable||c!==o.cacheable||l!==o.metadata||u!==o.timestamp)&&r.set(n.uri,{...o,watchable:s,cacheable:c,metadata:l,timestamp:u})}return Array.from(r.values())}};p();var Tgm=new pe("exp");function Zpo(t){let e=t.get(tr);e.registerStaticFilters(Rpl(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>kt(t,ze.DebugOverrideEngine)||kt(t,ze.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>KQe()?"copilot-web":t.get(Ir).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>Jpo(t)),e.registerDynamicFilter(_se.CopilotRelatedPluginVersionGithubCopilot,()=>Jpo(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>xpl(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Ir).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>c2t(t.get(Ir).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>wpl(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get(fx).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getRelatedPluginInfo()){let o=LE+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(_se).includes(o)){q9e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=c2t(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getEditorPluginSpecificFilters()){let o=n.isVersion?c2t(n.value):n.value;r[n.filter]=o}return r})}a(Zpo,"setupExperimentationService");function Jpo(t){return c2t(!t.get(As).isProduction()&&t.get(Ir).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Ir).getEditorPluginInfo().version)}a(Jpo,"getEditorPluginVersion");function xpl(t){let e=t.get(Ir).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a(xpl,"getPluginRelease");function wpl(t){let e=t.get(Ir).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(wpl,"getTargetPopulation");function Rpl(t){return kpl(t)}a(Rpl,"createAllFilters");function kpl(t){let e=t.get(za);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(As).isProduction()?A1(t):"1.999.0"}}a(kpl,"createDefaultFilters");function c2t(t){return t.split("-")[0]}a(c2t,"trimVersionSuffix");p();p();var Ppl=new Set(["__proto__","constructor","prototype"]);function tP(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}a(tP,"asObject");function e9e(t){return Object.entries(t).filter(([e])=>!Ppl.has(e))}a(e9e,"safeEntries");function wGr(t){if(Array.isArray(t))return t.map(wGr);let e=tP(t);return e?Object.fromEntries(e9e(e).map(([r,n])=>[r,wGr(n)])):t}a(wGr,"sanitizeRaw");function RGr(t){let e=tP(t);if(!e)return;let r={};for(let[n,o]of e9e(e))typeof o=="string"&&(r[n]=o);return r}a(RGr,"normalizeStringRecord");function Dpl(t){let e=tP(t);if(!e)return;let r={};return e.disableBypassPermissionsMode==="disable"&&(r.disableBypassPermissionsMode="disable"),r}a(Dpl,"normalizePermissions");function Npl(t,e){let r=tP(t);if(!r)return;let n=e9e(r);if(n.length!==1)return;let[o,s]=n[0];switch(o){case"serverUrl":return typeof s=="string"&&s.length>0?{serverUrl:s}:void 0;case"serverCommand":return Array.isArray(s)&&s.length>0&&s.every(c=>typeof c=="string"&&c.length>0)?{serverCommand:s}:void 0;case"serverName":return typeof s=="string"&&s.length>0&&(!e||/^[A-Za-z0-9_-]+$/.test(s))?{serverName:s}:void 0;default:return}}a(Npl,"normalizeMcpServerMatcher");function Xpo(t,e){if(!Array.isArray(t))return;let r=[];for(let n of t){let o=Npl(n,e);o&&r.push(o)}return r}a(Xpo,"normalizeMcpServers");function Mpl(t){if(!Array.isArray(t)||t.length===0)return;let e=[];for(let r of t){if(typeof r!="string"||r.length===0||e.includes(r))return;e.push(r)}return e}a(Mpl,"normalizeOrganizationLogins");function Opl(t){let e=tP(t);if(!e||e.mode!=="enabled"&&e.mode!=="disabled"&&e.mode!=="requireSSO")return;let r=Mpl(e.githubDotComOrganizations);return e.mode==="requireSSO"?r?{mode:e.mode,githubDotComOrganizations:r}:void 0:{mode:e.mode,...r!==void 0&&{githubDotComOrganizations:r}}}a(Opl,"normalizeRemoteControl");function Lpl(t){let e=tP(t);if(!e)return;let r={};for(let[n,o]of e9e(e))typeof o=="boolean"&&(r[n]=o);return r}a(Lpl,"normalizeEnabledPlugins");function eho(t){let e=tP(t);if(!(!e||typeof e.source!="string"))switch(e.source){case"github":return typeof e.repo!="string"||!/^[^/:]+\/[^/:]+$/.test(e.repo)?void 0:{source:"github",repo:e.repo,...typeof e.ref=="string"&&{ref:e.ref},...typeof e.path=="string"&&{path:e.path}};case"git":return typeof e.url!="string"?void 0:{source:"git",url:e.url,...typeof e.ref=="string"&&{ref:e.ref},...typeof e.path=="string"&&{path:e.path}};case"directory":return typeof e.path=="string"?{source:"directory",path:e.path}:void 0;default:return}}a(eho,"normalizeMarketplaceSource");function Bpl(t){let e=tP(t);if(!e)return;let r={};for(let[n,o]of e9e(e)){let s=tP(o),c=eho(s?.source);c&&(r[n]={source:c})}return r}a(Bpl,"normalizeExtraKnownMarketplaces");function Fpl(t){let e=tP(t);if(!(!e||typeof e.source!="string"))switch(e.source){case"github":case"git":case"directory":return eho(t);case"url":{if(typeof e.url!="string")return;let r=RGr(e.headers);return{source:"url",url:e.url,...r!==void 0&&{headers:r}}}case"npm":return typeof e.package=="string"?{source:"npm",package:e.package}:void 0;case"file":return typeof e.path=="string"?{source:"file",path:e.path}:void 0;case"hostPattern":return typeof e.hostPattern=="string"?{source:"hostPattern",hostPattern:e.hostPattern}:void 0;case"pathPattern":return typeof e.pathPattern=="string"?{source:"pathPattern",pathPattern:e.pathPattern}:void 0;default:return}}a(Fpl,"normalizeStrictMarketplaceEntry");function Upl(t){if(!Array.isArray(t))return;let e=[];for(let r of t){let n=Fpl(r);n&&e.push(n)}return e}a(Upl,"normalizeStrictKnownMarketplaces");function Qpl(t){let e=tP(t);if(!e)return;let r={};typeof e.enabled=="boolean"&&(r.enabled=e.enabled),typeof e.endpoint=="string"&&(r.endpoint=e.endpoint),typeof e.protocol=="string"&&(r.protocol=e.protocol),typeof e.captureContent=="boolean"&&(r.captureContent=e.captureContent),typeof e.lockCaptureContent=="boolean"&&(r.lockCaptureContent=e.lockCaptureContent),typeof e.serviceName=="string"&&(r.serviceName=e.serviceName);let n=RGr(e.headers);n&&(r.headers=n);let o=RGr(e.resourceAttributes);return o&&(r.resourceAttributes=o),r}a(Qpl,"normalizeTelemetry");function tho(t){let e=tP(t);if(!e)return{};let r=wGr(e),n=Xpo(r.allowedMcpServers,!0),o=Xpo(r.deniedMcpServers,!1),s=r.model==="auto"?r.model:void 0,c=Dpl(r.permissions),l=Opl(r.remoteControl),u=Lpl(r.enabledPlugins),d=Bpl(r.extraKnownMarketplaces),f=Upl(r.strictKnownMarketplaces),h=Qpl(r.telemetry);return{...n!==void 0&&{allowedMcpServers:n},...o!==void 0&&{deniedMcpServers:o},...s!==void 0&&{model:s},...c!==void 0&&{permissions:c},...l!==void 0&&{remoteControl:l},...u!==void 0&&{enabledPlugins:u},...d!==void 0&&{extraKnownMarketplaces:d},...f!==void 0&&{strictKnownMarketplaces:f},...h!==void 0&&{telemetry:h},raw:r}}a(tho,"normalizeManagedSettings");p();var qpl="managedSettings.fetch",jpl="managedSettings.active";function rho(t){return Object.keys(t).filter(e=>e!=="raw").length}a(rho,"countManagedSettingsKeys");function nho(t,e,r){$c(t,qpl,{result:r.result,channel:e,force:String(r.force),retainedLastKnownGood:String(r.retainedLastKnownGood),...r.hasSettings!==void 0&&{hasSettings:String(r.hasSettings)}},{...r.durationMs!==void 0&&{durationMs:r.durationMs},...r.payloadBytes!==void 0&&{payloadBytes:r.payloadBytes},...r.httpStatus!==void 0&&{httpStatus:r.httpStatus},...r.settingsKeyCount!==void 0&&{settingsKeyCount:r.settingsKeyCount}})}a(nho,"emitManagedSettingsFetchTelemetry");function iho(t,e){$c(t,jpl,{channel:e})}a(iho,"emitManagedSettingsActiveTelemetry");var sho=require("node:util");var Hpl=new pe("managedSettings.serverSource"),Gpl="copilot_internal/managed_settings",oho=3600*1e3,$pl="COPILOT_MANAGED_SETTINGS_REFRESH_INTERVAL_MS",Vpl=5*1e3,Wpl=60*1e3,zpl=1440*60*1e3;function aho(t,e=process.env){let r=t.get(Qt);return new kGr({resolveSession:a(async()=>await t.get(Fr).resolveSession(),"resolveSession"),fetch:a(async(n,o,s)=>await Gd(t,n,o,s),"fetch"),onDidChangeAuth:a(n=>{let o=[r.onDidChangeTokenResult(n),r.onDidResetToken(n)];return{dispose:a(()=>{for(let s of o)s.dispose()},"dispose")}},"onDidChangeAuth"),now:a(()=>t.get(HC).now().getTime(),"now"),refreshIntervalMs:Ypl(e),reportError:a(n=>Hpl.exception(t,n,".refresh"),"reportError"),emitTelemetry:a(n=>nho(t,"server",n),"emitTelemetry"),emitActiveTelemetry:a(()=>iho(t,"server"),"emitActiveTelemetry"),scheduleInterval:a((n,o)=>{let s=setInterval(n,o);return s.unref?.(),{dispose:a(()=>clearInterval(s),"dispose")}},"scheduleInterval")})}a(aho,"createServerManagedSettingsSource");function Ypl(t){let e=t[$pl];if(e===void 0||e.trim()==="")return oho;let r=Number(e);return Number.isFinite(r)&&r>=0?r:oho}a(Ypl,"getRefreshIntervalMs");function Kpl(t){if(t===null)return;let e=Number(t);return Number.isFinite(e)&&e>=0?e:void 0}a(Kpl,"parseContentLength");var kGr=class{constructor(e){this.dependencies=e;this.channel="server";this.didChangeEmitter=new Lc;this.onDidChange=this.didChangeEmitter.event;this.inflightByAccount=new Map;this.retryAfterByAccount=new Map;this.authGeneration=0;this.disposed=!1}static{a(this,"ServerManagedSettingsSource")}get current(){return this.currentValue}async refresh({force:e=!1}={}){if(this.disposed)return;this.startWatchingAuthChanges(),this.startPeriodicRefresh();let r=this.authGeneration;try{let n=await this.dependencies.resolveSession();if(this.disposed||r!==this.authGeneration)return;if(!n){this.currentAccountKey=void 0,this.lastSuccessfulFetch=void 0,this.updateCurrent(void 0);return}let o=this.getAccountKey(n);o!==this.currentAccountKey&&(this.currentAccountKey=o,this.lastSuccessfulFetch=void 0,this.updateCurrent(void 0));let s=this.inflightByAccount.get(o);if(s){await s;return}let c=this.dependencies.now(),l=this.retryAfterByAccount.get(o);if(l!==void 0&&cthis.dependencies.reportError(f)).finally(()=>{this.inflightByAccount.get(o)===d&&this.inflightByAccount.delete(o)});this.inflightByAccount.set(o,d),await d}catch(n){this.dependencies.reportError(n)}}dispose(){this.disposed||(this.disposed=!0,this.authSubscription?.dispose(),this.refreshSubscription?.dispose(),this.didChangeEmitter.dispose())}startWatchingAuthChanges(){this.authSubscription??=this.dependencies.onDidChangeAuth(()=>{this.authGeneration++,this.refresh()})}startPeriodicRefresh(){this.refreshSubscription||this.dependencies.refreshIntervalMs<=0||(this.refreshSubscription=this.dependencies.scheduleInterval(()=>{this.refresh({force:!0})},this.dependencies.refreshIntervalMs))}async fetchAndUpdate(e,r,n){let o=this.dependencies.now(),s={result:"error",force:n,retainedLastKnownGood:!1};try{let c=await this.dependencies.fetch(e,Gpl,{method:"GET",timeout:Vpl,headers:{Accept:"application/json"}});if(s.httpStatus=c.status,s.payloadBytes=Kpl(c.headers.get("content-length")),this.isStale(r)){s.result="stale";return}if(c.status===404){this.retryAfterByAccount.delete(r),this.lastSuccessfulFetch={accountKey:r,fetchedAt:this.dependencies.now()},this.updateCurrent(void 0),s.result="not_found",s.hasSettings=!1,s.settingsKeyCount=0;return}if(!c.ok){if(c.status===403||c.status===429){let u=(UM(c)??Wpl/1e3)*1e3,d=this.dependencies.now()+u;this.retryAfterByAccount.set(r,Math.max(this.retryAfterByAccount.get(r)??0,d)),s.result="rate_limited"}else s.result="http_error";throw new Rx(c)}let l=tho(await c.json());if(this.isStale(r)){s.result="stale";return}this.retryAfterByAccount.delete(r),this.lastSuccessfulFetch={accountKey:r,fetchedAt:this.dependencies.now()},this.updateCurrent(l),s.result="success",s.settingsKeyCount=rho(l),s.hasSettings=s.settingsKeyCount>0,s.hasSettings&&this.reportActive(r)}finally{s.durationMs=this.dependencies.now()-o,s.retainedLastKnownGood=(s.result==="error"||s.result==="http_error"||s.result==="rate_limited")&&this.currentValue!==void 0,this.dependencies.emitTelemetry(s)}}isStale(e){return this.disposed||e!==this.currentAccountKey}reportActive(e){let r=Math.floor(this.dependencies.now()/zpl);this.lastActiveReport?.accountKey===e&&this.lastActiveReport.day===r||(this.lastActiveReport={accountKey:e,day:r},this.dependencies.emitActiveTelemetry())}updateCurrent(e){(0,sho.isDeepStrictEqual)(this.currentValue,e)||(this.currentValue=e,this.didChangeEmitter.fire())}getAccountKey(e){return`${e.apiUrl}\0${e.login}`}};p();var mz=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var Obe=class{static{a(this,"AbstractCopilotMessageSender")}};p();var cho=100,lho=1e3*60*5;function uho(t){let e=new PGr(t);t.get(km).registerContextProvider(e),t.get(O4).add(e.id)}a(uho,"registerRelatedFilesShim");var PGr=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new aP(cho,lho);this.relatedFilesCache=new aP(cho,lho);this.resolver={resolve:a(async(r,n)=>{let o=r.documentContext.uri,s=r.documentContext.languageId;return await this.getTraits(o,s,n)},"resolve")}}static{a(this,"RelatedFilesShim")}async getTraits(e,r,n){return this.traitCache.has(e)||await this.requestRelatedFilesAndTraits(e,r,r,n),this.traitCache.get(e)??[]}async requestRelatedFilesAndTraits(e,r,n,o){try{let s=await this.ctx.get(tr).fetchTokenAndUpdateExPValuesAndAssignments({uri:e,languageId:n}),c={uri:e,clientLanguageId:r,detectedLanguageId:n},l=await Ppt(this.ctx,c,s,o,!0);if(o?.isCancellationRequested)return;let u=l.traits.filter(f=>f.includeInPrompt).map(f=>f.promptTextOverride?{name:"OtherInformation",value:f.promptTextOverride}:f),d=new Set;for(let f of l.entries.values())for(let h of f.keys())d.add(h);this.traitCache.set(e,u),this.relatedFilesCache.set(e,Array.from(d))}catch(s){MK(this.ctx,s,"relatedFilesShim")}}};var omo=fe(Jee()),smo=fe(require("path"));p();var t9e=fe(ii());var Jpl=new t9e.ProtocolRequestType("workspace/readFile"),Zpl=new t9e.ProtocolRequestType("workspace/readDirectory"),Xpl=new t9e.ProtocolRequestType("workspace/findFiles"),ehl=new t9e.ProtocolRequestType("workspace/findTextInFiles"),l2t=class extends ga{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(Jpl,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(Zpl,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(Xpl,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(ehl,r,"findTextInFiles",n=>({matchCount:n.matches.length}))}get connection(){return this.ctx.get(er).connection}async sendRequestWithTelemetry(r,n,o,s){let c=performance.now();try{let l=await this.connection.sendRequest(r,n),u=Math.round(performance.now()-c);return sr(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw Hs(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var u2t=class extends u5{constructor(r){super();this.ctx=r}static{a(this,"AgentLSPRequestSender")}async sendRequest(r,n){let o=this.ctx.get(er);try{return await o.connection.sendRequest(r,n)}catch(s){throw Hs(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var d2t=class t extends ete{constructor(r){super(r);this.reportedUnknownProviders=new Set}static{a(this,"AgentRelatedFilesProvider")}get service(){return this.context.get(er)}static mapProviderNameToNeighboringFileType(r){let n="CSharpCopilotCompletionContextProvider",o="CSharpRoslynCompletionRelatedContextProvider",s="CppCopilotCompletionContextProvider",c="CppCopilotCompletionSemanticCodeContextProvider";switch(r){case n:return"related/csharp";case o:return"related/csharproslyn";case s:return"related/cpp";case c:return"related/cppsemanticcodecontext";default:return"related/other"}}convert(r){let n={entries:[],traits:r.traits};for(let o of r.entries){let s={type:t.mapProviderNameToNeighboringFileType(o.providerName),uris:o.uris};n.entries.push(s),s.type==="related/other"&&!this.reportedUnknownProviders.has(o.providerName)&&(this.reportedUnknownProviders.add(o.providerName),Pg.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){Pg.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(Nn).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return Pg.debug(this.context,"`copilot/related` not supported"),Pci;try{let c=await this.service.connection.sendRequest(oGt.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){Pg.exception(this.context,c,".copilotRelated");return}}static{this.telemetrySent=!1}static relatedCapabilityTelemetry(r,n,o){try{if(!o||t.telemetrySent)return;t.telemetrySent=!0,ft(r,"copilotRelated.hasRelatedCapability",n)}catch(s){Pg.exception(r,s,"copilotRelated")}}};p();p();var Aho=fe(ii());p();p();function dho(t,e){return(e<<5)-e+t|0}a(dho,"numberHash");function fho(t,e){e=dho(149417,e);for(let r=0,n=t.length;rnew uM(o,uM.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new ho(Ze.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof C7?new ho(Ze.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof Ei?new ho(Ze.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(eRt,"performACPGitHubOAuth");function tRt(t){if(t!=="github_oauth")throw new ho(Ze.InvalidParams,`Unknown authentication method: ${t}`)}a(tRt,"validateAuthMethodId");async function rRt(t){let r=await t.get(Or).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw ho.authRequired()}a(rRt,"requireACPAuthenticated");p();function Vu(t,e,r,n){$c(t,e,r,n)}a(Vu,"telemetryAcp");function bCe(t,e,r,n,o){zp(t,e,r,n,o)}a(bCe,"telemetryAcpWithError");var Cno=[{id:Nl.Ask.id,name:Nl.Ask.name,description:Nl.Ask.description},{id:Nl.Agent.id,name:Nl.Agent.name,description:Nl.Agent.description}],nRt=class{constructor(e,r){this.connection=e;this.ctx=r;this.sessions=new Map;this.clientCapabilities={readTextFile:!1,writeTextFile:!1}}static{a(this,"CopilotACPAgent")}initialize(e){if(e.clientInfo){let o=this.ctx.get(Ir);o instanceof Jj&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}Vu(this.ctx,"acp.initialize");let r=e.clientCapabilities?.fs;r&&(this.clientCapabilities={readTextFile:r.readTextFile??!1,writeTextFile:r.writeTextFile??!1});let n=[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}];return Promise.resolve({protocolVersion:Xit,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:A1(this.ctx)},authMethods:n})}async newSession(e){Vu(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=Dt(),n=Dt(),s=this.ctx.get(Xo).create({source:"panel",conversationId:n}),c=e.cwd?{uri:Ko(e.cwd)}:null,l=this.getAvailableModes(),u=this.getDefaultModeId(),{availableModels:d,defaultModelId:f}=await this.getAvailableModels(),h=f;return this.sessions.set(r,{conversationId:n,conversation:s,pendingPrompt:null,cancellationTokenSource:null,workspaceFolder:c,currentModeId:u,currentModelId:h}),{sessionId:r,modes:{currentModeId:u,availableModes:l},models:{currentModelId:h,availableModels:d}}}async authenticate(e){return Vu(this.ctx,"acp.authenticate"),tRt(e.methodId),await eRt(this.ctx),{}}async requireAuthenticated(){await rRt(this.ctx)}async prompt(e){Vu(this.ctx,"acp.prompt"),await this.requireAuthenticated();let r=this.sessions.get(e.sessionId);if(!r)throw new Error(`Session ${e.sessionId} not found`);let n=process.env.GITHUB_COPILOT_ACP_MODEL_ID??r.currentModelId;r.pendingPrompt?.abort(),r.cancellationTokenSource?.cancel(),r.pendingPrompt=new AbortController,r.cancellationTokenSource=new jn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=Dt(),l=new lp(s,c),u=r.currentModeId===Nl.Ask.id?Nl.Ask:Nl.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(Xo),h=r.workspaceFolder?[{uri:r.workspaceFolder.uri,name:""}]:void 0;await f.addTurn(r.conversation.id,l,d,void 0,r.workspaceFolder??void 0,h);let m=new Xwt(this.connection,e.sessionId),g=new Qw(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(tv);A instanceof GW&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let _=await this.ctx.get(aM).createProcessor(g,e.sessionId);try{await _.process(m,r.cancellationTokenSource.token,void 0,void 0,{id:n})}finally{A instanceof GW&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(tv);if(s instanceof GW&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){Vu(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){Vu(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new ho(Ze.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new ho(Ze.InvalidParams,`Mode '${e.modeId}' is not available. Available modes: ${n.map(s=>s.id).join(", ")}`);return r.currentModeId=e.modeId,Promise.resolve({})}async unstable_setSessionModel(e){Vu(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new ho(Ze.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new ho(Ze.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return Dx(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?Cno:Cno.filter(e=>e.id===Nl.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?Nl.Agent.id:Nl.Ask.id}async getAvailableModels(){let e=await this.ctx.get(Ns).getMetadata(),r=[],n=lv;r.push({modelId:lv,name:"Auto",description:"Automatically selects the best model for the task"});for(let o of e)o.model_picker_enabled&&o.capabilities.type==="chat"&&this.isModelCompatibleWithAgentMode(o)&&r.push({modelId:o.id,name:o.name,description:this.getModelDescription(o)});return{availableModels:r,defaultModelId:n}}isModelCompatibleWithAgentMode(e){return!(eue.has(e.capabilities.family)||!e.capabilities.supports?.tool_calls||(e.capabilities.limits?.max_prompt_tokens??0)<4e4)}getModelDescription(e){let r=e.billing?.multiplier;if(r!==void 0)return`${r}x`}extractTextFromPrompt(e){return e.filter(r=>r.type==="text").map(r=>r.text).join(` +`)}extractReferencesFromPrompt(e){let r=[];for(let n of e)if(n.type==="resource_link"){let o=n;r.push({type:"file",uri:o.uri})}else if(n.type==="resource"){let o=n;o.resource?.uri&&r.push({type:"file",uri:o.resource.uri})}return r}getFileSystemCapabilities(){return this.clientCapabilities}getConnection(){return this.connection}};p();var bno=require("node:child_process"),oRt=require("node:stream");var iRt=class{constructor(e,r){this.cliInfo=e;this.ctx=r;this.cliProcess=null;this._cliConnection=null;this.disposed=!1}static{a(this,"CLIProcessManager")}start(e,r){if(this.disposed)throw new Error("CLIProcessManager has been disposed");if(this.cliProcess)throw new Error("CLI process is already running");let n={...process.env,COPILOT_AUTO_UPDATE:"false"};r&&(n.GH_TOKEN=r);let o=[...this.cliInfo.args,"--acp","--stdio"];if(this.cliProcess=(0,bno.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:xQt}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{bCe(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||Vu(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=oRt.Writable.toWeb(this.cliProcess.stdin),c=oRt.Readable.toWeb(this.cliProcess.stdout),l=_Pe(s,c);return this._cliConnection=new oot(e,l),this._cliConnection}get connection(){return this._cliConnection}get isRunning(){return this.cliProcess!==null&&this.cliProcess.exitCode===null}async kill(){await this.terminateProcess()}async dispose(){this.disposed=!0,await this.terminateProcess()}async terminateProcess(){if(this.cliProcess){try{this.cliProcess.stdin?.end(),this.cliProcess.kill("SIGTERM")}catch{}await new Promise(e=>{if(!this.cliProcess){e();return}let r=setTimeout(()=>{this.cliProcess?.kill("SIGKILL"),e()},3e3);this.cliProcess.once("exit",()=>{clearTimeout(r),e()})}),this.cliProcess=null}this._cliConnection=null}};p();var sRt=class{constructor(e,r,n){this.externalConnection=e;this.ctx=r;this.cliProcessManager=n;this.cliConnection=null;this.initParams=null;this.ensureCLIPromise=null}static{a(this,"CLIProxyAgent")}initialize(e){if(e.clientInfo){let r=this.ctx.get(Ir);r instanceof Jj&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return Vu(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:Xit,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:A1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return Vu(this.ctx,"acp.cli.authenticate"),tRt(e.methodId),await eRt(this.ctx),{}}async newSession(e){return Vu(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return Vu(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return Vu(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return Vu(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return Vu(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return Vu(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return Vu(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return Vu(this.ctx,"acp.cli.listSessions"),await this.requireAuthenticated(),(await this.ensureCLI()).listSessions(e)}async ensureCLI(){if(this.cliConnection)return this.cliConnection;if(!this.initParams)throw new ho(Ze.InternalError,"CLI connection not initialized. Call initialize() first.");if(this.ensureCLIPromise)return this.ensureCLIPromise;this.ensureCLIPromise=this.spawnAndInitializeCLI();try{return await this.ensureCLIPromise}finally{this.ensureCLIPromise=null}}async spawnAndInitializeCLI(){try{let r=(await this.ctx.get(Qt).getGitHubSession())?.accessToken;this.cliConnection=this.cliProcessManager.start(u=>this.createCLIClientHandler(),r);let n=this.initParams.clientInfo,o={name:"GitHub Copilot Language Server",version:A1(this.ctx)},s=n?{...n,_meta:{...n._meta??{},proxyClientInfo:o}}:o,c=this.cliConnection.initialize({protocolVersion:this.initParams.protocolVersion,clientCapabilities:this.initParams.clientCapabilities,clientInfo:s}),l=this.cliConnection.closed.then(()=>{throw new Error("CLI connection closed before initialize response was received")});l.catch(()=>{}),await Promise.race([c,l]),Vu(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw bCe(this.ctx,"acp.cli.handshake.error",e,{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source}),this.cliConnection=null,await this.cliProcessManager.kill(),new ho(Ze.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await rRt(this.ctx)}createCLIClientHandler(){return{sessionUpdate:a(async e=>{await this.externalConnection.sessionUpdate(e)},"sessionUpdate"),requestPermission:a(async e=>this.externalConnection.requestPermission(e),"requestPermission"),readTextFile:a(async e=>this.externalConnection.readTextFile(e),"readTextFile"),writeTextFile:a(async e=>this.externalConnection.writeTextFile(e),"writeTextFile"),createTerminal:a(async e=>({terminalId:(await this.externalConnection.createTerminal(e)).id}),"createTerminal"),extMethod:a(async(e,r)=>this.externalConnection.extMethod(e,r),"extMethod"),extNotification:a(async(e,r)=>this.externalConnection.extNotification(e,r),"extNotification")}}async dispose(){await this.cliProcessManager.dispose()}};p();p();var QPt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(fpo(),dpo)),this._sdkPromise}async query(e){return(await this._loadSdk()).query(e)}async listSessions(e){return(await this._loadSdk()).listSessions(e)}async getSessionInfo(e,r){return(await this._loadSdk()).getSessionInfo(e,r)}async getSessionMessages(e,r){return(await this._loadSdk()).getSessionMessages(e,r)}async forkSession(e,r){return(await this._loadSdk()).forkSession(e,r)}};p();p();function ppo(t){let e=new rde;e.set(Qo,t),e.set(HC,new HC),e.set(As,new As),e.set(AD,new AD);let r=new Qt(e);return e.set(Qt,r),e.set(tr,new tr(e)),e.set(jW,new jW(e,r)),e.set(PM,new PM),e.set(Gp,new Gp(e)),e.set(l0,new l0),e.set(jC,new jC),e.set(JO,new Fwe),e.set(t2,new oue),e.set(qP,new BTe),e.set(Qd,new Qd),e.set(M4,new M4(e)),e.set(si,new si(e)),e.set(SD,new SD(e)),e.set(c6,Xpt(e)),e.set(_y,new _y),e.set(Xb,new Xb),e.set(l6,l6.default),e.set(Pf,new Pf(e)),e.set(cw,new cw(e)),e.set(ih,new ih),e.set(Zb,new Zb(e)),e.set(Nn,new Nn),e.set(Ru,new Ru(e)),e.set(KO,new KO(e)),e.set(XN,new XN),e.set(OJ,new OJ(e)),e}a(ppo,"createCommonContext");p();var qPt=class extends Jf{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||rIt(r))&&this.console.warn(`[${o}]`,...s)}};p();var Apo=require("node:os");var $fl=new pe("repository"),sse="\\\\",ypo="(?:[#;].*)",Tbe=`(?:[^"${sse}]|${sse}.)`,Vfl="[0-9A-Za-z-]",hpo=`[A-Za-z]${Vfl}*`,_po=`\\s*${ypo}?$`,Epo=`(?:[^"${sse};#]|${sse}.)`,Wfl=`(?:"${Tbe}*"|"${Tbe}*(?${sse})$)`,zfl=`(?:${Epo}|${Wfl})+`,Yfl=`(?:(?${sse})$)`,vpo=`(?${zfl})${Yfl}?${_po}`,mpo=new RegExp(`^${vpo}`),Kfl=new RegExp(`^(?${Tbe}*(?:(?${sse})$|(?")))`),Jfl=new RegExp(`^\\s*(?:(?${hpo})\\s*=\\s*${vpo}|(?${hpo})${_po})`),Zfl=new RegExp(`(?${Epo}+)|"(?${Tbe}*)"`,"g"),gpo="[-.0-9A-Za-z]+",Xfl=`\\s+"(?${Tbe}*)"`,epl=`\\s+"(?${Tbe}*)"`,tpl=new RegExp(`^\\s*\\[(?:(?${gpo})${Xfl}|${epl}|(?${gpo}))\\]`),rpl=new RegExp(`^\\s*${ypo}$`),fGr=class{constructor(e){this.content=e;this.stopped=!1;this.section="";this.line="";this.lineNum=0;this.lines=[];this.linesWithErrors=[]}static{a(this,"GitConfigParser")}parse(e){for(this.stopped=!1,this.section="",this.line="",this.linesWithErrors=[],this.configValueHandler=e,this.lines=this.content.split(/\r?\n/),this.lineNum=0;!this.stopped&&this.lineNum0}errorAt(e){this.linesWithErrors.push(e)}parseSectionStart(){let e=this.line.match(tpl);e&&(e.groups?.simple?this.section=e.groups.simple.toLowerCase()+"."+this.unescapeBaseValue(e.groups.ext):e.groups?.extOnly?this.section="."+this.unescapeBaseValue(e.groups.extOnly):this.section=e.groups.simpleOnly.toLowerCase(),this.line=this.line.slice(e[0].length))}unescapeBaseValue(e){return e.replace(/\\(.)/g,"$1")}parseConfigPair(){let e=this.line.match(Jfl);if(e){if(e.groups?.key){let r=this.handleContinued(e);this.configValueHandler?.(this.nameWithSection(e.groups.key.toLowerCase()),r)}else e.groups?.soloKey&&this.configValueHandler?.(this.nameWithSection(e.groups.soloKey.toLowerCase()),"");this.line=""}}handleContinued(e){let r=e,n=[this.matchedValue(r)];for(;r?.groups?.cont||r?.groups?.strCont;){if(this.line=this.lines[++this.lineNum],this.lineNum>=this.lines.length){this.errorAt(this.lineNum);break}r.groups.strCont?(r=this.line.match(Kfl),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(mpo),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(mpo),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))}return this.normalizeValue(n.join(""))}matchedValue(e){return e.groups.strCont?e.groups.value.slice(0,-1):e.groups.value}normalizeValue(e){let r=!1,n=[...e.matchAll(Zfl)].map(o=>o.groups?.value?(r=!0,this.unescapeValue(o.groups.value.replace(/\s/g," "))):(r=!1,this.unescapeValue(o.groups.string))).join("");return r?n.trimEnd():n}unescapeValue(e){let r={n:` +`,t:" ",b:"\b"};return e.replace(/\\(.)/g,(n,o)=>r[o]||o)}nameWithSection(e){return this.section?this.section+"."+e:e}parseComment(){rpl.test(this.line)&&(this.line="")}},jPt=class extends l2{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await Pf.getRepoConfigLocation(e,r);if(!n)return;let o=await this.getParsedConfig(e,n);if(o)return this.mergeConfig(await this.baseConfig(e,n),o)}mergeConfig(...e){return e.filter(r=>r!==void 0).reduce((r,n)=>r.concat(n),new pJ)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new fGr(o),c=new pJ;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get(Go).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&$fl.warn(e,`Failed to load git config from ${JSON.stringify(r)}:`,o);return}}async baseConfig(e,r){let n=await this.commondirConfigUri(e,r),o=Oa(this.xdgConfigUri(),"git","config"),s=Oa(this.homeUri(),".gitconfig");return this.mergeConfig(await this.getParsedConfig(e,o,!1),await this.getParsedConfig(e,s,!1),n?await this.getParsedConfig(e,n,!1):void 0)}async commondirConfigUri(e,r){if(ro(r).toLowerCase()!=="config.worktree")return;let n=Cf(r),o=Oa(n,"commondir");try{let s=(await e.get(Go).readFileString(o)).trimEnd();return Oa(jz(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?Ko(process.env.XDG_CONFIG_HOME):Oa(this.homeUri(),".config")}homeUri(){return Ko((0,Apo.homedir)())}};p();var Cpo=require("child_process");var HPt=class extends l2{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,Cpo.execFile)(r,n,{cwd:e},(c,l)=>{c?s(c):o(l)})})}async tryRunCommand(e,r,n,o){try{return await this.runCommand(r,n,o)}catch(s){tqt.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=ys(r);if(n===void 0)return;let o;try{o=(await jO()).path}catch(c){tqt.info(e,`Skipping git config lookup: ${c.message}`);return}let s=await this.tryRunCommand(e,n,o,["-c","safe.directory=*","config","--list","--null",...this.extraArgs()]);return s?this.extractConfig(s):void 0}extractConfig(e){let r=new pJ;for(let n of e.split("\0").filter(o=>o)){let o=n.split(` +`,1)[0],s=n.slice(o.length+1);r.add(o,s)}return r}extraArgs(){return[]}};function bpo(t){let e=ppo(t);return npl(e),e.set(bp,jat(e)),e.set(Uk,Uwt(e)),e.set(l2,new fKe([new HPt,new jPt])),e}a(bpo,"createProductionContext");function npl(t){t.set(hx,hx.fromEnvironment(!1)),t.set(MB,new yCe),t.set(Jf,new qPt(console))}a(npl,"setupRudimentaryLogging");var amm=new pe("context");p();var Zpo=require("fs");p();p();var Wpo=require("node:url");p();p();var Ibe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Tpo=new Set,pGr=typeof process=="object"&&process?process:{},Ipo=a((t,e,r,n)=>{typeof pGr.emitWarning=="function"?pGr.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),GPt=globalThis.AbortController,Spo=globalThis.AbortSignal;if(typeof GPt>"u"){Spo=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},GPt=class{static{a(this,"AbortController")}constructor(){e()}signal=new Spo;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let o of this.signal._onabort)o(n);this.signal.onabort?.(n)}}};let t=pGr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,Ipo("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var ipl=a(t=>!Tpo.has(t),"shouldWarn");var fz=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),xpo=a(t=>fz(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?xbe:null:null,"getUintArray"),xbe=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},hGr=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=xpo(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},QUe=class t{static{a(this,"LRUCache")}#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#c;#u;#l;#p;#g;#A;#h;#v;#m;#b;#T;#_;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#_,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#l,next:e.#p,prev:e.#g,get head(){return e.#A},get tail(){return e.#h},free:e.#v,isBackgroundFetch:a(r=>e.#f(r),"isBackgroundFetch"),backgroundFetch:a((r,n,o,s)=>e.#U(r,n,o,s),"backgroundFetch"),moveToTail:a(r=>e.#O(r),"moveToTail"),indexes:a(r=>e.#I(r),"indexes"),rindexes:a(r=>e.#x(r),"rindexes"),isStale:a(r=>e.#E(r),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:_,memoMethod:E,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!fz(r))throw new TypeError("max option must be a nonnegative integer");let x=r?xpo(r):Array;if(!x)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=g,this.maxEntrySize=A||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=E,_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#i=_,this.#S=!!_,this.#c=new Map,this.#u=new Array(r).fill(void 0),this.#l=new Array(r).fill(void 0),this.#p=new x(r),this.#g=new x(r),this.#A=0,this.#h=0,this.#v=hGr.create(r),this.#s=0,this.#a=0,typeof d=="function"&&(this.#r=d),typeof f=="function"?(this.#n=f,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#C=!!this.#r,this.#y=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!fz(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!fz(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=fz(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!fz(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let k="LRU_CACHE_UNBOUNDED";ipl(k)&&(Tpo.add(k),Ipo("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",k,t))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new xbe(this.#e),r=new xbe(this.#e);this.#_=e,this.#T=r,this.#L=(s,c,l=Ibe.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#E(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?Ibe.now():0},this.#d=(s,c)=>{if(e[c]){let l=e[c],u=r[c];if(!l||!u)return;s.ttl=l,s.start=u,s.now=n||o();let d=s.now-u;s.remainingTTL=l-d}};let n=0,o=a(()=>{let s=Ibe.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"getNow");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#E=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#updateItemAge");#d=a(()=>{},"#statusTTL");#L=a(()=>{},"#setItemTTL");#E=a(()=>!1,"#isStale");#D(){let e=new xbe(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#B=(r,n,o,s)=>{if(this.#f(n))return 0;if(!fz(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!fz(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#P=a(e=>{},"#removeItemSize");#N=a((e,r,n)=>{},"#addItemSize");#B=a((e,r,n,o)=>{if(n||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#E(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#E(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#E(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#_&&this.#T){let c=this.#_[r],l=this.#T[r];if(c&&l){let u=c-(Ibe.now()-l);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let e=[];for(let r of this.#I({allowStale:!0})){let n=this.#u[r],o=this.#l[r],s=this.#f(o)?o.__staleWhileFetching:o;if(s===void 0||n===void 0)continue;let c={value:s};if(this.#_&&this.#T){c.ttl=this.#_[r];let l=Ibe.now()-this.#T[r];c.start=Math.floor(Date.now()-l)}this.#b&&(c.size=this.#b[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=Ibe.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#B(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#v.length!==0?this.#v.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#C&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#C&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#P(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#_&&this.#k(),this.#_&&(d||this.#L(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(new Error("evicted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#P(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#v.push(r)),this.#s===1?(this.#A=this.#h=0,this.#v.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#E(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#E(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new GPt,{signal:l}=n;l?.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let u={signal:c.signal,options:n,context:o},d=a((y,_=!1)=>{let{aborted:E}=c.signal,v=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(E&&!_?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),E&&!v&&!_)return h(c.signal.reason);let S=g;return this.#l[r]===g&&(y===void 0?S.__staleWhileFetching?this.#l[r]=S.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,u.options))),y},"cb"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),h(y)),"eb"),h=a(y=>{let{aborted:_}=c.signal,E=_&&n.allowStaleOnFetchAbort,v=E||n.allowStaleOnFetchRejection,S=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!S||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):E||(this.#l[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},"fetchFail"),m=a((y,_)=>{let E=this.#i?.(e,s,u);E&&E instanceof Promise&&E.then(v=>y(v===void 0?void 0:v),_),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(v=>d(v,!0),"res")))})},"pcall");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,f),A=Object.assign(g,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,A,{...u.options,status:void 0}),r=this.#c.get(e)):this.#l[r]=A,A}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof GPt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:_=!1,status:E,signal:v}=r;if(!this.#S)return E&&(E.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:E});let S={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:E,signal:v},T=this.#c.get(e);if(T===void 0){E&&(E.fetch="miss");let w=this.#U(e,T,S,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let N=n&&w.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",N&&(E.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#E(T);if(!_&&!R)return E&&(E.fetch="hit"),this.#O(T),o&&this.#R(T),E&&this.#d(E,T),w;let x=this.#U(e,T,S,y),D=x.__staleWhileFetching!==void 0&&n;return E&&(E.fetch=R?"stale":"refresh",D&&R&&(E.returnedStale=!0)),D?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#E(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#P(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(new Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#v.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(new Error("deleted"));else{let o=this.#u[r];this.#C&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#_&&this.#T&&(this.#_.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#v.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};var kbe=require("node:path"),Bpo=require("node:url"),DB=require("fs"),hpl=fe(require("node:fs"),1),mz=require("node:fs/promises");p();var JPt=require("node:events"),vGr=fe(require("node:stream"),1),Dpo=require("node:string_decoder");var wpo=typeof process=="object"&&process?process:{stdout:null,stderr:null},opl=a(t=>!!t&&typeof t=="object"&&(t instanceof hz||t instanceof vGr.default||spl(t)||apl(t)),"isStream"),spl=a(t=>!!t&&typeof t=="object"&&t instanceof JPt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==vGr.default.Writable.prototype.pipe,"isReadable"),apl=a(t=>!!t&&typeof t=="object"&&t instanceof JPt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),L9=Symbol("EOF"),B9=Symbol("maybeEmitEnd"),pz=Symbol("emittedEnd"),$Pt=Symbol("emittingEnd"),qUe=Symbol("emittedError"),VPt=Symbol("closed"),Rpo=Symbol("read"),WPt=Symbol("flush"),kpo=Symbol("flushChunk"),SM=Symbol("encoding"),wbe=Symbol("decoder"),_A=Symbol("flowing"),jUe=Symbol("paused"),Rbe=Symbol("resume"),EA=Symbol("buffer"),EC=Symbol("pipes"),vA=Symbol("bufferLength"),mGr=Symbol("bufferPush"),zPt=Symbol("bufferShift"),xE=Symbol("objectMode"),qh=Symbol("destroyed"),gGr=Symbol("error"),AGr=Symbol("emitData"),Ppo=Symbol("emitEnd"),yGr=Symbol("emitEnd2"),kB=Symbol("async"),_Gr=Symbol("abort"),YPt=Symbol("aborted"),HUe=Symbol("signal"),ase=Symbol("dataListeners"),cx=Symbol("discarded"),GUe=a(t=>Promise.resolve().then(t),"defer"),cpl=a(t=>t(),"nodefer"),lpl=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),upl=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),dpl=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),KPt=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[Rbe](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},EGr=class extends KPt{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=o=>r.emit("error",o),e.on("error",this.proxyErrors)}},fpl=a(t=>!!t.objectMode,"isObjectModeOptions"),ppl=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),hz=class extends JPt.EventEmitter{static{a(this,"Minipass")}[_A]=!1;[jUe]=!1;[EC]=[];[EA]=[];[xE];[SM];[kB];[wbe];[L9]=!1;[pz]=!1;[$Pt]=!1;[VPt]=!1;[qUe]=null;[vA]=0;[qh]=!1;[HUe];[YPt]=!1;[ase]=0;[cx]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");fpl(r)?(this[xE]=!0,this[SM]=null):ppl(r)?(this[SM]=r.encoding,this[xE]=!1):(this[xE]=!1,this[SM]=null),this[kB]=!!r.async,this[wbe]=this[SM]?new Dpo.StringDecoder(this[SM]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[EA],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[EC],"get")});let{signal:n}=r;n&&(this[HUe]=n,n.aborted?this[_Gr]():n.addEventListener("abort",()=>this[_Gr]()))}get bufferLength(){return this[vA]}get encoding(){return this[SM]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[xE]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[kB]}set async(e){this[kB]=this[kB]||!!e}[_Gr](){this[YPt]=!0,this.emit("abort",this[HUe]?.reason),this.destroy(this[HUe]?.reason)}get aborted(){return this[YPt]}set aborted(e){}write(e,r,n){if(this[YPt])return!1;if(this[L9])throw new Error("write after end");if(this[qh])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let o=this[kB]?GUe:cpl;if(!this[xE]&&!Buffer.isBuffer(e)){if(dpl(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(upl(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[xE]?(this[_A]&&this[vA]!==0&&this[WPt](!0),this[_A]?this.emit("data",e):this[mGr](e),this[vA]!==0&&this.emit("readable"),n&&o(n),this[_A]):e.length?(typeof e=="string"&&!(r===this[SM]&&!this[wbe]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[SM]&&(e=this[wbe].write(e)),this[_A]&&this[vA]!==0&&this[WPt](!0),this[_A]?this.emit("data",e):this[mGr](e),this[vA]!==0&&this.emit("readable"),n&&o(n),this[_A]):(this[vA]!==0&&this.emit("readable"),n&&o(n),this[_A])}read(e){if(this[qh])return null;if(this[cx]=!1,this[vA]===0||e===0||e&&e>this[vA])return this[B9](),null;this[xE]&&(e=null),this[EA].length>1&&!this[xE]&&(this[EA]=[this[SM]?this[EA].join(""):Buffer.concat(this[EA],this[vA])]);let r=this[Rpo](e||null,this[EA][0]);return this[B9](),r}[Rpo](e,r){if(this[xE])this[zPt]();else{let n=r;e===n.length||e===null?this[zPt]():typeof n=="string"?(this[EA][0]=n.slice(e),r=n.slice(0,e),this[vA]-=e):(this[EA][0]=n.subarray(e),r=n.subarray(0,e),this[vA]-=e)}return this.emit("data",r),!this[EA].length&&!this[L9]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[L9]=!0,this.writable=!1,(this[_A]||!this[jUe])&&this[B9](),this}[Rbe](){this[qh]||(!this[ase]&&!this[EC].length&&(this[cx]=!0),this[jUe]=!1,this[_A]=!0,this.emit("resume"),this[EA].length?this[WPt]():this[L9]?this[B9]():this.emit("drain"))}resume(){return this[Rbe]()}pause(){this[_A]=!1,this[jUe]=!0,this[cx]=!1}get destroyed(){return this[qh]}get flowing(){return this[_A]}get paused(){return this[jUe]}[mGr](e){this[xE]?this[vA]+=1:this[vA]+=e.length,this[EA].push(e)}[zPt](){return this[xE]?this[vA]-=1:this[vA]-=this[EA][0].length,this[EA].shift()}[WPt](e=!1){do;while(this[kpo](this[zPt]())&&this[EA].length);!e&&!this[EA].length&&!this[L9]&&this.emit("drain")}[kpo](e){return this.emit("data",e),this[_A]}pipe(e,r){if(this[qh])return e;this[cx]=!1;let n=this[pz];return r=r||{},e===wpo.stdout||e===wpo.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[EC].push(r.proxyErrors?new EGr(this,e,r):new KPt(this,e,r)),this[kB]?GUe(()=>this[Rbe]()):this[Rbe]()),e}unpipe(e){let r=this[EC].find(n=>n.dest===e);r&&(this[EC].length===1?(this[_A]&&this[ase]===0&&(this[_A]=!1),this[EC]=[]):this[EC].splice(this[EC].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[cx]=!1,this[ase]++,!this[EC].length&&!this[_A]&&this[Rbe]();else if(e==="readable"&&this[vA]!==0)super.emit("readable");else if(lpl(e)&&this[pz])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[qUe]){let o=r;this[kB]?GUe(()=>o.call(this,this[qUe])):o.call(this,this[qUe])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[ase]=this.listeners("data").length,this[ase]===0&&!this[cx]&&!this[EC].length&&(this[_A]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[ase]=0,!this[cx]&&!this[EC].length&&(this[_A]=!1)),r}get emittedEnd(){return this[pz]}[B9](){!this[$Pt]&&!this[pz]&&!this[qh]&&this[EA].length===0&&this[L9]&&(this[$Pt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[VPt]&&this.emit("close"),this[$Pt]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==qh&&this[qh])return!1;if(e==="data")return!this[xE]&&!n?!1:this[kB]?(GUe(()=>this[AGr](n)),!0):this[AGr](n);if(e==="end")return this[Ppo]();if(e==="close"){if(this[VPt]=!0,!this[pz]&&!this[qh])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[qUe]=n,super.emit(gGr,n);let s=!this[HUe]||this.listeners("error").length?super.emit("error",n):!1;return this[B9](),s}else if(e==="resume"){let s=super.emit("resume");return this[B9](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let o=super.emit(e,...r);return this[B9](),o}[AGr](e){for(let n of this[EC])n.dest.write(e)===!1&&this.pause();let r=this[cx]?!1:super.emit("data",e);return this[B9](),r}[Ppo](){return this[pz]?!1:(this[pz]=!0,this.readable=!1,this[kB]?(GUe(()=>this[yGr]()),!0):this[yGr]())}[yGr](){if(this[wbe]){let r=this[wbe].end();if(r){for(let n of this[EC])n.dest.write(r);this[cx]||super.emit("data",r)}}for(let r of this[EC])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[xE]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[xE]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[xE])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[SM]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(qh,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[cx]=!1;let e=!1,r=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return r();let o=this.read();if(o!==null)return Promise.resolve({done:!1,value:o});if(this[L9])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(qh,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(qh,f),this.pause(),s({value:h,done:!!this[L9]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(qh,f),r(),s({done:!0,value:void 0})},"onend"),f=a(()=>l(new Error("stream destroyed")),"ondestroy");return new Promise((h,m)=>{c=m,s=h,this.once(qh,f),this.once("error",l),this.once("end",d),this.once("data",u)})},"next"),throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[cx]=!1;let e=!1,r=a(()=>(this.pause(),this.off(gGr,r),this.off(qh,r),this.off("end",r),e=!0,{done:!0,value:void 0}),"stop"),n=a(()=>{if(e)return r();let o=this.read();return o===null?r():{done:!1,value:o}},"next");return this.once("end",r),this.once(gGr,r),this.once(qh,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[qh])return e?this.emit("error",e):this.emit(qh),this;this[qh]=!0,this[cx]=!0,this[EA].length=0,this[vA]=0;let r=this;return typeof r.close=="function"&&!this[VPt]&&r.close(),e?this.emit("error",e):this.emit(qh),this}static get isStream(){return opl}};var mpl=DB.realpathSync.native,VUe={lstatSync:DB.lstatSync,readdir:DB.readdir,readdirSync:DB.readdirSync,readlinkSync:DB.readlinkSync,realpathSync:mpl,promises:{lstat:mz.lstat,readdir:mz.readdir,readlink:mz.readlink,realpath:mz.realpath}},Fpo=a(t=>!t||t===VUe||t===hpl?VUe:{...VUe,...t,promises:{...VUe.promises,...t.promises||{}}},"fsFromOption"),Upo=/^\\\\\?\\([a-z]:)\\?$/i,gpl=a(t=>t.replace(/\//g,"\\").replace(Upo,"$1\\"),"uncToDrive"),Apl=/[\\\/]/,eP=0,Qpo=1,qpo=2,PB=4,jpo=6,Hpo=8,cse=10,Gpo=12,Xk=15,$Ue=~Xk,CGr=16,Npo=32,WUe=64,TM=128,ZPt=256,e2t=512,Mpo=WUe|TM|e2t,ypl=1023,bGr=a(t=>t.isFile()?Hpo:t.isDirectory()?PB:t.isSymbolicLink()?cse:t.isCharacterDevice()?qpo:t.isBlockDevice()?jpo:t.isSocket()?Gpo:t.isFIFO()?Qpo:eP,"entToType"),Opo=new Map,zUe=a(t=>{let e=Opo.get(t);if(e)return e;let r=t.normalize("NFKD");return Opo.set(t,r),r},"normalize"),Lpo=new Map,XPt=a(t=>{let e=Lpo.get(t);if(e)return e;let r=zUe(t.toLowerCase());return Lpo.set(t,r),r},"normalizeNocase"),t2t=class extends QUe{static{a(this,"ResolveCache")}constructor(){super({max:256})}},SGr=class extends QUe{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},$po=Symbol("PathScurry setAsCwd"),wE=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#n;get nlink(){return this.#n}#i;get uid(){return this.#i}#o;get gid(){return this.#o}#s;get rdev(){return this.#s}#a;get blksize(){return this.#a}#c;get ino(){return this.#c}#u;get size(){return this.#u}#l;get blocks(){return this.#l}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#A;get ctimeMs(){return this.#A}#h;get birthtimeMs(){return this.#h}#v;get atime(){return this.#v}#m;get mtime(){return this.#m}#b;get ctime(){return this.#b}#T;get birthtime(){return this.#T}#_;#C;#S;#y;#k;#R;#d;#L;#E;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=eP,n,o,s,c,l){this.name=e,this.#_=s?XPt(e):zUe(e),this.#d=r&ypl,this.nocase=s,this.roots=o,this.root=n||this,this.#L=c,this.#S=l.fullpath,this.#k=l.relative,this.#R=l.relativePosix,this.parent=l.parent,this.parent?this.#e=this.parent.#e:this.#e=Fpo(l.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#L}resolve(e){if(!e)return this;let r=this.getRootString(e),o=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#P(o):this.#P(o)}#P(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#L.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#L.set(this,r),this.#d&=~CGr,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?XPt(e):zUe(e);for(let u of n)if(u.#_===o)return u;let s=this.parent?this.sep:"",c=this.#S?this.#S+s+e:void 0,l=this.newChild(e,eP,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=TM),n.push(l),l}relative(){if(this.isCWD)return"";if(this.#k!==void 0)return this.#k;let e=this.name,r=this.parent;if(!r)return this.#k=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,r=this.parent;if(!r)return this.#R=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let o=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=o}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let o=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(o)?this.#y=`//?/${o}`:this.#y=o}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#y=n}isUnknown(){return(this.#d&Xk)===eP}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#d&Xk)===Hpo}isDirectory(){return(this.#d&Xk)===PB}isCharacterDevice(){return(this.#d&Xk)===qpo}isBlockDevice(){return(this.#d&Xk)===jpo}isFIFO(){return(this.#d&Xk)===Qpo}isSocket(){return(this.#d&Xk)===Gpo}isSymbolicLink(){return(this.#d&cse)===cse}lstatCached(){return this.#d&Npo?this:void 0}readlinkCached(){return this.#E}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#E)return!0;if(!this.parent)return!1;let e=this.#d&Xk;return!(e!==eP&&e!==cse||this.#d&ZPt||this.#d&TM)}calledReaddir(){return!!(this.#d&CGr)}isENOENT(){return!!(this.#d&TM)}isNamed(e){return this.nocase?this.#_===XPt(e):this.#_===zUe(e)}async readlink(){let e=this.#E;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#E=n}catch(r){this.#f(r.code);return}}readlinkSync(){let e=this.#E;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#E=n}catch(r){this.#f(r.code);return}}#N(e){this.#d|=CGr;for(let r=e.provisional;rn(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#H.push(e),this.#G)return;this.#G=!0;let o=this.fullpath();this.#e.readdir(o,{withFileTypes:!0},(s,c)=>{if(s)this.#M(s.code),n.provisional=0;else{for(let l of c)this.#Q(l,n);this.#N(n)}this.#V(n.slice(0,n.provisional))})}#j;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#j)await this.#j;else{let n=a(()=>{},"resolve");this.#j=new Promise(o=>n=o);try{for(let o of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#Q(o,e);this.#N(e)}catch(o){this.#M(o.code),e.provisional=0}this.#j=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let n of this.#e.readdirSync(r,{withFileTypes:!0}))this.#Q(n,e);this.#N(e)}catch(n){this.#M(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#d&Mpo)return!1;let e=Xk&this.#d;return e===eP||e===PB||e===cse}shouldWalk(e,r){return(this.#d&PB)===PB&&!(this.#d&Mpo)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((e2t|ZPt|TM)&this.#d))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}realpathSync(){if(this.#D)return this.#D;if(!((e2t|ZPt|TM)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[$po](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],o=this;for(;o&&o.parent;)r.add(o),o.#k=n.join(this.sep),o.#R=n.join("/"),o=o.parent,n.push("..");for(o=e;o&&o.parent&&!r.has(o);)o.#k=void 0,o.#R=void 0,o=o.parent}},r2t=class t extends wE{static{a(this,"PathWin32")}sep="\\";splitSep=Apl;constructor(e,r=eP,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=eP,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return kbe.win32.parse(e).root}getRoot(e){if(e=gpl(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new Pbe(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Upo,"$1\\"),e===r}},n2t=class t extends wE{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=eP,n,o,s,c,l){super(e,r,n,o,s,c,l)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=eP,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},i2t=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#r;nocase;#n;constructor(e=process.cwd(),r,n,{nocase:o,childrenCacheSize:s=16*1024,fs:c=VUe}={}){this.#n=Fpo(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,Bpo.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new t2t,this.#t=new t2t,this.#r=new SGr(s);let u=l.substring(this.rootPath.length).split(n);if(u.length===1&&!u[0]&&u.pop(),o===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=o,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let d=this.root,f=u.length-1,h=r.sep,m=this.rootPath,g=!1;for(let A of u){let y=f--;d=d.child(A,{relative:new Array(y).fill("..").join(h),relativePosix:new Array(y).fill("..").join("/"),fullpath:m+=(g?"":h)+A}),g=!0}this.cwd=d}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let c=e[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=this.#e.get(r);if(n!==void 0)return n;let o=this.cwd.resolve(r).fullpath();return this.#e.set(r,o),o}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let c=e[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=this.#t.get(r);if(n!==void 0)return n;let o=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,o),o}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let o=await e.readdir();return n?o:o.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(o=>o.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(e))&&l.push(n?e:e.fullpath());let u=new Set,d=a((h,m)=>{u.add(h),h.readdirCB((g,A)=>{if(g)return m(g);let y=A.length;if(!y)return m();let _=a(()=>{--y===0&&m()},"next");for(let E of A)(!s||s(E))&&l.push(n?E:E.fullpath()),o&&E.isSymbolicLink()?E.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(u,c)?d(v,_):_()):E.shouldWalk(u,c)?d(E,_):_()},!0)},"walk"),f=e;return new Promise((h,m)=>{d(f,g=>{if(g)return m(g);h(l)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(e))&&l.push(n?e:e.fullpath());let u=new Set([e]);for(let d of u){let f=d.readdirSync();for(let h of f){(!s||s(h))&&l.push(n?h:h.fullpath());let m=h;if(h.isSymbolicLink()){if(!(o&&(m=h.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(u,c)&&u.add(m)}}return l}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r;(!s||s(e))&&(yield n?e:e.fullpath());let l=new Set([e]);for(let u of l){let d=u.readdirSync();for(let f of d){(!s||s(f))&&(yield n?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(o&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(l,c)&&l.add(h)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new hz({objectMode:!0});(!s||s(e))&&l.write(n?e:e.fullpath());let u=new Set,d=[e],f=0,h=a(()=>{let m=!1;for(;!m;){let g=d.shift();if(!g){f===0&&l.end();return}f++,u.add(g);let A=a((_,E,v=!1)=>{if(_)return l.emit("error",_);if(o&&!v){let S=[];for(let T of E)T.isSymbolicLink()&&S.push(T.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(S.length){Promise.all(S).then(()=>A(null,E,!0));return}}for(let S of E)S&&(!s||s(S))&&(l.write(n?S:S.fullpath())||(m=!0));f--;for(let S of E){let T=S.realpathCached()||S;T.shouldWalk(u,c)&&d.push(T)}m&&!l.flowing?l.once("drain",h):y||h()},"onReaddir"),y=!0;g.readdirCB(A,!0),y=!1}},"process");return h(),l}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new hz({objectMode:!0}),u=new Set;(!s||s(e))&&l.write(n?e:e.fullpath());let d=[e],f=0,h=a(()=>{let m=!1;for(;!m;){let g=d.shift();if(!g){f===0&&l.end();return}f++,u.add(g);let A=g.readdirSync();for(let y of A)(!s||s(y))&&(l.write(n?y:y.fullpath())||(m=!0));f--;for(let y of A){let _=y;if(y.isSymbolicLink()){if(!(o&&(_=y.realpathSync())))continue;_.isUnknown()&&_.lstatSync()}_.shouldWalk(u,c)&&d.push(_)}}m&&!l.flowing&&l.once("drain",h)},"process");return h(),l}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[$po](r)}},Pbe=class extends i2t{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,kbe.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return kbe.win32.parse(e).root.toUpperCase()}newRoot(e){return new r2t(this.rootPath,PB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Dbe=class extends i2t{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,kbe.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new n2t(this.rootPath,PB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},YUe=class extends Dbe{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},vmm=process.platform==="win32"?r2t:n2t,Vpo=process.platform==="win32"?Pbe:process.platform==="darwin"?YUe:Dbe;p();var _pl=a(t=>t.length>=1,"isPatternList"),Epl=a(t=>t.length>=1,"isGlobList"),Nbe=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!_pl(e))throw new TypeError("empty pattern list");if(!Epl(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=r,this.#r=n,this.#n=o,this.#r===0){if(this.isUNC()){let[s,c,l,u,...d]=this.#e,[f,h,m,g,...A]=this.#t;d[0]===""&&(d.shift(),A.shift());let y=[s,c,l,u,""].join("/"),_=[f,h,m,g,""].join("/");this.#e=[y,...d],this.#t=[_,...A],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...c]=this.#e,[l,...u]=this.#t;c[0]===""&&(c.shift(),u.shift());let d=s+"/",f=l+"/";this.#e=[d,...c],this.#t=[f,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===ah}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#o=this.#o||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new t(this.#e,this.#t,this.#r+1,this.#n),this.#i.#c=this.#c,this.#i.#a=this.#a,this.#i.#s=this.#s,this.#i):this.#i=null}isUNC(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#n==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#s!==void 0?this.#s:this.#s=this.#n==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};p();p();var vpl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Mbe=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=vpl}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=c,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:o,noglobstar:s,optimizationLevel:2,platform:c,nocomment:!0,nonegate:!0};for(let l of e)this.add(l)}add(e){let r=new nv(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},xGr=class{static{a(this,"SubWalks")}store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(o=>o.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},KUe=class t{static{a(this,"Processor")}hasWalkedCache;matches=new IGr;subwalks=new xGr;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new TGr}processPatterns(e,r){this.patterns=r;let n=r.map(o=>[e,o]);for(let[o,s]of n){this.hasWalkedCache.storeWalked(o,s);let c=s.root(),l=s.isAbsolute()&&this.opts.absolute!==!1;if(c){o=o.resolve(c==="/"&&this.opts.root!==void 0?this.opts.root:c);let h=s.rest();if(h)s=h;else{this.matches.add(o,!0,!1);continue}}if(o.isENOENT())continue;let u,d,f=!1;for(;typeof(u=s.pattern())=="string"&&(d=s.rest());)o=o.resolve(u),s=d,f=!0;if(u=s.pattern(),d=s.rest(),f){if(this.hasWalkedCache.hasWalked(o,s))continue;this.hasWalkedCache.storeWalked(o,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(o.resolve(u),l,h);continue}else if(u===ah){(!o.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(o,s);let h=d?.pattern(),m=d?.rest();if(!d||(h===""||h===".")&&!m)this.matches.add(o,l,h===""||h===".");else if(h===".."){let g=o.parent||o;m?this.hasWalkedCache.hasWalked(g,m)||this.subwalks.add(g,m):this.matches.add(g,l,!0)}}else u instanceof RegExp&&this.subwalks.add(o,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),o=this.child();for(let s of r)for(let c of n){let l=c.isAbsolute(),u=c.pattern(),d=c.rest();u===ah?o.testGlobstar(s,c,d,l):u instanceof RegExp?o.testRegExp(s,u,d,l):o.testString(s,u,d,l)}return o}testGlobstar(e,r,n,o){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,o,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),o);else if(s===".."){let c=e.parent||e;this.subwalks.add(c,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),o)}}testRegExp(e,r,n,o){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,o,!1))}testString(e,r,n,o){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,o,!1))}};var Cpl=a((t,e)=>typeof t=="string"?new Mbe([t],e):Array.isArray(t)?new Mbe(t,e):t,"makeIgnore"),o2t=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=Cpl(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let o="cannot ignore child matches, ignore lacks add() method.";throw new Error(o)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let c=await s.realpath();c&&(c.isUnknown()||this.opts.stat)&&await c.lstat()}return this.matchCheckTest(s,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let c=s.realpathSync();c&&(c?.isUnknown()||this.opts.stat)&&c.lstatSync()}return this.matchCheckTest(s,r)}matchFinish(e,r){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let o=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+o)}else{let s=this.opts.posix?e.relativePosix():e.relative(),c=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?c+s+o:"."+o)}}async match(e,r,n){let o=await this.matchCheck(e,n);o&&this.matchFinish(o,r)}matchSync(e,r,n){let o=this.matchCheckSync(e,n);o&&this.matchFinish(o,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new KUe(this.opts),n)}walkCB2(e,r,n,o){if(this.#i(e))return o();if(this.signal?.aborted&&o(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,o));return}n.processPatterns(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||(s++,this.match(l,u,d).then(()=>c()));for(let l of n.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirCached();l.calledReaddir()?this.walkCB3(l,u,n,c):l.readdirCB((d,f)=>this.walkCB3(l,f,n,c),!0)}c()}walkCB3(e,r,n,o){n=n.filterEntries(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||(s++,this.match(l,u,d).then(()=>c()));for(let[l,u]of n.subwalks.entries())s++,this.walkCB2(l,u,n.child(),c);c()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new KUe(this.opts),n)}walkCB2Sync(e,r,n,o){if(this.#i(e))return o();if(this.signal?.aborted&&o(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,o));return}n.processPatterns(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||this.matchSync(l,u,d);for(let l of n.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirSync();this.walkCB3Sync(l,u,n,c)}c()}walkCB3Sync(e,r,n,o){n=n.filterEntries(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||this.matchSync(l,u,d);for(let[l,u]of n.subwalks.entries())s++,this.walkCB2Sync(l,u,n.child(),c);c()}},JUe=class extends o2t{static{a(this,"GlobWalker")}matches=new Set;constructor(e,r,n){super(e,r,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},ZUe=class extends o2t{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new hz({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var bpl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",IM=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,Wpo.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=r.platform||bpl,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=r.platform==="win32"?Pbe:r.platform==="darwin"?YUe:r.platform?Dbe:Vpo;this.scurry=new u(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",o={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new nv(u,o)),[c,l]=s.reduce((u,d)=>(u[0].push(...d.set),u[1].push(...d.globParts),u),[[],[]]);this.patterns=c.map((u,d)=>{let f=l[d];if(!f)throw new Error("invalid pattern object");return new Nbe(u,f,0,this.platform)})}async walk(){return[...await new JUe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new JUe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new ZUe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new ZUe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};p();var wGr=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new nv(r,e).hasMagic())return!0;return!1},"hasMagic");function a2t(t,e={}){return new IM(t,e).streamSync()}a(a2t,"globStreamSync");function Ypo(t,e={}){return new IM(t,e).stream()}a(Ypo,"globStream");function Kpo(t,e={}){return new IM(t,e).walkSync()}a(Kpo,"globSync");async function zpo(t,e={}){return new IM(t,e).walk()}a(zpo,"glob_");function c2t(t,e={}){return new IM(t,e).iterateSync()}a(c2t,"globIterateSync");function Jpo(t,e={}){return new IM(t,e).iterate()}a(Jpo,"globIterate");var Spl=a2t,Tpl=Object.assign(Ypo,{sync:a2t}),Ipl=c2t,xpl=Object.assign(Jpo,{sync:c2t}),wpl=Object.assign(Kpo,{stream:a2t,iterate:c2t}),s2t=Object.assign(zpo,{glob:zpo,globSync:Kpo,sync:wpl,globStream:Ypo,stream:Tpl,globStreamSync:a2t,streamSync:Spl,globIterate:Jpo,iterate:xpl,globIterateSync:c2t,iterateSync:Ipl,Glob:IM,hasMagic:wGr,escape:Pue,unescape:u2});s2t.glob=s2t;var XUe=class t{constructor(){this.logger=new pe("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(QA),s=r.map(d=>un(d.uri)),l=o.resolvePatterns(n,s).map(async d=>{let f=d.metadata?[d.metadata]:void 0,h=a((m,g)=>({uri:m,watchable:d.watchable,cacheable:d.cacheable,metadata:f,classification:d.classification,timestamp:g}),"build");if(d.isGlob)return(await this.globFiles(d.pattern,e)).map(g=>h(Ko(g.path),g.timestamp));{let m=await this.getExactFile(e,d.pattern);return m?[h(m.uri,m.timestamp)]:[]}}),u=await Promise.all(l);return this.deduplicateFiles(u.flat())}async globFiles(e,r){let n;try{n=await s2t(e,{dot:!0,nodir:!0,absolute:!0})}catch{return[]}return this.statGlobMatches(r,n)}async statGlobMatches(e,r){let n=[];for(let o=0;o{try{let u=await Zpo.promises.stat(l);return u.isFile()?{path:l,timestamp:u.mtimeMs}:void 0}catch(u){this.logger.warn(e,`Skipping prompt file ${l} because it could not be stat'd:`,u);return}}));n.push(...c.filter(l=>l!==void 0))}return n}async getExactFile(e,r){let n=Ko(r);try{let o=await e.get(Go).stat(n);return(o.type&1)!==0?{uri:n,timestamp:o.mtime}:void 0}catch{return}}deduplicateFiles(e){let r=new Map;for(let n of e){let o=r.get(n.uri);if(!o){r.set(n.uri,n);continue}let s=o.watchable||n.watchable,c=o.cacheable||n.cacheable,l=n.metadata?.length?[...o.metadata??[],...n.metadata]:o.metadata,u=Math.max(o.timestamp,n.timestamp);(s!==o.watchable||c!==o.cacheable||l!==o.metadata||u!==o.timestamp)&&r.set(n.uri,{...o,watchable:s,cacheable:c,metadata:l,timestamp:u})}return Array.from(r.values())}};p();var Rgm=new pe("exp");function eho(t){let e=t.get(tr);e.registerStaticFilters(Ppl(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>kt(t,ze.DebugOverrideEngine)||kt(t,ze.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>KQe()?"copilot-web":t.get(Ir).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>Xpo(t)),e.registerDynamicFilter(Ese.CopilotRelatedPluginVersionGithubCopilot,()=>Xpo(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>Rpl(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Ir).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>l2t(t.get(Ir).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>kpl(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get(fx).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getRelatedPluginInfo()){let o=LE+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(Ese).includes(o)){q9e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=l2t(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getEditorPluginSpecificFilters()){let o=n.isVersion?l2t(n.value):n.value;r[n.filter]=o}return r})}a(eho,"setupExperimentationService");function Xpo(t){return l2t(!t.get(As).isProduction()&&t.get(Ir).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Ir).getEditorPluginInfo().version)}a(Xpo,"getEditorPluginVersion");function Rpl(t){let e=t.get(Ir).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a(Rpl,"getPluginRelease");function kpl(t){let e=t.get(Ir).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(kpl,"getTargetPopulation");function Ppl(t){return Dpl(t)}a(Ppl,"createAllFilters");function Dpl(t){let e=t.get(za);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(As).isProduction()?A1(t):"1.999.0"}}a(Dpl,"createDefaultFilters");function l2t(t){return t.split("-")[0]}a(l2t,"trimVersionSuffix");p();p();var Npl=new Set(["__proto__","constructor","prototype"]);function tP(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}a(tP,"asObject");function e9e(t){return Object.entries(t).filter(([e])=>!Npl.has(e))}a(e9e,"safeEntries");function RGr(t){if(Array.isArray(t))return t.map(RGr);let e=tP(t);return e?Object.fromEntries(e9e(e).map(([r,n])=>[r,RGr(n)])):t}a(RGr,"sanitizeRaw");function kGr(t){let e=tP(t);if(!e)return;let r={};for(let[n,o]of e9e(e))typeof o=="string"&&(r[n]=o);return r}a(kGr,"normalizeStringRecord");function Mpl(t){let e=tP(t);if(!e)return;let r={};return e.disableBypassPermissionsMode==="disable"&&(r.disableBypassPermissionsMode="disable"),r}a(Mpl,"normalizePermissions");function Opl(t,e){let r=tP(t);if(!r)return;let n=e9e(r);if(n.length!==1)return;let[o,s]=n[0];switch(o){case"serverUrl":return typeof s=="string"&&s.length>0?{serverUrl:s}:void 0;case"serverCommand":return Array.isArray(s)&&s.length>0&&s.every(c=>typeof c=="string"&&c.length>0)?{serverCommand:s}:void 0;case"serverName":return typeof s=="string"&&s.length>0&&(!e||/^[A-Za-z0-9_-]+$/.test(s))?{serverName:s}:void 0;default:return}}a(Opl,"normalizeMcpServerMatcher");function tho(t,e){if(!Array.isArray(t))return;let r=[];for(let n of t){let o=Opl(n,e);o&&r.push(o)}return r}a(tho,"normalizeMcpServers");function Lpl(t){if(!Array.isArray(t)||t.length===0)return;let e=[];for(let r of t){if(typeof r!="string"||r.length===0||e.includes(r))return;e.push(r)}return e}a(Lpl,"normalizeOrganizationLogins");function Bpl(t){let e=tP(t);if(!e||e.mode!=="enabled"&&e.mode!=="disabled"&&e.mode!=="requireSSO")return;let r=Lpl(e.githubDotComOrganizations);return e.mode==="requireSSO"?r?{mode:e.mode,githubDotComOrganizations:r}:void 0:{mode:e.mode,...r!==void 0&&{githubDotComOrganizations:r}}}a(Bpl,"normalizeRemoteControl");function Fpl(t){let e=tP(t);if(!e)return;let r={};for(let[n,o]of e9e(e))typeof o=="boolean"&&(r[n]=o);return r}a(Fpl,"normalizeEnabledPlugins");function rho(t){let e=tP(t);if(!(!e||typeof e.source!="string"))switch(e.source){case"github":return typeof e.repo!="string"||!/^[^/:]+\/[^/:]+$/.test(e.repo)?void 0:{source:"github",repo:e.repo,...typeof e.ref=="string"&&{ref:e.ref},...typeof e.path=="string"&&{path:e.path}};case"git":return typeof e.url!="string"?void 0:{source:"git",url:e.url,...typeof e.ref=="string"&&{ref:e.ref},...typeof e.path=="string"&&{path:e.path}};case"directory":return typeof e.path=="string"?{source:"directory",path:e.path}:void 0;default:return}}a(rho,"normalizeMarketplaceSource");function Upl(t){let e=tP(t);if(!e)return;let r={};for(let[n,o]of e9e(e)){let s=tP(o),c=rho(s?.source);c&&(r[n]={source:c})}return r}a(Upl,"normalizeExtraKnownMarketplaces");function Qpl(t){let e=tP(t);if(!(!e||typeof e.source!="string"))switch(e.source){case"github":case"git":case"directory":return rho(t);case"url":{if(typeof e.url!="string")return;let r=kGr(e.headers);return{source:"url",url:e.url,...r!==void 0&&{headers:r}}}case"npm":return typeof e.package=="string"?{source:"npm",package:e.package}:void 0;case"file":return typeof e.path=="string"?{source:"file",path:e.path}:void 0;case"hostPattern":return typeof e.hostPattern=="string"?{source:"hostPattern",hostPattern:e.hostPattern}:void 0;case"pathPattern":return typeof e.pathPattern=="string"?{source:"pathPattern",pathPattern:e.pathPattern}:void 0;default:return}}a(Qpl,"normalizeStrictMarketplaceEntry");function qpl(t){if(!Array.isArray(t))return;let e=[];for(let r of t){let n=Qpl(r);n&&e.push(n)}return e}a(qpl,"normalizeStrictKnownMarketplaces");function jpl(t){let e=tP(t);if(!e)return;let r={};typeof e.enabled=="boolean"&&(r.enabled=e.enabled),typeof e.endpoint=="string"&&(r.endpoint=e.endpoint),typeof e.protocol=="string"&&(r.protocol=e.protocol),typeof e.captureContent=="boolean"&&(r.captureContent=e.captureContent),typeof e.lockCaptureContent=="boolean"&&(r.lockCaptureContent=e.lockCaptureContent),typeof e.serviceName=="string"&&(r.serviceName=e.serviceName);let n=kGr(e.headers);n&&(r.headers=n);let o=kGr(e.resourceAttributes);return o&&(r.resourceAttributes=o),r}a(jpl,"normalizeTelemetry");function nho(t){let e=tP(t);if(!e)return{};let r=RGr(e),n=tho(r.allowedMcpServers,!0),o=tho(r.deniedMcpServers,!1),s=r.model==="auto"?r.model:void 0,c=Mpl(r.permissions),l=Bpl(r.remoteControl),u=Fpl(r.enabledPlugins),d=Upl(r.extraKnownMarketplaces),f=qpl(r.strictKnownMarketplaces),h=jpl(r.telemetry);return{...n!==void 0&&{allowedMcpServers:n},...o!==void 0&&{deniedMcpServers:o},...s!==void 0&&{model:s},...c!==void 0&&{permissions:c},...l!==void 0&&{remoteControl:l},...u!==void 0&&{enabledPlugins:u},...d!==void 0&&{extraKnownMarketplaces:d},...f!==void 0&&{strictKnownMarketplaces:f},...h!==void 0&&{telemetry:h},raw:r}}a(nho,"normalizeManagedSettings");p();var Hpl="managedSettings.fetch",Gpl="managedSettings.active";function iho(t){return Object.keys(t).filter(e=>e!=="raw").length}a(iho,"countManagedSettingsKeys");function oho(t,e,r){$c(t,Hpl,{result:r.result,channel:e,force:String(r.force),retainedLastKnownGood:String(r.retainedLastKnownGood),...r.hasSettings!==void 0&&{hasSettings:String(r.hasSettings)}},{...r.durationMs!==void 0&&{durationMs:r.durationMs},...r.payloadBytes!==void 0&&{payloadBytes:r.payloadBytes},...r.httpStatus!==void 0&&{httpStatus:r.httpStatus},...r.settingsKeyCount!==void 0&&{settingsKeyCount:r.settingsKeyCount}})}a(oho,"emitManagedSettingsFetchTelemetry");function sho(t,e){$c(t,Gpl,{channel:e})}a(sho,"emitManagedSettingsActiveTelemetry");var cho=require("node:util");var $pl=new pe("managedSettings.serverSource"),Vpl="copilot_internal/managed_settings",aho=3600*1e3,Wpl="COPILOT_MANAGED_SETTINGS_REFRESH_INTERVAL_MS",zpl=5*1e3,Ypl=60*1e3,Kpl=1440*60*1e3;function lho(t,e=process.env){let r=t.get(Qt);return new PGr({resolveSession:a(async()=>await t.get(Or).resolveSession(),"resolveSession"),fetch:a(async(n,o,s)=>await $d(t,n,o,s),"fetch"),onDidChangeAuth:a(n=>{let o=[r.onDidChangeTokenResult(n),r.onDidResetToken(n)];return{dispose:a(()=>{for(let s of o)s.dispose()},"dispose")}},"onDidChangeAuth"),now:a(()=>t.get(HC).now().getTime(),"now"),refreshIntervalMs:Jpl(e),reportError:a(n=>$pl.exception(t,n,".refresh"),"reportError"),emitTelemetry:a(n=>oho(t,"server",n),"emitTelemetry"),emitActiveTelemetry:a(()=>sho(t,"server"),"emitActiveTelemetry"),scheduleInterval:a((n,o)=>{let s=setInterval(n,o);return s.unref?.(),{dispose:a(()=>clearInterval(s),"dispose")}},"scheduleInterval")})}a(lho,"createServerManagedSettingsSource");function Jpl(t){let e=t[Wpl];if(e===void 0||e.trim()==="")return aho;let r=Number(e);return Number.isFinite(r)&&r>=0?r:aho}a(Jpl,"getRefreshIntervalMs");function Zpl(t){if(t===null)return;let e=Number(t);return Number.isFinite(e)&&e>=0?e:void 0}a(Zpl,"parseContentLength");var PGr=class{constructor(e){this.dependencies=e;this.channel="server";this.didChangeEmitter=new Lc;this.onDidChange=this.didChangeEmitter.event;this.inflightByAccount=new Map;this.retryAfterByAccount=new Map;this.authGeneration=0;this.disposed=!1}static{a(this,"ServerManagedSettingsSource")}get current(){return this.currentValue}async refresh({force:e=!1}={}){if(this.disposed)return;this.startWatchingAuthChanges(),this.startPeriodicRefresh();let r=this.authGeneration;try{let n=await this.dependencies.resolveSession();if(this.disposed||r!==this.authGeneration)return;if(!n){this.currentAccountKey=void 0,this.lastSuccessfulFetch=void 0,this.updateCurrent(void 0);return}let o=this.getAccountKey(n);o!==this.currentAccountKey&&(this.currentAccountKey=o,this.lastSuccessfulFetch=void 0,this.updateCurrent(void 0));let s=this.inflightByAccount.get(o);if(s){await s;return}let c=this.dependencies.now(),l=this.retryAfterByAccount.get(o);if(l!==void 0&&cthis.dependencies.reportError(f)).finally(()=>{this.inflightByAccount.get(o)===d&&this.inflightByAccount.delete(o)});this.inflightByAccount.set(o,d),await d}catch(n){this.dependencies.reportError(n)}}dispose(){this.disposed||(this.disposed=!0,this.authSubscription?.dispose(),this.refreshSubscription?.dispose(),this.didChangeEmitter.dispose())}startWatchingAuthChanges(){this.authSubscription??=this.dependencies.onDidChangeAuth(()=>{this.authGeneration++,this.refresh()})}startPeriodicRefresh(){this.refreshSubscription||this.dependencies.refreshIntervalMs<=0||(this.refreshSubscription=this.dependencies.scheduleInterval(()=>{this.refresh({force:!0})},this.dependencies.refreshIntervalMs))}async fetchAndUpdate(e,r,n){let o=this.dependencies.now(),s={result:"error",force:n,retainedLastKnownGood:!1};try{let c=await this.dependencies.fetch(e,Vpl,{method:"GET",timeout:zpl,headers:{Accept:"application/json"}});if(s.httpStatus=c.status,s.payloadBytes=Zpl(c.headers.get("content-length")),this.isStale(r)){s.result="stale";return}if(c.status===404){this.retryAfterByAccount.delete(r),this.lastSuccessfulFetch={accountKey:r,fetchedAt:this.dependencies.now()},this.updateCurrent(void 0),s.result="not_found",s.hasSettings=!1,s.settingsKeyCount=0;return}if(!c.ok){if(c.status===403||c.status===429){let u=(UM(c)??Ypl/1e3)*1e3,d=this.dependencies.now()+u;this.retryAfterByAccount.set(r,Math.max(this.retryAfterByAccount.get(r)??0,d)),s.result="rate_limited"}else s.result="http_error";throw new Rx(c)}let l=nho(await c.json());if(this.isStale(r)){s.result="stale";return}this.retryAfterByAccount.delete(r),this.lastSuccessfulFetch={accountKey:r,fetchedAt:this.dependencies.now()},this.updateCurrent(l),s.result="success",s.settingsKeyCount=iho(l),s.hasSettings=s.settingsKeyCount>0,s.hasSettings&&this.reportActive(r)}finally{s.durationMs=this.dependencies.now()-o,s.retainedLastKnownGood=(s.result==="error"||s.result==="http_error"||s.result==="rate_limited")&&this.currentValue!==void 0,this.dependencies.emitTelemetry(s)}}isStale(e){return this.disposed||e!==this.currentAccountKey}reportActive(e){let r=Math.floor(this.dependencies.now()/Kpl);this.lastActiveReport?.accountKey===e&&this.lastActiveReport.day===r||(this.lastActiveReport={accountKey:e,day:r},this.dependencies.emitActiveTelemetry())}updateCurrent(e){(0,cho.isDeepStrictEqual)(this.currentValue,e)||(this.currentValue=e,this.didChangeEmitter.fire())}getAccountKey(e){return`${e.apiUrl}\0${e.login}`}};p();var gz=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var Obe=class{static{a(this,"AbstractCopilotMessageSender")}};p();var uho=100,dho=1e3*60*5;function fho(t){let e=new DGr(t);t.get(Pm).registerContextProvider(e),t.get(O4).add(e.id)}a(fho,"registerRelatedFilesShim");var DGr=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new aP(uho,dho);this.relatedFilesCache=new aP(uho,dho);this.resolver={resolve:a(async(r,n)=>{let o=r.documentContext.uri,s=r.documentContext.languageId;return await this.getTraits(o,s,n)},"resolve")}}static{a(this,"RelatedFilesShim")}async getTraits(e,r,n){return this.traitCache.has(e)||await this.requestRelatedFilesAndTraits(e,r,r,n),this.traitCache.get(e)??[]}async requestRelatedFilesAndTraits(e,r,n,o){try{let s=await this.ctx.get(tr).fetchTokenAndUpdateExPValuesAndAssignments({uri:e,languageId:n}),c={uri:e,clientLanguageId:r,detectedLanguageId:n},l=await Dpt(this.ctx,c,s,o,!0);if(o?.isCancellationRequested)return;let u=l.traits.filter(f=>f.includeInPrompt).map(f=>f.promptTextOverride?{name:"OtherInformation",value:f.promptTextOverride}:f),d=new Set;for(let f of l.entries.values())for(let h of f.keys())d.add(h);this.traitCache.set(e,u),this.relatedFilesCache.set(e,Array.from(d))}catch(s){OK(this.ctx,s,"relatedFilesShim")}}};var amo=fe(Zee()),cmo=fe(require("path"));p();var t9e=fe(ii());var Xpl=new t9e.ProtocolRequestType("workspace/readFile"),ehl=new t9e.ProtocolRequestType("workspace/readDirectory"),thl=new t9e.ProtocolRequestType("workspace/findFiles"),rhl=new t9e.ProtocolRequestType("workspace/findTextInFiles"),u2t=class extends ga{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(Xpl,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(ehl,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(thl,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(rhl,r,"findTextInFiles",n=>({matchCount:n.matches.length}))}get connection(){return this.ctx.get(er).connection}async sendRequestWithTelemetry(r,n,o,s){let c=performance.now();try{let l=await this.connection.sendRequest(r,n),u=Math.round(performance.now()-c);return sr(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw Hs(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var d2t=class extends u5{constructor(r){super();this.ctx=r}static{a(this,"AgentLSPRequestSender")}async sendRequest(r,n){let o=this.ctx.get(er);try{return await o.connection.sendRequest(r,n)}catch(s){throw Hs(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var f2t=class t extends tte{constructor(r){super(r);this.reportedUnknownProviders=new Set}static{a(this,"AgentRelatedFilesProvider")}get service(){return this.context.get(er)}static mapProviderNameToNeighboringFileType(r){let n="CSharpCopilotCompletionContextProvider",o="CSharpRoslynCompletionRelatedContextProvider",s="CppCopilotCompletionContextProvider",c="CppCopilotCompletionSemanticCodeContextProvider";switch(r){case n:return"related/csharp";case o:return"related/csharproslyn";case s:return"related/cpp";case c:return"related/cppsemanticcodecontext";default:return"related/other"}}convert(r){let n={entries:[],traits:r.traits};for(let o of r.entries){let s={type:t.mapProviderNameToNeighboringFileType(o.providerName),uris:o.uris};n.entries.push(s),s.type==="related/other"&&!this.reportedUnknownProviders.has(o.providerName)&&(this.reportedUnknownProviders.add(o.providerName),Dg.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){Dg.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(Nn).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return Dg.debug(this.context,"`copilot/related` not supported"),Nci;try{let c=await this.service.connection.sendRequest(sGt.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){Dg.exception(this.context,c,".copilotRelated");return}}static{this.telemetrySent=!1}static relatedCapabilityTelemetry(r,n,o){try{if(!o||t.telemetrySent)return;t.telemetrySent=!0,ft(r,"copilotRelated.hasRelatedCapability",n)}catch(s){Dg.exception(r,s,"copilotRelated")}}};p();p();var _ho=fe(ii());p();p();function pho(t,e){return(e<<5)-e+t|0}a(pho,"numberHash");function hho(t,e){e=pho(149417,e);for(let r=0,n=t.length;r{this.initialize()})}static{a(this,"StateDatabase")}get isClosed(){return this.state===3}get canPersist(){return this.persistenceEnabled&&!this.initializationFailed&&!this.isClosed}get canPerformDatabaseOperation(){return this.persistenceEnabled&&!this.initializationFailed}get onDidChange(){return this.changeEmitter.event}get initialized(){return this.state===2&&this.persistenceEnabled&&!this.initializationFailed&&this.database!==void 0}get size(){return this.cache.size}has(e){return this.cache.has(e)}clear(){if(this.isClosed)return;let e=this.getAllKeys();for(let r of e)this.delete(r)}getAllKeys(){return[...this.cache.keys()]}get(e){return this.cache.get(e)}set(e,r){if(this.isClosed)return;let n=pNn(r)||Array.isArray(r)?JSON.stringify(r):String(r);this.cache.get(e)!==n&&(this.cache.set(e,n),this.changeEmitter.fire({key:e,value:n}),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this.scheduleFlush())}delete(e){this.isClosed||!this.cache.delete(e)||(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this.changeEmitter.fire({key:e,value:void 0}),this.scheduleFlush())}initialize(){if(this.state!==0)return;let e=this.ctx.get(Nn).getCapabilities().stateDatabase??!1;if(this.state=1,this.persistenceEnabled=e,!e){this.state=2,this.initializationFailed=!1,this.database=void 0;return}this.initializationTask||(this.initializationTask=this.initializeWithTimeout().catch(r=>{this.handleInitializationError("Failed to initialize state database",r)})),this.state=2}handleInitializationError(e,r){this.initializationFailed=!0,this.state=0,Lbe.error(this.ctx,e,r)}async waitForInitialization(){await this.initializationTask?.catch(()=>{})}async dispose(){this.state=3,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0);try{await this.forceFlush()}catch(e){Lbe.error(this.ctx,"Failed to flush data before closing",e)}await this.waitForInitialization(),await this.writeQueue.catch(()=>{}),this.database&&(this.close(this.database),this.database=void 0),this.persistenceEnabled=!1}async forceFlush(){if(!this.canPersist)return;this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),await this.flushPendingChanges()&&await this.writeQueue}async initializeWithTimeout(){await Promise.race([this.initializeInternal(),(0,gho.setTimeout)(nhl).then(()=>{throw new Error("State database initialization timed out")})])}async initializeInternal(){let e;try{e=await this.resolveDatabasePath()}catch(o){this.handleInitializationError("State database disabled - unable to resolve storage path",o);return}let r;try{r=new hho.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` - ${ihl}; - ${ohl}; +`,fhl="SELECT key, value FROM state",Lbe=new pe("state-database"),CA=class{constructor(e){this.cache=new Map;this.changeEmitter=new Ji;this.pendingInserts=new Map;this.pendingDeletes=new Set;this.writeQueue=Promise.resolve();this.persistenceEnabled=!1;this.initializationFailed=!1;this.state=0;this.ctx=e,e.get(Nn).onDidSetCapabilities(()=>{this.initialize()})}static{a(this,"StateDatabase")}get isClosed(){return this.state===3}get canPersist(){return this.persistenceEnabled&&!this.initializationFailed&&!this.isClosed}get canPerformDatabaseOperation(){return this.persistenceEnabled&&!this.initializationFailed}get onDidChange(){return this.changeEmitter.event}get initialized(){return this.state===2&&this.persistenceEnabled&&!this.initializationFailed&&this.database!==void 0}get size(){return this.cache.size}has(e){return this.cache.has(e)}clear(){if(this.isClosed)return;let e=this.getAllKeys();for(let r of e)this.delete(r)}getAllKeys(){return[...this.cache.keys()]}get(e){return this.cache.get(e)}set(e,r){if(this.isClosed)return;let n=hNn(r)||Array.isArray(r)?JSON.stringify(r):String(r);this.cache.get(e)!==n&&(this.cache.set(e,n),this.changeEmitter.fire({key:e,value:n}),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this.scheduleFlush())}delete(e){this.isClosed||!this.cache.delete(e)||(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this.changeEmitter.fire({key:e,value:void 0}),this.scheduleFlush())}initialize(){if(this.state!==0)return;let e=this.ctx.get(Nn).getCapabilities().stateDatabase??!1;if(this.state=1,this.persistenceEnabled=e,!e){this.state=2,this.initializationFailed=!1,this.database=void 0;return}this.initializationTask||(this.initializationTask=this.initializeWithTimeout().catch(r=>{this.handleInitializationError("Failed to initialize state database",r)})),this.state=2}handleInitializationError(e,r){this.initializationFailed=!0,this.state=0,Lbe.error(this.ctx,e,r)}async waitForInitialization(){await this.initializationTask?.catch(()=>{})}async dispose(){this.state=3,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0);try{await this.forceFlush()}catch(e){Lbe.error(this.ctx,"Failed to flush data before closing",e)}await this.waitForInitialization(),await this.writeQueue.catch(()=>{}),this.database&&(this.close(this.database),this.database=void 0),this.persistenceEnabled=!1}async forceFlush(){if(!this.canPersist)return;this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),await this.flushPendingChanges()&&await this.writeQueue}async initializeWithTimeout(){await Promise.race([this.initializeInternal(),(0,yho.setTimeout)(ohl).then(()=>{throw new Error("State database initialization timed out")})])}async initializeInternal(){let e;try{e=await this.resolveDatabasePath()}catch(o){this.handleInitializationError("State database disabled - unable to resolve storage path",o);return}let r;try{r=new gho.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` ${shl}; ${ahl}; ${chl}; - `);let n=this.all(r,uhl,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):Lbe.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){Lbe.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(Un).directory;await pho.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return mho.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Ir).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||rhl}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=thl;this.flushTimer=setTimeout(()=>{this.flushTimer=void 0,this.flushPendingChanges()},e),typeof this.flushTimer.unref=="function"&&this.flushTimer.unref()}enqueue(e){return this.writeQueue=this.writeQueue.then(e).catch(r=>{Lbe.error(this.ctx,"State database write failed",r)}),this.writeQueue}async flushPendingChanges(){let e=new Map(this.pendingInserts.entries()),r=new Set(this.pendingDeletes.values());return this.pendingInserts.clear(),this.pendingDeletes.clear(),!e.size&&!r.size?!1:(await this.enqueue(()=>this.persistWrites(e,r)),!0)}async persistWrites(e,r){if(!e.size&&!r.size)return;let n=await this.awaitDatabase();if(!n){for(let[o,s]of e)this.pendingInserts.set(o,s);for(let o of r)this.pendingDeletes.add(o);return}this.run(n,"BEGIN IMMEDIATE",[]);try{for(let o of r)this.run(n,"DELETE FROM state WHERE key = ?",[o]);for(let[o,s]of e){let c;try{c=JSON.stringify(s)}catch(l){Lbe.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,lhl,[o,c,Date.now()])}this.run(n,"COMMIT",[])}catch(o){try{this.run(n,"ROLLBACK",[])}catch{}for(let[s,c]of e)this.pendingInserts.set(s,c);for(let s of r)this.pendingDeletes.add(s);throw this.scheduleFlush(),o}}async awaitDatabase(){if(this.canPerformDatabaseOperation)return await this.waitForInitialization(),this.database}run(e,r,n){let o=n;o.length>0?e.prepare(r).run(...o):e.prepare(r).run()}all(e,r,n){let o=n;return o.length>0?e.prepare(r).all(...o):e.prepare(r).all()}close(e){e.close()}};var vC=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},f2t=class extends vC{static{a(this,"CLSDynamicAuthenticationProviderStorageService")}constructor(e){super(),this.ctx=e}getClientRegistration(e){let r=this._getClientRegistration(e);if(r)try{let n=JSON.parse(r);if(n&&(n.clientId||n.clientSecret))return n}catch{this._removeClientRegistration(e)}}storeClientRegistration(e,r,n,o,s){let c={providerId:e,label:s||e,authorizationServer:r,clientId:n,clientSecret:o};this._updateClientRegistration(e,c)}removeDynamicProvider(e){this._removeClientRegistration(e)}getSessionsForDynamicAuthProvider(e,r){let n=this._getSessions(e,r);if(n)try{let o=JSON.parse(n);if(!Array.isArray(o)||!o.every(s=>typeof s.created_at=="number"&&Udt(s))){this._removeSessions(e,r);return}return o}catch{this._removeSessions(e,r)}}setSessionsForDynamicAuthProvider(e,r,n){this._updateSessions(e,r,n)}_generateClientKey(e){return`dynamicAuthProvider:clientRegistration:${e}`}_generateSessionKey(e,r){return`dynamicAuthProvider:sessions:${e}:${r}`}_getClientRegistration(e){let r=this._generateClientKey(e);return this.ctx.get(CA).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get(CA).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get(CA).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get(CA).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get(CA).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get(CA).delete(n)}};var RE=new pe("DynamicAuthenticationProvider"),p2t=class{static{a(this,"DynamicAuthenticationProvider")}constructor(e,r,n,o,s,c,l){this.ctx=e,this.authorizationServer=r,this.serverMetadata=n,this.resourceMetadata=o,this.clientId=s,this.clientSecret=c,this.initialTokens=l,this.id=o?.resource?r+" "+o?.resource:r,this.label=o?.resource_name??r,this.authorizationServers=[r],this.supportsMultipleAccounts=!0,this._tokenStore=new DGr(e,l,{set:a(u=>{this.ctx.get(vC).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(RE.info(this.ctx,`Getting sessions for scopes: ${e?.join(" ")??"all"}`),!e)return this._tokenStore.sessions;let n=[...e].sort(),o=e.join(" "),s=this._tokenStore.sessions.filter(c=>hke([...c.scopes].sort(),n));if(RE.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s.length){let c=[],l=[],u=new Map(this._tokenStore.tokens.map(d=>[d.access_token,d]));for(let d of s){let f=u.get(d.accessToken);if(f&&f.expires_in){let h=Date.now(),m=f.expires_in*1e3;if(h>f.created_at+m-300*1e3){if(RE.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){RE.warn(this.ctx,`No refresh token available for scopes ${d.scopes.join(" ")}. Throwing away token.`);continue}try{let g=await this.exchangeRefreshTokenForToken(f.refresh_token);g.scope!==o&&(RE.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),RE.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){RE.error(this.ctx,"Failed to refresh token: ",g)}}}}return(c.length||l.length)&&(this._tokenStore.update({added:c,removed:l}),s=this._tokenStore.sessions.filter(d=>hke([...d.scopes].sort(),n))),RE.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new oCe(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(RE.warn(this.ctx,`Token scopes '${o.scope}' do not match requested scopes '${e.join(" ")}'. Overwriting token with what was requested...`),o.scope=e.join(" ")),this._tokenStore.update({added:[{...o,created_at:Date.now()}],removed:[]});let s=this._tokenStore.sessions.find(c=>c.accessToken===o.access_token);return RE.info(this.ctx,`Created ${o.refresh_token?"refreshable":"non-refreshable"} session for scopes: ${o.scope}${o.expires_in?` that expires in ${o.expires_in} seconds`:""}`),s}removeSession(e){RE.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return RE.error(this.ctx,`Session with id ${e} not found`),Promise.resolve();let n=this._tokenStore.tokens.find(o=>o.access_token===r.accessToken);return n?(this._tokenStore.update({added:[],removed:[n]}),RE.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(RE.error(this.ctx,`Failed to retrieve token for removed session: ${r.id}`),Promise.resolve())}async exchangeRefreshTokenForToken(e){if(!this.serverMetadata.token_endpoint)throw new Error("Token endpoint not available in server metadata");let r=new URLSearchParams;r.append("client_id",this.clientId),r.append("grant_type","refresh_token"),r.append("refresh_token",e),this.resourceMetadata?.resource&&r.append("resource",this.resourceMetadata.resource),this.clientSecret&&r.append("client_secret",this.clientSecret);let o=await(await this.ctx.get(Jt).fetch(this.serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()})).json();if(Udt(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},DGr=class{static{a(this,"TokenStore")}constructor(e,r,n){this.ctx=e,this.tokens=r??[],this._persistence=n}get sessions(){return this.tokens.map(e=>this._getSessionFromToken(e))}update({added:e,removed:r}){RE.info(this.ctx,`Updating tokens: added ${e.length}, removed ${r.length}`);let n=[...this.tokens];for(let o of r){let s=n.findIndex(c=>c.access_token===o.access_token);s!==-1&&n.splice(s,1)}for(let o of e){let s=n.findIndex(c=>c.access_token===o.access_token);s===-1?n.push(o):n[s]=o}(e.length||r.length)&&(this.tokens=n,this._persistence.set(n)),RE.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=Agr(e.id_token)}catch{}if(!r)try{r=Agr(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:fho(e.access_token,0).toString(),accessToken:e.access_token,account:{id:r?.sub||"unknown",label:r?.preferred_username||r?.name||r?.email||"MCP"},scopes:n,idToken:e.id_token}}};var lx=new pe("DynamicAuthProviderService"),xM=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new Aho.ProtocolRequestType("copilot/dynamicOAuth")}constructor(e){this.ctx=e}async registerDynamicAuthProvider(e,r,n,o,s,c){if(!o){let u=await this.getDynamicClientRegistration(e,r,n);o=u.clientId,s=u.clientSecret}let l=new p2t(this.ctx,e,r,n,o,s,c);return this.registerDynamicAuthenticationProvider(l),l}async getDynamicClientRegistration(e,r,n){let o,s;if(r.registration_endpoint)try{let c=await this.fetchDynamicRegistration(r,n?.scopes_supported);o=c.client_id,s=c.client_secret}catch(c){lx.error(this.ctx,`Dynamic registration failed for ${e.toString()}: ${ld(c)}. Prompting user for client ID and client secret...`)}if(!o){let c=[`http://127.0.0.1:${iCe}/callback`,"http://127.0.0.1/callback"],l;try{l=await this.ctx.get(er).connection.sendRequest(t.dynamicOAuthRequestType,{title:"Add Client Registration Details",header:`The authorization server '${e.toString()}' does not support automatic client registration.`,detail:`Do you want to proceed by manually providing a client registration (client ID)? + ${lhl}; + ${uhl}; + `);let n=this.all(r,fhl,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):Lbe.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){Lbe.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(Un).directory;await mho.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return Aho.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Ir).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||ihl}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=nhl;this.flushTimer=setTimeout(()=>{this.flushTimer=void 0,this.flushPendingChanges()},e),typeof this.flushTimer.unref=="function"&&this.flushTimer.unref()}enqueue(e){return this.writeQueue=this.writeQueue.then(e).catch(r=>{Lbe.error(this.ctx,"State database write failed",r)}),this.writeQueue}async flushPendingChanges(){let e=new Map(this.pendingInserts.entries()),r=new Set(this.pendingDeletes.values());return this.pendingInserts.clear(),this.pendingDeletes.clear(),!e.size&&!r.size?!1:(await this.enqueue(()=>this.persistWrites(e,r)),!0)}async persistWrites(e,r){if(!e.size&&!r.size)return;let n=await this.awaitDatabase();if(!n){for(let[o,s]of e)this.pendingInserts.set(o,s);for(let o of r)this.pendingDeletes.add(o);return}this.run(n,"BEGIN IMMEDIATE",[]);try{for(let o of r)this.run(n,"DELETE FROM state WHERE key = ?",[o]);for(let[o,s]of e){let c;try{c=JSON.stringify(s)}catch(l){Lbe.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,dhl,[o,c,Date.now()])}this.run(n,"COMMIT",[])}catch(o){try{this.run(n,"ROLLBACK",[])}catch{}for(let[s,c]of e)this.pendingInserts.set(s,c);for(let s of r)this.pendingDeletes.add(s);throw this.scheduleFlush(),o}}async awaitDatabase(){if(this.canPerformDatabaseOperation)return await this.waitForInitialization(),this.database}run(e,r,n){let o=n;o.length>0?e.prepare(r).run(...o):e.prepare(r).run()}all(e,r,n){let o=n;return o.length>0?e.prepare(r).all(...o):e.prepare(r).all()}close(e){e.close()}};var vC=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},p2t=class extends vC{static{a(this,"CLSDynamicAuthenticationProviderStorageService")}constructor(e){super(),this.ctx=e}getClientRegistration(e){let r=this._getClientRegistration(e);if(r)try{let n=JSON.parse(r);if(n&&(n.clientId||n.clientSecret))return n}catch{this._removeClientRegistration(e)}}storeClientRegistration(e,r,n,o,s){let c={providerId:e,label:s||e,authorizationServer:r,clientId:n,clientSecret:o};this._updateClientRegistration(e,c)}removeDynamicProvider(e){this._removeClientRegistration(e)}getSessionsForDynamicAuthProvider(e,r){let n=this._getSessions(e,r);if(n)try{let o=JSON.parse(n);if(!Array.isArray(o)||!o.every(s=>typeof s.created_at=="number"&&Udt(s))){this._removeSessions(e,r);return}return o}catch{this._removeSessions(e,r)}}setSessionsForDynamicAuthProvider(e,r,n){this._updateSessions(e,r,n)}_generateClientKey(e){return`dynamicAuthProvider:clientRegistration:${e}`}_generateSessionKey(e,r){return`dynamicAuthProvider:sessions:${e}:${r}`}_getClientRegistration(e){let r=this._generateClientKey(e);return this.ctx.get(CA).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get(CA).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get(CA).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get(CA).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get(CA).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get(CA).delete(n)}};var RE=new pe("DynamicAuthenticationProvider"),h2t=class{static{a(this,"DynamicAuthenticationProvider")}constructor(e,r,n,o,s,c,l){this.ctx=e,this.authorizationServer=r,this.serverMetadata=n,this.resourceMetadata=o,this.clientId=s,this.clientSecret=c,this.initialTokens=l,this.id=o?.resource?r+" "+o?.resource:r,this.label=o?.resource_name??r,this.authorizationServers=[r],this.supportsMultipleAccounts=!0,this._tokenStore=new NGr(e,l,{set:a(u=>{this.ctx.get(vC).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(RE.info(this.ctx,`Getting sessions for scopes: ${e?.join(" ")??"all"}`),!e)return this._tokenStore.sessions;let n=[...e].sort(),o=e.join(" "),s=this._tokenStore.sessions.filter(c=>hke([...c.scopes].sort(),n));if(RE.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s.length){let c=[],l=[],u=new Map(this._tokenStore.tokens.map(d=>[d.access_token,d]));for(let d of s){let f=u.get(d.accessToken);if(f&&f.expires_in){let h=Date.now(),m=f.expires_in*1e3;if(h>f.created_at+m-300*1e3){if(RE.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){RE.warn(this.ctx,`No refresh token available for scopes ${d.scopes.join(" ")}. Throwing away token.`);continue}try{let g=await this.exchangeRefreshTokenForToken(f.refresh_token);g.scope!==o&&(RE.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),RE.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){RE.error(this.ctx,"Failed to refresh token: ",g)}}}}return(c.length||l.length)&&(this._tokenStore.update({added:c,removed:l}),s=this._tokenStore.sessions.filter(d=>hke([...d.scopes].sort(),n))),RE.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new oCe(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(RE.warn(this.ctx,`Token scopes '${o.scope}' do not match requested scopes '${e.join(" ")}'. Overwriting token with what was requested...`),o.scope=e.join(" ")),this._tokenStore.update({added:[{...o,created_at:Date.now()}],removed:[]});let s=this._tokenStore.sessions.find(c=>c.accessToken===o.access_token);return RE.info(this.ctx,`Created ${o.refresh_token?"refreshable":"non-refreshable"} session for scopes: ${o.scope}${o.expires_in?` that expires in ${o.expires_in} seconds`:""}`),s}removeSession(e){RE.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return RE.error(this.ctx,`Session with id ${e} not found`),Promise.resolve();let n=this._tokenStore.tokens.find(o=>o.access_token===r.accessToken);return n?(this._tokenStore.update({added:[],removed:[n]}),RE.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(RE.error(this.ctx,`Failed to retrieve token for removed session: ${r.id}`),Promise.resolve())}async exchangeRefreshTokenForToken(e){if(!this.serverMetadata.token_endpoint)throw new Error("Token endpoint not available in server metadata");let r=new URLSearchParams;r.append("client_id",this.clientId),r.append("grant_type","refresh_token"),r.append("refresh_token",e),this.resourceMetadata?.resource&&r.append("resource",this.resourceMetadata.resource),this.clientSecret&&r.append("client_secret",this.clientSecret);let o=await(await this.ctx.get(Jt).fetch(this.serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()})).json();if(Udt(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},NGr=class{static{a(this,"TokenStore")}constructor(e,r,n){this.ctx=e,this.tokens=r??[],this._persistence=n}get sessions(){return this.tokens.map(e=>this._getSessionFromToken(e))}update({added:e,removed:r}){RE.info(this.ctx,`Updating tokens: added ${e.length}, removed ${r.length}`);let n=[...this.tokens];for(let o of r){let s=n.findIndex(c=>c.access_token===o.access_token);s!==-1&&n.splice(s,1)}for(let o of e){let s=n.findIndex(c=>c.access_token===o.access_token);s===-1?n.push(o):n[s]=o}(e.length||r.length)&&(this.tokens=n,this._persistence.set(n)),RE.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=ygr(e.id_token)}catch{}if(!r)try{r=ygr(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:hho(e.access_token,0).toString(),accessToken:e.access_token,account:{id:r?.sub||"unknown",label:r?.preferred_username||r?.name||r?.email||"MCP"},scopes:n,idToken:e.id_token}}};var lx=new pe("DynamicAuthProviderService"),xM=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new _ho.ProtocolRequestType("copilot/dynamicOAuth")}constructor(e){this.ctx=e}async registerDynamicAuthProvider(e,r,n,o,s,c){if(!o){let u=await this.getDynamicClientRegistration(e,r,n);o=u.clientId,s=u.clientSecret}let l=new h2t(this.ctx,e,r,n,o,s,c);return this.registerDynamicAuthenticationProvider(l),l}async getDynamicClientRegistration(e,r,n){let o,s;if(r.registration_endpoint)try{let c=await this.fetchDynamicRegistration(r,n?.scopes_supported);o=c.client_id,s=c.client_secret}catch(c){lx.error(this.ctx,`Dynamic registration failed for ${e.toString()}: ${ld(c)}. Prompting user for client ID and client secret...`)}if(!o){let c=[`http://127.0.0.1:${iCe}/callback`,"http://127.0.0.1/callback"],l;try{l=await this.ctx.get(er).connection.sendRequest(t.dynamicOAuthRequestType,{title:"Add Client Registration Details",header:`The authorization server '${e.toString()}' does not support automatic client registration.`,detail:`Do you want to proceed by manually providing a client registration (client ID)? Note: When registering your OAuth application, make sure to include these redirect URIs: ${c.join(` -`)}`,inputs:[{title:"Client ID",value:"clientId",description:`Enter an existing client ID that has been registered with the following redirect URIs: ${c.join(", ")}`,placeholder:"OAuth client ID (azye39d...)",required:!0},{title:"Client Secret",value:"clientSecret",description:"(optional) Enter an existing client secret associated with the previous client id or leave this field blank",placeholder:"OAuth client secret (wer32o50f...) or leave it blank",required:!1}]})}catch(u){lx.error(this.ctx,`Failed to get client ID and secret from user: ${ld(u)}`)}if(!l)throw new Error("User did not provide client details");o=l.clientId,s=l.clientSecret,lx.info(this.ctx,`User provided client registration for ${e.toString()}`),s?lx.info(this.ctx,`User provided client secret for ${e.toString()}`):lx.info(this.ctx,`User did not provide client secret for ${e.toString()}`)}return{clientId:o,clientSecret:s}}async fetchDynamicRegistration(e,r){if(!e.registration_endpoint)throw new Error("Server does not support dynamic registration");let n=await this.ctx.get(Jt).fetch(e.registration_endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:"GitHub Copilot",client_uri:"https://github.com/features/copilot",grant_types:e.grant_types_supported?e.grant_types_supported.filter(s=>m9r.includes(s)):m9r,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${iCe}/callback`,`http://127.0.0.1:${iCe}/callback`],scope:r?.join(xni),token_endpoint_auth_method:"none",application_type:"native"})});if(!n.ok)throw new Error(`Dynamic client registration failed: ${n.status} ${n.statusText}`);let o=await n.json();if(Nni(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(xm).registerAuthenticationProvider(e.id,e),this.ctx.get(vC).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(xm);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);lx.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);lx.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw lx.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(xm);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});lx.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);lx.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw lx.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(xm),n=this.ctx.get(vC);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),lx.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw lx.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var h2t=class extends xm{constructor(r){super();this._authenticationProviders=new Map;this.ctx=r}static{a(this,"CLSAuthenticationService")}registerAuthenticationProvider(r,n){this._authenticationProviders.set(r,n)}unregisterAuthenticationProvider(r){this._authenticationProviders.delete(r)}getOrActivateProviderIdForServer(r){for(let n of this._authenticationProviders.values())if(n.authorizationServers?.some(o=>o===r))return n.id}createAuthenticationProvider(r,n,o){if(r===uM.providerId){let s=new uM(this.ctx,r,n,o);return this.registerAuthenticationProvider(s.id,s),s}}async createDynamicAuthenticationProvider(r,n,o){let s=o?`${r.toString()} ${o.resource}`:r.toString(),c=this.ctx.get(vC).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(vC).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(xM).registerDynamicAuthProvider(r,n,o,l,u,d)}getProvider(r){if(this._authenticationProviders.has(r))return this._authenticationProviders.get(r);throw new Error(`No authentication provider '${r}' is currently registered.`)}async getSessions(r,n,o,s=!1){let c=this._authenticationProviders.get(r);if(c){if(o?.authorizationServer){let l=o.authorizationServer;if(!c.authorizationServers?.some(u=>u===l))throw new Error(`The authorization server '${l}' is not supported by the authentication provider '${r}'.`)}return await c.getSessions(n,{...o})}else throw new Error(`No authentication provider '${r}' is currently registered.`)}};p();var _ho=fe(Wc());var yho=new pe("agentCopilotTokenManager"),dhl={type:new _ho.ProtocolRequestType("copilot/token")},m2t=class extends $h{constructor(){super(...arguments);this.networkFetcher=new tqe}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(Nn).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(er).connection;try{let c=await s.sendRequest(dhl.type,{force:!1,session:n});if(!c?.envelope)throw new Ei("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(yho.debug(r,"Retrieved envelope from copilot/token"),l.expires_at*1e3this.updateCapabilities(r))}static{a(this,"CapabilitiesUpdater")}async updateCapabilities(e){let r=this.ctx.get(Nn),n=this.isPreviewFeaturesDisabled(e);n&&!this.isJetBrains()&&r.setCapabilities({mcpAllowlist:!1}),await this.updateCveRemediatorCapability(e,n)}async updateCveRemediatorCapability(e,r){let n=this.ctx.get(Nn),o=this.ctx.get(tr),s=n.getCapabilities().cveRemediatorAgent??!1,c=await o.updateExPValuesAndAssignments(e),l=o.cveRemediatorAgentEnabled(c),u=s&&l&&!r;n.setCapabilities({cveRemediatorAgent:u})}isPreviewFeaturesDisabled(e){return e.getTokenValue("editor_preview_features")==="0"}isJetBrains(){return this.ctx.get(Ir).getEditorPluginInfo().name==="copilot-intellij"}};p();var fhl=new pe("Public Code References"),g2t=class extends fI{static{a(this,"CLSCitationManager")}async handleIPCodeCitation(e,r){let n=r.location?.start.line!==void 0?r.location.start.line+1:"-",o=r.location?.start.character!==void 0?r.location.start.character+1:"-",s=(r.matchingText??"").replace(/[\r\n]/g," ");fhl.info(e,`Text found matching public code in ${r.inDocumentUri} [Ln ${n}, Col ${o}] near ${s}...:`+r.details.map((c,l)=>` - ${l+1}) [${c.license}] ${c.url}`).join("")),!(r.version===void 0||r.location===void 0)&&e.get(Nn).getCapabilities().ipCodeCitation===!0&&await e.get(er).connection.sendNotification(JHt.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var NGr=fe(Wc());var phl=new NGr.ProtocolNotificationType("$/copilot/compressionStarted"),hhl=new NGr.ProtocolNotificationType("$/copilot/compressionCompleted"),A2t=class extends KI{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(er).connection.sendNotification(phl,r)}async notifyCompressionCompleted(r){await this.ctx.get(er).connection.sendNotification(hhl,r)}};p();p();function Eho(t){mhl(t)}a(Eho,"activateExtensibilityPlatformFeature");function mhl(t){t.set(C2,new AXe(t)),t.set(m5,new m5(t))}a(mhl,"registerContextDependencies");p();var vho=b.String(),MGr=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(_2t,"build logs"),`The contents of the application build logs: +`)}`,inputs:[{title:"Client ID",value:"clientId",description:`Enter an existing client ID that has been registered with the following redirect URIs: ${c.join(", ")}`,placeholder:"OAuth client ID (azye39d...)",required:!0},{title:"Client Secret",value:"clientSecret",description:"(optional) Enter an existing client secret associated with the previous client id or leave this field blank",placeholder:"OAuth client secret (wer32o50f...) or leave it blank",required:!1}]})}catch(u){lx.error(this.ctx,`Failed to get client ID and secret from user: ${ld(u)}`)}if(!l)throw new Error("User did not provide client details");o=l.clientId,s=l.clientSecret,lx.info(this.ctx,`User provided client registration for ${e.toString()}`),s?lx.info(this.ctx,`User provided client secret for ${e.toString()}`):lx.info(this.ctx,`User did not provide client secret for ${e.toString()}`)}return{clientId:o,clientSecret:s}}async fetchDynamicRegistration(e,r){if(!e.registration_endpoint)throw new Error("Server does not support dynamic registration");let n=await this.ctx.get(Jt).fetch(e.registration_endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:"GitHub Copilot",client_uri:"https://github.com/features/copilot",grant_types:e.grant_types_supported?e.grant_types_supported.filter(s=>g9r.includes(s)):g9r,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${iCe}/callback`,`http://127.0.0.1:${iCe}/callback`],scope:r?.join(Rni),token_endpoint_auth_method:"none",application_type:"native"})});if(!n.ok)throw new Error(`Dynamic client registration failed: ${n.status} ${n.statusText}`);let o=await n.json();if(Oni(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(xm).registerAuthenticationProvider(e.id,e),this.ctx.get(vC).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(xm);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);lx.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);lx.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw lx.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(xm);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});lx.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);lx.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw lx.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(xm),n=this.ctx.get(vC);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),lx.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw lx.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var m2t=class extends xm{constructor(r){super();this._authenticationProviders=new Map;this.ctx=r}static{a(this,"CLSAuthenticationService")}registerAuthenticationProvider(r,n){this._authenticationProviders.set(r,n)}unregisterAuthenticationProvider(r){this._authenticationProviders.delete(r)}getOrActivateProviderIdForServer(r){for(let n of this._authenticationProviders.values())if(n.authorizationServers?.some(o=>o===r))return n.id}createAuthenticationProvider(r,n,o){if(r===uM.providerId){let s=new uM(this.ctx,r,n,o);return this.registerAuthenticationProvider(s.id,s),s}}async createDynamicAuthenticationProvider(r,n,o){let s=o?`${r.toString()} ${o.resource}`:r.toString(),c=this.ctx.get(vC).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(vC).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(xM).registerDynamicAuthProvider(r,n,o,l,u,d)}getProvider(r){if(this._authenticationProviders.has(r))return this._authenticationProviders.get(r);throw new Error(`No authentication provider '${r}' is currently registered.`)}async getSessions(r,n,o,s=!1){let c=this._authenticationProviders.get(r);if(c){if(o?.authorizationServer){let l=o.authorizationServer;if(!c.authorizationServers?.some(u=>u===l))throw new Error(`The authorization server '${l}' is not supported by the authentication provider '${r}'.`)}return await c.getSessions(n,{...o})}else throw new Error(`No authentication provider '${r}' is currently registered.`)}};p();var vho=fe(Wc());var Eho=new pe("agentCopilotTokenManager"),phl={type:new vho.ProtocolRequestType("copilot/token")},g2t=class extends $h{constructor(){super(...arguments);this.networkFetcher=new tqe}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(Nn).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(er).connection;try{let c=await s.sendRequest(phl.type,{force:!1,session:n});if(!c?.envelope)throw new Ei("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(Eho.debug(r,"Retrieved envelope from copilot/token"),l.expires_at*1e3this.updateCapabilities(r))}static{a(this,"CapabilitiesUpdater")}async updateCapabilities(e){let r=this.ctx.get(Nn),n=this.isPreviewFeaturesDisabled(e);n&&!this.isJetBrains()&&r.setCapabilities({mcpAllowlist:!1}),await this.updateCveRemediatorCapability(e,n)}async updateCveRemediatorCapability(e,r){let n=this.ctx.get(Nn),o=this.ctx.get(tr),s=n.getCapabilities().cveRemediatorAgent??!1,c=await o.updateExPValuesAndAssignments(e),l=o.cveRemediatorAgentEnabled(c),u=s&&l&&!r;n.setCapabilities({cveRemediatorAgent:u})}isPreviewFeaturesDisabled(e){return e.getTokenValue("editor_preview_features")==="0"}isJetBrains(){return this.ctx.get(Ir).getEditorPluginInfo().name==="copilot-intellij"}};p();var hhl=new pe("Public Code References"),A2t=class extends fI{static{a(this,"CLSCitationManager")}async handleIPCodeCitation(e,r){let n=r.location?.start.line!==void 0?r.location.start.line+1:"-",o=r.location?.start.character!==void 0?r.location.start.character+1:"-",s=(r.matchingText??"").replace(/[\r\n]/g," ");hhl.info(e,`Text found matching public code in ${r.inDocumentUri} [Ln ${n}, Col ${o}] near ${s}...:`+r.details.map((c,l)=>` + ${l+1}) [${c.license}] ${c.url}`).join("")),!(r.version===void 0||r.location===void 0)&&e.get(Nn).getCapabilities().ipCodeCitation===!0&&await e.get(er).connection.sendNotification(ZHt.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var MGr=fe(Wc());var mhl=new MGr.ProtocolNotificationType("$/copilot/compressionStarted"),ghl=new MGr.ProtocolNotificationType("$/copilot/compressionCompleted"),y2t=class extends KI{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(er).connection.sendNotification(mhl,r)}async notifyCompressionCompleted(r){await this.ctx.get(er).connection.sendNotification(ghl,r)}};p();p();function Cho(t){Ahl(t)}a(Cho,"activateExtensibilityPlatformFeature");function Ahl(t){t.set(C2,new AXe(t)),t.set(m5,new m5(t))}a(Ahl,"registerContextDependencies");p();var bho=b.String(),OGr=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(E2t,"build logs"),`The contents of the application build logs: \`\`\` ${e} -\`\`\``}},_2t="build-logs",y2t=class extends T0{static{a(this,"BuildLogsSkill")}constructor(e){super(_2t,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new MGr(r))}};p();var OGr=class{constructor(e){this.turnContext=e}static{a(this,"DirectoryReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.filterDirectoryReferences(e);if(r.length===0)return;let n=await Ntt(this.turnContext.ctx,this.turnContext.cancelationToken,r);if(n.length>0){let o=[[new vr(["The user wants you to consider the following directory structures when computing your answer."]),1]];for(let s of n)o.push([new vr([s]),1]);return new vr(o)}}filterDirectoryReferences(e){return e.filter(r=>r.type==="directory")}},LGr=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},ghl="directory-references",E2t=class{constructor(){this.id=ghl;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new LGr}processor(e){return new OGr(e)}};p();var Ahl=b.Object({uri:b.String(),visibleRange:b.Optional(Of),openedAt:b.Optional(b.String()),activeAt:b.Optional(b.String())}),Cho=b.Object({files:b.Array(Ahl)}),yhl=3,BGr=class{constructor(e){this.turnContext=e}static{a(this,"RecentFilesSkillProcessor")}value(){return .7}async processSkill(e){let r=await this.getDocuments(e);if(r.length>0){let n=this.toElidableDocs(r),o=sj(n,"inversePositional");return await this.preElideDocuments(o)}}async getDocuments(e){let r=this.sortFiles(e.files);r=this.filterIncludedDocs(r);let n=this.turnContext.ctx.get(si),o=[];for(let s of r){let c=await n.getOrReadTextDocument(s),l=dd(c);if(await this.turnContext.collectFile(C2t,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===yhl))break}return o.reverse()}sortFiles(e){return e.sort((r,n)=>r.activeAt&&n.activeAt?new Date(r.activeAt).getTime()-new Date(n.activeAt).getTime():r.activeAt?-1:n.activeAt?1:0).reverse()}filterIncludedDocs(e){return e.filter(r=>!this.turnContext.isFileIncluded(r.uri))}toElidableDocs(e){return e.map(r=>{let[n,o]=r,s=this.turnContext.ctx.get(si).getRelativePath(n),c=new c5(n,void 0,o.visibleRange);return new vr([[`Code excerpt from file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),.9]])})}async preElideDocuments(e){let r=(await Ro.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new vr([n])}},C2t="recent-files",v2t=class extends T0{static{a(this,"RecentFilesSkill")}constructor(e){super(C2t,"Provides code examples helpful for creating, explaining, refactoring, or fixing code. It's based on the files the user has worked on in the editor.","Resolving recent files",()=>e,r=>new BGr(r))}};p();var bho=b.String(),FGr=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(S2t,"runtime logs"),`The contents of the application runtime logs: +\`\`\``}},E2t="build-logs",_2t=class extends I0{static{a(this,"BuildLogsSkill")}constructor(e){super(E2t,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new OGr(r))}};p();var LGr=class{constructor(e){this.turnContext=e}static{a(this,"DirectoryReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.filterDirectoryReferences(e);if(r.length===0)return;let n=await Ntt(this.turnContext.ctx,this.turnContext.cancelationToken,r);if(n.length>0){let o=[[new vr(["The user wants you to consider the following directory structures when computing your answer."]),1]];for(let s of n)o.push([new vr([s]),1]);return new vr(o)}}filterDirectoryReferences(e){return e.filter(r=>r.type==="directory")}},BGr=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},yhl="directory-references",v2t=class{constructor(){this.id=yhl;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new BGr}processor(e){return new LGr(e)}};p();var _hl=b.Object({uri:b.String(),visibleRange:b.Optional(Of),openedAt:b.Optional(b.String()),activeAt:b.Optional(b.String())}),Sho=b.Object({files:b.Array(_hl)}),Ehl=3,FGr=class{constructor(e){this.turnContext=e}static{a(this,"RecentFilesSkillProcessor")}value(){return .7}async processSkill(e){let r=await this.getDocuments(e);if(r.length>0){let n=this.toElidableDocs(r),o=sj(n,"inversePositional");return await this.preElideDocuments(o)}}async getDocuments(e){let r=this.sortFiles(e.files);r=this.filterIncludedDocs(r);let n=this.turnContext.ctx.get(si),o=[];for(let s of r){let c=await n.getOrReadTextDocument(s),l=dd(c);if(await this.turnContext.collectFile(b2t,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===Ehl))break}return o.reverse()}sortFiles(e){return e.sort((r,n)=>r.activeAt&&n.activeAt?new Date(r.activeAt).getTime()-new Date(n.activeAt).getTime():r.activeAt?-1:n.activeAt?1:0).reverse()}filterIncludedDocs(e){return e.filter(r=>!this.turnContext.isFileIncluded(r.uri))}toElidableDocs(e){return e.map(r=>{let[n,o]=r,s=this.turnContext.ctx.get(si).getRelativePath(n),c=new c5(n,void 0,o.visibleRange);return new vr([[`Code excerpt from file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),.9]])})}async preElideDocuments(e){let r=(await Ro.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new vr([n])}},b2t="recent-files",C2t=class extends I0{static{a(this,"RecentFilesSkill")}constructor(e){super(b2t,"Provides code examples helpful for creating, explaining, refactoring, or fixing code. It's based on the files the user has worked on in the editor.","Resolving recent files",()=>e,r=>new FGr(r))}};p();var Tho=b.String(),UGr=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(T2t,"runtime logs"),`The contents of the application runtime logs: \`\`\` ${e} -\`\`\``}},S2t="runtime-logs",b2t=class extends T0{static{a(this,"RuntimeLogsSkill")}constructor(e){super(S2t,"The application runtime or debug logs, which are used to view output logs from the console. This is useful for debugging and troubleshooting runtime issues.","Reading runtime logs",()=>e,r=>new FGr(r))}};p();var T2t=fe(s2());var I2t=class extends dm{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return P7e(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(er).connection}async inspectPrompt(r){return this.connection?.sendNotification(new T2t.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new T2t.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new T2t.NotificationType("conversation/documentDiff"),r)}};p();var Sho=fe(Wc());var n9e=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(Bk).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(er).connection.sendNotification(new Sho.NotificationType(this.notificationEndpoint),e)}};function Tho(t){_hl(t),Ehl(t),Eho(t)}a(Tho,"activateConversationFeature");function _hl(t){t.set(Xo,new Xo(t)),t.set(I0,new I0),t.set(jA,new jA(t)),t.set(dl,new JKe(t)),t.set(b9,new b9),t.set(Bc,new Bc(t)),t.set(Bk,new Bk(t)),t.set(n9e,new n9e(t)),t.set(Ns,new _We(t,new yWe(t))),t.set(aM,new aM),t.set(dm,new I2t(t)),t.set(R2,new R2(t))}a(_hl,"registerContextDependencies");function Ehl(t){let e=new fm;e.registerSkill(new att(new stt)),e.registerSkill(new NZe(new hC(t,l5,_In))),e.registerSkill(new vZe(new hC(t,E2,hIn))),e.registerSkill(new EZe(new hC(t,I_,pIn))),e.registerSkill(new MZe),e.registerSkill(new E2t),e.registerSkill(new v2t(new hC(t,C2t,Cho))),e.registerSkill(new cXe(new hC(t,g5,xxn))),e.registerSkill(new dtt(new hC(t,Sj,fDn))),e.registerSkill(new b2t(new hC(t,S2t,bho))),e.registerSkill(new y2t(new hC(t,_2t,vho))),e.registerSkill(new ptt(new hC(t,k2,pDn))),e.registerSkill(new htt(new hC(t,sZ,hDn))),t.set(fm,e)}a(Ehl,"registerSkills");p();var Iho=fe(Wc()),xho=fe(s2());var x2t=class extends Xd{constructor(){super(...arguments);this.requestType=new Iho.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=Zu.Compile(bbn)}static{a(this,"AgentClientToolConfirmationInvoker")}async invokeClientToolConfirmation(r,n){let o=this.ctx.get(er).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new xho.ResponseError(u.code,u.message,u.data);throw ot.error(this.ctx,`ResponseError while invoking client tool confirmation ${n.name}`,d),new Error(`Failed to invoke client tool confirmation ${n.name}: ${u.message}`)}s=l}catch(c){throw new Error(`Failed to invoke client tool confirmation ${n.name}: ${String(c)}`)}if(s==null)throw new Error(`Failed to invoke client tool confirmation ${n.name}: No result returned`);if(!this.typeCheck.Check(s))throw new ey(this.typeCheck.Errors(s));return s}};p();var who=fe(Wc()),Rho=fe(s2());var w2t=class extends tv{constructor(){super(...arguments);this.requestType=new who.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=Zu.Compile(Cbn)}static{a(this,"AgentClientToolInvoker")}async invokeClientTool(r,n){let o=this.ctx.get(er).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Rho.ResponseError(u.code,u.message,u.data);throw ot.error(this.ctx,`ResponseError while invoking client tool ${n.name}`,d),new Error(`Failed to invoke client tool ${n.name}: ${u.message}`)}s=l}catch(c){throw new Error(`Failed to invoke client tool ${n.name}: ${String(c)}`)}if(s==null)throw new Error(`Failed to invoke client tool ${n.name}: No result returned`);if(!this.typeCheck.Check(s))throw new ey(this.typeCheck.Errors(s));return this.transformToToolResult(s)}transformToToolResult(r){let n=r.content.map(o=>typeof o.value=="string"?new Or(o.value):new _J(o.value));return new Gr(n,r.status??"success")}};p();p();function kho(t,e,r){try{let n=t.get(tr).javaContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Br.debug(t,"Failed to get the active Java experiments for the Context Provider API",n),!1}return!0}a(kho,"fillInJavaActiveExperiments");var UGr=fe(s2());var vhl={type:new UGr.NotificationType("featureFlagsNotification")},Chl={type:new UGr.NotificationType("copilot/didChangeFeatureFlags")},i9e=class{constructor(e){this.ctx=e;ws(e,r=>this.sendNotification(r))}static{a(this,"FeatureFlagsNotifier")}async sendNotification(e){let r=this.ctx,n=!1,o=!1,s=!1,c=!1,l=!1,u=r.get(tr),d=await u.updateExPValuesAndAssignments(e);n=u.ideDataMigrationCompleted(d),o=u.appmodContextMenuEnabled(d),s=u.appmodProblemsViewEnabled(d),c=u.cliAsDefaultAgentProviderEnabled(d),l=u.inlineChatUseCliEnabled(d);let f={};r.get(tr).excludeRelatedFiles(d)&&(f.ExcludeRelatedFiles=!0);let h=i0r(r,d);h.length>0&&(f.ExpContextProviders=h);let m=new Map;rsi(r,h,m,d),lft(r,m,d),kho(r,m,d);for(let[y,_]of m.entries())f[y]=_;let g=r.get(Nn),A=r.get(er).connection;if(g.getCapabilities().didChangeFeatureFlags)await A.sendNotification(Chl.type,{envelope:{...e.envelope,token:void 0,expires_at:void 0,refresh_in:void 0,limited_user_quotas:void 0,limited_user_reset_date:void 0,error_details:void 0,organization_list:void 0,enterprise_list:void 0,endpoints:void 0},token:e.getTokenValues(),activeExps:f,byok:Bq(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,inline_chat_use_cli_enabled:l,user_info__cli_enabled:e.userInfo.cliEnabled,copilot_plan:e.userInfo.copilotPlan,abexp_features:d.filtersAndExp.exp.features,abexp_assignment_context:d.filtersAndExp.exp.assignmentContext});else{let y={rt:e.getTokenValue("rt")==="1",sn:e.getTokenValue("sn")==="1",chat:e.envelope.chat_enabled??!1,ic:e.envelope.chat_enabled??!1,pc:!0,ae:f,byok:Bq(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,inline_chat_use_cli_enabled:l};e.getTokenValue("agent_mode")==="0"&&(y.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(y.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(y.mcp=!1),e.envelope.chat_enabled&&(y.xc=!0),e.userInfo.cliEnabled!==void 0&&(y.user_info__cli_enabled=e.userInfo.cliEnabled),await A.sendNotification(vhl.type,y)}}};p();var R2t=class extends ks{constructor(r){super();this.ctx=r;this.notificationEndpoint="statusNotification"}static{a(this,"NotificationStatusReporter")}didChangeV1(r){let n=r.kind;r.busy&&n!=="Error"&&(n="InProgress"),this.ctx.get(er).connection.sendNotification(aGt.type,{busy:r.busy,kind:r.kind,status:n,message:r.message??""}),this.ctx.get(er).connection.sendNotification("didChangeStatus",{busy:r.busy,kind:r.kind,message:r.message,command:r.command})}didChangeV2(r){this.ctx.get(er).connection.sendNotification(cGt.type,r)}};p();var Pho=new pe("AgentEncodingConfigurationService"),k2t=class extends i5{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(er)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){Pho.debug(this.ctx,"Client does not support workspace/configuration, using UTF-8 fallback");return}try{let o=(await this.service.connection.workspace.getConfiguration([{scopeUri:e,section:"copilot.file.encoding"}]))[0];return o&&["utf8","utf-8","utf16le","ucs2","ucs-2","base64","base64url","latin1","binary","hex","ascii"].includes(o)?o:void 0}catch(n){Pho.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var Dho=new aq;p();var Oho=fe(ii());var Lho={"mcp.contributionPoint.enabled":{description:"Whether extension-contributed MCP servers are enabled",defaultValue:!0,type:"boolean"},"customAgent.enabled":{description:"Whether custom agent functionality is enabled",defaultValue:!0,type:"boolean"},"customHook.enabled":{description:"Whether custom hook functionality is enabled",defaultValue:!0,type:"boolean"},"customSkill.enabled":{description:"Whether custom skill functionality is enabled",defaultValue:!0,type:"boolean"},"subagent.enabled":{description:"Whether subagent functionality is enabled",defaultValue:!0,type:"boolean"},"autoModel.enabled":{description:"Whether auto model functionality is enabled",defaultValue:!0,type:"boolean"},"cveRemediatorAgent.enabled":{description:"Whether CVE remediator agent functionality is enabled",defaultValue:!0,type:"boolean"},"agentMode.autoApproval.enabled":{description:"Whether agent mode auto-approval is enabled",defaultValue:!0,type:"boolean"},"copilotAgent.ide.enabled":{description:"Whether copilot agent functionality is enabled",defaultValue:!0,type:"boolean"}},bhl=new Oho.NotificationType("policy/didChange"),Shl=Object.fromEntries(Object.entries(Lho).map(([t,e])=>[t,{type:e.type}])),o9e=class extends eu{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries(Lho).map(([r,n])=>[r,n.defaultValue]));let o=r.get(er);o.onActivation(()=>{this.startWatching().catch(s=>{Br.error(this.ctx,"Unexpected error starting policy watcher:",s)})}),o.onDeactivation(()=>{this.dispose()})}static{a(this,"GroupPolicyWatcher")}async startWatching(){try{let{createWatcher:r}=await Promise.resolve().then(()=>fe(Mho()));this.policyWatcher=r("IDEGitHubCopilot",Shl,n=>{this.handlePolicyUpdate(n).catch(o=>{Br.error(this.ctx,"Error in handlePolicyUpdate:",o)})}),Br.info(this.ctx,"Policy watcher started for GitHub Copilot Plugin")}catch(r){process.platform==="darwin"||process.platform==="win32"?Br.exception(this.ctx,r,"Policy watcher failed to load on supported platform"):Br.warn(this.ctx,"Policy watcher not available - continuing without policy watching:",r instanceof Error?r.message:String(r))}}async handlePolicyUpdate(r){Br.debug(this.ctx,"GroupPolicyWatcher - policy update triggered",r);let n=!1;for(let[o,s]of Object.entries(r))if(s!==void 0){let c=o;this.policyValues.get(c)!==s&&(n=!0),this.policyValues.set(c,s),Br.debug(this.ctx,`Policy change: ${o} = ${s}`)}n&&this.policyChangeEmitter.fire(void 0),this.policyValues.get("subagent.enabled")===!1&&this.ctx.get(Nn).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(Nn).setCapabilities({cveRemediatorAgent:!1}),await this.sendPolicyChangeNotification()}getAllPolicyValues(){let r={};for(let[n,o]of this.policyValues.entries())r[n]=o;return r}getPolicyValue(r){return this.policyValues.get(r)}sendPolicyChangeNotification(){if(this.disposed)return Promise.resolve();let r=this.getAllPolicyValues();try{return this.connection.sendNotification(bhl,r)}catch{return Promise.resolve()}}dispose(){if(!this.disposed){if(this.disposed=!0,this.policyWatcher){try{this.policyWatcher.dispose()}catch(r){Br.error(this.ctx,"Error disposing policy watcher:",r)}this.policyWatcher=void 0}Br.debug(this.ctx,"Policy watcher stopped")}}};p();var Fho=fe(Wc());var Bho=new pe("managedSettings.notifier"),Thl=new Fho.ProtocolNotificationType("copilot/didChangeManagedSettings"),s9e=class{constructor(e){this.ctx=e;this.disposed=!1;let r=e.get(er);this.lifecycleSubscriptions=[r.onActivation(()=>{e.get(Nn).getCapabilities().didChangeManagedSettings&&this.activate().catch(n=>Bho.exception(e,n,".activate"))}),r.onDeactivation(()=>this.dispose())]}static{a(this,"ManagedSettingsNotifier")}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.lifecycleSubscriptions)e.dispose();this.settingsSubscription?.dispose()}}async activate(){let e=this.ctx.get(ay);await e.refresh(),!this.disposed&&!this.settingsSubscription&&(this.settingsSubscription=e.observe(r=>this.notify(r)))}notify(e){this.ctx.get(er).connection.sendNotification(Thl,e).catch(r=>Bho.debug(this.ctx,"Failed to send managed settings notification:",r))}};p();var P2t=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(e){this.ctx.get(er).connection.sendNotification(WXi,{scope:e}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(er).connection.sendNotification(zXi,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(xM).unregisterProvider(e)}};p();var D2t=class extends Jb{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get(CA).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get(CA).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get(CA).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var Uho=fe(ii());var N2t="mcp.elicitation",M2t=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new Uho.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Hn(ri.InternalError,"Another MCP elicitation request is already in progress.");this.ongoingMcpElicitationCalls=!0;try{let c=n.params.message;if("url"in n.params)throw new Hn(ri.InvalidRequest,"URL mode elicitation is not supported");let l=n.params.requestedSchema;ur.info(e.ctx,`MCP server ${r} elicitation request received: ${c}`),await la(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(u5).sendRequest(this.elicitationRequestType,{mcpServer:r,message:c,requestedSchema:l,conversationId:e.conversation.id.toString(),roundId:o??e.agentToolCalls.getRound(0).roundId,turnId:e.turn.id.toString(),toolCallId:s??e.agentToolCalls.getRound(0).toolCalls[0].id});return ft(e.ctx,N2t,Vt.createAndMarkAsIssued()),sr(e.ctx,N2t),d}catch(c){let l=`Failed to process elicitation request: ${c instanceof Error?c.message:String(c)}`;throw ur.error(e.ctx,l,c),await Sd(e.ctx,{message:l,server:r}),Ma(e.ctx,c,N2t),Hs(e.ctx,N2t,c),new Hn(ri.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var rP=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var a9e=class extends rP{static{a(this,"LoggingMessageNotificationHandler")}constructor(e,r){super(e,r)}handle(e){let r=typeof e.params.data=="string"?e.params.data:JSON.stringify(e.params.data);switch(e.params.logger&&(r=`${e.params.logger}: ${r}`),e.params?.level){case"debug":case"info":case"notice":ur.info(this.ctx,`MCP server ${this.serverName} log:`,r),la(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":ur.warn(this.ctx,`MCP server ${this.serverName} log:`,r),mD(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"error":case"critical":case"alert":case"emergency":ur.error(this.ctx,`MCP server ${this.serverName} log:`,r),Sd(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:ur.info(this.ctx,`MCP server ${this.serverName} log:`,r),la(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var c9e=class extends rP{static{a(this,"PromptListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ur.info(this.ctx,"Prompts list changed, refreshing prompts..."),la(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(Yxt)}};p();var l9e=class extends rP{static{a(this,"ResourceListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ur.info(this.ctx,"Resource list changed, refreshing resources..."),la(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(zxt)}};p();var u9e=class extends rP{static{a(this,"ResourceUpdatedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ur.info(this.ctx,`Resource updated for URI: ${e.params.uri}`),la(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(UZi)}};p();var O2t=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},d9e=class extends O2t{static{a(this,"ListRootsRequestHandler")}constructor(e,r){super(e,r)}handle(e){ur.info(this.ctx,`MCP server ${this.serverName} requested roots list`);let r=[];try{(this.ctx.get($r).getWorkspaceFolders()||[]).forEach(o=>{r.push(o)}),la(this.ctx,{message:`Requested roots list and found ${r.length} root(s).`,server:this.serverName})}catch(n){ur.error(this.ctx,`Error getting workspace folders for MCP server ${this.serverName}:`,n),Sd(this.ctx,{message:`Error getting workspace folders for MCP server ${this.serverName}: ${n instanceof Error?n.message:String(n)}`,server:this.serverName})}return{roots:r}}};p();var f9e=class extends rP{static{a(this,"ToolListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ur.info(this.ctx,"Tool list changed, refreshing tools..."),la(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(Wxt)}};p();var Qho="mcp.sampling",L2t=class{constructor(){this.defaultTemperature=.7;this.ongoingMcpSamplingCalls=!1}static{a(this,"McpSamplingService")}async handleSamplingRequest(e,r,n,o,s,c){try{if(this.ongoingMcpSamplingCalls)throw new Hn(ri.InternalError,"Another MCP sampling request is already in progress.");this.ongoingMcpSamplingCalls=!0,ur.info(e.ctx,`MCP server ${o} requested sampling:`,n.params),await la(e.ctx,{message:`Sampling request received from ${o}: ${JSON.stringify({messageCount:n.params.messages.length,systemPrompt:n.params.systemPrompt?"provided":"none",maxTokens:n.params.maxTokens,temperature:n.params.temperature})}`,server:o});let l=await e.ctx.get(mz).readMcpSamplingConfig({serverName:o});if(l.alwaysDeny)throw new Error("User has chosen to always deny MCP tools with this mcp server.");if(!l.alwaysAllow){let y=n.params.messages.filter(v=>v.role==="user"),_=y[y.length-1];if((await e.ctx.get(Xd).invokeClientToolConfirmation(e,{name:o,title:`Allow MCP tools from "${o}" to make LLM requests?`,message:`The MCP server "${o}" has issued a request to make a language model call. Do you want to allow it to make requests during chat?`,input:{..._,toolType:"mcp_tool",mcpType:"sampling",mcpServerName:o},conversationId:e.conversation.id,roundId:s??e.agentToolCalls.getRound(0).roundId,turnId:e.turn.id,toolCallId:c??e.agentToolCalls.getRound(0).toolCalls[0].id})).result==="dismiss")throw new zc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await Qwe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new jn.CancellationTokenSource().token,g=await r.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:e.toLlmInteraction(),temperature:n.params.temperature??this.defaultTemperature,stop:n.params.stopSequences,turnId:String(e.turn.id)},m,f),A=this.processFetchResult(g,u.uiName);return $c(e.ctx,Qho,{userPreference:l.alwaysAllow?"autoApprove":l.alwaysDeny?"autoDeny":"none",selectedModel:u.uiName,success:"true"}),A}catch(l){let u=`Failed to process sampling request: ${l instanceof Error?l.message:String(l)}`;throw ur.error(e.ctx,u,l),await Sd(e.ctx,{message:u,server:o}),$c(e.ctx,Qho,{success:"false",errorMessage:u}),new Hn(ri.InternalError,u)}finally{this.ongoingMcpSamplingCalls=!1}}convertMCPMessagesToChatML(e,r,n){let o=[];n&&o.push({role:"system",content:n});for(let s of r){let c,l=Array.isArray(s.content)?s.content[0]:s.content;if(!l){ur.warn(e,"Empty content in MCP message, skipping");continue}if(l.type==="text")c=l.text;else if(l.type==="image")c=[{type:"image_url",image_url:{url:atob(l.data)}}];else throw ur.warn(e,`Unknown MCP content type: ${l.type}, defaulting to empty array`),new Error(`Unknown MCP content type: ${l.type}`);let u;switch(s.role){case"user":u="user";break;case"assistant":u="assistant";break;default:u="user",ur.warn(e,`Unknown MCP role: ${s.role}, defaulting to user`)}o.push({role:u,content:c})}return o}processFetchResult(e,r){if(e.type!=="success"){let n=`Unexpected fetch result type: ${e.type}.`;throw"reason"in e&&(n+=` Reason: ${e.reason}`),new Error(n)}return{model:r,role:"assistant",content:{type:"text",text:e.value}}}async getModelConfiguration(e,r,n){let o=await this.getAvailableBYOKModels(e),s=[...await this.getAvailableModels(e),...o.map(d=>d.name)];if(!s)throw new Error("No available models found");let c=n.allowedModels&&n.allowedModels.length>0?s.filter(d=>n.allowedModels.some(f=>f.toLowerCase()===d.toLowerCase())):s;if(!c||c.length===0)throw new Error("No available models found");let l;r.params.modelPreferences?.hints&&(l=this.mapFindFirst(r.params.modelPreferences.hints,d=>c.find(f=>f.toLowerCase().includes(d.name.toLowerCase())))),l=l??c[0];let u=o.find(d=>d.name===l);return u?zO(e,u.provider,l):await e.get(dl).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(Ns).getMetadata()).filter(n=>n.capabilities.type&&!Xle.has(n.capabilities.family)&&n.capabilities.supports?.tool_calls&&(n.capabilities.limits?.max_prompt_tokens??!1)).map(n=>n.capabilities.family)}async getAvailableBYOKModels(e){return(await new as(e.get(Un)).getAllModels(e)).filter(n=>n.capabilities?.toolCalling)}mapFindFirst(e,r){for(let n of e){let o=r(n);if(o!==void 0)return o}}};p();var Bbe=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function qho(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=Fdt(e);if(r!=="Bearer"||n.error!=="insufficient_scope")return null;let o=n.scope;if(!o)return null;let s=o.split(" ").filter(c=>c.length>0);return{error:n.error,requiredScopes:s,resourceMetadata:n.resource_metadata,errorDescription:n.error_description}}a(qho,"parseScopeChallenge");p();var qGr=/[^a-z0-9_-]/gi;var Ihl=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function jho(){let t={};for(let e of Ihl){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(jho,"getDefaultEnvironment");async function Hho(t,e,r){if(!e.description){let n=`Tool ${e.name} does not have a description. Tools must be accurately described to be called.`;ur.warn(t,n),await mD(t,{message:n,server:r,tool:e.name}),e.description=""}if(qGr.lastIndex=0,qGr.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;ur.warn(t,n),await mD(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(qGr,"_")}else e._nameForModel=e.name;return e}a(Hho,"normalizeTool");var B2t=class{constructor(){this.seenPrefixes=new Set}static{a(this,"McpPrefixGenerator")}generate(e){let r="mcp_"+e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"_").slice(0,13),n=r;for(let o=2;this.seenPrefixes.has(n);o++)n=r+o;return this.seenPrefixes.add(n),n}};p();async function*jGr(t,e,r){let n;do{let o=await t(n),s=e(o);s.length>0&&(yield s),n=r(o)}while(n!==void 0)}a(jGr,"paginateRequest");async function HGr(t){let e=[];for await(let r of t)e.push(...r);return e}a(HGr,"flattenAsyncIterable");var Gho=fe(require("events"));var GGr=6e4,gz=class{constructor(e,r,n){this.transport=null;this.emitter=new Gho.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(Nn);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new L2t),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new M2t);let s=this.ctx.get(Ir).getEditorInfo(),c=this.ctx.get(Ir).getEditorPluginInfo();this.mcp=new yG({name:`${s.name}/${c.name}`,version:`${s.version}/${c.version}`},{capabilities:{roots:{listChanged:!0},...this.isSamplingEnabled?{sampling:{}}:{},...this.isElicitationEnabled?{elicitation:{}}:{}}}),this.name=r}static{a(this,"MCPBaseServer")}get isConnected(){return this.transport!==null}async connect(e){if(this.transport=this.initTransport(e),!this.transport){let r=new Error("Failed to initialize transport");throw ur.error(this.ctx,"Transport initialization failed:",r),r}this.addListeners();try{await this.mcp.connect(this.transport),this.initializeCache()}catch(r){throw ur.error(this.ctx,"Connection failed:",r),await Sd(this.ctx,{message:`Failed to connect to MCP server: ${r instanceof Error?r.message:String(r)}`,server:this.name}),this.transport=null,r}}async initializeCache(){await Promise.all([this.refreshToolsCache(!0),this.refreshResourcesCache(!0),this.refreshPromptsCache(!0)]),this.emitter.emit(DW)}getCachedTools(){return this.cachedTools}getCachedResources(){return this.cachedResources}getCachedResourceTemplates(){return this.cachedResourceTemplates}getCachedPrompts(){return this.cachedPrompts}restoreCacheFromPersistence(e){this.cachedTools=[...e.tools],this.cachedResources=[...e.resources],this.cachedResourceTemplates=[...e.resourceTemplates],this.cachedPrompts=[...e.prompts]}async createMcpTool(e,r){let n={name:e.name,description:e.description,inputSchema:{...e.inputSchema||{},properties:e.inputSchema?.properties||{},type:e.inputSchema?.type||"object"},_status:r??"enabled",_nameForModel:e.name,annotations:e.annotations};return await Hho(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof Bbe){let l=`OAuth scope challenge during ${r} from server ${this.name}. Required scopes: ${s.challengeInfo.requiredScopes.join(", ")}`;if(n.scopeChallengeHandler)return n.scopeChallengeHandler(s.challengeInfo.requiredScopes);if(ur.info(this.ctx,l),await Sd(this.ctx,{message:l,server:this.name}),n.errorHandler)return n.errorHandler(l);if("defaultValue"in n)return n.defaultValue;throw s}if(s.code===ri.MethodNotFound){if(ur.info(this.ctx,`${r} not supported by server ${this.name}:`,s.message),"methodNotFoundValue"in n)return n.methodNotFoundValue;if(n.errorHandler)return n.errorHandler("Method not found");if("defaultValue"in n)return n.defaultValue;throw new Error("No default value or error handler provided")}let c=`Failed to ${r} from server ${this.name}: ${s.message||String(s)}`;if(ur.error(this.ctx,c),await Sd(this.ctx,{message:c,server:this.name}),n.errorHandler)return n.errorHandler(c);if("defaultValue"in n)return n.defaultValue;throw new Error("No default value or error handler provided")}}async*getResourcesIterable(e){if(!this.transport)return;let r=jGr(n=>this.mcp.listResources({cursor:n},{signal:e}),n=>n.resources,n=>n.nextCursor);for await(let n of r)yield n}async getResources(e){return await this.handleMCPOperationError(async()=>{let r=await HGr(this.getResourcesIterable(e));return la(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=jGr(n=>this.mcp.listResourceTemplates({cursor:n},{signal:e}),n=>n.resourceTemplates,n=>n.nextCursor);for await(let n of r)yield n}async getResourceTemplates(e){return await this.handleMCPOperationError(async()=>{let r=await HGr(this.getResourceTemplatesIterable(e));return la(this.ctx,{message:`Discovered ${r.length} resource templates`,server:this.name}),r},"get resource templates",{defaultValue:[]})}async readResource(e){return this.transport?await this.handleMCPOperationError(async()=>await this.mcp.readResource({uri:e}),`read resource ${e}`,{defaultValue:null,methodNotFoundValue:{contents:[]}}):null}async subscribeResource(e){this.transport&&await this.handleMCPOperationError(async()=>{await this.mcp.subscribeResource({uri:e})},`subscribe resource ${e}`,{defaultValue:void 0})}async unsubscribeResource(e){this.transport&&await this.handleMCPOperationError(async()=>{await this.mcp.unsubscribeResource({uri:e})},`unsubscribe resource ${e}`,{defaultValue:void 0})}async callTool(e,r,n,o,s,c){let l=SZ();this.ongoingMcpToolCalls.push({requestId:l,toolName:e,turnContext:o,roundId:s,toolCallId:c});let u=a(d=>{let f=new Gr([],"error");return f.content.push(new Or(d)),f},"createErrorResult");try{return await this.handleMCPOperationError(async()=>{let d=new AbortController;n.onCancellationRequested(()=>{d.abort()});let f=await this.mcp.callTool({name:e,arguments:r,_meta:{progressToken:l}},CR,{onprogress:a(m=>{ur.info(this.ctx,`${e} calling progress`,m),la(this.ctx,{message:`${e} calling progress:`+JSON.stringify(m),server:this.name})},"onprogress"),resetTimeoutOnProgress:!0,signal:d.signal});if(f&&typeof f=="object"){if(f.content||f.structuredContent)return this.formatToolResult(f);let m=`Error calling tool ${e}: `+JSON.stringify(f);return ur.error(this.ctx,m),await Sd(this.ctx,{message:m,server:this.name,tool:e}),u(m)}let h=`Error calling tool ${e}: `+JSON.stringify(f);return ur.error(this.ctx,h),await Sd(this.ctx,{message:h,server:this.name,tool:e}),u(h)},`call tool ${e}`,{errorHandler:u})}finally{this.ongoingMcpToolCalls=this.ongoingMcpToolCalls.filter(d=>d.requestId!==l)}}async getPrompt(e,r){return(await this.mcp.getPrompt({name:e,arguments:r})).messages}async completePrompt(e,r,n,o){return(await this.mcp.complete({ref:{type:"ref/prompt",name:e},argument:{name:r,value:n},context:{arguments:o}})).completion.values}addListeners(){this.mcp.onclose=()=>{ur.info(this.ctx,`MCP server ${this.name} connection closed.`),la(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{ur.error(this.ctx,`MCP server ${this.name} error:`,e),Sd(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(mee,e=>new a9e(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(j8,e=>new f9e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(q8,e=>new c9e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(Q8,e=>new l9e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(Hpr,e=>new u9e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(thr,e=>(this.initRootsTracker(),new d9e(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(DNe,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw ur.error(this.ctx,o),new Hn(ri.InternalError,o)}if(this.ongoingMcpToolCalls.length===0){let o="No ongoing tool call context found for sampling request.";throw ur.error(this.ctx,o),new Hn(ri.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new mc(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler(NNe,async e=>{if(this.ongoingMcpToolCalls.length===0){let n="No ongoing tool call context found for elicitation request.";throw ur.error(this.ctx,n),new Hn(ri.InternalError,n)}let r=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return this.elicitationHandler.handleRequest(r.turnContext,this.name,e,r.roundId,r.toolCallId)}),this.setupDataRefreshListeners()}setupDataRefreshListeners(){this.emitter.on(Wxt,()=>{this.refreshToolsCache()}),this.emitter.on(zxt,()=>{this.refreshResourcesCache()}),this.emitter.on(Yxt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(GGr),n=await this.mcp.listTools({},{signal:r}),o=new Map(this.cachedTools.map(s=>[s.name,s._status]));this.cachedTools=await Promise.all(n.tools.map(s=>this.createMcpTool(s,o.get(s.name)))),ur.info(this.ctx,`Refreshed ${this.cachedTools.length} tools for server ${this.name}`),e||this.emitter.emit(DW)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout(GGr),[n,o]=await Promise.all([this.getResources(r),this.getResourceTemplates(r)]);this.cachedResources=n,this.cachedResourceTemplates=o,ur.info(this.ctx,`Refreshed ${this.cachedResources.length} resources and ${this.cachedResourceTemplates.length} templates for server ${this.name}`),e||this.emitter.emit(DW)}catch(r){ur.error(this.ctx,`Failed to refresh resources cache for ${this.name}:`,r)}}async refreshPromptsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(GGr),n=await this.mcp.listPrompts({},{signal:r});this.cachedPrompts=n.prompts,ur.info(this.ctx,`Refreshed ${this.cachedPrompts.length} prompts for server ${this.name}`),e||this.emitter.emit(DW)},"refresh prompts",{defaultValue:void 0})}formatToolResult(e){let r=new Gr([],e.isError===!0?"error":"success");for(let n of e.content??[])if(n.type==="text")r.content.push(new Or(n.text));else if(n.type==="image"||n.type==="audio")r.content.push(new Mq({mimeType:n.mimeType,data:n.data}));else if(n.type==="resource"){let o=n.resource;if("text"in o)r.content.push(new Or(o.text));else if("blob"in o){let s=o.mimeType||"application/octet-stream";r.content.push(new Mq({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new Or(JSON.stringify(e.structuredContent))),r}initRootsTracker(){let e=this.ctx.get($r);this.rootsTracker=e.onDidChangeWorkspaceFolders(r=>{this.mcp.sendRootsListChanged().then(()=>{this.rootsTracker?.dispose()})})}getEmitter(){return this.emitter}async cleanup(){this.transport&&(await this.mcp.close(),this.mcp.transport&&this.mcp.transport.onclose?.(),this.rootsTracker?.dispose(),this.transport=null)}};p();function xhl(t){return a(async(r,n)=>{let o=r instanceof URL?r.toString():r,s;if(n?.headers)if(n.headers instanceof Headers){s={};for(let[f,h]of n.headers.entries())s[f]=h}else if(Array.isArray(n.headers)){s={};for(let[f,h]of n.headers)s[f]=h}else s=n.headers;let c={method:n?.method||"GET",headers:s,body:n?.body,signal:n?.signal||void 0},l=await t.fetch(o,c);if(l.status===403){let f=l.headers.get("WWW-Authenticate"),h=qho(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new Bbe(m,h)}}let u=l.body(),d=null;if(u)d=new ReadableStream({start(f){let h=a(y=>{f.enqueue(new Uint8Array(y))},"onData"),m=a(()=>{f.close(),A()},"onEnd"),g=a(y=>{f.error(y),A()},"onError"),A=a(()=>{u.off("data",h),u.off("end",m),u.off("error",g)},"cleanup");u.on("data",h),u.on("end",m),u.on("error",g)},cancel(){u&&"destroy"in u&&typeof u.destroy=="function"&&u.destroy()}});else{let f=await l.text();d=new ReadableStream({start(h){h.enqueue(new TextEncoder().encode(f)),h.close()}})}return new globalThis.Response(d,{status:l.status,statusText:l.statusText,headers:new Headers(l.headers)})},"fetchLike")}a(xhl,"createFetchAdapter");function F2t(t,e){let r=t.get(Jt),n=xhl(r);return{...e,fetch:n}}a(F2t,"createConfigWithFetch");var U2t=class extends gz{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=F2t(this.ctx,r),{url:o,...s}=n;return new rge(new URL(o),s)}};p();var $ho=require("child_process"),Vho=require("util");var Q2t=class extends gz{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...jho(),...r.env||{}},r.stderr="pipe",new lge(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{mD(this.ctx,{message:`[server stderr] ${r.toString().trimEnd()}`,server:this.name})})}async cleanup(){if(this.transport){if(process.platform==="win32"){let r=null;"pid"in this.transport&&typeof this.transport.pid=="number"&&(r=this.transport.pid),r&&await this.forceKillWindowsProcess(r)}await super.cleanup()}}async forceKillWindowsProcess(r){try{let n=(0,Vho.promisify)($ho.exec);ur.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),la(this.ctx,{message:`Force killing Windows process with PID ${r}`,server:this.name}),await n(`taskkill /pid ${r} /t /f`,{timeout:1e4}),ur.info(this.ctx,`Successfully force killed process ${r}`)}catch(n){ur.debug(this.ctx,`Failed to kill process ${r} (process may not exist):`,n),Sd(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var p9e=class extends gz{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=F2t(this.ctx,r),{url:o,...s}=n;return new nge(new URL(o),s)}};p();var q2t=class extends Nq{static{a(this,"McpLanguageModelTool")}constructor(e,r){super({...e,toolProvider:{id:e.serverName,displayNamePrefix:e.serverNamePrefix,displayName:e.serverName,description:e.serverName,isFirstPartyTool:!1},type:"mcp"}),this.invoker=r}prepareInvocation(e,r){let n={title:`Confirm MCP Tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`,message:`Do you want to allow the external MCP tool "${this.toolProvider.displayName}/${this.displayName}" to run?`};return{progressMessage:`Running MCP tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`,confirmationMessages:n}}prepareCompletion(e,r){return{completionMessage:`Ran MCP tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`}}async invoke(e,r,n){return await this.invoker(e,r,r.input,n)}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new zc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations};try{return await e.ctx.get(Xd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var Kho=fe(Wc());p();var Who="mcp-servers-cache",zho="mcp-first-boot-completed",j2t=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get(CA),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get(zho)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set(zho,"true")}parseCache(){let e=this.stateDb.get(Who);if(!e)return{};try{return JSON.parse(e)}catch{return{}}}async get(e){return await this.initPromise,this.parseCache()[e]}async store(e){await this.initPromise,this.stateDb.set(Who,e)}};p();function Yho(t){let e=t.get(Ir).getEditorPluginInfo();if(e.name==="copilot-intellij"){let r=e.version.endsWith("nightly"),n=e.version==="42.0.0.0";return r||n}if(e.name==="copilot-xcode"){let r=e.version.split(".");if(r.length>=3){let[n,o,s]=r;return n==="0"&&o==="0"&&s==="0"||n==="0"&&s!=="0"}}if(e.name==="copilot-eclipse"){let r=e.version.endsWith("nightly"),n=e.version.endsWith("qualifier");return r||n}return!1}a(Yho,"isNightlyOrDevBuild");var H2t=class t extends CE{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new _w;this.prefixGenerator=new B2t;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new j2t(r),this.registryService=r.get(lM),ws(this.ctx,async n=>{let o=this.isMcpEnabled;this.isMcpEnabled=this.isTokenMcpEnabled(n),o!==this.isMcpEnabled&&(ur.info(this.ctx,`MCP state changed from ${o} to ${this.isMcpEnabled}`),this.registryService.clearAllCaches(),this.isMcpEnabled?await this.updateMCPServers(this.storedMCPServersConfig):(ur.info(this.ctx,"MCP is disabled, clearing all servers and tools"),this.clearAllServers()))}),this.ctx.get(Nn).onDidSetCapabilities(n=>{let o=n.mcpAllowlist;o!==this.previousMcpAllowlist&&(this.previousMcpAllowlist=o,this.registryService.clearAllCaches(),this.isMcpEnabled&&(ur.info(this.ctx,`mcpAllowlist changed to ${o}, updating MCP servers`),this.updateMCPServers(this.storedMCPServersConfig)))})}static{a(this,"CLSMCPManager")}static{this.contentsNotificationType=new Kho.ProtocolNotificationType("copilot/mcpTools")}isTokenMcpEnabled(r){if(!r)return!0;try{return r.getTokenValue("mcp")!=="0"}catch(n){return ur.warn(this.ctx,`Error reading MCP value from token: ${n instanceof Error?n.message:String(n)}`),!0}}isAllowlistFeatureEnabled(){if(this.ctx.get(Nn).getCapabilities().mcpAllowlist)return ur.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=Yho(this.ctx);return n||ur.debug(this.ctx,"Allowlist feature disabled for stable version, only enabled for nightly/prerelease/dev (use copilotCapabilities.mcpAllowlist to override)"),n}ensureMcpEnabledOrThrow(r){if(!this.isMcpEnabled)throw new Error(`MCP is disabled, cannot ${r}`)}getActiveServerEntry(r){let n=this.MCPServersMap.get(r);if(!n)throw new Error(`MCP server ${r} does not exist`);if(n.isBlocked)throw new Error(`MCP server ${r} is blocked by registry`);return n}async ensureServerConnection(r,n,o){return n.server.isConnected?n.server:(ur.info(this.ctx,`Auto-starting MCP server ${r} for ${o}`),await this.startMCPServer(r),this.getActiveServerEntry(r).server)}async updateMCPServers(r){let n=this.storedMCPServersConfig;if(this.storedMCPServersConfig=r,!this.isMcpEnabled)return;let o=this.ctx.get(Nn).getCapabilities().mcpServerManagement??!1,s=new Set(Object.keys(r)),c=new Set(this.MCPServersMap.keys()),l=[...c].filter(m=>!s.has(m)),u=new Set([...s].filter(m=>c.has(m)&&!this.areServerConfigsEqual(n[m],r[m]))),d=new Set;for(let m of u){let g=this.MCPServersMap.get(m);g&&!g.isBlocked&&(g.server.isConnected||g.hasError)&&d.add(m)}let f=[...l,...u];for(let m of f){let g=this.MCPServersMap.get(m);g&&!g.isBlocked&&(this.unregisterServerTools(m),await this.stopMCPServer(m)),u.has(m)||(this.removeServerAccountPreferences(m),this.serverPrefixes.delete(m)),this.MCPServersMap.delete(m)}f.length>0&&await this.persistAllServersCache();for(let m of s)this.MCPServersMap.has(m)||await this.upsertServerDefinition(m,r[m]);if(await this.cache.isFirstBoot()||!o){if(await this.cache.markFirstBootCompleted(),s.size>0){let m=Array.from(s).map(async g=>{try{await this.startServer(g);let A=this.MCPServersMap.get(g);A&&(A.hasError=!1,A.errorMessage=void 0,A.isStarting=!1)}catch(A){let y=this.MCPServersMap.get(g);y&&(y.hasError=!0,y.errorMessage=A instanceof Error?A.message:String(A),y.isStarting=!1),ur.warn(this.ctx,`Failed to auto-start MCP server ${g} during first boot:`,A)}});await Promise.allSettled(m)}}else if(d.size>0){let m=Array.from(d).map(async g=>{try{await this.startServer(g);let A=this.MCPServersMap.get(g);A&&!A.isBlocked&&(A.hasError=!1,A.errorMessage=void 0,A.isStarting=!1)}catch(A){let y=this.MCPServersMap.get(g);y&&!y.isBlocked&&(y.hasError=!0,y.errorMessage=A instanceof Error?A.message:String(A),y.isStarting=!1),ur.warn(this.ctx,`Failed to restart MCP server ${g} after config update:`,A)}});await Promise.allSettled(m)}await this.updateServersList()}areServerConfigsEqual(r,n){return this.stableStringify(r)===this.stableStringify(n)}stableStringify(r){if(Array.isArray(r))return`[${r.map(n=>this.stableStringify(n)).join(",")}]`;if(r&&typeof r=="object"){let n=r;return`{${Object.keys(n).sort().map(s=>`${JSON.stringify(s)}:${this.stableStringify(n[s])}`).join(",")}}`}return JSON.stringify(r)??"undefined"}async upsertServerDefinition(r,n){let o=this.toManagedServerDefinition(r,n),s=this.MCPServersMap.get(r);if(this.isAllowlistFeatureEnabled()){let c=await this.registryService.validateServerConfig(r,n),{registryInfo:l,isBlocked:u,blockReason:d}=c;u?(this.addBlockedServer(o),ur.info(this.ctx,`MCP server ${r} is blocked: ${d}`)):s&&!s.isBlocked?await this.updateServerDefinition(s,o):await this.addServer(o),l&&this.updateRegistryInfo(r,l);return}s&&!s.isBlocked?await this.updateServerDefinition(s,o):await this.addServer(o)}toManagedServerDefinition(r,n){let o=n.type,s="command"in n?"stdio":o??"streamable";return{...n,name:r,type:s}}addBlockedServer(r){this.MCPServersMap.set(r.name,{server:null,definition:r,hasError:!1,errorMessage:void 0,isStarting:!1,isBlocked:!0,authInfo:void 0})}updateRegistryInfo(r,n){let o=this.MCPServersMap.get(r);o&&(o.registryInfo=n)}getAllContents(r){return this.isMcpEnabled?this.getAllMCPServerCapabilities(r):[]}getAllMCPServerCapabilities(r){let n=[];for(let[o,s]of this.MCPServersMap)try{let c=this.createServerSnapshot(o,s);n.push(c)}catch(c){let l=`Failed to create snapshot for MCP server ${o}.`+(c instanceof Error?` message: ${c.message}`:` ${String(c)}`);ur.error(this.ctx,l);let u={name:o,prefix:this.getServerPrefix(o),status:"error",tools:[],resources:[],resourceTemplates:[],prompts:[],error:l};n.push(u)}return r&&!r.isBuiltIn&&r.customTools?n.map(o=>(o.tools=o.tools.map(s=>{let c=this.createMcpLanguageModelTool(o.name,this.getServerPrefix(o.name),s);return s._status=r.customTools.includes(c.configurationKey)?"enabled":"disabled",s}),o)):n}async updateMCPToolsStatus(r,n){this.ensureMcpEnabledOrThrow("batch update tools status");for(let{serverName:o,toolName:s,status:c}of n){let d=this.getActiveServerEntry(o).server.getCachedTools().find(m=>m.name===s),f=this.getServerPrefix(o);if(!d){ur.error(this.ctx,`Not found MCP ${o} server ${s} tool`);continue}kwe(r)&&(d._status=c),this.ctx.get(vs).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(vs).updateToolsStatus(r,n.map(({serverName:o,toolName:s,status:c})=>({toolId:`${o}.${s}`,status:c}))),this.persistAllServersCache()}async callTool(r,n,o,s,c,l,u){this.ensureMcpEnabledOrThrow(`call tool ${r}.${n}`);let d=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,d,"tool call")).callTool(n,o,s,c,l,u)}async getPrompt(r,n,o){this.ensureMcpEnabledOrThrow(`get prompt ${r}.${n}`);let s=this.getActiveServerEntry(r),l=await(await this.ensureServerConnection(r,s,"get prompt")).getPrompt(n,o);return ft(this.ctx,"mcp.getPrompt",Vt.createAndMarkAsIssued()),sr(this.ctx,"mcp.getPrompt"),l}async completePrompt(r,n,o,s,c){this.ensureMcpEnabledOrThrow(`complete prompt ${r}.${n}`);let l=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,l,"complete prompt")).completePrompt(n,o,s,c)}async readResource(r,n){this.ensureMcpEnabledOrThrow(`read resource from ${r}: ${n}`);let o=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,o,"read resource")).readResource(n)}async startMCPServer(r){return this.ensureMcpEnabledOrThrow(`start server ${r}`),this.serverOperationSequencer.queue(r,async()=>{await this.startMCPServerInternal(r)})}async startMCPServerInternal(r){let n=this.getActiveServerEntry(r);if(n.server.isConnected){ur.info(this.ctx,`MCP server ${r} is already running`);return}if(n.isStarting){ur.info(this.ctx,`MCP server ${r} is already starting, skipping duplicate request`);return}n.isStarting=!0,await la(this.ctx,{message:`Starting server ${r}`,server:r}),await this.updateServersList(!1),this.unregisterServerTools(r);try{await this.startServer(r);let o=this.MCPServersMap.get(r);o&&(o.hasError=!1,o.errorMessage=void 0,o.isStarting=!1)}catch(o){let s=this.MCPServersMap.get(r);throw s&&(s.hasError=!0,s.errorMessage=o instanceof Error?o.message:String(o),s.isStarting=!1),o}finally{this.registerServerTools(r),await this.updateServersList(!1)}}async stopMCPServer(r){return this.serverOperationSequencer.queue(r,async()=>{await this.stopMCPServerInternal(r)})}async stopMCPServerInternal(r){let n=this.getActiveServerEntry(r);if(n.isStarting){ur.info(this.ctx,`MCP server ${r} is starting, cannot stop now`);return}await la(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners(DW),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await la(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await la(this.ctx,{message:`Restarting server ${r}`,server:r}),this.serverOperationSequencer.queue(r,async()=>{await this.stopMCPServerInternal(r),await new Promise(n=>setTimeout(n,100)),await this.startMCPServerInternal(r)})}async logoutMCPServer(r){return this.ensureMcpEnabledOrThrow(`logout server ${r}`),this.serverOperationSequencer.queue(r,async()=>{await la(this.ctx,{message:`Logging out MCP server ${r}`,server:r}),await this.performLogout(r)})}async clearOAuthMCPServer(r){return this.ensureMcpEnabledOrThrow(`clear OAuth for server ${r}`),this.serverOperationSequencer.queue(r,async()=>{let o=this.getActiveServerEntry(r).authInfo?.providerId;if(!o){ur.warn(this.ctx,`No OAuth provider found for server ${r}, nothing to clear`);return}await la(this.ctx,{message:`Clearing OAuth provider registration for MCP server ${r}`,server:r}),await this.performLogout(r),ur.info(this.ctx,`Unregistering provider ${o} for server ${r}`);try{await this.ctx.get(xM).unregisterProvider(o)}catch{ur.debug(this.ctx,`Provider ${o} is not a dynamic OAuth provider, skipping unregistration`)}})}async performLogout(r){let n=this.getActiveServerEntry(r);if(n.authInfo){let{providerId:c,accountName:l}=n.authInfo;ur.info(this.ctx,`Removing account preference and session for account ${l} on server ${r} with provider ${c}`),this.ctx.get(Jb).removeAccountPreference(r,c);try{let u=this.ctx.get(xm).getProvider(c),f=(await u.getSessions(void 0,{})).find(h=>h.account.label===l);f?(await u.removeSession(f.id),ur.info(this.ctx,`Successfully removed session for account ${l}`)):ur.warn(this.ctx,`No session found for account ${l}`)}catch(u){ur.error(this.ctx,`Failed to remove session for account ${l}:`,u)}n.authInfo=void 0}await this.stopMCPServerInternal(r);let o=this.storedMCPServersConfig[r];if(!o){let c=`Original config not found for server ${r}`;throw ur.error(this.ctx,c),new Error(c)}let s=this.toManagedServerDefinition(r,o);this.MCPServersMap.delete(r),await this.addServer(s),ur.info(this.ctx,`Server ${r} logged out and restored to original configuration`),await this.updateServersList(!1)}async startServer(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;if(n.server.isConnected){ur.info(this.ctx,`MCP server ${r} is already running`);return}let{server:o,definition:s}=n;try{o.getEmitter().on(DW,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await la(this.ctx,{message:"Connection state: Running",server:r})}catch(c){ur.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof xR||c instanceof IMe,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof p9e&&u!==401&&u>=400&&u<500){let f=`${u} status sending message to ${s.url}, will attempt to fall back to legacy SSE`;ur.info(this.ctx,f),la(this.ctx,{message:f,server:r});let h={...s,name:r,type:"sse"};return await o.cleanup().catch(()=>{}),await this.updateServerDefinition(n,h),await this.startServer(r)}else if(l&&"url"in s&&u===401){let f=await this.getAuthMetadata(s),h=await this.getToken(s.name,s.url,f.authorizationServer,f.serverMetadata,f.resourceMetadata);if(!h){let g=`Failed to get token for server: ${r}`;throw ur.error(this.ctx,g),new Error(g)}let m={...s,name:r,requestInit:{...s.requestInit??{},headers:{...s.requestInit?.headers??{},Authorization:`Bearer ${h}`}}};return await o.cleanup().catch(()=>{}),await this.updateServerDefinition(n,m),await this.startServer(r)}let d=c instanceof Error?`message: ${c.message} stack: ${c.stack}`:String(c);throw await Sd(this.ctx,{message:d,server:r}),this.ctx.get(ss).showWarningMessageOnlyOnce(`${r}.initialize`,`Failed to initialize MCP server '${r}'. Please check the logs for more details.`),c}}async updateServersList(r=!0){return this.updateServersQueue=this.updateServersQueue.then(async()=>{r&&this.registerTools(),await this.notifyClient()}).catch(n=>{ur.error(this.ctx,"updateServersList: Update failed",n)}),this.updateServersQueue}getServerPrefix(r){let n=this.serverPrefixes.get(r);if(n)return n;let o=this.prefixGenerator.generate(r);return this.serverPrefixes.set(r,o),o}async persistAllServersCache(){try{let r={};for(let[n,o]of this.MCPServersMap){let s=o.server?.getCachedTools()??[],c=o.server?.getCachedResources()??[],l=o.server?.getCachedResourceTemplates()??[],u=o.server?.getCachedPrompts()??[];r[n]={tools:s,resources:c,resourceTemplates:l,prompts:u}}await this.cache.store(r)}catch(r){ur.error(this.ctx,"Failed to persist MCP servers cache:",r)}}createMCPServer(r){return r.type==="sse"?new U2t(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new p9e(this.ctx,r.name,r.version||"1.0.0"):new Q2t(this.ctx,r.name,r.version||"1.0.0")}async addServer(r){let n=this.createMCPServer(r),o=await this.cache.get(r.name);o&&n.restoreCacheFromPersistence(o),this.MCPServersMap.set(r.name,{server:n,definition:r,hasError:!1,errorMessage:void 0,isStarting:!1,isBlocked:!1})}async updateServerDefinition(r,n){let o=this.createMCPServer(n),s=await this.cache.get(n.name);s&&o.restoreCacheFromPersistence(s),r.server=o,r.definition=n}async notifyClient(){let r=this.getAllContents();await this.ctx.get(er).connection.sendNotification(t.contentsNotificationType,{servers:r})}registerTools(){for(let[r]of this.MCPServersMap)this.registerServerTools(r)}registerServerTools(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;let o=this.getServerPrefix(r),s=n.server?.getCachedTools()??[];for(let c of s)this.registerTool(r,o,c)}unregisterServerTools(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;let o=n.server?.getCachedTools()??[];for(let s of o)this.unregisterTool(r,s.name)}registerTool(r,n,o){ur.debug(this.ctx,"register MCP Tool:",{...o}),this.ctx.get(vs).registerTool(this.createMcpLanguageModelTool(r,n,o))}createMcpLanguageModelTool(r,n,o){let{name:s,description:c,inputSchema:l,_status:u,_nameForModel:d,annotations:f}=o;return new q2t({serverName:r,serverNamePrefix:n,name:d,displayName:s,description:c||"",displayDescription:c||"",inputSchema:l,annotations:f,status:u},(h,m,g,A)=>(ur.info(this.ctx,"copilot MCP Invoker:",r,s,g),this.callTool(r,s,g,A,h,m.roundId,m.toolCallId?.toString())))}unregisterAllTools(){for(let[r,n]of this.MCPServersMap){if(n.isBlocked)continue;let o=n.server?.getCachedTools()??[];for(let s of o)this.unregisterTool(r,s.name)}}unregisterTool(r,n){ur.debug(this.ctx,"unregister MCP Tool:",{serverName:r,toolName:n}),this.ctx.get(vs).unregisterTool(`${r}.${n}`)}async clearAllServers(){this.unregisterAllTools();for(let r of this.MCPServersMap.keys())if(!this.MCPServersMap.get(r).isBlocked)try{await this.stopMCPServer(r)}catch(o){ur.error(this.ctx,`Error stopping server ${r} during clearAllServers:`,o)}this.MCPServersMap.clear(),this.serverPrefixes.clear()}determineServerStatus(r){return r.isBlocked?"blocked":r.isStarting?"starting":r.server.isConnected?"running":r.hasError?"error":"stopped"}createServerSnapshot(r,n){return{name:r,prefix:this.getServerPrefix(r),status:this.determineServerStatus(n),tools:n.server?.getCachedTools()??[],resources:n.server?.getCachedResources()??[],resourceTemplates:n.server?.getCachedResourceTemplates()??[],prompts:n.server?.getCachedPrompts()??[],error:n.isBlocked?void 0:n.errorMessage,registryInfo:n.registryInfo,authInfo:n.isBlocked?void 0:n.authInfo}}updateAuthInfo(r,n,o,s){let c=this.MCPServersMap.get(r);c&&!c.isBlocked&&(c.authInfo={providerId:n,accountName:o,isDynamic:s})}removeServerAccountPreferences(r){let n=this.MCPServersMap.get(r);if(n?.isBlocked||!n?.authInfo){ur.debug(this.ctx,`No auth info found for server ${r}, nothing to remove`);return}let{providerId:o}=n.authInfo;ur.info(this.ctx,`Removing account preference for server ${r} with provider ${o}`),this.ctx.get(Jb).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new sge(this.ctx).getMetadataFromOriginalUrl(r.url,r.requestInit?.headers)}catch(n){throw ur.error(this.ctx,`Failed to get auth metadata for ${r.url}: ${n instanceof Error?n.message:String(n)}`,n),n}}async getToken(r,n,o,s,c){let l=this.ctx.get(xm).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(xm).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(xm).createDynamicAuthenticationProvider(o,s,c),!A)){ur.warn(this.ctx,`Failed to create authentication provider for server ${r} (authServer: ${o})`);return}l=A.id}let u=c?.scopes_supported||s.scopes_supported||[],d=await this.ctx.get(xm).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(Jb).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(xm).getProvider(l),g=!!this.ctx.get(vC).getClientRegistration(l);if(d.length){if(h)return this.updateAuthInfo(r,l,h.account.label,g),h.accessToken;try{let A=m?.label||l,y="Sign in to another account",_=d.map(v=>({title:v.account.label}));_.push({title:y}),_.push({title:"Cancel"});let E=await this.ctx.get(ss).showInformationModal(`The MCP server ${r} wants to access a ${A} account, Select an account for ${r} to use`,..._);if(!E||E.title==="Cancel"){ur.warn(this.ctx,"user cancelled the account selection");return}if(E.title!==y){let v=d.find(S=>S.account.label===E.title);if(!v){ur.warn(this.ctx,"selected account not found in sessions");return}return this.ctx.get(Jb).updateAccountPreference(r,l,v.account),this.updateAuthInfo(r,l,v.account.label,g),v.accessToken}}catch(A){ur.error(this.ctx,"Failed during account selection:",A);return}}else try{if((await this.ctx.get(ss).showInformationModal(`The MCP Server Definition '${n}' wants to authenticate to ${m.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){ur.warn(this.ctx,"user cancelled the authentication request");return}}catch(A){ur.error(this.ctx,"Failed to show authentication request dialog:",A);return}try{let A=await m.createSession(u,{});return this.ctx.get(ss).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(Jb).updateAccountPreference(r,l,A.account),this.updateAuthInfo(r,l,A.account.label,g),A.accessToken}catch(A){ur.error(this.ctx,`Failed to create authentication session for server ${r}:`,A),this.ctx.get(ss).showWarningMessageOnlyOnce("Authentication failed",`You need to restart the IDE to authenticate the MCP server again. ${A instanceof Error?A.message:String(A)}`);return}}};p();var Jho=fe(Wc());var G2t=class t extends hD{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new Jho.ProtocolNotificationType("copilot/mcpRuntimeLogs")}constructor(e){super(),this.ctx=e}async notifyLog(e){await this.ctx.get(er).connection.sendNotification(t.notificationType,{...e,time:Date.now()})}};p();var Zho=fe(Wc());var whl=new Zho.ProtocolRequestType("copilot/readMcpSamplingConfig"),$2t=class extends mz{constructor(r){super();this.ctx=r}static{a(this,"CopilotMcpSamplingConfigSender")}async readMcpSamplingConfig(r){let n=this.ctx.get(er).connection,o;try{o=await n.sendRequest(whl,r)}catch(l){throw new Error(`Request copilot/readMcpSamplingConfig failed with message: ${ld(l)}`)}let[s,c]=o;if(c)throw new Error(`Request copilot/readMcpSamplingConfig failed with code: ${c.code}, message: ${c.message}`);return s}};p();var W2t=fe(Wc());var Rhl=new W2t.ProtocolRequestType("copilot/showPanelMessageRequest"),khl=new W2t.ProtocolNotificationType("copilot/showPanelMessage"),V2t=class extends Obe{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(er).connection.sendNotification(khl,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(er).connection,o;try{o=await n.sendRequest(Rhl,r)}catch(l){throw new Error(`Request copilot/showPanelMessageRequest failed with message: ${ld(l)}`)}let[s,c]=o;if(c)throw new Error(`Request copilot/showPanelMessageRequest failed with code: ${c.code}, message: ${c.message}`);return s}};p();p();var emo=require("node:stream"),cse=fe(Sfr());var F9=new pe("UndiciFetcher"),Y2t=class extends Jt{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(As).getVersion()}`,this.certificateConfigurator=new hCe(r),this.proxySocketFactory=r.get(Uk),this.settings=r.get(Qo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),F9.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(Qo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),F9.info(this.ctx,"HTTP settings changed; resetting Undici dispatchers.",this.getSettingsLogProperties()),this.resetDispatchers()})}static{a(this,"UndiciFetcher")}async fetch(r,n){let o={...n.headers??{}};o["User-Agent"]=this.userAgent;let s=n.body;if(n.json!==void 0){if(n.body!==void 0)throw new Error("Illegal arguments! Cannot pass in both 'body' and 'json'!");o["Content-Type"]="application/json",s=JSON.stringify(n.json)}let c=n.method??"GET";if(c!=="GET"&&c!=="POST"&&c!=="DELETE")throw new Error("Illegal arguments! 'method' must be 'GET', 'POST', or 'DELETE'!");let l=!1,u,d=Nhl(n.signal),f=d.signal;if(n.timeout){let h=new AbortController;u=setTimeout(()=>{l=!0,h.abort()},n.timeout),f=f?AbortSignal.any([f,h.signal]):h.signal}try{let h={method:c,headers:o,body:s,signal:f};F9.debug(this.ctx,"Starting Undici fetch.",{target:z2t(r),method:c,hasBody:s!==void 0,hasTimeout:n.timeout!==void 0,hasSignal:f!==void 0});let{dispatcher:m,isProxy:g}=await this.getDispatcher(r),A=await(0,cse.fetch)(r,{...h,dispatcher:m});return F9.debug(this.ctx,"Undici fetch completed.",{target:z2t(r),status:A.status,isProxy:g}),new kx(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?emo.Readable.fromWeb(A.body):null)}catch(h){throw l?(F9.warn(this.ctx,"Undici fetch timed out.",{target:z2t(r),timeout:n.timeout}),new Fz(`Request to <${r}> timed out after ${n.timeout}ms`,h)):Mhl(h)}finally{u&&clearTimeout(u),d.cleanup()}}async disconnectAll(){await this.resetDispatchers()}async getDispatcher(r){let n=await this.certificateConfigurator.getCertificates(),o=n?n.join("\0"):"";this.dispatcherCertsKey!==o&&(F9.info(this.ctx,"Root certificate set changed; resetting Undici dispatchers.",{certificateCount:n?.length??0}),await this.resetDispatchers()),this.dispatcherCertsKey=o;let s={allowH2:!0,ca:n,rejectUnauthorized:this.settings.proxyStrictSSL??!0};return!this.settings.proxy||this.shouldBypassProxy(r)?(this.noProxyAgent||(F9.debug(this.ctx,"Creating direct Undici agent.",{target:z2t(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new cse.Agent({allowH2:!0,connect:s})),{dispatcher:this.noProxyAgent,isProxy:!1}):(this.proxyAgent||(this.proxyAgent=this.buildProxyAgent(s)),{dispatcher:this.proxyAgent,isProxy:!0})}buildProxyAgent(r){let n=this.settings.proxy,o=new URL(n),s=(0,cse.buildConnector)(r);return F9.debug(this.ctx,"Creating proxied Undici agent.",{proxy:Xho(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new cse.Agent({allowH2:!0,connect:a((c,l)=>{let u=c.port!==void 0&&c.port!==""?Number(c.port):c.protocol==="https:"?443:80,d={hostname:c.hostname,port:u,headers:{}};this.proxySocketFactory.createSocket(d,{hostname:o.hostname,port:o.port,authorization:this.settings.proxyAuthorization,kerberosServicePrincipal:this.settings.proxyKerberosServicePrincipal}).then(f=>{if(c.protocol!=="https:"){l(null,f);return}s({...c,httpSocket:f},l)}).catch(f=>{l(f instanceof Error?f:new Error(String(f)),null)})},"connect")})}async resetDispatchers(){let r=this.noProxyAgent,n=this.proxyAgent;this.noProxyAgent=void 0,this.proxyAgent=void 0,this.dispatcherCertsKey=void 0,(r||n)&&F9.debug(this.ctx,"Closing Undici dispatchers.",{hasDirectAgent:!!r,hasProxyAgent:!!n}),await Promise.all([r?.close().catch(()=>{}),n?.close().catch(()=>{})])}updateNoProxyFilters(r){let n=(r??[]).map(s=>s.trim()).filter(s=>s.length>0);if(this.noProxyFilters=void 0,n.length===0)return;if(n.includes("*")){this.noProxyFilters=[{regex:/.*/i}];return}let o=[];for(let s of n){let{host:c,port:l}=Phl(s),u=Dhl(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:Xho(this.settings.proxy),noProxyCount:this.settings.noProxy?.length??0,proxyStrictSSL:this.settings.proxyStrictSSL,hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal}}shouldBypassProxy(r){if(!this.noProxyFilters?.length)return!1;let n;try{n=new URL(r)}catch{return!1}let o=n.hostname;if(!o)return!1;let s=n.port||(n.protocol==="https:"?"443":"80"),c=o.toLowerCase();return this.noProxyFilters.some(l=>l.regex.test(c)&&(!l.port||l.port===s))}};function Phl(t){if(t.startsWith("[")){let r=t.indexOf("]");if(r!==-1){let n=t.slice(1,r),o=t.slice(r+1);return{host:n,port:o.startsWith(":")?o.slice(1):void 0}}}let e=t.split(":");return e.length===2?{host:e[0],port:e[1]}:{host:t}}a(Phl,"splitHostPort");function Dhl(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a(Dhl,"compileHostPattern");function z2t(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(z2t,"describeUrl");function Xho(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(Xho,"describeProxy");function Nhl(t){if(!t||t instanceof AbortSignal)return{signal:t,cleanup:a(()=>{},"cleanup")};let e=new AbortController,r=a(()=>e.abort(),"abort");return t.addEventListener("abort",r),t.aborted&&e.abort(),{signal:e.signal,cleanup:a(()=>t.removeEventListener("abort",r),"cleanup")}}a(Nhl,"toNativeAbortSignal");function Mhl(t){if(!(t instanceof Error)||!("cause"in t)||!t.cause||typeof t.cause!="object")return t;let e=t.cause,r=new Error(t.message,{cause:t.cause});r.stack=t.stack,r.name=t.name,r.code=t.code??e.code,r.syscall=t.syscall??e.syscall,r.errno=t.errno??e.errno;let n=e.statusCode;return typeof n=="number"&&(r.statusCode=n),r}a(Mhl,"withCauseNetworkProperties");p();var h9e=new pe("fetcher"),Ohl="https://default.exp-tas.com/",m9e=class extends Jt{constructor(r,n,o,s){super();this.ctx=r;this.defaultFetcher=n;this.fallbackFetcher=o;this.onFallbackSuccess=s}static{a(this,"FallbackFetcher")}async fetch(r,n){try{return await this.defaultFetcher.fetch(r,n)}catch(o){if(ng(o)||`${r}/`.startsWith(Ohl))throw o;h9e.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),h9e.info(this.ctx,`Fallback fetch for <${r}> succeeded.`),s}}getImplementation(){return this.defaultFetcher.getImplementation()}get name(){return this.defaultFetcher.name}async disconnectAll(){await this.defaultFetcher.disconnectAll()}},K2t=class extends Jt{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new m9e(r,n,o,(s,c)=>{this.current!==o&&(h9e.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,Hs(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:Bhl(c),...Fhl(s),...Uhl(r)}),n.disconnectAll().catch(l=>{h9e.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(h9e.info(this.ctx,`Re-arming sticky fallback; ${this.primary.name} will be retried on the next request.`),this.current=this.default)}get name(){return this.current.name}getImplementation(){return this.current.getImplementation()}fetch(r,n){return this.current.fetch(r,n)}async disconnectAll(){await Promise.all([this.primary.disconnectAll(),this.secondary.disconnectAll()])}},Lhl=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function Bhl(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return Lhl.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(Bhl,"describeHost");function Fhl(t){try{if(!(t instanceof Error)||!t.cause)return{};let e=t.cause;Array.isArray(e.errors)&&e.errors.length>0&&e.errors[0]instanceof Error&&(e=e.errors[0]);let r={};for(let[n,o]of Object.entries({errorCauseName:e.name,errorCauseCode:e.code,errorCauseSyscall:e.syscall}))typeof o=="string"&&o&&(r[n]=o.slice(0,100));return typeof e.statusCode=="number"&&(r.errorCauseStatusCode=String(e.statusCode)),r}catch{return{}}}a(Fhl,"buildErrorCauseProperties");function Uhl(t){try{let e=t.get(Qo).getHttpSettings(),r=!!e.proxy,n="none";return r&&(n=e.proxyKerberosServicePrincipal?"kerberos":e.proxyAuthorization?"basic":"none"),{proxyConfigured:r?"true":"false",proxyAuth:n,proxyStrictSSL:e.proxyStrictSSL!==!1?"true":"false"}}catch{return{}}}a(Uhl,"describeHttpContext");var tmo=new pe("fetcher");function Qhl(t){return kt(t,ze.UseHelixFetcher)==="true"}a(Qhl,"isHelixFetcherForced");function qhl(t){if(Qhl(t))return new Doe(t);let e=new K2t(t,new Y2t(t),new Doe(t));return t.get(Qo).onDidChangeHttpSettings(()=>e.reset()),e}a(qhl,"createDefaultFetcher");var J2t=class extends Jt{constructor(r,n=qhl(r),o=new fCe(r)){super();this.ctx=r;this.defaultFetcher=n;this.editorFetcher=o;this.updateFetcher=a(()=>{let r,n;if(!this.editorFetcherCapability)n=`Using ${this.defaultFetcher.name}, editor does not have fetch capability.`,r=this.defaultFetcher;else if(this.fetchStrategy==="client")n="Using editor fetcher, fetch strategy set to client.",r=this.editorFetcher;else if(this.fetchStrategy==="native")n=`Using ${this.defaultFetcher.name}, fetch strategy set to native.`,r=this.defaultFetcher;else{let o=kt(this.ctx,ze.DebugUseEditorFetcher);o?.toString()==="true"?(n="Using editor fetcher, debug flag is enabled.",r=this.editorFetcher):o?.toString()==="false"?(n=`Using ${this.defaultFetcher.name}, debug flag is disabled.`,r=this.defaultFetcher):(n="Editor fetcher capability available, will fallback if needed.",r=this.fallbackFetcher)}this.currentFetcher!=r&&(tmo.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new m9e(r,n,o,()=>{tmo.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(Nn).onDidSetCapabilities(this.updateFetcher),r.get(Qo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return kt(this.ctx,ze.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(Nn).getCapabilities().fetch??!1}getImplementation(){return this.currentFetcher.getImplementation()}get name(){return this.currentFetcher.name}fetch(r,n){return this.currentFetcher.fetch(r,n)}async disconnectAll(){await Promise.all([this.defaultFetcher.disconnectAll(),this.editorFetcher.disconnectAll()])}};p();var X2t=fe(ii());var Z2t=class extends ss{constructor(r){super();this.ctx=r}static{a(this,"ConnectionNotificationSender")}get connection(){return this.ctx.get(er).connection}showWarningMessage(r,...n){return this.connection.window.showWarningMessage(r,...n)}showInformationMessage(r,...n){return this.connection.window.showInformationMessage(r,...n)}showInformationModal(r,...n){return this.connection.sendRequest(X2t.ShowMessageRequest.type,{type:X2t.MessageType.Info,message:r,actions:n,modal:!0}).then(o=>o||void 0)}async sendBackgroundAgentSessionUpdate(r,n,o,s){await this.connection.sendNotification("backgroundAgent/sessionUpdate",{sessionId:r,event:n,agentProvider:o,turnIndex:s})}async sendBackgroundAgentTodosChanged(r){await this.connection.sendNotification("backgroundAgent/todosChanged",r)}};p();var rmo=fe(Wc());var eDt=class t extends vJ{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new rmo.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(er).connection.sendNotification(t.notificationType,r)}};p();var nmo=fe(Wc());var tDt=class t extends Uq{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new nmo.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(er).connection.sendNotification(t.notificationType,r)}};p();var imo=fe(Wc());var jhl=new imo.ProtocolNotificationType("$/copilot/rateLimitWarning"),rDt=class extends pT{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(er).connection.sendNotification(jhl,r)}};p();p();var nDt=class extends EKe{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get(eM).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get(eM).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get(eM);this._watcher=e.onDidChangeWatchedFiles(this.onDidChangeWatchedFilesHandler.bind(this)),this.status="ready"}stopWatching(){this.status="stopped",this._watcher?.dispose(),this._watcher=void 0}onDidChangeWatchedFilesHandler(e){if(e.workspaceFolder.uri!==this.workspaceFolder.uri)return;let n=e.created.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);if(n.length){let c=n.map(l=>l.document).filter(l=>l!==void 0);this.emitFilesCreated(c)}let o=e.changed.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);if(o.length){let c=o.map(l=>l.document).filter(l=>l!==void 0);this.emitFilesUpdated(c)}let s=e.deleted.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);s.length&&this.emitFilesDeleted(s.map(c=>({uri:c.uri})))}};var iDt=class extends vw{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new nDt(this.ctx,e)}shouldStartWatching(e){return XE(this.ctx)?!!this.ctx.get(Nn).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped"):!1}};function oDt(t){let e=new Ib(process.env),r=vpo(e);r.set(Ib,e),r.set(Jt,new J2t(r)),r.set(mc,new mc(r)),l9r(r,{});let n=Csn();r.set(Un,n),r.set(CA,new CA(r));let o=new m2t;r.set($h,o);let s=smo.join(n.directory,E$r),c=tF.plaintextOnly();r.set(tF,c);let{repo:l,diagnostics:u}=t0n(r,s,c);r.set(QM,l),r.set(Fr,new aGe(r,process.env)),r.set(pI,new pI(r)),r.set(Ioe,new Ioe(r));let d=new op(r,"agent");d.onInitialized(()=>n0n(r,u)),r.set(op,d),r.set(za,hno),r.set(fx,new fx),r.set(Ir,new Jj),r.set(Noe,nno()),r.set(Fu,new Fu),r.set(Go,Dho),r.set(ga,new l2t(r)),r.set(ete,new d2t(r)),r.set(vw,new iDt(r)),r.set(eM,new eM(r)),r.set(Rm,new Rm),r.set(km,fft(r,vXi)),r.set(eS,new eS(r)),r.set(O4,new Sge),uho(r),vKe(r),i0n(r),r.set(er,new er(r,t));let f=new ay([aho(r)]);r.set(ay,f),r.set(s9e,new s9e(r)),r.get(er).onDeactivation(()=>f.dispose()),r.set(u5,new u2t(r)),r.set(ss,new Z2t(r)),r0n(r,u),r.set(Obe,new V2t(r)),r.set(mz,new $2t(r)),r.set(og,new nCe(r)),r.set(ks,new R2t(r));let h=new o9e(r,t);r.set(o9e,h),r.set(eu,h),r.set(i9e,new i9e(r)),r.set(r9e,new r9e(r)),r.set(up,new up);let m=new jW(r);r.set($r,m),r.set(jW,m),r.set(ig,new ACe(r,process.env)),r.set(sP,new yse),r.set(pc,new pc(r)),Tho(r),Zpo(r),r.set(sM,new sM),r.set(MW,new MW),r.set(cM,new cM),r.set(OW,new OW([])),r.set(fI,new g2t),r.set(omo.ObservableWorkspace,new AW(r,!0,!0)),r.set(z4,new _Ce),r.set(t9,new t9),r.set(fC,new fC(r)),r.set(Ay,new eIt(r)),r.set(tv,new w2t(r)),r.set(Xd,new x2t(r)),r.set(qw,new qw(r)),r.set(vs,new vs(r)),r.set(e8,new e8(r)),r.set(r8,new r8(r)),r.set(wT,new wT(r)),r.set(pZ,new pZ(r)),r.set(O5,new O5),r.set(xg,new xg),r.set(lM,new lM(r)),r.set(CE,new H2t(r)),r.set(hD,new G2t(r)),r.set(YF,new YF(r)),r.set(Jb,new D2t(r));let g=new bG(r);r.set(bG,g);let A=new gy(r,g,new P2t(r));r.set(gy,A),r.set(yR,new yR(g,A)),r.set(Jie,Szi(r)),r.set(pT,new rDt(r)),r.set(dee,new dee),r.set(Soe,new Soe),r.set(xm,new h2t(r)),r.set(vC,new f2t(r)),r.set(xM,new xM(r));let y=new QA(r);r.set(QA,y),r.set(Mf,new Mf(r,y)),r.set(P0,new P0(r,y)),r.set(Yd,new Yd(r,y)),r.set(Ig,new Ig(r,e,y));let _=new aF(r,y,n);r.set(aF,_),r.get(dT).addListener(_.lifecycleListener);let E=new XUe;r.set(XUe,E),r.set(_g,new Ywt(r)),r.set(y0,new y0(r,E)),r.set(Hw,new Hw),r.set(kT,new kT(r)),r.set(Lj,new Lj(r)),r.set(kw,new f5([new p5,new h5])),r.set(boe,new boe(r)),r.set(ov,new ov(r)),r.set(Uq,new tDt(r)),r.set(vJ,new eDt(r)),r.set(cI,new cI(r)),r.set(Ys,new Ys(r));let v=new Ca(r);r.set(Ca,v),r.set(wm,new wm),r.set(Bee,new Bee(r)),r.set(t6,new t6(r,new UPt)),r.set(roe,new roe(r)),r.set(eoe,new eoe(r)),r.set(Va,new Va(r)),r.set(i5,new k2t(r)),r.set(oM,new oM(r)),r.set(Lk,new Lk(r.get(oM),r)),r.set(T5,new T5(r)),r.set(KI,new A2t(r)),r.set(Cb,new Cb(r.get(Lk),r.get(KI),r)),r.set(D0,new D0(r));let S=new J8(r,v);return r.set(J8,S),r.set(Moe,new Moe(r,v)),r.get(er).onActivation(()=>{S.ensureInitialSync()}),r}a(oDt,"createLanguageServerContext");var wM=new pe("ACP");async function amo(t){let e=t.get(As);wM.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(Ib).markReady(),t.get(ih).githubAppId=$ce,$hl(t),Ghl(t),t.get(Nn).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Qt).primeToken()?wM.info(t,"Token primed successfully"):wM.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(op).initialize(!0),FEn()?await Hhl(t):(Vu(t,"acp.server.start",{acpPipeline:"internal"}),await cmo(t))}a(amo,"startACPServer");async function cmo(t){wM.info(t,"Starting ACP server with internal pipeline");let e=Fbe.Writable.toWeb(process.stdout),r=Fbe.Readable.toWeb(process.stdin),n=_Pe(e,r),o=new EPe(s=>new rRt(s,t),n);o.signal.addEventListener("abort",()=>{wM.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(cmo,"startACPServerInternal");async function Hhl(t){wM.info(t,"Starting ACP server with CLI proxy"),Vu(t,"acp.cli.discover");let e;try{e=await UEn()}catch(u){let d=u instanceof Error?u.message:String(u);wM.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),bCe(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await cmo(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;wM.info(t,`Found Copilot CLI: ${r} v${e.version}`),Vu(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new nRt(e,t),o=Fbe.Writable.toWeb(process.stdout),s=Fbe.Readable.toWeb(process.stdin),c=_Pe(o,s),l=new EPe(u=>new oRt(u,t,n),c);l.signal.addEventListener("abort",()=>{wM.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a(Hhl,"startACPServerWithCLI");function Ghl(t){let e=t.get(vs);e.registerTool(new Bj({name:"create_file",description:"Create a new file in the workspace with the specified content.",inputSchema:b.Object({filePath:b.String({description:"The absolute path of the file to create."}),content:b.String({description:"The content to write to the new file."})})})),e.registerTool(new Bj({name:"insert_edit_into_file",description:"Edit an existing file by inserting, replacing, or deleting content.",inputSchema:b.Object({filePath:b.String({description:"The absolute path of the file to edit."}),content:b.Optional(b.String({description:"The new content for the file."})),edits:b.Optional(b.Array(b.Object({startLine:b.Number({description:"The starting line number (1-based)."}),endLine:b.Number({description:"The ending line number (1-based)."}),newContent:b.String({description:"The new content to replace the range with."})})))})})),e.registerTool(new Bj({name:"replace_string_in_file",description:"Replace a specific string in a file with a new string.",inputSchema:b.Object({filePath:b.String({description:"The absolute path of the file to edit."}),oldString:b.String({description:"The string to find and replace."}),newString:b.String({description:"The string to replace it with."})})})),wM.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(Ghl,"registerACPClientTools");function lmo(){let e=oDt({onRequest:a(()=>{},"onRequest"),onNotification:a(()=>{},"onNotification"),listen:a(()=>{},"listen"),sendNotification:a(()=>{},"sendNotification"),sendRequest:a(()=>Promise.resolve({}),"sendRequest"),workspace:{onDidChangeWorkspaceFolders:a(()=>{},"onDidChangeWorkspaceFolders")},client:{register:a(()=>Promise.resolve({}),"register")},console:{log:a(()=>{},"log"),info:a(()=>{},"info"),warn:a(()=>{},"warn"),error:a(()=>{},"error")},window:{showWarningMessage:a(()=>Promise.resolve(void 0),"showWarningMessage"),showInformationMessage:a(()=>Promise.resolve(void 0),"showInformationMessage")}}),r=new HW(e);return e.forceSet(tv,r),{ctx:e,acpToolInvoker:r}}a(lmo,"createACPContext");function $hl(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(wM.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),eqe(t,r))}a($hl,"configureGitHubEnterpriseUrl");p();var $Gr=require("events"),g9e=fe(require("fs"));sWe();var aDt=fe(Wc());p();var dmo=fe(require("fs")),fmo=fe(require("http")),Ube=fe(require("path"));var sDt=class{constructor(e,r){this.port=e;let n;this.server=fmo.createServer((o,s)=>{if(o.headers.accept&&o.headers.accept=="text/event-stream")switch(s.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),o.url){case"/stdin":r.on("read",l=>{umo(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{umo(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;Ube.basename(__dirname)!=="debug"&&(c=Ube.dirname(__dirname)),n??=dmo.readFileSync(Ube.join(c,"dist","debugServer.html")).toString(),s.write(n),s.end()}),this.server.on("error",o=>{console.error(o)})}static{a(this,"DebugServer")}listen(){return this.server.listen(this.port),this}getPort(){return this.server.address().port}};function umo(t,e){t.write("data: "+e.toString().replace(/\n/g,` +\`\`\``}},T2t="runtime-logs",S2t=class extends I0{static{a(this,"RuntimeLogsSkill")}constructor(e){super(T2t,"The application runtime or debug logs, which are used to view output logs from the console. This is useful for debugging and troubleshooting runtime issues.","Reading runtime logs",()=>e,r=>new UGr(r))}};p();var I2t=fe(s2());var x2t=class extends dm{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return P7e(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(er).connection}async inspectPrompt(r){return this.connection?.sendNotification(new I2t.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new I2t.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new I2t.NotificationType("conversation/documentDiff"),r)}};p();var Iho=fe(Wc());var n9e=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(Bk).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(er).connection.sendNotification(new Iho.NotificationType(this.notificationEndpoint),e)}};function xho(t){vhl(t),Chl(t),Cho(t)}a(xho,"activateConversationFeature");function vhl(t){t.set(Xo,new Xo(t)),t.set(x0,new x0),t.set(jA,new jA(t)),t.set(dl,new JKe(t)),t.set(b9,new b9),t.set(Bc,new Bc(t)),t.set(Bk,new Bk(t)),t.set(n9e,new n9e(t)),t.set(Ns,new _We(t,new yWe(t))),t.set(aM,new aM),t.set(dm,new x2t(t)),t.set(R2,new R2(t))}a(vhl,"registerContextDependencies");function Chl(t){let e=new fm;e.registerSkill(new att(new stt)),e.registerSkill(new NZe(new hC(t,l5,EIn))),e.registerSkill(new vZe(new hC(t,E2,mIn))),e.registerSkill(new EZe(new hC(t,I_,hIn))),e.registerSkill(new MZe),e.registerSkill(new v2t),e.registerSkill(new C2t(new hC(t,b2t,Sho))),e.registerSkill(new cXe(new hC(t,g5,wxn))),e.registerSkill(new dtt(new hC(t,Sj,pDn))),e.registerSkill(new S2t(new hC(t,T2t,Tho))),e.registerSkill(new _2t(new hC(t,E2t,bho))),e.registerSkill(new ptt(new hC(t,k2,hDn))),e.registerSkill(new htt(new hC(t,aZ,mDn))),t.set(fm,e)}a(Chl,"registerSkills");p();var who=fe(Wc()),Rho=fe(s2());var w2t=class extends ef{constructor(){super(...arguments);this.requestType=new who.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=Zu.Compile(Sbn)}static{a(this,"AgentClientToolConfirmationInvoker")}async invokeClientToolConfirmation(r,n){let o=this.ctx.get(er).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Rho.ResponseError(u.code,u.message,u.data);throw ot.error(this.ctx,`ResponseError while invoking client tool confirmation ${n.name}`,d),new Error(`Failed to invoke client tool confirmation ${n.name}: ${u.message}`)}s=l}catch(c){throw new Error(`Failed to invoke client tool confirmation ${n.name}: ${String(c)}`)}if(s==null)throw new Error(`Failed to invoke client tool confirmation ${n.name}: No result returned`);if(!this.typeCheck.Check(s))throw new ey(this.typeCheck.Errors(s));return s}};p();var kho=fe(Wc()),Pho=fe(s2());var R2t=class extends tv{constructor(){super(...arguments);this.requestType=new kho.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=Zu.Compile(bbn)}static{a(this,"AgentClientToolInvoker")}async invokeClientTool(r,n){let o=this.ctx.get(er).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Pho.ResponseError(u.code,u.message,u.data);throw ot.error(this.ctx,`ResponseError while invoking client tool ${n.name}`,d),new Error(`Failed to invoke client tool ${n.name}: ${u.message}`)}s=l}catch(c){throw new Error(`Failed to invoke client tool ${n.name}: ${String(c)}`)}if(s==null)throw new Error(`Failed to invoke client tool ${n.name}: No result returned`);if(!this.typeCheck.Check(s))throw new ey(this.typeCheck.Errors(s));return this.transformToToolResult(s)}transformToToolResult(r){let n=r.content.map(o=>typeof o.value=="string"?new Lr(o.value):new EJ(o.value));return new Gr(n,r.status??"success")}};p();p();function Dho(t,e,r){try{let n=t.get(tr).javaContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Fr.debug(t,"Failed to get the active Java experiments for the Context Provider API",n),!1}return!0}a(Dho,"fillInJavaActiveExperiments");var QGr=fe(s2());var bhl={type:new QGr.NotificationType("featureFlagsNotification")},Shl={type:new QGr.NotificationType("copilot/didChangeFeatureFlags")},i9e=class{constructor(e){this.ctx=e;ws(e,r=>this.sendNotification(r))}static{a(this,"FeatureFlagsNotifier")}async sendNotification(e){let r=this.ctx,n=!1,o=!1,s=!1,c=!1,l=!1,u=r.get(tr),d=await u.updateExPValuesAndAssignments(e);n=u.ideDataMigrationCompleted(d),o=u.appmodContextMenuEnabled(d),s=u.appmodProblemsViewEnabled(d),c=u.cliAsDefaultAgentProviderEnabled(d),l=u.inlineChatUseCliEnabled(d);let f={};r.get(tr).excludeRelatedFiles(d)&&(f.ExcludeRelatedFiles=!0);let h=o0r(r,d);h.length>0&&(f.ExpContextProviders=h);let m=new Map;isi(r,h,m,d),uft(r,m,d),Dho(r,m,d);for(let[y,_]of m.entries())f[y]=_;let g=r.get(Nn),A=r.get(er).connection;if(g.getCapabilities().didChangeFeatureFlags)await A.sendNotification(Shl.type,{envelope:{...e.envelope,token:void 0,expires_at:void 0,refresh_in:void 0,limited_user_quotas:void 0,limited_user_reset_date:void 0,error_details:void 0,organization_list:void 0,enterprise_list:void 0,endpoints:void 0},token:e.getTokenValues(),activeExps:f,byok:Bq(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,inline_chat_use_cli_enabled:l,user_info__cli_enabled:e.userInfo.cliEnabled,copilot_plan:e.userInfo.copilotPlan,abexp_features:d.filtersAndExp.exp.features,abexp_assignment_context:d.filtersAndExp.exp.assignmentContext});else{let y={rt:e.getTokenValue("rt")==="1",sn:e.getTokenValue("sn")==="1",chat:e.envelope.chat_enabled??!1,ic:e.envelope.chat_enabled??!1,pc:!0,ae:f,byok:Bq(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,inline_chat_use_cli_enabled:l};e.getTokenValue("agent_mode")==="0"&&(y.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(y.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(y.mcp=!1),e.envelope.chat_enabled&&(y.xc=!0),e.userInfo.cliEnabled!==void 0&&(y.user_info__cli_enabled=e.userInfo.cliEnabled),await A.sendNotification(bhl.type,y)}}};p();var k2t=class extends ks{constructor(r){super();this.ctx=r;this.notificationEndpoint="statusNotification"}static{a(this,"NotificationStatusReporter")}didChangeV1(r){let n=r.kind;r.busy&&n!=="Error"&&(n="InProgress"),this.ctx.get(er).connection.sendNotification(cGt.type,{busy:r.busy,kind:r.kind,status:n,message:r.message??""}),this.ctx.get(er).connection.sendNotification("didChangeStatus",{busy:r.busy,kind:r.kind,message:r.message,command:r.command})}didChangeV2(r){this.ctx.get(er).connection.sendNotification(lGt.type,r)}};p();var Nho=new pe("AgentEncodingConfigurationService"),P2t=class extends i5{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(er)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){Nho.debug(this.ctx,"Client does not support workspace/configuration, using UTF-8 fallback");return}try{let o=(await this.service.connection.workspace.getConfiguration([{scopeUri:e,section:"copilot.file.encoding"}]))[0];return o&&["utf8","utf-8","utf16le","ucs2","ucs-2","base64","base64url","latin1","binary","hex","ascii"].includes(o)?o:void 0}catch(n){Nho.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var Mho=new aq;p();var Bho=fe(ii());var Fho={"mcp.contributionPoint.enabled":{description:"Whether extension-contributed MCP servers are enabled",defaultValue:!0,type:"boolean"},"customAgent.enabled":{description:"Whether custom agent functionality is enabled",defaultValue:!0,type:"boolean"},"customHook.enabled":{description:"Whether custom hook functionality is enabled",defaultValue:!0,type:"boolean"},"customSkill.enabled":{description:"Whether custom skill functionality is enabled",defaultValue:!0,type:"boolean"},"subagent.enabled":{description:"Whether subagent functionality is enabled",defaultValue:!0,type:"boolean"},"autoModel.enabled":{description:"Whether auto model functionality is enabled",defaultValue:!0,type:"boolean"},"cveRemediatorAgent.enabled":{description:"Whether CVE remediator agent functionality is enabled",defaultValue:!0,type:"boolean"},"agentMode.autoApproval.enabled":{description:"Whether agent mode auto-approval is enabled",defaultValue:!0,type:"boolean"},"copilotAgent.ide.enabled":{description:"Whether copilot agent functionality is enabled",defaultValue:!0,type:"boolean"}},Thl=new Bho.NotificationType("policy/didChange"),Ihl=Object.fromEntries(Object.entries(Fho).map(([t,e])=>[t,{type:e.type}])),o9e=class extends eu{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries(Fho).map(([r,n])=>[r,n.defaultValue]));let o=r.get(er);o.onActivation(()=>{this.startWatching().catch(s=>{Fr.error(this.ctx,"Unexpected error starting policy watcher:",s)})}),o.onDeactivation(()=>{this.dispose()})}static{a(this,"GroupPolicyWatcher")}async startWatching(){try{let{createWatcher:r}=await Promise.resolve().then(()=>fe(Lho()));this.policyWatcher=r("IDEGitHubCopilot",Ihl,n=>{this.handlePolicyUpdate(n).catch(o=>{Fr.error(this.ctx,"Error in handlePolicyUpdate:",o)})}),Fr.info(this.ctx,"Policy watcher started for GitHub Copilot Plugin")}catch(r){process.platform==="darwin"||process.platform==="win32"?Fr.exception(this.ctx,r,"Policy watcher failed to load on supported platform"):Fr.warn(this.ctx,"Policy watcher not available - continuing without policy watching:",r instanceof Error?r.message:String(r))}}async handlePolicyUpdate(r){Fr.debug(this.ctx,"GroupPolicyWatcher - policy update triggered",r);let n=!1;for(let[o,s]of Object.entries(r))if(s!==void 0){let c=o;this.policyValues.get(c)!==s&&(n=!0),this.policyValues.set(c,s),Fr.debug(this.ctx,`Policy change: ${o} = ${s}`)}n&&this.policyChangeEmitter.fire(void 0),this.policyValues.get("subagent.enabled")===!1&&this.ctx.get(Nn).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(Nn).setCapabilities({cveRemediatorAgent:!1}),await this.sendPolicyChangeNotification()}getAllPolicyValues(){let r={};for(let[n,o]of this.policyValues.entries())r[n]=o;return r}getPolicyValue(r){return this.policyValues.get(r)}sendPolicyChangeNotification(){if(this.disposed)return Promise.resolve();let r=this.getAllPolicyValues();try{return this.connection.sendNotification(Thl,r)}catch{return Promise.resolve()}}dispose(){if(!this.disposed){if(this.disposed=!0,this.policyWatcher){try{this.policyWatcher.dispose()}catch(r){Fr.error(this.ctx,"Error disposing policy watcher:",r)}this.policyWatcher=void 0}Fr.debug(this.ctx,"Policy watcher stopped")}}};p();var Qho=fe(Wc());var Uho=new pe("managedSettings.notifier"),xhl=new Qho.ProtocolNotificationType("copilot/didChangeManagedSettings"),s9e=class{constructor(e){this.ctx=e;this.disposed=!1;let r=e.get(er);this.lifecycleSubscriptions=[r.onActivation(()=>{e.get(Nn).getCapabilities().didChangeManagedSettings&&this.activate().catch(n=>Uho.exception(e,n,".activate"))}),r.onDeactivation(()=>this.dispose())]}static{a(this,"ManagedSettingsNotifier")}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.lifecycleSubscriptions)e.dispose();this.settingsSubscription?.dispose()}}async activate(){let e=this.ctx.get(ay);await e.refresh(),!this.disposed&&!this.settingsSubscription&&(this.settingsSubscription=e.observe(r=>this.notify(r)))}notify(e){this.ctx.get(er).connection.sendNotification(xhl,e).catch(r=>Uho.debug(this.ctx,"Failed to send managed settings notification:",r))}};p();var D2t=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(e){this.ctx.get(er).connection.sendNotification(YXi,{scope:e}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(er).connection.sendNotification(KXi,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(xM).unregisterProvider(e)}};p();var N2t=class extends Jb{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get(CA).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get(CA).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get(CA).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var qho=fe(ii());var M2t="mcp.elicitation",O2t=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new qho.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Hn(ri.InternalError,"Another MCP elicitation request is already in progress.");this.ongoingMcpElicitationCalls=!0;try{let c=n.params.message;if("url"in n.params)throw new Hn(ri.InvalidRequest,"URL mode elicitation is not supported");let l=n.params.requestedSchema;ur.info(e.ctx,`MCP server ${r} elicitation request received: ${c}`),await la(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(u5).sendRequest(this.elicitationRequestType,{mcpServer:r,message:c,requestedSchema:l,conversationId:e.conversation.id.toString(),roundId:o??e.agentToolCalls.getRound(0).roundId,turnId:e.turn.id.toString(),toolCallId:s??e.agentToolCalls.getRound(0).toolCalls[0].id});return ft(e.ctx,M2t,Vt.createAndMarkAsIssued()),sr(e.ctx,M2t),d}catch(c){let l=`Failed to process elicitation request: ${c instanceof Error?c.message:String(c)}`;throw ur.error(e.ctx,l,c),await Td(e.ctx,{message:l,server:r}),Ma(e.ctx,c,M2t),Hs(e.ctx,M2t,c),new Hn(ri.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var rP=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var a9e=class extends rP{static{a(this,"LoggingMessageNotificationHandler")}constructor(e,r){super(e,r)}handle(e){let r=typeof e.params.data=="string"?e.params.data:JSON.stringify(e.params.data);switch(e.params.logger&&(r=`${e.params.logger}: ${r}`),e.params?.level){case"debug":case"info":case"notice":ur.info(this.ctx,`MCP server ${this.serverName} log:`,r),la(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":ur.warn(this.ctx,`MCP server ${this.serverName} log:`,r),mD(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"error":case"critical":case"alert":case"emergency":ur.error(this.ctx,`MCP server ${this.serverName} log:`,r),Td(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:ur.info(this.ctx,`MCP server ${this.serverName} log:`,r),la(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var c9e=class extends rP{static{a(this,"PromptListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ur.info(this.ctx,"Prompts list changed, refreshing prompts..."),la(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(Kxt)}};p();var l9e=class extends rP{static{a(this,"ResourceListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ur.info(this.ctx,"Resource list changed, refreshing resources..."),la(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(Yxt)}};p();var u9e=class extends rP{static{a(this,"ResourceUpdatedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ur.info(this.ctx,`Resource updated for URI: ${e.params.uri}`),la(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(qZi)}};p();var L2t=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},d9e=class extends L2t{static{a(this,"ListRootsRequestHandler")}constructor(e,r){super(e,r)}handle(e){ur.info(this.ctx,`MCP server ${this.serverName} requested roots list`);let r=[];try{(this.ctx.get($r).getWorkspaceFolders()||[]).forEach(o=>{r.push(o)}),la(this.ctx,{message:`Requested roots list and found ${r.length} root(s).`,server:this.serverName})}catch(n){ur.error(this.ctx,`Error getting workspace folders for MCP server ${this.serverName}:`,n),Td(this.ctx,{message:`Error getting workspace folders for MCP server ${this.serverName}: ${n instanceof Error?n.message:String(n)}`,server:this.serverName})}return{roots:r}}};p();var f9e=class extends rP{static{a(this,"ToolListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ur.info(this.ctx,"Tool list changed, refreshing tools..."),la(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(zxt)}};p();var jho="mcp.sampling",B2t=class{constructor(){this.defaultTemperature=.7;this.ongoingMcpSamplingCalls=!1}static{a(this,"McpSamplingService")}async handleSamplingRequest(e,r,n,o,s,c){try{if(this.ongoingMcpSamplingCalls)throw new Hn(ri.InternalError,"Another MCP sampling request is already in progress.");this.ongoingMcpSamplingCalls=!0,ur.info(e.ctx,`MCP server ${o} requested sampling:`,n.params),await la(e.ctx,{message:`Sampling request received from ${o}: ${JSON.stringify({messageCount:n.params.messages.length,systemPrompt:n.params.systemPrompt?"provided":"none",maxTokens:n.params.maxTokens,temperature:n.params.temperature})}`,server:o});let l=await e.ctx.get(gz).readMcpSamplingConfig({serverName:o});if(l.alwaysDeny)throw new Error("User has chosen to always deny MCP tools with this mcp server.");if(!l.alwaysAllow){let y=n.params.messages.filter(v=>v.role==="user"),_=y[y.length-1];if((await e.ctx.get(ef).invokeClientToolConfirmation(e,{name:o,title:`Allow MCP tools from "${o}" to make LLM requests?`,message:`The MCP server "${o}" has issued a request to make a language model call. Do you want to allow it to make requests during chat?`,input:{..._,toolType:"mcp_tool",mcpType:"sampling",mcpServerName:o},conversationId:e.conversation.id,roundId:s??e.agentToolCalls.getRound(0).roundId,turnId:e.turn.id,toolCallId:c??e.agentToolCalls.getRound(0).toolCalls[0].id})).result==="dismiss")throw new zc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await Qwe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new jn.CancellationTokenSource().token,g=await r.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:e.toLlmInteraction(),temperature:n.params.temperature??this.defaultTemperature,stop:n.params.stopSequences,turnId:String(e.turn.id)},m,f),A=this.processFetchResult(g,u.uiName);return $c(e.ctx,jho,{userPreference:l.alwaysAllow?"autoApprove":l.alwaysDeny?"autoDeny":"none",selectedModel:u.uiName,success:"true"}),A}catch(l){let u=`Failed to process sampling request: ${l instanceof Error?l.message:String(l)}`;throw ur.error(e.ctx,u,l),await Td(e.ctx,{message:u,server:o}),$c(e.ctx,jho,{success:"false",errorMessage:u}),new Hn(ri.InternalError,u)}finally{this.ongoingMcpSamplingCalls=!1}}convertMCPMessagesToChatML(e,r,n){let o=[];n&&o.push({role:"system",content:n});for(let s of r){let c,l=Array.isArray(s.content)?s.content[0]:s.content;if(!l){ur.warn(e,"Empty content in MCP message, skipping");continue}if(l.type==="text")c=l.text;else if(l.type==="image")c=[{type:"image_url",image_url:{url:atob(l.data)}}];else throw ur.warn(e,`Unknown MCP content type: ${l.type}, defaulting to empty array`),new Error(`Unknown MCP content type: ${l.type}`);let u;switch(s.role){case"user":u="user";break;case"assistant":u="assistant";break;default:u="user",ur.warn(e,`Unknown MCP role: ${s.role}, defaulting to user`)}o.push({role:u,content:c})}return o}processFetchResult(e,r){if(e.type!=="success"){let n=`Unexpected fetch result type: ${e.type}.`;throw"reason"in e&&(n+=` Reason: ${e.reason}`),new Error(n)}return{model:r,role:"assistant",content:{type:"text",text:e.value}}}async getModelConfiguration(e,r,n){let o=await this.getAvailableBYOKModels(e),s=[...await this.getAvailableModels(e),...o.map(d=>d.name)];if(!s)throw new Error("No available models found");let c=n.allowedModels&&n.allowedModels.length>0?s.filter(d=>n.allowedModels.some(f=>f.toLowerCase()===d.toLowerCase())):s;if(!c||c.length===0)throw new Error("No available models found");let l;r.params.modelPreferences?.hints&&(l=this.mapFindFirst(r.params.modelPreferences.hints,d=>c.find(f=>f.toLowerCase().includes(d.name.toLowerCase())))),l=l??c[0];let u=o.find(d=>d.name===l);return u?zO(e,u.provider,l):await e.get(dl).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(Ns).getMetadata()).filter(n=>n.capabilities.type&&!eue.has(n.capabilities.family)&&n.capabilities.supports?.tool_calls&&(n.capabilities.limits?.max_prompt_tokens??!1)).map(n=>n.capabilities.family)}async getAvailableBYOKModels(e){return(await new as(e.get(Un)).getAllModels(e)).filter(n=>n.capabilities?.toolCalling)}mapFindFirst(e,r){for(let n of e){let o=r(n);if(o!==void 0)return o}}};p();var Bbe=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function Hho(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=Fdt(e);if(r!=="Bearer"||n.error!=="insufficient_scope")return null;let o=n.scope;if(!o)return null;let s=o.split(" ").filter(c=>c.length>0);return{error:n.error,requiredScopes:s,resourceMetadata:n.resource_metadata,errorDescription:n.error_description}}a(Hho,"parseScopeChallenge");p();var jGr=/[^a-z0-9_-]/gi;var whl=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function Gho(){let t={};for(let e of whl){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(Gho,"getDefaultEnvironment");async function $ho(t,e,r){if(!e.description){let n=`Tool ${e.name} does not have a description. Tools must be accurately described to be called.`;ur.warn(t,n),await mD(t,{message:n,server:r,tool:e.name}),e.description=""}if(jGr.lastIndex=0,jGr.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;ur.warn(t,n),await mD(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(jGr,"_")}else e._nameForModel=e.name;return e}a($ho,"normalizeTool");var F2t=class{constructor(){this.seenPrefixes=new Set}static{a(this,"McpPrefixGenerator")}generate(e){let r="mcp_"+e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"_").slice(0,13),n=r;for(let o=2;this.seenPrefixes.has(n);o++)n=r+o;return this.seenPrefixes.add(n),n}};p();async function*HGr(t,e,r){let n;do{let o=await t(n),s=e(o);s.length>0&&(yield s),n=r(o)}while(n!==void 0)}a(HGr,"paginateRequest");async function GGr(t){let e=[];for await(let r of t)e.push(...r);return e}a(GGr,"flattenAsyncIterable");var Vho=fe(require("events"));var $Gr=6e4,Az=class{constructor(e,r,n){this.transport=null;this.emitter=new Vho.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(Nn);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new B2t),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new O2t);let s=this.ctx.get(Ir).getEditorInfo(),c=this.ctx.get(Ir).getEditorPluginInfo();this.mcp=new _G({name:`${s.name}/${c.name}`,version:`${s.version}/${c.version}`},{capabilities:{roots:{listChanged:!0},...this.isSamplingEnabled?{sampling:{}}:{},...this.isElicitationEnabled?{elicitation:{}}:{}}}),this.name=r}static{a(this,"MCPBaseServer")}get isConnected(){return this.transport!==null}async connect(e){if(this.transport=this.initTransport(e),!this.transport){let r=new Error("Failed to initialize transport");throw ur.error(this.ctx,"Transport initialization failed:",r),r}this.addListeners();try{await this.mcp.connect(this.transport),this.initializeCache()}catch(r){throw ur.error(this.ctx,"Connection failed:",r),await Td(this.ctx,{message:`Failed to connect to MCP server: ${r instanceof Error?r.message:String(r)}`,server:this.name}),this.transport=null,r}}async initializeCache(){await Promise.all([this.refreshToolsCache(!0),this.refreshResourcesCache(!0),this.refreshPromptsCache(!0)]),this.emitter.emit(NW)}getCachedTools(){return this.cachedTools}getCachedResources(){return this.cachedResources}getCachedResourceTemplates(){return this.cachedResourceTemplates}getCachedPrompts(){return this.cachedPrompts}restoreCacheFromPersistence(e){this.cachedTools=[...e.tools],this.cachedResources=[...e.resources],this.cachedResourceTemplates=[...e.resourceTemplates],this.cachedPrompts=[...e.prompts]}async createMcpTool(e,r){let n={name:e.name,description:e.description,inputSchema:{...e.inputSchema||{},properties:e.inputSchema?.properties||{},type:e.inputSchema?.type||"object"},_status:r??"enabled",_nameForModel:e.name,annotations:e.annotations};return await $ho(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof Bbe){let l=`OAuth scope challenge during ${r} from server ${this.name}. Required scopes: ${s.challengeInfo.requiredScopes.join(", ")}`;if(n.scopeChallengeHandler)return n.scopeChallengeHandler(s.challengeInfo.requiredScopes);if(ur.info(this.ctx,l),await Td(this.ctx,{message:l,server:this.name}),n.errorHandler)return n.errorHandler(l);if("defaultValue"in n)return n.defaultValue;throw s}if(s.code===ri.MethodNotFound){if(ur.info(this.ctx,`${r} not supported by server ${this.name}:`,s.message),"methodNotFoundValue"in n)return n.methodNotFoundValue;if(n.errorHandler)return n.errorHandler("Method not found");if("defaultValue"in n)return n.defaultValue;throw new Error("No default value or error handler provided")}let c=`Failed to ${r} from server ${this.name}: ${s.message||String(s)}`;if(ur.error(this.ctx,c),await Td(this.ctx,{message:c,server:this.name}),n.errorHandler)return n.errorHandler(c);if("defaultValue"in n)return n.defaultValue;throw new Error("No default value or error handler provided")}}async*getResourcesIterable(e){if(!this.transport)return;let r=HGr(n=>this.mcp.listResources({cursor:n},{signal:e}),n=>n.resources,n=>n.nextCursor);for await(let n of r)yield n}async getResources(e){return await this.handleMCPOperationError(async()=>{let r=await GGr(this.getResourcesIterable(e));return la(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=HGr(n=>this.mcp.listResourceTemplates({cursor:n},{signal:e}),n=>n.resourceTemplates,n=>n.nextCursor);for await(let n of r)yield n}async getResourceTemplates(e){return await this.handleMCPOperationError(async()=>{let r=await GGr(this.getResourceTemplatesIterable(e));return la(this.ctx,{message:`Discovered ${r.length} resource templates`,server:this.name}),r},"get resource templates",{defaultValue:[]})}async readResource(e){return this.transport?await this.handleMCPOperationError(async()=>await this.mcp.readResource({uri:e}),`read resource ${e}`,{defaultValue:null,methodNotFoundValue:{contents:[]}}):null}async subscribeResource(e){this.transport&&await this.handleMCPOperationError(async()=>{await this.mcp.subscribeResource({uri:e})},`subscribe resource ${e}`,{defaultValue:void 0})}async unsubscribeResource(e){this.transport&&await this.handleMCPOperationError(async()=>{await this.mcp.unsubscribeResource({uri:e})},`unsubscribe resource ${e}`,{defaultValue:void 0})}async callTool(e,r,n,o,s,c){let l=TZ();this.ongoingMcpToolCalls.push({requestId:l,toolName:e,turnContext:o,roundId:s,toolCallId:c});let u=a(d=>{let f=new Gr([],"error");return f.content.push(new Lr(d)),f},"createErrorResult");try{return await this.handleMCPOperationError(async()=>{let d=new AbortController;n.onCancellationRequested(()=>{d.abort()});let f=await this.mcp.callTool({name:e,arguments:r,_meta:{progressToken:l}},CR,{onprogress:a(m=>{ur.info(this.ctx,`${e} calling progress`,m),la(this.ctx,{message:`${e} calling progress:`+JSON.stringify(m),server:this.name})},"onprogress"),resetTimeoutOnProgress:!0,signal:d.signal});if(f&&typeof f=="object"){if(f.content||f.structuredContent)return this.formatToolResult(f);let m=`Error calling tool ${e}: `+JSON.stringify(f);return ur.error(this.ctx,m),await Td(this.ctx,{message:m,server:this.name,tool:e}),u(m)}let h=`Error calling tool ${e}: `+JSON.stringify(f);return ur.error(this.ctx,h),await Td(this.ctx,{message:h,server:this.name,tool:e}),u(h)},`call tool ${e}`,{errorHandler:u})}finally{this.ongoingMcpToolCalls=this.ongoingMcpToolCalls.filter(d=>d.requestId!==l)}}async getPrompt(e,r){return(await this.mcp.getPrompt({name:e,arguments:r})).messages}async completePrompt(e,r,n,o){return(await this.mcp.complete({ref:{type:"ref/prompt",name:e},argument:{name:r,value:n},context:{arguments:o}})).completion.values}addListeners(){this.mcp.onclose=()=>{ur.info(this.ctx,`MCP server ${this.name} connection closed.`),la(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{ur.error(this.ctx,`MCP server ${this.name} error:`,e),Td(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(gee,e=>new a9e(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(j8,e=>new f9e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(q8,e=>new c9e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(Q8,e=>new l9e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(Gpr,e=>new u9e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(rhr,e=>(this.initRootsTracker(),new d9e(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(DNe,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw ur.error(this.ctx,o),new Hn(ri.InternalError,o)}if(this.ongoingMcpToolCalls.length===0){let o="No ongoing tool call context found for sampling request.";throw ur.error(this.ctx,o),new Hn(ri.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new mc(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler(NNe,async e=>{if(this.ongoingMcpToolCalls.length===0){let n="No ongoing tool call context found for elicitation request.";throw ur.error(this.ctx,n),new Hn(ri.InternalError,n)}let r=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return this.elicitationHandler.handleRequest(r.turnContext,this.name,e,r.roundId,r.toolCallId)}),this.setupDataRefreshListeners()}setupDataRefreshListeners(){this.emitter.on(zxt,()=>{this.refreshToolsCache()}),this.emitter.on(Yxt,()=>{this.refreshResourcesCache()}),this.emitter.on(Kxt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout($Gr),n=await this.mcp.listTools({},{signal:r}),o=new Map(this.cachedTools.map(s=>[s.name,s._status]));this.cachedTools=await Promise.all(n.tools.map(s=>this.createMcpTool(s,o.get(s.name)))),ur.info(this.ctx,`Refreshed ${this.cachedTools.length} tools for server ${this.name}`),e||this.emitter.emit(NW)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout($Gr),[n,o]=await Promise.all([this.getResources(r),this.getResourceTemplates(r)]);this.cachedResources=n,this.cachedResourceTemplates=o,ur.info(this.ctx,`Refreshed ${this.cachedResources.length} resources and ${this.cachedResourceTemplates.length} templates for server ${this.name}`),e||this.emitter.emit(NW)}catch(r){ur.error(this.ctx,`Failed to refresh resources cache for ${this.name}:`,r)}}async refreshPromptsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout($Gr),n=await this.mcp.listPrompts({},{signal:r});this.cachedPrompts=n.prompts,ur.info(this.ctx,`Refreshed ${this.cachedPrompts.length} prompts for server ${this.name}`),e||this.emitter.emit(NW)},"refresh prompts",{defaultValue:void 0})}formatToolResult(e){let r=new Gr([],e.isError===!0?"error":"success");for(let n of e.content??[])if(n.type==="text")r.content.push(new Lr(n.text));else if(n.type==="image"||n.type==="audio")r.content.push(new Mq({mimeType:n.mimeType,data:n.data}));else if(n.type==="resource"){let o=n.resource;if("text"in o)r.content.push(new Lr(o.text));else if("blob"in o){let s=o.mimeType||"application/octet-stream";r.content.push(new Mq({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new Lr(JSON.stringify(e.structuredContent))),r}initRootsTracker(){let e=this.ctx.get($r);this.rootsTracker=e.onDidChangeWorkspaceFolders(r=>{this.mcp.sendRootsListChanged().then(()=>{this.rootsTracker?.dispose()})})}getEmitter(){return this.emitter}async cleanup(){this.transport&&(await this.mcp.close(),this.mcp.transport&&this.mcp.transport.onclose?.(),this.rootsTracker?.dispose(),this.transport=null)}};p();function Rhl(t){return a(async(r,n)=>{let o=r instanceof URL?r.toString():r,s;if(n?.headers)if(n.headers instanceof Headers){s={};for(let[f,h]of n.headers.entries())s[f]=h}else if(Array.isArray(n.headers)){s={};for(let[f,h]of n.headers)s[f]=h}else s=n.headers;let c={method:n?.method||"GET",headers:s,body:n?.body,signal:n?.signal||void 0},l=await t.fetch(o,c);if(l.status===403){let f=l.headers.get("WWW-Authenticate"),h=Hho(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new Bbe(m,h)}}let u=l.body(),d=null;if(u)d=new ReadableStream({start(f){let h=a(y=>{f.enqueue(new Uint8Array(y))},"onData"),m=a(()=>{f.close(),A()},"onEnd"),g=a(y=>{f.error(y),A()},"onError"),A=a(()=>{u.off("data",h),u.off("end",m),u.off("error",g)},"cleanup");u.on("data",h),u.on("end",m),u.on("error",g)},cancel(){u&&"destroy"in u&&typeof u.destroy=="function"&&u.destroy()}});else{let f=await l.text();d=new ReadableStream({start(h){h.enqueue(new TextEncoder().encode(f)),h.close()}})}return new globalThis.Response(d,{status:l.status,statusText:l.statusText,headers:new Headers(l.headers)})},"fetchLike")}a(Rhl,"createFetchAdapter");function U2t(t,e){let r=t.get(Jt),n=Rhl(r);return{...e,fetch:n}}a(U2t,"createConfigWithFetch");var Q2t=class extends Az{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=U2t(this.ctx,r),{url:o,...s}=n;return new rge(new URL(o),s)}};p();var Who=require("child_process"),zho=require("util");var q2t=class extends Az{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...Gho(),...r.env||{}},r.stderr="pipe",new lge(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{mD(this.ctx,{message:`[server stderr] ${r.toString().trimEnd()}`,server:this.name})})}async cleanup(){if(this.transport){if(process.platform==="win32"){let r=null;"pid"in this.transport&&typeof this.transport.pid=="number"&&(r=this.transport.pid),r&&await this.forceKillWindowsProcess(r)}await super.cleanup()}}async forceKillWindowsProcess(r){try{let n=(0,zho.promisify)(Who.exec);ur.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),la(this.ctx,{message:`Force killing Windows process with PID ${r}`,server:this.name}),await n(`taskkill /pid ${r} /t /f`,{timeout:1e4}),ur.info(this.ctx,`Successfully force killed process ${r}`)}catch(n){ur.debug(this.ctx,`Failed to kill process ${r} (process may not exist):`,n),Td(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var p9e=class extends Az{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=U2t(this.ctx,r),{url:o,...s}=n;return new nge(new URL(o),s)}};p();var j2t=class extends Nq{static{a(this,"McpLanguageModelTool")}constructor(e,r){super({...e,toolProvider:{id:e.serverName,displayNamePrefix:e.serverNamePrefix,displayName:e.serverName,description:e.serverName,isFirstPartyTool:!1},type:"mcp"}),this.invoker=r}prepareInvocation(e,r){let n={title:`Confirm MCP Tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`,message:`Do you want to allow the external MCP tool "${this.toolProvider.displayName}/${this.displayName}" to run?`};return{progressMessage:`Running MCP tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`,confirmationMessages:n}}prepareCompletion(e,r){return{completionMessage:`Ran MCP tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`}}async invoke(e,r,n){return await this.invoker(e,r,r.input,n)}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new zc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations};try{return await e.ctx.get(ef).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var Zho=fe(Wc());p();var Yho="mcp-servers-cache",Kho="mcp-first-boot-completed",H2t=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get(CA),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get(Kho)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set(Kho,"true")}parseCache(){let e=this.stateDb.get(Yho);if(!e)return{};try{return JSON.parse(e)}catch{return{}}}async get(e){return await this.initPromise,this.parseCache()[e]}async store(e){await this.initPromise,this.stateDb.set(Yho,e)}};p();function Jho(t){let e=t.get(Ir).getEditorPluginInfo();if(e.name==="copilot-intellij"){let r=e.version.endsWith("nightly"),n=e.version==="42.0.0.0";return r||n}if(e.name==="copilot-xcode"){let r=e.version.split(".");if(r.length>=3){let[n,o,s]=r;return n==="0"&&o==="0"&&s==="0"||n==="0"&&s!=="0"}}if(e.name==="copilot-eclipse"){let r=e.version.endsWith("nightly"),n=e.version.endsWith("qualifier");return r||n}return!1}a(Jho,"isNightlyOrDevBuild");var G2t=class t extends CE{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new _w;this.prefixGenerator=new F2t;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new H2t(r),this.registryService=r.get(lM),ws(this.ctx,async n=>{let o=this.isMcpEnabled;this.isMcpEnabled=this.isTokenMcpEnabled(n),o!==this.isMcpEnabled&&(ur.info(this.ctx,`MCP state changed from ${o} to ${this.isMcpEnabled}`),this.registryService.clearAllCaches(),this.isMcpEnabled?await this.updateMCPServers(this.storedMCPServersConfig):(ur.info(this.ctx,"MCP is disabled, clearing all servers and tools"),this.clearAllServers()))}),this.ctx.get(Nn).onDidSetCapabilities(n=>{let o=n.mcpAllowlist;o!==this.previousMcpAllowlist&&(this.previousMcpAllowlist=o,this.registryService.clearAllCaches(),this.isMcpEnabled&&(ur.info(this.ctx,`mcpAllowlist changed to ${o}, updating MCP servers`),this.updateMCPServers(this.storedMCPServersConfig)))})}static{a(this,"CLSMCPManager")}static{this.contentsNotificationType=new Zho.ProtocolNotificationType("copilot/mcpTools")}isTokenMcpEnabled(r){if(!r)return!0;try{return r.getTokenValue("mcp")!=="0"}catch(n){return ur.warn(this.ctx,`Error reading MCP value from token: ${n instanceof Error?n.message:String(n)}`),!0}}isAllowlistFeatureEnabled(){if(this.ctx.get(Nn).getCapabilities().mcpAllowlist)return ur.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=Jho(this.ctx);return n||ur.debug(this.ctx,"Allowlist feature disabled for stable version, only enabled for nightly/prerelease/dev (use copilotCapabilities.mcpAllowlist to override)"),n}ensureMcpEnabledOrThrow(r){if(!this.isMcpEnabled)throw new Error(`MCP is disabled, cannot ${r}`)}getActiveServerEntry(r){let n=this.MCPServersMap.get(r);if(!n)throw new Error(`MCP server ${r} does not exist`);if(n.isBlocked)throw new Error(`MCP server ${r} is blocked by registry`);return n}async ensureServerConnection(r,n,o){return n.server.isConnected?n.server:(ur.info(this.ctx,`Auto-starting MCP server ${r} for ${o}`),await this.startMCPServer(r),this.getActiveServerEntry(r).server)}async updateMCPServers(r){let n=this.storedMCPServersConfig;if(this.storedMCPServersConfig=r,!this.isMcpEnabled)return;let o=this.ctx.get(Nn).getCapabilities().mcpServerManagement??!1,s=new Set(Object.keys(r)),c=new Set(this.MCPServersMap.keys()),l=[...c].filter(m=>!s.has(m)),u=new Set([...s].filter(m=>c.has(m)&&!this.areServerConfigsEqual(n[m],r[m]))),d=new Set;for(let m of u){let g=this.MCPServersMap.get(m);g&&!g.isBlocked&&(g.server.isConnected||g.hasError)&&d.add(m)}let f=[...l,...u];for(let m of f){let g=this.MCPServersMap.get(m);g&&!g.isBlocked&&(this.unregisterServerTools(m),await this.stopMCPServer(m)),u.has(m)||(this.removeServerAccountPreferences(m),this.serverPrefixes.delete(m)),this.MCPServersMap.delete(m)}f.length>0&&await this.persistAllServersCache();for(let m of s)this.MCPServersMap.has(m)||await this.upsertServerDefinition(m,r[m]);if(await this.cache.isFirstBoot()||!o){if(await this.cache.markFirstBootCompleted(),s.size>0){let m=Array.from(s).map(async g=>{try{await this.startServer(g);let A=this.MCPServersMap.get(g);A&&(A.hasError=!1,A.errorMessage=void 0,A.isStarting=!1)}catch(A){let y=this.MCPServersMap.get(g);y&&(y.hasError=!0,y.errorMessage=A instanceof Error?A.message:String(A),y.isStarting=!1),ur.warn(this.ctx,`Failed to auto-start MCP server ${g} during first boot:`,A)}});await Promise.allSettled(m)}}else if(d.size>0){let m=Array.from(d).map(async g=>{try{await this.startServer(g);let A=this.MCPServersMap.get(g);A&&!A.isBlocked&&(A.hasError=!1,A.errorMessage=void 0,A.isStarting=!1)}catch(A){let y=this.MCPServersMap.get(g);y&&!y.isBlocked&&(y.hasError=!0,y.errorMessage=A instanceof Error?A.message:String(A),y.isStarting=!1),ur.warn(this.ctx,`Failed to restart MCP server ${g} after config update:`,A)}});await Promise.allSettled(m)}await this.updateServersList()}areServerConfigsEqual(r,n){return this.stableStringify(r)===this.stableStringify(n)}stableStringify(r){if(Array.isArray(r))return`[${r.map(n=>this.stableStringify(n)).join(",")}]`;if(r&&typeof r=="object"){let n=r;return`{${Object.keys(n).sort().map(s=>`${JSON.stringify(s)}:${this.stableStringify(n[s])}`).join(",")}}`}return JSON.stringify(r)??"undefined"}async upsertServerDefinition(r,n){let o=this.toManagedServerDefinition(r,n),s=this.MCPServersMap.get(r);if(this.isAllowlistFeatureEnabled()){let c=await this.registryService.validateServerConfig(r,n),{registryInfo:l,isBlocked:u,blockReason:d}=c;u?(this.addBlockedServer(o),ur.info(this.ctx,`MCP server ${r} is blocked: ${d}`)):s&&!s.isBlocked?await this.updateServerDefinition(s,o):await this.addServer(o),l&&this.updateRegistryInfo(r,l);return}s&&!s.isBlocked?await this.updateServerDefinition(s,o):await this.addServer(o)}toManagedServerDefinition(r,n){let o=n.type,s="command"in n?"stdio":o??"streamable";return{...n,name:r,type:s}}addBlockedServer(r){this.MCPServersMap.set(r.name,{server:null,definition:r,hasError:!1,errorMessage:void 0,isStarting:!1,isBlocked:!0,authInfo:void 0})}updateRegistryInfo(r,n){let o=this.MCPServersMap.get(r);o&&(o.registryInfo=n)}getAllContents(r){return this.isMcpEnabled?this.getAllMCPServerCapabilities(r):[]}getAllMCPServerCapabilities(r){let n=[];for(let[o,s]of this.MCPServersMap)try{let c=this.createServerSnapshot(o,s);n.push(c)}catch(c){let l=`Failed to create snapshot for MCP server ${o}.`+(c instanceof Error?` message: ${c.message}`:` ${String(c)}`);ur.error(this.ctx,l);let u={name:o,prefix:this.getServerPrefix(o),status:"error",tools:[],resources:[],resourceTemplates:[],prompts:[],error:l};n.push(u)}return r&&!r.isBuiltIn&&r.customTools?n.map(o=>(o.tools=o.tools.map(s=>{let c=this.createMcpLanguageModelTool(o.name,this.getServerPrefix(o.name),s);return s._status=r.customTools.includes(c.configurationKey)?"enabled":"disabled",s}),o)):n}async updateMCPToolsStatus(r,n){this.ensureMcpEnabledOrThrow("batch update tools status");for(let{serverName:o,toolName:s,status:c}of n){let d=this.getActiveServerEntry(o).server.getCachedTools().find(m=>m.name===s),f=this.getServerPrefix(o);if(!d){ur.error(this.ctx,`Not found MCP ${o} server ${s} tool`);continue}kwe(r)&&(d._status=c),this.ctx.get(vs).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(vs).updateToolsStatus(r,n.map(({serverName:o,toolName:s,status:c})=>({toolId:`${o}.${s}`,status:c}))),this.persistAllServersCache()}async callTool(r,n,o,s,c,l,u){this.ensureMcpEnabledOrThrow(`call tool ${r}.${n}`);let d=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,d,"tool call")).callTool(n,o,s,c,l,u)}async getPrompt(r,n,o){this.ensureMcpEnabledOrThrow(`get prompt ${r}.${n}`);let s=this.getActiveServerEntry(r),l=await(await this.ensureServerConnection(r,s,"get prompt")).getPrompt(n,o);return ft(this.ctx,"mcp.getPrompt",Vt.createAndMarkAsIssued()),sr(this.ctx,"mcp.getPrompt"),l}async completePrompt(r,n,o,s,c){this.ensureMcpEnabledOrThrow(`complete prompt ${r}.${n}`);let l=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,l,"complete prompt")).completePrompt(n,o,s,c)}async readResource(r,n){this.ensureMcpEnabledOrThrow(`read resource from ${r}: ${n}`);let o=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,o,"read resource")).readResource(n)}async startMCPServer(r){return this.ensureMcpEnabledOrThrow(`start server ${r}`),this.serverOperationSequencer.queue(r,async()=>{await this.startMCPServerInternal(r)})}async startMCPServerInternal(r){let n=this.getActiveServerEntry(r);if(n.server.isConnected){ur.info(this.ctx,`MCP server ${r} is already running`);return}if(n.isStarting){ur.info(this.ctx,`MCP server ${r} is already starting, skipping duplicate request`);return}n.isStarting=!0,await la(this.ctx,{message:`Starting server ${r}`,server:r}),await this.updateServersList(!1),this.unregisterServerTools(r);try{await this.startServer(r);let o=this.MCPServersMap.get(r);o&&(o.hasError=!1,o.errorMessage=void 0,o.isStarting=!1)}catch(o){let s=this.MCPServersMap.get(r);throw s&&(s.hasError=!0,s.errorMessage=o instanceof Error?o.message:String(o),s.isStarting=!1),o}finally{this.registerServerTools(r),await this.updateServersList(!1)}}async stopMCPServer(r){return this.serverOperationSequencer.queue(r,async()=>{await this.stopMCPServerInternal(r)})}async stopMCPServerInternal(r){let n=this.getActiveServerEntry(r);if(n.isStarting){ur.info(this.ctx,`MCP server ${r} is starting, cannot stop now`);return}await la(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners(NW),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await la(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await la(this.ctx,{message:`Restarting server ${r}`,server:r}),this.serverOperationSequencer.queue(r,async()=>{await this.stopMCPServerInternal(r),await new Promise(n=>setTimeout(n,100)),await this.startMCPServerInternal(r)})}async logoutMCPServer(r){return this.ensureMcpEnabledOrThrow(`logout server ${r}`),this.serverOperationSequencer.queue(r,async()=>{await la(this.ctx,{message:`Logging out MCP server ${r}`,server:r}),await this.performLogout(r)})}async clearOAuthMCPServer(r){return this.ensureMcpEnabledOrThrow(`clear OAuth for server ${r}`),this.serverOperationSequencer.queue(r,async()=>{let o=this.getActiveServerEntry(r).authInfo?.providerId;if(!o){ur.warn(this.ctx,`No OAuth provider found for server ${r}, nothing to clear`);return}await la(this.ctx,{message:`Clearing OAuth provider registration for MCP server ${r}`,server:r}),await this.performLogout(r),ur.info(this.ctx,`Unregistering provider ${o} for server ${r}`);try{await this.ctx.get(xM).unregisterProvider(o)}catch{ur.debug(this.ctx,`Provider ${o} is not a dynamic OAuth provider, skipping unregistration`)}})}async performLogout(r){let n=this.getActiveServerEntry(r);if(n.authInfo){let{providerId:c,accountName:l}=n.authInfo;ur.info(this.ctx,`Removing account preference and session for account ${l} on server ${r} with provider ${c}`),this.ctx.get(Jb).removeAccountPreference(r,c);try{let u=this.ctx.get(xm).getProvider(c),f=(await u.getSessions(void 0,{})).find(h=>h.account.label===l);f?(await u.removeSession(f.id),ur.info(this.ctx,`Successfully removed session for account ${l}`)):ur.warn(this.ctx,`No session found for account ${l}`)}catch(u){ur.error(this.ctx,`Failed to remove session for account ${l}:`,u)}n.authInfo=void 0}await this.stopMCPServerInternal(r);let o=this.storedMCPServersConfig[r];if(!o){let c=`Original config not found for server ${r}`;throw ur.error(this.ctx,c),new Error(c)}let s=this.toManagedServerDefinition(r,o);this.MCPServersMap.delete(r),await this.addServer(s),ur.info(this.ctx,`Server ${r} logged out and restored to original configuration`),await this.updateServersList(!1)}async startServer(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;if(n.server.isConnected){ur.info(this.ctx,`MCP server ${r} is already running`);return}let{server:o,definition:s}=n;try{o.getEmitter().on(NW,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await la(this.ctx,{message:"Connection state: Running",server:r})}catch(c){ur.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof xR||c instanceof IMe,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof p9e&&u!==401&&u>=400&&u<500){let f=`${u} status sending message to ${s.url}, will attempt to fall back to legacy SSE`;ur.info(this.ctx,f),la(this.ctx,{message:f,server:r});let h={...s,name:r,type:"sse"};return await o.cleanup().catch(()=>{}),await this.updateServerDefinition(n,h),await this.startServer(r)}else if(l&&"url"in s&&u===401){let f=await this.getAuthMetadata(s),h=await this.getToken(s.name,s.url,f.authorizationServer,f.serverMetadata,f.resourceMetadata);if(!h){let g=`Failed to get token for server: ${r}`;throw ur.error(this.ctx,g),new Error(g)}let m={...s,name:r,requestInit:{...s.requestInit??{},headers:{...s.requestInit?.headers??{},Authorization:`Bearer ${h}`}}};return await o.cleanup().catch(()=>{}),await this.updateServerDefinition(n,m),await this.startServer(r)}let d=c instanceof Error?`message: ${c.message} stack: ${c.stack}`:String(c);throw await Td(this.ctx,{message:d,server:r}),this.ctx.get(ss).showWarningMessageOnlyOnce(`${r}.initialize`,`Failed to initialize MCP server '${r}'. Please check the logs for more details.`),c}}async updateServersList(r=!0){return this.updateServersQueue=this.updateServersQueue.then(async()=>{r&&this.registerTools(),await this.notifyClient()}).catch(n=>{ur.error(this.ctx,"updateServersList: Update failed",n)}),this.updateServersQueue}getServerPrefix(r){let n=this.serverPrefixes.get(r);if(n)return n;let o=this.prefixGenerator.generate(r);return this.serverPrefixes.set(r,o),o}async persistAllServersCache(){try{let r={};for(let[n,o]of this.MCPServersMap){let s=o.server?.getCachedTools()??[],c=o.server?.getCachedResources()??[],l=o.server?.getCachedResourceTemplates()??[],u=o.server?.getCachedPrompts()??[];r[n]={tools:s,resources:c,resourceTemplates:l,prompts:u}}await this.cache.store(r)}catch(r){ur.error(this.ctx,"Failed to persist MCP servers cache:",r)}}createMCPServer(r){return r.type==="sse"?new Q2t(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new p9e(this.ctx,r.name,r.version||"1.0.0"):new q2t(this.ctx,r.name,r.version||"1.0.0")}async addServer(r){let n=this.createMCPServer(r),o=await this.cache.get(r.name);o&&n.restoreCacheFromPersistence(o),this.MCPServersMap.set(r.name,{server:n,definition:r,hasError:!1,errorMessage:void 0,isStarting:!1,isBlocked:!1})}async updateServerDefinition(r,n){let o=this.createMCPServer(n),s=await this.cache.get(n.name);s&&o.restoreCacheFromPersistence(s),r.server=o,r.definition=n}async notifyClient(){let r=this.getAllContents();await this.ctx.get(er).connection.sendNotification(t.contentsNotificationType,{servers:r})}registerTools(){for(let[r]of this.MCPServersMap)this.registerServerTools(r)}registerServerTools(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;let o=this.getServerPrefix(r),s=n.server?.getCachedTools()??[];for(let c of s)this.registerTool(r,o,c)}unregisterServerTools(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;let o=n.server?.getCachedTools()??[];for(let s of o)this.unregisterTool(r,s.name)}registerTool(r,n,o){ur.debug(this.ctx,"register MCP Tool:",{...o}),this.ctx.get(vs).registerTool(this.createMcpLanguageModelTool(r,n,o))}createMcpLanguageModelTool(r,n,o){let{name:s,description:c,inputSchema:l,_status:u,_nameForModel:d,annotations:f}=o;return new j2t({serverName:r,serverNamePrefix:n,name:d,displayName:s,description:c||"",displayDescription:c||"",inputSchema:l,annotations:f,status:u},(h,m,g,A)=>(ur.info(this.ctx,"copilot MCP Invoker:",r,s,g),this.callTool(r,s,g,A,h,m.roundId,m.toolCallId?.toString())))}unregisterAllTools(){for(let[r,n]of this.MCPServersMap){if(n.isBlocked)continue;let o=n.server?.getCachedTools()??[];for(let s of o)this.unregisterTool(r,s.name)}}unregisterTool(r,n){ur.debug(this.ctx,"unregister MCP Tool:",{serverName:r,toolName:n}),this.ctx.get(vs).unregisterTool(`${r}.${n}`)}async clearAllServers(){this.unregisterAllTools();for(let r of this.MCPServersMap.keys())if(!this.MCPServersMap.get(r).isBlocked)try{await this.stopMCPServer(r)}catch(o){ur.error(this.ctx,`Error stopping server ${r} during clearAllServers:`,o)}this.MCPServersMap.clear(),this.serverPrefixes.clear()}determineServerStatus(r){return r.isBlocked?"blocked":r.isStarting?"starting":r.server.isConnected?"running":r.hasError?"error":"stopped"}createServerSnapshot(r,n){return{name:r,prefix:this.getServerPrefix(r),status:this.determineServerStatus(n),tools:n.server?.getCachedTools()??[],resources:n.server?.getCachedResources()??[],resourceTemplates:n.server?.getCachedResourceTemplates()??[],prompts:n.server?.getCachedPrompts()??[],error:n.isBlocked?void 0:n.errorMessage,registryInfo:n.registryInfo,authInfo:n.isBlocked?void 0:n.authInfo}}updateAuthInfo(r,n,o,s){let c=this.MCPServersMap.get(r);c&&!c.isBlocked&&(c.authInfo={providerId:n,accountName:o,isDynamic:s})}removeServerAccountPreferences(r){let n=this.MCPServersMap.get(r);if(n?.isBlocked||!n?.authInfo){ur.debug(this.ctx,`No auth info found for server ${r}, nothing to remove`);return}let{providerId:o}=n.authInfo;ur.info(this.ctx,`Removing account preference for server ${r} with provider ${o}`),this.ctx.get(Jb).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new sge(this.ctx).getMetadataFromOriginalUrl(r.url,r.requestInit?.headers)}catch(n){throw ur.error(this.ctx,`Failed to get auth metadata for ${r.url}: ${n instanceof Error?n.message:String(n)}`,n),n}}async getToken(r,n,o,s,c){let l=this.ctx.get(xm).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(xm).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(xm).createDynamicAuthenticationProvider(o,s,c),!A)){ur.warn(this.ctx,`Failed to create authentication provider for server ${r} (authServer: ${o})`);return}l=A.id}let u=c?.scopes_supported||s.scopes_supported||[],d=await this.ctx.get(xm).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(Jb).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(xm).getProvider(l),g=!!this.ctx.get(vC).getClientRegistration(l);if(d.length){if(h)return this.updateAuthInfo(r,l,h.account.label,g),h.accessToken;try{let A=m?.label||l,y="Sign in to another account",_=d.map(v=>({title:v.account.label}));_.push({title:y}),_.push({title:"Cancel"});let E=await this.ctx.get(ss).showInformationModal(`The MCP server ${r} wants to access a ${A} account, Select an account for ${r} to use`,..._);if(!E||E.title==="Cancel"){ur.warn(this.ctx,"user cancelled the account selection");return}if(E.title!==y){let v=d.find(S=>S.account.label===E.title);if(!v){ur.warn(this.ctx,"selected account not found in sessions");return}return this.ctx.get(Jb).updateAccountPreference(r,l,v.account),this.updateAuthInfo(r,l,v.account.label,g),v.accessToken}}catch(A){ur.error(this.ctx,"Failed during account selection:",A);return}}else try{if((await this.ctx.get(ss).showInformationModal(`The MCP Server Definition '${n}' wants to authenticate to ${m.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){ur.warn(this.ctx,"user cancelled the authentication request");return}}catch(A){ur.error(this.ctx,"Failed to show authentication request dialog:",A);return}try{let A=await m.createSession(u,{});return this.ctx.get(ss).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(Jb).updateAccountPreference(r,l,A.account),this.updateAuthInfo(r,l,A.account.label,g),A.accessToken}catch(A){ur.error(this.ctx,`Failed to create authentication session for server ${r}:`,A),this.ctx.get(ss).showWarningMessageOnlyOnce("Authentication failed",`You need to restart the IDE to authenticate the MCP server again. ${A instanceof Error?A.message:String(A)}`);return}}};p();var Xho=fe(Wc());var $2t=class t extends hD{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new Xho.ProtocolNotificationType("copilot/mcpRuntimeLogs")}constructor(e){super(),this.ctx=e}async notifyLog(e){await this.ctx.get(er).connection.sendNotification(t.notificationType,{...e,time:Date.now()})}};p();var emo=fe(Wc());var khl=new emo.ProtocolRequestType("copilot/readMcpSamplingConfig"),V2t=class extends gz{constructor(r){super();this.ctx=r}static{a(this,"CopilotMcpSamplingConfigSender")}async readMcpSamplingConfig(r){let n=this.ctx.get(er).connection,o;try{o=await n.sendRequest(khl,r)}catch(l){throw new Error(`Request copilot/readMcpSamplingConfig failed with message: ${ld(l)}`)}let[s,c]=o;if(c)throw new Error(`Request copilot/readMcpSamplingConfig failed with code: ${c.code}, message: ${c.message}`);return s}};p();var z2t=fe(Wc());var Phl=new z2t.ProtocolRequestType("copilot/showPanelMessageRequest"),Dhl=new z2t.ProtocolNotificationType("copilot/showPanelMessage"),W2t=class extends Obe{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(er).connection.sendNotification(Dhl,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(er).connection,o;try{o=await n.sendRequest(Phl,r)}catch(l){throw new Error(`Request copilot/showPanelMessageRequest failed with message: ${ld(l)}`)}let[s,c]=o;if(c)throw new Error(`Request copilot/showPanelMessageRequest failed with code: ${c.code}, message: ${c.message}`);return s}};p();p();var rmo=require("node:stream"),lse=fe(Tfr());var F9=new pe("UndiciFetcher"),K2t=class extends Jt{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(As).getVersion()}`,this.certificateConfigurator=new hCe(r),this.proxySocketFactory=r.get(Uk),this.settings=r.get(Qo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),F9.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(Qo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),F9.info(this.ctx,"HTTP settings changed; resetting Undici dispatchers.",this.getSettingsLogProperties()),this.resetDispatchers()})}static{a(this,"UndiciFetcher")}async fetch(r,n){let o={...n.headers??{}};o["User-Agent"]=this.userAgent;let s=n.body;if(n.json!==void 0){if(n.body!==void 0)throw new Error("Illegal arguments! Cannot pass in both 'body' and 'json'!");o["Content-Type"]="application/json",s=JSON.stringify(n.json)}let c=n.method??"GET";if(c!=="GET"&&c!=="POST"&&c!=="DELETE")throw new Error("Illegal arguments! 'method' must be 'GET', 'POST', or 'DELETE'!");let l=!1,u,d=Ohl(n.signal),f=d.signal;if(n.timeout){let h=new AbortController;u=setTimeout(()=>{l=!0,h.abort()},n.timeout),f=f?AbortSignal.any([f,h.signal]):h.signal}try{let h={method:c,headers:o,body:s,signal:f};F9.debug(this.ctx,"Starting Undici fetch.",{target:Y2t(r),method:c,hasBody:s!==void 0,hasTimeout:n.timeout!==void 0,hasSignal:f!==void 0});let{dispatcher:m,isProxy:g}=await this.getDispatcher(r),A=await(0,lse.fetch)(r,{...h,dispatcher:m});return F9.debug(this.ctx,"Undici fetch completed.",{target:Y2t(r),status:A.status,isProxy:g}),new kx(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?rmo.Readable.fromWeb(A.body):null)}catch(h){throw l?(F9.warn(this.ctx,"Undici fetch timed out.",{target:Y2t(r),timeout:n.timeout}),new Uz(`Request to <${r}> timed out after ${n.timeout}ms`,h)):Lhl(h)}finally{u&&clearTimeout(u),d.cleanup()}}async disconnectAll(){await this.resetDispatchers()}async getDispatcher(r){let n=await this.certificateConfigurator.getCertificates(),o=n?n.join("\0"):"";this.dispatcherCertsKey!==o&&(F9.info(this.ctx,"Root certificate set changed; resetting Undici dispatchers.",{certificateCount:n?.length??0}),await this.resetDispatchers()),this.dispatcherCertsKey=o;let s={allowH2:!0,ca:n,rejectUnauthorized:this.settings.proxyStrictSSL??!0};return!this.settings.proxy||this.shouldBypassProxy(r)?(this.noProxyAgent||(F9.debug(this.ctx,"Creating direct Undici agent.",{target:Y2t(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new lse.Agent({allowH2:!0,connect:s})),{dispatcher:this.noProxyAgent,isProxy:!1}):(this.proxyAgent||(this.proxyAgent=this.buildProxyAgent(s)),{dispatcher:this.proxyAgent,isProxy:!0})}buildProxyAgent(r){let n=this.settings.proxy,o=new URL(n),s=(0,lse.buildConnector)(r);return F9.debug(this.ctx,"Creating proxied Undici agent.",{proxy:tmo(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new lse.Agent({allowH2:!0,connect:a((c,l)=>{let u=c.port!==void 0&&c.port!==""?Number(c.port):c.protocol==="https:"?443:80,d={hostname:c.hostname,port:u,headers:{}};this.proxySocketFactory.createSocket(d,{hostname:o.hostname,port:o.port,authorization:this.settings.proxyAuthorization,kerberosServicePrincipal:this.settings.proxyKerberosServicePrincipal}).then(f=>{if(c.protocol!=="https:"){l(null,f);return}s({...c,httpSocket:f},l)}).catch(f=>{l(f instanceof Error?f:new Error(String(f)),null)})},"connect")})}async resetDispatchers(){let r=this.noProxyAgent,n=this.proxyAgent;this.noProxyAgent=void 0,this.proxyAgent=void 0,this.dispatcherCertsKey=void 0,(r||n)&&F9.debug(this.ctx,"Closing Undici dispatchers.",{hasDirectAgent:!!r,hasProxyAgent:!!n}),await Promise.all([r?.close().catch(()=>{}),n?.close().catch(()=>{})])}updateNoProxyFilters(r){let n=(r??[]).map(s=>s.trim()).filter(s=>s.length>0);if(this.noProxyFilters=void 0,n.length===0)return;if(n.includes("*")){this.noProxyFilters=[{regex:/.*/i}];return}let o=[];for(let s of n){let{host:c,port:l}=Nhl(s),u=Mhl(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:tmo(this.settings.proxy),noProxyCount:this.settings.noProxy?.length??0,proxyStrictSSL:this.settings.proxyStrictSSL,hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal}}shouldBypassProxy(r){if(!this.noProxyFilters?.length)return!1;let n;try{n=new URL(r)}catch{return!1}let o=n.hostname;if(!o)return!1;let s=n.port||(n.protocol==="https:"?"443":"80"),c=o.toLowerCase();return this.noProxyFilters.some(l=>l.regex.test(c)&&(!l.port||l.port===s))}};function Nhl(t){if(t.startsWith("[")){let r=t.indexOf("]");if(r!==-1){let n=t.slice(1,r),o=t.slice(r+1);return{host:n,port:o.startsWith(":")?o.slice(1):void 0}}}let e=t.split(":");return e.length===2?{host:e[0],port:e[1]}:{host:t}}a(Nhl,"splitHostPort");function Mhl(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a(Mhl,"compileHostPattern");function Y2t(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(Y2t,"describeUrl");function tmo(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(tmo,"describeProxy");function Ohl(t){if(!t||t instanceof AbortSignal)return{signal:t,cleanup:a(()=>{},"cleanup")};let e=new AbortController,r=a(()=>e.abort(),"abort");return t.addEventListener("abort",r),t.aborted&&e.abort(),{signal:e.signal,cleanup:a(()=>t.removeEventListener("abort",r),"cleanup")}}a(Ohl,"toNativeAbortSignal");function Lhl(t){if(!(t instanceof Error)||!("cause"in t)||!t.cause||typeof t.cause!="object")return t;let e=t.cause,r=new Error(t.message,{cause:t.cause});r.stack=t.stack,r.name=t.name,r.code=t.code??e.code,r.syscall=t.syscall??e.syscall,r.errno=t.errno??e.errno;let n=e.statusCode;return typeof n=="number"&&(r.statusCode=n),r}a(Lhl,"withCauseNetworkProperties");p();var h9e=new pe("fetcher"),Bhl="https://default.exp-tas.com/",m9e=class extends Jt{constructor(r,n,o,s){super();this.ctx=r;this.defaultFetcher=n;this.fallbackFetcher=o;this.onFallbackSuccess=s}static{a(this,"FallbackFetcher")}async fetch(r,n){try{return await this.defaultFetcher.fetch(r,n)}catch(o){if(ig(o)||`${r}/`.startsWith(Bhl))throw o;h9e.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),h9e.info(this.ctx,`Fallback fetch for <${r}> succeeded.`),s}}getImplementation(){return this.defaultFetcher.getImplementation()}get name(){return this.defaultFetcher.name}async disconnectAll(){await this.defaultFetcher.disconnectAll()}},J2t=class extends Jt{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new m9e(r,n,o,(s,c)=>{this.current!==o&&(h9e.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,Hs(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:Uhl(c),...Qhl(s),...qhl(r)}),n.disconnectAll().catch(l=>{h9e.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(h9e.info(this.ctx,`Re-arming sticky fallback; ${this.primary.name} will be retried on the next request.`),this.current=this.default)}get name(){return this.current.name}getImplementation(){return this.current.getImplementation()}fetch(r,n){return this.current.fetch(r,n)}async disconnectAll(){await Promise.all([this.primary.disconnectAll(),this.secondary.disconnectAll()])}},Fhl=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function Uhl(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return Fhl.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(Uhl,"describeHost");function Qhl(t){try{if(!(t instanceof Error)||!t.cause)return{};let e=t.cause;Array.isArray(e.errors)&&e.errors.length>0&&e.errors[0]instanceof Error&&(e=e.errors[0]);let r={};for(let[n,o]of Object.entries({errorCauseName:e.name,errorCauseCode:e.code,errorCauseSyscall:e.syscall}))typeof o=="string"&&o&&(r[n]=o.slice(0,100));return typeof e.statusCode=="number"&&(r.errorCauseStatusCode=String(e.statusCode)),r}catch{return{}}}a(Qhl,"buildErrorCauseProperties");function qhl(t){try{let e=t.get(Qo).getHttpSettings(),r=!!e.proxy,n="none";return r&&(n=e.proxyKerberosServicePrincipal?"kerberos":e.proxyAuthorization?"basic":"none"),{proxyConfigured:r?"true":"false",proxyAuth:n,proxyStrictSSL:e.proxyStrictSSL!==!1?"true":"false"}}catch{return{}}}a(qhl,"describeHttpContext");var nmo=new pe("fetcher");function jhl(t){return kt(t,ze.UseHelixFetcher)==="true"}a(jhl,"isHelixFetcherForced");function Hhl(t){if(jhl(t))return new Noe(t);let e=new J2t(t,new K2t(t),new Noe(t));return t.get(Qo).onDidChangeHttpSettings(()=>e.reset()),e}a(Hhl,"createDefaultFetcher");var Z2t=class extends Jt{constructor(r,n=Hhl(r),o=new fCe(r)){super();this.ctx=r;this.defaultFetcher=n;this.editorFetcher=o;this.updateFetcher=a(()=>{let r,n;if(!this.editorFetcherCapability)n=`Using ${this.defaultFetcher.name}, editor does not have fetch capability.`,r=this.defaultFetcher;else if(this.fetchStrategy==="client")n="Using editor fetcher, fetch strategy set to client.",r=this.editorFetcher;else if(this.fetchStrategy==="native")n=`Using ${this.defaultFetcher.name}, fetch strategy set to native.`,r=this.defaultFetcher;else{let o=kt(this.ctx,ze.DebugUseEditorFetcher);o?.toString()==="true"?(n="Using editor fetcher, debug flag is enabled.",r=this.editorFetcher):o?.toString()==="false"?(n=`Using ${this.defaultFetcher.name}, debug flag is disabled.`,r=this.defaultFetcher):(n="Editor fetcher capability available, will fallback if needed.",r=this.fallbackFetcher)}this.currentFetcher!=r&&(nmo.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new m9e(r,n,o,()=>{nmo.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(Nn).onDidSetCapabilities(this.updateFetcher),r.get(Qo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return kt(this.ctx,ze.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(Nn).getCapabilities().fetch??!1}getImplementation(){return this.currentFetcher.getImplementation()}get name(){return this.currentFetcher.name}fetch(r,n){return this.currentFetcher.fetch(r,n)}async disconnectAll(){await Promise.all([this.defaultFetcher.disconnectAll(),this.editorFetcher.disconnectAll()])}};p();var eDt=fe(ii());var X2t=class extends ss{constructor(r){super();this.ctx=r}static{a(this,"ConnectionNotificationSender")}get connection(){return this.ctx.get(er).connection}showWarningMessage(r,...n){return this.connection.window.showWarningMessage(r,...n)}showInformationMessage(r,...n){return this.connection.window.showInformationMessage(r,...n)}showInformationModal(r,...n){return this.connection.sendRequest(eDt.ShowMessageRequest.type,{type:eDt.MessageType.Info,message:r,actions:n,modal:!0}).then(o=>o||void 0)}async sendBackgroundAgentSessionUpdate(r,n,o,s){await this.connection.sendNotification("backgroundAgent/sessionUpdate",{sessionId:r,event:n,agentProvider:o,turnIndex:s})}async sendBackgroundAgentTodosChanged(r){await this.connection.sendNotification("backgroundAgent/todosChanged",r)}};p();var imo=fe(Wc());var tDt=class t extends CJ{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new imo.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(er).connection.sendNotification(t.notificationType,r)}};p();var omo=fe(Wc());var rDt=class t extends Uq{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new omo.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(er).connection.sendNotification(t.notificationType,r)}};p();var smo=fe(Wc());var Ghl=new smo.ProtocolNotificationType("$/copilot/rateLimitWarning"),nDt=class extends pT{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(er).connection.sendNotification(Ghl,r)}};p();p();var iDt=class extends EKe{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get(eM).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get(eM).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get(eM);this._watcher=e.onDidChangeWatchedFiles(this.onDidChangeWatchedFilesHandler.bind(this)),this.status="ready"}stopWatching(){this.status="stopped",this._watcher?.dispose(),this._watcher=void 0}onDidChangeWatchedFilesHandler(e){if(e.workspaceFolder.uri!==this.workspaceFolder.uri)return;let n=e.created.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);if(n.length){let c=n.map(l=>l.document).filter(l=>l!==void 0);this.emitFilesCreated(c)}let o=e.changed.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);if(o.length){let c=o.map(l=>l.document).filter(l=>l!==void 0);this.emitFilesUpdated(c)}let s=e.deleted.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);s.length&&this.emitFilesDeleted(s.map(c=>({uri:c.uri})))}};var oDt=class extends vw{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new iDt(this.ctx,e)}shouldStartWatching(e){return XE(this.ctx)?!!this.ctx.get(Nn).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped"):!1}};function sDt(t){let e=new Ib(process.env),r=bpo(e);r.set(Ib,e),r.set(Jt,new Z2t(r)),r.set(mc,new mc(r)),u9r(r,{});let n=bsn();r.set(Un,n),r.set(CA,new CA(r));let o=new g2t;r.set($h,o);let s=cmo.join(n.directory,v$r),c=tF.plaintextOnly();r.set(tF,c);let{repo:l,diagnostics:u}=r0n(r,s,c);r.set(QM,l),r.set(Or,new aGe(r,process.env)),r.set(pI,new pI(r)),r.set(xoe,new xoe(r));let d=new op(r,"agent");d.onInitialized(()=>i0n(r,u)),r.set(op,d),r.set(za,gno),r.set(fx,new fx),r.set(Ir,new Jj),r.set(Moe,ono()),r.set(Fu,new Fu),r.set(Go,Mho),r.set(ga,new u2t(r)),r.set(tte,new f2t(r)),r.set(vw,new oDt(r)),r.set(eM,new eM(r)),r.set(km,new km),r.set(Pm,pft(r,bXi)),r.set(eS,new eS(r)),r.set(O4,new Sge),fho(r),vKe(r),o0n(r),r.set(er,new er(r,t));let f=new ay([lho(r)]);r.set(ay,f),r.set(s9e,new s9e(r)),r.get(er).onDeactivation(()=>f.dispose()),r.set(u5,new d2t(r)),r.set(ss,new X2t(r)),n0n(r,u),r.set(Obe,new W2t(r)),r.set(gz,new V2t(r)),r.set(sg,new nCe(r)),r.set(ks,new k2t(r));let h=new o9e(r,t);r.set(o9e,h),r.set(eu,h),r.set(i9e,new i9e(r)),r.set(r9e,new r9e(r)),r.set(up,new up);let m=new HW(r);r.set($r,m),r.set(HW,m),r.set(og,new ACe(r,process.env)),r.set(sP,new _se),r.set(pc,new pc(r)),xho(r),eho(r),r.set(sM,new sM),r.set(OW,new OW),r.set(cM,new cM),r.set(LW,new LW([])),r.set(fI,new A2t),r.set(amo.ObservableWorkspace,new yW(r,!0,!0)),r.set(z4,new _Ce),r.set(t9,new t9),r.set(fC,new fC(r)),r.set(Ay,new tIt(r)),r.set(tv,new R2t(r)),r.set(ef,new w2t(r)),r.set(qw,new qw(r)),r.set(vs,new vs(r)),r.set(e8,new e8(r)),r.set(r8,new r8(r)),r.set(wT,new wT(r)),r.set(hZ,new hZ(r)),r.set(O5,new O5),r.set(wg,new wg),r.set(lM,new lM(r)),r.set(CE,new G2t(r)),r.set(hD,new $2t(r)),r.set(YF,new YF(r)),r.set(Jb,new N2t(r));let g=new SG(r);r.set(SG,g);let A=new gy(r,g,new D2t(r));r.set(gy,A),r.set(yR,new yR(g,A)),r.set(Zie,Izi(r)),r.set(pT,new nDt(r)),r.set(fee,new fee),r.set(Toe,new Toe),r.set(xm,new m2t(r)),r.set(vC,new p2t(r)),r.set(xM,new xM(r));let y=new QA(r);r.set(QA,y),r.set(Mf,new Mf(r,y)),r.set(D0,new D0(r,y)),r.set(Kd,new Kd(r,y)),r.set(xg,new xg(r,e,y));let _=new aF(r,y,n);r.set(aF,_),r.get(dT).addListener(_.lifecycleListener);let E=new XUe;r.set(XUe,E),r.set(Eg,new Kwt(r)),r.set(_0,new _0(r,E)),r.set(Hw,new Hw),r.set(kT,new kT(r)),r.set(Lj,new Lj(r)),r.set(kw,new f5([new p5,new h5])),r.set(Soe,new Soe(r)),r.set(ov,new ov(r)),r.set(Uq,new rDt(r)),r.set(CJ,new tDt(r)),r.set(cI,new cI(r)),r.set(Ys,new Ys(r));let v=new Ca(r);r.set(Ca,v),r.set(Rm,new Rm),r.set(Fee,new Fee(r)),r.set(t6,new t6(r,new QPt)),r.set(noe,new noe(r)),r.set(toe,new toe(r)),r.set(Va,new Va(r)),r.set(i5,new P2t(r)),r.set(oM,new oM(r)),r.set(Lk,new Lk(r.get(oM),r)),r.set(T5,new T5(r)),r.set(KI,new y2t(r)),r.set(Cb,new Cb(r.get(Lk),r.get(KI),r)),r.set(N0,new N0(r));let S=new J8(r,v);return r.set(J8,S),r.set(Ooe,new Ooe(r,v)),r.get(er).onActivation(()=>{S.ensureInitialSync()}),r}a(sDt,"createLanguageServerContext");var wM=new pe("ACP");async function lmo(t){let e=t.get(As);wM.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(Ib).markReady(),t.get(ih).githubAppId=Vce,Whl(t),Vhl(t),t.get(Nn).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Qt).primeToken()?wM.info(t,"Token primed successfully"):wM.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(op).initialize(!0),UEn()?await $hl(t):(Vu(t,"acp.server.start",{acpPipeline:"internal"}),await umo(t))}a(lmo,"startACPServer");async function umo(t){wM.info(t,"Starting ACP server with internal pipeline");let e=Fbe.Writable.toWeb(process.stdout),r=Fbe.Readable.toWeb(process.stdin),n=_Pe(e,r),o=new EPe(s=>new nRt(s,t),n);o.signal.addEventListener("abort",()=>{wM.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(umo,"startACPServerInternal");async function $hl(t){wM.info(t,"Starting ACP server with CLI proxy"),Vu(t,"acp.cli.discover");let e;try{e=await QEn()}catch(u){let d=u instanceof Error?u.message:String(u);wM.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),bCe(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await umo(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;wM.info(t,`Found Copilot CLI: ${r} v${e.version}`),Vu(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new iRt(e,t),o=Fbe.Writable.toWeb(process.stdout),s=Fbe.Readable.toWeb(process.stdin),c=_Pe(o,s),l=new EPe(u=>new sRt(u,t,n),c);l.signal.addEventListener("abort",()=>{wM.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a($hl,"startACPServerWithCLI");function Vhl(t){let e=t.get(vs);e.registerTool(new Bj({name:"create_file",description:"Create a new file in the workspace with the specified content.",inputSchema:b.Object({filePath:b.String({description:"The absolute path of the file to create."}),content:b.String({description:"The content to write to the new file."})})})),e.registerTool(new Bj({name:"insert_edit_into_file",description:"Edit an existing file by inserting, replacing, or deleting content.",inputSchema:b.Object({filePath:b.String({description:"The absolute path of the file to edit."}),content:b.Optional(b.String({description:"The new content for the file."})),edits:b.Optional(b.Array(b.Object({startLine:b.Number({description:"The starting line number (1-based)."}),endLine:b.Number({description:"The ending line number (1-based)."}),newContent:b.String({description:"The new content to replace the range with."})})))})})),e.registerTool(new Bj({name:"replace_string_in_file",description:"Replace a specific string in a file with a new string.",inputSchema:b.Object({filePath:b.String({description:"The absolute path of the file to edit."}),oldString:b.String({description:"The string to find and replace."}),newString:b.String({description:"The string to replace it with."})})})),wM.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(Vhl,"registerACPClientTools");function dmo(){let e=sDt({onRequest:a(()=>{},"onRequest"),onNotification:a(()=>{},"onNotification"),listen:a(()=>{},"listen"),sendNotification:a(()=>{},"sendNotification"),sendRequest:a(()=>Promise.resolve({}),"sendRequest"),workspace:{onDidChangeWorkspaceFolders:a(()=>{},"onDidChangeWorkspaceFolders")},client:{register:a(()=>Promise.resolve({}),"register")},console:{log:a(()=>{},"log"),info:a(()=>{},"info"),warn:a(()=>{},"warn"),error:a(()=>{},"error")},window:{showWarningMessage:a(()=>Promise.resolve(void 0),"showWarningMessage"),showInformationMessage:a(()=>Promise.resolve(void 0),"showInformationMessage")}}),r=new GW(e);return e.forceSet(tv,r),{ctx:e,acpToolInvoker:r}}a(dmo,"createACPContext");function Whl(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(wM.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),eqe(t,r))}a(Whl,"configureGitHubEnterpriseUrl");p();var VGr=require("events"),g9e=fe(require("fs"));sWe();var cDt=fe(Wc());p();var pmo=fe(require("fs")),hmo=fe(require("http")),Ube=fe(require("path"));var aDt=class{constructor(e,r){this.port=e;let n;this.server=hmo.createServer((o,s)=>{if(o.headers.accept&&o.headers.accept=="text/event-stream")switch(s.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),o.url){case"/stdin":r.on("read",l=>{fmo(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{fmo(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;Ube.basename(__dirname)!=="debug"&&(c=Ube.dirname(__dirname)),n??=pmo.readFileSync(Ube.join(c,"dist","debugServer.html")).toString(),s.write(n),s.end()}),this.server.on("error",o=>{console.error(o)})}static{a(this,"DebugServer")}listen(){return this.server.listen(this.port),this}getPort(){return this.server.address().port}};function fmo(t,e){t.write("data: "+e.toString().replace(/\n/g,` data: `)+` -`)}a(umo,"writeData");var VGr=class extends aDt.AbstractMessageWriter{constructor(r,n){super();this.delegate=r;this.ev=n}static{a(this,"DebugMessageWriter")}async write(r){return this.ev.emit("write",r),this.delegate.write(r)}end(){this.ev.emit("end"),this.delegate.end()}},WGr=class extends aDt.AbstractMessageReader{constructor(r,n){super();this.delegate=r;this.ev=n}static{a(this,"DebugMessageReader")}listen(r){return this.delegate.listen(n=>{this.ev.emit("read",n),r(n)})}};async function pmo(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new $Gr.EventEmitter;let l=new sDt(o,n).listen();o===0&&await axe(`http://localhost:${l.getPort()}`)}let s=t.GITHUB_COPILOT_RECORD??"",c;try{let l=Date.now().toString();s==="1"||s==="true"?c=g9e.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=g9e.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&g9e.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new $Gr.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} +`)}a(fmo,"writeData");var WGr=class extends cDt.AbstractMessageWriter{constructor(r,n){super();this.delegate=r;this.ev=n}static{a(this,"DebugMessageWriter")}async write(r){return this.ev.emit("write",r),this.delegate.write(r)}end(){this.ev.emit("end"),this.delegate.end()}},zGr=class extends cDt.AbstractMessageReader{constructor(r,n){super();this.delegate=r;this.ev=n}static{a(this,"DebugMessageReader")}listen(r){return this.delegate.listen(n=>{this.ev.emit("read",n),r(n)})}};async function mmo(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new VGr.EventEmitter;let l=new aDt(o,n).listen();o===0&&await axe(`http://localhost:${l.getPort()}`)}let s=t.GITHUB_COPILOT_RECORD??"",c;try{let l=Date.now().toString();s==="1"||s==="true"?c=g9e.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=g9e.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&g9e.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new VGr.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} `)),n.on("write",u=>l(`--> ${JSON.stringify(u)} -`))}return n&&(e=new WGr(e,n),r=new VGr(r,n)),[e,r]}a(pmo,"wrapTransports");p();var cDt=fe(require("fs/promises")),hmo=fe(require("os")),mmo=fe(require("path"));var Vhl={tmpdir:a(()=>hmo.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function gmo(t=Vhl){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await cDt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await cDt.mkdtemp(mmo.join(e,"github-copilot-"))}}a(gmo,"mitigateTempFolder");function Pml(){let t=process.env.GH_COPILOT_DEBUG??process.env.GITHUB_COPILOT_DEBUG;return process.argv.includes("--debug")||t!==void 0&&t!=="0"&&t.toLowerCase()!=="false"}a(Pml,"shouldEnableSourceMapSupport");Pml()&&Jmo();async function Xmo(){let t=NEn(process.argv.slice(2)).version(new As().getDisplayVersion()).strict().option("debug",{type:"boolean",hidden:!0}).option("clientProcessId",{type:"string",hidden:!0}).option("stdio",{type:"boolean",describe:"Use stdio"}).option("acp",{type:"boolean",describe:"Run as Agent Client Protocol (ACP) agent"});"pkg"in process||t.option("node-ipc",{type:"boolean",describe:"Use node IPC",conflicts:"stdio"});let e=await t.parse();if(e.acp){let{ctx:u}=lmo();await S9t(u),await amo(u);return}let r,n;e["node-ipc"]?(r=new iP.IPCMessageReader(process),n=new iP.IPCMessageWriter(process)):e.stdio?(r=new iP.StreamMessageReader(process.stdin),n=new iP.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await gmo();let o=(0,iP.createConnection)(iP.ProposedFeatures.all,...await pmo(process.env,r,n)),s=oDt(o);console=ayn(s),await S9t(s);let c=s.get(er),l=new jK(s);s.set(jK,l),c.onActivation(()=>{l.start(),o0n()}),Dml(c,r),c.listen()}a(Xmo,"main");function Dml(t,e){let r=!1,n=a((o,s)=>{r||(r=!0,console.error(`copilot-language-server: shutting down (${o})`),t.onExit().finally(()=>process.exit(s)).catch(()=>{}),setTimeout(()=>process.kill(process.pid,"SIGKILL"),500))},"shutdown");e.onClose(()=>n("reader closed",0)),process.on("SIGINT",()=>n("SIGINT",130)),process.on("SIGTERM",()=>n("SIGTERM",143))}a(Dml,"setupExitHandlers");Zmo.isMainThread?require.main===module&&Xmo():(x0n()&&w0n(),_7t()&&syn());0&&(module.exports={getTokenizer,getTokenizerAsync,main}); +`))}return n&&(e=new zGr(e,n),r=new WGr(r,n)),[e,r]}a(mmo,"wrapTransports");p();var lDt=fe(require("fs/promises")),gmo=fe(require("os")),Amo=fe(require("path"));var zhl={tmpdir:a(()=>gmo.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function ymo(t=zhl){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await lDt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await lDt.mkdtemp(Amo.join(e,"github-copilot-"))}}a(ymo,"mitigateTempFolder");function Nml(){let t=process.env.GH_COPILOT_DEBUG??process.env.GITHUB_COPILOT_DEBUG;return process.argv.includes("--debug")||t!==void 0&&t!=="0"&&t.toLowerCase()!=="false"}a(Nml,"shouldEnableSourceMapSupport");Nml()&&Xmo();async function tgo(){let t=MEn(process.argv.slice(2)).version(new As().getDisplayVersion()).strict().option("debug",{type:"boolean",hidden:!0}).option("clientProcessId",{type:"string",hidden:!0}).option("stdio",{type:"boolean",describe:"Use stdio"}).option("acp",{type:"boolean",describe:"Run as Agent Client Protocol (ACP) agent"});"pkg"in process||t.option("node-ipc",{type:"boolean",describe:"Use node IPC",conflicts:"stdio"});let e=await t.parse();if(e.acp){let{ctx:u}=dmo();await T9t(u),await lmo(u);return}let r,n;e["node-ipc"]?(r=new iP.IPCMessageReader(process),n=new iP.IPCMessageWriter(process)):e.stdio?(r=new iP.StreamMessageReader(process.stdin),n=new iP.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await ymo();let o=(0,iP.createConnection)(iP.ProposedFeatures.all,...await mmo(process.env,r,n)),s=sDt(o);console=cyn(s),await T9t(s);let c=s.get(er),l=new HK(s);s.set(HK,l),c.onActivation(()=>{l.start(),s0n()}),Mml(c,r),c.listen()}a(tgo,"main");function Mml(t,e){let r=!1,n=a((o,s)=>{r||(r=!0,console.error(`copilot-language-server: shutting down (${o})`),t.onExit().finally(()=>process.exit(s)).catch(()=>{}),setTimeout(()=>process.kill(process.pid,"SIGKILL"),500))},"shutdown");e.onClose(()=>n("reader closed",0)),process.on("SIGINT",()=>n("SIGINT",130)),process.on("SIGTERM",()=>n("SIGTERM",143))}a(Mml,"setupExitHandlers");ego.isMainThread?require.main===module&&tgo():(w0n()&&R0n(),E7t()&&ayn());0&&(module.exports={getTokenizer,getTokenizerAsync,main}); //!!! DO NOT modify, this file was COPIED from 'microsoft/vscode' /*! Bundled license information: diff --git a/lua/copilot/util.lua b/lua/copilot/util.lua index c3f011e6..c124d7c6 100644 --- a/lua/copilot/util.lua +++ b/lua/copilot/util.lua @@ -21,7 +21,7 @@ function M.get_editor_info() editorPluginInfo = { name = "copilot.lua", -- reflects version of github/copilot-language-server-release - version = "1.527.1", + version = "1.527.3", }, } return info